Merge webkit.org at r58033 : Initial merge by git

Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
diff --git a/Android.mk b/Android.mk
index e73f5b8..ee1104d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -39,6 +39,8 @@
 #    To help setup buildbot, a new environment variable, USE_ALT_JS_ENGINE,
 #    can be set to true, so that two builds can be different but without
 #    specifying which JS engine to use.
+# To enable JIT in Android's JSC, please set ENABLE_JSC_JIT environment
+# variable to true.
 
 # To enable JIT in Android's JSC, please set ENABLE_JSC_JIT environment
 # variable to true.
diff --git a/JavaScriptCore/API/APICast.h b/JavaScriptCore/API/APICast.h
index 4284c44..ba00d02 100644
--- a/JavaScriptCore/API/APICast.h
+++ b/JavaScriptCore/API/APICast.h
@@ -29,7 +29,6 @@
 #include "JSAPIValueWrapper.h"
 #include "JSGlobalObject.h"
 #include "JSValue.h"
-#include <wtf/Platform.h>
 #include <wtf/UnusedParam.h>
 
 namespace JSC {
diff --git a/JavaScriptCore/API/APIShims.h b/JavaScriptCore/API/APIShims.h
index 9a6cacb..3d42ca2 100644
--- a/JavaScriptCore/API/APIShims.h
+++ b/JavaScriptCore/API/APIShims.h
@@ -28,6 +28,7 @@
 
 #include "CallFrame.h"
 #include "JSLock.h"
+#include <wtf/WTFThreadData.h>
 
 namespace JSC {
 
@@ -35,7 +36,7 @@
 protected:
     APIEntryShimWithoutLock(JSGlobalData* globalData, bool registerThread)
         : m_globalData(globalData)
-        , m_entryIdentifierTable(setCurrentIdentifierTable(globalData->identifierTable))
+        , m_entryIdentifierTable(wtfThreadData().setCurrentIdentifierTable(globalData->identifierTable))
     {
         if (registerThread)
             globalData->heap.registerThread();
@@ -45,7 +46,7 @@
     ~APIEntryShimWithoutLock()
     {
         m_globalData->timeoutChecker.stop();
-        setCurrentIdentifierTable(m_entryIdentifierTable);
+        wtfThreadData().setCurrentIdentifierTable(m_entryIdentifierTable);
     }
 
 private:
@@ -79,12 +80,12 @@
         : m_dropAllLocks(exec)
         , m_globalData(&exec->globalData())
     {
-        resetCurrentIdentifierTable();
+        wtfThreadData().resetCurrentIdentifierTable();
     }
 
     ~APICallbackShim()
     {
-        setCurrentIdentifierTable(m_globalData->identifierTable);
+        wtfThreadData().setCurrentIdentifierTable(m_globalData->identifierTable);
     }
 
 private:
diff --git a/JavaScriptCore/API/JSCallbackFunction.cpp b/JavaScriptCore/API/JSCallbackFunction.cpp
index 0e434d9..63c8add 100644
--- a/JavaScriptCore/API/JSCallbackFunction.cpp
+++ b/JavaScriptCore/API/JSCallbackFunction.cpp
@@ -24,7 +24,6 @@
  */
 
 #include "config.h"
-#include <wtf/Platform.h>
 #include "JSCallbackFunction.h"
 
 #include "APIShims.h"
diff --git a/JavaScriptCore/API/JSCallbackObject.h b/JavaScriptCore/API/JSCallbackObject.h
index adb5b60..1cf7a02 100644
--- a/JavaScriptCore/API/JSCallbackObject.h
+++ b/JavaScriptCore/API/JSCallbackObject.h
@@ -33,6 +33,84 @@
 
 namespace JSC {
 
+struct JSCallbackObjectData {
+    JSCallbackObjectData(void* privateData, JSClassRef jsClass)
+        : privateData(privateData)
+        , jsClass(jsClass)
+    {
+        JSClassRetain(jsClass);
+    }
+    
+    ~JSCallbackObjectData()
+    {
+        JSClassRelease(jsClass);
+    }
+    
+    JSValue getPrivateProperty(const Identifier& propertyName) const
+    {
+        if (!m_privateProperties)
+            return JSValue();
+        return m_privateProperties->getPrivateProperty(propertyName);
+    }
+    
+    void setPrivateProperty(const Identifier& propertyName, JSValue value)
+    {
+        if (!m_privateProperties)
+            m_privateProperties.set(new JSPrivatePropertyMap);
+        m_privateProperties->setPrivateProperty(propertyName, value);
+    }
+    
+    void deletePrivateProperty(const Identifier& propertyName)
+    {
+        if (!m_privateProperties)
+            return;
+        m_privateProperties->deletePrivateProperty(propertyName);
+    }
+
+    void markChildren(MarkStack& markStack)
+    {
+        if (!m_privateProperties)
+            return;
+        m_privateProperties->markChildren(markStack);
+    }
+
+    void* privateData;
+    JSClassRef jsClass;
+    struct JSPrivatePropertyMap {
+        JSValue getPrivateProperty(const Identifier& propertyName) const
+        {
+            PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.ustring().rep());
+            if (location == m_propertyMap.end())
+                return JSValue();
+            return location->second;
+        }
+        
+        void setPrivateProperty(const Identifier& propertyName, JSValue value)
+        {
+            m_propertyMap.set(propertyName.ustring().rep(), value);
+        }
+        
+        void deletePrivateProperty(const Identifier& propertyName)
+        {
+            m_propertyMap.remove(propertyName.ustring().rep());
+        }
+
+        void markChildren(MarkStack& markStack)
+        {
+            for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) {
+                if (ptr->second)
+                    markStack.append(ptr->second);
+            }
+        }
+
+    private:
+        typedef HashMap<RefPtr<UString::Rep>, JSValue, IdentifierRepHash> PrivatePropertyMap;
+        PrivatePropertyMap m_propertyMap;
+    };
+    OwnPtr<JSPrivatePropertyMap> m_privateProperties;
+};
+
+    
 template <class Base>
 class JSCallbackObject : public Base {
 public:
@@ -52,6 +130,21 @@
     { 
         return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), Base::AnonymousSlotCount); 
     }
+    
+    JSValue getPrivateProperty(const Identifier& propertyName) const
+    {
+        return m_callbackObjectData->getPrivateProperty(propertyName);
+    }
+    
+    void setPrivateProperty(const Identifier& propertyName, JSValue value)
+    {
+        m_callbackObjectData->setPrivateProperty(propertyName, value);
+    }
+    
+    void deletePrivateProperty(const Identifier& propertyName)
+    {
+        m_callbackObjectData->deletePrivateProperty(propertyName);
+    }
 
 protected:
     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | Base::StructureFlags;
@@ -79,6 +172,12 @@
     virtual CallType getCallData(CallData&);
     virtual const ClassInfo* classInfo() const { return &info; }
 
+    virtual void markChildren(MarkStack& markStack)
+    {
+        Base::markChildren(markStack);
+        m_callbackObjectData->markChildren(markStack);
+    }
+
     void init(ExecState*);
  
     static JSCallbackObject* asCallbackObject(JSValue);
@@ -86,27 +185,10 @@
     static JSValue JSC_HOST_CALL call(ExecState*, JSObject* functionObject, JSValue thisValue, const ArgList&);
     static JSObject* construct(ExecState*, JSObject* constructor, const ArgList&);
    
-    static JSValue staticValueGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue staticFunctionGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue callbackGetter(ExecState*, const Identifier&, const PropertySlot&);
+    static JSValue staticValueGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue staticFunctionGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue callbackGetter(ExecState*, JSValue, const Identifier&);
 
-    struct JSCallbackObjectData {
-        JSCallbackObjectData(void* privateData, JSClassRef jsClass)
-            : privateData(privateData)
-            , jsClass(jsClass)
-        {
-            JSClassRetain(jsClass);
-        }
-        
-        ~JSCallbackObjectData()
-        {
-            JSClassRelease(jsClass);
-        }
-        
-        void* privateData;
-        JSClassRef jsClass;
-    };
-    
     OwnPtr<JSCallbackObjectData> m_callbackObjectData;
 };
 
diff --git a/JavaScriptCore/API/JSCallbackObjectFunctions.h b/JavaScriptCore/API/JSCallbackObjectFunctions.h
index 4b28a99..6c83eb4 100644
--- a/JavaScriptCore/API/JSCallbackObjectFunctions.h
+++ b/JavaScriptCore/API/JSCallbackObjectFunctions.h
@@ -516,9 +516,9 @@
 }
 
 template <class Base>
-JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
+    JSCallbackObject* thisObj = asCallbackObject(slotBase);
     
     JSObjectRef thisRef = toRef(thisObj);
     RefPtr<OpaqueJSString> propertyNameRef;
@@ -547,9 +547,9 @@
 }
 
 template <class Base>
-JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
+    JSCallbackObject* thisObj = asCallbackObject(slotBase);
     
     // Check for cached or override property.
     PropertySlot slot2(thisObj);
@@ -572,9 +572,9 @@
 }
 
 template <class Base>
-JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
+    JSCallbackObject* thisObj = asCallbackObject(slotBase);
     
     JSObjectRef thisRef = toRef(thisObj);
     RefPtr<OpaqueJSString> propertyNameRef;
diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp
index 717488f..3e65b75 100644
--- a/JavaScriptCore/API/JSClassRef.cpp
+++ b/JavaScriptCore/API/JSClassRef.cpp
@@ -33,6 +33,7 @@
 #include <runtime/JSGlobalObject.h>
 #include <runtime/ObjectPrototype.h>
 #include <runtime/Identifier.h>
+#include <wtf/text/StringHash.h>
 #include <wtf/unicode/UTF8.h>
 
 using namespace std;
@@ -111,7 +112,8 @@
 
 OpaqueJSClass::~OpaqueJSClass()
 {
-    ASSERT(!m_className.rep()->isIdentifier());
+    // The empty string is shared across threads & is an identifier, in all other cases we should have done a deep copy in className(), below. 
+    ASSERT(!m_className.size() || !m_className.rep()->isIdentifier());
 
     if (m_staticValues) {
         OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end();
@@ -171,7 +173,7 @@
             ASSERT(!it->first->isIdentifier());
             // Use a local variable here to sidestep an RVCT compiler bug.
             StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes);
-            staticValues->add(UString::Rep::create(it->first->data(), it->first->length()), entry);
+            staticValues->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
         }
     } else
         staticValues = 0;
@@ -183,7 +185,7 @@
             ASSERT(!it->first->isIdentifier());
             // Use a local variable here to sidestep an RVCT compiler bug.
             StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes);
-            staticFunctions->add(UString::Rep::create(it->first->data(), it->first->length()), entry);
+            staticFunctions->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
         }
             
     } else
diff --git a/JavaScriptCore/API/JSContextRef.cpp b/JavaScriptCore/API/JSContextRef.cpp
index 2c76338..06f9274 100644
--- a/JavaScriptCore/API/JSContextRef.cpp
+++ b/JavaScriptCore/API/JSContextRef.cpp
@@ -33,7 +33,7 @@
 #include "JSClassRef.h"
 #include "JSGlobalObject.h"
 #include "JSObject.h"
-#include <wtf/Platform.h>
+#include <wtf/text/StringHash.h>
 
 #if OS(DARWIN)
 #include <mach-o/dyld.h>
@@ -46,7 +46,7 @@
 JSContextGroupRef JSContextGroupCreate()
 {
     initializeThreading();
-    return toRef(JSGlobalData::createNonDefault().releaseRef());
+    return toRef(JSGlobalData::createNonDefault(ThreadStackTypeSmall).releaseRef());
 }
 
 JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group)
@@ -84,7 +84,7 @@
     initializeThreading();
 
     JSLock lock(LockForReal);
-    RefPtr<JSGlobalData> globalData = group ? PassRefPtr<JSGlobalData>(toJS(group)) : JSGlobalData::createNonDefault();
+    RefPtr<JSGlobalData> globalData = group ? PassRefPtr<JSGlobalData>(toJS(group)) : JSGlobalData::createNonDefault(ThreadStackTypeSmall);
 
     APIEntryShim entryShim(globalData.get(), false);
 
@@ -123,19 +123,32 @@
     JSLock lock(exec);
 
     JSGlobalData& globalData = exec->globalData();
-    IdentifierTable* savedIdentifierTable = setCurrentIdentifierTable(globalData.identifierTable);
+    JSGlobalObject* dgo = exec->dynamicGlobalObject();
+    IdentifierTable* savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(globalData.identifierTable);
 
-    gcUnprotect(exec->dynamicGlobalObject());
+    // One reference is held by JSGlobalObject, another added by JSGlobalContextRetain().
+    bool releasingContextGroup = globalData.refCount() == 2;
+    bool releasingGlobalObject = Heap::heap(dgo)->unprotect(dgo);
+    // If this is the last reference to a global data, it should also
+    // be the only remaining reference to the global object too!
+    ASSERT(!releasingContextGroup || releasingGlobalObject);
 
-    if (globalData.refCount() == 2) { // One reference is held by JSGlobalObject, another added by JSGlobalContextRetain().
-        // The last reference was released, this is our last chance to collect.
+    // An API 'JSGlobalContextRef' retains two things - a global object and a
+    // global data (or context group, in API terminology).
+    // * If this is the last reference to any contexts in the given context group,
+    //   call destroy on the heap (the global data is being  freed).
+    // * If this was the last reference to the global object, then unprotecting
+    //   it may  release a lot of GC memory - run the garbage collector now.
+    // * If there are more references remaining the the global object, then do nothing
+    //   (specifically that is more protects, which we assume come from other JSGlobalContextRefs).
+    if (releasingContextGroup)
         globalData.heap.destroy();
-    } else
+    else if (releasingGlobalObject)
         globalData.heap.collectAllGarbage();
 
     globalData.deref();
 
-    setCurrentIdentifierTable(savedIdentifierTable);
+    wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable);
 }
 
 JSObjectRef JSContextGetGlobalObject(JSContextRef ctx)
diff --git a/JavaScriptCore/API/JSObjectRef.cpp b/JavaScriptCore/API/JSObjectRef.cpp
index faaa4eb..8fdbdab 100644
--- a/JavaScriptCore/API/JSObjectRef.cpp
+++ b/JavaScriptCore/API/JSObjectRef.cpp
@@ -26,6 +26,7 @@
 
 #include "config.h"
 #include "JSObjectRef.h"
+#include "JSObjectRefPrivate.h"
 
 #include "APICast.h"
 #include "CodeBlock.h"
@@ -48,7 +49,6 @@
 #include "ObjectPrototype.h"
 #include "PropertyNameArray.h"
 #include "RegExpConstructor.h"
-#include <wtf/Platform.h>
 
 using namespace JSC;
 
@@ -364,6 +364,55 @@
     return false;
 }
 
+JSValueRef JSObjectGetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSObject* jsObject = toJS(object);
+    JSValue result;
+    Identifier name(propertyName->identifier(&exec->globalData()));
+    if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info))
+        result = static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivateProperty(name);
+    else if (jsObject->inherits(&JSCallbackObject<JSObject>::info))
+        result = static_cast<JSCallbackObject<JSObject>*>(jsObject)->getPrivateProperty(name);
+    return toRef(exec, result);
+}
+
+bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSObject* jsObject = toJS(object);
+    JSValue jsValue = toJS(exec, value);
+    Identifier name(propertyName->identifier(&exec->globalData()));
+    if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) {
+        static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(name, jsValue);
+        return true;
+    }
+    if (jsObject->inherits(&JSCallbackObject<JSObject>::info)) {
+        static_cast<JSCallbackObject<JSObject>*>(jsObject)->setPrivateProperty(name, jsValue);
+        return true;
+    }
+    return false;
+}
+
+bool JSObjectDeletePrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSObject* jsObject = toJS(object);
+    Identifier name(propertyName->identifier(&exec->globalData()));
+    if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) {
+        static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->deletePrivateProperty(name);
+        return true;
+    }
+    if (jsObject->inherits(&JSCallbackObject<JSObject>::info)) {
+        static_cast<JSCallbackObject<JSObject>*>(jsObject)->deletePrivateProperty(name);
+        return true;
+    }
+    return false;
+}
+
 bool JSObjectIsFunction(JSContextRef, JSObjectRef object)
 {
     CallData callData;
diff --git a/JavaScriptCore/API/JSObjectRefPrivate.h b/JavaScriptCore/API/JSObjectRefPrivate.h
new file mode 100644
index 0000000..32e80ab
--- /dev/null
+++ b/JavaScriptCore/API/JSObjectRefPrivate.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 JSObjectRefPrivate_h
+#define JSObjectRefPrivate_h
+
+#include <JavaScriptCore/JSObjectRef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*!
+ @function
+ @abstract Sets a private property on an object.  This private property cannot be accessed from within JavaScript.
+ @param ctx The execution context to use.
+ @param object The JSObject whose private property you want to set.
+ @param propertyName A JSString containing the property's name.
+ @param value A JSValue to use as the property's value.  This may be NULL.
+ @result true if object can store private data, otherwise false.
+ @discussion This API allows you to store JS values directly an object in a way that will be ensure that they are kept alive without exposing them to JavaScript code and without introducing the reference cycles that may occur when using JSValueProtect.
+
+ The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private properties.
+ */
+JS_EXPORT bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value);
+
+/*!
+ @function
+ @abstract Gets a private property from an object.
+ @param ctx The execution context to use.
+ @param object The JSObject whose private property you want to get.
+ @param propertyName A JSString containing the property's name.
+ @result The property's value if object has the property, otherwise NULL.
+ */
+JS_EXPORT JSValueRef JSObjectGetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
+
+/*!
+ @function
+ @abstract Deletes a private property from an object.
+ @param ctx The execution context to use.
+ @param object The JSObject whose private property you want to delete.
+ @param propertyName A JSString containing the property's name.
+ @result true if object can store private data, otherwise false.
+ @discussion The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data.
+ */
+JS_EXPORT bool JSObjectDeletePrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // JSObjectRefPrivate_h
diff --git a/JavaScriptCore/API/JSValueRef.cpp b/JavaScriptCore/API/JSValueRef.cpp
index a12cc34..f5dcccc 100644
--- a/JavaScriptCore/API/JSValueRef.cpp
+++ b/JavaScriptCore/API/JSValueRef.cpp
@@ -26,19 +26,21 @@
 #include "config.h"
 #include "JSValueRef.h"
 
-#include <wtf/Platform.h>
 #include "APICast.h"
 #include "APIShims.h"
 #include "JSCallbackObject.h"
 
 #include <runtime/JSGlobalObject.h>
+#include <runtime/JSONObject.h>
 #include <runtime/JSString.h>
+#include <runtime/LiteralParser.h>
 #include <runtime/Operations.h>
 #include <runtime/Protect.h>
 #include <runtime/UString.h>
 #include <runtime/JSValue.h>
 
 #include <wtf/Assertions.h>
+#include <wtf/text/StringHash.h>
 
 #include <algorithm> // for std::min
 
@@ -222,6 +224,31 @@
     return toRef(exec, jsString(exec, string->ustring()));
 }
 
+JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    LiteralParser parser(exec, string->ustring(), LiteralParser::StrictJSON);
+    return toRef(exec, parser.tryLiteralParse());
+}
+
+JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef apiValue, unsigned indent, JSValueRef* exception)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSValue value = toJS(exec, apiValue);
+    UString result = JSONStringify(exec, value, indent);
+    if (exception)
+        *exception = 0;
+    if (exec->hadException()) {
+        if (exception)
+            *exception = toRef(exec, exec->exception());
+        exec->clearException();
+        return 0;
+    }
+    return OpaqueJSString::create(result).releaseRef();
+}
+
 bool JSValueToBoolean(JSContextRef ctx, JSValueRef value)
 {
     ExecState* exec = toJS(ctx);
diff --git a/JavaScriptCore/API/JSValueRef.h b/JavaScriptCore/API/JSValueRef.h
index 7a7bf93..4186db8 100644
--- a/JavaScriptCore/API/JSValueRef.h
+++ b/JavaScriptCore/API/JSValueRef.h
@@ -27,6 +27,7 @@
 #define JSValueRef_h
 
 #include <JavaScriptCore/JSBase.h>
+#include <JavaScriptCore/WebKitAvailability.h>
 
 #ifndef __cplusplus
 #include <stdbool.h>
@@ -208,6 +209,28 @@
 */
 JS_EXPORT JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string);
 
+/* Converting to and from JSON formatted strings */
+
+/*!
+ @function
+ @abstract       Creates a JavaScript value from a JSON formatted string.
+ @param ctx      The execution context to use.
+ @param string   The JSString containing the JSON string to be parsed.
+ @result         A JSValue containing the parsed value, or NULL if the input is invalid.
+ */
+JS_EXPORT JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string) AVAILABLE_AFTER_WEBKIT_VERSION_4_0;
+
+/*!
+ @function
+ @abstract       Creates a JavaScript string containing the JSON serialized representation of a JS value.
+ @param ctx      The execution context to use.
+ @param value    The value to serialize.
+ @param indent   The number of spaces to indent when nesting.  If 0, the resulting JSON will not contains newlines.  The size of the indent is clamped to 10 spaces.
+ @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
+ @result         A JSString with the result of serialization, or NULL if an exception is thrown.
+ */
+JS_EXPORT JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef value, unsigned indent, JSValueRef* exception) AVAILABLE_AFTER_WEBKIT_VERSION_4_0;
+
 /* Converting to primitive values */
 
 /*!
diff --git a/JavaScriptCore/API/JSWeakObjectMapRefInternal.h b/JavaScriptCore/API/JSWeakObjectMapRefInternal.h
new file mode 100644
index 0000000..64e1f4d
--- /dev/null
+++ b/JavaScriptCore/API/JSWeakObjectMapRefInternal.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 JSWeakObjectMapRefInternal_h
+#define JSWeakObjectMapRefInternal_h
+
+#include "WeakGCMap.h"
+#include <wtf/RefCounted.h>
+
+namespace JSC {
+
+class JSObject;
+
+}
+
+typedef void (*JSWeakMapDestroyedCallback)(struct OpaqueJSWeakObjectMap*, void*);
+
+typedef JSC::WeakGCMap<void*, JSC::JSObject*> WeakMapType;
+
+struct OpaqueJSWeakObjectMap : public RefCounted<OpaqueJSWeakObjectMap> {
+public:
+    static PassRefPtr<OpaqueJSWeakObjectMap> create(void* data, JSWeakMapDestroyedCallback callback)
+    {
+        return adoptRef(new OpaqueJSWeakObjectMap(data, callback));
+    }
+
+    WeakMapType& map() { return m_map; }
+    
+    ~OpaqueJSWeakObjectMap()
+    {
+        m_callback(this, m_data);
+    }
+
+private:
+    OpaqueJSWeakObjectMap(void* data, JSWeakMapDestroyedCallback callback)
+        : m_data(data)
+        , m_callback(callback)
+    {
+    }
+    WeakMapType m_map;
+    void* m_data;
+    JSWeakMapDestroyedCallback m_callback;
+};
+
+
+#endif // JSWeakObjectMapInternal_h
diff --git a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
new file mode 100644
index 0000000..e377ea0
--- /dev/null
+++ b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "JSWeakObjectMapRefPrivate.h"
+
+#include "APICast.h"
+#include "APIShims.h"
+#include "JSCallbackObject.h"
+#include "JSValue.h"
+#include "JSWeakObjectMapRefInternal.h"
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+
+using namespace WTF;
+using namespace JSC;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef context, void* privateData, JSWeakMapDestroyedCallback callback)
+{
+    ExecState* exec = toJS(context);
+    APIEntryShim entryShim(exec);
+    RefPtr<OpaqueJSWeakObjectMap> map = OpaqueJSWeakObjectMap::create(privateData, callback);
+    exec->lexicalGlobalObject()->registerWeakMap(map.get());
+    return map.get();
+}
+
+void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSObject* obj = toJS(object);
+    if (!obj)
+        return;
+    ASSERT(obj->inherits(&JSCallbackObject<JSGlobalObject>::info) || obj->inherits(&JSCallbackObject<JSObject>::info));
+    map->map().set(key, obj);
+}
+
+JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* key)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    return toRef(static_cast<JSObject*>(map->map().get(key)));
+}
+
+bool JSWeakObjectMapClear(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object)
+{
+    ExecState* exec = toJS(ctx);
+    APIEntryShim entryShim(exec);
+    JSObject* obj = toJS(object);
+    if (map->map().uncheckedRemove(key, obj))
+        return true;
+    return false;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.h b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.h
new file mode 100644
index 0000000..d36111c
--- /dev/null
+++ b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 JSWeakObjectMapRefPrivate_h
+#define JSWeakObjectMapRefPrivate_h
+
+#include <JavaScriptCore/JSContextRef.h>
+#include <JavaScriptCore/JSValueRef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+    
+/*! @typedef JSWeakObjectMapRef A weak map for storing JSObjectRefs */
+typedef struct OpaqueJSWeakObjectMap* JSWeakObjectMapRef;
+
+/*! 
+ @typedef JSWeakMapDestroyedCallback
+ @abstract The callback invoked when a JSWeakObjectMapRef is being destroyed.
+ @param map The map that is being destroyed.
+ @param data The private data (if any) that was associated with the map instance.
+ */
+typedef void (*JSWeakMapDestroyedCallback)(JSWeakObjectMapRef map, void* data);
+
+/*!
+ @function
+ @abstract Creates a weak value map that can be used to reference user defined objects without preventing them from being collected.
+ @param ctx The execution context to use.
+ @param data A void* to set as the map's private data. Pass NULL to specify no private data.
+ @param destructor A function to call when the weak map is destroyed.
+ @result A JSWeakObjectMapRef bound to the given context, data and destructor.
+ @discussion The JSWeakObjectMapRef can be used as a storage mechanism to hold custom JS objects without forcing those objects to
+ remain live as JSValueProtect would.  Any objects that are intended to be stored in a weak map must be user defined objects that
+ remove themselves from the map in their finalizer.
+ */
+JS_EXPORT JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef ctx, void* data, JSWeakMapDestroyedCallback destructor);
+
+/*!
+ @function
+ @abstract Associates a JSObjectRef with the given key in a JSWeakObjectMap.
+ @param ctx The execution context to use.
+ @param map The map to operate on.
+ @param key The key to associate a weak reference with.
+ @param object The user defined object to associate with the key.
+ */
+JS_EXPORT void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef);
+
+/*!
+ @function
+ @abstract Retrieves the JSObjectRef associated with a key.
+ @param ctx The execution context to use.
+ @param map The map to query.
+ @param key The key to search for.
+ @result Either the live object associated with the provided key, or NULL.
+ */
+JS_EXPORT JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* key);
+
+/*!
+ @function
+ @abstract Clears the association between a key and an object in a JSWeakObjectMapRef
+ @param ctx The execution context to use.
+ @param map The map to clear the key association from.
+ @param key The key to use.
+ @param object The old object value.
+ @result Returns true if the key/object association was present in map, and has been removed.
+ */
+JS_EXPORT bool JSWeakObjectMapClear(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // JSWeakObjectMapPrivate_h
diff --git a/JavaScriptCore/API/WebKitAvailability.h b/JavaScriptCore/API/WebKitAvailability.h
index 8402528..0e4f091 100644
--- a/JavaScriptCore/API/WebKitAvailability.h
+++ b/JavaScriptCore/API/WebKitAvailability.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
 #define WEBKIT_VERSION_LATEST 0x9999
 
 #ifdef __APPLE__
-#import <AvailabilityMacros.h>
+#include <AvailabilityMacros.h>
 #else
 /*
  * For non-Mac platforms, require the newest version.
@@ -86,6 +86,9 @@
     #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
         /* WebKit 3.0 is the version that shipped on Mac OS X 10.5. */
         #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_3_0
+    #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
+        /* WebKit 4.0 is the version that shipped on Mac OS X 10.6. */
+        #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_4_0
     #else
         #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_LATEST
     #endif
@@ -645,9 +648,9 @@
  * 
  * Used on declarations introduced in WebKit 4.0
  */
-#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_4_0
     #define AVAILABLE_IN_WEBKIT_VERSION_4_0     UNAVAILABLE_ATTRIBUTE
-#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_LATEST
+#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_4_0
     #define AVAILABLE_IN_WEBKIT_VERSION_4_0     WEAK_IMPORT_ATTRIBUTE
 #else
     #define AVAILABLE_IN_WEBKIT_VERSION_4_0
@@ -659,7 +662,7 @@
  * Used on declarations introduced in WebKit 4.0, 
  * and deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_IN_WEBKIT_VERSION_4_0_BUT_DEPRECATED    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_IN_WEBKIT_VERSION_4_0_BUT_DEPRECATED    AVAILABLE_IN_WEBKIT_VERSION_4_0
@@ -671,7 +674,7 @@
  * Used on declarations introduced in WebKit 1.0, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER
@@ -683,7 +686,7 @@
  * Used on declarations introduced in WebKit 1.1, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER
@@ -695,7 +698,7 @@
  * Used on declarations introduced in WebKit 1.2, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER
@@ -707,7 +710,7 @@
  * Used on declarations introduced in WebKit 1.3, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER
@@ -719,7 +722,7 @@
  * Used on declarations introduced in WebKit 2.0, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER
@@ -731,7 +734,7 @@
  * Used on declarations introduced in WebKit 3.0, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
@@ -743,7 +746,7 @@
  * Used on declarations introduced in WebKit 3.1, 
  * but later deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER
@@ -754,11 +757,148 @@
  * 
  * Used on types deprecated in WebKit 4.0
  */
-#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0
     #define DEPRECATED_IN_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
 #else
     #define DEPRECATED_IN_WEBKIT_VERSION_4_0
 #endif
 
 
+
+
+
+
+/*
+ * AVAILABLE_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_LATEST
+    #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0     UNAVAILABLE_ATTRIBUTE
+#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_LATEST
+    #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0     WEAK_IMPORT_ATTRIBUTE
+#else
+    #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0
+#endif
+
+/*
+ * AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED
+ * 
+ * Used on declarations introduced after WebKit 4.0, 
+ * and deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED    AVAILABLE_AFTER_WEBKIT_VERSION_4_0
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 1.0, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 1.1, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 1.2, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 1.3, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 2.0, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 3.0, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 3.1, 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on declarations introduced in WebKit 4.0 
+ * but later deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0    AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+ * 
+ * Used on types deprecated after WebKit 4.0
+ */
+#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST
+    #define DEPRECATED_AFTER_WEBKIT_VERSION_4_0    DEPRECATED_ATTRIBUTE
+#else
+    #define DEPRECATED_AFTER_WEBKIT_VERSION_4_0
+#endif
+
+
 #endif /* __WebKitAvailability__ */
diff --git a/JavaScriptCore/API/tests/testapi.c b/JavaScriptCore/API/tests/testapi.c
index ebc0cfb..28b4ec8 100644
--- a/JavaScriptCore/API/tests/testapi.c
+++ b/JavaScriptCore/API/tests/testapi.c
@@ -26,6 +26,7 @@
 #include "JavaScriptCore.h"
 #include "JSBasePrivate.h"
 #include "JSContextRefPrivate.h"
+#include "JSObjectRefPrivate.h"
 #include <math.h>
 #define ASSERT_DISABLED 0
 #include <wtf/Assertions.h>
@@ -754,6 +755,8 @@
 
 static JSValueRef jsNumberValue =  NULL;
 
+static JSObjectRef aHeapRef = NULL;
+
 static void makeGlobalNumberValue(JSContextRef context) {
     JSValueRef v = JSValueMakeNumber(context, 420);
     JSValueProtect(context, v);
@@ -870,8 +873,107 @@
     JSObjectSetProperty(context, globalObject, EmptyObjectIString, EmptyObject, kJSPropertyAttributeNone, NULL);
     JSStringRelease(EmptyObjectIString);
     
-    JSValueRef exception;
+    JSStringRef lengthStr = JSStringCreateWithUTF8CString("length");
+    aHeapRef = JSObjectMakeArray(context, 0, 0, 0);
+    JSObjectSetProperty(context, aHeapRef, lengthStr, JSValueMakeNumber(context, 10), 0, 0);
+    JSStringRef privatePropertyName = JSStringCreateWithUTF8CString("privateProperty");
+    if (!JSObjectSetPrivateProperty(context, myObject, privatePropertyName, aHeapRef)) {
+        printf("FAIL: Could not set private property.\n");
+        failed = 1;        
+    } else {
+        printf("PASS: Set private property.\n");
+    }
+    if (JSObjectSetPrivateProperty(context, aHeapRef, privatePropertyName, aHeapRef)) {
+        printf("FAIL: JSObjectSetPrivateProperty should fail on non-API objects.\n");
+        failed = 1;        
+    } else {
+        printf("PASS: Did not allow JSObjectSetPrivateProperty on a non-API object.\n");
+    }
+    if (JSObjectGetPrivateProperty(context, myObject, privatePropertyName) != aHeapRef) {
+        printf("FAIL: Could not retrieve private property.\n");
+        failed = 1;
+    } else
+        printf("PASS: Retrieved private property.\n");
+    if (JSObjectGetPrivateProperty(context, aHeapRef, privatePropertyName)) {
+        printf("FAIL: JSObjectGetPrivateProperty should return NULL when called on a non-API object.\n");
+        failed = 1;
+    } else
+        printf("PASS: JSObjectGetPrivateProperty return NULL.\n");
+    
+    if (JSObjectGetProperty(context, myObject, privatePropertyName, 0) == aHeapRef) {
+        printf("FAIL: Accessed private property through ordinary property lookup.\n");
+        failed = 1;
+    } else
+        printf("PASS: Cannot access private property through ordinary property lookup.\n");
+    
+    JSGarbageCollect(context);
+    
+    for (int i = 0; i < 10000; i++)
+        JSObjectMake(context, 0, 0);
 
+    if (JSValueToNumber(context, JSObjectGetProperty(context, aHeapRef, lengthStr, 0), 0) != 10) {
+        printf("FAIL: Private property has been collected.\n");
+        failed = 1;
+    } else
+        printf("PASS: Private property does not appear to have been collected.\n");
+    JSStringRelease(lengthStr);
+    
+    JSStringRef validJSON = JSStringCreateWithUTF8CString("{\"aProperty\":true}");
+    JSValueRef jsonObject = JSValueMakeFromJSONString(context, validJSON);
+    JSStringRelease(validJSON);
+    if (!JSValueIsObject(context, jsonObject)) {
+        printf("FAIL: Did not parse valid JSON correctly\n");
+        failed = 1;
+    } else
+        printf("PASS: Parsed valid JSON string.\n");
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("aProperty");
+    assertEqualsAsBoolean(JSObjectGetProperty(context, JSValueToObject(context, jsonObject, 0), propertyName, 0), true);
+    JSStringRelease(propertyName);
+    JSStringRef invalidJSON = JSStringCreateWithUTF8CString("fail!");
+    if (JSValueMakeFromJSONString(context, invalidJSON)) {
+        printf("FAIL: Should return null for invalid JSON data\n");
+        failed = 1;
+    } else
+        printf("PASS: Correctly returned null for invalid JSON data.\n");
+    JSValueRef exception;
+    JSStringRef str = JSValueCreateJSONString(context, jsonObject, 0, 0);
+    if (!JSStringIsEqualToUTF8CString(str, "{\"aProperty\":true}")) {
+        printf("FAIL: Did not correctly serialise with indent of 0.\n");
+        failed = 1;
+    } else
+        printf("PASS: Correctly serialised with indent of 0.\n");
+    JSStringRelease(str);
+
+    str = JSValueCreateJSONString(context, jsonObject, 4, 0);
+    if (!JSStringIsEqualToUTF8CString(str, "{\n    \"aProperty\": true\n}")) {
+        printf("FAIL: Did not correctly serialise with indent of 4.\n");
+        failed = 1;
+    } else
+        printf("PASS: Correctly serialised with indent of 4.\n");
+    JSStringRelease(str);
+    JSStringRef src = JSStringCreateWithUTF8CString("({get a(){ throw '';}})");
+    JSValueRef unstringifiableObj = JSEvaluateScript(context, src, NULL, NULL, 1, NULL);
+    
+    str = JSValueCreateJSONString(context, unstringifiableObj, 4, 0);
+    if (str) {
+        printf("FAIL: Didn't return null when attempting to serialize unserializable value.\n");
+        JSStringRelease(str);
+        failed = 1;
+    } else
+        printf("PASS: returned null when attempting to serialize unserializable value.\n");
+    
+    str = JSValueCreateJSONString(context, unstringifiableObj, 4, &exception);
+    if (str) {
+        printf("FAIL: Didn't return null when attempting to serialize unserializable value.\n");
+        JSStringRelease(str);
+        failed = 1;
+    } else
+        printf("PASS: returned null when attempting to serialize unserializable value.\n");
+    if (!exception) {
+        printf("FAIL: Did not set exception on serialisation error\n");
+        failed = 1;
+    } else
+        printf("PASS: set exception on serialisation error\n");
     // Conversions that throw exceptions
     exception = NULL;
     ASSERT(NULL == JSValueToObject(context, jsNull, &exception));
diff --git a/JavaScriptCore/Android.mk b/JavaScriptCore/Android.mk
index b03cd97..2c2a2d0 100644
--- a/JavaScriptCore/Android.mk
+++ b/JavaScriptCore/Android.mk
@@ -153,13 +153,6 @@
 	runtime/UString.cpp \
 	runtime/UStringImpl.cpp \
 	\
-	wrec/CharacterClass.cpp \
-	wrec/CharacterClassConstructor.cpp \
-	wrec/WREC.cpp \
-	wrec/WRECFunctors.cpp \
-	wrec/WRECGenerator.cpp \
-	wrec/WRECParser.cpp \
-	\
 	wtf/Assertions.cpp \
 	wtf/ByteArray.cpp \
 	wtf/CurrentTime.cpp \
@@ -173,12 +166,18 @@
 	wtf/ThreadIdentifierDataPthreads.cpp \
 	wtf/Threading.cpp \
 	wtf/ThreadingPthreads.cpp \
+	wtf/WTFThreadData.cpp \
 	\
 	wtf/TypeTraits.cpp \
 	wtf/dtoa.cpp \
 	\
 	wtf/android/MainThreadAndroid.cpp \
 	\
+	wtf/text/AtomicString.cpp \
+	wtf/text/CString.cpp \
+	wtf/text/StringImpl.cpp \
+	wtf/text/WTFString.cpp \
+	\
 	wtf/unicode/CollatorDefault.cpp \
 	wtf/unicode/UTF8.cpp \
 	\
diff --git a/JavaScriptCore/Android.v8.wtf.mk b/JavaScriptCore/Android.v8.wtf.mk
index 69128d6..9249e47 100644
--- a/JavaScriptCore/Android.v8.wtf.mk
+++ b/JavaScriptCore/Android.v8.wtf.mk
@@ -45,12 +45,18 @@
 	wtf/ThreadIdentifierDataPthreads.cpp \
 	wtf/Threading.cpp \
 	wtf/ThreadingPthreads.cpp \
-	\
-	wtf/android/MainThreadAndroid.cpp \
+	wtf/WTFThreadData.cpp \
 	\
 	wtf/TypeTraits.cpp \
 	wtf/dtoa.cpp \
 	\
+	wtf/android/MainThreadAndroid.cpp \
+	\
+	wtf/text/AtomicString.cpp \
+	wtf/text/CString.cpp \
+	wtf/text/StringImpl.cpp \
+	wtf/text/WTFString.cpp \
+	\
 	wtf/unicode/CollatorDefault.cpp \
 	wtf/unicode/UTF8.cpp \
 	\
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 3d1a925..11f02e3 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,3664 @@
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber Stamped by Oliver Hunt.
+
+        Make SmallStrings store an array of RefPtr<StringImpl>,
+        instead of a direct array of StringImpls.  This allows
+        us to remove a friend (and a layering violation) from
+        WTF::StringImpl, and makes it so that all StringImpls
+        are individually heap allocated.
+
+        * runtime/SmallStrings.cpp:
+        (JSC::SmallStringsStorage::rep):
+        (JSC::SmallStringsStorage::SmallStringsStorage):
+        * wtf/text/StringImpl.h:
+
+2010-04-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=37937
+        Wean JavaScriptCore off calls to isMainThread()
+
+        - Replace use of isMainThread() for interpreter reentry checks
+          with a stored value on the JSGlobalData.
+        - Replace use of isMainThread() for useMainThread only check in the
+          collector with a stored exclusive thread.
+
+        * API/JSContextRef.cpp:
+        (JSContextGroupCreate):
+        Always default to a small stack type for uses of the JSC API. It is
+        unlikely that the interpreter reentry required on the web will be as
+        important for other uses of JavaScriptCore. 
+
+        * JavaScriptCore.exp: 
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        Update exports.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::execute):
+        (JSC::Interpreter::prepareForRepeatCall):
+        Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
+
+        * interpreter/Interpreter.h:
+        Rename MaxMainThreadReentryDepth to MaxLargeThreadReentryDepth and 
+        MaxSecondaryThreadReentryDepth to MaxSmallThreadReentryDepth.
+
+        * jsc.cpp:
+        (main): Use the a large stack for jsc since it is always using the
+        main thread.
+        
+        * runtime/ArrayPrototype.cpp:
+        (JSC::arrayProtoFuncToString):
+        (JSC::arrayProtoFuncToLocaleString):
+        (JSC::arrayProtoFuncJoin):
+        Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
+
+        * runtime/Collector.cpp:
+        (JSC::Heap::registerThread):
+        Use the concept of making JSC run on an exclusiveThread instead of
+        forcing a mainThreadOnly assertion.
+        
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::JSGlobalData):
+        (JSC::JSGlobalData::createNonDefault):
+        (JSC::JSGlobalData::create):
+        (JSC::JSGlobalData::createLeaked):
+        (JSC::JSGlobalData::sharedInstance):
+        * runtime/JSGlobalData.h:
+        Add ThreadStackType argument to JSGlobalData constructors and set
+        maxReentryDepth based on it.
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix pt. 3).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix pt. 2).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Qt build fix).
+
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * wtf/qt/StringQt.cpp: Copied from WebCore/platform/text/qt/StringQt.cpp.
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+        * API/JSValueRef.cpp:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * runtime/Identifier.cpp:
+        (JSC::IdentifierTable::~IdentifierTable):
+        (JSC::IdentifierTable::add):
+        * runtime/Identifier.h:
+        * wtf/WTFThreadData.h:
+        (JSC::IdentifierTable::remove):
+        (JSC::IdentifierTable::literalTable):
+        * wtf/text/StringImpl.cpp:
+        (WebCore::StringImpl::~StringImpl):
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt, Darin Adler.
+
+        Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
+
+        JSC::UStringImpl and WebCore::StringImpl (soon to be renamed to
+        WTF::StringImpl) are almost identical.  Remove duplication of code by unifying
+        the two, move missing features from UStringImpl into StringImpl & delete the
+        class UStringImpl.
+
+        * API/JSClassRef.cpp:
+        * API/JSContextRef.cpp:
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bytecode/EvalCodeCache.h:
+        * bytecode/JumpTable.cpp:
+        * profiler/ProfileNode.cpp:
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add):
+        * runtime/Identifier.h:
+        (JSC::Identifier::equal):
+        * runtime/UString.cpp:
+        * runtime/UString.h:
+        (WTF::):
+        * runtime/UStringImpl.cpp: Removed.
+        * runtime/UStringImpl.h:
+        * wtf/text/StringHash.h:
+        (WebCore::StringHash::equal):
+        (WebCore::CaseFoldingHash::equal):
+        * wtf/text/StringImpl.cpp:
+        (WebCore::StringImpl::~StringImpl):
+        (WebCore::StringImpl::empty):
+        (WebCore::StringImpl::sharedBuffer):
+        (WebCore::equal):
+        * wtf/text/StringImpl.h:
+        (WebCore::StringImpl::StringImpl):
+        (WebCore::StringImpl::create):
+        (WebCore::StringImpl::tryCreateUninitialized):
+        (WebCore::StringImpl::cost):
+        (WebCore::StringImpl::isIdentifier):
+        (WebCore::StringImpl::setIsIdentifier):
+        (WebCore::StringImpl::computeHash):
+        (WebCore::StringImpl::copyChars):
+        (WebCore::StringImpl::):
+
+2010-04-21  Patrick Gansterer  <paroga@paroga.com>
+
+        Reviewed by Darin Adler.
+
+        Added missing #include "Lookup.h" in LUT source files.
+        https://bugs.webkit.org/show_bug.cgi?id=37903
+
+        * runtime/ArrayPrototype.cpp:
+        * runtime/DatePrototype.cpp:
+        * runtime/JSONObject.cpp:
+        * runtime/MathObject.cpp:
+        * runtime/NumberConstructor.cpp:
+        * runtime/RegExpConstructor.cpp:
+        * runtime/RegExpObject.cpp:
+        * runtime/StringPrototype.cpp:
+
+2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Add missing EFL JavaScriptCore file.
+        http://webkit.org/b/37854
+
+        * wtf/efl: Added.
+        * wtf/efl/MainThreadEfl.cpp: Added.
+        (WTF::initializeMainThreadPlatform):
+        (WTF::timeoutFired):
+        (WTF::scheduleDispatchFunctionsOnMainThread):
+
+2010-04-20  Xan Lopez  <xlopez@igalia.com>
+
+        Another attempt to fix the build.
+
+        * GNUmakefile.am:
+
+2010-04-20  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        [ES5] RegExp literals are constants that should be persistent across multiple function calls.
+        https://bugs.webkit.org/show_bug.cgi?id=37908
+
+        Dump the separate RegExp constant pool, and just use the standard JS constant pool
+        in codeblock.  This allows us to drop op_new_regexp and all associated code as well.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dump):
+        (JSC::CodeBlock::shrinkToFit):
+        * bytecode/CodeBlock.h:
+        * bytecode/Opcode.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::emitLoad):
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::RegExpNode::emitBytecode):
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::privateExecute):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass):
+        * jit/JIT.h:
+        * jit/JITOpcodes.cpp:
+        * jit/JITStubs.cpp:
+        * jit/JITStubs.h:
+        (JSC::):
+
+2010-04-20  Oliver Hunt  <oliver@apple.com>
+
+        Fix license on create_regex_tables
+
+        * create_regex_tables:
+
+2010-04-20  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by NOBODY (Build fix).
+
+        Fix gtk
+
+        * GNUmakefile.am:
+        * make-generated-sources.sh:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 37895 - Share common code from UStringImplBase with StringImpl
+
+        The implementation of StringImpl & UStringImpl is very similar.  Restructure
+        StringImpl to match UStringImpl, moving the flags and length into a base class,
+        so that this can be shared between both string types to increase code reuse.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/RopeImpl.h:
+        (JSC::RopeImpl::RopeImpl):
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::UStringImpl):
+        * wtf/text/StringImpl.h:
+        (WebCore::StringImpl::StringImpl):
+        (WebCore::StringImpl::characters):
+        * wtf/text/StringImplBase.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
+        (WTF::StringImplBase::length):
+        (WTF::StringImplBase::operator new):
+        (WTF::StringImplBase::StringImplBase):
+
+2010-04-20  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        Autogenerate yarr character tables
+        https://bugs.webkit.org/show_bug.cgi?id=37877
+
+        Use a python script to automatically generate character tables
+        for the builtin YARR character classes.  This allows us to generate
+        actual tables as well, by using these tables we can both increase
+        performance of the check (for complex builtins) and reduce the actual
+        code size.
+
+        4-8% win on string-unpack-code, but lots of noise on other tests so
+        i'm only confident saying its a 1% win overall.
+
+        * DerivedSources.make:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * assembler/AbstractMacroAssembler.h:
+        (JSC::AbstractMacroAssembler::ExtendedAddress::ExtendedAddress):
+        * assembler/MacroAssembler.h:
+        (JSC::MacroAssembler::branchTest8):
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::branchTest8):
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::branchTest8):
+        * assembler/X86Assembler.h:
+        (JSC::X86Assembler::cmpb_im):
+        (JSC::X86Assembler::testb_im):
+        * bytecode/SamplingTool.cpp:
+        (JSC::SamplingTool::dump):
+        * create_regex_tables: Added.
+        * yarr/RegexCompiler.cpp:
+        (JSC::Yarr::CharacterClassConstructor::charClass):
+        * yarr/RegexJIT.cpp:
+        (JSC::Yarr::RegexGenerator::matchCharacterClass):
+        (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
+        (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
+        (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
+        * yarr/RegexPattern.h:
+        (JSC::Yarr::CharacterClassTable::create):
+        (JSC::Yarr::CharacterClassTable::CharacterClassTable):
+        (JSC::Yarr::CharacterClass::CharacterClass):
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (speculative windows fix - missed a bit!).
+
+        * wtf/text/AtomicString.h:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (speculative windows fix).
+
+        * wtf/text/AtomicString.h:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+        Add missing .def file entries.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 37869 - Move URopeImpl to its own .h/.cpp
+        
+        Currently Ropes are implemented by the class URopeImpl, which is defined in
+        UStringImpl.h, and then typedefed to the name JSString::Rope. Remove the
+        typedef, and rename all uses of URopeImpl and JSString::Rope to just RopeImpl.
+
+        Move RopeImpl to its own header, and remove all remaining references to ropes
+        from UStringImpl (rename UStringOrRopeImpl to UStringImplBase, rename or move
+        the isRope & deref methods from UStringOrRopeImpl).
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/JSString.cpp:
+        (JSC::JSString::resolveRope):
+        * runtime/JSString.h:
+        (JSC::):
+        (JSC::RopeBuilder::JSString):
+        (JSC::RopeBuilder::~JSString):
+        (JSC::RopeBuilder::appendStringInConstruct):
+        (JSC::RopeBuilder::JSStringFinalizerStruct::):
+        * runtime/RopeImpl.cpp: Copied from JavaScriptCore/runtime/UStringImpl.cpp.
+        (JSC::RopeImpl::derefFibersNonRecursive):
+        (JSC::RopeImpl::destructNonRecursive):
+        * runtime/RopeImpl.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
+        (JSC::RopeImpl::tryCreateUninitialized):
+        (JSC::RopeImpl::isRope):
+        (JSC::RopeImpl::deref):
+        (JSC::RopeImpl::RopeImpl):
+        * runtime/UStringImpl.cpp:
+        * runtime/UStringImpl.h:
+        (JSC::UStringImplBase::isInvalid):
+        (JSC::UStringImplBase::ref):
+        (JSC::UStringImplBase::UStringImplBase):
+        (JSC::UStringImplBase::):
+        (JSC::UStringImpl::UStringImpl):
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 37828 - Move WebCore's String classes to WTF
+
+        Move these classes up to WTF so they are available to all clients of WTF (in
+        particular JSC).
+
+        As a first patch, making the most minimal change possible, since this patch
+        could easily grow rather large since we'll have to change every class forward
+        declaration ( e.g. every "namespace WebCore { class String; }" much change to
+        "namespace WTF { class String; }").
+
+        Moving the files, but leaving the classes logically in the WebCore namespace -
+        which is technically a layering violation - I'll come back and fix this up in a
+        subsequent patch.
+
+        * Android.mk:
+        * Android.v8.wtf.mk:
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * config.h:
+        * wtf/StaticConstructors.h: Copied from WebCore/platform/StaticConstructors.h.
+        * wtf/text/AtomicString.cpp: Copied from WebCore/platform/text/AtomicString.cpp.
+        * wtf/text/AtomicString.h: Copied from WebCore/platform/text/AtomicString.h.
+        * wtf/text/AtomicStringImpl.h: Copied from WebCore/platform/text/AtomicStringImpl.h.
+        * wtf/text/StringBuffer.h: Copied from WebCore/platform/text/StringBuffer.h.
+        * wtf/text/StringHash.h: Copied from WebCore/platform/text/StringHash.h.
+        * wtf/text/StringImpl.cpp: Copied from WebCore/platform/text/StringImpl.cpp.
+        * wtf/text/StringImpl.h: Copied from WebCore/platform/text/StringImpl.h.
+        * wtf/text/WTFString.cpp: Copied from WebCore/platform/text/String.cpp.
+        (WebCore::charactersToFloat):
+        * wtf/text/WTFString.h: Copied from WebCore/platform/text/PlatformString.h.
+
+2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Unreviewed speculative buildfix for WinCE after r57882
+        https://bugs.webkit.org/show_bug.cgi?id=37701
+
+        * JavaScriptCore.pri: missing wince* case added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+        Speculative Chromium/Win build fix, attempt #2.
+
+        * config.h:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+        Speculative Chromium/Win build fix.
+
+        * config.h: JS_EXPORTDATA should do nothing on !JSC builds.
+
+2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Target(WebCore,jsc,...) must depends on static library of JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=37701
+
+        * JavaScriptCore.pri: dependency added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Maciej Stachowiak (relanding r57829).
+        Added missing JS_EXPORTDATA
+
+        * API/APIShims.h:
+        (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
+        (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
+        (JSC::APICallbackShim::APICallbackShim):
+        (JSC::APICallbackShim::~APICallbackShim):
+        * API/JSContextRef.cpp:
+        * Android.mk:
+        * Android.v8.wtf.mk:
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/Completion.cpp:
+        (JSC::checkSyntax):
+        (JSC::evaluate):
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::remove):
+        (JSC::Identifier::checkCurrentIdentifierTable):
+        * runtime/Identifier.h:
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreadingOnce):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::create):
+        * wtf/WTFThreadData.cpp: Copied from JavaScriptCore/wtf/WTFThreadData.cpp.
+        * wtf/WTFThreadData.h: Copied from JavaScriptCore/wtf/WTFThreadData.h.
+
+2010-04-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (rolling out r57829).
+        This broke windows.
+
+        * API/APIShims.h:
+        (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
+        (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
+        (JSC::APICallbackShim::APICallbackShim):
+        (JSC::APICallbackShim::~APICallbackShim):
+        * API/JSContextRef.cpp:
+        * Android.mk:
+        * Android.v8.wtf.mk:
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/Completion.cpp:
+        (JSC::checkSyntax):
+        (JSC::evaluate):
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::remove):
+        (JSC::Identifier::checkCurrentIdentifierTable):
+        (JSC::createIdentifierTableSpecificCallback):
+        (JSC::createIdentifierTableSpecific):
+        * runtime/Identifier.h:
+        (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
+        (JSC::defaultIdentifierTable):
+        (JSC::setDefaultIdentifierTable):
+        (JSC::currentIdentifierTable):
+        (JSC::setCurrentIdentifierTable):
+        (JSC::resetCurrentIdentifierTable):
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreadingOnce):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::create):
+        * wtf/WTFThreadData.cpp: Removed.
+        * wtf/WTFThreadData.h: Removed.
+
+2010-04-19  Douglas Gregor  <dgregor@apple.com>
+
+        Reviewed and landed by Anders Carlsson.
+
+        * runtime/UStringImpl.h:
+        Fix class/struct declaration mismatches.
+
+2010-04-19  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Checked in these tests I wrote becuase Balazs Kelemen wanted to use them.
+
+        * tests/perf: Added.
+        * tests/perf/bench-allocate-nonretained.js: Added.
+        * tests/perf/bench-allocate-retained.js: Added.
+
+2010-04-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37745
+        Move string uniquing tables to (new) WTFThreadData class.
+
+        Remove AtomicString's dependency on ThreadGlobalData so that we can move
+        WebCore's string classes up to WTF.
+
+        WTFThreadData.cpp/.h are based on ThreadGlobalData from WebCore.
+        Moved JSC & WebCore's string uniquing tables to this class.
+
+        This patch introduces a temporary layering violation in providing forward
+        declarations of classes from JSC and WTF; this will be resolved as we move
+        more string code up to WTF.
+
+        * API/APIShims.h:
+        (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
+        (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
+        (JSC::APICallbackShim::APICallbackShim):
+        (JSC::APICallbackShim::~APICallbackShim):
+        * API/JSContextRef.cpp:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/Completion.cpp:
+        (JSC::checkSyntax):
+        (JSC::evaluate):
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::remove):
+        (JSC::Identifier::checkCurrentIdentifierTable):
+        * runtime/Identifier.h:
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreadingOnce):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::create):
+        * wtf/WTFThreadData.cpp: Copied from WebCore/platform/ThreadGlobalData.cpp.
+        (WTF::WTFThreadData::WTFThreadData):
+        (WTF::WTFThreadData::~WTFThreadData):
+        * wtf/WTFThreadData.h: Copied from WebCore/platform/ThreadGlobalData.h.
+        (WTF::WTFThreadData::atomicStringTable):
+        (WTF::WTFThreadData::initializeIdentifierTable):
+        (WTF::WTFThreadData::currentIdentifierTable):
+        (WTF::WTFThreadData::setCurrentIdentifierTable):
+        (WTF::WTFThreadData::resetCurrentIdentifierTable):
+        (WTF::wtfThreadData):
+
+2010-04-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Build fix for WinCE.
+
+        Moved the include of the non-existing errno.h header file inside
+        platform guard macros.
+
+        * jit/ExecutableAllocatorFixedVMPool.cpp:
+
+2010-04-18  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Laszlo Gombos.
+
+        [WINCE] Don't define WTF_CPU_MIDDLE_ENDIAN=1
+        https://bugs.webkit.org/show_bug.cgi?id=37434
+
+        Windows CE supports little-endian format only, so don't define
+        WTF_CPU_MIDDLE_ENDIAN=1.
+
+        * wtf/Platform.h:
+
+2010-04-18  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Fix JavaScriptCore's include path for WinCE builds
+
+        https://bugs.webkit.org/show_bug.cgi?id=36751
+
+        * JavaScriptCore.pri:
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by nobody, build fix.
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by nobody, build fix.
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 37730 - Remove JSC::UString dependencies from WebCore::StringImpl
+        (Following on from bug #37675).
+
+        Make the argument ordering for UStringImpl's constructor & create
+        methods match, when passed a shared buffer.
+
+        * JavaScriptCore.exp:
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::create):
+        * runtime/UStringImpl.h:
+
+2010-04-15  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix memory leak in QScriptEngine::evaluate().
+
+        QScriptEnginePrivate::evaluate should release temporary variables.
+
+        [Qt] QScriptEngine::evaluate has memory leak.
+        https://bugs.webkit.org/show_bug.cgi?id=37596
+
+        * qt/api/qscriptengine_p.cpp:
+        (QScriptEnginePrivate::evaluate):
+        * qt/api/qscriptengine_p.h:
+
+2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix a memory leak in QScriptValue::inherits.
+
+        [Qt] QScriptValue::inherits has a memory leak.
+        https://bugs.webkit.org/show_bug.cgi?id=37617
+
+        * qt/api/qscriptvalue_p.h:
+        (QScriptValuePrivate::inherits):
+
+2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix a few memory leaks in QScriptEngine.
+
+        Syntax checking caused memory leak, not all temporary variables were released.
+
+        [Qt] Syntax checking  in the QtScript cause a memory leak.
+        https://bugs.webkit.org/show_bug.cgi?id=37610
+
+        * qt/api/qscriptengine_p.cpp:
+        (QScriptEnginePrivate::checkSyntax):
+        * qt/api/qscriptsyntaxcheckresult.cpp:
+        (QScriptSyntaxCheckResultPrivate::errorMessage):
+        (QScriptSyntaxCheckResultPrivate::errorLineNumber):
+
+2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix memory leak inside QScriptEnginePrivate::makeJSValue.
+
+        QScriptEnginePrivate::makeJSValue should release temporary JSStringRef variable.
+
+        [Qt] tst_QScriptValue::toString has a memory leak.
+        https://bugs.webkit.org/show_bug.cgi?id=37598
+
+        * qt/api/qscriptengine_p.h:
+        (QScriptEnginePrivate::makeJSValue):
+
+2010-04-14  Peter Varga  <pvarga@inf.u-szeged.hu>
+
+        Reviewed by Geoffrey Garen.
+
+        Move the YARR JIT fallback detection from RegexJIT.cpp to
+        RegexCompiler.cpp.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37571
+
+        * yarr/RegexCompiler.cpp:
+        (JSC::Yarr::RegexPatternConstructor::atomBackReference):
+        (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
+        * yarr/RegexJIT.cpp:
+        (JSC::Yarr::RegexGenerator::generateTerm):
+        (JSC::Yarr::RegexGenerator::RegexGenerator):
+        (JSC::Yarr::jitCompileRegex):
+        * yarr/RegexJIT.h:
+        (JSC::Yarr::RegexCodeBlock::operator!):
+        * yarr/RegexPattern.h:
+        (JSC::Yarr::RegexPattern::RegexPattern):
+        (JSC::Yarr::RegexPattern::reset):
+
+2010-04-14  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Mac OS X: Use deployment target to determine whether memory tagging should be enabled
+        https://bugs.webkit.org/show_bug.cgi?id=34888
+
+        When building on (Snow) Leopard but targeting Tiger
+        (TARGETING_TIGER defined, BUILDING_ON_TIGER not defined),
+        WebKit would crash on Tiger because the tags passed to mmap
+        caused those function calls to fail.
+
+        Conversely, when building on Tiger but targeting Leopard
+        (BUILDING_ON_TIGER defined, TARGETING_LEOPARD defined), WebKit
+        would crash on Leopard because the tags passed to vm_map and
+        vm_allocate caused those function calls to fail.
+
+        Solution: Use TARGETING_TIGER rather than BUILDING_ON_TIGER to
+        govern the tag definitions. Use the same tags for vm_map and
+        vm_allocate regardless of target, since they work on
+        both. Fall back to the mmap tags that work on Tiger (that is,
+        "no tags") if targeting Tiger, since those tags also work on
+        Leopard.
+
+        * wtf/VMTags.h:
+
+2010-04-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by nobody, build fix.
+
+        [Qt] Build fix for Mac when building with build-webkit --qt
+
+        Specifying no configuration on Mac builds WebCore both in debug
+        and release. JavaScriptCore has to follow this rule as well.
+
+        * JavaScriptCore.pro:
+
+2010-04-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7851332> Fix the build.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMallocStats::): Initialize extra members of malloc_introspection_t to zero.
+
+2010-04-09  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Make CallIdentifier constructor to handle null urls.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37341
+
+        * profiler/CallIdentifier.h:
+        (JSC::CallIdentifier::CallIdentifier):
+
+2010-04-09  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix crashes with package builds in release
+
+        Add NDEBUG to the defines for package build in JavaScriptCore.pri,
+        so that it's consistently used for JavaScriptCore, WebCore, jsc and all
+        other tools using wtf, etc. data structures directly. Mixing NDEBUG with
+        non-NDEBUG builds causes crashes due to differences in data structures when
+        assertions/checks are enabled.
+
+        * JavaScriptCore.pri:
+
+2010-04-09  Patrick Gansterer  <paroga@paroga.com>
+
+        Reviewed by Darin Adler.
+
+        Implement NO_RETURN for COMPILER(MSVC).
+        https://bugs.webkit.org/show_bug.cgi?id=33056 
+
+        Added NO_RETURN_WITH_VALUE for functions with non-void return type.
+
+        * jsc.cpp:
+        * wtf/AlwaysInline.h:
+        * wtf/FastMalloc.cpp:
+
+2010-04-08  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Simon Hausmann.
+
+        [WINCE] Check if ARM or _ARM_ is defined
+        https://bugs.webkit.org/show_bug.cgi?id=37200
+
+        MSVC defines ARM and _ARM_ for Windows CE ARM. Define WTF_CPU_ARM=1
+        when either ARM or _ARM_ is defined.
+
+        * wtf/Platform.h:
+
+2010-04-08  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed Oliver Hunt.
+
+        [Qt]r57240 broke Qt build (might be a gcc bug)
+        https://bugs.webkit.org/show_bug.cgi?id=37253
+
+        Workaround until fix. On PLATFORM(QT) use inline instead of ALWAYS_INLINE.
+
+        * wtf/PassRefPtr.h: Qt guards added.
+
+2010-04-07  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Vector<UString> makes many needless calls to UString::UString and UString::~UString
+
+        Add a VectorTrait<UString> specialisation to allow vector to simply memset/memcpy
+        data around.  Only difference from the VectorTrait<RefPtr<T> > traits is the inability
+        to use memset to initialize data.
+
+        * runtime/UString.h:
+        (WTF::):
+
+2010-04-07  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Beat gcc with a clue bat -- force inlining of refIfNotNull and derefIfNotNull
+
+        * wtf/PassRefPtr.h:
+
+2010-04-07  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Darin Adler.
+
+        Replace isprint with isASCIIPrintable
+        https://bugs.webkit.org/show_bug.cgi?id=37223
+
+        WebKit does not use functions in <ctype.h> as they are dependent on the current
+        locale. Use the equivalent functions in <wtf/ASCIICType.h>. isASCIIPrintable
+        replaces isprint.
+
+        * pcre/pcre_exec.cpp:
+        (pchars):
+
+2010-04-07  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37219
+        
+        This change disables text caret for the iPhone platflorm.
+        
+        * wtf/Platform.h: Disabled text caret for iPhone.
+
+2010-04-06  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
+        https://bugs.webkit.org/show_bug.cgi?id=36646
+
+        Add a new exception type for forcibly terminating a JavaScript stack.
+        The new exception functions similarly to the
+        InterruptedExecutionException but is conceptually different because
+        execution is terminated instead of just interrupted.
+
+        * GNUmakefile.am:
+            - Added new Terminator.h file.
+        * JavaScriptCore.gypi:
+            - Added new Terminator.h file.
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+            - Added new Terminator.h file.
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+            - Added new Terminator.h file.
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::throwException):
+            - Fully unwind the stack for TerminatedExecutionException.
+        (JSC::Interpreter::privateExecute):
+            - Check if we've been terminated at the same time we check if we've
+              timed out.
+        * jit/JITStubs.cpp:
+        (JSC::DEFINE_STUB_FUNCTION):
+            - Check if we've been terminated at the same time we check if we've
+              timed out.
+        * runtime/Completion.cpp:
+            - Some exceptions define special completion types so that calls can
+              see why we terminated evaluation.
+        (JSC::evaluate):
+        * runtime/Completion.h:
+            - Define a new completion type for termination.
+        (JSC::):
+        * runtime/ExceptionHelpers.cpp:
+            - Define TerminatedExecutionException and refactor pseudo-RTTI
+              virtual function to be more semantic.
+        (JSC::InterruptedExecutionError::exceptionType):
+        (JSC::TerminatedExecutionError::TerminatedExecutionError):
+        (JSC::TerminatedExecutionError::exceptionType):
+        (JSC::TerminatedExecutionError::toString):
+        (JSC::createTerminatedExecutionException):
+        * runtime/ExceptionHelpers.h:
+            - Entry point for generating a TerminatedExecutionException.
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::JSGlobalData):
+            - Add a Terminator object that can be used to asynchronously
+              terminate a JavaScript execution stack.
+        * runtime/JSGlobalData.h:
+        * runtime/JSObject.h:
+        (JSC::JSObject::exceptionType):
+            - Define that, by default, thrown objects have a normal exception
+              type.
+        * runtime/Terminator.h: Added.
+            - Added a new controller object that can be used to terminate
+              execution asynchronously.  This object is more or less a
+              glorified bool.
+        (JSC::Terminator::Terminator):
+        (JSC::Terminator::termianteSoon):
+        (JSC::Terminator::shouldTerminate):
+
+2010-04-05  Oliver Hunt  <oliver@apple.com>
+
+        And another one.
+
+        * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
+
+2010-04-05  Oliver Hunt  <oliver@apple.com>
+
+        And another build fix.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+
+2010-04-05  Oliver Hunt  <oliver@apple.com>
+
+        Build fix
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+
+2010-04-05  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        Support weak maps in JSC
+        https://bugs.webkit.org/show_bug.cgi?id=37132
+
+        Expose an API to allow creation of a map for storing
+        weak JS references.
+
+        * API/JSWeakObjectMapRefInternal.h: Added.
+        (OpaqueJSWeakObjectMap::create):
+        (OpaqueJSWeakObjectMap::map):
+        (OpaqueJSWeakObjectMap::~OpaqueJSWeakObjectMap):
+        (OpaqueJSWeakObjectMap::OpaqueJSWeakObjectMap):
+        * API/JSWeakObjectMapRefPrivate.cpp: Added.
+        * API/JSWeakObjectMapRefPrivate.h: Added.
+        * JavaScriptCore.exp:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::registerWeakMap):
+        (JSC::JSGlobalObject::deregisterWeakMap):
+
+2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Symbian] Consolidate Symbian WINSCW environment configuration
+        https://bugs.webkit.org/show_bug.cgi?id=37100
+
+        Move the "undefinition" of WIN32 and _WIN32 from WebCore/config.h
+        to JavaScriptCore/wtf/Platform.h as it is not specific to WebCore.
+
+        PLATFORM(WIN) and OS(WIN) no longer needs to be undefined as
+        undefining WIN32 takes care of it.
+
+        * wtf/Platform.h:
+
+2010-04-03  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37068
+        Change UString to use a 0 rep for null strings instead of a null object.
+
+        No performance impact.
+
+        * JavaScriptCore.exp:
+        * runtime/InternalFunction.cpp:
+        (JSC::InternalFunction::InternalFunction):
+        * runtime/JSString.h:
+        (JSC::RopeBuilder::JSString):
+        * runtime/UString.cpp:
+        (JSC::initializeUString):
+        * runtime/UString.h:
+        (JSC::UString::UString):
+        (JSC::UString::data):
+        (JSC::UString::size):
+        (JSC::UString::isNull):
+        (JSC::UString::isEmpty):
+        (JSC::UString::cost):
+
+2010-04-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
+
+        Reviewed by Oliver Hunt.
+
+        Fix uninitalised members in CallLinkInfo and BytecodeGenerator.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36816
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        * bytecode/CodeBlock.h:
+        (JSC::CallLinkInfo::CallLinkInfo):
+
+2010-04-03  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Enable HTMLProgressElement for Safari on OSX
+        https://bugs.webkit.org/show_bug.cgi?id=36961
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-04-02  Ruben Van Boxem  <vanboxem.ruben@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        Mingw-w64 fixes for JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=35607
+
+        * runtime/Collector.cpp: use the msvc code for mingw-w64 (but not mingw-w32)
+        (JSC::Heap::allocateBlock):
+        (JSC::Heap::freeBlockPtr):
+        (JSC::currentThreadStackBase):
+        (JSC::currentThreadStackBase):
+        * wtf/Platform.h: added COMPILER(MINGW64) check to differentiate between mingw.org and mingw-w64 functions
+
+2010-04-02  Geoffrey Garen  <ggaren@apple.com>
+
+        Build fix: updated the .def file.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-04-02  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Inlined toThisString and toThisJSString to avoid virtual function call overhead
+        https://bugs.webkit.org/show_bug.cgi?id=37039
+        
+        Maybe a 1% speedup on iBench JS.
+
+        * JavaScriptCore.exp: New exports.
+
+        * runtime/JSCell.cpp:
+        * runtime/JSCell.h:
+        * runtime/JSNumberCell.cpp:
+        * runtime/JSNumberCell.h:
+        * runtime/JSString.cpp:
+        * runtime/JSString.h:
+        * runtime/JSValue.h:
+        * runtime/JSZombie.h:
+        (JSC::JSZombie::toThisObject): Nixed the old virtual-type implementation.
+
+        * runtime/JSObject.h:
+        (JSC::JSValue::toThisString):
+        (JSC::JSValue::toThisJSString): Added the inlined implementation.
+
+2010-04-02  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Beef up documentation for ASSERT* and CRASH macros a bit.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36527
+
+        * wtf/Assertions.h:
+
+2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed, minor build fix.
+
+        Change the order of the member initialisation list
+        in constructor to match declaration order
+
+        * runtime/Collector.cpp:
+        (JSC::Heap::Heap):
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-03-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix pt II).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36871 - Remove JSC::CString
+        Use WTF::CString instead (which until recently was WebCore::CString).
+
+        * JavaScriptCore.exp:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * runtime/UString.cpp:
+        * runtime/UString.h:
+
+2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed, fix after r56842.
+
+        Add UNUSED_PARAM a to silence warning.
+
+        * jit/JITStubs.cpp:
+        (JSC::DEFINE_STUB_FUNCTION):
+
+2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed, Symbian build fix.
+
+        Refactor JITStubs.cpp so that the list of STUB_FUNCTIONs
+        are not dependent on the JSVALUE32_64 guard.
+
+        * jit/JITStubs.cpp: Place the JSVALUE32_64 guard inside 
+        the body of cti_op_eq_strings.
+        * jit/JITStubs.h: Remove JSVALUE32_64 guard from 
+        cti_op_eq_strings stub.
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+        Fixing b0rked version of JavaScriptCore.vcproj - added lines were truncated.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * JavaScriptCore.exp:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pro:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * wtf/text: Added.
+        * wtf/text/CString.cpp: Copied from WebCore/platform/text/CString.cpp.
+        * wtf/text/CString.h: Copied from WebCore/platform/text/CString.h.
+        (WTF::CStringBuffer::data):
+        (WTF::CStringBuffer::length):
+        (WTF::CStringBuffer::create):
+        (WTF::CStringBuffer::CStringBuffer):
+        (WTF::CStringBuffer::mutableData):
+        (WTF::CString::CString):
+        (WTF::CString::isNull):
+        (WTF::CString::buffer):
+        (WTF::operator!=):
+
+2010-03-30  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by nobody, build break.
+
+        [Qt] Fix build break on Qt Mac.
+
+        DESTDIR path on Mac do not include the configuration path by default
+        like on Windows. Have to force it.
+
+        * JavaScriptCore.pro:
+
+2010-03-29  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by NOBODY (build fix).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+        add JSObjectRefPrivate.h
+
+2010-03-29  Chao-ying Fu  <fu@mips.com>
+
+        Reviewed by Oliver Hunt.
+
+        MIPS JIT Supports
+        https://bugs.webkit.org/show_bug.cgi?id=30144
+
+        The following changes enable MIPS JIT.
+
+        * assembler/MIPSAssembler.h:
+        (JSC::MIPSAssembler::lbu):
+        (JSC::MIPSAssembler::linkWithOffset):
+        * assembler/MacroAssemblerMIPS.h:
+        (JSC::MacroAssemblerMIPS::load8):
+        (JSC::MacroAssemblerMIPS::branch8):
+        (JSC::MacroAssemblerMIPS::branchTest8):
+        (JSC::MacroAssemblerMIPS::setTest8):
+        (JSC::MacroAssemblerMIPS::setTest32):
+        * jit/JIT.h:
+        * jit/JITInlineMethods.h:
+        (JSC::JIT::preserveReturnAddressAfterCall):
+        (JSC::JIT::restoreReturnAddressBeforeReturn):
+        * jit/JITOpcodes.cpp:
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::JITThunks):
+        * jit/JITStubs.h:
+        (JSC::JITStackFrame::returnAddressSlot):
+        * wtf/Platform.h:
+
+2010-02-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add an enable flag for the Widgets (http://www.w3.org/TR/widgets-reqs/)
+        and turn it on for Qt only.
+
+        * wtf/Platform.h:
+
+2010-03-29  Patrick Gansterer  <paroga@paroga.com>
+
+        Reviewed by Darin Adler.
+
+        Corrected name of (u)int64_t compile time assert.
+        https://bugs.webkit.org/show_bug.cgi?id=36739
+
+        int64_t_is_four_bytes -> int64_t_is_eight_bytes
+
+        * os-win32/stdint.h:
+
+2010-03-29  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Use the -l syntax for linking against JavaScriptCore on Windows.
+        This allow qmake to extract dependencies correctly when generating VS
+        solutions.
+
+        * JavaScriptCore.pri:
+
+2010-03-29  Thomas Zander  <t.zander@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36742
+
+        gcc for Symbian doesn't support gcc extensions like atomicity.h - disable
+
+        * wtf/Threading.h: also detect os symbian
+
+2010-03-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Remove the definition of WTF_CHANGES guards from the build system
+        https://bugs.webkit.org/show_bug.cgi?id=31670
+  
+        * JavaScriptCore.pro: Remove the definition of WTF_CHANGES
+        as it is already defined in config.h
+
+2010-03-28  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add API for reporting additional memory cost of JavaScript objects
+        https://bugs.webkit.org/show_bug.cgi?id=36650
+
+        * qt/api/qscriptengine.cpp:
+        (QScriptEngine::reportAdditionalMemoryCost):
+        * qt/api/qscriptengine.h:
+        * qt/api/qscriptengine_p.h:
+        (QScriptEnginePrivate::reportAdditionalMemoryCost):
+        * qt/tests/qscriptengine/tst_qscriptengine.cpp:
+        (tst_QScriptEngine::reportAdditionalMemoryCost):
+
+2010-03-28  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        QScriptEngine API was enriched by globalObject() method
+        which give an access to the global object.
+
+        [Qt] QScriptEngine doesn't give an access to global object
+        https://bugs.webkit.org/show_bug.cgi?id=36603
+
+        * qt/api/qscriptengine.cpp:
+        (QScriptEngine::globalObject):
+        * qt/api/qscriptengine.h:
+        * qt/api/qscriptengine_p.cpp:
+        (QScriptEnginePrivate::globalObject):
+        * qt/api/qscriptengine_p.h:
+        * qt/tests/qscriptengine/tst_qscriptengine.cpp:
+        (tst_QScriptEngine::globalObject):
+
+2010-03-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Build JavaScriptCore as a static library.
+        https://bugs.webkit.org/show_bug.cgi?id=36590
+
+        This patch takes what was left of the unused JavaScriptCore.pro
+        and moved the compilation logic from JavaScriptCore.pri to
+        JavaScriptCore.pro.
+
+        * JavaScriptCore.pri:
+        * JavaScriptCore.pro:
+        * jsc.pro:
+        * qt/api/QtScript.pro:
+
+2010-03-25  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+
+        * profiler/ProfileGenerator.cpp:
+        (JSC::ProfileGenerator::willExecute):
+        (JSC::ProfileGenerator::didExecute):
+
+2010-03-25  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36611 - Cleanup JSC::CString
+        Rename CString::c_str() -> CString::data(), CString::size() -> CString::length(),
+        remove UString::getCString() (all uses are wrong, should use UString::UTF8String()).
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::printUnaryOp):
+        (JSC::CodeBlock::printBinaryOp):
+        (JSC::CodeBlock::printConditionalJump):
+        (JSC::CodeBlock::printGetByIdOp):
+        (JSC::CodeBlock::printPutByIdOp):
+        (JSC::printGlobalResolveInfo):
+        (JSC::printStructureStubInfo):
+        (JSC::CodeBlock::printStructure):
+        (JSC::CodeBlock::printStructures):
+        (JSC::CodeBlock::dump):
+        * jsc.cpp:
+        (functionPrint):
+        (functionDebug):
+        (runInteractive):
+        (fillBufferWithContentsOfFile):
+        * profiler/CallIdentifier.h:
+        (JSC::CallIdentifier::c_str):
+        * profiler/Profile.cpp:
+        (JSC::Profile::debugPrintDataSampleStyle):
+        * profiler/ProfileNode.cpp:
+        (JSC::ProfileNode::debugPrintData):
+        (JSC::ProfileNode::debugPrintDataSampleStyle):
+        * runtime/DateConversion.cpp:
+        (JSC::parseDate):
+        * runtime/JSGlobalObjectFunctions.cpp:
+        (JSC::encode):
+        (JSC::globalFuncJSCPrint):
+        * runtime/UString.cpp:
+        (JSC::operator==):
+        (JSC::UString::toDouble):
+        * runtime/UString.h:
+        (JSC::CString::length):
+        (JSC::CString::data):
+
+2010-03-25  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by nobody, build fix.
+
+        [Qt] Build fix on MSVC. Reverts r55633 for stdint.h
+
+        This file gets included in generated moc files which don't
+        include the prefix header.
+
+        * os-win32/stdint.h:
+
+2010-03-24  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (windows build fix).
+
+2010-03-24  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Switch String::latin1, String::utf8, String::fromUTF8 to
+        use WTF's Unicode conversion methods rather than TextEncoder.
+        These methods only perform simple conversion, and don't need
+        really require TextEncoder's full capability (to look up arbitrary
+        encodings by name), switching to only be dependent on WTF will
+        make it easier if we chose to move WebCore::String to WTF.
+
+        * JavaScriptCore.exp:
+
+2010-03-24  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        * wtf/FastMalloc.h: Added a using directive for fastMallocSize, like we do for all public
+        WTF symbols. Also sorted the list alphabetically.
+
+2010-03-23  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (speculative windows build fix part II).
+
+2010-03-23  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (speculative windows build fix).
+
+2010-03-23  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 36519 - JSGlobalContextRelease is unnecessarily slow
+
+        Since [ http://trac.webkit.org/changeset/35917 ], calling
+        JSGlobalContextRelease always triggers a GC heap collection
+        (if not a full destroy). As per 35917's changelog "This is
+        only really necessary when the (JSGlobalObject's) last
+        reference is released, but there is no way to determine that,
+        and no harm in collecting slightly more often."
+        
+        Well, we now know of cases of API clients who are harmed by
+        the performance penalty of collecting too often, so it's time
+        to add a way to determine whether a call to JSGlobalContextRelease
+        is removing the last protect from it's global object.  If further
+        protects are retaining the global object (likely from other
+        JSGlobalContextRefs), then don't trigger a GC collection.
+
+        * API/JSContextRef.cpp:
+        * runtime/Collector.cpp:
+        (JSC::Heap::unprotect): return a boolean indicating that the value is now unprotected.
+        * runtime/Collector.h:
+        * wtf/HashCountedSet.h:
+        (WTF::::remove): return a boolean indicating whether the value was removed from the set.
+
+2010-03-23  Mark Rowe  <mrowe@apple.com>
+
+        Build fix.
+
+        * runtime/ArrayPrototype.cpp:
+        (JSC::arrayProtoFuncSplice): Some versions of GCC emit a warning about the implicit 64- to 32-bit truncation
+        that takes place here. An explicit cast is sufficient to silence it.
+
+2010-03-23  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix.
+
+        * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): Fixed a typo - length doesn't
+        need to be converted with toInteger().
+
+2010-03-23  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36511
+        <rdar://problem/7753498> Safari freezes when using SPUTNIK JavaScript conformance check
+
+        Test: fast/js/sputnik-S15.4.4.12_A3_T3.html
+
+        * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): We were incorrectly computing
+        the start offset, and iterated over (almost) all integers. Note that this can be fixed
+        without using doubles, but the code would be much more complicated, and there is no important
+        reason to stick to integers here.
+
+2010-03-23  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Fix compilation on Itanium in 32-bit mode
+        https://bugs.webkit.org/show_bug.cgi?id=36494
+
+        * wtf/Platform.h: Introduce CPU(IA64_32). Don't define
+          WTF_USE_JSVALUE64 if the CPU is in 32-bit mode.
+
+2010-03-23  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Interpreter fix for <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
+        evaluates to -2147483648 on 32 bit (35842)
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::privateExecute): Only take the fast negate path if
+        a bit other than bit 31 is set. If none of bits 0-30 are set, then the
+        value we're negating can only be 0 or -2147483648, and neither can be
+        negated in int space.
+
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emit_op_negate):
+        (JSC::JIT::emitSlow_op_negate): Updated the JIT implementation to match
+        the interpreter, since it's slightly simpler.
+
+2010-03-22  Siddharth Mathur  <siddharth.mathur@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Symbian] More efficient aligned memory allocation for JSC Collector
+        https://bugs.webkit.org/show_bug.cgi?id=34350
+
+        * JavaScriptCore.pri: Added 2 new Symbian source files and HAL linkage
+
+        * runtime/Collector.cpp: Reduced port-specific code and added private data member
+        (JSC::Heap::Heap):
+        (JSC::Heap::~Heap):
+        (JSC::Heap::destroy):
+        (JSC::Heap::allocateBlock):
+        (JSC::Heap::freeBlockPtr):
+
+        * runtime/Collector.h: Added private data member
+
+        * wtf/symbian: Added.
+        * wtf/symbian/BlockAllocatorSymbian.cpp: Added.
+        (WTF::AlignedBlockAllocator::AlignedBlockAllocator): Helper class to allocate 
+        aligned blocks more efficiently as required by Collector
+        (WTF::AlignedBlockAllocator::alloc):
+        (WTF::AlignedBlockAllocator::free):
+        (WTF::AlignedBlockAllocator::destroy):
+        (WTF::AlignedBlockAllocator::~AlignedBlockAllocator):
+        * wtf/symbian/BlockAllocatorSymbian.h: Added.
+
+2010-03-22  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fixed <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
+        evaluates to -2147483648 on 32 bit (35842)
+        
+        Two ways to fix the same bug:
+        
+        1. Check for overflow when negating, since negating the largest negative
+        int causes overflow.
+        
+        2. Constant-fold even when negating a negative, since, like they say in
+        high school, "math works."
+
+        * assembler/MacroAssemblerARM.h:
+        (JSC::MacroAssemblerARM::branchNeg32):
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::branchNeg32): Added a branching version
+        of the negate operator.
+
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emit_op_negate): Use the branching version of the negate 
+        operator to check for overflow.
+
+        (JSC::JIT::emitSlow_op_negate): Link the check for overflow to a slow case.
+        (We could emit inline code for this, since we know what the result would
+        be, but that's probably just a waste of generated code.)
+
+        * parser/Grammar.y: Constant fold even when negating a negative.
+
+2010-03-22  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36431> Clean up 'int' use in UString.cpp after r54789
+
+        Reviewed by Darin Adler.
+
+        * runtime/UString.cpp:
+        (JSC::UString::from): Changed argument type from 'unsigned int'
+        to 'unsigned' to match WebKit coding style.
+        (JSC::UString::find): Changed static_cast<int>() to
+        static_cast<unsigned>() now that this method returns unsigned.
+        (JSC::UString::rfind): Ditto.
+        * runtime/UString.h:
+        (JSC::UString::from): Changed argument type from 'unsigned int'
+        to 'unsigned' to match WebKit coding style.
+
+2010-03-22  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add support for syntax checking in the QtScript API.
+
+        New class was created; the QScriptSyntaxCheckResult which main
+        responsibility is to provide results of the ECMA Script code
+        syntax check. The class is not fully functional as the JSC C API
+        doesn't expose an error column number, but it is a good start point
+        for a future development.
+
+        [Qt] QtScript functionality should be extended by syntax checking.
+        https://bugs.webkit.org/show_bug.cgi?id=36123
+
+        * qt/api/QtScript.pro:
+        * qt/api/qscriptengine.cpp:
+        (QScriptEngine::checkSyntax):
+        * qt/api/qscriptengine.h:
+        * qt/api/qscriptengine_p.cpp:
+        (QScriptEnginePrivate::checkSyntax):
+        * qt/api/qscriptengine_p.h:
+        * qt/api/qscriptsyntaxcheckresult.cpp: Added.
+        (QScriptSyntaxCheckResult::QScriptSyntaxCheckResult):
+        (QScriptSyntaxCheckResult::~QScriptSyntaxCheckResult):
+        (QScriptSyntaxCheckResult::operator=):
+        (QScriptSyntaxCheckResult::state):
+        (QScriptSyntaxCheckResult::errorLineNumber):
+        (QScriptSyntaxCheckResult::errorColumnNumber):
+        (QScriptSyntaxCheckResult::errorMessage):
+        * qt/api/qscriptsyntaxcheckresult.h: Added.
+        * qt/api/qscriptsyntaxcheckresult_p.cpp: Added.
+        (QScriptSyntaxCheckResultPrivate::~QScriptSyntaxCheckResultPrivate):
+        (QScriptSyntaxCheckResultPrivate::errorMessage):
+        (QScriptSyntaxCheckResultPrivate::errorLineNumber):
+        * qt/api/qscriptsyntaxcheckresult_p.h: Added.
+        (QScriptSyntaxCheckResultPrivate::get):
+        (QScriptSyntaxCheckResultPrivate::QScriptSyntaxCheckResultPrivate):
+        (QScriptSyntaxCheckResultPrivate::state):
+        (QScriptSyntaxCheckResultPrivate::errorColumnNumber):
+        * qt/tests/qscriptengine/tst_qscriptengine.cpp:
+        (tst_QScriptEngine::checkSyntax_data):
+        (tst_QScriptEngine::checkSyntax):
+
+2010-03-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        New class; QScriptProgram.
+
+        The class should be used to evaluate the same script multiple times
+        more efficiently.
+
+        [Qt] QtScript should have QScriptProgram class
+        https://bugs.webkit.org/show_bug.cgi?id=36008
+
+        * qt/api/QtScript.pro:
+        * qt/api/qscriptengine.cpp:
+        (QScriptEngine::evaluate):
+        * qt/api/qscriptengine.h:
+        * qt/api/qscriptengine_p.cpp:
+        (QScriptEnginePrivate::evaluate):
+        * qt/api/qscriptengine_p.h:
+        (QScriptEnginePrivate::evaluate):
+        * qt/api/qscriptprogram.cpp: Added.
+        (QScriptProgram::QScriptProgram):
+        (QScriptProgram::~QScriptProgram):
+        (QScriptProgram::operator=):
+        (QScriptProgram::isNull):
+        (QScriptProgram::sourceCode):
+        (QScriptProgram::fileName):
+        (QScriptProgram::firstLineNumber):
+        (QScriptProgram::operator==):
+        (QScriptProgram::operator!=):
+        * qt/api/qscriptprogram.h: Added.
+        * qt/api/qscriptprogram_p.h: Added.
+        (QScriptProgramPrivate::get):
+        (QScriptProgramPrivate::QScriptProgramPrivate):
+        (QScriptProgramPrivate::~QScriptProgramPrivate):
+        (QScriptProgramPrivate::isNull):
+        (QScriptProgramPrivate::sourceCode):
+        (QScriptProgramPrivate::fileName):
+        (QScriptProgramPrivate::firstLineNumber):
+        (QScriptProgramPrivate::operator==):
+        (QScriptProgramPrivate::operator!=):
+        (QScriptProgramPrivate::program):
+        (QScriptProgramPrivate::file):
+        (QScriptProgramPrivate::line):
+        * qt/tests/qscriptengine/tst_qscriptengine.cpp:
+        (tst_QScriptEngine::evaluateProgram):
+
+2010-03-21  David Kilzer  <ddkilzer@apple.com>
+
+        Blind attempt #2 to fix the Windows build after r56314
+
+        * API/tests/testapi.c: Include JSObjectRefPrivate.h for the new
+        methods instead of declaring them locally (and non-extern).
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        Backed out previous change.
+
+2010-03-21  David Kilzer  <ddkilzer@apple.com>
+
+        Blind attempt to fix the Windows build after r56314
+
+        Try to fix the following errors on the Windows buildbot:
+
+            Linking...
+            testapi.obj : error LNK2001: unresolved external symbol "bool __cdecl JSObjectSetPrivateProperty(struct OpaqueJSContext const *,struct OpaqueJSValue *,struct OpaqueJSString *,struct OpaqueJSValue const *)" (?JSObjectSetPrivateProperty@@YA_NPBUOpaqueJSContext@@PAUOpaqueJSValue@@PAUOpaqueJSString@@PBU2@@Z)
+            testapi.obj : error LNK2001: unresolved external symbol "struct OpaqueJSValue const * __cdecl JSObjectGetPrivateProperty(struct OpaqueJSContext const *,struct OpaqueJSValue *,struct OpaqueJSString *)" (?JSObjectGetPrivateProperty@@YAPBUOpaqueJSValue@@PBUOpaqueJSContext@@PAU1@PAUOpaqueJSString@@@Z)
+            C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\bin\testapi.exe : fatal error LNK1120: 2 unresolved externals
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added
+        missing symbols to be exported.
+
+2010-03-21  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Documentation fix for previous patch.
+
+        * API/JSObjectRefPrivate.h:
+
+2010-03-20  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        JSC needs an API to allow custom objects to have aprivate GC-accessible properties
+        https://bugs.webkit.org/show_bug.cgi?id=36420
+
+        Add new API methods to support "private" properties on custom
+        objects.
+
+        * API/JSCallbackObject.h:
+        (JSC::JSCallbackObjectData::JSCallbackObjectData):
+        (JSC::JSCallbackObjectData::~JSCallbackObjectData):
+        (JSC::JSCallbackObjectData::getPrivateProperty):
+        (JSC::JSCallbackObjectData::setPrivateProperty):
+        (JSC::JSCallbackObjectData::deletePrivateProperty):
+        (JSC::JSCallbackObjectData::markChildren):
+        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
+        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
+        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
+        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::markChildren):
+        (JSC::JSCallbackObject::getPrivateProperty):
+        (JSC::JSCallbackObject::setPrivateProperty):
+        (JSC::JSCallbackObject::deletePrivateProperty):
+        (JSC::JSCallbackObject::markChildren):
+        * API/JSObjectRef.cpp:
+        (JSObjectGetPrivateProperty):
+        (JSObjectSetPrivateProperty):
+        (JSObjectDeletePrivateProperty):
+        * API/JSObjectRefPrivate.h: Added.
+        * API/tests/testapi.c:
+        (main):
+        * JavaScriptCore.exp:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fixes after introduction of Brew files.
+
+        * wscript:
+
+2010-03-18  Tom Callaway  <tcallawa@redhat.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 35429: Fix compile on SPARC64
+        https://bugs.webkit.org/show_bug.cgi?id=35429
+
+        * wtf/Platform.h: Set WTF_USE_JSVALUE64 for SPARC64
+
+2010-03-18  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add API to directly expose JSON parsing
+        https://bugs.webkit.org/show_bug.cgi?id=34887
+
+        Add API to expose JSON parsing directly, and add tests to testapi
+
+        * API/JSValueRef.cpp:
+        (JSValueMakeFromJSONString):
+        (JSValueCreateJSONString):
+        * API/tests/testapi.c:
+        (main):
+        * JavaScriptCore.exp:
+        * runtime/JSONObject.cpp:
+        (JSC::JSONStringify):
+        * runtime/JSONObject.h:
+
+2010-03-16  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin Adler and Mark Rowe.
+
+        Update WebKit availability macros for release after 4.0.
+
+        * API/WebKitAvailability.h:
+
+2010-03-17  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        undefined, NaN, and Infinity should be ReadOnly
+        https://bugs.webkit.org/show_bug.cgi?id=36263
+
+        Simply add the ReadOnly flag to these properties.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::reset):
+
+2010-03-17  Darin Adler  <darin@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Speed up Math.round a little by removing unneeded special case
+        https://bugs.webkit.org/show_bug.cgi?id=36107
+
+        Test: fast/js/math.html
+
+        * runtime/MathObject.cpp:
+        (JSC::mathProtoFuncRound): This function had a special case for numbers
+        between -0.5 and -0.0 to return -0.0. But the algorithm in the function
+        already yields -0.0 for those cases, so the extra checking and branching
+        is unneeded.
+
+2010-03-17  Mike Homey  <glandium@debian.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Build fix for SPARC. Fix missing macro value.
+
+        * wtf/Platform.h:
+
+2010-03-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt, Darin Adler.
+
+        Bug 36083 - REGRESSION (r55772-r55834): Crash in JavaScriptCore RegExp code on PowerPC
+
+        The problem is a bug in our port of PCRE - that a read may take place from the first character in an
+        empty string.  For the time being, revert to using a valid pointer in the data segment rather than
+        an invalid non-null pointer into the zero-page for the empty string's data pointer.  A better fix for
+        this will be to remove PCRE.
+
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::empty):
+
+2010-03-16  Darin Adler  <darin@apple.com>
+
+        Rolled out r56081 since it broke the Windows build.
+
+2010-03-16  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Remove extra <new> include and add guards to operator new/delete definitions
+        https://bugs.webkit.org/show_bug.cgi?id=35967
+
+        Remove extra <new> header include from FastAlloc.cpp since it is included in 
+        FastAlloc.h. Add ENABLE(GLOBAL_FASTMALLOC_NEW) macro guard to operator
+        new/delete/new []/delete [] definitions.
+
+        * wtf/FastMalloc.cpp:
+
+2010-03-15  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Eric Seidel.
+
+        [BREWMP] Add a function to create a BREW instance without local variable declarations.
+        https://bugs.webkit.org/show_bug.cgi?id=34705
+
+        Add a template function to create a BREW instance in one line.
+
+        * wtf/brew/ShellBrew.h: Added.
+        (WTF::createInstance):
+
+2010-03-15  Geoffrey Garen  <ggaren@apple.com>
+
+        Not reviewed.
+
+        Removed a now-incorrect comment I forgot to remove in my last check-in.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMalloc_PageHeap::scavenge):
+
+2010-03-15  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fixed a portion of:
+        <rdar://problem/7165917> | https://bugs.webkit.org/show_bug.cgi?id=28676
+        Safari 4 does not release memory back to the operating system fast enough (28676)
+
+        Every few seconds, release a percentage of the minimum unused page count
+        during that time period.
+
+        SunSpider reports no change, command-line or in-browser, Mac or Windows.
+        
+        * wtf/FastMalloc.cpp:
+        (WTF::TCMalloc_PageHeap::init):
+        (WTF::TCMalloc_PageHeap::signalScavenger):
+        (WTF::TCMalloc_PageHeap::initializeScavenger): Renamed shouldContinueScavenging
+        to shouldScavenge, since scavenging is no longer something that we interrupt.
+
+        (WTF::TCMalloc_PageHeap::scavenge): The new scavenging algorithm. Fixes
+        a bug where the old code would release only one item from each size class
+        per scavenge, potentially leaving large numbers of large-sized objects
+        unreleased for a long time.
+
+        (WTF::TCMalloc_PageHeap::shouldScavenge):
+        (WTF::TCMalloc_PageHeap::New):
+        (WTF::TCMalloc_PageHeap::AllocLarge):
+        (WTF::TCMalloc_PageHeap::Delete):
+        (WTF::TCMalloc_PageHeap::GrowHeap):
+        (WTF::TCMalloc_PageHeap::scavengerThread):
+        (WTF::TCMalloc_PageHeap::periodicScavenge): Updated to track the minimum
+        value of free_committed_pages_ during a given scavenge period.
+
+2010-03-15  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35843
+        Re-land reverted fix to JSString::getIndex()
+
+        Calling getIndex() on a JSString in rope form may result in a JSException being thrown
+        if there is insuficient memory so value(exec) returns UString() with length zero,
+        which will be passed to jsSingleCharacterSubstring.
+        Add a slow case function to trap the error & return a safe null value, until the
+        exception is handled.
+
+        * runtime/JSString.cpp:
+        (JSC::JSString::getIndexSlowCase):
+        (JSC::JSString::getStringPropertyDescriptor):
+        * runtime/JSString.h:
+        (JSC::jsSingleCharacterSubstring):
+        (JSC::JSString::getIndex):
+        (JSC::jsSingleCharacterString):
+        (JSC::JSString::getStringPropertySlot):
+
+2010-03-04  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Add a long long version of abs() for MSVC.
+
+        * wtf/MathExtras.h:
+        (abs):
+
+2010-03-15  Gabor Loki  <loki@webkit.org>
+
+        Reviewed by Gavin Barraclough.
+
+        Combine ctiTrampolines on ARM and Thumb-2
+        https://bugs.webkit.org/show_bug.cgi?id=36014
+
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::JITThunks):
+
+2010-03-12  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-12  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 36075 - Clean up screwyness re static string impls & Identifiers.
+
+        * API/JSClassRef.cpp:
+        (OpaqueJSClass::~OpaqueJSClass): Classname may be null/empty, and these are an identifer.  This is okay, since the null/empty strings are shared across all threads.
+        * JavaScriptCore.exp:
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add): No need to explicitly hash null reps, this is done in the ststic UStringImpl constructor.
+        (JSC::Identifier::addSlowCase): UStringImpl::empty() handled & checkCurrentIdentifierTable now called in the header.
+        (JSC::Identifier::checkCurrentIdentifierTable): Replaces checkSameIdentifierTable (this no longer checked the rep since the identifierTable pointer was removed from UString::Rep long ago).
+        * runtime/Identifier.h:
+        (JSC::Identifier::add): Replace call to checkSameIdentifierTable with call to checkCurrentIdentifierTable at head of function.
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::~UStringImpl): Remove call to checkConsistency - this function no longer checks anything interesting.
+        * runtime/UStringImpl.h:
+        (JSC::UStringOrRopeImpl::UStringOrRopeImpl): Set s_refCountFlagIsIdentifier in static constructor.
+        (JSC::UStringImpl::UStringImpl): remove calls to checkConsistency (see above), add new ASSERT to substring constructor.
+        (JSC::UStringImpl::setHash): ASSERT not static (static strings set the hash in their constructor, should not reach this code path).
+        (JSC::UStringImpl::create): Add missing ASSERT.
+        (JSC::UStringImpl::setIsIdentifier): ASSERT !isStatic() (static strings hash set in constructor).
+
+2010-03-12  Peter Varga  <pvarga@inf.u-szeged.hu>
+
+        Reviewed by David Levin.
+
+        Two functions tryConsumeCharacter() and tryConsumeCharacterClass() are
+        removed from yarr/RegexInterpreter.cpp because they are never called.
+
+        * yarr/RegexInterpreter.cpp:
+
+2010-03-11  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        The JSNative state was renamed to JSPrimitive. The new name better
+        coresponds to the ECMAScript standard.
+
+        Enum QScriptValuePrivate::States was renamed to State to obey Qt
+        coding style rules ("States" name suggests that a state could
+        mixed together with an other state using bitwise logic operators.
+
+        [Qt] QScriptValuePrivate::States has naming issues
+        https://bugs.webkit.org/show_bug.cgi?id=35968
+
+        * qt/api/qscriptvalue_p.h:
+        (QScriptValuePrivate::):
+        (QScriptValuePrivate::QScriptValuePrivate):
+        (QScriptValuePrivate::isBool):
+        (QScriptValuePrivate::isNumber):
+        (QScriptValuePrivate::isNull):
+        (QScriptValuePrivate::isString):
+        (QScriptValuePrivate::isUndefined):
+        (QScriptValuePrivate::toString):
+        (QScriptValuePrivate::toNumber):
+        (QScriptValuePrivate::toBool):
+        (QScriptValuePrivate::assignEngine):
+        (QScriptValuePrivate::refinedJSValue):
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Windows build fix).
+
+        Add export.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Windows build fix).
+
+        Add export.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Oliver Hunt.
+
+        Remove nonsense comments used in development & commited in error.
+
+        * runtime/UStringImpl.h:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Windows build fix).
+
+        Remove export.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36041
+        Remove unnecessary differences in common code between WebCore::StringImpl & JSC::UStringImpl
+
+        Much of the code in WebCore::StringImpl and JSC::UStringImpl is now very similar,
+        but has trivial and unnecessary formatting differences, such as the exact wording
+        of comments, missing ASSERTs, functions implemented in the .h vs .cpp etc.
+
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add): UStringImpl::empty() now automatically hashes, uas per WebCore strings.
+        (JSC::Identifier::addSlowCase): UStringImpl::empty() now automatically hashes, uas per WebCore strings.
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::~UStringImpl): Only call bufferOwnership() once, add missing ASSERTs.
+        (JSC::UStringImpl::createUninitialized): Move from .h, not commonly called, no need to inline.
+        (JSC::UStringImpl::create): Move from .h, not commonly called, no need to inline.
+        (JSC::UStringImpl::sharedBuffer): Rewritten to more closely match WebCore implementation, remove need for separate baseSharedBuffer() method.
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::UStringImpl): Automatically hash static strings, ASSERT m_data & m_length are non-null/non-zero in non-static strings.
+        (JSC::UStringImpl::setHash): Add missing ASSERT.
+        (JSC::UStringImpl::create): Moved to .cpp / added missing check for empty string creation.
+        (JSC::UStringImpl::adopt): Vector.size() returns size_t, not unsigned.
+        (JSC::UStringImpl::cost): Renamed m_bufferSubstring -> m_substringBuffer
+        (JSC::UStringImpl::hash): Reordered in file.
+        (JSC::UStringImpl::existingHash): Reordered in file.
+        (JSC::UStringImpl::computeHash): Reordered in file, renamed parameter.
+        (JSC::UStringImpl::checkConsistency): rewrote ASSERT.
+        (JSC::UStringImpl::bufferOwnership): Return type should be BufferOwnership.
+        (JSC::UStringImpl::): Moved friends to head of class.
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by David Kilzer.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+        * Configurations/Base.xcconfig:
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
+        current Mac OS X version unless otherwise specified.
+
+        Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+        Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+        may not be usable when targetting a different Mac OS X version.
+
+        Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+        MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/DebugRelease.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+        * Configurations/JavaScriptCore.xcconfig:
+        * Configurations/Version.xcconfig:
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Sort the project file.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Sort the project file .
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2010-03-11  Gabor Loki  <loki@webkit.org>
+
+        Reviewed by Gavin Barraclough.
+
+        Buildfix for Thumb-2 after r55684. Add branch8 and branchTest8 functions.
+        https://bugs.webkit.org/show_bug.cgi?id=35892
+
+        * assembler/ARMv7Assembler.h:
+        (JSC::ARMv7Assembler::):
+        (JSC::ARMv7Assembler::ldrb):
+        * assembler/MacroAssemblerARMv7.h:
+        (JSC::MacroAssemblerARMv7::load8):
+        (JSC::MacroAssemblerARMv7::branch8):
+        (JSC::MacroAssemblerARMv7::branchTest8):
+        (JSC::MacroAssemblerARMv7::setTest8):
+
+2010-03-10  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Oliver Hunt.
+        
+        Rename JSC::UStringImpl::data() to characters(), to match WebCore::StringImpl.
+
+        * API/JSClassRef.cpp:
+        (OpaqueJSClassContextData::OpaqueJSClassContextData):
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::keyForCharacterSwitch):
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::processClauseList):
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::privateExecute):
+        * jit/JITStubs.cpp:
+        (JSC::DEFINE_STUB_FUNCTION):
+        * runtime/ArrayPrototype.cpp:
+        (JSC::arrayProtoFuncToString):
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::equal):
+        (JSC::Identifier::addSlowCase):
+        * runtime/JSString.cpp:
+        (JSC::JSString::resolveRope):
+        * runtime/UString.cpp:
+        (JSC::UString::toStrictUInt32):
+        (JSC::equal):
+        * runtime/UString.h:
+        (JSC::UString::data):
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::characters):
+        (JSC::UStringImpl::hash):
+        (JSC::UStringImpl::setHash):
+
+2010-03-10  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Darin Adler, Geoffrey Garen, Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35991
+        Would be faster to not use a thread specific to implement StringImpl::empty()
+
+        Change JSC::UStringImpl's implementation of empty() match to match StringImpl's new implementation
+        (use a static defined within the empty() method), and change the interface to match too (return
+        a pointer not a reference). 
+
+        ~0% performance impact (possible minor progression from moving empty() from .h to .cpp).
+
+        * JavaScriptCore.exp:
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add):
+        (JSC::Identifier::addSlowCase):
+        * runtime/PropertyNameArray.cpp:
+        (JSC::PropertyNameArray::add):
+        * runtime/UString.cpp:
+        (JSC::initializeUString):
+        (JSC::UString::UString):
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::empty):
+        (JSC::UStringImpl::create):
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::adopt):
+        (JSC::UStringImpl::createUninitialized):
+        (JSC::UStringImpl::tryCreateUninitialized):
+
+2010-03-10  Dmitry Titov  <dimich@chromium.org>
+
+        Not reviewed, fixing Snow Leopard build.
+
+        * wtf/mac/MainThreadMac.mm: Forgot 'static' for a new local function.
+        (WTF::postTimer):
+
+2010-03-10  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Document::postTask to use a single queue of tasks, to fire them in order
+        https://bugs.webkit.org/show_bug.cgi?id=35943
+
+        The patch uses CFRunLoopTimer to schedule execution of tasks instead of performSelectorOnMainThread which apparently can starve other event sources.
+        The timer is used when the schedule request is coming on the main thread itself. This happens when the task is posted on the main thread or
+        when too many tasks are posted and the queue does 'stop and re-schedule' to make sure run loop has a chance to execute other events.
+
+        * wtf/mac/MainThreadMac.mm:
+        (WTF::timerFired):
+        (WTF::postTimer):
+        (WTF::scheduleDispatchFunctionsOnMainThread): Use timer posted to the current RunLoop if scheduling the task execution while on the main thread.
+
+2010-03-10  Geoffrey Garen  <ggaren@apple.com>
+
+        Windows build fix: added new symbol.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-10  Geoffrey Garen  <ggaren@apple.com>
+
+        Windows build fix: removed old symbol.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Alexey Proskuryakov, Darin Adler, and Sam Weinig.
+
+        Refactored fastCheckConsistency to match some review comments:
+            - renamed fastCheckConsistency to fastMallocSize, and changed ValueCheck
+              to ASSERT that a pointer's fastMallocSize is not 0.
+            - implemented a version of fastMallocSize for tcmalloc.
+            
+        Also moved some pre-existing code around to avoid a problem related to
+        mismatched #define/#undef of malloc/free in this source file.
+
+        * JavaScriptCore.exp:
+        * wtf/FastMalloc.cpp:
+        (WTF::fastMallocSize): Renamed. Fixed indentation.
+
+        (WTF::TCMalloc_PageHeap::scavenge): Removed an incorrect ASSERT that
+        got in the way of testing the tcmalloc implementation. (More information
+        on why this ASSERT is incorrect is in <rdar://problem/7165917>.)
+
+        (WTF::TCMallocStats::fastMallocSize): Implemented for tcmalloc.
+
+        * wtf/FastMalloc.h: Updated for rename.
+
+        * wtf/ValueCheck.h:
+        (WTF::): Moved the ASSERT that used to be in fastCheckConsistency here.
+
+2010-03-10  Kevin Ollivier  <kevino@theolliviers.com>
+
+        Reviewed by Eric Seidel.
+
+        Make global new/delete operators configurable for all ports and disable it
+        for the wx port for now.
+
+        * wtf/FastMalloc.h:
+        * wtf/Platform.h:
+
+2010-03-09  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (reverting r54510).
+
+        This caused a performance regression, by breaking the code
+        generator's logic to calculate the skip level for resolving
+        variables (traced by rdar:7683350)  Reverting for now.
+
+        * parser/Grammar.y:
+        * parser/NodeConstructors.h:
+        (JSC::ContinueNode::ContinueNode):
+        (JSC::BreakNode::BreakNode):
+        (JSC::ForInNode::ForInNode):
+        * runtime/CommonIdentifiers.cpp:
+        (JSC::CommonIdentifiers::CommonIdentifiers):
+        * runtime/CommonIdentifiers.h:
+        * runtime/FunctionPrototype.cpp:
+        (JSC::FunctionPrototype::FunctionPrototype):
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add):
+        * runtime/PropertyNameArray.cpp:
+        (JSC::PropertyNameArray::add):
+
+2010-03-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Changed FastMalloc statistics reporting to be a bit clearer. We now
+        report:
+            - Reserved VM Bytes: the VM that has been mapped into the process.
+            - Committed VM Bytes: the subset of Reserved VM Bytes actually in use.
+            - Free List Bytes: the subset of Committed VM Bytes in a free list.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::fastMallocStatistics):
+        (WTF::TCMallocStats::fastMallocStatistics): Updated to report the statistics
+        above. Standardized use of "ifdef WTF_CHANGES". Added a SpinLockHolder
+        around all statistics gathering, since it reads from the page heap.
+
+        * wtf/FastMalloc.h: Updated to report the statistics above. 
+
+2010-03-09  Gabor Loki  <loki@webkit.org>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Buildfix for ARM after r55684. Add branch8 and branchTest8 functions.
+        https://bugs.webkit.org/show_bug.cgi?id=35892
+
+        * assembler/ARMAssembler.cpp:
+        (JSC::ARMAssembler::dataTransfer32):
+        * assembler/ARMAssembler.h:
+        (JSC::ARMAssembler::):
+        * assembler/MacroAssemblerARM.h:
+        (JSC::MacroAssemblerARM::load8):
+        (JSC::MacroAssemblerARM::branch8):
+        (JSC::MacroAssemblerARM::branchTest8):
+
+2010-03-08  Geoffrey Garen  <ggaren@apple.com>
+
+        Windows build fix: 'P' is not a type. Luckily, 'void' is.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::fastCheckConsistency):
+
+2010-03-08  Geoffrey Garen  <ggaren@apple.com>
+
+        Windows build fix: export a new symbol.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-08  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Switching malloc implementations requires a world rebuild
+        https://bugs.webkit.org/show_bug.cgi?id=35899
+
+        * wtf/FastMalloc.cpp:
+        (WTF::fastCheckConsistency):
+        (WTF::TCMallocStats::fastCheckConsistency):
+        * wtf/FastMalloc.h:
+        * wtf/ValueCheck.h:
+        (WTF::): Moved pointer checking into a helper function in FastMalloc.cpp,
+        so you can switch malloc implementations without rebuilding the world.
+
+2010-03-07  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        TypeInfo is unnecessarily large
+        https://bugs.webkit.org/show_bug.cgi?id=35850
+
+        Reduce the size of the type and flags members to a single
+        byte each, reducing the size of Structure by 8 bytes.
+
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::branch8):
+        (JSC::MacroAssemblerX86Common::branchTest8):
+        (JSC::MacroAssemblerX86Common::setTest8):
+          Add single byte branches, and correct setTest8 to do a
+          single byte read from memory, and actually store the result
+        * assembler/X86Assembler.h:
+        (JSC::X86Assembler::):
+        (JSC::X86Assembler::cmpb_im):
+        (JSC::X86Assembler::testb_im):
+        * jit/JITCall.cpp:
+        (JSC::JIT::emit_op_construct_verify):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_instanceof):
+        (JSC::JIT::emit_op_jeq_null):
+        (JSC::JIT::emit_op_jneq_null):
+        (JSC::JIT::emit_op_get_pnames):
+        (JSC::JIT::emit_op_convert_this):
+        (JSC::JIT::emit_op_construct_verify):
+        (JSC::JIT::emit_op_to_jsnumber):
+        (JSC::JIT::emit_op_eq_null):
+        (JSC::JIT::emit_op_neq_null):
+        * runtime/JSTypeInfo.h:
+        (JSC::TypeInfo::TypeInfo):
+        (JSC::TypeInfo::type):
+
+2010-03-08  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (reverting regression).
+
+        Reverting 55035, this caused a regression.
+        (https://bugs.webkit.org/show_bug.cgi?id=35843)
+
+        * runtime/JSString.cpp:
+        (JSC::JSString::resolveRope):
+        (JSC::JSString::getStringPropertyDescriptor):
+        * runtime/JSString.h:
+        (JSC::jsSingleCharacterSubstring):
+        (JSC::JSString::getIndex):
+        (JSC::JSString::getStringPropertySlot):
+        * runtime/UStringImpl.cpp:
+        * runtime/UStringImpl.h:
+
+2010-03-08  Stuart Morgan  <stuartmorgan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Added a new USE definition for secure text mode on the Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=31265
+
+        * wtf/Platform.h:
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+
+        Add ENABLE_BLOB_SLICE feature define.
+        Also fix a problem that JSValue.toInteger is not exposed on Windows.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-07  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Small performance fix in the QScriptConverter::toString().
+
+        The QByteArray was replaced by the QVarLengthArray which doesn't
+        have to allocate any memory on heap.
+
+        [Qt] QScriptConverter::toString() should use QVarLengthArray instead of QByteArray
+        https://bugs.webkit.org/show_bug.cgi?id=35577
+
+        * qt/api/qscriptconverter_p.h:
+        (QScriptConverter::toString):
+
+2010-03-06  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Remove unnecessary includes of wtf/Platform.h.  This is already pulled in by config.h.
+
+        * API/APICast.h:
+        * API/JSCallbackFunction.cpp:
+        * API/JSContextRef.cpp:
+        * API/JSObjectRef.cpp:
+        * API/JSValueRef.cpp:
+        * assembler/ARMAssembler.h:
+        * assembler/ARMv7Assembler.h:
+        * assembler/AbstractMacroAssembler.h:
+        * assembler/AssemblerBuffer.h:
+        * assembler/AssemblerBufferWithConstantPool.h:
+        * assembler/CodeLocation.h:
+        * assembler/LinkBuffer.h:
+        * assembler/MIPSAssembler.h:
+        * assembler/MacroAssembler.h:
+        * assembler/MacroAssemblerARM.h:
+        * assembler/MacroAssemblerARMv7.h:
+        * assembler/MacroAssemblerCodeRef.h:
+        * assembler/MacroAssemblerMIPS.h:
+        * assembler/MacroAssemblerX86.h:
+        * assembler/MacroAssemblerX86Common.h:
+        * assembler/MacroAssemblerX86_64.h:
+        * assembler/RepatchBuffer.h:
+        * assembler/X86Assembler.h:
+        * jit/JIT.h:
+        * jit/JITCode.h:
+        * jit/JITInlineMethods.h:
+        * jit/JITStubs.h:
+        * os-win32/stdint.h:
+        * runtime/JSAPIValueWrapper.h:
+        * runtime/JSImmediate.h:
+        * wtf/ASCIICType.h:
+        * wtf/StdLibExtras.h:
+        * wtf/VMTags.h:
+        * yarr/RegexCompiler.h:
+        * yarr/RegexInterpreter.h:
+        * yarr/RegexJIT.h:
+        * yarr/RegexParser.h:
+        * yarr/RegexPattern.h:
+
+2010-03-06  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Eric Seidel.
+
+        [BREWMP] Share OwnPtr.
+        https://bugs.webkit.org/show_bug.cgi?id=35776
+
+        Share OwnPtr implementation with BREW MP and remove OwnPtrBrew.
+
+        * wtf/OwnPtrBrew.cpp: Added.
+        (WTF::deleteOwnedPtr):
+        * wtf/OwnPtrCommon.h:
+        * wtf/brew/OwnPtrBrew.cpp: Removed.
+        * wtf/brew/OwnPtrBrew.h: Removed.
+
+2010-03-06  Patrick Gansterer  <paroga@paroga.com>
+
+        Reviewed by Eric Seidel.
+
+        Implemented JIT_OPTIMIZE_NATIVE_CALL for WinCE
+        https://bugs.webkit.org/show_bug.cgi?id=33426
+
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::privateCompileCTIMachineTrampolines):
+
+2010-03-05  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by NOBODY (build fix).
+
+        Add enw exports to windows
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-05  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        JSC should cache int to Identifier conversion as it does for ordinary strings
+        https://bugs.webkit.org/show_bug.cgi?id=35814
+
+        Make the NumericStrings cache cache unsigned ints in addition to signed.
+        We keep them separate from the int cache as it both simplifies code, and
+        also because the unsigned path is exclusive to property access and therefore
+        seems to have different usage patterns.
+
+        The primary trigger for the unsigned to Identifier propertyName conversion
+        is the construction of array-like objects out of normal objects.  Given these
+        tend to be relative small numbers, and the array-like behaviour lends itself
+        to sequential values this patch also adds a non-colliding cache for all small
+        numbers.
+
+        * JavaScriptCore.exp:
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::from):
+        * runtime/Identifier.h:
+        * runtime/NumericStrings.h:
+        (JSC::NumericStrings::add):
+        (JSC::NumericStrings::lookup):
+        (JSC::NumericStrings::lookupSmallString):
+
+2010-03-03  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        Allow static property getters to interact with JSCs caching
+        https://bugs.webkit.org/show_bug.cgi?id=35716
+
+        Add new opcodes for handling cached lookup of static value getters.
+        More or less the same as with JS getters, all that changes is that
+        instead of calling through a JSFunction we always know that we have
+        a C function to call.
+
+        For the patching routines in the JIT we now need to pass a few
+        new parameters to allow us to pass enough information to the stub
+        function to allow us to call the C function correctly.  Logically
+        this shouldn't actually be necessary as all of these functions ignore
+        the identifier, but removing the ident parameter would require
+        somewhat involved changes to the way we implement getOwnPropertySlot,
+        etc.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dump):
+        (JSC::CodeBlock::derefStructures):
+        (JSC::CodeBlock::refStructures):
+        * bytecode/Instruction.h:
+        (JSC::Instruction::Instruction):
+        (JSC::Instruction::):
+        * bytecode/Opcode.h:
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::tryCacheGetByID):
+        (JSC::Interpreter::privateExecute):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass):
+        * jit/JIT.h:
+        (JSC::JIT::compileGetByIdProto):
+        (JSC::JIT::compileGetByIdSelfList):
+        (JSC::JIT::compileGetByIdProtoList):
+        (JSC::JIT::compileGetByIdChainList):
+        (JSC::JIT::compileGetByIdChain):
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::privateCompileGetByIdProto):
+        (JSC::JIT::privateCompileGetByIdSelfList):
+        (JSC::JIT::privateCompileGetByIdProtoList):
+        (JSC::JIT::privateCompileGetByIdChainList):
+        (JSC::JIT::privateCompileGetByIdChain):
+        * jit/JITPropertyAccess32_64.cpp:
+        (JSC::JIT::privateCompileGetByIdProto):
+        (JSC::JIT::privateCompileGetByIdSelfList):
+        (JSC::JIT::privateCompileGetByIdProtoList):
+        (JSC::JIT::privateCompileGetByIdChainList):
+        (JSC::JIT::privateCompileGetByIdChain):
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::tryCacheGetByID):
+        (JSC::DEFINE_STUB_FUNCTION):
+        * jit/JITStubs.h:
+        (JSC::):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::getOwnPropertySlot):
+        * runtime/Lookup.h:
+        (JSC::getStaticPropertySlot):
+        (JSC::getStaticValueSlot):
+        * runtime/PropertySlot.h:
+        (JSC::PropertySlot::):
+        (JSC::PropertySlot::PropertySlot):
+        (JSC::PropertySlot::cachedPropertyType):
+        (JSC::PropertySlot::isCacheable):
+        (JSC::PropertySlot::isCacheableValue):
+        (JSC::PropertySlot::setValueSlot):
+        (JSC::PropertySlot::setCacheableCustom):
+        (JSC::PropertySlot::setGetterSlot):
+        (JSC::PropertySlot::setCacheableGetterSlot):
+        (JSC::PropertySlot::clearOffset):
+        (JSC::PropertySlot::customGetter):
+
+2010-03-04  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Unreviewed. Remove a non-ASCII character introduced in the following bug.
+
+        put_by_id does will incorrectly cache writes where a specific value exists, where at the point of caching the same value is being written.
+        https://bugs.webkit.org/show_bug.cgi?id=35537
+
+        * runtime/JSObject.h:
+        (JSC::JSObject::putDirectInternal):
+
+2010-03-04  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
+
+        This also allows shadow builds relying only on qmake to work properly.
+        * jsc.pro:
+        * qt/api/QtScript.pro:
+        * qt/tests/qscriptengine/qscriptengine.pro:
+        * qt/tests/qscriptvalue/qscriptvalue.pro:
+        * qt/tests/tests.pri:
+
+2010-03-03  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        QScriptValue::isObject fix.
+
+        Fix broken internal state evaluation from JSValue to JSNative / JSObject.
+        New function was introduced which should take care about promoting
+        JSValue state inside QScriptValuePrivate. It should be used instead of a
+        direct JSC C API call.
+
+        The bug exposed a weakness in autotest suite, as the QScriptValuePrivate
+        is based on state machine with lazy state evaluation, there is a possibility
+        that serial sequencial calls to the same public const function could return
+        different results. The patch fix the issue.
+
+        [Qt] Sometimes QScriptValue::isObject returns an incorrect value
+        https://bugs.webkit.org/show_bug.cgi?id=35387
+
+        * qt/api/qscriptvalue_p.h:
+        (QScriptValuePrivate::isBool):
+        (QScriptValuePrivate::isNumber):
+        (QScriptValuePrivate::isNull):
+        (QScriptValuePrivate::isString):
+        (QScriptValuePrivate::isUndefined):
+        (QScriptValuePrivate::isError):
+        (QScriptValuePrivate::isObject):
+        (QScriptValuePrivate::isFunction):
+        (QScriptValuePrivate::call):
+        (QScriptValuePrivate::refineJSValue):
+        * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
+        (tst_QScriptValue::initScriptValues):
+        (tst_QScriptValue::isValid_makeData):
+        (tst_QScriptValue::isValid_test):
+        (tst_QScriptValue::isBool_makeData):
+        (tst_QScriptValue::isBool_test):
+        (tst_QScriptValue::isBoolean_makeData):
+        (tst_QScriptValue::isBoolean_test):
+        (tst_QScriptValue::isNumber_makeData):
+        (tst_QScriptValue::isNumber_test):
+        (tst_QScriptValue::isFunction_test):
+        (tst_QScriptValue::isNull_makeData):
+        (tst_QScriptValue::isNull_test):
+        (tst_QScriptValue::isString_makeData):
+        (tst_QScriptValue::isString_test):
+        (tst_QScriptValue::isUndefined_makeData):
+        (tst_QScriptValue::isUndefined_test):
+        (tst_QScriptValue::isObject_makeData):
+        (tst_QScriptValue::isObject_test):
+        (tst_QScriptValue::toString_makeData):
+        (tst_QScriptValue::toString_test):
+        (tst_QScriptValue::toNumber_makeData):
+        (tst_QScriptValue::toNumber_test):
+        (tst_QScriptValue::toBool_makeData):
+        (tst_QScriptValue::toBool_test):
+        (tst_QScriptValue::toBoolean_makeData):
+        (tst_QScriptValue::toBoolean_test):
+        (tst_QScriptValue::toInteger_makeData):
+        (tst_QScriptValue::toInteger_test):
+        (tst_QScriptValue::toInt32_makeData):
+        (tst_QScriptValue::toInt32_test):
+        (tst_QScriptValue::toUInt32_makeData):
+        (tst_QScriptValue::toUInt32_test):
+        (tst_QScriptValue::toUInt16_makeData):
+        (tst_QScriptValue::toUInt16_test):
+
+2010-03-03  Chao-ying Fu  <fu@mips.com>
+
+        Reviewed by Gavin Barraclough.
+
+        MIPS JIT Supports
+        https://bugs.webkit.org/show_bug.cgi?id=30144
+
+        The following changes enable MIPS YARR and YARR_JIT.
+
+        * assembler/AbstractMacroAssembler.h:
+        (JSC::AbstractMacroAssembler::Imm32::Imm32):
+        * assembler/MIPSAssembler.h: Added.
+        (JSC::MIPSRegisters::):
+        (JSC::MIPSAssembler::MIPSAssembler):
+        (JSC::MIPSAssembler::):
+        (JSC::MIPSAssembler::JmpSrc::JmpSrc):
+        (JSC::MIPSAssembler::JmpDst::JmpDst):
+        (JSC::MIPSAssembler::JmpDst::isUsed):
+        (JSC::MIPSAssembler::JmpDst::used):
+        (JSC::MIPSAssembler::emitInst):
+        (JSC::MIPSAssembler::nop):
+        (JSC::MIPSAssembler::loadDelayNop):
+        (JSC::MIPSAssembler::copDelayNop):
+        (JSC::MIPSAssembler::move):
+        (JSC::MIPSAssembler::li):
+        (JSC::MIPSAssembler::lui):
+        (JSC::MIPSAssembler::addiu):
+        (JSC::MIPSAssembler::addu):
+        (JSC::MIPSAssembler::subu):
+        (JSC::MIPSAssembler::mult):
+        (JSC::MIPSAssembler::mfhi):
+        (JSC::MIPSAssembler::mflo):
+        (JSC::MIPSAssembler::mul):
+        (JSC::MIPSAssembler::andInsn):
+        (JSC::MIPSAssembler::andi):
+        (JSC::MIPSAssembler::nor):
+        (JSC::MIPSAssembler::orInsn):
+        (JSC::MIPSAssembler::ori):
+        (JSC::MIPSAssembler::xorInsn):
+        (JSC::MIPSAssembler::xori):
+        (JSC::MIPSAssembler::slt):
+        (JSC::MIPSAssembler::sltu):
+        (JSC::MIPSAssembler::sltiu):
+        (JSC::MIPSAssembler::sll):
+        (JSC::MIPSAssembler::sllv):
+        (JSC::MIPSAssembler::sra):
+        (JSC::MIPSAssembler::srav):
+        (JSC::MIPSAssembler::lw):
+        (JSC::MIPSAssembler::lwl):
+        (JSC::MIPSAssembler::lwr):
+        (JSC::MIPSAssembler::lhu):
+        (JSC::MIPSAssembler::sw):
+        (JSC::MIPSAssembler::jr):
+        (JSC::MIPSAssembler::jalr):
+        (JSC::MIPSAssembler::jal):
+        (JSC::MIPSAssembler::bkpt):
+        (JSC::MIPSAssembler::bgez):
+        (JSC::MIPSAssembler::bltz):
+        (JSC::MIPSAssembler::beq):
+        (JSC::MIPSAssembler::bne):
+        (JSC::MIPSAssembler::bc1t):
+        (JSC::MIPSAssembler::bc1f):
+        (JSC::MIPSAssembler::newJmpSrc):
+        (JSC::MIPSAssembler::appendJump):
+        (JSC::MIPSAssembler::addd):
+        (JSC::MIPSAssembler::subd):
+        (JSC::MIPSAssembler::muld):
+        (JSC::MIPSAssembler::lwc1):
+        (JSC::MIPSAssembler::ldc1):
+        (JSC::MIPSAssembler::swc1):
+        (JSC::MIPSAssembler::sdc1):
+        (JSC::MIPSAssembler::mtc1):
+        (JSC::MIPSAssembler::mfc1):
+        (JSC::MIPSAssembler::truncwd):
+        (JSC::MIPSAssembler::cvtdw):
+        (JSC::MIPSAssembler::ceqd):
+        (JSC::MIPSAssembler::cngtd):
+        (JSC::MIPSAssembler::cnged):
+        (JSC::MIPSAssembler::cltd):
+        (JSC::MIPSAssembler::cled):
+        (JSC::MIPSAssembler::cueqd):
+        (JSC::MIPSAssembler::coled):
+        (JSC::MIPSAssembler::coltd):
+        (JSC::MIPSAssembler::culed):
+        (JSC::MIPSAssembler::cultd):
+        (JSC::MIPSAssembler::label):
+        (JSC::MIPSAssembler::align):
+        (JSC::MIPSAssembler::getRelocatedAddress):
+        (JSC::MIPSAssembler::getDifferenceBetweenLabels):
+        (JSC::MIPSAssembler::size):
+        (JSC::MIPSAssembler::executableCopy):
+        (JSC::MIPSAssembler::getCallReturnOffset):
+        (JSC::MIPSAssembler::linkJump):
+        (JSC::MIPSAssembler::linkCall):
+        (JSC::MIPSAssembler::linkPointer):
+        (JSC::MIPSAssembler::relinkJump):
+        (JSC::MIPSAssembler::relinkCall):
+        (JSC::MIPSAssembler::repatchInt32):
+        (JSC::MIPSAssembler::repatchPointer):
+        (JSC::MIPSAssembler::repatchLoadPtrToLEA):
+        (JSC::MIPSAssembler::relocateJumps):
+        (JSC::MIPSAssembler::linkWithOffset):
+        (JSC::MIPSAssembler::linkCallInternal):
+        * assembler/MacroAssembler.h:
+        * assembler/MacroAssemblerMIPS.h: Added.
+        (JSC::MacroAssemblerMIPS::MacroAssemblerMIPS):
+        (JSC::MacroAssemblerMIPS::):
+        (JSC::MacroAssemblerMIPS::add32):
+        (JSC::MacroAssemblerMIPS::and32):
+        (JSC::MacroAssemblerMIPS::lshift32):
+        (JSC::MacroAssemblerMIPS::mul32):
+        (JSC::MacroAssemblerMIPS::not32):
+        (JSC::MacroAssemblerMIPS::or32):
+        (JSC::MacroAssemblerMIPS::rshift32):
+        (JSC::MacroAssemblerMIPS::sub32):
+        (JSC::MacroAssemblerMIPS::xor32):
+        (JSC::MacroAssemblerMIPS::load32):
+        (JSC::MacroAssemblerMIPS::load32WithUnalignedHalfWords):
+        (JSC::MacroAssemblerMIPS::load32WithAddressOffsetPatch):
+        (JSC::MacroAssemblerMIPS::loadPtrWithPatchToLEA):
+        (JSC::MacroAssemblerMIPS::loadPtrWithAddressOffsetPatch):
+        (JSC::MacroAssemblerMIPS::load16):
+        (JSC::MacroAssemblerMIPS::store32WithAddressOffsetPatch):
+        (JSC::MacroAssemblerMIPS::store32):
+        (JSC::MacroAssemblerMIPS::supportsFloatingPoint):
+        (JSC::MacroAssemblerMIPS::supportsFloatingPointTruncate):
+        (JSC::MacroAssemblerMIPS::pop):
+        (JSC::MacroAssemblerMIPS::push):
+        (JSC::MacroAssemblerMIPS::move):
+        (JSC::MacroAssemblerMIPS::swap):
+        (JSC::MacroAssemblerMIPS::signExtend32ToPtr):
+        (JSC::MacroAssemblerMIPS::zeroExtend32ToPtr):
+        (JSC::MacroAssemblerMIPS::branch32):
+        (JSC::MacroAssemblerMIPS::branch32WithUnalignedHalfWords):
+        (JSC::MacroAssemblerMIPS::branch16):
+        (JSC::MacroAssemblerMIPS::branchTest32):
+        (JSC::MacroAssemblerMIPS::jump):
+        (JSC::MacroAssemblerMIPS::branchAdd32):
+        (JSC::MacroAssemblerMIPS::branchMul32):
+        (JSC::MacroAssemblerMIPS::branchSub32):
+        (JSC::MacroAssemblerMIPS::breakpoint):
+        (JSC::MacroAssemblerMIPS::nearCall):
+        (JSC::MacroAssemblerMIPS::call):
+        (JSC::MacroAssemblerMIPS::ret):
+        (JSC::MacroAssemblerMIPS::set32):
+        (JSC::MacroAssemblerMIPS::setTest32):
+        (JSC::MacroAssemblerMIPS::moveWithPatch):
+        (JSC::MacroAssemblerMIPS::branchPtrWithPatch):
+        (JSC::MacroAssemblerMIPS::storePtrWithPatch):
+        (JSC::MacroAssemblerMIPS::tailRecursiveCall):
+        (JSC::MacroAssemblerMIPS::makeTailRecursiveCall):
+        (JSC::MacroAssemblerMIPS::loadDouble):
+        (JSC::MacroAssemblerMIPS::storeDouble):
+        (JSC::MacroAssemblerMIPS::addDouble):
+        (JSC::MacroAssemblerMIPS::subDouble):
+        (JSC::MacroAssemblerMIPS::mulDouble):
+        (JSC::MacroAssemblerMIPS::convertInt32ToDouble):
+        (JSC::MacroAssemblerMIPS::insertRelaxationWords):
+        (JSC::MacroAssemblerMIPS::branchTrue):
+        (JSC::MacroAssemblerMIPS::branchFalse):
+        (JSC::MacroAssemblerMIPS::branchEqual):
+        (JSC::MacroAssemblerMIPS::branchNotEqual):
+        (JSC::MacroAssemblerMIPS::branchDouble):
+        (JSC::MacroAssemblerMIPS::branchTruncateDoubleToInt32):
+        (JSC::MacroAssemblerMIPS::linkCall):
+        (JSC::MacroAssemblerMIPS::repatchCall):
+        * jit/ExecutableAllocator.h:
+        (JSC::ExecutableAllocator::cacheFlush):
+        * wtf/Platform.h:
+        * yarr/RegexJIT.cpp:
+        (JSC::Yarr::RegexGenerator::generateEnter):
+        (JSC::Yarr::RegexGenerator::generateReturn):
+
+2010-03-03  Steve Falkenburg  <sfalken@apple.com>
+
+        Windows build fix.
+
+        * JavaScriptCore.vcproj/jsc/jsc.vcproj:
+        * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
+
+2010-03-03  Steve Falkenburg  <sfalken@apple.com>
+
+        Windows build fix.
+
+        * JavaScriptCore.vcproj/jsc/jsc.vcproj:
+
+2010-03-03  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Add virtual memory tags for TCMalloc and WebCore's purgeable buffers.
+
+        * wtf/TCSystemAlloc.cpp:
+        (TryMmap): Use the VM tag.
+        * wtf/VMTags.h: Make use of VM_MEMORY_TCMALLOC and VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS.
+
+2010-03-03  Steve Falkenburg  <sfalken@apple.com>
+
+        Rubber stamped by Adam Roben.
+
+        Fix bogus xcopy that was polluting source tree at build time.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
+
+2010-03-02  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Oliver Hunt.
+
+        Allow building smoothly on win32 and win64 using GCC
+        https://bugs.webkit.org/show_bug.cgi?id=35607
+
+        * jit/JITStubs.h:
+        * runtime/Collector.cpp:
+        (JSC::Heap::allocateBlock):
+        (JSC::Heap::freeBlockPtr):
+        (JSC::currentThreadStackBase):
+
+2010-03-02  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by David Levin.
+
+        Revert database thread changes that are no longer required
+        https://bugs.webkit.org/show_bug.cgi?id=35519
+
+        Jochen Eisinger created 55214 and 55247 to track which database
+        owns which thread.  Dmitry suggested that this could also
+        be done via TLS, though.  After exploring the options, Jochen
+        chose to go the TLS route, so these patches are no longer needed.
+
+        * wtf/Threading.h:
+        * wtf/ThreadingNone.cpp:
+        (WTF::isMainThread):
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::identifierByPthreadHandle):
+        (WTF::establishIdentifierForPthreadHandle):
+        (WTF::pthreadHandleForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::currentThread):
+        * wtf/ThreadingWin.cpp:
+        (WTF::threadMap):
+        (WTF::storeThreadHandleByIdentifier):
+        (WTF::threadHandleForIdentifier):
+        (WTF::createThreadInternal):
+
+2010-03-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix QScriptValue::toString().
+
+        More ECMA Script compliance, especially for values as NaN, Inifinite
+        and really big/small numbers.
+
+        [Qt] QScriptValue::toString() returns incorrect values
+        https://bugs.webkit.org/show_bug.cgi?id=34850
+
+        * qt/api/qscriptconverter_p.h:
+        (QScriptConverter::toString):
+        * qt/api/qscriptvalue_p.h:
+        (QScriptValuePrivate::toString):
+        * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
+        * qt/tests/qscriptvalue/tst_qscriptvalue.h:
+        * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
+        (tst_QScriptValue::toString_initData):
+        (tst_QScriptValue::toString_makeData):
+        (tst_QScriptValue::toString_test):
+
+2010-03-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Introduce a new class; QScriptString.
+
+        The QScriptString class should act as a handle to "interned"
+        strings in a QScriptEngine.
+
+        [Qt] QtScript should provide QScriptString
+        https://bugs.webkit.org/show_bug.cgi?id=34843
+
+        * qt/api/QtScript.pro:
+        * qt/api/qscriptengine.cpp:
+        (QScriptEngine::toStringHandle):
+        * qt/api/qscriptengine.h:
+        * qt/api/qscriptengine_p.h:
+        (QScriptEnginePrivate::toStringHandle):
+        * qt/api/qscriptstring.cpp: Added.
+        (QScriptString::QScriptString):
+        (QScriptString::~QScriptString):
+        (QScriptString::operator=):
+        (QScriptString::isValid):
+        (QScriptString::operator==):
+        (QScriptString::operator!=):
+        (QScriptString::toArrayIndex):
+        (QScriptString::toString):
+        (QScriptString::operator QString):
+        (qHash):
+        * qt/api/qscriptstring.h: Added.
+        * qt/api/qscriptstring_p.h: Added.
+        (QScriptStringPrivate::QScriptStringPrivate):
+        (QScriptStringPrivate::~QScriptStringPrivate):
+        (QScriptStringPrivate::get):
+        (QScriptStringPrivate::isValid):
+        (QScriptStringPrivate::operator==):
+        (QScriptStringPrivate::operator!=):
+        (QScriptStringPrivate::toArrayIndex):
+        (QScriptStringPrivate::toString):
+        (QScriptStringPrivate::id):
+        * qt/tests/qscriptstring/qscriptstring.pro: Added.
+        * qt/tests/qscriptstring/tst_qscriptstring.cpp: Added.
+        (tst_QScriptString::tst_QScriptString):
+        (tst_QScriptString::~tst_QScriptString):
+        (tst_QScriptString::test):
+        (tst_QScriptString::hash):
+        (tst_QScriptString::toArrayIndex_data):
+        (tst_QScriptString::toArrayIndex):
+        * qt/tests/tests.pro:
+
+2010-03-02  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by NOBODY (Build fix).
+
+        Export function on windows.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-03-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Refactor named getter function signature to be in line with indexing getter signature
+        https://bugs.webkit.org/show_bug.cgi?id=35563
+
+        This removes the PropertySlot argument from getter functions, and makes them directly
+        pass the slot base.  This makes the semantics for the functions match that of the
+        indexing getters.
+
+        On the down side, this means that we can no longer simply use a proxy function for
+        JS getters, so we now add another marker value to indicate that a getter is present
+        and branch accordingly.
+
+        Against all rationality sunspider reports this as a perf win, but i suspect it's just noise.
+
+        * API/JSCallbackObject.h:
+        * API/JSCallbackObjectFunctions.h:
+        (JSC::::staticValueGetter):
+        (JSC::::staticFunctionGetter):
+        (JSC::::callbackGetter):
+        * JavaScriptCore.exp:
+        * runtime/JSActivation.cpp:
+        (JSC::JSActivation::argumentsGetter):
+        * runtime/JSActivation.h:
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::argumentsGetter):
+        (JSC::JSFunction::callerGetter):
+        (JSC::JSFunction::lengthGetter):
+        * runtime/JSFunction.h:
+        * runtime/NumberConstructor.cpp:
+        (JSC::numberConstructorNaNValue):
+        (JSC::numberConstructorNegInfinity):
+        (JSC::numberConstructorPosInfinity):
+        (JSC::numberConstructorMaxValue):
+        (JSC::numberConstructorMinValue):
+        * runtime/PropertySlot.cpp:
+        (JSC::PropertySlot::functionGetter):
+        * runtime/PropertySlot.h:
+        (JSC::PropertySlot::getValue):
+        (JSC::PropertySlot::setGetterSlot):
+        (JSC::PropertySlot::setCacheableGetterSlot):
+        * runtime/RegExpConstructor.cpp:
+        (JSC::regExpConstructorDollar1):
+        (JSC::regExpConstructorDollar2):
+        (JSC::regExpConstructorDollar3):
+        (JSC::regExpConstructorDollar4):
+        (JSC::regExpConstructorDollar5):
+        (JSC::regExpConstructorDollar6):
+        (JSC::regExpConstructorDollar7):
+        (JSC::regExpConstructorDollar8):
+        (JSC::regExpConstructorDollar9):
+        (JSC::regExpConstructorInput):
+        (JSC::regExpConstructorMultiline):
+        (JSC::regExpConstructorLastMatch):
+        (JSC::regExpConstructorLastParen):
+        (JSC::regExpConstructorLeftContext):
+        (JSC::regExpConstructorRightContext):
+        * runtime/RegExpObject.cpp:
+        (JSC::regExpObjectGlobal):
+        (JSC::regExpObjectIgnoreCase):
+        (JSC::regExpObjectMultiline):
+        (JSC::regExpObjectSource):
+        (JSC::regExpObjectLastIndex):
+
+2010-03-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        PropertySlot::getValue(ExecState, unsigned) unnecessarily converts index to an Identifier
+        https://bugs.webkit.org/show_bug.cgi?id=35561
+
+        Fix this by defining a separate property getter function for index getters.  This allows
+        us to pass an unsigned number without the conversion to an Identifier.  We then update
+        setCustomIndex to take this new getter type.
+
+        * runtime/PropertySlot.h:
+        (JSC::PropertySlot::getValue):
+        (JSC::PropertySlot::setCustom):
+        (JSC::PropertySlot::setCustomIndex):
+
+2010-03-01  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 35537 - put_by_id does will incorrectly cache writes where a specific value exists,
+                    where at the point of caching the same value is being written.
+
+        When performing a put_by_id that is replacing a property already present on the object,
+        there are three interesting cases regarding the state of the specific value:
+
+        (1) No specific value set - nothing to do, leave the structure in it's current state,
+            can cache.
+        (2) A specific value was set, the new put is not of a specified value (i.e. function),
+            or is of a different specific value - in these cases we need to perform a despecifying
+            transition to clear the specific value in the structure, but having done so this is a
+            normal property so as such we can again cache normally.
+        (3) A specific value was set, and we are overwriting with the same value - in these cases
+            leave the structure unchanged, but since a specific value is set we cannot cache this
+            put (we would need the JIT to dynamically check the value being written matched).
+
+        Unfortunately, the current behaviour does not match this.  the checks for a specific value
+        being present & the value matching are combined in such a way that in case (2), above we
+        will unnecessarily prevent the transition being cached, but in case (3) we will incorrectly
+        fail to prevent caching.
+
+        The bug exposes itself if multiple puts of the same specific value are performed to a
+        property, and erroneously the put is allowed to be cached by the JIT.  Method checks may be
+        generated caching calls of this structure.  Subsequent puts performed from JIT code may
+        write different values without triggering a despecify transition, and as such cached method
+        checks will continue to pass, despite the value having changed.
+
+        * runtime/JSObject.h:
+        (JSC::JSObject::putDirectInternal):
+
+2010-03-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix the Qt build on Mac OS X/Cocoa 64-bit
+
+        * JavaScriptCore.pri: Add missing implementation file to resolve JSC symbols
+
+2010-02-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber Stamped by Geoff Garen.
+
+        Remove wrec.  All builds should have switched to yarr by now.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.pri:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
+        * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * runtime/RegExp.cpp:
+        (JSC::RegExp::match):
+        * runtime/RegExp.h:
+        * wrec: Removed.
+        * wrec/CharacterClass.cpp: Removed.
+        * wrec/CharacterClass.h: Removed.
+        * wrec/CharacterClassConstructor.cpp: Removed.
+        * wrec/CharacterClassConstructor.h: Removed.
+        * wrec/Escapes.h: Removed.
+        * wrec/Quantifier.h: Removed.
+        * wrec/WREC.cpp: Removed.
+        * wrec/WREC.h: Removed.
+        * wrec/WRECFunctors.cpp: Removed.
+        * wrec/WRECFunctors.h: Removed.
+        * wrec/WRECGenerator.cpp: Removed.
+        * wrec/WRECGenerator.h: Removed.
+        * wrec/WRECParser.cpp: Removed.
+        * wrec/WRECParser.h: Removed.
+        * wscript:
+
+2010-02-26  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Make the lookup table generator include an explicit cast to expected
+        type of the function.  We do this because otherwise the blind intptr_t
+        cast that is subsequently applied allows incorrectly typed functions
+        to be inserted into the table, where they will only fail at runtime.
+        This change makes such errors produce a compile time failure.
+
+        * create_hash_table:
+
+2010-02-26  Janne Koskinen  <janne.p.koskinen@digia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Symbian specific getCPUTime implemetation
+        https://bugs.webkit.org/show_bug.cgi?id=34742
+
+        Default implementation doesn't work on Symbian devices.
+        This change adds a proper implementation by
+        asking thread execution time from the current thread.
+
+        * runtime/TimeoutChecker.cpp:
+        (JSC::getCPUTime):
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35406
+        <rdar://problem/6945502> Make generic array methods work with JavaArray
+
+        Renamed lazyCreationData to subclassData. This is extra data that can be used by JSArray
+        subclasses (you can't add new data members, because it wouldn't fit in JSCell otherwise).
+
+        * JavaScriptCore.exp:
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::JSArray):
+        (JSC::JSArray::subclassData):
+        (JSC::JSArray::setSubclassData):
+        * runtime/JSArray.h:
+        * runtime/RegExpConstructor.cpp:
+        (JSC::RegExpMatchesArray::RegExpMatchesArray):
+        (JSC::RegExpMatchesArray::~RegExpMatchesArray):
+        (JSC::RegExpMatchesArray::fillArrayInstance):
+        * runtime/RegExpMatchesArray.h:
+        (JSC::RegExpMatchesArray::getOwnPropertySlot):
+        (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
+        (JSC::RegExpMatchesArray::put):
+        (JSC::RegExpMatchesArray::deleteProperty):
+        (JSC::RegExpMatchesArray::getOwnPropertyNames):
+
+2010-02-25  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        JSC crashes like crazy in the JSPropertyNameIterator destructor
+
+        Add back null check of m_cachedStructure.  Curse last minute changes.
+
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
+
+2010-02-25  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Race condition in JSPropertyNameIterator and Structure destruction
+        https://bugs.webkit.org/show_bug.cgi?id=35398
+
+        JSPropertyNameIterator and Structure have a cyclic dependency that they
+        manage by clearing the appropriate reference in each other during their
+        destruction.  However if the Structure is destroyed while the 
+        JSPropertyNameIterator is dead but not yet finalized the Structures
+        WeakGCPtr will return null, and so prevent Structure from clearing
+        the m_cachedStructure pointer of the iterator.  When the iterator is
+        then finalised the m_cachedStructure is invalid, and the attempt to
+        clear the structures back reference fails.
+
+        To fix this we simply make JSPropertyNameIterator keep the Structure
+        alive, using the weak pointer to break the ref cycle.
+
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
+          The iterator now keeps m_cachedStructure alive itself, so no longer needs
+          to check for it being cleared
+        * runtime/JSPropertyNameIterator.h:
+        (JSC::JSPropertyNameIterator::setCachedStructure):
+          Add an assertion to ensure correct usage
+        (JSC::JSPropertyNameIterator::cachedStructure):
+          Add .get()
+        * runtime/Structure.cpp:
+        (JSC::Structure::~Structure):
+          Add an assertion that our iterator isn't already dead, and remove
+          the now unnecessary attempt to clear the ref in the iterator
+        * runtime/WeakGCPtr.h:
+        (JSC::WeakGCPtr::hasDeadObject):
+          An assert-only function to allow us to assert correct behaviour
+          in the Structure destructor
+
+2010-02-25  Jochen Eisinger  <jochen@chromium.org>
+ 
+        Reviewed by Jeremy Orlow.
+ 
+        Make the context that was passed to the ThreadFunction accessible.
+        https://bugs.webkit.org/show_bug.cgi?id=35379
+
+        When a database is opened, right now you
+        don't have any context from where it is opened. The problem is that
+        the actual calls that open a database go through the sqlite3 vfs
+        layer, so there's no easy way to pass this function down to to
+        platform/sql/chromium/SQLFileSystemChromium*.cpp
+
+        This patch will allow you to get from anywhere within webkit a pointer
+        to the Thread object that actually created the thread you're currently
+        on (in case of the database, this can be either a thread forked of
+        from the main thread or from a worker thread), and query the object
+        for context information.
+
+        * wtf/Threading.h:
+        * wtf/ThreadingNone.cpp:
+        (WTF::threadContext):
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::):
+        (WTF::identifierByPthreadHandle):
+        (WTF::establishIdentifierForPthreadHandle):
+        (WTF::pthreadHandleForIdentifier):
+        (WTF::contextForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::currentThread):
+        (WTF::threadContext):
+        * wtf/ThreadingWin.cpp:
+        (WTF::):
+        (WTF::threadMap):
+        (WTF::storeThreadHandleByIdentifier):
+        (WTF::threadHandleForIdentifier):
+        (WTF::contextForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::threadContext):
+
+2010-02-25  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reverting to re-submit with better change log.
+
+        * wtf/Threading.h:
+        * wtf/ThreadingNone.cpp:
+        (WTF::isMainThread):
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::identifierByPthreadHandle):
+        (WTF::establishIdentifierForPthreadHandle):
+        (WTF::pthreadHandleForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::currentThread):
+        * wtf/ThreadingWin.cpp:
+        (WTF::threadMap):
+        (WTF::storeThreadHandleByIdentifier):
+        (WTF::threadHandleForIdentifier):
+        (WTF::createThreadInternal):
+
+2010-02-25  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Make the context that was passed to the ThreadFunction accessible.
+        https://bugs.webkit.org/show_bug.cgi?id=35379
+
+        * wtf/Threading.h:
+        * wtf/ThreadingNone.cpp:
+        (WTF::threadContext):
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::):
+        (WTF::identifierByPthreadHandle):
+        (WTF::establishIdentifierForPthreadHandle):
+        (WTF::pthreadHandleForIdentifier):
+        (WTF::contextForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::currentThread):
+        (WTF::threadContext):
+        * wtf/ThreadingWin.cpp:
+        (WTF::):
+        (WTF::threadMap):
+        (WTF::storeThreadHandleByIdentifier):
+        (WTF::threadHandleForIdentifier):
+        (WTF::contextForIdentifier):
+        (WTF::createThreadInternal):
+        (WTF::threadContext):
+
+2010-02-24  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        [REGRESSION in r55185] EXC_BAD_ACCESS on opening inspector.
+        https://bugs.webkit.org/show_bug.cgi?id=35335
+
+        compileGetDirectOffset modifies the contents of the object register
+        when the object is not using the inline storage array.  As the object
+        register contains our 'this' pointer we can't allow it to be clobbered.
+        The fix is simply to copy the register into a separate scratch register
+        when we're loading off an object that doesn't use inline storage.
+
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::privateCompileGetByIdSelfList):
+        * jit/JITPropertyAccess32_64.cpp:
+        (JSC::JIT::privateCompileGetByIdSelfList):
+
+2010-02-24  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        Speed up getter performance in the jit
+        https://bugs.webkit.org/show_bug.cgi?id=35332
+
+        Implement getter lookup caching in the interpreter.
+        The getter stubs are generated through basically the
+        same code paths as the normal get_by_id caching.
+        Instead of simply loading a property and returning,
+        we load the getter slot, and pass the getter, base value
+        and return address to a shared stub used for getter
+        dispatch.
+
+        * jit/JIT.h:
+        (JSC::JIT::compileGetByIdProto):
+        (JSC::JIT::compileGetByIdSelfList):
+        (JSC::JIT::compileGetByIdProtoList):
+        (JSC::JIT::compileGetByIdChainList):
+        (JSC::JIT::compileGetByIdChain):
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::privateCompileGetByIdProto):
+        (JSC::JIT::privateCompileGetByIdSelfList):
+        (JSC::JIT::privateCompileGetByIdProtoList):
+        (JSC::JIT::privateCompileGetByIdChainList):
+        (JSC::JIT::privateCompileGetByIdChain):
+        * jit/JITPropertyAccess32_64.cpp:
+        (JSC::JIT::privateCompileGetByIdProto):
+        (JSC::JIT::privateCompileGetByIdSelfList):
+        (JSC::JIT::privateCompileGetByIdProtoList):
+        (JSC::JIT::privateCompileGetByIdChainList):
+        (JSC::JIT::privateCompileGetByIdChain):
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::tryCacheGetByID):
+        (JSC::DEFINE_STUB_FUNCTION):
+        * jit/JITStubs.h:
+        (JSC::):
+        * runtime/GetterSetter.h:
+
+2010-02-23  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Web Inspector: Regression: r55027+: Inspector broken
+        https://bugs.webkit.org/show_bug.cgi?id=35253
+
+        op_get_by_id_getter_chain was not passing the correct this parameter.
+        The bug was caused by incorrect use of baseCell instead of baseValue,
+        baseValue contains the original object for the lookup (and hence the
+        correct this object), baseCell is clobbered as part of walking the
+        prototype chain.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::privateExecute):
+
+2010-02-23  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Rubber-stamped by Dimitri Glazkov.
+
+        Chromium build fix.
+
+        * JavaScriptCore.gyp/JavaScriptCore.gyp:
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Changes references of GOwnPtr to reflect their new place.
+        http://webkit.org/b/35084
+
+        * JavaScriptCore/JavaScriptCore.gypi:
+        * JavaScriptCore/wtf/Threading.h:
+        * JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h:
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Adding the EFL implementation of JavaScriptCore.
+        See https://bugs.webkit.org/show_bug.cgi?id=35084 for details.
+
+        * GNUmakefile.am: Updated to reflect the new location of GOwnPtr and
+                          GRefPtr.
+        * wtf/efl/MainThreadEfl.cpp: Added.
+        * wtf/gobject/GOwnPtr.cpp: Moved from wtf/gtk.
+        * wtf/gobject/GOwnPtr.h: Moved from wtf/gtk.
+        * wtf/gobject/GRefPtr.cpp: Moved from wtf/gtk.
+        * wtf/gobject/GRefPtr.h: Moved from wtf/gtk.
+
+2010-02-22  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Remove auto_ptr usage in JavaScriptCore.
+        https://bugs.webkit.org/show_bug.cgi?id=35221
+
+        * parser/Nodes.h: Removed now unneeded adopt method.
+        * parser/Parser.cpp: Removed <memory> include as it is not required anymore.
+        * wtf/OwnPtr.h: Removed the constructor from auto_ptr.
+        * wtf/VectorTraits.h: Removed a template specialization for auto_ptr.
+        * wtf/unicode/Collator.h: Made userDefault return a PassOwnPtr.
+        * wtf/unicode/CollatorDefault.cpp:
+        (WTF::Collator::userDefault): Changed the method to match the next signature.
+        * wtf/unicode/icu/CollatorICU.cpp:
+        (WTF::Collator::userDefault): Ditto.
+
+2010-02-22  Huahui Wu  <hwu@google.com>
+
+        Reviewed by Eric Seidel.
+
+        Add code that enables SquirrelFish Extreme (a.k.a JSCX, JSC JIT)
+        in Android. It's disabled by default, but is enabled when the 
+        enveronment variable ENABLE_JSC_JIT is set to true.
+        https://bugs.webkit.org/show_bug.cgi?id=34855
+
+        * Android.mk:
+        * wtf/Platform.h:
+
+2010-02-22  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        JSStringBuilder should not CRASH if allocation fails, it should throw a JSException.
+
+        * runtime/JSGlobalObjectFunctions.cpp:
+        * runtime/JSStringBuilder.h:
+        (JSC::JSStringBuilder::JSStringBuilder):
+        (JSC::JSStringBuilder::append):
+        (JSC::JSStringBuilder::build):
+        * runtime/StringBuilder.h:
+        (JSC::StringBuilder::build):
+        * wtf/Vector.h:
+        (WTF::VectorBufferBase::tryAllocateBuffer):
+        (WTF::):
+        (WTF::VectorBuffer::tryAllocateBuffer):
+        (WTF::::tryExpandCapacity):
+        (WTF::::tryReserveCapacity):
+        (WTF::::tryAppend):
+
+2010-02-22  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Eric Seidel.
+
+        [BREWMP] Map FastMalloc to BREW memory allocator
+        https://bugs.webkit.org/show_bug.cgi?id=33570
+
+        Use MALLOC macro instead of the standard malloc function.
+        Although RVCT provides malloc, we can't use it in BREW
+        because the loader does not initialize the base address properly.
+
+        * wtf/FastMalloc.cpp:
+        * wtf/brew/SystemMallocBrew.h: Added.
+        (mallocBrew):
+        (callocBrew):
+        (freeBrew):
+        (reallocBrew):
+
+2010-02-22  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Build fix for make distcheck.
+
+        * GNUmakefile.am:
+
+2010-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed build fix.
+
+        [Qt] Build fix for RVCT.
+
+        Fix after r55024. The "-i" option is for perl not for the
+        script.
+
+        * DerivedSources.pro:
+
+2010-02-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Make UString::m_data be const, and make the UChar owned/ref-counted by CrossThreadRefCounted be const too.
+
+        * runtime/UStringImpl.cpp:
+        (JSC::UStringImpl::baseSharedBuffer):
+        (JSC::UStringImpl::~UStringImpl):
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::create):
+        (JSC::UStringImpl::data):
+        (JSC::UStringImpl::UStringImpl):
+        * wtf/OwnFastMallocPtr.h:
+        (WTF::OwnFastMallocPtr::~OwnFastMallocPtr):
+
+2010-02-21  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        HashMapTranslatorAdapter::translate() needs to set the mapped value.
+
+        HTTPHeaderMap::add(const char*, const String&) does not work
+        https://bugs.webkit.org/show_bug.cgi?id=35227
+
+        * wtf/HashMap.h:
+        (WTF::HashMapTranslatorAdapter::translate):
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-02-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        JSString::getIndex() calls value() to resolve the string value (is a rope)
+        to a UString, then passes the result to jsSingleCharacterSubstring without
+        checking for an exception.  In case of out-of-memory the returned UString
+        is null(), which may result in an out-of-buounds substring being created.
+        This is bad.
+
+        Simple fix is to be able to get an index from a rope without resolving to
+        UString.  This may be a useful optimization in some test cases.
+
+        The same bug exists in some other methods is JSString, these can be fixed
+        by changing them to call getIndex().
+
+        * runtime/JSString.cpp:
+        (JSC::JSString::resolveRope):
+        (JSC::JSString::getStringPropertyDescriptor):
+        * runtime/JSString.h:
+        (JSC::jsSingleCharacterSubstring):
+        (JSC::JSString::getIndex):
+        (JSC::jsSingleCharacterString):
+        (JSC::JSString::getStringPropertySlot):
+        * runtime/UStringImpl.cpp:
+        (JSC::singleCharacterSubstring):
+        * runtime/UStringImpl.h:
+        (JSC::UStringImpl::singleCharacterSubstring):
+
 2010-02-19  Oliver Hunt  <oliver@apple.com>
 
         RS = Gavin Barraclough.
@@ -196,7 +3857,7 @@
         another rope node.  A low bit in each pointer is used to distinguish between
         rope & string elements, in a fashion similar to the recently-removed
         PtrAndFlags class (see https://bugs.webkit.org/show_bug.cgi?id=33731 ).  Again,
-        this causes a problem for Leaks – refactor to remove the magic pointer
+        this causes a problem for Leaks - refactor to remove the magic pointer
         mangling.
 
         Move Rope out from JSString.h and rename to URopeImpl, to match UStringImpl.
@@ -639,6 +4300,40 @@
 
 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
 
+        Reviewed by Tor Arne Vestbø.
+
+        Additional refptr/passrefptr workarounds for WINSCW compiler
+        https://bugs.webkit.org/show_bug.cgi?id=28054
+
+        * wtf/PassRefPtr.h:
+        (WTF::refIfNotNull):
+        (WTF::PassRefPtr::PassRefPtr):
+        (WTF::PassRefPtr::~PassRefPtr):
+        (WTF::PassRefPtr::clear):
+        (WTF::::operator):
+        * wtf/RefPtr.h:
+        (WTF::RefPtr::RefPtr):
+        (WTF::::operator):
+
+2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Additional refptr/passrefptr workarounds for WINSCW compiler
+        https://bugs.webkit.org/show_bug.cgi?id=28054
+
+        * wtf/PassRefPtr.h:
+        (WTF::refIfNotNull):
+        (WTF::PassRefPtr::PassRefPtr):
+        (WTF::PassRefPtr::~PassRefPtr):
+        (WTF::PassRefPtr::clear):
+        (WTF::::operator):
+        * wtf/RefPtr.h:
+        (WTF::RefPtr::RefPtr):
+        (WTF::::operator):
+
+2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
+
         Reviewed by Simon Hausmann.
 
         Don't import the cmath functions from std:: for WINSCW.
@@ -7672,7 +11367,7 @@
         Fix branchDouble behaviour on ARM THUMB2 JIT.
 
         The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch
-        for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't
+        for DoubleEqualOrUnordered, however this is incorrect - ConditionEQ won't
         branch on unordered operands.  Similarly, DoubleLessThanOrUnordered &
         DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO &
         ARMv7Assembler::ConditionLS, whereas they should be using
diff --git a/JavaScriptCore/Configurations/Base.xcconfig b/JavaScriptCore/Configurations/Base.xcconfig
index c338eb7..4854b64 100644
--- a/JavaScriptCore/Configurations/Base.xcconfig
+++ b/JavaScriptCore/Configurations/Base.xcconfig
@@ -67,6 +67,8 @@
 REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator;
 REAL_PLATFORM_NAME_macosx = macosx;
 
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
+
 
 // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
 // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -92,16 +94,36 @@
 // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
 // number.  Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
 // XCODE_VERSION_ACTUAL for the full version number.
-GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR));
-GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL));
-GCC_VERSION_0310 = 4.2;
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
 
 
 // HAVE_DTRACE is disabled on Leopard due to <rdar://problem/5628149>
 HAVE_DTRACE = $(HAVE_DTRACE_$(REAL_PLATFORM_NAME));
 HAVE_DTRACE_iphoneos = 1;
 HAVE_DTRACE_iphonesimulator = 0;
-HAVE_DTRACE_macosx = $(HAVE_DTRACE_macosx_$(MAC_OS_X_VERSION_MAJOR));
+HAVE_DTRACE_macosx = $(HAVE_DTRACE_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 HAVE_DTRACE_macosx_ = $(HAVE_DTRACE_macosx_1040);
 HAVE_DTRACE_macosx_1040 = 0;
 HAVE_DTRACE_macosx_1050 = 0;
diff --git a/JavaScriptCore/Configurations/DebugRelease.xcconfig b/JavaScriptCore/Configurations/DebugRelease.xcconfig
index cbb0c8b..1e981f8 100644
--- a/JavaScriptCore/Configurations/DebugRelease.xcconfig
+++ b/JavaScriptCore/Configurations/DebugRelease.xcconfig
@@ -26,7 +26,7 @@
 ARCHS = $(ARCHS_$(REAL_PLATFORM_NAME));
 ARCHS_iphoneos = $(ARCHS_UNIVERSAL_IPHONE_OS);
 ARCHS_iphonesimulator = $(NATIVE_ARCH);
-ARCHS_macosx = $(ARCHS_macosx_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS_macosx = $(ARCHS_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ARCHS_macosx_ = $(ARCHS_macosx_1040);
 ARCHS_macosx_1040 = $(NATIVE_ARCH);
 ARCHS_macosx_1050 = $(NATIVE_ARCH);
@@ -35,7 +35,7 @@
 
 ONLY_ACTIVE_ARCH = YES;
 
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 MACOSX_DEPLOYMENT_TARGET_ = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 8343ce7..881c788 100644
--- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -31,16 +31,17 @@
 
 // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
 
-ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS;
 
-ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1070 = ENABLE_3D_RENDERING;
 
+ENABLE_BLOB_SLICE = ENABLE_BLOB_SLICE;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
 ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
 ENABLE_DATABASE = ENABLE_DATABASE;
@@ -49,6 +50,8 @@
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -56,7 +59,9 @@
 ENABLE_MATHML = ;
 ENABLE_NOTIFICATIONS = ;
 ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
+ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG;
 ENABLE_RUBY = ENABLE_RUBY;
+ENABLE_SANDBOX = ENABLE_SANDBOX;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
@@ -73,4 +78,4 @@
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/JavaScriptCore/Configurations/JavaScriptCore.xcconfig b/JavaScriptCore/Configurations/JavaScriptCore.xcconfig
index f8d6c2c..b6ba560 100644
--- a/JavaScriptCore/Configurations/JavaScriptCore.xcconfig
+++ b/JavaScriptCore/Configurations/JavaScriptCore.xcconfig
@@ -44,8 +44,7 @@
 PRODUCT_NAME = JavaScriptCore;
 
 OTHER_CFLAGS = $(OTHER_CFLAGS_$(CONFIGURATION)_$(CURRENT_VARIANT));
-OTHER_CFLAGS_Release_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL));
-OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_normal_$(XCODE_VERSION_ACTUAL));
-OTHER_CFLAGS_normal_0310 = $(OTHER_CFLAGS_normal_GCC_42);
-OTHER_CFLAGS_normal_0320 = $(OTHER_CFLAGS_normal_GCC_42);
+OTHER_CFLAGS_Release_normal = $(OTHER_CFLAGS_normal_$(TARGET_GCC_VERSION));
+OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_normal_$(TARGET_GCC_VERSION));
 OTHER_CFLAGS_normal_GCC_42 = -fomit-frame-pointer -funwind-tables;
+OTHER_CFLAGS_normal_LLVM_GCC_42 = $(OTHER_CFLAGS_normal_GCC_42);
diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig
index 0e289b1..6aeb263 100644
--- a/JavaScriptCore/Configurations/Version.xcconfig
+++ b/JavaScriptCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 MAJOR_VERSION = 533;
-MINOR_VERSION = 1;
+MINOR_VERSION = 6;
 TINY_VERSION = 0;
 FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
 
@@ -31,7 +31,7 @@
 SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
 
 // The system version prefix is based on the current system version.
-SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
+SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR.
 SYSTEM_VERSION_PREFIX_1040 = 4;
 SYSTEM_VERSION_PREFIX_1050 = 5;
diff --git a/JavaScriptCore/DerivedSources.make b/JavaScriptCore/DerivedSources.make
index 9eaccab..4fc9cad 100644
--- a/JavaScriptCore/DerivedSources.make
+++ b/JavaScriptCore/DerivedSources.make
@@ -48,6 +48,7 @@
     RegExpObject.lut.h \
     StringPrototype.lut.h \
     docs/bytecode.html \
+    RegExpJitTables.h \
 #
 
 # lookup tables for classes
@@ -74,3 +75,7 @@
 
 docs/bytecode.html: make-bytecode-docs.pl Interpreter.cpp 
 	perl $^ $@
+
+#character tables for Yarr
+RegExpJitTables.h: create_regex_tables
+	python $^ > $@
diff --git a/JavaScriptCore/DerivedSources.pro b/JavaScriptCore/DerivedSources.pro
index 28a229d..7c5aad8 100644
--- a/JavaScriptCore/DerivedSources.pro
+++ b/JavaScriptCore/DerivedSources.pro
@@ -78,7 +78,7 @@
 # GENERATOR 3: JIT Stub functions for RVCT
 rvctstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_RVCT.h
 rvctstubs.wkScript = $$PWD/create_jit_stubs
-rvctstubs.commands = perl $$rvctstubs.wkScript --prefix RVCT ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
+rvctstubs.commands = perl -i $$rvctstubs.wkScript --prefix RVCT ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
 rvctstubs.depends = ${QMAKE_FILE_NAME}
 rvctstubs.input = RVCT_STUB_FILES
 rvctstubs.CONFIG += no_link
@@ -93,3 +93,9 @@
 ctgen.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_JSC_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}
 addExtraCompiler(ctgen)
 
+#GENERATOR: "RegExpJitTables.h": tables used by Yarr
+retgen.output = $$JSC_GENERATED_SOURCES_DIR/RegExpJitTables.h
+retgen.wkScript = $$PWD/create_regex_tables 
+retgen.input = retgen.wkScript
+retgen.commands = python $$retgen.wkScript > ${QMAKE_FILE_OUT}
+addExtraCompiler(retgen)
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 53e3c65..2d024c1 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -10,11 +10,13 @@
 	-I$(srcdir)/JavaScriptCore/pcre \
 	-I$(srcdir)/JavaScriptCore/profiler \
 	-I$(srcdir)/JavaScriptCore/runtime \
-	-I$(srcdir)/JavaScriptCore/wrec \
 	-I$(srcdir)/JavaScriptCore/jit \
 	-I$(srcdir)/JavaScriptCore/assembler \
+	-I$(srcdir)/JavaScriptCore/wtf \
+	-I$(srcdir)/JavaScriptCore/wtf/text \
 	-I$(srcdir)/JavaScriptCore/wtf/unicode \
 	-I$(srcdir)/JavaScriptCore/yarr \
+	-I$(top_builddir)/JavaScriptCore \
 	-I$(top_builddir)/JavaScriptCore/pcre \
 	-I$(top_builddir)/JavaScriptCore/parser \
 	-I$(top_builddir)/JavaScriptCore/runtime
@@ -33,6 +35,7 @@
 
 javascriptcore_built_nosources += \
 	DerivedSources/Lexer.lut.h \
+	JavaScriptCore/RegExpJitTables.h \
 	JavaScriptCore/runtime/ArrayPrototype.lut.h \
 	JavaScriptCore/runtime/DatePrototype.lut.h \
 	JavaScriptCore/runtime/JSONObject.lut.h \
@@ -210,19 +213,12 @@
 	JavaScriptCore/runtime/StructureChain.cpp \
 	JavaScriptCore/runtime/StructureChain.h \
 	JavaScriptCore/runtime/StructureTransitionTable.h \
+	JavaScriptCore/runtime/Terminator.h \
 	JavaScriptCore/runtime/TimeoutChecker.cpp \
 	JavaScriptCore/runtime/TimeoutChecker.h \
 	JavaScriptCore/runtime/JSTypeInfo.h \
 	JavaScriptCore/runtime/WeakGCMap.h \
 	JavaScriptCore/runtime/WeakGCPtr.h \
-	JavaScriptCore/wrec/CharacterClass.h \
-	JavaScriptCore/wrec/CharacterClassConstructor.h \
-	JavaScriptCore/wrec/Escapes.h \
-	JavaScriptCore/wrec/Quantifier.h \
-	JavaScriptCore/wrec/WREC.h \
-	JavaScriptCore/wrec/WRECFunctors.h \
-	JavaScriptCore/wrec/WRECGenerator.h \
-	JavaScriptCore/wrec/WRECParser.h \
 	JavaScriptCore/wtf/ASCIICType.h \
 	JavaScriptCore/wtf/AVLTree.h \
 	JavaScriptCore/wtf/AlwaysInline.h \
@@ -264,7 +260,6 @@
 	JavaScriptCore/wtf/PassRefPtr.h \
 	JavaScriptCore/wtf/Platform.h \
 	JavaScriptCore/wtf/PossiblyNull.h \
-	JavaScriptCore/wtf/PtrAndFlags.h \
 	JavaScriptCore/wtf/RandomNumber.cpp \
 	JavaScriptCore/wtf/RandomNumber.h \
 	JavaScriptCore/wtf/RandomNumberSeed.h \
@@ -275,6 +270,7 @@
 	JavaScriptCore/wtf/RefPtrHashMap.h \
 	JavaScriptCore/wtf/RetainPtr.h \
 	JavaScriptCore/wtf/SegmentedVector.h \
+	JavaScriptCore/wtf/StaticConstructors.h \
 	JavaScriptCore/wtf/StdLibExtras.h \
 	JavaScriptCore/wtf/StringExtras.h \
 	JavaScriptCore/wtf/StringHashFunctions.h \
@@ -293,12 +289,24 @@
 	JavaScriptCore/wtf/ValueCheck.h \
 	JavaScriptCore/wtf/Vector.h \
 	JavaScriptCore/wtf/VectorTraits.h \
-	JavaScriptCore/wtf/gtk/GOwnPtr.cpp \
-	JavaScriptCore/wtf/gtk/GOwnPtr.h \
-	JavaScriptCore/wtf/gtk/GRefPtr.cpp \
-	JavaScriptCore/wtf/gtk/GRefPtr.h \
+	JavaScriptCore/wtf/WTFThreadData.cpp \
+	JavaScriptCore/wtf/WTFThreadData.h \
+	JavaScriptCore/wtf/gobject/GOwnPtr.cpp \
+	JavaScriptCore/wtf/gobject/GOwnPtr.h \
+	JavaScriptCore/wtf/gobject/GRefPtr.cpp \
+	JavaScriptCore/wtf/gobject/GRefPtr.h \
 	JavaScriptCore/wtf/gtk/MainThreadGtk.cpp \
 	JavaScriptCore/wtf/gtk/ThreadingGtk.cpp \
+	JavaScriptCore/wtf/text/AtomicString.cpp \
+	JavaScriptCore/wtf/text/AtomicString.h \
+	JavaScriptCore/wtf/text/AtomicStringImpl.h \
+	JavaScriptCore/wtf/text/CString.cpp \
+	JavaScriptCore/wtf/text/CString.h \
+	JavaScriptCore/wtf/text/StringHash.h \
+	JavaScriptCore/wtf/text/StringImpl.cpp \
+	JavaScriptCore/wtf/text/StringImpl.h \
+	JavaScriptCore/wtf/text/WTFString.cpp \
+	JavaScriptCore/wtf/text/WTFString.h \
 	JavaScriptCore/wtf/unicode/Collator.h \
 	JavaScriptCore/wtf/unicode/CollatorDefault.cpp \
 	JavaScriptCore/wtf/unicode/UTF8.cpp \
@@ -494,6 +502,8 @@
 	JavaScriptCore/runtime/RegExpObject.h \
 	JavaScriptCore/runtime/RegExpPrototype.cpp \
 	JavaScriptCore/runtime/RegExpPrototype.h \
+	JavaScriptCore/runtime/RopeImpl.cpp \
+	JavaScriptCore/runtime/RopeImpl.h \
 	JavaScriptCore/runtime/ScopeChain.cpp \
 	JavaScriptCore/runtime/ScopeChain.h \
 	JavaScriptCore/runtime/ScopeChainMark.h \
@@ -508,7 +518,6 @@
 	JavaScriptCore/runtime/Tracing.h \
 	JavaScriptCore/runtime/UString.cpp \
 	JavaScriptCore/runtime/UString.h \
-	JavaScriptCore/runtime/UStringImpl.cpp \
 	JavaScriptCore/runtime/UStringImpl.h \
 	JavaScriptCore/runtime/WeakRandom.h \
 	JavaScriptCore/wtf/FastAllocBase.h \
@@ -538,6 +547,9 @@
 JavaScriptCore/%.lut.h: $(CREATE_HASH_TABLE) $(srcdir)/JavaScriptCore/%.cpp
 	$(PERL) $^ -i > $@
 
+JavaScriptCore/RegExpJitTables.h: $(srcdir)/JavaScriptCore/create_regex_tables
+	$(PYTHON) $(srcdir)/JavaScriptCore/create_regex_tables > $@
+
 JavaScriptCore/pcre/chartables.c: $(srcdir)/JavaScriptCore/pcre/dftables
 	$(PERL) $^ $@
 
@@ -598,6 +610,7 @@
 
 javascriptcore_dist += \
 	$(CREATE_HASH_TABLE) \
+	$(CREATE_REGEXP_TABLES) \
 	JavaScriptCore/AUTHORS \
 	JavaScriptCore/COPYING.LIB \
 	JavaScriptCore/ChangeLog \
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index 9355321..e8e34ee 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -18,8 +18,10 @@
 _JSObjectCallAsConstructor
 _JSObjectCallAsFunction
 _JSObjectCopyPropertyNames
+_JSObjectDeletePrivateProperty
 _JSObjectDeleteProperty
 _JSObjectGetPrivate
+_JSObjectGetPrivateProperty
 _JSObjectGetProperty
 _JSObjectGetPropertyAtIndex
 _JSObjectGetPrototype
@@ -35,6 +37,7 @@
 _JSObjectMakeFunctionWithCallback
 _JSObjectMakeRegExp
 _JSObjectSetPrivate
+_JSObjectSetPrivateProperty
 _JSObjectSetProperty
 _JSObjectSetPropertyAtIndex
 _JSObjectSetPrototype
@@ -57,6 +60,7 @@
 _JSStringIsEqualToUTF8CString
 _JSStringRelease
 _JSStringRetain
+_JSValueCreateJSONString
 _JSValueGetType
 _JSValueIsBoolean
 _JSValueIsEqual
@@ -69,6 +73,7 @@
 _JSValueIsString
 _JSValueIsUndefined
 _JSValueMakeBoolean
+_JSValueMakeFromJSONString
 _JSValueMakeNull
 _JSValueMakeNumber
 _JSValueMakeString
@@ -79,6 +84,10 @@
 _JSValueToObject
 _JSValueToStringCopy
 _JSValueUnprotect
+_JSWeakObjectMapClear
+_JSWeakObjectMapCreate
+_JSWeakObjectMapGet
+_JSWeakObjectMapSet
 _WTFLog
 _WTFLogVerbose
 _WTFReportArgumentAssertionFailure
@@ -90,12 +99,14 @@
 __Z15jsRegExpCompilePKti24JSRegExpIgnoreCaseOption23JSRegExpMultilineOptionPjPPKc
 __Z15jsRegExpExecutePK8JSRegExpPKtiiPii
 __ZN14OpaqueJSString6createERKN3JSC7UStringE
-__ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPNS_11UStringImplE
-__ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPNS_11UStringImplE
-__ZN3JSC10Identifier24checkSameIdentifierTableEPNS_12JSGlobalDataEPNS_11UStringImplE
-__ZN3JSC10Identifier24checkSameIdentifierTableEPNS_9ExecStateEPNS_11UStringImplE
+__ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPN7WebCore10StringImplE
+__ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPN7WebCore10StringImplE
+__ZN3JSC10Identifier27checkCurrentIdentifierTableEPNS_12JSGlobalDataE
+__ZN3JSC10Identifier27checkCurrentIdentifierTableEPNS_9ExecStateE
 __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc
-__ZN3JSC10Identifier5equalEPKNS_11UStringImplEPKc
+__ZN3JSC10Identifier4fromEPNS_9ExecStateEi
+__ZN3JSC10Identifier4fromEPNS_9ExecStateEj
+__ZN3JSC10Identifier5equalEPKN7WebCore10StringImplEPKc
 __ZN3JSC10JSFunctionC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE
 __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE
 __ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc
@@ -103,23 +114,20 @@
 __ZN3JSC11JSByteArray15createStructureENS_7JSValueE
 __ZN3JSC11JSByteArrayC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEPNS3_9ByteArrayEPKNS_9ClassInfoE
 __ZN3JSC11ParserArena5resetEv
-__ZN3JSC11UStringImpl12sharedBufferEv
-__ZN3JSC11UStringImpl7s_emptyE
-__ZN3JSC11UStringImplD1Ev
 __ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeE
 __ZN3JSC12DateInstance4infoE
 __ZN3JSC12DateInstanceC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEd
 __ZN3JSC12DateInstanceC1EPNS_9ExecStateEd
 __ZN3JSC12JSGlobalData10ClientDataD2Ev
 __ZN3JSC12JSGlobalData11jsArrayVPtrE
-__ZN3JSC12JSGlobalData12createLeakedEv
+__ZN3JSC12JSGlobalData12createLeakedENS_15ThreadStackTypeE
 __ZN3JSC12JSGlobalData12jsStringVPtrE
 __ZN3JSC12JSGlobalData12stopSamplingEv
 __ZN3JSC12JSGlobalData13startSamplingEv
 __ZN3JSC12JSGlobalData14dumpSampleDataEPNS_9ExecStateE
 __ZN3JSC12JSGlobalData14resetDateCacheEv
 __ZN3JSC12JSGlobalData14sharedInstanceEv
-__ZN3JSC12JSGlobalData6createEv
+__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeE
 __ZN3JSC12JSGlobalDataD1Ev
 __ZN3JSC12SamplingTool5setupEv
 __ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE
@@ -163,7 +171,7 @@
 __ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
 __ZN3JSC16toUInt32SlowCaseEdRb
 __ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb
-__ZN3JSC17PropertyNameArray3addEPNS_11UStringImplE
+__ZN3JSC17PropertyNameArray3addEPN7WebCore10StringImplE
 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE
 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectES6_RKNS_7ArgListEE
 __ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
@@ -184,8 +192,6 @@
 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
-__ZN3JSC25g_identifierTableSpecificE
-__ZN3JSC29createIdentifierTableSpecificEv
 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
 __ZN3JSC3NaNE
 __ZN3JSC4Heap14primaryHeapEndEv
@@ -203,12 +209,10 @@
 __ZN3JSC4Heap8allocateEm
 __ZN3JSC4Heap9unprotectENS_7JSValueE
 __ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
-__ZN3JSC5equalEPKNS_11UStringImplES2_
 __ZN3JSC6JSCell11getCallDataERNS_8CallDataE
 __ZN3JSC6JSCell11getJSNumberEv
 __ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateEj
-__ZN3JSC6JSCell14toThisJSStringEPNS_9ExecStateE
 __ZN3JSC6JSCell16getConstructDataERNS_13ConstructDataE
 __ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
@@ -224,12 +228,14 @@
 __ZN3JSC6JSLock9lockCountEv
 __ZN3JSC6JSLockC1EPNS_9ExecStateE
 __ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE
-__ZN3JSC7CStringD1Ev
-__ZN3JSC7CStringaSERKS0_
+__ZN3JSC7JSArray12markChildrenERNS_9MarkStackE
+__ZN3JSC7JSArray15setSubclassDataEPv
 __ZN3JSC7JSArray4infoE
 __ZN3JSC7JSArray9setLengthEj
 __ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEE
 __ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE
+__ZN3JSC7JSArrayC2EN3WTF17NonNullPassRefPtrINS_9StructureEEE
+__ZN3JSC7JSArrayD2Ev
 __ZN3JSC7Profile10restoreAllEv
 __ZN3JSC7Profile5focusEPKNS_11ProfileNodeE
 __ZN3JSC7Profile7excludeEPKNS_11ProfileNodeE
@@ -238,7 +244,6 @@
 __ZN3JSC7UString4fromEi
 __ZN3JSC7UString4fromEj
 __ZN3JSC7UString4fromEl
-__ZN3JSC7UString9s_nullRepE
 __ZN3JSC7UStringC1EPKc
 __ZN3JSC7UStringC1EPKtj
 __ZN3JSC8Debugger23recompileAllJSFunctionsEPNS_12JSGlobalDataE
@@ -280,7 +285,7 @@
 __ZN3JSC9MarkStack12releaseStackEPvm
 __ZN3JSC9MarkStack13allocateStackEm
 __ZN3JSC9MarkStack18initializePagesizeEv
-__ZN3JSC9Structure13hasTransitionEPNS_11UStringImplEj
+__ZN3JSC9Structure13hasTransitionEPN7WebCore10StringImplEj
 __ZN3JSC9Structure17stopIgnoringLeaksEv
 __ZN3JSC9Structure18startIgnoringLeaksEv
 __ZN3JSC9Structure21addPropertyTransitionEPS0_RKNS_10IdentifierEjPNS_6JSCellERm
@@ -289,7 +294,7 @@
 __ZN3JSC9Structure27despecifyDictionaryFunctionERKNS_10IdentifierE
 __ZN3JSC9Structure27despecifyFunctionTransitionEPS0_RKNS_10IdentifierE
 __ZN3JSC9Structure28addPropertyWithoutTransitionERKNS_10IdentifierEjPNS_6JSCellE
-__ZN3JSC9Structure3getEPKNS_11UStringImplERjRPNS_6JSCellE
+__ZN3JSC9Structure3getEPKN7WebCore10StringImplERjRPNS_6JSCellE
 __ZN3JSC9Structure40addPropertyTransitionToExistingStructureEPS0_RKNS_10IdentifierEjPNS_6JSCellERm
 __ZN3JSC9StructureC1ENS_7JSValueERKNS_8TypeInfoEj
 __ZN3JSC9StructureD1Ev
@@ -307,9 +312,13 @@
 __ZN3WTF12detachThreadEj
 __ZN3WTF12isMainThreadEv
 __ZN3WTF12randomNumberEv
+__ZN3WTF13WTFThreadData10staticDataE
+__ZN3WTF13WTFThreadDataC1Ev
+__ZN3WTF13WTFThreadDataD1Ev
 __ZN3WTF13currentThreadEv
 __ZN3WTF13tryFastCallocEmm
 __ZN3WTF13tryFastMallocEm
+__ZN3WTF14fastMallocSizeEPKv
 __ZN3WTF15ThreadCondition4waitERNS_5MutexE
 __ZN3WTF15ThreadCondition6signalEv
 __ZN3WTF15ThreadCondition9broadcastEv
@@ -343,7 +352,12 @@
 __ZN3WTF5MutexC1Ev
 __ZN3WTF5MutexD1Ev
 __ZN3WTF6strtodEPKcPPc
+__ZN3WTF7CString11mutableDataEv
+__ZN3WTF7CString16newUninitializedEmRPc
+__ZN3WTF7CStringC1EPKc
+__ZN3WTF7CStringC1EPKcj
 __ZN3WTF7Unicode18convertUTF16ToUTF8EPPKtS2_PPcS4_b
+__ZN3WTF7Unicode18convertUTF8ToUTF16EPPKcS2_PPtS4_b
 __ZN3WTF8Collator18setOrderLowerFirstEb
 __ZN3WTF8CollatorC1EPKc
 __ZN3WTF8CollatorD1Ev
@@ -351,9 +365,93 @@
 __ZN3WTF8msToYearEd
 __ZN3WTF9ByteArray6createEm
 __ZN3WTF9dayInYearEdi
+__ZN3WTFeqERKNS_7CStringES2_
+__ZN7WebCore10StringImpl11reverseFindEPS0_ib
+__ZN7WebCore10StringImpl11reverseFindEti
+__ZN7WebCore10StringImpl12sharedBufferEv
+__ZN7WebCore10StringImpl18simplifyWhiteSpaceEv
+__ZN7WebCore10StringImpl19characterStartingAtEj
+__ZN7WebCore10StringImpl19createUninitializedEjRPt
+__ZN7WebCore10StringImpl22containsOnlyWhitespaceEv
+__ZN7WebCore10StringImpl23defaultWritingDirectionEv
+__ZN7WebCore10StringImpl37createStrippingNullCharactersSlowCaseEPKtj
+__ZN7WebCore10StringImpl4findEPFbtEi
+__ZN7WebCore10StringImpl4findEPKcib
+__ZN7WebCore10StringImpl4findEPS0_ib
+__ZN7WebCore10StringImpl4findEti
+__ZN7WebCore10StringImpl5adoptERNS_12StringBufferE
+__ZN7WebCore10StringImpl5emptyEv
+__ZN7WebCore10StringImpl5lowerEv
+__ZN7WebCore10StringImpl5toIntEPb
+__ZN7WebCore10StringImpl5upperEv
+__ZN7WebCore10StringImpl6createEPKc
+__ZN7WebCore10StringImpl6createEPKtj
+__ZN7WebCore10StringImpl6createEPKtjN3WTF10PassRefPtrINS3_21CrossThreadRefCountedINS3_16OwnFastMallocPtrIS1_EEEEEE
+__ZN7WebCore10StringImpl6secureEt
+__ZN7WebCore10StringImpl7replaceEPS0_S1_
+__ZN7WebCore10StringImpl7replaceEjjPS0_
+__ZN7WebCore10StringImpl7replaceEtPS0_
+__ZN7WebCore10StringImpl7replaceEtt
+__ZN7WebCore10StringImpl8endsWithEPS0_b
+__ZN7WebCore10StringImpl9substringEjj
+__ZN7WebCore10StringImplD1Ev
+__ZN7WebCore11commentAtomE
+__ZN7WebCore12AtomicString3addEPKc
+__ZN7WebCore12AtomicString3addEPKt
+__ZN7WebCore12AtomicString3addEPKtj
+__ZN7WebCore12AtomicString3addEPKtjj
+__ZN7WebCore12AtomicString3addEPNS_10StringImplE
+__ZN7WebCore12AtomicString4findEPKtjj
+__ZN7WebCore12AtomicString4initEv
+__ZN7WebCore15charactersToIntEPKtmPb
+__ZN7WebCore17charactersToFloatEPKtmPb
+__ZN7WebCore17equalIgnoringCaseEPKtPKcj
+__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplEPKc
+__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplES1_
+__ZN7WebCore18charactersToDoubleEPKtmPb
+__ZN7WebCore20equalIgnoringNullityEPNS_10StringImplES1_
+__ZN7WebCore21charactersToIntStrictEPKtmPbi
+__ZN7WebCore22charactersToUIntStrictEPKtmPbi
+__ZN7WebCore5equalEPKNS_10StringImplEPKc
+__ZN7WebCore5equalEPKNS_10StringImplES2_
+__ZN7WebCore6String26fromUTF8WithLatin1FallbackEPKcm
+__ZN7WebCore6String29charactersWithNullTerminationEv
+__ZN7WebCore6String6appendEPKtj
+__ZN7WebCore6String6appendERKS0_
+__ZN7WebCore6String6appendEc
+__ZN7WebCore6String6appendEt
+__ZN7WebCore6String6formatEPKcz
+__ZN7WebCore6String6insertERKS0_j
+__ZN7WebCore6String6numberEd
+__ZN7WebCore6String6numberEi
+__ZN7WebCore6String6numberEj
+__ZN7WebCore6String6numberEl
+__ZN7WebCore6String6numberEm
+__ZN7WebCore6String6numberEt
+__ZN7WebCore6String6numberEx
+__ZN7WebCore6String6numberEy
+__ZN7WebCore6String6removeEji
+__ZN7WebCore6String8fromUTF8EPKc
+__ZN7WebCore6String8fromUTF8EPKcm
+__ZN7WebCore6String8truncateEj
+__ZN7WebCore6StringC1EPKc
+__ZN7WebCore6StringC1EPKcj
+__ZN7WebCore6StringC1EPKt
+__ZN7WebCore6StringC1EPKtj
+__ZN7WebCore7xmlAtomE
+__ZN7WebCore8nullAtomE
+__ZN7WebCore8starAtomE
+__ZN7WebCore8textAtomE
+__ZN7WebCore9emptyAtomE
+__ZN7WebCore9xmlnsAtomE
+__ZN7WebCoreeqERKNS_12AtomicStringEPKc
+__ZN7WebCoreplEPKcRKNS_6StringE
+__ZN7WebCoreplERKNS_6StringEPKc
+__ZN7WebCoreplERKNS_6StringES2_
 __ZNK3JSC10JSFunction23isHostFunctionNonInlineEv
 __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE
 __ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE
+__ZNK3JSC12PropertySlot14functionGetterEPNS_9ExecStateE
 __ZNK3JSC14JSGlobalObject14isDynamicScopeEv
 __ZNK3JSC16InternalFunction9classInfoEv
 __ZNK3JSC16JSVariableObject16isVariableObjectEv
@@ -373,7 +471,6 @@
 __ZNK3JSC4Heap11objectCountEv
 __ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
 __ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE
-__ZNK3JSC6JSCell12toThisStringEPNS_9ExecStateE
 __ZNK3JSC6JSCell14isGetterSetterEv
 __ZNK3JSC6JSCell8toNumberEPNS_9ExecStateE
 __ZNK3JSC6JSCell8toObjectEPNS_9ExecStateE
@@ -384,6 +481,7 @@
 __ZNK3JSC6JSCell9getUInt32ERj
 __ZNK3JSC6JSCell9toBooleanEPNS_9ExecStateE
 __ZNK3JSC7ArgList8getSliceEiRS0_
+__ZNK3JSC7JSArray12subclassDataEv
 __ZNK3JSC7JSValue16toObjectSlowCaseEPNS_9ExecStateE
 __ZNK3JSC7JSValue19synthesizePrototypeEPNS_9ExecStateE
 __ZNK3JSC7JSValue20toThisObjectSlowCaseEPNS_9ExecStateE
@@ -407,7 +505,39 @@
 __ZNK3JSC8JSString11resolveRopeEPNS_9ExecStateE
 __ZNK3JSC9HashTable11createTableEPNS_12JSGlobalDataE
 __ZNK3JSC9HashTable11deleteTableEv
+__ZNK3WTF7CString4dataEv
+__ZNK3WTF7CString6lengthEv
 __ZNK3WTF8Collator7collateEPKtmS2_m
+__ZNK7WebCore12AtomicString5lowerEv
+__ZNK7WebCore6String10charactersEv
+__ZNK7WebCore6String11toIntStrictEPbi
+__ZNK7WebCore6String12toUIntStrictEPbi
+__ZNK7WebCore6String14threadsafeCopyEv
+__ZNK7WebCore6String15stripWhiteSpaceEv
+__ZNK7WebCore6String16removeCharactersEPFbtE
+__ZNK7WebCore6String17crossThreadStringEv
+__ZNK7WebCore6String18simplifyWhiteSpaceEv
+__ZNK7WebCore6String19characterStartingAtEj
+__ZNK7WebCore6String4utf8Ev
+__ZNK7WebCore6String5asciiEv
+__ZNK7WebCore6String5lowerEv
+__ZNK7WebCore6String5splitERKS0_RN3WTF6VectorIS0_Lm0EEE
+__ZNK7WebCore6String5splitERKS0_bRN3WTF6VectorIS0_Lm0EEE
+__ZNK7WebCore6String5splitEtRN3WTF6VectorIS0_Lm0EEE
+__ZNK7WebCore6String5splitEtbRN3WTF6VectorIS0_Lm0EEE
+__ZNK7WebCore6String5toIntEPb
+__ZNK7WebCore6String5upperEv
+__ZNK7WebCore6String6latin1Ev
+__ZNK7WebCore6String6lengthEv
+__ZNK7WebCore6String6toUIntEPb
+__ZNK7WebCore6String7isEmptyEv
+__ZNK7WebCore6String7toFloatEPb
+__ZNK7WebCore6String8foldCaseEv
+__ZNK7WebCore6String8toDoubleEPb
+__ZNK7WebCore6String8toIntPtrEPb
+__ZNK7WebCore6String8toUInt64EPb
+__ZNK7WebCore6String9substringEjj
+__ZNK7WebCore6StringixEj
 __ZTVN3JSC12StringObjectE
 __ZTVN3JSC14JSGlobalObjectE
 __ZTVN3JSC15JSWrapperObjectE
diff --git a/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp b/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp
index 66f40e9..b2ccf1a 100644
--- a/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp
+++ b/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp
@@ -114,7 +114,7 @@
         # ... Then include what we want.
         ['include', '../wtf/'],
         # GLib/GTK, even though its name doesn't really indicate.
-        ['exclude', '/(gtk|glib)/.*\\.(cpp|h)$'],
+        ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'],
         ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx)\\.(cpp|mm)$'],
         ['exclude', 'wtf/CurrentTime\\.cpp$'],
         ['exclude', 'wtf/TC.*\\.(cpp|h)$'],
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index c0eb086..ad2d09e 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -325,26 +325,13 @@
             'runtime/StructureChain.h',
             'runtime/StructureTransitionTable.h',
             'runtime/SymbolTable.h',
+            'runtime/Terminator.h',
             'runtime/TimeoutChecker.cpp',
             'runtime/TimeoutChecker.h',
             'runtime/Tracing.h',
             'runtime/UString.cpp',
             'runtime/UString.h',
             'runtime/WeakRandom.h',
-            'wrec/CharacterClass.cpp',
-            'wrec/CharacterClass.h',
-            'wrec/CharacterClassConstructor.cpp',
-            'wrec/CharacterClassConstructor.h',
-            'wrec/Escapes.h',
-            'wrec/Quantifier.h',
-            'wrec/WREC.cpp',
-            'wrec/WREC.h',
-            'wrec/WRECFunctors.cpp',
-            'wrec/WRECFunctors.h',
-            'wrec/WRECGenerator.cpp',
-            'wrec/WRECGenerator.h',
-            'wrec/WRECParser.cpp',
-            'wrec/WRECParser.h',
             'wtf/AlwaysInline.h',
             'wtf/ASCIICType.h',
             'wtf/Assertions.cpp',
@@ -368,8 +355,8 @@
             'wtf/FastMalloc.h',
             'wtf/Forward.h',
             'wtf/GetPtr.h',
-            'wtf/gtk/GOwnPtr.cpp',
-            'wtf/gtk/GOwnPtr.h',
+            'wtf/gobject/GOwnPtr.cpp',
+            'wtf/gobject/GOwnPtr.h',
             'wtf/gtk/MainThreadGtk.cpp',
             'wtf/gtk/ThreadingGtk.cpp',
             'wtf/HashCountedSet.h',
@@ -409,11 +396,13 @@
             'wtf/RefPtrHashMap.h',
             'wtf/RetainPtr.h',
             'wtf/SegmentedVector.h',
+            'wtf/StaticConstructors.h',
             'wtf/StdLibExtras.h',
             'wtf/StringExtras.h',
             'wtf/StringHashFunctions.h',
             'wtf/TCPackedCache.h',
             'wtf/qt/MainThreadQt.cpp',
+            'wtf/qt/StringQt.cpp',
             'wtf/qt/ThreadingQt.cpp',
             'wtf/TCPageMap.h',
             'wtf/TCSpinLock.h',
@@ -430,6 +419,16 @@
             'wtf/ThreadSpecificWin.cpp',
             'wtf/TypeTraits.cpp',
             'wtf/TypeTraits.h',
+            'wtf/text/AtomicString.cpp',
+            'wtf/text/AtomicString.h',
+            'wtf/text/AtomicStringImpl.h',
+            'wtf/text/CString.cpp',
+            'wtf/text/CString.h',
+            'wtf/text/StringHash.h',
+            'wtf/text/StringImpl.cpp',
+            'wtf/text/StringImpl.h',
+            'wtf/text/WTFString.cpp',
+            'wtf/text/WTFString.h',
             'wtf/unicode/Collator.h',
             'wtf/unicode/CollatorDefault.cpp',
             'wtf/unicode/glib/UnicodeGLib.cpp',
@@ -446,6 +445,8 @@
             'wtf/Vector.h',
             'wtf/VectorTraits.h',
             'wtf/VMTags.h',
+            'wtf/WTFThreadData.cpp',
+            'wtf/WTFThreadData.h',
             'wtf/win/MainThreadWin.cpp',
             'wtf/wx/MainThreadWx.cpp',
             'yarr/RegexCompiler.cpp',
diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri
index d4cfe10..24c8ce5 100644
--- a/JavaScriptCore/JavaScriptCore.pri
+++ b/JavaScriptCore/JavaScriptCore.pri
@@ -1,5 +1,6 @@
 # JavaScriptCore - Qt4 build info
 VPATH += $$PWD
+JAVASCRIPTCORE_TARGET = jscore
 
 CONFIG(standalone_package) {
     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
@@ -7,15 +8,12 @@
     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
 }
 
-CONFIG(debug, debug|release) {
-    OBJECTS_DIR = obj/debug
-} else { # Release
-    OBJECTS_DIR = obj/release
-}
+CONFIG(standalone_package): DEFINES *= NDEBUG
 
 symbian: {
     # Need to guarantee this comes before system includes of /epoc32/include
     MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler"
+    LIBS += -lhal
 }
 
 INCLUDEPATH = \
@@ -31,8 +29,8 @@
     $$PWD/pcre \
     $$PWD/profiler \
     $$PWD/runtime \
-    $$PWD/wrec \
     $$PWD/wtf \
+    $$PWD/wtf/symbian \
     $$PWD/wtf/unicode \
     $$PWD/yarr \
     $$PWD/API \
@@ -40,11 +38,10 @@
     $$JSC_GENERATED_SOURCES_DIR \
     $$INCLUDEPATH
 
+win32-*: DEFINES += _HAS_TR1=0
+
 DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
 
-win32-* {
-    LIBS += -lwinmm
-}
 contains(JAVASCRIPTCORE_JIT,yes) {
     DEFINES+=ENABLE_JIT=1
     DEFINES+=ENABLE_YARR_JIT=1
@@ -56,177 +53,48 @@
     DEFINES+=ENABLE_YARR=0
 }
 
-# Rules when JIT enabled (not disabled)
-!contains(DEFINES, ENABLE_JIT=0) {
-    linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
-        QMAKE_CXXFLAGS += -fno-stack-protector
-        QMAKE_CFLAGS += -fno-stack-protector
-    }
-}
-
 wince* {
     INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
-    SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
     DEFINES += WINCEBASIC
+
+    INCLUDEPATH += $$PWD/../JavaScriptCore/os-wince
+    INCLUDEPATH += $$PWD/../JavaScriptCore/os-win32
 }
 
-include(pcre/pcre.pri)
 
-SOURCES += \
-    API/JSBase.cpp \
-    API/JSCallbackConstructor.cpp \
-    API/JSCallbackFunction.cpp \
-    API/JSCallbackObject.cpp \
-    API/JSClassRef.cpp \
-    API/JSContextRef.cpp \
-    API/JSObjectRef.cpp \
-    API/JSStringRef.cpp \
-    API/JSValueRef.cpp \
-    API/OpaqueJSString.cpp \
-    assembler/ARMAssembler.cpp \
-    assembler/MacroAssemblerARM.cpp \
-    bytecode/CodeBlock.cpp \
-    bytecode/JumpTable.cpp \
-    bytecode/Opcode.cpp \
-    bytecode/SamplingTool.cpp \
-    bytecode/StructureStubInfo.cpp \
-    bytecompiler/BytecodeGenerator.cpp \
-    bytecompiler/NodesCodegen.cpp \
-    debugger/DebuggerActivation.cpp \
-    debugger/DebuggerCallFrame.cpp \
-    debugger/Debugger.cpp \
-    interpreter/CallFrame.cpp \
-    interpreter/Interpreter.cpp \
-    interpreter/RegisterFile.cpp \
-    jit/ExecutableAllocatorPosix.cpp \
-    jit/ExecutableAllocatorSymbian.cpp \
-    jit/ExecutableAllocatorWin.cpp \
-    jit/ExecutableAllocator.cpp \
-    jit/JITArithmetic.cpp \
-    jit/JITCall.cpp \
-    jit/JIT.cpp \
-    jit/JITOpcodes.cpp \
-    jit/JITPropertyAccess.cpp \
-    jit/JITPropertyAccess32_64.cpp \
-    jit/JITStubs.cpp \
-    parser/Lexer.cpp \
-    parser/Nodes.cpp \
-    parser/ParserArena.cpp \
-    parser/Parser.cpp \
-    profiler/Profile.cpp \
-    profiler/ProfileGenerator.cpp \
-    profiler/ProfileNode.cpp \
-    profiler/Profiler.cpp \
-    runtime/ArgList.cpp \
-    runtime/Arguments.cpp \
-    runtime/ArrayConstructor.cpp \
-    runtime/ArrayPrototype.cpp \
-    runtime/BooleanConstructor.cpp \
-    runtime/BooleanObject.cpp \
-    runtime/BooleanPrototype.cpp \
-    runtime/CallData.cpp \
-    runtime/Collector.cpp \
-    runtime/CommonIdentifiers.cpp \
-    runtime/Completion.cpp \
-    runtime/ConstructData.cpp \
-    runtime/DateConstructor.cpp \
-    runtime/DateConversion.cpp \
-    runtime/DateInstance.cpp \
-    runtime/DatePrototype.cpp \
-    runtime/ErrorConstructor.cpp \
-    runtime/Error.cpp \
-    runtime/ErrorInstance.cpp \
-    runtime/ErrorPrototype.cpp \
-    runtime/ExceptionHelpers.cpp \
-    runtime/Executable.cpp \
-    runtime/FunctionConstructor.cpp \
-    runtime/FunctionPrototype.cpp \
-    runtime/GetterSetter.cpp \
-    runtime/GlobalEvalFunction.cpp \
-    runtime/Identifier.cpp \
-    runtime/InitializeThreading.cpp \
-    runtime/InternalFunction.cpp \
-    runtime/JSActivation.cpp \
-    runtime/JSAPIValueWrapper.cpp \
-    runtime/JSArray.cpp \
-    runtime/JSByteArray.cpp \
-    runtime/JSCell.cpp \
-    runtime/JSFunction.cpp \
-    runtime/JSGlobalData.cpp \
-    runtime/JSGlobalObject.cpp \
-    runtime/JSGlobalObjectFunctions.cpp \
-    runtime/JSImmediate.cpp \
-    runtime/JSLock.cpp \
-    runtime/JSNotAnObject.cpp \
-    runtime/JSNumberCell.cpp \
-    runtime/JSObject.cpp \
-    runtime/JSONObject.cpp \
-    runtime/JSPropertyNameIterator.cpp \
-    runtime/JSStaticScopeObject.cpp \
-    runtime/JSString.cpp \
-    runtime/JSValue.cpp \
-    runtime/JSVariableObject.cpp \
-    runtime/JSWrapperObject.cpp \
-    runtime/LiteralParser.cpp \
-    runtime/Lookup.cpp \
-    runtime/MarkStackPosix.cpp \
-    runtime/MarkStackSymbian.cpp \
-    runtime/MarkStackWin.cpp \
-    runtime/MarkStack.cpp \
-    runtime/MathObject.cpp \
-    runtime/NativeErrorConstructor.cpp \
-    runtime/NativeErrorPrototype.cpp \
-    runtime/NumberConstructor.cpp \
-    runtime/NumberObject.cpp \
-    runtime/NumberPrototype.cpp \
-    runtime/ObjectConstructor.cpp \
-    runtime/ObjectPrototype.cpp \
-    runtime/Operations.cpp \
-    runtime/PropertyDescriptor.cpp \
-    runtime/PropertyNameArray.cpp \
-    runtime/PropertySlot.cpp \
-    runtime/PrototypeFunction.cpp \
-    runtime/RegExpConstructor.cpp \
-    runtime/RegExp.cpp \
-    runtime/RegExpObject.cpp \
-    runtime/RegExpPrototype.cpp \
-    runtime/ScopeChain.cpp \
-    runtime/SmallStrings.cpp \
-    runtime/StringConstructor.cpp \
-    runtime/StringObject.cpp \
-    runtime/StringPrototype.cpp \
-    runtime/StructureChain.cpp \
-    runtime/Structure.cpp \
-    runtime/TimeoutChecker.cpp \
-    runtime/UString.cpp \
-    runtime/UStringImpl.cpp \
-    wtf/Assertions.cpp \
-    wtf/ByteArray.cpp \
-    wtf/CurrentTime.cpp \
-    wtf/DateMath.cpp \
-    wtf/dtoa.cpp \
-    wtf/FastMalloc.cpp \
-    wtf/HashTable.cpp \
-    wtf/MainThread.cpp \
-    wtf/qt/MainThreadQt.cpp \
-    wtf/qt/ThreadingQt.cpp \
-    wtf/RandomNumber.cpp \
-    wtf/RefCountedLeakCounter.cpp \
-    wtf/ThreadingNone.cpp \
-    wtf/Threading.cpp \
-    wtf/TypeTraits.cpp \
-    wtf/unicode/CollatorDefault.cpp \
-    wtf/unicode/icu/CollatorICU.cpp \
-    wtf/unicode/UTF8.cpp \
-    yarr/RegexCompiler.cpp \
-    yarr/RegexInterpreter.cpp \
-    yarr/RegexJIT.cpp
+defineTest(addJavaScriptCoreLib) {
+    pathToJavaScriptCoreOutput = $$ARGS
+    CONFIG(debug_and_release):CONFIG(debug, debug|release): pathToJavaScriptCoreOutput = $$pathToJavaScriptCoreOutput/debug
+    CONFIG(debug_and_release):CONFIG(release, debug|release): pathToJavaScriptCoreOutput = $$pathToJavaScriptCoreOutput/release
 
-# Generated files, simply list them for JavaScriptCore
-SOURCES += \
-    $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp
+    win32-msvc*|wince* {
+        LIBS += -L$$pathToJavaScriptCoreOutput
+        LIBS += -l$$JAVASCRIPTCORE_TARGET
+        POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
+    } else:symbian {
+        LIBS += -l$${JAVASCRIPTCORE_TARGET}.lib
+        POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
+    } else {
+        # Make sure jscore will be early in the list of libraries to workaround a bug in MinGW
+        # that can't resolve symbols from QtCore if libjscore comes after.
+        QMAKE_LIBDIR = $$pathToJavaScriptCoreOutput $$QMAKE_LIBDIR
+        LIBS += -l$$JAVASCRIPTCORE_TARGET
+        POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}lib$${JAVASCRIPTCORE_TARGET}.a
+    }
 
-!contains(DEFINES, USE_SYSTEM_MALLOC) {
-    SOURCES += wtf/TCSystemAlloc.cpp
+    win32-* {
+        LIBS += -lwinmm
+    }
+
+    # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
+    # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
+    # statically in applications (which isn't used often because, among other things, of licensing obstacles).
+    CONFIG -= explicitlib
+
+    export(QMAKE_LIBDIR)
+    export(LIBS)
+    export(POST_TARGETDEPS)
+    export(CONFIG)
+
+    return(true)
 }
-
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
index 0d6becb..f33be05 100644
--- a/JavaScriptCore/JavaScriptCore.pro
+++ b/JavaScriptCore/JavaScriptCore.pro
@@ -1,28 +1,21 @@
 # JavaScriptCore - qmake build info
 CONFIG += building-libs
 include($$PWD/../WebKit.pri)
+include(JavaScriptCore.pri)
 
 TEMPLATE = lib
 CONFIG += staticlib
-TARGET = JavaScriptCore
+# Don't use JavaScriptCore as the target name. qmake would create a JavaScriptCore.vcproj for msvc
+# which already exists as a directory
+TARGET = $$JAVASCRIPTCORE_TARGET
+QT += core
 
 CONFIG += depend_includepath
 
 contains(QT_CONFIG, embedded):CONFIG += embedded
 
-CONFIG(QTDIR_build) {
-    GENERATED_SOURCES_DIR = $$PWD/generated
-    OLDDESTDIR = $$DESTDIR
-    include($$QT_SOURCE_TREE/src/qbase.pri)
-    INSTALLS =
-    DESTDIR = $$OLDDESTDIR
-    DEFINES *= NDEBUG
-}
-
-isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
-GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
-
-INCLUDEPATH += $$GENERATED_SOURCES_DIR
+CONFIG(debug_and_release):CONFIG(debug, debug|release): DESTDIR = debug
+CONFIG(debug_and_release):CONFIG(release, debug|release): DESTDIR = release
 
 !CONFIG(QTDIR_build) {
     CONFIG(debug, debug|release) {
@@ -30,20 +23,16 @@
     } else { # Release
         OBJECTS_DIR = obj/release
     }
+    # Make sure that build_all follows the build_all config in WebCore
+    mac:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework):!build_pass:CONFIG += build_all
 }
 
-CONFIG(release):!CONFIG(QTDIR_build) {
-    contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-    unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
+CONFIG(QTDIR_build) {
+    # Remove the following 2 lines if you want debug information in JavaScriptCore
+    CONFIG -= separate_debug_info
+    CONFIG += no_debug_info
 }
 
-linux-*: DEFINES += HAVE_STDINT_H
-freebsd-*: DEFINES += HAVE_PTHREAD_NP_H
-
-DEFINES += BUILD_WEBKIT
-
-win32-*: DEFINES += _HAS_TR1=0
-
 # Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
 win32-g++ {
     TMPPATH            = $$quote($$(INCLUDE))
@@ -52,11 +41,185 @@
     QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
 }
 
-DEFINES += WTF_CHANGES=1
-
-include(JavaScriptCore.pri)
-
-QMAKE_EXTRA_TARGETS += generated_files
-
 *-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
 *-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
+
+# Rules when JIT enabled (not disabled)
+!contains(DEFINES, ENABLE_JIT=0) {
+    linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
+        QMAKE_CXXFLAGS += -fno-stack-protector
+        QMAKE_CFLAGS += -fno-stack-protector
+    }
+}
+
+wince* {
+    SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
+}
+
+include(pcre/pcre.pri)
+
+SOURCES += \
+    API/JSBase.cpp \
+    API/JSCallbackConstructor.cpp \
+    API/JSCallbackFunction.cpp \
+    API/JSCallbackObject.cpp \
+    API/JSClassRef.cpp \
+    API/JSContextRef.cpp \
+    API/JSObjectRef.cpp \
+    API/JSStringRef.cpp \
+    API/JSValueRef.cpp \
+    API/OpaqueJSString.cpp \
+    assembler/ARMAssembler.cpp \
+    assembler/MacroAssemblerARM.cpp \
+    bytecode/CodeBlock.cpp \
+    bytecode/JumpTable.cpp \
+    bytecode/Opcode.cpp \
+    bytecode/SamplingTool.cpp \
+    bytecode/StructureStubInfo.cpp \
+    bytecompiler/BytecodeGenerator.cpp \
+    bytecompiler/NodesCodegen.cpp \
+    debugger/DebuggerActivation.cpp \
+    debugger/DebuggerCallFrame.cpp \
+    debugger/Debugger.cpp \
+    interpreter/CallFrame.cpp \
+    interpreter/Interpreter.cpp \
+    interpreter/RegisterFile.cpp \
+    jit/ExecutableAllocatorFixedVMPool.cpp \
+    jit/ExecutableAllocatorPosix.cpp \
+    jit/ExecutableAllocatorSymbian.cpp \
+    jit/ExecutableAllocatorWin.cpp \
+    jit/ExecutableAllocator.cpp \
+    jit/JITArithmetic.cpp \
+    jit/JITCall.cpp \
+    jit/JIT.cpp \
+    jit/JITOpcodes.cpp \
+    jit/JITPropertyAccess.cpp \
+    jit/JITPropertyAccess32_64.cpp \
+    jit/JITStubs.cpp \
+    parser/Lexer.cpp \
+    parser/Nodes.cpp \
+    parser/ParserArena.cpp \
+    parser/Parser.cpp \
+    profiler/Profile.cpp \
+    profiler/ProfileGenerator.cpp \
+    profiler/ProfileNode.cpp \
+    profiler/Profiler.cpp \
+    runtime/ArgList.cpp \
+    runtime/Arguments.cpp \
+    runtime/ArrayConstructor.cpp \
+    runtime/ArrayPrototype.cpp \
+    runtime/BooleanConstructor.cpp \
+    runtime/BooleanObject.cpp \
+    runtime/BooleanPrototype.cpp \
+    runtime/CallData.cpp \
+    runtime/Collector.cpp \
+    runtime/CommonIdentifiers.cpp \
+    runtime/Completion.cpp \
+    runtime/ConstructData.cpp \
+    runtime/DateConstructor.cpp \
+    runtime/DateConversion.cpp \
+    runtime/DateInstance.cpp \
+    runtime/DatePrototype.cpp \
+    runtime/ErrorConstructor.cpp \
+    runtime/Error.cpp \
+    runtime/ErrorInstance.cpp \
+    runtime/ErrorPrototype.cpp \
+    runtime/ExceptionHelpers.cpp \
+    runtime/Executable.cpp \
+    runtime/FunctionConstructor.cpp \
+    runtime/FunctionPrototype.cpp \
+    runtime/GetterSetter.cpp \
+    runtime/GlobalEvalFunction.cpp \
+    runtime/Identifier.cpp \
+    runtime/InitializeThreading.cpp \
+    runtime/InternalFunction.cpp \
+    runtime/JSActivation.cpp \
+    runtime/JSAPIValueWrapper.cpp \
+    runtime/JSArray.cpp \
+    runtime/JSByteArray.cpp \
+    runtime/JSCell.cpp \
+    runtime/JSFunction.cpp \
+    runtime/JSGlobalData.cpp \
+    runtime/JSGlobalObject.cpp \
+    runtime/JSGlobalObjectFunctions.cpp \
+    runtime/JSImmediate.cpp \
+    runtime/JSLock.cpp \
+    runtime/JSNotAnObject.cpp \
+    runtime/JSNumberCell.cpp \
+    runtime/JSObject.cpp \
+    runtime/JSONObject.cpp \
+    runtime/JSPropertyNameIterator.cpp \
+    runtime/JSStaticScopeObject.cpp \
+    runtime/JSString.cpp \
+    runtime/JSValue.cpp \
+    runtime/JSVariableObject.cpp \
+    runtime/JSWrapperObject.cpp \
+    runtime/LiteralParser.cpp \
+    runtime/Lookup.cpp \
+    runtime/MarkStackPosix.cpp \
+    runtime/MarkStackSymbian.cpp \
+    runtime/MarkStackWin.cpp \
+    runtime/MarkStack.cpp \
+    runtime/MathObject.cpp \
+    runtime/NativeErrorConstructor.cpp \
+    runtime/NativeErrorPrototype.cpp \
+    runtime/NumberConstructor.cpp \
+    runtime/NumberObject.cpp \
+    runtime/NumberPrototype.cpp \
+    runtime/ObjectConstructor.cpp \
+    runtime/ObjectPrototype.cpp \
+    runtime/Operations.cpp \
+    runtime/PropertyDescriptor.cpp \
+    runtime/PropertyNameArray.cpp \
+    runtime/PropertySlot.cpp \
+    runtime/PrototypeFunction.cpp \
+    runtime/RegExpConstructor.cpp \
+    runtime/RegExp.cpp \
+    runtime/RegExpObject.cpp \
+    runtime/RegExpPrototype.cpp \
+    runtime/RopeImpl.cpp \
+    runtime/ScopeChain.cpp \
+    runtime/SmallStrings.cpp \
+    runtime/StringConstructor.cpp \
+    runtime/StringObject.cpp \
+    runtime/StringPrototype.cpp \
+    runtime/StructureChain.cpp \
+    runtime/Structure.cpp \
+    runtime/TimeoutChecker.cpp \
+    runtime/UString.cpp \
+    wtf/Assertions.cpp \
+    wtf/ByteArray.cpp \
+    wtf/CurrentTime.cpp \
+    wtf/DateMath.cpp \
+    wtf/dtoa.cpp \
+    wtf/FastMalloc.cpp \
+    wtf/HashTable.cpp \
+    wtf/MainThread.cpp \
+    wtf/qt/MainThreadQt.cpp \
+    wtf/qt/StringQt.cpp \
+    wtf/qt/ThreadingQt.cpp \
+    wtf/RandomNumber.cpp \
+    wtf/RefCountedLeakCounter.cpp \
+    wtf/symbian/BlockAllocatorSymbian.cpp \
+    wtf/ThreadingNone.cpp \
+    wtf/Threading.cpp \
+    wtf/TypeTraits.cpp \
+    wtf/WTFThreadData.cpp \
+    wtf/text/AtomicString.cpp \
+    wtf/text/CString.cpp \
+    wtf/text/StringImpl.cpp \
+    wtf/text/WTFString.cpp \
+    wtf/unicode/CollatorDefault.cpp \
+    wtf/unicode/icu/CollatorICU.cpp \
+    wtf/unicode/UTF8.cpp \
+    yarr/RegexCompiler.cpp \
+    yarr/RegexInterpreter.cpp \
+    yarr/RegexJIT.cpp
+
+# Generated files, simply list them for JavaScriptCore
+SOURCES += \
+    $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp
+
+!contains(DEFINES, USE_SYSTEM_MALLOC) {
+    SOURCES += wtf/TCSystemAlloc.cpp
+}
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 9e1e74a..76f2fa7 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -1,5 +1,7 @@
 EXPORTS
-    
+
+    ??0CString@WTF@@QAE@PBD@Z
+    ??0CString@WTF@@QAE@PBDI@Z
     ??0Collator@WTF@@QAE@PBD@Z
     ??0DateInstance@JSC@@QAE@PAVExecState@1@N@Z
     ??0DateInstance@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@N@Z
@@ -13,12 +15,16 @@
     ??0PrototypeFunction@JSC@@QAE@PAVExecState@1@HABVIdentifier@1@P6I?AVJSValue@1@0PAVJSObject@1@V41@ABVArgList@1@@Z@Z
     ??0PrototypeFunction@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I?AVJSValue@1@0PAVJSObject@1@V61@ABVArgList@1@@Z@Z
     ??0RefCountedLeakCounter@WTF@@QAE@PBD@Z
+    ??0String@WebCore@@QAE@PBD@Z
+    ??0String@WebCore@@QAE@PBDI@Z
+    ??0String@WebCore@@QAE@PB_W@Z
+    ??0String@WebCore@@QAE@PB_WI@Z
     ??0StringObject@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVUString@1@@Z
     ??0Structure@JSC@@AAE@VJSValue@1@ABVTypeInfo@1@I@Z
     ??0ThreadCondition@WTF@@QAE@XZ
     ??0UString@JSC@@QAE@PBD@Z
     ??0UString@JSC@@QAE@PB_WI@Z
-    ??1CString@JSC@@QAE@XZ
+    ??0WTFThreadData@WTF@@QAE@XZ
     ??1ClientData@JSGlobalData@JSC@@UAE@XZ
     ??1Collator@WTF@@QAE@XZ
     ??1Debugger@JSC@@UAE@XZ
@@ -27,23 +33,40 @@
     ??1JSGlobalObject@JSC@@UAE@XZ
     ??1Mutex@WTF@@QAE@XZ
     ??1RefCountedLeakCounter@WTF@@QAE@XZ
+    ??1StringImpl@WebCore@@QAE@XZ
     ??1Structure@JSC@@QAE@XZ
     ??1ThreadCondition@WTF@@QAE@XZ
-    ??1UStringImpl@JSC@@AAE@XZ
+    ??1WTFThreadData@WTF@@QAE@XZ
     ??2JSGlobalObject@JSC@@SAPAXIPAVJSGlobalData@1@@Z
     ??8JSC@@YA_NABVUString@0@0@Z
+    ??8WTF@@YA_NABVCString@0@0@Z
+    ??8WebCore@@YA_NABVAtomicString@0@PBD@Z
+    ??AString@WebCore@@QBE_WI@Z
+    ??HWebCore@@YA?AVString@0@ABV10@0@Z
+    ??HWebCore@@YA?AVString@0@ABV10@PBD@Z
+    ??HWebCore@@YA?AVString@0@PBDABV10@@Z
     ?NaN@JSC@@3NB
-    ?UTF8String@UString@JSC@@QBE?AVCString@2@_N@Z
+    ?UTF8String@UString@JSC@@QBE?AVCString@WTF@@_N@Z
+    ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PAVStringImpl@2@@Z
+    ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PBD@Z
+    ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_W@Z
+    ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WI@Z
+    ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WII@Z
+    ?add@Identifier@JSC@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PAVExecState@2@PBD@Z
+    ?add@PropertyNameArray@JSC@@QAEXPAVStringImpl@WebCore@@@Z
     ?addPropertyTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
     ?addPropertyTransitionToExistingStructure@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
     ?addPropertyWithoutTransition@Structure@JSC@@QAEIABVIdentifier@2@IPAVJSCell@2@@Z
-    ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VUStringImpl@JSC@@@WTF@@PAVExecState@2@PAVUStringImpl@2@@Z
-    ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VUStringImpl@JSC@@@WTF@@PAVJSGlobalData@2@PAVUStringImpl@2@@Z
-    ?add@Identifier@JSC@@SA?AV?$PassRefPtr@VUStringImpl@JSC@@@WTF@@PAVExecState@2@PBD@Z
-    ?add@PropertyNameArray@JSC@@QAEXPAVUStringImpl@2@@Z
+    ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PAVExecState@2@PAVStringImpl@WebCore@@@Z
+    ?adopt@StringImpl@WebCore@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@AAVStringBuffer@2@@Z
     ?allocate@Heap@JSC@@QAEPAXI@Z
     ?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z
     ?allocateStack@MarkStack@JSC@@CAPAXI@Z
+    ?append@String@WebCore@@QAEXABV12@@Z
+    ?append@String@WebCore@@QAEXD@Z
+    ?append@String@WebCore@@QAEXPB_WI@Z
+    ?append@String@WebCore@@QAEX_W@Z
+    ?ascii@String@WebCore@@QBE?AV?$Vector@D$0A@@WTF@@XZ
     ?ascii@UString@JSC@@QBEPADXZ
     ?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
     ?broadcast@ThreadCondition@WTF@@QAEXXZ
@@ -52,43 +75,62 @@
     ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
     ?callOnMainThreadAndWait@WTF@@YAXP6AXPAX@Z0@Z
     ?changePrototypeTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@VJSValue@2@@Z
-    ?checkSameIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@PAVUStringImpl@2@@Z
-    ?checkSameIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@PAVUStringImpl@2@@Z
+    ?characterStartingAt@String@WebCore@@QBEHI@Z
+    ?characters@String@WebCore@@QBEPB_WXZ
+    ?charactersToDouble@WebCore@@YANPB_WIPA_N@Z
+    ?charactersToFloat@WebCore@@YAMPB_WIPA_N@Z
+    ?charactersToInt@WebCore@@YAHPB_WIPA_N@Z
+    ?charactersToIntStrict@WebCore@@YAHPB_WIPA_NH@Z
+    ?charactersToUIntStrict@WebCore@@YAIPB_WIPA_NH@Z
+    ?charactersWithNullTermination@String@WebCore@@QAEPB_WXZ
+    ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@@Z
+    ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z
     ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z
     ?classInfo@InternalFunction@JSC@@UBEPBUClassInfo@2@XZ
     ?classInfo@JSCell@JSC@@UBEPBUClassInfo@2@XZ
     ?className@JSObject@JSC@@UBE?AVUString@2@XZ
     ?collate@Collator@WTF@@QBE?AW4Result@12@PB_WI0I@Z
     ?collectAllGarbage@Heap@JSC@@QAEXXZ
+    ?commentAtom@WebCore@@3VAtomicString@1@B
     ?configurable@PropertyDescriptor@JSC@@QBE_NXZ
     ?construct@JSC@@YAPAVJSObject@1@PAVExecState@1@VJSValue@1@W4ConstructType@1@ABTConstructData@1@ABVArgList@1@@Z
     ?constructArray@JSC@@YAPAVJSArray@1@PAVExecState@1@ABVArgList@1@@Z
     ?constructEmptyArray@JSC@@YAPAVJSArray@1@PAVExecState@1@@Z
     ?constructEmptyObject@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
     ?constructFunction@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVArgList@1@ABVIdentifier@1@ABVUString@1@H@Z
+    ?containsOnlyWhitespace@StringImpl@WebCore@@QAE_NXZ
     ?convertUTF16ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPB_WPB_WPAPADPAD_N@Z
+    ?convertUTF8ToUTF16@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBDPBDPAPA_WPA_W_N@Z
     ?create@ByteArray@WTF@@SA?AV?$PassRefPtr@VByteArray@WTF@@@2@I@Z
-    ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@XZ
+    ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@@Z
     ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z
+    ?create@StringImpl@WebCore@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PBD@Z
+    ?create@StringImpl@WebCore@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WI@Z
+    ?create@StringImpl@WebCore@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WIV?$PassRefPtr@V?$CrossThreadRefCounted@V?$OwnFastMallocPtr@$$CB_W@WTF@@@WTF@@@4@@Z
     ?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z
     ?createInheritorID@JSObject@JSC@@AAEPAVStructure@2@XZ
     ?createInterruptedExecutionException@JSC@@YA?AVJSValue@1@PAVJSGlobalData@1@@Z
-    ?createLeaked@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@XZ
+    ?createLeaked@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@@Z
     ?createSingleCharacterString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@E@Z
     ?createStackOverflowError@JSC@@YA?AVJSValue@1@PAVExecState@1@@Z
+    ?createStrippingNullCharactersSlowCase@StringImpl@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WI@Z
     ?createStructure@JSByteArray@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@VJSValue@2@@Z
     ?createTable@HashTable@JSC@@ABEXPAVJSGlobalData@2@@Z
     ?createThread@WTF@@YAIP6APAXPAX@Z0@Z
     ?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
     ?createTypeError@JSC@@YA?AVJSValue@1@PAVExecState@1@PBD@Z
+    ?createUninitialized@StringImpl@WebCore@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@IAAPA_W@Z
+    ?crossThreadString@String@WebCore@@QBE?AV12@XZ
     ?currentThread@WTF@@YAIXZ
     ?currentTime@WTF@@YANXZ
+    ?data@CString@WTF@@QBEPBDXZ
     ?dateToDaysFrom1970@WTF@@YANHHH@Z
     ?dayInMonthFromDayInYear@WTF@@YAHH_N@Z
     ?dayInYear@WTF@@YAHNH@Z
     ?decrement@RefCountedLeakCounter@WTF@@QAEXXZ
     ?defaultAttributes@PropertyDescriptor@JSC@@0IA
     ?defaultValue@JSObject@JSC@@UBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z
+    ?defaultWritingDirection@StringImpl@WebCore@@QAE?AW4Direction@Unicode@WTF@@XZ
     ?defineGetter@JSGlobalObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@PAVJSObject@2@I@Z
     ?defineGetter@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@PAV12@I@Z
     ?defineOwnProperty@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@_N@Z
@@ -113,24 +155,47 @@
     ?didTimeOut@TimeoutChecker@JSC@@QAE_NPAVExecState@2@@Z
     ?doubleToStringInJavaScriptFormat@WTF@@YAXNQADPAI@Z
     ?dumpSampleData@JSGlobalData@JSC@@QAEXPAVExecState@2@@Z
+    ?empty@StringImpl@WebCore@@SAPAV12@XZ
+    ?emptyAtom@WebCore@@3VAtomicString@1@B
+    ?endsWith@StringImpl@WebCore@@QAE_NPAV12@_N@Z
     ?enumerable@PropertyDescriptor@JSC@@QBE_NXZ
-    ?equal@Identifier@JSC@@SA_NPBVUStringImpl@2@PBD@Z
-    ?equal@JSC@@YA_NPBVUStringImpl@1@0@Z
+    ?equal@Identifier@JSC@@SA_NPBVStringImpl@WebCore@@PBD@Z
+    ?equal@WebCore@@YA_NPBVStringImpl@1@0@Z
+    ?equal@WebCore@@YA_NPBVStringImpl@1@PBD@Z
+    ?equalIgnoringCase@WebCore@@YA_NPAVStringImpl@1@0@Z
+    ?equalIgnoringCase@WebCore@@YA_NPAVStringImpl@1@PBD@Z
+    ?equalIgnoringCase@WebCore@@YA_NPB_WPBDI@Z
+    ?equalIgnoringNullity@WebCore@@YA_NPAVStringImpl@1@0@Z
     ?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVUString@2@AAV32@@Z
     ?evaluate@JSC@@YA?AVCompletion@1@PAVExecState@1@AAVScopeChain@1@ABVSourceCode@1@VJSValue@1@@Z
     ?exclude@Profile@JSC@@QAEXPBVProfileNode@2@@Z
     ?fastCalloc@WTF@@YAPAXII@Z
     ?fastFree@WTF@@YAXPAX@Z
     ?fastMalloc@WTF@@YAPAXI@Z
+    ?fastMallocSize@WTF@@YAIPBX@Z
     ?fastRealloc@WTF@@YAPAXPAXI@Z
     ?fastStrDup@WTF@@YAPADPBD@Z
     ?fastZeroedMalloc@WTF@@YAPAXI@Z
     ?fillGetterPropertySlot@JSObject@JSC@@QAEXAAVPropertySlot@2@PAVJSValue@2@@Z
+    ?find@AtomicString@WebCore@@SAPAVAtomicStringImpl@2@PB_WII@Z
+    ?find@StringImpl@WebCore@@QAEHP6A_N_W@ZH@Z
+    ?find@StringImpl@WebCore@@QAEHPAV12@H_N@Z
+    ?find@StringImpl@WebCore@@QAEHPBDH_N@Z
+    ?find@StringImpl@WebCore@@QAEH_WH@Z
     ?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z
+    ?foldCase@String@WebCore@@QBE?AV12@XZ
+    ?format@String@WebCore@@SA?AV12@PBDZZ
+    ?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z
+    ?from@Identifier@JSC@@SA?AV12@PAVExecState@2@I@Z
     ?from@UString@JSC@@SA?AV12@H@Z
     ?from@UString@JSC@@SA?AV12@I@Z
     ?from@UString@JSC@@SA?AV12@N@Z
+    ?fromUTF8@String@WebCore@@SA?AV12@PBD@Z
+    ?fromUTF8@String@WebCore@@SA?AV12@PBDI@Z
+    ?fromUTF8WithLatin1Fallback@String@WebCore@@SA?AV12@PBDI@Z
+    ?functionGetter@PropertySlot@JSC@@ABE?AVJSValue@2@PAVExecState@2@@Z
     ?functionName@DebuggerCallFrame@JSC@@QBEPBVUString@2@XZ
+    ?get@Structure@JSC@@QAEIPBVStringImpl@WebCore@@AAIAAPAVJSCell@2@@Z
     ?getCallData@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z
     ?getConstructData@JSCell@JSC@@UAE?AW4ConstructType@2@AATConstructData@2@@Z
     ?getJSNumber@JSCell@JSC@@UAE?AVJSValue@2@XZ
@@ -157,25 +222,27 @@
     ?getString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z
     ?getString@JSCell@JSC@@QBE_NPAVExecState@2@AAVUString@2@@Z
     ?getUInt32@JSCell@JSC@@UBE_NAAI@Z
-    ?get@Structure@JSC@@QAEIPBVUStringImpl@2@AAIAAPAVJSCell@2@@Z
     ?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ
     ?globalExec@JSGlobalObject@JSC@@UAEPAVExecState@2@XZ
     ?globalObjectCount@Heap@JSC@@QAEIXZ
     ?hasInstance@JSObject@JSC@@UAE_NPAVExecState@2@VJSValue@2@1@Z
     ?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@ABVIdentifier@2@@Z
     ?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@I@Z
-    ?hasTransition@Structure@JSC@@QAE_NPAVUStringImpl@2@I@Z
+    ?hasTransition@Structure@JSC@@QAE_NPAVStringImpl@WebCore@@I@Z
     ?heap@Heap@JSC@@SAPAV12@VJSValue@2@@Z
     ?increment@RefCountedLeakCounter@WTF@@QAEXXZ
+    ?init@AtomicString@WebCore@@SAXXZ
     ?init@JSGlobalObject@JSC@@AAEXPAVJSObject@2@@Z
     ?initializeMainThread@WTF@@YAXXZ
     ?initializeThreading@JSC@@YAXXZ
     ?initializeThreading@WTF@@YAXXZ
+    ?insert@String@WebCore@@QAEXABV12@I@Z
     ?is8Bit@UString@JSC@@QBE_NXZ
     ?isAccessorDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
     ?isBusy@Heap@JSC@@QAE_NXZ
     ?isDataDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
     ?isDynamicScope@JSGlobalObject@JSC@@UBE_NXZ
+    ?isEmpty@String@WebCore@@QBE_NXZ
     ?isGetterSetter@JSCell@JSC@@UBE_NXZ
     ?isHostFunctionNonInline@JSFunction@JSC@@ABE_NXZ
     ?isMainThread@WTF@@YA_NXZ
@@ -186,11 +253,17 @@
     ?jsRegExpExecute@@YAHPBUJSRegExp@@PB_WHHPAHH@Z
     ?jsRegExpFree@@YAXPAUJSRegExp@@@Z
     ?jsString@JSC@@YAPAVJSString@1@PAVJSGlobalData@1@ABVUString@1@@Z
+    ?latin1@String@WebCore@@QBE?AVCString@WTF@@XZ
+    ?length@CString@WTF@@QBEIXZ
+    ?length@String@WebCore@@QBEIXZ
     ?lock@JSLock@JSC@@SAXW4JSLockBehavior@2@@Z
     ?lock@Mutex@WTF@@QAEXXZ
     ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
     ?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
     ?lookupSetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
+    ?lower@AtomicString@WebCore@@QBE?AV12@XZ
+    ?lower@String@WebCore@@QBE?AV12@XZ
+    ?lower@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@XZ
     ?markChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z
     ?markChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z
     ?markChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z
@@ -198,7 +271,17 @@
     ?monthFromDayInYear@WTF@@YAHH_N@Z
     ?msToYear@WTF@@YAHN@Z
     ?name@InternalFunction@JSC@@QAEABVUString@2@PAVExecState@2@@Z
+    ?newUninitialized@CString@WTF@@SA?AV12@IAAPAD@Z
     ?nonInlineNaN@JSC@@YANXZ
+    ?nullAtom@WebCore@@3VAtomicString@1@B
+    ?number@String@WebCore@@SA?AV12@G@Z
+    ?number@String@WebCore@@SA?AV12@H@Z
+    ?number@String@WebCore@@SA?AV12@I@Z
+    ?number@String@WebCore@@SA?AV12@J@Z
+    ?number@String@WebCore@@SA?AV12@K@Z
+    ?number@String@WebCore@@SA?AV12@N@Z
+    ?number@String@WebCore@@SA?AV12@_J@Z
+    ?number@String@WebCore@@SA?AV12@_K@Z
     ?objectCount@Heap@JSC@@QBEIXZ
     ?objectProtoFuncToString@JSC@@YI?AVJSValue@1@PAVExecState@1@PAVJSObject@1@V21@ABVArgList@1@@Z
     ?parse@Parser@JSC@@AAEXPAVJSGlobalData@2@PAHPAVUString@2@@Z
@@ -223,6 +306,12 @@
     ?recompileAllJSFunctions@Debugger@JSC@@QAEXPAVJSGlobalData@2@@Z
     ?recordExtraCost@Heap@JSC@@AAEXI@Z
     ?releaseStack@MarkStack@JSC@@CAXPAXI@Z
+    ?remove@String@WebCore@@QAEXIH@Z
+    ?removeCharacters@String@WebCore@@QBE?AV12@P6A_N_W@Z@Z
+    ?replace@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@IIPAV12@@Z
+    ?replace@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PAV12@0@Z
+    ?replace@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@_W0@Z
+    ?replace@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@_WPAV12@@Z
     ?reset@ParserArena@JSC@@QAEXXZ
     ?reset@TimeoutChecker@JSC@@QAEXXZ
     ?resetDateCache@JSGlobalData@JSC@@QAEXXZ
@@ -230,6 +319,9 @@
     ?restoreAll@Profile@JSC@@QAEXXZ
     ?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVInternalFunction@2@@Z
     ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z
+    ?reverseFind@StringImpl@WebCore@@QAEHPAV12@H_N@Z
+    ?reverseFind@StringImpl@WebCore@@QAEH_WH@Z
+    ?secure@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@_W@Z
     ?setAccessorDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@0I@Z
     ?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z
     ?setDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@I@Z
@@ -245,20 +337,33 @@
     ?setUpStaticFunctionSlot@JSC@@YAXPAVExecState@1@PBVHashEntry@1@PAVJSObject@1@ABVIdentifier@1@AAVPropertySlot@1@@Z
     ?setWritable@PropertyDescriptor@JSC@@QAEX_N@Z
     ?setter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ
-    ?sharedBuffer@UStringImpl@JSC@@QAEPAV?$CrossThreadRefCounted@V?$OwnFastMallocPtr@_W@WTF@@@WTF@@XZ
+    ?sharedBuffer@StringImpl@WebCore@@QAEPAV?$CrossThreadRefCounted@V?$OwnFastMallocPtr@$$CB_W@WTF@@@WTF@@XZ
     ?signal@ThreadCondition@WTF@@QAEXXZ
+    ?simplifyWhiteSpace@String@WebCore@@QBE?AV12@XZ
+    ?simplifyWhiteSpace@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@XZ
     ?slowAppend@MarkedArgumentBuffer@JSC@@AAEXVJSValue@2@@Z
+    ?split@String@WebCore@@QBEXABV12@AAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z
+    ?split@String@WebCore@@QBEXABV12@_NAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z
+    ?split@String@WebCore@@QBEX_WAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z
+    ?split@String@WebCore@@QBEX_W_NAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z
+    ?starAtom@WebCore@@3VAtomicString@1@B
     ?startIgnoringLeaks@Structure@JSC@@SAXXZ
     ?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVUString@2@@Z
     ?startSampling@JSGlobalData@JSC@@QAEXXZ
+    ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A
     ?stopIgnoringLeaks@Structure@JSC@@SAXXZ
     ?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z
     ?stopSampling@JSGlobalData@JSC@@QAEXXZ
+    ?stripWhiteSpace@String@WebCore@@QBE?AV12@XZ
     ?strtod@WTF@@YANPBDPAPAD@Z
     ?substr@UString@JSC@@QBE?AV12@II@Z
+    ?substring@String@WebCore@@QBE?AV12@II@Z
+    ?substring@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@II@Z
     ?symbolTableGet@JSVariableObject@JSC@@IAE_NABVIdentifier@2@AAVPropertyDescriptor@2@@Z
     ?synthesizePrototype@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
+    ?textAtom@WebCore@@3VAtomicString@1@B
     ?thisObject@DebuggerCallFrame@JSC@@QBEPAVJSObject@2@XZ
+    ?threadsafeCopy@String@WebCore@@QBE?AV12@XZ
     ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@@Z
     ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@ABVUString@1@@Z
     ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@PBD@Z
@@ -268,7 +373,14 @@
     ?toBoolean@JSCell@JSC@@UBE_NPAVExecState@2@@Z
     ?toBoolean@JSObject@JSC@@UBE_NPAVExecState@2@@Z
     ?toBoolean@JSString@JSC@@EBE_NPAVExecState@2@@Z
+    ?toDouble@String@WebCore@@QBENPA_N@Z
+    ?toFloat@String@WebCore@@QBEMPA_N@Z
     ?toInt32SlowCase@JSC@@YAHNAA_N@Z
+    ?toInt@String@WebCore@@QBEHPA_N@Z
+    ?toInt@StringImpl@WebCore@@QAEHPA_N@Z
+    ?toIntPtr@String@WebCore@@QBEHPA_N@Z
+    ?toIntStrict@String@WebCore@@QBEHPA_NH@Z
+    ?toInteger@JSValue@JSC@@QBENPAVExecState@2@@Z
     ?toNumber@JSCell@JSC@@UBENPAVExecState@2@@Z
     ?toNumber@JSObject@JSC@@UBENPAVExecState@2@@Z
     ?toNumber@JSString@JSC@@EBENPAVExecState@2@@Z
@@ -282,17 +394,17 @@
     ?toString@JSCell@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
     ?toString@JSObject@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
     ?toString@JSString@JSC@@EBE?AVUString@2@PAVExecState@2@@Z
-    ?toThisJSString@JSCell@JSC@@UAEPAVJSString@2@PAVExecState@2@@Z
-    ?toThisJSString@JSString@JSC@@EAEPAV12@PAVExecState@2@@Z
     ?toThisObject@JSCell@JSC@@UBEPAVJSObject@2@PAVExecState@2@@Z
     ?toThisObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@@Z
     ?toThisObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z
     ?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
-    ?toThisString@JSCell@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
-    ?toThisString@JSString@JSC@@EBE?AVUString@2@PAVExecState@2@@Z
     ?toUInt32@UString@JSC@@QBEIPA_N@Z
     ?toUInt32@UString@JSC@@QBEIPA_N_N@Z
     ?toUInt32SlowCase@JSC@@YAINAA_N@Z
+    ?toUInt64@String@WebCore@@QBE_KPA_N@Z
+    ?toUInt@String@WebCore@@QBEIPA_N@Z
+    ?toUIntStrict@String@WebCore@@QBEIPA_NH@Z
+    ?truncate@String@WebCore@@QAEXI@Z
     ?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z
     ?tryFastMalloc@WTF@@YA?AUTryMallocReturnValue@1@I@Z
     ?tryLock@Mutex@WTF@@QAE_NXZ
@@ -300,11 +412,16 @@
     ?unlock@JSLock@JSC@@SAXW4JSLockBehavior@2@@Z
     ?unlock@Mutex@WTF@@QAEXXZ
     ?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
-    ?unprotect@Heap@JSC@@QAEXVJSValue@2@@Z
+    ?unprotect@Heap@JSC@@QAE_NVJSValue@2@@Z
     ?unwrappedObject@JSObject@JSC@@UAEPAV12@XZ
+    ?upper@String@WebCore@@QBE?AV12@XZ
+    ?upper@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@XZ
+    ?utf8@String@WebCore@@QBE?AVCString@WTF@@XZ
     ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
     ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
     ?writable@PropertyDescriptor@JSC@@QBE_NXZ
+    ?xmlAtom@WebCore@@3VAtomicString@1@B
+    ?xmlnsAtom@WebCore@@3VAtomicString@1@B
     WTFLog
     WTFLogVerbose
     WTFReportArgumentAssertionFailure
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 60022dd..158621a 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -74,6 +74,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -136,6 +137,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -197,6 +199,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -260,6 +263,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -323,6 +327,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -384,6 +389,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -446,6 +452,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -507,6 +514,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 	</Configurations>

@@ -1133,6 +1141,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\runtime\RopeImpl.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\runtime\RopeImpl.h"

+				>

+			</File>

+			<File

 				RelativePath="..\..\runtime\ScopeChain.cpp"

 				>

 			</File>

@@ -1205,6 +1221,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\runtime\Terminator.h"

+				>

+			</File>

+			<File

 				RelativePath="..\..\runtime\TimeoutChecker.cpp"

 				>

 			</File>

@@ -1221,10 +1241,6 @@
 				>

 			</File>

 			<File

-				RelativePath="..\..\runtime\UStringImpl.cpp"

-				>

-			</File>

-			<File

 				RelativePath="..\..\runtime\UStringImpl.h"

 				>

 			</File>

@@ -1397,6 +1413,18 @@
 				>

 			</File>

 			<File

+				RelativePath="..\..\API\JSWeakObjectMapRefInternal.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\API\JSWeakObjectMapRefPrivate.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\..\API\JSWeakObjectMapRefPrivate.h"

+				>

+			</File>

+			<File

 				RelativePath="..\..\API\JSValueRef.cpp"

 				>

 			</File>

@@ -1578,66 +1606,6 @@
 			</File>

 		</Filter>

 		<Filter

-			Name="wrec"

-			>

-			<File

-				RelativePath="..\..\wrec\CharacterClass.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\CharacterClass.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\CharacterClassConstructor.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\CharacterClassConstructor.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\Escapes.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\Quantifier.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WREC.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WREC.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECFunctors.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECFunctors.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECGenerator.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECGenerator.h"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECParser.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\..\wrec\WRECParser.h"

-				>

-			</File>

-		</Filter>

-		<Filter

 			Name="yarr"

 			>

 			<File

diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops
index f489e79..4470819 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops
@@ -6,7 +6,7 @@
 	>

 	<Tool

 		Name="VCCLCompilerTool"

-		AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;../../API/;../../pcre/;../../parser/;../../bytecompiler/;../../jit/;../../runtime/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;../../wrec/;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"

+		AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;../../API/;../../pcre/;../../parser/;../../bytecompiler/;../../jit/;../../runtime/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"

 		PreprocessorDefinitions="__STD_C"

 	/>

 	<Tool

@@ -17,7 +17,7 @@
 	/>

 	<Tool

 		Name="VCPostBuildEventTool"

-		CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+		CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\VM\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\bytecode\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\interpreter\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\assembler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\jit\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\debugger\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\create_hash_table&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\..\pcre\pcre.h&quot; &quot;$(WebKitOutputDir)\include\private\JavaScriptCore&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\JavaScriptCore.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 	/>

 	<Tool

 		Name="VCPreBuildEventTool"

diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
index 92479bb..098ff08 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
@@ -9,12 +9,16 @@
     xcopy /y /d "..\..\API\JSContextRef.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSContextRefPrivate.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSObjectRef.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
+    xcopy /y /d "..\..\API\JSObjectRefPrivate.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSStringRef.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSStringRefCF.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSStringRefBSTR.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSValueRef.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JavaScriptCore.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\JSRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
+    xcopy /y /d "..\..\API\JSWeakObjectMapRefInternal.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
+    xcopy /y /d "..\..\API\JSWeakObjectMapRefPrivate.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
+    xcopy /y /d "..\..\API\JSRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\OpaqueJSString.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     xcopy /y /d "..\..\API\WebKitAvailability.h" "$(WEBKITOUTPUTDIR)\include\JavaScriptCore"
     -del "$(WEBKITOUTPUTDIR)\include\private\JavaScriptCore\stdbool.h" "$(WEBKITOUTPUTDIR)\include\private\JavaScriptCore\stdint.h"
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index c5b826c..0145311 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -537,6 +537,46 @@
 			>

 		</File>

 		<File

+ 			RelativePath="..\..\wtf\text\AtomicString.cpp"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\AtomicString.h"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\AtomicStringImpl.h"

+ 			>

+ 		</File>

+		<File

+ 			RelativePath="..\..\wtf\text\CString.cpp"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\CString.h"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\StringHash.h"

+ 			>

+ 		</File>

+		<File

+ 			RelativePath="..\..\wtf\text\StringImpl.cpp"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\StringImpl.h"

+ 			>

+ 		</File>

+		<File

+ 			RelativePath="..\..\wtf\text\WTFString.cpp"

+ 			>

+ 		</File>

+ 		<File

+ 			RelativePath="..\..\wtf\text\WTFString.h"

+ 			>

+ 		</File>

+ 		<File

 			RelativePath="..\..\wtf\unicode\UTF8.cpp"

 			>

 		</File>

@@ -556,6 +596,14 @@
 			RelativePath="..\..\wtf\VectorTraits.h"

 			>

 		</File>

+		<File

+			RelativePath="..\..\wtf\WTFThreadData.cpp"

+			>

+		</File>

+		<File

+			RelativePath="..\..\wtf\WTFThreadData.h"

+			>

+		</File>

 	</Files>

 	<Globals>

 	</Globals>

diff --git a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
index 61594e1..45fe975 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
+++ b/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
@@ -6,7 +6,7 @@
 	>

 	<Tool

 		Name="VCCLCompilerTool"

-		AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../assembler/;../../wrec/;../../parser/;../../runtime/;../../VM/;../../bytecode/;../../interpreter/;../../wtf/;../../debugger/;../../bytecompiler/;../../profiler;../../jit/;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"

+		AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../assembler/;../../API/;../../parser/;../../runtime/;../../VM/;../../bytecode/;../../interpreter/;../../wtf/;../../debugger/;../../bytecompiler/;../../profiler;../../jit/;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"

 		PreprocessorDefinitions="__STD_C"

 	/>

 	<Tool

@@ -16,7 +16,7 @@
 	/>

 	<Tool

 		Name="VCPostBuildEventTool"

-		CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;cmd /c&#x0D;&#x0A;"

+		CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\ASL$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libdispatch$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;cmd /c&#x0D;&#x0A;"

 	/>

 	<Tool

 		Name="VCPreBuildEventTool"

diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 2410466..9dff7ef 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -78,15 +78,6 @@
 		1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8DC0ED2205B00B89619 /* CallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1429D92F0ED22D7000B89619 /* JIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D92D0ED22D7000B89619 /* JIT.cpp */; };
 		1429D9300ED22D7000B89619 /* JIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D92E0ED22D7000B89619 /* JIT.h */; };
-		1429D9C40ED23C3900B89619 /* CharacterClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D9C20ED23C3900B89619 /* CharacterClass.cpp */; };
-		1429D9C50ED23C3900B89619 /* CharacterClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D9C30ED23C3900B89619 /* CharacterClass.h */; };
-		1429DA4A0ED245EC00B89619 /* Quantifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429DA490ED245EC00B89619 /* Quantifier.h */; };
-		1429DA820ED2482900B89619 /* WRECFunctors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429DA800ED2482900B89619 /* WRECFunctors.cpp */; };
-		1429DA830ED2482900B89619 /* WRECFunctors.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429DA810ED2482900B89619 /* WRECFunctors.h */; };
-		1429DABF0ED263E700B89619 /* WRECParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429DABD0ED263E700B89619 /* WRECParser.h */; };
-		1429DAC00ED263E700B89619 /* WRECParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429DABE0ED263E700B89619 /* WRECParser.cpp */; };
-		1429DAE00ED2645B00B89619 /* WRECGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429DADE0ED2645B00B89619 /* WRECGenerator.h */; };
-		1429DAE10ED2645B00B89619 /* WRECGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429DADF0ED2645B00B89619 /* WRECGenerator.cpp */; };
 		142D3939103E4560007DCB52 /* NumericStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D3938103E4560007DCB52 /* NumericStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		143A97E60A4A06E200456B66 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
 		1440057F0A5335640005F061 /* JSNode.c in Sources */ = {isa = PBXBuildFile; fileRef = 1440F6420A4F8B6A0005F061 /* JSNode.c */; };
@@ -195,8 +186,6 @@
 		655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; };
 		65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; };
 		65FDE49C0BDD1D4A00E80111 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.cpp */; settings = {COMPILER_FLAGS = "-Wno-missing-format-attribute"; }; };
-		7E2ADD8E0E79AAD500D50C51 /* CharacterClassConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E2ADD8D0E79AAD500D50C51 /* CharacterClassConstructor.h */; };
-		7E2ADD900E79AC1100D50C51 /* CharacterClassConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E2ADD8F0E79AC1100D50C51 /* CharacterClassConstructor.cpp */; };
 		7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; };
 		7EFF00640EC05A9A00AA7C93 /* NodeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EFF00630EC05A9A00AA7C93 /* NodeInfo.h */; };
@@ -206,16 +195,28 @@
 		860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */; };
 		860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */; };
 		863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		86565742115BE3DA00291F40 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86565740115BE3DA00291F40 /* CString.cpp */; };
+		86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
-		869083150E6518D7000D36ED /* WREC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 869083130E6518D7000D36ED /* WREC.cpp */; };
-		869083160E6518D7000D36ED /* WREC.h in Headers */ = {isa = PBXBuildFile; fileRef = 869083140E6518D7000D36ED /* WREC.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
+		868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA05117CEFD100B908B1 /* StringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA0E117CEFD100B908B1 /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA06117CEFD100B908B1 /* StringImpl.cpp */; };
+		868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA07117CEFD100B908B1 /* StringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA15117CF19900B908B1 /* WTFString.cpp */; };
+		868BFA18117CF19900B908B1 /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA16117CF19900B908B1 /* WTFString.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA5F117D048200B908B1 /* StaticConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698B86810D44D9400D8D01B /* StringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698BB3710D86BAF00D8D01B /* UStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		8698BB3A10D86BAF00D8D01B /* UStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */; };
 		869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; };
 		86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; };
 		86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; };
+		86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */; };
+		86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AB7117E391E00DF5A90 /* RopeImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE2117E578100DF5A90 /* StringImplBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; };
 		86CA032E1038E8440028A609 /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; };
 		86CAFEE31035DDE60028A609 /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (); }; };
@@ -223,6 +224,8 @@
 		86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85A20EE79B7400288682 /* JITCall.cpp */; };
 		86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; };
 		86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CCEFDD0F413F8900FD7F9E /* JITCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86D08D5111793613006E5ED0 /* WTFThreadData.cpp */; };
+		86D08D5411793613006E5ED0 /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D08D5211793613006E5ED0 /* WTFThreadData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */; };
 		86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C010156BDE002865E7 /* ARMAssembler.h */; };
 		86D3B2C510156BDE002865E7 /* AssemblerBufferWithConstantPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C110156BDE002865E7 /* AssemblerBufferWithConstantPool.h */; };
@@ -279,11 +282,15 @@
 		969A07990ED1D3AE00F1F681 /* Instruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07930ED1D3AE00F1F681 /* Instruction.h */; };
 		969A079A0ED1D3AE00F1F681 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; };
 		969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		96A746410EDDF70600904779 /* Escapes.h in Headers */ = {isa = PBXBuildFile; fileRef = 96A7463F0EDDF70600904779 /* Escapes.h */; };
 		96DD73790F9DA3100027FBCC /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DD73780F9DA3100027FBCC /* VMTags.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		971EDEA61169E0D3005E4262 /* Terminator.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F6903A1169DF7F00A6BB46 /* Terminator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; };
 		A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
 		A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; };
+		A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; };
+		A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A74B3499102A5F8E0032AB98 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74B3498102A5F8E0032AB98 /* MarkStack.cpp */; };
 		A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -565,7 +572,6 @@
 		088FA5B90EF76D4300578E6F /* RandomNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomNumber.cpp; sourceTree = "<group>"; };
 		088FA5BA0EF76D4300578E6F /* RandomNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomNumber.h; sourceTree = "<group>"; };
 		08E279E80EF83B10007DB523 /* RandomNumberSeed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomNumberSeed.h; sourceTree = "<group>"; };
-		0B1F921B0F17502D0036468E /* PtrAndFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PtrAndFlags.h; sourceTree = "<group>"; };
 		0B330C260F38C62300692DE3 /* TypeTraits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeTraits.cpp; sourceTree = "<group>"; };
 		0B4D7E620F319AC800AD7E58 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
 		0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnFastMallocPtr.h; sourceTree = "<group>"; };
@@ -589,15 +595,6 @@
 		1429D8DC0ED2205B00B89619 /* CallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrame.h; sourceTree = "<group>"; };
 		1429D92D0ED22D7000B89619 /* JIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JIT.cpp; sourceTree = "<group>"; };
 		1429D92E0ED22D7000B89619 /* JIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JIT.h; sourceTree = "<group>"; };
-		1429D9C20ED23C3900B89619 /* CharacterClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharacterClass.cpp; sourceTree = "<group>"; };
-		1429D9C30ED23C3900B89619 /* CharacterClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterClass.h; sourceTree = "<group>"; };
-		1429DA490ED245EC00B89619 /* Quantifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Quantifier.h; sourceTree = "<group>"; };
-		1429DA800ED2482900B89619 /* WRECFunctors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WRECFunctors.cpp; sourceTree = "<group>"; };
-		1429DA810ED2482900B89619 /* WRECFunctors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRECFunctors.h; sourceTree = "<group>"; };
-		1429DABD0ED263E700B89619 /* WRECParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRECParser.h; sourceTree = "<group>"; };
-		1429DABE0ED263E700B89619 /* WRECParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WRECParser.cpp; sourceTree = "<group>"; };
-		1429DADE0ED2645B00B89619 /* WRECGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRECGenerator.h; sourceTree = "<group>"; };
-		1429DADF0ED2645B00B89619 /* WRECGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WRECGenerator.cpp; sourceTree = "<group>"; };
 		142D3938103E4560007DCB52 /* NumericStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumericStrings.h; sourceTree = "<group>"; };
 		1440051F0A531D3B0005F061 /* Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Node.h; path = tests/Node.h; sourceTree = "<group>"; };
 		144005200A531D3B0005F061 /* Node.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Node.c; path = tests/Node.c; sourceTree = "<group>"; };
@@ -731,8 +728,6 @@
 		65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommonIdentifiers.h; sourceTree = "<group>"; };
 		65FB3F4809D11B2400F49DEB /* Grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Grammar.cpp; sourceTree = "<group>"; };
 		704FD35305697E6D003DBED9 /* BooleanObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BooleanObject.h; sourceTree = "<group>"; tabWidth = 8; };
-		7E2ADD8D0E79AAD500D50C51 /* CharacterClassConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterClassConstructor.h; sourceTree = "<group>"; };
-		7E2ADD8F0E79AC1100D50C51 /* CharacterClassConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharacterClassConstructor.cpp; sourceTree = "<group>"; };
 		7E2C6C980D31C6B6002D44E2 /* ScopeChainMark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeChainMark.h; sourceTree = "<group>"; };
 		7E4EE7080EBB7963005934AA /* StructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureChain.h; sourceTree = "<group>"; };
 		7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureChain.cpp; sourceTree = "<group>"; };
@@ -742,16 +737,28 @@
 		860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = "<group>"; };
 		860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = "<group>"; };
 		863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerCodeRef.h; sourceTree = "<group>"; };
+		86565740115BE3DA00291F40 /* CString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CString.cpp; path = text/CString.cpp; sourceTree = "<group>"; };
+		86565741115BE3DA00291F40 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CString.h; path = text/CString.h; sourceTree = "<group>"; };
 		865F408710E7D56300947361 /* APIShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIShims.h; sourceTree = "<group>"; };
-		869083130E6518D7000D36ED /* WREC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WREC.cpp; sourceTree = "<group>"; };
-		869083140E6518D7000D36ED /* WREC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WREC.h; sourceTree = "<group>"; };
+		868BFA00117CEFD100B908B1 /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = text/AtomicString.cpp; sourceTree = "<group>"; };
+		868BFA01117CEFD100B908B1 /* AtomicString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicString.h; path = text/AtomicString.h; sourceTree = "<group>"; };
+		868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringImpl.h; path = text/AtomicStringImpl.h; sourceTree = "<group>"; };
+		868BFA05117CEFD100B908B1 /* StringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringHash.h; path = text/StringHash.h; sourceTree = "<group>"; };
+		868BFA06117CEFD100B908B1 /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImpl.cpp; path = text/StringImpl.cpp; sourceTree = "<group>"; };
+		868BFA07117CEFD100B908B1 /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImpl.h; path = text/StringImpl.h; sourceTree = "<group>"; };
+		868BFA15117CF19900B908B1 /* WTFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WTFString.cpp; path = text/WTFString.cpp; sourceTree = "<group>"; };
+		868BFA16117CF19900B908B1 /* WTFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WTFString.h; path = text/WTFString.h; sourceTree = "<group>"; };
+		868BFA5F117D048200B908B1 /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
 		8698B86810D44D9400D8D01B /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; };
 		8698BB3710D86BAF00D8D01B /* UStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringImpl.h; sourceTree = "<group>"; };
-		8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UStringImpl.cpp; sourceTree = "<group>"; };
 		869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = "<group>"; };
 		86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = "<group>"; };
 		86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = "<group>"; };
 		86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = "<group>"; };
+		86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RopeImpl.cpp; sourceTree = "<group>"; };
+		86B99AB7117E391E00DF5A90 /* RopeImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RopeImpl.h; sourceTree = "<group>"; };
+		86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = "<group>"; };
+		86B99AE2117E578100DF5A90 /* StringImplBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImplBase.h; path = text/StringImplBase.h; sourceTree = "<group>"; };
 		86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = "<group>"; };
 		86CA032D1038E8440028A609 /* Executable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Executable.cpp; sourceTree = "<group>"; };
 		86CAFEE21035DDE60028A609 /* Executable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Executable.h; sourceTree = "<group>"; };
@@ -759,6 +766,8 @@
 		86CC85A20EE79B7400288682 /* JITCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITCall.cpp; sourceTree = "<group>"; };
 		86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess.cpp; sourceTree = "<group>"; };
 		86CCEFDD0F413F8900FD7F9E /* JITCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCode.h; sourceTree = "<group>"; };
+		86D08D5111793613006E5ED0 /* WTFThreadData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WTFThreadData.cpp; sourceTree = "<group>"; };
+		86D08D5211793613006E5ED0 /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
 		86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMAssembler.cpp; sourceTree = "<group>"; };
 		86D3B2C010156BDE002865E7 /* ARMAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMAssembler.h; sourceTree = "<group>"; };
 		86D3B2C110156BDE002865E7 /* AssemblerBufferWithConstantPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssemblerBufferWithConstantPool.h; sourceTree = "<group>"; };
@@ -844,19 +853,25 @@
 		969A07940ED1D3AE00F1F681 /* Opcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Opcode.cpp; sourceTree = "<group>"; };
 		969A07950ED1D3AE00F1F681 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Opcode.h; sourceTree = "<group>"; };
 		969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = "<group>"; };
-		96A7463F0EDDF70600904779 /* Escapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Escapes.h; sourceTree = "<group>"; };
 		96DD73780F9DA3100027FBCC /* VMTags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTags.h; sourceTree = "<group>"; };
+		97F6903A1169DF7F00A6BB46 /* Terminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminator.h; sourceTree = "<group>"; };
+		A718F61A11754A21002465A7 /* RegExpJitTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpJitTables.h; sourceTree = "<group>"; };
+		A718F8211178EB4B002465A7 /* create_regex_tables */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = create_regex_tables; sourceTree = "<group>"; };
 		A72700770DAC605600E548D7 /* JSNotAnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotAnObject.h; sourceTree = "<group>"; };
 		A72700780DAC605600E548D7 /* JSNotAnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotAnObject.cpp; sourceTree = "<group>"; };
 		A72701B30DADE94900E548D7 /* ExceptionHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionHelpers.h; sourceTree = "<group>"; };
 		A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNameIterator.h; sourceTree = "<group>"; };
 		A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = "<group>"; };
+		A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefPrivate.h; sourceTree = "<group>"; };
+		A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakObjectMapRefPrivate.cpp; sourceTree = "<group>"; };
+		A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefInternal.h; sourceTree = "<group>"; };
 		A74B3498102A5F8E0032AB98 /* MarkStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStack.cpp; sourceTree = "<group>"; };
 		A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeFunctionWrapper.h; sourceTree = "<group>"; };
 		A779558F101A74D500114E55 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = "<group>"; };
 		A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorPosix.cpp; sourceTree = "<group>"; };
 		A791EF260F11E07900AE1F68 /* JSByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteArray.h; sourceTree = "<group>"; };
 		A791EF270F11E07900AE1F68 /* JSByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSByteArray.cpp; sourceTree = "<group>"; };
+		A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectRefPrivate.h; sourceTree = "<group>"; };
 		A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteArray.cpp; sourceTree = "<group>"; };
 		A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteArray.h; sourceTree = "<group>"; };
 		A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
@@ -1102,6 +1117,7 @@
 		0867D691FE84028FC02AAC07 /* JavaScriptCore */ = {
 			isa = PBXGroup;
 			children = (
+				A718F8211178EB4B002465A7 /* create_regex_tables */,
 				937B63CC09E766D200A671DD /* DerivedSources.make */,
 				F692A8540255597D01FF60F7 /* create_hash_table */,
 				14B8ECA60A5653980062BE54 /* JavaScriptCore.exp */,
@@ -1120,7 +1136,6 @@
 				95AB831A0DA42C6900BC83F3 /* profiler */,
 				7EF6E0BB0EB7A1EC0079AFAF /* runtime */,
 				141211000A48772600480255 /* tests */,
-				869083120E6518D7000D36ED /* wrec */,
 				65162EF108E6A21C007556CD /* wtf */,
 				86EAC48C0F93E8B9008EC948 /* yarr */,
 				1C90513E0BA9E8830081E9D0 /* Configurations */,
@@ -1190,10 +1205,10 @@
 				86CC85A00EE79A4700288682 /* JITInlineMethods.h */,
 				BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */,
 				86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */,
+				A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */,
 				960626950FB8EC02009798AB /* JITStubCall.h */,
 				14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */,
 				14A6581A0F4E36F4000150FD /* JITStubs.h */,
-				A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */,
 			);
 			path = jit;
 			sourceTree = "<group>";
@@ -1224,6 +1239,7 @@
 				148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */,
 				1482B7E20A43076000517CFC /* JSObjectRef.cpp */,
 				1482B7E10A43076000517CFC /* JSObjectRef.h */,
+				A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */,
 				95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */,
 				952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */,
 				95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */,
@@ -1236,6 +1252,9 @@
 				E124A8F60E555775003091F1 /* OpaqueJSString.cpp */,
 				E124A8F50E555775003091F1 /* OpaqueJSString.h */,
 				5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */,
+				A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */,
+				A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */,
+				A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */,
 			);
 			path = API;
 			sourceTree = "<group>";
@@ -1290,6 +1309,7 @@
 		650FDF8D09D0FCA700769E54 /* Derived Sources */ = {
 			isa = PBXGroup;
 			children = (
+				A718F61A11754A21002465A7 /* RegExpJitTables.h */,
 				BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */,
 				65B174BE09D1000200820339 /* chartables.c */,
 				BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
@@ -1314,6 +1334,7 @@
 			isa = PBXGroup;
 			children = (
 				06D358A00DAAD9C4003B174E /* mac */,
+				8656573E115BE35200291F40 /* text */,
 				E195678D09E7CF1200B89D13 /* unicode */,
 				93AA4F770957251F0084B3A7 /* AlwaysInline.h */,
 				938C4F690CA06BC700D9310A /* ASCIICType.h */,
@@ -1362,7 +1383,6 @@
 				6580F795094070560082C219 /* PassRefPtr.h */,
 				65D6D87E09B5A32E0002E4D7 /* Platform.h */,
 				A7D649A91015224E009B2E1B /* PossiblyNull.h */,
-				0B1F921B0F17502D0036468E /* PtrAndFlags.h */,
 				088FA5B90EF76D4300578E6F /* RandomNumber.cpp */,
 				088FA5BA0EF76D4300578E6F /* RandomNumber.h */,
 				08E279E80EF83B10007DB523 /* RandomNumberSeed.h */,
@@ -1373,6 +1393,7 @@
 				148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */,
 				51F648D60BB4E2CA0033D760 /* RetainPtr.h */,
 				969A07290ED1CE6900F1F681 /* SegmentedVector.h */,
+				868BFA5F117D048200B908B1 /* StaticConstructors.h */,
 				FE1B44790ECCD73B004F4DD1 /* StdLibExtras.h */,
 				E11D51750B2E798D0056C188 /* StringExtras.h */,
 				5D63E9AC10F2BD6E00FC8AE9 /* StringHashFunctions.h */,
@@ -1394,6 +1415,8 @@
 				6592C316098B7DE10003D4F6 /* Vector.h */,
 				6592C317098B7DE10003D4F6 /* VectorTraits.h */,
 				96DD73780F9DA3100027FBCC /* VMTags.h */,
+				86D08D5111793613006E5ED0 /* WTFThreadData.cpp */,
+				86D08D5211793613006E5ED0 /* WTFThreadData.h */,
 			);
 			path = wtf;
 			sourceTree = "<group>";
@@ -1611,6 +1634,8 @@
 				F692A87C0255597D01FF60F7 /* RegExpObject.h */,
 				BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */,
 				BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */,
+				86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */,
+				86B99AB7117E391E00DF5A90 /* RopeImpl.h */,
 				9374D3A8038D9D74008635CE /* ScopeChain.cpp */,
 				9374D3A7038D9D74008635CE /* ScopeChain.h */,
 				7E2C6C980D31C6B6002D44E2 /* ScopeChainMark.h */,
@@ -1630,13 +1655,13 @@
 				7E4EE7080EBB7963005934AA /* StructureChain.h */,
 				BC9041470EB9250900FE26FA /* StructureTransitionTable.h */,
 				14A396A60CD2933100B5B4FF /* SymbolTable.h */,
+				97F6903A1169DF7F00A6BB46 /* Terminator.h */,
 				14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */,
 				14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */,
 				5D53726D0E1C546B0021E549 /* Tracing.d */,
 				5D53726E0E1C54880021E549 /* Tracing.h */,
 				F692A8850255597D01FF60F7 /* UString.cpp */,
 				F692A8860255597D01FF60F7 /* UString.h */,
-				8698BB3810D86BAF00D8D01B /* UStringImpl.cpp */,
 				8698BB3710D86BAF00D8D01B /* UStringImpl.h */,
 				14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
 				14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */,
@@ -1645,25 +1670,23 @@
 			path = runtime;
 			sourceTree = "<group>";
 		};
-		869083120E6518D7000D36ED /* wrec */ = {
+		8656573E115BE35200291F40 /* text */ = {
 			isa = PBXGroup;
 			children = (
-				1429D9C20ED23C3900B89619 /* CharacterClass.cpp */,
-				1429D9C30ED23C3900B89619 /* CharacterClass.h */,
-				7E2ADD8F0E79AC1100D50C51 /* CharacterClassConstructor.cpp */,
-				7E2ADD8D0E79AAD500D50C51 /* CharacterClassConstructor.h */,
-				96A7463F0EDDF70600904779 /* Escapes.h */,
-				1429DA490ED245EC00B89619 /* Quantifier.h */,
-				869083130E6518D7000D36ED /* WREC.cpp */,
-				869083140E6518D7000D36ED /* WREC.h */,
-				1429DA800ED2482900B89619 /* WRECFunctors.cpp */,
-				1429DA810ED2482900B89619 /* WRECFunctors.h */,
-				1429DADF0ED2645B00B89619 /* WRECGenerator.cpp */,
-				1429DADE0ED2645B00B89619 /* WRECGenerator.h */,
-				1429DABE0ED263E700B89619 /* WRECParser.cpp */,
-				1429DABD0ED263E700B89619 /* WRECParser.h */,
+				868BFA00117CEFD100B908B1 /* AtomicString.cpp */,
+				868BFA01117CEFD100B908B1 /* AtomicString.h */,
+				868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */,
+				86565740115BE3DA00291F40 /* CString.cpp */,
+				86565741115BE3DA00291F40 /* CString.h */,
+				86B99AE1117E578100DF5A90 /* StringBuffer.h */,
+				868BFA05117CEFD100B908B1 /* StringHash.h */,
+				868BFA06117CEFD100B908B1 /* StringImpl.cpp */,
+				868BFA07117CEFD100B908B1 /* StringImpl.h */,
+				86B99AE2117E578100DF5A90 /* StringImplBase.h */,
+				868BFA15117CF19900B908B1 /* WTFString.cpp */,
+				868BFA16117CF19900B908B1 /* WTFString.h */,
 			);
-			path = wrec;
+			name = text;
 			sourceTree = "<group>";
 		};
 		86EAC48C0F93E8B9008EC948 /* yarr */ = {
@@ -1817,8 +1840,6 @@
 				BC18C3ED0E16F5CD00B34460 /* CallData.h in Headers */,
 				1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */,
 				95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */,
-				1429D9C50ED23C3900B89619 /* CharacterClass.h in Headers */,
-				7E2ADD8E0E79AAD500D50C51 /* CharacterClassConstructor.h in Headers */,
 				BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */,
 				969A07970ED1D3AE00F1F681 /* CodeBlock.h in Headers */,
 				86E116B10FE75AC800B512BC /* CodeLocation.h in Headers */,
@@ -1849,7 +1870,6 @@
 				BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */,
 				BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */,
 				BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */,
-				96A746410EDDF70600904779 /* Escapes.h in Headers */,
 				969A07980ED1D3AE00F1F681 /* EvalCodeCache.h in Headers */,
 				BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */,
 				86CAFEE31035DDE60028A609 /* Executable.h in Headers */,
@@ -1910,6 +1930,7 @@
 				9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */,
 				BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */,
 				BC18C4270E16F5CD00B34460 /* JSString.h in Headers */,
+				86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */,
 				BC18C4280E16F5CD00B34460 /* JSStringRef.h in Headers */,
 				BC18C4290E16F5CD00B34460 /* JSStringRefCF.h in Headers */,
 				BC18C42A0E16F5CD00B34460 /* JSType.h in Headers */,
@@ -1984,7 +2005,6 @@
 				BC18C4560E16F5CD00B34460 /* Protect.h in Headers */,
 				BC257DF40E1F53740016B6C9 /* PrototypeFunction.h in Headers */,
 				147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
-				1429DA4A0ED245EC00B89619 /* Quantifier.h in Headers */,
 				088FA5BC0EF76D4300578E6F /* RandomNumber.h in Headers */,
 				08E279E90EF83B10007DB523 /* RandomNumberSeed.h in Headers */,
 				BC18C4570E16F5CD00B34460 /* RefCounted.h in Headers */,
@@ -2035,6 +2055,7 @@
 				18BAB55410DAE066000D945B /* ThreadIdentifierDataPthreads.h in Headers */,
 				BC18C4700E16F5CD00B34460 /* Threading.h in Headers */,
 				BC18C4710E16F5CD00B34460 /* ThreadSpecific.h in Headers */,
+				971EDEA61169E0D3005E4262 /* Terminator.h in Headers */,
 				14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */,
 				5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
 				0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */,
@@ -2045,6 +2066,7 @@
 				BC18C4760E16F5CD00B34460 /* UString.h in Headers */,
 				8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */,
 				BC18C4770E16F5CD00B34460 /* UTF8.h in Headers */,
+				E17FF771112131D200076A19 /* ValueCheck.h in Headers */,
 				BC18C4780E16F5CD00B34460 /* Vector.h in Headers */,
 				BC18C4790E16F5CD00B34460 /* VectorTraits.h in Headers */,
 				96DD73790F9DA3100027FBCC /* VMTags.h in Headers */,
@@ -2052,13 +2074,21 @@
 				14035DB110DBFB2A00FFFFE7 /* WeakGCPtr.h in Headers */,
 				1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */,
 				BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */,
-				869083160E6518D7000D36ED /* WREC.h in Headers */,
-				1429DA830ED2482900B89619 /* WRECFunctors.h in Headers */,
-				1429DAE00ED2645B00B89619 /* WRECGenerator.h in Headers */,
-				1429DABF0ED263E700B89619 /* WRECParser.h in Headers */,
 				9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */,
-				86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */,
-				E17FF771112131D200076A19 /* ValueCheck.h in Headers */,
+				A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */,
+				86565743115BE3DA00291F40 /* CString.h in Headers */,
+				A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
+				A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */,
+				86D08D5411793613006E5ED0 /* WTFThreadData.h in Headers */,
+				868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */,
+				868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */,
+				868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */,
+				868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */,
+				868BFA18117CF19900B908B1 /* WTFString.h in Headers */,
+				868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */,
+				86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */,
+				86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */,
+				86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2358,8 +2388,6 @@
 				148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */,
 				1428082D107EC0570013E7B2 /* CallData.cpp in Sources */,
 				1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */,
-				1429D9C40ED23C3900B89619 /* CharacterClass.cpp in Sources */,
-				7E2ADD900E79AC1100D50C51 /* CharacterClassConstructor.cpp in Sources */,
 				969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
 				E1A862D60D7F2B5C001EC6AA /* CollatorDefault.cpp in Sources */,
 				E1A862A90D7EBB76001EC6AA /* CollatorICU.cpp in Sources */,
@@ -2402,6 +2430,7 @@
 				86CC85A30EE79B7400288682 /* JITCall.cpp in Sources */,
 				BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */,
 				86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */,
+				A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */,
 				14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */,
 				140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */,
 				140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
@@ -2499,13 +2528,14 @@
 				14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */,
 				0B330C270F38C62300692DE3 /* TypeTraits.cpp in Sources */,
 				14469DEE107EC7E700650446 /* UString.cpp in Sources */,
-				8698BB3A10D86BAF00D8D01B /* UStringImpl.cpp in Sources */,
 				E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */,
-				869083150E6518D7000D36ED /* WREC.cpp in Sources */,
-				1429DA820ED2482900B89619 /* WRECFunctors.cpp in Sources */,
-				1429DAE10ED2645B00B89619 /* WRECGenerator.cpp in Sources */,
-				1429DAC00ED263E700B89619 /* WRECParser.cpp in Sources */,
-				A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */,
+				86565742115BE3DA00291F40 /* CString.cpp in Sources */,
+				A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */,
+				86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */,
+				868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */,
+				868BFA0E117CEFD100B908B1 /* StringImpl.cpp in Sources */,
+				868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */,
+				86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/JavaScriptCore/assembler/ARMAssembler.cpp b/JavaScriptCore/assembler/ARMAssembler.cpp
index 6dd2b87..7393aa1 100644
--- a/JavaScriptCore/assembler/ARMAssembler.cpp
+++ b/JavaScriptCore/assembler/ARMAssembler.cpp
@@ -262,28 +262,29 @@
 
 // Memory load/store helpers
 
-void ARMAssembler::dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset)
+void ARMAssembler::dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset, bool bytes)
 {
+    ARMWord transferFlag = bytes ? DT_BYTE : 0;
     if (offset >= 0) {
         if (offset <= 0xfff)
-            dtr_u(isLoad, srcDst, base, offset);
+            dtr_u(isLoad, srcDst, base, offset | transferFlag);
         else if (offset <= 0xfffff) {
             add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
-            dtr_u(isLoad, srcDst, ARMRegisters::S0, offset & 0xfff);
+            dtr_u(isLoad, srcDst, ARMRegisters::S0, (offset & 0xfff) | transferFlag);
         } else {
             ARMWord reg = getImm(offset, ARMRegisters::S0);
-            dtr_ur(isLoad, srcDst, base, reg);
+            dtr_ur(isLoad, srcDst, base, reg | transferFlag);
         }
     } else {
         offset = -offset;
         if (offset <= 0xfff)
-            dtr_d(isLoad, srcDst, base, offset);
+            dtr_d(isLoad, srcDst, base, offset | transferFlag);
         else if (offset <= 0xfffff) {
             sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
-            dtr_d(isLoad, srcDst, ARMRegisters::S0, offset & 0xfff);
+            dtr_d(isLoad, srcDst, ARMRegisters::S0, (offset & 0xfff) | transferFlag);
         } else {
             ARMWord reg = getImm(offset, ARMRegisters::S0);
-            dtr_dr(isLoad, srcDst, base, reg);
+            dtr_dr(isLoad, srcDst, base, reg | transferFlag);
         }
     }
 }
diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h
index 6967b37..f93db68 100644
--- a/JavaScriptCore/assembler/ARMAssembler.h
+++ b/JavaScriptCore/assembler/ARMAssembler.h
@@ -27,8 +27,6 @@
 #ifndef ARMAssembler_h
 #define ARMAssembler_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
 
 #include "AssemblerBufferWithConstantPool.h"
@@ -155,6 +153,7 @@
             SET_CC = (1 << 20),
             OP2_OFSREG = (1 << 25),
             DT_UP = (1 << 23),
+            DT_BYTE = (1 << 22),
             DT_WB = (1 << 21),
             // This flag is inlcuded in LDR and STR
             DT_PRE = (1 << 24),
@@ -780,7 +779,7 @@
 
         // Memory load/store helpers
 
-        void dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset);
+        void dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, int32_t offset, bool bytes = false);
         void baseIndexTransfer32(bool isLoad, RegisterID srcDst, RegisterID base, RegisterID index, int scale, int32_t offset);
         void doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset);
 
diff --git a/JavaScriptCore/assembler/ARMv7Assembler.h b/JavaScriptCore/assembler/ARMv7Assembler.h
index 4e394b2..21279f5 100644
--- a/JavaScriptCore/assembler/ARMv7Assembler.h
+++ b/JavaScriptCore/assembler/ARMv7Assembler.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,8 +27,6 @@
 #ifndef ARMAssembler_h
 #define ARMAssembler_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && CPU(ARM_THUMB2)
 
 #include "AssemblerBuffer.h"
@@ -582,11 +581,13 @@
         OP_MOV_reg_T1       = 0x4600,
         OP_BLX              = 0x4700,
         OP_BX               = 0x4700,
-        OP_LDRH_reg_T1      = 0x5A00,
         OP_STR_reg_T1       = 0x5000,
         OP_LDR_reg_T1       = 0x5800,
+        OP_LDRH_reg_T1      = 0x5A00,
+        OP_LDRB_reg_T1      = 0x5C00,
         OP_STR_imm_T1       = 0x6000,
         OP_LDR_imm_T1       = 0x6800,
+        OP_LDRB_imm_T1      = 0x7800,
         OP_LDRH_imm_T1      = 0x8800,
         OP_STR_imm_T2       = 0x9000,
         OP_LDR_imm_T2       = 0x9800,
@@ -631,12 +632,15 @@
         OP_SUB_imm_T4   = 0xF2A0,
         OP_MOVT         = 0xF2C0,
         OP_NOP_T2a      = 0xF3AF,
+        OP_LDRB_imm_T3  = 0xF810,
+        OP_LDRB_reg_T2  = 0xF810,
         OP_LDRH_reg_T2  = 0xF830,
         OP_LDRH_imm_T3  = 0xF830,
         OP_STR_imm_T4   = 0xF840,
         OP_STR_reg_T2   = 0xF840,
         OP_LDR_imm_T4   = 0xF850,
         OP_LDR_reg_T2   = 0xF850,
+        OP_LDRB_imm_T2  = 0xF890,
         OP_LDRH_imm_T2  = 0xF8B0,
         OP_STR_imm_T3   = 0xF8C0,
         OP_LDR_imm_T3   = 0xF8D0,
@@ -1080,6 +1084,52 @@
             m_formatter.twoWordOp12Reg4FourFours(OP_LDRH_reg_T2, rn, FourFours(rt, 0, shift, rm));
     }
 
+    void ldrb(RegisterID rt, RegisterID rn, ARMThumbImmediate imm)
+    {
+        ASSERT(rn != ARMRegisters::pc); // LDR (literal)
+        ASSERT(imm.isUInt12());
+
+        if (!((rt | rn) & 8) && imm.isUInt5())
+            m_formatter.oneWordOp5Imm5Reg3Reg3(OP_LDRB_imm_T1, imm.getUInt5(), rn, rt);
+        else
+            m_formatter.twoWordOp12Reg4Reg4Imm12(OP_LDRB_imm_T2, rn, rt, imm.getUInt12());
+    }
+
+    void ldrb(RegisterID rt, RegisterID rn, int offset, bool index, bool wback)
+    {
+        ASSERT(rt != ARMRegisters::pc);
+        ASSERT(rn != ARMRegisters::pc);
+        ASSERT(index || wback);
+        ASSERT(!wback | (rt != rn));
+
+        bool add = true;
+        if (offset < 0) {
+            add = false;
+            offset = -offset;
+        }
+
+        ASSERT(!(offset & ~0xff));
+
+        offset |= (wback << 8);
+        offset |= (add   << 9);
+        offset |= (index << 10);
+        offset |= (1 << 11);
+
+        m_formatter.twoWordOp12Reg4Reg4Imm12(OP_LDRB_imm_T3, rn, rt, offset);
+    }
+
+    void ldrb(RegisterID rt, RegisterID rn, RegisterID rm, unsigned shift = 0)
+    {
+        ASSERT(rn != ARMRegisters::pc); // LDR (literal)
+        ASSERT(!BadReg(rm));
+        ASSERT(shift <= 3);
+
+        if (!shift && !((rt | rn | rm) & 8))
+            m_formatter.oneWordOp7Reg3Reg3Reg3(OP_LDRB_reg_T1, rm, rn, rt);
+        else
+            m_formatter.twoWordOp12Reg4FourFours(OP_LDRB_reg_T2, rn, FourFours(rt, 0, shift, rm));
+    }
+
     void lsl(RegisterID rd, RegisterID rm, int32_t shiftAmount)
     {
         ASSERT(!BadReg(rd));
diff --git a/JavaScriptCore/assembler/AbstractMacroAssembler.h b/JavaScriptCore/assembler/AbstractMacroAssembler.h
index 198e8d1..f96e34a 100644
--- a/JavaScriptCore/assembler/AbstractMacroAssembler.h
+++ b/JavaScriptCore/assembler/AbstractMacroAssembler.h
@@ -26,8 +26,6 @@
 #ifndef AbstractMacroAssembler_h
 #define AbstractMacroAssembler_h
 
-#include <wtf/Platform.h>
-
 #include <MacroAssemblerCodeRef.h>
 #include <CodeLocation.h>
 #include <wtf/Noncopyable.h>
@@ -83,6 +81,17 @@
         int32_t offset;
     };
 
+    struct ExtendedAddress {
+        explicit ExtendedAddress(RegisterID base, intptr_t offset = 0)
+            : base(base)
+            , offset(offset)
+        {
+        }
+        
+        RegisterID base;
+        intptr_t offset;
+    };
+
     // ImplicitAddress:
     //
     // This class is used for explicit 'load' and 'store' operations
@@ -173,7 +182,7 @@
     struct Imm32 {
         explicit Imm32(int32_t value)
             : m_value(value)
-#if CPU(ARM)
+#if CPU(ARM) || CPU(MIPS)
             , m_isPointer(false)
 #endif
         {
@@ -182,7 +191,7 @@
 #if !CPU(X86_64)
         explicit Imm32(ImmPtr ptr)
             : m_value(ptr.asIntptr())
-#if CPU(ARM)
+#if CPU(ARM) || CPU(MIPS)
             , m_isPointer(true)
 #endif
         {
@@ -190,13 +199,14 @@
 #endif
 
         int32_t m_value;
-#if CPU(ARM)
+#if CPU(ARM) || CPU(MIPS)
         // We rely on being able to regenerate code to recover exception handling
         // information.  Since ARMv7 supports 16-bit immediates there is a danger
         // that if pointer values change the layout of the generated code will change.
         // To avoid this problem, always generate pointers (and thus Imm32s constructed
         // from ImmPtrs) with a code sequence that is able  to represent  any pointer
         // value - don't use a more compact form in these cases.
+        // Same for MIPS.
         bool m_isPointer;
 #endif
     };
diff --git a/JavaScriptCore/assembler/AssemblerBuffer.h b/JavaScriptCore/assembler/AssemblerBuffer.h
index 073906a..e2fb8a1 100644
--- a/JavaScriptCore/assembler/AssemblerBuffer.h
+++ b/JavaScriptCore/assembler/AssemblerBuffer.h
@@ -26,8 +26,6 @@
 #ifndef AssemblerBuffer_h
 #define AssemblerBuffer_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include "stdint.h"
diff --git a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
index af3c3be..b1c537e 100644
--- a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
+++ b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
@@ -27,8 +27,6 @@
 #ifndef AssemblerBufferWithConstantPool_h
 #define AssemblerBufferWithConstantPool_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include "AssemblerBuffer.h"
diff --git a/JavaScriptCore/assembler/CodeLocation.h b/JavaScriptCore/assembler/CodeLocation.h
index b910b6f..cab28cd 100644
--- a/JavaScriptCore/assembler/CodeLocation.h
+++ b/JavaScriptCore/assembler/CodeLocation.h
@@ -26,7 +26,6 @@
 #ifndef CodeLocation_h
 #define CodeLocation_h
 
-#include <wtf/Platform.h>
 
 #include <MacroAssemblerCodeRef.h>
 
diff --git a/JavaScriptCore/assembler/LinkBuffer.h b/JavaScriptCore/assembler/LinkBuffer.h
index 6d08117..47cac5a 100644
--- a/JavaScriptCore/assembler/LinkBuffer.h
+++ b/JavaScriptCore/assembler/LinkBuffer.h
@@ -26,8 +26,6 @@
 #ifndef LinkBuffer_h
 #define LinkBuffer_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include <MacroAssembler.h>
diff --git a/JavaScriptCore/assembler/MIPSAssembler.h b/JavaScriptCore/assembler/MIPSAssembler.h
new file mode 100644
index 0000000..ea35268
--- /dev/null
+++ b/JavaScriptCore/assembler/MIPSAssembler.h
@@ -0,0 +1,944 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 University of Szeged
+ * All rights reserved.
+ * Copyright (C) 2010 MIPS Technologies, 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 MIPS TECHNOLOGIES, 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 MIPS TECHNOLOGIES, 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 MIPSAssembler_h
+#define MIPSAssembler_h
+
+#if ENABLE(ASSEMBLER) && CPU(MIPS)
+
+#include "AssemblerBuffer.h"
+#include <wtf/Assertions.h>
+#include <wtf/SegmentedVector.h>
+
+namespace JSC {
+
+typedef uint32_t MIPSWord;
+
+namespace MIPSRegisters {
+typedef enum {
+    r0 = 0,
+    r1,
+    r2,
+    r3,
+    r4,
+    r5,
+    r6,
+    r7,
+    r8,
+    r9,
+    r10,
+    r11,
+    r12,
+    r13,
+    r14,
+    r15,
+    r16,
+    r17,
+    r18,
+    r19,
+    r20,
+    r21,
+    r22,
+    r23,
+    r24,
+    r25,
+    r26,
+    r27,
+    r28,
+    r29,
+    r30,
+    r31,
+    zero = r0,
+    at = r1,
+    v0 = r2,
+    v1 = r3,
+    a0 = r4,
+    a1 = r5,
+    a2 = r6,
+    a3 = r7,
+    t0 = r8,
+    t1 = r9,
+    t2 = r10,
+    t3 = r11,
+    t4 = r12,
+    t5 = r13,
+    t6 = r14,
+    t7 = r15,
+    s0 = r16,
+    s1 = r17,
+    s2 = r18,
+    s3 = r19,
+    s4 = r20,
+    s5 = r21,
+    s6 = r22,
+    s7 = r23,
+    t8 = r24,
+    t9 = r25,
+    k0 = r26,
+    k1 = r27,
+    gp = r28,
+    sp = r29,
+    fp = r30,
+    ra = r31
+} RegisterID;
+
+typedef enum {
+    f0,
+    f1,
+    f2,
+    f3,
+    f4,
+    f5,
+    f6,
+    f7,
+    f8,
+    f9,
+    f10,
+    f11,
+    f12,
+    f13,
+    f14,
+    f15,
+    f16,
+    f17,
+    f18,
+    f19,
+    f20,
+    f21,
+    f22,
+    f23,
+    f24,
+    f25,
+    f26,
+    f27,
+    f28,
+    f29,
+    f30,
+    f31
+} FPRegisterID;
+
+} // namespace MIPSRegisters
+
+class MIPSAssembler {
+public:
+    typedef MIPSRegisters::RegisterID RegisterID;
+    typedef MIPSRegisters::FPRegisterID FPRegisterID;
+    typedef SegmentedVector<int, 64> Jumps;
+
+    MIPSAssembler()
+    {
+    }
+
+    // MIPS instruction opcode field position
+    enum {
+        OP_SH_RD = 11,
+        OP_SH_RT = 16,
+        OP_SH_RS = 21,
+        OP_SH_SHAMT = 6,
+        OP_SH_CODE = 16,
+        OP_SH_FD = 6,
+        OP_SH_FS = 11,
+        OP_SH_FT = 16
+    };
+
+    class JmpSrc {
+        friend class MIPSAssembler;
+    public:
+        JmpSrc()
+            : m_offset(-1)
+        {
+        }
+
+    private:
+        JmpSrc(int offset)
+            : m_offset(offset)
+        {
+        }
+
+        int m_offset;
+    };
+
+    class JmpDst {
+        friend class MIPSAssembler;
+    public:
+        JmpDst()
+            : m_offset(-1)
+            , m_used(false)
+        {
+        }
+
+        bool isUsed() const { return m_used; }
+        void used() { m_used = true; }
+    private:
+        JmpDst(int offset)
+            : m_offset(offset)
+            , m_used(false)
+        {
+            ASSERT(m_offset == offset);
+        }
+
+        int m_offset : 31;
+        int m_used : 1;
+    };
+
+    void emitInst(MIPSWord op)
+    {
+        void* oldBase = m_buffer.data();
+
+        m_buffer.putInt(op);
+
+        void* newBase = m_buffer.data();
+        if (oldBase != newBase)
+            relocateJumps(oldBase, newBase);
+    }
+
+    void nop()
+    {
+        emitInst(0x00000000);
+    }
+
+    /* Need to insert one load data delay nop for mips1.  */
+    void loadDelayNop()
+    {
+#if WTF_MIPS_ISA(1)
+        nop();
+#endif
+    }
+
+    /* Need to insert one coprocessor access delay nop for mips1.  */
+    void copDelayNop()
+    {
+#if WTF_MIPS_ISA(1)
+        nop();
+#endif
+    }
+
+    void move(RegisterID rd, RegisterID rs)
+    {
+        /* addu */
+        emitInst(0x00000021 | (rd << OP_SH_RD) | (rs << OP_SH_RS));
+    }
+
+    /* Set an immediate value to a register.  This may generate 1 or 2
+       instructions.  */
+    void li(RegisterID dest, int imm)
+    {
+        if (imm >= -32768 && imm <= 32767)
+            addiu(dest, MIPSRegisters::zero, imm);
+        else if (imm >= 0 && imm < 65536)
+            ori(dest, MIPSRegisters::zero, imm);
+        else {
+            lui(dest, imm >> 16);
+            if (imm & 0xffff)
+                ori(dest, dest, imm);
+        }
+    }
+
+    void lui(RegisterID rt, int imm)
+    {
+        emitInst(0x3c000000 | (rt << OP_SH_RT) | (imm & 0xffff));
+    }
+
+    void addiu(RegisterID rt, RegisterID rs, int imm)
+    {
+        emitInst(0x24000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (imm & 0xffff));
+    }
+
+    void addu(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000021 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void subu(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000023 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void mult(RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000018 | (rs << OP_SH_RS) | (rt << OP_SH_RT));
+    }
+
+    void mfhi(RegisterID rd)
+    {
+        emitInst(0x00000010 | (rd << OP_SH_RD));
+    }
+
+    void mflo(RegisterID rd)
+    {
+        emitInst(0x00000012 | (rd << OP_SH_RD));
+    }
+
+    void mul(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+#if WTF_MIPS_ISA_AT_LEAST(32) 
+        emitInst(0x70000002 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+#else
+        mult(rs, rt);
+        mflo(rd);
+#endif
+    }
+
+    void andInsn(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000024 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void andi(RegisterID rt, RegisterID rs, int imm)
+    {
+        emitInst(0x30000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (imm & 0xffff));
+    }
+
+    void nor(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000027 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void orInsn(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000025 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void ori(RegisterID rt, RegisterID rs, int imm)
+    {
+        emitInst(0x34000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (imm & 0xffff));
+    }
+
+    void xorInsn(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x00000026 | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void xori(RegisterID rt, RegisterID rs, int imm)
+    {
+        emitInst(0x38000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (imm & 0xffff));
+    }
+
+    void slt(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x0000002a | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void sltu(RegisterID rd, RegisterID rs, RegisterID rt)
+    {
+        emitInst(0x0000002b | (rd << OP_SH_RD) | (rs << OP_SH_RS)
+                 | (rt << OP_SH_RT));
+    }
+
+    void sltiu(RegisterID rt, RegisterID rs, int imm)
+    {
+        emitInst(0x2c000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (imm & 0xffff));
+    }
+
+    void sll(RegisterID rd, RegisterID rt, int shamt)
+    {
+        emitInst(0x00000000 | (rd << OP_SH_RD) | (rt << OP_SH_RT)
+                 | ((shamt & 0x1f) << OP_SH_SHAMT));
+    }
+
+    void sllv(RegisterID rd, RegisterID rt, int rs)
+    {
+        emitInst(0x00000004 | (rd << OP_SH_RD) | (rt << OP_SH_RT)
+                 | (rs << OP_SH_RS));
+    }
+
+    void sra(RegisterID rd, RegisterID rt, int shamt)
+    {
+        emitInst(0x00000003 | (rd << OP_SH_RD) | (rt << OP_SH_RT)
+                 | ((shamt & 0x1f) << OP_SH_SHAMT));
+    }
+
+    void srav(RegisterID rd, RegisterID rt, RegisterID rs)
+    {
+        emitInst(0x00000007 | (rd << OP_SH_RD) | (rt << OP_SH_RT)
+                 | (rs << OP_SH_RS));
+    }
+
+    void lbu(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0x90000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        loadDelayNop();
+    }
+
+    void lw(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0x8c000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        loadDelayNop();
+    }
+
+    void lwl(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0x88000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        loadDelayNop();
+    }
+
+    void lwr(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0x98000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        loadDelayNop();
+    }
+
+    void lhu(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0x94000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        loadDelayNop();
+    }
+
+    void sw(RegisterID rt, RegisterID rs, int offset)
+    {
+        emitInst(0xac000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+    }
+
+    void jr(RegisterID rs)
+    {
+        emitInst(0x00000008 | (rs << OP_SH_RS));
+    }
+
+    void jalr(RegisterID rs)
+    {
+        emitInst(0x0000f809 | (rs << OP_SH_RS));
+    }
+
+    void jal()
+    {
+        emitInst(0x0c000000);
+    }
+
+    void bkpt()
+    {
+        int value = 512; /* BRK_BUG */
+        emitInst(0x0000000d | ((value & 0x3ff) << OP_SH_CODE));
+    }
+
+    void bgez(RegisterID rs, int imm)
+    {
+        emitInst(0x04010000 | (rs << OP_SH_RS) | (imm & 0xffff));
+    }
+
+    void bltz(RegisterID rs, int imm)
+    {
+        emitInst(0x04000000 | (rs << OP_SH_RS) | (imm & 0xffff));
+    }
+
+    void beq(RegisterID rs, RegisterID rt, int imm)
+    {
+        emitInst(0x10000000 | (rs << OP_SH_RS) | (rt << OP_SH_RT) | (imm & 0xffff));
+    }
+
+    void bne(RegisterID rs, RegisterID rt, int imm)
+    {
+        emitInst(0x14000000 | (rs << OP_SH_RS) | (rt << OP_SH_RT) | (imm & 0xffff));
+    }
+
+    void bc1t()
+    {
+        emitInst(0x45010000);
+    }
+
+    void bc1f()
+    {
+        emitInst(0x45000000);
+    }
+
+    JmpSrc newJmpSrc()
+    {
+        return JmpSrc(m_buffer.size());
+    }
+
+    void appendJump()
+    {
+        m_jumps.append(m_buffer.size());
+    }
+
+    void addd(FPRegisterID fd, FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200000 | (fd << OP_SH_FD) | (fs << OP_SH_FS)
+                 | (ft << OP_SH_FT));
+    }
+
+    void subd(FPRegisterID fd, FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200001 | (fd << OP_SH_FD) | (fs << OP_SH_FS)
+                 | (ft << OP_SH_FT));
+    }
+
+    void muld(FPRegisterID fd, FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200002 | (fd << OP_SH_FD) | (fs << OP_SH_FS)
+                 | (ft << OP_SH_FT));
+    }
+
+    void lwc1(FPRegisterID ft, RegisterID rs, int offset)
+    {
+        emitInst(0xc4000000 | (ft << OP_SH_FT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+        copDelayNop();
+    }
+
+    void ldc1(FPRegisterID ft, RegisterID rs, int offset)
+    {
+        emitInst(0xd4000000 | (ft << OP_SH_FT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+    }
+
+    void swc1(FPRegisterID ft, RegisterID rs, int offset)
+    {
+        emitInst(0xe4000000 | (ft << OP_SH_FT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+    }
+
+    void sdc1(FPRegisterID ft, RegisterID rs, int offset)
+    {
+        emitInst(0xf4000000 | (ft << OP_SH_FT) | (rs << OP_SH_RS)
+                 | (offset & 0xffff));
+    }
+
+    void mtc1(RegisterID rt, FPRegisterID fs)
+    {
+        emitInst(0x44800000 | (fs << OP_SH_FS) | (rt << OP_SH_RT));
+        copDelayNop();
+    }
+
+    void mfc1(RegisterID rt, FPRegisterID fs)
+    {
+        emitInst(0x44000000 | (fs << OP_SH_FS) | (rt << OP_SH_RT));
+        copDelayNop();
+    }
+
+    void truncwd(FPRegisterID fd, FPRegisterID fs)
+    {
+        emitInst(0x4620000d | (fd << OP_SH_FD) | (fs << OP_SH_FS));
+    }
+
+    void cvtdw(FPRegisterID fd, FPRegisterID fs)
+    {
+        emitInst(0x46800021 | (fd << OP_SH_FD) | (fs << OP_SH_FS));
+    }
+
+    void ceqd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200032 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cngtd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x4620003f | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cnged(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x4620003d | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cltd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x4620003c | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cled(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x4620003e | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cueqd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200033 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void coled(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200036 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void coltd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200034 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void culed(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200037 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    void cultd(FPRegisterID fs, FPRegisterID ft)
+    {
+        emitInst(0x46200035 | (fs << OP_SH_FS) | (ft << OP_SH_FT));
+        copDelayNop();
+    }
+
+    // General helpers
+
+    JmpDst label()
+    {
+        return JmpDst(m_buffer.size());
+    }
+
+    JmpDst align(int alignment)
+    {
+        while (!m_buffer.isAligned(alignment))
+            bkpt();
+
+        return label();
+    }
+
+    static void* getRelocatedAddress(void* code, JmpSrc jump)
+    {
+        ASSERT(jump.m_offset != -1);
+        void* b = reinterpret_cast<void*>((reinterpret_cast<intptr_t>(code)) + jump.m_offset);
+        return b;
+    }
+
+    static void* getRelocatedAddress(void* code, JmpDst label)
+    {
+        void* b = reinterpret_cast<void*>((reinterpret_cast<intptr_t>(code)) + label.m_offset);
+        return b;
+    }
+
+    static int getDifferenceBetweenLabels(JmpDst from, JmpDst to)
+    {
+        return to.m_offset - from.m_offset;
+    }
+
+    static int getDifferenceBetweenLabels(JmpDst from, JmpSrc to)
+    {
+        return to.m_offset - from.m_offset;
+    }
+
+    static int getDifferenceBetweenLabels(JmpSrc from, JmpDst to)
+    {
+        return to.m_offset - from.m_offset;
+    }
+
+    // Assembler admin methods:
+
+    size_t size() const
+    {
+        return m_buffer.size();
+    }
+
+    void* executableCopy(ExecutablePool* allocator)
+    {
+        void *result = m_buffer.executableCopy(allocator);
+        if (!result)
+            return 0;
+
+        relocateJumps(m_buffer.data(), result);
+        return result;
+    }
+
+    static unsigned getCallReturnOffset(JmpSrc call)
+    {
+        // The return address is after a call and a delay slot instruction
+        return call.m_offset;
+    }
+
+    // Linking & patching:
+    //
+    // 'link' and 'patch' methods are for use on unprotected code - such as the code
+    // within the AssemblerBuffer, and code being patched by the patch buffer.  Once
+    // code has been finalized it is (platform support permitting) within a non-
+    // writable region of memory; to modify the code in an execute-only execuable
+    // pool the 'repatch' and 'relink' methods should be used.
+
+    void linkJump(JmpSrc from, JmpDst to)
+    {
+        ASSERT(to.m_offset != -1);
+        ASSERT(from.m_offset != -1);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + from.m_offset);
+        MIPSWord* toPos = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(m_buffer.data()) + to.m_offset);
+
+        ASSERT(!(*(insn - 1)) && !(*(insn - 2)) && !(*(insn - 3)) && !(*(insn - 5)));
+        insn = insn - 6;
+        linkWithOffset(insn, toPos);
+    }
+
+    static void linkJump(void* code, JmpSrc from, void* to)
+    {
+        ASSERT(from.m_offset != -1);
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+
+        ASSERT(!(*(insn - 1)) && !(*(insn - 2)) && !(*(insn - 3)) && !(*(insn - 5)));
+        insn = insn - 6;
+        linkWithOffset(insn, to);
+    }
+
+    static void linkCall(void* code, JmpSrc from, void* to)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        linkCallInternal(insn, to);
+    }
+
+    static void linkPointer(void* code, JmpDst from, void* to)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(code) + from.m_offset);
+        ASSERT((*insn & 0xffe00000) == 0x3c000000); // lui
+        *insn = (*insn & 0xffff0000) | ((reinterpret_cast<intptr_t>(to) >> 16) & 0xffff);
+        insn++;
+        ASSERT((*insn & 0xfc000000) == 0x34000000); // ori
+        *insn = (*insn & 0xffff0000) | (reinterpret_cast<intptr_t>(to) & 0xffff);
+    }
+
+    static void relinkJump(void* from, void* to)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(from);
+
+        ASSERT(!(*(insn - 1)) && !(*(insn - 5)));
+        insn = insn - 6;
+        int flushSize = linkWithOffset(insn, to);
+
+        ExecutableAllocator::cacheFlush(insn, flushSize);
+    }
+
+    static void relinkCall(void* from, void* to)
+    {
+        void* start;
+        int size = linkCallInternal(from, to);
+        if (size == sizeof(MIPSWord))
+            start = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(from) - 2 * sizeof(MIPSWord));
+        else
+            start = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(from) - 4 * sizeof(MIPSWord));
+
+        ExecutableAllocator::cacheFlush(start, size);
+    }
+
+    static void repatchInt32(void* from, int32_t to)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(from);
+        ASSERT((*insn & 0xffe00000) == 0x3c000000); // lui
+        *insn = (*insn & 0xffff0000) | ((to >> 16) & 0xffff);
+        insn++;
+        ASSERT((*insn & 0xfc000000) == 0x34000000); // ori
+        *insn = (*insn & 0xffff0000) | (to & 0xffff);
+        insn--;
+        ExecutableAllocator::cacheFlush(insn, 2 * sizeof(MIPSWord));
+    }
+
+    static void repatchPointer(void* from, void* to)
+    {
+        repatchInt32(from, reinterpret_cast<int32_t>(to));
+    }
+
+    static void repatchLoadPtrToLEA(void* from)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(from);
+        insn = insn + 3;
+        ASSERT((*insn & 0xfc000000) == 0x8c000000); // lw
+        /* lw -> addiu */
+        *insn = 0x24000000 | (*insn & 0x03ffffff);
+
+        ExecutableAllocator::cacheFlush(insn, sizeof(MIPSWord));
+    }
+
+private:
+
+    /* Update each jump in the buffer of newBase.  */
+    void relocateJumps(void* oldBase, void* newBase)
+    {
+        // Check each jump
+        for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) {
+            int pos = *iter;
+            MIPSWord* insn = reinterpret_cast<MIPSWord*>(reinterpret_cast<intptr_t>(newBase) + pos);
+            insn = insn + 2;
+            // Need to make sure we have 5 valid instructions after pos
+            if ((unsigned int)pos >= m_buffer.size() - 5 * sizeof(MIPSWord))
+                continue;
+
+            if ((*insn & 0xfc000000) == 0x08000000) { // j
+                int offset = *insn & 0x03ffffff;
+                int oldInsnAddress = (int)insn - (int)newBase + (int)oldBase;
+                int topFourBits = (oldInsnAddress + 4) >> 28;
+                int oldTargetAddress = (topFourBits << 28) | (offset << 2);
+                int newTargetAddress = oldTargetAddress - (int)oldBase + (int)newBase;
+                int newInsnAddress = (int)insn;
+                if (((newInsnAddress + 4) >> 28) == (newTargetAddress >> 28))
+                    *insn = 0x08000000 | ((newTargetAddress >> 2) & 0x3ffffff);
+                else {
+                    /* lui */
+                    *insn = 0x3c000000 | (MIPSRegisters::t9 << OP_SH_RT) | ((newTargetAddress >> 16) & 0xffff);
+                    /* ori */
+                    *(insn + 1) = 0x34000000 | (MIPSRegisters::t9 << OP_SH_RT) | (MIPSRegisters::t9 << OP_SH_RS) | (newTargetAddress & 0xffff);
+                    /* jr */
+                    *(insn + 2) = 0x00000008 | (MIPSRegisters::t9 << OP_SH_RS);
+                }
+            } else if ((*insn & 0xffe00000) == 0x3c000000) { // lui
+                int high = (*insn & 0xffff) << 16;
+                int low = *(insn + 1) & 0xffff;
+                int oldTargetAddress = high | low;
+                int newTargetAddress = oldTargetAddress - (int)oldBase + (int)newBase;
+                /* lui */
+                *insn = 0x3c000000 | (MIPSRegisters::t9 << OP_SH_RT) | ((newTargetAddress >> 16) & 0xffff);
+                /* ori */
+                *(insn + 1) = 0x34000000 | (MIPSRegisters::t9 << OP_SH_RT) | (MIPSRegisters::t9 << OP_SH_RS) | (newTargetAddress & 0xffff);
+            }
+        }
+    }
+
+    static int linkWithOffset(MIPSWord* insn, void* to)
+    {
+        ASSERT((*insn & 0xfc000000) == 0x10000000 // beq
+               || (*insn & 0xfc000000) == 0x14000000 // bne
+               || (*insn & 0xffff0000) == 0x45010000 // bc1t
+               || (*insn & 0xffff0000) == 0x45000000); // bc1f
+        intptr_t diff = (reinterpret_cast<intptr_t>(to)
+                         - reinterpret_cast<intptr_t>(insn) - 4) >> 2;
+
+        if (diff < -32768 || diff > 32767 || *(insn + 2) != 0x10000003) {
+            /*
+                Convert the sequence:
+                  beq $2, $3, target
+                  nop
+                  b 1f
+                  nop
+                  nop
+                  nop
+                1:
+
+                to the new sequence if possible:
+                  bne $2, $3, 1f
+                  nop
+                  j    target
+                  nop
+                  nop
+                  nop
+                1:
+
+                OR to the new sequence:
+                  bne $2, $3, 1f
+                  nop
+                  lui $25, target >> 16
+                  ori $25, $25, target & 0xffff
+                  jr $25
+                  nop
+                1:
+
+                Note: beq/bne/bc1t/bc1f are converted to bne/beq/bc1f/bc1t.
+            */
+
+            if (*(insn + 2) == 0x10000003) {
+                if ((*insn & 0xfc000000) == 0x10000000) // beq
+                    *insn = (*insn & 0x03ff0000) | 0x14000005; // bne
+                else if ((*insn & 0xfc000000) == 0x14000000) // bne
+                    *insn = (*insn & 0x03ff0000) | 0x10000005; // beq
+                else if ((*insn & 0xffff0000) == 0x45010000) // bc1t
+                    *insn = 0x45000005; // bc1f
+                else if ((*insn & 0xffff0000) == 0x45000000) // bc1f
+                    *insn = 0x45010005; // bc1t
+                else
+                    ASSERT(0);
+            }
+
+            insn = insn + 2;
+            if ((reinterpret_cast<intptr_t>(insn) + 4) >> 28
+                == reinterpret_cast<intptr_t>(to) >> 28) {
+                *insn = 0x08000000 | ((reinterpret_cast<intptr_t>(to) >> 2) & 0x3ffffff);
+                *(insn + 1) = 0;
+                return 4 * sizeof(MIPSWord);
+            }
+
+            intptr_t newTargetAddress = reinterpret_cast<intptr_t>(to);
+            /* lui */
+            *insn = 0x3c000000 | (MIPSRegisters::t9 << OP_SH_RT) | ((newTargetAddress >> 16) & 0xffff);
+            /* ori */
+            *(insn + 1) = 0x34000000 | (MIPSRegisters::t9 << OP_SH_RT) | (MIPSRegisters::t9 << OP_SH_RS) | (newTargetAddress & 0xffff);
+            /* jr */
+            *(insn + 2) = 0x00000008 | (MIPSRegisters::t9 << OP_SH_RS);
+            return 5 * sizeof(MIPSWord);
+        }
+
+        *insn = (*insn & 0xffff0000) | (diff & 0xffff);
+        return sizeof(MIPSWord);
+    }
+
+    static int linkCallInternal(void* from, void* to)
+    {
+        MIPSWord* insn = reinterpret_cast<MIPSWord*>(from);
+        insn = insn - 4;
+
+        if ((*(insn + 2) & 0xfc000000) == 0x0c000000) { // jal
+            if ((reinterpret_cast<intptr_t>(from) - 4) >> 28
+                == reinterpret_cast<intptr_t>(to) >> 28) {
+                *(insn + 2) = 0x0c000000 | ((reinterpret_cast<intptr_t>(to) >> 2) & 0x3ffffff);
+                return sizeof(MIPSWord);
+            }
+
+            /* lui $25, (to >> 16) & 0xffff */
+            *insn = 0x3c000000 | (MIPSRegisters::t9 << OP_SH_RT) | ((reinterpret_cast<intptr_t>(to) >> 16) & 0xffff);
+            /* ori $25, $25, to & 0xffff */
+            *(insn + 1) = 0x34000000 | (MIPSRegisters::t9 << OP_SH_RT) | (MIPSRegisters::t9 << OP_SH_RS) | (reinterpret_cast<intptr_t>(to) & 0xffff);
+            /* jalr $25 */
+            *(insn + 2) = 0x0000f809 | (MIPSRegisters::t9 << OP_SH_RS);
+            return 3 * sizeof(MIPSWord);
+        }
+
+        ASSERT((*insn & 0xffe00000) == 0x3c000000); // lui
+        ASSERT((*(insn + 1) & 0xfc000000) == 0x34000000); // ori
+
+        /* lui */
+        *insn = (*insn & 0xffff0000) | ((reinterpret_cast<intptr_t>(to) >> 16) & 0xffff);
+        /* ori */
+        *(insn + 1) = (*(insn + 1) & 0xffff0000) | (reinterpret_cast<intptr_t>(to) & 0xffff);
+        return 2 * sizeof(MIPSWord);
+    }
+
+    AssemblerBuffer m_buffer;
+    Jumps m_jumps;
+};
+
+} // namespace JSC
+
+#endif // ENABLE(ASSEMBLER) && CPU(MIPS)
+
+#endif // MIPSAssembler_h
diff --git a/JavaScriptCore/assembler/MacroAssembler.h b/JavaScriptCore/assembler/MacroAssembler.h
index 76bd205..ce1be78 100644
--- a/JavaScriptCore/assembler/MacroAssembler.h
+++ b/JavaScriptCore/assembler/MacroAssembler.h
@@ -26,8 +26,6 @@
 #ifndef MacroAssembler_h
 #define MacroAssembler_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #if CPU(ARM_THUMB2)
@@ -38,6 +36,12 @@
 #include "MacroAssemblerARM.h"
 namespace JSC { typedef MacroAssemblerARM MacroAssemblerBase; };
 
+#elif CPU(MIPS)
+#include "MacroAssemblerMIPS.h"
+namespace JSC {
+typedef MacroAssemblerMIPS MacroAssemblerBase;
+};
+
 #elif CPU(X86)
 #include "MacroAssemblerX86.h"
 namespace JSC { typedef MacroAssemblerX86 MacroAssemblerBase; };
@@ -327,6 +331,11 @@
     {
         return branchSub32(cond, imm, dest);
     }
+    using MacroAssemblerBase::branchTest8;
+    Jump branchTest8(Condition cond, ExtendedAddress address, Imm32 mask = Imm32(-1))
+    {
+        return MacroAssemblerBase::branchTest8(cond, Address(address.base, address.offset), mask);
+    }
 #endif
 
 };
diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h
index 21b8de8..52c4fa2 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -28,8 +28,6 @@
 #ifndef MacroAssemblerARM_h
 #define MacroAssemblerARM_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL)
 
 #include "ARMAssembler.h"
@@ -214,6 +212,11 @@
         m_assembler.eors_r(dest, dest, m_assembler.getImm(imm.m_value, ARMRegisters::S0));
     }
 
+    void load8(ImplicitAddress address, RegisterID dest)
+    {
+        m_assembler.dataTransfer32(true, dest, address.base, address.offset, true);
+    }
+
     void load32(ImplicitAddress address, RegisterID dest)
     {
         m_assembler.dataTransfer32(true, dest, address.base, address.offset);
@@ -359,6 +362,12 @@
             move(src, dest);
     }
 
+    Jump branch8(Condition cond, Address left, Imm32 right)
+    {
+        load8(left, ARMRegisters::S1);
+        return branch32(cond, ARMRegisters::S1, right);
+    }
+
     Jump branch32(Condition cond, RegisterID left, RegisterID right, int useConstantPool = 0)
     {
         m_assembler.cmp_r(left, right);
@@ -422,6 +431,12 @@
         return m_assembler.jmp(ARMCondition(cond));
     }
 
+    Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
+    {
+        load8(address, ARMRegisters::S1);
+        return branchTest32(cond, ARMRegisters::S1, mask);
+    }
+
     Jump branchTest32(Condition cond, RegisterID reg, RegisterID mask)
     {
         ASSERT((cond == Zero) || (cond == NonZero));
@@ -530,6 +545,13 @@
         return Jump(m_assembler.jmp(ARMCondition(cond)));
     }
 
+    Jump branchNeg32(Condition cond, RegisterID srcDest)
+    {
+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
+        neg32(srcDest);
+        return Jump(m_assembler.jmp(ARMCondition(cond)));
+    }
+
     Jump branchOr32(Condition cond, RegisterID src, RegisterID dest)
     {
         ASSERT((cond == Signed) || (cond == Zero) || (cond == NonZero));
diff --git a/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/JavaScriptCore/assembler/MacroAssemblerARMv7.h
index 532a9cf..3d08f0e 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARMv7.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARMv7.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,8 +27,6 @@
 #ifndef MacroAssemblerARMv7_h
 #define MacroAssemblerARMv7_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include "ARMv7Assembler.h"
@@ -368,6 +367,20 @@
         }
     }
 
+    void load8(ArmAddress address, RegisterID dest)
+    {
+        if (address.type == ArmAddress::HasIndex)
+            m_assembler.ldrb(dest, address.base, address.u.index, address.u.scale);
+        else if (address.u.offset >= 0) {
+            ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12(address.u.offset);
+            ASSERT(armImm.isValid());
+            m_assembler.ldrb(dest, address.base, armImm);
+        } else {
+            ASSERT(address.u.offset >= -255);
+            m_assembler.ldrb(dest, address.base, address.u.offset, true, false);
+        }
+    }
+
     void store32(RegisterID src, ArmAddress address)
     {
         if (address.type == ArmAddress::HasIndex)
@@ -404,6 +417,11 @@
         m_assembler.ldr(dest, addressTempRegister, ARMThumbImmediate::makeUInt16(0));
     }
 
+    void load8(ImplicitAddress address, RegisterID dest)
+    {
+        load8(setupArmAddress(address), dest);
+    }
+
     DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
     {
         DataLabel32 label = moveWithPatch(Imm32(address.offset), dataTempRegister);
@@ -793,6 +811,19 @@
         return branch32(cond, addressTempRegister, Imm32(right.m_value << 16));
     }
 
+    Jump branch8(Condition cond, RegisterID left, Imm32 right)
+    {
+        compare32(left, right);
+        return Jump(makeBranch(cond));
+    }
+
+    Jump branch8(Condition cond, Address left, Imm32 right)
+    {
+        // use addressTempRegister incase the branch8 we call uses dataTempRegister. :-/
+        load8(left, addressTempRegister);
+        return branch8(cond, addressTempRegister, right);
+    }
+
     Jump branchTest32(Condition cond, RegisterID reg, RegisterID mask)
     {
         ASSERT((cond == Zero) || (cond == NonZero));
@@ -823,6 +854,21 @@
         return branchTest32(cond, addressTempRegister, mask);
     }
 
+    Jump branchTest8(Condition cond, RegisterID reg, Imm32 mask = Imm32(-1))
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        test32(reg, mask);
+        return Jump(makeBranch(cond));
+    }
+
+    Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        // use addressTempRegister incase the branchTest8 we call uses dataTempRegister. :-/
+        load8(address, addressTempRegister);
+        return branchTest8(cond, addressTempRegister, mask);
+    }
+
     Jump jump()
     {
         return Jump(makeJump());
@@ -973,6 +1019,14 @@
         m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
     }
 
+    void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+    {
+        load8(address, dataTempRegister);
+        test32(dataTempRegister, mask);
+        m_assembler.it(armV7Condition(cond), false);
+        m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(1));
+        m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
+    }
 
     DataLabel32 moveWithPatch(Imm32 imm, RegisterID dst)
     {
diff --git a/JavaScriptCore/assembler/MacroAssemblerCodeRef.h b/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
index cae8bf6..543b0fa 100644
--- a/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
+++ b/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
@@ -26,8 +26,6 @@
 #ifndef MacroAssemblerCodeRef_h
 #define MacroAssemblerCodeRef_h
 
-#include <wtf/Platform.h>
-
 #include "ExecutableAllocator.h"
 #include "PassRefPtr.h"
 #include "RefPtr.h"
diff --git a/JavaScriptCore/assembler/MacroAssemblerMIPS.h b/JavaScriptCore/assembler/MacroAssemblerMIPS.h
new file mode 100644
index 0000000..9853c34
--- /dev/null
+++ b/JavaScriptCore/assembler/MacroAssemblerMIPS.h
@@ -0,0 +1,1711 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 MIPS Technologies, 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 MIPS TECHNOLOGIES, 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 MIPS TECHNOLOGIES, 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 MacroAssemblerMIPS_h
+#define MacroAssemblerMIPS_h
+
+#if ENABLE(ASSEMBLER) && CPU(MIPS)
+
+#include "AbstractMacroAssembler.h"
+#include "MIPSAssembler.h"
+
+namespace JSC {
+
+class MacroAssemblerMIPS : public AbstractMacroAssembler<MIPSAssembler> {
+public:
+
+    MacroAssemblerMIPS()
+        : m_fixedWidth(false)
+    {
+    }
+
+    static const Scale ScalePtr = TimesFour;
+
+    // For storing immediate number
+    static const RegisterID immTempRegister = MIPSRegisters::t0;
+    // For storing data loaded from the memory
+    static const RegisterID dataTempRegister = MIPSRegisters::t1;
+    // For storing address base
+    static const RegisterID addrTempRegister = MIPSRegisters::t2;
+    // For storing compare result
+    static const RegisterID cmpTempRegister = MIPSRegisters::t3;
+
+    // FP temp register
+    static const FPRegisterID fpTempRegister = MIPSRegisters::f16;
+
+    enum Condition {
+        Equal,
+        NotEqual,
+        Above,
+        AboveOrEqual,
+        Below,
+        BelowOrEqual,
+        GreaterThan,
+        GreaterThanOrEqual,
+        LessThan,
+        LessThanOrEqual,
+        Overflow,
+        Signed,
+        Zero,
+        NonZero
+    };
+
+    enum DoubleCondition {
+        DoubleEqual,
+        DoubleNotEqual,
+        DoubleGreaterThan,
+        DoubleGreaterThanOrEqual,
+        DoubleLessThan,
+        DoubleLessThanOrEqual,
+        DoubleEqualOrUnordered,
+        DoubleNotEqualOrUnordered,
+        DoubleGreaterThanOrUnordered,
+        DoubleGreaterThanOrEqualOrUnordered,
+        DoubleLessThanOrUnordered,
+        DoubleLessThanOrEqualOrUnordered
+    };
+
+    static const RegisterID stackPointerRegister = MIPSRegisters::sp;
+    static const RegisterID returnAddressRegister = MIPSRegisters::ra;
+
+    // Integer arithmetic operations:
+    //
+    // Operations are typically two operand - operation(source, srcDst)
+    // For many operations the source may be an Imm32, the srcDst operand
+    // may often be a memory location (explictly described using an Address
+    // object).
+
+    void add32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.addu(dest, dest, src);
+    }
+
+    void add32(Imm32 imm, RegisterID dest)
+    {
+        add32(imm, dest, dest);
+    }
+
+    void add32(Imm32 imm, RegisterID src, RegisterID dest)
+    {
+        if (!imm.m_isPointer && imm.m_value >= -32768 && imm.m_value <= 32767
+            && !m_fixedWidth) {
+            /*
+              addiu     dest, src, imm
+            */
+            m_assembler.addiu(dest, src, imm.m_value);
+        } else {
+            /*
+              li        immTemp, imm
+              addu      dest, src, immTemp
+            */
+            move(imm, immTempRegister);
+            m_assembler.addu(dest, src, immTempRegister);
+        }
+    }
+
+    void add32(Imm32 imm, Address address)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            /*
+              lw        dataTemp, offset(base)
+              li        immTemp, imm
+              addu      dataTemp, dataTemp, immTemp
+              sw        dataTemp, offset(base)
+            */
+            m_assembler.lw(dataTempRegister, address.base, address.offset);
+            if (!imm.m_isPointer
+                && imm.m_value >= -32768 && imm.m_value <= 32767
+                && !m_fixedWidth)
+                m_assembler.addiu(dataTempRegister, dataTempRegister,
+                                  imm.m_value);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.addu(dataTempRegister, dataTempRegister,
+                                 immTempRegister);
+            }
+            m_assembler.sw(dataTempRegister, address.base, address.offset);
+        } else {
+            /*
+              lui       addrTemp, (offset + 0x8000) >> 16
+              addu      addrTemp, addrTemp, base
+              lw        dataTemp, (offset & 0xffff)(addrTemp)
+              li        immtemp, imm
+              addu      dataTemp, dataTemp, immTemp
+              sw        dataTemp, (offset & 0xffff)(addrTemp)
+            */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lw(dataTempRegister, addrTempRegister, address.offset);
+
+            if (imm.m_value >= -32768 && imm.m_value <= 32767 && !m_fixedWidth)
+                m_assembler.addiu(dataTempRegister, dataTempRegister,
+                                  imm.m_value);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.addu(dataTempRegister, dataTempRegister,
+                                 immTempRegister);
+            }
+            m_assembler.sw(dataTempRegister, addrTempRegister, address.offset);
+        }
+    }
+
+    void add32(Address src, RegisterID dest)
+    {
+        load32(src, dataTempRegister);
+        add32(dataTempRegister, dest);
+    }
+
+    void add32(RegisterID src, Address dest)
+    {
+        if (dest.offset >= -32768 && dest.offset <= 32767 && !m_fixedWidth) {
+            /*
+              lw        dataTemp, offset(base)
+              addu      dataTemp, dataTemp, src
+              sw        dataTemp, offset(base)
+            */
+            m_assembler.lw(dataTempRegister, dest.base, dest.offset);
+            m_assembler.addu(dataTempRegister, dataTempRegister, src);
+            m_assembler.sw(dataTempRegister, dest.base, dest.offset);
+        } else {
+            /*
+              lui       addrTemp, (offset + 0x8000) >> 16
+              addu      addrTemp, addrTemp, base
+              lw        dataTemp, (offset & 0xffff)(addrTemp)
+              addu      dataTemp, dataTemp, src
+              sw        dataTemp, (offset & 0xffff)(addrTemp)
+            */
+            m_assembler.lui(addrTempRegister, (dest.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, dest.base);
+            m_assembler.lw(dataTempRegister, addrTempRegister, dest.offset);
+            m_assembler.addu(dataTempRegister, dataTempRegister, src);
+            m_assembler.sw(dataTempRegister, addrTempRegister, dest.offset);
+        }
+    }
+
+    void add32(Imm32 imm, AbsoluteAddress address)
+    {
+        /*
+           li   addrTemp, address
+           li   immTemp, imm
+           lw   dataTemp, 0(addrTemp)
+           addu dataTemp, dataTemp, immTemp
+           sw   dataTemp, 0(addrTemp)
+        */
+        move(ImmPtr(address.m_ptr), addrTempRegister);
+        m_assembler.lw(dataTempRegister, addrTempRegister, 0);
+        if (!imm.m_isPointer && imm.m_value >= -32768 && imm.m_value <= 32767
+            && !m_fixedWidth)
+            m_assembler.addiu(dataTempRegister, dataTempRegister, imm.m_value);
+        else {
+            move(imm, immTempRegister);
+            m_assembler.addu(dataTempRegister, dataTempRegister, immTempRegister);
+        }
+        m_assembler.sw(dataTempRegister, addrTempRegister, 0);
+    }
+
+    void and32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.andInsn(dest, dest, src);
+    }
+
+    void and32(Imm32 imm, RegisterID dest)
+    {
+        if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth)
+            move(MIPSRegisters::zero, dest);
+        else if (!imm.m_isPointer && imm.m_value > 0 && imm.m_value < 65535
+                 && !m_fixedWidth)
+            m_assembler.andi(dest, dest, imm.m_value);
+        else {
+            /*
+              li        immTemp, imm
+              and       dest, dest, immTemp
+            */
+            move(imm, immTempRegister);
+            m_assembler.andInsn(dest, dest, immTempRegister);
+        }
+    }
+
+    void lshift32(Imm32 imm, RegisterID dest)
+    {
+        m_assembler.sll(dest, dest, imm.m_value);
+    }
+
+    void lshift32(RegisterID shiftAmount, RegisterID dest)
+    {
+        m_assembler.sllv(dest, dest, shiftAmount);
+    }
+
+    void mul32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.mul(dest, dest, src);
+    }
+
+    void mul32(Imm32 imm, RegisterID src, RegisterID dest)
+    {
+        if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth)
+            move(MIPSRegisters::zero, dest);
+        else if (!imm.m_isPointer && imm.m_value == 1 && !m_fixedWidth)
+            move(src, dest);
+        else {
+            /*
+                li      dataTemp, imm
+                mul     dest, src, dataTemp
+            */
+            move(imm, dataTempRegister);
+            m_assembler.mul(dest, src, dataTempRegister);
+        }
+    }
+
+    void not32(RegisterID srcDest)
+    {
+        m_assembler.nor(srcDest, srcDest, MIPSRegisters::zero);
+    }
+
+    void or32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.orInsn(dest, dest, src);
+    }
+
+    void or32(Imm32 imm, RegisterID dest)
+    {
+        if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth)
+            return;
+
+        if (!imm.m_isPointer && imm.m_value > 0 && imm.m_value < 65535
+            && !m_fixedWidth) {
+            m_assembler.ori(dest, dest, imm.m_value);
+            return;
+        }
+
+        /*
+            li      dataTemp, imm
+            or      dest, dest, dataTemp
+        */
+        move(imm, dataTempRegister);
+        m_assembler.orInsn(dest, dest, dataTempRegister);
+    }
+
+    void rshift32(RegisterID shiftAmount, RegisterID dest)
+    {
+        m_assembler.srav(dest, dest, shiftAmount);
+    }
+
+    void rshift32(Imm32 imm, RegisterID dest)
+    {
+        m_assembler.sra(dest, dest, imm.m_value);
+    }
+
+    void sub32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.subu(dest, dest, src);
+    }
+
+    void sub32(Imm32 imm, RegisterID dest)
+    {
+        if (!imm.m_isPointer && imm.m_value >= -32767 && imm.m_value <= 32768
+            && !m_fixedWidth) {
+            /*
+              addiu     dest, src, imm
+            */
+            m_assembler.addiu(dest, dest, -imm.m_value);
+        } else {
+            /*
+              li        immTemp, imm
+              subu      dest, src, immTemp
+            */
+            move(imm, immTempRegister);
+            m_assembler.subu(dest, dest, immTempRegister);
+        }
+    }
+
+    void sub32(Imm32 imm, Address address)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            /*
+              lw        dataTemp, offset(base)
+              li        immTemp, imm
+              subu      dataTemp, dataTemp, immTemp
+              sw        dataTemp, offset(base)
+            */
+            m_assembler.lw(dataTempRegister, address.base, address.offset);
+            if (!imm.m_isPointer
+                && imm.m_value >= -32767 && imm.m_value <= 32768
+                && !m_fixedWidth)
+                m_assembler.addiu(dataTempRegister, dataTempRegister,
+                                  -imm.m_value);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.subu(dataTempRegister, dataTempRegister,
+                                 immTempRegister);
+            }
+            m_assembler.sw(dataTempRegister, address.base, address.offset);
+        } else {
+            /*
+              lui       addrTemp, (offset + 0x8000) >> 16
+              addu      addrTemp, addrTemp, base
+              lw        dataTemp, (offset & 0xffff)(addrTemp)
+              li        immtemp, imm
+              subu      dataTemp, dataTemp, immTemp
+              sw        dataTemp, (offset & 0xffff)(addrTemp)
+            */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lw(dataTempRegister, addrTempRegister, address.offset);
+
+            if (!imm.m_isPointer
+                && imm.m_value >= -32767 && imm.m_value <= 32768
+                && !m_fixedWidth)
+                m_assembler.addiu(dataTempRegister, dataTempRegister,
+                                  -imm.m_value);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.subu(dataTempRegister, dataTempRegister,
+                                 immTempRegister);
+            }
+            m_assembler.sw(dataTempRegister, addrTempRegister, address.offset);
+        }
+    }
+
+    void sub32(Address src, RegisterID dest)
+    {
+        load32(src, dataTempRegister);
+        sub32(dataTempRegister, dest);
+    }
+
+    void sub32(Imm32 imm, AbsoluteAddress address)
+    {
+        /*
+           li   addrTemp, address
+           li   immTemp, imm
+           lw   dataTemp, 0(addrTemp)
+           subu dataTemp, dataTemp, immTemp
+           sw   dataTemp, 0(addrTemp)
+        */
+        move(ImmPtr(address.m_ptr), addrTempRegister);
+        m_assembler.lw(dataTempRegister, addrTempRegister, 0);
+
+        if (!imm.m_isPointer && imm.m_value >= -32767 && imm.m_value <= 32768
+            && !m_fixedWidth) {
+            m_assembler.addiu(dataTempRegister, dataTempRegister,
+                              -imm.m_value);
+        } else {
+            move(imm, immTempRegister);
+            m_assembler.subu(dataTempRegister, dataTempRegister, immTempRegister);
+        }
+        m_assembler.sw(dataTempRegister, addrTempRegister, 0);
+    }
+
+    void xor32(RegisterID src, RegisterID dest)
+    {
+        m_assembler.xorInsn(dest, dest, src);
+    }
+
+    void xor32(Imm32 imm, RegisterID dest)
+    {
+        /*
+            li  immTemp, imm
+            xor dest, dest, immTemp
+        */
+        move(imm, immTempRegister);
+        m_assembler.xorInsn(dest, dest, immTempRegister);
+    }
+
+    // Memory access operations:
+    //
+    // Loads are of the form load(address, destination) and stores of the form
+    // store(source, address).  The source for a store may be an Imm32.  Address
+    // operand objects to loads and store will be implicitly constructed if a
+    // register is passed.
+
+    /* Need to use zero-extened load byte for load8.  */
+    void load8(ImplicitAddress address, RegisterID dest)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth)
+            m_assembler.lbu(dest, address.base, address.offset);
+        else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                lbu     dest, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lbu(dest, addrTempRegister, address.offset);
+        }
+    }
+
+    void load32(ImplicitAddress address, RegisterID dest)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth)
+            m_assembler.lw(dest, address.base, address.offset);
+        else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                lw      dest, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lw(dest, addrTempRegister, address.offset);
+        }
+    }
+
+    void load32(BaseIndex address, RegisterID dest)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lw      dest, address.offset(addrTemp)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lw(dest, addrTempRegister, address.offset);
+        } else {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lui     immTemp, (address.offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, immTemp
+                lw      dest, (address.offset & 0xffff)(at)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lui(immTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister,
+                             immTempRegister);
+            m_assembler.lw(dest, addrTempRegister, address.offset);
+        }
+    }
+
+    void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
+    {
+        if (address.offset >= -32768 && address.offset <= 32764
+            && !m_fixedWidth) {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                (Big-Endian)
+                lwl     dest, address.offset(addrTemp)
+                lwr     dest, address.offset+3(addrTemp)
+                (Little-Endian)
+                lwl     dest, address.offset+3(addrTemp)
+                lwr     dest, address.offset(addrTemp)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+#if CPU(BIG_ENDIAN)
+            m_assembler.lwl(dest, addrTempRegister, address.offset);
+            m_assembler.lwr(dest, addrTempRegister, address.offset + 3);
+#else
+            m_assembler.lwl(dest, addrTempRegister, address.offset + 3);
+            m_assembler.lwr(dest, addrTempRegister, address.offset);
+
+#endif
+        } else {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lui     immTemp, address.offset >> 16
+                ori     immTemp, immTemp, address.offset & 0xffff
+                addu    addrTemp, addrTemp, immTemp
+                (Big-Endian)
+                lw      dest, 0(at)
+                lw      dest, 3(at)
+                (Little-Endian)
+                lw      dest, 3(at)
+                lw      dest, 0(at)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lui(immTempRegister, address.offset >> 16);
+            m_assembler.ori(immTempRegister, immTempRegister, address.offset);
+            m_assembler.addu(addrTempRegister, addrTempRegister,
+                             immTempRegister);
+#if CPU(BIG_ENDIAN)
+            m_assembler.lwl(dest, addrTempRegister, 0);
+            m_assembler.lwr(dest, addrTempRegister, 3);
+#else
+            m_assembler.lwl(dest, addrTempRegister, 3);
+            m_assembler.lwr(dest, addrTempRegister, 0);
+#endif
+        }
+    }
+
+    void load32(void* address, RegisterID dest)
+    {
+        /*
+            li  addrTemp, address
+            lw  dest, 0(addrTemp)
+        */
+        move(ImmPtr(address), addrTempRegister);
+        m_assembler.lw(dest, addrTempRegister, 0);
+    }
+
+    DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
+    {
+        m_fixedWidth = true;
+        /*
+            lui addrTemp, address.offset >> 16
+            ori addrTemp, addrTemp, address.offset & 0xffff
+            addu        addrTemp, addrTemp, address.base
+            lw  dest, 0(addrTemp)
+        */
+        DataLabel32 dataLabel(this);
+        move(Imm32(address.offset), addrTempRegister);
+        m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+        m_assembler.lw(dest, addrTempRegister, 0);
+        m_fixedWidth = false;
+        return dataLabel;
+    }
+
+    Label loadPtrWithPatchToLEA(Address address, RegisterID dest)
+    {
+        m_fixedWidth = true;
+        /*
+            lui         addrTemp, address.offset >> 16
+            ori         addrTemp, addrTemp, address.offset & 0xffff
+            addu        addrTemp, addrTemp, address.base
+            lw          dest, 0(addrTemp)
+        */
+        Label label(this);
+        move(Imm32(address.offset), addrTempRegister);
+        m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+        m_assembler.lw(dest, addrTempRegister, 0);
+        m_fixedWidth = false;
+        return label;
+    }
+
+    Label loadPtrWithAddressOffsetPatch(Address address, RegisterID dest)
+    {
+        return loadPtrWithPatchToLEA(address, dest);
+    }
+
+    /* Need to use zero-extened load half-word for load16.  */
+    void load16(BaseIndex address, RegisterID dest)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lhu     dest, address.offset(addrTemp)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lhu(dest, addrTempRegister, address.offset);
+        } else {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lui     immTemp, (address.offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, immTemp
+                lhu     dest, (address.offset & 0xffff)(addrTemp)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lui(immTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister,
+                             immTempRegister);
+            m_assembler.lhu(dest, addrTempRegister, address.offset);
+        }
+    }
+
+    DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address)
+    {
+        m_fixedWidth = true;
+        /*
+            lui addrTemp, address.offset >> 16
+            ori addrTemp, addrTemp, address.offset & 0xffff
+            addu        addrTemp, addrTemp, address.base
+            sw  src, 0(addrTemp)
+        */
+        DataLabel32 dataLabel(this);
+        move(Imm32(address.offset), addrTempRegister);
+        m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+        m_assembler.sw(src, addrTempRegister, 0);
+        m_fixedWidth = false;
+        return dataLabel;
+    }
+
+    void store32(RegisterID src, ImplicitAddress address)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth)
+            m_assembler.sw(src, address.base, address.offset);
+        else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                sw      src, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.sw(src, addrTempRegister, address.offset);
+        }
+    }
+
+    void store32(RegisterID src, BaseIndex address)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                sw      src, address.offset(addrTemp)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.sw(src, addrTempRegister, address.offset);
+        } else {
+            /*
+                sll     addrTemp, address.index, address.scale
+                addu    addrTemp, addrTemp, address.base
+                lui     immTemp, (address.offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, immTemp
+                sw      src, (address.offset & 0xffff)(at)
+            */
+            m_assembler.sll(addrTempRegister, address.index, address.scale);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.lui(immTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister,
+                             immTempRegister);
+            m_assembler.sw(src, addrTempRegister, address.offset);
+        }
+    }
+
+    void store32(Imm32 imm, ImplicitAddress address)
+    {
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            if (!imm.m_isPointer && !imm.m_value)
+                m_assembler.sw(MIPSRegisters::zero, address.base,
+                               address.offset);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.sw(immTempRegister, address.base, address.offset);
+            }
+        } else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                sw      immTemp, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth)
+                m_assembler.sw(MIPSRegisters::zero, addrTempRegister,
+                               address.offset);
+            else {
+                move(imm, immTempRegister);
+                m_assembler.sw(immTempRegister, addrTempRegister,
+                               address.offset);
+            }
+        }
+    }
+
+    void store32(RegisterID src, void* address)
+    {
+        /*
+            li  addrTemp, address
+            sw  src, 0(addrTemp)
+        */
+        move(ImmPtr(address), addrTempRegister);
+        m_assembler.sw(src, addrTempRegister, 0);
+    }
+
+    void store32(Imm32 imm, void* address)
+    {
+        /*
+            li  immTemp, imm
+            li  addrTemp, address
+            sw  src, 0(addrTemp)
+        */
+        if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth) {
+            move(ImmPtr(address), addrTempRegister);
+            m_assembler.sw(MIPSRegisters::zero, addrTempRegister, 0);
+        } else {
+            move(imm, immTempRegister);
+            move(ImmPtr(address), addrTempRegister);
+            m_assembler.sw(immTempRegister, addrTempRegister, 0);
+        }
+    }
+
+    // Floating-point operations:
+
+    bool supportsFloatingPoint() const
+    {
+#if WTF_MIPS_DOUBLE_FLOAT
+        return true;
+#else
+        return false;
+#endif
+    }
+
+    bool supportsFloatingPointTruncate() const
+    {
+#if WTF_MIPS_DOUBLE_FLOAT && WTF_MIPS_ISA_AT_LEAST(2)
+        return true;
+#else
+        return false;
+#endif
+    }
+
+    // Stack manipulation operations:
+    //
+    // The ABI is assumed to provide a stack abstraction to memory,
+    // containing machine word sized units of data.  Push and pop
+    // operations add and remove a single register sized unit of data
+    // to or from the stack.  Peek and poke operations read or write
+    // values on the stack, without moving the current stack position.
+
+    void pop(RegisterID dest)
+    {
+        m_assembler.lw(dest, MIPSRegisters::sp, 0);
+        m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, 4);
+    }
+
+    void push(RegisterID src)
+    {
+        m_assembler.addiu(MIPSRegisters::sp, MIPSRegisters::sp, -4);
+        m_assembler.sw(src, MIPSRegisters::sp, 0);
+    }
+
+    void push(Address address)
+    {
+        load32(address, dataTempRegister);
+        push(dataTempRegister);
+    }
+
+    void push(Imm32 imm)
+    {
+        move(imm, immTempRegister);
+        push(immTempRegister);
+    }
+
+    // Register move operations:
+    //
+    // Move values in registers.
+
+    void move(Imm32 imm, RegisterID dest)
+    {
+        if (!imm.m_isPointer && !imm.m_value && !m_fixedWidth)
+            move(MIPSRegisters::zero, dest);
+        else if (imm.m_isPointer || m_fixedWidth) {
+            m_assembler.lui(dest, imm.m_value >> 16);
+            m_assembler.ori(dest, dest, imm.m_value);
+        } else
+            m_assembler.li(dest, imm.m_value);
+    }
+
+    void move(RegisterID src, RegisterID dest)
+    {
+        if (src != dest || m_fixedWidth)
+            m_assembler.move(dest, src);
+    }
+
+    void move(ImmPtr imm, RegisterID dest)
+    {
+        move(Imm32(imm), dest);
+    }
+
+    void swap(RegisterID reg1, RegisterID reg2)
+    {
+        move(reg1, immTempRegister);
+        move(reg2, reg1);
+        move(immTempRegister, reg2);
+    }
+
+    void signExtend32ToPtr(RegisterID src, RegisterID dest)
+    {
+        if (src != dest || m_fixedWidth)
+            move(src, dest);
+    }
+
+    void zeroExtend32ToPtr(RegisterID src, RegisterID dest)
+    {
+        if (src != dest || m_fixedWidth)
+            move(src, dest);
+    }
+
+    // Forwards / external control flow operations:
+    //
+    // This set of jump and conditional branch operations return a Jump
+    // object which may linked at a later point, allow forwards jump,
+    // or jumps that will require external linkage (after the code has been
+    // relocated).
+    //
+    // For branches, signed <, >, <= and >= are denoted as l, g, le, and ge
+    // respecitvely, for unsigned comparisons the names b, a, be, and ae are
+    // used (representing the names 'below' and 'above').
+    //
+    // Operands to the comparision are provided in the expected order, e.g.
+    // jle32(reg1, Imm32(5)) will branch if the value held in reg1, when
+    // treated as a signed 32bit value, is less than or equal to 5.
+    //
+    // jz and jnz test whether the first operand is equal to zero, and take
+    // an optional second operand of a mask under which to perform the test.
+
+    Jump branch8(Condition cond, Address left, Imm32 right)
+    {
+        // Make sure the immediate value is unsigned 8 bits.
+        ASSERT(!(right.m_value & 0xFFFFFF00));
+        load8(left, dataTempRegister);
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branch32(Condition cond, RegisterID left, RegisterID right)
+    {
+        if (cond == Equal || cond == Zero)
+            return branchEqual(left, right);
+        if (cond == NotEqual || cond == NonZero)
+            return branchNotEqual(left, right);
+        if (cond == Above) {
+            m_assembler.sltu(cmpTempRegister, right, left);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == AboveOrEqual) {
+            m_assembler.sltu(cmpTempRegister, left, right);
+            return branchEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == Below) {
+            m_assembler.sltu(cmpTempRegister, left, right);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == BelowOrEqual) {
+            m_assembler.sltu(cmpTempRegister, right, left);
+            return branchEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == GreaterThan) {
+            m_assembler.slt(cmpTempRegister, right, left);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == GreaterThanOrEqual) {
+            m_assembler.slt(cmpTempRegister, left, right);
+            return branchEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == LessThan) {
+            m_assembler.slt(cmpTempRegister, left, right);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == LessThanOrEqual) {
+            m_assembler.slt(cmpTempRegister, right, left);
+            return branchEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == Overflow) {
+            /*
+                xor     cmpTemp, left, right
+                bgez    No_overflow, cmpTemp    # same sign bit -> no overflow
+                nop
+                subu    cmpTemp, left, right
+                xor     cmpTemp, cmpTemp, left
+                bgez    No_overflow, cmpTemp    # same sign bit -> no overflow
+                nop
+                b       Overflow
+                nop
+                nop
+                nop
+                nop
+                nop
+              No_overflow:
+            */
+            m_assembler.xorInsn(cmpTempRegister, left, right);
+            m_assembler.bgez(cmpTempRegister, 11);
+            m_assembler.nop();
+            m_assembler.subu(cmpTempRegister, left, right);
+            m_assembler.xorInsn(cmpTempRegister, cmpTempRegister, left);
+            m_assembler.bgez(cmpTempRegister, 7);
+            m_assembler.nop();
+            return jump();
+        }
+        if (cond == Signed) {
+            m_assembler.subu(cmpTempRegister, left, right);
+            // Check if the result is negative.
+            m_assembler.slt(cmpTempRegister, cmpTempRegister,
+                            MIPSRegisters::zero);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        ASSERT(0);
+
+        return Jump();
+    }
+
+    Jump branch32(Condition cond, RegisterID left, Imm32 right)
+    {
+        move(right, immTempRegister);
+        return branch32(cond, left, immTempRegister);
+    }
+
+    Jump branch32(Condition cond, RegisterID left, Address right)
+    {
+        load32(right, dataTempRegister);
+        return branch32(cond, left, dataTempRegister);
+    }
+
+    Jump branch32(Condition cond, Address left, RegisterID right)
+    {
+        load32(left, dataTempRegister);
+        return branch32(cond, dataTempRegister, right);
+    }
+
+    Jump branch32(Condition cond, Address left, Imm32 right)
+    {
+        load32(left, dataTempRegister);
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branch32(Condition cond, BaseIndex left, Imm32 right)
+    {
+        load32(left, dataTempRegister);
+        // Be careful that the previous load32() uses immTempRegister.
+        // So, we need to put move() after load32().
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+    {
+        load32WithUnalignedHalfWords(left, dataTempRegister);
+        // Be careful that the previous load32WithUnalignedHalfWords()
+        // uses immTempRegister.
+        // So, we need to put move() after load32WithUnalignedHalfWords().
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
+    {
+        load32(left.m_ptr, dataTempRegister);
+        return branch32(cond, dataTempRegister, right);
+    }
+
+    Jump branch32(Condition cond, AbsoluteAddress left, Imm32 right)
+    {
+        load32(left.m_ptr, dataTempRegister);
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branch16(Condition cond, BaseIndex left, RegisterID right)
+    {
+        load16(left, dataTempRegister);
+        return branch32(cond, dataTempRegister, right);
+    }
+
+    Jump branch16(Condition cond, BaseIndex left, Imm32 right)
+    {
+        ASSERT(!(right.m_value & 0xFFFF0000));
+        load16(left, dataTempRegister);
+        // Be careful that the previous load16() uses immTempRegister.
+        // So, we need to put move() after load16().
+        move(right, immTempRegister);
+        return branch32(cond, dataTempRegister, immTempRegister);
+    }
+
+    Jump branchTest32(Condition cond, RegisterID reg, RegisterID mask)
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        m_assembler.andInsn(cmpTempRegister, reg, mask);
+        if (cond == Zero)
+            return branchEqual(cmpTempRegister, MIPSRegisters::zero);
+        return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+    }
+
+    Jump branchTest32(Condition cond, RegisterID reg, Imm32 mask = Imm32(-1))
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        if (mask.m_value == -1 && !m_fixedWidth) {
+            if (cond == Zero)
+                return branchEqual(reg, MIPSRegisters::zero);
+            return branchNotEqual(reg, MIPSRegisters::zero);
+        }
+        move(mask, immTempRegister);
+        return branchTest32(cond, reg, immTempRegister);
+    }
+
+    Jump branchTest32(Condition cond, Address address, Imm32 mask = Imm32(-1))
+    {
+        load32(address, dataTempRegister);
+        return branchTest32(cond, dataTempRegister, mask);
+    }
+
+    Jump branchTest32(Condition cond, BaseIndex address, Imm32 mask = Imm32(-1))
+    {
+        load32(address, dataTempRegister);
+        return branchTest32(cond, dataTempRegister, mask);
+    }
+
+    Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
+    {
+        load8(address, dataTempRegister);
+        return branchTest32(cond, dataTempRegister, mask);
+    }
+
+    Jump jump()
+    {
+        return branchEqual(MIPSRegisters::zero, MIPSRegisters::zero);
+    }
+
+    void jump(RegisterID target)
+    {
+        m_assembler.jr(target);
+        m_assembler.nop();
+    }
+
+    void jump(Address address)
+    {
+        m_fixedWidth = true;
+        load32(address, MIPSRegisters::t9);
+        m_assembler.jr(MIPSRegisters::t9);
+        m_assembler.nop();
+        m_fixedWidth = false;
+    }
+
+    // Arithmetic control flow operations:
+    //
+    // This set of conditional branch operations branch based
+    // on the result of an arithmetic operation.  The operation
+    // is performed as normal, storing the result.
+    //
+    // * jz operations branch if the result is zero.
+    // * jo operations branch if the (signed) arithmetic
+    //   operation caused an overflow to occur.
+
+    Jump branchAdd32(Condition cond, RegisterID src, RegisterID dest)
+    {
+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
+        if (cond == Overflow) {
+            /*
+                move    dest, dataTemp
+                xor     cmpTemp, dataTemp, src
+                bltz    cmpTemp, No_overflow    # diff sign bit -> no overflow
+                addu    dest, dataTemp, src
+                xor     cmpTemp, dest, dataTemp
+                bgez    cmpTemp, No_overflow    # same sign big -> no overflow
+                nop
+                b       Overflow
+                nop
+                nop
+                nop
+                nop
+                nop
+            No_overflow:
+            */
+            move(dest, dataTempRegister);
+            m_assembler.xorInsn(cmpTempRegister, dataTempRegister, src);
+            m_assembler.bltz(cmpTempRegister, 10);
+            m_assembler.addu(dest, dataTempRegister, src);
+            m_assembler.xorInsn(cmpTempRegister, dest, dataTempRegister);
+            m_assembler.bgez(cmpTempRegister, 7);
+            m_assembler.nop();
+            return jump();
+        }
+        if (cond == Signed) {
+            add32(src, dest);
+            // Check if dest is negative.
+            m_assembler.slt(cmpTempRegister, dest, MIPSRegisters::zero);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == Zero) {
+            add32(src, dest);
+            return branchEqual(dest, MIPSRegisters::zero);
+        }
+        if (cond == NonZero) {
+            add32(src, dest);
+            return branchNotEqual(dest, MIPSRegisters::zero);
+        }
+        ASSERT(0);
+        return Jump();
+    }
+
+    Jump branchAdd32(Condition cond, Imm32 imm, RegisterID dest)
+    {
+        move(imm, immTempRegister);
+        return branchAdd32(cond, immTempRegister, dest);
+    }
+
+    Jump branchMul32(Condition cond, RegisterID src, RegisterID dest)
+    {
+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
+        if (cond == Overflow) {
+            /*
+                mult    src, dest
+                mfhi    dataTemp
+                mflo    dest
+                sra     addrTemp, dest, 31
+                beq     dataTemp, addrTemp, No_overflow # all sign bits (bit 63 to bit 31) are the same -> no overflow
+                nop
+                b       Overflow
+                nop
+                nop
+                nop
+                nop
+                nop
+            No_overflow:
+            */
+            m_assembler.mult(src, dest);
+            m_assembler.mfhi(dataTempRegister);
+            m_assembler.mflo(dest);
+            m_assembler.sra(addrTempRegister, dest, 31);
+            m_assembler.beq(dataTempRegister, addrTempRegister, 7);
+            m_assembler.nop();
+            return jump();
+        }
+        if (cond == Signed) {
+            mul32(src, dest);
+            // Check if dest is negative.
+            m_assembler.slt(cmpTempRegister, dest, MIPSRegisters::zero);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == Zero) {
+            mul32(src, dest);
+            return branchEqual(dest, MIPSRegisters::zero);
+        }
+        if (cond == NonZero) {
+            mul32(src, dest);
+            return branchNotEqual(dest, MIPSRegisters::zero);
+        }
+        ASSERT(0);
+        return Jump();
+    }
+
+    Jump branchMul32(Condition cond, Imm32 imm, RegisterID src, RegisterID dest)
+    {
+        move(imm, immTempRegister);
+        move(src, dest);
+        return branchMul32(cond, immTempRegister, dest);
+    }
+
+    Jump branchSub32(Condition cond, RegisterID src, RegisterID dest)
+    {
+        ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
+        if (cond == Overflow) {
+            /*
+                move    dest, dataTemp
+                xor     cmpTemp, dataTemp, src
+                bgez    cmpTemp, No_overflow    # same sign bit -> no overflow
+                subu    dest, dataTemp, src
+                xor     cmpTemp, dest, dataTemp
+                bgez    cmpTemp, No_overflow    # same sign bit -> no overflow
+                nop
+                b       Overflow
+                nop
+                nop
+                nop
+                nop
+                nop
+            No_overflow:
+            */
+            move(dest, dataTempRegister);
+            m_assembler.xorInsn(cmpTempRegister, dataTempRegister, src);
+            m_assembler.bgez(cmpTempRegister, 10);
+            m_assembler.subu(dest, dataTempRegister, src);
+            m_assembler.xorInsn(cmpTempRegister, dest, dataTempRegister);
+            m_assembler.bgez(cmpTempRegister, 7);
+            m_assembler.nop();
+            return jump();
+        }
+        if (cond == Signed) {
+            sub32(src, dest);
+            // Check if dest is negative.
+            m_assembler.slt(cmpTempRegister, dest, MIPSRegisters::zero);
+            return branchNotEqual(cmpTempRegister, MIPSRegisters::zero);
+        }
+        if (cond == Zero) {
+            sub32(src, dest);
+            return branchEqual(dest, MIPSRegisters::zero);
+        }
+        if (cond == NonZero) {
+            sub32(src, dest);
+            return branchNotEqual(dest, MIPSRegisters::zero);
+        }
+        ASSERT(0);
+        return Jump();
+    }
+
+    Jump branchSub32(Condition cond, Imm32 imm, RegisterID dest)
+    {
+        move(imm, immTempRegister);
+        return branchSub32(cond, immTempRegister, dest);
+    }
+
+    // Miscellaneous operations:
+
+    void breakpoint()
+    {
+        m_assembler.bkpt();
+    }
+
+    Call nearCall()
+    {
+        /* We need two words for relaxation.  */
+        m_assembler.nop();
+        m_assembler.nop();
+        m_assembler.jal();
+        m_assembler.nop();
+        return Call(m_assembler.newJmpSrc(), Call::LinkableNear);
+    }
+
+    Call call()
+    {
+        m_assembler.lui(MIPSRegisters::t9, 0);
+        m_assembler.ori(MIPSRegisters::t9, MIPSRegisters::t9, 0);
+        m_assembler.jalr(MIPSRegisters::t9);
+        m_assembler.nop();
+        return Call(m_assembler.newJmpSrc(), Call::Linkable);
+    }
+
+    Call call(RegisterID target)
+    {
+        m_assembler.jalr(target);
+        m_assembler.nop();
+        return Call(m_assembler.newJmpSrc(), Call::None);
+    }
+
+    Call call(Address address)
+    {
+        m_fixedWidth = true;
+        load32(address, MIPSRegisters::t9);
+        m_assembler.jalr(MIPSRegisters::t9);
+        m_assembler.nop();
+        m_fixedWidth = false;
+        return Call(m_assembler.newJmpSrc(), Call::None);
+    }
+
+    void ret()
+    {
+        m_assembler.jr(MIPSRegisters::ra);
+        m_assembler.nop();
+    }
+
+    void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+    {
+        if (cond == Equal || cond == Zero) {
+            m_assembler.xorInsn(dest, left, right);
+            m_assembler.sltiu(dest, dest, 1);
+        } else if (cond == NotEqual || cond == NonZero) {
+            m_assembler.xorInsn(dest, left, right);
+            m_assembler.sltu(dest, MIPSRegisters::zero, dest);
+        } else if (cond == Above)
+            m_assembler.sltu(dest, right, left);
+        else if (cond == AboveOrEqual) {
+            m_assembler.sltu(dest, left, right);
+            m_assembler.xori(dest, dest, 1);
+        } else if (cond == Below)
+            m_assembler.sltu(dest, left, right);
+        else if (cond == BelowOrEqual) {
+            m_assembler.sltu(dest, right, left);
+            m_assembler.xori(dest, dest, 1);
+        } else if (cond == GreaterThan)
+            m_assembler.slt(dest, right, left);
+        else if (cond == GreaterThanOrEqual) {
+            m_assembler.slt(dest, left, right);
+            m_assembler.xori(dest, dest, 1);
+        } else if (cond == LessThan)
+            m_assembler.slt(dest, left, right);
+        else if (cond == LessThanOrEqual) {
+            m_assembler.slt(dest, right, left);
+            m_assembler.xori(dest, dest, 1);
+        } else if (cond == Overflow) {
+            /*
+                xor     cmpTemp, left, right
+                bgez    Done, cmpTemp   # same sign bit -> no overflow
+                move    dest, 0
+                subu    cmpTemp, left, right
+                xor     cmpTemp, cmpTemp, left # diff sign bit -> overflow
+                slt     dest, cmpTemp, 0
+              Done:
+            */
+            m_assembler.xorInsn(cmpTempRegister, left, right);
+            m_assembler.bgez(cmpTempRegister, 4);
+            m_assembler.move(dest, MIPSRegisters::zero);
+            m_assembler.subu(cmpTempRegister, left, right);
+            m_assembler.xorInsn(cmpTempRegister, cmpTempRegister, left);
+            m_assembler.slt(dest, cmpTempRegister, MIPSRegisters::zero);
+        } else if (cond == Signed) {
+            m_assembler.subu(dest, left, right);
+            // Check if the result is negative.
+            m_assembler.slt(dest, dest, MIPSRegisters::zero);
+        }
+    }
+
+    void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+    {
+        move(right, immTempRegister);
+        set32(cond, left, immTempRegister, dest);
+    }
+
+    void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        load8(address, dataTempRegister);
+        if (mask.m_value == -1 && !m_fixedWidth) {
+            if (cond == Zero)
+                m_assembler.sltiu(dest, dataTempRegister, 1);
+            else
+                m_assembler.sltu(dest, MIPSRegisters::zero, dataTempRegister);
+        } else {
+            move(mask, immTempRegister);
+            m_assembler.andInsn(cmpTempRegister, dataTempRegister,
+                                immTempRegister);
+            if (cond == Zero)
+                m_assembler.sltiu(dest, cmpTempRegister, 1);
+            else
+                m_assembler.sltu(dest, MIPSRegisters::zero, cmpTempRegister);
+        }
+    }
+
+    void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        load32(address, dataTempRegister);
+        if (mask.m_value == -1 && !m_fixedWidth) {
+            if (cond == Zero)
+                m_assembler.sltiu(dest, dataTempRegister, 1);
+            else
+                m_assembler.sltu(dest, MIPSRegisters::zero, dataTempRegister);
+        } else {
+            move(mask, immTempRegister);
+            m_assembler.andInsn(cmpTempRegister, dataTempRegister,
+                                immTempRegister);
+            if (cond == Zero)
+                m_assembler.sltiu(dest, cmpTempRegister, 1);
+            else
+                m_assembler.sltu(dest, MIPSRegisters::zero, cmpTempRegister);
+        }
+    }
+
+    DataLabel32 moveWithPatch(Imm32 imm, RegisterID dest)
+    {
+        m_fixedWidth = true;
+        DataLabel32 label(this);
+        move(imm, dest);
+        m_fixedWidth = false;
+        return label;
+    }
+
+    DataLabelPtr moveWithPatch(ImmPtr initialValue, RegisterID dest)
+    {
+        m_fixedWidth = true;
+        DataLabelPtr label(this);
+        move(initialValue, dest);
+        m_fixedWidth = false;
+        return label;
+    }
+
+    Jump branchPtrWithPatch(Condition cond, RegisterID left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
+    {
+        m_fixedWidth = true;
+        dataLabel = moveWithPatch(initialRightValue, immTempRegister);
+        Jump temp = branch32(cond, left, immTempRegister);
+        m_fixedWidth = false;
+        return temp;
+    }
+
+    Jump branchPtrWithPatch(Condition cond, Address left, DataLabelPtr& dataLabel, ImmPtr initialRightValue = ImmPtr(0))
+    {
+        m_fixedWidth = true;
+        load32(left, dataTempRegister);
+        dataLabel = moveWithPatch(initialRightValue, immTempRegister);
+        Jump temp = branch32(cond, dataTempRegister, immTempRegister);
+        m_fixedWidth = false;
+        return temp;
+    }
+
+    DataLabelPtr storePtrWithPatch(ImmPtr initialValue, ImplicitAddress address)
+    {
+        m_fixedWidth = true;
+        DataLabelPtr dataLabel = moveWithPatch(initialValue, dataTempRegister);
+        store32(dataTempRegister, address);
+        m_fixedWidth = false;
+        return dataLabel;
+    }
+
+    DataLabelPtr storePtrWithPatch(ImplicitAddress address)
+    {
+        return storePtrWithPatch(ImmPtr(0), address);
+    }
+
+    Call tailRecursiveCall()
+    {
+        // Like a normal call, but don't update the returned address register
+        m_fixedWidth = true;
+        move(Imm32(0), MIPSRegisters::t9);
+        m_assembler.jr(MIPSRegisters::t9);
+        m_assembler.nop();
+        m_fixedWidth = false;
+        return Call(m_assembler.newJmpSrc(), Call::Linkable);
+    }
+
+    Call makeTailRecursiveCall(Jump oldJump)
+    {
+        oldJump.link(this);
+        return tailRecursiveCall();
+    }
+
+    void loadDouble(ImplicitAddress address, FPRegisterID dest)
+    {
+#if WTF_MIPS_ISA(1)
+        /*
+            li          addrTemp, address.offset
+            addu        addrTemp, addrTemp, base
+            lwc1        dest, 0(addrTemp)
+            lwc1        dest+1, 4(addrTemp)
+         */
+        move(Imm32(address.offset), addrTempRegister);
+        m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+        m_assembler.lwc1(dest, addrTempRegister, 0);
+        m_assembler.lwc1(FPRegisterID(dest + 1), addrTempRegister, 4);
+#else
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth) {
+            m_assembler.ldc1(dest, address.base, address.offset);
+        } else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                ldc1    dest, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.ldc1(dest, addrTempRegister, address.offset);
+        }
+#endif
+    }
+
+    void storeDouble(FPRegisterID src, ImplicitAddress address)
+    {
+#if WTF_MIPS_ISA(1)
+        /*
+            li          addrTemp, address.offset
+            addu        addrTemp, addrTemp, base
+            swc1        dest, 0(addrTemp)
+            swc1        dest+1, 4(addrTemp)
+         */
+        move(Imm32(address.offset), addrTempRegister);
+        m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+        m_assembler.swc1(src, addrTempRegister, 0);
+        m_assembler.swc1(FPRegisterID(src + 1), addrTempRegister, 4);
+#else
+        if (address.offset >= -32768 && address.offset <= 32767
+            && !m_fixedWidth)
+            m_assembler.sdc1(src, address.base, address.offset);
+        else {
+            /*
+                lui     addrTemp, (offset + 0x8000) >> 16
+                addu    addrTemp, addrTemp, base
+                sdc1    src, (offset & 0xffff)(addrTemp)
+              */
+            m_assembler.lui(addrTempRegister, (address.offset + 0x8000) >> 16);
+            m_assembler.addu(addrTempRegister, addrTempRegister, address.base);
+            m_assembler.sdc1(src, addrTempRegister, address.offset);
+        }
+#endif
+    }
+
+    void addDouble(FPRegisterID src, FPRegisterID dest)
+    {
+        m_assembler.addd(dest, dest, src);
+    }
+
+    void addDouble(Address src, FPRegisterID dest)
+    {
+        loadDouble(src, fpTempRegister);
+        m_assembler.addd(dest, dest, fpTempRegister);
+    }
+
+    void subDouble(FPRegisterID src, FPRegisterID dest)
+    {
+        m_assembler.subd(dest, dest, src);
+    }
+
+    void subDouble(Address src, FPRegisterID dest)
+    {
+        loadDouble(src, fpTempRegister);
+        m_assembler.subd(dest, dest, fpTempRegister);
+    }
+
+    void mulDouble(FPRegisterID src, FPRegisterID dest)
+    {
+        m_assembler.muld(dest, dest, src);
+    }
+
+    void mulDouble(Address src, FPRegisterID dest)
+    {
+        loadDouble(src, fpTempRegister);
+        m_assembler.muld(dest, dest, fpTempRegister);
+    }
+
+    void convertInt32ToDouble(RegisterID src, FPRegisterID dest)
+    {
+        m_assembler.mtc1(src, fpTempRegister);
+        m_assembler.cvtdw(dest, fpTempRegister);
+    }
+
+    void insertRelaxationWords()
+    {
+        /* We need four words for relaxation. */
+        m_assembler.beq(MIPSRegisters::zero, MIPSRegisters::zero, 3); // Jump over nops;
+        m_assembler.nop();
+        m_assembler.nop();
+        m_assembler.nop();
+    }
+
+    Jump branchTrue()
+    {
+        m_assembler.appendJump();
+        m_assembler.bc1t();
+        m_assembler.nop();
+        insertRelaxationWords();
+        return Jump(m_assembler.newJmpSrc());
+    }
+
+    Jump branchFalse()
+    {
+        m_assembler.appendJump();
+        m_assembler.bc1f();
+        m_assembler.nop();
+        insertRelaxationWords();
+        return Jump(m_assembler.newJmpSrc());
+    }
+
+    Jump branchEqual(RegisterID rs, RegisterID rt)
+    {
+        m_assembler.appendJump();
+        m_assembler.beq(rs, rt, 0);
+        m_assembler.nop();
+        insertRelaxationWords();
+        return Jump(m_assembler.newJmpSrc());
+    }
+
+    Jump branchNotEqual(RegisterID rs, RegisterID rt)
+    {
+        m_assembler.appendJump();
+        m_assembler.bne(rs, rt, 0);
+        m_assembler.nop();
+        insertRelaxationWords();
+        return Jump(m_assembler.newJmpSrc());
+    }
+
+    Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right)
+    {
+        if (cond == DoubleEqual) {
+            m_assembler.ceqd(left, right);
+            return branchTrue();
+        }
+        if (cond == DoubleNotEqual) {
+            m_assembler.ceqd(left, right);
+            return branchFalse(); // false
+        }
+        if (cond == DoubleGreaterThan) {
+            m_assembler.cngtd(left, right);
+            return branchFalse(); // false
+        }
+        if (cond == DoubleGreaterThanOrEqual) {
+            m_assembler.cnged(right, left);
+            return branchFalse(); // false
+        }
+        if (cond == DoubleLessThan) {
+            m_assembler.cltd(left, right);
+            return branchTrue();
+        }
+        if (cond == DoubleLessThanOrEqual) {
+            m_assembler.cled(left, right);
+            return branchTrue();
+        }
+        if (cond == DoubleEqualOrUnordered) {
+            m_assembler.cueqd(left, right);
+            return branchTrue();
+        }
+        if (cond == DoubleGreaterThanOrUnordered) {
+            m_assembler.coled(left, right);
+            return branchFalse(); // false
+        }
+        if (cond == DoubleGreaterThanOrEqualOrUnordered) {
+            m_assembler.coltd(left, right);
+            return branchFalse(); // false
+        }
+        if (cond == DoubleLessThanOrUnordered) {
+            m_assembler.cultd(left, right);
+            return branchTrue();
+        }
+        if (cond == DoubleLessThanOrEqualOrUnordered) {
+            m_assembler.culed(left, right);
+            return branchTrue();
+        }
+        ASSERT(0);
+
+        return Jump();
+    }
+
+    // Truncates 'src' to an integer, and places the resulting 'dest'.
+    // If the result is not representable as a 32 bit value, branch.
+    // May also branch for some values that are representable in 32 bits
+    // (specifically, in this case, INT_MAX 0x7fffffff).
+    Jump branchTruncateDoubleToInt32(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.truncwd(fpTempRegister, src);
+        m_assembler.mfc1(dest, fpTempRegister);
+        return branch32(Equal, dest, Imm32(0x7fffffff));
+    }
+
+private:
+    // If m_fixedWidth is true, we will generate a fixed number of instructions.
+    // Otherwise, we can emit any number of instructions.
+    bool m_fixedWidth;
+
+    friend class LinkBuffer;
+    friend class RepatchBuffer;
+
+    static void linkCall(void* code, Call call, FunctionPtr function)
+    {
+        MIPSAssembler::linkCall(code, call.m_jmp, function.value());
+    }
+
+    static void repatchCall(CodeLocationCall call, CodeLocationLabel destination)
+    {
+        MIPSAssembler::relinkCall(call.dataLocation(), destination.executableAddress());
+    }
+
+    static void repatchCall(CodeLocationCall call, FunctionPtr destination)
+    {
+        MIPSAssembler::relinkCall(call.dataLocation(), destination.executableAddress());
+    }
+
+};
+
+}
+
+#endif // ENABLE(ASSEMBLER) && CPU(MIPS)
+
+#endif // MacroAssemblerMIPS_h
diff --git a/JavaScriptCore/assembler/MacroAssemblerX86.h b/JavaScriptCore/assembler/MacroAssemblerX86.h
index ca7c31a..0366541 100644
--- a/JavaScriptCore/assembler/MacroAssemblerX86.h
+++ b/JavaScriptCore/assembler/MacroAssemblerX86.h
@@ -26,8 +26,6 @@
 #ifndef MacroAssemblerX86_h
 #define MacroAssemblerX86_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && CPU(X86)
 
 #include "MacroAssemblerX86Common.h"
diff --git a/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/JavaScriptCore/assembler/MacroAssemblerX86Common.h
index 449df86..27c2f15 100644
--- a/JavaScriptCore/assembler/MacroAssemblerX86Common.h
+++ b/JavaScriptCore/assembler/MacroAssemblerX86Common.h
@@ -26,8 +26,6 @@
 #ifndef MacroAssemblerX86Common_h
 #define MacroAssemblerX86Common_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include "X86Assembler.h"
@@ -620,6 +618,12 @@
     // an optional second operand of a mask under which to perform the test.
 
 public:
+    Jump branch8(Condition cond, Address left, Imm32 right)
+    {
+        m_assembler.cmpb_im(right.m_value, left.offset, left.base);
+        return Jump(m_assembler.jCC(x86Condition(cond)));
+    }
+
     Jump branch32(Condition cond, RegisterID left, RegisterID right)
     {
         m_assembler.cmpl_rr(right, left);
@@ -717,6 +721,26 @@
             m_assembler.testl_i32m(mask.m_value, address.offset, address.base, address.index, address.scale);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
+    
+    Jump branchTest8(Condition cond, Address address, Imm32 mask = Imm32(-1))
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        if (mask.m_value == -1)
+            m_assembler.cmpb_im(0, address.offset, address.base);
+        else
+            m_assembler.testb_im(mask.m_value, address.offset, address.base);
+        return Jump(m_assembler.jCC(x86Condition(cond)));
+    }
+    
+    Jump branchTest8(Condition cond, BaseIndex address, Imm32 mask = Imm32(-1))
+    {
+        ASSERT((cond == Zero) || (cond == NonZero));
+        if (mask.m_value == -1)
+            m_assembler.cmpb_im(0, address.offset, address.base, address.index, address.scale);
+        else
+            m_assembler.testb_im(mask.m_value, address.offset, address.base, address.index, address.scale);
+        return Jump(m_assembler.jCC(x86Condition(cond)));
+    }
 
     Jump jump()
     {
@@ -836,6 +860,13 @@
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
 
+    Jump branchNeg32(Condition cond, RegisterID srcDest)
+    {
+        ASSERT((cond == Overflow) || (cond == Zero) || (cond == NonZero));
+        neg32(srcDest);
+        return Jump(m_assembler.jCC(x86Condition(cond)));
+    }
+
     Jump branchOr32(Condition cond, RegisterID src, RegisterID dest)
     {
         ASSERT((cond == Signed) || (cond == Zero) || (cond == NonZero));
@@ -917,10 +948,11 @@
     void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
     {
         if (mask.m_value == -1)
-            m_assembler.cmpl_im(0, address.offset, address.base);
+            m_assembler.cmpb_im(0, address.offset, address.base);
         else
-            m_assembler.testl_i32m(mask.m_value, address.offset, address.base);
+            m_assembler.testb_im(mask.m_value, address.offset, address.base);
         m_assembler.setCC_r(x86Condition(cond), dest);
+        m_assembler.movzbl_rr(dest, dest);
     }
 
     void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
diff --git a/JavaScriptCore/assembler/MacroAssemblerX86_64.h b/JavaScriptCore/assembler/MacroAssemblerX86_64.h
index ec93f8c..339eaa4 100644
--- a/JavaScriptCore/assembler/MacroAssemblerX86_64.h
+++ b/JavaScriptCore/assembler/MacroAssemblerX86_64.h
@@ -26,8 +26,6 @@
 #ifndef MacroAssemblerX86_64_h
 #define MacroAssemblerX86_64_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && CPU(X86_64)
 
 #include "MacroAssemblerX86Common.h"
@@ -411,6 +409,14 @@
         return label;
     }
 
+    using MacroAssemblerX86Common::branchTest8;
+    Jump branchTest8(Condition cond, ExtendedAddress address, Imm32 mask = Imm32(-1))
+    {
+        ImmPtr addr(reinterpret_cast<void*>(address.offset));
+        MacroAssemblerX86Common::move(addr, scratchRegister);
+        return MacroAssemblerX86Common::branchTest8(cond, BaseIndex(scratchRegister, address.base, TimesOne), mask);
+    }
+
     Label loadPtrWithPatchToLEA(Address address, RegisterID dest)
     {
         Label label(this);
diff --git a/JavaScriptCore/assembler/RepatchBuffer.h b/JavaScriptCore/assembler/RepatchBuffer.h
index 89cbf06..72cf6b2 100644
--- a/JavaScriptCore/assembler/RepatchBuffer.h
+++ b/JavaScriptCore/assembler/RepatchBuffer.h
@@ -26,8 +26,6 @@
 #ifndef RepatchBuffer_h
 #define RepatchBuffer_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER)
 
 #include <MacroAssembler.h>
diff --git a/JavaScriptCore/assembler/X86Assembler.h b/JavaScriptCore/assembler/X86Assembler.h
index ab3d05f..14a02f7 100644
--- a/JavaScriptCore/assembler/X86Assembler.h
+++ b/JavaScriptCore/assembler/X86Assembler.h
@@ -26,8 +26,6 @@
 #ifndef X86Assembler_h
 #define X86Assembler_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(ASSEMBLER) && (CPU(X86) || CPU(X86_64))
 
 #include "AssemblerBuffer.h"
@@ -130,6 +128,7 @@
         PRE_SSE_66                      = 0x66,
         OP_PUSH_Iz                      = 0x68,
         OP_IMUL_GvEvIz                  = 0x69,
+        OP_GROUP1_EbIb                  = 0x80,
         OP_GROUP1_EvIz                  = 0x81,
         OP_GROUP1_EvIb                  = 0x83,
         OP_TEST_EvGv                    = 0x85,
@@ -760,7 +759,7 @@
         m_formatter.oneByteOp(OP_GROUP1_EvIz, GROUP1_OP_CMP, dst);
         m_formatter.immediate32(imm);
     }
-
+    
     void cmpl_im(int imm, int offset, RegisterID base)
     {
         if (CAN_SIGN_EXTEND_8_32(imm)) {
@@ -771,6 +770,18 @@
             m_formatter.immediate32(imm);
         }
     }
+    
+    void cmpb_im(int imm, int offset, RegisterID base)
+    {
+        m_formatter.oneByteOp(OP_GROUP1_EbIb, GROUP1_OP_CMP, base, offset);
+        m_formatter.immediate8(imm);
+    }
+    
+    void cmpb_im(int imm, int offset, RegisterID base, RegisterID index, int scale)
+    {
+        m_formatter.oneByteOp(OP_GROUP1_EbIb, GROUP1_OP_CMP, base, index, scale, offset);
+        m_formatter.immediate8(imm);
+    }
 
     void cmpl_im(int imm, int offset, RegisterID base, RegisterID index, int scale)
     {
@@ -890,6 +901,18 @@
         m_formatter.oneByteOp(OP_GROUP3_EvIz, GROUP3_OP_TEST, base, offset);
         m_formatter.immediate32(imm);
     }
+    
+    void testb_im(int imm, int offset, RegisterID base)
+    {
+        m_formatter.oneByteOp(OP_GROUP3_EbIb, GROUP3_OP_TEST, base, offset);
+        m_formatter.immediate8(imm);
+    }
+    
+    void testb_im(int imm, int offset, RegisterID base, RegisterID index, int scale)
+    {
+        m_formatter.oneByteOp(OP_GROUP3_EbIb, GROUP3_OP_TEST, base, index, scale, offset);
+        m_formatter.immediate8(imm);
+    }
 
     void testl_i32m(int imm, int offset, RegisterID base, RegisterID index, int scale)
     {
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp
index 68debb2..8e77e12 100644
--- a/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -89,25 +89,6 @@
     return makeString("r", UString::from(r)).UTF8String();
 }
 
-static UString regexpToSourceString(RegExp* regExp)
-{
-    char postfix[5] = { '/', 0, 0, 0, 0 };
-    int index = 1;
-    if (regExp->global())
-        postfix[index++] = 'g';
-    if (regExp->ignoreCase())
-        postfix[index++] = 'i';
-    if (regExp->multiline())
-        postfix[index] = 'm';
-
-    return makeString("/", regExp->pattern(), postfix);
-}
-
-static CString regexpName(int re, RegExp* regexp)
-{
-    return makeString(regexpToSourceString(regexp), "(@re", UString::from(re), ")").UTF8String();
-}
-
 static UString pointerToSourceString(void* p)
 {
     char buffer[2 + 2 * sizeof(void*) + 1]; // 0x [two characters per byte] \0
@@ -141,7 +122,7 @@
     int r0 = (++it)->u.operand;
     int r1 = (++it)->u.operand;
 
-    printf("[%4d] %s\t\t %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str());
+    printf("[%4d] %s\t\t %s, %s\n", location, op, registerName(exec, r0).data(), registerName(exec, r1).data());
 }
 
 void CodeBlock::printBinaryOp(ExecState* exec, int location, Vector<Instruction>::const_iterator& it, const char* op) const
@@ -149,14 +130,14 @@
     int r0 = (++it)->u.operand;
     int r1 = (++it)->u.operand;
     int r2 = (++it)->u.operand;
-    printf("[%4d] %s\t\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str());
+    printf("[%4d] %s\t\t %s, %s, %s\n", location, op, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
 }
 
 void CodeBlock::printConditionalJump(ExecState* exec, const Vector<Instruction>::const_iterator&, Vector<Instruction>::const_iterator& it, int location, const char* op) const
 {
     int r0 = (++it)->u.operand;
     int offset = (++it)->u.operand;
-    printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(exec, r0).c_str(), offset, location + offset);
+    printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(exec, r0).data(), offset, location + offset);
 }
 
 void CodeBlock::printGetByIdOp(ExecState* exec, int location, Vector<Instruction>::const_iterator& it, const char* op) const
@@ -164,7 +145,7 @@
     int r0 = (++it)->u.operand;
     int r1 = (++it)->u.operand;
     int id0 = (++it)->u.operand;
-    printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str());
+    printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data());
     it += 4;
 }
 
@@ -173,7 +154,7 @@
     int r0 = (++it)->u.operand;
     int id0 = (++it)->u.operand;
     int r1 = (++it)->u.operand;
-    printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str());
+    printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data());
     it += 4;
 }
 
@@ -223,32 +204,32 @@
 
 static void printGlobalResolveInfo(const GlobalResolveInfo& resolveInfo, unsigned instructionOffset)
 {
-    printf("  [%4d] %s: %s\n", instructionOffset, "resolve_global", pointerToSourceString(resolveInfo.structure).UTF8String().c_str());
+    printf("  [%4d] %s: %s\n", instructionOffset, "resolve_global", pointerToSourceString(resolveInfo.structure).UTF8String().data());
 }
 
 static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned instructionOffset)
 {
     switch (stubInfo.accessType) {
     case access_get_by_id_self:
-        printf("  [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).UTF8String().c_str());
+        printf("  [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).UTF8String().data());
         return;
     case access_get_by_id_proto:
-        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).UTF8String().data());
         return;
     case access_get_by_id_chain:
-        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdChain.chain).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.getByIdChain.chain).UTF8String().data());
         return;
     case access_get_by_id_self_list:
-        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).UTF8String().c_str(), stubInfo.u.getByIdSelfList.listSize);
+        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).UTF8String().data(), stubInfo.u.getByIdSelfList.listSize);
         return;
     case access_get_by_id_proto_list:
-        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).UTF8String().c_str(), stubInfo.u.getByIdProtoList.listSize);
+        printf("  [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).UTF8String().data(), stubInfo.u.getByIdProtoList.listSize);
         return;
     case access_put_by_id_transition:
-        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).UTF8String().data(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).UTF8String().data());
         return;
     case access_put_by_id_replace:
-        printf("  [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).UTF8String().c_str());
+        printf("  [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).UTF8String().data());
         return;
     case access_get_by_id:
         printf("  [%4d] %s\n", instructionOffset, "get_by_id");
@@ -277,7 +258,7 @@
 void CodeBlock::printStructure(const char* name, const Instruction* vPC, int operand) const
 {
     unsigned instructionOffset = vPC - m_instructions.begin();
-    printf("  [%4d] %s: %s\n", instructionOffset, name, pointerToSourceString(vPC[operand].u.structure).UTF8String().c_str());
+    printf("  [%4d] %s: %s\n", instructionOffset, name, pointerToSourceString(vPC[operand].u.structure).UTF8String().data());
 }
 
 void CodeBlock::printStructures(const Instruction* vPC) const
@@ -294,15 +275,15 @@
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto)) {
-        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structure).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structure).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structure).UTF8String().data());
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
-        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(vPC[4].u.structure).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structure).UTF8String().c_str(), pointerToSourceString(vPC[6].u.structureChain).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structure).UTF8String().data(), pointerToSourceString(vPC[6].u.structureChain).UTF8String().data());
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain)) {
-        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structure).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureChain).UTF8String().c_str());
+        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structureChain).UTF8String().data());
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id)) {
@@ -364,15 +345,6 @@
         } while (i < m_constantRegisters.size());
     }
 
-    if (m_rareData && !m_rareData->m_regexps.isEmpty()) {
-        printf("\nm_regexps:\n");
-        size_t i = 0;
-        do {
-            printf("  re%u = %s\n", static_cast<unsigned>(i), regexpToSourceString(m_rareData->m_regexps[i].get()).ascii());
-            ++i;
-        } while (i < m_rareData->m_regexps.size());
-    }
-
 #if ENABLE(JIT)
     if (!m_globalResolveInfos.isEmpty() || !m_structureStubInfos.isEmpty())
         printf("\nStructures:\n");
@@ -482,7 +454,7 @@
         }
         case op_enter_with_activation: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] enter_with_activation %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] enter_with_activation %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_create_arguments: {
@@ -495,31 +467,25 @@
         }
         case op_convert_this: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] convert_this %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] convert_this %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_new_object: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] new_object\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] new_object\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_new_array: {
             int dst = (++it)->u.operand;
             int argv = (++it)->u.operand;
             int argc = (++it)->u.operand;
-            printf("[%4d] new_array\t %s, %s, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, argv).c_str(), argc);
-            break;
-        }
-        case op_new_regexp: {
-            int r0 = (++it)->u.operand;
-            int re0 = (++it)->u.operand;
-            printf("[%4d] new_regexp\t %s, %s\n", location, registerName(exec, r0).c_str(), regexpName(re0, regexp(re0)).c_str());
+            printf("[%4d] new_array\t %s, %s, %d\n", location, registerName(exec, dst).data(), registerName(exec, argv).data(), argc);
             break;
         }
         case op_mov: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] mov\t\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] mov\t\t %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data());
             break;
         }
         case op_not: {
@@ -560,12 +526,12 @@
         }
         case op_pre_inc: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] pre_inc\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] pre_inc\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_pre_dec: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] pre_dec\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] pre_dec\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_post_inc: {
@@ -644,7 +610,7 @@
             int r1 = (++it)->u.operand;
             int r2 = (++it)->u.operand;
             int r3 = (++it)->u.operand;
-            printf("[%4d] instanceof\t\t %s, %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str());
+            printf("[%4d] instanceof\t\t %s, %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data(), registerName(exec, r3).data());
             break;
         }
         case op_typeof: {
@@ -682,21 +648,21 @@
         case op_resolve: {
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
-            printf("[%4d] resolve\t\t %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str());
+            printf("[%4d] resolve\t\t %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
             break;
         }
         case op_resolve_skip: {
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
             int skipLevels = (++it)->u.operand;
-            printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), skipLevels);
+            printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), skipLevels);
             break;
         }
         case op_resolve_global: {
             int r0 = (++it)->u.operand;
             JSValue scope = JSValue((++it)->u.jsCell);
             int id0 = (++it)->u.operand;
-            printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).c_str());
+            printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).data());
             it += 2;
             break;
         }
@@ -704,41 +670,41 @@
             int r0 = (++it)->u.operand;
             int index = (++it)->u.operand;
             int skipLevels = (++it)->u.operand;
-            printf("[%4d] get_scoped_var\t %s, %d, %d\n", location, registerName(exec, r0).c_str(), index, skipLevels);
+            printf("[%4d] get_scoped_var\t %s, %d, %d\n", location, registerName(exec, r0).data(), index, skipLevels);
             break;
         }
         case op_put_scoped_var: {
             int index = (++it)->u.operand;
             int skipLevels = (++it)->u.operand;
             int r0 = (++it)->u.operand;
-            printf("[%4d] put_scoped_var\t %d, %d, %s\n", location, index, skipLevels, registerName(exec, r0).c_str());
+            printf("[%4d] put_scoped_var\t %d, %d, %s\n", location, index, skipLevels, registerName(exec, r0).data());
             break;
         }
         case op_get_global_var: {
             int r0 = (++it)->u.operand;
             JSValue scope = JSValue((++it)->u.jsCell);
             int index = (++it)->u.operand;
-            printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), valueToSourceString(exec, scope).ascii(), index);
+            printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), index);
             break;
         }
         case op_put_global_var: {
             JSValue scope = JSValue((++it)->u.jsCell);
             int index = (++it)->u.operand;
             int r0 = (++it)->u.operand;
-            printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(exec, r0).c_str());
+            printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(exec, r0).data());
             break;
         }
         case op_resolve_base: {
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
-            printf("[%4d] resolve_base\t %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str());
+            printf("[%4d] resolve_base\t %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data());
             break;
         }
         case op_resolve_with_base: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
-            printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str());
+            printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data());
             break;
         }
         case op_get_by_id: {
@@ -785,6 +751,26 @@
             printGetByIdOp(exec, location, it, "get_by_id_getter_chain");
             break;
         }
+        case op_get_by_id_custom_self: {
+            printGetByIdOp(exec, location, it, "get_by_id_custom_self");
+            break;
+        }
+        case op_get_by_id_custom_self_list: {
+            printGetByIdOp(exec, location, it, "get_by_id_custom_self_list");
+            break;
+        }
+        case op_get_by_id_custom_proto: {
+            printGetByIdOp(exec, location, it, "get_by_id_custom_proto");
+            break;
+        }
+        case op_get_by_id_custom_proto_list: {
+            printGetByIdOp(exec, location, it, "get_by_id_custom_proto_list");
+            break;
+        }
+        case op_get_by_id_custom_chain: {
+            printGetByIdOp(exec, location, it, "get_by_id_custom_chain");
+            break;
+        }
         case op_get_by_id_generic: {
             printGetByIdOp(exec, location, it, "get_by_id_generic");
             break;
@@ -817,14 +803,14 @@
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data());
             break;
         }
         case op_put_setter: {
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data());
             break;
         }
         case op_method_check: {
@@ -835,14 +821,14 @@
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
-            printf("[%4d] del_by_id\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str());
+            printf("[%4d] del_by_id\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data());
             break;
         }
         case op_get_by_val: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int r2 = (++it)->u.operand;
-            printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str());
+            printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
             break;
         }
         case op_get_by_pname: {
@@ -852,28 +838,28 @@
             int r3 = (++it)->u.operand;
             int r4 = (++it)->u.operand;
             int r5 = (++it)->u.operand;
-            printf("[%4d] get_by_pname\t %s, %s, %s, %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str(), registerName(exec, r4).c_str(), registerName(exec, r5).c_str());
+            printf("[%4d] get_by_pname\t %s, %s, %s, %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data(), registerName(exec, r3).data(), registerName(exec, r4).data(), registerName(exec, r5).data());
             break;
         }
         case op_put_by_val: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int r2 = (++it)->u.operand;
-            printf("[%4d] put_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str());
+            printf("[%4d] put_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
             break;
         }
         case op_del_by_val: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int r2 = (++it)->u.operand;
-            printf("[%4d] del_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str());
+            printf("[%4d] del_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
             break;
         }
         case op_put_by_index: {
             int r0 = (++it)->u.operand;
             unsigned n0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] put_by_index\t %s, %u, %s\n", location, registerName(exec, r0).c_str(), n0, registerName(exec, r1).c_str());
+            printf("[%4d] put_by_index\t %s, %u, %s\n", location, registerName(exec, r0).data(), n0, registerName(exec, r1).data());
             break;
         }
         case op_jmp: {
@@ -914,75 +900,75 @@
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_jnless: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_jnlesseq: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_loop_if_less: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_jless: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] jless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] jless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_loop_if_lesseq: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset);
+            printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset);
             break;
         }
         case op_switch_imm: {
             int tableIndex = (++it)->u.operand;
             int defaultTarget = (++it)->u.operand;
             int scrutineeRegister = (++it)->u.operand;
-            printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str());
+            printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).data());
             break;
         }
         case op_switch_char: {
             int tableIndex = (++it)->u.operand;
             int defaultTarget = (++it)->u.operand;
             int scrutineeRegister = (++it)->u.operand;
-            printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str());
+            printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).data());
             break;
         }
         case op_switch_string: {
             int tableIndex = (++it)->u.operand;
             int defaultTarget = (++it)->u.operand;
             int scrutineeRegister = (++it)->u.operand;
-            printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str());
+            printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).data());
             break;
         }
         case op_new_func: {
             int r0 = (++it)->u.operand;
             int f0 = (++it)->u.operand;
-            printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(exec, r0).c_str(), f0);
+            printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(exec, r0).data(), f0);
             break;
         }
         case op_new_func_exp: {
             int r0 = (++it)->u.operand;
             int f0 = (++it)->u.operand;
-            printf("[%4d] new_func_exp\t %s, f%d\n", location, registerName(exec, r0).c_str(), f0);
+            printf("[%4d] new_func_exp\t %s, f%d\n", location, registerName(exec, r0).data(), f0);
             break;
         }
         case op_call: {
@@ -990,7 +976,7 @@
             int func = (++it)->u.operand;
             int argCount = (++it)->u.operand;
             int registerOffset = (++it)->u.operand;
-            printf("[%4d] call\t\t %s, %s, %d, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset);
+            printf("[%4d] call\t\t %s, %s, %d, %d\n", location, registerName(exec, dst).data(), registerName(exec, func).data(), argCount, registerOffset);
             break;
         }
         case op_call_eval: {
@@ -998,7 +984,7 @@
             int func = (++it)->u.operand;
             int argCount = (++it)->u.operand;
             int registerOffset = (++it)->u.operand;
-            printf("[%4d] call_eval\t %s, %s, %d, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset);
+            printf("[%4d] call_eval\t %s, %s, %d, %d\n", location, registerName(exec, dst).data(), registerName(exec, func).data(), argCount, registerOffset);
             break;
         }
         case op_call_varargs: {
@@ -1006,7 +992,7 @@
             int func = (++it)->u.operand;
             int argCount = (++it)->u.operand;
             int registerOffset = (++it)->u.operand;
-            printf("[%4d] call_varargs\t %s, %s, %s, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), registerName(exec, argCount).c_str(), registerOffset);
+            printf("[%4d] call_varargs\t %s, %s, %s, %d\n", location, registerName(exec, dst).data(), registerName(exec, func).data(), registerName(exec, argCount).data(), registerOffset);
             break;
         }
         case op_load_varargs: {
@@ -1015,7 +1001,7 @@
         }
         case op_tear_off_activation: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] tear_off_activation\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] tear_off_activation\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_tear_off_arguments: {
@@ -1024,7 +1010,7 @@
         }
         case op_ret: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] ret\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] ret\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_construct: {
@@ -1034,26 +1020,26 @@
             int registerOffset = (++it)->u.operand;
             int proto = (++it)->u.operand;
             int thisRegister = (++it)->u.operand;
-            printf("[%4d] construct\t %s, %s, %d, %d, %s, %s\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset, registerName(exec, proto).c_str(), registerName(exec, thisRegister).c_str());
+            printf("[%4d] construct\t %s, %s, %d, %d, %s, %s\n", location, registerName(exec, dst).data(), registerName(exec, func).data(), argCount, registerOffset, registerName(exec, proto).data(), registerName(exec, thisRegister).data());
             break;
         }
         case op_construct_verify: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] construct_verify\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] construct_verify\t %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data());
             break;
         }
         case op_strcat: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
             int count = (++it)->u.operand;
-            printf("[%4d] strcat\t\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), count);
+            printf("[%4d] strcat\t\t %s, %s, %d\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), count);
             break;
         }
         case op_to_primitive: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] to_primitive\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] to_primitive\t %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data());
             break;
         }
         case op_get_pnames: {
@@ -1062,7 +1048,7 @@
             int r2 = it[3].u.operand;
             int r3 = it[4].u.operand;
             int offset = it[5].u.operand;
-            printf("[%4d] get_pnames\t %s, %s, %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str(), offset, location + offset);
+            printf("[%4d] get_pnames\t %s, %s, %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data(), registerName(exec, r3).data(), offset, location + offset);
             it += OPCODE_LENGTH(op_get_pnames) - 1;
             break;
         }
@@ -1070,13 +1056,13 @@
             int dest = it[1].u.operand;
             int iter = it[4].u.operand;
             int offset = it[5].u.operand;
-            printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(exec, dest).c_str(), registerName(exec, iter).c_str(), offset, location + offset);
+            printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(exec, dest).data(), registerName(exec, iter).data(), offset, location + offset);
             it += OPCODE_LENGTH(op_next_pname) - 1;
             break;
         }
         case op_push_scope: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] push_scope\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] push_scope\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_pop_scope: {
@@ -1087,7 +1073,7 @@
             int r0 = (++it)->u.operand;
             int id0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
-            printf("[%4d] push_new_scope \t%s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str());
+            printf("[%4d] push_new_scope \t%s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data());
             break;
         }
         case op_jmp_scopes: {
@@ -1098,30 +1084,30 @@
         }
         case op_catch: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] catch\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] catch\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_throw: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] throw\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] throw\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
         case op_new_error: {
             int r0 = (++it)->u.operand;
             int errorType = (++it)->u.operand;
             int k0 = (++it)->u.operand;
-            printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(exec, r0).c_str(), errorType, constantName(exec, k0, getConstant(k0)).c_str());
+            printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(exec, r0).data(), errorType, constantName(exec, k0, getConstant(k0)).data());
             break;
         }
         case op_jsr: {
             int retAddrDst = (++it)->u.operand;
             int offset = (++it)->u.operand;
-            printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(exec, retAddrDst).c_str(), offset, location + offset);
+            printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(exec, retAddrDst).data(), offset, location + offset);
             break;
         }
         case op_sret: {
             int retAddrSrc = (++it)->u.operand;
-            printf("[%4d] sret\t\t %s\n", location, registerName(exec, retAddrSrc).c_str());
+            printf("[%4d] sret\t\t %s\n", location, registerName(exec, retAddrSrc).data());
             break;
         }
         case op_debug: {
@@ -1133,17 +1119,17 @@
         }
         case op_profile_will_call: {
             int function = (++it)->u.operand;
-            printf("[%4d] profile_will_call %s\n", location, registerName(exec, function).c_str());
+            printf("[%4d] profile_will_call %s\n", location, registerName(exec, function).data());
             break;
         }
         case op_profile_did_call: {
             int function = (++it)->u.operand;
-            printf("[%4d] profile_did_call\t %s\n", location, registerName(exec, function).c_str());
+            printf("[%4d] profile_did_call\t %s\n", location, registerName(exec, function).data());
             break;
         }
         case op_end: {
             int r0 = (++it)->u.operand;
-            printf("[%4d] end\t\t %s\n", location, registerName(exec, r0).c_str());
+            printf("[%4d] end\t\t %s\n", location, registerName(exec, r0).data());
             break;
         }
     }
@@ -1301,6 +1287,7 @@
 #endif
     , m_needsFullScopeChain(ownerExecutable->needsActivation())
     , m_usesEval(ownerExecutable->usesEval())
+    , m_usesArguments(false)
     , m_isNumericCompareFunction(false)
     , m_codeType(codeType)
     , m_source(sourceProvider)
@@ -1375,7 +1362,7 @@
 {
     Interpreter* interpreter = m_globalData->interpreter;
 
-    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
+    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
         vPC[4].u.structure->deref();
         return;
     }
@@ -1422,7 +1409,7 @@
 {
     Interpreter* interpreter = m_globalData->interpreter;
 
-    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
+    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
         vPC[4].u.structure->ref();
         return;
     }
@@ -1686,7 +1673,6 @@
 
     if (m_rareData) {
         m_rareData->m_exceptionHandlers.shrinkToFit();
-        m_rareData->m_regexps.shrinkToFit();
         m_rareData->m_immediateSwitchJumpTables.shrinkToFit();
         m_rareData->m_characterSwitchJumpTables.shrinkToFit();
         m_rareData->m_stringSwitchJumpTables.shrinkToFit();
diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h
index d92dc9d..1bbb265 100644
--- a/JavaScriptCore/bytecode/CodeBlock.h
+++ b/JavaScriptCore/bytecode/CodeBlock.h
@@ -102,9 +102,11 @@
     struct CallLinkInfo {
         CallLinkInfo()
             : callee(0)
+            , position(0)
+            , hasSeenShouldRepatch(0)
         {
         }
-    
+
         unsigned bytecodeIndex;
         CodeLocationNearCall callReturnLocation;
         CodeLocationDataLabelPtr hotPathBegin;
@@ -456,10 +458,6 @@
         unsigned addFunctionExpr(NonNullPassRefPtr<FunctionExecutable> n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; }
         FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); }
 
-        unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; }
-        RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
-
-
         // Jump Tables
 
         size_t numberOfImmediateSwitchJumpTables() const { return m_rareData ? m_rareData->m_immediateSwitchJumpTables.size() : 0; }
@@ -554,9 +552,6 @@
         struct RareData : FastAllocBase {
             Vector<HandlerInfo> m_exceptionHandlers;
 
-            // Rare Constants
-            Vector<RefPtr<RegExp> > m_regexps;
-
             // Jump Tables
             Vector<SimpleJumpTable> m_immediateSwitchJumpTables;
             Vector<SimpleJumpTable> m_characterSwitchJumpTables;
diff --git a/JavaScriptCore/bytecode/EvalCodeCache.h b/JavaScriptCore/bytecode/EvalCodeCache.h
index a036dd4..27c479d 100644
--- a/JavaScriptCore/bytecode/EvalCodeCache.h
+++ b/JavaScriptCore/bytecode/EvalCodeCache.h
@@ -37,6 +37,7 @@
 #include "UString.h"
 #include <wtf/HashMap.h>
 #include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
 
 namespace JSC {
 
diff --git a/JavaScriptCore/bytecode/Instruction.h b/JavaScriptCore/bytecode/Instruction.h
index bcef7fb..ab6659f 100644
--- a/JavaScriptCore/bytecode/Instruction.h
+++ b/JavaScriptCore/bytecode/Instruction.h
@@ -31,6 +31,7 @@
 
 #include "MacroAssembler.h"
 #include "Opcode.h"
+#include "PropertySlot.h"
 #include "Structure.h"
 #include <wtf/VectorTraits.h>
 
@@ -144,6 +145,7 @@
         Instruction(StructureChain* structureChain) { u.structureChain = structureChain; }
         Instruction(JSCell* jsCell) { u.jsCell = jsCell; }
         Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
+        Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }
 
         union {
             Opcode opcode;
@@ -152,6 +154,7 @@
             StructureChain* structureChain;
             JSCell* jsCell;
             PolymorphicAccessStructureList* polymorphicStructures;
+            PropertySlot::GetValueFunc getterFunc;
         } u;
     };
 
diff --git a/JavaScriptCore/bytecode/JumpTable.cpp b/JavaScriptCore/bytecode/JumpTable.cpp
index 175c1b3..ef7098b 100644
--- a/JavaScriptCore/bytecode/JumpTable.cpp
+++ b/JavaScriptCore/bytecode/JumpTable.cpp
@@ -30,6 +30,8 @@
 #include "config.h"
 #include "JumpTable.h"
 
+#include <wtf/text/StringHash.h>
+
 namespace JSC {
 
 int32_t SimpleJumpTable::offsetForValue(int32_t value, int32_t defaultOffset)
diff --git a/JavaScriptCore/bytecode/Opcode.h b/JavaScriptCore/bytecode/Opcode.h
index 56555f3..0a7f3fa 100644
--- a/JavaScriptCore/bytecode/Opcode.h
+++ b/JavaScriptCore/bytecode/Opcode.h
@@ -46,7 +46,6 @@
         \
         macro(op_new_object, 2) \
         macro(op_new_array, 4) \
-        macro(op_new_regexp, 3) \
         macro(op_mov, 3) \
         \
         macro(op_not, 3) \
@@ -109,6 +108,11 @@
         macro(op_get_by_id_getter_proto, 8) \
         macro(op_get_by_id_getter_proto_list, 8) \
         macro(op_get_by_id_getter_chain, 8) \
+        macro(op_get_by_id_custom_self, 8) \
+        macro(op_get_by_id_custom_self_list, 8) \
+        macro(op_get_by_id_custom_proto, 8) \
+        macro(op_get_by_id_custom_proto_list, 8) \
+        macro(op_get_by_id_custom_chain, 8) \
         macro(op_get_by_id_generic, 8) \
         macro(op_get_array_length, 8) \
         macro(op_get_string_length, 8) \
diff --git a/JavaScriptCore/bytecode/SamplingTool.cpp b/JavaScriptCore/bytecode/SamplingTool.cpp
index 3f0babc..8522e45 100644
--- a/JavaScriptCore/bytecode/SamplingTool.cpp
+++ b/JavaScriptCore/bytecode/SamplingTool.cpp
@@ -337,7 +337,7 @@
 
         if (blockPercent >= 1) {
             //Instruction* code = codeBlock->instructions().begin();
-            printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
+            printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().ascii(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
             if (i < 10) {
                 HashMap<unsigned,unsigned> lineCounts;
                 codeBlock->dump(exec);
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index f2193b0..aa5c5f9 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -34,6 +34,8 @@
 #include "PrototypeFunction.h"
 #include "JSFunction.h"
 #include "Interpreter.h"
+#include "RegExp.h"
+#include "RegExpObject.h"
 #include "UString.h"
 
 using namespace std;
@@ -827,11 +829,6 @@
     return &m_constantPoolRegisters[index];
 }
 
-unsigned BytecodeGenerator::addRegExp(RegExp* r)
-{
-    return m_codeBlock->addRegExp(r);
-}
-
 RegisterID* BytecodeGenerator::emitMove(RegisterID* dst, RegisterID* src)
 {
     emitOpcode(op_mov);
@@ -982,6 +979,12 @@
     return emitLoad(dst, JSValue(stringInMap));
 }
 
+RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, RegExp* regExp)
+{
+    JSValue jsRegExp = new (globalData()) RegExpObject(m_scopeChain->globalObject()->regExpStructure(), regExp);
+    return emitLoad(dst, jsRegExp);
+}
+
 RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, JSValue v)
 {
     RegisterID* constantID = addConstantValue(v);
@@ -1361,15 +1364,6 @@
     return dst;
 }
 
-RegisterID* BytecodeGenerator::emitNewRegExp(RegisterID* dst, RegExp* regExp)
-{
-    emitOpcode(op_new_regexp);
-    instructions().append(dst->index());
-    instructions().append(addRegExp(regExp));
-    return dst;
-}
-
-
 RegisterID* BytecodeGenerator::emitNewFunctionExpression(RegisterID* r0, FuncExprNode* n)
 {
     FunctionBodyNode* function = n->body();
@@ -1942,7 +1936,7 @@
     UString::Rep* clause = static_cast<StringNode*>(node)->value().ustring().rep();
     ASSERT(clause->length() == 1);
     
-    int32_t key = clause->data()[0];
+    int32_t key = clause->characters()[0];
     ASSERT(key >= min);
     ASSERT(key <= max);
     return key - min;
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 8b6a425..919183e 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -264,6 +264,7 @@
         RegisterID* emitLoad(RegisterID* dst, bool);
         RegisterID* emitLoad(RegisterID* dst, double);
         RegisterID* emitLoad(RegisterID* dst, const Identifier&);
+        RegisterID* emitLoad(RegisterID* dst, RegExp* regExp);
         RegisterID* emitLoad(RegisterID* dst, JSValue);
 
         RegisterID* emitUnaryOp(OpcodeID, RegisterID* dst, RegisterID* src);
@@ -276,7 +277,6 @@
 
         RegisterID* emitNewFunction(RegisterID* dst, FunctionBodyNode* body);
         RegisterID* emitNewFunctionExpression(RegisterID* dst, FuncExprNode* func);
-        RegisterID* emitNewRegExp(RegisterID* dst, RegExp* regExp);
 
         RegisterID* emitMove(RegisterID* dst, RegisterID* src);
 
@@ -446,7 +446,6 @@
 
         unsigned addConstant(const Identifier&);
         RegisterID* addConstantValue(JSValue);
-        unsigned addRegExp(RegExp*);
 
         PassRefPtr<FunctionExecutable> makeFunction(ExecState* exec, FunctionBodyNode* body)
         {
diff --git a/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 4162873..aaf2dd1 100644
--- a/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -149,7 +149,7 @@
         return emitThrowError(generator, SyntaxError, "Invalid regular expression: %s", regExp->errorMessage());
     if (dst == generator.ignoredResult())
         return 0;
-    return generator.emitNewRegExp(generator.finalDestination(dst), regExp.get());
+    return generator.emitLoad(generator.finalDestination(dst), regExp.get());
 }
 
 // ------------------------------ ThisNode -------------------------------------
@@ -1699,7 +1699,7 @@
             }
             const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
             if (singleCharacterSwitch &= value.size() == 1) {
-                int32_t intVal = value.rep()->data()[0];
+                int32_t intVal = value.rep()->characters()[0];
                 if (intVal < min_num)
                     min_num = intVal;
                 if (intVal > max_num)
diff --git a/JavaScriptCore/config.h b/JavaScriptCore/config.h
index d5fdfe9..791564a 100644
--- a/JavaScriptCore/config.h
+++ b/JavaScriptCore/config.h
@@ -25,7 +25,7 @@
 
 #include <wtf/Platform.h>
 
-#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
+#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
 #define JS_EXPORTDATA __declspec(dllexport)
 #else
@@ -75,6 +75,12 @@
 #include <wtf/DisallowCType.h>
 #endif
 
+#if COMPILER(MSVC)
+#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
+#else
+#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
+#endif
+
 #if PLATFORM(CHROMIUM)
 #if !defined(WTF_USE_V8)
 #define WTF_USE_V8 1
diff --git a/JavaScriptCore/create_hash_table b/JavaScriptCore/create_hash_table
index 4184500..77463fb 100755
--- a/JavaScriptCore/create_hash_table
+++ b/JavaScriptCore/create_hash_table
@@ -252,18 +252,21 @@
     foreach my $key (@keys) {
         my $firstValue = "";
         my $secondValue = "";
+        my $castStr = "";
 
         if ($values[$i]{"type"} eq "Function") {
+            $castStr = "static_cast<NativeFunction>";
             $firstValue = $values[$i]{"function"};
             $secondValue = $values[$i]{"params"};
         } elsif ($values[$i]{"type"} eq "Property") {
+            $castStr = "static_cast<PropertySlot::GetValueFunc>";
             $firstValue = $values[$i]{"get"};
             $secondValue = $values[$i]{"put"};
         } elsif ($values[$i]{"type"} eq "Lexer") {
             $firstValue = $values[$i]{"value"};
             $secondValue = "0";
         }
-        print "   { \"$key\", $attrs[$i], (intptr_t)$firstValue, (intptr_t)$secondValue },\n";
+        print "   { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue },\n";
         $i++;
     }
     print "   { 0, 0, 0, 0 }\n";
diff --git a/JavaScriptCore/create_regex_tables b/JavaScriptCore/create_regex_tables
new file mode 100644
index 0000000..b436eee
--- /dev/null
+++ b/JavaScriptCore/create_regex_tables
@@ -0,0 +1,112 @@
+# Copyright (C) 2010 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 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. 
+
+types = {
+    "wordchar": { "UseTable" : True, "data": ['_', ('0','9'), ('A', 'Z'), ('a','z')]},
+    "nonwordchar": { "UseTable" : True, "Inverse": "wordchar", "data": ['`', (0, ord('0') - 1), (ord('9') + 1, ord('A') - 1), (ord('Z') + 1, ord('_') - 1), (ord('z') + 1, 0xffff)]},
+    "newline": { "UseTable" : False, "data": ['\n', '\r', 0x2028, 0x2029]},
+    "spaces": { "UseTable" : True, "data": [' ', ('\t', '\r'), 0xa0, 0x1680, 0x180e, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000, (0x2000, 0x200a)]},
+    "nonspaces": { "UseTable" : True, "Inverse": "spaces", "data": [(0, ord('\t') - 1), (ord('\r') + 1, ord(' ') - 1), (ord(' ') + 1, 0x009f), (0x00a1, 0x167f), (0x1681, 0x180d), (0x180f, 0x1fff), (0x200b, 0x2027), (0x202a, 0x202e), (0x2030, 0x205e), (0x2060, 0x2fff), (0x3001, 0xffff)]},
+    "digits": { "UseTable" : False, "data": [('0', '9')]},
+    "nondigits": { "UseTable" : False, "Inverse": "digits", "data": [(0, ord('0') - 1), (ord('9') + 1, 0xffff)] }
+}
+entriesPerLine = 50
+arrays = "";
+functions = "";
+
+for name, classes in types.items():
+    ranges = [];
+    size = 0;
+    for _class in classes["data"]:
+        if type(_class) == str:
+            ranges.append((ord(_class), ord(_class)))
+        elif type(_class) == int:
+            ranges.append((_class, _class))
+        else:
+            (min, max) = _class;
+            if type(min) == str:
+                min = ord(min)
+            if type(max) == str:
+                max = ord(max)
+            if max > 0x7f and min <= 0x7f:
+                ranges.append((min, 0x7f))
+                min = 0x80
+            ranges.append((min,max))
+    ranges.sort();
+    
+    if classes["UseTable"] and (not "Inverse" in classes):
+        array = ("static const char _%sData[65536] = {\n" % name);
+        i = 0
+        for (min,max) in ranges:
+            while i < min:
+                i = i + 1
+                array += ('0,')
+                if (i % entriesPerLine == 0) and (i != 0):
+                    array += ('\n')
+            while i <= max:
+                i = i + 1
+                if (i == 65536):
+                    array += ("1")
+                else:
+                    array += ('1,')
+                if (i % entriesPerLine == 0) and (i != 0):
+                    array += ('\n')
+        while i < 0xffff:
+            array += ("0,")
+            i = i + 1;
+            if (i % entriesPerLine == 0) and (i != 0):
+                array += ('\n')
+        if i == 0xffff:
+            array += ("0")
+        array += ("\n};\n\n");
+        arrays += array
+    
+    # Generate createFunction:
+    function = "";
+    function += ("CharacterClass* %sCreate()\n" % name)
+    function += ("{\n")
+    if classes["UseTable"]:
+        if "Inverse" in classes:
+            function += ("    CharacterClass* characterClass = new CharacterClass(CharacterClassTable::create(_%sData, true));\n" % (classes["Inverse"]))
+        else:
+            function += ("    CharacterClass* characterClass = new CharacterClass(CharacterClassTable::create(_%sData, false));\n" % (name))
+    else:
+        function += ("    CharacterClass* characterClass = new CharacterClass(0);\n")
+    for (min, max) in ranges:
+        if (min == max):
+            if (min > 127):
+                function += ("    characterClass->m_matchesUnicode.append(0x%04x);\n" % min)
+            else:
+                function += ("    characterClass->m_matches.append(0x%02x);\n" % min)
+            continue
+        if (min > 127) or (max > 127):
+            function += ("    characterClass->m_rangesUnicode.append(CharacterRange(0x%04x, 0x%04x));\n" % (min, max))
+        else:
+            function += ("    characterClass->m_ranges.append(CharacterRange(0x%02x, 0x%02x));\n" % (min, max))
+    function += ("    return characterClass;\n")
+    function += ("}\n\n")
+    functions += function
+
+print(arrays)
+print(functions)
+
diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp
index 6dbbcf9..40f6458 100644
--- a/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/JavaScriptCore/interpreter/Interpreter.cpp
@@ -522,8 +522,9 @@
                 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerExecutable()->sourceID()), ReadOnly | DontDelete);
                 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerExecutable()->sourceURL()), ReadOnly | DontDelete);
             }
-            
-            if (exception->isWatchdogException()) {
+
+            ComplType exceptionType = exception->exceptionType();
+            if (exceptionType == Interrupted || exceptionType == Terminated) {
                 while (unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) {
                     // Don't need handler checks or anything, we just want to unroll all the JS callframes possible.
                 }
@@ -579,8 +580,8 @@
 {
     ASSERT(!scopeChain->globalData->exception);
 
-    if (m_reentryDepth >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || m_reentryDepth >= MaxMainThreadReentryDepth) {
+    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
+        if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
             *exception = createStackOverflowError(callFrame);
             return jsNull();
         }
@@ -640,8 +641,8 @@
 {
     ASSERT(!scopeChain->globalData->exception);
 
-    if (m_reentryDepth >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || m_reentryDepth >= MaxMainThreadReentryDepth) {
+    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
+        if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
             *exception = createStackOverflowError(callFrame);
             return jsNull();
         }
@@ -702,8 +703,8 @@
 {
     ASSERT(!scopeChain->globalData->exception);
     
-    if (m_reentryDepth >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || m_reentryDepth >= MaxMainThreadReentryDepth) {
+    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
+        if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
             *exception = createStackOverflowError(callFrame);
             return CallFrameClosure();
         }
@@ -778,8 +779,8 @@
 {
     ASSERT(!scopeChain->globalData->exception);
 
-    if (m_reentryDepth >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || m_reentryDepth >= MaxMainThreadReentryDepth) {
+    if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
+        if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
             *exception = createStackOverflowError(callFrame);
             return jsNull();
         }
@@ -1030,8 +1031,20 @@
     // Cache hit: Specialize instruction and ref Structures.
 
     if (slot.slotBase() == baseValue) {
-        vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_self) : getOpcode(op_get_by_id_self);
-        vPC[5] = slot.cachedOffset();
+        switch (slot.cachedPropertyType()) {
+        case PropertySlot::Getter:
+            vPC[0] = getOpcode(op_get_by_id_getter_self);
+            vPC[5] = slot.cachedOffset();
+            break;
+        case PropertySlot::Custom:
+            vPC[0] = getOpcode(op_get_by_id_custom_self);
+            vPC[5] = slot.customGetter();
+            break;
+        default:
+            vPC[0] = getOpcode(op_get_by_id_self);
+            vPC[5] = slot.cachedOffset();
+            break;
+        }
 
         codeBlock->refStructures(vPC);
         return;
@@ -1056,10 +1069,22 @@
         }
 
         ASSERT(!baseObject->structure()->isUncacheableDictionary());
-
-        vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_proto) : getOpcode(op_get_by_id_proto);
+        
+        switch (slot.cachedPropertyType()) {
+        case PropertySlot::Getter:
+            vPC[0] = getOpcode(op_get_by_id_getter_proto);
+            vPC[6] = offset;
+            break;
+        case PropertySlot::Custom:
+            vPC[0] = getOpcode(op_get_by_id_custom_proto);
+            vPC[6] = slot.customGetter();
+            break;
+        default:
+            vPC[0] = getOpcode(op_get_by_id_proto);
+            vPC[6] = offset;
+            break;
+        }
         vPC[5] = baseObject->structure();
-        vPC[6] = offset;
 
         codeBlock->refStructures(vPC);
         return;
@@ -1072,11 +1097,24 @@
         return;
     }
 
-    vPC[0] = slot.isGetter() ? getOpcode(op_get_by_id_getter_chain) : getOpcode(op_get_by_id_chain);
+    
+    switch (slot.cachedPropertyType()) {
+    case PropertySlot::Getter:
+        vPC[0] = getOpcode(op_get_by_id_getter_chain);
+        vPC[7] = offset;
+        break;
+    case PropertySlot::Custom:
+        vPC[0] = getOpcode(op_get_by_id_custom_chain);
+        vPC[7] = slot.customGetter();
+        break;
+    default:
+        vPC[0] = getOpcode(op_get_by_id_chain);
+        vPC[7] = offset;
+        break;
+    }
     vPC[4] = structure;
     vPC[5] = structure->prototypeChain(callFrame);
     vPC[6] = count;
-    vPC[7] = offset;
     codeBlock->refStructures(vPC);
 }
 
@@ -1137,7 +1175,7 @@
 
 #define CHECK_FOR_TIMEOUT() \
     if (!--tickCount) { \
-        if (globalData->timeoutChecker.didTimeOut(callFrame)) { \
+        if (globalData->terminator.shouldTerminate() || globalData->timeoutChecker.didTimeOut(callFrame)) { \
             exceptionValue = jsNull(); \
             goto vm_throw; \
         } \
@@ -1199,20 +1237,6 @@
         vPC += OPCODE_LENGTH(op_new_array);
         NEXT_INSTRUCTION();
     }
-    DEFINE_OPCODE(op_new_regexp) {
-        /* new_regexp dst(r) regExp(re)
-
-           Constructs a new RegExp instance using the original
-           constructor from regexp regExp, and puts the result in
-           register dst.
-        */
-        int dst = vPC[1].u.operand;
-        int regExp = vPC[2].u.operand;
-        callFrame->r(dst) = JSValue(new (globalData) RegExpObject(callFrame->scopeChain()->globalObject->regExpStructure(), callFrame->codeBlock()->regexp(regExp)));
-
-        vPC += OPCODE_LENGTH(op_new_regexp);
-        NEXT_INSTRUCTION();
-    }
     DEFINE_OPCODE(op_mov) {
         /* mov dst(r) src(r)
 
@@ -1483,7 +1507,7 @@
         */
         int dst = vPC[1].u.operand;
         JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
-        if (src.isInt32() && src.asInt32())
+        if (src.isInt32() && (src.asInt32() & 0x7fffffff)) // non-zero and no overflow
             callFrame->r(dst) = jsNumber(callFrame, -src.asInt32());
         else {
             JSValue result = jsNumber(callFrame, -src.toNumber(callFrame));
@@ -2207,6 +2231,48 @@
 #if HAVE(COMPUTED_GOTO)
     skip_id_getter_proto:
 #endif
+#if HAVE(COMPUTED_GOTO)
+    goto *(&&skip_id_custom_proto);
+#endif
+    DEFINE_OPCODE(op_get_by_id_custom_proto) {
+        /* op_get_by_id_custom_proto dst(r) base(r) property(id) structure(sID) prototypeStructure(sID) offset(n) nop(n)
+         
+         Cached property access: Attempts to use a cached named property getter
+         from the value base's prototype. If the cache misses, op_get_by_id_custom_proto
+         reverts to op_get_by_id.
+         */
+        int base = vPC[2].u.operand;
+        JSValue baseValue = callFrame->r(base).jsValue();
+        
+        if (LIKELY(baseValue.isCell())) {
+            JSCell* baseCell = asCell(baseValue);
+            Structure* structure = vPC[4].u.structure;
+            
+            if (LIKELY(baseCell->structure() == structure)) {
+                ASSERT(structure->prototypeForLookup(callFrame).isObject());
+                JSObject* protoObject = asObject(structure->prototypeForLookup(callFrame));
+                Structure* prototypeStructure = vPC[5].u.structure;
+                
+                if (LIKELY(protoObject->structure() == prototypeStructure)) {
+                    int dst = vPC[1].u.operand;
+                    int property = vPC[3].u.operand;
+                    Identifier& ident = callFrame->codeBlock()->identifier(property);
+                    
+                    PropertySlot::GetValueFunc getter = vPC[6].u.getterFunc;
+                    JSValue result = getter(callFrame, protoObject, ident);
+                    CHECK_FOR_EXCEPTION();
+                    callFrame->r(dst) = result;
+                    vPC += OPCODE_LENGTH(op_get_by_id_custom_proto);
+                    NEXT_INSTRUCTION();
+                }
+            }
+        }
+        uncacheGetByID(callFrame->codeBlock(), vPC);
+        NEXT_INSTRUCTION();
+    }
+#if HAVE(COMPUTED_GOTO)
+    skip_id_custom_proto:
+#endif
     DEFINE_OPCODE(op_get_by_id_self_list) {
         // Polymorphic self access caching currently only supported when JITting.
         ASSERT_NOT_REACHED();
@@ -2235,6 +2301,20 @@
         vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
         NEXT_INSTRUCTION();
     }
+    DEFINE_OPCODE(op_get_by_id_custom_self_list) {
+        // Polymorphic self access caching currently only supported when JITting.
+        ASSERT_NOT_REACHED();
+        // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)!
+        vPC += OPCODE_LENGTH(op_get_by_id_custom_self_list);
+        NEXT_INSTRUCTION();
+    }
+    DEFINE_OPCODE(op_get_by_id_custom_proto_list) {
+        // Polymorphic prototype access caching currently only supported when JITting.
+        ASSERT_NOT_REACHED();
+        // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)!
+        vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
+        NEXT_INSTRUCTION();
+    }
     DEFINE_OPCODE(op_get_by_id_chain) {
         /* op_get_by_id_chain dst(r) base(r) property(id) structure(sID) structureChain(chain) count(n) offset(n)
 
@@ -2324,6 +2404,43 @@
 #if HAVE(COMPUTED_GOTO)
     skip_id_getter_self:
 #endif
+#if HAVE(COMPUTED_GOTO)
+    goto *(&&skip_id_custom_self);
+#endif
+    DEFINE_OPCODE(op_get_by_id_custom_self) {
+        /* op_get_by_id_custom_self dst(r) base(r) property(id) structure(sID) offset(n) nop(n) nop(n)
+         
+         Cached property access: Attempts to use a cached named property getter
+         from the value base. If the cache misses, op_get_by_id_custom_self reverts to
+         op_get_by_id.
+         */
+        int base = vPC[2].u.operand;
+        JSValue baseValue = callFrame->r(base).jsValue();
+        
+        if (LIKELY(baseValue.isCell())) {
+            JSCell* baseCell = asCell(baseValue);
+            Structure* structure = vPC[4].u.structure;
+            
+            if (LIKELY(baseCell->structure() == structure)) {
+                ASSERT(baseCell->isObject());
+                int dst = vPC[1].u.operand;
+                int property = vPC[3].u.operand;
+                Identifier& ident = callFrame->codeBlock()->identifier(property);
+
+                PropertySlot::GetValueFunc getter = vPC[5].u.getterFunc;
+                JSValue result = getter(callFrame, baseValue, ident);
+                CHECK_FOR_EXCEPTION();
+                callFrame->r(dst) = result;
+                vPC += OPCODE_LENGTH(op_get_by_id_custom_self);
+                NEXT_INSTRUCTION();
+            }
+        }
+        uncacheGetByID(callFrame->codeBlock(), vPC);
+        NEXT_INSTRUCTION();
+    }
+#if HAVE(COMPUTED_GOTO)
+skip_id_custom_self:
+#endif
     DEFINE_OPCODE(op_get_by_id_generic) {
         /* op_get_by_id_generic dst(r) base(r) property(id) nop(sID) nop(n) nop(n) nop(n)
 
@@ -2379,7 +2496,7 @@
                             JSObject* getter = getterSetter->getter();
                             CallData callData;
                             CallType callType = getter->getCallData(callData);
-                            JSValue result = call(callFrame, getter, callType, callData, asObject(baseCell), ArgList());
+                            JSValue result = call(callFrame, getter, callType, callData, baseValue, ArgList());
                             CHECK_FOR_EXCEPTION();
                             callFrame->r(dst) = result;
                         } else
@@ -2399,6 +2516,58 @@
 #if HAVE(COMPUTED_GOTO)
     skip_id_getter_chain:
 #endif
+#if HAVE(COMPUTED_GOTO)
+    goto *(&&skip_id_custom_chain);
+#endif
+    DEFINE_OPCODE(op_get_by_id_custom_chain) {
+        /* op_get_by_id_custom_chain dst(r) base(r) property(id) structure(sID) structureChain(chain) count(n) offset(n)
+         
+         Cached property access: Attempts to use a cached named property getter on the
+         value base's prototype chain. If the cache misses, op_get_by_id_custom_chain
+         reverts to op_get_by_id.
+         */
+        int base = vPC[2].u.operand;
+        JSValue baseValue = callFrame->r(base).jsValue();
+        
+        if (LIKELY(baseValue.isCell())) {
+            JSCell* baseCell = asCell(baseValue);
+            Structure* structure = vPC[4].u.structure;
+            
+            if (LIKELY(baseCell->structure() == structure)) {
+                RefPtr<Structure>* it = vPC[5].u.structureChain->head();
+                size_t count = vPC[6].u.operand;
+                RefPtr<Structure>* end = it + count;
+                
+                while (true) {
+                    JSObject* baseObject = asObject(baseCell->structure()->prototypeForLookup(callFrame));
+                    
+                    if (UNLIKELY(baseObject->structure() != (*it).get()))
+                        break;
+                    
+                    if (++it == end) {
+                        int dst = vPC[1].u.operand;
+                        int property = vPC[3].u.operand;
+                        Identifier& ident = callFrame->codeBlock()->identifier(property);
+                        
+                        PropertySlot::GetValueFunc getter = vPC[7].u.getterFunc;
+                        JSValue result = getter(callFrame, baseObject, ident);
+                        CHECK_FOR_EXCEPTION();
+                        callFrame->r(dst) = result;
+                        vPC += OPCODE_LENGTH(op_get_by_id_custom_chain);
+                        NEXT_INSTRUCTION();
+                    }
+                    
+                    // Update baseCell, so that next time around the loop we'll pick up the prototype's prototype.
+                    baseCell = baseObject;
+                }
+            }
+        }
+        uncacheGetByID(callFrame->codeBlock(), vPC);
+        NEXT_INSTRUCTION();
+    }
+#if HAVE(COMPUTED_GOTO)
+    skip_id_custom_chain:
+#endif
     DEFINE_OPCODE(op_get_array_length) {
         /* op_get_array_length dst(r) base(r) property(id) nop(sID) nop(n) nop(n) nop(n)
 
@@ -3085,7 +3254,7 @@
             if (value->length() != 1)
                 vPC += defaultOffset;
             else
-                vPC += callFrame->codeBlock()->characterSwitchJumpTable(tableIndex).offsetForValue(value->data()[0], defaultOffset);
+                vPC += callFrame->codeBlock()->characterSwitchJumpTable(tableIndex).offsetForValue(value->characters()[0], defaultOffset);
         }
         NEXT_INSTRUCTION();
     }
diff --git a/JavaScriptCore/interpreter/Interpreter.h b/JavaScriptCore/interpreter/Interpreter.h
index e17b055..cf8b342 100644
--- a/JavaScriptCore/interpreter/Interpreter.h
+++ b/JavaScriptCore/interpreter/Interpreter.h
@@ -64,7 +64,7 @@
         WillExecuteStatement
     };
 
-    enum { MaxMainThreadReentryDepth = 256, MaxSecondaryThreadReentryDepth = 32 };
+    enum { MaxLargeThreadReentryDepth = 256, MaxSmallThreadReentryDepth = 32 };
 
     class Interpreter : public FastAllocBase {
         friend class JIT;
diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h
index 1fb8ff7..8f46dee 100644
--- a/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/JavaScriptCore/jit/ExecutableAllocator.h
@@ -43,6 +43,10 @@
 #include <e32std.h>
 #endif
 
+#if CPU(MIPS) && OS(LINUX)
+#include <sys/cachectl.h>
+#endif
+
 #if OS(WINCE)
 // From pkfuncs.h (private header file from the Platform Builder)
 #define CACHE_SYNC_ALL 0x07F
@@ -190,6 +194,32 @@
     static void cacheFlush(void*, size_t)
     {
     }
+#elif CPU(MIPS)
+    static void cacheFlush(void* code, size_t size)
+    {
+#if COMPILER(GCC) && (GCC_VERSION >= 40300)
+#if WTF_MIPS_ISA_REV(2) && (GCC_VERSION < 40403)
+        int lineSize;
+        asm("rdhwr %0, $1" : "=r" (lineSize));
+        //
+        // Modify "start" and "end" to avoid GCC 4.3.0-4.4.2 bug in
+        // mips_expand_synci_loop that may execute synci one more time.
+        // "start" points to the fisrt byte of the cache line.
+        // "end" points to the last byte of the line before the last cache line.
+        // Because size is always a multiple of 4, this is safe to set
+        // "end" to the last byte.
+        //
+        intptr_t start = reinterpret_cast<intptr_t>(code) & (-lineSize);
+        intptr_t end = ((reinterpret_cast<intptr_t>(code) + size - 1) & (-lineSize)) - 1;
+        __builtin___clear_cache(reinterpret_cast<char*>(start), reinterpret_cast<char*>(end));
+#else
+        intptr_t end = reinterpret_cast<intptr_t>(code) + size;
+        __builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
+#endif
+#else
+        _flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
+#endif
+    }
 #elif CPU(ARM_THUMB2) && OS(IPHONE_OS)
     static void cacheFlush(void* code, size_t size)
     {
diff --git a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
index dd1db4e..4d3c847 100644
--- a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
+++ b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
@@ -27,10 +27,10 @@
 
 #include "ExecutableAllocator.h"
 
-#include <errno.h>
-
 #if ENABLE(ASSEMBLER) && OS(DARWIN) && CPU(X86_64)
 
+#include <errno.h>
+
 #include "TCSpinLock.h"
 #include <mach/mach_init.h>
 #include <mach/vm_map.h>
diff --git a/JavaScriptCore/jit/JIT.cpp b/JavaScriptCore/jit/JIT.cpp
index 78c5153..ec23d8c 100644
--- a/JavaScriptCore/jit/JIT.cpp
+++ b/JavaScriptCore/jit/JIT.cpp
@@ -275,7 +275,6 @@
         DEFINE_OP(op_new_func)
         DEFINE_OP(op_new_func_exp)
         DEFINE_OP(op_new_object)
-        DEFINE_OP(op_new_regexp)
         DEFINE_OP(op_next_pname)
         DEFINE_OP(op_not)
         DEFINE_OP(op_nstricteq)
@@ -327,6 +326,11 @@
         case op_get_by_id_getter_proto_list:
         case op_get_by_id_getter_self:
         case op_get_by_id_getter_self_list:
+        case op_get_by_id_custom_chain:
+        case op_get_by_id_custom_proto:
+        case op_get_by_id_custom_proto_list:
+        case op_get_by_id_custom_self:
+        case op_get_by_id_custom_self_list:
         case op_get_string_length:
         case op_put_by_id_generic:
         case op_put_by_id_replace:
diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h
index bfbb1ee..e757112 100644
--- a/JavaScriptCore/jit/JIT.h
+++ b/JavaScriptCore/jit/JIT.h
@@ -26,8 +26,6 @@
 #ifndef JIT_h
 #define JIT_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(JIT)
 
 // We've run into some problems where changing the size of the class JIT leads to
@@ -268,6 +266,28 @@
         static const FPRegisterID fpRegT0 = ARMRegisters::d0;
         static const FPRegisterID fpRegT1 = ARMRegisters::d1;
         static const FPRegisterID fpRegT2 = ARMRegisters::d2;
+#elif CPU(MIPS)
+        static const RegisterID returnValueRegister = MIPSRegisters::v0;
+        static const RegisterID cachedResultRegister = MIPSRegisters::v0;
+        static const RegisterID firstArgumentRegister = MIPSRegisters::a0;
+
+        // regT0 must be v0 for returning a 32-bit value.
+        static const RegisterID regT0 = MIPSRegisters::v0;
+
+        // regT1 must be v1 for returning a pair of 32-bit value.
+        static const RegisterID regT1 = MIPSRegisters::v1;
+
+        static const RegisterID regT2 = MIPSRegisters::t4;
+
+        // regT3 must be saved in the callee, so use an S register.
+        static const RegisterID regT3 = MIPSRegisters::s2;
+
+        static const RegisterID callFrameRegister = MIPSRegisters::s0;
+        static const RegisterID timeoutCheckRegister = MIPSRegisters::s1;
+
+        static const FPRegisterID fpRegT0 = MIPSRegisters::f4;
+        static const FPRegisterID fpRegT1 = MIPSRegisters::f6;
+        static const FPRegisterID fpRegT2 = MIPSRegisters::f8;
 #else
     #error "JIT not supported on this platform."
 #endif
@@ -283,32 +303,32 @@
             return JIT(globalData, codeBlock).privateCompile();
         }
 
-        static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress)
+        static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress)
         {
             JIT jit(globalData, codeBlock);
-            jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, cachedOffset, returnAddress, callFrame);
+            jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, ident, slot, cachedOffset, returnAddress, callFrame);
         }
 
-        static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
+        static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
-            jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, cachedOffset);
+            jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, ident, slot, cachedOffset);
         }
-        static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset)
+        static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
-            jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, cachedOffset, callFrame);
+            jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, ident, slot, cachedOffset, callFrame);
         }
-        static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset)
+        static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
         {
             JIT jit(globalData, codeBlock);
-            jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, cachedOffset, callFrame);
+            jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, ident, slot, cachedOffset, callFrame);
         }
 
-        static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress)
+        static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress)
         {
             JIT jit(globalData, codeBlock);
-            jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, cachedOffset, returnAddress, callFrame);
+            jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, ident, slot, cachedOffset, returnAddress, callFrame);
         }
         
         static void compilePutByIdTransition(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress)
@@ -354,11 +374,11 @@
         void privateCompileLinkPass();
         void privateCompileSlowCases();
         JITCode privateCompile();
-        void privateCompileGetByIdProto(StructureStubInfo*, Structure*, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);
-        void privateCompileGetByIdSelfList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, size_t cachedOffset);
-        void privateCompileGetByIdProtoList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame);
-        void privateCompileGetByIdChainList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, StructureChain* chain, size_t count, size_t cachedOffset, CallFrame* callFrame);
-        void privateCompileGetByIdChain(StructureStubInfo*, Structure*, StructureChain*, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);
+        void privateCompileGetByIdProto(StructureStubInfo*, Structure*, Structure* prototypeStructure, const Identifier&, const PropertySlot&, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);
+        void privateCompileGetByIdSelfList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, const Identifier&, const PropertySlot&, size_t cachedOffset);
+        void privateCompileGetByIdProtoList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, Structure* prototypeStructure, const Identifier&, const PropertySlot&, size_t cachedOffset, CallFrame* callFrame);
+        void privateCompileGetByIdChainList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, StructureChain* chain, size_t count, const Identifier&, const PropertySlot&, size_t cachedOffset, CallFrame* callFrame);
+        void privateCompileGetByIdChain(StructureStubInfo*, Structure*, StructureChain*, size_t count, const Identifier&, const PropertySlot&, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame);
         void privateCompilePutByIdTransition(StructureStubInfo*, Structure*, Structure*, size_t cachedOffset, StructureChain*, ReturnAddressPtr returnAddress);
 
         void privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* data, TrampolineStructure *trampolines);
@@ -686,6 +706,48 @@
         // sequencePutById
         static const int sequencePutByIdInstructionSpace = 28;
         static const int sequencePutByIdConstantSpace = 3;
+#elif CPU(MIPS)
+#if WTF_MIPS_ISA(1)
+        static const int patchOffsetPutByIdStructure = 16;
+        static const int patchOffsetPutByIdExternalLoad = 48;
+        static const int patchLengthPutByIdExternalLoad = 20;
+        static const int patchOffsetPutByIdPropertyMapOffset = 68;
+        static const int patchOffsetGetByIdStructure = 16;
+        static const int patchOffsetGetByIdBranchToSlowCase = 48;
+        static const int patchOffsetGetByIdExternalLoad = 48;
+        static const int patchLengthGetByIdExternalLoad = 20;
+        static const int patchOffsetGetByIdPropertyMapOffset = 68;
+        static const int patchOffsetGetByIdPutResult = 88;
+#if ENABLE(OPCODE_SAMPLING)
+        #error "OPCODE_SAMPLING is not yet supported"
+#else
+        static const int patchOffsetGetByIdSlowCaseCall = 40;
+#endif
+        static const int patchOffsetOpCallCompareToJump = 32;
+        static const int patchOffsetMethodCheckProtoObj = 32;
+        static const int patchOffsetMethodCheckProtoStruct = 56;
+        static const int patchOffsetMethodCheckPutFunction = 88;
+#else // WTF_MIPS_ISA(1)
+        static const int patchOffsetPutByIdStructure = 12;
+        static const int patchOffsetPutByIdExternalLoad = 44;
+        static const int patchLengthPutByIdExternalLoad = 16;
+        static const int patchOffsetPutByIdPropertyMapOffset = 60;
+        static const int patchOffsetGetByIdStructure = 12;
+        static const int patchOffsetGetByIdBranchToSlowCase = 44;
+        static const int patchOffsetGetByIdExternalLoad = 44;
+        static const int patchLengthGetByIdExternalLoad = 16;
+        static const int patchOffsetGetByIdPropertyMapOffset = 60;
+        static const int patchOffsetGetByIdPutResult = 76;
+#if ENABLE(OPCODE_SAMPLING)
+        #error "OPCODE_SAMPLING is not yet supported"
+#else
+        static const int patchOffsetGetByIdSlowCaseCall = 40;
+#endif
+        static const int patchOffsetOpCallCompareToJump = 32;
+        static const int patchOffsetMethodCheckProtoObj = 32;
+        static const int patchOffsetMethodCheckProtoStruct = 52;
+        static const int patchOffsetMethodCheckPutFunction = 84;
+#endif
 #endif
 #endif // USE(JSVALUE32_64)
 
@@ -759,7 +821,6 @@
         void emit_op_new_func(Instruction*);
         void emit_op_new_func_exp(Instruction*);
         void emit_op_new_object(Instruction*);
-        void emit_op_new_regexp(Instruction*);
         void emit_op_get_pnames(Instruction*);
         void emit_op_next_pname(Instruction*);
         void emit_op_not(Instruction*);
diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp
index 2f2ffe3..2e1ff40 100644
--- a/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/JavaScriptCore/jit/JITArithmetic.cpp
@@ -56,8 +56,7 @@
     emitLoad(src, regT1, regT0);
 
     Jump srcNotInt = branch32(NotEqual, regT1, Imm32(JSValue::Int32Tag));
-    addSlowCase(branch32(Equal, regT0, Imm32(0)));
-
+    addSlowCase(branchTest32(Zero, regT0, Imm32(0x7fffffff)));
     neg32(regT0);
     emitStoreInt32(dst, regT0, (dst == src));
 
@@ -78,7 +77,7 @@
 {
     unsigned dst = currentInstruction[1].u.operand;
 
-    linkSlowCase(iter); // 0 check
+    linkSlowCase(iter); // 0x7fffffff check
     linkSlowCase(iter); // double check
 
     JITStubCall stubCall(this, cti_op_negate);
diff --git a/JavaScriptCore/jit/JITCall.cpp b/JavaScriptCore/jit/JITCall.cpp
index 179aad7..da603bd 100644
--- a/JavaScriptCore/jit/JITCall.cpp
+++ b/JavaScriptCore/jit/JITCall.cpp
@@ -159,7 +159,7 @@
     emitLoad(dst, regT1, regT0);
     addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::CellTag)));
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addSlowCase(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType)));
+    addSlowCase(branch8(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType)));
 }
 
 void JIT::emitSlow_op_construct_verify(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
diff --git a/JavaScriptCore/jit/JITCode.h b/JavaScriptCore/jit/JITCode.h
index 69cf167..5d889b5 100644
--- a/JavaScriptCore/jit/JITCode.h
+++ b/JavaScriptCore/jit/JITCode.h
@@ -26,8 +26,6 @@
 #ifndef JITCode_h
 #define JITCode_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(JIT)
 
 #include "CallFrame.h"
diff --git a/JavaScriptCore/jit/JITInlineMethods.h b/JavaScriptCore/jit/JITInlineMethods.h
index 5af7565..96a2e5b 100644
--- a/JavaScriptCore/jit/JITInlineMethods.h
+++ b/JavaScriptCore/jit/JITInlineMethods.h
@@ -26,7 +26,6 @@
 #ifndef JITInlineMethods_h
 #define JITInlineMethods_h
 
-#include <wtf/Platform.h>
 
 #if ENABLE(JIT)
 
@@ -161,6 +160,23 @@
     loadPtr(address, linkRegister);
 }
 
+#elif CPU(MIPS)
+
+ALWAYS_INLINE void JIT::preserveReturnAddressAfterCall(RegisterID reg)
+{
+    move(returnAddressRegister, reg);
+}
+
+ALWAYS_INLINE void JIT::restoreReturnAddressBeforeReturn(RegisterID reg)
+{
+    move(reg, returnAddressRegister);
+}
+
+ALWAYS_INLINE void JIT::restoreReturnAddressBeforeReturn(Address address)
+{
+    loadPtr(address, returnAddressRegister);
+}
+
 #else // CPU(X86) || CPU(X86_64)
 
 ALWAYS_INLINE void JIT::preserveReturnAddressAfterCall(RegisterID reg)
diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp
index c470495..0dd6a40 100644
--- a/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/JavaScriptCore/jit/JITOpcodes.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -282,6 +283,33 @@
     // r2 - callee
     // stack: this(JSValue) and a pointer to ArgList
 
+#if OS(WINCE)
+    // Setup arg4:
+    push(stackPointerRegister);
+
+    // Setup arg3:
+    // regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
+    load32(Address(regT1, -(int32_t)sizeof(void*) * 2), ARMRegisters::r3);
+    push(ARMRegisters::r3);
+    load32(Address(regT1, -(int32_t)sizeof(void*)), regT3);
+    storePtr(regT3, Address(stackPointerRegister));
+
+    // Setup arg2:
+    emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT2);
+
+    // Setup arg1:
+    move(callFrameRegister, regT1);
+
+    // Setup arg0:
+    move(stackPointerRegister, regT0);
+
+    call(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_data)));
+
+    load32(Address(stackPointerRegister, 0), regT0);
+    load32(Address(stackPointerRegister, 4), regT1);
+
+    addPtr(Imm32(sizeof(ArgList) + 8), stackPointerRegister);
+#else // OS(WINCE)
     move(stackPointerRegister, regT3);
     subPtr(Imm32(8), stackPointerRegister);
     move(stackPointerRegister, regT0);
@@ -290,7 +318,7 @@
     // Setup arg4:
     storePtr(regT3, Address(stackPointerRegister, 8));
 
-    // Setup arg3
+    // Setup arg3:
     // regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
     load32(Address(regT1, -(int32_t)sizeof(void*) * 2), regT3);
     storePtr(regT3, Address(stackPointerRegister, 0));
@@ -310,6 +338,8 @@
     load32(Address(stackPointerRegister, 20), regT1);
 
     addPtr(Imm32(sizeof(ArgList) + 16 + 8), stackPointerRegister);
+#endif // OS(WINCE)
+
 #endif
 
     // Check for an exception
@@ -486,7 +516,7 @@
 
     // Check that baseVal 'ImplementsDefaultHasInstance'.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT0);
-    addSlowCase(branchTest32(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
+    addSlowCase(branchTest8(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
 
     // Optimistically load the result true, and start looping.
     // Initially, regT1 still contains proto and regT2 still contains value.
@@ -839,7 +869,7 @@
 
     // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addJump(branchTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
+    addJump(branchTest8(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
 
     Jump wasNotImmediate = jump();
 
@@ -866,7 +896,7 @@
 
     // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addJump(branchTest32(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
+    addJump(branchTest8(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
 
     Jump wasNotImmediate = jump();
 
@@ -1143,13 +1173,6 @@
     stubCall.call(currentInstruction[1].u.operand);
 }
 
-void JIT::emit_op_new_regexp(Instruction* currentInstruction)
-{
-    JITStubCall stubCall(this, cti_op_new_regexp);
-    stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
-    stubCall.call(currentInstruction[1].u.operand);
-}
-
 void JIT::emit_op_throw(Instruction* currentInstruction)
 {
     unsigned exception = currentInstruction[1].u.operand;
@@ -1179,7 +1202,7 @@
         isNotObject.append(branch32(NotEqual, regT1, Imm32(JSValue::CellTag)));
     if (base != m_codeBlock->thisRegister()) {
         loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-        isNotObject.append(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
+        isNotObject.append(branch8(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
     }
 
     // We could inline the case where you have a valid cache, but
@@ -1458,7 +1481,7 @@
     addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::CellTag)));
 
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addSlowCase(branchTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));
+    addSlowCase(branchTest8(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));
 
     map(m_bytecodeIndex + OPCODE_LENGTH(op_convert_this), thisRegister, regT1, regT0);
 }
@@ -1764,7 +1787,30 @@
     // push pointer to arguments
     storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(ArgList, m_args)));
 
-    // Setup arg3: regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
+    // regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
+
+#if OS(WINCE)
+    // Setup arg3:
+    loadPtr(Address(regT1, -(int32_t)sizeof(Register)), ARMRegisters::r3);
+
+    // Setup arg2:
+    emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT2);
+
+    // Setup arg1:
+    move(callFrameRegister, regT1);
+
+    // Setup arg0:
+    move(stackPointerRegister, regT0);
+    subPtr(Imm32(sizeof(Register)), stackPointerRegister);
+    storePtr(regT0, Address(stackPointerRegister));
+
+    call(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_data)));
+
+    loadPtr(Address(regT0), regT0);
+
+    addPtr(Imm32(sizeof(Register) + sizeof(ArgList)), stackPointerRegister);
+#else // OS(WINCE)
+    // Setup arg3:
     loadPtr(Address(regT1, -(int32_t)sizeof(Register)), regT2);
 
     // Setup arg2:
@@ -1779,6 +1825,57 @@
     call(Address(regT1, OBJECT_OFFSETOF(JSFunction, m_data)));
 
     addPtr(Imm32(sizeof(ArgList)), stackPointerRegister);
+#endif // OS(WINCE)
+
+#elif CPU(MIPS)
+    emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0);
+
+    // Allocate stack space for our arglist
+    COMPILE_ASSERT(!(sizeof(ArgList) & 0x7), ArgList_should_by_8byte_aligned);
+    subPtr(Imm32(sizeof(ArgList) + 24), stackPointerRegister);
+
+    // Set up arguments
+    subPtr(Imm32(1), regT0); // Don't include 'this' in argcount
+
+    // Push argcount to 24 + offset($sp)
+    storePtr(regT0, Address(stackPointerRegister, 24 + OBJECT_OFFSETOF(ArgList, m_argCount)));
+
+    // Calculate the start of the callframe header, and store in regT1
+    move(callFrameRegister, regT1);
+    sub32(Imm32(RegisterFile::CallFrameHeaderSize * (int32_t)sizeof(Register)), regT1);
+
+    // Calculate start of arguments as callframe header - sizeof(Register) * argcount (regT1)
+    mul32(Imm32(sizeof(Register)), regT0, regT0);
+    subPtr(regT0, regT1);
+
+    // push pointer to arguments to 24 + offset($sp)
+    storePtr(regT1, Address(stackPointerRegister, 24 + OBJECT_OFFSETOF(ArgList, m_args)));
+
+    // Setup arg3: regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
+    loadPtr(Address(regT1, -(int32_t)sizeof(Register)), MIPSRegisters::a3);
+
+    // Setup arg2:
+    emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, MIPSRegisters::a2);
+
+    // Setup arg1:
+    move(callFrameRegister, MIPSRegisters::a1);
+
+    // Setup arg4: ArgList is passed by reference.  At 16($sp), store ($sp + 24)
+    addPtr(Imm32(24), stackPointerRegister, regT2);
+    storePtr(regT2, Address(stackPointerRegister, 16));
+
+    // Setup arg0 as 20($sp) to hold the returned structure.
+    ASSERT(sizeof(JSValue) == 4);
+    addPtr(Imm32(20), stackPointerRegister, MIPSRegisters::a0);
+
+    // Call
+    call(Address(MIPSRegisters::a2, OBJECT_OFFSETOF(JSFunction, m_data)));
+
+    // Get returned value from 0($v0) which is the same as 20($sp)
+    loadPtr(Address(returnValueRegister, 0), returnValueRegister);
+
+    // Restore stack space
+    addPtr(Imm32(sizeof(ArgList) + 24), stackPointerRegister);
 
 #elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
 #error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."
@@ -1938,7 +2035,7 @@
 
     // Check that baseVal 'ImplementsDefaultHasInstance'.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT0);
-    addSlowCase(branchTest32(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
+    addSlowCase(branchTest8(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));
 
     // Optimistically load the result true, and start looping.
     // Initially, regT1 still contains proto and regT2 still contains value.
@@ -2099,7 +2196,7 @@
 
     emitJumpSlowCaseIfNotJSCell(regT0);
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addSlowCase(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType)));
+    addSlowCase(branch8(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
 
 }
 
@@ -2208,7 +2305,7 @@
 
     // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addJump(branchTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
+    addJump(branchTest8(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
     Jump wasNotImmediate = jump();
 
     // Now handle the immediate cases - undefined & null
@@ -2229,7 +2326,7 @@
 
     // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addJump(branchTest32(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
+    addJump(branchTest8(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target);
     Jump wasNotImmediate = jump();
 
     // Now handle the immediate cases - undefined & null
@@ -2342,13 +2439,6 @@
     emitPutVirtualRegister(currentInstruction[1].u.operand);
 }
 
-void JIT::emit_op_new_regexp(Instruction* currentInstruction)
-{
-    JITStubCall stubCall(this, cti_op_new_regexp);
-    stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
-    stubCall.call(currentInstruction[1].u.operand);
-}
-
 void JIT::emit_op_bitor(Instruction* currentInstruction)
 {
     emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
@@ -2385,7 +2475,7 @@
         isNotObject.append(emitJumpIfNotJSCell(regT0));
     if (base != m_codeBlock->thisRegister()) {
         loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-        isNotObject.append(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
+        isNotObject.append(branch8(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));
     }
 
     // We could inline the case where you have a valid cache, but
@@ -2536,7 +2626,7 @@
 
     emitJumpSlowCaseIfNotJSCell(regT0, srcVReg);
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    addSlowCase(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(NumberType)));
+    addSlowCase(branch8(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(NumberType)));
     
     wasImmediate.link(this);
 
@@ -2647,7 +2737,7 @@
     Jump isImmediate = emitJumpIfNotJSCell(regT0);
 
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    setTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);
+    setTest8(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);
 
     Jump wasNotImmediate = jump();
 
@@ -2672,7 +2762,7 @@
     Jump isImmediate = emitJumpIfNotJSCell(regT0);
 
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2);
-    setTest32(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);
+    setTest8(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);
 
     Jump wasNotImmediate = jump();
 
@@ -2732,7 +2822,7 @@
 
     emitJumpSlowCaseIfNotJSCell(regT0);
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT1);
-    addSlowCase(branchTest32(NonZero, Address(regT1, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));
+    addSlowCase(branchTest8(NonZero, Address(regT1, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));
 
 }
 
diff --git a/JavaScriptCore/jit/JITPropertyAccess.cpp b/JavaScriptCore/jit/JITPropertyAccess.cpp
index 151bb03..3399f03 100644
--- a/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -32,6 +32,7 @@
 #if ENABLE(JIT)
 
 #include "CodeBlock.h"
+#include "GetterSetter.h"
 #include "JITInlineMethods.h"
 #include "JITStubCall.h"
 #include "JSArray.h"
@@ -695,7 +696,7 @@
     repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_array_fail));
 }
 
-void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
+void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
 {
     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is
     // referencing the prototype object - let's speculatively load it's table nice and early!)
@@ -713,11 +714,28 @@
     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure));
 #endif
 
-    // Checks out okay! - getDirectOffset
-    compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
-
+    bool needsStubLink = false;
+    
+    // Checks out okay!
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
     Jump success = jump();
-
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
 
     // Use the patch information to link the failure cases back to the original slow case routine.
@@ -728,6 +746,12 @@
     // On success return back to the hot patch code, at a point it will perform the store to dest for us.
     patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult));
 
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
     // Track the stub we have created so that it will be deleted later.
     CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum();
     stubInfo->stubRoutine = entryLabel;
@@ -741,14 +765,43 @@
     repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list));
 }
 
-void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
+void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
 {
     Jump failureCase = checkStructure(regT0, structure);
-    compileGetDirectOffset(regT0, regT0, structure, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        if (!structure->isUsingInlineStorage()) {
+            move(regT0, regT1);
+            compileGetDirectOffset(regT1, regT1, structure, cachedOffset);
+        } else
+            compileGetDirectOffset(regT0, regT1, structure, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(regT0, regT0, structure, cachedOffset);
     Jump success = jump();
 
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
 
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
+
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = polymorphicStructures->list[currentIndex - 1].stubRoutine;
     if (!lastProtoBegin)
@@ -770,7 +823,7 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame)
+void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame)
 {
     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is
     // referencing the prototype object - let's speculatively load it's table nice and early!)
@@ -788,13 +841,38 @@
     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure));
 #endif
 
-    // Checks out okay! - getDirectOffset
-    compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
+    // Checks out okay!
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
 
     Jump success = jump();
 
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
 
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
+
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
     patchBuffer.link(failureCases1, lastProtoBegin);
@@ -815,10 +893,9 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, CallFrame* callFrame)
+void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame)
 {
     ASSERT(count);
-    
     JumpList bucketsOfFail;
 
     // Check eax is an object of the right Structure.
@@ -842,11 +919,36 @@
 #endif
     }
     ASSERT(protoObject);
-
-    compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
+    
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
     Jump success = jump();
 
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
+    
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
 
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
@@ -869,10 +971,10 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
+void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
 {
     ASSERT(count);
-    
+
     JumpList bucketsOfFail;
 
     // Check eax is an object of the right Structure.
@@ -896,11 +998,36 @@
     }
     ASSERT(protoObject);
 
-    compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset);
     Jump success = jump();
 
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
 
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
+
     // Use the patch information to link the failure cases back to the original slow case routine.
     patchBuffer.link(bucketsOfFail, stubInfo->callReturnLocation.labelAtOffset(-patchOffsetGetByIdSlowCaseCall));
 
diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index f9e323d..ec33026 100644
--- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -718,7 +718,7 @@
     repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_array_fail));
 }
 
-void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
+void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
 {
     // regT0 holds a JSCell*
     
@@ -736,9 +736,26 @@
 #else
     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure));
 #endif
-    
-    // Checks out okay! - getDirectOffset
-    compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
+    bool needsStubLink = false;
+    // Checks out okay!
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
     
     Jump success = jump();
     
@@ -751,7 +768,14 @@
     
     // On success return back to the hot patch code, at a point it will perform the store to dest for us.
     patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult));
-    
+
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
+
     // Track the stub we have created so that it will be deleted later.
     CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum();
     stubInfo->stubRoutine = entryLabel;
@@ -766,16 +790,43 @@
 }
 
 
-void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
+void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset)
 {
     // regT0 holds a JSCell*
-    
     Jump failureCase = checkStructure(regT0, structure);
-    compileGetDirectOffset(regT0, regT1, regT0, structure, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        if (!structure->isUsingInlineStorage()) {
+            move(regT0, regT1);
+            compileGetDirectOffset(regT1, regT2, regT1, structure, cachedOffset);
+        } else
+            compileGetDirectOffset(regT0, regT2, regT1, structure, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(regT0, regT1, regT0, structure, cachedOffset);
+
     Jump success = jump();
     
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
-    
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }    
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = polymorphicStructures->list[currentIndex - 1].stubRoutine;
     if (!lastProtoBegin)
@@ -785,7 +836,7 @@
     
     // On success return back to the hot patch code, at a point it will perform the store to dest for us.
     patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult));
-    
+
     CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum();
     
     structure->ref();
@@ -797,7 +848,7 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame)
+void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame)
 {
     // regT0 holds a JSCell*
     
@@ -817,12 +868,35 @@
     Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure));
 #endif
     
-    compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
     
     Jump success = jump();
     
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
-    
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
     patchBuffer.link(failureCases1, lastProtoBegin);
@@ -843,10 +917,9 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, CallFrame* callFrame)
+void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame)
 {
     // regT0 holds a JSCell*
-    
     ASSERT(count);
     
     JumpList bucketsOfFail;
@@ -872,11 +945,35 @@
     }
     ASSERT(protoObject);
     
-    compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
+
     Jump success = jump();
     
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
-    
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
     // Use the patch information to link the failure cases back to the original slow case routine.
     CodeLocationLabel lastProtoBegin = prototypeStructures->list[currentIndex - 1].stubRoutine;
     
@@ -898,10 +995,9 @@
     repatchBuffer.relink(jumpLocation, entryLabel);
 }
 
-void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
+void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)
 {
     // regT0 holds a JSCell*
-    
     ASSERT(count);
     
     JumpList bucketsOfFail;
@@ -927,11 +1023,34 @@
     }
     ASSERT(protoObject);
     
-    compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
+    bool needsStubLink = false;
+    if (slot.cachedPropertyType() == PropertySlot::Getter) {
+        needsStubLink = true;
+        compileGetDirectOffset(protoObject, regT2, regT2, regT1, cachedOffset);
+        JITStubCall stubCall(this, cti_op_get_by_id_getter_stub);
+        stubCall.addArgument(regT1);
+        stubCall.addArgument(regT0);
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else if (slot.cachedPropertyType() == PropertySlot::Custom) {
+        needsStubLink = true;
+        JITStubCall stubCall(this, cti_op_get_by_id_custom_stub);
+        stubCall.addArgument(ImmPtr(protoObject));
+        stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress()));
+        stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident)));
+        stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress()));
+        stubCall.call();
+    } else
+        compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset);
     Jump success = jump();
     
     LinkBuffer patchBuffer(this, m_codeBlock->executablePool());
-    
+    if (needsStubLink) {
+        for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
+            if (iter->to)
+                patchBuffer.link(iter->from, FunctionPtr(iter->to));
+        }
+    }
     // Use the patch information to link the failure cases back to the original slow case routine.
     patchBuffer.link(bucketsOfFail, stubInfo->callReturnLocation.labelAtOffset(-patchOffsetGetByIdSlowCaseCall));
     
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index bf430a6..c32f2ce 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -38,6 +38,7 @@
 #include "Collector.h"
 #include "Debugger.h"
 #include "ExceptionHelpers.h"
+#include "GetterSetter.h"
 #include "GlobalEvalFunction.h"
 #include "JIT.h"
 #include "JSActivation.h"
@@ -238,99 +239,20 @@
 #error "JIT_STUB_ARGUMENT_VA_LIST not supported on ARMv7."
 #endif
 
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiTrampoline) "\n"
-HIDE_SYMBOL(ctiTrampoline) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n"
-SYMBOL_STRING(ctiTrampoline) ":" "\n"
-    "sub sp, sp, #0x3c" "\n"
-    "str lr, [sp, #0x20]" "\n"
-    "str r4, [sp, #0x24]" "\n"
-    "str r5, [sp, #0x28]" "\n"
-    "str r6, [sp, #0x2c]" "\n"
-    "str r1, [sp, #0x30]" "\n"
-    "str r2, [sp, #0x34]" "\n"
-    "str r3, [sp, #0x38]" "\n"
-    "cpy r5, r2" "\n"
-    "mov r6, #512" "\n"
-    "blx r0" "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x3c" "\n"
-    "bx lr" "\n"
-);
-
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "cpy r0, sp" "\n"
-    "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x3c" "\n"
-    "bx lr" "\n"
-);
-
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n"
-SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x3c" "\n"
-    "bx lr" "\n"
-);
+#define THUNK_RETURN_ADDRESS_OFFSET      0x3C
+#define PRESERVED_RETURN_ADDRESS_OFFSET  0x40
+#define PRESERVED_R4_OFFSET              0x44
+#define PRESERVED_R5_OFFSET              0x48
+#define PRESERVED_R6_OFFSET              0x4C
+#define REGISTER_FILE_OFFSET             0x50
+#define CALLFRAME_OFFSET                 0x54
+#define EXCEPTION_OFFSET                 0x58
+#define ENABLE_PROFILER_REFERENCE_OFFSET 0x64
 
 #elif COMPILER(GCC) && CPU(ARM_TRADITIONAL)
 
-asm volatile (
-".globl " SYMBOL_STRING(ctiTrampoline) "\n"
-SYMBOL_STRING(ctiTrampoline) ":" "\n"
-    "stmdb sp!, {r1-r3}" "\n"
-    "stmdb sp!, {r4-r8, lr}" "\n"
-    "sub sp, sp, #68" "\n"
-    "mov r4, r2" "\n"
-    "mov r5, #512" "\n"
-    // r0 contains the code
-    "mov lr, pc" "\n"
-    "mov pc, r0" "\n"
-    "add sp, sp, #68" "\n"
-    "ldmia sp!, {r4-r8, lr}" "\n"
-    "add sp, sp, #12" "\n"
-    "mov pc, lr" "\n"
-);
-
-asm volatile (
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov r0, sp" "\n"
-    "bl " SYMBOL_STRING(cti_vm_throw) "\n"
-
-// Both has the same return sequence
-".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
-SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
-    "add sp, sp, #68" "\n"
-    "ldmia sp!, {r4-r8, lr}" "\n"
-    "add sp, sp, #12" "\n"
-    "mov pc, lr" "\n"
-);
+#define THUNK_RETURN_ADDRESS_OFFSET 64
+#define PRESERVEDR4_OFFSET          68
 
 #elif COMPILER(MSVC) && CPU(X86)
 
@@ -543,102 +465,115 @@
 #error "JIT_STUB_ARGUMENT_VA_LIST not supported on ARMv7."
 #endif
 
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiTrampoline) "\n"
-HIDE_SYMBOL(ctiTrampoline) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n"
-SYMBOL_STRING(ctiTrampoline) ":" "\n"
-    "sub sp, sp, #0x40" "\n"
-    "str lr, [sp, #0x20]" "\n"
-    "str r4, [sp, #0x24]" "\n"
-    "str r5, [sp, #0x28]" "\n"
-    "str r6, [sp, #0x2c]" "\n"
-    "str r1, [sp, #0x30]" "\n"
-    "str r2, [sp, #0x34]" "\n"
-    "str r3, [sp, #0x38]" "\n"
-    "cpy r5, r2" "\n"
-    "mov r6, #512" "\n"
-    "blx r0" "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x40" "\n"
-    "bx lr" "\n"
-);
-
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
-SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "cpy r0, sp" "\n"
-    "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x40" "\n"
-    "bx lr" "\n"
-);
-
-asm volatile (
-".text" "\n"
-".align 2" "\n"
-".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
-HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
-".thumb" "\n"
-".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n"
-SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
-    "ldr r6, [sp, #0x2c]" "\n"
-    "ldr r5, [sp, #0x28]" "\n"
-    "ldr r4, [sp, #0x24]" "\n"
-    "ldr lr, [sp, #0x20]" "\n"
-    "add sp, sp, #0x40" "\n"
-    "bx lr" "\n"
-);
+#define THUNK_RETURN_ADDRESS_OFFSET      0x1C
+#define PRESERVED_RETURN_ADDRESS_OFFSET  0x20
+#define PRESERVED_R4_OFFSET              0x24
+#define PRESERVED_R5_OFFSET              0x28
+#define PRESERVED_R6_OFFSET              0x2C
+#define REGISTER_FILE_OFFSET             0x30
+#define CALLFRAME_OFFSET                 0x34
+#define EXCEPTION_OFFSET                 0x38
+#define ENABLE_PROFILER_REFERENCE_OFFSET 0x40
 
 #elif COMPILER(GCC) && CPU(ARM_TRADITIONAL)
 
-asm volatile (
-".text\n"
+#define THUNK_RETURN_ADDRESS_OFFSET 32
+#define PRESERVEDR4_OFFSET          36
+
+#elif CPU(MIPS)
+
+#if USE(JIT_STUB_ARGUMENT_VA_LIST)
+#error "JIT_STUB_ARGUMENT_VA_LIST not supported on MIPS."
+#endif
+
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".set noreorder" "\n"
+".set nomacro" "\n"
+".set nomips16" "\n"
 ".globl " SYMBOL_STRING(ctiTrampoline) "\n"
-HIDE_SYMBOL(ctiTrampoline) "\n"
+".ent " SYMBOL_STRING(ctiTrampoline) "\n"
 SYMBOL_STRING(ctiTrampoline) ":" "\n"
-    "stmdb sp!, {r1-r3}" "\n"
-    "stmdb sp!, {r4-r8, lr}" "\n"
-    "sub sp, sp, #36" "\n"
-    "mov r4, r2" "\n"
-    "mov r5, #512" "\n"
-    "mov lr, pc" "\n"
-    "mov pc, r0" "\n"
-    "add sp, sp, #36" "\n"
-    "ldmia sp!, {r4-r8, lr}" "\n"
-    "add sp, sp, #12" "\n"
-    "mov pc, lr" "\n"
+    "addiu $29,$29,-72" "\n"
+    "sw    $31,44($29)" "\n"
+    "sw    $18,40($29)" "\n"
+    "sw    $17,36($29)" "\n"
+    "sw    $16,32($29)" "\n"
+#if WTF_MIPS_PIC
+    "sw    $28,28($29)" "\n"
+#endif
+    "move  $16,$6       # set callFrameRegister" "\n"
+    "li    $17,512      # set timeoutCheckRegister" "\n"
+    "move  $25,$4       # move executableAddress to t9" "\n"
+    "sw    $5,52($29)   # store registerFile to current stack" "\n"
+    "sw    $6,56($29)   # store callFrame to curent stack" "\n"
+    "sw    $7,60($29)   # store exception to current stack" "\n"
+    "lw    $8,88($29)   # load enableProfilerReference from previous stack" "\n"
+    "lw    $9,92($29)   # load globalData from previous stack" "\n"
+    "sw    $8,64($29)   # store enableProfilerReference to current stack" "\n"
+    "jalr  $25" "\n"
+    "sw    $9,68($29)   # store globalData to current stack" "\n"
+    "lw    $16,32($29)" "\n"
+    "lw    $17,36($29)" "\n"
+    "lw    $18,40($29)" "\n"
+    "lw    $31,44($29)" "\n"
+    "jr    $31" "\n"
+    "addiu $29,$29,72" "\n"
+".set reorder" "\n"
+".set macro" "\n"
+".end " SYMBOL_STRING(ctiTrampoline) "\n"
 );
 
-asm volatile (
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".set noreorder" "\n"
+".set nomacro" "\n"
+".set nomips16" "\n"
 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
-HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
+".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
-    "mov r0, sp" "\n"
-    "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
+#if WTF_MIPS_PIC
+    "lw    $28,28($29)" "\n"
+".set macro" "\n"
+    "la    $25," SYMBOL_STRING(cti_vm_throw) "\n"
+".set nomacro" "\n"
+    "bal " SYMBOL_STRING(cti_vm_throw) "\n"
+    "move  $4,$29" "\n"
+#else
+    "jal " SYMBOL_STRING(cti_vm_throw) "\n"
+    "move  $4,$29" "\n"
+#endif
+    "lw    $16,32($29)" "\n"
+    "lw    $17,36($29)" "\n"
+    "lw    $18,40($29)" "\n"
+    "lw    $31,44($29)" "\n"
+    "jr    $31" "\n"
+    "addiu $29,$29,72" "\n"
+".set reorder" "\n"
+".set macro" "\n"
+".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+);
 
-// Both has the same return sequence
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".set noreorder" "\n"
+".set nomacro" "\n"
+".set nomips16" "\n"
 ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
-HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
+".ent " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
 SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
-    "add sp, sp, #36" "\n"
-    "ldmia sp!, {r4-r8, lr}" "\n"
-    "add sp, sp, #12" "\n"
-    "mov pc, lr" "\n"
+    "lw    $16,32($29)" "\n"
+    "lw    $17,36($29)" "\n"
+    "lw    $18,40($29)" "\n"
+    "lw    $31,44($29)" "\n"
+    "jr    $31" "\n"
+    "addiu $29,$29,72" "\n"
+".set reorder" "\n"
+".set macro" "\n"
+".end " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
 );
 
 #elif COMPILER(RVCT) && CPU(ARM_TRADITIONAL)
@@ -749,6 +684,108 @@
 
 #endif // USE(JSVALUE32_64)
 
+#if COMPILER(GCC) && CPU(ARM_THUMB2)
+
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+HIDE_SYMBOL(ctiTrampoline) "\n"
+".thumb" "\n"
+".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n"
+SYMBOL_STRING(ctiTrampoline) ":" "\n"
+    "sub sp, sp, #" STRINGIZE_VALUE_OF(ENABLE_PROFILER_REFERENCE_OFFSET) "\n"
+    "str lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
+    "str r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
+    "str r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
+    "str r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
+    "str r1, [sp, #" STRINGIZE_VALUE_OF(REGISTER_FILE_OFFSET) "]" "\n"
+    "str r2, [sp, #" STRINGIZE_VALUE_OF(CALLFRAME_OFFSET) "]" "\n"
+    "str r3, [sp, #" STRINGIZE_VALUE_OF(EXCEPTION_OFFSET) "]" "\n"
+    "cpy r5, r2" "\n"
+    "mov r6, #512" "\n"
+    "blx r0" "\n"
+    "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
+    "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
+    "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
+    "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
+    "add sp, sp, #" STRINGIZE_VALUE_OF(ENABLE_PROFILER_REFERENCE_OFFSET) "\n"
+    "bx lr" "\n"
+);
+
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
+".thumb" "\n"
+".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
+SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
+    "cpy r0, sp" "\n"
+    "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
+    "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
+    "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
+    "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
+    "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
+    "add sp, sp, #" STRINGIZE_VALUE_OF(ENABLE_PROFILER_REFERENCE_OFFSET) "\n"
+    "bx lr" "\n"
+);
+
+asm volatile(
+".text" "\n"
+".align 2" "\n"
+".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
+".thumb" "\n"
+".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n"
+SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
+    "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n"
+    "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n"
+    "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n"
+    "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n"
+    "add sp, sp, #" STRINGIZE_VALUE_OF(ENABLE_PROFILER_REFERENCE_OFFSET) "\n"
+    "bx lr" "\n"
+);
+
+#elif COMPILER(GCC) && CPU(ARM_TRADITIONAL)
+
+asm volatile(
+".globl " SYMBOL_STRING(ctiTrampoline) "\n"
+HIDE_SYMBOL(ctiTrampoline) "\n"
+SYMBOL_STRING(ctiTrampoline) ":" "\n"
+    "stmdb sp!, {r1-r3}" "\n"
+    "stmdb sp!, {r4-r8, lr}" "\n"
+    "sub sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n"
+    "mov r4, r2" "\n"
+    "mov r5, #512" "\n"
+    // r0 contains the code
+    "mov lr, pc" "\n"
+    "mov pc, r0" "\n"
+    "add sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n"
+    "ldmia sp!, {r4-r8, lr}" "\n"
+    "add sp, sp, #12" "\n"
+    "mov pc, lr" "\n"
+);
+
+asm volatile(
+".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
+HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
+SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
+    "mov r0, sp" "\n"
+    "bl " SYMBOL_STRING(cti_vm_throw) "\n"
+
+// Both has the same return sequence
+".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
+HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
+SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
+    "add sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n"
+    "ldmia sp!, {r4-r8, lr}" "\n"
+    "add sp, sp, #12" "\n"
+    "mov pc, lr" "\n"
+);
+
+#endif
+
 #if ENABLE(OPCODE_SAMPLING)
     #define CTI_SAMPLER stackFrame.globalData->interpreter->sampler()
 #else
@@ -763,18 +800,38 @@
     // Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it contains non POD types),
     // and the OBJECT_OFFSETOF macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT
     // macros.
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == 0x20);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == 0x24);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == 0x28);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == 0x2c);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVED_R4_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR5) == PRESERVED_R5_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR6) == PRESERVED_R6_OFFSET);
 
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == 0x30);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == 0x34);
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == 0x38);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == REGISTER_FILE_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == CALLFRAME_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == EXCEPTION_OFFSET);
     // The fifth argument is the first item already on the stack.
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == 0x40);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == ENABLE_PROFILER_REFERENCE_OFFSET);
 
-    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == 0x1C);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
+
+#elif CPU(ARM_TRADITIONAL)
+
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedR4) == PRESERVEDR4_OFFSET);
+
+
+#elif CPU(MIPS)
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == 28);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == 32);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == 36);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == 40);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == 44);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == 48);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == 52);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == 56);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == 60);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == 64);
+    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == 68);
+
 #endif
 }
 
@@ -856,11 +913,10 @@
     }
 
     // Uncacheable: give up.
-    if (!slot.isCacheableValue()) {
+    if (!slot.isCacheable()) {
         ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_get_by_id_generic));
         return;
     }
-    ASSERT(!slot.isGetter());
 
     JSCell* baseCell = asCell(baseValue);
     Structure* structure = baseCell->structure();
@@ -875,8 +931,10 @@
     if (slot.slotBase() == baseValue) {
         // set this up, so derefStructures can do it's job.
         stubInfo->initGetByIdSelf(structure);
-
-        JIT::patchGetByIdSelf(codeBlock, stubInfo, structure, slot.cachedOffset(), returnAddress);
+        if (slot.cachedPropertyType() != PropertySlot::Value)
+            ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_get_by_id_self_fail));
+        else
+            JIT::patchGetByIdSelf(codeBlock, stubInfo, structure, slot.cachedOffset(), returnAddress);
         return;
     }
 
@@ -902,7 +960,7 @@
 
         ASSERT(!structure->isDictionary());
         ASSERT(!slotBaseObject->structure()->isDictionary());
-        JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), offset, returnAddress);
+        JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), propertyName, slot, offset, returnAddress);
         return;
     }
 
@@ -915,7 +973,7 @@
 
     StructureChain* prototypeChain = structure->prototypeChain(callFrame);
     stubInfo->initGetByIdChain(structure, prototypeChain);
-    JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, offset, returnAddress);
+    JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, propertyName, slot, offset, returnAddress);
 }
 
 #endif // ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
@@ -1025,22 +1083,73 @@
         ".thumb" "\n" \
         ".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \
         SYMBOL_STRING(cti_##op) ":" "\n" \
-        "str lr, [sp, #0x1c]" "\n" \
+        "str lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \
         "bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \
-        "ldr lr, [sp, #0x1c]" "\n" \
+        "ldr lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \
         "bx lr" "\n" \
         ); \
     rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) \
 
-#elif CPU(ARM_TRADITIONAL) && COMPILER(GCC)
+#elif CPU(MIPS)
+#if WTF_MIPS_PIC
+#define DEFINE_STUB_FUNCTION(rtype, op) \
+    extern "C" { \
+        rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \
+    }; \
+    asm volatile( \
+        ".text" "\n" \
+        ".align 2" "\n" \
+        ".set noreorder" "\n" \
+        ".set nomacro" "\n" \
+        ".set nomips16" "\n" \
+        ".globl " SYMBOL_STRING(cti_##op) "\n" \
+        ".ent " SYMBOL_STRING(cti_##op) "\n" \
+        SYMBOL_STRING(cti_##op) ":" "\n" \
+        "lw    $28,28($29)" "\n" \
+        "sw    $31,48($29)" "\n" \
+        ".set macro" "\n" \
+        "la    $25," SYMBOL_STRING(JITStubThunked_##op) "\n" \
+        ".set nomacro" "\n" \
+        "bal " SYMBOL_STRING(JITStubThunked_##op) "\n" \
+        "nop" "\n" \
+        "lw    $31,48($29)" "\n" \
+        "jr    $31" "\n" \
+        "nop" "\n" \
+        ".set reorder" "\n" \
+        ".set macro" "\n" \
+        ".end " SYMBOL_STRING(cti_##op) "\n" \
+        ); \
+    rtype JITStubThunked_##op(STUB_ARGS_DECLARATION)
 
-#if USE(JSVALUE32_64)
-#define THUNK_RETURN_ADDRESS_OFFSET 64
-#else
-#define THUNK_RETURN_ADDRESS_OFFSET 32
+#else // WTF_MIPS_PIC
+#define DEFINE_STUB_FUNCTION(rtype, op) \
+    extern "C" { \
+        rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \
+    }; \
+    asm volatile( \
+        ".text" "\n" \
+        ".align 2" "\n" \
+        ".set noreorder" "\n" \
+        ".set nomacro" "\n" \
+        ".set nomips16" "\n" \
+        ".globl " SYMBOL_STRING(cti_##op) "\n" \
+        ".ent " SYMBOL_STRING(cti_##op) "\n" \
+        SYMBOL_STRING(cti_##op) ":" "\n" \
+        "sw    $31,48($29)" "\n" \
+        "jal " SYMBOL_STRING(JITStubThunked_##op) "\n" \
+        "nop" "\n" \
+        "lw    $31,48($29)" "\n" \
+        "jr    $31" "\n" \
+        "nop" "\n" \
+        ".set reorder" "\n" \
+        ".set macro" "\n" \
+        ".end " SYMBOL_STRING(cti_##op) "\n" \
+        ); \
+    rtype JITStubThunked_##op(STUB_ARGS_DECLARATION)
+
 #endif
 
-COMPILE_ASSERT(offsetof(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET, JITStackFrame_thunkReturnAddress_offset_mismatch);
+#elif CPU(ARM_TRADITIONAL) && COMPILER(GCC)
 
 #define DEFINE_STUB_FUNCTION(rtype, op) \
     extern "C" { \
@@ -1148,15 +1257,18 @@
 DEFINE_STUB_FUNCTION(int, timeout_check)
 {
     STUB_INIT_STACK_FRAME(stackFrame);
-    
+
     JSGlobalData* globalData = stackFrame.globalData;
     TimeoutChecker& timeoutChecker = globalData->timeoutChecker;
 
-    if (timeoutChecker.didTimeOut(stackFrame.callFrame)) {
+    if (globalData->terminator.shouldTerminate()) {
+        globalData->exception = createTerminatedExecutionException(globalData);
+        VM_THROW_EXCEPTION_AT_END();
+    } else if (timeoutChecker.didTimeOut(stackFrame.callFrame)) {
         globalData->exception = createInterruptedExecutionException(globalData);
         VM_THROW_EXCEPTION_AT_END();
     }
-    
+
     return timeoutChecker.ticksUntilNextCheck();
 }
 
@@ -1375,7 +1487,7 @@
     CHECK_FOR_EXCEPTION();
 
     if (baseValue.isCell()
-        && slot.isCacheableValue()
+        && slot.isCacheable()
         && !asCell(baseValue)->structure()->isUncacheableDictionary()
         && slot.slotBase() == baseValue) {
 
@@ -1397,7 +1509,7 @@
             stubInfo->u.getByIdSelfList.listSize++;
         }
 
-        JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), slot.cachedOffset());
+        JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset());
 
         if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
             ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_generic));
@@ -1435,6 +1547,37 @@
     return prototypeStructureList;
 }
 
+DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_getter_stub)
+{
+    STUB_INIT_STACK_FRAME(stackFrame);
+    CallFrame* callFrame = stackFrame.callFrame;
+    GetterSetter* getterSetter = asGetterSetter(stackFrame.args[0].jsObject());
+    if (!getterSetter->getter())
+        return JSValue::encode(jsUndefined());
+    JSObject* getter = asObject(getterSetter->getter());
+    CallData callData;
+    CallType callType = getter->getCallData(callData);
+    JSValue result = call(callFrame, getter, callType, callData, stackFrame.args[1].jsObject(), ArgList());
+    if (callFrame->hadException())
+        returnToThrowTrampoline(&callFrame->globalData(), stackFrame.args[2].returnAddress(), STUB_RETURN_ADDRESS);
+
+    return JSValue::encode(result);
+}
+
+DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_custom_stub)
+{
+    STUB_INIT_STACK_FRAME(stackFrame);
+    CallFrame* callFrame = stackFrame.callFrame;
+    JSObject* slotBase = stackFrame.args[0].jsObject();
+    PropertySlot::GetValueFunc getter = reinterpret_cast<PropertySlot::GetValueFunc>(stackFrame.args[1].asPointer);
+    const Identifier& ident = stackFrame.args[2].identifier();
+    JSValue result = getter(callFrame, slotBase, ident);
+    if (callFrame->hadException())
+        returnToThrowTrampoline(&callFrame->globalData(), stackFrame.args[3].returnAddress(), STUB_RETURN_ADDRESS);
+    
+    return JSValue::encode(result);
+}
+
 DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
 {
     STUB_INIT_STACK_FRAME(stackFrame);
@@ -1448,7 +1591,7 @@
 
     CHECK_FOR_EXCEPTION();
 
-    if (!baseValue.isCell() || !slot.isCacheableValue() || asCell(baseValue)->structure()->isDictionary()) {
+    if (!baseValue.isCell() || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) {
         ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail));
         return JSValue::encode(result);
     }
@@ -1476,7 +1619,7 @@
         int listIndex;
         PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
 
-        JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), offset);
+        JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), propertyName, slot, offset);
 
         if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
             ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full));
@@ -1486,7 +1629,7 @@
         PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
 
         StructureChain* protoChain = structure->prototypeChain(callFrame);
-        JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, offset);
+        JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, propertyName, slot, offset);
 
         if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
             ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full));
@@ -2518,10 +2661,9 @@
 #endif // USE(JSVALUE32_64)
 }
 
-#if USE(JSVALUE32_64)
-
 DEFINE_STUB_FUNCTION(int, op_eq_strings)
 {
+#if USE(JSVALUE32_64)
     STUB_INIT_STACK_FRAME(stackFrame);
 
     JSString* string1 = stackFrame.args[0].jsString();
@@ -2530,9 +2672,12 @@
     ASSERT(string1->isString());
     ASSERT(string2->isString());
     return string1->value(stackFrame.callFrame) == string2->value(stackFrame.callFrame);
-}
-
+#else
+    UNUSED_PARAM(args);
+    ASSERT_NOT_REACHED();
+    return 0;
 #endif
+}
 
 DEFINE_STUB_FUNCTION(EncodedJSValue, op_lshift)
 {
@@ -2713,13 +2858,6 @@
     return JSValue::encode(result);
 }
 
-DEFINE_STUB_FUNCTION(JSObject*, op_new_regexp)
-{
-    STUB_INIT_STACK_FRAME(stackFrame);
-
-    return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), stackFrame.args[0].regExp());
-}
-
 DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitor)
 {
     STUB_INIT_STACK_FRAME(stackFrame);
@@ -3025,7 +3163,7 @@
     if (scrutinee.isString()) {
         UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
         if (value->length() == 1)
-            result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->data()[0]).executableAddress();
+            result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->characters()[0]).executableAddress();
     }
 
     return result;
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index 17fd0d9..f419c8c 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -29,8 +29,6 @@
 #ifndef JITStubs_h
 #define JITStubs_h
 
-#include <wtf/Platform.h>
-
 #include "MacroAssemblerCodeRef.h"
 #include "Register.h"
 
@@ -108,10 +106,10 @@
         ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
     };
 #elif CPU(X86)
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
 #pragma pack(push)
 #pragma pack(4)
-#endif // COMPILER(MSVC)
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
     struct JITStackFrame {
         void* reserved; // Unused
         JITStubArg args[6];
@@ -135,9 +133,9 @@
         // When JIT code makes a call, it pushes its return address just below the rest of the stack.
         ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast<ReturnAddressPtr*>(this) - 1; }
     };
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
 #pragma pack(pop)
-#endif // COMPILER(MSVC)
+#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
 #elif CPU(ARM_THUMB2)
     struct JITStackFrame {
         void* reserved; // Unused
@@ -191,6 +189,30 @@
         // When JIT code makes a call, it pushes its return address just below the rest of the stack.
         ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
     };
+#elif CPU(MIPS)
+    struct JITStackFrame {
+        void* reserved; // Unused
+        JITStubArg args[6];
+
+        void* preservedGP; // store GP when using PIC code
+        void* preservedS0;
+        void* preservedS1;
+        void* preservedS2;
+        void* preservedReturnAddress;
+
+        ReturnAddressPtr thunkReturnAddress;
+
+        // These arguments passed in a1..a3 (a0 contained the entry code pointed, which is not preserved)
+        RegisterFile* registerFile;
+        CallFrame* callFrame;
+        JSValue* exception;
+
+        // These arguments passed on the stack.
+        Profiler** enabledProfilerReference;
+        JSGlobalData* globalData;
+
+        ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; }
+    };
 #else
 #error "JITStackFrame not defined for this platform."
 #endif
@@ -276,6 +298,8 @@
     EncodedJSValue JIT_STUB cti_op_get_by_id_array_fail(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_get_by_id_generic(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_get_by_id_method_check(STUB_ARGS_DECLARATION);
+    EncodedJSValue JIT_STUB cti_op_get_by_id_getter_stub(STUB_ARGS_DECLARATION);
+    EncodedJSValue JIT_STUB cti_op_get_by_id_custom_stub(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_get_by_id_proto_fail(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_get_by_id_proto_list(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_get_by_id_proto_list_full(STUB_ARGS_DECLARATION);
@@ -326,7 +350,6 @@
     JSObject* JIT_STUB cti_op_new_func(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_new_func_exp(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_new_object(STUB_ARGS_DECLARATION);
-    JSObject* JIT_STUB cti_op_new_regexp(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_push_activation(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_push_new_scope(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_push_scope(STUB_ARGS_DECLARATION);
@@ -334,9 +357,7 @@
     JSPropertyNameIterator* JIT_STUB cti_op_get_pnames(STUB_ARGS_DECLARATION);
     VoidPtrPair JIT_STUB cti_op_call_arityCheck(STUB_ARGS_DECLARATION);
     int JIT_STUB cti_op_eq(STUB_ARGS_DECLARATION);
-#if USE(JSVALUE32_64)
     int JIT_STUB cti_op_eq_strings(STUB_ARGS_DECLARATION);
-#endif
     int JIT_STUB cti_op_jless(STUB_ARGS_DECLARATION);
     int JIT_STUB cti_op_jlesseq(STUB_ARGS_DECLARATION);
     int JIT_STUB cti_op_jtrue(STUB_ARGS_DECLARATION);
diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp
index 252fb96..ae47d55 100644
--- a/JavaScriptCore/jsc.cpp
+++ b/JavaScriptCore/jsc.cpp
@@ -79,7 +79,7 @@
 static JSValue JSC_HOST_CALL functionLoad(ExecState*, JSObject*, JSValue, const ArgList&);
 static JSValue JSC_HOST_CALL functionCheckSyntax(ExecState*, JSObject*, JSValue, const ArgList&);
 static JSValue JSC_HOST_CALL functionReadline(ExecState*, JSObject*, JSValue, const ArgList&);
-static NO_RETURN JSValue JSC_HOST_CALL functionQuit(ExecState*, JSObject*, JSValue, const ArgList&);
+static NO_RETURN_WITH_VALUE JSValue JSC_HOST_CALL functionQuit(ExecState*, JSObject*, JSValue, const ArgList&);
 
 #if ENABLE(SAMPLING_FLAGS)
 static JSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState*, JSObject*, JSValue, const ArgList&);
@@ -177,7 +177,7 @@
         if (i)
             putchar(' ');
 
-        printf("%s", args.at(i).toString(exec).UTF8String().c_str());
+        printf("%s", args.at(i).toString(exec).UTF8String().data());
     }
 
     putchar('\n');
@@ -187,7 +187,7 @@
 
 JSValue JSC_HOST_CALL functionDebug(ExecState* exec, JSObject*, JSValue, const ArgList& args)
 {
-    fprintf(stderr, "--> %s\n", args.at(0).toString(exec).UTF8String().c_str());
+    fprintf(stderr, "--> %s\n", args.at(0).toString(exec).UTF8String().data());
     return jsUndefined();
 }
 
@@ -346,7 +346,7 @@
     // We can't use destructors in the following code because it uses Windows
     // Structured Exception Handling
     int res = 0;
-    JSGlobalData* globalData = JSGlobalData::create().releaseRef();
+    JSGlobalData* globalData = JSGlobalData::create(ThreadStackTypeLarge).releaseRef();
     TRY
         res = jscmain(argc, argv, globalData);
     EXCEPT(res = 3)
@@ -445,7 +445,7 @@
         if (completion.complType() == Throw)
             printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
         else
-            printf("%s\n", completion.value().toString(globalObject->globalExec()).UTF8String().c_str());
+            printf("%s\n", completion.value().toString(globalObject->globalExec()).UTF8String().data());
 
         globalObject->globalExec()->clearException();
     }
@@ -535,9 +535,9 @@
 
 static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer)
 {
-    FILE* f = fopen(fileName.UTF8String().c_str(), "r");
+    FILE* f = fopen(fileName.UTF8String().data(), "r");
     if (!f) {
-        fprintf(stderr, "Could not open file: %s\n", fileName.UTF8String().c_str());
+        fprintf(stderr, "Could not open file: %s\n", fileName.UTF8String().data());
         return false;
     }
 
diff --git a/JavaScriptCore/jsc.pro b/JavaScriptCore/jsc.pro
index 9bcf08b..420a3f1 100644
--- a/JavaScriptCore/jsc.pro
+++ b/JavaScriptCore/jsc.pro
@@ -8,13 +8,13 @@
 win32-*: CONFIG += console
 win32-msvc*: CONFIG += exceptions_off stl_off
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR= ..
 include($$PWD/../WebKit.pri)
 
 CONFIG += link_pkgconfig
 
 QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
 
-isEmpty(OUTPUT_DIR):OUTPUT_DIR=$$PWD/..
 CONFIG(debug, debug|release) {
     OBJECTS_DIR = obj/debug
 } else { # Release
@@ -22,9 +22,7 @@
 }
 OBJECTS_DIR_WTR = $$OBJECTS_DIR$${QMAKE_DIR_SEP}
 include($$PWD/JavaScriptCore.pri)
-
-*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
-*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
+addJavaScriptCoreLib(.)
 
 symbian {
     TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
diff --git a/JavaScriptCore/make-generated-sources.sh b/JavaScriptCore/make-generated-sources.sh
index 943a7cc..a6b0f63 100755
--- a/JavaScriptCore/make-generated-sources.sh
+++ b/JavaScriptCore/make-generated-sources.sh
@@ -3,6 +3,7 @@
 export SRCROOT=$PWD
 export WebCore=$PWD
 export CREATE_HASH_TABLE="$SRCROOT/create_hash_table"
+export CREATE_REGEXP_TABLES="$SRCROOT/create_regex_tables"
 
 mkdir -p DerivedSources/JavaScriptCore
 cd DerivedSources/JavaScriptCore
diff --git a/JavaScriptCore/os-win32/stdint.h b/JavaScriptCore/os-win32/stdint.h
index 1d8787e..b5dff56 100644
--- a/JavaScriptCore/os-win32/stdint.h
+++ b/JavaScriptCore/os-win32/stdint.h
@@ -61,7 +61,7 @@
 CASSERT(sizeof(uint16_t) == 2, uint16_t_is_two_bytes)
 CASSERT(sizeof(int32_t) == 4, int32_t_is_four_bytes)
 CASSERT(sizeof(uint32_t) == 4, uint32_t_is_four_bytes)
-CASSERT(sizeof(int64_t) == 8, int64_t_is_four_bytes)
-CASSERT(sizeof(uint64_t) == 8, uint64_t_is_four_bytes)
+CASSERT(sizeof(int64_t) == 8, int64_t_is_eight_bytes)
+CASSERT(sizeof(uint64_t) == 8, uint64_t_is_eight_bytes)
 
 #endif
diff --git a/JavaScriptCore/parser/Grammar.y b/JavaScriptCore/parser/Grammar.y
index a017cff..4d6e7d1 100644
--- a/JavaScriptCore/parser/Grammar.y
+++ b/JavaScriptCore/parser/Grammar.y
@@ -1147,7 +1147,7 @@
 ;
 
 TryStatement:
-    TRY Block FINALLY Block             { $$ = createNodeDeclarationInfo<StatementNode*>(new (GLOBAL_DATA) TryNode(GLOBAL_DATA, $2.m_node, GLOBAL_DATA->propertyNames->emptyIdentifier, false, 0, $4.m_node),
+    TRY Block FINALLY Block             { $$ = createNodeDeclarationInfo<StatementNode*>(new (GLOBAL_DATA) TryNode(GLOBAL_DATA, $2.m_node, GLOBAL_DATA->propertyNames->nullIdentifier, false, 0, $4.m_node),
                                                                                          mergeDeclarationLists($2.m_varDeclarations, $4.m_varDeclarations),
                                                                                          mergeDeclarationLists($2.m_funcDeclarations, $4.m_funcDeclarations),
                                                                                          $2.m_features | $4.m_features,
@@ -1188,10 +1188,10 @@
 ;
 
 FunctionExpr:
-    FUNCTION '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo(new (GLOBAL_DATA) FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->emptyIdentifier, $5, GLOBAL_DATA->lexer->sourceCode($4, $6, @4.first_line)), ClosureFeature, 0); setStatementLocation($5, @4, @6); }
+    FUNCTION '(' ')' OPENBRACE FunctionBody CLOSEBRACE { $$ = createNodeInfo(new (GLOBAL_DATA) FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $5, GLOBAL_DATA->lexer->sourceCode($4, $6, @4.first_line)), ClosureFeature, 0); setStatementLocation($5, @4, @6); }
     | FUNCTION '(' FormalParameterList ')' OPENBRACE FunctionBody CLOSEBRACE
       {
-          $$ = createNodeInfo(new (GLOBAL_DATA) FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->emptyIdentifier, $6, GLOBAL_DATA->lexer->sourceCode($5, $7, @5.first_line), $3.m_node.head), $3.m_features | ClosureFeature, 0);
+          $$ = createNodeInfo(new (GLOBAL_DATA) FuncExprNode(GLOBAL_DATA, GLOBAL_DATA->propertyNames->nullIdentifier, $6, GLOBAL_DATA->lexer->sourceCode($5, $7, @5.first_line), $3.m_node.head), $3.m_features | ClosureFeature, 0);
           if ($3.m_features & ArgumentsFeature)
               $6->setUsesArguments();
           setStatementLocation($6, @5, @7);
@@ -1981,18 +1981,15 @@
         type = PropertyNode::Setter;
     else
         return 0;
-    return new (globalData) PropertyNode(globalData, name, new (globalData) FuncExprNode(globalData, globalData->propertyNames->emptyIdentifier, body, source, params), type);
+    return new (globalData) PropertyNode(globalData, name, new (globalData) FuncExprNode(globalData, globalData->propertyNames->nullIdentifier, body, source, params), type);
 }
 
 static ExpressionNode* makeNegateNode(JSGlobalData* globalData, ExpressionNode* n)
 {
     if (n->isNumber()) {
-        NumberNode* number = static_cast<NumberNode*>(n);
-
-        if (number->value() > 0.0) {
-            number->setValue(-number->value());
-            return number;
-        }
+        NumberNode* numberNode = static_cast<NumberNode*>(n);
+        numberNode->setValue(-numberNode->value());
+        return numberNode;
     }
 
     return new (globalData) NegateNode(globalData, n);
diff --git a/JavaScriptCore/parser/NodeConstructors.h b/JavaScriptCore/parser/NodeConstructors.h
index fa8dd4b..dd3b981 100644
--- a/JavaScriptCore/parser/NodeConstructors.h
+++ b/JavaScriptCore/parser/NodeConstructors.h
@@ -741,7 +741,7 @@
 
     inline ContinueNode::ContinueNode(JSGlobalData* globalData)
         : StatementNode(globalData)
-        , m_ident(globalData->propertyNames->emptyIdentifier)
+        , m_ident(globalData->propertyNames->nullIdentifier)
     {
     }
 
@@ -753,7 +753,7 @@
     
     inline BreakNode::BreakNode(JSGlobalData* globalData)
         : StatementNode(globalData)
-        , m_ident(globalData->propertyNames->emptyIdentifier)
+        , m_ident(globalData->propertyNames->nullIdentifier)
     {
     }
 
@@ -877,7 +877,7 @@
 
     inline ForInNode::ForInNode(JSGlobalData* globalData, ExpressionNode* l, ExpressionNode* expr, StatementNode* statement)
         : StatementNode(globalData)
-        , m_ident(globalData->propertyNames->emptyIdentifier)
+        , m_ident(globalData->propertyNames->nullIdentifier)
         , m_init(0)
         , m_lexpr(l)
         , m_expr(expr)
diff --git a/JavaScriptCore/parser/Nodes.h b/JavaScriptCore/parser/Nodes.h
index c216ea8..7852165 100644
--- a/JavaScriptCore/parser/Nodes.h
+++ b/JavaScriptCore/parser/Nodes.h
@@ -1385,12 +1385,6 @@
 
         using ParserArenaRefCounted::operator new;
 
-        void adoptData(std::auto_ptr<ScopeNodeData> data)
-        {
-            ASSERT(!data->m_arena.contains(this));
-            ASSERT(!m_data);
-            m_data.adopt(data);
-        }
         ScopeNodeData* data() const { return m_data.get(); }
         void destroyData() { m_data.clear(); }
 
diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp
index 56c96b4..48627df 100644
--- a/JavaScriptCore/parser/Parser.cpp
+++ b/JavaScriptCore/parser/Parser.cpp
@@ -27,9 +27,6 @@
 #include "Lexer.h"
 #include <wtf/HashSet.h>
 #include <wtf/Vector.h>
-#include <memory>
-
-using std::auto_ptr;
 
 #ifndef yyparse
 extern int jscyyparse(void*);
diff --git a/JavaScriptCore/pcre/pcre_exec.cpp b/JavaScriptCore/pcre/pcre_exec.cpp
index 8ca2eb4..50973d0 100644
--- a/JavaScriptCore/pcre/pcre_exec.cpp
+++ b/JavaScriptCore/pcre/pcre_exec.cpp
@@ -198,7 +198,7 @@
         length = md.endSubject - p;
     while (length-- > 0) {
         int c;
-        if (isprint(c = *(p++)))
+        if (isASCIIPrintable(c = *(p++)))
             printf("%c", c);
         else if (c < 256)
             printf("\\x%02x", c);
diff --git a/JavaScriptCore/profiler/CallIdentifier.h b/JavaScriptCore/profiler/CallIdentifier.h
index ba48c55..f2d04fc 100644
--- a/JavaScriptCore/profiler/CallIdentifier.h
+++ b/JavaScriptCore/profiler/CallIdentifier.h
@@ -44,7 +44,7 @@
 
         CallIdentifier(const UString& name, const UString& url, int lineNumber)
             : m_name(name)
-            , m_url(url)
+            , m_url(!url.isNull() ? url : "")
             , m_lineNumber(lineNumber)
         {
         }
@@ -71,7 +71,7 @@
 
 #ifndef NDEBUG
         operator const char*() const { return c_str(); }
-        const char* c_str() const { return m_name.UTF8String().c_str(); }
+        const char* c_str() const { return m_name.UTF8String().data(); }
 #endif
     };
 
diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp
index c90f9b0..126e6f6 100644
--- a/JavaScriptCore/profiler/Profile.cpp
+++ b/JavaScriptCore/profiler/Profile.cpp
@@ -127,7 +127,7 @@
 
     std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
     for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
-        printf("        %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str());
+        printf("        %-12d%s\n", (*it).second, UString((*it).first).UTF8String().data());
 
     printf("\nSort by top of stack, same collapsed (when >= 5):\n");
 }
diff --git a/JavaScriptCore/profiler/ProfileGenerator.cpp b/JavaScriptCore/profiler/ProfileGenerator.cpp
index f367033..bdfa27b 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -77,7 +77,7 @@
     if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
         CString name = callIdentifier.m_name.UTF8String();
         CString url = callIdentifier.m_url.UTF8String();
-        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
+        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
     }
 
     if (!m_originatingGlobalExec)
@@ -92,7 +92,7 @@
     if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
         CString name = callIdentifier.m_name.UTF8String();
         CString url = callIdentifier.m_url.UTF8String();
-        JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
+        JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
     }
 
     if (!m_originatingGlobalExec)
diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp
index fb126b3..f60c72e 100644
--- a/JavaScriptCore/profiler/ProfileNode.cpp
+++ b/JavaScriptCore/profiler/ProfileNode.cpp
@@ -32,6 +32,7 @@
 #include "Profiler.h"
 #include <stdio.h>
 #include <wtf/DateMath.h>
+#include <wtf/text/StringHash.h>
 
 #if OS(WINDOWS)
 #include <windows.h>
@@ -293,11 +294,11 @@
         printf("  ");
 
     printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n",
-        functionName().UTF8String().c_str(), 
+        functionName().UTF8String().data(), 
         m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(),
         m_visibleSelfTime, m_visibleTotalTime, 
         (m_visible ? "True" : "False"),
-        m_nextSibling ? m_nextSibling->functionName().UTF8String().c_str() : "");
+        m_nextSibling ? m_nextSibling->functionName().UTF8String().data() : "");
 
     ++indentLevel;
 
@@ -312,7 +313,7 @@
     printf("    ");
 
     // Print function names
-    const char* name = functionName().UTF8String().c_str();
+    const char* name = functionName().UTF8String().data();
     double sampleCount = m_actualTotalTime * 1000;
     if (indentLevel) {
         for (int i = 0; i < indentLevel; ++i)
@@ -338,7 +339,7 @@
         while (indentLevel--)
             printf("  ");
 
-        printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().c_str());
+        printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().data());
     }
 
     return m_actualTotalTime;
diff --git a/JavaScriptCore/qt/api/QtScript.pro b/JavaScriptCore/qt/api/QtScript.pro
index c87eaf4..88629c7 100644
--- a/JavaScriptCore/qt/api/QtScript.pro
+++ b/JavaScriptCore/qt/api/QtScript.pro
@@ -13,14 +13,20 @@
     OBJECTS_DIR = obj/release
 }
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
 include($$PWD/../../../WebKit.pri)
+
 include($$PWD/../../JavaScriptCore.pri)
+addJavaScriptCoreLib(../..)
 
 INCLUDEPATH += $$PWD/../../API
 
 SOURCES +=  $$PWD/qscriptengine.cpp \
             $$PWD/qscriptengine_p.cpp \
             $$PWD/qscriptvalue.cpp \
+            $$PWD/qscriptstring.cpp \
+            $$PWD/qscriptprogram.cpp \
+            $$PWD/qscriptsyntaxcheckresult.cpp \
 
 HEADERS +=  $$PWD/qtscriptglobal.h \
             $$PWD/qscriptengine.h \
@@ -28,9 +34,13 @@
             $$PWD/qscriptvalue.h \
             $$PWD/qscriptvalue_p.h \
             $$PWD/qscriptconverter_p.h \
+            $$PWD/qscriptstring.h \
+            $$PWD/qscriptstring_p.h \
+            $$PWD/qscriptprogram.h \
+            $$PWD/qscriptprogram_p.h \
+            $$PWD/qscriptsyntaxcheckresult.h \
 
 
 !static: DEFINES += QT_MAKEDLL
 
 DESTDIR = $$OUTPUT_DIR/lib
-
diff --git a/JavaScriptCore/qt/api/qscriptconverter_p.h b/JavaScriptCore/qt/api/qscriptconverter_p.h
index c3ca41f..cd86e20 100644
--- a/JavaScriptCore/qt/api/qscriptconverter_p.h
+++ b/JavaScriptCore/qt/api/qscriptconverter_p.h
@@ -21,7 +21,11 @@
 #define qscriptconverter_p_h
 
 #include <JavaScriptCore/JavaScript.h>
+#include <QtCore/qnumeric.h>
 #include <QtCore/qstring.h>
+#include <QtCore/qvarlengtharray.h>
+
+extern char *qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **digits_str);
 
 /*
   \internal
@@ -33,6 +37,19 @@
 */
 class QScriptConverter {
 public:
+    static quint32 toArrayIndex(const JSStringRef jsstring)
+    {
+        // FIXME this function should be exported by JSC C API.
+        QString qstring = toString(jsstring);
+
+        bool ok;
+        quint32 idx = qstring.toUInt(&ok);
+        if (!ok || toString(idx) != qstring)
+            idx = 0xffffffff;
+
+        return idx;
+    }
+
     static QString toString(const JSStringRef str)
     {
         return QString(reinterpret_cast<const QChar*>(JSStringGetCharactersPtr(str)), JSStringGetLength(str));
@@ -45,6 +62,71 @@
     {
         return JSStringCreateWithUTF8CString(str);
     }
+    static QString toString(double value)
+    {
+        // FIXME this should be easier. The ideal fix is to create
+        // a new function in JSC C API which could cover the functionality.
+
+        if (qIsNaN(value))
+            return QString::fromLatin1("NaN");
+        if (qIsInf(value))
+            return QString::fromLatin1(value < 0 ? "-Infinity" : "Infinity");
+        if (!value)
+            return QString::fromLatin1("0");
+
+        QVarLengthArray<char, 25> buf;
+        int decpt;
+        int sign;
+        char* result = 0;
+        char* endresult;
+        (void)qdtoa(value, 0, 0, &decpt, &sign, &endresult, &result);
+
+        if (!result)
+            return QString();
+
+        int resultLen = endresult - result;
+        if (decpt <= 0 && decpt > -6) {
+            buf.resize(-decpt + 2 + sign);
+            qMemSet(buf.data(), '0', -decpt + 2 + sign);
+            if (sign) // fix the sign.
+                buf[0] = '-';
+            buf[sign + 1] = '.';
+            buf.append(result, resultLen);
+        } else {
+            if (sign)
+                buf.append('-');
+            int length = buf.size() - sign + resultLen;
+            if (decpt <= 21 && decpt > 0) {
+                if (length <= decpt) {
+                    const char* zeros = "0000000000000000000000000";
+                    buf.append(result, resultLen);
+                    buf.append(zeros, decpt - length);
+                } else {
+                    buf.append(result, decpt);
+                    buf.append('.');
+                    buf.append(result + decpt, resultLen - decpt);
+                }
+            } else if (result[0] >= '0' && result[0] <= '9') {
+                if (length > 1) {
+                    buf.append(result, 1);
+                    buf.append('.');
+                    buf.append(result + 1, resultLen - 1);
+                } else
+                    buf.append(result, resultLen);
+                buf.append('e');
+                buf.append(decpt >= 0 ? '+' : '-');
+                int e = qAbs(decpt - 1);
+                if (e >= 100)
+                    buf.append('0' + e / 100);
+                if (e >= 10)
+                    buf.append('0' + (e % 100) / 10);
+                buf.append('0' + e % 10);
+            }
+        }
+        free(result);
+        buf.append(0);
+        return QString::fromLatin1(buf.constData());
+    }
 };
 
 #endif // qscriptconverter_p_h
diff --git a/JavaScriptCore/qt/api/qscriptengine.cpp b/JavaScriptCore/qt/api/qscriptengine.cpp
index fbeb902..d49c578 100644
--- a/JavaScriptCore/qt/api/qscriptengine.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine.cpp
@@ -22,6 +22,8 @@
 #include "qscriptengine.h"
 
 #include "qscriptengine_p.h"
+#include "qscriptprogram_p.h"
+#include "qscriptsyntaxcheckresult_p.h"
 #include "qscriptvalue_p.h"
 
 /*!
@@ -42,6 +44,23 @@
 }
 
 /*!
+  Checks the syntax of the given \a program. Returns a
+  QScriptSyntaxCheckResult object that contains the result of the check.
+*/
+QScriptSyntaxCheckResult QScriptEngine::checkSyntax(const QString &program)
+{
+    // FIXME This is not optimal.
+    // The JSC C API needs a context to perform a syntax check, it means that a QScriptEnginePrivate
+    // had to be created. This function is static so we have to create QScriptEnginePrivate for each
+    // call. We can't remove the "static" for compatibility reason, at least up to Qt5.
+    // QScriptSyntaxCheckResultPrivate takes ownership of newly created engine. The engine will be
+    // kept as long as it is needed for lazy evaluation of properties of
+    // the QScriptSyntaxCheckResultPrivate.
+    QScriptEnginePrivate* engine = new QScriptEnginePrivate(/* q_ptr */ 0);
+    return QScriptSyntaxCheckResultPrivate::get(engine->checkSyntax(program));
+}
+
+/*!
     Evaluates \a program, using \a lineNumber as the base line number,
     and returns the result of the evaluation.
 
@@ -71,6 +90,11 @@
     return QScriptValuePrivate::get(d_ptr->evaluate(program, fileName, lineNumber));
 }
 
+QScriptValue QScriptEngine::evaluate(const QScriptProgram& program)
+{
+    return QScriptValuePrivate::get(d_ptr->evaluate(QScriptProgramPrivate::get(program)));
+}
+
 /*!
     Runs the garbage collector.
 
@@ -81,6 +105,8 @@
     when the QScriptEngine decides that it's wise to do so (i.e. when a certain number of new objects
     have been created). However, you can call this function to explicitly request that garbage
     collection should be performed as soon as possible.
+
+    \sa reportAdditionalMemoryCost()
 */
 void QScriptEngine::collectGarbage()
 {
@@ -88,6 +114,43 @@
 }
 
 /*!
+  Reports an additional memory cost of the given \a size, measured in
+  bytes, to the garbage collector.
+
+  This function can be called to indicate that a JavaScript object has
+  memory associated with it that isn't managed by Qt Script itself.
+  Reporting the additional cost makes it more likely that the garbage
+  collector will be triggered.
+
+  Note that if the additional memory is shared with objects outside
+  the scripting environment, the cost should not be reported, since
+  collecting the JavaScript object would not cause the memory to be
+  freed anyway.
+
+  Negative \a size values are ignored, i.e. this function can't be
+  used to report that the additional memory has been deallocated.
+
+  \sa collectGarbage()
+*/
+void QScriptEngine::reportAdditionalMemoryCost(int cost)
+{
+    d_ptr->reportAdditionalMemoryCost(cost);
+}
+
+/*!
+  Returns a handle that represents the given string, \a str.
+
+  QScriptString can be used to quickly look up properties, and
+  compare property names, of script objects.
+
+  \sa QScriptValue::property()
+*/
+QScriptString QScriptEngine::toStringHandle(const QString& str)
+{
+    return QScriptStringPrivate::get(d_ptr->toStringHandle(str));
+}
+
+/*!
   Returns a QScriptValue of the primitive type Null.
 
   \sa undefinedValue()
@@ -106,3 +169,18 @@
 {
     return QScriptValue(this, QScriptValue::UndefinedValue);
 }
+
+/*!
+  Returns this engine's Global Object.
+
+  By default, the Global Object contains the built-in objects that are
+  part of \l{ECMA-262}, such as Math, Date and String. Additionally,
+  you can set properties of the Global Object to make your own
+  extensions available to all script code. Non-local variables in
+  script code will be created as properties of the Global Object, as
+  well as local variables in global code.
+*/
+QScriptValue QScriptEngine::globalObject() const
+{
+    return QScriptValuePrivate::get(d_ptr->globalObject());
+}
diff --git a/JavaScriptCore/qt/api/qscriptengine.h b/JavaScriptCore/qt/api/qscriptengine.h
index b8bd5e6..e10888d 100644
--- a/JavaScriptCore/qt/api/qscriptengine.h
+++ b/JavaScriptCore/qt/api/qscriptengine.h
@@ -20,6 +20,9 @@
 #ifndef qscriptengine_h
 #define qscriptengine_h
 
+#include "qscriptprogram.h"
+#include "qscriptstring.h"
+#include "qscriptsyntaxcheckresult.h"
 #include <QtCore/qobject.h>
 #include <QtCore/qshareddata.h>
 #include <QtCore/qstring.h>
@@ -35,11 +38,18 @@
     QScriptEngine();
     ~QScriptEngine();
 
+    static QScriptSyntaxCheckResult checkSyntax(const QString& program);
     QScriptValue evaluate(const QString& program, const QString& fileName = QString(), int lineNumber = 1);
+    QScriptValue evaluate(const QScriptProgram& program);
+
     void collectGarbage();
+    void reportAdditionalMemoryCost(int cost);
+
+    QScriptString toStringHandle(const QString& str);
 
     QScriptValue nullValue();
     QScriptValue undefinedValue();
+    QScriptValue globalObject() const;
 private:
     friend class QScriptEnginePrivate;
 
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.cpp b/JavaScriptCore/qt/api/qscriptengine_p.cpp
index de8a355..38185ab 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine_p.cpp
@@ -21,6 +21,7 @@
 
 #include "qscriptengine_p.h"
 
+#include "qscriptprogram_p.h"
 #include "qscriptvalue_p.h"
 
 /*!
@@ -38,6 +39,19 @@
     JSGlobalContextRelease(m_context);
 }
 
+QScriptSyntaxCheckResultPrivate* QScriptEnginePrivate::checkSyntax(const QString& program)
+{
+    JSValueRef exception;
+    JSStringRef source = QScriptConverter::toString(program);
+    bool syntaxIsCorrect = JSCheckScriptSyntax(m_context, source, /* url */ 0, /* starting line */ 1, &exception);
+    JSStringRelease(source);
+    if (syntaxIsCorrect) {
+        return new QScriptSyntaxCheckResultPrivate(this);
+    }
+    JSValueProtect(m_context, exception);
+    return new QScriptSyntaxCheckResultPrivate(this, const_cast<JSObjectRef>(exception));
+}
+
 /*!
     Evaluates program and returns the result of the evaluation.
     \internal
@@ -46,9 +60,25 @@
 {
     JSStringRef script = QScriptConverter::toString(program);
     JSStringRef file = QScriptConverter::toString(fileName);
-    JSValueRef exception;
-    JSValueRef result = JSEvaluateScript(m_context, script, /* Global Object */ 0, file, lineNumber, &exception);
-    if (!result)
-        return new QScriptValuePrivate(this, exception); // returns an exception
-    return new QScriptValuePrivate(this, result);
+    QScriptValuePrivate* result = new QScriptValuePrivate(this, evaluate(script, file, lineNumber));
+    JSStringRelease(script);
+    JSStringRelease(file);
+    return result;
+}
+
+/*!
+    Evaluates program and returns the result of the evaluation.
+    \internal
+*/
+QScriptValuePrivate* QScriptEnginePrivate::evaluate(const QScriptProgramPrivate* program)
+{
+    if (program->isNull())
+        return new QScriptValuePrivate;
+    return new QScriptValuePrivate(this, evaluate(program->program(), program->file(), program->line()));
+}
+
+QScriptValuePrivate* QScriptEnginePrivate::globalObject() const
+{
+    JSObjectRef globalObject = JSContextGetGlobalObject(context());
+    return new QScriptValuePrivate(this, globalObject, globalObject);
 }
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.h b/JavaScriptCore/qt/api/qscriptengine_p.h
index 8e27c42..2bda68e 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.h
+++ b/JavaScriptCore/qt/api/qscriptengine_p.h
@@ -22,12 +22,16 @@
 
 #include "qscriptconverter_p.h"
 #include "qscriptengine.h"
+#include "qscriptstring_p.h"
+#include "qscriptsyntaxcheckresult_p.h"
 #include "qscriptvalue.h"
 #include <JavaScriptCore/JavaScript.h>
+#include <JSBasePrivate.h>
 #include <QtCore/qshareddata.h>
 #include <QtCore/qstring.h>
 
 class QScriptEngine;
+class QScriptSyntaxCheckResultPrivate;
 
 class QScriptEnginePrivate : public QSharedData {
 public:
@@ -37,8 +41,13 @@
     QScriptEnginePrivate(const QScriptEngine*);
     ~QScriptEnginePrivate();
 
+    QScriptSyntaxCheckResultPrivate* checkSyntax(const QString& program);
     QScriptValuePrivate* evaluate(const QString& program, const QString& fileName, int lineNumber);
+    QScriptValuePrivate* evaluate(const QScriptProgramPrivate* program);
+    inline JSValueRef evaluate(JSStringRef program, JSStringRef fileName, int lineNumber);
+
     inline void collectGarbage();
+    inline void reportAdditionalMemoryCost(int cost);
 
     inline JSValueRef makeJSValue(double number) const;
     inline JSValueRef makeJSValue(int number) const;
@@ -47,17 +56,42 @@
     inline JSValueRef makeJSValue(bool number) const;
     inline JSValueRef makeJSValue(QScriptValue::SpecialValue value) const;
 
+    QScriptValuePrivate* globalObject() const;
+
+    inline QScriptStringPrivate* toStringHandle(const QString& str) const;
+
     inline JSGlobalContextRef context() const;
 private:
     QScriptEngine* q_ptr;
     JSGlobalContextRef m_context;
 };
 
+
+/*!
+  Evaluates given JavaScript program and returns result of the evaluation.
+  \attention this function doesn't take ownership of the parameters.
+  \internal
+*/
+JSValueRef QScriptEnginePrivate::evaluate(JSStringRef program, JSStringRef fileName, int lineNumber)
+{
+    JSValueRef exception;
+    JSValueRef result = JSEvaluateScript(m_context, program, /* Global Object */ 0, fileName, lineNumber, &exception);
+    if (!result)
+        return exception; // returns an exception
+    return result;
+}
+
 void QScriptEnginePrivate::collectGarbage()
 {
     JSGarbageCollect(m_context);
 }
 
+void QScriptEnginePrivate::reportAdditionalMemoryCost(int cost)
+{
+    if (cost > 0)
+        JSReportExtraMemoryCost(m_context, cost);
+}
+
 JSValueRef QScriptEnginePrivate::makeJSValue(double number) const
 {
     return JSValueMakeNumber(m_context, number);
@@ -75,7 +109,10 @@
 
 JSValueRef QScriptEnginePrivate::makeJSValue(const QString& string) const
 {
-    return JSValueMakeString(m_context, QScriptConverter::toString(string));
+    JSStringRef tmp = QScriptConverter::toString(string);
+    JSValueRef result = JSValueMakeString(m_context, tmp);
+    JSStringRelease(tmp);
+    return result;
 }
 
 JSValueRef QScriptEnginePrivate::makeJSValue(bool value) const
@@ -90,6 +127,11 @@
     return JSValueMakeUndefined(m_context);
 }
 
+QScriptStringPrivate* QScriptEnginePrivate::toStringHandle(const QString& str) const
+{
+    return new QScriptStringPrivate(str);
+}
+
 JSGlobalContextRef QScriptEnginePrivate::context() const
 {
     return m_context;
diff --git a/JavaScriptCore/qt/api/qscriptprogram.cpp b/JavaScriptCore/qt/api/qscriptprogram.cpp
new file mode 100644
index 0000000..d7d4948
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptprogram.cpp
@@ -0,0 +1,136 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 "qscriptprogram.h"
+
+#include "qscriptprogram_p.h"
+
+/*!
+  \internal
+
+  \class QScriptProgram
+
+  \brief The QScriptProgram class encapsulates a Qt Script program.
+
+  \ingroup script
+
+  QScriptProgram retains the compiled representation of the script if
+  possible. Thus, QScriptProgram can be used to evaluate the same
+  script multiple times more efficiently.
+
+  \code
+  QScriptEngine engine;
+  QScriptProgram program("1 + 2");
+  QScriptValue result = engine.evaluate(program);
+  \endcode
+*/
+
+/*!
+  Constructs a null QScriptProgram.
+*/
+QScriptProgram::QScriptProgram()
+    : d_ptr(new QScriptProgramPrivate)
+{}
+
+/*!
+  Constructs a new QScriptProgram with the given \a sourceCode, \a
+  fileName and \a firstLineNumber.
+*/
+QScriptProgram::QScriptProgram(const QString& sourceCode,
+               const QString fileName,
+               int firstLineNumber)
+    : d_ptr(new QScriptProgramPrivate(sourceCode, fileName, firstLineNumber))
+{}
+
+/*!
+  Destroys this QScriptProgram.
+*/
+QScriptProgram::~QScriptProgram()
+{}
+
+/*!
+  Constructs a new QScriptProgram that is a copy of \a other.
+*/
+QScriptProgram::QScriptProgram(const QScriptProgram& other)
+{
+    d_ptr = other.d_ptr;
+}
+
+/*!
+  Assigns the \a other value to this QScriptProgram.
+*/
+QScriptProgram& QScriptProgram::operator=(const QScriptProgram& other)
+{
+    d_ptr = other.d_ptr;
+    return *this;
+}
+
+/*!
+  Returns true if this QScriptProgram is null; otherwise
+  returns false.
+*/
+bool QScriptProgram::isNull() const
+{
+    return d_ptr->isNull();
+}
+
+/*!
+  Returns the source code of this program.
+*/
+QString QScriptProgram::sourceCode() const
+{
+    return d_ptr->sourceCode();
+}
+
+/*!
+  Returns the filename associated with this program.
+*/
+QString QScriptProgram::fileName() const
+{
+    return d_ptr->fileName();
+}
+
+/*!
+  Returns the line number associated with this program.
+*/
+int QScriptProgram::firstLineNumber() const
+{
+    return d_ptr->firstLineNumber();
+}
+
+/*!
+  Returns true if this QScriptProgram is equal to \a other;
+  otherwise returns false.
+*/
+bool QScriptProgram::operator==(const QScriptProgram& other) const
+{
+    return d_ptr == other.d_ptr || *d_ptr == *other.d_ptr;
+}
+
+/*!
+  Returns true if this QScriptProgram is not equal to \a other;
+  otherwise returns false.
+*/
+bool QScriptProgram::operator!=(const QScriptProgram& other) const
+{
+    return d_ptr != other.d_ptr && *d_ptr != *other.d_ptr;
+}
+
diff --git a/JavaScriptCore/qt/api/qscriptprogram.h b/JavaScriptCore/qt/api/qscriptprogram.h
new file mode 100644
index 0000000..93c8a3c
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptprogram.h
@@ -0,0 +1,53 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptprogram_h
+#define qscriptprogram_h
+
+#include "qtscriptglobal.h"
+#include <QtCore/qshareddata.h>
+#include <QtCore/qstring.h>
+
+class QScriptProgramPrivate;
+class Q_JAVASCRIPT_EXPORT QScriptProgram {
+public:
+    QScriptProgram();
+    QScriptProgram(const QString& sourceCode,
+                   const QString fileName = QString(),
+                   int firstLineNumber = 1);
+    QScriptProgram(const QScriptProgram& other);
+    ~QScriptProgram();
+
+    QScriptProgram& operator=(const QScriptProgram& other);
+
+    bool isNull() const;
+
+    QString sourceCode() const;
+    QString fileName() const;
+    int firstLineNumber() const;
+
+    bool operator==(const QScriptProgram& other) const;
+    bool operator!=(const QScriptProgram& other) const;
+
+private:
+    QExplicitlySharedDataPointer<QScriptProgramPrivate> d_ptr;
+    Q_DECLARE_PRIVATE(QScriptProgram)
+};
+
+#endif // qscriptprogram_h
diff --git a/JavaScriptCore/qt/api/qscriptprogram_p.h b/JavaScriptCore/qt/api/qscriptprogram_p.h
new file mode 100644
index 0000000..6e80e85
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptprogram_p.h
@@ -0,0 +1,129 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptprogram_p_h
+#define qscriptprogram_p_h
+
+#include "qscriptconverter_p.h"
+#include "qscriptprogram.h"
+#include <JavaScriptCore/JavaScript.h>
+#include <QtCore/qshareddata.h>
+#include <QtCore/qstring.h>
+
+/*
+   FIXME The QScriptProgramPrivate potentially could be much faster. In current implementation we
+   gain CPU time only by avoiding QString -> JSStringRef conversion. In the ideal world we should
+   have a function inside the JSC C API that could provide us "parse once, execute multiple times"
+   functionality.
+*/
+
+class QScriptProgramPrivate : public QSharedData {
+public:
+    inline static QScriptProgramPrivate* get(const QScriptProgram& program);
+    inline QScriptProgramPrivate();
+    inline QScriptProgramPrivate(const QString& sourceCode,
+                   const QString fileName,
+                   int firstLineNumber);
+
+    inline ~QScriptProgramPrivate();
+
+    inline bool isNull() const;
+
+    inline QString sourceCode() const;
+    inline QString fileName() const;
+    inline int firstLineNumber() const;
+
+    inline bool operator==(const QScriptProgramPrivate& other) const;
+    inline bool operator!=(const QScriptProgramPrivate& other) const;
+
+    inline JSStringRef program() const;
+    inline JSStringRef file() const;
+    inline int line() const;
+private:
+    JSStringRef m_program;
+    JSStringRef m_fileName;
+    int m_line;
+};
+
+QScriptProgramPrivate* QScriptProgramPrivate::get(const QScriptProgram& program)
+{
+    return const_cast<QScriptProgramPrivate*>(program.d_ptr.constData());
+}
+
+QScriptProgramPrivate::QScriptProgramPrivate()
+    : m_program(0)
+    , m_fileName(0)
+    , m_line(-1)
+{}
+
+QScriptProgramPrivate::QScriptProgramPrivate(const QString& sourceCode,
+               const QString fileName,
+               int firstLineNumber)
+                   : m_program(QScriptConverter::toString(sourceCode))
+                   , m_fileName(QScriptConverter::toString(fileName))
+                   , m_line(firstLineNumber)
+{}
+
+QScriptProgramPrivate::~QScriptProgramPrivate()
+{
+    if (!isNull()) {
+        JSStringRelease(m_program);
+        JSStringRelease(m_fileName);
+    }
+}
+
+bool QScriptProgramPrivate::isNull() const
+{
+    return !m_program;
+}
+
+QString QScriptProgramPrivate::sourceCode() const
+{
+    return QScriptConverter::toString(m_program);
+}
+
+QString QScriptProgramPrivate::fileName() const
+{
+    return QScriptConverter::toString(m_fileName);
+}
+
+int QScriptProgramPrivate::firstLineNumber() const
+{
+    return m_line;
+}
+
+bool QScriptProgramPrivate::operator==(const QScriptProgramPrivate& other) const
+{
+    return m_line == other.m_line
+            && JSStringIsEqual(m_fileName, other.m_fileName)
+            && JSStringIsEqual(m_program, other.m_program);
+}
+
+bool QScriptProgramPrivate::operator!=(const QScriptProgramPrivate& other) const
+{
+    return m_line != other.m_line
+            || !JSStringIsEqual(m_fileName, other.m_fileName)
+            || !JSStringIsEqual(m_program, other.m_program);
+}
+
+JSStringRef QScriptProgramPrivate::program() const { return m_program; }
+JSStringRef QScriptProgramPrivate::file() const {return m_fileName; }
+int QScriptProgramPrivate::line() const { return m_line; }
+
+#endif // qscriptprogram_p_h
diff --git a/JavaScriptCore/qt/api/qscriptstring.cpp b/JavaScriptCore/qt/api/qscriptstring.cpp
new file mode 100644
index 0000000..83c03c5
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptstring.cpp
@@ -0,0 +1,131 @@
+/*
+    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 "qscriptstring.h"
+
+#include "qscriptstring_p.h"
+#include <QtCore/qhash.h>
+
+/*!
+  Constructs an invalid QScriptString.
+*/
+QScriptString::QScriptString()
+    : d_ptr(new QScriptStringPrivate())
+{
+}
+/*!
+  Constructs an QScriptString from internal representation
+  \internal
+*/
+QScriptString::QScriptString(QScriptStringPrivate* d)
+    : d_ptr(d)
+{
+}
+
+/*!
+  Constructs a new QScriptString that is a copy of \a other.
+*/
+QScriptString::QScriptString(const QScriptString& other)
+{
+    d_ptr = other.d_ptr;
+}
+
+/*!
+  Destroys this QScriptString.
+*/
+QScriptString::~QScriptString()
+{
+}
+
+/*!
+  Assigns the \a other value to this QScriptString.
+*/
+QScriptString& QScriptString::operator=(const QScriptString& other)
+{
+    d_ptr = other.d_ptr;
+    return *this;
+}
+
+/*!
+  Returns true if this QScriptString is valid; otherwise
+  returns false.
+*/
+bool QScriptString::isValid() const
+{
+    return d_ptr->isValid();
+}
+
+/*!
+  Returns true if this QScriptString is equal to \a other;
+  otherwise returns false.
+*/
+bool QScriptString::operator==(const QScriptString& other) const
+{
+    return d_ptr == other.d_ptr || *d_ptr == *(other.d_ptr);
+}
+
+/*!
+  Returns true if this QScriptString is not equal to \a other;
+  otherwise returns false.
+*/
+bool QScriptString::operator!=(const QScriptString& other) const
+{
+    return d_ptr != other.d_ptr || *d_ptr != *(other.d_ptr);
+}
+
+/*!
+  Attempts to convert this QScriptString to a QtScript array index,
+  and returns the result.
+
+  If a conversion error occurs, *\a{ok} is set to false; otherwise
+  *\a{ok} is set to true.
+*/
+quint32 QScriptString::toArrayIndex(bool* ok) const
+{
+    return d_ptr->toArrayIndex(ok);
+}
+
+/*!
+  Returns the string that this QScriptString represents, or a
+  null string if this QScriptString is not valid.
+
+  \sa isValid()
+*/
+QString QScriptString::toString() const
+{
+    return d_ptr->toString();
+}
+
+/*!
+  Returns the string that this QScriptString represents, or a
+  null string if this QScriptString is not valid.
+
+  \sa toString()
+*/
+QScriptString::operator QString() const
+{
+    return d_ptr->toString();
+}
+
+uint qHash(const QScriptString& key)
+{
+    return qHash(QScriptStringPrivate::get(key)->id());
+}
diff --git a/JavaScriptCore/qt/api/qscriptstring.h b/JavaScriptCore/qt/api/qscriptstring.h
new file mode 100644
index 0000000..16593bc
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptstring.h
@@ -0,0 +1,58 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptstring_h
+#define qscriptstring_h
+
+#include "qtscriptglobal.h"
+#include <QtCore/qshareddata.h>
+#include <QtCore/qstring.h>
+
+class QScriptStringPrivate;
+typedef QExplicitlySharedDataPointer<QScriptStringPrivate> QScriptStringPtr;
+
+class Q_JAVASCRIPT_EXPORT QScriptString {
+public:
+    QScriptString();
+    QScriptString(const QScriptString& other);
+    ~QScriptString();
+
+    QScriptString& operator=(const QScriptString& other);
+
+    bool isValid() const;
+
+    bool operator==(const QScriptString& other) const;
+    bool operator!=(const QScriptString& other) const;
+
+    quint32 toArrayIndex(bool* ok = 0) const;
+
+    QString toString() const;
+    operator QString() const;
+
+private:
+    QScriptString(QScriptStringPrivate* d);
+
+    QScriptStringPtr d_ptr;
+
+    friend class QScriptStringPrivate;
+};
+
+uint qHash(const QScriptString& key);
+
+#endif // qscriptstring_h
diff --git a/JavaScriptCore/qt/api/qscriptstring_p.h b/JavaScriptCore/qt/api/qscriptstring_p.h
new file mode 100644
index 0000000..f4fd117
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptstring_p.h
@@ -0,0 +1,112 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptstring_p_h
+#define qscriptstring_p_h
+
+#include "qscriptconverter_p.h"
+#include "qscriptstring.h"
+#include <JavaScriptCore/JavaScript.h>
+#include <QtCore/qnumeric.h>
+#include <QtCore/qshareddata.h>
+
+class QScriptStringPrivate : public QSharedData {
+public:
+    inline QScriptStringPrivate();
+    inline QScriptStringPrivate(const QString& qtstring);
+    inline ~QScriptStringPrivate();
+
+    static inline QScriptString get(QScriptStringPrivate* d);
+    static inline QScriptStringPtr get(const QScriptString& p);
+
+    inline bool isValid() const;
+
+    inline bool operator==(const QScriptStringPrivate& other) const;
+    inline bool operator!=(const QScriptStringPrivate& other) const;
+
+    inline quint32 toArrayIndex(bool* ok = 0) const;
+
+    inline QString toString() const;
+
+    inline quint64 id() const;
+
+private:
+    JSStringRef m_string;
+};
+
+
+QScriptStringPrivate::QScriptStringPrivate()
+    : m_string(0)
+{}
+
+QScriptStringPrivate::QScriptStringPrivate(const QString& qtstring)
+    : m_string(JSStringRetain(QScriptConverter::toString(qtstring)))
+{}
+
+QScriptStringPrivate::~QScriptStringPrivate()
+{
+    if (isValid())
+        JSStringRelease(m_string);
+}
+
+QScriptString QScriptStringPrivate::get(QScriptStringPrivate* d)
+{
+    Q_ASSERT(d);
+    return QScriptString(d);
+}
+
+QScriptStringPtr QScriptStringPrivate::get(const QScriptString& p)
+{
+    return p.d_ptr;
+}
+
+bool QScriptStringPrivate::isValid() const
+{
+    return m_string;
+}
+
+bool QScriptStringPrivate::operator==(const QScriptStringPrivate& other) const
+{
+    return isValid() && other.isValid() && JSStringIsEqual(m_string, other.m_string);
+}
+
+bool QScriptStringPrivate::operator!=(const QScriptStringPrivate& other) const
+{
+    return isValid() && other.isValid() && !JSStringIsEqual(m_string, other.m_string);
+}
+
+quint32 QScriptStringPrivate::toArrayIndex(bool* ok) const
+{
+    quint32 idx = QScriptConverter::toArrayIndex(m_string);
+    if (ok)
+        *ok = (idx != 0xffffffff);
+    return idx;
+}
+
+QString QScriptStringPrivate::toString() const
+{
+    return QScriptConverter::toString(m_string);
+}
+
+quint64 QScriptStringPrivate::id() const
+{
+    return reinterpret_cast<quint32>(m_string);
+}
+
+#endif // qscriptstring_p_h
diff --git a/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.cpp b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.cpp
new file mode 100644
index 0000000..5cf02ef
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.cpp
@@ -0,0 +1,148 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 "qscriptsyntaxcheckresult.h"
+#include "qscriptsyntaxcheckresult_p.h"
+
+/*!
+  \class QScriptSyntaxCheckResult
+
+  \brief The QScriptSyntaxCheckResult class provides the result of a script syntax check.
+
+  \ingroup script
+  \mainclass
+
+  QScriptSyntaxCheckResult is returned by QScriptEngine::checkSyntax() to
+  provide information about the syntactical (in)correctness of a script.
+*/
+
+/*!
+    \enum QScriptSyntaxCheckResult::State
+
+    This enum specifies the state of a syntax check.
+
+    \value Error The program contains a syntax error.
+    \value Intermediate The program is incomplete.
+    \value Valid The program is a syntactically correct Qt Script program.
+*/
+
+/*!
+  Constructs a new QScriptSyntaxCheckResult from the \a other result.
+*/
+QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(const QScriptSyntaxCheckResult& other)
+    : d_ptr(other.d_ptr)
+{}
+
+/*!
+  Constructs a new QScriptSyntaxCheckResult from an internal representation.
+  \internal
+*/
+QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate* d)
+    : d_ptr(d)
+{}
+
+/*!
+  Destroys this QScriptSyntaxCheckResult.
+*/
+QScriptSyntaxCheckResult::~QScriptSyntaxCheckResult()
+{}
+
+/*!
+  Assigns the \a other result to this QScriptSyntaxCheckResult, and returns a
+  reference to this QScriptSyntaxCheckResult.
+*/
+QScriptSyntaxCheckResult& QScriptSyntaxCheckResult::operator=(const QScriptSyntaxCheckResult& other)
+{
+    d_ptr = other.d_ptr;
+    return *this;
+}
+
+/*!
+  Returns the state of this QScriptSyntaxCheckResult.
+*/
+QScriptSyntaxCheckResult::State QScriptSyntaxCheckResult::state() const
+{
+    return d_ptr->state();
+}
+
+/*!
+  Returns the error line number of this QScriptSyntaxCheckResult, or -1 if
+  there is no error.
+
+  \sa state(), errorMessage()
+*/
+int QScriptSyntaxCheckResult::errorLineNumber() const
+{
+    return d_ptr->errorLineNumber();
+}
+
+/*!
+  Returns the error column number of this QScriptSyntaxCheckResult, or -1 if
+  there is no error.
+
+  \sa state(), errorLineNumber()
+*/
+int QScriptSyntaxCheckResult::errorColumnNumber() const
+{
+    return d_ptr->errorColumnNumber();
+}
+
+/*!
+  Returns the error message of this QScriptSyntaxCheckResult, or an empty
+  string if there is no error.
+
+  \sa state(), errorLineNumber()
+*/
+QString QScriptSyntaxCheckResult::errorMessage() const
+{
+    return d_ptr->errorMessage();
+}
+
+QScriptSyntaxCheckResultPrivate::~QScriptSyntaxCheckResultPrivate()
+{
+    if (m_exception)
+        JSValueUnprotect(m_engine->context(), m_exception);
+}
+
+QString QScriptSyntaxCheckResultPrivate::errorMessage() const
+{
+    if (!m_exception)
+        return QString();
+
+    JSStringRef tmp = JSValueToStringCopy(m_engine->context(), m_exception, /* exception */ 0);
+    QString message = QScriptConverter::toString(tmp);
+    JSStringRelease(tmp);
+    return message;
+}
+
+int QScriptSyntaxCheckResultPrivate::errorLineNumber() const
+{
+    if (!m_exception)
+        return -1;
+    // m_exception is an instance of the Exception so it has "line" attribute.
+    JSStringRef lineAttrName = QScriptConverter::toString("line");
+    JSValueRef line = JSObjectGetProperty(m_engine->context(),
+                                          m_exception,
+                                          lineAttrName,
+                                          /* exceptions */0);
+    JSStringRelease(lineAttrName);
+    return JSValueToNumber(m_engine->context(), line, /* exceptions */0);
+}
diff --git a/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.h b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.h
new file mode 100644
index 0000000..aa57744
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult.h
@@ -0,0 +1,50 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptsyntaxcheckresult_h
+#define qscriptsyntaxcheckresult_h
+
+#include "qtscriptglobal.h"
+#include <QtCore/qshareddata.h>
+
+class QScriptSyntaxCheckResultPrivate;
+class Q_JAVASCRIPT_EXPORT QScriptSyntaxCheckResult {
+public:
+    enum State {
+        Error,
+        Intermediate,
+        Valid
+    };
+
+    QScriptSyntaxCheckResult(const QScriptSyntaxCheckResult& other);
+    ~QScriptSyntaxCheckResult();
+    QScriptSyntaxCheckResult& operator=(const QScriptSyntaxCheckResult& other);
+
+    State state() const;
+    int errorLineNumber() const;
+    int errorColumnNumber() const;
+    QString errorMessage() const;
+
+private:
+    QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate* d);
+    QExplicitlySharedDataPointer<QScriptSyntaxCheckResultPrivate> d_ptr;
+
+    friend class QScriptSyntaxCheckResultPrivate;
+};
+#endif // qscriptsyntaxcheckresult_h
diff --git a/JavaScriptCore/qt/api/qscriptsyntaxcheckresult_p.h b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult_p.h
new file mode 100644
index 0000000..6e1a131
--- /dev/null
+++ b/JavaScriptCore/qt/api/qscriptsyntaxcheckresult_p.h
@@ -0,0 +1,73 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 qscriptsyntaxcheckresult_p_h
+#define qscriptsyntaxcheckresult_p_h
+
+#include "qscriptconverter_p.h"
+#include "qscriptengine_p.h"
+#include "qscriptsyntaxcheckresult.h"
+#include <JavaScriptCore/JavaScript.h>
+#include <QtCore/qshareddata.h>
+
+class QScriptSyntaxCheckResultPrivate : public QSharedData {
+public:
+    static inline QScriptSyntaxCheckResult get(QScriptSyntaxCheckResultPrivate* p);
+    inline QScriptSyntaxCheckResultPrivate(const QScriptEnginePrivate* engine);
+    inline QScriptSyntaxCheckResultPrivate(const QScriptEnginePrivate* engine, JSObjectRef value);
+    ~QScriptSyntaxCheckResultPrivate();
+
+    inline QScriptSyntaxCheckResult::State state() const;
+    int errorLineNumber() const;
+    inline int errorColumnNumber() const;
+    QString errorMessage() const;
+private:
+    JSObjectRef m_exception;
+    QScriptEnginePtr m_engine;
+};
+
+QScriptSyntaxCheckResult QScriptSyntaxCheckResultPrivate::get(QScriptSyntaxCheckResultPrivate* p)
+{
+    return QScriptSyntaxCheckResult(p);
+}
+
+QScriptSyntaxCheckResultPrivate::QScriptSyntaxCheckResultPrivate(const QScriptEnginePrivate* engine)
+    : m_exception(0)
+    , m_engine(const_cast<QScriptEnginePrivate*>(engine))
+{}
+
+QScriptSyntaxCheckResultPrivate::QScriptSyntaxCheckResultPrivate(const QScriptEnginePrivate* engine, JSObjectRef value)
+    : m_exception(value)
+    , m_engine(const_cast<QScriptEnginePrivate*>(engine))
+{}
+
+QScriptSyntaxCheckResult::State QScriptSyntaxCheckResultPrivate::state() const
+{
+    // FIXME This function doesn't return QScriptSyntaxCheckResult::Intermediate
+    return m_exception ? QScriptSyntaxCheckResult::Error : QScriptSyntaxCheckResult::Valid;
+}
+
+int QScriptSyntaxCheckResultPrivate::errorColumnNumber() const
+{
+    // FIXME JSC C API doesn't expose the error column number.
+    return m_exception ? 1 : -1;
+}
+
+
+#endif // qscriptsyntaxcheckresult_p_h
diff --git a/JavaScriptCore/qt/api/qscriptvalue_p.h b/JavaScriptCore/qt/api/qscriptvalue_p.h
index 8db43a7..830b38e 100644
--- a/JavaScriptCore/qt/api/qscriptvalue_p.h
+++ b/JavaScriptCore/qt/api/qscriptvalue_p.h
@@ -38,10 +38,10 @@
 
   Implementation of QScriptValue.
   The implementation is based on a state machine. The states names are included in
-  QScriptValuePrivate::States. Each method should check for the current state and then perform a
+  QScriptValuePrivate::State. Each method should check for the current state and then perform a
   correct action.
 
-  States:
+  State:
     Invalid -> QSVP is invalid, no assumptions should be made about class members (apart from m_value).
     CString -> QSVP is created from QString or const char* and no JSC engine has been associated yet.
         Current value is kept in m_string,
@@ -53,7 +53,7 @@
         is kept in m_number (cast of QScriptValue::SpecialValue)
     JSValue -> QSVP is associated with engine, but there is no information about real type, the state
         have really short live cycle. Normally it is created as a function call result.
-    JSNative -> QSVP is associated with engine, and it is sure that it isn't a JavaScript object.
+    JSPrimitive -> QSVP is associated with engine, and it is sure that it isn't a JavaScript object.
     JSObject -> QSVP is associated with engine, and it is sure that it is a JavaScript object.
 
   Each state keep all necessary information to invoke all methods, if not it should be changed to
@@ -117,14 +117,14 @@
 
 private:
     // Please, update class documentation when you change the enum.
-    enum States {
+    enum State {
         Invalid = 0,
         CString = 0x1000,
         CNumber,
         CBool,
         CSpecial,
         JSValue = 0x2000, // JS values are equal or higher then this value.
-        JSNative,
+        JSPrimitive,
         JSObject
     } m_state;
     QScriptEnginePtr m_engine;
@@ -136,6 +136,7 @@
     inline void setValue(JSValueRef);
 
     inline bool inherits(const char*);
+    inline State refinedJSValue();
 
     inline bool isJSBased() const;
     inline bool isNumberBased() const;
@@ -209,7 +210,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, bool value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -224,7 +225,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, int value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -239,7 +240,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, uint value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -254,7 +255,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, qsreal value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -269,7 +270,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, const QString& value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -284,7 +285,7 @@
 }
 
 QScriptValuePrivate::QScriptValuePrivate(const QScriptEngine* engine, QScriptValue::SpecialValue value)
-    : m_state(JSNative)
+    : m_state(JSPrimitive)
 {
     if (!engine) {
         // slower path reinitialization
@@ -325,10 +326,10 @@
     case CBool:
         return true;
     case JSValue:
-        if (isObject())
+        if (refinedJSValue() != JSPrimitive)
             return false;
         // Fall-through.
-    case JSNative:
+    case JSPrimitive:
         return JSValueIsBoolean(context(), value());
     default:
         return false;
@@ -341,10 +342,10 @@
     case CNumber:
         return true;
     case JSValue:
-        if (isObject())
+        if (refinedJSValue() != JSPrimitive)
             return false;
         // Fall-through.
-    case JSNative:
+    case JSPrimitive:
         return JSValueIsNumber(context(), value());
     default:
         return false;
@@ -357,10 +358,10 @@
     case CSpecial:
         return m_number == static_cast<int>(QScriptValue::NullValue);
     case JSValue:
-        if (isObject())
+        if (refinedJSValue() != JSPrimitive)
             return false;
         // Fall-through.
-    case JSNative:
+    case JSPrimitive:
         return JSValueIsNull(context(), value());
     default:
         return false;
@@ -373,10 +374,10 @@
     case CString:
         return true;
     case JSValue:
-        if (isObject())
+        if (refinedJSValue() != JSPrimitive)
             return false;
         // Fall-through.
-    case JSNative:
+    case JSPrimitive:
         return JSValueIsString(context(), value());
     default:
         return false;
@@ -389,10 +390,10 @@
     case CSpecial:
         return m_number == static_cast<int>(QScriptValue::UndefinedValue);
     case JSValue:
-        if (isObject())
+        if (refinedJSValue() != JSPrimitive)
             return false;
         // Fall-through.
-    case JSNative:
+    case JSPrimitive:
         return JSValueIsUndefined(context(), value());
     default:
         return false;
@@ -403,7 +404,7 @@
 {
     switch (m_state) {
     case JSValue:
-        if (!isObject())
+        if (refinedJSValue() != JSObject)
             return false;
         // Fall-through.
     case JSObject:
@@ -416,14 +417,11 @@
 bool QScriptValuePrivate::isObject()
 {
     switch (m_state) {
+    case JSValue:
+        return refinedJSValue() == JSObject;
     case JSObject:
         return true;
-    case JSValue:
-        m_object = JSValueToObject(context(), value(), /* exception */ 0);
-        if (!m_object)
-            return false;
-        m_state = JSObject;
-        return true;
+
     default:
         return false;
     }
@@ -433,10 +431,8 @@
 {
     switch (m_state) {
     case JSValue:
-        m_object = JSValueToObject(context(), value(), /* exception */ 0);
-        if (!m_object)
+        if (refinedJSValue() != JSObject)
             return false;
-        m_state = JSObject;
         // Fall-through.
     case JSObject:
         return JSObjectIsFunction(context(), object());
@@ -455,11 +451,11 @@
     case CString:
         return m_string;
     case CNumber:
-        return QString::number(m_number);
+        return QScriptConverter::toString(m_number);
     case CSpecial:
         return m_number == QScriptValue::NullValue ? QString::fromLatin1("null") : QString::fromLatin1("undefined");
     case JSValue:
-    case JSNative:
+    case JSPrimitive:
     case JSObject:
         return QScriptConverter::toString(JSValueToStringCopy(context(), value(), /* exception */ 0));
     }
@@ -472,7 +468,7 @@
 {
     switch (m_state) {
     case JSValue:
-    case JSNative:
+    case JSPrimitive:
     case JSObject:
         return JSValueToNumber(context(), value(), /* exception */ 0);
     case CNumber:
@@ -504,7 +500,7 @@
 {
     switch (m_state) {
     case JSValue:
-    case JSNative:
+    case JSPrimitive:
         return JSValueToBoolean(context(), value());
     case JSObject:
         return true;
@@ -631,7 +627,7 @@
         return false;
     }
     m_engine = engine;
-    m_state = JSNative;
+    m_state = JSPrimitive;
     setValue(value);
     return true;
 }
@@ -640,12 +636,8 @@
 {
     switch (m_state) {
     case JSValue:
-        m_object = JSValueToObject(context(), value(), /* exception */ 0);
-        if (!object()) {
-            m_state = JSValue;
+        if (refinedJSValue() != JSObject)
             return new QScriptValuePrivate;
-        }
-        m_state = JSObject;
         // Fall-through.
     case JSObject:
         {
@@ -719,12 +711,32 @@
 {
     Q_ASSERT(isJSBased());
     JSObjectRef globalObject = JSContextGetGlobalObject(context());
-    JSValueRef error = JSObjectGetProperty(context(), globalObject, QScriptConverter::toString(name), 0);
+    JSStringRef errorAttrName = QScriptConverter::toString(name);
+    JSValueRef error = JSObjectGetProperty(context(), globalObject, errorAttrName, /* exception */ 0);
+    JSStringRelease(errorAttrName);
     return JSValueIsInstanceOfConstructor(context(), value(), JSValueToObject(context(), error, /* exception */ 0), /* exception */ 0);
 }
 
 /*!
   \internal
+  Refines the state of this QScriptValuePrivate. Returns the new state.
+*/
+QScriptValuePrivate::State QScriptValuePrivate::refinedJSValue()
+{
+    Q_ASSERT(m_state == JSValue);
+    if (!JSValueIsObject(context(), value())) {
+        m_state = JSPrimitive;
+    } else {
+        m_state = JSObject;
+        // We are sure that value is an JSObject, so we can const_cast safely without
+        // calling JSC C API (JSValueToObject(context(), value(), /* exceptions */ 0)).
+        m_object = const_cast<JSObjectRef>(m_value);
+    }
+    return m_state;
+}
+
+/*!
+  \internal
   Returns true if QSV have an engine associated.
 */
 bool QScriptValuePrivate::isJSBased() const { return m_state >= JSValue; }
diff --git a/JavaScriptCore/qt/tests/qscriptengine/qscriptengine.pro b/JavaScriptCore/qt/tests/qscriptengine/qscriptengine.pro
index 0dc0902..d521dd8 100644
--- a/JavaScriptCore/qt/tests/qscriptengine/qscriptengine.pro
+++ b/JavaScriptCore/qt/tests/qscriptengine/qscriptengine.pro
@@ -1,6 +1,7 @@
 TEMPLATE = app
 TARGET = tst_qscriptengine
 QT += testlib
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
 
 SOURCES += tst_qscriptengine.cpp
diff --git a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
index b36e364..1ec9ad3 100644
--- a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
+++ b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
@@ -18,6 +18,8 @@
 */
 
 #include "qscriptengine.h"
+#include "qscriptprogram.h"
+#include "qscriptsyntaxcheckresult.h"
 #include "qscriptvalue.h"
 #include <QtTest/qtest.h>
 
@@ -33,10 +35,15 @@
     void cleanup() {}
 
 private slots:
+    void globalObject();
     void evaluate();
     void collectGarbage();
+    void reportAdditionalMemoryCost();
     void nullValue();
     void undefinedValue();
+    void evaluateProgram();
+    void checkSyntax_data();
+    void checkSyntax();
 };
 
 /* Evaluating a script that throw an unhandled exception should return an invalid value. */
@@ -47,6 +54,17 @@
     QVERIFY2(engine.evaluate("ping").isValid(), "Script throwing an unhandled exception should return an exception value");
 }
 
+void tst_QScriptEngine::globalObject()
+{
+    QScriptEngine engine;
+    QScriptValue global = engine.globalObject();
+    QScriptValue self = engine.evaluate("this");
+    QVERIFY(global.isObject());
+    QVERIFY(engine.globalObject().equals(engine.evaluate("this")));
+    QEXPECT_FAIL("", "strictlyEquals is broken - bug 36600 in bugs.webkit.org", Continue);
+    QVERIFY(engine.globalObject().strictlyEquals(self));
+}
+
 /* Test garbage collection, at least try to not crash. */
 void tst_QScriptEngine::collectGarbage()
 {
@@ -57,6 +75,26 @@
     QCOMPARE(foo.call().toString(), QString::fromAscii("pong"));
 }
 
+void tst_QScriptEngine::reportAdditionalMemoryCost()
+{
+    // There isn't any easy way to test the responsiveness of the GC;
+    // just try to call the function a few times with various sizes.
+    QScriptEngine eng;
+    for (int i = 0; i < 100; ++i) {
+        eng.reportAdditionalMemoryCost(0);
+        eng.reportAdditionalMemoryCost(10);
+        eng.reportAdditionalMemoryCost(1000);
+        eng.reportAdditionalMemoryCost(10000);
+        eng.reportAdditionalMemoryCost(100000);
+        eng.reportAdditionalMemoryCost(1000000);
+        eng.reportAdditionalMemoryCost(10000000);
+        eng.reportAdditionalMemoryCost(-1);
+        eng.reportAdditionalMemoryCost(-1000);
+        QScriptValue obj = eng.evaluate("new Object");
+        eng.collectGarbage();
+    }
+}
+
 void tst_QScriptEngine::nullValue()
 {
     QScriptEngine engine;
@@ -73,5 +111,198 @@
     QVERIFY(value.isUndefined());
 }
 
+void tst_QScriptEngine::evaluateProgram()
+{
+    QScriptEngine eng;
+    {
+        QString code("1 + 2");
+        QString fileName("hello.js");
+        int lineNumber = 123;
+        QScriptProgram program(code, fileName, lineNumber);
+        QVERIFY(!program.isNull());
+        QCOMPARE(program.sourceCode(), code);
+        QCOMPARE(program.fileName(), fileName);
+        QCOMPARE(program.firstLineNumber(), lineNumber);
+
+        QScriptValue expected = eng.evaluate(code);
+        for (int x = 0; x < 10; ++x) {
+            QScriptValue ret = eng.evaluate(program);
+            QVERIFY(ret.equals(expected));
+        }
+
+        // operator=
+        QScriptProgram sameProgram = program;
+        QVERIFY(sameProgram == program);
+        QVERIFY(eng.evaluate(sameProgram).equals(expected));
+
+        // copy constructor
+        QScriptProgram sameProgram2(program);
+        QVERIFY(sameProgram2 == program);
+        QVERIFY(eng.evaluate(sameProgram2).equals(expected));
+
+        QScriptProgram differentProgram("2 + 3");
+        QVERIFY(differentProgram != program);
+        QVERIFY(!eng.evaluate(differentProgram).equals(expected));
+    }
+
+    // Program that accesses variable in the scope
+    {
+        QScriptProgram program("a");
+        QVERIFY(!program.isNull());
+        {
+            QScriptValue ret = eng.evaluate(program);
+            QVERIFY(ret.isError());
+            QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: Can't find variable: a"));
+        }
+        {
+            QScriptValue ret = eng.evaluate(program);
+            QVERIFY(ret.isError());
+        }
+        eng.evaluate("a = 456");
+        {
+            QScriptValue ret = eng.evaluate(program);
+            QVERIFY(!ret.isError());
+            QCOMPARE(ret.toNumber(), 456.0);
+        }
+    }
+
+    // Program that creates closure
+    {
+        QScriptProgram program("(function() { var count = 0; return function() { return count++; }; })");
+        QVERIFY(!program.isNull());
+        QScriptValue createCounter = eng.evaluate(program);
+        QVERIFY(createCounter.isFunction());
+        QScriptValue counter = createCounter.call();
+        QVERIFY(counter.isFunction());
+        {
+            QScriptValue ret = counter.call();
+            QVERIFY(ret.isNumber());
+        }
+        QScriptValue counter2 = createCounter.call();
+        QVERIFY(counter2.isFunction());
+        QVERIFY(!counter2.equals(counter));
+        {
+            QScriptValue ret = counter2.call();
+            QVERIFY(ret.isNumber());
+        }
+    }
+
+    // Same program run in different engines
+    {
+        QString code("1 + 2");
+        QScriptProgram program(code);
+        QVERIFY(!program.isNull());
+        double expected = eng.evaluate(program).toNumber();
+        for (int x = 0; x < 2; ++x) {
+            QScriptEngine eng2;
+            for (int y = 0; y < 2; ++y) {
+                double ret = eng2.evaluate(program).toNumber();
+                QCOMPARE(ret, expected);
+            }
+        }
+    }
+
+    // No program
+    {
+        QScriptProgram program;
+        QVERIFY(program.isNull());
+        QScriptValue ret = eng.evaluate(program);
+        QVERIFY(!ret.isValid());
+    }
+}
+
+void tst_QScriptEngine::checkSyntax_data()
+{
+    QTest::addColumn<QString>("code");
+    QTest::addColumn<int>("expectedState");
+    QTest::addColumn<int>("errorLineNumber");
+    QTest::addColumn<int>("errorColumnNumber");
+    QTest::addColumn<QString>("errorMessage");
+
+    QTest::newRow("0")
+        << QString("0") << int(QScriptSyntaxCheckResult::Valid)
+        << -1 << -1 << "";
+    QTest::newRow("if (")
+        << QString("if (\n") << int(QScriptSyntaxCheckResult::Intermediate)
+        << 1 << 4 << "";
+    QTest::newRow("if else")
+        << QString("\nif else") << int(QScriptSyntaxCheckResult::Error)
+        << 2 << 4 << "SyntaxError: Parse error";
+    QTest::newRow("{if}")
+            << QString("{\n{\nif\n}\n") << int(QScriptSyntaxCheckResult::Error)
+        << 4 << 1 << "SyntaxError: Parse error";
+    QTest::newRow("foo[")
+        << QString("foo[") << int(QScriptSyntaxCheckResult::Error)
+        << 1 << 4 << "SyntaxError: Parse error";
+    QTest::newRow("foo['bar']")
+        << QString("foo['bar']") << int(QScriptSyntaxCheckResult::Valid)
+        << -1 << -1 << "";
+
+    QTest::newRow("/*")
+        << QString("/*") << int(QScriptSyntaxCheckResult::Intermediate)
+        << 1 << 1 << "Unclosed comment at end of file";
+    QTest::newRow("/*\nMy comment")
+        << QString("/*\nMy comment") << int(QScriptSyntaxCheckResult::Intermediate)
+        << 1 << 1 << "Unclosed comment at end of file";
+    QTest::newRow("/*\nMy comment */\nfoo = 10")
+        << QString("/*\nMy comment */\nfoo = 10") << int(QScriptSyntaxCheckResult::Valid)
+        << -1 << -1 << "";
+    QTest::newRow("foo = 10 /*")
+        << QString("foo = 10 /*") << int(QScriptSyntaxCheckResult::Intermediate)
+        << -1 << -1 << "";
+    QTest::newRow("foo = 10; /*")
+        << QString("foo = 10; /*") << int(QScriptSyntaxCheckResult::Intermediate)
+        << 1 << 11 << "Expected `end of file'";
+    QTest::newRow("foo = 10 /* My comment */")
+        << QString("foo = 10 /* My comment */") << int(QScriptSyntaxCheckResult::Valid)
+        << -1 << -1 << "";
+
+    QTest::newRow("/=/")
+        << QString("/=/") << int(QScriptSyntaxCheckResult::Valid) << -1 << -1 << "";
+    QTest::newRow("/=/g")
+        << QString("/=/g") << int(QScriptSyntaxCheckResult::Valid) << -1 << -1 << "";
+    QTest::newRow("/a/")
+        << QString("/a/") << int(QScriptSyntaxCheckResult::Valid) << -1 << -1 << "";
+    QTest::newRow("/a/g")
+        << QString("/a/g") << int(QScriptSyntaxCheckResult::Valid) << -1 << -1 << "";
+}
+
+void tst_QScriptEngine::checkSyntax()
+{
+    QFETCH(QString, code);
+    QFETCH(int, expectedState);
+    QFETCH(int, errorLineNumber);
+    QFETCH(int, errorColumnNumber);
+    QFETCH(QString, errorMessage);
+
+    QScriptSyntaxCheckResult result = QScriptEngine::checkSyntax(code);
+
+    // assignment
+    {
+        QScriptSyntaxCheckResult copy = result;
+        QCOMPARE(copy.state(), result.state());
+        QCOMPARE(copy.errorLineNumber(), result.errorLineNumber());
+        QCOMPARE(copy.errorColumnNumber(), result.errorColumnNumber());
+        QCOMPARE(copy.errorMessage(), result.errorMessage());
+    }
+    {
+        QScriptSyntaxCheckResult copy(result);
+        QCOMPARE(copy.state(), result.state());
+        QCOMPARE(copy.errorLineNumber(), result.errorLineNumber());
+        QCOMPARE(copy.errorColumnNumber(), result.errorColumnNumber());
+        QCOMPARE(copy.errorMessage(), result.errorMessage());
+    }
+
+    if (expectedState == QScriptSyntaxCheckResult::Intermediate)
+        QEXPECT_FAIL("", "QScriptSyntaxCheckResult::state() doesn't return the Intermediate state", Abort);
+    QCOMPARE(result.state(), QScriptSyntaxCheckResult::State(expectedState));
+    QCOMPARE(result.errorLineNumber(), errorLineNumber);
+    if (expectedState != QScriptSyntaxCheckResult::Valid && errorColumnNumber != 1)
+            QEXPECT_FAIL("", "QScriptSyntaxCheckResult::errorColumnNumber() doesn't return correct value", Continue);
+    QCOMPARE(result.errorColumnNumber(), errorColumnNumber);
+    QCOMPARE(result.errorMessage(), errorMessage);
+}
+
+
 QTEST_MAIN(tst_QScriptEngine)
 #include "tst_qscriptengine.moc"
diff --git a/JavaScriptCore/qt/tests/qscriptstring/qscriptstring.pro b/JavaScriptCore/qt/tests/qscriptstring/qscriptstring.pro
new file mode 100644
index 0000000..5ad9b7c
--- /dev/null
+++ b/JavaScriptCore/qt/tests/qscriptstring/qscriptstring.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+TARGET = tst_qscriptstring
+QT += testlib
+include(../tests.pri)
+
+SOURCES += tst_qscriptstring.cpp
+
diff --git a/JavaScriptCore/qt/tests/qscriptstring/tst_qscriptstring.cpp b/JavaScriptCore/qt/tests/qscriptstring/tst_qscriptstring.cpp
new file mode 100644
index 0000000..ff31835
--- /dev/null
+++ b/JavaScriptCore/qt/tests/qscriptstring/tst_qscriptstring.cpp
@@ -0,0 +1,175 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 tst_qscriptstring_h
+#define tst_qscriptstring_h
+
+#include "qscriptengine.h"
+#include "qscriptstring.h"
+#include <QtCore/qhash.h>
+#include <QtTest/QtTest>
+
+class tst_QScriptString : public QObject {
+    Q_OBJECT
+
+public:
+    tst_QScriptString();
+    virtual ~tst_QScriptString();
+
+private slots:
+    void test();
+    void hash();
+    void toArrayIndex_data();
+    void toArrayIndex();
+};
+
+tst_QScriptString::tst_QScriptString()
+{
+}
+
+tst_QScriptString::~tst_QScriptString()
+{
+}
+
+void tst_QScriptString::test()
+{
+    QScriptEngine eng;
+    {
+        QScriptString str;
+        QVERIFY(!str.isValid());
+        QVERIFY(str == str);
+        QVERIFY(!(str != str));
+        QVERIFY(str.toString().isNull());
+
+        QScriptString str1(str);
+        QVERIFY(!str1.isValid());
+
+        QScriptString str2 = str;
+        QVERIFY(!str2.isValid());
+
+        QCOMPARE(str.toArrayIndex(), quint32(0xffffffff));
+    }
+    for (int x = 0; x < 2; ++x) {
+        QString ciao = QString::fromLatin1("ciao");
+        QScriptString str = eng.toStringHandle(ciao);
+        QVERIFY(str.isValid());
+        QVERIFY(str == str);
+        QVERIFY(!(str != str));
+        QCOMPARE(str.toString(), ciao);
+
+        QScriptString str1(str);
+        QCOMPARE(str, str1);
+
+        QScriptString str2 = str;
+        QCOMPARE(str, str2);
+
+        QScriptString str3 = eng.toStringHandle(ciao);
+        QVERIFY(str3.isValid());
+        QCOMPARE(str, str3);
+
+        eng.collectGarbage();
+
+        QVERIFY(str.isValid());
+        QCOMPARE(str.toString(), ciao);
+        QVERIFY(str1.isValid());
+        QCOMPARE(str1.toString(), ciao);
+        QVERIFY(str2.isValid());
+        QCOMPARE(str2.toString(), ciao);
+        QVERIFY(str3.isValid());
+        QCOMPARE(str3.toString(), ciao);
+    }
+    {
+        QScriptEngine* eng2 = new QScriptEngine;
+        QString one = QString::fromLatin1("one");
+        QString two = QString::fromLatin1("two");
+        QScriptString oneInterned = eng2->toStringHandle(one);
+        QCOMPARE(oneInterned.toString(), one);
+        QScriptString twoInterned = eng2->toStringHandle(two);
+        QCOMPARE(twoInterned.toString(), two);
+        QVERIFY(oneInterned != twoInterned);
+        QVERIFY(!(oneInterned == twoInterned));
+
+        delete eng2;
+    }
+}
+
+void tst_QScriptString::hash()
+{
+    QScriptEngine engine;
+    QHash<QScriptString, int> stringToInt;
+    QScriptString foo = engine.toStringHandle("foo");
+
+    QScriptString bar = engine.toStringHandle("bar");
+    QVERIFY(!stringToInt.contains(foo));
+    for (int i = 0; i < 1000000; ++i)
+        stringToInt.insert(foo, 123);
+    QCOMPARE(stringToInt.value(foo), 123);
+    QVERIFY(!stringToInt.contains(bar));
+    stringToInt.insert(bar, 456);
+    QCOMPARE(stringToInt.value(bar), 456);
+    QCOMPARE(stringToInt.value(foo), 123);
+}
+
+void tst_QScriptString::toArrayIndex_data()
+{
+    QTest::addColumn<QString>("input");
+    QTest::addColumn<bool>("expectSuccess");
+    QTest::addColumn<quint32>("expectedIndex");
+    QTest::newRow("foo") << QString::fromLatin1("foo") << false << quint32(0xffffffff);
+    QTest::newRow("empty") << QString::fromLatin1("") << false << quint32(0xffffffff);
+    QTest::newRow("0") << QString::fromLatin1("0") << true << quint32(0);
+    QTest::newRow("00") << QString::fromLatin1("00") << false << quint32(0xffffffff);
+    QTest::newRow("1") << QString::fromLatin1("1") << true << quint32(1);
+    QTest::newRow("123") << QString::fromLatin1("123") << true << quint32(123);
+    QTest::newRow("-1") << QString::fromLatin1("-1") << false << quint32(0xffffffff);
+    QTest::newRow("0a") << QString::fromLatin1("0a") << false << quint32(0xffffffff);
+    QTest::newRow("0x1") << QString::fromLatin1("0x1") << false << quint32(0xffffffff);
+    QTest::newRow("01") << QString::fromLatin1("01") << false << quint32(0xffffffff);
+    QTest::newRow("101a") << QString::fromLatin1("101a") << false << quint32(0xffffffff);
+    QTest::newRow("4294967294") << QString::fromLatin1("4294967294") << true << quint32(0xfffffffe);
+    QTest::newRow("4294967295") << QString::fromLatin1("4294967295") << false << quint32(0xffffffff);
+    QTest::newRow("11111111111") << QString::fromLatin1("11111111111") << false << quint32(0xffffffff);
+    QTest::newRow("0.0") << QString::fromLatin1("0.0") << false << quint32(0xffffffff);
+    QTest::newRow("1.0") << QString::fromLatin1("1.0") << false << quint32(0xffffffff);
+    QTest::newRow("1.5") << QString::fromLatin1("1.5") << false << quint32(0xffffffff);
+    QTest::newRow("1.") << QString::fromLatin1("1.") << false << quint32(0xffffffff);
+    QTest::newRow(".1") << QString::fromLatin1(".1") << false << quint32(0xffffffff);
+    QTest::newRow("1e0") << QString::fromLatin1("1e0") << false << quint32(0xffffffff);
+}
+
+void tst_QScriptString::toArrayIndex()
+{
+    QFETCH(QString, input);
+    QFETCH(bool, expectSuccess);
+    QFETCH(quint32, expectedIndex);
+    QScriptEngine engine;
+    for (int x = 0; x < 2; ++x) {
+        bool isArrayIndex;
+        bool* ptr = (!x) ? &isArrayIndex : (bool*)0;
+        quint32 result = engine.toStringHandle(input).toArrayIndex(ptr);
+        if (!x)
+            QCOMPARE(isArrayIndex, expectSuccess);
+        QCOMPARE(result, expectedIndex);
+    }
+}
+
+QTEST_MAIN(tst_QScriptString)
+#include "tst_qscriptstring.moc"
+
+#endif // tst_qscriptstring_h
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/qscriptvalue.pro b/JavaScriptCore/qt/tests/qscriptvalue/qscriptvalue.pro
index b12337f..35cc17d 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/qscriptvalue.pro
+++ b/JavaScriptCore/qt/tests/qscriptvalue/qscriptvalue.pro
@@ -1,6 +1,7 @@
 TEMPLATE = app
 TARGET = tst_qscriptvalue
 QT += testlib
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
 
 SOURCES += \
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
index b44c5ca..82f0901 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
@@ -274,7 +274,7 @@
     QVERIFY(QScriptValue(0, QString("ciao")).isString());
 }
 
-void tst_QScriptValue::toString_data()
+void tst_QScriptValue::toStringSimple_data()
 {
     QTest::addColumn<QString>("code");
     QTest::addColumn<QString>("result");
@@ -289,7 +289,7 @@
 }
 
 /* Test conversion to string from different JSC types */
-void tst_QScriptValue::toString()
+void tst_QScriptValue::toStringSimple()
 {
     QFETCH(QString, code);
     QFETCH(QString, result);
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
index 1b3c657..28154a9 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
@@ -36,8 +36,8 @@
     virtual ~tst_QScriptValue();
 
 private slots:
-    void toString_data();
-    void toString();
+    void toStringSimple_data();
+    void toStringSimple();
     void copyConstructor_data();
     void copyConstructor();
     void assignOperator_data();
@@ -76,6 +76,9 @@
     void isValid_data();
     void isValid();
 
+    void toString_data();
+    void toString();
+
     void toNumber_data();
     void toNumber();
 
@@ -146,6 +149,10 @@
     void isValid_makeData(const char* expr);
     void isValid_test(const char* expr, const QScriptValue& value);
 
+    void toString_initData();
+    void toString_makeData(const char*);
+    void toString_test(const char*, const QScriptValue&);
+
     void toNumber_initData();
     void toNumber_makeData(const char*);
     void toNumber_test(const char*, const QScriptValue&);
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp
index 006b343..970c960 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp
@@ -130,6 +130,35 @@
     DEFINE_TEST_VALUE(engine->evaluate("new Object()"));
     DEFINE_TEST_VALUE(engine->evaluate("new Array()"));
     DEFINE_TEST_VALUE(engine->evaluate("new Error()"));
+    DEFINE_TEST_VALUE(engine->evaluate("a = new Object(); a.foo = 22; a.foo"));
+    DEFINE_TEST_VALUE(engine->evaluate("Undefined"));
+    DEFINE_TEST_VALUE(engine->evaluate("Null"));
+    DEFINE_TEST_VALUE(engine->evaluate("True"));
+    DEFINE_TEST_VALUE(engine->evaluate("False"));
+    DEFINE_TEST_VALUE(engine->evaluate("undefined"));
+    DEFINE_TEST_VALUE(engine->evaluate("null"));
+    DEFINE_TEST_VALUE(engine->evaluate("true"));
+    DEFINE_TEST_VALUE(engine->evaluate("false"));
+    DEFINE_TEST_VALUE(engine->evaluate("122"));
+    DEFINE_TEST_VALUE(engine->evaluate("124"));
+    DEFINE_TEST_VALUE(engine->evaluate("0"));
+    DEFINE_TEST_VALUE(engine->evaluate("0.0"));
+    DEFINE_TEST_VALUE(engine->evaluate("123.0"));
+    DEFINE_TEST_VALUE(engine->evaluate("6.37e-8"));
+    DEFINE_TEST_VALUE(engine->evaluate("-6.37e-8"));
+    DEFINE_TEST_VALUE(engine->evaluate("0x43211234"));
+    DEFINE_TEST_VALUE(engine->evaluate("0x10000"));
+    DEFINE_TEST_VALUE(engine->evaluate("0x10001"));
+    DEFINE_TEST_VALUE(engine->evaluate("NaN"));
+    DEFINE_TEST_VALUE(engine->evaluate("Infinity"));
+    DEFINE_TEST_VALUE(engine->evaluate("-Infinity"));
+    DEFINE_TEST_VALUE(engine->evaluate("'ciao'"));
+    DEFINE_TEST_VALUE(engine->evaluate("''"));
+    DEFINE_TEST_VALUE(engine->evaluate("'0'"));
+    DEFINE_TEST_VALUE(engine->evaluate("'123'"));
+    DEFINE_TEST_VALUE(engine->evaluate("'12.4'"));
+    DEFINE_TEST_VALUE(engine->nullValue());
+    DEFINE_TEST_VALUE(engine->undefinedValue());
 }
 
 
@@ -244,7 +273,36 @@
                 << "engine->evaluate(\"/foo/\")"
                 << "engine->evaluate(\"new Object()\")"
                 << "engine->evaluate(\"new Array()\")"
-                << "engine->evaluate(\"new Error()\")";
+                << "engine->evaluate(\"new Error()\")"
+                << "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"
+                << "engine->evaluate(\"Undefined\")"
+                << "engine->evaluate(\"Null\")"
+                << "engine->evaluate(\"True\")"
+                << "engine->evaluate(\"False\")"
+                << "engine->evaluate(\"undefined\")"
+                << "engine->evaluate(\"null\")"
+                << "engine->evaluate(\"true\")"
+                << "engine->evaluate(\"false\")"
+                << "engine->evaluate(\"122\")"
+                << "engine->evaluate(\"124\")"
+                << "engine->evaluate(\"0\")"
+                << "engine->evaluate(\"0.0\")"
+                << "engine->evaluate(\"123.0\")"
+                << "engine->evaluate(\"6.37e-8\")"
+                << "engine->evaluate(\"-6.37e-8\")"
+                << "engine->evaluate(\"0x43211234\")"
+                << "engine->evaluate(\"0x10000\")"
+                << "engine->evaluate(\"0x10001\")"
+                << "engine->evaluate(\"NaN\")"
+                << "engine->evaluate(\"Infinity\")"
+                << "engine->evaluate(\"-Infinity\")"
+                << "engine->evaluate(\"'ciao'\")"
+                << "engine->evaluate(\"''\")"
+                << "engine->evaluate(\"'0'\")"
+                << "engine->evaluate(\"'123'\")"
+                << "engine->evaluate(\"'12.4'\")"
+                << "engine->nullValue()"
+                << "engine->undefinedValue()";
     }
     newRow(expr) << isValid.contains(expr);
 }
@@ -253,6 +311,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isValid(), expected);
+    QCOMPARE(value.isValid(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isValid)
@@ -273,7 +332,9 @@
                 << "QScriptValue(0, true)"
                 << "QScriptValue(0, false)"
                 << "QScriptValue(engine, true)"
-                << "QScriptValue(engine, false)";
+                << "QScriptValue(engine, false)"
+                << "engine->evaluate(\"true\")"
+                << "engine->evaluate(\"false\")";
     }
     newRow(expr) << isBool.contains(expr);
 }
@@ -282,6 +343,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isBool(), expected);
+    QCOMPARE(value.isBool(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isBool)
@@ -302,7 +364,9 @@
                 << "QScriptValue(0, true)"
                 << "QScriptValue(0, false)"
                 << "QScriptValue(engine, true)"
-                << "QScriptValue(engine, false)";
+                << "QScriptValue(engine, false)"
+                << "engine->evaluate(\"true\")"
+                << "engine->evaluate(\"false\")";
     }
     newRow(expr) << isBoolean.contains(expr);
 }
@@ -311,10 +375,12 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isBoolean(), expected);
+    QCOMPARE(value.isBoolean(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isBoolean)
 
+
 void tst_QScriptValue::isNumber_initData()
 {
     QTest::addColumn<bool>("expected");
@@ -366,7 +432,21 @@
                 << "QScriptValue(engine, qSNaN())"
                 << "QScriptValue(engine, qQNaN())"
                 << "QScriptValue(engine, qInf())"
-                << "QScriptValue(engine, -qInf())";
+                << "QScriptValue(engine, -qInf())"
+                << "engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")"
+                << "engine->evaluate(\"122\")"
+                << "engine->evaluate(\"124\")"
+                << "engine->evaluate(\"0\")"
+                << "engine->evaluate(\"0.0\")"
+                << "engine->evaluate(\"123.0\")"
+                << "engine->evaluate(\"6.37e-8\")"
+                << "engine->evaluate(\"-6.37e-8\")"
+                << "engine->evaluate(\"0x43211234\")"
+                << "engine->evaluate(\"0x10000\")"
+                << "engine->evaluate(\"0x10001\")"
+                << "engine->evaluate(\"NaN\")"
+                << "engine->evaluate(\"Infinity\")"
+                << "engine->evaluate(\"-Infinity\")";
     }
     newRow(expr) << isNumber.contains(expr);
 }
@@ -375,6 +455,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isNumber(), expected);
+    QCOMPARE(value.isNumber(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isNumber)
@@ -407,6 +488,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isFunction(), expected);
+    QCOMPARE(value.isFunction(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isFunction)
@@ -424,7 +506,9 @@
     if (isNull.isEmpty()) {
         isNull << "QScriptValue(QScriptValue::NullValue)"
                 << "QScriptValue(0, QScriptValue::NullValue)"
-                << "QScriptValue(engine, QScriptValue::NullValue)";
+                << "QScriptValue(engine, QScriptValue::NullValue)"
+                << "engine->evaluate(\"null\")"
+                << "engine->nullValue()";
     }
     newRow(expr) << isNull.contains(expr);
 }
@@ -433,6 +517,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isNull(), expected);
+    QCOMPARE(value.isNull(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isNull)
@@ -477,7 +562,12 @@
                 << "QScriptValue(engine, QString())"
                 << "QScriptValue(engine, QString(\"0\"))"
                 << "QScriptValue(engine, QString(\"123\"))"
-                << "QScriptValue(engine, QString(\"1.23\"))";
+                << "QScriptValue(engine, QString(\"1.23\"))"
+                << "engine->evaluate(\"'ciao'\")"
+                << "engine->evaluate(\"''\")"
+                << "engine->evaluate(\"'0'\")"
+                << "engine->evaluate(\"'123'\")"
+                << "engine->evaluate(\"'12.4'\")";
     }
     newRow(expr) << isString.contains(expr);
 }
@@ -486,6 +576,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isString(), expected);
+    QCOMPARE(value.isString(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isString)
@@ -504,7 +595,9 @@
         isUndefined << "QScriptValue(QScriptValue::UndefinedValue)"
                 << "QScriptValue(0, QScriptValue::UndefinedValue)"
                 << "QScriptValue(engine, QScriptValue::UndefinedValue)"
-                << "engine->evaluate(\"{}\")";
+                << "engine->evaluate(\"{}\")"
+                << "engine->evaluate(\"undefined\")"
+                << "engine->undefinedValue()";
     }
     newRow(expr) << isUndefined.contains(expr);
 }
@@ -513,10 +606,15 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isUndefined(), expected);
+    QCOMPARE(value.isUndefined(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isUndefined)
 
+
+
+
+
 void tst_QScriptValue::isObject_initData()
 {
     QTest::addColumn<bool>("expected");
@@ -543,7 +641,11 @@
                 << "engine->evaluate(\"/foo/\")"
                 << "engine->evaluate(\"new Object()\")"
                 << "engine->evaluate(\"new Array()\")"
-                << "engine->evaluate(\"new Error()\")";
+                << "engine->evaluate(\"new Error()\")"
+                << "engine->evaluate(\"Undefined\")"
+                << "engine->evaluate(\"Null\")"
+                << "engine->evaluate(\"True\")"
+                << "engine->evaluate(\"False\")";
     }
     newRow(expr) << isObject.contains(expr);
 }
@@ -552,10 +654,168 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.isObject(), expected);
+    QCOMPARE(value.isObject(), expected);
 }
 
 DEFINE_TEST_FUNCTION(isObject)
 
+
+void tst_QScriptValue::toString_initData()
+{
+    QTest::addColumn<QString>("expected");
+    initScriptValues();
+}
+
+void tst_QScriptValue::toString_makeData(const char* expr)
+{
+    static QHash<QString, QString> toString;
+    if (toString.isEmpty()) {
+        toString.insert("QScriptValue()", "");
+        toString.insert("QScriptValue(QScriptValue::UndefinedValue)", "undefined");
+        toString.insert("QScriptValue(QScriptValue::NullValue)", "null");
+        toString.insert("QScriptValue(true)", "true");
+        toString.insert("QScriptValue(false)", "false");
+        toString.insert("QScriptValue(int(122))", "122");
+        toString.insert("QScriptValue(uint(124))", "124");
+        toString.insert("QScriptValue(0)", "0");
+        toString.insert("QScriptValue(0.0)", "0");
+        toString.insert("QScriptValue(123.0)", "123");
+        toString.insert("QScriptValue(6.37e-8)", "6.37e-8");
+        toString.insert("QScriptValue(-6.37e-8)", "-6.37e-8");
+        toString.insert("QScriptValue(0x43211234)", "1126240820");
+        toString.insert("QScriptValue(0x10000)", "65536");
+        toString.insert("QScriptValue(0x10001)", "65537");
+        toString.insert("QScriptValue(qSNaN())", "NaN");
+        toString.insert("QScriptValue(qQNaN())", "NaN");
+        toString.insert("QScriptValue(qInf())", "Infinity");
+        toString.insert("QScriptValue(-qInf())", "-Infinity");
+        toString.insert("QScriptValue(\"NaN\")", "NaN");
+        toString.insert("QScriptValue(\"Infinity\")", "Infinity");
+        toString.insert("QScriptValue(\"-Infinity\")", "-Infinity");
+        toString.insert("QScriptValue(\"ciao\")", "ciao");
+        toString.insert("QScriptValue(QString::fromLatin1(\"ciao\"))", "ciao");
+        toString.insert("QScriptValue(QString(\"\"))", "");
+        toString.insert("QScriptValue(QString())", "");
+        toString.insert("QScriptValue(QString(\"0\"))", "0");
+        toString.insert("QScriptValue(QString(\"123\"))", "123");
+        toString.insert("QScriptValue(QString(\"12.4\"))", "12.4");
+        toString.insert("QScriptValue(0, QScriptValue::UndefinedValue)", "undefined");
+        toString.insert("QScriptValue(0, QScriptValue::NullValue)", "null");
+        toString.insert("QScriptValue(0, true)", "true");
+        toString.insert("QScriptValue(0, false)", "false");
+        toString.insert("QScriptValue(0, int(122))", "122");
+        toString.insert("QScriptValue(0, uint(124))", "124");
+        toString.insert("QScriptValue(0, 0)", "0");
+        toString.insert("QScriptValue(0, 0.0)", "0");
+        toString.insert("QScriptValue(0, 123.0)", "123");
+        toString.insert("QScriptValue(0, 6.37e-8)", "6.37e-8");
+        toString.insert("QScriptValue(0, -6.37e-8)", "-6.37e-8");
+        toString.insert("QScriptValue(0, 0x43211234)", "1126240820");
+        toString.insert("QScriptValue(0, 0x10000)", "65536");
+        toString.insert("QScriptValue(0, 0x10001)", "65537");
+        toString.insert("QScriptValue(0, qSNaN())", "NaN");
+        toString.insert("QScriptValue(0, qQNaN())", "NaN");
+        toString.insert("QScriptValue(0, qInf())", "Infinity");
+        toString.insert("QScriptValue(0, -qInf())", "-Infinity");
+        toString.insert("QScriptValue(0, \"NaN\")", "NaN");
+        toString.insert("QScriptValue(0, \"Infinity\")", "Infinity");
+        toString.insert("QScriptValue(0, \"-Infinity\")", "-Infinity");
+        toString.insert("QScriptValue(0, \"ciao\")", "ciao");
+        toString.insert("QScriptValue(0, QString::fromLatin1(\"ciao\"))", "ciao");
+        toString.insert("QScriptValue(0, QString(\"\"))", "");
+        toString.insert("QScriptValue(0, QString())", "");
+        toString.insert("QScriptValue(0, QString(\"0\"))", "0");
+        toString.insert("QScriptValue(0, QString(\"123\"))", "123");
+        toString.insert("QScriptValue(0, QString(\"12.3\"))", "12.3");
+        toString.insert("QScriptValue(engine, QScriptValue::UndefinedValue)", "undefined");
+        toString.insert("QScriptValue(engine, QScriptValue::NullValue)", "null");
+        toString.insert("QScriptValue(engine, true)", "true");
+        toString.insert("QScriptValue(engine, false)", "false");
+        toString.insert("QScriptValue(engine, int(122))", "122");
+        toString.insert("QScriptValue(engine, uint(124))", "124");
+        toString.insert("QScriptValue(engine, 0)", "0");
+        toString.insert("QScriptValue(engine, 0.0)", "0");
+        toString.insert("QScriptValue(engine, 123.0)", "123");
+        toString.insert("QScriptValue(engine, 6.37e-8)", "6.37e-8");
+        toString.insert("QScriptValue(engine, -6.37e-8)", "-6.37e-8");
+        toString.insert("QScriptValue(engine, 0x43211234)", "1126240820");
+        toString.insert("QScriptValue(engine, 0x10000)", "65536");
+        toString.insert("QScriptValue(engine, 0x10001)", "65537");
+        toString.insert("QScriptValue(engine, qSNaN())", "NaN");
+        toString.insert("QScriptValue(engine, qQNaN())", "NaN");
+        toString.insert("QScriptValue(engine, qInf())", "Infinity");
+        toString.insert("QScriptValue(engine, -qInf())", "-Infinity");
+        toString.insert("QScriptValue(engine, \"NaN\")", "NaN");
+        toString.insert("QScriptValue(engine, \"Infinity\")", "Infinity");
+        toString.insert("QScriptValue(engine, \"-Infinity\")", "-Infinity");
+        toString.insert("QScriptValue(engine, \"ciao\")", "ciao");
+        toString.insert("QScriptValue(engine, QString::fromLatin1(\"ciao\"))", "ciao");
+        toString.insert("QScriptValue(engine, QString(\"\"))", "");
+        toString.insert("QScriptValue(engine, QString())", "");
+        toString.insert("QScriptValue(engine, QString(\"0\"))", "0");
+        toString.insert("QScriptValue(engine, QString(\"123\"))", "123");
+        toString.insert("QScriptValue(engine, QString(\"1.23\"))", "1.23");
+        toString.insert("engine->evaluate(\"[]\")", "");
+        toString.insert("engine->evaluate(\"{}\")", "undefined");
+        toString.insert("engine->evaluate(\"Object.prototype\")", "[object Object]");
+        toString.insert("engine->evaluate(\"Date.prototype\")", "Invalid Date");
+        toString.insert("engine->evaluate(\"Array.prototype\")", "");
+        toString.insert("engine->evaluate(\"Function.prototype\")", "function () {\n    [native code]\n}");
+        toString.insert("engine->evaluate(\"Error.prototype\")", "Error: Unknown error");
+        toString.insert("engine->evaluate(\"Object\")", "function Object() {\n    [native code]\n}");
+        toString.insert("engine->evaluate(\"Array\")", "function Array() {\n    [native code]\n}");
+        toString.insert("engine->evaluate(\"Number\")", "function Number() {\n    [native code]\n}");
+        toString.insert("engine->evaluate(\"Function\")", "function Function() {\n    [native code]\n}");
+        toString.insert("engine->evaluate(\"(function() { return 1; })\")", "function () { return 1; }");
+        toString.insert("engine->evaluate(\"(function() { return 'ciao'; })\")", "function () { return 'ciao'; }");
+        toString.insert("engine->evaluate(\"(function() { throw new Error('foo'); })\")", "function () { throw new Error('foo'); }");
+        toString.insert("engine->evaluate(\"/foo/\")", "/foo/");
+        toString.insert("engine->evaluate(\"new Object()\")", "[object Object]");
+        toString.insert("engine->evaluate(\"new Array()\")", "");
+        toString.insert("engine->evaluate(\"new Error()\")", "Error: Unknown error");
+        toString.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", "22");
+        toString.insert("engine->evaluate(\"Undefined\")", "ReferenceError: Can't find variable: Undefined");
+        toString.insert("engine->evaluate(\"Null\")", "ReferenceError: Can't find variable: Null");
+        toString.insert("engine->evaluate(\"True\")", "ReferenceError: Can't find variable: True");
+        toString.insert("engine->evaluate(\"False\")", "ReferenceError: Can't find variable: False");
+        toString.insert("engine->evaluate(\"undefined\")", "undefined");
+        toString.insert("engine->evaluate(\"null\")", "null");
+        toString.insert("engine->evaluate(\"true\")", "true");
+        toString.insert("engine->evaluate(\"false\")", "false");
+        toString.insert("engine->evaluate(\"122\")", "122");
+        toString.insert("engine->evaluate(\"124\")", "124");
+        toString.insert("engine->evaluate(\"0\")", "0");
+        toString.insert("engine->evaluate(\"0.0\")", "0");
+        toString.insert("engine->evaluate(\"123.0\")", "123");
+        toString.insert("engine->evaluate(\"6.37e-8\")", "6.37e-8");
+        toString.insert("engine->evaluate(\"-6.37e-8\")", "-6.37e-8");
+        toString.insert("engine->evaluate(\"0x43211234\")", "1126240820");
+        toString.insert("engine->evaluate(\"0x10000\")", "65536");
+        toString.insert("engine->evaluate(\"0x10001\")", "65537");
+        toString.insert("engine->evaluate(\"NaN\")", "NaN");
+        toString.insert("engine->evaluate(\"Infinity\")", "Infinity");
+        toString.insert("engine->evaluate(\"-Infinity\")", "-Infinity");
+        toString.insert("engine->evaluate(\"'ciao'\")", "ciao");
+        toString.insert("engine->evaluate(\"''\")", "");
+        toString.insert("engine->evaluate(\"'0'\")", "0");
+        toString.insert("engine->evaluate(\"'123'\")", "123");
+        toString.insert("engine->evaluate(\"'12.4'\")", "12.4");
+        toString.insert("engine->nullValue()", "null");
+        toString.insert("engine->undefinedValue()", "undefined");
+    }
+    newRow(expr) << toString.value(expr);
+}
+
+void tst_QScriptValue::toString_test(const char*, const QScriptValue& value)
+{
+    QFETCH(QString, expected);
+    QCOMPARE(value.toString(), expected);
+    QCOMPARE(value.toString(), expected);
+}
+
+DEFINE_TEST_FUNCTION(toString)
+
+
 void tst_QScriptValue::toNumber_initData()
 {
     QTest::addColumn<qsreal>("expected");
@@ -669,6 +929,35 @@
         toNumber.insert("engine->evaluate(\"new Object()\")", qQNaN());
         toNumber.insert("engine->evaluate(\"new Array()\")", 0);
         toNumber.insert("engine->evaluate(\"new Error()\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22);
+        toNumber.insert("engine->evaluate(\"Undefined\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"Null\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"True\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"False\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"undefined\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"null\")", 0);
+        toNumber.insert("engine->evaluate(\"true\")", 1);
+        toNumber.insert("engine->evaluate(\"false\")", 0);
+        toNumber.insert("engine->evaluate(\"122\")", 122);
+        toNumber.insert("engine->evaluate(\"124\")", 124);
+        toNumber.insert("engine->evaluate(\"0\")", 0);
+        toNumber.insert("engine->evaluate(\"0.0\")", 0);
+        toNumber.insert("engine->evaluate(\"123.0\")", 123);
+        toNumber.insert("engine->evaluate(\"6.37e-8\")", 6.369999999999999e-08);
+        toNumber.insert("engine->evaluate(\"-6.37e-8\")", -6.369999999999999e-08);
+        toNumber.insert("engine->evaluate(\"0x43211234\")", 1126240820);
+        toNumber.insert("engine->evaluate(\"0x10000\")", 65536);
+        toNumber.insert("engine->evaluate(\"0x10001\")", 65537);
+        toNumber.insert("engine->evaluate(\"NaN\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"Infinity\")", qInf());
+        toNumber.insert("engine->evaluate(\"-Infinity\")", qInf());
+        toNumber.insert("engine->evaluate(\"'ciao'\")", qQNaN());
+        toNumber.insert("engine->evaluate(\"''\")", 0);
+        toNumber.insert("engine->evaluate(\"'0'\")", 0);
+        toNumber.insert("engine->evaluate(\"'123'\")", 123);
+        toNumber.insert("engine->evaluate(\"'12.4'\")", 12.4);
+        toNumber.insert("engine->nullValue()", 0);
+        toNumber.insert("engine->undefinedValue()", qQNaN());
     }
     newRow(expr) << toNumber.value(expr);
 }
@@ -682,9 +971,11 @@
     }
     if (qIsInf(expected)) {
         QVERIFY(qIsInf(value.toNumber()));
+        QVERIFY(qIsInf(value.toNumber()));
         return;
     }
     QCOMPARE(value.toNumber(), expected);
+    QCOMPARE(value.toNumber(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toNumber)
@@ -803,6 +1094,35 @@
         toBool.insert("engine->evaluate(\"new Object()\")", true);
         toBool.insert("engine->evaluate(\"new Array()\")", true);
         toBool.insert("engine->evaluate(\"new Error()\")", true);
+        toBool.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", true);
+        toBool.insert("engine->evaluate(\"Undefined\")", true);
+        toBool.insert("engine->evaluate(\"Null\")", true);
+        toBool.insert("engine->evaluate(\"True\")", true);
+        toBool.insert("engine->evaluate(\"False\")", true);
+        toBool.insert("engine->evaluate(\"undefined\")", false);
+        toBool.insert("engine->evaluate(\"null\")", false);
+        toBool.insert("engine->evaluate(\"true\")", true);
+        toBool.insert("engine->evaluate(\"false\")", false);
+        toBool.insert("engine->evaluate(\"122\")", true);
+        toBool.insert("engine->evaluate(\"124\")", true);
+        toBool.insert("engine->evaluate(\"0\")", false);
+        toBool.insert("engine->evaluate(\"0.0\")", false);
+        toBool.insert("engine->evaluate(\"123.0\")", true);
+        toBool.insert("engine->evaluate(\"6.37e-8\")", true);
+        toBool.insert("engine->evaluate(\"-6.37e-8\")", true);
+        toBool.insert("engine->evaluate(\"0x43211234\")", true);
+        toBool.insert("engine->evaluate(\"0x10000\")", true);
+        toBool.insert("engine->evaluate(\"0x10001\")", true);
+        toBool.insert("engine->evaluate(\"NaN\")", false);
+        toBool.insert("engine->evaluate(\"Infinity\")", true);
+        toBool.insert("engine->evaluate(\"-Infinity\")", true);
+        toBool.insert("engine->evaluate(\"'ciao'\")", true);
+        toBool.insert("engine->evaluate(\"''\")", false);
+        toBool.insert("engine->evaluate(\"'0'\")", true);
+        toBool.insert("engine->evaluate(\"'123'\")", true);
+        toBool.insert("engine->evaluate(\"'12.4'\")", true);
+        toBool.insert("engine->nullValue()", false);
+        toBool.insert("engine->undefinedValue()", false);
     }
     newRow(expr) << toBool.value(expr);
 }
@@ -811,6 +1131,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.toBool(), expected);
+    QCOMPARE(value.toBool(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toBool)
@@ -929,6 +1250,35 @@
         toBoolean.insert("engine->evaluate(\"new Object()\")", true);
         toBoolean.insert("engine->evaluate(\"new Array()\")", true);
         toBoolean.insert("engine->evaluate(\"new Error()\")", true);
+        toBoolean.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", true);
+        toBoolean.insert("engine->evaluate(\"Undefined\")", true);
+        toBoolean.insert("engine->evaluate(\"Null\")", true);
+        toBoolean.insert("engine->evaluate(\"True\")", true);
+        toBoolean.insert("engine->evaluate(\"False\")", true);
+        toBoolean.insert("engine->evaluate(\"undefined\")", false);
+        toBoolean.insert("engine->evaluate(\"null\")", false);
+        toBoolean.insert("engine->evaluate(\"true\")", true);
+        toBoolean.insert("engine->evaluate(\"false\")", false);
+        toBoolean.insert("engine->evaluate(\"122\")", true);
+        toBoolean.insert("engine->evaluate(\"124\")", true);
+        toBoolean.insert("engine->evaluate(\"0\")", false);
+        toBoolean.insert("engine->evaluate(\"0.0\")", false);
+        toBoolean.insert("engine->evaluate(\"123.0\")", true);
+        toBoolean.insert("engine->evaluate(\"6.37e-8\")", true);
+        toBoolean.insert("engine->evaluate(\"-6.37e-8\")", true);
+        toBoolean.insert("engine->evaluate(\"0x43211234\")", true);
+        toBoolean.insert("engine->evaluate(\"0x10000\")", true);
+        toBoolean.insert("engine->evaluate(\"0x10001\")", true);
+        toBoolean.insert("engine->evaluate(\"NaN\")", false);
+        toBoolean.insert("engine->evaluate(\"Infinity\")", true);
+        toBoolean.insert("engine->evaluate(\"-Infinity\")", true);
+        toBoolean.insert("engine->evaluate(\"'ciao'\")", true);
+        toBoolean.insert("engine->evaluate(\"''\")", false);
+        toBoolean.insert("engine->evaluate(\"'0'\")", true);
+        toBoolean.insert("engine->evaluate(\"'123'\")", true);
+        toBoolean.insert("engine->evaluate(\"'12.4'\")", true);
+        toBoolean.insert("engine->nullValue()", false);
+        toBoolean.insert("engine->undefinedValue()", false);
     }
     newRow(expr) << toBoolean.value(expr);
 }
@@ -937,6 +1287,7 @@
 {
     QFETCH(bool, expected);
     QCOMPARE(value.toBoolean(), expected);
+    QCOMPARE(value.toBoolean(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toBoolean)
@@ -1055,6 +1406,35 @@
         toInteger.insert("engine->evaluate(\"new Object()\")", 0);
         toInteger.insert("engine->evaluate(\"new Array()\")", 0);
         toInteger.insert("engine->evaluate(\"new Error()\")", 0);
+        toInteger.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22);
+        toInteger.insert("engine->evaluate(\"Undefined\")", 0);
+        toInteger.insert("engine->evaluate(\"Null\")", 0);
+        toInteger.insert("engine->evaluate(\"True\")", 0);
+        toInteger.insert("engine->evaluate(\"False\")", 0);
+        toInteger.insert("engine->evaluate(\"undefined\")", 0);
+        toInteger.insert("engine->evaluate(\"null\")", 0);
+        toInteger.insert("engine->evaluate(\"true\")", 1);
+        toInteger.insert("engine->evaluate(\"false\")", 0);
+        toInteger.insert("engine->evaluate(\"122\")", 122);
+        toInteger.insert("engine->evaluate(\"124\")", 124);
+        toInteger.insert("engine->evaluate(\"0\")", 0);
+        toInteger.insert("engine->evaluate(\"0.0\")", 0);
+        toInteger.insert("engine->evaluate(\"123.0\")", 123);
+        toInteger.insert("engine->evaluate(\"6.37e-8\")", 0);
+        toInteger.insert("engine->evaluate(\"-6.37e-8\")", 0);
+        toInteger.insert("engine->evaluate(\"0x43211234\")", 1126240820);
+        toInteger.insert("engine->evaluate(\"0x10000\")", 65536);
+        toInteger.insert("engine->evaluate(\"0x10001\")", 65537);
+        toInteger.insert("engine->evaluate(\"NaN\")", 0);
+        toInteger.insert("engine->evaluate(\"Infinity\")", qInf());
+        toInteger.insert("engine->evaluate(\"-Infinity\")", qInf());
+        toInteger.insert("engine->evaluate(\"'ciao'\")", 0);
+        toInteger.insert("engine->evaluate(\"''\")", 0);
+        toInteger.insert("engine->evaluate(\"'0'\")", 0);
+        toInteger.insert("engine->evaluate(\"'123'\")", 123);
+        toInteger.insert("engine->evaluate(\"'12.4'\")", 12);
+        toInteger.insert("engine->nullValue()", 0);
+        toInteger.insert("engine->undefinedValue()", 0);
     }
     newRow(expr) << toInteger.value(expr);
 }
@@ -1064,9 +1444,11 @@
     QFETCH(qsreal, expected);
     if (qIsInf(expected)) {
         QVERIFY(qIsInf(value.toInteger()));
+        QVERIFY(qIsInf(value.toInteger()));
         return;
     }
     QCOMPARE(value.toInteger(), expected);
+    QCOMPARE(value.toInteger(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toInteger)
@@ -1185,6 +1567,35 @@
         toInt32.insert("engine->evaluate(\"new Object()\")", 0);
         toInt32.insert("engine->evaluate(\"new Array()\")", 0);
         toInt32.insert("engine->evaluate(\"new Error()\")", 0);
+        toInt32.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22);
+        toInt32.insert("engine->evaluate(\"Undefined\")", 0);
+        toInt32.insert("engine->evaluate(\"Null\")", 0);
+        toInt32.insert("engine->evaluate(\"True\")", 0);
+        toInt32.insert("engine->evaluate(\"False\")", 0);
+        toInt32.insert("engine->evaluate(\"undefined\")", 0);
+        toInt32.insert("engine->evaluate(\"null\")", 0);
+        toInt32.insert("engine->evaluate(\"true\")", 1);
+        toInt32.insert("engine->evaluate(\"false\")", 0);
+        toInt32.insert("engine->evaluate(\"122\")", 122);
+        toInt32.insert("engine->evaluate(\"124\")", 124);
+        toInt32.insert("engine->evaluate(\"0\")", 0);
+        toInt32.insert("engine->evaluate(\"0.0\")", 0);
+        toInt32.insert("engine->evaluate(\"123.0\")", 123);
+        toInt32.insert("engine->evaluate(\"6.37e-8\")", 0);
+        toInt32.insert("engine->evaluate(\"-6.37e-8\")", 0);
+        toInt32.insert("engine->evaluate(\"0x43211234\")", 1126240820);
+        toInt32.insert("engine->evaluate(\"0x10000\")", 65536);
+        toInt32.insert("engine->evaluate(\"0x10001\")", 65537);
+        toInt32.insert("engine->evaluate(\"NaN\")", 0);
+        toInt32.insert("engine->evaluate(\"Infinity\")", 0);
+        toInt32.insert("engine->evaluate(\"-Infinity\")", 0);
+        toInt32.insert("engine->evaluate(\"'ciao'\")", 0);
+        toInt32.insert("engine->evaluate(\"''\")", 0);
+        toInt32.insert("engine->evaluate(\"'0'\")", 0);
+        toInt32.insert("engine->evaluate(\"'123'\")", 123);
+        toInt32.insert("engine->evaluate(\"'12.4'\")", 12);
+        toInt32.insert("engine->nullValue()", 0);
+        toInt32.insert("engine->undefinedValue()", 0);
     }
     newRow(expr) << toInt32.value(expr);
 }
@@ -1193,6 +1604,7 @@
 {
     QFETCH(qint32, expected);
     QCOMPARE(value.toInt32(), expected);
+    QCOMPARE(value.toInt32(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toInt32)
@@ -1311,6 +1723,35 @@
         toUInt32.insert("engine->evaluate(\"new Object()\")", 0);
         toUInt32.insert("engine->evaluate(\"new Array()\")", 0);
         toUInt32.insert("engine->evaluate(\"new Error()\")", 0);
+        toUInt32.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22);
+        toUInt32.insert("engine->evaluate(\"Undefined\")", 0);
+        toUInt32.insert("engine->evaluate(\"Null\")", 0);
+        toUInt32.insert("engine->evaluate(\"True\")", 0);
+        toUInt32.insert("engine->evaluate(\"False\")", 0);
+        toUInt32.insert("engine->evaluate(\"undefined\")", 0);
+        toUInt32.insert("engine->evaluate(\"null\")", 0);
+        toUInt32.insert("engine->evaluate(\"true\")", 1);
+        toUInt32.insert("engine->evaluate(\"false\")", 0);
+        toUInt32.insert("engine->evaluate(\"122\")", 122);
+        toUInt32.insert("engine->evaluate(\"124\")", 124);
+        toUInt32.insert("engine->evaluate(\"0\")", 0);
+        toUInt32.insert("engine->evaluate(\"0.0\")", 0);
+        toUInt32.insert("engine->evaluate(\"123.0\")", 123);
+        toUInt32.insert("engine->evaluate(\"6.37e-8\")", 0);
+        toUInt32.insert("engine->evaluate(\"-6.37e-8\")", 0);
+        toUInt32.insert("engine->evaluate(\"0x43211234\")", 1126240820);
+        toUInt32.insert("engine->evaluate(\"0x10000\")", 65536);
+        toUInt32.insert("engine->evaluate(\"0x10001\")", 65537);
+        toUInt32.insert("engine->evaluate(\"NaN\")", 0);
+        toUInt32.insert("engine->evaluate(\"Infinity\")", 0);
+        toUInt32.insert("engine->evaluate(\"-Infinity\")", 0);
+        toUInt32.insert("engine->evaluate(\"'ciao'\")", 0);
+        toUInt32.insert("engine->evaluate(\"''\")", 0);
+        toUInt32.insert("engine->evaluate(\"'0'\")", 0);
+        toUInt32.insert("engine->evaluate(\"'123'\")", 123);
+        toUInt32.insert("engine->evaluate(\"'12.4'\")", 12);
+        toUInt32.insert("engine->nullValue()", 0);
+        toUInt32.insert("engine->undefinedValue()", 0);
     }
     newRow(expr) << toUInt32.value(expr);
 }
@@ -1319,6 +1760,7 @@
 {
     QFETCH(quint32, expected);
     QCOMPARE(value.toUInt32(), expected);
+    QCOMPARE(value.toUInt32(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toUInt32)
@@ -1437,6 +1879,35 @@
         toUInt16.insert("engine->evaluate(\"new Object()\")", 0);
         toUInt16.insert("engine->evaluate(\"new Array()\")", 0);
         toUInt16.insert("engine->evaluate(\"new Error()\")", 0);
+        toUInt16.insert("engine->evaluate(\"a = new Object(); a.foo = 22; a.foo\")", 22);
+        toUInt16.insert("engine->evaluate(\"Undefined\")", 0);
+        toUInt16.insert("engine->evaluate(\"Null\")", 0);
+        toUInt16.insert("engine->evaluate(\"True\")", 0);
+        toUInt16.insert("engine->evaluate(\"False\")", 0);
+        toUInt16.insert("engine->evaluate(\"undefined\")", 0);
+        toUInt16.insert("engine->evaluate(\"null\")", 0);
+        toUInt16.insert("engine->evaluate(\"true\")", 1);
+        toUInt16.insert("engine->evaluate(\"false\")", 0);
+        toUInt16.insert("engine->evaluate(\"122\")", 122);
+        toUInt16.insert("engine->evaluate(\"124\")", 124);
+        toUInt16.insert("engine->evaluate(\"0\")", 0);
+        toUInt16.insert("engine->evaluate(\"0.0\")", 0);
+        toUInt16.insert("engine->evaluate(\"123.0\")", 123);
+        toUInt16.insert("engine->evaluate(\"6.37e-8\")", 0);
+        toUInt16.insert("engine->evaluate(\"-6.37e-8\")", 0);
+        toUInt16.insert("engine->evaluate(\"0x43211234\")", 4660);
+        toUInt16.insert("engine->evaluate(\"0x10000\")", 0);
+        toUInt16.insert("engine->evaluate(\"0x10001\")", 1);
+        toUInt16.insert("engine->evaluate(\"NaN\")", 0);
+        toUInt16.insert("engine->evaluate(\"Infinity\")", 0);
+        toUInt16.insert("engine->evaluate(\"-Infinity\")", 0);
+        toUInt16.insert("engine->evaluate(\"'ciao'\")", 0);
+        toUInt16.insert("engine->evaluate(\"''\")", 0);
+        toUInt16.insert("engine->evaluate(\"'0'\")", 0);
+        toUInt16.insert("engine->evaluate(\"'123'\")", 123);
+        toUInt16.insert("engine->evaluate(\"'12.4'\")", 12);
+        toUInt16.insert("engine->nullValue()", 0);
+        toUInt16.insert("engine->undefinedValue()", 0);
     }
     newRow(expr) << toUInt16.value(expr);
 }
@@ -1445,6 +1916,7 @@
 {
     QFETCH(quint16, expected);
     QCOMPARE(value.toUInt16(), expected);
+    QCOMPARE(value.toUInt16(), expected);
 }
 
 DEFINE_TEST_FUNCTION(toUInt16)
diff --git a/JavaScriptCore/qt/tests/tests.pri b/JavaScriptCore/qt/tests/tests.pri
index 1ce238f..5af3383 100644
--- a/JavaScriptCore/qt/tests/tests.pri
+++ b/JavaScriptCore/qt/tests/tests.pri
@@ -1,12 +1,3 @@
-isEmpty(OUTPUT_DIR) {
-    CONFIG(debug, debug|release) {
-        OUTPUT_DIR=$$PWD/WebKitBuild/Debug
-    } else { # Release
-        OUTPUT_DIR=$$PWD/WebKitBuild/Release
-    }
-}
-
-
 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
 QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
 mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
diff --git a/JavaScriptCore/qt/tests/tests.pro b/JavaScriptCore/qt/tests/tests.pro
index 6e5edb1..7c3f590 100644
--- a/JavaScriptCore/qt/tests/tests.pro
+++ b/JavaScriptCore/qt/tests/tests.pro
@@ -1,3 +1,4 @@
 TEMPLATE = subdirs
 SUBDIRS =   qscriptengine \
-            qscriptvalue
+            qscriptvalue \
+            qscriptstring
diff --git a/JavaScriptCore/runtime/ArrayPrototype.cpp b/JavaScriptCore/runtime/ArrayPrototype.cpp
index 6d79581..bd14e64 100644
--- a/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -24,13 +24,13 @@
 #include "config.h"
 #include "ArrayPrototype.h"
 
-#include "CodeBlock.h"
 #include "CachedCall.h"
+#include "CodeBlock.h"
 #include "Interpreter.h"
 #include "JIT.h"
 #include "JSStringBuilder.h"
-#include "ObjectPrototype.h"
 #include "Lookup.h"
+#include "ObjectPrototype.h"
 #include "Operations.h"
 #include <algorithm>
 #include <wtf/Assertions.h>
@@ -156,9 +156,9 @@
     JSArray* thisObj = asArray(thisValue);
     
     HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements;
-    if (arrayVisitedElements.size() >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)
-            return throwError(exec, RangeError, "Maximum call stack size exceeded.");
+    if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) {
+        if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth)
+            return throwError(exec, RangeError, "Maximum call stack size exceeded.");    
     }
 
     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
@@ -201,7 +201,7 @@
         if (i)
             buffer.append(',');
         if (RefPtr<UString::Rep> rep = strBuffer[i])
-            buffer.append(rep->data(), rep->length());
+            buffer.append(rep->characters(), rep->length());
     }
     ASSERT(buffer.size() == totalSize);
     return jsString(exec, UString::adopt(buffer));
@@ -214,9 +214,9 @@
     JSObject* thisObj = asArray(thisValue);
 
     HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements;
-    if (arrayVisitedElements.size() >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)
-            return throwError(exec, RangeError, "Maximum call stack size exceeded.");
+    if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) {
+        if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth)
+            return throwError(exec, RangeError, "Maximum call stack size exceeded.");    
     }
 
     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
@@ -252,9 +252,9 @@
     JSObject* thisObj = thisValue.toThisObject(exec);
 
     HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements;
-    if (arrayVisitedElements.size() >= MaxSecondaryThreadReentryDepth) {
-        if (!isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)
-            return throwError(exec, RangeError, "Maximum call stack size exceeded.");
+    if (arrayVisitedElements.size() >= MaxSmallThreadReentryDepth) {
+        if (arrayVisitedElements.size() >= exec->globalData().maxReentryDepth)
+            return throwError(exec, RangeError, "Maximum call stack size exceeded.");    
     }
 
     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
@@ -506,14 +506,19 @@
     // 15.4.4.12
     JSArray* resObj = constructEmptyArray(exec);
     JSValue result = resObj;
-    unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
+
+    // FIXME: Firefox returns an empty array.
     if (!args.size())
         return jsUndefined();
-    int begin = args.at(0).toUInt32(exec);
-    if (begin < 0)
-        begin = std::max<int>(begin + length, 0);
-    else
-        begin = std::min<int>(begin, length);
+
+    unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
+    double relativeBegin = args.at(0).toInteger(exec);
+    unsigned begin;
+    if (relativeBegin < 0) {
+        relativeBegin += length;
+        begin = (relativeBegin < 0) ? 0 : static_cast<unsigned>(relativeBegin);
+    } else
+        begin = std::min<unsigned>(static_cast<unsigned>(relativeBegin), length);
 
     unsigned deleteCount;
     if (args.size() > 1)
@@ -539,7 +544,7 @@
             for (unsigned k = length; k > length - deleteCount + additionalArgs; --k)
                 thisObj->deleteProperty(exec, k - 1);
         } else {
-            for (unsigned k = length - deleteCount; (int)k > begin; --k) {
+            for (unsigned k = length - deleteCount; k > begin; --k) {
                 if (JSValue obj = getProperty(exec, thisObj, k + deleteCount - 1))
                     thisObj->put(exec, k + additionalArgs - 1, obj);
                 else
diff --git a/JavaScriptCore/runtime/Collector.cpp b/JavaScriptCore/runtime/Collector.cpp
index 2873e0b..9b72755 100644
--- a/JavaScriptCore/runtime/Collector.cpp
+++ b/JavaScriptCore/runtime/Collector.cpp
@@ -53,11 +53,6 @@
 #include <mach/thread_act.h>
 #include <mach/vm_map.h>
 
-#elif OS(SYMBIAN)
-#include <e32std.h>
-#include <e32cmn.h>
-#include <unistd.h>
-
 #elif OS(WINDOWS)
 
 #include <windows.h>
@@ -109,11 +104,6 @@
 // a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
 #define MIN_ARRAY_SIZE (static_cast<size_t>(14))
 
-#if OS(SYMBIAN)
-const size_t MAX_NUM_BLOCKS = 256; // Max size of collector heap set to 16 MB
-static RHeap* userChunk = 0;
-#endif
-
 #if ENABLE(JSC_MULTIPLE_THREADS)
 
 #if OS(DARWIN)
@@ -145,30 +135,12 @@
     , m_registeredThreads(0)
     , m_currentThreadRegistrar(0)
 #endif
+#if OS(SYMBIAN)
+    , m_blockallocator(JSCCOLLECTOR_VIRTUALMEM_RESERVATION, BLOCK_SIZE)
+#endif
     , m_globalData(globalData)
 {
     ASSERT(globalData);
-    
-#if OS(SYMBIAN)
-    // Symbian OpenC supports mmap but currently not the MAP_ANON flag.
-    // Using fastMalloc() does not properly align blocks on 64k boundaries
-    // and previous implementation was flawed/incomplete.
-    // UserHeap::ChunkHeap allows allocation of continuous memory and specification
-    // of alignment value for (symbian) cells within that heap.
-    //
-    // Clarification and mapping of terminology:
-    // RHeap (created by UserHeap::ChunkHeap below) is continuos memory chunk,
-    // which can dynamically grow up to 8 MB,
-    // that holds all CollectorBlocks of this session (static).
-    // Each symbian cell within RHeap maps to a 64kb aligned CollectorBlock.
-    // JSCell objects are maintained as usual within CollectorBlocks.
-    if (!userChunk) {
-        userChunk = UserHeap::ChunkHeap(0, 0, MAX_NUM_BLOCKS * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE);
-        if (!userChunk)
-            CRASH();
-    }
-#endif // OS(SYMBIAN)
-    
     memset(&m_heap, 0, sizeof(CollectorHeap));
     allocateBlock();
 }
@@ -211,7 +183,9 @@
         t = next;
     }
 #endif
-
+#if OS(SYMBIAN)
+    m_blockallocator.destroy();
+#endif
     m_globalData = 0;
 }
 
@@ -221,15 +195,13 @@
     vm_address_t address = 0;
     vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
 #elif OS(SYMBIAN)
-    // Allocate a 64 kb aligned CollectorBlock
-    unsigned char* mask = reinterpret_cast<unsigned char*>(userChunk->Alloc(BLOCK_SIZE));
-    if (!mask)
+    void* address = m_blockallocator.alloc();  
+    if (!address)
         CRASH();
-    uintptr_t address = reinterpret_cast<uintptr_t>(mask);
 #elif OS(WINCE)
     void* address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
 #elif OS(WINDOWS)
-#if COMPILER(MINGW)
+#if COMPILER(MINGW) && !COMPILER(MINGW64)
     void* address = __mingw_aligned_malloc(BLOCK_SIZE, BLOCK_SIZE);
 #else
     void* address = _aligned_malloc(BLOCK_SIZE, BLOCK_SIZE);
@@ -316,11 +288,11 @@
 #if OS(DARWIN)    
     vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
 #elif OS(SYMBIAN)
-    userChunk->Free(reinterpret_cast<TAny*>(block));
+    m_blockallocator.free(reinterpret_cast<void*>(block));
 #elif OS(WINCE)
     VirtualFree(block, 0, MEM_RELEASE);
 #elif OS(WINDOWS)
-#if COMPILER(MINGW)
+#if COMPILER(MINGW) && !COMPILER(MINGW64)
     __mingw_aligned_free(block);
 #else
     _aligned_free(block);
@@ -574,10 +546,6 @@
         MOV pTib, EAX
     }
     return static_cast<void*>(pTib->StackBase);
-#elif OS(WINDOWS) && CPU(X86_64) && COMPILER(MSVC)
-    // FIXME: why only for MSVC?
-    PNT_TIB64 pTib = reinterpret_cast<PNT_TIB64>(NtCurrentTeb());
-    return reinterpret_cast<void*>(pTib->StackBase);
 #elif OS(WINDOWS) && CPU(X86) && COMPILER(GCC)
     // offset 0x18 from the FS segment register gives a pointer to
     // the thread information block for the current thread
@@ -586,6 +554,9 @@
           : "=r" (pTib)
         );
     return static_cast<void*>(pTib->StackBase);
+#elif OS(WINDOWS) && CPU(X86_64)
+    PNT_TIB64 pTib = reinterpret_cast<PNT_TIB64>(NtCurrentTeb());
+    return reinterpret_cast<void*>(pTib->StackBase);
 #elif OS(QNX)
     return currentThreadStackBaseQNX();
 #elif OS(SOLARIS)
@@ -667,7 +638,7 @@
 
 void Heap::registerThread()
 {
-    ASSERT(!m_globalData->mainThreadOnly || isMainThread());
+    ASSERT(!m_globalData->exclusiveThread || m_globalData->exclusiveThread == currentThread());
 
     if (!m_currentThreadRegistrar || pthread_getspecific(m_currentThreadRegistrar))
         return;
@@ -1009,15 +980,15 @@
     m_protectedValues.add(k.asCell());
 }
 
-void Heap::unprotect(JSValue k)
+bool Heap::unprotect(JSValue k)
 {
     ASSERT(k);
     ASSERT(JSLock::currentThreadIsHoldingLock() || !m_globalData->isSharedInstance);
 
     if (!k.isCell())
-        return;
+        return false;
 
-    m_protectedValues.remove(k.asCell());
+    return m_protectedValues.remove(k.asCell());
 }
 
 void Heap::markProtectedObjects(MarkStack& markStack)
diff --git a/JavaScriptCore/runtime/Collector.h b/JavaScriptCore/runtime/Collector.h
index 82aa8a1..3db3d7e 100644
--- a/JavaScriptCore/runtime/Collector.h
+++ b/JavaScriptCore/runtime/Collector.h
@@ -35,6 +35,10 @@
 #include <pthread.h>
 #endif
 
+#if OS(SYMBIAN)
+#include <wtf/symbian/BlockAllocatorSymbian.h>
+#endif
+
 #define ASSERT_CLASS_FITS_IN_CELL(class) COMPILE_ASSERT(sizeof(class) <= CELL_SIZE, class_fits_in_cell)
 
 namespace JSC {
@@ -91,7 +95,9 @@
         Statistics statistics() const;
 
         void protect(JSValue);
-        void unprotect(JSValue);
+        // Returns true if the value is no longer protected by any protect pointers
+        // (though it may still be alive due to heap/stack references).
+        bool unprotect(JSValue);
 
         static Heap* heap(JSValue); // 0 for immediate values
         static Heap* heap(JSCell*);
@@ -168,6 +174,11 @@
         pthread_key_t m_currentThreadRegistrar;
 #endif
 
+#if OS(SYMBIAN)
+        // Allocates collector blocks with correct alignment
+        WTF::AlignedBlockAllocator m_blockallocator; 
+#endif
+        
         JSGlobalData* m_globalData;
     };
 
diff --git a/JavaScriptCore/runtime/CommonIdentifiers.cpp b/JavaScriptCore/runtime/CommonIdentifiers.cpp
index ed5e304..3837817 100644
--- a/JavaScriptCore/runtime/CommonIdentifiers.cpp
+++ b/JavaScriptCore/runtime/CommonIdentifiers.cpp
@@ -28,7 +28,8 @@
 #define INITIALIZE_PROPERTY_NAME(name) , name(globalData, #name)
 
 CommonIdentifiers::CommonIdentifiers(JSGlobalData* globalData)
-    : emptyIdentifier(globalData, "")
+    : nullIdentifier(globalData, nullCString)
+    , emptyIdentifier(globalData, "")
     , underscoreProto(globalData, "__proto__")
     , thisIdentifier(globalData, "this")
     JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PROPERTY_NAME)
diff --git a/JavaScriptCore/runtime/CommonIdentifiers.h b/JavaScriptCore/runtime/CommonIdentifiers.h
index 0a3d774..de24f4a 100644
--- a/JavaScriptCore/runtime/CommonIdentifiers.h
+++ b/JavaScriptCore/runtime/CommonIdentifiers.h
@@ -90,6 +90,7 @@
         friend class JSGlobalData;
 
     public:
+        const Identifier nullIdentifier;
         const Identifier emptyIdentifier;
         const Identifier underscoreProto;
         const Identifier thisIdentifier;
diff --git a/JavaScriptCore/runtime/Completion.cpp b/JavaScriptCore/runtime/Completion.cpp
index 2f88df9..9af5171 100644
--- a/JavaScriptCore/runtime/Completion.cpp
+++ b/JavaScriptCore/runtime/Completion.cpp
@@ -29,6 +29,7 @@
 #include "Interpreter.h"
 #include "Parser.h"
 #include "Debugger.h"
+#include "WTFThreadData.h"
 #include <stdio.h>
 
 namespace JSC {
@@ -36,7 +37,7 @@
 Completion checkSyntax(ExecState* exec, const SourceCode& source)
 {
     JSLock lock(exec);
-    ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
+    ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
 
     RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
     JSObject* error = program->checkSyntax(exec);
@@ -49,7 +50,7 @@
 Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& source, JSValue thisValue)
 {
     JSLock lock(exec);
-    ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
+    ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
 
     RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
     JSObject* error = program->compile(exec, scopeChain.node());
@@ -62,9 +63,10 @@
     JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain.node(), thisObj, &exception);
 
     if (exception) {
-        if (exception.isObject() && asObject(exception)->isWatchdogException())
-            return Completion(Interrupted, exception);
-        return Completion(Throw, exception);
+        ComplType exceptionType = Throw;
+        if (exception.isObject())
+            exceptionType = asObject(exception)->exceptionType();
+        return Completion(exceptionType, exception);
     }
     return Completion(Normal, result);
 }
diff --git a/JavaScriptCore/runtime/Completion.h b/JavaScriptCore/runtime/Completion.h
index 41c9a64..63b315e 100644
--- a/JavaScriptCore/runtime/Completion.h
+++ b/JavaScriptCore/runtime/Completion.h
@@ -31,7 +31,7 @@
     class ScopeChain;
     class SourceCode;
 
-    enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted };
+    enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted, Terminated };
 
     /*
      * Completion objects are used to convey the return status and value
diff --git a/JavaScriptCore/runtime/DateConversion.cpp b/JavaScriptCore/runtime/DateConversion.cpp
index f129407..70dbaa0 100644
--- a/JavaScriptCore/runtime/DateConversion.cpp
+++ b/JavaScriptCore/runtime/DateConversion.cpp
@@ -56,7 +56,7 @@
 {
     if (date == exec->globalData().cachedDateString)
         return exec->globalData().cachedDateStringValue;
-    double value = parseDateFromNullTerminatedCharacters(exec, date.UTF8String().c_str());
+    double value = parseDateFromNullTerminatedCharacters(exec, date.UTF8String().data());
     exec->globalData().cachedDateString = date;
     exec->globalData().cachedDateStringValue = value;
     return value;
diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp
index 25b0ac4..d331409 100644
--- a/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/JavaScriptCore/runtime/DatePrototype.cpp
@@ -24,11 +24,12 @@
 #include "DatePrototype.h"
 
 #include "DateConversion.h"
+#include "DateInstance.h"
 #include "Error.h"
 #include "JSString.h"
 #include "JSStringBuilder.h"
+#include "Lookup.h"
 #include "ObjectPrototype.h"
-#include "DateInstance.h"
 
 #if !PLATFORM(MAC) && HAVE(LANGINFO_H)
 #include <langinfo.h>
diff --git a/JavaScriptCore/runtime/ExceptionHelpers.cpp b/JavaScriptCore/runtime/ExceptionHelpers.cpp
index b9c6319..aee6f31 100644
--- a/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -46,7 +46,7 @@
     {
     }
 
-    virtual bool isWatchdogException() const { return true; }
+    virtual ComplType exceptionType() const { return Interrupted; }
 
     virtual UString toString(ExecState*) const { return "JavaScript execution exceeded timeout."; }
 };
@@ -56,6 +56,23 @@
     return new (globalData) InterruptedExecutionError(globalData);
 }
 
+class TerminatedExecutionError : public JSObject {
+public:
+    TerminatedExecutionError(JSGlobalData* globalData)
+        : JSObject(globalData->terminatedExecutionErrorStructure)
+    {
+    }
+
+    virtual ComplType exceptionType() const { return Terminated; }
+
+    virtual UString toString(ExecState*) const { return "JavaScript execution terminated."; }
+};
+
+JSValue createTerminatedExecutionException(JSGlobalData* globalData)
+{
+    return new (globalData) TerminatedExecutionError(globalData);
+}
+
 static JSValue createError(ExecState* exec, ErrorType e, const char* msg)
 {
     return Error::create(exec, e, msg, -1, -1, UString());
diff --git a/JavaScriptCore/runtime/ExceptionHelpers.h b/JavaScriptCore/runtime/ExceptionHelpers.h
index b6e7373..b152439 100644
--- a/JavaScriptCore/runtime/ExceptionHelpers.h
+++ b/JavaScriptCore/runtime/ExceptionHelpers.h
@@ -43,6 +43,7 @@
     struct Instruction;
     
     JSValue createInterruptedExecutionException(JSGlobalData*);
+    JSValue createTerminatedExecutionException(JSGlobalData*);
     JSValue createStackOverflowError(ExecState*);
     JSValue createTypeError(ExecState*, const char* message);
     JSValue createUndefinedVariableError(ExecState*, const Identifier&, unsigned bytecodeOffset, CodeBlock*);
diff --git a/JavaScriptCore/runtime/FunctionPrototype.cpp b/JavaScriptCore/runtime/FunctionPrototype.cpp
index 3475f08..a77b5b2 100644
--- a/JavaScriptCore/runtime/FunctionPrototype.cpp
+++ b/JavaScriptCore/runtime/FunctionPrototype.cpp
@@ -39,7 +39,7 @@
 static JSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*, JSObject*, JSValue, const ArgList&);
 
 FunctionPrototype::FunctionPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure)
-    : InternalFunction(&exec->globalData(), structure, exec->propertyNames().emptyIdentifier)
+    : InternalFunction(&exec->globalData(), structure, exec->propertyNames().nullIdentifier)
 {
     putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum);
 }
diff --git a/JavaScriptCore/runtime/GetterSetter.h b/JavaScriptCore/runtime/GetterSetter.h
index 4e47361..27ffbe7 100644
--- a/JavaScriptCore/runtime/GetterSetter.h
+++ b/JavaScriptCore/runtime/GetterSetter.h
@@ -34,6 +34,7 @@
     // This is an internal value object which stores getter and setter functions
     // for a property.
     class GetterSetter : public JSCell {
+        friend class JIT;
     public:
         GetterSetter(ExecState* exec)
             : JSCell(exec->globalData().getterSetterStructure.get())
diff --git a/JavaScriptCore/runtime/Identifier.cpp b/JavaScriptCore/runtime/Identifier.cpp
index 46fcd0b..f2642a9 100644
--- a/JavaScriptCore/runtime/Identifier.cpp
+++ b/JavaScriptCore/runtime/Identifier.cpp
@@ -22,50 +22,38 @@
 #include "Identifier.h"
 
 #include "CallFrame.h"
+#include "NumericStrings.h"
 #include <new> // for placement new
 #include <string.h> // for strlen
 #include <wtf/Assertions.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/HashSet.h>
+#include <wtf/WTFThreadData.h>
+#include <wtf/text/StringHash.h>
 
 using WTF::ThreadSpecific;
 
 namespace JSC {
 
-typedef HashMap<const char*, RefPtr<UString::Rep>, PtrHash<const char*> > LiteralIdentifierTable;
-
-class IdentifierTable : public FastAllocBase {
-public:
-    ~IdentifierTable()
-    {
-        HashSet<UString::Rep*>::iterator end = m_table.end();
-        for (HashSet<UString::Rep*>::iterator iter = m_table.begin(); iter != end; ++iter)
-            (*iter)->setIsIdentifier(false);
-    }
-    
-    std::pair<HashSet<UString::Rep*>::iterator, bool> add(UString::Rep* value)
-    {
-        std::pair<HashSet<UString::Rep*>::iterator, bool> result = m_table.add(value);
-        (*result.first)->setIsIdentifier(true);
-        return result;
-    }
-
-    template<typename U, typename V>
-    std::pair<HashSet<UString::Rep*>::iterator, bool> add(U value)
-    {
-        std::pair<HashSet<UString::Rep*>::iterator, bool> result = m_table.add<U, V>(value);
-        (*result.first)->setIsIdentifier(true);
-        return result;
-    }
-
-    void remove(UString::Rep* r) { m_table.remove(r); }
-
-    LiteralIdentifierTable& literalTable() { return m_literalTable; }
-
-private:
-    HashSet<UString::Rep*> m_table;
-    LiteralIdentifierTable m_literalTable;
-};
+IdentifierTable::~IdentifierTable()
+{
+    HashSet<StringImpl*>::iterator end = m_table.end();
+    for (HashSet<StringImpl*>::iterator iter = m_table.begin(); iter != end; ++iter)
+        (*iter)->setIsIdentifier(false);
+}
+std::pair<HashSet<StringImpl*>::iterator, bool> IdentifierTable::add(StringImpl* value)
+{
+    std::pair<HashSet<StringImpl*>::iterator, bool> result = m_table.add(value);
+    (*result.first)->setIsIdentifier(true);
+    return result;
+}
+template<typename U, typename V>
+std::pair<HashSet<StringImpl*>::iterator, bool> IdentifierTable::add(U value)
+{
+    std::pair<HashSet<StringImpl*>::iterator, bool> result = m_table.add<U, V>(value);
+    (*result.first)->setIsIdentifier(true);
+    return result;
+}
 
 IdentifierTable* createIdentifierTable()
 {
@@ -80,7 +68,7 @@
 bool Identifier::equal(const UString::Rep* r, const char* s)
 {
     int length = r->length();
-    const UChar* d = r->data();
+    const UChar* d = r->characters();
     for (int i = 0; i != length; ++i)
         if (d[i] != (unsigned char)s[i])
             return false;
@@ -91,14 +79,14 @@
 {
     if (r->length() != length)
         return false;
-    const UChar* d = r->data();
+    const UChar* d = r->characters();
     for (unsigned i = 0; i != length; ++i)
         if (d[i] != s[i])
             return false;
     return true;
 }
 
-struct CStringTranslator {
+struct IdentifierCStringTranslator {
     static unsigned hash(const char* c)
     {
         return UString::Rep::computeHash(c);
@@ -123,12 +111,10 @@
 
 PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const char* c)
 {
-    ASSERT(c);
-
-    if (!c[0]) {
-        UString::Rep::empty().hash();
-        return &UString::Rep::empty();
-    }
+    if (!c)
+        return UString::null().rep();
+    if (!c[0])
+        return UString::Rep::empty();
     if (!c[1])
         return add(globalData, globalData->smallStrings.singleCharacterStringRep(static_cast<unsigned char>(c[0])));
 
@@ -139,7 +125,7 @@
     if (iter != literalIdentifierTable.end())
         return iter->second;
 
-    pair<HashSet<UString::Rep*>::iterator, bool> addResult = identifierTable.add<const char*, CStringTranslator>(c);
+    pair<HashSet<UString::Rep*>::iterator, bool> addResult = identifierTable.add<const char*, IdentifierCStringTranslator>(c);
 
     // If the string is newly-translated, then we need to adopt it.
     // The boolean in the pair tells us if that is so.
@@ -160,7 +146,7 @@
     unsigned int length;
 };
 
-struct UCharBufferTranslator {
+struct IdentifierUCharBufferTranslator {
     static unsigned hash(const UCharBuffer& buf)
     {
         return UString::Rep::computeHash(buf.s, buf.length);
@@ -189,12 +175,10 @@
         if (c <= 0xFF)
             return add(globalData, globalData->smallStrings.singleCharacterStringRep(c));
     }
-    if (!length) {
-        UString::Rep::empty().hash();
-        return &UString::Rep::empty();
-    }
+    if (!length)
+        return UString::Rep::empty();
     UCharBuffer buf = {s, length}; 
-    pair<HashSet<UString::Rep*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+    pair<HashSet<UString::Rep*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, IdentifierUCharBufferTranslator>(buf);
 
     // If the string is newly-translated, then we need to adopt it.
     // The boolean in the pair tells us if that is so.
@@ -209,21 +193,18 @@
 PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UString::Rep* r)
 {
     ASSERT(!r->isIdentifier());
+    // The empty & null strings are static singletons, and static strings are handled
+    // in ::add() in the header, so we should never get here with a zero length string.
+    ASSERT(r->length());
+
     if (r->length() == 1) {
-        UChar c = r->data()[0];
+        UChar c = r->characters()[0];
         if (c <= 0xFF)
             r = globalData->smallStrings.singleCharacterStringRep(c);
-            if (r->isIdentifier()) {
-#ifndef NDEBUG
-                checkSameIdentifierTable(globalData, r);
-#endif
+            if (r->isIdentifier())
                 return r;
-            }
     }
-    if (!r->length()) {
-        UString::Rep::empty().hash();
-        return &UString::Rep::empty();
-    }
+
     return *globalData->identifierTable->add(r).first;
 }
 
@@ -232,58 +213,41 @@
     return addSlowCase(&exec->globalData(), r);
 }
 
-void Identifier::remove(UString::Rep* r)
+Identifier Identifier::from(ExecState* exec, unsigned value)
 {
-    currentIdentifierTable()->remove(r);
+    return Identifier(exec, exec->globalData().numericStrings.add(value));
+}
+
+Identifier Identifier::from(ExecState* exec, int value)
+{
+    return Identifier(exec, exec->globalData().numericStrings.add(value));
+}
+
+Identifier Identifier::from(ExecState* exec, double value)
+{
+    return Identifier(exec, exec->globalData().numericStrings.add(value));
 }
 
 #ifndef NDEBUG
 
-void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep*)
+void Identifier::checkCurrentIdentifierTable(JSGlobalData* globalData)
 {
-    ASSERT_UNUSED(exec, exec->globalData().identifierTable == currentIdentifierTable());
+    // Check the identifier table accessible through the threadspecific matches the
+    // globalData's identifier table.
+    ASSERT_UNUSED(globalData, globalData->identifierTable == wtfThreadData().currentIdentifierTable());
 }
 
-void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep*)
+void Identifier::checkCurrentIdentifierTable(ExecState* exec)
 {
-    ASSERT_UNUSED(globalData, globalData->identifierTable == currentIdentifierTable());
+    checkCurrentIdentifierTable(&exec->globalData());
 }
 
 #else
 
-void Identifier::checkSameIdentifierTable(ExecState*, UString::Rep*)
-{
-}
-
-void Identifier::checkSameIdentifierTable(JSGlobalData*, UString::Rep*)
-{
-}
-
-#endif
-
-ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific = 0;
-
-#if ENABLE(JSC_MULTIPLE_THREADS)
-
-pthread_once_t createIdentifierTableSpecificOnce = PTHREAD_ONCE_INIT;
-static void createIdentifierTableSpecificCallback()
-{
-    ASSERT(!g_identifierTableSpecific);
-    g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
-}
-void createIdentifierTableSpecific()
-{
-    pthread_once(&createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback);
-    ASSERT(g_identifierTableSpecific);
-}
-
-#else 
-
-void createIdentifierTableSpecific()
-{
-    ASSERT(!g_identifierTableSpecific);
-    g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
-}
+// These only exists so that our exports are the same for debug and release builds.
+// This would be an ASSERT_NOT_REACHED(), but we're in NDEBUG only code here!
+void Identifier::checkCurrentIdentifierTable(JSGlobalData*) { CRASH(); }
+void Identifier::checkCurrentIdentifierTable(ExecState*) { CRASH(); }
 
 #endif
 
diff --git a/JavaScriptCore/runtime/Identifier.h b/JavaScriptCore/runtime/Identifier.h
index 73e2af8..2f16bbf 100644
--- a/JavaScriptCore/runtime/Identifier.h
+++ b/JavaScriptCore/runtime/Identifier.h
@@ -54,9 +54,9 @@
         
         const char* ascii() const { return _ustring.ascii(); }
         
-        static Identifier from(ExecState* exec, unsigned y) { return Identifier(exec, UString::from(y)); }
-        static Identifier from(ExecState* exec, int y) { return Identifier(exec, UString::from(y)); }
-        static Identifier from(ExecState* exec, double y) { return Identifier(exec, UString::from(y)); }
+        static Identifier from(ExecState* exec, unsigned y);
+        static Identifier from(ExecState* exec, int y);
+        static Identifier from(ExecState* exec, double y);
         
         bool isNull() const { return _ustring.isNull(); }
         bool isEmpty() const { return _ustring.isEmpty(); }
@@ -73,11 +73,9 @@
         friend bool operator==(const Identifier&, const char*);
         friend bool operator!=(const Identifier&, const char*);
     
-        static void remove(UString::Rep*);
-
         static bool equal(const UString::Rep*, const char*);
         static bool equal(const UString::Rep*, const UChar*, unsigned length);
-        static bool equal(const UString::Rep* a, const UString::Rep* b) { return JSC::equal(a, b); }
+        static bool equal(const UString::Rep* a, const UString::Rep* b) { return ::equal(a, b); }
 
         static PassRefPtr<UString::Rep> add(ExecState*, const char*); // Only to be used with string literals.
         static PassRefPtr<UString::Rep> add(JSGlobalData*, const char*); // Only to be used with string literals.
@@ -93,30 +91,28 @@
 
         static PassRefPtr<UString::Rep> add(ExecState* exec, UString::Rep* r)
         {
-            if (r->isIdentifier()) {
 #ifndef NDEBUG
-                checkSameIdentifierTable(exec, r);
+            checkCurrentIdentifierTable(exec);
 #endif
+            if (r->isIdentifier())
                 return r;
-            }
             return addSlowCase(exec, r);
         }
         static PassRefPtr<UString::Rep> add(JSGlobalData* globalData, UString::Rep* r)
         {
-            if (r->isIdentifier()) {
 #ifndef NDEBUG
-                checkSameIdentifierTable(globalData, r);
+            checkCurrentIdentifierTable(globalData);
 #endif
+            if (r->isIdentifier())
                 return r;
-            }
             return addSlowCase(globalData, r);
         }
 
         static PassRefPtr<UString::Rep> addSlowCase(ExecState*, UString::Rep* r);
         static PassRefPtr<UString::Rep> addSlowCase(JSGlobalData*, UString::Rep* r);
 
-        static void checkSameIdentifierTable(ExecState*, UString::Rep*);
-        static void checkSameIdentifierTable(JSGlobalData*, UString::Rep*);
+        static void checkCurrentIdentifierTable(ExecState*);
+        static void checkCurrentIdentifierTable(JSGlobalData*);
     };
     
     inline bool operator==(const Identifier& a, const Identifier& b)
@@ -142,67 +138,6 @@
     IdentifierTable* createIdentifierTable();
     void deleteIdentifierTable(IdentifierTable*);
 
-    struct ThreadIdentifierTableData {
-        ThreadIdentifierTableData()
-            : defaultIdentifierTable(0)
-            , currentIdentifierTable(0)
-        {
-        }
-
-        IdentifierTable* defaultIdentifierTable;
-        IdentifierTable* currentIdentifierTable;
-    };
-
-    extern WTF::ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific;
-    void createIdentifierTableSpecific();
-
-    inline IdentifierTable* defaultIdentifierTable()
-    {
-        if (!g_identifierTableSpecific)
-            createIdentifierTableSpecific();
-        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
-
-        return data.defaultIdentifierTable;
-    }
-
-    inline void setDefaultIdentifierTable(IdentifierTable* identifierTable)
-    {
-        if (!g_identifierTableSpecific)
-            createIdentifierTableSpecific();
-        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
-
-        data.defaultIdentifierTable = identifierTable;
-    }
-
-    inline IdentifierTable* currentIdentifierTable()
-    {
-        if (!g_identifierTableSpecific)
-            createIdentifierTableSpecific();
-        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
-
-        return data.currentIdentifierTable;
-    }
-
-    inline IdentifierTable* setCurrentIdentifierTable(IdentifierTable* identifierTable)
-    {
-        if (!g_identifierTableSpecific)
-            createIdentifierTableSpecific();
-        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
-
-        IdentifierTable* oldIdentifierTable = data.currentIdentifierTable;
-        data.currentIdentifierTable = identifierTable;
-        return oldIdentifierTable;
-    }
-
-    inline void resetCurrentIdentifierTable()
-    {
-        if (!g_identifierTableSpecific)
-            createIdentifierTableSpecific();
-        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
-
-        data.currentIdentifierTable = data.defaultIdentifierTable;
-    }
-
 } // namespace JSC
 
 #endif // Identifier_h
diff --git a/JavaScriptCore/runtime/InitializeThreading.cpp b/JavaScriptCore/runtime/InitializeThreading.cpp
index 2605a9a..51d43ee 100644
--- a/JavaScriptCore/runtime/InitializeThreading.cpp
+++ b/JavaScriptCore/runtime/InitializeThreading.cpp
@@ -36,6 +36,7 @@
 #include "UString.h"
 #include <wtf/DateMath.h>
 #include <wtf/Threading.h>
+#include <wtf/WTFThreadData.h>
 
 using namespace WTF;
 
@@ -48,6 +49,7 @@
 static void initializeThreadingOnce()
 {
     WTF::initializeThreading();
+    wtfThreadData();
     initializeUString();
     JSGlobalData::storeVPtrs();
 #if ENABLE(JSC_MULTIPLE_THREADS)
diff --git a/JavaScriptCore/runtime/InternalFunction.cpp b/JavaScriptCore/runtime/InternalFunction.cpp
index c48d628..717b5ff 100644
--- a/JavaScriptCore/runtime/InternalFunction.cpp
+++ b/JavaScriptCore/runtime/InternalFunction.cpp
@@ -40,7 +40,7 @@
 InternalFunction::InternalFunction(JSGlobalData* globalData, NonNullPassRefPtr<Structure> structure, const Identifier& name)
     : JSObject(structure)
 {
-    putDirect(globalData->propertyNames->name, jsString(globalData, name.ustring()), DontDelete | ReadOnly | DontEnum);
+    putDirect(globalData->propertyNames->name, jsString(globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
 }
 
 const UString& InternalFunction::name(ExecState* exec)
diff --git a/JavaScriptCore/runtime/JSAPIValueWrapper.h b/JavaScriptCore/runtime/JSAPIValueWrapper.h
index b5016c2..10ded4c 100644
--- a/JavaScriptCore/runtime/JSAPIValueWrapper.h
+++ b/JavaScriptCore/runtime/JSAPIValueWrapper.h
@@ -23,8 +23,6 @@
 #ifndef JSAPIValueWrapper_h
 #define JSAPIValueWrapper_h
 
-#include <wtf/Platform.h>
-
 #include "JSCell.h"
 #include "CallFrame.h"
 
diff --git a/JavaScriptCore/runtime/JSActivation.cpp b/JavaScriptCore/runtime/JSActivation.cpp
index 22fdaaf..85e8bba 100644
--- a/JavaScriptCore/runtime/JSActivation.cpp
+++ b/JavaScriptCore/runtime/JSActivation.cpp
@@ -139,9 +139,9 @@
     return d()->functionExecutable->usesEval();
 }
 
-JSValue JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue JSActivation::argumentsGetter(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    JSActivation* activation = asActivation(slot.slotBase());
+    JSActivation* activation = asActivation(slotBase);
 
     if (activation->d()->functionExecutable->usesArguments()) {
         PropertySlot slot;
diff --git a/JavaScriptCore/runtime/JSActivation.h b/JavaScriptCore/runtime/JSActivation.h
index 761bee4..91c960c 100644
--- a/JavaScriptCore/runtime/JSActivation.h
+++ b/JavaScriptCore/runtime/JSActivation.h
@@ -89,7 +89,7 @@
             RefPtr<FunctionExecutable> functionExecutable;
         };
         
-        static JSValue argumentsGetter(ExecState*, const Identifier&, const PropertySlot&);
+        static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
         NEVER_INLINE PropertySlot::GetValueFunc getArgumentsGetter();
 
         JSActivationData* d() const { return static_cast<JSActivationData*>(JSVariableObject::d); }
diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp
index 2be7371..d3ef44c 100644
--- a/JavaScriptCore/runtime/JSArray.cpp
+++ b/JavaScriptCore/runtime/JSArray.cpp
@@ -151,7 +151,7 @@
     m_vectorLength = initialCapacity;
     m_storage->m_numValuesInVector = 0;
     m_storage->m_sparseValueMap = 0;
-    m_storage->lazyCreationData = 0;
+    m_storage->subclassData = 0;
     m_storage->reportedMapCapacity = 0;
 
     JSValue* vector = m_storage->m_vector;
@@ -173,7 +173,7 @@
     m_vectorLength = initialCapacity;
     m_storage->m_numValuesInVector = initialCapacity;
     m_storage->m_sparseValueMap = 0;
-    m_storage->lazyCreationData = 0;
+    m_storage->subclassData = 0;
     m_storage->reportedMapCapacity = 0;
 
     size_t i = 0;
@@ -1022,14 +1022,14 @@
     return numDefined;
 }
 
-void* JSArray::lazyCreationData()
+void* JSArray::subclassData() const
 {
-    return m_storage->lazyCreationData;
+    return m_storage->subclassData;
 }
 
-void JSArray::setLazyCreationData(void* d)
+void JSArray::setSubclassData(void* d)
 {
-    m_storage->lazyCreationData = d;
+    m_storage->subclassData = d;
 }
 
 #if CHECK_ARRAY_CONSISTENCY
diff --git a/JavaScriptCore/runtime/JSArray.h b/JavaScriptCore/runtime/JSArray.h
index ad6ee88..f65f2bc 100644
--- a/JavaScriptCore/runtime/JSArray.h
+++ b/JavaScriptCore/runtime/JSArray.h
@@ -31,7 +31,7 @@
         unsigned m_length;
         unsigned m_numValuesInVector;
         SparseArrayValueMap* m_sparseValueMap;
-        void* lazyCreationData; // A JSArray subclass can use this to fill the vector lazily.
+        void* subclassData; // A JSArray subclass can use this to fill the vector lazily.
         size_t reportedMapCapacity;
         JSValue m_vector[1];
     };
@@ -101,8 +101,8 @@
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
         virtual void markChildren(MarkStack&);
 
-        void* lazyCreationData();
-        void setLazyCreationData(void*);
+        void* subclassData() const;
+        void setSubclassData(void*);
 
     private:
         virtual const ClassInfo* classInfo() const { return &info; }
diff --git a/JavaScriptCore/runtime/JSCell.cpp b/JavaScriptCore/runtime/JSCell.cpp
index 869fbfc..0cc1ab1 100644
--- a/JavaScriptCore/runtime/JSCell.cpp
+++ b/JavaScriptCore/runtime/JSCell.cpp
@@ -163,16 +163,6 @@
     return toObject(exec);
 }
 
-UString JSCell::toThisString(ExecState* exec) const
-{
-    return toThisObject(exec)->toString(exec);
-}
-
-JSString* JSCell::toThisJSString(ExecState* exec)
-{
-    return jsString(exec, toThisString(exec));
-}
-
 const ClassInfo* JSCell::classInfo() const
 {
     return 0;
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 3c8c829..772708f 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -107,8 +107,6 @@
         virtual bool deleteProperty(ExecState*, unsigned propertyName);
 
         virtual JSObject* toThisObject(ExecState*) const;
-        virtual UString toThisString(ExecState*) const;
-        virtual JSString* toThisJSString(ExecState*);
         virtual JSValue getJSNumber();
         void* vptr() { return *reinterpret_cast<void**>(this); }
         void setVPtr(void* vptr) { *reinterpret_cast<void**>(this) = vptr; }
@@ -301,11 +299,6 @@
         return asCell()->structure()->typeInfo().needsThisConversion();
     }
 
-    inline UString JSValue::toThisString(ExecState* exec) const
-    {
-        return isCell() ? asCell()->toThisString(exec) : toString(exec);
-    }
-
     inline JSValue JSValue::getJSNumber()
     {
         if (isInt32() || isDouble())
diff --git a/JavaScriptCore/runtime/JSFunction.cpp b/JavaScriptCore/runtime/JSFunction.cpp
index d213b4a..cba6795 100644
--- a/JavaScriptCore/runtime/JSFunction.cpp
+++ b/JavaScriptCore/runtime/JSFunction.cpp
@@ -122,23 +122,23 @@
     return exec->interpreter()->execute(jsExecutable(), exec, this, thisValue.toThisObject(exec), args, scopeChain().node(), exec->exceptionSlot());
 }
 
-JSValue JSFunction::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    JSFunction* thisObj = asFunction(slot.slotBase());
+    JSFunction* thisObj = asFunction(slotBase);
     ASSERT(!thisObj->isHostFunction());
     return exec->interpreter()->retrieveArguments(exec, thisObj);
 }
 
-JSValue JSFunction::callerGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    JSFunction* thisObj = asFunction(slot.slotBase());
+    JSFunction* thisObj = asFunction(slotBase);
     ASSERT(!thisObj->isHostFunction());
     return exec->interpreter()->retrieveCaller(exec, thisObj);
 }
 
-JSValue JSFunction::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue JSFunction::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    JSFunction* thisObj = asFunction(slot.slotBase());
+    JSFunction* thisObj = asFunction(slotBase);
     ASSERT(!thisObj->isHostFunction());
     return jsNumber(exec, thisObj->jsExecutable()->parameterCount());
 }
@@ -162,17 +162,17 @@
     }
 
     if (propertyName == exec->propertyNames().arguments) {
-        slot.setCustom(this, argumentsGetter);
+        slot.setCacheableCustom(this, argumentsGetter);
         return true;
     }
 
     if (propertyName == exec->propertyNames().length) {
-        slot.setCustom(this, lengthGetter);
+        slot.setCacheableCustom(this, lengthGetter);
         return true;
     }
 
     if (propertyName == exec->propertyNames().caller) {
-        slot.setCustom(this, callerGetter);
+        slot.setCacheableCustom(this, callerGetter);
         return true;
     }
 
diff --git a/JavaScriptCore/runtime/JSFunction.h b/JavaScriptCore/runtime/JSFunction.h
index 8cd4b51..afa24a8 100644
--- a/JavaScriptCore/runtime/JSFunction.h
+++ b/JavaScriptCore/runtime/JSFunction.h
@@ -90,9 +90,9 @@
 
         virtual const ClassInfo* classInfo() const { return &info; }
 
-        static JSValue argumentsGetter(ExecState*, const Identifier&, const PropertySlot&);
-        static JSValue callerGetter(ExecState*, const Identifier&, const PropertySlot&);
-        static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
+        static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
+        static JSValue callerGetter(ExecState*, JSValue, const Identifier&);
+        static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
 
         RefPtr<ExecutableBase> m_executable;
         ScopeChain& scopeChain()
diff --git a/JavaScriptCore/runtime/JSGlobalData.cpp b/JavaScriptCore/runtime/JSGlobalData.cpp
index 45abc86..2948d1c 100644
--- a/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -49,6 +49,7 @@
 #include "Lookup.h"
 #include "Nodes.h"
 #include "Parser.h"
+#include <wtf/WTFThreadData.h>
 
 #if ENABLE(JSC_MULTIPLE_THREADS)
 #include <wtf/Threading.h>
@@ -102,7 +103,7 @@
     jsFunction->~JSCell();
 }
 
-JSGlobalData::JSGlobalData(bool isShared)
+JSGlobalData::JSGlobalData(bool isShared, ThreadStackType threadStackType)
     : isSharedInstance(isShared)
     , clientData(0)
     , arrayTable(fastNew<HashTable>(JSC::arrayTable))
@@ -115,6 +116,7 @@
     , stringTable(fastNew<HashTable>(JSC::stringTable))
     , activationStructure(JSActivation::createStructure(jsNull()))
     , interruptedExecutionErrorStructure(JSObject::createStructure(jsNull()))
+    , terminatedExecutionErrorStructure(JSObject::createStructure(jsNull()))
     , staticScopeStructure(JSStaticScopeObject::createStructure(jsNull()))
     , stringStructure(JSString::createStructure(jsNull()))
     , notAnObjectErrorStubStructure(JSNotAnObjectErrorStub::createStructure(jsNull()))
@@ -144,8 +146,9 @@
     , markStack(jsArrayVPtr)
     , cachedUTCOffset(NaN)
     , weakRandom(static_cast<int>(currentTime()))
+    , maxReentryDepth(threadStackType == ThreadStackTypeSmall ? MaxSmallThreadReentryDepth : MaxLargeThreadReentryDepth)
 #ifndef NDEBUG
-    , mainThreadOnly(false)
+    , exclusiveThread(0)
 #endif
 {
 #if PLATFORM(MAC)
@@ -194,23 +197,22 @@
     delete clientData;
 }
 
-PassRefPtr<JSGlobalData> JSGlobalData::createNonDefault()
+PassRefPtr<JSGlobalData> JSGlobalData::createNonDefault(ThreadStackType type)
 {
-    return adoptRef(new JSGlobalData(false));
+    return adoptRef(new JSGlobalData(false, type));
 }
 
-PassRefPtr<JSGlobalData> JSGlobalData::create()
+PassRefPtr<JSGlobalData> JSGlobalData::create(ThreadStackType type)
 {
-    JSGlobalData* globalData = new JSGlobalData(false);
-    setDefaultIdentifierTable(globalData->identifierTable);
-    setCurrentIdentifierTable(globalData->identifierTable);
+    JSGlobalData* globalData = new JSGlobalData(false, type);
+    wtfThreadData().initializeIdentifierTable(globalData->identifierTable);
     return adoptRef(globalData);
 }
 
-PassRefPtr<JSGlobalData> JSGlobalData::createLeaked()
+PassRefPtr<JSGlobalData> JSGlobalData::createLeaked(ThreadStackType type)
 {
     Structure::startIgnoringLeaks();
-    RefPtr<JSGlobalData> data = create();
+    RefPtr<JSGlobalData> data = create(type);
     Structure::stopIgnoringLeaks();
     return data.release();
 }
@@ -224,7 +226,7 @@
 {
     JSGlobalData*& instance = sharedInstanceInternal();
     if (!instance) {
-        instance = new JSGlobalData(true);
+        instance = new JSGlobalData(true, ThreadStackTypeSmall);
 #if ENABLE(JSC_MULTIPLE_THREADS)
         instance->makeUsableFromMultipleThreads();
 #endif
diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h
index 0f1f3c6..a90bf2c 100644
--- a/JavaScriptCore/runtime/JSGlobalData.h
+++ b/JavaScriptCore/runtime/JSGlobalData.h
@@ -37,6 +37,7 @@
 #include "MarkStack.h"
 #include "NumericStrings.h"
 #include "SmallStrings.h"
+#include "Terminator.h"
 #include "TimeoutChecker.h"
 #include "WeakRandom.h"
 #include <wtf/Forward.h>
@@ -83,6 +84,11 @@
         double increment;
     };
 
+    enum ThreadStackType {
+        ThreadStackTypeLarge,
+        ThreadStackTypeSmall
+    };
+
     class JSGlobalData : public RefCounted<JSGlobalData> {
     public:
         struct ClientData {
@@ -92,9 +98,9 @@
         static bool sharedInstanceExists();
         static JSGlobalData& sharedInstance();
 
-        static PassRefPtr<JSGlobalData> create();
-        static PassRefPtr<JSGlobalData> createLeaked();
-        static PassRefPtr<JSGlobalData> createNonDefault();
+        static PassRefPtr<JSGlobalData> create(ThreadStackType);
+        static PassRefPtr<JSGlobalData> createLeaked(ThreadStackType);
+        static PassRefPtr<JSGlobalData> createNonDefault(ThreadStackType);
         ~JSGlobalData();
 
 #if ENABLE(JSC_MULTIPLE_THREADS)
@@ -116,6 +122,7 @@
         
         RefPtr<Structure> activationStructure;
         RefPtr<Structure> interruptedExecutionErrorStructure;
+        RefPtr<Structure> terminatedExecutionErrorStructure;
         RefPtr<Structure> staticScopeStructure;
         RefPtr<Structure> stringStructure;
         RefPtr<Structure> notAnObjectErrorStubStructure;
@@ -153,6 +160,7 @@
         JITThunks jitStubs;
 #endif
         TimeoutChecker timeoutChecker;
+        Terminator terminator;
         Heap heap;
 
         JSValue exception;
@@ -184,8 +192,9 @@
         
         WeakRandom weakRandom;
 
+        int maxReentryDepth;
 #ifndef NDEBUG
-        bool mainThreadOnly;
+        ThreadIdentifier exclusiveThread;
 #endif
 
         void resetDateCache();
@@ -194,7 +203,7 @@
         void stopSampling();
         void dumpSampleData(ExecState* exec);
     private:
-        JSGlobalData(bool isShared);
+        JSGlobalData(bool isShared, ThreadStackType);
         static JSGlobalData*& sharedInstanceInternal();
         void createNativeThunk();
     };
diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp
index 4bf0a69..86690bd 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -319,9 +319,9 @@
     // Set global values.
     GlobalPropertyInfo staticGlobals[] = {
         GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, MathObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete),
-        GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete),
-        GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete),
-        GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete),
+        GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete | ReadOnly),
+        GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete | ReadOnly),
+        GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly),
         GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(JSONObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete)
     };
 
diff --git a/JavaScriptCore/runtime/JSGlobalObject.h b/JavaScriptCore/runtime/JSGlobalObject.h
index bbb6d5e..df942cf 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/JavaScriptCore/runtime/JSGlobalObject.h
@@ -25,6 +25,7 @@
 #include "JSArray.h"
 #include "JSGlobalData.h"
 #include "JSVariableObject.h"
+#include "JSWeakObjectMapRefInternal.h"
 #include "NativeFunctionWrapper.h"
 #include "NumberPrototype.h"
 #include "StringPrototype.h"
@@ -56,6 +57,7 @@
     class JSGlobalObject : public JSVariableObject {
     protected:
         using JSVariableObject::JSVariableObjectData;
+        typedef HashSet<RefPtr<OpaqueJSWeakObjectMap> > WeakMapSet;
 
         struct JSGlobalObjectData : public JSVariableObjectData {
             // We use an explicit destructor function pointer instead of a
@@ -153,6 +155,7 @@
             RefPtr<JSGlobalData> globalData;
 
             HashSet<GlobalCodeBlock*> codeBlocks;
+            WeakMapSet weakMaps;
         };
 
     public:
@@ -270,6 +273,16 @@
             return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
         }
 
+        void registerWeakMap(OpaqueJSWeakObjectMap* map)
+        {
+            d()->weakMaps.add(map);
+        }
+
+        void deregisterWeakMap(OpaqueJSWeakObjectMap* map)
+        {
+            d()->weakMaps.remove(map);
+        }
+
     protected:
 
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index 0e1fbee..5b6369a 100644
--- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -35,6 +35,7 @@
 #include "LiteralParser.h"
 #include "Nodes.h"
 #include "Parser.h"
+#include "StringBuilder.h"
 #include "StringExtras.h"
 #include "dtoa.h"
 #include <stdio.h>
@@ -54,12 +55,12 @@
 {
     UString str = args.at(0).toString(exec);
     CString cstr = str.UTF8String(true);
-    if (!cstr.c_str())
+    if (!cstr.data())
         return throwError(exec, URIError, "String contained an illegal UTF-16 sequence.");
 
     JSStringBuilder builder;
-    const char* p = cstr.c_str();
-    for (size_t k = 0; k < cstr.size(); k++, p++) {
+    const char* p = cstr.data();
+    for (size_t k = 0; k < cstr.length(); k++, p++) {
         char c = *p;
         if (c && strchr(doNotEscape, c))
             builder.append(c);
@@ -429,8 +430,7 @@
 #ifndef NDEBUG
 JSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState* exec, JSObject*, JSValue, const ArgList& args)
 {
-    CStringBuffer string;
-    args.at(0).toString(exec).getCString(string);
+    CString string = args.at(0).toString(exec).UTF8String();
     puts(string.data());
     return jsUndefined();
 }
diff --git a/JavaScriptCore/runtime/JSImmediate.h b/JavaScriptCore/runtime/JSImmediate.h
index 4ed35fc..0f54f60 100644
--- a/JavaScriptCore/runtime/JSImmediate.h
+++ b/JavaScriptCore/runtime/JSImmediate.h
@@ -22,8 +22,6 @@
 #ifndef JSImmediate_h
 #define JSImmediate_h
 
-#include <wtf/Platform.h>
-
 #if !USE(JSVALUE32_64)
 
 #include <wtf/Assertions.h>
diff --git a/JavaScriptCore/runtime/JSNumberCell.cpp b/JavaScriptCore/runtime/JSNumberCell.cpp
index f1009b9..a61c751 100644
--- a/JavaScriptCore/runtime/JSNumberCell.cpp
+++ b/JavaScriptCore/runtime/JSNumberCell.cpp
@@ -57,11 +57,6 @@
     return UString::from(m_value);
 }
 
-UString JSNumberCell::toThisString(ExecState*) const
-{
-    return UString::from(m_value);
-}
-
 JSObject* JSNumberCell::toObject(ExecState* exec) const
 {
     return constructNumber(exec, const_cast<JSNumberCell*>(this));
diff --git a/JavaScriptCore/runtime/JSNumberCell.h b/JavaScriptCore/runtime/JSNumberCell.h
index bcb506b..cdd2d8c 100644
--- a/JavaScriptCore/runtime/JSNumberCell.h
+++ b/JavaScriptCore/runtime/JSNumberCell.h
@@ -62,7 +62,6 @@
         virtual UString toString(ExecState*) const;
         virtual JSObject* toObject(ExecState*) const;
 
-        virtual UString toThisString(ExecState*) const;
         virtual JSObject* toThisObject(ExecState*) const;
         virtual JSValue getJSNumber();
 
diff --git a/JavaScriptCore/runtime/JSONObject.cpp b/JavaScriptCore/runtime/JSONObject.cpp
index d69a8da..f6c6b5f 100644
--- a/JavaScriptCore/runtime/JSONObject.cpp
+++ b/JavaScriptCore/runtime/JSONObject.cpp
@@ -31,6 +31,7 @@
 #include "ExceptionHelpers.h"
 #include "JSArray.h"
 #include "LiteralParser.h"
+#include "Lookup.h"
 #include "PropertyNameArray.h"
 #include "StringBuilder.h"
 #include <wtf/MathExtras.h>
@@ -868,4 +869,12 @@
     return Stringifier(exec, replacer, space).stringify(value);
 }
 
+UString JSONStringify(ExecState* exec, JSValue value, unsigned indent)
+{
+    JSValue result = Stringifier(exec, jsNull(), jsNumber(exec, indent)).stringify(value);
+    if (result.isUndefinedOrNull())
+        return UString();
+    return result.getString(exec);
+}
+
 } // namespace JSC
diff --git a/JavaScriptCore/runtime/JSONObject.h b/JavaScriptCore/runtime/JSONObject.h
index 905e4bc..7a9e0a4 100644
--- a/JavaScriptCore/runtime/JSONObject.h
+++ b/JavaScriptCore/runtime/JSONObject.h
@@ -57,6 +57,8 @@
         static const ClassInfo info;
     };
 
+    UString JSONStringify(ExecState* exec, JSValue value, unsigned indent);
+
 } // namespace JSC
 
 #endif // JSONObject_h
diff --git a/JavaScriptCore/runtime/JSObject.h b/JavaScriptCore/runtime/JSObject.h
index 2b31a65..64a1118 100644
--- a/JavaScriptCore/runtime/JSObject.h
+++ b/JavaScriptCore/runtime/JSObject.h
@@ -26,6 +26,7 @@
 #include "ArgList.h"
 #include "ClassInfo.h"
 #include "CommonIdentifiers.h"
+#include "Completion.h"
 #include "CallFrame.h"
 #include "JSCell.h"
 #include "JSNumberCell.h"
@@ -35,6 +36,7 @@
 #include "ScopeChain.h"
 #include "Structure.h"
 #include "JSGlobalData.h"
+#include "JSString.h"
 #include <wtf/StdLibExtras.h>
 
 namespace JSC {
@@ -194,9 +196,10 @@
         virtual bool isGlobalObject() const { return false; }
         virtual bool isVariableObject() const { return false; }
         virtual bool isActivationObject() const { return false; }
-        virtual bool isWatchdogException() const { return false; }
         virtual bool isNotAnObjectErrorStub() const { return false; }
 
+        virtual ComplType exceptionType() const { return Throw; }
+
         void allocatePropertyStorage(size_t oldSize, size_t newSize);
         void allocatePropertyStorageInline(size_t oldSize, size_t newSize);
         bool isUsingInlineStorage() const { return m_structure->isUsingInlineStorage(); }
@@ -436,12 +439,20 @@
         JSCell* currentSpecificFunction;
         size_t offset = m_structure->get(propertyName, currentAttributes, currentSpecificFunction);
         if (offset != WTF::notFound) {
+            // If there is currently a specific function, and there now either isn't,
+            // or the new value is different, then despecify.
             if (currentSpecificFunction && (specificFunction != currentSpecificFunction))
                 m_structure->despecifyDictionaryFunction(propertyName);
             if (checkReadOnly && currentAttributes & ReadOnly)
                 return;
             putDirectOffset(offset, value);
-            if (!specificFunction && !currentSpecificFunction)
+            // At this point, the objects structure only has a specific value set if previously there
+            // had been one set, and if the new value being specified is the same (otherwise we would
+            // have despecified, above).  So, if currentSpecificFunction is not set, or if the new
+            // value is different (or there is no new value), then the slot now has no value - and
+            // as such it is cachable.
+            // If there was previously a value, and the new value is the same, then we cannot cache.
+            if (!currentSpecificFunction || (specificFunction != currentSpecificFunction))
                 slot.setExistingProperty(this, offset);
             return;
         }
@@ -468,7 +479,8 @@
         ASSERT(offset < structure->propertyStorageCapacity());
         setStructure(structure.release());
         putDirectOffset(offset, value);
-        // See comment on setNewProperty call below.
+        // This is a new property; transitions with specific values are not currently cachable,
+        // so leave the slot in an uncachable state.
         if (!specificFunction)
             slot.setNewProperty(this, offset);
         return;
@@ -481,14 +493,28 @@
         if (checkReadOnly && currentAttributes & ReadOnly)
             return;
 
-        if (currentSpecificFunction && (specificFunction != currentSpecificFunction)) {
+        // There are three possibilities here:
+        //  (1) There is an existing specific value set, and we're overwriting with *the same value*.
+        //       * Do nothing - no need to despecify, but that means we can't cache (a cached
+        //         put could write a different value). Leave the slot in an uncachable state.
+        //  (2) There is a specific value currently set, but we're writing a different value.
+        //       * First, we have to despecify.  Having done so, this is now a regular slot
+        //         with no specific value, so go ahead & cache like normal.
+        //  (3) Normal case, there is no specific value set.
+        //       * Go ahead & cache like normal.
+        if (currentSpecificFunction) {
+            // case (1) Do the put, then return leaving the slot uncachable.
+            if (specificFunction == currentSpecificFunction) {
+                putDirectOffset(offset, value);
+                return;
+            }
+            // case (2) Despecify, fall through to (3).
             setStructure(Structure::despecifyFunctionTransition(m_structure, propertyName));
-            putDirectOffset(offset, value);
-            // Function transitions are not currently cachable, so leave the slot in an uncachable state.
-            return;
         }
-        putDirectOffset(offset, value);
+
+        // case (3) set the slot, do the put, return.
         slot.setExistingProperty(this, offset);
+        putDirectOffset(offset, value);
         return;
     }
 
@@ -510,7 +536,8 @@
     ASSERT(offset < structure->propertyStorageCapacity());
     setStructure(structure.release());
     putDirectOffset(offset, value);
-    // Function transitions are not currently cachable, so leave the slot in an uncachable state.
+    // This is a new property; transitions with specific values are not currently cachable,
+    // so leave the slot in an uncachable state.
     if (!specificFunction)
         slot.setNewProperty(this, offset);
 }
@@ -685,6 +712,18 @@
     markStack.appendValues(reinterpret_cast<JSValue*>(storage), storageSize);
 }
 
+// --- JSValue inlines ----------------------------
+
+ALWAYS_INLINE UString JSValue::toThisString(ExecState* exec) const
+{
+    return isString() ? static_cast<JSString*>(asCell())->value(exec) : toThisObject(exec)->toString(exec);
+}
+
+inline JSString* JSValue::toThisJSString(ExecState* exec) const
+{
+    return isString() ? static_cast<JSString*>(asCell()) : jsString(exec, toThisObject(exec)->toString(exec));
+}
+
 } // namespace JSC
 
 #endif // JSObject_h
diff --git a/JavaScriptCore/runtime/JSPropertyNameIterator.h b/JavaScriptCore/runtime/JSPropertyNameIterator.h
index 3f533a0..01700ac 100644
--- a/JavaScriptCore/runtime/JSPropertyNameIterator.h
+++ b/JavaScriptCore/runtime/JSPropertyNameIterator.h
@@ -67,8 +67,13 @@
         JSValue get(ExecState*, JSObject*, size_t i);
         size_t size() { return m_jsStringsSize; }
 
-        void setCachedStructure(Structure* structure) { m_cachedStructure = structure; }
-        Structure* cachedStructure() { return m_cachedStructure; }
+        void setCachedStructure(Structure* structure)
+        {
+            ASSERT(!m_cachedStructure);
+            ASSERT(structure);
+            m_cachedStructure = structure;
+        }
+        Structure* cachedStructure() { return m_cachedStructure.get(); }
 
         void setCachedPrototypeChain(NonNullPassRefPtr<StructureChain> cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; }
         StructureChain* cachedPrototypeChain() { return m_cachedPrototypeChain.get(); }
@@ -76,7 +81,7 @@
     private:
         JSPropertyNameIterator(ExecState*, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot);
 
-        Structure* m_cachedStructure;
+        RefPtr<Structure> m_cachedStructure;
         RefPtr<StructureChain> m_cachedPrototypeChain;
         uint32_t m_numCacheableSlots;
         uint32_t m_jsStringsSize;
diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp
index a72457e..fbc7d72 100644
--- a/JavaScriptCore/runtime/JSString.cpp
+++ b/JavaScriptCore/runtime/JSString.cpp
@@ -51,7 +51,7 @@
         m_value = newImpl;
     else {
         for (unsigned i = 0; i < m_fiberCount; ++i) {
-            m_other.m_fibers[i]->deref();
+            RopeImpl::deref(m_other.m_fibers[i]);
             m_other.m_fibers[i] = 0;
         }
         m_fiberCount = 0;
@@ -62,15 +62,15 @@
     }
     UChar* position = buffer + m_length;
 
-    // Start with the current Rope.
-    Vector<Rope::Fiber, 32> workQueue;
-    Rope::Fiber currentFiber;
+    // Start with the current RopeImpl.
+    Vector<RopeImpl::Fiber, 32> workQueue;
+    RopeImpl::Fiber currentFiber;
     for (unsigned i = 0; i < (m_fiberCount - 1); ++i)
         workQueue.append(m_other.m_fibers[i]);
     currentFiber = m_other.m_fibers[m_fiberCount - 1];
     while (true) {
-        if (currentFiber->isRope()) {
-            Rope* rope = static_cast<URopeImpl*>(currentFiber);
+        if (RopeImpl::isRope(currentFiber)) {
+            RopeImpl* rope = static_cast<RopeImpl*>(currentFiber);
             // Copy the contents of the current rope into the workQueue, with the last item in 'currentFiber'
             // (we will be working backwards over the rope).
             unsigned fiberCountMinusOne = rope->fiberCount() - 1;
@@ -81,14 +81,14 @@
             UStringImpl* string = static_cast<UStringImpl*>(currentFiber);
             unsigned length = string->length();
             position -= length;
-            UStringImpl::copyChars(position, string->data(), length);
+            UStringImpl::copyChars(position, string->characters(), length);
 
             // Was this the last item in the work queue?
             if (workQueue.isEmpty()) {
                 // Create a string from the UChar buffer, clear the rope RefPtr.
                 ASSERT(buffer == position);
                 for (unsigned i = 0; i < m_fiberCount; ++i) {
-                    m_other.m_fibers[i]->deref();
+                    RopeImpl::deref(m_other.m_fibers[i]);
                     m_other.m_fibers[i] = 0;
                 }
                 m_fiberCount = 0;
@@ -104,6 +104,18 @@
     }
 }
 
+JSString* JSString::getIndexSlowCase(ExecState* exec, unsigned i)
+{
+    ASSERT(isRope());
+    resolveRope(exec);
+    // Return a safe no-value result, this should never be used, since the excetion will be thrown.
+    if (exec->exception())
+        return jsString(exec, "");
+    ASSERT(!isRope());
+    ASSERT(i < m_value.size());
+    return jsSingleCharacterSubstring(exec, m_value, i);
+}
+
 JSValue JSString::toPrimitive(ExecState*, PreferredPrimitiveType) const
 {
     return const_cast<JSString*>(this);
@@ -131,16 +143,6 @@
     return value(exec);
 }
 
-UString JSString::toThisString(ExecState* exec) const
-{
-    return value(exec);
-}
-
-JSString* JSString::toThisJSString(ExecState*)
-{
-    return this;
-}
-
 inline StringObject* StringObject::create(ExecState* exec, JSString* string)
 {
     return new (exec) StringObject(exec->lexicalGlobalObject()->stringObjectStructure(), string);
@@ -187,7 +189,7 @@
     bool isStrictUInt32;
     unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
     if (isStrictUInt32 && i < m_length) {
-        descriptor.setDescriptor(jsSingleCharacterSubstring(exec, value(exec), i), DontDelete | ReadOnly);
+        descriptor.setDescriptor(getIndex(exec, i), DontDelete | ReadOnly);
         return true;
     }
     
diff --git a/JavaScriptCore/runtime/JSString.h b/JavaScriptCore/runtime/JSString.h
index 0162282..b1dccfa 100644
--- a/JavaScriptCore/runtime/JSString.h
+++ b/JavaScriptCore/runtime/JSString.h
@@ -29,6 +29,7 @@
 #include "JSNumberCell.h"
 #include "PropertyDescriptor.h"
 #include "PropertySlot.h"
+#include "RopeImpl.h"
 
 namespace JSC {
 
@@ -41,7 +42,6 @@
 
     JSString* jsSingleCharacterString(JSGlobalData*, UChar);
     JSString* jsSingleCharacterString(ExecState*, UChar);
-    JSString* jsSingleCharacterSubstring(JSGlobalData*, const UString&, unsigned offset);
     JSString* jsSingleCharacterSubstring(ExecState*, const UString&, unsigned offset);
     JSString* jsSubstring(JSGlobalData*, const UString&, unsigned offset, unsigned length);
     JSString* jsSubstring(ExecState*, const UString&, unsigned offset, unsigned length);
@@ -67,19 +67,17 @@
         friend class JIT;
         friend class JSGlobalData;
 
-        typedef URopeImpl Rope;
-
         class RopeBuilder {
         public:
             RopeBuilder(unsigned fiberCount)
                 : m_index(0)
-                , m_rope(Rope::tryCreateUninitialized(fiberCount))
+                , m_rope(RopeImpl::tryCreateUninitialized(fiberCount))
             {
             }
 
             bool isOutOfMemory() { return !m_rope; }
 
-            void append(Rope::Fiber& fiber)
+            void append(RopeImpl::Fiber& fiber)
             {
                 ASSERT(m_rope);
                 m_rope->initializeFiber(m_index, fiber);
@@ -98,7 +96,7 @@
                     append(jsString->string());
             }
 
-            PassRefPtr<Rope> release()
+            PassRefPtr<RopeImpl> release()
             {
                 ASSERT(m_index == m_rope->fiberCount());
                 return m_rope.release();
@@ -108,7 +106,7 @@
 
         private:
             unsigned m_index;
-            RefPtr<Rope> m_rope;
+            RefPtr<RopeImpl> m_rope;
         };
 
         ALWAYS_INLINE JSString(JSGlobalData* globalData, const UString& value)
@@ -117,6 +115,7 @@
             , m_value(value)
             , m_fiberCount(0)
         {
+            ASSERT(!m_value.isNull());
             Heap::heap(this)->reportExtraMemoryCost(value.cost());
         }
 
@@ -127,6 +126,7 @@
             , m_value(value)
             , m_fiberCount(0)
         {
+            ASSERT(!m_value.isNull());
         }
         JSString(JSGlobalData* globalData, PassRefPtr<UString::Rep> value, HasOtherOwnerType)
             : JSCell(globalData->stringStructure.get())
@@ -134,8 +134,9 @@
             , m_value(value)
             , m_fiberCount(0)
         {
+            ASSERT(!m_value.isNull());
         }
-        JSString(JSGlobalData* globalData, PassRefPtr<Rope> rope)
+        JSString(JSGlobalData* globalData, PassRefPtr<RopeImpl> rope)
             : JSCell(globalData->stringStructure.get())
             , m_length(rope->length())
             , m_fiberCount(1)
@@ -203,6 +204,7 @@
             , m_value(value)
             , m_fiberCount(0)
         {
+            ASSERT(!m_value.isNull());
             // nasty hack because we can't union non-POD types
             m_other.m_finalizerCallback = finalizer;
             m_other.m_finalizerContext = context;
@@ -213,7 +215,7 @@
         {
             ASSERT(vptr() == JSGlobalData::jsStringVPtr);
             for (unsigned i = 0; i < m_fiberCount; ++i)
-                m_other.m_fibers[i]->deref();
+                RopeImpl::deref(m_other.m_fibers[i]);
 
             if (!m_fiberCount && m_other.m_finalizerCallback)
                 m_other.m_finalizerCallback(this, m_other.m_finalizerContext);
@@ -240,6 +242,7 @@
 
         bool canGetIndex(unsigned i) { return i < m_length; }
         JSString* getIndex(ExecState*, unsigned);
+        JSString* getIndexSlowCase(ExecState*, unsigned);
 
         static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(StringType, OverridesGetOwnPropertySlot | NeedsThisConversion), AnonymousSlotCount); }
 
@@ -264,7 +267,7 @@
         {
             if (jsString->isRope()) {
                 for (unsigned i = 0; i < jsString->m_fiberCount; ++i) {
-                    Rope::Fiber fiber = jsString->m_other.m_fibers[i];
+                    RopeImpl::Fiber fiber = jsString->m_other.m_fibers[i];
                     fiber->ref();
                     m_other.m_fibers[index++] = fiber;
                 }
@@ -297,8 +300,6 @@
         virtual UString toString(ExecState*) const;
 
         virtual JSObject* toThisObject(ExecState*) const;
-        virtual UString toThisString(ExecState*) const;
-        virtual JSString* toThisJSString(ExecState*);
 
         // Actually getPropertySlot, not getOwnPropertySlot (see JSCell).
         virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
@@ -307,7 +308,7 @@
 
         static const unsigned s_maxInternalRopeLength = 3;
 
-        // A string is represented either by a UString or a Rope.
+        // A string is represented either by a UString or a RopeImpl.
         unsigned m_length;
         mutable UString m_value;
         mutable unsigned m_fiberCount;
@@ -315,7 +316,7 @@
         struct JSStringFinalizerStruct {
             JSStringFinalizerStruct() : m_finalizerCallback(0) {}
             union {
-                mutable Rope::Fiber m_fibers[s_maxInternalRopeLength];
+                mutable RopeImpl::Fiber m_fibers[s_maxInternalRopeLength];
                 struct {
                     JSStringFinalizerCallback m_finalizerCallback;
                     void* m_finalizerContext;
@@ -365,8 +366,9 @@
         return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(&c, 1)));
     }
 
-    inline JSString* jsSingleCharacterSubstring(JSGlobalData* globalData, const UString& s, unsigned offset)
+    inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset)
     {
+        JSGlobalData* globalData = &exec->globalData();
         ASSERT(offset < static_cast<unsigned>(s.size()));
         UChar c = s.data()[offset];
         if (c <= 0xFF)
@@ -391,7 +393,10 @@
     inline JSString* JSString::getIndex(ExecState* exec, unsigned i)
     {
         ASSERT(canGetIndex(i));
-        return jsSingleCharacterSubstring(&exec->globalData(), value(exec), i);
+        if (isRope())
+            return getIndexSlowCase(exec, i);
+        ASSERT(i < m_value.size());
+        return jsSingleCharacterSubstring(exec, value(exec), i);
     }
 
     inline JSString* jsString(JSGlobalData* globalData, const UString& s)
@@ -445,7 +450,6 @@
     inline JSString* jsEmptyString(ExecState* exec) { return jsEmptyString(&exec->globalData()); }
     inline JSString* jsString(ExecState* exec, const UString& s) { return jsString(&exec->globalData(), s); }
     inline JSString* jsSingleCharacterString(ExecState* exec, UChar c) { return jsSingleCharacterString(&exec->globalData(), c); }
-    inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset) { return jsSingleCharacterSubstring(&exec->globalData(), s, offset); }
     inline JSString* jsSubstring(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); }
     inline JSString* jsNontrivialString(ExecState* exec, const UString& s) { return jsNontrivialString(&exec->globalData(), s); }
     inline JSString* jsNontrivialString(ExecState* exec, const char* s) { return jsNontrivialString(&exec->globalData(), s); }
@@ -461,7 +465,7 @@
         bool isStrictUInt32;
         unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
         if (isStrictUInt32 && i < m_length) {
-            slot.setValue(jsSingleCharacterSubstring(exec, value(exec), i));
+            slot.setValue(getIndex(exec, i));
             return true;
         }
 
@@ -471,7 +475,7 @@
     ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
     {
         if (propertyName < m_length) {
-            slot.setValue(jsSingleCharacterSubstring(exec, value(exec), propertyName));
+            slot.setValue(getIndex(exec, propertyName));
             return true;
         }
 
@@ -482,11 +486,6 @@
 
     // --- JSValue inlines ----------------------------
 
-    inline JSString* JSValue::toThisJSString(ExecState* exec)
-    {
-        return isCell() ? asCell()->toThisJSString(exec) : jsString(exec, toString(exec));
-    }
-
     inline UString JSValue::toString(ExecState* exec) const
     {
         if (isString())
diff --git a/JavaScriptCore/runtime/JSStringBuilder.h b/JavaScriptCore/runtime/JSStringBuilder.h
index 2b11736..8f208a1 100644
--- a/JavaScriptCore/runtime/JSStringBuilder.h
+++ b/JavaScriptCore/runtime/JSStringBuilder.h
@@ -28,31 +28,59 @@
 
 #include "ExceptionHelpers.h"
 #include "JSString.h"
-#include "StringBuilder.h"
+#include "Vector.h"
 
 namespace JSC {
 
-class JSStringBuilder : public StringBuilder {
+class JSStringBuilder {
 public:
+    JSStringBuilder()
+        : m_okay(true)
+    {
+    }
+
+    void append(const UChar u)
+    {
+        m_okay &= buffer.tryAppend(&u, 1);
+    }
+
+    void append(const char* str)
+    {
+        append(str, strlen(str));
+    }
+
+    void append(const char* str, size_t len)
+    {
+        m_okay &= buffer.tryReserveCapacity(buffer.size() + len);
+        for (size_t i = 0; i < len; i++) {
+            UChar u = static_cast<unsigned char>(str[i]);
+            m_okay &= buffer.tryAppend(&u, 1);
+        }
+    }
+
+    void append(const UChar* str, size_t len)
+    {
+        m_okay &= buffer.tryAppend(str, len);
+    }
+
+    void append(const UString& str)
+    {
+        m_okay &= buffer.tryAppend(str.data(), str.size());
+    }
+
     JSValue build(ExecState* exec)
     {
+        if (!m_okay)
+            return throwOutOfMemoryError(exec);
         buffer.shrinkToFit();
         if (!buffer.data())
             return throwOutOfMemoryError(exec);
         return jsString(exec, UString::adopt(buffer));
     }
 
-private:
-    // Make attempts to call this compile error - if you only wanted a UString,
-    // Why didn't you just use a StringBuilder?!  (This may change, maybe at some
-    // point in the future we'll need to start building a string not knowing whether
-    // we'll want a UString or a JSValue - but until we have this requirement,
-    // block this).
-    UString build()
-    {
-        ASSERT_NOT_REACHED();
-        return StringBuilder::build();
-    }
+protected:
+    Vector<UChar, 64> buffer;
+    bool m_okay;
 };
 
 template<typename StringType1, typename StringType2>
diff --git a/JavaScriptCore/runtime/JSTypeInfo.h b/JavaScriptCore/runtime/JSTypeInfo.h
index 7c89600..e225bc7 100644
--- a/JavaScriptCore/runtime/JSTypeInfo.h
+++ b/JavaScriptCore/runtime/JSTypeInfo.h
@@ -50,6 +50,8 @@
         TypeInfo(JSType type, unsigned flags = 0)
             : m_type(type)
         {
+            ASSERT(flags <= 0xFF);
+            ASSERT(type <= 0xFF);
             // ImplementsDefaultHasInstance means (ImplementsHasInstance & !OverridesHasInstance)
             if ((flags & (ImplementsHasInstance | OverridesHasInstance)) == ImplementsHasInstance)
                 m_flags = flags | ImplementsDefaultHasInstance;
@@ -57,7 +59,7 @@
                 m_flags = flags;
         }
 
-        JSType type() const { return m_type; }
+        JSType type() const { return (JSType)m_type; }
 
         bool masqueradesAsUndefined() const { return m_flags & MasqueradesAsUndefined; }
         bool implementsHasInstance() const { return m_flags & ImplementsHasInstance; }
@@ -69,8 +71,8 @@
         unsigned flags() const { return m_flags; }
 
     private:
-        JSType m_type;
-        unsigned m_flags;
+        unsigned char m_type;
+        unsigned char m_flags;
     };
 
 }
diff --git a/JavaScriptCore/runtime/JSValue.h b/JavaScriptCore/runtime/JSValue.h
index 6da921f..b37adc0 100644
--- a/JavaScriptCore/runtime/JSValue.h
+++ b/JavaScriptCore/runtime/JSValue.h
@@ -188,7 +188,7 @@
         bool needsThisConversion() const;
         JSObject* toThisObject(ExecState*) const;
         UString toThisString(ExecState*) const;
-        JSString* toThisJSString(ExecState*);
+        JSString* toThisJSString(ExecState*) const;
 
         static bool equal(ExecState* exec, JSValue v1, JSValue v2);
         static bool equalSlowCase(ExecState* exec, JSValue v1, JSValue v2);
diff --git a/JavaScriptCore/runtime/JSZombie.h b/JavaScriptCore/runtime/JSZombie.h
index 8b33ea6..711f673 100644
--- a/JavaScriptCore/runtime/JSZombie.h
+++ b/JavaScriptCore/runtime/JSZombie.h
@@ -60,8 +60,6 @@
     virtual bool deleteProperty(ExecState*, const Identifier&) { ASSERT_NOT_REACHED(); return false; }
     virtual bool deleteProperty(ExecState*, unsigned) { ASSERT_NOT_REACHED(); return false; }
     virtual JSObject* toThisObject(ExecState*) const { ASSERT_NOT_REACHED(); return 0; }
-    virtual UString toThisString(ExecState*) const { ASSERT_NOT_REACHED(); return ""; }
-    virtual JSString* toThisJSString(ExecState*) { ASSERT_NOT_REACHED(); return 0; }
     virtual JSValue getJSNumber() { ASSERT_NOT_REACHED(); return jsNull(); }
     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&) { ASSERT_NOT_REACHED(); return false; }
     virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&) { ASSERT_NOT_REACHED(); return false; }
diff --git a/JavaScriptCore/runtime/Lookup.h b/JavaScriptCore/runtime/Lookup.h
index e673c09..995aeee 100644
--- a/JavaScriptCore/runtime/Lookup.h
+++ b/JavaScriptCore/runtime/Lookup.h
@@ -181,7 +181,7 @@
         if (entry->attributes() & Function)
             setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
         else
-            slot.setCustom(thisObj, entry->propertyGetter());
+            slot.setCacheableCustom(thisObj, entry->propertyGetter());
 
         return true;
     }
@@ -258,7 +258,7 @@
 
         ASSERT(!(entry->attributes() & Function));
 
-        slot.setCustom(thisObj, entry->propertyGetter());
+        slot.setCacheableCustom(thisObj, entry->propertyGetter());
         return true;
     }
 
diff --git a/JavaScriptCore/runtime/MathObject.cpp b/JavaScriptCore/runtime/MathObject.cpp
index 8f22fba..16d32a0 100644
--- a/JavaScriptCore/runtime/MathObject.cpp
+++ b/JavaScriptCore/runtime/MathObject.cpp
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "MathObject.h"
 
+#include "Lookup.h"
 #include "ObjectPrototype.h"
 #include "Operations.h"
 #include <time.h>
@@ -216,8 +217,6 @@
 JSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec, JSObject*, JSValue, const ArgList& args)
 {
     double arg = args.at(0).toNumber(exec);
-    if (signbit(arg) && arg >= -0.5)
-         return jsNumber(exec, -0.0);
     double integer = ceil(arg);
     return jsNumber(exec, integer - (integer - arg > 0.5));
 }
diff --git a/JavaScriptCore/runtime/NumberConstructor.cpp b/JavaScriptCore/runtime/NumberConstructor.cpp
index cc6c51d..0b7e821 100644
--- a/JavaScriptCore/runtime/NumberConstructor.cpp
+++ b/JavaScriptCore/runtime/NumberConstructor.cpp
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "NumberConstructor.h"
 
+#include "Lookup.h"
 #include "NumberObject.h"
 #include "NumberPrototype.h"
 
@@ -29,11 +30,11 @@
 
 ASSERT_CLASS_FITS_IN_CELL(NumberConstructor);
 
-static JSValue numberConstructorNaNValue(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue numberConstructorNegInfinity(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue numberConstructorPosInfinity(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue numberConstructorMaxValue(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue numberConstructorMinValue(ExecState*, const Identifier&, const PropertySlot&);
+static JSValue numberConstructorNaNValue(ExecState*, JSValue, const Identifier&);
+static JSValue numberConstructorNegInfinity(ExecState*, JSValue, const Identifier&);
+static JSValue numberConstructorPosInfinity(ExecState*, JSValue, const Identifier&);
+static JSValue numberConstructorMaxValue(ExecState*, JSValue, const Identifier&);
+static JSValue numberConstructorMinValue(ExecState*, JSValue, const Identifier&);
 
 } // namespace JSC
 
@@ -73,27 +74,27 @@
     return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, descriptor);
 }
 
-static JSValue numberConstructorNaNValue(ExecState* exec, const Identifier&, const PropertySlot&)
+static JSValue numberConstructorNaNValue(ExecState* exec, JSValue, const Identifier&)
 {
     return jsNaN(exec);
 }
 
-static JSValue numberConstructorNegInfinity(ExecState* exec, const Identifier&, const PropertySlot&)
+static JSValue numberConstructorNegInfinity(ExecState* exec, JSValue, const Identifier&)
 {
     return jsNumber(exec, -Inf);
 }
 
-static JSValue numberConstructorPosInfinity(ExecState* exec, const Identifier&, const PropertySlot&)
+static JSValue numberConstructorPosInfinity(ExecState* exec, JSValue, const Identifier&)
 {
     return jsNumber(exec, Inf);
 }
 
-static JSValue numberConstructorMaxValue(ExecState* exec, const Identifier&, const PropertySlot&)
+static JSValue numberConstructorMaxValue(ExecState* exec, JSValue, const Identifier&)
 {
     return jsNumber(exec, 1.7976931348623157E+308);
 }
 
-static JSValue numberConstructorMinValue(ExecState* exec, const Identifier&, const PropertySlot&)
+static JSValue numberConstructorMinValue(ExecState* exec, JSValue, const Identifier&)
 {
     return jsNumber(exec, 5E-324);
 }
diff --git a/JavaScriptCore/runtime/NumericStrings.h b/JavaScriptCore/runtime/NumericStrings.h
index c0696a4..89235af 100644
--- a/JavaScriptCore/runtime/NumericStrings.h
+++ b/JavaScriptCore/runtime/NumericStrings.h
@@ -45,6 +45,8 @@
 
         UString add(int i)
         {
+            if (static_cast<unsigned>(i) < cacheSize)
+                return lookupSmallString(static_cast<unsigned>(i));
             CacheEntry<int>& entry = lookup(i);
             if (i == entry.key && !entry.value.isNull())
                 return entry.value;
@@ -53,6 +55,17 @@
             return entry.value;
         }
 
+        UString add(unsigned i)
+        {
+            if (i < cacheSize)
+                return lookupSmallString(static_cast<unsigned>(i));
+            CacheEntry<unsigned>& entry = lookup(i);
+            if (i == entry.key && !entry.value.isNull())
+                return entry.value;
+            entry.key = i;
+            entry.value = UString::from(i);
+            return entry.value;
+        }
     private:
         static const size_t cacheSize = 64;
 
@@ -64,9 +77,19 @@
 
         CacheEntry<double>& lookup(double d) { return doubleCache[WTF::FloatHash<double>::hash(d) & (cacheSize - 1)]; }
         CacheEntry<int>& lookup(int i) { return intCache[WTF::IntHash<int>::hash(i) & (cacheSize - 1)]; }
+        CacheEntry<unsigned>& lookup(unsigned i) { return unsignedCache[WTF::IntHash<unsigned>::hash(i) & (cacheSize - 1)]; }
+        const UString& lookupSmallString(unsigned i)
+        {
+            ASSERT(i < cacheSize);
+            if (smallIntCache[i].isNull())
+                smallIntCache[i] = UString::from(i);
+            return smallIntCache[i];
+        }
 
         CacheEntry<double> doubleCache[cacheSize];
         CacheEntry<int> intCache[cacheSize];
+        CacheEntry<unsigned> unsignedCache[cacheSize];
+        UString smallIntCache[cacheSize];
     };
 
 } // namespace JSC
diff --git a/JavaScriptCore/runtime/PropertyNameArray.cpp b/JavaScriptCore/runtime/PropertyNameArray.cpp
index 4937b7c..6b24669 100644
--- a/JavaScriptCore/runtime/PropertyNameArray.cpp
+++ b/JavaScriptCore/runtime/PropertyNameArray.cpp
@@ -30,7 +30,7 @@
 
 void PropertyNameArray::add(UString::Rep* identifier)
 {
-    ASSERT(identifier == &UString::Rep::empty() || identifier->isIdentifier());
+    ASSERT(identifier == UString::null().rep() || identifier == UString::Rep::empty() || identifier->isIdentifier());
 
     size_t size = m_data->propertyNameVector().size();
     if (size < setThreshold) {
diff --git a/JavaScriptCore/runtime/PropertySlot.cpp b/JavaScriptCore/runtime/PropertySlot.cpp
index 8b6ceb9..2306a11 100644
--- a/JavaScriptCore/runtime/PropertySlot.cpp
+++ b/JavaScriptCore/runtime/PropertySlot.cpp
@@ -26,19 +26,19 @@
 
 namespace JSC {
 
-JSValue PropertySlot::functionGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue PropertySlot::functionGetter(ExecState* exec) const
 {
     // Prevent getter functions from observing execution if an exception is pending.
     if (exec->hadException())
         return exec->exception();
 
     CallData callData;
-    CallType callType = slot.m_data.getterFunc->getCallData(callData);
+    CallType callType = m_data.getterFunc->getCallData(callData);
     if (callType == CallTypeHost)
-        return callData.native.function(exec, slot.m_data.getterFunc, slot.thisValue(), exec->emptyList());
+        return callData.native.function(exec, m_data.getterFunc, thisValue(), exec->emptyList());
     ASSERT(callType == CallTypeJS);
     // FIXME: Can this be done more efficiently using the callData?
-    return asFunction(slot.m_data.getterFunc)->call(exec, slot.thisValue(), exec->emptyList());
+    return asFunction(m_data.getterFunc)->call(exec, thisValue(), exec->emptyList());
 }
 
 } // namespace JSC
diff --git a/JavaScriptCore/runtime/PropertySlot.h b/JavaScriptCore/runtime/PropertySlot.h
index a364e42..de9ddc9 100644
--- a/JavaScriptCore/runtime/PropertySlot.h
+++ b/JavaScriptCore/runtime/PropertySlot.h
@@ -34,10 +34,20 @@
 
 #define JSC_VALUE_SLOT_MARKER 0
 #define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1)
+#define INDEX_GETTER_MARKER reinterpret_cast<GetValueFunc>(2)
+#define GETTER_FUNCTION_MARKER reinterpret_cast<GetValueFunc>(3)
 
     class PropertySlot {
     public:
+        enum CachedPropertyType {
+            Uncacheable,
+            Getter,
+            Custom,
+            Value
+        };
+
         PropertySlot()
+            : m_cachedPropertyType(Uncacheable)
         {
             clearBase();
             clearOffset();
@@ -46,12 +56,14 @@
 
         explicit PropertySlot(const JSValue base)
             : m_slotBase(base)
+            , m_cachedPropertyType(Uncacheable)
         {
             clearOffset();
             clearValue();
         }
 
-        typedef JSValue (*GetValueFunc)(ExecState*, const Identifier&, const PropertySlot&);
+        typedef JSValue (*GetValueFunc)(ExecState*, JSValue slotBase, const Identifier&);
+        typedef JSValue (*GetIndexValueFunc)(ExecState*, JSValue slotBase, unsigned);
 
         JSValue getValue(ExecState* exec, const Identifier& propertyName) const
         {
@@ -59,7 +71,11 @@
                 return *m_data.valueSlot;
             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
                 return (*m_data.registerSlot).jsValue();
-            return m_getValue(exec, propertyName, *this);
+            if (m_getValue == INDEX_GETTER_MARKER)
+                return m_getIndexValue(exec, slotBase(), index());
+            if (m_getValue == GETTER_FUNCTION_MARKER)
+                return functionGetter(exec);
+            return m_getValue(exec, slotBase(), propertyName);
         }
 
         JSValue getValue(ExecState* exec, unsigned propertyName) const
@@ -68,12 +84,16 @@
                 return *m_data.valueSlot;
             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
                 return (*m_data.registerSlot).jsValue();
-            return m_getValue(exec, Identifier::from(exec, propertyName), *this);
+            if (m_getValue == INDEX_GETTER_MARKER)
+                return m_getIndexValue(exec, m_slotBase, m_data.index);
+            if (m_getValue == GETTER_FUNCTION_MARKER)
+                return functionGetter(exec);
+            return m_getValue(exec, slotBase(), Identifier::from(exec, propertyName));
         }
 
-        bool isGetter() const { return m_isGetter; }
-        bool isCacheable() const { return m_isCacheable; }
-        bool isCacheableValue() const { return m_isCacheable && !m_isGetter; }
+        CachedPropertyType cachedPropertyType() const { return m_cachedPropertyType; }
+        bool isCacheable() const { return m_cachedPropertyType != Uncacheable; }
+        bool isCacheableValue() const { return m_cachedPropertyType == Value; }
         size_t cachedOffset() const
         {
             ASSERT(isCacheable());
@@ -104,8 +124,7 @@
             m_slotBase = slotBase;
             m_data.valueSlot = valueSlot;
             m_offset = offset;
-            m_isCacheable = true;
-            m_isGetter = false;
+            m_cachedPropertyType = Value;
         }
         
         void setValue(JSValue value)
@@ -132,14 +151,26 @@
             ASSERT(slotBase);
             ASSERT(getValue);
             m_getValue = getValue;
+            m_getIndexValue = 0;
             m_slotBase = slotBase;
         }
-
-        void setCustomIndex(JSValue slotBase, unsigned index, GetValueFunc getValue)
+        
+        void setCacheableCustom(JSValue slotBase, GetValueFunc getValue)
         {
             ASSERT(slotBase);
             ASSERT(getValue);
             m_getValue = getValue;
+            m_getIndexValue = 0;
+            m_slotBase = slotBase;
+            m_cachedPropertyType = Custom;
+        }
+
+        void setCustomIndex(JSValue slotBase, unsigned index, GetIndexValueFunc getIndexValue)
+        {
+            ASSERT(slotBase);
+            ASSERT(getIndexValue);
+            m_getValue = INDEX_GETTER_MARKER;
+            m_getIndexValue = getIndexValue;
             m_slotBase = slotBase;
             m_data.index = index;
         }
@@ -148,21 +179,19 @@
         {
             ASSERT(getterFunc);
             m_thisValue = m_slotBase;
-            m_getValue = functionGetter;
+            m_getValue = GETTER_FUNCTION_MARKER;
             m_data.getterFunc = getterFunc;
-            m_isGetter = true;
         }
 
         void setCacheableGetterSlot(JSValue slotBase, JSObject* getterFunc, unsigned offset)
         {
             ASSERT(getterFunc);
-            m_getValue = functionGetter;
+            m_getValue = GETTER_FUNCTION_MARKER;
             m_thisValue = m_slotBase;
             m_slotBase = slotBase;
             m_data.getterFunc = getterFunc;
             m_offset = offset;
-            m_isCacheable = true;
-            m_isGetter = true;
+            m_cachedPropertyType = Getter;
         }
 
         void setUndefined()
@@ -201,17 +230,23 @@
             // Clear offset even in release builds, in case this PropertySlot has been used before.
             // (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.)
             m_offset = 0;
-            m_isCacheable = false;
-            m_isGetter = false;
+            m_cachedPropertyType = Uncacheable;
         }
 
         unsigned index() const { return m_data.index; }
 
         JSValue thisValue() const { return m_thisValue; }
+
+        GetValueFunc customGetter() const
+        {
+            ASSERT(m_cachedPropertyType == Custom);
+            return m_getValue;
+        }
     private:
-        static JSValue functionGetter(ExecState*, const Identifier&, const PropertySlot&);
+        JSValue functionGetter(ExecState*) const;
 
         GetValueFunc m_getValue;
+        GetIndexValueFunc m_getIndexValue;
         
         JSValue m_slotBase;
         union {
@@ -225,8 +260,7 @@
         JSValue m_thisValue;
 
         size_t m_offset;
-        bool m_isCacheable : 1;
-        bool m_isGetter : 1;
+        CachedPropertyType m_cachedPropertyType;
     };
 
 } // namespace JSC
diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp
index 85d41ee..f097943 100644
--- a/JavaScriptCore/runtime/RegExp.cpp
+++ b/JavaScriptCore/runtime/RegExp.cpp
@@ -40,20 +40,12 @@
 
 #else
 
-#if ENABLE(WREC)
-#include "JIT.h"
-#include "WRECGenerator.h"
-#endif
 #include <pcre/pcre.h>
 
 #endif
 
 namespace JSC {
 
-#if ENABLE(WREC)
-using namespace WREC;
-#endif
-
 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
     : m_pattern(pattern)
     , m_flagBits(0)
@@ -164,18 +156,9 @@
 
 #else
 
-void RegExp::compile(JSGlobalData* globalData)
+void RegExp::compile(JSGlobalData*)
 {
     m_regExp = 0;
-#if ENABLE(WREC)
-    m_wrecFunction = Generator::compileRegExp(globalData, m_pattern, &m_numSubpatterns, &m_constructionError, m_executablePool, ignoreCase(), multiline());
-    if (m_wrecFunction || m_constructionError)
-        return;
-    // Fall through to non-WREC case.
-#else
-    UNUSED_PARAM(globalData);
-#endif
-
     JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
     JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine;
     m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(m_pattern.data()), m_pattern.size(), ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
@@ -191,36 +174,6 @@
     if (static_cast<unsigned>(startOffset) > s.size() || s.isNull())
         return -1;
 
-#if ENABLE(WREC)
-    if (m_wrecFunction) {
-        int offsetVectorSize = (m_numSubpatterns + 1) * 2;
-        int* offsetVector;
-        Vector<int, 32> nonReturnedOvector;
-        if (ovector) {
-            ovector->resize(offsetVectorSize);
-            offsetVector = ovector->data();
-        } else {
-            nonReturnedOvector.resize(offsetVectorSize);
-            offsetVector = nonReturnedOvector.data();
-        }
-        ASSERT(offsetVector);
-        for (int j = 0; j < offsetVectorSize; ++j)
-            offsetVector[j] = -1;
-
-        int result = m_wrecFunction(s.data(), startOffset, s.size(), offsetVector);
-
-        if (result < 0) {
-#ifndef NDEBUG
-            // TODO: define up a symbol, rather than magic -1
-            if (result != -1)
-                fprintf(stderr, "jsRegExpExecute failed with result %d\n", result);
-#endif
-            if (ovector)
-                ovector->clear();
-        }
-        return result;
-    } else
-#endif
     if (m_regExp) {
         // Set up the offset vector for the result.
         // First 2/3 used for result, the last third used by PCRE.
diff --git a/JavaScriptCore/runtime/RegExp.h b/JavaScriptCore/runtime/RegExp.h
index 61ab0bc..695b688 100644
--- a/JavaScriptCore/runtime/RegExp.h
+++ b/JavaScriptCore/runtime/RegExp.h
@@ -23,7 +23,6 @@
 #define RegExp_h
 
 #include "UString.h"
-#include "WREC.h"
 #include "ExecutableAllocator.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
@@ -74,10 +73,6 @@
 #elif ENABLE(YARR)
         OwnPtr<Yarr::BytecodePattern> m_regExpBytecode;
 #else
-#if ENABLE(WREC)
-        WREC::CompiledRegExp m_wrecFunction;
-        RefPtr<ExecutablePool> m_executablePool;
-#endif
         JSRegExp* m_regExp;
 #endif
     };
diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp
index 6f00142..3a67ae6 100644
--- a/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -27,6 +27,7 @@
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "JSString.h"
+#include "Lookup.h"
 #include "ObjectPrototype.h"
 #include "RegExpMatchesArray.h"
 #include "RegExpObject.h"
@@ -35,21 +36,21 @@
 
 namespace JSC {
 
-static JSValue regExpConstructorInput(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorLastMatch(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorLastParen(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorLeftContext(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorRightContext(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar1(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar2(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar3(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar4(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar5(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar6(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar7(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar8(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpConstructorDollar9(ExecState*, const Identifier&, const PropertySlot&);
+static JSValue regExpConstructorInput(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorMultiline(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorLastMatch(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorLastParen(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorLeftContext(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorRightContext(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar1(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar2(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar3(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar4(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar5(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar6(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar7(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar8(ExecState*, JSValue, const Identifier&);
+static JSValue regExpConstructorDollar9(ExecState*, JSValue, const Identifier&);
 
 static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue);
 static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue);
@@ -113,17 +114,17 @@
     memcpy(d->lastOvector().data(), data->lastOvector().data(), offsetVectorSize * sizeof(int));
     // d->multiline is not needed, and remains uninitialized
 
-    setLazyCreationData(d);
+    setSubclassData(d);
 }
 
 RegExpMatchesArray::~RegExpMatchesArray()
 {
-    delete static_cast<RegExpConstructorPrivate*>(lazyCreationData());
+    delete static_cast<RegExpConstructorPrivate*>(subclassData());
 }
 
 void RegExpMatchesArray::fillArrayInstance(ExecState* exec)
 {
-    RegExpConstructorPrivate* d = static_cast<RegExpConstructorPrivate*>(lazyCreationData());
+    RegExpConstructorPrivate* d = static_cast<RegExpConstructorPrivate*>(subclassData());
     ASSERT(d);
 
     unsigned lastNumSubpatterns = d->lastNumSubPatterns;
@@ -141,7 +142,7 @@
     JSArray::put(exec, exec->propertyNames().input, jsString(exec, d->input), slot);
 
     delete d;
-    setLazyCreationData(0);
+    setSubclassData(0);
 }
 
 JSObject* RegExpConstructor::arrayOfMatches(ExecState* exec) const
@@ -195,79 +196,79 @@
     return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, descriptor);
 }
 
-JSValue regExpConstructorDollar1(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar1(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 1);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 1);
 }
 
-JSValue regExpConstructorDollar2(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar2(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 2);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 2);
 }
 
-JSValue regExpConstructorDollar3(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar3(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 3);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 3);
 }
 
-JSValue regExpConstructorDollar4(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar4(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 4);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 4);
 }
 
-JSValue regExpConstructorDollar5(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar5(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 5);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 5);
 }
 
-JSValue regExpConstructorDollar6(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar6(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 6);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 6);
 }
 
-JSValue regExpConstructorDollar7(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar7(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 7);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 7);
 }
 
-JSValue regExpConstructorDollar8(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar8(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 8);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 8);
 }
 
-JSValue regExpConstructorDollar9(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorDollar9(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 9);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 9);
 }
 
-JSValue regExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorInput(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return jsString(exec, asRegExpConstructor(slot.slotBase())->input());
+    return jsString(exec, asRegExpConstructor(slotBase)->input());
 }
 
-JSValue regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorMultiline(ExecState*, JSValue slotBase, const Identifier&)
 {
-    return jsBoolean(asRegExpConstructor(slot.slotBase())->multiline());
+    return jsBoolean(asRegExpConstructor(slotBase)->multiline());
 }
 
-JSValue regExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorLastMatch(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getBackref(exec, 0);
+    return asRegExpConstructor(slotBase)->getBackref(exec, 0);
 }
 
-JSValue regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorLastParen(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getLastParen(exec);
+    return asRegExpConstructor(slotBase)->getLastParen(exec);
 }
 
-JSValue regExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorLeftContext(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getLeftContext(exec);
+    return asRegExpConstructor(slotBase)->getLeftContext(exec);
 }
 
-JSValue regExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpConstructorRightContext(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return asRegExpConstructor(slot.slotBase())->getRightContext(exec);
+    return asRegExpConstructor(slotBase)->getRightContext(exec);
 }
 
 void RegExpConstructor::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
diff --git a/JavaScriptCore/runtime/RegExpMatchesArray.h b/JavaScriptCore/runtime/RegExpMatchesArray.h
index 38d3cb4..b823621 100644
--- a/JavaScriptCore/runtime/RegExpMatchesArray.h
+++ b/JavaScriptCore/runtime/RegExpMatchesArray.h
@@ -32,56 +32,56 @@
     private:
         virtual bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             return JSArray::getOwnPropertySlot(exec, propertyName, slot);
         }
 
         virtual bool getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             return JSArray::getOwnPropertySlot(exec, propertyName, slot);
         }
 
         virtual bool getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             return JSArray::getOwnPropertyDescriptor(exec, propertyName, descriptor);
         }
 
         virtual void put(ExecState* exec, const Identifier& propertyName, JSValue v, PutPropertySlot& slot)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             JSArray::put(exec, propertyName, v, slot);
         }
 
         virtual void put(ExecState* exec, unsigned propertyName, JSValue v)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             JSArray::put(exec, propertyName, v);
         }
 
         virtual bool deleteProperty(ExecState* exec, const Identifier& propertyName)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             return JSArray::deleteProperty(exec, propertyName);
         }
 
         virtual bool deleteProperty(ExecState* exec, unsigned propertyName)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             return JSArray::deleteProperty(exec, propertyName);
         }
 
         virtual void getOwnPropertyNames(ExecState* exec, PropertyNameArray& arr, EnumerationMode mode = ExcludeDontEnumProperties)
         {
-            if (lazyCreationData())
+            if (subclassData())
                 fillArrayInstance(exec);
             JSArray::getOwnPropertyNames(exec, arr, mode);
         }
diff --git a/JavaScriptCore/runtime/RegExpObject.cpp b/JavaScriptCore/runtime/RegExpObject.cpp
index 42bfcef..bc74924 100644
--- a/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/JavaScriptCore/runtime/RegExpObject.cpp
@@ -25,16 +25,17 @@
 #include "JSArray.h"
 #include "JSGlobalObject.h"
 #include "JSString.h"
+#include "Lookup.h"
 #include "RegExpConstructor.h"
 #include "RegExpPrototype.h"
 
 namespace JSC {
 
-static JSValue regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpObjectSource(ExecState*, const Identifier&, const PropertySlot&);
-static JSValue regExpObjectLastIndex(ExecState*, const Identifier&, const PropertySlot&);
+static JSValue regExpObjectGlobal(ExecState*, JSValue, const Identifier&);
+static JSValue regExpObjectIgnoreCase(ExecState*, JSValue, const Identifier&);
+static JSValue regExpObjectMultiline(ExecState*, JSValue, const Identifier&);
+static JSValue regExpObjectSource(ExecState*, JSValue, const Identifier&);
+static JSValue regExpObjectLastIndex(ExecState*, JSValue, const Identifier&);
 static void setRegExpObjectLastIndex(ExecState*, JSObject*, JSValue);
 
 } // namespace JSC
@@ -77,29 +78,29 @@
     return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, descriptor);
 }
 
-JSValue regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot& slot)
+JSValue regExpObjectGlobal(ExecState*, JSValue slotBase, const Identifier&)
 {
-    return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->global());
+    return jsBoolean(asRegExpObject(slotBase)->regExp()->global());
 }
 
-JSValue regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot& slot)
+JSValue regExpObjectIgnoreCase(ExecState*, JSValue slotBase, const Identifier&)
 {
-    return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->ignoreCase());
+    return jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase());
 }
  
-JSValue regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot& slot)
+JSValue regExpObjectMultiline(ExecState*, JSValue slotBase, const Identifier&)
 {            
-    return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->multiline());
+    return jsBoolean(asRegExpObject(slotBase)->regExp()->multiline());
 }
 
-JSValue regExpObjectSource(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return jsString(exec, asRegExpObject(slot.slotBase())->regExp()->pattern());
+    return jsString(exec, asRegExpObject(slotBase)->regExp()->pattern());
 }
 
-JSValue regExpObjectLastIndex(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue regExpObjectLastIndex(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    return jsNumber(exec, asRegExpObject(slot.slotBase())->lastIndex());
+    return jsNumber(exec, asRegExpObject(slotBase)->lastIndex());
 }
 
 void RegExpObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
diff --git a/JavaScriptCore/runtime/RopeImpl.cpp b/JavaScriptCore/runtime/RopeImpl.cpp
new file mode 100644
index 0000000..a3760e6
--- /dev/null
+++ b/JavaScriptCore/runtime/RopeImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 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 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 "RopeImpl.h"
+
+namespace JSC {
+
+void RopeImpl::derefFibersNonRecursive(Vector<RopeImpl*, 32>& workQueue)
+{
+    unsigned length = fiberCount();
+    for (unsigned i = 0; i < length; ++i) {
+        Fiber& fiber = fibers(i);
+        if (isRope(fiber)) {
+            RopeImpl* nextRope = static_cast<RopeImpl*>(fiber);
+            if (nextRope->hasOneRef())
+                workQueue.append(nextRope);
+            else
+                nextRope->deref();
+        } else
+            static_cast<UStringImpl*>(fiber)->deref();
+    }
+}
+
+void RopeImpl::destructNonRecursive()
+{
+    Vector<RopeImpl*, 32> workQueue;
+
+    derefFibersNonRecursive(workQueue);
+    delete this;
+
+    while (!workQueue.isEmpty()) {
+        RopeImpl* rope = workQueue.last();
+        workQueue.removeLast();
+        rope->derefFibersNonRecursive(workQueue);
+        delete rope;
+    }
+}
+
+} // namespace JSC
diff --git a/JavaScriptCore/runtime/RopeImpl.h b/JavaScriptCore/runtime/RopeImpl.h
new file mode 100644
index 0000000..6fbc595
--- /dev/null
+++ b/JavaScriptCore/runtime/RopeImpl.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2009, 2010 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 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 RopeImpl_h
+#define RopeImpl_h
+
+#include "UStringImpl.h"
+
+namespace JSC {
+
+class RopeImpl : public StringImplBase {
+public:
+    // A RopeImpl is composed from a set of smaller strings called Fibers.
+    // Each Fiber in a rope is either UStringImpl or another RopeImpl.
+    typedef StringImplBase* Fiber;
+
+    // Creates a RopeImpl comprising of 'fiberCount' Fibers.
+    // The RopeImpl is constructed in an uninitialized state - initialize must be called for each Fiber in the RopeImpl.
+    static PassRefPtr<RopeImpl> tryCreateUninitialized(unsigned fiberCount)
+    {
+        void* allocation;
+        if (tryFastMalloc(sizeof(RopeImpl) + (fiberCount - 1) * sizeof(Fiber)).getValue(allocation))
+            return adoptRef(new (allocation) RopeImpl(fiberCount));
+        return 0;
+    }
+
+    void initializeFiber(unsigned &index, Fiber fiber)
+    {
+        m_fibers[index++] = fiber;
+        fiber->ref();
+        m_length += fiber->length();
+    }
+
+    unsigned fiberCount() { return m_fiberCount; }
+    Fiber& fibers(unsigned index) { return m_fibers[index]; }
+
+    ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & s_refCountMask)) destructNonRecursive(); }
+
+    static bool isRope(Fiber fiber)
+    {
+        return !fiber->isStringImpl();
+    }
+
+    static void deref(Fiber fiber)
+    {
+        if (isRope(fiber))
+            static_cast<RopeImpl*>(fiber)->deref();
+        else
+            static_cast<UStringImpl*>(fiber)->deref();
+    }
+
+private:
+    RopeImpl(unsigned fiberCount) : StringImplBase(ConstructNonStringImpl), m_fiberCount(fiberCount) {}
+
+    void destructNonRecursive();
+    void derefFibersNonRecursive(Vector<RopeImpl*, 32>& workQueue);
+
+    bool hasOneRef() { return (m_refCountAndFlags & s_refCountMask) == s_refCountIncrement; }
+
+    unsigned m_fiberCount;
+    Fiber m_fibers[1];
+};
+
+}
+
+#endif
diff --git a/JavaScriptCore/runtime/SmallStrings.cpp b/JavaScriptCore/runtime/SmallStrings.cpp
index 78bd4e4..0f5df4a 100644
--- a/JavaScriptCore/runtime/SmallStrings.cpp
+++ b/JavaScriptCore/runtime/SmallStrings.cpp
@@ -43,10 +43,10 @@
 public:
     SmallStringsStorage();
 
-    UString::Rep* rep(unsigned char character) { return &m_reps[character]; }
+    UString::Rep* rep(unsigned char character) { return m_reps[character].get(); }
 
 private:
-    UString::Rep m_reps[numCharactersToStore];
+    RefPtr<UString::Rep> m_reps[numCharactersToStore];
 };
 
 SmallStringsStorage::SmallStringsStorage()
@@ -55,7 +55,7 @@
     RefPtr<UStringImpl> baseString = UStringImpl::createUninitialized(numCharactersToStore, characterBuffer);
     for (unsigned i = 0; i < numCharactersToStore; ++i) {
         characterBuffer[i] = i;
-        new (&m_reps[i]) UString::Rep(&characterBuffer[i], 1, PassRefPtr<UStringImpl>(baseString));
+        m_reps[i] = UStringImpl::create(baseString, i, 1);
     }
 }
 
diff --git a/JavaScriptCore/runtime/StringBuilder.h b/JavaScriptCore/runtime/StringBuilder.h
index 27dbbd7..59b01e0 100644
--- a/JavaScriptCore/runtime/StringBuilder.h
+++ b/JavaScriptCore/runtime/StringBuilder.h
@@ -69,8 +69,7 @@
     UString build()
     {
         buffer.shrinkToFit();
-        if (buffer.size() && !buffer.data())
-            CRASH();
+        ASSERT(buffer.data() || !buffer.size());
         return UString::adopt(buffer);
     }
 
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index bef4083..345378e 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -29,6 +29,7 @@
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "JSStringBuilder.h"
+#include "Lookup.h"
 #include "ObjectPrototype.h"
 #include "Operations.h"
 #include "PropertyNameArray.h"
diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp
index ebf8a4c..6f23c7d 100644
--- a/JavaScriptCore/runtime/Structure.cpp
+++ b/JavaScriptCore/runtime/Structure.cpp
@@ -265,9 +265,7 @@
         m_previous->transitionTableRemove(make_pair(m_nameInPrevious.get(), m_attributesInPrevious), m_specificValueInPrevious);
 
     }
-    
-    if (m_enumerationCache)
-        m_enumerationCache->setCachedStructure(0);
+    ASSERT(!m_enumerationCache.hasDeadObject());
 
     if (m_propertyTable) {
         unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
diff --git a/JavaScriptCore/runtime/Terminator.h b/JavaScriptCore/runtime/Terminator.h
new file mode 100644
index 0000000..6b0f236
--- /dev/null
+++ b/JavaScriptCore/runtime/Terminator.h
@@ -0,0 +1,47 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Google Inc. ("Google") 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 APPLE AND ITS 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 APPLE OR ITS 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 Terminator_h
+#define Terminator_h
+
+namespace JSC {
+
+class Terminator {
+public:
+    Terminator() : m_shouldTerminate(false) { }
+
+    void terminateSoon() { m_shouldTerminate = true; }
+    bool shouldTerminate() const { return m_shouldTerminate; }
+
+private:
+    bool m_shouldTerminate;
+};
+
+} // namespace JSC
+
+#endif // Terminator_h
diff --git a/JavaScriptCore/runtime/TimeoutChecker.cpp b/JavaScriptCore/runtime/TimeoutChecker.cpp
index 250fdaf..2dc1028 100644
--- a/JavaScriptCore/runtime/TimeoutChecker.cpp
+++ b/JavaScriptCore/runtime/TimeoutChecker.cpp
@@ -84,6 +84,13 @@
     GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
     
     return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
+#elif OS(SYMBIAN)
+    RThread current;
+    TTimeIntervalMicroSeconds cpuTime;
+
+    TInt err = current.GetCpuTime(cpuTime);
+    ASSERT_WITH_MESSAGE(err == KErrNone, "GetCpuTime failed with %d", err);
+    return cpuTime.Int64() / 1000;
 #elif PLATFORM(BREWMP)
     // This function returns a continuously and linearly increasing millisecond
     // timer from the time the device was powered on.
diff --git a/JavaScriptCore/runtime/UString.cpp b/JavaScriptCore/runtime/UString.cpp
index 1684ec2..ce91040 100644
--- a/JavaScriptCore/runtime/UString.cpp
+++ b/JavaScriptCore/runtime/UString.cpp
@@ -57,108 +57,15 @@
 extern const double NaN;
 extern const double Inf;
 
-CString::CString(const char* c)
-    : m_length(strlen(c))
-    , m_data(new char[m_length + 1])
-{
-    memcpy(m_data, c, m_length + 1);
-}
-
-CString::CString(const char* c, size_t length)
-    : m_length(length)
-    , m_data(new char[length + 1])
-{
-    memcpy(m_data, c, m_length);
-    m_data[m_length] = 0;
-}
-
-CString::CString(const CString& b)
-{
-    m_length = b.m_length;
-    if (b.m_data) {
-        m_data = new char[m_length + 1];
-        memcpy(m_data, b.m_data, m_length + 1);
-    } else
-        m_data = 0;
-}
-
-CString::~CString()
-{
-    delete [] m_data;
-}
-
-CString CString::adopt(char* c, size_t length)
-{
-    CString s;
-    s.m_data = c;
-    s.m_length = length;
-    return s;
-}
-
-CString& CString::append(const CString& t)
-{
-    char* n;
-    n = new char[m_length + t.m_length + 1];
-    if (m_length)
-        memcpy(n, m_data, m_length);
-    if (t.m_length)
-        memcpy(n + m_length, t.m_data, t.m_length);
-    m_length += t.m_length;
-    n[m_length] = 0;
-
-    delete [] m_data;
-    m_data = n;
-
-    return *this;
-}
-
-CString& CString::operator=(const char* c)
-{
-    if (m_data)
-        delete [] m_data;
-    m_length = strlen(c);
-    m_data = new char[m_length + 1];
-    memcpy(m_data, c, m_length + 1);
-
-    return *this;
-}
-
-CString& CString::operator=(const CString& str)
-{
-    if (this == &str)
-        return *this;
-
-    if (m_data)
-        delete [] m_data;
-    m_length = str.m_length;
-    if (str.m_data) {
-        m_data = new char[m_length + 1];
-        memcpy(m_data, str.m_data, m_length + 1);
-    } else
-        m_data = 0;
-
-    return *this;
-}
-
-bool operator==(const CString& c1, const CString& c2)
-{
-    size_t len = c1.size();
-    return len == c2.size() && (len == 0 || memcmp(c1.c_str(), c2.c_str(), len) == 0);
-}
-
-// These static strings are immutable, except for rc, whose initial value is chosen to
-// reduce the possibility of it becoming zero due to ref/deref not being thread-safe.
-static UChar sharedEmptyChar;
-UStringImpl* UStringImpl::s_empty;
-
-UString::Rep* UString::s_nullRep;
+// The null string is immutable, except for refCount.
 UString* UString::s_nullUString;
 
 void initializeUString()
 {
-    UStringImpl::s_empty = new UStringImpl(&sharedEmptyChar, 0, UStringImpl::ConstructStaticString);
+    // UStringImpl::empty() does not construct its static string in a threadsafe fashion,
+    // so ensure it has been initialized from here.
+    UStringImpl::empty();
 
-    UString::s_nullRep = new UStringImpl(0, 0, UStringImpl::ConstructStaticString);
     UString::s_nullUString = new UString;
 }
 
@@ -173,11 +80,8 @@
 }
 
 UString::UString(const UChar* c, unsigned length)
+    : m_rep(Rep::create(c, length))
 {
-    if (length == 0)
-        m_rep = &Rep::empty();
-    else
-        m_rep = Rep::create(c, length);
 }
 
 UString UString::from(int i)
@@ -242,7 +146,7 @@
     return UString(p, static_cast<unsigned>(end - p));
 }
 
-UString UString::from(unsigned int u)
+UString UString::from(unsigned u)
 {
     UChar buf[sizeof(u) * 3];
     UChar* end = buf + sizeof(buf) / sizeof(UChar);
@@ -297,29 +201,6 @@
     return UString(buffer, length);
 }
 
-bool UString::getCString(CStringBuffer& buffer) const
-{
-    unsigned length = size();
-    unsigned neededSize = length + 1;
-    buffer.resize(neededSize);
-    char* buf = buffer.data();
-
-    UChar ored = 0;
-    const UChar* p = data();
-    char* q = buf;
-    const UChar* limit = p + length;
-    while (p != limit) {
-        UChar c = p[0];
-        ored |= c;
-        *q = static_cast<char>(c);
-        ++p;
-        ++q;
-    }
-    *q = '\0';
-
-    return !(ored & 0xFF00);
-}
-
 char* UString::ascii() const
 {
     static char* asciiBuffer = 0;
@@ -373,11 +254,7 @@
         return NaN;
     }
 
-    // FIXME: If tolerateTrailingJunk is true, then we want to tolerate non-8-bit junk
-    // after the number, so this is too strict a check.
-    CStringBuffer s;
-    if (!getCString(s))
-        return NaN;
+    CString s = UTF8String();
     const char* c = s.data();
 
     // skip leading white space
@@ -498,7 +375,7 @@
     unsigned len = m_rep->length();
     if (len == 0)
         return 0;
-    const UChar* p = m_rep->data();
+    const UChar* p = m_rep->characters();
     unsigned short c = p[0];
 
     // If the first digit is 0, only 0 itself is OK.
@@ -548,7 +425,7 @@
         const UChar* end = data() + size();
         for (const UChar* c = data() + pos; c < end; c++) {
             if (*c == ch)
-                return static_cast<int>(c - data());
+                return static_cast<unsigned>(c - data());
         }
         return NotFound;
     }
@@ -565,7 +442,7 @@
     ++fdata;
     for (const UChar* c = data() + pos; c <= end; c++) {
         if (c[0] == fchar && !memcmp(c + 1, fdata, fsizeminusone))
-            return static_cast<int>(c - data());
+            return static_cast<unsigned>(c - data());
     }
 
     return NotFound;
@@ -576,7 +453,7 @@
     const UChar* end = data() + size();
     for (const UChar* c = data() + pos; c < end; c++) {
         if (*c == ch)
-            return static_cast<int>(c - data());
+            return static_cast<unsigned>(c - data());
     }
 
     return NotFound;
@@ -596,7 +473,7 @@
     const UChar* fdata = f.data();
     for (const UChar* c = data() + pos; c >= data(); c--) {
         if (*c == *fdata && !memcmp(c + 1, fdata + 1, fsizeminusone))
-            return static_cast<int>(c - data());
+            return static_cast<unsigned>(c - data());
     }
 
     return NotFound;
@@ -610,7 +487,7 @@
         pos = size() - 1;
     for (const UChar* c = data() + pos; c >= data(); c--) {
         if (*c == ch)
-            return static_cast<int>(c - data());
+            return static_cast<unsigned>(c - data());
     }
 
     return NotFound;
@@ -710,20 +587,6 @@
     return (l1 > l2) ? 1 : -1;
 }
 
-bool equal(const UString::Rep* r, const UString::Rep* b)
-{
-    unsigned length = r->length();
-    if (length != b->length())
-        return false;
-    const UChar* d = r->data();
-    const UChar* s = b->data();
-    for (unsigned i = 0; i != length; ++i) {
-        if (d[i] != s[i])
-            return false;
-    }
-    return true;
-}
-
 CString UString::UTF8String(bool strict) const
 {
     // Allocate a buffer big enough to hold all the characters.
diff --git a/JavaScriptCore/runtime/UString.h b/JavaScriptCore/runtime/UString.h
index 75b43b7..da1065e 100644
--- a/JavaScriptCore/runtime/UString.h
+++ b/JavaScriptCore/runtime/UString.h
@@ -33,6 +33,7 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 #include <wtf/unicode/Unicode.h>
 
 namespace JSC {
@@ -40,39 +41,6 @@
     using WTF::PlacementNewAdoptType;
     using WTF::PlacementNewAdopt;
 
-    class CString {
-    public:
-        CString()
-            : m_length(0)
-            , m_data(0)
-        {
-        }
-
-        CString(const char*);
-        CString(const char*, size_t);
-        CString(const CString&);
-
-        ~CString();
-
-        static CString adopt(char*, size_t); // buffer should be allocated with new[].
-
-        CString& append(const CString&);
-        CString& operator=(const char* c);
-        CString& operator=(const CString&);
-        CString& operator+=(const CString& c) { return append(c); }
-
-        size_t size() const { return m_length; }
-        const char* c_str() const { return m_data; }
-
-    private:
-        size_t m_length;
-        char* m_data;
-    };
-
-    bool operator==(const CString&, const CString&);
-
-    typedef Vector<char, 32> CStringBuffer;
-
     class UString {
         friend class JIT;
 
@@ -80,7 +48,7 @@
         typedef UStringImpl Rep;
     
     public:
-        UString();
+        UString() {}
         UString(const char*); // Constructor for null-terminated string.
         UString(const char*, unsigned length);
         UString(const UChar*, unsigned length);
@@ -97,10 +65,6 @@
         {
         }
 
-        ~UString()
-        {
-        }
-
         template<size_t inlineCapacity>
         static PassRefPtr<UStringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
         {
@@ -109,12 +73,10 @@
 
         static UString from(int);
         static UString from(long long);
-        static UString from(unsigned int);
+        static UString from(unsigned);
         static UString from(long);
         static UString from(double);
 
-        bool getCString(CStringBuffer&) const;
-
         // NOTE: This method should only be used for *debugging* purposes as it
         // is neither Unicode safe nor free from side effects nor thread-safe.
         char* ascii() const;
@@ -129,15 +91,25 @@
          */
         CString UTF8String(bool strict = false) const;
 
-        const UChar* data() const { return m_rep->data(); }
+        const UChar* data() const
+        {
+            if (!m_rep)
+                return 0;
+            return m_rep->characters();
+        }
 
-        bool isNull() const { return m_rep == s_nullRep; }
-        bool isEmpty() const { return !m_rep->length(); }
+        unsigned size() const
+        {
+            if (!m_rep)
+                return 0;
+            return m_rep->length();
+        }
+
+        bool isNull() const { return !m_rep; }
+        bool isEmpty() const { return !m_rep || !m_rep->length(); }
 
         bool is8Bit() const;
 
-        unsigned size() const { return m_rep->length(); }
-
         UChar operator[](unsigned pos) const;
 
         double toDouble(bool tolerateTrailingJunk, bool tolerateEmptyString) const;
@@ -165,15 +137,18 @@
         UString(PassRefPtr<Rep> r)
             : m_rep(r)
         {
-            ASSERT(m_rep);
         }
 
-        size_t cost() const { return m_rep->cost(); }
+        size_t cost() const
+        {
+            if (!m_rep)
+                return 0;
+            return m_rep->cost();
+        }
 
     private:
         RefPtr<Rep> m_rep;
 
-        JS_EXPORTDATA static Rep* s_nullRep;
         static UString* s_nullUString;
 
         friend void initializeUString();
@@ -228,11 +203,6 @@
 
     int compare(const UString&, const UString&);
 
-    inline UString::UString()
-        : m_rep(s_nullRep)
-    {
-    }
-
     // Rule from ECMA 15.2 about what an array index is.
     // Must exactly match string form of an unsigned integer, and be less than 2^32 - 1.
     inline unsigned UString::toArrayIndex(bool* ok) const
@@ -657,7 +627,7 @@
 
     template<> struct StrHash<JSC::UString::Rep*> {
         static unsigned hash(const JSC::UString::Rep* key) { return key->hash(); }
-        static bool equal(const JSC::UString::Rep* a, const JSC::UString::Rep* b) { return JSC::equal(a, b); }
+        static bool equal(const JSC::UString::Rep* a, const JSC::UString::Rep* b) { return ::equal(a, b); }
         static const bool safeToCompareToEmptyOrDeleted = false;
     };
 
@@ -665,22 +635,18 @@
         using StrHash<JSC::UString::Rep*>::hash;
         static unsigned hash(const RefPtr<JSC::UString::Rep>& key) { return key->hash(); }
         using StrHash<JSC::UString::Rep*>::equal;
-        static bool equal(const RefPtr<JSC::UString::Rep>& a, const RefPtr<JSC::UString::Rep>& b) { return JSC::equal(a.get(), b.get()); }
-        static bool equal(const JSC::UString::Rep* a, const RefPtr<JSC::UString::Rep>& b) { return JSC::equal(a, b.get()); }
-        static bool equal(const RefPtr<JSC::UString::Rep>& a, const JSC::UString::Rep* b) { return JSC::equal(a.get(), b); }
+        static bool equal(const RefPtr<JSC::UString::Rep>& a, const RefPtr<JSC::UString::Rep>& b) { return ::equal(a.get(), b.get()); }
+        static bool equal(const JSC::UString::Rep* a, const RefPtr<JSC::UString::Rep>& b) { return ::equal(a, b.get()); }
+        static bool equal(const RefPtr<JSC::UString::Rep>& a, const JSC::UString::Rep* b) { return ::equal(a.get(), b); }
 
         static const bool safeToCompareToEmptyOrDeleted = false;
     };
 
-    template<> struct DefaultHash<JSC::UString::Rep*> {
-        typedef StrHash<JSC::UString::Rep*> Hash;
+    template <> struct VectorTraits<JSC::UString> : SimpleClassVectorTraits
+    {
+        static const bool canInitializeWithMemset = true;
     };
-
-    template<> struct DefaultHash<RefPtr<JSC::UString::Rep> > {
-        typedef StrHash<RefPtr<JSC::UString::Rep> > Hash;
-
-    };
-
+    
 } // namespace WTF
 
 #endif
diff --git a/JavaScriptCore/runtime/UStringImpl.cpp b/JavaScriptCore/runtime/UStringImpl.cpp
deleted file mode 100644
index b7d9a40..0000000
--- a/JavaScriptCore/runtime/UStringImpl.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2009 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 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 "UStringImpl.h"
-
-#include "Identifier.h"
-#include "UString.h"
-#include <wtf/unicode/UTF8.h>
-
-using namespace WTF::Unicode;
-using namespace std;
-
-namespace JSC {
-
-PassRefPtr<UStringImpl> UStringImpl::create(const char* c)
-{
-    ASSERT(c);
-
-    if (!c[0])
-        return &UStringImpl::empty();
-
-    size_t length = strlen(c);
-    UChar* d;
-    PassRefPtr<UStringImpl> result = UStringImpl::createUninitialized(length, d);
-    for (size_t i = 0; i < length; i++)
-        d[i] = static_cast<unsigned char>(c[i]); // use unsigned char to zero-extend instead of sign-extend
-    return result;
-}
-
-PassRefPtr<UStringImpl> UStringImpl::create(const char* c, unsigned length)
-{
-    ASSERT(c);
-
-    if (!length)
-        return &UStringImpl::empty();
-
-    UChar* d;
-    PassRefPtr<UStringImpl> result = UStringImpl::createUninitialized(length, d);
-    for (unsigned i = 0; i < length; i++)
-        d[i] = static_cast<unsigned char>(c[i]); // use unsigned char to zero-extend instead of sign-extend
-    return result;
-}
-
-PassRefPtr<UStringImpl> UStringImpl::create(const UChar* buffer, unsigned length)
-{
-    UChar* newBuffer;
-    PassRefPtr<UStringImpl> impl = createUninitialized(length, newBuffer);
-    copyChars(newBuffer, buffer, length);
-    return impl;
-}
-
-SharedUChar* UStringImpl::baseSharedBuffer()
-{
-    ASSERT((bufferOwnership() == BufferShared)
-        || ((bufferOwnership() == BufferOwned) && !m_buffer));
-
-    if (bufferOwnership() != BufferShared) {
-        m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared;
-        m_bufferShared = SharedUChar::create(new OwnFastMallocPtr<UChar>(m_data)).releaseRef();
-    }
-
-    return m_bufferShared;
-}
-
-SharedUChar* UStringImpl::sharedBuffer()
-{
-    if (m_length < s_minLengthToShare)
-        return 0;
-    ASSERT(!isStatic());
-
-    UStringImpl* owner = bufferOwnerString();
-    if (owner->bufferOwnership() == BufferInternal)
-        return 0;
-
-    return owner->baseSharedBuffer();
-}
-
-UStringImpl::~UStringImpl()
-{
-    ASSERT(!isStatic());
-    checkConsistency();
-
-    if (isIdentifier())
-        Identifier::remove(this);
-
-    if (bufferOwnership() != BufferInternal) {
-        if (bufferOwnership() == BufferOwned)
-            fastFree(m_data);
-        else if (bufferOwnership() == BufferSubstring)
-            m_bufferSubstring->deref();
-        else {
-            ASSERT(bufferOwnership() == BufferShared);
-            m_bufferShared->deref();
-        }
-    }
-}
-
-void URopeImpl::derefFibersNonRecursive(Vector<URopeImpl*, 32>& workQueue)
-{
-    unsigned length = fiberCount();
-    for (unsigned i = 0; i < length; ++i) {
-        Fiber& fiber = fibers(i);
-        if (fiber->isRope()) {
-            URopeImpl* nextRope = static_cast<URopeImpl*>(fiber);
-            if (nextRope->hasOneRef())
-                workQueue.append(nextRope);
-            else
-                nextRope->deref();
-        } else
-            static_cast<UStringImpl*>(fiber)->deref();
-    }
-}
-
-void URopeImpl::destructNonRecursive()
-{
-    Vector<URopeImpl*, 32> workQueue;
-
-    derefFibersNonRecursive(workQueue);
-    delete this;
-
-    while (!workQueue.isEmpty()) {
-        URopeImpl* rope = workQueue.last();
-        workQueue.removeLast();
-        rope->derefFibersNonRecursive(workQueue);
-        delete rope;
-    }
-}
-
-} // namespace JSC
diff --git a/JavaScriptCore/runtime/UStringImpl.h b/JavaScriptCore/runtime/UStringImpl.h
index 142e01d..08f1fa5 100644
--- a/JavaScriptCore/runtime/UStringImpl.h
+++ b/JavaScriptCore/runtime/UStringImpl.h
@@ -1,359 +1,30 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 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 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 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 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. 
+ * 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 UStringImpl_h
 #define UStringImpl_h
 
-#include <limits>
-#include <wtf/CrossThreadRefCounted.h>
-#include <wtf/OwnFastMallocPtr.h>
-#include <wtf/PossiblyNull.h>
-#include <wtf/StringHashFunctions.h>
-#include <wtf/Vector.h>
-#include <wtf/unicode/Unicode.h>
-
-namespace JSC {
-
-class IdentifierTable;
-  
-typedef CrossThreadRefCounted<OwnFastMallocPtr<UChar> > SharedUChar;
-
-class UStringOrRopeImpl : public Noncopyable {
-public:
-    bool isRope() { return (m_refCountAndFlags & s_refCountIsRope) == s_refCountIsRope; }
-    unsigned length() const { return m_length; }
-
-    void ref() { m_refCountAndFlags += s_refCountIncrement; }
-    inline void deref();
-
-protected:
-    enum BufferOwnership {
-        BufferInternal,
-        BufferOwned,
-        BufferSubstring,
-        BufferShared,
-    };
-
-    using Noncopyable::operator new;
-    void* operator new(size_t, void* inPlace) { return inPlace; }
-
-    // For SmallStringStorage, which allocates an array and uses an in-place new.
-    UStringOrRopeImpl() { }
-
-    UStringOrRopeImpl(unsigned length, BufferOwnership ownership)
-        : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | ownership)
-        , m_length(length)
-    {
-        ASSERT(!isRope());
-    }
-
-    enum StaticStringConstructType { ConstructStaticString };
-    UStringOrRopeImpl(unsigned length, StaticStringConstructType)
-        : m_refCountAndFlags(s_refCountFlagStatic | BufferOwned)
-        , m_length(length)
-    {
-        ASSERT(!isRope());
-    }
-
-    enum RopeConstructType { ConstructRope };
-    UStringOrRopeImpl(RopeConstructType)
-        : m_refCountAndFlags(s_refCountIncrement | s_refCountIsRope)
-        , m_length(0)
-    {
-        ASSERT(isRope());
-    }
-
-    // The bottom 5 bits hold flags, the top 27 bits hold the ref count.
-    // When dereferencing UStringImpls we check for the ref count AND the
-    // static bit both being zero - static strings are never deleted.
-    static const unsigned s_refCountMask = 0xFFFFFFE0;
-    static const unsigned s_refCountIncrement = 0x20;
-    static const unsigned s_refCountFlagStatic = 0x10;
-    static const unsigned s_refCountFlagShouldReportedCost = 0x8;
-    static const unsigned s_refCountFlagIsIdentifier = 0x4;
-    static const unsigned s_refCountMaskBufferOwnership = 0x3;
-    // Use an otherwise invalid permutation of flags (static & shouldReportedCost -
-    // static strings do not set shouldReportedCost in the constructor, and this bit
-    // is only ever cleared, not set) to identify objects that are ropes.
-    static const unsigned s_refCountIsRope = s_refCountFlagStatic | s_refCountFlagShouldReportedCost;
-
-    unsigned m_refCountAndFlags;
-    unsigned m_length;
-};
-
-class UStringImpl : public UStringOrRopeImpl {
-public:
-    template<size_t inlineCapacity>
-    static PassRefPtr<UStringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
-    {
-        if (unsigned length = vector.size()) {
-            ASSERT(vector.data());
-            return adoptRef(new UStringImpl(vector.releaseBuffer(), length));
-        }
-        return &empty();
-    }
-
-    static PassRefPtr<UStringImpl> create(const char* c);
-    static PassRefPtr<UStringImpl> create(const char* c, unsigned length);
-    static PassRefPtr<UStringImpl> create(const UChar* buffer, unsigned length);
-
-    static PassRefPtr<UStringImpl> create(PassRefPtr<UStringImpl> rep, unsigned offset, unsigned length)
-    {
-        ASSERT(rep);
-        rep->checkConsistency();
-        return adoptRef(new UStringImpl(rep->m_data + offset, length, rep->bufferOwnerString()));
-    }
-
-    static PassRefPtr<UStringImpl> create(PassRefPtr<SharedUChar> sharedBuffer, UChar* buffer, unsigned length)
-    {
-        return adoptRef(new UStringImpl(buffer, length, sharedBuffer));
-    }
-
-    static PassRefPtr<UStringImpl> createUninitialized(unsigned length, UChar*& output)
-    {
-        if (!length) {
-            output = 0;
-            return &empty();
-        }
-
-        if (length > ((std::numeric_limits<size_t>::max() - sizeof(UStringImpl)) / sizeof(UChar)))
-            CRASH();
-        UStringImpl* resultImpl = static_cast<UStringImpl*>(fastMalloc(sizeof(UChar) * length + sizeof(UStringImpl)));
-        output = reinterpret_cast<UChar*>(resultImpl + 1);
-        return adoptRef(new(resultImpl) UStringImpl(length));
-    }
-
-    static PassRefPtr<UStringImpl> tryCreateUninitialized(unsigned length, UChar*& output)
-    {
-        if (!length) {
-            output = 0;
-            return &empty();
-        }
-
-        if (length > ((std::numeric_limits<size_t>::max() - sizeof(UStringImpl)) / sizeof(UChar)))
-            return 0;
-        UStringImpl* resultImpl;
-        if (!tryFastMalloc(sizeof(UChar) * length + sizeof(UStringImpl)).getValue(resultImpl))
-            return 0;
-        output = reinterpret_cast<UChar*>(resultImpl + 1);
-        return adoptRef(new(resultImpl) UStringImpl(length));
-    }
-
-    SharedUChar* sharedBuffer();
-    UChar* data() const { return m_data; }
-    size_t cost()
-    {
-        // For substrings, return the cost of the base string.
-        if (bufferOwnership() == BufferSubstring)
-            return m_bufferSubstring->cost();
-
-        if (m_refCountAndFlags & s_refCountFlagShouldReportedCost) {
-            m_refCountAndFlags &= ~s_refCountFlagShouldReportedCost;
-            return m_length;
-        }
-        return 0;
-    }
-    unsigned hash() const { if (!m_hash) m_hash = computeHash(data(), m_length); return m_hash; }
-    unsigned existingHash() const { ASSERT(m_hash); return m_hash; } // fast path for Identifiers
-    void setHash(unsigned hash) { ASSERT(hash == computeHash(data(), m_length)); m_hash = hash; } // fast path for Identifiers
-    bool isIdentifier() const { return m_refCountAndFlags & s_refCountFlagIsIdentifier; }
-    void setIsIdentifier(bool isIdentifier)
-    {
-        if (isIdentifier)
-            m_refCountAndFlags |= s_refCountFlagIsIdentifier;
-        else
-            m_refCountAndFlags &= ~s_refCountFlagIsIdentifier;
-    }
-
-    ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic))) delete this; }
-
-    static void copyChars(UChar* destination, const UChar* source, unsigned numCharacters)
-    {
-        if (numCharacters <= s_copyCharsInlineCutOff) {
-            for (unsigned i = 0; i < numCharacters; ++i)
-                destination[i] = source[i];
-        } else
-            memcpy(destination, source, numCharacters * sizeof(UChar));
-    }
-
-    static unsigned computeHash(const UChar* s, unsigned length) { return WTF::stringHash(s, length); }
-    static unsigned computeHash(const char* s, unsigned length) { return WTF::stringHash(s, length); }
-    static unsigned computeHash(const char* s) { return WTF::stringHash(s); }
-
-    static UStringImpl& empty() { return *s_empty; }
-
-    ALWAYS_INLINE void checkConsistency() const
-    {
-        // There is no recursion of substrings.
-        ASSERT(bufferOwnerString()->bufferOwnership() != BufferSubstring);
-        // Static strings cannot be put in identifier tables, because they are globally shared.
-        ASSERT(!isStatic() || !isIdentifier());
-    }
-
-private:
-    // For SmallStringStorage, which allocates an array and uses an in-place new.
-    UStringImpl() { }
-
-    // Used to construct normal strings with an internal buffer.
-    UStringImpl(unsigned length)
-        : UStringOrRopeImpl(length, BufferInternal)
-        , m_data(reinterpret_cast<UChar*>(this + 1))
-        , m_buffer(0)
-        , m_hash(0)
-    {
-        checkConsistency();
-    }
-
-    // Used to construct normal strings with an external buffer.
-    UStringImpl(UChar* data, unsigned length)
-        : UStringOrRopeImpl(length, BufferOwned)
-        , m_data(data)
-        , m_buffer(0)
-        , m_hash(0)
-    {
-        checkConsistency();
-    }
-
-    // Used to construct static strings, which have an special refCount that can never hit zero.
-    // This means that the static string will never be destroyed, which is important because
-    // static strings will be shared across threads & ref-counted in a non-threadsafe manner.
-    UStringImpl(UChar* data, unsigned length, StaticStringConstructType)
-        : UStringOrRopeImpl(length, ConstructStaticString)
-        , m_data(data)
-        , m_buffer(0)
-        , m_hash(0)
-    {
-        checkConsistency();
-    }
-
-    // Used to create new strings that are a substring of an existing string.
-    UStringImpl(UChar* data, unsigned length, PassRefPtr<UStringImpl> base)
-        : UStringOrRopeImpl(length, BufferSubstring)
-        , m_data(data)
-        , m_bufferSubstring(base.releaseRef())
-        , m_hash(0)
-    {
-        // Do use static strings as a base for substrings; UntypedPtrAndBitfield assumes
-        // that all pointers will be at least 8-byte aligned, we cannot guarantee that of
-        // UStringImpls that are not heap allocated.
-        ASSERT(m_bufferSubstring->length());
-        ASSERT(!m_bufferSubstring->isStatic());
-        checkConsistency();
-    }
-
-    // Used to construct new strings sharing an existing shared buffer.
-    UStringImpl(UChar* data, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
-        : UStringOrRopeImpl(length, BufferShared)
-        , m_data(data)
-        , m_bufferShared(sharedBuffer.releaseRef())
-        , m_hash(0)
-    {
-        checkConsistency();
-    }
-
-    ~UStringImpl();
-
-    // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings.
-    static const unsigned s_minLengthToShare = 10;
-    static const unsigned s_copyCharsInlineCutOff = 20;
-
-    UStringImpl* bufferOwnerString() { return (bufferOwnership() == BufferSubstring) ? m_bufferSubstring :  this; }
-    const UStringImpl* bufferOwnerString() const { return (bufferOwnership() == BufferSubstring) ? m_bufferSubstring :  this; }
-    SharedUChar* baseSharedBuffer();
-    unsigned bufferOwnership() const { return m_refCountAndFlags & s_refCountMaskBufferOwnership; }
-    bool isStatic() const { return m_refCountAndFlags & s_refCountFlagStatic; }
-
-    // unshared data
-    UChar* m_data;
-    union {
-        void* m_buffer;
-        UStringImpl* m_bufferSubstring;
-        SharedUChar* m_bufferShared;
-    };
-    mutable unsigned m_hash;
-
-    JS_EXPORTDATA static UStringImpl* s_empty;
-
-    friend class JIT;
-    friend class SmallStringsStorage;
-    friend class UStringOrRopeImpl;
-    friend void initializeUString();
-};
-
-class URopeImpl : public UStringOrRopeImpl {
-public:
-    // A URopeImpl is composed from a set of smaller strings called Fibers.
-    // Each Fiber in a rope is either UStringImpl or another URopeImpl.
-    typedef UStringOrRopeImpl* Fiber;
-
-    // Creates a URopeImpl comprising of 'fiberCount' Fibers.
-    // The URopeImpl is constructed in an uninitialized state - initialize must be called for each Fiber in the URopeImpl.
-    static PassRefPtr<URopeImpl> tryCreateUninitialized(unsigned fiberCount)
-    {
-        void* allocation;
-        if (tryFastMalloc(sizeof(URopeImpl) + (fiberCount - 1) * sizeof(Fiber)).getValue(allocation))
-            return adoptRef(new (allocation) URopeImpl(fiberCount));
-        return 0;
-    }
-
-    void initializeFiber(unsigned &index, Fiber fiber)
-    {
-        m_fibers[index++] = fiber;
-        fiber->ref();
-        m_length += fiber->length();
-    }
-
-    unsigned fiberCount() { return m_fiberCount; }
-    Fiber& fibers(unsigned index) { return m_fibers[index]; }
-
-    ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & s_refCountMask)) destructNonRecursive(); }
-
-private:
-    URopeImpl(unsigned fiberCount) : UStringOrRopeImpl(ConstructRope), m_fiberCount(fiberCount) {}
-
-    void destructNonRecursive();
-    void derefFibersNonRecursive(Vector<URopeImpl*, 32>& workQueue);
-
-    bool hasOneRef() { return (m_refCountAndFlags & s_refCountMask) == s_refCountIncrement; }
-
-    unsigned m_fiberCount;
-    Fiber m_fibers[1];
-
-    friend class UStringOrRopeImpl;
-};
-
-inline void UStringOrRopeImpl::deref()
-{
-    if (isRope())
-        static_cast<URopeImpl*>(this)->deref();
-    else
-        static_cast<UStringImpl*>(this)->deref();
-}
-
-bool equal(const UStringImpl*, const UStringImpl*);
-
-}
+// FIXME: Remove this redundant name!
+#include <wtf/text/StringImpl.h>
+namespace JSC { typedef WebCore::StringImpl UStringImpl; }
 
 #endif
diff --git a/JavaScriptCore/runtime/WeakGCPtr.h b/JavaScriptCore/runtime/WeakGCPtr.h
index 3ed4645..5f58374 100644
--- a/JavaScriptCore/runtime/WeakGCPtr.h
+++ b/JavaScriptCore/runtime/WeakGCPtr.h
@@ -65,6 +65,10 @@
 
     WeakGCPtr& operator=(T*);
 
+#if !ASSERT_DISABLED
+    bool hasDeadObject() const { return !!m_ptr; }
+#endif
+
 private:
     void assign(T* ptr)
     {
diff --git a/JavaScriptCore/tests/perf/bench-allocate-nonretained.js b/JavaScriptCore/tests/perf/bench-allocate-nonretained.js
new file mode 100644
index 0000000..d493416
--- /dev/null
+++ b/JavaScriptCore/tests/perf/bench-allocate-nonretained.js
@@ -0,0 +1,6 @@
+(function () {
+    for (var i = 0; i < 500; ++i) {
+        for (var j = 0; j < 100000; ++j)
+            var a = {};
+    }
+})();
diff --git a/JavaScriptCore/tests/perf/bench-allocate-retained.js b/JavaScriptCore/tests/perf/bench-allocate-retained.js
new file mode 100644
index 0000000..4e6a4bd
--- /dev/null
+++ b/JavaScriptCore/tests/perf/bench-allocate-retained.js
@@ -0,0 +1,10 @@
+(function () {
+    var a = new Array(100000);
+    for (var i = 0; i < 100000; ++i)
+        a[i] = {};
+
+    for (var i = 0; i < 500; ++i) {
+        for (var j = 0; j < 100000; ++j)
+            var b = {};
+    }
+})();
diff --git a/JavaScriptCore/wrec/CharacterClass.cpp b/JavaScriptCore/wrec/CharacterClass.cpp
deleted file mode 100644
index e3f12f2..0000000
--- a/JavaScriptCore/wrec/CharacterClass.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "CharacterClass.h"
-
-#if ENABLE(WREC)
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-const CharacterClass& CharacterClass::newline() {
-    static const UChar asciiNewlines[2] = { '\n', '\r' };
-    static const UChar unicodeNewlines[2] = { 0x2028, 0x2029 };
-    static const CharacterClass charClass = {
-        asciiNewlines, 2,
-        0, 0,
-        unicodeNewlines, 2,
-        0, 0,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::digits() {
-    static const CharacterRange asciiDigitsRange[1] = { { '0', '9' } };
-    static const CharacterClass charClass = {
-        0, 0,
-        asciiDigitsRange, 1,
-        0, 0,
-        0, 0,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::spaces() {
-    static const UChar asciiSpaces[1] = { ' ' };
-    static const CharacterRange asciiSpacesRange[1] = { { '\t', '\r' } };
-    static const UChar unicodeSpaces[8] = { 0x00a0, 0x1680, 0x180e, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000 };
-    static const CharacterRange unicodeSpacesRange[1] = { { 0x2000, 0x200a } };
-    static const CharacterClass charClass = {
-        asciiSpaces, 1,
-        asciiSpacesRange, 1,
-        unicodeSpaces, 8,
-        unicodeSpacesRange, 1,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::wordchar() {
-    static const UChar asciiWordchar[1] = { '_' };
-    static const CharacterRange asciiWordcharRange[3] = { { '0', '9' }, { 'A', 'Z' }, { 'a', 'z' } };
-    static const CharacterClass charClass = {
-        asciiWordchar, 1,
-        asciiWordcharRange, 3,
-        0, 0,
-        0, 0,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::nondigits() {
-    static const CharacterRange asciiNondigitsRange[2] = { { 0, '0' - 1 }, { '9' + 1, 0x7f } };
-    static const CharacterRange unicodeNondigitsRange[1] = { { 0x0080, 0xffff } };
-    static const CharacterClass charClass = {
-        0, 0,
-        asciiNondigitsRange, 2,
-        0, 0,
-        unicodeNondigitsRange, 1,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::nonspaces() {
-    static const CharacterRange asciiNonspacesRange[3] = { { 0, '\t' - 1 }, { '\r' + 1, ' ' - 1 }, { ' ' + 1, 0x7f } }; 
-    static const CharacterRange unicodeNonspacesRange[9] = {
-        { 0x0080, 0x009f },
-        { 0x00a1, 0x167f },
-        { 0x1681, 0x180d },
-        { 0x180f, 0x1fff },
-        { 0x200b, 0x2027 },
-        { 0x202a, 0x202e },
-        { 0x2030, 0x205e },
-        { 0x2060, 0x2fff },
-        { 0x3001, 0xffff }
-    }; 
-    static const CharacterClass charClass = {
-        0, 0,
-        asciiNonspacesRange, 3,
-        0, 0,
-        unicodeNonspacesRange, 9,
-    };
-    
-    return charClass;
-}
-
-const CharacterClass& CharacterClass::nonwordchar() {
-    static const UChar asciiNonwordchar[1] = { '`' };
-    static const CharacterRange asciiNonwordcharRange[4] = { { 0, '0' - 1 }, { '9' + 1, 'A' - 1 }, { 'Z' + 1, '_' - 1 }, { 'z' + 1, 0x7f } };
-    static const CharacterRange unicodeNonwordcharRange[1] = { { 0x0080, 0xffff } };
-    static const CharacterClass charClass = {
-        asciiNonwordchar, 1,
-        asciiNonwordcharRange, 4,
-        0, 0,
-        unicodeNonwordcharRange, 1,
-    };
-    
-    return charClass;
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/CharacterClass.h b/JavaScriptCore/wrec/CharacterClass.h
deleted file mode 100644
index 8a9d2fc..0000000
--- a/JavaScriptCore/wrec/CharacterClass.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 CharacterClass_h
-#define CharacterClass_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include <wtf/unicode/Unicode.h>
-
-namespace JSC { namespace WREC {
-
-    struct CharacterRange {
-        UChar begin;
-        UChar end;
-    };
-
-    struct CharacterClass {
-        static const CharacterClass& newline();
-        static const CharacterClass& digits();
-        static const CharacterClass& spaces();
-        static const CharacterClass& wordchar();
-        static const CharacterClass& nondigits();
-        static const CharacterClass& nonspaces();
-        static const CharacterClass& nonwordchar();
-
-        const UChar* matches;
-        unsigned numMatches;
-
-        const CharacterRange* ranges;
-        unsigned numRanges;
-
-        const UChar* matchesUnicode;
-        unsigned numMatchesUnicode;
-
-        const CharacterRange* rangesUnicode;
-        unsigned numRangesUnicode;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // CharacterClass_h
diff --git a/JavaScriptCore/wrec/CharacterClassConstructor.cpp b/JavaScriptCore/wrec/CharacterClassConstructor.cpp
deleted file mode 100644
index 06f4262..0000000
--- a/JavaScriptCore/wrec/CharacterClassConstructor.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 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 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 "CharacterClassConstructor.h"
-
-#if ENABLE(WREC)
-
-#include "pcre_internal.h"
-#include <wtf/ASCIICType.h>
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-void CharacterClassConstructor::addSorted(Vector<UChar>& matches, UChar ch)
-{
-    unsigned pos = 0;
-    unsigned range = matches.size();
-
-    // binary chop, find position to insert char.
-    while (range) {
-        unsigned index = range >> 1;
-
-        int val = matches[pos+index] - ch;
-        if (!val)
-            return;
-        else if (val > 0)
-            range = index;
-        else {
-            pos += (index+1);
-            range -= (index+1);
-        }
-    }
-    
-    if (pos == matches.size())
-        matches.append(ch);
-    else
-        matches.insert(pos, ch);
-}
-
-void CharacterClassConstructor::addSortedRange(Vector<CharacterRange>& ranges, UChar lo, UChar hi)
-{
-    unsigned end = ranges.size();
-    
-    // Simple linear scan - I doubt there are that many ranges anyway...
-    // feel free to fix this with something faster (eg binary chop).
-    for (unsigned i = 0; i < end; ++i) {
-        // does the new range fall before the current position in the array
-        if (hi < ranges[i].begin) {
-            // optional optimization: concatenate appending ranges? - may not be worthwhile.
-            if (hi == (ranges[i].begin - 1)) {
-                ranges[i].begin = lo;
-                return;
-            }
-            CharacterRange r = {lo, hi};
-            ranges.insert(i, r);
-            return;
-        }
-        // Okay, since we didn't hit the last case, the end of the new range is definitely at or after the begining
-        // If the new range start at or before the end of the last range, then the overlap (if it starts one after the
-        // end of the last range they concatenate, which is just as good.
-        if (lo <= (ranges[i].end + 1)) {
-            // found an intersect! we'll replace this entry in the array.
-            ranges[i].begin = std::min(ranges[i].begin, lo);
-            ranges[i].end = std::max(ranges[i].end, hi);
-
-            // now check if the new range can subsume any subsequent ranges.
-            unsigned next = i+1;
-            // each iteration of the loop we will either remove something from the list, or break the loop.
-            while (next < ranges.size()) {
-                if (ranges[next].begin <= (ranges[i].end + 1)) {
-                    // the next entry now overlaps / concatenates this one.
-                    ranges[i].end = std::max(ranges[i].end, ranges[next].end);
-                    ranges.remove(next);
-                } else
-                    break;
-            }
-            
-            return;
-        }
-    }
-
-    // CharacterRange comes after all existing ranges.
-    CharacterRange r = {lo, hi};
-    ranges.append(r);
-}
-
-void CharacterClassConstructor::put(UChar ch)
-{
-    // Parsing a regular expression like [a-z], we start in an initial empty state:
-    //     ((m_charBuffer == -1) && !m_isPendingDash)
-    // When buffer the 'a' sice it may be (and is in this case) part of a range:
-    //     ((m_charBuffer != -1) && !m_isPendingDash)
-    // Having parsed the hyphen we then record that the dash is also pending:
-    //     ((m_charBuffer != -1) && m_isPendingDash)
-    // The next change will always take us back to the initial state - either because
-    // a complete range has been parsed (such as [a-z]), or because a flush is forced,
-    // due to an early end in the regexp ([a-]), or a character class escape being added
-    // ([a-\s]).  The fourth permutation of m_charBuffer and m_isPendingDash is not permitted.
-    ASSERT(!((m_charBuffer == -1) && m_isPendingDash));
-
-    if (m_charBuffer != -1) {
-        if (m_isPendingDash) {
-            // EXAMPLE: parsing [-a-c], the 'c' reaches this case - we have buffered a previous character and seen a hyphen, so this is a range.
-            UChar lo = m_charBuffer;
-            UChar hi = ch;
-            // Reset back to the inital state.
-            m_charBuffer = -1;
-            m_isPendingDash = false;
-            
-            // This is an error, detected lazily.  Do not proceed.
-            if (lo > hi) {
-                m_isUpsideDown = true;
-                return;
-            }
-            
-            if (lo <= 0x7f) {
-                char asciiLo = lo;
-                char asciiHi = std::min(hi, (UChar)0x7f);
-                addSortedRange(m_ranges, lo, asciiHi);
-                
-                if (m_isCaseInsensitive) {
-                    if ((asciiLo <= 'Z') && (asciiHi >= 'A'))
-                        addSortedRange(m_ranges, std::max(asciiLo, 'A')+('a'-'A'), std::min(asciiHi, 'Z')+('a'-'A'));
-                    if ((asciiLo <= 'z') && (asciiHi >= 'a'))
-                        addSortedRange(m_ranges, std::max(asciiLo, 'a')+('A'-'a'), std::min(asciiHi, 'z')+('A'-'a'));
-                }
-            }
-            if (hi >= 0x80) {
-                UChar unicodeCurr = std::max(lo, (UChar)0x80);
-                addSortedRange(m_rangesUnicode, unicodeCurr, hi);
-                
-                if (m_isCaseInsensitive) {
-                    // we're going to scan along, updating the start of the range
-                    while (unicodeCurr <= hi) {
-                        // Spin forwards over any characters that don't have two cases.
-                        for (; jsc_pcre_ucp_othercase(unicodeCurr) == -1; ++unicodeCurr) {
-                            // if this was the last character in the range, we're done.
-                            if (unicodeCurr == hi)
-                                return;
-                        }
-                        // if we fall through to here, unicodeCurr <= hi & has another case. Get the other case.
-                        UChar rangeStart = unicodeCurr;
-                        UChar otherCurr = jsc_pcre_ucp_othercase(unicodeCurr);
-                        
-                        // If unicodeCurr is not yet hi, check the next char in the range.  If it also has another case,
-                        // and if it's other case value is one greater then the othercase value for the current last
-                        // character included in the range, we can include next into the range.
-                        while ((unicodeCurr < hi) && (jsc_pcre_ucp_othercase(unicodeCurr + 1) == (otherCurr + 1))) {
-                            // increment unicodeCurr; it points to the end of the range.
-                            // increment otherCurr, due to the check above other for next must be 1 greater than the currrent other value.
-                            ++unicodeCurr;
-                            ++otherCurr;
-                        }
-                        
-                        // otherChar is the last in the range of other case chars, calculate offset to get back to the start.
-                        addSortedRange(m_rangesUnicode, otherCurr-(unicodeCurr-rangeStart), otherCurr);
-                        
-                        // unicodeCurr has been added, move on to the next char.
-                        ++unicodeCurr;
-                    }
-                }
-            }
-        } else if (ch == '-')
-            // EXAMPLE: parsing [-a-c], the second '-' reaches this case - the hyphen is treated as potentially indicating a range.
-            m_isPendingDash = true;
-        else {
-            // EXAMPLE: Parsing [-a-c], the 'a' reaches this case - we repace the previously buffered char with the 'a'.
-            flush();
-            m_charBuffer = ch;
-        }
-    } else
-        // EXAMPLE: Parsing [-a-c], the first hyphen reaches this case - there is no buffered character
-        // (the hyphen not treated as a special character in this case, same handling for any char).
-        m_charBuffer = ch;
-}
-
-// When a character is added to the set we do not immediately add it to the arrays, in case it is actually defining a range.
-// When we have determined the character is not used in specifing a range it is added, in a sorted fashion, to the appropriate
-// array (either ascii or unicode).
-// If the pattern is case insensitive we add entries for both cases.
-void CharacterClassConstructor::flush()
-{
-    if (m_charBuffer != -1) {
-        if (m_charBuffer <= 0x7f) {
-            if (m_isCaseInsensitive && isASCIILower(m_charBuffer))
-                addSorted(m_matches, toASCIIUpper(m_charBuffer));
-            addSorted(m_matches, m_charBuffer);
-            if (m_isCaseInsensitive && isASCIIUpper(m_charBuffer))
-                addSorted(m_matches, toASCIILower(m_charBuffer));
-        } else {
-            addSorted(m_matchesUnicode, m_charBuffer);
-            if (m_isCaseInsensitive) {
-                int other = jsc_pcre_ucp_othercase(m_charBuffer);
-                if (other != -1)
-                    addSorted(m_matchesUnicode, other);
-            }
-        }
-        m_charBuffer = -1;
-    }
-    
-    if (m_isPendingDash) {
-        addSorted(m_matches, '-');
-        m_isPendingDash = false;
-    }
-}
-
-void CharacterClassConstructor::append(const CharacterClass& other)
-{
-    // [x-\s] will add, 'x', '-', and all unicode spaces to new class (same as [x\s-]).
-    // Need to check the spec, really, but think this matches PCRE behaviour.
-    flush();
-    
-    if (other.numMatches) {
-        for (size_t i = 0; i < other.numMatches; ++i)
-            addSorted(m_matches, other.matches[i]);
-    }
-    if (other.numRanges) {
-        for (size_t i = 0; i < other.numRanges; ++i)
-            addSortedRange(m_ranges, other.ranges[i].begin, other.ranges[i].end);
-    }
-    if (other.numMatchesUnicode) {
-        for (size_t i = 0; i < other.numMatchesUnicode; ++i)
-            addSorted(m_matchesUnicode, other.matchesUnicode[i]);
-    }
-    if (other.numRangesUnicode) {
-        for (size_t i = 0; i < other.numRangesUnicode; ++i)
-            addSortedRange(m_rangesUnicode, other.rangesUnicode[i].begin, other.rangesUnicode[i].end);
-    }
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/CharacterClassConstructor.h b/JavaScriptCore/wrec/CharacterClassConstructor.h
deleted file mode 100644
index 581733d..0000000
--- a/JavaScriptCore/wrec/CharacterClassConstructor.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 CharacterClassConstructor_h
-#define CharacterClassConstructor_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include "CharacterClass.h"
-#include <wtf/AlwaysInline.h>
-#include <wtf/Vector.h>
-#include <wtf/unicode/Unicode.h>
-
-namespace JSC { namespace WREC {
-
-    class CharacterClassConstructor {
-    public:
-        CharacterClassConstructor(bool isCaseInsensitive)
-            : m_charBuffer(-1)
-            , m_isPendingDash(false)
-            , m_isCaseInsensitive(isCaseInsensitive)
-            , m_isUpsideDown(false)
-        {
-        }
-
-        void flush();
-        
-        // We need to flush prior to an escaped hyphen to prevent it as being treated as indicating
-        // a range, e.g. [a\-c] we flush prior to adding the hyphen so that this is not treated as
-        // [a-c].  However, we do not want to flush if we have already seen a non escaped hyphen -
-        // e.g. [+-\-] should be treated the same as [+--], producing a range that will also match
-        // a comma.
-        void flushBeforeEscapedHyphen()
-        {
-            if (!m_isPendingDash)
-                flush();
-        }
-        
-        void put(UChar ch);
-        void append(const CharacterClass& other);
-
-        bool isUpsideDown() { return m_isUpsideDown; }
-
-        ALWAYS_INLINE CharacterClass charClass()
-        {
-            CharacterClass newCharClass = {
-                m_matches.begin(), m_matches.size(),
-                m_ranges.begin(), m_ranges.size(),
-                m_matchesUnicode.begin(), m_matchesUnicode.size(),
-                m_rangesUnicode.begin(), m_rangesUnicode.size(),
-            };
-
-            return newCharClass;
-        }
-
-    private:
-        void addSorted(Vector<UChar>& matches, UChar ch);
-        void addSortedRange(Vector<CharacterRange>& ranges, UChar lo, UChar hi);
-
-        int m_charBuffer;
-        bool m_isPendingDash;
-        bool m_isCaseInsensitive;
-        bool m_isUpsideDown;
-
-        Vector<UChar> m_matches;
-        Vector<CharacterRange> m_ranges;
-        Vector<UChar> m_matchesUnicode;
-        Vector<CharacterRange> m_rangesUnicode;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // CharacterClassConstructor_h
diff --git a/JavaScriptCore/wrec/Escapes.h b/JavaScriptCore/wrec/Escapes.h
deleted file mode 100644
index 16c1d6f..0000000
--- a/JavaScriptCore/wrec/Escapes.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 Escapes_h
-#define Escapes_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include <wtf/Assertions.h>
-
-namespace JSC { namespace WREC {
-
-    class CharacterClass;
-
-    class Escape {
-    public:
-        enum Type {
-            PatternCharacter,
-            CharacterClass,
-            Backreference,
-            WordBoundaryAssertion,
-            Error,
-        };
-        
-        Escape(Type type)
-            : m_type(type)
-        {
-        }
-
-        Type type() const { return m_type; }
-
-    private:
-        Type m_type;
-        
-    protected:
-        // Used by subclasses to store data.
-        union {
-            int i;
-            const WREC::CharacterClass* c;
-        } m_u;
-        bool m_invert;
-    };
-
-    class PatternCharacterEscape : public Escape {
-    public:
-        static const PatternCharacterEscape& cast(const Escape& escape)
-        {
-            ASSERT(escape.type() == PatternCharacter);
-            return static_cast<const PatternCharacterEscape&>(escape);
-        }
-        
-        PatternCharacterEscape(int character)
-            : Escape(PatternCharacter)
-        {
-            m_u.i = character;
-        }
-        
-        operator Escape() const { return *this; }
-        
-        int character() const { return m_u.i; }
-    };
-
-    class CharacterClassEscape : public Escape {
-    public:
-        static const CharacterClassEscape& cast(const Escape& escape)
-        {
-            ASSERT(escape.type() == CharacterClass);
-            return static_cast<const CharacterClassEscape&>(escape);
-        }
-        
-        CharacterClassEscape(const WREC::CharacterClass& characterClass, bool invert)
-            : Escape(CharacterClass)
-        {
-            m_u.c = &characterClass;
-            m_invert = invert;
-        }
-        
-        operator Escape() { return *this; }
-        
-        const WREC::CharacterClass& characterClass() const { return *m_u.c; }
-        bool invert() const { return m_invert; }
-    };
-
-    class BackreferenceEscape : public Escape {
-    public:
-        static const BackreferenceEscape& cast(const Escape& escape)
-        {
-            ASSERT(escape.type() == Backreference);
-            return static_cast<const BackreferenceEscape&>(escape);
-        }
-        
-        BackreferenceEscape(int subpatternId)
-            : Escape(Backreference)
-        {
-            m_u.i = subpatternId;
-        }
-        
-        operator Escape() const { return *this; }
-        
-        int subpatternId() const { return m_u.i; }
-    };
-
-    class WordBoundaryAssertionEscape : public Escape {
-    public:
-        static const WordBoundaryAssertionEscape& cast(const Escape& escape)
-        {
-            ASSERT(escape.type() == WordBoundaryAssertion);
-            return static_cast<const WordBoundaryAssertionEscape&>(escape);
-        }
-        
-        WordBoundaryAssertionEscape(bool invert)
-            : Escape(WordBoundaryAssertion)
-        {
-            m_invert = invert;
-        }
-        
-        operator Escape() const { return *this; }
-        
-        bool invert() const { return m_invert; }
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // Escapes_h
diff --git a/JavaScriptCore/wrec/Quantifier.h b/JavaScriptCore/wrec/Quantifier.h
deleted file mode 100644
index 3da74cd..0000000
--- a/JavaScriptCore/wrec/Quantifier.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 Quantifier_h
-#define Quantifier_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include <wtf/Assertions.h>
-#include <limits.h>
-
-namespace JSC { namespace WREC {
-
-    struct Quantifier {
-        enum Type {
-            None,
-            Greedy,
-            NonGreedy,
-            Error,
-        };
-
-        Quantifier(Type type = None, unsigned min = 0, unsigned max = Infinity)
-            : type(type)
-            , min(min)
-            , max(max)
-        {
-            ASSERT(min <= max);
-        }
-
-        Type type;
-
-        unsigned min;
-        unsigned max;
-
-        static const unsigned Infinity = UINT_MAX;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // Quantifier_h
diff --git a/JavaScriptCore/wrec/WREC.cpp b/JavaScriptCore/wrec/WREC.cpp
deleted file mode 100644
index 145a1ce..0000000
--- a/JavaScriptCore/wrec/WREC.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "WREC.h"
-
-#if ENABLE(WREC)
-
-#include "CharacterClassConstructor.h"
-#include "Interpreter.h"
-#include "JSGlobalObject.h"
-#include "RegisterFile.h"
-#include "WRECFunctors.h"
-#include "WRECParser.h"
-#include "pcre_internal.h"
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-CompiledRegExp Generator::compileRegExp(JSGlobalData* globalData, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, RefPtr<ExecutablePool>& pool, bool ignoreCase, bool multiline)
-{
-    if (pattern.size() > MAX_PATTERN_SIZE) {
-        *error_ptr = "regular expression too large";
-        return 0;
-    }
-
-    Parser parser(pattern, ignoreCase, multiline);
-    Generator& generator = parser.generator();
-    MacroAssembler::JumpList failures;
-    MacroAssembler::Jump endOfInput;
-
-    generator.generateEnter();
-    generator.generateSaveIndex();
-
-    Label beginPattern(&generator);
-    parser.parsePattern(failures);
-    generator.generateReturnSuccess();
-
-    failures.link(&generator);
-    generator.generateIncrementIndex(&endOfInput);
-    parser.parsePattern(failures);
-    generator.generateReturnSuccess();
-
-    failures.link(&generator);
-    generator.generateIncrementIndex();
-    generator.generateJumpIfNotEndOfInput(beginPattern);
-    
-    endOfInput.link(&generator);
-    generator.generateReturnFailure();
-
-    if (parser.error()) {
-        *error_ptr = parser.syntaxError(); // NULL in the case of patterns that WREC doesn't support yet.
-        return 0;
-    }
-
-    *numSubpatterns_ptr = parser.numSubpatterns();
-    pool = globalData->executableAllocator.poolForSize(generator.size());
-    return reinterpret_cast<CompiledRegExp>(generator.copyCode(pool.get()));
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/WREC.h b/JavaScriptCore/wrec/WREC.h
deleted file mode 100644
index 13324e7..0000000
--- a/JavaScriptCore/wrec/WREC.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 WREC_h
-#define WREC_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include <wtf/unicode/Unicode.h>
-
-#if COMPILER(GCC) && CPU(X86)
-#define WREC_CALL __attribute__ ((regparm (3)))
-#else
-#define WREC_CALL
-#endif
-
-namespace JSC {
-    class Interpreter;
-    class UString;
-}
-
-namespace JSC { namespace WREC {
-
-    typedef int (*CompiledRegExp)(const UChar* input, unsigned start, unsigned length, int* output) WREC_CALL;
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // WREC_h
diff --git a/JavaScriptCore/wrec/WRECFunctors.cpp b/JavaScriptCore/wrec/WRECFunctors.cpp
deleted file mode 100644
index 5f1674e..0000000
--- a/JavaScriptCore/wrec/WRECFunctors.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "WRECFunctors.h"
-
-#if ENABLE(WREC)
-
-#include "WRECGenerator.h"
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-void GeneratePatternCharacterFunctor::generateAtom(Generator* generator, Generator::JumpList& failures)
-{
-    generator->generatePatternCharacter(failures, m_ch);
-}
-
-void GeneratePatternCharacterFunctor::backtrack(Generator* generator)
-{
-    generator->generateBacktrack1();
-}
-
-void GenerateCharacterClassFunctor::generateAtom(Generator* generator, Generator::JumpList& failures)
-{
-    generator->generateCharacterClass(failures, *m_charClass, m_invert);
-}
-
-void GenerateCharacterClassFunctor::backtrack(Generator* generator)
-{
-    generator->generateBacktrack1();
-}
-
-void GenerateBackreferenceFunctor::generateAtom(Generator* generator, Generator::JumpList& failures)
-{
-    generator->generateBackreference(failures, m_subpatternId);
-}
-
-void GenerateBackreferenceFunctor::backtrack(Generator* generator)
-{
-    generator->generateBacktrackBackreference(m_subpatternId);
-}
-
-void GenerateParenthesesNonGreedyFunctor::generateAtom(Generator* generator, Generator::JumpList& failures)
-{
-    generator->generateParenthesesNonGreedy(failures, m_start, m_success, m_fail);
-}
-
-void GenerateParenthesesNonGreedyFunctor::backtrack(Generator*)
-{
-    // FIXME: do something about this.
-    CRASH();
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/WRECFunctors.h b/JavaScriptCore/wrec/WRECFunctors.h
deleted file mode 100644
index 610ce55..0000000
--- a/JavaScriptCore/wrec/WRECFunctors.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include "WRECGenerator.h"
-#include <wtf/unicode/Unicode.h>
-
-namespace JSC { namespace WREC {
-
-    struct CharacterClass;
-
-    class GenerateAtomFunctor {
-    public:
-        virtual ~GenerateAtomFunctor() {}
-
-        virtual void generateAtom(Generator*, Generator::JumpList&) = 0;
-        virtual void backtrack(Generator*) = 0;
-    };
-
-    class GeneratePatternCharacterFunctor : public GenerateAtomFunctor {
-    public:
-        GeneratePatternCharacterFunctor(const UChar ch)
-            : m_ch(ch)
-        {
-        }
-
-        virtual void generateAtom(Generator*, Generator::JumpList&);
-        virtual void backtrack(Generator*);
-
-    private:
-        const UChar m_ch;
-    };
-
-    class GenerateCharacterClassFunctor : public GenerateAtomFunctor {
-    public:
-        GenerateCharacterClassFunctor(const CharacterClass* charClass, bool invert)
-            : m_charClass(charClass)
-            , m_invert(invert)
-        {
-        }
-
-        virtual void generateAtom(Generator*, Generator::JumpList&);
-        virtual void backtrack(Generator*);
-
-    private:
-        const CharacterClass* m_charClass;
-        bool m_invert;
-    };
-
-    class GenerateBackreferenceFunctor : public GenerateAtomFunctor {
-    public:
-        GenerateBackreferenceFunctor(unsigned subpatternId)
-            : m_subpatternId(subpatternId)
-        {
-        }
-
-        virtual void generateAtom(Generator*, Generator::JumpList&);
-        virtual void backtrack(Generator*);
-
-    private:
-        unsigned m_subpatternId;
-    };
-
-    class GenerateParenthesesNonGreedyFunctor : public GenerateAtomFunctor {
-    public:
-        GenerateParenthesesNonGreedyFunctor(Generator::Label start, Generator::Jump success, Generator::Jump fail)
-            : m_start(start)
-            , m_success(success)
-            , m_fail(fail)
-        {
-        }
-
-        virtual void generateAtom(Generator*, Generator::JumpList&);
-        virtual void backtrack(Generator*);
-
-    private:
-        Generator::Label m_start;
-        Generator::Jump m_success;
-        Generator::Jump m_fail;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/WRECGenerator.cpp b/JavaScriptCore/wrec/WRECGenerator.cpp
deleted file mode 100644
index 7105984..0000000
--- a/JavaScriptCore/wrec/WRECGenerator.cpp
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "WREC.h"
-
-#if ENABLE(WREC)
-
-#include "CharacterClassConstructor.h"
-#include "Interpreter.h"
-#include "WRECFunctors.h"
-#include "WRECParser.h"
-#include "pcre_internal.h"
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-void Generator::generateEnter()
-{
-#if CPU(X86)
-    // On x86 edi & esi are callee preserved registers.
-    push(X86Registers::edi);
-    push(X86Registers::esi);
-    
-#if COMPILER(MSVC)
-    // Move the arguments into registers.
-    peek(input, 3);
-    peek(index, 4);
-    peek(length, 5);
-    peek(output, 6);
-#else
-    // On gcc the function is regparm(3), so the input, index, and length registers
-    // (eax, edx, and ecx respectively) already contain the appropriate values.
-    // Just load the fourth argument (output) into edi
-    peek(output, 3);
-#endif
-#endif
-}
-
-void Generator::generateReturnSuccess()
-{
-    ASSERT(returnRegister != index);
-    ASSERT(returnRegister != output);
-
-    // Set return value.
-    pop(returnRegister); // match begin
-    store32(returnRegister, output);
-    store32(index, Address(output, 4)); // match end
-    
-    // Restore callee save registers.
-#if CPU(X86)
-    pop(X86Registers::esi);
-    pop(X86Registers::edi);
-#endif
-    ret();
-}
-
-void Generator::generateSaveIndex()
-{
-    push(index);
-}
-
-void Generator::generateIncrementIndex(Jump* failure)
-{
-    peek(index);
-    if (failure)
-        *failure = branch32(Equal, length, index);
-    add32(Imm32(1), index);
-    poke(index);
-}
-
-void Generator::generateLoadCharacter(JumpList& failures)
-{
-    failures.append(branch32(Equal, length, index));
-    load16(BaseIndex(input, index, TimesTwo), character);
-}
-
-// For the sake of end-of-line assertions, we treat one-past-the-end as if it
-// were part of the input string.
-void Generator::generateJumpIfNotEndOfInput(Label target)
-{
-    branch32(LessThanOrEqual, index, length, target);
-}
-
-void Generator::generateReturnFailure()
-{
-    pop();
-    move(Imm32(-1), returnRegister);
-
-#if CPU(X86)
-    pop(X86Registers::esi);
-    pop(X86Registers::edi);
-#endif
-    ret();
-}
-
-void Generator::generateBacktrack1()
-{
-    sub32(Imm32(1), index);
-}
-
-void Generator::generateBacktrackBackreference(unsigned subpatternId)
-{
-    sub32(Address(output, (2 * subpatternId + 1) * sizeof(int)), index);
-    add32(Address(output, (2 * subpatternId) * sizeof(int)), index);
-}
-
-void Generator::generateBackreferenceQuantifier(JumpList& failures, Quantifier::Type quantifierType, unsigned subpatternId, unsigned min, unsigned max)
-{
-    GenerateBackreferenceFunctor functor(subpatternId);
-
-    load32(Address(output, (2 * subpatternId) * sizeof(int)), character);
-    Jump skipIfEmpty = branch32(Equal, Address(output, ((2 * subpatternId) + 1) * sizeof(int)), character);
-
-    ASSERT(quantifierType == Quantifier::Greedy || quantifierType == Quantifier::NonGreedy);
-    if (quantifierType == Quantifier::Greedy)
-        generateGreedyQuantifier(failures, functor, min, max);
-    else
-        generateNonGreedyQuantifier(failures, functor, min, max);
-
-    skipIfEmpty.link(this);
-}
-
-void Generator::generateNonGreedyQuantifier(JumpList& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max)
-{
-    JumpList atomFailedList;
-    JumpList alternativeFailedList;
-
-    // (0) Setup: Save, then init repeatCount.
-    push(repeatCount);
-    move(Imm32(0), repeatCount);
-    Jump start = jump();
-
-    // (4) Quantifier failed: No more atom reading possible.
-    Label quantifierFailed(this);
-    pop(repeatCount);
-    failures.append(jump()); 
-
-    // (3) Alternative failed: If we can, read another atom, then fall through to (2) to try again.
-    Label alternativeFailed(this);
-    pop(index);
-    if (max != Quantifier::Infinity)
-        branch32(Equal, repeatCount, Imm32(max), quantifierFailed);
-
-    // (1) Read an atom.
-    if (min)
-        start.link(this);
-    Label readAtom(this);
-    functor.generateAtom(this, atomFailedList);
-    atomFailedList.linkTo(quantifierFailed, this);
-    add32(Imm32(1), repeatCount);
-    
-    // (2) Keep reading if we're under the minimum.
-    if (min > 1)
-        branch32(LessThan, repeatCount, Imm32(min), readAtom);
-
-    // (3) Test the rest of the alternative.
-    if (!min)
-        start.link(this);
-    push(index);
-    m_parser.parseAlternative(alternativeFailedList);
-    alternativeFailedList.linkTo(alternativeFailed, this);
-
-    pop();
-    pop(repeatCount);
-}
-
-void Generator::generateGreedyQuantifier(JumpList& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max)
-{
-    if (!max)
-        return;
-
-    JumpList doneReadingAtomsList;
-    JumpList alternativeFailedList;
-
-    // (0) Setup: Save, then init repeatCount.
-    push(repeatCount);
-    move(Imm32(0), repeatCount);
-
-    // (1) Greedily read as many copies of the atom as possible, then jump to (2).
-    Label readAtom(this);
-    functor.generateAtom(this, doneReadingAtomsList);
-    add32(Imm32(1), repeatCount);
-    if (max == Quantifier::Infinity)
-        jump(readAtom);
-    else if (max == 1)
-        doneReadingAtomsList.append(jump());
-    else {
-        branch32(NotEqual, repeatCount, Imm32(max), readAtom);
-        doneReadingAtomsList.append(jump());
-    }
-
-    // (5) Quantifier failed: No more backtracking possible.
-    Label quantifierFailed(this);
-    pop(repeatCount);
-    failures.append(jump()); 
-
-    // (4) Alternative failed: Backtrack, then fall through to (2) to try again.
-    Label alternativeFailed(this);
-    pop(index);
-    functor.backtrack(this);
-    sub32(Imm32(1), repeatCount);
-
-    // (2) Verify that we have enough atoms.
-    doneReadingAtomsList.link(this);
-    branch32(LessThan, repeatCount, Imm32(min), quantifierFailed);
-
-    // (3) Test the rest of the alternative.
-    push(index);
-    m_parser.parseAlternative(alternativeFailedList);
-    alternativeFailedList.linkTo(alternativeFailed, this);
-
-    pop();
-    pop(repeatCount);
-}
-
-void Generator::generatePatternCharacterSequence(JumpList& failures, int* sequence, size_t count)
-{
-    for (size_t i = 0; i < count;) {
-        if (i < count - 1) {
-            if (generatePatternCharacterPair(failures, sequence[i], sequence[i + 1])) {
-                i += 2;
-                continue;
-            }
-        }
-
-        generatePatternCharacter(failures, sequence[i]);
-        ++i;
-    }
-}
-
-bool Generator::generatePatternCharacterPair(JumpList& failures, int ch1, int ch2)
-{
-    if (m_parser.ignoreCase()) {
-        // Non-trivial case folding requires more than one test, so we can't
-        // test as a pair with an adjacent character.
-        if (!isASCII(ch1) && Unicode::toLower(ch1) != Unicode::toUpper(ch1))
-            return false;
-        if (!isASCII(ch2) && Unicode::toLower(ch2) != Unicode::toUpper(ch2))
-            return false;
-    }
-
-    // Optimistically consume 2 characters.
-    add32(Imm32(2), index);
-    failures.append(branch32(GreaterThan, index, length));
-
-    // Load the characters we just consumed, offset -2 characters from index.
-    load32(BaseIndex(input, index, TimesTwo, -2 * 2), character);
-
-    if (m_parser.ignoreCase()) {
-        // Convert ASCII alphabet characters to upper case before testing for
-        // equality. (ASCII non-alphabet characters don't require upper-casing
-        // because they have no uppercase equivalents. Unicode characters don't
-        // require upper-casing because we only handle Unicode characters whose
-        // upper and lower cases are equal.)
-        int ch1Mask = 0;
-        if (isASCIIAlpha(ch1)) {
-            ch1 |= 32;
-            ch1Mask = 32;
-        }
-
-        int ch2Mask = 0;
-        if (isASCIIAlpha(ch2)) {
-            ch2 |= 32;
-            ch2Mask = 32;
-        }
-
-        int mask = ch1Mask | (ch2Mask << 16);
-        if (mask)
-            or32(Imm32(mask), character);
-    }
-    int pair = ch1 | (ch2 << 16);
-
-    failures.append(branch32(NotEqual, character, Imm32(pair)));
-    return true;
-}
-
-void Generator::generatePatternCharacter(JumpList& failures, int ch)
-{
-    generateLoadCharacter(failures);
-
-    // used for unicode case insensitive
-    bool hasUpper = false;
-    Jump isUpper;
-    
-    // if case insensitive match
-    if (m_parser.ignoreCase()) {
-        UChar lower, upper;
-        
-        // check for ascii case sensitive characters
-        if (isASCIIAlpha(ch)) {
-            or32(Imm32(32), character);
-            ch |= 32;
-        } else if (!isASCII(ch) && ((lower = Unicode::toLower(ch)) != (upper = Unicode::toUpper(ch)))) {
-            // handle unicode case sentitive characters - branch to success on upper
-            isUpper = branch32(Equal, character, Imm32(upper));
-            hasUpper = true;
-            ch = lower;
-        }
-    }
-    
-    // checks for ch, or lower case version of ch, if insensitive
-    failures.append(branch32(NotEqual, character, Imm32((unsigned short)ch)));
-
-    if (m_parser.ignoreCase() && hasUpper) {
-        // for unicode case insensitive matches, branch here if upper matches.
-        isUpper.link(this);
-    }
-    
-    // on success consume the char
-    add32(Imm32(1), index);
-}
-
-void Generator::generateCharacterClassInvertedRange(JumpList& failures, JumpList& matchDest, const CharacterRange* ranges, unsigned count, unsigned* matchIndex, const UChar* matches, unsigned matchCount)
-{
-    do {
-        // pick which range we're going to generate
-        int which = count >> 1;
-        char lo = ranges[which].begin;
-        char hi = ranges[which].end;
-        
-        // check if there are any ranges or matches below lo.  If not, just jl to failure -
-        // if there is anything else to check, check that first, if it falls through jmp to failure.
-        if ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) {
-            Jump loOrAbove = branch32(GreaterThanOrEqual, character, Imm32((unsigned short)lo));
-            
-            // generate code for all ranges before this one
-            if (which)
-                generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount);
-            
-            while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) {
-                matchDest.append(branch32(Equal, character, Imm32((unsigned short)matches[*matchIndex])));
-                ++*matchIndex;
-            }
-            failures.append(jump());
-
-            loOrAbove.link(this);
-        } else if (which) {
-            Jump loOrAbove = branch32(GreaterThanOrEqual, character, Imm32((unsigned short)lo));
-
-            generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount);
-            failures.append(jump());
-
-            loOrAbove.link(this);
-        } else
-            failures.append(branch32(LessThan, character, Imm32((unsigned short)lo)));
-
-        while ((*matchIndex < matchCount) && (matches[*matchIndex] <= hi))
-            ++*matchIndex;
-
-        matchDest.append(branch32(LessThanOrEqual, character, Imm32((unsigned short)hi)));
-        // fall through to here, the value is above hi.
-
-        // shuffle along & loop around if there are any more matches to handle.
-        unsigned next = which + 1;
-        ranges += next;
-        count -= next;
-    } while (count);
-}
-
-void Generator::generateCharacterClassInverted(JumpList& matchDest, const CharacterClass& charClass)
-{
-    Jump unicodeFail;
-    if (charClass.numMatchesUnicode || charClass.numRangesUnicode) {
-        Jump isAscii = branch32(LessThanOrEqual, character, Imm32(0x7f));
-    
-        if (charClass.numMatchesUnicode) {
-            for (unsigned i = 0; i < charClass.numMatchesUnicode; ++i) {
-                UChar ch = charClass.matchesUnicode[i];
-                matchDest.append(branch32(Equal, character, Imm32(ch)));
-            }
-        }
-        
-        if (charClass.numRangesUnicode) {
-            for (unsigned i = 0; i < charClass.numRangesUnicode; ++i) {
-                UChar lo = charClass.rangesUnicode[i].begin;
-                UChar hi = charClass.rangesUnicode[i].end;
-                
-                Jump below = branch32(LessThan, character, Imm32(lo));
-                matchDest.append(branch32(LessThanOrEqual, character, Imm32(hi)));
-                below.link(this);
-            }
-        }
-
-        unicodeFail = jump();
-        isAscii.link(this);
-    }
-
-    if (charClass.numRanges) {
-        unsigned matchIndex = 0;
-        JumpList failures; 
-        generateCharacterClassInvertedRange(failures, matchDest, charClass.ranges, charClass.numRanges, &matchIndex, charClass.matches, charClass.numMatches);
-        while (matchIndex < charClass.numMatches)
-            matchDest.append(branch32(Equal, character, Imm32((unsigned short)charClass.matches[matchIndex++])));
-
-        failures.link(this);
-    } else if (charClass.numMatches) {
-        // optimization: gather 'a','A' etc back together, can mask & test once.
-        Vector<char> matchesAZaz;
-
-        for (unsigned i = 0; i < charClass.numMatches; ++i) {
-            char ch = charClass.matches[i];
-            if (m_parser.ignoreCase()) {
-                if (isASCIILower(ch)) {
-                    matchesAZaz.append(ch);
-                    continue;
-                }
-                if (isASCIIUpper(ch))
-                    continue;
-            }
-            matchDest.append(branch32(Equal, character, Imm32((unsigned short)ch)));
-        }
-
-        if (unsigned countAZaz = matchesAZaz.size()) {
-            or32(Imm32(32), character);
-            for (unsigned i = 0; i < countAZaz; ++i)
-                matchDest.append(branch32(Equal, character, Imm32(matchesAZaz[i])));
-        }
-    }
-
-    if (charClass.numMatchesUnicode || charClass.numRangesUnicode)
-        unicodeFail.link(this);
-}
-
-void Generator::generateCharacterClass(JumpList& failures, const CharacterClass& charClass, bool invert)
-{
-    generateLoadCharacter(failures);
-
-    if (invert)
-        generateCharacterClassInverted(failures, charClass);
-    else {
-        JumpList successes;
-        generateCharacterClassInverted(successes, charClass);
-        failures.append(jump());
-        successes.link(this);
-    }
-    
-    add32(Imm32(1), index);
-}
-
-void Generator::generateParenthesesAssertion(JumpList& failures)
-{
-    JumpList disjunctionFailed;
-
-    push(index);
-    m_parser.parseDisjunction(disjunctionFailed);
-    Jump success = jump();
-
-    disjunctionFailed.link(this);
-    pop(index);
-    failures.append(jump());
-
-    success.link(this);
-    pop(index);
-}
-
-void Generator::generateParenthesesInvertedAssertion(JumpList& failures)
-{
-    JumpList disjunctionFailed;
-
-    push(index);
-    m_parser.parseDisjunction(disjunctionFailed);
-
-    // If the disjunction succeeded, the inverted assertion failed.
-    pop(index);
-    failures.append(jump());
-
-    // If the disjunction failed, the inverted assertion succeeded.
-    disjunctionFailed.link(this);
-    pop(index);
-}
-
-void Generator::generateParenthesesNonGreedy(JumpList& failures, Label start, Jump success, Jump fail)
-{
-    jump(start);
-    success.link(this);
-    failures.append(fail);
-}
-
-Generator::Jump Generator::generateParenthesesResetTrampoline(JumpList& newFailures, unsigned subpatternIdBefore, unsigned subpatternIdAfter)
-{
-    Jump skip = jump();
-    newFailures.link(this);
-    for (unsigned i = subpatternIdBefore + 1; i <= subpatternIdAfter; ++i) {
-        store32(Imm32(-1), Address(output, (2 * i) * sizeof(int)));
-        store32(Imm32(-1), Address(output, (2 * i + 1) * sizeof(int)));
-    }
-    
-    Jump newFailJump = jump();
-    skip.link(this);
-    
-    return newFailJump;
-}
-
-void Generator::generateAssertionBOL(JumpList& failures)
-{
-    if (m_parser.multiline()) {
-        JumpList previousIsNewline;
-
-        // begin of input == success
-        previousIsNewline.append(branch32(Equal, index, Imm32(0)));
-
-        // now check prev char against newline characters.
-        load16(BaseIndex(input, index, TimesTwo, -2), character);
-        generateCharacterClassInverted(previousIsNewline, CharacterClass::newline());
-
-        failures.append(jump());
-
-        previousIsNewline.link(this);
-    } else
-        failures.append(branch32(NotEqual, index, Imm32(0)));
-}
-
-void Generator::generateAssertionEOL(JumpList& failures)
-{
-    if (m_parser.multiline()) {
-        JumpList nextIsNewline;
-
-        generateLoadCharacter(nextIsNewline); // end of input == success
-        generateCharacterClassInverted(nextIsNewline, CharacterClass::newline());
-        failures.append(jump());
-        nextIsNewline.link(this);
-    } else {
-        failures.append(branch32(NotEqual, length, index));
-    }
-}
-
-void Generator::generateAssertionWordBoundary(JumpList& failures, bool invert)
-{
-    JumpList wordBoundary;
-    JumpList notWordBoundary;
-
-    // (1) Check if the previous value was a word char
-
-    // (1.1) check for begin of input
-    Jump atBegin = branch32(Equal, index, Imm32(0));
-    // (1.2) load the last char, and chck if is word character
-    load16(BaseIndex(input, index, TimesTwo, -2), character);
-    JumpList previousIsWord;
-    generateCharacterClassInverted(previousIsWord, CharacterClass::wordchar());
-    // (1.3) if we get here, previous is not a word char
-    atBegin.link(this);
-
-    // (2) Handle situation where previous was NOT a \w
-
-    generateLoadCharacter(notWordBoundary);
-    generateCharacterClassInverted(wordBoundary, CharacterClass::wordchar());
-    // (2.1) If we get here, neither chars are word chars
-    notWordBoundary.append(jump());
-
-    // (3) Handle situation where previous was a \w
-
-    // (3.0) link success in first match to here
-    previousIsWord.link(this);
-    generateLoadCharacter(wordBoundary);
-    generateCharacterClassInverted(notWordBoundary, CharacterClass::wordchar());
-    // (3.1) If we get here, this is an end of a word, within the input.
-    
-    // (4) Link everything up
-    
-    if (invert) {
-        // handle the fall through case
-        wordBoundary.append(jump());
-    
-        // looking for non word boundaries, so link boundary fails to here.
-        notWordBoundary.link(this);
-
-        failures.append(wordBoundary);
-    } else {
-        // looking for word boundaries, so link successes here.
-        wordBoundary.link(this);
-        
-        failures.append(notWordBoundary);
-    }
-}
-
-void Generator::generateBackreference(JumpList& failures, unsigned subpatternId)
-{
-    push(index);
-    push(repeatCount);
-
-    // get the start pos of the backref into repeatCount (multipurpose!)
-    load32(Address(output, (2 * subpatternId) * sizeof(int)), repeatCount);
-
-    Jump skipIncrement = jump();
-    Label topOfLoop(this);
-
-    add32(Imm32(1), index);
-    add32(Imm32(1), repeatCount);
-    skipIncrement.link(this);
-
-    // check if we're at the end of backref (if we are, success!)
-    Jump endOfBackRef = branch32(Equal, Address(output, ((2 * subpatternId) + 1) * sizeof(int)), repeatCount);
-
-    load16(BaseIndex(input, repeatCount, MacroAssembler::TimesTwo), character);
-
-    // check if we've run out of input (this would be a can o'fail)
-    Jump endOfInput = branch32(Equal, length, index);
-
-    branch16(Equal, BaseIndex(input, index, TimesTwo), character, topOfLoop);
-
-    endOfInput.link(this);
-
-    // Failure
-    pop(repeatCount);
-    pop(index);
-    failures.append(jump());
-
-    // Success
-    endOfBackRef.link(this);
-    pop(repeatCount);
-    pop();
-}
-
-void Generator::terminateAlternative(JumpList& successes, JumpList& failures)
-{
-    successes.append(jump());
-    
-    failures.link(this);
-    peek(index);
-}
-
-void Generator::terminateDisjunction(JumpList& successes)
-{
-    successes.link(this);
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/WRECGenerator.h b/JavaScriptCore/wrec/WRECGenerator.h
deleted file mode 100644
index d707a6e..0000000
--- a/JavaScriptCore/wrec/WRECGenerator.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 WRECGenerator_h
-#define WRECGenerator_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include "Quantifier.h"
-#include "MacroAssembler.h"
-#include <wtf/ASCIICType.h>
-#include <wtf/unicode/Unicode.h>
-#include "WREC.h"
-
-namespace JSC { 
-
-    class JSGlobalData;
-
-    namespace WREC {
-
-    class CharacterRange;
-    class GenerateAtomFunctor;
-    class Parser;
-    struct CharacterClass;
-
-    class Generator : private MacroAssembler {
-    public:
-        using MacroAssembler::Jump;
-        using MacroAssembler::JumpList;
-        using MacroAssembler::Label;
-
-        enum ParenthesesType { Capturing, NonCapturing, Assertion, InvertedAssertion, Error };
-
-        static CompiledRegExp compileRegExp(JSGlobalData*, const UString& pattern, unsigned* numSubpatterns_ptr, const char** error_ptr, RefPtr<ExecutablePool>& pool, bool ignoreCase = false, bool multiline = false);
-    
-        Generator(Parser& parser)
-            : m_parser(parser)
-        {
-        }
-
-#if CPU(X86)
-        static const RegisterID input = X86Registers::eax;
-        static const RegisterID index = X86Registers::edx;
-        static const RegisterID length = X86Registers::ecx;
-        static const RegisterID output = X86Registers::edi;
-
-        static const RegisterID character = X86Registers::esi;
-        static const RegisterID repeatCount = X86Registers::ebx; // How many times the current atom repeats in the current match.
-
-        static const RegisterID returnRegister = X86Registers::eax;
-#endif
-#if CPU(X86_64)
-        static const RegisterID input = X86Registers::edi;
-        static const RegisterID index = X86Registers::esi;
-        static const RegisterID length = X86Registers::edx;
-        static const RegisterID output = X86Registers::ecx;
-
-        static const RegisterID character = X86Registers::eax;
-        static const RegisterID repeatCount = X86Registers::ebx; // How many times the current atom repeats in the current match.
-
-        static const RegisterID returnRegister = X86Registers::eax;
-#endif
-
-        void generateEnter();
-        void generateSaveIndex();
-        void generateIncrementIndex(Jump* failure = 0);
-        void generateLoadCharacter(JumpList& failures);
-        void generateJumpIfNotEndOfInput(Label);
-        void generateReturnSuccess();
-        void generateReturnFailure();
-
-        void generateGreedyQuantifier(JumpList& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max);
-        void generateNonGreedyQuantifier(JumpList& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max);
-        void generateBacktrack1();
-        void generateBacktrackBackreference(unsigned subpatternId);
-        void generateCharacterClass(JumpList& failures, const CharacterClass& charClass, bool invert);
-        void generateCharacterClassInverted(JumpList& failures, const CharacterClass& charClass);
-        void generateCharacterClassInvertedRange(JumpList& failures, JumpList& matchDest, const CharacterRange* ranges, unsigned count, unsigned* matchIndex, const UChar* matches, unsigned matchCount);
-        void generatePatternCharacter(JumpList& failures, int ch);
-        void generatePatternCharacterSequence(JumpList& failures, int* sequence, size_t count);
-        void generateAssertionWordBoundary(JumpList& failures, bool invert);
-        void generateAssertionBOL(JumpList& failures);
-        void generateAssertionEOL(JumpList& failures);
-        void generateBackreference(JumpList& failures, unsigned subpatternID);
-        void generateBackreferenceQuantifier(JumpList& failures, Quantifier::Type quantifierType, unsigned subpatternId, unsigned min, unsigned max);
-        void generateParenthesesAssertion(JumpList& failures);
-        void generateParenthesesInvertedAssertion(JumpList& failures);
-        Jump generateParenthesesResetTrampoline(JumpList& newFailures, unsigned subpatternIdBefore, unsigned subpatternIdAfter);
-        void generateParenthesesNonGreedy(JumpList& failures, Label start, Jump success, Jump fail);
-
-        void terminateAlternative(JumpList& successes, JumpList& failures);
-        void terminateDisjunction(JumpList& successes);
-
-    private:
-        bool generatePatternCharacterPair(JumpList& failures, int ch1, int ch2);
-
-        Parser& m_parser;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // WRECGenerator_h
diff --git a/JavaScriptCore/wrec/WRECParser.cpp b/JavaScriptCore/wrec/WRECParser.cpp
deleted file mode 100644
index 1709bf9..0000000
--- a/JavaScriptCore/wrec/WRECParser.cpp
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "WRECParser.h"
-
-#if ENABLE(WREC)
-
-#include "CharacterClassConstructor.h"
-#include "WRECFunctors.h"
-
-using namespace WTF;
-
-namespace JSC { namespace WREC {
-
-// These error messages match the error messages used by PCRE.
-const char* Parser::QuantifierOutOfOrder = "numbers out of order in {} quantifier";
-const char* Parser::QuantifierWithoutAtom = "nothing to repeat";
-const char* Parser::ParenthesesUnmatched = "unmatched parentheses";
-const char* Parser::ParenthesesTypeInvalid = "unrecognized character after (?";
-const char* Parser::ParenthesesNotSupported = ""; // Not a user-visible syntax error -- just signals a syntax that WREC doesn't support yet.
-const char* Parser::CharacterClassUnmatched = "missing terminating ] for character class";
-const char* Parser::CharacterClassOutOfOrder = "range out of order in character class";
-const char* Parser::EscapeUnterminated = "\\ at end of pattern";
-
-class PatternCharacterSequence {
-typedef Generator::JumpList JumpList;
-
-public:
-    PatternCharacterSequence(Generator& generator, JumpList& failures)
-        : m_generator(generator)
-        , m_failures(failures)
-    {
-    }
-    
-    size_t size() { return m_sequence.size(); }
-    
-    void append(int ch)
-    {
-        m_sequence.append(ch);
-    }
-    
-    void flush()
-    {
-        if (!m_sequence.size())
-            return;
-
-        m_generator.generatePatternCharacterSequence(m_failures, m_sequence.begin(), m_sequence.size());
-        m_sequence.clear();
-    }
-
-    void flush(const Quantifier& quantifier)
-    {
-        if (!m_sequence.size())
-            return;
-
-        m_generator.generatePatternCharacterSequence(m_failures, m_sequence.begin(), m_sequence.size() - 1);
-
-        switch (quantifier.type) {
-        case Quantifier::None:
-        case Quantifier::Error:
-            ASSERT_NOT_REACHED();
-            break;
-
-        case Quantifier::Greedy: {
-            GeneratePatternCharacterFunctor functor(m_sequence.last());
-            m_generator.generateGreedyQuantifier(m_failures, functor, quantifier.min, quantifier.max);
-            break;
-        }
-        
-        case Quantifier::NonGreedy: {
-            GeneratePatternCharacterFunctor functor(m_sequence.last());
-            m_generator.generateNonGreedyQuantifier(m_failures, functor, quantifier.min, quantifier.max);
-            break;
-        }
-        }
-        
-        m_sequence.clear();
-    }
-
-private:
-    Generator& m_generator;
-    JumpList& m_failures;
-    Vector<int, 8> m_sequence;
-};
-
-ALWAYS_INLINE Quantifier Parser::consumeGreedyQuantifier()
-{
-    switch (peek()) {
-        case '?':
-            consume();
-            return Quantifier(Quantifier::Greedy, 0, 1);
-
-        case '*':
-            consume();
-            return Quantifier(Quantifier::Greedy, 0);
-
-        case '+':
-            consume();
-            return Quantifier(Quantifier::Greedy, 1);
-
-        case '{': {
-            SavedState state(*this);
-            consume();
-
-            // Accept: {n}, {n,}, {n,m}.
-            // Reject: {n,m} where n > m.
-            // Ignore: Anything else, such as {n, m}.
-
-            if (!peekIsDigit()) {
-                state.restore();
-                return Quantifier();
-            }
-
-            unsigned min = consumeNumber();
-            unsigned max = min;
-
-            if (peek() == ',') {
-                consume();
-                max = peekIsDigit() ? consumeNumber() : Quantifier::Infinity;
-            }
-
-            if (peek() != '}') {
-                state.restore();
-                return Quantifier();
-            }
-            consume();
- 
-            if (min > max) {
-                setError(QuantifierOutOfOrder);
-                return Quantifier(Quantifier::Error);
-            }
-
-            return Quantifier(Quantifier::Greedy, min, max);
-         }
-
-         default:
-            return Quantifier(); // No quantifier.
-    }
-}
-
-Quantifier Parser::consumeQuantifier()
-{
-    Quantifier q = consumeGreedyQuantifier();
-    
-    if ((q.type == Quantifier::Greedy) && (peek() == '?')) {
-        consume();
-        q.type = Quantifier::NonGreedy;
-    }
-    
-    return q;
-}
-
-bool Parser::parseCharacterClassQuantifier(JumpList& failures, const CharacterClass& charClass, bool invert)
-{
-    Quantifier q = consumeQuantifier();
-
-    switch (q.type) {
-    case Quantifier::None: {
-        m_generator.generateCharacterClass(failures, charClass, invert);
-        break;
-    }
-
-    case Quantifier::Greedy: {
-        GenerateCharacterClassFunctor functor(&charClass, invert);
-        m_generator.generateGreedyQuantifier(failures, functor, q.min, q.max);
-        break;
-    }
-
-    case Quantifier::NonGreedy: {
-        GenerateCharacterClassFunctor functor(&charClass, invert);
-        m_generator.generateNonGreedyQuantifier(failures, functor, q.min, q.max);
-        break;
-    }
-
-    case Quantifier::Error:
-        return false;
-    }
-    
-    return true;
-}
-
-bool Parser::parseBackreferenceQuantifier(JumpList& failures, unsigned subpatternId)
-{
-    Quantifier q = consumeQuantifier();
-
-    switch (q.type) {
-    case Quantifier::None: {
-        m_generator.generateBackreference(failures, subpatternId);
-        break;
-    }
-
-    case Quantifier::Greedy:
-    case Quantifier::NonGreedy:
-        m_generator.generateBackreferenceQuantifier(failures, q.type, subpatternId, q.min, q.max);
-        return true;
-
-    case Quantifier::Error:
-        return false;
-    }
-    
-    return true;
-}
-
-bool Parser::parseParentheses(JumpList& failures)
-{
-    ParenthesesType type = consumeParenthesesType();
-
-    // FIXME: WREC originally failed to backtrack correctly in cases such as
-    // "c".match(/(.*)c/). Now, most parentheses handling is disabled. For
-    // unsupported parentheses, we fall back on PCRE.
-
-    switch (type) {
-        case Generator::Assertion: {
-            m_generator.generateParenthesesAssertion(failures);
-
-            if (consume() != ')') {
-                setError(ParenthesesUnmatched);
-                return false;
-            }
-
-            Quantifier quantifier = consumeQuantifier();
-            if (quantifier.type != Quantifier::None && quantifier.min == 0) {
-                setError(ParenthesesNotSupported);
-                return false;
-            }
-
-            return true;
-        }
-        case Generator::InvertedAssertion: {
-            m_generator.generateParenthesesInvertedAssertion(failures);
-
-            if (consume() != ')') {
-                setError(ParenthesesUnmatched);
-                return false;
-            }
-
-            Quantifier quantifier = consumeQuantifier();
-            if (quantifier.type != Quantifier::None && quantifier.min == 0) {
-                setError(ParenthesesNotSupported);
-                return false;
-            }
-
-            return true;
-        }
-        default:
-            setError(ParenthesesNotSupported);
-            return false;
-    }
-}
-
-bool Parser::parseCharacterClass(JumpList& failures)
-{
-    bool invert = false;
-    if (peek() == '^') {
-        consume();
-        invert = true;
-    }
-
-    CharacterClassConstructor constructor(m_ignoreCase);
-
-    int ch;
-    while ((ch = peek()) != ']') {
-        switch (ch) {
-        case EndOfPattern:
-            setError(CharacterClassUnmatched);
-            return false;
-
-        case '\\': {
-            consume();
-            Escape escape = consumeEscape(true);
-
-            switch (escape.type()) {
-                case Escape::PatternCharacter: {
-                    int character = PatternCharacterEscape::cast(escape).character();
-                    if (character == '-')
-                        constructor.flushBeforeEscapedHyphen();
-                    constructor.put(character);
-                    break;
-                }
-                case Escape::CharacterClass: {
-                    const CharacterClassEscape& characterClassEscape = CharacterClassEscape::cast(escape);
-                    ASSERT(!characterClassEscape.invert());
-                    constructor.append(characterClassEscape.characterClass());
-                    break;
-                }
-                case Escape::Error:
-                    return false;
-                case Escape::Backreference:
-                case Escape::WordBoundaryAssertion: {
-                    ASSERT_NOT_REACHED();
-                    break;
-                }
-            }
-            break;
-        }
-
-        default:
-            consume();
-            constructor.put(ch);
-        }
-    }
-    consume();
-
-    // lazily catch reversed ranges ([z-a])in character classes
-    if (constructor.isUpsideDown()) {
-        setError(CharacterClassOutOfOrder);
-        return false;
-    }
-
-    constructor.flush();
-    CharacterClass charClass = constructor.charClass();
-    return parseCharacterClassQuantifier(failures, charClass, invert);
-}
-
-bool Parser::parseNonCharacterEscape(JumpList& failures, const Escape& escape)
-{
-    switch (escape.type()) {
-        case Escape::PatternCharacter:
-            ASSERT_NOT_REACHED();
-            return false;
-
-        case Escape::CharacterClass:
-            return parseCharacterClassQuantifier(failures, CharacterClassEscape::cast(escape).characterClass(), CharacterClassEscape::cast(escape).invert());
-
-        case Escape::Backreference:
-            return parseBackreferenceQuantifier(failures, BackreferenceEscape::cast(escape).subpatternId());
-
-        case Escape::WordBoundaryAssertion:
-            m_generator.generateAssertionWordBoundary(failures, WordBoundaryAssertionEscape::cast(escape).invert());
-            return true;
-
-        case Escape::Error:
-            return false;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-Escape Parser::consumeEscape(bool inCharacterClass)
-{
-    switch (peek()) {
-    case EndOfPattern:
-        setError(EscapeUnterminated);
-        return Escape(Escape::Error);
-
-    // Assertions
-    case 'b':
-        consume();
-        if (inCharacterClass)
-            return PatternCharacterEscape('\b');
-        return WordBoundaryAssertionEscape(false); // do not invert
-    case 'B':
-        consume();
-        if (inCharacterClass)
-            return PatternCharacterEscape('B');
-        return WordBoundaryAssertionEscape(true); // invert
-
-    // CharacterClassEscape
-    case 'd':
-        consume();
-        return CharacterClassEscape(CharacterClass::digits(), false);
-    case 's':
-        consume();
-        return CharacterClassEscape(CharacterClass::spaces(), false);
-    case 'w':
-        consume();
-        return CharacterClassEscape(CharacterClass::wordchar(), false);
-    case 'D':
-        consume();
-        return inCharacterClass
-            ? CharacterClassEscape(CharacterClass::nondigits(), false)
-            : CharacterClassEscape(CharacterClass::digits(), true);
-    case 'S':
-        consume();
-        return inCharacterClass
-            ? CharacterClassEscape(CharacterClass::nonspaces(), false)
-            : CharacterClassEscape(CharacterClass::spaces(), true);
-    case 'W':
-        consume();
-        return inCharacterClass
-            ? CharacterClassEscape(CharacterClass::nonwordchar(), false)
-            : CharacterClassEscape(CharacterClass::wordchar(), true);
-
-    // DecimalEscape
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9': {
-        if (peekDigit() > m_numSubpatterns || inCharacterClass) {
-            // To match Firefox, we parse an invalid backreference in the range [1-7]
-            // as an octal escape.
-            return peekDigit() > 7 ? PatternCharacterEscape('\\') : PatternCharacterEscape(consumeOctal());
-        }
-
-        int value = 0;
-        do {
-            unsigned newValue = value * 10 + peekDigit();
-            if (newValue > m_numSubpatterns)
-                break;
-            value = newValue;
-            consume();
-        } while (peekIsDigit());
-
-        return BackreferenceEscape(value);
-    }
-
-    // Octal escape
-    case '0':
-        consume();
-        return PatternCharacterEscape(consumeOctal());
-
-    // ControlEscape
-    case 'f':
-        consume();
-        return PatternCharacterEscape('\f');
-    case 'n':
-        consume();
-        return PatternCharacterEscape('\n');
-    case 'r':
-        consume();
-        return PatternCharacterEscape('\r');
-    case 't':
-        consume();
-        return PatternCharacterEscape('\t');
-    case 'v':
-        consume();
-        return PatternCharacterEscape('\v');
-
-    // ControlLetter
-    case 'c': {
-        SavedState state(*this);
-        consume();
-        
-        int control = consume();
-        // To match Firefox, inside a character class, we also accept numbers
-        // and '_' as control characters.
-        if ((!inCharacterClass && !isASCIIAlpha(control)) || (!isASCIIAlphanumeric(control) && control != '_')) {
-            state.restore();
-            return PatternCharacterEscape('\\');
-        }
-        return PatternCharacterEscape(control & 31);
-    }
-
-    // HexEscape
-    case 'x': {
-        consume();
-
-        SavedState state(*this);
-        int x = consumeHex(2);
-        if (x == -1) {
-            state.restore();
-            return PatternCharacterEscape('x');
-        }
-        return PatternCharacterEscape(x);
-    }
-
-    // UnicodeEscape
-    case 'u': {
-        consume();
-
-        SavedState state(*this);
-        int x = consumeHex(4);
-        if (x == -1) {
-            state.restore();
-            return PatternCharacterEscape('u');
-        }
-        return PatternCharacterEscape(x);
-    }
-
-    // IdentityEscape
-    default:
-        return PatternCharacterEscape(consume());
-    }
-}
-
-void Parser::parseAlternative(JumpList& failures)
-{
-    PatternCharacterSequence sequence(m_generator, failures);
-
-    while (1) {
-        switch (peek()) {
-        case EndOfPattern:
-        case '|':
-        case ')':
-            sequence.flush();
-            return;
-
-        case '*':
-        case '+':
-        case '?':
-        case '{': {
-            Quantifier q = consumeQuantifier();
-
-            if (q.type == Quantifier::None) {
-                sequence.append(consume());
-                continue;
-            }
-
-            if (q.type == Quantifier::Error)
-                return;
-
-            if (!sequence.size()) {
-                setError(QuantifierWithoutAtom);
-                return;
-            }
-
-            sequence.flush(q);
-            continue;
-        }
-
-        case '^':
-            consume();
-
-            sequence.flush();
-            m_generator.generateAssertionBOL(failures);
-            continue;
-
-        case '$':
-            consume();
-
-            sequence.flush();
-            m_generator.generateAssertionEOL(failures);
-            continue;
-
-        case '.':
-            consume();
-
-            sequence.flush();
-            if (!parseCharacterClassQuantifier(failures, CharacterClass::newline(), true))
-                return;
-            continue;
-
-        case '[':
-            consume();
-
-            sequence.flush();
-            if (!parseCharacterClass(failures))
-                return;
-            continue;
-
-        case '(':
-            consume();
-
-            sequence.flush();
-            if (!parseParentheses(failures))
-                return;
-            continue;
-
-        case '\\': {
-            consume();
-
-            Escape escape = consumeEscape(false);
-            if (escape.type() == Escape::PatternCharacter) {
-                sequence.append(PatternCharacterEscape::cast(escape).character());
-                continue;
-            }
-
-            sequence.flush();
-            if (!parseNonCharacterEscape(failures, escape))
-                return;
-            continue;
-        }
-
-        default:
-            sequence.append(consume());
-            continue;
-        }
-    }
-}
-
-/*
-  TOS holds index.
-*/
-void Parser::parseDisjunction(JumpList& failures)
-{
-    parseAlternative(failures);
-    if (peek() != '|')
-        return;
-
-    JumpList successes;
-    do {
-        consume();
-        m_generator.terminateAlternative(successes, failures);
-        parseAlternative(failures);
-    } while (peek() == '|');
-
-    m_generator.terminateDisjunction(successes);
-}
-
-Generator::ParenthesesType Parser::consumeParenthesesType()
-{
-    if (peek() != '?')
-        return Generator::Capturing;
-    consume();
-
-    switch (consume()) {
-    case ':':
-        return Generator::NonCapturing;
-    
-    case '=':
-        return Generator::Assertion;
-
-    case '!':
-        return Generator::InvertedAssertion;
-
-    default:
-        setError(ParenthesesTypeInvalid);
-        return Generator::Error;
-    }
-}
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
diff --git a/JavaScriptCore/wrec/WRECParser.h b/JavaScriptCore/wrec/WRECParser.h
deleted file mode 100644
index a3e151b..0000000
--- a/JavaScriptCore/wrec/WRECParser.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 Parser_h
-#define Parser_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(WREC)
-
-#include "Escapes.h"
-#include "Quantifier.h"
-#include "UString.h"
-#include "WRECGenerator.h"
-#include <wtf/ASCIICType.h>
-
-namespace JSC { namespace WREC {
-
-    struct CharacterClass;
-
-    class Parser {
-    typedef Generator::JumpList JumpList;
-    typedef Generator::ParenthesesType ParenthesesType;
-
-    friend class SavedState;
-
-    public:
-        Parser(const UString& pattern, bool ignoreCase, bool multiline)
-            : m_generator(*this)
-            , m_data(pattern.data())
-            , m_size(pattern.size())
-            , m_ignoreCase(ignoreCase)
-            , m_multiline(multiline)
-        {
-            reset();
-        }
-        
-        Generator& generator() { return m_generator; }
-
-        bool ignoreCase() const { return m_ignoreCase; }
-        bool multiline() const { return m_multiline; }
-
-        void recordSubpattern() { ++m_numSubpatterns; }
-        unsigned numSubpatterns() const { return m_numSubpatterns; }
-        
-        const char* error() const { return m_error; }
-        const char* syntaxError() const { return m_error == ParenthesesNotSupported ? 0 : m_error; }
-        
-        void parsePattern(JumpList& failures)
-        {
-            reset();
-
-            parseDisjunction(failures);
-
-            if (peek() != EndOfPattern)
-                setError(ParenthesesUnmatched); // Parsing the pattern should fully consume it.
-        }
-
-        void parseDisjunction(JumpList& failures);
-        void parseAlternative(JumpList& failures);
-        bool parseTerm(JumpList& failures);
-        bool parseNonCharacterEscape(JumpList& failures, const Escape&);
-        bool parseParentheses(JumpList& failures);
-        bool parseCharacterClass(JumpList& failures);
-        bool parseCharacterClassQuantifier(JumpList& failures, const CharacterClass& charClass, bool invert);
-        bool parseBackreferenceQuantifier(JumpList& failures, unsigned subpatternId);
-
-    private:
-        class SavedState {
-        public:
-            SavedState(Parser& parser)
-                : m_parser(parser)
-                , m_index(parser.m_index)
-            {
-            }
-            
-            void restore()
-            {
-                m_parser.m_index = m_index;
-            }
-
-        private:
-            Parser& m_parser;
-            unsigned m_index;
-        };
-
-        void reset()
-        {
-            m_index = 0;
-            m_numSubpatterns = 0;
-            m_error = 0;
-        }
-
-        void setError(const char* error)
-        {
-            if (m_error)
-                return;
-            m_error = error;
-        }
-
-        int peek()
-        {
-            if (m_index >= m_size)
-                return EndOfPattern;
-            return m_data[m_index];
-        }
-
-        int consume()
-        {
-            if (m_index >= m_size)
-                return EndOfPattern;
-            return m_data[m_index++];
-        }
-
-        bool peekIsDigit()
-        {
-            return WTF::isASCIIDigit(peek());
-        }
-
-        unsigned peekDigit()
-        {
-            ASSERT(peekIsDigit());
-            return peek() - '0';
-        }
-
-        unsigned consumeDigit()
-        {
-            ASSERT(peekIsDigit());
-            return consume() - '0';
-        }
-
-        unsigned consumeNumber()
-        {
-            int n = consumeDigit();
-            while (peekIsDigit()) {
-                n *= 10;
-                n += consumeDigit();
-            }
-            return n;
-        }
-
-        int consumeHex(int count)
-        {
-            int n = 0;
-            while (count--) {
-                if (!WTF::isASCIIHexDigit(peek()))
-                    return -1;
-                n = (n << 4) | WTF::toASCIIHexValue(consume());
-            }
-            return n;
-        }
-
-        unsigned consumeOctal()
-        {
-            unsigned n = 0;
-            while (n < 32 && WTF::isASCIIOctalDigit(peek()))
-                n = n * 8 + consumeDigit();
-            return n;
-        }
-        
-        ALWAYS_INLINE Quantifier consumeGreedyQuantifier();
-        Quantifier consumeQuantifier();
-        Escape consumeEscape(bool inCharacterClass);
-        ParenthesesType consumeParenthesesType();
-
-        static const int EndOfPattern = -1;
-
-        // Error messages.
-        static const char* QuantifierOutOfOrder;
-        static const char* QuantifierWithoutAtom;
-        static const char* ParenthesesUnmatched;
-        static const char* ParenthesesTypeInvalid;
-        static const char* ParenthesesNotSupported;
-        static const char* CharacterClassUnmatched;
-        static const char* CharacterClassOutOfOrder;
-        static const char* EscapeUnterminated;
-
-        Generator m_generator;
-        const UChar* m_data;
-        unsigned m_size;
-        unsigned m_index;
-        bool m_ignoreCase;
-        bool m_multiline;
-        unsigned m_numSubpatterns;
-        const char* m_error;
-    };
-
-} } // namespace JSC::WREC
-
-#endif // ENABLE(WREC)
-
-#endif // Parser_h
diff --git a/JavaScriptCore/wscript b/JavaScriptCore/wscript
index 7caf8b4..61ad1fb 100644
--- a/JavaScriptCore/wscript
+++ b/JavaScriptCore/wscript
@@ -30,7 +30,7 @@
 from settings import *
 
 jscore_excludes = ['jsc.cpp', 'ucptable.cpp']
-jscore_excludes.extend(get_excludes(jscore_dir, ['*CF.cpp', '*Symbian.cpp']))
+jscore_excludes.extend(get_excludes(jscore_dir, ['*Brew.cpp', '*CF.cpp', '*Symbian.cpp']))
 
 sources = []
 
@@ -78,7 +78,7 @@
     # 1. A simple program
     jscore = bld.new_task_gen(
         features = 'cxx cstaticlib',
-        includes = '. .. assembler wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
+        includes = '. .. assembler DerivedSources ForwardingHeaders ' + ' '.join(includes),
         source = sources,
         target = 'jscore',
         uselib = 'WX ICU ' + get_config(),
@@ -89,7 +89,7 @@
         
     obj = bld.new_task_gen(
         features = 'cxx cprogram',
-        includes = '. .. assembler wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
+        includes = '. .. assembler DerivedSources ForwardingHeaders ' + ' '.join(includes),
         source = 'jsc.cpp',
         target = 'jsc',
         uselib = 'WX ICU ' + get_config(),
diff --git a/JavaScriptCore/wtf/ASCIICType.h b/JavaScriptCore/wtf/ASCIICType.h
index 0c3c29f..b43bb37 100644
--- a/JavaScriptCore/wtf/ASCIICType.h
+++ b/JavaScriptCore/wtf/ASCIICType.h
@@ -30,7 +30,6 @@
 #define WTF_ASCIICType_h
 
 #include <wtf/Assertions.h>
-#include <wtf/Platform.h>
 
 // The behavior of many of the functions in the <ctype.h> header is dependent
 // on the current locale. But in the WebKit project, all uses of those functions
diff --git a/JavaScriptCore/wtf/AlwaysInline.h b/JavaScriptCore/wtf/AlwaysInline.h
index ce27df6..34f8b74 100644
--- a/JavaScriptCore/wtf/AlwaysInline.h
+++ b/JavaScriptCore/wtf/AlwaysInline.h
@@ -59,9 +59,17 @@
 #ifndef NO_RETURN
 #if COMPILER(GCC)
 #define NO_RETURN __attribute((__noreturn__))
-#elif COMPILER(RVCT)
+#elif COMPILER(MSVC) || COMPILER(RVCT)
 #define NO_RETURN __declspec(noreturn)
 #else
 #define NO_RETURN
 #endif
 #endif
+
+#ifndef NO_RETURN_WITH_VALUE
+#if !COMPILER(MSVC)
+#define NO_RETURN_WITH_VALUE NO_RETURN
+#else
+#define NO_RETURN_WITH_VALUE
+#endif
+#endif
diff --git a/JavaScriptCore/wtf/Assertions.h b/JavaScriptCore/wtf/Assertions.h
index 0e02af5..df8646f 100644
--- a/JavaScriptCore/wtf/Assertions.h
+++ b/JavaScriptCore/wtf/Assertions.h
@@ -56,6 +56,7 @@
 #endif
 
 #ifdef NDEBUG
+/* Disable ASSERT* macros in release mode. */
 #define ASSERTIONS_DISABLED_DEFAULT 1
 #else
 #define ASSERTIONS_DISABLED_DEFAULT 0
@@ -148,8 +149,14 @@
 }
 #endif
 
-/* CRASH -- gets us into the debugger or the crash reporter -- signals are ignored by the crash reporter so we must do better */
+/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter.
 
+   Use CRASH() in response to known, unrecoverable errors like out-of-memory.
+   Macro is enabled in both debug and release mode.
+   To test for unknown errors and verify assumptions, use ASSERT instead, to avoid impacting performance in release builds.
+
+   Signals are ignored by the crash reporter on OS X so we must do better.
+*/
 #ifndef CRASH
 #if OS(SYMBIAN)
 #define CRASH() do { \
@@ -164,7 +171,11 @@
 #endif
 #endif
 
-/* ASSERT, ASSERT_NOT_REACHED, ASSERT_UNUSED */
+/* ASSERT, ASSERT_NOT_REACHED, ASSERT_UNUSED
+
+  These macros are compiled out of release builds.
+  Expressions inside them are evaluated in debug builds only.
+*/
 
 #if OS(WINCE) && !PLATFORM(TORCHMOBILE)
 /* FIXME: We include this here only to avoid a conflict with the ASSERT macro. */
diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp
index 90d1e3f..7824159 100644
--- a/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/JavaScriptCore/wtf/FastMalloc.cpp
@@ -204,6 +204,16 @@
 
 #if FORCE_SYSTEM_MALLOC
 
+#if PLATFORM(BREWMP)
+#include "brew/SystemMallocBrew.h"
+#endif
+
+#if OS(DARWIN)
+#include <malloc/malloc.h>
+#elif COMPILER(MSVC)
+#include <malloc.h>
+#endif
+
 namespace WTF {
 
 TryMallocReturnValue tryFastMalloc(size_t n) 
@@ -365,10 +375,21 @@
     
 FastMallocStatistics fastMallocStatistics()
 {
-    FastMallocStatistics statistics = { 0, 0, 0, 0 };
+    FastMallocStatistics statistics = { 0, 0, 0 };
     return statistics;
 }
 
+size_t fastMallocSize(const void* p)
+{
+#if OS(DARWIN)
+    return malloc_size(p);
+#elif COMPILER(MSVC)
+    return _msize(const_cast<void*>(p));
+#else
+    return 1;
+#endif
+}
+
 } // namespace WTF
 
 #if OS(DARWIN)
@@ -396,7 +417,6 @@
 #include <algorithm>
 #include <errno.h>
 #include <limits>
-#include <new>
 #include <pthread.h>
 #include <stdarg.h>
 #include <stddef.h>
@@ -411,7 +431,7 @@
 #include <windows.h>
 #endif
 
-#if WTF_CHANGES
+#ifdef WTF_CHANGES
 
 #if OS(DARWIN)
 #include "MallocZoneSupport.h"
@@ -460,7 +480,7 @@
 #define CHECK_CONDITION ASSERT
 
 #if OS(DARWIN)
-class Span;
+struct Span;
 class TCMalloc_Central_FreeListPadded;
 class TCMalloc_PageHeap;
 class TCMalloc_ThreadCache;
@@ -1232,18 +1252,26 @@
 // -------------------------------------------------------------------------
 
 #if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
-// The central page heap collects spans of memory that have been deleted but are still committed until they are released
-// back to the system.  We use a background thread to periodically scan the list of free spans and release some back to the
-// system.  Every 5 seconds, the background thread wakes up and does the following:
-// - Check if we needed to commit memory in the last 5 seconds.  If so, skip this scavenge because it's a sign that we are short
-// of free committed pages and so we should not release them back to the system yet.
-// - Otherwise, go through the list of free spans (from largest to smallest) and release up to a fraction of the free committed pages
-// back to the system.
-// - If the number of free committed pages reaches kMinimumFreeCommittedPageCount, we can stop the scavenging and block the
-// scavenging thread until the number of free committed pages goes above kMinimumFreeCommittedPageCount.
+// The page heap maintains a free list for spans that are no longer in use by
+// the central cache or any thread caches. We use a background thread to
+// periodically scan the free list and release a percentage of it back to the OS.
 
-// Background thread wakes up every 5 seconds to scavenge as long as there is memory available to return to the system.
-static const int kScavengeTimerDelayInSeconds = 5;
+// If free_committed_pages_ exceeds kMinimumFreeCommittedPageCount, the
+// background thread:
+//     - wakes up
+//     - pauses for kScavengeDelayInSeconds
+//     - returns to the OS a percentage of the memory that remained unused during
+//       that pause (kScavengePercentage * min_free_committed_pages_since_last_scavenge_)
+// The goal of this strategy is to reduce memory pressure in a timely fashion
+// while avoiding thrashing the OS allocator.
+
+// Time delay before the page heap scavenger will consider returning pages to
+// the OS.
+static const int kScavengeDelayInSeconds = 2;
+
+// Approximate percentage of free committed pages to return to the OS in one
+// scavenge.
+static const float kScavengePercentage = .5f;
 
 // Number of free committed pages that we want to keep around.
 static const size_t kMinimumFreeCommittedPageCount = 512;
@@ -1353,8 +1381,9 @@
   // Number of pages kept in free lists that are still committed.
   Length free_committed_pages_;
 
-  // Number of pages that we committed in the last scavenge wait interval.
-  Length pages_committed_since_last_scavenge_;
+  // Minimum number of free committed pages since last scavenge. (Can be 0 if
+  // we've committed new pages since the last scavenge.)
+  Length min_free_committed_pages_since_last_scavenge_;
 #endif
 
   bool GrowHeap(Length n);
@@ -1399,13 +1428,13 @@
   void initializeScavenger();
   ALWAYS_INLINE void signalScavenger();
   void scavenge();
-  ALWAYS_INLINE bool shouldContinueScavenging() const;
+  ALWAYS_INLINE bool shouldScavenge() const;
 
 #if !HAVE(DISPATCH_H)
-  static NO_RETURN void* runScavengerThread(void*);
+  static NO_RETURN_WITH_VALUE void* runScavengerThread(void*);
   NO_RETURN void scavengerThread();
 
-  // Keeps track of whether the background thread is actively scavenging memory every kScavengeTimerDelayInSeconds, or
+  // Keeps track of whether the background thread is actively scavenging memory every kScavengeDelayInSeconds, or
   // it's blocked waiting for more pages to be deleted.
   bool m_scavengeThreadActive;
 
@@ -1431,7 +1460,7 @@
 
 #if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
   free_committed_pages_ = 0;
-  pages_committed_since_last_scavenge_ = 0;
+  min_free_committed_pages_since_last_scavenge_ = 0;
 #endif  // USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
 
   scavenge_counter_ = 0;
@@ -1474,7 +1503,7 @@
 
 ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger()
 {
-  if (!m_scavengeThreadActive && shouldContinueScavenging())
+  if (!m_scavengeThreadActive && shouldScavenge())
     pthread_cond_signal(&m_scavengeCondition);
 }
 
@@ -1484,15 +1513,15 @@
 {
   m_scavengeQueue = dispatch_queue_create("com.apple.JavaScriptCore.FastMallocSavenger", NULL);
   m_scavengeTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, m_scavengeQueue);
-  dispatch_time_t startTime = dispatch_time(DISPATCH_TIME_NOW, kScavengeTimerDelayInSeconds * NSEC_PER_SEC);
-  dispatch_source_set_timer(m_scavengeTimer, startTime, kScavengeTimerDelayInSeconds * NSEC_PER_SEC, 1000 * NSEC_PER_USEC);
+  dispatch_time_t startTime = dispatch_time(DISPATCH_TIME_NOW, kScavengeDelayInSeconds * NSEC_PER_SEC);
+  dispatch_source_set_timer(m_scavengeTimer, startTime, kScavengeDelayInSeconds * NSEC_PER_SEC, 1000 * NSEC_PER_USEC);
   dispatch_source_set_event_handler(m_scavengeTimer, ^{ periodicScavenge(); });
   m_scavengingScheduled = false;
 }
 
 ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger()
 {
-  if (!m_scavengingScheduled && shouldContinueScavenging()) {
+  if (!m_scavengingScheduled && shouldScavenge()) {
     m_scavengingScheduled = true;
     dispatch_resume(m_scavengeTimer);
   }
@@ -1502,17 +1531,12 @@
 
 void TCMalloc_PageHeap::scavenge()
 {
-    // If we've recently commited pages, our working set is growing, so now is
-    // not a good time to free pages.
-    if (pages_committed_since_last_scavenge_ > 0) {
-        pages_committed_since_last_scavenge_ = 0;
-        return;
-    }
+    size_t pagesToRelease = min_free_committed_pages_since_last_scavenge_ * kScavengePercentage;
+    size_t targetPageCount = std::max<size_t>(kMinimumFreeCommittedPageCount, free_committed_pages_ - pagesToRelease);
 
-    for (int i = kMaxPages; i >= 0 && shouldContinueScavenging(); i--) {
+    for (int i = kMaxPages; i >= 0 && free_committed_pages_ > targetPageCount; i--) {
         SpanList* slist = (static_cast<size_t>(i) == kMaxPages) ? &large_ : &free_[i];
-        if (!DLL_IsEmpty(&slist->normal)) {
-            // Release the last span on the normal portion of this list
+        while (!DLL_IsEmpty(&slist->normal) && free_committed_pages_ > targetPageCount) {
             Span* s = slist->normal.prev; 
             DLL_Remove(s);
             ASSERT(!s->decommitted);
@@ -1527,11 +1551,10 @@
         }
     }
 
-    ASSERT(!shouldContinueScavenging());
-    pages_committed_since_last_scavenge_ = 0;
+    min_free_committed_pages_since_last_scavenge_ = free_committed_pages_;
 }
 
-ALWAYS_INLINE bool TCMalloc_PageHeap::shouldContinueScavenging() const 
+ALWAYS_INLINE bool TCMalloc_PageHeap::shouldScavenge() const 
 {
     return free_committed_pages_ > kMinimumFreeCommittedPageCount; 
 }
@@ -1563,9 +1586,6 @@
     if (result->decommitted) {
         TCMalloc_SystemCommit(reinterpret_cast<void*>(result->start << kPageShift), static_cast<size_t>(n << kPageShift));
         result->decommitted = false;
-#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
-        pages_committed_since_last_scavenge_ += n;
-#endif
     }
 #if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
     else {
@@ -1573,6 +1593,8 @@
         // free committed pages count.
         ASSERT(free_committed_pages_ >= n);
         free_committed_pages_ -= n;
+        if (free_committed_pages_ < min_free_committed_pages_since_last_scavenge_)
+            min_free_committed_pages_since_last_scavenge_ = free_committed_pages_;
     }
 #endif  // USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
     ASSERT(Check());
@@ -1634,9 +1656,6 @@
     if (best->decommitted) {
         TCMalloc_SystemCommit(reinterpret_cast<void*>(best->start << kPageShift), static_cast<size_t>(n << kPageShift));
         best->decommitted = false;
-#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
-        pages_committed_since_last_scavenge_ += n;
-#endif
     }
 #if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
     else {
@@ -1644,6 +1663,8 @@
         // free committed pages count.
         ASSERT(free_committed_pages_ >= n);
         free_committed_pages_ -= n;
+        if (free_committed_pages_ < min_free_committed_pages_since_last_scavenge_)
+            min_free_committed_pages_since_last_scavenge_ = free_committed_pages_;
     }
 #endif  // USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
     ASSERT(Check());
@@ -1787,6 +1808,8 @@
       // If the merged span is decommitted, that means we decommitted any neighboring spans that were
       // committed.  Update the free committed pages count.
       free_committed_pages_ -= neighboringCommittedSpansLength;
+      if (free_committed_pages_ < min_free_committed_pages_since_last_scavenge_)
+            min_free_committed_pages_since_last_scavenge_ = free_committed_pages_;
   } else {
       // If the merged span remains committed, add the deleted span's size to the free committed pages count.
       free_committed_pages_ += n;
@@ -1951,10 +1974,6 @@
   }
   ask = actual_size >> kPageShift;
 
-#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
-  pages_committed_since_last_scavenge_ += ask;
-#endif
-
   uint64_t old_system_bytes = system_bytes_;
   system_bytes_ += (ask << kPageShift);
   const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
@@ -2352,15 +2371,15 @@
 #endif
 
   while (1) {
-      if (!shouldContinueScavenging()) {
+      if (!shouldScavenge()) {
           pthread_mutex_lock(&m_scavengeMutex);
           m_scavengeThreadActive = false;
-          // Block until there are enough freed pages to release back to the system.
+          // Block until there are enough free committed pages to release back to the system.
           pthread_cond_wait(&m_scavengeCondition, &m_scavengeMutex);
           m_scavengeThreadActive = true;
           pthread_mutex_unlock(&m_scavengeMutex);
       }
-      sleep(kScavengeTimerDelayInSeconds);
+      sleep(kScavengeDelayInSeconds);
       {
           SpinLockHolder h(&pageheap_lock);
           pageheap->scavenge();
@@ -2377,7 +2396,7 @@
     pageheap->scavenge();
   }
 
-  if (!shouldContinueScavenging()) {
+  if (!shouldScavenge()) {
     m_scavengingScheduled = false;
     dispatch_suspend(m_scavengeTimer);
   }
@@ -3922,6 +3941,8 @@
   }
 }
 
+#if ENABLE(GLOBAL_FASTMALLOC_NEW)
+
 void* operator new(size_t size) {
   void* p = cpp_alloc(size, false);
   // We keep this next instruction out of cpp_alloc for a reason: when
@@ -3976,6 +3997,8 @@
   do_free(p);
 }
 
+#endif
+
 extern "C" void* memalign(size_t align, size_t size) __THROW {
   void* result = do_memalign(align, size);
   MallocHook::InvokeNewHook(result, size);
@@ -4091,7 +4114,62 @@
 
 #endif
 
-#if defined(WTF_CHANGES) && OS(DARWIN)
+#ifdef WTF_CHANGES
+void releaseFastMallocFreeMemory()
+{
+    // Flush free pages in the current thread cache back to the page heap.
+    // Low watermark mechanism in Scavenge() prevents full return on the first pass.
+    // The second pass flushes everything.
+    if (TCMalloc_ThreadCache* threadCache = TCMalloc_ThreadCache::GetCacheIfPresent()) {
+        threadCache->Scavenge();
+        threadCache->Scavenge();
+    }
+
+    SpinLockHolder h(&pageheap_lock);
+    pageheap->ReleaseFreePages();
+}
+    
+FastMallocStatistics fastMallocStatistics()
+{
+    FastMallocStatistics statistics;
+
+    SpinLockHolder lockHolder(&pageheap_lock);
+    statistics.reservedVMBytes = static_cast<size_t>(pageheap->SystemBytes());
+    statistics.committedVMBytes = statistics.reservedVMBytes - pageheap->ReturnedBytes();
+
+    statistics.freeListBytes = 0;
+    for (unsigned cl = 0; cl < kNumClasses; ++cl) {
+        const int length = central_cache[cl].length();
+        const int tc_length = central_cache[cl].tc_length();
+
+        statistics.freeListBytes += ByteSizeForClass(cl) * (length + tc_length);
+    }
+    for (TCMalloc_ThreadCache* threadCache = thread_heaps; threadCache ; threadCache = threadCache->next_)
+        statistics.freeListBytes += threadCache->Size();
+
+    return statistics;
+}
+
+size_t fastMallocSize(const void* ptr)
+{
+    const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
+    Span* span = pageheap->GetDescriptorEnsureSafe(p);
+
+    if (!span || span->free)
+        return 0;
+
+    for (void* free = span->objects; free != NULL; free = *((void**) free)) {
+        if (ptr == free)
+            return 0;
+    }
+
+    if (size_t cl = span->sizeclass)
+        return ByteSizeForClass(cl);
+
+    return span->length << kPageShift;
+}
+
+#if OS(DARWIN)
 
 class FreeObjectFinder {
     const RemoteMemoryReader& m_reader;
@@ -4377,6 +4455,9 @@
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !OS(IPHONE_OS)
     , 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher.
 #endif
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) && !OS(IPHONE_OS)
+    , 0, 0, 0, 0 // These members will not be used unless the zone advertises itself as version seven or higher.
+#endif
 
     };
 }
@@ -4408,44 +4489,9 @@
     static FastMallocZone zone(pageheap, &thread_heaps, static_cast<TCMalloc_Central_FreeListPadded*>(central_cache), &span_allocator, &threadheap_allocator);
 }
 
-#endif
-
-#if WTF_CHANGES
-void releaseFastMallocFreeMemory()
-{
-    // Flush free pages in the current thread cache back to the page heap.
-    // Low watermark mechanism in Scavenge() prevents full return on the first pass.
-    // The second pass flushes everything.
-    if (TCMalloc_ThreadCache* threadCache = TCMalloc_ThreadCache::GetCacheIfPresent()) {
-        threadCache->Scavenge();
-        threadCache->Scavenge();
-    }
-
-    SpinLockHolder h(&pageheap_lock);
-    pageheap->ReleaseFreePages();
-}
-    
-FastMallocStatistics fastMallocStatistics()
-{
-    FastMallocStatistics statistics;
-    {
-        SpinLockHolder lockHolder(&pageheap_lock);
-        statistics.heapSize = static_cast<size_t>(pageheap->SystemBytes());
-        statistics.freeSizeInHeap = static_cast<size_t>(pageheap->FreeBytes());
-        statistics.returnedSize = pageheap->ReturnedBytes();
-        statistics.freeSizeInCaches = 0;
-        for (TCMalloc_ThreadCache* threadCache = thread_heaps; threadCache ; threadCache = threadCache->next_)
-            statistics.freeSizeInCaches += threadCache->Size();
-    }
-    for (unsigned cl = 0; cl < kNumClasses; ++cl) {
-        const int length = central_cache[cl].length();
-        const int tc_length = central_cache[cl].tc_length();
-        statistics.freeSizeInCaches += ByteSizeForClass(cl) * (length + tc_length);
-    }
-    return statistics;
-}
+#endif // OS(DARWIN)
 
 } // namespace WTF
-#endif
+#endif // WTF_CHANGES
 
 #endif // FORCE_SYSTEM_MALLOC
diff --git a/JavaScriptCore/wtf/FastMalloc.h b/JavaScriptCore/wtf/FastMalloc.h
index 74d4307..1ccd6a6 100644
--- a/JavaScriptCore/wtf/FastMalloc.h
+++ b/JavaScriptCore/wtf/FastMalloc.h
@@ -34,6 +34,7 @@
     void* fastCalloc(size_t numElements, size_t elementSize);
     void* fastRealloc(void*, size_t);
     char* fastStrDup(const char*);
+    size_t fastMallocSize(const void*);
 
     struct TryMallocReturnValue {
         TryMallocReturnValue(void* data)
@@ -82,10 +83,9 @@
     void releaseFastMallocFreeMemory();
     
     struct FastMallocStatistics {
-        size_t heapSize;
-        size_t freeSizeInHeap;
-        size_t freeSizeInCaches;
-        size_t returnedSize;
+        size_t reservedVMBytes;
+        size_t committedVMBytes;
+        size_t freeListBytes;
     };
     FastMallocStatistics fastMallocStatistics();
 
@@ -180,16 +180,17 @@
 
 } // namespace WTF
 
-using WTF::fastMalloc;
-using WTF::fastZeroedMalloc;
 using WTF::fastCalloc;
-using WTF::fastRealloc;
-using WTF::tryFastMalloc;
-using WTF::tryFastZeroedMalloc;
-using WTF::tryFastCalloc;
-using WTF::tryFastRealloc;
 using WTF::fastFree;
+using WTF::fastMalloc;
+using WTF::fastMallocSize;
+using WTF::fastRealloc;
 using WTF::fastStrDup;
+using WTF::fastZeroedMalloc;
+using WTF::tryFastCalloc;
+using WTF::tryFastMalloc;
+using WTF::tryFastRealloc;
+using WTF::tryFastZeroedMalloc;
 
 #ifndef NDEBUG    
 using WTF::fastMallocForbid;
@@ -215,8 +216,7 @@
 // debug-only code to make sure we don't use the system malloc via the default operator
 // new by accident.
 
-// We musn't customize the global operator new and delete for the Qt port.
-#if !PLATFORM(QT)
+#if ENABLE(GLOBAL_FASTMALLOC_NEW)
 
 #if COMPILER(MSVC)
 #pragma warning(push)
diff --git a/JavaScriptCore/wtf/HashCountedSet.h b/JavaScriptCore/wtf/HashCountedSet.h
index 165eb41..4ed75c5 100644
--- a/JavaScriptCore/wtf/HashCountedSet.h
+++ b/JavaScriptCore/wtf/HashCountedSet.h
@@ -43,7 +43,7 @@
         int capacity() const;
         bool isEmpty() const;
         
-        // iterators iterate over pairs of values and counts
+        // Iterators iterate over pairs of values and counts.
         iterator begin();
         iterator end();
         const_iterator begin() const;
@@ -54,21 +54,21 @@
         bool contains(const ValueType&) const;
         unsigned count(const ValueType&) const;
 
-        // increases the count if an equal value is already present
-        // the return value is a pair of an interator to the new value's location, 
-        // and a bool that is true if an new entry was added
+        // Increases the count if an equal value is already present
+        // the return value is a pair of an interator to the new value's 
+        // location, and a bool that is true if an new entry was added.
         std::pair<iterator, bool> add(const ValueType&);
         
-        // reduces the count of the value, and removes it if count
-        // goes down to zero
-        void remove(const ValueType&);
-        void remove(iterator);
+        // Reduces the count of the value, and removes it if count
+        // goes down to zero, returns true if the value is removed.
+        bool remove(const ValueType&);
+        bool remove(iterator);
  
-        // removes the value, regardless of its count
+        // Removes the value, regardless of its count.
         void removeAll(iterator);
         void removeAll(const ValueType&);
 
-        // clears the whole set
+        // Clears the whole set.
         void clear();
 
     private:
@@ -150,24 +150,27 @@
     }
     
     template<typename Value, typename HashFunctions, typename Traits>
-    inline void HashCountedSet<Value, HashFunctions, Traits>::remove(const ValueType& value)
+    inline bool HashCountedSet<Value, HashFunctions, Traits>::remove(const ValueType& value)
     {
-        remove(find(value));
+        return remove(find(value));
     }
     
     template<typename Value, typename HashFunctions, typename Traits>
-    inline void HashCountedSet<Value, HashFunctions, Traits>::remove(iterator it)
+    inline bool HashCountedSet<Value, HashFunctions, Traits>::remove(iterator it)
     {
         if (it == end())
-            return;
+            return false;
 
         unsigned oldVal = it->second;
-        ASSERT(oldVal != 0);
+        ASSERT(oldVal);
         unsigned newVal = oldVal - 1;
-        if (newVal == 0)
-            m_impl.remove(it);
-        else
+        if (newVal) {
             it->second = newVal;
+            return false;
+        }
+
+        m_impl.remove(it);
+        return true;
     }
     
     template<typename Value, typename HashFunctions, typename Traits>
diff --git a/JavaScriptCore/wtf/HashMap.h b/JavaScriptCore/wtf/HashMap.h
index d63a8d4..09094d1 100644
--- a/JavaScriptCore/wtf/HashMap.h
+++ b/JavaScriptCore/wtf/HashMap.h
@@ -133,9 +133,10 @@
 
         static unsigned hash(const T& key) { return Translator::hash(key); }
         static bool equal(const KeyType& a, const T& b) { return Translator::equal(a, b); }
-        static void translate(ValueType& location, const T& key, const MappedType&, unsigned hashCode)
+        static void translate(ValueType& location, const T& key, const MappedType& mapped, unsigned hashCode)
         {
             Translator::translate(location.first, key, hashCode);
+            location.second = mapped;
         }
     };
 
diff --git a/JavaScriptCore/wtf/MathExtras.h b/JavaScriptCore/wtf/MathExtras.h
index 089e8ff..ac9bf60 100644
--- a/JavaScriptCore/wtf/MathExtras.h
+++ b/JavaScriptCore/wtf/MathExtras.h
@@ -123,6 +123,8 @@
 
 #if COMPILER(MSVC)
 
+inline long long abs(long long num) { return _abs64(num); }
+
 inline bool isinf(double num) { return !_finite(num) && !_isnan(num); }
 inline bool isnan(double num) { return !!_isnan(num); }
 inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
diff --git a/JavaScriptCore/wtf/OwnFastMallocPtr.h b/JavaScriptCore/wtf/OwnFastMallocPtr.h
index c88235a..8b6cbf4 100644
--- a/JavaScriptCore/wtf/OwnFastMallocPtr.h
+++ b/JavaScriptCore/wtf/OwnFastMallocPtr.h
@@ -35,7 +35,7 @@
 
         ~OwnFastMallocPtr()
         {
-            fastFree(m_ptr);
+            fastFree(const_cast<void*>(static_cast<const void*>(const_cast<const T*>(m_ptr))));
         }
 
         T* get() const { return m_ptr; }
diff --git a/JavaScriptCore/wtf/OwnPtr.h b/JavaScriptCore/wtf/OwnPtr.h
index b7e62b1..af1684b 100644
--- a/JavaScriptCore/wtf/OwnPtr.h
+++ b/JavaScriptCore/wtf/OwnPtr.h
@@ -40,7 +40,6 @@
         typedef ValueType* PtrType;
 
         explicit OwnPtr(PtrType ptr = 0) : m_ptr(ptr) { }
-        OwnPtr(std::auto_ptr<ValueType> autoPtr) : m_ptr(autoPtr.release()) { }
         // See comment in PassOwnPtr.h for why this takes a const reference.
         template <typename U> OwnPtr(const PassOwnPtr<U>& o);
 
@@ -58,8 +57,6 @@
         // FIXME: This should be renamed to adopt. 
         void set(PtrType ptr) { ASSERT(!ptr || m_ptr != ptr); deleteOwnedPtr(m_ptr); m_ptr = ptr; }
 
-        void adopt(std::auto_ptr<ValueType> autoPtr) { ASSERT(!autoPtr.get() || m_ptr != autoPtr.get()); deleteOwnedPtr(m_ptr); m_ptr = autoPtr.release(); }
-
         void clear() { deleteOwnedPtr(m_ptr); m_ptr = 0; }
 
         ValueType& operator*() const { ASSERT(m_ptr); return *m_ptr; }
diff --git a/JavaScriptCore/wtf/OwnPtrBrew.cpp b/JavaScriptCore/wtf/OwnPtrBrew.cpp
new file mode 100644
index 0000000..c8384e1
--- /dev/null
+++ b/JavaScriptCore/wtf/OwnPtrBrew.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Company 100 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 COMPUTER, 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 "OwnPtr.h"
+
+#include <AEEBitmap.h>
+#include <AEEFile.h>
+#include <AEEStdLib.h>
+
+namespace WTF {
+
+void deleteOwnedPtr(IFileMgr* ptr)
+{
+    if (ptr)
+        IFILEMGR_Release(ptr);
+}
+
+void deleteOwnedPtr(IFile* ptr)
+{
+    if (ptr)
+        IFILE_Release(ptr);
+}
+
+void deleteOwnedPtr(IBitmap* ptr)
+{
+    if (ptr)
+        IBitmap_Release(ptr);
+}
+
+}
diff --git a/JavaScriptCore/wtf/OwnPtrCommon.h b/JavaScriptCore/wtf/OwnPtrCommon.h
index 6d91a54..c59fdc5 100644
--- a/JavaScriptCore/wtf/OwnPtrCommon.h
+++ b/JavaScriptCore/wtf/OwnPtrCommon.h
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2009 Apple Inc. All rights reserved.
  * Copyright (C) 2009 Torch Mobile, Inc.
+ * Copyright (C) 2010 Company 100 Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,6 +38,14 @@
 typedef struct HRGN__* HRGN;
 #endif
 
+#if PLATFORM(BREWMP)
+// Forward delcarations at this point avoid the need to include BREW includes
+// in WTF headers.
+typedef struct _IFileMgr IFileMgr;
+typedef struct _IFile IFile;
+typedef struct IBitmap IBitmap;
+#endif
+
 namespace WTF {
 
     template <typename T> inline void deleteOwnedPtr(T* ptr)
@@ -56,6 +65,12 @@
     void deleteOwnedPtr(HRGN);
 #endif
 
+#if PLATFORM(BREWMP)
+    void deleteOwnedPtr(IFileMgr*);
+    void deleteOwnedPtr(IFile*);
+    void deleteOwnedPtr(IBitmap*);
+#endif
+
 } // namespace WTF
 
 #endif // WTF_OwnPtrCommon_h
diff --git a/JavaScriptCore/wtf/PassRefPtr.h b/JavaScriptCore/wtf/PassRefPtr.h
index 9c6e44f..d7a9341 100644
--- a/JavaScriptCore/wtf/PassRefPtr.h
+++ b/JavaScriptCore/wtf/PassRefPtr.h
@@ -33,19 +33,32 @@
     // Remove inline for WINSCW compiler to prevent the compiler agressively resolving
     // T::ref() and T::deref(), which will fail compiling when PassRefPtr<T> is used as
     // a class member or function arguments before T is defined.
+
+    // [Qt]r57240 broke Qt build (might be a gcc bug)
+    // FIXME! See: https://bugs.webkit.org/show_bug.cgi?id=37253
     template<typename T>
 #if !COMPILER(WINSCW)
+#if !PLATFORM(QT)
+    ALWAYS_INLINE
+#else
     inline
 #endif
+#endif
     void refIfNotNull(T* ptr)
     {
         if (UNLIKELY(ptr != 0))
             ptr->ref();
     }
 
+    // [Qt]r57240 broke Qt build (might be a gcc bug)
+    // FIXME! See: https://bugs.webkit.org/show_bug.cgi?id=37253
     template<typename T> 
 #if !COMPILER(WINSCW)
-    inline 
+#if !PLATFORM(QT)
+    ALWAYS_INLINE
+#else
+    inline
+#endif
 #endif
     void derefIfNotNull(T* ptr)
     {
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index a6ded58..405d3e7 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -79,13 +79,21 @@
 #endif
 
 /* COMPILER(MINGW) - MinGW GCC */
-#if defined(MINGW) || defined(__MINGW32__)
+/* COMPILER(MINGW64) - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */
+#if defined(__MINGW32__)
 #define WTF_COMPILER_MINGW 1
-#endif
+#include <_mingw.h> /* private MinGW header */
+    #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */
+        #define WTF_COMPILER_MINGW64 1
+    #endif /* __MINGW64_VERSION_MAJOR */
+#endif /* __MINGW32__ */
 
 /* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */
 #if defined(__WINSCW__)
 #define WTF_COMPILER_WINSCW 1
+/* cross-compiling, it is not really windows */
+#undef WIN32
+#undef _WIN32
 #endif
 
 
@@ -102,7 +110,28 @@
 /* CPU(IA64) - Itanium / IA-64 */
 #if defined(__ia64__)
 #define WTF_CPU_IA64 1
+/* 32-bit mode on Itanium */
+#if !defined(__LP64__)
+#define WTF_CPU_IA64_32 1
 #endif
+#endif
+
+/* CPU(MIPS) - MIPS 32-bit */
+/* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now.  */
+#if (defined(mips) || defined(__mips__)) \
+    && defined(_ABIO32)
+#define WTF_CPU_MIPS 1
+#if defined(__MIPSEB__)
+#define WTF_CPU_BIG_ENDIAN 1
+#endif
+#define WTF_MIPS_PIC (defined __PIC__)
+#define WTF_MIPS_ARCH __mips
+#define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v)
+#define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v)
+#define WTF_MIPS_ARCH_REV __mips_isa_rev
+#define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v)
+#define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float)
+#endif /* MIPS */
 
 /* CPU(PPC) - PowerPC 32-bit */
 #if   defined(__ppc__)     \
@@ -142,7 +171,7 @@
 
 /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */
 #if CPU(SPARC32) || CPU(SPARC64)
-#define WTF_CPU_SPARC
+#define WTF_CPU_SPARC 1
 #endif
 
 /* CPU(X86) - i386 / x86 32-bit */
@@ -162,7 +191,9 @@
 
 /* CPU(ARM) - ARM, any version*/
 #if   defined(arm) \
-    || defined(__arm__)
+    || defined(__arm__) \
+    || defined(ARM) \
+    || defined(_ARM_)
 #define WTF_CPU_ARM 1
 
 #if defined(__ARMEB__)
@@ -171,6 +202,7 @@
 #elif !defined(__ARM_EABI__) \
     && !defined(__EABI__) \
     && !defined(__VFP_FP__) \
+    && !defined(_WIN32_WCE) \
     && !defined(ANDROID)
 #define WTF_CPU_MIDDLE_ENDIAN 1
 
@@ -371,9 +403,6 @@
 
 /* OS(SYMBIAN) - Symbian */
 #if defined (__SYMBIAN32__)
-/* we are cross-compiling, it is not really windows */
-#undef WTF_OS_WINDOWS
-#undef WTF_PLATFORM_WIN
 #define WTF_OS_SYMBIAN 1
 #endif
 
@@ -537,6 +566,9 @@
 
 #if PLATFORM(QT)
 #define WTF_USE_QT4_UNICODE 1
+#if !defined(ENABLE_WIDGETS_10_SUPPORT)
+#define ENABLE_WIDGETS_10_SUPPORT 1
+#endif
 #elif OS(WINCE)
 #define WTF_USE_WINCE_UNICODE 1
 #elif PLATFORM(GTK)
@@ -562,10 +594,15 @@
 #define HAVE_RUNLOOP_TIMER 1
 #endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */
 
+#if PLATFORM(MAC)
+#define WTF_USE_CARBON_SECURE_INPUT_MODE 1
+#endif
+
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
 #define WTF_PLATFORM_CF 1
 #define WTF_USE_PTHREADS 1
 #define HAVE_PTHREAD_RWLOCK 1
+#define WTF_USE_CARBON_SECURE_INPUT_MODE 1
 #endif
 
 #if PLATFORM(QT) && OS(DARWIN)
@@ -608,6 +645,7 @@
 
 #if PLATFORM(WX)
 #define ENABLE_ASSEMBLER 1
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 0
 #if OS(DARWIN)
 #define WTF_PLATFORM_CF 1
 #endif
@@ -743,6 +781,11 @@
 
 /* ENABLE macro defaults */
 
+#if PLATFORM(QT)
+// We musn't customize the global operator new and delete for the Qt port.
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 0
+#endif
+
 /* fastMalloc match validation allows for runtime verification that
    new is matched by delete, fastMalloc is matched by fastFree, etc. */
 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
@@ -777,6 +820,10 @@
 #define ENABLE_DASHBOARD_SUPPORT 0
 #endif
 
+#if !defined(ENABLE_WIDGETS_10_SUPPORT)
+#define ENABLE_WIDGETS_10_SUPPORT 0
+#endif
+
 #if !defined(ENABLE_INSPECTOR)
 #define ENABLE_INSPECTOR 1
 #endif
@@ -801,6 +848,10 @@
 #define ENABLE_OPCODE_STATS 0
 #endif
 
+#if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
+#define ENABLE_GLOBAL_FASTMALLOC_NEW 1
+#endif
+
 #define ENABLE_SAMPLING_COUNTERS 0
 #define ENABLE_SAMPLING_FLAGS 0
 #define ENABLE_OPCODE_SAMPLING 0
@@ -820,6 +871,10 @@
 #define ENABLE_NOTIFICATIONS 0
 #endif
 
+#if PLATFORM(IPHONE)
+#define ENABLE_TEXT_CARET 0
+#endif
+
 #if !defined(ENABLE_TEXT_CARET)
 #define ENABLE_TEXT_CARET 1
 #endif
@@ -840,9 +895,12 @@
 #endif
 
 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
-#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) || CPU(IA64) || CPU(ALPHA)
+#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
+    || (CPU(IA64) && !CPU(IA64_32)) \
+    || CPU(ALPHA) \
+    || CPU(SPARC64)
 #define WTF_USE_JSVALUE64 1
-#elif CPU(ARM) || CPU(PPC64)
+#elif CPU(ARM) || CPU(PPC64) || CPU(MIPS)
 #define WTF_USE_JSVALUE32 1
 #elif OS(WINDOWS) && COMPILER(MINGW)
 /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
@@ -885,6 +943,8 @@
 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100
     #define ENABLE_JIT 1
     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
+#elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100
+    #define ENABLE_JIT 1
 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)
     #define ENABLE_JIT 1
     #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
@@ -895,6 +955,9 @@
     #define ENABLE_JIT 1
 #elif CPU(ARM_TRADITIONAL) && OS(LINUX)
     #define ENABLE_JIT 1
+#elif CPU(MIPS) && OS(LINUX)
+    #define ENABLE_JIT 1
+    #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 0
 #endif
 #endif /* PLATFORM(QT) */
 
@@ -959,10 +1022,12 @@
 
 #if PLATFORM(QT)
 #if (CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \
+    || (CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100) \
     || (CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)) \
     || (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \
     || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \
-    || (CPU(ARM_TRADITIONAL) && OS(LINUX))
+    || (CPU(ARM_TRADITIONAL) && OS(LINUX)) \
+    || (CPU(MIPS) && OS(LINUX))
 #define ENABLE_YARR 1
 #define ENABLE_YARR_JIT 1
 #endif
diff --git a/JavaScriptCore/wtf/StaticConstructors.h b/JavaScriptCore/wtf/StaticConstructors.h
new file mode 100644
index 0000000..97af339
--- /dev/null
+++ b/JavaScriptCore/wtf/StaticConstructors.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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 StaticConstructors_h
+#define StaticConstructors_h
+
+// We need to avoid having static constructors. We achieve this
+// with two separate methods for GCC and MSVC. Both methods prevent the static
+// initializers from being registered and called on program startup. On GCC, we
+// declare the global objects with a different type that can be POD default
+// initialized by the linker/loader. On MSVC we use a special compiler feature
+// to have the CRT ignore our static initializers. The constructors will never
+// be called and the objects will be left uninitialized.
+//
+// With both of these approaches, we must define and explicitly call an init
+// routine that uses placement new to create the objects and overwrite the
+// uninitialized placeholders.
+//
+// This is not completely portable, but is what we have for now without
+// changing how a lot of code accesses these global objects.
+
+#ifdef SKIP_STATIC_CONSTRUCTORS_ON_MSVC
+// - Assume that all includes of this header want ALL of their static
+//   initializers ignored. This is currently the case. This means that if
+//   a .cc includes this header (or it somehow gets included), all static
+//   initializers after the include will not be executed.
+// - We do this with a pragma, so that all of the static initializer pointers
+//   go into our own section, and the CRT won't call them. Eventually it would
+//   be nice if the section was discarded, because we don't want the pointers.
+//   See: http://msdn.microsoft.com/en-us/library/7977wcck(VS.80).aspx
+#pragma warning(disable:4075)
+#pragma init_seg(".unwantedstaticinits")
+#endif
+
+#ifndef SKIP_STATIC_CONSTRUCTORS_ON_GCC
+    // Define an global in the normal way.
+#if COMPILER(MSVC7)
+#define DEFINE_GLOBAL(type, name) \
+    const type name;
+#elif COMPILER(WINSCW)
+#define DEFINE_GLOBAL(type, name, arg...) \
+    const type name;
+#else
+#define DEFINE_GLOBAL(type, name, ...) \
+    const type name;
+#endif
+
+#else
+// Define an correctly-sized array of pointers to avoid static initialization.
+// Use an array of pointers instead of an array of char in case there is some alignment issue.
+#if COMPILER(MSVC7)
+#define DEFINE_GLOBAL(type, name) \
+    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
+#elif COMPILER(WINSCW)
+#define DEFINE_GLOBAL(type, name, arg...) \
+    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
+#else
+#define DEFINE_GLOBAL(type, name, ...) \
+    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
+#endif
+#endif
+
+#endif // StaticConstructors_h
diff --git a/JavaScriptCore/wtf/StdLibExtras.h b/JavaScriptCore/wtf/StdLibExtras.h
index 9dfb969..96a929c 100644
--- a/JavaScriptCore/wtf/StdLibExtras.h
+++ b/JavaScriptCore/wtf/StdLibExtras.h
@@ -26,7 +26,6 @@
 #ifndef WTF_StdLibExtras_h
 #define WTF_StdLibExtras_h
 
-#include <wtf/Platform.h>
 #include <wtf/Assertions.h>
 
 // Use these to declare and define a static local variable (static T;) so that
diff --git a/JavaScriptCore/wtf/TCSystemAlloc.cpp b/JavaScriptCore/wtf/TCSystemAlloc.cpp
index 4d02919..c46ff31 100644
--- a/JavaScriptCore/wtf/TCSystemAlloc.cpp
+++ b/JavaScriptCore/wtf/TCSystemAlloc.cpp
@@ -38,6 +38,7 @@
 #include "Assertions.h"
 #include "TCSpinLock.h"
 #include "UnusedParam.h"
+#include "VMTags.h"
 
 #if HAVE(STDINT_H)
 #include <stdint.h>
@@ -178,7 +179,7 @@
   void* result = mmap(NULL, size + extra,
                       PROT_READ | PROT_WRITE,
                       MAP_PRIVATE|MAP_ANONYMOUS,
-                      -1, 0);
+                      VM_TAG_FOR_TCMALLOC_MEMORY, 0);
   if (result == reinterpret_cast<void*>(MAP_FAILED)) {
     mmap_failure = true;
     return NULL;
diff --git a/JavaScriptCore/wtf/Threading.h b/JavaScriptCore/wtf/Threading.h
index 1599562..768aecf 100644
--- a/JavaScriptCore/wtf/Threading.h
+++ b/JavaScriptCore/wtf/Threading.h
@@ -75,7 +75,7 @@
 #include <libkern/OSAtomic.h>
 #elif OS(ANDROID)
 #include <cutils/atomic.h>
-#elif COMPILER(GCC)
+#elif COMPILER(GCC) && !OS(SYMBIAN)
 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
 #include <ext/atomicity.h>
 #else
@@ -86,7 +86,7 @@
 #if USE(PTHREADS)
 #include <pthread.h>
 #elif PLATFORM(GTK)
-#include <wtf/gtk/GOwnPtr.h>
+#include "GOwnPtr.h"
 typedef struct _GMutex GMutex;
 typedef struct _GCond GCond;
 #endif
@@ -239,7 +239,7 @@
 inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }
 inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); }
 
-#elif COMPILER(GCC) && !CPU(SPARC64) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
+#elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
 #define WTF_USE_LOCKFREE_THREADSAFESHARED 1
 
 inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; }
diff --git a/JavaScriptCore/wtf/VMTags.h b/JavaScriptCore/wtf/VMTags.h
index 1ec79d9..6600050 100644
--- a/JavaScriptCore/wtf/VMTags.h
+++ b/JavaScriptCore/wtf/VMTags.h
@@ -26,30 +26,65 @@
 #ifndef VMTags_h
 #define VMTags_h
 
-#include <wtf/Platform.h>
-
 // On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map
 // in order to aid tools that inspect system memory use. 
-#if OS(DARWIN) && !defined(BUILDING_ON_TIGER)
+#if OS(DARWIN)
 
 #include <mach/vm_statistics.h>
 
-#if defined(VM_MEMORY_JAVASCRIPT_CORE) && defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
-#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE)
-#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
+#if !defined(TARGETING_TIGER)
+
+#if defined(VM_MEMORY_TCMALLOC)
+#define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(VM_MEMORY_TCMALLOC)
+#else
+#define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(53)
+#endif // defined(VM_MEMORY_TCMALLOC)
+
+#if defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
 #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
 #else
-#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(63)
 #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(64)
+#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
+
+#if defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
+#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
+#else
 #define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65)
-#endif // defined(VM_MEMORY_JAVASCRIPT_CORE) && defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
+#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
 
-#else // OS(DARWIN) && !defined(BUILDING_ON_TIGER)
+#else // !defined(TARGETING_TIGER)
 
-#define VM_TAG_FOR_COLLECTOR_MEMORY -1
+// mmap on Tiger fails with tags that work on Leopard, so fall
+// back to Tiger-compatible tags (that also work on Leopard)
+// when targeting Tiger.
+#define VM_TAG_FOR_TCMALLOC_MEMORY -1
 #define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1
 #define VM_TAG_FOR_REGISTERFILE_MEMORY -1
 
-#endif // OS(DARWIN) && !defined(BUILDING_ON_TIGER)
+#endif // !defined(TARGETING_TIGER)
+
+// Tags for vm_map and vm_allocate work on both Tiger and Leopard.
+
+#if defined(VM_MEMORY_JAVASCRIPT_CORE)
+#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE)
+#else
+#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(63)
+#endif // defined(VM_MEMORY_JAVASCRIPT_CORE)
+
+#if defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
+#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
+#else
+#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(69)
+#endif // defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
+
+#else // OS(DARWIN)
+
+#define VM_TAG_FOR_TCMALLOC_MEMORY -1
+#define VM_TAG_FOR_COLLECTOR_MEMORY -1
+#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1
+#define VM_TAG_FOR_REGISTERFILE_MEMORY -1
+#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY -1
+
+#endif // OS(DARWIN)
 
 #endif // VMTags_h
diff --git a/JavaScriptCore/wtf/ValueCheck.h b/JavaScriptCore/wtf/ValueCheck.h
index cd321b8..2a86eb0 100644
--- a/JavaScriptCore/wtf/ValueCheck.h
+++ b/JavaScriptCore/wtf/ValueCheck.h
@@ -26,12 +26,7 @@
 #ifndef ValueCheck_h
 #define ValueCheck_h
 
-// For malloc_size and _msize.
-#if OS(DARWIN)
-#include <malloc/malloc.h>
-#elif COMPILER(MSVC)
-#include <malloc.h>
-#endif
+#include <wtf/FastMalloc.h>
 
 namespace WTF {
 
@@ -47,13 +42,7 @@
     {
         if (!p)
             return;
-#if (defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) || !defined(NDEBUG)
-#if OS(DARWIN)
-        ASSERT(malloc_size(p));
-#elif COMPILER(MSVC)
-        ASSERT(_msize(const_cast<P*>(p)));
-#endif
-#endif
+        ASSERT(fastMallocSize(p));
         ValueCheck<P>::checkConsistency(*p);
     }
 };
diff --git a/JavaScriptCore/wtf/Vector.h b/JavaScriptCore/wtf/Vector.h
index 81ea321..6f55e53 100644
--- a/JavaScriptCore/wtf/Vector.h
+++ b/JavaScriptCore/wtf/Vector.h
@@ -286,6 +286,20 @@
             m_buffer = static_cast<T*>(fastMalloc(newCapacity * sizeof(T)));
         }
 
+        bool tryAllocateBuffer(size_t newCapacity)
+        {
+            if (newCapacity > std::numeric_limits<size_t>::max() / sizeof(T))
+                return false;
+
+            T* newBuffer;
+            if (tryFastMalloc(newCapacity * sizeof(T)).getValue(newBuffer)) {
+                m_capacity = newCapacity;
+                m_buffer = newBuffer;
+                return true;
+            }
+            return false;
+        }
+
         void deallocateBuffer(T* bufferToDeallocate)
         {
             if (m_buffer == bufferToDeallocate) {
@@ -361,6 +375,7 @@
         void restoreInlineBufferIfNeeded() { }
 
         using Base::allocateBuffer;
+        using Base::tryAllocateBuffer;
         using Base::deallocateBuffer;
 
         using Base::buffer;
@@ -405,6 +420,15 @@
             }
         }
 
+        bool tryAllocateBuffer(size_t newCapacity)
+        {
+            if (newCapacity > inlineCapacity)
+                return Base::tryAllocateBuffer(newCapacity);
+            m_buffer = inlineBuffer();
+            m_capacity = inlineCapacity;
+            return true;
+        }
+
         void deallocateBuffer(T* bufferToDeallocate)
         {
             if (bufferToDeallocate == inlineBuffer())
@@ -538,6 +562,7 @@
         void grow(size_t size);
         void resize(size_t size);
         void reserveCapacity(size_t newCapacity);
+        bool tryReserveCapacity(size_t newCapacity);
         void reserveInitialCapacity(size_t initialCapacity);
         void shrinkCapacity(size_t newCapacity);
         void shrinkToFit() { shrinkCapacity(size()); }
@@ -548,6 +573,7 @@
         template<typename U> void append(const U&);
         template<typename U> void uncheckedAppend(const U& val);
         template<size_t otherCapacity> void append(const Vector<T, otherCapacity>&);
+        template<typename U> bool tryAppend(const U*, size_t);
 
         template<typename U> void insert(size_t position, const U*, size_t);
         template<typename U> void insert(size_t position, const U&);
@@ -592,6 +618,8 @@
     private:
         void expandCapacity(size_t newMinCapacity);
         const T* expandCapacity(size_t newMinCapacity, const T*);
+        bool tryExpandCapacity(size_t newMinCapacity);
+        const T* tryExpandCapacity(size_t newMinCapacity, const T*);
         template<typename U> U* expandCapacity(size_t newMinCapacity, U*); 
 
         size_t m_size;
@@ -742,6 +770,26 @@
         return begin() + index;
     }
 
+    template<typename T, size_t inlineCapacity>
+    bool Vector<T, inlineCapacity>::tryExpandCapacity(size_t newMinCapacity)
+    {
+        return tryReserveCapacity(max(newMinCapacity, max(static_cast<size_t>(16), capacity() + capacity() / 4 + 1)));
+    }
+    
+    template<typename T, size_t inlineCapacity>
+    const T* Vector<T, inlineCapacity>::tryExpandCapacity(size_t newMinCapacity, const T* ptr)
+    {
+        if (ptr < begin() || ptr >= end()) {
+            if (!tryExpandCapacity(newMinCapacity))
+                return 0;
+            return ptr;
+        }
+        size_t index = ptr - begin();
+        if (!tryExpandCapacity(newMinCapacity))
+            return 0;
+        return begin() + index;
+    }
+
     template<typename T, size_t inlineCapacity> template<typename U>
     inline U* Vector<T, inlineCapacity>::expandCapacity(size_t newMinCapacity, U* ptr)
     {
@@ -797,6 +845,21 @@
     }
     
     template<typename T, size_t inlineCapacity>
+    bool Vector<T, inlineCapacity>::tryReserveCapacity(size_t newCapacity)
+    {
+        if (newCapacity <= capacity())
+            return true;
+        T* oldBuffer = begin();
+        T* oldEnd = end();
+        if (!m_buffer.tryAllocateBuffer(newCapacity))
+            return false;
+        ASSERT(begin());
+        TypeOperations::move(oldBuffer, oldEnd, begin());
+        m_buffer.deallocateBuffer(oldBuffer);
+        return true;
+    }
+    
+    template<typename T, size_t inlineCapacity>
     inline void Vector<T, inlineCapacity>::reserveInitialCapacity(size_t initialCapacity)
     {
         ASSERT(!m_size);
@@ -848,6 +911,25 @@
     }
 
     template<typename T, size_t inlineCapacity> template<typename U>
+    bool Vector<T, inlineCapacity>::tryAppend(const U* data, size_t dataSize)
+    {
+        size_t newSize = m_size + dataSize;
+        if (newSize > capacity()) {
+            data = tryExpandCapacity(newSize, data);
+            if (!data)
+                return false;
+            ASSERT(begin());
+        }
+        if (newSize < m_size)
+            return false;
+        T* dest = end();
+        for (size_t i = 0; i < dataSize; ++i)
+            new (&dest[i]) T(data[i]);
+        m_size = newSize;
+        return true;
+    }
+
+    template<typename T, size_t inlineCapacity> template<typename U>
     ALWAYS_INLINE void Vector<T, inlineCapacity>::append(const U& val)
     {
         const U* ptr = &val;
diff --git a/JavaScriptCore/wtf/VectorTraits.h b/JavaScriptCore/wtf/VectorTraits.h
index bf77878..3f33b29 100644
--- a/JavaScriptCore/wtf/VectorTraits.h
+++ b/JavaScriptCore/wtf/VectorTraits.h
@@ -80,9 +80,6 @@
     template<typename P>
     struct VectorTraits<OwnPtr<P> > : SimpleClassVectorTraits { };
 
-    template<typename P>
-    struct VectorTraits<std::auto_ptr<P> > : SimpleClassVectorTraits { };
-
     template<typename First, typename Second>
     struct VectorTraits<pair<First, Second> >
     {
diff --git a/JavaScriptCore/wtf/WTFThreadData.cpp b/JavaScriptCore/wtf/WTFThreadData.cpp
new file mode 100644
index 0000000..bbc9986
--- /dev/null
+++ b/JavaScriptCore/wtf/WTFThreadData.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008, 2010 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 COMPUTER, 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 "WTFThreadData.h"
+
+namespace WTF {
+
+#if WTFTHREADDATA_MULTITHREADED
+ThreadSpecific<WTFThreadData>* WTFThreadData::staticData;
+#else
+WTFThreadData* WTFThreadData::staticData;
+#endif
+
+WTFThreadData::WTFThreadData()
+    : m_atomicStringTable(0)
+    , m_atomicStringTableDestructor(0)
+#if USE(JSC)
+    , m_defaultIdentifierTable(0)
+    , m_currentIdentifierTable(0)
+#endif
+{
+}
+
+WTFThreadData::~WTFThreadData()
+{
+    if (m_atomicStringTableDestructor)
+        m_atomicStringTableDestructor(m_atomicStringTable);
+}
+
+} // namespace WebCore
diff --git a/JavaScriptCore/wtf/WTFThreadData.h b/JavaScriptCore/wtf/WTFThreadData.h
new file mode 100644
index 0000000..d2c379b
--- /dev/null
+++ b/JavaScriptCore/wtf/WTFThreadData.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2008 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 COMPUTER, 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 WTFThreadData_h
+#define WTFThreadData_h
+
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/text/StringHash.h>
+
+// This was ENABLE(WORKERS) in WebCore, but this is not defined when compiling JSC.
+// However this check was not correct anyway, re this comment:
+//    // FIXME: Workers are not necessarily the only feature that make per-thread global data necessary.
+//    // We need to check for e.g. database objects manipulating strings on secondary threads.
+// Always enabling this is safe, and should be a better option until we can come up
+// with a better define.
+#define WTFTHREADDATA_MULTITHREADED 1
+
+#if WTFTHREADDATA_MULTITHREADED
+#include <wtf/ThreadSpecific.h>
+#include <wtf/Threading.h>
+#endif
+
+// FIXME: This is a temporary layering violation while we move more string code to WTF.
+namespace WebCore {
+class AtomicStringTable;
+class StringImpl;
+}
+using WebCore::StringImpl;
+
+typedef void (*AtomicStringTableDestructor)(WebCore::AtomicStringTable*);
+
+#if USE(JSC)
+// FIXME: This is a temporary layering violation while we move more string code to WTF.
+namespace JSC {
+
+typedef HashMap<const char*, RefPtr<StringImpl>, PtrHash<const char*> > LiteralIdentifierTable;
+
+class IdentifierTable : public FastAllocBase {
+public:
+    ~IdentifierTable();
+
+    std::pair<HashSet<StringImpl*>::iterator, bool> add(StringImpl* value);
+    template<typename U, typename V>
+    std::pair<HashSet<StringImpl*>::iterator, bool> add(U value);
+
+    void remove(StringImpl* r) { m_table.remove(r); }
+
+    LiteralIdentifierTable& literalTable() { return m_literalTable; }
+
+private:
+    HashSet<StringImpl*> m_table;
+    LiteralIdentifierTable m_literalTable;
+};
+
+}
+#endif
+
+namespace WTF {
+
+class WTFThreadData : public Noncopyable {
+public:
+    WTFThreadData();
+    ~WTFThreadData();
+
+    WebCore::AtomicStringTable* atomicStringTable()
+    {
+        return m_atomicStringTable;
+    }
+
+#if USE(JSC)
+    void initializeIdentifierTable(JSC::IdentifierTable* identifierTable)
+    {
+        m_defaultIdentifierTable = identifierTable;
+        m_currentIdentifierTable = identifierTable;
+    }
+
+    JSC::IdentifierTable* currentIdentifierTable()
+    {
+        return m_currentIdentifierTable;
+    }
+
+    JSC::IdentifierTable* setCurrentIdentifierTable(JSC::IdentifierTable* identifierTable)
+    {
+        JSC::IdentifierTable* oldIdentifierTable = m_currentIdentifierTable;
+        m_currentIdentifierTable = identifierTable;
+        return oldIdentifierTable;
+    }
+
+    void resetCurrentIdentifierTable()
+    {
+        m_currentIdentifierTable = m_defaultIdentifierTable;
+    }
+#endif
+
+private:
+    WebCore::AtomicStringTable* m_atomicStringTable;
+    AtomicStringTableDestructor m_atomicStringTableDestructor;
+
+#if USE(JSC)
+    JSC::IdentifierTable* m_defaultIdentifierTable;
+    JSC::IdentifierTable* m_currentIdentifierTable;
+#endif
+
+#if WTFTHREADDATA_MULTITHREADED
+    static JS_EXPORTDATA ThreadSpecific<WTFThreadData>* staticData;
+#else
+    static JS_EXPORTDATA WTFThreadData* staticData;
+#endif
+    friend WTFThreadData& wtfThreadData();
+    friend class WebCore::AtomicStringTable;
+};
+
+inline WTFThreadData& wtfThreadData()
+{
+#if WTFTHREADDATA_MULTITHREADED
+    // WRT WebCore:
+    //    WTFThreadData is used on main thread before it could possibly be used
+    //    on secondary ones, so there is no need for synchronization here.
+    // WRT JavaScriptCore:
+    //    wtfThreadData() is initially called from initializeThreading(), ensuring
+    //    this is initially called in a pthread_once locked context.
+    if (!WTFThreadData::staticData)
+        WTFThreadData::staticData = new ThreadSpecific<WTFThreadData>;
+    return **WTFThreadData::staticData;
+#else
+    if (!WTFThreadData::staticData) {
+        WTFThreadData::staticData = static_cast<WTFThreadData*>(fastMalloc(sizeof(WTFThreadData)));
+        // WTFThreadData constructor indirectly uses staticData, so we need to set up the memory before invoking it.
+        new (WTFThreadData::staticData) WTFThreadData;
+    }
+    return *WTFThreadData::staticData;
+#endif
+}
+
+} // namespace WTF
+
+using WTF::WTFThreadData;
+using WTF::wtfThreadData;
+
+#endif // WTFThreadData_h
diff --git a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp b/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
deleted file mode 100644
index dadd82e..0000000
--- a/JavaScriptCore/wtf/brew/OwnPtrBrew.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2010 Company 100, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "OwnPtrBrew.h"
-
-#include <AEEBitmap.h>
-#include <AEEFile.h>
-#include <AEEStdLib.h>
-
-namespace WTF {
-
-template <> void freeOwnedPtrBrew<IFileMgr>(IFileMgr* ptr)
-{
-    if (ptr)
-        IFILEMGR_Release(ptr);
-}
-
-template <> void freeOwnedPtrBrew<IFile>(IFile* ptr)
-{
-    if (ptr)
-        IFILE_Release(ptr);
-}
-
-template <> void freeOwnedPtrBrew<IBitmap>(IBitmap* ptr)
-{
-    if (ptr)
-        IBitmap_Release(ptr);
-}
-
-template <typename T> void freeOwnedPtrBrew(T* ptr)
-{
-    FREEIF(ptr);
-}
-
-} // namespace WTF
diff --git a/JavaScriptCore/wtf/brew/OwnPtrBrew.h b/JavaScriptCore/wtf/brew/OwnPtrBrew.h
deleted file mode 100644
index 1bb44fc..0000000
--- a/JavaScriptCore/wtf/brew/OwnPtrBrew.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *  Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *  Copyright (C) 2008 Collabora Ltd.
- *  Copyright (C) 2010 Company 100, Inc.
- *
- *  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 OwnPtrBrew_h
-#define OwnPtrBrew_h
-
-#include <algorithm>
-#include <wtf/Assertions.h>
-#include <wtf/Noncopyable.h>
-
-// Forward delcarations at this point avoid the need to include BREW includes
-// in WTF headers.
-typedef struct _IFileMgr IFileMgr;
-typedef struct _IFile IFile;
-typedef struct IBitmap IBitmap;
-
-namespace WTF {
-
-template <typename T> void freeOwnedPtrBrew(T* ptr);
-template<> void freeOwnedPtrBrew<IFileMgr>(IFileMgr*);
-template<> void freeOwnedPtrBrew<IFile>(IFile*);
-template<> void freeOwnedPtrBrew<IBitmap>(IBitmap*);
-
-template <typename T> class OwnPtrBrew : public Noncopyable {
-public:
-    explicit OwnPtrBrew(T* ptr = 0) : m_ptr(ptr) { }
-    ~OwnPtrBrew() { freeOwnedPtrBrew(m_ptr); }
-
-    T* get() const { return m_ptr; }
-    T* release()
-    {
-        T* ptr = m_ptr;
-        m_ptr = 0;
-        return ptr;
-    }
-
-    T*& outPtr()
-    {
-        ASSERT(!m_ptr);
-        return m_ptr;
-    }
-
-    void set(T* ptr)
-    {
-        ASSERT(!ptr || m_ptr != ptr);
-        freeOwnedPtrBrew(m_ptr);
-        m_ptr = ptr;
-    }
-
-    void clear()
-    {
-        freeOwnedPtrBrew(m_ptr);
-        m_ptr = 0;
-    }
-
-    T& operator*() const
-    {
-        ASSERT(m_ptr);
-        return *m_ptr;
-    }
-
-    T* operator->() const
-    {
-        ASSERT(m_ptr);
-        return m_ptr;
-    }
-
-    bool operator!() const { return !m_ptr; }
-
-    // This conversion operator allows implicit conversion to bool but not to other integer types.
-    typedef T* OwnPtrBrew::*UnspecifiedBoolType;
-    operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtrBrew::m_ptr : 0; }
-
-    void swap(OwnPtrBrew& o) { std::swap(m_ptr, o.m_ptr); }
-
-private:
-    T* m_ptr;
-};
-
-template <typename T> inline void swap(OwnPtrBrew<T>& a, OwnPtrBrew<T>& b)
-{
-    a.swap(b);
-}
-
-template <typename T, typename U> inline bool operator==(const OwnPtrBrew<T>& a, U* b)
-{
-    return a.get() == b;
-}
-
-template <typename T, typename U> inline bool operator==(T* a, const OwnPtrBrew<U>& b)
-{
-    return a == b.get();
-}
-
-template <typename T, typename U> inline bool operator!=(const OwnPtrBrew<T>& a, U* b)
-{
-    return a.get() != b;
-}
-
-template <typename T, typename U> inline bool operator!=(T* a, const OwnPtrBrew<U>& b)
-{
-    return a != b.get();
-}
-
-template <typename T> inline typename OwnPtrBrew<T>::PtrType getPtr(const OwnPtrBrew<T>& p)
-{
-    return p.get();
-}
-
-} // namespace WTF
-
-using WTF::OwnPtrBrew;
-
-#endif // OwnPtrBrew_h
diff --git a/JavaScriptCore/wtf/brew/ShellBrew.h b/JavaScriptCore/wtf/brew/ShellBrew.h
new file mode 100644
index 0000000..7416eca
--- /dev/null
+++ b/JavaScriptCore/wtf/brew/ShellBrew.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Company 100 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 ShellBrew_h
+#define ShellBrew_h
+
+#include <AEEAppGen.h>
+#include <AEEStdLib.h>
+
+#include <wtf/Assertions.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WTF {
+
+template <typename T>
+static inline PassOwnPtr<T> createInstance(AEECLSID cls)
+{
+    T* instance = 0;
+
+    IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell;
+    ISHELL_CreateInstance(shell, cls, reinterpret_cast<void**>(&instance));
+    ASSERT(instance);
+
+    return instance;
+}
+
+} // namespace WTF
+
+using WTF::createInstance;
+
+#endif // ShellBrew_h
diff --git a/JavaScriptCore/wtf/brew/SystemMallocBrew.h b/JavaScriptCore/wtf/brew/SystemMallocBrew.h
new file mode 100644
index 0000000..c973b30
--- /dev/null
+++ b/JavaScriptCore/wtf/brew/SystemMallocBrew.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc.
+ *
+ * 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 SystemMallocBrew_h
+#define SystemMallocBrew_h
+
+#include <AEEStdLib.h>
+
+static inline void* mallocBrew(size_t n)
+{
+    // By default, memory allocated using MALLOC() is initialized
+    // to zero. This behavior can be disabled by performing a bitwise
+    // OR of the flag ALLOC_NO_ZMEM with the dwSize parameter.
+    return MALLOC(n | ALLOC_NO_ZMEM);
+}
+
+static inline void* callocBrew(size_t numElements, size_t elementSize)
+{
+    return MALLOC(numElements * elementSize);
+}
+
+static inline void freeBrew(void* p)
+{
+    return FREE(p);
+}
+
+static inline void* reallocBrew(void* p, size_t n)
+{
+    return REALLOC(p, n | ALLOC_NO_ZMEM);
+}
+
+// Use MALLOC macro instead of the standard malloc function.
+// Although RVCT provides malloc, we can't use it in BREW
+// because the loader does not initialize the base address properly.
+#define malloc(n) mallocBrew(n)
+#define calloc(n, s) callocBrew(n, s)
+#define realloc(p, n) reallocBrew(p, n)
+#define free(p) freeBrew(p)
+
+#endif // SystemMallocBrew_h
diff --git a/JavaScriptCore/wtf/efl/MainThreadEfl.cpp b/JavaScriptCore/wtf/efl/MainThreadEfl.cpp
new file mode 100644
index 0000000..fe32d1b
--- /dev/null
+++ b/JavaScriptCore/wtf/efl/MainThreadEfl.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com)
+ * Copyright (C) 2008 Diego Gonzalez
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "MainThread.h"
+
+#include <Ecore.h>
+
+namespace WTF {
+
+void initializeMainThreadPlatform()
+{
+}
+
+static int timeoutFired(void*)
+{
+    dispatchFunctionsFromMainThread();
+    return ECORE_CALLBACK_CANCEL;
+}
+
+void scheduleDispatchFunctionsOnMainThread()
+{
+    ecore_timer_add(0, timeoutFired, 0);
+}
+
+
+}
diff --git a/JavaScriptCore/wtf/gtk/GOwnPtr.cpp b/JavaScriptCore/wtf/gobject/GOwnPtr.cpp
similarity index 100%
rename from JavaScriptCore/wtf/gtk/GOwnPtr.cpp
rename to JavaScriptCore/wtf/gobject/GOwnPtr.cpp
diff --git a/JavaScriptCore/wtf/gtk/GOwnPtr.h b/JavaScriptCore/wtf/gobject/GOwnPtr.h
similarity index 100%
rename from JavaScriptCore/wtf/gtk/GOwnPtr.h
rename to JavaScriptCore/wtf/gobject/GOwnPtr.h
diff --git a/JavaScriptCore/wtf/gtk/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
similarity index 100%
rename from JavaScriptCore/wtf/gtk/GRefPtr.cpp
rename to JavaScriptCore/wtf/gobject/GRefPtr.cpp
diff --git a/JavaScriptCore/wtf/gtk/GRefPtr.h b/JavaScriptCore/wtf/gobject/GRefPtr.h
similarity index 100%
rename from JavaScriptCore/wtf/gtk/GRefPtr.h
rename to JavaScriptCore/wtf/gobject/GRefPtr.h
diff --git a/JavaScriptCore/wtf/mac/MainThreadMac.mm b/JavaScriptCore/wtf/mac/MainThreadMac.mm
index 0ddd5f6..586ef4d 100644
--- a/JavaScriptCore/wtf/mac/MainThreadMac.mm
+++ b/JavaScriptCore/wtf/mac/MainThreadMac.mm
@@ -29,8 +29,10 @@
 #import "config.h"
 #import "MainThread.h"
 
+#import <CoreFoundation/CoreFoundation.h>
 #import <Foundation/NSThread.h>
 #import <wtf/Assertions.h>
+#import <wtf/Threading.h>
 
 @interface WTFMainThreadCaller : NSObject {
 }
@@ -63,9 +65,36 @@
 #endif
 }
 
+static bool isTimerPosted; // This is only accessed on the 'main' thread.
+
+static void timerFired(CFRunLoopTimerRef timer, void*)
+{
+    CFRelease(timer);
+    isTimerPosted = false;
+    WTF::dispatchFunctionsFromMainThread();
+}
+
+static void postTimer()
+{
+    ASSERT(isMainThread());
+
+    if (isTimerPosted)
+        return;
+
+    isTimerPosted = true;
+    CFRunLoopAddTimer(CFRunLoopGetCurrent(), CFRunLoopTimerCreate(0, 0, 0, 0, 0, timerFired, 0), kCFRunLoopCommonModes);
+}
+
+
 void scheduleDispatchFunctionsOnMainThread()
 {
     ASSERT(staticMainThreadCaller);
+
+    if (isMainThread()) {
+        postTimer();
+        return;
+    }
+
 #if USE(WEB_THREAD)
     [staticMainThreadCaller performSelector:@selector(call) onThread:webThread withObject:nil waitUntilDone:NO];
 #else
diff --git a/JavaScriptCore/wtf/qt/StringQt.cpp b/JavaScriptCore/wtf/qt/StringQt.cpp
new file mode 100644
index 0000000..b2c621a
--- /dev/null
+++ b/JavaScriptCore/wtf/qt/StringQt.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ *
+ * 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 COMPUTER, 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 <wtf/text/WTFString.h>
+
+#include <QString>
+
+namespace WebCore {
+
+// String conversions
+String::String(const QString& qstr)
+{
+    if (qstr.isNull())
+        return;
+    m_impl = StringImpl::create(reinterpret_cast<const UChar*>(qstr.constData()), qstr.length());
+}
+
+String::String(const QStringRef& ref)
+{
+    if (!ref.string())
+        return;
+    m_impl = StringImpl::create(reinterpret_cast<const UChar*>(ref.unicode()), ref.length());
+}
+
+String::operator QString() const
+{
+    return QString(reinterpret_cast<const QChar*>(characters()), length());
+}
+
+QDataStream& operator<<(QDataStream& stream, const String& str)
+{
+    // could be faster
+    stream << QString(str);
+    return stream;
+}
+
+QDataStream& operator>>(QDataStream& stream, String& str)
+{
+    // mabe not the fastest way, but really easy
+    QString tmp;
+    stream >> tmp;
+    str = tmp;
+    return stream;
+}
+
+}
+
+// vim: ts=4 sw=4 et
diff --git a/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp b/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp
new file mode 100644
index 0000000..6a28e9e
--- /dev/null
+++ b/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 OS(SYMBIAN)
+
+#include "BlockAllocatorSymbian.h"
+
+
+namespace WTF {
+
+/** Efficiently allocates blocks of size blockSize with blockSize alignment. 
+ * Primarly designed for JSC Collector's needs. 
+ * Not thread-safe.    
+ */
+AlignedBlockAllocator::AlignedBlockAllocator(TUint32 reservationSize, TUint32 blockSize )
+    : m_reservation(reservationSize), 
+      m_blockSize(blockSize)
+{
+
+     // Get system's page size value.
+     SYMBIAN_PAGESIZE(m_pageSize); 
+     
+     // We only accept multiples of system page size for both initial reservation and the alignment/block size
+     m_reservation = SYMBIAN_ROUNDUPTOMULTIPLE(m_reservation, m_pageSize);
+     __ASSERT_ALWAYS(SYMBIAN_ROUNDUPTOMULTIPLE(m_blockSize, m_pageSize), User::Panic(_L("AlignedBlockAllocator1"), KErrArgument));
+     
+     // Calculate max. bit flags we need to carve a reservationSize range into blockSize-sized blocks
+     m_map.numBits = m_reservation / m_blockSize;   
+     const TUint32 bitsPerWord = 8*sizeof(TUint32); 
+     const TUint32 numWords = (m_map.numBits + bitsPerWord -1) / bitsPerWord; 
+   
+     m_map.bits = new TUint32[numWords];
+     __ASSERT_ALWAYS(m_map.bits, User::Panic(_L("AlignedBlockAllocator2"), KErrNoMemory));
+     m_map.clearAll();
+     
+     // Open a Symbian RChunk, and reserve requested virtual address range   
+     // Any thread in this process can operate this rchunk due to EOwnerProcess access rights. 
+     TInt ret = m_chunk.CreateDisconnectedLocal(0 , 0, (TInt)m_reservation , EOwnerProcess);  
+     if (ret != KErrNone) 
+         User::Panic(_L("AlignedBlockAllocator3"), ret);
+       
+     // This is the offset to m_chunk.Base() required to make it m_blockSize-aligned
+     m_offset = SYMBIAN_ROUNDUPTOMULTIPLE(TUint32(m_chunk.Base()), m_blockSize) - TUint(m_chunk.Base()); 
+
+}
+
+void* AlignedBlockAllocator::alloc()
+{
+
+    TInt  freeRam = 0; 
+    void* address = 0;
+    
+    // Look up first free slot in bit map
+    const TInt freeIdx = m_map.findFree();
+        
+    // Pseudo OOM: We ate up the address space we reserved..
+    // ..even though the device may have free RAM left
+    if (freeIdx < 0)
+        return 0;
+        
+    TInt ret = m_chunk.Commit(m_offset + (m_blockSize * freeIdx), m_blockSize);
+    if (ret != KErrNone)  
+        return 0; // True OOM: Device didn't have physical RAM to spare
+        
+    // Updated bit to mark region as in use. 
+    m_map.set(freeIdx); 
+    
+    // Calculate address of committed region (block)
+    address = (void*)( (m_chunk.Base() + m_offset) + (TUint)(m_blockSize * freeIdx) );
+    
+    return address;
+}
+
+void AlignedBlockAllocator::free(void* block)
+{
+    // Calculate index of block to be freed
+    TInt idx = TUint(static_cast<TUint8*>(block) - m_chunk.Base() - m_offset) / m_blockSize;
+    
+    __ASSERT_DEBUG(idx >= 0 && idx < m_map.numBits, User::Panic(_L("AlignedBlockAllocator4"), KErrCorrupt)); // valid index check
+    __ASSERT_DEBUG(m_map.get(idx), User::Panic(_L("AlignedBlockAllocator5"), KErrCorrupt)); // in-use flag check    
+    
+    // Return committed region to system RAM pool (the physical RAM becomes usable by others)
+    TInt ret = m_chunk.Decommit(m_offset + m_blockSize * idx, m_blockSize);
+            
+    // mark this available again
+    m_map.clear(idx); 
+}
+
+void AlignedBlockAllocator::destroy() 
+{
+    // release everything!
+    m_chunk.Decommit(0, m_chunk.MaxSize());
+    m_map.clearAll();
+}
+
+AlignedBlockAllocator::~AlignedBlockAllocator()
+{
+    destroy();
+    m_chunk.Close();
+    delete [] m_map.bits;
+}
+
+} // end of namespace
+
+#endif // SYMBIAN
diff --git a/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h b/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h
new file mode 100644
index 0000000..21422f6
--- /dev/null
+++ b/JavaScriptCore/wtf/symbian/BlockAllocatorSymbian.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 BlockAllocatorSymbian_h
+#define BlockAllocatorSymbian_h
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <hal.h>
+
+
+#define SYMBIAN_PAGESIZE(x) (HAL::Get(HALData::EMemoryPageSize, x));
+#define SYMBIAN_FREERAM(x)  (HAL::Get(HALData::EMemoryRAMFree, x));
+#define SYMBIAN_ROUNDUPTOMULTIPLE(x, multipleof)    ( (x + multipleof - 1) & ~(multipleof - 1) )
+
+// Set sane defaults if -D<flagname=value> wasn't provided via compiler args
+#ifndef JSCCOLLECTOR_VIRTUALMEM_RESERVATION
+#if defined(__WINS__) 
+    // Emulator has limited virtual address space
+    #define JSCCOLLECTOR_VIRTUALMEM_RESERVATION (4*1024*1024)
+#else
+    // HW has plenty of virtual addresses
+    #define JSCCOLLECTOR_VIRTUALMEM_RESERVATION (128*1024*1024)
+#endif
+#endif
+
+namespace WTF {
+
+/** 
+ *  Allocates contiguous region of size blockSize with blockSize-aligned address. 
+ *  blockSize must be a multiple of system page size (typically 4K on Symbian/ARM)
+ *
+ *  @param reservationSize Virtual address range to be reserved upon creation of chunk (bytes).
+ *  @param blockSize Size of a single allocation. Returned address will also be blockSize-aligned.
+ */
+class AlignedBlockAllocator {
+    public:
+        AlignedBlockAllocator(TUint32 reservationSize, TUint32 blockSize);
+        ~AlignedBlockAllocator();
+        void destroy();
+        void* alloc();
+        void free(void* data);
+    
+    private: 
+        RChunk   m_chunk; // Symbian chunk that lets us reserve/commit/decommit
+        TUint    m_offset; // offset of first committed region from base 
+        TInt     m_pageSize; // cached value of system page size, typically 4K on Symbian
+        TUint32  m_reservation;
+        TUint32  m_blockSize;  
+
+        // Tracks comitted/decommitted state of a blockSize region
+        struct {
+            
+            TUint32 *bits; // array of bit flags 
+            TUint32  numBits; // number of regions to keep track of
+            
+            bool get(TUint32 n) const
+            {
+                return !!(bits[n >> 5] & (1 << (n & 0x1F)));
+            }
+            
+            void set(TUint32 n)
+            {
+                bits[n >> 5] |= (1 << (n & 0x1F));
+            }
+            
+            void clear(TUint32 n)
+            {
+                bits[n >> 5] &= ~(1 << (n & 0x1F));
+            }
+            
+            void clearAll()
+            {
+               for (TUint32 i = 0; i < numBits; i++)
+                    clear(i);
+            }
+            
+            TInt findFree() const
+            {
+                for (TUint32 i = 0; i < numBits; i++) {
+                    if (!get(i)) 
+                        return i;
+                }
+                return -1;
+            }
+            
+        } m_map;  
+
+};
+ 
+}
+
+#endif // end of BlockAllocatorSymbian_h
+
+
diff --git a/JavaScriptCore/wtf/text/AtomicString.cpp b/JavaScriptCore/wtf/text/AtomicString.cpp
new file mode 100644
index 0000000..79b9ab5
--- /dev/null
+++ b/JavaScriptCore/wtf/text/AtomicString.cpp
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * 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"
+
+#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
+#define ATOMICSTRING_HIDE_GLOBALS 1
+#endif
+
+#include "AtomicString.h"
+
+#include "StaticConstructors.h"
+#include "StringHash.h"
+#include <wtf/Threading.h>
+#include <wtf/HashSet.h>
+#include <wtf/WTFThreadData.h>
+
+namespace WebCore {
+
+class AtomicStringTable {
+public:
+    static AtomicStringTable* create()
+    {
+        AtomicStringTable* table = new AtomicStringTable;
+
+        WTFThreadData& data = wtfThreadData();
+        data.m_atomicStringTable = table;
+        data.m_atomicStringTableDestructor = AtomicStringTable::destroy;
+
+        return table;
+    }
+
+    HashSet<StringImpl*>& table()
+    {
+        return m_table;
+    }
+
+private:
+    static void destroy(AtomicStringTable* table)
+    {
+        delete table;
+    }
+
+    HashSet<StringImpl*> m_table;
+};
+
+static inline HashSet<StringImpl*>& stringTable()
+{
+    // Once possible we should make this non-lazy (constructed in WTFThreadData's constructor).
+    AtomicStringTable* table = wtfThreadData().atomicStringTable();
+    if (UNLIKELY(!table))
+        table = AtomicStringTable::create();
+    return table->table();
+}
+
+struct CStringTranslator {
+    static unsigned hash(const char* c)
+    {
+        return StringImpl::computeHash(c);
+    }
+
+    static bool equal(StringImpl* r, const char* s)
+    {
+        int length = r->length();
+        const UChar* d = r->characters();
+        for (int i = 0; i != length; ++i) {
+            unsigned char c = s[i];
+            if (d[i] != c)
+                return false;
+        }
+        return s[length] == 0;
+    }
+
+    static void translate(StringImpl*& location, const char* const& c, unsigned hash)
+    {
+        location = StringImpl::create(c).releaseRef(); 
+        location->setHash(hash);
+        location->setInTable();
+    }
+};
+
+bool operator==(const AtomicString& a, const char* b)
+{ 
+    StringImpl* impl = a.impl();
+    if ((!impl || !impl->characters()) && !b)
+        return true;
+    if ((!impl || !impl->characters()) || !b)
+        return false;
+    return CStringTranslator::equal(impl, b); 
+}
+
+PassRefPtr<StringImpl> AtomicString::add(const char* c)
+{
+    if (!c)
+        return 0;
+    if (!*c)
+        return StringImpl::empty();    
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<const char*, CStringTranslator>(c);
+    if (!addResult.second)
+        return *addResult.first;
+    return adoptRef(*addResult.first);
+}
+
+struct UCharBuffer {
+    const UChar* s;
+    unsigned length;
+};
+
+static inline bool equal(StringImpl* string, const UChar* characters, unsigned length)
+{
+    if (string->length() != length)
+        return false;
+
+    // FIXME: perhaps we should have a more abstract macro that indicates when
+    // going 4 bytes at a time is unsafe
+#if CPU(ARM) || CPU(SH4)
+    const UChar* stringCharacters = string->characters();
+    for (unsigned i = 0; i != length; ++i) {
+        if (*stringCharacters++ != *characters++)
+            return false;
+    }
+    return true;
+#else
+    /* Do it 4-bytes-at-a-time on architectures where it's safe */
+
+    const uint32_t* stringCharacters = reinterpret_cast<const uint32_t*>(string->characters());
+    const uint32_t* bufferCharacters = reinterpret_cast<const uint32_t*>(characters);
+
+    unsigned halfLength = length >> 1;
+    for (unsigned i = 0; i != halfLength; ++i) {
+        if (*stringCharacters++ != *bufferCharacters++)
+            return false;
+    }
+
+    if (length & 1 &&  *reinterpret_cast<const uint16_t*>(stringCharacters) != *reinterpret_cast<const uint16_t*>(bufferCharacters))
+        return false;
+
+    return true;
+#endif
+}
+
+struct UCharBufferTranslator {
+    static unsigned hash(const UCharBuffer& buf)
+    {
+        return StringImpl::computeHash(buf.s, buf.length);
+    }
+
+    static bool equal(StringImpl* const& str, const UCharBuffer& buf)
+    {
+        return WebCore::equal(str, buf.s, buf.length);
+    }
+
+    static void translate(StringImpl*& location, const UCharBuffer& buf, unsigned hash)
+    {
+        location = StringImpl::create(buf.s, buf.length).releaseRef(); 
+        location->setHash(hash);
+        location->setInTable();
+    }
+};
+
+struct HashAndCharacters {
+    unsigned hash;
+    const UChar* characters;
+    unsigned length;
+};
+
+struct HashAndCharactersTranslator {
+    static unsigned hash(const HashAndCharacters& buffer)
+    {
+        ASSERT(buffer.hash == StringImpl::computeHash(buffer.characters, buffer.length));
+        return buffer.hash;
+    }
+
+    static bool equal(StringImpl* const& string, const HashAndCharacters& buffer)
+    {
+        return WebCore::equal(string, buffer.characters, buffer.length);
+    }
+
+    static void translate(StringImpl*& location, const HashAndCharacters& buffer, unsigned hash)
+    {
+        location = StringImpl::create(buffer.characters, buffer.length).releaseRef();
+        location->setHash(hash);
+        location->setInTable();
+    }
+};
+
+PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length)
+{
+    if (!s)
+        return 0;
+
+    if (length == 0)
+        return StringImpl::empty();
+    
+    UCharBuffer buf = { s, length }; 
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<UCharBuffer, UCharBufferTranslator>(buf);
+
+    // If the string is newly-translated, then we need to adopt it.
+    // The boolean in the pair tells us if that is so.
+    return addResult.second ? adoptRef(*addResult.first) : *addResult.first;
+}
+
+PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length, unsigned existingHash)
+{
+    ASSERT(s);
+    ASSERT(existingHash);
+
+    if (length == 0)
+        return StringImpl::empty();
+    
+    HashAndCharacters buffer = { existingHash, s, length }; 
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
+    if (!addResult.second)
+        return *addResult.first;
+    return adoptRef(*addResult.first);
+}
+
+PassRefPtr<StringImpl> AtomicString::add(const UChar* s)
+{
+    if (!s)
+        return 0;
+
+    int length = 0;
+    while (s[length] != UChar(0))
+        length++;
+
+    if (length == 0)
+        return StringImpl::empty();
+
+    UCharBuffer buf = {s, length}; 
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<UCharBuffer, UCharBufferTranslator>(buf);
+
+    // If the string is newly-translated, then we need to adopt it.
+    // The boolean in the pair tells us if that is so.
+    return addResult.second ? adoptRef(*addResult.first) : *addResult.first;
+}
+
+PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
+{
+    if (!r || r->inTable())
+        return r;
+
+    if (r->length() == 0)
+        return StringImpl::empty();
+    
+    StringImpl* result = *stringTable().add(r).first;
+    if (result == r)
+        r->setInTable();
+    return result;
+}
+
+AtomicStringImpl* AtomicString::find(const UChar* s, unsigned length, unsigned existingHash)
+{
+    ASSERT(s);
+    ASSERT(existingHash);
+
+    if (length == 0)
+        return static_cast<AtomicStringImpl*>(StringImpl::empty());
+
+    HashAndCharacters buffer = { existingHash, s, length }; 
+    HashSet<StringImpl*>::iterator iterator = stringTable().find<HashAndCharacters, HashAndCharactersTranslator>(buffer);
+    if (iterator == stringTable().end())
+        return 0;
+    return static_cast<AtomicStringImpl*>(*iterator);
+}
+
+void AtomicString::remove(StringImpl* r)
+{
+    stringTable().remove(r);
+}
+    
+AtomicString AtomicString::lower() const
+{
+    // Note: This is a hot function in the Dromaeo benchmark.
+    StringImpl* impl = this->impl();
+    RefPtr<StringImpl> newImpl = impl->lower();
+    if (LIKELY(newImpl == impl))
+        return *this;
+    return AtomicString(newImpl);
+}
+
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom)
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom, "")
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, textAtom, "#text")
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, commentAtom, "#comment")
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom, "*")
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom, "xml")
+JS_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom, "xmlns")
+
+void AtomicString::init()
+{
+    static bool initialized;
+    if (!initialized) {
+        // Initialization is not thread safe, so this function must be called from the main thread first.
+        ASSERT(isMainThread());
+
+        // Use placement new to initialize the globals.
+        new ((void*)&nullAtom) AtomicString;
+        new ((void*)&emptyAtom) AtomicString("");
+        new ((void*)&textAtom) AtomicString("#text");
+        new ((void*)&commentAtom) AtomicString("#comment");
+        new ((void*)&starAtom) AtomicString("*");
+        new ((void*)&xmlAtom) AtomicString("xml");
+        new ((void*)&xmlnsAtom) AtomicString("xmlns");
+
+        initialized = true;
+    }
+}
+
+}
diff --git a/JavaScriptCore/wtf/text/AtomicString.h b/JavaScriptCore/wtf/text/AtomicString.h
new file mode 100644
index 0000000..9db70f4
--- /dev/null
+++ b/JavaScriptCore/wtf/text/AtomicString.h
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ *
+ * 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 AtomicString_h
+#define AtomicString_h
+
+#include "AtomicStringImpl.h"
+#include "WTFString.h"
+
+// Define 'NO_IMPLICIT_ATOMICSTRING' before including this header,
+// to disallow (expensive) implicit String-->AtomicString conversions.
+#ifdef NO_IMPLICIT_ATOMICSTRING
+#define ATOMICSTRING_CONVERSION explicit
+#else
+#define ATOMICSTRING_CONVERSION
+#endif
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace WebCore {
+
+struct AtomicStringHash;
+
+class AtomicString : public FastAllocBase {
+public:
+    static void init();
+
+    AtomicString() { }
+    AtomicString(const char* s) : m_string(add(s)) { }
+    AtomicString(const UChar* s, unsigned length) : m_string(add(s, length)) { }
+    AtomicString(const UChar* s, unsigned length, unsigned existingHash) : m_string(add(s, length, existingHash)) { }
+    AtomicString(const UChar* s) : m_string(add(s)) { }
+    ATOMICSTRING_CONVERSION AtomicString(StringImpl* imp) : m_string(add(imp)) { }
+    AtomicString(AtomicStringImpl* imp) : m_string(imp) { }
+    ATOMICSTRING_CONVERSION AtomicString(const String& s) : m_string(add(s.impl())) { }
+
+    // Hash table deleted values, which are only constructed and never copied or destroyed.
+    AtomicString(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { }
+    bool isHashTableDeletedValue() const { return m_string.isHashTableDeletedValue(); }
+
+    static AtomicStringImpl* find(const UChar* s, unsigned length, unsigned existingHash);
+
+    operator const String&() const { return m_string; }
+    const String& string() const { return m_string; };
+
+    AtomicStringImpl* impl() const { return static_cast<AtomicStringImpl *>(m_string.impl()); }
+    
+    const UChar* characters() const { return m_string.characters(); }
+    unsigned length() const { return m_string.length(); }
+    
+    UChar operator[](unsigned int i) const { return m_string[i]; }
+    
+    bool contains(UChar c) const { return m_string.contains(c); }
+    bool contains(const char* s, bool caseSensitive = true) const
+        { return m_string.contains(s, caseSensitive); }
+    bool contains(const String& s, bool caseSensitive = true) const
+        { return m_string.contains(s, caseSensitive); }
+
+    int find(UChar c, int start = 0) const { return m_string.find(c, start); }
+    int find(const char* s, int start = 0, bool caseSentitive = true) const
+        { return m_string.find(s, start, caseSentitive); }
+    int find(const String& s, int start = 0, bool caseSentitive = true) const
+        { return m_string.find(s, start, caseSentitive); }
+    
+    bool startsWith(const String& s, bool caseSensitive = true) const
+        { return m_string.startsWith(s, caseSensitive); }
+    bool endsWith(const String& s, bool caseSensitive = true) const
+        { return m_string.endsWith(s, caseSensitive); }
+    
+    AtomicString lower() const;
+    AtomicString upper() const { return AtomicString(impl()->upper()); }
+    
+    int toInt(bool* ok = 0) const { return m_string.toInt(ok); }
+    double toDouble(bool* ok = 0) const { return m_string.toDouble(ok); }
+    float toFloat(bool* ok = 0) const { return m_string.toFloat(ok); }
+    bool percentage(int& p) const { return m_string.percentage(p); }
+
+    bool isNull() const { return m_string.isNull(); }
+    bool isEmpty() const { return m_string.isEmpty(); }
+
+    static void remove(StringImpl*);
+    
+#if PLATFORM(CF)
+    AtomicString(CFStringRef s) :  m_string(add(String(s).impl())) { }
+    CFStringRef createCFString() const { return m_string.createCFString(); }
+#endif    
+#ifdef __OBJC__
+    AtomicString(NSString* s) : m_string(add(String(s).impl())) { }
+    operator NSString*() const { return m_string; }
+#endif
+#if PLATFORM(QT)
+    AtomicString(const QString& s) : m_string(add(String(s).impl())) { }
+    operator QString() const { return m_string; }
+#endif
+
+private:
+    String m_string;
+    
+    static PassRefPtr<StringImpl> add(const char*);
+    static PassRefPtr<StringImpl> add(const UChar*, unsigned length);
+    static PassRefPtr<StringImpl> add(const UChar*, unsigned length, unsigned existingHash);
+    static PassRefPtr<StringImpl> add(const UChar*);
+    static PassRefPtr<StringImpl> add(StringImpl*);
+};
+
+inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }
+bool operator==(const AtomicString& a, const char* b);
+inline bool operator==(const AtomicString& a, const String& b) { return equal(a.impl(), b.impl()); }
+inline bool operator==(const char* a, const AtomicString& b) { return b == a; }
+inline bool operator==(const String& a, const AtomicString& b) { return equal(a.impl(), b.impl()); }
+
+inline bool operator!=(const AtomicString& a, const AtomicString& b) { return a.impl() != b.impl(); }
+inline bool operator!=(const AtomicString& a, const char *b) { return !(a == b); }
+inline bool operator!=(const AtomicString& a, const String& b) { return !equal(a.impl(), b.impl()); }
+inline bool operator!=(const char* a, const AtomicString& b) { return !(b == a); }
+inline bool operator!=(const String& a, const AtomicString& b) { return !equal(a.impl(), b.impl()); }
+
+inline bool equalIgnoringCase(const AtomicString& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
+inline bool equalIgnoringCase(const AtomicString& a, const char* b) { return equalIgnoringCase(a.impl(), b); }
+inline bool equalIgnoringCase(const AtomicString& a, const String& b) { return equalIgnoringCase(a.impl(), b.impl()); }
+inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equalIgnoringCase(a, b.impl()); }
+inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
+
+// Define external global variables for the commonly used atomic strings.
+// These are only usable from the main thread.
+#ifndef ATOMICSTRING_HIDE_GLOBALS
+    extern const JS_EXPORTDATA AtomicString nullAtom;
+    extern const JS_EXPORTDATA AtomicString emptyAtom;
+    extern const JS_EXPORTDATA AtomicString textAtom;
+    extern const JS_EXPORTDATA AtomicString commentAtom;
+    extern const JS_EXPORTDATA AtomicString starAtom;
+    extern const JS_EXPORTDATA AtomicString xmlAtom;
+    extern const JS_EXPORTDATA AtomicString xmlnsAtom;
+#endif
+
+} // namespace WebCore
+
+
+namespace WTF {
+
+    // AtomicStringHash is the default hash for AtomicString
+    template<typename T> struct DefaultHash;
+    template<> struct DefaultHash<WebCore::AtomicString> {
+        typedef WebCore::AtomicStringHash Hash;
+    };
+
+} // namespace WTF
+
+#endif // AtomicString_h
diff --git a/JavaScriptCore/wtf/text/AtomicStringImpl.h b/JavaScriptCore/wtf/text/AtomicStringImpl.h
new file mode 100644
index 0000000..d21a00a
--- /dev/null
+++ b/JavaScriptCore/wtf/text/AtomicStringImpl.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * 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 AtomicStringImpl_h
+#define AtomicStringImpl_h
+
+#include "StringImpl.h"
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace WebCore {
+
+class AtomicStringImpl : public StringImpl
+{
+};
+
+}
+
+#endif
diff --git a/JavaScriptCore/wtf/text/CString.cpp b/JavaScriptCore/wtf/text/CString.cpp
new file mode 100644
index 0000000..d93a5a3
--- /dev/null
+++ b/JavaScriptCore/wtf/text/CString.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2003, 2006, 2008, 2009 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 COMPUTER, 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 "CString.h"
+
+using std::min;
+
+namespace WTF {
+
+CString::CString(const char* str)
+{
+    init(str, strlen(str));
+}
+
+CString::CString(const char* str, unsigned length)
+{
+    init(str, length);
+}
+
+void CString::init(const char* str, unsigned length)
+{
+    if (!str)
+        return;
+    
+    m_buffer = CStringBuffer::create(length + 1);
+    memcpy(m_buffer->mutableData(), str, length); 
+    m_buffer->mutableData()[length] = '\0';
+}
+
+const char* CString::data() const
+{
+    return m_buffer ? m_buffer->data() : 0;
+}
+
+char* CString::mutableData()
+{
+    copyBufferIfNeeded();
+    if (!m_buffer)
+        return 0;
+    return m_buffer->mutableData();
+}
+    
+unsigned CString::length() const
+{
+    return m_buffer ? m_buffer->length() - 1 : 0;
+}
+    
+CString CString::newUninitialized(size_t length, char*& characterBuffer)
+{
+    CString result;
+    result.m_buffer = CStringBuffer::create(length + 1);
+    char* bytes = result.m_buffer->mutableData();
+    bytes[length] = '\0';
+    characterBuffer = bytes;
+    return result;
+}
+
+void CString::copyBufferIfNeeded()
+{
+    if (!m_buffer || m_buffer->hasOneRef())
+        return;
+        
+    int len = m_buffer->length();
+    RefPtr<CStringBuffer> m_temp = m_buffer;
+    m_buffer = CStringBuffer::create(len);
+    memcpy(m_buffer->mutableData(), m_temp->data(), len);
+}
+
+bool operator==(const CString& a, const CString& b)
+{
+    if (a.isNull() != b.isNull())
+        return false;
+    if (a.length() != b.length())
+        return false;
+    return !strncmp(a.data(), b.data(), min(a.length(), b.length()));
+}
+
+} // namespace WTF
diff --git a/JavaScriptCore/wtf/text/CString.h b/JavaScriptCore/wtf/text/CString.h
new file mode 100644
index 0000000..47f7675
--- /dev/null
+++ b/JavaScriptCore/wtf/text/CString.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2003, 2006, 2008, 2009, 2010 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 COMPUTER, 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 CString_h
+#define CString_h
+
+#include "PassRefPtr.h"
+#include "RefCounted.h"
+#include "Vector.h"
+
+namespace WTF {
+
+class CStringBuffer : public RefCounted<CStringBuffer> {
+public:
+    const char* data() { return m_vector.data(); }
+    size_t length() { return m_vector.size(); }
+
+private:
+    friend class CString;
+
+    static PassRefPtr<CStringBuffer> create(unsigned length) { return adoptRef(new CStringBuffer(length)); }
+    CStringBuffer(unsigned length) : m_vector(length) { }
+    char* mutableData() { return m_vector.data(); }
+
+    Vector<char> m_vector;
+};
+
+// A container for a null-terminated char array supporting copy-on-write
+// assignment.  The contained char array may be null.
+class CString {
+public:
+    CString() { }
+    CString(const char*);
+    CString(const char*, unsigned length);
+    CString(CStringBuffer* buffer) : m_buffer(buffer) { }
+    static CString newUninitialized(size_t length, char*& characterBuffer);
+
+    const char* data() const;
+    char* mutableData();
+    unsigned length() const;
+
+    bool isNull() const { return !m_buffer; }
+
+    CStringBuffer* buffer() const { return m_buffer.get(); }
+
+private:
+    void copyBufferIfNeeded();
+    void init(const char*, unsigned length);
+    RefPtr<CStringBuffer> m_buffer;
+};
+
+bool operator==(const CString& a, const CString& b);
+inline bool operator!=(const CString& a, const CString& b) { return !(a == b); }
+
+} // namespace WTF
+
+using WTF::CString;
+
+#endif // CString_h
diff --git a/JavaScriptCore/wtf/text/StringBuffer.h b/JavaScriptCore/wtf/text/StringBuffer.h
new file mode 100644
index 0000000..353a44a
--- /dev/null
+++ b/JavaScriptCore/wtf/text/StringBuffer.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2008 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. 
+ * 3.  Neither the name of Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 StringBuffer_h
+#define StringBuffer_h
+
+#include <wtf/Assertions.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/unicode/Unicode.h>
+
+namespace WebCore {
+
+class StringBuffer : public Noncopyable {
+public:
+    explicit StringBuffer(unsigned length)
+        : m_length(length)
+        , m_data(static_cast<UChar*>(fastMalloc(length * sizeof(UChar))))
+    {
+    }
+    ~StringBuffer()
+    {
+        fastFree(m_data);
+    }
+
+    void shrink(unsigned newLength)
+    {
+        ASSERT(newLength <= m_length);
+        m_length = newLength;
+    }
+
+    void resize(unsigned newLength)
+    {
+        if (newLength > m_length)
+            m_data = static_cast<UChar*>(fastRealloc(m_data, newLength * sizeof(UChar)));
+        m_length = newLength;
+    }
+
+    unsigned length() const { return m_length; }
+    UChar* characters() { return m_data; }
+
+    UChar& operator[](unsigned i) { ASSERT(i < m_length); return m_data[i]; }
+
+    UChar* release() { UChar* data = m_data; m_data = 0; return data; }
+
+private:
+    unsigned m_length;
+    UChar* m_data;
+};
+
+}
+
+#endif
diff --git a/JavaScriptCore/wtf/text/StringHash.h b/JavaScriptCore/wtf/text/StringHash.h
new file mode 100644
index 0000000..b820004
--- /dev/null
+++ b/JavaScriptCore/wtf/text/StringHash.h
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ *
+ * 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 StringHash_h
+#define StringHash_h
+
+#include "AtomicString.h"
+#include "WTFString.h"
+#include <wtf/HashTraits.h>
+#include <wtf/StringHashFunctions.h>
+#include <wtf/unicode/Unicode.h>
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace WebCore {
+
+    // The hash() functions on StringHash and CaseFoldingHash do not support
+    // null strings. get(), contains(), and add() on HashMap<String,..., StringHash>
+    // cause a null-pointer dereference when passed null strings.
+
+    // FIXME: We should really figure out a way to put the computeHash function that's
+    // currently a member function of StringImpl into this file so we can be a little
+    // closer to having all the nearly-identical hash functions in one place.
+
+    struct StringHash {
+        static unsigned hash(StringImpl* key) { return key->hash(); }
+        static bool equal(const StringImpl* a, const StringImpl* b)
+        {
+            if (a == b)
+                return true;
+            if (!a || !b)
+                return false;
+
+            unsigned aLength = a->length();
+            unsigned bLength = b->length();
+            if (aLength != bLength)
+                return false;
+
+            // FIXME: perhaps we should have a more abstract macro that indicates when
+            // going 4 bytes at a time is unsafe
+#if CPU(ARM) || CPU(SH4)
+            const UChar* aChars = a->characters();
+            const UChar* bChars = b->characters();
+            for (unsigned i = 0; i != aLength; ++i) {
+                if (*aChars++ != *bChars++)
+                    return false;
+            }
+            return true;
+#else
+            /* Do it 4-bytes-at-a-time on architectures where it's safe */
+            const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters());
+            const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters());
+
+            unsigned halfLength = aLength >> 1;
+            for (unsigned i = 0; i != halfLength; ++i)
+                if (*aChars++ != *bChars++)
+                    return false;
+
+            if (aLength & 1 && *reinterpret_cast<const uint16_t*>(aChars) != *reinterpret_cast<const uint16_t*>(bChars))
+                return false;
+
+            return true;
+#endif
+        }
+
+        static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); }
+        static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
+        {
+            return equal(a.get(), b.get());
+        }
+
+        static unsigned hash(const String& key) { return key.impl()->hash(); }
+        static bool equal(const String& a, const String& b)
+        {
+            return equal(a.impl(), b.impl());
+        }
+
+        static const bool safeToCompareToEmptyOrDeleted = false;
+    };
+
+    class CaseFoldingHash {
+    public:
+        // Paul Hsieh's SuperFastHash
+        // http://www.azillionmonkeys.com/qed/hash.html
+        static unsigned hash(const UChar* data, unsigned length)
+        {
+            unsigned l = length;
+            const UChar* s = data;
+            uint32_t hash = WTF::stringHashingStartValue;
+            uint32_t tmp;
+            
+            int rem = l & 1;
+            l >>= 1;
+            
+            // Main loop.
+            for (; l > 0; l--) {
+                hash += WTF::Unicode::foldCase(s[0]);
+                tmp = (WTF::Unicode::foldCase(s[1]) << 11) ^ hash;
+                hash = (hash << 16) ^ tmp;
+                s += 2;
+                hash += hash >> 11;
+            }
+            
+            // Handle end case.
+            if (rem) {
+                hash += WTF::Unicode::foldCase(s[0]);
+                hash ^= hash << 11;
+                hash += hash >> 17;
+            }
+            
+            // Force "avalanching" of final 127 bits.
+            hash ^= hash << 3;
+            hash += hash >> 5;
+            hash ^= hash << 2;
+            hash += hash >> 15;
+            hash ^= hash << 10;
+            
+            // This avoids ever returning a hash code of 0, since that is used to
+            // signal "hash not computed yet", using a value that is likely to be
+            // effectively the same as 0 when the low bits are masked.
+            hash |= !hash << 31;
+            
+            return hash;
+        }
+
+        static unsigned hash(StringImpl* str)
+        {
+            return hash(str->characters(), str->length());
+        }
+        
+        static unsigned hash(const char* str, unsigned length)
+        {
+            // This hash is designed to work on 16-bit chunks at a time. But since the normal case
+            // (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
+            // were 16-bit chunks, which will give matching results.
+
+            unsigned l = length;
+            const char* s = str;
+            uint32_t hash = WTF::stringHashingStartValue;
+            uint32_t tmp;
+            
+            int rem = l & 1;
+            l >>= 1;
+            
+            // Main loop
+            for (; l > 0; l--) {
+                hash += WTF::Unicode::foldCase(s[0]);
+                tmp = (WTF::Unicode::foldCase(s[1]) << 11) ^ hash;
+                hash = (hash << 16) ^ tmp;
+                s += 2;
+                hash += hash >> 11;
+            }
+            
+            // Handle end case
+            if (rem) {
+                hash += WTF::Unicode::foldCase(s[0]);
+                hash ^= hash << 11;
+                hash += hash >> 17;
+            }
+            
+            // Force "avalanching" of final 127 bits
+            hash ^= hash << 3;
+            hash += hash >> 5;
+            hash ^= hash << 2;
+            hash += hash >> 15;
+            hash ^= hash << 10;
+            
+            // this avoids ever returning a hash code of 0, since that is used to
+            // signal "hash not computed yet", using a value that is likely to be
+            // effectively the same as 0 when the low bits are masked
+            hash |= !hash << 31;
+            
+            return hash;
+        }
+        
+        static bool equal(const StringImpl* a, const StringImpl* b)
+        {
+            if (a == b)
+                return true;
+            if (!a || !b)
+                return false;
+            unsigned length = a->length();
+            if (length != b->length())
+                return false;
+            return WTF::Unicode::umemcasecmp(a->characters(), b->characters(), length) == 0;
+        }
+
+        static unsigned hash(const RefPtr<StringImpl>& key) 
+        {
+            return hash(key.get());
+        }
+
+        static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
+        {
+            return equal(a.get(), b.get());
+        }
+
+        static unsigned hash(const String& key)
+        {
+            return hash(key.impl());
+        }
+        static unsigned hash(const AtomicString& key)
+        {
+            return hash(key.impl());
+        }
+        static bool equal(const String& a, const String& b)
+        {
+            return equal(a.impl(), b.impl());
+        }
+        static bool equal(const AtomicString& a, const AtomicString& b)
+        {
+            return (a == b) || equal(a.impl(), b.impl());
+        }
+
+        static const bool safeToCompareToEmptyOrDeleted = false;
+    };
+
+    // This hash can be used in cases where the key is a hash of a string, but we don't
+    // want to store the string. It's not really specific to string hashing, but all our
+    // current uses of it are for strings.
+    struct AlreadyHashed : IntHash<unsigned> {
+        static unsigned hash(unsigned key) { return key; }
+
+        // To use a hash value as a key for a hash table, we need to eliminate the
+        // "deleted" value, which is negative one. That could be done by changing
+        // the string hash function to never generate negative one, but this works
+        // and is still relatively efficient.
+        static unsigned avoidDeletedValue(unsigned hash)
+        {
+            ASSERT(hash);
+            unsigned newHash = hash | (!(hash + 1) << 31);
+            ASSERT(newHash);
+            ASSERT(newHash != 0xFFFFFFFF);
+            return newHash;
+        }
+    };
+
+}
+
+namespace WTF {
+
+    template<> struct HashTraits<WebCore::String> : GenericHashTraits<WebCore::String> {
+        static const bool emptyValueIsZero = true;
+        static void constructDeletedValue(WebCore::String& slot) { new (&slot) WebCore::String(HashTableDeletedValue); }
+        static bool isDeletedValue(const WebCore::String& slot) { return slot.isHashTableDeletedValue(); }
+    };
+
+}
+
+#endif
diff --git a/JavaScriptCore/wtf/text/StringImpl.cpp b/JavaScriptCore/wtf/text/StringImpl.cpp
new file mode 100644
index 0000000..287e529
--- /dev/null
+++ b/JavaScriptCore/wtf/text/StringImpl.cpp
@@ -0,0 +1,953 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ *           (C) 2001 Dirk Mueller ( mueller@kde.org )
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
+ *
+ * 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 "StringImpl.h"
+
+#include "AtomicString.h"
+#include "StringBuffer.h"
+#include "StringHash.h"
+#include <wtf/StdLibExtras.h>
+#include <wtf/WTFThreadData.h>
+
+using namespace WTF;
+using namespace Unicode;
+
+namespace WebCore {
+
+static const unsigned minLengthToShare = 20;
+
+StringImpl::~StringImpl()
+{
+    ASSERT(!isStatic());
+
+    if (inTable())
+        AtomicString::remove(this);
+#if USE(JSC)
+    if (isIdentifier())
+        wtfThreadData().currentIdentifierTable()->remove(this);
+#endif
+
+    BufferOwnership ownership = bufferOwnership();
+    if (ownership != BufferInternal) {
+        if (ownership == BufferOwned) {
+            ASSERT(!m_sharedBuffer);
+            ASSERT(m_data);
+            fastFree(const_cast<UChar*>(m_data));
+        } else if (ownership == BufferSubstring) {
+            ASSERT(m_substringBuffer);
+            m_substringBuffer->deref();
+        } else {
+            ASSERT(ownership == BufferShared);
+            ASSERT(m_sharedBuffer);
+            m_sharedBuffer->deref();
+        }
+    }
+}
+
+StringImpl* StringImpl::empty()
+{
+    // FIXME: This works around a bug in our port of PCRE, that a regular expression
+    // run on the empty string may still perform a read from the first element, and
+    // as such we need this to be a valid pointer. No code should ever be reading
+    // from a zero length string, so this should be able to be a non-null pointer
+    // into the zero-page.
+    // Replace this with 'reinterpret_cast<UChar*>(static_cast<intptr_t>(1))' once
+    // PCRE goes away.
+    static UChar emptyUCharData = 0;
+    DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyUCharData, 0, ConstructStaticString));
+    return &emptyString;
+}
+
+PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, UChar*& data)
+{
+    if (!length) {
+        data = 0;
+        return empty();
+    }
+
+    // Allocate a single buffer large enough to contain the StringImpl
+    // struct as well as the data which it contains. This removes one 
+    // heap allocation from this call.
+    if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar)))
+        CRASH();
+    size_t size = sizeof(StringImpl) + length * sizeof(UChar);
+    StringImpl* string = static_cast<StringImpl*>(fastMalloc(size));
+
+    data = reinterpret_cast<UChar*>(string + 1);
+    return adoptRef(new (string) StringImpl(length));
+}
+
+PassRefPtr<StringImpl> StringImpl::create(const UChar* characters, unsigned length)
+{
+    if (!characters || !length)
+        return empty();
+
+    UChar* data;
+    PassRefPtr<StringImpl> string = createUninitialized(length, data);
+    memcpy(data, characters, length * sizeof(UChar));
+    return string;
+}
+
+PassRefPtr<StringImpl> StringImpl::create(const char* characters, unsigned length)
+{
+    if (!characters || !length)
+        return empty();
+
+    UChar* data;
+    PassRefPtr<StringImpl> string = createUninitialized(length, data);
+    for (unsigned i = 0; i != length; ++i) {
+        unsigned char c = characters[i];
+        data[i] = c;
+    }
+    return string;
+}
+
+PassRefPtr<StringImpl> StringImpl::create(const char* string)
+{
+    if (!string)
+        return empty();
+    return create(string, strlen(string));
+}
+
+PassRefPtr<StringImpl> StringImpl::create(const UChar* characters, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
+{
+    ASSERT(characters);
+    ASSERT(minLengthToShare && length >= minLengthToShare);
+    return adoptRef(new StringImpl(characters, length, sharedBuffer));
+}
+
+SharedUChar* StringImpl::sharedBuffer()
+{
+    if (m_length < minLengthToShare)
+        return 0;
+    // All static strings are smaller that the minimim length to share.
+    ASSERT(!isStatic());
+
+    BufferOwnership ownership = bufferOwnership();
+
+    if (ownership == BufferInternal)
+        return 0;
+    if (ownership == BufferSubstring)
+        return m_substringBuffer->sharedBuffer();
+    if (ownership == BufferOwned) {
+        ASSERT(!m_sharedBuffer);
+        m_sharedBuffer = SharedUChar::create(new SharableUChar(m_data)).releaseRef();
+        m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared;
+    }
+
+    ASSERT(bufferOwnership() == BufferShared);
+    ASSERT(m_sharedBuffer);
+    return m_sharedBuffer;
+}
+
+bool StringImpl::containsOnlyWhitespace()
+{
+    // FIXME: The definition of whitespace here includes a number of characters
+    // that are not whitespace from the point of view of RenderText; I wonder if
+    // that's a problem in practice.
+    for (unsigned i = 0; i < m_length; i++)
+        if (!isASCIISpace(m_data[i]))
+            return false;
+    return true;
+}
+
+PassRefPtr<StringImpl> StringImpl::substring(unsigned start, unsigned length)
+{
+    if (start >= m_length)
+        return empty();
+    unsigned maxLength = m_length - start;
+    if (length >= maxLength) {
+        if (!start)
+            return this;
+        length = maxLength;
+    }
+    return create(m_data + start, length);
+}
+
+UChar32 StringImpl::characterStartingAt(unsigned i)
+{
+    if (U16_IS_SINGLE(m_data[i]))
+        return m_data[i];
+    if (i + 1 < m_length && U16_IS_LEAD(m_data[i]) && U16_IS_TRAIL(m_data[i + 1]))
+        return U16_GET_SUPPLEMENTARY(m_data[i], m_data[i + 1]);
+    return 0;
+}
+
+PassRefPtr<StringImpl> StringImpl::lower()
+{
+    // Note: This is a hot function in the Dromaeo benchmark, specifically the
+    // no-op code path up through the first 'return' statement.
+    
+    // First scan the string for uppercase and non-ASCII characters:
+    UChar ored = 0;
+    bool noUpper = true;
+    const UChar *end = m_data + m_length;
+    for (const UChar* chp = m_data; chp != end; chp++) {
+        if (UNLIKELY(isASCIIUpper(*chp)))
+            noUpper = false;
+        ored |= *chp;
+    }
+    
+    // Nothing to do if the string is all ASCII with no uppercase.
+    if (noUpper && !(ored & ~0x7F))
+        return this;
+
+    int32_t length = m_length;
+    UChar* data;
+    RefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
+
+    if (!(ored & ~0x7F)) {
+        // Do a faster loop for the case where all the characters are ASCII.
+        for (int i = 0; i < length; i++) {
+            UChar c = m_data[i];
+            data[i] = toASCIILower(c);
+        }
+        return newImpl;
+    }
+    
+    // Do a slower implementation for cases that include non-ASCII characters.
+    bool error;
+    int32_t realLength = Unicode::toLower(data, length, m_data, m_length, &error);
+    if (!error && realLength == length)
+        return newImpl;
+    newImpl = createUninitialized(realLength, data);
+    Unicode::toLower(data, realLength, m_data, m_length, &error);
+    if (error)
+        return this;
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::upper()
+{
+    // This function could be optimized for no-op cases the way lower() is,
+    // but in empirical testing, few actual calls to upper() are no-ops, so
+    // it wouldn't be worth the extra time for pre-scanning.
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
+    int32_t length = m_length;
+
+    // Do a faster loop for the case where all the characters are ASCII.
+    UChar ored = 0;
+    for (int i = 0; i < length; i++) {
+        UChar c = m_data[i];
+        ored |= c;
+        data[i] = toASCIIUpper(c);
+    }
+    if (!(ored & ~0x7F))
+        return newImpl;
+
+    // Do a slower implementation for cases that include non-ASCII characters.
+    bool error;
+    int32_t realLength = Unicode::toUpper(data, length, m_data, m_length, &error);
+    if (!error && realLength == length)
+        return newImpl;
+    newImpl = createUninitialized(realLength, data);
+    Unicode::toUpper(data, realLength, m_data, m_length, &error);
+    if (error)
+        return this;
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::secure(UChar aChar)
+{
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
+    int32_t length = m_length;
+    for (int i = 0; i < length; ++i)
+        data[i] = aChar;
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::foldCase()
+{
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
+    int32_t length = m_length;
+
+    // Do a faster loop for the case where all the characters are ASCII.
+    UChar ored = 0;
+    for (int i = 0; i < length; i++) {
+        UChar c = m_data[i];
+        ored |= c;
+        data[i] = toASCIILower(c);
+    }
+    if (!(ored & ~0x7F))
+        return newImpl;
+
+    // Do a slower implementation for cases that include non-ASCII characters.
+    bool error;
+    int32_t realLength = Unicode::foldCase(data, length, m_data, m_length, &error);
+    if (!error && realLength == length)
+        return newImpl;
+    newImpl = createUninitialized(realLength, data);
+    Unicode::foldCase(data, realLength, m_data, m_length, &error);
+    if (error)
+        return this;
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::stripWhiteSpace()
+{
+    if (!m_length)
+        return empty();
+
+    unsigned start = 0;
+    unsigned end = m_length - 1;
+    
+    // skip white space from start
+    while (start <= end && isSpaceOrNewline(m_data[start]))
+        start++;
+    
+    // only white space
+    if (start > end) 
+        return empty();
+
+    // skip white space from end
+    while (end && isSpaceOrNewline(m_data[end]))
+        end--;
+
+    if (!start && end == m_length - 1)
+        return this;
+    return create(m_data + start, end + 1 - start);
+}
+
+PassRefPtr<StringImpl> StringImpl::removeCharacters(CharacterMatchFunctionPtr findMatch)
+{
+    const UChar* from = m_data;
+    const UChar* fromend = from + m_length;
+
+    // Assume the common case will not remove any characters
+    while (from != fromend && !findMatch(*from))
+        from++;
+    if (from == fromend)
+        return this;
+
+    StringBuffer data(m_length);
+    UChar* to = data.characters();
+    unsigned outc = from - m_data;
+
+    if (outc)
+        memcpy(to, m_data, outc * sizeof(UChar));
+
+    while (true) {
+        while (from != fromend && findMatch(*from))
+            from++;
+        while (from != fromend && !findMatch(*from))
+            to[outc++] = *from++;
+        if (from == fromend)
+            break;
+    }
+
+    data.shrink(outc);
+
+    return adopt(data);
+}
+
+PassRefPtr<StringImpl> StringImpl::simplifyWhiteSpace()
+{
+    StringBuffer data(m_length);
+
+    const UChar* from = m_data;
+    const UChar* fromend = from + m_length;
+    int outc = 0;
+    bool changedToSpace = false;
+    
+    UChar* to = data.characters();
+    
+    while (true) {
+        while (from != fromend && isSpaceOrNewline(*from)) {
+            if (*from != ' ')
+                changedToSpace = true;
+            from++;
+        }
+        while (from != fromend && !isSpaceOrNewline(*from))
+            to[outc++] = *from++;
+        if (from != fromend)
+            to[outc++] = ' ';
+        else
+            break;
+    }
+    
+    if (outc > 0 && to[outc - 1] == ' ')
+        outc--;
+    
+    if (static_cast<unsigned>(outc) == m_length && !changedToSpace)
+        return this;
+    
+    data.shrink(outc);
+    
+    return adopt(data);
+}
+
+int StringImpl::toIntStrict(bool* ok, int base)
+{
+    return charactersToIntStrict(m_data, m_length, ok, base);
+}
+
+unsigned StringImpl::toUIntStrict(bool* ok, int base)
+{
+    return charactersToUIntStrict(m_data, m_length, ok, base);
+}
+
+int64_t StringImpl::toInt64Strict(bool* ok, int base)
+{
+    return charactersToInt64Strict(m_data, m_length, ok, base);
+}
+
+uint64_t StringImpl::toUInt64Strict(bool* ok, int base)
+{
+    return charactersToUInt64Strict(m_data, m_length, ok, base);
+}
+
+intptr_t StringImpl::toIntPtrStrict(bool* ok, int base)
+{
+    return charactersToIntPtrStrict(m_data, m_length, ok, base);
+}
+
+int StringImpl::toInt(bool* ok)
+{
+    return charactersToInt(m_data, m_length, ok);
+}
+
+unsigned StringImpl::toUInt(bool* ok)
+{
+    return charactersToUInt(m_data, m_length, ok);
+}
+
+int64_t StringImpl::toInt64(bool* ok)
+{
+    return charactersToInt64(m_data, m_length, ok);
+}
+
+uint64_t StringImpl::toUInt64(bool* ok)
+{
+    return charactersToUInt64(m_data, m_length, ok);
+}
+
+intptr_t StringImpl::toIntPtr(bool* ok)
+{
+    return charactersToIntPtr(m_data, m_length, ok);
+}
+
+double StringImpl::toDouble(bool* ok)
+{
+    return charactersToDouble(m_data, m_length, ok);
+}
+
+float StringImpl::toFloat(bool* ok)
+{
+    return charactersToFloat(m_data, m_length, ok);
+}
+
+static bool equal(const UChar* a, const char* b, int length)
+{
+    ASSERT(length >= 0);
+    while (length--) {
+        unsigned char bc = *b++;
+        if (*a++ != bc)
+            return false;
+    }
+    return true;
+}
+
+bool equalIgnoringCase(const UChar* a, const char* b, unsigned length)
+{
+    while (length--) {
+        unsigned char bc = *b++;
+        if (foldCase(*a++) != foldCase(bc))
+            return false;
+    }
+    return true;
+}
+
+static inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length)
+{
+    ASSERT(length >= 0);
+    return umemcasecmp(a, b, length) == 0;
+}
+
+int StringImpl::find(const char* chs, int index, bool caseSensitive)
+{
+    if (!chs || index < 0)
+        return -1;
+
+    int chsLength = strlen(chs);
+    int n = m_length - index;
+    if (n < 0)
+        return -1;
+    n -= chsLength - 1;
+    if (n <= 0)
+        return -1;
+
+    const char* chsPlusOne = chs + 1;
+    int chsLengthMinusOne = chsLength - 1;
+    
+    const UChar* ptr = m_data + index - 1;
+    if (caseSensitive) {
+        UChar c = *chs;
+        do {
+            if (*++ptr == c && equal(ptr + 1, chsPlusOne, chsLengthMinusOne))
+                return m_length - chsLength - n + 1;
+        } while (--n);
+    } else {
+        UChar lc = Unicode::foldCase(*chs);
+        do {
+            if (Unicode::foldCase(*++ptr) == lc && equalIgnoringCase(ptr + 1, chsPlusOne, chsLengthMinusOne))
+                return m_length - chsLength - n + 1;
+        } while (--n);
+    }
+
+    return -1;
+}
+
+int StringImpl::find(UChar c, int start)
+{
+    return WebCore::find(m_data, m_length, c, start);
+}
+
+int StringImpl::find(CharacterMatchFunctionPtr matchFunction, int start)
+{
+    return WebCore::find(m_data, m_length, matchFunction, start);
+}
+
+int StringImpl::find(StringImpl* str, int index, bool caseSensitive)
+{
+    /*
+      We use a simple trick for efficiency's sake. Instead of
+      comparing strings, we compare the sum of str with that of
+      a part of this string. Only if that matches, we call memcmp
+      or ucstrnicmp.
+    */
+    ASSERT(str);
+    if (index < 0)
+        index += m_length;
+    int lstr = str->m_length;
+    int lthis = m_length - index;
+    if ((unsigned)lthis > m_length)
+        return -1;
+    int delta = lthis - lstr;
+    if (delta < 0)
+        return -1;
+
+    const UChar* uthis = m_data + index;
+    const UChar* ustr = str->m_data;
+    unsigned hthis = 0;
+    unsigned hstr = 0;
+    if (caseSensitive) {
+        for (int i = 0; i < lstr; i++) {
+            hthis += uthis[i];
+            hstr += ustr[i];
+        }
+        int i = 0;
+        while (1) {
+            if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
+                return index + i;
+            if (i == delta)
+                return -1;
+            hthis += uthis[i + lstr];
+            hthis -= uthis[i];
+            i++;
+        }
+    } else {
+        for (int i = 0; i < lstr; i++ ) {
+            hthis += toASCIILower(uthis[i]);
+            hstr += toASCIILower(ustr[i]);
+        }
+        int i = 0;
+        while (1) {
+            if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr))
+                return index + i;
+            if (i == delta)
+                return -1;
+            hthis += toASCIILower(uthis[i + lstr]);
+            hthis -= toASCIILower(uthis[i]);
+            i++;
+        }
+    }
+}
+
+int StringImpl::reverseFind(UChar c, int index)
+{
+    return WebCore::reverseFind(m_data, m_length, c, index);
+}
+
+int StringImpl::reverseFind(StringImpl* str, int index, bool caseSensitive)
+{
+    /*
+     See StringImpl::find() for explanations.
+     */
+    ASSERT(str);
+    int lthis = m_length;
+    if (index < 0)
+        index += lthis;
+    
+    int lstr = str->m_length;
+    int delta = lthis - lstr;
+    if ( index < 0 || index > lthis || delta < 0 )
+        return -1;
+    if ( index > delta )
+        index = delta;
+    
+    const UChar *uthis = m_data;
+    const UChar *ustr = str->m_data;
+    unsigned hthis = 0;
+    unsigned hstr = 0;
+    int i;
+    if (caseSensitive) {
+        for ( i = 0; i < lstr; i++ ) {
+            hthis += uthis[index + i];
+            hstr += ustr[i];
+        }
+        i = index;
+        while (1) {
+            if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
+                return i;
+            if (i == 0)
+                return -1;
+            i--;
+            hthis -= uthis[i + lstr];
+            hthis += uthis[i];
+        }
+    } else {
+        for (i = 0; i < lstr; i++) {
+            hthis += toASCIILower(uthis[index + i]);
+            hstr += toASCIILower(ustr[i]);
+        }
+        i = index;
+        while (1) {
+            if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr) )
+                return i;
+            if (i == 0)
+                return -1;
+            i--;
+            hthis -= toASCIILower(uthis[i + lstr]);
+            hthis += toASCIILower(uthis[i]);
+        }
+    }
+    
+    // Should never get here.
+    return -1;
+}
+
+bool StringImpl::endsWith(StringImpl* m_data, bool caseSensitive)
+{
+    ASSERT(m_data);
+    int start = m_length - m_data->m_length;
+    if (start >= 0)
+        return (find(m_data, start, caseSensitive) == start);
+    return false;
+}
+
+PassRefPtr<StringImpl> StringImpl::replace(UChar oldC, UChar newC)
+{
+    if (oldC == newC)
+        return this;
+    unsigned i;
+    for (i = 0; i != m_length; ++i)
+        if (m_data[i] == oldC)
+            break;
+    if (i == m_length)
+        return this;
+
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
+
+    for (i = 0; i != m_length; ++i) {
+        UChar ch = m_data[i];
+        if (ch == oldC)
+            ch = newC;
+        data[i] = ch;
+    }
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::replace(unsigned position, unsigned lengthToReplace, StringImpl* str)
+{
+    position = min(position, length());
+    lengthToReplace = min(lengthToReplace, length() - position);
+    unsigned lengthToInsert = str ? str->length() : 0;
+    if (!lengthToReplace && !lengthToInsert)
+        return this;
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl =
+        createUninitialized(length() - lengthToReplace + lengthToInsert, data);
+    memcpy(data, characters(), position * sizeof(UChar));
+    if (str)
+        memcpy(data + position, str->characters(), lengthToInsert * sizeof(UChar));
+    memcpy(data + position + lengthToInsert, characters() + position + lengthToReplace,
+        (length() - position - lengthToReplace) * sizeof(UChar));
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::replace(UChar pattern, StringImpl* replacement)
+{
+    if (!replacement)
+        return this;
+        
+    int repStrLength = replacement->length();
+    int srcSegmentStart = 0;
+    int matchCount = 0;
+    
+    // Count the matches
+    while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
+        ++matchCount;
+        ++srcSegmentStart;
+    }
+    
+    // If we have 0 matches, we don't have to do any more work
+    if (!matchCount)
+        return this;
+    
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl =
+        createUninitialized(m_length - matchCount + (matchCount * repStrLength), data);
+
+    // Construct the new data
+    int srcSegmentEnd;
+    int srcSegmentLength;
+    srcSegmentStart = 0;
+    int dstOffset = 0;
+    
+    while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
+        srcSegmentLength = srcSegmentEnd - srcSegmentStart;
+        memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
+        dstOffset += srcSegmentLength;
+        memcpy(data + dstOffset, replacement->m_data, repStrLength * sizeof(UChar));
+        dstOffset += repStrLength;
+        srcSegmentStart = srcSegmentEnd + 1;
+    }
+
+    srcSegmentLength = m_length - srcSegmentStart;
+    memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
+
+    ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
+
+    return newImpl;
+}
+
+PassRefPtr<StringImpl> StringImpl::replace(StringImpl* pattern, StringImpl* replacement)
+{
+    if (!pattern || !replacement)
+        return this;
+
+    int patternLength = pattern->length();
+    if (!patternLength)
+        return this;
+        
+    int repStrLength = replacement->length();
+    int srcSegmentStart = 0;
+    int matchCount = 0;
+    
+    // Count the matches
+    while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
+        ++matchCount;
+        srcSegmentStart += patternLength;
+    }
+    
+    // If we have 0 matches, we don't have to do any more work
+    if (!matchCount)
+        return this;
+    
+    UChar* data;
+    PassRefPtr<StringImpl> newImpl =
+        createUninitialized(m_length + matchCount * (repStrLength - patternLength), data);
+    
+    // Construct the new data
+    int srcSegmentEnd;
+    int srcSegmentLength;
+    srcSegmentStart = 0;
+    int dstOffset = 0;
+    
+    while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
+        srcSegmentLength = srcSegmentEnd - srcSegmentStart;
+        memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
+        dstOffset += srcSegmentLength;
+        memcpy(data + dstOffset, replacement->m_data, repStrLength * sizeof(UChar));
+        dstOffset += repStrLength;
+        srcSegmentStart = srcSegmentEnd + patternLength;
+    }
+
+    srcSegmentLength = m_length - srcSegmentStart;
+    memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
+
+    ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
+
+    return newImpl;
+}
+
+bool equal(const StringImpl* a, const StringImpl* b)
+{
+    return StringHash::equal(a, b);
+}
+
+bool equal(const StringImpl* a, const char* b)
+{
+    if (!a)
+        return !b;
+    if (!b)
+        return !a;
+
+    unsigned length = a->length();
+    const UChar* as = a->characters();
+    for (unsigned i = 0; i != length; ++i) {
+        unsigned char bc = b[i];
+        if (!bc)
+            return false;
+        if (as[i] != bc)
+            return false;
+    }
+
+    return !b[length];
+}
+
+bool equalIgnoringCase(StringImpl* a, StringImpl* b)
+{
+    return CaseFoldingHash::equal(a, b);
+}
+
+bool equalIgnoringCase(StringImpl* a, const char* b)
+{
+    if (!a)
+        return !b;
+    if (!b)
+        return !a;
+
+    unsigned length = a->length();
+    const UChar* as = a->characters();
+
+    // Do a faster loop for the case where all the characters are ASCII.
+    UChar ored = 0;
+    bool equal = true;
+    for (unsigned i = 0; i != length; ++i) {
+        char bc = b[i];
+        if (!bc)
+            return false;
+        UChar ac = as[i];
+        ored |= ac;
+        equal = equal && (toASCIILower(ac) == toASCIILower(bc));
+    }
+
+    // Do a slower implementation for cases that include non-ASCII characters.
+    if (ored & ~0x7F) {
+        equal = true;
+        for (unsigned i = 0; i != length; ++i) {
+            unsigned char bc = b[i];
+            equal = equal && (foldCase(as[i]) == foldCase(bc));
+        }
+    }
+
+    return equal && !b[length];
+}
+
+bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
+{
+    if (StringHash::equal(a, b))
+        return true;
+    if (!a && b && !b->length())
+        return true;
+    if (!b && a && !a->length())
+        return true;
+
+    return false;
+}
+
+Vector<char> StringImpl::ascii()
+{
+    Vector<char> buffer(m_length + 1);
+    for (unsigned i = 0; i != m_length; ++i) {
+        UChar c = m_data[i];
+        if ((c >= 0x20 && c < 0x7F) || c == 0x00)
+            buffer[i] = c;
+        else
+            buffer[i] = '?';
+    }
+    buffer[m_length] = '\0';
+    return buffer;
+}
+
+WTF::Unicode::Direction StringImpl::defaultWritingDirection()
+{
+    for (unsigned i = 0; i < m_length; ++i) {
+        WTF::Unicode::Direction charDirection = WTF::Unicode::direction(m_data[i]);
+        if (charDirection == WTF::Unicode::LeftToRight)
+            return WTF::Unicode::LeftToRight;
+        if (charDirection == WTF::Unicode::RightToLeft || charDirection == WTF::Unicode::RightToLeftArabic)
+            return WTF::Unicode::RightToLeft;
+    }
+    return WTF::Unicode::LeftToRight;
+}
+
+// This is a hot function because it's used when parsing HTML.
+PassRefPtr<StringImpl> StringImpl::createStrippingNullCharactersSlowCase(const UChar* characters, unsigned length)
+{
+    StringBuffer strippedCopy(length);
+    unsigned strippedLength = 0;
+    for (unsigned i = 0; i < length; i++) {
+        if (int c = characters[i])
+            strippedCopy[strippedLength++] = c;
+    }
+    ASSERT(strippedLength < length);  // Only take the slow case when stripping.
+    strippedCopy.shrink(strippedLength);
+    return adopt(strippedCopy);
+}
+
+PassRefPtr<StringImpl> StringImpl::adopt(StringBuffer& buffer)
+{
+    unsigned length = buffer.length();
+    if (length == 0)
+        return empty();
+    return adoptRef(new StringImpl(buffer.release(), length));
+}
+
+PassRefPtr<StringImpl> StringImpl::createWithTerminatingNullCharacter(const StringImpl& string)
+{
+    // Use createUninitialized instead of 'new StringImpl' so that the string and its buffer
+    // get allocated in a single malloc block.
+    UChar* data;
+    int length = string.m_length;
+    RefPtr<StringImpl> terminatedString = createUninitialized(length + 1, data);
+    memcpy(data, string.m_data, length * sizeof(UChar));
+    data[length] = 0;
+    terminatedString->m_length--;
+    terminatedString->m_hash = string.m_hash;
+    terminatedString->m_refCountAndFlags |= s_refCountFlagHasTerminatingNullCharacter;
+    return terminatedString.release();
+}
+
+PassRefPtr<StringImpl> StringImpl::threadsafeCopy() const
+{
+    return create(m_data, m_length);
+}
+
+PassRefPtr<StringImpl> StringImpl::crossThreadString()
+{
+    if (SharedUChar* sharedBuffer = this->sharedBuffer())
+        return adoptRef(new StringImpl(m_data, m_length, sharedBuffer->crossThreadCopy()));
+
+    // If no shared buffer is available, create a copy.
+    return threadsafeCopy();
+}
+
+} // namespace WebCore
diff --git a/JavaScriptCore/wtf/text/StringImpl.h b/JavaScriptCore/wtf/text/StringImpl.h
new file mode 100644
index 0000000..6ac9e40
--- /dev/null
+++ b/JavaScriptCore/wtf/text/StringImpl.h
@@ -0,0 +1,389 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * 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 StringImpl_h
+#define StringImpl_h
+
+#include <limits.h>
+#include <wtf/ASCIICType.h>
+#include <wtf/CrossThreadRefCounted.h>
+#include <wtf/OwnFastMallocPtr.h>
+#include <wtf/StringHashFunctions.h>
+#include <wtf/Vector.h>
+#include <wtf/text/StringImplBase.h>
+#include <wtf/unicode/Unicode.h>
+
+#if PLATFORM(CF)
+typedef const struct __CFString * CFStringRef;
+#endif
+
+#ifdef __OBJC__
+@class NSString;
+#endif
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace JSC {
+
+struct IdentifierCStringTranslator;
+struct IdentifierUCharBufferTranslator;
+
+}
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace WebCore {
+
+class StringBuffer;
+
+struct CStringTranslator;
+struct HashAndCharactersTranslator;
+struct StringHash;
+struct UCharBufferTranslator;
+
+enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive };
+
+typedef OwnFastMallocPtr<const UChar> SharableUChar;
+typedef CrossThreadRefCounted<SharableUChar> SharedUChar;
+typedef bool (*CharacterMatchFunctionPtr)(UChar);
+
+class StringImpl : public StringImplBase {
+    friend struct JSC::IdentifierCStringTranslator;
+    friend struct JSC::IdentifierUCharBufferTranslator;
+    friend struct CStringTranslator;
+    friend struct HashAndCharactersTranslator;
+    friend struct UCharBufferTranslator;
+private:
+    // Used to construct static strings, which have an special refCount that can never hit zero.
+    // This means that the static string will never be destroyed, which is important because
+    // static strings will be shared across threads & ref-counted in a non-threadsafe manner.
+    StringImpl(const UChar* characters, unsigned length, StaticStringConstructType)
+        : StringImplBase(length, ConstructStaticString)
+        , m_data(characters)
+        , m_buffer(0)
+        , m_hash(0)
+    {
+        // Ensure that the hash is computed so that AtomicStringHash can call existingHash()
+        // with impunity. The empty string is special because it is never entered into
+        // AtomicString's HashKey, but still needs to compare correctly.
+        hash();
+    }
+
+    // Create a normal string with internal storage (BufferInternal)
+    StringImpl(unsigned length)
+        : StringImplBase(length, BufferInternal)
+        , m_data(reinterpret_cast<const UChar*>(this + 1))
+        , m_buffer(0)
+        , m_hash(0)
+    {
+        ASSERT(m_data);
+        ASSERT(m_length);
+    }
+
+    // Create a StringImpl adopting ownership of the provided buffer (BufferOwned)
+    StringImpl(const UChar* characters, unsigned length)
+        : StringImplBase(length, BufferOwned)
+        , m_data(characters)
+        , m_buffer(0)
+        , m_hash(0)
+    {
+        ASSERT(m_data);
+        ASSERT(m_length);
+    }
+
+    // Used to create new strings that are a substring of an existing StringImpl (BufferSubstring)
+    StringImpl(const UChar* characters, unsigned length, PassRefPtr<StringImpl> base)
+        : StringImplBase(length, BufferSubstring)
+        , m_data(characters)
+        , m_substringBuffer(base.releaseRef())
+        , m_hash(0)
+    {
+        ASSERT(m_data);
+        ASSERT(m_length);
+        ASSERT(m_substringBuffer->bufferOwnership() != BufferSubstring);
+    }
+
+    // Used to construct new strings sharing an existing SharedUChar (BufferShared)
+    StringImpl(const UChar* characters, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
+        : StringImplBase(length, BufferShared)
+        , m_data(characters)
+        , m_sharedBuffer(sharedBuffer.releaseRef())
+        , m_hash(0)
+    {
+        ASSERT(m_data);
+        ASSERT(m_length);
+    }
+
+    // For use only by AtomicString's XXXTranslator helpers.
+    void setHash(unsigned hash)
+    {
+        ASSERT(!isStatic());
+        ASSERT(!m_hash);
+        ASSERT(hash == computeHash(m_data, m_length));
+        m_hash = hash;
+    }
+
+public:
+    ~StringImpl();
+
+    static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
+    static PassRefPtr<StringImpl> create(const char*, unsigned length);
+    static PassRefPtr<StringImpl> create(const char*);
+    static PassRefPtr<StringImpl> create(const UChar*, unsigned length, PassRefPtr<SharedUChar> sharedBuffer);
+    static PassRefPtr<StringImpl> create(PassRefPtr<StringImpl> rep, unsigned offset, unsigned length)
+    {
+        ASSERT(rep);
+        ASSERT(length <= rep->length());
+
+        if (!length)
+            return empty();
+
+        StringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->m_substringBuffer : rep.get();
+        return adoptRef(new StringImpl(rep->m_data + offset, length, ownerRep));
+    }
+
+    static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
+    static PassRefPtr<StringImpl> tryCreateUninitialized(unsigned length, UChar*& output)
+    {
+        if (!length) {
+            output = 0;
+            return empty();
+        }
+
+        if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar)))
+            return 0;
+        StringImpl* resultImpl;
+        if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl))
+            return 0;
+        output = reinterpret_cast<UChar*>(resultImpl + 1);
+        return adoptRef(new(resultImpl) StringImpl(length));
+    }
+
+    static PassRefPtr<StringImpl> createWithTerminatingNullCharacter(const StringImpl&);
+    static PassRefPtr<StringImpl> createStrippingNullCharacters(const UChar*, unsigned length);
+
+    template<size_t inlineCapacity>
+    static PassRefPtr<StringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
+    {
+        if (size_t size = vector.size()) {
+            ASSERT(vector.data());
+            return adoptRef(new StringImpl(vector.releaseBuffer(), size));
+        }
+        return empty();
+    }
+    static PassRefPtr<StringImpl> adopt(StringBuffer&);
+
+    SharedUChar* sharedBuffer();
+    const UChar* characters() const { return m_data; }
+
+    size_t cost()
+    {
+        // For substrings, return the cost of the base string.
+        if (bufferOwnership() == BufferSubstring)
+            return m_substringBuffer->cost();
+
+        if (m_refCountAndFlags & s_refCountFlagShouldReportedCost) {
+            m_refCountAndFlags &= ~s_refCountFlagShouldReportedCost;
+            return m_length;
+        }
+        return 0;
+    }
+
+    bool isIdentifier() const { return m_refCountAndFlags & s_refCountFlagIsIdentifier; }
+    void setIsIdentifier(bool isIdentifier)
+    {
+        ASSERT(!isStatic());
+        if (isIdentifier)
+            m_refCountAndFlags |= s_refCountFlagIsIdentifier;
+        else
+            m_refCountAndFlags &= ~s_refCountFlagIsIdentifier;
+    }
+
+    bool hasTerminatingNullCharacter() const { return m_refCountAndFlags & s_refCountFlagHasTerminatingNullCharacter; }
+
+    bool inTable() const { return m_refCountAndFlags & s_refCountFlagInTable; }
+    void setInTable() { m_refCountAndFlags |= s_refCountFlagInTable; }
+
+    unsigned hash() const { if (!m_hash) m_hash = computeHash(m_data, m_length); return m_hash; }
+    unsigned existingHash() const { ASSERT(m_hash); return m_hash; }
+    static unsigned computeHash(const UChar* data, unsigned length) { return WTF::stringHash(data, length); }
+    static unsigned computeHash(const char* data, unsigned length) { return WTF::stringHash(data, length); }
+    static unsigned computeHash(const char* data) { return WTF::stringHash(data); }
+
+    ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic))) delete this; }
+    ALWAYS_INLINE bool hasOneRef() const { return (m_refCountAndFlags & (s_refCountMask | s_refCountFlagStatic)) == s_refCountIncrement; }
+
+    static StringImpl* empty();
+
+    static void copyChars(UChar* destination, const UChar* source, unsigned numCharacters)
+    {
+        if (numCharacters <= s_copyCharsInlineCutOff) {
+            for (unsigned i = 0; i < numCharacters; ++i)
+                destination[i] = source[i];
+        } else
+            memcpy(destination, source, numCharacters * sizeof(UChar));
+    }
+
+    // Returns a StringImpl suitable for use on another thread.
+    PassRefPtr<StringImpl> crossThreadString();
+    // Makes a deep copy. Helpful only if you need to use a String on another thread
+    // (use crossThreadString if the method call doesn't need to be threadsafe).
+    // Since StringImpl objects are immutable, there's no other reason to make a copy.
+    PassRefPtr<StringImpl> threadsafeCopy() const;
+
+    PassRefPtr<StringImpl> substring(unsigned pos, unsigned len = UINT_MAX);
+
+    UChar operator[](unsigned i) { ASSERT(i < m_length); return m_data[i]; }
+    UChar32 characterStartingAt(unsigned);
+
+    bool containsOnlyWhitespace();
+
+    int toIntStrict(bool* ok = 0, int base = 10);
+    unsigned toUIntStrict(bool* ok = 0, int base = 10);
+    int64_t toInt64Strict(bool* ok = 0, int base = 10);
+    uint64_t toUInt64Strict(bool* ok = 0, int base = 10);
+    intptr_t toIntPtrStrict(bool* ok = 0, int base = 10);
+
+    int toInt(bool* ok = 0); // ignores trailing garbage
+    unsigned toUInt(bool* ok = 0); // ignores trailing garbage
+    int64_t toInt64(bool* ok = 0); // ignores trailing garbage
+    uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage
+    intptr_t toIntPtr(bool* ok = 0); // ignores trailing garbage
+
+    double toDouble(bool* ok = 0);
+    float toFloat(bool* ok = 0);
+
+    PassRefPtr<StringImpl> lower();
+    PassRefPtr<StringImpl> upper();
+    PassRefPtr<StringImpl> secure(UChar aChar);
+    PassRefPtr<StringImpl> foldCase();
+
+    PassRefPtr<StringImpl> stripWhiteSpace();
+    PassRefPtr<StringImpl> simplifyWhiteSpace();
+
+    PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr);
+
+    int find(const char*, int index = 0, bool caseSensitive = true);
+    int find(UChar, int index = 0);
+    int find(CharacterMatchFunctionPtr, int index = 0);
+    int find(StringImpl*, int index, bool caseSensitive = true);
+
+    int reverseFind(UChar, int index);
+    int reverseFind(StringImpl*, int index, bool caseSensitive = true);
+    
+    bool startsWith(StringImpl* str, bool caseSensitive = true) { return reverseFind(str, 0, caseSensitive) == 0; }
+    bool endsWith(StringImpl*, bool caseSensitive = true);
+
+    PassRefPtr<StringImpl> replace(UChar, UChar);
+    PassRefPtr<StringImpl> replace(UChar, StringImpl*);
+    PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
+    PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
+
+    Vector<char> ascii();
+
+    WTF::Unicode::Direction defaultWritingDirection();
+
+#if PLATFORM(CF)
+    CFStringRef createCFString();
+#endif
+#ifdef __OBJC__
+    operator NSString*();
+#endif
+
+private:
+    // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings.
+    static const unsigned s_copyCharsInlineCutOff = 20;
+
+    static PassRefPtr<StringImpl> createStrippingNullCharactersSlowCase(const UChar*, unsigned length);
+    
+    BufferOwnership bufferOwnership() const { return static_cast<BufferOwnership>(m_refCountAndFlags & s_refCountMaskBufferOwnership); }
+    bool isStatic() const { return m_refCountAndFlags & s_refCountFlagStatic; }
+
+    const UChar* m_data;
+    union {
+        void* m_buffer;
+        StringImpl* m_substringBuffer;
+        SharedUChar* m_sharedBuffer;
+    };
+    mutable unsigned m_hash;
+};
+
+bool equal(const StringImpl*, const StringImpl*);
+bool equal(const StringImpl*, const char*);
+inline bool equal(const char* a, StringImpl* b) { return equal(b, a); }
+
+bool equalIgnoringCase(StringImpl*, StringImpl*);
+bool equalIgnoringCase(StringImpl*, const char*);
+inline bool equalIgnoringCase(const char* a, StringImpl* b) { return equalIgnoringCase(b, a); }
+bool equalIgnoringCase(const UChar* a, const char* b, unsigned length);
+inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, a, length); }
+
+bool equalIgnoringNullity(StringImpl*, StringImpl*);
+
+static inline bool isSpaceOrNewline(UChar c)
+{
+    // Use isASCIISpace() for basic Latin-1.
+    // This will include newlines, which aren't included in Unicode DirWS.
+    return c <= 0x7F ? WTF::isASCIISpace(c) : WTF::Unicode::direction(c) == WTF::Unicode::WhiteSpaceNeutral;
+}
+
+// This is a hot function because it's used when parsing HTML.
+inline PassRefPtr<StringImpl> StringImpl::createStrippingNullCharacters(const UChar* characters, unsigned length)
+{
+    ASSERT(characters);
+    ASSERT(length);
+
+    // Optimize for the case where there are no Null characters by quickly
+    // searching for nulls, and then using StringImpl::create, which will
+    // memcpy the whole buffer.  This is faster than assigning character by
+    // character during the loop. 
+
+    // Fast case.
+    int foundNull = 0;
+    for (unsigned i = 0; !foundNull && i < length; i++) {
+        int c = characters[i]; // more efficient than using UChar here (at least on Intel Mac OS)
+        foundNull |= !c;
+    }
+    if (!foundNull)
+        return StringImpl::create(characters, length);
+
+    return StringImpl::createStrippingNullCharactersSlowCase(characters, length);
+}
+
+}
+
+using WebCore::equal;
+
+namespace WTF {
+
+    // WebCore::StringHash is the default hash for StringImpl* and RefPtr<StringImpl>
+    template<typename T> struct DefaultHash;
+    template<> struct DefaultHash<WebCore::StringImpl*> {
+        typedef WebCore::StringHash Hash;
+    };
+    template<> struct DefaultHash<RefPtr<WebCore::StringImpl> > {
+        typedef WebCore::StringHash Hash;
+    };
+
+}
+
+#endif
diff --git a/JavaScriptCore/wtf/text/StringImplBase.h b/JavaScriptCore/wtf/text/StringImplBase.h
new file mode 100644
index 0000000..a8e3385
--- /dev/null
+++ b/JavaScriptCore/wtf/text/StringImplBase.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2010 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 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 StringImplBase_h
+#define StringImplBase_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/unicode/Unicode.h>
+
+namespace WTF {
+
+class StringImplBase : public Noncopyable {
+public:
+    bool isStringImpl() { return (m_refCountAndFlags & s_refCountInvalidForStringImpl) != s_refCountInvalidForStringImpl; }
+    unsigned length() const { return m_length; }
+    void ref() { m_refCountAndFlags += s_refCountIncrement; }
+
+protected:
+    enum BufferOwnership {
+        BufferInternal,
+        BufferOwned,
+        BufferSubstring,
+        BufferShared,
+    };
+
+    using Noncopyable::operator new;
+    void* operator new(size_t, void* inPlace) { ASSERT(inPlace); return inPlace; }
+
+    // For SmallStringStorage, which allocates an array and uses an in-place new.
+    StringImplBase() { }
+
+    StringImplBase(unsigned length, BufferOwnership ownership)
+        : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | ownership)
+        , m_length(length)
+    {
+        ASSERT(isStringImpl());
+    }
+
+    enum StaticStringConstructType { ConstructStaticString };
+    StringImplBase(unsigned length, StaticStringConstructType)
+        : m_refCountAndFlags(s_refCountFlagStatic | s_refCountFlagIsIdentifier | BufferOwned)
+        , m_length(length)
+    {
+        ASSERT(isStringImpl());
+    }
+
+    // This constructor is not used when creating StringImpl objects,
+    // and sets the flags into a state marking the object as such.
+    enum NonStringImplConstructType { ConstructNonStringImpl };
+    StringImplBase(NonStringImplConstructType)
+        : m_refCountAndFlags(s_refCountIncrement | s_refCountInvalidForStringImpl)
+        , m_length(0)
+    {
+        ASSERT(!isStringImpl());
+    }
+
+    // The bottom 7 bits hold flags, the top 25 bits hold the ref count.
+    // When dereferencing StringImpls we check for the ref count AND the
+    // static bit both being zero - static strings are never deleted.
+    static const unsigned s_refCountMask = 0xFFFFFF80;
+    static const unsigned s_refCountIncrement = 0x80;
+    static const unsigned s_refCountFlagStatic = 0x40;
+    static const unsigned s_refCountFlagHasTerminatingNullCharacter = 0x20;
+    static const unsigned s_refCountFlagInTable = 0x10;
+    static const unsigned s_refCountFlagShouldReportedCost = 0x8;
+    static const unsigned s_refCountFlagIsIdentifier = 0x4;
+    static const unsigned s_refCountMaskBufferOwnership = 0x3;
+    // An invalid permutation of flags (static & shouldReportedCost - static strings do not
+    // set shouldReportedCost in the constructor, and this bit is only ever cleared, not set).
+    // Used by "ConstructNonStringImpl" constructor, above.
+    static const unsigned s_refCountInvalidForStringImpl = s_refCountFlagStatic | s_refCountFlagShouldReportedCost;
+
+    unsigned m_refCountAndFlags;
+    unsigned m_length;
+};
+
+} // namespace WTF
+
+using WTF::StringImplBase;
+
+#endif
diff --git a/JavaScriptCore/wtf/text/WTFString.cpp b/JavaScriptCore/wtf/text/WTFString.cpp
new file mode 100644
index 0000000..a683e3d
--- /dev/null
+++ b/JavaScriptCore/wtf/text/WTFString.cpp
@@ -0,0 +1,960 @@
+/*
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ *
+ * 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 "WTFString.h"
+
+#include <limits>
+#include <stdarg.h>
+#include <wtf/ASCIICType.h>
+#include <wtf/text/CString.h>
+#include <wtf/StringExtras.h>
+#include <wtf/Vector.h>
+#include <wtf/dtoa.h>
+#include <wtf/unicode/UTF8.h>
+#include <wtf/unicode/Unicode.h>
+
+using namespace WTF;
+using namespace WTF::Unicode;
+
+namespace WebCore {
+
+String::String(const UChar* str, unsigned len)
+{
+    if (!str)
+        return;
+    m_impl = StringImpl::create(str, len);
+}
+
+String::String(const UChar* str)
+{
+    if (!str)
+        return;
+        
+    int len = 0;
+    while (str[len] != UChar(0))
+        len++;
+    
+    m_impl = StringImpl::create(str, len);
+}
+
+String::String(const char* str)
+{
+    if (!str)
+        return;
+    m_impl = StringImpl::create(str);
+}
+
+String::String(const char* str, unsigned length)
+{
+    if (!str)
+        return;
+    m_impl = StringImpl::create(str, length);
+}
+
+void String::append(const String& str)
+{
+    if (str.isEmpty())
+       return;
+
+    // FIXME: This is extremely inefficient. So much so that we might want to take this
+    // out of String's API. We can make it better by optimizing the case where exactly
+    // one String is pointing at this StringImpl, but even then it's going to require a
+    // call to fastMalloc every single time.
+    if (str.m_impl) {
+        if (m_impl) {
+            UChar* data;
+            RefPtr<StringImpl> newImpl =
+                StringImpl::createUninitialized(m_impl->length() + str.length(), data);
+            memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
+            memcpy(data + m_impl->length(), str.characters(), str.length() * sizeof(UChar));
+            m_impl = newImpl.release();
+        } else
+            m_impl = str.m_impl;
+    }
+}
+
+void String::append(char c)
+{
+    // FIXME: This is extremely inefficient. So much so that we might want to take this
+    // out of String's API. We can make it better by optimizing the case where exactly
+    // one String is pointing at this StringImpl, but even then it's going to require a
+    // call to fastMalloc every single time.
+    if (m_impl) {
+        UChar* data;
+        RefPtr<StringImpl> newImpl =
+            StringImpl::createUninitialized(m_impl->length() + 1, data);
+        memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
+        data[m_impl->length()] = c;
+        m_impl = newImpl.release();
+    } else
+        m_impl = StringImpl::create(&c, 1);
+}
+
+void String::append(UChar c)
+{
+    // FIXME: This is extremely inefficient. So much so that we might want to take this
+    // out of String's API. We can make it better by optimizing the case where exactly
+    // one String is pointing at this StringImpl, but even then it's going to require a
+    // call to fastMalloc every single time.
+    if (m_impl) {
+        UChar* data;
+        RefPtr<StringImpl> newImpl =
+            StringImpl::createUninitialized(m_impl->length() + 1, data);
+        memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
+        data[m_impl->length()] = c;
+        m_impl = newImpl.release();
+    } else
+        m_impl = StringImpl::create(&c, 1);
+}
+
+String operator+(const String& a, const String& b)
+{
+    if (a.isEmpty())
+        return b;
+    if (b.isEmpty())
+        return a;
+    String c = a;
+    c += b;
+    return c;
+}
+
+String operator+(const String& s, const char* cs)
+{
+    return s + String(cs);
+}
+
+String operator+(const char* cs, const String& s)
+{
+    return String(cs) + s;
+}
+
+void String::insert(const String& str, unsigned pos)
+{
+    if (str.isEmpty()) {
+        if (str.isNull())
+            return;
+        if (isNull())
+            m_impl = str.impl();
+        return;
+    }
+    insert(str.characters(), str.length(), pos);
+}
+
+void String::append(const UChar* charactersToAppend, unsigned lengthToAppend)
+{
+    if (!m_impl) {
+        if (!charactersToAppend)
+            return;
+        m_impl = StringImpl::create(charactersToAppend, lengthToAppend);
+        return;
+    }
+
+    if (!lengthToAppend)
+        return;
+
+    ASSERT(charactersToAppend);
+    UChar* data;
+    RefPtr<StringImpl> newImpl =
+        StringImpl::createUninitialized(length() + lengthToAppend, data);
+    memcpy(data, characters(), length() * sizeof(UChar));
+    memcpy(data + length(), charactersToAppend, lengthToAppend * sizeof(UChar));
+    m_impl = newImpl.release();
+}
+
+void String::insert(const UChar* charactersToInsert, unsigned lengthToInsert, unsigned position)
+{
+    if (position >= length()) {
+        append(charactersToInsert, lengthToInsert);
+        return;
+    }
+
+    ASSERT(m_impl);
+
+    if (!lengthToInsert)
+        return;
+
+    ASSERT(charactersToInsert);
+    UChar* data;
+    RefPtr<StringImpl> newImpl =
+      StringImpl::createUninitialized(length() + lengthToInsert, data);
+    memcpy(data, characters(), position * sizeof(UChar));
+    memcpy(data + position, charactersToInsert, lengthToInsert * sizeof(UChar));
+    memcpy(data + position + lengthToInsert, characters() + position, (length() - position) * sizeof(UChar));
+    m_impl = newImpl.release();
+}
+
+UChar String::operator[](unsigned i) const
+{
+    if (!m_impl || i >= m_impl->length())
+        return 0;
+    return m_impl->characters()[i];
+}
+
+UChar32 String::characterStartingAt(unsigned i) const
+{
+    if (!m_impl || i >= m_impl->length())
+        return 0;
+    return m_impl->characterStartingAt(i);
+}
+
+unsigned String::length() const
+{
+    if (!m_impl)
+        return 0;
+    return m_impl->length();
+}
+
+void String::truncate(unsigned position)
+{
+    if (position >= length())
+        return;
+    UChar* data;
+    RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(position, data);
+    memcpy(data, characters(), position * sizeof(UChar));
+    m_impl = newImpl.release();
+}
+
+void String::remove(unsigned position, int lengthToRemove)
+{
+    if (lengthToRemove <= 0)
+        return;
+    if (position >= length())
+        return;
+    if (static_cast<unsigned>(lengthToRemove) > length() - position)
+        lengthToRemove = length() - position;
+    UChar* data;
+    RefPtr<StringImpl> newImpl =
+        StringImpl::createUninitialized(length() - lengthToRemove, data);
+    memcpy(data, characters(), position * sizeof(UChar));
+    memcpy(data + position, characters() + position + lengthToRemove,
+        (length() - lengthToRemove - position) * sizeof(UChar));
+    m_impl = newImpl.release();
+}
+
+String String::substring(unsigned pos, unsigned len) const
+{
+    if (!m_impl) 
+        return String();
+    return m_impl->substring(pos, len);
+}
+
+String String::lower() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->lower();
+}
+
+String String::upper() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->upper();
+}
+
+String String::stripWhiteSpace() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->stripWhiteSpace();
+}
+
+String String::simplifyWhiteSpace() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->simplifyWhiteSpace();
+}
+
+String String::removeCharacters(CharacterMatchFunctionPtr findMatch) const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->removeCharacters(findMatch);
+}
+
+String String::foldCase() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->foldCase();
+}
+
+bool String::percentage(int& result) const
+{
+    if (!m_impl || !m_impl->length())
+        return false;
+
+    if ((*m_impl)[m_impl->length() - 1] != '%')
+       return false;
+
+    result = charactersToIntStrict(m_impl->characters(), m_impl->length() - 1);
+    return true;
+}
+
+const UChar* String::characters() const
+{
+    if (!m_impl)
+        return 0;
+    return m_impl->characters();
+}
+
+const UChar* String::charactersWithNullTermination()
+{
+    if (!m_impl)
+        return 0;
+    if (m_impl->hasTerminatingNullCharacter())
+        return m_impl->characters();
+    m_impl = StringImpl::createWithTerminatingNullCharacter(*m_impl);
+    return m_impl->characters();
+}
+
+String String::format(const char *format, ...)
+{
+#if PLATFORM(QT)
+    // Use QString::vsprintf to avoid the locale dependent formatting of vsnprintf.
+    // https://bugs.webkit.org/show_bug.cgi?id=18994
+    va_list args;
+    va_start(args, format);
+
+    QString buffer;
+    buffer.vsprintf(format, args);
+
+    va_end(args);
+
+    return buffer;
+
+#elif OS(WINCE)
+    va_list args;
+    va_start(args, format);
+
+    Vector<char, 256> buffer;
+
+    int bufferSize = 256;
+    buffer.resize(bufferSize);
+    for (;;) {
+        int written = vsnprintf(buffer.data(), bufferSize, format, args);
+        va_end(args);
+
+        if (written == 0)
+            return String("");
+        if (written > 0)
+            return StringImpl::create(buffer.data(), written);
+        
+        bufferSize <<= 1;
+        buffer.resize(bufferSize);
+        va_start(args, format);
+    }
+
+#else
+    va_list args;
+    va_start(args, format);
+
+    Vector<char, 256> buffer;
+
+    // Do the format once to get the length.
+#if COMPILER(MSVC)
+    int result = _vscprintf(format, args);
+#else
+    char ch;
+    int result = vsnprintf(&ch, 1, format, args);
+    // We need to call va_end() and then va_start() again here, as the
+    // contents of args is undefined after the call to vsnprintf
+    // according to http://man.cx/snprintf(3)
+    //
+    // Not calling va_end/va_start here happens to work on lots of
+    // systems, but fails e.g. on 64bit Linux.
+    va_end(args);
+    va_start(args, format);
+#endif
+
+    if (result == 0)
+        return String("");
+    if (result < 0)
+        return String();
+    unsigned len = result;
+    buffer.grow(len + 1);
+    
+    // Now do the formatting again, guaranteed to fit.
+    vsnprintf(buffer.data(), buffer.size(), format, args);
+
+    va_end(args);
+    
+    return StringImpl::create(buffer.data(), len);
+#endif
+}
+
+String String::number(short n)
+{
+    return String::format("%hd", n);
+}
+
+String String::number(unsigned short n)
+{
+    return String::format("%hu", n);
+}
+
+String String::number(int n)
+{
+    return String::format("%d", n);
+}
+
+String String::number(unsigned n)
+{
+    return String::format("%u", n);
+}
+
+String String::number(long n)
+{
+    return String::format("%ld", n);
+}
+
+String String::number(unsigned long n)
+{
+    return String::format("%lu", n);
+}
+
+String String::number(long long n)
+{
+#if OS(WINDOWS) && !PLATFORM(QT)
+    return String::format("%I64i", n);
+#else
+    return String::format("%lli", n);
+#endif
+}
+
+String String::number(unsigned long long n)
+{
+#if OS(WINDOWS) && !PLATFORM(QT)
+    return String::format("%I64u", n);
+#else
+    return String::format("%llu", n);
+#endif
+}
+    
+String String::number(double n)
+{
+    return String::format("%.6lg", n);
+}
+
+int String::toIntStrict(bool* ok, int base) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toIntStrict(ok, base);
+}
+
+unsigned String::toUIntStrict(bool* ok, int base) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toUIntStrict(ok, base);
+}
+
+int64_t String::toInt64Strict(bool* ok, int base) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toInt64Strict(ok, base);
+}
+
+uint64_t String::toUInt64Strict(bool* ok, int base) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toUInt64Strict(ok, base);
+}
+
+intptr_t String::toIntPtrStrict(bool* ok, int base) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toIntPtrStrict(ok, base);
+}
+
+
+int String::toInt(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toInt(ok);
+}
+
+unsigned String::toUInt(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toUInt(ok);
+}
+
+int64_t String::toInt64(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toInt64(ok);
+}
+
+uint64_t String::toUInt64(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toUInt64(ok);
+}
+
+intptr_t String::toIntPtr(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0;
+    }
+    return m_impl->toIntPtr(ok);
+}
+
+double String::toDouble(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0.0;
+    }
+    return m_impl->toDouble(ok);
+}
+
+float String::toFloat(bool* ok) const
+{
+    if (!m_impl) {
+        if (ok)
+            *ok = false;
+        return 0.0f;
+    }
+    return m_impl->toFloat(ok);
+}
+
+String String::threadsafeCopy() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->threadsafeCopy();
+}
+
+String String::crossThreadString() const
+{
+    if (!m_impl)
+        return String();
+    return m_impl->crossThreadString();
+}
+
+bool String::isEmpty() const
+{
+    return !m_impl || !m_impl->length();
+}
+
+void String::split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const
+{
+    result.clear();
+
+    int startPos = 0;
+    int endPos;
+    while ((endPos = find(separator, startPos)) != -1) {
+        if (allowEmptyEntries || startPos != endPos)
+            result.append(substring(startPos, endPos - startPos));
+        startPos = endPos + separator.length();
+    }
+    if (allowEmptyEntries || startPos != static_cast<int>(length()))
+        result.append(substring(startPos));
+}
+
+void String::split(const String& separator, Vector<String>& result) const
+{
+    return split(separator, false, result);
+}
+
+void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const
+{
+    result.clear();
+
+    int startPos = 0;
+    int endPos;
+    while ((endPos = find(separator, startPos)) != -1) {
+        if (allowEmptyEntries || startPos != endPos)
+            result.append(substring(startPos, endPos - startPos));
+        startPos = endPos + 1;
+    }
+    if (allowEmptyEntries || startPos != static_cast<int>(length()))
+        result.append(substring(startPos));
+}
+
+void String::split(UChar separator, Vector<String>& result) const
+{
+    return split(String(&separator, 1), false, result);
+}
+
+Vector<char> String::ascii() const
+{
+    if (m_impl) 
+        return m_impl->ascii();
+    
+    const char* nullMsg = "(null impl)";
+    Vector<char, 2048> buffer;
+    for (int i = 0; nullMsg[i]; ++i)
+        buffer.append(nullMsg[i]);
+    
+    buffer.append('\0');
+    return buffer;
+}
+
+CString String::latin1() const
+{
+    // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
+    // preserved, characters outside of this range are converted to '?'.
+
+    unsigned length = this->length();
+    const UChar* characters = this->characters();
+
+    char* characterBuffer;
+    CString result = CString::newUninitialized(length, characterBuffer);
+
+    for (unsigned i = 0; i < length; ++i) {
+        UChar ch = characters[i];
+        characterBuffer[i] = ch > 255 ? '?' : ch;
+    }
+
+    return result;
+}
+
+// Helper to write a three-byte UTF-8 code point to the buffer, caller must check room is available.
+static inline void putUTF8Triple(char*& buffer, UChar ch)
+{
+    ASSERT(ch >= 0x0800);
+    *buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0);
+    *buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80);
+    *buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
+}
+
+CString String::utf8() const
+{
+    unsigned length = this->length();
+    const UChar* characters = this->characters();
+
+    // Allocate a buffer big enough to hold all the characters
+    // (an individual UTF-16 UChar can only expand to 3 UTF-8 bytes).
+    // Optimization ideas, if we find this function is hot:
+    //  * We could speculatively create a CStringBuffer to contain 'length' 
+    //    characters, and resize if necessary (i.e. if the buffer contains
+    //    non-ascii characters). (Alternatively, scan the buffer first for
+    //    ascii characters, so we know this will be sufficient).
+    //  * We could allocate a CStringBuffer with an appropriate size to
+    //    have a good chance of being able to write the string into the
+    //    buffer without reallocing (say, 1.5 x length).
+    Vector<char, 1024> bufferVector(length * 3);
+
+    char* buffer = bufferVector.data();
+    ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), false);
+    ASSERT(result != sourceIllegal); // Only produced from strict conversion.
+    ASSERT(result != targetExhausted); // (length * 3) should be sufficient for any conversion
+
+    // If a high surrogate is left unconverted, treat it the same was as an unpaired high surrogate
+    // would have been handled in the middle of a string with non-strict conversion - which is to say,
+    // simply encode it to UTF-8.
+    if (result == sourceExhausted) {
+        // This should be one unpaired high surrogate.
+        ASSERT((characters + 1) == (characters + length));
+        ASSERT((*characters >= 0xD800) && (*characters <= 0xDBFF));
+        // There should be room left, since one UChar hasn't been converted.
+        ASSERT((buffer + 3) <= (buffer + bufferVector.size()));
+        putUTF8Triple(buffer, *characters);
+    }
+
+    return CString(bufferVector.data(), buffer - bufferVector.data());
+}
+
+String String::fromUTF8(const char* stringStart, size_t length)
+{
+    if (!stringStart)
+        return String();
+
+    // We'll use a StringImpl as a buffer; if the source string only contains ascii this should be
+    // the right length, if there are any multi-byte sequences this buffer will be too large.
+    UChar* buffer;
+    String stringBuffer(StringImpl::createUninitialized(length, buffer));
+    UChar* bufferEnd = buffer + length;
+
+    // Try converting into the buffer.
+    const char* stringCurrent = stringStart;
+    if (convertUTF8ToUTF16(&stringCurrent, stringStart + length, &buffer, bufferEnd) != conversionOK)
+        return String();
+
+    // stringBuffer is full (the input must have been all ascii) so just return it!
+    if (buffer == bufferEnd)
+        return stringBuffer;
+
+    // stringBuffer served its purpose as a buffer, copy the contents out into a new string.
+    unsigned utf16Length = buffer - stringBuffer.characters();
+    ASSERT(utf16Length < length);
+    return String(stringBuffer.characters(), utf16Length);
+}
+
+String String::fromUTF8(const char* string)
+{
+    if (!string)
+        return String();
+    return fromUTF8(string, strlen(string));
+}
+
+String String::fromUTF8WithLatin1Fallback(const char* string, size_t size)
+{
+    String utf8 = fromUTF8(string, size);
+    if (!utf8)
+        return String(string, size);
+    return utf8;
+}
+
+// String Operations
+
+static bool isCharacterAllowedInBase(UChar c, int base)
+{
+    if (c > 0x7F)
+        return false;
+    if (isASCIIDigit(c))
+        return c - '0' < base;
+    if (isASCIIAlpha(c)) {
+        if (base > 36)
+            base = 36;
+        return (c >= 'a' && c < 'a' + base - 10)
+            || (c >= 'A' && c < 'A' + base - 10);
+    }
+    return false;
+}
+
+template <typename IntegralType>
+static inline IntegralType toIntegralType(const UChar* data, size_t length, bool* ok, int base)
+{
+    static const IntegralType integralMax = std::numeric_limits<IntegralType>::max();
+    static const bool isSigned = std::numeric_limits<IntegralType>::is_signed;
+    const IntegralType maxMultiplier = integralMax / base;
+
+    IntegralType value = 0;
+    bool isOk = false;
+    bool isNegative = false;
+
+    if (!data)
+        goto bye;
+
+    // skip leading whitespace
+    while (length && isSpaceOrNewline(*data)) {
+        length--;
+        data++;
+    }
+
+    if (isSigned && length && *data == '-') {
+        length--;
+        data++;
+        isNegative = true;
+    } else if (length && *data == '+') {
+        length--;
+        data++;
+    }
+
+    if (!length || !isCharacterAllowedInBase(*data, base))
+        goto bye;
+
+    while (length && isCharacterAllowedInBase(*data, base)) {
+        length--;
+        IntegralType digitValue;
+        UChar c = *data;
+        if (isASCIIDigit(c))
+            digitValue = c - '0';
+        else if (c >= 'a')
+            digitValue = c - 'a' + 10;
+        else
+            digitValue = c - 'A' + 10;
+
+        if (value > maxMultiplier || (value == maxMultiplier && digitValue > (integralMax % base) + isNegative))
+            goto bye;
+
+        value = base * value + digitValue;
+        data++;
+    }
+
+#if COMPILER(MSVC)
+#pragma warning(push, 0)
+#pragma warning(disable:4146)
+#endif
+
+    if (isNegative)
+        value = -value;
+
+#if COMPILER(MSVC)
+#pragma warning(pop)
+#endif
+
+    // skip trailing space
+    while (length && isSpaceOrNewline(*data)) {
+        length--;
+        data++;
+    }
+
+    if (!length)
+        isOk = true;
+bye:
+    if (ok)
+        *ok = isOk;
+    return isOk ? value : 0;
+}
+
+static unsigned lengthOfCharactersAsInteger(const UChar* data, size_t length)
+{
+    size_t i = 0;
+
+    // Allow leading spaces.
+    for (; i != length; ++i) {
+        if (!isSpaceOrNewline(data[i]))
+            break;
+    }
+    
+    // Allow sign.
+    if (i != length && (data[i] == '+' || data[i] == '-'))
+        ++i;
+    
+    // Allow digits.
+    for (; i != length; ++i) {
+        if (!isASCIIDigit(data[i]))
+            break;
+    }
+
+    return i;
+}
+
+int charactersToIntStrict(const UChar* data, size_t length, bool* ok, int base)
+{
+    return toIntegralType<int>(data, length, ok, base);
+}
+
+unsigned charactersToUIntStrict(const UChar* data, size_t length, bool* ok, int base)
+{
+    return toIntegralType<unsigned>(data, length, ok, base);
+}
+
+int64_t charactersToInt64Strict(const UChar* data, size_t length, bool* ok, int base)
+{
+    return toIntegralType<int64_t>(data, length, ok, base);
+}
+
+uint64_t charactersToUInt64Strict(const UChar* data, size_t length, bool* ok, int base)
+{
+    return toIntegralType<uint64_t>(data, length, ok, base);
+}
+
+intptr_t charactersToIntPtrStrict(const UChar* data, size_t length, bool* ok, int base)
+{
+    return toIntegralType<intptr_t>(data, length, ok, base);
+}
+
+int charactersToInt(const UChar* data, size_t length, bool* ok)
+{
+    return toIntegralType<int>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
+}
+
+unsigned charactersToUInt(const UChar* data, size_t length, bool* ok)
+{
+    return toIntegralType<unsigned>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
+}
+
+int64_t charactersToInt64(const UChar* data, size_t length, bool* ok)
+{
+    return toIntegralType<int64_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
+}
+
+uint64_t charactersToUInt64(const UChar* data, size_t length, bool* ok)
+{
+    return toIntegralType<uint64_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
+}
+
+intptr_t charactersToIntPtr(const UChar* data, size_t length, bool* ok)
+{
+    return toIntegralType<intptr_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
+}
+
+double charactersToDouble(const UChar* data, size_t length, bool* ok)
+{
+    if (!length) {
+        if (ok)
+            *ok = false;
+        return 0.0;
+    }
+
+    Vector<char, 256> bytes(length + 1);
+    for (unsigned i = 0; i < length; ++i)
+        bytes[i] = data[i] < 0x7F ? data[i] : '?';
+    bytes[length] = '\0';
+    char* end;
+    double val = WTF::strtod(bytes.data(), &end);
+    if (ok)
+        *ok = (end == 0 || *end == '\0');
+    return val;
+}
+
+float charactersToFloat(const UChar* data, size_t length, bool* ok)
+{
+    // FIXME: This will return ok even when the string fits into a double but not a float.
+    return static_cast<float>(charactersToDouble(data, length, ok));
+}
+
+} // namespace WebCore
+
+#ifndef NDEBUG
+// For use in the debugger - leaks memory
+WebCore::String* string(const char*);
+
+WebCore::String* string(const char* s)
+{
+    return new WebCore::String(s);
+}
+#endif
diff --git a/JavaScriptCore/wtf/text/WTFString.h b/JavaScriptCore/wtf/text/WTFString.h
new file mode 100644
index 0000000..7c3c2dd
--- /dev/null
+++ b/JavaScriptCore/wtf/text/WTFString.h
@@ -0,0 +1,398 @@
+/*
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * 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 WTFString_h
+#define WTFString_h
+
+// This file would be called String.h, but that conflicts with <string.h>
+// on systems without case-sensitive file systems.
+
+#include "StringImpl.h"
+
+#ifdef __OBJC__
+#include <objc/objc.h>
+#endif
+
+#if PLATFORM(CF)
+typedef const struct __CFString * CFStringRef;
+#endif
+
+#if PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QString;
+QT_END_NAMESPACE
+#include <QDataStream>
+#endif
+
+#if PLATFORM(WX)
+class wxString;
+#endif
+
+#if PLATFORM(HAIKU)
+class BString;
+#endif
+
+namespace WTF {
+class CString;
+}
+using WTF::CString;
+
+// FIXME: This is a temporary layering violation while we move string code to WTF.
+// Landing the file moves in one patch, will follow on with patches to change the namespaces.
+namespace WebCore {
+
+class SharedBuffer;
+struct StringHash;
+
+// Declarations of string operations
+
+bool charactersAreAllASCII(const UChar*, size_t);
+int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
+uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
+intptr_t charactersToIntPtrStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
+
+int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+unsigned charactersToUInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+int64_t charactersToInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+uint64_t charactersToUInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
+
+double charactersToDouble(const UChar*, size_t, bool* ok = 0);
+float charactersToFloat(const UChar*, size_t, bool* ok = 0);
+
+int find(const UChar*, size_t, UChar, int startPosition = 0);
+int reverseFind(const UChar*, size_t, UChar, int startPosition = -1);
+
+class String {
+public:
+    String() { } // gives null string, distinguishable from an empty string
+    String(const UChar*, unsigned length);
+    String(const UChar*); // Specifically for null terminated UTF-16
+    String(const char*);
+    String(const char*, unsigned length);
+    String(StringImpl* i) : m_impl(i) { }
+    String(PassRefPtr<StringImpl> i) : m_impl(i) { }
+    String(RefPtr<StringImpl> i) : m_impl(i) { }
+
+    void swap(String& o) { m_impl.swap(o.m_impl); }
+
+    // Hash table deleted values, which are only constructed and never copied or destroyed.
+    String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
+    bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
+
+    static String adopt(StringBuffer& buffer) { return StringImpl::adopt(buffer); }
+    static String adopt(Vector<UChar>& vector) { return StringImpl::adopt(vector); }
+
+    unsigned length() const;
+    const UChar* characters() const;
+    const UChar* charactersWithNullTermination();
+    
+    UChar operator[](unsigned i) const; // if i >= length(), returns 0    
+    UChar32 characterStartingAt(unsigned) const; // Ditto.
+    
+    bool contains(UChar c) const { return find(c) != -1; }
+    bool contains(const char* str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
+    bool contains(const String& str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
+
+    int find(UChar c, int start = 0) const
+        { return m_impl ? m_impl->find(c, start) : -1; }
+    int find(CharacterMatchFunctionPtr matchFunction, int start = 0) const
+        { return m_impl ? m_impl->find(matchFunction, start) : -1; }
+    int find(const char* str, int start = 0, bool caseSensitive = true) const
+        { return m_impl ? m_impl->find(str, start, caseSensitive) : -1; }
+    int find(const String& str, int start = 0, bool caseSensitive = true) const
+        { return m_impl ? m_impl->find(str.impl(), start, caseSensitive) : -1; }
+
+    int reverseFind(UChar c, int start = -1) const
+        { return m_impl ? m_impl->reverseFind(c, start) : -1; }
+    int reverseFind(const String& str, int start = -1, bool caseSensitive = true) const
+        { return m_impl ? m_impl->reverseFind(str.impl(), start, caseSensitive) : -1; }
+    
+    bool startsWith(const String& s, bool caseSensitive = true) const
+        { return m_impl ? m_impl->startsWith(s.impl(), caseSensitive) : s.isEmpty(); }
+    bool endsWith(const String& s, bool caseSensitive = true) const
+        { return m_impl ? m_impl->endsWith(s.impl(), caseSensitive) : s.isEmpty(); }
+
+    void append(const String&);
+    void append(char);
+    void append(UChar);
+    void append(const UChar*, unsigned length);
+    void insert(const String&, unsigned pos);
+    void insert(const UChar*, unsigned length, unsigned pos);
+
+    String& replace(UChar a, UChar b) { if (m_impl) m_impl = m_impl->replace(a, b); return *this; }
+    String& replace(UChar a, const String& b) { if (m_impl) m_impl = m_impl->replace(a, b.impl()); return *this; }
+    String& replace(const String& a, const String& b) { if (m_impl) m_impl = m_impl->replace(a.impl(), b.impl()); return *this; }
+    String& replace(unsigned index, unsigned len, const String& b) { if (m_impl) m_impl = m_impl->replace(index, len, b.impl()); return *this; }
+
+    void makeLower() { if (m_impl) m_impl = m_impl->lower(); }
+    void makeUpper() { if (m_impl) m_impl = m_impl->upper(); }
+    void makeSecure(UChar aChar) { if (m_impl) m_impl = m_impl->secure(aChar); }
+
+    void truncate(unsigned len);
+    void remove(unsigned pos, int len = 1);
+
+    String substring(unsigned pos, unsigned len = UINT_MAX) const;
+    String left(unsigned len) const { return substring(0, len); }
+    String right(unsigned len) const { return substring(length() - len, len); }
+
+    // Returns a lowercase/uppercase version of the string
+    String lower() const;
+    String upper() const;
+
+    String stripWhiteSpace() const;
+    String simplifyWhiteSpace() const;
+
+    String removeCharacters(CharacterMatchFunctionPtr) const;
+
+    // Return the string with case folded for case insensitive comparison.
+    String foldCase() const;
+
+    static String number(short);
+    static String number(unsigned short);
+    static String number(int);
+    static String number(unsigned);
+    static String number(long);
+    static String number(unsigned long);
+    static String number(long long);
+    static String number(unsigned long long);
+    static String number(double);
+    
+    static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
+
+    // Returns an uninitialized string. The characters needs to be written
+    // into the buffer returned in data before the returned string is used.
+    // Failure to do this will have unpredictable results.
+    static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
+
+    void split(const String& separator, Vector<String>& result) const;
+    void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
+    void split(UChar separator, Vector<String>& result) const;
+    void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
+
+    int toIntStrict(bool* ok = 0, int base = 10) const;
+    unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
+    int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
+    uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
+    intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
+
+    int toInt(bool* ok = 0) const;
+    unsigned toUInt(bool* ok = 0) const;
+    int64_t toInt64(bool* ok = 0) const;
+    uint64_t toUInt64(bool* ok = 0) const;
+    intptr_t toIntPtr(bool* ok = 0) const;
+    double toDouble(bool* ok = 0) const;
+    float toFloat(bool* ok = 0) const;
+
+    bool percentage(int& percentage) const;
+
+    // Returns a StringImpl suitable for use on another thread.
+    String crossThreadString() const;
+    // Makes a deep copy. Helpful only if you need to use a String on another thread
+    // (use crossThreadString if the method call doesn't need to be threadsafe).
+    // Since the underlying StringImpl objects are immutable, there's no other reason
+    // to ever prefer copy() over plain old assignment.
+    String threadsafeCopy() const;
+
+    bool isNull() const { return !m_impl; }
+    bool isEmpty() const;
+
+    StringImpl* impl() const { return m_impl.get(); }
+
+#if PLATFORM(CF)
+    String(CFStringRef);
+    CFStringRef createCFString() const;
+#endif
+
+#ifdef __OBJC__
+    String(NSString*);
+    
+    // This conversion maps NULL to "", which loses the meaning of NULL, but we 
+    // need this mapping because AppKit crashes when passed nil NSStrings.
+    operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
+#endif
+
+#if PLATFORM(QT)
+    String(const QString&);
+    String(const QStringRef&);
+    operator QString() const;
+#endif
+
+#if PLATFORM(WX)
+    String(const wxString&);
+    operator wxString() const;
+#endif
+
+#if PLATFORM(HAIKU)
+    String(const BString&);
+    operator BString() const;
+#endif
+
+    Vector<char> ascii() const;
+
+    CString latin1() const;
+    CString utf8() const;
+
+    static String fromUTF8(const char*, size_t);
+    static String fromUTF8(const char*);
+
+    // Tries to convert the passed in string to UTF-8, but will fall back to Latin-1 if the string is not valid UTF-8.
+    static String fromUTF8WithLatin1Fallback(const char*, size_t);
+    
+    // Determines the writing direction using the Unicode Bidi Algorithm rules P2 and P3.
+    WTF::Unicode::Direction defaultWritingDirection() const { return m_impl ? m_impl->defaultWritingDirection() : WTF::Unicode::LeftToRight; }
+
+    bool containsOnlyASCII() const { return charactersAreAllASCII(characters(), length()); }
+
+private:
+    RefPtr<StringImpl> m_impl;
+};
+
+#if PLATFORM(QT)
+QDataStream& operator<<(QDataStream& stream, const String& str);
+QDataStream& operator>>(QDataStream& stream, String& str);
+#endif
+
+String operator+(const String&, const String&);
+String operator+(const String&, const char*);
+String operator+(const char*, const String&);
+
+inline String& operator+=(String& a, const String& b) { a.append(b); return a; }
+
+inline bool operator==(const String& a, const String& b) { return equal(a.impl(), b.impl()); }
+inline bool operator==(const String& a, const char* b) { return equal(a.impl(), b); }
+inline bool operator==(const char* a, const String& b) { return equal(a, b.impl()); }
+
+inline bool operator!=(const String& a, const String& b) { return !equal(a.impl(), b.impl()); }
+inline bool operator!=(const String& a, const char* b) { return !equal(a.impl(), b); }
+inline bool operator!=(const char* a, const String& b) { return !equal(a, b.impl()); }
+
+inline bool equalIgnoringCase(const String& a, const String& b) { return equalIgnoringCase(a.impl(), b.impl()); }
+inline bool equalIgnoringCase(const String& a, const char* b) { return equalIgnoringCase(a.impl(), b); }
+inline bool equalIgnoringCase(const char* a, const String& b) { return equalIgnoringCase(a, b.impl()); }
+
+inline bool equalPossiblyIgnoringCase(const String& a, const String& b, bool ignoreCase) 
+{
+    return ignoreCase ? equalIgnoringCase(a, b) : (a == b);
+}
+
+inline bool equalIgnoringNullity(const String& a, const String& b) { return equalIgnoringNullity(a.impl(), b.impl()); }
+
+inline bool operator!(const String& str) { return str.isNull(); }
+
+inline void swap(String& a, String& b) { a.swap(b); }
+
+// Definitions of string operations
+
+#ifdef __OBJC__
+// This is for situations in WebKit where the long standing behavior has been
+// "nil if empty", so we try to maintain longstanding behavior for the sake of
+// entrenched clients
+inline NSString* nsStringNilIfEmpty(const String& str) {  return str.isEmpty() ? nil : (NSString*)str; }
+#endif
+
+inline bool charactersAreAllASCII(const UChar* characters, size_t length)
+{
+    UChar ored = 0;
+    for (size_t i = 0; i < length; ++i)
+        ored |= characters[i];
+    return !(ored & 0xFF80);
+}
+
+inline int find(const UChar* characters, size_t length, UChar character, int startPosition)
+{
+    if (startPosition >= static_cast<int>(length))
+        return -1;
+    for (size_t i = startPosition; i < length; ++i) {
+        if (characters[i] == character)
+            return static_cast<int>(i);
+    }
+    return -1;
+}
+
+inline int find(const UChar* characters, size_t length, CharacterMatchFunctionPtr matchFunction, int startPosition)
+{
+    if (startPosition >= static_cast<int>(length))
+        return -1;
+    for (size_t i = startPosition; i < length; ++i) {
+        if (matchFunction(characters[i]))
+            return static_cast<int>(i);
+    }
+    return -1;
+}
+
+inline int reverseFind(const UChar* characters, size_t length, UChar character, int startPosition)
+{
+    if (startPosition >= static_cast<int>(length) || !length)
+        return -1;
+    if (startPosition < 0)
+        startPosition += static_cast<int>(length);
+    while (true) {
+        if (characters[startPosition] == character)
+            return startPosition;
+        if (!startPosition)
+            return -1;
+        startPosition--;
+    }
+    ASSERT_NOT_REACHED();
+    return -1;
+}
+
+inline void append(Vector<UChar>& vector, const String& string)
+{
+    vector.append(string.characters(), string.length());
+}
+
+inline void appendNumber(Vector<UChar>& vector, unsigned char number)
+{
+    int numberLength = number > 99 ? 3 : (number > 9 ? 2 : 1);
+    size_t vectorSize = vector.size();
+    vector.grow(vectorSize + numberLength);
+
+    switch (numberLength) {
+    case 3:
+        vector[vectorSize + 2] = number % 10 + '0';
+        number /= 10;
+
+    case 2:
+        vector[vectorSize + 1] = number % 10 + '0';
+        number /= 10;
+
+    case 1:
+        vector[vectorSize] = number % 10 + '0';
+    }
+}
+
+} // namespace WebCore
+
+namespace WTF {
+
+    // StringHash is the default hash for String
+    template<typename T> struct DefaultHash;
+    template<> struct DefaultHash<WebCore::String> {
+        typedef WebCore::StringHash Hash;
+    };
+
+}
+
+#endif
diff --git a/JavaScriptCore/wtf/unicode/Collator.h b/JavaScriptCore/wtf/unicode/Collator.h
index 51e8a06..fe6a809 100644
--- a/JavaScriptCore/wtf/unicode/Collator.h
+++ b/JavaScriptCore/wtf/unicode/Collator.h
@@ -29,8 +29,8 @@
 #ifndef WTF_Collator_h
 #define WTF_Collator_h
 
-#include <memory>
 #include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/unicode/Unicode.h>
 
 #if USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION
@@ -47,7 +47,7 @@
         ~Collator();
         void setOrderLowerFirst(bool);
 
-        static std::auto_ptr<Collator> userDefault();
+        static PassOwnPtr<Collator> userDefault();
 
         Result collate(const ::UChar*, size_t, const ::UChar*, size_t) const;
 
diff --git a/JavaScriptCore/wtf/unicode/CollatorDefault.cpp b/JavaScriptCore/wtf/unicode/CollatorDefault.cpp
index eddbe53..4e05432 100644
--- a/JavaScriptCore/wtf/unicode/CollatorDefault.cpp
+++ b/JavaScriptCore/wtf/unicode/CollatorDefault.cpp
@@ -45,9 +45,9 @@
 {
 }
 
-std::auto_ptr<Collator> Collator::userDefault()
+PassOwnPtr<Collator> Collator::userDefault()
 {
-    return std::auto_ptr<Collator>(new Collator(0));
+    return new Collator(0);
 }
 
 // A default implementation for platforms that lack Unicode-aware collation.
diff --git a/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h b/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
index d72e707..46b00ea 100644
--- a/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
+++ b/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
@@ -26,7 +26,7 @@
 #define UnicodeGLib_h
 
 #include "UnicodeMacrosFromICU.h"
-#include <wtf/gtk/GOwnPtr.h>
+#include "GOwnPtr.h"
 
 #include <glib.h>
 #include <pango/pango.h>
diff --git a/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp b/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
index a1753a4..ecab5bd 100644
--- a/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
+++ b/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp
@@ -57,7 +57,7 @@
 {
 }
 
-std::auto_ptr<Collator> Collator::userDefault()
+PassOwnPtr<Collator> Collator::userDefault()
 {
 #if OS(DARWIN) && PLATFORM(CF)
     // Mac OS X doesn't set UNIX locale to match user-selected one, so ICU default doesn't work.
@@ -71,11 +71,11 @@
     char buf[256];
     if (collationOrder) {
         CFStringGetCString(collationOrder, buf, sizeof(buf), kCFStringEncodingASCII);
-        return std::auto_ptr<Collator>(new Collator(buf));
+        return new Collator(buf);
     } else
-        return std::auto_ptr<Collator>(new Collator(""));
+        return new Collator("");
 #else
-    return std::auto_ptr<Collator>(new Collator(0));
+    return new Collator(0);
 #endif
 }
 
diff --git a/JavaScriptCore/yarr/RegexCompiler.cpp b/JavaScriptCore/yarr/RegexCompiler.cpp
index 9cd3d12..9fbe213 100644
--- a/JavaScriptCore/yarr/RegexCompiler.cpp
+++ b/JavaScriptCore/yarr/RegexCompiler.cpp
@@ -36,6 +36,8 @@
 
 namespace JSC { namespace Yarr {
 
+#include "RegExpJitTables.h"
+
 class CharacterClassConstructor {
 public:
     CharacterClassConstructor(bool isCaseInsensitive = false)
@@ -141,7 +143,7 @@
 
     CharacterClass* charClass()
     {
-        CharacterClass* characterClass = new CharacterClass();
+        CharacterClass* characterClass = new CharacterClass(0);
 
         characterClass->m_matches.append(m_matches);
         characterClass->m_ranges.append(m_ranges);
@@ -233,105 +235,6 @@
     Vector<CharacterRange> m_rangesUnicode;
 };
 
-
-CharacterClass* newlineCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_matches.append('\n');
-    characterClass->m_matches.append('\r');
-    characterClass->m_matchesUnicode.append(0x2028);
-    characterClass->m_matchesUnicode.append(0x2029);
-    
-    return characterClass;
-}
-
-CharacterClass* digitsCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_ranges.append(CharacterRange('0', '9'));
-    
-    return characterClass;
-}
-
-CharacterClass* spacesCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_matches.append(' ');
-    characterClass->m_ranges.append(CharacterRange('\t', '\r'));
-    characterClass->m_matchesUnicode.append(0x00a0);
-    characterClass->m_matchesUnicode.append(0x1680);
-    characterClass->m_matchesUnicode.append(0x180e);
-    characterClass->m_matchesUnicode.append(0x2028);
-    characterClass->m_matchesUnicode.append(0x2029);
-    characterClass->m_matchesUnicode.append(0x202f);
-    characterClass->m_matchesUnicode.append(0x205f);
-    characterClass->m_matchesUnicode.append(0x3000);
-    characterClass->m_rangesUnicode.append(CharacterRange(0x2000, 0x200a));
-    
-    return characterClass;
-}
-
-CharacterClass* wordcharCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_matches.append('_');
-    characterClass->m_ranges.append(CharacterRange('0', '9'));
-    characterClass->m_ranges.append(CharacterRange('A', 'Z'));
-    characterClass->m_ranges.append(CharacterRange('a', 'z'));
-    
-    return characterClass;
-}
-
-CharacterClass* nondigitsCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_ranges.append(CharacterRange(0, '0' - 1));
-    characterClass->m_ranges.append(CharacterRange('9' + 1, 0x7f));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x80, 0xffff));
-    
-    return characterClass;
-}
-
-CharacterClass* nonspacesCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_ranges.append(CharacterRange(0, '\t' - 1));
-    characterClass->m_ranges.append(CharacterRange('\r' + 1, ' ' - 1));
-    characterClass->m_ranges.append(CharacterRange(' ' + 1, 0x7f));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x0080, 0x009f));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x00a1, 0x167f));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x1681, 0x180d));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x180f, 0x1fff));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x200b, 0x2027));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x202a, 0x202e));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x2030, 0x205e));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x2060, 0x2fff));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x3001, 0xffff));
-    
-    return characterClass;
-}
-
-CharacterClass* nonwordcharCreate()
-{
-    CharacterClass* characterClass = new CharacterClass();
-
-    characterClass->m_matches.append('`');
-    characterClass->m_ranges.append(CharacterRange(0, '0' - 1));
-    characterClass->m_ranges.append(CharacterRange('9' + 1, 'A' - 1));
-    characterClass->m_ranges.append(CharacterRange('Z' + 1, '_' - 1));
-    characterClass->m_ranges.append(CharacterRange('z' + 1, 0x7f));
-    characterClass->m_rangesUnicode.append(CharacterRange(0x80, 0xffff));
-
-    return characterClass;
-}
-
-
 class RegexPatternConstructor {
 public:
     RegexPatternConstructor(RegexPattern& pattern)
@@ -469,6 +372,7 @@
     void atomBackReference(unsigned subpatternId)
     {
         ASSERT(subpatternId);
+        m_pattern.m_shouldFallBack = true;
         m_pattern.m_maxBackReference = std::max(m_pattern.m_maxBackReference, subpatternId);
 
         if (subpatternId > m_pattern.m_numSubpatterns) {
@@ -544,6 +448,9 @@
             return;
         }
 
+        if (max > 1 && term.type == PatternTerm::TypeParenthesesSubpattern)
+            m_pattern.m_shouldFallBack = true;
+
         if (min == 0)
             term.quantify(max, greedy   ? QuantifierGreedy : QuantifierNonGreedy);
         else if (min == max)
diff --git a/JavaScriptCore/yarr/RegexCompiler.h b/JavaScriptCore/yarr/RegexCompiler.h
index 3ed2be9..9d2443a 100644
--- a/JavaScriptCore/yarr/RegexCompiler.h
+++ b/JavaScriptCore/yarr/RegexCompiler.h
@@ -26,13 +26,11 @@
 #ifndef RegexCompiler_h
 #define RegexCompiler_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(YARR)
 
-#include <wtf/unicode/Unicode.h>
 #include "RegexParser.h"
 #include "RegexPattern.h"
+#include <wtf/unicode/Unicode.h>
 
 namespace JSC { namespace Yarr {
 
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index d088086..c2cb1c2 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -280,20 +280,6 @@
         return false;
     }
 
-    bool tryConsumeCharacter(int testChar)
-    {
-        if (input.atEnd())
-            return false;
-
-        int ch = input.read();
-
-        if (pattern->m_ignoreCase ? ((Unicode::toLower(testChar) == ch) || (Unicode::toUpper(testChar) == ch)) : (testChar == ch)) {
-            input.next();
-            return true;
-        }
-        return false;
-    }
-
     bool checkCharacter(int testChar, int inputPosition)
     {
         return testChar == input.readChecked(inputPosition);
@@ -305,23 +291,6 @@
         return (loChar == ch) || (hiChar == ch);
     }
 
-    bool tryConsumeCharacterClass(CharacterClass* characterClass, bool invert)
-    {
-        if (input.atEnd())
-            return false;
-
-        bool match = testCharacterClass(characterClass, input.read());
-
-        if (invert)
-            match = !match;
-
-        if (match) {
-            input.next();
-            return true;
-        }
-        return false;
-    }
-
     bool checkCharacterClass(CharacterClass* characterClass, bool invert, int inputPosition)
     {
         bool match = testCharacterClass(characterClass, input.readChecked(inputPosition));
diff --git a/JavaScriptCore/yarr/RegexInterpreter.h b/JavaScriptCore/yarr/RegexInterpreter.h
index 48c9a5e..e3c3122 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.h
+++ b/JavaScriptCore/yarr/RegexInterpreter.h
@@ -26,13 +26,11 @@
 #ifndef RegexInterpreter_h
 #define RegexInterpreter_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(YARR)
 
-#include <wtf/unicode/Unicode.h>
 #include "RegexParser.h"
 #include "RegexPattern.h"
+#include <wtf/unicode/Unicode.h>
 
 namespace JSC { namespace Yarr {
 
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index fcb8d86..340b53d 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -40,7 +40,6 @@
 
 namespace JSC { namespace Yarr {
 
-
 class RegexGenerator : private MacroAssembler {
     friend void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
 
@@ -54,6 +53,16 @@
     static const RegisterID regT1 = ARMRegisters::r6;
 
     static const RegisterID returnRegister = ARMRegisters::r0;
+#elif CPU(MIPS)
+    static const RegisterID input = MIPSRegisters::a0;
+    static const RegisterID index = MIPSRegisters::a1;
+    static const RegisterID length = MIPSRegisters::a2;
+    static const RegisterID output = MIPSRegisters::a3;
+
+    static const RegisterID regT0 = MIPSRegisters::t4;
+    static const RegisterID regT1 = MIPSRegisters::t5;
+
+    static const RegisterID returnRegister = MIPSRegisters::v0;
 #elif CPU(X86)
     static const RegisterID input = X86Registers::eax;
     static const RegisterID index = X86Registers::edx;
@@ -145,6 +154,11 @@
 
     void matchCharacterClass(RegisterID character, JumpList& matchDest, const CharacterClass* charClass)
     {
+        if (charClass->m_table) {
+            ExtendedAddress tableEntry(character, reinterpret_cast<intptr_t>(charClass->m_table->m_table));
+            matchDest.append(branchTest8(charClass->m_table->m_inverted ? Zero : NonZero, tableEntry));   
+            return;
+        }
         Jump unicodeFail;
         if (charClass->m_matchesUnicode.size() || charClass->m_rangesUnicode.size()) {
             Jump isAscii = branch32(LessThanOrEqual, character, Imm32(0x7f));
@@ -599,9 +613,14 @@
             ASSERT(!m_pattern.m_ignoreCase || (Unicode::toLower(ch) == Unicode::toUpper(ch)));
             failures.append(jumpIfCharNotEquals(ch, state.inputOffset()));
         }
+
         add32(Imm32(1), countRegister);
         add32(Imm32(1), index);
-        branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
+        if (term.quantityCount != 0xffffffff)
+            branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
+        else
+            jump(loop);
+
         failures.append(jump());
 
         Label backtrackBegin(this);
@@ -636,7 +655,8 @@
         loadFromFrame(term.frameLocation, countRegister);
 
         atEndOfInput().linkTo(hardFail, this);
-        branch32(Equal, countRegister, Imm32(term.quantityCount), hardFail);
+        if (term.quantityCount != 0xffffffff)
+            branch32(Equal, countRegister, Imm32(term.quantityCount), hardFail);
         if (m_pattern.m_ignoreCase && isASCIIAlpha(ch)) {
             readCharacter(state.inputOffset(), character);
             or32(Imm32(32), character);
@@ -722,7 +742,11 @@
 
         add32(Imm32(1), countRegister);
         add32(Imm32(1), index);
-        branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
+        if (term.quantityCount != 0xffffffff)
+            branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
+        else
+            jump(loop);
+
         failures.append(jump());
 
         Label backtrackBegin(this);
@@ -1078,17 +1102,15 @@
             break;
 
         case PatternTerm::TypeBackReference:
-            m_generationFailed = true;
+            ASSERT_NOT_REACHED();
             break;
 
         case PatternTerm::TypeForwardReference:
             break;
 
         case PatternTerm::TypeParenthesesSubpattern:
-            if ((term.quantityCount == 1) && !term.parentheses.isCopy)
-                generateParenthesesSingle(state);
-            else
-                m_generationFailed = true;
+            ASSERT((term.quantityCount == 1) && !term.parentheses.isCopy); // must fallback to pcre before this point
+            generateParenthesesSingle(state);
             break;
 
         case PatternTerm::TypeParentheticalAssertion:
@@ -1313,6 +1335,8 @@
         push(ARMRegisters::r5);
         push(ARMRegisters::r6);
         move(ARMRegisters::r3, output);
+#elif CPU(MIPS)
+        // Do nothing.
 #endif
     }
 
@@ -1330,6 +1354,8 @@
         pop(ARMRegisters::r6);
         pop(ARMRegisters::r5);
         pop(ARMRegisters::r4);
+#elif CPU(MIPS)
+        // Do nothing
 #endif
         ret();
     }
@@ -1337,7 +1363,6 @@
 public:
     RegexGenerator(RegexPattern& pattern)
         : m_pattern(pattern)
-        , m_generationFailed(false)
     {
     }
 
@@ -1367,15 +1392,9 @@
         jitObject.set(patchBuffer.finalizeCode());
     }
 
-    bool generationFailed()
-    {
-        return m_generationFailed;
-    }
-
 private:
     RegexPattern& m_pattern;
     Vector<AlternativeBacktrackRecord> m_backtrackRecords;
-    bool m_generationFailed;
 };
 
 void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& patternString, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline)
@@ -1387,13 +1406,13 @@
 
     numSubpatterns = pattern.m_numSubpatterns;
 
-    RegexGenerator generator(pattern);
-    generator.compile(globalData, jitObject);
-
-    if (generator.generationFailed()) {
+    if (pattern.m_shouldFallBack) {
         JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
         JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine;
         jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
+    } else {
+        RegexGenerator generator(pattern);
+        generator.compile(globalData, jitObject);
     }
 }
 
diff --git a/JavaScriptCore/yarr/RegexJIT.h b/JavaScriptCore/yarr/RegexJIT.h
index 935b9a3..7f9c16e 100644
--- a/JavaScriptCore/yarr/RegexJIT.h
+++ b/JavaScriptCore/yarr/RegexJIT.h
@@ -26,8 +26,6 @@
 #ifndef RegexJIT_h
 #define RegexJIT_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(YARR_JIT)
 
 #include "MacroAssembler.h"
@@ -68,7 +66,7 @@
     JSRegExp* getFallback() { return m_fallback; }
     void setFallback(JSRegExp* fallback) { m_fallback = fallback; }
 
-    bool operator!() { return !m_ref.m_code.executableAddress(); }
+    bool operator!() { return (!m_ref.m_code.executableAddress() && !m_fallback); }
     void set(MacroAssembler::CodeRef ref) { m_ref = ref; }
 
     int execute(const UChar* input, unsigned start, unsigned length, int* output)
diff --git a/JavaScriptCore/yarr/RegexParser.h b/JavaScriptCore/yarr/RegexParser.h
index 64e8463..c946c2e 100644
--- a/JavaScriptCore/yarr/RegexParser.h
+++ b/JavaScriptCore/yarr/RegexParser.h
@@ -26,14 +26,12 @@
 #ifndef RegexParser_h
 #define RegexParser_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(YARR)
 
 #include <UString.h>
+#include <limits.h>
 #include <wtf/ASCIICType.h>
 #include <wtf/unicode/Unicode.h>
-#include <limits.h>
 
 namespace JSC { namespace Yarr {
 
diff --git a/JavaScriptCore/yarr/RegexPattern.h b/JavaScriptCore/yarr/RegexPattern.h
index dd7512d..3271cc1 100644
--- a/JavaScriptCore/yarr/RegexPattern.h
+++ b/JavaScriptCore/yarr/RegexPattern.h
@@ -26,7 +26,6 @@
 #ifndef RegexPattern_h
 #define RegexPattern_h
 
-#include <wtf/Platform.h>
 
 #if ENABLE(YARR)
 
@@ -57,11 +56,35 @@
     }
 };
 
+struct CharacterClassTable : RefCounted<CharacterClassTable> {
+    const char* m_table;
+    bool m_inverted;
+    static PassRefPtr<CharacterClassTable> create(const char* table, bool inverted)
+    {
+        return adoptRef(new CharacterClassTable(table, inverted));
+    }
+
+private:
+    CharacterClassTable(const char* table, bool inverted)
+        : m_table(table)
+        , m_inverted(inverted)
+    {
+    }
+};
+
 struct CharacterClass : FastAllocBase {
+    // All CharacterClass instances have to have the full set of matches and ranges,
+    // they may have an optional table for faster lookups (which must match the
+    // specified matches and ranges)
+    CharacterClass(PassRefPtr<CharacterClassTable> table)
+        : m_table(table)
+    {
+    }
     Vector<UChar> m_matches;
     Vector<CharacterRange> m_ranges;
     Vector<UChar> m_matchesUnicode;
     Vector<CharacterRange> m_rangesUnicode;
+    RefPtr<CharacterClassTable> m_table;
 };
 
 enum QuantifierType {
@@ -248,6 +271,7 @@
         , m_multiline(multiline)
         , m_numSubpatterns(0)
         , m_maxBackReference(0)
+        , m_shouldFallBack(false)
         , newlineCached(0)
         , digitsCached(0)
         , spacesCached(0)
@@ -269,6 +293,8 @@
         m_numSubpatterns = 0;
         m_maxBackReference = 0;
 
+        m_shouldFallBack = false;
+
         newlineCached = 0;
         digitsCached = 0;
         spacesCached = 0;
@@ -335,6 +361,7 @@
     bool m_multiline;
     unsigned m_numSubpatterns;
     unsigned m_maxBackReference;
+    bool m_shouldFallBack;
     PatternDisjunction* m_body;
     Vector<PatternDisjunction*, 4> m_disjunctions;
     Vector<CharacterClass*> m_userCharacterClasses;
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index df8b3ec..69a8208 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,146 @@
+2010-04-21  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7879485> Leopard: Crash after opening Software Update dialog
+
+        * JSUtils.cpp:
+        (unprotectGlobalObject): Use the version of JSGlueAPIEntry that doesn't
+        call pthread_getspecific, since it's not safe to call pthread_getspecific
+        from a thread-specific data destructor. (<rdar://problem/7889842>
+        pthread_getspecific returns 0 when called from thread-specific data
+        destructor function)
+
+        (getThreadGlobalObject): Make sure to set the currentIdentifierTable
+        when first constructing our JSGlobalObject, since JSGlueAPIEntry has not
+        yet had an opportunity to do so.
+
+        (JSGlueAPIEntry::JSGlueAPIEntry):
+        * JSUtils.h: New version of JSGlueAPIEntry that doesn't call
+        pthread_getspecific.
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+        Errk! tree on fire, add fwd!
+
+        * ForwardingHeaders/wtf/text/StringHash.h: Added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt, Darin Adler.
+
+        Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
+        Add forwarding header.
+
+        * ForwardingHeaders/wtf/ASCIICType.h: Added.
+        * ForwardingHeaders/wtf/text/StringImpl.h: Added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 37895 - Share common code from UStringImplBase with StringImpl
+        Add forwarding header.
+
+        * ForwardingHeaders/wtf/text/StringImplBase.h: Added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Maciej Stachowiak (relanding r57829).
+        Added missing JS_EXPORTDATA
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/WTFThreadData.h.
+        * JSUtils.cpp:
+        (JSGlueAPIEntry::JSGlueAPIEntry):
+        (JSGlueAPIEntry::~JSGlueAPIEntry):
+        (JSGlueAPICallback::JSGlueAPICallback):
+        (JSGlueAPICallback::~JSGlueAPICallback):
+
+2010-04-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (rolling out r57829).
+        This broke windows.
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Removed.
+        * JSUtils.cpp:
+        (JSGlueAPIEntry::JSGlueAPIEntry):
+        (JSGlueAPIEntry::~JSGlueAPIEntry):
+        (JSGlueAPICallback::JSGlueAPICallback):
+        (JSGlueAPICallback::~JSGlueAPICallback):
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37745
+        Move string uniquing tables to (new) WTFThreadData class.
+
+        Remove AtomicString's dependency on ThreadGlobalData so that we can move
+        WebCore's string classes up to WTF.
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Added.
+        * JSUtils.cpp: Update 
+        (JSGlueAPIEntry::JSGlueAPIEntry):
+        (JSGlueAPIEntry::~JSGlueAPIEntry):
+        (JSGlueAPICallback::JSGlueAPICallback):
+        (JSGlueAPICallback::~JSGlueAPICallback):
+
+2010-03-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36871 - Remove JSC::CString
+        Use WTF::CString instead (which until recently was WebCore::CString).
+
+        * ForwardingHeaders/wtf/text: Added.
+        * ForwardingHeaders/wtf/text/CString.h: Added.
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by David Kilzer.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+        * Configurations/Base.xcconfig:
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
+        current Mac OS X version unless otherwise specified.
+
+        Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+        Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+        may not be usable when targetting a different Mac OS X version.
+
+        Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+        MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/DebugRelease.xcconfig:
+        * Configurations/Version.xcconfig:
+        * JavaScriptGlue.xcodeproj/project.pbxproj:
+
+2010-03-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Refactor named getter function signature to be in line with indexing getter signature
+        https://bugs.webkit.org/show_bug.cgi?id=35563
+
+        Fix method signature and update code as appropriate
+
+        * UserObjectImp.cpp:
+        (UserObjectImp::userObjectGetter):
+        * UserObjectImp.h:
+
 2010-02-09  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/JavaScriptGlue/Configurations/Base.xcconfig b/JavaScriptGlue/Configurations/Base.xcconfig
index 6f28a0d..ab6988a 100644
--- a/JavaScriptGlue/Configurations/Base.xcconfig
+++ b/JavaScriptGlue/Configurations/Base.xcconfig
@@ -56,6 +56,7 @@
 WARNING_CFLAGS_x86_64 = $(WARNING_CFLAGS_BASE);
 HEADER_SEARCH_PATHS = . icu $(HEADER_SEARCH_PATHS);
 
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
 
 // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL and STRIP_INSTALLED_PRODUCT vary between the debug and normal variants.
 // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -76,6 +77,26 @@
 // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
 // number.  Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
 // XCODE_VERSION_ACTUAL for the full version number.
-GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR));
-GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL));
-GCC_VERSION_0310 = 4.2;
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
diff --git a/JavaScriptGlue/Configurations/DebugRelease.xcconfig b/JavaScriptGlue/Configurations/DebugRelease.xcconfig
index a0ca127..764b4e1 100644
--- a/JavaScriptGlue/Configurations/DebugRelease.xcconfig
+++ b/JavaScriptGlue/Configurations/DebugRelease.xcconfig
@@ -23,7 +23,7 @@
 
 #include "Base.xcconfig"
 
-ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ARCHS_ = $(ARCHS_1040);
 ARCHS_1040 = $(NATIVE_ARCH);
 ARCHS_1050 = $(NATIVE_ARCH);
@@ -32,7 +32,7 @@
 
 ONLY_ACTIVE_ARCH = YES;
 
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 MACOSX_DEPLOYMENT_TARGET_ = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
diff --git a/JavaScriptGlue/Configurations/Version.xcconfig b/JavaScriptGlue/Configurations/Version.xcconfig
index 0e289b1..6aeb263 100644
--- a/JavaScriptGlue/Configurations/Version.xcconfig
+++ b/JavaScriptGlue/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 MAJOR_VERSION = 533;
-MINOR_VERSION = 1;
+MINOR_VERSION = 6;
 TINY_VERSION = 0;
 FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
 
@@ -31,7 +31,7 @@
 SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
 
 // The system version prefix is based on the current system version.
-SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
+SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR.
 SYSTEM_VERSION_PREFIX_1040 = 4;
 SYSTEM_VERSION_PREFIX_1050 = 5;
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/ASCIICType.h b/JavaScriptGlue/ForwardingHeaders/wtf/ASCIICType.h
new file mode 100644
index 0000000..f2258d2
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/ASCIICType.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/ASCIICType.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/WTFThreadData.h b/JavaScriptGlue/ForwardingHeaders/wtf/WTFThreadData.h
new file mode 100644
index 0000000..925b698
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/WTFThreadData.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/WTFThreadData.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/text/CString.h b/JavaScriptGlue/ForwardingHeaders/wtf/text/CString.h
new file mode 100644
index 0000000..50e766b
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/text/CString.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/CString.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/text/StringHash.h b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringHash.h
new file mode 100644
index 0000000..902082f
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringHash.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/StringHash.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImpl.h b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImpl.h
new file mode 100644
index 0000000..029ea84
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImpl.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/StringImpl.h>
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImplBase.h b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImplBase.h
new file mode 100644
index 0000000..7e0597b
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/text/StringImplBase.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/StringImplBase.h>
diff --git a/JavaScriptGlue/JSUtils.cpp b/JavaScriptGlue/JSUtils.cpp
index 67dba86..f2b7e64 100644
--- a/JavaScriptGlue/JSUtils.cpp
+++ b/JavaScriptGlue/JSUtils.cpp
@@ -36,6 +36,7 @@
 #include "UserObjectImp.h"
 #include <JavaScriptCore/JSString.h>
 #include <JavaScriptCore/PropertyNameArray.h>
+#include <JavaScriptCore/WTFThreadData.h>
 
 struct ObjectImpList {
     JSObject* imp;
@@ -394,8 +395,9 @@
 
 static void unprotectGlobalObject(void* data) 
 {
-    JSGlueAPIEntry entry;
-    gcUnprotect(static_cast<JSGlueGlobalObject*>(data));
+    JSGlobalObject* jsGlobalObject = static_cast<JSGlueGlobalObject*>(data);
+    JSGlueAPIEntry entry(jsGlobalObject);
+    gcUnprotect(jsGlobalObject);
 }
 
 static void initializeGlobalObjectKey()
@@ -408,8 +410,14 @@
     pthread_once(&globalObjectKeyOnce, initializeGlobalObjectKey);
     JSGlueGlobalObject* globalObject = static_cast<JSGlueGlobalObject*>(pthread_getspecific(globalObjectKey));
     if (!globalObject) {
-        globalObject = new (&JSGlobalData::sharedInstance()) JSGlueGlobalObject(JSGlueGlobalObject::createStructure(jsNull()));
+        JSGlobalData& globalData = JSGlobalData::sharedInstance();
+
+        IdentifierTable* storedIdentifierTable = wtfThreadData().currentIdentifierTable();
+        wtfThreadData().setCurrentIdentifierTable(globalData.identifierTable);
+        globalObject = new (&globalData) JSGlueGlobalObject(JSGlueGlobalObject::createStructure(jsNull()));
         gcProtect(globalObject);
+        wtfThreadData().setCurrentIdentifierTable(storedIdentifierTable);
+
         pthread_setspecific(globalObjectKey, globalObject);
     }
     return globalObject;
@@ -427,23 +435,30 @@
 
 JSGlueAPIEntry::JSGlueAPIEntry()
     : m_lock(LockForReal)
-    , m_storedIdentifierTable(currentIdentifierTable())
+    , m_storedIdentifierTable(wtfThreadData().currentIdentifierTable())
 {
-    setCurrentIdentifierTable(getThreadGlobalObject()->globalExec()->globalData().identifierTable);
+    wtfThreadData().setCurrentIdentifierTable(getThreadGlobalObject()->globalExec()->globalData().identifierTable);
+}
+
+JSGlueAPIEntry::JSGlueAPIEntry(JSGlobalObject* jsGlobalObject)
+    : m_lock(LockForReal)
+    , m_storedIdentifierTable(wtfThreadData().currentIdentifierTable())
+{
+    wtfThreadData().setCurrentIdentifierTable(jsGlobalObject->globalExec()->globalData().identifierTable);
 }
 
 JSGlueAPIEntry::~JSGlueAPIEntry()
 {
-    setCurrentIdentifierTable(m_storedIdentifierTable);
+    wtfThreadData().setCurrentIdentifierTable(m_storedIdentifierTable);
 }
 
 JSGlueAPICallback::JSGlueAPICallback(ExecState* exec)
     : m_dropLocks(exec)
 {
-    resetCurrentIdentifierTable();
+    wtfThreadData().resetCurrentIdentifierTable();
 }
 
 JSGlueAPICallback::~JSGlueAPICallback()
 {
-    setCurrentIdentifierTable(getThreadGlobalObject()->globalExec()->globalData().identifierTable);
+    wtfThreadData().setCurrentIdentifierTable(getThreadGlobalObject()->globalExec()->globalData().identifierTable);
 }
diff --git a/JavaScriptGlue/JSUtils.h b/JavaScriptGlue/JSUtils.h
index 05bce62..cbd9912 100644
--- a/JavaScriptGlue/JSUtils.h
+++ b/JavaScriptGlue/JSUtils.h
@@ -80,6 +80,7 @@
 class JSGlueAPIEntry {
 public:
     JSGlueAPIEntry();
+    JSGlueAPIEntry(JSGlobalObject*); // For use when it's not safe for JSGlueAPIEntry() to call getThreadGlobalObject() -- for example, from a thread-specific data destructor.
     ~JSGlueAPIEntry();
 
 private:
diff --git a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
index 36bde4a..f33bf97 100644
--- a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
+++ b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
@@ -355,7 +355,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if (( MAC_OS_X_VERSION_MAJOR > 1050 )); then\n   rm -rf \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"/*.h;\nfi;\n";
+			shellScript = "if (( TARGET_MAC_OS_X_VERSION_MAJOR > 1050 )); then\n   rm -rf \"$BUILT_PRODUCTS_DIR/$PUBLIC_HEADERS_FOLDER_PATH\"/*.h;\nfi;\n";
 		};
 		939D055E09DA033400984996 /* Check For Global Initializers */ = {
 			isa = PBXShellScriptBuildPhase;
diff --git a/JavaScriptGlue/UserObjectImp.cpp b/JavaScriptGlue/UserObjectImp.cpp
index 1fbb982..c188f75 100644
--- a/JavaScriptGlue/UserObjectImp.cpp
+++ b/JavaScriptGlue/UserObjectImp.cpp
@@ -112,9 +112,9 @@
     JSObject::getOwnPropertyNames(exec, propertyNames, mode);
 }
 
-JSValue UserObjectImp::userObjectGetter(ExecState*, const Identifier& propertyName, const PropertySlot& slot)
+JSValue UserObjectImp::userObjectGetter(ExecState*, JSValue slotBase, const Identifier& propertyName)
 {
-    UserObjectImp *thisObj = static_cast<UserObjectImp *>(asObject(slot.slotBase()));
+    UserObjectImp *thisObj = static_cast<UserObjectImp *>(asObject(slotBase));
     // getOwnPropertySlot should have guarded against a null fJSUserObject.
     assert(thisObj->fJSUserObject);
     
diff --git a/JavaScriptGlue/UserObjectImp.h b/JavaScriptGlue/UserObjectImp.h
index 6f857f9..e44c40e 100644
--- a/JavaScriptGlue/UserObjectImp.h
+++ b/JavaScriptGlue/UserObjectImp.h
@@ -65,7 +65,7 @@
     }
 
 private:
-    static JSValue userObjectGetter(ExecState*, const Identifier& propertyName, const PropertySlot&);
+    static JSValue userObjectGetter(ExecState*, JSValue, const Identifier& propertyName);
 
     JSUserObject* fJSUserObject;
 };
diff --git a/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt b/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
index 67db8dc..9f83f8f 100644
--- a/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
+++ b/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
@@ -9,6 +9,8 @@
 PASS lastEvent.touches.length is 2
 PASS lastEvent.changedTouches.length is 2
 PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.touches[0].pageX is 10
 PASS lastEvent.touches[0].pageY is 10
 PASS lastEvent.touches[0].clientX is 10
@@ -44,6 +46,8 @@
 PASS lastEvent.touches.length is 2
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.touches[0].pageX is 15
 PASS lastEvent.touches[0].pageY is 15
 PASS lastEvent.touches[0].clientX is 15
@@ -64,6 +68,8 @@
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.touches[0].pageX is 20
 PASS lastEvent.touches[0].pageY is 30
 PASS lastEvent.touches[0].clientX is 20
@@ -84,6 +90,8 @@
 PASS lastEvent.touches.length is 0
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.changedTouches[0].pageX is 20
 PASS lastEvent.changedTouches[0].pageY is 30
 PASS lastEvent.changedTouches[0].clientX is 20
diff --git a/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt b/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
index 634faa1..ec168cb 100644
--- a/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
+++ b/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
@@ -7,6 +7,8 @@
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.shiftKey is false
 PASS lastEvent.touches[0].target.id is "touchtarget"
 PASS lastEvent.touches[0].pageX is 10
@@ -28,6 +30,8 @@
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.touches[0].pageX is 20
 PASS lastEvent.touches[0].pageY is 15
 PASS lastEvent.touches[0].clientX is 20
@@ -41,6 +45,8 @@
 PASS lastEvent.touches.length is 0
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.changedTouches[0].pageX is 20
 PASS lastEvent.changedTouches[0].pageY is 15
 PASS lastEvent.changedTouches[0].clientX is 20
@@ -52,12 +58,16 @@
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
 PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
 PASS lastEvent.targetTouches[0].target.tagName is "DIV"
 PASS lastEvent.type is "touchmove"
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
-PASS lastEvent.targetTouches.length is 0
-PASS lastEvent.touches[0].target.tagName is "HTML"
+PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
+PASS lastEvent.touches[0].target.tagName is "DIV"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
index abfaf90..579c073 100644
--- a/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
+++ b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
@@ -37,6 +37,8 @@
     shouldBe("lastEvent.touches.length", totalTouchCount.toString());
     shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
     shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+    shouldBe("lastEvent.pageX", "0");
+    shouldBe("lastEvent.pageY", "0");
 }
 
 function verifyTouchPoint(list, point, x, y, id)
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
index ca99d83..9975c87 100644
--- a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
+++ b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
@@ -37,6 +37,8 @@
     shouldBe("lastEvent.touches.length", totalTouchCount.toString());
     shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
     shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+    shouldBe("lastEvent.pageX", "0");
+    shouldBe("lastEvent.pageY", "0");
 }
 
 function verifyTouchPoint(list, point, x, y, id)
@@ -77,8 +79,8 @@
             shouldBeEqualToString("lastEvent.targetTouches[0].target.tagName", "DIV");
         break;
         case 4:
-            verifyTouchEvent("touchmove", 1, 1, 0);
-            shouldBeEqualToString("lastEvent.touches[0].target.tagName", "HTML");
+            verifyTouchEvent("touchmove", 1, 1, 1);
+            shouldBeEqualToString("lastEvent.touches[0].target.tagName", "DIV");
         break;
 
         default: testFailed("Wrong number of touch events! (" + which + ")");
diff --git a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
index c83daa4..01eac2f 100644
--- a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
+++ b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
@@ -13,7 +13,6 @@
     shouldBe("cancelEvent.pageY", touchY.toString());
     if (window.layoutTestController) {
         layoutTestController.notifyDone();
-        isSuccessfullyParsed(); 
     }
 }
     
diff --git a/LayoutTests/fast/events/touch/script-tests/touch-target.js b/LayoutTests/fast/events/touch/script-tests/touch-target.js
new file mode 100644
index 0000000..0623811
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/touch-target.js
@@ -0,0 +1,97 @@
+var div1 = document.createElement("div");
+div1.id = "targetA";
+div1.style.width = "100px";
+div1.style.height = "100px";
+div1.style.backgroundColor = "blue";
+
+var div2 = document.createElement("div");
+div2.id = "targetB";
+div2.style.width = "100px";
+div2.style.height = "100px";
+div2.style.backgroundColor = "green";
+
+var touchStartCount = 0;
+var touchMoveCount = 0;
+
+document.getElementById('targetsDiv').appendChild(div1);
+document.getElementById('targetsDiv').appendChild(document.createElement('br'));
+document.getElementById('targetsDiv').appendChild(div2);
+
+function touchStartHandler()
+{
+    shouldBeEqualToString('event.type', 'touchstart');
+    switch (touchStartCount) {
+        case 0:
+            shouldBeEqualToString('event.touches[0].target.id', div1.id);
+            shouldBeEqualToString('event.touches[1].target.id', div2.id);
+            break;
+        case 1:
+            shouldBeEqualToString('event.touches[0].target.id', div2.id);
+            shouldBeEqualToString('event.touches[1].target.id', div1.id);
+            break;
+    }
+
+    touchStartCount++;
+}
+
+function touchMoveHandler()
+{
+    shouldBeEqualToString('event.type', 'touchmove');
+    switch (touchMoveCount) {
+        case 0:
+        case 1:
+            shouldBeEqualToString('event.touches[0].target.id', div1.id);
+            shouldBeEqualToString('event.touches[1].target.id', div2.id);
+            break;
+        case 2:
+            shouldBeEqualToString('event.touches[0].target.id', div2.id);
+            shouldBeEqualToString('event.touches[1].target.id', div1.id);
+            break;
+    }
+
+    if (++touchMoveCount == 3)
+    {
+        successfullyParsed = true;
+        layoutTestController.notifyDone();
+        isSuccessfullyParsed();
+    }
+}
+
+div1.addEventListener("touchstart", touchStartHandler, false);
+div1.addEventListener("touchmove", touchMoveHandler, false);
+
+div2.addEventListener("touchstart", touchStartHandler, false);
+div2.addEventListener("touchmove", touchMoveHandler, false);
+
+description("Tests that the target of touches match the element where the event originated, not where the touch is currently occurring.");
+
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+}
+
+if (window.eventSender) {
+    eventSender.clearTouchPoints();
+    eventSender.addTouchPoint(50, 150);
+    eventSender.addTouchPoint(50, 250);
+    eventSender.touchStart();
+
+    eventSender.updateTouchPoint(0, 50, 250);
+    eventSender.updateTouchPoint(1, 50, 150);
+    eventSender.touchMove();
+
+    eventSender.updateTouchPoint(0, 1000, 1000);
+    eventSender.updateTouchPoint(1, 1000, 1000);
+    eventSender.touchMove();
+
+    eventSender.releaseTouchPoint(0);
+    eventSender.touchEnd();
+
+    eventSender.addTouchPoint(50,150);
+    eventSender.touchStart();
+
+    eventSender.updateTouchPoint(0, 500, 500);
+    eventSender.updateTouchPoint(1, 500, 500);
+    eventSender.touchMove();
+} else
+    debug('This test requires DRT.');
+
diff --git a/LayoutTests/fast/events/touch/touch-target-expected.txt b/LayoutTests/fast/events/touch/touch-target-expected.txt
new file mode 100644
index 0000000..60a4c37
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target-expected.txt
@@ -0,0 +1,25 @@
+Tests that the target of touches match the element where the event originated, not where the touch is currently occurring.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-target.html b/LayoutTests/fast/events/touch/touch-target.html
new file mode 100644
index 0000000..dfd8dab
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="targetsDiv"></div>
+<div id="console"></div>
+<script src="script-tests/touch-target.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js b/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js
index 880aed4..eb01411 100644
--- a/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js
+++ b/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js
@@ -39,6 +39,9 @@
 descriptorShouldBe("Math.sin", "'name'", {writable: false, enumerable: false, configurable: false, value:"'sin'"});
 var global = this;
 descriptorShouldBe("global", "'global'", {writable: true, enumerable: true, configurable: false, value:"global"});
+descriptorShouldBe("global", "'undefined'", {writable: false, enumerable: false, configurable: false, value:"undefined"});
+descriptorShouldBe("global", "'NaN'", {writable: false, enumerable: false, configurable: false, value:"NaN"});
+descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"});
 descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"});
 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: true, configurable: false, value:"XMLHttpRequest"});
 descriptorShouldBe("global", "'length'", {writable: true, enumerable: true, configurable: false, value:"global.length"});
diff --git a/LayoutTests/fast/js/resources/js-test-post-async.js b/LayoutTests/fast/js/resources/js-test-post-async.js
new file mode 100644
index 0000000..76777aa
--- /dev/null
+++ b/LayoutTests/fast/js/resources/js-test-post-async.js
@@ -0,0 +1,5 @@
+shouldBeTrue("successfullyParsed");
+debug('<br /><span class="pass">TEST COMPLETE</span>');
+
+if (window.layoutTestController)
+    layoutTestController.notifyDone();
diff --git a/LayoutTests/fast/js/resources/js-test-post.js b/LayoutTests/fast/js/resources/js-test-post.js
index 6d8a68f..88882c5 100644
--- a/LayoutTests/fast/js/resources/js-test-post.js
+++ b/LayoutTests/fast/js/resources/js-test-post.js
@@ -1,2 +1,13 @@
-shouldBeTrue("successfullyParsed");
-debug('<br /><span class="pass">TEST COMPLETE</span>');
+function finishJSTest()
+{
+    shouldBeTrue("successfullyParsed");
+    debug('<br /><span class="pass">TEST COMPLETE</span>');
+    if (window.jsTestIsAsync && window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+if (window.jsTestIsAsync) {
+    if (window.layoutTestController)
+        layoutTestController.waitUntilDone();
+} else
+    finishJSTest();
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index b91812f..ecf5fd0 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -37,11 +37,15 @@
 
 function areArraysEqual(_a, _b)
 {
-    if (_a.length !== _b.length)
-        return false;
-    for (var i = 0; i < _a.length; i++)
-        if (_a[i] !== _b[i])
+    try {
+        if (_a.length !== _b.length)
             return false;
+        for (var i = 0; i < _a.length; i++)
+            if (_a[i] !== _b[i])
+                return false;
+    } catch (ex) {
+        return false;
+    }
     return true;
 }
 
@@ -118,7 +122,7 @@
 
 function shouldBeEqualToString(a, b)
 {
-  var unevaledString = '"' + b.replace(/"/g, "\"") + '"';
+  var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"';
   shouldBe(a, unevaledString);
 }
 
diff --git a/LayoutTests/http/conf/apache2-debian-httpd.conf b/LayoutTests/http/conf/apache2-debian-httpd.conf
index 03aa9c8..b8918db 100644
--- a/LayoutTests/http/conf/apache2-debian-httpd.conf
+++ b/LayoutTests/http/conf/apache2-debian-httpd.conf
@@ -163,6 +163,16 @@
 #Listen 3000
 Listen 127.0.0.1:8080
 Listen 127.0.0.1:8443
+# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
+# requests to 8000 from random users on network.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
+# FIXME: This breaks the GTK-Debug and Chromium-Linux bots.
+# Starting up apache fails on this line with a syntax error.
+# Need a way to detect if the machine supports ipv6 and then
+# only do this binding in that case.
+#Listen [::1]:8000
+#Listen [::1]:8080
+#Listen [::1]:8443
 
 #
 # Dynamic Shared Object (DSO) Support
diff --git a/LayoutTests/http/conf/apache2-httpd.conf b/LayoutTests/http/conf/apache2-httpd.conf
index 980e4e2..e915fa7 100644
--- a/LayoutTests/http/conf/apache2-httpd.conf
+++ b/LayoutTests/http/conf/apache2-httpd.conf
@@ -163,6 +163,12 @@
 #Listen 3000
 Listen 127.0.0.1:8080
 Listen 127.0.0.1:8443
+# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
+# requests to 8000 from random users on network.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
+Listen [::1]:8000
+Listen [::1]:8080
+Listen [::1]:8443
 
 #
 # Dynamic Shared Object (DSO) Support
diff --git a/LayoutTests/http/conf/cygwin-httpd.conf b/LayoutTests/http/conf/cygwin-httpd.conf
index a79ed39..1651912 100644
--- a/LayoutTests/http/conf/cygwin-httpd.conf
+++ b/LayoutTests/http/conf/cygwin-httpd.conf
@@ -179,6 +179,10 @@
 #
 #Listen 3000
 Listen 127.0.0.1:8080
+# Apache 1.3 only supports IPv4, so we do not listen on ::1 (IPv6 loopback).
+# This may cause flaky tests on systems which support IPv6 if localhost resolves
+# to ::1 in addition to 127.0.0.1.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
 
 #
 # Dynamic Shared Object (DSO) Support
diff --git a/LayoutTests/http/conf/fedora-httpd.conf b/LayoutTests/http/conf/fedora-httpd.conf
index cd71d88..62100c8 100644
--- a/LayoutTests/http/conf/fedora-httpd.conf
+++ b/LayoutTests/http/conf/fedora-httpd.conf
@@ -138,6 +138,12 @@
 #Listen 12.34.56.78:80
 Listen 127.0.0.1:8080
 Listen 127.0.0.1:8443
+# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
+# requests to 8000 from random users on network.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
+Listen [::1]:8000
+Listen [::1]:8080
+Listen [::1]:8443
 
 #
 # Dynamic Shared Object (DSO) Support
diff --git a/LayoutTests/http/conf/httpd.conf b/LayoutTests/http/conf/httpd.conf
index ec04c73..6e6157c 100644
--- a/LayoutTests/http/conf/httpd.conf
+++ b/LayoutTests/http/conf/httpd.conf
@@ -181,6 +181,10 @@
 #Listen 3000
 Listen 127.0.0.1:8080
 Listen 127.0.0.1:8443
+# Apache 1.3 only supports IPv4, so we do not listen on ::1 (IPv6 loopback).
+# This may cause flaky tests on systems which support IPv6 if localhost resolves
+# to ::1 in addition to 127.0.0.1.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
 
 #
 # Dynamic Shared Object (DSO) Support
diff --git a/LayoutTests/http/conf/mime.types b/LayoutTests/http/conf/mime.types
index cfb9d53..0489350 100644
--- a/LayoutTests/http/conf/mime.types
+++ b/LayoutTests/http/conf/mime.types
@@ -324,6 +324,7 @@
 application/vnd.vsf
 application/vnd.wap.sic
 application/vnd.wap.slc
+application/vnd.wap.xhtml+xml	xhtmlmp
 application/vnd.wap.wbxml	wbxml
 application/vnd.wap.wmlc	wmlc
 application/vnd.wap.wmlscriptc	wmlsc
diff --git a/LayoutTests/http/tests/appcache/top-frame-2-expected.txt b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt
index 6e99bb6..41a3fe0 100644
--- a/LayoutTests/http/tests/appcache/top-frame-2-expected.txt
+++ b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt
@@ -2,6 +2,5 @@
 
 Should say SUCCESS:
 
-checking
 SUCCESS
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-2.html b/LayoutTests/http/tests/appcache/top-frame-2.html
index c239d08..71bd468 100644
--- a/LayoutTests/http/tests/appcache/top-frame-2.html
+++ b/LayoutTests/http/tests/appcache/top-frame-2.html
@@ -16,13 +16,34 @@
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
+function debug(message)
+{
+    // If running manually in the browser, print the sequence of events.
+    if (!window.layoutTestController)
+        log(message);
+}
+
+var receivedExpectedMessage = false;
+var receivedCheckingEvent = false;
+var receivedNoupdateEvent = false;
+
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEvent && receivedNoupdateEvent) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
     applicationCache.oncached = null;
 
     // When a new main resource is associated with the cache, an update should be started.
-    applicationCache.onchecking = function() { log("checking") }
+    applicationCache.onchecking = function() { debug("checking"); receivedCheckingEvent = true; checkDone();  }
+    applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEvent = true; checkDone();  }
 
     var ifr = document.createElement("iframe");
     ifr.setAttribute("src", "resources/subframe-2.html");
@@ -35,7 +56,7 @@
 applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
 applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
 
-window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+window.addEventListener("message", function() { debug("message"); receivedExpectedMessage = true; checkDone(); }, false);
 
 </script>
 </body>
diff --git a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
index a10dbee..a1245cb 100644
--- a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
+++ b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
@@ -4,7 +4,5 @@
 
 Should say SUCCESS:
 
-checking
-checking
 SUCCESS
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-3.html b/LayoutTests/http/tests/appcache/top-frame-3.html
index 9fc9dde..a2d2cc6 100644
--- a/LayoutTests/http/tests/appcache/top-frame-3.html
+++ b/LayoutTests/http/tests/appcache/top-frame-3.html
@@ -16,13 +16,34 @@
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
+function debug(message)
+{
+    // If running manually in the browser, print the sequence of events.
+    if (!window.layoutTestController)
+        log(message);
+}
+
+var receivedExpectedMessage = false;
+var receivedCheckingEventsCounter = 0;
+var receivedNoupdateEventsCounter = 0;
+
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
     applicationCache.oncached = null;
 
     // When a new main resource is associated with the cache, an update should be started.
-    applicationCache.onchecking = function() { log("checking") }
+    applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() }
+    applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone();  }
 
     var ifr = document.createElement("iframe");
     ifr.setAttribute("src", "resources/subframe-3.html");
@@ -42,9 +63,9 @@
 
 function test3()
 {
-    log("SUCCESS");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
+    debug("message");
+    receivedExpectedMessage = true;
+    checkDone();
 }
 
 applicationCache.onnoupdate = function() { test() }
diff --git a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
index 43bfd43..e748160 100644
--- a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
+++ b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
@@ -4,7 +4,5 @@
 
 Should say SUCCESS:
 
-checking
-checking
 SUCCESS
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-4.html b/LayoutTests/http/tests/appcache/top-frame-4.html
index 39743b9..c36e0a3 100644
--- a/LayoutTests/http/tests/appcache/top-frame-4.html
+++ b/LayoutTests/http/tests/appcache/top-frame-4.html
@@ -16,13 +16,34 @@
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
+function debug(message)
+{
+    // If running manually in the browser, print the sequence of events.
+    if (!window.layoutTestController)
+        log(message);
+}
+
+var receivedExpectedMessage = false;
+var receivedCheckingEventsCounter = 0;
+var receivedNoupdateEventsCounter = 0;
+
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
     applicationCache.oncached = null;
 
     // When a new main resource is associated with the cache, an update should be started.
-    applicationCache.onchecking = function() { log("checking") }
+    applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() }
+    applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone();  }
 
     var ifr = document.createElement("iframe");
     ifr.setAttribute("src", "resources/subframe-4.html");
@@ -42,9 +63,9 @@
 
 function test3()
 {
-    log("SUCCESS");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
+    debug("message");
+    receivedExpectedMessage = true;
+    checkDone();
 }
 
 applicationCache.onnoupdate = function() { test() }
diff --git a/LayoutTests/storage/database-lock-after-reload.html b/LayoutTests/storage/database-lock-after-reload.html
index 8bdaddc..5b5989f 100644
--- a/LayoutTests/storage/database-lock-after-reload.html
+++ b/LayoutTests/storage/database-lock-after-reload.html
@@ -1,8 +1,6 @@
 <html>
 <head>
 <script>
-var database;
-
 function log(message)
 {
     document.getElementById("console").innerHTML += message + "<br>";
@@ -15,7 +13,7 @@
         layoutTestController.notifyDone();
 }
 
-function errorFunction(tx, error)
+function errorFunction(error)
 {
     log("Test failed - " + error.message);
     finishTest();
@@ -23,16 +21,16 @@
 
 function addData(db)
 {
-    db.transaction(function(tx) { 
+    db.transaction(function(tx) {
         log("Inserting some data");
-        // Insert a large amount of data that will take a little while to run. Schedule a timout to run that will load a new page
-        // whilst the transaction is still in progress, interrupting the transaction. This should not leave the database locked and on
-        // the next page we should be able to insert some more data.
-        tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))", [], function(tx, result) { }, errorFunction);
-        location.href = "./resources/database-lock-after-reload-2.html";
-    }, errorFunction, function() { 
-        finishTest();
-    });
+        // Load a new page while the transaction is still in progress, interrupting the transaction.
+        // This should not leave the database locked and on the next page we should be able to insert
+        // some more data.
+        tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))", [],
+            function(tx, result) { location.href = "./resources/database-lock-after-reload-2.html"; },
+            function(tx, error) { errorFunction(error); });
+        tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))");
+    }, errorFunction, function() { finishTest(); });
 }
 
 function runTest()
@@ -42,20 +40,20 @@
         layoutTestController.dumpAsText();
         layoutTestController.waitUntilDone();
     }
-    
+
+    var database;
     try {
         database = openDatabase("DatabaseLockTest", "1.0", "Test for database locking", 5242880);
     } catch (e) {
         log("Error - could not open database");
         finishTest();
     }
-    
+
     database.transaction(function(tx) {
         log("Adding a table");
-        tx.executeSql("CREATE TABLE DataTest (testData)", [], function(tx, result) { }, errorFunction); 
-    }, errorFunction, function() { 
-        addData(database); 
-    });
+        tx.executeSql("CREATE TABLE DataTest (testData)", [], function(tx, result) { },
+            function(tx, error) { errorFunction(error); });
+    }, errorFunction, function() { addData(database); });
 }
 
 </script>
diff --git a/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt b/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt
new file mode 100644
index 0000000..b95ceee
--- /dev/null
+++ b/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt
@@ -0,0 +1,3 @@
+This test tests that executeSql() fails when called with a string that has more than one valid statement in it.
+Test passed.
+
diff --git a/LayoutTests/storage/executesql-accepts-only-one-statement.html b/LayoutTests/storage/executesql-accepts-only-one-statement.html
new file mode 100644
index 0000000..a3860c8
--- /dev/null
+++ b/LayoutTests/storage/executesql-accepts-only-one-statement.html
@@ -0,0 +1,78 @@
+<html>
+<head>
+<script>
+
+var TOTAL_STATEMENTS = 8;
+var statements = 0;
+var db = null;
+
+function log(message)
+{
+    document.body.innerText += message + "\n";
+}
+
+function terminateTest()
+{
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function executeStatement(expectedToPass, statement)
+{
+    db.transaction(function(tx) {
+        tx.executeSql(statement, [],
+            function(tx, data) {
+                if (!expectedToPass) {
+                    log("Statement " + statement + " was expected to fail, but passed.");
+                    terminateTest();
+                }
+                if (++statements == TOTAL_STATEMENTS) {
+                    log("Test passed.");
+                    terminateTest();
+                }
+            }, function(tx, error) {
+                if (expectedToPass) {
+                    log("Statement " + statement + " was expected to pass, but failed.");
+                    terminateTest();
+                }
+                if (++statements == TOTAL_STATEMENTS) {
+                    log("Test passed.");
+                    terminateTest();
+                }
+            });
+    });
+}
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.clearAllDatabases();
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    db = openDatabase("ExecuteSQLAcceptsOnlyOneStatementTest", "1.0", "", 1);
+    db.transaction(function(tx) {
+        tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
+    }, function(error) {
+        log("Test failed: " + error.message);
+        terminateTest();
+    }, function() {
+        executeStatement(true, "INSERT INTO Test VALUES (1)");
+        executeStatement(true, "INSERT INTO Test VALUES (2);");
+        executeStatement(true, "   INSERT INTO Test VALUES (3)    ");
+        executeStatement(true, "   INSERT INTO Test VALUES (4);   ");
+        executeStatement(true, "INSERT INTO Test VALUES (5)   ;");
+        executeStatement(false, "INSERT INTO Test VALUES (6); garbage");
+        executeStatement(false, "INSERT INTO Test VALUES (7); INSERT INTO Test VALUES (8)");
+        executeStatement(false, "  INSERT INTO Test VALUES (9);   INSERT INTO Test VALUES (10);   ");
+    });
+}
+
+</script>
+</head>
+<body onload="runTest();">
+This test tests that executeSql() fails when called with a string that has more than one valid statement in it.<br>
+</body>
+</body>
+</html>
diff --git a/LayoutTests/storage/open-database-creation-callback-expected.txt b/LayoutTests/storage/open-database-creation-callback-expected.txt
new file mode 100644
index 0000000..d86ab72
--- /dev/null
+++ b/LayoutTests/storage/open-database-creation-callback-expected.txt
@@ -0,0 +1,2 @@
+This test tests openDatabase()'s creation callback.
+
diff --git a/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt b/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt
new file mode 100644
index 0000000..fa96a67
--- /dev/null
+++ b/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt
@@ -0,0 +1,4 @@
+ALERT: undefined
+ALERT: PASS: document.body.bar visible in a callback created in this world.
+This test tests that the openDatabase() creation callback is called in the right world.
+
diff --git a/LayoutTests/storage/open-database-creation-callback-isolated-world.html b/LayoutTests/storage/open-database-creation-callback-isolated-world.html
new file mode 100644
index 0000000..98a4664
--- /dev/null
+++ b/LayoutTests/storage/open-database-creation-callback-isolated-world.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test tests that the openDatabase() creation callback is called in the right world.
+<div id="console"></div>
+<script>
+var creationCallbacksExecuted = 0;
+function done()
+{
+    if ((++creationCallbacksExecuted == 2) && (window.layoutTestController))
+        layoutTestController.notifyDone();
+}
+
+function creationCallback1(db)
+{
+    alert("FAIL: Visible in isolated world.");
+    done();
+}
+
+function creationCallback2(db)
+{
+    alert(document.body.bar);
+    done();
+}
+
+document.body.foo = "FAIL: document.body.foo visible in isolated world.";
+document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
+
+if (window.layoutTestController) {
+    layoutTestController.clearAllDatabases();
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.evaluateScriptInIsolatedWorld(
+        0,
+        "function creationCallback1(db)\n" +
+        "{\n" +
+        "    alert(document.body.foo);\n" +
+        "    window.location='javascript:done()';\n" +
+        "}\n" +
+        "var db1 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld', '1.0', '', 1, creationCallback1);");
+
+    var db2 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld2', '1.0', '', 1, creationCallback2);
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/open-database-creation-callback.html b/LayoutTests/storage/open-database-creation-callback.html
new file mode 100644
index 0000000..ac24942
--- /dev/null
+++ b/LayoutTests/storage/open-database-creation-callback.html
@@ -0,0 +1,90 @@
+<html>
+<head>
+<script>
+function log(message)
+{
+    document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function finishTest()
+{
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.clearAllDatabases();
+        layoutTestController.setDatabaseQuota(32768);
+        layoutTestController.dumpDatabaseCallbacks();
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    var transactionsRun = 0;
+
+    // Open a new database with a creation callback, and make sure the creation callback is queued
+    var creationCallbackCalled1 = false;
+    var db1 = openDatabase("OpenDatabaseCreationCallback1", "1.0", "", 1,
+                           function(db) {
+                               creationCallbackCalled1 = true;
+                               if (db.version != "") {
+                                   log("Creation callback was called with a database with version " +
+                                       db.version + "; empty string expected.");
+                                   finishTest();
+                               }
+                           });
+
+    // Putting this code inside a transaction on 'db1' makes sure that it is executed after
+    // the creation callback is.
+    db1.transaction(function(tx) {
+        if (!creationCallbackCalled1) {
+            log("Creation callback for db1 was not called.");
+            finishTest();
+        }
+        if (++transactionsRun == 2)
+            finishTest();
+    });
+
+    // Try to open another handle to the same database.
+    // Since the version of this database is "" (empty string), openDatabase() should return
+    // a null handle and throw a INVALID_STATE_ERR exception.
+    var db1Fail = null;
+    try {
+        db1Fail = openDatabase("OpenDatabaseCreationCallback1", "1.0", "", 1);
+        log("This statement should not have been executed; an INVALID_STATE_ERR exception should've been thrown.");
+        finishTest();
+    } catch(err) {
+        if (db1Fail) {
+            log("db1Fail should have been null.");
+            finishTest();
+        }
+    }
+
+    // Open a handle to another database, first without a creation callback, then with one.
+    // Make sure the creation callback is not called.
+    var creationCallbackCalled2 = false;
+    var db2 = openDatabase("OpenDatabaseCreationCallback2", "1.0", "", 1);
+    db2 = openDatabase("OpenDatabaseCreationCallback2", "1.0", "", 1,
+                       function(db) { creationCallbackCalled2 = true; });
+    db2.transaction(function(tx) {
+        if (creationCallbackCalled2) {
+            log("Creation callback for db2 should not have been called.");
+            finishTest();
+        }
+        if (++transactionsRun == 2)
+            finishTest();
+    });
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+This test tests openDatabase()'s creation callback.
+<pre id="console">
+</pre>
+</body>
+
+</html>
diff --git a/LayoutTests/storage/open-database-over-quota-expected.txt b/LayoutTests/storage/open-database-over-quota-expected.txt
new file mode 100644
index 0000000..d0c15e4
--- /dev/null
+++ b/LayoutTests/storage/open-database-over-quota-expected.txt
@@ -0,0 +1,2 @@
+This tests that calling openDatabase with a size over 5MB doesn't assert on debug builds.
+PASS
diff --git a/LayoutTests/storage/open-database-over-quota.html b/LayoutTests/storage/open-database-over-quota.html
new file mode 100644
index 0000000..2a9264d
--- /dev/null
+++ b/LayoutTests/storage/open-database-over-quota.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script>
+function runTest() {
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.clearAllDatabases();
+    }
+
+    try {
+        var db = openDatabase('OverQuotaOpen', '', 'Test for bug 36473: missing lock in call to doneCreatingDatabase', 10000000);
+    } catch (err) {
+        document.getElementById('result').innerHTML = 'PASS'
+    }
+}
+</script>
+</head>
+<body onload="runTest()">
+<div>This tests that calling openDatabase with a size over 5MB doesn't assert on debug builds.
+<div id="result">
+FAIL: We shouldn't have been able to open the database.
+</div>
+</body>
+</html>
diff --git a/LayoutTests/storage/resources/database-lock-after-reload-2.html b/LayoutTests/storage/resources/database-lock-after-reload-2.html
index d73a0df..6e0f09c 100644
--- a/LayoutTests/storage/resources/database-lock-after-reload-2.html
+++ b/LayoutTests/storage/resources/database-lock-after-reload-2.html
@@ -1,8 +1,6 @@
 <html>
 <head>
 <script>
-var database;
-
 function log(message)
 {
     document.getElementById("console").innerHTML += message + "<br>";
@@ -15,7 +13,7 @@
         layoutTestController.notifyDone();
 }
 
-function errorFunction(tx, error)
+function errorFunction(error)
 {
     log("Test failed - " + error.message);
     finishTest();
@@ -23,13 +21,11 @@
 
 function addData(db)
 {
-    db.transaction(function(tx) { 
+    db.transaction(function(tx) {
         log("Inserting some data");
-
-        tx.executeSql("INSERT INTO DataTest (testData) VALUES (?)", ["A"], function(tx, result) { }, errorFunction);
-    }, function(){}, function() { 
-        finishTest();
-    });
+        tx.executeSql("INSERT INTO DataTest (testData) VALUES (?)", ["A"],
+            function(tx, result) { }, function(tx, error) { errorFunction(error); });
+    }, function() { }, function() { finishTest(); });
 }
 
 function runTest()
@@ -38,9 +34,9 @@
         layoutTestController.dumpAsText();
         layoutTestController.waitUntilDone();
     }
-    
+
     try {
-        database = openDatabase("DatabaseLockTest", "1.0", "Test for database locking", 5242880);
+        var database = openDatabase("DatabaseLockTest", "1.0", "Test for database locking", 5242880);
         addData(database);
     } catch(e) {
         log("Error - could not open database");
diff --git a/LayoutTests/storage/statement-error-callback-expected.txt b/LayoutTests/storage/statement-error-callback-expected.txt
index 791dfb6..6b65683 100644
--- a/LayoutTests/storage/statement-error-callback-expected.txt
+++ b/LayoutTests/storage/statement-error-callback-expected.txt
@@ -6,6 +6,9 @@
 PASS - the transaction error callback was invoked.
 PASS - the transaction error callback was invoked.
 PASS - the transaction error callback was invoked.
-PASS - the transaction error callback was invoked.
+PASS - the transaction success callback was invoked.
+PASS - the transaction success callback was invoked.
+PASS - the transaction success callback was invoked.
+PASS - the transaction success callback was invoked.
 Test Complete
 
diff --git a/LayoutTests/storage/statement-error-callback-isolated-world-expected.txt b/LayoutTests/storage/statement-error-callback-isolated-world-expected.txt
new file mode 100644
index 0000000..b376896
--- /dev/null
+++ b/LayoutTests/storage/statement-error-callback-isolated-world-expected.txt
@@ -0,0 +1,4 @@
+ALERT: undefined
+ALERT: PASS: document.body.bar visible in a callback created in this world.
+This test tests that the statement error callback is called in the right world.
+
diff --git a/LayoutTests/storage/statement-error-callback-isolated-world.html b/LayoutTests/storage/statement-error-callback-isolated-world.html
new file mode 100644
index 0000000..196e42b
--- /dev/null
+++ b/LayoutTests/storage/statement-error-callback-isolated-world.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test tests that the statement error callback is called in the right world.
+<div id="console"></div>
+<script>
+var statementErrorCallbacksInvoked = 0;
+function done()
+{
+    if ((++statementErrorCallbacksInvoked == 2) && (window.layoutTestController))
+        layoutTestController.notifyDone();
+}
+
+function statementErrorCallback1(tx, error)
+{
+    alert("FAIL: Visible in isolated world.");
+    done();
+}
+
+function statementErrorCallback2(tx, error)
+{
+    alert(document.body.bar);
+    done();
+}
+
+document.body.foo = "FAIL: document.body.foo visible in isolated world.";
+document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
+
+if (window.layoutTestController) {
+    layoutTestController.clearAllDatabases();
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.evaluateScriptInIsolatedWorld(
+        0,
+        "function statementErrorCallback1(tx, error)\n" +
+        "{\n" +
+        "    alert(document.body.foo);\n" +
+        "    window.location='javascript:done()';\n" +
+        "}\n" +
+        "var db1 = openDatabase('StatementErrorCallbackIsolatedWorld1', '1.0', '', 1);\n" +
+        "db1.transaction(function(tx) {\n" +
+        "    tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statementErrorCallback1);\n" +
+        "});");
+
+    var db2 = openDatabase('StatementErrorCallbackIsolatedWorld2', '1.0', '', 1);
+    db2.transaction(function(tx) {
+        tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statementErrorCallback2);
+    });
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/statement-error-callback.html b/LayoutTests/storage/statement-error-callback.html
index 060a881..6db836d 100644
--- a/LayoutTests/storage/statement-error-callback.html
+++ b/LayoutTests/storage/statement-error-callback.html
@@ -15,37 +15,42 @@
 }
 
 var txCallbackCount = 0;
-var NUMBER_OF_TRANSACTIONS = 7;
+var NUMBER_OF_TRANSACTIONS = 10;
 var database;
 
-function transactionErrorFunction(error)
-{
-    log("PASS - the transaction error callback was invoked.");
-    if (++txCallbackCount == NUMBER_OF_TRANSACTIONS)
-        finishTest();
-}
-
-function transactionSuccessFunction(message)
-{
-    log("FAIL - the transaction success callback should not be invoked.");
-    if (++txCallbackCount == NUMBER_OF_TRANSACTIONS)
-        finishTest();
-}
-
-function runTransactionExpectedToFail(statementErrorCallback)
+function runTransaction(expectedToFail, statementErrorCallback)
 {
     database.transaction(function(tx) {
-        tx.executeSql("CREATE TABLE IF NOT EXISTS StatementErrorCallbackTest (randomData)");
-        tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test']);
+        tx.executeSql("CREATE TABLE IF NOT EXISTS TestTable (RandomData TEXT)");
+        tx.executeSql("INSERT INTO TestTable VALUES (?)", ['test']);
         tx.executeSql("THIS STATEMENT WILL FAIL", [],
             function(tx, data) {
                 log("FAIL - this statement should have failed");
                 finishTest();
             }, statementErrorCallback);
-        tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test1'],
-            function(error) { log("FAIL - This statement should not have been executed"); },
-            function() { log("FAIL - This statement should not have been executed"); });
-    }, transactionErrorFunction, transactionSuccessFunction);
+        tx.executeSql("INSERT INTO TestTable VALUES (?)", ['test1'],
+            function(error) {
+                if (expectedToFail)
+                    log("FAIL - This statement should not have been executed");
+            }, function() {
+                if (expectedToFail)
+                    log("FAIL - This statement should not have been executed");
+            });
+    }, function(error) {
+        if (expectedToFail)
+            log("PASS - the transaction error callback was invoked.");
+        else
+            log("FAIL - the transaction error callback should not have been invoked.");
+        if (++txCallbackCount == NUMBER_OF_TRANSACTIONS)
+            finishTest();
+    }, function() {
+        if (expectedToFail)
+            log("FAIL - the transaction success callback should not have been invoked.");
+        else
+            log("PASS - the transaction success callback was invoked.");
+        if (++txCallbackCount == NUMBER_OF_TRANSACTIONS)
+            finishTest();
+    });
 }
 
 function runTest()
@@ -56,28 +61,18 @@
         layoutTestController.waitUntilDone();
     }
 
-    database = openDatabase("bug-28872", "1.0", "statement error callback test", 1024);
-    database.transaction(function(tx) {
-        tx.executeSql("CREATE TABLE IF NOT EXISTS StatementErrorCallbackTest (randomData)");
-        tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test']);
-        tx.executeSql("THIS STATEMENT WILL FAIL", [],
-            function(tx, data) {
-                log("FAIL - this statement should have failed");
-                finishTest();
-            }, function(tx, error) { return false; });
-        tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test1'],
-            function(tx, data) { },
-            function(tx, error) { log("FAIL - This statement should not have caused an error"); });
-    }, function(error) { log("FAIL - The transaction error callback should not have been invoked"); },
-    function() { });
+    database = openDatabase("StatementErrorCallbackTest", "1.0", "statement error callback test", 1024);
 
-    runTransactionExpectedToFail(function(error) { return true; });
-    runTransactionExpectedToFail(function(error) { throw "Exception in statement error callback"; return false; });
-    runTransactionExpectedToFail(function(error) {});
-    runTransactionExpectedToFail(function(error) { return null; });
-    runTransactionExpectedToFail(function(error) { return "some string"; });
-    runTransactionExpectedToFail(function(error) { return 1234; });
-    runTransactionExpectedToFail(function(error) { return {a: 2, b: "abc"}; });
+    runTransaction(true, function(error) { return true; });
+    runTransaction(true, function(error) { throw "Exception in statement error callback"; return false; });
+    runTransaction(true, function(error) { return "some string"; });
+    runTransaction(true, function(error) { return 1234; });
+    runTransaction(true, function(error) { return {a: 2, b: "abc"}; });
+    runTransaction(true, function(error) { return "false"; });
+    runTransaction(false, function(error) {});
+    runTransaction(false, function(error) { return false; });
+    runTransaction(false, function(error) { return 0; });
+    runTransaction(false, function(error) { return null; });
 }
 
 </script>
diff --git a/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt b/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt
new file mode 100644
index 0000000..2ef027d
--- /dev/null
+++ b/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt
@@ -0,0 +1,4 @@
+ALERT: undefined
+ALERT: PASS: document.body.bar visible in a callback created in this world.
+This test tests that the statement success callback is called in the right world.
+
diff --git a/LayoutTests/storage/statement-success-callback-isolated-world.html b/LayoutTests/storage/statement-success-callback-isolated-world.html
new file mode 100644
index 0000000..4fac754
--- /dev/null
+++ b/LayoutTests/storage/statement-success-callback-isolated-world.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test tests that the statement success callback is called in the right world.
+<div id="console"></div>
+<script>
+var statementSuccessCallbacksInvoked = 0;
+function done()
+{
+    if ((++statementSuccessCallbacksInvoked == 2) && (window.layoutTestController))
+        layoutTestController.notifyDone();
+}
+
+function statementSuccessCallback1(tx, data)
+{
+    alert("FAIL: Visible in isolated world.");
+    done();
+}
+
+function statementSuccessCallback2(tx, data)
+{
+    alert(document.body.bar);
+    done();
+}
+
+document.body.foo = "FAIL: document.body.foo visible in isolated world.";
+document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
+
+if (window.layoutTestController) {
+    layoutTestController.clearAllDatabases();
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.evaluateScriptInIsolatedWorld(
+        0,
+        "function statementSuccessCallback1(tx, data)\n" +
+        "{\n" +
+        "    alert(document.body.foo);\n" +
+        "    window.location='javascript:done()';\n" +
+        "}\n" +
+        "var db1 = openDatabase('StatementSuccessCallbackIsolatedWorld1', '1.0', '', 1);\n" +
+        "db1.transaction(function(tx) {\n" +
+        "    tx.executeSql('CREATE TABLE IF NOT EXISTS Test (Foo INT)', [], statementSuccessCallback1);\n" +
+        "});");
+
+    var db2 = openDatabase('StatementSuccessCallbackIsolatedWorld2', '1.0', '', 1);
+    db2.transaction(function(tx) {
+        tx.executeSql('CREATE TABLE IF NOT EXISTS Test (Foo INT)', [], statementSuccessCallback2);
+    });
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/transaction-callback-isolated-world-expected.txt b/LayoutTests/storage/transaction-callback-isolated-world-expected.txt
new file mode 100644
index 0000000..27f474f
--- /dev/null
+++ b/LayoutTests/storage/transaction-callback-isolated-world-expected.txt
@@ -0,0 +1,4 @@
+ALERT: undefined
+ALERT: PASS: document.body.bar visible in a callback created in this world.
+This test tests that the transaction callback is called in the right world.
+
diff --git a/LayoutTests/storage/transaction-callback-isolated-world.html b/LayoutTests/storage/transaction-callback-isolated-world.html
new file mode 100644
index 0000000..6825d70
--- /dev/null
+++ b/LayoutTests/storage/transaction-callback-isolated-world.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test tests that the transaction callback is called in the right world.
+<div id="console"></div>
+<script>
+var transactionCallbacksInvoked = 0;
+function done()
+{
+    if ((++transactionCallbacksInvoked == 2) && (window.layoutTestController))
+        layoutTestController.notifyDone();
+}
+
+function transactionCallback1(tx)
+{
+    alert("FAIL: Visible in isolated world.");
+    done();
+}
+
+function transactionCallback2(tx)
+{
+    alert(document.body.bar);
+    done();
+}
+
+document.body.foo = "FAIL: document.body.foo visible in isolated world.";
+document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
+
+if (window.layoutTestController) {
+    layoutTestController.clearAllDatabases();
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.evaluateScriptInIsolatedWorld(
+        0,
+        "function transactionCallback1(tx)\n" +
+        "{\n" +
+        "    alert(document.body.foo);\n" +
+        "    window.location='javascript:done()';\n" +
+        "}\n" +
+        "var db1 = openDatabase('TransactionCallbackIsolatedWorld1', '1.0', '', 1);\n" +
+        "db1.transaction(transactionCallback1);");
+
+    var db2 = openDatabase('TransactionCallbackIsolatedWorld2', '1.0', '', 1);
+    db2.transaction(transactionCallback2);
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt b/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt
new file mode 100644
index 0000000..da15396
--- /dev/null
+++ b/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt
@@ -0,0 +1,4 @@
+ALERT: undefined
+ALERT: PASS: document.body.bar visible in a callback created in this world.
+This test tests that the transaction error callback is called in the right world.
+
diff --git a/LayoutTests/storage/transaction-error-callback-isolated-world.html b/LayoutTests/storage/transaction-error-callback-isolated-world.html
new file mode 100644
index 0000000..521894d
--- /dev/null
+++ b/LayoutTests/storage/transaction-error-callback-isolated-world.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<body>
+This test tests that the transaction error callback is called in the right world.
+<div id="console"></div>
+<script>
+var transactionErrorCallbacksInvoked = 0;
+function done()
+{
+    if ((++transactionErrorCallbacksInvoked == 2) && (window.layoutTestController))
+        layoutTestController.notifyDone();
+}
+
+function transactionErrorCallback1(tx)
+{
+    alert("FAIL: Visible in isolated world.");
+    done();
+}
+
+function transactionErrorCallback2(tx)
+{
+    alert(document.body.bar);
+    done();
+}
+
+document.body.foo = "FAIL: document.body.foo visible in isolated world.";
+document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
+
+if (window.layoutTestController) {
+    layoutTestController.clearAllDatabases();
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    layoutTestController.evaluateScriptInIsolatedWorld(
+        0,
+        "function transactionErrorCallback1(tx)\n" +
+        "{\n" +
+        "    alert(document.body.foo);\n" +
+        "    window.location='javascript:done()';\n" +
+        "}\n" +
+        "var db1 = openDatabase('TransactionErrorCallbackIsolatedWorld1', '1.0', '', 1);\n" +
+        "db1.transaction(function(tx) {\n" +
+        "    tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, function(tx, error) { return true; });\n" +
+        "}, transactionErrorCallback1);");
+
+    var db2 = openDatabase('TransactionErrorCallbackIsolatedWorld2', '1.0', '', 1);
+    db2.transaction(function(tx) {
+        tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, function(tx, error) { return true; });
+    }, transactionErrorCallback2);
+}
+</script>
+</body>
+</html>
diff --git a/SunSpider/ChangeLog b/SunSpider/ChangeLog
index a200015..d0ec113 100644
--- a/SunSpider/ChangeLog
+++ b/SunSpider/ChangeLog
@@ -1,3 +1,19 @@
+2010-04-05  Darin Adler  <darin@apple.com>
+
+        Updated the ignore property for changes to the contents here.
+
+        * .: Modified property svn:ignore.
+
+2010-02-20  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Adam Barth.
+
+        Add sunspider-0.9.1 to the site in preparation for announcing it.
+        https://bugs.webkit.org/show_bug.cgi?id=35206
+
+        * hosted/sunspider.css: Remove tabs, which I noticed where present while
+        copying to the WebKitSite directory.
+
 2010-01-11  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Darin Adler.
diff --git a/SunSpider/hosted/sunspider.css b/SunSpider/hosted/sunspider.css
index 7a17979..c91a103 100644
--- a/SunSpider/hosted/sunspider.css
+++ b/SunSpider/hosted/sunspider.css
@@ -19,13 +19,13 @@
 :visited { color: #5113A1 }
 
 #testframe { margin-top: 20px;
-	     width: 80%;
-	     height: 500px;
- 	     border: 2px solid #360D6B }
+             width: 80%;
+             height: 500px;
+             border: 2px solid #360D6B }
 
 #logo { float: left;
         position: relative; 
         bottom: 0.33em;
         padding-right: 20px;
-	margin-bottom: -40px; 
+        margin-bottom: -40px; 
         font-size: 3em }
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index e9afc68..458a860 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -154,6 +154,7 @@
 # HTML
 GEN := \
     $(intermediates)/html/JSBlob.h \
+    $(intermediates)/html/JSDOMFormData.h \
     $(intermediates)/html/JSDataGridColumn.h \
     $(intermediates)/html/JSDataGridColumnList.h \
     $(intermediates)/html/JSFile.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 8715f20..87491bc 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -535,6 +535,7 @@
 
 # XML
 GEN := \
+    $(intermediates)/bindings/V8DOMFormData.h \
     $(intermediates)/bindings/V8DOMParser.h \
     $(intermediates)/bindings/V8XMLHttpRequest.h \
     $(intermediates)/bindings/V8XMLHttpRequestException.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index 8b8ed77..282186d 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -82,9 +82,11 @@
 	bindings/js/JSCustomSQLTransactionCallback.cpp \
 	bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
 	bindings/js/JSCustomVoidCallback.cpp \
+	bindings/js/JSDatabaseCallback.cpp \
 	bindings/js/JSDesktopNotificationsCustom.cpp \
 	bindings/js/JSDOMApplicationCacheCustom.cpp \
 	bindings/js/JSDOMBinding.cpp \
+  bindings/js/JSDOMFormDataCustom.cpp \
 	bindings/js/JSDOMGlobalObject.cpp \
 	bindings/js/JSDOMWindowBase.cpp \
 	bindings/js/JSDOMWindowCustom.cpp \
@@ -158,6 +160,7 @@
 	bindings/js/JSWorkerConstructor.cpp \
 	bindings/js/JSWorkerContextBase.cpp \
 	bindings/js/JSWorkerContextCustom.cpp \
+	bindings/js/JSWorkerContextErrorHandler.cpp \
 	bindings/js/JSWorkerCustom.cpp \
 	bindings/js/JSXMLHttpRequestConstructor.cpp \
 	bindings/js/JSXMLHttpRequestCustom.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index f6576ae..97ddbd6 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -177,6 +177,8 @@
 	dom/TreeWalker.cpp \
 	dom/UIEvent.cpp \
 	dom/UIEventWithKeyState.cpp \
+	dom/UserGestureIndicator.cpp \
+	dom/ViewportArguments.cpp \
 	dom/WebKitAnimationEvent.cpp \
 	dom/WebKitTransitionEvent.cpp \
 	dom/WheelEvent.cpp \
@@ -243,7 +245,11 @@
 	\
 	html/Blob.cpp \
 	html/CollectionCache.cpp \
+<<<<<<< HEAD
 	html/DateComponents.cpp \
+=======
+	html/DOMFormData.cpp \
+>>>>>>> webkit.org at r58033
 	html/File.cpp \
 	html/FileList.cpp \
 	html/FormDataList.cpp \
@@ -288,6 +294,7 @@
 	loader/DocLoader.cpp \
 	loader/DocumentLoader.cpp \
 	loader/DocumentThreadableLoader.cpp \
+	loader/DocumentWriter.cpp \
 	loader/FormState.cpp \
 	loader/FrameLoader.cpp \
 	loader/HistoryController.cpp \
@@ -357,6 +364,7 @@
 	page/Screen.cpp \
 	page/SecurityOrigin.cpp \
 	page/Settings.cpp \
+	page/SpatialNavigation.cpp \
 	page/UserContentURLPattern.cpp \
 	page/WindowFeatures.cpp \
 	page/WorkerNavigator.cpp \
@@ -440,7 +448,7 @@
 	platform/graphics/FontFastPath.cpp \
 	platform/graphics/GeneratedImage.cpp \
 	platform/graphics/GlyphPageTreeNode.cpp \
-	platform/graphics/GlyphWidthMap.cpp \
+	platform/graphics/GlyphMetricsMap.cpp \
 	platform/graphics/Gradient.cpp \
 	platform/graphics/GraphicsContext.cpp \
 	platform/graphics/GraphicsLayer.cpp \
@@ -541,16 +549,17 @@
 	platform/sql/SQLiteStatement.cpp \
 	platform/sql/SQLiteTransaction.cpp \
 	\
-	platform/text/AtomicString.cpp \
 	platform/text/Base64.cpp \
 	platform/text/BidiContext.cpp \
-	platform/text/CString.cpp \
 	platform/text/RegularExpression.cpp \
 	platform/text/SegmentedString.cpp \
 	platform/text/String.cpp \
 	platform/text/StringBuilder.cpp \
+<<<<<<< HEAD
 	platform/text/StringImpl.cpp \
 	platform/text/TextBoundaries.cpp \
+=======
+>>>>>>> webkit.org at r58033
 	platform/text/TextBreakIteratorICU.cpp \
 	platform/text/TextCodec.cpp \
 	platform/text/TextCodecICU.cpp \
@@ -609,8 +618,10 @@
 	rendering/RenderFlexibleBox.cpp \
 	rendering/RenderForeignObject.cpp \
 	rendering/RenderFrame.cpp \
+	rendering/RenderFrameBase.cpp \
 	rendering/RenderFrameSet.cpp \
 	rendering/RenderHTMLCanvas.cpp \
+	rendering/RenderIFrame.cpp \
 	rendering/RenderImage.cpp \
 	rendering/RenderImageGeneratedContent.cpp \
 	rendering/RenderInline.cpp \
@@ -627,7 +638,6 @@
 	rendering/RenderObject.cpp \
 	rendering/RenderObjectChildList.cpp \
 	rendering/RenderPart.cpp \
-	rendering/RenderPartObject.cpp \
 	rendering/RenderPath.cpp \
 	rendering/RenderReplaced.cpp \
 	rendering/RenderReplica.cpp \
@@ -646,6 +656,9 @@
 	rendering/RenderSVGInline.cpp \
 	rendering/RenderSVGInlineText.cpp \
 	rendering/RenderSVGModelObject.cpp \
+	rendering/RenderSVGResourceClipper.cpp \
+	rendering/RenderSVGResourceFilter.cpp \
+	rendering/RenderSVGResourceMarker.cpp \
 	rendering/RenderSVGResourceMasker.cpp \
 	rendering/RenderSVGRoot.cpp \
 	rendering/RenderSVGShadowTreeRootContainer.cpp \
@@ -899,9 +912,6 @@
 	svg/graphics/SVGPaintServerRadialGradient.cpp \
 	svg/graphics/SVGPaintServerSolid.cpp \
 	svg/graphics/SVGResource.cpp \
-	svg/graphics/SVGResourceClipper.cpp \
-	svg/graphics/SVGResourceFilter.cpp \
-	svg/graphics/SVGResourceMarker.cpp \
 	\
 	svg/graphics/filters/SVGFEConvolveMatrix.cpp \
 	svg/graphics/filters/SVGFEDiffuseLighting.cpp \
@@ -937,6 +947,7 @@
 	\
 	xml/DOMParser.cpp \
 	xml/XMLHttpRequest.cpp \
+	xml/XMLHttpRequestProgressEventThrottle.cpp \
 	xml/XMLHttpRequestUpload.cpp \
 	xml/XMLSerializer.cpp
 
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index 603ca74..3d36659 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -49,9 +49,12 @@
 	bindings/v8/DateExtension.cpp \
 	bindings/v8/DOMData.cpp \
 	bindings/v8/DOMDataStore.cpp \
+<<<<<<< HEAD
 	bindings/v8/DOMWrapperWorld.cpp \
 	bindings/v8/DerivedSourcesAllInOne.cpp \
 	bindings/v8/IsolatedWorld.cpp \
+=======
+>>>>>>> webkit.org at r58033
 	bindings/v8/MainThreadDOMData.cpp \
 	bindings/v8/NPV8Object.cpp \
 	bindings/v8/ScheduledAction.cpp \
@@ -83,8 +86,12 @@
 	bindings/v8/V8GCController.cpp \
 	bindings/v8/V8Helpers.cpp \
 	bindings/v8/V8HiddenPropertyName.cpp \
+<<<<<<< HEAD
 	bindings/v8/V8IsolatedContext.cpp \
 	bindings/v8/V8Index.cpp \
+=======
+	bindings/v8/V8IsolatedWorld.cpp \
+>>>>>>> webkit.org at r58033
 	bindings/v8/V8LazyEventListener.cpp \
 	bindings/v8/V8NPObject.cpp \
 	bindings/v8/V8NPUtils.cpp \
@@ -98,9 +105,7 @@
 	\
 	bindings/v8/npruntime.cpp \
 	\
-	bindings/v8/custom/V8AbstractWorkerCustom.cpp \
 	bindings/v8/custom/V8AttrCustom.cpp \
-	bindings/v8/custom/V8BarInfoCustom.cpp \
 	bindings/v8/custom/V8CSSRuleCustom.cpp \
 	bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
 	bindings/v8/custom/V8CSSStyleSheetCustom.cpp \
@@ -118,10 +123,10 @@
 	bindings/v8/custom/V8CustomSQLTransactionCallback.cpp \
 	bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp \
 	bindings/v8/custom/V8CustomVoidCallback.cpp \
-	bindings/v8/custom/V8DOMApplicationCacheCustom.cpp \
-	bindings/v8/custom/V8DOMSelectionCustom.cpp \
+  bindings/v8/custom/V8DOMFormDataCustom.cpp \
 	bindings/v8/custom/V8DOMWindowCustom.cpp \
 	bindings/v8/custom/V8DataGridColumnListCustom.cpp \
+	bindings/v8/custom/V8DatabaseCallback.cpp \
 	bindings/v8/custom/V8DatabaseCustom.cpp \
 	bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
 	bindings/v8/custom/V8DocumentCustom.cpp \
@@ -129,7 +134,11 @@
 	bindings/v8/custom/V8ElementCustom.cpp \
 	bindings/v8/custom/V8EventCustom.cpp \
 	bindings/v8/custom/V8EventSourceConstructor.cpp \
+<<<<<<< HEAD
 	bindings/v8/custom/V8EventSourceCustom.cpp \
+=======
+	bindings/v8/custom/V8FileListCustom.cpp \
+>>>>>>> webkit.org at r58033
 	bindings/v8/custom/V8GeolocationCustom.cpp \
 	bindings/v8/custom/V8HistoryCustom.cpp \
 	bindings/v8/custom/V8HTMLAllCollectionCustom.cpp \
@@ -160,8 +169,11 @@
 	bindings/v8/custom/V8NodeFilterCustom.cpp \
 	bindings/v8/custom/V8NodeIteratorCustom.cpp \
 	bindings/v8/custom/V8NodeListCustom.cpp \
+<<<<<<< HEAD
 	bindings/v8/custom/V8PopStateEventCustom.cpp \
 	bindings/v8/custom/V8ScreenCustom.cpp \
+=======
+>>>>>>> webkit.org at r58033
 	bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	bindings/v8/custom/V8WebSocketCustom.cpp
@@ -170,7 +182,6 @@
 LOCAL_SRC_FILES += \
 	bindings/v8/custom/V8SVGDocumentCustom.cpp \
 	bindings/v8/custom/V8SVGElementCustom.cpp \
-	bindings/v8/custom/V8SVGElementInstanceCustom.cpp \
 	bindings/v8/custom/V8SVGLengthCustom.cpp \
 	bindings/v8/custom/V8SVGMatrixCustom.cpp \
 	bindings/v8/custom/V8SVGPathSegCustom.cpp
@@ -187,10 +198,14 @@
 	bindings/v8/custom/V8WorkerContextCustom.cpp \
 	bindings/v8/custom/V8WorkerCustom.cpp \
 	bindings/v8/custom/V8XMLHttpRequestConstructor.cpp \
+<<<<<<< HEAD
 	bindings/v8/custom/V8XMLHttpRequestCustom.cpp \
 	bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp \
 	\
 	bindings/v8/specialization/V8BindingState.cpp
+=======
+	bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+>>>>>>> webkit.org at r58033
 
 LOCAL_SRC_FILES += \
 	bridge/jni/JNIBridge.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 01d1a54..9700ffe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27106 @@
+2009-04-21  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        aria-liveregion-notifications.html fails on leopard release bot
+        https://bugs.webkit.org/show_bug.cgi?id=37112
+
+        Change the method that DRT uses to monitor AX notifications so that its robust
+        by just sending out NSNotification that can be listened to by anyone, instead
+        of keeping a static function pointer around.
+   
+        This change is aimed to avoid flakiness seen in DRT when the notification handlers
+        are not being called at the appropriate time.
+
+        Tests: platform/mac/accessibility/aria-liveregions-addedelement.html
+               platform/mac/accessibility/aria-liveregions-changedalt.html
+               platform/mac/accessibility/aria-liveregions-changedtext.html
+               platform/mac/accessibility/aria-liveregions-removedelement.html
+
+        * accessibility/mac/AccessibilityObjectWrapper.h:
+        * accessibility/mac/AccessibilityObjectWrapper.mm:
+        (-[AccessibilityObjectWrapper accessibilitySetShouldRepostNotifications:]):
+        (-[AccessibilityObjectWrapper accessibilityPostedNotification:]):
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Leopard build fix).
+        Remove old exports.
+
+        * WebCore.base.exp:
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 37949 - Do no copy strings into a shared buffer when converting UStrings to Strings
+        UString and String now have the same internal representation; Just re-wrap the internal impl.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::jsStringSlowCase):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::ustringToString):
+        (WebCore::stringToUString):
+        (WebCore::identifierToString):
+        (WebCore::ustringToAtomicString):
+        (WebCore::identifierToAtomicString):
+
+2010-04-21  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        <rdar://problem/7313430> Many crashes in Safari inside Flip4Mac below -[NSAlert didEndAlert:returnCode:contextInfo:]
+
+        A manual test case is required here as the Flip4Mac plug-in displays an alert, and some manual tweaking of the plug-in's
+        preference file on disk is often required to reproduce the bug.
+
+        * manual-tests/plugins/flip4mac-update-alert-over-navigation.html: Added.
+
+2010-04-21  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/7856151> REGRESSION: NPP_Destroy is not called when page navigates when plug-in is displaying modal dialog
+
+        This is a manual test case as I was not able to construct an automated test that reproduced the same issue without displaying
+        a modal dialog on-screen.
+
+        * manual-tests/plugins/timeout-dialog-displayed-over-navigation.html: Added.
+        * manual-tests/plugins/timeout-dialog-displayed-over-navigation.swf: Added.
+
+2010-04-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=37937
+        Wean JavaScriptCore off calls to isMainThread()
+
+        No change in behavior.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonJSGlobalData):
+        Explicitly set a large stack type for the common JSGlobalData and
+        set the currently running thread as the exclusive thread for its 
+        execution.
+
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::WorkerScriptController):
+        Explicitly set a small stack type for the workers JSGlobalData. 
+
+2010-04-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Qt build fix).
+
+        * WebCore.gypi:
+        * WebCore.pro:
+        * platform/text/qt/StringQt.cpp: Removed.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt, Darin Adler.
+
+        Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
+        Add include for StringHash.h.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/c/c_class.cpp:
+
+2010-04-21  Alexey Proskuryakov  <ap@apple.com>
+
+        Tiger build fix.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::createNSURLConnection): Fixed a typo, named an argument.
+        (WebCore::ResourceHandle::start): Moved shouldUseCredentialStorage out of #if, since it's
+        now passed to createNSURLConneciton() on all platforms (and then ignored on Tiger).
+
+2010-04-21  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Windows build fix.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp: Declare CFURLConnectionCreateWithProperties
+        for now, as it's mistakenly missing from WebKitSupportLibrary headers.
+
+2010-04-21  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(r57292): Safari/Win and Chromium/Win no longer pass the acid3 test.
+        https://bugs.webkit.org/show_bug.cgi?id=37902
+
+        The issue is due to MSVC creating enums as signed. The fix is to store the value
+        as unsigned.
+
+        Test: http://acid3.acidtests.org/
+
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags): Changed type of _insideLink to unsigned.
+
+2010-04-21  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37933
+        <rdar://problem/7719540> XMLHttpRequest.withCredentials should be better enforced.
+
+        Test: http/tests/xmlhttprequest/cross-origin-authorization-with-embedder.html
+
+        This improves integration between ResourceHandle and Apple networking libraries.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::createConnectionProperties): A new helper for creating connection properties dictionary.
+        (WebCore::ResourceHandle::start): Pass connection properties.
+        (WebCore::WebCoreSynchronousLoader::load): Ditto.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::createNSURLConnection): Factor out OS version dependent code for creating
+        NSURLConnection. Tell NSURLConnection about credential policy upfront.
+        (WebCore::ResourceHandle::start): Use the new function.
+        (+[WebCoreSynchronousLoader loadRequest:allowStoredCredentials:returningResponse:error:]): Ditto.
+
+2010-04-21  Xiaomei Ji  <xji@chromium.org>
+
+        Reviewed by Dimitri Glazkov
+
+        This patch fixes [chromium] RTL <select> dropdown box expands to right
+        instead of left.
+        https://bugs.webkit.org/show_bug.cgi?id=37232
+
+        No automatic test is possible.
+
+        * manual-tests/select_dropdown_box_alignment.html: Added.
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::layout): Adjust the x-axis of dropdown box 
+        for RTL.
+
+2010-04-21  anton muhin  <antonm@google.com>
+
+        Reviewed by Adam Barth.
+
+        [v8] Bail out if fetching of Object.prototype fails.
+        https://bugs.webkit.org/show_bug.cgi?id=37661
+
+        If for any reason we failed to fetch Object.prototype, context cannot
+        be properly initialized and we bail out.
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::initContextIfNeeded): bail out if installHiddenObjectPrototype failed
+        (WebCore::V8DOMWindowShell::installHiddenObjectPrototype): bail out if failed to fetch Object.prototype
+        * bindings/v8/V8DOMWindowShell.h: return false if installHiddenObjectPrototype failed
+
+2010-04-21  Timothy Hatcher  <timothy@apple.com>
+
+        Make UserContentURLPattern correctly check for subdomains and the URL
+        has the same suffix as the pattern. Also improve the parsing of the host.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37357
+
+        Reviewed by Darin Adler.
+
+        * page/UserContentURLPattern.cpp:
+        (WebCore::UserContentURLPattern::parse): Simplify the subdomain pattern parsing to
+        simply check for "*" only or a "*." prefix and then do a substring.
+        (WebCore::UserContentURLPattern::matchesHost): Check that the host has a "." in the
+        position before the suffix to ensure it a subdomain and not just a suffix match.
+
+2010-04-21  Xan Lopez  <xlopez@igalia.com>
+
+        Try to fix compilation on GTK+ debug bots.
+
+        * bindings/gobject/WebKitDOMBinding.cpp:
+        (WebKit::createWrapper):
+
+2010-04-21  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        List item markers are not always updated after changes in the DOM.
+        https://bugs.webkit.org/show_bug.cgi?id=37060
+
+        In particular, they would not be updated when adding/removing an item
+        that is not a direct child of the list element.
+
+        Tests: fast/lists/ol-nested-items-dynamic-insert.html
+               fast/lists/ol-nested-items-dynamic-remove.html
+               fast/lists/ol-nested-items.html
+               fast/lists/ol-nested-list-dynamic-insert.html
+               fast/lists/ol-nested-list-dynamic-remove.html
+               fast/lists/ol-nested-list.html
+
+        * rendering/RenderListItem.cpp:
+        (WebCore::updateListMarkerNumbers): Change it to traverse the whole subtree of a list, not only siblings of an item.
+        * rendering/RenderListItem.h:
+        * rendering/RenderObject.cpp: Move the updateListMarkerNumbers function to RenderListItem.cpp.
+        (WebCore::RenderObject::addChild): Move the code updating list markers to RenderObjectChildList for consistency.
+        * rendering/RenderObjectChildList.cpp: Move the updateListMarkerNumbers function to RenderListItem.cpp.
+        (WebCore::RenderObjectChildList::removeChildNode): Pass the actual node being removed, not the next sibling.
+        (WebCore::RenderObjectChildList::appendChildNode): Pass the actual node being added, not the next sibling.
+        (WebCore::RenderObjectChildList::insertChildNode): Pass the actual node being added, not the next sibling.
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::markerTextForListItem):
+
+2010-04-21  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Adam Barth.
+
+        [GTK] GObject DOM bindings
+        https://bugs.webkit.org/show_bug.cgi?id=33590
+
+        Initial version of the GObject DOM bindings.
+
+        Only bindings for Node.idl and a few of its dependencies are
+        provided, without public API to access them at the
+        moment. References to the Document interfaces and to
+        EventListeners in Node.idl are ignored for GObject to make the
+        initial patch as small as possible, but will be enabled in a
+        follow-up patch.
+
+        * GNUmakefile.am:
+        * bindings/gobject/ConvertToUTF8String.cpp: Added.
+        (convertToUTF8String):
+        * bindings/gobject/ConvertToUTF8String.h: Added.
+        * bindings/gobject/WebKitDOMBinding.cpp: Added.
+        (WebKit::domObjects):
+        (WebKit::DOMObjectCache::get):
+        (WebKit::DOMObjectCache::put):
+        (WebKit::DOMObjectCache::forget):
+        (WebKit::createWrapper):
+        (WebKit::kit):
+        * bindings/gobject/WebKitDOMBinding.h: Added.
+        * bindings/gobject/WebKitDOMObject.cpp: Added.
+        (webkit_dom_object_init):
+        (webkit_dom_object_class_init):
+        * bindings/gobject/WebKitDOMObject.h: Added.
+        * bindings/scripts/CodeGeneratorGObject.pm: Added.
+        * bindings/scripts/gobject-generate-headers.pl: Added.
+        * dom/Node.idl:
+
+2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
+
+        Reviewed by Xan Lopez.
+
+        Wrong header being included in FontPlatformDataCairo.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37829
+
+        No behavior changes, so no new tests were added.
+
+        * platform/graphics/cairo/FontPlatformDataCairo.cpp:
+
+2010-04-21  Adam Roben  <aroben@apple.com>
+
+        Fix leaks of FilterData/SVGFilterBuilder in RenderSVGResourceFilter
+
+        Fixes <http://webkit.org/b/37922>.
+
+        Reviewed by Dave Hyatt.
+
+        * rendering/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource): Use an OwnPtr to
+        hold the heap-allocated FilterData object, so that we won't leak it
+        when we bail out of this function on error.
+
+2010-04-21  Zoltan Herczeg  <zherczeg@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] startAnimation() is not needed to preceede nativeImageForCurrentFrame()
+        https://bugs.webkit.org/show_bug.cgi?id=37844
+
+        nativeImageForCurrentFrame() resets the m_decoder parameter under Qt,
+        which is required by startAnimation() to detect frame and repetition counts.
+        Hence, Image::drawTiled cannot start animations under Qt:
+        <html><body background="animated.gif"></body></html> does not work
+
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+
+2010-04-21  Benjamin Poulain  <ikipou@gmail.com>
+
+        Reviewed by Simon Fraser.
+
+        Update of fixed elements is not made correctly when the page has been scrolled
+        https://bugs.webkit.org/show_bug.cgi?id=36783
+
+        When a fixed element was updated, the old geometry was not repainted correctly
+        because the repaint rect was cached during the layout and not updated when 
+        scrolling.
+
+        The rect is now updated while scrolling so the region updated correspond to the
+        region of the element on the screen.
+
+        The method RenderLayer::updateRepaintRectsAfterScroll() updates
+        the repaint rect of all fixed tree after scroll.
+
+        Tests: fast/repaint/fixed-child-move-after-scroll.html
+               fast/repaint/fixed-child-of-fixed-move-after-scroll.html
+               fast/repaint/fixed-child-of-transformed-move-after-scroll.html
+               fast/repaint/fixed-move-after-scroll.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollPositionChanged):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateRepaintRectsAfterScroll):
+        * rendering/RenderLayer.h:
+
+2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
+
+        Reviewed by Adam Roben.
+
+        Update EFL port to match recent API changes.
+        http://webkit.org/b/37853
+
+        No behavior changes, so no new tests were added.
+
+        * platform/efl/FileSystemEfl.cpp:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::missingPluginText):
+        (WebCore::crashedPluginText):
+        * platform/efl/MIMETypeRegistryEfl.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/graphics/efl/ImageEfl.cpp:
+
+2010-04-21  Avi Drissman  <avi@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        JPG images fail to print in Chromium
+        https://bugs.webkit.org/show_bug.cgi?id=37796
+
+        Image sources of JPG data with final=false fail to draw into PDF contexts even if later updated (<rdar://problem/7874035>). Therefore, destroy and re-create the image source when the final data arrives.
+
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::setData):
+
+2010-04-21  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        EventSource needs to be marked as an ActiveDomType.
+        https://bugs.webkit.org/show_bug.cgi?id=37857
+        Existing layout tests (fast/eventsource and http/tests/eventsource/) should pass when compiling with eventsource enabled.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/custom/V8EventSourceConstructor.cpp:
+        (WebCore::V8EventSource::constructorCallback):
+
+2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Add missing includes to platform/posix/FileSystemPOSIX.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37861
+
+        No behavior changes, so no new tests were added.
+
+        * platform/posix/FileSystemPOSIX.cpp:
+
+2010-04-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Simon Fraser.
+
+        [Qt] Fix or remove the runtime flag for accelerated compositing.
+
+        This adds a way for a chrome client to disallow layers from becoming composited,
+        even if the settings enable accelerated compositing. This is necessary for platforms
+        where different views can be applied with the same settings to the same page.
+
+        We enable an API through ChromeClient to ask the chrome-client whether or not
+        it can render composited layers, which is taken into account when the compositor
+        decides whether or not to start compositing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37313
+
+        Pages under LayoutTests/compositing now work under QWebView, even when
+        QWebSettings::AcceleratedCompositingEnabled is on.
+
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::allowsAcceleratedCompositing):
+        * platform/qt/QWebPageClient.h:
+        (QWebPageClient::allowsAcceleratedCompositing):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::canBeComposited):
+
+2010-04-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        No review. Spurious whitespace was removed from project file.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-04-20  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [Qt] Build fix: warning on L933 of CompositeEditCommand.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37912
+
+        Replaced the ternary operator by an if statement because GCC was confused by the use of
+        ternary operator and producing warnings on Qt builds.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::moveParagraphs):
+
+2010-04-20  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Justin Garcia.
+
+        Nested <ul>s are mishandled when converted to <ol> using execCommand('insertorderedlist')
+        https://bugs.webkit.org/show_bug.cgi?id=19539
+
+        Fixes a bug where two consecutive lists are not merged if they have been converted
+        from ordered/unordered lists inside another list.
+
+        The bug was caused by InsertListCommand::doApply where it did not merge a newly inserted
+        list element and its neighbors. This patch adds code to doApply so that after inserting
+        the list element, it updates previousList and nextList to the outermost list elements around
+        insertionPos under the same enclosing list. Because the next and the previous list elements
+        are not necessarily visually next to the newly inserted element before moveParagraph moves
+        the paragraph into the new list element, doApply merges lists after moveParagraph is called.
+
+        Test: editing/execCommand/insert-lists-inside-another-list.html
+
+        * editing/InsertListCommand.cpp:
+        (WebCore::InsertListCommand::doApply): Modified as described above
+        * editing/htmlediting.cpp:
+        (WebCore::outermostEnclosingList): Added rootNode. Returns the outermost list element,
+          which is a descendent of rootNode.
+        * editing/htmlediting.h:
+
+2010-04-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37776
+        <rdar://problem/7877716> REGRESSION: When using dvorak, keydown/keyup reports qwerty keyCodes
+
+        * platform/cocoa/KeyEventCocoa.mm: (WebCore::windowsKeyCodeForCharCode): Re-added mapping
+        for Roman letters and punctuation.
+
+        * platform/mac/KeyEventMac.mm: (WebCore::windowsKeyCodeForKeyEvent): Improved approximation
+        of IE behavior. Keyboard layouts that change location of Roman letters (like AZERTY or Dvorak)
+        also switch their keycodes. Also, restored Safari 4 behavior for punctuation. It's difficult
+        to match Windows for punctuation exactly, because keyboard layouts make arbitrary changes
+        to their keycodes.
+
+2010-04-20  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler and Alexey Proskuryakov.
+
+        A backslash in EUC-JP becomes to a yen sign when it is copied
+        https://bugs.webkit.org/show_bug.cgi?id=36419
+
+        Tests: editing/execCommand/transpose-backslash-with-euc.html
+               editing/pasteboard/copy-backslash-with-euc.html
+
+        * editing/Editor.cpp: Remove an unnecessary displayStringModifiedByEncoding calls.
+        (WebCore::Editor::addToKillRing):
+        * editing/TextIterator.cpp: TextIterator can use RenderText::textWithoutTranscoding and now plainText() uses this version
+        (WebCore::TextIterator::TextIterator):
+        (WebCore::TextIterator::init):
+        (WebCore::TextIterator::emitText):
+        (WebCore::plainTextToMallocAllocatedBuffer):
+        * editing/TextIterator.h:
+        (WebCore::):
+        * platform/mac/PasteboardMac.mm: Remove an unnecessary displayStringModifiedByEncoding call.
+        (WebCore::Pasteboard::writeSelection):
+        * platform/text/TextEncoding.h: Make backslashAsCurrencySymbol public.
+        * rendering/RenderText.cpp: Add RenderText::textWithoutTranscoding
+        (WebCore::RenderText::RenderText):
+        (WebCore::RenderText::updateNeedsTranscoding):
+        (WebCore::RenderText::styleDidChange):
+        (WebCore::isInlineFlowOrEmptyText):
+        (WebCore::RenderText::previousCharacter):
+        (WebCore::RenderText::setTextInternal):
+        (WebCore::RenderText::textWithoutTranscoding):
+        (WebCore::RenderText::transformText):
+        * rendering/RenderText.h:
+        * rendering/RenderTextControl.cpp: Remove an unnecessary displayStringModifiedByEncoding call.
+        (WebCore::RenderTextControl::setInnerTextValue):
+        (WebCore::RenderTextControl::finishText):
+        * rendering/RenderTextFragment.cpp:
+        (WebCore::RenderTextFragment::previousCharacter):
+        * rendering/RenderTextFragment.h:
+
+2010-04-20  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37367
+
+        Fix style violations in code generated by CodeGeneratorV8.pm.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/test/V8TestObj.cpp:
+        * bindings/v8/test/V8TestObj.h:
+
+2010-04-20  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57924.
+        http://trac.webkit.org/changeset/57924
+        https://bugs.webkit.org/show_bug.cgi?id=37898
+
+        It broke 3-4 test on all bot (Requested by Ossy on #webkit).
+
+        * page/AbstractView.idl:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::media):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 37895 - Share common code from UStringImplBase with StringImpl
+        Add forwarding header.
+
+        * ForwardingHeaders/wtf/text/StringImplBase.h: Added.
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed build fix fro Chromium.
+
+        * loader/DocumentWriter.cpp:
+
+2010-04-20  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Support live edit while on a breakpoint, preserve breakpoints when adding new lines.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37820
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.editScriptLine.mycallback):
+        (WebInspector.ScriptsPanel.prototype.editScriptLine):
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer.prototype._handleDoubleClick):
+        (WebInspector.TextViewer.prototype._cancelEditingLine):
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        This patch separates the begin/write/end cycle of decoding network
+        bytes and putting them into a document from the rest of the loading
+        machinery.  The code and state required to write bytes into a document
+        doesn't interact very much with the rest of the loading machinery.
+
+        No tests because there is no behavior change (hopefully!).
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * dom/Document.cpp:
+        (WebCore::Document::close):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::scriptCharset):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::requestPreload):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        * loader/DocumentWriter.cpp: Added.
+        * loader/DocumentWriter.h: Added.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::FrameLoader):
+        (WebCore::FrameLoader::init):
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::setURL):
+        (WebCore::FrameLoader::didBeginDocument):
+        (WebCore::FrameLoader::didEndDocument):
+        (WebCore::FrameLoader::willSetEncoding):
+        (WebCore::FrameLoader::addData):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::finishedLoadingDocument):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::writer):
+        (WebCore::FrameLoader::isDisplayingInitialEmptyDocument):
+        * loader/MediaDocument.cpp:
+        (WebCore::MediaDocument::replaceMediaElementTimerFired):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::createDocumentStructure):
+        * platform/network/FormDataBuilder.cpp:
+        (WebCore::FormDataBuilder::dataEncoding):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
+2010-04-20  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Rename window.media to window.styleMedia
+        https://bugs.webkit.org/show_bug.cgi?id=36187
+
+        It has been defined that the AbstractView media extension
+        defined in the CSSOM View spec should be renamed to styleMedia.
+        This patch does that and updates the current layout tests
+        making use of it.
+
+        * page/AbstractView.idl:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::styleMedia):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+
+2010-04-20  Timothy Hatcher  <timothy@apple.com>
+
+        Fix matching of "file:///*" patterns by not trying to compare the host. The host is
+        irrelevant for file URLs.
+
+        Also fix comparisons to be case insensitive.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37889
+
+        Reviewed by Dave Hyatt.
+
+        * page/UserContentURLPattern.cpp:
+        (WebCore::UserContentURLPattern::parse): Use equalIgnoringCase when comparing for "file" schemes.
+        (WebCore::UserContentURLPattern::matches): Use equalIgnoringCase when comparing schemes. Only call
+        matchesHost if the scheme isn't "file".
+        (WebCore::UserContentURLPattern::matchesHost): Call equalIgnoringCase when comparing hosts. The endsWith
+        was already doing a case-insensitive compare, so existing tests worked though this path.
+
+2010-04-20  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Invalid cast due to <video> inside <foreignObject> inside <svg> inside <img>
+        https://bugs.webkit.org/show_bug.cgi?id=37331
+
+        Added a setting to enable/disable media per-page and have the SVGImage 
+        disable media for its dummy page. Also found and fixed a related bad
+        cast in the V8 bindings (JSC had a custom wrapper for this already).
+
+        Tests: media/svg-as-image-with-media-blocked.html
+
+        * dom/make_names.pl: Added media enabled check and V8 cast wrapper
+        * page/Settings.cpp: Added m_isMediaEnabled (defaults to true)
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setMediaEnabled):
+        * page/Settings.h:
+        (WebCore::Settings::isMediaEnabled):
+        * svg/graphics/SVGImage.cpp: Disables media in dummy page
+        (WebCore::SVGImage::dataChanged):
+
+2010-04-19  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial Navigation: at @updateFocusCandidateIfCloser make an assignment shortcut when FocusCandidate is null
+        https://bugs.webkit.org/show_bug.cgi?id=37802
+
+        In updateFocusCandidateIfCloser method, we do all bail out checks in the begining of
+        the method body. If after those bail out checks, no "best FocusCandidate" has been taken
+        yet (i.e. focusCandidate.isNull() == true), we can safely take the current candidate,
+        and exit earlier.
+
+        No behavior change, it is just a safe assignment shortcut.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+
+2010-04-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Hook compositing layers together across iframes
+        https://bugs.webkit.org/show_bug.cgi?id=37878
+        
+        First step: if an iframe's document goes into compositing mode, also throw the parent
+        document into compositing mode (all the way up to the root). This is required both
+        to preserve layering (since parent document content can obscure iframe content),
+        and so that we can eventually hook the layer trees together.
+
+        Test: compositing/iframes/composited-iframe.html
+
+        * rendering/RenderIFrame.h:
+        * rendering/RenderIFrame.cpp:
+        (WebCore::RenderIFrame::requiresLayer): In order to make an iframe composited, it also has to have
+        a RenderLayer, so must return |true| from requiresLayer().
+        (WebCore::RenderIFrame::requiresAcceleratedCompositing): Returns true if the content document
+        is in compositing mode.
+        (WebCore::RenderIFrame::isRenderIFrame): Required so that RenderLayerCompositor can check
+        if a renderer is an iframe.
+        (WebCore::toRenderIFrame): Required so that RenderLayerCompositor can cast to a RenderIFrame.
+
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::enableCompositingMode): Call out to the RenderView when
+        the compositing mode changes, so that the parent document can update its compositing status.
+        (WebCore::RenderLayerCompositor::requiresCompositingLayer): Call requiresCompositingForIFrame().
+        (WebCore::RenderLayerCompositor::requiresCompositingForIFrame): Check to see if the iframe
+        wants to be composited.
+
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isRenderIFrame): Base class returns false.
+
+        * rendering/RenderView.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::compositingStateChanged): New method that allows an iframe to notify
+        its parent document that a recalcStyle is required, to update compositing state.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (build fix).
+        Speculative tiger build fix.
+
+        * WebCore.NPAPI.exp:
+        * WebCore.PluginHostProcess.exp:
+        * WebCore.base.exp:
+
+2010-04-20  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: add basic script editing capabilities to the front-end.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37875
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        * inspector/front-end/ScriptView.js:
+        (WebInspector.ScriptView):
+        (WebInspector.ScriptView.prototype._editLine):
+        (WebInspector.ScriptView.prototype._editLineComplete):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+        (WebInspector.ScriptsPanel.prototype.canEditScripts):
+        (WebInspector.ScriptsPanel.prototype.editScriptLine):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame):
+        (WebInspector.SourceFrame.prototype.updateContent):
+        (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter):
+        (WebInspector.TextEditorHighlighter.prototype.reset):
+        * inspector/front-end/TextEditorModel.js:
+        (WebInspector.TextEditorModel.prototype.copyRange):
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer):
+        (WebInspector.TextViewer.prototype.set editCallback):
+        (WebInspector.TextViewer.prototype._buildChunks):
+        (WebInspector.TextViewer.prototype._handleKeyDown):
+        (WebInspector.TextViewer.prototype._handleDoubleClick):
+        (WebInspector.TextViewer.prototype._commitEditingLine):
+        (WebInspector.TextViewer.prototype._cancelEditingLine):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown):
+        (WebInspector.log.logMessage):
+        (WebInspector.log):
+        (WebInspector.isEditingAnyField):
+        (WebInspector.startEditing.cleanUpAfterEditing):
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Add forwarding header.
+
+        * ForwardingHeaders/runtime/RopeImpl.h: Added.
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 37828 - Move WebCore's String classes to WTF
+
+        Move these classes up to WTF so they are available to all clients of WTF (in
+        particular JSC).
+
+        As a first patch, making the most minimal change possible, since this patch
+        could easily grow rather large since we'll have to change every class forward
+        declaration ( e.g. every "namespace WebCore { class String; }" much change to
+        "namespace WTF { class String; }").
+
+        Moving the files, but leaving the classes logically in the WebCore namespace –
+        which is technically a layering violation – I'll come back and fix this up in a
+        subsequent patch.
+
+        * Android.mk:
+        * ForwardingHeaders/wtf/StaticConstructors.h: Added.
+        * ForwardingHeaders/wtf/text/AtomicString.h: Added.
+        * ForwardingHeaders/wtf/text/AtomicStringImpl.h: Added.
+        * ForwardingHeaders/wtf/text/StringBuffer.h: Added.
+        * ForwardingHeaders/wtf/text/StringHash.h: Added.
+        * ForwardingHeaders/wtf/text/StringImpl.h: Added.
+        * ForwardingHeaders/wtf/text/WTFString.h: Added.
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/MediaFeatureNames.cpp:
+        * dom/QualifiedName.cpp:
+        * dom/make_names.pl:
+        * platform/StaticConstructors.h: Removed.
+        * platform/text/AtomicString.cpp: Removed.
+        * platform/text/AtomicString.h:
+        * platform/text/AtomicStringImpl.h:
+        * platform/text/PlatformString.h:
+        * platform/text/String.cpp:
+        * platform/text/StringHash.h:
+        * platform/text/StringImpl.cpp: Removed.
+        * platform/text/StringImpl.h:
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        Change PassRefPtr<FileChooser> parameter of chooseIconForFiles()
+        to FileChooser*. Though an implementation of chooseIconForFiles()
+        might have ownership of the FileChooser instance, we don't need to
+        use PassRefPtr<> in this case.
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyChromeClient::chooseIconForFiles):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::chooseIconForFiles):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+
+2010-04-20  Diego Escalante Urrelo  <descalante@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Evaluate and create tests for all the AtkRole's implemented by
+        WebKitGtk
+        https://bugs.webkit.org/show_bug.cgi?id=34449
+
+        Implement ATK_ROLE_FORM.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_get_role):
+
+2010-04-20  Martin Robinson  <mrobinson@webkit.org>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] Enable DOM clipboard and drag-and-drop access
+        https://bugs.webkit.org/show_bug.cgi?id=30623
+
+        Move most of the PasteboardHelper logic into WebCore. This helps
+        prepare for WebKit2 and leads to a clearer separation of concerns
+        between the WebKit and WebCore layers.
+
+        No new tests as functionality has not changed.
+
+        * GNUmakefile.am: Add PastboardHelper.cpp to list of sources.
+        * platform/Pasteboard.h: Added a getter for the PasteboardHelper and made the member private.
+        * platform/gtk/PasteboardGtk.cpp: Update PasteboardHelper method calls to use new naming.
+        (WebCore::clipboard_get_contents_cb): Ditto.
+        (WebCore::Pasteboard::helper): Added, member is now private.
+        (WebCore::Pasteboard::writeURL): Ditto.
+        (WebCore::Pasteboard::documentFragment): Update to reflect method renaming.
+        (WebCore::Pasteboard::plainText): Ditto.
+        * platform/gtk/PasteboardHelper.cpp: Added.
+        (WebCore::PasteboardHelper::PasteboardHelper): Added.
+        (WebCore::PasteboardHelper::~PasteboardHelper): Added.
+        (WebCore::PasteboardHelper::initializeTargetList): Added, originally from WebKit.
+        (WebCore::widgetFromFrame): Added helper function.
+        (WebCore::PasteboardHelper::getCurrentClipboard): Added, originally from WebKit.
+        (WebCore::PasteboardHelper::getClipboard): Ditto.
+        (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Ditto.
+        (WebCore::PasteboardHelper::targetList): Ditto.
+        (WebCore::PasteboardHelper::fillSelectionData): Ditto.
+        (WebCore::PasteboardHelper::targetListForDataObject): Ditto.
+        (WebCore::getClipboardContentsCallback): Ditto.
+        (WebCore::clearClipboardContentsCallback): Ditto.
+        (WebCore::PasteboardHelper::writeClipboardContents): Ditto.
+        * platform/gtk/PasteboardHelper.h: Moved methods from WebKit to WebCore.
+
+2010-04-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        backgroundColor is oddly indented in layer tree dump
+        https://bugs.webkit.org/show_bug.cgi?id=37885
+
+        The writeIndent() was mistakenly outside the LayerTreeAsTextDebug clause, causing indents
+        to be written twice.
+        
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::dumpProperties):
+
+2010-04-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Clean up RenderPart/RenderPartObject/RenderFrame/RenderEmbeddedObject
+        https://bugs.webkit.org/show_bug.cgi?id=37741
+
+        RenderPartObject is a useless intermediate class between RenderPart and
+        RenderEmbeddedObject, and we can now remove it. Its only method, viewCleared(),
+        applies to objects and embeds when the content is a FrameView, so can move
+        to RenderEmbeddedObject.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::RenderEmbeddedObject):
+        (WebCore::RenderEmbeddedObject::requiresLayer):
+        (WebCore::RenderEmbeddedObject::paint):
+        (WebCore::RenderEmbeddedObject::viewCleared):
+        * rendering/RenderEmbeddedObject.h:
+        * rendering/RenderFrameBase.h:
+        * rendering/RenderPart.cpp:
+        (WebCore::RenderPart::RenderPart):
+        * rendering/RenderPart.h:
+        * rendering/RenderPartObject.cpp: Removed.
+        * rendering/RenderPartObject.h: Removed.
+
+2010-04-20  Robin Cao  <robin.webkit@gmail.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVG no AnimateColor for stroke or fill if they are set to none on target.
+        https://bugs.webkit.org/show_bug.cgi?id=36718
+
+        SVGAnimateElement::resetToBaseValue reset 'm_propertyType' in the process of animation.
+        This will cause problems when attributes 'fill' and 'stroke' have the value 'none', because in this case 
+        the property type determined by base value may be different from the one determined by 'fromTo' values.
+
+        No new tests. The test suite in svg/animation is not working for target element with attribute 'fill' set to 'none'.
+        Now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.
+
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::calculateFromAndToValues):
+        (WebCore::SVGAnimateElement::resetToBaseValue):
+
+2010-04-20  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57892.
+        http://trac.webkit.org/changeset/57892
+        https://bugs.webkit.org/show_bug.cgi?id=37864
+
+        Caused an assertion in Mac builds (Requested by smfr on
+        #webkit).
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * editing/Editor.cpp:
+        (WebCore::Editor::insideVisibleArea):
+        * page/Frame.cpp:
+        (WebCore::Frame::ownerRenderer):
+        * page/Frame.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::~FrameView):
+        (WebCore::FrameView::clear):
+        (WebCore::FrameView::invalidateRect):
+        (WebCore::FrameView::createScrollbar):
+        * rendering/RenderFrameBase.h:
+        * rendering/RenderObject.h:
+
+2010-04-20  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        RenderListItem: change enclosingList() to only traverse the render tree.
+        https://bugs.webkit.org/show_bug.cgi?id=37319
+
+        This makes the function safe to use for items with nodes that are detached from
+        the DOM tree and simplifies the code quite a bit.
+
+        Covered by existing tests.
+
+        * rendering/RenderListItem.cpp:
+        (WebCore::enclosingList):
+        (WebCore::previousListItem):
+        (WebCore::RenderListItem::explicitValueChanged):
+
+2010-04-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Clean up RenderPart/RenderPartObject/RenderFrame/RenderEmbeddedObject
+        https://bugs.webkit.org/show_bug.cgi?id=37741
+
+        Make Frame::ownerRenderer() return a RenderFrameBase* rather than a
+        RenderPart*, and add the necessary toRenderFrameBase() and isRenderFrameBase().
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * editing/Editor.cpp:
+        (WebCore::Editor::insideVisibleArea):
+        * page/Frame.cpp:
+        (WebCore::Frame::ownerRenderer):
+        * page/Frame.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::~FrameView):
+        (WebCore::FrameView::clear):
+        (WebCore::FrameView::invalidateRect):
+        (WebCore::FrameView::createScrollbar):
+        * rendering/RenderFrameBase.h:
+        (WebCore::RenderFrameBase::isRenderFrameBase):
+        (WebCore::toRenderFrameBase):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isRenderFrameBase):
+
+2010-04-20  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Pressing tab now closes the select popup as it should.
+        https://bugs.webkit.org/show_bug.cgi?id=37721
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupListBox::handleKeyEvent):
+
+2010-04-20  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Null value should be legit value for wrapped types. This requires some cleanup in canvas which was missing built-in null argument checks;
+        https://bugs.webkit.org/show_bug.cgi?id=37810
+
+        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+        (WebCore::JSCanvasRenderingContext2D::drawImage): Passes ec to drawImage(3) too
+        * bindings/scripts/CodeGeneratorV8.pm: A null value is now legit value for wrapped types.
+        * bindings/v8/test/V8TestObj.cpp:
+        (WebCore::TestObjInternal::overloadedMethodCallback):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage): Added null checks.
+        (WebCore::CanvasRenderingContext2D::createPattern): Added null checks.
+        * html/canvas/CanvasRenderingContext2D.h: Added needed raises "DOMException".
+        * html/canvas/CanvasRenderingContext2D.idl: Added needed raises "DOMException".
+
+2010-04-20  Evan Stade  <estade@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] crash when dragging images
+        https://bugs.webkit.org/show_bug.cgi?id=37715
+
+        NULL check the return value of nativeImageForCurrentFrame(),
+        and NULL check Image just for good measure.
+
+        Tested by new DragImageTest unit test.
+
+        * platform/chromium/DragImageChromiumSkia.cpp:
+        (WebCore::createDragImageFromImage):
+
+2010-04-20  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResourceFilter needs to be moved to under Renderers
+        https://bugs.webkit.org/show_bug.cgi?id=35320
+
+        This patch adds a renderer for SVGFilterElement. SVGFilterElement is now independent
+        from the SVGResources.
+        A clean-up solves the dependencies between SVGFilterElement, the filter primitives
+        and SVGResources. This shall make the filter code more readable and better maintable.
+        The Filter primitives get dumped now, as long as they have externalRepresentation
+        implemented.
+
+        No behavior changes, so no new tests were added.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::selfWillPaint):
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGResource.h:
+        (WebCore::):
+        (WebCore::RenderSVGResource::postApplyResource):
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        * rendering/RenderSVGResourceClipper.h:
+        * rendering/RenderSVGResourceFilter.cpp: Added.
+        (WebCore::RenderSVGResourceFilter::RenderSVGResourceFilter):
+        (WebCore::RenderSVGResourceFilter::~RenderSVGResourceFilter):
+        (WebCore::RenderSVGResourceFilter::invalidateClients):
+        (WebCore::RenderSVGResourceFilter::invalidateClient):
+        (WebCore::RenderSVGResourceFilter::buildPrimitives):
+        (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize):
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        (WebCore::RenderSVGResourceFilter::resourceBoundingBox):
+        * rendering/RenderSVGResourceFilter.h: Added.
+        (WebCore::FilterData::FilterData):
+        (WebCore::RenderSVGResourceFilter::renderName):
+        (WebCore::RenderSVGResourceFilter::filterUnits):
+        (WebCore::RenderSVGResourceFilter::primitiveUnits):
+        (WebCore::RenderSVGResourceFilter::resourceType):
+        * rendering/RenderSVGResourceMarker.h:
+        (WebCore::RenderSVGResourceMarker::applyResource):
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        * rendering/RenderSVGResourceMasker.h:
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::selfWillPaint):
+        (WebCore::RenderSVGRoot::paint):
+        * rendering/RenderSVGText.cpp:
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        (WebCore::SVGRenderBase::finishRenderSVGContent):
+        (WebCore::SVGRenderBase::filterBoundingBoxForRenderer):
+        (WebCore::deregisterFromResources):
+        * rendering/SVGRenderSupport.h:
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+        (WebCore::writeSVGResource):
+        (WebCore::writeResources):
+        (WebCore::writeRenderResources):
+        * rendering/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBoxPaintWalker::SVGRootInlineBoxPaintWalker):
+        (WebCore::SVGRootInlineBox::paint):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::build):
+        * svg/SVGFEBlendElement.h:
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::build):
+        * svg/SVGFEColorMatrixElement.h:
+        * svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::build):
+        * svg/SVGFEComponentTransferElement.h:
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::build):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::build):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::build):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::build):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::build):
+        * svg/SVGFEMergeElement.h:
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::build):
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::build):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::build):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::build):
+        * svg/SVGFETurbulenceElement.h:
+        (WebCore::):
+        * svg/SVGFilterElement.cpp:
+        (WebCore::SVGFilterElement::createRenderer):
+        * svg/SVGFilterElement.h:
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::setStandardAttributes):
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::isFilterEffect):
+        (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/graphics/SVGResource.cpp:
+        * svg/graphics/SVGResource.h:
+        (WebCore::):
+        (WebCore::SVGResource::isPaintServer):
+        * svg/graphics/SVGResourceFilter.cpp: Removed.
+        * svg/graphics/SVGResourceFilter.h: Removed.
+        * svg/graphics/filters/SVGFEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::externalRepresentation):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore::SVGFilterBuilder::namedEffects):
+
+2010-04-20  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57880.
+        http://trac.webkit.org/changeset/57880
+        https://bugs.webkit.org/show_bug.cgi?id=37846
+
+        Broke several bots, FEDisplacmentMap dumps includes pointers,
+        no one noticed. Dirk will upload a new patch later. (Requested
+        by WildFox on #webkit).
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::selfWillPaint):
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGResource.h:
+        (WebCore::):
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        * rendering/RenderSVGResourceClipper.h:
+        * rendering/RenderSVGResourceFilter.cpp: Removed.
+        * rendering/RenderSVGResourceFilter.h: Removed.
+        * rendering/RenderSVGResourceMarker.h:
+        (WebCore::RenderSVGResourceMarker::applyResource):
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        * rendering/RenderSVGResourceMasker.h:
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::selfWillPaint):
+        (WebCore::RenderSVGRoot::paint):
+        * rendering/RenderSVGText.cpp:
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        (WebCore::SVGRenderBase::finishRenderSVGContent):
+        (WebCore::SVGRenderBase::filterBoundingBoxForRenderer):
+        (WebCore::deregisterFromResources):
+        * rendering/SVGRenderSupport.h:
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+        (WebCore::writeSVGResource):
+        (WebCore::writeResources):
+        (WebCore::writeRenderResources):
+        * rendering/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBoxPaintWalker::SVGRootInlineBoxPaintWalker):
+        (WebCore::SVGRootInlineBox::paint):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::build):
+        * svg/SVGFEBlendElement.h:
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::build):
+        * svg/SVGFEColorMatrixElement.h:
+        * svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::build):
+        * svg/SVGFEComponentTransferElement.h:
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::build):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::build):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::build):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::build):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::build):
+        * svg/SVGFEMergeElement.h:
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::build):
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::build):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::build):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::build):
+        * svg/SVGFETurbulenceElement.h:
+        (WebCore::):
+        * svg/SVGFilterElement.cpp:
+        (WebCore::SVGFilterElement::buildFilter):
+        (WebCore::SVGFilterElement::canvasResource):
+        * svg/SVGFilterElement.h:
+        (WebCore::SVGFilterElement::rendererIsNeeded):
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::setStandardAttributes):
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::isFilterEffect):
+        (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/graphics/SVGResource.cpp:
+        * svg/graphics/SVGResource.h:
+        (WebCore::):
+        (WebCore::SVGResource::isFilter):
+        * svg/graphics/SVGResourceFilter.cpp: Added.
+        (WebCore::SVGResourceFilter::SVGResourceFilter):
+        (WebCore::SVGResourceFilter::~SVGResourceFilter):
+        (WebCore::SVGResourceFilter::filterBoundingBox):
+        (WebCore::shouldProcessFilter):
+        (WebCore::SVGResourceFilter::addFilterEffect):
+        (WebCore::SVGResourceFilter::fitsInMaximumImageSize):
+        (WebCore::SVGResourceFilter::prepareFilter):
+        (WebCore::SVGResourceFilter::applyFilter):
+        (WebCore::SVGResourceFilter::externalRepresentation):
+        (WebCore::getFilterById):
+        * svg/graphics/SVGResourceFilter.h: Added.
+        (WebCore::SVGResourceFilter::create):
+        (WebCore::SVGResourceFilter::resourceType):
+        (WebCore::SVGResourceFilter::setFilterResolution):
+        (WebCore::SVGResourceFilter::setHasFilterResolution):
+        (WebCore::SVGResourceFilter::filterBoundingBoxMode):
+        (WebCore::SVGResourceFilter::setFilterBoundingBoxMode):
+        (WebCore::SVGResourceFilter::effectBoundingBoxMode):
+        (WebCore::SVGResourceFilter::setEffectBoundingBoxMode):
+        (WebCore::SVGResourceFilter::filterRect):
+        (WebCore::SVGResourceFilter::setFilterRect):
+        (WebCore::SVGResourceFilter::scaleX):
+        (WebCore::SVGResourceFilter::scaleY):
+        (WebCore::SVGResourceFilter::setFilterBoundingBox):
+        (WebCore::SVGResourceFilter::builder):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+
+2010-04-20  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResourceFilter needs to be moved to under Renderers
+        https://bugs.webkit.org/show_bug.cgi?id=35320
+
+        This patch adds a renderer for SVGFilterElement. SVGFilterElement is now independent
+        from the SVGResources.
+        A clean-up solves the dependencies between SVGFilterElement, the filter primitives
+        and SVGResources. This shall make the filter code more readable and better maintable.
+        The Filter primitives get dumped now, as long as they have externalRepresentation
+        implemented.
+
+        No behavior changes, so no new tests were added.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::selfWillPaint):
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGResource.h:
+        (WebCore::):
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        * rendering/RenderSVGResourceClipper.h:
+        * rendering/RenderSVGResourceFilter.cpp: Added.
+        (WebCore::RenderSVGResourceFilter::RenderSVGResourceFilter):
+        (WebCore::RenderSVGResourceFilter::~RenderSVGResourceFilter):
+        (WebCore::RenderSVGResourceFilter::invalidateClients):
+        (WebCore::RenderSVGResourceFilter::invalidateClient):
+        (WebCore::RenderSVGResourceFilter::buildPrimitives):
+        (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize):
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        (WebCore::RenderSVGResourceFilter::resourceBoundingBox):
+        * rendering/RenderSVGResourceFilter.h: Added.
+        (WebCore::FilterData::FilterData):
+        (WebCore::RenderSVGResourceFilter::renderName):
+        (WebCore::RenderSVGResourceFilter::filterUnits):
+        (WebCore::RenderSVGResourceFilter::primitiveUnits):
+        (WebCore::RenderSVGResourceFilter::resourceType):
+        * rendering/RenderSVGResourceMarker.h:
+        (WebCore::RenderSVGResourceMarker::applyResource):
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        * rendering/RenderSVGResourceMasker.h:
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::selfWillPaint):
+        (WebCore::RenderSVGRoot::paint):
+        * rendering/RenderSVGText.cpp:
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        (WebCore::SVGRenderBase::finishRenderSVGContent):
+        (WebCore::SVGRenderBase::filterBoundingBoxForRenderer):
+        (WebCore::deregisterFromResources):
+        * rendering/SVGRenderSupport.h:
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+        (WebCore::writeSVGResource):
+        (WebCore::writeResources):
+        (WebCore::writeRenderResources):
+        * rendering/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBoxPaintWalker::SVGRootInlineBoxPaintWalker):
+        (WebCore::SVGRootInlineBox::paint):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::build):
+        * svg/SVGFEBlendElement.h:
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::build):
+        * svg/SVGFEColorMatrixElement.h:
+        * svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::build):
+        * svg/SVGFEComponentTransferElement.h:
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::build):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::build):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::build):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::build):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::build):
+        * svg/SVGFEMergeElement.h:
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::build):
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::build):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::build):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::build):
+        * svg/SVGFETurbulenceElement.h:
+        (WebCore::):
+        * svg/SVGFilterElement.cpp:
+        (WebCore::SVGFilterElement::createRenderer):
+        * svg/SVGFilterElement.h:
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::setStandardAttributes):
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::isFilterEffect):
+        (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/graphics/SVGResource.cpp:
+        * svg/graphics/SVGResource.h:
+        (WebCore::):
+        (WebCore::SVGResource::isPaintServer):
+        * svg/graphics/SVGResourceFilter.cpp: Removed.
+        * svg/graphics/SVGResourceFilter.h: Removed.
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore::SVGFilterBuilder::namedEffects):
+
+2010-04-20  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Maciej Stachowiak (relanding r57829).
+        Added missing JS_EXPORTDATA
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Copied from WebCore/ForwardingHeaders/wtf/WTFThreadData.h.
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::~ThreadGlobalData):
+        * platform/ThreadGlobalData.h:
+        (WebCore::ThreadGlobalData::eventNames):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicStringTable::create):
+        (WebCore::AtomicStringTable::table):
+        (WebCore::AtomicStringTable::destroy):
+        (WebCore::stringTable):
+
+2010-04-20  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        [Qt] GraphicsLayer: support fill-modes
+        https://bugs.webkit.org/show_bug.cgi?id=36216
+        Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
+        enables a key-frame animation to go to the animation's starting point before the delay,
+        and/or to stay at the animation's ending point after its ended, without reverting to the default
+        value.
+        We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
+        and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::AnimationQtBase::AnimationQtBase):
+        (WebCore::TransformAnimationQt::~TransformAnimationQt):
+        (WebCore::TransformAnimationQt::applyFrame):
+        (WebCore::GraphicsLayerQt::addAnimation):
+
+2010-04-19  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by David Hyatt.
+
+        Add missing dummy implementations in PluginPackageNone and PluginViewNone.
+        http://webkit.org/b/37478
+
+        * plugins/PluginPackageNone.cpp:
+        (WebCore::PluginPackage::NPVersion): Add dummy implementation.
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::handleFocusInEvent): Add dummy implementation.
+        (WebCore::PluginView::handleFocusOutEvent): Add dummy implementation.
+
+2010-04-19  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Clean up RenderPart/RenderPartObject/RenderFrame/RenderEmbeddedObject
+        https://bugs.webkit.org/show_bug.cgi?id=37741
+
+        Move m_hasFallbackContent from RenderPart to RenderEmbeddedObject,
+        since it's only used for <object> fallback.
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::RenderEmbeddedObject):
+        * rendering/RenderEmbeddedObject.h:
+        (WebCore::RenderEmbeddedObject::hasFallbackContent):
+        * rendering/RenderPart.cpp:
+        (WebCore::RenderPart::RenderPart):
+        * rendering/RenderPart.h:
+
+2010-04-19  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Clean up RenderPart/RenderPartObject/RenderFrame/RenderEmbeddedObject
+        https://bugs.webkit.org/show_bug.cgi?id=37741
+
+        Add a new renderer for iframes, named RenderIFrame. Add a new shared base class
+        between this and RenderFrame, called RenderFrameBase (following the existing HTMLFrameElementBase),
+        and move code from RenderPart and RenderPartObject into these new classes.
+        
+        There should be no functionality difference with this change, so no new tests.
+        
+        Fixing up renderer names in the layout tests will be done in a later pass.
+        
+        Fix build systems to include the new files.
+        
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::createRenderer):
+        * rendering/RenderEmbeddedObject.h:
+        * rendering/RenderFrame.cpp:
+        (WebCore::RenderFrame::RenderFrame):
+        * rendering/RenderFrame.h:
+        * rendering/RenderFrameBase.cpp: Added.
+        (WebCore::RenderFrameBase::RenderFrameBase):
+        (WebCore::RenderFrameBase::layoutWithFlattening):
+        * rendering/RenderFrameBase.h: Added.
+        * rendering/RenderIFrame.cpp: Added.
+        (WebCore::RenderIFrame::RenderIFrame):
+        (WebCore::RenderIFrame::calcHeight):
+        (WebCore::RenderIFrame::calcWidth):
+        (WebCore::RenderIFrame::flattenFrame):
+        (WebCore::RenderIFrame::layout):
+        * rendering/RenderIFrame.h: Added.
+        (WebCore::RenderIFrame::renderName):
+        * rendering/RenderPart.cpp:
+        * rendering/RenderPart.h:
+        * rendering/RenderPartObject.cpp:
+        * rendering/RenderPartObject.h:
+
+2010-04-19  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Bindings clean-up.
+        https://bugs.webkit.org/show_bug.cgi?id=37833
+
+        Move some WebSQLDatabases logic out of the bindings into
+        DOMWindow.cpp where it should be.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openDatabaseCallback):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+
+2010-04-19  Kevin Ollivier  <kevino@theolliviers.com>
+
+        Fix the Mac builders for now by restoring the keepAlive function.
+
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::keepAlive):
+
+2010-04-19  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix, remove a method that has been moved to PluginView.cpp.
+
+        * plugins/PluginViewNone.cpp:
+
+2010-04-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (rolling out r57829).
+        This broke windows.
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Removed.
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::~ThreadGlobalData):
+        * platform/ThreadGlobalData.h:
+        (WebCore::ThreadGlobalData::atomicStringTable):
+        * platform/text/AtomicString.cpp:
+        (WebCore::stringTable):
+
+2010-04-19  Mark Rowe  <mrowe@apple.com>
+
+        Build fix.
+
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+
+2010-04-19  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: aria-haspopup needs to be exposed
+        https://bugs.webkit.org/show_bug.cgi?id=37808
+
+        Test: platform/mac/accessibility/element-haspopup.html
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::ariaHasPopup):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::ariaHasPopup):
+        (WebCore::AccessibilityRenderObject::determineAriaRoleAttribute):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/mac/AccessibilityObjectWrapper.mm:
+        (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+
+2010-04-19  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fix a crash when rendering <select> elements with WebKit2.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMenuList):
+        Set the current NSGraphicsContext before calling out to AppKit, otherwise the current graphics context
+        could point to a CGContext whose memory has been freed.
+
+2010-04-08  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Manipulating document fragment members while adding it to tree may result in loss of tree integrity.
+        https://bugs.webkit.org/show_bug.cgi?id=36031
+
+        Changes the logic of appending/inserting document fragment to first stashing all of its children
+        to a vector, then processing the vector. This avoids ghastliness that would be caused by mutation
+        events mucking with the document fragment while it's being appended/inserted.
+
+        Test: fast/dom/Node/fragment-mutation.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::targetNodes): Added method to populate a vector of nodes (targets) to be used in
+            inserting/appending operation.
+        (WebCore::ContainerNode::insertBefore): Changed to use vector-based iteration.
+        (WebCore::ContainerNode::appendChild): Ditto.
+        * dom/Node.cpp:
+        (WebCore::Node::checkReplaceChild): Cleaned up comments.
+        (WebCore::Node::checkAddChild): Ditto.
+
+2010-04-19  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix regression introduced in r57820.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::loadNextSourceChild): Create a new MediaPlayer instead of
+        just setting a URL on the one used for the previous <source> element. This restores
+        the behavior prior to the changes for https://bugs.webkit.org/show_bug.cgi?id=37728.
+
+2010-04-19  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37745
+        Move string uniquing tables to (new) WTFThreadData class.
+
+        Remove AtomicString's dependency on ThreadGlobalData so that we can move
+        WebCore's string classes up to WTF.
+
+        * ForwardingHeaders/wtf/WTFThreadData.h: Added.
+        * platform/ThreadGlobalData.cpp: Remove m_atomicStringTable, all wtfThreadData() to ensure threadsafely initialized.
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::~ThreadGlobalData):
+        * platform/ThreadGlobalData.h: Remove m_atomicStringTable.
+        (WebCore::ThreadGlobalData::eventNames):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicStringTable::create):
+        (WebCore::AtomicStringTable::table):
+        (WebCore::AtomicStringTable::destroy):
+        (WebCore::stringTable): Access the AtomicStringTable on wtfThreadData() rather then threadGlobalData().
+
+2010-04-19  Ada Chan  <adachan@apple.com>
+
+        Build fix: wrap Settings::setLocalStorageQuota() and Settings::setSessionStorageQuota()
+        in #if ENABLE(DOM_STORAGE).
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+
+2010-04-19  Dave Moore  <davemoore@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Added notification when the favicons for a page are changed
+        from a script.
+        The Document object will notify the frame loader, which will
+        notify the client. Implementations of FrameLoaderClient will
+        have to add one method; dispatchDidChangeIcons().
+
+        https://bugs.webkit.org/show_bug.cgi?id=33812
+
+        Test: fast/dom/icon-url-property.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::setIconURL):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::setIconURL):
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::iconURL):
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::dispatchDidChangeIcons):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::setIconURL):
+        (WebCore::FrameLoader::didChangeIcons):
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+
+2010-04-19  Ada Chan  <adachan@apple.com>
+
+        Reviewed by Jeremy Orlow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37717
+        Allow clients concerned with memory consumption to set a quota on session storage
+        since the memory used won't be released until the Page is destroyed.
+        The default is noQuota, which matches the current behavior.
+
+        * WebCore.base.exp: Export Settings::setSessionStorageQuota().
+        * page/Page.cpp:
+        (WebCore::Page::sessionStorage):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setSessionStorageQuota):
+        * page/Settings.h:
+        (WebCore::Settings::sessionStorageQuota):
+        * storage/StorageNamespace.cpp:
+        (WebCore::StorageNamespace::sessionStorageNamespace):
+        * storage/StorageNamespace.h:
+        * storage/StorageNamespaceImpl.cpp:
+        (WebCore::StorageNamespaceImpl::sessionStorageNamespace):
+        * storage/StorageNamespaceImpl.h:
+
+2010-04-19  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Setting media element 'src' attribute should trigger immediate load
+        https://bugs.webkit.org/show_bug.cgi?id=37728
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::attributeChanged): Schedule load every time 'src' attribute
+        changes unless it is missing.
+        (WebCore::HTMLMediaElement::prepareForLoad): Include steps 3 to 6 from loadInternal.
+        (WebCore::HTMLMediaElement::loadInternal): Steps 3 to 6 are now in prepareForLoad.
+        (WebCore::HTMLMediaElement::loadResource): MediaPlayer is now allocated in prepareForLoad
+        so the previously loading file, if any, is cancelled there.
+
+2010-04-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix compilation against namespaced Qt.
+
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/Tile.h:
+        * platform/graphics/qt/MediaPlayerPrivateQt.h:
+        * platform/network/qt/NetworkStateNotifierPrivate.h:
+
+2010-04-19  Balazs Kelemen  <kb@inf.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Destroy SharedTimerQt before destruction of QCoreApplication.
+
+        To avoid unsafe situations caused by running WebCore code (through firing timers) when destruction of QCoreApplication
+        has been started, we should explicitly destroy the SharedTimerQt instance on application exit.
+        We can achieve that through installing a self-destroying slot for the QCoreApplication::aboutToQuit() signal
+        into the SharedTimerQt instance.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36832
+
+        No functional change so no new tests.
+
+        * platform/qt/SharedTimerQt.cpp:
+        (WebCore::SharedTimerQt::SharedTimerQt):
+        (WebCore::SharedTimerQt::destroy):
+        (WebCore::SharedTimerQt::inst):
+
+2010-04-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Make the fix for <rdar://problem/7873647> from r57759 more robust.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateHoverActiveState): Use RefPtrs for the Nodes.
+
+2010-04-19  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed. Chromium build fix.
+
+        * bindings/v8/JavaScriptCallFrame.h:
+
+2010-04-19  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: implement JavaScriptCallFrame that works for v8.
+        Implementing this binding for v8 allows to make evaluations on
+        call frames and protects access to the debugger context from
+        inspected context.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37755
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * bindings/js/JSJavaScriptCallFrameCustom.cpp:
+        (WebCore::JSJavaScriptCallFrame::scopeType):
+        * bindings/v8/JavaScriptCallFrame.cpp: Added.
+        (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
+        (WebCore::JavaScriptCallFrame::~JavaScriptCallFrame):
+        (WebCore::JavaScriptCallFrame::caller):
+        (WebCore::JavaScriptCallFrame::sourceID):
+        (WebCore::JavaScriptCallFrame::line):
+        (WebCore::JavaScriptCallFrame::functionName):
+        (WebCore::JavaScriptCallFrame::scopeChain):
+        (WebCore::JavaScriptCallFrame::scopeType):
+        (WebCore::JavaScriptCallFrame::thisObject):
+        (WebCore::JavaScriptCallFrame::evaluate):
+        * bindings/v8/JavaScriptCallFrame.h: Added.
+        (WebCore::JavaScriptCallFrame::create):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::currentCallFrame):
+        * bindings/v8/ScriptDebugServer.h:
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::V8InjectedScriptHost::currentCallFrameCallback):
+        * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp: Added.
+        (WebCore::V8JavaScriptCallFrame::evaluateCallback):
+        (WebCore::V8JavaScriptCallFrame::scopeChainAccessorGetter):
+        (WebCore::V8JavaScriptCallFrame::scopeTypeCallback):
+        (WebCore::V8JavaScriptCallFrame::thisObjectAccessorGetter):
+        (WebCore::V8JavaScriptCallFrame::typeAccessorGetter):
+        * inspector/JavaScriptCallFrame.idl:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor.):
+
+2010-04-19  Jessie Berlin  <jberlin@webkit.org>
+
+        Rubber Stamped by Adam Roben
+
+        Chromium Release Build Fix.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::pseudoId):
+        In the case where the DATALIST is not enabled, fall through to NOPSEUDO instead of omitting PseudoInputListButton entirely from the switch.
+
+2010-04-19  Jessie Berlin  <jberlin@webkit.org>
+
+        Reviewed by Dave Hyatt.
+
+        First steps towards fixing bug 24021 - pseudo-element styles not accessible / retrievable via DOM methods.
+        https://bugs.webkit.org/show_bug.cgi?id=24021
+
+        Allows access to the computed styles for the pseudo-elements through the second argument to getComputedStyle.
+        This approach does not provide the correct values for 'length' properties and does not work for the ':selection' pseudo-element and will instead return results similiar to those returned by Firefox. This approach also requires waiting until at least one iteration of a hardware accelerated composited animation to return the correct values for the "opacity" and "transform" properties of a pseudo-element associated with the element being animated.
+        Those values need to be retrieved from the renderer for the pseudo-element as opposed to the cached RenderStyle for the element on which the pseudo-element is defined, which is further complicated by the fact that not all elements have renderers.
+
+        Test: fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html
+
+        * WebCore.base.exp:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
+        Parse the and store the pseudo-element specifier from the string provided by the user.
+        (WebCore::CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword):
+        Get the computed style for the pseudo-element if it has been specified.
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        Get the computed style for the pseudo-element if it has been specified, with a FIXME noting that the values returned for the "opacity" and "transform" properties of a pseudo-element associated with an element being animated and using hardware accelerated compositing will not be correct until after the first iteration of the animation.
+        (WebCore::CSSComputedStyleDeclaration::length):
+        Get the computed style for the pseudo-element if it has been specified.
+        (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches):
+        Ditto.
+        * css/CSSComputedStyleDeclaration.h:
+        (WebCore::computedStyle):
+        Take into consideration the pseudo-element.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::pseudoId):
+        Return the PseudoId that corresponds to the given PseudoType. If there is no corresponding PseudoId, returns NOPSEUDO.
+        (WebCore::nameToPseudoTypeMap):
+        Create and return the mapping between string names and PseudoTypes.
+        (WebCore::CSSSelector::parsePseudoType):
+        Parse and the given string into a PseudoType.
+        (WebCore::CSSSelector::extractPseudoType):
+        Refactored to use parsePseudoType.
+        * css/CSSSelector.h:
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+        Refactored to use pseudoId.
+
+        * dom/Element.cpp:
+        (WebCore::Element::computedStyle):
+        If the pseudo-element is specified, then return the cached RenderStyle for that PseudoId. Added a FIXME to find the actual renders of the pseudo-elements instead of just the cached RenderStyle of the RenderStyle for the associated element.
+        * dom/Element.h:
+        (WebCore::Element::virtualComputedStyle):
+        Because Element::computedStyle is used so often, don't make it virtual. Instead, provide a virtualComputedStyle method in the Node.h class andmake computedStyle non-virtual. That way the Element version and the Node version of computedStyle will have the same name and look the same at the call site, but the Element version will be more efficient.
+
+        * dom/Node.h:
+        (WebCore::Node::computedStyle):
+        Ditto.
+        * dom/Node.cpp:
+        (WebCore::Node::virtualComputedStyle):
+        Get the computed style for the pseudo-element if it has been specified.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::getComputedStyle):
+        Ditto.
+
+2010-04-18  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Fix JavaScriptCore's include path for WinCE builds
+
+        https://bugs.webkit.org/show_bug.cgi?id=36751
+
+        * WebCore.pro:
+
+2010-04-17  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37720
+        <rdar://problem/7873752> HTMLFrameSetElement-window-eventListener-attributes.html sometimes
+        crashes on SnowLeopard Release
+
+        Tests: 
+        * fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html:
+        * fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html:
+
+        * bindings/scripts/CodeGeneratorJS.pm: Use global object as a wrapper for window event
+        listeners set via document.body. The body wrapper can go away if nothing else references it.
+
+        * html/HTMLBodyElement.idl: Override listeners that exist on Element with custom implementations,
+        because we need to use window object as a wrapper, not the element. Marked all window event
+        listeners as such for code generator.
+
+        * html/HTMLFrameSetElement.idl: Ditto.
+
+2010-04-17  Juan C. Montemayor  <jmonte03@cs.tufts.edu>
+
+        Reviewed by Joseph Pecoraro.
+
+        Databases pane doesn't recognize table creation/deletion
+        https://bugs.webkit.org/show_bug.cgi?id=20219
+
+        * inspector/front-end/DatabaseQueryView.js:
+        (WebInspector.DatabaseQueryView.prototype._queryFinished):
+
+2010-04-17  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Auto-generate V8 bindings for canvas.* overloads
+        https://bugs.webkit.org/show_bug.cgi?id=37453
+
+        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp: Deleted custom code that is now auto-generated.
+        * bindings/scripts/CodeGeneratorV8.pm: Not generating custom signatures for overloaded methods and accepting Object as a string input.
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage): Added missing 9-arguments overloads for drawImage.
+        * html/canvas/CanvasRenderingContext2D.h: 
+        * html/canvas/CanvasRenderingContext2D.idl: Overloaded methods defined (V8 only).
+
+2010-04-17  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: move JavaScriptCallFrame.{h,cpp} to WebCore/bindings/js
+
+        https://bugs.webkit.org/show_bug.cgi?id=37740
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JavaScriptCallFrame.cpp: Renamed from WebCore/inspector/JavaScriptCallFrame.cpp.
+        (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
+        (WebCore::JavaScriptCallFrame::caller):
+        (WebCore::JavaScriptCallFrame::scopeChain):
+        (WebCore::JavaScriptCallFrame::dynamicGlobalObject):
+        (WebCore::JavaScriptCallFrame::functionName):
+        (WebCore::JavaScriptCallFrame::type):
+        (WebCore::JavaScriptCallFrame::thisObject):
+        (WebCore::JavaScriptCallFrame::evaluate):
+        * bindings/js/JavaScriptCallFrame.h: Renamed from WebCore/inspector/JavaScriptCallFrame.h.
+        (WebCore::JavaScriptCallFrame::create):
+        (WebCore::JavaScriptCallFrame::invalidate):
+        (WebCore::JavaScriptCallFrame::isValid):
+        (WebCore::JavaScriptCallFrame::sourceID):
+        (WebCore::JavaScriptCallFrame::line):
+        (WebCore::JavaScriptCallFrame::update):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InspectorController.h:
+
+2010-04-17  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Adding definition of GLES2Context class.
+        https://bugs.webkit.org/show_bug.cgi?id=37541
+
+        No new functionality implemented yet, no tests.
+
+        * WebCore.gypi: Added GLES2Context.h
+        * platform/chromium/GLES2Context.h: Added.
+
+2010-04-17  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Crash while handling SVG font in the wrong namespace imported with @font-face
+        https://bugs.webkit.org/show_bug.cgi?id=18862
+
+        Test: fast/invalid/invalidSVGFont.html
+
+        * loader/CachedFont.cpp:
+        (WebCore::CachedFont::getSVGFontById): Make sure we really get an SVGFontElement by using
+        getElementsByNameNS: the element factory chooses which element to create based on both
+        localName and namespace.
+
+2010-04-16  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57770.
+        http://trac.webkit.org/changeset/57770
+        https://bugs.webkit.org/show_bug.cgi?id=37746
+
+        8 test cases crashed (Requested by Ossy on #webkit).
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::AnimationQtBase::AnimationQtBase):
+        (WebCore::TransformAnimationQt::~TransformAnimationQt):
+        (WebCore::TransformAnimationQt::applyFrame):
+        (WebCore::OpacityAnimationQt::applyFrame):
+        (WebCore::GraphicsLayerQt::addAnimation):
+
+2010-04-16  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Adam Treat.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36312
+
+        Adds support for the viewport meta tag. The code is largely derived in whole
+        or in part from the WebCore-528.15 source published as part of the iPhone 3.1.3
+        source code <http://www.opensource.apple.com/source/WebCore/WebCore-528.15/>.
+
+        * Android.mk: Added file ViewportArguments.cpp.
+        * GNUmakefile.am: Added files ViewportArguments.cpp and ViewportArguments.h.
+        * WebCore.gypi: Ditto.
+        * WebCore.pro: Ditto.
+        * WebCore.vcproj/WebCore.vcproj: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * dom/Document.cpp:
+        (WebCore::isSeparator): Added.
+        (WebCore::Document::processArguments): Added.
+        (WebCore::Document::processViewport): Added.
+        * dom/Document.h:
+        * dom/ViewportArguments.cpp: Added.
+        (WebCore::setViewportFeature):
+        (WebCore::viewportErrorMessageTemplate):
+        (WebCore::viewportErrorMessageLevel):
+        (WebCore::reportViewportWarning):
+        * dom/ViewportArguments.h: Added.
+        (WebCore::):
+        (WebCore::ViewportArguments::):
+        (WebCore::ViewportArguments::ViewportArguments):
+        (WebCore::ViewportArguments::hasCustomArgument):
+        * html/HTMLMetaElement.cpp:
+        (WebCore::HTMLMetaElement::process): Modified to call Document::processViewport.
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::didReceiveViewportArguments): Added.
+
+2010-04-16  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        [Qt] GraphicsLayer: support fill-modes
+        https://bugs.webkit.org/show_bug.cgi?id=36216
+        Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
+        enables a key-frame animation to go to the animation's starting point before the delay,
+        and/or to stay at the animation's ending point after its ended, without reverting to the default
+        value.
+        We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
+        and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::AnimationQtBase::AnimationQtBase):
+        (WebCore::TransformAnimationQt::~TransformAnimationQt):
+        (WebCore::TransformAnimationQt::applyFrame):
+        (WebCore::GraphicsLayerQt::addAnimation):
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (arm build fix).
+
+        * bindings/js/JSDesktopNotificationsCustom.cpp:
+        (WebCore::JSNotification::addEventListener):
+        (WebCore::JSNotification::removeEventListener):
+
+2010-04-16  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        [v8] In Workers, script errors right after close() are not delivered to the Worker.onerror.
+        https://bugs.webkit.org/show_bug.cgi?id=37691
+
+        Existing worker-close.html will now work in Chromium.
+
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::getScriptExecutionContext): Stop using proxy() to just retrieve WorkerContext which should be always available.
+        * bindings/v8/WorkerContextExecutionProxy.h: removed workerContext() accessor which moved to WorkerScriptController.
+        * bindings/v8/WorkerScriptController.h:
+        (WebCore::WorkerScriptController::workerContext): Added, to be able to pull WorkerContext out from the controller.
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37735
+        Remove JSC specific code from WebCore::AtomicString
+
+        Add generic constructor/add/find methods that take a UChar* & length, along
+        with a known existing hash for the string.
+        This removes the remaining JSC specific code from platform/text.
+
+        * bindings/js/JSAbstractWorkerCustom.cpp:
+        (WebCore::JSAbstractWorker::addEventListener):
+        (WebCore::JSAbstractWorker::removeEventListener):
+        * bindings/js/JSDOMApplicationCacheCustom.cpp:
+        (WebCore::JSDOMApplicationCache::addEventListener):
+        (WebCore::JSDOMApplicationCache::removeEventListener):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::ustringToAtomicString):
+        (WebCore::identifierToAtomicString):
+        (WebCore::findAtomicString):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::childFrameGetter):
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+        (WebCore::JSDOMWindow::open):
+        (WebCore::JSDOMWindow::addEventListener):
+        (WebCore::JSDOMWindow::removeEventListener):
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::JSElement::setAttribute):
+        (WebCore::JSElement::setAttributeNS):
+        * bindings/js/JSEventSourceCustom.cpp:
+        (WebCore::JSEventSource::addEventListener):
+        (WebCore::JSEventSource::removeEventListener):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::getNamedItems):
+        (WebCore::JSHTMLAllCollection::canGetItemsForName):
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::getNamedItems):
+        (WebCore::JSHTMLCollection::canGetItemsForName):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::canGetItemsForName):
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::canGetItemsForName):
+        (WebCore::JSHTMLFormElement::nameGetter):
+        * bindings/js/JSHTMLFrameSetElementCustom.cpp:
+        (WebCore::JSHTMLFrameSetElement::canGetItemsForName):
+        (WebCore::JSHTMLFrameSetElement::nameGetter):
+        * bindings/js/JSMessageEventCustom.cpp:
+        (WebCore::JSMessageEvent::initMessageEvent):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::addEventListener):
+        (WebCore::JSMessagePort::removeEventListener):
+        * bindings/js/JSMimeTypeArrayCustom.cpp:
+        (WebCore::JSMimeTypeArray::canGetItemsForName):
+        (WebCore::JSMimeTypeArray::nameGetter):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNode::addEventListener):
+        (WebCore::JSNode::removeEventListener):
+        * bindings/js/JSNodeListCustom.cpp:
+        (WebCore::JSNodeList::canGetItemsForName):
+        (WebCore::JSNodeList::nameGetter):
+        * bindings/js/JSPluginArrayCustom.cpp:
+        (WebCore::JSPluginArray::canGetItemsForName):
+        (WebCore::JSPluginArray::nameGetter):
+        * bindings/js/JSPluginCustom.cpp:
+        (WebCore::JSPlugin::canGetItemsForName):
+        (WebCore::JSPlugin::nameGetter):
+        * bindings/js/JSPopStateEventCustom.cpp:
+        (WebCore::JSPopStateEvent::initPopStateEvent):
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        (WebCore::JSSVGElementInstance::addEventListener):
+        (WebCore::JSSVGElementInstance::removeEventListener):
+        * bindings/js/JSWebSocketCustom.cpp:
+        (WebCore::JSWebSocket::addEventListener):
+        (WebCore::JSWebSocket::removeEventListener):
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::addEventListener):
+        (WebCore::JSWorkerContext::removeEventListener):
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::setRequestHeader):
+        (WebCore::JSXMLHttpRequest::getResponseHeader):
+        (WebCore::JSXMLHttpRequest::addEventListener):
+        (WebCore::JSXMLHttpRequest::removeEventListener):
+        * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
+        (WebCore::JSXMLHttpRequestUpload::addEventListener):
+        (WebCore::JSXMLHttpRequestUpload::removeEventListener):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicString::add):
+        (WebCore::AtomicString::find):
+        * platform/text/AtomicString.h:
+        (WebCore::AtomicString::AtomicString):
+
+2010-04-16  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebSocket crash when it receives bad header.
+        https://bugs.webkit.org/show_bug.cgi?id=37682
+
+        If name or value is not valid UTF-8, nameStr or valueStr would be
+        null string, so crashed in headers->add(nameStr, valueStr).
+        Check both nameStr and valueStr are not null string.
+        Otherwise handshake will fail.
+
+        Test: websocket/tests/bad-handshake-crash.html
+
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readHTTPHeaders): check nameStr and valueStr are not null string.
+
+2010-04-16  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/7873647> Crash when updating hover state
+
+        Test: fast/dynamic/hover-style-recalc-crash.html
+
+        Updating the hover state of an element caused the document to need style
+        recalc, and then updating the hover state of a link caused style recalc,
+        which changed the render tree while updateHoverActiveState() was iterating
+        over it, leading to a crash.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateHoverActiveState): Collect the nodes to be
+        updated into vectors, then update their active and hover states.
+
+2010-04-16  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Make Safari correctly allocate 5MB of DB storage to all new
+        origins.
+        https://bugs.webkit.org/show_bug.cgi?id=36671
+
+        Eric fixed the same problem in
+        DatabaseTracker::fullPathForDatabaseNoLock() in r57128, but forgot
+        to fix it in DatabaseTracker::detailsForNameAndOrigin() too.
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::detailsForNameAndOrigin):
+
+2010-04-16  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Jian Li.
+
+        Implement FileStreamProxy that calls FileStream methods on FileThread for FileAPI
+        https://bugs.webkit.org/show_bug.cgi?id=37218
+
+        No new tests; tests will be added when we add upper layer implementations.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/FileStream.cpp:
+        (WebCore::FileStream::stop):
+        * html/FileStream.h:
+        * html/FileStreamClient.h:
+        (WebCore::FileStreamClient::didStop):
+        * html/FileStreamProxy.cpp: Added
+        * html/FileStreamProxy.h: Added
+        * html/FileThreadTask.h: Added
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 37730 - Remove JSC::UString dependencies from WebCore::StringImpl
+        (Following on from bug #37675).
+
+        Remove ustring() method, and constructor passed a UString.
+
+        * WebCore.base.exp:
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::stringimplToUString):
+        (WebCore::jsStringSlowCase):
+        (WebCore::ustringToString):
+        (WebCore::stringToUString):
+        (WebCore::identifierToString):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::jsString):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicString::operator UString):
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::create):
+        * platform/text/StringImpl.h:
+
+2010-04-16  Jarkko Sakkinen  <jarkko.j.sakkinen@gmail.com>
+ 
+        Reviewed by Simon Hausmann.
+ 
+        [Qt] WebGL is not visible when QGLWidget viewport is used
+        https://bugs.webkit.org/show_bug.cgi?id=37070
+ 
+        Added HostWindow parameter to the constructor of GraphicsContext3D.
+        Shared OpenGL context is initialized with parent QGLWidget.
+ 
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::create):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::getOwnerGLWidget):
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-04-16  Jarkko Sakkinen  <jarkko.j.sakkinen@gmail.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] WebKit compilation fails with --3d-canvas
+        https://bugs.webkit.org/show_bug.cgi?id=37699 
+        
+        API for readPixels() has been changed. 
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::readPixels):
+
+2010-04-16  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        [Qt]QtLauncher crash on page with CSS 3D transform
+        https://bugs.webkit.org/show_bug.cgi?id=36859
+
+        Added a neccessary null-pointer check, lack of which created the crash circumstances.
+
+        Tested by http://css-vfx.googlecode.com/svn/trunk/snowstack/snowstack.html
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::flushChanges):
+
+2010-04-16  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Make sure to update the current graphics context when calling out to AppKit.
+
+        * platform/mac/ThemeMac.mm:
+        (WebCore::paintCheckbox):
+        (WebCore::paintRadio):
+
+2010-04-15  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig & Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37675
+        Remove casts/constructors to/from JSC::UString type from WebCore::String
+        
+        WebCore's strings should not know about JSC::UString, this should be abstracted
+        away in the bindings.  Add explicit conversion methods rather than relying on
+        overloaded cast operators / constructors being implicitly called.
+
+        This patch only changes the class String, once this has landed StringImpl, and
+        hopefully AtomicString too, should follow suit.
+
+        This patch adds:
+            WebCore::identifierToString
+            WebCore::ustringToString
+            WebCore::stringToUString
+
+        - to JSDOMBindings.h, and updates code to call these methods.
+
+        * WebCore.base.exp:
+        * WebCore.order:
+        * bindings/js/CachedScriptSourceProvider.h:
+        (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
+        * bindings/js/JSAudioConstructor.cpp:
+        (WebCore::constructAudio):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::nameGetter):
+        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+        (WebCore::toHTMLCanvasStyle):
+        (WebCore::JSCanvasRenderingContext2D::setFillColor):
+        (WebCore::JSCanvasRenderingContext2D::setStrokeColor):
+        (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
+        (WebCore::JSCanvasRenderingContext2D::setShadow):
+        (WebCore::JSCanvasRenderingContext2D::fillText):
+        (WebCore::JSCanvasRenderingContext2D::strokeText):
+        * bindings/js/JSClipboardCustom.cpp:
+        (WebCore::JSClipboard::types):
+        (WebCore::JSClipboard::clearData):
+        (WebCore::JSClipboard::getData):
+        (WebCore::JSClipboard::setData):
+        * bindings/js/JSCustomXPathNSResolver.cpp:
+        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::identifierToString):
+        (WebCore::ustringToString):
+        (WebCore::stringToUString):
+        (WebCore::valueToStringWithNullCheck):
+        (WebCore::valueToStringWithUndefinedOrNullCheck):
+        (WebCore::reportException):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMFormDataCustom.cpp:
+        (WebCore::JSDOMFormData::append):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::namedItemGetter):
+        (WebCore::JSDOMWindow::setLocation):
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/js/JSDatabaseCustom.cpp:
+        (WebCore::JSDatabase::changeVersion):
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::setLocation):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSEventSourceConstructor.cpp:
+        (WebCore::constructEventSource):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::callHTMLAllCollection):
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::JSHTMLCanvasElement::getContext):
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::callHTMLCollection):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        (WebCore::documentWrite):
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        * bindings/js/JSInspectorFrontendHostCustom.cpp:
+        (WebCore::JSInspectorFrontendHost::showContextMenu):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::initializeJSFunction):
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::JSLocation::setHref):
+        (WebCore::JSLocation::setProtocol):
+        (WebCore::JSLocation::setHost):
+        (WebCore::JSLocation::setHostname):
+        (WebCore::JSLocation::setPathname):
+        (WebCore::JSLocation::setSearch):
+        (WebCore::JSLocation::setHash):
+        (WebCore::JSLocation::replace):
+        (WebCore::JSLocation::assign):
+        * bindings/js/JSMessageEventCustom.cpp:
+        (WebCore::JSMessageEvent::initMessageEvent):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::canGetItemsForName):
+        (WebCore::JSNamedNodeMap::nameGetter):
+        * bindings/js/JSOptionConstructor.cpp:
+        (WebCore::constructHTMLOptionElement):
+        * bindings/js/JSSQLResultSetRowListCustom.cpp:
+        (WebCore::JSSQLResultSetRowList::item):
+        * bindings/js/JSSQLTransactionCustom.cpp:
+        (WebCore::JSSQLTransaction::executeSql):
+        * bindings/js/JSSharedWorkerConstructor.cpp:
+        (WebCore::constructSharedWorker):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::canGetItemsForName):
+        (WebCore::JSStorage::nameGetter):
+        (WebCore::JSStorage::deleteProperty):
+        (WebCore::JSStorage::getOwnPropertyNames):
+        (WebCore::JSStorage::putDelegate):
+        * bindings/js/JSStyleSheetListCustom.cpp:
+        (WebCore::JSStyleSheetList::canGetItemsForName):
+        (WebCore::JSStyleSheetList::nameGetter):
+        * bindings/js/JSWebKitCSSMatrixConstructor.cpp:
+        (WebCore::constructWebKitCSSMatrix):
+        * bindings/js/JSWebSocketConstructor.cpp:
+        (WebCore::constructWebSocket):
+        * bindings/js/JSWebSocketCustom.cpp:
+        (WebCore::JSWebSocket::send):
+        * bindings/js/JSWorkerConstructor.cpp:
+        (WebCore::constructWorker):
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::importScripts):
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::open):
+        (WebCore::JSXMLHttpRequest::setRequestHeader):
+        (WebCore::JSXMLHttpRequest::send):
+        (WebCore::JSXMLHttpRequest::overrideMimeType):
+        * bindings/js/JSXSLTProcessorCustom.cpp:
+        (WebCore::JSXSLTProcessor::setParameter):
+        (WebCore::JSXSLTProcessor::getParameter):
+        (WebCore::JSXSLTProcessor::removeParameter):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::create):
+        * bindings/js/ScriptCallFrame.cpp:
+        (WebCore::ScriptCallFrame::ScriptCallFrame):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::hasBreakpoint):
+        (WebCore::ScriptDebugServer::dispatchDidParseSource):
+        (WebCore::ScriptDebugServer::dispatchFailedToParseSource):
+        (WebCore::ScriptDebugServer::sourceParsed):
+        * bindings/js/ScriptEventListener.cpp:
+        (WebCore::getEventListenerHandlerBody):
+        * bindings/js/ScriptFunctionCall.cpp:
+        (WebCore::ScriptFunctionCall::appendArgument):
+        (WebCore::ScriptFunctionCall::call):
+        (WebCore::ScriptFunctionCall::construct):
+        * bindings/js/ScriptObject.cpp:
+        (WebCore::ScriptObject::set):
+        * bindings/js/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::start):
+        (WebCore::ScriptProfiler::stop):
+        * bindings/js/ScriptString.h:
+        (WebCore::ScriptString::operator String):
+        (WebCore::ScriptString::ustring):
+        (WebCore::ScriptString::operator+=):
+        * bindings/js/ScriptValue.cpp:
+        (WebCore::ScriptValue::getString):
+        * bindings/js/ScriptValue.h:
+        (WebCore::ScriptValue::toString):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::SerializedObject::set):
+        (WebCore::SerializingTreeWalker::convertIfTerminal):
+        (WebCore::DeserializingTreeWalker::putProperty):
+        * bindings/js/StringSourceProvider.h:
+        (WebCore::StringSourceProvider::StringSourceProvider):
+        * bindings/objc/WebScriptObject.mm:
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject setValue:forKey:]):
+        (-[WebScriptObject valueForKey:]):
+        (-[WebScriptObject removeWebScriptKey:]):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bridge/IdentifierRep.cpp:
+        (WebCore::IdentifierRep::get):
+        * bridge/c/c_utility.cpp:
+        (JSC::Bindings::identifierFromNPIdentifier):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::scriptImported):
+        (WebCore::InspectorController::addProfileFinishedMessageToConsole):
+        (WebCore::InspectorController::createProfileHeader):
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::sourceString):
+        * inspector/JavaScriptCallFrame.cpp:
+        (WebCore::JavaScriptCallFrame::functionName):
+        * platform/KURL.h:
+        (WebCore::KURL::operator const String&):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicString::operator UString):
+        * platform/text/AtomicString.h:
+        * platform/text/PlatformString.h:
+        * platform/text/String.cpp:
+
+2010-04-16  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Always pass a view to the AppKit drawing functions.
+        https://bugs.webkit.org/show_bug.cgi?id=37724
+
+        * platform/mac/ThemeMac.mm:
+        (WebCore::paintCheckbox):
+        (WebCore::paintRadio):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMenuList):
+        (WebCore::RenderThemeMac::paintSliderThumb):
+        (WebCore::RenderThemeMac::paintSearchField):
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
+
+2010-04-16  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37718
+        Safari crashes with certain JavaScript charCode events in EventHandler::needsKeyboardEventDisambiguationQuirks
+
+        Test: fast/events/recorded-keydown-event.html
+
+        * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::charCode): Check if the view (window) is
+        frameless.
+
+2010-04-16  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Update FormDataList to fix style violations in old code.
+        https://bugs.webkit.org/show_bug.cgi?id=37689
+
+        * html/FormDataList.h:
+        (WebCore::FormDataList::appendData):
+        (WebCore::FormDataList::appendBlob):
+
+2010-04-16  Anders Carlsson  <andersca@apple.com>
+
+        Fix WebKit2 build.
+
+        * WebCore.base.exp:
+
+2010-04-16  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Fix Mac build.
+        https://bugs.webkit.org/show_bug.cgi?id=37436
+
+        * platform/chromium/PopupMenuChromium.h:
+
+2010-04-16  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Select popups would assert when destroyed.
+        https://bugs.webkit.org/show_bug.cgi?id=37436
+
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::notifyPopupHidden):
+        * platform/chromium/PopupMenuChromium.h:
+
+2010-04-16  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Unreviewed QtWebKit (with Qt 4.7) build fix.
+
+        Bug 37683 moved code from FontQt.cpp to FontPlatformDataQt.cpp but did not
+        renamed the variable used.
+
+        * platform/graphics/qt/FontPlatformDataQt.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+
+2010-04-16  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make GraphicsLayerQt always use ItemCoordinateCache, and remove ItemUsesExtendedStyleOption.
+        This aligns our implementation with the Safari implementation - layers are always uploaded
+        to textures in item units, and WebCore is responsible for the heuristics.
+
+        [Qt] GraphicsLayer: performance optimizations
+        https://bugs.webkit.org/show_bug.cgi?id=35393
+
+        No new tests. Still no FPS benchmarks available (on any platform)
+        but animations are noticably better.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::GraphicsLayerQtImpl):
+        (WebCore::GraphicsLayerQtImpl::paint):
+        (WebCore::GraphicsLayerQtImpl::flushChanges):
+        (WebCore::TransformAnimationQt::updateState):
+
+2010-04-16  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] WebCore::Font::font() causes a QFont detach
+        https://bugs.webkit.org/show_bug.cgi?id=37683
+
+        Moved the setStyleStrategy call to FontPlatformData
+        to avoid the detach.
+
+        Thanks to Holger for spotting this.
+
+        * platform/graphics/qt/FontPlatformDataQt.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::font):
+
+2010-04-15  Matt Perry  <mpcomplete@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Remove the check for the main frame's scheme when deciding which
+        v8 extensions to add to a script context. Instead, Chromium will
+        handle that check elsewhere to allow finer-grained control over
+        what APIs we expose to web pages.
+        https://bugs.webkit.org/show_bug.cgi?id=37681
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::createNewContext):
+
+2010-04-15  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Antti Koivisto.
+
+        No default selection for <select multiple> menu lists.
+        https://bugs.webkit.org/show_bug.cgi?id=37530
+
+        Manual test: manual-tests/no-listbox-rendering.html
+
+        For menu lists, if the selection is not indicated by the html file, the first <option> will be
+        selected after loading the page or reseting the form. On the other hand listboxes may have no
+        element selected after loading the page or reseting the form.
+
+        When NO_LISTBOX_RENDERING is enabled listboxes becomes menu lists. Those <select multiple>
+        that did not have selected elements, now being menu lists, will have the first <option>
+        selected. That is the behavior difference that this patch corrects.
+
+        When NO_LISTBOX_RENDERING is enabled usesMenuList() always returns true then usesMenuList() cannot
+        be used to decide about initial selection of the elements. This patch replaces (usesMenuLists())
+        by (!multiple && size <= 1) where initial selection is considered.
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::recalcListItems):
+        (WebCore::SelectElement::reset):
+        * manual-tests/no-listbox-rendering.html: Added.
+
+2010-04-15  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Index validation code validates too many vertex attributes
+        https://bugs.webkit.org/show_bug.cgi?id=31892
+
+        * html/canvas/WebGLProgram.cpp:
+        (WebCore::WebGLProgram::cacheActiveAttribLocations): Cache active attribute locations for a program at linkProgram time.
+        (WebCore::WebGLProgram::getActiveAttribLocation): Get the cached attribute location.
+        (WebCore::WebGLProgram::numActiveAttribLocations): Get the number of cached attribute locations.
+        * html/canvas/WebGLProgram.h: Add attribute locations member.
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::validateRenderingState): Add logic not to validate those attributes that do not belong to the current program.
+        (WebCore::WebGLRenderingContext::linkProgram): Call cacheActiveAttribLocations().
+
+2010-04-16  Adam Roben  <aroben@apple.com>
+
+        Don't assert when soft-linked libraries can't be found
+
+        In some situations (e.g., when using SOFT_LINK_OPTIONAL), we expect soft-link libraries not
+        to be able to be found in all cases. So we shouldn't assert that they're always found.
+
+        Reviewed by Sam Weinig.
+
+        * platform/win/SoftLinking.h:
+        (SOFT_LINK): Don't assert when LoadLibrary fails.
+
+2010-04-15  Dmitry Titov  <dimich@chromium.org>
+
+        Unreviewed, rolling out r57688.
+        http://trac.webkit.org/changeset/57688
+        https://bugs.webkit.org/show_bug.cgi?id=34992
+
+        Makes fast/workers/dedicated-worker-lifecycle.html crashing on all GTK bots
+
+        * bindings/js/JSWorkerContextCustom.cpp:
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        * storage/Database.idl:
+        * storage/SQLError.idl:
+        * storage/SQLResultSet.idl:
+        * storage/SQLResultSetRowList.idl:
+        * storage/SQLTransaction.idl:
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+        (WebCore::WorkerContext::databaseExceededQuota):
+        * workers/WorkerContext.idl:
+
+2010-04-15  Yury Semikhatsky  <yurys@google.com>
+
+        Reviewed by Pavel Feldman.
+    
+        Support basic debugging capabilities including step in/over/out in v8
+        implementation of ScriptDebugServer.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::setDebuggerScriptSource):
+        (WebCore::ScriptDebugServer::addListener):
+        (WebCore::ScriptDebugServer::removeListener):
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::clearBreakpoints):
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        (WebCore::ScriptDebugServer::continueProgram):
+        (WebCore::ScriptDebugServer::stepIntoStatement):
+        (WebCore::ScriptDebugServer::stepOverStatement):
+        (WebCore::ScriptDebugServer::stepOutOfFunction):
+        (WebCore::ScriptDebugServer::currentCallFrameState):
+        (WebCore::ScriptDebugServer::currentCallFrameV8):
+        (WebCore::ScriptDebugServer::onV8DebugMessage):
+        (WebCore::ScriptDebugServer::onV8DebugHostDispatch):
+        (WebCore::ScriptDebugServer::handleV8DebugHostDispatch):
+        (WebCore::ScriptDebugServer::handleV8DebugMessage):
+        (WebCore::ScriptDebugServer::dispatchDidParseSource):
+        (WebCore::ScriptDebugServer::ensureDebuggerScriptCompiled):
+        (WebCore::ScriptDebugServer::didResume):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setMessageLoopDispatchHandler):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::V8InjectedScriptHost::currentCallFrameCallback):
+        (WebCore::V8InjectedScriptHost::isActivationCallback):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+        (injectedScriptConstructor.):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+
+2010-04-15  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Support using FormData to send a sliced file via XHR.
+        https://bugs.webkit.org/show_bug.cgi?id=36678
+
+        Tests: http/tests/local/formdata/send-form-data-with-sliced-file.html
+
+        * html/Blob.h:
+        (WebCore::Blob::isFile):
+        * html/DOMFormData.cpp:
+        (WebCore::DOMFormData::append):
+        * html/File.h:
+        (WebCore::File::isFile):
+        * html/FormDataList.h:
+        (WebCore::FormDataList::appendBlob):
+        (WebCore::FormDataList::Item::Item):
+        (WebCore::FormDataList::Item::blob):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::appendFormData):
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::appendDOMFormData):
+        * platform/network/mac/FormDataStreamMac.mm:
+        (WebCore::closeCurrentStream):
+
+2010-04-15  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Must enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization
+        https://bugs.webkit.org/show_bug.cgi?id=37178
+
+        Test: fast/canvas/webgl/point-size.html
+
+        * platform/graphics/mac/GraphicsContext3DMac.cpp: Enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization.
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-04-15  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add bindings for async DB API in Workers.
+        https://bugs.webkit.org/show_bug.cgi?id=34992
+
+        Tests: storage/change-version-handle-reuse-worker.html
+               storage/execute-sql-args-worker.html
+
+        * bindings/js/JSWorkerContextCustom.cpp: Add openDatabase binding.
+        (WebCore::JSWorkerContext::openDatabase):
+
+        * bindings/v8/custom/V8WorkerContextCustom.cpp: Add openDatabase stub; Chromium will need work both in V8 and in the browser process before we can turn this on there.
+        (WebCore::V8WorkerContext::openDatabaseCallback):
+
+        Add NoStaticTables flags to all objects now shared with workers.
+        * storage/Database.idl:
+        * storage/SQLError.idl:
+        * storage/SQLResultSet.idl:
+        * storage/SQLResultSetRowList.idl:
+        * storage/SQLTransaction.idl:
+        
+        * workers/WorkerContext.h: Add databaseExceededQuota.
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::databaseExceededQuota): Add stub implementation for testing; you just get 5MB for now.
+        (WebCore::WorkerContext::openDatabase): Remove invalid assertion.
+
+        Add the IDL for the call to openDatabase.
+        * workers/WorkerContext.idl:
+
+2010-04-15  Nicolas Weber  <thakis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix drag image thumbnails for indexed images.
+        https://bugs.webkit.org/show_bug.cgi?id=37621
+
+        * platform/chromium/DragImageChromiumMac.cpp:
+        (WebCore::scaleDragImage): Always use RGB color space.
+        (WebCore::dissolveDragImageToFraction): Always use RGB color space.
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Expose UserContentURLPattern as WebKit SPI
+
+        Fixes <http://webkit.org/b/37354>.
+
+        Reviewed by Tim Hatcher.
+
+        * WebCore.base.exp: Export UserContentURLPattern::parse, and sorted
+        the file.
+
+        * WebCore.xcodeproj/project.pbxproj: Marked UserContentURLPattern.h as
+        "Private".
+
+        * page/UserContentURLPattern.h:
+        (WebCore::UserContentURLPattern::UserContentURLPattern): Added a
+        default constructor.
+        (WebCore::UserContentURLPattern::isValid): Added this getter.
+
+2010-04-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AXHelp is being appended from ancestors incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=37659
+
+        Test: platform/mac/accessibility/unexpected-help-text.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::helpText):
+
+2010-04-15  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37669, REGRESSION: visited styles don't work right when only the visited path specifies
+        a pseudoelement.
+        
+        Rework the pseudo cache on RenderStyles to support nesting, i.e., a pseudo hanging off a pseudo.  The existing model gets
+        confused by this concept, since it relies on a singly linked list of chained pseudo styles (instead of a Vector owned by a primary
+        style).  I changed the style cache to be a Vector instead.
+        
+        Reworked both styleForElement and pseudoStyleForElement to resolve visited styles first, since in the pseudoStyleForElement case
+        you need to do this in order to know to allocate an unvisited pseudo style even if one shouldn't normally exist.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::styleForElement):
+        (WebCore::CSSStyleSelector::pseudoStyleForElement):
+        * dom/Element.cpp:
+        (WebCore::Element::pseudoStyleCacheIsInvalid):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::getCachedPseudoStyle):
+        (WebCore::RenderStyle::addCachedPseudoStyle):
+        * rendering/style/RenderStyle.h:
+        (WebCore::):
+        (WebCore::InheritedFlags::cachedPseudoStyles):
+
+2010-04-15  Albert J. Wong  <ajwong@chromium.org>
+
+        Unreviewed, rolling out r57660.
+        http://trac.webkit.org/changeset/57660
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        Broke a large number of inspector layout tests in chromium.
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        * bindings/v8/ScriptDebugServer.cpp:
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::addListener):
+        (WebCore::ScriptDebugServer::removeListener):
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::clearBreakpoints):
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::continueProgram):
+        (WebCore::ScriptDebugServer::stepIntoStatement):
+        (WebCore::ScriptDebugServer::stepOverStatement):
+        (WebCore::ScriptDebugServer::stepOutOfFunction):
+        (WebCore::ScriptDebugServer::currentCallFrameState):
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::V8InjectedScriptHost::currentCallFrameCallback):
+        (WebCore::V8InjectedScriptHost::isActivationCallback):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+
+2010-04-14  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        DatabaseTracker refactoring: remove the dependency on
+        OriginQuotaManager from DatabaseTracker.h
+        https://bugs.webkit.org/show_bug.cgi?id=31482
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::DatabaseTracker):
+        (WebCore::DatabaseTracker::~DatabaseTracker):
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::hasEntryForOrigin):
+        (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+        (WebCore::DatabaseTracker::databaseChanged):
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
+        (WebCore::DatabaseTracker::fullPathForDatabase):
+        (WebCore::DatabaseTracker::populateOrigins):
+        (WebCore::DatabaseTracker::origins):
+        (WebCore::DatabaseTracker::databaseNamesForOrigin):
+        (WebCore::DatabaseTracker::addOpenDatabase):
+        (WebCore::DatabaseTracker::removeOpenDatabase):
+        (WebCore::DatabaseTracker::usageForOriginNoLock):
+        (WebCore::DatabaseTracker::usageForOrigin):
+        (WebCore::DatabaseTracker::quotaForOrigin):
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        * storage/DatabaseTracker.h:
+        * storage/SQLTransactionClient.cpp:
+        (WebCore::SQLTransactionClient::didExecuteStatement):
+
+2010-04-15  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Adam Barth.
+
+        Several tests in fast/canvas/webgl/ failed randomly on Leopard Commit Bot
+        This fixes an uninitialized variable bug and restores a glFinish call that used to be present.
+        https://bugs.webkit.org/show_bug.cgi?id=36908
+
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D): Initialize width/height to 0/0.
+        (WebCore::GraphicsContext3D::prepareTexture): Restore glFinish() in every path.
+
+2010-04-14  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial Navigation: make hasOffscreenRect() to earlier return 'true' if absoluteClippedOverflowRect() gives an empty rect
+        https://bugs.webkit.org/show_bug.cgi?id=37635
+
+        absoluteClippedOverflowRect method of RenderObject does return an empty IntRect for offscreen nodes.
+        So hasOffscreenRect method (SpatialNavigation.cpp) can safily bail out earlier in such cases.
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::hasOffscreenRect):
+
+2010-04-14  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial Navigation: remove unnecessery assignment in updateFocusCandidateIfCloser method
+        https://bugs.webkit.org/show_bug.cgi?id=37634
+
+        This assignment line is not longer needed after r57061, bug that refactored all
+        assignment logic to happen lines below in the method.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+
+2010-04-15  Yury Semikhatsky  <yurys@google.com>
+
+        Reviewed by Pavel Feldman.
+    
+        Support basic debugging capabilities including step in/over/out in v8
+        implementation of ScriptDebugServer.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::setDebuggerScriptSource):
+        (WebCore::ScriptDebugServer::addListener):
+        (WebCore::ScriptDebugServer::removeListener):
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::clearBreakpoints):
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        (WebCore::ScriptDebugServer::continueProgram):
+        (WebCore::ScriptDebugServer::stepIntoStatement):
+        (WebCore::ScriptDebugServer::stepOverStatement):
+        (WebCore::ScriptDebugServer::stepOutOfFunction):
+        (WebCore::ScriptDebugServer::currentCallFrameState):
+        (WebCore::ScriptDebugServer::currentCallFrameV8):
+        (WebCore::ScriptDebugServer::onV8DebugMessage):
+        (WebCore::ScriptDebugServer::onV8DebugHostDispatch):
+        (WebCore::ScriptDebugServer::handleV8DebugHostDispatch):
+        (WebCore::ScriptDebugServer::handleV8DebugMessage):
+        (WebCore::ScriptDebugServer::dispatchDidParseSource):
+        (WebCore::ScriptDebugServer::ensureDebuggerScriptCompiled):
+        (WebCore::ScriptDebugServer::didResume):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setMessageLoopDispatchHandler):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::V8InjectedScriptHost::currentCallFrameCallback):
+        (WebCore::V8InjectedScriptHost::isActivationCallback):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+        (injectedScriptConstructor.):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+
+2010-04-15  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Reviewed by Beth Dakin.
+
+        RenderSVGResource <-> id mapping should be cached
+        https://bugs.webkit.org/show_bug.cgi?id=37575
+
+        Test: svg/custom/clip-path-id-changes.svg
+
+        * rendering/RenderSVGResource.h:
+        (WebCore::RenderSVGResource::RenderSVGResource):
+        (WebCore::RenderSVGResource::~RenderSVGResource):
+        (WebCore::RenderSVGResource::idChanged):
+        (WebCore::getRenderSVGResourceById):
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::addResource):
+        (WebCore::SVGDocumentExtensions::removeResource):
+        (WebCore::SVGDocumentExtensions::resourceById):
+        * svg/SVGDocumentExtensions.h:
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::svgAttributeChanged):
+
+2010-04-15  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        LayoutTest breakage in V8 bindings after r57627
+        https://bugs.webkit.org/show_bug.cgi?id=37660
+
+        Fixes breakage of the following tests due to an error in V8 bindings for
+        NamedNodeMap:
+        hc_namednodemapinuseattributeerr.html
+        hc_namednodemapsetnameditemreturnvalue.html
+        hc_namednodemapwrongdocumenterr.html
+        hc_namednodemapinvalidtype1.html
+        NamedNodeMap-setNamedItem-crash.html
+
+        * bindings/v8/custom/V8NamedNodeMapCustom.cpp:
+        (WebCore::V8NamedNodeMap::setNamedItemNSCallback):
+        (WebCore::V8NamedNodeMap::setNamedItemCallback):
+
+2010-04-15  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37567, :first-letter inside a :visited link is wrong color.  Make sure
+        that the pseudo style caching allows visited link styles to hang off other pseudo styles.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateFirstLetter):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::getCachedPseudoStyle):
+
+2010-04-15  Ben Murdoch  <benm@google.com>
+
+        Unreviewed, rolling out r57652.
+        http://trac.webkit.org/changeset/57652
+        https://bugs.webkit.org/show_bug.cgi?id=37609
+
+        Caused a build break on Chromium Mac and Layout Test fail on
+        Qt
+
+        * platform/PlatformTouchPoint.h:
+        (WebCore::PlatformTouchPoint::):
+        * platform/qt/PlatformTouchPointQt.cpp:
+        (WebCore::PlatformTouchPoint::PlatformTouchPoint):
+
+2010-04-15  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Overloads auto-generation in V8
+        https://bugs.webkit.org/show_bug.cgi?id=37373
+
+        This will be used by XHR.send/open, Canvas.*, WebGL.* methods that are currently custom. When more than a single overload exists for a method, the correct overload is chosen based on the total number of arguments passed as well as the values passed to non-primitive arguments.
+
+        Overload dispatch order depends on the order the functions are defined in the IDL. Overloads must be specified from the most precise (overloads with wrapper type arguments) to the least precise (overloads with only primitive type arguments).
+
+        * bindings/scripts/CodeGeneratorV8.pm: Identify and output overloads callbacks and dispatch code.
+        * bindings/v8/test/TestObj.idl: Overloads sample.
+        * bindings/v8/test/V8TestObj.cpp: Output change.
+
+2010-04-15  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The TouchStationary state of WebCore::PlatformTouchPoint
+        is not handled inside the touch event handler.
+        https://bugs.webkit.org/show_bug.cgi?id=37609
+
+        After discussions at the WebKit contributors meeting, we decided
+        that this is a currently unused state without a good future use
+        case in the Touch API and thus decided to remove it. This patch
+        actions that decision.
+
+        As the TouchStationary state is not handled in the EventHandler,
+        there is no change in functionality so no new tests are required.
+
+        * platform/PlatformTouchPoint.h:
+        (WebCore::PlatformTouchPoint::): Remove TouchStationary.
+        * platform/qt/PlatformTouchPointQt.cpp:
+        (WebCore::PlatformTouchPoint::PlatformTouchPoint): Remove TouchStationary.
+
+2010-04-15  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use a lower-overhead mechanism for plug-in message throttling
+        https://bugs.webkit.org/show_bug.cgi?id=37642        
+        <rdar://problem/7418285> Very high CPU usage idling in gmail under Windows 7 (plug-in related)
+        
+        GMail has an instance of Flash that loads on the main mail page.
+        This Flash content sends us a constant stream of WM_USER+1 messsages.
+        
+        There was already code in PluginMessageThrottlerWin to queue and process these
+        excess WM_USER+1 messages from Flash. Unfortunately, there were a couple of
+        problems with this code:
+        
+        - The timer used to process the excess messages had a very low timeout (1ms).
+          Chrome uses a value of 5ms for this delay, and doesn't use excess CPU here,
+          while still maintaining good Flash frame rate.
+        
+        - The overhead involved in generating a constant stream of 5ms timers still swamped
+          the CPU, resulting in continued high CPU utilization.
+          
+        To fix this, I changed the throttling code to:
+        
+        - Process a queued WM_USER+1 message directly if none has been processed in 5ms.
+          This allows us to avoid the overhead of a timer.
+          
+        - Process remaining delayed WM_USER+1 messages on a 16ms timer.
+        
+        This reduces our CPU utilization idling in GMail from ~20% to ~2-3% on my system.
+        I also verified the frame rate for Flash content wasn't reduced with this change.
+
+        * plugins/win/PluginMessageThrottlerWin.cpp:
+        (WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin): Initialize m_lastMessageTime.
+        (WebCore::PluginMessageThrottlerWin::appendMessage): Process a queued message directly if >5ms have passed.
+        (WebCore::PluginMessageThrottlerWin::processQueuedMessage): Split out from messageThrottleTimerFired.
+        (WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired): Call through to processQueuedMessage.
+        * plugins/win/PluginMessageThrottlerWin.h: Add processQueuedMessage, m_lastMessageTime.
+
+2010-04-15  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by David Levin.
+
+        LEAK: in ThreadableWebSocketChannel::create()
+        https://bugs.webkit.org/show_bug.cgi?id=37584
+
+        No new tests because this change just fixes a leak.
+
+        * websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
+        * websockets/WorkerThreadableWebSocketChannel.h:
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
+
+2010-04-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Reviewed by Eric Seidel.
+
+        Duplicated patches related to wml were pushed to trunk. So, one of
+        the patches should be reverted.
+        https://bugs.webkit.org/show_bug.cgi?id=37542
+
+        * wml/WMLOptionElement.h:
+        * wml/WMLSelectElement.h:
+
+2010-04-15  Bruno Schmidt  <bruno.schmidt@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Null QObjects properties cause Segmentation Fault
+        https://bugs.webkit.org/show_bug.cgi?id=34730
+
+        QObjects exported to the QWebkit javascript with properties that are
+        a null "QObject*" cause Segmentation Fault.
+
+        If an QObject is added to the javascript context and it contains
+        properties of the type QObject* with NULL value, calling the property
+        causes Segmentation Fault.
+        So now the code below properly checks for null pointers:
+
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtInstance::getClass): may return NULL
+        (JSC::Bindings::QtInstance::getMethod): may return jsNull()
+        (JSC::Bindings::QtInstance::stringValue): may return jsNull()
+        (JSC::Bindings::QtInstance::booleanValue): may return false
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::convertValueToQVariant): 
+        (JSC::Bindings::convertQVariantToValue): May return jsNull on QObjectStar
+
+2010-04-14  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Repaint of fixed, transformed element is broken
+        https://bugs.webkit.org/show_bug.cgi?id=37637
+
+        RenderBox::computeRectForRepaint() failed to set the 'fixed' flag correctly
+        for elements that had both fixed position and a transform. If the element has
+        a transform, 'fixed' should only remain true if the element itself is fixed
+        position.
+        
+        Also cache style()->position() in a local variable for performance.
+        
+        Test: fast/repaint/fixed-tranformed.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeRectForRepaint):
+
+2010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Changing view mode names due to specification changes
+        https://bugs.webkit.org/show_bug.cgi?id=37615
+
+        test: fast/media/media-feature-wgt-view-mode.html
+
+        specification: http://dev.w3.org/2006/waf/widgets-vmmf/
+
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::view_modeMediaFeatureEval):
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::isWindowed):
+        (WebCore::ChromeClient::isMaximized):
+        (WebCore::ChromeClient::isMinimized):
+
+2010-04-14  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed attempt to fix Qt build.
+
+        * bindings/js/JSNodeCustom.cpp:
+
+2010-04-14  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Javascript URL can be set as iframe.src via multiple DOM aliases
+        https://bugs.webkit.org/show_bug.cgi?id=37031
+
+        Moved frame/iframe checks from Attr to Node on inherited members.
+        Node child manipulation methods now return NOT_SUPPORTED_ERR if used
+        on a frame/iframe src attribute.
+        NamedNodeMap set methods now perform frame/iframe src checks.
+        Moved allowSettingSrcToJavascriptURL static helper function from 
+        JSElementCustom.cpp to exported function in JSDOMBinding.h.
+
+        * bindings/js/JSAttrCustom.cpp:
+        (WebCore::JSAttr::setValue):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::allowSettingSrcToJavascriptURL):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSElementCustom.cpp:
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::setNamedItem):
+        (WebCore::JSNamedNodeMap::setNamedItemNS):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::isAttrFrameSrc):
+        (WebCore::JSNode::setNodeValue):
+        (WebCore::JSNode::setTextContent):
+        (WebCore::JSNode::insertBefore):
+        (WebCore::JSNode::replaceChild):
+        (WebCore::JSNode::removeChild):
+        (WebCore::JSNode::appendChild):
+        * bindings/v8/custom/V8AttrCustom.cpp:
+        * bindings/v8/custom/V8NamedNodeMapCustom.cpp:
+        (WebCore::V8NamedNodeMap::setNamedItemNSCallback):
+        (WebCore::V8NamedNodeMap::setNamedItemCallback):
+        (WebCore::toV8):
+        * bindings/v8/custom/V8NodeCustom.cpp:
+        (WebCore::isFrameSrc):
+        (WebCore::V8Node::textContentAccessorSetter):
+        (WebCore::V8Node::nodeValueAccessorSetter):
+        (WebCore::V8Node::insertBeforeCallback):
+        (WebCore::V8Node::replaceChildCallback):
+        (WebCore::V8Node::removeChildCallback):
+        (WebCore::V8Node::appendChildCallback):
+        * dom/Attr.idl:
+        * dom/NamedNodeMap.idl:
+        * dom/Node.idl:
+
+2010-04-14  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        We have to check if the resource handler is cancelled before
+        checking the client, other case it could crash.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::parseDataUrl):
+
+2010-04-14  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57609.
+        http://trac.webkit.org/changeset/57609
+        https://bugs.webkit.org/show_bug.cgi?id=37614
+
+        "Broke multiple builders.  Probably needs new test results,
+        but may be an Inspector bug." (Requested by eseidel on
+        #webkit).
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didReceiveResponse):
+        (WebCore::InspectorController::didFailLoading):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
+
+2010-04-14  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Don't cache SimpleFontData* in getLastResortFallbackFont. The cached entry may be invalidated.
+        https://bugs.webkit.org/show_bug.cgi?id=37599
+
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::fontDataFromDescriptionAndLogFont):
+        (WebCore::FontCache::getLastResortFallbackFont):
+
+2010-04-14  Andrey Kosyakov  <caseq@chromium.ru>
+
+        Reviewed by Timothy Hatcher.
+
+        Log error message to inspector console if a resource fails to load.
+        Disable checking of mime-type consistency for failed resources.
+        https://bugs.webkit.org/show_bug.cgi?id=37215
+
+        Test: inspector/console-resource-errors.html
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didReceiveResponse):
+        (WebCore::InspectorController::didFailLoading):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
+
+2010-04-14  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57599.
+        http://trac.webkit.org/changeset/57599
+        https://bugs.webkit.org/show_bug.cgi?id=37605
+
+        "Broke Chromium build" (Requested by dglazkov on #webkit).
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::notifyPopupHidden):
+        * platform/chromium/PopupMenuChromium.h:
+
+2010-04-14  Aaron Boodman  <aa@chromium.org>
+
+        Reviewed by David Levin.
+
+        Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting
+        the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are
+        unsupported. Fixed by resolving the relative URL first.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36623
+
+        Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows.
+
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification): Accept resolved KURL instead of relative string.
+        * notifications/Notification.h:
+        (WebCore::Notification::create): Ditto.
+        (WebCore::Notification::iconURL): Return resolved KURL instead of relative string.
+        * notifications/NotificationCenter.h:
+        (WebCore::NotificationCenter::createHTMLNotification): Immediately resolve URL instead of passing off relative string.
+        (WebCore::NotificationCenter::createNotification): Ditto.
+        * notifications/NotificationContents.h:
+        (WebCore::NotificationContents::NotificationContents): Accept resolved KURL instead of relative string.
+        (WebCore::NotificationContents::icon): Return resolved URL.
+
+2010-04-14  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add ThemeMac::ensuredView and get rid of a workaround in ThemeMac::paintButton.
+        https://bugs.webkit.org/show_bug.cgi?id=37601
+
+        * platform/mac/ThemeMac.h:
+        * platform/mac/ThemeMac.mm:
+        (-[WebCoreFlippedView isFlipped]):
+        (WebCore::paintButton):
+        (WebCore::ThemeMac::ensuredView):
+
+2010-04-14  Jay Civelli  <jcivelli@chromium.org>
+ 
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Select popups would assert when destroyed.
+        https://bugs.webkit.org/show_bug.cgi?id=37436
+ 
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::notifyPopupHidden):
+        * platform/chromium/PopupMenuChromium.h:
+ 
+
+2010-04-14  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Jian Li.
+
+        Remove an incorrect ASSERT in UniscribeHelper::draw().
+        https://bugs.webkit.org/show_bug.cgi?id=37533
+
+        * platform/graphics/chromium/UniscribeHelper.cpp:
+        (WebCore::UniscribeHelper::draw):
+
+2010-04-14  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: readline shortcuts don't work in Chromium.
+
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype._onKeyDown):
+        (WebInspector.TextPrompt.prototype._moveCaretToStartOfPrompt):
+
+2010-04-14  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Console: Shift-Tab does not cycle autocompletions in the reverse order
+        https://bugs.webkit.org/show_bug.cgi?id=37582
+
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype.complete):
+        (WebInspector.TextPrompt.prototype._completionsReady):
+        (WebInspector.TextPrompt.prototype._tabKeyPressed):
+
+2010-04-14  Jeff Schiller  <codedread@gmail.com>
+
+        Reviewed by Dirk Schulze.
+
+        Render SVG Paths up to first error, bug 37413: https://bugs.webkit.org/show_bug.cgi?id=37413
+
+        * svg/SVGParserUtilities.cpp:
+        (WebCore::SVGPathSegListBuilder::build):
+
+2010-04-14  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Joseph Pecoraro.
+
+        Web Inspector: Ctrl-L (Clear History) does nothing on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=37579
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView):
+
+2010-04-14  Anton Muhin  <antonm@chromium.org>
+
+        Not review, build fix.
+
+        Add <limits.h> include to bring UINT_MAX.
+
+        * html/canvas/WebGLArray.h:
+
+2010-04-14  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Not reviewed. Attempt to unbreak build - NodeRenderStyle.h is an _interessting_ concept...
+
+        * rendering/style/SVGRenderStyle.cpp: Include 'NodeRenderStyle.h'
+
+2010-04-14  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVGRenderStyle/SVGRenderStyleDefs needs a cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=37568
+
+        Cleanup SVGRenderStyle / SVGRenderStyleDefs:
+        - use copy constructors in initialization list to initialize members, instead of assignment operators in the body
+        - fix style issues (misplaced references, abbrevations)
+        - merge StyleClipData/StyleMaskData to save memory, rename it StyleResourceData
+        - move filter property in StyleResourceData
+        - rename StyleMarkerData to StyleInheritedResourceData to highlight the difference to StyleResourceData
+        - unify naming schemes for all resources (filter/clipper/masker/markers)
+          - clipPath() -> clipperResource()
+          - maskElement() -> maskerResource()
+          - startMarker() -> markerStartResource()
+          - midMarker() -> markerMidResource()
+          - endMarker() -> markerEndResource()
+          - filter() -> filterResource()
+
+        Adapt all callsites to the renames above.
+        No new tests, as this doesn't affect anything except memory overhead.
+
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue):
+        * css/SVGCSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applySVGProperty):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::calculateMarkerBoundsIfNeeded):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::selfWillPaint):
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::selfWillPaint):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        (WebCore::SVGRenderBase::filterBoundingBoxForRenderer):
+        (WebCore::SVGRenderBase::clipperBoundingBoxForRenderer):
+        (WebCore::SVGRenderBase::maskerBoundingBoxForRenderer):
+        (WebCore::deregisterFromResources):
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+        (WebCore::writeResources):
+        * rendering/style/SVGRenderStyle.cpp:
+        (WebCore::SVGRenderStyle::SVGRenderStyle):
+        (WebCore::SVGRenderStyle::operator==):
+        (WebCore::SVGRenderStyle::inheritedNotEqual):
+        (WebCore::SVGRenderStyle::inheritFrom):
+        * rendering/style/SVGRenderStyle.h:
+        * rendering/style/SVGRenderStyleDefs.cpp:
+        (WebCore::StyleFillData::StyleFillData):
+        (WebCore::StyleFillData::operator==):
+        (WebCore::StyleStrokeData::StyleStrokeData):
+        (WebCore::StyleStrokeData::operator==):
+        (WebCore::StyleStopData::StyleStopData):
+        (WebCore::StyleStopData::operator==):
+        (WebCore::StyleTextData::StyleTextData):
+        (WebCore::StyleMiscData::StyleMiscData):
+        (WebCore::StyleMiscData::operator==):
+        (WebCore::StyleShadowSVGData::StyleShadowSVGData):
+        (WebCore::StyleShadowSVGData::operator==):
+        (WebCore::StyleResourceData::StyleResourceData):
+        (WebCore::StyleResourceData::operator==):
+        (WebCore::StyleInheritedResourceData::StyleInheritedResourceData):
+        (WebCore::StyleInheritedResourceData::operator==):
+        * rendering/style/SVGRenderStyleDefs.h:
+        (WebCore::StyleFillData::operator!=):
+        (WebCore::StyleStopData::operator!=):
+        (WebCore::StyleMiscData::create):
+        (WebCore::StyleMiscData::copy):
+        (WebCore::StyleMiscData::operator!=):
+        (WebCore::StyleShadowSVGData::create):
+        (WebCore::StyleShadowSVGData::copy):
+        (WebCore::StyleShadowSVGData::operator!=):
+        (WebCore::StyleResourceData::create):
+        (WebCore::StyleResourceData::copy):
+        (WebCore::StyleResourceData::operator!=):
+        (WebCore::StyleInheritedResourceData::create):
+        (WebCore::StyleInheritedResourceData::copy):
+        (WebCore::StyleInheritedResourceData::operator!=):
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::addResource):
+        (WebCore::SVGDocumentExtensions::removeResource):
+        * svg/SVGDocumentExtensions.h:
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+
+2010-04-14  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        readPixels must take PACK_ALIGNMENT into account
+        https://bugs.webkit.org/show_bug.cgi?id=34718
+
+        Test: fast/canvas/webgl/read-pixels.html
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext): Init members to support pack_alignment.
+        (WebCore::WebGLRenderingContext::pixelStorei): Save pack/unpack_alignment.
+        (WebCore::WebGLRenderingContext::readPixels): Validate enum and deal with pack_alignment.
+        * html/canvas/WebGLRenderingContext.h: Add members to support pack_alignment.
+        * platform/graphics/GraphicsContext3D.h: Refactor readPixels.
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+        (WebCore::GraphicsContext3D::readPixels): Move array allocation and alpha fix to WebGLRenderingContext; flush before read pixels.
+
+2010-04-13  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION(r57511): many new graphics / svg related leaks
+        https://bugs.webkit.org/show_bug.cgi?id=37527
+
+        The content of a HashMap was not correctly deleted. Fixed this
+        in the DTor and in invalidateClient of RenderSVGResourceClipper.
+
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::~RenderSVGResourceClipper):
+        (WebCore::RenderSVGResourceClipper::invalidateClient):
+
+2010-04-13  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fix a potential integer overflow in WebGL*Array::slice()
+        https://bugs.webkit.org/show_bug.cgi?id=37466
+
+        * html/canvas/WebGLArray.h:
+        (WebCore::WebGLArray::clampOffsetAndNumElements): Input parameter "offset"'s semantic changed from in bytes from buffer to in elements from array view; calculate offset in bytes from buffer inside the function, avoiding overflow. 
+        * html/canvas/WebGLByteArray.cpp:
+        (WebCore::WebGLByteArray::slice): Changed according to new semantic of WebCore::WebGLArray::clampOffsetAndNumElements.
+        * html/canvas/WebGLFloatArray.cpp:
+        (WebCore::WebGLFloatArray::slice): Ditto.
+        * html/canvas/WebGLIntArray.cpp:
+        (WebCore::WebGLIntArray::slice): Ditto.
+        * html/canvas/WebGLShortArray.cpp:
+        (WebCore::WebGLShortArray::slice): Ditto.
+        * html/canvas/WebGLUnsignedByteArray.cpp:
+        (WebCore::WebGLUnsignedByteArray::slice): Ditto.
+        * html/canvas/WebGLUnsignedIntArray.cpp:
+        (WebCore::WebGLUnsignedIntArray::slice): Ditto.
+        * html/canvas/WebGLUnsignedShortArray.cpp:
+        (WebCore::WebGLUnsignedShortArray::slice): Ditto.
+
+2010-04-13  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        If the browsing context's session history contains only one Document,
+        and that was the about:blank Document created when the browsing context
+        was created, then the navigation must be done with replacement enabled.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37126
+
+        Tests: fast/loader/frame-location-change-not-added-to-history.html
+               fast/loader/frame-src-change-not-added-to-history.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clientRedirected):
+        (WebCore::FrameLoader::findFrameForNavigation):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::currentItemShouldBeReplaced):
+        * loader/HistoryController.h:
+
+2010-04-13  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Separated a DOMWrapperWorld's behavior of keeping wrappers alive from
+        its own lifetime, so a DOMWrapperWorld's controller can throw away
+        its wrappers even before its refcount reaches 0.
+
+        * WebCore.base.exp:
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::registerWorld):
+        (WebCore::DOMWrapperWorld::unregisterWorld):
+        * bindings/js/DOMWrapperWorld.h: Factored out DOMWrapperWorld registration
+        and unregistration into helper functions, so unregistering could be done manually.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::destroyWindowShell): Added an ASSERT to match
+        similar code.
+
+2010-04-13  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34653
+
+        Based on W3C spec and Firefox behavior, while invoking XHR Send with parameter
+        as String, the charset in Content-Type should be forced to set to UTF-8.
+
+        Test: http/tests/xmlhttprequest/request-encoding2.html
+
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::extractCharsetFromMediaType):
+        (WebCore::findCharsetInMediaType):
+        * platform/network/HTTPParsers.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::setCharsetInMediaType):
+        (WebCore::XMLHttpRequest::send):
+
+2010-04-12  Timothy Hatcher  <timothy@apple.com>
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Test: http/tests/xmlhttprequest/origin-whitelisting-removal.html
+
+        Reviewed by Dave Hyatt.
+
+        * WebCore.base.exp: Added SecurityOrigin::removeOriginAccessWhitelistEntry.
+        * page/OriginAccessEntry.h:
+        (WebCore::OriginAccessEntry::protocol): Added. Returns m_protocol.
+        (WebCore::OriginAccessEntry::host): Added. Returns m_host.
+        (WebCore::OriginAccessEntry::subdomainSettings): Added. Returns m_subdomainSettings.
+        (WebCore::operator==): Added. Compares OriginAccessEntry.
+        (WebCore::operator!=): Ditto.
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::addOriginAccessWhitelistEntry): Use the add method to prevent a
+        second hash lookup.
+        (WebCore::SecurityOrigin::removeOriginAccessWhitelistEntry): Added. Find a matching
+        OriginAccessEntry and remove it.
+        * page/SecurityOrigin.h: Added removeOriginAccessWhitelistEntry.
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * WebCore.base.exp:
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::addOriginAccessWhitelistEntry):
+        (WebCore::SecurityOrigin::resetOriginAccessWhitelists):
+        * page/SecurityOrigin.h:
+
+2010-04-13  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Tidied up some more DOMWrapperWorld lifetime issues.
+        
+        Made DOMWrapperWorld aware of its JSDOMWindowShells, so it can clear them.
+
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::DOMWrapperWorld::didCreateWindowShell):
+        (WebCore::DOMWrapperWorld::didDestroyWindowShell): Functionality for
+        tracking window shells that reference a given DOMWrapperWorld.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::~ScriptController):
+        (WebCore::ScriptController::destroyWindowShell):
+        (WebCore::ScriptController::createWindowShell):
+        (WebCore::ScriptController::clearWindowShell):
+        (WebCore::ScriptController::initScript):
+        * bindings/js/ScriptController.h: Refactored to update a DOMWrapperWorld
+        when adding or removing a JSDOMWindowShell.
+
+        * dom/Document.cpp:
+        (WebCore::Document::destroyAllWrapperCaches): Changed to use isEmpty(),
+        which is slightly faster and simpler than iterator comparison.
+
+2010-04-13  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Make all HTML5 DB callbacks run in the correct context.
+        https://bugs.webkit.org/show_bug.cgi?id=27698
+
+        Tests: storage/statement-error-callback-isolated-world.html
+               storage/statement-success-callback-isolated-world.html
+               storage/transaction-callback-isolated-world.html
+               storage/transaction-error-callback-isolated-world.html
+
+        * bindings/js/JSCustomSQLStatementCallback.cpp:
+        (WebCore::JSCustomSQLStatementCallback::JSCustomSQLStatementCallback):
+        (WebCore::JSCustomSQLStatementCallback::handleEvent):
+        * bindings/js/JSCustomSQLStatementCallback.h:
+        * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+        (WebCore::JSCustomSQLStatementErrorCallback::JSCustomSQLStatementErrorCallback):
+        (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
+        * bindings/js/JSCustomSQLStatementErrorCallback.h:
+        * bindings/js/JSCustomSQLTransactionCallback.cpp:
+        (WebCore::JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback):
+        (WebCore::JSCustomSQLTransactionCallback::handleEvent):
+        * bindings/js/JSCustomSQLTransactionCallback.h:
+        * bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
+        (WebCore::JSCustomSQLTransactionErrorCallback::JSCustomSQLTransactionErrorCallback):
+        (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
+        * bindings/js/JSCustomSQLTransactionErrorCallback.h:
+        * bindings/v8/custom/V8CustomSQLStatementCallback.cpp:
+        (WebCore::V8CustomSQLStatementCallback::V8CustomSQLStatementCallback):
+        (WebCore::V8CustomSQLStatementCallback::handleEvent):
+        * bindings/v8/custom/V8CustomSQLStatementCallback.h:
+        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+        (WebCore::V8CustomSQLStatementErrorCallback::V8CustomSQLStatementErrorCallback):
+        (WebCore::V8CustomSQLStatementErrorCallback::handleEvent):
+        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.h:
+        * bindings/v8/custom/V8CustomSQLTransactionCallback.cpp:
+        (WebCore::V8CustomSQLTransactionCallback::V8CustomSQLTransactionCallback):
+        (WebCore::V8CustomSQLTransactionCallback::handleEvent):
+        * bindings/v8/custom/V8CustomSQLTransactionCallback.h:
+        * bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp:
+        (WebCore::V8CustomSQLTransactionErrorCallback::V8CustomSQLTransactionErrorCallback):
+        (WebCore::V8CustomSQLTransactionErrorCallback::handleEvent):
+        * bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h:
+        * storage/SQLStatement.cpp:
+        (WebCore::SQLStatement::performCallback):
+        * storage/SQLStatementCallback.h:
+        * storage/SQLStatementErrorCallback.h:
+        * storage/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::deliverTransactionCallback):
+        (WebCore::SQLTransaction::deliverTransactionErrorCallback):
+        * storage/SQLTransactionCallback.h:
+        * storage/SQLTransactionErrorCallback.h:
+        (WebCore::SQLTransactionErrorCallback::~SQLTransactionErrorCallback):
+
+2010-04-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Fix search behavior in Profiles tab.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37498
+
+        * inspector/front-end/ProfileView.js:
+        (WebInspector.CPUProfileView.profileCallback):
+        (WebInspector.CPUProfileView):
+
+2010-04-13  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37513, clean up StyleBoxData and the RenderStyle variable that uses it.
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::RenderStyle):
+        (WebCore::RenderStyle::operator==):
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        (WebCore::):
+        (WebCore::InheritedFlags::width):
+        (WebCore::InheritedFlags::height):
+        (WebCore::InheritedFlags::minWidth):
+        (WebCore::InheritedFlags::maxWidth):
+        (WebCore::InheritedFlags::minHeight):
+        (WebCore::InheritedFlags::maxHeight):
+        (WebCore::InheritedFlags::verticalAlignLength):
+        (WebCore::InheritedFlags::boxSizing):
+        (WebCore::InheritedFlags::setWidth):
+        (WebCore::InheritedFlags::setHeight):
+        (WebCore::InheritedFlags::setMinWidth):
+        (WebCore::InheritedFlags::setMaxWidth):
+        (WebCore::InheritedFlags::setMinHeight):
+        (WebCore::InheritedFlags::setMaxHeight):
+        (WebCore::InheritedFlags::setVerticalAlignLength):
+        (WebCore::InheritedFlags::hasAutoZIndex):
+        (WebCore::InheritedFlags::setHasAutoZIndex):
+        (WebCore::InheritedFlags::zIndex):
+        (WebCore::InheritedFlags::setZIndex):
+        (WebCore::InheritedFlags::setBoxSizing):
+        * rendering/style/StyleBoxData.cpp:
+        (WebCore::StyleBoxData::StyleBoxData):
+        (WebCore::StyleBoxData::operator==):
+        * rendering/style/StyleBoxData.h:
+        (WebCore::StyleBoxData::width):
+        (WebCore::StyleBoxData::height):
+        (WebCore::StyleBoxData::minWidth):
+        (WebCore::StyleBoxData::minHeight):
+        (WebCore::StyleBoxData::maxWidth):
+        (WebCore::StyleBoxData::maxHeight):
+        (WebCore::StyleBoxData::verticalAlign):
+        (WebCore::StyleBoxData::zIndex):
+        (WebCore::StyleBoxData::hasAutoZIndex):
+        (WebCore::StyleBoxData::boxSizing):
+
+2010-04-12  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Tor Arne Vestbo.
+
+        Minor fix to pass RenderProgress instead of RenderObject
+        https://bugs.webkit.org/show_bug.cgi?id=37481
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::getOrCreate):
+        * accessibility/AccessibilityProgressIndicator.cpp:
+        (WebCore::AccessibilityProgressIndicator::AccessibilityProgressIndicator):
+        (WebCore::AccessibilityProgressIndicator::create):
+        * accessibility/AccessibilityProgressIndicator.h:
+
+2010-04-13  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37510, clean up StyleBackgroundData
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::RenderStyle):
+        (WebCore::RenderStyle::operator==):
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        (WebCore::):
+        (WebCore::InheritedFlags::hasBackground):
+        (WebCore::InheritedFlags::hasBackgroundImage):
+        (WebCore::InheritedFlags::hasFixedBackgroundImage):
+        (WebCore::InheritedFlags::outlineWidth):
+        (WebCore::InheritedFlags::outlineStyle):
+        (WebCore::InheritedFlags::outlineStyleIsAuto):
+        (WebCore::InheritedFlags::outlineColor):
+        (WebCore::InheritedFlags::backgroundColor):
+        (WebCore::InheritedFlags::backgroundImage):
+        (WebCore::InheritedFlags::backgroundRepeatX):
+        (WebCore::InheritedFlags::backgroundRepeatY):
+        (WebCore::InheritedFlags::backgroundComposite):
+        (WebCore::InheritedFlags::backgroundAttachment):
+        (WebCore::InheritedFlags::backgroundClip):
+        (WebCore::InheritedFlags::backgroundOrigin):
+        (WebCore::InheritedFlags::backgroundXPosition):
+        (WebCore::InheritedFlags::backgroundYPosition):
+        (WebCore::InheritedFlags::backgroundSizeType):
+        (WebCore::InheritedFlags::backgroundSizeLength):
+        (WebCore::InheritedFlags::accessBackgroundLayers):
+        (WebCore::InheritedFlags::backgroundLayers):
+        (WebCore::InheritedFlags::outlineOffset):
+        (WebCore::InheritedFlags::resetOutline):
+        (WebCore::InheritedFlags::setBackgroundColor):
+        (WebCore::InheritedFlags::setBackgroundXPosition):
+        (WebCore::InheritedFlags::setBackgroundYPosition):
+        (WebCore::InheritedFlags::setBackgroundSize):
+        (WebCore::InheritedFlags::setBackgroundSizeLength):
+        (WebCore::InheritedFlags::setOutlineWidth):
+        (WebCore::InheritedFlags::setOutlineStyle):
+        (WebCore::InheritedFlags::setOutlineColor):
+        (WebCore::InheritedFlags::clearBackgroundLayers):
+        (WebCore::InheritedFlags::inheritBackgroundLayers):
+        (WebCore::InheritedFlags::setOutlineOffset):
+        * rendering/style/StyleBackgroundData.h:
+        (WebCore::StyleBackgroundData::background):
+        (WebCore::StyleBackgroundData::color):
+        (WebCore::StyleBackgroundData::outline):
+
+2010-04-13  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by David Levin.
+
+        [Haiku] Use the system clipboard instead of a private clipboard.
+                Fix various problems in the previous implementation.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37421
+
+        No new tests needed.
+
+        * platform/haiku/PasteboardHaiku.cpp:
+        (WebCore::Pasteboard::~Pasteboard):
+        (WebCore::Pasteboard::generalPasteboard):
+            - Don't leak the pasteboard at program exit.
+        (WebCore::AutoClipboardLocker::AutoClipboardLocker):
+        (WebCore::AutoClipboardLocker::~AutoClipboardLocker):
+        (WebCore::AutoClipboardLocker::isLocked):
+            - helper class for locking a BClipboard.
+        (WebCore::Pasteboard::writeSelection):
+            - Use AddData(B_MIME_TYPE) as required by clipboard protocol.
+            - Make sure we don't end up with unwanted UTF-8 characters for
+              regular line breaks.
+        (WebCore::Pasteboard::writePlainText):
+            - Use AddData(B_MIME_TYPE) as required by clipboard protocol.
+        (WebCore::Pasteboard::plainText):
+            - Use FindData(B_MIME_TYPE) as required by clipboard protocol.
+        (WebCore::Pasteboard::documentFragment):
+            - Implemented.
+        (WebCore::Pasteboard::writeURL):
+            - Needs to use AddData(B_MIME_TYPE) instead of AddString().
+        (WebCore::Pasteboard::clear):
+
+2010-04-13  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by David Levin.
+
+        [Haiku] Fix bridging Widget to native top-level BView.
+        https://bugs.webkit.org/show_bug.cgi?id=37419
+
+        In the Haiku port, there is no mapping between native widgets
+        and WebCore Widget instances. There is only a top-level BView
+        which renders a web page into a bitmap. For certain WebCore widget
+        functionality, we need to access this BView, like for setting the
+        current cursor or forcing focus. On the other hand, setting a
+        platform widget pointer on Widget results into completely different
+        behavior, like ScrollView tries to forward everything instead of
+        handling stuff itself. To make this work, the pointer to a "top-level"
+        BView is stored in every Widget for the Haiku port.
+
+        No new tests needed.
+
+        * platform/Widget.h:
+            - Added the m_topLevelPlatformWidget member for the Haiku platform.
+        (WebCore::Widget::setPlatformWidget):
+        (WebCore::Widget::topLevelPlatformWidget):
+        (WebCore::Widget::setTopLevelPlatformWidget):
+        * platform/haiku/WidgetHaiku.cpp:
+        (WebCore::AutoPlatformWidgetLocker::AutoPlatformWidgetLocker):
+        (WebCore::AutoPlatformWidgetLocker::~AutoPlatformWidgetLocker):
+        (WebCore::AutoPlatformWidgetLocker::isLocked):
+            - helper class for locking the BView looper thread with a timeout
+        (WebCore::Widget::Widget):
+        (WebCore::Widget::setFocus):
+            - Make sure the top-level view receives keyboard input.
+        (WebCore::Widget::setCursor):
+            - Set the cursor on the top-level view.
+        (WebCore::Widget::show):
+        (WebCore::Widget::hide):
+            - Don't show/hide the top-level view, but make the code correct
+              for whenever we would map an individual BView per Widget.
+            - Use setSelfVisible() and isParentVisible() like in other ports.
+
+2010-04-13  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
+
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        No new tests as there is no new functionality.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedLoadingDocument): Make copy of mimeType string to isolate crash.
+
+2010-04-13  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add a null ptr check for m_popupClient.
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupListBox::abandon): Add a null ptr check
+
+2010-04-13  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by David Levin.
+
+        [Haiku] Use the system's default font family as last fall back font.
+        https://bugs.webkit.org/show_bug.cgi?id=37501
+
+        No new tests needed.
+
+        * platform/graphics/haiku/FontCacheHaiku.cpp:
+        (WebCore::FontCache::getLastResortFallbackFont):
+            - Use the system's default font family (from be_plain_font global).
+
+2010-04-13  Eskil Blomfeldt <eblomfel@trolltech.com>, Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac
+        https://bugs.webkit.org/show_bug.cgi?id=36532
+
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::floatWidthForComplexText):
+        (WebCore::Font::font):
+
+2010-04-13  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Cannot effectively delete properties in the Styles sidebar pane
+        https://bugs.webkit.org/show_bug.cgi?id=37499
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::applyStyleText):
+
+2010-04-13  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by David Levin.
+
+        Use the Haiku MIME type data base as a fall back for unknown file extensions.
+        https://bugs.webkit.org/show_bug.cgi?id=34686
+
+        Covered by existing tests.
+
+        * platform/haiku/MIMETypeRegistryHaiku.cpp:
+        (WebCore::):
+            - fixed coding style issues
+        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
+            - fall back to the system MIME database for unknown types.
+            - return empty String as last resort, this is used
+              elsewhere as indicator for unknown types.
+
+2010-04-13  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by David Levin.
+
+        [Haiku] Use all the new system cursors available in recent Haiku revisions.
+        <https://bugs.webkit.org/show_bug.cgi?id=37385>
+
+        Covered by existing tests.
+
+        * platform/haiku/CursorHaiku.cpp:
+        (WebCore::Cursor::Cursor):
+        (WebCore::Cursor::~Cursor):
+        (WebCore::Cursor::operator=):
+            - Adapted to maintain an owned BCursor instance.
+        (WebCore::createCursorByID):
+            - helper function to create a Cursor instance by BCursorID constant.
+        (WebCore::pointerCursor):
+            - NULL BCursor triggers using the system cursor.
+        (WebCore::moveCursor):
+        (WebCore::crossCursor):
+        (WebCore::handCursor):
+        (WebCore::iBeamCursor):
+        (WebCore::waitCursor):
+        (WebCore::helpCursor):
+        (WebCore::eastResizeCursor):
+        (WebCore::northResizeCursor):
+        (WebCore::northEastResizeCursor):
+        (WebCore::northWestResizeCursor):
+        (WebCore::southResizeCursor):
+        (WebCore::southEastResizeCursor):
+        (WebCore::southWestResizeCursor):
+        (WebCore::westResizeCursor):
+        (WebCore::northSouthResizeCursor):
+        (WebCore::eastWestResizeCursor):
+        (WebCore::northEastSouthWestResizeCursor):
+        (WebCore::northWestSouthEastResizeCursor):
+        (WebCore::columnResizeCursor):
+        (WebCore::rowResizeCursor):
+        (WebCore::verticalTextCursor):
+        (WebCore::cellCursor):
+        (WebCore::contextMenuCursor):
+        (WebCore::noDropCursor):
+        (WebCore::copyCursor):
+        (WebCore::progressCursor):
+        (WebCore::aliasCursor):
+        (WebCore::noneCursor):
+        (WebCore::notAllowedCursor):
+        (WebCore::zoomInCursor):
+        (WebCore::zoomOutCursor):
+        (WebCore::grabCursor):
+        (WebCore::grabbingCursor):
+            - Use the new system cursors.
+
+2010-04-13  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        <clipPath> doesn't correctly handle <text> elements
+        https://bugs.webkit.org/show_bug.cgi?id=12571
+
+        Adds support for text elements as clipPath, heterogenous clip rules, as well
+        as clipping of clipPath.
+        A fast code path let platforms clip simple shapes directly. All other variants
+        are drawn to a seperate ImageBuffer, which is used as a mask. This happens the same
+        way we like we do it on SVG Masking. This needs temporary changes to the RenderStyle
+        of clipPath childs. Values like stroke, resources, opacity have to be ignored.
+
+        Tests: svg/clip-path/clip-path-child-clipped.svg
+               svg/clip-path/clip-path-childs-clipped.svg
+               svg/clip-path/clip-path-clipped-evenodd-twice.svg
+               svg/clip-path/clip-path-clipped-no-content.svg
+               svg/clip-path/clip-path-clipped-nonzero.svg
+               svg/clip-path/clip-path-clipped.svg
+               svg/clip-path/clip-path-evenodd-nonzero.svg
+               svg/clip-path/clip-path-evenodd.svg
+               svg/clip-path/clip-path-nonzero-evenodd.svg
+               svg/clip-path/clip-path-nonzero.svg
+               svg/clip-path/clip-path-objectBoundingBox.svg
+               svg/clip-path/clip-path-on-clipped-use.svg
+               svg/clip-path/clip-path-on-g-and-child.svg
+               svg/clip-path/clip-path-on-g.svg
+               svg/clip-path/clip-path-on-svg-and-child.svg
+               svg/clip-path/clip-path-on-svg.svg
+               svg/clip-path/clip-path-recursive-call-by-child.svg
+               svg/clip-path/clip-path-recursive-call.svg
+               svg/clip-path/clip-path-text-and-shape.svg
+               svg/clip-path/clip-path-text-and-stroke.svg
+               svg/clip-path/clip-path-text.svg
+               svg/clip-path/clip-path-use-as-child.svg
+               svg/clip-path/clip-path-use-as-child2.svg
+               svg/clip-path/clip-path-use-as-child3.svg
+               svg/clip-path/clip-path-use-as-child4.svg
+               svg/clip-path/clip-path-use-as-child5.svg
+               svg/clip-path/clip-path-userSpaceOnUse.svg
+               svg/clip-path/clip-path-with-container.svg
+               svg/clip-path/clip-path-with-different-unittypes.svg
+               svg/clip-path/clip-path-with-different-unittypes2.svg
+               svg/clip-path/clip-path-with-invisibile-child.svg
+               svg/clip-path/clip-path-with-text-clipped.svg
+
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isSVGShadowTreeRootContainer): identify use-element renderer
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::invalidateClients):
+        (WebCore::RenderSVGResourceClipper::invalidateClient):
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        (WebCore::RenderSVGResourceClipper::pathOnlyClipping): direct clipping for simple shapes
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext): direct clipping or maskImage?
+        (WebCore::RenderSVGResourceClipper::createClipData): creates maskImage for clipping
+        (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
+        * rendering/RenderSVGResourceClipper.h:
+        * rendering/RenderSVGShadowTreeRootContainer.h: identify use-Element by renderer
+        (WebCore::RenderSVGShadowTreeRootContainer::isSVGShadowTreeRootContainer):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::renderSubtreeToImage): hack to get texts working on clipping (masks and pattern)
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::rendererClipChild): get renderer of referenced object
+        * svg/SVGUseElement.h:
+
+2010-04-13  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        SVG renderers should track transform/path changes, instead of pulling every time from SVG DOM
+        https://bugs.webkit.org/show_bug.cgi?id=15389
+
+        RenderPath caches repaint rectangles (fill/stroke bbox etc.) though this caching
+        was effectively useless because every layout() call caused them to be reset to empty rects.
+        Furthermore RenderPath::layout() queried the SVG DOM upon every invocation to retrieve
+        the Path object, instead of only doing it when necessary. Even the TransformationMatrix
+        was polled everytime from the SVG DOM.
+
+        Move the knownledge wheter we need to update path/transform into the render tree and
+        only update when necessary. This should result in a huge performance increase, with
+        the drawback of adding slightly more memory, because we need to add booleans indicating
+        the status of path/transform (is dirty?).
+
+        Doesn't affect any tests, only performance.
+
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::RenderForeignObject):
+        (WebCore::RenderForeignObject::layout):
+        * rendering/RenderForeignObject.h:
+        (WebCore::RenderForeignObject::setNeedsTransformUpdate):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::setNeedsTransformUpdate):
+        (WebCore::RenderObject::setNeedsBoundariesUpdate):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::RenderPath):
+        (WebCore::RenderPath::layout):
+        (WebCore::RenderPath::invalidateCachedBoundaries):
+        (WebCore::RenderPath::styleWillChange):
+        * rendering/RenderPath.h:
+        (WebCore::RenderPath::setNeedsBoundariesUpdate):
+        (WebCore::RenderPath::setNeedsPathUpdate):
+        (WebCore::RenderPath::setNeedsTransformUpdate):
+        (WebCore::RenderPath::localToParentTransform):
+        (WebCore::RenderPath::localTransform):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::RenderSVGImage):
+        (WebCore::RenderSVGImage::layout):
+        * rendering/RenderSVGImage.h:
+        (WebCore::RenderSVGImage::setNeedsTransformUpdate):
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::invalidateClients):
+        * rendering/RenderSVGResourceMarker.cpp:
+        (WebCore::RenderSVGResourceMarker::invalidateClients):
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::invalidateClients):
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::RenderSVGText):
+        (WebCore::RenderSVGText::layout):
+        * rendering/RenderSVGText.h:
+        (WebCore::RenderSVGText::setNeedsTransformUpdate):
+        * rendering/RenderSVGTransformableContainer.cpp:
+        (WebCore::RenderSVGTransformableContainer::RenderSVGTransformableContainer):
+        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
+        * rendering/RenderSVGTransformableContainer.h:
+        (WebCore::RenderSVGTransformableContainer::localToParentTransform):
+        (WebCore::RenderSVGTransformableContainer::setNeedsTransformUpdate):
+        (WebCore::RenderSVGTransformableContainer::localTransform):
+        * svg/SVGAnimateMotionElement.cpp:
+        (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
+        (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
+        * svg/SVGAnimateTransformElement.cpp:
+        (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
+        * svg/SVGCircleElement.cpp:
+        (WebCore::SVGCircleElement::svgAttributeChanged):
+        * svg/SVGEllipseElement.cpp:
+        (WebCore::SVGEllipseElement::svgAttributeChanged):
+        * svg/SVGForeignObjectElement.cpp:
+        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
+        * svg/SVGGElement.cpp:
+        (WebCore::SVGGElement::svgAttributeChanged):
+        * svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::svgAttributeChanged):
+        * svg/SVGLineElement.cpp:
+        (WebCore::SVGLineElement::svgAttributeChanged):
+        * svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::svgAttributeChanged):
+        * svg/SVGPolyElement.cpp:
+        (WebCore::SVGPolyElement::svgAttributeChanged):
+        * svg/SVGRectElement.cpp:
+        (WebCore::SVGRectElement::svgAttributeChanged):
+        * svg/SVGTextElement.cpp:
+        (WebCore::SVGTextElement::svgAttributeChanged):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::svgAttributeChanged):
+
+2010-04-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Unreviewed Qt build fix: add new .idl files to WebCore.pri
+
+        * WebCore.pri:
+
+2010-04-12  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Replace hand-written JavaScriptProfile* bindings with idl-based, and
+        in Chromium port, bind them to the new V8's profiler API that is
+        aligned with JSC.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37448
+
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSConsoleCustom.cpp:
+        * bindings/js/JSScriptProfileNodeCustom.cpp: Added.
+        (WebCore::JSScriptProfileNode::callUID):
+        (WebCore::JSScriptProfileNode::children):
+        * bindings/js/JavaScriptProfile.cpp: Removed.
+        * bindings/js/JavaScriptProfile.h: Removed.
+        * bindings/js/JavaScriptProfileNode.cpp: Removed.
+        * bindings/js/JavaScriptProfileNode.h: Removed.
+        * bindings/js/ScriptProfileNode.h: Added.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/ScriptProfile.cpp: Added.
+        (WebCore::ScriptProfile::title):
+        (WebCore::ScriptProfile::uid):
+        (WebCore::ScriptProfile::head):
+        * bindings/v8/ScriptProfile.h:
+        (WebCore::ScriptProfile::create):
+        (WebCore::ScriptProfile::ScriptProfile):
+        * bindings/v8/ScriptProfileNode.cpp: Added.
+        (WebCore::ScriptProfileNode::functionName):
+        (WebCore::ScriptProfileNode::url):
+        (WebCore::ScriptProfileNode::lineNumber):
+        (WebCore::ScriptProfileNode::totalTime):
+        (WebCore::ScriptProfileNode::selfTime):
+        (WebCore::ScriptProfileNode::numberOfCalls):
+        (WebCore::ScriptProfileNode::children):
+        (WebCore::ScriptProfileNode::visible):
+        (WebCore::ScriptProfileNode::callUID):
+        * bindings/v8/ScriptProfileNode.h: Added.
+        (WebCore::ScriptProfileNode::create):
+        (WebCore::ScriptProfileNode::~ScriptProfileNode):
+        (WebCore::ScriptProfileNode::ScriptProfileNode):
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::start):
+        (WebCore::ScriptProfiler::stop):
+        * bindings/v8/custom/V8ConsoleCustom.cpp: Added.
+        (WebCore::V8Console::profilesAccessorGetter):
+        * bindings/v8/custom/V8ScriptProfileCustom.cpp: Added.
+        (WebCore::toV8):
+        * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp: Added.
+        (WebCore::V8ScriptProfileNode::childrenAccessorGetter):
+        (WebCore::V8ScriptProfileNode::callUIDAccessorGetter):
+        (WebCore::toV8):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::getProfile):
+        * inspector/ScriptProfile.idl: Added.
+        * inspector/ScriptProfileNode.idl: Added.
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.getProfile):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype.populateInterface):
+        (WebInspector.ProfilesPanel.prototype.profilerWasEnabled):
+        * page/Console.idl:
+        * platform/android/TemporaryLinkStubs.cpp:
+
+2010-04-12  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial Navigation: make renderRectRelativeToRootDocument method to fallback to getRect() of Element when needed
+        https://bugs.webkit.org/show_bug.cgi?id=37461
+
+        getRect() of Element can be used instead of absoluteClippedOverflowRect of RenderObject when
+        the node is currently offscreen in an scroll overflowed content.
+
+        Test: fast/events/spatial-navigation/snav-simple-content-overflow.html
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::renderRectRelativeToRootDocument):
+
+2010-04-12  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Unreviewed style fix.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+
+2010-04-08  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Accessibility support for progress element
+        https://bugs.webkit.org/show_bug.cgi?id=37275
+
+        Implement AccessibilityProgressIndicator to hook up progress element to accessibility framework.
+
+        Test: platform/mac/accessibility/progressbar.html
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::getOrCreate):
+        * accessibility/AccessibilityProgressIndicator.cpp: Added.
+        (WebCore::AccessibilityProgressIndicator::AccessibilityProgressIndicator):
+        (WebCore::AccessibilityProgressIndicator::create):
+        (WebCore::AccessibilityProgressIndicator::accessibilityIsIgnored):
+        (WebCore::AccessibilityProgressIndicator::valueForRange):
+        (WebCore::AccessibilityProgressIndicator::maxValueForRange):
+        (WebCore::AccessibilityProgressIndicator::minValueForRange):
+        (WebCore::AccessibilityProgressIndicator::element):
+        * accessibility/AccessibilityProgressIndicator.h: Added.
+        (WebCore::AccessibilityProgressIndicator::roleValue):
+        (WebCore::AccessibilityProgressIndicator::isProgressIndicator):
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::updateFromElement):
+        (WebCore::RenderProgress::progressElement):
+        * rendering/RenderProgress.h:
+
+2010-04-12  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Throwing a SECURITY_ERR when openDatabase() cannot open a database
+        for whatever reason, as required by the spec.
+        https://bugs.webkit.org/show_bug.cgi?id=33916
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openDatabaseCallback):
+
+2010-04-12  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        WebKit should have more robust last-chance font fallback on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=37473
+        <rdar://problem/7789438> Crash in FontFallbackList::determinePitch
+        <rdar://problem/7233762> Crash in FontFallbackList::fontDataAt
+        
+        Look harder for a suitable last-resort font. Previously, we checked for
+        "Times New Roman" followed by DEFAULT_GUI_FONT.
+        
+        We now look for:
+        - Typically installed Unicode-capable fonts, in order of coverage
+        - DEFAULT_GUI_FONT
+        - SPI_GETNONCLIENTMETRICS fonts
+        
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::fontDataFromDescriptionAndLogFont):
+        (WebCore::FontCache::getLastResortFallbackFont):
+
+2010-04-12  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37469, clean up ShadowData to be encapsulated properly.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::valueForShadow):
+        * page/animation/AnimationBase.cpp:
+        (WebCore::blendFunc):
+        (WebCore::PropertyWrapperShadow::PropertyWrapperShadow):
+        (WebCore::PropertyWrapperShadow::equals):
+        (WebCore::PropertyWrapperShadow::blend):
+        * page/mac/FrameMac.mm:
+        (WebCore::Frame::fontAttributesForSelectionStart):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::placeBoxesHorizontally):
+        (WebCore::InlineFlowBox::computeVerticalOverflow):
+        (WebCore::InlineFlowBox::paintTextDecorations):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::paintTextWithShadows):
+        (WebCore::InlineTextBox::paint):
+        (WebCore::InlineTextBox::paintDecoration):
+        * rendering/InlineTextBox.h:
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateRects):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::adjustRectForOutlineAndShadow):
+        * rendering/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintCharacters):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::setTextShadow):
+        (WebCore::RenderStyle::setBoxShadow):
+        (WebCore::RenderStyle::getBoxShadowExtent):
+        (WebCore::RenderStyle::getBoxShadowHorizontalExtent):
+        (WebCore::RenderStyle::getBoxShadowVerticalExtent):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::textShadow):
+        (WebCore::InheritedFlags::boxShadow):
+        * rendering/style/SVGRenderStyle.cpp:
+        (WebCore::getSVGShadowExtent):
+        * rendering/style/ShadowData.cpp:
+        (WebCore::ShadowData::ShadowData):
+        (WebCore::ShadowData::operator==):
+        * rendering/style/ShadowData.h:
+        (WebCore::ShadowData::ShadowData):
+        (WebCore::ShadowData::~ShadowData):
+        (WebCore::ShadowData::x):
+        (WebCore::ShadowData::y):
+        (WebCore::ShadowData::blur):
+        (WebCore::ShadowData::spread):
+        (WebCore::ShadowData::style):
+        (WebCore::ShadowData::color):
+        (WebCore::ShadowData::next):
+        (WebCore::ShadowData::setNext):
+
+2010-04-12  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37463, clean up NinePieceImage.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForNinePieceImage):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::mapNinePieceImage):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintNinePieceImage):
+        * rendering/style/NinePieceImage.h:
+        (WebCore::NinePieceImage::setImage):
+        (WebCore::NinePieceImage::slices):
+        (WebCore::NinePieceImage::setSlices):
+        (WebCore::NinePieceImage::setHorizontalRule):
+        (WebCore::NinePieceImage::verticalRule):
+        (WebCore::NinePieceImage::setVerticalRule):
+
+2010-04-12  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37455, :visited doesn't work with multiple classes/ids.
+
+        Added fast/history/multiple-classes-visited.html.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
+
+2010-04-12  Dirk Schulze  <krit@webkit.org>
+
+        Unreviewed build fix.
+
+        Make comma/whitespace around arc flags optional in SVG path syntax
+        https://bugs.webkit.org/show_bug.cgi?id=37431
+
+        Fix the SL build.
+
+        * svg/SVGParserUtilities.cpp:
+        (WebCore::parseArcFlag):
+
+2010-04-12  Jeff Schiller  <codedread@gmail.com>
+
+        Reviewed by Dirk Schulze.
+
+        Make comma/whitespace around arc flags optional in SVG path syntax and ensure flags are
+        either 0 or 1: https://bugs.webkit.org/show_bug.cgi?id=37431
+
+        * svg/SVGParserUtilities.cpp:
+        (WebCore::parseArcFlag): function to read in a 0 or 1 for largeArcFlag and sweepFlag
+        (WebCore::SVGPathParser::parseSVG): modify/simplify arc parsing by using parseArcFlag()
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * dom/Document.cpp:
+        (WebCore::Document::close):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::scriptCharset):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::requestPreload):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        * loader/DocumentWriter.cpp: Removed.
+        * loader/DocumentWriter.h: Removed.
+        * loader/FrameLoader.cpp:
+        (WebCore::canReferToParentFrameEncoding):
+        (WebCore::FrameLoader::FrameLoader):
+        (WebCore::FrameLoader::init):
+        (WebCore::FrameLoader::replaceDocument):
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::responseMIMEType):
+        (WebCore::FrameLoader::setResponseMIMEType):
+        (WebCore::FrameLoader::begin):
+        (WebCore::FrameLoader::write):
+        (WebCore::FrameLoader::end):
+        (WebCore::FrameLoader::endIfNotLoadingMainResource):
+        (WebCore::FrameLoader::encoding):
+        (WebCore::FrameLoader::setEncoding):
+        (WebCore::FrameLoader::addData):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::finishedLoadingDocument):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        * loader/FrameLoader.h:
+        * loader/MediaDocument.cpp:
+        (WebCore::MediaDocument::replaceMediaElementTimerFired):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::createDocumentStructure):
+        * platform/network/FormDataBuilder.cpp:
+        (WebCore::FormDataBuilder::dataEncoding):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        This patch separates the begin/write/end cycle of decoding network
+        bytes and putting them into a document from the rest of the loading
+        machinery.  The code and state required to write bytes into a document
+        doesn't interact very much with the rest of the loading machinery.
+
+        No tests because there is no behavior change (hopefully!).
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * dom/Document.cpp:
+        (WebCore::Document::close):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::scriptCharset):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::requestPreload):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        * loader/DocumentWriter.cpp: Added.
+        * loader/DocumentWriter.h: Added.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::FrameLoader):
+        (WebCore::FrameLoader::init):
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::setURL):
+        (WebCore::FrameLoader::didBeginDocument):
+        (WebCore::FrameLoader::didEndDocument):
+        (WebCore::FrameLoader::willSetEncoding):
+        (WebCore::FrameLoader::addData):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::finishedLoadingDocument):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::writer):
+        (WebCore::FrameLoader::isDisplayingInitialEmptyDocument):
+        * loader/MediaDocument.cpp:
+        (WebCore::MediaDocument::replaceMediaElementTimerFired):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::createDocumentStructure):
+        * platform/network/FormDataBuilder.cpp:
+        (WebCore::FormDataBuilder::dataEncoding):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
+2010-04-07  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] implement getData('text/html') for paste and drop events
+        https://bugs.webkit.org/show_bug.cgi?id=37193
+
+        Tests: editing/pasteboard/onpaste-text-html.html
+               fast/events/ondrop-text-html.html
+
+        * platform/chromium/ClipboardChromium.cpp:
+        (WebCore::):
+        (WebCore::clipboardTypeFromMIMEType): add html type
+        (WebCore::ClipboardChromium::clearData): implement clear text/html
+        (WebCore::ClipboardChromium::getData): implement get text/html (similar to text/plain)
+        (WebCore::ClipboardChromium::setData): implement set text/html
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Rename m_forceSandboxFlags to m_forcedSandoxFlags, as
+        requested by Darin Adler.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::FrameLoader):
+        (WebCore::FrameLoader::updateSandboxFlags):
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::setForcedSandboxFlags):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
+2010-04-10  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/7845305> Further adoption of formal protocols for delegates.
+
+        Move EmptyProtocolDefinitions.h down in to WebCore, and add the new protocols. Adopt the protocols in the appropriate places.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mac/EmptyProtocolDefinitions.h: Renamed from WebKit/mac/Misc/EmptyProtocolDefinitions.h.
+        * platform/network/mac/ResourceHandleMac.mm:
+
+2010-04-10  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Defense in depth: make sure an SVG document in the <img> context has
+        a unique origin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37392
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+          Force the temporary rendering context into a unique origin.
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::setForceSandboxFlags):
+          Support for setting sandbox flags that will always be applied.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::updateSandboxFlags):
+          Always apply any forced flags.
+
+2010-04-10  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Moving files associated with the GPU compositor from platform/graphics/skia to platform/graphics/chromium. Class
+        rename was done in a previous CL, this CL does the file move and rename.
+        https://bugs.webkit.org/show_bug.cgi?id=37231
+
+        No new functionality, no new tests.
+
+        * WebCore.gypi:
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp: Copied from WebCore/platform/graphics/skia/GraphicsLayerSkia.cpp.
+        * platform/graphics/chromium/GraphicsLayerChromium.h: Copied from WebCore/platform/graphics/skia/GraphicsLayerSkia.h.
+        * platform/graphics/chromium/LayerChromium.cpp: Copied from WebCore/platform/graphics/skia/LayerSkia.cpp.
+        * platform/graphics/chromium/LayerChromium.h: Copied from WebCore/platform/graphics/skia/LayerSkia.h.
+        * platform/graphics/chromium/LayerRendererChromium.cpp: Copied from WebCore/platform/graphics/skia/LayerRendererSkia.cpp.
+        * platform/graphics/chromium/LayerRendererChromium.h: Copied from WebCore/platform/graphics/skia/LayerRendererSkia.h.
+        * platform/graphics/skia/GraphicsLayerSkia.cpp: Removed.
+        * platform/graphics/skia/GraphicsLayerSkia.h: Removed.
+        * platform/graphics/skia/LayerRendererSkia.cpp: Removed.
+        * platform/graphics/skia/LayerRendererSkia.h: Removed.
+        * platform/graphics/skia/LayerSkia.cpp: Removed.
+        * platform/graphics/skia/LayerSkia.h: Removed.
+
+2010-04-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Refactor Qt DRT support in QtWebKit
+
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * WebCore.pro: Add DumpRenderTreeSupportQt.cpp
+
+2010-04-10  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Missing CONTEXT_MENUS Guards
+        https://bugs.webkit.org/show_bug.cgi?id=37398
+
+        Added missing ENABLE(CONTEXT_MENUS) guards.
+
+        * bindings/js/JSInspectorFrontendHostCustom.cpp:
+        (WebCore::JSInspectorFrontendHost::showContextMenu):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::InspectorFrontendHost):
+        (WebCore::InspectorFrontendHost::disconnectClient):
+        * inspector/InspectorFrontendHost.h:
+
+2010-04-10  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Fix crash in Gradient::fill()
+        https://bugs.webkit.org/show_bug.cgi?id=37386
+
+        Covered by existing tests.
+
+        * platform/graphics/haiku/GradientHaiku.cpp:
+        (WebCore::Gradient::fill):
+            - Make sure the platform gradient is already cached before
+              dereferencing its pointer.
+
+2010-04-10  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Fix build of ImageHaiku.cpp
+        <https://bugs.webkit.org/show_bug.cgi?id=37384>
+
+        No new tests needed.
+
+        * platform/graphics/haiku/ImageHaiku.cpp:
+        (WebCore::Image::drawPattern):
+            - include SharedBuffer.h
+            - changed parameter name to be in line with other ports,
+              the code I landed in an earlier commit was already using
+              this name.
+
+2010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement Desktop Notifications API for QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35503
+
+        No new tests enabled as notification DRT tests are
+        disabled at the moment.
+
+        * WebCore.pri: Add files to the build system and turn
+        on the feature by default.
+
+        * WebCore.pro: Add files to the build system
+
+        * bindings/js/JSDesktopNotificationsCustom.cpp:
+        (WebCore::JSNotificationCenter::requestPermission):
+        (WebCore::JSNotification::addEventListener):
+        (WebCore::JSNotification::removeEventListener):
+        Fix build regresssion.
+
+2010-04-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Joseph Pecoraro.
+
+        Web Inspector: Console with two recursive arrays causes infinite loop trying to display.
+        https://bugs.webkit.org/show_bug.cgi?id=37133
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._printArray):
+        (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-04-09  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        [wx] Basic implementation of SVG support for wx port.
+
+        * css/CSSFontFaceSource.cpp:
+        * platform/graphics/wx/FontPlatformData.h:
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::size):
+        * platform/graphics/wx/FontPlatformDataWx.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/wx/GraphicsContextWx.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        (WebCore::GraphicsContext::clipPath):
+        (WebCore::GraphicsContext::getCTM):
+        (WebCore::GraphicsContext::beginPath):
+        (WebCore::GraphicsContext::addPath):
+        (WebCore::GraphicsContext::concatCTM):
+        (WebCore::GraphicsContext::fillPath):
+        (WebCore::GraphicsContext::strokePath):
+        (WebCore::GraphicsContext::setLineDash):
+        * platform/graphics/wx/ImageBufferWx.cpp:
+        (WebCore::ImageBuffer::platformTransformColorSpace):
+        * platform/graphics/wx/PathWx.cpp:
+        (WebCore::Path::strokeContains):
+        (WebCore::Path::debugString):
+        (WebCore::Path::operator=):
+        (WebCore::Path::isEmpty):
+        * rendering/RenderSVGResourceMasker.cpp:
+        * wscript:
+
+2010-04-09  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        StorageEvent destructor should be in StorageEvent.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37356
+
+        Because Storage is forward-declared in StorageEvent.h, we need to define
+        the StorageEvent destructor in the .cpp file so that the RefPtr<Storage>
+        destructor has a complete type for Storage.
+
+        * storage/StorageEvent.cpp:
+        (WebCore::StorageEvent::~StorageEvent):
+        * storage/StorageEvent.h:
+
+2010-04-09  Young Han Lee  <joybro@company100.net>
+
+        Reviewed by Eric Seidel.
+
+        [WINCE] Add forwarding header for UnicodeWince.h
+        https://bugs.webkit.org/show_bug.cgi?id=37224
+
+        * ForwardingHeaders/wtf/unicode/wince/UnicodeWince.h: Added.
+
+2010-04-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam "R the K!" Weinig.
+
+        Tidied up some more DOMWrapperWorld lifetime issues.
+
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld): Notify the document that
+        we're going away instead of deleting its data, since deleting other
+        objects' data is error-prone and, more importantly, rude.
+
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::DOMWrapperWorld::didCreateWrapperCache):
+        (WebCore::DOMWrapperWorld::didDestroyWrapperCache): A few renames for
+        clarity.
+
+        * bindings/js/JSDOMBinding.cpp:
+        * bindings/js/JSDOMBinding.h: Converted forgetAllDOMNodesForDocument
+        to a Document member function, for the same reason.
+
+        * dom/Document.cpp: 
+        (WebCore::Document::~Document):
+        (WebCore::Document::createWrapperCache):
+        (WebCore::Document::destroyWrapperCache):
+        (WebCore::Document::destroyAllWrapperCaches):
+        * dom/Document.h: Added a destroyWrapperCache function to balance
+        createWrapperCache, so it's clear who allocates and deletes these wrapper
+        caches.
+
+2010-04-09  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed bug where animation time was not updated when dynamically loading a style sheet
+        https://bugs.webkit.org/show_bug.cgi?id=37352
+
+        A dynamically loaded style sheet kicks off its own styleRecalc cycle. This was not
+        bracketed with a beginAnimationUpdate/endAnimationUpdate which wasn't resetting the
+        animation time. In some time-dependent cases this was causing a negative elapsedTime
+        to be sent to the keyframe animator. This is an invalid case which destroys the
+        animation prematurely. I not only added the brackets, but I also added an assert
+        and protection for when the elapsedTime comes up negative.
+
+        Test: animations/dynamic-stylesheet-loading.html
+
+        * dom/Document.cpp: Added brackets
+        (WebCore::Document::updateStyleSelector):
+        * page/animation/KeyframeAnimation.cpp: Added assert and protection
+        (WebCore::KeyframeAnimation::getKeyframeAnimationInterval):
+
+2010-04-09  Jaime Yap  <jaimeyap@google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Fixes "wrong parent" for GCEvents that come at the end of a
+        timeline record node.
+        https://bugs.webkit.org/show_bug.cgi?id=37340
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didInstallTimer):
+        (WebCore::InspectorTimelineAgent::didRemoveTimer):
+        (WebCore::InspectorTimelineAgent::didMarkTimeline):
+        (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+        (WebCore::InspectorTimelineAgent::didMarkLoadEvent):
+        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+        (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+
+2010-04-09  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Prevent HTTP responses served with JSON content type from being rendered as HTML. 
+
+        Test: http/tests/security/xss-DENIED-mime-type-execute-as-html.html
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::isTextMIMEType): Render application/json as text/plain.
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedNonImageMimeTypes): Add a compile assert to prevent addition of new mime types in non-image types. 
+
+2010-04-09  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Prevent wrong use of PrintContext
+        https://bugs.webkit.org/show_bug.cgi?id=37194
+
+        No new tests because this doesn't change the behavior.
+
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::PrintContext):
+        (WebCore::PrintContext::~PrintContext):
+        (WebCore::PrintContext::begin):
+        (WebCore::PrintContext::end):
+        * page/PrintContext.h:
+
+2010-04-09  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [V8] SerializedScriptValue value doesn't follow the spec for DOM objects and files
+        https://bugs.webkit.org/show_bug.cgi?id=37094
+
+        This patch adds support for file-related types.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::):
+        (WebCore::Writer::writeString):
+        (WebCore::Writer::writeWebCoreString):
+        (WebCore::Writer::writeBlob):
+        (WebCore::Writer::writeFile):
+        (WebCore::Writer::writeFileList):
+        (WebCore::Writer::doWriteString):
+        (WebCore::Writer::doWriteWebCoreString):
+        (WebCore::Serializer::writeBlob):
+        (WebCore::Serializer::writeFile):
+        (WebCore::Serializer::writeFileList):
+        (WebCore::Serializer::doSerialize):
+        (WebCore::Reader::read):
+        (WebCore::Reader::readWebCoreString):
+        (WebCore::Reader::readBlob):
+        (WebCore::Reader::readFile):
+        (WebCore::Reader::readFileList):
+        (WebCore::SerializedScriptValue::SerializedScriptValue):
+
+2010-04-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Cameron Zwarich.
+        
+        Tidied up some DOMWrapperWorld lifetime issues.
+
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::DOMWrapperWorld): Made DOMWrapperWorld wholly
+        responsible for managing its presence in WebCoreJSClientData's world set.
+        This is simpler and more encapsulated than making its clients sometimes
+        responsible for managing that set and sometimes not.
+        
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::DOMWrapperWorld::create): Made isNormal default to false,
+        removing one of the reasons for the IsolatedWorld class to exist, so I
+        could remove that class.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonJSGlobalData): Used the work-around below.
+
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::createWorld): Nixed IsolatedWorld, which is
+        now superfluous.
+
+        * bindings/js/WebCoreJSClientData.h:
+        (WebCore::initNormalWorldClientData): Added a work-around for the fact
+        that WebCoreJSClientData must be set as globalData->clientData before
+        the DOMWrapperWorld constructor runs. This removed the other reason
+        for the IsolatedWorld class to exist, so I could remove that class.
+
+2010-04-09  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Testing utility for CodeGeneratorV8.pm
+        https://bugs.webkit.org/show_bug.cgi?id=37286
+
+        * bindings/v8/test: Added.
+        * bindings/v8/test/TestObj.idl: Contains basic IDL definitions for testing purposes.
+        * bindings/v8/test/V8TestObj.cpp: Expected output.
+        * bindings/v8/test/V8TestObj.h: Expected output.
+        * bindings/v8/test/run_tests.py: Tool for generating the above h/cpp files from the idl file.
+
+2010-04-09  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37370
+        Division by 0 in RenderBoxModelObject::calculateFillTileSize
+
+        Test: fast/backgrounds/background-fill-zero-area-crash.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateFillTileSize): Added checks for
+        zero before doing division. These come up when the area to fill is zero.
+
+2010-04-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24572
+        XMLHttpRequest.statusText returns always "OK" on Mac
+
+        Covered by existing tests, which now pass.
+
+        * WebCore.base.exp:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        Added a WebKitSystemInterface method to fetch status line.
+
+        * platform/network/HTTPParsers.cpp: (WebCore::extractReasonPhraseFromHTTPStatusLine):
+        * platform/network/HTTPParsers.h:
+        * platform/network/cf/ResourceResponseCFNet.cpp: (WebCore::ResourceResponse::platformLazyInit):
+        Moved code for parsing status line to HTTPHeaders, as it's used for both Mac and CF now.
+
+        * platform/network/mac/ResourceResponseMac.mm: (WebCore::ResourceResponse::platformLazyInit):
+        Use the actual reason phrase when available, and "OK" otherwise. Synthesizing a reson when
+        there isn't one is misleading, so we'll stick to our old broken behavior on Tiger, rather than
+        introduce a new broken one.
+
+2010-04-09  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37361, clean up FillLayer.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * rendering/style/FillLayer.h:
+        (WebCore::FillLayer::sizeType):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::backgroundImage):
+        (WebCore::InheritedFlags::backgroundRepeatX):
+        (WebCore::InheritedFlags::backgroundRepeatY):
+        (WebCore::InheritedFlags::backgroundComposite):
+        (WebCore::InheritedFlags::backgroundAttachment):
+        (WebCore::InheritedFlags::backgroundClip):
+        (WebCore::InheritedFlags::backgroundOrigin):
+        (WebCore::InheritedFlags::backgroundXPosition):
+        (WebCore::InheritedFlags::backgroundYPosition):
+        (WebCore::InheritedFlags::backgroundSizeType):
+        (WebCore::InheritedFlags::backgroundSizeLength):
+        (WebCore::InheritedFlags::maskImage):
+        (WebCore::InheritedFlags::maskRepeatX):
+        (WebCore::InheritedFlags::maskRepeatY):
+        (WebCore::InheritedFlags::maskComposite):
+        (WebCore::InheritedFlags::maskAttachment):
+        (WebCore::InheritedFlags::maskClip):
+        (WebCore::InheritedFlags::maskOrigin):
+        (WebCore::InheritedFlags::maskXPosition):
+        (WebCore::InheritedFlags::maskYPosition):
+        (WebCore::InheritedFlags::maskSizeType):
+        (WebCore::InheritedFlags::maskSizeLength):
+
+2010-04-09  Sam Weinig  <sam@webkit.org>
+
+        Add another missing export to fix the build.
+
+        * WebCore.base.exp:
+
+2010-04-09  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Adam Roben.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37353, clean up cursors used by RenderStyles.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::selectCursor):
+        * rendering/style/CursorData.h:
+        (WebCore::CursorData::CursorData):
+        (WebCore::CursorData::operator==):
+        (WebCore::CursorData::image):
+        (WebCore::CursorData::hotSpot):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::addCursor):
+
+2010-04-09  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Adam Roben.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=37349, RenderStyle cleanup.  Working from the outside in to
+        bring some style consistency to RenderStyle and its associated classes.  This patch cleans up the
+        border and outline classes.
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::calcBorderLeft):
+        (WebCore::RenderTable::calcBorderRight):
+        (WebCore::RenderTable::outerBorderTop):
+        (WebCore::RenderTable::outerBorderBottom):
+        (WebCore::RenderTable::outerBorderLeft):
+        (WebCore::RenderTable::outerBorderRight):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::compareBorders):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::calcOuterBorderTop):
+        (WebCore::RenderTableSection::calcOuterBorderBottom):
+        (WebCore::RenderTableSection::calcOuterBorderLeft):
+        (WebCore::RenderTableSection::calcOuterBorderRight):
+        * rendering/style/BorderData.h:
+        (WebCore::BorderData::hasBorder):
+        (WebCore::BorderData::hasBorderRadius):
+        (WebCore::BorderData::borderLeftWidth):
+        (WebCore::BorderData::borderRightWidth):
+        (WebCore::BorderData::borderTopWidth):
+        (WebCore::BorderData::borderBottomWidth):
+        (WebCore::BorderData::operator==):
+        (WebCore::BorderData::left):
+        (WebCore::BorderData::right):
+        (WebCore::BorderData::top):
+        (WebCore::BorderData::bottom):
+        (WebCore::BorderData::image):
+        (WebCore::BorderData::topLeft):
+        (WebCore::BorderData::topRight):
+        (WebCore::BorderData::bottomLeft):
+        (WebCore::BorderData::bottomRight):
+        * rendering/style/BorderValue.h:
+        (WebCore::BorderValue::BorderValue):
+        (WebCore::BorderValue::nonZero):
+        (WebCore::BorderValue::isTransparent):
+        (WebCore::BorderValue::operator==):
+        (WebCore::BorderValue::color):
+        (WebCore::BorderValue::width):
+        (WebCore::BorderValue::style):
+        * rendering/style/CollapsedBorderValue.h:
+        (WebCore::CollapsedBorderValue::CollapsedBorderValue):
+        (WebCore::CollapsedBorderValue::width):
+        (WebCore::CollapsedBorderValue::style):
+        (WebCore::CollapsedBorderValue::exists):
+        (WebCore::CollapsedBorderValue::color):
+        (WebCore::CollapsedBorderValue::isTransparent):
+        (WebCore::CollapsedBorderValue::precedence):
+        (WebCore::CollapsedBorderValue::operator==):
+        * rendering/style/OutlineValue.h:
+        (WebCore::OutlineValue::OutlineValue):
+        (WebCore::OutlineValue::operator==):
+        (WebCore::OutlineValue::offset):
+        (WebCore::OutlineValue::isAuto):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::getBorderRadiiForRect):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::borderLeft):
+        (WebCore::InheritedFlags::borderRight):
+        (WebCore::InheritedFlags::borderTop):
+        (WebCore::InheritedFlags::borderBottom):
+        (WebCore::InheritedFlags::borderImage):
+        (WebCore::InheritedFlags::borderTopLeftRadius):
+        (WebCore::InheritedFlags::borderTopRightRadius):
+        (WebCore::InheritedFlags::borderBottomLeftRadius):
+        (WebCore::InheritedFlags::borderBottomRightRadius):
+        (WebCore::InheritedFlags::borderLeftStyle):
+        (WebCore::InheritedFlags::borderLeftColor):
+        (WebCore::InheritedFlags::borderLeftIsTransparent):
+        (WebCore::InheritedFlags::borderRightStyle):
+        (WebCore::InheritedFlags::borderRightColor):
+        (WebCore::InheritedFlags::borderRightIsTransparent):
+        (WebCore::InheritedFlags::borderTopStyle):
+        (WebCore::InheritedFlags::borderTopColor):
+        (WebCore::InheritedFlags::borderTopIsTransparent):
+        (WebCore::InheritedFlags::borderBottomStyle):
+        (WebCore::InheritedFlags::borderBottomColor):
+        (WebCore::InheritedFlags::borderBottomIsTransparent):
+        (WebCore::InheritedFlags::outlineWidth):
+        (WebCore::InheritedFlags::outlineStyleIsAuto):
+        (WebCore::InheritedFlags::outlineColor):
+        (WebCore::InheritedFlags::outlineOffset):
+        (WebCore::InheritedFlags::columnRuleColor):
+        (WebCore::InheritedFlags::resetBorderTop):
+        (WebCore::InheritedFlags::resetBorderRight):
+        (WebCore::InheritedFlags::resetBorderBottom):
+        (WebCore::InheritedFlags::resetBorderLeft):
+        (WebCore::InheritedFlags::resetBorderImage):
+        (WebCore::InheritedFlags::resetBorderTopLeftRadius):
+        (WebCore::InheritedFlags::resetBorderTopRightRadius):
+        (WebCore::InheritedFlags::resetBorderBottomLeftRadius):
+        (WebCore::InheritedFlags::resetBorderBottomRightRadius):
+        (WebCore::InheritedFlags::setBorderImage):
+        (WebCore::InheritedFlags::setBorderTopLeftRadius):
+        (WebCore::InheritedFlags::setBorderTopRightRadius):
+        (WebCore::InheritedFlags::setBorderBottomLeftRadius):
+        (WebCore::InheritedFlags::setBorderBottomRightRadius):
+        (WebCore::InheritedFlags::setBorderLeftWidth):
+        (WebCore::InheritedFlags::setBorderLeftStyle):
+        (WebCore::InheritedFlags::setBorderLeftColor):
+        (WebCore::InheritedFlags::setBorderRightWidth):
+        (WebCore::InheritedFlags::setBorderRightStyle):
+        (WebCore::InheritedFlags::setBorderRightColor):
+        (WebCore::InheritedFlags::setBorderTopWidth):
+        (WebCore::InheritedFlags::setBorderTopStyle):
+        (WebCore::InheritedFlags::setBorderTopColor):
+        (WebCore::InheritedFlags::setBorderBottomWidth):
+        (WebCore::InheritedFlags::setBorderBottomStyle):
+        (WebCore::InheritedFlags::setBorderBottomColor):
+        (WebCore::InheritedFlags::setOutlineWidth):
+        (WebCore::InheritedFlags::setOutlineStyle):
+        (WebCore::InheritedFlags::setOutlineColor):
+        (WebCore::InheritedFlags::setOutlineOffset):
+        (WebCore::InheritedFlags::setColumnRuleColor):
+        (WebCore::InheritedFlags::setColumnRuleWidth):
+        * rendering/style/StyleMultiColData.h:
+        (WebCore::StyleMultiColData::ruleWidth):
+
+2010-04-09  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fixed ResourceError::failingURL() and ResourceResponse::httpStatusText()
+        to return meaningful values.
+        https://bugs.webkit.org/show_bug.cgi?id=37274
+
+        * platform/network/mac/ResourceErrorMac.mm:
+        (WebCore::ResourceError::platformLazyInit):
+        * platform/network/mac/ResourceResponseMac.mm:
+        (WebCore::ResourceResponse::platformLazyInit):
+
+2010-04-09  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Move the IDB::open ExceptionCode paramter to be last
+        https://bugs.webkit.org/show_bug.cgi?id=37277
+
+        Move the ExceptionCode paramter to the last position in
+        IndexedDatabaseRequest::open and friends.  It should definitely
+        go after the callbacks to keep the parameters that come directly
+        from javascript together.  And having output parameters appear
+        last is done often in the code base, so it makes sense to push
+        it past the Frame* param as well.
+
+        No functional change.
+
+        * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
+        (WebCore::V8IndexedDatabaseRequest::openCallback):
+        * storage/IndexedDatabase.h:
+        * storage/IndexedDatabaseImpl.cpp:
+        (WebCore::IndexedDatabaseImpl::open):
+        * storage/IndexedDatabaseImpl.h:
+        * storage/IndexedDatabaseRequest.cpp:
+        (WebCore::IndexedDatabaseRequest::open):
+        * storage/IndexedDatabaseRequest.h:
+
+2010-04-09  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        WebCore: WorkerGlobalScope.close() should let the currently running script complete execution, then terminate the worker.
+        https://bugs.webkit.org/show_bug.cgi?id=37053
+
+        Test: fast/workers/worker-close-more.html
+
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::forbidExecution):
+        (WebCore::WorkerScriptController::):
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::forbidExecution):
+        * bindings/v8/WorkerScriptController.h:
+        (WebCore::WorkerScriptController::):
+        Added option parameter to forbidExecution (both JCS and V8 versions) that specifies whether currently running
+        script should be immediately terminated or left executed until the end.
+
+        * bindings/js/WorkerScriptController.h:
+        (WebCore::WorkerScriptController::workerContextWrapper):
+        This method now can return 0 instead of context if the further execution of JS is forbidden. Since any JS execution requires
+        fetching JS global object first, returning 0 here is a good way to prevent re-entry into JS once worker started termination.
+        V8 version does similar thing already in WorkerScriptController::proxy().
+
+        * workers/DedicatedWorkerContext.cpp:
+        (WebCore::DedicatedWorkerContext::postMessage):
+        Removed check that immediately disables postMessage from WorkerContext after close().
+
+        * workers/WorkerContext.cpp:
+        (WebCore::CloseWorkerContextTask::create):
+        (WebCore::CloseWorkerContextTask::performTask):
+        (WebCore::CloseWorkerContextTask::isCleanupTask):
+        (WebCore::WorkerContext::close):
+        Use new forbidExecution(LetRunningScriptFinish) to avoid termination of script until it executes and exits.
+        Post a task to actually terminate the worker once the currently executing JS fragment exits.
+
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::workerThread):
+        (WebCore::WorkerThread::stop):
+        Use new forbidExecution(TerminateRunningScript) to immediately terminate the JS.
+
+2010-04-09  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Implement interactive validation for forms.
+        https://bugs.webkit.org/show_bug.cgi?id=34930
+
+        - HTMLFormControlElement::checkValidity() supports unhandled invalid control list
+        - HTMLFormElement::validateInteractively() called from prepareSubmit()
+          prevents the submission if neither noValidate nor formNoValidate is
+          specified, and focuses on the first invalid control of which "invalid"
+          event is not canceled.
+
+        Tests: fast/forms/checkValidity-cancel.html
+               fast/forms/interactive-validation-cancel.html
+               fast/forms/interactive-validation-formnovalidate.html
+               fast/forms/interactive-validation-novalidate.html
+               fast/forms/interactive-validation-prevented.html
+               fast/forms/interactive-validation-remove-node-in-handler.html
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::checkValidity):
+          If the control is invalid and the "invalid" is not canceled,
+          push the control to the specified vector.
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::validateInteractively):
+         The main part of the interactive validation.
+        (WebCore::HTMLFormElement::prepareSubmit):
+         Calls validateInteractively().
+        (WebCore::HTMLFormElement::checkValidity):
+         Uses collectUnhandledInvalidControls().
+        (WebCore::HTMLFormElement::collectUnhandledInvalidControls):
+        * html/HTMLFormElement.h:
+
+2010-04-09  Sam Weinig  <sam@webkit.org>
+
+        Fix the mac WebKit2 build.
+
+        * WebCore.base.exp:
+
+2010-04-08  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37181
+        <rdar://problem/7835374> REGRESSION (r54400): Hangs when doing AJAX update with large amount of data
+
+        Test: fast/events/gc-freeze-with-attribute-listeners.html
+
+        The problem was that we were creating JS wrappers for nodes with attribute event listeners,
+        and GC is very slow if there are nodes with wrappers in a detached tree whose root does not
+        have a wrapper.
+
+        * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Don't create
+        wrappers for attribute event listeners - if there is a node, JSLazyEventListener::initializeJSFunction()
+        will create one.
+
+        * bindings/js/JSNodeCustom.cpp: (WebCore::JSNode::markChildren): Added a FIXME about the problem
+        we are stepping around now.
+
+2010-04-09  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        WebGtk GLib-CRITICAL Segmentation fault
+        https://bugs.webkit.org/show_bug.cgi?id=34937
+
+        Do not crash if a plugin does not return anything in
+        NP_GetMIMEDescription. This can happen, and other ports gracefully
+        handle the situation.
+
+        * plugins/gtk/PluginPackageGtk.cpp:
+        (WebCore::PluginPackage::fetchInfo):
+
+2010-04-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Cannot select elements within iframes with the magnifying glass.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31732
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::inspect):
+        (WebCore::InspectorController::handleMousePress):
+        * inspector/InspectorController.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+
+2010-04-09  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt]Fix compile error with QT_NO_PROPERTIES
+        https://bugs.webkit.org/show_bug.cgi?id=36526
+
+        Disable dynamic properties when QT_NO_PROPERTIES is defined.
+
+        * bridge/qt/qt_class.cpp:
+        (JSC::Bindings::QtClass::fieldNamed):
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtInstance::getPropertyNames):
+        (JSC::Bindings::QtField::name):
+        (JSC::Bindings::QtField::valueFromInstance):
+        (JSC::Bindings::QtField::setValueToInstance):
+        * bridge/qt/qt_runtime.h:
+        (JSC::Bindings::QtField::):
+
+2010-04-09  David Leong  <david.leong@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Symbian apps crash on exit due to a bad qObject_cast.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37303
+
+        Added check for NULL to avoid the crash.
+
+        * plugins/symbian/PluginViewSymbian.cpp:
+        (WebCore::PluginView::platformDestroy):
+
+2010-04-09  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        <http://webkit.org/b/37326> IDL files are being copied in to the WebCore framework again
+
+        * WebCore.xcodeproj/project.pbxproj: Wire up the script.  Remove the three inappropriate
+        files from the Copy Bundle Resources build phase.
+
+2010-04-09  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Passing null WebGLObjects should synthesize INVALID_VALUE error
+        https://bugs.webkit.org/show_bug.cgi?id=37047
+
+        * html/canvas/WebGLRenderingContext.cpp: Synthesize INVALID_VALUE error when input object is 0.
+        (WebCore::WebGLRenderingContext::bindAttribLocation):
+        (WebCore::WebGLRenderingContext::compileShader):
+        (WebCore::WebGLRenderingContext::detachShader):
+        (WebCore::WebGLRenderingContext::validateWebGLObject):
+        (WebCore::WebGLRenderingContext::getActiveAttrib):
+        (WebCore::WebGLRenderingContext::getActiveUniform):
+        (WebCore::WebGLRenderingContext::getProgramParameter):
+        (WebCore::WebGLRenderingContext::getProgramInfoLog):
+        (WebCore::WebGLRenderingContext::getShaderParameter):
+        (WebCore::WebGLRenderingContext::getShaderInfoLog):
+        (WebCore::WebGLRenderingContext::getShaderSource):
+        (WebCore::WebGLRenderingContext::getUniform):
+        (WebCore::WebGLRenderingContext::getUniformLocation):
+        (WebCore::WebGLRenderingContext::linkProgram):
+        (WebCore::WebGLRenderingContext::shaderSource):
+        * html/canvas/WebGLRenderingContext.h: Add helper function to validate webgl object input parameters.
+
+2010-04-09  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
+        https://bugs.webkit.org/show_bug.cgi?id=37174
+
+        Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
+
+        * platform/graphics/mac/GraphicsContext3DMac.cpp: resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D.
+        (WebCore::GraphicsContext3D::copyTexImage2D):
+        (WebCore::GraphicsContext3D::copyTexSubImage2D):
+
+2010-04-09  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] <select> dropdowns don't die when an item is selected
+        https://bugs.webkit.org/show_bug.cgi?id=37243
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::hidePopup):
+        (WebCore::PopupContainer::notifyPopupHidden):
+        (WebCore::PopupListBox::hidePopup): inform container that popup is closing
+        * platform/chromium/PopupMenuChromium.h:
+
+2010-04-09  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix crashes with package builds in release
+
+        * WebCore.pro: Don't add NDEBUG to the defines here, add it from JavaScriptCore.pri
+
+2010-04-09  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Remove "all" value from the view-mode media feature (as agreed on
+        1-Apr-2010) in the Widgets voice conf.
+
+        * css/CSSValueKeywords.in:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::view_modeMediaFeatureEval):
+
+2010-04-09  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57286.
+        http://trac.webkit.org/changeset/57286
+        https://bugs.webkit.org/show_bug.cgi?id=37312
+
+        "Caused intermittent test failures on all Mac bots."
+        (Requested by eseidel on #webkit).
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::originQuotaManagerNoLock):
+        (WebCore::DatabaseTracker::originQuotaManager):
+        (WebCore::DatabaseTracker::DatabaseTracker):
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::hasEntryForOrigin):
+        (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
+        (WebCore::DatabaseTracker::fullPathForDatabase):
+        (WebCore::DatabaseTracker::populateOrigins):
+        (WebCore::DatabaseTracker::origins):
+        (WebCore::DatabaseTracker::databaseNamesForOrigin):
+        (WebCore::DatabaseTracker::addOpenDatabase):
+        (WebCore::DatabaseTracker::removeOpenDatabase):
+        (WebCore::DatabaseTracker::usageForOriginNoLock):
+        (WebCore::DatabaseTracker::usageForOrigin):
+        (WebCore::DatabaseTracker::quotaForOrigin):
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        * storage/DatabaseTracker.h:
+        * storage/SQLTransactionClient.cpp:
+        (WebCore::SQLTransactionClient::didExecuteStatement):
+
+2010-04-09  Andras Becsi  <abecsi@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] User agent style sheets are crippled by moc -E in make-css-file-arrays.pl
+        https://bugs.webkit.org/show_bug.cgi?id=37296
+
+        Do not use moc to preprocess user agent style sheets because it removes at-symbols
+        and hexadecimal colours from declarations.
+        Remove unneeded preprocessor usage from make-css-file-arrays.pl since the script
+        processes default css files using regular expressions therefore preprocessing is redundant.
+
+        * WebCore.pri: remove --preprocessor usage
+        * css/make-css-file-arrays.pl: remove gcc dependency
+
+2010-04-08  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Sam Weinig.
+
+        Use the new UserGestureIndictor for _blank POST requests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34541
+
+        Test: fast/events/popup-blocked-to-post-blank.html
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::processingUserGesture):
+          Use UserGestureIndicator in more cases.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler):
+          Impact from UserGestureIndicator API change.
+        (WebCore::FrameLoader::submitForm):
+          Block the load immediately if popups are not allowed and it would
+          open a new window.
+        * loader/RedirectScheduler.cpp:
+        (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
+          Note the UserGestureIndicator status at the time of submission.
+        (WebCore::ScheduledFormSubmission::fire):
+          Use the stored UserGestureIndicator status in the asynchronous
+          callback.
+        * dom/UserGestureIndicator.h:
+        * dom/UserGestureIndicator.cpp:
+        (WebCore::UserGestureIndicator::UserGestureIndicator):
+          Add ability to store a negative indication.
+
+2010-03-29  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial Navigation: proper handle negative x or y coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=36773
+
+        In Spatial Navigation logic, during rect acquisition in renderRectRelativeToRootDocument,
+        sometimes negative x() or y() values are got, and the current algorithm bails out in
+        any of such cases.
+
+        However, when a node is in a scrollable content (content overflow <div>) and
+        this scrollable container scrolled up, element gets offscreen, and gets negative values
+        for y(), for example. In such cases, they are still valid to be used in Spatial Navigation
+        logic.
+
+        Test: fast/events/spatial-navigation/snav-offscreen-content.html
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::distanceDataForNode):
+        (WebCore::checkNegativeCoordsForNode):
+
+2010-04-08  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Create the creation callback is the current world.
+        https://bugs.webkit.org/show_bug.cgi?id=37290
+
+        * bindings/js/JSDatabaseCallback.cpp:
+        (WebCore::JSDatabaseCallback::JSDatabaseCallback):
+
+2010-04-08  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Followup optimization to bug 24300, don't leak history info via CSS :visited.  If a Web
+        site uses document colors that are the same for link and vlink in HTML and also doesn't
+        specify any :link or :visited rules, then don't waste time resolving visited styles.
+
+        There is a further optimization that could be done to detect when :link and :visited are
+        used together in the same rule to specify a color, and this is how most sites turn off
+        visited link colors, but this fix doesn't address that.  It just restores the optimization
+        that existed prior to the patch in 24300 landing.
+
+        * css/CSSGrammar.y:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::styleForElement):
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        * dom/Document.h:
+        (WebCore::Document::usesLinkRules):
+        (WebCore::Document::setUsesLinkRules):
+
+2010-04-08  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Caught by pixel tests.  I missed patching the borderRightColor() call for fieldset border painting so the
+        border stopped showing up.
+        
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintBorderMinusLegend):
+
+2010-04-07  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24300, don't leak history info via CSS :visited.
+
+        This patch implements the policy described by David Baron here:
+        
+        http://dbaron.org/mozilla/visited-privacy
+        
+        Added new tests in fast/history.
+
+        * WebCore.base.exp:
+        Expose functions needed for the WebKit SPI used by layout tests.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isVisited):
+        Make sure accessibility objects still return visited information.
+        
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSComputedStyleDeclaration.h:
+        (WebCore::computedStyle):
+        Add a boolean to computed style declarations that - if set - causes the computed style
+        to still return :visited information.  For normal Web pages, this will be false.  It is set
+        to true for the Web Inspector and by the WebKit SPI used by the layout tests.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::initElement):
+        (WebCore::CSSStyleSelector::SelectorChecker::SelectorChecker):
+        (WebCore::CSSStyleSelector::SelectorChecker::determineLinkState):
+        (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
+        (WebCore::CSSStyleSelector::canShareStyleWithElement):
+        (WebCore::CSSStyleSelector::styleForElement):
+        (WebCore::CSSStyleSelector::keyframeStylesForAnimation):
+        (WebCore::CSSStyleSelector::pseudoStyleForElement):
+        (WebCore::CSSStyleSelector::pseudoStyleRulesForElement):
+        (WebCore::CSSStyleSelector::checkSelector):
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+        (WebCore::CSSStyleSelector::applyPropertyToStyle):
+        (WebCore::CSSStyleSelector::getColorFromPrimitiveValue):
+        * css/CSSStyleSelector.h:
+        Rework the style selector to resolve two styles instead of one.  The first forces the link to
+        be unvisited, and the second forces the link to be visited.  The real state of the link is 
+        cached on the principal (unvisited) style.  The visited style hangs off the principal style
+        as a pseudo style (VISITED_LINK).
+
+        * dom/Element.cpp:
+        (WebCore::Element::pseudoStyleCacheIsInvalid):
+        Make sure to deal with the VISITED_LINK pseudo to know when only :visited style info changed.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        Let the Web Inspector see :visited computed styles by default.
+        
+        * platform/LinkHash.cpp:
+        (WebCore::visitedURL):
+        Fix an issue where <a href=""> is not hashed properly to the document's base URI, so it wasn't
+        correctly reported as :visited.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintTextDecorations):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+        (WebCore::InlineTextBox::paintSelection):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintColumnRules):
+        (WebCore::RenderBlock::paintObject):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintBorderMinusLegend):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintFocusRings):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutline):
+        (WebCore::RenderInline::paintOutlineForLine):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::drawLineForBoxSide):
+        (WebCore::RenderObject::drawArcForBoxSide):
+        (WebCore::RenderObject::paintOutline):
+        (WebCore::decorationColor):
+        (WebCore::RenderObject::getTextDecorationColors):
+        * rendering/RenderObject.h:
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paint):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::collapsedLeftBorder):
+        (WebCore::RenderTableCell::collapsedRightBorder):
+        (WebCore::RenderTableCell::collapsedTopBorder):
+        (WebCore::RenderTableCell::collapsedBottomBorder):
+        (WebCore::RenderTableCell::paintCollapsedBorder):
+        * rendering/style/CollapsedBorderValue.h:
+        (WebCore::CollapsedBorderValue::CollapsedBorderValue):
+        (WebCore::CollapsedBorderValue::color):
+        (WebCore::CollapsedBorderValue::operator==):
+        Patch painting code to fetch visitedDependentColors from the RenderStyle.  Properties that
+        are honored include background-color, color, border colors, outline color, column rules,
+        and fill and stroke (both SVG and our custom versions).
+    
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::RenderStyle):
+        (WebCore::RenderStyle::diff):
+        (WebCore::borderStyleForColorProperty):
+        (WebCore::colorIncludingFallback):
+        (WebCore::RenderStyle::visitedDependentColor):
+        * rendering/style/RenderStyle.h:
+        (WebCore::):
+        (WebCore::InheritedFlags::NonInheritedFlags::operator==):
+        (WebCore::InheritedFlags::setBitDefaults):
+        (WebCore::InheritedFlags::insideLink):
+        (WebCore::InheritedFlags::isLink):
+        (WebCore::InheritedFlags::setInsideLink):
+        (WebCore::InheritedFlags::setIsLink):
+        * rendering/style/RenderStyleConstants.h:
+        Change how link information is stored.  The noninherited flags now have a bit set for if you're a link
+        or not.  The inherited flags now cache whether you're inside a visited or unvisited link (or no link at
+        all).
+
+        (WebCore::):
+        * svg/graphics/SVGPaintServer.cpp:
+        (WebCore::SVGPaintServer::fillPaintServer):
+        (WebCore::SVGPaintServer::strokePaintServer):
+        Patch SVG fill/stroke painting to honor :visited.
+
+2010-04-08  Benjamin Otte  <otte@gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Fix build with MathML enabled.
+
+        * GNUmakefile.am:
+
+2010-04-08  Daniel Bates  <dbates@rim.com>
+
+        No review, rolling out 56655.
+        http://trac.webkit.org/changeset/56655
+        https://bugs.webkit.org/show_bug.cgi?id=9268
+
+        Rolling out the change committed in change set 56655
+        because it caused a regression in some of the mozilla
+        and mozilla expected failure test cases, such as:
+        tables/mozilla/marvin/backgr_simple-table-row.html, and
+        tables/mozilla/marvin/backgr_simple-table-row-group.html.
+
+        We need to look into this issue some more.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderObject.h:
+        * rendering/RenderTableCell.cpp:
+        * rendering/RenderTableCell.h:
+
+2010-03-30  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Refactor DatabaseTracker, part 1: Remove the dependency on
+        OriginQuotaManager from DatabaseTracker.h.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31482
+
+        * storage/DatabaseTracker.cpp:
+        (originQuotaManager):
+        (WebCore::DatabaseTracker::DatabaseTracker):
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::hasEntryForOrigin):
+        (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+        (WebCore::DatabaseTracker::databaseChanged):
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
+        (WebCore::DatabaseTracker::fullPathForDatabase):
+        (WebCore::DatabaseTracker::populateOrigins):
+        (WebCore::DatabaseTracker::origins):
+        (WebCore::DatabaseTracker::databaseNamesForOrigin):
+        (WebCore::DatabaseTracker::removeOpenDatabase):
+        (WebCore::DatabaseTracker::usageForOriginNoLock):
+        (WebCore::DatabaseTracker::usageForOrigin):
+        (WebCore::DatabaseTracker::quotaForOrigin):
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        * storage/DatabaseTracker.h:
+        * storage/SQLTransactionClient.cpp:
+        (WebCore::SQLTransactionClient::didExecuteStatement):
+
+2010-04-08  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Simon Hausmann.
+
+        [WINCE] Replace max with std::max
+        https://bugs.webkit.org/show_bug.cgi?id=37201
+
+        std::max is preferred.
+
+        * platform/wince/FileSystemWince.cpp:
+        (WebCore::makeAllDirectories):
+        (WebCore::pathGetFileName):
+
+2010-04-08  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Laszlo Gombos.
+
+        [EFL] Move AccessibilityObjectEfl.cpp from page to accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=36405
+
+        * accessibility/efl/AccessibilityObjectEfl.cpp: Renamed from WebCore/page/efl/AccessibilityObjectEfl.cpp.
+        (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
+
+2010-04-08  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Render Load, DOM Content and MarkTimeline event dividers on Timeline panel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37267
+
+        * English.lproj/localizedStrings.js:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::mainResourceFiredDOMContentEvent):
+        (WebCore::InspectorController::mainResourceFiredLoadEvent):
+        * inspector/InspectorController.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+        (WebCore::InspectorTimelineAgent::didMarkLoadEvent):
+        * inspector/InspectorTimelineAgent.h:
+        (WebCore::):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.updateGraphDividersIfNeeded):
+        * inspector/front-end/TimelineAgent.js:
+        * inspector/front-end/TimelineGrid.js:
+        (WebInspector.TimelineGrid.prototype.removeEventDividers):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype.get _recordStyles):
+        (WebInspector.TimelinePanel.prototype._updateMarks):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._clearPanel):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelineCalculator.prototype.computeBarGraphWindowPosition):
+        (WebInspector.TimelineRecordGraphRow.prototype.update):
+        * inspector/front-end/inspector.css:
+        (.resources-event-divider):
+        (.resources-red-divider):
+        (.resources-blue-divider):
+        (.resources-orange-divider):
+
+2010-04-01  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by David Hyatt.
+
+        [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+        https://bugs.webkit.org/show_bug.cgi?id=29431
+
+        Test: fast/overflow/scrollbar-restored-and-then-locked.html
+
+        Patch introduces a lock scrollbars concept to ScrollView, as in WebDynamicScrollBarsView.mm/h
+        on WebKit/mac. It is needed because in QtWebKit, we have Api for setting both vertical and
+        horizontal scrollbars on/off/auto. When it is set to off, for example, it should remain
+        as such, unless unset.
+
+        For the locking concept, optional 'lock' parameters were added to setScrollbarModes,
+        setHorizontalScrollbarMode and setVerticalScrollbarMode methods of ScrollView. As these
+        are all optional, any previous code calling them do not need modification.
+
+        Two optional parameters were also added to Frame's createView method, for horizontal and vertical
+        lock state persistence cross page loads.
+
+        * page/Frame.cpp:
+        (WebCore::Frame::createView):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::ScrollView):
+        (WebCore::ScrollView::setScrollbarModes):
+        (WebCore::ScrollView::setHorizontalScrollbarMode):
+        (WebCore::ScrollView::setVerticalScrollbarMode):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::setHorizontalScrollbarLock):
+        (WebCore::ScrollView::isHorizontalScrollbarLocked):
+        (WebCore::ScrollView::setVerticalScrollbarLock):
+        (WebCore::ScrollView::isVerticalScrollbarLocked):
+        (WebCore::ScrollView::setScrollingModesLocked):
+
+2010-04-08  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Correctly save number of properties when object being serialized
+        have properties in its prorotype.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37263
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::ZigZag::Serializer::AbstractObjectState::AbstractObjectState):
+        (WebCore::ZigZag::Serializer::AbstractObjectState::advance):
+
+2010-04-08  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        IDB callbacks should fire asynchronously
+        https://bugs.webkit.org/show_bug.cgi?id=37265
+
+        Fix the firing behavior of the callbacks to not be synchronous.
+
+        There's still a major bug that I'm trying to track down that is keeping
+        us from testing this stuff.  Promise lots of tests ASAP.
+
+        * bindings/v8/custom/V8CustomIDBCallbacks.h:
+        (WebCore::V8CustomIDBCallbacks::onSuccessAsync):
+        (WebCore::V8CustomIDBCallbacks::onErrorAsync):
+        * storage/IDBCallbacks.h:
+        (WebCore::IDBCallbacks::IDBCallbacks):
+        (WebCore::IDBCallbacks::onSuccess):
+        (WebCore::IDBCallbacks::onError):
+        (WebCore::IDBCallbacks::timerFired):
+        * storage/IndexedDatabaseRequest.cpp:
+
+2010-04-08  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        willValidate doesn't need to check existence of a form element and a name attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=34733
+
+        Remove checks against m_form and m_hasName in
+        HTMLFormControlElement::willValidate(), and remove the code to
+        track their updates.
+
+        Test: fast/forms/willvalidate.html
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        (WebCore::HTMLFormControlElement::parseMappedAttribute):
+        (WebCore::HTMLFormControlElement::insertedIntoTree):
+        (WebCore::HTMLFormControlElement::removedFromTree):
+        (WebCore::HTMLFormControlElement::recalcWillValidate):
+        (WebCore::HTMLFormControlElement::willValidate):
+        (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
+        * html/HTMLFormControlElement.h:
+        (WebCore::HTMLFormControlElement::formDestroyed):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setInputType):
+          setNeedsWillValidateCheck() should be called before
+          setAttribute(valueAttr, ...) is called.
+
+2010-04-08  Young Han Lee  <joybro@company100.net>
+
+        Reviewed by Simon Hausmann.
+
+        [WINCE] Add missing headers
+        https://bugs.webkit.org/show_bug.cgi?id=37199
+
+        Include missing headers.
+
+        * platform/graphics/wince/FontCustomPlatformData.cpp:
+        * platform/graphics/wince/FontPlatformData.cpp:
+        * platform/graphics/wince/GraphicsContextWince.cpp:
+        * platform/graphics/wince/ImageBufferWince.cpp:
+        * platform/graphics/wince/PlatformPathWince.h:
+        * platform/wince/FileSystemWince.cpp:
+
+2010-04-08  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Simon Hausmann.
+
+        [WINCE] Use WebCore::instanceHandle()
+        https://bugs.webkit.org/show_bug.cgi?id=37202
+
+        Page::instanceHandle() is moved to WebCore::instanceHandle().
+
+        * platform/wince/PasteboardWince.cpp:
+        (WebCore::Pasteboard::Pasteboard):
+        * platform/wince/SharedTimerWince.cpp:
+        (WebCore::initializeOffScreenTimerWindow):
+
+2010-04-08  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Fix crash in NodeFilterCondition in detached iframe
+        https://bugs.webkit.org/show_bug.cgi?id=37234
+
+        Test: fast/dom/node-filter-detached-iframe-crash.html
+
+        * bindings/v8/V8NodeFilterCondition.cpp:
+        (WebCore::V8NodeFilterCondition::acceptNode): Switched to using
+        callFunctionWithoutFrame.
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::callFunctionWithoutFrame): Added a function to
+        call V8 with no current frame.
+        * bindings/v8/V8Proxy.h:
+
+2010-04-08  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Simon Hausmann.
+
+         [Qt] Remove shaderSource manipulation from GraphicsContext3DQt.cpp
+         https://bugs.webkit.org/show_bug.cgi?id=37226
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::shaderSource):
+
+2010-04-08  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Sanity: apply a max node depth to XML parsing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37247
+
+        Test: fast/images/svg-nested.html
+
+        * dom/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::pushCurrentNode):
+          Error out the parse upon a really large node depth.
+
+2010-04-07  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Fix Chromium's HTML5 DB support in --single-process mode.
+        https://bugs.webkit.org/show_bug.cgi?id=37186.
+
+        Always register and use Chromium's SQLite VFS for
+        WebSQLDatabases. Keep using the default VFS in all other
+        cases. This change should allow Chromium to support
+        WebSQLDatabases in --single-process mode.
+
+        Also, cleaning up a bit SQLiteFileSystemChromium and getting rid
+        of the SQLITE_OPEN_FULLMUTEX flag: we use sqlite DB handles only
+        on the DB thread, so we don't need multi-threaded support.
+
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::SQLiteDatabase::open):
+        * platform/sql/SQLiteDatabase.h:
+        * platform/sql/SQLiteFileSystem.cpp:
+        (WebCore::SQLiteFileSystem::openDatabase):
+        * platform/sql/SQLiteFileSystem.h:
+        * platform/sql/chromium/SQLiteFileSystemChromium.cpp:
+        (WebCore::SQLiteFileSystem::openDatabase):
+        * platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
+        (WebCore::SQLiteFileSystem::registerSQLiteVFS):
+        * platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:
+        (WebCore::SQLiteFileSystem::registerSQLiteVFS):
+        * storage/Database.cpp:
+        (WebCore::Database::performOpenAndVerify):
+
+2010-04-07  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Steve Falkenburg.
+
+        Remove QuartzCoreInterface from the build
+        
+        No longer needed since QuartzCore.dll is now included in  the latest Safari release (4.0.5).
+        This gets rid of all the function shims from the clients of QuartzCore.dll.
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:
+        (WebCore::GraphicsLayerCACF::updateLayerPreserves3D):
+        * platform/graphics/win/WKCACFLayer.cpp:
+        (WebCore::toCACFLayerType):
+        (WebCore::toCACFContentsGravityType):
+        (WebCore::fromCACFContentsGravityType):
+        (WebCore::toCACFFilterType):
+        (WebCore::fromCACFFilterType):
+        (WebCore::WKCACFLayer::isTransformLayer):
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFLayerRenderer::createRenderer):
+
+2010-04-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57178.
+        http://trac.webkit.org/changeset/57178
+        https://bugs.webkit.org/show_bug.cgi?id=37240
+
+        Caused chromium browser_test and ui_test regressions
+        (Requested by ojan on #webkit).
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::processingUserGesture):
+
+2010-04-07  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Adam Barth and Dmitry Titov.
+
+        Add the comment and assert that we're generating version 4 random number
+        based UUIDs.
+        https://bugs.webkit.org/show_bug.cgi?id=36472
+
+        * platform/UUID.cpp:
+        (WebCore::createCanonicalUUIDString):
+        * platform/UUID.h:
+
+2010-04-07  Erik Arvidsson  <arv@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Allow white listing access from origin to local origin.
+        https://bugs.webkit.org/show_bug.cgi?id=37228
+
+        This makes it possible to load a local resource from a non local
+        origin if the access has previously been white listed by calling
+        SecurityOrigin::whiteListAccessFromOrigin.
+
+        Test: http/tests/security/local-image-from-remote-whitelisted.html
+
+        * page/OriginAccessEntry.cpp:
+        (WebCore::OriginAccessEntry::OriginAccessEntry): Removed assert that only the http and https protocol are valid.
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::canRequest): Use isAccessWhiteListed
+        (WebCore::SecurityOrigin::isAccessWhiteListed): Extracted code that goes through the originAccessMap to do the origin matching.
+        (WebCore::SecurityOrigin::canLoad): Check if access has been white listed.
+        * page/SecurityOrigin.h: Add private function isAccessWhiteListed
+
+2010-04-07  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Darin Adler.
+
+        Adding static method zero() to classes IntPoint and FloatPoint.
+        https://bugs.webkit.org/show_bug.cgi?id=37220
+
+        Adding static method zero() to classes IntPoint and FloatPoint as suggested by Darin Adler.
+
+        * platform/graphics/FloatPoint.h:
+        (WebCore::FloatPoint::zero):
+        * platform/graphics/IntPoint.h:
+        (WebCore::IntPoint::zero):
+        (WebCore::IntPoint::clampNegativeToZero):
+
+2010-04-07  Alexey Proskuryakov  <ap@apple.com>
+
+        * platform/network/mac/AuthenticationMac.mm: Fix a typo in comment.
+
+2010-04-07  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37230
+        <rdar://problem/7813115> REGRESSION (4.0.5): Safari asks for credentials all the time when
+        authenticating to Windows IIS Server
+
+        * platform/network/ProtectionSpace.h: (WebCore::ProtectionSpaceAuthenticationScheme): Added
+        a constant for ProtectionSpaceAuthenticationSchemeUnknown.
+
+        * platform/network/cf/AuthenticationCF.cpp: (WebCore::core):
+        * platform/network/cf/SocketStreamHandleCFNet.cpp: (WebCore::authenticationSchemeFromAuthenticationMethod):
+        Return ProtectionSpaceAuthenticationSchemeUnknown for unknown scheme.
+
+        * platform/network/mac/AuthenticationMac.mm:
+        (WebCore::mac): Support NTLM on systems older than 10.6. We actually get this string from
+        NSURLConnection, even though there was no public constant.
+        (WebCore::core): Return ProtectionSpaceAuthenticationSchemeUnknown for unknown scheme.
+
+2010-04-07  Jaime Yap  <jaimeyap@google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Adds the ability to get the function symbol name when looking up the call location
+        for records sent by the InspectorTimelineAgent.
+        https://bugs.webkit.org/show_bug.cgi?id=36839
+
+        No new tests.
+
+        * bindings/js/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::callLocation):
+        * bindings/js/ScriptCallStack.h:
+        * bindings/v8/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::create):
+        (WebCore::ScriptCallStack::callLocation):
+        (WebCore::ScriptCallStack::ScriptCallStack):
+        * bindings/v8/ScriptCallStack.h:
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::createUtilityContext):
+        (WebCore::ScriptDebugServer::topStackFrame):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::utilityContext):
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+
+2010-04-07  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Jian Li.
+
+        [chromium] Fixing a NULL pointer being dereferenced in some cases.
+        https://bugs.webkit.org/show_bug.cgi?id=37141
+
+        Test: platform/chromium/fast/forms/search-popup-crasher.html
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupMenu::~PopupMenu):
+
+2010-04-07  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Jian Li.
+
+        Add skeleton FileStream module for providing sync file operations for FileAPI
+        https://bugs.webkit.org/show_bug.cgi?id=37217
+
+        For now the module just defines an interface and is almost empty.
+        Implementation will be added.
+
+        No new tests; will be added when we have complete implementation.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/FileStream.cpp: Added.
+        * html/FileStream.h: Added.
+        * html/FileStreamClient.h: Added.
+        * html/FileThread.cpp:
+        (WebCore::SameFilePredicate::SameFilePredicate):
+        (WebCore::SameFilePredicate::operator()):
+        (WebCore::FileThread::unscheduleTasks):
+        * html/FileThread.h:
+        (WebCore::FileThread::Task::stream):
+        (WebCore::FileThread::Task::Task):
+
+2010-04-07  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Remove some unnecessary uses of commonJSGlobalData
+        https://bugs.webkit.org/show_bug.cgi?id=37229
+
+        Pass the ExecState down to identifierFromNPIdentifier and update call sites
+
+        * bridge/NP_jsobject.cpp:
+        (_NPN_Invoke):
+        (_NPN_GetProperty):
+        (_NPN_SetProperty):
+        (_NPN_RemoveProperty):
+        (_NPN_HasProperty):
+        (_NPN_HasMethod):
+        * bridge/c/c_instance.cpp:
+        (JSC::Bindings::CInstance::getPropertyNames):
+        * bridge/c/c_utility.cpp:
+        (JSC::Bindings::identifierFromNPIdentifier):
+        * bridge/c/c_utility.h:
+
+2010-04-07  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Poor rendering on lala.com with frame flattening
+        https://bugs.webkit.org/show_bug.cgi?id=37164
+
+        Do not flatten offscreen iframes.
+
+        Test: fast/frames/flattening/iframe-flattening-offscreen.html
+
+        * rendering/RenderPartObject.cpp:
+        (WebCore::RenderPartObject::flattenFrame):
+        * rendering/RenderPartObject.h:
+
+2010-04-07  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [V8] Add a missing check for constructor call in WebKitPointConstructor.
+        https://bugs.webkit.org/show_bug.cgi?id=37210
+
+        Test: fast/constructors/constructor-as-function-crash.html
+
+        * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+        (WebCore::V8WebKitPoint::constructorCallback): Added a check for constructor call.
+
+2010-04-07  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37219
+        
+        This change disables text caret for the iPhone platflorm.
+        Added UNUSED_PARAM to build when ENABLE_TEXT_CARET is 0.
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::recomputeCaretRect):
+        (WebCore::SelectionController::paintCaret):
+        * page/Frame.cpp:
+        (WebCore::Frame::paintDragCaret):
+
+2010-04-07  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Text repainting does not account for glyphs which draw outside the typographic bounds of the font (6274).
+        <rdar://problem/6649734>
+        <https://bugs.webkit.org/show_bug.cgi?id=6274>
+        
+        In order to be able to handle successfully this case, it is necessary to change the glyph width cache to store
+        the bounding box for the glyph instead of the simply caching the glyph width.
+        Retrieving the bounding box for the glyph is expensive, therefore we do it only
+        when we are rendering text using the complex text path to minimize the performance impact.
+        To support characters with stacked diacritics, the method canUseGlyphCache has been modified to
+        return false for the range of characters with stacked diacritics.
+        The glyph cache has been also updated to allow storing the glyph bounding box together with the
+        horizontal width. The bounding box is populated only for complex text.
+        
+        The original version of this patch has been written by Dan Bernstein.
+
+        Test: fast/repaint/stacked-diacritics.html
+
+        * Android.mk: File name change.
+        * GNUmakefile.am: File name change.
+        * WebCore.base.exp: Added parameter in exported function.
+        * WebCore.gypi: File name change.
+        * WebCore.vcproj/WebCore.vcproj: File name change.
+        * WebCore.xcodeproj/project.pbxproj: File name change.
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::floatWidth): Added glyphOverflow parameter.
+        * platform/graphics/Font.h:
+        (WebCore::GlyphOverflow::GlyphOverflow): Added.
+        (WebCore::Font::width): Added glyphOverflow parameter.
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::canUseGlyphCache): Modified to render characters with stacked diacritics with complex text path.
+        * platform/graphics/GlyphMetricsMap.cpp: Copied from WebCore/platform/graphics/GlyphWidthMap.cpp.
+        (WebCore::GlyphMetricsMap::locatePageSlowCase): Class name changed to reflect new semantics.
+        * platform/graphics/GlyphMetricsMap.h: Copied from WebCore/platform/graphics/GlyphWidthMap.h.
+        (WebCore::GlyphMetricsMap::GlyphMetricsMap):
+        (WebCore::GlyphMetricsMap::~GlyphMetricsMap):
+        (WebCore::GlyphMetricsMap::metricsForGlyph):
+        (WebCore::GlyphMetricsMap::widthForGlyph):
+        (WebCore::GlyphMetricsMap::setMetricsForGlyph):
+        (WebCore::GlyphMetricsMap::GlyphMetricsPage::metricsForGlyph):
+        (WebCore::GlyphMetricsMap::GlyphMetricsPage::setMetricsForGlyph):
+        (WebCore::GlyphMetricsMap::GlyphMetricsPage::setMetricsForIndex):
+        (WebCore::GlyphMetricsMap::locatePage):
+        * platform/graphics/GlyphWidthMap.cpp: Removed.
+        * platform/graphics/GlyphWidthMap.h: Removed.
+        * platform/graphics/SimpleFontData.cpp:
+        (WebCore::SimpleFontData::platformGlyphInit):
+        * platform/graphics/SimpleFontData.h:
+        (WebCore::):
+        (WebCore::SimpleFontData::widthForGlyph):
+        (WebCore::SimpleFontData::metricsForGlyph):
+        * platform/graphics/cairo/SimpleFontDataCairo.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/chromium/FontChromiumWin.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/chromium/FontLinux.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/chromium/SimpleFontDataLinux.cpp:
+        (WebCore::SimpleFontData::platformWidthForGlyph): Name and signature vachange
+        * platform/graphics/efl/FontEfl.cpp:
+        (WebCore::Font::floatWidthForComplexText): Name and signature change.
+        * platform/graphics/gtk/SimpleFontDataPango.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/haiku/FontHaiku.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/haiku/SimpleFontDataHaiku.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::ComplexTextController):
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+        * platform/graphics/mac/ComplexTextController.h:
+        (WebCore::ComplexTextController::minGlyphBoundingBoxX):
+        (WebCore::ComplexTextController::maxGlyphBoundingBoxX):
+        (WebCore::ComplexTextController::minGlyphBoundingBoxY):
+        (WebCore::ComplexTextController::maxGlyphBoundingBoxY):
+        * platform/graphics/mac/FontComplexTextMac.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added paramter.
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added paramter.
+        * platform/graphics/win/FontWin.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/win/SimpleFontDataCGWin.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * platform/graphics/win/SimpleFontDataWin.cpp:
+        (WebCore::SimpleFontData::metricsForGDIGlyph):
+        * platform/graphics/win/UniscribeController.cpp:
+        (WebCore::UniscribeController::UniscribeController):
+        (WebCore::UniscribeController::shapeAndPlaceItem):
+        * platform/graphics/win/UniscribeController.h:
+        (WebCore::UniscribeController::minGlyphBoundingBoxX):
+        (WebCore::UniscribeController::maxGlyphBoundingBoxX):
+        (WebCore::UniscribeController::minGlyphBoundingBoxY):
+        (WebCore::UniscribeController::maxGlyphBoundingBoxY):
+        * platform/graphics/wince/FontWince.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/wx/FontWx.cpp:
+        (WebCore::Font::floatWidthForComplexText): Added parameter.
+        * platform/graphics/wx/SimpleFontDataWx.cpp:
+        (WebCore::SimpleFontData::platformMetricsForGlyph): Name and signature change.
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::placeBoxesHorizontally):
+        (WebCore::InlineFlowBox::computeLogicalBoxHeights):
+        (WebCore::InlineFlowBox::computeVerticalOverflow):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::setFallbackFonts):
+        (WebCore::InlineTextBox::fallbackFonts):
+        (WebCore::InlineTextBox::setGlyphOverflow):
+        (WebCore::InlineTextBox::glyphOverflow):
+        * rendering/InlineTextBox.h:
+        (WebCore::InlineTextBox::clearGlyphOverflowAndFallbackFontMap): Added.
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::computeHorizontalPositionsForLine):
+        (WebCore::RenderBlock::layoutInlineChildren):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::RenderText):
+        (WebCore::RenderText::styleDidChange):
+        (WebCore::RenderText::widthFromCache):
+        (WebCore::RenderText::trimmedPrefWidths):
+        (WebCore::RenderText::calcPrefWidths):
+        (WebCore::RenderText::setText):
+        (WebCore::RenderText::width):
+        * rendering/RenderText.h:
+
+2010-04-07  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Fix incorrect white-space in WebGLRenderingContext.idl
+        https://bugs.webkit.org/show_bug.cgi?id=31339
+
+        * html/canvas/WebGLRenderingContext.idl: Remove offending extra whitespace.
+
+2010-04-07  Rodrigo Belem  <rodrigo.belem@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] The build system is not installing the generated headers (QGraphicsWebView, QWebDatabase, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=37173
+
+        This patch sets the correct path to the classheaders.pri and then
+        fixes the installation of the generated headers.
+
+        * WebCore.pro:
+
+2010-04-05  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Kenneth Christiansen.
+
+        Spatial Navigation: bail out as soon as algorithm finds a focus candidate is not applicable
+        https://bugs.webkit.org/show_bug.cgi?id=37135
+
+        It happens, for example, when distanceDataForNode assigns numeric_limits<long long> to
+        current focus candidate's. It means that current candidate is not in direction, or not
+        a valid target node.
+
+        * page/FocusController.cpp:
+        (WebCore::FocusController::findFocusableNodeInDirection):
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed inspector methods from ScriptExecutionContext and derived classes.
+        Removed MessageDestination parameter from console-related calls (we now always
+        log to the same destination(s)).
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * dom/Document.cpp:
+        (WebCore::Document::reportException):
+        (WebCore::Document::addMessage):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
+        * loader/FrameLoaderClient.h:
+        * loader/ResourceLoadNotifier.cpp:
+        * loader/ResourceLoadNotifier.h:
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect):
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didOpen):
+        (WebCore::WebSocketChannel::appendToBuffer):
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readServerHandshake):
+        (WebCore::WebSocketHandshake::readHTTPHeaders):
+        (WebCore::WebSocketHandshake::checkResponseHeaders):
+        * workers/DefaultSharedWorkerRepository.cpp:
+        (WebCore::postConsoleMessageTask):
+        (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::importScripts):
+        (WebCore::WorkerContext::addMessage):
+        * workers/WorkerContext.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::postConsoleMessageTask):
+        (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
+        * workers/WorkerMessagingProxy.h:
+        * workers/WorkerReportingProxy.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::reportUnsafeUsage):
+        (WebCore::XMLHttpRequest::didFinishLoading):
+
+2010-04-07  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36827
+
+        Replaced the 'shouldTreatAsAttachment' function with a more generic 
+        function that returns the content disposition type.
+
+        See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395
+
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::contentDispositionType):
+        * platform/network/HTTPParsers.h:
+        (WebCore::):
+
+2010-04-07  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        [V8] Throw exception in SerializedScriptValue on input errors
+        https://bugs.webkit.org/show_bug.cgi?id=37160
+
+        When cycles are detected SerializedScriptValue should throw
+        NOT_SUPPORTED_ERR. See
+        http://www.whatwg.org/specs/web-apps/2009-10-27/multipage/urls.html#structured-clone
+
+        * bindings/scripts/CodeGeneratorV8.pm: Custom processing for
+        function arguments of type SerializedScriptValue.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::SerializedScriptValue):
+        * bindings/v8/SerializedScriptValue.h:
+        (WebCore::SerializedScriptValue::create): Added a constructor
+        function with an extra paratemer to check whether an exception was
+        thrown.
+
+        SerializedScriptValue::create callers updated to check for
+        exceptions:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::postMessageCallback):
+        * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
+        (WebCore::V8DedicatedWorkerContext::postMessageCallback):
+        * bindings/v8/custom/V8HistoryCustom.cpp:
+        (WebCore::V8History::pushStateCallback):
+        (WebCore::V8History::replaceStateCallback):
+        * bindings/v8/custom/V8MessagePortCustom.cpp:
+        (WebCore::V8MessagePort::postMessageCallback):
+        * bindings/v8/custom/V8PopStateEventCustom.cpp:
+        (WebCore::V8PopStateEvent::initPopStateEventCallback):
+        * bindings/v8/custom/V8WorkerCustom.cpp:
+        (WebCore::V8Worker::postMessageCallback):
+
+2010-04-07  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Provide a placeholder for resources with no content available
+        https://bugs.webkit.org/show_bug.cgi?id=37142
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ImageView.js:
+        (WebInspector.ImageView):
+        (WebInspector.ImageView.prototype.contentTabSelected):
+        * inspector/front-end/ResourceView.js:
+        (WebInspector.ResourceView.prototype._innerSelectContentTab):
+        (WebInspector.ResourceView.prototype.contentTabSelected):
+        * inspector/front-end/inspector.css:
+        (.resource-content-unavailable):
+
+2010-04-07  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36750
+
+        [Qt] Package build without touch support is broken
+
+        Use the conditional attribute instead of #ifdefs in the idl file for the
+        touch specific properties, to make the generated files compile with and
+        without the touch events enabled.
+
+        * dom/Document.idl: Use conditional instead of #ifdef.
+        * dom/Element.idl: Ditto.
+        * page/DOMWindow.idl: Ditto.
+
+2010-04-07  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Holger Freyther.
+
+        Add the touch event related IDL files to the idl generation, so that
+        they can be safely included from generated JS bindings files. The
+        generated files have #ifdef feature guards.
+
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+
+2010-04-06  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        V8CustomIDBCallbacks<> should not hold a reference to the frame
+        https://bugs.webkit.org/show_bug.cgi?id=37154
+
+        Don't hold on to a Frame reference.
+        Instead, be an ActiveDOMObject and use scriptExecutionContext()
+        to get the v8 context.
+        Factor the guts of onSuccess and onError out.
+
+        Doesn't work enough to test yet.
+
+        * bindings/v8/custom/V8CustomIDBCallbacks.h:
+        (WebCore::V8CustomIDBCallbacks::create):
+        (WebCore::V8CustomIDBCallbacks::onSuccess):
+        (WebCore::V8CustomIDBCallbacks::onError):
+        (WebCore::V8CustomIDBCallbacks::V8CustomIDBCallbacks):
+        (WebCore::V8CustomIDBCallbacks::onEvent):
+        * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
+        (WebCore::V8IndexedDatabaseRequest::openCallback):
+        * storage/IDBCallbacks.h:
+        (WebCore::IDBCallbacks::IDBCallbacks):
+
+2010-04-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57196.
+        http://trac.webkit.org/changeset/57196
+        https://bugs.webkit.org/show_bug.cgi?id=37196
+
+        Multiple layout test failures on Chromium (Requested by yurys
+        on #webkit).
+
+        * bindings/js/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::callLocation):
+        * bindings/js/ScriptCallStack.h:
+        * bindings/v8/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::create):
+        (WebCore::ScriptCallStack::callLocation):
+        (WebCore::ScriptCallStack::ScriptCallStack):
+        * bindings/v8/ScriptCallStack.h:
+        * bindings/v8/ScriptDebugServer.cpp:
+        * bindings/v8/ScriptDebugServer.h:
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::createUtilityContext):
+        (WebCore::V8Proxy::sourceLineNumber):
+        (WebCore::V8Proxy::sourceName):
+        * bindings/v8/V8Proxy.h:
+        (WebCore::V8Proxy::utilityContext):
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+
+2010-04-07  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed, rolling out r57199.
+        http://trac.webkit.org/changeset/57199
+        https://bugs.webkit.org/show_bug.cgi?id=36750
+
+        Breaks non-touch enabled build
+
+        * dom/Document.idl:
+        * dom/Element.idl:
+        * page/DOMWindow.idl:
+
+2010-04-07  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36750
+
+        [Qt] Package build without touch support is broken
+
+        Use the conditional attribute instead of #ifdefs in the idl file for the
+        touch specific properties, to make the generated files compile with and
+        without the touch events enabled.
+
+        * dom/Document.idl: Use conditional instead of #ifdef.
+        * dom/Element.idl: Ditto.
+        * page/DOMWindow.idl: Ditto.
+
+2010-04-07  Jaime Yap  <jaimeyap@google.com>
+
+        Reviewed by Yury Semikhatsky.
+
+        Adds the ability to get the function symbol name when looking up the call location
+        for records sent by the InspectorTimelineAgent.
+        https://bugs.webkit.org/show_bug.cgi?id=36839
+
+        No new tests.
+
+        * bindings/js/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::callLocation):
+        * bindings/js/ScriptCallStack.h:
+        * bindings/v8/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::create):
+        (WebCore::ScriptCallStack::callLocation):
+        (WebCore::ScriptCallStack::ScriptCallStack):
+        * bindings/v8/ScriptCallStack.h:
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::createUtilityContext):
+        (WebCore::ScriptDebugServer::lastCallFrame):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::utilityContext):
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+
+2010-04-06  Greg Bolsinga  <bolsinga@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37188
+        WebCore::page::Geolocation::m_shouldClearCache is not used.
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::Geolocation): Remove m_shouldClearCache.
+        * page/Geolocation.h:
+        (WebCore::Geolocation::): Ditto.
+
+2010-04-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Remove obsolete MOBILE flag
+        https://bugs.webkit.org/show_bug.cgi?id=37125
+
+        The MOBILE flag is no longer used by any of the ports.
+        The flag use to control some tokenizer defaults that 
+        can be changed runtime.
+
+        No new tests as there is no new functionality.
+
+        * config.h:
+        * html/HTMLTokenizer.cpp:
+
+2010-04-06  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
+        https://bugs.webkit.org/show_bug.cgi?id=36646
+
+        Cause the worker code to swallow termination exceptions because these
+        need not be reported to the user because they are an implementation
+        detail of how we terminate worker execution.
+
+        Test: fast/workers/worker-terminate-forever.html
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::reportException):
+            - Refuse to report termination exceptions to the user because they
+              are an implementation detail.
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::forbidExecution):
+            - Instead of using timeouts to stop run away workers, use our fancy
+              new Terminator object.
+
+2010-04-06  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Jian Li.
+
+        Add basic FileSystem operations for FileReader/FileWriter support for POSIX (incl. Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=36938
+
+        No new tests; will be added when we implement upper layers.
+
+        * platform/FileSystem.h:
+        (WebCore::):
+        * platform/posix/FileSystemPOSIX.cpp:
+        (WebCore::openFile):
+        (WebCore::closeFile):
+        (WebCore::seekFile):
+        (WebCore::truncateFile):
+        (WebCore::writeToFile):
+        (WebCore::readFromFile):
+
+2010-04-06  Nicolas Weber  <thakis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Implement DragImage functionality for chromium/mac.
+        https://bugs.webkit.org/show_bug.cgi?id=37069
+
+        * page/chromium/DragControllerChromium.cpp:
+        (WebCore::DragController::maxDragImageSize):
+        Use a max size of 400x400 on OS X.
+        * platform/chromium/DragImageChromiumMac.cpp:
+        (WebCore::dragImageSize): Implement.
+        (WebCore::deleteDragImage): Implement.
+        (WebCore::scaleDragImage): Implement.
+        (WebCore::dissolveDragImageToFraction): Implement.
+        (WebCore::createDragImageFromImage): Implement.
+        * platform/chromium/DragImageRef.h:
+        Use CGImageRefs as DragImageRef on OS X.
+
+2010-04-06  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Use the new UserGestureIndictor to process javascript:window.open()
+
+        https://bugs.webkit.org/show_bug.cgi?id=37138
+
+        * bindings/v8/ScriptController.cpp
+        (WebCore::ScriptController::processingUserGesture):
+          Use the new UserGestureIndicator when processing a
+          javascript:window.open()
+
+2010-04-06  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Renaming Graphics Layer related classes used by Chromium from *Skia to *Chromium and replacing wherever possible Skia-specific
+        data types with WebCore equivalents. The source files will be renamed accordingly and moved out of platform/graphics/skia
+        in a subsequent CL.
+        https://bugs.webkit.org/show_bug.cgi?id=37116
+
+        No new functionality so no new tests.
+
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/skia/GraphicsLayerSkia.cpp:
+        (WebCore::setLayerBorderColor):
+        (WebCore::clearBorderColor):
+        (WebCore::setLayerBackgroundColor):
+        (WebCore::clearLayerBackgroundColor):
+        (WebCore::GraphicsLayer::create):
+        (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+        (WebCore::GraphicsLayerChromium::~GraphicsLayerChromium):
+        (WebCore::GraphicsLayerChromium::setName):
+        (WebCore::GraphicsLayerChromium::nativeLayer):
+        (WebCore::GraphicsLayerChromium::setChildren):
+        (WebCore::GraphicsLayerChromium::addChild):
+        (WebCore::GraphicsLayerChromium::addChildAtIndex):
+        (WebCore::GraphicsLayerChromium::addChildBelow):
+        (WebCore::GraphicsLayerChromium::addChildAbove):
+        (WebCore::GraphicsLayerChromium::replaceChild):
+        (WebCore::GraphicsLayerChromium::removeFromParent):
+        (WebCore::GraphicsLayerChromium::setPosition):
+        (WebCore::GraphicsLayerChromium::setAnchorPoint):
+        (WebCore::GraphicsLayerChromium::setSize):
+        (WebCore::GraphicsLayerChromium::setTransform):
+        (WebCore::GraphicsLayerChromium::setChildrenTransform):
+        (WebCore::GraphicsLayerChromium::setPreserves3D):
+        (WebCore::GraphicsLayerChromium::setMasksToBounds):
+        (WebCore::GraphicsLayerChromium::setDrawsContent):
+        (WebCore::GraphicsLayerChromium::setBackgroundColor):
+        (WebCore::GraphicsLayerChromium::clearBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setContentsOpaque):
+        (WebCore::GraphicsLayerChromium::setBackfaceVisibility):
+        (WebCore::GraphicsLayerChromium::setOpacity):
+        (WebCore::GraphicsLayerChromium::setNeedsDisplay):
+        (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect):
+        (WebCore::GraphicsLayerChromium::setContentsRect):
+        (WebCore::GraphicsLayerChromium::setContentsToImage):
+        (WebCore::GraphicsLayerChromium::setContentsToVideo):
+        (WebCore::GraphicsLayerChromium::setGeometryOrientation):
+        (WebCore::GraphicsLayerChromium::hostLayerForSublayers):
+        (WebCore::GraphicsLayerChromium::layerForSuperlayer):
+        (WebCore::GraphicsLayerChromium::platformLayer):
+        (WebCore::GraphicsLayerChromium::setDebugBackgroundColor):
+        (WebCore::GraphicsLayerChromium::setDebugBorder):
+        (WebCore::GraphicsLayerChromium::updateSublayerList):
+        (WebCore::GraphicsLayerChromium::updateLayerPosition):
+        (WebCore::GraphicsLayerChromium::updateLayerSize):
+        (WebCore::GraphicsLayerChromium::updateAnchorPoint):
+        (WebCore::GraphicsLayerChromium::updateTransform):
+        (WebCore::GraphicsLayerChromium::updateChildrenTransform):
+        (WebCore::GraphicsLayerChromium::updateMasksToBounds):
+        (WebCore::GraphicsLayerChromium::updateContentsOpaque):
+        (WebCore::GraphicsLayerChromium::updateBackfaceVisibility):
+        (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+        (WebCore::GraphicsLayerChromium::updateLayerDrawsContent):
+        (WebCore::GraphicsLayerChromium::updateLayerBackgroundColor):
+        (WebCore::GraphicsLayerChromium::updateContentsImage):
+        (WebCore::GraphicsLayerChromium::updateContentsVideo):
+        (WebCore::GraphicsLayerChromium::updateContentsRect):
+        (WebCore::GraphicsLayerChromium::updateGeometryOrientation):
+        (WebCore::GraphicsLayerChromium::setupContentsLayer):
+        (WebCore::GraphicsLayerChromium::updateOpacityOnLayer):
+        * platform/graphics/skia/GraphicsLayerSkia.h:
+        (WebCore::GraphicsLayerChromium::primaryLayer):
+        (WebCore::GraphicsLayerChromium::contentsLayer):
+        * platform/graphics/skia/LayerRendererSkia.cpp:
+        (WebCore::LayerRendererChromium::create):
+        (WebCore::LayerRendererChromium::LayerRendererChromium):
+        (WebCore::LayerRendererChromium::~LayerRendererChromium):
+        (WebCore::LayerRendererChromium::updateLayerContents):
+        (WebCore::LayerRendererChromium::drawLayersInCanvas):
+        (WebCore::LayerRendererChromium::drawLayerInCanvasRecursive):
+        (WebCore::LayerRendererChromium::updateLayerContentsRecursive):
+        * platform/graphics/skia/LayerRendererSkia.h:
+        (WebCore::LayerRendererChromium::setRootLayer):
+        (WebCore::LayerRendererChromium::rootLayer):
+        * platform/graphics/skia/LayerSkia.cpp:
+        (WebCore::LayerChromium::create):
+        (WebCore::LayerChromium::LayerChromium):
+        (WebCore::LayerChromium::~LayerChromium):
+        (WebCore::LayerChromium::updateGraphicsContext):
+        (WebCore::LayerChromium::updateContents):
+        (WebCore::LayerChromium::drawDebugBorder):
+        (WebCore::LayerChromium::setNeedsCommit):
+        (WebCore::LayerChromium::addSublayer):
+        (WebCore::LayerChromium::insertSublayer):
+        (WebCore::LayerChromium::removeFromSuperlayer):
+        (WebCore::LayerChromium::removeSublayer):
+        (WebCore::LayerChromium::indexOfSublayer):
+        (WebCore::LayerChromium::setBackingStoreRect):
+        (WebCore::LayerChromium::setBounds):
+        (WebCore::LayerChromium::setFrame):
+        (WebCore::LayerChromium::rootLayer):
+        (WebCore::LayerChromium::removeAllSublayers):
+        (WebCore::LayerChromium::setSublayers):
+        (WebCore::LayerChromium::setSuperlayer):
+        (WebCore::LayerChromium::superlayer):
+        (WebCore::LayerChromium::setNeedsDisplay):
+        * platform/graphics/skia/LayerSkia.h:
+        (WebCore::LayerChromium::setAnchorPoint):
+        (WebCore::LayerChromium::anchorPoint):
+        (WebCore::LayerChromium::borderWidth):
+        (WebCore::LayerChromium::bounds):
+        (WebCore::LayerChromium::frame):
+        (WebCore::LayerChromium::setPosition):
+        (WebCore::LayerChromium::position):
+        (WebCore::LayerChromium::zPosition):
+        (WebCore::LayerChromium::getSublayers):
+        (WebCore::LayerChromium::setSublayerTransform):
+        (WebCore::LayerChromium::sublayerTransform):
+        (WebCore::LayerChromium::setTransform):
+        (WebCore::LayerChromium::transform):
+
+2010-04-06  Jarkko Sakkinen  <jarkko.j.sakkinen@gmail.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] WebKit does not build on Windows with --3d-canvas
+        https://bugs.webkit.org/show_bug.cgi?id=37026
+
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+
+2010-04-06  Abhinav Mithal <abhinav.mithal@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] npapi header leaves XP_WIN flag defined even when __SYMBIAN32__ flag is found
+        https://bugs.webkit.org/show_bug.cgi?id=34614
+
+        Do not define XP_WIN if WebKit is compiled for Symbian.
+
+        No new tests as there is no new functionality.
+
+        * bridge/npapi.h:
+
+2010-04-06  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        aria-label doesn't work on image map area
+        https://bugs.webkit.org/show_bug.cgi?id=36977
+
+        Test: platform/mac/accessibility/area-with-aria-label.html
+
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::accessibilityDescription):
+
+2010-04-06  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Reverts the incorrect fixed position fastpath scrolling logic
+        https://bugs.webkit.org/show_bug.cgi?id=33150
+
+        This code does not properly handle overflow or transforms on fixed
+        position elements, causing repaint bugs on scroll.
+
+        No new tests.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::addFixedObject):
+        (WebCore::FrameView::removeFixedObject):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollContents):
+        * platform/ScrollView.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::styleWillChange):
+
+2010-04-06  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix for wxMac / Cocoa on wx trunk.
+        
+        * platform/wx/wxcode/mac/carbon/fontprops.mm:
+        (wxFontContainsCharacters):
+
+2010-04-06  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        JS code generator does not support feature conditional attributes that are writable
+        https://bugs.webkit.org/show_bug.cgi?id=37149
+
+        Write out the feature #ifdef not only for the getter, but also for the setter
+        function.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+
+2010-04-06  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] need DragImage implementation
+        https://bugs.webkit.org/show_bug.cgi?id=35811
+
+        Use the DragImageRef that the DragController passes to us.
+
+        This was previously committed but rolled back for breaking layout
+        tests. The fix is on the WebKit/chromium side.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/DragImageChromium.cpp: Removed.
+        * platform/chromium/DragImageChromiumMac.cpp: Added.
+        (WebCore::dragImageSize):
+        (WebCore::deleteDragImage):
+        (WebCore::scaleDragImage):
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        (WebCore::createDragImageIconForCachedImage):
+        * platform/chromium/DragImageChromiumSkia.cpp: Added.
+        (WebCore::dragImageSize):
+        (WebCore::deleteDragImage):
+        (WebCore::scaleDragImage):
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        (WebCore::createDragImageIconForCachedImage):
+        * platform/chromium/DragImageRef.h:
+
+2010-04-01  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Darin Adler.
+
+        Fix bug: CSS3 :not selector with ID simple selector sequence test fails
+        As per http://www.w3.org/TR/css3-selectors/#negation, :not(X) takes a simple selector as an argument.
+        WebKit was accepting a simple selector *sequence*.
+        This patch adds WebCore::CSSSelector::isSimple which judges if the selector is simple.
+        The method is used in CSSGrammar.y to decide whether to accept the selector as the argument of :not().
+        https://bugs.webkit.org/show_bug.cgi?id=36276
+
+        Test: fast/css/invalid-not-with-simple-selector-sequence.html
+
+        * css/CSSGrammar.y:
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::isSimple):
+        * css/CSSSelector.h:
+
+2010-04-06  Andy Estes  <aestes@apple.com>
+
+        Rubber-stamped by Dan Bernstein.
+
+        Remove non-ASCII characters from license headers to fix build errors on
+        Japanese Windows.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37008
+
+        * dom/UserGestureIndicator.cpp:
+        * dom/UserGestureIndicator.h:
+
+2010-04-06  Andrei Popescu  <andreip@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8][Android] PageCache crashes when JavaScript is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=37150
+
+        This patch ensures that saving and restoration of the script
+        state only happens when JS is enabled and each frame has a
+        non-null context.
+
+        No new tests: existing tests show the feature is working
+        when JS is enabled. When JS is disabled, manual testing
+        is required.
+
+        * bindings/v8/ScriptCachedFrameData.cpp:
+        (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
+        (WebCore::ScriptCachedFrameData::restore):
+
+2010-04-06  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed build fix.
+
+        Web Inspector: missed files were added.
+
+
+        * GNUmakefile.am:
+        * bindings/js/ScriptGCEvent.h: Added.
+        (WebCore::ScriptGCEvent::addEventListener):
+        (WebCore::ScriptGCEvent::removeEventListener):
+        (WebCore::ScriptGCEvent::getHeapSize):
+        * bindings/v8/ScriptGCEvent.cpp: Added.
+        (WebCore::ScriptGCEvent::addEventListener):
+        (WebCore::ScriptGCEvent::removeEventListener):
+        (WebCore::ScriptGCEvent::getHeapSize):
+        (WebCore::ScriptGCEvent::getUsedHeapSize):
+        (WebCore::ScriptGCEvent::gcPrologueCallback):
+        (WebCore::ScriptGCEvent::gcEpilogueCallback):
+        * bindings/v8/ScriptGCEvent.h: Added.
+        * inspector/ScriptGCEventListener.h: Added.
+        (WebCore::ScriptGCEventListener::~ScriptGCEventListener):
+
+2010-04-06  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: The JS code can be not optimal from memory usage point of view.
+        As example it can generate a lot of temp objects and GC will spend significant time to collect these objects.
+        GC event will show us these moments. Also each event can show us how much memory is in use.
+        https://bugs.webkit.org/show_bug.cgi?id=37025
+
+        * WebCore.gypi:
+        * WebCore.pro:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+        (WebCore::InspectorTimelineAgent::pushGCEventRecords):
+        (WebCore::InspectorTimelineAgent::didGC):
+        (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
+        (WebCore::InspectorTimelineAgent::didInstallTimer):
+        (WebCore::InspectorTimelineAgent::didRemoveTimer):
+        (WebCore::InspectorTimelineAgent::willSendResourceRequest):
+        (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+        (WebCore::InspectorTimelineAgent::didMarkTimeline):
+        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+        (WebCore::InspectorTimelineAgent::setHeapSizeStatistic):
+        (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+        * inspector/InspectorTimelineAgent.h:
+        (WebCore::):
+        (WebCore::InspectorTimelineAgent::instanceCount):
+        (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
+        (WebCore::InspectorTimelineAgent::GCEvent::GCEvent):
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGCEventData):
+        * inspector/TimelineRecordFactory.h:
+        * inspector/front-end/Popover.js:
+        (WebInspector.PopoverHelper.prototype._mouseHover):
+        * inspector/front-end/TimelineAgent.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype.get _recordStyles):
+        (WebInspector.TimelinePanel.FormattedRecord):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+
+2010-04-05  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Laszlo Gombos.
+
+        Remove unused DIRECTIONAL_PAD_NAVIGATION
+        https://bugs.webkit.org/show_bug.cgi?id=37134
+
+        Android browser was planning to have a "directional pad navigation" available on
+        trunk, guarded by a build flag named DIRECTIONAL_PAD_NAVIGATION, but according to
+        https://bugs.webkit.org/show_bug.cgi?id=23145#c3 , the plan was dropped.
+
+        However bug 23163 landed some code relying on the build flag supposedly to be added,
+        and is now dead code in trunk.
+
+        * dom/Element.cpp:
+        (WebCore::Element::updateFocusAppearance):
+
+2010-04-06  Mattias Nissler  <mnissler@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Rework inspector docking to issue a request call from the frontend
+        whenever the user triggers to (un)dock the inspector window. Doing so
+        enables InspectorFrontendHost implementations to asynchronously decide
+        whether the window is docked or not. The old canAttachWindow() is not
+        required anymore, remove it.
+        https://bugs.webkit.org/show_bug.cgi?id=36944
+
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::requestAttachWindow):
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::requestAttachWindow):
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/front-end/inspector.js:
+        (WebInspector.toggleAttach):
+
+2010-04-06  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        [V8] Extend the set of types supported by SerializedScriptValue
+        https://bugs.webkit.org/show_bug.cgi?id=37052
+
+        New types include sparse arrays, Uint32, Date, and ImageData.
+
+        Serialization process became more flexible. A state can either
+        directly write primitive values (instead of returning them like
+        iterator) or construct a new state for serializing complex values
+        that will return to the current state when done.
+
+        Deserialization process now avoids exposing the tags using a set
+        of factory functions for complex objects instead.
+
+        Internal buffer type changed to uint8_t to be independent of
+        whether char is signed or not.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::):
+        (WebCore::Writer::Writer):
+        (WebCore::Writer::writeString):
+        (WebCore::Writer::writeUint32):
+        (WebCore::Writer::writeDate):
+        (WebCore::Writer::writeNumber):
+        (WebCore::Writer::writeImageData):
+        (WebCore::Writer::writeArray):
+        (WebCore::Writer::writeObject):
+        (WebCore::Writer::writeSparseArray):
+        (WebCore::Writer::doWriteUint32):
+        (WebCore::Writer::doWriteNumber):
+        (WebCore::Writer::append):
+        (WebCore::Writer::fillHole):
+        (WebCore::Writer::byteAt):
+        (WebCore::Serializer::Serializer):
+        (WebCore::Serializer::serialize):
+        (WebCore::Serializer::writeArray):
+        (WebCore::Serializer::writeObject):
+        (WebCore::Serializer::writeSparseArray):
+        (WebCore::Serializer::StateBase::StateBase):
+        (WebCore::Serializer::ErrorState::ErrorState):
+        (WebCore::Serializer::ErrorState::advance):
+        (WebCore::Serializer::State::composite):
+        (WebCore::Serializer::State::State):
+        (WebCore::Serializer::ArrayState::ArrayState):
+        (WebCore::Serializer::ArrayState::advance):
+        (WebCore::Serializer::AbstractObjectState::AbstractObjectState):
+        (WebCore::Serializer::AbstractObjectState::advance):
+        (WebCore::Serializer::ObjectState::ObjectState):
+        (WebCore::Serializer::ObjectState::objectDone):
+        (WebCore::Serializer::SparseArrayState::SparseArrayState):
+        (WebCore::Serializer::SparseArrayState::objectDone):
+        (WebCore::Serializer::push):
+        (WebCore::Serializer::pop):
+        (WebCore::Serializer::handleError):
+        (WebCore::Serializer::checkComposite):
+        (WebCore::Serializer::writeString):
+        (WebCore::Serializer::writeImageData):
+        (WebCore::Serializer::newArrayState):
+        (WebCore::Serializer::newObjectState):
+        (WebCore::Serializer::doSerialize):
+        (WebCore::Reader::Reader):
+        (WebCore::Reader::read):
+        (WebCore::Reader::readString):
+        (WebCore::Reader::readUint32):
+        (WebCore::Reader::readDate):
+        (WebCore::Reader::readNumber):
+        (WebCore::Reader::readImageData):
+        (WebCore::Reader::doReadUint32):
+        (WebCore::Reader::doReadNumber):
+        (WebCore::Deserializer::Deserializer):
+        (WebCore::Deserializer::createArray):
+        (WebCore::Deserializer::createObject):
+        (WebCore::Deserializer::createSparseArray):
+        (WebCore::Deserializer::initializeObject):
+        (WebCore::Deserializer::doDeserialize):
+        (WebCore::Deserializer::stackDepth):
+        (WebCore::SerializedScriptValue::deserialize):
+
+2010-04-06  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed buildfix for --minimal build.
+        Buildfix after r57134. Add ENABLE(WORKERS) guard.
+
+        original bug: https://bugs.webkit.org/show_bug.cgi?id=36375
+
+        * bindings/js/JSWorkerContextErrorHandler.cpp:
+
+2010-04-06  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Oliver Hunt.
+
+        SVG/SMIL parse failure on attribute keySplines
+        https://bugs.webkit.org/show_bug.cgi?id=37071
+
+        Test: svg/animations/animate-keySplines.html
+
+        The String in 'keySplines' can have multiple spaces between numbers
+        and delimiters. The parsing code is inspired by SVGParserUtilities
+        and respects this.
+
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::parseKeySplines):
+
+2010-04-06  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Refactored error reporting mechanizm on Worker Global Objects.
+        Unlike other event listeners which accept single argument(Event)
+        onerror handler on worker global object should be a function
+        accepting three arguments. This error reporting was implementedas
+        EventListener::reportError method which had custom implementations
+        for v8 and JSC. This patch removes EventListener::reportError and
+        moves its functionality into custom bindings(V8WorkerContextErrorHandler
+        and JSWorkerContextErrorHandler) that implement EventListener inerface
+        for the onerror handler.
+
+        This patch also makes uncaught exceptions that happen in the onerror
+        listener be reported to the Worker's onerror handler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36375
+
+        * Android.jscbindings.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSEventListener.cpp:
+        * bindings/js/JSEventListener.h:
+        * bindings/js/JSWorkerContextErrorHandler.cpp: Added.
+        (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::handleEvent):
+        * bindings/js/JSWorkerContextErrorHandler.h: Added.
+        (WebCore::JSWorkerContextErrorHandler::create):
+        (WebCore::createJSWorkerContextErrorHandler):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8WorkerContextErrorHandler.cpp: Added.
+        (WebCore::V8WorkerContextErrorHandler::V8WorkerContextErrorHandler):
+        (WebCore::V8WorkerContextErrorHandler::callListenerFunction):
+        * bindings/v8/V8WorkerContextErrorHandler.h: Added.
+        (WebCore::V8WorkerContextErrorHandler::create):
+        * bindings/v8/V8WorkerContextEventListener.cpp:
+        * bindings/v8/V8WorkerContextEventListener.h:
+        * dom/EventListener.h:
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::WorkerContext):
+        (WebCore::WorkerContext::reportException):
+        * workers/WorkerContext.h:
+
+2010-04-06  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: reverting v8 change at r57079 for crashing Chromium layout tests.
+
+2010-04-05  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Darin Adler.
+
+        RenderProgress.cpp is missing CurrentTime.h
+        https://bugs.webkit.org/show_bug.cgi?id=37080
+
+        No new tests. just fixed compilation error.
+
+        * rendering/RenderProgress.cpp:
+
+
+2010-04-05  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        window.openDatabase() always fails for new databases when using WebKit nightly with Safari 4.0.5
+        https://bugs.webkit.org/show_bug.cgi?id=36671
+
+        The previous "fix" I mistakenly compared hashes, an improvement over comparing pointers, but still not right.
+
+        No new tests.
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): Use SecurityOrigin::equal to compare instead of SecurityOriginHash.
+
+2010-04-05  Anthony Ricaud  <rik@webkit.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Audits launcher view is unusable with a small height window
+        https://bugs.webkit.org/show_bug.cgi?id=37109
+
+        Use flex box instead of absolute positioning to avoid overlapping elements.
+
+        * inspector/front-end/AuditLauncherView.js:
+        (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+        * inspector/front-end/audits.css:
+        (.audit-launcher-view .audit-launcher-view-content):
+        (.audit-launcher-view div.button-container):
+        (.audit-launcher-view .flexible-space):
+
+2010-04-05  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - wrong spelling
+        https://bugs.webkit.org/show_bug.cgi?id=37110
+
+        Correcting wrong spelling in RenderThemeQt.cpp.
+
+        * platform/qt/RenderThemeQt.cpp:
+
+2010-04-05  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL-specific code to platform/Platform*Event.h.
+        http://webkit.org/b/36309
+
+        * platform/PlatformWheelEvent.h:
+        * platform/PlatformMouseEvent.h:
+        * platform/PlatformKeyboardEvent.h:
+
+2010-04-05  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL-specific code to platform/graphics/*.h.
+        http://webkit.org/b/36308
+
+        * platform/graphics/Icon.h:
+        * platform/graphics/IntRect.h:
+        * platform/graphics/FloatRect.h:
+        * platform/graphics/IntPoint.h:
+
+2010-04-05  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix infinite redirection loop in QNetworkReplyHandler
+
+        Put a maximum on consecutive redirections so we don't have to
+        worry about whether it's the same url or not.
+
+        Tolerate up to 10 consecutive redirections, anything beyond
+        that is considered a potentially infinite recursion in the
+        redirection requests. This is the same behaviour as Firefox.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37097
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+        (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+        * platform/network/qt/QNetworkReplyHandler.h:
+
+2010-04-05  Dimitri Glazkov  <dglazkov@chromium.org> and James Robinson <jamesr@chromium.org>
+
+        Reviewed by Darin Adler and Dimitri Glazkov.
+
+        Style update done due to mutation event dispatching in textarea can be
+        used to corrupt the render tree.
+        https://bugs.webkit.org/show_bug.cgi?id=36864
+
+        Tests: fast/forms/select-change-listbox-to-popup-roundtrip.html
+               fast/forms/select-change-popup-to-listbox-roundtrip.html
+               fast/forms/textarea-and-mutation-events.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::finishedParsing): Added updateStyleIfNeeded()
+            call to ensure that object loads start before firing window load.
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent): Removed invocation of
+            Document::updateStyleForAllDocuments
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute): Added explicit
+            recalc to ensure accuracy of representation, especially for
+            menuList/listBox switches.
+
+2010-04-05  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Laszlo Gombos.
+
+        Cleaned up spatial-navigation-test-cases.html by removing the wrongly
+        used <frameset> tag.
+
+        Patch also adds a manual-test specifically to test Spatial Navigation with framesets.
+
+        * manual-tests/spatial-navigation/frameset.html: Added.
+        * manual-tests/spatial-navigation/spatial-navigation-test-cases.html:
+
+2010-04-05  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Roll out r56989 as it introduced crashes in Mail.
+        <http://webkit.org/b/37115> / <rdar://problem/7829331>
+
+        * dom/Position.cpp:
+        (WebCore::Position::isCandidate):
+        * dom/PositionIterator.cpp:
+        (WebCore::PositionIterator::isCandidate):
+
+2010-04-05  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Images must re-load when an image-holding element moves into a new document
+        https://bugs.webkit.org/show_bug.cgi?id=37127
+
+        Test: fast/images/move-image-to-new-document.html
+
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::willMoveToNewOwnerDocument): Call ImageLoader's
+        elementWillMoveToNewOwnerDocument function.
+        * html/HTMLImageElement.h: Added willMoveToNewOwnerDocument.
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::willMoveToNewOwnerDocument): Ditto.
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::willMoveToNewOwnerDocument): Ditto.
+        * html/HTMLPlugInImageElement.h: Ditto.
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::willMoveToNewOwnerDocument): Ditto.
+        * html/HTMLVideoElement.h: Ditto.
+        * svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::willMoveToNewOwnerDocument): Ditto.
+        * svg/SVGImageElement.h: Ditto.
+
+        * html/HTMLMediaElement.h: Made willMoveToNewOwnerDocument protected
+        so it can be called by HTMLVideoElement.cpp.
+
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::elementWillMoveToNewOwnerDocument): Added.
+        Resets the loader by clearing out the cached image.
+        * loader/ImageLoader.h: Added it.
+
+2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Symbian] Consolidate Symbian WINSCW environment configuration
+        https://bugs.webkit.org/show_bug.cgi?id=37100
+
+        Move the "undefinition" of WIN32 and _WIN32 from WebCore/config.h
+        to JavaScriptCore/wtf/Platform.h as it is not specific to WebCore.
+
+        No new tests as there is no new functionality.
+
+        * config.h:
+
+2010-04-05  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add missing ClipboardEfl.h to platform/efl.
+        http://webkit.org/b/36242
+
+        * platform/efl/ClipboardEfl.h: Added.
+
+2010-04-05  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Escape control characters in CSS string value when it is serialilzed.
+
+        When WebKit serializes a CSS string value that contains binary characters
+        ('\0\1\2' for example), it did not escape these characters. As a result,
+        users got (invisible) control characters through scripts. This change fixes
+        this issue.
+
+        As a side effect, two separate codes for escaping CSS strings are merged, and
+        become a public function (quoteCSSString).
+
+        CSS string value is not correctly serialized when it contains binary characters
+        https://bugs.webkit.org/show_bug.cgi?id=28938
+
+        Test: fast/css/string-quote-binary.html
+
+        * css/CSSParser.cpp:
+        (WebCore::isCSSTokenizerIdentifier):
+        (WebCore::isCSSTokenizerURL):
+        (WebCore::quoteCSSString):
+        (WebCore::quoteCSSStringIfNeeded):
+        (WebCore::quoteCSSURLIfNeeded):
+        * css/CSSParser.h:
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::cssText):
+        * css/FontFamilyValue.cpp:
+        (WebCore::FontFamilyValue::cssText):
+
+2010-04-05  John Gregg  <johnnyg@google.com>
+
+        Reviewed by Darin Adler.
+
+        Notifications should not resolve an empty icon parameter as a relative URL
+        https://bugs.webkit.org/show_bug.cgi?id=36862
+
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+
+2010-04-05  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Removed some unneeded type casts.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::cssText): Removed an unneeded cast.
+        * page/Location.cpp:
+        (WebCore::Location::host): Removed unneeded parentheses and cast.
+        (WebCore::Location::port): Ditto.
+        * platform/KURLGoogle.cpp:
+        (WebCore::KURL::setPort): Ditto.
+        * workers/WorkerLocation.cpp:
+        (WebCore::WorkerLocation::host): Ditto.
+        (WebCore::WorkerLocation::port): Ditto.
+
+2010-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57081.
+        http://trac.webkit.org/changeset/57081
+        https://bugs.webkit.org/show_bug.cgi?id=37121
+
+        We think it triggered two tests to fail on Tiger because of
+        race conditions (Requested by abarth on #webkit).
+
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute):
+
+2010-04-05  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        ASSERT close()ing the same StorageAreaImpl twice when using multiple PageGroups
+        <rdar://problem/7828420> and https://bugs.webkit.org/show_bug.cgi?id=37120
+
+        No new tests. (No behavior change)
+
+        * storage/StorageNamespaceImpl.cpp:
+        (WebCore::StorageNamespaceImpl::close): Change this invalid ASSERT to an early return.
+
+2010-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57030.
+        http://trac.webkit.org/changeset/57030
+        https://bugs.webkit.org/show_bug.cgi?id=37114
+
+        Regressed fast/repaint/line-flow-with-floats-9 pixel tests in
+        chromium port (Requested by jamesr on #webkit).
+
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren):
+
+2010-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        * page/mac/WebCoreViewFactory.h:
+        * platform/LocalizedStrings.h:
+        * platform/mac/LocalizedStringsMac.mm:
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        * platform/qt/Localizations.cpp:
+        * platform/wx/LocalizedStringsWx.cpp:
+        Added a localizable string for plug-in failure (only used on Mac at the moment).
+
+        * WebCore.xcodeproj/project.pbxproj: Made RenderEmbeddedObject.h (and dependencies) private,
+        since it's now used from WebKit.
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::RenderEmbeddedObject):m Removed m_showsMissingPluginIndicator
+        initializer.
+        (WebCore::RenderEmbeddedObject::updateWidget): Check m_replacementText instead of the removed
+        m_showsMissingPluginIndicator.
+        (WebCore::RenderEmbeddedObject::setShowsMissingPluginIndicator): Load m_replacementText.
+        (WebCore::RenderEmbeddedObject::setShowsCrashedPluginIndicator): Ditto.
+        (WebCore::RenderEmbeddedObject::paint): Check m_replacementText instead of the removed
+        m_showsMissingPluginIndicator.
+        (WebCore::RenderEmbeddedObject::paintReplaced): Draw arbitrary text from m_replacementText
+        insted of just "Missing Plug-in". Renamed constants and variables accordingly.
+
+        * rendering/RenderEmbeddedObject.h: Changed boolean for missing plug-in to a String holding
+        actual replacement text.
+
+        * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadPlugin): Adapted for the change in
+        setShowsMissingPluginIndicator(), which no longer takes an argument.
+
+        * WebCore/WebCore.base.exp: Exported RenderEmbeddedObject::setShowsCrashedPluginIndicator().
+
+2010-04-05  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 37040 - AX: need to send selected children change notification when aria-selected changed
+        https://bugs.webkit.org/show_bug.cgi?id=37040
+
+        When aria-selected is changed in the DOM, it will trigger a selected children change notification. 
+
+        Test: platform/mac/accessibility/aria-listbox-selectedchildren-change.html
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::selectedChildrenChanged):
+        * accessibility/AXObjectCache.h:
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::controlType):
+            Remove extra whitespace before comment (webkit-style).
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::observableObject):
+            Allowed a listBox to be an observable object.
+        (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren):
+        (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
+            Updated and streamlined existing code.
+        * dom/Element.cpp:
+        (WebCore::Element::updateAfterAttributeChanged):
+
+2010-04-05  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Darin Adler.
+
+        Fix regression in pixel test for animated svg background images.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37027
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImageChromeClient::invalidateContentsAndWindow):
+
+2010-04-05  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Kenneth Rohde-Christiansen.
+
+        [Qt] Fix infinite redirection loop in QNetworkReplyHandler
+
+        Qt enters an infinite loop if a redirect response redirects to itself.
+
+        Fixes http/tests/xmlhttprequest/connection-error-sync.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=37097
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+
+2010-04-05  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed, revert r57078.
+
+        * Android.jscbindings.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::reportError):
+        * bindings/js/JSEventListener.h:
+        * bindings/js/JSWorkerContextErrorHandler.cpp: Removed.
+        * bindings/js/JSWorkerContextErrorHandler.h: Removed.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8WorkerContextErrorHandler.cpp: Removed.
+        * bindings/v8/V8WorkerContextErrorHandler.h: Removed.
+        * bindings/v8/V8WorkerContextEventListener.cpp:
+        (WebCore::V8WorkerContextEventListener::reportError):
+        * bindings/v8/V8WorkerContextEventListener.h:
+        * dom/EventListener.h:
+        (WebCore::EventListener::reportError):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::WorkerContext):
+        (WebCore::WorkerContext::reportException):
+        * workers/WorkerContext.h:
+
+2010-04-05  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Style update done due to mutation event dispatching in textarea can be
+        used to corrupt the render tree.
+        https://bugs.webkit.org/show_bug.cgi?id=36864
+
+        Tests: fast/forms/select-change-listbox-to-popup-roundtrip.html
+               fast/forms/select-change-popup-to-listbox-roundtrip.html
+               fast/forms/textarea-and-mutation-events.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent): Removed invocation of
+            Document::updateStyleForAllDocuments
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute): Added explicit
+            recalc to ensure accuracy of representation, especially for
+            menuList/listBox switches.
+
+2010-04-01  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Dave Hyatt.
+
+        iframe flattening doesn't flatten
+        https://bugs.webkit.org/show_bug.cgi?id=36798
+
+        Fixed to the iframe flattening code so that the iframes on
+        http://www.samisite.com/test-csb2nf/id43.htm are actually
+        flattened.
+
+        Covered by current tests.
+
+        * page/FrameView.cpp: Propagate contents changes of iframes
+        and subframes in framesets to the parent so that it is relayouted
+        (WebCore::FrameView::setContentsSize):
+        (WebCore::FrameView::adjustViewSize):
+        (WebCore::FrameView::scheduleRelayout):
+        * rendering/RenderPart.cpp: HTMLIFrameElement do not inherit from
+        HTMLFrameElement, but HTMLFrameElementBase, correct cast. Correct
+        the use of inset border values. Avoid a sometimes unnecessary
+        relayout.
+        (WebCore::RenderPart::layoutWithFlattening):
+        * rendering/RenderPartObject.cpp: Make the calcHeight and calcWidth
+        return the right values, considering scrolling and fixed width/height
+        (WebCore::RenderPartObject::flattenFrame):
+        (WebCore::RenderPartObject::calcHeight):
+        (WebCore::RenderPartObject::calcWidth):
+        (WebCore::RenderPartObject::layout):
+
+2010-04-05  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        [V8] Extend the set of types supported by SerializedScriptValue
+        https://bugs.webkit.org/show_bug.cgi?id=37052
+
+        New types include sparse arrays, Uint32, Date, and ImageData.
+
+        Serialization process became more flexible. A state can either
+        directly write primitive values (instead of returning them like
+        iterator) or construct a new state for serializing complex values
+        that will return to the current state when done.
+
+        Deserialization process now avoids exposing the tags using a set
+        of factory functions for complex objects instead.
+
+        Internal buffer type changed to uint8_t to be independent of
+        whether char is signed or not.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::):
+        (WebCore::Writer::Writer):
+        (WebCore::Writer::writeString):
+        (WebCore::Writer::writeUint32):
+        (WebCore::Writer::writeDate):
+        (WebCore::Writer::writeNumber):
+        (WebCore::Writer::writeImageData):
+        (WebCore::Writer::writeArray):
+        (WebCore::Writer::writeObject):
+        (WebCore::Writer::writeSparseArray):
+        (WebCore::Writer::doWriteUint32):
+        (WebCore::Writer::doWriteNumber):
+        (WebCore::Writer::append):
+        (WebCore::Writer::fillHole):
+        (WebCore::Writer::byteAt):
+        (WebCore::Serializer::Serializer):
+        (WebCore::Serializer::serialize):
+        (WebCore::Serializer::writeArray):
+        (WebCore::Serializer::writeObject):
+        (WebCore::Serializer::writeSparseArray):
+        (WebCore::Serializer::StateBase::StateBase):
+        (WebCore::Serializer::ErrorState::ErrorState):
+        (WebCore::Serializer::ErrorState::advance):
+        (WebCore::Serializer::State::composite):
+        (WebCore::Serializer::State::State):
+        (WebCore::Serializer::ArrayState::ArrayState):
+        (WebCore::Serializer::ArrayState::advance):
+        (WebCore::Serializer::AbstractObjectState::AbstractObjectState):
+        (WebCore::Serializer::AbstractObjectState::advance):
+        (WebCore::Serializer::ObjectState::ObjectState):
+        (WebCore::Serializer::ObjectState::objectDone):
+        (WebCore::Serializer::SparseArrayState::SparseArrayState):
+        (WebCore::Serializer::SparseArrayState::objectDone):
+        (WebCore::Serializer::push):
+        (WebCore::Serializer::pop):
+        (WebCore::Serializer::handleError):
+        (WebCore::Serializer::checkComposite):
+        (WebCore::Serializer::writeString):
+        (WebCore::Serializer::writeImageData):
+        (WebCore::Serializer::newArrayState):
+        (WebCore::Serializer::newObjectState):
+        (WebCore::Serializer::doSerialize):
+        (WebCore::Reader::Reader):
+        (WebCore::Reader::read):
+        (WebCore::Reader::readString):
+        (WebCore::Reader::readUint32):
+        (WebCore::Reader::readDate):
+        (WebCore::Reader::readNumber):
+        (WebCore::Reader::readImageData):
+        (WebCore::Reader::doReadUint32):
+        (WebCore::Reader::doReadNumber):
+        (WebCore::Deserializer::Deserializer):
+        (WebCore::Deserializer::createArray):
+        (WebCore::Deserializer::createObject):
+        (WebCore::Deserializer::createSparseArray):
+        (WebCore::Deserializer::initializeObject):
+        (WebCore::Deserializer::doDeserialize):
+        (WebCore::Deserializer::stackDepth):
+        (WebCore::SerializedScriptValue::deserialize):
+
+2010-04-05  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Refactored error reporting mechanizm on Worker Global Objects.
+        Unlike other event listeners which accept single argument(Event)
+        onerror handler on worker global object should be a function
+        accepting three arguments. This error reporting was implementedas
+        EventListener::reportError method which had custom implementations
+        for v8 and JSC. This patch removes EventListener::reportError and
+        moves its functionality into custom bindings(V8WorkerContextErrorHandler
+        and JSWorkerContextErrorHandler) that implement EventListener inerface
+        for the onerror handler.
+
+        This patch also makes uncaught exceptions that happen in the onerror
+        listener be reported to the Worker's onerror handler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36375
+
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventListener.cpp:
+        * bindings/js/JSEventListener.h:
+        * bindings/js/JSWorkerContextErrorHandler.cpp: Added.
+        (WebCore::JSWorkerContextErrorHandler::JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler):
+        (WebCore::JSWorkerContextErrorHandler::handleEvent):
+        * bindings/js/JSWorkerContextErrorHandler.h: Added.
+        (WebCore::JSWorkerContextErrorHandler::create):
+        (WebCore::createJSWorkerContextErrorHandler):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8WorkerContextErrorHandler.cpp: Added.
+        (WebCore::V8WorkerContextErrorHandler::V8WorkerContextErrorHandler):
+        (WebCore::V8WorkerContextErrorHandler::callListenerFunction):
+        * bindings/v8/V8WorkerContextErrorHandler.h: Added.
+        (WebCore::V8WorkerContextErrorHandler::create):
+        * bindings/v8/V8WorkerContextEventListener.cpp:
+        * bindings/v8/V8WorkerContextEventListener.h:
+        * dom/EventListener.h: Removed reportError method that was used only for reporting worker errors.
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::WorkerContext):
+        (WebCore::WorkerContext::reportException):
+        * workers/WorkerContext.h:
+
+2010-04-05  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Fix some  "explicit braces to avoid ambiguous 'else'" warnings
+        https://bugs.webkit.org/show_bug.cgi?id=37088
+
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::dispatchEvent):
+
+2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Consolidate the definition of SKIP_STATIC_CONSTRUCTORS_ON_GCC
+
+        Instead of defining and undefining it later, let's not
+        define SKIP_STATIC_CONSTRUCTORS_ON_GCC for WINSCW.
+
+        No new tests as there is no new functionality.
+
+        * config.h:
+
+2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] [Symbian] Remove obsolete build flags for Symbian
+        https://bugs.webkit.org/show_bug.cgi?id=37083
+
+        Symbian port of QtWebKit port does not use icu, so it does 
+        not need U_HAVE_* defines.
+
+        Symbian now has inttypes.h as part of OpenC.
+
+        stdio.h, limits.h and MathExtras.h are already included in
+        more appropriate locations.
+
+        No new tests as there is no new functionality.
+
+        * config.h:
+
+2010-04-05  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: chromium build fix.
+
+        * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+        (WebCore::V8InspectorFrontendHost::platformCallback):
+        (WebCore::V8InspectorFrontendHost::portCallback):
+
+2010-04-05  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: [REGRESSION] platform detection in Chromium
+        has regressed to unknown.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37081
+
+        * bindings/js/JSInspectorFrontendHostCustom.cpp:
+        (WebCore::JSInspectorFrontendHost::platform):
+        (WebCore::JSInspectorFrontendHost::port):
+        * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+        (WebCore::V8InspectorFrontendHost::platform):
+        (WebCore::V8InspectorFrontendHost::port):
+        * inspector/InspectorFrontendHost.cpp:
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+
+2010-04-05  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Remove logging of successful XHR and worker's importScript()
+        to inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=37078
+
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::importScripts):
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        (WebCore::V8WorkerContext::importScriptsCallback):
+        * workers/DedicatedWorkerContext.cpp:
+        (WebCore::DedicatedWorkerContext::importScripts):
+        * workers/DedicatedWorkerContext.h:
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::importScripts):
+        * workers/WorkerContext.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::didFinishLoading):
+
+2010-04-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Rolling out chromium changes r57028 and r57032
+        for breaking chromium layout tests.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/DragImageChromium.cpp: Added.
+        (WebCore::dragImageSize):
+        (WebCore::deleteDragImage):
+        (WebCore::scaleDragImage):
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        (WebCore::createDragImageIconForCachedImage):
+        * platform/chromium/DragImageChromiumMac.cpp: Removed.
+        * platform/chromium/DragImageChromiumSkia.cpp: Removed.
+        * platform/chromium/DragImageRef.h:
+
+2010-03-29  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Spatial Navigation: Initial code simplification in FocusController.cpp and SpatialNavigation.cpp
+
+        WebCore::distanceInDirection method was handling much of the logic not
+        strictly only related to the distance between nodes acquisition. This
+        method was simplified and renamed to 'WebCore::distanceDataForNode'.
+        The latter is now responsible for only getting the distance and alignment
+        data, while all assignement logic previously in distanceInDirection method
+        was moved place to updateFocusCandidateIfCloser.
+
+        Parent document distance and alignment acquisitions, in turn, have also
+        changed location: they are both got from deepFindFocusableNodeInDirection,
+        and passed in a recursive call to findFocusableNodeInDirection via the
+        candidateParent variable (optional parameter). In addition, the need for
+        the 'focusCandidateCopy' variable in deepFindFocusableNodeInDirection method
+        was removed, making the code much cleaner.
+
+        No behaviour change at this point. Mostly moving code around to the place
+        where it should live in.
+
+        * page/FocusController.cpp:
+        (WebCore::FocusController::advanceFocusDirectionally):
+        (WebCore::updateFocusCandidateIfCloser):
+        (WebCore::FocusController::findFocusableNodeInDirection):
+        (WebCore::FocusController::deepFindFocusableNodeInDirection):
+        * page/FocusController.h:
+        * page/SpatialNavigation.cpp:
+        (WebCore::distanceDataForNode):
+        (WebCore::renderRectRelativeToRootDocument):
+        * page/SpatialNavigation.h:
+
+2010-04-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: In the inherited styles, do not render non-inherited properties as overriden.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37072
+
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertiesSection.prototype.isPropertyOverloaded):
+
+2010-04-03  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Enable HTMLProgressElement for Safari on OSX
+        https://bugs.webkit.org/show_bug.cgi?id=36961
+
+        * Configurations/FeatureDefines.xcconfig:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
+        (WebCore::RenderThemeMac::animationDurationForProgressBar):
+        (WebCore::RenderThemeMac::adjustProgressBarStyle):
+        (WebCore::RenderThemeMac::paintProgressBar):
+
+2010-04-03  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Unreviewed.
+
+        Fix debug build with GCC >= 4.3.
+
+        * platform/graphics/GraphicsLayer.cpp: Include stdio.h explicitly.
+
+2010-04-03  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Inconsistent failure modes from uniform[Matrix]* with null WebGLUniformLocation
+        https://bugs.webkit.org/show_bug.cgi?id=36574
+
+        Fixed bugs in JavaScript bindings for uniform[Matrix]* entry
+        points causing them to throw exceptions rather than synthesize GL
+        errors. Fixed the implementations to synthesize INVALID_VALUE
+        rather than INVALID_OPERATION to comply to the WebGL spec. Updated
+        uniform-location-expected.txt to incorporate the correct error.
+        Tested in Safari and Chromium.
+
+        Test: fast/canvas/webgl/null-uniform-location.html
+
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::V8WebGLRenderingContext::getUniformCallback):
+        (WebCore::vertexAttribAndUniformHelperf):
+        (WebCore::uniformHelperi):
+        (WebCore::uniformMatrixHelper):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::uniform1f):
+        (WebCore::WebGLRenderingContext::uniform1fv):
+        (WebCore::WebGLRenderingContext::uniform1i):
+        (WebCore::WebGLRenderingContext::uniform1iv):
+        (WebCore::WebGLRenderingContext::uniform2f):
+        (WebCore::WebGLRenderingContext::uniform2fv):
+        (WebCore::WebGLRenderingContext::uniform2i):
+        (WebCore::WebGLRenderingContext::uniform2iv):
+        (WebCore::WebGLRenderingContext::uniform3f):
+        (WebCore::WebGLRenderingContext::uniform3fv):
+        (WebCore::WebGLRenderingContext::uniform3i):
+        (WebCore::WebGLRenderingContext::uniform3iv):
+        (WebCore::WebGLRenderingContext::uniform4f):
+        (WebCore::WebGLRenderingContext::uniform4fv):
+        (WebCore::WebGLRenderingContext::uniform4i):
+        (WebCore::WebGLRenderingContext::uniform4iv):
+        (WebCore::WebGLRenderingContext::uniformMatrix2fv):
+        (WebCore::WebGLRenderingContext::uniformMatrix3fv):
+        (WebCore::WebGLRenderingContext::uniformMatrix4fv):
+
+2010-04-02  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Adam Barth.
+
+        The previous mechanism for testing whether an event was due to a user
+        gesture only checked the event type, not the source of the event.  This
+        allowed scripts to defeat popup blocking by programatically emitting
+        certain types of events.
+
+        Change the user gesture detection to check for a flag that is only set
+        when the event in question was generated through the platform and not
+        through the DOM.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37008
+
+        Tests: fast/events/popup-allowed-from-gesture-initiated-event.html
+               fast/events/popup-blocked-from-fake-button-click.html
+               fast/events/popup-blocked-from-fake-focus.html
+
+        * Android.mk: Add UserGestureIndicator.{cpp, h}.
+        * GNUmakefile.am: Same.
+        * WebCore.gypi: Same.
+        * WebCore.pro: Same.
+        * WebCore.vcproj/WebCore.vcproj: Same.
+        * WebCore.xcodeproj/project.pbxproj: Same.
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::processingUserGesture): Check the value of
+        UserGesureIndicator::processingUserGesture().
+        * dom/Document.cpp:
+        (WebCore::Document::createEvent): Remove call to
+        Event::setCreatedByDOM().
+        * dom/Event.cpp:
+        (WebCore::Event::Event): Remove initializers for m_createdByDOM.
+        (WebCore::Event::fromUserGesture): Check the value of
+        UserGestureIndicator::processingUserGesture().
+        * dom/Event.h: Remove m_createdByDOM.
+        * dom/UserGestureIndicator.cpp: Added.
+        (WebCore::UserGestureIndicator::UserGestureIndicator): Save the previous
+        value of s_processingUserGesture before setting it to true.
+        (WebCore::UserGestureIndicator::~UserGestureIndicator): Restore
+        s_processingUserGesture to its previous value.
+        * dom/UserGestureIndicator.h: Added.
+        (WebCore::UserGestureIndicator::processingUserGesture): Return the value
+        of s_processingUserGesture.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent): Instantiate a
+        UserGestureIndicator object on the stack to indicate a user gesture is
+        being processed.
+        (WebCore::EventHandler::handleMouseDoubleClickEvent): Same.
+        (WebCore::EventHandler::handleMouseReleaseEvent): Same.
+        (WebCore::EventHandler::keyEvent): Same.
+        (WebCore::EventHandler::handleTouchEvent): Same.
+
+2010-04-02  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        XHR allows arbitrary XSRF across domains 
+        https://bugs.webkit.org/show_bug.cgi?id=36843
+
+        Added a one-line change to prevent bypassing the XDC check on
+        synchronous preflighted requests. Added layout tests to cover
+        variations of this problem.
+
+        Tests: http/tests/xmlhttprequest/access-control-preflight-async-header-denied.html
+               http/tests/xmlhttprequest/access-control-preflight-async-method-denied.html
+               http/tests/xmlhttprequest/access-control-preflight-sync-header-denied.html
+               http/tests/xmlhttprequest/access-control-preflight-sync-method-denied.html
+
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::preflightFailure):
+
+2010-04-02  Nayan Kumar K  <nayankk@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        Fix for WML enabled build failure.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36648
+
+        * wml/WMLOptionElement.cpp:
+        (WebCore::WMLOptionElement::disabled):
+        * wml/WMLOptionElement.h:
+        * wml/WMLSelectElement.cpp:
+        (WebCore::WMLSelectElement::listBoxSelectItem):
+        * wml/WMLSelectElement.h:
+
+2010-04-02  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37011
+        Position::primaryDirection() should not use its own accessor.
+
+        No new tests. This is small clenaup with no behaviour change.
+
+        * dom/Position.cpp:
+        (WebCore::Position::primaryDirection):
+
+2010-04-02  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        window.openDatabase() always fails for new databases when using WebKit nightly with Safari 4.0.5.  This is caused by a SecurityOrigin pointer comparison that I should have switched to be a hash comparison in r56293 [bug 34991].
+        https://bugs.webkit.org/show_bug.cgi?id=36671
+
+        No new tests.  Requires testing on Safari on Windows.
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): Convert a pointer comparison to use SecurityOriginHash::hash() instead, and move it to the end of the clause for speed in the easy-out case.
+
+2010-04-02  Michael Nordman  <michaeln@google.com>
+
+        Reviewed by Nate Chapin.
+
+        Set the close policy used by the DatabaseCloseTask in a constructor argument
+        instead of hard coding it.
+        https://bugs.webkit.org/show_bug.cgi?id=37037
+
+        No new tests, new new functionality.
+
+        * storage/Database.cpp: This callsite passes in DoNotRemoveFromDatabaseContext to retain its current behavior.
+        (WebCore::Database::markAsDeletedAndClose):
+        * storage/DatabaseTask.cpp:
+        (WebCore::DatabaseCloseTask::DatabaseCloseTask):
+        (WebCore::DatabaseCloseTask::doPerformTask):
+        * storage/DatabaseTask.h:
+        (WebCore::DatabaseCloseTask::create):
+
+2010-04-02  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Remove an ASSERT that sometimes flakes due to time dependent animations
+        https://bugs.webkit.org/show_bug.cgi?id=37048
+
+        The outline repaint rectangle for a layer might change between two calls
+        if there are animations involved, even if nothing in the DOM has actually
+        changed between the calls.
+
+        No change in behavior, no new tests.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+
+2010-04-02  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [chromium] need DragImage implementation
+        https://bugs.webkit.org/show_bug.cgi?id=35811
+
+        Add two files that failed to get added in my previous patch.
+
+        * platform/chromium/DragImageChromiumMac.cpp: Added.
+        (WebCore::dragImageSize):
+        (WebCore::deleteDragImage):
+        (WebCore::scaleDragImage):
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        (WebCore::createDragImageIconForCachedImage):
+        * platform/chromium/DragImageChromiumSkia.cpp: Added.
+        (WebCore::dragImageSize):
+        (WebCore::deleteDragImage):
+        (WebCore::scaleDragImage):
+        (WebCore::dissolveDragImageToFraction):
+        (WebCore::createDragImageFromImage):
+        (WebCore::createDragImageIconForCachedImage):
+
+2010-04-02  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        Configure multi-language movies: when QuickTime has sufficiently loaded
+        the movie, call into wkQTMovieSelectPreferredAlternates to select the
+        movie's alternate tracks according to the user's language preferences.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36624
+
+        * WebCore.base.exp:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 
+        (WebCore::MediaPlayerPrivate::updateStates): If the movie is sufficiently loaded,
+        call wkQTMovieSelectPreferredAlternates to set up the alternate tracks.
+        * platform/mac/WebCoreSystemInterface.h: Declare WKQTMovieSelectPreferredAlternates.
+        * platform/mac/WebCoreSystemInterface.mm: Add WKQTMovieSelectPreferredAlternates.
+
+2010-04-02  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Splits RenderBlock::layoutInline into smaller functions
+        https://bugs.webkit.org/show_bug.cgi?id=36921
+
+        RenderBlock::layoutInlineChildren is 351 lines long and very difficult
+        to comprehend or edit safely. This patch splits it up into a few
+        slightly smaller functions.  Most of the code is now in the 241 line
+        layoutRunsAndFloats() which is a slight improvement.
+
+        Perf neutral on the page cyclers.  This doesn't introduce any function
+        calls into the hottest layout paths inside layoutRunsAndFloats and
+        findNextLineBreak.
+
+        No change in behavior, no new tests.
+
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::FloatWithRect::FloatWithRect):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutReplacedElements):
+        (WebCore::RenderBlock::createLineBoxesForResolver):
+        (WebCore::RenderBlock::layoutRunsAndFloats):
+        (WebCore::RenderBlock::layoutInlineChildren):
+
+2010-04-02  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] need DragImage implementation
+        https://bugs.webkit.org/show_bug.cgi?id=35811
+
+        Basic implementation using SkBitmap. Transformations are not supported
+        yet. No implementation for mac.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/DragImageChromium.cpp:
+        * platform/chromium/DragImageRef.h:
+
+2010-04-02  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] font fallback for generic fonts picks wrong font
+        https://bugs.webkit.org/show_bug.cgi?id=37033
+
+        When a page specifies the generic "monospace" font and the user's
+        browser-configured monospace font doesn't exist, we previously relied
+        on getLastResortFallbackFont to eventually pick a monospace font for us.
+
+        But that doesn't quite work: WebKit first falls back to the user's
+        "preferred standard font" before hitting the last resort code path.
+        So if the above conditions hold but this font exists, we'll end up
+        never hitting the last resort codepath.
+
+        The fix is to allow OS-level font fallback when first attempting to
+        resolve monospace.  The existing code tried to do this, but the logic
+        was wrong.  We would eventually fall back to the correct font anyway
+        so we didn't notice the logic was wrong.
+
+        This code is all handling cases where particular fonts aren't installed,
+        so I can't think of a way to test it; existing tests should still pass.
+
+        * platform/graphics/chromium/FontCacheLinux.cpp:
+        (WebCore::FontCache::createFontPlatformData):
+
+2010-04-02  Andrew Scherkus  <scherkus@chromium.org>
+
+        Reviewed by Eric Carlson and Eric Seidel.
+
+        Don't stop the playback event timer when media resource loading has suspended.
+        https://bugs.webkit.org/show_bug.cgi?id=37003
+
+        When a user agent decides to suspend media resource loading and enters the
+        NETWORK_IDLE state we are supposed to only stop the progress event timer but
+        keep the playback timer running.
+
+        Test: http/tests/media/video-play-suspend.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setNetworkState): Only stop the progress event timer.
+
+2010-04-02  Darin Adler  <darin@apple.com>
+
+        Fix mispelling that broke the build.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        * html/canvas/CanvasRenderingContext2D.h:
+        Dashbard -> Dashboard.
+
+2010-04-02  David Levin  <levin@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        (non-generated) code should only use CanvasRenderingContext::canvas as a CanvasSurface.
+        https://bugs.webkit.org/show_bug.cgi?id=36906
+
+        * dom/CanvasSurface.cpp: Added methods for items that depended on
+        CanvasRenderingContext::canvas() being an HTMLElement(), so that this usage
+        can be dealt with in one place.
+        (WebCore::CanvasSurface::securityOrigin): Only used by methods that are
+        only run in the document context.
+        (WebCore::CanvasSurface::renderBox): Will likely return 0 in a worker context.
+        (WebCore::CanvasSurface::computedStyle): Used by setFont. Return value is TBD for
+        the worker context.
+        (WebCore::CanvasSurface::styleSelector): Ditto.
+        * dom/CanvasSurface.h:
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext): Passing in information into
+        the CanvasRenderingContext2D constructor to eliminate some uses of document
+        inside of the CanvasRenderingContext2D class.
+        * html/HTMLCanvasElement.h:
+        (WebCore::HTMLCanvasElement::renderBox): Added to disambiguate between the
+        two parent class versions of the method.
+        (WebCore::HTMLCanvasElement::computedStyle): Ditto.
+        * html/canvas/CanvasRenderingContext2D.cpp: All of these changes are about
+        removing document usage either by using a bool that is set in the constructor or
+        by calling one of the new methods added to CanvasSurface.
+        (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
+        (WebCore::CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode):
+        (WebCore::CanvasRenderingContext2D::checkOrigin):
+        (WebCore::CanvasRenderingContext2D::prepareGradientForDashboard):
+        (WebCore::CanvasRenderingContext2D::createPattern):
+        (WebCore::CanvasRenderingContext2D::setFont):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * html/canvas/CanvasRenderingContext2D.h:
+        * html/canvas/WebGLRenderingContext.cpp: Removed some duplicate includes.
+        (WebCore::WebGLRenderingContext::markContextChanged): Reduced calls to renderBox
+         as it may become slightly more expensive in the future.
+        (WebCore::WebGLRenderingContext::reshape): Ditto.
+
+2010-04-02  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Eric Seidel.
+
+        Implement and test new framebuffer object attachment behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=35611
+
+        Test: fast/canvas/webgl/framebuffer-object-attachment.html
+
+        * html/canvas/WebGLFramebuffer.cpp: Keep track of attached stencil/depth renderbuffers in WebGLFramebuffer.
+        (WebCore::WebGLFramebuffer::WebGLFramebuffer):
+        (WebCore::WebGLFramebuffer::setIsAttached):
+        * html/canvas/WebGLFramebuffer.h: Ditto.
+        (WebCore::WebGLFramebuffer::isDepthAttached):
+        (WebCore::WebGLFramebuffer::isStencilAttached):
+        (WebCore::WebGLFramebuffer::isDepthStencilAttached):
+        * html/canvas/WebGLRenderbuffer.cpp: Keep track of internalformat.
+        (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
+        * html/canvas/WebGLRenderbuffer.h: Ditto.
+        (WebCore::WebGLRenderbuffer::setInternalformat):
+        (WebCore::WebGLRenderbuffer::getInternalformat):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::framebufferRenderbuffer): Detect stencil/depth buffer conflicts.
+        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Handling DEPTH_STENCIL case.
+        (WebCore::WebGLRenderingContext::getRenderbufferParameter): Get correct WebGL internalformat.
+        (WebCore::WebGLRenderingContext::renderbufferStorage): Detect illegal enums.
+        * html/canvas/WebGLRenderingContext.idl: Add DEPTH_STENCIL enums.
+        * platform/graphics/GraphicsContext3D.h: Add DEPTH_STENCIL enums.
+        (WebCore::GraphicsContext3D::):
+        * platform/graphics/mac/GraphicsContext3DMac.cpp: Map to correct DEPTH_STENCIL format.
+        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+
+2010-04-02  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Form control state shouldn't be restored for hidden inputs.
+        https://bugs.webkit.org/show_bug.cgi?id=26241
+
+        To fix this issue, we don't save values if it is not changed from
+        the default value.
+
+        Updating the value IDL attribute of some controls such as
+        type=hidden also updates the value content attribute, and it's
+        impossible to distinguish the initial value and the current
+        value. The values of such controls are not saved. It won't be a
+        problem because we want to save and restore user-edited values.
+
+        Test: fast/forms/state-restore-to-non-edited-controls.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::saveFormControlState):
+          Do not save the value if it is same as the default value.
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::saveFormControlState): ditto.
+
+2010-04-02  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Forms with autocomplete=off should not consume saved state
+        https://bugs.webkit.org/show_bug.cgi?id=36762
+        
+        Introduce Element::shouldSaveAndRestoreFormControlState() to check
+        if we should save and restore control state.
+
+        Test: fast/forms/state-restore-to-non-autocomplete-form.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::formElementsState): Check shouldSaveAndRestoreFormControlState().
+        * dom/Element.h:
+        (WebCore::Element::shouldSaveAndRestoreFormControlState): Added. It just returns true.
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElementWithState::autoComplete):
+          Added. It return autocomplete state of the form.
+        (WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
+          Added. It returns the result of autoComplete().
+        (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
+          Do not restore state if shouldSaveAndRestoreFormControlState() is false.
+        * html/HTMLFormControlElement.h: Declare autoComplete() and overriding methods.
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::autoComplete):
+          Reduce code by using autoComplete() of the parent class.
+        (WebCore::HTMLInputElement::saveFormControlState):
+          Remove the autoComplete() check. Document::formElementsState() does equivalent check.
+
+2010-04-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Very bad scrolling-performance with the Trackpad at http://www.apple.com/ipad/app-store/
+        https://bugs.webkit.org/show_bug.cgi?id=36978
+
+        When we update compositing layers (which can happen on scrolling, when there are fixed position elements
+        on the page), we can end up redundantly setting images as layer contents if we have to color-correct
+        the image. This is because we call CGImageCreateCopyWithColorSpace(), which hands back a new image
+        every time.
+        
+        Avoid this by storing a reference to the original uncorrected image, which is used to then
+        avoid work if the image does not change.
+
+        * platform/graphics/mac/GraphicsLayerCA.h:
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::GraphicsLayerCA::setContentsToImage):
+
+2010-04-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Avoid doing work in FrameView::scrollPositionChanged() if there are no fixed position elements
+        https://bugs.webkit.org/show_bug.cgi?id=36994
+        
+        r55890 added knowledge to FrameView about whether it contains any fixed-position elements. We can
+        use this to avoid updating widget positions, and compositing layer positions when possible.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollPositionChanged):
+        * page/FrameView.h:
+        (WebCore::FrameView::hasFixedObjects):
+
+2010-04-02  Nate Chapin  <japhet@chromium.org>
+
+        Rubber-stamped by Dimitri Glazkov.
+
+        http://trac.webkit.org/changeset/57004 caused
+        fast/dom/console-log-stack-overflow.html to fail for Chromium.
+        Add check for empty wrappers before using them to create a hidden reference.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+
+2010-04-01  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Generalize (and generate!) the creation of hidden references
+        between JS wrappers.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=36777
+
+        * Android.v8bindings.mk:
+        * WebCore.gypi:
+        * bindings/scripts/CodeGeneratorV8.pm: Generate calls to setHiddenReference() in
+        attribute getters.
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::setHiddenReference): Split common logic out of hidden setHiddenWindowReference
+        (WebCore::V8DOMWrapper::setHiddenWindowReference): Now contains logic specific to putting a 
+        hidden reference on a global object.
+        (WebCore::globalObjectPrototypeIsDOMWindow): Be more thorough in the COMPILE_ASSERTs.
+        (WebCore::V8DOMWrapper::convertEventTargetToV8Object): Cleanup: Remove a duplicate if statement.
+        * bindings/v8/V8DOMWrapper.h:
+        * bindings/v8/WrapperTypeInfo.h:
+        * bindings/v8/custom/V8BarInfoCustom.cpp: Removed.
+        * bindings/v8/custom/V8CSSStyleSheetCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8DOMSelectionCustom.cpp: Removed.
+        * bindings/v8/custom/V8HistoryCustom.cpp:
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        * bindings/v8/custom/V8MessageChannelConstructor.cpp:
+        (WebCore::V8MessageChannel::constructorCallback):
+        * bindings/v8/custom/V8NamedNodeMapCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8NavigatorCustom.cpp: Removed.
+        * bindings/v8/custom/V8ScreenCustom.cpp: Removed.
+        * bindings/v8/custom/V8StyleSheetCustom.cpp:
+        (WebCore::toV8):
+        * loader/appcache/DOMApplicationCache.h:
+        (WebCore::DOMApplicationCache::frame): Add frame() accessor.
+
+
+2010-04-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: start editing DOM and styles on click-and-pause.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36965
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype.onattach):
+        (WebInspector.ElementsTreeElement.prototype.selectOnMouseDown):
+        (WebInspector.ElementsTreeElement.prototype.ondblclick):
+        (WebInspector.ElementsTreeElement.prototype._handleClickAndPause):
+        (WebInspector.ElementsTreeElement.prototype._startEditingTarget):
+        (WebInspector.ElementsTreeElement.prototype._startEditingAttribute):
+        (WebInspector.ElementsTreeElement.prototype._startEditingTextNode):
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName):
+        (WebInspector.ElementsTreeElement.prototype._startEditingAsHTML):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertiesSection.prototype._handleEmptySpaceDoubleClick):
+        (WebInspector.StylePropertiesSection.prototype._handleSelectorClick):
+        (WebInspector.StylePropertiesSection.prototype._handleSelectorClickAndPause):
+        (WebInspector.StylePropertiesSection.prototype._handleSelectorDoubleClick):
+        (WebInspector.StylePropertiesSection.prototype._startEditingOnMouseEvent):
+        (WebInspector.StylePropertyTreeElement.prototype.onattach):
+        (WebInspector.StylePropertyTreeElement.prototype):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.js:
+        * inspector/front-end/treeoutline.js:
+        (TreeElement.prototype._attach):
+        (TreeElement.treeElementMouseDown):
+        (TreeElement.prototype.selectOnMouseDown):
+
+2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed build fix when building --no-svg.
+
+        Build fix after r56941. Add ENABLE(SVG) guard.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+
+2010-04-02  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Implement InspectorFrontendHost::showContextMenu for Chromium.
+ 
+        Move inspector frontend context menu code from InspectorFrontendClient to InspectorFrontendHost as it's platform independent.
+ 
+        https://bugs.webkit.org/show_bug.cgi?id=36817
+
+        * WebCore.Inspector.exp:
+        * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+        (WebCore::V8InspectorFrontendHost::showContextMenuCallback):
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::FrontendMenuProvider::create):
+        (WebCore::FrontendMenuProvider::disconnect):
+        (WebCore::FrontendMenuProvider::FrontendMenuProvider):
+        (WebCore::FrontendMenuProvider::~FrontendMenuProvider):
+        (WebCore::FrontendMenuProvider::populateContextMenu):
+        (WebCore::FrontendMenuProvider::contextMenuItemSelected):
+        (WebCore::FrontendMenuProvider::contextMenuCleared):
+        (WebCore::InspectorFrontendHost::InspectorFrontendHost):
+        (WebCore::InspectorFrontendHost::disconnectClient):
+        (WebCore::InspectorFrontendHost::showContextMenu):
+        * inspector/InspectorFrontendHost.h:
+        (WebCore::InspectorFrontendHost::create):
+
+2010-04-02  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        WebInspector: Timeline Overview pane should support short records filtering.
+        https://bugs.webkit.org/show_bug.cgi?id=37020
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/TimelineOverviewPane.js:
+        (WebInspector.TimelineOverviewPane.prototype.update.markTimeline):
+        (WebInspector.TimelineOverviewPane.prototype.update):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype.isLong):
+
+2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Accept XHTML-MP content type as XHTML content
+        https://bugs.webkit.org/show_bug.cgi?id=34262
+
+        Enable processing XHTML-MP mime type as an XHTML document
+        even if XHTML-MP support is not enabled.
+
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedNonImageMimeTypes):
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Daniel Bates.
+
+        Make XSSAuditor go fast with large POST data
+        https://bugs.webkit.org/show_bug.cgi?id=36694
+
+        There were two things slowing down this bechmark:
+
+        1) Searching the large POST data for each inline event handler.  To
+           make this faster, we now use a suffix tree to fast-reject strings
+           that don't appear as substrings of the POST data.
+
+        2) The next largest cost was flattening the form data into a string.
+           To make this fater, we now use the form data object itself as a key
+           and only flatten once.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::CachingURLCanonicalizer::canonicalizeURL):
+        (WebCore::XSSAuditor::CachingURLCanonicalizer::clear):
+        (WebCore::XSSAuditor::XSSAuditor):
+        (WebCore::XSSAuditor::findInRequest):
+        * page/XSSAuditor.h:
+        (WebCore::XSSAuditor::CachingURLCanonicalizer::CachingURLCanonicalizer):
+        (WebCore::XSSAuditor::CachingURLCanonicalizer::generation):
+        * platform/text/SuffixTree.h: Added.
+        (WebCore::UnicodeCodebook::codeWord):
+        (WebCore::UnicodeCodebook::):
+        (WebCore::ASCIICodebook::codeWord):
+        (WebCore::ASCIICodebook::):
+        (WebCore::SuffixTree::SuffixTree):
+        (WebCore::SuffixTree::mightContain):
+        (WebCore::SuffixTree::Node::Node):
+        (WebCore::SuffixTree::Node::~Node):
+        (WebCore::SuffixTree::Node::at):
+        (WebCore::SuffixTree::build):
+
+2010-04-02  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Bug 36741 -  Duplicate, slightly divergent implementation of Position[Iterator]::isCandidate()
+        https://bugs.webkit.org/show_bug.cgi?id=36741
+        
+        Patch: change Position::isCandididate() to call the PositionIterator::isCandidate() version.
+        Update PositionIterator::isCandidate() to mirror Position::isCandidate().
+
+        Rationale: PositionIterator::isCandidate() is called in a tight loop within
+        next/previousCandidate(). Also, creation of a PositionIterator from a Position
+        is cheaper than vice-versa.
+
+        Tests: ran all tests in 'editing'.
+
+        * dom/Position.cpp:
+        (WebCore::Position::isCandidate):
+        * dom/PositionIterator.cpp:
+        (WebCore::PositionIterator::isCandidate):
+
+2010-04-02  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Database code falsely returns errors due to errant pointer check
+        https://bugs.webkit.org/show_bug.cgi?id=37014
+
+        r56943 introduced a check to see if there were any unprocessed
+        SQL commands after calling sqlite3_prepare16_v2.
+
+        Accessing the remaining data via pointer wasn't possible since
+        the query string is deallocated immediately after the
+        query runs. The String returned from strippedWhiteSpace
+        goes out of scope at that point.
+
+        Fix is to store the strippedWhiteSpace in a temporary String
+        so we can access it via character ptr later in the function.
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::prepare):
+
+2010-04-01  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Darin Adler.
+
+        setting document.title doesn't change document.title value 
+        https://bugs.webkit.org/show_bug.cgi?id=36802
+
+        An entity of "value" argument on HTMLTitleElement::setTitle() could be
+        Document::m_title and be changed during HTMLTitleElement::setText(). 
+        Fix copying the argument to keep the original value.
+        
+        Test: fast/dom/Document/title-with-multiple-children.html
+
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::setText):
+
+2010-04-01  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - <select multiple> custom rendering
+        https://bugs.webkit.org/show_bug.cgi?id=36369
+
+        Customizing rendering of <select multiple> elements in Maemo5.
+
+        * platform/qt/Maemo5Webstyle.cpp:
+        (Maemo5WebStyle::drawMultipleComboButton):
+        (Maemo5WebStyle::drawSimpleComboButton):
+        (Maemo5WebStyle::getButtonImageSize):
+        (Maemo5WebStyle::findComboButton):
+        (Maemo5WebStyle::drawComplexControl):
+        * platform/qt/Maemo5Webstyle.h:
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add FileThread for async file operation support for FileReader and
+        FileWriter.  The patch also adds ENABLE_FILE_READER or
+        ENABLE_FILE_WRITER build flags/defines.  Both flags are disabled
+        by default.
+
+        No new tests, will add ones when after adding modules which use the thread.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+        (WebCore::ScriptExecutionContext::fileThread):
+        * dom/ScriptExecutionContext.h:
+        * html/FileThread.cpp: Added.
+        (WebCore::FileThread::FileThread):
+        (WebCore::FileThread::~FileThread):
+        (WebCore::FileThread::start):
+        (WebCore::FileThread::stop):
+        (WebCore::FileThread::postTask):
+        (WebCore::SameFilePredicate::SameFilePredicate):
+        (WebCore::SameFilePredicate::operator()):
+        (WebCore::FileThread::removeTask):
+        (WebCore::FileThread::fileThreadStart):
+        (WebCore::FileThread::runLoop):
+        * html/FileThread.h: Added.
+        (WebCore::FileThread::create):
+        (WebCore::FileThread::Task::Task):
+        (WebCore::FileThread::Task::~Task):
+        (WebCore::FileThread::Task::fileHandle):
+        * platform/Logging.cpp:
+        (WebCore::):
+        (WebCore::getChannelFromName):
+        * platform/Logging.h:
+
+2010-04-01  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed. Rollout of http://trac.webkit.org/changeset/56930
+        https://bugs.webkit.org/show_bug.cgi?id=36977
+
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::accessibilityDescription):
+
+2010-04-01  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Darin Adler.
+
+        WebCore::Document::updateLayoutIgnorePendingStylesheets NULL pointer
+        https://bugs.webkit.org/show_bug.cgi?id=31680
+        Ownerless nodes leads a crash on DOMSelection APIs
+        https://bugs.webkit.org/show_bug.cgi?id=36800
+
+        Added guards nodes from foreign documents to DOMSelection APIs.
+
+        Tests: editing/selection/DOMSelection-DocumentType.html
+               editing/selection/DOMSelection-crossing-document.html
+
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::canonicalPosition):
+        * page/DOMSelection.cpp:
+        (WebCore::DOMSelection::collapse):
+        (WebCore::DOMSelection::setBaseAndExtent):
+        (WebCore::DOMSelection::setPosition):
+        (WebCore::DOMSelection::extend):
+        (WebCore::DOMSelection::containsNode):
+        (WebCore::DOMSelection::isValidForPosition):
+        * page/DOMSelection.h:
+
+2010-04-01  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fix a NULL pointer crash if @import fails to load a stylesheet.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36804
+
+        Test: fast/xsl/xslt-bad-import-uri.html
+
+        * xml/XSLStyleSheetLibxslt.cpp:
+        (WebCore::XSLStyleSheet::parseString):
+          Handle an empty string gracefully. An empty string has a NULL
+          buffer, which we pass in to xmlCreateMemoryParserCtxt(). It returns
+          NULL if it is passed a NULL buffer.
+          In the top-level XSL case, the current code does not crash "by luck"
+          because the other APIs used can handle a NULL argument. In the
+          @import case, additional code runs which will deference the NULL.
+
+2010-04-01  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36854
+        <rdar://problem/7811668> REGRESSION (r47291): Body from cross origin preflight response
+        is prepended to the actual response body
+
+        Tests: http/tests/xmlhttprequest/access-control-response-with-body-sync.html
+               http/tests/xmlhttprequest/access-control-response-with-body.html
+
+        * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didReceiveData):
+        Don't send data to the client when handling a preflight request.
+
+2010-04-01  Ada Chan  <adachan@apple.com>
+
+        Reviewed by Darin Adler.
+        
+        Change DatabaseTracker::deleteOrigin() to return true if there are no errors in deleting the origin.
+        Ditto for DatabaseTracker::deleteDatabase().
+        
+        https://bugs.webkit.org/show_bug.cgi?id=36988
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        * storage/DatabaseTracker.h:
+
+2010-04-01  Simon Fraser  <simon.fraser@apple.com>
+
+        No review.
+
+        Remove some casts that I indended to remove before committing r56948.
+
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::writeRenderObject):
+        (WebCore::write):
+
+2010-04-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Assertion failure (willBeComposited == needsToBeComposited(layer)) in
+        RenderLayerCompositor::computeCompositingRequirements() on hulu.com
+        https://bugs.webkit.org/show_bug.cgi?id=36516
+        
+        Fix assertions added in r56017. That changed replaced calls to needsToBeComposited()
+        with use of the local 'willBeComposited' variable, but that fails to take into
+        account the fact that needsToBeComposited() also tests layer->isSelfPaintingLayer().
+        
+        Fix by adding a canBeComposited() method that we call before testing
+        whether the layer should go into compositing mode.
+
+        Test: compositing/self-painting-layers2.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::calculateCompositedBounds): Repace use of isSelfPaintingLayer()
+        with a call to canBeComposited().
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements): Call canBeComposited() to ensure
+        that we only toggle 'willBeComposited' for layers that can.
+        (WebCore::RenderLayerCompositor::needsToBeComposited): Call canBeComposited().
+        (WebCore::RenderLayerCompositor::canBeComposited): Test if compositing is enabled, and whether
+        the layer is self-painting.
+        * rendering/RenderLayerCompositor.h: Add canBeComposited().
+
+2010-04-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36980
+        Add object addresses to debug showLayerTree() output.
+        
+        Add the ability to print RenderLayer and RenderObject addresses in the showLayerTree()
+        output.
+
+        * platform/text/TextStream.cpp:
+        (WebCore::TextStream::operator<<):
+        * platform/text/TextStream.h:
+        * rendering/RenderLayer.cpp:
+        (showLayerTree):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::writeRenderObject):
+        (WebCore::write):
+        * rendering/RenderTreeAsText.h:
+
+2010-03-29  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Changing SQLiteStatement::prepare() to return an error when it's
+        given a string that has more than one statement in it. Currently,
+        everything past the first statement is silently ignored.
+
+        Test: storage/executesql-accepts-only-one-statement.html
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::prepare):
+
+2010-04-01  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Keeps a transient optimistic offset to the root in RenderLayer::updateLayerPositions
+        https://bugs.webkit.org/show_bug.cgi?id=33520
+
+        RenderLayer::updateLayerPositions() makes a recursive walk through all RenderLayers and updates the repaint rectangles on each.
+        These rectangles have to be calculated in the repaint container's coordinates using RenderObject::mapLocalToContainer to walk
+        up to the repaint container.  This patch keeps track of the offset to the root and uses that offset instead of walking back up to
+        the root every time.
+
+        Tests: fast/layers/nested-layers-1.html
+               fast/layers/nested-layers-2.html
+               fast/layers/nested-layers-3.html
+               fast/layers/nested-layers-4.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::outlineBoundsForRepaint):
+        * rendering/RenderBox.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        * rendering/RenderLayer.h:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::outlineBoundsForRepaint):
+        * rendering/RenderSVGModelObject.cpp:
+        (WebCore::RenderSVGModelObject::outlineBoundsForRepaint):
+        * rendering/RenderSVGModelObject.h:
+
+2010-04-01  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36901
+
+        Removed functions Range::operator == and Range::operator != as they
+        were using C++ code that was not sound and hence may have undefined
+        behavior.
+
+        Test case: manual-tests/crash-on-find-with-no-selection.html
+
+        * dom/Range.cpp:
+        (WebCore::areRangesEqual): Added.
+        * dom/Range.h:
+        * editing/markup.cpp:
+        (WebCore::createMarkup): Modified to call WebCore::areRangesEqual.
+        * manual-tests/crash-on-find-with-no-selection.html: Added.
+        * page/Frame.cpp:
+        (WebCore::Frame::findString): Modified to call WebCore::areRangesEqual.
+
+2010-04-01  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Synchronous rendering when setting form control values slows down JavaScript
+        https://bugs.webkit.org/show_bug.cgi?id=36967
+
+        This patch basically reverts http://trac.webkit.org/changeset/19006.
+        
+        Dan asked me to investigate why 19006 is no longer needed. I have two answers:
+
+            (1) I was also able to remove the synchronous call to updateFromElement().
+            That call was the proximate cause of the crash that 19006 fixed.
+
+            (2) updateFromElement() no longer calls HTMLElement::setInnerText()
+            in the way that it used to. (However, it doesn't seem prudent to
+            rely on this happy coincidence.)
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setValue): Simplified some logic here. Moved
+        setNeedsValidityCheck() outside of individual 'if' clauses, since they all
+        called it.
+        
+        Removed call to updateStyleIfNeeded(), which does rendering synchronously,
+        since that was the performance problem. (setNeedsStyleRecalc() ensures
+        that rendering will happen asynchronously.) Also removed comment about
+        ordering dangers introduced by updateStyleIfNeeded().
+        
+        Removed call to updateFromElement(), since it's dangerous and also a minor
+        performance problem. (setNeedsStyleRecalc() ensures that updateFromElement()
+        will happen asynchronously, too.)
+
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::setNonDirtyValue): Ditto. Here, I had to
+        add a call to setNeedsStyleRecalc(), since there wasn't one before.
+
+2010-04-01  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Sometimes js code can detach page from it's frame and in that case
+        Dispatch Events will stay in the TimelineAgent's events stack. Only immediate events will
+        appear at frontend.
+        https://bugs.webkit.org/show_bug.cgi?id=36890
+
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::callFunction):
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::dispatchEvent):
+
+2010-04-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Bug 36977 - aria-label doesn't work on image map area
+        https://bugs.webkit.org/show_bug.cgi?id=36977
+
+        Test: platform/mac/accessibility/area-with-aria-label.html
+
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::accessibilityDescription):
+
+2010-04-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Assertion failure: !repaintContainer || repaintContainer == this
+        https://bugs.webkit.org/show_bug.cgi?id=36672
+        
+        RenderText's implementation of clippedOverflowRectForRepaint() uses containingBlock()
+        to get the renderer to use for computing the repaint rect. However, the renderer returned
+        by containingBlock() may be an ancestor of the repaintContainer, and containingBlock()
+        doesn't have the 'repaintContainerSkipped' logic that container() has.
+        
+        So in this case, check to see whether repaintContainer is actually a descendant of the
+        containing block, and in that case just repaint the entire repaintContainer.
+
+        Test: compositing/repaint/inline-repaint-container.html
+
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::clippedOverflowRectForRepaint):
+
+2010-04-01  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Jian Li.
+
+        [Qt] REGRESSION(r56869): Windows build is broken
+        https://bugs.webkit.org/show_bug.cgi?id=36929
+
+        * WebCore.pro: LIBS += -lOle32 added.
+        * platform/UUID.cpp: Define ARRAYSIZE macro if it isn't defined before.
+
+2010-04-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Bug 36968 - 1 crash in Safari at com.apple.WebCore: WebCore::Element::getAttribute const
+        https://bugs.webkit.org/show_bug.cgi?id=36968
+
+        Test: accessibility/crash-with-noelement-selectbox.html
+
+        When a <select> element had no options, the selectedIndex == -1 and that was being
+        used to index into an empty array.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::stringValue):
+
+2010-04-01  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Shinichiro Hamaji.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36948
+        Refactoring: Position::primaryDirection() should be extracted.
+
+        No new tests. No functinal change.
+
+        * dom/Position.cpp:
+        (WebCore::Position::getInlineBoxAndOffset):
+        (WebCore::Position::primaryDirection): Added
+        * dom/Position.h:
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
+        (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
+
+2010-04-01  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Audits: fix parsing of injected script-evaluated result for CssInHeadRule
+        https://bugs.webkit.org/show_bug.cgi?id=36952
+
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+
+2010-03-31  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Misc IndexedDatabase cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=36889
+
+        No functional changes.
+
+        * bindings/v8/custom/V8CustomIDBCallbacks.h:  
+        (WebCore::V8CustomIDBCallbacks::onSuccess):
+        (WebCore::V8CustomIDBCallbacks::onError):
+        (WebCore::V8CustomIDBCallbacks::V8CustomIDBCallbacks):
+            Get rid of 2 largely redundant bools
+
+        * storage/IndexedDatabase.h:
+        * storage/IndexedDatabaseImpl.cpp:
+        (WebCore::IndexedDatabaseImpl::open):
+        * storage/IndexedDatabaseImpl.h:
+        * storage/IndexedDatabaseRequest.cpp:
+        (WebCore::IndexedDatabaseRequest::open):
+        * storage/IndexedDatabaseRequest.h:
+            Plumb the Frame* and style cleanups.
+
+2010-03-31  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        REGRESSION: document.documentElement.getScreenCTM() returns incorrect matrix.
+        https://bugs.webkit.org/show_bug.cgi?id=27183
+
+        Rewrite getCTM() / getScreenCTM() handling in an iterative way, fixing all known problems/limitations.
+        The bug mentioned above is actually not a regression, getScreenCTM() only worked before, because we
+        did not handle non-SVG CSS box parents properly. When support was added to handle those cases, the
+        getScreenCTM() handling was completly off, causing a lot of trouble in real-life SVG applications (carto.net for instance)
+
+        Tests: svg/custom/svgsvgelement-ctm.xhtml (fixed typo, missing unit identifier in CSS 'height' property, leading to incorrect results)
+               svg/custom/svgsvgelement-ctm2.xhtml
+               svg/custom/svgsvgelement-ctm3.xhtml
+               svg/custom/svgsvgelement-ctm4.xhtml
+               svg/custom/svgsvgelement-ctm5.xhtml
+
+        * svg/SVGLocatable.cpp:
+        (WebCore::SVGLocatable::getBBox):
+        (WebCore::SVGLocatable::computeCTM):
+        * svg/SVGLocatable.h:
+        (WebCore::SVGLocatable::localCoordinateSpaceTransform):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
+        (WebCore::SVGSVGElement::createRenderer):
+        * svg/SVGSVGElement.h:
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::localCoordinateSpaceTransform):
+        * svg/SVGStyledElement.h:
+        * svg/SVGStyledLocatableElement.cpp:
+        (WebCore::SVGStyledLocatableElement::getCTM):
+        (WebCore::SVGStyledLocatableElement::getScreenCTM):
+        * svg/SVGStyledLocatableElement.h:
+        (WebCore::SVGStyledLocatableElement::localCoordinateSpaceTransform):
+        * svg/SVGStyledTransformableElement.cpp:
+        (WebCore::SVGStyledTransformableElement::getCTM):
+        (WebCore::SVGStyledTransformableElement::getScreenCTM):
+        * svg/SVGStyledTransformableElement.h:
+        (WebCore::SVGStyledTransformableElement::localCoordinateSpaceTransform):
+        * svg/SVGTextElement.cpp:
+        (WebCore::SVGTextElement::getCTM):
+        (WebCore::SVGTextElement::getScreenCTM):
+        * svg/SVGTextElement.h:
+        (WebCore::SVGTextElement::localCoordinateSpaceTransform):
+        * svg/SVGTransformable.cpp:
+        (WebCore::SVGTransformable::SVGTransformable):
+        * svg/SVGTransformable.h:
+        (WebCore::SVGTransformable::localCoordinateSpaceTransform):
+
+2010-04-01  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [V8] Quick fix for failure in SerializedScriptValue
+        https://bugs.webkit.org/show_bug.cgi?id=36943
+
+        This allows the web worker layout tests to pass again.
+
+        * bindings/v8/SerializedScriptValue.h:
+        (WebCore::SerializedScriptValue::deserializeAndSetProperty):
+
+2010-03-31  MORITA Hajime  <morrita@google.com>
+        
+        Reviewed by Darin Adler.
+
+        Crash when writing into a detached TITLE element
+        https://bugs.webkit.org/show_bug.cgi?id=25567
+        
+        Document::setTitle() invoked HTMLTitleElement::setText(), which
+        contains DOM tree modification, even when setTitle() is called
+        from HTMLTitleElement::childrenChanged().  Fix to skip setText()
+        when setTitle() is called childrenChanged() to avoid cascading
+        DOM mutations between Document and HTMLTitleElement.
+
+        Test: fast/dom/title-content-write-set.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::setTitle):
+
+2010-04-01  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Bug 36803 - 'Inline-table' workaround for <ruby> broken with ruby support
+        https://bugs.webkit.org/show_bug.cgi?id=36803
+
+        Don't use ruby rendering if the underlying 'display' property has been
+        changed into a value other than 'inline' or 'block' (such as 'inline-table').
+
+        Test: fast/ruby/ruby-inline-table.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::createObject):
+
+2010-03-31  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Crash submitting display:none textarea in a form
+        https://bugs.webkit.org/show_bug.cgi?id=36905
+
+        Test: fast/forms/textarea-submit-crash.html
+
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::appendFormData): Do update layout before
+        asking our renderer for its text, since we can't rely on our renderer's
+        text if layout is needed.
+
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::textWithHardLineBreaks): Don't update layout
+        while being asked for our text, since doing so may delete us, causing a crash.
+
+2010-03-31  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 36845 - AX: need a way to set the label of a AXWebArea through WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=36845
+
+        Provide a way through WebKit to set an accessible label that describes the web area.
+
+        Test: platform/mac/accessibility/html-with-aria-label.html
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::setAccessibleName):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityDescription):
+        (WebCore::AccessibilityRenderObject::setAccessibleName):
+        * accessibility/AccessibilityRenderObject.h:
+
+2010-03-31  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <http://webkit.org/b/36878> REGRESSION: Trailing colon on hostnames (with no port specified) causes "Not allowed to use restricted network port"
+
+        * platform/KURL.cpp:
+        (WebCore::KURL::port): Explicitly handle the case of a colon being present in the URL after the host name but with
+        no port number before the path.  This is handled in the same manner as the colon and port being omitted completely.
+
+2010-03-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Remove dependency on TextBreakIterator from StringImpl.cpp,
+        and from member methods of String.
+
+        Make 'numGraphemeClusters' & 'numCharactersInGraphemeClusters'
+        global function defined in PlatformString.h, rather than
+        member methods on String (these can be implemented purely
+        using the characters() and length() public interface),
+        and make 'makeCapitalized' a static function in RenderText.cpp.
+
+        * dom/InputElement.cpp:
+        (WebCore::InputElement::sanitizeUserInputValue):
+        (WebCore::InputElement::handleBeforeTextInsertedEvent):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::tooLong):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
+        (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
+        (WebCore::HTMLTextAreaElement::tooLong):
+        * platform/text/PlatformString.h:
+        (WebCore::String::makeSecure):
+        * platform/text/String.cpp:
+        (WebCore::numGraphemeClusters):
+        (WebCore::numCharactersInGraphemeClusters):
+        * platform/text/StringImpl.cpp:
+        * platform/text/StringImpl.h:
+        * rendering/RenderText.cpp:
+        (WebCore::makeCapitalized):
+        (WebCore::RenderText::setTextInternal):
+
+2010-03-31  Vitaly Repeshko  <vitalyr@chromium.org>
+
+        Reviewed by David Levin.
+
+        [V8] SerializedScriptValue must be deserialized only once and in the right context
+        https://bugs.webkit.org/show_bug.cgi?id=36892
+
+        See also https://bugs.webkit.org/show_bug.cgi?id=34227 for the
+        corresponding JSC change.
+
+        General idea: SerializedScriptValue must be deserialized only once
+        and in the context of the intended MessageEvent recepient. The
+        approach we take for now is to eagerly deserialize when a
+        JavaScript wrapper for MessageEvent is created.
+
+        A better fix would be to keep a reference to the context in
+        MessageEvent and use it when lazily deserializing. It's harder to
+        do since the API doesn't have a clean method to have such a reference.
+
+        Tested by fast/dom/Window/window-postmessage-clone-frames.html. This
+        test still fails but only for the types which we can't serialize yet.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/SerializedScriptValue.h:
+        (WebCore::SerializedScriptValue::deserializeAndSetProperty):
+        * bindings/v8/custom/V8MessageEventCustom.cpp:
+        (WebCore::V8MessageEvent::initMessageEventCallback):
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Cleanup RedirectScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=36874
+
+        Removed the nutty ScheduledRedirection struct in favor of a hierarchy
+        of classes to represent the various kinds of scheduled redirects.
+        Doing this lets us get rid of the pseudo RTTI switch statements on
+        "type" in favour of calling virtual functions.
+
+        No new tests because this change should be API identical with the
+        existing RedirectScheduler.
+
+        * loader/RedirectScheduler.cpp:
+        (WebCore::ScheduledNavigation::ScheduledNavigation):
+        (WebCore::ScheduledNavigation::~ScheduledNavigation):
+        (WebCore::ScheduledNavigation::isLocationChange):
+        (WebCore::ScheduledNavigation::shouldStartTimer):
+        (WebCore::ScheduledNavigation::didStartTimer):
+        (WebCore::ScheduledNavigation::didStopTimer):
+        (WebCore::ScheduledNavigation::delay):
+        (WebCore::ScheduledNavigation::lockHistory):
+        (WebCore::ScheduledNavigation::lockBackForwardList):
+        (WebCore::ScheduledNavigation::wasDuringLoad):
+        (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
+        (WebCore::ScheduledURLNavigation::fire):
+        (WebCore::ScheduledURLNavigation::didStartTimer):
+        (WebCore::ScheduledURLNavigation::didStopTimer):
+        (WebCore::ScheduledURLNavigation::url):
+        (WebCore::ScheduledURLNavigation::referrer):
+        (WebCore::ScheduledURLNavigation::wasUserGesture):
+        (WebCore::ScheduledRedirect::ScheduledRedirect):
+        (WebCore::ScheduledRedirect::isLocationChange):
+        (WebCore::ScheduledRedirect::shouldStartTimer):
+        (WebCore::ScheduledLocationChange::ScheduledLocationChange):
+        (WebCore::ScheduledRefresh::ScheduledRefresh):
+        (WebCore::ScheduledRefresh::fire):
+        (WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
+        (WebCore::ScheduledHistoryNavigation::fire):
+        (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
+        (WebCore::ScheduledFormSubmission::fire):
+        (WebCore::RedirectScheduler::redirectScheduledDuringLoad):
+        (WebCore::RedirectScheduler::clear):
+        (WebCore::RedirectScheduler::scheduleRedirect):
+        (WebCore::RedirectScheduler::mustLockBackForwardList):
+        (WebCore::RedirectScheduler::scheduleLocationChange):
+        (WebCore::RedirectScheduler::scheduleFormSubmission):
+        (WebCore::RedirectScheduler::scheduleRefresh):
+        (WebCore::RedirectScheduler::locationChangePending):
+        (WebCore::RedirectScheduler::scheduleHistoryNavigation):
+        (WebCore::RedirectScheduler::timerFired):
+        (WebCore::RedirectScheduler::schedule):
+        (WebCore::RedirectScheduler::startTimer):
+        (WebCore::RedirectScheduler::cancel):
+        * loader/RedirectScheduler.h:
+
+2010-03-31  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Hook up WebGLContextAttributes to OpenGL context creation code
+        https://bugs.webkit.org/show_bug.cgi?id=33416
+
+        Test: fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
+
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: Fix an index bug.
+        (WebCore::V8HTMLCanvasElement::getContextCallback):
+        * platform/graphics/GraphicsContext3D.h: Add members/functions for multisampling/stencil buffer purpose.
+        * platform/graphics/mac/Canvas3DLayer.h: Add GraphicsContext3D as a member of Canvas3DLayer.
+        * platform/graphics/mac/Canvas3DLayer.mm: Add multisampling support.
+        (-[Canvas3DLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
+        * platform/graphics/mac/GraphicsContext3DMac.cpp: Hook up WebGLContextAttributes to OpenGL context creation code for Mac.
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::validateAttributes):
+        (WebCore::GraphicsContext3D::reshape):
+        (WebCore::GraphicsContext3D::prepareTexture):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::readPixels):
+        * platform/graphics/mac/GraphicsLayerCA.mm: Adjust to modified Canvas3DLayer init call.
+        (WebCore::GraphicsLayerCA::setContentsToGraphicsContext3D):
+
+2010-03-31  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add support to create UUID string.
+        https://bugs.webkit.org/show_bug.cgi?id=36472
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/UUID.cpp: Added.
+        (WebCore::createCanonicalUUIDString):
+        * platform/UUID.h: Added.
+
+2010-03-31  Darin Adler  <darin@apple.com>
+
+        * rendering/RenderThemeChromiumWin.h: Fix inconsistent line endings.
+
+2010-03-31  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - form controls style
+        https://bugs.webkit.org/show_bug.cgi?id=36370
+
+        Adjusting Mameo5 form elements rendering.
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * css/themeQtMaemo5.css: Added.
+        (select):
+        (select:disabled):
+        (select:active):
+        (select:active:disabled):
+        (textarea):
+        (textarea:disabled):
+        (textarea:active):
+        * platform/qt/Maemo5Webstyle.cpp: Added.
+        (Maemo5WebStyle::Maemo5WebStyle):
+        (drawRectangularControlBackgorund):
+        (Maemo5WebStyle::drawChecker):
+        (Maemo5WebStyle::findChecker):
+        (Maemo5WebStyle::drawRadio):
+        (Maemo5WebStyle::findRadio):
+        (Maemo5WebStyle::drawControl):
+        (Maemo5WebStyle::drawComplexControl):
+        * platform/qt/Maemo5Webstyle.h: Added.
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::RenderThemeQt):
+        (WebCore::RenderThemeQt::isControlStyled):
+        (WebCore::RenderThemeQt::popupInternalPaddingBottom):
+        (WebCore::RenderThemeQt::extraDefaultStyleSheet):
+        (WebCore::RenderThemeQt::adjustMenuListButtonStyle):
+        * platform/qt/RenderThemeQt.h:
+
+2010-03-31  Alexey Proskuryakov  <ap@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=36897
+        <rdar://problem/7804018> REGRESSION (r56429): Flash ads are clipped when main page is scrolled (boxofficemojo.com)
+
+        Addressing additional review comments.
+
+        * rendering/RenderWidget.cpp: Removed an unneeded include.
+        * rendering/RenderWidget.h: Reworded the new comment.
+
+2010-03-31  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36897
+        <rdar://problem/7804018> REGRESSION (r56429): Flash ads are clipped when main page is scrolled (boxofficemojo.com)
+
+        * manual-tests/plugin-in-iframe-scroll.html: Added.
+        * manual-tests/resources/plugin-in-iframe-scroll-iframe.html: Added.
+
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::setWidgetGeometry): This method isn't called when an iframe containing
+        the widget moves, so we should store a value that is not dependent on current scroll offset.
+        (WebCore::RenderWidget::windowClipRect): Apply scroll offset and window clip now.
+
+        * rendering/RenderWidget.h: Renamed m_windowClipRect to m_clipRect, because it is no longer
+        in window coordinates.
+
+        * WebCore.base.exp: Export RenderWidget::windowClipRect(), since it's no longer inline.
+
+2010-03-31  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Unreviewed crash fix.
+
+        Crash with frame flattening on after r56854
+        https://bugs.webkit.org/show_bug.cgi?id=36894
+
+        Solution tested by Greg Bolsinga, thanks.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::avoidScrollbarCreation):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setHasHorizontalScrollbar):
+        (WebCore::ScrollView::setHasVerticalScrollbar):
+
+2010-03-31  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        iframe flattening doesn't flatten
+        https://bugs.webkit.org/show_bug.cgi?id=36798
+
+        Do not draw scrollbars for subframes when frame flattening is
+        enabled. Implemented using a virtual method in ScrollView as
+        suggested by Dave Hyatt.
+
+        Do not suppress scrollbars as that is wrong according to
+        Dave Hyatt.
+
+        Covered by current tests.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::avoidScrollbarCreation):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setHasHorizontalScrollbar):
+        (WebCore::ScrollView::setHasVerticalScrollbar):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::avoidScrollbarCreation):
+        * rendering/RenderPart.cpp:
+        (WebCore::RenderPart::layoutWithFlattening):
+
+2010-03-30  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        iframe flattening doesn't flatten
+        https://bugs.webkit.org/show_bug.cgi?id=36798
+
+        Fix wrongly reversing logic in frame flattening check.
+
+        Tests:
+        fast/frames/flattening/iframe-flattening-fixed-height.html
+        fast/frames/flattening/iframe-flattening-fixed-width.html
+        fast/frames/flattening/iframe-flattening-fixed-width-and-height.html
+        fast/frames/flattening/iframe-flattening-fixed-width-and-height-no-scrolling.html
+
+        * rendering/RenderPartObject.cpp:
+        (WebCore::RenderPartObject::flattenFrame):
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Implements cancelGeolocationPermissionRequestForFrame.
+        Similar to requestGeolocationPermissionForFrame(), passes Geolocation* to cancelGeolocationPermissionRequestForFrame(),
+        so that the embedder can identify which Geolocation object is cancelling the pending permission request.
+        Calls cancelGeolocationPermissionRequestForFrame() before stopUpdating() so it better matches the startUpdating() / requestPermission() flow.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyChromeClient::cancelGeolocationPermissionRequestForFrame):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::cancelGeolocationPermissionRequestForFrame):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::disconnectFrame):
+
+2010-03-31  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        Add animation to progress element
+        https://bugs.webkit.org/show_bug.cgi?id=36664
+
+        Add a timer to control the animation. The timer is started after painting
+        or a state change in the progress bar, to prevent animation from running
+        when the progress bar is not visible.
+
+        * html/HTMLProgressElement.cpp:
+        (WebCore::HTMLProgressElement::createRenderer):
+        * manual-tests/dom: Added.
+        * manual-tests/dom/progressbar.html: Added.
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::animationRepeatIntervalForProgressBar):
+        (WebCore::RenderThemeQt::animationDurationForProgressBar):
+        (WebCore::RenderThemeQt::paintProgressBar):
+        * platform/qt/RenderThemeQt.h:
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::RenderProgress):
+        (WebCore::RenderProgress::layout):
+        (WebCore::RenderProgress::updateFromElement):
+        (WebCore::RenderProgress::animationProgress):
+        (WebCore::RenderProgress::animationTimerFired):
+        (WebCore::RenderProgress::paint):
+        (WebCore::RenderProgress::updateAnimationState):
+        * rendering/RenderProgress.h:
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
+        (WebCore::RenderTheme::animationDurationForProgressBar):
+        * rendering/RenderTheme.h:
+
+2010-03-31  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Rolling out r56829 since it broke chromium layout tests.
+
+        [REGRESSION] Inspector tests started crashing since r56829
+        https://bugs.webkit.org/show_bug.cgi?id=36888
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8Utilities.cpp:
+        * bindings/v8/V8Utilities.h:
+        * loader/FrameLoaderClient.h:
+
+2010-03-31  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: creating new style bugfixing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36884
+
+        - InspectorDOMAgent should clear internal state upon reset (we are re-using
+          single dom agent instance throughout entire inspector controller lifetime) 
+        - Brought back blank style 'refresh' processing logic - remove it by mistake earlier
+        - Blocked couple of click handlers so that double-click to edit was not
+          expanding / collapsing the pane
+        - There is no need to reach out for matched rules upon 'refresh' update -
+          getting computed style is sufficient.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::matchRulesForList):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::discardBindings):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype.update.getStylesCallback):
+        (WebInspector.StylesSidebarPane.prototype.update.getComputedStyleCallback):
+        (WebInspector.StylesSidebarPane.prototype.update):
+        (WebInspector.StylesSidebarPane.prototype._refreshUpdate):
+        (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
+        (WebInspector.StylesSidebarPane.prototype._refreshStyleRules):
+        (WebInspector.StylesSidebarPane.prototype.addBlankSection):
+        (WebInspector.StylePropertiesSection.prototype._dblclickEmptySpace):
+        (WebInspector.StylePropertiesSection.prototype._clickSelector):
+
+2010-03-31  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed. Chromium build fix: create missing v8::HandleScope.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36828
+
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::canAccessInspectedWindow):
+
+2010-03-31  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Check that injected script can still access inspected window object when wrapping console object. When the window cannot be access serialize objects as strings. Also don't call InjectedScript.dispatch if the window cannot be accessed (due to frame navigation).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36828
+
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::canAccessInspectedWindow):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::canAccessInspectedWindow):
+        * inspector/InjectedScript.cpp:
+        (WebCore::InjectedScript::wrapForConsole):
+        * inspector/InjectedScriptHost.h:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-03-31  Mattias Nissler  <mnissler@google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Allow generic resource URLs for cookie handling in the inspector. This
+        enables display of all cookies, not only those that are associated
+        with resources accessed through http, https or file.
+        https://bugs.webkit.org/show_bug.cgi?id=36877
+
+        * inspector/front-end/CookieItemsView.js:
+        (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.Cookies.cookieMatchesResourceURL):
+        * inspector/front-end/inspector.js:
+        (WebInspector.updateResource):
+
+2010-03-30  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        IndexedDB: Finish hooking up bindings for IndexedDatabaseRequest
+        https://bugs.webkit.org/show_bug.cgi?id=36830
+
+        Still not enough hooked up to test.  Soon!
+
+        * WebCore.gypi:
+        * bindings/v8/custom/V8CustomIDBCallback.h: Removed.
+        * bindings/v8/custom/V8CustomIDBCallbacks.h: Added.
+        (WebCore::V8CustomIDBCallbacks::create):
+        (WebCore::V8CustomIDBCallbacks::~V8CustomIDBCallbacks):
+        (WebCore::V8CustomIDBCallbacks::onSuccess):
+        (WebCore::V8CustomIDBCallbacks::onError):
+        (WebCore::V8CustomIDBCallbacks::V8CustomIDBCallbacks):
+        * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
+        (WebCore::V8IndexedDatabaseRequest::openCallback):
+        * storage/IDBDatabaseRequest.cpp: Added.
+        (WebCore::IDBDatabaseRequest::IDBDatabaseRequest):
+        (WebCore::IDBDatabaseRequest::~IDBDatabaseRequest):
+        * storage/IDBDatabaseRequest.h:
+        (WebCore::IDBDatabaseRequest::create):
+        * storage/IndexedDatabaseRequest.cpp:
+        (WebCore::IndexedDatabaseRequest::open):
+        * storage/IndexedDatabaseRequest.h:
+
+2010-03-31  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Implement memmove behavior for WebGLArray set()
+        https://bugs.webkit.org/show_bug.cgi?id=35619
+
+        New test cases are added to fast/canvas/webgl/array-setters.html.
+
+        * html/canvas/WebGLArray.cpp: Use memmove instead of memcpy; with memmove, copying takes place as if an intermediate buffer was used, allowing the destination and source to overlap.
+        (WebCore::WebGLArray::setImpl):
+
+2010-03-31  Benjamin Poulain  <benjamin.poulain@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        tryLayoutDoingPositionedMovementOnly does not have to be in RenderObject or be virtual
+        https://bugs.webkit.org/show_bug.cgi?id=36810
+
+        Move tryLayoutDoingPositionedMovementOnly as a regular method of RenderBox
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
+        * rendering/RenderObject.h:
+
+2010-03-31  John Gregg  <johnnyg@google.com>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] add logging of cross-frame property accesses for site isolation
+        https://bugs.webkit.org/show_bug.cgi?id=35773
+
+        No new tests as no new functionality.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::logPropertyAccess):
+        * bindings/v8/V8Utilities.h:
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::logCrossFramePropertyAccess):
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * Android.mk:
+        * ForwardingHeaders/wtf/text: Added.
+        * ForwardingHeaders/wtf/text/CString.h: Added.
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.order:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        * bindings/js/JSDOMWindowBase.cpp:
+        * bindings/js/ScheduledAction.cpp:
+        * bindings/js/ScriptController.cpp:
+        * bindings/v8/ScriptController.cpp:
+        * bindings/v8/V8Binding.cpp:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bridge/jni/JNIBridge.cpp:
+        * bridge/jni/v8/JavaStringV8.h:
+        (JSC::Bindings::JavaStringImpl::init):
+        * css/CSSParser.cpp:
+        * dom/CharacterData.cpp:
+        * dom/Document.cpp:
+        * dom/Element.cpp:
+        * dom/Node.cpp:
+        * dom/Position.cpp:
+        * dom/Range.cpp:
+        * dom/Text.cpp:
+        * dom/XMLTokenizer.cpp:
+        * dom/XMLTokenizerLibxml2.cpp:
+        * dom/XMLTokenizerQt.cpp:
+        * editing/SelectionController.cpp:
+        * editing/VisiblePosition.cpp:
+        * editing/VisibleSelection.cpp:
+        * history/CachedFrame.cpp:
+        * history/HistoryItem.cpp:
+        * history/qt/HistoryItemQt.cpp:
+        * html/FormDataList.h:
+        (WebCore::FormDataList::appendData):
+        (WebCore::FormDataList::Item::Item):
+        (WebCore::FormDataList::Item::data):
+        * html/HTMLDocument.cpp:
+        * html/PreloadScanner.cpp:
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorDOMAgent.cpp:
+        * loader/DocLoader.cpp:
+        * loader/FTPDirectoryDocument.cpp:
+        * loader/FrameLoader.cpp:
+        * loader/HistoryController.cpp:
+        * loader/ProgressTracker.cpp:
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        * loader/icon/wince/IconDatabaseWince.cpp:
+        * loader/loader.cpp:
+        * page/Console.cpp:
+        * page/DOMWindow.cpp:
+        * page/SecurityOrigin.cpp:
+        * page/XSSAuditor.cpp:
+        * page/animation/AnimationBase.cpp:
+        * platform/ContextMenu.cpp:
+        * platform/FileSystem.h:
+        * platform/KURL.cpp:
+        * platform/KURLGoogle.cpp:
+        * platform/KURLGooglePrivate.h:
+        * platform/Pasteboard.h:
+        * platform/android/FileSystemAndroid.cpp:
+        * platform/android/TemporaryLinkStubs.cpp:
+        * platform/brew/KURLBrew.cpp:
+        * platform/cf/FileSystemCF.cpp:
+        * platform/chromium/MIMETypeRegistryChromium.cpp:
+        * platform/efl/FileSystemEfl.cpp:
+        * platform/efl/PasteboardEfl.cpp:
+        * platform/efl/PlatformKeyboardEventEfl.cpp:
+        * platform/efl/PlatformScreenEfl.cpp:
+        * platform/efl/RenderThemeEfl.cpp:
+        * platform/efl/ScrollbarEfl.cpp:
+        * platform/efl/SharedBufferEfl.cpp:
+        * platform/efl/WidgetEfl.cpp:
+        * platform/graphics/GlyphPageTreeNode.cpp:
+        * platform/graphics/cairo/FontPlatformDataCairo.cpp:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        * platform/graphics/chromium/FontCacheLinux.cpp:
+        * platform/graphics/chromium/FontPlatformDataLinux.h:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        * platform/graphics/gtk/FontPlatformDataPango.cpp:
+        * platform/graphics/gtk/IconGtk.cpp:
+        * platform/graphics/gtk/ImageGtk.cpp:
+        * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        * platform/graphics/qt/ImageBufferQt.cpp:
+        * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        * platform/graphics/skia/GraphicsLayerSkia.cpp:
+        * platform/graphics/win/GraphicsLayerCACF.cpp:
+        * platform/graphics/win/WKCACFLayer.cpp:
+        * platform/graphics/wx/FontPlatformData.h:
+        * platform/gtk/ClipboardGtk.cpp:
+        * platform/gtk/ContextMenuItemGtk.cpp:
+        * platform/gtk/DataObjectGtk.h:
+        * platform/gtk/FileChooserGtk.cpp:
+        * platform/gtk/FileSystemGtk.cpp:
+        * platform/gtk/GeolocationServiceGtk.cpp:
+        * platform/gtk/KURLGtk.cpp:
+        * platform/gtk/Language.cpp:
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        * platform/gtk/PasteboardGtk.cpp:
+        * platform/gtk/PopupMenuGtk.cpp:
+        * platform/gtk/RenderThemeGtk.cpp:
+        * platform/gtk/SharedBufferGtk.cpp:
+        * platform/haiku/FileSystemHaiku.cpp:
+        * platform/haiku/PlatformKeyboardEventHaiku.cpp:
+        * platform/network/CredentialStorage.cpp:
+        * platform/network/FormData.cpp:
+        * platform/network/FormData.h:
+        * platform/network/FormDataBuilder.cpp:
+        * platform/network/FormDataBuilder.h:
+        * platform/network/HTTPParsers.cpp:
+        * platform/network/android/ResourceHandleAndroid.cpp:
+        * platform/network/cf/FormDataStreamCFNet.cpp:
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        * platform/network/chromium/ResourceResponse.h:
+        * platform/network/curl/FormDataStreamCurl.cpp:
+        * platform/network/curl/ResourceHandleManager.cpp:
+        * platform/network/curl/ResourceHandleManager.h:
+        * platform/network/mac/FormDataStreamMac.mm:
+        * platform/network/mac/ResourceHandleMac.mm:
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        * platform/network/soup/CookieJarSoup.cpp:
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        * platform/network/win/ResourceHandleWin.cpp:
+        * platform/posix/FileSystemPOSIX.cpp:
+        * platform/qt/FileSystemQt.cpp:
+        * platform/qt/KURLQt.cpp:
+        * platform/qt/TemporaryLinkStubs.cpp:
+        * platform/sql/chromium/SQLiteFileSystemChromium.cpp:
+        * platform/text/CString.cpp: Removed.
+        * platform/text/CString.h: Removed.
+        * platform/text/PlatformString.h:
+        * platform/text/String.cpp:
+        * platform/text/StringImpl.cpp:
+        * platform/text/TextCodec.h:
+        * platform/text/TextCodecICU.cpp:
+        * platform/text/TextCodecLatin1.cpp:
+        * platform/text/TextCodecUTF16.cpp:
+        * platform/text/TextCodecUserDefined.cpp:
+        * platform/text/TextEncoding.cpp:
+        * platform/text/TextEncoding.h:
+        * platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp:
+        * platform/text/gtk/TextCodecGtk.cpp:
+        * platform/text/haiku/StringHaiku.cpp:
+        * platform/text/mac/TextCodecMac.cpp:
+        * platform/text/qt/TextCodecQt.cpp:
+        * platform/text/wx/StringWx.cpp:
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        * platform/win/ClipboardWin.cpp:
+        * platform/win/ContextMenuItemWin.cpp:
+        * platform/win/ContextMenuWin.cpp:
+        * platform/win/FileSystemWin.cpp:
+        * platform/win/GDIObjectCounter.cpp:
+        * platform/win/Language.cpp:
+        * platform/win/PasteboardWin.cpp:
+        * platform/wince/FileSystemWince.cpp:
+        * platform/wince/KeygenWince.cpp:
+        * platform/wince/PasteboardWince.cpp:
+        * platform/wx/FileSystemWx.cpp:
+        * platform/wx/LoggingWx.cpp:
+        * plugins/PluginDebug.h:
+        * plugins/PluginPackage.cpp:
+        * plugins/PluginStream.cpp:
+        * plugins/PluginStream.h:
+        * plugins/PluginView.h:
+        * plugins/gtk/PluginPackageGtk.cpp:
+        * plugins/mac/PluginPackageMac.cpp:
+        * plugins/qt/PluginPackageQt.cpp:
+        * plugins/symbian/PluginPackageSymbian.cpp:
+        * plugins/win/PluginPackageWin.cpp:
+        * rendering/RenderLayer.cpp:
+        * rendering/RenderLayerCompositor.cpp:
+        * rendering/RenderTreeAsText.cpp:
+        * storage/Database.cpp:
+        * storage/SQLTransactionCoordinator.cpp:
+        * storage/SQLTransactionCoordinator.h:
+        * storage/StorageAreaSync.cpp:
+        * storage/StorageSyncManager.cpp:
+        * storage/chromium/DatabaseTrackerChromium.cpp:
+        * storage/chromium/QuotaTracker.cpp:
+        * storage/chromium/QuotaTracker.h:
+        * svg/SVGFontFaceElement.cpp:
+        * svg/SVGStyledElement.cpp:
+        * svg/SVGUseElement.cpp:
+        * websockets/WebSocket.cpp:
+        * websockets/WebSocketChannel.cpp:
+        * websockets/WebSocketHandshake.cpp:
+        * wml/WMLErrorHandling.cpp:
+        * wml/WMLGoElement.cpp:
+        * wml/WMLPageState.cpp:
+        * wml/WMLPostfieldElement.cpp:
+        * wml/WMLSelectElement.cpp:
+        * xml/XMLHttpRequest.cpp:
+        * xml/XSLStyleSheetLibxslt.cpp:
+        * xml/XSLTProcessorLibxslt.cpp:
+
+2010-03-30  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        REGRESSION (r56439) - Crash when a renderer for a file upload control
+        with a selected file is recreated
+        https://bugs.webkit.org/show_bug.cgi?id=36723
+
+        RenderFileUploadControl::chooseIconForFiles was called before
+        m_fileChooser was initialized.
+
+        * platform/FileChooser.cpp:
+        (WebCore::FileChooser::FileChooser): Introduce m_isInitializing flag to
+          avoid FileChooserClient::repaint() call.
+        (WebCore::FileChooser::loadIcon):
+        (WebCore::FileChooser::iconLoaded):
+        * platform/FileChooser.h: Add a FielChooser parameter to
+          FileChooserClient::chooseIconForFiles().
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::chooseIconForFiles):
+        (WebCore::RenderFileUploadControl::paintObject): Add an assertion.
+        * rendering/RenderFileUploadControl.h:
+
+2010-03-30  Stanislav Paltis  <Stanislav.Paltis@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] qmake/symbian build failure
+        https://bugs.webkit.org/show_bug.cgi?id=36745
+
+        Fix build break in Symbian build introduced in r56714,
+        by modifying comment escape character from ";" to "#".
+
+        * WebCore.pro:
+
+2010-03-30  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after new localized string addition.
+
+        * platform/wx/LocalizedStringsWx.cpp:
+        (WebCore::missingPluginText):
+
+2010-03-30  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Add missing export.
+
+        * WebCore.base.exp:
+
+2010-03-30  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Incorrect insertion position after typing THAI CHARACTER SARA AM = 0E33.
+        <rdar://problem/7810749>
+        https://bugs.webkit.org/show_bug.cgi?id=36858
+
+        Test: fast/text/multiglyph-characters.html
+
+        Characters with multiple glyph were not supported correctly.
+        Computing the advance width was producing a division by zero.
+        
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::advance):
+
+2010-03-30  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Taint the canvas if an SVG-derived pattern is rendered into it.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36838
+
+        Test: fast/canvas/svg-taint.html
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::createPattern):
+          Take into account the image's hasSingleSecurityOrigin() property.
+
+2010-03-30  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36616
+        Dvorak-Qwerty keyboard layout gives unexpected results in javascript keydown
+
+        https://bugs.webkit.org/show_bug.cgi?id=36797
+        For non-Roman layouts, keydown Event.keyCode is always 0
+
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::windowsKeyCodeForKeyCode): This is now the primary function for determining
+        Windows key code - there is no reason to round trip a virtual key code via character code to
+        get Windows virtual key code, and this can't work for non-Roman alphabets.
+        (WebCore::windowsKeyCodeForCharCode): Removed keys that are now handled in windowsKeyCodeForKeyCode(),
+        only keeping those for which we don't have known key codes (yet?).
+
+        * platform/mac/KeyEventMac.mm: (WebCore::windowsKeyCodeForKeyEvent): Added comments.
+
+2010-03-30  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Rename / tidy up Geolocation bridge
+        Uses Geoposition instead of individual params for setLastPosition.
+        https://bugs.webkit.org/show_bug.cgi?id=36535
+
+        * platform/chromium/GeolocationServiceChromium.cpp:
+        (WebCore::GeolocationServiceChromium::GeolocationServiceChromium):
+        (WebCore::GeolocationServiceChromium::setIsAllowed):
+        (WebCore::GeolocationServiceChromium::setLastPosition):
+        * platform/chromium/GeolocationServiceChromium.h:
+
+2010-03-30  Adam Langley  <agl@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] linux: prefer the "hinting" fontconfig preference.
+
+        fontconfig can give contradictory hinting information, setting
+        "hinting" to zero and "hintstyle" to non-zero. In this case we
+        should take the "hinting" preference.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36602
+
+        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+        (WebCore::FontPlatformData::setupPaint):
+
+2010-03-30  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Copying from the Content tab in Resources includes line numbers.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35104
+
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer):
+        (WebInspector.TextViewer.prototype._beforeCopy):
+        (WebInspector.TextViewer.prototype._copy):
+
+2010-03-30  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Do not send empty matching rules for pseudo elements to frontend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36834
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype._update):
+
+2010-03-30  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Cannot animate "points" attribute for <svg:polygon>
+        https://bugs.webkit.org/show_bug.cgi?id=21371
+
+        Add animation support for 'points' on polygons in SVG. 
+
+        Test: svg/animations/animate-points.html
+
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::determinePropertyType):
+        (WebCore::SVGAnimateElement::calculateAnimatedValue):
+        (WebCore::SVGAnimateElement::calculateFromAndToValues):
+        (WebCore::SVGAnimateElement::resetToBaseValue):
+        (WebCore::SVGAnimateElement::applyResultsToTarget):
+        * svg/SVGAnimateElement.h:
+        (WebCore::SVGAnimateElement::): added PropertyType PointsProperty
+        * svg/SVGPointList.cpp:
+        (WebCore::blendFunc):
+        (WebCore::SVGPointList::createAnimated): calculates animated PointList
+        * svg/SVGPointList.h:
+
+2010-03-30  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Audits: bad CSS selector results in exception inside evaluated code
+        https://bugs.webkit.org/show_bug.cgi?id=36821
+
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.routine):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback):
+
+2010-03-29  Janne Koskinen  <janne.p.koskinen@digia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Package build fixes for Symbian
+
+        * enable building standalone QtWebkit for Symbian using qtlibinfix configuration option
+
+        qtlibinfix adds possibility having multiple versions of Qt in Symbian devices.
+        Fix also allows unfrozen DLL exports during development.
+
+        * Removed heap size configuration. DLLs don't have a heap.
+
+        * Removed enforcement to def files for package builds. Instead inherit the setting from
+        Qt's qconfig.pri whether to use def files or not. It's still possible to override this
+        also at qmake time by passing CONFIG+=def_files.
+
+        * WebCore.pro:
+
+2010-03-30  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Title for show/hide short records button was adjusted.
+        Some unused code was removed.
+        https://bugs.webkit.org/show_bug.cgi?id=36823
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+
+2010-03-30  Adam Roben  <aroben@apple.com>
+
+        Enable extra Direct3D debugging information in Debug builds
+
+        This makes it easier to track down memory leaks and misuses of the D3D
+        APIs in Debug builds.
+
+        Fixes <http://webkit.org/b/36820>
+
+        Reviewed by John Sullivan.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp: Define D3D_DEBUG_INFO
+        in Debug builds before #including d3d9.h so that extra D3D debugging
+        information will be enabled.
+
+2010-03-30  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - QtMaemoWebPopup class
+        https://bugs.webkit.org/show_bug.cgi?id=36790
+
+        Moving maemo5 theme related code from WebCore.pri to WebCore.pro and adding
+        new maemo menu lists popup class source and header to the project.
+
+        The code was in .pri file because of a theme css that was conditionally included.
+        As the css file is been included unconditionally there is no need to this
+        code to be kept in webcore.pri.
+
+        * WebCore.pri:
+        * WebCore.pro:
+
+2010-03-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by David Kilzer.
+
+        Guard Geolocation files with ENABLE_GEOLOCATION
+        https://bugs.webkit.org/show_bug.cgi?id=25756
+
+        The intent is to guard the Geolocation implementation files 
+        and minimize the impact on on clients/call sites.
+
+        * DerivedSources.make:
+        * WebCore.Geolocation.exp: Added. Exported interfaces if GEOLOCATION
+        is enabled.
+        * WebCore.base.exp:
+        * bindings/js/JSCustomPositionCallback.cpp:
+        * bindings/js/JSCustomPositionErrorCallback.cpp:
+        * bindings/js/JSGeolocationCustom.cpp:
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::disconnectFrame): Stub implementation if
+        GEOLOCATION is turned off.
+        (WebCore::Geolocation::Geolocation): Ditto.
+        (WebCore::Geolocation::~Geolocation): Ditto.
+        (WebCore::Geolocation::setIsAllowed): Ditto.
+        * page/Geolocation.h: 
+        * page/Geolocation.idl:
+        * page/GeolocationPositionCache.cpp:
+        * page/Geoposition.idl:
+        * page/PositionError.idl:
+        * platform/GeolocationService.cpp:
+        * platform/mock/GeolocationServiceMock.cpp:
+
+2010-03-30  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Support EventTarget interface in fake workers (both for Worker object
+        and WorkerContext). Use MessagePort to implement message passing to
+        support passing ports in PostMessage.
+        https://bugs.webkit.org/show_bug.cgi?id=36763
+
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.Worker.onmessageGetter):
+        (InjectedFakeWorker.Worker.onmessageSetter):
+        (InjectedFakeWorker.Worker):
+        (InjectedFakeWorker.FakeWorker):
+        (InjectedFakeWorker.FakeWorker.prototype.postMessage):
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        (InjectedFakeWorker.FakeWorker.prototype._onWorkerFrameLoaded):
+        (InjectedFakeWorker.FakeWorker.prototype._setupWorkerContext.onmessageGetter):
+        (InjectedFakeWorker.FakeWorker.prototype._setupWorkerContext.onmessageSetter):
+        (InjectedFakeWorker.FakeWorker.prototype._setupWorkerContext):
+        (InjectedFakeWorker.FakeWorker.prototype._addEventListener):
+        (InjectedFakeWorker.FakeWorker.prototype._removeEventListener):
+        (InjectedFakeWorker.FakeWorker.prototype._callbackWrapper):
+        (InjectedFakeWorker.FakeWorker.prototype._handleException):
+
+2010-03-30  Kristian Monsen  <kristianm@google.com>
+
+        Reviewed by David Levin.
+
+        [v8] Add if ENABLE guard for Worker specific code.
+        https://bugs.webkit.org/show_bug.cgi?id=36597
+
+        Build fix only, no new tests.
+
+        * bindings/v8/V8DOMWrapper.h:
+
+2010-03-29  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        More IndexedDB work
+        https://bugs.webkit.org/show_bug.cgi?id=36770
+
+        Add the "singleton" IndexedDatabase object to PageGroup
+        IndexedDatabase now has a create() method since PageGroup can own the instance (at least for now)
+        Rip out the IDBRequest stuff (now obsolete).
+        DOMWindow now can instantiate indexedDatabase objects on demand.
+
+        New layout tests starting with the next patch (which should make indexedDB.open() "work").
+
+        * WebCore.gypi:
+        * bindings/v8/custom/V8IDBRequestCustom.cpp: Removed.
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::indexedDB):
+        * page/DOMWindow.h:
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::indexedDatabase):
+        * page/PageGroup.h:
+        * storage/IDBDatabase.cpp:
+        * storage/IDBDatabaseRequest.h:
+        (WebCore::IDBDatabaseRequest::createObjectStore):
+        * storage/IDBDatabaseRequest.idl:
+        * storage/IDBRequest.cpp: Removed.
+        * storage/IDBRequest.h: Removed.
+        * storage/IDBRequest.idl: Removed.
+        * storage/IndexedDatabase.cpp:
+        (WebCore::IndexedDatabase::create):
+        * storage/IndexedDatabase.h:
+        * storage/IndexedDatabaseImpl.cpp:
+        (WebCore::IndexedDatabaseImpl::create):
+        (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl):
+        * storage/IndexedDatabaseImpl.h:
+        * storage/IndexedDatabaseRequest.cpp:
+        (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
+        * storage/IndexedDatabaseRequest.h:
+        (WebCore::IndexedDatabaseRequest::create):
+        * storage/IndexedDatabaseRequest.idl:
+        * storage/chromium/IndexedDatabase.cpp:
+        (WebCore::IndexedDatabase::create):
+
+2010-03-30  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG Glyph transformations wrong on use of SVGFont
+        https://bugs.webkit.org/show_bug.cgi?id=36731
+
+        Kerning on SVGFonts should be applied to the userSpace of the current Char
+        and not to the userSpace of the viewport. This means scaling the kerning
+        to match the current userSpace.
+
+        Test: svg/custom/glyph-transformation-with-hkern.svg
+
+        * rendering/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBox::buildLayoutInformationForTextBox):
+
+2010-03-30  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG Animation doesn't respect 'currentColor'
+        https://bugs.webkit.org/show_bug.cgi?id=36695
+
+        Test: svg/custom/animation-currentColor.svg
+
+        SVG Animation can't handle currentColor at the moment. This patch catches the
+        color value of the target element and replaces 'currentColor' with it's color string.
+
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::adjustForCurrentColor):
+        (WebCore::SVGAnimationElement::startedActiveInterval):
+
+2010-03-30  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Visible/captured records counter should be implemented in Timeline panel.
+        https://bugs.webkit.org/show_bug.cgi?id=36708
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype.get statusBarItems):
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype._updateRecordsCounter):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._createRootRecord):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._filterRecords):
+        * inspector/front-end/inspector.css:
+        (.timeline-records-counter):
+
+2010-03-30  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] define static variables with DEFINE_STATIC_LOCAL macro
+        https://bugs.webkit.org/show_bug.cgi?id=36653
+
+        Unreviewed, don't define the bool variable with
+        DEFINE_STATIC_LOCAL, it makes sense only for objects which have a
+        destructor. Thanks to Dan Bernstein for spotting this.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mimeTypeCache):
+
+2010-03-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Reviewed by Eric Seidel.
+
+        There is a build break due to the disabled() when wml feature is
+        enabled. This break comes from the Bug 35056 - Disabled menu options
+        are still submitted.(https://bugs.webkit.org/show_bug.cgi?id=35056)
+        The WMLOptionElement.h needs to define the disabled() as well.
+        And, there is an additional break due to Bug 36177 -  Multiselect Popup
+        - Listbox click simulation. (https://bugs.webkit.org/show_bug.cgi?id=36177)
+        virtual void listBoxSelectItem() should be added to WMLSelectElement.h as well.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36698
+
+        * wml/WMLOptionElement.h:
+        (WebCore::WMLOptionElement::disabled):
+        * wml/WMLSelectElement.h:
+        (WebCore::WMLSelectElement::listBoxSelectItem):
+
+2010-03-29  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by David Hyatt.
+
+        No vertical scrollbar after the CSS class change
+        https://bugs.webkit.org/show_bug.cgi?id=36461
+
+        Don't suppress scrollbar change for non-first layouts.
+        In the first layout, the scrollbar change will happen in later
+        adjustViewSize() call, but in other layouts, adjustViewSize() may
+        not be called when the size of contents doesn't change.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+
+2010-03-29  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Don't use unique domains for file:// separation: it breaks local
+        databases, and access to your own same-origin iframes. Instead, use
+        path-based access checks.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36692
+
+        Test: fast/xmlhttprequest/xmlhttprequest-no-file-access.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::initSecurityContext): renamed API.
+        * page/SecurityOrigin.h:
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::SecurityOrigin):
+          Initialize new flag. Take note of file:// path.
+          Copy new fields in copy constructor.
+        (WebCore::SecurityOrigin::canAccess):
+          Take into account path-based origin separation for file://
+        (WebCore::SecurityOrigin::enforceFilePathSeparation):
+          New method to enable file:// path origin separation.
+        (WebCore::SecurityOrigin::toString):
+          Return a null domain for an isolated file origin.
+        (WebCore::SecurityOrigin::isSameSchemeHostPort):
+          Take into account path-based origin separation for file://
+        (WebCore::SecurityOrigin::passesFileCheck):
+          Abstraction of common logic for file:// access checks.
+
+2010-03-29  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Change NotificationPresenter::checkPermission() to take the source frames full KURL,
+        rather than its SecurityOrigin. This will aid chromium in having more fine grained
+        permissions to control notification spam.
+
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+        * notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::checkPermission):
+        * notifications/NotificationPresenter.h:
+
+2010-03-29  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Multiselect - Adding method itemIsSelected() to QtAbstractWebPopup
+        https://bugs.webkit.org/show_bug.cgi?id=36769
+
+        Adding method itemIsSelected() to QtAbstractWebPopup.
+
+        * platform/qt/QtAbstractWebPopup.h:
+        (WebCore::QtAbstractWebPopup::itemIsSelected):
+
+2010-03-29  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        Added a function, WebCore::shouldTreatAsAttachment, to HTTPParsers.*
+
+        https://bugs.webkit.org/show_bug.cgi?id=36395
+
+        This function, which was moved from WebKit/chromium/src/FrameClientImpl.cpp,
+        is used to check whether or not a request is supposed to be rendered or
+        simply downloaded based on the "Content-Disposition" header sent by the
+        web server. The intent of code refactoring is to avoid code duplication
+        so that this piece of code can be used by other implementations such as
+        QtWebKit.
+
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::shouldTreatAsAttachment):
+        * platform/network/HTTPParsers.h:
+
+2010-03-29  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Bug 36735 - Live regions don't send out notifications when the element changing is the live region
+        https://bugs.webkit.org/show_bug.cgi?id=36735
+
+        Test: platform/mac/accessibility/aria-liveregion-on-image.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::contentChanged):
+
+2010-03-29  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        In order to speed up multiple calls to CSSPrimitiveValue::cssText(),
+        this CL caches the String result.  When m_value is changed, the
+        cached string is cleared.  This gives a good speedup on benchmarks
+        which do a lot of CSS property gets, such as Peacekeeper.
+        The processing cost should be negligible, since the strings are 
+        refcounted.  The memory cost is an additional 4 bytes per
+        CSSPrimitiveValue, and the extended lifetime of the computed string
+        (potentially, the same as the lifetime of the CSSPrimitiveValue).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36556
+
+        Covered by fast/css/cssText-cache.html, and more.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::cssText):
+        * css/CSSPrimitiveValue.h:
+
+2010-03-22  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        When enabling Web Widgets, add support for the view-mode media
+        feature (http://www.w3.org/TR/widgets-vmmf/).
+
+        Test: fast/media/media-feature-wgt-view-mode.html
+
+        * css/CSSValueKeywords.in:
+        * css/MediaFeatureNames.h:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::view_modeMediaFeatureEval):
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::isDocked):
+        (WebCore::ChromeClient::isFloating):
+        (WebCore::ChromeClient::isApplication):
+        (WebCore::ChromeClient::isFullscreen):
+
+2010-03-29  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=36737
+
+        No new tests; ran WebGL demos in Chromium on Windows to verify fix.
+
+        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+
+2010-03-29  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Cover the Audits panel with tests
+        https://bugs.webkit.org/show_bug.cgi?id=36613
+
+        Sort results, add a few drive-by fixes and refactorings to improve testability.
+
+        Test: inspector/audits-panel-functional.html
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/AuditResultView.js:
+        (WebInspector.AuditResultView):
+        (WebInspector.AuditCategoryResultPane.ruleSorter):
+        (WebInspector.AuditCategoryResultPane):
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.GzipRule.prototype.doRun):
+        (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditRuleResult.linkifyDisplayName):
+        (WebInspector.AuditRuleResult.resourceDomain):
+        (WebInspector.AuditRuleResult.prototype.addURL):
+        * inspector/front-end/inspector.js:
+        (WebInspector.displayNameForURL):
+
+2010-03-29  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by nobody, build fix.
+
+        [Qt] Fix build break introduced in r56724.
+
+        * WebCore.pro:
+
+2010-03-29  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector should highlight when clicking a node's closing tag
+        https://bugs.webkit.org/show_bug.cgi?id=16258
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeOutline.prototype.set suppressRevealAndSelect):
+        (WebInspector.ElementsTreeOutline.prototype.revealAndSelectNode):
+        (WebInspector.ElementsTreeOutline.prototype._keyDown):
+        (WebInspector.ElementsTreeOutline.prototype._onmousemove):
+        (WebInspector.ElementsTreeElement):
+        (WebInspector.ElementsTreeElement.prototype.showChild):
+        (WebInspector.ElementsTreeElement.prototype.onpopulate):
+        (WebInspector.ElementsTreeElement.prototype.updateChildren):
+        (WebInspector.ElementsTreeElement.prototype.insertChildElement):
+        (WebInspector.ElementsTreeElement.prototype.moveChild):
+        (WebInspector.ElementsTreeElement.prototype._updateChildren):
+        (WebInspector.ElementsTreeElement.prototype.onexpand):
+        (WebInspector.ElementsTreeElement.prototype.oncollapse):
+        (WebInspector.ElementsTreeElement.prototype.onselect):
+        (WebInspector.ElementsTreeElement.prototype.ondblclick):
+        ():
+
+2010-03-29  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36315
+
+        Remove obsolete Geolocation::m_currentPosition
+        (follow up on https://bugs.webkit.org/show_bug.cgi?id=30676)
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::positionChanged):
+        (WebCore::Geolocation::makeSuccessCallbacks):
+        * page/Geolocation.h:
+        * platform/chromium/GeolocationServiceChromium.cpp:
+        (WebCore::GeolocationServiceChromium::GeolocationServiceChromium):
+
+2010-03-29  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Do not generate INSTALLS for webkit when building inside Qt.
+        Qt will do this for us.
+
+        * WebCore.pro:
+
+2010-03-29  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36703
+        Timer restart loop during page loading
+        
+        Fix regression introduced in http://trac.webkit.org/changeset/54526. 
+        Restarting the request timer unconditionally from the timer callback is a bad idea. 
+        Instead, start the timer when a non-cached request completes.
+
+        * loader/loader.cpp:
+        (WebCore::Loader::Host::nonCacheRequestComplete):
+        (WebCore::Loader::Host::servePendingRequests):
+
+2010-03-29  Thomas Zander  <t.zander@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Shadowbuilds of WebCore with Qt on Symbian fails.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36749
+
+        Doing a 'make sis' expects the dll in the libdir, so place it
+        there. This fixes out-of-source building to always put the dll
+        in the expected dir.
+
+        * WebCore.pro: Fix for shadow builds inside Qt.
+
+2010-03-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Implement flattening for iframes.
+
+        Refactoring of frameset flattening code to reuse it for
+        iframe flattening.
+
+        Tests: fast/frames/flattening/iframe-flattening-simple.html
+
+        * WebCore.base.exp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::scheduleRelayout):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setFrameFlatteningEnabled):
+        * page/Settings.h:
+        (WebCore::Settings::frameFlatteningEnabled):
+        * rendering/RenderFrame.cpp:
+        * rendering/RenderFrame.h:
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::flattenFrameSet):
+        * rendering/RenderFrameSet.h:
+        * rendering/RenderPart.cpp:
+        (WebCore::RenderPart::layoutWithFlattening):
+        * rendering/RenderPart.h:
+        * rendering/RenderPartObject.cpp:
+        (WebCore::RenderPartObject::flattenFrame):
+        (WebCore::RenderPartObject::calcHeight):
+        (WebCore::RenderPartObject::calcWidth):
+        (WebCore::RenderPartObject::layout):
+        * rendering/RenderPartObject.h:
+
+2010-03-29  Andrei Popescu  <andreip@google.com>
+
+        Reviewed by Adam Barth.
+
+        Page Cache does not work on Android with V8
+        https://bugs.webkit.org/show_bug.cgi?id=36665
+
+        No new tests, existing tests should suffice, this is platform code.
+
+        This implementation simply saves the context and the global object
+        just before the frame is navigated to a new url. At restore time,
+        the global object is reattached to the context and the context
+        is attached to the window shell of the frame.
+
+        Note that isolated worlds are not taken into account in any way,
+        as Android does not use them.
+
+        * bindings/v8/ScriptCachedFrameData.cpp: Added.
+        (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
+        (WebCore::ScriptCachedFrameData::domWindow):
+        (WebCore::ScriptCachedFrameData::~ScriptCachedFrameData):
+        (WebCore::ScriptCachedFrameData::restore):
+        (WebCore::ScriptCachedFrameData::clear):
+        * bindings/v8/ScriptCachedFrameData.h:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::setContext):
+        * bindings/v8/V8DOMWindowShell.h:
+
+2010-03-29  Thomas Zander  <t.zander@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Make it possible to build using both Windows and Linux for Symbian
+        https://bugs.webkit.org/show_bug.cgi?id=36748
+
+        * WebCore.pro: don't assume Windows buildsystem is the only one
+        and exclude the windows-only setters from the linux builds.
+
+2010-03-29  Thomas Zander  <t.zander@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36745
+
+        [Qt] Fix def file builds with Qt 4.7.
+
+        Switched to using DEF_FILE, which is the official variable.
+
+        * WebCore.pro: Use DEF_FILE
+
+2010-03-24  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        A few more steps towards IndexedDB
+        https://bugs.webkit.org/show_bug.cgi?id=36546
+
+        Add a callback interface to be used by all async methods.
+        Add the first fragments of IDBDatabase.
+        Clean up on IDBDatabaseError.
+        Flesh out IndexedDatabase further.
+
+        Not enough hooked up yet to test.  Soon though...
+
+        * WebCore.gypi:
+        * storage/IDBCallbacks.h: Added.
+        (WebCore::IDBCallbacks::~IDBCallbacks):
+        * storage/IDBDatabase.cpp: Added.
+        * storage/IDBDatabase.h: Added.
+        (WebCore::IDBDatabase::~IDBDatabase):
+        * storage/IDBDatabaseError.h:
+        (WebCore::IDBDatabaseError::create):
+        (WebCore::IDBDatabaseError::message):
+        (WebCore::IDBDatabaseError::IDBDatabaseError):
+        * storage/IndexedDatabase.h:
+        * storage/IndexedDatabaseImpl.cpp:
+        (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::open):
+        * storage/IndexedDatabaseImpl.h:
+        * storage/IndexedDatabaseRequest.cpp:
+        (WebCore::IndexedDatabaseRequest::open):
+
+2010-03-29  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Remove a possibility of confusion from Profiles panel Welcome screen
+        by turning buttons into non-clickable glyphs. Also, span instructions
+        alongside panel width.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34319
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ProfileView.js:
+        (WebInspector.CPUProfileType.prototype.get welcomeMessage):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype._addWelcomeMessage):
+        * inspector/front-end/inspector.css:
+        (.panel-enabler-view.welcome .instructions):
+        (.panel-enabler-view.welcome button.status-bar-item):
+
+2010-03-26  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [GStreamer] define static variables with DEFINE_STATIC_LOCAL macro
+        https://bugs.webkit.org/show_bug.cgi?id=36653
+
+        Defined the static variables using DEFINE_STATIC_GLOBAL.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mimeTypeCache):
+
+2010-03-26  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [GStreamer] player header cleanups
+        https://bugs.webkit.org/show_bug.cgi?id=36656
+
+        Destructor made private and added missing
+        mediaPlayerPrivateMuteChangedCallback declaration.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-29  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Protect global object from being GC'ed if there are messages written to console from the iframe with that global object.
+
+        Whent serializing objects in the injected script check that global object properties are still defined before using them as arguments. The may become undefined if owning frame navigated to a different domain.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36612
+
+        Test: http/tests/inspector-enabled/console-log-before-frame-navigation.html
+
+        * bindings/js/ScriptState.h:
+        (WebCore::ScriptStateProtectedPtr::ScriptStateProtectedPtr):
+        (WebCore::ScriptStateProtectedPtr::get):
+        * bindings/v8/ScriptState.h:
+        (WebCore::ScriptStateProtectedPtr::ScriptStateProtectedPtr):
+        (WebCore::ScriptStateProtectedPtr::~ScriptStateProtectedPtr):
+        (WebCore::ScriptStateProtectedPtr::get):
+        * inspector/ConsoleMessage.cpp:
+        (WebCore::ConsoleMessage::addToFrontend):
+        * inspector/ConsoleMessage.h:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+        (injectedScriptConstructor.):
+
+2010-03-26  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Carlson.
+
+        It should be possible to use GStreamer in addition to another media engine
+        https://bugs.webkit.org/show_bug.cgi?id=36654
+
+        Renamed gstreamer player and added a WTF_USE_GSTREAMER
+        define. Made the MediaPlayer register the GStreamer backend only
+        if it's enabled (true by default on WebKitGTK+).
+
+        * GNUmakefile.am:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::installedMediaEngines):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mediaPlayerPrivateMessageCallback):
+        (WebCore::mediaPlayerPrivateSourceChangedCallback):
+        (WebCore::mediaPlayerPrivateVolumeChangedCallback):
+        (WebCore::mediaPlayerPrivateMuteChangedCallback):
+        (WebCore::mediaPlayerPrivateRepaintCallback):
+        (WebCore::MediaPlayerPrivateGStreamer::create):
+        (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
+        (WebCore::MediaPlayerPrivateGStreamer::isAvailable):
+        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
+        (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
+        (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
+        (WebCore::MediaPlayerPrivateGStreamer::play):
+        (WebCore::MediaPlayerPrivateGStreamer::pause):
+        (WebCore::MediaPlayerPrivateGStreamer::duration):
+        (WebCore::MediaPlayerPrivateGStreamer::currentTime):
+        (WebCore::MediaPlayerPrivateGStreamer::seek):
+        (WebCore::MediaPlayerPrivateGStreamer::startEndPointTimerIfNeeded):
+        (WebCore::MediaPlayerPrivateGStreamer::cancelSeek):
+        (WebCore::MediaPlayerPrivateGStreamer::endPointTimerFired):
+        (WebCore::MediaPlayerPrivateGStreamer::paused):
+        (WebCore::MediaPlayerPrivateGStreamer::seeking):
+        (WebCore::MediaPlayerPrivateGStreamer::naturalSize):
+        (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
+        (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
+        (WebCore::MediaPlayerPrivateGStreamer::setVolume):
+        (WebCore::MediaPlayerPrivateGStreamer::volumeChangedTimerFired):
+        (WebCore::MediaPlayerPrivateGStreamer::volumeChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::setRate):
+        (WebCore::MediaPlayerPrivateGStreamer::networkState):
+        (WebCore::MediaPlayerPrivateGStreamer::readyState):
+        (WebCore::MediaPlayerPrivateGStreamer::buffered):
+        (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
+        (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
+        (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
+        (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
+        (WebCore::MediaPlayerPrivateGStreamer::bytesLoaded):
+        (WebCore::MediaPlayerPrivateGStreamer::totalBytes):
+        (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
+        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
+        (WebCore::MediaPlayerPrivateGStreamer::mediaLocationChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
+        (WebCore::MediaPlayerPrivateGStreamer::loadStateChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::sizeChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::timeChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::didEnd):
+        (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::supportsMuting):
+        (WebCore::MediaPlayerPrivateGStreamer::setMuted):
+        (WebCore::MediaPlayerPrivateGStreamer::muteChangedTimerFired):
+        (WebCore::MediaPlayerPrivateGStreamer::muteChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
+        (WebCore::MediaPlayerPrivateGStreamer::setSize):
+        (WebCore::MediaPlayerPrivateGStreamer::setVisible):
+        (WebCore::MediaPlayerPrivateGStreamer::repaint):
+        (WebCore::MediaPlayerPrivateGStreamer::paint):
+        (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
+        (WebCore::MediaPlayerPrivateGStreamer::supportsType):
+        (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
+        (WebCore::MediaPlayerPrivateGStreamer::supportsFullscreen):
+        (WebCore::MediaPlayerPrivateGStreamer::setPreload):
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36733
+        Use a common header for Windows virtual key codes on all platforms
+
+        No change in functionality, so no new tests.
+
+        * platform/WindowsKeyboardCodes.h: Added. Define VK_* key codes as macros, matching Windows.
+
+        * platform/KeyboardCodes.h: Removed.
+        * platform/android/KeyboardCodes.h: Removed.
+        * platform/chromium/KeyboardCodesPosix.h: Removed.
+        * platform/chromium/KeyboardCodesWin.h: Removed.
+        * platform/haiku/KeyboardCodes.h: Removed.
+        * platform/wx/KeyboardCodes.h: Removed.
+        Removed platform specific attempts to do the same thing. In fact, platform/KeyboardCodes.h
+        was supposed to be cross-platform, but it didn't have a sufficiently descriptive name, and
+        its name was the same as platform-specific versions, so I chose a new one.
+
+        * platform/chromium/KeyboardCodes.h: Copied from WebCore/platform/chromium/KeyboardCodesWin.h.
+        Chromium redefines Windows constants to different names; keeping the header doing that to
+        avoid breaking Chromium code.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        Replaced KeyboardCodes.h with WindowsKeyboardCodes.h.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::windowsKeyCodeForKeyCode):
+        (WebCore::windowsKeyCodeForCharCode):
+        Mac used to hardcode the key codes; changed to use VK_* macros.
+
+        * config.h: Removed a hack to include KeyboardCodes.h, it shouldn't be necessary any more.
+
+        * platform/android/KeyEventAndroid.cpp:
+        * platform/brew/PlatformKeyboardEventBrew.cpp:
+        * platform/efl/PlatformKeyboardEventEfl.cpp:
+        * platform/gtk/KeyEventGtk.cpp:
+        * platform/haiku/PlatformKeyboardEventHaiku.cpp:
+        * platform/qt/PlatformKeyboardEventQt.cpp:
+        * platform/wx/KeyboardEventWx.cpp:
+        Changed to include WindowsKeyboardCodes.h.
+
+2010-03-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Remove the definition of WTF_CHANGES guards from the build system
+        https://bugs.webkit.org/show_bug.cgi?id=31670
+
+        No new tests as there is no new functionality.
+
+        * WebCore.pri: Remove the definition of WTF_CHANGES
+        as it is already defined in config.h
+
+2010-03-28  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Clean up the Xcode project a bit.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-28  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Toggling style properties on/off does not always work.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36720
+
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::toggleStyleEnabled):
+        (WebCore::InspectorDOMAgent::buildObjectForStyle):
+        (WebCore::InspectorDOMAgent::buildArrayForDisabledStyleProperties):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.CSSStyleDeclaration):
+
+2010-03-28  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: resource links should navigate to resource panel enabler when resource tracking is off.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36722
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentMouseOver):
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+
+2010-03-28  Dirk Schulze  <krit@webkit.org>
+
+        Unreviewed build-fix for chromium linux.
+
+        SVGResourceMarker needs to be moved to RenderersSVGResourceMarker
+        https://bugs.webkit.org/show_bug.cgi?id=36185
+
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+
+2010-03-28  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResourceMarker needs to be moved to RenderersSVGResourceMarker
+        https://bugs.webkit.org/show_bug.cgi?id=36185
+
+        This moves SVGResourceMarker to RenderersSVGResourceMarker. This follows other
+        SVG resources like masker and clipper and makes DRT results more readable and
+        adds additonal informations.
+        Some marker specific code also moved out from RenderSVGViewportContainer to 
+        RenderersSVGResourceMarker.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::calculateMarkerBoundsIfNeeded):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::destroy):
+        * rendering/RenderSVGResource.h:
+        (WebCore::):
+        * rendering/RenderSVGResourceMarker.cpp: Added.
+        (WebCore::RenderSVGResourceMarker::RenderSVGResourceMarker):
+        (WebCore::RenderSVGResourceMarker::~RenderSVGResourceMarker):
+        (WebCore::RenderSVGResourceMarker::layout):
+        (WebCore::RenderSVGResourceMarker::addClient):
+        (WebCore::RenderSVGResourceMarker::invalidateClients):
+        (WebCore::RenderSVGResourceMarker::invalidateClient):
+        (WebCore::RenderSVGResourceMarker::applyViewportClip):
+        (WebCore::RenderSVGResourceMarker::markerBoundaries):
+        (WebCore::RenderSVGResourceMarker::localToParentTransform):
+        (WebCore::RenderSVGResourceMarker::referencePoint):
+        (WebCore::RenderSVGResourceMarker::angle):
+        (WebCore::RenderSVGResourceMarker::markerTransformation):
+        (WebCore::RenderSVGResourceMarker::draw):
+        (WebCore::RenderSVGResourceMarker::markerContentTransformation):
+        (WebCore::RenderSVGResourceMarker::viewportTransform):
+        (WebCore::RenderSVGResourceMarker::calcViewport):
+        * rendering/RenderSVGResourceMarker.h: Added.
+        (WebCore::RenderSVGResourceMarker::renderName):
+        (WebCore::RenderSVGResourceMarker::applyResource):
+        (WebCore::RenderSVGResourceMarker::resourceBoundingBox):
+        (WebCore::RenderSVGResourceMarker::markerUnits):
+        (WebCore::RenderSVGResourceMarker::resourceType):
+        * rendering/RenderSVGViewportContainer.cpp:
+        (WebCore::RenderSVGViewportContainer::calcViewport):
+        (WebCore::RenderSVGViewportContainer::viewportTransform):
+        * rendering/RenderSVGViewportContainer.h:
+        * rendering/SVGMarkerData.h:
+        (WebCore::SVGMarkerData::SVGMarkerData):
+        (WebCore::SVGMarkerData::marker):
+        (WebCore::SVGMarkerData::updateTypeAndMarker):
+        * rendering/SVGMarkerLayoutInfo.cpp:
+        (WebCore::processStartAndMidMarkers):
+        (WebCore::SVGMarkerLayoutInfo::calculateBoundaries):
+        (WebCore::SVGMarkerLayoutInfo::addLayoutedMarker):
+        * rendering/SVGMarkerLayoutInfo.h:
+        (WebCore::MarkerLayout::MarkerLayout):
+        (WebCore::SVGMarkerLayoutInfo::midMarker):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::deregisterFromResources):
+        * rendering/SVGRenderSupport.h:
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::operator<<):
+        (WebCore::writeSVGResource):
+        * svg/SVGMarkerElement.cpp:
+        (WebCore::SVGMarkerElement::svgAttributeChanged):
+        (WebCore::SVGMarkerElement::childrenChanged):
+        (WebCore::SVGMarkerElement::setOrientToAuto):
+        (WebCore::SVGMarkerElement::setOrientToAngle):
+        (WebCore::SVGMarkerElement::createRenderer):
+        * svg/SVGMarkerElement.h:
+        (WebCore::SVGMarkerElement::):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/graphics/SVGResource.h:
+        (WebCore::):
+        (WebCore::SVGResource::isFilter):
+        * svg/graphics/SVGResourceMarker.cpp: Removed.
+        * svg/graphics/SVGResourceMarker.h: Removed.
+
+2010-03-28  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Consolidate Tree Hierarchy Attribute HTML Generation
+        https://bugs.webkit.org/show_bug.cgi?id=36719
+
+          Consolidates the generation of Element Tree Hierarchy attribute code
+          generation to a single function: _attributeHTML.
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._addNewAttribute): convert to use attributeHTML.
+        (WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted.regenerateStyledAttribute): convert to use attributeHTML.
+        (WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted):
+        (WebInspector.ElementsTreeElement.prototype._attributeHTML): a single point for generating the html for attributes.
+
+2010-03-28  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Edit Tag Names
+        https://bugs.webkit.org/show_bug.cgi?id=36481
+
+          Ensure blacklisting happens by checking it in _startEditingTagName
+          instead of all the possible entry points.
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._startEditingFromEvent): don't check blacklist here.
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName): check blacklist here.
+
+2010-03-28  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] GraphicsLayer: Timing functions don't work with transitions
+        https://bugs.webkit.org/show_bug.cgi?id=36589
+
+        If the animation value doesn't have timing function set, we need to
+        use the animation's timing function.
+        
+        Fixed also a bug in passing the duration to solveCubicBezierFunction.
+        The duration was divided two times by 1000 and meanwhile casted to int.
+        It needs to be kept as double and divided by 1000 only once.
+
+        Test case: https://bugs.webkit.org/attachment.cgi?id=51619
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::applyTimingFunction):
+        (WebCore::AnimationQt:::AnimationQtBase):
+        (WebCore::AnimationQt::updateCurrentTime):
+
+2010-03-27  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Edit Tag Names
+        https://bugs.webkit.org/show_bug.cgi?id=36481
+
+        Allow tabbing back and forth between the tag name and element
+        attributes when editing. Also, fixed a number of minor issues with
+        editing attributes and tabbing.
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName): find the tag name if it wasn't provided.
+        (WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted): fix tabbing issues, enable tab to tag name.
+        (WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted.regenerateStyledAttribute): cleanup styles when tabbing.
+        * inspector/front-end/inspector.css: do not display <br>s while editing
+
+2010-03-27  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Edit Tag Names
+        https://bugs.webkit.org/show_bug.cgi?id=36481
+        
+        Allow editing an Element's Tag Name by double clicking
+        on the tag name in the Element's Tree Hierarchy.
+        
+          The usual asynchronous InspectorBackend, InspectorDOMAgent, InspectorFrontend flow.
+
+        * inspector/InspectorBackend.cpp: moved DOM manipulation to InspectorDOMAgent
+        (WebCore::InspectorBackend::removeNode):
+        (WebCore::InspectorBackend::changeTagName):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::removeNode):
+        (WebCore::InspectorDOMAgent::changeTagName):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didChangeTagName):
+        * inspector/InspectorFrontend.h:
+
+        * inspector/front-end/DOMAgent.js:
+
+          Handle the UI for editing an Element's tag name.
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._startEditingFromEvent): allow editing from double click.
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName.keyupListener): update the closing tag
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName.editingComitted): remove extra listener and commit
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName.editingCancelled): remove extra listener and cancel
+        (WebInspector.ElementsTreeElement.prototype._startEditingTagName):
+        (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted.cancel):
+        (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted.moveToNextAttributeIfNeeded):
+        (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted.editTagNameCallback):
+        (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted):
+        (WebInspector.ElementsTreeElement.prototype._distinctClosingTagElement): get the closing tag for an opening tag
+        (WebInspector.ElementsTreeElement.prototype._nodeTitleInfo): wrap the tagName in span.webkit-html-tag-name
+
+          Miscellaneous updates.
+
+        * inspector/front-end/treeoutline.js: fixed a typo.
+
+2010-03-27  Dmitry Gorbik  <socket.h@gmail.com>
+
+        Reviewed by Pavel Feldman.
+
+        Fix the regression caused by r28078: a global variable
+        definition masks a local one in an inspector console
+        https://bugs.webkit.org/show_bug.cgi?id=32442
+
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-03-27  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7801598> REGRESSION (r56182): iWeb shadow drawn around image rectangle, not around opaque part of the image
+        https://bugs.webkit.org/show_bug.cgi?id=36700
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::createColor): Reverted to returning an RGB color value rather than an
+        identifier for the transparent color.
+
+2010-03-26  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Converge Inspector ids to be long, not ints
+        https://bugs.webkit.org/show_bug.cgi?id=36706
+
+          Part 1: Converge on `long` for callIds, nodeIds, and other Ids.
+
+        * inspector/InspectorController.cpp:
+        * inspector/InspectorController.h:
+        * inspector/InspectorDOMAgent.cpp:
+        * inspector/InspectorFrontend.cpp:
+        * inspector/InspectorFrontend.h:
+
+2010-03-27  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: add layout test for styles panel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36699
+
+        Test: inspector/elements-panel-styles.html
+
+        * inspector/front-end/inspector.css:
+        (#elements-content):
+        (#elements-sidebar):
+        * inspector/front-end/inspector.js:
+        (WebInspector.displayNameForURL):
+        * inspector/front-end/utilities.js:
+        (String.prototype.trimURL):
+
+2010-03-27  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Darin Adler.
+
+        CSSPrimitiveValue::setFloatValue/setStringValue should throw an exception if passed an incorrect unit type.
+        <http://webkit.org/b/36680> / <rdar://problem/7801016>
+
+        Test: fast/dom/setPrimitiveValue-exceptions.html
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::setFloatValue): Throw an INVALID_ACCESS_ERR if either of our type or the passed-in
+        type is not a numeric type.
+        (WebCore::CSSPrimitiveValue::setStringValue): Throw an INVALID_ACCESS_ERR if either of our type or the passed-in
+        type is not a string type.
+
+2010-03-27  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by nobody, fix typo in previous commit.
+
+        Allow plugins implemented by the application, such as mimetype 'x-qt-plugin',
+         when pluginsEnabled is false
+
+        Fix parentheses typo in r56661. This happened while rebasing and was not present
+        in the reviewed patch, so committing unreviewed.
+
+        https://bugs.webkit.org/attachment.cgi?id=49515
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestObject):
+
+2010-03-26  Robert Hogan  <robert@roberthogan.net>
+
+        Reviewed by Simon Hausmann.
+
+        Allow plugins implemented by the application, such as mimetype 'x-qt-plugin',
+         when pluginsEnabled is false.
+
+        The purpose of disabling plugins is to prevent the execution of third-party code
+        that may be untrustworthy. Qt plugins are implemented by the client rather than
+        loaded from an external source, so the client should have the opportunity to
+        consider them separately from other plugins.
+
+        Add a function MimeTypeRegistry::isApplicationPluginMIMEType() that WebKit
+        uses in conjunction with arePluginsEnabled() to determine if it should attempt
+        to load a plugin. If isApplicationPluginMIMEType() returns true, WebKit will load
+        the plugin even if arePluginsEnabled() is false.
+
+        Currently, only Qt has application-implemented plugins: these use the mimetype
+        'x-qt-plugin' and 'x-qt-styled-widget'. This patch permits Qt clients'
+        reimplementation of QWebPage::createPlugin() to decide whether or not
+        to create a Qt plugin, even when arePluginsEnabled is false.
+
+        For all platforms apart from Qt, isApplicationPluginMIMEType() returns false.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32196
+
+        Test: plugins/application-plugin-plugins-disabled.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestObject):
+        * platform/MIMETypeRegistry.h:
+        * platform/brew/MIMETypeRegistryBrew.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/chromium/MIMETypeRegistryChromium.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/gtk/MIMETypeRegistryGtk.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/haiku/MIMETypeRegistryHaiku.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/mac/MIMETypeRegistryMac.mm:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/qt/MIMETypeRegistryQt.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/win/MIMETypeRegistryWin.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/wince/MIMETypeRegistryWince.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        * platform/wx/MimeTypeRegistryWx.cpp:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+
+2010-03-27  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Fix Acid3 text-shadow rendering regression introduced in r56597.
+
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::Font::drawGlyphs): Revert to using the simple shadow logic for zero-blur shadows,
+        except for color bitmap fonts.
+
+2010-03-26  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Beth Dakin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=9268
+
+        As per sections 14.2 (http://www.w3.org/TR/CSS2/colors.html#background)
+        and 17.5.1 (http://www.w3.org/TR/CSS2/tables.html#table-layers) of the
+        CSS 2.1 spec., the background-image of a table-row should span the
+        entire area of the table-row (i.e cover all the <td>'s). Moreover,
+        fixes background image painting with respect to row-groups, columns
+        and column-groups (*).
+
+        Currently, the background-image of a table row, row-group, and column-group
+        is inherited by the table cells. This directly contradicts section 14.2.
+        Instead, the background-image should cover the entire area of the table row,
+        row-group, column, or column-group, respectively as described in section 17.5.1.
+
+        (*) A follow up patch to compute the absolute content box of a column, and
+        column-group is needed so that background image positioning for these table
+        elements works. See bug #36104.
+
+        Tests: fast/table/table-background.html
+               fast/table/table-cell-border-draws-on-top-of-col-background.html
+               fast/table/table-cell-border-draws-on-top-of-col-group-background.html
+               fast/table/table-cell-border-draws-on-top-of-row-background.html
+               fast/table/table-cell-border-draws-on-top-of-row-group-background.html
+               fast/table/table-cell-overrides-row-background.html
+               fast/table/table-col-background.html
+               fast/table/table-col-group-background.html
+               fast/table/table-col-group-col-span-background.html
+               fast/table/table-col-group-span-background.html
+               fast/table/table-col-span-background.html
+               fast/table/table-row-background-left-50px.html
+               fast/table/table-row-background-right-100percent.html
+               fast/table/table-row-background-right-50px.html
+               fast/table/table-row-background.html
+               fast/table/table-row-group-background-positioned.html
+               fast/table/table-row-group-background.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Modified
+        to call RenderObject::adjustBackgroundImagePosition.
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::adjustBackgroundImagePosition): Added.
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::adjustBackgroundImagePosition): Added.
+        * rendering/RenderTableCell.h:
+
+2010-03-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed, minor build fix.
+
+        [Gtk] Guard defined but not used function
+        
+        Eliminate the "defined but not used" warning after r52684.
+        No new tests as there is no new functionality.
+
+        * platform/ContextMenu.cpp:
+
+2010-03-26  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Security: iFrame.src accepts JavaScript URL via nodeValue or textContent
+        https://bugs.webkit.org/show_bug.cgi?id=36502
+
+        Overrode inherited nodeValue and textContent in Attr.idl so they proxy 
+        to value, which performs a security check.
+
+        Test: http/tests/security/xss-DENIED-iframe-src-alias.html
+
+        * bindings/js/JSAttrCustom.cpp:
+        (WebCore::JSAttr::nodeValue):
+        (WebCore::JSAttr::setNodeValue):
+        (WebCore::JSAttr::textContent):
+        (WebCore::JSAttr::setTextContent):
+        * bindings/v8/custom/V8AttrCustom.cpp:
+        (WebCore::V8Attr::nodeValueAccessorSetter):
+        (WebCore::V8Attr::nodeValueAccessorGetter):
+        (WebCore::V8Attr::textContentAccessorSetter):
+        (WebCore::V8Attr::textContentAccessorGetter):
+        * dom/Attr.idl:
+
+2010-03-26  Eric Carlson  <eric.carlson@apple.com>
+
+        <rdar://problem/7320584> 
+        https://bugs.webkit.org/show_bug.cgi?id=36681
+        "new Audio()" doesn't work with plug-in backed media engine.
+
+        Don't require plug-in backed <video> and <audio> elements to be in the document to play.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_proxyWidget
+        (WebCore::HTMLMediaElement::createRenderer): Set renderer widget if it has already been
+        allocated.
+        (WebCore::HTMLMediaElement::scheduleLoad): Call createMediaPlayerProxy to make sure we
+        have a plug-in proxy.
+        (WebCore::HTMLMediaElement::loadResource): Ditto.
+        (WebCore::HTMLMediaElement::ensureMediaPlayer): Allocate media player.
+        (WebCore::HTMLMediaElement::setMediaPlayerProxy): Call ensureMediaPlayer.
+        (WebCore::HTMLMediaElement::getPluginProxyParams): New, return the url and params vectors.
+        (WebCore::HTMLMediaElement::finishParsingChildren): Call createMediaPlayerProxy.
+        (WebCore::HTMLMediaElement::createMediaPlayerProxy): New, allocate the proxy widget if necessary.
+        * html/HTMLMediaElement.h:
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::createMediaPlayerProxyPlugin): Add declaration.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::toPlugInElement): Don't allow an audio or video element to be cast to a plug-in element.
+        (WebCore::FrameLoader::loadPlugin):
+        (WebCore::FrameLoader::loadMediaPlayerProxyPlugin): New, allocate a media player proxy plug-in.
+
+        * loader/FrameLoader.h: Declare loadMediaPlayerProxyPlugin.
+
+        * loader/FrameLoaderClient.h: Declare createMediaPlayerProxyPlugin.
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::updateWidget): Call loadMediaPlayerProxyPlugin when passed an
+        audio or video node.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
+
+         * rendering/RenderVideo.cpp:
+         (WebCore::RenderVideo::RenderVideo): Get default width and height from defaultSize.
+         (WebCore::RenderVideo::defaultSize): New, return the spec defined default width and height.
+         * rendering/RenderVideo.h:
+
+2010-03-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein, Darin Adler.
+
+        Re-entrant layout via plug-ins may cause crashes with bad RenderWidgets
+        https://bugs.webkit.org/show_bug.cgi?id=36675
+        <rdar://problem/7787617>
+        
+        Fix two places in the code where RenderWidgets can get destroyed while being iterated over.
+        This can happen when plug-ins execute script from NPP_SetWindow, and that script makes a change
+        to the page that destroys a RenderWidget.
+
+        Tests: plugins/reentrant-update-widget-positions.html
+               plugins/update-widgets-crash.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::updateWidgets): ref() the RenderEmbeddedObjects that are put into the
+        vector before iterating of them, and deref() them at the end. Rather than checking the m_widgetUpdateSet
+        to see if the RenderWidget is still live, test object->node().
+        
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::RenderView): Initialize some data members to make it more obvious in the debugger
+        that the object is not garbage.
+        (WebCore::RenderView::updateWidgetPositions): Use a Vector of RenderWidget* to keep the RenderWidgets
+        alive during iteration, by reffing and dereffing them.
+        * rendering/RenderWidget.h:
+        (WebCore::RenderWidget::ref): Make this and deref() public.
+
+2010-03-26 Beth Dakin <bdakin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Partial fix for https://bugs.webkit.org/show_bug.cgi?id=36564 
+        Performance regression for setting content of <text> in SVG
+        -and corresponding-
+        <rdar://problem/7693963>
+
+        toClipPath() is extremely inefficient, so this patch removes the 
+        call to it from RenderSVGResourceClipper::resourceBoundingBox() 
+        which is very hot code in SVG with clip-paths. It is sufficient to 
+        call unite with the objectBoundingBox(), which will return early if 
+        objectBoundingBox() is empty.
+
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
+
+2010-03-26  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Dave Hyatt.
+
+        Generated run-in Content is Mistakenly Getting Deleted
+        https://bugs.webkit.org/show_bug.cgi?id=36505
+        <rdar://problem/7767161>
+
+        Test: fast/runin/generated2.html
+        Test: fast/runin/generated3.html
+        Test: fast/runin/generated4.html
+
+        Do not destroy :before/:after generated content with display run-in
+        when relaying out different nodes. Have their real owners correctly
+        handle them.
+
+        * rendering/RenderObjectChildList.cpp:
+        (WebCore::RenderObjectChildList::updateBeforeAfterContent): simplified logic
+        (WebCore::RenderObjectChildList::beforeAfterContainer): skip generated run-ins when checking children, check for them in grandchildren
+
+2010-03-25  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        shift+home/end and cmd+shift+left/right don't extend the selection correctly
+        https://bugs.webkit.org/show_bug.cgi?id=36539
+
+        * WebCore.base.exp:
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::modify):
+        * editing/SelectionController.h:
+
+2010-03-26  Janne Koskinen  <janne.p.koskinen@digia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        Don't undefine SKIP_STATIC_CONSTRUCTORS_ON_GCC for Symbian HW targets.
+        https://bugs.webkit.org/show_bug.cgi?id=34081
+
+        Defining StringImpl instances as globals will cause a crash on process exit as 
+        StringImpl::Remove expects TLS which was already deleted at time of exiting main and ends up
+        constructing one exiting thread.
+
+        * config.h:
+
+2010-03-26  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+
+        Send worker resource content to inspector to enable display of web
+        workers in inspector's resource tab.
+        https://bugs.webkit.org/show_bug.cgi?id=36658
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+        (WebCore::InspectorController::scriptImported):
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::type):
+        (WebCore::InspectorResource::setOverrideContent):
+        (WebCore::InspectorResource::sourceString):
+        * inspector/InspectorResource.h:
+        * workers/DefaultSharedWorkerRepository.cpp:
+        (WebCore::SharedWorkerScriptLoader::notifyFinished):
+        * workers/Worker.cpp:
+        (WebCore::Worker::notifyFinished):
+
+2010-03-26  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        Fix the rendering of HTMLProgressElement
+        https://bugs.webkit.org/show_bug.cgi?id=36206
+
+        Update the rendering and css to conform to
+        http://www.whatwg.org/specs/web-apps/current-work/complete.html#the-progress-element-0.
+        Updated the tests and the expected results accordingly.
+
+        * css/html.css:
+        (progress):
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::RenderProgress):
+        (WebCore::RenderProgress::updateFromElement):
+        * rendering/RenderProgress.h:
+        (WebCore::RenderProgress::isProgress):
+
+2010-03-26  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Unreviewed build fix.
+
+        FontPlatformDataPango.cpp: prototype for
+        'WebCore::FontPlatformData::FontPlatformData(cairo_font_face_t*, int, bool, bool)'
+        does not match any in class
+        https://bugs.webkit.org/show_bug.cgi?id=36496
+
+        * platform/graphics/gtk/FontPlatformDataPango.cpp:
+        (WebCore::FontPlatformData::FontPlatformData): The 'size' parameter
+        should be a float to match the declaration and the other definitions.
+
+2010-03-26  Shu Chang  <chang.shu@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt] Prevent referring d->m_job in the future because calling abort()
+        deletes the instance itself.
+        https://bugs.webkit.org/show_bug.cgi?id=36618
+
+        Test: http/tests/appcache/fallback.html
+
+        * platform/network/qt/ResourceHandleQt.cpp:
+        (WebCore::ResourceHandle::cancel):
+
+2010-03-26  Stephen White  <senorblanco@chromium.org>
+
+        Unreviewed; build fix.
+
+        Rolling out 56620; too many layout test failures.
+
+        Covered by fast/css/*.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::cssText):
+        * css/CSSPrimitiveValue.h:
+        (WebCore::CSSPrimitiveValue::):
+
+2010-03-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Build JavaScriptCore as a static library.
+        https://bugs.webkit.org/show_bug.cgi?id=36590
+
+        This patch takes what was left of the unused JavaScriptCore.pro
+        and moved the compilation logic from JavaScriptCore.pri to
+        JavaScriptCore.pro.
+
+        * WebCore.pro:
+
+2010-03-26  Olivier Goffart  <ogoffart@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix compilation on Windows
+
+        For some reason, the MSVC compiler choose the
+        operator+(const QString &, const QString &) instead of
+        operator+(const WebCore::String &, const WebCore::String &)
+        resulting in errors when QT_USE_FAST_OPERATOR_PLUS is used.
+
+        * dom/XMLTokenizerQt.cpp:
+        (WebCore::handleElementNamespaces):
+
+2010-03-24  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        In order to speed up multiple calls to CSSPrimitiveValue::cssText(),
+        this CL caches the String result.  When m_value is changed, the
+        cached string is cleared.  This gives a good speedup on benchmarks
+        which do a lot of CSS property gets, such as Peacekeeper.
+        The processing cost should be negligible, since the strings are 
+        refcounted.  The memory cost is an additional 4 bytes per
+        CSSPrimitiveValue, and the extended lifetime of the computed string
+        (potentially, the same as the lifetime of the CSSPrimitiveValue).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36556
+
+        Covered by fast/css/large-number-round-trip.html, and more.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::cssText):
+        * css/CSSPrimitiveValue.h:
+
+2010-03-26  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] fast/canvas/drawImage-with-negative-source-destination.html failed
+        https://bugs.webkit.org/show_bug.cgi?id=35005
+
+        To support negative width or height at context.drawImage
+
+        * platform/graphics/qt/StillImageQt.cpp:
+        (WebCore::StillImage::draw):
+
+2010-03-08  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        [GStreamer] soften dependency on libsoup in the http src element
+        https://bugs.webkit.org/show_bug.cgi?id=35864
+
+        Replaced SoupURI calls with KURL and pause/resume internal soup
+        messages only if the element is compiled for a port depending on
+        libsoup.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webkit_web_src_init):
+        (webKitWebSrcSetUri):
+        (webKitWebSrcNeedDataMainCb):
+        (webKitWebSrcEnoughDataMainCb):
+
+2010-03-25  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Shot record filter is implemented in Timeline Panel.
+        https://bugs.webkit.org/show_bug.cgi?id=36606
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype.get statusBarItems):
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
+        (WebInspector.TimelineRecordGraphRow.prototype.update):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype.get _isLongEvent):
+        * inspector/front-end/inspector.css:
+
+2010-03-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Implement CSSStyleSelector::pseudoStyleForElement and use it in the InspectorDOMAgent.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36509
+
+        This change provides pseudo elements information into the inspector styles sidebar pane.
+        Changes applied:
+        - CSSStyleSelector::pseudoStyleRulesForElement implemented. I changed the signature to accept
+          PseudoId instead of a String since it better reflected the needs;
+        - Accompanied elementStyle checks with m_collectRulesOnly checks;
+        - Removed pseudoStyleRulesForElement usage from DOMWindow::getMatchedCSSRules. It was anyways
+          returning 0, while I would need to convert String to PseudoId in order to leave the call in place;
+        - Needed to introduce AFTER_LAST_INTERNAL_PSEUDOID marker const in RenderStyleConstants' PseudoId enum
+        - InspectorDOMAgent is now iterating over all pseudo ids to get all styles (including internal ones).
+        - Brushed up front-end code so that proper overriding took place locally within pseudo id categories.
+
+        * English.lproj/localizedStrings.js:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::styleRulesForElement):
+        (WebCore::CSSStyleSelector::pseudoStyleRulesForElement):
+        (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+        * css/CSSStyleSelector.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        (WebCore::InspectorDOMAgent::buildObjectForAttributeStyles):
+        (WebCore::InspectorDOMAgent::buildArrayForCSSRules):
+        (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype.update.callback):
+        (WebInspector.StylesSidebarPane.prototype.update):
+        (WebInspector.StylesSidebarPane.prototype._update):
+        (WebInspector.StylesSidebarPane.prototype._refreshStyleRules):
+        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules.insertInheritedNodeSeparator):
+        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
+        (WebInspector.StylesSidebarPane.prototype._markUsedProperties):
+        (WebInspector.StylesSidebarPane.prototype._refreshSectionsForStyleRules):
+        (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules):
+        (WebInspector.StylesSidebarPane.prototype._changeColorFormat):
+        (WebInspector.StylesSidebarPane.prototype.addBlankSection):
+        (WebInspector.StylesSidebarPane.prototype.removeSection):
+        * inspector/front-end/inspector.css:
+        (.styles-sidebar-separator):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::getMatchedCSSRules):
+        * rendering/style/RenderStyleConstants.h:
+        (WebCore::):
+
+2010-03-25  Charlie Reis  <creis@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        onbeforeunload not called at window close + frame or iframe focused
+        https://bugs.webkit.org/show_bug.cgi?id=27481
+
+        Test: fast/events/onbeforeunload-focused-iframe.html
+
+        Replaces initial manual tests with a layout test.
+
+        * manual-tests/onbeforeunload-focused-iframe.html: Removed.
+        * manual-tests/resources/focused-iframe.html: Removed.
+
+2010-03-25  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Missing lock in call to doneCreatingDatabase
+        https://bugs.webkit.org/show_bug.cgi?id=36473
+
+        Added new test storage/open-database-over-quota.html.
+
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::canEstablishDatabase):  Added missing lock call.
+
+2010-03-25  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] REGRESSION: Some LayoutTests fail after r56567
+        https://bugs.webkit.org/show_bug.cgi?id=36630
+
+        Fix boolean logic goofup. This was a last minute code review
+        change that didn't get tested on Windows before commit.
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::setIsDirectional):
+
+2010-03-25  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7728903> Support color bitmap fonts
+
+        Test: platform/mac/fonts/color-bitmap.html
+
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::showGlyphsWithAdvances): Added. Calls CGContextShowGlyphsWithAdvances()
+        or CTFontShowGlyphs() depending on whether the font is a color bitmap font.
+        (WebCore::Font::drawGlyphs): Use showGlyphsWithAdvances(). Don’t include the font’s matrix in
+        the context’s text matrix when drawing with a color bitmap font, because CTFontShowGlyphs()
+        factors it in.
+        * platform/graphics/mac/FontPlatformData.h:
+        (WebCore::FontPlatformData::FontPlatformData): Added m_isColorBitmapFont member
+        and initialized it in constructors.
+        (WebCore::FontPlatformData::isColorBitmapFont): Added this getter.
+        * platform/graphics/mac/FontPlatformDataMac.mm:
+        (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
+        (WebCore::FontPlatformData::operator=): Copy m_isColorBitmapFont.
+        (WebCore::FontPlatformData::setFont): Set m_isColorBitmapFont.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Sam Weinig.
+
+        Implement allow-top-navigation for HTML5 sandbox attribute
+        https://bugs.webkit.org/show_bug.cgi?id=36549
+
+        Tests: fast/frames/sandboxed-iframe-navigation-top-by-constant-name.html
+               fast/frames/sandboxed-iframe-navigation-top-by-constant-name2.html
+               fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
+               fast/frames/sandboxed-iframe-navigation-top-by-name.html
+               fast/frames/sandboxed-iframe-navigation-top-denied.html
+               fast/frames/sandboxed-iframe-navigation-top.html
+
+        * bindings/generic/BindingDOMWindow.h:
+        (WebCore::::createWindow):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::createWindow):
+          Moved the security check to FrameLoader because we need to allow
+          window.open navigation to succeed sometimes when the
+          SandboxNavigation bit is set.
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::parseSandboxAttribute):
+          Added allow-top-navigation to the parser.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::createWindow):
+          The SandboxNavigation check now occurs after we search for the frame
+          by name.  Notice that the named frame navigation case is caught by
+          the generic navigation access check.
+        (WebCore::FrameLoader::shouldAllowNavigation):
+          Update the navigation access check to allow navigating of top unless
+          it's forbidden.
+        * loader/FrameLoaderTypes.h:
+          Introduce a bit for SandboxedTopNavigation.
+        (WebCore::):
+
+2010-03-25  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        V8CustomVoidCallback should not check if a return value is a
+        boolean. It should only convert the value to a boolean.
+
+        * bindings/v8/custom/V8CustomVoidCallback.cpp:
+        (WebCore::invokeCallback):
+
+2010-03-25  Dmitry Titov  <dimich@chromium.org>
+
+        No review, rolling out r56585.
+        http://trac.webkit.org/changeset/56585
+        https://bugs.webkit.org/show_bug.cgi?id=36621
+
+        Broke Chromium builds on waterfall
+
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::getValue):
+        * plugins/PluginView.h:
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::setJavaScriptPaused):
+
+2010-03-25  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Fix build if NPAPI support is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=36621
+
+        No new tests, this is a build fix.
+
+        * plugins/PluginView.cpp: Guard getValueStatic() with
+        NETSCAPE_PLUGIN_API
+        (WebCore::PluginView::getValue):
+        * plugins/PluginView.h: Guard getValue() with NETSCAPE_PLUGIN_API
+        * plugins/PluginViewNone.cpp: Guard platformGetValue() and
+        platformGetValueStatic with NETSCAPE_PLUGIN_API;
+        Guard privateBrowsingStateChanged() and setJavaScriptPaused() with
+        PLATFORM(MAC)
+
+2010-03-25  Drew Wilson  <atwilson@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [v8] Error in getScriptExecutionContext() when worker context is terminating.
+        https://bugs.webkit.org/show_bug.cgi?id=36565
+
+        Removed WorkerScriptExecutionProxy::retrieve() and added WorkerScriptController::controllerForContext(). This allows
+        callers to differentiate between "the current context is shutting down" vs "the current context is not a worker context".
+
+        Test: Existing worker tests suffice.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::getConstructor):
+        Changed to use WorkerScriptController::controllerForContext() instead of WorkerScriptExecutionProxy::retrieve().
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::getScriptExecutionContext):
+        Changed to use WorkerScriptController::controllerForContext() instead of WorkerScriptExecutionProxy::retrieve().
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        Removed WorkerScriptExecutionProxy::retrieve().
+        * bindings/v8/WorkerContextExecutionProxy.h:
+        Removed WorkerScriptExecutionProxy::retrieve().
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::controllerForContext):
+        Added helper function to get the WorkerScriptController for the current context.
+        * bindings/v8/WorkerScriptController.h:
+        Added declaration for controllerForContext().
+
+2010-03-25  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix the package build on Maemo 5
+
+        https://bugs.webkit.org/show_bug.cgi?id=36607
+
+        Always embed the stylesheet for the no-listbox rendering. This way it'll be
+        included in the generated files for the package generation.
+
+        * WebCore.pri:
+
+2010-03-24  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Changing the V8 and JSC implementations of
+        SQLStatementErrorCallback to interpret as false all results that
+        could be converted to a false boolean. Pretty much a revert of
+        r54981.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36569
+
+        * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
+        (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
+        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+        (WebCore::V8CustomSQLStatementErrorCallback::handleEvent):
+        * bindings/v8/custom/V8CustomVoidCallback.cpp:
+        (WebCore::invokeCallback):
+        * bindings/v8/custom/V8CustomVoidCallback.h:
+
+2010-03-25  Dmitry Titov  <dimich@chromium.org>
+
+        Unreviewed, fix Chromium tests.
+
+        Recent http://trac.webkit.org/changeset/56489 made all urls in Chromium that
+        have unspecified port to return invalidPortNumber from KURL::port().
+
+        * platform/KURLGoogle.cpp: Return 0 for unspecified ports, mimic WebKit KURL behavior for invalid ports.
+        (WebCore::KURL::port):
+
+2010-03-25  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        This is a follow up of:
+        https://bugs.webkit.org/show_bug.cgi?id=30055
+        Bad DOM performance in large SVG files
+
+        Just save and restore the GraphicsContext, if we realy modify it.
+        (Cairo)Path::contains checks if a point is in the boundingBox
+        as a heuristic. The intention was to make the process faster for
+        points outside of this rect, but it rather causes the
+        opposite.
+
+        No new test cases added. No change in functionality.
+
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::contains):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+
+2010-03-25  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by David Levin.
+
+        mouse-based selections are always directional on Windows/Linux
+        https://bugs.webkit.org/show_bug.cgi?id=25195
+
+        Change m_lastChangeWasHorizontalExtension to m_isDirectional
+        and make m_isDirectional always be true for Windows/Linux.
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::SelectionController):
+        (WebCore::SelectionController::setSelection):
+        (WebCore::SelectionController::setIsDirectional):
+        (WebCore::SelectionController::willBeModified):
+        When double-clicking, the base/extent will be in the middle
+        of the selection instead of the start/end of it. Changed to
+        maintain that modifications after double-click still move the
+        start/end of the selection, not the base/extent.
+        (WebCore::SelectionController::modify):
+        * editing/SelectionController.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEventSingleClick):
+        (WebCore::EventHandler::updateSelectionForMouseDrag):
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Revert r56565 which was based on an incorrect premise.
+
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::clearRenderer):
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+        (WebCore::CompositeAnimation::getAnimatedStyle):
+        (WebCore::CompositeAnimation::setAnimating):
+        (WebCore::CompositeAnimation::timeToNextService):
+        (WebCore::CompositeAnimation::getAnimationForProperty):
+        (WebCore::CompositeAnimation::suspendAnimations):
+        (WebCore::CompositeAnimation::resumeAnimations):
+        (WebCore::CompositeAnimation::isAnimatingProperty):
+        (WebCore::CompositeAnimation::pauseAnimationAtTime):
+        (WebCore::CompositeAnimation::numberOfActiveAnimations):
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        Make calls to m_keyframeAnimations.checkConsistency() debug-only
+        https://bugs.webkit.org/show_bug.cgi?id=36555
+
+        Remove lots of calls to m_keyframeAnimations.checkConsistency(); which were left after some earlier
+        debugging. Leave one in CompositeAnimation::animate() to catch any future issues, which is OK since
+        these calls are no-ops in release builds.
+        
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::clearRenderer):
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+        (WebCore::CompositeAnimation::getAnimatedStyle):
+        (WebCore::CompositeAnimation::setAnimating):
+        (WebCore::CompositeAnimation::timeToNextService):
+        (WebCore::CompositeAnimation::getAnimationForProperty):
+        (WebCore::CompositeAnimation::suspendAnimations):
+        (WebCore::CompositeAnimation::resumeAnimations):
+        (WebCore::CompositeAnimation::isAnimatingProperty):
+        (WebCore::CompositeAnimation::pauseAnimationAtTime):
+        (WebCore::CompositeAnimation::numberOfActiveAnimations):
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36557
+        Animations use the wrong timing-function sometimes
+        
+        Fix an issue where animations picked the wrong style for their "unanimated" value.
+        
+        Previously, the "unanimated" style was considered to be the style before the animation
+        was applied. This caused us to pick up stale values for animation timing functions, for
+        blending when a property is missing from the first keyframe, and for resuming transitions
+        once an animation ends.
+        
+        Instead, we need to use the "current" style, which is the one that causes the animation
+        to kick off.
+
+        Tests: animations/longhand-timing-function.html
+               animations/transition-and-animation-3.html
+               animations/unanimated-style.html
+
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+
+2010-03-25  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36611 - Cleanup JSC::CString
+        Rename CString::c_str() -> CString::data(), CString::size() -> CString::length(),
+        remove UString::getCString() (all uses are wrong, should use UString::UTF8String()).
+
+        * bridge/NP_jsobject.cpp:
+        (_NPN_Enumerate):
+        * bridge/c/c_utility.cpp:
+        (JSC::Bindings::convertValueToNPVariant):
+        * bridge/jni/jsc/JNIBridgeJSC.cpp:
+        (JavaField::valueFromInstance):
+        (JavaField::setValueToInstance):
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaInstance::invokeMethod):
+        * bridge/jni/jsc/JavaStringJSC.h:
+        (JSC::Bindings::JavaStringImpl::UTF8String):
+
+2010-03-25  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [Qt] RenderTheme: fix size adjustment for text fields
+        https://bugs.webkit.org/show_bug.cgi?id=36413
+
+        To match other ports, remove the hardcoded dimensions for text fields so that
+        the default ones from WebCore can be used.
+        Properly apply the correct padding to text areas - this fixes their appearance
+        with the Oxygen style.
+
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::computeSizeBasedOnStyle):
+
+2010-03-25  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Implement ChromeClient::windowResizerRect()
+
+        https://bugs.webkit.org/show_bug.cgi?id=21300
+
+        The helper function geometryRelativeToOwnerWidget() in the page
+        client is used to clip the resize rect to the actual size of the
+        viewport, not the size of the QGraphicsView.
+
+        * platform/qt/QWebPageClient.h:
+
+2010-03-25  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: reloading debug target window with cmd-R from inspector window produces beep.
+        https://bugs.webkit.org/show_bug.cgi?id=36554
+
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown): prevent the default behavior, if handled, which would result in a system beep.
+
+2010-03-25  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Forward DatabaseTracker::canEstablishDatabase to chromium layer.
+        https://bugs.webkit.org/show_bug.cgi?id=36595
+
+        * storage/chromium/DatabaseObserver.h:
+        * storage/chromium/DatabaseTrackerChromium.cpp:
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+
+2010-03-25  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Windowed netscape plugins don't work with QGraphicsWebView on Symbian
+        https://bugs.webkit.org/show_bug.cgi?id=35112
+
+        Add a proxy widget when loading a QWidget based plugin in a QGraphicsWebView.
+
+        * plugins/symbian/PluginContainerSymbian.cpp:
+        (PluginContainerSymbian::PluginContainerSymbian):
+        (PluginContainerSymbian::focusInEvent):
+        * plugins/symbian/PluginContainerSymbian.h:
+        (WebCore::PluginContainerSymbian::proxy):
+        * plugins/symbian/PluginViewSymbian.cpp:
+        (WebCore::PluginView::updatePluginWidget):
+        (WebCore::PluginView::platformStart):
+        (WebCore::PluginView::platformDestroy):
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35714
+        Computed style on delayed transform animations is incorrect
+        
+        When fetching computed style while a delayed accelerated animation is in effect,
+        we would get the value form the first keyframe, rather than getting the current
+        style.
+        
+        Fix by checking to see whether we've in the delay phase (with no backwards-fill)
+        in KeyframeAnimation::getAnimatedStyle().
+
+        Test: compositing/animation/computed-style-during-delay.html
+
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::getAnimatedStyle):
+
+2010-03-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Initialize Web Inspector title with inspected page URL when opening Web Inspector.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36534
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setFrontend):
+
+2010-03-25  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36316
+        Tiles of selected content do not update if not in viewport
+        
+        Don't clip repaints to viewport when tiling is enabled.
+
+        * page/Frame.cpp:
+        (WebCore::Frame::setView):
+        (WebCore::Frame::setTiledBackingStoreEnabled):
+
+2010-03-25  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Eric Seidel.
+
+        Missing forward ENABLE_DATALIST macro to JavaScript enabled features macros
+        on WebKit.pri
+
+        [Qt] Forward ENABLE_DATALIST macro to JavaScript enabled macros
+        https://bugs.webkit.org/show_bug.cgi?id=36547
+
+        * WebCore.pri:
+
+2010-03-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Expect console object wrapping to fail.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36587
+
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-03-25  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36371
+        [Gtk] Elements with a title attribute should not be ignored
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (AccessibilityRenderObject::accessibilityIsIgnored):
+
+2010-03-24  Steve Block  <steveblock@google.com>
+
+        Reviewed by David Levin.
+
+        Adds a missing ENABLE(WORKERS) guards to the V8 bindings.
+        https://bugs.webkit.org/show_bug.cgi?id=36550
+
+        Build fix only, no new tests.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::instantiateV8Object):
+
+2010-03-25  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Eric Seidel.
+
+        Add EFL-specific code to platform/ScrollView.cpp and
+        platform/Scrollbar.cpp.
+        http://webkit.org/b/36305
+
+        * platform/ScrollView.cpp:
+        * platform/Scrollbar.cpp:
+
+2010-03-25  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt]Fix compile error with QT_NO_LIBRARY
+        https://bugs.webkit.org/show_bug.cgi?id=36533
+
+        * platform/FileSystem.h:
+        * platform/qt/FileSystemQt.cpp:
+        (WebCore::unloadModule):
+
+2010-03-25  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt]Fix compile error with QT_NO_ANIMATION
+        https://bugs.webkit.org/show_bug.cgi?id=36526
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::~GraphicsLayerQtImpl):
+        * platform/graphics/qt/GraphicsLayerQt.h:
+
+2010-03-25  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33697
+        Have dragOpFromIEOp("move") return DragOperationGeneric | DragOperationMove
+        because only returning Generic doesn't work for platforms that don't
+        have a generic operation.
+
+        Covered by existing tests (fast/events/drag-and-drop.html).
+
+        * dom/Clipboard.cpp:
+        (WebCore::dragOpFromIEOp):
+        (WebCore::Clipboard::destinationOperation):
+        (WebCore::Clipboard::setDestinationOperation):
+
+2010-03-25  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Qt] websocket/tests/long-invalid-header.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=36492
+
+        trim message at most 128 bytes from the current position.
+        I believe it's enough data to investigate the error reason and
+        it makes test not depend on buffered size.
+
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::trimConsoleMessage):
+        (WebCore::WebSocketHandshake::readServerHandshake):
+        (WebCore::WebSocketHandshake::readHTTPHeaders):
+
+2010-03-24  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        <rdar://problem/7780798> Missing plug-ins should be represented by text
+        only, instead of lego block
+
+        https://bugs.webkit.org/show_bug.cgi?id=36583
+
+        Reviewed by Dan Bernstein.
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::paintReplaced):
+        Set the font rendering mode and the computed size, so that the text will
+        draw properly on Windows.
+
+2010-03-24  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Removing unecessary redraws of LayerSkia contents:
+        https://bugs.webkit.org/show_bug.cgi?id=36470
+
+        Test: No new functionality added, no tests.
+
+        * platform/graphics/skia/LayerRendererSkia.cpp:
+        (WebCore::LayerRendererSkia::drawLayerInCanvasRecursive):
+        Debug borders now rendered at composite time rather than update time.
+        * platform/graphics/skia/LayerSkia.cpp:
+        (WebCore::LayerSkia::updateContents):
+        (WebCore::LayerSkia::drawDebugBorder):
+        Debug border drawing removed from updateContents and split into a separate method that
+        can be called at composite time.
+        (WebCore::LayerSkia::setBounds):
+        Resetting the bounds causes the layer to redraw its contents.
+        (WebCore::LayerSkia::setNeedsDisplay):
+        * platform/graphics/skia/LayerSkia.h:
+        Added declaration for drawDebugBorders method.
+
+2010-03-24  Mark Rowe  <mrowe@apple.com>
+
+        Revert the portion of r56489 that dealt with port zero as it introduced some test failures.
+
+        * platform/KURL.cpp:
+        (WebCore::KURL::port): Use the "ok" argument to charactersToUIntStrict to determine whether
+        it was able to successfully parse the string as an unsigned integer, rather than relying on
+        the fact it returned zero when it failed.
+
+2010-03-24  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        * platform/text/String.cpp:
+        (WebCore::putUTF8Triple): Correct capitalization of function name.
+        (WebCore::String::utf8): Fix C-style casts.
+        (WebCore::String::fromUTF8): Remove unnecessary newline.
+        (WebCore::String::fromUTF8WithLatin1Fallback): Use early return.
+
+2010-03-24  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit should treat port numbers outside the valid range as being blacklisted
+        <http://webkit.org/b/36571> / <rdar://problem/7790908>
+
+        * platform/KURL.cpp:
+        (WebCore::KURL::port): Map invalid port numbers to invalidPortNumber.
+        (WebCore::portAllowed): Add invalidPortNumber to the blacklist.
+        * platform/KURLGoogle.cpp:  invalid port numbers to invalidPortNumber.
+        (WebCore::KURL::port): Add invalidPortNumber to the blacklist.
+        Also bring this in to sync with KURL.  Having this identical code in two places is stupid.
+
+2010-03-24  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Mark Rowe.
+
+        Add some missing exports.
+
+        * WebCore.base.exp:
+
+2010-03-24  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Switch String::latin1, String::utf8, String::fromUTF8 to
+        use WTF's Unicode conversion methods rather than TextEncoder.
+        These methods only perform simple conversion, and don't need
+        really require TextEncoder's full capability (to look up arbitrary
+        encodings by name), switching to only be dependent on WTF will
+        make it easier if we chose to move WebCore::String to WTF.
+
+        * platform/text/String.cpp:
+        (WebCore::String::latin1):
+        (WebCore::putUTF8triple):
+        (WebCore::String::utf8):
+        (WebCore::String::fromUTF8):
+
+2010-03-24  Dmitry Titov  <dimich@chromium.org>
+
+        No review, rolling out r56453.
+        http://trac.webkit.org/changeset/56453
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        In Chromium port, it broke invalid-image-data-standalone.html
+        invalid-image-data.html multipart-wait-before-boundary.html
+        stop-crash.html win-boundary-crash.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedLoadingDocument):
+
+2010-03-24  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Significant scroll speed degradation if Timeline has
+        an expanded record with significant number of children.
+        https://bugs.webkit.org/show_bug.cgi?id=36543
+
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._updateBoundaries):
+        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
+        (WebInspector.TimelinePanel.prototype._filterRecords):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+
+2010-03-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Carlson.
+
+        [GStreamer] Fails to go to Loaded state because of floating point discrepancies
+        https://bugs.webkit.org/show_bug.cgi?id=35891
+
+        Use the m_fillStatus variable, which is more reliable, instead of
+        using the calculation, for the completed case.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::fillTimerFired):
+
+2010-03-24  Dmitry Titov  <dimich@chromium.org>
+
+        Unreviewed, Chromium test fix.
+
+        Recent r56445 added CustomEvent and a test but it didn't work on Chromium bots.
+        Test crashed due to infinte recursion because the compiler did not have the right definition of toV8(CustomEvent*)
+        and was substituting toV8(Event*).
+
+        Fixing test fast/events/custom-event.html
+
+        * bindings/v8/custom/V8EventCustom.cpp:
+
+2010-03-24  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Darin Adler.
+
+        Refactoring: HTMLFormControlElement should not have redundant null check
+        https://bugs.webkit.org/show_bug.cgi?id=36487
+        
+        No new tests as there is no new functionality.        
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::dispatchFocusEvent):
+        (WebCore::HTMLFormControlElement::dispatchBlurEvent):
+
+2010-03-24  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        DOMCoreException needs NoStaticTables modifier
+        https://bugs.webkit.org/show_bug.cgi?id=36458
+
+        No new tests, but this shows up in tests of Database accesses from the
+        Worker thread that I'll be checking in soon.  The symptom is that
+        DOMCoreException.toString() returns [object DOMException] instead of
+        something more helpful.
+
+        * dom/DOMCoreException.idl:  Added NoStaticTables.
+
+2010-03-24  Drew Wilson  <atwilson@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Failed assertion in V8Proxy::setDOMException() if worker is shutting down.
+        https://bugs.webkit.org/show_bug.cgi?id=36514
+
+        Test: none (existing worker tests suffice)
+
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::setDOMException):
+        Updated setDOMException() to check for an empty exception (due to no active context) and avoid throwing in that case.
+
+2010-03-23  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        [chromium] use integral glyph widths
+        https://bugs.webkit.org/show_bug.cgi?id=36510
+
+        Despite WebKit (and Skia, to an extent) supporting non-integral
+        glyph widths, the font code path we hit in Skia only supports
+        integral glyph positions.  This means that we would accumulate
+        offsets when drawing a sequence up non-integer-width glyphs
+        which would cause gaps when snapped to the pixel grid when drawing.
+
+        * platform/graphics/chromium/SimpleFontDataLinux.cpp:
+        (WebCore::SimpleFontData::platformWidthForGlyph):
+        round glyph widths to integers.
+
+2010-03-24  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Kevin Decker.
+
+        <rdar://problem/7785305>
+        Fix regression caused by r55576. It turned out that ensuring
+        CoreAnimation always gets a correct fill parameter caused flashing
+        as non-filled animations ended (CA briefly showed the initial animation
+        value before the style system set the final value).
+
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::GraphicsLayerCA::setupAnimation):
+
+2010-03-24  Hayato Ito  <hayato@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactor computePageRects so that Mac can make use of it.
+        https://bugs.webkit.org/show_bug.cgi?id=36159
+
+        Refactoring only, so no new tests.
+
+        * WebCore.base.exp:
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::computePageRects):
+        (WebCore::PrintContext::computePageRectsWithPageSize):
+        (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
+        (WebCore::PrintContext::pageNumberForElement):
+        (WebCore::PrintContext::numberOfPages):
+        * page/PrintContext.h:
+
+2010-03-24  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
+
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        No new tests as there is no new functionality.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedLoadingDocument): Make copy of mimeType string to isolate crash.
+
+2010-03-24  Anton Muhin  <antonm@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Use newly introduced SetPrototype method to deal with global objects.
+        https://bugs.webkit.org/show_bug.cgi?id=36497
+
+        No new tests, should be covered by the current test infrastructure.
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::installDOMWindow):
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::getConstructor):
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
+
+2010-03-24  Dmitry Titov  <dimich@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::PopupContainer): Fix order of initializers.
+        (WebCore::PopupContainer::layout): Remove unused variable.
+
+2010-03-23  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        Add a way to check if the page client is making use of
+        a QWidget.
+
+        * platform/qt/QWebPageClient.h:
+        (QWebPageClient::isQWidgetClient):
+
+2010-03-24  Jay Campan  <jcampan@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Making Chromium select popups not steal activation from the browser.
+        Select popups are now like autocomplete popups, shown in non-activated
+        windows.
+        https://bugs.webkit.org/show_bug.cgi?id=36062
+
+        * page/chromium/ChromeClientChromium.h:
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::):
+        (WebCore::PopupListBox::setMaxHeight):
+        (WebCore::PopupListBox::disconnectClient):
+        (WebCore::PopupListBox::PopupListBox):
+        (WebCore::PopupContainer::create):
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::showExternal):
+        (WebCore::PopupContainer::hidePopup):
+        (WebCore::PopupContainer::layout):
+        (WebCore::PopupContainer::chromeClientChromium):
+        (WebCore::PopupListBox::hidePopup):
+        (WebCore::PopupListBox::layout):
+        (WebCore::PopupMenu::~PopupMenu):
+        (WebCore::PopupMenu::show):
+        * platform/chromium/PopupMenuChromium.h:
+        (WebCore::PopupItem::):
+        (WebCore::PopupItem::PopupItem):
+        (WebCore::PopupContainerSettings::):
+        (WebCore::PopupContainer::):
+        (WebCore::PopupContainer::listBox):
+        (WebCore::PopupContainer::popupType):
+
+2010-03-10  David Levin  <levin@chromium.org>
+
+        Reviewed by Oliver Hunt.
+
+        Need to move items that CanvasRenderingContext2D depends on into CanvasSurface.
+        https://bugs.webkit.org/show_bug.cgi?id=35453
+
+        Prepartory changes to allow for an OffscreenCanvas which may be used in a worker
+        or outside of the DOM.
+
+        No change in functionality, so new tests.
+
+        * dom/CanvasSurface.cpp: Moved functionality that CanvasRenderingContext2D depends on
+        into this class (and removed dependencies on document/html element).
+        (WebCore::CanvasSurface::CanvasSurface):
+        (WebCore::CanvasSurface::~CanvasSurface): Put the desctructor in the cpp file
+        to avoid needing access to ~ImageBuffer in the header file.
+        (WebCore::CanvasSurface::setSurfaceSize): Does basic items needed
+        when the size changes. It is protected to force outside callers to go
+        through HTMLCanvasElement::setSize.
+        (WebCore::CanvasSurface::toDataURL): Just moved from HTMLCanvasElement and
+        made a note about a method to fix for worker usage.
+        (WebCore::CanvasSurface::willDraw): Made this virtual to allow an overide
+        which uses the renderbox and tracks a dirtyRect.
+        (WebCore::CanvasSurface::convertLogicalToDevice): Moved and changed to
+        rely on a member variable for page scale (to avoid using the document).
+        (WebCore::CanvasSurface::createImageBuffer):
+        (WebCore::CanvasSurface::drawingContext): Simple move from HTMLCanvasElement.
+        (WebCore::CanvasSurface::buffer): Ditto.
+        (WebCore::CanvasSurface::baseTransform): Ditto.
+        * dom/CanvasSurface.h:
+        (WebCore::CanvasSurface::width): Simple move from HTMLCanvasElement.
+        (WebCore::CanvasSurface::height): Ditto.
+        (WebCore::CanvasSurface::size): Ditto.
+        (WebCore::CanvasSurface::setOriginTainted): Ditto.
+        (WebCore::CanvasSurface::originClean): Ditto.
+        (WebCore::CanvasSurface::hasCreatedImageBuffer): Ditto (with small name change).
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::HTMLCanvasElement): Pass in the scale factor to CanvasSurface
+        so it doesn't need the document.
+        (WebCore::HTMLCanvasElement::willDraw): Moved the relevant portion to CanvasSurface.
+        (WebCore::HTMLCanvasElement::reset): Small changes due to refactoring.
+        (WebCore::HTMLCanvasElement::paint): Ditto.
+        * html/HTMLCanvasElement.h:
+        (WebCore::HTMLCanvasElement::setSize): Ditto.
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding): Added assert
+        to verify that this is only called on the main thread.
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::nullImage): Ditto.
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::utiFromMIMEType): Ditto.
+
+2010-03-24  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Inspector: XML Tags should not be converted to lowercase
+        https://bugs.webkit.org/show_bug.cgi?id=28600
+
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.prototype.updateBreadcrumb):
+        (WebInspector.ElementsPanel.prototype.decorateNodeLabel):
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeOutline.prototype.nodeNameToCorrectCase):
+        (WebInspector.ElementsTreeElement.prototype._updateChildren):
+        (WebInspector.ElementsTreeElement.prototype._nodeTitleInfo):
+
+2010-03-03  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Add support for DOM Level 3 Custom Event
+        http://www.w3.org/TR/DOM-Level-3-Events
+
+        V8 Generator change by Nate Chapin <japhet@chromium.org>, Thanks!
+
+        Test: fast/events/custom-event.html
+
+        * DerivedSources.cpp:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore/DerivedSources.make:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::toJS):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * dom/CustomEvent.cpp: Added.
+        (WebCore::CustomEvent::CustomEvent):
+        (WebCore::CustomEvent::initCustomEvent):
+        (WebCore::CustomEvent::isCustomEvent):
+        * dom/CustomEvent.h: Added.
+        (WebCore::CustomEvent::create):
+        (WebCore::CustomEvent::detail):
+        * dom/Document.cpp:
+        (WebCore::Document::createEvent):
+        * dom/Event.cpp:
+        (WebCore::Event::isCustomEvent):
+        * dom/Event.h:
+
+2010-03-24  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Error when highlighting JavaScript with an invalid mime type
+        https://bugs.webkit.org/show_bug.cgi?id=36530
+
+        * inspector/front-end/SourceTokenizer.js:
+        (WebInspector.SourceTokenizer.Registry):
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView.prototype._contentLoaded):
+        (WebInspector.SourceView.prototype._canonicalMimeType):
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter):
+
+2010-03-24  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Chromium test fix: added a frameCount check to the
+        debugger function call.
+
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::createUtilityContext):
+
+2010-03-19  Miikka Heikkinen  <miikka.heikkinen@digia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Support for QT_LIBINFIX in Symbian builds
+
+        Configuring Qt with -qtlibinfix parameter will enable installing
+        an alternate version of Qt on devices that already have it on ROM.
+        This patch provides support for infixed builds of Webkit.
+
+        * WebCore.pro:
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        r54923 made Icon::createIconForFiles() deprecated. However moving
+        existing icon loading code to outside of WebCore is not good.  So,
+        we assume:
+        - ChromeClient::chooseIconForFiles(), renamed from iconForFiles(), is
+          the primary API to load icons.
+        - Icon::createIconForFiles() is an optional API to help
+          implementing ChromeClient::iconForFiles().
+
+        This patch removes a call to Icon::createIconForFiles() from
+        FileChooser::loadIcon(), and ChromeClient::chooseIconForFiles() of
+        non-Chromium ports calls Icon::createIconForFiles().
+
+        * WebCore.base.exp: Export FileChooser::iconLoaded(),
+          Icon::createIconForFiles(), and Icon::~Icon().
+        * WebCore.xcodeproj/project.pbxproj: Export Icon.h
+        * loader/EmptyClient.h: Rename iconForFiles() to chooseIconForFiles().
+        * page/Chrome.cpp: ditto.
+        * page/Chrome.h: ditto.
+        * page/ChromeClient.h: ditto.
+        * platform/FileChooser.cpp:
+        (WebCore::FileChooser::loadIcon):
+        * platform/graphics/Icon.h: Remove a comment on createIconForFiles().
+        * platform/graphics/chromium/IconChromiumLinux.cpp: Remove createIconForFiles().
+        * platform/graphics/chromium/IconChromiumMac.cpp: ditto.
+        * platform/graphics/chromium/IconChromiumWin.cpp: ditto.
+        * rendering/RenderFileUploadControl.cpp: Rename iconForFiles() to chooseIconForFiles().
+        * rendering/RenderFileUploadControl.h: ditto.
+
+2010-03-23  Dan Bernstein  <mitz@apple.com>
+
+        Fixed typos.
+
+        * manual-tests/plugin-visible-rect-change.html:
+
+2010-03-23  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        WebCore part of
+        <rdar://problem/7197736> Plug-in clip rect does not update when overflow
+        clip changes
+        https://bugs.webkit.org/show_bug.cgi?id=36479.
+
+        * manual-tests/plugin-visible-rect-change.html: Added.
+        * platform/mac/WidgetMac.mm:
+        (WebCore::WidgetPrivate::WidgetPrivate): Added previousVisibleRect.
+        (WebCore::Widget::setFrameRect): If the visible rect changed but the
+        frame rect did not, send a -visibleRectDidChange message to the view,
+        if it responds to it.
+        (WebCore::Widget::releasePlatformWidget): Reset previousVisibleRect.
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::setWidgetGeometry): Track changes to the clip rect
+        imposed by the enclosing layer. Call Widget::setFrameRect when it changes,
+        even if the frame rect did not.
+        * rendering/RenderWidget.h:
+        (WebCore::RenderWidget::windowClipRect): Added this accessor.
+
+2010-03-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Assertion ASSERTION FAILED: rootLayer == m_clipRectsRoot at hulu.com
+        https://bugs.webkit.org/show_bug.cgi?id=34065
+        
+        Fix another cause of assertions related to the clip rects root. Embeds
+        with zero size caused the overlap testing to fail, yet we require them to work
+        for correct compositing, so when the composited bounds is empty, use a 1x1 rect
+        for overlap testing.
+
+        Test: compositing/geometry/empty-embed-rects.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::addToOverlapMap):
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
+2010-03-23  David Levin  <levin@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [chromium] XMLHttpRequest.send sends 'undefined' string when passed undefined value.
+        https://bugs.webkit.org/show_bug.cgi?id=36506
+
+        Test: http/tests/xmlhttprequest/send-undefined-and-null.html
+
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::isDocumentType): Unrelated style fix: fixed the casing of the method.
+        (WebCore::V8XMLHttpRequest::sendCallback): Added check for null/undefined to do the send.
+        This mirrors what is done in the JSC bindings. Previously, sending 'null' worked because
+        the last case, which did "toWebCoreStringWithNullCheck", resulted in sending an empty
+        request body.
+
+2010-03-23  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fix hard-to-see crash due to incorrect libxml API usage.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36000
+
+        Test: fast/text/bad-encoding.html
+
+        * dom/XMLTokenizerLibxml2.cpp:
+        (WebCore::XMLTokenizer::doEnd): Avoid operations on a closed context.
+
+2010-03-23  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, revert r56376.
+
+        This revision introduced a crash in a couple of layout tests
+        on Chromium Linux.
+
+        * page/chromium/ChromeClientChromium.h:
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::):
+        (WebCore::PopupContainer::create):
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::showExternal):
+        (WebCore::PopupContainer::hidePopup):
+        (WebCore::PopupMenu::show):
+        * platform/chromium/PopupMenuChromium.h:
+        (WebCore::PopupItem::):
+        (WebCore::PopupItem::PopupItem):
+        (WebCore::PopupContainerSettings::):
+        (WebCore::PopupContainer::listBox):
+
+2010-03-23  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser and Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36272, make sure nth-child can work when the portion with "n" is omitted.
+
+        Added fast/css/nth-child-implied-step.html
+
+        * css/CSSGrammar.y:
+        * css/tokenizer.flex:
+
+2010-03-23  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Reduce and straighten internal use of DOMImplementation
+        https://bugs.webkit.org/show_bug.cgi?id=36501
+
+        * WebCore.xcodeproj/project.pbxproj: Xcode decided to
+        re-sort this file.
+
+        * dom/Clipboard.cpp: Removed unneeded include of DOMImplementation.h.
+
+        * dom/DOMImplementation.cpp: Removed unneeded createDocument and
+        createHTMLDocument functions. These should be done directly instead
+        of involving the DOMImplementation class.
+        * dom/DOMImplementation.h: Ditto.
+
+        * dom/DocumentType.cpp: Removed unneeded include of DOMImplementation.h.
+
+        * html/HTMLViewSourceDocument.cpp:
+        (WebCore::HTMLViewSourceDocument::createTokenizer): Don't allocate a
+        DOMImplementation object just to use a class member function.
+
+        * loader/CachedFont.cpp: Removed unneeded include of DOMImplementation.h.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::responseXML): Use Document::create to create a
+        new document instead of involving DOMImplementation.
+        * xml/XSLTProcessor.cpp:
+        (WebCore::XSLTProcessor::createDocumentFromSource): Ditto. And in the case
+        where we do need to call DOMImplementation to interpret the MIME type,
+        don't allocate a DOMImplementation object just to use a class member
+        function.
+
+2010-03-23  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - all <select> elements should be rendered as menu lists.
+        https://bugs.webkit.org/show_bug.cgi?id=36367
+
+        Enabling NO_LISTBOX_RENDERING in WebCore.pri for Maemo5.
+
+        * WebCore.pri:
+
+2010-03-22  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Upstream iPhone KeyEvent platform code and share with Mac platform
+        https://bugs.webkit.org/show_bug.cgi?id=35870
+
+        * platform/iphone/KeyEventCodesIPhone.h: Improper comment for #endif.
+        * platform/iphone/KeyEventIPhone.mm: Fixed headers.
+
+2010-03-23  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Jeremy Orlow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36277, make sure nth-child supports the positive unary prefix (+) as well as the negative
+        one (-).
+
+        Added fast/css/nth-child-unary-prefix.html
+
+        * css/tokenizer.flex:
+
+2010-03-23  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Change notification sent to inspector frontend on workers creation / destruction
+        to be posted asynchronously to avoid JS reenterability problems. Also, renamed
+        willDestroyWorker to didDestroyWorker to reflect that it gets called later and got
+        rid of explicit IDs for workers (use addresses instead).
+        https://bugs.webkit.org/show_bug.cgi?id=36213
+
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::didDestroyWorker):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptHost.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::PostWorkerNotificationToFrontendTask::create):
+        (WebCore::PostWorkerNotificationToFrontendTask::PostWorkerNotificationToFrontendTask):
+        (WebCore::PostWorkerNotificationToFrontendTask::performTask):
+        (WebCore::InspectorController::postWorkerNotificationToFrontend):
+        (WebCore::InspectorController::didCreateWorker):
+        (WebCore::InspectorController::didDestroyWorker):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::):
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didDestroyWorker):
+        * inspector/InspectorFrontend.h:
+        * inspector/InspectorWorkerResource.h:
+        (WebCore::InspectorWorkerResource::create):
+        (WebCore::InspectorWorkerResource::id):
+        (WebCore::InspectorWorkerResource::InspectorWorkerResource):
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        * inspector/front-end/WorkersSidebarPane.js:
+        (WebInspector.didDestroyWorker):
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::AbstractWorker):
+        (WebCore::AbstractWorker::onDestroyWorker):
+        * workers/AbstractWorker.h:
+        (WebCore::AbstractWorker::asID):
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::SharedWorker):
+        * workers/Worker.cpp:
+        (WebCore::Worker::Worker):
+
+2010-03-22  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36266, support DOM Level 3 focusin/focusout events.  Add support for
+        IE onfocusin/onfocusout extensions to HTML.  The old DOM level 2 names (DOMFocusIn/DOMFocusOut are still supported).
+
+        Added fast/events/focusinout.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::setFocusedNode):
+        * dom/Event.cpp:
+        (WebCore::Event::aliasedType):
+        (WebCore::Event::hasAliasedType):
+        * dom/Event.h:
+        * dom/EventNames.h:
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::fireEventListeners):
+        * dom/EventTarget.h:
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchUIEvent):
+        * html/HTMLAttributeNames.in:
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::parseMappedAttribute):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseMappedAttribute):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::parseMappedAttribute):
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::parseMappedAttribute):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::parseMappedAttribute):
+
+2010-03-23  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebCore::SelectionController::setSelection NULL pointer
+        https://bugs.webkit.org/show_bug.cgi?id=31545
+
+        Added missing NULL-check that other APIs have.
+
+        Test: svg/dom/frame-related-api-during-load.html
+
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::deselectAll):
+
+2010-03-23  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] LayoutTests/fast/canvas/fillrect_gradient.html failed
+        https://bugs.webkit.org/show_bug.cgi?id=36444
+
+        Handle duplicated or unsorted colorStop at platformDestory
+
+        * platform/graphics/qt/GradientQt.cpp:
+        (WebCore::Gradient::platformGradient):
+
+2010-03-23  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Unreviewed build fix.
+
+        Try to make the window buildbot happy.
+
+        * xml/XMLHttpRequestProgressEventThrottle.cpp:
+        * xml/XMLHttpRequestProgressEventThrottle.h: Move initialization of the
+        static const in the cpp file.
+
+2010-03-23  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: make gear menu appear on styles panel at all times.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36490
+
+        * inspector/front-end/inspector.css:
+
+2010-03-23  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: render nodes in inherited style bars as links.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36486
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.BreakpointsSidebarPane.prototype._appendBreakpointElement.breakpointClicked):
+        (WebInspector.BreakpointsSidebarPane.prototype._appendBreakpointElement):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype._update.else.insertInheritedNodeSeparator):
+        (WebInspector.StylesSidebarPane.prototype._update):
+        (WebInspector.StylesSidebarPane.prototype._selectNode):
+        * inspector/front-end/inspector.js:
+
+2010-03-23  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        [XHR] onProgress event needs to be dispatched according to what the specification states
+        https://bugs.webkit.org/show_bug.cgi?id=18654
+
+        Test: http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        Added XMLHttpRequestProgressEventThrottle to the build systems.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::XMLHttpRequest): Created the throttle.
+        (WebCore::XMLHttpRequest::callReadyStateChangeListener): The 'readyState' event are
+        dispatched using the XMLHttpRequestProgressEventThrottle now. For the DONE state, we
+        need to flush any pending progress event as we do not want it to be dispatched after
+        the DONE readyState event.
+        (WebCore::XMLHttpRequest::createRequest): Made this event use the
+        XMLHttpRequestProgressEventThrottle for event dispatching.
+        (WebCore::XMLHttpRequest::abort): Ditto.
+        (WebCore::XMLHttpRequest::networkError): Ditto.
+        (WebCore::XMLHttpRequest::abortError): Ditto.
+        (WebCore::XMLHttpRequest::didReceiveData): Ditto. Also fixed a potential warning.
+        (WebCore::XMLHttpRequest::suspend):
+        (WebCore::XMLHttpRequest::resume): Implemented the logic for suspend / resume.
+        * xml/XMLHttpRequest.h:
+        * xml/XMLHttpRequestProgressEventThrottle.cpp: Added.
+        (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
+        (WebCore::XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle):
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): Implemented the bulk
+        of the event throttling here: we use a timer to do so, as long as the timer is active it means
+        that events are coming faster than the throttling time and we coalesce them.
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent): Generic method to dispatch an event.
+        (WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent): Called when we want to dispatch
+        any pending events and stopping any further dispatching.
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchPausedEvent): Used to dispatch the event
+        that was queued due to the object being suspended.
+        (WebCore::XMLHttpRequestProgressEventThrottle::fired): Used to dispatch any coalesced event.
+        (WebCore::XMLHttpRequestProgressEventThrottle::hasEventToDispatch): Used to check if we have
+        an event to dispatch.
+        (WebCore::XMLHttpRequestProgressEventThrottle::suspend): Marked the object as suspended.
+        (WebCore::XMLHttpRequestProgressEventThrottle::resume): Dispatched the event that was queued.
+        * xml/XMLHttpRequestProgressEventThrottle.h: Added.
+        (WebCore::):
+        (WebCore::XMLHttpRequestProgressEventThrottle::suspended):
+
+2010-03-23  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Element inspector search funtion: Error dispatching: performSearch.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36488
+
+        Test: inspector/elements-panel-search.html
+
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.prototype.performSearch):
+        (WebInspector.ElementsPanel.prototype.addNodesToSearchResult):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor.):
+        (injectedScriptConstructor):
+
+2010-03-23  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt]  fast/canvas/patternfill-repeat.html failed.
+        https://bugs.webkit.org/show_bug.cgi?id=34477
+
+        Change Pattern to expose the repeatX and repeatY
+        At GraphicsContextQt to apply repeatX and repeatY
+
+        * platform/graphics/Pattern.h:
+        (WebCore::Pattern::repeatX):
+        (WebCore::Pattern::repeatY):
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::drawLine):
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::rotate):
+
+2010-03-23  Alex Milowski  <alex@milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Removed the use of beta STIX fonts.
+
+        * css/mathml.css:
+
+2010-03-23  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] Does not build with latest GTK+ development release
+        https://bugs.webkit.org/show_bug.cgi?id=36398
+
+        Fix building with newest GTK+ versions.
+
+        * GNUmakefile.am:
+        * platform/gtk/GtkPluginWidget.cpp:
+        (WebCore::GtkPluginWidget::invalidateRect):
+        (WebCore::GtkPluginWidget::paint):
+        * platform/gtk/GtkVersioning.h: Added.
+        * platform/gtk/PlatformScreenGtk.cpp:
+        (WebCore::getVisual):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/gtk/ScrollbarGtk.cpp:
+        (ScrollbarGtk::paint):
+        * plugins/gtk/gtk2xtbin.c:
+        (gtk_xtbin_set_position):
+        (gtk_xtbin_unrealize):
+
+2010-03-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove support for Qt v4.4
+        https://bugs.webkit.org/show_bug.cgi?id=36389
+
+        No new tests as there is no new functionality.
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * platform/network/qt/ResourceHandleQt.cpp:
+        (WebCore::ResourceHandle::willLoadFromCache):
+        * platform/qt/CookieJarQt.cpp:
+        (WebCore::setCookies):
+        (WebCore::cookies):
+        * platform/qt/KURLQt.cpp:
+        (WebCore::KURL::operator QUrl):
+        * platform/qt/ScrollbarThemeQt.cpp:
+        (WebCore::ScrollbarThemeQt::paintScrollCorner):
+        * plugins/mac/PluginViewMac.cpp:
+
+2010-03-23  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add checks if setNeedsWillValidateCheck() and
+        setNeedsValidityCheck() are called correctly.
+        https://bugs.webkit.org/show_bug.cgi?id=34924
+
+        Introduce HTMLFormControlElement::m_willValidate and
+        m_isValid. They are the caches of willValidate() and
+        isValidFormControlElement(). setNeedsWillValidateCheck() updates
+        m_willValidate and setNeedsValidityCheck() updates m_isValid.
+
+        willValidate() and isValidFormControlElement() have assertions to
+        check m_willvalidate or m_isValid has the correct state. If
+        setNeedsWillValidateCheck() or setNeedsValidityCheck() is needed
+        to be called and is not called, these assertions fail.
+
+        * html/HTMLButtonElement.h:
+        (WebCore::HTMLButtonElement::recalcWillValidate):
+        * html/HTMLFieldSetElement.h:
+        (WebCore::HTMLFieldSetElement::recalcWillValidate):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        (WebCore::HTMLFormControlElement::parseMappedAttribute):
+        (WebCore::HTMLFormControlElement::recalcWillValidate):
+        (WebCore::HTMLFormControlElement::willValidate):
+        (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
+        (WebCore::HTMLFormControlElement::validationMessage):
+        (WebCore::HTMLFormControlElement::isValidFormControlElement):
+        (WebCore::HTMLFormControlElement::setNeedsValidityCheck):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setInputType):
+        (WebCore::HTMLInputElement::parseMappedAttribute):
+        (WebCore::HTMLInputElement::setValue):
+        (WebCore::HTMLInputElement::recalcWillValidate):
+        * html/HTMLInputElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::setNonDirtyValue):
+
+2010-03-22  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        Web Inspector: display CSS selector source line in the styles sidebar pane.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36414
+
+        This change adds a sourceLine field into the CSSStyleRule that is populated
+        from within the parser. CSSParser is now keeping track of the line numbers
+        and last selector line number that is being used while creating CSSStyleRules.
+
+        Test: inspector/styles-source-lines.html
+
+        * css/CSSGrammar.y:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::CSSParser):
+        (WebCore::CSSParser::lex):
+        (WebCore::CSSParser::countLines):
+        (WebCore::CSSParser::createStyleRule):
+        * css/CSSParser.h:
+        (WebCore::CSSParser::updateLastSelectorLine):
+        * css/CSSStyleRule.cpp:
+        (WebCore::CSSStyleRule::CSSStyleRule):
+        * css/CSSStyleRule.h:
+        (WebCore::CSSStyleRule::create):
+        (WebCore::CSSStyleRule::sourceLine):
+        * css/tokenizer.flex:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForRule):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.CSSStyleDeclaration.parseRule):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertiesSection):
+
+2010-03-22  Qi Zhang  <qi.2.zhang@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Fix arc function in canvas
+        https://bugs.webkit.org/show_bug.cgi?id=36296
+
+        Based on HTLM5 spec (4.8.10.1.8 Complex shapes), arc function should draw a line to previous point, not only the arc.
+
+        * platform/graphics/qt/PathQt.cpp:
+        (WebCore::Path::addArc):
+
+2010-03-19  Abhishek Arya  <inferno@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36339
+        Off-by-one memory corruption fix for long invalid websockets upgrade header
+
+        Test: websocket/tests/long-invalid-header.html
+
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::readServerHandshake):
+
+2010-03-22  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Unreviewed build fix for Chromim Mac at r56376
+
+        Fix initializer order  of PopupContainer.
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::PopupContainer):
+
+2010-03-22  Jay Campan  <jcampan@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Making Chromium select popups not steal activation from the browser.
+        Select popups are now like autocomplete popups, shown in non-activated
+        windows.
+        https://bugs.webkit.org/show_bug.cgi?id=36062
+
+        * page/chromium/ChromeClientChromium.h:
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::):
+        (WebCore::PopupContainer::create):
+        (WebCore::PopupContainer::PopupContainer):
+        (WebCore::PopupContainer::~PopupContainer):
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupContainer::showExternal):
+        (WebCore::PopupContainer::hidePopup):
+        (WebCore::PopupMenu::show):
+        * platform/chromium/PopupMenuChromium.h:
+        (WebCore::PopupContainer::):
+        (WebCore::PopupContainer::popupType):
+
+2010-03-22  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [v8] Crash if the worker is terminated before its initial script is executed.
+        https://bugs.webkit.org/show_bug.cgi?id=36336
+
+        Test: fast/workers/termination-early.html
+
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::initContextIfNeeded): Check for 0 context. When terminated, the v8 heap initialization returns 0.
+        (WebCore::WorkerContextExecutionProxy::evaluate): Don't execute script if initialization failed.
+        * bindings/v8/WorkerContextExecutionProxy.h:
+
+2010-03-22  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Support creation of fake workers before document is loaded by deferring
+        attaching of fake workers iframe until document is loaded and buffering all
+        messages addressed to worker.
+        https://bugs.webkit.org/show_bug.cgi?id=36445
+
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.FakeWorker.prototype.postMessage):
+        (InjectedFakeWorker.FakeWorker.prototype._buildWorker):
+        (InjectedFakeWorker.FakeWorker.prototype._attachWorkerFrameToDocument):
+        (InjectedFakeWorker.FakeWorker.prototype._onWorkerFrameLoaded):
+
+2010-03-22  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Brady Eidson.
+
+        HistoryController::replaceState() should modify m_currentItem
+        instead of the current HistoryItem of the BackForwardList.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36435
+
+        Test: fast/loader/stateobjects/replacestate-in-iframe.html
+
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::replaceState):
+
+2010-03-22  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Upstream Part of the iPhone Platform sharing code with the Mac Platform
+        https://bugs.webkit.org/show_bug.cgi?id=35870
+        <rdar://problem/7707283> and <rdar://problem/7707318>
+
+        Part 3 of 3: Shared code between iphone and mac. The shared code was
+        refactored to be usable by both platforms without platform specific
+        typing, meaning no NSEvent versus WebEvent special cases.
+
+          Shared code usable by either mac or iphone platforms.
+
+        * platform/cocoa/KeyEventCocoa.h:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::keyIdentifierForCharCode):
+        (WebCore::windowsKeyCodeForKeyCode):
+        (WebCore::windowsKeyCodeForCharCode):
+
+          Make use of the shared code. Keep anything platform specific in the
+          original file before calling the shared code.
+
+        * platform/iphone/KeyEventIPhone.mm:
+        (WebCore::keyIdentifierForKeyEvent):
+        * platform/mac/KeyEventMac.mm:
+        (WebCore::keyIdentifierForKeyEvent):
+        (WebCore::windowsKeyCodeForKeyEvent):
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): Fix a find/repalce mistake from my earlier patch.
+        Rename m_setShowsMissingPluginIndicator -> m_showsMissingPluginIndicator. 
+        (WebCore::RenderEmbeddedObject::updateWidget): Don't update the widget if we're showing
+        the missing plug-in indicator.
+        (WebCore::RenderEmbeddedObject::paint):Fix a find/repalce mistake from my earlier patch.
+        Rename m_setShowsMissingPluginIndicator -> m_showsMissingPluginIndicator. 
+        (WebCore::RenderEmbeddedObject::paintReplaced): Ditto.
+        * rendering/RenderEmbeddedObject.h: Ditto.
+        (WebCore::RenderEmbeddedObject::setShowsMissingPluginIndicator): Ditto.
+        (WebCore::RenderEmbeddedObject::showsMissingPluginIndicator): Ditto.
+
+2010-03-22  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Upstream Part of the iPhone Platform sharing code with the Mac Platform
+        https://bugs.webkit.org/show_bug.cgi?id=35870
+        <rdar://problem/7707283>
+
+        Part 2 of 3: No changes other than moving code around.
+        Copied KeyEvent function from platform/mac to a platform/cocoa shared directory.
+
+        * WebCore.xcodeproj/project.pbxproj: Added cocoa group and new files.
+        * platform/cocoa/KeyEventCocoa.h: Added.
+        * platform/cocoa/KeyEventCocoa.mm: Copied from WebCore/platform/mac/KeyEventMac.mm.
+        (WebCore::keyIdentifierForKeyEvent):
+        (WebCore::windowsKeyCodeForKeyEvent): Include the shared code.
+        * platform/mac/KeyEventMac.mm:
+
+2010-03-22  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Part 1 of 3: Upstream iPhone KeyEvent platform code and share with Mac platform
+        https://bugs.webkit.org/show_bug.cgi?id=35870
+        <rdar://problem/7707283>
+
+        * WebCore.xcodeproj/project.pbxproj: Added iphone group and new files.
+        * platform/iphone: Added.
+        * platform/iphone/KeyEventCodesIPhone.h: Added.
+        * platform/iphone/KeyEventIPhone.mm: Added. Ensure PLATFORM(IPHONE)
+        * platform/mac/KeyEventMac.mm: Ensure PLATFORM(MAC)
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+    
+        Attempt to fix the Leopard build.
+        * rendering/RenderEmbeddedObject.cpp: Add ".f" to contants.
+
+2010-03-22  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Dirk Schulze.
+
+        Out of bounds read in SVG feColorMatrix filter
+        https://bugs.webkit.org/show_bug.cgi?id=32714
+
+        Prevents an invalid read when a valid values attribute is not
+        supplied for an feColorMatrix SVG filter. Also fixes general
+        handling of missing or invalid values attribute.
+
+        Tests: svg/filters/feColorMatrix-invalid-value.svg
+               svg/filters/feColorMatrix-values.svg
+
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::build):
+
+2010-03-22  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Eric Carlson.
+
+        [GStreamer] Use ImageBuffer API to do painting
+        https://bugs.webkit.org/show_bug.cgi?id=35783
+
+        New ImageGStreamer class abstracting the conversion of GStreamer
+        buffers to cairo surfaces. Using this makes the painting code of
+        the player more generic.
+
+        * GNUmakefile.am:
+        * platform/graphics/gstreamer/ImageGStreamer.h: Added.
+        (WebCore::ImageGStreamer::image):
+        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Added.
+        (ImageGStreamer::createImage):
+        (ImageGStreamer::ImageGStreamer):
+        (ImageGStreamer::~ImageGStreamer):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::paint):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-22  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for <rdar://problem/7766437> With Web Inspector opened, a crash 
+        occurs at Webcore:getMatchedCSSRules() when navigating to a 
+        previous page
+
+        defaultView() can legitimately by null (as it is in this case), so 
+        it must be null-checked.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        (WebCore::InspectorDOMAgent::getComputedStyle):
+        (WebCore::InspectorDOMAgent::getMatchedCSSRules):
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Darin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+        
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadPlugin): Call setShowsMissingPluginIndicator(true) in cases that fail
+        to generate a widget.
+        * rendering/RenderEmbeddedObject.cpp: Added new missing plug-in related static constants
+        (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): Initialize newly boolean to false.
+        (WebCore::RenderEmbeddedObject::paint): Added.
+        (WebCore::RenderEmbeddedObject::paintReplaced): Added. Draws a subtle rounded rectangle
+        containing the text "Missing Plug-in".
+        * rendering/RenderEmbeddedObject.h: Added the following two methods below.
+        (WebCore::RenderEmbeddedObject::setShowsMissingPluginIndicator):
+        (WebCore::RenderEmbeddedObject::showsMissingPluginIndicator):
+        * rendering/RenderWidget.h: Moved paint(PaintInfo&, int, int) from private to protected.
+
+2010-03-22  Jakub Wieczorek  <faw217@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Phonon media backend: expose supported MIME types to WebCore
+
+        https://bugs.webkit.org/show_bug.cgi?id=33453
+
+        MediaPlayerPrivate should expose the MIME types that are supported
+        by the underlying backend in Phonon.
+
+        * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
+        (WebCore::MediaPlayerPrivate::supportedTypesCache):
+        (WebCore::MediaPlayerPrivate::getSupportedTypes):
+        (WebCore::MediaPlayerPrivate::supportsType):
+        * platform/graphics/qt/MediaPlayerPrivatePhonon.h:
+
+2010-03-22  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: AuditRules still use getMatchedCSSRules as a part of the img-related audit.
+        https://bugs.webkit.org/show_bug.cgi?id=36424
+
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.receivedImages):
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.pushImageNodes):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-03-22  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        TextBreakIteratorICU.cpp is incompatible with new UBreakIterator type in ICU 4.4
+        https://bugs.webkit.org/show_bug.cgi?id=36381
+
+        * platform/text/TextBreakIteratorICU.cpp:
+        (WebCore::setUpIterator): Use reinterpret_cast instead of static_cast or relying
+        on conversion to void*.
+        (WebCore::textBreakFirst): Ditto.
+        (WebCore::textBreakLast): Ditto.
+        (WebCore::textBreakNext): Ditto.
+        (WebCore::textBreakPrevious): Ditto.
+        (WebCore::textBreakPreceding): Ditto.
+        (WebCore::textBreakFollowing): Ditto.
+        (WebCore::textBreakCurrent): Ditto.
+        (WebCore::isTextBreak): Ditto.
+        (WebCore::setUpIteratorWithRules): Ditto.
+
+2010-03-22  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Typo in GPL license text
+        https://bugs.webkit.org/show_bug.cgi?id=36442
+
+        Fix typo - "aint with this library" -> "along with this library".
+
+        * bindings/scripts/CodeGenerator.pm:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/scripts/IDLParser.pm:
+        * bindings/scripts/IDLStructure.pm:
+        * bindings/scripts/generate-bindings.pl:
+
+2010-03-22  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Don't construct a QLineEdit every time when painting a text field
+        https://bugs.webkit.org/show_bug.cgi?id=36373
+
+        Instead, keep one instance per RenderTheme around.
+
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::findFrameLineWidth):
+
+2010-03-22  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Multiselect Popup - adjusting QtAbstractWebPopup
+        https://bugs.webkit.org/show_bug.cgi?id=36186
+
+        QtAbstractWebPopup must provide new methods to be used by its descendants that
+        wish to handle <select multiple> elements.
+
+        * platform/qt/QtAbstractWebPopup.cpp:
+        (WebCore::QtAbstractWebPopup::selectItem):
+        (WebCore::QtAbstractWebPopup::multiple):
+        * platform/qt/QtAbstractWebPopup.h:
+
+2010-03-22  Alex Milowski  <alex@milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added basic support for mfrac (fractions)
+
+        Test: mathml/presentation/fractions.xhtml
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::createRenderer):
+        * mathml/RenderMathMLFraction.cpp: Added.
+        (WebCore::RenderMathMLFraction::RenderMathMLFraction):
+        (WebCore::RenderMathMLFraction::updateFromElement):
+        (WebCore::RenderMathMLFraction::addChild):
+        * mathml/RenderMathMLFraction.h: Added.
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * page/mac/WebCoreViewFactory.h: Added -missingPluginText method 
+        * platform/LocalizedStrings.h: Added missingPluginText()
+        * platform/gtk/LocalizedStringsGtk.cpp: Likewise.
+        * platform/mac/LocalizedStringsMac.mm: Same here.
+        * platform/qt/Localizations.cpp: Ditto.
+
+2010-03-22  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Handle worker exceptions in V8MessageHandler like it's done in regular documents. This way all worker exceptions will be logged in the console not only those which happen in event listeners. 
+
+        https://bugs.webkit.org/show_bug.cgi?id=31171
+
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::invokeEventHandler): Removed explicit call to reportException.
+        * bindings/v8/V8Utilities.cpp: reportException function was removed since it's not used.
+        (WebCore::getScriptExecutionContext):
+        * bindings/v8/V8Utilities.h:
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::v8MessageHandler):
+        (WebCore::WorkerContextExecutionProxy::initContextIfNeeded): Setup message handler when first worker context is created.
+
+2010-03-22  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Simon Hausmann.
+
+        Add EFL-specific code to page/EventHandler.cpp.
+        http://webkit.org/b/36306
+
+        * page/EventHandler.cpp:
+
+2010-03-22  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Simon Hausmann.
+
+        Add EFL-specific code to platform/DragImage.h and
+        platform/DragData.h.
+        http://webkit.org/b/36310
+
+        * platform/DragImage.h:
+        * platform/DragData.h:
+
+2010-03-22  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Simon Hausmann.
+
+        Add EFL-specific code to platform/FileSystem.h.
+        http://webkit.org/b/36313
+
+        * platform/FileSystem.h:
+
+2010-03-22  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Simon Hausmann.
+
+        Add EFL-specific code to platform/Cursor.h.
+        http://webkit.org/b/36319
+
+        * platform/Cursor.h:
+
+2010-03-22  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Simon Hausmann.
+
+        Add EFL-specific code to platform/NotImplemented.h.
+        http://webkit.org/b/36320
+
+        * platform/NotImplemented.h:
+
+2010-03-21  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] GraphicsLayer: matrix interpolations in transform-animations don't behave correctly
+        https://bugs.webkit.org/show_bug.cgi?id=35520
+        
+        The case where the list of source and target transform operations are 
+        not the same but have the same size needs to be special-cased in
+        GraphicsLayerQt, as well as the case where the source or target
+        operation list is empty. The URLs listed here render correctly after
+        applying the patch.
+
+        Tests: https://bug-35520-attachments.webkit.org/attachment.cgi?id=49890
+               https://bug-35520-attachments.webkit.org/attachment.cgi?id=49889
+            
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::TransformAnimationQt::applyFrame):
+
+2010-03-21  Dmitry Gorbik  <socket.h@gmail.com>
+
+        <http://webkit.org/b/14858> <col> width ignored when not tied to a single cell
+
+        Reviewed by David Kilzer.
+
+        Fixed width calculation for cells with span when <col> is defined.
+
+        Test: fast/table/col-width-span-expand.html
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::styleOrColWidth): Added the calculation of cell width
+        in case of <col> defined and span > 1.
+
+2010-03-20  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Kenneth Christiansen.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Spatial Navigation: Code simplification in FocusController.cpp and SpatialNavigation.cpp (part I)
+        https://bugs.webkit.org/show_bug.cgi?id=36168
+
+        Make use of isNull and document methods introduced in FocusCandidate class by patch in bug 36167.
+        No functionalty change.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+        * page/SpatialNavigation.cpp:
+        (WebCore::distanceInDirection):
+
+2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fixes after recent changes.
+
+        * platform/graphics/wx/ImageWx.cpp:
+        * wscript:
+
+2010-03-20  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Assertion failure in media/video-controls-with-mutation-event-handler.html
+        https://bugs.webkit.org/show_bug.cgi?id=36376
+
+        Test: media/video-controls-with-mutation-event-handler.html
+
+        Break early (when not attached) in the defaultEventHandler before the
+        slider is completely set up.
+
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlTimelineElement::defaultEventHandler):
+        (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::createVolumeSlider):
+
+2010-03-19  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        WebCore::RenderButton::styleDidChange ReadAV@NULL (6739b7fe455ecb54a6812c0866c3b47c)
+        https://bugs.webkit.org/show_bug.cgi?id=34641
+
+        Don't dig into buttons and menu lists when finding which element
+        should be modified by :first-letter pseudo class.  Even before
+        this change, we didn't dig into inline buttons and menu lists as
+        they are replaced so this issue wasn't found long time.
+
+        Test: fast/css/first-letter-block-form-controls-crash.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateFirstLetter):
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Daniel Bates.
+
+        Change XSSAuditor block syntax
+        https://bugs.webkit.org/show_bug.cgi?id=34436
+
+        Update our blocking syntax to something more reasonable.  Also,
+        implemented a way for a web site to disable the filter.
+
+        Tests: http/tests/security/xssAuditor/no-protection-script-tag.html
+               http/tests/security/xssAuditor/xss-protection-parsing-01.html
+
+        * page/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::xssProtection):
+        (WebCore::XSSAuditor::findInRequest):
+        * page/XSSAuditor.h:
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::skipToken):
+        (WebCore::parseXSSProtectionHeader):
+        * platform/network/HTTPParsers.h:
+        (WebCore::):
+
+2010-03-19  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Refactor DatabaseTracker.cpp for thread safety
+        https://bugs.webkit.org/show_bug.cgi?id=34991
+
+        This enables calling into DatabaseTracker from multiple context threads,
+        as will happen once Workers can access the Database.  It required a fair
+        amount of reshuffling of locks.  I ended up splitting the public
+        interface [calls that take locks and call private functions] from the
+        implementations [calls that assert that locks are already held] in order
+        to avoid lock conflicts.  I also had to make sure we weren't sharing
+        Strings or SecurityOrigins across threads.
+
+        No new tests.
+
+        Allow access to database handles from multiple threads IFF SQLite is new enough and the user requests it.
+
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::SQLiteDatabase::SQLiteDatabase):
+        (WebCore::SQLiteDatabase::disableThreadingChecks):
+        * platform/sql/SQLiteDatabase.h:
+        (WebCore::SQLiteDatabase::sqlite3Handle):
+        (WebCore::SQLiteDatabase::disableThreadingChecks):
+
+        Remove an asynchronous call from Database::close back to the execution thread, so that cleanup can be more deterministic.
+
+        * storage/Database.cpp:
+        (WebCore::Database::markAsDeletedAndClose):
+        (WebCore::Database::close):
+        * storage/Database.h:
+        (WebCore::Database::):
+        * storage/DatabaseDetails.h:
+        (WebCore::DatabaseDetails::DatabaseDetails):
+        (WebCore::DatabaseDetails::thread):
+        * storage/DatabaseTask.cpp:
+        (WebCore::DatabaseCloseTask::doPerformTask):
+        * storage/DatabaseThread.cpp:
+        (WebCore::DatabaseThread::databaseThread):
+
+        Any Strings that get stored in DatabaseTracker, and any Strings returned from DatabaseTracker, are now threadsafeCopies.
+        Public functions now take all needed locks, then generally call only private functions [there are a few exceptions: deletion functions and origins()].
+        Private functions no longer take locks.
+        m_quotaMapGuard becomes m_databaseGuard, and now protects m_database, m_quotaMap, m_proposedDatabases, m_databaseDirectoryPath, m_originsBeingDeleted, m_beingCreated, and m_beingDeleted.
+        m_proposedDatabases replaces m_proposedDatabase, to account for reentrancy.
+
+        * storage/DatabaseTracker.h:
+        * storage/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::originQuotaManagerNoLock):
+        (WebCore::DatabaseTracker::originQuotaManager):
+        (WebCore::DatabaseTracker::DatabaseTracker):
+        (WebCore::DatabaseTracker::setDatabaseDirectoryPath):
+        (WebCore::DatabaseTracker::databaseDirectoryPath):
+        (WebCore::DatabaseTracker::trackerDatabasePath):
+        (WebCore::DatabaseTracker::openTrackerDatabase):
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
+        (WebCore::DatabaseTracker::hasEntryForOrigin):
+        (WebCore::DatabaseTracker::hasEntryForDatabase):
+        (WebCore::DatabaseTracker::originPath):
+        (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
+        (WebCore::DatabaseTracker::fullPathForDatabase):
+        (WebCore::DatabaseTracker::populateOrigins):
+        (WebCore::DatabaseTracker::origins):
+        (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
+        (WebCore::DatabaseTracker::databaseNamesForOrigin):
+        (WebCore::DatabaseTracker::detailsForNameAndOrigin):
+        (WebCore::DatabaseTracker::setDatabaseDetails):
+        (WebCore::DatabaseTracker::usageForDatabase):
+        (WebCore::DatabaseTracker::addOpenDatabase):
+        (WebCore::DatabaseTracker::removeOpenDatabase):
+        (WebCore::DatabaseTracker::usageForOriginNoLock):
+        (WebCore::DatabaseTracker::usageForOrigin):
+        (WebCore::DatabaseTracker::quotaForOriginNoLock):
+        (WebCore::DatabaseTracker::quotaForOrigin):
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::addDatabase):
+        (WebCore::DatabaseTracker::deleteAllDatabases):
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        (WebCore::DatabaseTracker::setClient):
+        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
+        (WebCore::DatabaseTracker::notifyDatabasesChanged):
+
+        These functions keep track of in-progress deletions and creations, so that we can make sure nobody every deletes a database file while a live database is using it.
+        (WebCore::DatabaseTracker::canCreateDatabase):
+        (WebCore::DatabaseTracker::recordCreatingDatabase):
+        (WebCore::DatabaseTracker::doneCreatingDatabase):
+        (WebCore::DatabaseTracker::creatingDatabase):
+        (WebCore::DatabaseTracker::canDeleteDatabase):
+        (WebCore::DatabaseTracker::recordDeletingDatabase):
+        (WebCore::DatabaseTracker::doneDeletingDatabase):
+        (WebCore::DatabaseTracker::deletingDatabase):
+        (WebCore::DatabaseTracker::canDeleteOrigin):
+        (WebCore::DatabaseTracker::deletingOrigin):
+        (WebCore::DatabaseTracker::recordDeletingOrigin):
+        (WebCore::DatabaseTracker::doneDeletingOrigin):
+
+        Any SecurityOrigins stored in OriginQuotaManager are now threadsafeCopies of inputs.  There's a new tryLock() function in addition to the existing lock().
+
+        * storage/OriginQuotaManager.cpp:
+        (WebCore::OriginQuotaManager::tryLock):
+        (WebCore::OriginQuotaManager::trackOrigin):
+        * storage/OriginQuotaManager.h:
+
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::databaseIdentifier):
+        Removed DEFINE_STATIC_LOCAL wrapper on a local variable; it appears to have been a small optimization, but it's not thread-safe.
+
+2010-03-19  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Antti Koivisto.
+
+        Multiselect popups - rendering
+        https://bugs.webkit.org/show_bug.cgi?id=36006
+
+        The objective of this patch is to create a compile time flag that can be used
+        to force all <select> elements to be rendered as menu lists.
+
+        Theme stylesheet mechanism has been used to change the appearance of the elements.
+
+        Class QtStyleOptionWebComboBox has been introduced to provide to QStyle objects
+        the needed information to render <select multiple> comboboxes.
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * css/themeQtNoListboxes.css: Added.
+        (select[size][multiple]):
+        * dom/SelectElement.h:
+        (WebCore::SelectElementData::usesMenuList):
+        * platform/qt/QtStyleOptionWebComboBox.h: Added.
+        (WebCore::QtStyleOptionWebComboBox::QtStyleOptionWebComboBox):
+        (WebCore::QtStyleOptionWebComboBox::multiple):
+        (WebCore::QtStyleOptionWebComboBox::checkMultiple):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::extraDefaultStyleSheet):
+        (WebCore::RenderThemeQt::paintMenuList):
+        (WebCore::RenderThemeQt::paintMenuListButton):
+        * platform/qt/RenderThemeQt.h:
+
+2010-03-19  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Oliver Hunt.
+
+        Update WebGLArray.slice() to new spec
+        https://bugs.webkit.org/show_bug.cgi?id-35612
+
+        * bindings/js/JSWebGLArrayCustom.cpp: Adding support for default inputs.
+        (WebCore::JSWebGLArray::slice):
+        * bindings/v8/custom/V8WebGLArrayCustom.cpp: Ditto.
+        (WebCore::V8WebGLArray::sliceCallback):
+        * html/canvas/WebGLArray.cpp: Map start/end to offset/length.
+        (WebCore::WebGLArray::calculateOffsetAndLength):
+        * html/canvas/WebGLArray.h: Modified slice parameters.
+        * html/canvas/WebGLArray.idl: Define custom binding for slice().
+        * html/canvas/WebGLByteArray.cpp: Modified slice parameters.
+        (WebCore::WebGLByteArray::slice):
+        * html/canvas/WebGLByteArray.h: Ditto.
+        * html/canvas/WebGLFloatArray.cpp: Ditto.
+        (WebCore::WebGLFloatArray::slice):
+        * html/canvas/WebGLFloatArray.h: Ditto.
+        * html/canvas/WebGLIntArray.cpp: Ditto.
+        (WebCore::WebGLIntArray::slice):
+        * html/canvas/WebGLIntArray.h: Ditto.
+        * html/canvas/WebGLShortArray.cpp: Ditto.
+        (WebCore::WebGLShortArray::slice):
+        * html/canvas/WebGLShortArray.h: Ditto.
+        * html/canvas/WebGLUnsignedByteArray.cpp: Ditto.
+        (WebCore::WebGLUnsignedByteArray::slice):
+        * html/canvas/WebGLUnsignedByteArray.h: Ditto.
+        * html/canvas/WebGLUnsignedIntArray.cpp: Ditto.
+        (WebCore::WebGLUnsignedIntArray::slice):
+        * html/canvas/WebGLUnsignedIntArray.h: Ditto.
+        * html/canvas/WebGLUnsignedShortArray.cpp: Ditto.
+        (WebCore::WebGLUnsignedShortArray::slice):
+        * html/canvas/WebGLUnsignedShortArray.h: Ditto.
+
+2010-03-19  Yong Li <yong.li@torchmobile.com> and Andy Estes <aestes@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Ensure the segments inside SharedBuffer are merged before constructing
+        a CFData with it.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50843
+
+        * manual-tests/WebKitSite.webarchive: Added.
+        * manual-tests/webarchive-test.html: Added.
+        * platform/cf/SharedBufferCF.cpp:
+        (WebCore::SharedBuffer::createCFData):
+
+2010-03-19  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Oliver Hunt.
+
+        Security: ReadAV@NULL for negative feMorphology filter radius
+        https://bugs.webkit.org/show_bug.cgi?id=34566
+
+        Prevents building the filter if either radius is negative.
+        Catches negative radii resulting from conversions.
+
+        Test: svg/filters/feMorphology-invalid-radius.svg
+
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::build):
+        * svg/graphics/filters/SVGFEMorphology.cpp:
+        (WebCore::FEMorphology::apply):
+
+2010-03-19  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed a crash with AnimationController getting deleted out from under itself.
+        
+        It's possible for the Frame that owns an AnimationController to get deleted
+        in the EndTransitionEvent (or other animation events) to get deleted in the
+        event handler. Normally this case is protected against by preventing the Frame
+        from getting deleted until the end of the runloop. But native uses of the 
+        WebView can subvert this protection. So I added a protector to the 
+        animation event dispatcher to protect it in those cases.
+
+        Test: transitions/transition-end-event-destroy-iframe.html
+
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
+
+2010-03-19  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Antti Koivisto.
+
+        Multiselect Popup - PopupMenuClient extension
+        https://bugs.webkit.org/show_bug.cgi?id=36178
+
+        PopupMenuClient class is the interface used by combobox popup implementations.
+        It needs to be extended to handle <select multiple> needs.
+
+        A new interface named ListPopupMenuClient that inherits from PopupMenuClient was created.
+        The use of this new class instead of adding methods to PopupMenuClient avoids changes
+        in other non related implementations of PopupMenuClient.
+
+        RenderMenuList has changed to inherit ListPopupMenuClient instead of PopupMenuClient
+        and to have the new methods implemented.
+
+        * platform/PopupMenuClient.h:
+        * rendering/RenderMenuList.cpp:
+        (WebCore::RenderMenuList::listBoxSelectItem):
+        (WebCore::RenderMenuList::multiple):
+        * rendering/RenderMenuList.h:
+
+2010-03-19  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36387
+        REGRESSION: Can "uncheck" radio buttons by clicking on them
+        
+        My change in r56174 caused radio buttons and checkboxes to go down the same code path by virtue
+        of allowsIndeterminate(), but this broke save/restore behavior on radio buttons.
+        
+        Fix by saving and restoring both the intermediate and checked state for radio buttons
+        and checkboxes, as well as the "current radio button" state.
+
+        Test: fast/forms/radio-checkbox-restore-indeterminate.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::EventHandlingState::EventHandlingState): New struct to hold state between preDispatchEventHandler()
+        and postDispatchEventHandler().
+        (WebCore::HTMLInputElement::preDispatchEventHandler): Store intermedate and checked state
+        and the current radio button.
+        (WebCore::HTMLInputElement::postDispatchEventHandler): Restore state as appropriate.
+        * html/HTMLInputElement.h: Add a comment to clarify how 'intermediate' interacts with 'checked', according
+        to the spec.
+
+2010-03-19  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: caret moves past prompt in javascript console
+        https://bugs.webkit.org/show_bug.cgi?id=26602
+
+        Having noticed any Element children besides a leading <br> (which are empty
+        text nodes), WebCore editing facility thinks it should delete the <br>,
+        thus clearing away the text prompt contents.
+
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype.clearAutoComplete):
+        (WebInspector.TextPrompt.prototype._completionsReady):
+        * inspector/front-end/utilities.js:
+        (Element.prototype.pruneEmptyTextNodes):
+
+2010-03-19  Adam Roben  <aroben@apple.com>
+
+        Windows clean build fix after r56192
+
+        * WebCore.vcproj/WebCore.vcproj: Copy headers from
+        platform/graphics/cg to $WebKitOutputDir as part of the post-build
+        event so that WebKit can use them. (The only one we currently require
+        is FontPlatformData.h.)
+
+        * platform/graphics/win/FontPlatformDataCGWin.cpp: Touched to force a
+        build.
+
+2010-03-19  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Assertion failure in media/video-controls-with-mutation-event-handler.html
+        https://bugs.webkit.org/show_bug.cgi?id=36376
+
+        Fix crashing test. Underlying the media element's volume slider is a
+        range input, which sanitizes values before expected on the media control.
+
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::createVolumeSlider):
+
+2010-03-19  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        3 of the new HTML5 loading events need to be asynchronous.
+
+        Laying the groundwork for:
+        https://bugs.webkit.org/show_bug.cgi?id=36201
+        https://bugs.webkit.org/show_bug.cgi?id=36202
+        https://bugs.webkit.org/show_bug.cgi?id=36334
+        https://bugs.webkit.org/show_bug.cgi?id=36335
+
+        Document already had an asynchronous event delivery mechanism for storage events, so
+        we can repurpose that for all async events.
+
+        No new tests. (No change in behavior)
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::implicitClose): Use Document::schedule* for the related events.
+        (WebCore::Document::enqueueEvent): Renamed from enqueueStorageEvent
+        (WebCore::Document::pendingEventTimerFired): Renamed from "storageEventTimerFired"
+        (WebCore::Document::statePopped): Use Document::schedulePopstateEvent
+        (WebCore::Document::enqueuePageshowEvent): All Pageshow events are piped through here.
+          This will be made asynchronous in a separate patch.
+        (WebCore::Document::enqueueHashchangeEvent): All Hashchange events are piped through here.
+          This will be made asynchronous in a separate patch.
+        (WebCore::Document::enqueuePopstateEvent): All Popstate events are piped through here.
+          This will be made asynchronous in a separate patch.
+        * dom/Document.h:
+        (WebCore::):
+
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrameBase::restore): Use Document::enqueuePageshowEvent
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadInSameDocument): Use Document::enqueueHashchangeEvent
+
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatch): Use Document::enqueueEvent
+
+2010-03-19  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Darin Adler and Brady Eidson.
+
+        First step toward:
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        This is the first step torward eliminating the WebKit WebNullPluginView class. The responsibility for this will soon
+        be in platform-independent code in WebCore. The plan is to change RenderEmbeddedObject and give it the capability of
+        drawing the missing plug-in text. 
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestObject): Renamed the renderer parameter to requestEmbeddedObject and made it
+        a RenderEmbeddedObject.
+        (WebCore::FrameLoader::loadPlugin): Likewise.
+        * loader/FrameLoader.h: Updated loadPlugin() and requestObject() method signatures accordingly. 
+
+2010-03-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Disable TILED_BACKING_STORE if Qt version is earlier than Qt4.6
+        https://bugs.webkit.org/show_bug.cgi?id=36348
+
+        Backing store implementation for QtWebKit requires at least Qt
+        version 4.6.
+
+        No new tests as there is no new functionality.
+
+        * WebCore.pri:
+
+2010-03-19  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        <input type=range> does not validate correctly without a renderer and the tests are incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=36259
+
+        Setting value attribute on an <input type=range> to an out-of-range value fires oninput
+        https://bugs.webkit.org/show_bug.cgi?id=16990
+
+        Part 2 of 2: When setting the range element's value, overflows and underflows
+        are automatically sanitized to valid values. Moved the general case
+        sanitization code out of the Renderer into HTMLInputElement::sanitizeValue.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::value): when getting a default value on reset() ensure the defaultValue is provided
+        (WebCore::HTMLInputElement::sanitizeValue): clamp the value within the max/min/step range constraints
+        * html/StepRange.cpp:
+        (WebCore::StepRange::StepRange): allow const element in the constructor
+        (WebCore::StepRange::clampValue): clamp from a String value
+        * html/StepRange.h:
+        (WebCore::StepRange::defaultValue): easy calculation of the default value for max/min/step range constraints
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::updateFromElement): no longer handle the general case sanitization in the renderer
+
+2010-03-19  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by David Kilzer.
+
+        <input type=range> does not validate correctly without a renderer and the tests are incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=36259
+
+        Part 1 of 2: Refactoring the SliderRange struct out of RenderSlider
+        into a more appropriate place. Changed the named to StepRange. Changed
+        from a struct to a class.
+
+          Added new files to the build.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
+          Renamed and moved class SliderRange to StepRange.
+
+        * html/StepRange.cpp: Added.
+        (WebCore::StepRange::StepRange):
+        (WebCore::StepRange::clampValue):
+        (WebCore::StepRange::valueFromElement):
+        (WebCore::sliderPosition):
+        * html/StepRange.h: Added.
+        (WebCore::StepRange::proportionFromValue):
+        (WebCore::StepRange::valueFromProportion):
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::updateFromElement): updated to use StepRange
+        (WebCore::RenderSlider::setValueForPosition): updated to use StepRange
+
+2010-03-19  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36366
+        Repaint loop when painting using scaled CTMs with different translations
+
+        The code in RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality
+        tests if the scaling has changed from the previous value by comparing the
+        transformations. The test fails if the scale is the same but the translation 
+        changes. This can lead to infinite repaint loop if the document is painted 
+        in pieces using different translations (for example for tiling).
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality):
+
+2010-03-19  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: editing shorthands does not always work.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36362
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::applyStyleText):
+        (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+        (WebCore::InspectorDOMAgent::shorthandValue):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype):
+        * inspector/front-end/inspector.css:
+        (.section .properties li.disabled .enabled-button):
+        * inspector/front-end/inspector.js:
+        (WebInspector.startEditing.editingCommitted):
+
+2010-03-19  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Don't replace clip when drawing complex text
+
+        * platform/graphics/qt/FontQt.cpp:
+
+2010-03-18  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        If a frame is already in the document, then setting its "src" attribute
+        should add the resultant navigation to history.
+
+        https://bugs.webkit.org/show_bug.cgi?id=9166
+
+        This behavior is specified in section 4.8.2 of the HTML5 spec.
+
+        Test: fast/loader/frame-src-change-added-to-history.html
+
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::openURL):
+        (WebCore::HTMLFrameElementBase::setLocation):
+        * html/HTMLFrameElementBase.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestFrame):
+        * loader/FrameLoader.h:
+
+2010-03-18  Chris Evans  <cevans@chromium.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Fix a minor crash with mismatched array sizes in SVG animation
+        elements.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35606
+
+        Test: svg/animations/keypoints-mismatch.svg
+
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::startedActiveInterval):
+        Globally apply validations relevant to all animation types.
+
+2010-03-18  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Implement software composited graphics layers in Chromium using the Skia library.
+        https://bugs.webkit.org/show_bug.cgi?id=35557
+        This is an initial step in the implementation. Layer compositing is functioning
+        but not optimized in any way. Subsesquent check-ins will be necessary to fine tune
+        it.
+
+        Test: No new exposed functionality so no new tests.
+
+        * WebCore.gypi:
+          Added new source files to the chromium build
+        * platform/graphics/GraphicsLayer.h:
+          Added necessary typedef's and forward declarations for Chromium.
+        * platform/graphics/skia/GraphicsLayerSkia.cpp: Added.
+        * platform/graphics/skia/GraphicsLayerSkia.h: Added.
+          Declaration and implementation of the platform-specific GraphicsLayer class.
+        * platform/graphics/skia/LayerRendererSkia.cpp: Added.
+        * platform/graphics/skia/LayerRendererSkia.h: Added.
+          Declaration and implementation of the Skia-based software compositor.
+        * platform/graphics/skia/LayerSkia.cpp: Added.
+        * platform/graphics/skia/LayerSkia.h: Added.
+          Declaration and implementation of a compositable layer that uses a Skia canvas
+          for backing store.
+
+2010-03-18  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Make setPrinting() with printing=false, restore the previous
+        media type in use.
+
+        Test: fast/media/print-restores-previous-mediatype.html
+
+        * page/Frame.cpp:
+        (WebCore::Frame::setPrinting):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustMediaTypeForPrinting):
+        * page/FrameView.h:
+
+2010-03-18  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36338> Remove unused RenderReplaced::adjustOverflowForBoxShadowAndReflect() declaration
+
+        Rubber-stamped by Darin Adler.
+
+        This declaration should have been removed in r47440.
+
+        * rendering/RenderReplaced.h:
+        (WebCore::RenderReplaced::adjustOverflowForBoxShadowAndReflect): Removed.
+
+2010-03-18  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Dragging a PDF image triggers assertion in DragController::startDrag()
+        https://bugs.webkit.org/show_bug.cgi?id=36247
+
+        Test: fast/images/drag-pdf-as-image.html
+
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::filenameExtension):
+        * platform/graphics/cg/PDFDocumentImage.h:
+
+2010-03-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Avoid taking a reference to a String owned by a temporary AtomicString.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::RareData::parseNth):
+
+2010-03-18  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed parenting issues with HW layers on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=32449
+        
+        CACF can't properly fix superlayer changes, so a layer added
+        as a sublayer must have a null superlayer. I changed a couple of
+        places that change sublayers to removeFromSuperlayer while adding
+        to a new layer. This fixes both the problem of disappearing children
+        and children getting doubled. Also got rid of removeSublayer(). Layers
+        should always be removed from their parent with removeFromSuperlayer().
+        
+        This also removed moveLayer(), which is not used and may not be safe in how
+        it copies.
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:Changed setName to be like Mac, to give more debugging info (to fix problems like these)
+        (WebCore::GraphicsLayerCACF::setName):
+        * platform/graphics/win/WKCACFLayer.cpp:Make sure superlayer is null before adding
+        (WebCore::WKCACFLayer::insertSublayer):
+        (WebCore::WKCACFLayer::replaceSublayer):
+        (WebCore::WKCACFLayer::removeFromSuperlayer):
+        (WebCore::WKCACFLayer::setSublayers):
+        (WebCore::WKCACFLayer::printLayer):print the superlayer for better debugging
+        * platform/graphics/win/WKCACFLayer.h:
+
+2010-03-18  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Unreviewed, build fix.
+
+        [Chromium] Change the order of mac/ and cg/ include dirs to fix compile break
+        due to http://trac.webkit.org/changeset/56192,
+
+        * WebCore.gyp/WebCore.gyp: Changed the order.
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36325
+
+        Add support for stopImmediatePropagation from DOM Level 3 Events.
+
+        Added fast/events/stop-immediate-propagation.html.
+
+        * dom/Event.cpp:
+        (WebCore::Event::Event):
+        * dom/Event.h:
+        (WebCore::Event::timeStamp):
+        (WebCore::Event::stopPropagation):
+        (WebCore::Event::stopImmediatePropagation):
+        (WebCore::Event::propagationStopped):
+        (WebCore::Event::immediatePropagationStopped):
+        * dom/Event.idl:
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::fireEventListeners):
+
+2010-03-18  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Unreviewed, build fix.
+
+        Return frame accessor back to Geolocation, it's used in GeolocationServiceChromium.
+        The accessor was removed in http://trac.webkit.org/changeset/56188.
+
+        * page/Geolocation.h:
+        (WebCore::Geolocation::frame): Added back.
+
+2010-03-18  Brent Fulgham  <bfulgham@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Help reduce build problems due to font declarations.
+        https://bugs.webkit.org/show_bug.cgi?id=36190
+
+        Functions unchanged, no new tests.
+
+        * WebCore.vcproj/WebCore.vcproj: Add new file, and show
+          movement of FontPlatformData.h to cg/ directory.
+        * platform/graphics/cairo/FontPlatformData.h: Merge in
+          WinCairo-specific declarations.  Correct constructor
+          declaration to use type float for font size.
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::hfont):
+        (WebCore::FontPlatformData::useGDI):
+        (WebCore::FontPlatformData::fontFace):
+        (WebCore::FontPlatformData::setSize):
+        (WebCore::FontPlatformData::hash):
+        (WebCore::FontPlatformData::isHashTableDeletedValue):
+        * platform/graphics/cairo/FontPlatformDataCairo.cpp:
+        (WebCore::FontPlatformData::FontPlatformData): Correct
+          constructor to accept type float for font size.
+        * platform/graphics/cg/FontPlatformData.h: Copied from WebCore/platform/graphics/win/FontPlatformData.h.
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::hfont):
+        (WebCore::FontPlatformData::cgFont):
+        (WebCore::FontPlatformData::operator==):
+        * platform/graphics/win/FontPlatformData.h: Removed.
+        * platform/graphics/win/FontPlatformDataCairoWin.cpp:
+        (WebCore::FontPlatformData::operator==): Move implementation
+          here (previously in header) to match other cairo-based ports.
+        * platform/graphics/win/RefCountedHFONT.h: Added.  This
+          was extracted from win/FontPlatformData.h, and is now shared
+          by the cg/FontPlatformData.h and cairo/FontPlatformData.h
+        (WebCore::RefCountedHFONT::create):
+        (WebCore::RefCountedHFONT::createDeleted):
+        (WebCore::RefCountedHFONT::~RefCountedHFONT):
+        (WebCore::RefCountedHFONT::hfont):
+        (WebCore::RefCountedHFONT::hash):
+        (WebCore::RefCountedHFONT::RefCountedHFONT):
+
+2010-03-18  Simon Fraser  <simon.fraser@apple.com>
+
+        No review.
+
+        Fix brace style after r56170.
+        
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+
+2010-03-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36274
+        CSS3 :nth-child selector 'odd' keyword case sensitivity test fails
+        
+        The tests for "odd", "even" etc. for nth-child selectors should be case insensitive.
+
+        Test: fast/css/nth-child-odd-case-insensitive.html
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::RareData::parseNth):
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36265
+
+        Add support for event.defaultPrevented from DOM level 3.
+    
+        Added fast/events/defaultprevented.html
+
+        * dom/Event.idl:
+
+2010-03-18  Darin Adler  <darin@apple.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Remove Geolocation.lastPosition, no longer in the spec.
+        https://bugs.webkit.org/show_bug.cgi?id=36255
+        rdar://problem/7746357
+
+        * WebCore.base.exp: Updated since Geolocation's destructor is now non-virtual.
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::lastPosition): Add an assertion; it's only legal to
+        call this if access to the location is allowed.
+
+        * page/Geolocation.h: Removed unneeded includes. Made destructor non-virtual,
+        although it will still be virtual if any of the base classes have a virtual
+        destructor. Made lastPosition, isAllowed, and isDenied functions private.
+        Removed unused suspend, resume, setShouldClearCache, shouldClearCache,
+        and frame functions.
+
+        * page/Geolocation.idl: Removed lastPosition read-only attribute. No longer in
+        the Geolocation specification.
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36275
+
+        Make sure :not does not allow pseudo-elements inside it. (Hooray for another pointless
+        restriction on :not.)
+
+        Added fast/css/invalid-not-with-pseudo-element.html
+
+        * css/CSSGrammar.y:
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::matchesPseudoElement):
+
+2010-03-18  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7761400> Rework the fix for
+        https://bugs.webkit.org/show_bug.cgi?id=18722
+
+        Test: fast/dynamic/float-remove-above-line-2.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::removeFloatingObject): Treat 0- and less-than-0-height floats
+        as having a height of 1 so that they intersect with the line they originate on.
+        (WebCore::RenderBlock::clearFloats): Use numeric_limits.
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutInlineChildren): Removed the intersection checks here,
+        so that a float is always included in the float list of the line it originates on, even
+        if it does not intersect that line. This ensures that every float is accounted for, which
+        is necessary during incremental layout when adding floats from clean lines.
+
+2010-03-18  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36102
+        [Qt] Scaling control API for tiled backing store
+        
+        Commit the new scale synchronously after unfreeze to avoid ugliness.
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::TiledBackingStore):
+        (WebCore::TiledBackingStore::setContentsScale):
+        (WebCore::TiledBackingStore::commitScaleChange):
+        (WebCore::TiledBackingStore::setContentsFrozen):
+        * platform/graphics/TiledBackingStore.h:
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36281
+
+        Make sure an exception is raised if an @import rule is inserted in the wrong place.
+        
+        Also make sure (so that this particular test case passes) that rgba(0, 0, 0, 0) is dumped
+        as transparent by getComputedStyle, since it most commonly occurs in background-color and
+        that default makes more sense than dumping rgba values.
+
+        Added fast/css/invalid-import-insertion.html
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::createColor):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::insertRule):
+
+2010-03-18  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Multiselect Popup - Listbox click simulation
+        https://bugs.webkit.org/show_bug.cgi?id=36177
+
+        Listbox popups will need to notify the corresponding select elements that a
+        selection change happened. The current HTMLSelectElement interface does not
+        allow multiple selections.
+
+        The new method  listBoxSelectItem will be used for that. I have refactored part
+        of the mouse handling code in bug 36124 and I am now reusing it here for
+        <select multiple> popups. All the other cases will handled as they were before to be
+        sure that no side effects will show up.
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::updateListBoxSelection):
+        (WebCore::SelectElement::listBoxOnChange):
+        * dom/SelectElement.h:
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::listBoxPopupClick):
+        * html/HTMLSelectElement.h:
+
+2010-03-12  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by David Levin.
+
+        smartdelete should only occur after double-click
+        https://bugs.webkit.org/show_bug.cgi?id=35314
+
+        1. Consolidate all notions of selection-granularity into SelectionController.
+        2. Now only mouse-based selections store a selection-granularity. This matches NSTextView.
+
+        New tests were added in http://trac.webkit.org/changeset/55913.
+
+        * WebCore.base.exp:
+        * editing/MoveSelectionCommand.cpp:
+        (WebCore::MoveSelectionCommand::MoveSelectionCommand):
+        (WebCore::MoveSelectionCommand::doApply):
+        * editing/MoveSelectionCommand.h:
+        (WebCore::MoveSelectionCommand::create):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::SelectionController):
+        (WebCore::SelectionController::setSelection):
+        (WebCore::SelectionController::modify):
+        (WebCore::SelectionController::clear):
+        * editing/SelectionController.h:
+        (WebCore::SelectionController::setSelection):
+        (WebCore::SelectionController::granularity):
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::VisibleSelection):
+        (WebCore::VisibleSelection::expandUsingGranularity):
+        (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
+        (WebCore::VisibleSelection::validate):
+        * editing/VisibleSelection.h:
+        (WebCore::operator==):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clear):
+        * page/DOMSelection.cpp:
+        (WebCore::DOMSelection::extend):
+        * page/DragController.cpp:
+        (WebCore::DragController::concludeEditDrag):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::selectClosestWordFromMouseEvent):
+        (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
+        (WebCore::EventHandler::handleMousePressEventTripleClick):
+        (WebCore::EventHandler::handleMousePressEventSingleClick):
+        (WebCore::EventHandler::updateSelectionForMouseDrag):
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::selectionGranularity):
+        * page/Frame.h:
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::setSelectionRange):
+
+2010-03-18  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Unreviewed, build fix.
+
+        [V8] Turn npObjectTypeInfo into a function, make everyone happy.
+
+        * bindings/v8/NPV8Object.cpp:
+        (WebCore::npObjectTypeInfo): Added new function.
+        (npCreateV8ScriptObject):
+        * bindings/v8/NPV8Object.h: Turned npObjectTypeInfo into function.
+        * bindings/v8/V8NPObject.cpp: Replaced references to function
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36283
+        
+        The wrong constants were being used for the code that attempted to compact the background-repeat shorthand to
+        a single value.
+
+        Added fast/backgrounds/background-repeat-computed-style.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::fillRepeatToCSSValue):
+
+2010-03-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36273
+        CSS3 :indeterminate and input type=radio test fails
+
+        The :indeterminate pseudo-class should apply to both radio buttons and checkboxes.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setIndeterminate): Use allowsIndeterminate() to determine if the input
+        supports the indeterminate state.
+        (WebCore::HTMLInputElement::preDispatchEventHandler): Use allowsIndeterminate() to determine whether
+        to handle the indeterminate state.
+        (WebCore::HTMLInputElement::postDispatchEventHandler): Ditto.
+        * html/HTMLInputElement.h:
+        (WebCore::HTMLInputElement::allowsIndeterminate): New utility method, returns true for radio buttons
+        and checkboxes.
+
+2010-03-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36271
+        CSS3 :enabled on an input type=hidden element fails
+        
+        The CSS3 selectors spec now makes it clear that hidden inputs should respect
+        the :enabled and :disabled pseudo-classes.
+
+        Test: fast/forms/hidden-input-enabled.html
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Remove checks for hidden inputs.
+
+2010-03-18  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Intro text at Star Wars demo is clipped.
+        <rdar://problem/7560979>
+        https://bugs.webkit.org/show_bug.cgi?id=33909
+        
+        Test: compositing/repaint/layer-repaint.html
+        
+        We are flipping the coordinates for drawing, therefore
+        we must flip them also when we invalidate the rectangles.
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:
+        (WebCore::WebLayer::setNeedsDisplay):
+
+2010-03-18  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        Missed a #include in V8Collection.h.
+
+        * bindings/v8/V8Collection.h:
+
+2010-03-18  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=36284.
+        
+        Make sure the CSS parser properly rejects negative border widths.
+
+        Added fast/borders/negative-border-width.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+
+2010-03-18  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Remove V8Index.h and all references to V8ClassIndex.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=33477
+
+        * WebCore.gypi:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/NPV8Object.cpp:
+        * bindings/v8/NPV8Object.h:
+        * bindings/v8/V8Collection.h:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bindings/v8/V8DOMWindowShell.h:
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/V8DOMWrapper.h:
+        * bindings/v8/V8GCController.cpp:
+        * bindings/v8/V8Helpers.cpp:
+        * bindings/v8/V8Index.h: Removed.
+        * bindings/v8/V8IsolatedContext.h:
+        * bindings/v8/V8NPObject.cpp:
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+        * bindings/v8/V8SVGPODTypeWrapper.h:
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        * bindings/v8/WorkerContextExecutionProxy.h:
+        * bindings/v8/WrapperTypeInfo.h: Move WrapperTypeInfo struct into its own file from V8Index.h.
+        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8EventSourceConstructor.cpp:
+        * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLAudioElementConstructor.h:
+        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLImageElementConstructor.h:
+        * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLOptionElementConstructor.h:
+        * bindings/v8/custom/V8HistoryCustom.cpp:
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        * bindings/v8/custom/V8WebGLArrayCustom.h:
+        * bindings/v8/custom/V8WebGLByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLFloatArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        * bindings/v8/custom/V8WebGLShortArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp:
+        * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+
+2010-03-18  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Preserve console history between debugging sessions.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36223
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._settingsLoaded):
+        (WebInspector.ConsoleView.prototype._enterKeyPressed.printResult):
+        (WebInspector.ConsoleView.prototype._enterKeyPressed):
+        * inspector/front-end/Settings.js:
+        (WebInspector.Settings.prototype._load):
+
+2010-03-18  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] GraphicsLayer: Pausing and resuming of animations don't work as expected
+        https://bugs.webkit.org/show_bug.cgi?id=36219
+        
+        addAnimation and pauseAnimation were handling animation state changes in
+        the wrong way.
+        Apparently WebCore calls addAnimation for resuming, so we have to make 
+        sure to resume an existing animation if that happens. Also, timeOffset 
+        is now used for synchronization of the Qt animation clock with the 
+        WebCore clock, as opposed to using it as a delay timer. 
+        Both those fixes were necessary to get the layout test to work.
+        
+        LayoutTests/animations/play-state.html now passed on Qt.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::AnimationQtBase::AnimationQtBase):
+        (WebCore::TransformAnimationQt::updateState):
+        (WebCore::GraphicsLayerQt::addAnimation):
+        (WebCore::GraphicsLayerQt::pauseAnimation):
+
+2010-03-18  Adam Langley  <agl@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] Fix inverted logic in per-strike renderer patch.
+
+        I screwed up in r55089 and got one of the conditions backwards. Thanks
+        to Roman Tsisyk for pointing it out.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35495
+
+        Test: platform/chromium/fast/text/chromium-linux-fontconfig-renderstyle.html
+
+        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+        (WebCore::FontPlatformData::querySystemForRenderStyle):
+
+2010-03-18  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Show inherited styles for a selected DOM element
+
+        https://bugs.webkit.org/show_bug.cgi?id=28039
+
+        * English.lproj/localizedStrings.js:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.CSSStyleDeclaration):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype._update):
+        (WebInspector.StylesSidebarPane.prototype._containsInherited):
+        (WebInspector.StylePropertiesSection):
+        (WebInspector.StylePropertiesSection.prototype.isPropertyInherited):
+        (WebInspector.StylePropertiesSection.prototype.onpopulate):
+
+2010-03-15  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Gustavo Noronha.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Spatial Navigation: Add isNull() and document() convenience methods to FocusCandidate.
+        https://bugs.webkit.org/show_bug.cgi?id=36167
+
+        It turns out that Spatial Navigation related code (in FocusController.cpp for
+        instance) can be simplified and look better if FocusCandidate class offer some
+        convenience method. This patch introduces a couple of them (isNull and a Document
+        getter). It also adds another constructor that receives a Node as parameter.
+
+        A followup refactoring patch will be making use of these helper methods.
+
+        * page/SpatialNavigation.h:
+        (WebCore::FocusCandidate::FocusCandidate): Added a "Node*" parameter
+        to FocusCandidate's constructor.
+        (WebCore::FocusCandidate::isNull): In the Spatial Navigation logic, a NULL
+        FocusCandidate object is one that does not hold a valid reference to a "Node*".
+        (WebCore::FocusCandidate::document): This method returns a pointer for the FocusCandidate
+        node's document, if |node| is a valid pointer.
+
+2010-03-18  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Antti Koivisto.
+
+        [Qt] [Performance] GraphicsLayerQt updates the scene too often
+        https://bugs.webkit.org/show_bug.cgi?id=36158
+
+        This fix makes sure that flushChanges is only called when necessary,
+        by calling the notifySync function asynchronously, which makes sure flushChanges() is called
+        after the WebCore compositor has made all its changes.
+
+        This has shown a visual improvement on several test-cases.
+
+        * Makefile:
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::):
+        (WebCore::GraphicsLayerQtImpl::notifySyncRequired):
+        (WebCore::GraphicsLayerQtImpl::notifyChange):
+        (WebCore::GraphicsLayerQtImpl::flushChanges):
+        (WebCore::GraphicsLayerQt::setMaskLayer):
+        (WebCore::GraphicsLayerQt::setPosition):
+        (WebCore::GraphicsLayerQt::setAnchorPoint):
+        (WebCore::GraphicsLayerQt::setSize):
+        (WebCore::GraphicsLayerQt::setTransform):
+        (WebCore::GraphicsLayerQt::setChildrenTransform):
+        (WebCore::GraphicsLayerQt::setPreserves3D):
+        (WebCore::GraphicsLayerQt::setMasksToBounds):
+        (WebCore::GraphicsLayerQt::setDrawsContent):
+        (WebCore::GraphicsLayerQt::setBackgroundColor):
+        (WebCore::GraphicsLayerQt::clearBackgroundColor):
+        (WebCore::GraphicsLayerQt::setContentsOpaque):
+        (WebCore::GraphicsLayerQt::setBackfaceVisibility):
+        (WebCore::GraphicsLayerQt::setOpacity):
+        (WebCore::GraphicsLayerQt::setContentsRect):
+
+2010-03-18  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Oliver Hunt.
+
+        Parsing of rgb() colors in HTML canvas is still fairly slow.
+        findNamedColor() was showing up as hot, so this patch attempts to
+        avoid calling it by putting the rgb() check ahead of the named
+        colors.  It also removes a call to Color::Color() from
+        CanvasStyle, which was doing a redundant check for the hex
+        color and named colors, which CSSParser already does.  Finally, it
+        changes the ad-hoc parser to check for negative values, and clamps them
+        at zero.  This avoids the lex/yacc path for rgb() colors with
+        negative color components.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36199
+
+        Covered by fast/canvas/set-colors.html.
+
+        * css/CSSParser.cpp:
+        (WebCore::parseInt):
+        (WebCore::CSSParser::parseColor):
+        * html/canvas/CanvasStyle.cpp:
+        (WebCore::CanvasStyle::applyFillColor):
+
+2010-03-18  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36246> Node::removeAllEventListenersSlowCase is declared but not used
+
+        Reviewed by Sam Weinig.
+
+        * dom/Node.h:
+        (WebCore::Node::removeAllEventListenersSlowCase): Removed
+        declaration.  Implementation was removed in r48701.
+
+2010-03-17  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Oliver Hunt.
+
+        [Haiku] Implement ImageBuffer support
+        https://bugs.webkit.org/show_bug.cgi?id=35288
+
+        Covered by existing tests.
+
+        The StillImage class implements WebCore::Image by wrapping a native
+        BBitmap. It will be needed to implement WebCore::ImageBuffer. This
+        solution is just like it's done in the Qt port.
+
+        * platform/graphics/haiku/StillImageHaiku.cpp: Added.
+        (WebCore::StillImage::StillImage):
+        (WebCore::StillImage::destroyDecodedData):
+        (WebCore::StillImage::decodedSize):
+        (WebCore::StillImage::size):
+        (WebCore::StillImage::nativeImageForCurrentFrame):
+        (WebCore::StillImage::draw):
+        * platform/graphics/haiku/StillImageHaiku.h: Added.
+        (WebCore::StillImage::create):
+
+2010-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Rubber stamped by Gustavo Noronha Silva.
+
+        [Gtk+] Avoid making a copy of the HTTPHeaderMap.
+
+        ResourceRequest::httpHeaderFields() is returning a const
+        reference but we are storing it as a simple value. This
+        means that we run either the copy constructor or the assignment
+        operator and make a copy of the RefPtrs.
+
+        This extra copy can be avoided easily by storing
+        the result as a const reference.
+
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::toSoupMessage):
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponseSoup::toSoupMessage):
+
+2010-03-17  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: When switching resources in the Resources panel, the Content tab is always selected
+        https://bugs.webkit.org/show_bug.cgi?id=36222
+
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.showResource):
+
+2010-03-17  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        databaseIdentifiers are not filtered for slashes
+        <rdar://problem/7708789> and https://bugs.webkit.org/show_bug.cgi?id=36243
+
+        In addition to filtering for '/' and '\', to remove the directory vulnerability
+        on all platforms, it seems worth it to also escape other characters that are
+        obviously dangerous or illegal to have in a filename (mostly inspired by the 
+        Windows illegal-character list).
+
+        No new tests - It's unclear how a test could possibly work into our testing
+        infrastructure.
+
+        * page/SecurityOrigin.cpp:
+        (WebCore::): Added a 128-bool table "needsEscaping" that has a true/false answer
+          for lower-ASCII.
+        (WebCore::SecurityOrigin::SecurityOrigin):
+        (WebCore::SecurityOrigin::createFromDatabaseIdentifier): "Unescape" the host
+          component using the KURL utility.
+        (WebCore::shouldEscapeUChar): If the char is lower-ASCII, look it up in the 
+          needsEscaping table. Otherwise, let it pass.
+        (WebCore::encodedHost): Modeled after KURL's host escaping method, but targeted 
+          for the escaping considerations for the host component. We don't use the KURL
+          version because this one is "different" enough because it operates on UTF16 and
+          has its own "is bad character?" decider.
+        (WebCore::SecurityOrigin::databaseIdentifier): Create the escaped host if needed,
+          and use it instead of the unescaped host.
+        * page/SecurityOrigin.h:
+
+2010-03-17  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [v8] Avoid reentry into v8 after TerminateExecution() on a worker thread.
+        https://bugs.webkit.org/show_bug.cgi?id=36239
+
+        Test: fast/workers/termination-with-port-messages.html
+
+        * bindings/v8/V8Proxy.h:
+        (WebCore::throwError): Avoid throwing if v8 execution is terminated anyways.
+        * bindings/v8/WorkerScriptController.h:
+        (WebCore::WorkerScriptController::proxy): Return V8 proxy as 0 if execution is terminating. Callers to check for 0 before invoking v8.
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        (WebCore::SetTimeoutOrInterval): Bail out if v8 proxy is 0.
+        (WebCore::toV8): Ditto
+
+2010-03-17  José Millán Soto  <jmillan@igalia.com>
+
+        Reviewed by Adam Barth.
+
+        Change the way of prefetching DNS to allow prefetching function to use full URL
+        https://bugs.webkit.org/show_bug.cgi?id=35589
+
+        Creates a new function, ResourceHandle::prepareForURL, whose default implementation
+        calls prefetchDNS with the host of the given URL as the parameter.
+        Soup implementation of ResourceHandle::prepareForURL executes soup_session_prepare_for_uri.
+        Soup implementation of prefetchDNS is removed.
+        Changed various prefetchDNS calls to ResourceHandle::prepareForURL calls.
+
+        * GNUmakefile.am:
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::parseMappedAttribute):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::mouseDidMoveOverElement):
+        * platform/network/DNS.h:
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::prepareForURL):
+        * platform/network/ResourceHandle.h:
+        * platform/network/chromium/DNSChromium.cpp:
+        (WebCore::ResourceHandle::prepareForURL):
+        * platform/network/soup/DNSSoup.cpp: Removed.
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::prepareForURL):
+        * wml/WMLAElement.cpp:
+        (WebCore::WMLAElement::parseMappedAttribute):
+
+2010-03-17  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Revert WebGL context attributes changes 33416 / r56074 and 36200 / r56093
+        https://bugs.webkit.org/show_bug.cgi?id=36233
+
+        The patch for bug 33416, which added multisampling support to the
+        WebGL back buffer, uncovered some OpenGL driver bugs on the build
+        bots which need further investigation to determine the appropriate
+        workaround. Reverting this change, the minor build fix in 36189,
+        and the skipping of the affected tests in bug 36200.
+
+        Built and tested WebKit and Chromium and ran all WebGL layout
+        tests in both.
+
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+        (WebCore::V8HTMLCanvasElement::getContextCallback):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/mac/Canvas3DLayer.h:
+        * platform/graphics/mac/Canvas3DLayer.mm:
+        (-[Canvas3DLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
+        * platform/graphics/mac/GraphicsContext3DMac.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::reshape):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::readPixels):
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::GraphicsLayerCA::setContentsToGraphicsContext3D):
+
+2010-03-17  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Optimize painting for HTMLProgressElement
+        https://bugs.webkit.org/show_bug.cgi?id=36113
+        Cache the progress bar's position, so it is not required to recalculate
+        it for each repaint. 
+        Call repaintRectangle() when the position changes.
+
+        No new tests, as no new functionality introduced.
+
+        * html/HTMLProgressElement.cpp:
+        (WebCore::HTMLProgressElement::parseMappedAttribute):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::getNumberOfPixelsForProgressPosition):
+        (WebCore::RenderThemeQt::paintProgressBar):
+        * platform/qt/RenderThemeQt.h:
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::RenderProgress):
+        (WebCore::RenderProgress::updateFromElement):
+        * rendering/RenderProgress.h:
+        (WebCore::RenderProgress::position):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::getNumberOfPixelsForProgressPosition):
+        * rendering/RenderTheme.h:
+
+2010-03-17  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Mac Buildfix: Using ASSERT_UNUSED instead of ASSERT.
+
+        Reviewed by Simon fraser.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::listBoxDefaultEventHandler):
+
+2010-03-17  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Missing support for showing compositing layers borders and repaint count on Windows.
+        <rdar://problem/7760736>
+        <https://bugs.webkit.org/show_bug.cgi?id=36197>
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:
+        (WebCore::WebLayer::drawInContext): Modified to use the correct font on Windows.
+
+2010-03-16  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Antti Koivisto.
+
+        [Qt] Multiselect Popup - SelectElement refactoring.
+        https://bugs.webkit.org/show_bug.cgi?id=36124
+
+        As it is today it is not possible to the menulists popups to tell SelectElement
+        that more then one option is selected. If you select one the other ones
+        selected state will turn off.
+
+        For <select multiple> I needed to extend the API used by menulist popups. This
+        is the first step. Just refactoring SelectElement without any behavior change.
+        Separating code that will be reused in future patches.
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::updateSelectedState):
+        (WebCore::SelectElement::listBoxDefaultEventHandler):
+        * dom/SelectElement.h:
+
+2010-03-17  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        Delete the correct file this time.
+
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: Copied from WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp.
+        * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Removed.
+
+2010-03-17  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Remove custom bindings callbacks that aren't in use.
+        (The relevant .idl doesn't mark them as V8Custom or Custom).
+        
+        https://bugs.webkit.org/show_bug.cgi?id=33066
+
+        * Android.v8bindings.mk:
+        * WebCore.gypi:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8WebGLArrayCustom.h:
+        * bindings/v8/custom/V8WebGLByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLFloatArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLShortArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Removed.
+
+2010-03-17  Steve Block  <steveblock@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Adds ENABLE(WORKERS) guards to V8 bindings
+        https://bugs.webkit.org/show_bug.cgi?id=36221
+
+        Build fix only, no new tests.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::instantiateV8Object):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::toV8Context):
+
+2010-03-17  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Remove unused reference to InspectorController from InspectorFrontend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36218
+
+        * inspector/InspectorFrontend.h:
+
+2010-03-17 Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        WebInspector: Timeline improvements - next iteration.
+
+        The top level records should be collapsed.
+        Virtually linked events should be nested in Timeline like Send Request and
+        corresponding Received Responce, Timer Install and Timer Fire etc.
+        It should be possible to see Main Resource request.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36122
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::resetScriptObjects):
+        (WebCore::InspectorController::didReceiveResponse):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
+        (WebCore::InspectorTimelineAgent::didReceiveResourceResponse):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype.addRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._findParentRecord):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype.resize):
+        (WebInspector.TimelinePanel.prototype._createTopLevelRecord):
+        (WebInspector.TimelinePanel.prototype.reset):
+        (WebInspector.TimelinePanel.prototype._clean):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
+        (WebInspector.TimelineCalculator.prototype.computeBarGraphPercentages):
+        (WebInspector.TimelineCalculator.prototype.updateBoundaries):
+        (WebInspector.TimelineRecordGraphRow):
+        (WebInspector.TimelineRecordGraphRow.prototype.update):
+        (WebInspector.TimelinePanel.FormattedRecord):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype.get children):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+        * inspector/front-end/inspector.css:
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didReceiveResponse):
+
+2010-03-17  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Reimplement style-related audits using native API
+        https://bugs.webkit.org/show_bug.cgi?id=36172
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::getAllStyles):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getAllStyles):
+        (WebCore::InspectorDOMAgent::getMatchedCSSRules):
+        (WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
+        (WebCore::InspectorDOMAgent::buildObjectForRule):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didGetAllStyles):
+        * inspector/InspectorFrontend.h:
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.evaluateInTargetWindow):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.routine):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.routine):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun):
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+        (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
+        * inspector/front-end/DOMAgent.js:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+
+2010-03-17  Steve Block  <steveblock@google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Replace instances of bzero in WebCore/bridge common code with memset
+        https://bugs.webkit.org/show_bug.cgi?id=36214
+
+        Syntax change only, no new tests.
+
+        * bridge/jni/JNIUtility.cpp:
+        (JSC::Bindings::getJNIField):
+        * bridge/jni/jsc/JNIBridgeJSC.cpp:
+        (JavaField::dispatchValueFromInstance):
+        * bridge/jni/jsc/JNIUtilityPrivate.cpp:
+        (JSC::Bindings::convertValueToJValue):
+        * bridge/jni/v8/JNIUtilityPrivate.cpp:
+        (JSC::Bindings::convertNPVariantToJValue):
+        * bridge/jni/v8/JavaNPObjectV8.cpp:
+        (JSC::Bindings::AllocJavaNPObject):
+
+2010-03-17  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Mark inspector resources as changed so that they are reloaded on the next frontend connection.
+        
+        Split resetScriptObjects into code specific for page navigation and insepctor frontend disconnection.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36183
+
+        * WebCore.xcodeproj/project.pbxproj: Added InspectorWorkerResource.h to the project file.
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::unbindAllResources):
+        (WebCore::InspectorController::didCommitLoad):
+        * inspector/InspectorController.h:
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::releaseScriptObject):
+
+2010-03-17  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Capture main resource load events in timeline panel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36188
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
+        (WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
+        (WebInspector.TimelinePanel.prototype.timelineWasStopped):
+        (WebInspector.TimelinePanel.prototype.addRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._clearPanel):
+        (WebInspector.TimelinePanel.FormattedRecord):
+
+2010-03-17  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Allow custom memory allocation control for AtomicString class
+        https://bugs.webkit.org/show_bug.cgi?id=35907
+
+        Inherits the following class from FastAllocBase because it is
+        instantiated by 'new':
+
+        class name   - instantiated at: WebCore/'location'
+        AtomicString - WebCore/html/HTMLTableElement.cpp:525
+
+        * platform/text/AtomicString.h:
+
+2010-03-16  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Give keyboard focus to PluginDocuments by default
+        https://bugs.webkit.org/show_bug.cgi?id=36147
+
+        Test: http/tests/plugins/plugin-document-has-focus.html
+
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginDocument::pluginNode):
+        * loader/PluginDocument.h:
+        * page/EventHandler.cpp:
+        (WebCore::eventTargetNodeForDocument):
+
+2010-03-16  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION (r53857): Crash when tabbing to <map>
+        https://bugs.webkit.org/show_bug.cgi?id=36017
+
+        Test: fast/events/imagemap-norender-crash.html
+
+        * html/HTMLMapElement.cpp:
+        (WebCore::HTMLMapElement::imageElement):
+
+2010-03-16  Brent Fulgham  <bfulgham@webkit.org>
+
+        Build fix.  No Review.
+
+        Correct missing includes in cURL network backend introduced
+        by recent changes in WebKit.
+
+        * platform/network/curl/ResourceHandleCurl.cpp: Add missing
+          includes for SharedBuffer and PassRefPtr.
+        (WebCore::ResourceHandle::loadResourceSynchronously): Correct
+          constructor signature for ResourceHandle to match @r55688.
+        * platform/network/curl/ResourceHandleManager.cpp: Add missing
+          include for RetainPtr.
+
+2010-03-16  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Hook up WebGLContextAttributes to OpenGL context creation code
+        https://bugs.webkit.org/show_bug.cgi?id=33416
+
+        Test: fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
+
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: Fix an index bug.
+        * platform/graphics/GraphicsContext3D.h: Add members/functions for multisampling/stencil buffer purpose.
+        * platform/graphics/mac/Canvas3DLayer.h: Add GraphicsContext3D as a member of Canvas3DLayer.
+        * platform/graphics/mac/Canvas3DLayer.mm: Add multisampling support.
+        * platform/graphics/mac/GraphicsContext3DMac.cpp: Hook up WebGLContextAttributes to OpenGL context creation code for Mac.
+        * platform/graphics/mac/GraphicsLayerCA.mm: Adjust to modified Canvas3DLayer init call.
+
+2010-03-16  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35504
+        [Gtk] Evaluate and fix AtkTable for layout tables
+
+        Causes "layout tables" to be exposed as AccessibilityTables for Gtk.
+
+        * accessibility/AccessibilityTable.cpp:
+        (AccessibilityTable::isTableExposableThroughAccessibility):
+
+2010-03-16  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Unreviewed. Build fix for distcheck.
+
+        * GNUmakefile.am:
+
+2010-03-15  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36152
+        [chromium] Add support for history.pushState and history.replaceState
+
+        This is covered by the existing tests in fast/loader/stateobjects
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::ZigZag::Deserializer::deserialize):
+        (WebCore::SerializedScriptValue::deserialize):
+        * bindings/v8/SerializedScriptValue.h:
+        Switch to returning v8::Null instead of the empty value to match JSC
+        and the spec.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadInSameDocument): Call
+        dispatchDidNavigateWithinPage just before dispatching events to the
+        page.  This ordering is important since the event handlers could
+        destroy the page or start another navigation.
+
+        * loader/FrameLoaderClient.h: Add dispatchDidNavigateWithinPage to
+        notify the client whenever a navigation occurs without changing any of
+        the documents in the page.
+
+2010-03-16  Adam Roben  <aroben@apple.com>
+
+        Fix linker warnings when building WebCore on Windows
+
+        Rubber-stamped by Steve Falkenburg.
+
+        * WebCore.vcproj/WebCore.vcproj: Exclude JSDOMFormData.cpp from the
+        build, since it's already included in DerivedSources.cpp. Also let VS
+        sort this file as it saw fit.
+
+2010-03-15  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36121
+        [Qt] Make WebKit scrollbars work with tiling
+         
+        Translate coordinates correctly.
+
+        * page/Frame.cpp:
+        (WebCore::Frame::tiledBackingStorePaintEnd):
+
+2010-03-16  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [Qt] MediaPlayerPrivate: Initialize m_mediaPlayerControl to 0 to avoid crashes
+        when no media services can be found.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36142
+
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+
+2010-03-16  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        noscript tag should render when @sandbox disables JavaScript
+        https://bugs.webkit.org/show_bug.cgi?id=36092
+
+        Add missing "!" in plugin code.  Should fix plugins/embed-inside-object
+        on Gtk and Qt.
+
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::load):
+
+2010-03-16  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Delete DerivedSourcesAllInOne.cpp.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33048
+
+        * Android.v8bindings.mk:
+        * bindings/v8/DerivedSourcesAllInOne.cpp: Removed.
+
+2010-03-16  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Revert r56006 as it caused functional issues. We will work on a
+        testcase, and rework the fix, and land when we have this a bit
+        more testable.
+
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::paintMediaPlayButton):
+
+2010-03-16  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Errors when inspecting styles of non-renderable elements in XHTML.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35025
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getStyles):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMNode.prototype._addAttribute):
+        (WebInspector.DOMWindow.prototype.Object):
+        * inspector/front-end/MetricsSidebarPane.js:
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype.update.callback):
+        (WebInspector.StylesSidebarPane.prototype.update):
+        (WebInspector.StylesSidebarPane.prototype._update):
+
+2010-03-12  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Spatial Navigation: Add a scrollIntoView call when focusing an element.
+        https://bugs.webkit.org/show_bug.cgi?id=36020
+
+        When focusing an element in Spatial Navigation logic, it is desired to make
+        this element visible in the current viewport. For that to happen, there
+        could be a call to Element's scrollIntoView method at focusing time. However
+        for visual aspects, it is preferable to scroll to an inflated rect of |element|
+        in order to consider the focus outline width.
+        As Element's scrollIntoView method does not provide this flexibility, patch adds
+        a custom scrollIntoView method to SpatialNavigation.h .
+
+        * page/FocusController.cpp:
+        (WebCore::FocusController::advanceFocusDirectionally):
+        * page/SpatialNavigation.cpp:
+        (WebCore::scrollIntoView):
+        * page/SpatialNavigation.h:
+
+2010-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Seidel.
+
+        [GTK] Position queries are lagging
+        https://bugs.webkit.org/show_bug.cgi?id=34372
+
+        Normalize timeout priorities through the GStreamer media player as
+        a whole. This should help avoid that any of them is starved.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::volumeChanged):
+        (WebCore::MediaPlayerPrivate::processBufferingStats):
+        (WebCore::MediaPlayerPrivate::muteChanged):
+        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
+        (webkit_video_sink_render):
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcNeedDataCb):
+        (webKitWebSrcEnoughDataCb):
+        (webKitWebSrcSeekDataCb):
+
+2010-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Seidel.
+
+        [GTK] Position queries are lagging
+        https://bugs.webkit.org/show_bug.cgi?id=34372
+
+        Use default priority also for parsing data: URIs.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::startData):
+
+2010-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Seidel.
+
+        [GTK] Position queries are lagging
+        https://bugs.webkit.org/show_bug.cgi?id=34372
+
+        Normalize SharedTimers priorities to always be
+        G_PRIORITY_DEFAULT. As it is currently, timers that should happen
+        immediately (0 miliseconds delay) end up delayed by a lot of time
+        due to glib starving lower priority sources.
+
+        * platform/gtk/SharedTimerGtk.cpp:
+        (WebCore::setSharedTimerFireTime):
+
+2010-03-16  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Add support for Fast Mobile Scrolling in the build system.
+
+        * GNUmakefile.am:
+
+2010-03-11  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * GNUmakefile.am:
+        * WebCore.Inspector.exp:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.order:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/ConsoleMessage.cpp:
+        (WebCore::ConsoleMessage::addToFrontend):
+        * inspector/ConsoleMessage.h:
+        * inspector/InspectorClient.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::~InspectorController):
+        (WebCore::InspectorController::inspectedPageDestroyed):
+        (WebCore::InspectorController::windowVisible):
+        (WebCore::InspectorController::frontendReady):
+        (WebCore::InspectorController::willCloseFrontend):
+        (WebCore::InspectorController::addConsoleMessage):
+        (WebCore::InspectorController::setInspectorFrontendClient):
+        (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
+        (WebCore::InspectorController::setFrontend):
+        (WebCore::InspectorController::show):
+        (WebCore::InspectorController::close):
+        (WebCore::InspectorController::releaseDOMAgent):
+        (WebCore::InspectorController::populateScriptObjects):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::getProfile):
+        (WebCore::InspectorController::enableDebugger):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::hasInspectorFrontendClient):
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::InspectorFrontend):
+        (WebCore::InspectorFrontend::~InspectorFrontend):
+        (WebCore::InspectorFrontend::addConsoleMessage):
+        (WebCore::InspectorFrontend::bringToFront):
+        (WebCore::InspectorFrontend::inspectedURLChanged):
+        * inspector/InspectorFrontend.h:
+        * inspector/InspectorFrontendClient.h: Added.
+        (WebCore::InspectorFrontendClient::~InspectorFrontendClient):
+        * inspector/InspectorFrontendClientLocal.cpp: Added.
+        (WebCore::FrontendMenuProvider::create):
+        (WebCore::FrontendMenuProvider::disconnect):
+        (WebCore::FrontendMenuProvider::FrontendMenuProvider):
+        (WebCore::FrontendMenuProvider::~FrontendMenuProvider):
+        (WebCore::FrontendMenuProvider::populateContextMenu):
+        (WebCore::FrontendMenuProvider::contextMenuItemSelected):
+        (WebCore::FrontendMenuProvider::contextMenuCleared):
+        (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
+        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+        (WebCore::InspectorFrontendClientLocal::frontendLoaded):
+        (WebCore::InspectorFrontendClientLocal::canAttachWindow):
+        (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
+        (WebCore::InspectorFrontendClientLocal::moveWindowBy):
+        (WebCore::InspectorFrontendClientLocal::showContextMenu):
+        (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
+        (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
+        (WebCore::InspectorFrontendClientLocal::constrainedAttachedWindowHeight):
+        * inspector/InspectorFrontendClientLocal.h: Added.
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::InspectorFrontendHost):
+        (WebCore::InspectorFrontendHost::~InspectorFrontendHost):
+        (WebCore::InspectorFrontendHost::loaded):
+        (WebCore::InspectorFrontendHost::attach):
+        (WebCore::InspectorFrontendHost::detach):
+        (WebCore::InspectorFrontendHost::closeWindow):
+        (WebCore::InspectorFrontendHost::bringToFront):
+        (WebCore::InspectorFrontendHost::inspectedURLChanged):
+        (WebCore::InspectorFrontendHost::canAttachWindow):
+        (WebCore::InspectorFrontendHost::setAttachedWindowHeight):
+        (WebCore::InspectorFrontendHost::moveWindowBy):
+        (WebCore::InspectorFrontendHost::showContextMenu):
+        * inspector/InspectorFrontendHost.h:
+        (WebCore::InspectorFrontendHost::create):
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        (.WebInspector.InspectorFrontendHostStub.prototype.bringToFront):
+        (.WebInspector.InspectorFrontendHostStub.prototype.inspectedURLChanged):
+        * inspector/front-end/inspector.js:
+        (WebInspector.loaded):
+        (WebInspector.close):
+        (WebInspector.bringToFront):
+        (WebInspector.inspectedURLChanged):
+        * loader/EmptyClients.h:
+        (WebCore::EmptyInspectorClient::openInspectorFrontend):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::~Page):
+        * page/Page.h:
+        * platform/ContextMenu.cpp:
+        (WebCore::ContextMenu::populate):
+        (WebCore::ContextMenu::addInspectElementItem):
+
+2010-03-16  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: migrate to native styles inspector in
+        order to inspect styles from foreighn domains.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36117
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::getStyles):
+        (WebCore::InspectorBackend::getInlineStyle):
+        (WebCore::InspectorBackend::getComputedStyle):
+        (WebCore::InspectorBackend::applyStyleText):
+        (WebCore::InspectorBackend::setStyleText):
+        (WebCore::InspectorBackend::setStyleProperty):
+        (WebCore::InspectorBackend::toggleStyleEnabled):
+        (WebCore::InspectorBackend::setRuleSelector):
+        (WebCore::InspectorBackend::addRule):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
+        (WebCore::InspectorDOMAgent::getStyles):
+        (WebCore::InspectorDOMAgent::getInlineStyle):
+        (WebCore::InspectorDOMAgent::getComputedStyle):
+        (WebCore::InspectorDOMAgent::getMatchedCSSRules):
+        (WebCore::InspectorDOMAgent::getAttributeStyles):
+        (WebCore::InspectorDOMAgent::applyStyleText):
+        (WebCore::InspectorDOMAgent::setStyleText):
+        (WebCore::InspectorDOMAgent::setStyleProperty):
+        (WebCore::InspectorDOMAgent::toggleStyleEnabled):
+        (WebCore::InspectorDOMAgent::setRuleSelector):
+        (WebCore::InspectorDOMAgent::addRule):
+        (WebCore::InspectorDOMAgent::bindStyle):
+        (WebCore::InspectorDOMAgent::bindRule):
+        (WebCore::InspectorDOMAgent::buildObjectForStyle):
+        (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+        (WebCore::InspectorDOMAgent::buildObjectForRule):
+        (WebCore::InspectorDOMAgent::uniqueStyleProperties):
+        (WebCore::InspectorDOMAgent::longhandProperties):
+        (WebCore::InspectorDOMAgent::shorthandPriority):
+        (WebCore::InspectorDOMAgent::ruleAffectsNode):
+        (WebCore::InspectorDOMAgent::toArray):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didGetEventListenersForNode):
+        (WebCore::InspectorFrontend::didGetStyles):
+        (WebCore::InspectorFrontend::didGetComputedStyle):
+        (WebCore::InspectorFrontend::didGetInlineStyle):
+        (WebCore::InspectorFrontend::didApplyStyleText):
+        (WebCore::InspectorFrontend::didSetStyleText):
+        (WebCore::InspectorFrontend::didSetStyleProperty):
+        (WebCore::InspectorFrontend::didToggleStyleEnabled):
+        (WebCore::InspectorFrontend::didSetRuleSelector):
+        (WebCore::InspectorFrontend::didAddRule):
+        * inspector/InspectorFrontend.h:
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.CSSStyleDeclaration):
+        * inspector/front-end/ElementsTreeOutline.js:
+        * inspector/front-end/InjectedScript.js:
+        * inspector/front-end/MetricsSidebarPane.js:
+        (WebInspector.MetricsSidebarPane.prototype.update):
+        (WebInspector.MetricsSidebarPane.prototype.editingCommitted):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype.update):
+        (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.callback):
+        (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted):
+        (WebInspector.BlankStylePropertiesSection.prototype.editingSelectorCommitted.callback):
+        (WebInspector.BlankStylePropertiesSection.prototype.editingSelectorCommitted):
+        (WebInspector.StylePropertyTreeElement.prototype):
+        (WebInspector.StylePropertyTreeElement.prototype.):
+
+2010-03-16  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        RenderText::m_text should be a String, not RefPtr<StringImpl>
+        https://bugs.webkit.org/show_bug.cgi?id=36010
+
+        Refactoring only, so no new tests.
+
+        * platform/text/PlatformString.h:
+        (WebCore::String::makeLower):
+        (WebCore::String::makeUpper):
+        (WebCore::String::makeSecure):
+        (WebCore::String::makeCapitalized):
+        (WebCore::String::containsOnlyASCII):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::RenderText):
+        (WebCore::RenderText::widthFromCache):
+        (WebCore::RenderText::trimmedPrefWidths):
+        (WebCore::RenderText::containsOnlyWhitespace):
+        (WebCore::RenderText::setTextInternal):
+        (WebCore::RenderText::setText):
+        (WebCore::RenderText::previousOffset):
+        (WebCore::RenderText::previousOffsetForBackwardDeletion):
+        (WebCore::RenderText::nextOffset):
+        * rendering/RenderText.h:
+        (WebCore::RenderText::text):
+        (WebCore::RenderText::characters):
+        (WebCore::RenderText::textLength):
+
+2010-03-16  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        noscript tag should render when @sandbox disables JavaScript
+        https://bugs.webkit.org/show_bug.cgi?id=36092
+
+        Instead of talking to Settings directly to figure out if JavaScript is
+        enabled in a frame, we need to talk to the ScriptController.  The
+        ScriptController is better at answering that question because it knows
+        about @sandbox.
+
+        Test: fast/frames/sandboxed-iframe-noscript.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::createRenderer):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::rendererIsNeeded):
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::noscriptCreateErrorCheck):
+        (WebCore::HTMLParser::isInline):
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::load):
+
+2010-03-15  John Gregg  <johnnyg@google.com>
+
+        Reviewed by David Levin.
+
+        Notification object should expose absolute URL of icon
+        https://bugs.webkit.org/show_bug.cgi?id=35800
+
+        Covered by existing tests.
+
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+        * notifications/Notification.h:
+        (WebCore::Notification::iconURL):
+
+2010-03-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Holger Freyther.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35887
+
+        * platform/efl/ClipboardEfl.cpp: Added.
+        * platform/efl/PasteboardEfl.cpp: Added.
+
+2010-03-15  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Don't submit disabled menu options.
+        https://bugs.webkit.org/show_bug.cgi?id=35056
+
+        Test: fast/forms/menulist-disabled-selected-option.html
+
+        * dom/OptionElement.h:
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElement::appendFormData):
+         If a selected option is disabled, skip it.
+         Remove code for non-selected menulist because of compatibility with
+         other browsers.
+
+2010-03-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Holger Freyther.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35884
+
+        * platform/efl/FileSystemEfl.cpp: Added.
+
+2010-03-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Holger Freyther.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35882
+
+        * platform/efl/ContextMenuItemEfl.cpp: Added.
+
+2010-03-15  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35502
+        [Gtk] Objects of ATK_ROLE_TABLE should not implement AtkText
+
+        Simple change to stop tables from implementing AtkText.
+
+        * accessibility/gtk/AccessibilityObjectAtk.cpp:
+        (getInterfaceMaskFromObject):
+
+2010-03-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
+
+        Reviewed by Adam Barth.
+
+        According to the updated specification, a data field should always
+        result in a newline character being appended to the data buffer
+        regardless if the data buffer contains any data or not. However, upon
+        event dispatch, the last newline will be removed. This differs from an
+        older version of the specification where a newline character was
+        appended before the data value only if the buffer already contained
+        data. As a result, EventSource now supports receiving events with empty
+        data or newline characters only.
+        https://bugs.webkit.org/show_bug.cgi?id=33210
+
+        * page/EventSource.cpp:
+        (WebCore::EventSource::parseEventStreamLine):
+
+2010-03-15  Valters Svabe  <vsvabe@gmail.com>
+
+        Reviewed by Darin Adler.
+
+        :after selector displays in wrong place with nested div
+        https://bugs.webkit.org/show_bug.cgi?id=32288
+        
+        Make sure we don't append things after :after-generated content, if
+        it's inside an anonymous block.
+
+        Test: fast/css-generated-content/block-after.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addChild):
+
+2010-03-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Eric Seidel.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35885
+
+        * platform/efl/KURLEfl.cpp: Added.
+
+2010-03-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        VO not able to perform a VO-spacebar on facebook links
+        https://bugs.webkit.org/show_bug.cgi?id=36132
+
+        When a label element is used as a click event handler, and it doesn't have any
+        corresponding control, it should handle the action itself.
+
+        Test: accessibility/label-element-press.html
+
+        * html/HTMLLabelElement.cpp:
+        (WebCore::HTMLLabelElement::accessKeyAction):
+
+2010-03-15  Cameron Zwarich  <zwarich@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36135 - GCController::garbageCollectNow() crashes when called from garbage collection
+        <https://bugs.webkit.org/show_bug.cgi?id=36135>
+        <rdar://problem/7752552>
+
+        * bindings/js/GCController.cpp:
+        (WebCore::GCController::garbageCollectNow): Fail silently if garbage collection is
+        active rather than hitting the CRASH() reentrancy guard.
+
+2010-03-15  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Drop out of compositing mode when no elements need to composite
+        https://bugs.webkit.org/show_bug.cgi?id=36134
+
+        When no more elements on the page need to be composited, drop out of compositing
+        mode altogether, including removing the layer-backed view that hosts the layers.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateCompositingLayers): If the list of child layers to attach at
+        the root is empty, we have no composited layers, and can drop out of compositing mode by calling
+        willMoveOffscreen().
+        
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements): In several places,
+        use willBeComposited rather than calling needsToBeComposited(), because it avoids
+        recomputing state that we know already (but assert that we're getting it right).
+        When we're assessing the root layer in post-order, see if we have any child layers that
+        are compositing, and also whether the root itself needs to composite. If neither are
+        true, then we can drop out of compositing mode.
+        
+        (WebCore::RenderLayerCompositor::needsToBeComposited):
+        (WebCore::RenderLayerCompositor::requiresCompositingLayer): Move the
+        "inCompositingMode() && layer->isRootLayer()" test out of requiresCompositingLayer()
+        and into needsToBeComposited() so that we can call requiresCompositingLayer() separately
+        on the root layer above.
+
+2010-03-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35888
+
+        * platform/efl/SoundEfl.cpp: Added.
+
+2010-03-15  Andy Estes  <aestes@apple.com>
+
+        Reviewed by John Sullivan.
+
+        For continuous scrolling devices on the Mac (trackpads and Mighty/Magic
+        Mice), set the number of wheel ticks equal to the atomic increment of
+        the device: a pixel.  This ensures that any scrolling action will
+        generate at least one wheel tick, regardless of the speed/length of
+        the gesture.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29601
+        <rdar://problem/7453254>
+
+        Tests: fast/events/continuous-platform-wheelevent-in-scrolling-div.html
+               fast/events/platform-wheelevent-in-scrolling-div.html
+
+        * platform/mac/WebCoreSystemInterface.h: Modify method signature.
+        * platform/mac/WebCoreSystemInterface.mm: Ditto.
+        * platform/mac/WheelEventMac.mm:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Call into
+        WebKitSystemInterface to determine both wheelTicksX/Y and deltaX/Y.
+        WKSI will query the event system for number of wheel ticks and
+        pixels/lines scrolled based on the device type.
+
+2010-03-15  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] duration query optimizations
+        https://bugs.webkit.org/show_bug.cgi?id=36116
+
+        Don't reattempt duration queries that previously failed and cache
+        media duration only if it's known.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::duration):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        (WebCore::MediaPlayerPrivate::durationChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-11  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Adam Barth.
+
+        Clean up more bits of the open-source image decoders.  In addition to
+        simplifying things somewhat, this makes all the decoders the same in
+        terms of how they construct "image reader" subclasses and init scale
+        data.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36040
+
+        No functional change, so no tests.
+
+        * platform/image-decoders/ImageDecoder.h: Reorder a few declarations to try and group/order members slightly better.
+        (WebCore::ImageDecoder::ImageDecoder):
+        * platform/image-decoders/gif/GIFImageDecoder.cpp: Move reader construction into decode().  Prep scale data in setSize().  Remove useless comment.
+        (WebCore::GIFImageDecoder::setData):
+        (WebCore::GIFImageDecoder::setSize):
+        (WebCore::GIFImageDecoder::frameBufferAtIndex):
+        (WebCore::GIFImageDecoder::decode):
+        * platform/image-decoders/gif/GIFImageDecoder.h: Prep scale data in setSize().
+        * platform/image-decoders/gif/GIFImageReader.cpp: Prep scale data in setSize().
+        (GIFImageReader::read):
+        * platform/image-decoders/ico/ICOImageDecoder.cpp: Shorten code.
+        (WebCore::ICOImageDecoder::setSize):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Fix style.  Move reader construction into decode().
+        (WebCore::JPEGImageReader::close):
+        (WebCore::JPEGImageReader::skipBytes):
+        (WebCore::JPEGImageDecoder::decode):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.h: Move reader construction into decode().
+        (WebCore::JPEGImageDecoder::filenameExtension):
+        * platform/image-decoders/png/PNGImageDecoder.cpp: Move reader construction into decode().  Track completion on decoder, not reader.  Prep scale data in setSize().  Remove useless comment.
+        (WebCore::PNGImageReader::PNGImageReader):
+        (WebCore::PNGImageReader::close):
+        (WebCore::PNGImageReader::decode):
+        (WebCore::PNGImageDecoder::setSize):
+        (WebCore::PNGImageDecoder::frameBufferAtIndex):
+        (WebCore::PNGImageDecoder::headerAvailable):
+        (WebCore::PNGImageDecoder::pngComplete):
+        (WebCore::PNGImageDecoder::decode):
+        * platform/image-decoders/png/PNGImageDecoder.h: Move reader construction into decode().  Track completion on decoder, not reader.  Prep scale data in setSize().
+        (WebCore::PNGImageDecoder::filenameExtension):
+        (WebCore::PNGImageDecoder::isComplete):
+
+2010-03-15  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] updateStates called for all elements posting a state-change
+        https://bugs.webkit.org/show_bug.cgi?id=36115
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mediaPlayerPrivateMessageCallback): Update player state
+        only for state-change messages coming from playbin2 directly.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        (WebCore::MediaPlayerPrivate::pipeline): public accessor for the
+        playbin element.
+
+2010-03-15  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [v8] Add V8 bindings for DOMFormData.
+        https://bugs.webkit.org/show_bug.cgi?id=36026
+
+        Test: http/tests/local/send-form-data.html
+
+        * Android.v8bindings.mk:
+        * WebCore.gypi:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8DOMFormDataCustom.cpp: Added.
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::sendCallback):
+
+2010-03-15  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Sam Weinig.
+
+        Add DOMFormData.idl to expose FormData interface.
+        https://bugs.webkit.org/show_bug.cgi?id=36024
+        
+        The implementation is based on XMLHttpRequest 2 spec:
+        http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#formdata
+
+        Test: http/tests/local/send-form-data.html
+
+        * Android.derived.jscbindings.mk:
+        * Android.derived.v8bindings.mk:
+        * Android.jscbindings.mk:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMFormDataCustom.cpp: Added.
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::send):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * html/DOMFormData.idl: Added.
+        * page/DOMWindow.idl:
+
+2010-03-15  Patrik Persson  <patrik.j.persson@ericsson.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32369
+
+        Revise iframe sandbox behavior to match the updated HTML5 spec.
+
+        - Enables window.sessionStorage in sandboxed iframes.
+
+        - Raises SECURITY_ERR exceptions when window.localStorage or
+          window.openDatabase() is blocked by iframe sandboxing.
+
+          Note: window.sessionStorage does not raise exceptions.
+
+        WebKit would previously return null references in these cases.  The
+        new behavior is in accordance with HTML5:
+
+          http://dev.w3.org/html5/webstorage/   (sections 4.2 and 4.3)
+          http://dev.w3.org/html5/webdatabase/  (section 4.1)
+          http://www.mail-archive.com/whatwg@lists.whatwg.org/msg19786.html
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::selectDOMStorage): exception handling
+        * inspector/InspectorDOMStorageResource.cpp:
+        (WebCore::InspectorDOMStorageResource::handleEvent): exception handling
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::sessionStorage): re-enabled in iframe sandbox
+        (WebCore::DOMWindow::localStorage): raise exception rather than return null
+        (WebCore::DOMWindow::openDatabase): raise exception rather than return null
+        * page/DOMWindow.h: added exceptions to interface
+        * page/DOMWindow.idl: added exceptions to interface
+        * page/SecurityOrigin.h:
+        (WebCore::SecurityOrigin::canAccessLocalStorage): renamed function to reflect its purpose
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatch): exception handling
+
+2010-03-15  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Implement a progress indicator in the Audits panel
+        when resources are reloading
+        https://bugs.webkit.org/show_bug.cgi?id=35971
+
+        * English.lproj/localizedStrings.js:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * inspector/front-end/AuditLauncherView.js:
+        (WebInspector.AuditLauncherView.prototype.updateResourceTrackingState):
+        (WebInspector.AuditLauncherView.prototype.get totalResources):
+        (WebInspector.AuditLauncherView.prototype.set totalResources):
+        (WebInspector.AuditLauncherView.prototype.get loadedResources):
+        (WebInspector.AuditLauncherView.prototype.set loadedResources):
+        (WebInspector.AuditLauncherView.prototype._resetResourceCount):
+        (WebInspector.AuditLauncherView.prototype.resourceStarted):
+        (WebInspector.AuditLauncherView.prototype.resourceFinished):
+        (WebInspector.AuditLauncherView.prototype.reset):
+        (WebInspector.AuditLauncherView.prototype._setAuditRunning):
+        (WebInspector.AuditLauncherView.prototype._launchButtonClicked):
+        (WebInspector.AuditLauncherView.prototype._createCategoryElement):
+        (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+        (WebInspector.AuditLauncherView.prototype._updateResourceProgress):
+        (WebInspector.AuditLauncherView.prototype._updateButton):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel.prototype.resourceStarted):
+        (WebInspector.AuditsPanel.prototype.resourceFinished):
+        (WebInspector.AuditsPanel.prototype.reset):
+        * inspector/front-end/Images/spinner.gif: Added.
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/audits.css:
+        (.audit-launcher-view .resource-progress > img):
+        * inspector/front-end/inspector.js:
+        (WebInspector.updateResource):
+
+2010-03-15  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] replace g_idle_add / g_timeout_add calls with Timers in the gstreamer player
+        https://bugs.webkit.org/show_bug.cgi?id=35735
+
+        Replaced g_idle_add calls with Timers immediately started once
+        only. The g_timeout_add was replaced by a periodic Timer.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::volumeChangedTimerFired):
+        (WebCore::MediaPlayerPrivate::volumeChanged):
+        (WebCore::MediaPlayerPrivate::processBufferingStats):
+        (WebCore::MediaPlayerPrivate::fillTimerFired):
+        (WebCore::MediaPlayerPrivate::maxTimeLoaded):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        (WebCore::MediaPlayerPrivate::muteChangedTimerFired):
+        (WebCore::MediaPlayerPrivate::muteChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Carlson.
+
+        media/video-preload.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=35793
+
+        Only effectively load, and start buffering when playing, or when
+        the preload attribute is set.
+
+        Test: media/video-preload.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::commitLoad):
+        (WebCore::MediaPlayerPrivate::prepareToPlay):
+        (WebCore::MediaPlayerPrivate::setPreload):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-15  Shu Chang  <Chang.Shu@nokia.com>
+
+        Reviewed by Holger Freyther.
+
+        [Qt] The behavior of QGradient with no stops is defined differently from HTML5 spec,
+        where the latter requires the gradient to be transparent black. Explicitly added a
+        transparent black color stop to match the HTML5 behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=36060
+
+        * platform/graphics/qt/GradientQt.cpp:
+        (WebCore::Gradient::platformGradient):
+
+2010-03-11  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Rubber-stamped by Holger Freyther.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Some minor code clean ups in SpatialNavigation.cpp
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::distanceInDirection):
+        (WebCore::deflateIfOverlapped):
+
+2010-03-13  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        WebInspector: Position of GraphBar elements is calculating more carefully
+        and they fully visible at the bottom of Timeline panel.
+       
+        http://bugs.webkit.org/show_bug.cgi?id=35966
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelineRecordGraphRow.prototype.update):
+
+2010-03-15  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Selection.modify extends too far with 'lineboundary'.
+        https://bugs.webkit.org/show_bug.cgi?id=33413
+
+        Selection.modify() with 'lineboundary' granularity implies just
+        "Go to the end of the line", unlike selection expansion with
+        other type of granularities. This change handled LineGranularity
+        as special case, to look-up end of line with UPSTREAM affinity. 
+        Doing this prevents look-up algorithm to go next line.
+
+        Test: editing/selection/extend-selection-expected.txt
+
+        * dom/Position.cpp:
+        (WebCore::Position::getInlineBoxAndOffset):
+        Handled an edge case for node look-up with UPSTREAM.
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::modifyExtendingForward):
+        Added UPSTREAM tweak for the case for LineGranularity.
+        
+2010-03-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Always call PrintContext.end() from PrintContext::pageNumberForElement().
+
+        Without this change, WebKit remains in printing mode after determining the page number if the specified element is found.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36049
+
+        Test: printing/return-from-printing-mode.html
+
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::pageNumberForElement):
+
+2010-03-11  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] progressTimer never stopped after EOS
+        https://bugs.webkit.org/show_bug.cgi?id=36007
+
+        Mark the pipeline as paused only if playback hasn't ended
+        yet. When didEnd() is triggered, the pipeline is paused (but
+        paused() still returns false) and a timeupdate event is fired,
+        those 2 conditions allow the HTMLMediaElement to stop the
+        progressTimer (in updatePlayerState, via mediaPlayerTimeChanged).
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::updateStates):
+
+2010-03-14  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] [Symbian] Added block for ENABLE_SYMBIAN_DIALOG_PROVIDERS
+        on Symbian platform.
+        https://bugs.webkit.org/show_bug.cgi?id=35919
+
+        * WebCore.pro:
+
+2010-03-14  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Support for HTMLProgressElement
+        https://bugs.webkit.org/show_bug.cgi?id=35937
+
+        Added support for HTMLProgressElement.
+        This implementation is enabled only for Qt, because only RenderThemeQt
+        was modified to actually draw the progress element.
+        The labels attribute of the progress element will be implemented in a
+        separate patch.
+
+        Tests: fast/dom/HTMLProgressElement/progress-element.html
+               fast/dom/HTMLProgressElement/set-progress-properties.html
+
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::extractPseudoType):
+        * css/CSSValueKeywords.in:
+        * css/html.css:
+        * html/HTMLElement.cpp:
+        (WebCore::inlineTagList):
+        * html/HTMLElementsAllInOne.cpp:
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLProgressElement.cpp: Added.
+        (WebCore::HTMLProgressElement::HTMLProgressElement):
+        (WebCore::HTMLProgressElement::create):
+        (WebCore::HTMLProgressElement::createRenderer):
+        (WebCore::HTMLProgressElement::formControlType):
+        (WebCore::HTMLProgressElement::parseMappedAttribute):
+        (WebCore::HTMLProgressElement::value):
+        (WebCore::HTMLProgressElement::setValue):
+        (WebCore::HTMLProgressElement::max):
+        (WebCore::HTMLProgressElement::setMax):
+        (WebCore::HTMLProgressElement::position):
+        * html/HTMLProgressElement.h: Added.
+        (WebCore::HTMLProgressElement::isOptionalFormControl):
+        * html/HTMLProgressElement.idl: Added.
+        * html/HTMLTagNames.in:
+        * page/DOMWindow.idl:
+        * platform/ThemeTypes.h:
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::adjustProgressBarStyle):
+        (WebCore::RenderThemeQt::paintProgressBar):
+        * platform/qt/RenderThemeQt.h:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isProgress):
+        * rendering/RenderProgress.cpp: Added.
+        (WebCore::RenderProgress::RenderProgress):
+        (WebCore::RenderProgress::baselinePosition):
+        (WebCore::RenderProgress::calcPrefWidths):
+        (WebCore::RenderProgress::layout):
+        (WebCore::RenderProgress::updateFromElement):
+        * rendering/RenderProgress.h: Added.
+        (WebCore::RenderProgress::renderName):
+        (WebCore::RenderProgress::isProgress):
+        (WebCore::toRenderProgress):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustStyle):
+        (WebCore::RenderTheme::paint):
+        (WebCore::RenderTheme::paintBorderOnly):
+        (WebCore::RenderTheme::paintDecorations):
+        (WebCore::RenderTheme::adjustProgressBarStyle):
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::paintProgressBar):
+
+2010-03-14  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(r53287): drop event is not fired if dataTransfer.dropEffect is not explicitly set
+        https://bugs.webkit.org/show_bug.cgi?id=36095
+
+        The issue here is that while dropEffect is meant to be initialized
+        to "none", the behaviour of the drag is differs between dragEffect
+        not being set and dragEffect being explicitly set to "none"
+
+        This patch corrects this behaviour by making Clipboard distinguish
+        between the initial "none" value of dropEffect and an explicit "none".
+        This alone is insufficient for correct behaviour, we also need to
+        resurrect the removed defaultOperationForDrag function, but we now
+        use the function only when dragEffect is uninitialized.  There are a
+        few tweaks to the behaviour of the defaultOperationForDrag as well
+        to ensure exactly the same set of outcomes for all cases that we
+        may hit it.
+
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::Clipboard):
+        (WebCore::dragOpFromIEOp):
+        (WebCore::Clipboard::destinationOperation):
+        * dom/Clipboard.h:
+        (WebCore::Clipboard::dropEffect):
+        (WebCore::Clipboard::dropEffectIsUninitialized):
+        * page/DragController.cpp:
+        (WebCore::defaultOperationForDrag):
+        (WebCore::DragController::tryDHTMLDrag):
+
+2010-03-14  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35146
+        Support tiled backing store
+
+        Implements a basic tiled backing store mechanism. Tiles are created and 
+        deleted on demand. The page content is cached to the tiles. Tile content
+        is kept in sync with the document. Since the backing store covers area
+        larger than the currently visible viewport, the document can be scrolled
+        quickly without having to enter rendering tree painting.
+        
+        The tile management code is platform independent. This patch has simple QPixmap
+        based tile implementation for Qt.
+        
+        The feature is behind ENABLE_TILED_BACKING_STORE flag.
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::setTiledBackingStoreEnabled):
+        (WebCore::Frame::tiledBackingStorePaintBegin):
+        (WebCore::Frame::tiledBackingStorePaint):
+        (WebCore::Frame::tiledBackingStorePaintEnd):
+        (WebCore::Frame::tiledBackingStoreContentsRect):
+        * page/Frame.h:
+        (WebCore::Frame::tiledBackingStore):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::repaintContentRectangle):
+        (WebCore::FrameView::doDeferredRepaints):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setTiledBackingStoreEnabled):
+        * page/Settings.h:
+        (WebCore::Settings::tiledBackingStoreEnabled):
+        * platform/graphics/Tile.h: Added.
+        (WebCore::Tile::create):
+        (WebCore::Tile::coordinate):
+        (WebCore::Tile::rect):
+        * platform/graphics/TiledBackingStore.cpp: Added.
+        (WebCore::TiledBackingStore::TiledBackingStore):
+        (WebCore::TiledBackingStore::~TiledBackingStore):
+        (WebCore::TiledBackingStore::invalidate):
+        (WebCore::TiledBackingStore::updateTileBuffers):
+        (WebCore::TiledBackingStore::paint):
+        (WebCore::TiledBackingStore::viewportChanged):
+        (WebCore::TiledBackingStore::setContentsScale):
+        (WebCore::TiledBackingStore::tileDistance):
+        (WebCore::TiledBackingStore::createTiles):
+        (WebCore::TiledBackingStore::dropOverhangingTiles):
+        (WebCore::TiledBackingStore::dropTilesOutsideRect):
+        (WebCore::TiledBackingStore::tileAt):
+        (WebCore::TiledBackingStore::setTile):
+        (WebCore::TiledBackingStore::removeTile):
+        (WebCore::TiledBackingStore::mapToContents):
+        (WebCore::TiledBackingStore::mapFromContents):
+        (WebCore::TiledBackingStore::contentsRect):
+        (WebCore::TiledBackingStore::tileRectForCoordinate):
+        (WebCore::TiledBackingStore::tileCoordinateForPoint):
+        (WebCore::TiledBackingStore::startTileBufferUpdateTimer):
+        (WebCore::TiledBackingStore::tileBufferUpdateTimerFired):
+        (WebCore::TiledBackingStore::startTileCreationTimer):
+        (WebCore::TiledBackingStore::tileCreationTimerFired):
+        (WebCore::TiledBackingStore::setContentsFrozen):
+        * platform/graphics/TiledBackingStore.h: Added.
+        (WebCore::TiledBackingStore::contentsScale):
+        (WebCore::TiledBackingStore::contentsFrozen):
+        * platform/graphics/TiledBackingStoreClient.h: Added.
+        * platform/graphics/qt/TileQt.cpp: Added.
+        (WebCore::checkeredPixmap):
+        (WebCore::Tile::Tile):
+        (WebCore::Tile::~Tile):
+        (WebCore::Tile::isDirty):
+        (WebCore::Tile::isReadyToPaint):
+        (WebCore::Tile::invalidate):
+        (WebCore::Tile::updateBackBuffer):
+        (WebCore::Tile::swapBackBufferToFront):
+        (WebCore::Tile::paint):
+        (WebCore::Tile::paintCheckerPattern):
+
+2010-03-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebCore part of removing support for legacy versions of Core Graphics
+
+        * WebCore.vcproj/WebCore.vcproj: Removed FontDatabase.{cpp,h}
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::Font::drawGlyphs): Removed call to wkCanCreateCGFontWithLOGFONT(),
+        as it is now always true.
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::createFontPlatformData): Ditto.
+        * platform/graphics/win/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Updated for
+        the removal of m_cgFont.
+        (WebCore::FontCustomPlatformData::fontPlatformData): Removed call to
+        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
+        (WebCore::createFontCustomPlatformData): Ditto. Also updated for change to
+        the FontCustomPlatformData constructor.
+        * platform/graphics/win/FontCustomPlatformData.h: Removed m_cgFont member.
+        (WebCore::FontCustomPlatformData::FontCustomPlatformData): Removed cgFont
+        parameter.
+        * platform/graphics/win/FontDatabase.cpp: Removed.
+        * platform/graphics/win/FontDatabase.h: Removed.
+        * platform/graphics/win/FontPlatformDataCGWin.cpp:
+        (WebCore::FontPlatformData::platformDataInit): Removed call to
+        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
+        * platform/win/TemporaryLinkStubs.cpp:
+        (WebCore::populateFontDatabase): Removed stub.
+
+2010-03-14  Jessie Berlin  <jberlin@webkit.org>
+
+        Reviewed by Sam Weinig.
+
+        "event.ctrlKey" is always false when dragging an element with "ctrl" key down
+        https://bugs.webkit.org/show_bug.cgi?id=17113
+
+        No new tests.
+
+        * page/DragController.cpp:
+        (WebCore::createMouseEvent):
+        Use the current state of the shift, ctrl, alt, and meta keys when creating the drag mouse event.
+
+2010-03-13  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Not reviewed identation fix.
+
+        * manual-tests/spatial-navigation/spatial-navigation-test-cases.html:
+
+2010-03-13  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] GraphicsLayer: Opacity change from zero to non-zero doesn't always have effect with AC
+        https://bugs.webkit.org/show_bug.cgi?id=36034
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::OpacityAnimationQt::applyFrame):
+
+2010-03-13  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] GraphicsLayer: Opacity transitions end with begin value
+        https://bugs.webkit.org/show_bug.cgi?id=36019
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::AnimationQt::updateCurrentTime):
+
+2010-03-13  Dirk Schulze  <krit@webkit.org>
+
+        No review, rolling out r55927.
+        http://trac.webkit.org/changeset/55927
+        https://bugs.webkit.org/show_bug.cgi?id=35793
+
+        Breaks Gtk build bots.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::setPreload):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-12  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG Glyphs - transform path not context
+        https://bugs.webkit.org/show_bug.cgi?id=36070
+
+        SVGFont should transform the path of a glyph, not the context. Modifying
+        the context causes wrong gradient transformations. This bug doesn't
+        influence CG because we generally fill or stroke texts with a mask image.
+        All other platforms provide a direct way to make the drawings.
+
+        * svg/SVGFont.cpp:
+        (WebCore::Font::drawTextUsingSVGFont):
+
+2010-03-12  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen 
+        API naming is inconsistent
+        -and corresponding-
+        <rdar://problem/7729165>
+
+        This patch changes all occurrences of "fullScreen" to the more 
+        popular "fullscreen." webkitEnterFullScreen and 
+        webkitExitFullScreen have been maintained for now for backwards 
+        compatibility. 
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::webkitEnterFullscreen):
+        (WebCore::HTMLVideoElement::webkitExitFullscreen):
+        * html/HTMLVideoElement.h:
+        (WebCore::HTMLVideoElement::webkitEnterFullScreen):
+        (WebCore::HTMLVideoElement::webkitExitFullScreen):
+        * html/HTMLVideoElement.idl:
+        * platform/graphics/mac/MediaPlayerProxy.h:
+
+2010-03-12  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add virtual destructor to DOMWrapperWorld
+        https://bugs.webkit.org/show_bug.cgi?id=36077
+
+        DOMWrapperWorld is RefCounted<DOMWrapperWorld>.  IsolatedWorld
+        inherits from DOMWrapperWorld and has member variables
+        with destructors, so DOMWrapperWorld needs to have a declared virtual
+        d'tor to ensure that its derived class's destructors are called.
+
+        No new tests, no change in behavior
+
+        * bindings/v8/DOMWrapperWorld.h:
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 36075 - Clean up screwyness re static string impls & Identifiers.
+
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::~StringImpl): Add ASSERT
+        (WebCore::StringImpl::sharedBuffer): Add ASSERT
+        * platform/text/StringImpl.h:
+        (WebCore::StringImpl::setHash): Add ASSERT
+        (WebCore::StringImpl::isStatic): added.
+
+2010-03-12  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Content of 3D tests appears at the bottom right corner sometimes.
+        <rdar://problem/7556244>
+        <https://bugs.webkit.org/show_bug.cgi?id=36027>
+
+        There were two problems to solve here:
+        - the incorrect anchoring of the rootChildLayer that was causing the composited
+          content to be positioned incorrectly
+        - the failure to paint the non composited content into the backing store when
+          animating composited content.
+          
+        The first problem has been solved by leaving the original anchor point for the
+        rootChildLayer and splitting the tasks of clipping and scrolling using two separate layers.
+        The second problem has been solved leveraging the knowledge that WebView has of the dirty region
+        of the backing store to pass this information to the layer renderer. This allows the renderer to force
+        a paint into the backing store before moving to the compositing.
+        
+        Tests: compositing/geometry/horizontal-scroll-composited.html
+               compositing/geometry/vertical-scroll-composited.html
+
+        * manual-tests/win/horizontal-scroll-composited.html: Removed. This is now a layout test.
+        * manual-tests/win/milliondollar.html: Added.
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer): Added initialization of dirty flag.
+        (WebCore::WKCACFLayerRenderer::setScrollFrame): 
+        (WebCore::WKCACFLayerRenderer::updateScrollFrame): Updated to resize and position the clip and scroll layers.
+        (WebCore::WKCACFLayerRenderer::setRootChildLayer):
+        (WebCore::WKCACFLayerRenderer::createRenderer): Added new layer hierarchy.
+        (WebCore::WKCACFLayerRenderer::destroyRenderer): Remove clip layer on destroy.
+        (WebCore::WKCACFLayerRenderer::resize):
+        (WebCore::WKCACFLayerRenderer::paint): Forcing paint massage to trigger paint into the backing store.
+        * platform/graphics/win/WKCACFLayerRenderer.h:
+        (WebCore::WKCACFLayerRenderer::setBackingStoreDirty): Added.
+
+2010-03-12  Robert Hogan  <robert@webkit.org>
+
+        Not reviewed, build fix.
+
+        Revert http://trac.webkit.org/projects/webkit/changeset/55374 which broke
+        the !ENABLE(DATABASE) build on all platforms when attempting to fix the
+        --minimal build on Qt.
+
+        Support for SQLite now seems to be non-negotiable for the Qt build but making
+        it mandatory requires review, so re-break --minimal Qt build for now.
+
+        Qt build issue now tracked at https://bugs.webkit.org/show_bug.cgi?id=36073
+
+        * page/GeolocationPositionCache.cpp:
+
+2010-03-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        <rdar://problem/7709115> REGRESSION: toolbar is missing at http://www.glom.org/
+        https://bugs.webkit.org/show_bug.cgi?id=35507
+
+        * css/CSSImportRule.cpp:
+        (WebCore::CSSImportRule::setCSSStyleSheet): Extend the change made in
+        <http://trac.webkit.org/changeset/48818> to detect the two variants of
+        KHTMLFixes.css in @import rules as well as in <link> elements.
+
+2010-03-12  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Bug 36052 - [Qt] REGRESSION(55878) 63 test cases crash
+
+        r55878 changed UStringImpl::empty()->characters() to be non-null,
+        so TextBreakIteratorQt.cpp now should check the length of strings
+        (previously was assuming all strings with a non-null data pointer
+        had a length of at least 1).
+
+        * platform/text/qt/TextBreakIteratorQt.cpp:
+        (WebCore::wordBreakIterator):
+        (WebCore::characterBreakIterator):
+        (WebCore::lineBreakIterator):
+        (WebCore::sentenceBreakIterator):
+
+2010-03-12  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG fallback color doesn't work for bogus gradients.
+        https://bugs.webkit.org/show_bug.cgi?id=35479
+
+        Use a given fallback color on ignored gradients if present. Gradients
+        must be ignored, if one dimension of the objects boundingBox is zero.
+
+        Test: svg/custom/gradient-with-1d-boundingbox.svg
+
+        * svg/graphics/SVGPaintServer.cpp:
+        (WebCore::SVGPaintServer::strokePaintServer):
+        * svg/graphics/SVGPaintServerGradient.cpp:
+        (WebCore::SVGPaintServerGradient::setup):
+
+2010-03-12  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36069
+        
+        Eliminate InlineRunBox.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::adjustPosition):
+        (WebCore::InlineFlowBox::paintFillLayer):
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintMask):
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::InlineFlowBox):
+        (WebCore::InlineFlowBox::prevLineBox):
+        (WebCore::InlineFlowBox::nextLineBox):
+        (WebCore::InlineFlowBox::setNextLineBox):
+        (WebCore::InlineFlowBox::setPreviousLineBox):
+        * rendering/InlineRunBox.h: Removed.
+        * rendering/InlineTextBox.h:
+        (WebCore::InlineTextBox::InlineTextBox):
+        (WebCore::InlineTextBox::prevTextBox):
+        (WebCore::InlineTextBox::nextTextBox):
+        (WebCore::InlineTextBox::setNextTextBox):
+        (WebCore::InlineTextBox::setPreviousTextBox):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::destroy):
+        (WebCore::RenderBlock::rightmostPosition):
+        (WebCore::RenderBlock::leftmostPosition):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::destroy):
+        (WebCore::RenderInline::absoluteRects):
+        (WebCore::RenderInline::absoluteQuads):
+        (WebCore::RenderInline::linesBoundingBox):
+        (WebCore::RenderInline::linesVisibleOverflowBoundingBox):
+        (WebCore::RenderInline::addFocusRingRects):
+        (WebCore::RenderInline::paintOutline):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::localBoundingBox):
+        * rendering/RenderLineBoxList.cpp:
+        (WebCore::RenderLineBoxList::deleteLineBoxTree):
+        (WebCore::RenderLineBoxList::extractLineBox):
+        (WebCore::RenderLineBoxList::attachLineBox):
+        (WebCore::RenderLineBoxList::removeLineBox):
+        (WebCore::RenderLineBoxList::deleteLineBoxes):
+        (WebCore::RenderLineBoxList::dirtyLineBoxes):
+        (WebCore::RenderLineBoxList::paint):
+        (WebCore::RenderLineBoxList::hitTest):
+        (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
+        (WebCore::RenderLineBoxList::checkConsistency):
+        * rendering/RenderSVGInline.cpp:
+        (WebCore::RenderSVGInline::absoluteRects):
+        (WebCore::RenderSVGInline::absoluteQuads):
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::absoluteRects):
+        (WebCore::RenderSVGText::absoluteQuads):
+        (WebCore::RenderSVGText::objectBoundingBox):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::extractTextBox):
+        (WebCore::RenderText::attachTextBox):
+        (WebCore::RenderText::removeTextBox):
+        (WebCore::RenderText::createInlineTextBox):
+        (WebCore::RenderText::positionLineBox):
+        * rendering/RootInlineBox.h:
+        (WebCore::RootInlineBox::nextRootBox):
+        (WebCore::RootInlineBox::prevRootBox):
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Carlson.
+
+        media/video-preload.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=35793
+
+        Only effectively load, and start buffering when playing, or when
+        the preload attribute is set.
+
+        Test: media/video-preload.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::commitLoad):
+        (WebCore::MediaPlayerPrivate::prepareToPlay):
+        (WebCore::MediaPlayerPrivate::setPreload):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-12  Dmitry Titov  <dimich@chromium.org>
+
+        Not reviewed, build fix.
+
+        Reverts 55920 and 55921. Landing for Jian Li.
+
+        * Android.derived.jscbindings.mk:
+        * Android.derived.v8bindings.mk:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMFormDataCustom.cpp: Removed.
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::send):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8DOMFormDataCustom.cpp: Removed.
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::sendCallback):
+        * html/DOMFormData.idl: Removed.
+        * page/DOMWindow.idl:
+
+2010-03-12  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        [OpenVG] Add support for drawing text to PainterOpenVG
+        https://bugs.webkit.org/show_bug.cgi?id=35581
+
+        Doesn't come with any actual font classes, as OpenVG
+        by itself doesn't provide any access to platform fonts
+        but just the means to draw glyphs that have been loaded
+        manually before.
+
+        * platform/graphics/openvg/PainterOpenVG.cpp:
+        (WebCore::PlatformPainterState::PlatformPainterState):
+        (WebCore::PlatformPainterState::copyPaintState):
+        (WebCore::PainterOpenVG::textDrawingMode):
+        (WebCore::PainterOpenVG::setTextDrawingMode):
+        (WebCore::PainterOpenVG::drawText):
+        * platform/graphics/openvg/PainterOpenVG.h:
+
+2010-03-12  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        [OpenVG] Use masks to implement non-rectilinear clipping
+        https://bugs.webkit.org/show_bug.cgi?id=35544
+
+        Requires some additional context switching logic to
+        make sure the right context is current when dealing
+        with the mask, because we don't store it by ourselves.
+
+        Initial version of this code was written by
+        Eli Fidler <efidler@rim.com>, I did a couple of
+        bug fixes and efficiency improvements since then.
+
+        * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
+        (WebCore::GraphicsContext::clipPath):
+        (WebCore::GraphicsContext::clip):
+        (WebCore::GraphicsContext::clipOut):
+        (WebCore::GraphicsContext::clipOutEllipseInRect):
+        (WebCore::GraphicsContext::addInnerRoundedRectClip):
+        * platform/graphics/openvg/PainterOpenVG.cpp:
+        (WebCore::PlatformPainterState::PlatformPainterState):
+        (WebCore::PlatformPainterState::~PlatformPainterState):
+        (WebCore::PlatformPainterState::maskingEnabled):
+        (WebCore::PlatformPainterState::applyState):
+        (WebCore::PlatformPainterState::saveMaskIfNecessary):
+        (WebCore::PainterOpenVG::intersectClipRect):
+        (WebCore::PainterOpenVG::clipPath):
+        (WebCore::PainterOpenVG::save):
+        * platform/graphics/openvg/PainterOpenVG.h:
+        (WebCore::PainterOpenVG::):
+        * platform/graphics/openvg/SurfaceOpenVG.cpp:
+        (WebCore::SurfaceOpenVG::makeCurrent):
+        (WebCore::SurfaceOpenVG::makeCompatibleCurrent):
+        * platform/graphics/openvg/SurfaceOpenVG.h:
+        (WebCore::SurfaceOpenVG::):
+
+2010-03-12  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Sam Weinig.
+
+        Add DOMFormData.idl to expose FormData interface.
+        https://bugs.webkit.org/show_bug.cgi?id=36024
+        
+        The implementation is based on XMLHttpRequest 2 spec:
+        http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#formdata
+
+        Test: http/tests/local/send-form-data.html
+
+        * Android.derived.jscbindings.mk:
+        * Android.derived.v8bindings.mk:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMFormDataCustom.cpp: Added.
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::send):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * html/DOMFormData.idl: Added.
+        * page/DOMWindow.idl:
+
+2010-03-12  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        [OpenVG] Add a SurfaceOpenVG constructor for EGL client buffer surfaces
+        https://bugs.webkit.org/show_bug.cgi?id=35538
+
+        SurfaceOpenVG can now not only encapsulate pbuffer
+        and window surfaces but also VGImage-based ones.
+
+        * platform/graphics/openvg/EGLDisplayOpenVG.cpp:
+        (WebCore::EGLDisplayOpenVG::createPbufferFromClientBuffer):
+        * platform/graphics/openvg/EGLDisplayOpenVG.h:
+        * platform/graphics/openvg/SurfaceOpenVG.cpp:
+        (WebCore::SurfaceOpenVG::SurfaceOpenVG):
+        * platform/graphics/openvg/SurfaceOpenVG.h:
+
+2010-03-12  Alpha Lam  <hclam@chromium.org>
+
+        Reviewed by Eric Carlson.
+
+        Fix a crash when resource loading of media element is canceled.
+        https://bugs.webkit.org/show_bug.cgi?id=35992
+
+        Use of HTMLMediaElement::duration() after resource loading was canceled
+        will cause a crash. This is because HTMLMediaElement::m_player is used
+        when NULL.
+        Test: http/tests/media/video-cancel-load.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::duration):
+        Avoid calling to m_player when it is null.
+        (WebCore::HTMLMediaElement::userCancelledLoad):
+        Set m_readyState to HAVE_NOTHING.
+
+2010-03-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7725534> CSSPrimitiveValue::parserValue() returns deleted memory
+        https://bugs.webkit.org/show_bug.cgi?id=20069
+
+        No test added, since with the CSS variables feature disabled, the pointer
+        to the freed memory is never dereferenced.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::valueOrPropertyName): Changed to return a const AtomicString& from
+        a static table.
+        (WebCore::CSSPrimitiveValue::parserValue): Updated for the above change.
+
+2010-03-12  Dan Bernstein  <mitz@apple.com>
+
+        Build fix.
+
+        * platform/chromium/PlatformKeyboardEventChromium.cpp:
+
+2010-03-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7694674> Hover states not updated when overflow section scrolls under stationary mouse pointer
+        https://bugs.webkit.org/show_bug.cgi?id=35949
+
+        Test: fast/events/overflow-scroll-fake-mouse-move.html
+
+        Soon after an overflow section scrolls under the mouse pointer, dispatch
+        a fake mouse move event. This is similar to how frame scrolling is handled
+        in WebKit, and has the effect of updating hover state, dispatching DOM mouse
+        events, and updating the tool tip.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler): Initialize m_fakeMouseMoveEventTimer.
+        (WebCore::EventHandler::~EventHandler): Assert that the timer is not active.
+        (WebCore::EventHandler::clear): Stop the timer.
+        (WebCore::EventHandler::handleMousePressEvent): Cancel pending fake mouse
+        move events.
+        (WebCore::EventHandler::handleMouseMoveEvent): Ditto.
+        (WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): If the mouse
+        is in the passed-in quad, ensure that a fake mouse move event is scheduled
+        to fire soon.
+        (WebCore::EventHandler::cancelFakeMouseMoveEvent): Does what the name says.
+        (WebCore::EventHandler::fakeMouseMoveEventTimerFired): Constructs a
+        PlatformMouseEvent with the current mouse location, modifier key state and
+        time stamp and calls mouseMoved().
+        * page/EventHandler.h:
+        * platform/PlatformKeyboardEvent.h: Declared getCurrentModifierState().
+        * platform/android/KeyEventAndroid.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
+        * platform/brew/PlatformKeyboardEventBrew.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
+        * platform/chromium/PlatformKeyboardEventChromium.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
+        * platform/efl/PlatformKeyboardEventEfl.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
+        * platform/gtk/KeyEventGtk.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
+        * platform/haiku/PlatformKeyboardEventHaiku.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
+        * platform/mac/KeyEventMac.mm:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
+        * platform/qt/PlatformKeyboardEventQt.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
+        * platform/win/KeyEventWin.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
+        * platform/wx/KeyboardEventWx.cpp:
+        (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollToOffset): Call
+        EventHandler::dispatchFakeMouseMoveEventSoonInQuad(). Moved things around
+        a little to avoid computing the repaint rect twice.
+
+2010-03-12  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Webkit doesn't build with workers on and database off
+        https://bugs.webkit.org/show_bug.cgi?id=35997
+
+        Added missing ENABLE(DATABASE) guards.
+
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThreadShutdownStartTask::performTask):
+
+2010-03-12  Dan Winship  <danw@gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Make the defaultCookieJar use a no-third-party policy. Most
+        applications set their own cookie jar, but DumpRenderTree doesn't,
+        so it was failing the new third-party-cookie test.
+
+        * platform/network/soup/CookieJarSoup.cpp:
+        (WebCore::defaultCookieJar):
+
+2010-03-11  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Enable network state notifier when compiling against Qt 4.7
+        https://bugs.webkit.org/show_bug.cgi?id=35983
+
+        * WebCore.pri:
+        * platform/network/qt/NetworkStateNotifierPrivate.h:
+        * platform/network/qt/NetworkStateNotifierQt.cpp:
+
+2010-03-11  Benjamin Poulain  <benjamin.poulain@nokia.com>
+
+        Reviewed by Adam Treat.
+
+        Do not render the full frame when there is some elements with fixed positioning
+        https://bugs.webkit.org/show_bug.cgi?id=33150
+
+        The frame view take into acount the list of fixed object when scrolling
+        the view. If the number of object is lower than a certain threshold, the pixel
+        are blitted, and the invalidated area updated.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView):
+        (WebCore::FrameView::useSlowRepaints):
+        (WebCore::FrameView::useSlowRepaintsIfNotOverlapped):
+        (WebCore::FrameView::addFixedObject):
+        (WebCore::FrameView::removeFixedObject):
+        (WebCore::FrameView::scrollContentsFastPath):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollContents):
+        (WebCore::ScrollView::scrollContentsFastPath):
+        * platform/ScrollView.h:
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::positionedObjects):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::styleWillChange):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::styleWillChange):
+
+2010-03-11  Aaron Boodman  <aa@chromium.org>
+
+        Kill WebDocument::applicationID() (part 1).
+
+        Modify interface to WebCore::NotificationPresenter::checkPermission()
+        and remove implementation of WebDocument::applicationID(). Breaking
+        API changes will be in a subsequent change.
+        https://bugs.webkit.org/show_bug.cgi?id=35846
+
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+        * notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::checkPermission):
+        * notifications/NotificationPresenter.h:
+
+2010-03-11  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by David Levin.
+
+        [v8] Remove obsolete code for delayed dereferencing of DOM objects for single-heap, multithread v8 usage.
+        https://bugs.webkit.org/show_bug.cgi?id=36043
+
+        No new tests, no changes in functionality.
+
+        * bindings/v8/DOMData.cpp:
+        (WebCore::DOMData::DOMData):
+        * bindings/v8/DOMData.h:
+        (WebCore::DOMData::handleWeakObject):
+        * bindings/v8/DOMDataStore.cpp:
+        * bindings/v8/DOMDataStore.h:
+        (WebCore::DOMDataStore::domObjectMap):
+        (WebCore::DOMDataStore::activeDomObjectMap):
+        (WebCore::DOMDataStore::domSvgElementInstanceMap):
+        (WebCore::DOMDataStore::domSvgObjectWithContextMap):
+        * bindings/v8/ScopedDOMDataStore.cpp:
+        (WebCore::ScopedDOMDataStore::ScopedDOMDataStore):
+        * bindings/v8/StaticDOMDataStore.cpp:
+        (WebCore::StaticDOMDataStore::StaticDOMDataStore):
+        * bindings/v8/StaticDOMDataStore.h:
+        * bindings/v8/V8DOMMap.cpp:
+        (WebCore::removeAllDOMObjectsInCurrentThread):
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Oliver Hunt.
+
+        Remove nonsense comments used in development & commited in error.
+
+        * platform/text/StringImpl.h:
+
+2010-03-11  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36041
+        Remove unnecessary differences in common code between WebCore::StringImpl & JSC::UStringImpl
+
+        Much of the code in WebCore::StringImpl and JSC::UStringImpl is now very similar,
+        but has trivial and unnecessary formatting differences, such as the exact wording
+        of comments, missing ASSERTs, functions implemented in the .h vs .cpp etc.
+
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::empty): Reordered in file, made empty()->characters() return a non-null value to match JSC.
+        (WebCore::StringImpl::createUninitialized): Added overflow check.
+        (WebCore::StringImpl::create): Reordered in file.
+        (WebCore::StringImpl::sharedBuffer): Reordered in file.
+        * platform/text/StringImpl.h:
+        (WebCore::StringImpl::): Remove ThreadGlobalData as friend, move SharableUChar & SharedUChar to WebCore namespace.
+        (WebCore::StringImpl::StringImpl): Made static constructor method (used to create empty string) take arguments, to match JSC & prevent accidental use.
+        (WebCore::StringImpl::setHash): Added missing ASSERT.
+        (WebCore::StringImpl::adopt): Make adpot work with Vectors with a non-zero inline capacity.
+        (WebCore::StringImpl::characters): Mark as const to match JSC.
+        (WebCore::StringImpl::hash): Use !m_hash instead of m_hash == 0.
+        (WebCore::StringImpl::computeHash): Remove redundant 'inline'.
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by David Kilzer.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+        * Configurations/Base.xcconfig:
+
+2010-03-11  Jungshik Shin  <jshin@chromium.org>
+
+        [Chromium]: Plane 2 characters are rendered "blank" 
+         (not even empty boxes) on Windows even when there are fonts to
+         cover them. 
+
+        https://bugs.webkit.org/show_bug.cgi?id=35605
+
+        Test:LayoutTests/fast/text/international/plane2.html 
+
+        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+        (WebCore::LookupAltName): Add two ExtB fonts to the array (namePairs) that are used for Plane 2 character rendering.
+        (WebCore::FontCache::getFontDataForCharacters): Add two more fonts to the fallback font list
+        * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
+        (WebCore::getFallbackFamily): Fix the fallback font lookup to cover Plane 2 (CJK ExtB).
+
+2010-03-11  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Holger Freyther.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35889
+
+        * platform/efl/SystemTimeEfl.cpp: Added.
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
+        current Mac OS X version unless otherwise specified.
+
+        Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+        Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+        may not be usable when targetting a different Mac OS X version.
+
+        Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+        MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/DebugRelease.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+        * Configurations/Version.xcconfig:
+        * Configurations/WebCore.xcconfig:
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * loader/EmptyClients.h:
+        * page/Chrome.cpp:
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * platform/HostWindow.h:
+
+2010-03-11  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Remove DOMObjectsInclude.h and update headers accordingly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36036
+
+        * WebCore.gypi:
+        * bindings/v8/DOMData.h:
+        * bindings/v8/DOMDataStore.h:
+        * bindings/v8/DOMObjectsInclude.h: Removed.
+        * bindings/v8/V8DOMMap.cpp:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/V8GCController.cpp:
+        * bindings/v8/V8Proxy.cpp:
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Remove duplicate entries revealed after sorting.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Sort the project file (also removing some bogus spaces that caused Xcode to rewrite the file
+        every time you opened it).
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-11  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix style issues and improve comments from 
+        http://trac.webkit.org/changeset/55853.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36029
+
+        * platform/animation/TimingFunction.h:
+        (WebCore::TimingFunction::TimingFunction):
+
+2010-03-11  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        accessibilityIsIgnoredBase() needs to respect when platform says include
+        https://bugs.webkit.org/show_bug.cgi?id=36025
+
+        Changed accessibilityIsIgnoredBase() to return a policy instead of a yes/no
+        answer. This allows the platform to make a yes decision on an element.
+
+        * accessibility/AccessibilityList.cpp:
+        (WebCore::AccessibilityList::accessibilityIsIgnored):
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore::AccessibilityListBox::accessibilityIsIgnored):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::):
+        (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore::AccessibilitySlider::accessibilityIsIgnored):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::accessibilityIsIgnored):
+        * accessibility/chromium/AccessibilityObjectChromium.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/gtk/AccessibilityObjectAtk.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/mac/AccessibilityObjectMac.mm:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/qt/AccessibilityObjectQt.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/win/AccessibilityObjectWin.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/wx/AccessibilityObjectWx.cpp:
+        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+
+2010-03-11  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix build breakage with ENABLE_3D_CANVAS=0
+        https://bugs.webkit.org/show_bug.cgi?id=35995
+
+        No new tests; verified in Chromium that WebGL is disabled in
+        ENABLE_3D_CANVAS=0 builds.
+
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+
+2010-03-11  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, Chromium mac build fix.
+
+        Add an explicit copy constructor to TimingFunction.
+        http://trac.webkit.org/changeset/55835 trigged an inlining
+        bug in gcc that the copy constructor resolves.
+
+        * platform/animation/TimingFunction.h:
+        (WebCore::TimingFunction::TimingFunction):
+
+2010-03-11  Chris Fleizach  <cfleizach@apple.com>
+
+        Fixing GTK. No review.
+
+        support lang attribute on <option> elements
+        https://bugs.webkit.org/show_bug.cgi?id=36021
+ 
+        We don't need to cast to AccessibilityRenderObject to get language().
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_document_get_locale):
+
+2010-03-11  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        support lang attribute on <option> elements
+        https://bugs.webkit.org/show_bug.cgi?id=36021
+
+        Allow non AccessibilityRenderObject classes to access the lang
+        attribute by moving the useful code into AccessibilityObject.
+
+        Test: platform/mac/accessibility/option-with-lang.html
+
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::language):
+        * accessibility/AccessibilityListBoxOption.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::language):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::language):
+        * accessibility/AccessibilityRenderObject.h:
+
+2010-03-11  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Access key modifier should be Ctrl+Alt for Darwin derived OS and Alt for the others
+        https://bugs.webkit.org/show_bug.cgi?id=35993
+
+        * page/qt/EventHandlerQt.cpp:
+        (WebCore::EventHandler::accessKeyModifiers):
+
+2010-03-08  Brett Wilson  <brettw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Remove the deprecated argument to url_util::IsStandard in preparation
+        for deleting that version of the function. Pull the latest googleurl
+        with the new version for the Chromium builder.
+
+        * platform/KURLGoogle.cpp:
+        (WebCore::KURL::isHierarchical):
+
+2010-03-11  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Make it possible to do builds with separate debug info in packages
+
+        * WebCore.pro:
+
+2010-03-11  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Avoid double-buffering with Qt image decoders
+
+        Pass QIODevice::Unbuffered when opening the QBuffer that
+        wraps the image data, to hint to Qt that no extra buffering
+        is needed.
+
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::setData):
+
+2010-03-10  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        [Android] The platform touch events on Android are missing support
+        for key modifiers.
+        https://bugs.webkit.org/show_bug.cgi?id=35521
+
+        Add support in PlatformToucHEventAndroid for the platform supplying
+        key modifiers with touch events.
+
+        Fixes Android so it now passes basic-single-touch-events.html.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleTouchEvent): Fix two compiler warnings.
+        * platform/PlatformTouchEvent.h:
+        (WebCore::PlatformTouchEvent::PlatformTouchEvent): Add support for
+            key modifiers on Android.
+        * platform/android/PlatformTouchEventAndroid.cpp:
+        (WebCore::PlatformTouchEvent::PlatformTouchEvent): ditto.
+
+2010-03-10  Steve Block  <steveblock@google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Implements Geolocation maximumAge property
+        https://bugs.webkit.org/show_bug.cgi?id=30676
+
+        Test: fast/dom/Geolocation/maximum-age.html
+
+        * WebCore.xcodeproj/project.pbxproj: Modified. Adds GeolocationPositionCache.h to Private headers
+        * page/Geolocation.cpp: Modified.
+        (WebCore::Geolocation::GeoNotifier::setUseCachedPosition): Added.
+        (WebCore::Geolocation::GeoNotifier::runSuccessCallback): Added.
+        (WebCore::Geolocation::GeoNotifier::timerFired): Modified. Added logic to handle using a cached position
+        (WebCore::Geolocation::Watchers::contains): Added. Required to determine if a notifier is a watch request
+        (WebCore::Geolocation::startRequest): Modified. Added logic to check for a cached position
+        (WebCore::Geolocation::requestUsesCachedPosition): Added. Callback to Geolocation object when notifier uses a cached position
+        (WebCore::Geolocation::makeCachedPositionCallbacks): Added.
+        (WebCore::Geolocation::haveSuitableCachedPosition): Added.
+        (WebCore::Geolocation::setIsAllowed): Modified.
+        (WebCore::Geolocation::positionChanged): Modified. Make callbacks using cached position where appropriate
+        (WebCore::Geolocation::geolocationServiceErrorOccurred): Modified. Make callbacks using cached position where appropriate
+        * page/Geolocation.h: Modified.
+
+2010-03-11  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed buildfix after r55823. (To fix Qt --minimal build.)
+        I have déjà vu, I'm sure that I did it before. (r55598)
+
+        * bindings/js/JSDOMWindowCustom.cpp: Missing #if ENABLE(DATABASE) guard added. 
+
+2010-03-11  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Unreviewed buildfix after r55833.
+
+        Rename all instances of data() to characters()
+
+        * bridge/qt/qt_class.cpp:
+        (JSC::Bindings::QtClass::fieldNamed):
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::convertValueToQVariant):
+
+2010-03-11  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        Allow custom memory allocation control for RenderLayerBacking class
+        https://bugs.webkit.org/show_bug.cgi?id=35857
+
+        Inherits the following class from Noncopyable because it is
+        instantiated by 'new' and no need to be copyable:                                     
+
+        class name    - instantiated at: WebCore/'location'
+        RenderLayerBacking - rendering/RenderLayer.cpp:3047
+
+        * rendering/RenderLayerBacking.h:
+
+2010-03-11  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        Allow custom memory allocation control for TimingFunction struct
+        https://bugs.webkit.org/show_bug.cgi?id=35855
+
+        Inherits the following struct from FastAllocBase because it is 
+        instantiated by 'new':
+
+        class name    - instantiated at: WebCore/'location'
+        TimingFuction - platform/graphics/GraphicsLayer.h:89
+
+        * platform/animation/TimingFunction.h:
+
+2010-03-10  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Oliver Hunt.
+        
+        Rename JSC::UStringImpl::data() to characters(), to match WebCore::StringImpl.
+
+        * bridge/jni/jsc/JavaStringJSC.h:
+        (JSC::Bindings::JavaStringImpl::uchars):
+        * platform/text/AtomicString.cpp:
+        (WebCore::AtomicString::add):
+        (WebCore::AtomicString::find):
+
+2010-03-10  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Fix for r55825, threadsafeCopy no longer needs to special-case for
+        empty strings (in fact, doing so results in leaks).
+
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::threadsafeCopy):
+
+2010-03-10  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        While calculating alpha channel, convert the floating point value to
+        an integer in [0, 256) with equal distribution.
+        https://bugs.webkit.org/show_bug.cgi?id=22150
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseColorParameters):
+
+2010-03-10  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Darin Adler, Geoffrey Garen, Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35991
+        Would be faster to not use a thread specific to implement StringImpl::empty()
+
+        Copy JavaScriptCore in making 'static' strings threadsafe, make the empty string a static,
+        shared by all threads.
+
+        ~2% progression on Dromaeo DOM core & JS lib tests.
+
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::~ThreadGlobalData):
+        * platform/ThreadGlobalData.h:
+        (WebCore::ThreadGlobalData::eventNames):
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::StringImpl):
+        (WebCore::StringImpl::empty):
+        * platform/text/StringImpl.h:
+        (WebCore::StringImpl::deref):
+        (WebCore::StringImpl::hasOneRef):
+
+2010-03-08  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Adding support for the optional creation callback that could be
+        passed to openDatabase().
+
+        Tests: storage/open-database-creation-callback.html
+               storage/open-database-creation-callback-isolated-world.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=34726
+
+        * Android.jscbindings.mk
+        * Android.v8bindings.mk
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/js/JSDatabaseCallback.cpp: Added.
+        (WebCore::JSDatabaseCallback::JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::~JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::handleEvent):
+        * bindings/js/JSDatabaseCallback.h: Added.
+        (WebCore::JSDatabaseCallback::create):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openDatabaseCallback):
+        * bindings/v8/custom/V8DatabaseCallback.cpp: Added.
+        (WebCore::V8DatabaseCallback::V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::~V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::handleEvent):
+        * bindings/v8/custom/V8DatabaseCallback.h: Added.
+        (WebCore::V8DatabaseCallback::create):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * storage/Database.cpp:
+        (WebCore::DatabaseCreationCallbackTask::create):
+        (WebCore::DatabaseCreationCallbackTask::performTask):
+        (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        (WebCore::Database::performCreationCallback):
+        * storage/Database.h:
+        (WebCore::Database::isNew):
+        * storage/DatabaseCallback.h: Added.
+        (WebCore::DatabaseCallback::~DatabaseCallback):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+
+2010-03-10  Justin Schuh  <jschuh@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Make Chrome consistently handle leading format characters in URLs
+
+        https://bugs.webkit.org/show_bug.cgi?id=35948
+
+        Test: http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char.html
+
+        * platform/KURLGoogle.cpp:
+
+2010-03-10  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Implementing DOMFormData class.
+        https://bugs.webkit.org/show_bug.cgi?id=35707
+
+        This patch only addresses the implementation of DOMFormData class and
+        moves the FormData construction logic from HTMLFormElement::createFormData
+        to FormData::create() so that it can be used by both HTMLFormElement
+        and XMLHttpRequest.
+
+        The DOMFormData IDL interface will be exposed in another patch and the
+        test will be added then.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/DOMFormData.cpp: Added.
+        * html/DOMFormData.h: Added.
+        * html/FormDataList.h:
+        (WebCore::FormDataList::encoding):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::createFormData):
+        (WebCore::HTMLFormElement::submit):
+        * html/HTMLFormElement.h:
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::create):
+        (WebCore::FormData::createMultiPart):
+        (WebCore::FormData::appendDOMFormData):
+        * platform/network/FormData.h:
+        (WebCore::FormData::boundary):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+        * xml/XMLHttpRequest.h:
+
+2010-03-10  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        VoiceOver can navigate to hidden content in widget (WAI-ARIA)
+        https://bugs.webkit.org/show_bug.cgi?id=35986
+
+        Elements that are subclassers of AXRenderObject have not been respecting
+        aria-hidden and other cases that would make them ignored. This applies
+        to tables, rows, cells, select boxes, sliders, and lists. Select boxes
+        also need to make sure their option elements respect aria-hidden as well.
+
+        Test: accessibility/aria-hidden-with-elements.html
+
+        * accessibility/AccessibilityList.cpp:
+        (WebCore::AccessibilityList::accessibilityIsIgnored):
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore::AccessibilityListBox::addChildren):
+        (WebCore::AccessibilityListBox::accessibilityIsIgnored):
+        (WebCore::AccessibilityListBox::doAccessibilityHitTest):
+        * accessibility/AccessibilityListBox.h:
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::accessibilityIsIgnored):
+        * accessibility/AccessibilityListBoxOption.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredCommon):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::doAccessibilityHitTest):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore::AccessibilitySlider::accessibilityIsIgnored):
+        * accessibility/AccessibilitySlider.h:
+        (WebCore::AccessibilitySlider::roleValue):
+        (WebCore::AccessibilitySliderThumb::roleValue):
+        (WebCore::AccessibilitySliderThumb::accessibilityIsIgnored):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableColumn.cpp:
+        (WebCore::AccessibilityTableColumn::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableColumn.h:
+        (WebCore::AccessibilityTableColumn::roleValue):
+        * accessibility/AccessibilityTableHeaderContainer.cpp:
+        (WebCore::AccessibilityTableHeaderContainer::accessibilityIsIgnored):
+        * accessibility/AccessibilityTableHeaderContainer.h:
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::accessibilityIsIgnored):
+
+2010-03-10  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Document::postTask to use a single queue of tasks, to fire them in order
+        https://bugs.webkit.org/show_bug.cgi?id=35943
+
+        Test: existing worker-cloneport.html which was broken by initial patch in http://trac.webkit.org/changeset/55593.
+        Additional test which indirectly verifies the order of execution will come as part of https://bugs.webkit.org/show_bug.cgi?id=34726
+
+        * dom/Document.cpp:
+        (WebCore::Document::postTask): Always use the same task queue, independent of what thread is posting the task.
+
+2010-03-10  Sanjeev Radhakrishnan  <sanjeevr@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Allow a plugin to participate in the browser's print workflow.
+        https://bugs.webkit.org/show_bug.cgi?id=35550
+
+        * loader/PluginDocument.cpp:
+        * loader/PluginDocument.h:
+
+2010-03-10  Ilya Tikhonovsky  <loislo@loislo-macbookpro.local>
+
+        Reviewed by Pavel Feldman.
+
+        Sidebar resize element height was adjusted.
+        Display name for Function Call details was adjusted.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35939
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+
+2010-03-10  Charles Wei  <charles.wei@torchmobile.com.cn>
+
+        Reviewed by George Staikos.
+
+        Fix https://bugs.webkig.org/show_bug.cgi?id=35207
+        When XHTMLMP is enabled, all xhtml documents fail to render for webkit portings wich use libxml2 tokenizer.
+
+        No new tests as all the xhtml test cases in LayoutTests/dom/xhtml fails without this fix when XHTMLMP is enabled.
+
+        * dom/Document.cpp:
+        (WebCore::Document::isXHTMLMPDocument):
+        * dom/XMLTokenizerLibxml2.cpp:
+        (WebCore::XMLTokenizer::internalSubset):
+        (WebCore::externalSubsetHandler):
+
+2010-03-10  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Adding all of the touch-related sources into Chromium's WebCore build.
+        https://bugs.webkit.org/show_bug.cgi?id=35874
+
+        Patch tested against the try bots, but the feature is exercised in the
+        fast/events/touch tests.
+
+        * WebCore.gypi:
+
+2010-03-10  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: now that audits panel is added, add it to the
+        enums (for storing last active, etc.).
+
+        https://bugs.webkit.org/show_bug.cgi?id=35980
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorController::specialPanelForJSName):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::):
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::showPanel):
+        * inspector/front-end/inspector.js:
+        (WebInspector.showAuditsPanel):
+
+2010-03-10  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Instead of describing the type of a wrapped v8 object
+        with an enum value, use a pointer to struct with more complete
+        information.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35941
+
+        Refactoring only, so new tests.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/DOMData.cpp:
+        * bindings/v8/DOMData.h:
+        * bindings/v8/NPV8Object.cpp:
+        * bindings/v8/V8Collection.h:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        * bindings/v8/V8DOMWindowShell.h:
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/V8DOMWrapper.h:
+        * bindings/v8/V8GCController.cpp:
+        * bindings/v8/V8Helpers.cpp:
+        * bindings/v8/V8Helpers.h:
+        * bindings/v8/V8Index.cpp: Removed.
+        * bindings/v8/V8Index.h:
+        * bindings/v8/V8NPObject.cpp:
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/V8Proxy.h:
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLAudioElementConstructor.h:
+        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLImageElementConstructor.h:
+        * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp:
+        * bindings/v8/custom/V8HTMLOptionElementConstructor.h:
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        * bindings/v8/custom/V8MessageChannelConstructor.cpp:
+        * bindings/v8/custom/V8SharedWorkerCustom.cpp:
+        * bindings/v8/custom/V8WebGLArrayBufferCustom.cpp:
+        * bindings/v8/custom/V8WebGLArrayCustom.h:
+        * bindings/v8/custom/V8WebGLByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLFloatArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLShortArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp:
+        * bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp:
+        * bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp:
+        * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+        * bindings/v8/custom/V8WebSocketCustom.cpp:
+        * bindings/v8/custom/V8WorkerCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
+        * bindings/v8/custom/V8XSLTProcessorCustom.cpp:
+
+2010-03-10  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Dave Hyatt.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Extend keyboard navigation to allow directional navigation (Manual tests)
+        https://bugs.webkit.org/show_bug.cgi?id=18662
+
+        Adds a manual tests for the Spatial Navigation feature comprasing varios
+        Html focusable elements (e.g. <a>, <table>, <iframe>) and much of the logic
+        provided by the feature.
+
+        * manual-tests/spatial-navigation/links.html: Added.
+        * manual-tests/spatial-navigation/spatial-navigation-test-cases.html: Added.
+
+2010-03-10  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35890
+
+        * platform/efl/ScrollbarEfl.h: Added.
+        * platform/efl/ScrollbarThemeEfl.h: Added.
+
+2010-03-10  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Audits panel needs an icon.
+        Landing icon attached by Timothy. Enabling panel!
+
+        https://bugs.webkit.org/show_bug.cgi?id=35945
+
+        * WebCore.gypi:
+        * inspector/front-end/Images/auditsIcon.png: Added.
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.css:
+
+2010-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Roll-out r55657, as Xan noticed a bad degradation in playing
+        youtube HTML5 videos with it, that is fixed with it
+        reverted. Looks like we'll need to work a bit more on this.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::volumeChangedTimerFired):
+        (WebCore::MediaPlayerPrivate::volumeChanged):
+        (WebCore::MediaPlayerPrivate::processBufferingStats):
+        (WebCore::MediaPlayerPrivate::fillTimerFired):
+        (WebCore::MediaPlayerPrivate::maxTimeLoaded):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        (WebCore::MediaPlayerPrivate::muteChangedTimerFired):
+        (WebCore::MediaPlayerPrivate::muteChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Rubber-stamped by Xan Lopez.
+
+        Fix ready state when buffering under PLAYING. We should not go
+        back to HaveNothing in that case.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::updateStates):
+
+2010-03-10  Ada Chan  <adachan@apple.com>
+
+        Reviewed by Adam Roben.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35976
+
+        Retrieve any dwItemData that's set on the context menu item in contextMenuItemByIdOrPosition().
+
+        * platform/win/ContextMenuWin.cpp:
+
+2010-03-10  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add IndexedDatabase class and hook it up.
+        https://bugs.webkit.org/show_bug.cgi?id=35927
+
+        This change is mostly just adding the plumbing necessary for
+        the IndexedDatabaseRequest and IndexedDatabaseSync (not written
+        yet).
+
+        This code is non-functional, so no tests (yet).
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+        * platform/chromium/ChromiumBridge.h:
+        * storage/IndexedDatabase.cpp: Added.
+        (WebCore::IndexedDatabase::get):
+        * storage/IndexedDatabase.h: Added.
+        (WebCore::IndexedDatabase::~IndexedDatabase):
+        * storage/IndexedDatabaseImpl.cpp: Added.
+        (WebCore::IndexedDatabaseImpl::get):
+        (WebCore::IndexedDatabaseImpl::IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::~IndexedDatabaseImpl):
+        (WebCore::IndexedDatabaseImpl::open):
+        * storage/IndexedDatabaseImpl.h: Added.
+        * storage/chromium/IndexedDatabase.cpp: Added.
+        (WebCore::IndexedDatabase::get):
+
+2010-03-05  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Sam Weinig.
+
+        Add one more parent check during node removal.
+        https://bugs.webkit.org/show_bug.cgi?id=35818
+
+        Test: fast/dom/Node/mutation-blur.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::removeChild): Added check.
+
+2010-03-10  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: added missing quote into localized strings.
+
+        * English.lproj/localizedStrings.js:
+
+2010-03-10  Jeremy Orlow  <jorlow@chromium.org>
+
+        Commit files that were supposed to go in with the last checkin.
+
+2010-03-10  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Dimitry Glazkov.
+
+        Baby steps towards IndexedDB: Start implementing callbacks.
+        https://bugs.webkit.org/show_bug.cgi?id=35911
+
+        This patch adds some infastructure for IndexedDB callbacks in V8.
+        It also adds a stub of IDBDatabaseRequest.  In the near future,
+        I'll gut the event based implementation code, flesh out IDBReqest
+        further, and start plumbing IndexedDatabaseRequest.
+
+        Code is not testible because it doesn't work (yet).
+
+        * WebCore.gypi:
+        * bindings/v8/DOMObjectsInclude.h:
+        * bindings/v8/V8Index.cpp:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8CustomIDBCallback.h: Added.
+        (WebCore::V8CustomIDBCallback::create):
+        (WebCore::V8CustomIDBCallback::~V8CustomIDBCallback):
+        (WebCore::V8CustomIDBCallback::handleEvent):
+        (WebCore::V8CustomIDBCallback::V8CustomIDBCallback):
+        * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp:
+        (WebCore::V8IndexedDatabaseRequest::openCallback):
+        * storage/IDBDatabaseRequest.h: Added.
+        (WebCore::IDBDatabaseRequest::request):
+        * storage/IDBDatabaseRequest.idl: Added.
+        * storage/IndexedDatabaseRequest.idl:
+
+2010-03-10  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Non animated gifs are animated in QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35955
+
+        Properly map Qt animated and non-animated values to WebCore's
+        understanding of animated and non-animated images. Currently
+        we can not map anything to the cAnimationLoopNone value.
+
+        * manual-tests/qt/qt-anim.gif: Added.
+        * manual-tests/qt/qt-gif-test.html: Added.
+        * manual-tests/qt/qt-noanim.gif: Added.
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::repetitionCount):
+
+2010-03-07  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Darin Adler.
+
+        [CAIRO] DoS on iexploder test with high text stroke width.
+        https://bugs.webkit.org/show_bug.cgi?id=33759
+
+        Specifying a big text stroke width can make WebKitGTK+ spend
+        a very long time in the cairo library for stroking the path of
+        the text. The best way to prevent this from happening right now
+        is to not stroke paths with a certain width. Samuel proposed to
+        not stroke with a width that is twice the width of the text. The
+        reason to use twice the text width is that even one stroke of
+        any charachter to be drawn would cover the full width.
+
+        Test: fast/text/text-stroke-width-cairo-dos.html
+
+        * platform/graphics/cairo/FontCairo.cpp:
+        (WebCore::Font::drawGlyphs):
+
+2010-03-10  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display list of active workers & support debugging
+        with fake workers.
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * dom/Document.cpp:
+        (WebCore::Document::inspectorController):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        (WebCore::ScriptExecutionContext::inspectorController):
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::InjectedScriptHost):
+        (WebCore::InjectedScriptHost::injectScript):
+        (WebCore::InjectedScriptHost::nextWorkerId):
+        (WebCore::InjectedScriptHost::didCreateWorker):
+        (WebCore::InjectedScriptHost::willDestroyWorker):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptHost.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects):
+        (WebCore::InspectorController::resetScriptObjects):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::didCreateWorker):
+        (WebCore::InspectorController::willDestroyWorker):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didCreateWorker):
+        (WebCore::InspectorFrontend::willDestroyWorker):
+        * inspector/InspectorFrontend.h:
+        * inspector/InspectorWorkerResource.h: Added.
+        (WebCore::InspectorWorkerResource::create):
+        (WebCore::InspectorWorkerResource::id):
+        (WebCore::InspectorWorkerResource::url):
+        (WebCore::InspectorWorkerResource::isSharedWorker):
+        (WebCore::InspectorWorkerResource::InspectorWorkerResource):
+        * inspector/front-end/Checkbox.js: Added.
+        (WebInspector.Checkbox.callbackWrapper):
+        (WebInspector.Checkbox):
+        (WebInspector.Checkbox.prototype.checked):
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.FakeWorker):
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        (InjectedFakeWorker.FakeWorker.prototype._handleException):
+        (InjectedFakeWorker.FakeWorker.prototype._importScripts):
+        (InjectedFakeWorker.FakeWorker.prototype._loadScript):
+        (InjectedFakeWorker.FakeWorker.prototype._expandURLAndCheckOrigin):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertiesSection.showInheritedToggleFunction):
+        (WebInspector.StylePropertiesSection):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/WorkersSidebarPane.js: Added.
+        (WebInspector.WorkersSidebarPane):
+        (WebInspector.WorkersSidebarPane.prototype.addWorker):
+        (WebInspector.WorkersSidebarPane.prototype.removeWorker):
+        (WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
+        (WebInspector.WorkersSidebarPane.prototype.reset):
+        (WebInspector.WorkersSidebarPane.prototype._onTriggerInstrument):
+        (WebInspector.Worker):
+        (WebInspector.didCreateWorker):
+        (WebInspector.willDestroyWorker):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.html:
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::AbstractWorker):
+        (WebCore::AbstractWorker::~AbstractWorker):
+        (WebCore::AbstractWorker::onDestroyWorker):
+        (WebCore::AbstractWorker::contextDestroyed):
+        * workers/AbstractWorker.h:
+        (WebCore::AbstractWorker::id):
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::SharedWorker):
+        * workers/Worker.cpp:
+        (WebCore::Worker::Worker):
+
+2010-03-10  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Unreviewed build fix. Fix variable name change that somehow didn't
+        make it into the patch.
+
+2010-03-10  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Reviewed by David Levin.
+
+        Bug 28293 -  [Chromium] event.datatransfer.getdata("text/uri-list") is treated the same as getdata("URL")
+        https://bugs.webkit.org/show_bug.cgi?id=28293
+        
+        Change ChromiumDataObject such that it treats types "URL" and "text/uri-list"
+        correctly for event.dataTransfer.getData/setData. Currently both are treated
+        as synonyms, but for "URL", getData is supposed to only return the first valid URL
+        contained within the data for "text/uri-list" (see HTML5 spec).
+
+        Tests: editing/pasteboard/dataTransfer-setData-getData.html
+
+        * platform/chromium/ChromiumDataObject.cpp:
+        (WebCore::ChromiumDataObject::clear):
+        (WebCore::ChromiumDataObject::clearAllExceptFiles):
+        (WebCore::ChromiumDataObject::hasData):
+        (WebCore::ChromiumDataObject::ChromiumDataObject):
+        * platform/chromium/ChromiumDataObject.h:
+        (WebCore::ChromiumDataObject::clearURL):
+        (WebCore::ChromiumDataObject::hasValidURL):
+        (WebCore::ChromiumDataObject::getURL):
+        (WebCore::ChromiumDataObject::setURL):
+        * platform/chromium/ClipboardChromium.cpp:
+        (WebCore::):
+        (WebCore::clipboardTypeFromMIMEType):
+        (WebCore::ClipboardChromium::clearData):
+        (WebCore::ClipboardChromium::getData):
+        (WebCore::ClipboardChromium::setData):
+        (WebCore::ClipboardChromium::types):
+        * platform/chromium/DragDataChromium.cpp:
+        (WebCore::DragData::asURL):
+        (WebCore::DragData::canSmartReplace):
+
+2010-03-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: REGRESSION: Tall image resources are cropped over the bottom.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34720
+
+        * inspector/front-end/inspector.css:
+
+2010-03-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: REGRESSION: Pressing up/down arrow key to change numeric
+        value in CSS property takes focus away.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34697
+
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype):
+        (WebInspector.StylePropertyTreeElement.prototype.):
+
+2010-03-09  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=21840
+        https://bugs.webkit.org/show_bug.cgi?id=23993
+
+        Fix an editing bug where replacing a selection would result in the
+        new text ending up inside nodes that were not visibly included in the
+        selection.  Instead, move our destination position out of nodes that
+        were not visibly included.
+
+        Tests: editing/deleting/backspace-avoid-preceding-style.html
+               editing/inserting/replace-at-visible-boundary.html
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::positionAvoidingPrecedingNodes):
+        (WebCore::ReplaceSelectionCommand::doApply):
+
+2010-03-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        REGRESSION: WebInspector docking busted on Windows
+        <rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
+
+        First off, a bit of settings-key related cleanup. If they're shared over multiple files, these 
+        things should be properly declared Strings, not random loose char*'s.
+
+        Along with that change, we move the "inspectorStartsAttachedSettingName" from WebKit down to the
+        InspectorController in WebCore.
+
+        Finally, when the controller is ready to show the WebInspector window, it can use this newly
+        exposed settings key to call "setWindowVisible" directly instead of relying on "showWindow" to do
+        it indirectly.
+
+        * WebCore.base.exp:
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::saveFrontendSettings):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::frontendSettingsSettingName):
+        (WebCore::InspectorController::inspectorStartsAttachedSettingName):
+        (WebCore::InspectorController::scriptObjectReady): Using the new inspectorStartsAttachedSettingName
+          key and some "can I attach this?" logic, call setWindowVisible directly to display the inspector
+          window.
+        (WebCore::InspectorController::populateScriptObjects):
+        * inspector/InspectorController.h:
+
+2010-03-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35951
+        <rdar://problem/7327060> Frequent crashes in Dashcode at JSC::Bindings::ObjcInstance::~ObjcInstance + 80
+
+        * bridge/objc/objc_instance.mm: (createInstanceWrapperCache): Fix Tiger code path, too.
+
+2010-03-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35951
+        <rdar://problem/7327060> Frequent crashes in Dashcode at JSC::Bindings::ObjcInstance::~ObjcInstance + 80
+
+        * bridge/objc/objc_instance.mm: (createInstanceWrapperCache): It's not correct to use object
+        personality for keys, because the key can be a mutable object, so its hash can change over its
+        lifetime.
+
+2010-03-09  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fix review comment accidentally overlooked in bug 35713
+        https://bugs.webkit.org/show_bug.cgi?id=35947
+
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete):
+        * editing/DeleteSelectionCommand.h:
+
+2010-03-03  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        undo after smartdelete should select the deleted space
+        https://bugs.webkit.org/show_bug.cgi?id=35713
+
+        TextEdit behavior is to select the deleted space after a smartdelete.
+
+        Tests: editing/undo/undo-smart-delete-reversed-selection.html
+               editing/undo/undo-smart-delete-word.html
+
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete):
+        (WebCore::DeleteSelectionCommand::initializePositionData):
+        * editing/DeleteSelectionCommand.h:
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::setWithoutValidation):
+        This assert looks bogus to me. undo-smart-delete-reversed-selection.html hits it
+        but not as a result of the other changes in this patch. The granularity when
+        deleting after making a wordgranularity selection is wordgranularity, not charactergranularity.
+
+2010-03-09  Steve Falkenburg  <sfalken@apple.com>
+
+        Rubber stamped by Adam Roben.
+
+        Load debug version of graphics library in Windows Debug_All builds.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFLayerRenderer::acceleratedCompositingAvailable):
+
+2010-03-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Plug-ins don't always respect the cookie accept policy.
+        <rdar://problem/7338359> and https://bugs.webkit.org/show_bug.cgi?id=26391
+
+        The problem is that the various plug-in implementations call into a ResourceLoader
+        directly instead of filtering the request through FrameLoader. This bypassed the step
+        of adding extra fields to the requests, such as the firstPartyForCookies URL.
+
+        Since plug-in code is currently so strewn about and very platform specific, I
+        think reworking it needs to be a task for domain experts. I don't know the implications
+        of adding *all* the extra fields to plug-in requests, for example.
+
+        There's no harm in this targeted fix for the hole in our cookie accept policy until
+        plug-ins can more fundamentally change.
+
+        Test: http/tests/plugins/third-party-cookie-accept-policy.html
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::load): Don't load a resource without first giving the request 
+          a firstPartyForCookies URL.
+
+2010-03-09  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Check for null renderer in scrollNode().
+        https://bugs.webkit.org/show_bug.cgi?id=34700
+
+        Test: fast/events/remove-child-onscroll.html
+
+        * page/EventHandler.cpp:
+        (WebCore::scrollNode): Return early if node->renderer() == 0
+
+2010-03-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Unreviewed distcheck fix.
+
+        * GNUmakefile.am:
+
+2010-03-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Unreviewed build fix (only exposed by make distcheck). The
+        SharedWorkers files are not built, they need to be distributed.
+
+        * GNUmakefile.am:
+
+2010-03-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Dirk Schulze.
+
+        [GStreamer] Buffering logic is not correct, and does not work very well
+        https://bugs.webkit.org/show_bug.cgi?id=35706
+
+        Fix buffering to match GStreamer expectancies regarding the
+        pipeline state, so that videos which really need buffering to play
+        correctly also work, while maintaining the convenience of
+        on-disk-buffering. This required a bit of shuffling of state
+        change handling.
+
+        No behaviour change expected.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::processBufferingStats):
+        (WebCore::MediaPlayerPrivate::fillTimerFired):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Dirk Schulze.
+
+        [GStreamer] Buffering logic is not correct, and does not work very well
+        https://bugs.webkit.org/show_bug.cgi?id=35706
+
+        Do not call pause(), but set the GStreamer state directly. This is
+        just a GStreamer implementation detail, and this will avoid having
+        side effects in case we change the pause implementation in the
+        future.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::load):
+
+2010-03-09  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        Since <option> elements don't have renderers, their hit testing needs
+        to be handled with a special case.
+
+        Test: platform/mac/accessibility/listbox-hit-test.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::ariaIsHidden):
+        (WebCore::AccessibilityRenderObject::doAccessibilityHitTest):
+
+2010-03-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Refactor Audits panel presentation layer.
+        This change removes unnecessary complexity:
+          - Audit scores were not used
+          - Audit rule parameters are passed as rule constructor arguments
+          - View management aligned with the rest of the front-end
+          - Single TreeOutline is used for category results (no need to create sections for those)
+          - Rules code beautified and simplified where possible
+          - Some UI improvements applied (see attached screenshot)
+
+        https://bugs.webkit.org/show_bug.cgi?id=35860
+
+        * inspector/front-end/AuditCategories.js:
+        (WebInspector.AuditCategories.PagePerformance.prototype.initialize):
+        (WebInspector.AuditCategories.NetworkUtilization.prototype.initialize):
+        * inspector/front-end/AuditResultView.js:
+        (WebInspector.AuditResultView):
+        (WebInspector.AuditCategoryResultPane):
+        (WebInspector.AuditCategoryResultPane.prototype._appendResult):
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.GzipRule.prototype.doRun):
+        (WebInspector.AuditRules.CombineExternalResourcesRule):
+        (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
+        (WebInspector.AuditRules.CombineJsResourcesRule):
+        (WebInspector.AuditRules.CombineCssResourcesRule):
+        (WebInspector.AuditRules.MinimizeDnsLookupsRule):
+        (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
+        (WebInspector.AuditRules.ParallelizeDownloadRule):
+        (WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun):
+        (WebInspector.AuditRules.UnusedCssRule):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.routine):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun):
+        (WebInspector.AuditRules.CacheControlRule):
+        (WebInspector.AuditRules.CacheControlRule.prototype.doRun):
+        (WebInspector.AuditRules.CacheControlRule.prototype.execCheck):
+        (WebInspector.AuditRules.BrowserCacheControlRule):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks):
+        (WebInspector.AuditRules.ProxyCacheControlRule):
+        (WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks):
+        (WebInspector.AuditRules.ImageDimensionsRule):
+        (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+        (WebInspector.AuditRules.CssInHeadRule):
+        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+        (WebInspector.AuditRules.CssInHeadRule.prototype.doRun.routine):
+        (WebInspector.AuditRules.StylesScriptsOrderRule):
+        (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
+        (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun.routine):
+        (WebInspector.AuditRules.CookieRuleBase):
+        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback):
+        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun):
+        (WebInspector.AuditRules.CookieSizeRule):
+        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
+        (WebInspector.AuditRules.StaticCookielessRule):
+        (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel):
+        (WebInspector.AuditsPanel.prototype._executeAudit.ruleResultReadyCallback):
+        (WebInspector.AuditsPanel.prototype._executeAudit):
+        (WebInspector.AuditsPanel.prototype._reloadResources):
+        (WebInspector.AuditsPanel.prototype._didMainResourceLoad):
+        (WebInspector.AuditsPanel.prototype.showResults):
+        (WebInspector.AuditsPanel.prototype.showLauncherView):
+        (WebInspector.AuditsPanel.prototype.get visibleView):
+        (WebInspector.AuditsPanel.prototype.set visibleView):
+        (WebInspector.AuditsPanel.prototype.show):
+        (WebInspector.AuditsPanel.prototype._clearButtonClicked):
+        (WebInspector.AuditCategory.prototype.addRule):
+        (WebInspector.AuditRule):
+        (WebInspector.AuditRule.prototype.set severity):
+        (WebInspector.AuditRule.prototype.run):
+        (WebInspector.AuditRule.prototype.doRun):
+        (WebInspector.AuditCategoryResult):
+        (WebInspector.AuditCategoryResult.prototype.addRuleResult):
+        (WebInspector.AuditRuleResult):
+        (WebInspector.AuditRuleResult.prototype.addChild):
+        (WebInspector.AuditRuleResult.prototype.addURL):
+        (WebInspector.AuditRuleResult.prototype.addURLs):
+        (WebInspector.AuditRuleResult.prototype.addSnippet):
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/audits.css:
+        * inspector/front-end/inspector.js:
+        (WebInspector._createPanels):
+        (WebInspector.documentKeyDown):
+
+2010-03-09  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+ 
+        When enable resource tracking state changes use the same method as
+        location.reload for reloading inspected page.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35923
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::reloadPage):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::enableResourceTracking):
+
+2010-03-09  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: highlight text node containers while searching for node.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35912
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::mouseDidMoveOverElement):
+
+2010-03-09  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] player code cleanups
+        https://bugs.webkit.org/show_bug.cgi?id=35868
+
+        Cleaned up the private instance variables of the player.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::fillTimerFired):
+        (WebCore::MediaPlayerPrivate::mediaLocationChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-09  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GStreamer] player code cleanups
+        https://bugs.webkit.org/show_bug.cgi?id=35868
+
+        Splitted GOwnPtrGtk.{cpp,h} to GOwnPtr{Soup,GStreamer}.{cpp,h}.
+
+        * GNUmakefile.am:
+        * platform/graphics/gstreamer/GOwnPtrGStreamer.cpp: Added.
+        (WTF::GstElement):
+        * platform/graphics/gstreamer/GOwnPtrGStreamer.h: Added.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        * platform/gtk/GOwnPtrGtk.cpp: Removed.
+        * platform/gtk/GOwnPtrGtk.h: Removed.
+        * platform/network/soup/CookieJarSoup.cpp:
+        * platform/network/soup/DNSSoup.cpp:
+        * platform/network/soup/GOwnPtrSoup.cpp: Added.
+        (WTF::SoupURI):
+        * platform/network/soup/GOwnPtrSoup.h: Added.
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        * platform/network/soup/ResourceRequestSoup.cpp:
+
+2010-03-09  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Should remove paddings of Win/Linux chromium's buttons
+        https://bugs.webkit.org/show_bug.cgi?id=35629
+
+        No new tests, but we may need to rebaseline bunch of expectation
+        images in chromium's tree.
+
+        * rendering/RenderThemeChromiumSkia.cpp:
+        * rendering/RenderThemeChromiumSkia.h:
+
+2010-03-08  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Implement HTML5 <hgroup> element.
+        https://bugs.webkit.org/show_bug.cgi?id=33369
+
+        <hgroup> should behave the same as <nav>, <section>, <article>, and <aside>.
+        <hgroup> has no specific parsing rules.
+
+        Test: fast/html/hgroup-element.html
+
+        * css/html.css: Add hgroup as a block element.
+        * editing/htmlediting.cpp:
+        (WebCore::validBlockTag): Add hgroupTag.
+        * html/HTMLElement.cpp:
+        (WebCore::createTagPriorityMap): Returns 5 for hgroupTag.
+        (WebCore::blockTagList): Add hgroupTag.
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::getNode): Add hgroupTag.
+        * html/HTMLTagNames.in: Add hgroup.
+
+2010-03-08  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32131
+        Crash when inserting an ordered list.
+
+        Test: editing/execCommand/insert-ordered-list.html
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/TextIterator.cpp:
+        (WebCore::TextIterator::rangeFromLocationAndLength):
+
+2010-03-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Added a test for crash when you quit inside an unload handler.
+        rdar://problem/6958347
+
+        * manual-tests/quit-inside-unload.html: Added.
+
+2010-03-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        Don't auto-play <audio> and <video> elements loaded in background tabs
+        https://bugs.webkit.org/show_bug.cgi?id=35886
+        rdar://problem/7117745
+
+        * manual-tests/video-in-non-frontmost-tab.html: Added.
+        * manual-tests/resources/video-tab.html: Added.
+
+        * html/HTMLMediaElement.h: Added MediaCanStartListener as a base class, and
+        added the mediaCanStart function as well as a boolean,
+        m_isWaitingUntilMediaCanStart.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize
+        m_isWaitingUntilMediaCanStart.
+        (WebCore::HTMLMediaElement::~HTMLMediaElement): Call
+        removeMediaCanStartListener if m_isWaitingUntilMediaCanStart is true. 
+        (WebCore::HTMLMediaElement::loadInternal): Set m_isWaitingUntilMediaCanStart
+        and call addMediaCanStartListener if canStartMedia is false.
+        (WebCore::HTMLMediaElement::mediaCanStart): Clear m_isWaitingUntilMediaCanStart
+        and call loadInternal.
+
+2010-03-08  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [GTK] Unreviewed buildfix after r55688.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcStart):
+
+2010-03-08  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [GTK] Unreviewed buildfix after r55688.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::):
+
+2010-03-08  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Unreviewed buildfix after r55688.
+
+        * platform/network/qt/ResourceHandleQt.cpp:
+        (WebCore::ResourceHandle::loadResourceSynchronously):
+
+2010-03-08  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35879
+        Eliminate m_mightDownloadFromHandle
+
+        It was only used on Mac, and unnecessarily complicated the code.
+
+        No change in behavior, thus no test.
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::loadNow):
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::load):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::createResourceHandle):
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::ResourceHandle):
+        (WebCore::ResourceHandle::create):
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::start):
+
+2010-03-02  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Adam Barth.
+
+        Clean up usage of m_failed in open-source image decoders, part 1.
+        https://bugs.webkit.org/show_bug.cgi?id=35411
+        
+        Makes setFailed() virtual so subclasses can override it (none do yet) to
+        do automatic cleanup on failure; makes it return a bool for easy
+        tailcalling; makes failed() the only way to access m_failed so
+        subclasses are assured setFailed() won't be bypassed.  Plus one or two
+        other tiny cleanup bits.
+
+        Overriding setFailed() is coming in a subsequent patch because it can be
+        hairy and needs close review.
+
+        No functional change, so no tests.
+
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::setData):
+        (WebCore::ImageDecoderQt::frameBufferAtIndex):
+        (WebCore::ImageDecoderQt::internalDecodeSize):
+        (WebCore::ImageDecoderQt::internalReadImage):
+        (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+        (WebCore::ImageDecoderQt::forceLoadEverything):
+        (WebCore::ImageDecoderQt::clearPointers):
+        * platform/graphics/qt/ImageDecoderQt.h:
+        * platform/image-decoders/ImageDecoder.h:
+        (WebCore::ImageDecoder::ImageDecoder):
+        (WebCore::ImageDecoder::setData):
+        (WebCore::ImageDecoder::setSize):
+        (WebCore::ImageDecoder::setFailed):
+        (WebCore::ImageDecoder::failed):
+        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+        (WebCore::BMPImageDecoder::isSizeAvailable):
+        (WebCore::BMPImageDecoder::frameBufferAtIndex):
+        (WebCore::BMPImageDecoder::processFileHeader):
+        * platform/image-decoders/gif/GIFImageDecoder.cpp:
+        (WebCore::GIFImageDecoder::setData):
+        (WebCore::GIFImageDecoder::isSizeAvailable):
+        (WebCore::GIFImageDecoder::frameBufferAtIndex):
+        (WebCore::GIFImageDecoder::decode):
+        (WebCore::GIFImageDecoder::initFrameBuffer):
+        * platform/image-decoders/ico/ICOImageDecoder.cpp:
+        (WebCore::ICOImageDecoder::decodeAtIndex):
+        (WebCore::ICOImageDecoder::processDirectory):
+        (WebCore::ICOImageDecoder::processDirectoryEntries):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageReader::decode):
+        (WebCore::JPEGImageDecoder::setData):
+        (WebCore::JPEGImageDecoder::isSizeAvailable):
+        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
+        (WebCore::JPEGImageDecoder::outputScanlines):
+        (WebCore::JPEGImageDecoder::decode):
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::decodingFailed):
+        (WebCore::PNGImageReader::decode):
+        (WebCore::PNGImageDecoder::setData):
+        (WebCore::PNGImageDecoder::isSizeAvailable):
+        (WebCore::PNGImageDecoder::frameBufferAtIndex):
+        (WebCore::PNGImageDecoder::headerAvailable):
+        (WebCore::PNGImageDecoder::rowAvailable):
+        (WebCore::PNGImageDecoder::decode):
+        * platform/image-decoders/png/PNGImageDecoder.h:
+
+2010-03-08  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Disallow WebGL when HW comp is not turned on at runtime
+        https://bugs.webkit.org/show_bug.cgi?id=35759
+
+        When HW comp is turned off with the runtime flag, WebGL would still
+        create a context, but silently fail to render. This prevents that.
+        Now if HW comp is turned off getContext('webgl') will return null.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext):
+
+2010-03-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35876
+
+        Fix minor style issues in HTMLMediaElement and classes derived from it.
+        Made many public members private and protected.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::screenRect): Got rid of a stray "const" and
+        retstructured the function to use early return and get rid of a local.
+
+        * html/HTMLMediaElement.h: Made lots of members private and some
+        protected. Also use private inheritance instead of public. Removed
+        some unneeded includes.
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::parseMappedAttribute): Use player() instead
+        of m_player; HTMLMediaElement data members are now private, not protected.
+        (WebCore::HTMLVideoElement::supportsFullscreen): Ditto.
+        (WebCore::HTMLVideoElement::videoWidth): Ditto.
+        (WebCore::HTMLVideoElement::videoHeight): Ditto.
+        (WebCore::HTMLVideoElement::hasAvailableVideoFrame): Ditto.
+        (WebCore::HTMLVideoElement::webkitEnterFullScreen): Use isFullscreen()
+        instead of m_isFullscreen; same reason.
+        (WebCore::HTMLVideoElement::webkitExitFullScreen): Ditto.
+        (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Ditto.
+
+        * html/HTMLVideoElement.h: Removed an unneeded include. Made many
+        public functions private. Got rid of unused paint function, which was
+        replaced with paintCurrentFrameInContext a while back.
+
+2010-03-08  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30895
+        [Gtk] The accessible hierarchy of tables is significantly incorrect for Atk
+
+        Gives platforms the ability to exclude parts of an AccessibilityTable
+        from the accessible hierarchy.
+
+        * accessibility/gtk/AccessibilityObjectAtk.cpp:
+        (AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/AccessibilityTable.cpp:
+        (AccessibilityTable::addChildren):
+        * accessibility/AccessibilityTableColumn.h:
+        (accessibilityIsIgnored):
+        * accessibility/AccessibilityTableHeaderContainer.h:
+        (accessibilityIsIgnored):
+        * accessibility/AccessibilityTableRow.cpp:
+        (accessibilityIsIgnored):
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        No review. Fix build break on Tiger intel release.
+
+        * html/Blob.cpp:
+        * html/Blob.h:
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Refactor the HostWindow methods for repaint, scroll, invalidate and blit
+        of backingstore and window by eliminating the three bools that currently
+        exist as params of the repaint method.
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        I've added extra methods to provide the hosts with more semantic
+        information of what is being requested thus eliminating the need for
+        these bools.
+
+        No tests as this change should not introduce any behavior changes in any
+        of the ports.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyChromeClient::invalidateContents):
+        (WebCore::EmptyChromeClient::invalidateWindow):
+        (WebCore::EmptyChromeClient::invalidateContentsAndWindow):
+        (WebCore::EmptyChromeClient::invalidateContentsForSlowScroll):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::invalidateContents):
+        (WebCore::Chrome::invalidateWindow):
+        (WebCore::Chrome::invalidateContentsAndWindow):
+        (WebCore::Chrome::invalidateContentsForSlowScroll):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::invalidateRect):
+        * platform/HostWindow.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollContents):
+        (WebCore::ScrollView::wheelEvent):
+
+2010-03-08  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Nate Chapin.
+
+        [V8] Block popups from inline script
+        https://bugs.webkit.org/show_bug.cgi?id=35474
+
+        Apparently, we're supposed to look at the sourceURL to figure out
+        whether we're running a script tag or a hyperlink.  This logic is
+        copied from the JSC version.
+
+        Test: http/tests/security/popup-blocked-from-window-open.html
+
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::processingUserGesture):
+        (WebCore::ScriptController::evaluate):
+
+2010-03-08  Stuart Morgan  <stuartmorgan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Move the details of secure text mode into WebCore/platform.
+        Move the higher-level logic for secure text mode from Frame
+        to SelectionController.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31265
+
+        No new tests: no functional changes.
+
+        * WebCore.gypi:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Document.cpp:
+        (WebCore::Document::setUseSecureKeyboardEntryWhenActive):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::focusedOrActiveStateChanged):
+        (WebCore::SelectionController::updateSecureKeyboardEntryIfActive):
+        (WebCore::SelectionController::setUseSecureKeyboardEntry):
+        * editing/SelectionController.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::setDocument):
+        * page/Frame.h:
+        * platform/SecureTextInput.cpp: Added.
+        (WebCore::enableSecureTextInput):
+        (WebCore::disableSecureTextInput):
+        * platform/SecureTextInput.h: Added.
+        (WebCore::enableSecureTextInput):
+        (WebCore::disableSecureTextInput):
+
+2010-03-08  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Relax the 3rd party cookie policy in cases where it won't add a new tracking vector.
+        <rdar://problem/7163012> and https://bugs.webkit.org/show_bug.cgi?id=35824
+
+        Test: http/tests/cookies/third-party-cookie-relaxing.html
+
+        If the 3rd-party domain in question already has a cookie set, allow changes
+        by setting the first party url of the request to be the url of the request itself:        
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::makeFinalRequest):
+
+        Ditto:
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::start):
+        (WebCore::ResourceHandle::loadResourceSynchronously):
+
+        I've filed <rdar://problem/7728508> to track changing the policy in our networking layer.
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+        
+        The following semantic is adopted per the discussions on public-webapps:
+        1) File.slice() does a synchronous IO to capture the current size and
+           modification time and cache them in the resulting Blob.
+        2) Subsequent Blob operations, like Blob.slice and Blob.size simply
+           use the cached values.
+        3) When the underlying file data are accessed, like in XHR.send(), the
+           UA will check the cached modification time against the current
+           modification time to determine if the file has been changed or not.
+           An error or exception will be thrown if needed.
+
+        Also add ENABLE_BLOB_SLICE feature define.
+
+        Test: http/tests/local/send-sliced-dragged-file.html
+
+        * Configurations/FeatureDefines.xcconfig:
+        * GNUmakefile.am:
+        * WebCore.pri:
+        * html/Blob.cpp:
+        (WebCore::Blob::Blob):
+        (WebCore::Blob::size):
+        (WebCore::Blob::slice):
+        * html/Blob.h:
+        (WebCore::Blob::start):
+        (WebCore::Blob::length):
+        (WebCore::Blob::modificationTime):
+        * html/Blob.idl:
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::deepCopy):
+        (WebCore::FormData::appendFile):
+        (WebCore::FormData::appendFileRange):
+        * platform/network/FormData.h:
+        (WebCore::FormDataElement::FormDataElement):
+        (WebCore::operator==):
+        * platform/network/mac/FormDataStreamMac.mm:
+        (WebCore::advanceCurrentStream):
+        (WebCore::openNextStream):
+        (WebCore::formCreate):
+        (WebCore::formOpen):
+        (WebCore::formRead):
+        (WebCore::setHTTPBody):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+
+2010-03-08  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34819
+
+        Fixes an issue where we repaint the caret rectangle even if the associated
+        selection is not in a content editable element. This is extraneous since the
+        caret is only visible when the selection is in a content editable element.
+        Hence, we should only repaint the caret rectangle when the associated selection
+        is in a content editable element.
+
+        Note, we always paint the caret when caret browsing is enabled.
+
+        Test: fast/repaint/no-caret-repaint-in-non-content-editable-element.html
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::recomputeCaretRect): Modified to call method
+        SelectionController::shouldRepaintCaret.
+        (WebCore::SelectionController::shouldRepaintCaret): Added.
+        (WebCore::SelectionController::invalidateCaretRect): Modified to call method
+        SelectionController::shouldRepaintCaret.
+        * editing/SelectionController.h:
+
+2010-03-08  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Darin Adler.
+
+        YouTube HTML5 video never starts playing on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=33954
+
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
+        (WebCore::MediaPlayerPrivate::rfc2616DateStringFromTime): New, create an rfc 2616 formatted
+        string for an absolute time value.
+        (WebCore::addCookieParam): New, add a cookie param and value to a string builder.
+        (WebCore::MediaPlayerPrivate::setUpCookiesForQuickTime): Copy cookies for the movie to
+            be loaded from CFNetwork into WinINet so they are available when QuickTime tries to
+            download the movie.
+        (WebCore::MediaPlayerPrivate::load): Call setupCookiesForQuickTime.
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
+
+2010-03-08  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove the now-redundant Settings fields for the Database
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        No new tests; this code isn't called.
+
+        * WebCore.base.exp:
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+
+2010-03-07  David Levin  <levin@chromium.org>
+
+        Chromium Linux build fix.
+
+        * platform/graphics/chromium/FontPlatformDataLinux.h: Add "class String" since a debug
+        only method returns a String.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Chromium build fix.
+
+        * platform/chromium/ClipboardChromium.cpp: Include Image.h since we're using WebCore::Image.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Gtk build fix.
+
+        * platform/network/soup/ResourceHandleSoup.cpp: Include SharedBuffer.h since we're using WebCore::SharedBuffer.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Gtk build fix.
+
+        * platform/graphics/gtk/ImageGtk.cpp: Include SharedBuffer.h since we're using WebCore::SharedBuffer.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Fix builds where USE_CG_SHADING is set.
+
+        * platform/graphics/cg/GradientCG.cpp: Include wtf/RetainPtr.h since WTF::RetainPtr is used when USE_CG_SHADING is set.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Windows build fix.  Add some required includes.
+
+        * platform/graphics/win/ImageCGWin.cpp:
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        * platform/win/ClipboardWin.cpp:
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Gtk build fix.
+
+        * platform/graphics/GraphicsContext.h: Include wtf/PassOwnPtr.h since some platforms use WTF::PassOwnPtr in this header.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Qt build fix.
+
+        * platform/network/qt/ResourceHandleQt.cpp: Include SharedBuffer.h since we're using WebCore::SharedBuffer.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Gtk build fix.
+
+        * platform/gtk/ClipboardGtk.cpp: Include Image.h since we're using WebCore::Image.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Cameron Zwarich.
+
+        Remove unnecessary includes from header files, adding them to the handful of implementation files that need them.
+
+        * loader/CachedCSSStyleSheet.cpp:
+        * loader/CachedFont.cpp:
+        * loader/CachedImage.cpp:
+        * loader/CachedResource.cpp:
+        * loader/CachedResource.h:
+        * loader/CachedScript.cpp:
+        * loader/CachedXSLStyleSheet.cpp:
+        * loader/icon/IconFetcher.cpp:
+        * loader/loader.cpp:
+        * page/Page.cpp:
+        * platform/graphics/Image.cpp:
+        * platform/graphics/Image.h:
+        * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        * platform/graphics/cg/PathCG.cpp:
+        * platform/graphics/mac/ImageMac.mm:
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Chromium build fix.
+
+        * platform/chromium/ChromiumDataObject.h: Include SharedBuffer.h since the inline constructor of this
+        class means that the pointed-to type of the RefPtr member must be available.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Qt build fix.
+
+        * platform/network/qt/DnsPrefetchHelper.cpp: Include PlatformString.h since we're using WebCore::String.
+
+2010-03-07  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix a bug that validity.valueMissing for a radio button with required
+        in a form element always returns true.
+        https://bugs.webkit.org/show_bug.cgi?id=35472
+
+        Test: fast/forms/ValidityState-valueMissing-radio.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::checkedRadioButtons): Move the location to be used by valueMissing().
+        (WebCore::HTMLInputElement::valueMissing):
+          Use checkedRadioButtons() instead of document()->checkedRadioButtons().
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Cameron Zwarich.
+
+        Remove unnecessary includes from header files, adding them to the handful of implementation files that need them.
+
+        * bindings/objc/DOM.mm:
+        * loader/CachedImage.h:
+        * loader/EmptyClients.h:
+        * platform/graphics/GlyphPageTreeNode.cpp:
+        * platform/text/CString.h:
+        * platform/text/String.cpp:
+        * platform/text/mac/TextCodecMac.cpp:
+        * svg/graphics/SVGResourceFilter.h:
+        * svg/graphics/filters/SVGFEImage.h:
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Completely remove two files that were deleted in r55635 from the Xcode project.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-07  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Remove inconsistent "Too few arguments" handling for window.atob() and window.btoa()
+        https://bugs.webkit.org/show_bug.cgi?id=35848
+
+        - Take the opportunity to fully autogenerate window.atob() and window.btoa().
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::btoa):
+        (WebCore::DOMWindow::atob):
+        * page/DOMWindow.idl:
+
+2010-03-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/7722008> Column breaking ignores floats
+        https://bugs.webkit.org/show_bug.cgi?id=35837
+
+        Test: fast/multicol/float-truncation.html
+
+        Introduce an earlier column-break if otherwise a float that could fit
+        inside a single column will be split between columns.
+
+        It is still possible for floats to be needlessly broken if initially
+        they fit in the column, but normal flow truncation then shortens the
+        column.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::visibleTopOfHighestFloatExtendingBelow): Added.
+        Returns the visible top of the highest descendant float that visibly
+        extends below the given y offset, ignoring floats that are taller than
+        the given maximum height.
+        (WebCore::RenderBlock::layoutColumns): If the initial column height
+        would cause a float to be split, truncate above the float.
+        * rendering/RenderBlock.h:
+
+2010-03-07  Dmitry Titov  <dimich@chromium.org>
+
+        Not reviewed. Revert of r55593 which caused a regression of worker-cloneports.html.
+
+        REGRESSION(55593?): fast/workers/worker-cloneport.html is timing out on Leopard
+        https://bugs.webkit.org/show_bug.cgi?id=35819
+
+        * Android.jscbindings.mk:
+        * Android.v8bindings.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        * bindings/js/JSDatabaseCallback.cpp: Removed.
+        * bindings/js/JSDatabaseCallback.h: Removed.
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * bindings/v8/custom/V8DatabaseCallback.cpp: Removed.
+        * bindings/v8/custom/V8DatabaseCallback.h: Removed.
+        * dom/Document.cpp:
+        (WebCore::Document::postTask):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * storage/Database.cpp:
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        * storage/Database.h:
+        * storage/DatabaseCallback.h: Removed.
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+
+2010-03-06  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Remove unnecessary includes of wtf/Platform.h.  This is already pulled in by config.h.
+
+        * accessibility/AccessibilityObject.h:
+        * dom/XMLTokenizer.cpp:
+        * dom/XMLTokenizerLibxml2.cpp:
+        * dom/XMLTokenizerQt.cpp:
+        * editing/TextAffinity.h:
+        * loader/FrameLoaderClient.h:
+        * page/FocusController.cpp:
+        * page/FrameTree.cpp:
+        * page/Geolocation.h:
+        * page/PositionCallback.h:
+        * page/PositionErrorCallback.h:
+        * platform/Cursor.h:
+        * platform/FileSystem.h:
+        * platform/FloatConversion.h:
+        * platform/KeyboardCodes.h:
+        * platform/PlatformKeyboardEvent.h:
+        * platform/PlatformTouchPoint.h:
+        * platform/SuddenTermination.h:
+        * platform/Widget.h:
+        * platform/graphics/Color.h:
+        * platform/graphics/FloatPoint.h:
+        * platform/graphics/FloatSize.h:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/IntPoint.h:
+        * platform/graphics/IntRect.h:
+        * platform/graphics/IntSize.h:
+        * platform/graphics/openvg/PainterOpenVG.h:
+        * platform/graphics/openvg/SurfaceOpenVG.h:
+        * platform/network/ResourceHandleClient.h:
+        * platform/text/Base64.cpp:
+        * rendering/style/SVGRenderStyle.h:
+        * xml/XSLTProcessor.cpp:
+        * xml/XSLTProcessorLibxslt.cpp:
+        * xml/XSLTProcessorQt.cpp:
+
+2010-03-06  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Move debug only JS wrapper-set tracking code into its own file.
+        https://bugs.webkit.org/show_bug.cgi?id=35839
+
+        * GNUmakefile.am: Added new files.
+        * WebCore.gypi: Ditto.
+        * WebCore.pro: Ditto.
+        * WebCore.vcproj/WebCore.vcproj: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::cacheDOMObjectWrapper):
+        (WebCore::forgetDOMObject):
+        (WebCore::forgetDOMNode):
+        (WebCore::cacheDOMNodeWrapper):
+        (WebCore::takeWrappers):
+        (WebCore::updateDOMNodeDocument):
+        Updated for new signature for willCacheWrapper and didUncacheWrapper.
+
+        * bindings/js/JSDOMWrapper.cpp: Added.
+        (WebCore::DOMObject::~DOMObject):
+        (WebCore::DOMObject::defineOwnProperty):
+        Moved from JSDOMBinding.cpp.
+
+        * bindings/js/JSDebugWrapperSet.cpp: Added.
+        (WebCore::JSDebugWrapperSet::shared):
+        (WebCore::JSDebugWrapperSet::JSDebugWrapperSet):
+        * bindings/js/JSDebugWrapperSet.h: Added.
+        (WebCore::JSDebugWrapperSet::add):
+        (WebCore::JSDebugWrapperSet::remove):
+        (WebCore::JSDebugWrapperSet::contains):
+        (WebCore::JSDebugWrapperSet::willCacheWrapper):
+        (WebCore::JSDebugWrapperSet::didUncacheWrapper):
+        Moved from JSDOMBinding.cpp.
+
+2010-03-06  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Dan Bernstein.
+
+        Move DOMObjectHashTableMap, DOMWrapperWorld and WebCoreJSClientData into
+        their own files.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/DOMObjectHashTableMap.cpp: Copied from bindings/js/JSDOMBinding.cpp.
+        * bindings/js/DOMObjectHashTableMap.h: Copied from bindings/js/JSDOMBinding.h.
+        (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap):
+        (WebCore::DOMObjectHashTableMap::get):
+        * bindings/js/DOMWrapperWorld.cpp: Copied from bindings/js/JSDOMBinding.cpp.
+        (WebCore::forgetWorldOfDOMNodesForDocument):
+        * bindings/js/DOMWrapperWorld.h: Copied from bindings/js/JSDOMBinding.h.
+        (WebCore::DOMWrapperWorld::create):
+        (WebCore::DOMWrapperWorld::rememberDocument):
+        (WebCore::DOMWrapperWorld::forgetDocument):
+        (WebCore::DOMWrapperWorld::isNormal):
+        (WebCore::debuggerWorld):
+        (WebCore::pluginWorld):
+        (WebCore::currentWorld):
+        (WebCore::Document::getWrapperCache):
+        * bindings/js/JSDOMBinding.cpp:
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMWindowBase.cpp:
+        * bindings/js/ScriptController.cpp:
+        * bindings/js/WebCoreJSClientData.h: Copied from bindings/js/JSDOMBinding.h.
+        (WebCore::WebCoreJSClientData::WebCoreJSClientData):
+        (WebCore::WebCoreJSClientData::~WebCoreJSClientData):
+        (WebCore::WebCoreJSClientData::normalWorld):
+        (WebCore::WebCoreJSClientData::getAllWorlds):
+        (WebCore::WebCoreJSClientData::rememberWorld):
+        (WebCore::WebCoreJSClientData::forgetWorld):
+        * bindings/js/WorkerScriptController.cpp:
+
+2010-03-06  Dan Bernstein  <mitz@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Remove an unused method.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock): Changed comment.
+        (WebCore::RenderBlock::floatRect): Removed.
+        * rendering/RenderBlock.h: Removed floatRect().
+
+2010-03-06  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: make timeline overview bars transparent to mouse events.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35832
+
+        * inspector/front-end/inspector.css:
+
+2010-03-06  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Web Inspector: switching to/from Timeline Panel moves scroller.
+        (Also added couple of record details items as I was fixing it).
+
+        https://bugs.webkit.org/show_bug.cgi?id=35829
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype.get defaultFocusedElement):
+        (WebInspector.TimelinePanel.prototype.show):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+
+2010-03-06  Patrick Gansterer  <paroga@paroga.com>
+
+        Reviewed by Eric Seidel.
+
+        Removed unnecessary WinCE file.
+        The same functionality is provided by platform/win/SystemTimeWin.cpp.
+        https://bugs.webkit.org/show_bug.cgi?id=35799
+
+        * platform/wince/SystemTimeWince.cpp: Removed.
+
+2010-03-06  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30895
+        [Gtk] The accessible hierarchy of tables is significantly incorrect for Atk
+
+        This completes the fixing of the Atk table hierarchy which was started
+        in bug #35418.
+
+        * accessibility/gtk/AccessibilityObjectAtk.cpp:
+        (AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (AccessibilityRenderObject::determineAccessibilityRole):
+
+2010-03-06  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Darin Adler.
+
+        Moved implementations of window.btoa() and window.atob() from
+        JSDOMWindow to DOMWindow, and make V8DOMWindow use DOMWindow
+        functions instead of having a separate implementation. As a side effect, the
+        error message has changed from "Cannot decode base64" to one that
+        indicates DOM Exception, which is compatible to Firefox.
+        
+        Refactoring: window.btoa() and window.atob() should be implemented on DOMWindow
+        https://bugs.webkit.org/show_bug.cgi?id=35723
+
+        No new test. No new functionality.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::atob):
+        (WebCore::JSDOMWindow::btoa):
+        Moved conversion code to DOMWindow and invoke it. Argument
+        checking remains here.
+        
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::atobCallback):
+        (WebCore::V8DOMWindow::btoaCallback):
+        Remove conversion code and call DOMWindow APIs. Although argument
+        checking remains here.
+        
+        * page/DOMWindow.cpp:
+        (WebCore::hasMultibyteCharacters):
+        (WebCore::DOMWindow::btoa):
+        (WebCore::DOMWindow::atob):
+        * page/DOMWindow.h:
+        Moved Conversion code from JSDOMWindow, modifing to fit JSC independent.
+
+2010-03-06  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix decoration position in search input field.
+
+        This patch fixes rendering of input field of "search" type, whose decoration
+        (loupe icon and close button) was wrongly positioned when the input field was
+        contained in a block with -webkit-transform property.
+
+        Chromium bug: http://crbug.com/20439
+
+        [Chromium] Decoration of "search" input field is wrongly rendered
+        https://bugs.webkit.org/show_bug.cgi?id=30245
+
+        No new tests, since this patch fixes an existing test
+        (fast/forms/search-transformed.html) in Chromium layout tests.
+
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::convertToPaintingRect): Added. This method
+        does almost the same thing as RenderThemeMac::convertToPaintingRect.
+        (WebCore::RenderThemeChromiumSkia::paintSearchFieldCancelButton): The position
+        of the icon should not depend on its absolute position.
+        (WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsDecoration): Ditto.
+        (WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsButton): Ditto.
+        * rendering/RenderThemeChromiumSkia.h: Added new method.
+
+2010-03-06  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: in Timeline panel, click followed with mouse move resets popover.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35827
+
+        * inspector/front-end/Popover.js:
+        (WebInspector.PopoverHelper.prototype._mouseDown):
+        (WebInspector.PopoverHelper.prototype._mouseMove):
+        (WebInspector.PopoverHelper.prototype._handleMouseAction):
+
+2010-03-05  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33247
+        Backwards cursor movement incorrect when previous block ends with <br>.
+
+        If the cursor is trying to move into a node that has a height of 0,
+        skip over it.
+
+        Test: editing/execCommand/move-selection-back-line.html
+
+        * editing/visible_units.cpp:
+        (WebCore::previousLinePosition):
+
+2010-03-05  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Enable resource loading callback while loading worker scripts
+        https://bugs.webkit.org/show_bug.cgi?id=35744
+
+        * workers/WorkerScriptLoader.cpp:
+        (WebCore::WorkerScriptLoader::loadSynchronously):
+        (WebCore::WorkerScriptLoader::loadAsynchronously):
+
+2010-03-05  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Eric Seidel.
+
+        WAI-ARIA live region doesn't appear when <div> only has a <div> child
+        https://bugs.webkit.org/show_bug.cgi?id=35751
+
+        Elements should not be ignored if they carry ARIA attributes in them.
+
+        Test: platform/mac/accessibility/div-containing-div-with-aria.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::supportsARIAAttributes):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::supportsARIADropping):
+        (WebCore::AccessibilityObject::supportsARIADragging):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::supportsARIADropping):
+        (WebCore::AccessibilityRenderObject::supportsARIADragging):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        * accessibility/AccessibilityRenderObject.h:
+
+2010-03-05  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Oliver Hunt.
+
+        Add a manual test for crash in DOMWindow::clearTimeout when DOMWindow is not connected to Frame
+        https://bugs.webkit.org/show_bug.cgi?id=32353
+
+        * manual-tests/clearTimeout-crash-bug29832.html: Added.
+
+2010-03-05  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by David Levin.
+
+        [v8] Remove wrong assert in GC callback
+        https://bugs.webkit.org/show_bug.cgi?id=35757
+
+        Test: fast/workers/wrapper-map-gc.html
+
+        * bindings/v8/DOMData.h:
+        (WebCore::DOMData::handleWeakObject): remove ASSERT(isMainThread()), move another assert up to verify we are on the right thread.
+
+2010-03-05  Alex Milowski  <alex@milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added support for row layout with stretchy operators and
+        adjusted the over spacing for over and underover accordingly.
+
+        Tests: mathml/presentation/mo.xhtml
+               mathml/presentation/row.xhtml
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * mathml/MathMLInlineContainerElement.cpp:
+        * mathml/MathMLTextElement.cpp:
+        * mathml/RenderMathMLMath.cpp: Added.
+        * mathml/RenderMathMLMath.h: Added.
+        * mathml/RenderMathMLOperator.cpp: Added.
+        * mathml/RenderMathMLOperator.h: Added.
+        * mathml/RenderMathMLRow.cpp: Added.
+        * mathml/RenderMathMLRow.h: Added.
+        * mathml/RenderMathMLUnderOver.cpp:
+        * mathml/mathtags.in:
+
+2010-03-05  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35772
+        Animation fill modes should be supported in the shorthand property
+
+        Add CSSPropertyWebkitAnimationFillMode to the list of properties
+        evaluated in the -webkit-animation shorthand.
+
+        Test: animations/animation-shorthand.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseAnimationShorthand):
+
+2010-03-05  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Simon Fraser
+
+        https://bugs.webkit.org/show_bug.cgi?id=35815
+        Animation Fill Modes fail on Windows
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        * css/CSSStyleSelector.cpp:
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+            - use new enum value
+        * platform/animation/Animation.h:
+            - change bitfield type
+        * rendering/style/RenderStyleConstants.h:
+            - add new enum for fill mode
+
+2010-03-05  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed buildfix after r55593. (To fix Qt --minimal build.)
+
+        * bindings/js/JSDOMWindowCustom.cpp: Missing #if ENABLE(DATABASE) guard added.
+
+2010-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        ASSERTION FAILED: rootLayer == m_clipRectsRoot at hulu.com
+        https://bugs.webkit.org/show_bug.cgi?id=34065
+        <rdar://problem/7573509>
+        
+        Fix one instance of this assertion (not necessarily the one seen on hulu.com).
+        
+        If the layer that clippingRoot() is being called on is itself compositing,
+        then it acts as the clipping root. Without this, calls to RenderLayer::childrenClipRect()
+        and RenderLayer::selfClipRect() via FrameView::windowClipRectForLayer(), for plug-ins,
+        caused the caching of an incorrect clip rects root.
+
+        Test: compositing/geometry/object-clip-rects-assertion.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::clippingRoot):
+
+2010-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Child clipping compositing layers don't show the blue debug color
+        https://bugs.webkit.org/show_bug.cgi?id=35807
+
+        Set a layer owner on the GraphicsLayers created for clipping children,
+        so that they can get to the debug settings that give them the blue color.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateClippingLayers):
+
+2010-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        MobileMe movie page is missing playback controls
+        https://bugs.webkit.org/show_bug.cgi?id=35805
+        <rdar://problem/7653169>
+        
+        On pages with video or plug-ins, we run overlap tests to determine which layers
+        need to be composited. There was an ordering dependency bug in
+        RenderLayerCompositor::computeCompositingRequirements() that caused us to fail
+        to detect that a layer needed to be composited, resulting in page content
+        not being visible.
+        
+        Specifically, layer->setHasCompositingDescendant() can change the answer
+        to needsToBeComposited(), when a layer has to clip compositing descendants.
+        So if we change setHasCompositingDescendant(), then we need to re-test
+        clipsCompositingDescendants() and add the layer to the overlap map if so.
+
+        Test: compositing/overflow/overflow-compositing-descendant.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
+2010-03-04  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Adding support for the optional creation callback that could be
+        passed to openDatabase().
+
+        Test: storage/open-database-creation-callback.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=34726
+
+        * Android.jscbindings.mk
+        * Android.v8bindings.mk
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/js/JSDatabaseCallback.cpp: Added.
+        (WebCore::JSDatabaseCallback::JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::~JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::handleEvent):
+        * bindings/js/JSDatabaseCallback.h: Added.
+        (WebCore::JSDatabaseCallback::create):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openDatabaseCallback):
+        * bindings/v8/custom/V8DatabaseCallback.cpp: Added.
+        (WebCore::V8DatabaseCallback::V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::~V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::handleEvent):
+        * bindings/v8/custom/V8DatabaseCallback.h: Added.
+        (WebCore::V8DatabaseCallback::create):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * storage/Database.cpp:
+        (WebCore::DatabaseCreationCallbackTask::create):
+        (WebCore::DatabaseCreationCallbackTask::performTask):
+        (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        (WebCore::Database::performCreationCallback):
+        * storage/Database.h:
+        (WebCore::Database::isNew):
+        * storage/DatabaseCallback.h: Added.
+        (WebCore::DatabaseCallback::~DatabaseCallback):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+
+2010-03-05  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed infinite recursion of composited video on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=35798
+        
+        Due to a change in the way we get the platformLayer (WKCACFLayer)
+        for video, the mediaplayer was in an infinite loop with WKCACFLayer
+        bouncing notifySyncRequired calls back and forth. After discussion
+        we decided it would be better to avoid notifySyncRequired entirely,
+        which would walk up through WebCore calls and back down through
+        WebKit calls to tell the WKCACFLayerRenderer to kick off a render cycle.
+        
+        I subclassed WKCACFLayer into a WKCACFRootLayer which has a pointer to
+        the WKCACFLayerRenderer. When something changes, we get the rootLayer()
+        by walking up the layers and make a virtual call which WKCACFRootLayer
+        implements to tell WKCACFLayerRenderer to render.
+        
+        I also got rid of GraphicsLayer knowledge from WKCACFLayer. GraphicsLayerCACF
+        now makes a WebLayer subclass which implements the drawInContext()
+        virtual method.
+        
+        I also had to add protection to the platformLayer() call in 
+        MediaPlayerPrivateQuickTimeWin because it gets called earlier than before
+        when the layer is still null.
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:Implement WebLayer
+        (WebCore::WebLayer::create):
+        (WebCore::WebLayer::drawInContext):
+        (WebCore::WebLayer::WebLayer):
+        (WebCore::GraphicsLayerCACF::GraphicsLayerCACF):
+        (WebCore::GraphicsLayerCACF::setNeedsDisplayInRect):
+        (WebCore::GraphicsLayerCACF::updateLayerPreserves3D):
+        (WebCore::GraphicsLayerCACF::updateContentsImage):
+        * platform/graphics/win/GraphicsLayerCACF.h:
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:Protect platformLayer from a null qtLayer
+        (WebCore::MediaPlayerPrivate::platformLayer):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:Got rid of no longer needed method
+        (WebCore::MediaPlayerPrivate::notifyAnimationStarted):
+        * platform/graphics/win/WKCACFLayer.cpp:Got rid of GraphicsLayer dependency. Made virtual.
+        (WebCore::displayCallback):
+        (WebCore::WKCACFLayer::create):
+        (WebCore::WKCACFLayer::WKCACFLayer):
+        (WebCore::WKCACFLayer::setNeedsCommit):
+        (WebCore::WKCACFLayer::setNeedsDisplay):
+        * platform/graphics/win/WKCACFLayer.h:
+        (WebCore::WKCACFLayer::setNeedsRender):
+        (WebCore::WKCACFLayer::drawInContext):
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:Create WKCACFRootLayer which tells WKCACFLayerRenderer to render
+        (WebCore::WKCACFRootLayer::WKCACFRootLayer):
+        (WebCore::WKCACFRootLayer::create):
+        (WebCore::WKCACFRootLayer::setNeedsRender):
+        (WebCore::WKCACFRootLayer::setNeedsDisplay):
+        (WebCore::WKCACFLayerRenderer::rootLayer):
+        (WebCore::WKCACFLayerRenderer::setRootChildLayer):
+        (WebCore::WKCACFLayerRenderer::setNeedsDisplay):
+        (WebCore::WKCACFLayerRenderer::createRenderer):
+        * platform/graphics/win/WKCACFLayerRenderer.h:
+
+2010-03-05  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] Missing commas in WebCore.gypi file make building Geo unpossible.
+        https://bugs.webkit.org/show_bug.cgi?id=35797
+
+        No new tests, this is a latent compile break.
+
+        * WebCore.gypi:
+
+2010-03-04  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        <rdar://problem/7718442> Implement 'preload=none'
+        https://bugs.webkit.org/show_bug.cgi?id=35789
+
+        Don't load any media data when preload is 'none'.
+
+        Test: media/video-preload.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::loadResource): Don't call player's setPreload method
+            when autoplay is set.
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::setPreload): Set m_preload so we have the correct value when
+            the media engine is created.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Initialize m_preload.
+        (WebCore::MediaPlayerPrivate::resumeLoad): New, kick off postponed a load.
+        (WebCore::MediaPlayerPrivate::load): Do nothing if preload is 'none'
+        (WebCore::MediaPlayerPrivate::loadInternal): New, complete loading.
+        (WebCore::MediaPlayerPrivate::prepareToPlay): New, resume a postponed load as someone
+            has called play().
+        (WebCore::MediaPlayerPrivate::setPreload): New, set m_preload.
+
+2010-03-04  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Give CodeGeneratorV8.pm a much-needed spring cleaning.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35697
+
+        * bindings/scripts/CodeGeneratorV8.pm: Remove unused code, fix style issues, make less hard-coded.
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::addEventListenerCallback):
+        (WebCore::V8DOMWindow::removeEventListenerCallback):
+
+2010-03-05  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Roll back r55522 since it regreses performance
+        according to chromium's page cycler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+2010-03-05  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Simon Fraser and Chris Marrin.
+
+        Bug 26869: Add fill modes for CSS Animations
+        https://bugs.webkit.org/show_bug.cgi?id=26869
+
+        Tests: animations/fill-mode-removed.html
+               animations/fill-mode-transform.html
+               animations/fill-mode.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        * css/CSSParser.cpp:
+        * css/CSSParser.h:
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        * css/CSSStyleSelector.h:
+        * css/CSSValueKeywords.in:
+            - parse, assign and retrieve the value of the new
+              -webkit-animation-fill-mode property
+        * page/animation/AnimationBase.cpp:
+        * page/animation/AnimationBase.h:
+            - new state in animation engine for a finished animation
+              that is "filling" forwards in time. This allows the
+              engine to keep the animation around and not revert to the
+              old style.
+            - update the timer code to indicate it doesn't need to
+              keep animating if it is filling
+            - now that animations can extend beyond their elapsed time,
+              make sure progress works correctly with iteration counts
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::animate):
+            - ensure correct style value is returned at the right
+              time by checking for fill mode
+        (WebCore::KeyframeAnimation::onAnimationEnd):
+            - continue to send the end event, but only remove the
+              animation if it isn't filling forwards
+        * platform/animation/Animation.cpp:
+        * platform/animation/Animation.h:
+            - new fill mode member property
+        * platform/animation/AnimationList.cpp:
+            - ensure the fill mode is propagated to a list of style valus
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+            - make hardware layers use Core Animation's fill mode
+
+2010-03-05  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Do not show link helper in popovers and/or for external resources.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35785
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._scriptOrResourceForURLAndLine):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype.hide):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentMouseOver):
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+        (WebInspector.addMainEventListeners):
+
+2010-03-05  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebSocket onmessageerror event handler
+        https://bugs.webkit.org/show_bug.cgi?id=35570
+
+        Test: websocket/tests/error-detect.html
+
+        * websockets/WebSocket.cpp:
+        (WebCore::WebSocketChannel::didConnect): assert scriptExecutionContext.
+        (WebCore::WebSocketChannel::didReceiveMessage): assert scriptExecutionContext.
+        (WebCore::WebSocket::didReceiveMessageError):
+        (WebCore::WebSocket::didClose): assert scriptExecutionContext.
+        * websockets/WebSocket.h:
+        * websockets/WebSocket.idl: Add onerror event listener
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didReceiveData): call didReceiveMessageError if unknown frame tye is detected, or frame length overflowed.
+        * websockets/WebSocketChannelClient.h:
+        (WebCore::WebSocketChannelClient::didReceiveMessageError):
+
+2010-03-04  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Changing private members from PlatformTouchEvent and PlatformTouchPoint
+        to be protected, so that Chromium's PlatformTouchEventBuilder and
+        PlatformTouchPointBuilder can access them. Exercised by the
+        fast/events/touch tests.
+        https://bugs.webkit.org/show_bug.cgi?id=35760
+
+        * platform/PlatformTouchEvent.h:
+        (WebCore::PlatformTouchEvent::~PlatformTouchEvent):
+        * platform/PlatformTouchPoint.h:
+        (WebCore::PlatformTouchPoint::~PlatformTouchPoint):
+
+2010-03-04  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebSocket crash bug when reloading the page while the WebSocket is busy
+        https://bugs.webkit.org/show_bug.cgi?id=35732
+
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::disconnect): clear m_context from WebSocketChannel and WebSocketHandshake.
+        (WebCore::WebSocketChannel::didOpen): check m_context
+        (WebCore::WebSocketChannel::didClose): clear m_context
+        (WebCore::WebSocketChannel::didReceiveData): check m_context, and check m_client early before appending to buffer
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::clearScriptExecutionContext): Added.
+        * websockets/WebSocketHandshake.h:
+
+2010-03-04  MORITA Hajime <morrita@google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Refactoring: XMLHTTPRequest.open() should have all overloaded implementations
+        https://bugs.webkit.org/show_bug.cgi?id=35630
+
+        Test: http/tests/xmlhttprequest/open-async-overload.html
+
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::open):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::openCallback):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::open):
+        * xml/XMLHttpRequest.h:
+
+2010-03-04  James Robinson  <jamesr@google.com>
+
+        Reviewed by Eric Seidel.
+
+        Styles do not have to be synchronously rematched after every event dispatch
+
+        https://bugs.webkit.org/show_bug.cgi?id=32580
+
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::handleEvent):
+
+2010-03-04  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        maemo spelled as mameo in WebCore.pro
+        https://bugs.webkit.org/show_bug.cgi?id=35765
+
+        Spelling corrected.
+
+        * WebCore.pro:
+
+2010-03-04  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=18819
+        Pressing option+page{down,up} should move the cursor and scroll in
+        content editable areas.  On other platforms, pressing page{down,up}
+        should move the cursor and scroll in content editable areas.
+
+        Test: editing/input/option-page-up-down.html
+
+        * editing/EditorCommand.cpp:
+        (WebCore::verticalScrollDistance):
+
+2010-03-03  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        Allow static property getters to interact with JSCs caching
+        https://bugs.webkit.org/show_bug.cgi?id=35716
+
+        Update the obviously safe getters to allow caching
+
+        Test: fast/js/pic/cached-named-property-getter.html
+
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::getOwnPropertySlot):
+        * bridge/runtime_method.cpp:
+        (JSC::RuntimeMethod::getOwnPropertySlot):
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7717249> DOMSVG.h includes a non-existent DOMSVGFEMorphologyElement.h
+
+        * WebCore.xcodeproj/project.pbxproj: Copy DOMSVGFEMorphologyElement.h and DOMSVGFEMorphologyElementInternal.h
+        in to the framework wrapper.
+
+2010-03-04  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Handles setting HTMLSelectElement.length with mutation handlers present
+        https://bugs.webkit.org/show_bug.cgi?id=33983
+
+        When setting an HTMLSelectElement's length attribute, option elements have to be added or removed to the select
+        as appropriate.  This is a little tricky with mutation events since they might add, remove, or reorder elements
+        while option elements are being added or deleted.
+
+        Tests: fast/forms/select-set-length-optgroup.html
+               fast/forms/select-set-length-with-mutation-remove.html
+               fast/forms/select-set-length-with-mutation-reorder.html
+               fast/forms/select-set-length-with-mutation-reparent.html
+               fast/forms/select-set-length-with-mutation.html
+               fast/forms/select-set-length.html
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::setLength):
+
+2010-03-04  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Unreviewed buildfix after r55542 on Windows.
+
+        * WebCore.pro:
+         - plugins/win/PluginDatabaseWin.cpp removed.
+         - platform/win/WebCoreInstanceHandle.cpp added.
+
+        * platform/win/WebCoreInstanceHandle.cpp: Remove explicit qualification in namespace declaration to make gcc happy.
+
+2010-03-04  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix the case where we do a same document navigation, scroll,
+        then repeat the same document navigation.  Currently, the second
+        navigation does nothing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35547
+
+        Test: fast/loader/repeat-same-document-navigation.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadInSameDocument): Call scrollToFragment() whether or not the hash changed.
+
+2010-03-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Build fix.
+        
+        const long long cMaxDistance = numeric_limits<long long>::max() created global
+        initializers at the call sites, so replace with an inline function.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+        * page/SpatialNavigation.cpp:
+        (WebCore::distanceInDirection):
+        * page/SpatialNavigation.h:
+        (WebCore::maxDistance):
+        (WebCore::FocusCandidate::FocusCandidate):
+
+2010-03-04  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Unreviewed attempt to fix Windows build.
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::spatialDistance):
+
+2010-03-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Build fix.
+
+        Delcare updateFocusCandidateIfCloser static to avoid warning.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfCloser):
+
+2010-03-04  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        [chromium] make history.{push,replace}State enabled at runtime
+        https://bugs.webkit.org/show_bug.cgi?id=35753
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setPushStateEnabled):
+        (WebCore::RuntimeEnabledFeatures::pushStateEnabled):
+        (WebCore::RuntimeEnabledFeatures::replaceStateEnabled):
+        * page/History.idl:
+
+2010-03-04  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Unreviewed attempt to (again) fix Mac build.
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::spatialDistance):
+
+2010-03-04  Dan Bernstein  <mitz@apple.com>
+
+        Based on a patch from Nick Jong.
+
+        Reviewed by Simon Fraser.
+
+        Improve selection in multi-column blocks when hitting points above or
+        below a column rect.
+
+        Test: fast/multicol/hit-test-above-or-below.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::adjustPointToColumnContents): If the point lies
+        within the horizontal range for a column, constrain it to the column (if
+        it is above) or the next column (if it is below).
+
+2010-03-04  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Attempt to fix Mac build.
+
+        * page/SpatialNavigation.cpp:
+
+2010-03-04  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Add SpatialNavigation header and cpp to Mac XCode project file.
+
+        Reviewed by Kenneth Christiansen.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-02  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser, Eric Seidel and Darin Adler.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+        Based on the initial work of Marco Barisione <marco.barisione@collabora.co.uk>
+
+        Extend keyboard navigation to allow directional navigation
+        https://bugs.webkit.org/show_bug.cgi?id=18662
+
+        This patch implements the core logic of the 'Spatial Navigation' feature [1].
+        It improves the accessibility support of WebCore by extending the basic keyboard
+        navigation currently available (based on Tab forward and backward) with the
+        addition of a two-dimensional directional navigation by using Left, Right, Up and
+        Down arrow keys to move to the "nearest" element in the corresponding direction.
+
+        Highlights:
+        * Feature is turned off by default in Settings. Port specific APIs need to be added
+          for toggling it on/off.
+        * Only elements viewed in the current viewport can have focus move to it. If the
+          "nearest" is not in viewport dimensions, then a scroll-in-direction action is
+          performed.
+
+        Known issues (to be covered in follow-up bugs):
+        * Add port specific hooks to each DRT to enable/disable Spatial Navigation.
+        * Support for spatial navigation through form elements (<input>, <select>, etc)
+          is be added.
+        * Make navigation keys customizable. It currently works with arrows keys only
+          (up, down, right and left).
+        * Make it support modifiers (Alt, Ctrl and Shift).
+        * Improve support on scrollable content.
+
+        [1] http://en.wikipedia.org/wiki/Spatial_navigation
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::defaultKeyboardEventHandler):
+        (WebCore::EventHandler::focusDirectionForKey):
+        (WebCore::EventHandler::defaultArrowEventHandler):
+        * page/EventHandler.h:
+        * page/FocusController.cpp:
+        (WebCore::FocusController::advanceFocus):
+        (WebCore::FocusController::advanceFocusInDocumentOrder):
+        (WebCore::FocusController::advanceFocusDirectionally):
+        (WebCore::updateFocusCandidateIfCloser):
+        (WebCore::FocusController::findFocusableNodeInDirection):
+        (WebCore::FocusController::deepFindFocusableNodeInDirection):
+        * page/FocusController.h:
+        * page/FocusDirection.h:
+        (WebCore::):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setSpatialNavigationEnabled):
+        * page/Settings.h:
+        (WebCore::Settings::isSpatialNavigationEnabled):
+        * page/SpatialNavigation.cpp: Added.
+        (WebCore::distanceInDirection):
+        (WebCore::renderRectRelativeToRootDocument):
+        (WebCore::alignmentForRects):
+        (WebCore::isHorizontalMove):
+        (WebCore::areRectsFullyAligned):
+        (WebCore::areRectsPartiallyAligned):
+        (WebCore::spatialDistance):
+        (WebCore::isRectInDirection):
+        (WebCore::hasOffscreenRect):
+        (WebCore::scrollInDirection):
+        (WebCore::isInRootDocument):
+        (WebCore::deflateIfOverlapped):
+        * page/SpatialNavigation.h: Added.
+        (WebCore::):
+        (WebCore::FocusCandidate::FocusCandidate):
+
+2010-03-04  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        This fixes the layering violation I committed yesterday by moving 
+        Page::instanceHandle into its own file just in the WebCore 
+        namespace.
+
+        Added WebCoreInstanceHandle.h + .cpp and removed PageWin.cpp
+        * WebCore.vcproj/WebCore.vcproj:
+        * page/win/PageWin.cpp: Removed.
+
+        Remove all instance handle code from Page.
+        * page/Page.h:
+
+        New files.
+        * platform/win/WebCoreInstanceHandle.cpp: Added.
+        * platform/win/WebCoreInstanceHandle.h: Added.
+        (WebCore::setInstanceHandle):
+        (WebCore::instanceHandle):
+
+        Switch to WebCore::instanceHandle() instead of 
+        Page::instanceHandle() and include the new header.
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFLayerRenderer::acceleratedCompositingAvailable):
+        * platform/win/PasteboardWin.cpp:
+        (WebCore::Pasteboard::Pasteboard):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenu::show):
+        (WebCore::PopupMenu::registerClass):
+        * platform/win/SharedTimerWin.cpp:
+        (WebCore::initializeOffScreenTimerWindow):
+        * plugins/win/PluginViewWin.cpp:
+        (WebCore::registerPluginView):
+        (WebCore::PluginView::platformStart):
+
+2010-03-04  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Unreviewed build fix.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        'glib_file_name' renamed to 'gligFileName'.
+
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (WebCore::Image::loadPlatformResource):
+
+2010-03-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Remove two last synchronous calls from front-end to InspectorBackend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35720
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::enableSearchingForNode):
+        (WebCore::InspectorBackend::disableSearchingForNode):
+        (WebCore::InspectorBackend::setPauseOnExceptionsState):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorContorller::setSearchingForNode):
+        (WebCore::InspectorController::populateScriptObjects):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::searchingForNodeWasEnabled):
+        (WebCore::InspectorFrontend::searchingForNodeWasDisabled):
+        (WebCore::InspectorFrontend::updatePauseOnExceptionsState):
+        * inspector/InspectorFrontend.h:
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype.get statusBarItems):
+        (WebInspector.ElementsPanel.prototype.hide):
+        (WebInspector.ElementsPanel.prototype.reset):
+        (WebInspector.ElementsPanel.prototype.searchingForNodeWasEnabled):
+        (WebInspector.ElementsPanel.prototype.searchingForNodeWasDisabled):
+        (WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.enableSearchingForNode):
+        (.WebInspector.InspectorBackendStub.prototype.disableSearchingForNode):
+        (.WebInspector.InspectorBackendStub.prototype.setPauseOnExceptionsState):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.get statusBarItems):
+        (WebInspector.ScriptsPanel.prototype.updatePauseOnExceptionsState):
+        (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+        (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+        * inspector/front-end/inspector.js:
+        (WebInspector.searchingForNodeWasEnabled):
+        (WebInspector.searchingForNodeWasDisabled):
+        (WebInspector.updatePauseOnExceptionsState):
+
+2010-03-03  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Clicking on an error should take me to the error
+
+        https://bugs.webkit.org/show_bug.cgi?id=34860
+
+        * inspector/front-end/ResourceView.js:
+        (WebInspector.ResourceView):
+        (WebInspector.ResourceView.prototype._selectTab):
+        (WebInspector.ResourceView.prototype.selectContentTab):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.showResource):
+
+2010-03-03  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Remove sync access to resourceTrackingEnabled.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35693
+
+        * inspector/InspectorBackend.cpp:
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel.prototype._reloadResources):
+        (WebInspector.AuditsPanel.prototype.show):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub):
+        (.WebInspector.InspectorBackendStub.prototype.enableResourceTracking):
+        (.WebInspector.InspectorBackendStub.prototype.disableResourceTracking):
+        (.WebInspector.InspectorBackendStub.prototype.enableDebugger):
+        (.WebInspector.InspectorBackendStub.prototype.disableDebugger):
+        (.WebInspector.InspectorBackendStub.prototype.enableProfiler):
+        (.WebInspector.InspectorBackendStub.prototype.disableProfiler):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel):
+        (WebInspector.ResourcesPanel.prototype.get resourceTrackingEnabled):
+        (WebInspector.ResourcesPanel.prototype.get visibleView):
+        (WebInspector.ResourcesPanel.prototype.resourceTrackingWasEnabled):
+        (WebInspector.ResourcesPanel.prototype.resourceTrackingWasDisabled):
+        (WebInspector.ResourcesPanel.prototype.reset):
+        (WebInspector.ResourcesPanel.prototype.showResource):
+        (WebInspector.ResourcesPanel.prototype._enableResourceTracking):
+        (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+
+2010-03-04  Antoine Quint  <ml@graougraou.com>
+
+        Reviewed by Darin Adler.
+
+        DOM insertion mutation events should dispatch after a node is attached to the render tree
+        https://bugs.webkit.org/show_bug.cgi?id=35590
+
+        Test: fast/events/domnodeinsertedintodocument-dispatched-post-rendering.html
+
+        Split off the internal-to-WebCore node insertion notification code from the DOM mutation
+        event dispatching, originally in dispatchChildInsertionEvents(), to a new static function
+        called notifyChildInserted(). This allows us to dispatch the mutation events at a later
+        time upon insertion of a child into to the tree, specifically _after_ attachment to the render
+        tree.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::insertBefore):
+        (WebCore::ContainerNode::replaceChild):
+        (WebCore::ContainerNode::appendChild):
+        (WebCore::notifyChildInserted):
+        (WebCore::dispatchChildInsertionEvents):
+
+2010-03-04  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Holger Freyther.
+
+        Make paths relocatable on runtime on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=32711
+
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (get_webkit_datadir):
+        (WebCore::Image::loadPlatformResource):
+
+2010-03-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Popup for Timeline panel will work in a tooltip mode
+
+        https://bugs.webkit.org/show_bug.cgi?id=35680
+
+        * inspector/front-end/Popover.js:
+        (WebInspector.Popover):
+        (WebInspector.Popover.prototype.show):
+        (WebInspector.Popover.prototype.hide):
+        (WebInspector.Popover.prototype._positionElement):
+        (WebInspector.PopoverHelper):
+        (WebInspector.PopoverHelper.prototype._mouseDown):
+        (WebInspector.PopoverHelper.prototype._mouseMove.doHide):
+        (WebInspector.PopoverHelper.prototype._mouseMove):
+        (WebInspector.PopoverHelper.prototype._resetHoverTimer):
+        (WebInspector.PopoverHelper.prototype.hidePopup):
+        (WebInspector.PopoverHelper.prototype._mouseHover):
+        (WebInspector.PopoverHelper.prototype._killHidePopupTimer):
+        * inspector/front-end/TimelineOverviewPane.js:
+        (WebInspector.TimelineOverviewPane.prototype.reset):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype.get _recordStyles):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._scheduleRefresh):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.prototype._adjustScrollPosition):
+        (WebInspector.TimelinePanel.prototype._getPopoverAnchor):
+        (WebInspector.TimelinePanel.prototype._showPopover):
+        (WebInspector.TimelinePanel.prototype._closeRecordDetails):
+        (WebInspector.TimelineRecordListRow):
+        (WebInspector.TimelineRecordListRow.prototype.update):
+        (WebInspector.TimelineRecordGraphRow):
+        (WebInspector.TimelineRecordGraphRow.prototype._onClick):
+        (WebInspector.TimelinePanel.FormattedRecord):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._createCell):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._createRow):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._createLinkRow):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+        * inspector/front-end/inspector.css:
+
+2010-03-04  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed build fix.
+
+        Build fix after r55464.
+
+        No new tests, no new functionality.
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects):
+
+2010-03-04  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/graphics/efl.
+        http://webkit.org/b/35539
+
+        * platform/graphics/efl/FloatRectEfl.cpp: Added.
+        * platform/graphics/efl/FontEfl.cpp: Added.
+        * platform/graphics/efl/IconEfl.cpp: Added.
+        * platform/graphics/efl/ImageEfl.cpp: Added.
+        * platform/graphics/efl/IntPointEfl.cpp: Added.
+        * platform/graphics/efl/IntRectEfl.cpp: Added.
+
+2010-03-04  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/text/efl.
+        http://webkit.org/b/35740
+
+        * platform/text/efl/TextBreakIteratorInternalICUEfl.cpp: Added.
+
+2010-03-04  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35726
+        Remove orphaned #ifdef WTF_USE_GLIB_ICU_UNICODE_HYBRID
+
+        Removing orphaned #if USE.
+
+        * platform/ThreadGlobalData.h:
+
+2010-03-03  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Throttle sync requests sent to the LocalStorage background thread
+        https://bugs.webkit.org/show_bug.cgi?id=34943
+
+        Currently, once a second LocalStorage takes all keys/values which have
+        been changed and sends them to a background thread to sync.  The problem
+        is that this background thread can get overwhelmed and stop being
+        responsive.  This means that if any other page tries to start using
+        LocalStorage (and thus initiates the initial import) that'll block on
+        all the previous syncs completing.
+
+        To mitigate this, I'm adding code so that we never schedule another
+        sync task when another is still running.  In order to keep the sync
+        tasks from growing exponentially when they do take longer than the
+        storage sync interval, I've also added a basic rate limiter.  No effort
+        is made to ensure fairness/ordering of what gets synced nor is there
+        any way for this rate to be changed because most normal uses of
+        LocalStorage really shouldn't be hitting these types of limits anyway.
+
+        The only behavioral change that's observible in JavaScript is time based
+        and thus it's not practical to make new tests that aren't racy.  The
+        existing layout tests cover LocalStorage pretty well, though.
+
+        * storage/StorageAreaSync.cpp:
+        (WebCore::StorageAreaSync::StorageAreaSync):
+        (WebCore::StorageAreaSync::scheduleFinalSync):
+        (WebCore::StorageAreaSync::syncTimerFired):
+        (WebCore::StorageAreaSync::performSync):
+        * storage/StorageAreaSync.h:
+
+2010-03-04  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Added support for worker instrumentation in inspector
+        (display list of active workers, allow debugging of workers
+        by injecting fake JS implementation)
+
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+        * English.lproj/localizedStrings.js:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::createInjectedScript):
+        (WebCore::InjectedScriptHost::injectedScriptFor):
+        * dom/Document.cpp:
+        (WebCore::Document::inspectorController):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        (WebCore::ScriptExecutionContext::inspectorController):
+        * inspector/InjectedScriptHost.cpp:
+        (WebCore::InjectedScriptHost::InjectedScriptHost):
+        (WebCore::InjectedScriptHost::injectScript):
+        (WebCore::InjectedScriptHost::nextWorkerId):
+        (WebCore::InjectedScriptHost::didCreateWorker):
+        (WebCore::InjectedScriptHost::willDestroyWorker):
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptHost.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects):
+        (WebCore::InspectorController::resetScriptObjects):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::didCreateWorker):
+        (WebCore::InspectorController::willDestroyWorker):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::didCreateWorker):
+        (WebCore::InspectorFrontend::willDestroyWorker):
+        * inspector/InspectorFrontend.h:
+        * inspector/InspectorWorkerResource.h: Added.
+        (WebCore::InspectorWorkerResource::create):
+        (WebCore::InspectorWorkerResource::id):
+        (WebCore::InspectorWorkerResource::url):
+        (WebCore::InspectorWorkerResource::isSharedWorker):
+        (WebCore::InspectorWorkerResource::InspectorWorkerResource):
+        * inspector/front-end/Checkbox.js: Added.
+        (WebInspector.Checkbox.callbackWrapper):
+        (WebInspector.Checkbox):
+        (WebInspector.Checkbox.prototype.checked):
+        * inspector/front-end/InjectedFakeWorker.js:
+        (InjectedFakeWorker.FakeWorker):
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        (InjectedFakeWorker.FakeWorker.prototype._handleException):
+        (InjectedFakeWorker.FakeWorker.prototype._importScripts):
+        (InjectedFakeWorker.FakeWorker.prototype._loadScript):
+        (InjectedFakeWorker.FakeWorker.prototype._expandURLAndCheckOrigin):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/WorkersSidebarPane.js: Added.
+        (WebInspector.WorkersSidebarPane):
+        (WebInspector.WorkersSidebarPane.prototype.addWorker):
+        (WebInspector.WorkersSidebarPane.prototype.removeWorker):
+        (WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
+        (WebInspector.WorkersSidebarPane.prototype.reset):
+        (WebInspector.WorkersSidebarPane.prototype._onTriggerInstrument):
+        (WebInspector.Worker):
+        (WebInspector.didCreateWorker):
+        (WebInspector.willDestroyWorker):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.html:
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::AbstractWorker):
+        (WebCore::AbstractWorker::~AbstractWorker):
+        (WebCore::AbstractWorker::onDestroyWorker):
+        (WebCore::AbstractWorker::contextDestroyed):
+        * workers/AbstractWorker.h:
+        (WebCore::AbstractWorker::id):
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::SharedWorker):
+        * workers/Worker.cpp:
+        (WebCore::Worker::Worker):
+
+2010-03-04  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
+
+        This also allows shadow builds relying only on qmake to work properly.
+
+        * WebCore.pro:
+
+2010-03-02  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Avoid calling QFont::detach too often from FontQt
+        https://bugs.webkit.org/show_bug.cgi?id=35569
+
+        The letter- and wordspacing is inside the WebCore::Font class,
+        our QFont is located in the WebCore::FontPlatformData. Everytime
+        we need to use a QFont inside WebCore::Font we are calling the
+        font method which gets the QFont from the WebCore::FontPlatformData
+        and is applying the letter- and wordspacing. Internally this
+        will attempt to detach the QFont...
+
+        Avoid calling setLetterSpacing and setWordSpacing on QFont if
+        the WebCore::Font has the default applied.
+
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::font):
+
+2010-03-04  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Nothing happens on navigation to resource via a link if resource tracking is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=35574
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
+        (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentMouseOver):
+        (WebInspector.documentMouseOut):
+        (WebInspector.hideBadLinkPopupIfNecessary):
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+        (WebInspector.showBadLinkPopup.popupOverOut):
+        (WebInspector.showBadLinkPopup):
+        (WebInspector.addMainEventListeners):
+
+2010-03-04  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Oliver Hunt.
+
+        getUniformLocation() now returns null if uniform requested 
+        is not found.
+        https://bugs.webkit.org/show_bug.cgi?id=34669
+        
+        Test:LayoutTests/fast/canvas/webgl/uniform-location.html
+        (added missing test)
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getUniformLocation):
+
+2010-03-04  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fix incorrect setup of DateExtension.
+        https://bugs.webkit.org/show_bug.cgi?id=35710
+
+        * bindings/v8/DateExtension.cpp:
+        (WebCore::DateExtension::setAllowSleep):
+
+2010-03-04  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35603
+        SVG incorrectly allows nested <use> elements in a <use> shadow tree
+
+        Simplify the handling of invalid or missing use-targets by cloning them
+        to empty <g> elements rather than just allowing the <use> element to
+        be copied into the shadow tree, as this violates a number of assumptions
+        in the shadow tree handling code.
+
+        Tests: svg/custom/use-nested-disallowed-target.svg
+               svg/custom/use-nested-missing-target-added.svg
+               svg/custom/use-nested-missing-target-removed.svg
+               svg/custom/use-nested-missing-target.svg
+               svg/custom/use-nested-notarget.svg
+
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::buildPendingResource):
+        (WebCore::SVGUseElement::buildShadowAndInstanceTree):
+        (WebCore::SVGUseElement::expandUseElementsInShadowTree):
+
+2010-03-04  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Move Cairo-related font code from platform/graphics/gtk to
+        platform/graphics/cairo, so other ports may use them.
+        http://webkit.org/b/35539
+
+        * GNUmakefile.am:
+        * platform/graphics/cairo/FontCacheCairo.cpp: Copied from WebCore/platform/graphics/gtk/FontCacheGtk.cpp.
+        * platform/graphics/cairo/FontCustomPlatformData.cpp: Copied from WebCore/platform/graphics/gtk/FontCustomPlatformData.cpp.
+        * platform/graphics/cairo/FontCustomPlatformData.h: Copied from WebCore/platform/graphics/gtk/FontCustomPlatformData.h.
+        * platform/graphics/cairo/FontPlatformData.h: Copied from WebCore/platform/graphics/gtk/FontPlatformData.h.
+        * platform/graphics/cairo/FontPlatformDataCairo.cpp: Copied from WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp.
+        * platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp: Copied from WebCore/platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp.
+        * platform/graphics/cairo/SimpleFontDataCairo.cpp: Copied from WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp.
+        * platform/graphics/gtk/FontCacheGtk.cpp: Removed.
+        * platform/graphics/gtk/FontCustomPlatformData.cpp: Removed.
+        * platform/graphics/gtk/FontCustomPlatformData.h: Removed.
+        * platform/graphics/gtk/FontPlatformData.h: Removed.
+        * platform/graphics/gtk/FontPlatformDataGtk.cpp: Removed.
+        * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp: Removed.
+        * platform/graphics/gtk/SimpleFontDataGtk.cpp: Removed.
+
+2010-03-04  Evan Stade  <estade@chromium.org>
+
+        Reviewed by David Levin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35261
+        [skia] crash when attempting to render certain SVGs
+
+        This fixes the crash, but the SVG still doesn't render properly.
+
+        Test: svg/custom/tiling-regular-hexagonal-crash.svg
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::BitmapImageSingleFrameSkia::create): don't return 0 when
+        the copy fails; instead return a blank bitmap. The caller doesn't
+        check for 0 before dereferencing.
+
+2010-03-04  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Initialize m_isMultipartPayload in other ResourceResponse ctor.
+        In r55451 (bug 35628) I added an extra bool, but only initialized
+        it in one constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=35719
+
+        * platform/network/chromium/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+
+2010-03-03  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add a new class that stores information about Web Socket handshake request.
+
+        Instances of this class contain the necessary information to send a Web Socket
+        handshake request. In the future, this class will provide request information
+        to the Web Inspector.
+
+        WebSocketHandshake needs to provide request information
+        https://bugs.webkit.org/show_bug.cgi?id=34784
+
+        No new tests, since the current tests will suffice (LayoutTests/websocket/*).
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * websockets/WebSocketChannel.cpp:
+        * websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::clientHandshakeMessage):
+        (WebCore::WebSocketHandshake::clientHandshakeRequest):
+        * websockets/WebSocketHandshake.h:
+        * websockets/WebSocketHandshakeRequest.cpp: Added.
+        (WebCore::WebSocketHandshakeRequest::WebSocketHandshakeRequest):
+        (WebCore::WebSocketHandshakeRequest::~WebSocketHandshakeRequest):
+        (WebCore::WebSocketHandshakeRequest::addExtraHeaderField):
+        (WebCore::WebSocketHandshakeRequest::headerFields):
+        (WebCore::WebSocketHandshakeRequest::host):
+        * websockets/WebSocketHandshakeRequest.h: Added.
+
+2010-03-03  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Build fix after r55452.
+
+        No new tests, this is a build fix.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::setDatabasesEnabled):
+
+2010-03-03  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make keyIdentifierForQtKeyCode return the unicode backspace value on Qt PlatformKeyboardEvent
+
+        LayoutTests:
+            fast/events/key-events-in-input-text.html
+            fast/events/special-key-events-in-input-text.html
+
+        [Qt] Return the unicode backspace value in keyIdentifierForQtKeyCode on Qt PlatformKeyboardEvent
+        https://bugs.webkit.org/show_bug.cgi?id=35694
+
+        * platform/qt/PlatformKeyboardEventQt.cpp:
+        (WebCore::keyIdentifierForQtKeyCode):
+
+2010-03-03  Chad Faragher  <wyck@chromium.org>
+
+        Reviewed by Darin Adler.
+        Changed the double-click framework code to pass adjusted page
+        coordinates for zoomed pages.  Added a new test to expose
+        mistreatment of mouse click coordinates during a double-click.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35690
+
+        Test: fast/events/zoom-dblclick.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchMouseEvent):
+
+2010-03-03  David Levin  <levin@chromium.org>
+
+        No review, rolling out r55474.
+
+        The patch broke fast/frames/sandboxed-iframe-storage.html
+
+        Last one (I hope).
+        
+        * WebCore.xcodeproj/project.pbxproj:
+
+2010-03-03  David Levin  <levin@chromium.org>
+
+        No review, rolling out r55474.
+
+        The patch broke fast/frames/sandboxed-iframe-storage.html
+
+        Unfortunately, (the webkit-patch rollout and) I missed these in r55485.
+
+        * bindings/js/JSDatabaseCallback.cpp: Removed.
+        * bindings/js/JSDatabaseCallback.h: Removed.
+        * bindings/v8/custom/V8DatabaseCallback.cpp: Removed.
+        * bindings/v8/custom/V8DatabaseCallback.h: Removed.
+        * storage/DatabaseCallback.h: Removed.
+
+2010-03-02  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix a bug that could lead to a crash. Some parts of
+        SQLTransaction::checkAndHandleClosedDatabase() should only be run
+        when that method is invoked on the DB thread.
+
+        We cannot test this fix with a test, because the crash happens
+        only when all of the following conditions are met:
+        1. A database is closing.
+        2. A transaction on that database is in progress.
+        3. The transaction is in a state where a statement/transaction
+        success/error callback needs to be invoked (so there's a task for
+        this transaction pending on the main thread).
+        4. The DB thread finished processing all its tasks and called
+        SQLTransactionCoordinator::shutdown() before the main thread go to
+        that task.
+
+        The closest thing we have to a test is running
+        LayoutTests/storage/database-lock-after-reload.html 1000 times in
+        a row. Without the patch, the probability of a crash happening in
+        one of the runs is very high. With the patch, the test should
+        reliably run 1000 times in a row without a single crash.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35624
+
+        * storage/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
+
+2010-03-03  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Mark Rowe.
+
+        Page should not care about Chromium plug-in implementation details
+        https://bugs.webkit.org/show_bug.cgi?id=35623
+
+        * WebCore.gypi: Compile PluginViewNone.cpp
+        * page/Page.cpp:
+        (WebCore::Page::privateBrowsingStateChanged): Remove conditional
+        compilation for PLATFORM(CHROMIUM).
+
+2010-03-03  David Levin  <levin@chromium.org>
+
+        No review, rolling out r55474.
+        http://trac.webkit.org/changeset/55480
+
+        The patch broke fast/frames/sandboxed-iframe-storage.html
+
+        * Android.jscbindings.mk:
+        * Android.v8bindings.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        * dom/Document.cpp:
+        (WebCore::Document::postTask):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * storage/Database.cpp:
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        * storage/Database.h:
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+
+2010-03-03  David Levin  <levin@chromium.org>
+
+        No review, rolling out r55480.
+        http://trac.webkit.org/changeset/55480
+
+        The patch broke fast/frames/sandboxed-iframe-storage.html
+
+        * storage/Database.cpp:
+        * storage/Database.h:
+
+2010-03-03  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Add virtual memory tags for TCMalloc and WebCore's purgeable buffers.
+
+        * platform/mac/PurgeableBufferMac.cpp:
+        (WebCore::PurgeableBuffer::create):  Use the VM tag.
+
+2010-03-03  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by nobody, build fix.
+
+        Move #include "DatabaseCallback.h" from Database.h to
+        Database.cpp.
+
+        * storage/Database.cpp:
+        * storage/Database.h:
+
+2010-03-03  Darin Adler  <darin@apple.com>
+
+        Fixed Mac build.
+
+        * WebCore.xcodeproj/project.pbxproj: Marked a couple of headers "private" so they can
+        be used in the WebKit project.
+
+2010-03-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35044
+        Crash in XML tokenizer reloading zoom-coords-viewattr-01-b.svg
+
+        I'm often getting a crash even when opening the test for the first time in Safari, but it
+        doesn't seem to crash in DumpRenderTree. Still, I can't think of a stronger way to test for
+        this condition, so no new regression test.
+
+        * dom/XMLTokenizer.cpp: (WebCore::XMLTokenizer::end): Be prepared that parsing remaining
+        input will pause parsing.
+
+2010-03-03  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Adding support for the optional creation callback that could be
+        passed to openDatabase().
+
+        Test: storage/open-database-creation-callback.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=34726
+
+        * Android.jscbindings.mk
+        * Android.v8bindings.mk
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::openDatabase):
+        * bindings/js/JSDatabaseCallback.cpp: Added.
+        (WebCore::JSDatabaseCallback::JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::~JSDatabaseCallback):
+        (WebCore::JSDatabaseCallback::handleEvent):
+        * bindings/js/JSDatabaseCallback.h: Added.
+        (WebCore::JSDatabaseCallback::create):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openDatabaseCallback):
+        * bindings/v8/custom/V8DatabaseCallback.cpp: Added.
+        (WebCore::V8DatabaseCallback::V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::~V8DatabaseCallback):
+        (WebCore::V8DatabaseCallback::handleEvent):
+        * bindings/v8/custom/V8DatabaseCallback.h: Added.
+        (WebCore::V8DatabaseCallback::create):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::openDatabase):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * storage/Database.cpp:
+        (WebCore::DatabaseCreationCallbackTask::create):
+        (WebCore::DatabaseCreationCallbackTask::performTask):
+        (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        (WebCore::Database::performCreationCallback):
+        * storage/Database.h:
+        (WebCore::Database::isNew):
+        * storage/DatabaseCallback.h: Added.
+        (WebCore::DatabaseCallback::~DatabaseCallback):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::openDatabase):
+        * workers/WorkerContext.h:
+
+2010-03-03  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: resources panel only shows uncompressed resource size.
+        https://bugs.webkit.org/show_bug.cgi?id=35403
+
+        * English.lproj/localizedStrings.js:
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::updateScriptObject):
+        * inspector/front-end/AbstractTimelinePanel.js:
+        (WebInspector.AbstractTimelinePanel.prototype.refresh):
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.GzipRule.prototype.doRun):
+        (WebInspector.AuditRules.GzipRule.prototype._shouldCompress):
+        * inspector/front-end/ImageView.js:
+        (WebInspector.ImageView):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.get resourceSize):
+        (WebInspector.Resource.prototype.set resourceSize):
+        (WebInspector.Resource.prototype.get transferSize):
+        (WebInspector.Resource.CompareBySize):
+        (WebInspector.Resource.CompareByTransferSize):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.populateSidebar):
+        (WebInspector.ResourceTimeCalculator.prototype.computeBarGraphLabels):
+        (WebInspector.ResourceTransferSizeCalculator.prototype.computeBarGraphLabels):
+        (WebInspector.ResourceTransferSizeCalculator.prototype.computeBarGraphPercentages):
+        (WebInspector.ResourceTransferSizeCalculator.prototype._value):
+        (WebInspector.ResourceTransferSizeCalculator.prototype._networkBytes):
+        (WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize):
+        (WebInspector.ResourceGraph.prototype.refreshLabelPositions):
+        (WebInspector.ResourceGraph.prototype.refresh):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.js:
+        (WebInspector.updateResource):
+
+2010-03-03  Dan Bernstein  <mitz@apple.com>
+
+        Build fix.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::removeChildren):
+
+2010-03-03  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Get rid of synchronous debuggerEnabled, profilerEnabled calls.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32331
+
+        * inspector/InspectorBackend.cpp:
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
+        (WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint):
+        (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel):
+        (WebInspector.ProfilesPanel.prototype.profilerWasEnabled):
+        (WebInspector.ProfilesPanel.prototype.profilerWasDisabled):
+        (WebInspector.ProfilesPanel.prototype._updateInterface):
+        (WebInspector.ProfilesPanel.prototype._enableProfiling):
+        (WebInspector.ProfilesPanel.prototype._toggleProfiling):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
+        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        (WebInspector.ScriptsPanel.prototype.canShowSourceLine):
+        (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+        (WebInspector.ScriptsPanel.prototype._enableDebugging):
+        (WebInspector.ScriptsPanel.prototype._toggleDebugging):
+
+2010-03-03  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Replace 'autobuffer' attribute with 'preload' to align with spec revision 4811.
+        https://bugs.webkit.org/show_bug.cgi?id=35385
+        rdar://problem/7689602
+
+        Tests: media/audio-constructor-preload.html
+               media/video-dom-preload.html
+
+        * html/HTMLAttributeNames.in: Remove autobuffer, add preload
+
+        * html/HTMLAudioElement.cpp:
+        (WebCore::HTMLAudioElement::createForJSConstructor): set preload to 'auto' instead of 
+            autobuffer to true.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_preload.
+        (WebCore::HTMLMediaElement::parseMappedAttribute): Deal with 'preload' attribute.
+        (WebCore::HTMLMediaElement::loadResource): Call setPreload() on the newly created MediaPlayer,
+            before calling load() so it can pass the setting through to the media engine.
+        (WebCore::HTMLMediaElement::preload): New.
+        (WebCore::HTMLMediaElement::setPreload): Ditto
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElement.idl:
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::MediaPlayer): Initialize m_preload.
+        (WebCore::MediaPlayer::load): Pass m_preload to newly created media engine.
+        (WebCore::MediaPlayer::preload): New, return m_preload.
+        (WebCore::MediaPlayer::setPreload): New, set m_preload.
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayer::):
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::setPreload):
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::setPreload): Renamed from setAutoplay, fix logic for preload.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-03-03  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7682756> Assertion failure when replacing the contents of a <select>
+
+        Test: fast/dom/remove-children-notification-order.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::removeChildren): Changed to call childrenChanged()
+        before calling removedFromDocument() on each removed child, which matches
+        the order removeChild() does things, and avoids the assertion. This required
+        temporarily storing the removed children in a vector.
+        Also added comments about other discrepancies between this function and
+        removeChild().
+
+2010-03-03  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Document cookieURL and firstPartyForCookies
+        https://bugs.webkit.org/show_bug.cgi?id=35613
+
+        Some folks asked what the cookieURL and the firstPartyForCookies were
+        on IRC.  This patch documents these properties in the code so folks
+        don't have to ask on IRC anymore.
+
+        * dom/Document.h:
+
+2010-03-03  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk]: assertion triggered when geolocation getCurrentPosition without an option argument.
+        https://bugs.webkit.org/show_bug.cgi?id=35666
+
+        * platform/gtk/GeolocationServiceGtk.cpp:
+        (WebCore::GeolocationServiceGtk::startUpdating):
+
+2010-03-03  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Xan Lopez.
+
+        Miscellaneous little fixes for the windows build of webkit-gtk
+        https://bugs.webkit.org/show_bug.cgi?id=35640
+
+        * GNUmakefile.am: dist two new files concerning mathml support.
+
+2010-03-03  Xan Lopez  <xlopez@igalia.com>
+
+        Unreviewed distcheck fix.
+
+        Add new file to the build.
+
+        * GNUmakefile.am:
+
+2010-03-03  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Oliver Hunt.
+
+        Make IntPoint usable as a hash key
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35586
+
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/IntPointHash.h: Added.
+        (WTF::IntPointHash::hash):
+        (WTF::IntPointHash::equal):
+        (WTF::):
+
+2010-03-02  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Move database enable bit fully out of settings
+        This is stage one of a three-stage commit [webkit, then chromium, then
+        webkit again].  In this change I'm adding calls to
+        Database::setIsAvailable inside Settings::setDatabaseEnabled and
+        anywhere else that called it, and switching webkit fully over to using
+        that flag [added in a previous checkin].  Phase two will remove
+        Chromium's use of Settings for the Database, and phase three will remove
+        the Setting for the Database enable entirely, leaving only
+        Database::isAvailable/setIsAvailable.
+
+        No new tests; tested by existing storage tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35310
+
+        * WebCore.base.exp: Export Database::setIsAvailable
+        * WebCore.xcodeproj/project.pbxproj: Export needed headers as Private
+        * page/DOMWindow.cpp: Read isAvailable, not Settings::isDatabaseEnabled
+        (WebCore::DOMWindow::openDatabase):
+        * page/Settings.cpp:  Add a call to Database::setIsAvailable.
+        (WebCore::Settings::setDatabasesEnabled):
+
+2010-03-02  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        add a flag to WebURLResponse so we can identify multipart content
+        https://bugs.webkit.org/show_bug.cgi?id=35628
+
+        * platform/network/chromium/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        (WebCore::ResourceResponse::isMultipartPayload):
+        (WebCore::ResourceResponse::setIsMultipartPayload):
+
+2010-03-02  Tony Chang  <tony@chromium.org>
+
+        Not reviewed, test fix.
+
+        Revert r55447 because the new layout test is crashing consistently
+        on Leopard Intel Debug (tests).
+        https://bugs.webkit.org/show_bug.cgi?id=35261
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::BitmapImageSingleFrameSkia::create):
+
+2010-03-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Google Analytics triggers "blocked plugin" UI
+        https://bugs.webkit.org/show_bug.cgi?id=35565
+
+        Just like for running script, we need to distinguish between querying
+        whether plug-ins are enabled and actually blocking a page from
+        instantiating a plugin.  We need to issue different callbacks to the
+        FrameLoaderClient so that the client can inform us that plug-ins are
+        disabled in some cases without showing the "plug-in blocked" UI.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::requestObject):
+        (WebCore::FrameLoader::allowPlugins):
+        * loader/FrameLoader.h:
+        (WebCore::):
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::didNotAllowPlugins):
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::substituteMIMETypeFromPluginDatabase):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::writeRawData):
+        * page/Page.cpp:
+        (WebCore::Page::pluginData):
+        * plugins/MimeType.cpp:
+        (WebCore::MimeType::enabledPlugin):
+
+2010-03-02  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Support the HTTP OPTIONS verb (needed for preflight requests)
+
+        https://bugs.webkit.org/show_bug.cgi?id=34647
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+        (WebCore::QNetworkReplyHandler::start):
+
+2010-03-02  Evan Stade  <estade@chromium.org>
+
+        Reviewed by David Levin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35261
+        [skia] crash when attempting to render certain SVGs
+
+        This fixes the crash, but the SVG still doesn't render properly.
+
+        Test: svg/custom/tiling-regular-hexagonal-crash.svg
+
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::BitmapImageSingleFrameSkia::create): don't return 0 when
+        the copy fails; instead return a blank bitmap. The caller doesn't
+        check for 0 before dereferencing.
+
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] use geoclue providers with don't provide update
+        https://bugs.webkit.org/show_bug.cgi?id=35191
+
+        No new tests, behaviour depends on system.
+
+        * platform/gtk/GeolocationServiceGtk.cpp:
+        (WebCore::GeolocationServiceGtk::startUpdating):
+
+2010-03-02  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Remove unnecessary check.
+        https://bugs.webkit.org/show_bug.cgi?id=35513
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars):
+
+2010-03-02  Darin Fisher  <darin@chromium.org>
+
+        Fix chromium build bustage.
+
+        * page/Page.cpp:
+        (WebCore::Page::privateBrowsingStateChanged): PluginView methods may
+        not be called in the Chromium port.
+
+2010-03-02  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin Adler and Adam Roben.
+
+        Fix for <rdar://problem/7485289> WebKit crashes on systems that 
+        don't support CoreAnimation
+
+        WKCACFLayerRenderer::acceleratedCompositingAvailable() now creates 
+        a dummy HWND so that it can step through the whole setHostWindow() 
+        and createRenderer() process. createRenderer() also calls a new 
+        function, hardwareCapabilitiesIndicateCoreAnimationSupport() which 
+        can only be called  once we have a d3dDevice.
+
+        setHostWindow() and createRenderer() now both return bools that 
+        indicate whether or not they have succeeded.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::hardwareCapabilitiesIndicateCoreAnimationSupport):
+        (WebCore::CoreAnimationTesterWindowWndProc):
+        (WebCore::WKCACFLayerRenderer::acceleratedCompositingAvailable):
+        (WebCore::WKCACFLayerRenderer::shared):
+        (WebCore::WKCACFLayerRenderer::createRenderer):
+        * platform/graphics/win/WKCACFLayerRenderer.h:
+        (WebCore::WKCACFLayerRenderer::setHostWindow):
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Jon Honeycutt.
+
+        ScriptDebugServer shouldn't care that Mac does not use PluginView for plug-ins.
+
+        * bindings/js/ScriptDebugServer.cpp:
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::setJavaScriptPaused): Add an empty implementation of setJavaScriptPaused.
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Jon Honeycutt.
+
+        Clean up the build fix r55437 by adding an empty implementation of privateBrowsingStateChanged in PluginViewNone.cpp
+
+        * page/Page.cpp:
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::privateBrowsingStateChanged):
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        * page/Page.cpp:
+        (WebCore::Page::privateBrowsingStateChanged): Mac doesn't use WebCore's PluginView class
+        for plug-ins, so provide an empty implementation of privateBrowsingStateChanged for Mac.
+
+2010-03-02  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Add the capability to create and dispatch a WheelEvent in JavaScript.
+        Ensure the event's default handler is triggered in the same way as it is
+        during a PlatformWheelEvent.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35566
+
+        Test: fast/events/wheelevent-in-scrolling-div.html
+
+        * dom/Node.cpp: Ensure that the default behavior (scrolling) occurs for
+        wheel events originating both from the platform and from
+        JavaScript/ObjC.
+        (WebCore::Node::dispatchWheelEvent): Instantiate new WheelEvent with
+        the graunularity of the PlatformWheelEvent.
+        (WebCore::Node::defaultEventHandler): Add support for mousewheel events.
+        * dom/WheelEvent.cpp: Add three new member variables: m_deltaX, m_deltaY
+        and m_granularity.  m_deltaX and m_deltaY differ from m_wheelDeltaX and
+        m_wheelDeltaY, which are the number of wheel ticks multiplied by 120 for
+        IE compatibility.
+        (WebCore::WheelEvent::WheelEvent): Initialize new member variables.
+        (WebCore::WheelEvent::initWheelEvent): Same.
+        (WebCore::WheelEvent::initWebKitWheelEvent): Same.
+        * dom/WheelEvent.h: See WheelEvent.cpp.
+        (WebCore::WheelEvent::): Add Granularity enum (Pixel, Line, Page).
+        (WebCore::WheelEvent::create): Add new arguments.
+        (WebCore::WheelEvent::deltaX): Amount of scroll in x direction.
+        (WebCore::WheelEvent::deltaY): Amount of scroll in y direction.
+        (WebCore::WheelEvent::granularity): Units of deltaX and deltaY.
+        * dom/WheelEvent.idl: Add initWebKitWheelEvent() to JavaScript.  This is
+        the same as the initWheelEvent ObjC method.  As the DOM Level 3 Events
+        specification is still a working draft and subject to change, prefix
+        'WebKit' to the method signature to indicate experimental support.
+        * page/EventHandler.cpp: Move the scroll handling from
+        handleWheelEvent() to defaultWheelEventHandler(), which is executed on
+        both PlatformWheelEvents and JavaScript WheelEvents.
+        (WebCore::scrollNode): Renamed from scrollAndAcceptEvent().  Remove
+        the PlatformWheelEvent from the argument list and instead return a
+        boolean indicating if the scroll event was accepted.
+        (WebCore::EventHandler::handleWheelEvent): Move scrolling code from here
+        (WebCore::EventHandler::defaultWheelEventHandler): ...to here.
+        * page/EventHandler.h: Add function signature.
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 35576: WebKit should tell plug-in instances when private browsing state changes
+        <http://webkit.org/b/35576>
+
+        Notify plug-in instances when the private browsing state changes to match the behavior of the
+        Mac plug-in code.
+
+        * page/Page.cpp:
+        (WebCore::Page::privateBrowsingStateChanged): Walk the frame tree and notify each PluginView that
+        the private browsing state has changed.
+        * page/Page.h:
+        * page/Settings.cpp:
+        (WebCore::Settings::setPrivateBrowsingEnabled): Notify the page that the private browsing state
+        has changed.
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::privateBrowsingStateChanged): Notify the plug-in instance of the new private
+        browsing state.
+        * plugins/PluginView.h:
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Bug 30348: Implement private mode for plug-ins on Windows
+        <http://webkit.org/b/30348> / <rdar://problem/7562261>
+
+        Rework PluginView::getValue and PluginView::getValueStatic to remove the amount of code that
+        was duplicated across platforms.  getValue and getValueStatic now call in to platform-specific
+        variants that indicate whether they handled the query.  If the query is not handled by the
+        platform-specific variants then the cross-platform handler has a chance to handle it.
+
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::getValueStatic): Give the platform-specific variant a chance to handle the
+        variable lookup.  If it does not handle it, return an error.
+        (WebCore::PluginView::getValue): Give the platform-specific variant and platform-specific static
+        variant a chance to handle the variable lookup.  If they do not handle it, apply the cross-platform
+        handler.  At the moment the cross-platform code handles NPNVWindowNPObject, NPNVPluginElementNPObject,
+        and NPNVprivateModeBool as they have an identical implementation across ports.
+        * plugins/PluginView.h:
+        * plugins/PluginViewNone.cpp:
+        (WebCore::PluginView::platformGetValue): PluginViewNone does not handle any lookups.
+        (WebCore::PluginView::platformGetValueStatic): Ditto.
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue):
+        platform-independent implementation.
+        * plugins/mac/PluginViewMac.cpp:
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue):
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue): Fix a bug noticed while updating this code.
+        The Qt implementation of the handler for NPNVToolkit was relying on case fall-through
+        to have some values handled by the static handler.  When NPNVprivateModeBool was added
+        it was placed before the default case, interferring with this fall-through.  It now
+        explicitly indicates in this situation that it was not handled.
+        * plugins/symbian/PluginViewSymbian.cpp:
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue):
+        * plugins/win/PluginViewWin.cpp:
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue):
+
+2010-03-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Make the default constructor available to all platforms.
+
+        * platform/PlatformKeyboardEvent.h:
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        * platform/mac/KeyEventMac.mm:
+
+2010-03-02  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by David Levin.
+
+        Revert database thread changes that are no longer required
+        https://bugs.webkit.org/show_bug.cgi?id=35519
+
+        Jochen Eisinger created 55214 and 55247 to track which database
+        owns which thread.  Dmitry suggested that this could also
+        be done via TLS, though.  After exploring the options, Jochen
+        chose to go the TLS route, so these patches are no longer needed.
+
+        * storage/DatabaseThread.cpp:
+        (WebCore::DatabaseThread::DatabaseThread):
+        (WebCore::DatabaseThread::databaseThread):
+        * storage/DatabaseThread.h:
+        (WebCore::DatabaseThread::getThreadID):
+
+2010-03-02  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Followup for REGRESSION(r51097) - Unable to log in to statefarm.com
+        <rdar://problem/7672667> and https://bugs.webkit.org/show_bug.cgi?id=35556
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::shouldExecuteAsJavaScript): To more perfectly match Gecko's rule,
+          strip whitespace from the attribute values before comparing to window/onload/onload().
+
+2010-03-02  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        aria-label isn't respected on option elements
+        https://bugs.webkit.org/show_bug.cgi?id=35400
+
+        When aria-label is used on an <option> element, it can take three forms.
+        An option in a multi-select list, a popup button and the menu that is displayed 
+        from the popup button. This patches the three requisite locations so that if
+        aria-label is used, the correct accessibility text is returned.
+
+        Test: platform/mac/accessibility/option-with-arialabel.html
+
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::stringValue):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::getAttribute):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::getAttribute):
+        (WebCore::AccessibilityRenderObject::stringValue):
+        * platform/PopupMenuClient.h:
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenu::populate):
+        * rendering/RenderMenuList.cpp:
+        (WebCore::RenderMenuList::itemAccessibilityText):
+        * rendering/RenderMenuList.h:
+        * rendering/RenderTextControlSingleLine.h:
+        (WebCore::RenderTextControlSingleLine::itemAccessibilityText):
+
+2010-03-02  Mads Ager  <ager@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [V8] V8 should be notified of context disposals
+        https://bugs.webkit.org/show_bug.cgi?id=35526
+
+        Notify V8 of context disposals to allow it to clean up memory from those
+        contexts when idle.  When disposing a context, start a timer that will
+        give V8 an idle notification after a while to force cleanup.  Use a timer
+        to avoid performing an idle notification in the middle of navigation where
+        we know we are not idle.
+
+        * WebCore.gypi:
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::disposeContextHandles):
+        * bindings/v8/V8GCForContextDispose.cpp: Added.
+        (WebCore::V8GCForContextDispose::V8GCForContextDispose):
+        (WebCore::V8GCForContextDispose::notifyContextDisposed):
+        (WebCore::V8GCForContextDispose::notifyIdleSooner):
+        (WebCore::V8GCForContextDispose::instance):
+        (WebCore::V8GCForContextDispose::pseudoIdleTimerFired):
+        * bindings/v8/V8GCForContextDispose.h: Added.
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::WindowSetTimeoutImpl):
+
+2010-03-02  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: adding missing image files to WebKit.qrc and gypi.
+
+        * WebCore.gypi:
+        * inspector/front-end/WebKit.qrc:
+
+2010-03-02  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] GraphicsLayer: Video element with 3d transform crashes when AC is enabled.
+        https://bugs.webkit.org/show_bug.cgi?id=35516
+
+        No new tests.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQt::setContentsToMedia):
+
+2010-03-02  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Xan Lopez.
+
+        Use unsigned instead of uint which does not exist on windows
+        https://bugs.webkit.org/show_bug.cgi?id=35546
+
+        * platform/graphics/gtk/ImageGtk.cpp:
+        (WebCore::getCairoSurfacePixel):
+        (WebCore::getGdkPixbufPixel):
+
+2010-03-02  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Add EnabledAtRuntime attribute to WebGLArray constructors
+        https://bugs.webkit.org/show_bug.cgi?id=35558
+
+        New functionality verified manually in Chromium; not possible to
+        write layout test. Ran WebGL tests in WebKit as well.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebGLEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLRenderingContextEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLArrayBufferEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLByteArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLUnsignedByteArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLShortArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLUnsignedShortArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLIntArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLUnsignedIntArrayEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGLFloatArrayEnabled):
+        * page/DOMWindow.idl:
+
+2010-03-02  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Fail gracefully if NPN_GetProperty tries to retrieve a property that doesn't exist.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35588
+
+        Required for passing LayoutTests/plugins/netscape-plugin-property-access-exception.html on Chromium.
+
+        * bindings/v8/NPV8Object.cpp:
+        (_NPN_GetProperty): If the result is empty, don't try to convert it to an NPVariant and return false.
+
+2010-03-02  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [V8] DOMCoreException should be visible as DOMException 
+        https://bugs.webkit.org/show_bug.cgi?id=35552
+
+        Fix V8 code generator to use the correct visible name.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+
+2010-03-02  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION(r51097) - Unable to log in to statefarm.com
+        <rdar://problem/7672667> and https://bugs.webkit.org/show_bug.cgi?id=35556
+
+        Test: fast/loader/for-window-event-onload-scripts.html
+
+        Match Gecko's rules for executing "for/event" scripts:
+          -If there's only a 'for' attribute, execute it.
+          -If there's only an 'event' attribute, execute it.
+          -If there's a 'for=window' and 'event=onload', execute it.
+          -If there's a 'for=window' and 'event=onload()', execute it.
+          -If there's any other combination of both 'for' and 'event', don't execute it.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::shouldExecuteAsJavaScript):
+        * dom/ScriptElement.h:
+
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::eventAttributeValue):
+        * html/HTMLScriptElement.h:
+
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::eventAttributeValue):
+        * svg/SVGScriptElement.h:
+
+        Add the event attribute name:
+        * html/HTMLAttributeNames.in:
+
+
+2010-03-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35555
+        QuickTime plugin content can spill outside the <object> tag
+
+        Set -masksToBounds on the layer that is handed to us by plug-ins, to ensure that sublayers
+        of that layer don't spill outside the <object> contents rect.
+        
+        Manual test because it relies on QuickTime, and pixel results depend on movie loading timing.
+
+        * manual-tests/plugins/object-clipping.html: Added.
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::GraphicsLayerCA::setupContentsLayer):
+
+2010-03-02  Adam Roben  <aroben@apple.com>
+
+        Export SecurityOrigin::registerURLSchemeAsSecure
+
+        Fixes <http://webkit.org/b/35580> <rdar://problem/7706407> Expose
+        SecurityOrigin::registerURLSchemeAsSecure as WebKit SPI
+
+        Reviewed by Tim Hatcher.
+
+        * WebCore.base.exp: Added symbol, sorted file.
+
+2010-03-02  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: render breakpoints as border images instead of canvas.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35535
+
+        * inspector/front-end/Images/breakpointBorder.png: Added.
+        * inspector/front-end/Images/breakpointConditionalBorder.png: Added.
+        * inspector/front-end/Images/breakpointConditionalCounterBorder.png: Added.
+        * inspector/front-end/Images/breakpointCounterBorder.png: Added.
+        * inspector/front-end/Images/programCounterBorder.png: Added.
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._updateExecutionLine):
+        (WebInspector.SourceFrame.prototype._addBreakpointToSource):
+        (WebInspector.SourceFrame.prototype.resize):
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextChunk):
+        * inspector/front-end/textViewer.css:
+
+2010-01-28  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Special case Font::floatWidthForComplexText for single space
+        https://bugs.webkit.org/show_bug.cgi?id=33876
+
+        For a single space we can go through the QFontMetric::width routine
+        instead of converting the WebCore::String to a QString and then
+        going through the QTextLine.
+
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::floatWidthForComplexText):
+
+2010-02-28  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Gustavo Noronha.
+
+        [Gtk] Support private browsing mode in plugins.
+        https://bugs.webkit.org/show_bug.cgi?id=35500
+
+        Integrate the PluginViewQt.cpp changes from r55358 into Gtk+.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::getValue):
+
+2010-03-02  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by NOBODY (Build fix).
+
+        Update Qt bridge to new named getter signature
+
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::QtRuntimeMetaMethod::lengthGetter):
+        (JSC::Bindings::QtRuntimeMetaMethod::connectGetter):
+        (JSC::Bindings::QtRuntimeMetaMethod::disconnectGetter):
+        (JSC::Bindings::QtRuntimeConnectionMethod::lengthGetter):
+        * bridge/qt/qt_runtime.h:
+
+2010-03-01  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        [GTK] Move gstreamer-related source files to platform/graphics/gstreamer
+        https://bugs.webkit.org/show_bug.cgi?id=35518
+
+        Moved GStreamer-related files to platform/graphics/gstreamer so
+        other ports could benefit from this media player implementation.
+
+        * GNUmakefile.am:
+        * platform/graphics/gstreamer/DataSourceGStreamer.cpp: Renamed from WebCore/platform/graphics/gtk/DataSourceGStreamer.cpp.
+        (_do_init):
+        (webkit_data_src_base_init):
+        (webkit_data_src_class_init):
+        (webkit_data_src_reset):
+        (webkit_data_src_init):
+        (webkit_data_src_finalize):
+        (webkit_data_src_change_state):
+        (webkit_data_src_uri_get_type):
+        (webkit_data_src_uri_get_protocols):
+        (webkit_data_src_uri_get_uri):
+        (webkit_data_src_uri_set_uri):
+        (webkit_data_src_uri_handler_init):
+        * platform/graphics/gstreamer/DataSourceGStreamer.h: Renamed from WebCore/platform/graphics/gtk/DataSourceGStreamer.h.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Renamed from WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp.
+        (WebCore::greatestCommonDivisor):
+        (WebCore::mediaPlayerPrivateMessageCallback):
+        (WebCore::mediaPlayerPrivateSourceChangedCallback):
+        (WebCore::mediaPlayerPrivateVolumeChangedCallback):
+        (WebCore::notifyVolumeIdleCallback):
+        (WebCore::mediaPlayerPrivateMuteChangedCallback):
+        (WebCore::notifyMuteIdleCallback):
+        (WebCore::bufferingTimeoutCallback):
+        (WebCore::playbackPosition):
+        (WebCore::mediaPlayerPrivateRepaintCallback):
+        (WebCore::MediaPlayerPrivate::create):
+        (WebCore::MediaPlayerPrivate::registerMediaEngine):
+        (WebCore::doGstInit):
+        (WebCore::MediaPlayerPrivate::isAvailable):
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::changePipelineState):
+        (WebCore::MediaPlayerPrivate::play):
+        (WebCore::MediaPlayerPrivate::pause):
+        (WebCore::MediaPlayerPrivate::duration):
+        (WebCore::MediaPlayerPrivate::currentTime):
+        (WebCore::MediaPlayerPrivate::seek):
+        (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
+        (WebCore::MediaPlayerPrivate::cancelSeek):
+        (WebCore::MediaPlayerPrivate::endPointTimerFired):
+        (WebCore::MediaPlayerPrivate::paused):
+        (WebCore::MediaPlayerPrivate::seeking):
+        (WebCore::MediaPlayerPrivate::naturalSize):
+        (WebCore::MediaPlayerPrivate::hasVideo):
+        (WebCore::MediaPlayerPrivate::hasAudio):
+        (WebCore::MediaPlayerPrivate::setVolume):
+        (WebCore::MediaPlayerPrivate::volumeChangedCallback):
+        (WebCore::MediaPlayerPrivate::volumeChanged):
+        (WebCore::MediaPlayerPrivate::setRate):
+        (WebCore::MediaPlayerPrivate::networkState):
+        (WebCore::MediaPlayerPrivate::readyState):
+        (WebCore::MediaPlayerPrivate::buffered):
+        (WebCore::MediaPlayerPrivate::processBufferingStats):
+        (WebCore::MediaPlayerPrivate::queryBufferingStats):
+        (WebCore::MediaPlayerPrivate::maxTimeSeekable):
+        (WebCore::MediaPlayerPrivate::maxTimeLoaded):
+        (WebCore::MediaPlayerPrivate::bytesLoaded):
+        (WebCore::MediaPlayerPrivate::totalBytes):
+        (WebCore::MediaPlayerPrivate::cancelLoad):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        (WebCore::MediaPlayerPrivate::mediaLocationChanged):
+        (WebCore::MediaPlayerPrivate::loadNextLocation):
+        (WebCore::MediaPlayerPrivate::loadStateChanged):
+        (WebCore::MediaPlayerPrivate::sizeChanged):
+        (WebCore::MediaPlayerPrivate::timeChanged):
+        (WebCore::MediaPlayerPrivate::didEnd):
+        (WebCore::MediaPlayerPrivate::durationChanged):
+        (WebCore::MediaPlayerPrivate::supportsMuting):
+        (WebCore::MediaPlayerPrivate::setMuted):
+        (WebCore::MediaPlayerPrivate::muteChangedCallback):
+        (WebCore::MediaPlayerPrivate::muteChanged):
+        (WebCore::MediaPlayerPrivate::loadingFailed):
+        (WebCore::MediaPlayerPrivate::setSize):
+        (WebCore::MediaPlayerPrivate::setVisible):
+        (WebCore::MediaPlayerPrivate::repaint):
+        (WebCore::MediaPlayerPrivate::paint):
+        (WebCore::mimeTypeCache):
+        (WebCore::MediaPlayerPrivate::getSupportedTypes):
+        (WebCore::MediaPlayerPrivate::supportsType):
+        (WebCore::MediaPlayerPrivate::hasSingleSecurityOrigin):
+        (WebCore::MediaPlayerPrivate::supportsFullscreen):
+        (WebCore::MediaPlayerPrivate::setAutobuffer):
+        (WebCore::MediaPlayerPrivate::createGSTPlayBin):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Renamed from WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h.
+        (WebCore::MediaPlayerPrivate::pipelineReset):
+        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: Renamed from WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp.
+        (webkit_video_sink_base_init):
+        (webkit_video_sink_init):
+        (webkit_video_sink_timeout_func):
+        (webkit_video_sink_render):
+        (webkit_video_sink_dispose):
+        (unlock_buffer_mutex):
+        (webkit_video_sink_unlock):
+        (webkit_video_sink_unlock_stop):
+        (webkit_video_sink_stop):
+        (webkit_video_sink_start):
+        (marshal_VOID__MINIOBJECT):
+        (webkit_video_sink_class_init):
+        (webkit_video_sink_new):
+        * platform/graphics/gstreamer/VideoSinkGStreamer.h: Renamed from WebCore/platform/graphics/gtk/VideoSinkGStreamer.h.
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Renamed from WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.cpp.
+        (doInit):
+        (webkit_web_src_base_init):
+        (webkit_web_src_class_init):
+        (webkit_web_src_init):
+        (webKitWebSrcFinalize):
+        (webKitWebSrcSetProperty):
+        (webKitWebSrcGetProperty):
+        (webKitWebSrcStop):
+        (webKitWebSrcStart):
+        (webKitWebSrcChangeState):
+        (webKitWebSrcUriGetType):
+        (webKitWebSrcGetProtocols):
+        (webKitWebSrcGetUri):
+        (webKitWebSrcSetUri):
+        (webKitWebSrcUriHandlerInit):
+        (webKitWebSrcNeedDataMainCb):
+        (webKitWebSrcNeedDataCb):
+        (webKitWebSrcEnoughDataMainCb):
+        (webKitWebSrcEnoughDataCb):
+        (webKitWebSrcSeekMainCb):
+        (webKitWebSrcSeekDataCb):
+        (webKitWebSrcSetFrame):
+        (StreamingClient::StreamingClient):
+        (StreamingClient::~StreamingClient):
+        (StreamingClient::willSendRequest):
+        (StreamingClient::didReceiveResponse):
+        (StreamingClient::didReceiveData):
+        (StreamingClient::didFinishLoading):
+        (StreamingClient::didFail):
+        (StreamingClient::wasBlocked):
+        (StreamingClient::cannotShowURL):
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Renamed from WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.h.
+
+2010-03-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Refactor named getter function signature to be in line with indexing getter signature
+        https://bugs.webkit.org/show_bug.cgi?id=35563
+
+        Fix up WebCore to use the new named getter function signature, update the
+        codegenerator to the new calling convention, and fix the custom bindings.
+
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::nameGetter):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::objectToStringFunctionGetter):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::nonCachingStaticFunctionGetter):
+        (WebCore::childFrameGetter):
+        (WebCore::namedItemGetter):
+        * bindings/js/JSDataGridColumnListCustom.cpp:
+        (WebCore::JSDataGridColumnList::nameGetter):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::JSHTMLAllCollection::nameGetter):
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::JSHTMLCollection::nameGetter):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::nameGetter):
+        * bindings/js/JSHTMLFrameSetElementCustom.cpp:
+        (WebCore::JSHTMLFrameSetElement::nameGetter):
+        * bindings/js/JSHistoryCustom.cpp:
+        (WebCore::nonCachingStaticBackFunctionGetter):
+        (WebCore::nonCachingStaticForwardFunctionGetter):
+        (WebCore::nonCachingStaticGoFunctionGetter):
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::nonCachingStaticReplaceFunctionGetter):
+        (WebCore::nonCachingStaticReloadFunctionGetter):
+        (WebCore::nonCachingStaticAssignFunctionGetter):
+        * bindings/js/JSMimeTypeArrayCustom.cpp:
+        (WebCore::JSMimeTypeArray::nameGetter):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::nameGetter):
+        * bindings/js/JSNodeListCustom.cpp:
+        (WebCore::JSNodeList::nameGetter):
+        * bindings/js/JSPluginArrayCustom.cpp:
+        (WebCore::JSPluginArray::nameGetter):
+        * bindings/js/JSPluginCustom.cpp:
+        (WebCore::JSPlugin::nameGetter):
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::runtimeObjectPropertyGetter):
+        * bindings/js/JSPluginElementFunctions.h:
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::nameGetter):
+        * bindings/js/JSStyleSheetListCustom.cpp:
+        (WebCore::JSStyleSheetList::nameGetter):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::lengthGetter):
+        * bridge/runtime_array.h:
+        * bridge/runtime_method.cpp:
+        (JSC::RuntimeMethod::lengthGetter):
+        * bridge/runtime_method.h:
+        * bridge/runtime_object.cpp:
+        (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
+        (JSC::Bindings::RuntimeObject::fieldGetter):
+        (JSC::Bindings::RuntimeObject::methodGetter):
+        * bridge/runtime_object.h:
+
+2010-03-01  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        PropertySlot::getValue(ExecState, unsigned) unnecessarily converts index to an Identifier
+        https://bugs.webkit.org/show_bug.cgi?id=35561
+
+        Update bindings generation and the few manual indexing getters we have to use
+        the new PropertySlot API.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::indexGetter):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::indexGetter):
+        * bridge/runtime_array.h:
+
+2010-03-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=35514
+
+        When a table's DOM is changed and an AX Table is not asked first for its children,
+        it would return wrong information. A table needs to make sure children are up to date in
+        all methods that can be called from the outside.
+
+        Test: platform/mac/accessibility/stale-table-rows.html
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::cellForColumnAndRow):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::clearChildren):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::clearChildren):
+        (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
+        (WebCore::AccessibilityRenderObject::children):
+        * accessibility/AccessibilityRenderObject.h:
+        (WebCore::AccessibilityRenderObject::needsToUpdateChildren):
+        (WebCore::AccessibilityRenderObject::setNeedsToUpdateChildren):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::clearChildren):
+        (WebCore::AccessibilityTable::columns):
+        (WebCore::AccessibilityTable::rows):
+        (WebCore::AccessibilityTable::rowHeaders):
+        (WebCore::AccessibilityTable::columnHeaders):
+        (WebCore::AccessibilityTable::cells):
+        (WebCore::AccessibilityTable::columnCount):
+        (WebCore::AccessibilityTable::rowCount):
+        (WebCore::AccessibilityTable::cellForColumnAndRow):
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Convert the zoom mode (page vs. text-only) into a proper enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * GNUmakefile.am:
+        * WebCore.base.exp: Substituted symbols __ZN7WebCore5Frame13setZoomFactorEfNS_8ZoomModeE
+        and __ZN7WebCore8Settings11setZoomModeENS_8ZoomModeE for __ZN7WebCore5Frame13setZoomFactorEfb
+        and __ZN7WebCore8Settings16setZoomsTextOnlyEb, respectively.
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/Frame.cpp:
+        (WebCore::Frame::zoomMode):
+        (WebCore::Frame::shouldApplyTextZoom):
+        (WebCore::Frame::shouldApplyPageZoom):
+        (WebCore::Frame::setZoomFactor):
+        * page/Frame.h:
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setZoomMode):
+        * page/Settings.h:
+        (WebCore::Settings::zoomMode):
+        * page/ZoomMode.h: Added.
+        (WebCore::):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::setCurrentScale):
+
+2010-03-01  Alex Milowski  <alex@milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added support for the msubsup element that also handles the msup and msub elements.
+
+        Test: mathml/presentation/subsup.xhtml
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::createRenderer):
+        * mathml/RenderMathMLSubSup.cpp: Added.
+        (WebCore::RenderMathMLSubSup::RenderMathMLSubSup):
+        (WebCore::RenderMathMLSubSup::addChild):
+        (WebCore::RenderMathMLSubSup::stretchToHeight):
+        (WebCore::RenderMathMLSubSup::nonOperatorHeight):
+        (WebCore::RenderMathMLSubSup::layout):
+        (WebCore::RenderMathMLSubSup::baselinePosition):
+        * mathml/RenderMathMLSubSup.h: Added.
+        (WebCore::RenderMathMLSubSup::hasBase):
+        (WebCore::RenderMathMLSubSup::):
+
+2010-03-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: use dejavu sans mono 11px on linux.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35527
+
+        * inspector/front-end/inspector.css:
+
+2010-03-01  Thatcher Ulrich  <tulrich@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Fix chromium iframe shims.  Add another test case to the
+        iframes-shims test.  After r53637, the plugin widget doesn't get
+        moved every paint.  This used to hide the bug that if an iframe
+        gets added, the plugin's cutout rectangles don't get updated until
+        a layout happens.
+        https://bugs.webkit.org/show_bug.cgi?id=35184
+
+        * platform/Widget.h:
+        (WebCore::Widget::widgetPositionsUpdated): new virtual method
+            widgetPositionsUpdated() to notify widgets when other widgets on
+            the page have been repositioned.
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::updateWidgetPositions): call widgetPositionsUpdated() on the widgets
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::widgetPositionsUpdated): call widgetPositionsUpdated() on the widget
+        * rendering/RenderWidget.h:
+
+2010-03-01  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Holger Freyther.
+
+        Dist some mathml related files
+
+        * GNUmakefile.am:
+
+2010-03-01  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Oliver Hunt.
+
+        Integer overflow in WebGL arrays
+        https://bugs.webkit.org/show_bug.cgi?id=35241
+
+        Test: fast/canvas/webgl/webgl-array-invalid-ranges.html
+
+        * bindings/js/JSWebGLArrayBufferConstructor.cpp:
+        (WebCore::constructCanvasArrayBuffer):
+        * bindings/js/JSWebGLArrayBufferConstructor.h:
+        (WebCore::construct):
+        * bindings/js/JSWebGLArrayHelper.h:
+        (WebCore::setWebGLArrayFromArray):
+        * bindings/js/JSWebGLByteArrayConstructor.cpp:
+        (WebCore::constructCanvasByteArray):
+        * bindings/js/JSWebGLFloatArrayConstructor.cpp:
+        (WebCore::constructCanvasFloatArray):
+        * bindings/js/JSWebGLIntArrayConstructor.cpp:
+        (WebCore::constructCanvasIntArray):
+        * bindings/js/JSWebGLShortArrayConstructor.cpp:
+        (WebCore::constructCanvasShortArray):
+        * bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp:
+        (WebCore::constructCanvasUnsignedByteArray):
+        * bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp:
+        (WebCore::constructCanvasUnsignedIntArray):
+        * bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp:
+        (WebCore::constructCanvasUnsignedShortArray):
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::toUInt32):
+        * bindings/v8/V8Binding.h:
+        (WebCore::toUInt32):
+        * bindings/v8/custom/V8WebGLArrayBufferCustom.cpp:
+        (WebCore::V8WebGLArrayBuffer::constructorCallback):
+        * bindings/v8/custom/V8WebGLArrayCustom.h:
+        (WebCore::constructWebGLArray):
+        (WebCore::getWebGLArrayElement):
+        (WebCore::setWebGLArrayFromArray):
+        (WebCore::setWebGLArray):
+        * bindings/v8/custom/V8WebGLByteArrayCustom.cpp:
+        (WebCore::V8WebGLByteArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLFloatArrayCustom.cpp:
+        (WebCore::V8WebGLFloatArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLIntArrayCustom.cpp:
+        (WebCore::V8WebGLIntArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLShortArrayCustom.cpp:
+        (WebCore::V8WebGLShortArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp:
+        (WebCore::V8WebGLUnsignedByteArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp:
+        (WebCore::V8WebGLUnsignedIntArray::constructorCallback):
+        * bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp:
+        (WebCore::V8WebGLUnsignedShortArray::constructorCallback):
+        * html/canvas/WebGLArray.cpp:
+        (WebCore::WebGLArray::setImpl):
+        * html/canvas/WebGLArray.h:
+        (WebCore::WebGLArray::verifySubRange):
+        (WebCore::WebGLArray::clampOffsetAndNumElements):
+        * html/canvas/WebGLArrayBuffer.cpp:
+        (WebCore::WebGLArrayBuffer::create):
+        (WebCore::WebGLArrayBuffer::WebGLArrayBuffer):
+        (WebCore::WebGLArrayBuffer::tryAllocate):
+        * html/canvas/WebGLArrayBuffer.h:
+        * html/canvas/WebGLByteArray.cpp:
+        (WebCore::WebGLByteArray::create):
+        (WebCore::WebGLByteArray::WebGLByteArray):
+        (WebCore::WebGLByteArray::slice):
+        * html/canvas/WebGLByteArray.h:
+        * html/canvas/WebGLFloatArray.cpp:
+        (WebCore::WebGLFloatArray::create):
+        (WebCore::WebGLFloatArray::WebGLFloatArray):
+        (WebCore::WebGLFloatArray::slice):
+        * html/canvas/WebGLFloatArray.h:
+        * html/canvas/WebGLIntArray.cpp:
+        (WebCore::WebGLIntArray::create):
+        (WebCore::WebGLIntArray::WebGLIntArray):
+        (WebCore::WebGLIntArray::slice):
+        * html/canvas/WebGLIntArray.h:
+        * html/canvas/WebGLShortArray.cpp:
+        (WebCore::WebGLShortArray::create):
+        (WebCore::WebGLShortArray::WebGLShortArray):
+        (WebCore::WebGLShortArray::slice):
+        * html/canvas/WebGLShortArray.h:
+        * html/canvas/WebGLUnsignedByteArray.cpp:
+        (WebCore::WebGLUnsignedByteArray::create):
+        (WebCore::WebGLUnsignedByteArray::WebGLUnsignedByteArray):
+        (WebCore::WebGLUnsignedByteArray::slice):
+        * html/canvas/WebGLUnsignedByteArray.h:
+        * html/canvas/WebGLUnsignedIntArray.cpp:
+        (WebCore::WebGLUnsignedIntArray::create):
+        (WebCore::WebGLUnsignedIntArray::WebGLUnsignedIntArray):
+        (WebCore::WebGLUnsignedIntArray::slice):
+        * html/canvas/WebGLUnsignedIntArray.h:
+        * html/canvas/WebGLUnsignedShortArray.cpp:
+        (WebCore::WebGLUnsignedShortArray::create):
+        (WebCore::WebGLUnsignedShortArray::WebGLUnsignedShortArray):
+        (WebCore::WebGLUnsignedShortArray::slice):
+        * html/canvas/WebGLUnsignedShortArray.h:
+
+2010-03-01  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION: Telling a WebView to go to its current WebHistoryItem is broken.
+        <rdar://problem/7699371> and https://bugs.webkit.org/show_bug.cgi?id=35532
+
+        Test: fast/loader/api-test-go-to-current-back-forward-item.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadItem): If the current item is the same as the target item, don't
+          consider this to be a same document navigation.
+
+        * page/Page.cpp:
+        (WebCore::Page::goToItem): Hard code the "going to the same item as the current item" relationship
+          as a precondition for stopping all loaders, as that will be a new document load.
+
+2010-03-01  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by nobody, build fix.
+
+        Fix --minimal build. Add ENABLE(DATABASE) as compile time condition
+        for building file GeolocationPositionCache.cpp.
+
+        * page/GeolocationPositionCache.cpp:
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        [OpenVG] Implement support for paths
+        https://bugs.webkit.org/show_bug.cgi?id=34366
+
+        Adds an implementation of the Path class -
+        *almost* complete, but not quite because OpenVG
+        does not provide access to the points in a VGPath
+        unless one keeps track of all the points by
+        themselves, which we decided not to do.
+
+        Also hooked up to PainterOpenVG and GraphicsContext.
+
+        Further introduced is SharedResourceOpenVG, which is
+        intended as base class for paths and other OpenVG
+        resources (images, fonts) that WebKit creates as
+        long-lived objects. We are at a slight disadvantage
+        here as WebKit doesn't have the concept of resources
+        belonging to a specific (hardware graphics) context,
+        which is the reason why EGLDisplayOpenVG had to
+        provide a current display singleton; this class is
+        what actually requires that functionality.
+
+        Path::addArcTo() uses code by Yong Li <yoli@rim.com>.
+
+        * platform/graphics/Path.cpp:
+        * platform/graphics/Path.h:
+        * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
+        (WebCore::GraphicsContext::fillPath):
+        (WebCore::GraphicsContext::strokePath):
+        (WebCore::GraphicsContext::drawPath):
+        (WebCore::GraphicsContext::beginPath):
+        (WebCore::GraphicsContext::addPath):
+        * platform/graphics/openvg/PainterOpenVG.cpp:
+        (WebCore::PainterOpenVG::PainterOpenVG):
+        (WebCore::PainterOpenVG::~PainterOpenVG):
+        (WebCore::PainterOpenVG::transformPath):
+        (WebCore::PainterOpenVG::beginPath):
+        (WebCore::PainterOpenVG::addPath):
+        (WebCore::PainterOpenVG::currentPath):
+        (WebCore::PainterOpenVG::drawPath):
+        * platform/graphics/openvg/PainterOpenVG.h:
+        * platform/graphics/openvg/PathOpenVG.cpp: Added.
+        (WebCore::PlatformPathOpenVG::PlatformPathOpenVG):
+        (WebCore::PlatformPathOpenVG::operator=):
+        (WebCore::PlatformPathOpenVG::~PlatformPathOpenVG):
+        (WebCore::PlatformPathOpenVG::clear):
+        (WebCore::PlatformPathOpenVG::createPath):
+        (WebCore::Path::Path):
+        (WebCore::Path::~Path):
+        (WebCore::Path::operator=):
+        (WebCore::Path::contains):
+        (WebCore::Path::strokeContains):
+        (WebCore::Path::translate):
+        (WebCore::Path::boundingRect):
+        (WebCore::Path::strokeBoundingRect):
+        (WebCore::Path::moveTo):
+        (WebCore::Path::addLineTo):
+        (WebCore::Path::addQuadCurveTo):
+        (WebCore::Path::addBezierCurveTo):
+        (WebCore::Path::addArcTo):
+        (WebCore::Path::closeSubpath):
+        (WebCore::Path::addArc):
+        (WebCore::Path::addRect):
+        (WebCore::Path::addEllipse):
+        (WebCore::Path::clear):
+        (WebCore::Path::isEmpty):
+        (WebCore::Path::hasCurrentPoint):
+        (WebCore::Path::debugString):
+        (WebCore::Path::apply):
+        (WebCore::Path::transform):
+        (WebCore::Path::length):
+        (WebCore::Path::pointAtLength):
+        (WebCore::Path::normalAngleAtLength):
+        * platform/graphics/openvg/PlatformPathOpenVG.h: Added.
+        (WebCore::PlatformPathOpenVG::vgPath):
+        * platform/graphics/openvg/SharedResourceOpenVG.cpp: Added.
+        (WebCore::SharedResourceOpenVG::makeSharedContextCurrent):
+        (WebCore::SharedResourceOpenVG::makeCompatibleContextCurrent):
+        * platform/graphics/openvg/SharedResourceOpenVG.h: Added.
+
+2010-03-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed, bring English.lproj/locallizedStrings.js back to binary (UTF) mode.
+
+        * English.lproj/localizedStrings.js:
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Nikolas Zimmermann.
+
+        [OpenVG] Convert from TransformationMatrix to AffineTransform.
+        https://bugs.webkit.org/show_bug.cgi?id=35445
+
+        Dirk Schulze previously introduced AffineTransform as
+        replacement for most TransformationMatrix occurrences
+        in GraphicsContext & Co., but did not update the OpenVG
+        graphics backend as there's no publicly available way
+        to build it. This commit now takes care of that.
+
+        * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
+        (WebCore::GraphicsContext::getCTM):
+        (WebCore::GraphicsContext::roundToDevicePixels):
+        (WebCore::GraphicsContext::origin):
+        (WebCore::GraphicsContext::concatCTM):
+        * platform/graphics/openvg/PainterOpenVG.cpp:
+        (WebCore::isNonRotatedAffineTransformation):
+        (WebCore::PlatformPainterState::PlatformPainterState):
+        (WebCore::PlatformPainterState::applyState):
+        (WebCore::PlatformPainterState::applyTransformation):
+        (WebCore::PainterOpenVG::transformation):
+        (WebCore::PainterOpenVG::concatTransformation):
+        (WebCore::PainterOpenVG::setTransformation):
+        (WebCore::PainterOpenVG::scale):
+        (WebCore::PainterOpenVG::rotate):
+        (WebCore::PainterOpenVG::translate):
+        (WebCore::PainterOpenVG::intersectClipRect):
+        * platform/graphics/openvg/PainterOpenVG.h:
+        * platform/graphics/openvg/VGUtils.cpp:
+        (WebCore::VGMatrix::VGMatrix):
+        (WebCore::VGMatrix::operator AffineTransform):
+        (WebCore::VGMatrix::operator TransformationMatrix):
+        (WebCore::AffineTransform::operator VGMatrix):
+        * platform/graphics/openvg/VGUtils.h:
+        * platform/graphics/transforms/AffineTransform.h:
+
+2010-03-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix segfault when drawing NPAPI plugins on Mac
+
+        Don't try to get a contexctRef for a null-pixmap. If the pixmap
+        size is 0,0 the private pixmap data has not yet been initialized.
+
+        * plugins/mac/PluginViewMac.cpp:
+
+2010-03-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fix the Qt build on Mac OS X/Cocoa 64-bit
+
+        Use the proper event/drawing-model guards instead of global 64-bit
+        guard for the NPAPI plugin implementation (view and package).
+
+        * plugins/mac/PluginPackageMac.cpp: Change guards and fix warning
+        * plugins/mac/PluginViewMac.cpp: Remove 64-bit guard
+
+2010-02-27  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: disable breakpoint upon Shift-click.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35477
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._format):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._mouseDown):
+        (WebInspector.SourceFrame.prototype._mouseMove):
+        * inspector/front-end/textViewer.css:
+
+2010-02-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35496
+        <rdar://problem/7663444> Opening newsweek.com and youtube.com has become very slow in debug builds
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSRuleSet::getIDRules):
+        (WebCore::CSSRuleSet::getClassRules):
+        (WebCore::CSSRuleSet::getTagRules):
+        Removed consistency checks, as they affect performance too much in this case.
+
+2010-02-28  Robert Hogan  <robert@roberthogan.net>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Support private browsing mode in plugins
+
+        Add support for NPNVprivateModeBool property in plugins.
+
+        See also: https://developer.mozilla.org/En/Supporting_private_browsing_in_plugins
+
+        The NPNVprivateModeBool property is supported as scriptable property privateBrowsingEnabled
+        in the test WebKit plugin. The Mac platform also supports a cachedPrivateBrowsingEnabled
+        property implemented in the test plugin. This allows the Layout test
+        plugins/private-browsing-mode.html to retrieve the previous value of NPNVprivateModeBool
+        in the test plugin. Due to the platform-specific overhead required to support this bespoke
+        property it is not implemented as part of this patch, instead a new test,
+        plugins/private-browsing-mode-2.html, is added to ensure that setting and resetting
+        privateBrowsingEnabled works as expected.
+
+        http://bugs.webkit.org/show_bug.cgi?id=33180
+
+        Test: plugins/private-browsing-mode-2.html
+
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::getValue):
+
+
+2010-02-27  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector shouldn't show a white color box for "-webkit-line-break: after-white-space"
+        https://bugs.webkit.org/show_bug.cgi?id=33478
+
+        * inspector/front-end/StylesSidebarPane.js:
+
+2010-02-27  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/7696607> Links do not respect -webkit-user-drag: none
+        https://bugs.webkit.org/show_bug.cgi?id=35475
+
+        Test: fast/css/user-drag-none.html
+
+        * page/DragController.cpp:
+        (WebCore::DragController::mayStartDragAtEventLocation): Added a node
+        parameter. The image drag check is done against the node, rather than
+        than against the hit test result. This prevents a non-draggable image
+        with an auto-draggable ancestor from being dragged alone. The link drag
+        check now ignores links that are -webkit-user-drag: none.
+        * page/DragController.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::shouldDragAutoNode): Pass the current node
+        to mayStartDragAtEventLocation().
+
+2010-02-27  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: REGRESSION: hangs when scrolling in Resource pane.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35216
+
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter):
+        (WebInspector.TextEditorHighlighter.prototype.highlight):
+        (WebInspector.TextEditorHighlighter.prototype._highlightInChunks):
+        (WebInspector.TextEditorHighlighter.prototype._highlightLines):
+
+2010-02-27  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Abort XEmbed plugin initialization if our parent is not anchored
+        in a widget hierarchy. This can happen when the browser window is
+        destroyed while the plugin is being loaded, and will lead to a
+        crash.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::platformStart):
+
+2010-02-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: reload inspected page on Cmd+R / Ctrl+R / F5 key event in inspector.
+        Drive-by fix for couple of minor front-end problems.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35434
+
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::reloadPage):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didFinishLoading):
+        (WebCore::InspectorController::didFailLoading):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.reloadPage):
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        (.WebInspector.InspectorFrontendHostStub.prototype.copyText):
+        (.WebInspector.InspectorFrontendHostStub.prototype.canAttachWindow):
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer.prototype._paintLine):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentKeyDown):
+        (WebInspector.toggleAttach):
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * platform/efl/ScrollbarEfl.cpp: Added.
+        * platform/efl/EventLoopEfl.cpp: Added.
+        * platform/efl/PlatformKeyboardEventEfl.cpp: Added.
+        * platform/efl/DragImageEfl.cpp: Added.
+        * platform/efl/PlatformMouseEventEfl.cpp: Added.
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * platform/efl/CursorEfl.cpp: Added.
+        * platform/efl/LocalizedStringsEfl.cpp: Added.
+        * platform/efl/SearchPopupMenuEfl.cpp: Added.
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to page/efl.
+        http://webkit.org/b/35087
+
+        * WebCore/page/efl/DragControllerEfl.cpp: Added.
+        * WebCore/page/efl/FrameEfl.cpp: Added.
+        * WebCore/page/efl/AccessibilityObjectEfl.cpp: Added.
+        * WebCore/page/efl/EventHandlerEfl.cpp: Added.
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * WebCore/platform/efl/LoggingEfl.cpp: Added.
+        * WebCore/platform/efl/ScrollbarThemeEfl.cpp: Added.
+        * WebCore/platform/efl/TemporaryLinkStubs.cpp: Added.
+        * WebCore/platform/efl/ScrollViewEfl.cpp: Added.
+        * WebCore/platform/efl/SharedBufferEfl.cpp: Added.
+        * WebCore/platform/efl/DragDataEfl.cpp: Added.
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * WebCore/platform/efl/RenderThemeEfl.cpp: Added.
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * WebCore/platform/efl/PlatformWheelEventEfl.cpp: Added.
+        * WebCore/platform/efl/FileChooserEfl.cpp: Added.
+        * WebCore/platform/efl/ContextMenuEfl.cpp: Added.
+        * WebCore/platform/efl/PlatformScreenEfl.cpp: Added.
+        * WebCore/platform/efl/WidgetEfl.cpp: Added.
+
+2010-02-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Expose an API for ports to add schemes to the mixed content whitelist
+        https://bugs.webkit.org/show_bug.cgi?id=35438
+
+        Add a notion of a "secure" scheme that doesn't trigger mixed content
+        warnings.  Let folks register new secure schemes in the same way they
+        can register "local" schemes.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::isMixedContent):
+        * page/SecurityOrigin.cpp:
+        (WebCore::secureSchemes):
+        (WebCore::SecurityOrigin::registerURLSchemeAsSecure):
+        (WebCore::SecurityOrigin::shouldTreatURLSchemeAsSecure):
+        * page/SecurityOrigin.h:
+
+2010-02-26  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] GraphicsLayerQt: artifacts and wrong transformOrigin
+        This was due to wrong way of applying cache-mode and transformation
+        on a graphics-item with HTML. Cache-mode should be updated
+        when the content type updates, even if it was the same cache-mode
+   
+        https://bugs.webkit.org/show_bug.cgi?id=35382
+
+        Test URL attached to the bug now works correctly.
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::computeTransform):
+        (WebCore::GraphicsLayerQtImpl::flushChanges):
+
+2010-02-26  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Qt/Mac: Revert null timer removal (r51105)
+        https://bugs.webkit.org/show_bug.cgi?id=35396
+
+        r51105 removed the null timer event of the carbon event model. This however
+        breaks the flash of many sites.        
+
+        Applying patch suggested by Girish Ramakrishnan in bug comment #1.
+
+        * plugins/PluginView.h:
+        * plugins/mac/PluginViewMac.cpp:
+        (WebCore::PluginView::platformStart):
+        (WebCore::PluginView::handleMouseEvent):
+        (WebCore::PluginView::nullEventTimerFired):
+        (WebCore::PluginView::mousePosForPlugin):
+
+2010-02-26  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Compile error with 3d-canvas
+        Replaced a direct gl call with a getProcAddress call
+        https://bugs.webkit.org/show_bug.cgi?id=35448
+
+        No new tests.
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::blendColor):
+
+2010-02-26  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [BREWMP] Port EventHandler
+        https://bugs.webkit.org/show_bug.cgi?id=34796
+
+        Add platform-specific code required to implement EventHandler.
+
+        * page/brew/EventHandlerBrew.cpp: Added.
+        (WebCore::EventHandler::tabsToAllControls):
+        (WebCore::EventHandler::focusDocumentView):
+        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+        (WebCore::EventHandler::passMouseDownEventToWidget):
+        (WebCore::EventHandler::eventActivatedView):
+        (WebCore::EventHandler::passSubframeEventToSubframe):
+        (WebCore::EventHandler::passWheelEventToWidget):
+        (WebCore::EventHandler::passMousePressEventToSubframe):
+        (WebCore::EventHandler::passMouseMoveEventToSubframe):
+        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+        (WebCore::EventHandler::accessKeyModifiers):
+
+2010-02-26  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to platform/efl.
+        http://webkit.org/b/35087
+
+        * WebCore/platform/efl/ClipboardEfl.cpp: Added.
+        * WebCore/platform/efl/PopupMenuEfl.cpp: Added.
+        * WebCore/platform/efl/SharedTimerEfl.cpp: Added.
+        * WebCore/platform/efl/RenderThemeEfl.h: Added.
+        * WebCore/platform/efl/Language.cpp: Added.
+        * WebCore/platform/efl/CookieJarEfl.cpp: Added.
+        * WebCore/platform/efl/MIMETypeRegistryEfl.cpp: Added.
+
+2010-02-26  Robert Kroeger  <rjkroege@chromium.org>
+
+        Reviewed by Nate Chapin
+
+        To fire each event handler registered on an SVG node once per
+        event, Chromium needs an implementation of wasCreatedFromMarkup
+        added to V8LazyEventListener.h that matches the one in
+        WebKit/WebCore/bindings/js/JSLazyEventListener.h.
+        
+        This patch adds such a matching implementation of wasCreatedFromMarkup
+        to V8LazyEventListener.h.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35325
+
+        * bindings/v8/V8LazyEventListener.h:
+        (WebCore::V8LazyEventListener::wasCreatedFromMarkup):
+
+2010-02-26  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] use geoclue_position_get_position_async to get geolocation position.
+        https://bugs.webkit.org/show_bug.cgi?id=35355
+
+        No new tests, behaviour depends on system.
+
+        * platform/gtk/GeolocationServiceGtk.cpp:
+        (WebCore::GeolocationServiceGtk::startUpdating):
+        (WebCore::GeolocationServiceGtk::get_position):
+        * platform/gtk/GeolocationServiceGtk.h:
+
+2010-02-26  Yaar Schnitman  <yaar@chromium.org>
+
+        Chromium Win build fix.
+
+        * WebCore.gyp/WebCore.gyp: Added missing file to action input.
+
+2010-02-12  Brett Wilson  <brettw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Update the Google-URL version of KURL and the V8 bindings to the new
+        behavior of KURL.IsStandard.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34859
+
+        This is covered by fast/dom/Window/invalid-protocol.html
+
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::protocolAccessorSetter):
+        * platform/KURLGoogle.cpp:
+        (WebCore::KURL::setProtocol):
+        (WebCore::KURL::isHierarchical):
+
+2010-02-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Build fix following r55312).
+
+        * bridge/qt/qt_pixmapruntime.cpp:
+        (JSC::Bindings::QtPixmapInstance::invokeMethod):
+
+2010-02-26  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Auto-generate and split DerivedSourcesAllInOne.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=33048
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gyp/scripts/action_derivedsourcesallinone.py: Added.
+        * bindings/v8/DerivedSourcesAllInOne.cpp: Removed.
+
+2010-02-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Build fix following r55312).
+
+        * bridge/qt/qt_pixmapruntime.cpp:
+        (JSC::Bindings::QtPixmapInstance::invokeMethod):
+
+2010-02-26  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35450
+        Crash when a Java array property accessor raises an exception
+
+        Test: java/inaccessible-class.html
+
+        * bridge/jni/jsc/JNIBridgeJSC.cpp: (JavaField::valueFromInstance): Check if the result
+        is null before interpreting it as an object or array.
+
+2010-02-26  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Extend AffineTransform to mapQuad
+        https://bugs.webkit.org/show_bug.cgi?id=35444
+
+        This makes mapQuad available for AffineTransform. So that platforms
+        can make use of it after the switch from TransformationMatrix to
+        AffineTransform in GraphicsContext.
+
+        * platform/graphics/transforms/AffineTransform.cpp:
+        (WebCore::AffineTransform::mapRect): mapRect already did the calculation for mapQuad but gave back the
+                                             boundingBox of the resulting FloatQuad.
+        (WebCore::AffineTransform::mapQuad):
+        * platform/graphics/transforms/AffineTransform.h:
+
+2010-02-26  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Pavel Feldman.
+
+        Arrow keys do not scroll source view in Resources pane or Scripts pane.
+        <rdar://problem/7594367> and https://bugs.webkit.org/show_bug.cgi?id=34356
+
+        Handle vertical scrolling in the Text Viewer:
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer): Listen for the keydown event.
+        (WebInspector.TextViewer.prototype._handleKeyDown): If the event has no modifiers and refers
+          to an arrow key, scroll. The horizontal values were ripped from the default "pixels per scroll line"
+          value in ScrollBar.h.
+
+2010-02-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Bug 35401 - Fix handling of errors in handling calls over bridge,
+        where base object bridge-type does not match method bridge-type.
+
+        The code assumes users will only attempt to invoke a Java method
+        on a Java base object, etc.
+        Add language specific subclasses of RuntimeMethod, and pass the
+        RuntimeMethod into invokeMethod, so we can typecheck before
+        casting.  Throw an exception on type mismatch.
+
+        * WebCore.base.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/c/c_instance.cpp:
+        (JSC::Bindings::CRuntimeMethod::CRuntimeMethod):new class to distinguish this type of RuntimeMethod.
+        (JSC::Bindings::CInstance::getMethod): create an appropriate sublclass of RuntimeMethod.
+        (JSC::Bindings::CInstance::invokeMethod): dynamically check the type of the RuntimeMethod.
+        * bridge/c/c_instance.h:
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaRuntimeMethod::JavaRuntimeMethod): new class to distinguish this type of RuntimeMethod.
+        (JavaInstance::getMethod): create an appropriate sublclass of RuntimeMethod.
+        (JavaInstance::invokeMethod): dynamically check the type of the RuntimeMethod.
+        * bridge/jni/jsc/JavaInstanceJSC.h:
+        * bridge/jsc/BridgeJSC.h:
+        * bridge/objc/objc_instance.h:
+        * bridge/objc/objc_instance.mm:
+        (ObjcRuntimeMethod::ObjcRuntimeMethod): new class to distinguish this type of RuntimeMethod.
+        (ObjcInstance::getMethod): create an appropriate sublclass of RuntimeMethod.
+        (ObjcInstance::invokeMethod): dynamically check the type of the RuntimeMethod.
+        (ObjcInstance::invokeObjcMethod): new method, takes an ObjcMethod* as an argument so that we don't need to dynamically determine the type.
+        * bridge/objc/objc_runtime.mm:
+        (JSC::Bindings::callObjCFallbackObject): use new invokeObjcMethod method.
+        * bridge/runtime_method.cpp:
+        (JSC::callRuntimeMethod): pass RuntimeMethod as argument to invokeMethod, rather than its MethodList.
+        * bridge/runtime_object.cpp:
+        (JSC::RuntimeObject::methodGetter): use new getMethod method.
+
+2010-02-26  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        Make the lookup table generator include an explicit cast to expected
+        type of the function.  We do this because otherwise the blind intptr_t
+        cast that is subsequently applied allows incorrectly typed functions
+        to be inserted into the table, where they will only fail at runtime.
+        This change makes such errors produce a compile time failure.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/scripts/CodeGeneratorJS.pm:
+
+2010-02-26  Alex Milowski  <alex@milowski.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added basic support for the munder, munderover, and mover elements.
+
+        Tests: mathml/presentation/over.xhtml
+               mathml/presentation/under.xhtml
+               mathml/presentation/underover.xhtml
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::createRenderer):
+        * mathml/RenderMathMLUnderOver.cpp: Added.
+        (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
+        (WebCore::RenderMathMLUnderOver::addChild):
+        (WebCore::getOffsetHeight):
+        (WebCore::RenderMathMLUnderOver::stretchToHeight):
+        (WebCore::RenderMathMLUnderOver::layout):
+        (WebCore::RenderMathMLUnderOver::baselinePosition):
+        (WebCore::RenderMathMLUnderOver::nonOperatorHeight):
+        * mathml/RenderMathMLUnderOver.h: Added.
+        (WebCore::RenderMathMLUnderOver::hasBase):
+        (WebCore::RenderMathMLUnderOver::):
+
+2010-02-24  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        This CL implements a simple ad-hoc parser for CSS rgb() values.
+        If it fails, it returns false and the normal lex/yacc parser will
+        be invoked.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35362
+
+        Covered by fast/canvas/canvas-bg.html, fast/canvas/canvas-bg-zoom.html,
+        and many more.
+
+        * css/CSSParser.cpp:
+        (WebCore::parseInt):
+        (WebCore::CSSParser::parseColor):
+
+2010-02-26  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35419
+        3D canvas did not update when WTF_USE_ACCELERATED_COMPOSITING
+        was enabled but not from run-time settings. Added run-time 
+        check that compositing is enabled.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::markContextChanged):
+
+2010-02-26  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Compilation failed because functions glSampleCoverage, glBlendEquation
+        and glActiveTexture were not available.
+        https://bugs.webkit.org/show_bug.cgi?id=35423
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3D::activeTexture):
+        (WebCore::GraphicsContext3D::blendEquation):
+        (WebCore::GraphicsContext3D::sampleCoverage):
+
+2010-02-26  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+ 
+         Reviewed by Kenneth Rohde Christiansen.
+
+         https://bugs.webkit.org/show_bug.cgi?id=35380
+         Fixed compilation error when WTF_USE_ACCELERATED_COMPOSITING=0
+ 
+         * css/MediaQueryEvaluator.cpp:
+         (WebCore::transform_3dMediaFeatureEval):
+
+2010-02-26  Nicholas Young  <nicholas.young@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Incorrect painting after a size changed.
+        https://bugs.webkit.org/show_bug.cgi?id=35412
+
+        No new tests. Bug fix in backend.
+
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivate::paint): Provide the source rectangle, rather than inferring it.
+
+2010-02-26  Nicholas Young  <nicholas.young@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Incorrect handling of MIME types in Media Player
+        https://bugs.webkit.org/show_bug.cgi?id=35413
+
+        No new tests. Bug fix in backend.
+
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivate::supportsType): Corrected logic.
+
+2010-02-26  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35418
+        [Gtk] Every table, including layout tables, should be exposed as a table
+
+        This patch exposes layout tables as tables. (Addressing the problematic table
+        hierarchy remains to be done.)
+
+        * accessibility/gtk/AccessibilityObjectAtk.cpp:
+        (AccessibilityObject::accessibilityPlatformIncludesObject):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (AccessibilityRenderObject::determineAccessibilityRole):
+
+2010-02-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        XSSAuditor is super super super slow
+        https://bugs.webkit.org/show_bug.cgi?id=35373
+
+        In this patch, we separate the decoding cache for the page's URL and
+        form data.  Previously, we used the same cache for both, which caused
+        us miss the cache every time when the page had form data (because the
+        cache only stored one entry).  When the form data is large, we were
+        wasting a lot of time canonicalizing.
+
+        * page/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::findInRequest):
+        * page/XSSAuditor.h:
+
+2010-02-26  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResourceClipper needs to be moved to RenderSVGResourceClipper
+        https://bugs.webkit.org/show_bug.cgi?id=35421
+
+        Move SVGResourceClipper to RenderSVGResourceClipper. This follows the changes
+        of Masker and helps to clean up the SVG code. Code snippets from SVGClipPathElement
+        and SVGResourceClipper got combined in RenderSVGResourceClipper. DRT results are
+        more readable for clipPath's now. It's possible to see the unit type of clipper, as
+        well as it's childs instead of just one path.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderSVGResource.h:
+        (WebCore::):
+        * rendering/RenderSVGResourceClipper.cpp: Added.
+        (WebCore::RenderSVGResourceClipper::RenderSVGResourceClipper):
+        (WebCore::RenderSVGResourceClipper::~RenderSVGResourceClipper):
+        (WebCore::RenderSVGResourceClipper::invalidateClients):
+        (WebCore::RenderSVGResourceClipper::invalidateClient):
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
+        * rendering/RenderSVGResourceClipper.h: Added.
+        (WebCore::RenderSVGResourceClipper::renderName):
+        (WebCore::RenderSVGResourceClipper::resourceType):
+        (WebCore::RenderSVGResourceClipper::clipPathUnits):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+        (WebCore::SVGRenderBase::clipperBoundingBoxForRenderer):
+        (WebCore::SVGRenderBase::deregisterFromResources):
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::operator<<):
+        (WebCore::writeStyle):
+        (WebCore::writeSVGResource):
+        (WebCore::writeResources):
+        * svg/SVGClipPathElement.cpp:
+        (WebCore::SVGClipPathElement::svgAttributeChanged):
+        (WebCore::SVGClipPathElement::childrenChanged):
+        (WebCore::SVGClipPathElement::createRenderer):
+        * svg/SVGClipPathElement.h:
+        (WebCore::SVGClipPathElement::isValid):
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/graphics/SVGResource.h:
+        (WebCore::):
+        (WebCore::SVGResource::isPaintServer):
+        (WebCore::SVGResource::isFilter):
+        (WebCore::SVGResource::isMarker):
+        * svg/graphics/SVGResourceClipper.cpp: Removed.
+        * svg/graphics/SVGResourceClipper.h: Removed.
+
+2010-02-26  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The element that a touchevent is dispatched to isn't always right
+        https://bugs.webkit.org/show_bug.cgi?id=35431
+
+        The element that touch events are dispatched on is not always the
+        correct one, as the cached m_touchEventTarget member is only updated
+        when the first element of the PlatformTouchEvent touch list is in the
+        TouchPressed state.
+
+        This patch changes this behavior to dispatch the event to the target
+        of the touch that caused the event to be generated and eliminates the
+        m_touchEventTarget in favour of using the touch target hashmap. It also
+        simplifies the way in which the touchTargets list is generated as we
+        no longer have m_touchEventTarget (which was used previously to build
+        the list). The new behavior matches the observed behavior of the
+        iPhone and Android.
+
+        * page/EventHandler.cpp:
+        (WebCore::assembleTargetTouches): Added. new function to build the
+            targetTouches list. Filters a list of touches (passed) about
+            another given touch.
+        (WebCore::EventHandler::handleTouchEvent): Remove the
+            m_touchEventTarget member, and simplify the generation of the
+            TouchLists that are bundled with the TouchEVent object. Dispatch
+            the event to the target of the touch that caused the event to be
+            fired.
+        * page/EventHandler.h: Remove m_touchEventTarget.
+
+2010-02-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Fix the handling of updates to #hash fragments to check for differences
+        post-canonicalization rather than comparing pre- to post-. Chromium
+        had a bug where we would set the #hash on an about:blank URL and generate
+        an onload event because we thought the URL (not just the fragment) was
+        changing.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35180
+
+        Test: fast/loader/about-blank-hash-change.html
+
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::hashAccessorSetter):
+
+2010-02-26  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by David Levin.
+
+        texImage2D and texSubImage2D taking ImageData ignore flipY and premultiplyAlpha
+        https://bugs.webkit.org/show_bug.cgi?id=34459
+
+        Test: fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::texImage2D): Apply flipY and premultiplyAlpha to the texture data.
+        (WebCore::WebGLRenderingContext::texSubImage2D): Ditto.
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::extractImageData): Extract data from ImageData, applying flipY and premultiplyAlpha.
+        * platform/graphics/GraphicsContext3D.h: Add function extractImageData declaration.
+
+2010-02-26  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by David Levin.
+
+        Set viewport to canvas size upon context creation
+        https://bugs.webkit.org/show_bug.cgi?id=35057
+
+        Covered by existing tests, in particular fast/canvas/webgl/gl-get-calls.html
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext): Set the viewport size to match the canvas size.
+
+2010-02-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: touch InspectorController to force front-end deployment.
+
+        * inspector/InspectorController.cpp:
+
+2010-02-26  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        WebInspector: While the current timeline view in DevTools provides a great overview of
+        things happening, we should make it easier to locate the cause of an event,
+        e.g., link to JS where relevant.
+        Caller info support for all kind of Timeline events and new Function Call event will be added.
+        JSC can be patched the same way as it will be done for V8.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33995
+
+        * bindings/js/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::callLocation):
+        * bindings/js/ScriptCallStack.h:
+        * bindings/v8/ScriptCallStack.cpp:
+        (WebCore::ScriptCallStack::create):
+        (WebCore::ScriptCallStack::callLocation):
+        * bindings/v8/ScriptCallStack.h:
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::callFunction):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+        (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
+        (WebCore::InspectorTimelineAgent::willCallFunction):
+        (WebCore::InspectorTimelineAgent::didCallFunction):
+        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+        * inspector/InspectorTimelineAgent.h:
+        (WebCore::):
+        (WebCore::InspectorTimelineAgent::instanceCount):
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+        (WebCore::TimelineRecordFactory::createFunctionCallData):
+        * inspector/TimelineRecordFactory.h:
+        * inspector/front-end/Popover.js:
+        (WebInspector.Popover.prototype.hideWhenClicked):
+        (WebInspector.Popover.prototype._positionElement):
+        * inspector/front-end/TimelineAgent.js:
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+        (WebInspector.TimelinePanel.prototype._formatRecord):
+        (WebInspector.TimelinePanel.prototype._getRecordDetails):
+        (WebInspector.TimelinePanel.prototype.reset):
+        (WebInspector.TimelinePanel.prototype._closeRecordDetails):
+        (WebInspector.TimelinePanel.prototype._onScroll):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelineRecordListRow):
+        (WebInspector.TimelineRecordListRow.prototype.update):
+        (WebInspector.TimelineRecordListRow.prototype._createCell):
+        (WebInspector.TimelineRecordListRow.prototype._createRow):
+        (WebInspector.TimelineRecordListRow.prototype._createLinkRow):
+        (WebInspector.TimelineRecordListRow.prototype._generateBubbleContent):
+        (WebInspector.TimelineRecordListRow.prototype._onClick):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.js:
+        (WebInspector.linkifyResourceAsNode):
+
+2010-02-26  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed. Roll-out r55263 because it broke fast/forms/textarea-type-spaces-pretty-diff.html.
+        https://bugs.webkit.org/show_bug.cgi?id=30946
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::isWhitespace):
+        (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::input):
+        * editing/InsertTextCommand.h:
+        * editing/htmlediting.cpp:
+        * editing/htmlediting.h:
+
+2010-02-25  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        <rdar://problem/7688455> REGRESSION(r55205): Crash inside dispatchEventsOnWindowAndFocusedNode when clicking link from bookmarks view
+
+        Null-check the document's page to avoid dereferencing a null page.
+
+        No regression test is added as this appears to be dependent on an interaction with Safari's bookmarks view that is
+        not testable from within DumpRenderTree.
+
+        * page/FocusController.cpp:
+        (WebCore::dispatchEventsOnWindowAndFocusedNode):
+
+2010-02-25  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Multiple repaints on apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=35409
+
+        apple.com was triggering the fast scaling path for background images due to
+        repeated repaints as more content came in.  This occured due to a two problems
+        in the logic to detect scaling.  The first is that the main context is flipped
+        on mac so fails the identity or translation check.  We work around this by adding
+        an function that allows the scaling for a flipped CTM.  The other problem was that
+        we were looking at the destination rect size instead of the destination tile size
+        when deciding if the size we were drawn at would cause scaling.
+
+        * platform/graphics/transforms/AffineTransform.h:
+        (WebCore::AffineTransform::isIdentityOrTranslationOrFlipped):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality):
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
+2010-02-25  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Extra layout on keypress after a space (problem with rebalanceWhitespaceAt in InsertTextCommand).
+        https://bugs.webkit.org/show_bug.cgi?id=30946
+        <rdar://problem/7639184>
+
+        Do text insertion and whitespace rebalancing around the insertion in one step so that there's only one layout.
+        This patch was originally made by Justin Garcia.
+        
+        Test: editing/inserting/rebalance-whitespace-1.html
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): No behavior changes here,
+        just pushed the code that determined the extent of whitespace surrounding a position
+        to its own helper function.
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::insertTextIntoNodeAndRebalanceWhitespace): Added.  Find 
+        whitespace surrounding the insertion position, add the text to insert, rebalance that entire
+        string, then insert it into the document.
+        (WebCore::InsertTextCommand::input):
+        * editing/InsertTextCommand.h:
+        * editing/htmlediting.cpp:
+        (WebCore::isWhitespace): Moved from CompositeEditCommand.cpp.
+        (WebCore::extentOfWhitespaceForRebalancingAt): Moved code from rebalanceWhitespaceAt into this helper
+        function.  Obtains the offset of the start and end of whitespace around a particular position.
+        * editing/htmlediting.h:
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35406
+        <rdar://problem/6945502> Make generic array methods work with JavaArray
+
+        Test: java/array-sort.html
+
+        Made RuntimeArray inherit from JSArray, keeping the promise given in ClassInfo.
+
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::RuntimeArray):
+        (JSC::RuntimeArray::~RuntimeArray):
+        * bridge/runtime_array.h:
+        (JSC::RuntimeArray::classInfo):
+        (JSC::RuntimeArray::getConcreteArray):
+
+2010-02-25  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fixed a regression introduced in r44243, which made the assertion in checkListItems()
+        ineffective.
+
+        * dom/SelectElement.cpp:
+        (WebCore::SelectElementData::checkListItems): Copy the items vector before recomputing it,
+        then assert that the newly-computed vector is equal to the copy.
+
+2010-02-25  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG's tspan is no member of SVGRenderBase, this can cause crashes on filters
+        https://bugs.webkit.org/show_bug.cgi?id=35354
+
+        This makes the base class RenderSVGInline of RenderSVGTSpan and RenderSVGInlineText
+        dependent on SVGBaseRenderer.
+        The SVG spec want as to use the object bounding box of the text root as the bounding box
+        for text-childs. So we search for the text root and use it's bounding box, stroke rect and
+        repaint rect for further calculations.
+
+        Test: svg/filters/filter-on-tspan.svg
+
+        * rendering/RenderSVGInline.cpp:
+        (WebCore::RenderSVGInline::objectBoundingBox): Find the text root and give back it's bounding box.
+        (WebCore::RenderSVGInline::strokeBoundingBox): same for stroke rect
+        (WebCore::RenderSVGInline::repaintRectInLocalCoordinates): same for repaint rect
+        * rendering/RenderSVGInline.h:
+        (WebCore::RenderSVGInline::toSVGRenderBase): RenderSVGInline is part of SVGRenderBase now.
+        * rendering/RenderSVGTSpan.h:
+        (WebCore::RenderSVGTSpan::renderName): Removed bounding box code. Was just a hack for filters and maskers.
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::findTextRootObject): Search for the text root.
+        * rendering/SVGRenderSupport.h:
+        * svg/graphics/SVGPaintServerGradient.cpp: moved findTextRootObject to SVGRenderSupport
+
+2010-02-25  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Use-element doesn't transform clipPath
+        https://bugs.webkit.org/show_bug.cgi?id=35375
+
+        If the use element is a child of clipPath, any settings on x, y or transform does not
+        transform the clipPath it references.
+        The use-element just misses this transformation in toClipPath.
+
+        Test: svg/custom/use-on-clip-path-with-transformation.svg
+
+        * platform/graphics/cairo/PathCairo.cpp: Gtk port translated the path to the wrong direction.
+        (WebCore::Path::translate):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::toClipPath):
+
+2010-02-25  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        File.type support.
+        https://bugs.webkit.org/show_bug.cgi?id=35361
+
+        Test: LayoutTests/editing/pasteboard/file-input-files-access.html
+
+        * html/File.cpp:
+        (WebCore::File::File):
+        * html/File.h:
+        (WebCore::File::type):
+        * html/File.idl:
+
+2010-02-25  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Javascript console should not attempt to scroll to end of console if console is not visible
+
+        https://bugs.webkit.org/show_bug.cgi?id=22992
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._scheduleScrollIntoView.scrollIntoView):
+        (WebInspector.ConsoleView.prototype._scheduleScrollIntoView):
+        (WebInspector.ConsoleView.prototype.addMessage):
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Qt and Gtk build fixes.
+
+        * GNUmakefile.am:
+        * WebCore.pro:
+        Added CRuntimeObject.{c,cpp}.
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Windows build fix.
+
+        * WebCore.vcproj/WebCore.vcproj: Added CRuntimeObject.{c,cpp}.
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35394
+        <rdar://problem/7685262> Make passing objects between Java and plug-ins work
+
+        * WebCore.PluginHostProcess.exp: WebKit now subclasses RuntimeObject, so it needed more exports.
+
+        * bridge/runtime_object.cpp:
+        (JSC::Bindings::callRuntimeObject):
+        (JSC::Bindings::callRuntimeConstructor):
+        Assert that a runtime object is passed as function.
+
+        * bridge/runtime_object.h: Moved RuntimeObject into Bindings namespace, matching other
+        related classes.
+
+        * bridge/jni/jni_jsobject.mm:
+        (JavaJSObject::toString): Pass rootObject to convertValueToJValue(). It's not needed when
+        constructing a string, but this function now takes it for the sake of Object.
+        (JavaJSObject::convertValueToJObject): Check that object class is JavaRuntimeObject, not
+        just RuntimeObject.
+
+        * bridge/jni/jsc/JNIBridgeJSC.cpp:
+        (JavaField::setValueToInstance): Pass rootObject to convertValueToJValue().
+        (JavaArray::setValueAt): Ditto.
+
+        * bridge/jni/jsc/JNIUtilityPrivate.h: convertValueToJValue() now takes a RootObject argument,
+        because one is needed to gcProtect an object ghtat is wrapped into JSObject.
+
+        * bridge/jni/jsc/JNIUtilityPrivate.cpp: (JSC::Bindings::convertValueToJValue): Convert
+        JavaScript objects to Java JSObject ones. This was already happening in other code paths,
+        which we should change to use common code.
+
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaInstance::newRuntimeObject): Create an appropriate RuntimeObject subclass,
+        which is JavaRuntimeObject for Java.
+        (JavaInstance::invokeMethod): Unwrap returned JavaObjects that contain JS objects.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+        * bridge/c/CRuntimeObject.cpp: Added.
+        (JSC::Bindings::CRuntimeObject::CRuntimeObject):
+        (JSC::Bindings::CRuntimeObject::~CRuntimeObject):
+        (JSC::Bindings::CRuntimeObject::getInternalCInstance):
+        * bridge/c/CRuntimeObject.h: Added.
+        (JSC::Bindings::CRuntimeObject::classInfo):
+        * bridge/c/c_instance.cpp:
+        (JSC::Bindings::CInstance::newRuntimeObject):
+        * bridge/c/c_instance.h:
+        * bridge/c/c_utility.cpp:
+        (JSC::Bindings::convertValueToNPVariant):
+        * bridge/jni/jsc/JavaInstanceJSC.h:
+        * bridge/jni/jsc/JavaRuntimeObject.cpp: Added.
+        (JSC::Bindings::):
+        (JSC::Bindings::JavaRuntimeObject::JavaRuntimeObject):
+        (JSC::Bindings::JavaRuntimeObject::~JavaRuntimeObject):
+        (JSC::Bindings::JavaRuntimeObject::getInternalJavaInstance):
+        * bridge/jni/jsc/JavaRuntimeObject.h: Added.
+        (JSC::Bindings::JavaRuntimeObject::classInfo):
+        * bridge/jsc/BridgeJSC.h:
+        * bridge/objc/ObjCRuntimeObject.h: Added.
+        (JSC::Bindings::ObjCRuntimeObject::classInfo):
+        * bridge/objc/ObjCRuntimeObject.mm: Added.
+        (JSC::Bindings::):
+        (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
+        (JSC::Bindings::ObjCRuntimeObject::~ObjCRuntimeObject):
+        (JSC::Bindings::ObjCRuntimeObject::getInternalObjCInstance):
+        * bridge/objc/objc_instance.h:
+        * bridge/objc/objc_instance.mm:
+        (ObjcInstance::newRuntimeObject):
+        * bridge/objc/objc_runtime.mm:
+        (JSC::Bindings::callObjCFallbackObject):
+        * bridge/runtime_root.h:
+        Added RuntimeObject subclasses for each instance type, and use them for type casting.
+
+2010-02-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Rubber-stamped by Xan Lopez.
+
+        Adopt the same string as the one that is expected by
+        fast/parser/fragment-parser.html for the description used by the
+        <isindex> element.
+
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::searchableIndexIntroduction):
+
+2010-02-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: evaluate-on-hover does not work on HTML files.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35378
+
+        * inspector/front-end/SourceCSSTokenizer.re2js:
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        (WebInspector.SourceHTMLTokenizer):
+        (WebInspector.SourceHTMLTokenizer.prototype.set line):
+        (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._attrValueTokenType):
+        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+        * inspector/front-end/SourceJavaScriptTokenizer.js:
+        (WebInspector.SourceJavaScriptTokenizer):
+        * inspector/front-end/SourceJavaScriptTokenizer.re2js:
+        * inspector/front-end/SourceTokenizer.js:
+        (WebInspector.SourceTokenizer.prototype.set condition):
+        (WebInspector.SourceTokenizer.prototype.get condition):
+        (WebInspector.SourceTokenizer.prototype.get subTokenizer):
+        (WebInspector.SourceTokenizer.prototype.getLexCondition):
+        (WebInspector.SourceTokenizer.prototype.setLexCondition):
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter):
+        (WebInspector.TextEditorHighlighter.prototype.set mimeType):
+        (WebInspector.TextEditorHighlighter.prototype.highlight):
+        (WebInspector.TextEditorHighlighter.prototype._highlightInChunks):
+        (WebInspector.TextEditorHighlighter.prototype._highlightLines):
+        (WebInspector.TextEditorHighlighter.prototype._highlightLine):
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer.prototype._paintLine):
+
+2010-02-25  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Simple style cleanups.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::plugRemovedCallback):
+        (WebCore::plugAddedCallback):
+        (WebCore::PluginView::platformStart):
+
+2010-02-25  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Optimize decoding of Latin-1 text by exploiting the fact that most of it will
+        be ASCII-only data.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35233
+
+        * platform/text/TextCodecLatin1.cpp:
+        (WebCore::TextCodecLatin1::decode):
+
+2010-02-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Web Inspector: make script lines count calculation lazy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35392
+
+        * inspector/front-end/Script.js:
+        (WebInspector.Script):
+        (WebInspector.Script.prototype.get linesCount):
+        * inspector/front-end/ScriptsPanel.js:
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView.prototype._addBreakpoint):
+
+2010-02-25  James Choi  <jchoi42@pha.jhu.edu>
+
+        Reviewed by David Levin.
+
+        Change hardcoded gcc paths to be Solaris friendly
+        https://bugs.webkit.org/show_bug.cgi?id=35213
+
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        * bindings/scripts/IDLParser.pm:
+        * css/make-css-file-arrays.pl:
+        * dom/make_names.pl:
+
+2010-02-25  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Workaround Java plugins not drawing themselves properly on first
+        expose by doing a late size-allocate after 'plug-added' has been
+        emitted on the embedding GtkSocket. It's unclear to me if this is
+        a bug in our side or theirs, but this should be pretty safe and
+        fixes the annoyance while we investigate it further.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::plugAddedCallback):
+        (WebCore::PluginView::platformStart):
+
+2010-02-23  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Add missing include guards
+
+        * loader/CrossOriginPreflightResultCache.h:
+        * loader/MainResourceLoader.h:
+
+2010-02-25  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Restrict the optimization flags for Symbian to release builds.
+
+        * WebCore.pro:
+
+2010-02-25  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Qt WebGL support
+
+        Adds GraphicsContext3D QtWebKit implementation.
+        https://bugs.webkit.org/show_bug.cgi?id=35153
+
+        * WebCore.pri:
+        * WebCore.pro:
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/qt/GraphicsContext3DQt.cpp: Added.
+        (WebCore::GraphicsContext3DInternal::isValid):
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::getProcAddress):
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformTexture):
+        (WebCore::GraphicsContext3D::makeContextCurrent):
+        (WebCore::GraphicsContext3D::beginPaint):
+        (WebCore::GraphicsContext3D::endPaint):
+        (WebCore::GraphicsContext3D::reshape):
+        (WebCore::GraphicsContext3D::activeTexture):
+        (WebCore::GraphicsContext3D::attachShader):
+        (WebCore::GraphicsContext3D::bindAttribLocation):
+        (WebCore::GraphicsContext3D::bindBuffer):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::bindRenderbuffer):
+        (WebCore::GraphicsContext3D::bindTexture):
+        (WebCore::GraphicsContext3D::blendColor):
+        (WebCore::GraphicsContext3D::blendEquation):
+        (WebCore::GraphicsContext3D::blendEquationSeparate):
+        (WebCore::GraphicsContext3D::blendFunc):
+        (WebCore::GraphicsContext3D::blendFuncSeparate):
+        (WebCore::GraphicsContext3D::bufferData):
+        (WebCore::GraphicsContext3D::bufferSubData):
+        (WebCore::GraphicsContext3D::checkFramebufferStatus):
+        (WebCore::GraphicsContext3D::clearColor):
+        (WebCore::GraphicsContext3D::clear):
+        (WebCore::GraphicsContext3D::clearDepth):
+        (WebCore::GraphicsContext3D::clearStencil):
+        (WebCore::GraphicsContext3D::colorMask):
+        (WebCore::GraphicsContext3D::compileShader):
+        (WebCore::GraphicsContext3D::copyTexImage2D):
+        (WebCore::GraphicsContext3D::copyTexSubImage2D):
+        (WebCore::GraphicsContext3D::cullFace):
+        (WebCore::GraphicsContext3D::depthFunc):
+        (WebCore::GraphicsContext3D::depthMask):
+        (WebCore::GraphicsContext3D::depthRange):
+        (WebCore::GraphicsContext3D::detachShader):
+        (WebCore::GraphicsContext3D::disable):
+        (WebCore::GraphicsContext3D::disableVertexAttribArray):
+        (WebCore::GraphicsContext3D::drawArrays):
+        (WebCore::GraphicsContext3D::drawElements):
+        (WebCore::GraphicsContext3D::enable):
+        (WebCore::GraphicsContext3D::enableVertexAttribArray):
+        (WebCore::GraphicsContext3D::finish):
+        (WebCore::GraphicsContext3D::flush):
+        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+        (WebCore::GraphicsContext3D::framebufferTexture2D):
+        (WebCore::GraphicsContext3D::frontFace):
+        (WebCore::GraphicsContext3D::generateMipmap):
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+        (WebCore::GraphicsContext3D::getAttribLocation):
+        (WebCore::GraphicsContext3D::getContextAttributes):
+        (WebCore::GraphicsContext3D::getError):
+        (WebCore::GraphicsContext3D::getString):
+        (WebCore::GraphicsContext3D::hint):
+        (WebCore::GraphicsContext3D::isBuffer):
+        (WebCore::GraphicsContext3D::isEnabled):
+        (WebCore::GraphicsContext3D::isFramebuffer):
+        (WebCore::GraphicsContext3D::isProgram):
+        (WebCore::GraphicsContext3D::isRenderbuffer):
+        (WebCore::GraphicsContext3D::isShader):
+        (WebCore::GraphicsContext3D::isTexture):
+        (WebCore::GraphicsContext3D::lineWidth):
+        (WebCore::GraphicsContext3D::linkProgram):
+        (WebCore::GraphicsContext3D::pixelStorei):
+        (WebCore::GraphicsContext3D::polygonOffset):
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::releaseShaderCompiler):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        (WebCore::GraphicsContext3D::sampleCoverage):
+        (WebCore::GraphicsContext3D::scissor):
+        (WebCore::GraphicsContext3D::shaderSource):
+        (WebCore::GraphicsContext3D::stencilFunc):
+        (WebCore::GraphicsContext3D::stencilFuncSeparate):
+        (WebCore::GraphicsContext3D::stencilMask):
+        (WebCore::GraphicsContext3D::stencilMaskSeparate):
+        (WebCore::GraphicsContext3D::stencilOp):
+        (WebCore::GraphicsContext3D::stencilOpSeparate):
+        (WebCore::GraphicsContext3D::texParameterf):
+        (WebCore::GraphicsContext3D::texParameteri):
+        (WebCore::GraphicsContext3D::uniform1f):
+        (WebCore::GraphicsContext3D::uniform1fv):
+        (WebCore::GraphicsContext3D::uniform2f):
+        (WebCore::GraphicsContext3D::uniform2fv):
+        (WebCore::GraphicsContext3D::uniform3f):
+        (WebCore::GraphicsContext3D::uniform3fv):
+        (WebCore::GraphicsContext3D::uniform4f):
+        (WebCore::GraphicsContext3D::uniform4fv):
+        (WebCore::GraphicsContext3D::uniform1i):
+        (WebCore::GraphicsContext3D::uniform1iv):
+        (WebCore::GraphicsContext3D::uniform2i):
+        (WebCore::GraphicsContext3D::uniform2iv):
+        (WebCore::GraphicsContext3D::uniform3i):
+        (WebCore::GraphicsContext3D::uniform3iv):
+        (WebCore::GraphicsContext3D::uniform4i):
+        (WebCore::GraphicsContext3D::uniform4iv):
+        (WebCore::GraphicsContext3D::uniformMatrix2fv):
+        (WebCore::GraphicsContext3D::uniformMatrix3fv):
+        (WebCore::GraphicsContext3D::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::useProgram):
+        (WebCore::GraphicsContext3D::validateProgram):
+        (WebCore::GraphicsContext3D::vertexAttrib1f):
+        (WebCore::GraphicsContext3D::vertexAttrib1fv):
+        (WebCore::GraphicsContext3D::vertexAttrib2f):
+        (WebCore::GraphicsContext3D::vertexAttrib2fv):
+        (WebCore::GraphicsContext3D::vertexAttrib3f):
+        (WebCore::GraphicsContext3D::vertexAttrib3fv):
+        (WebCore::GraphicsContext3D::vertexAttrib4f):
+        (WebCore::GraphicsContext3D::vertexAttrib4fv):
+        (WebCore::GraphicsContext3D::vertexAttribPointer):
+        (WebCore::GraphicsContext3D::viewport):
+        (WebCore::GraphicsContext3D::getBooleanv):
+        (WebCore::GraphicsContext3D::getBufferParameteriv):
+        (WebCore::GraphicsContext3D::getFloatv):
+        (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+        (WebCore::GraphicsContext3D::getIntegerv):
+        (WebCore::GraphicsContext3D::getProgramiv):
+        (WebCore::GraphicsContext3D::getProgramInfoLog):
+        (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
+        (WebCore::GraphicsContext3D::getShaderiv):
+        (WebCore::GraphicsContext3D::getShaderInfoLog):
+        (WebCore::GraphicsContext3D::getShaderSource):
+        (WebCore::GraphicsContext3D::getTexParameterfv):
+        (WebCore::GraphicsContext3D::getTexParameteriv):
+        (WebCore::GraphicsContext3D::getUniformfv):
+        (WebCore::GraphicsContext3D::getUniformiv):
+        (WebCore::GraphicsContext3D::getUniformLocation):
+        (WebCore::GraphicsContext3D::getVertexAttribfv):
+        (WebCore::GraphicsContext3D::getVertexAttribiv):
+        (WebCore::GraphicsContext3D::getVertexAttribOffset):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        (WebCore::GraphicsContext3D::createBuffer):
+        (WebCore::GraphicsContext3D::createFramebuffer):
+        (WebCore::GraphicsContext3D::createProgram):
+        (WebCore::GraphicsContext3D::createRenderbuffer):
+        (WebCore::GraphicsContext3D::createShader):
+        (WebCore::GraphicsContext3D::createTexture):
+        (WebCore::GraphicsContext3D::deleteBuffer):
+        (WebCore::GraphicsContext3D::deleteFramebuffer):
+        (WebCore::GraphicsContext3D::deleteProgram):
+        (WebCore::GraphicsContext3D::deleteRenderbuffer):
+        (WebCore::GraphicsContext3D::deleteShader):
+        (WebCore::GraphicsContext3D::deleteTexture):
+        (WebCore::GraphicsContext3D::sizeInBytes):
+        (WebCore::GraphicsContext3D::synthesizeGLError):
+        (WebCore::GraphicsContext3D::getImageData):
+
+2010-02-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Swap images for activate and deactivate breakpoints.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35383
+
+        * WebCore.gypi:
+        * inspector/front-end/Images/breakpointsActivateButtonGlyph.png: Renamed from WebCore/inspector/front-end/Images/deactivateBreakpointsButtonGlyph.png.
+        * inspector/front-end/Images/breakpointsDeactivateButtonGlyph.png: Renamed from WebCore/inspector/front-end/Images/deactivateBreakpointsDisabledButtonGlyph.png.
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.css:
+
+2010-02-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        Go back on symlink resolution if we are loading the flash plugin,
+        and the path contains /netscape/, following what Chromium does.
+
+        Thanks to Evan Martin for the help on this!
+
+        * plugins/gtk/PluginPackageGtk.cpp:
+        (WebCore::PluginPackage::load):
+
+2010-02-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Scripts panel shows blank source when stopping on a breakpoint on refresh.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35232
+
+        * inspector/front-end/Panel.js:
+        (WebInspector.Panel.prototype.canShowSourceLine):
+        (WebInspector.Panel.prototype.showSourceLine):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
+        (WebInspector.ResourcesPanel.prototype.showSourceLine):
+        * inspector/front-end/Script.js:
+        (WebInspector.Script):
+        * inspector/front-end/ScriptView.js:
+        (WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.show):
+        (WebInspector.ScriptsPanel.prototype.get searchableViews):
+        (WebInspector.ScriptsPanel.prototype.addScript):
+        (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+        (WebInspector.ScriptsPanel.prototype.addBreakpoint):
+        (WebInspector.ScriptsPanel.prototype.removeBreakpoint):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        (WebInspector.ScriptsPanel.prototype.canShowSourceLine):
+        (WebInspector.ScriptsPanel.prototype.showSourceLine):
+        (WebInspector.ScriptsPanel.prototype._scriptOrResourceForURLAndLine):
+        (WebInspector.ScriptsPanel.prototype.showView):
+        (WebInspector.ScriptsPanel.prototype._sourceFrameForScriptOrResource):
+        (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+        (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu.optionCompare):
+        (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu):
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView.prototype._addBreakpoint):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+        (WebInspector._choosePanelToShowSourceLine):
+        (WebInspector.canShowSourceLine):
+        (WebInspector.showSourceLine):
+
+2010-02-25  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The target element of a Touch should be the target where that touch originated, not where it is now.
+        https://bugs.webkit.org/show_bug.cgi?id=34585
+
+        Currently the target of a touch is set to the resulting node of the hit test where the touch currently
+        is. This does not match the behavior of iPhone or Android. This patch uses a hashmap on the EventHandler
+        to keep track of the target element when a touch is first started. This target is then used as the target
+        for subsequent touches with the same id. This matches observed behavior on iPhone and Android.
+
+        Tests:
+        fast/events/touch/touch-target.html: Added.
+        fast/events/touch/basic-single-touch-events.html: Updated.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleTouchEvent): Store the originating target element of a touch in a hashmap
+            so that we can reuse that target for future events caused by that touch. This matches observed behavior
+            on iPhone and Android.
+        * page/EventHandler.h: Add hashmap as a member.
+        * platform/PlatformTouchPoint.h:
+        (WebCore::PlatformTouchPoint::id): Store the touch point id as unsigned.
+        * platform/qt/PlatformTouchPointQt.cpp: 
+        (WebCore::PlatformTouchPoint::PlatformTouchPoint): Cast platform touch id from signed to unsigned. Qt API
+            docs state that it will always be >= 0.
+
+2010-02-24  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Add a convenient center() method to IntRect
+        https://bugs.webkit.org/show_bug.cgi?id=35346
+
+        As it is a convenience method, and implemention is
+        based on FloatRect's one, patch does not provide a
+        layout test.
+
+        * platform/graphics/IntRect.h:
+        (WebCore::IntRect::center):
+
+2010-02-25  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Fake workers implementation that simulates workers using iframe and timer,
+        needed to support workers debugging. Also, a facility to inject scripts into
+        inspected page upon load.
+        https://bugs.webkit.org/show_bug.cgi?id=35148
+
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::addScriptToEvaluateOnLoad):
+        (WebCore::InspectorBackend::removeAllScriptsToEvaluateOnLoad):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::addScriptToEvaluateOnLoad):
+        (WebCore::InspectorController::removeAllScriptsToEvaluateOnLoad):
+        * inspector/InspectorController.h:
+        * inspector/front-end/InjectedFakeWorker.js: Added.
+        (InjectedFakeWorker.Worker):
+        (InjectedFakeWorker.FakeWorker):
+        (InjectedFakeWorker.FakeWorker.prototype.postMessage):
+        (InjectedFakeWorker.FakeWorker.prototype.terminate):
+        (InjectedFakeWorker.FakeWorker.prototype._onmessageWrapper):
+        (InjectedFakeWorker.FakeWorker.prototype._dispatchMessage):
+        (InjectedFakeWorker.FakeWorker.prototype._handleException):
+        (InjectedFakeWorker.FakeWorker.prototype._buildWorker):
+        (InjectedFakeWorker.FakeWorker.prototype._setupWorkerContext.handler):
+        (InjectedFakeWorker.FakeWorker.prototype._setupWorkerContext):
+        (InjectedFakeWorker.FakeWorker.prototype._importScripts):
+        (InjectedFakeWorker.FakeWorker.prototype._loadScript):
+        (InjectedFakeWorker.URL):
+        (InjectedFakeWorker.URL.prototype.urlRegEx.split):
+        (InjectedFakeWorker.URL.prototype.mockLocation):
+        (InjectedFakeWorker.URL.prototype.completeWith):
+        (InjectedFakeWorker.URL.prototype.sameOrigin):
+        (InjectedFakeWorker.DOMCoreException.formatError):
+        (InjectedFakeWorker.DOMCoreException):
+        (InjectedFakeWorker.noop):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.setInjectedScriptSource):
+        (.WebInspector.InspectorBackendStub.prototype.addScriptToEvaluateOnLoad):
+        (.WebInspector.InspectorBackendStub.prototype.removeAllScriptsToEvaluateOnLoad):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+
+2010-02-24  Nicholas Young  <nicholas.young@nokia.com>
+
+        Reviewed by Eric Carlson.
+
+        Add mediaPlayerOwningDocument() to MediaPlayerClient.
+        https://bugs.webkit.org/show_bug.cgi?id=35374
+
+        No new tests. These are interface changes only.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerOwningDocument): Implementation for media element.
+        * html/HTMLMediaElement.h:
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerOwningDocument): New virtual method.
+
+2010-02-24  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Optimized Font::normalizeSpaces() by caching the String::characters()
+        instead of repeatedly calling operator[]
+
+        https://bugs.webkit.org/show_bug.cgi?id=35336
+
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::normalizeSpaces):
+
+2010-02-24  Jungshik Shin  <jshin@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] Traditional Chinese Chrome on Windows should use PMingLiu instead of Simsun for Han characters
+        https://bugs.webkit.org/show_bug.cgi?id=35319
+
+        No visible change in the layout test.
+
+        * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
+        (WebCore::):
+
+2010-02-24  Anthony Ricaud  <rik@webkit.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Reduce the timer to show the eval popover
+        https://bugs.webkit.org/show_bug.cgi?id=35344
+
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._mouseMove):
+
+2010-02-24  Jay Campan  <jcampan@google.com>
+
+        Reviewed by David Levin.
+
+        Don't show the autofill popup when the input text is disabled or read only.
+
+        Test: manual-tests/chromium/no-autofill-on-readonly.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=35129
+
+        * src/EditorClientImpl.cpp:
+        (WebKit::EditorClientImpl::autofill):
+        *  manual-tests/chromium/no-autofill-on-readonly.html: Added.
+
+2010-02-24  Dominic Mazzoni  <dmazzoni@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Wraps includes of SVG headers so that it's possible to
+        compile the V8 bindings with SVG disabled, e.g. 'enable_svg=0'.
+        https://bugs.webkit.org/show_bug.cgi?id=35345
+
+        No new tests.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        * bindings/v8/V8Proxy.cpp:
+        * bindings/v8/custom/V8CSSValueCustom.cpp:
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        * bindings/v8/custom/V8ElementCustom.cpp:
+        * bindings/v8/custom/V8EventCustom.cpp:
+        * bindings/v8/custom/V8SVGElementCustom.cpp:
+
+2010-02-24  Maciej Stachowiak  <mjs@apple.com>
+
+        Unreviewed build fix.
+
+        Fix gtk build.
+
+        Include JSC headers as runtime/ instead of JavaScriptCore/
+
+        * bindings/js/JSDOMWrapper.h:
+        * bindings/js/ScriptWrappable.h:
+
+2010-02-24  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Cache JavaScript wrappers inline in DOM nodes
+        https://bugs.webkit.org/show_bug.cgi?id=35226
+
+        <rdar://problem/7664202>
+        
+        7.4% speedup on Dromaeo DOM Core tests.
+        2.3% speedup on Hixie DOM Core tests.
+
+        This fixes the following things from the last attempt:
+        - Now builds in both debug and release and passes all tests
+        - Properly use a WeakGCPtr, not just a raw pointer, in ScriptWrappable
+        - Properly look in the appropriate per-document or per-world map
+        - Added an assert that would have caught any of the problems I found
+        - Handle clearing the inline cache properly in all cases
+        
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::cacheDOMObjectWrapper): Adjust for name changes.
+        (WebCore::forgetDOMNode): Clear wrapper pointer.
+        (WebCore::cacheDOMNodeWrapper): Cache inline too if caching for normal world.
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::Document::getWrapperCache): Inlined.
+        (WebCore::domObjectWrapperMapFor): Renamed to start with lowercase. Moved to header to inline.
+        * bindings/js/JSDOMWrapper.h: Added.
+        (WebCore::DOMObject::DOMObject): Factored this out of JSDOMBinding.h to avoid include
+        cycle. I think the class should be renamed, I picked a forward-looking header name because
+        we already have a DOMObject.h
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::createWrapperInline): Renamed version of original createWrapper.
+        (WebCore::createWrapper): Call createWrapperInline. Out-of-line version.
+        (WebCore::toJSNewlyCreated): Call createWrapperInline instead of createWrapper.
+        * bindings/js/JSNodeCustom.h: Added.
+        (WebCore::getCachedDOMNodeWrapper): Moved from JSDOMBinding.cpp and moved here,
+        so it could inline everywhere without creating an include cycle. Consider inline
+        cache.
+        (WebCore::toJS): Moved to header to inline.
+        * bindings/js/ScriptWrappable.h:
+        (WebCore::ScriptWrappable::ScriptWrappable): Implement this in the obvious
+        way for JavaScriptCore. (Using a WeakGCPtr).
+        (WebCore::ScriptWrappable::wrapper):
+        (WebCore::ScriptWrappable::setWrapper):
+        (WebCore::ScriptWrappable::clearWrapper):
+        * bindings/scripts/CodeGeneratorJS.pm: Include CustomHeader heaaders
+        in the header, not just the impl file, so they can add inlining.
+        * dom/Node.idl: Add CustomHeader directive.
+        
+        Add new files to build.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
+
+2010-02-24  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Expose Database object of currently active task on the database thread
+        https://bugs.webkit.org/show_bug.cgi?id=35341
+
+        * storage/DatabaseThread.cpp:
+        (WebCore::DatabaseThread::DatabaseThread):
+        (WebCore::DatabaseThread::databaseThread):
+        * storage/DatabaseThread.h:
+        (WebCore::DatabaseThread::getDatabaseOfCurrentTask):
+
+2010-02-24  Nicholas Young  <nicholas.young@nokia.com>
+
+        Reviewed by Eric Carlson.
+
+        supportsMuting() should be an internal interface between MediaPlayer and MediaPlayerPrivate.
+        https://bugs.webkit.org/show_bug.cgi?id=35327
+
+        No new tests. Refactoring Only.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setMuted): Do not check supportsMuting()
+        (WebCore::HTMLMediaElement::updateVolume): Set volume and muted
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::setVolume): Check supportsMuting()
+        (WebCore::MediaPlayer::setMuted): Check supportsMuting()
+        * platform/graphics/MediaPlayer.h: Remove supportsMuting()
+
+2010-02-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium API] Disambiguate allowJavaScript from didNotAllowScript
+        https://bugs.webkit.org/show_bug.cgi?id=35205
+
+        For clients that want to show a user interface element when JavaScript
+        was blocked on a page, we need to disambiguate between querying the
+        client for whether JavaScript is enabled from actually failing to
+        execute some script.
+
+        This patch adds a new FrameLoaderClient callback for when WebCore would
+        like to execute JavaScript but fails to because JavaScript is disabled.
+
+        This patch also touches every client of canExecuteScripts so they can
+        indicate whether we should make this callback.  I was hoping there was
+        a better choke point, but my first two attempts were wrong in subtle
+        ways.  pkasting points out that this will be easy to screw up in the
+        future, so it's better to make all the clients be explicit.
+
+        * WebCore.PluginHostProcess.exp:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::canExecuteScripts):
+        (WebCore::ScriptController::executeScript):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::initializeJSFunction):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::bindingRootObject):
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::jsObjectForPluginElement):
+        (WebCore::ScriptController::executeScriptInWorld):
+        * bindings/js/ScriptController.h:
+        (WebCore::):
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::ScriptController::windowScriptObject):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::setJavaScriptPaused):
+        * bindings/js/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::scriptStateFromNode):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::createScriptObjectForPluginElement):
+        * bindings/v8/ScriptController.h:
+        (WebCore::):
+        * bindings/v8/ScriptEventListener.cpp:
+        (WebCore::createAttributeEventListener):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::retrieve):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElementData::evaluateScript):
+        * dom/XMLTokenizerLibxml2.cpp:
+        (WebCore::XMLTokenizer::startElementNs):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::controls):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::processToken):
+        * inspector/InspectorController.cpp:
+        (WebCore::canPassNodeToJavaScript):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::isProcessingUserGesture):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::didNotAllowScript):
+
+2010-02-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Add call to FrameLoaderClient::allowPlugins everywhere arePluginsEnabled is called
+        https://bugs.webkit.org/show_bug.cgi?id=34997
+
+        If we want to let the FrameLoaderClient override arePluginsEnabled,
+        then we need to call out to the FrameLoaderClient every time we read
+        the setting.
+
+        We don't have testing infrustructure for these changes, which is lame.
+        I'm supposed to fix that in Bug 33991.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::substituteMIMETypeFromPluginDatabase):
+        * loader/PluginDocument.cpp:
+        (WebCore::PluginTokenizer::writeRawData):
+        * page/Page.cpp:
+        (WebCore::Page::pluginData):
+        * plugins/MimeType.cpp:
+        (WebCore::MimeType::enabledPlugin):
+
+2010-02-24  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Do not fire focus events while a modal dialog is up.
+        https://bugs.webkit.org/show_bug.cgi?id=33962
+
+        Modifies the FocusController to check the frame's page's defersLoading() flag before firing blur/focus events.
+        This flag is set while a modal dialog (like a window.alert or window.confirm) is up.  Firing the events causes
+        assertion failures, since when the dialog is dismissed the PageGroupLoadDeferrer assumes that no script has run.
+
+        Manual tests only as DumpRenderTree does not support modal dialogs
+
+        * manual-tests/modal-dialog-blur-selfclose.html: Added.
+        * manual-tests/modal-dialog-blur.html: Added.
+        * page/FocusController.cpp:
+        (WebCore::dispatchEventsOnWindowAndFocusedNode):
+
+2010-02-24  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        <rdar://problem/7018611> innerHTML applies meta/link/title tags from a detached html element
+
+        Test: fast/parser/fragment-parser.html
+
+        Ensure that fragment parsing has no side effects on the fragment’s owner
+        document.
+
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::insertNode): Don’t call
+        dispatchDocumentElementAvailable() for fragments.
+        (WebCore::HTMLParser::handleError): Don’t copy attributes to the owner
+        document’s <html> and <body> elements when a redundant <html> or <body>
+        is encountered while parsing a fragment.
+        (WebCore::HTMLParser::framesetCreateErrorCheck): Don’t change the owner
+        document’s <body> element’s style when parsing a fragment.
+        (WebCore::HTMLParser::createHead): Don’t attach the new <head> to the
+        ownder document of a fragment.
+
+2010-02-24  David Levin  <levin@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Need to create a CanvasSurface base class for HTMLCanvasElement.
+        https://bugs.webkit.org/show_bug.cgi?id=35322
+
+        This is an initial step in making the OffscreenCanvas object.
+
+        No new functionality so no new tests.
+
+        * GNUmakefile.am: Added CanvasSurface to the build.
+        * WebCore.gypi: ditto
+        * WebCore.pro: ditto
+        * WebCore.vcproj/WebCore.vcproj: ditto
+        * WebCore.xcodeproj/project.pbxproj: ditto
+        * dom/CanvasSurface.cpp: Added.
+        * dom/CanvasSurface.h: Added.
+        * html/HTMLCanvasElement.h: Made HTMLCanvasElement inherit from CanvasSurface.
+
+2010-02-24  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Adam Barth.
+
+        Fix regression in calculating an animated image's start time.
+        https://bugs.webkit.org/show_bug.cgi?id=35115
+
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::startAnimation):
+
+2010-02-24  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/7682827> Text with :first-letter lingers after being removed
+
+        Test: fast/css/first-letter-set-text.html
+
+        * rendering/RenderTextFragment.cpp:
+        (WebCore::RenderTextFragment::setTextInternal): Set this back as the
+        text node’s renderer, as removing the first letter has resets the node’s
+        renderer.
+
+2010-02-24  Ariya Hidayat  <ariya.hidayat@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Faster cut-off for rectangle fill without shadow.
+        https://bugs.webkit.org/show_bug.cgi?id=35337
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+
+2010-02-24  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by nobody, build fix.
+
+        [Qt] Corrects build break of QtLauncher on Windows.
+        The VERSION variable was not set anymore while building in trunk.
+
+        * WebCore.pro:
+
+2010-02-24  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Activate/Deactivate breaks does not look consistent with rest of the toolbar.
+
+        Fix style and add the new images to the related file sets.
+        https://bugs.webkit.org/show_bug.cgi?id=35307
+
+        * WebCore.gypi:
+        * inspector/front-end/Images/deactivateBreakpointsButtonGlyph.png:
+        * inspector/front-end/Images/deactivateBreakpointsDisabledButtonGlyph.png:
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.css:
+
+2010-02-24  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Get rid of an extra call to
+        setNPWindowIfNeeded. updatePluginWidget already calls this for us
+        if needed.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::platformStart):
+
+2010-02-24  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Try to sanitize a bit the geometry management of plugins.
+
+        Stop doing contradictory things in updatePluginWidget (we were at
+        the same time pretending the geometry setting was delayed until
+        ::paint and setting the geometry not once but twice) and just set
+        it any time the windowRect or clipRect for the plugin has changed.
+
+        This is closer to what the Mac port does, and fixes instances of
+        the plugins not being drawn until the window is resized or
+        scrolled. Other than that all manual and layout tests seems to
+        still work.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::updatePluginWidget):
+        (WebCore::PluginView::setNPWindowIfNeeded):
+
+2010-02-23  Geoff Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Simplify animation lifetime handling.  Previously we manually
+        determined whether our base element was safe when we unregistered
+        our listener, now we simply ensure that the base element itself
+        registers and unregisters the animation listener.
+
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::ConditionEventListener::create):
+        (WebCore::ConditionEventListener::disconnectAnimation):
+        (WebCore::ConditionEventListener::ConditionEventListener):
+        (WebCore::ConditionEventListener::operator==):
+        (WebCore::ConditionEventListener::handleEvent):
+        (WebCore::SVGSMILElement::eventBaseFor):
+        (WebCore::SVGSMILElement::connectConditions):
+        (WebCore::SVGSMILElement::disconnectConditions):
+        * svg/animation/SVGSMILElement.h:
+
+2010-02-23  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by David Levin.
+
+        Chromium: Use V8::TerminateExecution to actually terminate workers.
+        https://bugs.webkit.org/show_bug.cgi?id=35137
+
+        Test: existing fast/workers/stress-js-execution.html which is currently failing
+        on Mac and Linux bots for Chromium.
+
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::evaluate):
+        * bindings/v8/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::forbidExecution):
+
+2010-02-23  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        REGRESSION: WebKit crashes when deleting images on blogger.com (34957)
+        <rdar://problem/7651935>
+        https://bugs.webkit.org/show_bug.cgi?id=34957
+
+        Fixing a regression introduced with revision 53085. Anchor elements should not be considered
+        in editable content when calculating the position in the parent before the node.
+        
+        Test: editing/execCommand/delete-image-in-anchor.html
+
+        * dom/Position.cpp:
+        (WebCore::Position::getInlineBoxAndOffset):
+
+2010-02-23  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34634
+        Pasting a list into the middle of another list item should split the target
+        list item into two separate list items.  This matches the behavior in other
+        browsers.
+
+        Test: editing/pasteboard/paste-list-004.html
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::insertAsListItems):
+
+2010-02-23  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher and Pavel Feldman.
+
+        Regression (r55107) - WebInspector docking is busted.
+        https://bugs.webkit.org/show_bug.cgi?id=35274
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::canAttachWindow): Use the minimum height for this calculation,
+          not the preferred height.
+        (WebCore::InspectorController::attachWindow): attachWindow() shouldn't decide the policy, as it is
+          often called partway through the show or dock procedure after some of the initial conditions have
+          changed. Let the front-end itself and the InspectorClient's make the policy decision at the start
+          of the show/dock operation.
+
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::canAttachWindow):
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+
+        * inspector/front-end/inspector.js:
+        (WebInspector.toggleAttach): Before attaching, ask the front-end-host if attaching is allowed.
+
+2010-02-23  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        <http://webkit.org/b/35287> ImageSourceCG::frameIsCompleteAtIndex returns false for all frames until image has completed loading
+
+        CGImageSourceGetStatusAtIndex claims that all frames of a multi-frame image are incomplete when we've not yet received the
+        complete data for an image that is using an incremental data source (<rdar://problem/7679174>). We work around this by
+        special-casing all frames except the last in an image and treating them as complete if they are present and reported as
+        being incomplete. We do this on the assumption that loading new data can only modify the existing last frame or append new
+        frames. The last frame is only treated as being complete if the image source reports it as such. This ensures that it is
+        truly the last frame of the image rather than just the last that we currently have data for.
+
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::frameIsCompleteAtIndex):
+
+2010-02-23  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Crash in createContextualFragment when inserting a list in a non HTML document.
+        <rdar://problem/7666670>
+        https://bugs.webkit.org/show_bug.cgi?id=35305
+        
+        createFragmentFromMarkup did not handle correctly the case where documentElement is
+        not an HTMLElement. The static cast to HTMLElement was causing createContextualFragment to
+        crash.
+        
+        Test: editing/execCommand/insert-list-xml.xhtml
+
+        * dom/Element.cpp:
+        (WebCore::Element::createContextualFragment): Added.
+        * dom/Element.h: Added createContextualFragment virtual function.
+        * editing/markup.cpp:
+        (WebCore::createFragmentFromMarkup): Removed static cast to HTMLElement.
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::createContextualFragment): Modified to perform only checks
+        that are specific for an HTMLElement object. The rest of the logic has been moved to the
+        corresponding method in the Element class.
+
+2010-02-23  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebCore should stop throwing away the CGImageSourceRef on Windows to improve GIF performance
+        https://bugs.webkit.org/show_bug.cgi?id=35309
+
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::clear):
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Changes references of GOwnPtr to reflect their new place.
+        http://webkit.org/b/35084
+
+        * WebCore/platform/KURL.cpp
+        * WebCore/platform/TextEncoding.cpp:
+        * WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp: 
+        * WebCore/platform/text/gtk/TextCodecGtk.cpp:
+
+2010-02-23  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        HTTP 307 after a 303 after a POST re-sends POST data from the original request.
+        <rdar://problem/7390251> and https://bugs.webkit.org/show_bug.cgi?id=31410
+
+        Test: http/tests/loading/307-after-303-after-post.html
+
+        Remember the last HTTP method send out during a redirect chain for a resource handle:
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::lastHTTPMethod):
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+
+        Refer to the last HTTP method used instead of the original method:
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::willSendRequest):
+        (WebCore::ResourceHandle::willSendRequest):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::willSendRequest):
+        (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
+
+2010-02-23  Crystal Zhang  <haizhang@rim.com>
+
+        Unreviewed build fix.
+
+        Fix build error when enable plugin proxy: 'toRenderEmbeddedObject' identifier not found.
+        As RenderEmbeddedObject inherits RenderPartObject and 'toRenderEmbeddedObject' belongs
+        to former one.
+
+        * html/HTMLMediaElement.cpp:
+
+2010-02-23  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        [chromium] fix previous SVG-disabling patch
+        https://bugs.webkit.org/show_bug.cgi?id=35298
+
+        * WebCore.gypi: rename variable
+        * WebCore.gyp/WebCore.gyp: actually use the variable
+
+2010-02-23  Michael Lotz <mmlr@mlotz.ch>
+
+        Reviewed by David Levin.
+
+        [Haiku] Fix conversion from BString to String
+        https://bugs.webkit.org/show_bug.cgi?id=35082
+
+        The previous patch to this file was broken (sorry). First of all,
+        the conversion from UTF8 was accidentally removed. Second, for
+        empty strings, we need to point the implementation at StringImpl::empty().
+
+        Covered by existing tests.
+
+        * platform/text/haiku/StringHaiku.cpp:
+        (WebCore::String::String):
+
+2010-02-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Eric Carlson.
+
+        [Qt] Prevent the media backend from handling non-audio or -video mime types
+
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+
+2010-02-23  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        [chromium] Allow building without SVG
+        https://bugs.webkit.org/show_bug.cgi?id=31522
+
+        * WebCore.gyp/WebCore.gyp, WebCore.gypi: test enable_svg flag.
+        * bindings/v8/custom/V8SVGDocumentCustom.cpp,
+          bindings/v8/custom/V8SVGPathSegCustom.cpp: test ENABLE(SVG).
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Fixes references to GOwnPtr and GRefPtr so the GTK+ port builds
+        again.
+        http://webkit.org/b/35084
+
+        * WebCore/platform/gtk/DataObjectGtk.h:
+        * WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+
+2010-02-23  Ariya Hidayat  <ariya.hidayat@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Faster cut-off for rectangle drawing without shadow.
+        https://bugs.webkit.org/show_bug.cgi?id=35267
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::drawRect):
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Removes redundant Settings::setGeolocationEnabled and Settings::geolocationEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=35242
+
+        No new tests, removing dead code only.
+
+        * page/Settings.cpp:
+        * page/Settings.h:
+
+2010-02-23  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Eric Seidel.
+
+        pageX/Y co-ordinates of TouchEvent should be 0,0
+        https://bugs.webkit.org/show_bug.cgi?id=35239
+
+        The co-ordinates attached to a touch event are not used for tracking touch motion, rather the co-ordinates attached to Touches within the touch event should be used. Set the co-ordinates on the event itself to 0 to avoid confusion and match observed iPhone behavior.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleTouchEvent): Set the pageX/Y and screenX/Y co-ordinates attached to the touch event to 0,0 to match observed behavior on the iPhone.
+        * page/EventHandler.h: Remove now unused members m_firstTouchScreenPos and m_firstTouchPagePos.
+
+2010-02-23  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Various improvements to EventHandlerHaiku.
+        https://bugs.webkit.org/show_bug.cgi?id=34685
+
+        Covered by existing tests.
+
+        Fix the build by not including PlatformScrollBar.h.
+
+        * page/haiku/EventHandlerHaiku.cpp:
+        (WebCore::isKeyboardOptionTab):
+            Use the correct keycode for tab keys.
+        (WebCore::EventHandler::focusDocumentView):
+            Use proper locking. In any case, Haiku doesn't append platform
+            widgets to WebCore widgets. But if it did, this implementation
+            would be correct.
+        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+            Implemented.
+        (WebCore::EventHandler::eventActivatedView):
+            Removed notImplemented() and added note.
+        (WebCore::EventHandler::passMousePressEventToSubframe):
+            Implemented.
+        (WebCore::EventHandler::passMouseMoveEventToSubframe):
+            Implemented.
+        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+            Implemented.
+        (WebCore::EventHandler::accessKeyModifiers):
+            Added note.
+
+2010-02-23  Tony Chang  <tony@chromium.org>
+
+        Not reviewed.
+        Revert r55135 because the layout test is failing on all the bots.
+        https://bugs.webkit.org/show_bug.cgi?id=34634
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::insertAsListItems):
+
+2010-02-17  Steve Block  <steveblock@google.com>
+
+        Reviewed by Ariya Hidayat.
+
+        Adds cache to store Geolocation positions between browser sessions.
+        https://bugs.webkit.org/show_bug.cgi?id=34084
+
+        This is required to fully implement the Geolocation maximumAge property.
+        See Bug 30676.
+
+        No new tests, will add tests for maximumAge once complete.
+
+        * Android.mk: Modified. Added GeolocationPositionCache.cpp
+        * GNUmakefile.am: Modified. Added GeolocationPositionCache.[cpp|h]
+        * WebCore.gypi: Modified. Added GeolocationPositionCache.[cpp|h]
+        * WebCore.pro: Modified. Added GeolocationPositionCache.[cpp|h]
+        * WebCore.vcproj/WebCore.vcproj: Modified. Added GeolocationPositionCache.[cpp|h]
+        * WebCore.xcodeproj/project.pbxproj: Modified. Added GeolocationPositionCache.[cpp|h]
+        * page/GeolocationPositionCache.cpp: Added.
+        (WebCore::GeolocationPositionCache::GeolocationPositionCache):
+        (WebCore::GeolocationPositionCache::~GeolocationPositionCache):
+        (WebCore::GeolocationPositionCache::setCachedPosition):
+        (WebCore::GeolocationPositionCache::cachedPosition):
+        (WebCore::GeolocationPositionCache::setDatabasePath):
+        (WebCore::GeolocationPositionCache::readFromDB):
+        (WebCore::GeolocationPositionCache::writeToDB):
+        * page/GeolocationPositionCache.h: Added.
+
+2010-02-23  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix alignment of vertical-align: text-bottom inside an inline-block.
+        
+        This patch is based on a fix provided by Takahito Hirano.
+
+        display: inline-block + vertical-align: text-bottom causes misalignment.
+        https://bugs.webkit.org/show_bug.cgi?id=30846
+
+        Test: fast/inline-block/inline-block-vertical-align-2.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::verticalPosition): Fixed vpos calculation.
+        We cannot cut corners for inline blocks, since they may have their own
+        text metrics.
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by David Levin.
+
+        Sets default values of V8 runtime enabler flags to match behavior with JSC
+        https://bugs.webkit.org/show_bug.cgi?id=35095
+
+        No new tests, modifies a Chromium feature only.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp: Modified. Sets appcache and geolocation flag defaults to 'on'
+        * storage/Database.cpp: Modified. Sets database flag default to 'on'.
+
+2010-02-23  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Fix various issues in keyboard event generation.
+        https://bugs.webkit.org/show_bug.cgi?id=34685
+
+        Covered by existing tests.
+
+        Fixed backspace keycode.
+        Fixed using the appropriate fields from the Haiku event for mapping
+        to the VK_* codes and added mapping a great deal more codes.
+        Added extraction of modifier key flags.
+        Completed implementation of disambiguateKeyDownEvent()
+        Implemented currentCapsLockState().
+
+        * platform/haiku/PlatformKeyboardEventHaiku.cpp:
+        (WebCore::keyIdentifierForHaikuKeyCode):
+        (WebCore::windowsKeyCodeForKeyEvent):
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
+        (WebCore::PlatformKeyboardEvent::currentCapsLockState):
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds Client::cancelGeolocationPermissionRequestForFrame and ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        These methods are required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        No new tests, as this is for the purposes of browser UI only.
+
+        * loader/EmptyClients.h: Modified
+        (WebCore::EmptyChromeClient::cancelGeolocationPermissionRequestForFrame): Added
+        * page/Chrome.cpp: Modified.
+        (WebCore::Chrome::cancelGeolocationPermissionRequestForFrame): Added
+        * page/Chrome.h: Modified.
+        * page/ChromeClient.h: Modified.
+        (WebCore::ChromeClient::cancelGeolocationPermissionRequestForFrame): Added
+        * page/Geolocation.cpp: Modified.
+        (WebCore::Geolocation::disconnectFrame): Modified. Call cancelGeolocationPermissionRequestForFrame
+
+2010-02-23  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34634
+        Pasting a list into the middle of another list item should split the target
+        list item into two separate list items.  This matches the behavior in other
+        browsers.
+
+        Test: editing/pasteboard/paste-list-004.html
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::insertAsListItems):
+
+2010-02-23  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Correct build problems while building QtWebKit inside Qt.
+        https://bugs.webkit.org/show_bug.cgi?id=34975
+
+        * WebCore.pro: Change the condition !standalone_package to !QTDIR_build
+
+2010-02-23  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] Connect video with accelerated compositing
+        https://bugs.webkit.org/show_bug.cgi?id=35276
+
+        MediaControlPrivate and GraphicsLayer are patched together via
+        a shared PlatformLayer (QGraphicsItem). This patch makes sure that the
+        QGraphicsVideoItem from MediaControl becomes part of the scene 
+        associsated with GraphicsLayer
+
+        Test: http://double.co.nz/video_test/test1.html with AC turned on
+
+        * platform/graphics/qt/GraphicsLayerQt.cpp:
+        (WebCore::GraphicsLayerQtImpl::): mediaLayer member
+        (WebCore::GraphicsLayerQtImpl::opaqueArea): video is opaque
+        (WebCore::GraphicsLayerQtImpl::paint): don't paint video
+        (WebCore::GraphicsLayerQtImpl::flushChanges): flush mediaLayer
+        (WebCore::GraphicsLayerQt::setContentsToMedia): notify
+        * platform/graphics/qt/GraphicsLayerQt.h: reimp setContentsToMedia
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): m_compositing
+        (WebCore::MediaPlayerPrivate::paint): don't paint if compositing
+        (WebCore::MediaPlayerPrivate::acceleratedRenderingStateChanged):
+        reimp from MediaPlayerPrivateInterface to support AC
+        (WebCore::MediaPlayerPrivate::platformLayer): ditto
+        * platform/graphics/qt/MediaPlayerPrivateQt.h: 
+        (WebCore::MediaPlayerPrivate::supportsAcceleratedRendering): ditto
+
+2010-02-23  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        Fix various issues in PlatformWheelEventHaiku.
+        https://bugs.webkit.org/show_bug.cgi?id=34685
+
+        Covered by existing tests.
+        
+        Fixed coding style violations.
+        Synced extracting the correct coordinates with Haiku WebKit implementation.
+        Added extracting modifier key flags.
+
+        * platform/haiku/PlatformWheelEventHaiku.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+
+2010-02-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Build fix for PluginView
+        https://bugs.webkit.org/show_bug.cgi?id=35230
+
+        No new tests, build fix only.
+
+        * plugins/PluginView.cpp:
+        * plugins/PluginView.h:
+        * plugins/PluginViewNone.cpp:
+
+2010-02-23  Kwang Yul Seo  <skyul@company100.net>
+
+        Reviewed by Eric Seidel.
+
+        [BREWMP] Port ScriptController::createScriptInstanceForWidget
+        https://bugs.webkit.org/show_bug.cgi?id=34413
+
+        * bindings/js/ScriptControllerBrew.cpp: Added.
+        (WebCore::ScriptController::createScriptInstanceForWidget):
+
+2010-02-23  José Millán Soto  <jmillan@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Gtk] Webkit crashes when using orca
+        https://bugs.webkit.org/show_bug.cgi?id=35169
+
+        Made webkit_accessible_text_get_caret_offset check if end selection
+        node is null.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_text_get_caret_offset):
+
+2010-02-22  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Implemented PopupMenu support.
+        https://bugs.webkit.org/show_bug.cgi?id=35078
+
+        Covered by existing tests.
+
+        The implementation is currently very simple: Added a PopupMenuHaiku
+        class that derives from a native BPopUpMenu. It attaches a BHandler
+        derivative to the BApplication (WebCore main thread) which receives
+        the item invokation and menu hidden events and informs the PopupMenuClient
+        accordingly.
+
+        * platform/PopupMenu.h:
+            Changed type of m_menu for Haiku.
+        * platform/haiku/PopupMenuHaiku.cpp:
+        (WebCore::PopupMenuHandler::PopupMenuHandler):
+        (WebCore::PopupMenuHandler::MessageReceived):
+        (WebCore::PopupMenuHaiku::PopupMenuHaiku):
+        (WebCore::PopupMenuHaiku::~PopupMenuHaiku):
+        (WebCore::PopupMenuHaiku::show):
+        (WebCore::PopupMenuHaiku::hide):
+        (WebCore::PopupMenuHaiku::Hide):
+        (WebCore::PopupMenu::PopupMenu):
+        (WebCore::PopupMenu::~PopupMenu):
+            Removed bogus code.
+        (WebCore::PopupMenu::show):
+            Implemented using new PopupMenuHaiku class.
+        (WebCore::PopupMenu::hide):
+            Implemented using new PopupMenuHaiku class.
+        (WebCore::PopupMenu::updateFromElement):
+            Implemented.
+        (WebCore::PopupMenu::itemWritingDirectionIsNatural):
+            Implemented according to Gtk port.
+
+2010-02-22  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        Fix various issues in PlatformMouseEventHaiku.
+        https://bugs.webkit.org/show_bug.cgi?id=34685
+
+        Covered by existing tests.
+        
+        Mapping Haiku button constants (bit field) to WebCore buttons was broken.
+        Extracting event time was broken (supposed to be in seconds).
+        Wrong coordinate was being extracted, needs to be content local.
+        Added extracting modifier key flags.
+
+        * platform/haiku/PlatformMouseEventHaiku.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+
+2010-02-22  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        [Haiku] Implement creating and filling platform gradients.
+        https://bugs.webkit.org/show_bug.cgi?id=34683
+
+        Covered by existing tests.
+
+        * platform/graphics/Gradient.h:
+            Typedef PlatformGradient to BGradient
+        * platform/graphics/haiku/GradientHaiku.cpp:
+        (WebCore::Gradient::platformDestroy):
+            Delete the cached BGradient object.
+        (WebCore::Gradient::platformGradient):
+            Create a BGradient object according to the type of Gradient.
+            Return the cached object.
+        (WebCore::Gradient::fill):
+            use BView API to fill with the platform gradient.
+
+2010-02-22  Stephan Aßmus  <superstippi@gmx.de>
+
+        Reviewed by Eric Seidel.
+
+        Build fix for debug builds of GlyphPageTreeNode.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=34528
+
+        Covered by existing tests.
+
+        * platform/graphics/GlyphPageTreeNode.cpp:
+            include <stdio.h> since printf() is used if NDEBUG is not defined.
+
+2010-02-22  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        Add special case in CodeGeneratorV8.pm for named getters for html plugin-related elements.
+
+        CodeGeneratorV8.pm was relying on HasOverridingNameGetter to hint
+        that a custom named getter was needed. That hint was removed in
+        http://trac.webkit.org/changeset/55104.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+
+2010-02-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Rubber-stamped by Geoff Garen.
+
+        Rename RuntimeObjectImp to RuntimeObject.
+
+        * WebCore.PluginHostProcess.exp:
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::getRuntimeObject):
+        (WebCore::runtimeObjectPropertyGetter):
+        (WebCore::runtimeObjectCustomGetOwnPropertySlot):
+        (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):
+        (WebCore::runtimeObjectCustomPut):
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+        * bridge/c/c_utility.cpp:
+        (JSC::Bindings::convertValueToNPVariant):
+        * bridge/jni/jni_jsobject.mm:
+        (JavaJSObject::convertValueToJObject):
+        * bridge/jni/jsc/JNIUtilityPrivate.cpp:
+        (JSC::Bindings::convertValueToJValue):
+        * bridge/jsc/BridgeJSC.cpp:
+        (JSC::Bindings::Instance::createRuntimeObject):
+        (JSC::Bindings::Instance::newRuntimeObject):
+        * bridge/jsc/BridgeJSC.h:
+        * bridge/objc/objc_runtime.mm:
+        (JSC::Bindings::callObjCFallbackObject):
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObject::markChildren):
+        (JSC::Bindings::):
+        (JSC::Bindings::QtRuntimeObject::QtRuntimeObject):
+        (JSC::Bindings::QtInstance::getInstance):
+        (JSC::Bindings::QtInstance::newRuntimeObject):
+        * bridge/qt/qt_instance.h:
+        * bridge/qt/qt_pixmapruntime.cpp:
+        (JSC::Bindings::QtPixmapRuntimeObject::QtPixmapRuntimeObject):
+        (JSC::Bindings::):
+        (JSC::Bindings::QtPixmapInstance::variantFromObject):
+        (JSC::Bindings::QtPixmapInstance::createRuntimeObject):
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::valueRealType):
+        * bridge/runtime_method.cpp:
+        (JSC::callRuntimeMethod):
+        * bridge/runtime_object.cpp:
+        (JSC::RuntimeObject::RuntimeObject):
+        (JSC::RuntimeObject::~RuntimeObject):
+        (JSC::RuntimeObject::invalidate):
+        (JSC::RuntimeObject::fallbackObjectGetter):
+        (JSC::RuntimeObject::fieldGetter):
+        (JSC::RuntimeObject::methodGetter):
+        (JSC::RuntimeObject::getOwnPropertySlot):
+        (JSC::RuntimeObject::getOwnPropertyDescriptor):
+        (JSC::RuntimeObject::put):
+        (JSC::RuntimeObject::deleteProperty):
+        (JSC::RuntimeObject::defaultValue):
+        (JSC::callRuntimeObject):
+        (JSC::RuntimeObject::getCallData):
+        (JSC::callRuntimeConstructor):
+        (JSC::RuntimeObject::getConstructData):
+        (JSC::RuntimeObject::getOwnPropertyNames):
+        (JSC::RuntimeObject::throwInvalidAccessError):
+        * bridge/runtime_object.h:
+        * bridge/runtime_root.cpp:
+        (JSC::Bindings::RootObject::invalidate):
+        (JSC::Bindings::RootObject::addRuntimeObject):
+        (JSC::Bindings::RootObject::removeRuntimeObject):
+        * bridge/runtime_root.h:
+
+2010-02-19  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Eric Seidel.
+
+        Avoid recursion when trying to get the size of a PNG; it's unnecessary
+        and in the worst case can lead to heap corruption.
+        https://bugs.webkit.org/show_bug.cgi?id=35167
+
+        Test: fast/images/bad-png.html
+
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageReader::decode):
+
+2010-02-22  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Disable WebView docking to views that are too small.
+        <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+        * WebCore.base.exp:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::canAttachWindow): Provide a utility for WebKits to make a showWindow()
+          decision based on if attachment would be allowed or not.
+        (WebCore::InspectorController::attachWindow): Don't attach if the view is too small to attach to.
+        * inspector/InspectorController.h:
+
+2010-02-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix.
+
+        * WebCore.base.exp: Export Instance::newRuntimeObject, it's virtual!
+
+2010-02-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Undo a small part of the previous commit.
+
+        * bridge/runtime_method.cpp: (JSC::callRuntimeMethod): Let's keep the instance local
+        variable as RefPtr for safety.
+
+2010-02-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35260
+        Eliminate __apple_runtime_object
+
+        No change in functionality, so no tests.
+
+        * WebCore.base.exp: Don't export Instance::newRuntimeObject, WebKit doesn't need it.
+
+        * bindings/js/JSHTMLAppletElementCustom.cpp:
+        * bindings/js/JSHTMLEmbedElementCustom.cpp:
+        * bindings/js/JSHTMLObjectElementCustom.cpp:
+        * html/HTMLAppletElement.idl:
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLObjectElement.idl:
+        These objects no longer need overriding name getters, as they no longer intercept the
+        __apple_runtime_object property.
+
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::pluginInstance): This is no longer static. It was used for callPlugin() in
+        this file, and now it's also used elsewhere when calling plug-in methods.
+        (WebCore::runtimeObjectGetter): Removed. This function was only used by the intercepting
+        name getters.
+
+        * bindings/js/JSPluginElementFunctions.h: Export pluginInstance().
+
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+        * bridge/runtime_method.cpp:
+        (JSC::callRuntimeMethod):
+        Take plug-in element's instance directly, without relying on fake attribute lookup.
+        One change resulting from this is that RuntimeObjectImp may not be created in some cases -
+        this code only needs an instance, but the old code had to pass the instance wrapped into
+        RuntimeObjectImp.
+
+2010-02-22  John Sullivan  <sullivan@apple.com>
+        
+        Reviewed by Tim Hatcher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35256
+        HTMLSelectElement::setSelectedIndexByUser() can trigger unnecessary JS when there is no change to the selected index
+
+        No new tests because this code path is not used for JS-initiated changes.
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::setSelectedIndexByUser):
+        Bail out if the to-be-selected index matches the already-selected index.
+
+2010-02-22  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Reproducible crash in WebCore::nextLinePosition on Tweeteorites.com
+        <rdar://problem/7615758>
+        https://bugs.webkit.org/show_bug.cgi?id=35060
+
+        Test: editing/selection/extend-byline-withfloat.html
+
+        * editing/visible_units.cpp:
+        (WebCore::previousLinePosition): Skip elements with zero height.
+        (WebCore::nextLinePosition): Skip elements with zero height.
+
+2010-02-22  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        * bindings/scripts/CodeGeneratorV8.pm: Compile break due to bad patch merge.
+
+2010-02-22  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Streamline V8 event listener code. Merge all the variants of
+        V8DOMWrapper::getEventListner() into a single version and generate
+        addEventListener() and removeEventListener() bindings for all objects 
+        except DOMWindow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35245
+
+        * Android.v8bindings.mk:
+        * WebCore.gypi:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::getEventListener):
+        * bindings/v8/V8DOMWrapper.h:
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        * bindings/v8/WorkerContextExecutionProxy.h:
+        * bindings/v8/custom/V8AbstractWorkerCustom.cpp: Removed.
+        * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp: Removed.
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::addEventListenerCallback):
+        (WebCore::V8DOMWindow::removeEventListenerCallback):
+        * bindings/v8/custom/V8EventSourceCustom.cpp: Removed.
+        * bindings/v8/custom/V8MessagePortCustom.cpp:
+        * bindings/v8/custom/V8NodeCustom.cpp:
+        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+        * bindings/v8/custom/V8SVGElementInstanceCustom.cpp: Removed.
+        * bindings/v8/custom/V8WebSocketCustom.cpp:
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp:
+        * dom/MessagePort.idl:
+        * dom/Node.idl:
+        * loader/appcache/DOMApplicationCache.idl:
+        * notifications/Notification.idl:
+        * page/EventSource.idl:
+        * svg/SVGElementInstance.idl:
+        * websockets/WebSocket.idl:
+        * workers/AbstractWorker.idl:
+        * workers/WorkerContext.idl:
+        * xml/XMLHttpRequest.idl:
+        * xml/XMLHttpRequestUpload.idl:
+
+2010-02-22  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: AXFocused is not writable like it should be on nodes
+        https://bugs.webkit.org/show_bug.cgi?id=35186
+
+        Test: platform/mac/accessibility/element-focus.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::canSetFocusAttribute):
+
+2010-02-22  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein, Darin Adler.
+
+        Remove addScrolledContentOffset/subtractScrolledContentOffset
+        https://bugs.webkit.org/show_bug.cgi?id=35225
+
+        Remove RenderLayer's addScrolledContentOffset() and subtractScrolledContentOffset()
+        methods, and instead use the existing scrolledContentOffset(), and use
+        IntSize and IntPoint instead of lots of x, y variables.
+        
+        Added new IntPoint toPoint(const IntSize&) method as a convenience to convert a size to a point,
+        which is needed in a few places.
+        
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleDrag): Use the new toPoint() convenience.
+        * platform/graphics/IntPoint.h:
+        (WebCore::toPoint): New convenience method to convert an IntSize to an IntPoint.
+        * rendering/LayoutState.cpp:
+        (WebCore::LayoutState::LayoutState):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock):
+        (WebCore::RenderBlock::paintObject):
+        (WebCore::RenderBlock::selectionGapRectsForRepaint):
+        (WebCore::RenderBlock::nodeAtPoint):
+        (WebCore::RenderBlock::offsetForContents):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::clippedOverflowRectForRepaint):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPosition):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::size):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::computeRectForRepaint):
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::RenderTextControlInnerBlock::positionForPoint):
+
+2009-02-22  Adam Langley  <agl@google.com>
+
+        Reviewed by Darin Fisher.
+
+        fontconfig on Linux can change the render preferences on a per strike
+        basis (a strike a combination of face and size). Because of this, we
+        need to query fontconfig each time a new FontPlatformData is created
+        for a new size.
+
+        This patch adds support for querying this via ChromiumBridge.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33065
+
+        * platform/chromium/ChromiumBridge.h: add getRenderStyleForStrike
+        * platform/graphics/chromium/FontCacheLinux.cpp:
+        (WebCore::FontCache::createFontPlatformData):
+        * platform/graphics/chromium/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+        * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::operator=):
+        (WebCore::FontPlatformData::setupPaint):
+        (WebCore::FontPlatformData::queryStyle):
+          add code to query fontconfig via ChromiumBridge
+        * platform/graphics/chromium/FontPlatformDataLinux.h:
+
+2010-02-22  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Build fix for make distcheck.
+
+        * GNUmakefile.am:
+
+2010-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix compiler warning "suggest parentheses around"
+        https://bugs.webkit.org/show_bug.cgi?id=35197
+
+        No new tests as there is no new functionality.
+
+        * wml/WMLVariables.cpp:
+        (WebCore::substituteVariableReferences):
+
+2010-02-22  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Reviewed by Xan Lopez.
+
+        [Soup] loses information related to message flags when converting from/to Resource{Request,Response}
+        https://bugs.webkit.org/show_bug.cgi?id=35093
+
+        Store message flags in WebCore objects, and set them on the
+        SoupMessage, when creating one from them.
+
+        No behaviour change.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::fillResponseFromMessage):
+        * platform/network/soup/ResourceRequest.h:
+        (WebCore::ResourceRequest::soupMessageFlags):
+        (WebCore::ResourceRequest::setSoupMessageFlags):
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::toSoupMessage):
+        (WebCore::ResourceRequest::updateFromSoupMessage):
+        * platform/network/soup/ResourceResponse.h:
+        (WebCore::ResourceResponse::soupMessageFlags):
+        (WebCore::ResourceResponse::setSoupMessageFlags):
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponse::toSoupMessage):
+        (WebCore::ResourceResponse::updateFromSoupMessage):
+
+2010-02-22  Steve Block  <steveblock@google.com>
+
+        Reviewed by Nate Chapin.
+
+        Shared worker types used in globalObjectPrototypeIsDOMWindow are not properly guarded
+        https://bugs.webkit.org/show_bug.cgi?id=35238
+
+        No new tests, build fix only.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::globalObjectPrototypeIsDOMWindow):
+
+2010-02-22  Steve Block  <steveblock@google.com>
+
+        Reviewed by Simon Fraser.
+
+        Simplifies calculation of the transform in RenderLayer::paintLayer
+        https://bugs.webkit.org/show_bug.cgi?id=35101
+
+        No new tests, optimization only.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayer):
+
+2010-02-22  Nicholas Young  <nicholas.young@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Switching from Phonon to QtMultimedia Backend for Qt 4.7
+
+        https://bugs.webkit.org/show_bug.cgi?id=34631
+
+        No new tests. This patch only affects multimedia backend.
+
+        * WebCore.pro: Build depends on Qt version.
+        * css/mediaControlsQt.css: Updated media controls.
+        * platform/graphics/MediaPlayer.cpp: Different backend included depending on Qt version.
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp: Added new QtMultimedia Backend.
+        (WebCore::MediaPlayerPrivate::create):
+        (WebCore::MediaPlayerPrivate::registerMediaEngine):
+        (WebCore::MediaPlayerPrivate::getSupportedTypes):
+        (WebCore::MediaPlayerPrivate::supportsType):
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::hasVideo):
+        (WebCore::MediaPlayerPrivate::hasAudio):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::cancelLoad):
+        (WebCore::MediaPlayerPrivate::play):
+        (WebCore::MediaPlayerPrivate::pause):
+        (WebCore::MediaPlayerPrivate::paused):
+        (WebCore::MediaPlayerPrivate::seek):
+        (WebCore::MediaPlayerPrivate::seeking):
+        (WebCore::MediaPlayerPrivate::duration):
+        (WebCore::MediaPlayerPrivate::currentTime):
+        (WebCore::MediaPlayerPrivate::buffered):
+        (WebCore::MediaPlayerPrivate::maxTimeSeekable):
+        (WebCore::MediaPlayerPrivate::bytesLoaded):
+        (WebCore::MediaPlayerPrivate::totalBytes):
+        (WebCore::MediaPlayerPrivate::setRate):
+        (WebCore::MediaPlayerPrivate::setVolume):
+        (WebCore::MediaPlayerPrivate::supportsMuting):
+        (WebCore::MediaPlayerPrivate::setMuted):
+        (WebCore::MediaPlayerPrivate::networkState):
+        (WebCore::MediaPlayerPrivate::readyState):
+        (WebCore::MediaPlayerPrivate::setVisible):
+        (WebCore::MediaPlayerPrivate::mediaStatusChanged):
+        (WebCore::MediaPlayerPrivate::handleError):
+        (WebCore::MediaPlayerPrivate::stateChanged):
+        (WebCore::MediaPlayerPrivate::nativeSizeChanged):
+        (WebCore::MediaPlayerPrivate::queuedSeekTimeout):
+        (WebCore::MediaPlayerPrivate::seekTimeout):
+        (WebCore::MediaPlayerPrivate::positionChanged):
+        (WebCore::MediaPlayerPrivate::durationChanged):
+        (WebCore::MediaPlayerPrivate::volumeChanged):
+        (WebCore::MediaPlayerPrivate::mutedChanged):
+        (WebCore::MediaPlayerPrivate::updateStates):
+        (WebCore::MediaPlayerPrivate::setSize):
+        (WebCore::MediaPlayerPrivate::naturalSize):
+        (WebCore::MediaPlayerPrivate::paint):
+        (WebCore::MediaPlayerPrivate::repaint):
+        * platform/graphics/qt/MediaPlayerPrivateQt.h: Added new QtMultimedia Backend.
+        (WebCore::MediaPlayerPrivate::isAvailable):
+        (WebCore::MediaPlayerPrivate::supportsFullscreen):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::mediaControlsBaselineOpacity): New method.
+        (WebCore::RenderThemeQt::paintMediaBackground): Background depends on baseline opacity.
+        (WebCore::RenderThemeQt::paintMediaMuteButton): Changed styling.
+        (WebCore::RenderThemeQt::paintMediaCurrentTime): Added current time display.
+        (WebCore::RenderThemeQt::formatMediaControlsCurrentTime): Added time formatting.
+        (WebCore::RenderThemeQt::formatMediaControlsRemainingTime): Added time formatting.
+        (WebCore::RenderThemeQt::paintMediaVolumeSliderTrack): Volume slider added.
+        (WebCore::RenderThemeQt::paintMediaVolumeSliderThumb): Volume slider added.
+        (WebCore::RenderThemeQt::paintMediaSliderTrack): Updated for QtMultimedia.
+        (WebCore::RenderThemeQt::paintMediaSliderThumb): Dropped an unnecessary check.
+        (WebCore::RenderThemeQt::adjustSliderThumbSize): Handle a missing case.
+        * platform/qt/RenderThemeQt.h: Reimplemented a few more methods.
+
+2010-02-22  Alexander Pavlov  <apavlov@chromium.org>
+
+        Not reviewed: mac build fix
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+
+2010-02-22  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: there should be a way to "deactivate" or "skip" all breakpoints while debugging.
+        https://bugs.webkit.org/show_bug.cgi?id=33217
+
+        * English.lproj/localizedStrings.js:
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::hasBreakpoint):
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        * bindings/js/ScriptDebugServer.h:
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::setBreakpointsActivated):
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::activateBreakpoints):
+        (WebCore::InspectorBackend::deactivateBreakpoints):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/front-end/Images/deactivateBreakpointsButtonGlyph.png: Added.
+        * inspector/front-end/Images/deactivateBreakpointsDisabledButtonGlyph.png: Added.
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.activateBreakpoints):
+        (.WebInspector.InspectorBackendStub.prototype.deactivateBreakpoints):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.get breakpointsActivated):
+        (WebInspector.ScriptsPanel.prototype.addBreakpoint):
+        (WebInspector.ScriptsPanel.prototype._stepOutClicked):
+        (WebInspector.ScriptsPanel.prototype._toggleBreakpointsClicked):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/textViewer.css:
+
+2010-02-22  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig and Maciej Stachowiak.
+
+        REGRESSION (r55039): Animation starts from near end when loaded over slow network
+        <http://webkit.org/b/35222> / <rdar://problem/7673523>
+
+        Roll out r55039 (related to <http://webkit.org/b/35115>) as it causes animated GIFs
+        to skip intermediate frames when loading over a slower network.
+
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::startAnimation):
+
+2010-02-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Not reviewed, build fix.
+        
+        Revert the previous change.
+        
+2010-02-21  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Cache JavaScript wrappers inline in DOM nodes
+        https://bugs.webkit.org/show_bug.cgi?id=35226
+        <rdar://problem/7664202>
+
+        8.8% speedup on Dromaeo DOM Core tests.
+        3.3% speedup on Hixie DOM Core tests.
+        
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::forgetDOMNode): Clear wrapper pointer.
+        (WebCore::cacheDOMNodeWrapper): Cache inline too if caching for normal world.
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::DOMObjectWrapperMapFor): 
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::toJS): Remove unneeded argument from getCachedDOMNodeWrapper.
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::createWrapperInline): Renamed version of original createWrapper.
+        (WebCore::createWrapper): Call createWrapperInline. Out-of-line version.
+        (WebCore::toJSNewlyCreated): Call createWrapperInline instead of createWrapper.
+        * bindings/js/JSNodeCustom.h: Added.
+        (WebCore::getCachedDOMNodeWrapper): Moved here so it can be inlined.
+        (WebCore::toJS): Moved here so it can be inlined.
+        * bindings/js/ScriptWrappable.h:
+        (WebCore::ScriptWrappable::ScriptWrappable): Implement this in the obvious
+        way for JavaScriptCore.
+        (WebCore::ScriptWrappable::wrapper):
+        (WebCore::ScriptWrappable::setWrapper):
+        (WebCore::ScriptWrappable::clearWrapper):
+        * bindings/scripts/CodeGeneratorJS.pm: Include CustomHeader heaaders
+        in the header, not just the impl file, so they can add inlining.
+        * dom/Node.idl: Add CustomHeader directive.
+        
+        Add new files to build.
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+
+2010-02-22  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: windows build fix.
+
+2010-02-21  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: stop on inline breakpoints on reload.
+        - ScriptBreakpoint struct has been introduced and reused in InspectorController
+          and debug server.
+        - JavaScriptDebugServer was moved to bindings/js and renamed to ScriptDebugServer
+          There were no changes to semantics, only some mechanical changes:
+            - addBreakpoint and updateBreakpoint were merged into setBreakpoint
+            - ScriptDebugServer now operates ScriptBreakpoint instances instead of
+              BreakpointInfo.
+            - It no longer allocates maps and breakpoint info in heap - all done on stack.
+            - JavaScriptDebugListener is now ScriptDebugServer::Listener
+            - Listener methods no longer have ExecState (was unused).
+            - addListener/removeListener pair wuth no page argument removed (was unused).
+        - InspectorController now binds sourceID to url and maintains a map of 'sticky'
+          breakpoints. Whenever script is loaded and there is a sticky breakpoint url matching,
+          breakpoint is being 'restored' synchronously in debug server and pushed to frontend.
+          Front-end no longer stores map of sticky breakpoints.
+            - setBreakpoint/removeBreakpoint/didParseSource trio handle this logic.
+        - A bunch of if(USE_JSC/V8/other) forks removed.
+        - InspectorFrontend now operates primitive types only, got rid of USE_JSC as well.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28799
+
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.gypi:
+        * WebCore.order:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::JSInjectedScriptHost::currentCallFrame):
+        (WebCore::JSInjectedScriptHost::isActivation):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::shared):
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::~ScriptDebugServer):
+        (WebCore::ScriptDebugServer::addListener):
+        (WebCore::ScriptDebugServer::removeListener):
+        (WebCore::ScriptDebugServer::pageCreated):
+        (WebCore::ScriptDebugServer::hasListenersInterestedInPage):
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::hasBreakpoint):
+        (WebCore::ScriptDebugServer::clearBreakpoints):
+        (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::pauseProgram):
+        (WebCore::ScriptDebugServer::continueProgram):
+        (WebCore::ScriptDebugServer::stepIntoStatement):
+        (WebCore::ScriptDebugServer::stepOverStatement):
+        (WebCore::ScriptDebugServer::stepOutOfFunction):
+        (WebCore::ScriptDebugServer::currentCallFrame):
+        (WebCore::ScriptDebugServer::currentCallFrameState):
+        (WebCore::ScriptDebugServer::dispatchDidParseSource):
+        (WebCore::ScriptDebugServer::dispatchFailedToParseSource):
+        (WebCore::toPage):
+        (WebCore::ScriptDebugServer::detach):
+        (WebCore::ScriptDebugServer::sourceParsed):
+        (WebCore::ScriptDebugServer::dispatchFunctionToListeners):
+        (WebCore::ScriptDebugServer::setJavaScriptPaused):
+        (WebCore::ScriptDebugServer::pauseIfNeeded):
+        (WebCore::ScriptDebugServer::callEvent):
+        (WebCore::ScriptDebugServer::atStatement):
+        (WebCore::ScriptDebugServer::returnEvent):
+        (WebCore::ScriptDebugServer::exception):
+        (WebCore::ScriptDebugServer::willExecuteProgram):
+        (WebCore::ScriptDebugServer::didExecuteProgram):
+        (WebCore::ScriptDebugServer::didReachBreakpoint):
+        (WebCore::ScriptDebugServer::recompileAllJSFunctionsSoon):
+        (WebCore::ScriptDebugServer::recompileAllJSFunctions):
+        (WebCore::ScriptDebugServer::didAddListener):
+        (WebCore::ScriptDebugServer::didRemoveListener):
+        (WebCore::ScriptDebugServer::didRemoveLastListener):
+        * bindings/js/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::Listener::~Listener):
+        (WebCore::ScriptDebugServer::):
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::hasListeners):
+        (WebCore::ScriptDebugServer::hasGlobalListeners):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::shared):
+        * bindings/v8/ScriptDebugServer.h:
+        (WebCore::ScriptDebugServer::Listener::~Listener):
+        (WebCore::ScriptDebugServer::addListener):
+        (WebCore::ScriptDebugServer::removeListener):
+        (WebCore::ScriptDebugServer::setBreakpoint):
+        (WebCore::ScriptDebugServer::removeBreakpoint):
+        (WebCore::ScriptDebugServer::clearBreakpoints):
+        (WebCore::ScriptDebugServer::):
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::setPauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::pauseProgram):
+        (WebCore::ScriptDebugServer::continueProgram):
+        (WebCore::ScriptDebugServer::stepIntoStatement):
+        (WebCore::ScriptDebugServer::stepOverStatement):
+        (WebCore::ScriptDebugServer::stepOutOfFunction):
+        (WebCore::ScriptDebugServer::recompileAllJSFunctionsSoon):
+        (WebCore::ScriptDebugServer::recompileAllJSFunctions):
+        (WebCore::ScriptDebugServer::currentCallFrameState):
+        (WebCore::ScriptDebugServer::pageCreated):
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::~ScriptDebugServer):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::V8InjectedScriptHost::currentCallFrameCallback):
+        (WebCore::V8InjectedScriptHost::isActivationCallback):
+        * inspector/InjectedScriptHost.cpp:
+        * inspector/InjectedScriptHost.h:
+        * inspector/InjectedScriptHost.idl:
+        * inspector/InspectorBackend.cpp:
+        (WebCore::InspectorBackend::setBreakpoint):
+        (WebCore::InspectorBackend::removeBreakpoint):
+        (WebCore::InspectorBackend::pauseInDebugger):
+        (WebCore::InspectorBackend::stepOverStatementInDebugger):
+        (WebCore::InspectorBackend::stepIntoStatementInDebugger):
+        (WebCore::InspectorBackend::stepOutOfFunctionInDebugger):
+        (WebCore::InspectorBackend::pauseOnExceptionsState):
+        (WebCore::InspectorBackend::setPauseOnExceptionsState):
+        * inspector/InspectorBackend.h:
+        * inspector/InspectorBackend.idl:
+        * inspector/ScriptBreakpoint.h: Added.
+        (WebCore::InspectorBreakpoint::InspectorBreakpoint):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorController::scriptObjectReady):
+        (WebCore::InspectorController::close):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::addProfile):
+        (WebCore::InspectorController::startUserInitiatedProfiling):
+        (WebCore::InspectorController::stopUserInitiatedProfiling):
+        (WebCore::InspectorController::enableProfiler):
+        (WebCore::InspectorController::disableProfiler):
+        (WebCore::InspectorController::enableDebuggerFromFrontend):
+        (WebCore::InspectorController::disableDebugger):
+        (WebCore::InspectorController::resumeDebugger):
+        (WebCore::InspectorController::setBreakpoint):
+        (WebCore::InspectorController::removeBreakpoint):
+        (WebCore::InspectorController::didParseSource):
+        (WebCore::InspectorController::failedToParseSource):
+        (WebCore::InspectorController::didPause):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        (WebCore::InspectorFrontend::parsedScriptSource):
+        (WebCore::InspectorFrontend::restoredBreakpoint):
+        (WebCore::InspectorFrontend::failedToParseScriptSource):
+        (WebCore::InspectorFrontend::resumedScript):
+        * inspector/InspectorFrontend.h:
+        * inspector/JavaScriptDebugListener.h: Removed.
+        * inspector/JavaScriptDebugServer.cpp: Removed.
+        * inspector/JavaScriptDebugServer.h: Removed.
+        * inspector/front-end/Breakpoint.js:
+        (WebInspector.Breakpoint.prototype.set condition):
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
+        (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub.prototype.addBreakpoint):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.sourceFrameForResource):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.addScript):
+        (WebInspector.ScriptsPanel.prototype.addBreakpoint):
+        (WebInspector.ScriptsPanel.prototype.removeBreakpoint):
+        (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+        * inspector/front-end/inspector.js:
+        (WebInspector.restoredBreakpoint):
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        * platform/android/TemporaryLinkStubs.cpp:
+
+2010-02-21  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Make the UChar owned/ref-counted by StringImpl::CrossThreadRefCounted be const.
+
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::sharedBuffer):
+        * platform/text/StringImpl.h:
+
+2010-02-07  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Eric Seidel.
+
+        When page-break-{after,before} is set to always, force page breaks even for overflow-specified elements.
+        RenderBlock::inRootBlockContext() was introduced by Changeset 5611. Although it is a reasonable criteria for choosing an optional page break location, it is not for a mandatory page break as specified by http://dev.w3.org/csswg/css3-page/#forced-pg-brk. The method is removed because it is not used anywhere else.
+        Note: this patch makes page break work for overflow-specified elements. For tables and floated elements, more work is needed.
+        https://bugs.webkit.org/show_bug.cgi?id=9526
+
+        Test: printing/page-break-always-for-overflow.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintChildren):
+        * rendering/RenderBlock.h:
+
+2010-02-21  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove auto_ptr usage in WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=35157
+
+        The changes consists of:
+
+        - Changing auto_ptr arguments or return types to PassOwnPtr.
+
+        - Replacing local auto_ptr by OwnPtr.
+
+        - Removing now unneeded <memory> inclusion.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::addProperty):
+        * loader/WorkerThreadableLoader.cpp:
+        (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader):
+        (WebCore::workerContextDidReceiveResponse):
+        (WebCore::workerContextDidReceiveData):
+        (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
+        (WebCore::workerContextDidReceiveAuthenticationCancellation):
+        * loader/WorkerThreadableLoader.h:
+        * loader/icon/IconLoader.cpp:
+        (WebCore::IconLoader::create):
+        * loader/icon/IconLoader.h:
+        * platform/ContextMenu.cpp:
+        (WebCore::separatorItem):
+        * platform/CrossThreadCopier.h:
+        (WebCore::):
+        * platform/network/HTTPHeaderMap.cpp:
+        (WebCore::HTTPHeaderMap::copyData):
+        (WebCore::HTTPHeaderMap::adopt):
+        * platform/network/HTTPHeaderMap.h:
+        * platform/network/ResourceRequestBase.cpp:
+        (WebCore::ResourceRequestBase::adopt):
+        (WebCore::ResourceRequestBase::copyData):
+        * platform/network/ResourceRequestBase.h:
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::adopt):
+        (WebCore::ResourceResponseBase::copyData):
+        * platform/network/ResourceResponseBase.h:
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::removePendingResource):
+        * svg/SVGDocumentExtensions.h:
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::insertedIntoDocument):
+        * workers/GenericWorkerTask.h:
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThreadStartupData::create):
+
+2010-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22215
+        Avoid calling absoluteClippedOverflowRect() so many times
+
+        RenderLayer::updateLayerPositions() computes the clipped overflow rect
+        and the outline bounds for repaint, and then calls repaintAfterLayoutIfNeeded()
+        which can compute the same rects all over again. Avoid this by passing
+        these two rects into repaintAfterLayoutIfNeeded() if known. This measurably
+        reduces the time spent in updateLayerPositions() for some content.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+        * rendering/RenderObject.h:
+
+2010-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35202
+        <rdar://problem/4856597> Calling Java method which accepts Object always passes a null argument
+
+        * bridge/jni/jsc/JNIUtilityPrivate.cpp: (JSC::Bindings::convertValueToJValue): Add cases for
+        other JS types.
+
+2010-02-20  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Fix compiler warning "suggest parentheses around"
+        https://bugs.webkit.org/show_bug.cgi?id=35197
+
+        No new tests as there is no new functionality.
+
+        * html/DateComponents.cpp:
+        (WebCore::beforeGregorianStartDate):
+        * plugins/PluginDatabase.cpp:
+        (WebCore::PluginDatabase::findPlugin):
+
+2010-02-20  Noam Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] ENABLE_3D_RENDERING should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=35100
+
+        No new tests: this is a build fix.
+
+        * WebCore.pri: ENABLE_3D_RENDERING is now a proper feature test
+
+2010-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23742
+        Applet methods can not return arrays to JS
+
+        * bridge/jni/jsc/JNIBridgeJSC.cpp: (JavaArray::JavaArray): Don't accidentally zero out
+        m_rootObject (that's how PassRefPtr works). Without m_rootObject, we crash quickly.
+
+        * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaInstance::invokeMethod): Do handle returned arrays.
+        Also, added an ifdef around  code that's only needed on Tiger, and removed a comment saying
+        it can be removed when "new" plugin ships. I doubt that anyone can remember what "new"
+        could refer to back then.
+
+2010-02-20  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: re-creating view in ResourcesPanel confuses ScriptsPanel's visibleView logic.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35192
+
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.show):
+        (WebInspector.ScriptsPanel.prototype.viewRecreated):
+
+2010-02-20  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: need to highlight the evaluated expression used for popovers.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35126
+
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._mouseMove):
+        (WebInspector.SourceFrame.prototype._hidePopup):
+        (WebInspector.SourceFrame.prototype._mouseHover):
+        (WebInspector.SourceFrame.prototype._showPopup.showObjectPopup):
+        (WebInspector.SourceFrame.prototype._showPopup):
+        * inspector/front-end/inspector.css:
+
+2010-02-20  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Roll out 55047 because it causes layout, and API tests to fail
+
+2010-02-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [Soup] loses information related to message flags when converting from/to Resource{Request,Response}
+        https://bugs.webkit.org/show_bug.cgi?id=35093
+
+        Refactor updating of ResourceResponse objects from soup message
+        objects, to avoid code duplication.
+
+        No behaviour change.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::fillResponseFromMessage):
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponse::updateFromSoupMessage):
+
+2010-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35190
+        Don't use system malloc in Java bindings
+
+        * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaInstance::invokeMethod): Switched to WTF::Vector.
+
+2010-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=9761
+        LiveConnect string conversion fails for java.lang.Object
+
+        Can't test Java in DRT (I wonder why).
+
+        * bridge/jni/jsc/JNIUtilityPrivate.cpp: (JSC::Bindings::convertValueToJValue):
+        Added the necessary conversion. Also, removed CONVERT_NULL_TO_EMPTY_STRING dead code.
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        I made ENABLE(SANDBOX) only control the sandbox attribute itself;
+        I did not ifdef the infrastructure to make sandboxing
+        switchable. This is because the likely concerns about sandboxing
+        are not stability of the infrastructure code, but rather the fact
+        that the security model exposed to authors is still evolving.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * GNUmakefile.am:
+        * WebCore.pri:
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::parseMappedAttribute):
+
+2010-02-19  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35132
+        <rdar://problem/7664353> Mouse cursor sometimes flickers over Flash content (35132)
+
+        * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent): Don't set mouse
+        pointer when above a plug-in or applet to prevent flicker.
+
+2010-02-18  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Adam Barth.
+
+        Fix regression in calculating an animated image's start time.
+        https://bugs.webkit.org/show_bug.cgi?id=35115
+
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::startAnimation):
+
+2010-02-19  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35178
+        LiveConnect code uses hand-rolled fprintf logging
+
+        Changed to use LOG, LOG_ERROR and ASSERT.
+
+        * platform/Logging.cpp:
+        (WebCore::getChannelFromName):
+        * platform/Logging.h:
+        * platform/mac/LoggingMac.mm:
+        (WebCore::InitializeLoggingChannelsIfNecessary):
+        * platform/win/LoggingWin.cpp:
+        (WebCore::InitializeLoggingChannelsIfNecessary):
+        TextConversion channel was (almost) unused, renamed to LiveConnect.
+
+        * platform/text/gtk/TextCodecGtk.cpp: (WebCore::TextCodecGtk::registerEncodingNames):
+        The only use of this channel was in platform specific code, commandeered it for cross-platform
+        needs.
+
+        * bridge/jni/JNIBridge.cpp:
+        * bridge/jni/JNIUtility.cpp:
+        (JSC::Bindings::getJavaVM):
+        (JSC::Bindings::getJNIEnv):
+        (JSC::Bindings::getJNIField):
+        * bridge/jni/JNIUtility.h:
+        (JSC::Bindings::callJNIMethodV):
+        (JSC::Bindings::callJNIStaticMethod):
+        * bridge/jni/jni_jsobject.mm:
+        (completedJavaScriptAccess):
+        (dispatchToJavaScriptThread):
+        (performJavaScriptAccess):
+        (JavaJSObject::invoke):
+        (JavaJSObject::call):
+        (JavaJSObject::eval):
+        (JavaJSObject::getMember):
+        (JavaJSObject::setMember):
+        (JavaJSObject::removeMember):
+        (JavaJSObject::getSlot):
+        (JavaJSObject::setSlot):
+        (JavaJSObject::toString):
+        (JavaJSObject::createNative):
+        * bridge/jni/jsc/JNIBridgeJSC.cpp:
+        (JavaField::valueFromInstance):
+        (JavaField::setValueToInstance):
+        * bridge/jni/jsc/JavaClassJSC.cpp:
+        (JavaClass::JavaClass):
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaInstance::invokeMethod):
+        (JObjectWrapper::JObjectWrapper):
+        (JObjectWrapper::~JObjectWrapper):
+
 2010-02-19  Dirk Schulze  <krit@webkit.org>
 
         Reviewed by Nikolas Zimmermann.
@@ -167,23 +27270,6 @@
         (WebCore::HTMLOptionElement::insertedIntoTree):
         * html/HTMLOptionElement.h:
 
-2010-02-12  Brett Wilson  <brettw@chromium.org>
-
-        Reviewed by Adam Barth.
-
-        Update the Google-URL version of KURL and the V8 bindings to the new
-        behavior of KURL.IsStandard.
-
-        https://bugs.webkit.org/show_bug.cgi?id=34859
-
-        This is covered by fast/dom/Window/invalid-protocol.html
-
-        * bindings/v8/custom/V8LocationCustom.cpp:
-        (WebCore::V8Location::protocolAccessorSetter):
-        * platform/KURLGoogle.cpp:
-        (WebCore::KURL::setProtocol):
-        (WebCore::KURL::isHierarchical):
-
 2010-02-18  Simon Fraser  <simon.fraser@apple.com>
 
         No Review.
@@ -555,6 +27641,23 @@
         (WebCore::V8DOMWrapper::instantiateV8Object): Merge instantiateV8Object paths.
         * bindings/v8/V8DOMWrapper.h:
 
+2010-02-12  Brett Wilson  <brettw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Update the Google-URL version of KURL and the V8 bindings to the new
+        behavior of KURL.IsStandard.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34859
+
+        This is covered by fast/dom/Window/invalid-protocol.html
+
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::protocolAccessorSetter):
+        * platform/KURLGoogle.cpp:
+        (WebCore::KURL::setProtocol):
+        (WebCore::KURL::isHierarchical):
+
 2010-02-18  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Gustavo Noronha.
diff --git a/WebCore/Configurations/Base.xcconfig b/WebCore/Configurations/Base.xcconfig
index 441c9fa..aa68bdb 100644
--- a/WebCore/Configurations/Base.xcconfig
+++ b/WebCore/Configurations/Base.xcconfig
@@ -58,6 +58,8 @@
 REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
 REAL_PLATFORM_NAME_macosx = macosx;
 
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
+
 
 // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
 // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -80,7 +82,7 @@
 SECTORDER_FLAGS = -sectorder __TEXT __text WebCore.order;
 
 WEBCORE_SQLITE3_HEADER_SEARCH_PATHS = $(NEXT_ROOT)/usr/local/include/WebCoreSQLite3;
-SQLITE3_HEADER_SEARCH_PATHS = $(SQLITE3_HEADER_SEARCH_PATHS_$(MAC_OS_X_VERSION_MAJOR));
+SQLITE3_HEADER_SEARCH_PATHS = $(SQLITE3_HEADER_SEARCH_PATHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SQLITE3_HEADER_SEARCH_PATHS_ = $(SQLITE3_HEADER_SEARCH_PATHS_1040);
 SQLITE3_HEADER_SEARCH_PATHS_1040 = $(WEBCORE_SQLITE3_HEADER_SEARCH_PATHS);
 SQLITE3_HEADER_SEARCH_PATHS_1050 = $(WEBCORE_SQLITE3_HEADER_SEARCH_PATHS);
@@ -92,6 +94,26 @@
 // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
 // number.  Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
 // XCODE_VERSION_ACTUAL for the full version number.
-GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR));
-GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL));
-GCC_VERSION_0310 = 4.2;
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
diff --git a/WebCore/Configurations/DebugRelease.xcconfig b/WebCore/Configurations/DebugRelease.xcconfig
index 470414d..449358e 100644
--- a/WebCore/Configurations/DebugRelease.xcconfig
+++ b/WebCore/Configurations/DebugRelease.xcconfig
@@ -23,7 +23,7 @@
 
 #include "Base.xcconfig"
 
-ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ARCHS_ = $(ARCHS_1040);
 ARCHS_1040 = $(NATIVE_ARCH);
 ARCHS_1050 = $(NATIVE_ARCH);
@@ -32,7 +32,7 @@
 
 ONLY_ACTIVE_ARCH = YES;
 
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 MACOSX_DEPLOYMENT_TARGET_ = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 8343ce7..881c788 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -31,16 +31,17 @@
 
 // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
 
-ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS;
 
-ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1070 = ENABLE_3D_RENDERING;
 
+ENABLE_BLOB_SLICE = ENABLE_BLOB_SLICE;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
 ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
 ENABLE_DATABASE = ENABLE_DATABASE;
@@ -49,6 +50,8 @@
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -56,7 +59,9 @@
 ENABLE_MATHML = ;
 ENABLE_NOTIFICATIONS = ;
 ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
+ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG;
 ENABLE_RUBY = ENABLE_RUBY;
+ENABLE_SANDBOX = ENABLE_SANDBOX;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
@@ -73,4 +78,4 @@
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig
index 0e289b1..6aeb263 100644
--- a/WebCore/Configurations/Version.xcconfig
+++ b/WebCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 MAJOR_VERSION = 533;
-MINOR_VERSION = 1;
+MINOR_VERSION = 6;
 TINY_VERSION = 0;
 FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
 
@@ -31,7 +31,7 @@
 SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
 
 // The system version prefix is based on the current system version.
-SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
+SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR.
 SYSTEM_VERSION_PREFIX_1040 = 4;
 SYSTEM_VERSION_PREFIX_1050 = 5;
diff --git a/WebCore/Configurations/WebCore.xcconfig b/WebCore/Configurations/WebCore.xcconfig
index f122e35..c678bce 100644
--- a/WebCore/Configurations/WebCore.xcconfig
+++ b/WebCore/Configurations/WebCore.xcconfig
@@ -53,7 +53,7 @@
 EXCLUDED_SOURCE_FILE_NAMES_ = DOMSVG*.* DOMHTMLFrameElementPrivate.h DOMHTMLIFrameElementPrivate.h;
 EXCLUDED_SOURCE_FILE_NAMES_ENABLE_SVG_DOM_OBJC_BINDINGS = ;
 
-SQLITE3_LIBRARY = $(SQLITE3_LIBRARY_$(MAC_OS_X_VERSION_MAJOR));
+SQLITE3_LIBRARY = $(SQLITE3_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SQLITE3_LIBRARY_ = WebCoreSQLite3;
 SQLITE3_LIBRARY_1040 = WebCoreSQLite3;
 SQLITE3_LIBRARY_1050 = WebCoreSQLite3;
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 17d8ad9..72c5d47 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -62,6 +62,7 @@
 #include "JSCSSValueList.cpp"
 #include "JSCSSVariablesDeclaration.cpp"
 #include "JSCSSVariablesRule.cpp"
+#include "JSCustomEvent.cpp"
 #include "JSDatabase.cpp"
 #include "JSDataGridColumn.cpp"
 #include "JSDataGridColumnList.cpp"
@@ -71,6 +72,7 @@
 #include "JSDocumentType.cpp"
 #include "JSDOMApplicationCache.cpp"
 #include "JSDOMCoreException.cpp"
+#include "JSDOMFormData.cpp"
 #include "JSDOMImplementation.cpp"
 #include "JSDOMParser.cpp"
 #include "JSDOMSelection.cpp"
@@ -143,6 +145,7 @@
 #include "JSHTMLParagraphElement.cpp"
 #include "JSHTMLParamElement.cpp"
 #include "JSHTMLPreElement.cpp"
+#include "JSHTMLProgressElement.cpp"
 #include "JSHTMLQuoteElement.cpp"
 #include "JSHTMLScriptElement.cpp"
 #include "JSHTMLSelectElement.cpp"
@@ -194,6 +197,8 @@
 #include "JSRect.cpp"
 #include "JSRGBColor.cpp"
 #include "JSScreen.cpp"
+#include "JSScriptProfile.cpp"
+#include "JSScriptProfileNode.cpp"
 #include "JSSharedWorker.cpp"
 #include "JSSharedWorkerContext.cpp"
 #include "JSSQLError.cpp"
@@ -340,6 +345,9 @@
 #include "JSTextEvent.cpp"
 #include "JSTextMetrics.cpp"
 #include "JSTimeRanges.cpp"
+#include "JSTouch.cpp"
+#include "JSTouchEvent.cpp"
+#include "JSTouchList.cpp"
 #include "JSTreeWalker.cpp"
 #include "JSUIEvent.cpp"
 #include "JSValidityState.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index d5fd2c1..1aaa066 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -103,11 +103,13 @@
     Console \
     Coordinates \
     Counter \
+    CustomEvent \
     DataGridColumn \
     DataGridColumnList \
     DedicatedWorkerContext \
     DOMApplicationCache \
     DOMCoreException \
+    DOMFormData \
     DOMImplementation \
     DOMParser \
     DOMSelection \
@@ -185,6 +187,7 @@
     HTMLParagraphElement \
     HTMLParamElement \
     HTMLPreElement \
+    HTMLProgressElement \
     HTMLQuoteElement \
     HTMLScriptElement \
     HTMLSelectElement \
@@ -240,6 +243,8 @@
     Rect \
     SharedWorker \
     SharedWorkerContext \
+    ScriptProfile \
+    ScriptProfileNode \
     SQLError \
     SQLResultSet \
     SQLResultSetRowList \
@@ -398,6 +403,9 @@
     TextEvent \
     TextMetrics \
     TimeRanges \
+    Touch \
+    TouchEvent \
+    TouchList \
     TreeWalker \
     UIEvent \
     ValidityState \
@@ -620,6 +628,10 @@
     HTML_FLAGS := $(HTML_FLAGS) ENABLE_DATALIST=1
 endif
 
+ifeq ($(findstring ENABLE_PROGRESS_TAG,$(FEATURE_DEFINES)), ENABLE_PROGRESS_TAG)
+    HTML_FLAGS := $(HTML_FLAGS) ENABLE_PROGRESS_TAG=1
+endif
+
 ifeq ($(findstring ENABLE_VIDEO,$(FEATURE_DEFINES)), ENABLE_VIDEO)
     HTML_FLAGS := $(HTML_FLAGS) ENABLE_VIDEO=1
 endif
@@ -865,6 +877,10 @@
     WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.ClientBasedGeolocation.exp
 endif
 
+ifeq ($(findstring ENABLE_GEOLOCATION,$(FEATURE_DEFINES)), ENABLE_GEOLOCATION)
+    WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.Geolocation.exp
+endif
+
 WebCore.exp : WebCore.base.exp $(WEBCORE_EXPORT_DEPENDENCIES)
 	cat $^ > $@
 
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 65d9528..a59ba83 100644
--- a/WebCore/English.lproj/localizedStrings.js
+++ b/WebCore/English.lproj/localizedStrings.js
Binary files differ
diff --git a/WebCore/ForwardingHeaders/runtime/RopeImpl.h b/WebCore/ForwardingHeaders/runtime/RopeImpl.h
new file mode 100644
index 0000000..c1f323c
--- /dev/null
+++ b/WebCore/ForwardingHeaders/runtime/RopeImpl.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_RopeImpl_h
+#define WebCore_FWD_RopeImpl_h
+#include <JavaScriptCore/RopeImpl.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/StaticConstructors.h b/WebCore/ForwardingHeaders/wtf/StaticConstructors.h
new file mode 100644
index 0000000..c8ce157
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/StaticConstructors.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StaticConstructors_h
+#define WebCore_FWD_StaticConstructors_h
+#include <JavaScriptCore/StaticConstructors.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/WTFThreadData.h b/WebCore/ForwardingHeaders/wtf/WTFThreadData.h
new file mode 100644
index 0000000..a08417a
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/WTFThreadData.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_WTFThreadData_h
+#define WebCore_FWD_WTFThreadData_h
+#include <JavaScriptCore/WTFThreadData.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/AtomicString.h b/WebCore/ForwardingHeaders/wtf/text/AtomicString.h
new file mode 100644
index 0000000..83289d2
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/AtomicString.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_AtomicString_h
+#define WebCore_FWD_AtomicString_h
+#include <JavaScriptCore/AtomicString.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/AtomicStringImpl.h b/WebCore/ForwardingHeaders/wtf/text/AtomicStringImpl.h
new file mode 100644
index 0000000..87214a1
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/AtomicStringImpl.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_AtomicStringImpl_h
+#define WebCore_FWD_AtomicStringImpl_h
+#include <JavaScriptCore/AtomicStringImpl.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/CString.h b/WebCore/ForwardingHeaders/wtf/text/CString.h
new file mode 100644
index 0000000..a8c2ac9
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/CString.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_CString_h
+#define WebCore_FWD_CString_h
+#include <JavaScriptCore/CString.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/StringBuffer.h b/WebCore/ForwardingHeaders/wtf/text/StringBuffer.h
new file mode 100644
index 0000000..0b53240
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/StringBuffer.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StringBuffer_h
+#define WebCore_FWD_StringBuffer_h
+#include <JavaScriptCore/StringBuffer.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/StringHash.h b/WebCore/ForwardingHeaders/wtf/text/StringHash.h
new file mode 100644
index 0000000..f56c7b5
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/StringHash.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StringHash_h
+#define WebCore_FWD_StringHash_h
+#include <JavaScriptCore/StringHash.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/StringImpl.h b/WebCore/ForwardingHeaders/wtf/text/StringImpl.h
new file mode 100644
index 0000000..3e506d4
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/StringImpl.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StringImpl_h
+#define WebCore_FWD_StringImpl_h
+#include <JavaScriptCore/StringImpl.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h b/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h
new file mode 100644
index 0000000..c833bd5
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_StringImplBase_h
+#define WebCore_FWD_StringImplBase_h
+#include <JavaScriptCore/StringImplBase.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/text/WTFString.h b/WebCore/ForwardingHeaders/wtf/text/WTFString.h
new file mode 100644
index 0000000..4b9f31d
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/WTFString.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_WTFString_h
+#define WebCore_FWD_WTFString_h
+#include <JavaScriptCore/WTFString.h>
+#endif
diff --git a/WebCore/ForwardingHeaders/wtf/unicode/wince/UnicodeWince.h b/WebCore/ForwardingHeaders/wtf/unicode/wince/UnicodeWince.h
new file mode 100644
index 0000000..6d63d31
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/unicode/wince/UnicodeWince.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_UnicodeWince_h
+#define WebCore_FWD_UnicodeWince_h
+#include <JavaScriptCore/UnicodeWince.h>
+#endif
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 17fe33f..93b685e 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -9,9 +9,13 @@
 WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
 
 webcore_cppflags += \
+	-I$(srcdir)/WebKit/gtk \
+	-I$(srcdir)/WebKit/gtk/WebCoreSupport \
+	-I$(srcdir)/WebKit/gtk/webkit \
 	-I$(srcdir)/WebCore \
 	-I$(srcdir)/WebCore/accessibility \
 	-I$(srcdir)/WebCore/bindings/js \
+	-I$(srcdir)/WebCore/bindings/gobject \
 	-I$(srcdir)/WebCore/bridge \
 	-I$(srcdir)/WebCore/bridge/c \
 	-I$(srcdir)/WebCore/bridge/jni/jsc \
@@ -64,10 +68,12 @@
 
 webcoregtk_cppflags += \
 	-DWTF_USE_SOUP=1 \
+	-DWTF_USE_GSTREAMER=1 \
 	-I$(srcdir)/WebCore/accessibility/gtk \
 	-I$(srcdir)/WebCore/loader/gtk \
 	-I$(srcdir)/WebCore/page/gtk \
 	-I$(srcdir)/WebCore/platform/graphics/cairo \
+	-I$(srcdir)/WebCore/platform/graphics/gstreamer \
 	-I$(srcdir)/WebCore/platform/graphics/gtk \
 	-I$(srcdir)/WebCore/platform/gtk \
 	-I$(srcdir)/WebCore/platform/network/soup
@@ -75,7 +81,8 @@
 webcore_built_nosources += \
 	DerivedSources/DocTypeStrings.cpp \
 	DerivedSources/tokenizer.cpp \
-	DerivedSources/ColorData.c
+	DerivedSources/ColorData.c \
+	DerivedSources/webkit/webkitdomdummy.c
 
 webcore_built_sources += \
 	DerivedSources/CSSGrammar.cpp \
@@ -127,6 +134,7 @@
 	WebCore/dom/Clipboard.idl \
 	WebCore/dom/Comment.idl \
 	WebCore/dom/CompositionEvent.idl \
+	Webcore/dom/CustomEvent.idl \
 	WebCore/dom/DOMCoreException.idl \
 	WebCore/dom/DOMImplementation.idl \
 	WebCore/dom/Document.idl \
@@ -159,6 +167,9 @@
 	WebCore/dom/RangeException.idl \
 	WebCore/dom/Text.idl \
 	WebCore/dom/TextEvent.idl \
+	WebCore/dom/Touch.idl \
+	WebCore/dom/TouchEvent.idl \
+	WebCore/dom/TouchList.idl \
 	WebCore/dom/TreeWalker.idl \
 	WebCore/dom/UIEvent.idl \
 	WebCore/dom/WebKitAnimationEvent.idl \
@@ -181,6 +192,7 @@
 	WebCore/html/canvas/WebGLUnsignedShortArray.idl \
 	WebCore/html/DataGridColumn.idl \
 	WebCore/html/DataGridColumnList.idl \
+	WebCore/html/DOMFormData.idl \
 	WebCore/html/File.idl \
 	WebCore/html/FileList.idl \
 	WebCore/html/HTMLAllCollection.idl \
@@ -239,6 +251,7 @@
 	WebCore/html/HTMLParagraphElement.idl \
 	WebCore/html/HTMLParamElement.idl \
 	WebCore/html/HTMLPreElement.idl \
+	WebCore/html/HTMLProgressElement.idl \
 	WebCore/html/HTMLQuoteElement.idl \
 	WebCore/html/HTMLScriptElement.idl \
 	WebCore/html/HTMLSelectElement.idl \
@@ -262,6 +275,8 @@
 	WebCore/inspector/InjectedScriptHost.idl \
 	WebCore/inspector/InspectorBackend.idl \
 	WebCore/inspector/InspectorFrontendHost.idl \
+	WebCore/inspector/ScriptProfile.idl \
+	WebCore/inspector/ScriptProfileNode.idl \
 	WebCore/notifications/Notification.idl \
 	WebCore/notifications/NotificationCenter.idl \
 	WebCore/page/BarInfo.idl \
@@ -298,6 +313,16 @@
 	WebCore/xml/XMLSerializer.idl \
 	WebCore/xml/XSLTProcessor.idl
 
+webcoregtk_dom_sources = \
+	WebCore/bindings/gobject/ConvertToUTF8String.cpp \
+	WebCore/bindings/gobject/ConvertToUTF8String.h \
+	WebCore/bindings/gobject/WebKitDOMBinding.cpp \
+	WebCore/bindings/gobject/WebKitDOMBinding.h \
+	WebCore/bindings/gobject/WebKitDOMObject.cpp \
+	WebCore/bindings/gobject/WebKitDOMObject.h
+
+webcoregtk_sources += $(webcoregtk_dom_sources)
+
 webcore_sources += \
 	WebCore/WebCorePrefix.h \
         WebCore/accessibility/AXObjectCache.cpp \
@@ -326,6 +351,8 @@
 	WebCore/accessibility/AccessibilityMenuListOption.h \
 	WebCore/accessibility/AccessibilityObject.cpp \
 	WebCore/accessibility/AccessibilityObject.h \
+	WebCore/accessibility/AccessibilityProgressIndicator.cpp \
+	WebCore/accessibility/AccessibilityProgressIndicator.h \
 	WebCore/accessibility/AccessibilityRenderObject.cpp \
 	WebCore/accessibility/AccessibilityRenderObject.h \
 	WebCore/accessibility/AccessibilityScrollbar.cpp \
@@ -343,6 +370,10 @@
 	WebCore/accessibility/AccessibilityTableRow.cpp \
 	WebCore/accessibility/AccessibilityTableRow.h \
 	WebCore/bindings/js/CachedScriptSourceProvider.h \
+	WebCore/bindings/js/DOMObjectHashTableMap.cpp \
+	WebCore/bindings/js/DOMObjectHashTableMap.h \
+	WebCore/bindings/js/DOMWrapperWorld.cpp \
+	WebCore/bindings/js/DOMWrapperWorld.h \
 	WebCore/bindings/js/GCController.cpp \
 	WebCore/bindings/js/GCController.h \
 	WebCore/bindings/js/JSAttrCustom.cpp \
@@ -350,6 +381,8 @@
 	WebCore/bindings/js/JSDataGridColumnListCustom.cpp \
 	WebCore/bindings/js/JSDataGridDataSource.cpp \
 	WebCore/bindings/js/JSDataGridDataSource.h \
+	WebCore/bindings/js/JSDebugWrapperSet.cpp \
+	WebCore/bindings/js/JSDebugWrapperSet.h \
 	WebCore/bindings/js/JSCSSRuleCustom.cpp \
 	WebCore/bindings/js/JSCSSRuleListCustom.cpp \
 	WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \
@@ -372,6 +405,7 @@
 	WebCore/bindings/js/JSCustomXPathNSResolver.h \
 	WebCore/bindings/js/JSDOMBinding.cpp \
 	WebCore/bindings/js/JSDOMBinding.h \
+	WebCore/bindings/js/JSDOMFormDataCustom.cpp \
 	WebCore/bindings/js/JSDOMGlobalObject.cpp \
 	WebCore/bindings/js/JSDOMGlobalObject.h \
 	WebCore/bindings/js/JSDOMWindowBase.cpp \
@@ -380,6 +414,8 @@
 	WebCore/bindings/js/JSDOMWindowCustom.h \
 	WebCore/bindings/js/JSDOMWindowShell.cpp \
 	WebCore/bindings/js/JSDOMWindowShell.h \
+	WebCore/bindings/js/JSDOMWrapper.cpp \
+	WebCore/bindings/js/JSDOMWrapper.h \
 	WebCore/bindings/js/JSDocumentCustom.cpp \
 	WebCore/bindings/js/JSDocumentFragmentCustom.cpp \
 	WebCore/bindings/js/JSElementCustom.cpp \
@@ -437,6 +473,7 @@
 	WebCore/bindings/js/JSNamedNodeMapCustom.cpp \
 	WebCore/bindings/js/JSNavigatorCustom.cpp \
 	WebCore/bindings/js/JSNodeCustom.cpp \
+	WebCore/bindings/js/JSNodeCustom.h \
 	WebCore/bindings/js/JSNodeFilterCondition.cpp \
 	WebCore/bindings/js/JSNodeFilterCondition.h \
 	WebCore/bindings/js/JSNodeFilterCustom.cpp \
@@ -449,6 +486,7 @@
 	WebCore/bindings/js/JSPluginElementFunctions.cpp \
 	WebCore/bindings/js/JSPluginElementFunctions.h \
 	WebCore/bindings/js/JSPopStateEventCustom.cpp \
+	WebCore/bindings/js/JSScriptProfileNodeCustom.cpp \
 	WebCore/bindings/js/JSStorageCustom.h \
 	WebCore/bindings/js/JSStyleSheetCustom.cpp \
 	WebCore/bindings/js/JSStyleSheetListCustom.cpp \
@@ -458,6 +496,8 @@
 	WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h \
 	WebCore/bindings/js/JSWebKitPointConstructor.cpp \
 	WebCore/bindings/js/JSWebKitPointConstructor.h \
+	WebCore/bindings/js/JSWorkerContextErrorHandler.cpp \
+	WebCore/bindings/js/JSWorkerContextErrorHandler.h \
 	WebCore/bindings/js/JSXMLHttpRequestConstructor.cpp \
 	WebCore/bindings/js/JSXMLHttpRequestConstructor.h \
 	WebCore/bindings/js/JSXMLHttpRequestCustom.cpp \
@@ -465,10 +505,8 @@
 	WebCore/bindings/js/JSXSLTProcessorConstructor.cpp \
 	WebCore/bindings/js/JSXSLTProcessorConstructor.h \
 	WebCore/bindings/js/JSXSLTProcessorCustom.cpp \
-	WebCore/bindings/js/JavaScriptProfile.cpp \
-	WebCore/bindings/js/JavaScriptProfile.h \
-	WebCore/bindings/js/JavaScriptProfileNode.cpp \
-	WebCore/bindings/js/JavaScriptProfileNode.h \
+	WebCore/bindings/js/JavaScriptCallFrame.cpp \
+	WebCore/bindings/js/JavaScriptCallFrame.h \
 	WebCore/bindings/js/ScheduledAction.cpp \
 	WebCore/bindings/js/ScheduledAction.h \
 	WebCore/bindings/js/ScriptArray.cpp \
@@ -487,10 +525,12 @@
 	WebCore/bindings/js/ScriptEventListener.h \
 	WebCore/bindings/js/ScriptFunctionCall.cpp \
 	WebCore/bindings/js/ScriptFunctionCall.h \
+	WebCore/bindings/js/ScriptGCEvent.h \
 	WebCore/bindings/js/ScriptInstance.h \
 	WebCore/bindings/js/ScriptObject.cpp \
 	WebCore/bindings/js/ScriptObject.h \
 	WebCore/bindings/js/ScriptProfile.h \
+	WebCore/bindings/js/ScriptProfileNode.h \
 	WebCore/bindings/js/ScriptProfiler.cpp \
 	WebCore/bindings/js/ScriptProfiler.h \
 	WebCore/bindings/js/ScriptSourceCode.h \
@@ -504,12 +544,15 @@
 	WebCore/bindings/js/SerializedScriptValue.cpp \
 	WebCore/bindings/js/SerializedScriptValue.h \
 	WebCore/bindings/js/StringSourceProvider.h \
+	WebCore/bindings/js/WebCoreJSClientData.h \
 	WebCore/bindings/ScriptControllerBase.cpp \
 	WebCore/bridge/Bridge.h \
 	WebCore/bridge/IdentifierRep.cpp \
 	WebCore/bridge/IdentifierRep.h \
 	WebCore/bridge/NP_jsobject.cpp \
 	WebCore/bridge/NP_jsobject.h \
+	WebCore/bridge/c/CRuntimeObject.cpp \
+	WebCore/bridge/c/CRuntimeObject.h \
 	WebCore/bridge/c/c_class.cpp \
 	WebCore/bridge/c/c_class.h \
 	WebCore/bridge/c/c_instance.cpp \
@@ -686,6 +729,8 @@
 	WebCore/dom/CDATASection.h \
 	WebCore/dom/CSSMappedAttributeDeclaration.cpp \
 	WebCore/dom/CSSMappedAttributeDeclaration.h \
+	WebCore/dom/CanvasSurface.cpp \
+	WebCore/dom/CanvasSurface.h \
 	WebCore/dom/CharacterData.cpp \
 	WebCore/dom/CharacterData.h \
 	WebCore/dom/CheckedRadioButtons.cpp \
@@ -710,6 +755,8 @@
 	WebCore/dom/ContainerNode.cpp \
 	WebCore/dom/ContainerNode.h \
 	WebCore/dom/ContainerNodeAlgorithms.h \
+	WebCore/dom/CustomEvent.cpp \
+	WebCore/dom/CustomEvent.h \
 	WebCore/dom/DOMCoreException.h \
 	WebCore/dom/DOMImplementation.cpp \
 	WebCore/dom/DOMImplementation.h \
@@ -844,6 +891,10 @@
 	WebCore/dom/UIEvent.h \
 	WebCore/dom/UIEventWithKeyState.cpp \
 	WebCore/dom/UIEventWithKeyState.h \
+	WebCore/dom/UserGestureIndicator.cpp \
+	WebCore/dom/UserGestureIndicator.h \
+	WebCore/dom/ViewportArguments.cpp \
+	WebCore/dom/ViewportArguments.h \
 	WebCore/dom/WebKitAnimationEvent.cpp \
 	WebCore/dom/WebKitAnimationEvent.h \
 	WebCore/dom/WebKitTransitionEvent.cpp \
@@ -966,8 +1017,8 @@
 	WebCore/history/HistoryItem.h \
 	WebCore/history/PageCache.cpp \
 	WebCore/history/PageCache.h \
-        WebCore/html/Blob.cpp \
-        WebCore/html/Blob.h \
+	WebCore/html/Blob.cpp \
+	WebCore/html/Blob.h \
 	WebCore/html/canvas/CanvasContextAttributes.h \
 	WebCore/html/canvas/CanvasGradient.cpp \
 	WebCore/html/canvas/CanvasGradient.h \
@@ -993,10 +1044,20 @@
 	WebCore/html/DateComponents.h \
 	WebCore/html/DOMDataGridDataSource.cpp \
 	WebCore/html/DOMDataGridDataSource.h \
+	WebCore/html/DOMFormData.cpp \
+	WebCore/html/DOMFormData.h \
 	WebCore/html/File.cpp \
 	WebCore/html/File.h \
 	WebCore/html/FileList.cpp \
 	WebCore/html/FileList.h \
+	WebCore/html/FileStream.cpp \
+	WebCore/html/FileStream.h \
+	WebCore/html/FileStreamClient.h \
+	WebCore/html/FileStreamProxy.cpp \
+	WebCore/html/FileStreamProxy.h \
+	WebCore/html/FileThread.cpp \
+	WebCore/html/FileThread.h \
+	WebCore/html/FileThreadTask.h \
 	WebCore/html/FormDataList.cpp \
 	WebCore/html/FormDataList.h \
 	WebCore/html/HTMLAllCollection.cpp \
@@ -1128,6 +1189,8 @@
 	WebCore/html/HTMLPlugInImageElement.h \
 	WebCore/html/HTMLPreElement.cpp \
 	WebCore/html/HTMLPreElement.h \
+	WebCore/html/HTMLProgressElement.cpp \
+	WebCore/html/HTMLProgressElement.h \
 	WebCore/html/HTMLQuoteElement.cpp \
 	WebCore/html/HTMLQuoteElement.h \
 	WebCore/html/HTMLScriptElement.cpp \
@@ -1167,6 +1230,8 @@
 	WebCore/html/MediaError.h \
 	WebCore/html/PreloadScanner.cpp \
 	WebCore/html/PreloadScanner.h \
+	WebCore/html/StepRange.cpp \
+	WebCore/html/StepRange.h \
 	WebCore/html/TextMetrics.h \
 	WebCore/html/ValidityState.cpp \
 	WebCore/html/ValidityState.h \
@@ -1217,17 +1282,19 @@
 	WebCore/inspector/InspectorController.h \
 	WebCore/inspector/InspectorFrontend.cpp \
 	WebCore/inspector/InspectorFrontend.h \
+	WebCore/inspector/InspectorFrontendClient.h \
+	WebCore/inspector/InspectorFrontendClientLocal.cpp \
+	WebCore/inspector/InspectorFrontendClientLocal.h \
 	WebCore/inspector/InspectorFrontendHost.cpp \
 	WebCore/inspector/InspectorFrontendHost.h \
 	WebCore/inspector/InspectorResource.cpp \
 	WebCore/inspector/InspectorResource.h \
 	WebCore/inspector/InspectorTimelineAgent.cpp \
 	WebCore/inspector/InspectorTimelineAgent.h \
-	WebCore/inspector/JavaScriptCallFrame.cpp \
-	WebCore/inspector/JavaScriptCallFrame.h \
-	WebCore/inspector/JavaScriptDebugListener.h \
-	WebCore/inspector/JavaScriptDebugServer.cpp \
-	WebCore/inspector/JavaScriptDebugServer.h \
+	WebCore/inspector/InspectorWorkerResource.h \
+	WebCore/inspector/ScriptBreakpoint.h \
+	WebCore/inspector/ScriptDebugListener.h \
+	WebCore/inspector/ScriptGCEventListener.h \
 	WebCore/inspector/TimelineRecordFactory.cpp \
 	WebCore/inspector/TimelineRecordFactory.h \
 	WebCore/loader/Cache.cpp \
@@ -1261,6 +1328,8 @@
 	WebCore/loader/DocumentLoader.h \
 	WebCore/loader/DocumentThreadableLoader.cpp \
 	WebCore/loader/DocumentThreadableLoader.h \
+	WebCore/loader/DocumentWriter.cpp \
+	WebCore/loader/DocumentWriter.h \
 	WebCore/loader/EmptyClients.h \
 	WebCore/loader/FTPDirectoryDocument.cpp \
 	WebCore/loader/FTPDirectoryDocument.h \
@@ -1375,12 +1444,15 @@
 	WebCore/page/GeolocationControllerClient.h \
 	WebCore/page/GeolocationError.h \
 	WebCore/page/GeolocationPosition.h \
+	WebCore/page/GeolocationPositionCache.cpp \
+	WebCore/page/GeolocationPositionCache.h \
 	WebCore/page/Geoposition.h \
 	WebCore/page/HaltablePlugin.h \
 	WebCore/page/History.cpp \
 	WebCore/page/History.h \
 	WebCore/page/Location.cpp \
 	WebCore/page/Location.h \
+	WebCore/page/MediaCanStartListener.h \
 	WebCore/page/MouseEventWithHitTestResults.cpp \
 	WebCore/page/MouseEventWithHitTestResults.h \
 	WebCore/page/Navigator.cpp \
@@ -1411,6 +1483,8 @@
 	WebCore/page/SecurityOriginHash.h \
 	WebCore/page/Settings.cpp \
 	WebCore/page/Settings.h \
+	WebCore/page/SpatialNavigation.cpp \
+	WebCore/page/SpatialNavigation.h \
 	WebCore/page/UserContentURLPattern.cpp \
 	WebCore/page/UserContentURLPattern.h \
 	WebCore/page/UserScript.h \
@@ -1422,6 +1496,7 @@
 	WebCore/page/WindowFeatures.h \
 	WebCore/page/XSSAuditor.cpp \
 	WebCore/page/XSSAuditor.h \
+	WebCore/page/ZoomMode.h \
 	WebCore/page/animation/AnimationBase.cpp \
 	WebCore/page/animation/AnimationBase.h \
 	WebCore/page/animation/AnimationController.cpp \
@@ -1461,7 +1536,6 @@
 	WebCore/platform/GeolocationService.cpp \
 	WebCore/platform/GeolocationService.h \
 	WebCore/platform/HostWindow.h \
-	WebCore/platform/KeyboardCodes.h \
 	WebCore/platform/KURL.cpp \
 	WebCore/platform/KURL.h \
 	WebCore/platform/KURLHash.h \
@@ -1501,6 +1575,7 @@
 	WebCore/platform/ScrollbarThemeComposite.cpp \
 	WebCore/platform/ScrollbarThemeComposite.h \
 	WebCore/platform/SearchPopupMenu.h \
+	WebCore/platform/SecureTextInput.h \
 	WebCore/platform/SharedBuffer.cpp \
 	WebCore/platform/SharedBuffer.h \
 	WebCore/platform/SharedTimer.h \
@@ -1517,8 +1592,11 @@
 	WebCore/platform/Timer.cpp \
 	WebCore/platform/Timer.h \
 	WebCore/platform/TreeShared.h \
+	WebCore/platform/UUID.cpp \
+	WebCore/platform/UUID.h \
 	WebCore/platform/Widget.cpp \
 	WebCore/platform/Widget.h \
+	WebCore/platform/WindowsKeyboardCodes.h \
 	WebCore/platform/animation/Animation.cpp \
 	WebCore/platform/animation/Animation.h \
 	WebCore/platform/animation/AnimationList.cpp \
@@ -1563,8 +1641,8 @@
 	WebCore/platform/graphics/GlyphBuffer.h \
 	WebCore/platform/graphics/GlyphPageTreeNode.cpp \
 	WebCore/platform/graphics/GlyphPageTreeNode.h \
-	WebCore/platform/graphics/GlyphWidthMap.cpp \
-	WebCore/platform/graphics/GlyphWidthMap.h \
+	WebCore/platform/graphics/GlyphMetricsMap.cpp \
+	WebCore/platform/graphics/GlyphMetricsMap.h \
 	WebCore/platform/graphics/Gradient.cpp \
 	WebCore/platform/graphics/Gradient.h \
 	WebCore/platform/graphics/GraphicsContext.cpp \
@@ -1582,6 +1660,7 @@
 	WebCore/platform/graphics/ImageSource.cpp \
 	WebCore/platform/graphics/ImageSource.h \
 	WebCore/platform/graphics/IntPoint.h \
+	WebCore/platform/graphics/IntPointHash.h \
 	WebCore/platform/graphics/IntRect.cpp \
 	WebCore/platform/graphics/IntRect.h \
 	WebCore/platform/graphics/IntSize.h \
@@ -1635,7 +1714,6 @@
 	WebCore/platform/network/AuthenticationClient.h \
 	WebCore/platform/network/Credential.cpp \
 	WebCore/platform/network/Credential.h \
-	WebCore/platform/network/DNS.h \
 	WebCore/platform/network/FormData.cpp \
 	WebCore/platform/network/FormData.h \
 	WebCore/platform/network/FormDataBuilder.cpp \
@@ -1658,7 +1736,6 @@
 	WebCore/platform/network/ResourceRequestBase.h \
 	WebCore/platform/network/ResourceResponseBase.cpp \
 	WebCore/platform/network/ResourceResponseBase.h \
-	WebCore/platform/text/AtomicString.cpp \
 	WebCore/platform/text/AtomicString.h \
 	WebCore/platform/text/AtomicStringHash.h \
 	WebCore/platform/text/AtomicStringImpl.h \
@@ -1667,8 +1744,6 @@
 	WebCore/platform/text/BidiContext.cpp \
 	WebCore/platform/text/BidiContext.h \
 	WebCore/platform/text/BidiResolver.h \
-	WebCore/platform/text/CString.cpp \
-	WebCore/platform/text/CString.h \
 	WebCore/platform/text/CharacterNames.h \
 	WebCore/platform/text/ParserUtilities.h \
 	WebCore/platform/text/PlatformString.h \
@@ -1681,8 +1756,8 @@
 	WebCore/platform/text/StringBuilder.cpp \
 	WebCore/platform/text/StringBuilder.h \
 	WebCore/platform/text/StringHash.h \
-	WebCore/platform/text/StringImpl.cpp \
 	WebCore/platform/text/StringImpl.h \
+	WebCore/platform/text/SuffixTree.h \
 	WebCore/platform/text/TextBoundaries.h \
 	WebCore/platform/text/TextBoundaries.cpp \
 	WebCore/platform/text/TextBreakIterator.h \
@@ -1753,7 +1828,6 @@
 	WebCore/rendering/InlineFlowBox.cpp \
 	WebCore/rendering/InlineFlowBox.h \
 	WebCore/rendering/InlineIterator.h \
-	WebCore/rendering/InlineRunBox.h \
 	WebCore/rendering/InlineTextBox.cpp \
 	WebCore/rendering/InlineTextBox.h \
 	WebCore/rendering/LayoutState.cpp \
@@ -1789,10 +1863,14 @@
 	WebCore/rendering/RenderFlexibleBox.h \
 	WebCore/rendering/RenderFrame.cpp \
 	WebCore/rendering/RenderFrame.h \
+	WebCore/rendering/RenderFrameBase.cpp \
+	WebCore/rendering/RenderFrameBase.h \
 	WebCore/rendering/RenderFrameSet.cpp \
 	WebCore/rendering/RenderFrameSet.h \
 	WebCore/rendering/RenderHTMLCanvas.cpp \
 	WebCore/rendering/RenderHTMLCanvas.h \
+	WebCore/rendering/RenderIFrame.cpp \
+	WebCore/rendering/RenderIFrame.h \
 	WebCore/rendering/RenderImage.cpp \
 	WebCore/rendering/RenderImage.h \
 	WebCore/rendering/RenderImageGeneratedContent.cpp \
@@ -1821,8 +1899,8 @@
 	WebCore/rendering/RenderOverflow.h \
 	WebCore/rendering/RenderPart.cpp \
 	WebCore/rendering/RenderPart.h \
-	WebCore/rendering/RenderPartObject.cpp \
-	WebCore/rendering/RenderPartObject.h \
+	WebCore/rendering/RenderProgress.cpp \
+	WebCore/rendering/RenderProgress.h \
 	WebCore/rendering/RenderReplaced.cpp \
 	WebCore/rendering/RenderReplaced.h \
 	WebCore/rendering/RenderReplica.cpp \
@@ -1948,6 +2026,8 @@
 	WebCore/xml/XMLHttpRequest.h \
 	WebCore/xml/XMLHttpRequestException.h \
 	WebCore/xml/XMLHttpRequestProgressEvent.h \
+	WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp \
+	WebCore/xml/XMLHttpRequestProgressEventThrottle.h \
 	WebCore/xml/XMLHttpRequestUpload.cpp \
 	WebCore/xml/XMLHttpRequestUpload.h \
 	WebCore/xml/XMLSerializer.cpp \
@@ -1992,11 +2072,11 @@
 	WebCore/platform/graphics/cairo/PathCairo.cpp \
 	WebCore/platform/graphics/cairo/PatternCairo.cpp \
 	WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \
+	WebCore/platform/graphics/cairo/FontCacheCairo.cpp \
+	WebCore/platform/graphics/cairo/FontCustomPlatformData.h \
+	WebCore/platform/graphics/cairo/FontPlatformData.h \
 	WebCore/platform/graphics/gtk/ColorGtk.cpp \
-	WebCore/platform/graphics/gtk/FontCacheGtk.cpp \
-	WebCore/platform/graphics/gtk/FontCustomPlatformData.h \
 	WebCore/platform/graphics/gtk/FontGtk.cpp \
-	WebCore/platform/graphics/gtk/FontPlatformData.h \
 	WebCore/platform/graphics/gtk/IconGtk.cpp \
 	WebCore/platform/graphics/gtk/ImageGtk.cpp \
 	WebCore/platform/graphics/gtk/IntPointGtk.cpp \
@@ -2016,10 +2096,9 @@
 	WebCore/platform/gtk/FileSystemGtk.cpp \
 	WebCore/platform/gtk/GRefPtrGtk.cpp \
 	WebCore/platform/gtk/GRefPtrGtk.h \
-	WebCore/platform/gtk/GOwnPtrGtk.cpp \
-	WebCore/platform/gtk/GOwnPtrGtk.h \
 	WebCore/platform/gtk/GtkPluginWidget.cpp \
 	WebCore/platform/gtk/GtkPluginWidget.h \
+	WebCore/platform/gtk/GtkVersioning.h \
 	WebCore/platform/gtk/KURLGtk.cpp \
 	WebCore/platform/gtk/KeyEventGtk.cpp \
 	WebCore/platform/gtk/Language.cpp \
@@ -2028,6 +2107,7 @@
 	WebCore/platform/gtk/MIMETypeRegistryGtk.cpp \
 	WebCore/platform/gtk/MouseEventGtk.cpp \
 	WebCore/platform/gtk/PasteboardGtk.cpp \
+	WebCore/platform/gtk/PasteboardHelper.cpp \
 	WebCore/platform/gtk/PasteboardHelper.h \
 	WebCore/platform/gtk/PlatformScreenGtk.cpp \
 	WebCore/platform/gtk/PopupMenuGtk.cpp \
@@ -2067,13 +2147,14 @@
 	WebCore/platform/network/soup/AuthenticationChallenge.h \
 	WebCore/platform/network/soup/CookieJarSoup.cpp \
 	WebCore/platform/network/soup/CookieJarSoup.h \
-	WebCore/platform/network/soup/DNSSoup.cpp \
 	WebCore/platform/network/soup/ResourceError.h \
 	WebCore/platform/network/soup/ResourceHandleSoup.cpp \
 	WebCore/platform/network/soup/ResourceRequestSoup.cpp \
 	WebCore/platform/network/soup/ResourceResponseSoup.cpp \
 	WebCore/platform/network/soup/ResourceRequest.h \
 	WebCore/platform/network/soup/ResourceResponse.h \
+	WebCore/platform/network/soup/GOwnPtrSoup.h \
+	WebCore/platform/network/soup/GOwnPtrSoup.cpp \
 	WebCore/workers/SharedWorkerRepository.h
 
 # ----
@@ -2111,6 +2192,17 @@
 endif # END ENABLE_CHANNEL_MESSAGING
 
 # ---
+# Fast Mobile Scrolling
+# ---
+if ENABLE_FAST_MOBILE_SCROLLING
+FEATURE_DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
+
+webcore_cppflags += \
+	-DENABLE_FAST_MOBILE_SCROLLING=1
+
+endif # END ENABLE_FAST_MOBILE_SCROLLING
+
+# ---
 # Freetype font backend
 # ---
 if USE_FREETYPE
@@ -2118,10 +2210,10 @@
 	-DUSE_FREETYPE=1
 
 webcoregtk_sources += \
-	WebCore/platform/graphics/gtk/FontCustomPlatformData.cpp \
-	WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp \
-	WebCore/platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp \
-	WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
+	WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp \
+	WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp \
+	WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp \
+	WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
 endif # END USE_FREETYPE
 
 # ---
@@ -2147,6 +2239,14 @@
 	-DENABLE_DATAGRID=0
 
 # ----
+# HTML Progress Element - disable for now, since painting code is missing.
+# ----
+FEATURE_DEFINES += ENABLE_PROGRESS_TAG=0
+
+webcore_cppflags += \
+	-DENABLE_PROGRESS_TAG=0
+
+# ----
 # JavaScript Debugger/Profiler
 # ----
 if ENABLE_JAVASCRIPT_DEBUGGER
@@ -2217,6 +2317,8 @@
 	WebCore/bindings/js/JSCustomSQLTransactionCallback.h \
 	WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
 	WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h \
+	WebCore/bindings/js/JSDatabaseCallback.cpp \
+	WebCore/bindings/js/JSDatabaseCallback.h \
 	WebCore/bindings/js/JSDatabaseCustom.cpp \
 	WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
 	WebCore/bindings/js/JSSQLTransactionCustom.cpp \
@@ -2237,6 +2339,7 @@
 	WebCore/storage/Database.h \
 	WebCore/storage/DatabaseAuthorizer.cpp \
 	WebCore/storage/DatabaseAuthorizer.h \
+	WebCore/storage/DatabaseCallback.h \
 	WebCore/storage/DatabaseDetails.h \
 	WebCore/storage/DatabaseTask.cpp \
 	WebCore/storage/DatabaseTask.h \
@@ -2409,14 +2512,18 @@
 	WebCore/rendering/RenderVideo.h
 
 webcoregtk_sources += \
-	WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp \
-	WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h \
-	WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp \
-	WebCore/platform/graphics/gtk/VideoSinkGStreamer.h \
-	WebCore/platform/graphics/gtk/DataSourceGStreamer.cpp \
-	WebCore/platform/graphics/gtk/DataSourceGStreamer.h \
-	WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.cpp \
-	WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.h
+	WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \
+	WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \
+	WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp \
+	WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h \
+	WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp \
+	WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h \
+	WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp \
+	WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h \
+	WebCore/platform/graphics/gstreamer/ImageGStreamer.h \
+	WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp \
+	WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
+	WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
 
 webcore_libadd += \
 	-lgstinterfaces-0.10 \
@@ -2440,6 +2547,16 @@
 endif # END ENABLE_XHTMLMP
 
 # ----
+# Sandboxed IFrame Support
+# ----
+if ENABLE_SANDBOX
+
+HTML_FEATURES += ENABLE_SANDBOX=1
+webcore_cppflags += -DENABLE_SANDBOX=1
+
+endif # END ENABLE_SANDBOX
+
+# ----
 # Ruby Support
 # ----
 if ENABLE_RUBY
@@ -2602,7 +2719,7 @@
 webcore_cppflags += \
 	-DENABLE_SHARED_WORKERS=1
 
-webcore_built_sources += \
+webcore_sources += \
 	WebCore/bindings/js/JSSharedWorkerConstructor.cpp \
 	WebCore/bindings/js/JSSharedWorkerConstructor.h \
 	WebCore/bindings/js/JSSharedWorkerCustom.cpp \
@@ -2744,7 +2861,19 @@
 	WebCore/mathml/MathMLTextElement.cpp \
 	WebCore/mathml/MathMLTextElement.h \
 	WebCore/mathml/RenderMathMLBlock.cpp \
-	WebCore/mathml/RenderMathMLBlock.h
+	WebCore/mathml/RenderMathMLBlock.h \
+	WebCore/mathml/RenderMathMLFraction.cpp \
+	WebCore/mathml/RenderMathMLFraction.h \
+	WebCore/mathml/RenderMathMLMath.cpp \
+	WebCore/mathml/RenderMathMLMath.h \
+	WebCore/mathml/RenderMathMLOperator.cpp \
+	WebCore/mathml/RenderMathMLOperator.h \
+	WebCore/mathml/RenderMathMLRow.cpp \
+	WebCore/mathml/RenderMathMLRow.h \
+	WebCore/mathml/RenderMathMLSubSup.cpp \
+	WebCore/mathml/RenderMathMLSubSup.h \
+	WebCore/mathml/RenderMathMLUnderOver.cpp \
+	WebCore/mathml/RenderMathMLUnderOver.h
 
 webcore_built_sources += \
 	DerivedSources/MathMLElementFactory.cpp \
@@ -2757,8 +2886,8 @@
 
 DerivedSources/MathMLNames.h: DerivedSources/MathMLNames.cpp
 
-DerivedSources/MathMLElementFactory.cpp DerivedSources/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in
-	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --factory --wrapperFactory --outputDir "$(GENSOURCES)"
+DerivedSources/MathMLElementFactory.cpp DerivedSources/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in $(WebCore)/mathml/mathattrs.in
+	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES)"
 else 
 DerivedSources/MathMLElementFactory.cpp:
 	echo > $@
@@ -2991,6 +3120,12 @@
 	WebCore/rendering/RenderSVGModelObject.cpp \
 	WebCore/rendering/RenderSVGModelObject.h \
 	WebCore/rendering/RenderSVGResource.h \
+	WebCore/rendering/RenderSVGResourceClipper.cpp \
+	WebCore/rendering/RenderSVGResourceClipper.h \
+	WebCore/rendering/RenderSVGResourceFilter.cpp \
+	WebCore/rendering/RenderSVGResourceFilter.h \
+	WebCore/rendering/RenderSVGResourceMarker.cpp \
+	WebCore/rendering/RenderSVGResourceMarker.h \
 	WebCore/rendering/RenderSVGResourceMasker.cpp \
 	WebCore/rendering/RenderSVGResourceMasker.h \
 	WebCore/rendering/RenderSVGRoot.cpp \
@@ -3328,13 +3463,7 @@
 	WebCore/svg/graphics/SVGPaintServerSolid.h \
 	WebCore/svg/graphics/SVGResource.cpp \
 	WebCore/svg/graphics/SVGResource.h \
-	WebCore/svg/graphics/SVGResourceClipper.cpp \
-	WebCore/svg/graphics/SVGResourceClipper.h \
-	WebCore/svg/graphics/SVGResourceFilter.cpp \
-	WebCore/svg/graphics/SVGResourceFilter.h \
 	WebCore/svg/graphics/SVGResourceListener.h \
-	WebCore/svg/graphics/SVGResourceMarker.cpp \
-	WebCore/svg/graphics/SVGResourceMarker.h \
 	WebCore/svg/graphics/filters/SVGDistantLightSource.h \
 	WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp \
 	WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h \
@@ -3447,7 +3576,9 @@
 	WebCore/websockets/WebSocketChannel.h \
 	WebCore/websockets/WebSocketChannelClient.h \
 	WebCore/websockets/WebSocketHandshake.cpp \
-	WebCore/websockets/WebSocketHandshake.h
+	WebCore/websockets/WebSocketHandshake.h \
+	WebCore/websockets/WebSocketHandshakeRequest.cpp \
+	WebCore/websockets/WebSocketHandshakeRequest.h
 
 if ENABLE_WORKERS
 webcore_sources += \
@@ -3467,6 +3598,29 @@
 webcore_cppflags += -DENABLE_WEB_SOCKETS=0
 endif  # END ENABLE_WEB_SOCKETS
 
+# ---
+# Blob.slice support
+# ---
+if ENABLE_BLOB_SLICE
+FEATURE_DEFINES += ENABLE_BLOB_SLICE=1
+webcore_cppflags += -DENABLE_BLOB_SLICE=1
+endif  # END ENABLE_BLOB_SLICE
+
+# ---
+# FileReader support
+# ---
+if ENABLE_FILE_READER
+FEATURE_DEFINES += ENABLE_FILE_READER=1
+webcore_cppflags += -DENABLE_FILE_READER=1
+endif  # END ENABLE_FILE_READER
+
+# ---
+# FileWriter support
+# ---
+if ENABLE_FILE_WRITER
+FEATURE_DEFINES += ENABLE_FILE_WRITER=1
+webcore_cppflags += -DENABLE_FILE_WRITER=1
+endif  # END ENABLE_FILE_WRITER
 
 DerivedSources/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
 	if sort $(WEBCORE_CSS_PROPERTY_NAMES) | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
@@ -3624,6 +3778,82 @@
 	$(CXXLINK) $(libWebCoreJS_objects) $(LIBS)
 
 
+DerivedSources/webkit/webkitdomdummy.c:
+	echo > $@
+
+# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header
+# required by other distributed headers (both static and auto-generated), need to move this to the
+# DerivedSources/webkit directory.  The reason is that we want all header files distributed in the
+# include/webkit-x.y/webkit directory, but do not want to name the WebCore/bindings/gobject directory 
+# "webkit", as that's a bit presumptuous for a GTK binding.
+$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h:
+	cp -f $(WebCore)/bindings/gobject/WebKitDOMObject.h $@
+
+# Start with a subset of all the DOM bindings
+IDL_BINDINGS_GDOM := \
+	WebCore/css/CSSRule.idl \
+	WebCore/css/CSSRuleList.idl \
+	WebCore/css/CSSStyleDeclaration.idl \
+	WebCore/css/CSSStyleSheet.idl \
+	WebCore/css/CSSValue.idl \
+	WebCore/css/MediaList.idl \
+	WebCore/css/StyleSheet.idl \
+	WebCore/dom/Attr.idl \
+	WebCore/dom/Element.idl \
+	WebCore/dom/NamedNodeMap.idl \
+	WebCore/dom/Node.idl \
+	WebCore/dom/NodeList.idl
+
+# All classes autogenerated in the GObject DOM bindings
+GDOM_AUTO_CLASSES := $(basename $(notdir $(IDL_BINDINGS_GDOM)))
+
+# The classes implemented manually
+GDOM_FIXED_CLASSES := Object
+
+GDOM_CLASSES := $(GDOM_AUTO_CLASSES) $(GDOM_FIXED_CLASSES)
+
+# Filter out SVG for now
+FEATURE_DEFINES_GDOM := $(filter-out ENABLE-SVG%, $(FEATURE_DEFINES))
+
+# Autogenerated header files
+GDOM_HEADERS_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.h,$(GDOM_AUTO_CLASSES)) \
+	$(top_builddir)/DerivedSources/webkit/webkitdom.h \
+	$(top_builddir)/DerivedSources/webkit/webkitdomdefines.h \
+	$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h
+
+# Autogenerated source files
+GDOM_SOURCES_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.cpp,$(GDOM_AUTO_CLASSES))
+
+# Hand-coded header files
+GDOM_HEADERS_FIXED := $(patsubst %,$(srcdir)/WebCore/bindings/gobject/WebKitDOM%.h,$(GDOM_FIXED_CLASSES))
+
+# All header files that get installed
+libgdom_h_api := $(GDOM_HEADERS_FIXED) $(GDOM_HEADERS_BUILT)
+
+DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl
+	echo $(GDOM_CLASSES) | $(PERL) $< gdom > $@
+
+DerivedSources/webkit/webkitdomdefines.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(IDL_BINDINGS_GDOM) $(WebCore)/GNUmakefile.am
+	echo $(GDOM_CLASSES) | $(PERL) $< defines > $@
+
+DerivedSources/webkit/WebKitDOM%.h: DerivedSources/webkit/WebKitDOM%.cpp;
+
+DerivedSources/webkit/WebKitDOM%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm $(webcoregtk_dom_sources)
+	$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCESWEBKITDOM)" --defines "LANGUAGE_GOBJECT=1 $(FEATURE_DEFINES_GDOM)" --generator GObject $<
+
+gdom_built_nosources := $(GDOM_HEADERS_BUILT) $(GDOM_SOURCES_BUILT)
+
+libgdom_objects := $(subst .cpp,.lo,$(GDOM_SOURCES_BUILT))
+
+-include WebCore/bindings/gobject/$(DEPDIR)/%.Plo
+-include DerivedSources/webkit/$(DEPDIR)/%.Plo
+
+$(libgdom_objects): AM_CPPFLAGS+=$(libwebkit_1_0_la_CPPFLAGS)
+$(libgdom_objects): AM_CXXFLAGS+=$(libwebkit_1_0_la_CXXFLAGS)
+
+libgdom.la: $(libgdom_objects)
+	$(CXXLINK) $(libgdom_objects) $(LIBS)
+
 noinst_HEADERS += \
 	$(IDL_BINDINGS)
 
@@ -3639,6 +3869,7 @@
 	WebCore/bindings/scripts/InFilesParser.pm \
 	WebCore/bindings/scripts/generate-bindings.pl \
 	WebCore/bindings/scripts/CodeGeneratorJS.pm \
+	WebCore/bindings/scripts/CodeGeneratorGObject.pm \
 	WebCore/css/html.css \
 	WebCore/css/mathml.css \
 	WebCore/css/quirks.css \
@@ -3659,6 +3890,7 @@
 	WebCore/css/SVGCSSValueKeywords.in \
 	WebCore/css/makegrammar.pl \
 	WebCore/dom/make_names.pl \
+	WebCore/mathml/mathtags.in \
 	WebCore/platform/text/mac/make-charset-table.pl \
 	WebCore/platform/ColorData.gperf \
 	WebCore/svg/xlinkattrs.in \
@@ -3680,6 +3912,7 @@
 
 webinspectorimagesdir = ${datadir}/webkit-1.0/webinspector/Images
 dist_webinspectorimages_DATA = \
+	$(shell ls $(WebCore)/inspector/front-end/Images/*.gif) \
 	$(shell ls $(WebCore)/inspector/front-end/Images/*.png)
 
 webresourcesdir = ${datadir}/webkit-1.0/images
diff --git a/WebCore/WebCore.Geolocation.exp b/WebCore/WebCore.Geolocation.exp
new file mode 100644
index 0000000..296c8aa
--- /dev/null
+++ b/WebCore/WebCore.Geolocation.exp
@@ -0,0 +1,2 @@
+__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE
+__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE
diff --git a/WebCore/WebCore.Inspector.exp b/WebCore/WebCore.Inspector.exp
index 379b7a2..5cda893 100644
--- a/WebCore/WebCore.Inspector.exp
+++ b/WebCore/WebCore.Inspector.exp
@@ -1,11 +1,10 @@
 __ZN7WebCore19InspectorController10setSettingERKNS_6StringES3_
-__ZN7WebCore19InspectorController12attachWindowEv
-__ZN7WebCore19InspectorController12detachWindowEv
 __ZN7WebCore19InspectorController14enableDebuggerEv
 __ZN7WebCore19InspectorController14enableProfilerEbb
 __ZN7WebCore19InspectorController15disableDebuggerEb
 __ZN7WebCore19InspectorController15disableProfilerEb
-__ZN7WebCore19InspectorController16setWindowVisibleEbb
+__ZN7WebCore19InspectorController18disconnectFrontendEv
+__ZN7WebCore19InspectorController26setInspectorFrontendClientEN3WTF10PassOwnPtrINS_23InspectorFrontendClientEEE
 __ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
 __ZN7WebCore19InspectorController27startUserInitiatedProfilingEPNS_5TimerIS0_EE
 __ZN7WebCore19InspectorController4showEv
@@ -18,3 +17,14 @@
 __ZNK7WebCore19InspectorController7settingERKNS_6StringE
 __ZN7WebCore19InspectorController21startTimelineProfilerEv
 __ZN7WebCore19InspectorController20stopTimelineProfilerEv
+__ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageE
+__ZN7WebCore28InspectorFrontendClientLocalD2Ev
+__ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv
+__ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv
+__ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv
+__ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff
+__ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
+__ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
+__ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj
+__ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv
+__ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv
diff --git a/WebCore/WebCore.NPAPI.exp b/WebCore/WebCore.NPAPI.exp
index d487ade..781332e 100644
--- a/WebCore/WebCore.NPAPI.exp
+++ b/WebCore/WebCore.NPAPI.exp
@@ -21,8 +21,6 @@
 __NPN_UTF8FromIdentifier
 __ZN7WebCore16ScriptController20windowScriptNPObjectEv
 __ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
-__ZN7WebCore6String8fromUTF8EPKc
-__ZN7WebCoreplERKNS_6StringEPKc
 __ZNK7WebCore12RenderObject4viewEv
 __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
 __ZNK7WebCore4KURL7hasPathEv
diff --git a/WebCore/WebCore.PluginHostProcess.exp b/WebCore/WebCore.PluginHostProcess.exp
index 4b78966..d3c4178 100644
--- a/WebCore/WebCore.PluginHostProcess.exp
+++ b/WebCore/WebCore.PluginHostProcess.exp
@@ -1,15 +1,30 @@
 # This file gets appended to WebCore.exp when USE(PLUGIN_HOST_PROCESS) is 1.
 
-__ZN3JSC16RuntimeObjectImp6s_infoE
+__ZN3JSC13RuntimeMethod11getCallDataERNS_8CallDataE
+__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
+__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
+__ZN3JSC13RuntimeMethod6s_infoE
+__ZN3JSC13RuntimeMethodC1EPNS_9ExecStateERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
+__ZN3JSC13RuntimeMethodC2EPNS_9ExecStateERKNS_10IdentifierERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
 __ZN3JSC8Bindings10RootObjectD1Ev
+__ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE
+__ZN3JSC8Bindings13RuntimeObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
+__ZN3JSC8Bindings13RuntimeObject16getConstructDataERNS_13ConstructDataE
+__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
+__ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
+__ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
+__ZN3JSC8Bindings13RuntimeObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
+__ZN3JSC8Bindings13RuntimeObject6s_infoE
+__ZN3JSC8Bindings13RuntimeObjectC2EPNS_9ExecStateEN3WTF10PassRefPtrINS0_8InstanceEEE
+__ZN3JSC8Bindings13RuntimeObjectD2Ev
 __ZN3JSC8Bindings8Instance19createRuntimeObjectEPNS_9ExecStateE
 __ZN3JSC8Bindings8InstanceC2EN3WTF10PassRefPtrINS0_10RootObjectEEE
 __ZN3JSC8Bindings8InstanceD2Ev
-__ZN7WebCore13IdentifierRep3getEi
 __ZN7WebCore13IdentifierRep3getEPKc
+__ZN7WebCore13IdentifierRep3getEi
 __ZN7WebCore13IdentifierRep7isValidEPS0_
 __ZN7WebCore16ScriptController16createRootObjectEPv
-__ZN7WebCore16ScriptController17canExecuteScriptsEv
+__ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE
 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
-__ZN7WebCore6String26fromUTF8WithLatin1FallbackEPKcm
-__ZN7WebCore6String8fromUTF8EPKcm
+__ZNK3JSC8Bindings13RuntimeObject12defaultValueEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
+__ZTVN3JSC13RuntimeMethodE
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index 2afdd34..fed064d 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -1,4 +1,3 @@
-
 .objc_class_name_DOMAbstractView
 .objc_class_name_DOMAttr
 .objc_class_name_DOMCDATASection
@@ -136,13 +135,8 @@
 __Z4coreP8DOMRange
 __ZN3JSC8Bindings8Instance16newRuntimeObjectEPNS_9ExecStateE
 __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbN3WTF10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
-__ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_
 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
-__ZN7WebCore10StringImpl11reverseFindEPS0_ib
-__ZN7WebCore10StringImpl7replaceEtt
-__ZN7WebCore10StringImpl7ustringEv
-__ZN7WebCore10StringImpl8endsWithEPS0_b
-__ZN7WebCore10StringImplD1Ev
+__ZN7WebCore10StringImpl14createCFStringEv
 __ZN7WebCore10StringImplcvP8NSStringEv
 __ZN7WebCore10handCursorEv
 __ZN7WebCore10setCookiesEPNS_8DocumentERKNS_4KURLERKNS_6StringE
@@ -152,11 +146,11 @@
 __ZN7WebCore11EditCommand7reapplyEv
 __ZN7WebCore11EditCommand7unapplyEv
 __ZN7WebCore11FileChooser10chooseFileERKNS_6StringE
+__ZN7WebCore11FileChooser10iconLoadedEN3WTF10PassRefPtrINS_4IconEEE
 __ZN7WebCore11FileChooser11chooseFilesERKN3WTF6VectorINS_6StringELm0EEE
 __ZN7WebCore11FileChooserD1Ev
 __ZN7WebCore11FrameLoader11completeURLERKNS_6StringE
 __ZN7WebCore11FrameLoader11loadArchiveEN3WTF10PassRefPtrINS_7ArchiveEEE
-__ZN7WebCore11FrameLoader11setEncodingERKNS_6StringEb
 __ZN7WebCore11FrameLoader12shouldReloadERKNS_4KURLES3_
 __ZN7WebCore11FrameLoader14detachChildrenEv
 __ZN7WebCore11FrameLoader14stopAllLoadersENS_14DatabasePolicyE
@@ -174,6 +168,7 @@
 __ZN7WebCore11FrameLoader6reloadEb
 __ZN7WebCore11FrameLoader7addDataEPKci
 __ZN7WebCore11Geolocation12setIsAllowedEb
+__ZN7WebCore11GeolocationD1Ev
 __ZN7WebCore11HistoryItem10targetItemEv
 __ZN7WebCore11HistoryItem11setReferrerERKNS_6StringE
 __ZN7WebCore11HistoryItem12addChildItemEN3WTF10PassRefPtrIS0_EE
@@ -206,18 +201,20 @@
 __ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow
 __ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
-__ZN7WebCore12AtomicString3addEPKc
-__ZN7WebCore12AtomicString3addEPNS_10StringImplE
 __ZN7WebCore12ChromeClient20paintCustomScrollbarEPNS_15GraphicsContextERKNS_9FloatRectENS_20ScrollbarControlSizeEjNS_13ScrollbarPartEbffj
 __ZN7WebCore12ChromeClient23paintCustomScrollCornerEPNS_15GraphicsContextERKNS_9FloatRectE
 __ZN7WebCore12EventHandler10mouseMovedEP7NSEvent
+__ZN7WebCore12EventHandler10mouseMovedERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler10wheelEventEP7NSEvent
 __ZN7WebCore12EventHandler12mouseDraggedEP7NSEvent
 __ZN7WebCore12EventHandler14currentNSEventEv
 __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranularityE
 __ZN7WebCore12EventHandler15sendScrollEventEv
+__ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE
 __ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb
 __ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsE
+__ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
+__ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
 __ZN7WebCore12EventHandler7mouseUpEP7NSEvent
 __ZN7WebCore12EventHandler8keyEventEP7NSEvent
@@ -251,6 +248,9 @@
 __ZN7WebCore12PluginWidget14invalidateRectERKNS_7IntRectE
 __ZN7WebCore12PrintContext13numberOfPagesEPNS_5FrameERKNS_9FloatSizeE
 __ZN7WebCore12PrintContext20pageNumberForElementEPNS_7ElementERKNS_9FloatSizeE
+__ZN7WebCore12PrintContext28computePageRectsWithPageSizeERKNS_9FloatSizeEb
+__ZN7WebCore12PrintContextC1EPNS_5FrameE
+__ZN7WebCore12PrintContextD1Ev
 __ZN7WebCore12RenderObject16repaintRectangleERKNS_7IntRectEb
 __ZN7WebCore12RenderWidget19showSubstituteImageEN3WTF10PassRefPtrINS_5ImageEEE
 __ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
@@ -290,8 +290,10 @@
 __ZN7WebCore14DocumentLoader7requestEv
 __ZN7WebCore14DocumentLoader8setFrameEPNS_5FrameE
 __ZN7WebCore14DocumentLoader8setTitleERKNS_6StringE
+__ZN7WebCore14DocumentLoaderC1ERKNS_15ResourceRequestERKNS_14SubstituteDataE
 __ZN7WebCore14DocumentLoaderC2ERKNS_15ResourceRequestERKNS_14SubstituteDataE
 __ZN7WebCore14DocumentLoaderD2Ev
+__ZN7WebCore14DocumentWriter11setEncodingERKNS_6StringEb
 __ZN7WebCore14ResourceHandle12releaseProxyEv
 __ZN7WebCore14ResourceHandle20forceContentSniffingEv
 __ZN7WebCore14ResourceLoader14cancelledErrorEv
@@ -301,8 +303,10 @@
 __ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
 __ZN7WebCore14SecurityOrigin18shouldHideReferrerERKNS_4KURLERKNS_6StringE
 __ZN7WebCore14SecurityOrigin24registerURLSchemeAsLocalERKNS_6StringE
-__ZN7WebCore14SecurityOrigin25whiteListAccessFromOriginERKS0_RKNS_6StringES5_b
-__ZN7WebCore14SecurityOrigin27resetOriginAccessWhiteListsEv
+__ZN7WebCore14SecurityOrigin25registerURLSchemeAsSecureERKNS_6StringE
+__ZN7WebCore14SecurityOrigin27resetOriginAccessWhitelistsEv
+__ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
+__ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKNS_6StringES5_b
 __ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKNS_6StringE
 __ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
 __ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKNS_6StringEPNS_8DocumentE
@@ -330,6 +334,7 @@
 __ZN7WebCore15BackForwardList9goForwardEv
 __ZN7WebCore15BackForwardListC1EPNS_4PageE
 __ZN7WebCore15BackForwardListD1Ev
+__ZN7WebCore15DOMWrapperWorld15unregisterWorldEv
 __ZN7WebCore15DOMWrapperWorldD1Ev
 __ZN7WebCore15DatabaseTracker12deleteOriginEPNS_14SecurityOriginE
 __ZN7WebCore15DatabaseTracker14deleteDatabaseEPNS_14SecurityOriginERKNS_6StringE
@@ -349,6 +354,10 @@
 __ZN7WebCore15FocusController18focusedOrMainFrameEv
 __ZN7WebCore15FocusController9setActiveEb
 __ZN7WebCore15GraphicsContext12setFillColorERKNS_5ColorENS_10ColorSpaceE
+__ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
+__ZN7WebCore15GraphicsContext4saveEv
+__ZN7WebCore15GraphicsContext7restoreEv
+__ZN7WebCore15GraphicsContext9translateEff
 __ZN7WebCore15GraphicsContextC1EP9CGContext
 __ZN7WebCore15GraphicsContextD1Ev
 __ZN7WebCore15JSDOMWindowBase18commonJSGlobalDataEv
@@ -397,7 +406,6 @@
 __ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
 __ZN7WebCore17HTMLPlugInElement11getNPObjectEv
 __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
-__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplES1_
 __ZN7WebCore18deprecatedParseURLERKNS_6StringE
 __ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
 __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
@@ -405,8 +413,9 @@
 __ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
 __ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd
 __ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
+__ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv
 __ZN7WebCore19SelectionController10setFocusedEb
-__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbb
+__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbbNS_15TextGranularityE
 __ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
 __ZN7WebCore19SelectionController5clearEv
 __ZN7WebCore19SelectionController6modifyENS0_11EAlterationENS0_10EDirectionENS_15TextGranularityEb
@@ -417,23 +426,21 @@
 __ZN7WebCore19TextResourceDecoderC1ERKNS_6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
 __ZN7WebCore19applicationIsSafariEv
+__ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
 __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
 __ZN7WebCore20ResourceResponseBaseC2Ev
-__ZN7WebCore21JavaScriptDebugServer23recompileAllJSFunctionsEPNS_5TimerIS0_EE
-__ZN7WebCore21JavaScriptDebugServer6sharedEv
 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
 __ZN7WebCore21SVGDocumentExtensions21sampleAnimationAtTimeERKNS_6StringEPNS_14SVGSMILElementEd
 __ZN7WebCore21SerializedScriptValue11deserializeEPK15OpaqueJSContextPPK13OpaqueJSValue
 __ZN7WebCore21SerializedScriptValue6createEPK15OpaqueJSContextPK13OpaqueJSValuePS6_
 __ZN7WebCore21SerializedScriptValueD1Ev
+__ZN7WebCore21UserContentURLPattern5parseERKNS_6StringE
 __ZN7WebCore21WindowsLatin1EncodingEv
 __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
 __ZN7WebCore21mainThreadNormalWorldEv
 __ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
-__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE
-__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE
 __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
 __ZN7WebCore22applicationIsAppleMailEv
 __ZN7WebCore22counterValueForElementEPNS_7ElementE
@@ -463,6 +470,7 @@
 __ZN7WebCore26CSSMutableStyleDeclarationC1Ev
 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE
 __ZN7WebCore26usesTestModeFocusRingColorEv
+__ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS_6StringE
 __ZN7WebCore27applicationIsAdobeInstallerEv
 __ZN7WebCore29isCharacterSmartReplaceExemptEib
 __ZN7WebCore29setUsesTestModeFocusRingColorEb
@@ -481,9 +489,13 @@
 __ZN7WebCore4FontC1Ev
 __ZN7WebCore4FontD1Ev
 __ZN7WebCore4FontaSERKS0_
+__ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS_6StringELm0EEE
+__ZN7WebCore4IconD1Ev
 __ZN7WebCore4KURL10invalidateEv
 __ZN7WebCore4KURLC1ENS_18ParsedURLStringTagERKNS_6StringE
 __ZN7WebCore4KURLC1EP5NSURL
+__ZN7WebCore4KURLC1EPK7__CFURL
+__ZN7WebCore4KURLC1ERKS0_RKNS_6StringE
 __ZN7WebCore4Node17stopIgnoringLeaksEv
 __ZN7WebCore4Node18startIgnoringLeaksEv
 __ZN7WebCore4Node19setNeedsStyleRecalcENS_15StyleChangeTypeE
@@ -511,13 +523,15 @@
 __ZN7WebCore4PageC1EPNS_12ChromeClientEPNS_17ContextMenuClientEPNS_12EditorClientEPNS_10DragClientEPNS_15InspectorClientEPNS_18PluginHalterClientEPNS_27GeolocationControllerClientE
 __ZN7WebCore4PageD1Ev
 __ZN7WebCore4coreEP20NSURLProtectionSpace
+__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
 __ZN7WebCore5Cache11setDisabledEb
 __ZN7WebCore5Cache13getStatisticsEv
 __ZN7WebCore5Cache13setCapacitiesEjjj
+__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b
 __ZN7WebCore5Frame10findStringERKNS_6StringEbbbb
 __ZN7WebCore5Frame11shouldCloseEv
 __ZN7WebCore5Frame13reapplyStylesEv
-__ZN7WebCore5Frame13setZoomFactorEfb
+__ZN7WebCore5Frame13setZoomFactorEfNS_8ZoomModeE
 __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE
 __ZN7WebCore5Frame15revealSelectionERKNS_15ScrollAlignmentEb
 __ZN7WebCore5Frame17setIsDisconnectedEb
@@ -542,8 +556,6 @@
 __ZN7WebCore5Range8setStartEN3WTF10PassRefPtrINS_4NodeEEEiRi
 __ZN7WebCore5RangeD1Ev
 __ZN7WebCore5cacheEv
-__ZN7WebCore5equalEPNS_10StringImplEPKc
-__ZN7WebCore5equalEPNS_10StringImplES1_
 __ZN7WebCore6Editor10applyStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
 __ZN7WebCore6Editor10insertTextERKNS_6StringEPNS_5EventE
 __ZN7WebCore6Editor13canDHTMLPasteEv
@@ -583,16 +595,8 @@
 __ZN7WebCore6Editor7copyURLERKNS_4KURLERKNS_6StringE
 __ZN7WebCore6Editor7outdentEv
 __ZN7WebCore6Loader20servePendingRequestsENS0_8PriorityE
-__ZN7WebCore6String6appendERKS0_
-__ZN7WebCore6String6appendEc
-__ZN7WebCore6String6numberEi
-__ZN7WebCore6String6numberEl
-__ZN7WebCore6String8fromUTF8EPKcm
 __ZN7WebCore6StringC1EP8NSString
 __ZN7WebCore6StringC1EPK10__CFString
-__ZN7WebCore6StringC1EPKc
-__ZN7WebCore6StringC1EPKcj
-__ZN7WebCore6StringC1ERKN3JSC7UStringE
 __ZN7WebCore6Widget12setFrameRectERKNS_7IntRectE
 __ZN7WebCore6Widget16removeFromParentEv
 __ZN7WebCore6Widget20retainPlatformWidgetEv
@@ -605,13 +609,14 @@
 __ZN7WebCore6WidgetC1EP6NSView
 __ZN7WebCore6WidgetC2EP6NSView
 __ZN7WebCore6WidgetD2Ev
-__ZN7WebCore7CStringC1EPKc
 __ZN7WebCore7Console21shouldPrintExceptionsEv
 __ZN7WebCore7Console24setShouldPrintExceptionsEb
+__ZN7WebCore7IntRect5uniteERKS0_
 __ZN7WebCore7IntRectC1ERKNS_9FloatRectE
 __ZN7WebCore7IntSizeC1ERK7_NSSize
 __ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE
 __ZN7WebCore7nsColorERKNS_5ColorE
+__ZN7WebCore8Database14setIsAvailableEb
 __ZN7WebCore8Document11createRangeEv
 __ZN7WebCore8Document13removeMarkersENS_14DocumentMarker10MarkerTypeE
 __ZN7WebCore8Document13svgExtensionsEv
@@ -626,17 +631,16 @@
 __ZN7WebCore8FormDataD1Ev
 __ZN7WebCore8IntPointC1ERK8_NSPoint
 __ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
+__ZN7WebCore8Settings11setZoomModeENS_8ZoomModeE
 __ZN7WebCore8Settings14setJavaEnabledEb
 __ZN7WebCore8Settings15setWebGLEnabledEb
 __ZN7WebCore8Settings16setUsesPageCacheEb
-__ZN7WebCore8Settings16setZoomsTextOnlyEb
 __ZN7WebCore8Settings17setPluginsEnabledEb
 __ZN7WebCore8Settings18setDOMPasteAllowedEb
 __ZN7WebCore8Settings18setDefaultFontSizeEi
 __ZN7WebCore8Settings18setFixedFontFamilyERKNS_12AtomicStringE
 __ZN7WebCore8Settings18setMinimumFontSizeEi
 __ZN7WebCore8Settings18setSerifFontFamilyERKNS_12AtomicStringE
-__ZN7WebCore8Settings19setDatabasesEnabledEb
 __ZN7WebCore8Settings19setShowDebugBordersEb
 __ZN7WebCore8Settings20setCursiveFontFamilyERKNS_12AtomicStringE
 __ZN7WebCore8Settings20setFantasyFontFamilyERKNS_12AtomicStringE
@@ -647,6 +651,7 @@
 __ZN7WebCore8Settings21setWebSecurityEnabledEb
 __ZN7WebCore8Settings22setLocalStorageEnabledEb
 __ZN7WebCore8Settings22setSansSerifFontFamilyERKNS_12AtomicStringE
+__ZN7WebCore8Settings22setSessionStorageQuotaEj
 __ZN7WebCore8Settings22setShowsURLsInToolTipsEb
 __ZN7WebCore8Settings23setDefaultFixedFontSizeEi
 __ZN7WebCore8Settings23setEditableLinkBehaviorENS_20EditableLinkBehaviorE
@@ -657,6 +662,7 @@
 __ZN7WebCore8Settings24setApplicationChromeModeEb
 __ZN7WebCore8Settings24setTextAreasAreResizableEb
 __ZN7WebCore8Settings25setDeveloperExtrasEnabledEb
+__ZN7WebCore8Settings25setFrameFlatteningEnabledEb
 __ZN7WebCore8Settings25setMinimumLogicalFontSizeEi
 __ZN7WebCore8Settings25setNeedsLeopardMailQuirksEb
 __ZN7WebCore8Settings25setPrivateBrowsingEnabledEb
@@ -668,7 +674,6 @@
 __ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
 __ZN7WebCore8Settings27setLocalStorageDatabasePathERKNS_6StringE
 __ZN7WebCore8Settings28setForceFTPDirectoryListingsEb
-__ZN7WebCore8Settings28setFrameSetFlatteningEnabledEb
 __ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
 __ZN7WebCore8Settings29setWebArchiveDebugModeEnabledEb
 __ZN7WebCore8Settings30setAllowFileAccessFromFileURLsEb
@@ -690,6 +695,7 @@
 __ZN7WebCore9DOMWindow30dispatchAllPendingUnloadEventsEv
 __ZN7WebCore9DOMWindow36dispatchAllPendingBeforeUnloadEventsEv
 __ZN7WebCore9FloatRectC1ERK7_NSRect
+__ZN7WebCore9FloatRectC1ERKNS_7IntRectE
 __ZN7WebCore9FontCache13fontDataCountEv
 __ZN7WebCore9FontCache21inactiveFontDataCountEv
 __ZN7WebCore9FontCache21purgeInactiveFontDataEi
@@ -704,6 +710,7 @@
 __ZN7WebCore9FrameView14setTransparentEb
 __ZN7WebCore9FrameView15setMarginHeightEi
 __ZN7WebCore9FrameView16adjustPageHeightEPffff
+__ZN7WebCore9FrameView16setPaintBehaviorEj
 __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView21flushDeferredRepaintsEv
 __ZN7WebCore9FrameView21scrollPositionChangedEv
@@ -713,9 +720,6 @@
 __ZN7WebCore9FrameView29forceLayoutWithPageWidthRangeEffb
 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
 __ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
-__ZNK7WebCore9FrameView20isSoftwareRenderableEv
-__ZN7WebCore9FrameView16setPaintBehaviorEj
-__ZNK7WebCore9FrameView13paintBehaviorEv
 __ZN7WebCore9FrameView6createEPNS_5FrameE
 __ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
 __ZN7WebCore9HTMLNames10listingTagE
@@ -752,6 +756,7 @@
 __ZN7WebCore9HTMLNames8videoTagE
 __ZN7WebCore9HTMLNames9iframeTagE
 __ZN7WebCore9HTMLNames9scriptTagE
+__ZN7WebCore9JSElement6s_infoE
 __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache27releaseAutoreleasedPagesNowEv
 __ZN7WebCore9PageGroup14addVisitedLinkEPKtm
@@ -774,10 +779,7 @@
 __ZN7WebCore9fontCacheEv
 __ZN7WebCore9makeRangeERKNS_15VisiblePositionES2_
 __ZN7WebCore9pageCacheEv
-__ZN7WebCoreeqERKNS_12AtomicStringEPKc
 __ZN7WebCoreeqERKNS_19ResourceRequestBaseES2_
-__ZN7WebCoreplEPKcRKNS_6StringE
-__ZN7WebCoreplERKNS_6StringES2_
 __ZNK3JSC8Bindings10RootObject12globalObjectEv
 __ZNK7WebCore10FloatPointcv8_NSPointEv
 __ZNK7WebCore10PluginData16supportsMimeTypeERKNS_6StringE
@@ -793,7 +795,6 @@
 __ZNK7WebCore11FrameLoader15containsPluginsEv
 __ZNK7WebCore11FrameLoader15firstLayoutDoneEv
 __ZNK7WebCore11FrameLoader16outgoingReferrerEv
-__ZNK7WebCore11FrameLoader16responseMIMETypeEv
 __ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
 __ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
 __ZNK7WebCore11FrameLoader8loadTypeEv
@@ -821,6 +822,7 @@
 __ZNK7WebCore12IconDatabase9isEnabledEv
 __ZNK7WebCore12RenderObject14enclosingLayerEv
 __ZNK7WebCore12RenderObject15localToAbsoluteENS_10FloatPointEbb
+__ZNK7WebCore12RenderWidget14windowClipRectEv
 __ZNK7WebCore12SharedBuffer4dataEv
 __ZNK7WebCore12SharedBuffer4sizeEv
 __ZNK7WebCore12TextEncoding6decodeEPKcmbRb
@@ -889,9 +891,10 @@
 __ZNK7WebCore20ResourceResponseBase3urlEv
 __ZNK7WebCore20ResourceResponseBase8mimeTypeEv
 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
-__ZNK7WebCore4Font10floatWidthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEE
+__ZNK7WebCore4Font10floatWidthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE
 __ZNK7WebCore4Font11primaryFontEv
 __ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEii
+__ZNK7WebCore4KURL11createCFURLEv
 __ZNK7WebCore4KURL11isLocalFileEv
 __ZNK7WebCore4KURL17lastPathComponentEv
 __ZNK7WebCore4KURL4hostEv
@@ -911,6 +914,7 @@
 __ZNK7WebCore5Frame13ownerRendererEv
 __ZNK7WebCore5Frame14selectionImageEb
 __ZNK7WebCore5Frame15contentRendererEv
+__ZNK7WebCore5Frame15layerTreeAsTextEv
 __ZNK7WebCore5Frame15selectionBoundsEb
 __ZNK7WebCore5Frame16inViewSourceModeEv
 __ZNK7WebCore5Frame17firstRectForRangeEPNS_5RangeE
@@ -941,6 +945,7 @@
 __ZNK7WebCore5Range19boundaryPointsValidEv
 __ZNK7WebCore5Range9endOffsetERi
 __ZNK7WebCore5Range9firstNodeEv
+__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesE
 __ZNK7WebCore6Editor13canEditRichlyEv
 __ZNK7WebCore6Editor16compositionRangeEv
 __ZNK7WebCore6Editor16fontForSelectionERb
@@ -959,20 +964,12 @@
 __ZNK7WebCore6Editor7canEditEv
 __ZNK7WebCore6Editor8canPasteEv
 __ZNK7WebCore6Editor9canDeleteEv
-__ZNK7WebCore6String10charactersEv
 __ZNK7WebCore6String14createCFStringEv
-__ZNK7WebCore6String4utf8Ev
-__ZNK7WebCore6String6lengthEv
-__ZNK7WebCore6String7isEmptyEv
-__ZNK7WebCore6String9substringEjj
-__ZNK7WebCore6StringcvN3JSC7UStringEEv
 __ZNK7WebCore6Widget23convertToContainingViewERKNS_7IntRectE
 __ZNK7WebCore6Widget23convertToContainingViewERKNS_8IntPointE
 __ZNK7WebCore6Widget25convertFromContainingViewERKNS_7IntRectE
 __ZNK7WebCore6Widget25convertFromContainingViewERKNS_8IntPointE
 __ZNK7WebCore6Widget9frameRectEv
-__ZNK7WebCore7CString4dataEv
-__ZNK7WebCore7CString6lengthEv
 __ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE
 __ZNK7WebCore7IntRectcv7_NSRectEv
 __ZNK7WebCore7IntSizecv7_NSSizeEv
@@ -997,6 +994,8 @@
 __ZNK7WebCore9FrameTree5childERKNS_12AtomicStringE
 __ZNK7WebCore9FrameTree6parentEb
 __ZNK7WebCore9FrameView11needsLayoutEv
+__ZNK7WebCore9FrameView13paintBehaviorEv
+__ZNK7WebCore9FrameView20isSoftwareRenderableEv
 __ZNK7WebCore9PageCache10frameCountEv
 __ZNK7WebCore9PageCache21autoreleasedPageCountEv
 __ZTVN7WebCore12ChromeClientE
@@ -1013,6 +1012,7 @@
 _wkAdvanceDefaultButtonPulseAnimation
 _wkCGContextGetShouldSmoothFonts
 _wkCopyCONNECTProxyResponse
+_wkCopyNSURLResponseStatusLine
 _wkCreateCustomCFReadStream
 _wkCreateNSURLConnectionDelegateProxy
 _wkCreateURLNPasteboardFlavorTypeName
@@ -1050,6 +1050,7 @@
 _wkQTMovieMaxTimeLoaded
 _wkQTMovieMaxTimeLoadedChangeNotification
 _wkQTMovieMaxTimeSeekable
+_wkQTMovieSelectPreferredAlternates
 _wkQTMovieSetShowClosedCaptions
 _wkQTMovieViewSetDrawSynchronously
 _wkSetCGFontRenderingMode
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 0c8d035..c564aff 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -1,10 +1,10 @@
 #
 # Copyright (C) 2009 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
@@ -14,7 +14,7 @@
 #     * 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
@@ -101,7 +101,11 @@
     # If set to 1, doesn't compile debug symbols into webcore reducing the
     # size of the binary and increasing the speed of gdb.  gcc only.
     'remove_webcore_debug_symbols%': 0,
-  
+
+    # If set to 0, doesn't build SVG support, reducing the size of the
+    # binary and increasing the speed of gdb.
+    'enable_svg%': 1,
+
     'webcore_include_dirs': [
       '../',
       '../accessibility',
@@ -165,7 +169,48 @@
       '../workers',
       '../xml',
     ],
+
+    'bindings_idl_files': [
+      '<@(webcore_bindings_idl_files)',
+    ],
+
+    'bindings_idl_files!': [
+      # Custom bindings in bindings/v8/custom exist for these.
+      '../dom/EventListener.idl',
+      '../dom/EventTarget.idl',
+      '../html/VoidCallback.idl',
+
+      # Bindings with custom Objective-C implementations.
+      '../page/AbstractView.idl',
+
+      # FIXME: I don't know why all of these are excluded.
+      # Extra SVG bindings to exclude.
+      '../svg/ElementTimeControl.idl',
+      '../svg/SVGAnimatedPathData.idl',
+      '../svg/SVGExternalResourcesRequired.idl',
+      '../svg/SVGFilterPrimitiveStandardAttributes.idl',
+      '../svg/SVGFitToViewBox.idl',
+
+      '../svg/SVGHKernElement.idl',
+      '../svg/SVGLangSpace.idl',
+      '../svg/SVGLocatable.idl',
+      '../svg/SVGStylable.idl',
+      '../svg/SVGTests.idl',
+      '../svg/SVGTransformable.idl',
+      '../svg/SVGViewSpec.idl',
+      '../svg/SVGZoomAndPan.idl',
+
+      # FIXME: I don't know why these are excluded, either.
+      # Someone (me?) should figure it out and add appropriate comments.
+      '../css/CSSUnknownRule.idl',
+    ],
+
     'conditions': [
+      ['enable_svg!=0', {
+        'bindings_idl_files': [
+          '<@(webcore_svg_bindings_idl_files)',
+        ],
+      }],
       ['OS=="mac"', {
         'webcore_include_dirs+': [
           # platform/graphics/cg and mac needs to come before
@@ -177,8 +222,8 @@
           # FIXME: Eliminate dependency on platform/graphics/mac and
           # related directories.
           # platform/graphics/cg may need to stick around, though.
-          '../platform/graphics/cg',
           '../platform/graphics/mac',
+          '../platform/graphics/cg',
         ],
         'webcore_include_dirs': [
           # FIXME: Eliminate dependency on platform/mac and related
@@ -199,6 +244,23 @@
           '../platform/win',
         ],
       }],
+      ['OS=="win" and buildtype=="Official"', {
+        # On windows official release builds, we try to preserve symbol space.
+        'derived_sources_aggregate_files': [
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSourcesAll.cpp',
+        ],
+      },{
+        'derived_sources_aggregate_files': [
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources1.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources2.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources3.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources4.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources5.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources6.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources7.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources8.cpp',
+        ],
+      }]
     ],
   },
   'targets': [
@@ -216,40 +278,8 @@
         '../html/HTMLEntityNames.gperf',
         '../platform/ColorData.gperf',
 
-        # idl rule
-        '<@(webcore_bindings_idl_files)',
-      ],
-      'sources!': [
-        # Custom bindings in bindings/v8/custom exist for these.
-        '../dom/EventListener.idl',
-        '../dom/EventTarget.idl',
-        '../html/VoidCallback.idl',
-
-        # JSC-only.
-        '../inspector/JavaScriptCallFrame.idl',
-
-        # Bindings with custom Objective-C implementations.
-        '../page/AbstractView.idl',
-
-        # FIXME: I don't know why all of these are excluded.
-        # Extra SVG bindings to exclude.
-        '../svg/ElementTimeControl.idl',
-        '../svg/SVGAnimatedPathData.idl',
-        '../svg/SVGExternalResourcesRequired.idl',
-        '../svg/SVGFitToViewBox.idl',
-        '../svg/SVGHKernElement.idl',
-        '../svg/SVGLangSpace.idl',
-        '../svg/SVGLocatable.idl',
-        '../svg/SVGStylable.idl',
-        '../svg/SVGTests.idl',
-        '../svg/SVGTransformable.idl',
-        '../svg/SVGViewSpec.idl',
-        '../svg/SVGZoomAndPan.idl',
-
-        # FIXME: I don't know why these are excluded, either.
-        # Someone (me?) should figure it out and add appropriate comments.
-        '../css/CSSUnknownRule.idl',
-
+        # idl rules
+        '<@(bindings_idl_files)',
       ],
       'actions': [
         # Actions to build derived sources.
@@ -447,6 +477,29 @@
             '<@(_inputs)'
           ],
         },
+        {
+          'action_name': 'derived_sources_all_in_one',
+          'variables': {
+            # Write sources into a file, so that the action command line won't
+            # exceed OS limites.
+            'idls_list_temp_file': '<|(idls_list_temp_file.tmp <@(bindings_idl_files))',
+          },
+          'inputs': [
+            'scripts/action_derivedsourcesallinone.py',
+            '<(idls_list_temp_file)',
+            '<!@(cat <(idls_list_temp_file))',
+          ],
+          'outputs': [
+            '<@(derived_sources_aggregate_files)',
+          ],
+          'action': [
+            'python',
+            'scripts/action_derivedsourcesallinone.py',
+            '<(idls_list_temp_file)',
+            '--',
+            '<@(derived_sources_aggregate_files)',
+          ],
+        },
       ],
       'rules': [
         # Rules to build derived sources.
@@ -576,18 +629,15 @@
         ],
       },
       'sources': [
-        # This file includes all the .cpp files generated from the .idl files
+        # These files include all the .cpp files generated from the .idl files
         # in webcore_files.
-        '../bindings/v8/DerivedSourcesAllInOne.cpp',
+        '<@(derived_sources_aggregate_files)',
 
         # Additional .cpp files from webcore_bindings_sources actions.
         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
-        '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
-        '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
-        '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
@@ -602,6 +652,13 @@
             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
           ],
         }],
+        ['enable_svg!=0', {
+          'sources': [
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
+         ],
+        }],
         ['OS=="mac"', {
           'include_dirs': [
             '../../WebKitLibraries',
@@ -650,7 +707,7 @@
         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
       ],
       'defines': [
-        'WEBCORE_NAVIGATOR_VENDOR="Google Inc."', 
+        'WEBCORE_NAVIGATOR_VENDOR="Google Inc."',
       ],
       'include_dirs': [
         '<(INTERMEDIATE_DIR)',
@@ -674,10 +731,6 @@
         ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|opentype|posix|qt|soup|symbian|win|wx)/'],
         ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
         ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
-        # Exclude everything in svg/ directly but not in subdirectories.
-        # Everything in svg/*.cpp is included in svg/SVGAllInOne.cpp.
-        ['exclude', 'svg/[^/]+\\.cpp$'],
-        ['include', 'svg/SVGAllInOne\\.cpp$'],
 
         # JSC-only.
         ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
@@ -706,6 +759,9 @@
         # Don't build StorageEventDispatcher.  We have our own implementation.
         '../storage/StorageEventDispatcher.cpp',
 
+        # Don't build IndexedDatabase.  We have our own implementation.
+        '../storage/IndexedDatabase.cpp',
+
         # Use history/BackForwardListChromium.cpp instead.
         '../history/BackForwardList.cpp',
 
@@ -818,6 +874,20 @@
             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
           ],
         }],
+        ['enable_svg!=0', {
+          'sources/': [
+            ['exclude', 'svg/[^/]+\\.cpp$'],
+            ['include', 'svg/SVGAllInOne\\.cpp$'],
+          ],
+        }, {  # svg disabled
+          'sources/': [
+            ['exclude', 'svg/'],
+            ['exclude', 'css/svg/'],
+            ['exclude', 'rendering/style/SVG'],
+            ['exclude', 'rendering/RenderSVG'],
+            ['exclude', 'rendering/SVG'],
+          ],
+        }],
         ['OS=="linux" or OS=="freebsd"', {
           'dependencies': [
             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
@@ -991,6 +1061,9 @@
             '../platform/image-decoders/skia/ImageDecoderSkia.cpp',
             '../platform/image-decoders/xbm/XBMImageDecoder.cpp',
             '../platform/image-decoders/xbm/XBMImageDecoder.h',
+
+            # Again, Skia is not used on Mac.
+            '../platform/chromium/DragImageChromiumSkia.cpp',
           ],
           'direct_dependent_settings': {
             'include_dirs': [
diff --git a/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py b/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py
new file mode 100644
index 0000000..6a11414
--- /dev/null
+++ b/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py
@@ -0,0 +1,201 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 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 (c) 2009 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.
+
+# action_derivedsourceslist.py generates a single cpp file that includes
+# all v8 bindings cpp files generated from idls. Files can be assigned into
+# multiple output files, to reduce maximum compilation unit size and allow
+# parallel compilation.
+#
+# usage: action_derivedsourceslist.py IDL_FILES_LIST -- OUTPUT_FILE1 OUTPUT_FILE2 ...
+#
+# Note that IDL_FILES_LIST is a text file containing the IDL file paths.
+
+import errno
+import os
+import os.path
+import re
+import subprocess
+import sys
+
+# A regexp for finding Conditional attributes in interface definitions.
+conditionalPattern = re.compile('interface[\s]*\[[^\]]*Conditional=([\_0-9a-zA-Z&]*)')
+
+copyrightTemplate = """/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * This file was generated by the make_jni_lists.py script.
+ *
+ * Copyright (C) 2009 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 COMPUTER, 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.
+ */
+"""
+
+
+# Wraps conditional with ENABLE() and && if more than one conditional is specified.
+def formatConditional(conditional):
+    def wrapWithEnable(s):
+        return 'ENABLE(' + s + ')'
+    return ' && '.join(map(wrapWithEnable, conditional))
+
+
+# Find the conditional interface attribute.
+def extractConditional(idlFilePath):
+    conditional = None
+
+    # Read file and look for "interface [ Conditional=XXX ]".
+    idlFile = open(idlFilePath)
+    idlContents = idlFile.read().replace('\n', '')
+    idlFile.close()
+
+    match = conditionalPattern.search(idlContents)
+    if match:
+        conditional = match.group(1)
+        conditional = conditional.split('&')
+
+    return conditional
+
+# Extracts conditional and interface name from each IDL file.
+def extractMetaData(filePaths):
+    metaDataList = []
+
+    for f in filePaths:
+        metaData = {}
+        if len(f) == 0:
+            continue
+        if not os.path.exists(f):
+            print 'WARNING: file not found: "%s"' % f
+            continue
+
+        # Extract type name from file name
+        (parentPath, fileName) = os.path.split(f)
+        (interfaceName, ext) = os.path.splitext(fileName)
+
+        if not ext == '.idl':
+            continue
+
+        metaData = {
+            'conditional': extractConditional(f),
+            'name': interfaceName,
+        }
+
+        metaDataList.append(metaData)
+
+    return metaDataList
+
+
+def generateContent(filesMetaData, partition, totalPartitions):
+    # Sort files by conditionals.
+    filesMetaData.sort()
+
+    output = []
+
+    # Add fixed content.
+    output.append(copyrightTemplate)
+    output.append('#define NO_IMPLICIT_ATOMICSTRING\n\n')
+
+    # List all includes segmented by if and endif.
+    prevConditional = None
+    for metaData in filesMetaData:
+        name = metaData['name']
+        if (hash(name) % totalPartitions) != partition:
+            continue
+        conditional = metaData['conditional']
+
+        if prevConditional and prevConditional != conditional:
+            output.append('#endif\n')
+        if conditional and prevConditional != conditional:
+            output.append('\n#if %s\n' % formatConditional(conditional))
+
+        output.append('#include "bindings/V8%s.cpp"\n' % name)
+
+        prevConditional = conditional
+
+    if prevConditional:
+        output.append('#endif\n')
+
+    return ''.join(output)
+
+
+def writeContent(content, outputFileName):
+    (parentPath, fileName) = os.path.split(outputFileName)
+    if not os.path.exists(parentPath):
+        print parentPath
+        os.mkdir(parentPath)
+    f = open(outputFileName, 'w')
+    f.write(content)
+    f.close()
+
+
+def main(args):
+    assert(len(args) > 3)
+    inOutBreakIndex = args.index('--')
+    inputFileName = args[1]
+    outputFileNames = args[inOutBreakIndex+1:]
+
+    inputFile = open(inputFileName, 'r')
+    idlFileNames = inputFile.read().split('\n')
+    inputFile.close()
+
+    filesMetaData = extractMetaData(idlFileNames)
+    for fileName in outputFileNames:
+        print 'Generating derived sources list into %s...' % fileName
+        partition = outputFileNames.index(fileName)
+        fileContents = generateContent(filesMetaData, partition, len(outputFileNames))
+        writeContent(fileContents, fileName)
+
+    return 0
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index b8316cf..d4d6767 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1,8 +1,6 @@
 {
     'variables': {
         'webcore_bindings_idl_files': [
-
-            #IDL files
             'css/CSSCharsetRule.idl',
             'css/CSSFontFaceRule.idl',
             'css/CSSImportRule.idl',
@@ -39,6 +37,7 @@
             'dom/Clipboard.idl',
             'dom/Comment.idl',
             'dom/CompositionEvent.idl',
+            'dom/CustomEvent.idl',
             'dom/DOMCoreException.idl',
             'dom/DOMImplementation.idl',
             'dom/Document.idl',
@@ -108,6 +107,7 @@
             'html/canvas/WebGLTexture.idl',
             'html/DataGridColumn.idl',
             'html/DataGridColumnList.idl',
+            'html/DOMFormData.idl',
             'html/File.idl',
             'html/FileList.idl',
             'html/HTMLAllCollection.idl',
@@ -165,6 +165,7 @@
             'html/HTMLParagraphElement.idl',
             'html/HTMLParamElement.idl',
             'html/HTMLPreElement.idl',
+            'html/HTMLProgressElement.idl',
             'html/HTMLQuoteElement.idl',
             'html/HTMLScriptElement.idl',
             'html/HTMLSelectElement.idl',
@@ -190,6 +191,8 @@
             'inspector/InspectorBackend.idl',
             'inspector/InspectorFrontendHost.idl',
             'inspector/JavaScriptCallFrame.idl',
+            'inspector/ScriptProfile.idl',
+            'inspector/ScriptProfileNode.idl',
             'loader/appcache/DOMApplicationCache.idl',
             'notifications/Notification.idl',
             'notifications/NotificationCenter.idl',
@@ -216,7 +219,7 @@
             'storage/Database.idl',
             'storage/IDBDatabaseError.idl',
             'storage/IDBDatabaseException.idl',
-            'storage/IDBRequest.idl',
+            'storage/IDBDatabaseRequest.idl',
             'storage/IndexedDatabaseRequest.idl',
             'storage/SQLError.idl',
             'storage/SQLResultSet.idl',
@@ -224,6 +227,28 @@
             'storage/SQLTransaction.idl',
             'storage/Storage.idl',
             'storage/StorageEvent.idl',
+            'websockets/WebSocket.idl',
+            'workers/AbstractWorker.idl',
+            'workers/DedicatedWorkerContext.idl',
+            'workers/SharedWorker.idl',
+            'workers/SharedWorkerContext.idl',
+            'workers/Worker.idl',
+            'workers/WorkerContext.idl',
+            'workers/WorkerLocation.idl',
+            'xml/DOMParser.idl',
+            'xml/XMLHttpRequest.idl',
+            'xml/XMLHttpRequestException.idl',
+            'xml/XMLHttpRequestProgressEvent.idl',
+            'xml/XMLHttpRequestUpload.idl',
+            'xml/XMLSerializer.idl',
+            'xml/XPathEvaluator.idl',
+            'xml/XPathException.idl',
+            'xml/XPathExpression.idl',
+            'xml/XPathNSResolver.idl',
+            'xml/XPathResult.idl',
+            'xml/XSLTProcessor.idl',
+        ],
+        'webcore_svg_bindings_idl_files': [
             'svg/ElementTimeControl.idl',
             'svg/SVGAElement.idl',
             'svg/SVGAltGlyphElement.idl',
@@ -370,26 +395,6 @@
             'svg/SVGViewSpec.idl',
             'svg/SVGZoomAndPan.idl',
             'svg/SVGZoomEvent.idl',
-            'websockets/WebSocket.idl',
-            'workers/AbstractWorker.idl',
-            'workers/DedicatedWorkerContext.idl',
-            'workers/SharedWorker.idl',
-            'workers/SharedWorkerContext.idl',
-            'workers/Worker.idl',
-            'workers/WorkerContext.idl',
-            'workers/WorkerLocation.idl',
-            'xml/DOMParser.idl',
-            'xml/XMLHttpRequest.idl',
-            'xml/XMLHttpRequestException.idl',
-            'xml/XMLHttpRequestProgressEvent.idl',
-            'xml/XMLHttpRequestUpload.idl',
-            'xml/XMLSerializer.idl',
-            'xml/XPathEvaluator.idl',
-            'xml/XPathException.idl',
-            'xml/XPathExpression.idl',
-            'xml/XPathNSResolver.idl',
-            'xml/XPathResult.idl',
-            'xml/XSLTProcessor.idl',
         ],
         'webcore_files': [
 
@@ -420,6 +425,8 @@
             'accessibility/AccessibilityMenuListOption.h',
             'accessibility/AccessibilityObject.cpp',
             'accessibility/AccessibilityObject.h',
+            'accessibility/AccessibilityProgressIndicator.cpp',
+            'accessibility/AccessibilityProgressIndicator.h',
             'accessibility/AccessibilityRenderObject.cpp',
             'accessibility/AccessibilityRenderObject.h',
             'accessibility/AccessibilityScrollbar.cpp',
@@ -462,6 +469,10 @@
             'bindings/generic/RuntimeEnabledFeatures.h',
             'bindings/js/CachedScriptSourceProvider.h',
             'bindings/js/DOMObjectWithSVGContext.h',
+            'bindings/js/DOMObjectHashTableMap.cpp',
+            'bindings/js/DOMObjectHashTableMap.h',
+            'bindings/js/DOMWrapperWorld.cpp',
+            'bindings/js/DOMWrapperWorld.h',
             'bindings/js/GCController.cpp',
             'bindings/js/GCController.h',
             'bindings/js/JSCallbackData.cpp',
@@ -501,6 +512,8 @@
             'bindings/js/JSDataGridDataSource.cpp',
             'bindings/js/JSDataGridDataSource.h',
             'bindings/js/JSDedicatedWorkerContextCustom.cpp',
+            'bindings/js/JSDebugWrapperSet.cpp',
+            'bindings/js/JSDebugWrapperSet.h',
             'bindings/js/JSDocumentCustom.cpp',
             'bindings/js/JSDocumentFragmentCustom.cpp',
             'bindings/js/JSDOMApplicationCacheCustom.cpp',
@@ -514,6 +527,8 @@
             'bindings/js/JSDOMWindowCustom.h',
             'bindings/js/JSDOMWindowShell.cpp',
             'bindings/js/JSDOMWindowShell.h',
+            'bindings/js/JSDOMWrapper.cpp',
+            'bindings/js/JSDOMWrapper.h',
             'bindings/js/JSElementCustom.cpp',
             'bindings/js/JSEventCustom.cpp',
             'bindings/js/JSEventListener.cpp',
@@ -568,6 +583,7 @@
             'bindings/js/JSNamedNodesCollection.h',
             'bindings/js/JSNavigatorCustom.cpp',
             'bindings/js/JSNodeCustom.cpp',
+            'bindings/js/JSNodeCustom.h',
             'bindings/js/JSNodeFilterCondition.cpp',
             'bindings/js/JSNodeFilterCondition.h',
             'bindings/js/JSNodeFilterCustom.cpp',
@@ -584,6 +600,7 @@
             'bindings/js/JSSharedWorkerConstructor.cpp',
             'bindings/js/JSSharedWorkerConstructor.h',
             'bindings/js/JSSharedWorkerCustom.cpp',
+            'bindings/js/JSScriptProfileNodeCustom.cpp',
             'bindings/js/JSSQLResultSetRowListCustom.cpp',
             'bindings/js/JSSQLTransactionCustom.cpp',
             'bindings/js/JSStorageCustom.cpp',
@@ -612,6 +629,8 @@
             'bindings/js/JSWorkerContextBase.cpp',
             'bindings/js/JSWorkerContextBase.h',
             'bindings/js/JSWorkerContextCustom.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.cpp',
+            'bindings/js/JSWorkerContextErrorHandler.h',
             'bindings/js/JSWorkerCustom.cpp',
             'bindings/js/JSXMLHttpRequestConstructor.cpp',
             'bindings/js/JSXMLHttpRequestConstructor.h',
@@ -620,10 +639,8 @@
             'bindings/js/JSXSLTProcessorConstructor.cpp',
             'bindings/js/JSXSLTProcessorConstructor.h',
             'bindings/js/JSXSLTProcessorCustom.cpp',
-            'bindings/js/JavaScriptProfile.cpp',
-            'bindings/js/JavaScriptProfile.h',
-            'bindings/js/JavaScriptProfileNode.cpp',
-            'bindings/js/JavaScriptProfileNode.h',
+            'bindings/js/JavaScriptCallFrame.cpp',
+            'bindings/js/JavaScriptCallFrame.h',
             'bindings/js/ScheduledAction.cpp',
             'bindings/js/ScheduledAction.h',
             'bindings/js/ScriptArray.cpp',
@@ -657,14 +674,13 @@
             'bindings/js/ScriptValue.h',
             'bindings/js/ScriptWrappable.h',
             'bindings/js/StringSourceProvider.h',
+            'bindings/js/WebCoreJSClientData.h',
             'bindings/js/WorkerScriptController.cpp',
             'bindings/js/WorkerScriptController.h',
             'bindings/ScriptControllerBase.cpp',
             'bindings/v8/ChildThreadDOMData.cpp',
             'bindings/v8/ChildThreadDOMData.h',
-            'bindings/v8/custom/V8AbstractWorkerCustom.cpp',
             'bindings/v8/custom/V8AttrCustom.cpp',
-            'bindings/v8/custom/V8BarInfoCustom.cpp',
             'bindings/v8/custom/V8CanvasPixelArrayCustom.cpp',
             'bindings/v8/custom/V8WebGLArrayCustom.h',
             'bindings/v8/custom/V8WebGLArrayCustom.cpp',
@@ -679,11 +695,13 @@
             'bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp',
             'bindings/v8/custom/V8WebGLRenderingContextCustom.cpp',
             'bindings/v8/custom/V8ClipboardCustom.cpp',
+            'bindings/v8/custom/V8ConsoleCustom.cpp',
             'bindings/v8/custom/V8CoordinatesCustom.cpp',
             'bindings/v8/custom/V8CSSRuleCustom.cpp',
             'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
             'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',
             'bindings/v8/custom/V8CSSValueCustom.cpp',
+            'bindings/v8/custom/V8CustomIDBCallbacks.h',
             'bindings/v8/custom/V8CustomEventListener.cpp',
             'bindings/v8/custom/V8CustomEventListener.h',
             'bindings/v8/custom/V8CustomPositionCallback.cpp',
@@ -702,18 +720,18 @@
             'bindings/v8/custom/V8CustomVoidCallback.h',
             'bindings/v8/custom/V8CustomXPathNSResolver.cpp',
             'bindings/v8/custom/V8CustomXPathNSResolver.h',
+            'bindings/v8/custom/V8DatabaseCallback.cpp',
+            'bindings/v8/custom/V8DatabaseCallback.h',
             'bindings/v8/custom/V8DatabaseCustom.cpp',
             'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
             'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
             'bindings/v8/custom/V8DocumentLocationCustom.cpp',
-            'bindings/v8/custom/V8DOMApplicationCacheCustom.cpp',
-            'bindings/v8/custom/V8DOMSelectionCustom.cpp',
+            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
             'bindings/v8/custom/V8DOMWindowCustom.cpp',
             'bindings/v8/custom/V8DocumentCustom.cpp',
             'bindings/v8/custom/V8ElementCustom.cpp',
             'bindings/v8/custom/V8EventCustom.cpp',
             'bindings/v8/custom/V8EventSourceConstructor.cpp',
-            'bindings/v8/custom/V8EventSourceCustom.cpp',
             'bindings/v8/custom/V8GeolocationCustom.cpp',
             'bindings/v8/custom/V8HistoryCustom.cpp',
             'bindings/v8/custom/V8HTMLAudioElementConstructor.cpp',
@@ -737,10 +755,10 @@
             'bindings/v8/custom/V8HTMLPlugInElementCustom.cpp',
             'bindings/v8/custom/V8HTMLSelectElementCustom.cpp',
             'bindings/v8/custom/V8HTMLSelectElementCustom.h',
-            'bindings/v8/custom/V8IDBRequestCustom.cpp',
             'bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp',
             'bindings/v8/custom/V8InjectedScriptHostCustom.cpp',
             'bindings/v8/custom/V8InspectorFrontendHostCustom.cpp',
+            'bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp',
             'bindings/v8/custom/V8LocationCustom.cpp',
             'bindings/v8/custom/V8MessageChannelConstructor.cpp',
             'bindings/v8/custom/V8MessageEventCustom.cpp',
@@ -749,23 +767,22 @@
             'bindings/v8/custom/V8NamedNodeMapCustom.cpp',
             'bindings/v8/custom/V8NamedNodesCollection.cpp',
             'bindings/v8/custom/V8NamedNodesCollection.h',
-            'bindings/v8/custom/V8NavigatorCustom.cpp',
             'bindings/v8/custom/V8NodeCustom.cpp',
             'bindings/v8/custom/V8NodeFilterCustom.cpp',
             'bindings/v8/custom/V8NodeIteratorCustom.cpp',
             'bindings/v8/custom/V8NodeListCustom.cpp',
             'bindings/v8/custom/V8NotificationCenterCustom.cpp',
             'bindings/v8/custom/V8PopStateEventCustom.cpp',
+            'bindings/v8/custom/V8ScriptProfileCustom.cpp',
+            'bindings/v8/custom/V8ScriptProfileNodeCustom.cpp',
             'bindings/v8/custom/V8StorageCustom.cpp',
             'bindings/v8/custom/V8SQLResultSetRowListCustom.cpp',
             'bindings/v8/custom/V8SQLTransactionCustom.cpp',
             'bindings/v8/custom/V8SVGDocumentCustom.cpp',
             'bindings/v8/custom/V8SVGElementCustom.cpp',
-            'bindings/v8/custom/V8SVGElementInstanceCustom.cpp',
             'bindings/v8/custom/V8SVGLengthCustom.cpp',
             'bindings/v8/custom/V8SVGMatrixCustom.cpp',
             'bindings/v8/custom/V8SVGPathSegCustom.cpp',
-            'bindings/v8/custom/V8ScreenCustom.cpp',
             'bindings/v8/custom/V8SharedWorkerCustom.cpp',
             'bindings/v8/custom/V8StyleSheetCustom.cpp',
             'bindings/v8/custom/V8StyleSheetListCustom.cpp',
@@ -777,7 +794,6 @@
             'bindings/v8/custom/V8WorkerCustom.cpp',
             'bindings/v8/custom/V8XMLHttpRequestConstructor.cpp',
             'bindings/v8/custom/V8XMLHttpRequestCustom.cpp',
-            'bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp',
             'bindings/v8/custom/V8XSLTProcessorCustom.cpp',
             'bindings/v8/DateExtension.cpp',
             'bindings/v8/DateExtension.h',
@@ -785,11 +801,12 @@
             'bindings/v8/DOMData.h',
             'bindings/v8/DOMDataStore.cpp',
             'bindings/v8/DOMDataStore.h',
-            'bindings/v8/DOMObjectsInclude.h',
             'bindings/v8/DOMWrapperWorld.cpp',
             'bindings/v8/DOMWrapperWorld.h',
             'bindings/v8/IsolatedWorld.cpp',
             'bindings/v8/IsolatedWorld.h',
+            'bindings/v8/JavaScriptCallFrame.cpp',
+            'bindings/v8/JavaScriptCallFrame.h',
             'bindings/v8/MainThreadDOMData.cpp',
             'bindings/v8/MainThreadDOMData.h',
             'bindings/v8/NPV8Object.cpp',
@@ -814,11 +831,16 @@
             'bindings/v8/ScriptEventListener.h',
             'bindings/v8/ScriptFunctionCall.cpp',
             'bindings/v8/ScriptFunctionCall.h',
+            'bindings/v8/ScriptGCEvent.cpp',
+            'bindings/v8/ScriptGCEvent.h',
             'bindings/v8/ScriptInstance.cpp',
             'bindings/v8/ScriptInstance.h',
             'bindings/v8/ScriptObject.cpp',
             'bindings/v8/ScriptObject.h',
+            'bindings/v8/ScriptProfile.cpp',
             'bindings/v8/ScriptProfile.h',
+            'bindings/v8/ScriptProfileNode.cpp',
+            'bindings/v8/ScriptProfileNode.h',
             'bindings/v8/ScriptProfiler.cpp',
             'bindings/v8/ScriptProfiler.h',
             'bindings/v8/ScriptScope.cpp',
@@ -859,12 +881,12 @@
             'bindings/v8/V8EventListenerList.h',
             'bindings/v8/V8GCController.cpp',
             'bindings/v8/V8GCController.h',
+            'bindings/v8/V8GCForContextDispose.cpp',
+            'bindings/v8/V8GCForContextDispose.h',
             'bindings/v8/V8Helpers.cpp',
             'bindings/v8/V8Helpers.h',
             'bindings/v8/V8HiddenPropertyName.cpp',
             'bindings/v8/V8HiddenPropertyName.h',
-            'bindings/v8/V8Index.cpp',
-            'bindings/v8/V8Index.h',
             'bindings/v8/V8IsolatedContext.cpp',
             'bindings/v8/V8IsolatedContext.h',
             'bindings/v8/V8LazyEventListener.cpp',
@@ -880,6 +902,8 @@
             'bindings/v8/V8SVGPODTypeWrapper.h',
             'bindings/v8/V8Utilities.cpp',
             'bindings/v8/V8Utilities.h',
+            'bindings/v8/V8WorkerContextErrorHandler.cpp',
+            'bindings/v8/V8WorkerContextErrorHandler.h',
             'bindings/v8/V8WorkerContextEventListener.cpp',
             'bindings/v8/V8WorkerContextEventListener.h',
             'bindings/v8/WorkerContextExecutionProxy.h',
@@ -888,6 +912,7 @@
             'bindings/v8/WorkerScriptController.cpp',
             'bindings/v8/WorldContextHandle.cpp',
             'bindings/v8/WorldContextHandle.h',
+            'bindings/v8/WrapperTypeInfo.h',
             'bindings/v8/npruntime.cpp',
             'bindings/v8/npruntime_impl.h',
             'bindings/v8/npruntime_internal.h',
@@ -1042,6 +1067,8 @@
             'dom/CDATASection.h',
             'dom/CSSMappedAttributeDeclaration.cpp',
             'dom/CSSMappedAttributeDeclaration.h',
+            'dom/CanvasSurface.cpp',
+            'dom/CanvasSurface.h',
             'dom/CharacterData.cpp',
             'dom/CharacterData.h',
             'dom/CheckedRadioButtons.cpp',
@@ -1066,6 +1093,8 @@
             'dom/ContainerNode.cpp',
             'dom/ContainerNode.h',
             'dom/ContainerNodeAlgorithms.h',
+            'dom/CustomEvent.cpp',
+            'dom/CustomEvent.h',
             'dom/DOMCoreException.h',
             'dom/DOMImplementation.cpp',
             'dom/DOMImplementation.h',
@@ -1193,6 +1222,11 @@
             'dom/Text.h',
             'dom/TextEvent.cpp',
             'dom/TextEvent.h',
+            'dom/Touch.cpp',
+            'dom/Touch.h',
+            'dom/TouchEvent.cpp',
+            'dom/TouchList.cpp',
+            'dom/TouchList.h',
             'dom/Tokenizer.h',
             'dom/TransformSourceLibxslt.cpp',
             'dom/TransformSource.h',
@@ -1204,6 +1238,10 @@
             'dom/UIEvent.h',
             'dom/UIEventWithKeyState.cpp',
             'dom/UIEventWithKeyState.h',
+            'dom/UserGestureIndicator.cpp',
+            'dom/UserGestureIndicator.h',
+            'dom/ViewportArguments.cpp',
+            'dom/ViewportArguments.h',
             'dom/WebKitAnimationEvent.cpp',
             'dom/WebKitAnimationEvent.h',
             'dom/WebKitTransitionEvent.cpp',
@@ -1396,6 +1434,8 @@
             'html/DataGridColumn.h',
             'html/DOMDataGridDataSource.cpp',
             'html/DOMDataGridDataSource.h',
+            'html/DOMFormData.cpp',
+            'html/DOMFormData.h',
             'html/DataGridColumnList.cpp',
             'html/DataGridColumnList.h',
             'html/DateComponents.cpp',
@@ -1404,6 +1444,14 @@
             'html/File.h',
             'html/FileList.cpp',
             'html/FileList.h',
+            'html/FileStream.cpp',
+            'html/FileStream.h',
+            'html/FileStreamClient.h',
+            'html/FileStreamProxy.cpp',
+            'html/FileStreamProxy.h',
+            'html/FileThread.cpp',
+            'html/FileThread.h',
+            'html/FileThreadTask.h',
             'html/FormDataList.cpp',
             'html/FormDataList.h',
             'html/HTMLAllCollection.cpp',
@@ -1538,6 +1586,8 @@
             'html/HTMLPlugInImageElement.h',
             'html/HTMLPreElement.cpp',
             'html/HTMLPreElement.h',
+            'html/HTMLProgressElement.cpp',
+            'html/HTMLProgressElement.h',
             'html/HTMLQuoteElement.cpp',
             'html/HTMLQuoteElement.h',
             'html/HTMLScriptElement.cpp',
@@ -1581,6 +1631,8 @@
             'html/MediaError.h',
             'html/PreloadScanner.cpp',
             'html/PreloadScanner.h',
+            'html/StepRange.cpp',
+            'html/StepRange.h',
             'html/TextMetrics.h',
             'html/TimeRanges.cpp',
             'html/TimeRanges.h',
@@ -1606,17 +1658,19 @@
             'inspector/InspectorDOMStorageResource.h',
             'inspector/InspectorFrontend.cpp',
             'inspector/InspectorFrontend.h',
+            'inspector/InspectorFrontendClient.h',
+            'inspector/InspectorFrontendClientLocal.cpp',
+            'inspector/InspectorFrontendClientLocal.h',
             'inspector/InspectorFrontendHost.cpp',
             'inspector/InspectorFrontendHost.h',
             'inspector/InspectorResource.cpp',
             'inspector/InspectorResource.h',
             'inspector/InspectorTimelineAgent.cpp',
             'inspector/InspectorTimelineAgent.h',
-            'inspector/JavaScriptCallFrame.cpp',
-            'inspector/JavaScriptCallFrame.h',
-            'inspector/JavaScriptDebugListener.h',
-            'inspector/JavaScriptDebugServer.cpp',
-            'inspector/JavaScriptDebugServer.h',
+            'inspector/InspectorWorkerResource.h',
+            'inspector/ScriptBreakpoint.h',
+            'inspector/ScriptDebugListener.h',
+            'inspector/ScriptGCEventListener.h',
             'inspector/TimelineRecordFactory.cpp',
             'inspector/TimelineRecordFactory.h',
             'loader/appcache/ApplicationCache.cpp',
@@ -1693,6 +1747,8 @@
             'loader/DocumentLoader.h',
             'loader/DocumentThreadableLoader.cpp',
             'loader/DocumentThreadableLoader.h',
+            'loader/DocumentWriter.cpp',
+            'loader/DocumentWriter.h',
             'loader/EmptyClients.h',
             'loader/FTPDirectoryDocument.cpp',
             'loader/FTPDirectoryDocument.h',
@@ -1838,11 +1894,13 @@
             'page/FrameView.h',
             'page/Geolocation.cpp',
             'page/Geolocation.h',
-            'page/GeolocationController.cpp'
-            'page/GeolocationController.h'
-            'page/GeolocationControllerClient.h'
-            'page/GeolocationError.h'
-            'page/GeolocationPosition.h'
+            'page/GeolocationController.cpp',
+            'page/GeolocationController.h',
+            'page/GeolocationControllerClient.h',
+            'page/GeolocationError.h',
+            'page/GeolocationPosition.h',
+            'page/GeolocationPositionCache.cpp',
+            'page/GeolocationPositionCache.h',
             'page/Geoposition.h',
             'page/HaltablePlugin.h',
             'page/History.cpp',
@@ -1879,6 +1937,8 @@
             'page/SecurityOriginHash.h',
             'page/Settings.cpp',
             'page/Settings.h',
+            'page/SpatialNavigation.h',
+            'page/SpatialNavigation.cpp',
             'page/UserContentURLPattern.cpp',
             'page/UserContentURLPattern.h',
             'page/UserScript.h',
@@ -1892,6 +1952,7 @@
             'page/WorkerNavigator.h',
             'page/XSSAuditor.cpp',
             'page/XSSAuditor.h',
+            'page/ZoomMode.h',
             'platform/animation/Animation.cpp',
             'platform/animation/Animation.h',
             'platform/animation/AnimationList.cpp',
@@ -1917,7 +1978,8 @@
             'platform/chromium/CursorChromium.cpp',
             'platform/chromium/DragDataChromium.cpp',
             'platform/chromium/DragDataRef.h',
-            'platform/chromium/DragImageChromium.cpp',
+            'platform/chromium/DragImageChromiumMac.cpp',
+            'platform/chromium/DragImageChromiumSkia.cpp',
             'platform/chromium/DragImageRef.h',
             'platform/chromium/FileChooserChromium.cpp',
             'platform/chromium/FileSystemChromium.cpp',
@@ -1929,10 +1991,9 @@
             'platform/chromium/FramelessScrollViewClient.h',
             'platform/chromium/GeolocationServiceChromium.cpp',
             'platform/chromium/GeolocationServiceChromium.h',
+            'platform/chromium/GLES2Context.h',
             'platform/chromium/KeyCodeConversion.h',
             'platform/chromium/KeyCodeConversionGtk.cpp',
-            'platform/chromium/KeyboardCodesPosix.h',
-            'platform/chromium/KeyboardCodesWin.h',
             'platform/chromium/Language.cpp',
             'platform/chromium/LinkHashChromium.cpp',
             'platform/chromium/MIMETypeRegistryChromium.cpp',
@@ -2013,11 +2074,17 @@
             'platform/graphics/chromium/FontUtilsChromiumWin.h',
             'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp',
             'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp',
+            'platform/graphics/chromium/GraphicsLayerChromium.cpp',
+            'platform/graphics/chromium/GraphicsLayerChromium.h',
             'platform/graphics/chromium/IconChromiumLinux.cpp',
             'platform/graphics/chromium/IconChromiumMac.cpp',
             'platform/graphics/chromium/IconChromiumWin.cpp',
             'platform/graphics/chromium/ImageBufferData.h',
             'platform/graphics/chromium/ImageChromiumMac.mm',
+            'platform/graphics/chromium/LayerChromium.cpp',
+            'platform/graphics/chromium/LayerChromium.h',
+            'platform/graphics/chromium/LayerRendererChromium.cpp',
+            'platform/graphics/chromium/LayerRendererChromium.h',
             'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
             'platform/graphics/chromium/PlatformIcon.h',
             'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp',
@@ -2276,8 +2343,8 @@
             'platform/graphics/GlyphBuffer.h',
             'platform/graphics/GlyphPageTreeNode.cpp',
             'platform/graphics/GlyphPageTreeNode.h',
-            'platform/graphics/GlyphWidthMap.cpp',
-            'platform/graphics/GlyphWidthMap.h',
+            'platform/graphics/GlyphMetricsMap.cpp',
+            'platform/graphics/GlyphMetricsMap.h',
             'platform/graphics/Gradient.cpp',
             'platform/graphics/Gradient.h',
             'platform/graphics/GraphicsContext.cpp',
@@ -2340,7 +2407,6 @@
             'platform/gtk/GeolocationServiceGtk.h',
             'platform/gtk/KURLGtk.cpp',
             'platform/gtk/KeyEventGtk.cpp',
-            'platform/gtk/KeyboardCodes.h',
             'platform/gtk/Language.cpp',
             'platform/gtk/LocalizedStringsGtk.cpp',
             'platform/gtk/LoggingGtk.cpp',
@@ -2573,7 +2639,6 @@
             'platform/qt/FileChooserQt.cpp',
             'platform/qt/FileSystemQt.cpp',
             'platform/qt/KURLQt.cpp',
-            'platform/qt/KeyboardCodes.h',
             'platform/qt/Localizations.cpp',
             'platform/qt/LoggingQt.cpp',
             'platform/qt/MIMETypeRegistryQt.cpp',
@@ -2631,7 +2696,6 @@
             'platform/text/mac/TextBreakIteratorInternalICUMac.mm',
             'platform/text/mac/TextCodecMac.cpp',
             'platform/text/mac/TextCodecMac.h',
-            'platform/text/qt/StringQt.cpp',
             'platform/text/qt/TextBoundaries.cpp',
             'platform/text/qt/TextBreakIteratorQt.cpp',
             'platform/text/qt/TextCodecQt.cpp',
@@ -2640,7 +2704,6 @@
             'platform/text/symbian/StringSymbian.cpp',
             'platform/text/win/TextBreakIteratorInternalICUWin.cpp',
             'platform/text/wx/StringWx.cpp',
-            'platform/text/AtomicString.cpp',
             'platform/text/AtomicString.h',
             'platform/text/AtomicStringHash.h',
             'platform/text/AtomicStringImpl.h',
@@ -2649,8 +2712,6 @@
             'platform/text/BidiContext.cpp',
             'platform/text/BidiContext.h',
             'platform/text/BidiResolver.h',
-            'platform/text/CString.cpp',
-            'platform/text/CString.h',
             'platform/text/CharacterNames.h',
             'platform/text/ParserUtilities.h',
             'platform/text/PlatformString.h',
@@ -2663,8 +2724,8 @@
             'platform/text/StringBuilder.cpp',
             'platform/text/StringBuilder.h',
             'platform/text/StringHash.h',
-            'platform/text/StringImpl.cpp',
             'platform/text/StringImpl.h',
+            'platform/text/SuffixTree.h',
             'platform/text/TextBoundaries.h',
             'platform/text/TextBoundaries.cpp',
             'platform/text/TextBreakIterator.h',
@@ -2760,7 +2821,6 @@
             'platform/wx/EventLoopWx.cpp',
             'platform/wx/FileSystemWx.cpp',
             'platform/wx/KeyEventWin.cpp',
-            'platform/wx/KeyboardCodes.h',
             'platform/wx/KeyboardEventWx.cpp',
             'platform/wx/LocalizedStringsWx.cpp',
             'platform/wx/LoggingWx.cpp',
@@ -2804,7 +2864,6 @@
             'platform/GeolocationService.cpp',
             'platform/GeolocationService.h',
             'platform/HostWindow.h',
-            'platform/KeyboardCodes.h',
             'platform/KURL.cpp',
             'platform/KURL.h',
             'platform/KURLGoogle.cpp',
@@ -2846,6 +2905,8 @@
             'platform/ScrollbarThemeComposite.cpp',
             'platform/ScrollbarThemeComposite.h',
             'platform/SearchPopupMenu.h',
+            'platform/SecureTextInput.cpp',
+            'platform/SecureTextInput.h',
             'platform/SharedBuffer.cpp',
             'platform/SharedBuffer.h',
             'platform/SharedTimer.h',
@@ -2863,8 +2924,11 @@
             'platform/Timer.cpp',
             'platform/Timer.h',
             'platform/TreeShared.h',
+            'platform/UUID.cpp',
+            'platform/UUID.h',
             'platform/Widget.cpp',
             'platform/Widget.h',
+            'platform/WindowsKeyboardCodes.h',
             'plugins/chromium/PluginDataChromium.cpp',
             'plugins/chromium/PluginDataChromium.h',
             'plugins/gtk/PluginDataGtk.cpp',
@@ -2912,6 +2976,7 @@
             'plugins/PluginStream.h',
             'plugins/PluginView.cpp',
             'plugins/PluginView.h',
+            'plugins/PluginViewNone.cpp',
             'plugins/npapi.cpp',
             'plugins/npfunctions.h',
             'rendering/style/BindingURI.cpp',
@@ -2991,7 +3056,6 @@
             'rendering/InlineFlowBox.cpp',
             'rendering/InlineFlowBox.h',
             'rendering/InlineIterator.h',
-            'rendering/InlineRunBox.h',
             'rendering/InlineTextBox.cpp',
             'rendering/InlineTextBox.h',
             'rendering/LayoutState.cpp',
@@ -3031,10 +3095,14 @@
             'rendering/RenderForeignObject.h',
             'rendering/RenderFrame.cpp',
             'rendering/RenderFrame.h',
+            'rendering/RenderFrameBase.cpp',
+            'rendering/RenderFrameBase.h',
             'rendering/RenderFrameSet.cpp',
             'rendering/RenderFrameSet.h',
             'rendering/RenderHTMLCanvas.cpp',
             'rendering/RenderHTMLCanvas.h',
+            'rendering/RenderIFrame.cpp',
+            'rendering/RenderIFrame.h',
             'rendering/RenderImage.cpp',
             'rendering/RenderImage.h',
             'rendering/RenderImageGeneratedContent.cpp',
@@ -3069,10 +3137,10 @@
             'rendering/RenderObjectChildList.h',
             'rendering/RenderPart.cpp',
             'rendering/RenderPart.h',
-            'rendering/RenderPartObject.cpp',
-            'rendering/RenderPartObject.h',
             'rendering/RenderPath.cpp',
             'rendering/RenderPath.h',
+            'rendering/RenderProgress.cpp',
+            'rendering/RenderProgress.h',
             'rendering/RenderReplaced.cpp',
             'rendering/RenderReplaced.h',
             'rendering/RenderReplica.cpp',
@@ -3102,6 +3170,12 @@
             'rendering/RenderSVGModelObject.cpp',
             'rendering/RenderSVGModelObject.h',
             'rendering/RenderSVGResource.h',
+            'rendering/RenderSVGResourceClipper.cpp',
+            'rendering/RenderSVGResourceClipper.h',
+            'rendering/RenderSVGResourceFilter.cpp',
+            'rendering/RenderSVGResourceFilter.h',
+            'rendering/RenderSVGResourceMarker.cpp',
+            'rendering/RenderSVGResourceMarker.h',
             'rendering/RenderSVGResourceMasker.cpp',
             'rendering/RenderSVGResourceMasker.h',
             'rendering/RenderSVGRoot.cpp',
@@ -3204,6 +3278,7 @@
             'storage/ChangeVersionWrapper.cpp',
             'storage/ChangeVersionWrapper.h',
             'storage/chromium/DatabaseObserver.h',
+            'storage/chromium/IndexedDatabase.cpp',
             'storage/chromium/DatabaseTrackerChromium.cpp',
             'storage/chromium/QuotaTracker.cpp',
             'storage/chromium/QuotaTracker.h',
@@ -3212,6 +3287,7 @@
             'storage/Database.h',
             'storage/DatabaseAuthorizer.cpp',
             'storage/DatabaseAuthorizer.h',
+            'storage/DatabaseCallback.h',
             'storage/DatabaseDetails.h',
             'storage/DatabaseTask.cpp',
             'storage/DatabaseTask.h',
@@ -3220,10 +3296,17 @@
             'storage/DatabaseTracker.cpp',
             'storage/DatabaseTracker.h',
             'storage/DatabaseTrackerClient.h',
+            'storage/IDBCallbacks.h',
+            'storage/IDBDatabase.h',
+            'storage/IDBDatabase.cpp',
             'storage/IDBDatabaseError.h',
             'storage/IDBDatabaseException.h',
-            'storage/IDBRequest.cpp',
-            'storage/IDBRequest.h',
+            'storage/IDBDatabaseRequest.cpp',
+            'storage/IDBDatabaseRequest.h',
+            'storage/IndexedDatabase.cpp',
+            'storage/IndexedDatabase.h',
+            'storage/IndexedDatabaseImpl.cpp',
+            'storage/IndexedDatabaseImpl.h',
             'storage/IndexedDatabaseRequest.cpp',
             'storage/IndexedDatabaseRequest.h',
             'storage/LocalStorageTask.cpp',
@@ -3323,13 +3406,7 @@
             'svg/graphics/SVGPaintServerSolid.h',
             'svg/graphics/SVGResource.cpp',
             'svg/graphics/SVGResource.h',
-            'svg/graphics/SVGResourceClipper.cpp',
-            'svg/graphics/SVGResourceClipper.h',
-            'svg/graphics/SVGResourceFilter.cpp',
-            'svg/graphics/SVGResourceFilter.h',
             'svg/graphics/SVGResourceListener.h',
-            'svg/graphics/SVGResourceMarker.cpp',
-            'svg/graphics/SVGResourceMarker.h',
             'svg/ColorDistance.cpp',
             'svg/ColorDistance.h',
             'svg/ElementTimeControl.h',
@@ -3619,6 +3696,8 @@
             'websockets/WebSocketChannelClient.h',
             'websockets/WebSocketHandshake.cpp',
             'websockets/WebSocketHandshake.h',
+            'websockets/WebSocketHandshakeRequest.cpp',
+            'websockets/WebSocketHandshakeRequest.h',
             'websockets/WorkerThreadableWebSocketChannel.cpp',
             'websockets/WorkerThreadableWebSocketChannel.h',
             'workers/AbstractWorker.cpp',
@@ -3662,6 +3741,8 @@
             'xml/XMLHttpRequest.h',
             'xml/XMLHttpRequestException.h',
             'xml/XMLHttpRequestProgressEvent.h',
+            'xml/XMLHttpRequestProgressEventThrottle.cpp',
+            'xml/XMLHttpRequestProgressEventThrottle.h',
             'xml/XMLHttpRequestUpload.cpp',
             'xml/XMLHttpRequestUpload.h',
             'xml/XMLSerializer.cpp',
@@ -3724,6 +3805,7 @@
             'inspector/front-end/Callback.js',
             'inspector/front-end/CallStackSidebarPane.js',
             'inspector/front-end/ChangesView.js',
+            'inspector/front-end/Checkbox.js',
             'inspector/front-end/Color.js',
             'inspector/front-end/ConsolePanel.js',
             'inspector/front-end/ConsoleView.js',
@@ -3745,6 +3827,7 @@
             'inspector/front-end/ImageView.js',
             'inspector/front-end/InspectorBackendStub.js',
             'inspector/front-end/InspectorFrontendHostStub.js',
+            'inspector/front-end/InjectedFakeWorker.js',
             'inspector/front-end/InjectedScript.js',
             'inspector/front-end/InjectedScriptAccess.js',
             'inspector/front-end/inspector.js',
@@ -3799,6 +3882,7 @@
             'inspector/front-end/View.js',
             'inspector/front-end/WatchExpressionsSidebarPane.js',
             'inspector/front-end/WelcomeView.js',
+            'inspector/front-end/WorkersSidebarPane.js',
             'inspector/front-end/audits.css',
             'inspector/front-end/inspector.css',
             'inspector/front-end/inspectorSyntaxHighlight.css',
@@ -3806,8 +3890,14 @@
             'inspector/front-end/textViewer.css',
         ],
         'webinspector_image_files': [
-
+            'inspector/front-end/Images/auditsIcon.png',
             'inspector/front-end/Images/back.png',
+            'inspector/front-end/Images/breakpointBorder.png',
+            'inspector/front-end/Images/breakpointConditionalBorder.png',
+            'inspector/front-end/Images/breakpointConditionalCounterBorder.png',
+            'inspector/front-end/Images/breakpointCounterBorder.png',
+            'inspector/front-end/Images/breakpointsActivateButtonGlyph.png',
+            'inspector/front-end/Images/breakpointsDeactivateButtonGlyph.png',
             'inspector/front-end/Images/checker.png',
             'inspector/front-end/Images/clearConsoleButtonGlyph.png',
             'inspector/front-end/Images/closeButtons.png',
@@ -3865,6 +3955,7 @@
             'inspector/front-end/Images/profilesIcon.png',
             'inspector/front-end/Images/profileSmallIcon.png',
             'inspector/front-end/Images/profilesSilhouette.png',
+            'inspector/front-end/Images/programCounterBorder.png',
             'inspector/front-end/Images/radioDot.png',
             'inspector/front-end/Images/recordButtonGlyph.png',
             'inspector/front-end/Images/recordToggledButtonGlyph.png',
@@ -3892,6 +3983,7 @@
             'inspector/front-end/Images/segmentSelected.png',
             'inspector/front-end/Images/segmentSelectedEnd.png',
             'inspector/front-end/Images/sessionStorage.png',
+            'inspector/front-end/Images/spinner.gif',
             'inspector/front-end/Images/splitviewDimple.png',
             'inspector/front-end/Images/splitviewDividerBackground.png',
             'inspector/front-end/Images/statusbarBackground.png',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 3144ec1..2d2d4e1 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -46,8 +46,6 @@
 __ZN7WebCore24fileSystemRepresentationERKNS_6StringE
 __ZNK7WebCore6String14createCFStringEv
 __ZN7WebCore10StringImpl14createCFStringEv
-__ZN7WebCore7CString16newUninitializedEmRPc
-__ZNK7WebCore7CString4dataEv
 __ZN3WTF6VectorIcLm0EE6shrinkEm
 __ZN7WebCore15AutodrainedPoolC1Ei
 __ZN7WebCore15AutodrainedPoolC2Ei
@@ -215,11 +213,6 @@
 __ZN3WTF9HashTableIPN7WebCore4PageES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6rehashEi
 __ZN3WTF9HashTableIPN7WebCore4PageES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E13allocateTableEi
 __ZN3WTF9HashTableIPN7WebCore4PageES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E15deallocateTableEP
-__ZN7WebCore21JavaScriptDebugServer6sharedEv
-__ZN7WebCore21JavaScriptDebugServerC1Ev
-__ZN7WebCore21JavaScriptDebugServerC2Ev
-__ZN7WebCore21JavaScriptDebugServer11pageCreatedEPNS_4PageE
-__ZN7WebCore21JavaScriptDebugServer28hasListenersInterestedInPageEPNS_4PageE
 __ZNK3WTF9HashTableIPN7WebCore4PageESt4pairIS3_PNS_7HashSetIPNS1_23JavaScriptDebugListenerENS_7PtrHashIS7_EENS_10HashTraitsIS7_
 __ZN7WebCore8Settings27setLocalStorageDatabasePathERKNS_6StringE
 __ZN7WebCore5FrameC1EPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
@@ -1783,7 +1776,6 @@
 __ZNK7WebCore6String6latin1Ev
 __ZNK7WebCore12TextEncoding6encodeEPKtmNS_19UnencodableHandlingE
 __ZN7WebCore15TextCodecLatin16encodeEPKtmNS_19UnencodableHandlingE
-__ZNK7WebCore7CString6lengthEv
 __ZN7WebCore8Document19updateStyleSelectorEv
 __ZN7WebCore8Document19recalcStyleSelectorEv
 __ZNK7WebCore11RenderStyle17inheritedNotEqualEPS0_
@@ -2212,7 +2204,6 @@
 __ZNK7WebCore17ScriptElementData13scriptContentEv
 __ZN7WebCore15SegmentedString7prependERKS0_
 __ZN7WebCore15SegmentedString7prependERKNS_18SegmentedSubstringE
-__ZNK7WebCore6StringcvN3JSC7UStringEEv
 __ZNK7WebCore20StringSourceProvider6lengthEv
 __ZN7WebCore13HTMLTokenizer15scriptExecutionERKNS_16ScriptSourceCodeENS0_5StateE
 __ZN7WebCore11FrameLoader13executeScriptERKNS_16ScriptSourceCodeE
@@ -2288,7 +2279,6 @@
 __ZNK3WTF9HashTableIPN3JSC8JSObjectESt4pairIS3_jENS_18PairFirstExtractorIS5_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTra
 __ZN3WTF7HashMapIPN3JSC8JSObjectEjNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS6_IjEEE3addERKS3_RKj
 __ZN3WTF9HashTableIPN3JSC8JSObjectESt4pairIS3_jENS_18PairFirstExtractorIS5_EENS_7PtrHashIS3_EENS_14PairHashTraitsINS_10HashTrai
-__ZN7WebCore6StringC1ERKN3JSC7UStringE
 __ZN7WebCore6StringC2ERKN3JSC7UStringE
 __ZNK7WebCore20StringSourceProvider4dataEv
 __ZNK7WebCore15JSDOMWindowBase17supportsProfilingEv
@@ -2424,9 +2414,6 @@
 __ZN3WTF6VectorItLm512EE6appendItEEvPKT_m
 __ZN7WebCoreL21appendEncodedHostnameERN3WTF6VectorItLm512EEEPKtj
 __ZN7WebCore12TextCodecICU6encodeEPKtmNS_19UnencodableHandlingE
-__ZN7WebCore7CStringC1EPKcj
-__ZN7WebCore7CStringC2EPKcj
-__ZN7WebCore7CString4initEPKcj
 __ZN7WebCore12TextCodecICUD0Ev
 __ZNK7WebCore12TextCodecICU19releaseICUConverterEv
 __ZN7WebCoreL18headingConstructorERKNS_13QualifiedNameEPNS_8DocumentEPNS_15HTMLFormElementEb
@@ -8971,8 +8958,6 @@
 __ZN7WebCore12FormDataList12appendStringERKNS_6StringE
 __ZN3WTF6VectorIN7WebCore12FormDataList4ItemELm0EE14expandCapacityEm
 __ZN3WTF6VectorIN7WebCore12FormDataList4ItemELm0EE15reserveCapacityEm
-__ZN7WebCore7CStringC1EPKc
-__ZN7WebCore7CStringC2EPKc
 __ZN7WebCoreeqERKNS_7CStringES2_
 __ZN7WebCore15FormDataBuilder25addKeyValuePairAsFormDataERN3WTF6VectorIcLm0EEERKNS_7CStringES7_
 __ZN7WebCore15FormDataBuilder22encodeStringAsFormDataERN3WTF6VectorIcLm0EEERKNS_7CStringE
@@ -19544,8 +19529,6 @@
 __ZNK3WTF7HashMapINS_6RefPtrIN7WebCore14SecurityOriginEEEyNS2_18SecurityOriginHashENS_10HashTraitsIS4_EENS6_IyEEE3getEPS3_
 __ZN7WebCore18SecurityOriginHash4hashEPNS_14SecurityOriginE
 __ZN7WebCore15DatabaseTracker8setQuotaEPNS_14SecurityOriginEy
-__ZN7WebCore7CString11mutableDataEv
-__ZN7WebCore7CString18copyBufferIfNeededEv
 __ZNK3WTF9HashTableINS_6RefPtrIN7WebCore14SecurityOriginEEESt4pairIS4_yENS_18PairFirstExtractorIS6_EENS2_18SecurityOriginHashEN
 __ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
 __ZN3WTF7HashMapINS_6RefPtrIN7WebCore14SecurityOriginEEEyNS2_18SecurityOriginHashENS_10HashTraitsIS4_EENS6_IyEEE3setEPS3_RKy
@@ -19813,7 +19796,6 @@
 __ZN3WTF6VectorIN3JSC16ProtectedJSValueELm0EE6shrinkEm
 __ZN7WebCore13HTMLTokenizer9parseTextERNS_15SegmentedStringENS0_5StateE
 __ZN7WebCore19InspectorController14enableProfilerEb
-__ZN7WebCore21JavaScriptDebugServer27recompileAllJSFunctionsSoonEv
 __ZN7WebCore33jsConsolePrototypeFunctionProfileEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore7Console7profileERKN3JSC7UStringEPNS_15ScriptCallStackE
 __ZN7WebCore36jsConsolePrototypeFunctionProfileEndEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
@@ -19849,8 +19831,6 @@
 __ZN7WebCoreL13getLineNumberEPK15OpaqueJSContextP13OpaqueJSValueP14OpaqueJSStringPPKS3_
 __ZN7WebCoreL11getChildrenEPK15OpaqueJSContextP13OpaqueJSValueP14OpaqueJSStringPPKS3_
 __ZNK3WTF7HashMapIxNS_6RefPtrIN7WebCore17InspectorResourceEEENS_7IntHashIyEENS_10HashTraitsIxEENS7_IS4_EEE3getERKx
-__ZN7WebCore5TimerINS_21JavaScriptDebugServerEE5firedEv
-__ZN7WebCore21JavaScriptDebugServer23recompileAllJSFunctionsEPNS_5TimerIS0_EE
 __ZNK3JSC21CollectorHeapIteratorILNS_8HeapTypeE0EEdeEv
 __ZN3JSC21CollectorHeapIteratorILNS_8HeapTypeE0EEppEv
 __ZN3WTF6VectorIN3JSC12ProtectedPtrINS1_10JSFunctionEEELm0EE14expandCapacityEm
@@ -23797,7 +23777,6 @@
 __ZN7WebCore18ScriptFunctionCall4callEv
 __ZN7WebCore18ScriptFunctionCall4callERbb
 __ZN7WebCore44jsInspectorControllerPrototypeFunctionAttachEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
-__ZN7WebCore19InspectorController12attachWindowEv
 __ZN7WebCore19InspectorController21populateScriptObjectsEv
 __ZN7WebCoreL18callSimpleFunctionEPN3JSC9ExecStateERKNS_12ScriptObjectEPKc
 __ZN7WebCore19InspectorController9showPanelENS0_13SpecialPanelsE
@@ -23858,7 +23837,6 @@
 __ZN7WebCoreL16drawOutlinedQuadERNS_15GraphicsContextERKNS_9FloatQuadERKNS_5ColorE
 __ZN7WebCoreL10quadToPathERKNS_9FloatQuadE
 __ZN7WebCore44jsInspectorControllerPrototypeFunctionDetachEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
-__ZN7WebCore19InspectorController12detachWindowEv
 __ZN7WebCore56jsInspectorControllerPrototypeFunctionMoveByUnrestrictedEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgL
 __ZNK7WebCore19InspectorController12moveWindowByEff
 __ZN7WebCoreL24drawOutlinedQuadWithClipERNS_15GraphicsContextERKNS_9FloatQuadES4_RKNS_5ColorE
@@ -23874,19 +23852,15 @@
 __ZN7WebCore22HTMLViewSourceDocument17addViewSourceTextERKNS_6StringE
 __ZN7WebCore52jsInspectorControllerPrototypeFunctionEnableDebuggerEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore19InspectorController14enableDebuggerEv
-__ZN7WebCore21JavaScriptDebugServer11addListenerEPNS_23JavaScriptDebugListenerEPNS_4PageE
 __ZN3WTF7HashMapIPN7WebCore4PageEPNS_7HashSetIPNS1_23JavaScriptDebugListenerENS_7PtrHashIS6_EENS_10HashTraitsIS6_EEEENS7_IS3_EE
 __ZN3WTF7HashSetIPN7WebCore23JavaScriptDebugListenerENS_7PtrHashIS3_EENS_10HashTraitsIS3_EEE3addERKS3_
 __ZN3WTF9HashTableIPN7WebCore23JavaScriptDebugListenerES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_
-__ZN7WebCore21JavaScriptDebugServer14didAddListenerEPNS_4PageE
 __ZN7WebCore4Page11setDebuggerEPN3JSC8DebuggerE
-__ZN7WebCore21JavaScriptDebugServer16clearBreakpointsEv
 __ZN3WTF20deleteAllPairSecondsIPNS_7HashSetIjNS_7IntHashIjEENS_10HashTraitsIjEEEEKNS_7HashMapIlS7_NS2_ImEENS4_IlEENS4_IS7_EEEEE
 __ZNK7WebCore25JSCanvasGradientPrototype9classInfoEv
 __ZNK7WebCore30JSInspectorControllerPrototype9classInfoEv
 __ZN3WTF7HashMapIPN3JSC14SourceProviderEPNS1_9ExecStateENS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3addERKS3_RKS5_
 __ZN3WTF9HashTableIPN3JSC14SourceProviderESt4pairIS3_PNS1_9ExecStateEENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14PairHa
-__ZN7WebCore21JavaScriptDebugServer12sourceParsedEPN3JSC9ExecStateERKNS1_10SourceCodeEiRKNS1_7UStringE
 __ZN7WebCoreL6toPageEPN3JSC14JSGlobalObjectE
 __ZNK3WTF7HashMapIPN7WebCore4PageEPNS_7HashSetIPNS1_23JavaScriptDebugListenerENS_7PtrHashIS6_EENS_10HashTraitsIS6_EEEENS7_IS3_E
 __ZN7WebCoreL22dispatchDidParseSourceERKN3WTF7HashSetIPNS_23JavaScriptDebugListenerENS0_7PtrHashIS3_EENS0_10HashTraitsIS3_EEEEP
@@ -23900,32 +23874,20 @@
 __ZN7WebCore32jsConsolePrototypeFunctionAssertEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore7Console15assertConditionEbPNS_15ScriptCallStackE
 __ZN3WTF6VectorIPN7WebCore23JavaScriptDebugListenerELm0EE6shrinkEm
-__ZN7WebCore21JavaScriptDebugServer9callEventERKN3JSC17DebuggerCallFrameEli
 __ZN7WebCore19JavaScriptCallFrameC1ERKN3JSC17DebuggerCallFrameEN3WTF10PassRefPtrIS0_EEli
 __ZN7WebCore19JavaScriptCallFrameC2ERKN3JSC17DebuggerCallFrameEN3WTF10PassRefPtrIS0_EEli
-__ZN7WebCore21JavaScriptDebugServer13pauseIfNeededEPNS_4PageE
-__ZNK7WebCore21JavaScriptDebugServer13hasBreakpointElj
 __ZNK3WTF7HashMapIlPNS_7HashSetIjNS_7IntHashIjEENS_10HashTraitsIjEEEENS2_ImEENS4_IlEENS4_IS7_EEE3getERKl
-__ZN7WebCore21JavaScriptDebugServer11atStatementERKN3JSC17DebuggerCallFrameEli
-__ZN7WebCore21JavaScriptDebugServer11returnEventERKN3JSC17DebuggerCallFrameEli
 __ZN7WebCore19JavaScriptCallFrame6callerEv
 __ZN3WTF10RefCountedIN7WebCore19JavaScriptCallFrameEE5derefEv
-__ZN7WebCore21JavaScriptDebugServer18willExecuteProgramERKN3JSC17DebuggerCallFrameEli
-__ZN7WebCore21JavaScriptDebugServer17didExecuteProgramERKN3JSC17DebuggerCallFrameEli
 __ZN7WebCore46jsInspectorControllerPrototypeFunctionProfilesEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore21JSInspectorController8profilesEPN3JSC9ExecStateERKNS1_7ArgListE
 __ZN7WebCore52jsInspectorControllerPrototypeFunctionEnableProfilerEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZNK7WebCore32JSHTMLOptionsCollectionPrototype9classInfoEv
-__ZN7WebCore21JavaScriptDebugServer15continueProgramEv
-__ZN7WebCore21JavaScriptDebugServer9exceptionERKN3JSC17DebuggerCallFrameEli
 __ZN7WebCore52jsInspectorControllerPrototypeFunctionStartProfilingEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore51jsInspectorControllerPrototypeFunctionStopProfilingEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
 __ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
 __ZN7WebCore19InspectorController15disableDebuggerEv
-__ZN7WebCore21JavaScriptDebugServer14removeListenerEPNS_23JavaScriptDebugListenerEPNS_4PageE
 __ZN3WTF9HashTableIPN7WebCore4PageESt4pairIS3_PNS_7HashSetIPNS1_23JavaScriptDebugListenerENS_7PtrHashIS7_EENS_10HashTraitsIS7_E
-__ZN7WebCore21JavaScriptDebugServer17didRemoveListenerEPNS_4PageE
-__ZN7WebCore21JavaScriptDebugServer21didRemoveLastListenerEv
 __ZN7WebCore5Frame17setIsDisconnectedEb
 __ZN7WebCore19InspectorController11closeWindowEv
 __ZN7WebCoreL19getUniqueIdCallbackEPK15OpaqueJSContextP13OpaqueJSValueP14OpaqueJSStringPPKS3_
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index c1b2e5a..e45bd99 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -53,6 +53,14 @@
 !contains(DEFINES, ENABLE_DATAGRID=.): DEFINES += ENABLE_DATAGRID=0
 !contains(DEFINES, ENABLE_VIDEO=.): DEFINES += ENABLE_VIDEO=1
 !contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1
+!contains(DEFINES, ENABLE_SANDBOX=.): DEFINES += ENABLE_SANDBOX=1
+!contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
+!contains(DEFINES, ENABLE_BLOB_SLICE=.): DEFINES += ENABLE_BLOB_SLICE=0
+!contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
+
+greaterThan(QT_MINOR_VERSION, 5) {
+    !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
+}
 
 # SVG support
 !contains(DEFINES, ENABLE_SVG=0) {
@@ -72,6 +80,11 @@
 # HTML5 datalist support
 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
 
+# Tiled Backing Store support
+greaterThan(QT_MINOR_VERSION, 5) {
+    !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
+}
+
 # Nescape plugins support (NPAPI)
 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
     unix|win32-*:!embedded:!wince*: {
@@ -86,7 +99,7 @@
 
 # XSLT support with QtXmlPatterns
 !contains(DEFINES, ENABLE_XSLT=.) {
-    contains(QT_CONFIG, xmlpatterns):!lessThan(QT_MINOR_VERSION, 5):DEFINES += ENABLE_XSLT=1
+    contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
     else:DEFINES += ENABLE_XSLT=0
 }
 
@@ -99,7 +112,8 @@
     }
 }
 
-DEFINES += WTF_CHANGES=1
+# Bearer management is part of Qt 4.7
+!lessThan(QT_MINOR_VERSION, 7):!contains(DEFINES, ENABLE_QT_BEARER=.):DEFINES += ENABLE_QT_BEARER=1
 
 # Enable touch event support with Qt 4.6
 !lessThan(QT_MINOR_VERSION, 6): DEFINES += ENABLE_TOUCH_EVENTS=1
@@ -125,6 +139,7 @@
 contains(DEFINES, ENABLE_DATAGRID=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATAGRID=1
 contains(DEFINES, ENABLE_EVENTSOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_EVENTSOURCE=1
 contains(DEFINES, ENABLE_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
+contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
 contains(DEFINES, ENABLE_DOM_STORAGE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
@@ -142,6 +157,8 @@
 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=1
 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
+contains(DEFINES, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
+contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
 
 
 ## Derived source generators
@@ -192,7 +209,9 @@
     $$PWD/css/view-source.css \
     $$PWD/css/wml.css \
     $$PWD/css/mediaControls.css \
-    $$PWD/css/mediaControlsQt.css
+    $$PWD/css/mediaControlsQt.css \
+    $$PWD/css/themeQtNoListboxes.css \
+    $$PWD/css/themeQtMaemo5.css
 
 IDL_BINDINGS += \
     css/Counter.idl \
@@ -230,6 +249,7 @@
     dom/CDATASection.idl \
     dom/Comment.idl \
     dom/CompositionEvent.idl \
+    dom/CustomEvent.idl \
     dom/DocumentFragment.idl \
     dom/Document.idl \
     dom/DocumentType.idl \
@@ -282,13 +302,23 @@
     html/canvas/CanvasPattern.idl \
     html/canvas/CanvasRenderingContext.idl \
     html/canvas/CanvasRenderingContext2D.idl \
+    html/canvas/WebGLActiveInfo.idl \
+    html/canvas/WebGLBuffer.idl \
+    html/canvas/WebGLContextAttributes.idl \
+    html/canvas/WebGLFramebuffer.idl \
+    html/canvas/WebGLProgram.idl \
+    html/canvas/WebGLRenderbuffer.idl \
     html/canvas/WebGLRenderingContext.idl \
+    html/canvas/WebGLShader.idl \
     html/canvas/WebGLShortArray.idl \
+    html/canvas/WebGLTexture.idl \
+    html/canvas/WebGLUniformLocation.idl \
     html/canvas/WebGLUnsignedByteArray.idl \
     html/canvas/WebGLUnsignedIntArray.idl \
     html/canvas/WebGLUnsignedShortArray.idl \
     html/DataGridColumn.idl \
     html/DataGridColumnList.idl \
+    html/DOMFormData.idl \
     html/File.idl \
     html/FileList.idl \
     html/HTMLAllCollection.idl \
@@ -346,6 +376,7 @@
     html/HTMLParagraphElement.idl \
     html/HTMLParamElement.idl \
     html/HTMLPreElement.idl \
+    html/HTMLProgressElement.idl \
     html/HTMLQuoteElement.idl \
     html/HTMLScriptElement.idl \
     html/HTMLSelectElement.idl \
@@ -371,7 +402,11 @@
     inspector/InspectorBackend.idl \
     inspector/InspectorFrontendHost.idl \
     inspector/JavaScriptCallFrame.idl \
+    inspector/ScriptProfile.idl \
+    inspector/ScriptProfileNode.idl \
     loader/appcache/DOMApplicationCache.idl \
+    notifications/Notification.idl \
+    notifications/NotificationCenter.idl \
     page/BarInfo.idl \
     page/Console.idl \
     page/Coordinates.idl \
@@ -669,7 +704,7 @@
 stylesheets.wkScript = $$PWD/css/make-css-file-arrays.pl
 stylesheets.output = $${WC_GENERATED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
 stylesheets.input = stylesheets.wkScript
-stylesheets.commands = perl $$stylesheets.wkScript --preprocessor \"$${QMAKE_MOC} -E\" $${WC_GENERATED_SOURCES_DIR}/UserAgentStyleSheets.h ${QMAKE_FILE_OUT} $$STYLESHEETS_EMBED
+stylesheets.commands = perl $$stylesheets.wkScript $${WC_GENERATED_SOURCES_DIR}/UserAgentStyleSheets.h ${QMAKE_FILE_OUT} $$STYLESHEETS_EMBED
 stylesheets.depends = $$STYLESHEETS_EMBED
 stylesheets.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/UserAgentStyleSheets.h
 addExtraCompiler(stylesheets, $${WC_GENERATED_SOURCES_DIR}/UserAgentStyleSheets.h)
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 4cb4794..8d90003 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -4,11 +4,14 @@
 
 symbian: {
     TARGET.EPOCALLOWDLLDATA=1
-    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB
     TARGET.CAPABILITY = All -Tcb
-    TARGET.UID3 = 0x200267C2
-
-    webkitlibs.sources = QtWebKit.dll
+    isEmpty(QT_LIBINFIX) {
+        TARGET.UID3 = 0x200267C2
+    } else {
+        TARGET.UID3 = 0xE00267C2
+    }
+    webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
+    CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
     webkitlibs.path = /sys/bin
     vendorinfo = \
         "; Localised Vendor name" \
@@ -27,13 +30,16 @@
     # Need to guarantee that these come before system includes of /epoc32/include
     MMP_RULES += "USERINCLUDE rendering"
     MMP_RULES += "USERINCLUDE platform/text"
-    # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
-    # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
-    QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000
-    MMP_RULES += ALWAYS_BUILD_AS_ARM
-    QMAKE_CXXFLAGS.ARMCC += -OTime -O3
+    symbian-abld|symbian-sbsv2 {
+        # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
+        # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
+        QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000
+        MMP_RULES += ALWAYS_BUILD_AS_ARM
+    }
+    CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3
 }
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ..
 include($$PWD/../WebKit.pri)
 
 TEMPLATE = lib
@@ -41,19 +47,13 @@
 
 contains(QT_CONFIG, embedded):CONFIG += embedded
 
-isEmpty(OUTPUT_DIR): OUTPUT_DIR = ..
-
 CONFIG(standalone_package) {
     isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/generated
     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/../JavaScriptCore/generated
 
-    CONFIG(QTDIR_build):include($$QT_SOURCE_TREE/src/qbase.pri)
-    else: VERSION = 4.7.0
-
     PRECOMPILED_HEADER = $$PWD/../WebKit/qt/WebKit_pch.h
-    DEFINES *= NDEBUG
 
-    symbian: CONFIG += def_files
+    symbian: TARGET += $${QT_LIBINFIX}
 } else {
     isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = generated
     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = ../JavaScriptCore/generated
@@ -66,7 +66,11 @@
 
 }
 
-!CONFIG(QTDIR_build) {
+CONFIG(QTDIR_build) {
+    include($$QT_SOURCE_TREE/src/qbase.pri)
+    # Qt will set the version for us when building in Qt's tree
+} else {
+    VERSION = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
     DESTDIR = $$OUTPUT_DIR/lib
     !static: DEFINES += QT_MAKEDLL
 }
@@ -95,16 +99,6 @@
     QMAKE_CXXFLAGS_RELEASE -= -GL
 }
 
-win32-*: DEFINES += _HAS_TR1=0
-wince* {
-#    DEFINES += ENABLE_SVG=0 ENABLE_XPATH=0 ENABLE_XBL=0 \
-#               ENABLE_SVG_ANIMATION=0 ENABLE_SVG_USE=0  \
-#               ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_AS_IMAGE=0
-
-    INCLUDEPATH += $$PWD/../JavaScriptCore/os-wince
-    INCLUDEPATH += $$PWD/../JavaScriptCore/os-win32
-}
-
 # Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
 win32-g++ {
     TMPPATH            = $$quote($$(INCLUDE))
@@ -125,17 +119,32 @@
     RESOURCES += $$PWD/../WebCore/inspector/front-end/WebKit.qrc
 }
 
-mameo5|symbian|embedded {
+maemo5|symbian|embedded {
     DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
 }
 
-include($$PWD/../JavaScriptCore/JavaScriptCore.pri)
+maemo5 {
+    DEFINES += ENABLE_NO_LISTBOX_RENDERING=1
+}
 
-# Disable HTML5 media compilation if phonon is unavailable
-!contains(DEFINES, ENABLE_VIDEO=1) {
-    !contains(QT_CONFIG, phonon) {
-        DEFINES -= ENABLE_VIDEO=1
-        DEFINES += ENABLE_VIDEO=0
+include($$PWD/../JavaScriptCore/JavaScriptCore.pri)
+addJavaScriptCoreLib(../JavaScriptCore)
+
+
+# HTML5 Media Support
+# We require phonon for versions of Qt < 4.7
+# We require QtMultimedia for versions of Qt >= 4.7
+!contains(DEFINES, ENABLE_VIDEO=.) {
+    DEFINES -= ENABLE_VIDEO=1
+    DEFINES += ENABLE_VIDEO=0
+
+    lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, phonon) {
+        DEFINES -= ENABLE_VIDEO=0
+        DEFINES += ENABLE_VIDEO=1
+    }
+    !lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, multimedia) {
+        DEFINES -= ENABLE_VIDEO=0
+        DEFINES += ENABLE_VIDEO=1
     }
 }
 
@@ -243,6 +252,7 @@
     accessibility/AccessibilityList.cpp \    
     accessibility/AccessibilityListBox.cpp \    
     accessibility/AccessibilityListBoxOption.cpp \    
+    accessibility/AccessibilityProgressIndicator.cpp \    
     accessibility/AccessibilityRenderObject.cpp \    
     accessibility/AccessibilityScrollbar.cpp \
     accessibility/AccessibilitySlider.cpp \    
@@ -256,6 +266,8 @@
     accessibility/AccessibilityTableRow.cpp \    
     accessibility/AXObjectCache.cpp \
     bindings/js/GCController.cpp \
+    bindings/js/DOMObjectHashTableMap.cpp \
+    bindings/js/DOMWrapperWorld.cpp \
     bindings/js/JSCallbackData.cpp \
     bindings/js/JSAttrCustom.cpp \
     bindings/js/JSCDATASectionCustom.cpp \
@@ -274,12 +286,16 @@
     bindings/js/JSCustomXPathNSResolver.cpp \
     bindings/js/JSDataGridColumnListCustom.cpp \
     bindings/js/JSDataGridDataSource.cpp \
+    bindings/js/JSDebugWrapperSet.cpp \
+    bindings/js/JSDesktopNotificationsCustom.cpp \
     bindings/js/JSDocumentCustom.cpp \
     bindings/js/JSDocumentFragmentCustom.cpp \
+    bindings/js/JSDOMFormDataCustom.cpp \
     bindings/js/JSDOMGlobalObject.cpp \
     bindings/js/JSDOMWindowBase.cpp \
     bindings/js/JSDOMWindowCustom.cpp \
     bindings/js/JSDOMWindowShell.cpp \
+    bindings/js/JSDOMWrapper.cpp \
     bindings/js/JSElementCustom.cpp \
     bindings/js/JSEventCustom.cpp \
     bindings/js/JSEventSourceConstructor.cpp \
@@ -317,6 +333,7 @@
     bindings/js/JSNodeIteratorCustom.cpp \
     bindings/js/JSNodeListCustom.cpp \
     bindings/js/JSOptionConstructor.cpp \
+    bindings/js/JSScriptProfileNodeCustom.cpp \
     bindings/js/JSStyleSheetCustom.cpp \
     bindings/js/JSStyleSheetListCustom.cpp \
     bindings/js/JSTextCustom.cpp \
@@ -339,10 +356,7 @@
     bindings/js/JSLazyEventListener.cpp \
     bindings/js/JSPluginElementFunctions.cpp \
     bindings/js/JSPopStateEventCustom.cpp \
-    bindings/js/JavaScriptProfile.h \
-    bindings/js/JavaScriptProfileNode.h \
-    bindings/js/JavaScriptProfile.cpp \
-    bindings/js/JavaScriptProfileNode.cpp \
+    bindings/js/JSWorkerContextErrorHandler.cpp \
     bindings/js/ScriptArray.cpp \
     bindings/js/ScriptCachedFrameData.cpp \
     bindings/js/ScriptCallFrame.cpp \
@@ -352,7 +366,6 @@
     bindings/js/ScriptEventListener.cpp \
     bindings/js/ScriptFunctionCall.cpp \
     bindings/js/ScriptObject.cpp \
-    bindings/js/ScriptProfiler.cpp \
     bindings/js/ScriptState.cpp \
     bindings/js/ScriptValue.cpp \
     bindings/js/ScheduledAction.cpp \
@@ -365,6 +378,7 @@
     bridge/runtime_method.cpp \
     bridge/runtime_object.cpp \
     bridge/runtime_root.cpp \
+    bridge/c/CRuntimeObject.cpp \
     bridge/c/c_class.cpp \
     bridge/c/c_instance.cpp \
     bridge/c/c_runtime.cpp \
@@ -436,6 +450,7 @@
     dom/BeforeTextInsertedEvent.cpp \
     dom/BeforeUnloadEvent.cpp \
     dom/CDATASection.cpp \
+    dom/CanvasSurface.cpp \
     dom/CharacterData.cpp \
     dom/CheckedRadioButtons.cpp \
     dom/ChildNodeList.cpp \
@@ -448,6 +463,7 @@
     dom/CompositionEvent.cpp \
     dom/ContainerNode.cpp \
     dom/CSSMappedAttributeDeclaration.cpp \
+    dom/CustomEvent.cpp \
     dom/Document.cpp \
     dom/DocumentFragment.cpp \
     dom/DocumentType.cpp \
@@ -511,6 +527,8 @@
     dom/TreeWalker.cpp \
     dom/UIEvent.cpp \
     dom/UIEventWithKeyState.cpp \
+    dom/UserGestureIndicator.cpp \
+    dom/ViewportArguments.cpp \
     dom/WebKitAnimationEvent.cpp \
     dom/WebKitTransitionEvent.cpp \
     dom/WheelEvent.cpp \
@@ -582,8 +600,12 @@
     html/DataGridColumnList.cpp \
     html/DateComponents.cpp \
     html/DOMDataGridDataSource.cpp \
+    html/DOMFormData.cpp \
     html/File.cpp \
     html/FileList.cpp \
+    html/FileStream.cpp \
+    html/FileStreamProxy.cpp \
+    html/FileThread.cpp \
     html/FormDataList.cpp \
     html/HTMLAllCollection.cpp \
     html/HTMLAnchorElement.cpp \
@@ -649,6 +671,7 @@
     html/HTMLPlugInElement.cpp \
     html/HTMLPlugInImageElement.cpp \
     html/HTMLPreElement.cpp \
+    html/HTMLProgressElement.cpp \
     html/HTMLQuoteElement.cpp \
     html/HTMLScriptElement.cpp \
     html/HTMLSelectElement.cpp \
@@ -668,6 +691,7 @@
     html/HTMLViewSourceDocument.cpp \
     html/ImageData.cpp \
     html/PreloadScanner.cpp \
+    html/StepRange.cpp \
     html/ValidityState.cpp \
     inspector/ConsoleMessage.cpp \
     inspector/InjectedScript.cpp \
@@ -678,6 +702,7 @@
     inspector/InspectorDOMAgent.cpp \
     inspector/InspectorDOMStorageResource.cpp \
     inspector/InspectorFrontend.cpp \
+    inspector/InspectorFrontendClientLocal.cpp \
     inspector/InspectorFrontendHost.cpp \
     inspector/InspectorResource.cpp \
     inspector/InspectorTimelineAgent.cpp \
@@ -699,6 +724,7 @@
     loader/DocLoader.cpp \
     loader/DocumentLoader.cpp \
     loader/DocumentThreadableLoader.cpp \
+    loader/DocumentWriter.cpp \
     loader/FormState.cpp \
     loader/FrameLoader.cpp \
     loader/HistoryController.cpp \
@@ -725,6 +751,8 @@
     loader/TextDocument.cpp \
     loader/TextResourceDecoder.cpp \
     loader/ThreadableLoader.cpp \
+    notifications/Notification.cpp \
+    notifications/NotificationCenter.cpp \
     page/animation/AnimationBase.cpp \
     page/animation/AnimationController.cpp \
     page/animation/CompositeAnimation.cpp \
@@ -748,6 +776,7 @@
     page/FrameView.cpp \
     page/Geolocation.cpp \
     page/GeolocationController.cpp \
+    page/GeolocationPositionCache.cpp \
     page/History.cpp \
     page/Location.cpp \
     page/MouseEventWithHitTestResults.cpp \
@@ -760,6 +789,7 @@
     page/SecurityOrigin.cpp \
     page/Screen.cpp \
     page/Settings.cpp \
+    page/SpatialNavigation.cpp \
     page/UserContentURLPattern.cpp \
     page/WindowFeatures.cpp \
     page/XSSAuditor.cpp \
@@ -772,13 +802,11 @@
     platform/animation/Animation.cpp \
     platform/animation/AnimationList.cpp \
     platform/Arena.cpp \
-    platform/text/AtomicString.cpp \
     platform/text/Base64.cpp \
     platform/text/BidiContext.cpp \
     platform/ContentType.cpp \
     platform/ContextMenu.cpp \
     platform/CrossThreadCopier.cpp \
-    platform/text/CString.cpp \
     platform/DeprecatedPtrListImpl.cpp \
     platform/DragData.cpp \
     platform/DragImage.cpp \
@@ -812,6 +840,7 @@
     platform/graphics/Pen.cpp \
     platform/graphics/SegmentedFontData.cpp \
     platform/graphics/SimpleFontData.cpp \
+    platform/graphics/TiledBackingStore.cpp \
     platform/graphics/transforms/AffineTransform.cpp \
     platform/graphics/transforms/TransformationMatrix.cpp \
     platform/graphics/transforms/MatrixTransformOperation.cpp \
@@ -848,7 +877,6 @@
     platform/SharedBuffer.cpp \
     platform/text/String.cpp \
     platform/text/StringBuilder.cpp \
-    platform/text/StringImpl.cpp \
     platform/text/TextCodec.cpp \
     platform/text/TextCodecLatin1.cpp \
     platform/text/TextCodecUserDefined.cpp \
@@ -861,6 +889,7 @@
     platform/ThreadTimers.cpp \
     platform/Timer.cpp \
     platform/text/UnicodeRange.cpp \
+    platform/UUID.cpp \
     platform/Widget.cpp \
     plugins/PluginDatabase.cpp \
     plugins/PluginDebug.cpp \
@@ -894,8 +923,10 @@
     rendering/RenderFileUploadControl.cpp \
     rendering/RenderFlexibleBox.cpp \
     rendering/RenderFrame.cpp \
+    rendering/RenderFrameBase.cpp \
     rendering/RenderFrameSet.cpp \
     rendering/RenderHTMLCanvas.cpp \
+    rendering/RenderIFrame.cpp \
     rendering/RenderImage.cpp \
     rendering/RenderImageGeneratedContent.cpp \
     rendering/RenderInline.cpp \
@@ -909,7 +940,7 @@
     rendering/RenderObject.cpp \
     rendering/RenderObjectChildList.cpp \
     rendering/RenderPart.cpp \
-    rendering/RenderPartObject.cpp \
+    rendering/RenderProgress.cpp \
     rendering/RenderReplaced.cpp \
     rendering/RenderReplica.cpp \
     rendering/RenderRuby.cpp \
@@ -963,6 +994,7 @@
     rendering/style/StyleVisualData.cpp \
     xml/DOMParser.cpp \
     xml/XMLHttpRequest.cpp \
+    xml/XMLHttpRequestProgressEventThrottle.cpp \
     xml/XMLHttpRequestUpload.cpp \
     xml/XMLSerializer.cpp 
 
@@ -976,6 +1008,7 @@
     accessibility/AccessibilityList.h \
     accessibility/AccessibilityMediaControls.h \
     accessibility/AccessibilityObject.h \
+    accessibility/AccessibilityProgressIndicator.h \
     accessibility/AccessibilityRenderObject.h \
     accessibility/AccessibilityScrollbar.h \
     accessibility/AccessibilitySlider.h \
@@ -987,6 +1020,8 @@
     accessibility/AXObjectCache.h \
     bindings/js/CachedScriptSourceProvider.h \
     bindings/js/GCController.h \
+    bindings/js/DOMObjectHashTableMap.h \
+    bindings/js/DOMWrapperWorld.h \
     bindings/js/JSCallbackData.h \
     bindings/js/JSAudioConstructor.h \
     bindings/js/JSCSSStyleDeclarationCustom.h \
@@ -998,13 +1033,16 @@
     bindings/js/JSCustomSQLTransactionErrorCallback.h \
     bindings/js/JSCustomVoidCallback.h \
     bindings/js/JSCustomXPathNSResolver.h \
+    bindings/js/JSDatabaseCallback.h \
     bindings/js/JSDataGridDataSource.h \
+    bindings/js/JSDebugWrapperSet.h \
     bindings/js/JSDOMBinding.h \
     bindings/js/JSDOMGlobalObject.h \
     bindings/js/JSDOMWindowBase.h \
     bindings/js/JSDOMWindowBase.h \
     bindings/js/JSDOMWindowCustom.h \
     bindings/js/JSDOMWindowShell.h \
+    bindings/js/JSDOMWrapper.h \
     bindings/js/JSEventListener.h \
     bindings/js/JSEventSourceConstructor.h \
     bindings/js/JSEventTarget.h \
@@ -1018,6 +1056,7 @@
     bindings/js/JSLazyEventListener.h \
     bindings/js/JSLocationCustom.h \
     bindings/js/JSMessageChannelConstructor.h \
+    bindings/js/JSNodeCustom.h \
     bindings/js/JSNodeFilterCondition.h \
     bindings/js/JSOptionConstructor.h \
     bindings/js/JSPluginElementFunctions.h \
@@ -1027,9 +1066,10 @@
     bindings/js/JSWebKitPointConstructor.h \
     bindings/js/JSWorkerConstructor.h \
     bindings/js/JSWorkerContextBase.h \
-    bindings/js/JSWorkerContextBase.h \
+    bindings/js/JSWorkerContextErrorHandler.h \
     bindings/js/JSXMLHttpRequestConstructor.h \
     bindings/js/JSXSLTProcessorConstructor.h \
+    bindings/js/JavaScriptCallFrame.h \
     bindings/js/ScheduledAction.h \
     bindings/js/ScriptArray.h \
     bindings/js/ScriptCachedFrameData.h \
@@ -1038,7 +1078,11 @@
     bindings/js/ScriptController.h \
     bindings/js/ScriptEventListener.h \
     bindings/js/ScriptFunctionCall.h \
+    bindings/js/ScriptGCEvent.h \
     bindings/js/ScriptObject.h \
+    bindings/js/ScriptProfile.h \
+    bindings/js/ScriptProfileNode.h \
+    bindings/js/ScriptProfiler.h \
     bindings/js/ScriptSourceCode.h \
     bindings/js/ScriptSourceProvider.h \
     bindings/js/ScriptState.h \
@@ -1046,8 +1090,10 @@
     bindings/js/ScriptWrappable.h \
     bindings/js/SerializedScriptValue.h \
     bindings/js/StringSourceProvider.h \
+    bindings/js/WebCoreJSClientData.h \
     bindings/js/WorkerScriptController.h \
     bridge/Bridge.h \
+    bridge/c/CRuntimeObject.h \
     bridge/c/c_class.h \
     bridge/c/c_instance.h \
     bridge/c/c_runtime.h \
@@ -1141,6 +1187,7 @@
     dom/Comment.h \
     dom/ContainerNode.h \
     dom/CSSMappedAttributeDeclaration.h \
+    dom/CustomEvent.h \
     dom/default/PlatformMessagePortChannel.h \
     dom/DocumentFragment.h \
     dom/Document.h \
@@ -1204,6 +1251,8 @@
     dom/TreeWalker.h \
     dom/UIEvent.h \
     dom/UIEventWithKeyState.h \
+    dom/UserGestureIndicator.h \
+    dom/ViewportArguments.h \
     dom/WebKitAnimationEvent.h \
     dom/WebKitTransitionEvent.h \
     dom/WheelEvent.h \
@@ -1270,8 +1319,14 @@
     html/DataGridColumnList.h \
     html/DateComponents.h \
     html/DOMDataGridDataSource.h \
+    html/DOMFormData.h \
     html/File.h \
     html/FileList.h \
+    html/FileStream.h \
+    html/FileStreamClient.h \
+    html/FileStreamProxy.h \
+    html/FileThread.h \
+    html/FileThreadTask.h \
     html/FormDataList.h \
     html/HTMLAllCollection.h \
     html/HTMLAnchorElement.h \
@@ -1339,6 +1394,7 @@
     html/HTMLPlugInElement.h \
     html/HTMLPlugInImageElement.h \
     html/HTMLPreElement.h \
+    html/HTMLProgressElement.h \
     html/HTMLQuoteElement.h \
     html/HTMLScriptElement.h \
     html/HTMLSelectElement.h \
@@ -1360,6 +1416,7 @@
     html/HTMLViewSourceDocument.h \
     html/ImageData.h \
     html/PreloadScanner.h \
+    html/StepRange.h \
     html/TimeRanges.h \
     html/ValidityState.h \
     inspector/ConsoleMessage.h \
@@ -1370,11 +1427,12 @@
     inspector/InspectorDatabaseResource.h \
     inspector/InspectorDOMStorageResource.h \
     inspector/InspectorFrontend.h \
+    inspector/InspectorFrontendClient.h \
+    inspector/InspectorFrontendClientLocal.h \
     inspector/InspectorFrontendHost.h \
     inspector/InspectorResource.h \
     inspector/InspectorTimelineAgent.h \
-    inspector/JavaScriptCallFrame.h \
-    inspector/JavaScriptDebugServer.h \
+    inspector/ScriptGCEventListener.h \
     inspector/TimelineRecordFactory.h \
     loader/appcache/ApplicationCacheGroup.h \
     loader/appcache/ApplicationCacheHost.h \
@@ -1425,6 +1483,10 @@
     loader/TextResourceDecoder.h \
     loader/ThreadableLoader.h \
     loader/WorkerThreadableLoader.h \
+    notifications/Notification.h \
+    notifications/NotificationCenter.h \
+    notifications/NotificationPresenter.h \
+    notifications/NotificationContents.h \
     page/animation/AnimationBase.h \
     page/animation/AnimationController.h \
     page/animation/CompositeAnimation.h \
@@ -1447,6 +1509,7 @@
     page/FrameTree.h \
     page/FrameView.h \
     page/Geolocation.h \
+    page/GeolocationPositionCache.h \
     page/Geoposition.h \
     page/HaltablePlugin.h \
     page/History.h \
@@ -1463,9 +1526,11 @@
     page/Screen.h \
     page/SecurityOrigin.h \
     page/Settings.h \
+    page/SpatialNavigation.h \
     page/WindowFeatures.h \
     page/WorkerNavigator.h \
     page/XSSAuditor.h \
+    page/ZoomMode.h \
     platform/animation/Animation.h \
     platform/animation/AnimationList.h \
     platform/Arena.h \
@@ -1504,6 +1569,8 @@
     platform/graphics/GraphicsTypes.h \
     platform/graphics/Image.h \
     platform/graphics/ImageSource.h \
+    platform/graphics/IntPoint.h \
+    platform/graphics/IntPointHash.h \
     platform/graphics/IntRect.h \
     platform/graphics/MediaPlayer.h \
     platform/graphics/Path.h \
@@ -1515,6 +1582,9 @@
     platform/graphics/qt/StillImageQt.h \
     platform/graphics/SegmentedFontData.h \
     platform/graphics/SimpleFontData.h \
+    platform/graphics/Tile.h \
+    platform/graphics/TiledBackingStore.h \    
+    platform/graphics/TiledBackingStoreClient.h \
     platform/graphics/transforms/Matrix3DTransformOperation.h \
     platform/graphics/transforms/MatrixTransformOperation.h \
     platform/graphics/transforms/PerspectiveTransformOperation.h \
@@ -1548,6 +1618,7 @@
     platform/qt/ClipboardQt.h \
     platform/qt/QWebPageClient.h \
     platform/qt/QtAbstractWebPopup.h \
+    platform/qt/QtStyleOptionWebComboBox.h \
     platform/qt/RenderThemeQt.h \
     platform/qt/ScrollbarThemeQt.h \
     platform/Scrollbar.h \
@@ -1562,7 +1633,6 @@
     platform/text/AtomicString.h \
     platform/text/Base64.h \
     platform/text/BidiContext.h \
-    platform/text/CString.h \
     platform/text/qt/TextCodecQt.h \
     platform/text/RegularExpression.h \
     platform/text/SegmentedString.h \
@@ -1620,8 +1690,10 @@
     rendering/RenderFlexibleBox.h \
     rendering/RenderForeignObject.h \
     rendering/RenderFrame.h \
+    rendering/RenderFrameBase.h \
     rendering/RenderFrameSet.h \
     rendering/RenderHTMLCanvas.h \
+    rendering/RenderIFrame.h \
     rendering/RenderImageGeneratedContent.h \
     rendering/RenderImage.h \
     rendering/RenderInline.h \
@@ -1636,8 +1708,8 @@
     rendering/RenderObjectChildList.h \
     rendering/RenderObject.h \
     rendering/RenderPart.h \
-    rendering/RenderPartObject.h \
     rendering/RenderPath.h \
+    rendering/RenderProgress.h \
     rendering/RenderReplaced.h \
     rendering/RenderReplica.h \
     rendering/RenderRuby.h \
@@ -1657,6 +1729,9 @@
     rendering/RenderSVGInlineText.h \
     rendering/RenderSVGModelObject.h \
     rendering/RenderSVGResource.h \
+    rendering/RenderSVGResourceClipper.h \
+    rendering/RenderSVGResourceFilter.h \
+    rendering/RenderSVGResourceMarker.h \
     rendering/RenderSVGResourceMasker.h \
     rendering/RenderSVGRoot.h \
     rendering/RenderSVGShadowTreeRootContainer.h \
@@ -1745,10 +1820,7 @@
     svg/graphics/SVGPaintServerPattern.h \
     svg/graphics/SVGPaintServerRadialGradient.h \
     svg/graphics/SVGPaintServerSolid.h \
-    svg/graphics/SVGResourceClipper.h \
-    svg/graphics/SVGResourceFilter.h \
     svg/graphics/SVGResource.h \
-    svg/graphics/SVGResourceMarker.h \
     svg/SVGAElement.h \
     svg/SVGAltGlyphElement.h \
     svg/SVGAngle.h \
@@ -1958,6 +2030,7 @@
     $$PWD/../WebKit/qt/Api/qwebplugindatabase_p.h \
     $$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
     $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
+    $$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
     $$PWD/platform/network/qt/DnsPrefetchHelper.h
 
 SOURCES += \
@@ -2008,6 +2081,7 @@
     platform/graphics/qt/FontCustomPlatformDataQt.cpp \
     platform/graphics/qt/GlyphPageTreeNodeQt.cpp \
     platform/graphics/qt/SimpleFontDataQt.cpp \
+    platform/graphics/qt/TileQt.cpp \
     platform/qt/KURLQt.cpp \
     platform/qt/Localizations.cpp \
     platform/qt/MIMETypeRegistryQt.cpp \
@@ -2027,7 +2101,6 @@
     platform/qt/SharedTimerQt.cpp \
     platform/qt/SoundQt.cpp \
     platform/qt/LoggingQt.cpp \
-    platform/text/qt/StringQt.cpp \
     platform/qt/TemporaryLinkStubs.cpp \
     platform/text/qt/TextBoundariesQt.cpp \
     platform/text/qt/TextBreakIteratorQt.cpp \
@@ -2039,10 +2112,12 @@
     ../WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/DragClientQt.cpp \
+    ../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
     ../WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/EditCommandQt.cpp \
     ../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
     ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
+    ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
     ../WebKit/qt/Api/qwebframe.cpp \
     ../WebKit/qt/Api/qgraphicswebview.cpp \
     ../WebKit/qt/Api/qwebpage.cpp \
@@ -2058,6 +2133,15 @@
     ../WebKit/qt/Api/qwebinspector.cpp \
     ../WebKit/qt/Api/qwebkitversion.cpp
 
+maemo5 {
+    HEADERS += \
+        ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h \
+        platform/qt/Maemo5Webstyle.h
+    SOURCES += \
+        ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp \
+        platform/qt/Maemo5Webstyle.cpp
+}
+
 
     win32-*|wince*: SOURCES += platform/win/SystemTimeWin.cpp \
                                platform/graphics/win/TransformationMatrixWin.cpp
@@ -2073,8 +2157,8 @@
 
     win32-* {
         LIBS += -lgdi32
+        LIBS += -lOle32
         LIBS += -luser32
-        LIBS += -lwinmm
     }
     wince*: LIBS += -lmmtimer
 
@@ -2127,12 +2211,12 @@
             INCLUDEPATH += $$PWD/plugins/win \
                            $$PWD/platform/win
     
-            SOURCES += page/win/PageWin.cpp \
-                       plugins/win/PluginDatabaseWin.cpp \
+            SOURCES += plugins/win/PluginDatabaseWin.cpp \
                        plugins/win/PluginPackageWin.cpp \
                        plugins/win/PluginMessageThrottlerWin.cpp \
                        plugins/win/PluginViewWin.cpp \
-                       platform/win/BitmapInfo.cpp
+                       platform/win/BitmapInfo.cpp \
+                       platform/win/WebCoreInstanceHandle.cpp
     
             LIBS += \
                 -ladvapi32 \
@@ -2200,6 +2284,7 @@
         bindings/js/JSCustomSQLStatementErrorCallback.cpp \
         bindings/js/JSCustomSQLTransactionCallback.cpp \
         bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
+        bindings/js/JSDatabaseCallback.cpp \
         bindings/js/JSDatabaseCustom.cpp \
         bindings/js/JSSQLResultSetRowListCustom.cpp \
         bindings/js/JSSQLTransactionCustom.cpp
@@ -2210,6 +2295,7 @@
         storage/ChangeVersionWrapper.h \
         storage/DatabaseAuthorizer.h \
         storage/Database.h \
+        storage/DatabaseCallback.h \
         storage/DatabaseTask.h \
         storage/DatabaseThread.h \
         storage/DatabaseTracker.h \
@@ -2305,21 +2391,29 @@
         rendering/RenderMedia.cpp \
         bindings/js/JSAudioConstructor.cpp
 
-        HEADERS += \
-            platform/graphics/qt/MediaPlayerPrivatePhonon.h
+        # QtMultimedia since 4.7
+        greaterThan(QT_MINOR_VERSION, 6) {
+            HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
+            SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
 
-        SOURCES += \
-            platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+            QT += multimedia
+        } else {
+            HEADERS += \
+                platform/graphics/qt/MediaPlayerPrivatePhonon.h
 
-        # Add phonon manually to prevent it from coming first in
-        # the include paths, as Phonon's path.h conflicts with
-        # WebCore's Path.h on case-insensitive filesystems.
-        qtAddLibrary(phonon)
-        INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon
-        INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon
-        mac {
-            INCLUDEPATH -= $$QMAKE_LIBDIR_QT/phonon.framework/Headers
-            INCLUDEPATH += $$QMAKE_LIBDIR_QT/phonon.framework/Headers
+            SOURCES += \
+                platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+
+            # Add phonon manually to prevent it from coming first in
+            # the include paths, as Phonon's path.h conflicts with
+            # WebCore's Path.h on case-insensitive filesystems.
+            qtAddLibrary(phonon)
+            INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon
+            INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon
+            mac {
+                INCLUDEPATH -= $$QMAKE_LIBDIR_QT/phonon.framework/Headers
+                INCLUDEPATH += $$QMAKE_LIBDIR_QT/phonon.framework/Headers
+            }
         }
 
 }
@@ -2595,10 +2689,7 @@
         svg/graphics/SVGPaintServerPattern.cpp \
         svg/graphics/SVGPaintServerRadialGradient.cpp \
         svg/graphics/SVGPaintServerSolid.cpp \
-        svg/graphics/SVGResourceClipper.cpp \
         svg/graphics/SVGResource.cpp \
-        svg/graphics/SVGResourceFilter.cpp \
-        svg/graphics/SVGResourceMarker.cpp \
         rendering/RenderForeignObject.cpp \
         rendering/RenderPath.cpp \
         rendering/RenderSVGBlock.cpp \
@@ -2609,6 +2700,9 @@
         rendering/RenderSVGInline.cpp \
         rendering/RenderSVGInlineText.cpp \
         rendering/RenderSVGModelObject.cpp \
+        rendering/RenderSVGResourceClipper.cpp \
+        rendering/RenderSVGResourceFilter.cpp \
+        rendering/RenderSVGResourceMarker.cpp \
         rendering/RenderSVGResourceMasker.cpp \
         rendering/RenderSVGRoot.cpp \
         rendering/RenderSVGShadowTreeRootContainer.cpp \
@@ -2629,8 +2723,8 @@
 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1) {
     SOURCES += \
         bindings/js/JSJavaScriptCallFrameCustom.cpp \
-        inspector/JavaScriptCallFrame.cpp \
-        inspector/JavaScriptDebugServer.cpp \
+        bindings/js/ScriptProfiler.cpp \
+        bindings/js/JavaScriptCallFrame.cpp \
 }
 
 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1) {
@@ -2646,61 +2740,157 @@
 }
 
 contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
-HEADERS += \
-    platform/network/qt/SocketStreamHandlePrivate.h \
+    HEADERS += \
+        websockets/ThreadableWebSocketChannel.h \
+        websockets/ThreadableWebSocketChannelClientWrapper.h \
+        websockets/WebSocket.h \
+        websockets/WebSocketChannel.h \
+        websockets/WebSocketChannelClient.h \
+        websockets/WebSocketHandshake.h \
+        websockets/WebSocketHandshakeRequest.h \
+        platform/network/qt/SocketStreamHandlePrivate.h
 
-SOURCES += \
-    websockets/WebSocket.cpp \
-    websockets/WebSocketChannel.cpp \
-    websockets/WebSocketHandshake.cpp \
-    websockets/ThreadableWebSocketChannel.cpp \
-    platform/network/SocketStreamErrorBase.cpp \
-    platform/network/SocketStreamHandleBase.cpp \
-    platform/network/qt/SocketStreamHandleQt.cpp \
-    bindings/js/JSWebSocketCustom.cpp \
-    bindings/js/JSWebSocketConstructor.cpp
+    SOURCES += \
+        websockets/WebSocket.cpp \
+        websockets/WebSocketChannel.cpp \
+        websockets/WebSocketHandshake.cpp \
+        websockets/WebSocketHandshakeRequest.cpp \
+        websockets/ThreadableWebSocketChannel.cpp \
+        platform/network/SocketStreamErrorBase.cpp \
+        platform/network/SocketStreamHandleBase.cpp \
+        platform/network/qt/SocketStreamHandleQt.cpp \
+        bindings/js/JSWebSocketCustom.cpp \
+        bindings/js/JSWebSocketConstructor.cpp
 
-contains(DEFINES, ENABLE_WORKERS=1) {
-SOURCES += \
-    websockets/WorkerThreadableWebSocketChannel.cpp
+    contains(DEFINES, ENABLE_WORKERS=1) {
+        HEADERS += \
+            websockets/WorkerThreadableWebSocketChannel.h
+
+        SOURCES += \
+            websockets/WorkerThreadableWebSocketChannel.cpp
+    }
 }
+
+contains(DEFINES, ENABLE_3D_CANVAS=1) {
+QT += opengl
+HEADERS += \
+	bindings/js/JSWebGLArrayBufferConstructor.h \
+	bindings/js/JSWebGLArrayHelper.h \
+	bindings/js/JSWebGLByteArrayConstructor.h \
+	bindings/js/JSWebGLFloatArrayConstructor.h \
+	bindings/js/JSWebGLIntArrayConstructor.h \
+	bindings/js/JSWebGLShortArrayConstructor.h \
+	bindings/js/JSWebGLUnsignedByteArrayConstructor.h \
+	bindings/js/JSWebGLUnsignedIntArrayConstructor.h \
+	bindings/js/JSWebGLUnsignedShortArrayConstructor.h \
+	html/canvas/CanvasContextAttributes.h \
+	html/canvas/CanvasObject.h \
+	html/canvas/WebGLActiveInfo.h \
+	html/canvas/WebGLArrayBuffer.h \
+	html/canvas/WebGLArray.h \
+	html/canvas/WebGLBuffer.h \
+	html/canvas/WebGLByteArray.h \
+	html/canvas/WebGLContextAttributes.h \
+	html/canvas/WebGLFloatArray.h \
+	html/canvas/WebGLFramebuffer.h \
+	html/canvas/WebGLGetInfo.h \
+	html/canvas/WebGLIntArray.h \
+	html/canvas/WebGLProgram.h \
+	html/canvas/WebGLRenderbuffer.h \
+	html/canvas/WebGLRenderingContext.h \
+	html/canvas/WebGLShader.h \
+	html/canvas/WebGLShortArray.h \
+	html/canvas/WebGLTexture.h \
+	html/canvas/WebGLUniformLocation.h \
+	html/canvas/WebGLUnsignedByteArray.h \
+	html/canvas/WebGLUnsignedIntArray.h \
+	html/canvas/WebGLUnsignedShortArray.h \
+    platform/graphics/GraphicsContext3D.h 
+
+SOURCES += \
+	bindings/js/JSWebGLArrayBufferConstructor.cpp \
+	bindings/js/JSWebGLArrayCustom.cpp \
+	bindings/js/JSWebGLByteArrayConstructor.cpp \
+	bindings/js/JSWebGLByteArrayCustom.cpp \
+	bindings/js/JSWebGLFloatArrayConstructor.cpp \
+	bindings/js/JSWebGLFloatArrayCustom.cpp \
+	bindings/js/JSWebGLIntArrayConstructor.cpp \
+	bindings/js/JSWebGLIntArrayCustom.cpp \
+	bindings/js/JSWebGLRenderingContextCustom.cpp \
+	bindings/js/JSWebGLShortArrayConstructor.cpp \
+	bindings/js/JSWebGLShortArrayCustom.cpp \
+	bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp \
+	bindings/js/JSWebGLUnsignedByteArrayCustom.cpp \
+	bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp \
+	bindings/js/JSWebGLUnsignedIntArrayCustom.cpp \
+	bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp \
+	bindings/js/JSWebGLUnsignedShortArrayCustom.cpp \
+	html/canvas/CanvasContextAttributes.cpp \
+    html/canvas/CanvasObject.cpp \
+	html/canvas/WebGLArrayBuffer.cpp \
+	html/canvas/WebGLArray.cpp \
+	html/canvas/WebGLBuffer.cpp \
+	html/canvas/WebGLByteArray.cpp \
+	html/canvas/WebGLContextAttributes.cpp \
+	html/canvas/WebGLFloatArray.cpp \
+	html/canvas/WebGLFramebuffer.cpp \
+	html/canvas/WebGLGetInfo.cpp \
+	html/canvas/WebGLIntArray.cpp \
+	html/canvas/WebGLProgram.cpp \
+	html/canvas/WebGLRenderbuffer.cpp \
+	html/canvas/WebGLRenderingContext.cpp \
+	html/canvas/WebGLShader.cpp \
+	html/canvas/WebGLShortArray.cpp \
+	html/canvas/WebGLTexture.cpp \
+	html/canvas/WebGLUniformLocation.cpp \
+	html/canvas/WebGLUnsignedByteArray.cpp \
+	html/canvas/WebGLUnsignedIntArray.cpp \
+	html/canvas/WebGLUnsignedShortArray.cpp \
+    platform/graphics/GraphicsContext3D.cpp \
+    platform/graphics/qt/GraphicsContext3DQt.cpp \
+
+}
+
+contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
+    # this feature requires the S60 platform private BrowserDialogsProvider.h header file
+    # and is therefore not enabled by default but only meant for platform builds.
+    symbian {
+        LIBS += -lbrowserdialogsprovider
+    }
 }
 
 include($$PWD/../WebKit/qt/Api/headers.pri)
-include(../include/QtWebKit/classheaders.pri)
 HEADERS += $$WEBKIT_API_HEADERS
-WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
 
-!symbian {
-    headers.files = $$WEBKIT_INSTALL_HEADERS
-    headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
-    target.path = $$[QT_INSTALL_LIBS]
+!CONFIG(QTDIR_build) {
+    exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
+    WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
 
-    INSTALLS += target headers
-} else {
-    # INSTALLS is not implemented in qmake's s60 generators, copy headers manually
-    inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
-    inst_headers.input = WEBKIT_INSTALL_HEADERS
-    inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
-    QMAKE_EXTRA_COMPILERS += inst_headers
+    !symbian {
+        headers.files = $$WEBKIT_INSTALL_HEADERS
+        headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
+        target.path = $$[QT_INSTALL_LIBS]
 
-    install.depends += compiler_inst_headers_make_all
-    QMAKE_EXTRA_TARGETS += install
-}
+        INSTALLS += target headers
+    } else {
+        # INSTALLS is not implemented in qmake's s60 generators, copy headers manually
+        inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
+        inst_headers.input = WEBKIT_INSTALL_HEADERS
+        inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+        QMAKE_EXTRA_COMPILERS += inst_headers
 
-# Qt will set the version for us when building in Qt's tree
-!CONFIG(QTDIR_build): VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
+        install.depends += compiler_inst_headers_make_all
+        QMAKE_EXTRA_TARGETS += install
+    }
 
-win32-*|wince* {
-    DLLDESTDIR = $$OUTPUT_DIR/bin
-    TARGET = $$qtLibraryTarget($$TARGET)
+    win32-*|wince* {
+        DLLDESTDIR = $$OUTPUT_DIR/bin
+        TARGET = $$qtLibraryTarget($$TARGET)
 
-    dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
-    dlltarget.CONFIG = no_path
-    INSTALLS += dlltarget
-}
-
-!CONFIG(standalone_package) {
+        dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
+        dlltarget.CONFIG = no_path
+        INSTALLS += dlltarget
+    }
 
     unix {
         CONFIG += create_pc create_prl
@@ -2735,8 +2925,7 @@
     }
 }
 
-CONFIG(standalone_package):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
-    # start with 4.5
+CONFIG(QTDIR_build) {
     # Remove the following 2 lines if you want debug information in WebCore
     CONFIG -= separate_debug_info
     CONFIG += no_debug_info
@@ -2776,6 +2965,8 @@
 symbian {
     shared {
         contains(CONFIG, def_files) {
+            DEF_FILE=../WebKit/qt/symbian
+            # defFilePath is for Qt4.6 compatibility
             defFilePath=../WebKit/qt/symbian
         } else {
             MMP_RULES += EXPORTUNFROZEN
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 02d3070..0c624c2 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1251"?>

+<?xml version="1.0" encoding="Windows-1252"?>

 <VisualStudioProject

 	ProjectType="Visual C++"

 	Version="8.00"

@@ -67,7 +67,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -123,7 +123,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -178,7 +178,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -233,7 +233,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -289,7 +289,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 		<Configuration

@@ -344,7 +344,7 @@
 			/>

 			<Tool

 				Name="VCPostBuildEventTool"

-				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

 			/>

 		</Configuration>

 	</Configurations>

@@ -2401,6 +2401,62 @@
 				>

 			</File>

 			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCustomEvent.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_All|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCustomEvent.h"

+				>

+			</File>

+			<File

 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDatabase.cpp"

 				>

 				<FileConfiguration

@@ -2905,6 +2961,62 @@
 				>

 			</File>

 			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMFormData.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_All|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMFormData.h"

+				>

+			</File>

+			<File

 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMImplementation.cpp"

 				>

 				<FileConfiguration

@@ -6885,6 +6997,62 @@
 				>

 			</File>

 			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLProgressElement.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_All|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLProgressElement.h"

+				>

+			</File>

+			<File

 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHTMLQuoteElement.cpp"

 				>

 				<FileConfiguration

@@ -8221,6 +8389,7 @@
 					>

 					<Tool

 						Name="VCCLCompilerTool"

+

 					/>

 				</FileConfiguration>

 				<FileConfiguration

@@ -18665,6 +18834,7 @@
 				</FileConfiguration>

 				<FileConfiguration

 					Name="Debug_All|Win32"

+

 					ExcludedFromBuild="true"

 					>

 					<Tool

@@ -20073,6 +20243,62 @@
 				>

 			</File>

 			<File

+				RelativePath="..\accessibility\AccessibilityProgressIndicator.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_All|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\accessibility\AccessibilityProgressIndicator.h"

+				>

+			</File>

+			<File

 				RelativePath="..\accessibility\AccessibilityRenderObject.cpp"

 				>

 				<FileConfiguration

@@ -20829,6 +21055,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\page\GeolocationPositionCache.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\page\GeolocationPositionCache.h"

+				>

+			</File>

+			<File

 				RelativePath="..\page\Geoposition.h"

 				>

 			</File>

@@ -20985,6 +21219,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\page\SpatialNavigation.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\page\SpatialNavigation.h"

+				>

+			</File>

+			<File

 				RelativePath="..\page\UserContentURLPattern.cpp"

 				>

 			</File>

@@ -21036,6 +21278,10 @@
 				RelativePath="..\page\XSSAuditor.h"

 				>

 			</File>

+			<File

+				RelativePath="..\page\ZoomMode.h"

+				>

+			</File>

 			<Filter

 				Name="win"

 				>

@@ -21103,10 +21349,6 @@
 					RelativePath="..\page\win\FrameWin.h"

 					>

 				</File>

-				<File

-					RelativePath="..\page\win\PageWin.cpp"

-					>

-				</File>

 			</Filter>

 		</Filter>

 		<Filter

@@ -21233,6 +21475,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\loader\DocumentWriter.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\loader\DocumentWriter.h"

+				>

+			</File>

+			<File

 				RelativePath="..\loader\DocumentThreadableLoader.cpp"

 				>

 			</File>

@@ -21977,6 +22227,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\platform\UUID.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\platform\UUID.h"

+				>

+			</File>

+			<File

 				RelativePath="..\platform\Widget.cpp"

 				>

 			</File>

@@ -22278,6 +22536,14 @@
 					>

 				</File>

 				<File

+					RelativePath="..\platform\win\WebCoreInstanceHandle.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\platform\win\WebCoreInstanceHandle.h"

+					>

+				</File>

+				<File

 					RelativePath="..\WebCorePrefix.cpp"

 					>

 					<FileConfiguration

@@ -22596,11 +22862,11 @@
 					>

 				</File>

 				<File

-					RelativePath="..\platform\graphics\GlyphWidthMap.cpp"

+					RelativePath="..\platform\graphics\GlyphMetricsMap.cpp"

 					>

 				</File>

 				<File

-					RelativePath="..\platform\graphics\GlyphWidthMap.h"

+					RelativePath="..\platform\graphics\GlyphMetricsMap.h"

 					>

 				</File>

 				<File

@@ -22879,34 +23145,6 @@
 						</FileConfiguration>

 					</File>

 					<File

-						RelativePath="..\platform\graphics\win\FontDatabase.cpp"

-						>

-						<FileConfiguration

-							Name="Debug_Cairo|Win32"

-							ExcludedFromBuild="true"

-							>

-							<Tool

-								Name="VCCLCompilerTool"

-							/>

-						</FileConfiguration>

-						<FileConfiguration

-							Name="Release_Cairo|Win32"

-							ExcludedFromBuild="true"

-							>

-							<Tool

-								Name="VCCLCompilerTool"

-							/>

-						</FileConfiguration>

-					</File>

-					<File

-						RelativePath="..\platform\graphics\win\FontDatabase.h"

-						>

-					</File>

-					<File

-						RelativePath="..\platform\graphics\win\FontPlatformData.h"

-						>

-					</File>

-					<File

 						RelativePath="..\platform\graphics\win\FontPlatformDataCairoWin.cpp"

 						>

 						<FileConfiguration

@@ -23267,6 +23505,10 @@
 						>

 					</File>

 					<File

+						RelativePath="..\platform\graphics\win\RefCountedHFONT.h"

+						>

+					</File>

+					<File

 						RelativePath="..\platform\graphics\win\SimpleFontDataCairoWin.cpp"

 						>

 						<FileConfiguration

@@ -23447,6 +23689,26 @@
 						</FileConfiguration>

 					</File>

 					<File

+						RelativePath="..\platform\graphics\cg\FontPlatformData.h"

+						>

+						<FileConfiguration

+							Name="Debug_Cairo|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+						<FileConfiguration

+							Name="Release_Cairo|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+					</File>

+					<File

 						RelativePath="..\platform\graphics\cg\GradientCG.cpp"

 						>

 						<FileConfiguration

@@ -23843,6 +24105,42 @@
 						</FileConfiguration>

 					</File>

 					<File

+						RelativePath="..\platform\graphics\cairo\FontPlatformData.h"

+						>

+						<FileConfiguration

+							Name="Debug|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+						<FileConfiguration

+							Name="Release|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+						<FileConfiguration

+							Name="Debug_Internal|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+						<FileConfiguration

+							Name="Debug_All|Win32"

+							ExcludedFromBuild="true"

+							>

+							<Tool

+								Name="VCCustomBuildTool"

+							/>

+						</FileConfiguration>

+					</File>

+					<File

 						RelativePath="..\platform\graphics\cairo\GradientCairo.cpp"

 						>

 						<FileConfiguration

@@ -25376,10 +25674,6 @@
 				Name="text"

 				>

 				<File

-					RelativePath="..\platform\text\AtomicString.cpp"

-					>

-				</File>

-				<File

 					RelativePath="..\platform\text\AtomicString.h"

 					>

 				</File>

@@ -25416,14 +25710,6 @@
 					>

 				</File>

 				<File

-					RelativePath="..\platform\text\CString.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\platform\text\CString.h"

-					>

-				</File>

-				<File

 					RelativePath="..\platform\text\ParserUtilities.h"

 					>

 				</File>

@@ -25468,11 +25754,11 @@
 					>

 				</File>

 				<File

-					RelativePath="..\platform\text\StringImpl.cpp"

+					RelativePath="..\platform\text\StringImpl.h"

 					>

 				</File>

 				<File

-					RelativePath="..\platform\text\StringImpl.h"

+					RelativePath="..\platform\text\SuffixTree.h"

 					>

 				</File>

 				<File

@@ -27057,14 +27343,6 @@
 				>

 			</File>

 			<File

-				RelativePath="..\rendering\break_lines.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\rendering\break_lines.h"

-				>

-			</File>

-                        <File

 				RelativePath="..\rendering\BidiRun.cpp"

 				>

 			</File>

@@ -27073,6 +27351,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\rendering\break_lines.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\break_lines.h"

+				>

+			</File>

+			<File

 				RelativePath="..\rendering\CounterNode.cpp"

 				>

 			</File>

@@ -27128,12 +27414,8 @@
 				RelativePath="..\rendering\InlineFlowBox.h"

 				>

 			</File>

-                        <File

-				RelativePath="..\rendering\InlineIterator.h"

-				>

-			</File>

 			<File

-				RelativePath="..\rendering\InlineRunBox.h"

+				RelativePath="..\rendering\InlineIterator.h"

 				>

 			</File>

 			<File

@@ -27293,6 +27575,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\rendering\RenderFrameBase.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderFrameBase.h"

+				>

+			</File>

+			<File

 				RelativePath="..\rendering\RenderFrameSet.cpp"

 				>

 			</File>

@@ -27309,6 +27599,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\rendering\RenderIFrame.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderIFrame.h"

+				>

+			</File>

+			<File

 				RelativePath="..\rendering\RenderImage.cpp"

 				>

 			</File>

@@ -27477,14 +27775,6 @@
 				>

 			</File>

 			<File

-				RelativePath="..\rendering\RenderPartObject.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\rendering\RenderPartObject.h"

-				>

-			</File>

-			<File

 				RelativePath="..\rendering\RenderPath.cpp"

 				>

 			</File>

@@ -27493,6 +27783,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\rendering\RenderProgress.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderProgress.h"

+				>

+			</File>

+			<File

 				RelativePath="..\rendering\RenderReplaced.cpp"

 				>

 			</File>

@@ -27645,6 +27943,30 @@
 				>

 			</File>

 			<File

+				RelativePath="..\rendering\RenderSVGResourceClipper.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderSVGResourceClipper.h"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderSVGResourceFilter.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderSVGResourceFilter.h"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderSVGResourceMarker.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\rendering\RenderSVGResourceMarker.h"

+				>

+			</File>

+			<File

 				RelativePath="..\rendering\RenderSVGResourceMasker.cpp"

 				>

 			</File>

@@ -28299,6 +28621,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\xml\XMLHttpRequestProgressEventThrottle.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\xml\XMLHttpRequestProgressEventThrottle.h"

+				>

+			</File>

+			<File

 				RelativePath="..\xml\XMLHttpRequestUpload.cpp"

 				>

 			</File>

@@ -28593,6 +28923,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\dom\CanvasSurface.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\dom\CanvasSurface.h"

+				>

+			</File>

+			<File

 				RelativePath="..\dom\CDATASection.cpp"

 				>

 			</File>

@@ -28701,6 +29039,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\dom\CustomEvent.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\dom\CustomEvent.h"

+				>

+			</File>

+			<File

 				RelativePath="..\dom\Document.cpp"

 				>

 			</File>

@@ -29233,6 +29579,22 @@
 				>

 			</File>

 			<File

+				RelativePath="..\dom\UserGestureIndicator.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\dom\UserGestureIndicator.h"

+				>

+			</File>

+			<File

+				RelativePath="..\dom\ViewportArguments.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\dom\ViewportArguments.h"

+				>

+			</File>

+			<File

 				RelativePath="..\dom\WebKitAnimationEvent.cpp"

 				>

 			</File>

@@ -29953,6 +30315,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\html\DOMFormData.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\html\DOMFormData.h"

+				>

+			</File>

+			<File

 				RelativePath="..\html\File.cpp"

 				>

 			</File>

@@ -29969,6 +30339,38 @@
 				>

 			</File>

 			<File

+				RelativePath="..\html\FileStream.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileStream.h"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileStreamClient.h"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileStreamProxy.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileStreamProxy.h"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileThread.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileThread.h"

+				>

+			</File>

+			<File

+				RelativePath="..\html\FileThreadTask.h"

+				>

+			</File>

+			<File

 				RelativePath="..\html\FormDataList.cpp"

 				>

 			</File>

@@ -31359,6 +31761,7 @@
 						Name="VCCLCompilerTool"

 					/>

 				</FileConfiguration>

+

 			</File>

 			<File

 				RelativePath="..\html\HTMLFormElement.h"

@@ -33213,6 +33616,62 @@
 				>

 			</File>

 			<File

+				RelativePath="..\html\HTMLProgressElement.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Internal|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release_Cairo|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug_All|Win32"

+					ExcludedFromBuild="true"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\html\HTMLProgressElement.h"

+				>

+			</File>

+			<File

 				RelativePath="..\html\HTMLQuoteElement.cpp"

 				>

 				<FileConfiguration

@@ -34153,6 +34612,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\html\StepRange.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\html\StepRange.h"

+				>

+			</File>

+			<File

 				RelativePath="..\html\TimeRanges.cpp"

 				>

 			</File>

@@ -34188,10 +34655,26 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\DOMObjectHashTableMap.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\bindings\js\DOMObjectHashTableMap.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\DOMObjectWithSVGContext.h"

 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\DOMWrapperWorld.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\bindings\js\DOMWrapperWorld.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\GCController.cpp"

 					>

 					<FileConfiguration

@@ -35332,6 +35815,14 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSDatabaseCallback.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\bindings\js\JSDatabaseCallback.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSDatabaseCustom.cpp"

 					>

 					<FileConfiguration

@@ -35488,6 +35979,14 @@
 					</FileConfiguration>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSDebugWrapperSet.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\bindings\js\JSDebugWrapperSet.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSDedicatedWorkerContextCustom.cpp"

 					>

 					<FileConfiguration

@@ -35804,6 +36303,10 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSDOMFormDataCustom.cpp"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSDOMGlobalObject.cpp"

 					>

 					<FileConfiguration

@@ -36028,6 +36531,14 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSDOMWrapper.cpp"

+					>

+				</File>

+				<File

+					RelativePath="..\bindings\js\JSDOMWrapper.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSElementCustom.cpp"

 					>

 					<FileConfiguration

@@ -38100,6 +38611,10 @@
 					</FileConfiguration>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSNodeCustom.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSNodeFilterCondition.cpp"

 					>

 					<FileConfiguration

@@ -39172,6 +39687,58 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSScriptProfileNodeCustom.cpp"

+					>

+					<FileConfiguration

+						Name="Debug|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Release|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_Internal|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_Cairo|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Release_Cairo|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_All|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSTextCustom.cpp"

 					>

 					<FileConfiguration

@@ -39660,6 +40227,61 @@
 					</FileConfiguration>

 				</File>

 				<File

+					RelativePath="..\bindings\js\JSWorkerContextErrorHandler.cpp" >

+					<FileConfiguration

+						Name="Debug|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Release|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_Internal|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_Cairo|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Release_Cairo|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+					<FileConfiguration

+						Name="Debug_All|Win32"

+						ExcludedFromBuild="true"

+						>

+						<Tool

+							Name="VCCLCompilerTool"

+						/>

+					</FileConfiguration>

+				</File>

+				<File

+					RelativePath="..\bindings\js\JSWorkerContextErrorHandler.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\JSXMLHttpRequestConstructor.cpp"

 					>

 					<FileConfiguration

@@ -39928,22 +40550,6 @@
 					</FileConfiguration>

 				</File>

 				<File

-					RelativePath="..\bindings\js\JavaScriptProfile.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\bindings\js\JavaScriptProfile.h"

-					>

-				</File>

-				<File

-					RelativePath="..\bindings\js\JavaScriptProfileNode.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\bindings\js\JavaScriptProfileNode.h"

-					>

-				</File>

-				<File

 					RelativePath="..\bindings\js\ScheduledAction.cpp"

 					>

 					<FileConfiguration

@@ -40596,6 +41202,10 @@
 					>

 				</File>

 				<File

+					RelativePath="..\bindings\js\WebCoreJSClientData.h"

+					>

+				</File>

+				<File

 					RelativePath="..\bindings\js\WorkerScriptController.cpp"

 					>

 					<FileConfiguration

@@ -41776,33 +42386,9 @@
 					>

 				</File>

 				<File

-					RelativePath="..\svg\graphics\SVGResourceClipper.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\svg\graphics\SVGResourceClipper.h"

-					>

-				</File>

-				<File

-					RelativePath="..\svg\graphics\SVGResourceFilter.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\svg\graphics\SVGResourceFilter.h"

-					>

-				</File>

-				<File

 					RelativePath="..\svg\graphics\SVGResourceListener.h"

 					>

 				</File>

-				<File

-					RelativePath="..\svg\graphics\SVGResourceMarker.cpp"

-					>

-				</File>

-				<File

-					RelativePath="..\svg\graphics\SVGResourceMarker.h"

-					>

-				</File>

 				<Filter

 					Name="filters"

 					>

@@ -42063,6 +42649,14 @@
 						</File>

 					</Filter>

 				</Filter>

+				<Filter

+					Name="text"

+					>

+					<File

+						RelativePath="..\ForwardingHeaders\wtf\text\CString.h"

+						>

+					</File>

+				</Filter>

 			</Filter>

 			<Filter

 				Name="JSC"

@@ -42269,6 +42863,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\storage\DatabaseCallback.h"

+				>

+			</File>

+			<File

 				RelativePath="..\storage\DatabaseTask.cpp"

 				>

 			</File>

@@ -42525,6 +43123,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\bridge\c\CRuntimeObject.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\bridge\c\CRuntimeObject.h"

+				>

+			</File>

+			<File

 				RelativePath="..\bridge\IdentifierRep.cpp"

 				>

 			</File>

@@ -42677,6 +43283,18 @@
 				>

 			</File>

 			<File

+				RelativePath="..\inspector\InspectorFrontendClient.h"

+				>

+			</File>

+			<File

+				RelativePath="..\inspector\InspectorFrontendClientLocal.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\inspector\InspectorFrontendClientLocal.h"

+				>

+			</File>

+			<File

 				RelativePath="..\inspector\InspectorFrontendHost.cpp"

 				>

 			</File>

@@ -42701,23 +43319,15 @@
 				>

 			</File>

 			<File

-				RelativePath="..\inspector\JavaScriptCallFrame.cpp"

+				RelativePath="..\inspector\InspectorWorkerResource.h"

 				>

 			</File>

 			<File

-				RelativePath="..\inspector\JavaScriptCallFrame.h"

+				RelativePath="..\inspector\ScriptBreakpoint.h"

 				>

 			</File>

 			<File

-				RelativePath="..\inspector\JavaScriptDebugListener.h"

-				>

-			</File>

-			<File

-				RelativePath="..\inspector\JavaScriptDebugServer.cpp"

-				>

-			</File>

-			<File

-				RelativePath="..\inspector\JavaScriptDebugServer.h"

+				RelativePath="..\inspector\ScriptDebugListener.h"

 				>

 			</File>

 			<File

@@ -42784,6 +43394,10 @@
 					>

 				</File>

 				<File

+					RelativePath="..\inspector\front-end\Checkbox.js"

+					>

+				</File>

+				<File

 					RelativePath="..\inspector\front-end\Color.js"

 					>

 				</File>

@@ -42856,6 +43470,10 @@
 					>

 				</File>

 				<File

+					RelativePath="..\inspector\front-end\InjectedFakeWorker.js"

+					>

+				</File>

+				<File

 					RelativePath="..\inspector\front-end\InjectedScript.js"

 					>

 				</File>

@@ -43040,11 +43658,11 @@
 					>

 				</File>

 				<File

-					RelativePath="..\inspector\front-end\TextViewer.js"

+					RelativePath="..\inspector\front-end\textViewer.css"

 					>

 				</File>

 				<File

-					RelativePath="..\inspector\front-end\textViewer.css"

+					RelativePath="..\inspector\front-end\TextViewer.js"

 					>

 				</File>

 				<File

@@ -43087,6 +43705,10 @@
 					RelativePath="..\inspector\front-end\WelcomeView.js"

 					>

 				</File>

+				<File

+					RelativePath="..\inspector\front-end\WorkersSidebarPane.js"

+					>

+				</File>

 			</Filter>

 		</Filter>

 		<Filter

@@ -43473,6 +44095,14 @@
 				>

 			</File>

 			<File

+				RelativePath="..\websockets\WebSocketHandshakeRequest.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\websockets\WebSocketHandshakeRequest.h"

+				>

+			</File>

+			<File

 				RelativePath="..\websockets\WorkerThreadableWebSocketChannel.cpp"

 				>

 			</File>

diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 289ae48..7f62b04 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -170,6 +170,8 @@
 		0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */; };
 		0B9056F80F2685F30095FF6A /* WorkerThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B9056F60F2685F30095FF6A /* WorkerThreadableLoader.cpp */; };
 		0B9056F90F2685F30095FF6A /* WorkerThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056F70F2685F30095FF6A /* WorkerThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
+		0BC2C7771134A8FC000B2F61 /* CanvasSurface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BC2C7751134A8FC000B2F61 /* CanvasSurface.cpp */; };
+		0BC2C7781134A8FC000B2F61 /* CanvasSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BC2C7761134A8FC000B2F61 /* CanvasSurface.h */; };
 		0BE030A20F3112FB003C1A46 /* RenderLineBoxList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BE030A10F3112FB003C1A46 /* RenderLineBoxList.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0C3F1F5A10C8871200D72CE1 /* WebGLUniformLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C3F1F5710C8871200D72CE1 /* WebGLUniformLocation.cpp */; };
 		0C3F1F5B10C8871200D72CE1 /* WebGLUniformLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C3F1F5810C8871200D72CE1 /* WebGLUniformLocation.h */; };
@@ -191,7 +193,7 @@
 		0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580CFB0F12DE9B0051D689 /* RenderLayerBacking.h */; };
 		0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F580CFC0F12DE9B0051D689 /* RenderLayerBacking.cpp */; };
 		0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; };
-		0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; };
+		0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F6ECD450F252F3700BDE271 /* CSSPropertyLonghand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */; };
 		0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */; };
 		0FC705210EB1815600B90AD8 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC705200EB1815600B90AD8 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -200,6 +202,10 @@
 		0FCF332D0F2B9A25004B6795 /* WebTiledLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCF33290F2B9A25004B6795 /* WebTiledLayer.h */; };
 		0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */; };
 		0FCF332F0F2B9A25004B6795 /* WebLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCF332B0F2B9A25004B6795 /* WebLayer.h */; };
+		0FD3080E117CF7E700A791F7 /* RenderFrameBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3080C117CF7E700A791F7 /* RenderFrameBase.cpp */; };
+		0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3080D117CF7E700A791F7 /* RenderFrameBase.h */; };
+		0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD308D3117D168400A791F7 /* RenderIFrame.cpp */; };
+		0FD308D6117D168500A791F7 /* RenderIFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD308D4117D168400A791F7 /* RenderIFrame.h */; };
 		0FD723820EC8BD9300CA5DD7 /* FloatQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD723800EC8BD9300CA5DD7 /* FloatQuad.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0FD723830EC8BD9300CA5DD7 /* FloatQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD723810EC8BD9300CA5DD7 /* FloatQuad.cpp */; };
 		0FF5025B102BA9010066F39A /* DOMMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50259102BA9010066F39A /* DOMMedia.h */; };
@@ -219,7 +225,7 @@
 		14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */; };
 		1419D2C50CEA6F6100FF507A /* TreeShared.h in Headers */ = {isa = PBXBuildFile; fileRef = 1419D2C40CEA6F6100FF507A /* TreeShared.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */; };
-		142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */; };
+		142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1432E8470C51493800B1500F /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1432E8460C51493800B1500F /* GCController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1432E8490C51493F00B1500F /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1432E8480C51493F00B1500F /* GCController.cpp */; };
 		1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1449E24A107D4A8400B5793F /* JSCallbackData.h */; };
@@ -276,7 +282,7 @@
 		1A22464B0CC98DDB00C05240 /* SQLiteStatement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2246450CC98DDB00C05240 /* SQLiteStatement.cpp */; };
 		1A22464C0CC98DDB00C05240 /* SQLiteStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246460CC98DDB00C05240 /* SQLiteStatement.h */; };
 		1A22464D0CC98DDB00C05240 /* SQLiteTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2246470CC98DDB00C05240 /* SQLiteTransaction.cpp */; };
-		1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */; };
+		1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */; };
 		1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2AAC580DC2A3B100A20D9A /* ApplicationCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */; };
@@ -285,7 +291,7 @@
 		1A2D753D0DE47FAB00F0A648 /* IconFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D753B0DE47FAB00F0A648 /* IconFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2D753E0DE47FAB00F0A648 /* IconFetcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D753C0DE47FAB00F0A648 /* IconFetcher.cpp */; };
 		1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E570CC55213004A2062 /* SQLValue.cpp */; };
-		1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; };
+		1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; };
 		1A3178930B20A81600316987 /* SubresourceLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3178920B20A81600316987 /* SubresourceLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; };
@@ -335,7 +341,7 @@
 		1A569D1E0D7E2B82007C3983 /* runtime_array.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CEF0D7E2B82007C3983 /* runtime_array.cpp */; };
 		1A569D1F0D7E2B82007C3983 /* runtime_array.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF00D7E2B82007C3983 /* runtime_array.h */; };
 		1A569D200D7E2B82007C3983 /* runtime_method.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF10D7E2B82007C3983 /* runtime_method.cpp */; };
-		1A569D210D7E2B82007C3983 /* runtime_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF20D7E2B82007C3983 /* runtime_method.h */; };
+		1A569D210D7E2B82007C3983 /* runtime_method.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF20D7E2B82007C3983 /* runtime_method.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF30D7E2B82007C3983 /* runtime_object.cpp */; };
 		1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A569CF40D7E2B82007C3983 /* runtime_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A569CF50D7E2B82007C3983 /* runtime_root.cpp */; };
@@ -359,11 +365,11 @@
 		1A762C780A074F2600989F5B /* JSXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A762C700A074F2600989F5B /* JSXPathNSResolver.h */; };
 		1A762C790A074F2600989F5B /* JSXPathResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A762C710A074F2600989F5B /* JSXPathResult.cpp */; };
 		1A762C7A0A074F2600989F5B /* JSXPathResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A762C720A074F2600989F5B /* JSXPathResult.h */; };
-		1A7CCB190CD9469A00B7B64E /* SQLStatementCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB150CD9469A00B7B64E /* SQLStatementCallback.h */; };
-		1A7CCB1A0CD9469A00B7B64E /* SQLStatementErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB160CD9469A00B7B64E /* SQLStatementErrorCallback.h */; };
-		1A7CCB1B0CD9469A00B7B64E /* SQLTransactionCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB170CD9469A00B7B64E /* SQLTransactionCallback.h */; };
-		1A7CCB1C0CD9469A00B7B64E /* SQLTransactionErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB180CD9469A00B7B64E /* SQLTransactionErrorCallback.h */; };
-		1A7CCB240CD946FD00B7B64E /* SQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB220CD946FD00B7B64E /* SQLTransaction.h */; };
+		1A7CCB190CD9469A00B7B64E /* SQLStatementCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB150CD9469A00B7B64E /* SQLStatementCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1A7CCB1A0CD9469A00B7B64E /* SQLStatementErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB160CD9469A00B7B64E /* SQLStatementErrorCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1A7CCB1B0CD9469A00B7B64E /* SQLTransactionCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB170CD9469A00B7B64E /* SQLTransactionCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1A7CCB1C0CD9469A00B7B64E /* SQLTransactionErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB180CD9469A00B7B64E /* SQLTransactionErrorCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		1A7CCB240CD946FD00B7B64E /* SQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB220CD946FD00B7B64E /* SQLTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7FA6180DDA3B3A0028F8A5 /* NetworkStateNotifier.h */; };
 		1A7FA61B0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7FA61A0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp */; };
 		1A7FA6490DDA3CBA0028F8A5 /* NetworkStateNotifierMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7FA6470DDA3CBA0028F8A5 /* NetworkStateNotifierMac.cpp */; };
@@ -494,7 +500,7 @@
 		1AE82FED0CAB07EE002237AE /* JSSQLResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE82FEB0CAB07EE002237AE /* JSSQLResultSet.h */; };
 		1AF326790D78B9440068F0C4 /* EditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF326770D78B9440068F0C4 /* EditorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AFE117D0CBFFB36003017FA /* SQLResultSetRowList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE117B0CBFFB36003017FA /* SQLResultSetRowList.cpp */; };
-		1AFE117E0CBFFB36003017FA /* SQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE117C0CBFFB36003017FA /* SQLResultSetRowList.h */; };
+		1AFE117E0CBFFB36003017FA /* SQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE117C0CBFFB36003017FA /* SQLResultSetRowList.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AFE11990CBFFCC4003017FA /* JSSQLResultSetRowList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE11970CBFFCC4003017FA /* JSSQLResultSetRowList.cpp */; };
 		1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
 		1C11CCB50AA6093700DADB20 /* DOMNotation.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85CA96E80A9624E900690CCF /* DOMNotation.h */; };
@@ -533,9 +539,6 @@
 		1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9580E97330800266E07 /* InspectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1C81BA090E97348300266E07 /* JavaScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C81BA030E97348300266E07 /* JavaScriptCallFrame.cpp */; };
 		1C81BA0A0E97348300266E07 /* JavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */; };
-		1C81BA0C0E97348300266E07 /* JavaScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA060E97348300266E07 /* JavaScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		1C81BA0D0E97348300266E07 /* JavaScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C81BA070E97348300266E07 /* JavaScriptDebugServer.cpp */; };
-		1C81BA0E0E97348300266E07 /* JavaScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81BA080E97348300266E07 /* JavaScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1CA19E050DC255950065A994 /* EventLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CA19E030DC255950065A994 /* EventLoopMac.mm */; };
 		1CA19E160DC255CA0065A994 /* EventLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA19E150DC255CA0065A994 /* EventLoop.h */; };
 		1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -560,6 +563,8 @@
 		228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		24F54EAC101FE914000AE741 /* ApplicationCacheHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */; };
 		24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (); }; };
+		2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */; };
+		2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */; };
 		29A812260FBB9C1D00510293 /* AccessibilityRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */; };
 		29A812270FBB9C1D00510293 /* AccessibilityTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A812090FBB9C1D00510293 /* AccessibilityTable.cpp */; };
 		29A812280FBB9C1D00510293 /* AccessibilityARIAGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8120A0FBB9C1D00510293 /* AccessibilityARIAGrid.cpp */; };
@@ -595,6 +600,9 @@
 		29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A812470FBB9CA900510293 /* AXObjectCacheMac.mm */; };
 		2D9066060BE141D400956998 /* LayoutState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9066040BE141D400956998 /* LayoutState.cpp */; };
 		2D9066070BE141D400956998 /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D9066050BE141D400956998 /* LayoutState.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */; };
+		2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0888D31148848A00AF4265 /* JSDOMFormData.h */; };
+		2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */; };
 		2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */; };
 		2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99CC10E2BBDA00496337 /* JSBlob.h */; };
 		2E2D99E710E2BC1C00496337 /* DOMBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E510E2BC1C00496337 /* DOMBlob.h */; };
@@ -602,6 +610,8 @@
 		2E2D99EA10E2BC3800496337 /* DOMBlobInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */; };
 		2E2D99EB10E2BD3900496337 /* DOMBlob.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E510E2BC1C00496337 /* DOMBlob.h */; };
 		2E2D99EC10E2BD3900496337 /* DOMBlobInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */; };
+		2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E3BBF051162DA1100B9409A /* UUID.cpp */; };
+		2E3BBF081162DA1100B9409A /* UUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BBF061162DA1100B9409A /* UUID.h */; };
 		2E4346440F546A8200B0F1BA /* GenericWorkerTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346320F546A8200B0F1BA /* GenericWorkerTask.h */; };
 		2E4346450F546A8200B0F1BA /* Worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346330F546A8200B0F1BA /* Worker.cpp */; };
 		2E4346460F546A8200B0F1BA /* Worker.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346340F546A8200B0F1BA /* Worker.h */; };
@@ -626,6 +636,8 @@
 		2ECF7ADD10162B3800427DE7 /* JSErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADB10162B3800427DE7 /* JSErrorEvent.h */; };
 		2ECF7AE110162B5800427DE7 /* ErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */; };
 		2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADF10162B5800427DE7 /* ErrorEvent.h */; };
+		2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ED609BA1145B07100C8684E /* DOMFormData.cpp */; };
+		2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED609BB1145B07100C8684E /* DOMFormData.h */; };
 		31288E720E3005D6003619AE /* WebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */; };
 		31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */; };
 		31288E740E3005D6003619AE /* WebKitCSSKeyframesRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */; };
@@ -681,6 +693,8 @@
 		3390CA550FFC157B00921962 /* NotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3390CA510FFC157B00921962 /* NotificationCenter.cpp */; };
 		3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; };
 		3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; };
+		33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; };
+		33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; };
 		371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
 		371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */; };
@@ -1033,7 +1047,7 @@
 		514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76680CE923A1007EF3CD /* ResourceRequestBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		514C767E0CE923A1007EF3CD /* ResourceResponseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76690CE923A1007EF3CD /* ResourceResponseBase.cpp */; };
 		514C767F0CE923A1007EF3CD /* ResourceResponseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C766A0CE923A1007EF3CD /* ResourceResponseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		515B03990CD1642A00B7EA9C /* SQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = 515B03970CD1642A00B7EA9C /* SQLStatement.h */; };
+		515B03990CD1642A00B7EA9C /* SQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = 515B03970CD1642A00B7EA9C /* SQLStatement.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		515B039A0CD1642A00B7EA9C /* SQLStatement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515B03980CD1642A00B7EA9C /* SQLStatement.cpp */; };
 		5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; };
 		5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; };
@@ -1054,10 +1068,10 @@
 		518A34C81026C8C9001B6896 /* JSWebSocketConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */; };
 		518A34C91026C8C9001B6896 /* JSWebSocketCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */; };
 		5196116A0CAC56570010A80C /* Database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5196115E0CAC56570010A80C /* Database.cpp */; };
-		5196116B0CAC56570010A80C /* Database.h in Headers */ = {isa = PBXBuildFile; fileRef = 5196115F0CAC56570010A80C /* Database.h */; };
+		5196116B0CAC56570010A80C /* Database.h in Headers */ = {isa = PBXBuildFile; fileRef = 5196115F0CAC56570010A80C /* Database.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5196116D0CAC56570010A80C /* DatabaseThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519611610CAC56570010A80C /* DatabaseThread.cpp */; };
 		519611730CAC56570010A80C /* SQLResultSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519611670CAC56570010A80C /* SQLResultSet.cpp */; };
-		519611740CAC56570010A80C /* SQLResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 519611680CAC56570010A80C /* SQLResultSet.h */; };
+		519611740CAC56570010A80C /* SQLResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 519611680CAC56570010A80C /* SQLResultSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		519611780CAC56A80010A80C /* DatabaseThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 519611620CAC56570010A80C /* DatabaseThread.h */; };
 		519611EA0CAC749C0010A80C /* DatabaseTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 519611E80CAC749C0010A80C /* DatabaseTask.h */; };
 		519611EB0CAC749C0010A80C /* DatabaseTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519611E90CAC749C0010A80C /* DatabaseTask.cpp */; };
@@ -1104,7 +1118,7 @@
 		51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9D40DA05E1D00250911 /* JSStorage.cpp */; };
 		51E4ADB60C42B4CF0042BC55 /* FTPDirectoryDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E4ADB20C42B4CF0042BC55 /* FTPDirectoryDocument.cpp */; };
 		51E4ADB70C42B4CF0042BC55 /* FTPDirectoryDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4ADB30C42B4CF0042BC55 /* FTPDirectoryDocument.h */; };
-		51EC92590CE90DB400F90308 /* SQLError.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EC92570CE90DB400F90308 /* SQLError.h */; };
+		51EC92590CE90DB400F90308 /* SQLError.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EC92570CE90DB400F90308 /* SQLError.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51EC92630CE90DD400F90308 /* JSCustomSQLStatementCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925B0CE90DD400F90308 /* JSCustomSQLStatementCallback.cpp */; };
 		51EC92640CE90DD400F90308 /* JSCustomSQLStatementCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EC925C0CE90DD400F90308 /* JSCustomSQLStatementCallback.h */; };
 		51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */; };
@@ -1119,6 +1133,8 @@
 		550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5913953B110758450083EC55 /* JNIBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5913953A110758450083EC55 /* JNIBridge.h */; };
 		5913953D1107584E0083EC55 /* JNIBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5913953C1107584E0083EC55 /* JNIBridge.cpp */; };
+		596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */; };
+		5962297A1133EFE200DC4CBB /* GeolocationPositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 596229791133EFE200DC4CBB /* GeolocationPositionCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		599E759011055A1F00D904FA /* Bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 599E758F11055A1F00D904FA /* Bridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		59A9E7B01104758800DFB4C1 /* JavaInstanceJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A9E7AF1104758800DFB4C1 /* JavaInstanceJSC.cpp */; };
 		59A9E7B21104759400DFB4C1 /* JavaInstanceJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A9E7B11104759400DFB4C1 /* JavaInstanceJSC.h */; };
@@ -1140,17 +1156,24 @@
 		5D15E3AB0F9E6AC1009E0E3F /* XMLTokenizerScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D15E3A90F9E6AC1009E0E3F /* XMLTokenizerScope.cpp */; };
 		5D15E3AC0F9E6AC1009E0E3F /* XMLTokenizerScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D15E3AA0F9E6AC1009E0E3F /* XMLTokenizerScope.h */; };
 		5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */; };
+		5D88EE9111407FD300BC3ABC /* DOMSVGFEMorphologyElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 84224189107E786F00766A87 /* DOMSVGFEMorphologyElement.h */; };
+		5D88EE9211407FF400BC3ABC /* DOMSVGFEMorphologyElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8422418B107E786F00766A87 /* DOMSVGFEMorphologyElementInternal.h */; };
 		5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */; };
 		5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */; };
 		5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA5E0FB102B953800088CF9 /* JSWebSocket.h */; };
 		5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB1BC6810715A6400EFAA49 /* TransformSource.h */; };
 		5DB1BC6B10715A6400EFAA49 /* TransformSourceLibxslt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */; };
+		5DC87EF011716DF2001C0E6D /* EmptyProtocolDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5DCF836D0D59159800953BC6 /* PluginInfoStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCF836C0D59159800953BC6 /* PluginInfoStore.h */; };
 		5DD0A3810D9AC6070056C122 /* DOMElementTimeControl.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */; };
 		5DF7F5C20F01F92A00526B4B /* CSSPropertyNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */; };
 		5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */; };
 		5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; };
+		626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
+		626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 626CDE0D1140424C001E5A68 /* SpatialNavigation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		62CD32591157E57C0063B0A7 /* CustomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62CD32561157E57C0063B0A7 /* CustomEvent.cpp */; };
+		62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 62CD32571157E57C0063B0A7 /* CustomEvent.h */; };
 		63189AE30E83A33300012E41 /* NodeRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 63189AE20E83A33300012E41 /* NodeRareData.h */; settings = {ATTRIBUTES = (); }; };
 		63D7B32D0E78CD3F00F7617C /* NodeRenderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */; };
 		63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B7ADE0E8767B800E32194 /* ElementRareData.h */; };
@@ -1221,7 +1244,7 @@
 		65DF31F709D1CC60000BE325 /* JSDOMImplementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */; };
 		65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */; };
 		65DF31F909D1CC60000BE325 /* JSElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31E509D1CC60000BE325 /* JSElement.cpp */; };
-		65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31E609D1CC60000BE325 /* JSElement.h */; };
+		65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31E609D1CC60000BE325 /* JSElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31E709D1CC60000BE325 /* JSMutationEvent.cpp */; };
 		65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF31E809D1CC60000BE325 /* JSMutationEvent.h */; };
 		65DF31FD09D1CC60000BE325 /* JSNotation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF31E909D1CC60000BE325 /* JSNotation.cpp */; };
@@ -1241,6 +1264,7 @@
 		65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DF323509D1DE65000BE325 /* JSCanvasPattern.cpp */; };
 		65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DF323609D1DE65000BE325 /* JSCanvasPattern.h */; };
 		65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
+		65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
 		6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */; };
 		6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */; };
@@ -1264,6 +1288,8 @@
 		75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; };
 		75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
 		75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
+		7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */; };
+		7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */; };
 		7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BACE106C2DCA007B0823 /* HaltablePlugin.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */; };
 		7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD0106C2DCA007B0823 /* PluginHalter.h */; };
@@ -1300,6 +1326,10 @@
 		7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
 		7AED3E050FBB1EAA00D2B03C /* InspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */; };
 		7AED3E060FBB1EAA00D2B03C /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */; };
+		7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		841FDC261178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */; };
+		841FDC271178C9BE00F8AC9B /* RenderSVGResourceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 841FDC251178C9BE00F8AC9B /* RenderSVGResourceFilter.h */; };
 		84224183107E77F400766A87 /* JSSVGFEMorphologyElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84224181107E77F400766A87 /* JSSVGFEMorphologyElement.cpp */; };
 		84224184107E77F400766A87 /* JSSVGFEMorphologyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 84224182107E77F400766A87 /* JSSVGFEMorphologyElement.h */; };
 		8422418C107E786F00766A87 /* DOMSVGFEMorphologyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 84224189107E786F00766A87 /* DOMSVGFEMorphologyElement.h */; };
@@ -1312,11 +1342,15 @@
 		845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72FA0FD2623900A87D79 /* SVGFilter.h */; };
 		84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */; };
 		84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 84801953108BAFB300CB2B1F /* FEGaussianBlur.h */; };
+		8499A514115FB33000F566E3 /* RenderSVGResourceMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8499A512115FB33000F566E3 /* RenderSVGResourceMarker.cpp */; };
+		8499A515115FB33000F566E3 /* RenderSVGResourceMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499A513115FB33000F566E3 /* RenderSVGResourceMarker.h */; };
 		849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */ = {isa = PBXBuildFile; fileRef = 849F77750EFEC6200090849D /* StrokeStyleApplier.h */; };
 		84A81F3D0FC7DFF000955300 /* SourceAlpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A81F3B0FC7DFF000955300 /* SourceAlpha.cpp */; };
 		84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */; };
 		84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */; };
 		84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
+		84BDA16B11358D2A00DBF64C /* RenderSVGResourceClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */; };
+		84BDA16C11358D2A00DBF64C /* RenderSVGResourceClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */; };
 		84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0C4031115F1D40018AA34 /* AffineTransform.cpp */; };
 		84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		85004D940ACEEAEF00C438F6 /* DOMSVGDefsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */; };
@@ -2183,6 +2217,14 @@
 		85F74E0A0AA8DF8C000DC284 /* DOMCSSUnknownRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85032DD50AA8C9BE007D3B7D /* DOMCSSUnknownRule.h */; };
 		85FF315A0AAFBFCB00374F38 /* DOMKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */; };
 		85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; };
+		8952535211641B3400CABF00 /* FileThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8952535011641B3400CABF00 /* FileThread.cpp */; };
+		8952535311641B3400CABF00 /* FileThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 8952535111641B3400CABF00 /* FileThread.h */; };
+		895253D7116C4C6800CABF00 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 895253D4116C4C6800CABF00 /* FileStream.cpp */; };
+		895253D8116C4C6800CABF00 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253D5116C4C6800CABF00 /* FileStream.h */; };
+		895253D9116C4C6800CABF00 /* FileStreamClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253D6116C4C6800CABF00 /* FileStreamClient.h */; };
+		895253DC116C4EF500CABF00 /* FileStreamProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */; };
+		895253DD116C4EF500CABF00 /* FileStreamProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DB116C4EF500CABF00 /* FileStreamProxy.h */; };
+		895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; };
 		9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
 		9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9305B24D098F1B6B00C28855 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305B24C098F1B6B00C28855 /* Timer.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2195,7 +2237,7 @@
 		9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; };
 		930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 930FC6891072B9280045293E /* TextRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */; };
+		931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
 		9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */; };
 		932871C00B20DEB70049035A /* PlatformMenuDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 932871BF0B20DEB70049035A /* PlatformMenuDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2292,7 +2334,6 @@
 		934F71420D5A6F4400018D69 /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71410D5A6F4400018D69 /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
-		9352071909BD3BA500F2038D /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 9352071709BD3BA500F2038D /* StaticConstructors.h */; };
 		935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; };
 		935207C009BD412100F2038D /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935207BF09BD412000F2038D /* LocalizedStringsMac.mm */; };
 		9352084509BD43B900F2038D /* Language.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352084409BD43B900F2038D /* Language.mm */; };
@@ -2451,26 +2492,50 @@
 		97059978107D975200A50A7C /* PolicyCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 97059974107D975200A50A7C /* PolicyCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		97059979107D975200A50A7C /* PolicyChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97059975107D975200A50A7C /* PolicyChecker.cpp */; };
 		9705997A107D975200A50A7C /* PolicyChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 97059976107D975200A50A7C /* PolicyChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		973889A0116EA9DC00ADF313 /* DocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */; };
+		973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9738899F116EA9DC00ADF313 /* DocumentWriter.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		973E325610883B7C005BC493 /* ResourceLoadNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */; };
 		973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 973E325510883B7C005BC493 /* ResourceLoadNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */; };
 		979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* RedirectScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; };
 		97DCE20110807C750057D394 /* HistoryController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DCE1FF10807C750057D394 /* HistoryController.cpp */; };
 		97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */; };
 		97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */; };
 		97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; };
-		9F2A322B1125A0A2003C3056 /* JavaScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */; };
-		9F2A322C1125A0A2003C3056 /* JavaScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */; };
-		9F2A322D1125A0A2003C3056 /* JavaScriptProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */; };
-		9F2A322E1125A0A2003C3056 /* JavaScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */; };
 		9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */; };
 		9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304C11184B4100AD0126 /* ScriptProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */; };
 		9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304E11184B4100AD0126 /* ScriptProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		9FA37EE71172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */; };
+		9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */; };
+		9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */; };
+		9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */; };
+		9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */; };
+		A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */; };
+		A136A00D1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h in Headers */ = {isa = PBXBuildFile; fileRef = A136A00B1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h */; };
 		A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
 		A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
+		A409C984116D0DDD007197BD /* AccessibilityProgressIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */; };
+		A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */; };
+		A4226E5A1163D667008B8397 /* JSHTMLProgressElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */; };
+		A4226E5C1163D695008B8397 /* JSHTMLProgressElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A4226E5B1163D695008B8397 /* JSHTMLProgressElement.h */; };
+		A4226E951163D73A008B8397 /* DOMHTMLProgressElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A4226E921163D73A008B8397 /* DOMHTMLProgressElement.h */; };
+		A4226E961163D73A008B8397 /* DOMHTMLProgressElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4226E931163D73A008B8397 /* DOMHTMLProgressElement.mm */; };
+		A4226E991163D7CC008B8397 /* DOMHTMLProgressElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A4226E981163D7CC008B8397 /* DOMHTMLProgressElementInternal.h */; };
+		A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */; };
+		A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A43BF5971149290A00C643CA /* HTMLProgressElement.h */; };
+		A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A43BF59A1149292800C643CA /* RenderProgress.cpp */; };
+		A43BF59D1149292800C643CA /* RenderProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = A43BF59B1149292800C643CA /* RenderProgress.h */; };
+		A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */; };
+		A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */; };
+		A59E3C1E11580F510072928E /* KeyEventCodesIPhone.h in Headers */ = {isa = PBXBuildFile; fileRef = A59E3C1C11580F510072928E /* KeyEventCodesIPhone.h */; };
+		A59E3C1F11580F510072928E /* KeyEventIPhone.mm in Sources */ = {isa = PBXBuildFile; fileRef = A59E3C1D11580F510072928E /* KeyEventIPhone.mm */; };
+		A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
+		A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; };
 		A718760E0B2A120100A16ECE /* DragActions.h in Headers */ = {isa = PBXBuildFile; fileRef = A718760D0B2A120100A16ECE /* DragActions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A71878900B2D04AC00A16ECE /* DragControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */; };
 		A7352C190B1BB89D00A986D0 /* RenderSVGBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7352C170B1BB89D00A986D0 /* RenderSVGBlock.cpp */; };
@@ -2878,8 +2943,6 @@
 		A871DED20A1530C700B12A68 /* RenderFrameSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DECA0A1530C700B12A68 /* RenderFrameSet.cpp */; };
 		A871DED30A1530C700B12A68 /* RenderFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DECB0A1530C700B12A68 /* RenderFrame.h */; };
 		A871DED40A1530C700B12A68 /* RenderFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DECC0A1530C700B12A68 /* RenderFrame.cpp */; };
-		A871DED50A1530C700B12A68 /* RenderPartObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DECD0A1530C700B12A68 /* RenderPartObject.h */; };
-		A871DED60A1530C700B12A68 /* RenderPartObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DECE0A1530C700B12A68 /* RenderPartObject.cpp */; };
 		A871DED70A1530C700B12A68 /* RenderPart.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DECF0A1530C700B12A68 /* RenderPart.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */; };
 		A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2922,7 +2985,6 @@
 		A8CFF0500A154F09000A4234 /* AutoTableLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */; };
 		A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF04C0A154F09000A4234 /* TableLayout.h */; };
 		A8CFF5E10A155A05000A4234 /* RootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		A8CFF5E20A155A05000A4234 /* InlineRunBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */; };
 		A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DE0A155A05000A4234 /* InlineBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3190,7 +3252,6 @@
 		A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; };
 		A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
 		A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; };
-		A8EDB03D1016849400FE8113 /* DOMObjectWithSVGContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */; };
 		A8F46A840CB20A9D003A9670 /* DOMSVGClipPathElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8503612C0ACE007B001F3D9E /* DOMSVGClipPathElement.h */; };
 		A8F46A880CB20A9D003A9670 /* DOMSVGGradientElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85C9A2EC0AD7E90300FBFF1E /* DOMSVGGradientElement.h */; };
 		A8F46A890CB20A9D003A9670 /* DOMSVGAnimateColorElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 850361280ACE007B001F3D9E /* DOMSVGAnimateColorElement.h */; };
@@ -3686,13 +3747,7 @@
 		B25599B10D00D8BA00BB825C /* SVGPaintServerSolid.h in Headers */ = {isa = PBXBuildFile; fileRef = B25599190D00D8B900BB825C /* SVGPaintServerSolid.h */; };
 		B25599B20D00D8BA00BB825C /* SVGResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B255991A0D00D8B900BB825C /* SVGResource.cpp */; };
 		B25599B30D00D8BA00BB825C /* SVGResource.h in Headers */ = {isa = PBXBuildFile; fileRef = B255991B0D00D8B900BB825C /* SVGResource.h */; };
-		B25599B40D00D8BA00BB825C /* SVGResourceClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B255991C0D00D8B900BB825C /* SVGResourceClipper.cpp */; };
-		B25599B50D00D8BA00BB825C /* SVGResourceClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = B255991D0D00D8B900BB825C /* SVGResourceClipper.h */; };
-		B25599B60D00D8BA00BB825C /* SVGResourceFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B255991E0D00D8B900BB825C /* SVGResourceFilter.cpp */; };
-		B25599B70D00D8BA00BB825C /* SVGResourceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B255991F0D00D8B900BB825C /* SVGResourceFilter.h */; };
 		B25599B80D00D8BA00BB825C /* SVGResourceListener.h in Headers */ = {isa = PBXBuildFile; fileRef = B25599200D00D8B900BB825C /* SVGResourceListener.h */; };
-		B25599B90D00D8BA00BB825C /* SVGResourceMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25599210D00D8B900BB825C /* SVGResourceMarker.cpp */; };
-		B25599BA0D00D8BA00BB825C /* SVGResourceMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = B25599220D00D8B900BB825C /* SVGResourceMarker.h */; };
 		B25DFAAF0B2E2929000E6510 /* JSSVGMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */; };
 		B262B8040D1F32D000158F09 /* SVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B262B8030D1F32D000158F09 /* SVGFont.cpp */; };
 		B26554EA0B80D74900A50EC3 /* RenderSVGTextPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B26554E80B80D74900A50EC3 /* RenderSVGTextPath.cpp */; };
@@ -3719,7 +3774,7 @@
 		B275356B0B053814002CE64F /* FloatRect.h in Headers */ = {isa = PBXBuildFile; fileRef = B275353D0B053814002CE64F /* FloatRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B275356C0B053814002CE64F /* FloatSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B275353E0B053814002CE64F /* FloatSize.cpp */; };
 		B275356D0B053814002CE64F /* FloatSize.h in Headers */ = {isa = PBXBuildFile; fileRef = B275353F0B053814002CE64F /* FloatSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		B275356E0B053814002CE64F /* Icon.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535400B053814002CE64F /* Icon.h */; };
+		B275356E0B053814002CE64F /* Icon.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535400B053814002CE64F /* Icon.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B275356F0B053814002CE64F /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535410B053814002CE64F /* Image.cpp */; };
 		B27535700B053814002CE64F /* Image.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535420B053814002CE64F /* Image.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B27535710B053814002CE64F /* ImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535430B053814002CE64F /* ImageSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3800,7 +3855,6 @@
 		B2B2645D0D00A77E000ACC1D /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */; };
 		B2B33A5F0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */; };
 		B2B33A600B887CEF00C15984 /* SVGCharacterLayoutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2B33A5E0B887CEF00C15984 /* SVGCharacterLayoutInfo.h */; };
-		B2C3DA1E0D006C1D00EF6F26 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9ED0D006C1D00EF6F26 /* AtomicString.cpp */; };
 		B2C3DA1F0D006C1D00EF6F26 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA200D006C1D00EF6F26 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9F00D006C1D00EF6F26 /* Base64.cpp */; };
@@ -3809,8 +3863,6 @@
 		B2C3DA240D006C1D00EF6F26 /* BidiContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA250D006C1D00EF6F26 /* BidiResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA260D006C1D00EF6F26 /* CharacterNames.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		B2C3DA270D006C1D00EF6F26 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9F60D006C1D00EF6F26 /* CString.cpp */; };
-		B2C3DA280D006C1D00EF6F26 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9F70D006C1D00EF6F26 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA2A0D006C1D00EF6F26 /* CharsetData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FA0D006C1D00EF6F26 /* CharsetData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA2B0D006C1D00EF6F26 /* PlatformString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA2C0D006C1D00EF6F26 /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */; };
@@ -3819,7 +3871,6 @@
 		B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA000D006C1D00EF6F26 /* String.cpp */; };
 		B2C3DA310D006C1D00EF6F26 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA010D006C1D00EF6F26 /* StringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		B2C3DA320D006C1D00EF6F26 /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA020D006C1D00EF6F26 /* StringImpl.cpp */; };
 		B2C3DA330D006C1D00EF6F26 /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA030D006C1D00EF6F26 /* StringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3859,8 +3910,6 @@
 		B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C3DA6D0D006CD600EF6F26 /* GlyphPageTreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */; };
 		B2C3DA6E0D006CD600EF6F26 /* GlyphPageTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		B2C3DA6F0D006CD600EF6F26 /* GlyphWidthMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA5E0D006CD600EF6F26 /* GlyphWidthMap.cpp */; };
-		B2C3DA700D006CD600EF6F26 /* GlyphWidthMap.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5F0D006CD600EF6F26 /* GlyphWidthMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */; };
 		B2CB92420B5BD966009BAA78 /* JSSVGElementInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */; };
 		B2CB92440B5BD970009BAA78 /* JSSVGElementInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */; };
@@ -4112,6 +4161,9 @@
 		B5A684240FFABEAA00D24689 /* SQLiteFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */; };
 		B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */; };
 		B5C1123C102B6C4600096578 /* SQLTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */; };
+		B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D36019112F8B560048DEA8 /* DatabaseCallback.h */; };
+		B5D3601D112F8BA00048DEA8 /* JSDatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */; };
+		B5D3601F112F8BA80048DEA8 /* JSDatabaseCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */; };
 		B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B776D43C1104527500BEB0EC /* PrintContext.cpp */; };
 		BC00F0040E0A185500FD04E3 /* DOMFile.h in Headers */ = {isa = PBXBuildFile; fileRef = BC00EFFE0E0A185500FD04E3 /* DOMFile.h */; };
@@ -4248,6 +4300,14 @@
 		BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53C6070DA56C570021EB5D /* Gradient.cpp */; };
 		BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53C60A0DA56CF10021EB5D /* GradientCG.cpp */; };
 		BC53C6920DA591140021EB5D /* CSSGradientValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53C6910DA591140021EB5D /* CSSGradientValue.h */; };
+		BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53D910114310CC000D817E /* WebCoreJSClientData.h */; };
+		BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		BC53DA481143134D000D817E /* DOMWrapperWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */; };
+		BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		BC53DA62114314BD000D817E /* DOMObjectHashTableMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */; };
+		BC53DAC211432EEE000D817E /* JSDebugWrapperSet.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53DAC111432EEE000D817E /* JSDebugWrapperSet.h */; };
+		BC53DAC511432FD9000D817E /* JSDebugWrapperSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DAC411432FD9000D817E /* JSDebugWrapperSet.cpp */; };
+		BC53DAC711433064000D817E /* JSDOMWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DAC611433064000D817E /* JSDOMWrapper.cpp */; };
 		BC56CB2110D5AC8000A77C64 /* GeolocationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC56CB1C10D5AC8000A77C64 /* GeolocationController.cpp */; };
 		BC56CB2210D5AC8000A77C64 /* GeolocationController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56CB1D10D5AC8000A77C64 /* GeolocationController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC56CB2310D5AC8000A77C64 /* GeolocationControllerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56CB1E10D5AC8000A77C64 /* GeolocationControllerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4411,6 +4471,7 @@
 		BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC904B730D10998F00680D32 /* ClassNodeList.h */; };
 		BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC926F7E0C0552470082776B /* JSHTMLFrameSetElement.cpp */; };
 		BC926F810C0552470082776B /* JSHTMLFrameSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC926F7F0C0552470082776B /* JSHTMLFrameSetElement.h */; };
+		BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9439C2116CF4940048C750 /* JSNodeCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */; };
 		BC946346107A934B00857193 /* JSBeforeLoadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC946345107A934B00857193 /* JSBeforeLoadEvent.cpp */; };
 		BC946348107A936600857193 /* JSBeforeLoadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC946347107A936600857193 /* JSBeforeLoadEvent.h */; };
@@ -4447,7 +4508,7 @@
 		BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
 		BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; };
 		BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
-		BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; };
+		BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; };
 		BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* Cache.cpp */; };
 		BCB16C180979C3BD00467741 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* Cache.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4564,7 +4625,7 @@
 		BCE99EC30DCA624100182683 /* JSXSLTProcessorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE99EC10DCA624100182683 /* JSXSLTProcessorConstructor.cpp */; };
 		BCE99EC40DCA624100182683 /* JSXSLTProcessorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE99EC20DCA624100182683 /* JSXSLTProcessorConstructor.h */; };
 		BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */; };
-		BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; };
+		BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCEA4852097D93020094C9E4 /* RenderBlockLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4813097D93020094C9E4 /* RenderBlockLineLayout.cpp */; };
 		BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4815097D93020094C9E4 /* break_lines.cpp */; };
 		BCEA4855097D93020094C9E4 /* break_lines.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4816097D93020094C9E4 /* break_lines.h */; };
@@ -4650,13 +4711,18 @@
 		C5160EEB1004543A00A7CEE2 /* StorageAreaImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = C5160EE91004543A00A7CEE2 /* StorageAreaImpl.h */; };
 		C55E38BF10040D5D00A56BDB /* StorageNamespaceImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */; };
 		C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */; };
+		C5D4AA79116BAFB60069CA93 /* GlyphMetricsMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5D4AA77116BAFB60069CA93 /* GlyphMetricsMap.cpp */; };
+		C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */ = {isa = PBXBuildFile; fileRef = C5D4AA78116BAFB60069CA93 /* GlyphMetricsMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		C5E9B67710697E1300C7BB1A /* StorageEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5E9B67610697E1300C7BB1A /* StorageEventDispatcher.cpp */; };
 		C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */; };
 		C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; };
 		C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */; };
+		CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */ = {isa = PBXBuildFile; fileRef = CE172E001136E8CE0062A533 /* ZoomMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CE4C00E410F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */; };
 		CE4C00E610F6F7C100CA38F5 /* HTMLNoScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */; };
 		CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEF418CC1179678C009D112C /* ViewportArguments.cpp */; };
+		CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; };
 		D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */; };
 		D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */; };
@@ -4715,6 +4781,12 @@
 		E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12EDBE90B308E0B002704B6 /* EventTarget.cpp */; };
 		E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
 		E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
+		E169803D1133542D00894115 /* CRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169803C1133542D00894115 /* CRuntimeObject.h */; };
+		E16980491133644700894115 /* CRuntimeObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E16980481133644700894115 /* CRuntimeObject.cpp */; };
+		E16982551134629D00894115 /* ObjCRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E16982541134629D00894115 /* ObjCRuntimeObject.h */; };
+		E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = E169825F1134636A00894115 /* ObjCRuntimeObject.mm */; };
+		E1698264113467F300894115 /* JavaRuntimeObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1698263113467F300894115 /* JavaRuntimeObject.cpp */; };
+		E16982681134680700894115 /* JavaRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E16982671134680700894115 /* JavaRuntimeObject.h */; };
 		E17A4A1B0D97991D00FC10C6 /* DOMSVGAltGlyphElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 65AA6BAC0D974A00000541AE /* DOMSVGAltGlyphElement.h */; };
 		E17A4A1C0D97991D00FC10C6 /* DOMSVGAltGlyphElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 65AA6BAE0D974A00000541AE /* DOMSVGAltGlyphElementInternal.h */; };
 		E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */; };
@@ -4756,6 +4828,7 @@
 		E1CA5CD30E8CDE8000E8EF90 /* JSWorkerConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CA5CD20E8CDE8000E8EF90 /* JSWorkerConstructor.h */; };
 		E1CA5CD60E8CDEE900E8EF90 /* JSWorkerConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CD50E8CDEE900E8EF90 /* JSWorkerConstructor.cpp */; };
 		E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; };
+		E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; };
 		E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; };
 		E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; };
 		E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */; };
@@ -4779,7 +4852,7 @@
 		E44613AD0CD6331000FADA75 /* MediaError.h in Headers */ = {isa = PBXBuildFile; fileRef = E446139B0CD6331000FADA75 /* MediaError.h */; };
 		E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E446139D0CD6331000FADA75 /* TimeRanges.cpp */; };
 		E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = E446139E0CD6331000FADA75 /* TimeRanges.h */; };
-		E44613B60CD6344E00FADA75 /* VoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = E44613B40CD6344E00FADA75 /* VoidCallback.h */; };
+		E44613B60CD6344E00FADA75 /* VoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = E44613B40CD6344E00FADA75 /* VoidCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E44613E30CD6819F00FADA75 /* MediaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */; };
 		E44613E40CD681A200FADA75 /* MediaPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E44613E50CD681A600FADA75 /* MediaPlayerPrivateQTKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B41E110CBF90EF00AF2ECE /* MediaPlayerPrivateQTKit.mm */; };
@@ -4802,6 +4875,9 @@
 		E446143C0CD689CC00FADA75 /* JSHTMLSourceElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B423720CBFB6E000AF2ECE /* JSHTMLSourceElement.h */; };
 		E44614510CD68A3500FADA75 /* RenderVideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B41E330CBFB60900AF2ECE /* RenderVideo.cpp */; };
 		E44614520CD68A3500FADA75 /* RenderVideo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B41E340CBFB60900AF2ECE /* RenderVideo.h */; };
+		E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; };
+		E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */; };
+		E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; };
 		E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */; };
 		E49626C20D80D94800E3405C /* PreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D4ABE00D7542F000F96869 /* PreloadScanner.cpp */; };
@@ -4826,8 +4902,14 @@
 		ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED501DC50B249F2900AE18D9 /* EditorMac.mm */; };
 		EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
+		F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */; };
 		F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3644AFD1119805900E0D537 /* InjectedScript.cpp */; };
 		F3644B001119805900E0D537 /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = F3644AFE1119805900E0D537 /* InjectedScript.h */; };
+		F375CC071150D300008DDB81 /* InspectorWorkerResource.h in Headers */ = {isa = PBXBuildFile; fileRef = F375CC061150D300008DDB81 /* InspectorWorkerResource.h */; };
+		F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */; };
+		F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */; };
 		F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */; };
 		F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
 		F5C041DA0FFCA7CE00839D4A /* HTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041D70FFCA7CE00839D4A /* HTMLDataListElement.cpp */; };
@@ -4842,12 +4924,20 @@
 		F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
 		F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
 		F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */; };
-		FA654A641108ABB7002615E0 /* mathml.css in Resources */ = {isa = PBXBuildFile; fileRef = FA654A631108ABB7002615E0 /* mathml.css */; };
-		FA654A681108ABE2002615E0 /* mathattrs.in in Resources */ = {isa = PBXBuildFile; fileRef = FA654A671108ABE2002615E0 /* mathattrs.in */; };
+		FA0B1F8611125CEE007F9839 /* RenderMathMLMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B1F8211125CEE007F9839 /* RenderMathMLMath.cpp */; };
+		FA0B1F8711125CEE007F9839 /* RenderMathMLMath.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B1F8311125CEE007F9839 /* RenderMathMLMath.h */; };
+		FA0B1F8811125CEE007F9839 /* RenderMathMLRow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0B1F8411125CEE007F9839 /* RenderMathMLRow.cpp */; };
+		FA0B1F8911125CEE007F9839 /* RenderMathMLRow.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0B1F8511125CEE007F9839 /* RenderMathMLRow.h */; };
+		FA5FAE4211126A5D00D3750F /* RenderMathMLOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA5FAE4011126A5D00D3750F /* RenderMathMLOperator.cpp */; };
+		FA5FAE4311126A5D00D3750F /* RenderMathMLOperator.h in Headers */ = {isa = PBXBuildFile; fileRef = FA5FAE4111126A5D00D3750F /* RenderMathMLOperator.h */; };
 		FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A691108ABED002615E0 /* MathMLTextElement.cpp */; };
 		FA654A6C1108ABED002615E0 /* MathMLTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6A1108ABED002615E0 /* MathMLTextElement.h */; };
 		FA654A6F1108ABFF002615E0 /* RenderMathMLBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */; };
 		FA654A701108ABFF002615E0 /* RenderMathMLBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */; };
+		FA7EFB051120D25400CF79C7 /* RenderMathMLUnderOver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */; };
+		FA7EFB061120D25400CF79C7 /* RenderMathMLUnderOver.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */; };
+		FAA10570114C2DF700940A01 /* RenderMathMLFraction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAA1056E114C2DF700940A01 /* RenderMathMLFraction.cpp */; };
+		FAA10571114C2DF700940A01 /* RenderMathMLFraction.h in Headers */ = {isa = PBXBuildFile; fileRef = FAA1056F114C2DF700940A01 /* RenderMathMLFraction.h */; };
 		FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */; };
 		FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72EE1059C1EB00D999DD /* MathMLElement.h */; };
 		FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */; };
@@ -4856,6 +4946,8 @@
 		FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FABE72F21059C1EB00D999DD /* MathMLMathElement.h */; };
 		FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */; };
 		FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABE72FC1059C21100D999DD /* MathMLNames.cpp */; };
+		FAC12CC41120DA6900DACC36 /* RenderMathMLSubSup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */; };
+		FAC12CC51120DA6900DACC36 /* RenderMathMLSubSup.h in Headers */ = {isa = PBXBuildFile; fileRef = FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */; };
 		FE6FD4880F676E5700092873 /* Coordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD4850F676E5700092873 /* Coordinates.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */; };
 		FE6FD48E0F676E9300092873 /* JSCoordinates.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6FD48C0F676E9300092873 /* JSCoordinates.h */; };
@@ -5128,6 +5220,8 @@
 				A80F3B520CCDCE24002DD990 /* DOMSVGFEMergeElementInternal.h in Copy Generated Headers */,
 				A8F46B710CB20A9D003A9670 /* DOMSVGFEMergeNodeElement.h in Copy Generated Headers */,
 				A80F3B320CCDCE24002DD990 /* DOMSVGFEMergeNodeElementInternal.h in Copy Generated Headers */,
+				5D88EE9111407FD300BC3ABC /* DOMSVGFEMorphologyElement.h in Copy Generated Headers */,
+				5D88EE9211407FF400BC3ABC /* DOMSVGFEMorphologyElementInternal.h in Copy Generated Headers */,
 				A8F46B1C0CB20A9D003A9670 /* DOMSVGFEOffsetElement.h in Copy Generated Headers */,
 				A80F3B760CCDCE24002DD990 /* DOMSVGFEOffsetElementInternal.h in Copy Generated Headers */,
 				A8F46B790CB20A9D003A9670 /* DOMSVGFEPointLightElement.h in Copy Generated Headers */,
@@ -5450,6 +5544,8 @@
 		0B90561D0F257E930095FF6A /* ThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableLoader.cpp; sourceTree = "<group>"; };
 		0B9056F60F2685F30095FF6A /* WorkerThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerThreadableLoader.cpp; sourceTree = "<group>"; };
 		0B9056F70F2685F30095FF6A /* WorkerThreadableLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerThreadableLoader.h; sourceTree = "<group>"; };
+		0BC2C7751134A8FC000B2F61 /* CanvasSurface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasSurface.cpp; sourceTree = "<group>"; };
+		0BC2C7761134A8FC000B2F61 /* CanvasSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasSurface.h; sourceTree = "<group>"; };
 		0BE030A10F3112FB003C1A46 /* RenderLineBoxList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLineBoxList.h; sourceTree = "<group>"; };
 		0C3F1F5710C8871200D72CE1 /* WebGLUniformLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLUniformLocation.cpp; path = canvas/WebGLUniformLocation.cpp; sourceTree = "<group>"; };
 		0C3F1F5810C8871200D72CE1 /* WebGLUniformLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLUniformLocation.h; path = canvas/WebGLUniformLocation.h; sourceTree = "<group>"; };
@@ -5482,6 +5578,10 @@
 		0FCF33290F2B9A25004B6795 /* WebTiledLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTiledLayer.h; sourceTree = "<group>"; };
 		0FCF332A0F2B9A25004B6795 /* WebLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebLayer.mm; sourceTree = "<group>"; };
 		0FCF332B0F2B9A25004B6795 /* WebLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebLayer.h; sourceTree = "<group>"; };
+		0FD3080C117CF7E700A791F7 /* RenderFrameBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFrameBase.cpp; sourceTree = "<group>"; };
+		0FD3080D117CF7E700A791F7 /* RenderFrameBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFrameBase.h; sourceTree = "<group>"; };
+		0FD308D3117D168400A791F7 /* RenderIFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderIFrame.cpp; sourceTree = "<group>"; };
+		0FD308D4117D168400A791F7 /* RenderIFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderIFrame.h; sourceTree = "<group>"; };
 		0FD723800EC8BD9300CA5DD7 /* FloatQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatQuad.h; sourceTree = "<group>"; };
 		0FD723810EC8BD9300CA5DD7 /* FloatQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatQuad.cpp; sourceTree = "<group>"; };
 		0FF50259102BA9010066F39A /* DOMMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMMedia.h; sourceTree = "<group>"; };
@@ -5857,9 +5957,6 @@
 		1C81BA030E97348300266E07 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = "<group>"; };
 		1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = "<group>"; };
 		1C81BA050E97348300266E07 /* JavaScriptCallFrame.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = JavaScriptCallFrame.idl; sourceTree = "<group>"; };
-		1C81BA060E97348300266E07 /* JavaScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptDebugListener.h; sourceTree = "<group>"; };
-		1C81BA070E97348300266E07 /* JavaScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptDebugServer.cpp; sourceTree = "<group>"; };
-		1C81BA080E97348300266E07 /* JavaScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptDebugServer.h; sourceTree = "<group>"; };
 		1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
 		1CA19E030DC255950065A994 /* EventLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventLoopMac.mm; sourceTree = "<group>"; };
 		1CA19E150DC255CA0065A994 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = "<group>"; };
@@ -5882,6 +5979,8 @@
 		228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
 		24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; };
 		24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
+		2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
+		2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserGestureIndicator.h; sourceTree = "<group>"; };
 		29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityRenderObject.cpp; sourceTree = "<group>"; };
 		29A812090FBB9C1D00510293 /* AccessibilityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTable.cpp; sourceTree = "<group>"; };
 		29A8120A0FBB9C1D00510293 /* AccessibilityARIAGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGrid.cpp; sourceTree = "<group>"; };
@@ -5920,11 +6019,17 @@
 		2D9066050BE141D400956998 /* LayoutState.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutState.h; sourceTree = "<group>"; };
 		2D90660B0665D937006B6F1A /* ClipboardMac.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardMac.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		2D90660C0665D937006B6F1A /* ClipboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ClipboardMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+		2E0888C3114883A900AF4265 /* DOMFormData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMFormData.idl; sourceTree = "<group>"; };
+		2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormData.cpp; sourceTree = "<group>"; };
+		2E0888D31148848A00AF4265 /* JSDOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFormData.h; sourceTree = "<group>"; };
+		2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormDataCustom.cpp; sourceTree = "<group>"; };
 		2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlob.cpp; sourceTree = "<group>"; };
 		2E2D99CC10E2BBDA00496337 /* JSBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlob.h; sourceTree = "<group>"; };
 		2E2D99E510E2BC1C00496337 /* DOMBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlob.h; sourceTree = "<group>"; };
 		2E2D99E610E2BC1C00496337 /* DOMBlob.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMBlob.mm; sourceTree = "<group>"; };
 		2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlobInternal.h; sourceTree = "<group>"; };
+		2E3BBF051162DA1100B9409A /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UUID.cpp; sourceTree = "<group>"; };
+		2E3BBF061162DA1100B9409A /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = "<group>"; };
 		2E4346320F546A8200B0F1BA /* GenericWorkerTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GenericWorkerTask.h; path = workers/GenericWorkerTask.h; sourceTree = "<group>"; };
 		2E4346330F546A8200B0F1BA /* Worker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Worker.cpp; path = workers/Worker.cpp; sourceTree = "<group>"; };
 		2E4346340F546A8200B0F1BA /* Worker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Worker.h; path = workers/Worker.h; sourceTree = "<group>"; };
@@ -5954,6 +6059,8 @@
 		2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorEvent.cpp; sourceTree = "<group>"; };
 		2ECF7ADF10162B5800427DE7 /* ErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorEvent.h; sourceTree = "<group>"; };
 		2ECF7AE010162B5800427DE7 /* ErrorEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ErrorEvent.idl; sourceTree = "<group>"; };
+		2ED609BA1145B07100C8684E /* DOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMFormData.cpp; sourceTree = "<group>"; };
+		2ED609BB1145B07100C8684E /* DOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFormData.h; sourceTree = "<group>"; };
 		31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframeRule.cpp; sourceTree = "<group>"; };
 		31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSKeyframeRule.h; sourceTree = "<group>"; };
 		31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframesRule.cpp; sourceTree = "<group>"; };
@@ -6017,6 +6124,8 @@
 		3390CA520FFC157B00921962 /* NotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationCenter.h; path = notifications/NotificationCenter.h; sourceTree = "<group>"; };
 		3390CA530FFC157B00921962 /* NotificationCenter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NotificationCenter.idl; path = notifications/NotificationCenter.idl; sourceTree = "<group>"; };
 		3390CA540FFC157B00921962 /* NotificationContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationContents.h; path = notifications/NotificationContents.h; sourceTree = "<group>"; };
+		33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; };
+		33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; };
 		371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
 		371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
 		371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentedFontData.h; sourceTree = "<group>"; };
@@ -6525,6 +6634,8 @@
 		550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		5913953A110758450083EC55 /* JNIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JNIBridge.h; sourceTree = "<group>"; };
 		5913953C1107584E0083EC55 /* JNIBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JNIBridge.cpp; sourceTree = "<group>"; };
+		596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
+		596229791133EFE200DC4CBB /* GeolocationPositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationPositionCache.h; sourceTree = "<group>"; };
 		599E758F11055A1F00D904FA /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bridge.h; path = bridge/Bridge.h; sourceTree = "<group>"; };
 		59A9E7AF1104758800DFB4C1 /* JavaInstanceJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaInstanceJSC.cpp; path = jsc/JavaInstanceJSC.cpp; sourceTree = "<group>"; };
 		59A9E7B11104759400DFB4C1 /* JavaInstanceJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaInstanceJSC.h; path = jsc/JavaInstanceJSC.h; sourceTree = "<group>"; };
@@ -6551,7 +6662,13 @@
 		5DA5E0FB102B953800088CF9 /* JSWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebSocket.h; sourceTree = "<group>"; };
 		5DB1BC6810715A6400EFAA49 /* TransformSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformSource.h; sourceTree = "<group>"; };
 		5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = "<group>"; };
+		5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; };
 		5DCF836C0D59159800953BC6 /* PluginInfoStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginInfoStore.h; sourceTree = "<group>"; };
+		626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = "<group>"; };
+		626CDE0D1140424C001E5A68 /* SpatialNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpatialNavigation.h; sourceTree = "<group>"; };
+		62CD32561157E57C0063B0A7 /* CustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomEvent.cpp; sourceTree = "<group>"; };
+		62CD32571157E57C0063B0A7 /* CustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomEvent.h; sourceTree = "<group>"; };
+		62CD32581157E57C0063B0A7 /* CustomEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CustomEvent.idl; sourceTree = "<group>"; };
 		63189AE20E83A33300012E41 /* NodeRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRareData.h; sourceTree = "<group>"; };
 		637B7ADE0E8767B800E32194 /* ElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementRareData.h; sourceTree = "<group>"; };
 		63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRenderStyle.h; sourceTree = "<group>"; };
@@ -6658,6 +6775,7 @@
 		65DF323409D1DE65000BE325 /* JSCanvasGradient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCanvasGradient.h; sourceTree = "<group>"; };
 		65DF323509D1DE65000BE325 /* JSCanvasPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasPattern.cpp; sourceTree = "<group>"; };
 		65DF323609D1DE65000BE325 /* JSCanvasPattern.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCanvasPattern.h; sourceTree = "<group>"; };
+		65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWrapper.h; sourceTree = "<group>"; };
 		65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
 		6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
@@ -6684,6 +6802,8 @@
 		75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; };
 		75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
 		75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
+		7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; };
+		7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeRequest.h; sourceTree = "<group>"; };
 		7693BACE106C2DCA007B0823 /* HaltablePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HaltablePlugin.h; sourceTree = "<group>"; };
 		7693BACF106C2DCA007B0823 /* PluginHalter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginHalter.cpp; sourceTree = "<group>"; };
 		7693BAD0106C2DCA007B0823 /* PluginHalter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalter.h; sourceTree = "<group>"; };
@@ -6724,6 +6844,10 @@
 		7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
 		7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontend.cpp; sourceTree = "<group>"; };
 		7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontend.h; sourceTree = "<group>"; };
+		7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; };
+		7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
+		841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceFilter.cpp; sourceTree = "<group>"; };
+		841FDC251178C9BE00F8AC9B /* RenderSVGResourceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceFilter.h; sourceTree = "<group>"; };
 		84224181107E77F400766A87 /* JSSVGFEMorphologyElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFEMorphologyElement.cpp; sourceTree = "<group>"; };
 		84224182107E77F400766A87 /* JSSVGFEMorphologyElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFEMorphologyElement.h; sourceTree = "<group>"; };
 		84224189107E786F00766A87 /* DOMSVGFEMorphologyElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGFEMorphologyElement.h; sourceTree = "<group>"; };
@@ -6737,6 +6861,8 @@
 		845E72FA0FD2623900A87D79 /* SVGFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilter.h; sourceTree = "<group>"; };
 		84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEGaussianBlur.cpp; path = filters/FEGaussianBlur.cpp; sourceTree = "<group>"; };
 		84801953108BAFB300CB2B1F /* FEGaussianBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEGaussianBlur.h; path = filters/FEGaussianBlur.h; sourceTree = "<group>"; };
+		8499A512115FB33000F566E3 /* RenderSVGResourceMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceMarker.cpp; sourceTree = "<group>"; };
+		8499A513115FB33000F566E3 /* RenderSVGResourceMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceMarker.h; sourceTree = "<group>"; };
 		849F77750EFEC6200090849D /* StrokeStyleApplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrokeStyleApplier.h; sourceTree = "<group>"; };
 		84A81F3B0FC7DFF000955300 /* SourceAlpha.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SourceAlpha.cpp; path = filters/SourceAlpha.cpp; sourceTree = "<group>"; };
 		84A81F3C0FC7DFF000955300 /* SourceAlpha.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceAlpha.h; path = filters/SourceAlpha.h; sourceTree = "<group>"; };
@@ -6745,6 +6871,8 @@
 		84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreKeyGenerator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+		84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceClipper.cpp; sourceTree = "<group>"; };
+		84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceClipper.h; sourceTree = "<group>"; };
 		84D0C4031115F1D40018AA34 /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AffineTransform.cpp; path = transforms/AffineTransform.cpp; sourceTree = "<group>"; };
 		84D0C4051115F1EA0018AA34 /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AffineTransform.h; path = transforms/AffineTransform.h; sourceTree = "<group>"; };
 		85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGDefsElement.h; sourceTree = "<group>"; };
@@ -7556,6 +7684,14 @@
 		85F56A790A98CE3700ADB60A /* DOMProcessingInstruction.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMProcessingInstruction.mm; sourceTree = "<group>"; };
 		85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMKeyboardEvent.h; sourceTree = "<group>"; };
 		85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; };
+		8952535011641B3400CABF00 /* FileThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileThread.cpp; sourceTree = "<group>"; };
+		8952535111641B3400CABF00 /* FileThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThread.h; sourceTree = "<group>"; };
+		895253D4116C4C6800CABF00 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = "<group>"; };
+		895253D5116C4C6800CABF00 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = "<group>"; };
+		895253D6116C4C6800CABF00 /* FileStreamClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStreamClient.h; sourceTree = "<group>"; };
+		895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStreamProxy.cpp; sourceTree = "<group>"; };
+		895253DB116C4EF500CABF00 /* FileStreamProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStreamProxy.h; sourceTree = "<group>"; };
+		895253DE116C4F0600CABF00 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThreadTask.h; sourceTree = "<group>"; };
 		9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
 		9302B0BE0D79F82C00C7EE83 /* PageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroup.h; sourceTree = "<group>"; };
 		9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
@@ -7667,7 +7803,6 @@
 		934F71410D5A6F4400018D69 /* ResourceError.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceError.h; sourceTree = "<group>"; };
 		934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallenge.h; sourceTree = "<group>"; };
 		934FE9E40B5CA539003E4A73 /* FileChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileChooser.cpp; sourceTree = "<group>"; };
-		9352071709BD3BA500F2038D /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
 		935207BD09BD410A00F2038D /* LocalizedStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedStrings.h; sourceTree = "<group>"; };
 		935207BF09BD412000F2038D /* LocalizedStringsMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedStringsMac.mm; sourceTree = "<group>"; };
 		9352084409BD43B900F2038D /* Language.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Language.mm; sourceTree = "<group>"; };
@@ -7802,26 +7937,53 @@
 		97059974107D975200A50A7C /* PolicyCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyCallback.h; sourceTree = "<group>"; };
 		97059975107D975200A50A7C /* PolicyChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolicyChecker.cpp; sourceTree = "<group>"; };
 		97059976107D975200A50A7C /* PolicyChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyChecker.h; sourceTree = "<group>"; };
+		9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentWriter.cpp; sourceTree = "<group>"; };
+		9738899F116EA9DC00ADF313 /* DocumentWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentWriter.h; sourceTree = "<group>"; };
 		973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadNotifier.cpp; sourceTree = "<group>"; };
 		973E325510883B7C005BC493 /* ResourceLoadNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadNotifier.h; sourceTree = "<group>"; };
 		979F43D11075E44A0000F83B /* RedirectScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedirectScheduler.cpp; sourceTree = "<group>"; };
 		979F43D21075E44A0000F83B /* RedirectScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedirectScheduler.h; sourceTree = "<group>"; };
+		97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; };
 		97DCE1FF10807C750057D394 /* HistoryController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryController.cpp; sourceTree = "<group>"; };
 		97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; };
 		97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSSAuditor.cpp; sourceTree = "<group>"; };
 		97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSSAuditor.h; sourceTree = "<group>"; };
 		97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; };
-		9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptProfile.cpp; sourceTree = "<group>"; };
-		9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptProfile.h; sourceTree = "<group>"; };
-		9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptProfileNode.cpp; sourceTree = "<group>"; };
-		9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptProfileNode.h; sourceTree = "<group>"; };
 		9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; };
 		9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; };
 		9F72304C11184B4100AD0126 /* ScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfile.h; sourceTree = "<group>"; };
 		9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfiler.cpp; sourceTree = "<group>"; };
 		9F72304E11184B4100AD0126 /* ScriptProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfiler.h; sourceTree = "<group>"; };
+		9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfileNode.h; sourceTree = "<group>"; };
+		9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfileNodeCustom.cpp; sourceTree = "<group>"; };
+		9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfile.idl; sourceTree = "<group>"; };
+		9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfileNode.idl; sourceTree = "<group>"; };
+		9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfile.cpp; sourceTree = "<group>"; };
+		9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfile.h; sourceTree = "<group>"; };
+		9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfileNode.cpp; sourceTree = "<group>"; };
+		9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfileNode.h; sourceTree = "<group>"; };
+		A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestProgressEventThrottle.cpp; sourceTree = "<group>"; };
+		A136A00B1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestProgressEventThrottle.h; sourceTree = "<group>"; };
 		A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; };
 		A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; };
+		A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityProgressIndicator.cpp; sourceTree = "<group>"; };
+		A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityProgressIndicator.h; sourceTree = "<group>"; };
+		A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLProgressElement.cpp; sourceTree = "<group>"; };
+		A4226E5B1163D695008B8397 /* JSHTMLProgressElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLProgressElement.h; sourceTree = "<group>"; };
+		A4226E921163D73A008B8397 /* DOMHTMLProgressElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLProgressElement.h; sourceTree = "<group>"; };
+		A4226E931163D73A008B8397 /* DOMHTMLProgressElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLProgressElement.mm; sourceTree = "<group>"; };
+		A4226E981163D7CC008B8397 /* DOMHTMLProgressElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLProgressElementInternal.h; sourceTree = "<group>"; };
+		A4226EA51163D84D008B8397 /* HTMLProgressElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLProgressElement.idl; sourceTree = "<group>"; };
+		A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLProgressElement.cpp; sourceTree = "<group>"; };
+		A43BF5971149290A00C643CA /* HTMLProgressElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLProgressElement.h; sourceTree = "<group>"; };
+		A43BF59A1149292800C643CA /* RenderProgress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderProgress.cpp; sourceTree = "<group>"; };
+		A43BF59B1149292800C643CA /* RenderProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderProgress.h; sourceTree = "<group>"; };
+		A59E3C1C11580F510072928E /* KeyEventCodesIPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCodesIPhone.h; path = iphone/KeyEventCodesIPhone.h; sourceTree = "<group>"; };
+		A59E3C1D11580F510072928E /* KeyEventIPhone.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventIPhone.mm; path = iphone/KeyEventIPhone.mm; sourceTree = "<group>"; };
+		A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = "<group>"; };
+		A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
+		A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCocoa.h; path = cocoa/KeyEventCocoa.h; sourceTree = "<group>"; };
+		A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventCocoa.mm; path = cocoa/KeyEventCocoa.mm; sourceTree = "<group>"; };
 		A718760D0B2A120100A16ECE /* DragActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragActions.h; sourceTree = "<group>"; };
 		A718788F0B2D04AC00A16ECE /* DragControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragControllerMac.mm; sourceTree = "<group>"; };
 		A7352C170B1BB89D00A986D0 /* RenderSVGBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGBlock.cpp; sourceTree = "<group>"; };
@@ -8096,8 +8258,6 @@
 		A871DECA0A1530C700B12A68 /* RenderFrameSet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFrameSet.cpp; sourceTree = "<group>"; };
 		A871DECB0A1530C700B12A68 /* RenderFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderFrame.h; sourceTree = "<group>"; };
 		A871DECC0A1530C700B12A68 /* RenderFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFrame.cpp; sourceTree = "<group>"; };
-		A871DECD0A1530C700B12A68 /* RenderPartObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderPartObject.h; sourceTree = "<group>"; };
-		A871DECE0A1530C700B12A68 /* RenderPartObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPartObject.cpp; sourceTree = "<group>"; };
 		A871DECF0A1530C700B12A68 /* RenderPart.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderPart.h; sourceTree = "<group>"; };
 		A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderReplaced.cpp; sourceTree = "<group>"; };
 		A871DFDF0A15376B00B12A68 /* RenderReplaced.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderReplaced.h; sourceTree = "<group>"; };
@@ -8139,7 +8299,6 @@
 		A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AutoTableLayout.cpp; sourceTree = "<group>"; };
 		A8CFF04C0A154F09000A4234 /* TableLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TableLayout.h; sourceTree = "<group>"; };
 		A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RootInlineBox.h; sourceTree = "<group>"; };
-		A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineRunBox.h; sourceTree = "<group>"; };
 		A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineFlowBox.h; sourceTree = "<group>"; };
 		A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFlowBox.cpp; sourceTree = "<group>"; };
 		A8CFF5DE0A155A05000A4234 /* InlineBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineBox.h; sourceTree = "<group>"; };
@@ -8400,7 +8559,6 @@
 		A8EA80040A19516E00A8EF5F /* StyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleSheet.h; sourceTree = "<group>"; };
 		A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
 		A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
-		A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMObjectWithSVGContext.h; sourceTree = "<group>"; };
 		A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRenderSupport.h; sourceTree = "<group>"; };
 		A8F4FB950C169E85002AFED5 /* SVGRenderSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGRenderSupport.cpp; sourceTree = "<group>"; };
 		A8F5C0B60F9285AC0098E06B /* RenderSVGModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGModelObject.h; sourceTree = "<group>"; };
@@ -8926,13 +9084,7 @@
 		B25599190D00D8B900BB825C /* SVGPaintServerSolid.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPaintServerSolid.h; sourceTree = "<group>"; };
 		B255991A0D00D8B900BB825C /* SVGResource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResource.cpp; sourceTree = "<group>"; };
 		B255991B0D00D8B900BB825C /* SVGResource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResource.h; sourceTree = "<group>"; };
-		B255991C0D00D8B900BB825C /* SVGResourceClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceClipper.cpp; sourceTree = "<group>"; };
-		B255991D0D00D8B900BB825C /* SVGResourceClipper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceClipper.h; sourceTree = "<group>"; };
-		B255991E0D00D8B900BB825C /* SVGResourceFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceFilter.cpp; sourceTree = "<group>"; };
-		B255991F0D00D8B900BB825C /* SVGResourceFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceFilter.h; sourceTree = "<group>"; };
 		B25599200D00D8B900BB825C /* SVGResourceListener.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceListener.h; sourceTree = "<group>"; };
-		B25599210D00D8B900BB825C /* SVGResourceMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceMarker.cpp; sourceTree = "<group>"; };
-		B25599220D00D8B900BB825C /* SVGResourceMarker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceMarker.h; sourceTree = "<group>"; };
 		B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGMatrixCustom.cpp; sourceTree = "<group>"; };
 		B262B8030D1F32D000158F09 /* SVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFont.cpp; sourceTree = "<group>"; };
 		B26554E80B80D74900A50EC3 /* RenderSVGTextPath.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTextPath.cpp; sourceTree = "<group>"; };
@@ -9044,7 +9196,6 @@
 		B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringImplCF.cpp; sourceTree = "<group>"; };
 		B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGCharacterLayoutInfo.cpp; sourceTree = "<group>"; };
 		B2B33A5E0B887CEF00C15984 /* SVGCharacterLayoutInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGCharacterLayoutInfo.h; sourceTree = "<group>"; };
-		B2C3D9ED0D006C1D00EF6F26 /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicString.cpp; sourceTree = "<group>"; };
 		B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AtomicString.h; sourceTree = "<group>"; };
 		B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AtomicStringImpl.h; sourceTree = "<group>"; };
 		B2C3D9F00D006C1D00EF6F26 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
@@ -9053,8 +9204,6 @@
 		B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BidiContext.h; sourceTree = "<group>"; };
 		B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BidiResolver.h; sourceTree = "<group>"; };
 		B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CharacterNames.h; sourceTree = "<group>"; };
-		B2C3D9F60D006C1D00EF6F26 /* CString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CString.cpp; sourceTree = "<group>"; };
-		B2C3D9F70D006C1D00EF6F26 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CString.h; sourceTree = "<group>"; };
 		B2C3D9FA0D006C1D00EF6F26 /* CharsetData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CharsetData.h; sourceTree = "<group>"; };
 		B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformString.h; sourceTree = "<group>"; };
 		B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegularExpression.cpp; sourceTree = "<group>"; };
@@ -9063,7 +9212,6 @@
 		B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SegmentedString.h; sourceTree = "<group>"; };
 		B2C3DA000D006C1D00EF6F26 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; };
 		B2C3DA010D006C1D00EF6F26 /* StringHash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringHash.h; sourceTree = "<group>"; };
-		B2C3DA020D006C1D00EF6F26 /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringImpl.cpp; sourceTree = "<group>"; };
 		B2C3DA030D006C1D00EF6F26 /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringImpl.h; sourceTree = "<group>"; };
 		B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBoundaries.h; sourceTree = "<group>"; };
 		B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; };
@@ -9103,8 +9251,6 @@
 		B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphBuffer.h; sourceTree = "<group>"; };
 		B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphPageTreeNode.cpp; sourceTree = "<group>"; };
 		B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphPageTreeNode.h; sourceTree = "<group>"; };
-		B2C3DA5E0D006CD600EF6F26 /* GlyphWidthMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphWidthMap.cpp; sourceTree = "<group>"; };
-		B2C3DA5F0D006CD600EF6F26 /* GlyphWidthMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphWidthMap.h; sourceTree = "<group>"; };
 		B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegCustom.cpp; sourceTree = "<group>"; };
 		B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElementInstance.cpp; sourceTree = "<group>"; };
 		B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElementInstance.h; sourceTree = "<group>"; };
@@ -9357,6 +9503,9 @@
 		B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteFileSystem.cpp; path = sql/SQLiteFileSystem.cpp; sourceTree = "<group>"; };
 		B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionCoordinator.cpp; sourceTree = "<group>"; };
 		B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionCoordinator.h; sourceTree = "<group>"; };
+		B5D36019112F8B560048DEA8 /* DatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseCallback.h; sourceTree = "<group>"; };
+		B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseCallback.h; sourceTree = "<group>"; };
+		B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseCallback.cpp; sourceTree = "<group>"; };
 		B776D43A1104525D00BEB0EC /* PrintContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintContext.h; sourceTree = "<group>"; };
 		B776D43C1104527500BEB0EC /* PrintContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintContext.cpp; sourceTree = "<group>"; };
 		BC00EFFE0E0A185500FD04E3 /* DOMFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFile.h; sourceTree = "<group>"; };
@@ -9499,6 +9648,14 @@
 		BC53C6070DA56C570021EB5D /* Gradient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Gradient.cpp; sourceTree = "<group>"; };
 		BC53C60A0DA56CF10021EB5D /* GradientCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GradientCG.cpp; sourceTree = "<group>"; };
 		BC53C6910DA591140021EB5D /* CSSGradientValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGradientValue.h; sourceTree = "<group>"; };
+		BC53D910114310CC000D817E /* WebCoreJSClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreJSClientData.h; sourceTree = "<group>"; };
+		BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWrapperWorld.h; sourceTree = "<group>"; };
+		BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWrapperWorld.cpp; sourceTree = "<group>"; };
+		BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMObjectHashTableMap.h; sourceTree = "<group>"; };
+		BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMObjectHashTableMap.cpp; sourceTree = "<group>"; };
+		BC53DAC111432EEE000D817E /* JSDebugWrapperSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDebugWrapperSet.h; sourceTree = "<group>"; };
+		BC53DAC411432FD9000D817E /* JSDebugWrapperSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDebugWrapperSet.cpp; sourceTree = "<group>"; };
+		BC53DAC611433064000D817E /* JSDOMWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWrapper.cpp; sourceTree = "<group>"; };
 		BC56CB1C10D5AC8000A77C64 /* GeolocationController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationController.cpp; sourceTree = "<group>"; };
 		BC56CB1D10D5AC8000A77C64 /* GeolocationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationController.h; sourceTree = "<group>"; };
 		BC56CB1E10D5AC8000A77C64 /* GeolocationControllerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationControllerClient.h; sourceTree = "<group>"; };
@@ -9675,6 +9832,7 @@
 		BC904B730D10998F00680D32 /* ClassNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassNodeList.h; sourceTree = "<group>"; };
 		BC926F7E0C0552470082776B /* JSHTMLFrameSetElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElement.cpp; sourceTree = "<group>"; };
 		BC926F7F0C0552470082776B /* JSHTMLFrameSetElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFrameSetElement.h; sourceTree = "<group>"; };
+		BC9439C2116CF4940048C750 /* JSNodeCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeCustom.h; sourceTree = "<group>"; };
 		BC9462CB107A7A3900857193 /* BeforeLoadEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeLoadEvent.idl; sourceTree = "<group>"; };
 		BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeforeLoadEvent.h; sourceTree = "<group>"; };
 		BC946345107A934B00857193 /* JSBeforeLoadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBeforeLoadEvent.cpp; sourceTree = "<group>"; };
@@ -9931,13 +10089,18 @@
 		C5160EE91004543A00A7CEE2 /* StorageAreaImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaImpl.h; sourceTree = "<group>"; };
 		C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespaceImpl.h; sourceTree = "<group>"; };
 		C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = "<group>"; };
+		C5D4AA77116BAFB60069CA93 /* GlyphMetricsMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphMetricsMap.cpp; sourceTree = "<group>"; };
+		C5D4AA78116BAFB60069CA93 /* GlyphMetricsMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlyphMetricsMap.h; sourceTree = "<group>"; };
 		C5E9B67610697E1300C7BB1A /* StorageEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageEventDispatcher.cpp; sourceTree = "<group>"; };
 		C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageEventDispatcher.h; sourceTree = "<group>"; };
 		C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; };
 		C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; };
+		CE172E001136E8CE0062A533 /* ZoomMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZoomMode.h; sourceTree = "<group>"; };
 		CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLNoScriptElement.cpp; sourceTree = "<group>"; };
 		CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLNoScriptElement.h; sourceTree = "<group>"; };
 		CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceProvider.h; sourceTree = "<group>"; };
+		CEF418CC1179678C009D112C /* ViewportArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportArguments.cpp; sourceTree = "<group>"; };
+		CEF418CD1179678C009D112C /* ViewportArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewportArguments.h; sourceTree = "<group>"; };
 		D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; };
 		D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
 		D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
@@ -9998,6 +10161,12 @@
 		E12EDBE90B308E0B002704B6 /* EventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTarget.cpp; sourceTree = "<group>"; };
 		E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
 		E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
+		E169803C1133542D00894115 /* CRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRuntimeObject.h; sourceTree = "<group>"; };
+		E16980481133644700894115 /* CRuntimeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CRuntimeObject.cpp; sourceTree = "<group>"; };
+		E16982541134629D00894115 /* ObjCRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCRuntimeObject.h; sourceTree = "<group>"; };
+		E169825F1134636A00894115 /* ObjCRuntimeObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObjCRuntimeObject.mm; sourceTree = "<group>"; };
+		E1698263113467F300894115 /* JavaRuntimeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaRuntimeObject.cpp; path = jsc/JavaRuntimeObject.cpp; sourceTree = "<group>"; };
+		E16982671134680700894115 /* JavaRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaRuntimeObject.h; path = jsc/JavaRuntimeObject.h; sourceTree = "<group>"; };
 		E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContext.cpp; sourceTree = "<group>"; };
 		E182568E0EF2B02D00933242 /* JSWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContext.h; sourceTree = "<group>"; };
 		E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextCustom.cpp; sourceTree = "<group>"; };
@@ -10039,6 +10208,7 @@
 		E1CA5CD20E8CDE8000E8EF90 /* JSWorkerConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerConstructor.h; sourceTree = "<group>"; };
 		E1CA5CD50E8CDEE900E8EF90 /* JSWorkerConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerConstructor.cpp; sourceTree = "<group>"; };
 		E1CAA5C50E8BD23600A73ECA /* JSWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorker.h; sourceTree = "<group>"; };
+		E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsKeyboardCodes.h; sourceTree = "<group>"; };
 		E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = "<group>"; };
 		E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSHTMLSelectElement.h; sourceTree = "<group>"; };
 		E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCharsetRule.cpp; sourceTree = "<group>"; };
@@ -10077,7 +10247,10 @@
 		E44614110CD6826900FADA75 /* JSMediaError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaError.h; sourceTree = "<group>"; };
 		E44614120CD6826900FADA75 /* JSTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTimeRanges.cpp; sourceTree = "<group>"; };
 		E44614130CD6826900FADA75 /* JSTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTimeRanges.h; sourceTree = "<group>"; };
+		E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; };
 		E472053A0E5A053A0006BB4D /* CachedResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceHandle.h; sourceTree = "<group>"; };
+		E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomEvent.cpp; sourceTree = "<group>"; };
+		E4778B7E115A581A00B5D372 /* JSCustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomEvent.h; sourceTree = "<group>"; };
 		E47B4BE60E71241600038854 /* CachedResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceHandle.h; sourceTree = "<group>"; };
 		E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceHandle.cpp; sourceTree = "<group>"; };
 		E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnitBezier.h; sourceTree = "<group>"; };
@@ -10119,8 +10292,14 @@
 		ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = EditorMac.mm; path = mac/EditorMac.mm; sourceTree = "<group>"; };
 		EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
 		EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
+		F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClient.h; sourceTree = "<group>"; };
+		F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClientLocal.h; sourceTree = "<group>"; };
+		F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendClientLocal.cpp; sourceTree = "<group>"; };
 		F3644AFD1119805900E0D537 /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = "<group>"; };
 		F3644AFE1119805900E0D537 /* InjectedScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScript.h; sourceTree = "<group>"; };
+		F375CC061150D300008DDB81 /* InspectorWorkerResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWorkerResource.h; sourceTree = "<group>"; };
+		F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextErrorHandler.cpp; sourceTree = "<group>"; };
+		F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContextErrorHandler.h; sourceTree = "<group>"; };
 		F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenTypeSanitizer.cpp; path = opentype/OpenTypeSanitizer.cpp; sourceTree = "<group>"; };
 		F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenTypeSanitizer.h; path = opentype/OpenTypeSanitizer.h; sourceTree = "<group>"; };
 		F523D23B02DE4396018635CA /* HTMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -10167,12 +10346,22 @@
 		F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
 		F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
 		F9F0ED780DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLHttpRequestProgressEvent.idl; sourceTree = "<group>"; };
+		FA0B1F8211125CEE007F9839 /* RenderMathMLMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLMath.cpp; sourceTree = "<group>"; };
+		FA0B1F8311125CEE007F9839 /* RenderMathMLMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLMath.h; sourceTree = "<group>"; };
+		FA0B1F8411125CEE007F9839 /* RenderMathMLRow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLRow.cpp; sourceTree = "<group>"; };
+		FA0B1F8511125CEE007F9839 /* RenderMathMLRow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLRow.h; sourceTree = "<group>"; };
+		FA5FAE4011126A5D00D3750F /* RenderMathMLOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLOperator.cpp; sourceTree = "<group>"; };
+		FA5FAE4111126A5D00D3750F /* RenderMathMLOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLOperator.h; sourceTree = "<group>"; };
 		FA654A631108ABB7002615E0 /* mathml.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mathml.css; sourceTree = "<group>"; };
 		FA654A671108ABE2002615E0 /* mathattrs.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathattrs.in; sourceTree = "<group>"; };
 		FA654A691108ABED002615E0 /* MathMLTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLTextElement.cpp; sourceTree = "<group>"; };
 		FA654A6A1108ABED002615E0 /* MathMLTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLTextElement.h; sourceTree = "<group>"; };
 		FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLBlock.cpp; sourceTree = "<group>"; };
 		FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLBlock.h; sourceTree = "<group>"; };
+		FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLUnderOver.cpp; sourceTree = "<group>"; };
+		FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLUnderOver.h; sourceTree = "<group>"; };
+		FAA1056E114C2DF700940A01 /* RenderMathMLFraction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLFraction.cpp; sourceTree = "<group>"; };
+		FAA1056F114C2DF700940A01 /* RenderMathMLFraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLFraction.h; sourceTree = "<group>"; };
 		FABE72ED1059C1EB00D999DD /* MathMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElement.cpp; sourceTree = "<group>"; };
 		FABE72EE1059C1EB00D999DD /* MathMLElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLElement.h; sourceTree = "<group>"; };
 		FABE72EF1059C1EB00D999DD /* MathMLInlineContainerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLInlineContainerElement.cpp; sourceTree = "<group>"; };
@@ -10182,6 +10371,8 @@
 		FABE72F31059C1EB00D999DD /* mathtags.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mathtags.in; sourceTree = "<group>"; };
 		FABE72FB1059C21100D999DD /* MathMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLElementFactory.cpp; sourceTree = "<group>"; };
 		FABE72FC1059C21100D999DD /* MathMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLNames.cpp; sourceTree = "<group>"; };
+		FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLSubSup.cpp; sourceTree = "<group>"; };
+		FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSubSup.h; sourceTree = "<group>"; };
 		FE136AE710643BE50078CF6D /* WebCore.OrientationEvents.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.OrientationEvents.exp; sourceTree = "<group>"; };
 		FE49BD301061719100D0E1AE /* WebCore.Inspector.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.Inspector.exp; sourceTree = "<group>"; };
 		FE49EF970DC51462004266E1 /* DashboardSupportCSSPropertyNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DashboardSupportCSSPropertyNames.in; sourceTree = "<group>"; };
@@ -10439,6 +10630,8 @@
 				1A569CCB0D7E2B82007C3983 /* c_runtime.h */,
 				1A569CCC0D7E2B82007C3983 /* c_utility.cpp */,
 				1A569CCD0D7E2B82007C3983 /* c_utility.h */,
+				E16980481133644700894115 /* CRuntimeObject.cpp */,
+				E169803C1133542D00894115 /* CRuntimeObject.h */,
 			);
 			name = c;
 			path = bridge/c;
@@ -10472,6 +10665,8 @@
 				1A569CE90D7E2B82007C3983 /* objc_runtime.mm */,
 				1A569CEA0D7E2B82007C3983 /* objc_utility.h */,
 				1A569CEB0D7E2B82007C3983 /* objc_utility.mm */,
+				E16982541134629D00894115 /* ObjCRuntimeObject.h */,
+				E169825F1134636A00894115 /* ObjCRuntimeObject.mm */,
 				1A569CEC0D7E2B82007C3983 /* WebScriptObject.h */,
 			);
 			name = objc;
@@ -10534,6 +10729,7 @@
 				519611600CAC56570010A80C /* Database.idl */,
 				51A45B550CAD7FD7000D2BE9 /* DatabaseAuthorizer.cpp */,
 				51A45B540CAD7FD7000D2BE9 /* DatabaseAuthorizer.h */,
+				B5D36019112F8B560048DEA8 /* DatabaseCallback.h */,
 				5116D9750CF177BD00C2B84D /* DatabaseDetails.h */,
 				519611E90CAC749C0010A80C /* DatabaseTask.cpp */,
 				519611E80CAC749C0010A80C /* DatabaseTask.h */,
@@ -10610,6 +10806,10 @@
 				7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
 				1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */,
 				1C5FAED00DCFD90100D58F78 /* JSJavaScriptCallFrame.h */,
+				9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */,
+				9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */,
+				9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */,
+				9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */,
 			);
 			name = Inspector;
 			sourceTree = "<group>";
@@ -10639,6 +10839,9 @@
 				41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */,
 				7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */,
 				7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */,
+				F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */,
+				F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */,
+				F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */,
 				7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */,
 				7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */,
 				7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
@@ -10646,13 +10849,13 @@
 				41F061FF0F5F0B6600A07EAC /* InspectorResource.h */,
 				754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
 				754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
-				1C81BA030E97348300266E07 /* JavaScriptCallFrame.cpp */,
-				1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */,
+				F375CC061150D300008DDB81 /* InspectorWorkerResource.h */,
 				1C81BA050E97348300266E07 /* JavaScriptCallFrame.idl */,
-				1C81BA060E97348300266E07 /* JavaScriptDebugListener.h */,
-				1C81BA070E97348300266E07 /* JavaScriptDebugServer.cpp */,
-				1C81BA080E97348300266E07 /* JavaScriptDebugServer.h */,
 				BCC64F5F0DCFB84E0081EF3B /* localizedStrings.js */,
+				7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */,
+				7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */,
+				9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */,
+				9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */,
 				7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */,
 				7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */,
 			);
@@ -10703,6 +10906,8 @@
 				76CDD2EF1103DA6600680521 /* AccessibilityMenuListPopup.h */,
 				29A8121E0FBB9C1D00510293 /* AccessibilityObject.cpp */,
 				29A812180FBB9C1D00510293 /* AccessibilityObject.h */,
+				A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */,
+				A409C983116D0DDD007197BD /* AccessibilityProgressIndicator.h */,
 				29A812080FBB9C1D00510293 /* AccessibilityRenderObject.cpp */,
 				29A8121B0FBB9C1D00510293 /* AccessibilityRenderObject.h */,
 				93C4F6E81108F9A50099D0DB /* AccessibilityScrollbar.cpp */,
@@ -10943,8 +11148,8 @@
 		49E911B20EF86D27009D0CAF /* transforms */ = {
 			isa = PBXGroup;
 			children = (
-				84D0C4051115F1EA0018AA34 /* AffineTransform.h */,
 				84D0C4031115F1D40018AA34 /* AffineTransform.cpp */,
+				84D0C4051115F1EA0018AA34 /* AffineTransform.h */,
 				49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */,
 				49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */,
 				49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */,
@@ -11159,6 +11364,8 @@
 				510D4A49103177A20049EA54 /* WebSocketChannelClient.h */,
 				51ABAE421043AB4A008C5260 /* WebSocketHandshake.cpp */,
 				51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */,
+				7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */,
+				7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */,
 				5112247710CFB8F4008099D7 /* WorkerThreadableWebSocketChannel.cpp */,
 				5112247910CFB8FF008099D7 /* WorkerThreadableWebSocketChannel.h */,
 			);
@@ -11172,6 +11379,8 @@
 				59E560A61105336600AA1258 /* JavaClassJSC.h */,
 				59A9E7AF1104758800DFB4C1 /* JavaInstanceJSC.cpp */,
 				59A9E7B11104759400DFB4C1 /* JavaInstanceJSC.h */,
+				E1698263113467F300894115 /* JavaRuntimeObject.cpp */,
+				E16982671134680700894115 /* JavaRuntimeObject.h */,
 				59BC393E11054A1300FD85DB /* JavaStringJSC.h */,
 				59E842671109E5AE000305AD /* JNIBridgeJSC.cpp */,
 				59E842651109E5A2000305AD /* JNIBridgeJSC.h */,
@@ -11370,6 +11579,7 @@
 				F58784F002DE375901EA4122 /* CursorMac.mm */,
 				A795463D0B5C4C80007B438F /* DragDataMac.mm */,
 				A7CFB3D40B7ED1180070C32D /* DragImageMac.mm */,
+				5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */,
 				1CA19E030DC255950065A994 /* EventLoopMac.mm */,
 				066C772C0AB603D200238CC4 /* FileChooserMac.mm */,
 				514B3F750C722055000530DF /* FileSystemMac.mm */,
@@ -11485,6 +11695,8 @@
 				BC56CB1E10D5AC8000A77C64 /* GeolocationControllerClient.h */,
 				BC56CB1F10D5AC8000A77C64 /* GeolocationError.h */,
 				BC56CB2010D5AC8000A77C64 /* GeolocationPosition.h */,
+				596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */,
+				596229791133EFE200DC4CBB /* GeolocationPositionCache.h */,
 				FE80D7BB0E9C1F25000D6F75 /* Geoposition.h */,
 				FE80D7BC0E9C1F25000D6F75 /* Geoposition.idl */,
 				7693BACE106C2DCA007B0823 /* HaltablePlugin.h */,
@@ -11528,6 +11740,8 @@
 				BCD0E0F90E972C3500265DEA /* SecurityOriginHash.h */,
 				14C9A5E90B3D105F005A0232 /* Settings.cpp */,
 				F587863A02DE3A1401EA4122 /* Settings.h */,
+				626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
+				626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
 				BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */,
 				BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */,
 				BCA2B0601050475F0043BD1C /* UserScript.h */,
@@ -11543,6 +11757,7 @@
 				E1271A510EEECD1C00F61213 /* WorkerNavigator.idl */,
 				97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */,
 				97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */,
+				CE172E001136E8CE0062A533 /* ZoomMode.h */,
 			);
 			path = page;
 			sourceTree = "<group>";
@@ -12340,6 +12555,8 @@
 				85ECBEEA0AA7626900544F0B /* DOMHTMLParamElement.mm */,
 				85183B3E0AA6926100F19FA3 /* DOMHTMLPreElement.h */,
 				85183B3F0AA6926100F19FA3 /* DOMHTMLPreElement.mm */,
+				A4226E921163D73A008B8397 /* DOMHTMLProgressElement.h */,
+				A4226E931163D73A008B8397 /* DOMHTMLProgressElement.mm */,
 				85183B400AA6926100F19FA3 /* DOMHTMLQuoteElement.h */,
 				85183B410AA6926100F19FA3 /* DOMHTMLQuoteElement.mm */,
 				85DF81930AA77E4B00486AD7 /* DOMHTMLScriptElement.h */,
@@ -12454,6 +12671,7 @@
 				85E711720AC5D5350053270F /* DOMHTMLParagraphElementInternal.h */,
 				85E711730AC5D5350053270F /* DOMHTMLParamElementInternal.h */,
 				85E711740AC5D5350053270F /* DOMHTMLPreElementInternal.h */,
+				A4226E981163D7CC008B8397 /* DOMHTMLProgressElementInternal.h */,
 				85E711750AC5D5350053270F /* DOMHTMLQuoteElementInternal.h */,
 				85E711760AC5D5350053270F /* DOMHTMLScriptElementInternal.h */,
 				85E711770AC5D5350053270F /* DOMHTMLSelectElementInternal.h */,
@@ -12776,6 +12994,14 @@
 		93EEC1EC09C2877700C515D1 /* html */ = {
 			isa = PBXGroup;
 			children = (
+				895253DE116C4F0600CABF00 /* FileThreadTask.h */,
+				895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */,
+				895253DB116C4EF500CABF00 /* FileStreamProxy.h */,
+				895253D4116C4C6800CABF00 /* FileStream.cpp */,
+				895253D5116C4C6800CABF00 /* FileStream.h */,
+				895253D6116C4C6800CABF00 /* FileStreamClient.h */,
+				8952535011641B3400CABF00 /* FileThread.cpp */,
+				8952535111641B3400CABF00 /* FileThread.h */,
 				49484FAE102CF01E00187DD3 /* canvas */,
 				2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */,
 				2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */,
@@ -12794,6 +13020,9 @@
 				F5D3A57B106B83B300545297 /* DateComponents.h */,
 				BC7DAAEC0FF9615D00CE0138 /* DOMDataGridDataSource.cpp */,
 				BC7DAAED0FF9615D00CE0138 /* DOMDataGridDataSource.h */,
+				2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
+				2ED609BB1145B07100C8684E /* DOMFormData.h */,
+				2E0888C3114883A900AF4265 /* DOMFormData.idl */,
 				BCDBB8CC0E08958400C60FF6 /* File.cpp */,
 				BCDBB8CB0E08958400C60FF6 /* File.h */,
 				BC1881D90E08C4ED00048C13 /* File.idl */,
@@ -12993,6 +13222,9 @@
 				A8EA7C9F0A192B9C00A8EF5F /* HTMLPreElement.cpp */,
 				A8EA7CA20A192B9C00A8EF5F /* HTMLPreElement.h */,
 				1AE2AB850A1CE85000B42B25 /* HTMLPreElement.idl */,
+				A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */,
+				A43BF5971149290A00C643CA /* HTMLProgressElement.h */,
+				A4226EA51163D84D008B8397 /* HTMLProgressElement.idl */,
 				A8CFF79B0A156978000A4234 /* HTMLQuoteElement.cpp */,
 				A8CFF7990A156978000A4234 /* HTMLQuoteElement.h */,
 				1AE2AEA30A1D28E800B42B25 /* HTMLQuoteElement.idl */,
@@ -13054,6 +13286,8 @@
 				E446139C0CD6331000FADA75 /* MediaError.idl */,
 				E4D4ABE00D7542F000F96869 /* PreloadScanner.cpp */,
 				E4D4ABE10D7542F100F96869 /* PreloadScanner.h */,
+				A5AFB34D115151A700B045CB /* StepRange.cpp */,
+				A5AFB34E115151A700B045CB /* StepRange.h */,
 				BCEF45E80E687767001C1287 /* TextMetrics.h */,
 				BCEF453F0E676AC1001C1287 /* TextMetrics.idl */,
 				E446139D0CD6331000FADA75 /* TimeRanges.cpp */,
@@ -13070,6 +13304,24 @@
 			tabWidth = 4;
 			usesTabs = 0;
 		};
+		A59E3C1B11580F340072928E /* iphone */ = {
+			isa = PBXGroup;
+			children = (
+				A59E3C1C11580F510072928E /* KeyEventCodesIPhone.h */,
+				A59E3C1D11580F510072928E /* KeyEventIPhone.mm */,
+			);
+			name = iphone;
+			sourceTree = "<group>";
+		};
+		A5C974CE11485FDA0066F2AB /* cocoa */ = {
+			isa = PBXGroup;
+			children = (
+				A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */,
+				A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */,
+			);
+			name = cocoa;
+			sourceTree = "<group>";
+		};
 		A75E8B7F0E1DE2B0007F2481 /* filters */ = {
 			isa = PBXGroup;
 			children = (
@@ -13111,6 +13363,8 @@
 				BC77D1660FF19F550070887B /* JSDataGridColumn.h */,
 				BC77D1670FF19F550070887B /* JSDataGridColumnList.cpp */,
 				BC77D1680FF19F550070887B /* JSDataGridColumnList.h */,
+				2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */,
+				2E0888D31148848A00AF4265 /* JSDOMFormData.h */,
 				BC00F0100E0A189500FD04E3 /* JSFile.cpp */,
 				BC00F0110E0A189500FD04E3 /* JSFile.h */,
 				BC00F0120E0A189500FD04E3 /* JSFileList.cpp */,
@@ -13225,6 +13479,8 @@
 				1AE2ABA10A1CE90500B42B25 /* JSHTMLParamElement.h */,
 				1AE2ABA20A1CE90500B42B25 /* JSHTMLPreElement.cpp */,
 				1AE2ABA30A1CE90500B42B25 /* JSHTMLPreElement.h */,
+				A4226E591163D667008B8397 /* JSHTMLProgressElement.cpp */,
+				A4226E5B1163D695008B8397 /* JSHTMLProgressElement.h */,
 				1AE2AEC30A1D297B00B42B25 /* JSHTMLQuoteElement.cpp */,
 				1AE2AEC40A1D297B00B42B25 /* JSHTMLQuoteElement.h */,
 				1AE2ABA40A1CE90500B42B25 /* JSHTMLScriptElement.cpp */,
@@ -13720,6 +13976,8 @@
 				BC946347107A936600857193 /* JSBeforeLoadEvent.h */,
 				79AC9216109945C80021266E /* JSCompositionEvent.cpp */,
 				79AC9217109945C80021266E /* JSCompositionEvent.h */,
+				E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */,
+				E4778B7E115A581A00B5D372 /* JSCustomEvent.h */,
 				2ECF7ADA10162B3800427DE7 /* JSErrorEvent.cpp */,
 				2ECF7ADB10162B3800427DE7 /* JSErrorEvent.h */,
 				14E8378309F85D1C00B85AE4 /* JSEvent.cpp */,
@@ -14272,13 +14530,7 @@
 				B25599190D00D8B900BB825C /* SVGPaintServerSolid.h */,
 				B255991A0D00D8B900BB825C /* SVGResource.cpp */,
 				B255991B0D00D8B900BB825C /* SVGResource.h */,
-				B255991C0D00D8B900BB825C /* SVGResourceClipper.cpp */,
-				B255991D0D00D8B900BB825C /* SVGResourceClipper.h */,
-				B255991E0D00D8B900BB825C /* SVGResourceFilter.cpp */,
-				B255991F0D00D8B900BB825C /* SVGResourceFilter.h */,
 				B25599200D00D8B900BB825C /* SVGResourceListener.h */,
-				B25599210D00D8B900BB825C /* SVGResourceMarker.cpp */,
-				B25599220D00D8B900BB825C /* SVGResourceMarker.h */,
 			);
 			path = graphics;
 			sourceTree = "<group>";
@@ -14437,10 +14689,10 @@
 				BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */,
 				BCE04C890DAFF7A0007A0F41 /* Generator.h */,
 				B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */,
+				C5D4AA77116BAFB60069CA93 /* GlyphMetricsMap.cpp */,
+				C5D4AA78116BAFB60069CA93 /* GlyphMetricsMap.h */,
 				B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */,
 				B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */,
-				B2C3DA5E0D006CD600EF6F26 /* GlyphWidthMap.cpp */,
-				B2C3DA5F0D006CD600EF6F26 /* GlyphWidthMap.h */,
 				BC53C6070DA56C570021EB5D /* Gradient.cpp */,
 				BC53C5F40DA56B920021EB5D /* Gradient.h */,
 				B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */,
@@ -14460,6 +14712,7 @@
 				BC7F44A70B9E324E00A9D081 /* ImageObserver.h */,
 				B27535430B053814002CE64F /* ImageSource.h */,
 				B27535440B053814002CE64F /* IntPoint.h */,
+				E462A4A0113E71BE004A4220 /* IntPointHash.h */,
 				B27535450B053814002CE64F /* IntRect.cpp */,
 				B27535460B053814002CE64F /* IntRect.h */,
 				B27535470B053814002CE64F /* IntSize.h */,
@@ -14505,7 +14758,6 @@
 			children = (
 				B2B264590D00A77E000ACC1D /* cf */,
 				B2C3D9F90D006C1D00EF6F26 /* mac */,
-				B2C3D9ED0D006C1D00EF6F26 /* AtomicString.cpp */,
 				B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */,
 				0FC705200EB1815600B90AD8 /* AtomicStringHash.h */,
 				B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */,
@@ -14515,8 +14767,6 @@
 				B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */,
 				B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */,
 				B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */,
-				B2C3D9F60D006C1D00EF6F26 /* CString.cpp */,
-				B2C3D9F70D006C1D00EF6F26 /* CString.h */,
 				BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
 				B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */,
 				B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */,
@@ -14528,8 +14778,8 @@
 				E1A302C00DE8376900C52F2C /* StringBuilder.cpp */,
 				E1A302BB0DE8370300C52F2C /* StringBuilder.h */,
 				B2C3DA010D006C1D00EF6F26 /* StringHash.h */,
-				B2C3DA020D006C1D00EF6F26 /* StringImpl.cpp */,
 				B2C3DA030D006C1D00EF6F26 /* StringImpl.h */,
+				97C0784F1165D5BE003A32EF /* SuffixTree.h */,
 				B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */,
 				B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */,
 				B2C3DA070D006C1D00EF6F26 /* TextBreakIteratorICU.cpp */,
@@ -14614,9 +14864,16 @@
 				14DFB33F0A7DF7630018F769 /* Derived Sources */,
 				BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
 				93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
-				A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */,
+				BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */,
+				BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */,
+				BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */,
+				BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */,
 				1432E8480C51493F00B1500F /* GCController.cpp */,
 				1432E8460C51493800B1500F /* GCController.h */,
+				B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */,
+				B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */,
+				BC53DAC411432FD9000D817E /* JSDebugWrapperSet.cpp */,
+				BC53DAC111432EEE000D817E /* JSDebugWrapperSet.h */,
 				93B70D4709EB0C7C009D8468 /* JSDOMBinding.cpp */,
 				93B70D4809EB0C7C009D8468 /* JSDOMBinding.h */,
 				E1C36CBC0EB08062007410BC /* JSDOMGlobalObject.cpp */,
@@ -14625,6 +14882,8 @@
 				BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */,
 				BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp */,
 				BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */,
+				BC53DAC611433064000D817E /* JSDOMWrapper.cpp */,
+				65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
 				BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */,
 				BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */,
 				3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
@@ -14637,10 +14896,10 @@
 				B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */,
 				E1C36D320EB0A094007410BC /* JSWorkerContextBase.cpp */,
 				E1C36D330EB0A094007410BC /* JSWorkerContextBase.h */,
-				9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */,
-				9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */,
-				9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */,
-				9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */,
+				F3D461461161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp */,
+				F3D461471161D53200CA0D09 /* JSWorkerContextErrorHandler.h */,
+				1C81BA030E97348300266E07 /* JavaScriptCallFrame.cpp */,
+				1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */,
 				BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,
 				BCA378BB0D15F64200B793D6 /* ScheduledAction.h */,
 				7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */,
@@ -14664,6 +14923,7 @@
 				41F066E30F64BCF600A07EAC /* ScriptObject.cpp */,
 				41F066E20F64BCF600A07EAC /* ScriptObject.h */,
 				9F72304C11184B4100AD0126 /* ScriptProfile.h */,
+				9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */,
 				9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */,
 				9F72304E11184B4100AD0126 /* ScriptProfiler.h */,
 				934CC1090EDB223900A658F2 /* ScriptSourceCode.h */,
@@ -14677,6 +14937,7 @@
 				A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */,
 				A75E497410752ACB00C9B896 /* SerializedScriptValue.h */,
 				65488D6A0DD5A83D009D83B2 /* StringSourceProvider.h */,
+				BC53D910114310CC000D817E /* WebCoreJSClientData.h */,
 				E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */,
 				E1A643F10EC0972500779668 /* WorkerScriptController.h */,
 			);
@@ -14737,35 +14998,13 @@
 				49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
 				49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */,
 				93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
-				93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
-				BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */,
 				BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */,
 				C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */,
-				C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */,
-				FE700DD00F92D81A008E2BFE /* JSCoordinatesCustom.cpp */,
 				FE700DD00F92D81A008E2BFE /* JSCoordinatesCustom.cpp */,
 				BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
-				BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
-				9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
 				9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
 				BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
-				BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
 				BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
-				BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
-				FE80D7A20E9C1ED2000D6F75 /* JSCustomPositionCallback.cpp */,
-				FE80D7A30E9C1ED2000D6F75 /* JSCustomPositionCallback.h */,
-				FE80D7A40E9C1ED2000D6F75 /* JSCustomPositionErrorCallback.cpp */,
-				FE80D7A50E9C1ED2000D6F75 /* JSCustomPositionErrorCallback.h */,
-				51EC925B0CE90DD400F90308 /* JSCustomSQLStatementCallback.cpp */,
-				51EC925C0CE90DD400F90308 /* JSCustomSQLStatementCallback.h */,
-				51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */,
-				51EC925E0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.h */,
-				51EC925F0CE90DD400F90308 /* JSCustomSQLTransactionCallback.cpp */,
-				51EC92600CE90DD400F90308 /* JSCustomSQLTransactionCallback.h */,
-				51EC92610CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.cpp */,
-				51EC92620CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.h */,
-				1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */,
-				1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */,
 				BCCE58AB1061E8CF008FB35A /* JSDatabaseCustom.cpp */,
 				BC77D1510FF19C730070887B /* JSDataGridColumnListCustom.cpp */,
 				4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
@@ -14773,6 +15012,7 @@
 				49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
 				BCCE58AE1061E90C008FB35A /* JSDocumentFragmentCustom.cpp */,
 				1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
+				2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
 				BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
 				652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
 				BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */,
@@ -14810,6 +15050,7 @@
 				BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */,
 				A9C6E6480D7465D8006442E9 /* JSNavigatorCustom.cpp */,
 				BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */,
+				BC9439C2116CF4940048C750 /* JSNodeCustom.h */,
 				BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */,
 				1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
 				BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */,
@@ -14828,6 +15069,7 @@
 				B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
 				B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */,
 				087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */,
+				9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */,
 				1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */,
 				516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */,
 				492273A21083B3B100EE5C84 /* JSWebGLArrayCustom.cpp */,
@@ -15006,6 +15248,8 @@
 				656D371E0ADBA5DE00A4554D /* DocumentLoader.h */,
 				0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */,
 				0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */,
+				9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */,
+				9738899F116EA9DC00ADF313 /* DocumentWriter.h */,
 				B255990D0D00D8B900BB825C /* EmptyClients.h */,
 				656D37230ADBA5DE00A4554D /* FormState.cpp */,
 				656D37220ADBA5DE00A4554D /* FormState.h */,
@@ -15165,7 +15409,9 @@
 			children = (
 				49E912A40EFAC8E6009D0CAF /* animation */,
 				1AE42F670AA4B8CB00C8612D /* cf */,
+				A5C974CE11485FDA0066F2AB /* cocoa */,
 				B2A015910AF6CD53006BCE0E /* graphics */,
+				A59E3C1B11580F340072928E /* iphone */,
 				6582A14809999D6C00BEEB6D /* mac */,
 				59C77F101054591C00506104 /* mock */,
 				656B84D70AEA1CE900A095B4 /* network */,
@@ -15236,12 +15482,13 @@
 				BC2441C30E8B65D00055320F /* ScrollView.cpp */,
 				BC6D6E2509AF943500F59759 /* ScrollView.h */,
 				AB7170880B3118080017123E /* SearchPopupMenu.h */,
+				33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */,
+				33C0CCD3112C5E6200CE057D /* SecureTextInput.h */,
 				1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */,
 				1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */,
 				93309EA0099EB78C0056E581 /* SharedTimer.h */,
 				4B3043C60AE0370300A82647 /* Sound.h */,
 				F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */,
-				9352071709BD3BA500F2038D /* StaticConstructors.h */,
 				93B2D8150F9920D2006AE6B2 /* SuddenTermination.h */,
 				93E62D990985F41600E1B5E3 /* SystemTime.h */,
 				BCE65D310EAD1211007E4533 /* Theme.cpp */,
@@ -15255,8 +15502,11 @@
 				93309EA1099EB78C0056E581 /* Timer.cpp */,
 				9305B24C098F1B6B00C28855 /* Timer.h */,
 				1419D2C40CEA6F6100FF507A /* TreeShared.h */,
+				2E3BBF051162DA1100B9409A /* UUID.cpp */,
+				2E3BBF061162DA1100B9409A /* UUID.h */,
 				9380F47109A11AB4001FDB34 /* Widget.cpp */,
 				9380F47209A11AB4001FDB34 /* Widget.h */,
+				E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */,
 			);
 			path = platform;
 			sourceTree = "<group>";
@@ -15302,6 +15552,8 @@
 				BC60D9C80D2A29E500B9918F /* XMLHttpRequestException.idl */,
 				F9F0ED770DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h */,
 				F9F0ED780DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.idl */,
+				A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */,
+				A136A00B1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h */,
 				BCDFD48D0E305290009D10AD /* XMLHttpRequestUpload.cpp */,
 				BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */,
 				BCDFD4900E305644009D10AD /* XMLHttpRequestUpload.idl */,
@@ -15583,6 +15835,8 @@
 		F523D2F302DE443B018635CA /* rendering */ = {
 			isa = PBXGroup;
 			children = (
+				841FDC241178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp */,
+				841FDC251178C9BE00F8AC9B /* RenderSVGResourceFilter.h */,
 				BC8C8FAA0DDCD2F200B592F4 /* style */,
 				A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */,
 				A8CFF0490A154F09000A4234 /* AutoTableLayout.h */,
@@ -15605,7 +15859,6 @@
 				A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */,
 				A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */,
 				BCE789151120D6080060ECE5 /* InlineIterator.h */,
-				A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */,
 				BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
 				BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
 				2D9066040BE141D400956998 /* LayoutState.cpp */,
@@ -15646,10 +15899,14 @@
 				853CA9EB0AEEC63C002372DC /* RenderForeignObject.h */,
 				A871DECC0A1530C700B12A68 /* RenderFrame.cpp */,
 				A871DECB0A1530C700B12A68 /* RenderFrame.h */,
+				0FD3080C117CF7E700A791F7 /* RenderFrameBase.cpp */,
+				0FD3080D117CF7E700A791F7 /* RenderFrameBase.h */,
 				A871DECA0A1530C700B12A68 /* RenderFrameSet.cpp */,
 				A871DEC90A1530C700B12A68 /* RenderFrameSet.h */,
 				BCEA482A097D93020094C9E4 /* RenderHTMLCanvas.cpp */,
 				BCEA482B097D93020094C9E4 /* RenderHTMLCanvas.h */,
+				0FD308D3117D168400A791F7 /* RenderIFrame.cpp */,
+				0FD308D4117D168400A791F7 /* RenderIFrame.h */,
 				BCEA4836097D93020094C9E4 /* RenderImage.cpp */,
 				BCEA4837097D93020094C9E4 /* RenderImage.h */,
 				BCB4F8920DB28E530039139B /* RenderImageGeneratedContent.cpp */,
@@ -15683,10 +15940,10 @@
 				BCFA930710333193007B25D1 /* RenderOverflow.h */,
 				A871DEC80A1530C700B12A68 /* RenderPart.cpp */,
 				A871DECF0A1530C700B12A68 /* RenderPart.h */,
-				A871DECE0A1530C700B12A68 /* RenderPartObject.cpp */,
-				A871DECD0A1530C700B12A68 /* RenderPartObject.h */,
 				853CA9EE0AEEC657002372DC /* RenderPath.cpp */,
 				853CA9EF0AEEC657002372DC /* RenderPath.h */,
+				A43BF59A1149292800C643CA /* RenderProgress.cpp */,
+				A43BF59B1149292800C643CA /* RenderProgress.h */,
 				A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */,
 				A871DFDF0A15376B00B12A68 /* RenderReplaced.h */,
 				BCA846D40DC67A350026C309 /* RenderReplica.cpp */,
@@ -15725,6 +15982,10 @@
 				A8F5C0B70F9285AC0098E06B /* RenderSVGModelObject.cpp */,
 				A8F5C0B60F9285AC0098E06B /* RenderSVGModelObject.h */,
 				083192A7112B43050083C3B9 /* RenderSVGResource.h */,
+				84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */,
+				84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */,
+				8499A512115FB33000F566E3 /* RenderSVGResourceMarker.cpp */,
+				8499A513115FB33000F566E3 /* RenderSVGResourceMarker.h */,
 				083192A8112B43050083C3B9 /* RenderSVGResourceMasker.cpp */,
 				083192A9112B43050083C3B9 /* RenderSVGResourceMasker.h */,
 				AA31B5B20C1DFD1000AE7083 /* RenderSVGRoot.cpp */,
@@ -15824,6 +16085,8 @@
 				AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */,
 				85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */,
 				85031B270A44EFC700F992E0 /* BeforeUnloadEvent.h */,
+				0BC2C7751134A8FC000B2F61 /* CanvasSurface.cpp */,
+				0BC2C7761134A8FC000B2F61 /* CanvasSurface.h */,
 				6550B693099DF0270090D781 /* CDATASection.cpp */,
 				6550B694099DF0270090D781 /* CDATASection.h */,
 				85089CC90A98C2AB00A275AA /* CDATASection.idl */,
@@ -15859,6 +16122,9 @@
 				E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */,
 				A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */,
 				A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */,
+				62CD32561157E57C0063B0A7 /* CustomEvent.cpp */,
+				62CD32571157E57C0063B0A7 /* CustomEvent.h */,
+				62CD32581157E57C0063B0A7 /* CustomEvent.idl */,
 				A8185F3409765765005826D9 /* Document.cpp */,
 				A8185F3809765765005826D9 /* Document.h */,
 				6548E24809E1E04D00AF8020 /* Document.idl */,
@@ -16033,6 +16299,10 @@
 				141B94EE09EC425A000E9413 /* UIEvent.idl */,
 				93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */,
 				85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */,
+				2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */,
+				2542F4D91166C25A00E89A86 /* UserGestureIndicator.h */,
+				CEF418CC1179678C009D112C /* ViewportArguments.cpp */,
+				CEF418CD1179678C009D112C /* ViewportArguments.h */,
 				31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */,
 				31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */,
 				31C0FF1D0E4CEB6E007D6FE5 /* WebKitAnimationEvent.idl */,
@@ -16068,6 +16338,18 @@
 				FABE72F31059C1EB00D999DD /* mathtags.in */,
 				FA654A6D1108ABFF002615E0 /* RenderMathMLBlock.cpp */,
 				FA654A6E1108ABFF002615E0 /* RenderMathMLBlock.h */,
+				FAA1056E114C2DF700940A01 /* RenderMathMLFraction.cpp */,
+				FAA1056F114C2DF700940A01 /* RenderMathMLFraction.h */,
+				FA0B1F8211125CEE007F9839 /* RenderMathMLMath.cpp */,
+				FA0B1F8311125CEE007F9839 /* RenderMathMLMath.h */,
+				FA5FAE4011126A5D00D3750F /* RenderMathMLOperator.cpp */,
+				FA5FAE4111126A5D00D3750F /* RenderMathMLOperator.h */,
+				FA0B1F8411125CEE007F9839 /* RenderMathMLRow.cpp */,
+				FA0B1F8511125CEE007F9839 /* RenderMathMLRow.h */,
+				FAC12CC21120DA6900DACC36 /* RenderMathMLSubSup.cpp */,
+				FAC12CC31120DA6900DACC36 /* RenderMathMLSubSup.h */,
+				FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */,
+				FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */,
 			);
 			path = mathml;
 			sourceTree = "<group>";
@@ -16101,6 +16383,7 @@
 				29A8123F0FBB9C1D00510293 /* AccessibilityTableHeaderContainer.h in Headers */,
 				29A812310FBB9C1D00510293 /* AccessibilityTableRow.h in Headers */,
 				E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */,
+				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
 				49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
 				316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
 				316FE1140E6E1DA700BF6088 /* AnimationController.h in Headers */,
@@ -16138,6 +16421,7 @@
 				85031B3D0A44EFC700F992E0 /* BeforeUnloadEvent.h in Headers */,
 				B2C3DA240D006C1D00EF6F26 /* BidiContext.h in Headers */,
 				B2C3DA250D006C1D00EF6F26 /* BidiResolver.h in Headers */,
+				BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */,
 				938192050F87E1EC00D5352A /* BinaryPropertyList.h in Headers */,
 				BC5EB9200E82040800B25965 /* BindingURI.h in Headers */,
 				A89943280B42338800D7C802 /* BitmapImage.h in Headers */,
@@ -16178,6 +16462,7 @@
 				49C7B9DD1042D32F0009D447 /* CanvasRenderingContext.h in Headers */,
 				49484FCB102CF23C00187DD3 /* CanvasRenderingContext2D.h in Headers */,
 				49484FCE102CF23C00187DD3 /* CanvasStyle.h in Headers */,
+				0BC2C7781134A8FC000B2F61 /* CanvasSurface.h in Headers */,
 				6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
 				514185EE0CD65F0400763C99 /* ChangeVersionWrapper.h in Headers */,
 				6550B6A0099DF0270090D781 /* CharacterData.h in Headers */,
@@ -16232,6 +16517,7 @@
 				E1C416120F6562FD0092D2FB /* CrossOriginAccessControl.h in Headers */,
 				E1C415DA0F655D6F0092D2FB /* CrossOriginPreflightResultCache.h in Headers */,
 				2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */,
+				E169803D1133542D00894115 /* CRuntimeObject.h in Headers */,
 				A80E6D070A1989CA007FB8C5 /* CSSBorderImageValue.h in Headers */,
 				BC6049CC0DB560C200204739 /* CSSCanvasValue.h in Headers */,
 				A80E6CF90A1989CA007FB8C5 /* CSSCharsetRule.h in Headers */,
@@ -16284,7 +16570,6 @@
 				BCCBE7B20E07159A00EAFA8E /* CSSVariableDependentValue.h in Headers */,
 				BCCBE68A0E06E60D00EAFA8E /* CSSVariablesDeclaration.h in Headers */,
 				BCCBE68C0E06E60D00EAFA8E /* CSSVariablesRule.h in Headers */,
-				B2C3DA280D006C1D00EF6F26 /* CString.h in Headers */,
 				93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
 				BC2272A20E82E87C00E7F975 /* CursorData.h in Headers */,
 				BC2272AD0E82E8F300E7F975 /* CursorList.h in Headers */,
@@ -16292,6 +16577,7 @@
 				A80E6D0B0A1989CA007FB8C5 /* DashboardRegion.h in Headers */,
 				5196116B0CAC56570010A80C /* Database.h in Headers */,
 				51A45B560CAD7FD7000D2BE9 /* DatabaseAuthorizer.h in Headers */,
+				B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */,
 				5116D9770CF177BD00C2B84D /* DatabaseDetails.h in Headers */,
 				519611EA0CAC749C0010A80C /* DatabaseTask.h in Headers */,
 				519611780CAC56A80010A80C /* DatabaseThread.h in Headers */,
@@ -16400,6 +16686,7 @@
 				BC00F0060E0A185500FD04E3 /* DOMFileInternal.h in Headers */,
 				BC00F0070E0A185500FD04E3 /* DOMFileList.h in Headers */,
 				BC00F0090E0A185500FD04E3 /* DOMFileListInternal.h in Headers */,
+				2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */,
 				BC1A37B6097C715F0019F3D8 /* DOMHTML.h in Headers */,
 				85DF81270AA7787200486AD7 /* DOMHTMLAnchorElement.h in Headers */,
 				85E7119B0AC5D5350053270F /* DOMHTMLAnchorElementInternal.h in Headers */,
@@ -16551,7 +16838,7 @@
 				85CA96EA0A9624E900690CCF /* DOMNotation.h in Headers */,
 				85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */,
 				856C8AE40A912649005C687B /* DOMObject.h in Headers */,
-				A8EDB03D1016849400FE8113 /* DOMObjectWithSVGContext.h in Headers */,
+				BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */,
 				85C7F5D00AAFB8D9004014DD /* DOMOverflowEvent.h in Headers */,
 				85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */,
 				E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */,
@@ -17039,8 +17326,6 @@
 				316FE0800E6CCC2800BF6088 /* DOMWebKitCSSKeyframesRule.h in Headers */,
 				316FE0820E6CCC2800BF6088 /* DOMWebKitCSSKeyframesRuleInternal.h in Headers */,
 				498391500F1E76B400C23782 /* DOMWebKitCSSMatrix.h in Headers */,
-				498391500F1E76B400C23782 /* DOMWebKitCSSMatrix.h in Headers */,
-				498391520F1E76B400C23782 /* DOMWebKitCSSMatrixInternal.h in Headers */,
 				498391520F1E76B400C23782 /* DOMWebKitCSSMatrixInternal.h in Headers */,
 				31611E610E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.h in Headers */,
 				31611E630E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h in Headers */,
@@ -17049,6 +17334,7 @@
 				85C7F5E70AAFBAFB004014DD /* DOMWheelEvent.h in Headers */,
 				85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */,
 				1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
+				BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */,
 				1A1D13800A5325520064BF5F /* DOMXPath.h in Headers */,
 				858015CE0ABCA75D0080588D /* DOMXPathException.h in Headers */,
 				85E9E0A10AB3A0C700069CD0 /* DOMXPathExpression.h in Headers */,
@@ -17150,13 +17436,13 @@
 				BC56CB2310D5AC8000A77C64 /* GeolocationControllerClient.h in Headers */,
 				BC56CB2410D5AC8000A77C64 /* GeolocationError.h in Headers */,
 				BC56CB2510D5AC8000A77C64 /* GeolocationPosition.h in Headers */,
+				5962297A1133EFE200DC4CBB /* GeolocationPositionCache.h in Headers */,
 				FEAB90130EA51B9C006348C3 /* GeolocationService.h in Headers */,
 				BCE494AB0F4F5E9E0084E319 /* GeolocationServiceMac.h in Headers */,
 				59C77F2B10545B3B00506104 /* GeolocationServiceMock.h in Headers */,
 				FE80D7C90E9C1F25000D6F75 /* Geoposition.h in Headers */,
 				B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
 				B2C3DA6E0D006CD600EF6F26 /* GlyphPageTreeNode.h in Headers */,
-				B2C3DA700D006CD600EF6F26 /* GlyphWidthMap.h in Headers */,
 				BC53C5F50DA56B920021EB5D /* Gradient.h in Headers */,
 				B22279640D00BF220071B782 /* GradientAttributes.h in Headers */,
 				B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */,
@@ -17287,10 +17573,11 @@
 				4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */,
 				316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */,
 				DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */,
+				F3644B001119805900E0D537 /* InjectedScript.h in Headers */,
 				7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */,
 				A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
 				A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
-				A8CFF5E20A155A05000A4234 /* InlineRunBox.h in Headers */,
+				BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
 				BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
 				08591AA50F085C4E009BACB1 /* InputElement.h in Headers */,
 				93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */,
@@ -17306,18 +17593,20 @@
 				7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */,
 				41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */,
 				7AED3E060FBB1EAA00D2B03C /* InspectorFrontend.h in Headers */,
+				F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
+				F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
 				7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
 				41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
 				754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
 				B27535720B053814002CE64F /* IntPoint.h in Headers */,
+				E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */,
 				B27535740B053814002CE64F /* IntRect.h in Headers */,
 				B27535750B053814002CE64F /* IntSize.h in Headers */,
 				B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
 				59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */,
 				59A9E7B21104759400DFB4C1 /* JavaInstanceJSC.h in Headers */,
+				E16982681134680700894115 /* JavaRuntimeObject.h in Headers */,
 				1C81BA0A0E97348300266E07 /* JavaScriptCallFrame.h in Headers */,
-				1C81BA0C0E97348300266E07 /* JavaScriptDebugListener.h in Headers */,
-				1C81BA0E0E97348300266E07 /* JavaScriptDebugServer.h in Headers */,
 				59BC393F11054A1300FD85DB /* JavaStringJSC.h in Headers */,
 				1A569D040D7E2B82007C3983 /* jni_jsobject.h in Headers */,
 				5913953B110758450083EC55 /* JNIBridge.h in Headers */,
@@ -17370,9 +17659,11 @@
 				1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */,
 				E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */,
 				1AE82F900CAAFA9D002237AE /* JSDatabase.h in Headers */,
+				B5D3601D112F8BA00048DEA8 /* JSDatabaseCallback.h in Headers */,
 				BC77D16A0FF19F560070887B /* JSDataGridColumn.h in Headers */,
 				BC77D16C0FF19F560070887B /* JSDataGridColumnList.h in Headers */,
 				BCBCAE3D0FF19399000762AE /* JSDataGridDataSource.h in Headers */,
+				BC53DAC211432EEE000D817E /* JSDebugWrapperSet.h in Headers */,
 				4162A4581011464700DFF3ED /* JSDedicatedWorkerContext.h in Headers */,
 				659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */,
 				1A494EDF0A123F4C00FDAFC1 /* JSDocumentFragment.h in Headers */,
@@ -17380,6 +17671,7 @@
 				1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */,
 				93B70D6409EB0C7C009D8468 /* JSDOMBinding.h in Headers */,
 				BC60D7C10D29A46300B9918F /* JSDOMCoreException.h in Headers */,
+				2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */,
 				E1C36C030EB076D6007410BC /* JSDOMGlobalObject.h in Headers */,
 				65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
 				1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */,
@@ -17387,6 +17679,7 @@
 				BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
 				652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
 				BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
+				65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
 				65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */,
 				65DF323009D1DDBC000BE325 /* JSEntity.h in Headers */,
 				93F9B7750BA5FDDD00854064 /* JSEntityReference.h in Headers */,
@@ -17704,8 +17997,6 @@
 				316FE0720E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h in Headers */,
 				316FE0740E6CCBEE00BF6088 /* JSWebKitCSSKeyframesRule.h in Headers */,
 				498391400F1E767500C23782 /* JSWebKitCSSMatrix.h in Headers */,
-				498391400F1E767500C23782 /* JSWebKitCSSMatrix.h in Headers */,
-				498391640F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h in Headers */,
 				498391640F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h in Headers */,
 				31611E5B0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.h in Headers */,
 				494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */,
@@ -17718,6 +18009,7 @@
 				E1CA5CD30E8CDE8000E8EF90 /* JSWorkerConstructor.h in Headers */,
 				E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */,
 				E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */,
+				F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */,
 				E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
 				E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */,
 				BC348BD40DB7F804004ABAB9 /* JSXMLHttpRequest.h in Headers */,
@@ -17767,6 +18059,7 @@
 				49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */,
 				49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */,
 				0FF50272102BA96A0066F39A /* Media.h in Headers */,
+				931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */,
 				ABFE7E130D32FAF60066F4D2 /* MediaControlElements.h in Headers */,
 				AB40484E0E083FA8007D6920 /* MediaDocument.h in Headers */,
 				E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
@@ -17829,6 +18122,7 @@
 				1A569D190D7E2B82007C3983 /* objc_utility.h in Headers */,
 				1CF6BDFA0E9BB26A0025E1CD /* ObjCEventListener.h in Headers */,
 				1CF6BE150E9BB4670025E1CD /* ObjCNodeFilterCondition.h in Headers */,
+				E16982551134629D00894115 /* ObjCRuntimeObject.h in Headers */,
 				F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */,
 				087281560F26B9B600AFC596 /* OptionElement.h in Headers */,
 				087281580F26B9B600AFC596 /* OptionGroupElement.h in Headers */,
@@ -17886,6 +18180,7 @@
 				37919C240B7D188600A56998 /* PositionIterator.h in Headers */,
 				FE80D7D10E9C1F25000D6F75 /* PositionOptions.h in Headers */,
 				E49626C30D80D94900E3405C /* PreloadScanner.h in Headers */,
+				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
 				A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */,
 				E44613EC0CD681B500FADA75 /* ProgressEvent.h in Headers */,
 				1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */,
@@ -17934,13 +18229,17 @@
 				A8EA7A500A191A5200A8EF5F /* RenderListMarker.h in Headers */,
 				0F56028F0E4B76580065B038 /* RenderMarquee.h in Headers */,
 				FA654A701108ABFF002615E0 /* RenderMathMLBlock.h in Headers */,
+				FA0B1F8711125CEE007F9839 /* RenderMathMLMath.h in Headers */,
+				FA5FAE4311126A5D00D3750F /* RenderMathMLOperator.h in Headers */,
+				FA0B1F8911125CEE007F9839 /* RenderMathMLRow.h in Headers */,
+				FAC12CC51120DA6900DACC36 /* RenderMathMLSubSup.h in Headers */,
+				FA7EFB061120D25400CF79C7 /* RenderMathMLUnderOver.h in Headers */,
 				E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */,
 				ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */,
 				BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */,
 				BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */,
 				BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
 				A871DED70A1530C700B12A68 /* RenderPart.h in Headers */,
-				A871DED50A1530C700B12A68 /* RenderPartObject.h in Headers */,
 				853CA9F10AEEC657002372DC /* RenderPath.h in Headers */,
 				A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */,
 				BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */,
@@ -17964,6 +18263,8 @@
 				853CA9DD0AEEC5E9002372DC /* RenderSVGInlineText.h in Headers */,
 				A8F5C0B80F9285AC0098E06B /* RenderSVGModelObject.h in Headers */,
 				083192AA112B43050083C3B9 /* RenderSVGResource.h in Headers */,
+				84BDA16C11358D2A00DBF64C /* RenderSVGResourceClipper.h in Headers */,
+				841FDC271178C9BE00F8AC9B /* RenderSVGResourceFilter.h in Headers */,
 				083192AC112B43050083C3B9 /* RenderSVGResourceMasker.h in Headers */,
 				AA31B5B50C1DFD1000AE7083 /* RenderSVGRoot.h in Headers */,
 				08DAB9BB1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h in Headers */,
@@ -18017,16 +18318,21 @@
 				1CEFC9B90D78DC8C007D2579 /* SchedulePair.h in Headers */,
 				BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */,
 				7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */,
+				7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */,
 				41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */,
 				416E75CB0EDF90C700360E1D /* ScriptCallFrame.h in Headers */,
 				416E75BE0EDF8FD700360E1D /* ScriptCallStack.h in Headers */,
 				93B70D7009EB0C7C009D8468 /* ScriptController.h in Headers */,
+				7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */,
+				9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */,
 				08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */,
 				411046410FA222A600BA436A /* ScriptEventListener.h in Headers */,
 				E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */,
 				41002CCD0F66EDEF009E660D /* ScriptFunctionCall.h in Headers */,
 				934CC1170EDCAC7300A658F2 /* ScriptInstance.h in Headers */,
 				41F066E40F64BCF600A07EAC /* ScriptObject.h in Headers */,
+				9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
+				9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */,
 				934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */,
 				CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */,
 				41C760B10EDE03D300C1655F /* ScriptState.h in Headers */,
@@ -18042,6 +18348,7 @@
 				93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */,
 				BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
 				AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
+				33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */,
 				BCD0E0FB0E972C3500265DEA /* SecurityOrigin.h in Headers */,
 				BCD0E0FC0E972C3500265DEA /* SecurityOriginHash.h in Headers */,
 				371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */,
@@ -18076,6 +18383,7 @@
 				84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */,
 				84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */,
 				D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */,
+				626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
 				93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
 				93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
 				93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
@@ -18096,7 +18404,6 @@
 				1A7CCB1C0CD9469A00B7B64E /* SQLTransactionErrorCallback.h in Headers */,
 				1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */,
 				93F1996308245E59001E9ABC /* SSLKeyGenerator.h in Headers */,
-				9352071909BD3BA500F2038D /* StaticConstructors.h in Headers */,
 				BC7FA62D0D1F0EFF00DB22A9 /* StaticNodeList.h in Headers */,
 				51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */,
 				C5160EEB1004543A00A7CEE2 /* StorageAreaImpl.h in Headers */,
@@ -18285,10 +18592,7 @@
 				A8F4FB940C169E7B002AFED5 /* SVGRenderSupport.h in Headers */,
 				B2EBDC9D0AF77E3400AE4A68 /* SVGRenderTreeAsText.h in Headers */,
 				B25599B30D00D8BA00BB825C /* SVGResource.h in Headers */,
-				B25599B50D00D8BA00BB825C /* SVGResourceClipper.h in Headers */,
-				B25599B70D00D8BA00BB825C /* SVGResourceFilter.h in Headers */,
 				B25599B80D00D8BA00BB825C /* SVGResourceListener.h in Headers */,
-				B25599BA0D00D8BA00BB825C /* SVGResourceMarker.h in Headers */,
 				853CA9E90AEEC608002372DC /* SVGRootInlineBox.h in Headers */,
 				B2227AA30D00BF220071B782 /* SVGScriptElement.h in Headers */,
 				B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */,
@@ -18395,6 +18699,7 @@
 				A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */,
 				E44613B60CD6344E00FADA75 /* VoidCallback.h in Headers */,
 				93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */,
+				BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */,
 				93F199BB08245E59001E9ABC /* WebCoreKeyboardUIMode.h in Headers */,
 				93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */,
 				934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */,
@@ -18430,7 +18735,6 @@
 				31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */,
 				31288E750E3005D6003619AE /* WebKitCSSKeyframesRule.h in Headers */,
 				498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */,
-				498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */,
 				BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */,
 				494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */,
 				31C0FF250E4CEB6E007D6FE5 /* WebKitTransitionEvent.h in Headers */,
@@ -18442,6 +18746,7 @@
 				510D4A4F103177A20049EA54 /* WebSocketChannel.h in Headers */,
 				510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
 				51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */,
+				7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */,
 				0FCF332D0F2B9A25004B6795 /* WebTiledLayer.h in Headers */,
 				85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
 				9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
@@ -18506,6 +18811,7 @@
 				BC772C470C4EB2C60083285F /* XMLHttpRequest.h in Headers */,
 				BC60D9C90D2A29E500B9918F /* XMLHttpRequestException.h in Headers */,
 				F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */,
+				A136A00D1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h in Headers */,
 				BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */,
 				A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */,
 				E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */,
@@ -18534,8 +18840,8 @@
 				E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */,
 				93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
-				F3644B001119805900E0D537 /* InjectedScript.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+<<<<<<< HEAD
 				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
 				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
 				9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
@@ -18547,6 +18853,42 @@
 				931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */,
 				9F2A322C1125A0A2003C3056 /* JavaScriptProfile.h in Headers */,
 				9F2A322E1125A0A2003C3056 /* JavaScriptProfileNode.h in Headers */,
+=======
+				CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
+				FAA10571114C2DF700940A01 /* RenderMathMLFraction.h in Headers */,
+				A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */,
+				A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
+				F375CC071150D300008DDB81 /* InspectorWorkerResource.h in Headers */,
+				A5AFB350115151A700B045CB /* StepRange.h in Headers */,
+				A59E3C1E11580F510072928E /* KeyEventCodesIPhone.h in Headers */,
+				A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */,
+				62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */,
+				E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */,
+				E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
+				8499A515115FB33000F566E3 /* RenderSVGResourceMarker.h in Headers */,
+				A4226E5C1163D695008B8397 /* JSHTMLProgressElement.h in Headers */,
+				A4226E951163D73A008B8397 /* DOMHTMLProgressElement.h in Headers */,
+				A4226E991163D7CC008B8397 /* DOMHTMLProgressElementInternal.h in Headers */,
+				2E3BBF081162DA1100B9409A /* UUID.h in Headers */,
+				8952535311641B3400CABF00 /* FileThread.h in Headers */,
+				97C078501165D5BE003A32EF /* SuffixTree.h in Headers */,
+				2542F4DB1166C25A00E89A86 /* UserGestureIndicator.h in Headers */,
+				BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
+				C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,
+				A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */,
+				895253D8116C4C6800CABF00 /* FileStream.h in Headers */,
+				973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */,
+				895253D9116C4C6800CABF00 /* FileStreamClient.h in Headers */,
+				5DC87EF011716DF2001C0E6D /* EmptyProtocolDefinitions.h in Headers */,
+				9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */,
+				9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */,
+				9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */,
+				895253DD116C4EF500CABF00 /* FileStreamProxy.h in Headers */,
+				895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */,
+				CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,
+				0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */,
+				0FD308D6117D168500A791F7 /* RenderIFrame.h in Headers */,
+>>>>>>> webkit.org at r58033
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -18569,6 +18911,7 @@
 				939D050109D9FF6B00984996 /* Check For Global Initializers */,
 				933457E60EBFDF6B00B80894 /* Check For Exit Time Destructors */,
 				5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */,
+				5DF50887116F3077005202AB /* Check For Inappropriate Files In Framework */,
 			);
 			buildRules = (
 			);
@@ -18626,8 +18969,6 @@
 				85136C9B0AED665900F90A3D /* helpCursor.png in Resources */,
 				85136C9C0AED665900F90A3D /* linkCursor.png in Resources */,
 				1CDC14050DD3934C006EACD3 /* localizedStrings.js in Resources */,
-				FA654A681108ABE2002615E0 /* mathattrs.in in Resources */,
-				FA654A641108ABB7002615E0 /* mathml.css in Resources */,
 				AB4261D80A2F6C9700BDD17D /* missingImage.tiff in Resources */,
 				85136C9D0AED665900F90A3D /* moveCursor.png in Resources */,
 				46F9D5DE0B0D60170028EE36 /* noDropCursor.png in Resources */,
@@ -18734,6 +19075,20 @@
 			shellPath = /bin/sh;
 			shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n    touch \"$SRCROOT/Info.plist\";\nfi;\n";
 		};
+		5DF50887116F3077005202AB /* Check For Inappropriate Files In Framework */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			name = "Check For Inappropriate Files In Framework";
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-inappropriate-files-in-framework ]; then\n    ../WebKitTools/Scripts/check-for-inappropriate-files-in-framework || exit $?\nfi\n";
+		};
 		933457E60EBFDF6B00B80894 /* Check For Exit Time Destructors */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -18809,6 +19164,7 @@
 				29A812400FBB9C1D00510293 /* AccessibilityTableHeaderContainer.cpp in Sources */,
 				29A812290FBB9C1D00510293 /* AccessibilityTableRow.cpp in Sources */,
 				E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */,
+				84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
 				49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
 				316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
 				316FE1130E6E1DA700BF6088 /* AnimationController.cpp in Sources */,
@@ -18824,7 +19180,6 @@
 				512DD8FB0D91E6AF000F89EE /* ArchiveResource.cpp in Sources */,
 				512DD8F70D91E6AF000F89EE /* ArchiveResourceCollection.cpp in Sources */,
 				BCFB2F76097A2E1A00BA703D /* Arena.cpp in Sources */,
-				B2C3DA1E0D006C1D00EF6F26 /* AtomicString.cpp in Sources */,
 				A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */,
 				A8C4A80C09D563270003AC8D /* Attribute.cpp in Sources */,
 				934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */,
@@ -18839,6 +19194,7 @@
 				AB23A32709BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp in Sources */,
 				85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */,
 				B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */,
+				BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */,
 				938192030F87E1E600D5352A /* BinaryPropertyList.cpp in Sources */,
 				BC5EB91F0E82040800B25965 /* BindingURI.cpp in Sources */,
 				A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
@@ -18872,6 +19228,7 @@
 				49C7B9DC1042D32F0009D447 /* CanvasRenderingContext.cpp in Sources */,
 				49484FCA102CF23C00187DD3 /* CanvasRenderingContext2D.cpp in Sources */,
 				49484FCD102CF23C00187DD3 /* CanvasStyle.cpp in Sources */,
+				0BC2C7771134A8FC000B2F61 /* CanvasSurface.cpp in Sources */,
 				6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
 				514185EF0CD65F0400763C99 /* ChangeVersionWrapper.cpp in Sources */,
 				6550B69F099DF0270090D781 /* CharacterData.cpp in Sources */,
@@ -18917,6 +19274,7 @@
 				E1C416170F6563180092D2FB /* CrossOriginAccessControl.cpp in Sources */,
 				E1C415DE0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp in Sources */,
 				2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */,
+				E16980491133644700894115 /* CRuntimeObject.cpp in Sources */,
 				A80E6CE50A1989CA007FB8C5 /* CSSBorderImageValue.cpp in Sources */,
 				BC604A430DB5634E00204739 /* CSSCanvasValue.cpp in Sources */,
 				E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */,
@@ -18961,7 +19319,6 @@
 				BCCBE7B50E07166900EAFA8E /* CSSVariableDependentValue.cpp in Sources */,
 				BCCBE69B0E06F51000EAFA8E /* CSSVariablesDeclaration.cpp in Sources */,
 				BCCBE68B0E06E60D00EAFA8E /* CSSVariablesRule.cpp in Sources */,
-				B2C3DA270D006C1D00EF6F26 /* CString.cpp in Sources */,
 				93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
 				5196116A0CAC56570010A80C /* Database.cpp in Sources */,
 				51A45B570CAD7FD7000D2BE9 /* DatabaseAuthorizer.cpp in Sources */,
@@ -19027,6 +19384,7 @@
 				BC1A37B3097C715F0019F3D8 /* DOMEvents.mm in Sources */,
 				BC00F0050E0A185500FD04E3 /* DOMFile.mm in Sources */,
 				BC00F0080E0A185500FD04E3 /* DOMFileList.mm in Sources */,
+				2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */,
 				BC1A37B7097C715F0019F3D8 /* DOMHTML.mm in Sources */,
 				85DF81280AA7787200486AD7 /* DOMHTMLAnchorElement.mm in Sources */,
 				85C050BA0AD84F5E005532E7 /* DOMHTMLAppletElement.mm in Sources */,
@@ -19104,6 +19462,7 @@
 				85ACAA8E0A9B759C00671E90 /* DOMNodeList.mm in Sources */,
 				85CA96EB0A9624E900690CCF /* DOMNotation.mm in Sources */,
 				856C8AE50A912649005C687B /* DOMObject.mm in Sources */,
+				BC53DA62114314BD000D817E /* DOMObjectHashTableMap.cpp in Sources */,
 				85C7F5D10AAFB8D9004014DD /* DOMOverflowEvent.mm in Sources */,
 				E1284BD51044A01E00EAEB52 /* DOMPageTransitionEvent.mm in Sources */,
 				1ACE53E70A8D18E70022947D /* DOMParser.cpp in Sources */,
@@ -19262,6 +19621,7 @@
 				31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
 				85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
 				1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
+				BC53DA481143134D000D817E /* DOMWrapperWorld.cpp in Sources */,
 				1A1D13810A5325520064BF5F /* DOMXPath.mm in Sources */,
 				85E9E0A20AB3A0C700069CD0 /* DOMXPathExpression.mm in Sources */,
 				85E9E0A60AB3A0C700069CD0 /* DOMXPathResult.mm in Sources */,
@@ -19350,15 +19710,17 @@
 				BCE04C940DAFF902007A0F41 /* GeneratedImage.cpp in Sources */,
 				FE80D7C50E9C1F25000D6F75 /* Geolocation.cpp in Sources */,
 				BC56CB2110D5AC8000A77C64 /* GeolocationController.cpp in Sources */,
+				596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */,
 				FEAB90120EA51B9C006348C3 /* GeolocationService.cpp in Sources */,
 				BCE494AC0F4F5E9E0084E319 /* GeolocationServiceMac.mm in Sources */,
 				59C77F2A10545B3B00506104 /* GeolocationServiceMock.cpp in Sources */,
 				B2C3DA6D0D006CD600EF6F26 /* GlyphPageTreeNode.cpp in Sources */,
 				B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */,
-				B2C3DA6F0D006CD600EF6F26 /* GlyphWidthMap.cpp in Sources */,
 				BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */,
 				BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */,
 				B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */,
+				6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
+				6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */,
 				49C7BA021042D38C0009D447 /* GraphicsContext3DMac.cpp in Sources */,
 				B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */,
 				B277B4040B22F37C0004BEC6 /* GraphicsContextMac.mm in Sources */,
@@ -19481,6 +19843,7 @@
 				4B3480930EEF50D400AC1B41 /* ImageSourceCGMac.mm in Sources */,
 				316FE1170E6E1DA700BF6088 /* ImplicitAnimation.cpp in Sources */,
 				DB23C2CB0A508D29002489EB /* IndentOutdentCommand.cpp in Sources */,
+				F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */,
 				7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */,
 				A8CFF5E60A155A05000A4234 /* InlineBox.cpp in Sources */,
 				A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */,
@@ -19498,6 +19861,7 @@
 				7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */,
 				41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */,
 				7AED3E050FBB1EAA00D2B03C /* InspectorFrontend.cpp in Sources */,
+				F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
 				7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
 				41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
 				754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
@@ -19510,8 +19874,8 @@
 				B275357E0B053814002CE64F /* IntSizeMac.mm in Sources */,
 				59E560A91105336F00AA1258 /* JavaClassJSC.cpp in Sources */,
 				59A9E7B01104758800DFB4C1 /* JavaInstanceJSC.cpp in Sources */,
+				E1698264113467F300894115 /* JavaRuntimeObject.cpp in Sources */,
 				1C81BA090E97348300266E07 /* JavaScriptCallFrame.cpp in Sources */,
-				1C81BA0D0E97348300266E07 /* JavaScriptDebugServer.cpp in Sources */,
 				1A569D030D7E2B82007C3983 /* jni_jsobject.mm in Sources */,
 				1A569D050D7E2B82007C3983 /* jni_objc.mm in Sources */,
 				5913953D1107584E0083EC55 /* JNIBridge.cpp in Sources */,
@@ -19576,11 +19940,13 @@
 				1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */,
 				E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */,
 				1AE82F8F0CAAFA9D002237AE /* JSDatabase.cpp in Sources */,
+				B5D3601F112F8BA80048DEA8 /* JSDatabaseCallback.cpp in Sources */,
 				BCCE58AC1061E8CF008FB35A /* JSDatabaseCustom.cpp in Sources */,
 				BC77D1690FF19F560070887B /* JSDataGridColumn.cpp in Sources */,
 				BC77D16B0FF19F560070887B /* JSDataGridColumnList.cpp in Sources */,
 				BC77D1520FF19C730070887B /* JSDataGridColumnListCustom.cpp in Sources */,
 				BCBCAE3C0FF19399000762AE /* JSDataGridDataSource.cpp in Sources */,
+				BC53DAC511432FD9000D817E /* JSDebugWrapperSet.cpp in Sources */,
 				4162A4571011464700DFF3ED /* JSDedicatedWorkerContext.cpp in Sources */,
 				4162A454101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp in Sources */,
 				33503CC010179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp in Sources */,
@@ -19593,6 +19959,8 @@
 				1AC226170DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp in Sources */,
 				93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */,
 				BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
+				2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */,
+				2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */,
 				E1C36CBD0EB08062007410BC /* JSDOMGlobalObject.cpp in Sources */,
 				65DF31F709D1CC60000BE325 /* JSDOMImplementation.cpp in Sources */,
 				1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */,
@@ -19601,6 +19969,7 @@
 				BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
 				BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
 				BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
+				BC53DAC711433064000D817E /* JSDOMWrapper.cpp in Sources */,
 				65DF31F909D1CC60000BE325 /* JSElement.cpp in Sources */,
 				BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */,
 				65DF322F09D1DDBC000BE325 /* JSEntity.cpp in Sources */,
@@ -19990,6 +20359,7 @@
 				E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */,
 				E1C36D340EB0A094007410BC /* JSWorkerContextBase.cpp in Sources */,
 				E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */,
+				F3D461481161D53200CA0D09 /* JSWorkerContextErrorHandler.cpp in Sources */,
 				E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */,
 				E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
 				E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
@@ -20094,6 +20464,7 @@
 				1A569D1A0D7E2B82007C3983 /* objc_utility.mm in Sources */,
 				1CF6BDFB0E9BB26A0025E1CD /* ObjCEventListener.mm in Sources */,
 				1CF6BE140E9BB4670025E1CD /* ObjCNodeFilterCondition.mm in Sources */,
+				E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */,
 				F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */,
 				087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */,
 				087281570F26B9B600AFC596 /* OptionGroupElement.cpp in Sources */,
@@ -20128,6 +20499,7 @@
 				1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */,
 				7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */,
 				1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
+				76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */,
 				0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */,
 				B2B1F7160D00CAA8004AEA64 /* PointerEventsHitRules.cpp in Sources */,
 				97059977107D975200A50A7C /* PolicyCallback.cpp in Sources */,
@@ -20137,6 +20509,7 @@
 				93F19AF808245E59001E9ABC /* Position.cpp in Sources */,
 				37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */,
 				E49626C20D80D94800E3405C /* PreloadScanner.cpp in Sources */,
+				B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
 				A8EA7EBD0A1945D000A8EF5F /* ProcessingInstruction.cpp in Sources */,
 				E44613EB0CD681B400FADA75 /* ProgressEvent.cpp in Sources */,
 				1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */,
@@ -20181,12 +20554,16 @@
 				A8EA7A510A191A5200A8EF5F /* RenderListMarker.cpp in Sources */,
 				0F5602900E4B76580065B038 /* RenderMarquee.cpp in Sources */,
 				FA654A6F1108ABFF002615E0 /* RenderMathMLBlock.cpp in Sources */,
+				FA0B1F8611125CEE007F9839 /* RenderMathMLMath.cpp in Sources */,
+				FA5FAE4211126A5D00D3750F /* RenderMathMLOperator.cpp in Sources */,
+				FA0B1F8811125CEE007F9839 /* RenderMathMLRow.cpp in Sources */,
+				FAC12CC41120DA6900DACC36 /* RenderMathMLSubSup.cpp in Sources */,
+				FA7EFB051120D25400CF79C7 /* RenderMathMLUnderOver.cpp in Sources */,
 				E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */,
 				ABDDFE790A5C6E7000A3E11D /* RenderMenuList.cpp in Sources */,
 				BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
 				BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */,
 				A871DED00A1530C700B12A68 /* RenderPart.cpp in Sources */,
-				A871DED60A1530C700B12A68 /* RenderPartObject.cpp in Sources */,
 				853CA9F00AEEC657002372DC /* RenderPath.cpp in Sources */,
 				A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */,
 				BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */,
@@ -20207,6 +20584,8 @@
 				853CA9DA0AEEC5E9002372DC /* RenderSVGInline.cpp in Sources */,
 				853CA9DC0AEEC5E9002372DC /* RenderSVGInlineText.cpp in Sources */,
 				A8F5C0B90F9285AC0098E06B /* RenderSVGModelObject.cpp in Sources */,
+				84BDA16B11358D2A00DBF64C /* RenderSVGResourceClipper.cpp in Sources */,
+				841FDC261178C9BE00F8AC9B /* RenderSVGResourceFilter.cpp in Sources */,
 				083192AB112B43050083C3B9 /* RenderSVGResourceMasker.cpp in Sources */,
 				AA31B5B40C1DFD1000AE7083 /* RenderSVGRoot.cpp in Sources */,
 				08DAB9BA1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp in Sources */,
@@ -20267,11 +20646,13 @@
 				93B70D6F09EB0C7C009D8468 /* ScriptController.cpp in Sources */,
 				97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */,
 				A83E1C740E49042C00140B9C /* ScriptControllerMac.mm in Sources */,
+				9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */,
 				08A484770E5272C500C3FE76 /* ScriptElement.cpp in Sources */,
 				411046420FA222A600BA436A /* ScriptEventListener.cpp in Sources */,
 				E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */,
 				41002CCE0F66EDEF009E660D /* ScriptFunctionCall.cpp in Sources */,
 				41F066E50F64BCF600A07EAC /* ScriptObject.cpp in Sources */,
+				9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */,
 				4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */,
 				934CC0E10ED39D6F00A658F2 /* ScriptValue.cpp in Sources */,
 				BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */,
@@ -20281,6 +20662,7 @@
 				BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */,
 				9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
 				AB7170A00B31193B0017123E /* SearchPopupMenuMac.mm in Sources */,
+				33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */,
 				BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */,
 				371F4FFD0D25E7F300ECE0D5 /* SegmentedFontData.cpp in Sources */,
 				B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */,
@@ -20315,6 +20697,7 @@
 				84A81F3D0FC7DFF000955300 /* SourceAlpha.cpp in Sources */,
 				84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */,
 				D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */,
+				626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
 				93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
 				93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
 				93309E15099E64920056E581 /* SplitTextNodeContainingElementCommand.cpp in Sources */,
@@ -20344,7 +20727,6 @@
 				B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */,
 				E1A302C10DE8376900C52F2C /* StringBuilder.cpp in Sources */,
 				B2B2645C0D00A77E000ACC1D /* StringCF.cpp in Sources */,
-				B2C3DA320D006C1D00EF6F26 /* StringImpl.cpp in Sources */,
 				B2B2645D0D00A77E000ACC1D /* StringImplCF.cpp in Sources */,
 				B2AFFC950D00A5DF0030074D /* StringImplMac.mm in Sources */,
 				B2AFFC960D00A5DF0030074D /* StringMac.mm in Sources */,
@@ -20505,9 +20887,6 @@
 				A8F4FB960C169E85002AFED5 /* SVGRenderSupport.cpp in Sources */,
 				B2EBDC9C0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp in Sources */,
 				B25599B20D00D8BA00BB825C /* SVGResource.cpp in Sources */,
-				B25599B40D00D8BA00BB825C /* SVGResourceClipper.cpp in Sources */,
-				B25599B60D00D8BA00BB825C /* SVGResourceFilter.cpp in Sources */,
-				B25599B90D00D8BA00BB825C /* SVGResourceMarker.cpp in Sources */,
 				853CA9E80AEEC608002372DC /* SVGRootInlineBox.cpp in Sources */,
 				B2227AA20D00BF220071B782 /* SVGScriptElement.cpp in Sources */,
 				B2227AA50D00BF220071B782 /* SVGSetElement.cpp in Sources */,
@@ -20630,6 +21009,7 @@
 				518A34C11026C831001B6896 /* WebSocket.cpp in Sources */,
 				510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */,
 				51ABAE441043AB4A008C5260 /* WebSocketHandshake.cpp in Sources */,
+				7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */,
 				0FCF332C0F2B9A25004B6795 /* WebTiledLayer.mm in Sources */,
 				85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
 				935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */,
@@ -20690,6 +21070,7 @@
 				A833C7CC0A2CF07400D57664 /* XLinkNames.cpp in Sources */,
 				BC772C460C4EB2C60083285F /* XMLHttpRequest.cpp in Sources */,
 				BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */,
+				A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */,
 				A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */,
 				E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
 				1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */,
@@ -20716,10 +21097,10 @@
 				93F19B0308245E59001E9ABC /* XSLStyleSheetLibxslt.cpp in Sources */,
 				E1F1E82F0C3C2BB9006DB391 /* XSLTExtensions.cpp in Sources */,
 				93F19B0408245E59001E9ABC /* XSLTProcessor.cpp in Sources */,
-				F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */,
 				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+<<<<<<< HEAD
 				84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
 				B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
 				9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */,
@@ -20731,6 +21112,33 @@
 				9F2A322D1125A0A2003C3056 /* JavaScriptProfileNode.cpp in Sources */,
 				6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
 				6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */,
+=======
+				FAA10570114C2DF700940A01 /* RenderMathMLFraction.cpp in Sources */,
+				A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */,
+				A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
+				A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */,
+				A59E3C1F11580F510072928E /* KeyEventIPhone.mm in Sources */,
+				A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */,
+				62CD32591157E57C0063B0A7 /* CustomEvent.cpp in Sources */,
+				E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */,
+				8499A514115FB33000F566E3 /* RenderSVGResourceMarker.cpp in Sources */,
+				A4226E5A1163D667008B8397 /* JSHTMLProgressElement.cpp in Sources */,
+				A4226E961163D73A008B8397 /* DOMHTMLProgressElement.mm in Sources */,
+				2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */,
+				8952535211641B3400CABF00 /* FileThread.cpp in Sources */,
+				2542F4DA1166C25A00E89A86 /* UserGestureIndicator.cpp in Sources */,
+				C5D4AA79116BAFB60069CA93 /* GlyphMetricsMap.cpp in Sources */,
+				A409C984116D0DDD007197BD /* AccessibilityProgressIndicator.cpp in Sources */,
+				895253D7116C4C6800CABF00 /* FileStream.cpp in Sources */,
+				9FA37EE71172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp in Sources */,
+				9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */,
+				9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */,
+				895253DC116C4EF500CABF00 /* FileStreamProxy.cpp in Sources */,
+				CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */,
+				0FD3080E117CF7E700A791F7 /* RenderFrameBase.cpp in Sources */,
+				0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */,
+				973889A0116EA9DC00ADF313 /* DocumentWriter.cpp in Sources */,
+>>>>>>> webkit.org at r58033
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/accessibility/AXObjectCache.cpp b/WebCore/accessibility/AXObjectCache.cpp
index c347a81..b7622b8 100644
--- a/WebCore/accessibility/AXObjectCache.cpp
+++ b/WebCore/accessibility/AXObjectCache.cpp
@@ -38,8 +38,9 @@
 #include "AccessibilityListBoxOption.h"
 #include "AccessibilityMediaControls.h"
 #include "AccessibilityMenuList.h"
-#include "AccessibilityMenuListPopup.h"
 #include "AccessibilityMenuListOption.h"
+#include "AccessibilityMenuListPopup.h"
+#include "AccessibilityProgressIndicator.h"
 #include "AccessibilityRenderObject.h"
 #include "AccessibilityScrollbar.h"
 #include "AccessibilitySlider.h"
@@ -59,6 +60,7 @@
 #include "InputElement.h"
 #include "Page.h"
 #include "RenderObject.h"
+#include "RenderProgress.h"
 #include "RenderView.h"
 
 #include <wtf/PassRefPtr.h>
@@ -159,7 +161,7 @@
     return obj;
 }
     
-bool AXObjectCache::nodeIsAriaType(Node* node, String role)
+bool AXObjectCache::nodeHasRole(Node* node, const AtomicString& role)
 {
     if (!node || !node->isElementNode())
         return false;
@@ -183,16 +185,16 @@
             newObj = AccessibilityMenuList::create(renderer);
 
         // If the node is aria role="list" or the aria role is empty and its a ul/ol/dl type (it shouldn't be a list if aria says otherwise). 
-        else if (node && ((nodeIsAriaType(node, "list") || nodeIsAriaType(node, "directory"))
-                          || (nodeIsAriaType(node, nullAtom) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
+        else if (node && ((nodeHasRole(node, "list") || nodeHasRole(node, "directory"))
+                          || (nodeHasRole(node, nullAtom) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
             newObj = AccessibilityList::create(renderer);
         
         // aria tables
-        else if (nodeIsAriaType(node, "grid") || nodeIsAriaType(node, "treegrid"))
+        else if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid"))
             newObj = AccessibilityARIAGrid::create(renderer);
-        else if (nodeIsAriaType(node, "row"))
+        else if (nodeHasRole(node, "row"))
             newObj = AccessibilityARIAGridRow::create(renderer);
-        else if (nodeIsAriaType(node, "gridcell") || nodeIsAriaType(node, "columnheader") || nodeIsAriaType(node, "rowheader"))
+        else if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader"))
             newObj = AccessibilityARIAGridCell::create(renderer);
 
         // standard tables
@@ -209,6 +211,12 @@
             newObj = AccessibilityMediaControl::create(renderer);
 #endif
 
+#if ENABLE(PROGRESS_TAG)
+        // progress bar
+        else if (renderer->isProgress())
+            newObj = AccessibilityProgressIndicator::create(toRenderProgress(renderer));
+#endif
+
         // input type=range
         else if (renderer->isSlider())
             newObj = AccessibilitySlider::create(renderer);
@@ -441,7 +449,9 @@
 
 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
 {
-    postNotification(renderer, AXSelectedChildrenChanged, true);
+    // postToElement is false so that you can pass in any child of an element and it will go up the parent tree
+    // to find the container which should send out the notification.
+    postNotification(renderer, AXSelectedChildrenChanged, false);
 }
 #endif
 
diff --git a/WebCore/accessibility/AXObjectCache.h b/WebCore/accessibility/AXObjectCache.h
index dad73f2..25f5347 100644
--- a/WebCore/accessibility/AXObjectCache.h
+++ b/WebCore/accessibility/AXObjectCache.h
@@ -121,6 +121,8 @@
     void postNotification(RenderObject*, AXNotification, bool postToElement, PostType = PostAsynchronously);
     void postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType = PostAsynchronously);
 
+    bool nodeHasRole(Node*, const AtomicString& role);
+
 protected:
     void postPlatformNotification(AccessibilityObject*, AXNotification);
 
@@ -139,7 +141,6 @@
     static AccessibilityObject* focusedImageMapUIElement(HTMLAreaElement*);
     
     AXID getAXID(AccessibilityObject*);
-    bool nodeIsAriaType(Node*, String role);
 };
 
 #if !HAVE(ACCESSIBILITY)
diff --git a/WebCore/accessibility/AccessibilityARIAGrid.cpp b/WebCore/accessibility/AccessibilityARIAGrid.cpp
index a0cf77a..58b3fa1 100644
--- a/WebCore/accessibility/AccessibilityARIAGrid.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGrid.cpp
@@ -131,8 +131,7 @@
     if (!m_renderer)
         return 0;
     
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     if (column >= columnCount() || row >= rowCount())
         return 0;
diff --git a/WebCore/accessibility/AccessibilityImageMapLink.cpp b/WebCore/accessibility/AccessibilityImageMapLink.cpp
index 06150b9..2eac8d3 100644
--- a/WebCore/accessibility/AccessibilityImageMapLink.cpp
+++ b/WebCore/accessibility/AccessibilityImageMapLink.cpp
@@ -103,6 +103,9 @@
     if (!m_areaElement)
         return String();
 
+    const AtomicString& ariaLabel = m_areaElement->getAttribute(aria_labelAttr);
+    if (!ariaLabel.isEmpty())
+        return ariaLabel;
     const AtomicString& alt = m_areaElement->getAttribute(altAttr);
     if (!alt.isEmpty())
         return alt;
diff --git a/WebCore/accessibility/AccessibilityList.cpp b/WebCore/accessibility/AccessibilityList.cpp
index feceee5..073b0fc 100644
--- a/WebCore/accessibility/AccessibilityList.cpp
+++ b/WebCore/accessibility/AccessibilityList.cpp
@@ -55,8 +55,10 @@
 
 bool AccessibilityList::accessibilityIsIgnored() const
 {
-    // Is the platform interested in the object?
-    if (accessibilityPlatformIncludesObject() == IgnoreObject)
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
         return true;
     
     // lists don't appear on tiger/leopard on the mac
diff --git a/WebCore/accessibility/AccessibilityListBox.cpp b/WebCore/accessibility/AccessibilityListBox.cpp
index 2c267c1..8a9e062 100644
--- a/WebCore/accessibility/AccessibilityListBox.cpp
+++ b/WebCore/accessibility/AccessibilityListBox.cpp
@@ -80,7 +80,7 @@
         // The cast to HTMLElement below is safe because the only other possible listItem type
         // would be a WMLElement, but WML builds don't use accessibility features at all.
         AccessibilityObject* listOption = listBoxOptionAccessibilityObject(static_cast<HTMLElement*>(listItems[i]));
-        if (listOption)
+        if (listOption && !listOption->accessibilityIsIgnored())
             m_children.append(listOption);
     }
 }
@@ -151,6 +151,17 @@
     
     return listBoxObject;
 }
+    
+bool AccessibilityListBox::accessibilityIsIgnored() const
+{
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
+        return true;
+    
+    return false;
+}
 
 AccessibilityObject* AccessibilityListBox::doAccessibilityHitTest(const IntPoint& point) const
 {
@@ -165,16 +176,21 @@
     
     IntRect parentRect = boundingBoxRect();
     
-    const Vector<Element*>& listItems = static_cast<HTMLSelectElement*>(node)->listItems();
-    unsigned length = listItems.size();
+    AccessibilityObject* listBoxOption = 0;
+    unsigned length = m_children.size();
     for (unsigned i = 0; i < length; i++) {
         IntRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(parentRect.x(), parentRect.y(), i);
         // The cast to HTMLElement below is safe because the only other possible listItem type
         // would be a WMLElement, but WML builds don't use accessibility features at all.
-        if (rect.contains(point))
-            return listBoxOptionAccessibilityObject(static_cast<HTMLElement*>(listItems[i]));
+        if (rect.contains(point)) {
+            listBoxOption = m_children[i].get();
+            break;
+        }
     }
     
+    if (listBoxOption && !listBoxOption->accessibilityIsIgnored())
+        return listBoxOption;
+    
     return axObjectCache()->getOrCreate(m_renderer);
 }
 
diff --git a/WebCore/accessibility/AccessibilityListBox.h b/WebCore/accessibility/AccessibilityListBox.h
index ce1abe0..72ce82f 100644
--- a/WebCore/accessibility/AccessibilityListBox.h
+++ b/WebCore/accessibility/AccessibilityListBox.h
@@ -49,9 +49,7 @@
     virtual bool canSetSelectedChildrenAttribute() const;
     void setSelectedChildren(AccessibilityChildrenVector&);
     virtual AccessibilityRole roleValue() const { return ListBoxRole; }
-    
-    virtual bool accessibilityIsIgnored() const { return false; }
-    
+        
     virtual void selectedChildren(AccessibilityChildrenVector&);
     virtual void visibleChildren(AccessibilityChildrenVector&);
     
@@ -59,6 +57,7 @@
 
 private:    
     AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
+    virtual bool accessibilityIsIgnored() const;
 };
     
 } // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 6a77dac..57519e3 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -105,6 +105,22 @@
     return rect;
 }
 
+bool AccessibilityListBoxOption::accessibilityIsIgnored() const
+{
+    if (!m_optionElement)
+        return true;
+    
+    if (equalIgnoringCase(getAttribute(m_optionElement, aria_hiddenAttr), "true"))
+        return true;
+    
+    return parentObject()->accessibilityIsIgnored();
+}
+    
+String AccessibilityListBoxOption::language() const
+{
+    return AccessibilityObject::language(m_optionElement);
+}
+
 bool AccessibilityListBoxOption::canSetSelectedAttribute() const
 {
     if (!m_optionElement)
@@ -128,6 +144,10 @@
     if (!m_optionElement)
         return String();
     
+    const AtomicString& ariaLabel = getAttribute(m_optionElement, aria_labelAttr);
+    if (!ariaLabel.isNull())
+        return ariaLabel;
+    
     if (m_optionElement->hasTagName(optionTag))
         return static_cast<HTMLOptionElement*>(m_optionElement)->text();
     
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.h b/WebCore/accessibility/AccessibilityListBoxOption.h
index f8fd5f0..1da77e7 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.h
+++ b/WebCore/accessibility/AccessibilityListBoxOption.h
@@ -51,7 +51,7 @@
     void setHTMLElement(HTMLElement* element) { m_optionElement = element; }
     
     virtual AccessibilityRole roleValue() const { return ListBoxOptionRole; }
-    virtual bool accessibilityIsIgnored() const { return false; }
+    virtual bool accessibilityIsIgnored() const;
     virtual bool isSelected() const;
     virtual bool isEnabled() const;
     virtual String stringValue() const;
@@ -68,6 +68,7 @@
 private:
     HTMLElement* m_optionElement;
     
+    virtual String language() const;
     virtual bool canHaveChildren() const { return false; }
     HTMLSelectElement* listBoxOptionParentNode() const;
     int listBoxOptionIndex() const;
diff --git a/WebCore/accessibility/AccessibilityMediaControls.cpp b/WebCore/accessibility/AccessibilityMediaControls.cpp
index 6151840..2f98acd 100644
--- a/WebCore/accessibility/AccessibilityMediaControls.cpp
+++ b/WebCore/accessibility/AccessibilityMediaControls.cpp
@@ -89,7 +89,7 @@
 MediaControlElementType AccessibilityMediaControl::controlType() const
 {
     if (!renderer() || !renderer()->node())
-        return MediaTimelineContainer;  // Timeline container is not accessible.
+        return MediaTimelineContainer; // Timeline container is not accessible.
 
     Node* node = renderer()->node();
 
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index 7c616ea..8dedc36 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -148,6 +148,15 @@
     return true;
 }
     
+String AccessibilityObject::language(Node* node) const
+{
+    const AtomicString& lang = getAttribute(node, langAttr);
+    if (lang.isEmpty())
+        return AccessibilityObject::language();
+    
+    return lang;
+}
+    
 String AccessibilityObject::language() const
 {
     AccessibilityObject* parent = parentObject();
@@ -731,8 +740,8 @@
 
 void AccessibilityObject::clearChildren()
 {
-    m_haveChildren = false;
     m_children.clear();
+    m_haveChildren = false;
 }
 
 AccessibilityObject* AccessibilityObject::anchorElementForNode(Node* node)
@@ -835,6 +844,18 @@
     }
 }
  
+const AtomicString& AccessibilityObject::getAttribute(Node* node, const QualifiedName& attribute)
+{
+    if (!node)
+        return nullAtom;
+    
+    if (!node->isElementNode())
+        return nullAtom;
+    
+    Element* element = static_cast<Element*>(node);
+    return element->getAttribute(attribute);
+}
+    
 // Lacking concrete evidence of orientation, horizontal means width > height. vertical is height > width;
 AccessibilityOrientation AccessibilityObject::orientation() const
 {
@@ -949,6 +970,11 @@
     return false;
 }
 
+bool AccessibilityObject::supportsARIAAttributes() const
+{
+    return supportsARIALiveRegion() || supportsARIADragging() || supportsARIADropping() || supportsARIAFlowTo() || supportsARIAOwns();
+}
+    
 bool AccessibilityObject::supportsARIALiveRegion() const
 {
     const AtomicString& liveRegion = ariaLiveRegionStatus();
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index e4b1d99..8b4923a 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -34,7 +34,6 @@
 #include "Range.h"
 #include "VisiblePosition.h"
 #include "VisibleSelection.h"
-#include <wtf/Platform.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
@@ -204,7 +203,7 @@
     AccessibilityOrientationHorizontal,
 };
     
-enum AccessibilityObjectPlatformInclusion {
+enum AccessibilityObjectInclusion {
     IncludeObject,
     IgnoreObject,
     DefaultBehavior,
@@ -326,6 +325,9 @@
     
     virtual bool hasIntValue() const { return false; }
 
+    // A programmatic way to set a name on an AccessibleObject.
+    virtual void setAccessibleName(String&) { }
+    
     bool accessibilityShouldUseUniqueId() const { return true; }
     virtual bool accessibilityIsIgnored() const  { return true; }
 
@@ -345,10 +347,11 @@
     virtual void ariaOwnsElements(AccessibilityChildrenVector&) const { }
     virtual bool supportsARIAFlowTo() const { return false; }
     virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { }
+    virtual bool ariaHasPopup() const { return false; }
     
     // ARIA drag and drop
-    virtual bool supportsARIADropping() { return false; }
-    virtual bool supportsARIADragging() { return false; }
+    virtual bool supportsARIADropping() const { return false; }
+    virtual bool supportsARIADragging() const { return false; }
     virtual bool isARIAGrabbed() { return false; }
     virtual void setARIAGrabbed(bool) { }
     virtual void determineARIADropEffects(Vector<String>&) { }
@@ -415,6 +418,7 @@
     virtual FrameView* topDocumentFrameView() const { return 0; }
     virtual FrameView* documentFrameView() const;
     virtual String language() const;
+    String language(Node*) const;
     virtual unsigned hierarchicalLevel() const { return 0; }
     
     virtual void setFocused(bool) { }
@@ -446,7 +450,8 @@
     virtual void handleActiveDescendantChanged() { }
 
     static AccessibilityRole ariaRoleToWebCoreRole(const String&);
-    
+    static const AtomicString& getAttribute(Node*, const QualifiedName&);
+
     virtual VisiblePositionRange visiblePositionRange() const { return VisiblePositionRange(); }
     virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const { return VisiblePositionRange(); }
     
@@ -518,6 +523,8 @@
     virtual bool ariaLiveRegionAtomic() const { return false; }
     virtual bool ariaLiveRegionBusy() const { return false; }
     
+    bool supportsARIAAttributes() const;
+    
 #if HAVE(ACCESSIBILITY)
 #if PLATFORM(GTK)
     AccessibilityObjectWrapper* wrapper() const;
@@ -531,18 +538,14 @@
 #endif
 #endif
 
-    // a platform-specific method for determining if an attachment is ignored
 #if HAVE(ACCESSIBILITY)
+    // a platform-specific method for determining if an attachment is ignored
     bool accessibilityIgnoreAttachment() const;
+    // gives platforms the opportunity to indicate if and how an object should be included
+    AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const;
 #else
     bool accessibilityIgnoreAttachment() const { return true; }
-#endif
-
-    // gives platforms the opportunity to indicate if and how an object should be included
-#if HAVE(ACCESSIBILITY)
-    AccessibilityObjectPlatformInclusion accessibilityPlatformIncludesObject() const;
-#else
-    AccessibilityObjectPlatformInclusion accessibilityPlatformIncludesObject() const { return DefaultBehavior; }
+    AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const { return DefaultBehavior; }
 #endif
 
     // allows for an AccessibilityObject to update its render tree or perform
diff --git a/WebCore/accessibility/AccessibilityProgressIndicator.cpp b/WebCore/accessibility/AccessibilityProgressIndicator.cpp
new file mode 100644
index 0000000..c7202f0
--- /dev/null
+++ b/WebCore/accessibility/AccessibilityProgressIndicator.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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"
+
+#if ENABLE(PROGRESS_TAG)
+
+#include "AccessibilityProgressIndicator.h"
+
+#include "FloatConversion.h"
+#include "HTMLNames.h"
+#include "HTMLProgressElement.h"
+#include "RenderObject.h"
+#include "RenderProgress.h"
+
+namespace WebCore {
+    
+using namespace HTMLNames;
+
+AccessibilityProgressIndicator::AccessibilityProgressIndicator(RenderProgress* renderer)
+    : AccessibilityRenderObject(renderer)
+{
+}
+
+PassRefPtr<AccessibilityProgressIndicator> AccessibilityProgressIndicator::create(RenderProgress* renderer)
+{
+    return adoptRef(new AccessibilityProgressIndicator(renderer));
+}
+
+bool AccessibilityProgressIndicator::accessibilityIsIgnored() const
+{
+    return accessibilityIsIgnoredBase() == IgnoreObject;
+}
+    
+float AccessibilityProgressIndicator::valueForRange() const
+{
+    if (element()->position() >= 0)
+        return narrowPrecisionToFloat(element()->value());
+    // Indeterminate progress bar should return 0.
+    return 0.0f;
+}
+
+float AccessibilityProgressIndicator::maxValueForRange() const
+{
+    return narrowPrecisionToFloat(element()->max());
+}
+
+float AccessibilityProgressIndicator::minValueForRange() const
+{
+    return 0.0f;
+}
+
+HTMLProgressElement* AccessibilityProgressIndicator::element() const
+{
+    return toRenderProgress(m_renderer)->progressElement();
+}
+
+
+} // namespace WebCore
+
+#endif // ENABLE(PROGRESS_TAG)
diff --git a/WebCore/accessibility/AccessibilityProgressIndicator.h b/WebCore/accessibility/AccessibilityProgressIndicator.h
new file mode 100644
index 0000000..b52a619
--- /dev/null
+++ b/WebCore/accessibility/AccessibilityProgressIndicator.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 AccessibilityProgressIndicator_h
+#define AccessibilityProgressIndicator_h
+
+#if ENABLE(PROGRESS_TAG)
+
+#include "AccessibilityRenderObject.h"
+
+namespace WebCore {
+
+class HTMLProgressElement;
+class RenderProgress;
+
+class AccessibilityProgressIndicator : public AccessibilityRenderObject {
+public:
+    static PassRefPtr<AccessibilityProgressIndicator> create(RenderProgress*);
+
+private:
+    virtual AccessibilityRole roleValue() const { return ProgressIndicatorRole; }
+
+    virtual bool isProgressIndicator() const { return true; }
+
+    virtual float valueForRange() const;
+    virtual float maxValueForRange() const;
+    virtual float minValueForRange() const;
+
+    AccessibilityProgressIndicator(RenderProgress*);
+
+    HTMLProgressElement* element() const;
+    virtual bool accessibilityIsIgnored() const;
+};
+
+
+} // namespace WebCore
+
+#endif // ENABLE(PROGRESS_TAG)
+
+#endif // AccessibilityProgressIndicator_h
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index d738ca8..3463546 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -69,6 +69,7 @@
 #include "RenderTheme.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
+#include "SelectElement.h"
 #include "SelectionController.h"
 #include "Text.h"
 #include "TextIterator.h"
@@ -547,15 +548,7 @@
     
 const AtomicString& AccessibilityRenderObject::getAttribute(const QualifiedName& attribute) const
 {
-    Node* node = m_renderer->node();
-    if (!node)
-        return nullAtom;
-
-    if (!node->isElementNode())
-        return nullAtom;
-
-    Element* element = static_cast<Element*>(node);
-    return element->getAttribute(attribute);
+    return AccessibilityObject::getAttribute(m_renderer->node(), attribute);
 }
 
 Element* AccessibilityRenderObject::anchorElement() const
@@ -731,6 +724,15 @@
             if (!title.isEmpty())
                 return title;
         }
+        
+        // Only take help text from an ancestor element if its a group or an unknown role. If help was 
+        // added to those kinds of elements, it is likely it was meant for a child element.
+        AccessibilityObject* axObj = axObjectCache()->getOrCreate(curr);
+        if (axObj) {
+            AccessibilityRole role = axObj->roleValue();
+            if (role != GroupRole && role != UnknownRole)
+                break;
+        }
     }
     
     return String();
@@ -775,18 +777,7 @@
     if (!m_renderer)
         return String();
     
-    // Defer to parent if this element doesn't have a language set
-    Node* node = m_renderer->node();
-    if (!node)
-        return AccessibilityObject::language();
-    
-    if (!node->isElementNode())
-        return AccessibilityObject::language();
-    
-    String language = static_cast<Element*>(node)->getAttribute(langAttr);
-    if (language.isEmpty())
-        return AccessibilityObject::language();
-    return language;
+    return AccessibilityObject::language(m_renderer->node());
 }
 
 String AccessibilityRenderObject::textUnderElement() const
@@ -898,8 +889,22 @@
     if (m_renderer->isText())
         return textUnderElement();
     
-    if (m_renderer->isMenuList())
+    if (m_renderer->isMenuList()) {
+        // RenderMenuList will go straight to the text() of its selected item.
+        // This has to be overriden in the case where the selected item has an aria label
+        SelectElement* selectNode = toSelectElement(static_cast<Element*>(m_renderer->node()));
+        int selectedIndex = selectNode->selectedIndex();
+        const Vector<Element*> listItems = selectNode->listItems();
+        
+        Element* selectedOption = 0;
+        if (selectedIndex >= 0 && selectedIndex < (int)listItems.size()) 
+            selectedOption = listItems[selectedIndex];
+        String overridenDescription = AccessibilityObject::getAttribute(selectedOption, aria_labelAttr);
+        if (!overridenDescription.isNull())
+            return overridenDescription;
+        
         return toRenderMenuList(m_renderer)->text();
+    }
     
     if (m_renderer->isListMarker())
         return toRenderListMarker(m_renderer)->text();
@@ -1133,6 +1138,13 @@
     
     if (isWebArea()) {
         Document* document = m_renderer->document();
+        
+        // Check if the HTML element has an aria-label for the webpage.
+        Element* documentElement = document->documentElement();
+        const AtomicString& ariaLabel = AccessibilityObject::getAttribute(documentElement, aria_labelAttr);
+        if (!ariaLabel.isEmpty())
+            return ariaLabel;
+        
         Node* owner = document->ownerElement();
         if (owner) {
             if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) {
@@ -1318,6 +1330,11 @@
     return false;   
 }
     
+bool AccessibilityRenderObject::ariaHasPopup() const
+{
+    return elementAttributeValue(aria_haspopupAttr);
+}
+    
 bool AccessibilityRenderObject::supportsARIAFlowTo() const
 {
     return !getAttribute(aria_flowtoAttr).string().isEmpty();
@@ -1339,13 +1356,13 @@
         
 }
     
-bool AccessibilityRenderObject::supportsARIADropping()
+bool AccessibilityRenderObject::supportsARIADropping() const 
 {
     const AtomicString& dropEffect = getAttribute(aria_dropeffectAttr).string();
     return !dropEffect.isEmpty();
 }
 
-bool AccessibilityRenderObject::supportsARIADragging()
+bool AccessibilityRenderObject::supportsARIADragging() const
 {
     const AtomicString& grabbed = getAttribute(aria_grabbedAttr).string();
     return equalIgnoringCase(grabbed, "true") || equalIgnoringCase(grabbed, "false");   
@@ -1410,13 +1427,13 @@
     
 bool AccessibilityRenderObject::ariaIsHidden() const
 {
-    if (equalIgnoringCase(getAttribute(aria_hiddenAttr).string(), "true"))
+    if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
         return true;
     
     // aria-hidden hides this object and any children
     AccessibilityObject* object = parentObject();
     while (object) {
-        if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_cast<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr).string(), "true"))
+        if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_cast<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr), "true"))
             return true;
         object = object->parentObject();
     }
@@ -1456,26 +1473,43 @@
     return true;
 }
     
+AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBase() const
+{
+    // The following cases can apply to any element that's a subclass of AccessibilityRenderObject.
+    
+    // Ignore invisible elements.
+    if (!m_renderer || m_renderer->style()->visibility() != VISIBLE)
+        return IgnoreObject;
+
+    // Anything marked as aria-hidden or a child of something aria-hidden must be hidden.
+    if (ariaIsHidden())
+        return IgnoreObject;
+    
+    // Anything that is a presentational role must be hidden.
+    if (isPresentationalChildOfAriaRole())
+        return IgnoreObject;
+
+    // Allow the platform to make a decision.
+    AccessibilityObjectInclusion decision = accessibilityPlatformIncludesObject();
+    if (decision == IncludeObject)
+        return IncludeObject;
+    if (decision == IgnoreObject)
+        return IgnoreObject;
+        
+    return DefaultBehavior;
+}  
+ 
 bool AccessibilityRenderObject::accessibilityIsIgnored() const
 {
-    // Is the platform interested in this object?
-    AccessibilityObjectPlatformInclusion decision = accessibilityPlatformIncludesObject();
+    // Check first if any of the common reasons cause this element to be ignored.
+    // Then process other use cases that need to be applied to all the various roles
+    // that AccessibilityRenderObjects take on.
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
     if (decision == IncludeObject)
         return false;
     if (decision == IgnoreObject)
         return true;
-    // the decision must, therefore, be DefaultBehavior.
-
-    // ignore invisible element
-    if (!m_renderer || m_renderer->style()->visibility() != VISIBLE)
-        return true;
-
-    if (ariaIsHidden())
-        return true;
     
-    if (isPresentationalChildOfAriaRole())
-        return true;
-        
     // If this element is within a parent that cannot have children, it should not be exposed.
     if (isDescendantOfBarrenParent())
         return true;    
@@ -1531,6 +1565,9 @@
     
     if (ariaRole != UnknownRole)
         return false;
+
+    if (!helpText().isEmpty())
+        return false;
     
     // don't ignore labels, because they serve as TitleUIElements
     Node* node = m_renderer->node();
@@ -1547,6 +1584,10 @@
             return false;
     }
     
+    // if this element has aria attributes on it, it should not be ignored.
+    if (supportsARIAAttributes())
+        return false;
+    
     if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
         return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();
     
@@ -1779,7 +1820,8 @@
 
 bool AccessibilityRenderObject::isVisited() const
 {
-    return m_renderer->style()->pseudoState() == PseudoVisited;
+    // FIXME: Is it a privacy violation to expose visited information to accessibility APIs?
+    return m_renderer->style()->isLink() && m_renderer->style()->insideLink() == InsideVisitedLink;
 }
     
 bool AccessibilityRenderObject::isExpanded() const
@@ -2479,14 +2521,21 @@
     if (node->hasTagName(areaTag)) 
         return accessibilityImageMapHitTest(static_cast<HTMLAreaElement*>(node), point);
     
+    if (node->hasTagName(optionTag))
+        node = static_cast<HTMLOptionElement*>(node)->ownerSelectElement();
+    
     RenderObject* obj = node->renderer();
     if (!obj)
         return 0;
     
     AccessibilityObject* result = obj->document()->axObjectCache()->getOrCreate(obj);
 
-    if (obj->isListBox())
-        return static_cast<AccessibilityListBox*>(result)->doAccessibilityHitTest(point);
+    if (obj->isListBox()) {
+        // Make sure the children are initialized so that hit testing finds the right element.
+        AccessibilityListBox* listBox = static_cast<AccessibilityListBox*>(result);
+        listBox->updateChildrenIfNecessary();
+        return listBox->doAccessibilityHitTest(point);
+    }
         
     if (result->accessibilityIsIgnored()) {
         // If this element is the label of a control, a hit test should return the control.
@@ -2605,11 +2654,25 @@
     return 0;
 }
 
+bool AccessibilityRenderObject::renderObjectIsObservable(RenderObject* renderer) const
+{
+    // AX clients will listen for AXValueChange on a text control.
+    if (renderer->isTextControl())
+        return true;
+    
+    // AX clients will listen for AXSelectedChildrenChanged on listboxes.
+    if (renderer->isListBox() || axObjectCache()->nodeHasRole(renderer->node(), "listbox"))
+        return true;
+    
+    return false;
+}
+    
 AccessibilityObject* AccessibilityRenderObject::observableObject() const
 {
+    // Find the object going up the parent chain that is used in accessibility to monitor certain notifications.
     for (RenderObject* renderer = m_renderer; renderer && renderer->node(); renderer = renderer->parent()) {
-        if (renderer->isTextControl())
-            return renderer->document()->axObjectCache()->getOrCreate(renderer);
+        if (renderObjectIsObservable(renderer))
+            return axObjectCache()->getOrCreate(renderer);
     }
     
     return 0;
@@ -2623,7 +2686,7 @@
     
     AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole);
 
-    if (role == ButtonRole && elementAttributeValue(aria_haspopupAttr))
+    if (role == ButtonRole && ariaHasPopup())
         role = PopUpButtonRole;
     
     if (role)
@@ -2726,7 +2789,19 @@
 
     if (node && (node->hasTagName(rpTag) || node->hasTagName(rtTag)))
         return AnnotationRole;
-    
+
+#if PLATFORM(GTK)
+    // Gtk ATs expect all tables, data and layout, to be exposed as tables.
+    if (node && (node->hasTagName(tdTag) || node->hasTagName(thTag)))
+        return CellRole;
+
+    if (node && node->hasTagName(trTag))
+        return RowRole;
+
+    if (node && node->hasTagName(tableTag))
+        return TableRole;
+#endif   
+
     if (m_renderer->isBlockFlow() || (node && node->hasTagName(labelTag)))
         return GroupRole;
     
@@ -2761,7 +2836,7 @@
     case SliderRole:
     case ImageRole:
     case ProgressIndicatorRole:
-    //case SeparatorRole:
+    // case SeparatorRole:
         return true;
     default:
         return false;
@@ -2794,7 +2869,7 @@
     case SliderRole:
         return true;
     default:
-        return false;
+        return node->supportsFocus();
     }
 }
     
@@ -2823,8 +2898,9 @@
 void AccessibilityRenderObject::contentChanged()
 {
     // If this element supports ARIA live regions, then notify the AT of changes.
-    for (RenderObject* renderParent = m_renderer->parent(); renderParent; renderParent = renderParent->parent()) {
-        AccessibilityObject* parent = m_renderer->document()->axObjectCache()->get(renderParent);
+    AXObjectCache* cache = m_renderer->document()->axObjectCache();
+    for (RenderObject* renderParent = m_renderer; renderParent; renderParent = renderParent->parent()) {
+        AccessibilityObject* parent = cache->get(renderParent);
         if (!parent)
             continue;
         
@@ -2889,15 +2965,25 @@
     }
 }
 
+void AccessibilityRenderObject::clearChildren()
+{
+    AccessibilityObject::clearChildren();
+    m_childrenDirty = false;
+}
+    
+void AccessibilityRenderObject::updateChildrenIfNecessary()
+{
+    if (needsToUpdateChildren())
+        clearChildren();        
+    
+    if (!hasChildren())
+        addChildren();    
+}
+    
 const AccessibilityObject::AccessibilityChildrenVector& AccessibilityRenderObject::children()
 {
-    if (m_childrenDirty) {
-        clearChildren();        
-        m_childrenDirty = false;
-    }
+    updateChildrenIfNecessary();
     
-    if (!m_haveChildren)
-        addChildren();
     return m_children;
 }
 
@@ -3026,32 +3112,18 @@
     
 void AccessibilityRenderObject::ariaListboxSelectedChildren(AccessibilityChildrenVector& result)
 {
-    AccessibilityObject* child = firstChild();
-    
-    Element* element = static_cast<Element*>(renderer()->node());        
-    if (!element || !element->isElementNode()) // do this check to ensure safety of static_cast above
-        return;
-
     bool isMulti = isMultiSelectable();
-    
-    while (child) {
-        // every child should have aria-role option, and if so, check for selected attribute/state
-        AccessibilityRole ariaRole = child->ariaRoleAttribute();
-        RenderObject* childRenderer = 0;
-        if (child->isAccessibilityRenderObject())
-            childRenderer = static_cast<AccessibilityRenderObject*>(child)->renderer();
-        if (childRenderer && ariaRole == ListBoxOptionRole) {
-            Element* childElement = static_cast<Element*>(childRenderer->node());
-            if (childElement && childElement->isElementNode()) { // do this check to ensure safety of static_cast above
-                String selectedAttrString = childElement->getAttribute(aria_selectedAttr).string();
-                if (equalIgnoringCase(selectedAttrString, "true")) {
-                    result.append(child);
-                    if (isMulti)
-                        return;
-                }
-            }
+
+    AccessibilityChildrenVector childObjects = children();
+    unsigned childrenSize = childObjects.size();
+    for (unsigned k = 0; k < childrenSize; ++k) {
+        // Every child should have aria-role option, and if so, check for selected attribute/state.
+        AccessibilityObject* child = childObjects[k].get();
+        if (child->isSelected() && child->ariaRoleAttribute() == ListBoxOptionRole) {
+            result.append(child);
+            if (!isMulti)
+                return;
         }
-        child = child->nextSibling(); 
     }
 }
 
@@ -3130,7 +3202,24 @@
         return noAction;
     }
 }
-     
+    
+void AccessibilityRenderObject::setAccessibleName(String& name)
+{
+    // Setting the accessible name can store the value in the DOM
+    if (!m_renderer)
+        return;
+
+    Node* domNode = 0;
+    // For web areas, set the aria-label on the HTML element.
+    if (isWebArea())
+        domNode = m_renderer->document()->documentElement();
+    else
+        domNode = m_renderer->node();
+
+    if (domNode && domNode->isElementNode())
+        static_cast<Element*>(domNode)->setAttribute(aria_labelAttr, name);
+}
+    
 void AccessibilityRenderObject::updateBackingStore()
 {
     if (!m_renderer)
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 6735076..494e6bb 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -114,6 +114,10 @@
 
     virtual bool hasIntValue() const;
     
+    virtual void setAccessibleName(String&);
+    
+    // Provides common logic used by all elements when determining isIgnored.
+    AccessibilityObjectInclusion accessibilityIsIgnoredBase() const;
     virtual bool accessibilityIsIgnored() const;
     
     virtual int headingLevel() const;
@@ -191,10 +195,11 @@
     virtual Widget* widgetForAttachmentView() const;
     virtual void getDocumentLinks(AccessibilityChildrenVector&);
     virtual FrameView* documentFrameView() const;
-    virtual String language() const;
     virtual unsigned hierarchicalLevel() const;
 
     virtual const AccessibilityChildrenVector& children();
+    virtual void clearChildren();
+    void updateChildrenIfNecessary();
     
     virtual void setFocused(bool);
     virtual void setSelectedTextRange(const PlainTextRange&);
@@ -224,9 +229,10 @@
     virtual void setSelectedVisiblePositionRange(const VisiblePositionRange&) const;
     virtual bool supportsARIAFlowTo() const;
     virtual void ariaFlowToElements(AccessibilityChildrenVector&) const;
+    virtual bool ariaHasPopup() const;
 
-    virtual bool supportsARIADropping();
-    virtual bool supportsARIADragging();
+    virtual bool supportsARIADropping() const;
+    virtual bool supportsARIADragging() const;
     virtual bool isARIAGrabbed();
     virtual void setARIAGrabbed(bool);
     virtual void determineARIADropEffects(Vector<String>&);
@@ -259,6 +265,7 @@
     
     void setRenderObject(RenderObject* renderer) { m_renderer = renderer; }
     void ariaLabeledByElements(Vector<Element*>& elements) const;
+    bool needsToUpdateChildren() const { return m_childrenDirty; }
     
     virtual bool isDetached() const { return !m_renderer; }
 
@@ -270,6 +277,7 @@
     bool isAllowedChildOfTree() const;
     bool hasTextAlternative() const;
     String positionalDescriptionForMSAA() const;
+    virtual String language() const;
 
     Element* menuElementForMenuButton() const;
     Element* menuItemElementForMenu() const;
@@ -282,7 +290,8 @@
     AccessibilityObject* internalLinkElement() const;
     AccessibilityObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const;
     AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const;
-
+    bool renderObjectIsObservable(RenderObject*) const;
+    
     void ariaSelectedRows(AccessibilityChildrenVector&);
     
     bool elementAttributeValue(const QualifiedName&) const;
@@ -297,7 +306,6 @@
     virtual bool ariaLiveRegionBusy() const;    
     
     void setNeedsToUpdateChildren() const { m_childrenDirty = true; }
-    bool needsToUpdateChildren() const { return m_childrenDirty; }
     
     mutable AccessibilityRole m_roleForMSAA;
 };
diff --git a/WebCore/accessibility/AccessibilitySlider.cpp b/WebCore/accessibility/AccessibilitySlider.cpp
index 77f4dcc..e8d1f41 100644
--- a/WebCore/accessibility/AccessibilitySlider.cpp
+++ b/WebCore/accessibility/AccessibilitySlider.cpp
@@ -99,6 +99,17 @@
     return element()->getAttribute(attribute);
 }
 
+bool AccessibilitySlider::accessibilityIsIgnored() const
+{
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
+        return true;
+    
+    return false;
+}
+    
 float AccessibilitySlider::valueForRange() const
 {
     return element()->value().toFloat();
diff --git a/WebCore/accessibility/AccessibilitySlider.h b/WebCore/accessibility/AccessibilitySlider.h
index e1e3812..461f62b 100644
--- a/WebCore/accessibility/AccessibilitySlider.h
+++ b/WebCore/accessibility/AccessibilitySlider.h
@@ -42,7 +42,6 @@
     virtual ~AccessibilitySlider() { }
 
     virtual AccessibilityRole roleValue() const { return SliderRole; }
-    virtual bool accessibilityIsIgnored() const { return false; }
 
     virtual bool isSlider() const { return true; }
 
@@ -63,6 +62,7 @@
 
 private:
     HTMLInputElement* element() const;
+    virtual bool accessibilityIsIgnored() const;
 };
 
 class AccessibilitySliderThumb : public AccessibilityObject {
@@ -72,7 +72,6 @@
     virtual ~AccessibilitySliderThumb() { }
 
     virtual AccessibilityRole roleValue() const { return SliderThumbRole; }
-    virtual bool accessibilityIsIgnored() const { return false; }
 
     void setParentObject(AccessibilitySlider* slider) { m_parentSlider = slider; }
     virtual AccessibilityObject* parentObject() const { return m_parentSlider; }
@@ -82,6 +81,7 @@
 
 private:
     AccessibilitySliderThumb();
+    virtual bool accessibilityIsIgnored() const { return false; }
 
     AccessibilitySlider* m_parentSlider;
 };
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index 9ac1046..aed8867 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -94,6 +94,11 @@
     Node* tableNode = table->node();
     if (!tableNode || !tableNode->hasTagName(tableTag))
         return false;
+
+    // Gtk+ ATs expect all tables to be exposed as tables.
+#if PLATFORM(GTK)
+    return true;
+#endif
     
     // if there is a caption element, summary, THEAD, or TFOOT section, it's most certainly a data table
     HTMLTableElement* tableElement = static_cast<HTMLTableElement*>(tableNode);
@@ -193,10 +198,9 @@
     
 void AccessibilityTable::clearChildren()
 {
-    m_children.clear();
+    AccessibilityRenderObject::clearChildren();
     m_rows.clear();
     m_columns.clear();
-    m_haveChildren = false;
 }
 
 void AccessibilityTable::addChildren()
@@ -251,7 +255,12 @@
                 
                 row->setRowIndex((int)m_rows.size());        
                 m_rows.append(row);
-                m_children.append(row);
+                if (!row->accessibilityIsIgnored())
+                    m_children.append(row);
+#if PLATFORM(GTK)
+                else
+                    m_children.append(row->children());
+#endif
                 appendedRows.add(row);
             }
         }
@@ -266,11 +275,12 @@
         column->setColumnIndex((int)i);
         column->setParentTable(this);
         m_columns.append(column);
-        m_children.append(column);
+        if (!column->accessibilityIsIgnored())
+            m_children.append(column);
     }
     
     AccessibilityObject* headerContainerObject = headerContainer();
-    if (headerContainerObject)
+    if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored())
         m_children.append(headerContainerObject);
 }
     
@@ -287,17 +297,15 @@
 
 AccessibilityObject::AccessibilityChildrenVector& AccessibilityTable::columns()
 {
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
         
     return m_columns;
 }
 
 AccessibilityObject::AccessibilityChildrenVector& AccessibilityTable::rows()
 {
-    if (!hasChildren())
-        addChildren();
-
+    updateChildrenIfNecessary();
+    
     return m_rows;
 }
     
@@ -306,8 +314,7 @@
     if (!m_renderer)
         return;
     
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     unsigned rowCount = m_rows.size();
     for (unsigned k = 0; k < rowCount; ++k) {
@@ -323,8 +330,7 @@
     if (!m_renderer)
         return;
     
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     unsigned colCount = m_columns.size();
     for (unsigned k = 0; k < colCount; ++k) {
@@ -340,8 +346,7 @@
     if (!m_renderer)
         return;
     
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     int numRows = m_rows.size();
     for (int row = 0; row < numRows; ++row) {
@@ -352,16 +357,14 @@
     
 unsigned AccessibilityTable::columnCount()
 {
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     return m_columns.size();    
 }
     
 unsigned AccessibilityTable::rowCount()
 {
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     return m_rows.size();
 }
@@ -371,8 +374,7 @@
     if (!m_renderer || !m_renderer->isTable())
         return 0;
     
-    if (!hasChildren())
-        addChildren();
+    updateChildrenIfNecessary();
     
     RenderTable* table = toRenderTable(m_renderer);
     RenderTableSection* tableSection = table->header();
@@ -448,9 +450,15 @@
     
 bool AccessibilityTable::accessibilityIsIgnored() const
 {
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
+        return true;
+    
     if (!isDataTable())
         return AccessibilityRenderObject::accessibilityIsIgnored();
-    
+        
     return false;
 }
     
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index 7674cb8..318c619 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -56,6 +56,12 @@
 
 bool AccessibilityTableCell::accessibilityIsIgnored() const
 {
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
+        return true;
+    
     if (!isTableCell())
         return AccessibilityRenderObject::accessibilityIsIgnored();
     
diff --git a/WebCore/accessibility/AccessibilityTableColumn.cpp b/WebCore/accessibility/AccessibilityTableColumn.cpp
index ee8531e..5872706 100644
--- a/WebCore/accessibility/AccessibilityTableColumn.cpp
+++ b/WebCore/accessibility/AccessibilityTableColumn.cpp
@@ -158,6 +158,18 @@
     return m_parentTable->axObjectCache()->getOrCreate(cell);
 }
     
+bool AccessibilityTableColumn::accessibilityIsIgnored() const
+{
+    if (!m_parentTable)
+        return true;
+    
+#if PLATFORM(GTK)
+    return true;
+#endif
+    
+    return m_parentTable->accessibilityIsIgnored();
+}
+    
 void AccessibilityTableColumn::addChildren()
 {
     ASSERT(!m_haveChildren); 
diff --git a/WebCore/accessibility/AccessibilityTableColumn.h b/WebCore/accessibility/AccessibilityTableColumn.h
index 6270398..15d300c 100644
--- a/WebCore/accessibility/AccessibilityTableColumn.h
+++ b/WebCore/accessibility/AccessibilityTableColumn.h
@@ -49,8 +49,8 @@
     virtual AccessibilityObject* parentObject() const { return m_parentTable; }
     AccessibilityObject* headerObject();
         
+    virtual bool accessibilityIsIgnored() const;
     virtual AccessibilityRole roleValue() const { return ColumnRole; }
-    virtual bool accessibilityIsIgnored() const { return false; }
     virtual bool isTableColumn() const { return true; }
     
     void setColumnIndex(int columnIndex) { m_columnIndex = columnIndex; }
diff --git a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
index 3a2a241..e2da83c 100644
--- a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
+++ b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
@@ -68,6 +68,18 @@
     return elementRect().size();
 }
     
+bool AccessibilityTableHeaderContainer::accessibilityIsIgnored() const
+{
+    if (!m_parentTable)
+        return true;
+    
+#if PLATFORM(GTK)
+    return true;
+#endif
+
+    return m_parentTable->accessibilityIsIgnored();
+}
+
 void AccessibilityTableHeaderContainer::addChildren()
 {
     ASSERT(!m_haveChildren); 
diff --git a/WebCore/accessibility/AccessibilityTableHeaderContainer.h b/WebCore/accessibility/AccessibilityTableHeaderContainer.h
index 8a9448a..79521c0 100644
--- a/WebCore/accessibility/AccessibilityTableHeaderContainer.h
+++ b/WebCore/accessibility/AccessibilityTableHeaderContainer.h
@@ -48,8 +48,6 @@
     void setParentTable(AccessibilityTable* table) { m_parentTable = table; }
     virtual AccessibilityObject* parentObject() const { return m_parentTable; }
     
-    virtual bool accessibilityIsIgnored() const { return false; }
-    
     virtual const AccessibilityChildrenVector& children();
     virtual void addChildren();
     
@@ -60,6 +58,7 @@
     AccessibilityTable* m_parentTable;
     IntRect m_headerRect;
     
+    virtual bool accessibilityIsIgnored() const;
 }; 
     
 } // namespace WebCore 
diff --git a/WebCore/accessibility/AccessibilityTableRow.cpp b/WebCore/accessibility/AccessibilityTableRow.cpp
index 71f8b2b..e2a1157 100644
--- a/WebCore/accessibility/AccessibilityTableRow.cpp
+++ b/WebCore/accessibility/AccessibilityTableRow.cpp
@@ -76,6 +76,12 @@
     
 bool AccessibilityTableRow::accessibilityIsIgnored() const
 {    
+    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    if (decision == IncludeObject)
+        return false;
+    if (decision == IgnoreObject)
+        return true;
+    
     if (!isTableRow())
         return AccessibilityRenderObject::accessibilityIsIgnored();
 
diff --git a/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp b/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
index 6749f77..5b4cfd5 100644
--- a/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
+++ b/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp
@@ -34,7 +34,7 @@
     return false;
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     if (isMenuListPopup() || isMenuListOption())
         return IgnoreObject;
diff --git a/WebCore/accessibility/efl/AccessibilityObjectEfl.cpp b/WebCore/accessibility/efl/AccessibilityObjectEfl.cpp
new file mode 100644
index 0000000..d57c3fa
--- /dev/null
+++ b/WebCore/accessibility/efl/AccessibilityObjectEfl.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 Apple Ltd.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "AccessibilityObject.h"
+
+#if HAVE(ACCESSIBILITY)
+
+namespace WebCore {
+
+bool AccessibilityObject::accessibilityIgnoreAttachment() const
+{
+    return false;
+}
+
+} // namespace WebCore
+
+#endif // HAVE(ACCESSIBILITY)
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
index f48770f..ca3e8cc 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp
@@ -32,7 +32,7 @@
     return false;
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     AccessibilityObject* parent = parentObject();
     if (!parent)
@@ -41,17 +41,34 @@
     if (isMenuListPopup() || isMenuListOption())
         return IgnoreObject;
 
-    // When a list item is made up entirely of children (e.g. paragraphs)
-    // the list item gets ignored. We need it.
-    if (isGroup() && parent->isList())
-        return IncludeObject;
+    if (isGroup()) {
+        // When a list item is made up entirely of children (e.g. paragraphs)
+        // the list item gets ignored. We need it.
+        if (parent->isList())
+            return IncludeObject;
+
+        // We expect the parent of a table cell to be a table.
+        AccessibilityObject* child = firstChild();
+        if (child && child->roleValue() == CellRole)
+            return IgnoreObject;
+    }
 
     // Entries and password fields have extraneous children which we want to ignore.
     if (parent->isPasswordField() || parent->isTextControl())
         return IgnoreObject;
 
+    AccessibilityRole role = roleValue();
+
+    // Include all tables, even layout tables. The AT can decide what to do with each.
+    if (role == CellRole || role == TableRole)
+        return IncludeObject;
+
+    // We at some point might have a need to expose a table row; but it's not standard Gtk+.
+    if (role == RowRole)
+        return IgnoreObject;
+
     // The object containing the text should implement AtkText itself.
-    if (roleValue() == StaticTextRole)
+    if (role == StaticTextRole)
         return IgnoreObject;
 
     return DefaultBehavior;
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 487fa5b..ffef2a8 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -42,7 +42,6 @@
 #include "AccessibilityTableColumn.h"
 #include "AccessibilityTableRow.h"
 #include "AtomicString.h"
-#include "CString.h"
 #include "Document.h"
 #include "DocumentType.h"
 #include "Editor.h"
@@ -57,6 +56,7 @@
 #include "NotImplemented.h"
 #include "RenderText.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 
 #include <atk/atk.h>
 #include <glib.h>
@@ -448,6 +448,8 @@
                 return ATK_ROLE_LABEL;
             if (node->hasTagName(HTMLNames::divTag))
                 return ATK_ROLE_SECTION;
+            if (node->hasTagName(HTMLNames::formTag))
+                return ATK_ROLE_FORM;
         }
     }
 
@@ -996,8 +998,13 @@
     // coreObject is the unignored object whose offset the caller is requesting.
     // focusedObject is the object with the caret. It is likely ignored -- unless it's a link.
     AccessibilityObject* coreObject = core(text);
-    RenderObject* focusedNode = coreObject->selection().end().node()->renderer();
-    AccessibilityObject* focusedObject = coreObject->document()->axObjectCache()->getOrCreate(focusedNode);
+    Node* focusedNode = coreObject->selection().end().node();
+
+    if (!focusedNode)
+        return 0;
+
+    RenderObject* focusedRenderer = focusedNode->renderer();
+    AccessibilityObject* focusedObject = coreObject->document()->axObjectCache()->getOrCreate(focusedRenderer);
 
     int offset;
     // Don't ignore links if the offset is being requested for a link.
@@ -1563,7 +1570,7 @@
 {
 
     // TODO: Should we fall back on lang xml:lang when the following comes up empty?
-    String language = static_cast<AccessibilityRenderObject*>(core(document))->language();
+    String language = core(document)->language();
     if (!language.isEmpty())
         return returnString(language);
 
@@ -1656,7 +1663,7 @@
             interfaceMask |= 1 << WAI_TEXT;
             if (!coreObject->isReadOnly())
                 interfaceMask |= 1 << WAI_EDITABLE_TEXT;
-        } else if (static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
+        } else if (role != TableRole && static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->childrenInline())
             interfaceMask |= 1 << WAI_TEXT;
 
     // Image
diff --git a/WebCore/accessibility/mac/AccessibilityObjectMac.mm b/WebCore/accessibility/mac/AccessibilityObjectMac.mm
index 1807a9b..37fa65a 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectMac.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectMac.mm
@@ -41,7 +41,7 @@
     return [attachment accessibilityIsIgnored];
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     if (isMenuListPopup() || isMenuListOption())
         return IgnoreObject;
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.h b/WebCore/accessibility/mac/AccessibilityObjectWrapper.h
index 1f0a9e3..e6cc706 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.h
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.h
@@ -53,7 +53,7 @@
 - (WebCore::AccessibilityObject*)accessibilityObject;
 
 // Used to inform an element when a notification is posted for it. Used by DRT.
-- (void)accessibilityPostedNotification:(NSString *)notification;
+- (void)accessibilityPostedNotification:(NSString *)notificationName;
 
 - (NSView*)attachmentView;
 
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index b53b167..f13968d 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -152,6 +152,10 @@
 #define NSAccessibilityLoadingProgressAttribute @"AXLoadingProgress"
 #endif
 
+#ifndef NSAccessibilityHasPopupAttribute
+#define NSAccessibilityHasPopupAttribute @"AXHasPopup"
+#endif
+
 #ifdef BUILDING_ON_TIGER
 typedef unsigned NSUInteger;
 #define NSAccessibilityValueDescriptionAttribute @"AXValueDescription"
@@ -634,6 +638,9 @@
         [additional addObject:NSAccessibilityARIABusyAttribute];
     }
     
+    if (m_object->ariaHasPopup())
+        [additional addObject:NSAccessibilityHasPopupAttribute];
+    
     return additional;
 }
 
@@ -1850,6 +1857,9 @@
         return dropEffectsArray;
     }
     
+    if ([attributeName isEqualToString:NSAccessibilityHasPopupAttribute])
+        return [NSNumber numberWithBool:m_object->ariaHasPopup()];
+    
     // ARIA Live region attributes.
     if ([attributeName isEqualToString:NSAccessibilityARIALiveAttribute])
         return m_object->ariaLiveRegionStatus();
@@ -2657,22 +2667,19 @@
     return [super accessibilityArrayAttributeValues:attribute index:index maxCount:maxCount];
 }
 
-// These are used by DRT so that it can know when notifications are sent.
-// Since they are static, only one callback can be installed at a time (that's all DRT should need).
-typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
-static AXPostedNotificationCallback AXNotificationCallback = 0;
-static void* AXPostedNotificationContext = 0;
-
-- (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context
+// This is set by DRT when it wants to listen for notifications.
+static BOOL accessibilityShouldRepostNotifications;
+- (void)accessibilitySetShouldRepostNotifications:(BOOL)repost
 {
-    AXNotificationCallback = function;
-    AXPostedNotificationContext = context;
+    accessibilityShouldRepostNotifications = repost;
 }
 
-- (void)accessibilityPostedNotification:(NSString *)notification
+- (void)accessibilityPostedNotification:(NSString *)notificationName
 {
-    if (AXNotificationCallback)
-        AXNotificationCallback(self, notification, AXPostedNotificationContext);
+    if (accessibilityShouldRepostNotifications) {
+        NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:notificationName, @"notificationName", nil];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"AXDRTNotification" object:nil userInfo:userInfo];
+    }
 }
 
 @end
diff --git a/WebCore/accessibility/qt/AccessibilityObjectQt.cpp b/WebCore/accessibility/qt/AccessibilityObjectQt.cpp
index 5d85f1e..7232642 100644
--- a/WebCore/accessibility/qt/AccessibilityObjectQt.cpp
+++ b/WebCore/accessibility/qt/AccessibilityObjectQt.cpp
@@ -29,7 +29,7 @@
     return false;
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     if (isMenuListPopup() || isMenuListOption())
         return IgnoreObject;
diff --git a/WebCore/accessibility/win/AccessibilityObjectWin.cpp b/WebCore/accessibility/win/AccessibilityObjectWin.cpp
index a86988f..44122ef 100644
--- a/WebCore/accessibility/win/AccessibilityObjectWin.cpp
+++ b/WebCore/accessibility/win/AccessibilityObjectWin.cpp
@@ -35,7 +35,7 @@
     return false;
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     if (isMenuListPopup() || isMenuListOption())
         return IncludeObject;
diff --git a/WebCore/accessibility/wx/AccessibilityObjectWx.cpp b/WebCore/accessibility/wx/AccessibilityObjectWx.cpp
index 5d85f1e..7232642 100644
--- a/WebCore/accessibility/wx/AccessibilityObjectWx.cpp
+++ b/WebCore/accessibility/wx/AccessibilityObjectWx.cpp
@@ -29,7 +29,7 @@
     return false;
 }
 
-AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
+AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
 {
     if (isMenuListPopup() || isMenuListOption())
         return IgnoreObject;
diff --git a/WebCore/bindings/ScriptControllerBase.cpp b/WebCore/bindings/ScriptControllerBase.cpp
index abe96ee..41d2e0a 100644
--- a/WebCore/bindings/ScriptControllerBase.cpp
+++ b/WebCore/bindings/ScriptControllerBase.cpp
@@ -31,14 +31,17 @@
 
 namespace WebCore {
 
-bool ScriptController::canExecuteScripts()
+bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reason)
 {
     // FIXME: We should get this information from the document instead of the frame.
     if (m_frame->loader()->isSandboxed(SandboxScripts))
         return false;
 
     Settings* settings = m_frame->settings();
-    return m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled());
+    const bool allowed = m_frame->loader()->client()->allowJavaScript(settings && settings->isJavaScriptEnabled());
+    if (!allowed && reason == AboutToExecuteScript)
+        m_frame->loader()->client()->didNotAllowScript();
+    return allowed;
 }
 
 ScriptValue ScriptController::executeScript(const String& script, bool forceUserGesture)
@@ -48,7 +51,7 @@
 
 ScriptValue ScriptController::executeScript(const ScriptSourceCode& sourceCode)
 {
-    if (!canExecuteScripts() || isPaused())
+    if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
@@ -98,7 +101,7 @@
     //        synchronously can cause crashes:
     //        http://bugs.webkit.org/show_bug.cgi?id=16782
     if (replaceDocument) 
-        m_frame->loader()->replaceDocument(scriptResult);
+        m_frame->loader()->writer()->replaceDocument(scriptResult);
 
     return true;
 }
diff --git a/WebCore/bindings/generic/BindingDOMWindow.h b/WebCore/bindings/generic/BindingDOMWindow.h
index d6d3087..b46bdf9 100644
--- a/WebCore/bindings/generic/BindingDOMWindow.h
+++ b/WebCore/bindings/generic/BindingDOMWindow.h
@@ -69,12 +69,6 @@
     ASSERT(callingFrame);
     ASSERT(enteredFrame);
 
-    if (Document* callingDocument = callingFrame->document()) {
-        // Sandboxed iframes cannot open new auxiliary browsing contexts.
-        if (callingDocument->securityOrigin()->isSandboxed(SandboxNavigation))
-            return 0;
-    }
-
     ResourceRequest request;
 
     // For whatever reason, Firefox uses the entered frame to determine
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 1b09518..6ba85da 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -44,6 +44,8 @@
 bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true;
 bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
+bool RuntimeEnabledFeatures::isWebGLEnabled = false;
+bool RuntimeEnabledFeatures::isPushStateEnabled = false;
 
 #if ENABLE(VIDEO)
 
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index 6f0f78f..37dceff 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -77,6 +77,23 @@
     static bool openDatabaseEnabled();
 #endif
 
+#if ENABLE(3D_CANVAS)
+    static void setWebGLEnabled(bool isEnabled) { isWebGLEnabled = isEnabled; }
+    static bool webGLRenderingContextEnabled() { return isWebGLEnabled; }
+    static bool webGLArrayBufferEnabled() { return isWebGLEnabled; }
+    static bool webGLByteArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLUnsignedByteArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLShortArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLUnsignedShortArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLIntArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLUnsignedIntArrayEnabled() { return isWebGLEnabled; }
+    static bool webGLFloatArrayEnabled() { return isWebGLEnabled; }
+#endif
+
+    static void setPushStateEnabled(bool isEnabled) { isPushStateEnabled = isEnabled; }
+    static bool pushStateEnabled() { return isPushStateEnabled; }
+    static bool replaceStateEnabled() { return isPushStateEnabled; }
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures() { }
@@ -87,6 +104,8 @@
     static bool isApplicationCacheEnabled;
     static bool isGeolocationEnabled;
     static bool isIndexedDBEnabled;
+    static bool isWebGLEnabled;
+    static bool isPushStateEnabled;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/gobject/ConvertToUTF8String.cpp b/WebCore/bindings/gobject/ConvertToUTF8String.cpp
new file mode 100644
index 0000000..57010fa
--- /dev/null
+++ b/WebCore/bindings/gobject/ConvertToUTF8String.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * 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 "ConvertToUTF8String.h"
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include <wtf/text/CString.h>
+
+#include <glib.h>
+
+gchar* convertToUTF8String(WebCore::String const& s)
+{
+    return g_strdup(s.utf8().data());
+}
+
+gchar* convertToUTF8String(WebCore::KURL const& s)
+{
+    return g_strdup(s.string().utf8().data());
+}
+
diff --git a/WebCore/bindings/gobject/ConvertToUTF8String.h b/WebCore/bindings/gobject/ConvertToUTF8String.h
new file mode 100644
index 0000000..02b6416
--- /dev/null
+++ b/WebCore/bindings/gobject/ConvertToUTF8String.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * 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 ConvertToUTF8String_h
+#define ConvertToUTF8String_h
+
+namespace WebCore {
+class String;
+class KURL;
+}
+
+typedef char gchar;
+
+gchar* convertToUTF8String(WebCore::String const& s);
+gchar* convertToUTF8String(WebCore::KURL const& s);
+
+#endif /* ConvertToUTF8String_h */
diff --git a/WebCore/bindings/gobject/WebKitDOMBinding.cpp b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
new file mode 100644
index 0000000..1f900c3
--- /dev/null
+++ b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
@@ -0,0 +1,90 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *  Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
+ *  Copyright (C) 2009, 2010 Igalia S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "WebKitDOMBinding.h"
+
+#include "Event.h"
+#include "EventException.h"
+#include "HTMLNames.h"
+#include "WebKitDOMNode.h"
+#include "WebKitDOMNodePrivate.h"
+
+namespace WebKit {
+
+using namespace WebCore;
+using namespace WebCore::HTMLNames;
+
+// DOMObjectCache
+
+typedef HashMap<void*, gpointer> DOMObjectMap;
+
+static DOMObjectMap& domObjects()
+{
+    static DOMObjectMap staticDOMObjects;
+    return staticDOMObjects;
+}
+
+gpointer DOMObjectCache::get(void* objectHandle)
+{
+    return domObjects().get(objectHandle);
+}
+
+gpointer DOMObjectCache::put(void* objectHandle, gpointer wrapper)
+{
+    domObjects().set(objectHandle, wrapper);
+    return wrapper;
+}
+
+void DOMObjectCache::forget(void* objectHandle)
+{
+    domObjects().take(objectHandle);
+}
+
+// kit methods
+
+static gpointer createWrapper(Node* node)
+{
+    ASSERT(node);
+
+    gpointer wrappedNode = 0;
+
+    if (node->nodeType())
+        wrappedNode = wrapNode(node);
+
+    return DOMObjectCache::put(node, wrappedNode);
+}
+
+gpointer kit(Node* node)
+{
+    if (!node)
+        return 0;
+
+    gpointer kitNode = DOMObjectCache::get(node);
+    if (kitNode)
+        return kitNode;
+
+    return createWrapper(node);
+}
+
+} // namespace WebKit
diff --git a/WebCore/bindings/gobject/WebKitDOMBinding.h b/WebCore/bindings/gobject/WebKitDOMBinding.h
new file mode 100644
index 0000000..f6efa46
--- /dev/null
+++ b/WebCore/bindings/gobject/WebKitDOMBinding.h
@@ -0,0 +1,44 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *  Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
+ *  Copyright (C) 2009-2010 Igalia S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef WebKitDOMBinding_h
+#define WebKitDOMBinding_h
+
+#include <glib.h>
+
+namespace WebCore {
+class Node;
+} // namespace WebCore
+
+namespace WebKit {
+gpointer kit(WebCore::Node* node);
+
+class DOMObjectCache {
+public:
+    static gpointer get(void* objectHandle);
+    static gpointer put(void* objectHandle, gpointer wrapper);
+    static void forget(void* objectHandle);
+};
+} // namespace WebKit
+
+#endif // WebKitDOMBinding_h
diff --git a/WebCore/bindings/gobject/WebKitDOMObject.cpp b/WebCore/bindings/gobject/WebKitDOMObject.cpp
new file mode 100644
index 0000000..fc8a874
--- /dev/null
+++ b/WebCore/bindings/gobject/WebKitDOMObject.cpp
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ * Copyright (C) 2009 Igalia S.L.
+ */
+#include "config.h"
+#include "WebKitDOMObject.h"
+
+#include "glib-object.h"
+#include "WebKitDOMBinding.h"
+
+G_DEFINE_TYPE(WebKitDOMObject, webkit_dom_object, G_TYPE_OBJECT);
+
+static void webkit_dom_object_init(WebKitDOMObject* object)
+{
+}
+
+static void webkit_dom_object_class_init(WebKitDOMObjectClass* klass)
+{
+}
+
diff --git a/WebCore/bindings/gobject/WebKitDOMObject.h b/WebCore/bindings/gobject/WebKitDOMObject.h
new file mode 100644
index 0000000..b99c57c
--- /dev/null
+++ b/WebCore/bindings/gobject/WebKitDOMObject.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ * Copyright (C) 2009 Igalia S.L.
+ *
+ * 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 WebKitDOMObject_h
+#define WebKitDOMObject_h
+
+#include "glib-object.h"
+#include "webkit/webkitdomdefines.h"
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_DOM_OBJECT            (webkit_dom_object_get_type())
+#define WEBKIT_DOM_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_OBJECT, WebKitDOMObject))
+#define WEBKIT_DOM_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_DOM_OBJECT, WebKitDOMObjectClass))
+#define WEBKIT_IS_DOM_OBJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_OBJECT))
+#define WEBKIT_IS_DOM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_DOM_OBJECT))
+#define WEBKIT_DOM_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_DOM_OBJECT, WebKitDOMObjectClass))
+
+typedef struct _WebKitDOMObjectPrivate WebKitDOMObjectPrivate;
+
+struct _WebKitDOMObject {
+    GObject parentInstance;
+
+    gpointer coreObject;
+};
+
+struct _WebKitDOMObjectClass {
+    GObjectClass parentClass;
+};
+
+WEBKIT_API GType
+webkit_dom_object_get_type(void);
+
+G_END_DECLS
+
+#endif /* WebKitDOMObject_h */
diff --git a/WebCore/bindings/js/CachedScriptSourceProvider.h b/WebCore/bindings/js/CachedScriptSourceProvider.h
index 1cdd8aa..8e69b6b 100644
--- a/WebCore/bindings/js/CachedScriptSourceProvider.h
+++ b/WebCore/bindings/js/CachedScriptSourceProvider.h
@@ -50,7 +50,7 @@
 
     private:
         CachedScriptSourceProvider(CachedScript* cachedScript)
-            : ScriptSourceProvider(cachedScript->url())
+            : ScriptSourceProvider(stringToUString(cachedScript->url()))
             , m_cachedScript(cachedScript)
         {
             m_cachedScript->addClient(this);
diff --git a/WebCore/bindings/js/DOMObjectHashTableMap.cpp b/WebCore/bindings/js/DOMObjectHashTableMap.cpp
new file mode 100644
index 0000000..bfcab0b
--- /dev/null
+++ b/WebCore/bindings/js/DOMObjectHashTableMap.cpp
@@ -0,0 +1,37 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "DOMObjectHashTableMap.h"
+
+#include "WebCoreJSClientData.h"
+
+using namespace JSC;
+
+namespace WebCore{
+
+DOMObjectHashTableMap& DOMObjectHashTableMap::mapFor(JSGlobalData& globalData)
+{
+    JSGlobalData::ClientData* clientData = globalData.clientData;
+    ASSERT(clientData);
+    return static_cast<WebCoreJSClientData*>(clientData)->hashTableMap;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/DOMObjectHashTableMap.h b/WebCore/bindings/js/DOMObjectHashTableMap.h
new file mode 100644
index 0000000..4ddacb8
--- /dev/null
+++ b/WebCore/bindings/js/DOMObjectHashTableMap.h
@@ -0,0 +1,60 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef DOMObjectHashTableMap_h
+#define DOMObjectHashTableMap_h
+
+#include <runtime/Lookup.h>
+#include <wtf/HashMap.h>
+
+namespace JSC {
+    class JSGlobalData;
+}
+
+namespace WebCore {
+
+// Map from static HashTable instances to per-GlobalData ones.
+class DOMObjectHashTableMap {
+public:
+    static DOMObjectHashTableMap& mapFor(JSC::JSGlobalData&);
+
+    ~DOMObjectHashTableMap()
+    {
+        HashMap<const JSC::HashTable*, JSC::HashTable>::iterator mapEnd = m_map.end();
+        for (HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.begin(); iter != m_map.end(); ++iter)
+            iter->second.deleteTable();
+    }
+
+    const JSC::HashTable* get(const JSC::HashTable* staticTable)
+    {
+        HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable);
+        if (iter != m_map.end())
+            return &iter->second;
+        return &m_map.set(staticTable, JSC::HashTable(*staticTable)).first->second;
+    }
+
+private:
+    HashMap<const JSC::HashTable*, JSC::HashTable> m_map;
+};
+
+} // namespace WebCore
+
+#endif // DOMObjectHashTableMap_h
diff --git a/WebCore/bindings/js/DOMWrapperWorld.cpp b/WebCore/bindings/js/DOMWrapperWorld.cpp
new file mode 100644
index 0000000..10c3fdd
--- /dev/null
+++ b/WebCore/bindings/js/DOMWrapperWorld.cpp
@@ -0,0 +1,85 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "DOMWrapperWorld.h"
+
+#include "JSDOMWindow.h"
+#include "ScriptController.h"
+#include "WebCoreJSClientData.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+DOMWrapperWorld::DOMWrapperWorld(JSC::JSGlobalData* globalData, bool isNormal)
+    : m_globalData(globalData)
+    , m_isNormal(isNormal)
+    , m_isRegistered(false)
+{
+    registerWorld();
+}
+
+DOMWrapperWorld::~DOMWrapperWorld()
+{
+    unregisterWorld();
+}
+
+void DOMWrapperWorld::registerWorld()
+{
+    JSGlobalData::ClientData* clientData = m_globalData->clientData;
+    ASSERT(clientData);
+    static_cast<WebCoreJSClientData*>(clientData)->rememberWorld(this);
+    m_isRegistered = true;
+}
+
+void DOMWrapperWorld::unregisterWorld()
+{
+    if (!m_isRegistered)
+        return;
+    m_isRegistered = false;
+
+    JSGlobalData::ClientData* clientData = m_globalData->clientData;
+    ASSERT(clientData);
+    static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
+
+    // These items are created lazily.
+    while (!m_documentsWithWrapperCaches.isEmpty())
+        (*m_documentsWithWrapperCaches.begin())->destroyWrapperCache(this);
+
+    while (!m_scriptControllersWithWindowShells.isEmpty())
+        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(this);
+}
+
+DOMWrapperWorld* normalWorld(JSC::JSGlobalData& globalData)
+{
+    JSGlobalData::ClientData* clientData = globalData.clientData;
+    ASSERT(clientData);
+    return static_cast<WebCoreJSClientData*>(clientData)->normalWorld();
+}
+
+DOMWrapperWorld* mainThreadNormalWorld()
+{
+    ASSERT(isMainThread());
+    static DOMWrapperWorld* cachedNormalWorld = normalWorld(*JSDOMWindow::commonJSGlobalData());
+    return cachedNormalWorld;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/DOMWrapperWorld.h b/WebCore/bindings/js/DOMWrapperWorld.h
new file mode 100644
index 0000000..832c5e0
--- /dev/null
+++ b/WebCore/bindings/js/DOMWrapperWorld.h
@@ -0,0 +1,97 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef DOMWrapperWorld_h
+#define DOMWrapperWorld_h
+
+#include "Document.h"
+#include "JSDOMGlobalObject.h"
+#include "JSDOMWrapper.h"
+#include <runtime/WeakGCMap.h>
+
+namespace WebCore {
+
+class ScriptController;
+class StringImpl;
+
+typedef JSC::WeakGCMap<void*, DOMObject*> DOMObjectWrapperMap;
+typedef JSC::WeakGCMap<StringImpl*, JSC::JSString*> JSStringCache; 
+
+class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
+public:
+    static PassRefPtr<DOMWrapperWorld> create(JSC::JSGlobalData* globalData, bool isNormal = false)
+    {
+        return adoptRef(new DOMWrapperWorld(globalData, isNormal));
+    }
+    ~DOMWrapperWorld();
+    
+    void registerWorld();
+    void unregisterWorld();
+
+    void didCreateWrapperCache(Document* document) { m_documentsWithWrapperCaches.add(document); }
+    void didDestroyWrapperCache(Document* document) { m_documentsWithWrapperCaches.remove(document); }
+
+    void didCreateWindowShell(ScriptController* scriptController) { m_scriptControllersWithWindowShells.add(scriptController); }
+    void didDestroyWindowShell(ScriptController* scriptController) { m_scriptControllersWithWindowShells.remove(scriptController); }
+
+    // FIXME: can we make this private?
+    DOMObjectWrapperMap m_wrappers;
+    JSStringCache m_stringCache;
+
+    bool isNormal() const { return m_isNormal; }
+
+protected:
+    DOMWrapperWorld(JSC::JSGlobalData*, bool isNormal);
+
+private:
+    JSC::JSGlobalData* m_globalData;
+    HashSet<Document*> m_documentsWithWrapperCaches;
+    HashSet<ScriptController*> m_scriptControllersWithWindowShells;
+    bool m_isNormal;
+    bool m_isRegistered;
+};
+
+DOMWrapperWorld* normalWorld(JSC::JSGlobalData&);
+DOMWrapperWorld* mainThreadNormalWorld();
+inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
+inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
+
+inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
+{
+    return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
+}
+
+// From Document.h
+
+inline Document::JSWrapperCache* Document::getWrapperCache(DOMWrapperWorld* world)
+{
+    if (world->isNormal()) {
+        if (Document::JSWrapperCache* wrapperCache = m_normalWorldWrapperCache)
+            return wrapperCache;
+        ASSERT(!m_wrapperCacheMap.contains(world));
+    } else if (Document::JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world))
+        return wrapperCache;
+    return createWrapperCache(world);
+}
+
+} // namespace WebCore
+
+#endif // DOMWrapperWorld_h
diff --git a/WebCore/bindings/js/GCController.cpp b/WebCore/bindings/js/GCController.cpp
index 3e5645f..d5a1789 100644
--- a/WebCore/bindings/js/GCController.cpp
+++ b/WebCore/bindings/js/GCController.cpp
@@ -71,7 +71,9 @@
 
 void GCController::garbageCollectNow()
 {
-    collect(0);
+    JSLock lock(SilenceAssertionsOnly);
+    if (!JSDOMWindow::commonJSGlobalData()->heap.isBusy())
+        collect(0);
 }
 
 void GCController::garbageCollectOnAlternateThreadForDebugging(bool waitUntilDone)
diff --git a/WebCore/bindings/js/JSAbstractWorkerCustom.cpp b/WebCore/bindings/js/JSAbstractWorkerCustom.cpp
index 61fcf98..1f843f9 100644
--- a/WebCore/bindings/js/JSAbstractWorkerCustom.cpp
+++ b/WebCore/bindings/js/JSAbstractWorkerCustom.cpp
@@ -50,7 +50,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -60,7 +60,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSAttrCustom.cpp b/WebCore/bindings/js/JSAttrCustom.cpp
index 3c01535..4cd40ac 100644
--- a/WebCore/bindings/js/JSAttrCustom.cpp
+++ b/WebCore/bindings/js/JSAttrCustom.cpp
@@ -33,6 +33,7 @@
 #include "Document.h"
 #include "HTMLFrameElementBase.h"
 #include "HTMLNames.h"
+#include "JSDOMBinding.h"
 
 using namespace JSC;
 
@@ -46,13 +47,8 @@
     String attrValue = valueToStringWithNullCheck(exec, value);
 
     Element* ownerElement = imp->ownerElement();
-    if (ownerElement && (ownerElement->hasTagName(iframeTag) || ownerElement->hasTagName(frameTag))) {
-        if (equalIgnoringCase(imp->name(), "src") && protocolIsJavaScript(deprecatedParseURL(attrValue))) {
-            Document* contentDocument = static_cast<HTMLFrameElementBase*>(ownerElement)->contentDocument();
-            if (contentDocument && !checkNodeSecurity(exec, contentDocument))
-                return;
-        }
-    }
+    if (ownerElement && !allowSettingSrcToJavascriptURL(exec, ownerElement, imp->name(), attrValue))
+        return;
 
     ExceptionCode ec = 0;
     imp->setValue(attrValue, ec);
diff --git a/WebCore/bindings/js/JSAudioConstructor.cpp b/WebCore/bindings/js/JSAudioConstructor.cpp
index 77bb120..cc791d1 100644
--- a/WebCore/bindings/js/JSAudioConstructor.cpp
+++ b/WebCore/bindings/js/JSAudioConstructor.cpp
@@ -64,7 +64,7 @@
     // rather than looking at args.size.
     String src;
     if (args.size() > 0)
-        src = args.at(0).toString(exec);
+        src = ustringToString(args.at(0).toString(exec));
     return asObject(toJS(exec, jsConstructor->globalObject(),
         HTMLAudioElement::createForJSConstructor(document, src)));
 }
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index 5a0820b..2e05350 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -113,6 +113,7 @@
 #include "JSSVGMatrixCustom.cpp"
 #include "JSSVGPathSegCustom.cpp"
 #include "JSSVGPathSegListCustom.cpp"
+#include "JSScriptProfileNodeCustom.cpp"
 #include "JSSharedWorkerConstructor.cpp"
 #include "JSSharedWorkerCustom.cpp"
 #include "JSStorageCustom.cpp"
@@ -127,12 +128,14 @@
 #include "JSWorkerConstructor.cpp"
 #include "JSWorkerContextBase.cpp"
 #include "JSWorkerContextCustom.cpp"
+#include "JSWorkerContextErrorHandler.cpp"
 #include "JSWorkerCustom.cpp"
 #include "JSXMLHttpRequestConstructor.cpp"
 #include "JSXMLHttpRequestCustom.cpp"
 #include "JSXMLHttpRequestUploadCustom.cpp"
 #include "JSXSLTProcessorConstructor.cpp"
 #include "JSXSLTProcessorCustom.cpp"
+#include "JavaScriptCallFrame.cpp"
 #include "ScheduledAction.cpp"
 #include "ScriptArray.cpp"
 #include "ScriptCachedFrameData.cpp"
diff --git a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 4a137d3..22bfee4 100644
--- a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -142,9 +142,9 @@
 
 // FIXME: You can get these properties, and set them (see putDelegate below),
 // but you should also be able to enumerate them.
-JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slot.slotBase()));
+    JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
 
     // Set up pixelOrPos boolean to handle the fact that
     // pixelTop returns "CSS Top" as number value in unit pixels
@@ -165,7 +165,7 @@
 
     // Make the SVG 'filter' attribute undetectable, to avoid confusion with the IE 'filter' attribute.
     if (propertyName == "filter")
-        return StringObjectThatMasqueradesAsUndefined::create(exec, thisObj->impl()->getPropertyValue(prop));
+        return StringObjectThatMasqueradesAsUndefined::create(exec, stringToUString(thisObj->impl()->getPropertyValue(prop)));
 
     return jsString(exec, thisObj->impl()->getPropertyValue(prop));
 }
diff --git a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index a271923..7a776db 100644
--- a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -54,7 +54,7 @@
 static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState* exec, JSValue value)
 {
     if (value.isString())
-        return CanvasStyle::create(asString(value)->value(exec));
+        return CanvasStyle::create(ustringToString(asString(value)->value(exec)));
     if (!value.isObject())
         return 0;
     JSObject* object = asObject(value);
@@ -102,13 +102,13 @@
     switch (args.size()) {
         case 1:
             if (args.at(0).isString())
-                context->setFillColor(asString(args.at(0))->value(exec));
+                context->setFillColor(ustringToString(asString(args.at(0))->value(exec)));
             else
                 context->setFillColor(args.at(0).toFloat(exec));
             break;
         case 2:
             if (args.at(0).isString())
-                context->setFillColor(asString(args.at(0))->value(exec), args.at(1).toFloat(exec));
+                context->setFillColor(ustringToString(asString(args.at(0))->value(exec)), args.at(1).toFloat(exec));
             else
                 context->setFillColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec));
             break;
@@ -139,13 +139,13 @@
     switch (args.size()) {
         case 1:
             if (args.at(0).isString())
-                context->setStrokeColor(asString(args.at(0))->value(exec));
+                context->setStrokeColor(ustringToString(asString(args.at(0))->value(exec)));
             else
                 context->setStrokeColor(args.at(0).toFloat(exec));
             break;
         case 2:
             if (args.at(0).isString())
-                context->setStrokeColor(asString(args.at(0))->value(exec), args.at(1).toFloat(exec));
+                context->setStrokeColor(ustringToString(asString(args.at(0))->value(exec)), args.at(1).toFloat(exec));
             else
                 context->setStrokeColor(args.at(0).toFloat(exec), args.at(1).toFloat(exec));
             break;
@@ -198,7 +198,7 @@
         HTMLImageElement* imgElt = static_cast<HTMLImageElement*>(static_cast<JSHTMLElement*>(o)->impl());
         switch (args.size()) {
             case 3:
-                context->drawImage(imgElt, args.at(1).toFloat(exec), args.at(2).toFloat(exec));
+                context->drawImage(imgElt, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec);
                 break;
             case 5:
                 context->drawImage(imgElt, args.at(1).toFloat(exec), args.at(2).toFloat(exec),
@@ -219,7 +219,7 @@
         HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLElement*>(o)->impl());
         switch (args.size()) {
             case 3:
-                context->drawImage(canvas, args.at(1).toFloat(exec), args.at(2).toFloat(exec));
+                context->drawImage(canvas, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec);
                 break;
             case 5:
                 context->drawImage(canvas, args.at(1).toFloat(exec), args.at(2).toFloat(exec),
@@ -241,7 +241,7 @@
             HTMLVideoElement* video = static_cast<HTMLVideoElement*>(static_cast<JSHTMLElement*>(o)->impl());
             switch (args.size()) {
                 case 3:
-                    context->drawImage(video, args.at(1).toFloat(exec), args.at(2).toFloat(exec));
+                    context->drawImage(video, args.at(1).toFloat(exec), args.at(2).toFloat(exec), ec);
                     break;
                 case 5:
                     context->drawImage(video, args.at(1).toFloat(exec), args.at(2).toFloat(exec),
@@ -282,7 +282,7 @@
                                args.at(3).toFloat(exec), args.at(4).toFloat(exec),
                                args.at(5).toFloat(exec), args.at(6).toFloat(exec),
                                args.at(7).toFloat(exec), args.at(8).toFloat(exec),
-                               args.at(9).toString(exec));    
+                               ustringToString(args.at(9).toString(exec)));    
     return jsUndefined();    
 }
 
@@ -298,7 +298,7 @@
         case 4:
             if (args.at(3).isString())
                 context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
-                                   args.at(2).toFloat(exec), asString(args.at(3))->value(exec));
+                                   args.at(2).toFloat(exec), ustringToString(asString(args.at(3))->value(exec)));
             else
                 context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
                                    args.at(2).toFloat(exec), args.at(3).toFloat(exec));
@@ -306,7 +306,7 @@
         case 5:
             if (args.at(3).isString())
                 context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
-                                   args.at(2).toFloat(exec), asString(args.at(3))->value(exec),
+                                   args.at(2).toFloat(exec), ustringToString(asString(args.at(3))->value(exec)),
                                    args.at(4).toFloat(exec));
             else
                 context->setShadow(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
@@ -391,9 +391,9 @@
         return throwError(exec, SyntaxError);
     
     if (args.size() == 4)
-        context->fillText(args.at(0).toString(exec), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec));
+        context->fillText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec));
     else
-        context->fillText(args.at(0).toString(exec), args.at(1).toFloat(exec), args.at(2).toFloat(exec));
+        context->fillText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec));
     return jsUndefined();
 }
 
@@ -409,9 +409,9 @@
         return throwError(exec, SyntaxError);
     
     if (args.size() == 4)
-        context->strokeText(args.at(0).toString(exec), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec));
+        context->strokeText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec), args.at(3).toFloat(exec));
     else
-        context->strokeText(args.at(0).toString(exec), args.at(1).toFloat(exec), args.at(2).toFloat(exec));
+        context->strokeText(ustringToString(args.at(0).toString(exec)), args.at(1).toFloat(exec), args.at(2).toFloat(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSClipboardCustom.cpp b/WebCore/bindings/js/JSClipboardCustom.cpp
index 78dca49..7efd2b0 100644
--- a/WebCore/bindings/js/JSClipboardCustom.cpp
+++ b/WebCore/bindings/js/JSClipboardCustom.cpp
@@ -59,7 +59,7 @@
     MarkedArgumentBuffer list;
     HashSet<String>::const_iterator end = types.end();
     for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
-        list.append(jsString(exec, UString(*it)));
+        list.append(jsString(exec, stringToUString(*it)));
     return constructArray(exec, list);
 }
 
@@ -73,7 +73,7 @@
     }
 
     if (args.size() == 1) {
-        clipboard->clearData(args.at(0).toString(exec));
+        clipboard->clearData(ustringToString(args.at(0).toString(exec)));
         return jsUndefined();
     }
 
@@ -90,7 +90,7 @@
     Clipboard* clipboard = impl();
 
     bool success;
-    String result = clipboard->getData(args.at(0).toString(exec), success);
+    String result = clipboard->getData(ustringToString(args.at(0).toString(exec)), success);
     if (!success)
         return jsUndefined();
 
@@ -105,7 +105,7 @@
     if (args.size() != 2)
         return throwError(exec, SyntaxError, "setData: Invalid number of arguments");
 
-    return jsBoolean(clipboard->setData(args.at(0).toString(exec), args.at(1).toString(exec)));
+    return jsBoolean(clipboard->setData(ustringToString(args.at(0).toString(exec)), ustringToString(args.at(1).toString(exec))));
 }
 
 JSValue JSClipboard::setDragImage(ExecState* exec, const ArgList& args)
diff --git a/WebCore/bindings/js/JSConsoleCustom.cpp b/WebCore/bindings/js/JSConsoleCustom.cpp
index b631cdd..3ad34a3 100644
--- a/WebCore/bindings/js/JSConsoleCustom.cpp
+++ b/WebCore/bindings/js/JSConsoleCustom.cpp
@@ -28,8 +28,9 @@
 #include "JSConsole.h"
 
 #include "Console.h"
-#include "JavaScriptProfile.h"
+#include "JSScriptProfile.h"
 #include "ScriptCallStack.h"
+#include "ScriptProfile.h"
 #include <runtime/JSArray.h>
 
 using namespace JSC;
@@ -38,7 +39,7 @@
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 
-typedef Vector<RefPtr<JSC::Profile> > ProfilesArray;
+typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
 
 JSValue JSConsole::profiles(ExecState* exec) const
 {
diff --git a/WebCore/bindings/js/JSCustomPositionCallback.cpp b/WebCore/bindings/js/JSCustomPositionCallback.cpp
index e5f83aa..cc6d45c 100644
--- a/WebCore/bindings/js/JSCustomPositionCallback.cpp
+++ b/WebCore/bindings/js/JSCustomPositionCallback.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "JSCustomPositionCallback.h"
 
+#if ENABLE(GEOLOCATION)
+
 #include "Frame.h"
 #include "JSGeoposition.h"
 #include "ScriptController.h"
@@ -52,3 +54,5 @@
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp b/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp
index bd64deb..c94ae9a 100644
--- a/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp
+++ b/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "JSCustomPositionErrorCallback.h"
 
+#if ENABLE(GEOLOCATION)
+
 #include "Frame.h"
 #include "JSPositionError.h"
 #include "ScriptController.h"
@@ -53,3 +55,5 @@
 }
     
 } // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
index 1f6bd95..46a7ae5 100644
--- a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
+++ b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
@@ -32,21 +32,22 @@
 #if ENABLE(DATABASE)
 
 #include "Frame.h"
-#include "ScriptController.h"
 #include "JSSQLResultSet.h"
 #include "JSSQLTransaction.h"
+#include "ScriptExecutionContext.h"
 #include <runtime/JSLock.h>
 #include <wtf/MainThread.h>
 
 namespace WebCore {
-    
+
 using namespace JSC;
-    
+
 JSCustomSQLStatementCallback::JSCustomSQLStatementCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
     : m_data(new JSCallbackData(callback, globalObject))
+    , m_isolatedWorld(globalObject->world())
 {
 }
-    
+
 JSCustomSQLStatementCallback::~JSCustomSQLStatementCallback()
 {
     callOnMainThread(JSCallbackData::deleteData, m_data);
@@ -55,14 +56,19 @@
 #endif
 }
 
-void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
+void JSCustomSQLStatementCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
 {
     ASSERT(m_data);
+    ASSERT(context);
 
     RefPtr<JSCustomSQLStatementCallback> protect(this);
 
     JSC::JSLock lock(SilenceAssertionsOnly);
-    ExecState* exec = m_data->globalObject()->globalExec();
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
     MarkedArgumentBuffer args;
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), transaction));
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), resultSet));
diff --git a/WebCore/bindings/js/JSCustomSQLStatementCallback.h b/WebCore/bindings/js/JSCustomSQLStatementCallback.h
index 259aecf..cb7b34d 100644
--- a/WebCore/bindings/js/JSCustomSQLStatementCallback.h
+++ b/WebCore/bindings/js/JSCustomSQLStatementCallback.h
@@ -45,15 +45,16 @@
     {
         return adoptRef(new JSCustomSQLStatementCallback(callback, globalObject));
     }
-    
+
     virtual ~JSCustomSQLStatementCallback();
 
-    virtual void handleEvent(SQLTransaction*, SQLResultSet*, bool& raisedException);
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLResultSet*, bool& raisedException);
 
 private:
     JSCustomSQLStatementCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
 
     JSCallbackData* m_data;
+    RefPtr<DOMWrapperWorld> m_isolatedWorld;
 };
 
 }
diff --git a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
index 4d5de79..a2ba52a 100644
--- a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
+++ b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
@@ -35,16 +35,17 @@
 #include "JSCallbackData.h"
 #include "JSSQLError.h"
 #include "JSSQLTransaction.h"
-#include "ScriptController.h"
+#include "ScriptExecutionContext.h"
 #include <runtime/JSLock.h>
 #include <wtf/MainThread.h>
 
 namespace WebCore {
-    
+
 using namespace JSC;
-    
+
 JSCustomSQLStatementErrorCallback::JSCustomSQLStatementErrorCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
     : m_data(new JSCallbackData(callback, globalObject))
+    , m_isolatedWorld(globalObject->world())
 {
 }
 
@@ -56,18 +57,23 @@
 #endif
 }
 
-bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLError* error)
+bool JSCustomSQLStatementErrorCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLError* error)
 {
     ASSERT(m_data);
-        
+    ASSERT(context);
+
     RefPtr<JSCustomSQLStatementErrorCallback> protect(this);
-        
+
     JSC::JSLock lock(SilenceAssertionsOnly);
-    ExecState* exec = m_data->globalObject()->globalExec();
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    if (!globalObject)
+        return true; // if we cannot invoke the callback, roll back the transaction
+
+    ExecState* exec = globalObject->globalExec();
     MarkedArgumentBuffer args;
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), transaction));
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), error));
-    
+
     bool raisedException = false;
     JSValue result = m_data->invokeCallback(args, &raisedException);
     if (raisedException) {
@@ -77,7 +83,7 @@
         // Therefore an exception and returning true are the same thing - so, return true on an exception
         return true;
     }
-    return !result.isFalse();
+    return result.toBoolean(exec);
 }
 
 }
diff --git a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h
index ac4e45f..b1b0792 100644
--- a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h
+++ b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h
@@ -31,16 +31,15 @@
 
 #if ENABLE(DATABASE)
 
-#include "JSDOMGlobalObject.h"
+#include "JSCallbackData.h"
 #include "SQLStatementErrorCallback.h"
-#include <runtime/Protect.h>
 #include <wtf/Forward.h>
 
 namespace WebCore {
 
-class JSCallbackData;    
+class JSCallbackData;
 class SQLError;
-    
+
 class JSCustomSQLStatementErrorCallback : public SQLStatementErrorCallback {
 public:
     static PassRefPtr<JSCustomSQLStatementErrorCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
@@ -50,17 +49,17 @@
 
     virtual ~JSCustomSQLStatementErrorCallback();
 
-    virtual bool handleEvent(SQLTransaction*, SQLError*);
+    virtual bool handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLError*);
 
 private:
     JSCustomSQLStatementErrorCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
 
     JSCallbackData* m_data;
+    RefPtr<DOMWrapperWorld> m_isolatedWorld;
 };
-    
+
 }
 
 #endif // ENABLE(DATABASE)
 
 #endif // JSCustomSQLStatementErrorCallback_h
-
diff --git a/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp b/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
index 456022f..d5e9754 100644
--- a/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
+++ b/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
@@ -33,24 +33,23 @@
 
 #include "Frame.h"
 #include "JSCallbackData.h"
-#include "JSDOMGlobalObject.h"
 #include "JSSQLTransaction.h"
-#include "Page.h"
-#include "ScriptController.h"
+#include "ScriptExecutionContext.h"
 #include <runtime/JSLock.h>
 #include <wtf/MainThread.h>
 #include <wtf/RefCountedLeakCounter.h>
 
 namespace WebCore {
-    
+
 using namespace JSC;
-    
+
 #ifndef NDEBUG
 static WTF::RefCountedLeakCounter counter("JSCustomSQLTransactionCallback");
 #endif
 
 JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
     : m_data(new JSCallbackData(callback, globalObject))
+    , m_isolatedWorld(globalObject->world())
 {
 #ifndef NDEBUG
     counter.increment();
@@ -66,19 +65,24 @@
 #endif
 }
 
-void JSCustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bool& raisedException)
+void JSCustomSQLTransactionCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, bool& raisedException)
 {
     ASSERT(m_data);
+    ASSERT(context);
 
     RefPtr<JSCustomSQLTransactionCallback> protect(this);
-        
+
     JSC::JSLock lock(SilenceAssertionsOnly);
-    ExecState* exec = m_data->globalObject()->globalExec();
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
     MarkedArgumentBuffer args;
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), transaction));
     m_data->invokeCallback(args, &raisedException);
 }
-    
+
 }
 
 #endif // ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSCustomSQLTransactionCallback.h b/WebCore/bindings/js/JSCustomSQLTransactionCallback.h
index f142e59..bf2ae68 100644
--- a/WebCore/bindings/js/JSCustomSQLTransactionCallback.h
+++ b/WebCore/bindings/js/JSCustomSQLTransactionCallback.h
@@ -31,12 +31,9 @@
 
 #if ENABLE(DATABASE)
 
+#include "JSDOMGlobalObject.h"
 #include "SQLTransactionCallback.h"
-#include <wtf/PassRefPtr.h>
-
-namespace JSC {
-    class JSObject;
-}
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -52,13 +49,14 @@
     }
 
     virtual ~JSCustomSQLTransactionCallback();
-    
-    virtual void handleEvent(SQLTransaction*, bool& raisedException);
+
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, bool& raisedException);
 
 private:
     JSCustomSQLTransactionCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
 
     JSCallbackData* m_data;
+    RefPtr<DOMWrapperWorld> m_isolatedWorld;
 };
 
 }
diff --git a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
index 331e014..09ff340 100644
--- a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
+++ b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
@@ -34,16 +34,17 @@
 #include "Frame.h"
 #include "JSCallbackData.h"
 #include "JSSQLError.h"
-#include "ScriptController.h"
+#include "ScriptExecutionContext.h"
 #include <runtime/JSLock.h>
 #include <wtf/MainThread.h>
 
 namespace WebCore {
-    
+
 using namespace JSC;
-    
+
 JSCustomSQLTransactionErrorCallback::JSCustomSQLTransactionErrorCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
     : m_data(new JSCallbackData(callback, globalObject))
+    , m_isolatedWorld(globalObject->world())
 {
 }
 
@@ -55,14 +56,19 @@
 #endif
 }
 
-void JSCustomSQLTransactionErrorCallback::handleEvent(SQLError* error)
+void JSCustomSQLTransactionErrorCallback::handleEvent(ScriptExecutionContext* context, SQLError* error)
 {
     ASSERT(m_data);
+    ASSERT(context);
 
     RefPtr<JSCustomSQLTransactionErrorCallback> protect(this);
 
     JSC::JSLock lock(SilenceAssertionsOnly);
-    ExecState* exec = m_data->globalObject()->globalExec();
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
     MarkedArgumentBuffer args;
     args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), error));
     m_data->invokeCallback(args);
diff --git a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h
index 54bf33b..bb92393 100644
--- a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h
+++ b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h
@@ -31,9 +31,8 @@
 
 #if ENABLE(DATABASE)
 
+#include "JSCallbackData.h"
 #include "SQLTransactionErrorCallback.h"
-#include "JSDOMGlobalObject.h"
-#include <runtime/Protect.h>
 #include <wtf/Forward.h>
 
 namespace WebCore {
@@ -47,15 +46,16 @@
     {
         return adoptRef(new JSCustomSQLTransactionErrorCallback(callback, globalObject));
     }
-    
+
     virtual ~JSCustomSQLTransactionErrorCallback();
-    
-    virtual void handleEvent(SQLError*);
+
+    virtual void handleEvent(ScriptExecutionContext*, SQLError*);
 
 private:
     JSCustomSQLTransactionErrorCallback(JSC::JSObject* callback, JSDOMGlobalObject* globalObject);
 
     JSCallbackData* m_data;
+    RefPtr<DOMWrapperWorld> m_isolatedWorld;
 };
 
 }
diff --git a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
index 07cfc74..e7d174f 100644
--- a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
+++ b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
@@ -98,7 +98,7 @@
         reportCurrentException(exec);
     else {
         if (!retval.isUndefinedOrNull())
-            result = retval.toString(exec);
+            result = ustringToString(retval.toString(exec));
     }
 
     Document::updateStyleForAllDocuments();
diff --git a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
index 5637087..6198d6e 100644
--- a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
+++ b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
@@ -91,7 +91,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -101,7 +101,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index abba405..a4c3d6a 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -24,7 +24,9 @@
 #include "debugger/DebuggerCallFrame.h"
 
 #include "ActiveDOMObject.h"
+#include "CSSHelper.h"
 #include "DOMCoreException.h"
+#include "DOMObjectHashTableMap.h"
 #include "Document.h"
 #include "EventException.h"
 #include "ExceptionBase.h"
@@ -32,11 +34,13 @@
 #include "Frame.h"
 #include "HTMLAudioElement.h"
 #include "HTMLCanvasElement.h"
+#include "HTMLFrameElementBase.h"
 #include "HTMLImageElement.h"
-#include "HTMLScriptElement.h"
 #include "HTMLNames.h"
+#include "HTMLScriptElement.h"
 #include "JSDOMCoreException.h"
 #include "JSDOMWindowCustom.h"
+#include "JSDebugWrapperSet.h"
 #include "JSEventException.h"
 #include "JSExceptionBase.h"
 #include "JSNode.h"
@@ -48,6 +52,7 @@
 #include "ScriptCachedFrameData.h"
 #include "ScriptController.h"
 #include "Settings.h"
+#include "WebCoreJSClientData.h"
 #include "XMLHttpRequestException.h"
 #include <runtime/DateInstance.h>
 #include <runtime/Error.h>
@@ -66,11 +71,6 @@
 #include "XPathException.h"
 #endif
 
-#if ENABLE(WORKERS)
-#include <wtf/ThreadSpecific.h>
-using namespace WTF;
-#endif
-
 using namespace JSC;
 
 namespace WebCore {
@@ -80,85 +80,6 @@
 typedef Document::JSWrapperCache JSWrapperCache;
 typedef Document::JSWrapperCacheMap JSWrapperCacheMap;
 
-inline JSWrapperCache* Document::getWrapperCache(DOMWrapperWorld* world)
-{
-    if (world->isNormal()) {
-        if (JSWrapperCache* wrapperCache = m_normalWorldWrapperCache)
-            return wrapperCache;
-        ASSERT(!m_wrapperCacheMap.contains(world));
-    } else if (JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world))
-        return wrapperCache;
-    return createWrapperCache(world);
-}
-
-// For debugging, keep a set of wrappers currently cached, and check that
-// all are uncached before they are destroyed. This helps us catch bugs like:
-//     - wrappers being deleted without being removed from the cache
-//     - wrappers being cached twice
-
-static void willCacheWrapper(DOMObject* wrapper);
-static void didUncacheWrapper(DOMObject* wrapper);
-
-#ifdef NDEBUG
-
-static inline void willCacheWrapper(DOMObject*)
-{
-}
-
-static inline void didUncacheWrapper(DOMObject*)
-{
-}
-
-#else
-
-static HashSet<DOMObject*>& wrapperSet()
-{
-#if ENABLE(WORKERS)
-    DEFINE_STATIC_LOCAL(ThreadSpecific<HashSet<DOMObject*> >, staticWrapperSet, ());
-    return *staticWrapperSet;
-#else
-    DEFINE_STATIC_LOCAL(HashSet<DOMObject*>, staticWrapperSet, ());
-    return staticWrapperSet;
-#endif
-}
-
-static void willCacheWrapper(DOMObject* wrapper)
-{
-    ASSERT(!wrapperSet().contains(wrapper));
-    wrapperSet().add(wrapper);
-}
-
-static void didUncacheWrapper(DOMObject* wrapper)
-{
-    if (!wrapper)
-        return;
-    ASSERT(wrapperSet().contains(wrapper));
-    wrapperSet().remove(wrapper);
-}
-
-DOMObject::~DOMObject()
-{
-    ASSERT(!wrapperSet().contains(this));
-}
-
-#endif
-
-DOMWrapperWorld::DOMWrapperWorld(JSC::JSGlobalData* globalData, bool isNormal)
-    : m_globalData(globalData)
-    , m_isNormal(isNormal)
-{
-}
-
-DOMWrapperWorld::~DOMWrapperWorld()
-{
-    JSGlobalData::ClientData* clientData = m_globalData->clientData;
-    ASSERT(clientData);
-    static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
-
-    for (HashSet<Document*>::iterator iter = documentsWithWrappers.begin(); iter != documentsWithWrappers.end(); ++iter)
-        forgetWorldOfDOMNodesForDocument(*iter, this);
-}
-
 class JSGlobalDataWorldIterator {
 public:
     JSGlobalDataWorldIterator(JSGlobalData* globalData)
@@ -195,37 +116,11 @@
     HashSet<DOMWrapperWorld*>::iterator m_end;
 };
 
-DOMWrapperWorld* normalWorld(JSC::JSGlobalData& globalData)
-{
-    JSGlobalData::ClientData* clientData = globalData.clientData;
-    ASSERT(clientData);
-    return static_cast<WebCoreJSClientData*>(clientData)->normalWorld();
-}
-
-DOMWrapperWorld* mainThreadNormalWorld()
-{
-    ASSERT(isMainThread());
-    static DOMWrapperWorld* cachedNormalWorld = normalWorld(*JSDOMWindow::commonJSGlobalData());
-    return cachedNormalWorld;
-}
-
-DOMObjectHashTableMap& DOMObjectHashTableMap::mapFor(JSGlobalData& globalData)
-{
-    JSGlobalData::ClientData* clientData = globalData.clientData;
-    ASSERT(clientData);
-    return static_cast<WebCoreJSClientData*>(clientData)->hashTableMap;
-}
-
 const JSC::HashTable* getHashTableForGlobalData(JSGlobalData& globalData, const JSC::HashTable* staticTable)
 {
     return DOMObjectHashTableMap::mapFor(globalData).get(staticTable);
 }
 
-static inline DOMObjectWrapperMap& DOMObjectWrapperMapFor(JSC::ExecState* exec)
-{
-    return currentWorld(exec)->m_wrappers;
-}
-
 bool hasCachedDOMObjectWrapperUnchecked(JSGlobalData* globalData, void* objectHandle)
 {
     for (JSGlobalDataWorldIterator worldIter(globalData); worldIter; ++worldIter) {
@@ -246,13 +141,13 @@
 
 DOMObject* getCachedDOMObjectWrapper(JSC::ExecState* exec, void* objectHandle) 
 {
-    return DOMObjectWrapperMapFor(exec).get(objectHandle);
+    return domObjectWrapperMapFor(exec).get(objectHandle);
 }
 
 void cacheDOMObjectWrapper(JSC::ExecState* exec, void* objectHandle, DOMObject* wrapper) 
 {
-    willCacheWrapper(wrapper);
-    DOMObjectWrapperMapFor(exec).set(objectHandle, wrapper);
+    JSDebugWrapperSet::willCacheWrapper(wrapper);
+    domObjectWrapperMapFor(exec).set(objectHandle, wrapper);
 }
 
 bool hasCachedDOMNodeWrapperUnchecked(Document* document, Node* node)
@@ -268,13 +163,6 @@
     return false;
 }
 
-JSNode* getCachedDOMNodeWrapper(JSC::ExecState* exec, Document* document, Node* node)
-{
-    if (document)
-        return document->getWrapperCache(currentWorld(exec))->get(node);
-    return static_cast<JSNode*>(DOMObjectWrapperMapFor(exec).get(node));
-}
-
 void forgetDOMObject(DOMObject* wrapper, void* objectHandle)
 {
     JSC::JSGlobalData* globalData = Heap::heap(wrapper)->globalData();
@@ -284,7 +172,7 @@
     ASSERT(clientData);
     DOMObjectWrapperMap& wrappers = static_cast<WebCoreJSClientData*>(clientData)->normalWorld()->m_wrappers;
     if (wrappers.uncheckedRemove(objectHandle, wrapper)) {
-        didUncacheWrapper(wrapper);
+        JSDebugWrapperSet::didUncacheWrapper(wrapper);
         return;
     }
 
@@ -294,11 +182,13 @@
         if (worldIter->m_wrappers.uncheckedRemove(objectHandle, wrapper))
             break;
     }
-    didUncacheWrapper(wrapper);
+    JSDebugWrapperSet::didUncacheWrapper(wrapper);
 }
 
 void forgetDOMNode(JSNode* wrapper, Node* node, Document* document)
 {
+    node->clearWrapper(wrapper);
+
     if (!document) {
         forgetDOMObject(wrapper, node);
         return;
@@ -311,36 +201,20 @@
         if (wrappersIter->second->uncheckedRemove(node, wrapper))
             break;
     }
-    didUncacheWrapper(wrapper);
+    JSDebugWrapperSet::didUncacheWrapper(wrapper);
 }
 
 void cacheDOMNodeWrapper(JSC::ExecState* exec, Document* document, Node* node, JSNode* wrapper)
 {
-    if (!document) {
-        willCacheWrapper(wrapper);
-        DOMObjectWrapperMapFor(exec).set(node, wrapper);
-        return;
-    }
-    willCacheWrapper(wrapper);
-    document->getWrapperCache(currentWorld(exec))->set(node, wrapper);
-}
+    JSDebugWrapperSet::willCacheWrapper(wrapper);
 
-void forgetAllDOMNodesForDocument(Document* document)
-{
-    ASSERT(document);
-    JSWrapperCacheMap& wrapperCacheMap = document->wrapperCacheMap();
-    JSWrapperCacheMap::const_iterator wrappersMapEnd = wrapperCacheMap.end();
-    for (JSWrapperCacheMap::const_iterator wrappersMapIter = wrapperCacheMap.begin(); wrappersMapIter != wrappersMapEnd; ++wrappersMapIter) {
-        delete wrappersMapIter->second;
-        wrappersMapIter->first->forgetDocument(document);
-    }
-}
+    if (!document)
+        domObjectWrapperMapFor(exec).set(node, wrapper);
+    else
+        document->getWrapperCache(currentWorld(exec))->set(node, wrapper);
 
-void forgetWorldOfDOMNodesForDocument(Document* document, DOMWrapperWorld* world)
-{
-    JSWrapperCache* wrappers = document->wrapperCacheMap().take(world);
-    ASSERT(wrappers); // 'world' should only know about 'document' if 'document' knows about 'world'!
-    delete wrappers;
+    if (currentWorld(exec)->isNormal())
+        node->setWrapper(wrapper);
 }
 
 static inline bool isObservableThroughDOM(JSNode* jsNode, DOMWrapperWorld* world)
@@ -464,7 +338,7 @@
         JSWrapperCacheMap& wrapperCacheMap = document->wrapperCacheMap();
         for (JSWrapperCacheMap::iterator iter = wrapperCacheMap.begin(); iter != wrapperCacheMap.end(); ++iter) {
             if (JSNode* wrapper = iter->second->take(node)) {
-                didUncacheWrapper(wrapper);
+                JSDebugWrapperSet::didUncacheWrapper(wrapper);
                 wrapperSet.append(WrapperAndWorld(wrapper, iter->first));
             }
         }
@@ -472,7 +346,7 @@
         for (JSGlobalDataWorldIterator worldIter(JSDOMWindow::commonJSGlobalData()); worldIter; ++worldIter) {
             DOMWrapperWorld* world = *worldIter;
             if (JSNode* wrapper = static_cast<JSNode*>(world->m_wrappers.take(node))) {
-                didUncacheWrapper(wrapper);
+                JSDebugWrapperSet::didUncacheWrapper(wrapper);
                 wrapperSet.append(WrapperAndWorld(wrapper, world));
             }
         }
@@ -488,7 +362,7 @@
 
     for (unsigned i = 0; i < wrapperSet.size(); ++i) {
         JSNode* wrapper = wrapperSet[i].first;
-        willCacheWrapper(wrapper);
+        JSDebugWrapperSet::willCacheWrapper(wrapper);
         if (newDocument)
             newDocument->getWrapperCache(wrapperSet[i].second)->set(node, wrapper);
         else
@@ -556,7 +430,7 @@
     if (JSString* wrapper = stringCache.uncheckedGet(stringImpl))
         stringCache.uncheckedRemove(stringImpl, wrapper);
 
-    JSString* wrapper = jsStringWithFinalizer(exec, stringImpl->ustring(), stringWrapperDestroyed, stringImpl);
+    JSString* wrapper = jsStringWithFinalizer(exec, UString(stringImpl), stringWrapperDestroyed, stringImpl);
     stringCache.set(stringImpl, wrapper);
     // ref explicitly instead of using a RefPtr-keyed hashtable because the wrapper can
     // outlive the cache, so the stringImpl has to match the wrapper's lifetime.
@@ -618,18 +492,27 @@
     return jsString(exec, url.string());
 }
 
-UString valueToStringWithNullCheck(ExecState* exec, JSValue value)
+AtomicStringImpl* findAtomicString(const Identifier& identifier)
 {
-    if (value.isNull())
-        return UString();
-    return value.toString(exec);
+    if (identifier.isNull())
+        return 0;
+    UStringImpl* impl = identifier.ustring().rep();
+    ASSERT(impl->existingHash());
+    return AtomicString::find(impl->characters(), impl->length(), impl->existingHash());
 }
 
-UString valueToStringWithUndefinedOrNullCheck(ExecState* exec, JSValue value)
+String valueToStringWithNullCheck(ExecState* exec, JSValue value)
+{
+    if (value.isNull())
+        return String();
+    return ustringToString(value.toString(exec));
+}
+
+String valueToStringWithUndefinedOrNullCheck(ExecState* exec, JSValue value)
 {
     if (value.isUndefinedOrNull())
-        return UString();
-    return value.toString(exec);
+        return String();
+    return ustringToString(value.toString(exec));
 }
 
 JSValue jsDateOrNull(ExecState* exec, double value)
@@ -650,6 +533,9 @@
 
 void reportException(ExecState* exec, JSValue exception)
 {
+    if (exception.isObject() && asObject(exception)->exceptionType() == Terminated)
+        return;
+
     UString errorMessage = exception.toString(exec);
     JSObject* exceptionObject = exception.toObject(exec);
     int lineNumber = exceptionObject->get(exec, Identifier(exec, "line")).toInt32(exec);
@@ -657,7 +543,7 @@
     exec->clearException();
 
     if (ExceptionBase* exceptionBase = toExceptionBase(exception))
-        errorMessage = exceptionBase->message() + ": "  + exceptionBase->description();
+        errorMessage = stringToUString(exceptionBase->message() + ": "  + exceptionBase->description());
 
     ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     ASSERT(scriptExecutionContext);
@@ -667,7 +553,7 @@
     if (!scriptExecutionContext)
         return;
 
-    scriptExecutionContext->reportException(errorMessage, lineNumber, exceptionSourceURL);
+    scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL));
 }
 
 void reportCurrentException(ExecState* exec)
@@ -747,6 +633,16 @@
     return lexicalFrame && lexicalFrame->loader()->shouldAllowNavigation(frame);
 }
 
+bool allowSettingSrcToJavascriptURL(ExecState* exec, Element* element, const String& name, const String& value)
+{
+    if ((element->hasTagName(iframeTag) || element->hasTagName(frameTag)) && equalIgnoringCase(name, "src") && protocolIsJavaScript(deprecatedParseURL(value))) {
+          Document* contentDocument = static_cast<HTMLFrameElementBase*>(element)->contentDocument();
+          if (contentDocument && !checkNodeSecurity(exec, contentDocument))
+              return false;
+      }
+      return true;
+}
+
 void printErrorMessageForFrame(Frame* frame, const String& message)
 {
     if (!frame)
@@ -788,7 +684,7 @@
     return frame->loader()->completeURL(relativeURL);
 }
 
-JSValue objectToStringFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, objectProtoFuncToString);
 }
@@ -852,10 +748,4 @@
     return object;
 }
 
-bool DOMObject::defineOwnProperty(ExecState* exec, const Identifier&, PropertyDescriptor&, bool)
-{
-    throwError(exec, TypeError, "defineProperty is not supported on DOM Objects");
-    return false;
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h
index 807bf82..209be3f 100644
--- a/WebCore/bindings/js/JSDOMBinding.h
+++ b/WebCore/bindings/js/JSDOMBinding.h
@@ -23,6 +23,8 @@
 #define JSDOMBinding_h
 
 #include "JSDOMGlobalObject.h"
+#include "JSDOMWrapper.h"
+#include "DOMWrapperWorld.h"
 #include "JSSVGContextCache.h"
 #include "Document.h"
 #include <runtime/Completion.h>
@@ -52,21 +54,6 @@
     class SVGElement;
 #endif
 
-    // Base class for all objects in this binding except Window.
-    class DOMObject : public JSC::JSObject {
-    protected:
-        explicit DOMObject(NonNullPassRefPtr<JSC::Structure> structure) 
-            : JSObject(structure)
-        {
-        }
-
-        virtual bool defineOwnProperty(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, bool);
-
-#ifndef NDEBUG
-        virtual ~DOMObject();
-#endif
-    };
-
     // FIXME: This class should collapse into DOMObject once all DOMObjects are
     // updated to store a globalObject pointer.
     class DOMObjectWithGlobalPointer : public DOMObject {
@@ -133,102 +120,6 @@
         }
     };
 
-    typedef JSC::WeakGCMap<void*, DOMObject*> DOMObjectWrapperMap;
-    typedef JSC::WeakGCMap<StringImpl*, JSC::JSString*> JSStringCache; 
-
-    class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
-    public:
-        static PassRefPtr<DOMWrapperWorld> create(JSC::JSGlobalData* globalData, bool isNormal)
-        {
-            return adoptRef(new DOMWrapperWorld(globalData, isNormal));
-        }
-        ~DOMWrapperWorld();
-
-        void rememberDocument(Document* document) { documentsWithWrappers.add(document); }
-        void forgetDocument(Document* document) { documentsWithWrappers.remove(document); }
-
-        // FIXME: can we make this private?
-        DOMObjectWrapperMap m_wrappers;
-        JSStringCache m_stringCache;
-
-        bool isNormal() const { return m_isNormal; }
-
-    protected:
-        DOMWrapperWorld(JSC::JSGlobalData*, bool isNormal);
-
-    private:
-        JSC::JSGlobalData* m_globalData;
-        HashSet<Document*> documentsWithWrappers;
-        bool m_isNormal;
-    };
-
-    // Map from static HashTable instances to per-GlobalData ones.
-    class DOMObjectHashTableMap {
-    public:
-        static DOMObjectHashTableMap& mapFor(JSC::JSGlobalData&);
-
-        ~DOMObjectHashTableMap()
-        {
-            HashMap<const JSC::HashTable*, JSC::HashTable>::iterator mapEnd = m_map.end();
-            for (HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.begin(); iter != m_map.end(); ++iter)
-                iter->second.deleteTable();
-        }
-
-        const JSC::HashTable* get(const JSC::HashTable* staticTable)
-        {
-            HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable);
-            if (iter != m_map.end())
-                return &iter->second;
-            return &m_map.set(staticTable, JSC::HashTable(*staticTable)).first->second;
-        }
-
-    private:
-        HashMap<const JSC::HashTable*, JSC::HashTable> m_map;
-    };
-
-    class WebCoreJSClientData : public JSC::JSGlobalData::ClientData, public Noncopyable {
-        friend class JSGlobalDataWorldIterator;
-
-    public:
-        WebCoreJSClientData(JSC::JSGlobalData* globalData)
-            : m_normalWorld(DOMWrapperWorld::create(globalData, true))
-        {
-            m_worldSet.add(m_normalWorld.get());
-        }
-
-        virtual ~WebCoreJSClientData()
-        {
-            ASSERT(m_worldSet.contains(m_normalWorld.get()));
-            ASSERT(m_worldSet.size() == 1);
-            ASSERT(m_normalWorld->hasOneRef());
-            m_normalWorld.clear();
-            ASSERT(m_worldSet.isEmpty());
-        }
-
-        DOMWrapperWorld* normalWorld() { return m_normalWorld.get(); }
-
-        void getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
-        {
-            copyToVector(m_worldSet, worlds);
-        }
-
-        void rememberWorld(DOMWrapperWorld* world)
-        {
-            ASSERT(!m_worldSet.contains(world));
-            m_worldSet.add(world);
-        }
-        void forgetWorld(DOMWrapperWorld* world)
-        {
-            ASSERT(m_worldSet.contains(world));
-            m_worldSet.remove(world);
-        }
-
-        DOMObjectHashTableMap hashTableMap;
-    private:
-        HashSet<DOMWrapperWorld*> m_worldSet;
-        RefPtr<DOMWrapperWorld> m_normalWorld;
-    };
-
     DOMObject* getCachedDOMObjectWrapper(JSC::ExecState*, void* objectHandle);
     bool hasCachedDOMObjectWrapper(JSC::JSGlobalData*, void* objectHandle);
     void cacheDOMObjectWrapper(JSC::ExecState*, void* objectHandle, DOMObject* wrapper);
@@ -237,8 +128,6 @@
 
     JSNode* getCachedDOMNodeWrapper(JSC::ExecState*, Document*, Node*);
     void cacheDOMNodeWrapper(JSC::ExecState*, Document*, Node*, JSNode* wrapper);
-    void forgetAllDOMNodesForDocument(Document*);
-    void forgetWorldOfDOMNodesForDocument(Document*, DOMWrapperWorld*);
     void updateDOMNodeDocument(Node*, Document* oldDocument, Document* newDocument);
 
     void markDOMNodesForDocument(JSC::MarkStack&, Document*);
@@ -253,12 +142,6 @@
     JSC::Structure* getCachedDOMStructure(JSC::ExecState*, const JSC::ClassInfo*);
     JSC::Structure* cacheDOMStructure(JSC::ExecState*, NonNullPassRefPtr<JSC::Structure>, const JSC::ClassInfo*);
 
-    DOMWrapperWorld* currentWorld(JSC::ExecState*);
-    DOMWrapperWorld* normalWorld(JSC::JSGlobalData&);
-    DOMWrapperWorld* mainThreadNormalWorld();
-    inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
-    inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
-
     JSC::JSObject* getCachedDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*);
     void cacheDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*, JSC::JSObject* constructor);
 
@@ -375,8 +258,16 @@
     // object, to let the engine know that collecting the JSString wrapper is unlikely to save memory.
     JSC::JSValue jsOwnedStringOrNull(JSC::ExecState*, const JSC::UString&); 
 
-    JSC::UString valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
-    JSC::UString valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
+    String identifierToString(const JSC::Identifier&);
+    String ustringToString(const JSC::UString&);
+    JSC::UString stringToUString(const String&);
+
+    AtomicString identifierToAtomicString(const JSC::Identifier&);
+    AtomicString ustringToAtomicString(const JSC::UString&);
+    AtomicStringImpl* findAtomicString(const JSC::Identifier&);
+
+    String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
+    String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
 
     // Returns a Date instance for the specified value, or null if the value is NaN or infinity.
     JSC::JSValue jsDateOrNull(JSC::ExecState*, double);
@@ -417,18 +308,15 @@
     bool allowsAccessFromFrame(JSC::ExecState*, Frame*);
     bool allowsAccessFromFrame(JSC::ExecState*, Frame*, String& message);
     bool shouldAllowNavigation(JSC::ExecState*, Frame*);
+    bool allowSettingSrcToJavascriptURL(JSC::ExecState*, Element*, const String&, const String&);
+
     void printErrorMessageForFrame(Frame*, const String& message);
-    JSC::JSValue objectToStringFunctionGetter(JSC::ExecState*, const JSC::Identifier& propertyName, const JSC::PropertySlot&);
+    JSC::JSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier& propertyName);
 
     Frame* toLexicalFrame(JSC::ExecState*);
     Frame* toDynamicFrame(JSC::ExecState*);
     bool processingUserGesture(JSC::ExecState*);
     KURL completeURL(JSC::ExecState*, const String& relativeURL);
-
-    inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
-    {
-        return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
-    }
     
     inline JSC::JSValue jsString(JSC::ExecState* exec, const String& s)
     {
@@ -437,7 +325,7 @@
             return jsEmptyString(exec);
 
         if (stringImpl->length() == 1 && stringImpl->characters()[0] <= 0xFF)
-            return jsString(exec, stringImpl->ustring());
+            return jsString(exec, stringToUString(s));
 
         JSStringCache& stringCache = currentWorld(exec)->m_stringCache;
         if (JSC::JSString* wrapper = stringCache.get(stringImpl))
@@ -446,6 +334,36 @@
         return jsStringSlowCase(exec, stringCache, stringImpl);
     }
 
+    inline DOMObjectWrapperMap& domObjectWrapperMapFor(JSC::ExecState* exec)
+    {
+        return currentWorld(exec)->m_wrappers;
+    }
+
+    inline String ustringToString(const JSC::UString& u)
+    {
+        return u.rep();
+    }
+
+    inline JSC::UString stringToUString(const String& s)
+    {
+        return JSC::UString(s.impl());
+    }
+
+    inline String identifierToString(const JSC::Identifier& i)
+    {
+        return i.ustring().rep();
+    }
+
+    inline AtomicString ustringToAtomicString(const JSC::UString& u)
+    {
+        return AtomicString(u.rep());
+    }
+
+    inline AtomicString identifierToAtomicString(const JSC::Identifier& identifier)
+    {
+        return AtomicString(identifier.ustring().rep());
+    }
+
 } // namespace WebCore
 
 #endif // JSDOMBinding_h
diff --git a/WebCore/bindings/js/JSDOMFormDataCustom.cpp b/WebCore/bindings/js/JSDOMFormDataCustom.cpp
new file mode 100644
index 0000000..830db6b
--- /dev/null
+++ b/WebCore/bindings/js/JSDOMFormDataCustom.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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 "JSDOMFormData.h"
+
+#include "DOMFormData.h"
+#include "JSBlob.h"
+#include <runtime/Error.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDOMFormData::append(ExecState* exec, const ArgList& args)
+{
+    if (args.size() >= 2) {
+        String name = ustringToString(args.at(0).toString(exec));
+        JSValue value = args.at(1);
+        if (value.inherits(&JSBlob::s_info))
+            impl()->append(name, toBlob(value));
+        else
+            impl()->append(name, ustringToString(value.toString(exec)));
+    }
+
+    return jsUndefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSDOMWindowBase.cpp b/WebCore/bindings/js/JSDOMWindowBase.cpp
index 4338cdd..82ac1ce 100644
--- a/WebCore/bindings/js/JSDOMWindowBase.cpp
+++ b/WebCore/bindings/js/JSDOMWindowBase.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "JSDOMWindowBase.h"
 
-#include "CString.h"
 #include "Chrome.h"
 #include "Console.h"
 #include "DOMWindow.h"
@@ -36,6 +35,9 @@
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
+#include "WebCoreJSClientData.h"
+#include <wtf/Threading.h>
+#include <wtf/text/CString.h>
 
 using namespace JSC;
 
@@ -155,12 +157,12 @@
 
     static JSGlobalData* globalData = 0;
     if (!globalData) {
-        globalData = JSGlobalData::createLeaked().releaseRef();
+        globalData = JSGlobalData::createLeaked(ThreadStackTypeLarge).releaseRef();
         globalData->timeoutChecker.setTimeoutInterval(10000); // 10 seconds
 #ifndef NDEBUG
-        globalData->mainThreadOnly = true;
+        globalData->exclusiveThread = currentThread();
 #endif
-        globalData->clientData = new WebCoreJSClientData(globalData);
+        initNormalWorldClientData(globalData);
     }
 
     return globalData;
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index bbd4a51..f5f2ae2 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -21,8 +21,8 @@
 #include "JSDOMWindowCustom.h"
 
 #include "AtomicString.h"
-#include "Base64.h"
 #include "Chrome.h"
+#include "Database.h"
 #include "DOMWindow.h"
 #include "Document.h"
 #include "ExceptionCode.h"
@@ -36,6 +36,8 @@
 #include "HTMLDocument.h"
 #include "History.h"
 #include "JSAudioConstructor.h"
+#include "JSDatabase.h"
+#include "JSDatabaseCallback.h"
 #include "JSDOMWindowShell.h"
 #include "JSEvent.h"
 #include "JSEventListener.h"
@@ -124,31 +126,31 @@
 }
 
 template<NativeFunction nativeFunction, int length>
-JSValue nonCachingStaticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), length, propertyName, nativeFunction);
 }
 
-static JSValue childFrameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slot.slotBase()))->impl()->frame()->tree()->child(AtomicString(propertyName))->domWindow());
+    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->child(identifierToAtomicString(propertyName))->domWindow());
 }
 
-static JSValue indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
 {
-    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slot.slotBase()))->impl()->frame()->tree()->child(slot.index())->domWindow());
+    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->child(index)->domWindow());
 }
 
-static JSValue namedItemGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMWindowBase* thisObj = static_cast<JSDOMWindow*>(asObject(slot.slotBase()));
+    JSDOMWindowBase* thisObj = static_cast<JSDOMWindow*>(asObject(slotBase));
     Document* document = thisObj->impl()->frame()->document();
 
     ASSERT(thisObj->allowsAccessFrom(exec));
     ASSERT(document);
     ASSERT(document->isHTMLDocument());
 
-    RefPtr<HTMLCollection> collection = document->windowNamedItems(propertyName);
+    RefPtr<HTMLCollection> collection = document->windowNamedItems(identifierToString(propertyName));
     if (collection->length() == 1)
         return toJS(exec, collection->firstItem());
     return toJS(exec, collection.get());
@@ -249,7 +251,7 @@
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (impl()->frame()->tree()->child(propertyName)) {
+    if (impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) {
         slot.setCustom(this, childFrameGetter);
         return true;
     }
@@ -287,7 +289,7 @@
     // Allow shortcuts like 'Image1' instead of document.images.Image1
     Document* document = impl()->frame()->document();
     if (document->isHTMLDocument()) {
-        AtomicStringImpl* atomicPropertyName = AtomicString::find(propertyName);
+        AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
         if (atomicPropertyName && (static_cast<HTMLDocument*>(document)->hasNamedItem(atomicPropertyName) || document->hasElementWithId(atomicPropertyName))) {
             slot.setCustom(this, namedItemGetter);
             return true;
@@ -338,7 +340,7 @@
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (impl()->frame()->tree()->child(propertyName)) {
+    if (impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) {
         PropertySlot slot;
         slot.setCustom(this, childFrameGetter);
         descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
@@ -357,7 +359,7 @@
     // Allow shortcuts like 'Image1' instead of document.images.Image1
     Document* document = impl()->frame()->document();
     if (document->isHTMLDocument()) {
-        AtomicStringImpl* atomicPropertyName = AtomicString::find(propertyName);
+        AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
         if (atomicPropertyName && (static_cast<HTMLDocument*>(document)->hasNamedItem(atomicPropertyName) || document->hasElementWithId(atomicPropertyName))) {
             PropertySlot slot;
             slot.setCustom(this, namedItemGetter);
@@ -504,7 +506,7 @@
     Frame* frame = impl()->frame();
     ASSERT(frame);
 
-    KURL url = completeURL(exec, value.toString(exec));
+    KURL url = completeURL(exec, ustringToString(value.toString(exec)));
     if (url.isNull())
         return;
 
@@ -666,12 +668,6 @@
     ASSERT(lexicalFrame);
     ASSERT(dynamicFrame);
 
-    if (Document* lexicalDocument = lexicalFrame->document()) {
-        // Sandboxed iframes cannot open new auxiliary browsing contexts.
-        if (lexicalDocument->securityOrigin()->isSandboxed(SandboxNavigation))
-            return 0;
-    }
-
     ResourceRequest request;
 
     // For whatever reason, Firefox uses the dynamicGlobalObject to determine
@@ -729,7 +725,7 @@
 JSValue JSDOMWindow::open(ExecState* exec, const ArgList& args)
 {
     String urlString = valueToStringWithUndefinedOrNullCheck(exec, args.at(0));
-    AtomicString frameName = args.at(1).isUndefinedOrNull() ? "_blank" : AtomicString(args.at(1).toString(exec));
+    AtomicString frameName = args.at(1).isUndefinedOrNull() ? "_blank" : ustringToAtomicString(args.at(1).toString(exec));
     WindowFeatures windowFeatures(valueToStringWithUndefinedOrNullCheck(exec, args.at(2)));
 
     Frame* frame = impl()->frame();
@@ -938,57 +934,6 @@
     return jsNumber(exec, result);
 }
 
-JSValue JSDOMWindow::atob(ExecState* exec, const ArgList& args)
-{
-    if (args.size() < 1)
-        return throwError(exec, SyntaxError, "Not enough arguments");
-
-    JSValue v = args.at(0);
-    if (v.isNull())
-        return jsEmptyString(exec);
-
-    UString s = v.toString(exec);
-    if (!s.is8Bit()) {
-        setDOMException(exec, INVALID_CHARACTER_ERR);
-        return jsUndefined();
-    }
-
-    Vector<char> in(s.size());
-    for (unsigned i = 0; i < s.size(); ++i)
-        in[i] = static_cast<char>(s.data()[i]);
-    Vector<char> out;
-
-    if (!base64Decode(in, out))
-        return throwError(exec, GeneralError, "Cannot decode base64");
-
-    return jsString(exec, String(out.data(), out.size()));
-}
-
-JSValue JSDOMWindow::btoa(ExecState* exec, const ArgList& args)
-{
-    if (args.size() < 1)
-        return throwError(exec, SyntaxError, "Not enough arguments");
-
-    JSValue v = args.at(0);
-    if (v.isNull())
-        return jsEmptyString(exec);
-
-    UString s = v.toString(exec);
-    if (!s.is8Bit()) {
-        setDOMException(exec, INVALID_CHARACTER_ERR);
-        return jsUndefined();
-    }
-
-    Vector<char> in(s.size());
-    for (unsigned i = 0; i < s.size(); ++i)
-        in[i] = static_cast<char>(s.data()[i]);
-    Vector<char> out;
-
-    base64Encode(in, out);
-
-    return jsString(exec, String(out.data(), out.size()));
-}
-
 JSValue JSDOMWindow::addEventListener(ExecState* exec, const ArgList& args)
 {
     Frame* frame = impl()->frame();
@@ -999,7 +944,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -1013,10 +958,31 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
+#if ENABLE(DATABASE)
+JSValue JSDOMWindow::openDatabase(ExecState* exec, const ArgList& args)
+{
+    if (!allowsAccessFrom(exec) || (args.size() < 4))
+        return jsUndefined();
+    ExceptionCode ec = 0;
+    const UString& name = args.at(0).toString(exec);
+    const UString& version = args.at(1).toString(exec);
+    const UString& displayName = args.at(2).toString(exec);
+    unsigned long estimatedSize = args.at(3).toInt32(exec);
+    RefPtr<DatabaseCallback> creationCallback;
+    if ((args.size() >= 5) && args.at(4).isObject())
+        creationCallback = JSDatabaseCallback::create(asObject(args.at(4)), globalObject());
+
+    JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(ustringToString(name), ustringToString(version), ustringToString(displayName), estimatedSize, creationCallback.release(), ec)));
+
+    setDOMException(exec, ec);
+    return result;
+}
+#endif
+
 DOMWindow* toDOMWindow(JSValue value)
 {
     if (!value.isObject())
diff --git a/WebCore/bindings/js/JSDOMWrapper.cpp b/WebCore/bindings/js/JSDOMWrapper.cpp
new file mode 100644
index 0000000..3fcdcc1
--- /dev/null
+++ b/WebCore/bindings/js/JSDOMWrapper.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "JSDOMWrapper.h"
+
+#include "JSDebugWrapperSet.h"
+#include <runtime/Error.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+#ifndef NDEBUG
+
+DOMObject::~DOMObject()
+{
+    ASSERT(!JSDebugWrapperSet::shared().contains(this));
+}
+
+#endif
+
+bool DOMObject::defineOwnProperty(ExecState* exec, const Identifier&, PropertyDescriptor&, bool)
+{
+    throwError(exec, TypeError, "defineProperty is not supported on DOM Objects");
+    return false;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSDOMWrapper.h b/WebCore/bindings/js/JSDOMWrapper.h
new file mode 100644
index 0000000..00594cf
--- /dev/null
+++ b/WebCore/bindings/js/JSDOMWrapper.h
@@ -0,0 +1,46 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef JSDOMWrapper_h
+#define JSDOMWrapper_h
+
+#include <runtime/JSObject.h>
+
+namespace WebCore {
+
+// Base class for all objects in this binding except Window.
+class DOMObject : public JSC::JSObject {
+protected:
+    explicit DOMObject(NonNullPassRefPtr<JSC::Structure> structure) 
+        : JSObject(structure)
+    {
+    }
+
+    virtual bool defineOwnProperty(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, bool);
+
+#ifndef NDEBUG
+    virtual ~DOMObject();
+#endif
+};
+
+} // namespace WebCore
+
+#endif // JSDOMWrapper_h
diff --git a/WebCore/bindings/js/JSDataGridColumnListCustom.cpp b/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
index 91b3d15..9a6982a 100644
--- a/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
+++ b/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
@@ -43,9 +43,9 @@
     return impl->itemWithName(propertyName);
 }
 
-JSValue JSDataGridColumnList::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSDataGridColumnList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDataGridColumnList* thisObj = static_cast<JSDataGridColumnList*>(asObject(slot.slotBase()));
+    JSDataGridColumnList* thisObj = static_cast<JSDataGridColumnList*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyName));
 }
 
diff --git a/WebCore/bindings/js/JSDatabaseCallback.cpp b/WebCore/bindings/js/JSDatabaseCallback.cpp
new file mode 100644
index 0000000..6887c86
--- /dev/null
+++ b/WebCore/bindings/js/JSDatabaseCallback.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "JSDatabaseCallback.h"
+
+#if ENABLE(DATABASE)
+
+#include "Frame.h"
+#include "JSDatabase.h"
+#include "ScriptExecutionContext.h"
+#include <runtime/JSLock.h>
+#include <wtf/MainThread.h>
+
+namespace WebCore {
+
+using namespace JSC;
+
+JSDatabaseCallback::JSDatabaseCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
+    : m_data(new JSCallbackData(callback, globalObject))
+    , m_isolatedWorld(globalObject->world())
+{
+}
+
+JSDatabaseCallback::~JSDatabaseCallback()
+{
+    callOnMainThread(JSCallbackData::deleteData, m_data);
+#ifndef NDEBUG
+    m_data = 0;
+#endif
+}
+
+void JSDatabaseCallback::handleEvent(ScriptExecutionContext* context, Database* database)
+{
+    ASSERT(m_data);
+    ASSERT(context);
+
+    RefPtr<JSDatabaseCallback> protect(this);
+
+    JSC::JSLock lock(SilenceAssertionsOnly);
+
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS(exec, database));
+
+    bool ignored;
+    m_data->invokeCallback(args, &ignored);
+}
+
+}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSDatabaseCallback.h b/WebCore/bindings/js/JSDatabaseCallback.h
new file mode 100644
index 0000000..752a2c3
--- /dev/null
+++ b/WebCore/bindings/js/JSDatabaseCallback.h
@@ -0,0 +1,66 @@
+/*
+ * 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 JSDatabaseCallback_h
+#define JSDatabaseCallback_h
+
+#if ENABLE(DATABASE)
+
+#include "DatabaseCallback.h"
+#include "JSCallbackData.h"
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class ScriptExecutionContext;
+
+class JSDatabaseCallback : public DatabaseCallback {
+public:
+    static PassRefPtr<JSDatabaseCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+    {
+        return adoptRef(new JSDatabaseCallback(callback, globalObject));
+    }
+
+    virtual ~JSDatabaseCallback();
+
+    virtual void handleEvent(ScriptExecutionContext*, Database*);
+
+private:
+    JSDatabaseCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+    JSCallbackData* m_data;
+    RefPtr<DOMWrapperWorld> m_isolatedWorld;
+};
+
+}
+
+#endif // ENABLE(DATABASE)
+
+#endif // JSDatabaseCallback_h
diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp
index 0932cca..50f1d17 100644
--- a/WebCore/bindings/js/JSDatabaseCustom.cpp
+++ b/WebCore/bindings/js/JSDatabaseCustom.cpp
@@ -49,8 +49,8 @@
 
 JSValue JSDatabase::changeVersion(ExecState* exec, const ArgList& args)
 {
-    String oldVersion = args.at(0).toString(exec);
-    String newVersion = args.at(1).toString(exec);
+    String oldVersion = ustringToString(args.at(0).toString(exec));
+    String newVersion = ustringToString(args.at(1).toString(exec));
 
     JSObject* object;
     if (!(object = args.at(2).getObject())) {
diff --git a/WebCore/bindings/js/JSDebugWrapperSet.cpp b/WebCore/bindings/js/JSDebugWrapperSet.cpp
new file mode 100644
index 0000000..b0d6ca9
--- /dev/null
+++ b/WebCore/bindings/js/JSDebugWrapperSet.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "JSDebugWrapperSet.h"
+
+#include <wtf/StdLibExtras.h>
+
+#if ENABLE(WORKERS)
+#include <wtf/ThreadSpecific.h>
+#endif
+
+namespace WebCore {
+
+JSDebugWrapperSet& JSDebugWrapperSet::shared()
+{
+#if ENABLE(WORKERS)
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<JSDebugWrapperSet>, staticWrapperSet, ());
+    return *staticWrapperSet;
+#else
+    DEFINE_STATIC_LOCAL(JSDebugWrapperSet, staticWrapperSet, ());
+    return staticWrapperSet;
+#endif
+}
+
+JSDebugWrapperSet::JSDebugWrapperSet()
+{
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSDebugWrapperSet.h b/WebCore/bindings/js/JSDebugWrapperSet.h
new file mode 100644
index 0000000..94b6f78
--- /dev/null
+++ b/WebCore/bindings/js/JSDebugWrapperSet.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 JSDebugWrapperSet_h
+#define JSDebugWrapperSet_h
+
+#include "JSDOMWrapper.h"
+#include <wtf/HashSet.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+// For debugging, keep a set of wrappers currently cached, and check that
+// all are uncached before they are destroyed. This helps us catch bugs like:
+//     - wrappers being deleted without being removed from the cache
+//     - wrappers being cached twice
+
+class JSDebugWrapperSet : public Noncopyable {
+    friend class WTF::ThreadSpecific<JSDebugWrapperSet>;
+public:
+    static JSDebugWrapperSet& shared();
+
+    void add(DOMObject* object) { m_wrapperSet.add(object); }
+    void remove(DOMObject* object) { m_wrapperSet.remove(object); }
+    bool contains(DOMObject* object) const { return m_wrapperSet.contains(object); }
+
+    static void willCacheWrapper(DOMObject*);
+    static void didUncacheWrapper(DOMObject*);
+
+private:
+    JSDebugWrapperSet();
+
+    HashSet<DOMObject*> m_wrapperSet;
+};
+
+#ifdef NDEBUG
+
+inline void JSDebugWrapperSet::willCacheWrapper(DOMObject*)
+{
+}
+
+inline void JSDebugWrapperSet::didUncacheWrapper(DOMObject*)
+{
+}
+
+#else
+
+inline void JSDebugWrapperSet::willCacheWrapper(DOMObject* wrapper)
+{
+    ASSERT(!JSDebugWrapperSet::shared().contains(wrapper));
+    JSDebugWrapperSet::shared().add(wrapper);
+}
+
+inline void JSDebugWrapperSet::didUncacheWrapper(DOMObject* wrapper)
+{
+    if (!wrapper)
+        return;
+    ASSERT(JSDebugWrapperSet::shared().contains(wrapper));
+    JSDebugWrapperSet::shared().remove(wrapper);
+}
+
+#endif
+
+} // namespace WebCore
+
+#endif // JSDebugWrapperSet_h
diff --git a/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp b/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
index 7485c1f..f86bae5 100644
--- a/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
+++ b/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
@@ -55,7 +55,7 @@
     if (!args.at(0).isObject())
         return throwError(exec, TypeError);
 
-    PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(args.at(0).getObject(), static_cast<Document*>(context)->frame());
+    PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(args.at(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec));
 
     impl()->requestPermission(callback);
     return jsUndefined();
@@ -67,7 +67,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener)), false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -77,7 +77,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSDocumentCustom.cpp b/WebCore/bindings/js/JSDocumentCustom.cpp
index eda153e..8abd8ce 100644
--- a/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -79,7 +79,7 @@
     if (!frame)
         return;
 
-    String str = value.toString(exec);
+    String str = ustringToString(value.toString(exec));
 
     // IE and Mozilla both resolve the URL relative to the source frame,
     // not the target frame.
diff --git a/WebCore/bindings/js/JSElementCustom.cpp b/WebCore/bindings/js/JSElementCustom.cpp
index c725290..7e294bd 100644
--- a/WebCore/bindings/js/JSElementCustom.cpp
+++ b/WebCore/bindings/js/JSElementCustom.cpp
@@ -36,6 +36,7 @@
 #include "HTMLFrameElementBase.h"
 #include "HTMLNames.h"
 #include "JSAttr.h"
+#include "JSDOMBinding.h"
 #include "JSHTMLElementWrapperFactory.h"
 #include "JSNodeList.h"
 #include "NodeList.h"
@@ -63,21 +64,11 @@
         markDOMObjectWrapper(markStack, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl());
 }
 
-static inline bool allowSettingSrcToJavascriptURL(ExecState* exec, Element* element, const String& name, const String& value)
-{
-    if ((element->hasTagName(iframeTag) || element->hasTagName(frameTag)) && equalIgnoringCase(name, "src") && protocolIsJavaScript(deprecatedParseURL(value))) {
-        Document* contentDocument = static_cast<HTMLFrameElementBase*>(element)->contentDocument();
-        if (contentDocument && !checkNodeSecurity(exec, contentDocument))
-            return false;
-    }
-    return true;
-}
-
 JSValue JSElement::setAttribute(ExecState* exec, const ArgList& args)
 {
     ExceptionCode ec = 0;
-    AtomicString name = args.at(0).toString(exec);
-    AtomicString value = args.at(1).toString(exec);
+    AtomicString name = ustringToAtomicString(args.at(0).toString(exec));
+    AtomicString value = ustringToAtomicString(args.at(1).toString(exec));
 
     Element* imp = impl();
     if (!allowSettingSrcToJavascriptURL(exec, imp, name, value))
@@ -110,8 +101,8 @@
 {
     ExceptionCode ec = 0;
     AtomicString namespaceURI = valueToStringWithNullCheck(exec, args.at(0));
-    AtomicString qualifiedName = args.at(1).toString(exec);
-    AtomicString value = args.at(2).toString(exec);
+    AtomicString qualifiedName = ustringToAtomicString(args.at(1).toString(exec));
+    AtomicString value = ustringToAtomicString(args.at(2).toString(exec));
 
     Element* imp = impl();
     if (!allowSettingSrcToJavascriptURL(exec, imp, qualifiedName, value))
diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp
index 04ceec5..6686d7a 100644
--- a/WebCore/bindings/js/JSEventCustom.cpp
+++ b/WebCore/bindings/js/JSEventCustom.cpp
@@ -31,9 +31,11 @@
 
 #include "Clipboard.h"
 #include "CompositionEvent.h"
+#include "CustomEvent.h"
 #include "Event.h"
 #include "JSBeforeLoadEvent.h"
 #include "JSClipboard.h"
+#include "JSCustomEvent.h"
 #include "JSCompositionEvent.h"
 #include "JSErrorEvent.h"
 #include "JSKeyboardEvent.h"
@@ -153,6 +155,8 @@
 #endif
     else if (event->isPopStateEvent())
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event);
+    else if (event->isCustomEvent())
+        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CustomEvent, event);
     else
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, Event, event);
 
diff --git a/WebCore/bindings/js/JSEventListener.cpp b/WebCore/bindings/js/JSEventListener.cpp
index 61f21be..3853cfc 100644
--- a/WebCore/bindings/js/JSEventListener.cpp
+++ b/WebCore/bindings/js/JSEventListener.cpp
@@ -83,7 +83,7 @@
             return;
         // FIXME: Is this check needed for other contexts?
         ScriptController* script = frame->script();
-        if (!script->canExecuteScripts() || script->isPaused())
+        if (!script->canExecuteScripts(AboutToExecuteScript) || script->isPaused())
             return;
     }
 
@@ -121,7 +121,7 @@
             reportCurrentException(exec);
         else {
             if (!retval.isUndefinedOrNull() && event->storesResultAsString())
-                event->storeResult(retval.toString(exec));
+                event->storeResult(ustringToString(retval.toString(exec)));
             if (m_isAttribute) {
                 bool retvalbool;
                 if (retval.getBoolean(retvalbool) && !retvalbool)
@@ -129,53 +129,10 @@
             }
         }
 
-        if (scriptExecutionContext->isDocument())
-            Document::updateStyleForAllDocuments();
         deref();
     }
 }
 
-bool JSEventListener::reportError(ScriptExecutionContext* context, const String& message, const String& url, int lineNumber)
-{
-    JSLock lock(SilenceAssertionsOnly);
-
-    JSObject* jsFunction = this->jsFunction(context);
-    if (!jsFunction)
-        return false;
-
-    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
-    ExecState* exec = globalObject->globalExec();
-
-    CallData callData;
-    CallType callType = jsFunction->getCallData(callData);
-
-    if (callType == CallTypeNone)
-        return false;
-
-    MarkedArgumentBuffer args;
-    args.append(jsString(exec, message));
-    args.append(jsString(exec, url));
-    args.append(jsNumber(exec, lineNumber));
-
-    JSGlobalData* globalData = globalObject->globalData();
-    DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);    
-
-    JSValue thisValue = globalObject->toThisObject(exec);
-
-    globalData->timeoutChecker.start();
-    JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
-    globalData->timeoutChecker.stop();
-
-    // If an error occurs while handling the script error, it should be bubbled up.
-    if (exec->hadException()) {
-        exec->clearException();
-        return false;
-    }
-    
-    bool bubbleEvent;
-    return returnValue.getBoolean(bubbleEvent) && !bubbleEvent;
-}
-
 bool JSEventListener::virtualisAttribute() const
 {
     return m_isAttribute;
diff --git a/WebCore/bindings/js/JSEventListener.h b/WebCore/bindings/js/JSEventListener.h
index 569c192..b15c589 100644
--- a/WebCore/bindings/js/JSEventListener.h
+++ b/WebCore/bindings/js/JSEventListener.h
@@ -60,7 +60,6 @@
         virtual void markJSFunction(JSC::MarkStack&);
         virtual void invalidateJSFunction(JSC::JSObject*);
         virtual void handleEvent(ScriptExecutionContext*, Event*);
-        virtual bool reportError(ScriptExecutionContext*, const String& message, const String& url, int lineNumber);
         virtual bool virtualisAttribute() const;
 
     protected:
diff --git a/WebCore/bindings/js/JSEventSourceConstructor.cpp b/WebCore/bindings/js/JSEventSourceConstructor.cpp
index c6e4825..e48489b 100644
--- a/WebCore/bindings/js/JSEventSourceConstructor.cpp
+++ b/WebCore/bindings/js/JSEventSourceConstructor.cpp
@@ -71,7 +71,7 @@
         return throwError(exec, ReferenceError, "EventSource constructor associated document is unavailable");
 
     ExceptionCode ec = 0;
-    RefPtr<EventSource> eventSource = EventSource::create(url, context, ec);
+    RefPtr<EventSource> eventSource = EventSource::create(ustringToString(url), context, ec);
     if (ec) {
         setDOMException(exec, ec);
         return 0;
diff --git a/WebCore/bindings/js/JSEventSourceCustom.cpp b/WebCore/bindings/js/JSEventSourceCustom.cpp
index dab3285..86db431 100644
--- a/WebCore/bindings/js/JSEventSourceCustom.cpp
+++ b/WebCore/bindings/js/JSEventSourceCustom.cpp
@@ -49,7 +49,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -59,7 +59,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSGeolocationCustom.cpp b/WebCore/bindings/js/JSGeolocationCustom.cpp
index 530b89b..8bc348c 100644
--- a/WebCore/bindings/js/JSGeolocationCustom.cpp
+++ b/WebCore/bindings/js/JSGeolocationCustom.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "JSGeolocation.h"
 
+#if ENABLE(GEOLOCATION)
+
 #include "DOMWindow.h"
 #include "ExceptionCode.h"
 #include "Geolocation.h"
@@ -178,3 +180,5 @@
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
index fd1dd11..86d6fa2 100644
--- a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
@@ -43,7 +43,7 @@
 static JSValue getNamedItems(ExecState* exec, JSHTMLAllCollection* collection, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
-    collection->impl()->namedItems(propertyName, namedItems);
+    collection->impl()->namedItems(identifierToAtomicString(propertyName), namedItems);
 
     if (namedItems.isEmpty())
         return jsUndefined();
@@ -86,7 +86,7 @@
     UString string = args.at(0).toString(exec);
     unsigned index = args.at(1).toString(exec).toUInt32(&ok, false);
     if (ok) {
-        String pstr = string;
+        String pstr = ustringToString(string);
         Node* node = collection->namedItem(pstr);
         while (node) {
             if (!index)
@@ -108,13 +108,13 @@
 bool JSHTMLAllCollection::canGetItemsForName(ExecState*, HTMLAllCollection* collection, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
-    collection->namedItems(propertyName, namedItems);
+    collection->namedItems(identifierToAtomicString(propertyName), namedItems);
     return !namedItems.isEmpty();
 }
 
-JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slot.slotBase()));
+    JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slotBase));
     return getNamedItems(exec, thisObj, propertyName);
 }
 
diff --git a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
index 30892e0..40d20cf 100644
--- a/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
@@ -53,14 +53,4 @@
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLAppletElement::canGetItemsForName(ExecState*, HTMLAppletElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLAppletElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp b/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
index 80634f7..89f62f8 100644
--- a/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
@@ -78,7 +78,7 @@
         }
     }
 #endif
-    return toJS(exec, globalObject(), WTF::getPtr(canvas->getContext(contextId, attrs.get())));
+    return toJS(exec, globalObject(), WTF::getPtr(canvas->getContext(ustringToString(contextId), attrs.get())));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
index ba61922..c5eb41a 100644
--- a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
@@ -40,7 +40,7 @@
 static JSValue getNamedItems(ExecState* exec, JSHTMLCollection* collection, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
-    collection->impl()->namedItems(propertyName, namedItems);
+    collection->impl()->namedItems(identifierToAtomicString(propertyName), namedItems);
 
     if (namedItems.isEmpty())
         return jsUndefined();
@@ -83,7 +83,7 @@
     UString string = args.at(0).toString(exec);
     unsigned index = args.at(1).toString(exec).toUInt32(&ok, false);
     if (ok) {
-        String pstr = string;
+        String pstr = ustringToString(string);
         Node* node = collection->namedItem(pstr);
         while (node) {
             if (!index)
@@ -105,13 +105,13 @@
 bool JSHTMLCollection::canGetItemsForName(ExecState*, HTMLCollection* collection, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
-    collection->namedItems(propertyName, namedItems);
+    collection->namedItems(identifierToAtomicString(propertyName), namedItems);
     return !namedItems.isEmpty();
 }
 
-JSValue JSHTMLCollection::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slot.slotBase()));
+    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slotBase));
     return getNamedItems(exec, thisObj, propertyName);
 }
 
diff --git a/WebCore/bindings/js/JSHTMLDocumentCustom.cpp b/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
index 7fde002..de0e96f 100644
--- a/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
@@ -51,16 +51,16 @@
 
 bool JSHTMLDocument::canGetItemsForName(ExecState*, HTMLDocument* document, const Identifier& propertyName)
 {
-    AtomicStringImpl* atomicPropertyName = AtomicString::find(propertyName);
+    AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
     return atomicPropertyName && (document->hasNamedItem(atomicPropertyName) || document->hasExtraNamedItem(atomicPropertyName));
 }
 
-JSValue JSHTMLDocument::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(asObject(slot.slotBase()));
+    JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(asObject(slotBase));
     HTMLDocument* document = static_cast<HTMLDocument*>(thisObj->impl());
 
-    String name = propertyName;
+    String name = identifierToString(propertyName);
     RefPtr<HTMLCollection> collection = document->documentNamedItems(name);
 
     unsigned length = collection->length();
@@ -137,14 +137,14 @@
     size_t size = args.size();
 
     UString firstString = args.at(0).toString(exec);
-    SegmentedString segmentedString = String(firstString);
+    SegmentedString segmentedString = ustringToString(firstString);
     if (size != 1) {
         if (!size)
             segmentedString.clear();
         else {
             for (size_t i = 1; i < size; ++i) {
                 UString subsequentString = args.at(i).toString(exec);
-                segmentedString.append(SegmentedString(String(subsequentString)));
+                segmentedString.append(SegmentedString(ustringToString(subsequentString)));
             }
         }
     }
diff --git a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
index bce3ffb..b9f8c12 100644
--- a/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
@@ -53,14 +53,4 @@
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLEmbedElement::canGetItemsForName(ExecState*, HTMLEmbedElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLEmbedElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLFormElementCustom.cpp b/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
index c364c14..2e7522c 100644
--- a/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
@@ -40,17 +40,17 @@
 bool JSHTMLFormElement::canGetItemsForName(ExecState*, HTMLFormElement* form, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
-    form->getNamedElements(propertyName, namedItems);
+    form->getNamedElements(identifierToAtomicString(propertyName), namedItems);
     return namedItems.size();
 }
 
-JSValue JSHTMLFormElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slot.slotBase()));
+    JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slotBase));
     HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());
 
     Vector<RefPtr<Node> > namedItems;
-    form->getNamedElements(propertyName, namedItems);
+    form->getNamedElements(identifierToAtomicString(propertyName), namedItems);
     
     if (namedItems.isEmpty())
         return jsUndefined();
diff --git a/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp b/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
index 68769d6..617aaff 100644
--- a/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
@@ -43,16 +43,16 @@
 
 bool JSHTMLFrameSetElement::canGetItemsForName(ExecState*, HTMLFrameSetElement* frameSet, const Identifier& propertyName)
 {
-    Node* frame = frameSet->children()->namedItem(propertyName);
+    Node* frame = frameSet->children()->namedItem(identifierToAtomicString(propertyName));
     return frame && frame->hasTagName(frameTag);
 }
 
-JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
+    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slotBase));
     HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
 
-    Node* frame = element->children()->namedItem(propertyName);
+    Node* frame = element->children()->namedItem(identifierToAtomicString(propertyName));
     if (Document* doc = static_cast<HTMLFrameElement*>(frame)->contentDocument()) {
         if (JSDOMWindowShell* window = toJSDOMWindowShell(doc->frame(), currentWorld(exec)))
             return window;
diff --git a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
index 1bfb51f..68c9e59 100644
--- a/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
@@ -53,14 +53,4 @@
     return runtimeObjectGetCallData(impl(), callData);
 }
 
-bool JSHTMLObjectElement::canGetItemsForName(ExecState*, HTMLObjectElement*, const Identifier& propertyName)
-{
-    return propertyName == "__apple_runtime_object";
-}
-
-JSValue JSHTMLObjectElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    return runtimeObjectGetter(exec, propertyName, slot);
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSHistoryCustom.cpp b/WebCore/bindings/js/JSHistoryCustom.cpp
index fff747f..c031b30 100644
--- a/WebCore/bindings/js/JSHistoryCustom.cpp
+++ b/WebCore/bindings/js/JSHistoryCustom.cpp
@@ -38,17 +38,17 @@
 
 namespace WebCore {
 
-static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionBack);
 }
 
-static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsHistoryPrototypeFunctionForward);
 }
 
-static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsHistoryPrototypeFunctionGo);
 }
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 3db894d..8bfb8a3 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -48,6 +48,7 @@
 #include "InspectorController.h"
 #include "InspectorResource.h"
 #include "JSDOMWindow.h"
+#include "JSDOMWindowCustom.h"
 #include "JSNode.h"
 #include "JSRange.h"
 #include "Node.h"
@@ -67,17 +68,17 @@
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 #include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
 #include "JSJavaScriptCallFrame.h"
+#include "ScriptDebugServer.h"
 #endif
 
 using namespace JSC;
 
 namespace WebCore {
 
-static ScriptObject createInjectedScript(const String& source, InjectedScriptHost* injectedScriptHost, ScriptState* scriptState, long id)
+ScriptObject InjectedScriptHost::createInjectedScript(const String& source, ScriptState* scriptState, long id)
 {
-    SourceCode sourceCode = makeSource(source);
+    SourceCode sourceCode = makeSource(stringToUString(source));
     JSLock lock(SilenceAssertionsOnly);
     JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     JSValue globalThisValue = scriptState->globalThisValue();
@@ -91,9 +92,10 @@
         return ScriptObject();
 
     MarkedArgumentBuffer args;
-    args.append(toJS(scriptState, globalObject, injectedScriptHost));
+    args.append(toJS(scriptState, globalObject, this));
     args.append(globalThisValue);
     args.append(jsNumber(scriptState, id));
+    args.append(jsString(scriptState, String("JSC")));
     JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
     if (result.isObject())
         return ScriptObject(scriptState, result.getObject());
@@ -118,10 +120,9 @@
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-
 JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec, const ArgList&)
 {
-    JavaScriptCallFrame* callFrame = impl()->currentCallFrame();
+    JavaScriptCallFrame* callFrame = ScriptDebugServer::shared().currentCallFrame();
     if (!callFrame || !callFrame->isValid())
         return jsUndefined();
 
@@ -134,7 +135,6 @@
     JSObject* object = args.at(0).getObject();
     return jsBoolean(object && object->isActivationObject());
 }
-
 #endif
 
 JSValue JSInjectedScriptHost::nodeForId(ExecState* exec, const ArgList& args)
@@ -223,15 +223,23 @@
     if (injectedScript)
         return InjectedScript(ScriptObject(scriptState, injectedScript));
 
-    ASSERT(!m_injectedScriptSource.isEmpty());
-    ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, scriptState, m_nextInjectedScriptId);
-    globalObject->setInjectedScript(injectedScriptObject.jsObject());
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
-    m_nextInjectedScriptId++;
+    ASSERT(!m_injectedScriptSource.isEmpty()); 
+    pair<long, ScriptObject> injectedScriptObject = injectScript(m_injectedScriptSource, scriptState);
+    globalObject->setInjectedScript(injectedScriptObject.second.jsObject());
+    InjectedScript result(injectedScriptObject.second);
+    m_idToInjectedScript.set(injectedScriptObject.first, result);
     return result;
 }
 
+bool InjectedScriptHost::canAccessInspectedWindow(ScriptState* scriptState)
+{
+    JSLock lock(SilenceAssertionsOnly);
+    JSDOMWindow* inspectedWindow = toJSDOMWindow(scriptState->lexicalGlobalObject());
+    if (!inspectedWindow)
+        return false;
+    return inspectedWindow->allowsAccessFromNoErrorMessage(scriptState);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
index 7b06bac..d18260b 100644
--- a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -49,11 +49,39 @@
 
 namespace WebCore {
 
+JSValue JSInspectorFrontendHost::platform(ExecState* execState, const ArgList&)
+{
+#if PLATFORM(MAC)
+    DEFINE_STATIC_LOCAL(const String, platform, ("mac"));
+#elif OS(WINDOWS)
+    DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
+#elif OS(LINUX)
+    DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
+#else
+    DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
+#endif
+    return jsString(execState, platform);
+}
+
+JSValue JSInspectorFrontendHost::port(ExecState* execState, const ArgList&)
+{
+#if PLATFORM(QT)
+    DEFINE_STATIC_LOCAL(const String, port, ("qt"));
+#elif PLATFORM(GTK)
+    DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
+#elif PLATFORM(WX)
+    DEFINE_STATIC_LOCAL(const String, port, ("wx"));
+#else
+    DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
+#endif
+    return jsString(execState, port);
+}
+
 JSValue JSInspectorFrontendHost::showContextMenu(ExecState* execState, const ArgList& args)
 {
     if (args.size() < 2)
         return jsUndefined();
-
+#if ENABLE(CONTEXT_MENUS)
     Event* event = toEvent(args.at(0));
 
     JSArray* array = asArray(args.at(1));
@@ -67,11 +95,14 @@
             items.append(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String()));
         else {
             ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(execState));
-            items.append(new ContextMenuItem(ActionType, typedId, label.toString(execState)));
+            items.append(new ContextMenuItem(ActionType, typedId, ustringToString(label.toString(execState))));
         }
     }
 
     impl()->showContextMenu(event, items);
+#else
+    UNUSED_PARAM(execState);
+#endif
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp b/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
index afbdf5d..080f730 100644
--- a/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
+++ b/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
@@ -85,6 +85,12 @@
     return constructArray(exec, list);
 }
 
+JSValue JSJavaScriptCallFrame::scopeType(ExecState*, const ArgList&)
+{
+    // FIXME(37663): implement this method the way it's done in the InjectedScipt.js
+    return jsNull();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/js/JSLazyEventListener.cpp b/WebCore/bindings/js/JSLazyEventListener.cpp
index 4fbdaa6..1aad7df 100644
--- a/WebCore/bindings/js/JSLazyEventListener.cpp
+++ b/WebCore/bindings/js/JSLazyEventListener.cpp
@@ -79,7 +79,7 @@
         return 0;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->canExecuteScripts())
+    if (!scriptController->canExecuteScripts(AboutToExecuteScript))
         return 0;
 
     JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(executionContext, isolatedWorld());
@@ -93,17 +93,17 @@
             return 0;
         // FIXME: Is this check needed for non-Document contexts?
         ScriptController* script = frame->script();
-        if (!script->canExecuteScripts() || script->isPaused())
+        if (!script->canExecuteScripts(AboutToExecuteScript) || script->isPaused())
             return 0;
     }
 
     ExecState* exec = globalObject->globalExec();
 
     MarkedArgumentBuffer args;
-    args.append(jsNontrivialString(exec, m_eventParameterName));
+    args.append(jsNontrivialString(exec, stringToUString(m_eventParameterName)));
     args.append(jsString(exec, m_code));
 
-    JSObject* jsFunction = constructFunction(exec, args, Identifier(exec, m_functionName), m_sourceURL, m_lineNumber); // FIXME: is globalExec ok?
+    JSObject* jsFunction = constructFunction(exec, args, Identifier(exec, stringToUString(m_functionName)), stringToUString(m_sourceURL), m_lineNumber); // FIXME: is globalExec ok?
     if (exec->hadException()) {
         exec->clearException();
         return 0;
diff --git a/WebCore/bindings/js/JSLocationCustom.cpp b/WebCore/bindings/js/JSLocationCustom.cpp
index 8599242..e92a750 100644
--- a/WebCore/bindings/js/JSLocationCustom.cpp
+++ b/WebCore/bindings/js/JSLocationCustom.cpp
@@ -39,17 +39,17 @@
 
 namespace WebCore {
 
-static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionReplace);
 }
 
-static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 0, propertyName, jsLocationPrototypeFunctionReload);
 }
 
-static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
+static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
 {
     return new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), 1, propertyName, jsLocationPrototypeFunctionAssign);
 }
@@ -199,7 +199,7 @@
     Frame* frame = impl()->frame();
     ASSERT(frame);
 
-    KURL url = completeURL(exec, value.toString(exec));
+    KURL url = completeURL(exec, ustringToString(value.toString(exec)));
     if (url.isNull())
         return;
 
@@ -215,7 +215,7 @@
     ASSERT(frame);
 
     KURL url = frame->loader()->url();
-    if (!url.setProtocol(value.toString(exec))) {
+    if (!url.setProtocol(ustringToString(value.toString(exec)))) {
         setDOMException(exec, SYNTAX_ERR);
         return;
     }
@@ -229,7 +229,7 @@
     ASSERT(frame);
 
     KURL url = frame->loader()->url();
-    url.setHostAndPort(value.toString(exec));
+    url.setHostAndPort(ustringToString(value.toString(exec)));
 
     navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false);
 }
@@ -240,7 +240,7 @@
     ASSERT(frame);
 
     KURL url = frame->loader()->url();
-    url.setHost(value.toString(exec));
+    url.setHost(ustringToString(value.toString(exec)));
 
     navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false);
 }
@@ -268,7 +268,7 @@
     ASSERT(frame);
 
     KURL url = frame->loader()->url();
-    url.setPath(value.toString(exec));
+    url.setPath(ustringToString(value.toString(exec)));
 
     navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false);
 }
@@ -279,7 +279,7 @@
     ASSERT(frame);
 
     KURL url = frame->loader()->url();
-    url.setQuery(value.toString(exec));
+    url.setQuery(ustringToString(value.toString(exec)));
 
     navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false);
 }
@@ -291,7 +291,7 @@
 
     KURL url = frame->loader()->url();
     String oldFragmentIdentifier = url.fragmentIdentifier();
-    String str = value.toString(exec);
+    String str = ustringToString(value.toString(exec));
     if (str.startsWith("#"))
         str = str.substring(1);
     if (equalIgnoringNullity(oldFragmentIdentifier, str))
@@ -307,7 +307,7 @@
     if (!frame)
         return jsUndefined();
 
-    KURL url = completeURL(exec, args.at(0).toString(exec));
+    KURL url = completeURL(exec, ustringToString(args.at(0).toString(exec)));
     if (url.isNull())
         return jsUndefined();
 
@@ -335,7 +335,7 @@
     if (!frame)
         return jsUndefined();
 
-    KURL url = completeURL(exec, args.at(0).toString(exec));
+    KURL url = completeURL(exec, ustringToString(args.at(0).toString(exec)));
     if (url.isNull())
         return jsUndefined();
 
diff --git a/WebCore/bindings/js/JSMessageEventCustom.cpp b/WebCore/bindings/js/JSMessageEventCustom.cpp
index 2e7b2d0..fc1f542 100644
--- a/WebCore/bindings/js/JSMessageEventCustom.cpp
+++ b/WebCore/bindings/js/JSMessageEventCustom.cpp
@@ -72,7 +72,7 @@
     }
 
     MessageEvent* event = static_cast<MessageEvent*>(this->impl());
-    event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, messagePorts.release());
+    event->initMessageEvent(ustringToAtomicString(typeArg), canBubbleArg, cancelableArg, dataArg, ustringToString(originArg), ustringToString(lastEventIdArg), sourceArg, messagePorts.release());
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSMessagePortCustom.cpp b/WebCore/bindings/js/JSMessagePortCustom.cpp
index 2ee8125..f7c0160 100644
--- a/WebCore/bindings/js/JSMessagePortCustom.cpp
+++ b/WebCore/bindings/js/JSMessagePortCustom.cpp
@@ -58,7 +58,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -68,7 +68,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp b/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp
index c90dadd..bdd6ddb 100644
--- a/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp
+++ b/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp
@@ -30,13 +30,13 @@
 
 bool JSMimeTypeArray::canGetItemsForName(ExecState*, MimeTypeArray* mimeTypeArray, const Identifier& propertyName)
 {
-    return mimeTypeArray->canGetItemsForName(propertyName);
+    return mimeTypeArray->canGetItemsForName(identifierToAtomicString(propertyName));
 }
 
-JSValue JSMimeTypeArray::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSMimeTypeArray* thisObj = static_cast<JSMimeTypeArray*>(asObject(slot.slotBase()));
-    return toJS(exec, thisObj->impl()->namedItem(propertyName));
+    JSMimeTypeArray* thisObj = static_cast<JSMimeTypeArray*>(asObject(slotBase));
+    return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSNamedNodeMapCustom.cpp b/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
index d1bbeec..e1c490e 100644
--- a/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
+++ b/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
@@ -35,15 +35,47 @@
 
 namespace WebCore {
 
-bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, const Identifier& propertyName)
+JSValue JSNamedNodeMap::setNamedItem(ExecState* exec, const ArgList& args)
 {
-    return impl->getNamedItem(propertyName);
+    NamedNodeMap* imp = static_cast<NamedNodeMap*>(impl());
+    ExceptionCode ec = 0;
+    Node* newNode = toNode(args.at(0));
+
+    if (newNode && newNode->nodeType() == Node::ATTRIBUTE_NODE && imp->element()) {
+        if (!allowSettingSrcToJavascriptURL(exec, imp->element(), newNode->nodeName(), newNode->nodeValue()))
+            return jsNull();
+    }
+
+    JSValue result = toJS(exec, globalObject(), WTF::getPtr(imp->setNamedItem(newNode, ec)));
+    setDOMException(exec, ec);
+    return result;
 }
 
-JSValue JSNamedNodeMap::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSNamedNodeMap::setNamedItemNS(ExecState* exec, const ArgList& args)
 {
-    JSNamedNodeMap* thisObj = static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()));
-    return toJS(exec, thisObj->impl()->getNamedItem(propertyName));
+    NamedNodeMap* imp = static_cast<NamedNodeMap*>(impl());
+    ExceptionCode ec = 0;
+    Node* newNode = toNode(args.at(0));
+
+    if (newNode && newNode->nodeType() == Node::ATTRIBUTE_NODE && imp->element()) {
+        if (!allowSettingSrcToJavascriptURL(exec, imp->element(), newNode->nodeName(), newNode->nodeValue()))
+            return jsNull();
+    }
+
+    JSValue result = toJS(exec, globalObject(), WTF::getPtr(imp->setNamedItemNS(newNode, ec)));
+    setDOMException(exec, ec);
+    return result;
+}
+
+bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, const Identifier& propertyName)
+{
+    return impl->getNamedItem(identifierToString(propertyName));
+}
+
+JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
+{
+    JSNamedNodeMap* thisObj = static_cast<JSNamedNodeMap*>(asObject(slotBase));
+    return toJS(exec, thisObj->impl()->getNamedItem(identifierToString(propertyName)));
 }
 
 void JSNamedNodeMap::markChildren(MarkStack& markStack)
diff --git a/WebCore/bindings/js/JSNodeCustom.cpp b/WebCore/bindings/js/JSNodeCustom.cpp
index 46a30a4..3a07b29 100644
--- a/WebCore/bindings/js/JSNodeCustom.cpp
+++ b/WebCore/bindings/js/JSNodeCustom.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,10 +34,12 @@
 #include "DocumentType.h"
 #include "Entity.h"
 #include "EntityReference.h"
+#include "ExceptionCode.h"
 #include "HTMLElement.h"
 #include "JSAttr.h"
 #include "JSCDATASection.h"
 #include "JSComment.h"
+#include "JSDOMBinding.h"
 #include "JSDocument.h"
 #include "JSDocumentFragment.h"
 #include "JSDocumentType.h"
@@ -66,12 +68,53 @@
 
 namespace WebCore {
 
-typedef int ExpectionCode;
+static inline bool isAttrFrameSrc(Element *element, const String& name)
+{
+    return element && (element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag)) && equalIgnoringCase(name, "src");
+}
+
+void JSNode::setNodeValue(JSC::ExecState* exec, JSC::JSValue value)
+{
+    Node* imp = static_cast<Node*>(impl());
+    String nodeValue = valueToStringWithNullCheck(exec, value);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE) {
+        Element* ownerElement = static_cast<Attr*>(impl())->ownerElement();
+        if (ownerElement && !allowSettingSrcToJavascriptURL(exec, ownerElement, imp->nodeName(), nodeValue))
+            return;
+    }
+
+    ExceptionCode ec = 0;
+    imp->setNodeValue(nodeValue, ec);
+    setDOMException(exec, ec);
+}
+
+void JSNode::setTextContent(JSC::ExecState* exec, JSC::JSValue value)
+{
+    Node* imp = static_cast<Node*>(impl());
+    String nodeValue = valueToStringWithNullCheck(exec, value);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE) {
+        Element* ownerElement = static_cast<Attr*>(impl())->ownerElement();
+        if (ownerElement && !allowSettingSrcToJavascriptURL(exec, ownerElement, imp->nodeName(), nodeValue))
+            return;
+    }
+
+    ExceptionCode ec = 0;
+    imp->setTextContent(nodeValue, ec);
+    setDOMException(exec, ec);
+}
 
 JSValue JSNode::insertBefore(ExecState* exec, const ArgList& args)
 {
+    Node* imp = static_cast<Node*>(impl());
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isAttrFrameSrc(static_cast<Attr*>(impl())->ownerElement(), imp->nodeName())) {
+        setDOMException(exec, NOT_SUPPORTED_ERR);
+        return jsNull();
+    }
+
     ExceptionCode ec = 0;
-    bool ok = impl()->insertBefore(toNode(args.at(0)), toNode(args.at(1)), ec, true);
+    bool ok = imp->insertBefore(toNode(args.at(0)), toNode(args.at(1)), ec, true);
     setDOMException(exec, ec);
     if (ok)
         return args.at(0);
@@ -80,8 +123,14 @@
 
 JSValue JSNode::replaceChild(ExecState* exec, const ArgList& args)
 {
+    Node* imp = static_cast<Node*>(impl());
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isAttrFrameSrc(static_cast<Attr*>(impl())->ownerElement(), imp->nodeName())) {
+        setDOMException(exec, NOT_SUPPORTED_ERR);
+        return jsNull();
+    }
+
     ExceptionCode ec = 0;
-    bool ok = impl()->replaceChild(toNode(args.at(0)), toNode(args.at(1)), ec, true);
+    bool ok = imp->replaceChild(toNode(args.at(0)), toNode(args.at(1)), ec, true);
     setDOMException(exec, ec);
     if (ok)
         return args.at(1);
@@ -90,8 +139,14 @@
 
 JSValue JSNode::removeChild(ExecState* exec, const ArgList& args)
 {
+    Node* imp = static_cast<Node*>(impl());
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isAttrFrameSrc(static_cast<Attr*>(impl())->ownerElement(), imp->nodeName())) {
+        setDOMException(exec, NOT_SUPPORTED_ERR);
+        return jsNull();
+    }
+
     ExceptionCode ec = 0;
-    bool ok = impl()->removeChild(toNode(args.at(0)), ec);
+    bool ok = imp->removeChild(toNode(args.at(0)), ec);
     setDOMException(exec, ec);
     if (ok)
         return args.at(0);
@@ -100,8 +155,14 @@
 
 JSValue JSNode::appendChild(ExecState* exec, const ArgList& args)
 {
+    Node* imp = static_cast<Node*>(impl());
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isAttrFrameSrc(static_cast<Attr*>(impl())->ownerElement(), imp->nodeName())) {
+        setDOMException(exec, NOT_SUPPORTED_ERR);
+        return jsNull();
+    }
+
     ExceptionCode ec = 0;
-    bool ok = impl()->appendChild(toNode(args.at(0)), ec, true);
+    bool ok = imp->appendChild(toNode(args.at(0)), ec, true);
     setDOMException(exec, ec);
     if (ok)
         return args.at(0);
@@ -114,7 +175,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -124,7 +185,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -162,6 +223,8 @@
     // case, the root of the detached subtree has a wrapper, so the tree will only
     // get marked once. Nodes that aren't outermost need to mark the outermost
     // in case it is otherwise unreachable.
+    // FIXME: In the non-common case of root not having a wrapper, this is still an O(n^2) algorithm,
+    // as we will traverse the whole tree as many times as there are nodes with wrappers in it.
     if (node != outermostNodeWithWrapper) {
         markDOMNodeWrapper(markStack, m_impl->document(), outermostNodeWithWrapper);
         return;
@@ -172,7 +235,7 @@
         markDOMNodeWrapper(markStack, m_impl->document(), nodeToMark);
 }
 
-static ALWAYS_INLINE JSValue createWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
+static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
 {
     ASSERT(node);
     ASSERT(!getCachedDOMNodeWrapper(exec, node->document(), node));
@@ -228,25 +291,18 @@
 
     return wrapper;    
 }
+
+JSValue createWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
+{
+    return createWrapperInline(exec, globalObject, node);
+}
     
 JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
 {
     if (!node)
         return jsNull();
     
-    return createWrapper(exec, globalObject, node);
-}
-    
-JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
-{
-    if (!node)
-        return jsNull();
-
-    JSNode* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node);
-    if (wrapper)
-        return wrapper;
-
-    return createWrapper(exec, globalObject, node);
+    return createWrapperInline(exec, globalObject, node);
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSNodeCustom.h b/WebCore/bindings/js/JSNodeCustom.h
new file mode 100644
index 0000000..9d06ae6
--- /dev/null
+++ b/WebCore/bindings/js/JSNodeCustom.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2007, 2009, 2010 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 COMPUTER, 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 JSNodeCustom_h
+#define JSNodeCustom_h
+
+#include "JSDOMBinding.h"
+#include <wtf/AlwaysInline.h>
+
+namespace WebCore {
+
+inline JSNode* getCachedDOMNodeWrapper(JSC::ExecState* exec, Document* document, Node* node)
+{
+    if (currentWorld(exec)->isNormal()) {
+        ASSERT(node->wrapper() == (document ? document->getWrapperCache(currentWorld(exec))->get(node) : domObjectWrapperMapFor(exec).get(node)));
+        return static_cast<JSNode*>(node->wrapper());
+    }
+
+    if (document)
+        return document->getWrapperCache(currentWorld(exec))->get(node);
+    return static_cast<JSNode*>(domObjectWrapperMapFor(exec).get(node));
+}
+
+JSC::JSValue createWrapper(JSC::ExecState*, JSDOMGlobalObject*, Node*);
+
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
+{
+    if (!node)
+        return JSC::jsNull();
+
+    JSNode* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node);
+    if (wrapper)
+        return wrapper;
+
+    return createWrapper(exec, globalObject, node);
+}
+
+}
+
+#endif // JSDOMNodeCustom_h
diff --git a/WebCore/bindings/js/JSNodeListCustom.cpp b/WebCore/bindings/js/JSNodeListCustom.cpp
index 2821d01..d013e4f 100644
--- a/WebCore/bindings/js/JSNodeListCustom.cpp
+++ b/WebCore/bindings/js/JSNodeListCustom.cpp
@@ -53,13 +53,13 @@
 
 bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, const Identifier& propertyName)
 {
-    return impl->itemWithName(propertyName);
+    return impl->itemWithName(identifierToAtomicString(propertyName));
 }
 
-JSValue JSNodeList::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSNodeList* thisObj = static_cast<JSNodeList*>(asObject(slot.slotBase()));
-    return toJS(exec, thisObj->impl()->itemWithName(propertyName));
+    JSNodeList* thisObj = static_cast<JSNodeList*>(asObject(slotBase));
+    return toJS(exec, thisObj->impl()->itemWithName(identifierToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSOptionConstructor.cpp b/WebCore/bindings/js/JSOptionConstructor.cpp
index 995903e..8b29136 100644
--- a/WebCore/bindings/js/JSOptionConstructor.cpp
+++ b/WebCore/bindings/js/JSOptionConstructor.cpp
@@ -51,11 +51,11 @@
 
     String data;
     if (!args.at(0).isUndefined())
-        data = args.at(0).toString(exec);
+        data = ustringToString(args.at(0).toString(exec));
 
     String value;
     if (!args.at(1).isUndefined())
-        value = args.at(1).toString(exec);
+        value = ustringToString(args.at(1).toString(exec));
     bool defaultSelected = args.at(2).toBoolean(exec);
     bool selected = args.at(3).toBoolean(exec);
 
diff --git a/WebCore/bindings/js/JSPluginArrayCustom.cpp b/WebCore/bindings/js/JSPluginArrayCustom.cpp
index 81d4295..b232f4d 100644
--- a/WebCore/bindings/js/JSPluginArrayCustom.cpp
+++ b/WebCore/bindings/js/JSPluginArrayCustom.cpp
@@ -30,13 +30,13 @@
 
 bool JSPluginArray::canGetItemsForName(ExecState*, PluginArray* pluginArray, const Identifier& propertyName)
 {
-    return pluginArray->canGetItemsForName(propertyName);
+    return pluginArray->canGetItemsForName(identifierToAtomicString(propertyName));
 }
 
-JSValue JSPluginArray::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSPluginArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSPluginArray* thisObj = static_cast<JSPluginArray*>(asObject(slot.slotBase()));
-    return toJS(exec, thisObj->impl()->namedItem(propertyName));
+    JSPluginArray* thisObj = static_cast<JSPluginArray*>(asObject(slotBase));
+    return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSPluginCustom.cpp b/WebCore/bindings/js/JSPluginCustom.cpp
index 555dd9e..9fa0b76 100644
--- a/WebCore/bindings/js/JSPluginCustom.cpp
+++ b/WebCore/bindings/js/JSPluginCustom.cpp
@@ -29,13 +29,13 @@
 
 bool JSPlugin::canGetItemsForName(ExecState*, Plugin* plugin, const Identifier& propertyName)
 {
-    return plugin->canGetItemsForName(propertyName);
+    return plugin->canGetItemsForName(identifierToAtomicString(propertyName));
 }
 
-JSValue JSPlugin::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSPlugin::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSPlugin* thisObj = static_cast<JSPlugin*>(asObject(slot.slotBase()));
-    return toJS(exec, thisObj->impl()->namedItem(propertyName));
+    JSPlugin* thisObj = static_cast<JSPlugin*>(asObject(slotBase));
+    return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.cpp b/WebCore/bindings/js/JSPluginElementFunctions.cpp
index e927ef1..b20b9a7 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.cpp
+++ b/WebCore/bindings/js/JSPluginElementFunctions.cpp
@@ -35,7 +35,7 @@
 
 // Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement.
 
-static Instance* pluginInstance(Node* node)
+Instance* pluginInstance(Node* node)
 {
     if (!node)
         return 0;
@@ -49,7 +49,7 @@
     return instance;
 }
 
-static RuntimeObjectImp* getRuntimeObject(ExecState* exec, Node* node)
+static RuntimeObject* getRuntimeObject(ExecState* exec, Node* node)
 {
     Instance* instance = pluginInstance(node);
     if (!instance)
@@ -57,19 +57,11 @@
     return instance->createRuntimeObject(exec);
 }
 
-JSValue runtimeObjectGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue runtimeObjectPropertyGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
+    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slotBase));
     HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element);
-    return runtimeObject ? runtimeObject : jsUndefined();
-}
-
-JSValue runtimeObjectPropertyGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
-{
-    JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
-    HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element);
+    RuntimeObject* runtimeObject = getRuntimeObject(exec, element);
     if (!runtimeObject)
         return jsUndefined();
     return runtimeObject->get(exec, propertyName);
@@ -77,7 +69,7 @@
 
 bool runtimeObjectCustomGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, JSHTMLElement* element)
 {
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element->impl());
+    RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl());
     if (!runtimeObject)
         return false;
     if (!runtimeObject->hasProperty(exec, propertyName))
@@ -88,7 +80,7 @@
 
 bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, JSHTMLElement* element)
 {
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element->impl());
+    RuntimeObject* runtimeObject = getRuntimeObject(exec, element->impl());
     if (!runtimeObject)
         return false;
     if (!runtimeObject->hasProperty(exec, propertyName))
@@ -104,7 +96,7 @@
 
 bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSValue value, HTMLElement* element, PutPropertySlot& slot)
 {
-    RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element);
+    RuntimeObject* runtimeObject = getRuntimeObject(exec, element);
     if (!runtimeObject)
         return 0;
     if (!runtimeObject->hasProperty(exec, propertyName))
diff --git a/WebCore/bindings/js/JSPluginElementFunctions.h b/WebCore/bindings/js/JSPluginElementFunctions.h
index a5a323a..736ace9 100644
--- a/WebCore/bindings/js/JSPluginElementFunctions.h
+++ b/WebCore/bindings/js/JSPluginElementFunctions.h
@@ -22,6 +22,12 @@
 
 #include "JSDOMBinding.h"
 
+namespace JSC {
+namespace Bindings {
+class Instance;
+}
+}
+
 namespace WebCore {
 
     class HTMLElement;
@@ -29,9 +35,9 @@
     class Node;
 
     // Runtime object support code for JSHTMLAppletElement, JSHTMLEmbedElement and JSHTMLObjectElement.
+    JSC::Bindings::Instance* pluginInstance(Node*);
 
-    JSC::JSValue runtimeObjectGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
-    JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
+    JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
     bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&, JSHTMLElement*);
     bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&, JSHTMLElement*);
     bool runtimeObjectCustomPut(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, HTMLElement*, JSC::PutPropertySlot&);
diff --git a/WebCore/bindings/js/JSPopStateEventCustom.cpp b/WebCore/bindings/js/JSPopStateEventCustom.cpp
index 3f5fd7e..ce430ab 100644
--- a/WebCore/bindings/js/JSPopStateEventCustom.cpp
+++ b/WebCore/bindings/js/JSPopStateEventCustom.cpp
@@ -41,7 +41,7 @@
     RefPtr<SerializedScriptValue> stateObjectArg = SerializedScriptValue::create(exec, args.at(3));
     
     PopStateEvent* event = static_cast<PopStateEvent*>(impl());
-    event->initPopStateEvent(typeArg, canBubbleArg, cancelableArg, stateObjectArg.release());
+    event->initPopStateEvent(ustringToAtomicString(typeArg), canBubbleArg, cancelableArg, stateObjectArg.release());
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index f40956e..0039a05 100644
--- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -74,7 +74,7 @@
               ASSERT_NOT_REACHED();
         }
 
-        object->putDirect(Identifier(exec, m_impl->columnNames()[i]), jsValue, DontDelete | ReadOnly);
+        object->putDirect(Identifier(exec, stringToUString(m_impl->columnNames()[i])), jsValue, DontDelete | ReadOnly);
     }
 
     return object;
diff --git a/WebCore/bindings/js/JSSQLTransactionCustom.cpp b/WebCore/bindings/js/JSSQLTransactionCustom.cpp
index e022401..81e6c63 100644
--- a/WebCore/bindings/js/JSSQLTransactionCustom.cpp
+++ b/WebCore/bindings/js/JSSQLTransactionCustom.cpp
@@ -49,7 +49,7 @@
         return jsUndefined();
     }
 
-    String sqlStatement = args.at(0).toString(exec);
+    String sqlStatement = ustringToString(args.at(0).toString(exec));
     if (exec->hadException())
         return jsUndefined();
 
@@ -80,7 +80,7 @@
                 sqlValues.append(value.uncheckedGetNumber());
             else {
                 // Convert the argument to a string and append it
-                sqlValues.append(value.toString(exec));
+                sqlValues.append(ustringToString(value.toString(exec)));
                 if (exec->hadException())
                     return jsUndefined();
             }
diff --git a/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp b/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
index b3bded5..fdcab06 100644
--- a/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
+++ b/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
@@ -52,7 +52,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -62,7 +62,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
new file mode 100644
index 0000000..127227e
--- /dev/null
+++ b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * 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:
+ * 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 COMPUTER, 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 "JSScriptProfileNode.h"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include <profiler/ProfileNode.h>
+#endif
+
+#include <runtime/JSArray.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+JSValue JSScriptProfileNode::callUID(ExecState* exec) const
+{
+    JSValue result = jsNumber(exec, impl()->callIdentifier().hash());
+    return result;
+}
+
+typedef Vector<RefPtr<ProfileNode> > ProfileNodesList;
+
+JSValue JSScriptProfileNode::children(ExecState* exec) const
+{
+    const ProfileNodesList& children = impl()->children();
+    MarkedArgumentBuffer list;
+
+    ProfileNodesList::const_iterator end = children.end();
+    for (ProfileNodesList::const_iterator iter = children.begin(); iter != end; ++iter)
+        list.append(toJS(exec, iter->get()));
+
+    return constructArray(exec, list);
+}
+
+#endif
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSSharedWorkerConstructor.cpp b/WebCore/bindings/js/JSSharedWorkerConstructor.cpp
index c05b3d2..a66b1f7 100644
--- a/WebCore/bindings/js/JSSharedWorkerConstructor.cpp
+++ b/WebCore/bindings/js/JSSharedWorkerConstructor.cpp
@@ -71,7 +71,7 @@
     // FIXME: We need to use both the dynamic scope and the lexical scope (dynamic scope for resolving the worker URL)
     DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
     ExceptionCode ec = 0;
-    RefPtr<SharedWorker> worker = SharedWorker::create(scriptURL, name, window->document(), ec);
+    RefPtr<SharedWorker> worker = SharedWorker::create(ustringToString(scriptURL), ustringToString(name), window->document(), ec);
     setDOMException(exec, ec);
 
     return asObject(toJS(exec, jsConstructor->globalObject(), worker.release()));
diff --git a/WebCore/bindings/js/JSStorageCustom.cpp b/WebCore/bindings/js/JSStorageCustom.cpp
index 3cfe22e..6a126b7 100644
--- a/WebCore/bindings/js/JSStorageCustom.cpp
+++ b/WebCore/bindings/js/JSStorageCustom.cpp
@@ -38,13 +38,13 @@
 
 bool JSStorage::canGetItemsForName(ExecState*, Storage* impl, const Identifier& propertyName)
 {
-    return impl->contains(propertyName);
+    return impl->contains(identifierToString(propertyName));
 }
 
-JSValue JSStorage::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSStorage* thisObj = static_cast<JSStorage*>(asObject(slot.slotBase()));
-    return jsStringOrNull(exec, thisObj->impl()->getItem(propertyName));
+    JSStorage* thisObj = static_cast<JSStorage*>(asObject(slotBase));
+    return jsStringOrNull(exec, thisObj->impl()->getItem(identifierToString(propertyName)));
 }
 
 bool JSStorage::deleteProperty(ExecState* exec, const Identifier& propertyName)
@@ -60,7 +60,7 @@
     if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
         return false;
 
-    m_impl->removeItem(propertyName);
+    m_impl->removeItem(identifierToString(propertyName));
     return true;
 }
 
@@ -68,7 +68,7 @@
 {
     unsigned length = m_impl->length();
     for (unsigned i = 0; i < length; ++i)
-        propertyNames.add(Identifier(exec, m_impl->key(i)));
+        propertyNames.add(Identifier(exec, stringToUString(m_impl->key(i))));
         
     Base::getOwnPropertyNames(exec, propertyNames, mode);
 }
@@ -86,12 +86,12 @@
     if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
         return false;
     
-    String stringValue = value.toString(exec);
+    String stringValue = ustringToString(value.toString(exec));
     if (exec->hadException())
         return true;
     
     ExceptionCode ec = 0;
-    impl()->setItem(propertyName, stringValue, ec);
+    impl()->setItem(identifierToString(propertyName), stringValue, ec);
     setDOMException(exec, ec);
 
     return true;
diff --git a/WebCore/bindings/js/JSStyleSheetListCustom.cpp b/WebCore/bindings/js/JSStyleSheetListCustom.cpp
index 7bf9389..eb96a67 100644
--- a/WebCore/bindings/js/JSStyleSheetListCustom.cpp
+++ b/WebCore/bindings/js/JSStyleSheetListCustom.cpp
@@ -49,13 +49,13 @@
 
 bool JSStyleSheetList::canGetItemsForName(ExecState*, StyleSheetList* styleSheetList, const Identifier& propertyName)
 {
-    return styleSheetList->getNamedItem(propertyName);
+    return styleSheetList->getNamedItem(identifierToString(propertyName));
 }
 
-JSValue JSStyleSheetList::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue JSStyleSheetList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(asObject(slot.slotBase()));
-    HTMLStyleElement* element = thisObj->impl()->getNamedItem(propertyName);
+    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(asObject(slotBase));
+    HTMLStyleElement* element = thisObj->impl()->getNamedItem(identifierToString(propertyName));
     ASSERT(element);
     return toJS(exec, element->sheet());
 }
diff --git a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
index 9742db7..8671908 100644
--- a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
@@ -30,7 +30,6 @@
 #include "JSWebGLArrayBufferConstructor.h"
 
 #include "Document.h"
-#include "WebGLArrayBuffer.h"
 #include "JSWebGLArrayBuffer.h"
 
 namespace WebCore {
@@ -56,7 +55,12 @@
         if (isnan(size))
             size = 0;
     }
-    return asObject(toJS(exec, jsConstructor->globalObject(), WebGLArrayBuffer::create(size)));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(size, 1);
+    if (!buffer.get()){
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
+    return asObject(toJS(exec, jsConstructor->globalObject(), buffer.get()));
 }
 
 JSC::ConstructType JSWebGLArrayBufferConstructor::getConstructData(JSC::ConstructData& constructData)
diff --git a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.h b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.h
index 98e364b..c7a927e 100644
--- a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.h
+++ b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.h
@@ -30,6 +30,7 @@
 #include "JSDocument.h"
 #include "JSWebGLArrayBuffer.h"
 #include <runtime/Error.h>
+#include "WebGLArrayBuffer.h"
 
 namespace WebCore {
 
@@ -51,24 +52,30 @@
         if (args.size() < 1)
             return C::create(0, 0, 0);
         
+        if (args.size() > 1 && !args.at(0).isObject())
+            // Invalid first argument
+            return 0;
+
         if (args.at(0).isObject()) {
             RefPtr<WebGLArrayBuffer> buffer = toWebGLArrayBuffer(args.at(0));
             if (buffer) {
-                int offset = (args.size() > 1) ? args.at(1).toInt32(exec) : 0;
-                unsigned int length = (args.size() > 2) ? static_cast<unsigned int>(args.at(2).toInt32(exec)) : 0;
+                unsigned offset = (args.size() > 1) ? args.at(1).toUInt32(exec) : 0;
+                unsigned int length = (buffer->byteLength() - offset) / sizeof(T);
+                if (args.size() > 2)
+                    length = args.at(2).toUInt32(exec);
                 return C::create(buffer, offset, length);
             }
             
             JSC::JSObject* array = asObject(args.at(0));
-            int length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
+            unsigned length = array->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
             void* tempValues;
-            if (!tryFastMalloc(length * sizeof(T)).getValue(tempValues)) {
+            if (!tryFastCalloc(length, sizeof(T)).getValue(tempValues)) {
                 throwError(exec, JSC::GeneralError);
                 return 0;
             }
             
             OwnFastMallocPtr<T> values(static_cast<T*>(tempValues));
-            for (int i = 0; i < length; ++i) {
+            for (unsigned i = 0; i < length; ++i) {
                 JSC::JSValue v = array->get(exec, i);
                 if (exec->hadException())
                     return 0;
@@ -78,7 +85,7 @@
             return C::create(values.get(), length);
         }
         
-        unsigned size = static_cast<unsigned>(args.at(0).toInt32(exec));
+        unsigned size = args.at(0).toUInt32(exec);
         return C::create(size);
     }
 
diff --git a/WebCore/bindings/js/JSWebGLArrayCustom.cpp b/WebCore/bindings/js/JSWebGLArrayCustom.cpp
index 9018544..d111d4e 100644
--- a/WebCore/bindings/js/JSWebGLArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLArrayCustom.cpp
@@ -67,6 +67,27 @@
     return jsUndefined();
 }
 
+JSValue JSWebGLArray::slice(ExecState* exec, const ArgList& args)
+{
+    WebGLArray* array = reinterpret_cast<WebGLArray*>(impl());
+
+    int start, end;
+    switch (args.size()) {
+    case 0:
+        start = 0;
+        end = array->length();
+        break;
+    case 1:
+        start = args.at(0).toInt32(exec);
+        end = array->length();
+        break;
+    default:
+        start = args.at(0).toInt32(exec);
+        end = args.at(1).toInt32(exec);
+    }
+    return toJS(exec, globalObject(), array->slice(start, end));
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSWebGLArrayHelper.h b/WebCore/bindings/js/JSWebGLArrayHelper.h
index 3326d76..481c68f 100644
--- a/WebCore/bindings/js/JSWebGLArrayHelper.h
+++ b/WebCore/bindings/js/JSWebGLArrayHelper.h
@@ -43,14 +43,16 @@
     if (args.at(0).isObject()) {
         // void set(in sequence<long> array, [Optional] in unsigned long offset);
         JSC::JSObject* array = JSC::asObject(args.at(0));
-        unsigned offset = 0;
+        uint32_t offset = 0;
         if (args.size() == 2)
             offset = args.at(1).toInt32(exec);
-        int length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
-        if (offset + length > webGLArray->length())
+        uint32_t length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
+        if (offset > webGLArray->length() ||
+            offset + length > webGLArray->length() ||
+            offset + length < offset)
             setDOMException(exec, INDEX_SIZE_ERR);
         else {
-            for (int i = 0; i < length; i++) {
+            for (uint32_t i = 0; i < length; i++) {
                 JSC::JSValue v = array->get(exec, i);
                 if (exec->hadException())
                     return JSC::jsUndefined();
diff --git a/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
index 7db710f..f76fb1d 100644
--- a/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLByteArrayConstructor.cpp
@@ -53,6 +53,10 @@
 {
     JSWebGLByteArrayConstructor* jsConstructor = static_cast<JSWebGLByteArrayConstructor*>(constructor);
     RefPtr<WebGLByteArray> array = static_cast<WebGLByteArray*>(construct<WebGLByteArray, signed char>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLFloatArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLFloatArrayConstructor.cpp
index 707fe56..e6375ac 100644
--- a/WebCore/bindings/js/JSWebGLFloatArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLFloatArrayConstructor.cpp
@@ -53,6 +53,10 @@
 {
     JSWebGLFloatArrayConstructor* jsConstructor = static_cast<JSWebGLFloatArrayConstructor*>(constructor);
     RefPtr<WebGLFloatArray> array = static_cast<WebGLFloatArray*>(construct<WebGLFloatArray, float>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLIntArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLIntArrayConstructor.cpp
index f2a0922..5b14803 100644
--- a/WebCore/bindings/js/JSWebGLIntArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLIntArrayConstructor.cpp
@@ -53,6 +53,10 @@
 {
     JSWebGLIntArrayConstructor* jsConstructor = static_cast<JSWebGLIntArrayConstructor*>(constructor);
     RefPtr<WebGLIntArray> array = static_cast<WebGLIntArray*>(construct<WebGLIntArray, int>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLShortArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLShortArrayConstructor.cpp
index 74bfe5c..a33779b 100644
--- a/WebCore/bindings/js/JSWebGLShortArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLShortArrayConstructor.cpp
@@ -54,6 +54,10 @@
 {
     JSWebGLShortArrayConstructor* jsConstructor = static_cast<JSWebGLShortArrayConstructor*>(constructor);
     RefPtr<WebGLShortArray> array = static_cast<WebGLShortArray*>(construct<WebGLShortArray, short>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
index d5597ce..dcb940e 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedByteArrayConstructor.cpp
@@ -30,6 +30,7 @@
 #include "JSWebGLUnsignedByteArrayConstructor.h"
 
 #include "Document.h"
+#include "ExceptionCode.h"
 #include "WebGLUnsignedByteArray.h"
 #include "JSWebGLArrayBuffer.h"
 #include "JSWebGLArrayBufferConstructor.h"
@@ -53,6 +54,10 @@
 {
     JSWebGLUnsignedByteArrayConstructor* jsConstructor = static_cast<JSWebGLUnsignedByteArrayConstructor*>(constructor);
     RefPtr<WebGLUnsignedByteArray> array = static_cast<WebGLUnsignedByteArray*>(construct<WebGLUnsignedByteArray, unsigned char>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp
index 6fafa81..23fccce 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedIntArrayConstructor.cpp
@@ -53,6 +53,10 @@
 {
     JSWebGLUnsignedIntArrayConstructor* jsConstructor = static_cast<JSWebGLUnsignedIntArrayConstructor*>(constructor);
     RefPtr<WebGLUnsignedIntArray> array = static_cast<WebGLUnsignedIntArray*>(construct<WebGLUnsignedIntArray, unsigned int>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp b/WebCore/bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp
index deaeffd..d8c2cfb 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedShortArrayConstructor.cpp
@@ -53,6 +53,10 @@
 {
     JSWebGLUnsignedShortArrayConstructor* jsConstructor = static_cast<JSWebGLUnsignedShortArrayConstructor*>(constructor);
     RefPtr<WebGLUnsignedShortArray> array = static_cast<WebGLUnsignedShortArray*>(construct<WebGLUnsignedShortArray, unsigned short>(exec, args).get());
+    if (!array.get()) {
+        setDOMException(exec, INDEX_SIZE_ERR);
+        return 0;
+    }
     return asObject(toJS(exec, jsConstructor->globalObject(), array.get()));
 }
 
diff --git a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp b/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp
index bc05250..baf174e 100644
--- a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp
+++ b/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp
@@ -47,7 +47,7 @@
     JSWebKitCSSMatrixConstructor* jsConstructor = static_cast<JSWebKitCSSMatrixConstructor*>(constructor);
     String s;
     if (args.size() >= 1)
-        s = args.at(0).toString(exec);
+        s = ustringToString(args.at(0).toString(exec));
     
     ExceptionCode ec = 0;
     RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(s, ec);
diff --git a/WebCore/bindings/js/JSWebSocketConstructor.cpp b/WebCore/bindings/js/JSWebSocketConstructor.cpp
index 5b34765..57b7477 100644
--- a/WebCore/bindings/js/JSWebSocketConstructor.cpp
+++ b/WebCore/bindings/js/JSWebSocketConstructor.cpp
@@ -64,7 +64,7 @@
     if (args.size() == 0)
         return throwError(exec, SyntaxError, "Not enough arguments");
 
-    const String& urlString = args.at(0).toString(exec);
+    const String& urlString = ustringToString(args.at(0).toString(exec));
     if (exec->hadException())
         return throwError(exec, SyntaxError, "wrong URL");
     const KURL& url = context->completeURL(urlString);
@@ -73,7 +73,7 @@
     if (args.size() < 2)
         webSocket->connect(url, ec);
     else {
-        const String& protocol = args.at(1).toString(exec);
+        const String& protocol = ustringToString(args.at(1).toString(exec));
         if (exec->hadException())
             return 0;
         webSocket->connect(url, protocol, ec);
diff --git a/WebCore/bindings/js/JSWebSocketCustom.cpp b/WebCore/bindings/js/JSWebSocketCustom.cpp
index d610f01..18f4183 100644
--- a/WebCore/bindings/js/JSWebSocketCustom.cpp
+++ b/WebCore/bindings/js/JSWebSocketCustom.cpp
@@ -50,7 +50,7 @@
     if (args.size() < 1)
         return throwError(exec, SyntaxError, "Not enough arguments");
 
-    const String& msg = args.at(0).toString(exec);
+    const String& msg = ustringToString(args.at(0).toString(exec));
     if (exec->hadException())
         return throwError(exec, SyntaxError, "bad message data.");
     ExceptionCode ec = 0;
@@ -65,7 +65,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -75,7 +75,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSWorkerConstructor.cpp b/WebCore/bindings/js/JSWorkerConstructor.cpp
index 69c05e7..43c685e 100644
--- a/WebCore/bindings/js/JSWorkerConstructor.cpp
+++ b/WebCore/bindings/js/JSWorkerConstructor.cpp
@@ -64,7 +64,7 @@
     DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
 
     ExceptionCode ec = 0;
-    RefPtr<Worker> worker = Worker::create(scriptURL, window->document(), ec);
+    RefPtr<Worker> worker = Worker::create(ustringToString(scriptURL), window->document(), ec);
     if (ec) {
         setDOMException(exec, ec);
         return 0;
diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp
index bf9409c..0a9489b 100644
--- a/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -105,18 +105,13 @@
 
     Vector<String> urls;
     for (unsigned i = 0; i < args.size(); i++) {
-        urls.append(args.at(i).toString(exec));
+        urls.append(ustringToString(args.at(i).toString(exec)));
         if (exec->hadException())
             return jsUndefined();
     }
     ExceptionCode ec = 0;
-    int signedLineNumber;
-    intptr_t sourceID;
-    UString sourceURL;
-    JSValue function;
-    exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, sourceURL, function);
 
-    impl()->importScripts(urls, sourceURL, signedLineNumber >= 0 ? signedLineNumber : 0, ec);
+    impl()->importScripts(urls, ec);
     setDOMException(exec, ec);
     return jsUndefined();
 }
@@ -127,7 +122,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -137,7 +132,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
new file mode 100644
index 0000000..ad3f5ec
--- /dev/null
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
@@ -0,0 +1,116 @@
+/*
+ * 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(WORKERS)
+
+#include "JSWorkerContextErrorHandler.h"
+
+#include "ErrorEvent.h"
+#include "Event.h"
+#include "JSEvent.h"
+#include <runtime/JSLock.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSWorkerContextErrorHandler::JSWorkerContextErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    : JSEventListener(function, wrapper, isAttribute, isolatedWorld)
+{
+}
+
+JSWorkerContextErrorHandler::~JSWorkerContextErrorHandler()
+{
+}
+
+void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
+{
+    ASSERT(scriptExecutionContext);
+    if (!scriptExecutionContext)
+        return;
+
+    JSLock lock(SilenceAssertionsOnly);
+
+    JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
+    if (!jsFunction)
+        return;
+
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
+    if (!globalObject)
+        return;
+
+    ExecState* exec = globalObject->globalExec();
+
+    CallData callData;
+    CallType callType = jsFunction->getCallData(callData);
+
+    if (callType != CallTypeNone) {
+
+        ref();
+
+        Event* savedEvent = globalObject->currentEvent();
+        globalObject->setCurrentEvent(event);
+
+        ASSERT(event->isErrorEvent());
+        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
+
+        MarkedArgumentBuffer args;
+        args.append(jsString(exec, errorEvent->message()));
+        args.append(jsString(exec, errorEvent->filename()));
+        args.append(jsNumber(exec, errorEvent->lineno()));
+
+        JSGlobalData* globalData = globalObject->globalData();
+        DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);    
+
+        JSValue thisValue = globalObject->toThisObject(exec);
+
+        globalData->timeoutChecker.start();
+        JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
+        globalData->timeoutChecker.stop();
+
+        globalObject->setCurrentEvent(savedEvent);
+
+        if (exec->hadException())
+            reportCurrentException(exec);
+        else {
+            bool retvalbool;
+            if (returnValue.getBoolean(retvalbool) && !retvalbool)
+                event->preventDefault();
+        }
+
+        deref();
+    }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.h b/WebCore/bindings/js/JSWorkerContextErrorHandler.h
new file mode 100644
index 0000000..a188299
--- /dev/null
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.h
@@ -0,0 +1,64 @@
+/*
+ * 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 JSWorkerContextErrorHandler_h
+#define JSWorkerContextErrorHandler_h
+
+#include "JSEventListener.h"
+
+namespace WebCore {
+
+class JSWorkerContextErrorHandler : public JSEventListener {
+public:
+    static PassRefPtr<JSWorkerContextErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    {
+        return adoptRef(new JSWorkerContextErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
+    }
+
+    virtual ~JSWorkerContextErrorHandler();
+
+private:
+    JSWorkerContextErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
+    virtual void handleEvent(ScriptExecutionContext*, Event*);
+};
+
+// Creates a JS EventListener for "onerror" event handler in worker context. It has custom implementation because
+// unlike other event listeners it accepts three parameters.
+inline PassRefPtr<JSWorkerContextErrorHandler> createJSWorkerContextErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
+{
+    if (!listener.isObject())
+        return 0;
+
+    return JSWorkerContextErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
+}
+
+} // namespace WebCore
+
+#endif // JSWorkerContextErrorHandler_h
diff --git a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
index e20b6d9..da83801 100644
--- a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
@@ -30,6 +30,7 @@
 #include "JSXMLHttpRequest.h"
 
 #include "Blob.h"
+#include "DOMFormData.h"
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Event.h"
@@ -37,6 +38,7 @@
 #include "FrameLoader.h"
 #include "HTMLDocument.h"
 #include "JSBlob.h"
+#include "JSDOMFormData.h"
 #include "JSDOMWindowCustom.h"
 #include "JSDocument.h"
 #include "JSEvent.h"
@@ -65,23 +67,25 @@
     if (args.size() < 2)
         return throwError(exec, SyntaxError, "Not enough arguments");
 
-    const KURL& url = impl()->scriptExecutionContext()->completeURL(args.at(1).toString(exec));
-    String method = args.at(0).toString(exec);
-    bool async = true;
-    if (args.size() >= 3)
-        async = args.at(2).toBoolean(exec);
+    const KURL& url = impl()->scriptExecutionContext()->completeURL(ustringToString(args.at(1).toString(exec)));
+    String method = ustringToString(args.at(0).toString(exec));
 
     ExceptionCode ec = 0;
-    if (args.size() >= 4 && !args.at(3).isUndefined()) {
-        String user = valueToStringWithNullCheck(exec, args.at(3));
+    if (args.size() >= 3) {
+        bool async = args.at(2).toBoolean(exec);
 
-        if (args.size() >= 5 && !args.at(4).isUndefined()) {
-            String password = valueToStringWithNullCheck(exec, args.at(4));
-            impl()->open(method, url, async, user, password, ec);
+        if (args.size() >= 4 && !args.at(3).isUndefined()) {
+            String user = valueToStringWithNullCheck(exec, args.at(3));
+            
+            if (args.size() >= 5 && !args.at(4).isUndefined()) {
+                String password = valueToStringWithNullCheck(exec, args.at(4));
+                impl()->open(method, url, async, user, password, ec);
+            } else
+                impl()->open(method, url, async, user, ec);
         } else
-            impl()->open(method, url, async, user, ec);
+            impl()->open(method, url, async, ec);
     } else
-        impl()->open(method, url, async, ec);
+        impl()->open(method, url, ec);
 
     setDOMException(exec, ec);
     return jsUndefined();
@@ -93,7 +97,7 @@
         return throwError(exec, SyntaxError, "Not enough arguments");
 
     ExceptionCode ec = 0;
-    impl()->setRequestHeader(args.at(0).toString(exec), args.at(1).toString(exec), ec);
+    impl()->setRequestHeader(ustringToAtomicString(args.at(0).toString(exec)), ustringToString(args.at(1).toString(exec)), ec);
     setDOMException(exec, ec);
     return jsUndefined();
 }
@@ -111,8 +115,10 @@
             impl()->send(toDocument(val), ec);
         else if (val.inherits(&JSBlob::s_info))
             impl()->send(toBlob(val), ec);
+        else if (val.inherits(&JSDOMFormData::s_info))
+            impl()->send(toDOMFormData(val), ec);
         else
-            impl()->send(val.toString(exec), ec);
+            impl()->send(ustringToString(val.toString(exec)), ec);
     }
 
     int signedLineNumber;
@@ -121,7 +127,7 @@
     JSValue function;
     exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, sourceURL, function);
     impl()->setLastSendLineNumber(signedLineNumber >= 0 ? signedLineNumber : 0);
-    impl()->setLastSendURL(sourceURL);
+    impl()->setLastSendURL(ustringToString(sourceURL));
 
     setDOMException(exec, ec);
     return jsUndefined();
@@ -133,7 +139,7 @@
         return throwError(exec, SyntaxError, "Not enough arguments");
 
     ExceptionCode ec = 0;
-    JSValue header = jsStringOrNull(exec, impl()->getResponseHeader(args.at(0).toString(exec), ec));
+    JSValue header = jsStringOrNull(exec, impl()->getResponseHeader(ustringToAtomicString(args.at(0).toString(exec)), ec));
     setDOMException(exec, ec);
     return header;
 }
@@ -143,7 +149,7 @@
     if (args.size() < 1)
         return throwError(exec, SyntaxError, "Not enough arguments");
 
-    impl()->overrideMimeType(args.at(0).toString(exec));
+    impl()->overrideMimeType(ustringToString(args.at(0).toString(exec)));
     return jsUndefined();
 }
 
@@ -153,7 +159,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -163,7 +169,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp b/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
index 857c12d..42d4eb9 100644
--- a/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
+++ b/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
@@ -57,7 +57,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -67,7 +67,7 @@
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
index 441bbc9..49ac234 100644
--- a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
+++ b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
@@ -89,9 +89,9 @@
 {
     if (args.at(1).isUndefinedOrNull() || args.at(2).isUndefinedOrNull())
         return jsUndefined(); // Throw exception?
-    String namespaceURI = args.at(0).toString(exec);
-    String localName = args.at(1).toString(exec);
-    String value = args.at(2).toString(exec);
+    String namespaceURI = ustringToString(args.at(0).toString(exec));
+    String localName = ustringToString(args.at(1).toString(exec));
+    String value = ustringToString(args.at(2).toString(exec));
     impl()->setParameter(namespaceURI, localName, value);
     return jsUndefined();
 }
@@ -100,8 +100,8 @@
 {
     if (args.at(1).isUndefinedOrNull())
         return jsUndefined();
-    String namespaceURI = args.at(0).toString(exec);
-    String localName = args.at(1).toString(exec);
+    String namespaceURI = ustringToString(args.at(0).toString(exec));
+    String localName = ustringToString(args.at(1).toString(exec));
     String value = impl()->getParameter(namespaceURI, localName);
     return jsStringOrUndefined(exec, value);
 }
@@ -110,8 +110,8 @@
 {
     if (args.at(1).isUndefinedOrNull())
         return jsUndefined();
-    String namespaceURI = args.at(0).toString(exec);
-    String localName = args.at(1).toString(exec);
+    String namespaceURI = ustringToString(args.at(0).toString(exec));
+    String localName = ustringToString(args.at(1).toString(exec));
     impl()->removeParameter(namespaceURI, localName);
     return jsUndefined();
 }
diff --git a/WebCore/bindings/js/JavaScriptCallFrame.cpp b/WebCore/bindings/js/JavaScriptCallFrame.cpp
new file mode 100644
index 0000000..c280d98
--- /dev/null
+++ b/WebCore/bindings/js/JavaScriptCallFrame.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2008 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 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 "JavaScriptCallFrame.h"
+
+#include "JSDOMBinding.h"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+
+#include "PlatformString.h"
+#include <debugger/DebuggerCallFrame.h>
+#include <runtime/Completion.h>
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSLock.h>
+#include <runtime/JSObject.h>
+#include <runtime/JSValue.h>
+
+using namespace JSC;
+
+namespace WebCore {
+    
+JavaScriptCallFrame::JavaScriptCallFrame(const DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line)
+    : m_debuggerCallFrame(debuggerCallFrame)
+    , m_caller(caller)
+    , m_sourceID(sourceID)
+    , m_line(line)
+    , m_isValid(true)
+{
+}
+
+JavaScriptCallFrame* JavaScriptCallFrame::caller()
+{
+    return m_caller.get();
+}
+
+const JSC::ScopeChainNode* JavaScriptCallFrame::scopeChain() const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return 0;
+    return m_debuggerCallFrame.scopeChain();
+}
+
+JSC::JSGlobalObject* JavaScriptCallFrame::dynamicGlobalObject() const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return 0;
+    return m_debuggerCallFrame.dynamicGlobalObject();
+}
+
+String JavaScriptCallFrame::functionName() const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return String();
+    UString functionName = m_debuggerCallFrame.calculatedFunctionName();
+    if (functionName.isEmpty())
+        return String();
+    return ustringToString(functionName);
+}
+
+DebuggerCallFrame::Type JavaScriptCallFrame::type() const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return DebuggerCallFrame::ProgramType;
+    return m_debuggerCallFrame.type();
+}
+
+JSObject* JavaScriptCallFrame::thisObject() const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return 0;
+    return m_debuggerCallFrame.thisObject();
+}
+
+// Evaluate some JavaScript code in the scope of this frame.
+JSValue JavaScriptCallFrame::evaluate(const UString& script, JSValue& exception) const
+{
+    ASSERT(m_isValid);
+    if (!m_isValid)
+        return jsNull();
+
+    JSLock lock(SilenceAssertionsOnly);
+    return m_debuggerCallFrame.evaluate(script, exception);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/js/JavaScriptCallFrame.h b/WebCore/bindings/js/JavaScriptCallFrame.h
new file mode 100644
index 0000000..574c782
--- /dev/null
+++ b/WebCore/bindings/js/JavaScriptCallFrame.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2008 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 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 JavaScriptCallFrame_h
+#define JavaScriptCallFrame_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+
+#include <debugger/DebuggerCallFrame.h>
+#include <interpreter/CallFrame.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class String;
+
+class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
+public:
+    static PassRefPtr<JavaScriptCallFrame> create(const JSC::DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line)
+    {
+        return adoptRef(new JavaScriptCallFrame(debuggerCallFrame, caller, sourceID, line));
+    }
+
+    void invalidate()
+    {
+        m_isValid = false;
+        m_debuggerCallFrame = 0;
+    }
+
+    bool isValid() const { return m_isValid; }
+
+    JavaScriptCallFrame* caller();
+
+    intptr_t sourceID() const { return m_sourceID; }
+    int line() const { return m_line; }
+    void update(const JSC::DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int line)
+    {
+        m_debuggerCallFrame = debuggerCallFrame;
+        m_line = line;
+        m_sourceID = sourceID;
+        m_isValid = true;
+    }
+
+    String functionName() const;
+    JSC::DebuggerCallFrame::Type type() const;
+    const JSC::ScopeChainNode* scopeChain() const;
+    JSC::JSGlobalObject* dynamicGlobalObject() const;
+
+    JSC::JSObject* thisObject() const;
+    JSC::JSValue evaluate(const JSC::UString& script, JSC::JSValue& exception) const;
+    
+private:
+    JavaScriptCallFrame(const JSC::DebuggerCallFrame&, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line);
+
+    JSC::DebuggerCallFrame m_debuggerCallFrame;
+    RefPtr<JavaScriptCallFrame> m_caller;
+    intptr_t m_sourceID;
+    int m_line;
+    bool m_isValid;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // JavaScriptCallFrame_h
diff --git a/WebCore/bindings/js/JavaScriptProfile.cpp b/WebCore/bindings/js/JavaScriptProfile.cpp
deleted file mode 100644
index 8e56ed8..0000000
--- a/WebCore/bindings/js/JavaScriptProfile.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "JavaScriptProfile.h"
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-
-#include "JavaScriptProfileNode.h"
-#include <JavaScriptCore/APICast.h>
-#include <JavaScriptCore/JSObjectRef.h>
-#include <JavaScriptCore/JSStringRef.h>
-#include <JavaScriptCore/OpaqueJSString.h>
-#include <profiler/Profile.h>
-#include <runtime/JSObject.h>
-#include <runtime/JSValue.h>
-#include <wtf/StdLibExtras.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-// Cache
-
-typedef HashMap<Profile*, JSObject*> ProfileMap;
-
-static ProfileMap& profileCache()
-{
-    DEFINE_STATIC_LOCAL(ProfileMap, staticProfiles, ());
-    return staticProfiles;
-}
-
-// Static Values
-
-static JSClassRef ProfileClass();
-
-static JSValueRef getTitleCallback(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeString(ctx, OpaqueJSString::create(profile->title()).get());
-}
-
-static JSValueRef getHeadCallback(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ExecState* exec = toJS(ctx);
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    return toRef(exec, toJS(exec, profile->head()));
-}
-
-static JSValueRef getUniqueIdCallback(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profile->uid());
-}
-
-// Static Functions
-
-static JSValueRef focus(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    if (argumentCount < 1)
-        return JSValueMakeUndefined(ctx);
-
-    if (!JSValueIsObjectOfClass(ctx, arguments[0], ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    profile->focus(static_cast<ProfileNode*>(JSObjectGetPrivate(const_cast<JSObjectRef>(arguments[0]))));
-
-    return JSValueMakeUndefined(ctx);
-}
-
-static JSValueRef exclude(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    if (argumentCount < 1)
-        return JSValueMakeUndefined(ctx);
-
-    if (!JSValueIsObjectOfClass(ctx, arguments[0], ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    profile->exclude(static_cast<ProfileNode*>(JSObjectGetPrivate(const_cast<JSObjectRef>(arguments[0]))));
-
-    return JSValueMakeUndefined(ctx);
-}
-
-static JSValueRef restoreAll(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* /*exception*/)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileClass()))
-        return JSValueMakeUndefined(ctx);
-
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(thisObject));
-    profile->restoreAll();
-
-    return JSValueMakeUndefined(ctx);
-}
-
-static void finalize(JSObjectRef object)
-{
-    Profile* profile = static_cast<Profile*>(JSObjectGetPrivate(object));
-    profileCache().remove(profile);
-    profile->deref();
-}
-
-JSClassRef ProfileClass()
-{
-    static JSStaticValue staticValues[] = {
-        { "title", getTitleCallback, 0, kJSPropertyAttributeNone },
-        { "head", getHeadCallback, 0, kJSPropertyAttributeNone },
-        { "uid", getUniqueIdCallback, 0, kJSPropertyAttributeNone },
-        { 0, 0, 0, 0 }
-    };
-
-    static JSStaticFunction staticFunctions[] = {
-        { "focus", focus, kJSPropertyAttributeNone },
-        { "exclude", exclude, kJSPropertyAttributeNone },
-        { "restoreAll", restoreAll, kJSPropertyAttributeNone },
-        { 0, 0, 0 }
-    };
-
-    static JSClassDefinition classDefinition = {
-        0, kJSClassAttributeNone, "Profile", 0, staticValues, staticFunctions,
-        0, finalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    };
-
-    static JSClassRef profileClass = JSClassCreate(&classDefinition);
-    return profileClass;
-}
-
-JSValue toJS(ExecState* exec, Profile* profile)
-{
-    if (!profile)
-        return jsNull();
-
-    JSObject* profileWrapper = profileCache().get(profile);
-    if (profileWrapper)
-        return profileWrapper;
-
-    profile->ref();
-    profileWrapper = toJS(JSObjectMake(toRef(exec), ProfileClass(), static_cast<void*>(profile)));
-    profileCache().set(profile, profileWrapper);
-    return profileWrapper;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/js/JavaScriptProfile.h b/WebCore/bindings/js/JavaScriptProfile.h
deleted file mode 100644
index 7b75b97..0000000
--- a/WebCore/bindings/js/JavaScriptProfile.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 JavaScriptProfile_h
-#define JavaScriptProfile_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-
-#include <runtime/JSValue.h>
-
-namespace JSC {
-class ExecState;
-class Profile;
-}
-
-namespace WebCore {
-
-JSC::JSValue toJS(JSC::ExecState*, JSC::Profile*);
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-#endif
diff --git a/WebCore/bindings/js/JavaScriptProfileNode.cpp b/WebCore/bindings/js/JavaScriptProfileNode.cpp
deleted file mode 100644
index 7d60b24..0000000
--- a/WebCore/bindings/js/JavaScriptProfileNode.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "JavaScriptProfileNode.h"
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-
-#include "JSDOMBinding.h"
-#include <JavaScriptCore/APICast.h>
-#include <JavaScriptCore/JSContextRef.h>
-#include <JavaScriptCore/JSObjectRef.h>
-#include <JavaScriptCore/JSRetainPtr.h>
-#include <JavaScriptCore/JSStringRef.h>
-#include <profiler/ProfileNode.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSValue.h>
-#include <wtf/StdLibExtras.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-// Cache
-
-typedef HashMap<ProfileNode*, JSObject*> ProfileNodeMap;
-
-static ProfileNodeMap& profileNodeCache()
-{
-    DEFINE_STATIC_LOCAL(ProfileNodeMap, staticProfileNodes, ());
-    return staticProfileNodes;
-}
-
-static JSValueRef getFunctionName(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    JSRetainPtr<JSStringRef> functionNameString(Adopt, JSStringCreateWithCharacters(profileNode->functionName().data(), profileNode->functionName().size()));
-    return JSValueMakeString(ctx, functionNameString.get());
-}
-
-static JSValueRef getURL(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    JSRetainPtr<JSStringRef> urlString(Adopt, JSStringCreateWithCharacters(profileNode->url().data(), profileNode->url().size()));
-    return JSValueMakeString(ctx, urlString.get());
-}
-
-static JSValueRef getLineNumber(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profileNode->lineNumber());
-}
-
-static JSValueRef getTotalTime(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profileNode->totalTime());
-}
-
-static JSValueRef getSelfTime(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profileNode->selfTime());
-}
-
-static JSValueRef getNumberOfCalls(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profileNode->numberOfCalls());
-}
-
-static JSValueRef getChildren(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef* exception)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    const Vector<RefPtr<ProfileNode> >& children = profileNode->children();
-
-    JSObjectRef global = JSContextGetGlobalObject(ctx);
-
-    JSRetainPtr<JSStringRef> arrayString(Adopt, JSStringCreateWithUTF8CString("Array"));
-
-    JSValueRef arrayProperty = JSObjectGetProperty(ctx, global, arrayString.get(), exception);
-    if (exception && *exception)
-        return JSValueMakeUndefined(ctx);
-
-    JSObjectRef arrayConstructor = JSValueToObject(ctx, arrayProperty, exception);
-    if (exception && *exception)
-        return JSValueMakeUndefined(ctx);
-
-    JSObjectRef result = JSObjectCallAsConstructor(ctx, arrayConstructor, 0, 0, exception);
-    if (exception && *exception)
-        return JSValueMakeUndefined(ctx);
-
-    JSRetainPtr<JSStringRef> pushString(Adopt, JSStringCreateWithUTF8CString("push"));
-
-    JSValueRef pushProperty = JSObjectGetProperty(ctx, result, pushString.get(), exception);
-    if (exception && *exception)
-        return JSValueMakeUndefined(ctx);
-
-    JSObjectRef pushFunction = JSValueToObject(ctx, pushProperty, exception);
-    if (exception && *exception)
-        return JSValueMakeUndefined(ctx);
-
-    ExecState* exec = toJS(ctx);
-    for (Vector<RefPtr<ProfileNode> >::const_iterator it = children.begin(); it != children.end(); ++it) {
-        JSValueRef arg0 = toRef(exec, toJS(exec, (*it).get() ));
-        JSObjectCallAsFunction(ctx, pushFunction, result, 1, &arg0, exception);
-        if (exception && *exception)
-            return JSValueMakeUndefined(ctx);
-    }
-
-    return result;
-}
-
-static JSValueRef getVisible(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeBoolean(ctx, profileNode->visible());
-}
-
-static JSValueRef getCallUID(JSContextRef ctx, JSObjectRef thisObject, JSStringRef, JSValueRef*)
-{
-    JSC::JSLock lock(SilenceAssertionsOnly);
-
-    if (!JSValueIsObjectOfClass(ctx, thisObject, ProfileNodeClass()))
-        return JSValueMakeUndefined(ctx);
-
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(thisObject));
-    return JSValueMakeNumber(ctx, profileNode->callIdentifier().hash());
-}
-
-static void finalize(JSObjectRef object)
-{
-    ProfileNode* profileNode = static_cast<ProfileNode*>(JSObjectGetPrivate(object));
-    profileNodeCache().remove(profileNode);
-    profileNode->deref();
-}
-
-JSClassRef ProfileNodeClass()
-{
-    static JSStaticValue staticValues[] = {
-        { "functionName", getFunctionName, 0, kJSPropertyAttributeNone },
-        { "url", getURL, 0, kJSPropertyAttributeNone },
-        { "lineNumber", getLineNumber, 0, kJSPropertyAttributeNone },
-        { "totalTime", getTotalTime, 0, kJSPropertyAttributeNone },
-        { "selfTime", getSelfTime, 0, kJSPropertyAttributeNone },
-        { "numberOfCalls", getNumberOfCalls, 0, kJSPropertyAttributeNone },
-        { "children", getChildren, 0, kJSPropertyAttributeNone },
-        { "visible", getVisible, 0, kJSPropertyAttributeNone },
-        { "callUID", getCallUID, 0, kJSPropertyAttributeNone },
-        { 0, 0, 0, 0 }
-    };
-
-    static JSClassDefinition classDefinition = {
-        0, kJSClassAttributeNone, "ProfileNode", 0, staticValues, 0,
-        0, finalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    };
-
-    static JSClassRef profileNodeClass = JSClassCreate(&classDefinition);
-    return profileNodeClass;
-}
-
-JSValue toJS(ExecState* exec, ProfileNode* profileNode)
-{
-    if (!profileNode)
-        return jsNull();
-
-    JSObject* profileNodeWrapper = profileNodeCache().get(profileNode);
-    if (profileNodeWrapper)
-        return profileNodeWrapper;
-
-    profileNode->ref();
-
-    profileNodeWrapper = toJS(JSObjectMake(toRef(exec), ProfileNodeClass(), static_cast<void*>(profileNode)));
-    profileNodeCache().set(profileNode, profileNodeWrapper);
-    return profileNodeWrapper;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/js/JavaScriptProfileNode.h b/WebCore/bindings/js/JavaScriptProfileNode.h
deleted file mode 100644
index f01be19..0000000
--- a/WebCore/bindings/js/JavaScriptProfileNode.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 JavaScriptProfileNode_h
-#define JavaScriptProfileNode_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-
-#include <JavaScriptCore/JSBase.h>
-#include <runtime/JSValue.h>
-
-namespace JSC {
-class ExecState;
-class ProfileNode;
-}
-
-namespace WebCore {
-
-JSClassRef ProfileNodeClass();
-JSC::JSValue toJS(JSC::ExecState*, JSC::ProfileNode*);
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-#endif
diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp
index be62bb8..8fc860b 100644
--- a/WebCore/bindings/js/ScheduledAction.cpp
+++ b/WebCore/bindings/js/ScheduledAction.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "ScheduledAction.h"
 
-#include "CString.h"
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Frame.h"
@@ -55,7 +54,7 @@
         UString string = v.toString(exec);
         if (exec->hadException())
             return 0;
-        return new ScheduledAction(string, isolatedWorld);
+        return new ScheduledAction(ustringToString(string), isolatedWorld);
     }
     ArgList argsTail;
     args.getSlice(2, argsTail);
@@ -117,7 +116,7 @@
         return;
 
     RefPtr<Frame> frame = window->impl()->frame();
-    if (!frame || !frame->script()->canExecuteScripts())
+    if (!frame || !frame->script()->canExecuteScripts(AboutToExecuteScript))
         return;
 
     frame->script()->setProcessingTimerCallback(true);
diff --git a/WebCore/bindings/js/ScriptCallFrame.cpp b/WebCore/bindings/js/ScriptCallFrame.cpp
index 09752d1..19ed1ea 100644
--- a/WebCore/bindings/js/ScriptCallFrame.cpp
+++ b/WebCore/bindings/js/ScriptCallFrame.cpp
@@ -40,7 +40,7 @@
 
 ScriptCallFrame::ScriptCallFrame(const UString& functionName, const UString& urlString, int lineNumber, const ArgList& args, unsigned skipArgumentCount)
     : m_functionName(functionName)
-    , m_sourceURL(ParsedURLString, urlString)
+    , m_sourceURL(ParsedURLString, ustringToString(urlString))
     , m_lineNumber(lineNumber)
 {
     size_t argumentCount = args.size();
diff --git a/WebCore/bindings/js/ScriptCallStack.cpp b/WebCore/bindings/js/ScriptCallStack.cpp
index a435588..771141d 100644
--- a/WebCore/bindings/js/ScriptCallStack.cpp
+++ b/WebCore/bindings/js/ScriptCallStack.cpp
@@ -101,4 +101,9 @@
     m_initialized = true;
 }
 
+bool ScriptCallStack::callLocation(String*, int*, String*)
+{
+    return false;
+}
+
 } // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptCallStack.h b/WebCore/bindings/js/ScriptCallStack.h
index 52362ea..e51d97a 100644
--- a/WebCore/bindings/js/ScriptCallStack.h
+++ b/WebCore/bindings/js/ScriptCallStack.h
@@ -53,6 +53,7 @@
         // frame retrieval methods
         const ScriptCallFrame &at(unsigned);
         unsigned size();
+        static bool callLocation(String*, int*, String*);
 
     private:
         void initialize();
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 171d4dd..b3695b4 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "ScriptController.h"
 
-#include "CString.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "Frame.h"
@@ -37,6 +36,7 @@
 #include "ScriptValue.h"
 #include "Settings.h"
 #include "StorageNamespace.h"
+#include "WebCoreJSClientData.h"
 #include "XSSAuditor.h"
 #include "npruntime_impl.h"
 #include "runtime_root.h"
@@ -81,20 +81,36 @@
 
 ScriptController::~ScriptController()
 {
+    disconnectPlatformScriptObjects();
+
+    // It's likely that destroying m_windowShells will create a lot of garbage.
     if (!m_windowShells.isEmpty()) {
-        m_windowShells.clear();
-    
-        // It's likely that releasing the global object has created a lot of garbage.
+        while (!m_windowShells.isEmpty())
+            destroyWindowShell(m_windowShells.begin()->first.get());
         gcController().garbageCollectSoon();
     }
+}
 
-    disconnectPlatformScriptObjects();
+void ScriptController::destroyWindowShell(DOMWrapperWorld* world)
+{
+    ASSERT(m_windowShells.contains(world));
+    m_windowShells.remove(world);
+    world->didDestroyWindowShell(this);
+}
+
+JSDOMWindowShell* ScriptController::createWindowShell(DOMWrapperWorld* world)
+{
+    ASSERT(!m_windowShells.contains(world));
+    JSDOMWindowShell* windowShell = new JSDOMWindowShell(m_frame->domWindow(), world);
+    m_windowShells.add(world, windowShell);
+    world->didCreateWindowShell(this);
+    return windowShell;
 }
 
 ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld* world)
 {
     const SourceCode& jsSourceCode = sourceCode.jsSourceCode();
-    String sourceURL = jsSourceCode.provider()->url();
+    String sourceURL = ustringToString(jsSourceCode.provider()->url());
 
     if (!m_XSSAuditor->canEvaluate(sourceCode.source())) {
         // This script is not safe to be evaluated.
@@ -152,24 +168,9 @@
     return evaluateInWorld(sourceCode, mainThreadNormalWorld());
 }
 
-// An DOMWrapperWorld other than the thread's normal world.
-class IsolatedWorld : public DOMWrapperWorld {
-public:
-    static PassRefPtr<IsolatedWorld> create(JSGlobalData* globalData) { return adoptRef(new IsolatedWorld(globalData)); }
-
-protected:
-    IsolatedWorld(JSGlobalData* globalData)
-        : DOMWrapperWorld(globalData, false)
-    {
-        JSGlobalData::ClientData* clientData = globalData->clientData;
-        ASSERT(clientData);
-        static_cast<WebCoreJSClientData*>(clientData)->rememberWorld(this);
-    }
-};
-
 PassRefPtr<DOMWrapperWorld> ScriptController::createWorld()
 {
-    return IsolatedWorld::create(JSDOMWindow::commonJSGlobalData());
+    return DOMWrapperWorld::create(JSDOMWindow::commonJSGlobalData());
 }
 
 void ScriptController::getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
@@ -199,7 +200,7 @@
         }
     }
 
-    // There is likely to be a lot of garbage now.
+    // It's likely that resetting our windows created a lot of garbage.
     gcController().garbageCollectSoon();
 }
 
@@ -209,8 +210,8 @@
 
     JSLock lock(SilenceAssertionsOnly);
 
-    JSDOMWindowShell* windowShell = new JSDOMWindowShell(m_frame->domWindow(), world);
-    m_windowShells.add(world, windowShell);
+    JSDOMWindowShell* windowShell = createWindowShell(world);
+
     windowShell->window()->updateDocument();
 
     if (Page* page = m_frame->page()) {
@@ -317,7 +318,7 @@
 
 Bindings::RootObject* ScriptController::bindingRootObject()
 {
-    if (!canExecuteScripts())
+    if (!canExecuteScripts(NotAboutToExecuteScript))
         return 0;
 
     if (!m_bindingRootObject) {
@@ -344,7 +345,7 @@
 NPObject* ScriptController::windowScriptNPObject()
 {
     if (!m_windowScriptNPObject) {
-        if (canExecuteScripts()) {
+        if (canExecuteScripts(NotAboutToExecuteScript)) {
             // JavaScript is enabled, so there is a JavaScript window object.
             // Return an NPObject bound to the window object.
             JSC::JSLock lock(SilenceAssertionsOnly);
@@ -377,7 +378,7 @@
 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create JSObjects when JavaScript is disabled
-    if (!canExecuteScripts())
+    if (!canExecuteScripts(NotAboutToExecuteScript))
         return 0;
 
     // Create a JSObject bound to this element
@@ -444,7 +445,7 @@
 {
     ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url());
 
-    if (!canExecuteScripts() || isPaused())
+    if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
         return ScriptValue();
 
     bool wasInExecuteScript = m_inExecuteScript;
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index 1cbb56d..d096c2e 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -62,6 +62,11 @@
 
 typedef HashMap<void*, RefPtr<JSC::Bindings::RootObject> > RootObjectMap;
 
+enum ReasonForCallingCanExecuteScripts {
+    AboutToExecuteScript,
+    NotAboutToExecuteScript
+};
+
 class ScriptController {
     friend class ScriptCachedFrameData;
     typedef WTF::HashMap< RefPtr<DOMWrapperWorld>, JSC::ProtectedPtr<JSDOMWindowShell> > ShellMap;
@@ -72,6 +77,9 @@
 
     static PassRefPtr<DOMWrapperWorld> createWorld();
 
+    JSDOMWindowShell* createWindowShell(DOMWrapperWorld*);
+    void destroyWindowShell(DOMWrapperWorld*);
+
     JSDOMWindowShell* windowShell(DOMWrapperWorld* world)
     {
         ShellMap::iterator iter = m_windowShells.find(world);
@@ -110,7 +118,7 @@
     bool processingUserGesture(DOMWrapperWorld*) const;
     bool anyPageIsProcessingUserGesture() const;
 
-    bool canExecuteScripts();
+    bool canExecuteScripts(ReasonForCallingCanExecuteScripts);
 
     // Debugger can be 0 to detach any existing Debugger.
     void attachDebugger(JSC::Debugger*); // Attaches/detaches in all worlds/window shells.
diff --git a/WebCore/bindings/js/ScriptControllerBrew.cpp b/WebCore/bindings/js/ScriptControllerBrew.cpp
new file mode 100644
index 0000000..d8d345a
--- /dev/null
+++ b/WebCore/bindings/js/ScriptControllerBrew.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Apple Computer, Inc.
+ * Copyright (C) 2009 Company 100, 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 COMPUTER, 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 "ScriptController.h"
+
+#include "Bridge.h"
+#include "PluginView.h"
+#include "runtime_root.h"
+
+namespace WebCore {
+
+PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(WebCore::Widget* widget)
+{
+    if (!widget->isPluginView())
+        return 0;
+
+    return static_cast<PluginView*>(widget)->bindingInstance();
+
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptControllerMac.mm b/WebCore/bindings/js/ScriptControllerMac.mm
index 208aae8..a895489 100644
--- a/WebCore/bindings/js/ScriptControllerMac.mm
+++ b/WebCore/bindings/js/ScriptControllerMac.mm
@@ -107,7 +107,7 @@
 
 WebScriptObject* ScriptController::windowScriptObject()
 {
-    if (!canExecuteScripts())
+    if (!canExecuteScripts(NotAboutToExecuteScript))
         return 0;
 
     if (!m_windowScriptObject) {
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index 9869775..8f476b4 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -1,47 +1,588 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
  * 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:
- * 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 COMPUTER, 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.
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "ScriptDebugServer.h"
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 
-#include "ScriptDebugServer.h"
+#include "DOMWindow.h"
+#include "EventLoop.h"
+#include "Frame.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "JSDOMWindowCustom.h"
+#include "JavaScriptCallFrame.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PluginView.h"
+#include "ScriptBreakpoint.h"
+#include "ScriptController.h"
+#include "ScriptDebugListener.h"
+#include "ScrollView.h"
+#include "Widget.h"
+#include <debugger/DebuggerCallFrame.h>
+#include <parser/SourceCode.h>
+#include <runtime/JSLock.h>
+#include <wtf/MainThread.h>
+#include <wtf/StdLibExtras.h>
+#include <wtf/UnusedParam.h>
 
-#include "JavaScriptDebugServer.h"
+using namespace JSC;
 
 namespace WebCore {
 
-void ScriptDebugServer::recompileAllJSFunctions()
+ScriptDebugServer& ScriptDebugServer::shared()
 {
-    JavaScriptDebugServer::shared().recompileAllJSFunctions();
+    DEFINE_STATIC_LOCAL(ScriptDebugServer, server, ());
+    return server;
+}
+
+ScriptDebugServer::ScriptDebugServer()
+    : m_callingListeners(false)
+    , m_pauseOnExceptionsState(DontPauseOnExceptions)
+    , m_pauseOnNextStatement(false)
+    , m_paused(false)
+    , m_doneProcessingDebuggerEvents(true)
+    , m_breakpointsActivated(true)
+    , m_pauseOnCallFrame(0)
+    , m_recompileTimer(this, &ScriptDebugServer::recompileAllJSFunctions)
+{
+}
+
+ScriptDebugServer::~ScriptDebugServer()
+{
+    deleteAllValues(m_pageListenersMap);
+}
+
+void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
+{
+    ASSERT_ARG(listener, listener);
+    ASSERT_ARG(page, page);
+
+    pair<PageListenersMap::iterator, bool> result = m_pageListenersMap.add(page, 0);
+    if (result.second)
+        result.first->second = new ListenerSet;
+
+    ListenerSet* listeners = result.first->second;
+    listeners->add(listener);
+
+    didAddListener(page);
+}
+
+void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page)
+{
+    ASSERT_ARG(listener, listener);
+    ASSERT_ARG(page, page);
+
+    PageListenersMap::iterator it = m_pageListenersMap.find(page);
+    if (it == m_pageListenersMap.end())
+        return;
+
+    ListenerSet* listeners = it->second;
+    listeners->remove(listener);
+    if (listeners->isEmpty()) {
+        m_pageListenersMap.remove(it);
+        delete listeners;
+    }
+
+    didRemoveListener(page);
+    if (!hasListeners())
+        didRemoveLastListener();
+}
+
+void ScriptDebugServer::pageCreated(Page* page)
+{
+    ASSERT_ARG(page, page);
+
+    if (!hasListenersInterestedInPage(page))
+        return;
+    page->setDebugger(this);
+}
+
+bool ScriptDebugServer::hasListenersInterestedInPage(Page* page)
+{
+    ASSERT_ARG(page, page);
+
+    if (hasGlobalListeners())
+        return true;
+
+    return m_pageListenersMap.contains(page);
+}
+
+void ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumber, ScriptBreakpoint breakpoint)
+{
+    intptr_t sourceIDValue = sourceID.toIntPtr();
+    if (!sourceIDValue)
+        return;
+    BreakpointsMap::iterator it = m_breakpoints.find(sourceIDValue);
+    if (it == m_breakpoints.end())
+        it = m_breakpoints.set(sourceIDValue, SourceBreakpoints()).first;
+    it->second.set(lineNumber, breakpoint);
+}
+
+void ScriptDebugServer::removeBreakpoint(const String& sourceID, unsigned lineNumber)
+{
+    intptr_t sourceIDValue = sourceID.toIntPtr();
+    if (!sourceIDValue)
+        return;
+    BreakpointsMap::iterator it = m_breakpoints.find(sourceIDValue);
+    if (it != m_breakpoints.end())
+        it->second.remove(lineNumber);
+}
+
+bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const
+{
+    if (!m_breakpointsActivated)
+        return false;
+
+    BreakpointsMap::const_iterator it = m_breakpoints.find(sourceID);
+    if (it == m_breakpoints.end())
+        return false;
+    SourceBreakpoints::const_iterator breakIt = it->second.find(lineNumber);
+    if (breakIt == it->second.end() || !breakIt->second.enabled)
+        return false;
+
+    // An empty condition counts as no condition which is equivalent to "true".
+    if (breakIt->second.condition.isEmpty())
+        return true;
+
+    JSValue exception;
+    JSValue result = m_currentCallFrame->evaluate(stringToUString(breakIt->second.condition), exception);
+    if (exception) {
+        // An erroneous condition counts as "false".
+        return false;
+    }
+    return result.toBoolean(m_currentCallFrame->scopeChain()->globalObject->globalExec());
+}
+
+void ScriptDebugServer::clearBreakpoints()
+{
+    m_breakpoints.clear();
+}
+
+void ScriptDebugServer::setBreakpointsActivated(bool activated)
+{
+    m_breakpointsActivated = activated;
+}
+
+void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pause)
+{
+    m_pauseOnExceptionsState = pause;
+}
+
+void ScriptDebugServer::pauseProgram()
+{
+    m_pauseOnNextStatement = true;
+}
+
+void ScriptDebugServer::continueProgram()
+{
+    if (!m_paused)
+        return;
+
+    m_pauseOnNextStatement = false;
+    m_doneProcessingDebuggerEvents = true;
+}
+
+void ScriptDebugServer::stepIntoStatement()
+{
+    if (!m_paused)
+        return;
+
+    m_pauseOnNextStatement = true;
+    m_doneProcessingDebuggerEvents = true;
+}
+
+void ScriptDebugServer::stepOverStatement()
+{
+    if (!m_paused)
+        return;
+
+    m_pauseOnCallFrame = m_currentCallFrame.get();
+    m_doneProcessingDebuggerEvents = true;
+}
+
+void ScriptDebugServer::stepOutOfFunction()
+{
+    if (!m_paused)
+        return;
+
+    m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame->caller() : 0;
+    m_doneProcessingDebuggerEvents = true;
+}
+
+JavaScriptCallFrame* ScriptDebugServer::currentCallFrame()
+{
+    if (!m_paused)
+        return 0;
+    return m_currentCallFrame.get();
+}
+
+ScriptState* ScriptDebugServer::currentCallFrameState()
+{
+    if (!m_paused)
+        return 0;
+    return m_currentCallFrame->scopeChain()->globalObject->globalExec();        
+}
+
+void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source)
+{
+    String sourceID = ustringToString(JSC::UString::from(source.provider()->asID()));
+    String url = ustringToString(source.provider()->url());
+    String data = ustringToString(JSC::UString(source.data(), source.length()));
+    int firstLine = source.firstLine();
+
+    Vector<ScriptDebugListener*> copy;
+    copyToVector(listeners, copy);
+    for (size_t i = 0; i < copy.size(); ++i)
+        copy[i]->didParseSource(sourceID, url, data, firstLine);
+}
+
+void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, const SourceCode& source, int errorLine, const String& errorMessage)
+{
+    String url = ustringToString(source.provider()->url());
+    String data = ustringToString(JSC::UString(source.data(), source.length()));
+    int firstLine = source.firstLine();
+
+    Vector<ScriptDebugListener*> copy;
+    copyToVector(listeners, copy);
+    for (size_t i = 0; i < copy.size(); ++i)
+        copy[i]->failedToParseSource(url, data, firstLine, errorLine, errorMessage);
+}
+
+static Page* toPage(JSGlobalObject* globalObject)
+{
+    ASSERT_ARG(globalObject, globalObject);
+
+    JSDOMWindow* window = asJSDOMWindow(globalObject);
+    Frame* frame = window->impl()->frame();
+    return frame ? frame->page() : 0;
+}
+
+void ScriptDebugServer::detach(JSGlobalObject* globalObject)
+{
+    // If we're detaching from the currently executing global object, manually tear down our
+    // stack, since we won't get further debugger callbacks to do so. Also, resume execution,
+    // since there's no point in staying paused once a window closes.
+    if (m_currentCallFrame && m_currentCallFrame->dynamicGlobalObject() == globalObject) {
+        m_currentCallFrame = 0;
+        m_pauseOnCallFrame = 0;
+        continueProgram();
+    }
+    Debugger::detach(globalObject);
+}
+
+void ScriptDebugServer::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMessage)
+{
+    if (m_callingListeners)
+        return;
+
+    Page* page = toPage(exec->dynamicGlobalObject());
+    if (!page)
+        return;
+
+    m_callingListeners = true;
+
+    bool isError = errorLine != -1;
+
+    if (hasGlobalListeners()) {
+        if (isError)
+            dispatchFailedToParseSource(m_listeners, source, errorLine, ustringToString(errorMessage));
+        else
+            dispatchDidParseSource(m_listeners, source);
+    }
+
+    if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
+        ASSERT(!pageListeners->isEmpty());
+        if (isError)
+            dispatchFailedToParseSource(*pageListeners, source, errorLine, ustringToString(errorMessage));
+        else
+            dispatchDidParseSource(*pageListeners, source);
+    }
+
+    m_callingListeners = false;
+}
+
+void ScriptDebugServer::dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback callback)
+{
+    Vector<ScriptDebugListener*> copy;
+    copyToVector(listeners, copy);
+    for (size_t i = 0; i < copy.size(); ++i)
+        (copy[i]->*callback)();
+}
+
+void ScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback callback, Page* page)
+{
+    if (m_callingListeners)
+        return;
+
+    m_callingListeners = true;
+
+    ASSERT(hasListeners());
+
+    dispatchFunctionToListeners(m_listeners, callback);
+
+    if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
+        ASSERT(!pageListeners->isEmpty());
+        dispatchFunctionToListeners(*pageListeners, callback);
+    }
+
+    m_callingListeners = false;
+}
+
+void ScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused)
+{
+    setMainThreadCallbacksPaused(paused);
+
+    const HashSet<Page*>& pages = pageGroup.pages();
+
+    HashSet<Page*>::const_iterator end = pages.end();
+    for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it)
+        setJavaScriptPaused(*it, paused);
+}
+
+void ScriptDebugServer::setJavaScriptPaused(Page* page, bool paused)
+{
+    ASSERT_ARG(page, page);
+
+    page->setDefersLoading(paused);
+
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+        setJavaScriptPaused(frame, paused);
+}
+
+void ScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
+{
+    ASSERT_ARG(frame, frame);
+
+    if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
+        return;
+
+    frame->script()->setPaused(paused);
+
+    Document* document = frame->document();
+    if (paused)
+        document->suspendActiveDOMObjects();
+    else
+        document->resumeActiveDOMObjects();
+
+    setJavaScriptPaused(frame->view(), paused);
+}
+
+void ScriptDebugServer::setJavaScriptPaused(FrameView* view, bool paused)
+{
+    if (!view)
+        return;
+
+    const HashSet<RefPtr<Widget> >* children = view->children();
+    ASSERT(children);
+
+    HashSet<RefPtr<Widget> >::const_iterator end = children->end();
+    for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) {
+        Widget* widget = (*it).get();
+        if (!widget->isPluginView())
+            continue;
+        static_cast<PluginView*>(widget)->setJavaScriptPaused(paused);
+    }
+}
+
+void ScriptDebugServer::pauseIfNeeded(Page* page)
+{
+    if (m_paused)
+        return;
+
+    if (!page || !hasListenersInterestedInPage(page))
+        return;
+
+    bool pauseNow = m_pauseOnNextStatement;
+    pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame);
+    pauseNow |= (m_currentCallFrame->line() > 0 && hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->line()));
+    if (!pauseNow)
+        return;
+
+    m_pauseOnCallFrame = 0;
+    m_pauseOnNextStatement = false;
+    m_paused = true;
+
+    dispatchFunctionToListeners(&ScriptDebugListener::didPause, page);
+
+    setJavaScriptPaused(page->group(), true);
+
+    TimerBase::fireTimersInNestedEventLoop();
+
+    EventLoop loop;
+    m_doneProcessingDebuggerEvents = false;
+    while (!m_doneProcessingDebuggerEvents && !loop.ended())
+        loop.cycle();
+
+    setJavaScriptPaused(page->group(), false);
+
+    m_paused = false;
+
+    dispatchFunctionToListeners(&ScriptDebugListener::didContinue, page);
+}
+
+void ScriptDebugServer::callEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+}
+
+void ScriptDebugServer::atStatement(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    ASSERT(m_currentCallFrame);
+    if (!m_currentCallFrame)
+        return;
+
+    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+}
+
+void ScriptDebugServer::returnEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    ASSERT(m_currentCallFrame);
+    if (!m_currentCallFrame)
+        return;
+
+    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+
+    // Treat stepping over a return statement like stepping out.
+    if (m_currentCallFrame == m_pauseOnCallFrame)
+        m_pauseOnCallFrame = m_currentCallFrame->caller();
+    m_currentCallFrame = m_currentCallFrame->caller();
+}
+
+void ScriptDebugServer::exception(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber, bool hasHandler)
+{
+    if (m_paused)
+        return;
+
+    ASSERT(m_currentCallFrame);
+    if (!m_currentCallFrame)
+        return;
+
+    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasHandler))
+        m_pauseOnNextStatement = true;
+
+    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+}
+
+void ScriptDebugServer::willExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+}
+
+void ScriptDebugServer::didExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    ASSERT(m_currentCallFrame);
+    if (!m_currentCallFrame)
+        return;
+
+    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+
+    // Treat stepping over the end of a program like stepping out.
+    if (m_currentCallFrame == m_pauseOnCallFrame)
+        m_pauseOnCallFrame = m_currentCallFrame->caller();
+    m_currentCallFrame = m_currentCallFrame->caller();
+}
+
+void ScriptDebugServer::didReachBreakpoint(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
+{
+    if (m_paused)
+        return;
+
+    ASSERT(m_currentCallFrame);
+    if (!m_currentCallFrame)
+        return;
+
+    m_pauseOnNextStatement = true;
+    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
+    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
 }
 
 void ScriptDebugServer::recompileAllJSFunctionsSoon()
 {
-    JavaScriptDebugServer::shared().recompileAllJSFunctionsSoon();
+    m_recompileTimer.startOneShot(0);
+}
+
+void ScriptDebugServer::recompileAllJSFunctions(Timer<ScriptDebugServer>*)
+{
+    JSLock lock(SilenceAssertionsOnly);
+    Debugger::recompileAllJSFunctions(JSDOMWindow::commonJSGlobalData());
+}
+
+void ScriptDebugServer::didAddListener(Page* page)
+{
+    recompileAllJSFunctionsSoon();
+
+    if (page)
+        page->setDebugger(this);
+    else
+        Page::setDebuggerForAllPages(this);
+}
+
+void ScriptDebugServer::didRemoveListener(Page* page)
+{
+    if (hasGlobalListeners() || (page && hasListenersInterestedInPage(page)))
+        return;
+
+    recompileAllJSFunctionsSoon();
+
+    if (page)
+        page->setDebugger(0);
+    else
+        Page::setDebuggerForAllPages(0);
+}
+
+void ScriptDebugServer::didRemoveLastListener()
+{
+    m_doneProcessingDebuggerEvents = true;
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptDebugServer.h b/WebCore/bindings/js/ScriptDebugServer.h
index 027ffa5..4740585 100644
--- a/WebCore/bindings/js/ScriptDebugServer.h
+++ b/WebCore/bindings/js/ScriptDebugServer.h
@@ -1,27 +1,30 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
  * 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:
- * 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 COMPUTER, 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.
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 ScriptDebugServer_h
@@ -29,14 +32,118 @@
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 
-#include <wtf/Noncopyable.h>
+#include "PlatformString.h"
+#include "ScriptBreakpoint.h"
+#include "ScriptState.h"
+#include "Timer.h"
 
+#include <debugger/Debugger.h>
+#include <runtime/UString.h>
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/RefPtr.h>
+
+namespace JSC {
+class DebuggerCallFrame;
+class JSGlobalObject;
+}
 namespace WebCore {
 
-class ScriptDebugServer : public Noncopyable {
+class Frame;
+class FrameView;
+class Page;
+class PageGroup;
+class ScriptDebugListener;
+class JavaScriptCallFrame;
+
+class ScriptDebugServer : JSC::Debugger, public Noncopyable {
 public:
-    static void recompileAllJSFunctions();
-    static void recompileAllJSFunctionsSoon();
+    static ScriptDebugServer& shared();
+
+    void addListener(ScriptDebugListener*, Page*);
+    void removeListener(ScriptDebugListener*, Page*);
+
+    void setBreakpoint(const String& sourceID, unsigned lineNumber, ScriptBreakpoint breakpoint);
+    void removeBreakpoint(const String& sourceID, unsigned lineNumber);
+    void clearBreakpoints();
+    void setBreakpointsActivated(bool activated);
+
+    enum PauseOnExceptionsState {
+        DontPauseOnExceptions,
+        PauseOnAllExceptions,
+        PauseOnUncaughtExceptions
+    };
+    PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
+    void setPauseOnExceptionsState(PauseOnExceptionsState);
+
+    void pauseProgram();
+    void continueProgram();
+    void stepIntoStatement();
+    void stepOverStatement();
+    void stepOutOfFunction();
+
+    void recompileAllJSFunctionsSoon();
+    void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0);
+
+    JavaScriptCallFrame* currentCallFrame();
+    ScriptState* currentCallFrameState();
+
+    void pageCreated(Page*);
+
+private:
+    typedef HashSet<ScriptDebugListener*> ListenerSet;
+    typedef void (ScriptDebugListener::*JavaScriptExecutionCallback)();
+
+    ScriptDebugServer();
+    ~ScriptDebugServer();
+
+    bool hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const;
+    bool hasListeners() const { return !m_listeners.isEmpty() || !m_pageListenersMap.isEmpty(); }
+    bool hasGlobalListeners() const { return !m_listeners.isEmpty(); }
+    bool hasListenersInterestedInPage(Page*);
+
+    void setJavaScriptPaused(const PageGroup&, bool paused);
+    void setJavaScriptPaused(Page*, bool paused);
+    void setJavaScriptPaused(Frame*, bool paused);
+    void setJavaScriptPaused(FrameView*, bool paused);
+
+    void dispatchFunctionToListeners(JavaScriptExecutionCallback, Page*);
+    void dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback callback);
+    void dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source);
+    void dispatchFailedToParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, int errorLine, const String& errorMessage);
+
+    void pauseIfNeeded(Page*);
+
+    virtual void detach(JSC::JSGlobalObject*);
+
+    virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg);
+    virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+    virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int firstLine);
+    virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
+    virtual void exception(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, bool hasHandler);
+    virtual void willExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
+    virtual void didExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
+    virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
+
+    void didAddListener(Page*);
+    void didRemoveListener(Page*);
+    void didRemoveLastListener();
+
+    typedef HashMap<Page*, ListenerSet*> PageListenersMap;
+    typedef HashMap<intptr_t, SourceBreakpoints> BreakpointsMap;
+
+    PageListenersMap m_pageListenersMap;
+    ListenerSet m_listeners;
+    bool m_callingListeners;
+    PauseOnExceptionsState m_pauseOnExceptionsState;
+    bool m_pauseOnNextStatement;
+    bool m_paused;
+    bool m_doneProcessingDebuggerEvents;
+    bool m_breakpointsActivated;
+    JavaScriptCallFrame* m_pauseOnCallFrame;
+    RefPtr<JavaScriptCallFrame> m_currentCallFrame;
+    BreakpointsMap m_breakpoints;
+    Timer<ScriptDebugServer> m_recompileTimer;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptEventListener.cpp b/WebCore/bindings/js/ScriptEventListener.cpp
index fd45546..01b9060 100644
--- a/WebCore/bindings/js/ScriptEventListener.cpp
+++ b/WebCore/bindings/js/ScriptEventListener.cpp
@@ -59,12 +59,11 @@
 
     int lineNumber = 1;
     String sourceURL;
-    JSObject* wrapper = 0;
     
     // FIXME: We should be able to provide accurate source information for frameless documents, too (e.g. for importing nodes from XMLHttpRequest.responseXML).
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->canExecuteScripts())
+        if (!scriptController->canExecuteScripts(AboutToExecuteScript))
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -74,13 +73,9 @@
 
         lineNumber = scriptController->eventHandlerLineNumber();
         sourceURL = node->document()->url().string();
-
-        JSC::JSLock lock(SilenceAssertionsOnly);
-        JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(node->document(), mainThreadNormalWorld());
-        wrapper = asObject(toJS(globalObject->globalExec(), globalObject, node));
     }
 
-    return JSLazyEventListener::create(attr->localName().string(), eventParameterName(node->isSVGElement()), attr->value(), node, sourceURL, lineNumber, wrapper, mainThreadNormalWorld());
+    return JSLazyEventListener::create(attr->localName().string(), eventParameterName(node->isSVGElement()), attr->value(), node, sourceURL, lineNumber, 0, mainThreadNormalWorld());
 }
 
 PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame* frame, Attribute* attr)
@@ -96,7 +91,7 @@
     String sourceURL;
     
     ScriptController* scriptController = frame->script();
-    if (!scriptController->canExecuteScripts())
+    if (!scriptController->canExecuteScripts(AboutToExecuteScript))
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -118,7 +113,7 @@
     JSC::JSObject* jsFunction = jsListener->jsFunction(context);
     if (!jsFunction)
         return "";
-    return jsFunction->toString(scriptState);
+    return ustringToString(jsFunction->toString(scriptState));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptFunctionCall.cpp b/WebCore/bindings/js/ScriptFunctionCall.cpp
index 5001d3c..e9073b5 100644
--- a/WebCore/bindings/js/ScriptFunctionCall.cpp
+++ b/WebCore/bindings/js/ScriptFunctionCall.cpp
@@ -60,7 +60,7 @@
 
 void ScriptFunctionCall::appendArgument(const ScriptString& argument)
 {
-    m_arguments.append(jsString(m_exec, argument));
+    m_arguments.append(jsString(m_exec, argument.ustring()));
 }
 
 void ScriptFunctionCall::appendArgument(const ScriptValue& argument)
@@ -132,7 +132,7 @@
 
     JSLock lock(SilenceAssertionsOnly);
 
-    JSValue function = thisObject->get(m_exec, Identifier(m_exec, m_name));
+    JSValue function = thisObject->get(m_exec, Identifier(m_exec, stringToUString(m_name)));
     if (m_exec->hadException()) {
         if (reportExceptions)
             reportException(m_exec, m_exec->exception());
@@ -170,7 +170,7 @@
 
     JSLock lock(SilenceAssertionsOnly);
 
-    JSObject* constructor = asObject(thisObject->get(m_exec, Identifier(m_exec, m_name)));
+    JSObject* constructor = asObject(thisObject->get(m_exec, Identifier(m_exec, stringToUString(m_name))));
     if (m_exec->hadException()) {
         if (reportExceptions)
             reportException(m_exec, m_exec->exception());
diff --git a/WebCore/bindings/js/ScriptGCEvent.h b/WebCore/bindings/js/ScriptGCEvent.h
new file mode 100644
index 0000000..57892e7
--- /dev/null
+++ b/WebCore/bindings/js/ScriptGCEvent.h
@@ -0,0 +1,51 @@
+/*
+ * 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 ScriptGCEvent_h
+#define ScriptGCEvent_h
+
+#if ENABLE(INSPECTOR)
+
+namespace WebCore {
+
+class ScriptGCEventListener;
+
+class ScriptGCEvent
+{
+public:
+    static void addEventListener(ScriptGCEventListener*) { }
+    static void removeEventListener(ScriptGCEventListener*) { }
+    static void getHeapSize(size_t&, size_t&) { }
+};
+
+} // namespace WebCore
+
+#endif // !ENABLE(INSPECTOR)
+#endif // !defined(ScriptGCEvent_h)
diff --git a/WebCore/bindings/js/ScriptObject.cpp b/WebCore/bindings/js/ScriptObject.cpp
index 7948219..16b9f01 100644
--- a/WebCore/bindings/js/ScriptObject.cpp
+++ b/WebCore/bindings/js/ScriptObject.cpp
@@ -64,7 +64,7 @@
 {
     JSLock lock(SilenceAssertionsOnly);
     PutPropertySlot slot;
-    jsObject()->put(m_scriptState, Identifier(m_scriptState, name), jsString(m_scriptState, value), slot);
+    jsObject()->put(m_scriptState, Identifier(m_scriptState, stringToUString(name)), jsString(m_scriptState, stringToUString(value)), slot);
     return handleException(m_scriptState);
 }
 
diff --git a/WebCore/bindings/js/ScriptProfileNode.h b/WebCore/bindings/js/ScriptProfileNode.h
new file mode 100644
index 0000000..b2edcbf
--- /dev/null
+++ b/WebCore/bindings/js/ScriptProfileNode.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * 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:
+ * 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 COMPUTER, 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 ScriptProfileNode_h
+#define ScriptProfileNode_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include <profiler/ProfileNode.h>
+
+namespace WebCore {
+
+typedef JSC::ProfileNode ScriptProfileNode;
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // ScriptProfileNode_h
diff --git a/WebCore/bindings/js/ScriptProfiler.cpp b/WebCore/bindings/js/ScriptProfiler.cpp
index 789e3d3..5121232 100644
--- a/WebCore/bindings/js/ScriptProfiler.cpp
+++ b/WebCore/bindings/js/ScriptProfiler.cpp
@@ -30,18 +30,19 @@
 
 #include "ScriptProfiler.h"
 
+#include "JSDOMBinding.h"
 #include <profiler/Profiler.h>
 
 namespace WebCore {
 
 void ScriptProfiler::start(ScriptState* state, const String& title)
 {
-    JSC::Profiler::profiler()->startProfiling(state, title);
+    JSC::Profiler::profiler()->startProfiling(state, stringToUString(title));
 }
 
 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
 {
-    return JSC::Profiler::profiler()->stopProfiling(state, title);
+    return JSC::Profiler::profiler()->stopProfiling(state, stringToUString(title));
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptState.cpp b/WebCore/bindings/js/ScriptState.cpp
index b9f334a..3edd1bd 100644
--- a/WebCore/bindings/js/ScriptState.cpp
+++ b/WebCore/bindings/js/ScriptState.cpp
@@ -54,7 +54,7 @@
     Frame* frame = document->frame();
     if (!frame)
         return 0;
-    if (!frame->script()->canExecuteScripts())
+    if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         return 0;
     return frame->script()->globalObject(world)->globalExec();
 }
diff --git a/WebCore/bindings/js/ScriptState.h b/WebCore/bindings/js/ScriptState.h
index 0c7c575..6bef4f7 100644
--- a/WebCore/bindings/js/ScriptState.h
+++ b/WebCore/bindings/js/ScriptState.h
@@ -33,23 +33,39 @@
 #define ScriptState_h
 
 #include "JSDOMBinding.h"
+#include <runtime/Protect.h>
+#include <wtf/Noncopyable.h>
 
 namespace WebCore {
-    class DOMWrapperWorld;
-    class Frame;
-    class Node;
-    class Page;
+class DOMWrapperWorld;
+class Frame;
+class Node;
+class Page;
 
-    // The idea is to expose "state-like" methods (hadException, and any other
-    // methods where ExecState just dips into globalData) of JSC::ExecState as a
-    // separate abstraction.
-    // For now, the separation is purely by convention.
-    typedef JSC::ExecState ScriptState;
+// The idea is to expose "state-like" methods (hadException, and any other
+// methods where ExecState just dips into globalData) of JSC::ExecState as a
+// separate abstraction.
+// For now, the separation is purely by convention.
+typedef JSC::ExecState ScriptState;
 
-    ScriptState* mainWorldScriptState(Frame*);
+class ScriptStateProtectedPtr : public Noncopyable {
+public:
+    ScriptStateProtectedPtr() { }
+    ScriptStateProtectedPtr(ScriptState* scriptState) : m_globalObject(scriptState->lexicalGlobalObject()) { }
+    ScriptState* get()
+    {
+        if (m_globalObject)
+            return m_globalObject->globalExec();
+        return 0;
+    }
+private:
+    JSC::ProtectedPtr<JSC::JSGlobalObject> m_globalObject;
+};
 
-    ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
-    ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
+ScriptState* mainWorldScriptState(Frame*);
+
+ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
+ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
 
 } // namespace WebCore
 
diff --git a/WebCore/bindings/js/ScriptString.h b/WebCore/bindings/js/ScriptString.h
index 18964b8..ad0ae95 100644
--- a/WebCore/bindings/js/ScriptString.h
+++ b/WebCore/bindings/js/ScriptString.h
@@ -31,6 +31,7 @@
 #ifndef ScriptString_h
 #define ScriptString_h
 
+#include "JSDOMBinding.h"
 #include "PlatformString.h"
 #include <runtime/UString.h>
 #include <runtime/StringBuilder.h>
@@ -43,9 +44,12 @@
 public:
     ScriptString() {}
     ScriptString(const char* s) : m_str(s) {}
+    ScriptString(const String& s) : m_str(stringToUString(s)) {}
     ScriptString(const JSC::UString& s) : m_str(s) {}
 
     operator JSC::UString() const { return m_str; }
+    operator String() const { return ustringToString(m_str); }
+    const JSC::UString& ustring() const { return m_str; }
 
     bool isNull() const { return m_str.isNull(); }
     size_t size() const { return m_str.size(); }
@@ -60,7 +64,7 @@
     {
         JSC::StringBuilder buffer;
         buffer.append(m_str);
-        buffer.append(s);
+        buffer.append(stringToUString(s));
         m_str = buffer.build();
         return *this;
     }
diff --git a/WebCore/bindings/js/ScriptValue.cpp b/WebCore/bindings/js/ScriptValue.cpp
index 005c329..a52024d 100644
--- a/WebCore/bindings/js/ScriptValue.cpp
+++ b/WebCore/bindings/js/ScriptValue.cpp
@@ -50,7 +50,7 @@
     UString ustring;
     if (!m_value.get().getString(scriptState, ustring))
         return false;
-    result = ustring;
+    result = ustringToString(ustring);
     return true;
 }
 
diff --git a/WebCore/bindings/js/ScriptValue.h b/WebCore/bindings/js/ScriptValue.h
index 9ccb7ac..f4f9c68 100644
--- a/WebCore/bindings/js/ScriptValue.h
+++ b/WebCore/bindings/js/ScriptValue.h
@@ -31,14 +31,15 @@
 #ifndef ScriptValue_h
 #define ScriptValue_h
 
+#include "JSDOMBinding.h"
 #include "PlatformString.h"
 #include "ScriptState.h"
+#include <runtime/JSValue.h>
 #include <runtime/Protect.h>
 #include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
-class String;
 class SerializedScriptValue;
 
 class ScriptValue {
@@ -48,7 +49,7 @@
 
     JSC::JSValue jsValue() const { return m_value.get(); }
     bool getString(ScriptState*, String& result) const;
-    String toString(ScriptState* scriptState) const { return m_value.get().toString(scriptState); }
+    String toString(ScriptState* scriptState) const { return ustringToString(m_value.get().toString(scriptState)); }
     bool isEqual(ScriptState*, const ScriptValue&) const;
     bool isNull() const;
     bool isUndefined() const;
@@ -58,6 +59,8 @@
     PassRefPtr<SerializedScriptValue> serialize(ScriptState*);
     static ScriptValue deserialize(ScriptState*, SerializedScriptValue*);
 
+    static ScriptValue undefined() { return ScriptValue(JSC::jsUndefined()); }
+
 private:
     JSC::ProtectedJSValue m_value;
 };
diff --git a/WebCore/bindings/js/ScriptWrappable.h b/WebCore/bindings/js/ScriptWrappable.h
index d70cab7..5e99c1c 100644
--- a/WebCore/bindings/js/ScriptWrappable.h
+++ b/WebCore/bindings/js/ScriptWrappable.h
@@ -31,11 +31,33 @@
 #ifndef ScriptWrappable_h
 #define ScriptWrappable_h
 
+#include "JSDOMWrapper.h"
+#include <runtime/WeakGCPtr.h>
+
 namespace WebCore {
 
 class ScriptWrappable {
 public:
-    ScriptWrappable() { }
+    ScriptWrappable() : m_wrapper(0) { }
+    
+    DOMObject* wrapper() const
+    {
+        return m_wrapper.get();
+    }
+    
+    void setWrapper(DOMObject* wrapper)
+    {
+        ASSERT(wrapper);
+        m_wrapper = wrapper;
+    }
+    
+    void clearWrapper(DOMObject* wrapper) 
+    { 
+        m_wrapper.clear(wrapper); 
+    }
+    
+private:
+    JSC::WeakGCPtr<DOMObject> m_wrapper;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index fbf8899..e761480 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -56,7 +56,7 @@
     void set(const Identifier& propertyName, const SerializedScriptValueData& value)
     {
         ASSERT(m_names.size() == m_values.size());
-        m_names.append(String(propertyName.ustring()).crossThreadString().impl());
+        m_names.append(identifierToString(propertyName).crossThreadString().impl());
         m_values.append(value);
     }
 
@@ -554,7 +554,7 @@
             return SerializedScriptValueData(value);
 
         if (value.isString())
-            return SerializedScriptValueData(asString(value)->value(m_exec));
+            return SerializedScriptValueData(ustringToString(asString(value)->value(m_exec)));
 
         if (value.isNumber())
             return SerializedScriptValueData(SerializedScriptValueData::NumberType, value.uncheckedGetNumber());
@@ -777,7 +777,7 @@
 
     void putProperty(JSObject* object, const RefPtr<StringImpl> propertyName, JSValue value)
     {
-        object->putDirect(Identifier(m_exec, String(propertyName)), value);
+        object->putDirect(Identifier(m_exec, stringToUString(String(propertyName))), value);
     }
 
     bool startArray(RefPtr<SerializedArray>, JSArray* outArray)
diff --git a/WebCore/bindings/js/StringSourceProvider.h b/WebCore/bindings/js/StringSourceProvider.h
index 770c4fc..478c1d1 100644
--- a/WebCore/bindings/js/StringSourceProvider.h
+++ b/WebCore/bindings/js/StringSourceProvider.h
@@ -29,6 +29,7 @@
 #ifndef StringSourceProvider_h
 #define StringSourceProvider_h
 
+#include "JSDOMBinding.h"
 #include "ScriptSourceProvider.h"
 #include <parser/SourceCode.h>
 
@@ -45,7 +46,7 @@
 
     private:
         StringSourceProvider(const String& source, const String& url)
-            : ScriptSourceProvider(url)
+            : ScriptSourceProvider(stringToUString(url))
             , m_source(source)
         {
         }
diff --git a/WebCore/bindings/js/WebCoreJSClientData.h b/WebCore/bindings/js/WebCoreJSClientData.h
new file mode 100644
index 0000000..5d03328
--- /dev/null
+++ b/WebCore/bindings/js/WebCoreJSClientData.h
@@ -0,0 +1,81 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef WebCoreJSClientData_h
+#define WebCoreJSClientData_h
+
+#include "DOMWrapperWorld.h"
+#include "DOMObjectHashTableMap.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/HashSet.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebCoreJSClientData : public JSC::JSGlobalData::ClientData, public Noncopyable {
+    friend class JSGlobalDataWorldIterator;
+    friend void initNormalWorldClientData(JSC::JSGlobalData*);
+
+public:
+    virtual ~WebCoreJSClientData()
+    {
+        ASSERT(m_worldSet.contains(m_normalWorld.get()));
+        ASSERT(m_worldSet.size() == 1);
+        ASSERT(m_normalWorld->hasOneRef());
+        m_normalWorld.clear();
+        ASSERT(m_worldSet.isEmpty());
+    }
+
+    DOMWrapperWorld* normalWorld() { return m_normalWorld.get(); }
+
+    void getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
+    {
+        copyToVector(m_worldSet, worlds);
+    }
+
+    void rememberWorld(DOMWrapperWorld* world)
+    {
+        ASSERT(!m_worldSet.contains(world));
+        m_worldSet.add(world);
+    }
+    void forgetWorld(DOMWrapperWorld* world)
+    {
+        ASSERT(m_worldSet.contains(world));
+        m_worldSet.remove(world);
+    }
+
+    DOMObjectHashTableMap hashTableMap;
+
+private:
+    HashSet<DOMWrapperWorld*> m_worldSet;
+    RefPtr<DOMWrapperWorld> m_normalWorld;
+};
+
+inline void initNormalWorldClientData(JSC::JSGlobalData* globalData)
+{
+    WebCoreJSClientData* webCoreJSClientData = new WebCoreJSClientData;
+    globalData->clientData = webCoreJSClientData; // ~JSGlobalData deletes this pointer.
+    webCoreJSClientData->m_normalWorld = DOMWrapperWorld::create(globalData, true);
+}
+
+} // namespace WebCore
+
+#endif // WebCoreJSClientData_h
diff --git a/WebCore/bindings/js/WorkerScriptController.cpp b/WebCore/bindings/js/WorkerScriptController.cpp
index adcc089..85d6861 100644
--- a/WebCore/bindings/js/WorkerScriptController.cpp
+++ b/WebCore/bindings/js/WorkerScriptController.cpp
@@ -30,11 +30,11 @@
 
 #include "WorkerScriptController.h"
 
-#include "JSDOMBinding.h"
 #include "JSDedicatedWorkerContext.h"
 #include "JSSharedWorkerContext.h"
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
+#include "WebCoreJSClientData.h"
 #include "WorkerContext.h"
 #include "WorkerObjectProxy.h"
 #include "WorkerThread.h"
@@ -48,11 +48,11 @@
 namespace WebCore {
 
 WorkerScriptController::WorkerScriptController(WorkerContext* workerContext)
-    : m_globalData(JSGlobalData::create())
+    : m_globalData(JSGlobalData::create(ThreadStackTypeSmall))
     , m_workerContext(workerContext)
     , m_executionForbidden(false)
 {
-    m_globalData->clientData = new WebCoreJSClientData(m_globalData.get());
+    initNormalWorldClientData(m_globalData.get());
 }
 
 WorkerScriptController::~WorkerScriptController()
@@ -136,15 +136,16 @@
     m_workerContextWrapper->globalExec()->setException(exception.jsValue());
 }
 
-void WorkerScriptController::forbidExecution()
+void WorkerScriptController::forbidExecution(ForbidExecutionOption option)
 {
-    // This function is called from another thread.
+    // This function may be called from another thread.
     // Mutex protection for m_executionForbidden is needed to guarantee that the value is synchronized between processors, because
     // if it were not, the worker could re-enter JSC::evaluate(), but with timeout already reset.
-    // It is not critical for Interpreter::m_timeoutTime to be synchronized, we just rely on it reaching the worker thread's processor sooner or later.
+    // It is not critical for Terminator::m_shouldTerminate to be synchronized, we just rely on it reaching the worker thread's processor sooner or later.
     MutexLocker lock(m_sharedDataMutex);
     m_executionForbidden = true;
-    m_globalData->timeoutChecker.setTimeoutInterval(1); // 1ms is the smallest timeout that can be set.
+    if (option == TerminateRunningScript)
+        m_globalData->terminator.terminateSoon();
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/WorkerScriptController.h b/WebCore/bindings/js/WorkerScriptController.h
index c820cd9..38c3c30 100644
--- a/WebCore/bindings/js/WorkerScriptController.h
+++ b/WebCore/bindings/js/WorkerScriptController.h
@@ -52,6 +52,9 @@
 
         JSWorkerContext* workerContextWrapper()
         {
+            if (m_executionForbidden)
+                return 0;
+
             initScriptIfNeeded();
             return m_workerContextWrapper;
         }
@@ -61,7 +64,8 @@
 
         void setException(ScriptValue);
 
-        void forbidExecution();
+        enum ForbidExecutionOption { TerminateRunningScript, LetRunningScriptFinish };
+        void forbidExecution(ForbidExecutionOption);
 
         JSC::JSGlobalData* globalData() { return m_globalData.get(); }
 
diff --git a/WebCore/bindings/objc/DOM.mm b/WebCore/bindings/objc/DOM.mm
index 907961f..378efe2 100644
--- a/WebCore/bindings/objc/DOM.mm
+++ b/WebCore/bindings/objc/DOM.mm
@@ -37,6 +37,7 @@
 #import "Frame.h"
 #import "HTMLElement.h"
 #import "HTMLNames.h"
+#import "Image.h"
 #import "NodeFilter.h"
 #import "RenderImage.h"
 #import "WebScriptObjectPrivate.h"
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index d7bc90c..618459a 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -33,6 +33,9 @@
 #import "Frame.h"
 #import "JSDOMWindow.h"
 #import "JSDOMWindowCustom.h"
+#import "JSHTMLElement.h"
+#import "JSPluginElementFunctions.h"
+#import "ObjCRuntimeObject.h"
 #import "PlatformString.h"
 #import "StringSourceProvider.h"
 #import "WebCoreObjCExtras.h"
@@ -286,7 +289,7 @@
     ExecState* exec = [self _rootObject]->globalObject()->globalExec();
     ASSERT(!exec->hadException());
 
-    JSValue function = [self _imp]->get(exec, Identifier(exec, String(name)));
+    JSValue function = [self _imp]->get(exec, Identifier(exec, stringToUString(String(name))));
     CallData callData;
     CallType callType = function.getCallData(callData);
     if (callType == CallTypeNone)
@@ -363,7 +366,7 @@
     JSLock lock(SilenceAssertionsOnly);
 
     PutPropertySlot slot;
-    [self _imp]->put(exec, Identifier(exec, String(key)), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot);
+    [self _imp]->put(exec, Identifier(exec, stringToUString(String(key))), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot);
 
     if (exec->hadException()) {
         addExceptionToConsole(exec);
@@ -388,7 +391,7 @@
         // leaving the lock permanently held
         JSLock lock(SilenceAssertionsOnly);
         
-        JSValue result = [self _imp]->get(exec, Identifier(exec, String(key)));
+        JSValue result = [self _imp]->get(exec, Identifier(exec, stringToUString(String(key))));
         
         if (exec->hadException()) {
             addExceptionToConsole(exec);
@@ -417,7 +420,7 @@
     ASSERT(!exec->hadException());
 
     JSLock lock(SilenceAssertionsOnly);
-    [self _imp]->deleteProperty(exec, Identifier(exec, String(key)));
+    [self _imp]->deleteProperty(exec, Identifier(exec, stringToUString(String(key))));
 
     if (exec->hadException()) {
         addExceptionToConsole(exec);
@@ -508,18 +511,17 @@
 {
     if (value.isObject()) {
         JSObject* object = asObject(value);
-        ExecState* exec = rootObject->globalObject()->globalExec();
         JSLock lock(SilenceAssertionsOnly);
-        
-        if (object->classInfo() != &RuntimeObjectImp::s_info) {
-            JSValue runtimeObject = object->get(exec, Identifier(exec, "__apple_runtime_object"));
-            if (runtimeObject && runtimeObject.isObject())
-                object = asObject(runtimeObject);
-        }
 
-        if (object->classInfo() == &RuntimeObjectImp::s_info) {
-            RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
-            ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
+        if (object->inherits(&JSHTMLElement::s_info)) {
+            // Plugin elements cache the instance internally.
+            HTMLElement* el = static_cast<JSHTMLElement*>(object)->impl();
+            ObjcInstance* instance = static_cast<ObjcInstance*>(pluginInstance(el));
+            if (instance)
+                return instance->getObject();
+        } else if (object->inherits(&ObjCRuntimeObject::s_info)) {
+            ObjCRuntimeObject* runtimeObject = static_cast<ObjCRuntimeObject*>(object);
+            ObjcInstance* instance = runtimeObject->getInternalObjCInstance();
             if (instance)
                 return instance->getObject();
             return nil;
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index 506e8ea..487a4b3 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -17,7 +17,7 @@
 # Library General Public License for more details.
 #
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 #
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
new file mode 100644
index 0000000..2a38eff
--- /dev/null
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -0,0 +1,1086 @@
+# Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+# Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
+# Copyright (C) 2008 Alp Toker <alp@atoker.com>
+# Copyright (C) 2009 Adam Dingle <adam@yorba.org>
+# Copyright (C) 2009 Jim Nelson <jim@yorba.org>
+# Copyright (C) 2009, 2010 Igalia S.L.
+#
+# 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+package CodeGeneratorGObject;
+
+# Global Variables
+my %implIncludes = ();
+my %hdrIncludes = ();
+
+my $className = "";
+
+# Default constructor
+sub new {
+    my $object = shift;
+    my $reference = { };
+
+    $codeGenerator = shift;
+    $outputDir = shift;
+    mkdir $outputDir;
+
+    bless($reference, $object);
+}
+
+sub finish {
+}
+
+my $licenceTemplate = << "EOF";
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    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.
+*/
+EOF
+
+sub GenerateModule {
+}
+
+sub GetParentClassName {
+    my $dataNode = shift;
+
+    return "WebKitDOMObject" if @{$dataNode->parents} eq 0;
+    return "WebKitDOM" . $codeGenerator->StripModule($dataNode->parents(0));
+}
+
+# From String::CamelCase 0.01
+sub camelize
+{
+        my $s = shift;
+        join('', map{ ucfirst $_ } split(/(?<=[A-Za-z])_(?=[A-Za-z])|\b/, $s));
+}
+
+sub decamelize
+{
+        my $s = shift;
+        $s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{
+                my $fc = pos($s)==0;
+                my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4);
+                my $t = $p0 || $fc ? $p0 : '_';
+                $t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : "$p1$p2";
+                $t;
+        }ge;
+        $s;
+}
+
+sub ClassNameToGObjectType {
+    my $className = shift;
+    my $CLASS_NAME = uc(decamelize($className));
+    # Fixup: with our prefix being 'WebKitDOM' decamelize can't get
+    # WebKitDOMCSS right, so we have to fix it manually (and there
+    # might be more like this in the future)
+    $CLASS_NAME =~ s/DOMCSS/DOM_CSS/;
+    return $CLASS_NAME;
+}
+
+sub GetParentGObjType {
+    my $dataNode = shift;
+
+    return "WEBKIT_TYPE_DOM_OBJECT" if @{$dataNode->parents} eq 0;
+    return "WEBKIT_TYPE_DOM_" . ClassNameToGObjectType($codeGenerator->StripModule($dataNode->parents(0)));
+}
+
+sub GetClassName {
+    my $name = $codeGenerator->StripModule(shift);
+
+    return "WebKitDOM$name";
+}
+
+sub GetCoreObject {
+    my ($interfaceName, $name, $parameter) = @_;
+
+    return "WebCore::${interfaceName}* $name = WebKit::core($parameter);";
+}
+
+sub SkipAttribute {
+    my $attribute = shift;
+    
+    if ($attribute->signature->extendedAttributes->{"CustomGetter"} ||
+        $attribute->signature->extendedAttributes->{"CustomSetter"}) {
+        return 1;
+    }
+    
+    my $propType = $attribute->signature->type;
+    if ($propType eq "EventListener") {
+        return 1;
+    }
+
+    if ($propType =~ /Constructor$/) {
+        return 1;
+    }
+
+    return 0;
+}
+
+# Name type used in the g_value_{set,get}_* functions
+sub GetGValueTypeName {
+    my $type = shift;
+
+    my %types = ("DOMString", "string",
+                 "float", "float",
+                 "double", "double",
+                 "boolean", "boolean",
+                 "char", "char",
+                 "long", "long",
+                 "short", "int",
+                 "uchar", "uchar",
+                 "unsigned", "uint",
+                 "int", "int",
+                 "unsigned int", "uint",
+                 "unsigned long long", "uint64", 
+                 "unsigned long", "ulong",
+                 "unsigned short", "ushort");
+
+    return $types{$type} ? $types{$type} : "object";
+}
+
+# Name type used in C declarations
+sub GetGlibTypeName {
+    my $type = shift;
+    my $name = GetClassName($type);
+
+    my %types = ("DOMString", "gchar* ",
+                 "float", "gfloat",
+                 "double", "gdouble",
+                 "boolean", "gboolean",
+                 "char", "gchar",
+                 "long", "glong",
+                 "short", "gshort",
+                 "uchar", "guchar",
+                 "unsigned", "guint",
+                 "int", "gint",
+                 "unsigned int", "guint",
+                 "unsigned long", "gulong",
+                 "unsigned long long", "guint64",
+                 "unsigned short", "gushort",
+                 "void", "void");
+
+    return $types{$type} ? $types{$type} : "$name* ";
+}
+
+sub IsGDOMClassType {
+    my $type = shift;
+
+    return 0 if $type eq "DOMString";
+    return 0 if $type eq "float";
+    return 0 if $type eq "double";
+    return 0 if $type eq "boolean";
+    return 0 if $type eq "char";
+    return 0 if $type eq "long";
+    return 0 if $type eq "short";
+    return 0 if $type eq "uchar";
+    return 0 if $type eq "unsigned";
+    return 0 if $type eq "int";
+    return 0 if $type eq "unsigned int";
+    return 0 if $type eq "unsigned long";
+    return 0 if $type eq "unsigned long long";
+    return 0 if $type eq "unsigned short";
+    return 0 if $type eq "void";
+
+    return 1;
+}
+
+sub GenerateProperties {
+    my ($object, $interfaceName, $dataNode) = @_;
+
+    my $clsCaps = substr(ClassNameToGObjectType($className), 12);
+    my $lowerCaseIfaceName = "webkit_dom_" . (decamelize($interfaceName));
+
+    # Properties
+    my $implContent = "";
+
+    # Properties
+    $implContent = << "EOF";
+enum {
+    PROP_0,
+EOF
+    push(@cBodyPriv, $implContent);
+
+    my @txtInstallProps = ();
+    my @txtSetProps = ();
+    my @txtGetProps = ();
+
+    my $privFunction = GetCoreObject($interfaceName, "coreSelf", "self");
+
+    my $txtGetProp = << "EOF";
+static void ${lowerCaseIfaceName}_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+    ${className}* self = WEBKIT_DOM_${clsCaps}(object);
+    $privFunction
+
+    switch (prop_id) {
+EOF
+    push(@txtGetProps, $txtGetProp);
+
+    my $txtSetProps = << "EOF";
+static void ${lowerCaseIfaceName}_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+    ${className} *self = WEBKIT_DOM_${clsCaps}(object);
+    $privFunction
+
+    switch (prop_id) {
+EOF
+    push(@txtSetProps, $txtSetProps);
+
+    # Iterate over the interface attributes and generate a property for
+    # each one of them.
+  SKIPENUM:
+    foreach my $attribute (@{$dataNode->attributes}) {
+        if (SkipAttribute($attribute)) {
+            next SKIPENUM;
+        }
+
+        my $camelPropName = $attribute->signature->name;
+        my $setPropNameFunction = $codeGenerator->WK_ucfirst($camelPropName);
+        my $getPropNameFunction = $codeGenerator->WK_lcfirst($camelPropName);
+
+        my $propName = decamelize($camelPropName);
+        my $propNameCaps = uc($propName);
+        $propName =~ s/_/-/g;
+        my ${propEnum} = "PROP_${propNameCaps}";
+        push(@cBodyPriv, "    ${propEnum},\n");
+
+        my $propType = $attribute->signature->type;
+        my ${propGType} = decamelize($propType);
+        if ($propGType eq "event_target") {
+            $propGType = "event_target_node";
+        }
+        my ${ucPropGType} = uc($propGType);
+
+        my $gtype = GetGValueTypeName($propType);
+        my $gparamflag = "WEBKIT_PARAM_READABLE";
+        my $writeable = $attribute->type !~ /^readonly/;
+        my $const = "read-only ";
+        if ($writeable && $custom) {
+            $const = "read-only (due to custom functions needed in webkitdom)";
+            next SKIPENUM;
+        }
+        if ($writeable && !$custom) {
+            $gparamflag = "WEBKIT_PARAM_READWRITE";
+            $const = "read-write ";
+        }
+
+        my $type = GetGlibTypeName($propType);
+        $nick = decamelize("${interfaceName}_${propName}");
+        $long = "${const} ${type} ${interfaceName}.${propName}";
+
+        my $convertFunction = "";
+
+        if ($writeable && ($gtype eq "boolean" || $gtype eq "float" || $gtype eq "double" ||
+                           $gtype eq "uint64" || $gtype eq "ulong" || $gtype eq "long" || 
+                           $gtype eq "uint" || $gtype eq "ushort" || $gtype eq "uchar" ||
+                           $gtype eq "char" || $gtype eq "string")) {
+
+            push(@txtSetProps, "   case ${propEnum}:\n    {\n");
+            push(@txtSetProps, "        WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
+
+            if ($gtype eq "string") {
+                $convertFunction = "WebCore::String::fromUTF8";
+            } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
+                $convertFunction = "WebCore::String::number";
+            }
+
+            push(@txtSetProps, "        coreSelf->set${setPropNameFunction}(${convertFunction}(g_value_get_$gtype(value))");
+            push(@txtSetProps, ", ec") if @{$attribute->setterExceptions};
+            push(@txtSetProps, ");\n");
+
+            push(@txtSetProps, "        break;\n    }\n");
+        }
+
+        push(@txtGetProps, "   case ${propEnum}:\n    {\n");
+
+        my $exception = "";
+        if (@{$attribute->getterExceptions}) {
+            $exception = "ec";
+            push(@txtGetProps, "        WebCore::ExceptionCode ec = 0;\n");
+        }
+
+        my $postConvertFunction = "";
+        my $done = 0;
+        if ($gtype eq "string") {
+            push(@txtGetProps, "        g_value_take_string(value, convertToUTF8String(coreSelf->${getPropNameFunction}(${exception})));\n");
+            $done = 1;
+        } elsif ($gtype eq "object") {
+
+            $txtGetProp = << "EOF";
+        RefPtr<WebCore::${propType}> ptr = coreSelf->${getPropNameFunction}(${exception});
+        g_value_set_object(value, WebKit::kit(ptr.get()));
+EOF
+            push(@txtGetProps, $txtGetProp);
+
+            $done = 1;
+        }
+
+        if($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
+            # TODO: Add other conversion functions for different types.  Current
+            # IDLs only list longs.
+            if($gtype eq "long") {
+                $convertFunction = "";
+                $postConvertFunction = ".toInt()";
+            } else {
+                die "Can't convert to type ${gtype}.";
+            }
+        }
+
+        # FIXME: get rid of this glitch?
+        my $_gtype = $gtype;
+        if ($gtype eq "ushort") {
+            $_gtype = "uint";
+        }
+
+        if (!$done) {
+            push(@txtGetProps, "        g_value_set_$_gtype(value, ${convertFunction}coreSelf->${getPropNameFunction}(${exception})${postConvertFunction});\n");
+        }
+
+        push(@txtGetProps, "        break;\n    }\n");
+
+my %param_spec_options = ("int", "G_MININT, /* min */\nG_MAXINT, /* max */\n0, /* default */",
+                          "boolean", "FALSE, /* default */",
+                          "float", "G_MINFLOAT, /* min */\nG_MAXFLOAT, /* max */\n0.0, /* default */",
+                          "double", "G_MINDOUBLE, /* min */\nG_MAXDOUBLE, /* max */\n0.0, /* default */",
+                          "uint64", "0, /* min */\nG_MAXUINT64, /* min */\n0, /* default */",
+                          "long", "G_MINLONG, /* min */\nG_MAXLONG, /* max */\n0, /* default */",
+                          "ulong", "0, /* min */\nG_MAXULONG, /* max */\n0, /* default */",
+                          "uint", "0, /* min */\nG_MAXUINT, /* max */\n0, /* default */",
+                          "ushort", "0, /* min */\nG_MAXUINT16, /* max */\n0, /* default */",
+                          "uchar", "G_MININT8, /* min */\nG_MAXINT8, /* max */\n0, /* default */",
+                          "char", "0, /* min */\nG_MAXUINT8, /* max */\n0, /* default */",
+                          "string", "\"\", /* default */",
+                          "object", "WEBKIT_TYPE_DOM_${ucPropGType}, /* gobject type */");
+
+        my $txtInstallProp = << "EOF";
+    g_object_class_install_property(gobjectClass,
+                                    ${propEnum},
+                                    g_param_spec_${_gtype}("${propName}", /* name */
+                                                           "$nick", /* short description */
+                                                           "$long", /* longer - could do with some extra doc stuff here */
+                                                           $param_spec_options{$gtype}
+                                                           ${gparamflag}));
+EOF
+        push(@txtInstallProps, $txtInstallProp);
+        $txtInstallProp = "/* TODO! $gtype */\n";
+    }
+
+    push(@cBodyPriv, "};\n\n");
+
+    $txtGetProp = << "EOF";
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+EOF
+    push(@txtGetProps, $txtGetProp);
+
+    $txtSetProps = << "EOF";
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+EOF
+    push(@txtSetProps, $txtSetProps);
+
+    # TODO: work out if it's appropriate to split this into many different
+    # signals e.g. "click" etc.
+    my $txtInstallSignals = "";
+
+    $implContent = << "EOF";
+
+static void ${lowerCaseIfaceName}_finalize(GObject* object)
+{
+    WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+    
+    if (dom_object->coreObject != NULL) {
+        WebCore::${interfaceName}* coreObject = static_cast<WebCore::${interfaceName} *>(dom_object->coreObject);
+
+        WebKit::DOMObjectCache::forget(coreObject);
+        coreObject->deref();
+
+        dom_object->coreObject = NULL;
+    }
+
+    G_OBJECT_CLASS(${lowerCaseIfaceName}_parent_class)->finalize(object);
+}
+
+@txtSetProps
+
+@txtGetProps
+
+static void ${lowerCaseIfaceName}_class_init(${className}Class* requestClass)
+{
+    GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+    gobjectClass->finalize = ${lowerCaseIfaceName}_finalize;
+    gobjectClass->set_property = ${lowerCaseIfaceName}_set_property;
+    gobjectClass->get_property = ${lowerCaseIfaceName}_get_property;
+
+@txtInstallProps
+
+$txtInstallSignals
+}
+
+static void ${lowerCaseIfaceName}_init(${className}* request)
+{
+}
+
+EOF
+    push(@cBodyPriv, $implContent);
+}
+
+sub GenerateHeader {
+    my ($object, $interfaceName, $parentClassName) = @_;
+
+    my $implContent = "";
+
+    # Add the default header template
+    @hPrefix = split("\r", $licenceTemplate);
+    push(@hPrefix, "\n");
+
+    #Header guard
+    my $guard = $className . "_h";
+
+    @hPrefixGuard = << "EOF";
+#ifndef $guard
+#define $guard
+
+EOF
+
+    $implContent = << "EOF";
+G_BEGIN_DECLS
+EOF
+
+    push(@hBodyPre, $implContent);
+
+    my $clsCaps = uc(decamelize($interfaceName));
+    my $lowerCaseIfaceName = "webkit_dom_" . (decamelize($interfaceName));
+
+    $implContent = << "EOF";
+
+#define WEBKIT_TYPE_DOM_${clsCaps}            (${lowerCaseIfaceName}_get_type())
+#define WEBKIT_DOM_${clsCaps}(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_${clsCaps}, ${className}))
+#define WEBKIT_DOM_${clsCaps}_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_DOM_${clsCaps}, ${className}Class)
+#define WEBKIT_DOM_IS_${clsCaps}(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_${clsCaps}))
+#define WEBKIT_DOM_IS_${clsCaps}_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_DOM_${clsCaps}))
+#define WEBKIT_DOM_${clsCaps}_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_DOM_${clsCaps}, ${className}Class))
+
+struct _${className} {
+    ${parentClassName} parent_instance;
+};
+
+struct _${className}Class {
+    ${parentClassName}Class parent_class;
+};
+
+WEBKIT_API GType
+${lowerCaseIfaceName}_get_type (void);
+
+EOF
+
+    push(@hBody, $implContent);
+}
+
+sub getIncludeHeader {
+    my $type = shift;
+    my $name = GetClassName($type);
+
+    return "" if $type eq "int";
+    return "" if $type eq "long";
+    return "" if $type eq "short";
+    return "" if $type eq "char";
+    return "" if $type eq "float";
+    return "" if $type eq "double";
+    return "" if $type eq "unsigned";
+    return "" if $type eq "unsigned int";
+    return "" if $type eq "unsigned long";
+    return "" if $type eq "unsigned long long";
+    return "" if $type eq "unsigned short";
+    return "" if $type eq "DOMTimeStamp";
+    return "" if $type eq "EventListener";
+    return "" if $type eq "unsigned char";
+    return "" if $type eq "DOMString";
+    return "" if $type eq "float";
+    return "" if $type eq "boolean";
+    return "" if $type eq "void";
+
+    return "$name.h";
+}
+
+sub addIncludeInBody {
+    my $type = shift;
+
+    my $header = getIncludeHeader($type);
+    if ($header eq "") {
+        return;
+    }
+    
+    if (IsGDOMClassType($type)) {
+        $implIncludes{"webkit/$header"} = 1;
+    } else {
+        $implIncludes{$header} = 1
+    }
+}
+
+sub GenerateFunction {
+    my ($object, $interfaceName, $function, $prefix) = @_;
+
+    my $functionSigName = $function->signature->name;
+    my $functionSigType = $function->signature->type;
+    my $functionName = "webkit_dom_" . decamelize($interfaceName) . "_" . $prefix . decamelize($functionSigName);
+    my $returnType = GetGlibTypeName($functionSigType);
+    my $returnValueIsGDOMType = IsGDOMClassType($functionSigType);
+
+    my $functionSig = "$className *self";
+
+    my $callImplParams = "";
+
+    # skip some custom functions for now
+    my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} ||
+                       $function->signature->extendedAttributes->{"CustomArgumentHandling"};
+
+    foreach my $param (@{$function->parameters}) {
+        my $paramIDLType = $param->type;
+        if ($paramIDLType eq "Event") {
+            push(@hBody, "\n/* TODO: event function ${functionName} */\n\n");
+            push(@cBody, "\n/* TODO: event function ${functionName} */\n\n");
+            return;
+        }
+        addIncludeInBody($paramIDLType);
+        my $paramType = GetGlibTypeName($paramIDLType);
+        my $paramName = decamelize($param->name);
+
+        $functionSig .= ", $paramType $paramName";
+
+        my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
+        if ($paramIsGDOMType) {
+            if ($paramIDLType ne "DOMObject") {
+                $implIncludes{"webkit/WebKitDOM${paramIDLType}Private.h"} = 1;
+            }
+        }
+        if ($paramIsGDOMType || ($paramIDLType eq "DOMString")) {
+            $paramName = "_g_" . $paramName;
+        }
+        if ($callImplParams) {
+            $callImplParams .= ", $paramName";
+        } else {
+            $callImplParams = "$paramName";
+        }
+    }
+
+    if ($functionSigType eq "Event") {
+        push(@hBody, "\n/* TODO: event function ${functionName} */\n\n");
+        push(@cBody, "\n/* TODO: event function ${functionName} */\n\n");
+        return;
+    }
+
+    if ($returnType ne "void" && $returnValueIsGDOMType) {
+        if ($functionSigType ne "EventTarget") {
+            $implIncludes{"webkit/WebKitDOM${functionSigType}Private.h"} = 1;
+            $implIncludes{"webkit/WebKitDOM${functionSigType}.h"} = 1;
+        }
+
+        $implIncludes{"${functionSigType}.h"} = 1;
+    }
+
+    # skip custom functions for now
+    # but skip from here to allow some headers to be created
+    # for a successful compile.
+    if ($isCustomFunction &&
+        $functionName ne "webkit_dom_node_remove_child" && 
+        $functionName ne "webkit_dom_node_insert_before" &&
+        $functionName ne "webkit_dom_node_replace_child" &&
+        $functionName ne "webkit_dom_node_append_child") {
+        push(@hBody, "\n/* TODO: custom function ${functionName} */\n\n");
+        push(@cBody, "\n/* TODO: custom function ${functionName} */\n\n");
+        return;
+    }
+
+    if(@{$function->raisesExceptions}) {
+        $functionSig .= ", GError **error";
+    }
+
+    push(@hBody, "WEBKIT_API $returnType\n$functionName ($functionSig);\n\n");
+    push(@cBody, "$returnType\n$functionName ($functionSig)\n{\n");
+
+    if ($returnType ne "void") {
+        # TODO: return proper default result
+        push(@cBody, "    g_return_val_if_fail (self, 0);\n");
+    } else {
+        push(@cBody, "    g_return_if_fail (self);\n");
+    }
+
+    # The WebKit::core implementations check for NULL already; no need to
+    # duplicate effort.
+    push(@cBody, "    WebCore::${interfaceName} * item = WebKit::core(self);\n");
+
+    foreach my $param (@{$function->parameters}) {
+        my $paramName = decamelize($param->name);
+        my $paramIDLType = $param->type;
+        my $paramTypeIsPrimitive = $codeGenerator->IsPrimitiveType($paramIDLType);
+        my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
+        if (!$paramTypeIsPrimitive) {
+            if ($returnType ne "void") {
+                # TODO: return proper default result
+                push(@cBody, "    g_return_val_if_fail ($paramName, 0);\n");
+            } else {
+                push(@cBody, "    g_return_if_fail ($paramName);\n");
+            }
+        }
+    }
+
+    $returnParamName = "";
+    foreach my $param (@{$function->parameters}) {
+        my $paramIDLType = $param->type;
+        my $paramName = decamelize($param->name);
+
+        my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
+        if ($paramIDLType eq "DOMString") {
+            push(@cBody, "    WebCore::String _g_${paramName} = WebCore::String::fromUTF8($paramName);\n");
+        }
+        if ($paramIsGDOMType) {
+            push(@cBody, "    WebCore::${paramIDLType} * _g_${paramName} = WebKit::core($paramName);\n");
+            if ($returnType ne "void") {
+                # TODO: return proper default result
+                push(@cBody, "    g_return_val_if_fail (_g_${paramName}, 0);\n");
+            } else {
+                push(@cBody, "    g_return_if_fail (_g_${paramName});\n");
+            }
+        }
+        $returnParamName = "_g_".$paramName if $param->extendedAttributes->{"Return"};
+    }
+
+    my $assign = "";
+    my $assignPre = "";
+    my $assignPost = "";
+
+    if ($returnType ne "void" && !$isCustomFunction) {
+        if ($returnValueIsGDOMType) {
+            $assign = "PassRefPtr<WebCore::${functionSigType}> g_res = ";
+            $assignPre = "WTF::getPtr(";
+            $assignPost = ")";
+        } else {
+            $assign = "${returnType} res = ";
+        }
+    }
+    my $exceptions = "";
+    if (@{$function->raisesExceptions}) {
+        push(@cBody, "    WebCore::ExceptionCode ec = 0;\n");
+        if (${callImplParams} ne "") {
+            $exceptions = ", ec";
+        } else {
+            $exceptions = "ec";
+        }
+    }
+
+    # We need to special-case these Node methods because their C++ signature is different
+    # from what we'd expect given their IDL description; see Node.h.
+    if ($functionName eq "webkit_dom_node_append_child" ||
+        $functionName eq "webkit_dom_node_insert_before" ||
+        $functionName eq "webkit_dom_node_replace_child" ||
+        $functionName eq "webkit_dom_node_remove_child") {
+        my $customNodeAppendChild = << "EOF";
+    bool ok = item->${functionSigName}(${callImplParams}${exceptions});
+    if (ok)
+    {
+        ${returnType} res = static_cast<${returnType}>(WebKit::kit($returnParamName));
+        return res;
+    }
+EOF
+        push(@cBody, $customNodeAppendChild);
+    
+        if(@{$function->raisesExceptions}) {
+            my $exceptionHandling = << "EOF";
+
+    WebCore::ExceptionCodeDescription ecdesc;
+    WebCore::getExceptionCodeDescription(ec, ecdesc);
+    g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+EOF
+            push(@cBody, $exceptionHandling);
+        }
+        push(@cBody, "return NULL;");
+        push(@cBody, "}\n\n");
+        return;
+    } elsif ($functionSigType eq "DOMString") {
+        push(@cBody, "    ${assign}convertToUTF8String(item->${functionSigName}(${callImplParams}${exceptions}));\n" );
+    } else {
+        push(@cBody, "    ${assign}${assignPre}item->${functionSigName}(${callImplParams}${exceptions}${assignPost});\n" );
+        
+        if(@{$function->raisesExceptions}) {
+            my $exceptionHandling = << "EOF";
+    if(ec) {
+        WebCore::ExceptionCodeDescription ecdesc;
+        WebCore::getExceptionCodeDescription(ec, ecdesc);
+        g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+    }
+EOF
+            push(@cBody, $exceptionHandling);
+        }
+    }
+
+    if ($returnType ne "void" && !$isCustomFunction) {
+        if ($functionSigType ne "DOMObject") {
+            if ($returnValueIsGDOMType) {
+                push(@cBody, "    ${returnType} res = static_cast<${returnType}>(WebKit::kit(g_res.get()));\n");
+            }
+        }
+        if ($functionSigType eq "DOMObject") {
+            push(@cBody, "    return NULL; /* TODO: return canvas object */\n");
+        } else {
+            push(@cBody, "    return res;\n");
+        }
+    }
+    push(@cBody, "\n}\n\n");
+}
+
+sub ClassHasFunction {
+    my ($class, $name) = @_;
+
+    foreach my $function (@{$class->functions}) {
+        if ($function->signature->name eq $name) {
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+sub GenerateFunctions {
+    my ($object, $interfaceName, $dataNode) = @_;
+
+    foreach my $function (@{$dataNode->functions}) {
+        $object->GenerateFunction($interfaceName, $function, "");
+    }
+
+    TOP:
+    foreach my $attribute (@{$dataNode->attributes}) {
+        if (SkipAttribute($attribute)) {
+            next TOP;
+        }
+        
+        if ($attribute->signature->name eq "type"
+            # This will conflict with the get_type() function we define to return a GType
+            # according to GObject conventions.  Skip this for now.
+            || $attribute->signature->name eq "URL"     # TODO: handle this
+            || $attribute->signature->extendedAttributes->{"ConvertFromString"}    # TODO: handle this
+            ) {
+            next TOP;
+        }
+            
+        my $attrNameUpper = $codeGenerator->WK_ucfirst($attribute->signature->name);
+        my $getname = "get${attrNameUpper}";
+        my $setname = "set${attrNameUpper}";
+        if (ClassHasFunction($dataNode, $getname) || ClassHasFunction($dataNode, $setname)) {
+            # Very occasionally an IDL file defines getter/setter functions for one of its
+            # attributes; in this case we don't need to autogenerate the getter/setter.
+            next TOP;
+        }
+        
+        # Generate an attribute getter.  For an attribute "foo", this is a function named
+        # "get_foo" which calls a DOM class method named foo().
+        my $function = new domFunction();
+        $function->signature($attribute->signature);
+        $function->raisesExceptions($attribute->getterExceptions);
+        $object->GenerateFunction($interfaceName, $function, "get_");
+        
+        if ($attribute->type =~ /^readonly/ ||
+            $attribute->signature->extendedAttributes->{"Replaceable"}  # can't handle this yet
+            ) {
+            next TOP;
+        }
+        
+        # Generate an attribute setter.  For an attribute, "foo", this is a function named
+        # "set_foo" which calls a DOM class method named setFoo().
+        $function = new domFunction();
+        
+        $function->signature(new domSignature());
+        $function->signature->name($setname);
+        $function->signature->type("void");
+        $function->signature->extendedAttributes($attribute->signature->extendedAttributes);
+        
+        my $param = new domSignature();
+        $param->name("value");
+        $param->type($attribute->signature->type);
+        my %attributes = ();
+        $param->extendedAttributes(attributes);
+        my $arrayRef = $function->parameters;
+        push(@$arrayRef, $param);
+        
+        $function->raisesExceptions($attribute->setterExceptions);
+        
+        $object->GenerateFunction($interfaceName, $function, "");
+    }
+}
+
+sub GenerateCFile {
+    my ($object, $interfaceName, $parentClassName, $parentGObjType, $dataNode) = @_;
+    my $implContent = "";
+
+    my $clsCaps = uc(decamelize($interfaceName));
+    my $lowerCaseIfaceName = "webkit_dom_" . decamelize($interfaceName);
+
+    $implContent = << "EOF";
+G_DEFINE_TYPE(${className}, ${lowerCaseIfaceName}, ${parentGObjType})
+
+namespace WebKit {
+
+${className}* wrap${interfaceName}(WebCore::${interfaceName}* coreObject)
+{
+    g_return_val_if_fail(coreObject != 0, 0);
+    
+    ${className}* wrapper = WEBKIT_DOM_${clsCaps}(g_object_new(WEBKIT_TYPE_DOM_${clsCaps}, NULL));
+    g_return_val_if_fail(wrapper != 0, 0);
+
+    /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+     * in a C-allocated GObject structure.  See the finalize() code for the
+     * matching deref().
+     */
+
+    coreObject->ref();
+    WEBKIT_DOM_OBJECT(wrapper)->coreObject = coreObject;
+
+    return wrapper;
+}
+
+WebCore::${interfaceName}* core(${className}* request)
+{
+    g_return_val_if_fail(request != 0, 0);
+    
+    WebCore::${interfaceName}* coreObject = static_cast<WebCore::${interfaceName}*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+    g_return_val_if_fail(coreObject != 0, 0);
+    
+    return coreObject;
+}
+
+} // namespace WebKit
+EOF
+
+    push(@cBodyPriv, $implContent);
+    $object->GenerateProperties($interfaceName, $dataNode);
+    $object->GenerateFunctions($interfaceName, $dataNode);
+}
+
+sub GenerateEndHeader {
+    my ($object) = @_;
+
+    #Header guard
+    my $guard = $className . "_h";
+
+    push(@hBody, "G_END_DECLS\n\n");
+    push(@hBody, "#endif /* $guard */\n");
+}
+
+sub GeneratePrivateHeader {
+    my $object = shift;
+    my $dataNode = shift;
+
+    my $interfaceName = $dataNode->name;
+    my $filename = "$outputDir/" . $className . "Private.h";
+    my $guard = uc(decamelize($className)) . "_PRIVATE_H";
+    my $parentClassName = GetParentClassName($dataNode);
+    my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
+    my $hasRealParent = @{$dataNode->parents} > 0;
+    my $hasParent = $hasLegacyParent || $hasRealParent;
+    
+    open(PRIVHEADER, ">$filename") or die "Couldn't open file $filename for writing";
+    
+    print PRIVHEADER split("\r", $licenceTemplate);
+    print PRIVHEADER "\n";
+    
+    my $text = << "EOF";
+#ifndef $guard
+#define $guard
+
+#include <glib-object.h>
+#include <webkit/${parentClassName}.h>
+#include "${interfaceName}.h"
+EOF
+
+    print PRIVHEADER $text;
+    
+    print PRIVHEADER map { "#include \"$_\"\n" } sort keys(%hdrPropIncludes);
+    print PRIVHEADER "\n" if keys(%hdrPropIncludes);
+    
+    $text = << "EOF";
+namespace WebKit {
+    ${className} *
+    wrap${interfaceName}(WebCore::${interfaceName} *coreObject);
+
+    WebCore::${interfaceName} *
+    core(${className} *request);
+
+EOF
+
+    print PRIVHEADER $text;
+
+    if ($className ne "WebKitDOMNode") {
+        $text = << "EOF";
+    gpointer
+    kit(WebCore::${interfaceName}* node);
+
+EOF
+        print PRIVHEADER $text;
+    }
+
+    $text = << "EOF";
+} // namespace WebKit
+
+#endif /* ${guard} */
+EOF
+    print PRIVHEADER $text;
+    
+    close(PRIVHEADER);
+}
+
+sub UsesManualToJSImplementation {
+    my $type = shift;
+
+    return 1 if $type eq "Node" or $type eq "Document" or $type eq "HTMLCollection" or
+      $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue" or
+      $type eq "Event" or $type eq "Element" or $type eq "Text";
+    return 0;
+}
+
+sub Generate {
+    my ($object, $dataNode) = @_;
+
+    my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
+    my $hasRealParent = @{$dataNode->parents} > 0;
+    my $hasParent = $hasLegacyParent || $hasRealParent;
+    my $parentClassName = GetParentClassName($dataNode);
+    my $parentGObjType = GetParentGObjType($dataNode);
+    my $interfaceName = $dataNode->name;
+
+    # Add the default impl header template
+    @cPrefix = split("\r", $licenceTemplate);
+    push(@cPrefix, "\n");
+
+    $implIncludes{"webkitmarshal.h"} = 1;
+    $implIncludes{"webkitprivate.h"} = 1;
+    $implIncludes{"WebKitDOMBinding.h"} = 1;
+    $implIncludes{"gobject/ConvertToUTF8String.h"} = 1;
+    $implIncludes{"webkit/$className.h"} = 1;
+    $implIncludes{"webkit/${className}Private.h"} = 1;
+    $implIncludes{"${interfaceName}.h"} = 1;
+    $implIncludes{"ExceptionCode.h"} = 1;
+
+    $hdrIncludes{"webkit/${parentClassName}.h"} = 1;
+
+    if ($className ne "WebKitDOMNode") {
+        my $converter = << "EOF";
+namespace WebKit {
+    
+gpointer kit(WebCore::$interfaceName* obj)
+{
+    g_return_val_if_fail(obj != 0, 0);
+
+    if (gpointer ret = DOMObjectCache::get(obj))
+        return ret;
+
+    return DOMObjectCache::put(obj, WebKit::wrap${interfaceName}(obj));
+}
+    
+} // namespace WebKit //
+
+EOF
+    push(@cBody, $converter);
+    }
+
+    $object->GenerateHeader($interfaceName, $parentClassName);
+    $object->GenerateCFile($interfaceName, $parentClassName, $parentGObjType, $dataNode);
+    $object->GenerateEndHeader();
+    $object->GeneratePrivateHeader($dataNode);
+}
+
+# Internal helper
+sub WriteData {
+    my ($object, $name) = @_;
+
+    # Write public header.
+    my $hdrFName = "$outputDir/" . $name . ".h";
+    open(HEADER, ">$hdrFName") or die "Couldn't open file $hdrFName";
+
+    print HEADER @hPrefix;
+    print HEADER @hPrefixGuard;
+    print HEADER "#include \"webkit/webkitdomdefines.h\"\n";
+    print HEADER "#include <glib-object.h>\n";
+    print HEADER "#include <webkit/webkitdefines.h>\n";
+    print HEADER map { "#include \"$_\"\n" } sort keys(%hdrIncludes);
+    print HEADER "\n" if keys(%hdrIncludes);
+    print HEADER "\n";
+    print HEADER @hBodyPre;
+    print HEADER @hBody;
+
+    close(HEADER);
+
+    # Write the implementation sources
+    my $implFileName = "$outputDir/" . $name . ".cpp";
+    open(IMPL, ">$implFileName") or die "Couldn't open file $implFileName";
+
+    print IMPL @cPrefix;
+    print IMPL "#include <glib-object.h>\n";
+    print IMPL "#include \"config.h\"\n\n";
+    print IMPL "#include <wtf/GetPtr.h>\n";
+    print IMPL "#include <wtf/RefPtr.h>\n";
+    print IMPL map { "#include \"$_\"\n" } sort keys(%implIncludes);
+    print IMPL "\n" if keys(%implIncludes);
+    print IMPL @cBody;
+
+    print IMPL "\n";
+    print IMPL @cBodyPriv;
+
+    close(IMPL);
+
+    %implIncludes = ();
+    %hdrIncludes = ();
+    @hPrefix = ();
+    @hBody = ();
+
+    @cPrefix = ();
+    @cBody = ();
+    @cBodyPriv = ();
+}
+
+sub GenerateInterface {
+    my ($object, $dataNode, $defines) = @_;
+    my $name = $dataNode->name;
+
+    # Set up some global variables
+    $className = GetClassName($dataNode->name);
+    $object->Generate($dataNode);
+
+    # Write changes
+    my $fname = "WebKitDOM_" . $name;
+    $fname =~ s/_//g;
+    $object->WriteData($fname);
+}
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 94fc2b8..919e321 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -17,7 +17,7 @@
 # Library General Public License for more details.
 #
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 
@@ -32,6 +32,7 @@
 my @headerContentHeader = ();
 my @headerContent = ();
 my %headerIncludes = ();
+my %headerTrailingIncludes = ();
 
 my @implContentHeader = ();
 my @implContent = ();
@@ -143,6 +144,7 @@
     my $className = shift;
 
     return "DOMException" if $className eq "DOMCoreException";
+    return "FormData" if $className eq "DOMFormData";
     return $className;
 }
 
@@ -212,12 +214,32 @@
     }
 }
 
+sub IsScriptProfileType
+{
+    my $type = shift;
+    return 1 if ($type eq "ScriptProfile" or $type eq "ScriptProfileNode");
+    return 0;
+}
+
+sub AddTypedefForScriptProfileType
+{
+    my $type = shift;
+    (my $jscType = $type) =~ s/Script//;
+
+    push(@headerContent, "typedef JSC::$jscType $type;\n\n");
+}
+
 sub AddClassForwardIfNeeded
 {
     my $implClassName = shift;
 
     # SVGAnimatedLength/Number/etc. are typedefs to SVGAnimatedTemplate, so don't use class forwards for them!
-    push(@headerContent, "class $implClassName;\n\n") unless $codeGenerator->IsSVGAnimatedType($implClassName);
+    unless ($codeGenerator->IsSVGAnimatedType($implClassName) or IsScriptProfileType($implClassName)) {
+        push(@headerContent, "class $implClassName;\n\n");
+    # ScriptProfile and ScriptProfileNode are typedefs to JSC::Profile and JSC::ProfileNode.
+    } elsif (IsScriptProfileType($implClassName)) {
+        AddTypedefForScriptProfileType($implClassName);
+    }
 }
 
 sub IsSVGTypeNeedingContextParameter
@@ -517,6 +539,7 @@
     # Get correct pass/store types respecting PODType flag
     my $podType = $dataNode->extendedAttributes->{"PODType"};
     my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
+
     $headerIncludes{"$podType.h"} = 1 if $podType and $podType ne "float";
 
     $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1 if $podType;
@@ -551,7 +574,9 @@
     # Prototype
     push(@headerContent, "    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);\n") unless ($dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"});
 
-    $implIncludes{"${className}Custom.h"} = 1 if $dataNode->extendedAttributes->{"CustomHeader"} || $dataNode->extendedAttributes->{"CustomPutFunction"} || $dataNode->extendedAttributes->{"DelegatingPutFunction"};
+    $headerTrailingIncludes{"${className}Custom.h"} = 1 if $dataNode->extendedAttributes->{"CustomHeader"};
+
+    $implIncludes{"${className}Custom.h"} = 1 if !$dataNode->extendedAttributes->{"CustomHeader"} && ($dataNode->extendedAttributes->{"CustomPutFunction"} || $dataNode->extendedAttributes->{"DelegatingPutFunction"});
 
     my $hasGetter = $numAttributes > 0 
                  || !($dataNode->extendedAttributes->{"OmitConstructor"}
@@ -743,7 +768,7 @@
 
     # Index getter
     if ($dataNode->extendedAttributes->{"HasIndexGetter"}) {
-        push(@headerContent, "    static JSC::JSValue indexGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);\n");
+        push(@headerContent, "    static JSC::JSValue indexGetter(JSC::ExecState*, JSC::JSValue, unsigned);\n");
     }
     if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
         push(@headerContent, "    JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n");
@@ -758,7 +783,7 @@
     if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
         push(@headerContent, "private:\n");
         push(@headerContent, "    static bool canGetItemsForName(JSC::ExecState*, $implClassName*, const JSC::Identifier&);\n");
-        push(@headerContent, "    static JSC::JSValue nameGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);\n");
+        push(@headerContent, "    static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n");
     }
 
     push(@headerContent, "};\n\n");
@@ -859,7 +884,7 @@
         push(@headerContent,"// Attributes\n\n");
         foreach my $attribute (@{$dataNode->attributes}) {
             my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : "");
-            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);\n");
+            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n");
             unless ($attribute->type =~ /readonly/) {
                 my $setter = "setJS" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : "");
                 push(@headerContent, "void ${setter}(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);\n");
@@ -868,7 +893,7 @@
         
         if (!($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {
             my $getter = "js" . $interfaceName . "Constructor";
-            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);\n");
+            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n");
         }
     }
 
@@ -876,7 +901,7 @@
         push(@headerContent,"// Constants\n\n");
         foreach my $constant (@{$dataNode->constants}) {
             my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name);
-            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);\n");
+            push(@headerContent, "JSC::JSValue ${getter}(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n");
         }
     }
 
@@ -1286,9 +1311,9 @@
                     push(@implContent, "#if ${conditionalString}\n");
                 }
 
-                push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, const Identifier&, const PropertySlot& slot)\n");
+                push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, const Identifier&)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* castedThis = static_cast<$className*>(asObject(slot.slotBase()));\n");
+                push(@implContent, "    ${className}* castedThis = static_cast<$className*>(asObject(slotBase));\n");
 
                 my $implClassNameForValueConversion = "";
                 if (!$podType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {
@@ -1402,9 +1427,9 @@
             if (!($dataNode->extendedAttributes->{"OmitConstructor"} || $dataNode->extendedAttributes->{"CustomConstructor"})) {
                 my $constructorFunctionName = "js" . $interfaceName . "Constructor";
 
-                push(@implContent, "JSValue ${constructorFunctionName}(ExecState* exec, const Identifier&, const PropertySlot& slot)\n");
+                push(@implContent, "JSValue ${constructorFunctionName}(ExecState* exec, JSValue slotBase, const Identifier&)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* domObject = static_cast<$className*>(asObject(slot.slotBase()));\n");
+                push(@implContent, "    ${className}* domObject = static_cast<$className*>(asObject(slotBase));\n");
                 push(@implContent, "    return ${className}::getConstructor(exec, domObject->globalObject());\n");
                 push(@implContent, "}\n");
             }
@@ -1461,6 +1486,12 @@
                         my $putFunctionName = "setJS" . $interfaceName .  $codeGenerator->WK_ucfirst($name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : "");
                         my $implSetterFunctionName = $codeGenerator->WK_ucfirst($name);
 
+                        my $conditional = $attribute->signature->extendedAttributes->{"Conditional"};
+                        if ($conditional) {
+                            $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
+                            push(@implContent, "#if ${conditionalString}\n");
+                        }
+
                         push(@implContent, "void ${putFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n");
                         push(@implContent, "{\n");
 
@@ -1478,12 +1509,28 @@
                         } elsif ($type eq "EventListener") {
                             $implIncludes{"JSEventListener.h"} = 1;
                             push(@implContent, "    UNUSED_PARAM(exec);\n");
+                            my $windowEventListener = $attribute->signature->extendedAttributes->{"WindowEventListener"};
+                            if ($windowEventListener) {
+                                push(@implContent, "    ${className}* castedThis = static_cast<${className}*>(thisObject);\n");
+                                push(@implContent, "    JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
+                            }
                             push(@implContent, "    $implClassName* imp = static_cast<$implClassName*>(static_cast<$className*>(thisObject)->impl());\n");
-                            push(@implContent, "    imp->set$implSetterFunctionName(createJSAttributeEventListener(exec, value, thisObject));\n");
+                            if ($interfaceName eq "WorkerContext" and $name eq "onerror") {
+                                $implIncludes{"JSWorkerContextErrorHandler.h"} = 1;
+                                push(@implContent, "    imp->set$implSetterFunctionName(createJSWorkerContextErrorHandler(exec, value, thisObject));\n");
+                            } else {
+                                if ($windowEventListener) {
+                                    push(@implContent, "    imp->set$implSetterFunctionName(createJSAttributeEventListener(exec, value, globalObject));\n");
+                                } else {
+                                    push(@implContent, "    imp->set$implSetterFunctionName(createJSAttributeEventListener(exec, value, thisObject));\n");
+                                }
+                            }
                         } elsif ($attribute->signature->type =~ /Constructor$/) {
                             my $constructorType = $attribute->signature->type;
                             $constructorType =~ s/Constructor$//;
-                            $implIncludes{"JS" . $constructorType . ".h"} = 1;
+                            if ($constructorType ne "DOMObject") {
+                                $implIncludes{"JS" . $constructorType . ".h"} = 1;
+                            }
                             push(@implContent, "    // Shadowing a built-in constructor\n");
                             push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(Identifier(exec, \"$name\"), value);\n");
                         } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
@@ -1522,7 +1569,13 @@
                             }
                         }
                         
-                        push(@implContent, "}\n\n");
+                        push(@implContent, "}\n");
+
+                        if ($conditional) {
+                            push(@implContent, "#endif\n");
+                        }
+
+                        push(@implContent, "\n");
                     }
                 }
             }
@@ -1701,7 +1754,7 @@
             my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($constant->name);
 
             # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL
-            push(@implContent, "JSValue ${getter}(ExecState* exec, const Identifier&, const PropertySlot&)\n");
+            push(@implContent, "JSValue ${getter}(ExecState* exec, JSValue, const Identifier&)\n");
             push(@implContent, "{\n");
             push(@implContent, "    return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n");
             push(@implContent, "}\n\n");
@@ -1709,14 +1762,14 @@
     }
 
     if ($dataNode->extendedAttributes->{"HasIndexGetter"}) {
-        push(@implContent, "\nJSValue ${className}::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)\n");
+        push(@implContent, "\nJSValue ${className}::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}* thisObj = static_cast<$className*>(asObject(slot.slotBase()));\n");
+        push(@implContent, "    ${className}* thisObj = static_cast<$className*>(asObject(slotBase));\n");
         if (IndexGetterReturnsStrings($implClassName)) {
             $implIncludes{"KURL.h"} = 1;
-            push(@implContent, "    return jsStringOrNull(exec, thisObj->impl()->item(slot.index()));\n");
+            push(@implContent, "    return jsStringOrNull(exec, thisObj->impl()->item(index));\n");
         } else {
-            push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$implClassName*>(thisObj->impl())->item(slot.index()));\n");
+            push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$implClassName*>(thisObj->impl())->item(index));\n");
         }
         push(@implContent, "}\n");
         if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
@@ -1832,7 +1885,8 @@
 
 my %nativeType = (
     "CompareHow" => "Range::CompareHow",
-    "DOMString" => "const UString&",
+    "DOMString" => "const String&",
+    "DOMObject" => "ScriptValue",
     "NodeFilter" => "RefPtr<NodeFilter>",
     "SVGAngle" => "SVGAngle",
     "SVGLength" => "SVGLength",
@@ -1883,7 +1937,11 @@
     if ($type eq "DOMString") {
         return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"};
         return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"};
-        return "$value.toString(exec)";
+        return "ustringToString($value.toString(exec))";
+    }
+
+    if ($type eq "DOMObject") {
+        return "$value";
     }
 
     if ($type eq "SerializedScriptValue" or $type eq "any") {
@@ -1985,7 +2043,11 @@
     }
 
     if ($type eq "DOMObject") {
-        $implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
+        if ($implClassName eq "Document") {
+            $implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
+        } else {
+            return "$value.jsValue();";
+        }
     } elsif ($type =~ /SVGPathSeg/) {
         $implIncludes{"JS$type.h"} = 1;
         $joinedName = $type;
@@ -2123,6 +2185,7 @@
     $i = 0;
     foreach my $key (@{$keys}) {
         my $conditional;
+        my $targetType;
 
         if ($conditionals) {
             $conditional = $conditionals->{$key};
@@ -2131,7 +2194,13 @@
             my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
             push(@implContent, "#if ${conditionalString}\n");
         }
-        push(@implContent, "    { \"$key\", @$specials[$i], (intptr_t)@$value1[$i], (intptr_t)@$value2[$i] },\n");
+        
+        if ("@$specials[$i]" =~ m/Function/) {
+            $targetType = "static_cast<NativeFunction>";
+        } else {
+            $targetType = "static_cast<PropertySlot::GetValueFunc>";
+        }
+        push(@implContent, "    { \"$key\", @$specials[$i], (intptr_t)" . $targetType . "(@$value1[$i]), (intptr_t)@$value2[$i] },\n");
         if ($conditional) {
             push(@implContent, "#endif\n");
         }
@@ -2246,12 +2315,23 @@
         }
 
         print $HEADER @headerContent;
+
+        @includes = ();
+        foreach my $include (keys %headerTrailingIncludes) {
+            $include = "\"$include\"" unless $include =~ /^["<]/; # "
+            push @includes, $include;
+        }
+        foreach my $include (sort @includes) {
+            print $HEADER "#include $include\n";
+        }
+
         close($HEADER);
         undef($HEADER);
 
         @headerContentHeader = ();
         @headerContent = ();
         %headerIncludes = ();
+        %headerTrailingIncludes = ();
     }
 
     if (defined($DEPS)) {
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index dcb22a7..3c5fe45 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -17,7 +17,7 @@
 # Library General Public License for more details.
 # 
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 #
@@ -222,7 +222,13 @@
     %publicInterfaces = ();
 
     my $fileName = "WebCore/bindings/objc/PublicDOMInterfaces.h";
-    open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "objective-c", 
+    my $gccLocation = "";
+    if (($Config::Config{'osname'}) =~ /solaris/i) {
+        $gccLocation = "/usr/sfw/bin/gcc";
+    } else {
+        $gccLocation = "/usr/bin/gcc";
+    }
+    open FILE, "-|", $gccLocation, "-E", "-P", "-x", "objective-c",
         (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName";
     my @documentContent = <FILE>;
     close FILE;
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index ee51ec3..1c5f398 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -18,7 +18,7 @@
 # Library General Public License for more details.
 #
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# along with this library; see the file COPYING.LIB.  If not, write to
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 #
@@ -84,11 +84,6 @@
     $object->WriteData();
 }
 
-sub leftShift($$) {
-    my ($value, $distance) = @_;
-    return (($value << $distance) & 0xFFFFFFFF);
-}
-
 # Workaround for V8 bindings difference where RGBColor is not a POD type.
 sub IsPodType
 {
@@ -126,13 +121,6 @@
     $module = $dataNode->module;
 }
 
-sub GetLegacyHeaderIncludes
-{
-    my $legacyParent = shift;
-
-    die "Don't know what headers to include for module $module";
-}
-
 sub AvoidInclusionOfType
 {
     my $type = shift;
@@ -142,14 +130,6 @@
     return 0;
 }
 
-sub UsesManualToJSImplementation
-{
-    my $type = shift;
-
-    return 1 if $type eq "SVGPathSeg";
-    return 0;
-}
-
 sub AddIncludesForType
 {
     my $type = $codeGenerator->StripModule(shift);
@@ -203,14 +183,6 @@
     $implIncludes{"SVGAnimatedTemplate.h"} = 1;
 }
 
-sub AddClassForwardIfNeeded
-{
-    my $implClassName = shift;
-
-    # SVGAnimatedLength/Number/etc.. are typedefs to SVGAnimtatedTemplate, so don't use class forwards for them!
-    push(@headerContent, "class $implClassName;\n\n") unless $codeGenerator->IsSVGAnimatedType($implClassName);
-}
-
 # If the node has a [Conditional=XXX] attribute, returns an "ENABLE(XXX)" string for use in an #if.
 sub GenerateConditionalString
 {
@@ -223,6 +195,23 @@
     }
 }
 
+sub LinkOverloadedFunctions
+{
+    my $dataNode = shift;
+
+    # Identifies overloaded functions and for each function adds an array with
+    # links to its respective overloads (including itself).
+    my %nameToFunctionsMap = ();
+    foreach my $function (@{$dataNode->functions}) {
+        my $name = $function->signature->name;
+        $nameToFunctionsMap{$name} = [] if !exists $nameToFunctionsMap{$name};
+        push(@{$nameToFunctionsMap{$name}}, $function);
+        $function->{overloads} = $nameToFunctionsMap{$name};
+        $function->{overloadIndex} = @{$nameToFunctionsMap{$name}};
+    }
+
+}
+
 sub GenerateHeader
 {
     my $object = shift;
@@ -243,19 +232,26 @@
     @headerContent = split("\r", $headerTemplate);
 
     push(@headerContent, "\n#if ${conditionalString}\n\n") if $conditionalString;
-    push(@headerContent, "\n#ifndef $className" . "_H");
-    push(@headerContent, "\n#define $className" . "_H\n\n");
+    push(@headerContent, "\n#ifndef $className" . "_h");
+    push(@headerContent, "\n#define $className" . "_h\n\n");
 
     # Get correct pass/store types respecting PODType flag
     my $podType = $dataNode->extendedAttributes->{"PODType"};
 
-    push(@headerContent, "#include \"$podType.h\"\n") if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32");
+    my %headerInclues = ();
+    $headerIncludes{"$podType.h"} = 1 if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32");
+    $headerIncludes{"StringHash.h"} = 1;
+    $headerIncludes{"WrapperTypeInfo.h"} = 1;
+    my $headerClassInclude = GetHeaderClassInclude($implClassName);
+    $headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne "";
+
+    foreach my $headerInclude (sort keys(%headerIncludes)) {
+        push(@headerContent, "#include \"${headerInclude}\"\n");
+    }
 
     push(@headerContent, "#include <v8.h>\n");
     push(@headerContent, "#include <wtf/HashMap.h>\n");
-    push(@headerContent, "#include \"StringHash.h\"\n");
-    push(@headerContent, "#include \"V8Index.h\"\n");
-    push(@headerContent, GetHeaderClassInclude($implClassName));
+    
     push(@headerContent, "\nnamespace WebCore {\n");
     if ($podType) {
         push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n");
@@ -269,17 +265,22 @@
     my $forceNewObjectParameter = IsDOMNodeType($interfaceName) ? ", bool forceNewObject = false" : "";
     push(@headerContent, <<END);
 
- public:
-  static bool HasInstance(v8::Handle<v8::Value> value);
-  static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
-  static v8::Persistent<v8::FunctionTemplate> GetTemplate();
-  static ${nativeType}* toNative(v8::Handle<v8::Object>);
-  static v8::Handle<v8::Object> wrap(${nativeType}*${forceNewObjectParameter});
+public:
+    static bool HasInstance(v8::Handle<v8::Value> value);
+    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+    static ${nativeType}* toNative(v8::Handle<v8::Object>);
+    static v8::Handle<v8::Object> wrap(${nativeType}*${forceNewObjectParameter});
+    static void derefObject(void*);
+    static WrapperTypeInfo info;
 END
+    if (IsActiveDomType($implClassName)) {
+        push(@headerContent, "    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);\n");
+    }
 
     if ($implClassName eq "DOMWindow") {
-      push(@headerContent, <<END);
-  static v8::Persistent<v8::ObjectTemplate> GetShadowObjectTemplate();
+        push(@headerContent, <<END);
+    static v8::Persistent<v8::ObjectTemplate> GetShadowObjectTemplate();
 END
     }
 
@@ -288,11 +289,12 @@
         my $name = $function->signature->name;
         my $attrExt = $function->signature->extendedAttributes;
 
-        # FIXME: We should only be generating callback declarations for functions labeled [Custom] or [V8Custom],
-        # but we can't do that due to some mislabeled functions in the idl's (https://bugs.webkit.org/show_bug.cgi?id=33066).
-        push(@headerContent, <<END);
-  static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&);
+        if ($attrExt->{"Custom"} || $attrExt->{"V8Custom"}) {
+            push(@headerContent, <<END);
+    static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&);
 END
+        }
+
         if ($attrExt->{"EnabledAtRuntime"}) {
             push(@enabledAtRuntime, $function);
         }
@@ -300,7 +302,7 @@
 
     if ($dataNode->extendedAttributes->{"CustomConstructor"} || $dataNode->extendedAttributes->{"CanBeConstructed"}) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
+    static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
 END
     }
 
@@ -310,13 +312,13 @@
         if ($attrExt->{"V8CustomGetter"} || $attrExt->{"CustomGetter"}
             || $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) {
             push(@headerContent, <<END);
-  static v8::Handle<v8::Value> ${name}AccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Value> ${name}AccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
 END
         }
         if ($attrExt->{"V8CustomSetter"} || $attrExt->{"CustomSetter"}
             || $attrExt->{"V8Custom"} || $attrExt->{"Custom"}) {
             push(@headerContent, <<END);
-  static void ${name}AccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
+    static void ${name}AccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
 END
         }
         if ($attrExt->{"EnabledAtRuntime"}) {
@@ -330,24 +332,24 @@
 
     if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
         push(@headerContent, <<END);
-  static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
-  static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
+    static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
+    static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
 END
     }
 
     push(@headerContent, <<END);
 };
 
-  v8::Handle<v8::Value> toV8(${nativeType}*${forceNewObjectParameter});
+v8::Handle<v8::Value> toV8(${nativeType}*${forceNewObjectParameter});
 END
     if (IsRefPtrType($implClassName)) {
         push(@headerContent, <<END);
-  v8::Handle<v8::Value> toV8(PassRefPtr<${nativeType} >${forceNewObjectParameter});
+v8::Handle<v8::Value> toV8(PassRefPtr<${nativeType} >${forceNewObjectParameter});
 END
     }
 
     push(@headerContent, "}\n\n");
-    push(@headerContent, "#endif // $className" . "_H\n");
+    push(@headerContent, "#endif // $className" . "_h\n");
 
     push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString;
 }
@@ -356,33 +358,25 @@
 {
     my $dataNode = shift;
     my $name = $dataNode->name;
+    
+    my @customInternalFields = ();
+ 
+    # We can't ask whether a parent type has a given extendedAttribute, so special-case Node, AbstractWorker and WorkerContext to include all sub-types.
+    # FIXME: SVGElementInstance should probably have the EventTarget extended attribute, but doesn't.
+    if ($dataNode->extendedAttributes->{"EventTarget"} || IsNodeSubType($dataNode) || IsSubType($dataNode, "AbstractWorker") || IsSubType($dataNode, "WorkerContext")
+        || $name eq "SVGElementInstance") {
+        push(@customInternalFields, "eventListenerCacheIndex");
+    }
 
-    # FIXME: I am hideous and hard-coded.  Make me beautiful.
-    return ("cacheIndex", "implementationIndex") if ($name eq "Document") || ($name eq "SVGDocument");
-    return ("cacheIndex", "implementationIndex", "markerIndex", "shadowIndex") if $name eq "HTMLDocument";
-    return ("cacheIndex") if IsNodeSubType($dataNode);
-    return ("cacheIndex") if $name eq "EventSource";
-    return ("cacheIndex") if $name eq "XMLHttpRequest";
-    return ("cacheIndex") if $name eq "XMLHttpRequestUpload";
-    return ("cacheIndex") if $name eq "MessagePort";
-    return ("port1Index", "port2Index") if ($name eq "MessageChannel");
-    return ("cacheIndex") if $name eq "AbstractWorker";
-    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "Worker";
-    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "WorkerContext";
-    return ("abstractWorkerCacheIndex", "workerContextCacheIndex", "cacheIndex") if $name eq "DedicatedWorkerContext";
-    return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "SharedWorker";
-    return ("abstractWorkerCacheIndex", "workerContextCacheIndex", "cacheIndex") if $name eq "SharedWorkerContext";
-    return ("cacheIndex") if $name eq "Notification";
-    return ("cacheIndex") if $name eq "IDBRequest";
-    return ("cacheIndex") if $name eq "SVGElementInstance";
-    return ("consoleIndex", "historyIndex", "locationbarIndex", "menubarIndex", "navigatorIndex", "personalbarIndex",
-        "screenIndex", "scrollbarsIndex", "selectionIndex", "statusbarIndex", "toolbarIndex", "locationIndex",
-        "domSelectionIndex", "cacheIndex", "enteredIsolatedWorldIndex") if $name eq "DOMWindow";
-    return ("cacheIndex") if $name eq "DOMApplicationCache";
-    return ("cacheIndex") if $name eq "WebSocket";
-    return ("ownerNodeIndex") if ($name eq "StyleSheet") || ($name eq "CSSStyleSheet");
-    return ("ownerNodeIndex") if ($name eq "NamedNodeMap");
-    return ();
+    if (IsSubType($dataNode, "Document")) {
+        push(@customInternalFields, "implementationIndex");
+        if ($name eq "HTMLDocument") {
+            push(@customInternalFields, ("markerIndex", "shadowIndex"));
+        }
+    } elsif ($name eq "DOMWindow") {
+        push(@customInternalFields, "enteredIsolatedWorldIndex");
+    }
+    return @customInternalFields;
 }
 
 sub GetHeaderClassInclude
@@ -392,8 +386,8 @@
         $className =~ s/Abs|Rel//;
     }
     return "" if (AvoidInclusionOfType($className));
-    return "#include \"SVGAnimatedTemplate.h\"\n" if ($codeGenerator->IsSVGAnimatedType($className));
-    return "#include \"${className}.h\"\n";
+    return "SVGAnimatedTemplate.h" if ($codeGenerator->IsSVGAnimatedType($className));
+    return "${className}.h";
 }
 
 sub GenerateHeaderCustomInternalFieldIndices
@@ -403,12 +397,12 @@
     my $customFieldCounter = 0;
     foreach my $customInternalField (@customInternalFields) {
         push(@headerContent, <<END);
-  static const int ${customInternalField} = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
+    static const int ${customInternalField} = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
 END
         $customFieldCounter++;
     }
     push(@headerContent, <<END);
-  static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + ${customFieldCounter};
 END
 }
 
@@ -439,45 +433,45 @@
         $hasCustomDeleterr = 0;
         $hasEnumerator = 0;
     }
-    if ($interfaceName eq "HTMLSelectElement") {
+    if ($interfaceName eq "HTMLSelectElement" || $interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
         $hasCustomNamedGetter = 1;
     }
     my $isIndexerSpecialCase = exists $indexerSpecialCases{$interfaceName};
 
     if ($hasCustomIndexedGetter || $isIndexerSpecialCase) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info);
 END
     }
 
     if ($isIndexerSpecialCase || $hasCustomIndexedSetter) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Value> indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Value> indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
 END
     }
     if ($hasCustomDeleters) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Boolean> indexedPropertyDeleter(uint32_t index, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Boolean> indexedPropertyDeleter(uint32_t index, const v8::AccessorInfo& info);
 END
     }
     if ($hasCustomNamedGetter) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
 END
     }
     if ($hasCustomNamedSetter) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
 END
     }
     if ($hasCustomDeleters || $interfaceName eq "HTMLDocument") {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Boolean> namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
+    static v8::Handle<v8::Boolean> namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
 END
     }
     if ($hasCustomEnumerator) {
         push(@headerContent, <<END);
-  static v8::Handle<v8::Array> namedPropertyEnumerator(const v8::AccessorInfo& info);
+    static v8::Handle<v8::Array> namedPropertyEnumerator(const v8::AccessorInfo& info);
 END
     }
 }
@@ -487,16 +481,16 @@
     my $dataNode = shift;
 
     if ($dataNode->extendedAttributes->{"CustomCall"}) {
-        push(@headerContent, "  static v8::Handle<v8::Value> callAsFunctionCallback(const v8::Arguments&);\n");
+        push(@headerContent, "    static v8::Handle<v8::Value> callAsFunctionCallback(const v8::Arguments&);\n");
     }
     if ($dataNode->name eq "Event") {
-        push(@headerContent, "  static v8::Handle<v8::Value> dataTransferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
-        push(@headerContent, "  static void valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);\n");
+        push(@headerContent, "    static v8::Handle<v8::Value> dataTransferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+        push(@headerContent, "    static void valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);\n");
     }
     if ($dataNode->name eq "Location") {
-        push(@headerContent, "  static v8::Handle<v8::Value> assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
-        push(@headerContent, "  static v8::Handle<v8::Value> reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
-        push(@headerContent, "  static v8::Handle<v8::Value> replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+        push(@headerContent, "    static v8::Handle<v8::Value> assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+        push(@headerContent, "    static v8::Handle<v8::Value> reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
+        push(@headerContent, "    static v8::Handle<v8::Value> replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);\n");
     }
 }
 
@@ -531,19 +525,12 @@
     return IsSubType($dataNode, "Node");
 }
 
-sub IsEventSubType
-{
-    my $dataNode = shift;
-    return IsSubType($dataNode, "Event");
-}
-
 sub GenerateDomainSafeFunctionGetter
 {
     my $function = shift;
-    my $dataNode = shift;
     my $implClassName = shift;
 
-    my $className = "V8" . $dataNode->name;
+    my $className = "V8" . $implClassName;
     my $funcName = $function->signature->name;
 
     my $signature = "v8::Signature::New(" . $className . "::GetRawTemplate())";
@@ -551,29 +538,26 @@
         $signature = "v8::Local<v8::Signature>()";
     }
 
-    my $newTemplateString = GenerateNewFunctionTemplate($function, $dataNode, $signature);
+    my $newTemplateString = GenerateNewFunctionTemplate($function, $implClassName, $signature);
 
     push(@implContentDecls, <<END);
-  static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
+static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
     INC_STATS(\"DOM.$implClassName.$funcName._get\");
-    static v8::Persistent<v8::FunctionTemplate> private_template =
-        v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
+    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
     v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(${className}::GetTemplate(), info.This());
     if (holder.IsEmpty()) {
-      // can only reach here by 'object.__proto__.func', and it should passed
-      // domain security check already
-      return private_template->GetFunction();
+        // can only reach here by 'object.__proto__.func', and it should passed
+        // domain security check already
+        return privateTemplate->GetFunction();
     }
     ${implClassName}* imp = ${className}::toNative(holder);
     if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), false)) {
-      static v8::Persistent<v8::FunctionTemplate> shared_template =
-        v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
-      return shared_template->GetFunction();
-
-    } else {
-      return private_template->GetFunction();
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
+        return sharedTemplate->GetFunction();
     }
-  }
+    return privateTemplate->GetFunction();
+}
 
 END
 }
@@ -581,24 +565,24 @@
 sub GenerateConstructorGetter
 {
     my $implClassName = shift;
-    my $classIndex = shift;
 
     push(@implContentDecls, <<END);
-  static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
+static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
     INC_STATS(\"DOM.$implClassName.constructors._get\");
     v8::Handle<v8::Value> data = info.Data();
-    ASSERT(data->IsNumber());
-    V8ClassIndex::V8WrapperType type = V8ClassIndex::FromInt(data->Int32Value());
+    ASSERT(data->IsExternal() || data->IsNumber());
+    WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
 END
 
-    if ($classIndex eq "DOMWINDOW") {
+    if ($implClassName eq "DOMWindow") {
         push(@implContentDecls, <<END);
     // Get the proxy corresponding to the DOMWindow if possible to
     // make sure that the constructor function is constructed in the
     // context of the DOMWindow and not in the context of the caller.
     return V8DOMWrapper::getConstructor(type, V8DOMWindow::toNative(info.Holder()));
 END
-    } elsif ($classIndex eq "DEDICATEDWORKERCONTEXT" or $classIndex eq "WORKERCONTEXT" or $classIndex eq "SHAREDWORKERCONTEXT") {
+    } elsif ($implClassName eq "DedicatedWorkerContext" or $implClassName eq "WorkerContext" or $implClassName eq "SharedWorkerContext") {
         push(@implContentDecls, <<END);
     return V8DOMWrapper::getConstructor(type, V8WorkerContext::toNative(info.Holder()));
 END
@@ -607,8 +591,7 @@
     }
 
     push(@implContentDecls, <<END);
-
-    }
+}
 
 END
 }
@@ -631,7 +614,6 @@
     my $isPodType = IsPodType($implClassName);
     my $skipContext = 0;
 
-
     if ($isPodType) {
         $implClassName = GetNativeType($implClassName);
         $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;
@@ -658,34 +640,36 @@
 
   # Getter
     push(@implContentDecls, <<END);
-  static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
+static v8::Handle<v8::Value> ${attrName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
     INC_STATS(\"DOM.$implClassName.$attrName._get\");
 END
 
     if ($isPodType) {
         push(@implContentDecls, <<END);
-    V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());
-    $implClassName imp_instance = *imp_wrapper;
+    V8SVGPODTypeWrapper<$implClassName>* impWrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());
+    $implClassName impInstance = *impWrapper;
 END
         if ($getterStringUsesImp) {
             push(@implContentDecls, <<END);
-    $implClassName* imp = &imp_instance;
+    $implClassName* imp = &impInstance;
 END
         }
 
     } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) {
-      if ($interfaceName eq "DOMWindow") {
-        push(@implContentDecls, <<END);
+        if ($interfaceName eq "DOMWindow") {
+            push(@implContentDecls, <<END);
     v8::Handle<v8::Object> holder = info.Holder();
 END
-      } else {
-        # perform lookup first
-        push(@implContentDecls, <<END);
+        } else {
+            # perform lookup first
+            push(@implContentDecls, <<END);
     v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8${interfaceName}::GetTemplate(), info.This());
-    if (holder.IsEmpty()) return v8::Handle<v8::Value>();
+    if (holder.IsEmpty())
+        return v8::Handle<v8::Value>();
 END
-      }
-    push(@implContentDecls, <<END);
+        }
+        push(@implContentDecls, <<END);
     ${implClassName}* imp = V8${implClassName}::toNative(holder);
 END
     } else {
@@ -696,7 +680,7 @@
             my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
             $implIncludes{"${namespace}.h"} = 1;
             push(@implContentDecls, "    return getElementStringAttr(info, ${namespace}::${contentAttributeName}Attr);\n");
-            push(@implContentDecls, "  }\n\n");
+            push(@implContentDecls, "}\n\n");
             return;
             # Skip the rest of the function!
         }
@@ -707,9 +691,9 @@
 
     # Generate security checks if necessary
     if ($attribute->signature->extendedAttributes->{"CheckNodeSecurity"}) {
-        push(@implContentDecls, "    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->$attrName())) return v8::Handle<v8::Value>();\n\n");
+        push(@implContentDecls, "    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->$attrName()))\n    return v8::Handle<v8::Value>();\n\n");
     } elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
-        push(@implContentDecls, "    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->contentDocument())) return v8::Handle<v8::Value>();\n\n");
+        push(@implContentDecls, "    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->contentDocument()))\n    return v8::Handle<v8::Value>();\n\n");
     }
 
     my $useExceptions = 1 if @{$attribute->getterExceptions} and !($isPodType);
@@ -751,7 +735,7 @@
             $getterString .= ".toInt()";
         }
     } else {
-        $getterString = "imp_instance";
+        $getterString = "impInstance";
     }
 
     my $result;
@@ -768,7 +752,7 @@
         my $implClassIsAnimatedType = $codeGenerator->IsSVGAnimatedType($implClassName);
         if (not $implClassIsAnimatedType and $codeGenerator->IsPodTypeWithWriteableProperties($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) {
             if (IsPodType($implClassName)) {
-                my $wrapper = "V8SVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($getterString, imp_wrapper)";
+                my $wrapper = "V8SVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName>::create($getterString, impWrapper)";
                 push(@implContentDecls, "    RefPtr<V8SVGStaticPODTypeWrapperWithPODTypeParent<$nativeType, $implClassName> > wrapper = $wrapper;\n");
             } else {
                 my $wrapper = "V8SVGStaticPODTypeWrapperWithParent<$nativeType, $implClassName>::create(imp, &${implClassName}::$getter, &${implClassName}::$setter)";
@@ -790,7 +774,7 @@
     } else {
         if ($attribute->signature->type eq "EventListener" && $dataNode->name eq "DOMWindow") {
             push(@implContentDecls, "    if (!imp->document())\n");
-            push(@implContentDecls, "      return v8::Handle<v8::Value>();\n");
+            push(@implContentDecls, "        return v8::Handle<v8::Value>();\n");
         }
 
         if ($useExceptions) {
@@ -803,6 +787,32 @@
             # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary
             $result = $getterString;
         }
+ 
+        # Special case for readonly or Replaceable attributes (with a few exceptions). This attempts to ensure that JS wrappers don't get
+        # garbage-collected prematurely when their lifetime is strongly tied to their owner. We accomplish this by inserting a reference to
+        # the newly created wrapper into an internal field of the holder object.
+        if (!IsNodeSubType($dataNode) && $attrName ne "self" && (IsWrapperType($returnType) && ($attribute->type =~ /^readonly/ || $attribute->signature->extendedAttributes->{"Replaceable"})
+            && $returnType ne "EventTarget" && $returnType ne "SerializedScriptValue" && $returnType ne "DOMWindow" 
+            && $returnType !~ /SVG/ && $returnType !~ /HTML/ && !IsDOMNodeType($returnType))) {
+            AddIncludesForType($returnType);
+            my $domMapFunction = GetDomMapFunction(0, $returnType);
+            # Check for a wrapper in the wrapper cache. If there is one, we know that a hidden reference has already
+            # been created. If we don't find a wrapper, we create both a wrapper and a hidden reference.
+            push(@implContentDecls, "    RefPtr<$returnType> result = ${getterString};\n");
+            push(@implContentDecls, "    v8::Handle<v8::Value> wrapper = result.get() ? ${domMapFunction}.get(result.get()) : v8::Handle<v8::Value>();\n");
+            push(@implContentDecls, "    if (wrapper.IsEmpty()) {\n");
+            push(@implContentDecls, "        wrapper = toV8(result.get());\n");
+            push(@implContentDecls, "        if (!wrapper.IsEmpty())\n");
+            if ($dataNode->name eq "DOMWindow") {
+                push(@implContentDecls, "            V8DOMWrapper::setHiddenWindowReference(imp->frame(), wrapper);\n");
+            } else {
+                push(@implContentDecls, "            V8DOMWrapper::setHiddenReference(info.Holder(), wrapper);\n");
+            }
+            push(@implContentDecls, "    }\n");
+            push(@implContentDecls, "    return wrapper;\n");
+            push(@implContentDecls, "}\n\n");
+            return;
+        }
     }
 
     if (IsSVGTypeNeedingContextParameter($attrType) && !$skipContext) {
@@ -824,27 +834,9 @@
         push(@implContentDecls, "    " . ReturnNativeToJSValue($attribute->signature, $result, "    ").";\n");
     }
 
-    push(@implContentDecls, "  }\n\n");  # end of getter
+    push(@implContentDecls, "}\n\n");  # end of getter
 }
 
-
-sub GenerateReplaceableAttrSetter
-{
-    my $implClassName = shift;
-
-    push(@implContentDecls,
-       "  static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
-       " v8::Local<v8::Value> value, const v8::AccessorInfo& info) {\n");
-
-    push(@implContentDecls, "    INC_STATS(\"DOM.$implClassName.$attrName._set\");\n");
-
-    push(@implContentDecls, "    v8::Local<v8::String> ${attrName}_string = v8::String::New(\"${attrName}\");\n");
-    push(@implContentDecls, "    info.Holder()->Delete(${attrName}_string);\n");
-    push(@implContentDecls, "    info.This()->Set(${attrName}_string, value);\n");
-    push(@implContentDecls, "  }\n\n");
-}
-
-
 sub GenerateNormalAttrSetter
 {
     my $attribute = shift;
@@ -854,10 +846,7 @@
 
     my $attrExt = $attribute->signature->extendedAttributes;
 
-    push(@implContentDecls,
-       "  static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
-       " v8::Local<v8::Value> value, const v8::AccessorInfo& info) {\n");
-
+    push(@implContentDecls, "static void ${attrName}AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n");
     push(@implContentDecls, "    INC_STATS(\"DOM.$implClassName.$attrName._set\");\n");
 
     my $isPodType = IsPodType($implClassName);
@@ -866,8 +855,8 @@
         $implClassName = GetNativeType($implClassName);
         $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;
         push(@implContentDecls, "    V8SVGPODTypeWrapper<$implClassName>* wrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());\n");
-        push(@implContentDecls, "    $implClassName imp_instance = *wrapper;\n");
-        push(@implContentDecls, "    $implClassName* imp = &imp_instance;\n");
+        push(@implContentDecls, "    $implClassName impInstance = *wrapper;\n");
+        push(@implContentDecls, "    $implClassName* imp = &impInstance;\n");
 
     } elsif ($attrExt->{"v8OnProto"}) {
       if ($interfaceName eq "DOMWindow") {
@@ -878,7 +867,8 @@
         # perform lookup first
         push(@implContentDecls, <<END);
     v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8${interfaceName}::GetTemplate(), info.This());
-    if (holder.IsEmpty()) return;
+    if (holder.IsEmpty())
+        return;
 END
       }
     push(@implContentDecls, <<END);
@@ -894,7 +884,7 @@
             my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
             $implIncludes{"${namespace}.h"} = 1;
             push(@implContentDecls, "    setElementStringAttr(info, ${namespace}::${contentAttributeName}Attr, value);\n");
-            push(@implContentDecls, "  }\n\n");
+            push(@implContentDecls, "}\n\n");
             return;
             # Skip the rest of the function!
         }
@@ -908,7 +898,7 @@
     if ($attribute->signature->type eq "EventListener") {
         if ($dataNode->name eq "DOMWindow") {
             push(@implContentDecls, "    if (!imp->document())\n");
-            push(@implContentDecls, "      return;\n");
+            push(@implContentDecls, "        return;\n");
         }
     } else {
         push(@implContentDecls, "    $nativeType v = " . JSValueToNative($attribute->signature, "value") . ";\n");
@@ -947,8 +937,14 @@
             push(@implContentDecls, "    imp->setAttribute(${namespace}::${contentAttributeName}Attr, $result");
         } elsif ($attribute->signature->type eq "EventListener") {
             $implIncludes{"V8AbstractEventListener.h"} = 1;
-            push(@implContentDecls, "    transferHiddenDependency(info.Holder(), imp->$attrName(), value, V8${interfaceName}::cacheIndex);\n");
-            push(@implContentDecls, "    imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(imp, value, true, ListenerFindOrCreate)");
+            push(@implContentDecls, "    transferHiddenDependency(info.Holder(), imp->$attrName(), value, V8${interfaceName}::eventListenerCacheIndex);\n");
+            if ($interfaceName eq "WorkerContext" and $attribute->signature->name eq "onerror") {
+                $implIncludes{"V8EventListenerList.h"} = 1;
+                $implIncludes{"V8WorkerContextErrorHandler.h"} = 1;
+                push(@implContentDecls, "    imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8WorkerContextErrorHandler>(value, true)");
+            } else {
+                push(@implContentDecls, "    imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
+            }
         } else {
             push(@implContentDecls, "    imp->set$implSetterFunctionName($result");
         }
@@ -971,21 +967,19 @@
             $currentObject = "wrapper";
         }
 
-        push(@implContentDecls, "    if (SVGElement* context = V8Proxy::svgContext($currentObject)) {\n");
+        push(@implContentDecls, "    if (SVGElement* context = V8Proxy::svgContext($currentObject))\n");
         push(@implContentDecls, "        context->svgAttributeChanged(imp->associatedAttributeName());\n");
-        push(@implContentDecls, "    }\n");
     }
 
     push(@implContentDecls, "    return;\n");
-    push(@implContentDecls, "  }\n\n");  # end of setter
+    push(@implContentDecls, "}\n\n");  # end of setter
 }
 
 sub GetFunctionTemplateCallbackName
 {
     $function = shift;
-    $dataNode = shift;
+    $interfaceName = shift;
 
-    my $interfaceName = $dataNode->name;
     my $name = $function->signature->name;
 
     if ($function->signature->extendedAttributes->{"Custom"} ||
@@ -1003,54 +997,167 @@
 sub GenerateNewFunctionTemplate
 {
     $function = shift;
-    $dataNode = shift;
+    $interfaceName = shift;
     $signature = shift;
 
-    my $callback = GetFunctionTemplateCallbackName($function, $dataNode);
+    my $callback = GetFunctionTemplateCallbackName($function, $interfaceName);
     return "v8::FunctionTemplate::New($callback, v8::Handle<v8::Value>(), $signature)";
 }
 
+sub GenerateEventListenerCallback
+{
+    my $implClassName = shift;
+    my $functionName = shift;
+    my $lookupType = ($functionName eq "add") ? "OrCreate" : "Only";
+    my $passRefPtrHandling = ($functionName eq "add") ? "" : ".get()";
+    my $hiddenDependencyAction = ($functionName eq "add") ? "create" : "remove";
+ 
+    push(@implContentDecls, <<END);
+static v8::Handle<v8::Value> ${functionName}EventListenerCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.${implClassName}.${functionName}EventListener()");
+    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType});
+    if (listener) {
+        V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(v8ValueToAtomicWebCoreString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
+        ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], V8${implClassName}::eventListenerCacheIndex);
+    }
+    return v8::Undefined();
+}
+
+END
+}
+
+sub GenerateParametersCheckExpression
+{
+    my $numParameters = shift;
+    my $function = shift;
+
+    my @andExpression = ();
+    push(@andExpression, "args.Length() == $numParameters");
+    my $parameterIndex = 0;
+    foreach $parameter (@{$function->parameters}) {
+        last if $parameterIndex >= $numParameters;
+        my $value = "args[$parameterIndex]";
+        my $type = GetTypeFromSignature($parameter);
+
+        # Only DOMString or wrapper types are checked.
+        # For DOMString, Null, Undefined and any Object are accepted too, as
+        # these are acceptable values for a DOMString argument (any Object can
+        # be converted to a string via .toString).
+        push(@andExpression, "(${value}->IsNull() || ${value}->IsUndefined() || ${value}->IsString() || ${value}->IsObject())") if $codeGenerator->IsStringType($type);
+        push(@andExpression, "(${value}->IsNull() || V8${type}::HasInstance($value))") if IsWrapperType($type);
+
+        $parameterIndex++;
+    }
+    my $res = join(" && ", @andExpression);
+    $res = "($res)" if @andExpression > 1;
+    return $res;
+}
+
+sub GenerateFunctionParametersCheck
+{
+    my $function = shift;
+
+    my @orExpression = ();
+    my $numParameters = 0;
+    foreach $parameter (@{$function->parameters}) {
+        if ($parameter->extendedAttributes->{"Optional"}) {
+            push(@orExpression, GenerateParametersCheckExpression($numParameters, $function));
+        }
+        $numParameters++;
+    }
+    push(@orExpression, GenerateParametersCheckExpression($numParameters, $function));
+    return join(" || ", @orExpression);
+}
+
+sub GenerateOverloadedFunctionCallback
+{
+    my $function = shift;
+    my $dataNode = shift;
+    my $implClassName = shift;
+
+    # Generate code for choosing the correct overload to call. Overloads are
+    # chosen based on the total number of arguments passed and the type of
+    # values passed in non-primitive argument slots. When more than a single
+    # overload is applicable, precedence is given according to the order of
+    # declaration in the IDL.
+
+    my $name = $function->signature->name;
+    push(@implContentDecls, <<END);
+static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args)
+{
+    INC_STATS(\"DOM.$implClassName.$name\");
+END
+
+    foreach my $overload (@{$function->{overloads}}) {
+        my $parametersCheck = GenerateFunctionParametersCheck($overload);
+        push(@implContentDecls, "    if ($parametersCheck)\n");
+        push(@implContentDecls, "        return ${name}$overload->{overloadIndex}Callback(args);\n");
+    }
+    push(@implContentDecls, <<END);
+    V8Proxy::setDOMException(SYNTAX_ERR);
+    return notHandledByInterceptor();
+END
+    push(@implContentDecls, "}\n\n");
+}
+
 sub GenerateFunctionCallback
 {
     my $function = shift;
     my $dataNode = shift;
-    my $classIndex = shift;
     my $implClassName = shift;
 
     my $interfaceName = $dataNode->name;
     my $name = $function->signature->name;
 
-    push(@implContentDecls,
-"  static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args) {\n" .
-"    INC_STATS(\"DOM.$implClassName.$name\");\n");
+    if (@{$function->{overloads}} > 1) {
+        # Append a number to an overloaded method's name to make it unique:
+        $name = $name . $function->{overloadIndex};
+    }
+
+    # Adding and removing event listeners are not standard callback behavior,
+    # but they are extremely consistent across the various classes that take event listeners,
+    # so we can generate them as a "special case".
+    if ($name eq "addEventListener") {
+        GenerateEventListenerCallback($implClassName, "add");
+        return;
+    } elsif ($name eq "removeEventListener") {
+        GenerateEventListenerCallback($implClassName, "remove");
+        return;
+    }
+
+    push(@implContentDecls, <<END);
+static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments& args)
+{
+    INC_STATS(\"DOM.$implClassName.$name\");
+END
 
     my $numParameters = @{$function->parameters};
 
     if ($function->signature->extendedAttributes->{"RequiresAllArguments"}) {
-        push(@implContentDecls,
-            "    if (args.Length() < $numParameters) return v8::Handle<v8::Value>();\n");
+        push(@implContentDecls, "    if (args.Length() < $numParameters)\n    return v8::Handle<v8::Value>();\n");
     }
 
     if (IsPodType($implClassName)) {
         my $nativeClassName = GetNativeType($implClassName);
-        push(@implContentDecls, "    V8SVGPODTypeWrapper<$nativeClassName>* imp_wrapper = V8SVGPODTypeWrapper<$nativeClassName>::toNative(args.Holder());\n");
-        push(@implContentDecls, "    $nativeClassName imp_instance = *imp_wrapper;\n");
-        push(@implContentDecls, "    $nativeClassName* imp = &imp_instance;\n");
+        push(@implContentDecls, "    V8SVGPODTypeWrapper<$nativeClassName>* impWrapper = V8SVGPODTypeWrapper<$nativeClassName>::toNative(args.Holder());\n");
+        push(@implContentDecls, "    $nativeClassName impInstance = *impWrapper;\n");
+        push(@implContentDecls, "    $nativeClassName* imp = &impInstance;\n");
     } else {
         push(@implContentDecls, <<END);
     ${implClassName}* imp = V8${implClassName}::toNative(args.Holder());
 END
     }
 
-  # Check domain security if needed
+    # Check domain security if needed
     if (($dataNode->extendedAttributes->{"CheckDomainSecurity"}
        || $interfaceName eq "DOMWindow")
        && !$function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
     # We have not find real use cases yet.
-    push(@implContentDecls,
-"    if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true)) {\n".
-"      return v8::Handle<v8::Value>();\n" .
-"    }\n");
+    push(@implContentDecls, <<END);
+    if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
+        return v8::Handle<v8::Value>();
+END
     }
 
     my $raisesExceptions = @{$function->raisesExceptions};
@@ -1072,16 +1179,18 @@
     }
 
     if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
-        push(@implContentDecls,
-"    OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, $numParameters));\n".
-"    if (!callStack)\n".
-"        return v8::Undefined();\n");
+        push(@implContentDecls, <<END);
+    OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, $numParameters));
+    if (!callStack)
+        return v8::Undefined();
+END
         $implIncludes{"ScriptCallStack.h"} = 1;
     }
     if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"}) {
-        push(@implContentDecls,
-"    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->getSVGDocument(ec)))\n" .
-"      return v8::Handle<v8::Value>();\n");
+        push(@implContentDecls, <<END);
+    if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->getSVGDocument(ec)))
+        return v8::Handle<v8::Value>();
+END
     }
 
     my $paramIndex = 0;
@@ -1098,20 +1207,29 @@
             push(@implContentDecls, "    }\n");
         }
 
-        if (BasicTypeCanFailConversion($parameter)) {
+        if ($parameter->type eq "SerializedScriptValue") {
+            $implIncludes{"SerializedScriptValue.h"} = 1;
+            push(@implContentDecls, "    bool ${parameterName}DidThrow = false;\n");
+        } elsif (BasicTypeCanFailConversion($parameter)) {
             push(@implContentDecls, "    bool ${parameterName}Ok;\n");
         }
 
         push(@implContentDecls, "    " . GetNativeTypeFromSignature($parameter, $paramIndex) . " $parameterName = ");
-        push(@implContentDecls, JSValueToNative($parameter, "args[$paramIndex]",
-           BasicTypeCanFailConversion($parameter) ?  "${parameterName}Ok" : undef) . ";\n");
+
+        if ($parameter->type eq "SerializedScriptValue") {
+            push(@implContentDecls, "SerializedScriptValue::create(args[$paramIndex], ${parameterName}DidThrow);\n");
+            push(@implContentDecls, "    if (${parameterName}DidThrow)\n    return v8::Undefined();\n");
+        } else {
+            push(@implContentDecls, JSValueToNative($parameter, "args[$paramIndex]",
+                                                    BasicTypeCanFailConversion($parameter) ?  "${parameterName}Ok" : undef) . ";\n");
+        }
 
         if (TypeCanFailConversion($parameter)) {
             $implIncludes{"ExceptionCode.h"} = 1;
             push(@implContentDecls,
 "    if (UNLIKELY(!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ")) {\n" .
-"      ec = TYPE_MISMATCH_ERR;\n" .
-"      goto fail;\n" .
+"        ec = TYPE_MISMATCH_ERR;\n" .
+"        goto fail;\n" .
 "    }\n");
         }
 
@@ -1119,8 +1237,8 @@
             $implIncludes{"ExceptionCode.h"} = 1;
             push(@implContentDecls,
 "    if (UNLIKELY($parameterName < 0)) {\n" .
-"      ec = INDEX_SIZE_ERR;\n" .
-"      goto fail;\n" .
+"        ec = INDEX_SIZE_ERR;\n" .
+"        goto fail;\n" .
 "    }\n");
         }
 
@@ -1133,12 +1251,12 @@
 
     if ($raisesExceptions) {
         push(@implContentDecls, "    }\n");
-        push(@implContentDecls, "  fail:\n");
+        push(@implContentDecls, "    fail:\n");
         push(@implContentDecls, "    V8Proxy::setDOMException(ec);\n");
         push(@implContentDecls, "    return v8::Handle<v8::Value>();\n");
     }
 
-    push(@implContentDecls, "  }\n\n");
+    push(@implContentDecls, "}\n\n");
 }
 
 sub GenerateBatchedAttributeData
@@ -1164,6 +1282,10 @@
     my $attrName = $attribute->signature->name;
     my $attrExt = $attribute->signature->extendedAttributes;
 
+    # Attributes of type SerializedScriptValue are set in the
+    # constructor and don't require callbacks.
+    return if ($attribute->signature->type eq "SerializedScriptValue");
+
     my $accessControl = "v8::DEFAULT";
     if ($attrExt->{"DoNotCheckDomainSecurityOnGet"}) {
         $accessControl = "v8::ALL_CAN_READ";
@@ -1172,11 +1294,11 @@
     } elsif ($attrExt->{"DoNotCheckDomainSecurity"}) {
         $accessControl = "v8::ALL_CAN_READ";
         if (!($attribute->type =~ /^readonly/) && !($attrExt->{"V8ReadOnly"})) {
-            $accessControl .= "|v8::ALL_CAN_WRITE";
+            $accessControl .= " | v8::ALL_CAN_WRITE";
         }
     }
     if ($attrExt->{"V8DisallowShadowing"}) {
-        $accessControl .= "|v8::PROHIBITS_OVERWRITING";
+        $accessControl .= " | v8::PROHIBITS_OVERWRITING";
     }
     $accessControl = "static_cast<v8::AccessControl>(" . $accessControl . ")";
 
@@ -1200,24 +1322,24 @@
 
     # Check attributes.
     if ($attrExt->{"DontEnum"}) {
-        $propAttr .= "|v8::DontEnum";
+        $propAttr .= " | v8::DontEnum";
     }
     if ($attrExt->{"V8DisallowShadowing"}) {
-        $propAttr .= "|v8::DontDelete";
+        $propAttr .= " | v8::DontDelete";
     }
 
     my $on_proto = "0 /* on instance */";
-    my $data = "V8ClassIndex::INVALID_CLASS_INDEX /* no data */";
+    my $data = "0 /* no data */";
 
     # Constructor
     if ($attribute->signature->type =~ /Constructor$/) {
         my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
         $constructorType =~ s/Constructor$//;
-        my $constructorIndex = uc($constructorType);
+        $implIncludes{"V8${constructorType}.h"} = 1;
         if ($customAccessor) {
             $getter = "V8${customAccessor}AccessorGetter";
         } else {
-            $data = "V8ClassIndex::${constructorIndex}";
+            $data = "&V8${constructorType}::info";
             $getter = "${interfaceName}Internal::${interfaceName}ConstructorGetter";
         }
         $setter = "0";
@@ -1247,7 +1369,7 @@
         # FIXME: Investigate whether we could treat window.top as replaceable
         # and allow shadowing without it being a security hole.
         if (!($interfaceName eq "DOMWindow" and $attrName eq "top")) {
-            $propAttr .= "|v8::ReadOnly";
+            $propAttr .= " | v8::ReadOnly";
         }
     }
 
@@ -1264,17 +1386,8 @@
     my $commentInfo = "Attribute '$attrName' (Type: '" . $attribute->type .
                       "' ExtAttr: '" . join(' ', keys(%{$attrExt})) . "')";
 
-    push(@implContent, $indent . "    {\n");
-    push(@implContent, $indent . "        \/\/ $commentInfo\n");
-    push(@implContent, $indent . "        \"$attrName\",\n");
-    push(@implContent, $indent . "        $getter,\n");
-    push(@implContent, $indent . "        $setter,\n");
-    push(@implContent, $indent . "        $data,\n");
-    push(@implContent, $indent . "        $accessControl,\n");
-    push(@implContent, $indent . "        static_cast<v8::PropertyAttribute>($propAttr),\n");
-    push(@implContent, $indent . "        $on_proto\n");
-    push(@implContent, $indent . "    }" . $delimiter . "\n");
-END
+    push(@implContent, $indent . "    \/\/ $commentInfo\n");
+    push(@implContent, $indent . "    {\"$attrName\", $getter, $setter, $data, $accessControl, static_cast<v8::PropertyAttribute>($propAttr), $on_proto}" . $delimiter . "\n");
 }
 
 sub GenerateImplementationIndexer
@@ -1326,17 +1439,16 @@
             my $conversion = $indexer->extendedAttributes->{"ConvertNullStringTo"};
             if ($conversion && $conversion eq "Null") {
                 push(@implContent, <<END);
-  setCollectionStringOrNullIndexedGetter<${interfaceName}>(desc);
+    setCollectionStringOrNullIndexedGetter<${interfaceName}>(desc);
 END
             } else {
                 push(@implContent, <<END);
-  setCollectionStringIndexedGetter<${interfaceName}>(desc);
+    setCollectionStringIndexedGetter<${interfaceName}>(desc);
 END
             }
         } else {
-            my $indexerClassIndex = uc($indexerType);
             push(@implContent, <<END);
-  setCollectionIndexedGetter<${interfaceName}, ${indexerType}>(desc, V8ClassIndex::${indexerClassIndex});
+    setCollectionIndexedGetter<${interfaceName}, ${indexerType}>(desc);
 END
             # Include the header for this indexer type, because setCollectionIndexedGetter() requires toV8() for this type.
             $implIncludes{"V8${indexerType}.h"} = 1;
@@ -1358,11 +1470,11 @@
         $hasDeleter = 0;
     }
 
-    push(@implContent, "  desc->${setOn}Template()->SetIndexedPropertyHandler(V8${interfaceName}::indexedPropertyGetter");
+    push(@implContent, "    desc->${setOn}Template()->SetIndexedPropertyHandler(V8${interfaceName}::indexedPropertyGetter");
     push(@implContent, $hasCustomSetter ? ", V8${interfaceName}::indexedPropertySetter" : ", 0");
     push(@implContent, ", 0"); # IndexedPropertyQuery -- not being used at the moment.
     push(@implContent, $hasDeleter ? ", V8${interfaceName}::indexedPropertyDeleter" : ", 0");
-    push(@implContent, ", nodeCollectionIndexedPropertyEnumerator<${interfaceName}>, v8::Integer::New(V8ClassIndex::NODE)") if $hasEnumerator;
+    push(@implContent, ", nodeCollectionIndexedPropertyEnumerator<${interfaceName}>") if $hasEnumerator;
     push(@implContent, ");\n");
 }
 
@@ -1380,6 +1492,10 @@
         $hasCustomGetter = 1;
     }
 
+    if ($interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
+        $hasCustomGetter = 1;
+    }
+
     my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $hasCustomGetter || $namedPropertyGetter;
     if (!$hasGetter) {
         return;
@@ -1388,9 +1504,8 @@
     if ($namedPropertyGetter && $namedPropertyGetter->type ne "Node" && !$namedPropertyGetter->extendedAttributes->{"Custom"} && !$hasCustomGetter) {
         $implIncludes{"V8Collection.h"} = 1;
         my $type = $namedPropertyGetter->type;
-        my $classIndex = uc($type);
         push(@implContent, <<END);
-  setCollectionNamedGetter<${interfaceName}, ${type}>(desc, V8ClassIndex::${classIndex});
+    setCollectionNamedGetter<${interfaceName}, ${type}>(desc);
 END
         return;
     }
@@ -1411,7 +1526,7 @@
         $hasEnumerator = 0;
     }
 
-    push(@implContent, "  desc->${setOn}Template()->SetNamedPropertyHandler(V8${interfaceName}::namedPropertyGetter, ");
+    push(@implContent, "    desc->${setOn}Template()->SetNamedPropertyHandler(V8${interfaceName}::namedPropertyGetter, ");
     push(@implContent, $hasSetter ? "V8${interfaceName}::namedPropertySetter, " : "0, ");
     push(@implContent, "0, "); # NamedPropertyQuery -- not being used at the moment.
     push(@implContent, $hasDeleter ? "V8${interfaceName}::namedPropertyDeleter, " : "0, ");
@@ -1432,7 +1547,7 @@
     }
 
     if ($hasCustomCall) {
-        push(@implContent, "  desc->InstanceTemplate()->SetCallAsFunctionHandler(V8${interfaceName}::callAsFunctionCallback);\n");
+        push(@implContent, "    desc->InstanceTemplate()->SetCallAsFunctionHandler(V8${interfaceName}::callAsFunctionCallback);\n");
     }
 }
 
@@ -1441,7 +1556,7 @@
     my $dataNode = shift;
     if ($dataNode->extendedAttributes->{"MasqueradesAsUndefined"})
     {
-        push(@implContent, "  desc->InstanceTemplate()->MarkAsUndetectable();\n");
+        push(@implContent, "    desc->InstanceTemplate()->MarkAsUndetectable();\n");
     }
 }
 
@@ -1450,9 +1565,9 @@
     my $object = shift;
     my $dataNode = shift;
     my $interfaceName = $dataNode->name;
+    my $visibleInterfaceName = GetVisibleInterfaceName($interfaceName);
     my $className = "V8$interfaceName";
     my $implClassName = $interfaceName;
-    my $classIndex = uc($codeGenerator->StripModule($interfaceName));
 
     my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
     my $conditionalString = GenerateConditionalString($dataNode);
@@ -1461,30 +1576,33 @@
     @implContentHeader = split("\r", $headerTemplate);
 
     push(@implFixedHeader,
-         "#include \"config.h\"\n" .
-         "#include \"RuntimeEnabledFeatures.h\"\n" .
-         "#include \"V8Proxy.h\"\n" .
-         "#include \"V8Binding.h\"\n" .
-         "#include \"V8BindingState.h\"\n" .
-         "#include \"V8DOMWrapper.h\"\n" .
-         "#include \"V8IsolatedContext.h\"\n\n" .
-         "#undef LOG\n\n");
+         "\n#include \"config.h\"\n" .
+         "#include \"${className}.h\"\n\n");
 
     push(@implFixedHeader, "\n#if ${conditionalString}\n\n") if $conditionalString;
+         
+    $implIncludes{"RuntimeEnabledFeatures.h"} = 1;
+    $implIncludes{"V8Proxy.h"} = 1;
+    $implIncludes{"V8Binding.h"} = 1;
+    $implIncludes{"V8BindingState.h"} = 1;
+    $implIncludes{"V8DOMWrapper.h"} = 1;
+    $implIncludes{"V8IsolatedContext.h"} = 1;
 
     if ($className =~ /^V8SVGAnimated/) {
         AddIncludesForSVGAnimatedType($interfaceName);
     }
 
-    $implIncludes{"${className}.h"} = 1;
-
     AddIncludesForType($interfaceName);
 
-    push(@implContentDecls, "namespace WebCore {\n");
+    my $toActive = IsActiveDomType($interfaceName) ? "${className}::toActiveDOMObject" : "0";
+
+    push(@implContentDecls, "namespace WebCore {\n\n");
+    push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, ${toActive} };\n\n");   
     push(@implContentDecls, "namespace ${interfaceName}Internal {\n\n");
     push(@implContentDecls, "template <typename T> void V8_USE(T) { }\n\n");
 
     my $hasConstructors = 0;
+    my $serializedAttribute;
     # Generate property accessors for attributes.
     for ($index = 0; $index < @{$dataNode->attributes}; $index++) {
         $attribute = @{$dataNode->attributes}[$index];
@@ -1504,6 +1622,15 @@
             $attribute->signature->extendedAttributes->{"v8OnProto"} = 1;
         }
 
+        # Attributes of type SerializedScriptValue are set in the
+        # constructor and don't require callbacks.
+        if ($attrType eq "SerializedScriptValue") {
+            die "Only one attribute of type SerializedScriptValue supported" if $serializedAttribute;
+            $implIncludes{"SerializedScriptValue.h"} = 1;
+            $serializedAttribute = $attribute;
+            next;
+        }
+
         # Do not generate accessor if this is a custom attribute.  The
         # call will be forwarded to a hand-written accessor
         # implementation.
@@ -1517,29 +1644,30 @@
             $attribute->signature->extendedAttributes->{"V8CustomGetter"})) {
             GenerateNormalAttrGetter($attribute, $dataNode, $implClassName, $interfaceName);
         }
-        if (!($attribute->signature->extendedAttributes->{"CustomSetter"} ||
-            $attribute->signature->extendedAttributes->{"V8CustomSetter"})) {
-            if ($attribute->signature->extendedAttributes->{"Replaceable"}) {
-                $dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"} || die "Replaceable attribute can only be used in interface that defines ExtendsDOMGlobalObject attribute!";
-                # GenerateReplaceableAttrSetter($implClassName);
-            } elsif ($attribute->type !~ /^readonly/ && !$attribute->signature->extendedAttributes->{"V8ReadOnly"}) {
-                GenerateNormalAttrSetter($attribute, $dataNode, $implClassName, $interfaceName);
-            }
+        if (!$attribute->signature->extendedAttributes->{"CustomSetter"} &&
+            !$attribute->signature->extendedAttributes->{"V8CustomSetter"} &&
+            !$attribute->signature->extendedAttributes->{"Replaceable"} &&
+            $attribute->type !~ /^readonly/ &&
+            !$attribute->signature->extendedAttributes->{"V8ReadOnly"}) {
+            GenerateNormalAttrSetter($attribute, $dataNode, $implClassName, $interfaceName);
         }
     }
 
     if ($hasConstructors) {
-        GenerateConstructorGetter($implClassName, $classIndex);
+        GenerateConstructorGetter($implClassName);
     }
 
+    LinkOverloadedFunctions($dataNode);
+
     my $indexer;
     my $namedPropertyGetter;
     # Generate methods for functions.
     foreach my $function (@{$dataNode->functions}) {
-        # hack for addEventListener/RemoveEventListener
-        # FIXME: avoid naming conflict
         if (!($function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"V8Custom"})) {
-            GenerateFunctionCallback($function, $dataNode, $classIndex, $implClassName);
+            GenerateFunctionCallback($function, $dataNode, $implClassName);
+            if ($function->{overloadIndex} > 1 && $function->{overloadIndex} == @{$function->{overloads}}) {
+                GenerateOverloadedFunctionCallback($function, $dataNode, $implClassName);
+            }
         }
 
         if ($function->signature->name eq "item") {
@@ -1554,7 +1682,7 @@
         # generate an access getter that returns different function objects
         # for different calling context.
         if (($dataNode->extendedAttributes->{"CheckDomainSecurity"} || ($interfaceName eq "DOMWindow")) && $function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
-            GenerateDomainSafeFunctionGetter($function, $dataNode, $implClassName);
+            GenerateDomainSafeFunctionGetter($function, $implClassName);
         }
     }
 
@@ -1580,7 +1708,7 @@
     $attributes = \@normal;
     # Put the attributes that disallow shadowing on the shadow object.
     if (@disallowsShadowing) {
-        push(@implContent, "static const BatchedAttribute shadow_attrs[] = {\n");
+        push(@implContent, "static const BatchedAttribute shadowAttrs[] = {\n");
         GenerateBatchedAttributeData($dataNode, \@disallowsShadowing);
         push(@implContent, "};\n");
     }
@@ -1588,7 +1716,7 @@
     my $has_attributes = 0;
     if (@$attributes) {
         $has_attributes = 1;
-        push(@implContent, "static const BatchedAttribute ${interfaceName}_attrs[] = {\n");
+        push(@implContent, "static const BatchedAttribute ${interfaceName}Attrs[] = {\n");
         GenerateBatchedAttributeData($dataNode, $attributes);
         push(@implContent, "};\n");
     }
@@ -1597,6 +1725,9 @@
     $num_callbacks = 0;
     $has_callbacks = 0;
     foreach my $function (@{$dataNode->functions}) {
+        # Only one table entry is needed for overloaded methods:
+        next if $function->{overloadIndex} > 1;
+
         my $attrExt = $function->signature->extendedAttributes;
         # Don't put any nonstandard functions into this table:
         if ($attrExt->{"V8OnInstance"}) {
@@ -1614,12 +1745,12 @@
         }
         if (!$has_callbacks) {
             $has_callbacks = 1;
-            push(@implContent, "static const BatchedCallback ${interfaceName}_callbacks[] = {\n");
+            push(@implContent, "static const BatchedCallback ${interfaceName}Callbacks[] = {\n");
         }
         my $name = $function->signature->name;
-        my $callback = GetFunctionTemplateCallbackName($function, $dataNode);
+        my $callback = GetFunctionTemplateCallbackName($function, $interfaceName);
         push(@implContent, <<END);
-  {"$name", $callback},
+    {"$name", $callback},
 END
         $num_callbacks++;
     }
@@ -1629,7 +1760,7 @@
     my $has_constants = 0;
     if (@{$dataNode->constants}) {
         $has_constants = 1;
-        push(@implContent, "static const BatchedConstant ${interfaceName}_consts[] = {\n");
+        push(@implContent, "static const BatchedConstant ${interfaceName}Consts[] = {\n");
     }
     foreach my $constant (@{$dataNode->constants}) {
         my $name = $constant->name;
@@ -1638,7 +1769,7 @@
         # defines "const unsigned long SHOW_ALL = 0xFFFFFFFF".  It would be better if we
         # handled this here, and converted it to a -1 constant in the c++ output.
         push(@implContent, <<END);
-  { "${name}", static_cast<signed int>($value) },
+    {"${name}", static_cast<signed int>($value)},
 END
     }
     if ($has_constants) {
@@ -1650,33 +1781,31 @@
     # In namespace WebCore, add generated implementation for 'CanBeConstructed'.
     if ($dataNode->extendedAttributes->{"CanBeConstructed"} && !$dataNode->extendedAttributes->{"CustomConstructor"}) {
         push(@implContent, <<END);
- v8::Handle<v8::Value> ${className}::constructorCallback(const v8::Arguments& args)
-  {
+v8::Handle<v8::Value> ${className}::constructorCallback(const v8::Arguments& args)
+{
     INC_STATS("DOM.${interfaceName}.Contructor");
-    return V8Proxy::constructDOMObject<V8ClassIndex::${classIndex}, $interfaceName>(args);
-  }
+    return V8Proxy::constructDOMObject<$interfaceName>(args, &info);
+}
 END
    }
 
     my $access_check = "";
     if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} && !($interfaceName eq "DOMWindow")) {
-        $access_check = "instance->SetAccessCheckCallbacks(V8${interfaceName}::namedSecurityCheck, V8${interfaceName}::indexedSecurityCheck, v8::Integer::New(V8ClassIndex::ToInt(V8ClassIndex::${classIndex})));";
+        $access_check = "instance->SetAccessCheckCallbacks(V8${interfaceName}::namedSecurityCheck, V8${interfaceName}::indexedSecurityCheck, v8::External::Wrap(&V8${interfaceName}::info));";
     }
 
     # For the DOMWindow interface, generate the shadow object template
     # configuration method.
     if ($implClassName eq "DOMWindow") {
         push(@implContent, <<END);
-static v8::Persistent<v8::ObjectTemplate> ConfigureShadowObjectTemplate(v8::Persistent<v8::ObjectTemplate> templ) {
-  batchConfigureAttributes(templ,
-                           v8::Handle<v8::ObjectTemplate>(),
-                           shadow_attrs,
-                           sizeof(shadow_attrs)/sizeof(*shadow_attrs));
+static v8::Persistent<v8::ObjectTemplate> ConfigureShadowObjectTemplate(v8::Persistent<v8::ObjectTemplate> templ)
+{
+    batchConfigureAttributes(templ, v8::Handle<v8::ObjectTemplate>(), shadowAttrs, sizeof(shadowAttrs) / sizeof(*shadowAttrs));
 
-  // Install a security handler with V8.
-  templ->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::Integer::New(V8ClassIndex::DOMWINDOW));
-  templ->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
-  return templ;
+    // Install a security handler with V8.
+    templ->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::Wrap(&V8DOMWindow::info));
+    templ->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
+    return templ;
 }
 END
     }
@@ -1696,45 +1825,45 @@
 
     # Generate the template configuration method
     push(@implContent,  <<END);
-static v8::Persistent<v8::FunctionTemplate> Configure${className}Template(v8::Persistent<v8::FunctionTemplate> desc) {
-  v8::Local<v8::Signature> default_signature = configureTemplate(desc, \"${interfaceName}\",
-      $parentClassTemplate, V8${interfaceName}::internalFieldCount,
+static v8::Persistent<v8::FunctionTemplate> Configure${className}Template(v8::Persistent<v8::FunctionTemplate> desc)
+{
+    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, \"${visibleInterfaceName}\", $parentClassTemplate, V8${interfaceName}::internalFieldCount,
 END
     # Set up our attributes if we have them
     if ($has_attributes) {
         push(@implContent, <<END);
-      ${interfaceName}_attrs, sizeof(${interfaceName}_attrs)/sizeof(*${interfaceName}_attrs),
+        ${interfaceName}Attrs, sizeof(${interfaceName}Attrs) / sizeof(*${interfaceName}Attrs),
 END
     } else {
         push(@implContent, <<END);
-      NULL, 0,
+        0, 0,
 END
     }
 
     if ($has_callbacks) {
         push(@implContent, <<END);
-      ${interfaceName}_callbacks, sizeof(${interfaceName}_callbacks)/sizeof(*${interfaceName}_callbacks));
+        ${interfaceName}Callbacks, sizeof(${interfaceName}Callbacks) / sizeof(*${interfaceName}Callbacks));
 END
     } else {
         push(@implContent, <<END);
-      NULL, 0);
+        0, 0);
 END
     }
 
     if ($dataNode->extendedAttributes->{"CustomConstructor"} || $dataNode->extendedAttributes->{"CanBeConstructed"}) {
         push(@implContent, <<END);
-      desc->SetCallHandler(V8${interfaceName}::constructorCallback);
+        desc->SetCallHandler(V8${interfaceName}::constructorCallback);
 END
     }
 
     if ($access_check or @enabledAtRuntime or @{$dataNode->functions} or $has_constants) {
         push(@implContent,  <<END);
-  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
-  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
 END
     }
 
-    push(@implContent,  "  $access_check\n");
+    push(@implContent,  "    $access_check\n");
 
     # Setup the enable-at-runtime attrs if we have them
     foreach my $runtime_attr (@enabledAtRuntime) {
@@ -1760,16 +1889,19 @@
     # Define our functions with Set() or SetAccessor()
     $total_functions = 0;
     foreach my $function (@{$dataNode->functions}) {
+        # Only one accessor is needed for overloaded methods:
+        next if $function->{overloadIndex} > 1;
+
         $total_functions++;
         my $attrExt = $function->signature->extendedAttributes;
         my $name = $function->signature->name;
 
         my $property_attributes = "v8::DontDelete";
         if ($attrExt->{"DontEnum"}) {
-            $property_attributes .= "|v8::DontEnum";
+            $property_attributes .= " | v8::DontEnum";
         }
         if ($attrExt->{"V8ReadOnly"}) {
-            $property_attributes .= "|v8::ReadOnly";
+            $property_attributes .= " | v8::ReadOnly";
         }
 
         my $commentInfo = "Function '$name' (ExtAttr: '" . join(' ', keys(%{$attrExt})) . "')";
@@ -1783,7 +1915,7 @@
         if ($attrExt->{"EnabledAtRuntime"}) {
             # Only call Set()/SetAccessor() if this method should be enabled
             $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled";
-            $conditional = "if (${enable_function}())\n";
+            $conditional = "if (${enable_function}())\n        ";
         }
 
         if ($attrExt->{"DoNotCheckDomainSecurity"} &&
@@ -1802,34 +1934,28 @@
             #
             # The solution is very hacky and fragile, it really needs to be replaced
             # by a better solution.
-            $property_attributes .= "|v8::ReadOnly";
+            $property_attributes .= " | v8::ReadOnly";
             push(@implContent, <<END);
 
-  // $commentInfo
-  $conditional $template->SetAccessor(
-      v8::String::New("$name"),
-      ${interfaceName}Internal::${name}AttrGetter,
-      0,
-      v8::Handle<v8::Value>(),
-      v8::ALL_CAN_READ,
-      static_cast<v8::PropertyAttribute>($property_attributes));
+    // $commentInfo
+    ${conditional}$template->SetAccessor(v8::String::New("$name"), ${interfaceName}Internal::${name}AttrGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
 END
           $num_callbacks++;
           next;
       }
 
-      my $signature = "default_signature";
-      if ($attrExt->{"V8DoNotCheckSignature"}){
+      my $signature = "defaultSignature";
+      if ($attrExt->{"V8DoNotCheckSignature"}) {
           $signature = "v8::Local<v8::Signature>()";
       }
 
       if (RequiresCustomSignature($function)) {
-          $signature = "${name}_signature";
-          push(@implContent, "\n  // Custom Signature '$name'\n", CreateCustomSignature($function));
+          $signature = "${name}Signature";
+          push(@implContent, "\n    // Custom Signature '$name'\n", CreateCustomSignature($function));
       }
 
       # Normal function call is a template
-      my $callback = GetFunctionTemplateCallbackName($function, $dataNode);
+      my $callback = GetFunctionTemplateCallbackName($function, $interfaceName);
 
       if ($property_attributes eq "v8::DontDelete") {
           $property_attributes = "";
@@ -1837,13 +1963,13 @@
           $property_attributes = ", static_cast<v8::PropertyAttribute>($property_attributes)";
       }
 
-      if ($template eq "proto" && $conditional eq "" && $signature eq "default_signature" && $property_attributes eq "") {
+      if ($template eq "proto" && $conditional eq "" && $signature eq "defaultSignature" && $property_attributes eq "") {
           # Standard type of callback, already created in the batch, so skip it here.
           next;
       }
 
       push(@implContent, <<END);
-  ${conditional}$template->Set(v8::String::New("$name"), v8::FunctionTemplate::New($callback, v8::Handle<v8::Value>(), ${signature})$property_attributes);
+    ${conditional}$template->Set(v8::String::New("$name"), v8::FunctionTemplate::New($callback, v8::Handle<v8::Value>(), ${signature})$property_attributes);
 END
       $num_callbacks++;
     }
@@ -1852,7 +1978,7 @@
 
     if ($has_constants) {
         push(@implContent, <<END);
-  batchConfigureConstants(desc, proto, ${interfaceName}_consts, sizeof(${interfaceName}_consts)/sizeof(*${interfaceName}_consts));
+    batchConfigureConstants(desc, proto, ${interfaceName}Consts, sizeof(${interfaceName}Consts) / sizeof(*${interfaceName}Consts));
 END
     }
 
@@ -1860,23 +1986,23 @@
     if ($interfaceName eq "DOMWindow") {
         push(@implContent, <<END);
 
-  proto->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
-  desc->SetHiddenPrototype(true);
-  instance->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
-  // Set access check callbacks, but turned off initially.
-  // When a context is detached from a frame, turn on the access check.
-  // Turning on checks also invalidates inline caches of the object.
-  instance->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::Integer::New(V8ClassIndex::DOMWINDOW), false);
+    proto->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
+    desc->SetHiddenPrototype(true);
+    instance->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
+    // Set access check callbacks, but turned off initially.
+    // When a context is detached from a frame, turn on the access check.
+    // Turning on checks also invalidates inline caches of the object.
+    instance->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::Wrap(&V8DOMWindow::info), false);
 END
     }
     if ($interfaceName eq "Location") {
         push(@implContent, <<END);
 
-  // For security reasons, these functions are on the instance instead
-  // of on the prototype object to insure that they cannot be overwritten.
-  instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
-  instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
-  instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+    // For security reasons, these functions are on the instance instead
+    // of on the prototype object to ensure that they cannot be overwritten.
+    instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+    instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+    instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
 END
     }
 
@@ -1886,51 +2012,86 @@
     }
     push(@implContent, <<END);
 
-  // Custom toString template
-  desc->Set(getToStringName(), getToStringTemplate());
-  return desc;
+    // Custom toString template
+    desc->Set(getToStringName(), getToStringTemplate());
+    return desc;
 }
 
-v8::Persistent<v8::FunctionTemplate> ${className}::GetRawTemplate() {
-  static v8::Persistent<v8::FunctionTemplate> ${className}_raw_cache_ = createRawTemplate();
-  return ${className}_raw_cache_;
+v8::Persistent<v8::FunctionTemplate> ${className}::GetRawTemplate()
+{
+    static v8::Persistent<v8::FunctionTemplate> ${className}RawCache = createRawTemplate();
+    return ${className}RawCache;
 }
 
-v8::Persistent<v8::FunctionTemplate> ${className}::GetTemplate() {
-  static v8::Persistent<v8::FunctionTemplate> ${className}_cache_ = Configure${className}Template(GetRawTemplate());
-  return ${className}_cache_;
+v8::Persistent<v8::FunctionTemplate> ${className}::GetTemplate()\
+{
+    static v8::Persistent<v8::FunctionTemplate> ${className}Cache = Configure${className}Template(GetRawTemplate());
+    return ${className}Cache;
 }
 
-${nativeType}* ${className}::toNative(v8::Handle<v8::Object> object) {
-  return reinterpret_cast<${nativeType}*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+${nativeType}* ${className}::toNative(v8::Handle<v8::Object> object)
+{
+    return reinterpret_cast<${nativeType}*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
 }
 
-bool ${className}::HasInstance(v8::Handle<v8::Value> value) {
-  return GetRawTemplate()->HasInstance(value);
+bool ${className}::HasInstance(v8::Handle<v8::Value> value)
+{
+    return GetRawTemplate()->HasInstance(value);
 }
 
 END
 
+    if (IsActiveDomType($interfaceName)) {
+        # MessagePort is handled like an active dom object even though it doesn't inherit
+        # from ActiveDOMObject, so don't try to cast it to ActiveDOMObject.
+        my $returnValue = $interfaceName eq "MessagePort" ? "0" : "toNative(object)";
+        push(@implContent, <<END);
+ActiveDOMObject* ${className}::toActiveDOMObject(v8::Handle<v8::Object> object)
+{
+    return ${returnValue};
+}      
+END
+    }
+
     if ($implClassName eq "DOMWindow") {
         push(@implContent, <<END);
-v8::Persistent<v8::ObjectTemplate> V8DOMWindow::GetShadowObjectTemplate() {
-  static v8::Persistent<v8::ObjectTemplate> V8DOMWindowShadowObject_cache_;
-  if (V8DOMWindowShadowObject_cache_.IsEmpty()) {
-    V8DOMWindowShadowObject_cache_ = v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New());
-    ConfigureShadowObjectTemplate(V8DOMWindowShadowObject_cache_);
-  }
-  return V8DOMWindowShadowObject_cache_;
+v8::Persistent<v8::ObjectTemplate> V8DOMWindow::GetShadowObjectTemplate()
+{
+    static v8::Persistent<v8::ObjectTemplate> V8DOMWindowShadowObjectCache;
+    if (V8DOMWindowShadowObjectCache.IsEmpty()) {
+        V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New());
+        ConfigureShadowObjectTemplate(V8DOMWindowShadowObjectCache);
+    }
+    return V8DOMWindowShadowObjectCache;
 }
 END
     }
 
-    GenerateToV8Converters($dataNode, $interfaceName, $className, $nativeType);
+    GenerateToV8Converters($dataNode, $interfaceName, $className, $nativeType, $serializedAttribute);
 
     push(@implContent, <<END);
+
+void ${className}::derefObject(void* object)
+{
+END
+
+    if (IsRefPtrType($interfaceName)) {
+        push(@implContent, <<END);
+    static_cast<${nativeType}*>(object)->deref();
+END
+    }
+
+    push(@implContent, <<END);
+}
+
 } // namespace WebCore
 END
 
     push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+    
+    # We've already added the header for this file in implFixedHeader, so remove
+    # it from implIncludes to ensure we don't #include it twice.
+    delete $implIncludes{"${className}.h"};
 }
 
 sub GenerateToV8Converters
@@ -1939,90 +2100,107 @@
     my $interfaceName = shift;
     my $className = shift;
     my $nativeType = shift;
+    my $serializedAttribute = shift;
 
-    my $wrapperType = "V8ClassIndex::" . uc($interfaceName);
     my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
     my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
     my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : "";
 
     push(@implContent, <<END);
 
-v8::Handle<v8::Object> ${className}::wrap(${nativeType}* impl${forceNewObjectInput}) {
-  v8::Handle<v8::Object> wrapper;
-  V8Proxy* proxy = 0;
+v8::Handle<v8::Object> ${className}::wrap(${nativeType}* impl${forceNewObjectInput})
+{
+    v8::Handle<v8::Object> wrapper;
+    V8Proxy* proxy = 0;
 END
 
     if (IsNodeSubType($dataNode)) {
         push(@implContent, <<END);
-  if (impl->document()) {
-    proxy = V8Proxy::retrieve(impl->document()->frame());
-    if (proxy && static_cast<Node*>(impl->document()) == static_cast<Node*>(impl))
-      proxy->windowShell()->initContextIfNeeded();
-  }
+    if (impl->document()) {
+        proxy = V8Proxy::retrieve(impl->document()->frame());
+        if (proxy && static_cast<Node*>(impl->document()) == static_cast<Node*>(impl))
+            proxy->windowShell()->initContextIfNeeded();
+    }
 
 END
     }
 
     if ($domMapFunction) {
-        push(@implContent, "  if (!forceNewObject) {\n") if IsDOMNodeType($interfaceName);
+        push(@implContent, "    if (!forceNewObject) {\n") if IsDOMNodeType($interfaceName);
         if (IsNodeSubType($dataNode)) {
-            push(@implContent, "  wrapper = V8DOMWrapper::getWrapper(impl);\n");
+            push(@implContent, "        wrapper = V8DOMWrapper::getWrapper(impl);\n");
         } else {
-            push(@implContent, "  wrapper = ${domMapFunction}.get(impl);\n");
+            push(@implContent, "        wrapper = ${domMapFunction}.get(impl);\n");
         }
         push(@implContent, <<END);
-  if (!wrapper.IsEmpty())
-    return wrapper;
+        if (!wrapper.IsEmpty())
+            return wrapper;
 END
-        push(@implContent, "  }\n") if IsDOMNodeType($interfaceName);
+        push(@implContent, "    }\n") if IsDOMNodeType($interfaceName);
     }
     if (IsNodeSubType($dataNode)) {
         push(@implContent, <<END);
 
-  v8::Handle<v8::Context> context;
-  if (proxy)
-    context = proxy->context();
+    v8::Handle<v8::Context> context;
+    if (proxy)
+        context = proxy->context();
 
-  // Enter the node's context and create the wrapper in that context.
-  if (!context.IsEmpty())
-    context->Enter();
+    // Enter the node's context and create the wrapper in that context.
+    if (!context.IsEmpty())
+        context->Enter();
 END
     }
 
     push(@implContent, <<END);
-  wrapper = V8DOMWrapper::instantiateV8Object(proxy, ${wrapperType}, impl);
+    wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
 END
-
     if (IsNodeSubType($dataNode)) {
         push(@implContent, <<END);
-  // Exit the node's context if it was entered.
-  if (!context.IsEmpty())
-    context->Exit();
+    // Exit the node's context if it was entered.
+    if (!context.IsEmpty())
+        context->Exit();
 END
     }
 
     push(@implContent, <<END);
-  if (wrapper.IsEmpty())
-    return wrapper;
+    if (wrapper.IsEmpty())
+        return wrapper;
 END
-    push(@implContent, "\n  impl->ref();\n") if IsRefPtrType($interfaceName);
+    push(@implContent, "\n    impl->ref();\n") if IsRefPtrType($interfaceName);
+
+    # Eagerly deserialize attributes of type SerializedScriptValue
+    # while we're in the right context.
+    if ($serializedAttribute) {
+        die "Attribute of type SerializedScriptValue expected" if $serializedAttribute->signature->type ne "SerializedScriptValue";
+        my $attrName = $serializedAttribute->signature->name;
+        my $attrAttr = "v8::DontDelete";
+        if ($serializedAttribute->type =~ /^readonly/) {
+            $attrAttr .= " | v8::ReadOnly";
+        }
+        $attrAttr = "static_cast<v8::PropertyAttribute>($attrAttr)";
+        my $getterFunc = $codeGenerator->WK_lcfirst($attrName);
+        push(@implContent, <<END);
+    SerializedScriptValue::deserializeAndSetProperty(wrapper, "${attrName}", ${attrAttr}, impl->${getterFunc}());
+END
+    }
 
     if ($domMapFunction) {
         push(@implContent, <<END);
-  ${domMapFunction}.set(impl, v8::Persistent<v8::Object>::New(wrapper));
+    ${domMapFunction}.set(impl, v8::Persistent<v8::Object>::New(wrapper));
 END
     }
 
     push(@implContent, <<END);
-  return wrapper;
+    return wrapper;
 }
 END
 
     if (IsRefPtrType($interfaceName)) {
         push(@implContent, <<END);
 
-v8::Handle<v8::Value> toV8(PassRefPtr<${nativeType} > impl${forceNewObjectInput}) {
-  return toV8(impl.get()${forceNewObjectCall});
+v8::Handle<v8::Value> toV8(PassRefPtr<${nativeType} > impl${forceNewObjectInput})
+{
+    return toV8(impl.get()${forceNewObjectCall});
 }
 END
     }
@@ -2030,10 +2208,11 @@
     if (!HasCustomToV8Implementation($dataNode, $interfaceName)) {
         push(@implContent, <<END);
 
-v8::Handle<v8::Value> toV8(${nativeType}* impl${forceNewObjectInput}) {
-  if (!impl)
-    return v8::Null();
-  return ${className}::wrap(impl${forceNewObjectCall});
+v8::Handle<v8::Value> toV8(${nativeType}* impl${forceNewObjectInput})
+{
+    if (!impl)
+        return v8::Null();
+    return ${className}::wrap(impl${forceNewObjectCall});
 }
 END
     }
@@ -2045,21 +2224,18 @@
     $interfaceName = shift;
 
     # We generate a custom converter (but JSC doesn't) for the following:
-    return 1 if $interfaceName eq "BarInfo";
     return 1 if $interfaceName eq "CSSStyleSheet";
     return 1 if $interfaceName eq "CanvasPixelArray";
-    return 1 if $interfaceName eq "DOMSelection";
     return 1 if $interfaceName eq "DOMWindow";
     return 1 if $interfaceName eq "Element";
-    return 1 if $interfaceName eq "Location";
     return 1 if $interfaceName eq "HTMLDocument";
     return 1 if $interfaceName eq "HTMLElement";
-    return 1 if $interfaceName eq "History";
+    return 1 if $interfaceName eq "Location";
     return 1 if $interfaceName eq "NamedNodeMap";
-    return 1 if $interfaceName eq "Navigator";
     return 1 if $interfaceName eq "SVGDocument";
     return 1 if $interfaceName eq "SVGElement";
-    return 1 if $interfaceName eq "Screen";
+    return 1 if $interfaceName eq "ScriptProfile";
+    return 1 if $interfaceName eq "ScriptProfileNode";
     return 1 if $interfaceName eq "WorkerContext";
     # We don't generate a custom converter (but JSC does) for the following:
     return 0 if $interfaceName eq "AbstractWorker";
@@ -2076,7 +2252,7 @@
     my $dataNode = shift;
     my $type = shift;
     return "getDOMSVGElementInstanceMap()" if $type eq "SVGElementInstance";
-    return "getDOMNodeMap()" if IsNodeSubType($dataNode);
+    return "getDOMNodeMap()" if ($dataNode && IsNodeSubType($dataNode));
     # Only use getDOMSVGObjectWithContextMap() for non-node svg objects
     return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/;
     return "" if $type eq "DOMImplementation";
@@ -2088,6 +2264,7 @@
 {
     # FIXME: Consider making this an .idl attribute.
     my $type = shift;
+    return 1 if $type eq "EventSource";
     return 1 if $type eq "MessagePort";
     return 1 if $type eq "XMLHttpRequest";
     return 1 if $type eq "WebSocket";
@@ -2201,9 +2378,7 @@
     if ($returnType eq "void") {
         $result .= $indent . "$functionString;\n";
     } elsif ($copyFirst) {
-        $result .=
-            $indent . GetNativeType($returnType, 0) . " result = *imp;\n" .
-            $indent . "$functionString;\n";
+        $result .= $indent . GetNativeType($returnType, 0) . " result = *imp;\n" . $indent . "$functionString;\n";
     } elsif ($returnsListItemPodType) {
         $result .= $indent . "RefPtr<SVGPODListItem<$nativeReturnType> > result = $functionString;\n";
     } elsif (@{$function->raisesExceptions} or $returnsPodType or $isPodType or IsSVGTypeNeedingContextParameter($returnType)) {
@@ -2215,7 +2390,7 @@
     }
 
     if (@{$function->raisesExceptions}) {
-        $result .= $indent . "if (UNLIKELY(ec)) goto fail;\n";
+        $result .= $indent . "if (UNLIKELY(ec))\n" . $indent . "    goto fail;\n";
     }
 
     # If the return type is a POD type, separate out the wrapper generation
@@ -2253,7 +2428,7 @@
             $generatedSVGContextRetrieval = 1;
         }
 
-        $result .= $indent . "imp_wrapper->commitChange(imp_instance, context);\n";
+        $result .= $indent . "impWrapper->commitChange(impInstance, context);\n";
     }
 
     if ($returnsPodType) {
@@ -2355,6 +2530,7 @@
     return "unsigned" if $type eq "unsigned int";
     return "Node*" if $type eq "EventTarget" and $isParameter;
     return "double" if $type eq "Date";
+    return "ScriptValue" if $type eq "DOMObject";
 
     return "String" if $type eq "DOMUserData";  # FIXME: Temporary hack?
 
@@ -2370,75 +2546,6 @@
     return "${type}*";
 }
 
-
-my %typeCanFailConversion = (
-    "Attr" => 1,
-    "WebGLArray" => 0,
-    "WebGLBuffer" => 0,
-    "WebGLByteArray" => 0,
-    "WebGLUnsignedByteArray" => 0,
-    "WebGLContextAttributes" => 0,
-    "WebGLFloatArray" => 0,
-    "WebGLFramebuffer" => 0,
-    "CanvasGradient" => 0,
-    "WebGLIntArray" => 0,
-    "CanvasPixelArray" => 0,
-    "WebGLProgram" => 0,
-    "WebGLRenderbuffer" => 0,
-    "WebGLShader" => 0,
-    "WebGLShortArray" => 0,
-    "WebGLTexture" => 0,
-    "WebGLUniformLocation" => 0,
-    "CompareHow" => 0,
-    "DataGridColumn" => 0,
-    "DOMString" => 0,
-    "DOMWindow" => 0,
-    "DocumentType" => 0,
-    "Element" => 0,
-    "Event" => 0,
-    "EventListener" => 0,
-    "EventTarget" => 0,
-    "HTMLCanvasElement" => 0,
-    "HTMLElement" => 0,
-    "HTMLImageElement" => 0,
-    "HTMLOptionElement" => 0,
-    "HTMLVideoElement" => 0,
-    "Node" => 0,
-    "NodeFilter" => 0,
-    "MessagePort" => 0,
-    "NSResolver" => 0,
-    "Range" => 0,
-    "SQLResultSet" => 0,
-    "Storage" => 0,
-    "SVGAngle" => 1,
-    "SVGElement" => 0,
-    "SVGLength" => 1,
-    "SVGMatrix" => 1,
-    "SVGNumber" => 0,
-    "SVGPaintType" => 0,
-    "SVGPathSeg" => 0,
-    "SVGPoint" => 1,
-    "SVGPreserveAspectRatio" => 1,
-    "SVGRect" => 1,
-    "SVGTransform" => 1,
-    "TouchList" => 0,
-    "VoidCallback" => 1,
-    "WebKitCSSMatrix" => 0,
-    "WebKitPoint" => 0,
-    "XPathEvaluator" => 0,
-    "XPathNSResolver" => 0,
-    "XPathResult" => 0,
-    "boolean" => 0,
-    "double" => 0,
-    "float" => 0,
-    "long" => 0,
-    "unsigned long" => 0,
-    "unsigned short" => 0,
-    "long long" => 0,
-    "unsigned long long" => 0
-);
-
-
 sub TranslateParameter
 {
     my $signature = shift;
@@ -2471,10 +2578,9 @@
     my $type = GetTypeFromSignature($signature);
 
     $implIncludes{"ExceptionCode.h"} = 1 if $type eq "Attr";
-
-    return $typeCanFailConversion{$type} if exists $typeCanFailConversion{$type};
-
-    die "Don't know whether a JS value can fail conversion to type $type.";
+    return 1 if $type eq "Attr";
+    return 1 if $type eq "VoidCallback";
+    return BasicTypeCanFailConversion($signature);
 }
 
 sub JSValueToNative
@@ -2501,9 +2607,11 @@
         return $value;
     }
 
-    if ($type eq "SerializedScriptValue") {
-        $implIncludes{"SerializedScriptValue.h"} = 1;
-        return "SerializedScriptValue::create($value)";
+    die "Unexpected SerializedScriptValue" if $type eq "SerializedScriptValue";
+
+    if ($type eq "DOMObject") {
+        $implIncludes{"ScriptValue.h"} = 1;
+        return "ScriptValue($value)";
     }
 
     if ($type eq "NodeFilter") {
@@ -2539,17 +2647,13 @@
         # return NULL.
         return "V8${type}::HasInstance($value) ? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0";
     } else {
-        # TODO: Temporary to avoid Window name conflict.
-        my $classIndex = uc($type);
-        my $implClassName = ${type};
-
         $implIncludes{"V8$type.h"} = 1;
 
         if (IsPodType($type)) {
             my $nativeType = GetNativeType($type);
             $implIncludes{"V8SVGPODTypeWrapper.h"} = 1;
 
-            return "V8SVGPODTypeUtil::toSVGPODType<${nativeType}>(V8ClassIndex::${classIndex}, $value${maybeOkParam})"
+            return "V8SVGPODTypeUtil::toSVGPODType<${nativeType}>(&V8${type}::info, $value${maybeOkParam})"
         }
 
         $implIncludes{"V8${type}.h"} = 1;
@@ -2560,7 +2664,6 @@
     }
 }
 
-
 sub GetV8HeaderName
 {
     my $type = shift;
@@ -2568,17 +2671,17 @@
     return "EventListener.h" if $type eq "EventListener";
     return "EventTarget.h" if $type eq "EventTarget";
     return "SerializedScriptValue.h" if $type eq "SerializedScriptValue";
+    return "ScriptValue.h" if $type eq "DOMObject";
     return "V8${type}.h";
 }
 
-
 sub CreateCustomSignature
 {
     my $function = shift;
     my $count = @{$function->parameters};
     my $name = $function->signature->name;
-    my $result = "  const int ${name}_argc = ${count};\n" .
-      "  v8::Handle<v8::FunctionTemplate> ${name}_argv[${name}_argc] = { ";
+    my $result = "    const int ${name}Argc = ${count};\n" .
+      "    v8::Handle<v8::FunctionTemplate> ${name}Argv[${name}Argc] = { ";
     my $first = 1;
     foreach my $parameter (@{$function->parameters}) {
         if ($first) { $first = 0; }
@@ -2599,7 +2702,7 @@
         }
     }
     $result .= " };\n";
-    $result .= "  v8::Handle<v8::Signature> ${name}_signature = v8::Signature::New(desc, ${name}_argc, ${name}_argv);\n";
+    $result .= "    v8::Handle<v8::Signature> ${name}Signature = v8::Signature::New(desc, ${name}Argc, ${name}Argv);\n";
     return $result;
 }
 
@@ -2612,11 +2715,21 @@
         $function->signature->extendedAttributes->{"V8Custom"}) {
         return 0;
     }
+    # No signature needed for overloaded function
+    if (@{$function->{overloads}} > 1) {
+        return 0;
+    }
 
     foreach my $parameter (@{$function->parameters}) {
-      if (IsWrapperType($parameter->type)) {
-          return 1;
-      }
+        if ($parameter->extendedAttributes->{"Optional"}) {
+            return 0;
+        }
+    }
+
+    foreach my $parameter (@{$function->parameters}) {
+        if (IsWrapperType($parameter->type)) {
+            return 1;
+        }
     }
     return 0;
 }
@@ -2625,6 +2738,8 @@
 my %non_wrapper_types = (
     'float' => 1,
     'double' => 1,
+    'int' => 1,
+    'unsigned int' => 1,
     'short' => 1,
     'unsigned short' => 1,
     'long' => 1,
@@ -2645,6 +2760,7 @@
     'SVGPaintType' => 1,
     'DOMTimeStamp' => 1,
     'JSObject' => 1,
+    'DOMObject' => 1,
     'EventTarget' => 1,
     'NodeFilter' => 1,
     'EventListener' => 1
@@ -2704,8 +2820,9 @@
     return "return v8::Integer::New($value)" if $nativeType eq "int";
     return "return v8::Integer::NewFromUnsigned($value)" if $nativeType eq "unsigned";
 
-    return "return v8DateOrNull($value);" if $type eq "Date";
+    return "return v8DateOrNull($value)" if $type eq "Date";
     return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
+    return "return $value.v8Value()" if $nativeType eq "ScriptValue";
 
     if ($codeGenerator->IsStringType($type)) {
         my $conv = $signature->extendedAttributes->{"ConvertNullStringTo"};
@@ -2775,7 +2892,11 @@
             my $checkType = $implInclude;
             $checkType =~ s/\.h//;
 
-            print $IMPL "#include \"$implInclude\"\n" unless $codeGenerator->IsSVGAnimatedType($checkType);
+            if ($implInclude =~ /wtf/) {
+                print $IMPL "#include \<$implInclude\>\n";
+            } else {
+                print $IMPL "#include \"$implInclude\"\n" unless $codeGenerator->IsSVGAnimatedType($checkType);
+            }
         }
 
         print $IMPL "\n";
@@ -2833,7 +2954,7 @@
 
     my $srcObject = "imp";
     if ($srcIsPodType) {
-        $srcObject = "imp_wrapper";
+        $srcObject = "impWrapper";
     }
 
     my $contextDecl;
@@ -2882,6 +3003,15 @@
     return 0;
 }
 
+sub GetVisibleInterfaceName
+{
+    my $interfaceName = shift;
+
+    return "DOMException" if $interfaceName eq "DOMCoreException";
+    return "FormData" if $interfaceName eq "DOMFormData";
+    return $interfaceName;
+}
+
 sub DebugPrint
 {
     my $output = shift;
diff --git a/WebCore/bindings/scripts/IDLParser.pm b/WebCore/bindings/scripts/IDLParser.pm
index b2577d2..7db7747 100644
--- a/WebCore/bindings/scripts/IDLParser.pm
+++ b/WebCore/bindings/scripts/IDLParser.pm
@@ -14,7 +14,7 @@
 # Library General Public License for more details.
 # 
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 # 
@@ -64,7 +64,14 @@
     $parentsOnly = shift;
 
     if (!$preprocessor) {
-        $preprocessor = "/usr/bin/gcc -E -P -x c++";
+        require Config;
+        my $gccLocation = "";
+        if (($Config::Config{'osname'}) =~ /solaris/i) {
+            $gccLocation = "/usr/sfw/bin/gcc";
+        } else {
+            $gccLocation = "/usr/bin/gcc";
+        }
+        $preprocessor = $gccLocation . " -E -P -x c++";
     }
 
     if (!$defines) {
diff --git a/WebCore/bindings/scripts/IDLStructure.pm b/WebCore/bindings/scripts/IDLStructure.pm
index f5970b4..6224e54 100644
--- a/WebCore/bindings/scripts/IDLStructure.pm
+++ b/WebCore/bindings/scripts/IDLStructure.pm
@@ -14,7 +14,7 @@
 # Library General Public License for more details.
 # 
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 # 
diff --git a/WebCore/bindings/scripts/generate-bindings.pl b/WebCore/bindings/scripts/generate-bindings.pl
index ad29dc5..44ed4d3 100755
--- a/WebCore/bindings/scripts/generate-bindings.pl
+++ b/WebCore/bindings/scripts/generate-bindings.pl
@@ -16,7 +16,7 @@
 # Library General Public License for more details.
 # 
 # You should have received a copy of the GNU Library General Public License
-# aint with this library; see the file COPYING.LIB.  If not, write to
+# 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.
 # 
diff --git a/WebCore/bindings/scripts/gobject-generate-headers.pl b/WebCore/bindings/scripts/gobject-generate-headers.pl
new file mode 100644
index 0000000..1017406
--- /dev/null
+++ b/WebCore/bindings/scripts/gobject-generate-headers.pl
@@ -0,0 +1,77 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2009 Adam Dingle <adam@yorba.org>
+#
+# This file is part of WebKit
+# 
+# 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
+# aint 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.
+# 
+
+my $classlist = <STDIN>;
+chomp($classlist);
+my @classes = split / /, $classlist;
+@classes = sort @classes;
+
+print <<EOF;
+/* This file is part of the WebKit open source project.
+   This file has been generated by gobject-generate-headers.pl.  DO NOT MODIFY!
+   
+   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.
+*/
+
+EOF
+
+my $outType = $ARGV[0];
+my $header;
+if ($outType eq "defines") {
+    $header = "webkitdomdefines_h";
+} elsif ($outType eq "gdom") {
+    $header = "webkitdom_h";
+} else {
+    die "unknown output type";
+}
+
+print "#ifndef ${header}\n";
+print "#define ${header}\n";
+print "\n";
+
+if ($outType eq "defines") {
+    foreach my $class (@classes) {
+        print "typedef struct _WebKitDOM${class} WebKitDOM${class};\n";
+        print "typedef struct _WebKitDOM${class}Class WebKitDOM${class}Class;\n";
+        print "\n";
+    }
+} elsif ($outType eq "gdom") {
+    foreach my $class (@classes) {
+        print "#include <webkit/WebKitDOM${class}.h>\n";
+    }
+}
+
+print "\n";
+print "#endif\n";
diff --git a/WebCore/bindings/v8/DOMData.cpp b/WebCore/bindings/v8/DOMData.cpp
index 417426f..568fc2c 100644
--- a/WebCore/bindings/v8/DOMData.cpp
+++ b/WebCore/bindings/v8/DOMData.cpp
@@ -39,9 +39,7 @@
 namespace WebCore {
 
 DOMData::DOMData()
-    : m_delayedProcessingScheduled(false)
-    , m_isMainThread(WTF::isMainThread())
-    , m_owningThread(WTF::currentThread())
+    : m_owningThread(WTF::currentThread())
 {
 }
 
@@ -58,72 +56,9 @@
     return childThreadDOMData;
 }
 
-void DOMData::ensureDeref(V8ClassIndex::V8WrapperType type, void* domObject)
+void DOMData::derefObject(WrapperTypeInfo* type, void* domObject)
 {
-    if (m_owningThread == WTF::currentThread()) {
-        // No need to delay the work. We can deref right now.
-        derefObject(type, domObject);
-        return;
-    }
-
-    // We need to do the deref on the correct thread.
-    m_delayedObjectMap.set(domObject, type);
-
-    // Post a task to the owning thread in order to process the delayed queue.
-    // FIXME: For now, we can only post to main thread due to WTF task posting limitation. We will fix this when we work on nested worker.
-    if (!m_delayedProcessingScheduled) {
-        m_delayedProcessingScheduled = true;
-        if (isMainThread())
-            WTF::callOnMainThread(&derefDelayedObjectsInCurrentThread, 0);
-    }
-}
-
-void DOMData::derefObject(V8ClassIndex::V8WrapperType type, void* domObject)
-{
-    switch (type) {
-    case V8ClassIndex::NODE:
-        static_cast<Node*>(domObject)->deref();
-        break;
-
-#define MakeCase(type, name)   \
-        case V8ClassIndex::type: static_cast<name*>(domObject)->deref(); break;
-    DOM_OBJECT_TYPES(MakeCase)   // This includes both active and non-active.
-#undef MakeCase
-
-#if ENABLE(SVG)
-#define MakeCase(type, name)     \
-        case V8ClassIndex::type: static_cast<name*>(domObject)->deref(); break;
-    SVG_OBJECT_TYPES(MakeCase)   // This also includes SVGElementInstance.
-#undef MakeCase
-
-#define MakeCase(type, name)     \
-        case V8ClassIndex::type:    \
-            static_cast<V8SVGPODTypeWrapper<name>*>(domObject)->deref(); break;
-    SVG_POD_NATIVE_TYPES(MakeCase)
-#undef MakeCase
-#endif
-
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-}
-
-void DOMData::derefDelayedObjects()
-{
-    WTF::MutexLocker locker(DOMDataStore::allStoresMutex());
-
-    m_delayedProcessingScheduled = false;
-
-    for (DelayedObjectMap::iterator iter(m_delayedObjectMap.begin()); iter != m_delayedObjectMap.end(); ++iter)
-        derefObject(iter->second, iter->first);
-
-    m_delayedObjectMap.clear();
-}
-
-void DOMData::derefDelayedObjectsInCurrentThread(void*)
-{
-    getCurrent()->derefDelayedObjects();
+    type->derefObject(domObject);
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/DOMData.h b/WebCore/bindings/v8/DOMData.h
index 7fa9e7d..4d7331b 100644
--- a/WebCore/bindings/v8/DOMData.h
+++ b/WebCore/bindings/v8/DOMData.h
@@ -32,6 +32,7 @@
 #define DOMData_h
 
 #include "DOMDataStore.h"
+#include "V8DOMWrapper.h"
 
 namespace WebCore {
 
@@ -53,62 +54,39 @@
         template<typename T>
         static void handleWeakObject(DOMDataStore::DOMWrapperMapType, v8::Persistent<v8::Object>, T* domObject);
 
-        void forgetDelayedObject(void* object) { m_delayedObjectMap.take(object); }
-
-        // This is to ensure that we will deref DOM objects from the owning thread,
-        // not the GC thread. The helper function will be scheduled by the GC
-        // thread to get called from the owning thread.
-        static void derefDelayedObjectsInCurrentThread(void*);
-        void derefDelayedObjects();
-
         template<typename T>
         static void removeObjectsFromWrapperMap(AbstractWeakReferenceMap<T, v8::Object>& domMap);
 
         ThreadIdentifier owningThread() const { return m_owningThread; }
 
     private:
-        typedef WTF::HashMap<void*, V8ClassIndex::V8WrapperType> DelayedObjectMap;
-
-        void ensureDeref(V8ClassIndex::V8WrapperType type, void* domObject);
-        static void derefObject(V8ClassIndex::V8WrapperType type, void* domObject);
+        static void derefObject(WrapperTypeInfo* type, void* domObject);
 
         template<typename T>
         class WrapperMapObjectRemover : public WeakReferenceMap<T, v8::Object>::Visitor {
         public:
             virtual void visitDOMWrapper(T* domObject, v8::Persistent<v8::Object> v8Object)
             {
-                V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(v8Object);
+                WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(v8Object);
                 derefObject(type, domObject);
                 v8Object.Dispose();
             }
         };
 
-        // Stores all the DOM objects that are delayed to be processed when the
-        // owning thread gains control.
-        DelayedObjectMap m_delayedObjectMap;
-
-        // The flag to indicate if the task to do the delayed process has
-        // already been posted.
-        bool m_delayedProcessingScheduled;
-
-        bool m_isMainThread;
         ThreadIdentifier m_owningThread;
     };
 
     template<typename T>
     void DOMData::handleWeakObject(DOMDataStore::DOMWrapperMapType mapType, v8::Persistent<v8::Object> v8Object, T* domObject)
     {
-        ASSERT(WTF::isMainThread());
         DOMDataList& list = DOMDataStore::allStores();
         for (size_t i = 0; i < list.size(); ++i) {
             DOMDataStore* store = list[i];
+            ASSERT(store->domData()->owningThread() == WTF::currentThread());
 
-            DOMDataStore::InternalDOMWrapperMap<T>* domMap = static_cast<DOMDataStore::InternalDOMWrapperMap<T>*>(store->getDOMWrapperMap(mapType));
-
-            if (domMap->removeIfPresent(domObject, v8Object)) {
-                ASSERT(store->domData()->owningThread() == WTF::currentThread());
+            DOMWrapperMap<T>* domMap = static_cast<DOMWrapperMap<T>*>(store->getDOMWrapperMap(mapType));
+            if (domMap->removeIfPresent(domObject, v8Object))
                 store->domData()->derefObject(V8DOMWrapper::domWrapperType(v8Object), domObject);
-            }
         }
     }
 
diff --git a/WebCore/bindings/v8/DOMDataStore.cpp b/WebCore/bindings/v8/DOMDataStore.cpp
index e181ebc..5d609d8 100644
--- a/WebCore/bindings/v8/DOMDataStore.cpp
+++ b/WebCore/bindings/v8/DOMDataStore.cpp
@@ -114,11 +114,6 @@
     return staticDOMDataListMutex;
 }
 
-void DOMDataStore::forgetDelayedObject(DOMData* domData, void* object)
-{
-    domData->forgetDelayedObject(object);
-}
-
 void* DOMDataStore::getDOMWrapperMap(DOMWrapperMapType type)
 {
     switch (type) {
diff --git a/WebCore/bindings/v8/DOMDataStore.h b/WebCore/bindings/v8/DOMDataStore.h
index 54a49e7..c39a0ed 100644
--- a/WebCore/bindings/v8/DOMDataStore.h
+++ b/WebCore/bindings/v8/DOMDataStore.h
@@ -31,7 +31,7 @@
 #ifndef DOMDataStore_h
 #define DOMDataStore_h
 
-#include "DOMObjectsInclude.h"
+#include "V8DOMMap.h"
 #include "V8Node.h"
 
 #include <v8.h>
@@ -47,6 +47,7 @@
 namespace WebCore {
 
     class DOMData;
+    class DOMDataStore;
 
     typedef WTF::Vector<DOMDataStore*> DOMDataList;
 
@@ -160,22 +161,6 @@
 #endif
         };
 
-        template <class KeyType>
-        class InternalDOMWrapperMap : public DOMWrapperMap<KeyType> {
-        public:
-            InternalDOMWrapperMap(DOMData* domData, v8::WeakReferenceCallback callback)
-                : DOMWrapperMap<KeyType>(callback), m_domData(domData) { }
-
-            virtual void forget(KeyType* object)
-            {
-                DOMWrapperMap<KeyType>::forget(object);
-                forgetDelayedObject(m_domData, object);
-            }
-
-        private:
-            DOMData* m_domData;
-        };
-
         class IntrusiveDOMWrapperMap : public AbstractWeakReferenceMap<Node, v8::Object> {
         public:
             IntrusiveDOMWrapperMap(v8::WeakReferenceCallback callback)
@@ -252,25 +237,21 @@
         DOMDataStore(DOMData*);
         virtual ~DOMDataStore();
 
-        // A list of all DOMDataStore objects.  Traversed during GC to find a thread-specific map that
-        // contains the object - so we can schedule the object to be deleted on the thread which created it.
+        // A list of all DOMDataStore objects in the current V8 instance (thread). Normally, each World has a DOMDataStore.
         static DOMDataList& allStores();
         // Mutex to protect against concurrent access of DOMDataList.
         static WTF::Mutex& allStoresMutex();
 
-        // Helper function to avoid circular includes.
-        static void forgetDelayedObject(DOMData*, void* object);
-
         DOMData* domData() const { return m_domData; }
 
         void* getDOMWrapperMap(DOMWrapperMapType);
 
         DOMNodeMapping& domNodeMap() { return *m_domNodeMap; }
-        InternalDOMWrapperMap<void>& domObjectMap() { return *m_domObjectMap; }
-        InternalDOMWrapperMap<void>& activeDomObjectMap() { return *m_activeDomObjectMap; }
+        DOMWrapperMap<void>& domObjectMap() { return *m_domObjectMap; }
+        DOMWrapperMap<void>& activeDomObjectMap() { return *m_activeDomObjectMap; }
 #if ENABLE(SVG)
-        InternalDOMWrapperMap<SVGElementInstance>& domSvgElementInstanceMap() { return *m_domSvgElementInstanceMap; }
-        InternalDOMWrapperMap<void>& domSvgObjectWithContextMap() { return *m_domSvgObjectWithContextMap; }
+        DOMWrapperMap<SVGElementInstance>& domSvgElementInstanceMap() { return *m_domSvgElementInstanceMap; }
+        DOMWrapperMap<void>& domSvgObjectWithContextMap() { return *m_domSvgObjectWithContextMap; }
 #endif
 
         // Need by V8GCController.
@@ -286,11 +267,11 @@
 #endif
         
         DOMNodeMapping* m_domNodeMap;
-        InternalDOMWrapperMap<void>* m_domObjectMap;
-        InternalDOMWrapperMap<void>* m_activeDomObjectMap;
+        DOMWrapperMap<void>* m_domObjectMap;
+        DOMWrapperMap<void>* m_activeDomObjectMap;
 #if ENABLE(SVG)
-        InternalDOMWrapperMap<SVGElementInstance>* m_domSvgElementInstanceMap;
-        InternalDOMWrapperMap<void>* m_domSvgObjectWithContextMap;
+        DOMWrapperMap<SVGElementInstance>* m_domSvgElementInstanceMap;
+        DOMWrapperMap<void>* m_domSvgObjectWithContextMap;
 #endif
 
     private:
diff --git a/WebCore/bindings/v8/DOMWrapperWorld.h b/WebCore/bindings/v8/DOMWrapperWorld.h
index f54cd4e..2a9df30 100644
--- a/WebCore/bindings/v8/DOMWrapperWorld.h
+++ b/WebCore/bindings/v8/DOMWrapperWorld.h
@@ -43,6 +43,7 @@
 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
 public:
     static PassRefPtr<DOMWrapperWorld> create() { return adoptRef(new DOMWrapperWorld()); }
+    virtual ~DOMWrapperWorld() {}
 
 protected:
     DOMWrapperWorld();
diff --git a/WebCore/bindings/v8/DateExtension.cpp b/WebCore/bindings/v8/DateExtension.cpp
index abf8967..f2b6242 100644
--- a/WebCore/bindings/v8/DateExtension.cpp
+++ b/WebCore/bindings/v8/DateExtension.cpp
@@ -88,7 +88,7 @@
         return;
 
     v8::Handle<v8::Value> argv[1];
-    argv[0] = v8::String::New(allow ? "false" : "true");
+    argv[0] = v8::Boolean::New(!allow);
     v8::Handle<v8::Function>::Cast(sleepFunctionHandle)->Call(v8::Object::New(), 1, argv);
 }
 
diff --git a/WebCore/bindings/v8/JavaScriptCallFrame.cpp b/WebCore/bindings/v8/JavaScriptCallFrame.cpp
new file mode 100644
index 0000000..049321b
--- /dev/null
+++ b/WebCore/bindings/v8/JavaScriptCallFrame.cpp
@@ -0,0 +1,120 @@
+/*
+ * 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 "JavaScriptCallFrame.h"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "V8Binding.h"
+
+namespace WebCore {
+
+JavaScriptCallFrame::JavaScriptCallFrame(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame)
+    : m_debuggerContext(debuggerContext)
+    , m_callFrame(callFrame)
+{
+}
+
+JavaScriptCallFrame::~JavaScriptCallFrame()
+{
+}
+
+JavaScriptCallFrame* JavaScriptCallFrame::caller()
+{
+    if (!m_caller) {
+        v8::HandleScope handleScope;
+        v8::Context::Scope contextScope(m_debuggerContext.get());
+        v8::Handle<v8::Value> callerFrame = m_callFrame.get()->Get(v8String("caller"));
+        if (!callerFrame->IsObject())
+            return 0;
+        m_caller = JavaScriptCallFrame::create(m_debuggerContext.get(), v8::Handle<v8::Object>::Cast(callerFrame));
+    }
+    return m_caller.get();
+}
+
+int JavaScriptCallFrame::sourceID() const
+{
+    v8::HandleScope handleScope;
+    v8::Context::Scope contextScope(m_debuggerContext.get());
+    v8::Handle<v8::Value> result = m_callFrame.get()->Get(v8String("sourceID"));
+    if (result->IsInt32())
+        return result->Int32Value();
+    return 0;
+}
+
+int JavaScriptCallFrame::line() const
+{
+    v8::HandleScope handleScope;
+    v8::Context::Scope contextScope(m_debuggerContext.get());
+    v8::Handle<v8::Value> result = m_callFrame.get()->Get(v8String("line"));
+    if (result->IsInt32())
+        return result->Int32Value();
+    return 0;
+}
+
+String JavaScriptCallFrame::functionName() const
+{
+    v8::HandleScope handleScope;
+    v8::Context::Scope contextScope(m_debuggerContext.get());
+    v8::Handle<v8::Value> result = m_callFrame.get()->Get(v8String("functionName"));
+    return toWebCoreString(result);
+}
+
+v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const
+{
+    v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(m_callFrame.get()->Get(v8String("scopeChain")));
+    v8::Handle<v8::Array> result = v8::Array::New(scopeChain->Length());
+    for (uint32_t i = 0; i < scopeChain->Length(); i++)
+        result->Set(i, scopeChain->Get(i));
+    return result;
+}
+
+int JavaScriptCallFrame::scopeType(int scopeIndex) const
+{
+    v8::Handle<v8::Array> scopeType = v8::Handle<v8::Array>::Cast(m_callFrame.get()->Get(v8String("scopeType")));
+    return scopeType->Get(scopeIndex)->Int32Value();
+}
+
+v8::Handle<v8::Value> JavaScriptCallFrame::thisObject() const
+{
+    return m_callFrame.get()->Get(v8String("thisObject"));
+}
+
+v8::Handle<v8::Value> JavaScriptCallFrame::evaluate(const String& expression)
+{
+    v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(m_callFrame.get()->Get(v8String("evaluate")));
+    v8::Handle<v8::Value> argv[] = { v8String(expression) };
+    return evalFunction->Call(m_callFrame.get(), 1, argv);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/v8/JavaScriptCallFrame.h b/WebCore/bindings/v8/JavaScriptCallFrame.h
new file mode 100644
index 0000000..95a0510
--- /dev/null
+++ b/WebCore/bindings/v8/JavaScriptCallFrame.h
@@ -0,0 +1,74 @@
+/*
+ * 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 JavaScriptCallFrame_h
+#define JavaScriptCallFrame_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "OwnHandle.h"
+#include "PlatformString.h"
+#include <v8-debug.h>
+
+namespace WebCore {
+
+class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
+public:
+    static PassRefPtr<JavaScriptCallFrame> create(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame)
+    {
+        return adoptRef(new JavaScriptCallFrame(debuggerContext, callFrame));
+    }
+    ~JavaScriptCallFrame();
+
+    JavaScriptCallFrame* caller();
+
+    int sourceID() const;
+    int line() const;
+    String functionName() const;
+    
+    v8::Handle<v8::Value> scopeChain() const;
+    int scopeType(int scopeIndex) const;
+    v8::Handle<v8::Value> thisObject() const;
+    
+    v8::Handle<v8::Value> evaluate(const String& expression);
+    
+private:
+    JavaScriptCallFrame(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame);
+
+    RefPtr<JavaScriptCallFrame> m_caller;
+    OwnHandle<v8::Context> m_debuggerContext;
+    OwnHandle<v8::Object> m_callFrame;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // JavaScriptCallFrame_h
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index 06243d4..56f9810 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -36,9 +36,9 @@
 #include "ScriptController.h"
 #include "V8GCController.h"
 #include "V8Helpers.h"
-#include "V8Index.h"
 #include "V8NPUtils.h"
 #include "V8Proxy.h"
+#include "WrapperTypeInfo.h"
 #include "npruntime_impl.h"
 #include "npruntime_priv.h"
 
@@ -55,10 +55,20 @@
 using WebCore::npObjectInternalFieldCount;
 using WebCore::toV8Context;
 using WebCore::toV8Proxy;
-using WebCore::V8ClassIndex;
 using WebCore::V8DOMWrapper;
 using WebCore::V8GCController;
 using WebCore::V8Proxy;
+using WebCore::WrapperTypeInfo;
+
+namespace WebCore {
+
+WrapperTypeInfo* npObjectTypeInfo()
+{
+    static WrapperTypeInfo typeInfo = { 0, 0, false };
+    return &typeInfo;
+}
+
+}
 
 // FIXME: Comments on why use malloc and free.
 static NPObject* allocV8NPObject(NPP, NPClass*)
@@ -115,8 +125,8 @@
 {
     // Check to see if this object is already wrapped.
     if (object->InternalFieldCount() == npObjectInternalFieldCount) {
-        v8::Local<v8::Value> typeIndex = object->GetInternalField(WebCore::v8DOMWrapperTypeIndex);
-        if (typeIndex->IsNumber() && typeIndex->Uint32Value() == V8ClassIndex::NPOBJECT) {
+        WrapperTypeInfo* typeInfo = static_cast<WrapperTypeInfo*>(object->GetPointerFromInternalField(WebCore::v8DOMWrapperTypeIndex));
+        if (typeInfo == WebCore::npObjectTypeInfo()) {
 
             NPObject* returnValue = v8ObjectToNPObject(object);
             _NPN_RetainObject(returnValue);
@@ -299,6 +309,9 @@
 
         v8::Handle<v8::Object> obj(object->v8Object);
         v8::Local<v8::Value> v8result = obj->Get(npIdentifierToV8Identifier(propertyName));
+        
+        if (v8result.IsEmpty())
+            return false;
 
         convertV8ObjectToNPVariant(v8result, npObject, result);
         return true;
diff --git a/WebCore/bindings/v8/NPV8Object.h b/WebCore/bindings/v8/NPV8Object.h
index e5550ee..b6fecce 100644
--- a/WebCore/bindings/v8/NPV8Object.h
+++ b/WebCore/bindings/v8/NPV8Object.h
@@ -30,7 +30,7 @@
 #ifndef NPV8Object_h
 #define NPV8Object_h
 
-#include "V8Index.h"
+#include "V8DOMWrapper.h"
 
 #if PLATFORM(CHROMIUM)
 // FIXME: Chromium uses a different npruntime.h, which is in
@@ -48,6 +48,8 @@
     class DOMWindow;
 
     static const int npObjectInternalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+
+    WrapperTypeInfo* npObjectTypeInfo();
 }
 
 extern NPClass* npScriptObjectClass;
diff --git a/WebCore/bindings/v8/ScopedDOMDataStore.cpp b/WebCore/bindings/v8/ScopedDOMDataStore.cpp
index 19cd545..df4a63a 100644
--- a/WebCore/bindings/v8/ScopedDOMDataStore.cpp
+++ b/WebCore/bindings/v8/ScopedDOMDataStore.cpp
@@ -36,12 +36,12 @@
 ScopedDOMDataStore::ScopedDOMDataStore(DOMData* domData)
     : DOMDataStore(domData)
 {
-    m_domNodeMap = new InternalDOMWrapperMap<Node>(domData, &DOMDataStore::weakNodeCallback);
-    m_domObjectMap = new InternalDOMWrapperMap<void>(domData, &DOMDataStore::weakDOMObjectCallback);
-    m_activeDomObjectMap = new InternalDOMWrapperMap<void>(domData, &DOMDataStore::weakActiveDOMObjectCallback);
+    m_domNodeMap = new DOMWrapperMap<Node>(&DOMDataStore::weakNodeCallback);
+    m_domObjectMap = new DOMWrapperMap<void>(&DOMDataStore::weakDOMObjectCallback);
+    m_activeDomObjectMap = new DOMWrapperMap<void>(&DOMDataStore::weakActiveDOMObjectCallback);
 #if ENABLE(SVG)
-    m_domSvgElementInstanceMap = new InternalDOMWrapperMap<SVGElementInstance>(domData, &DOMDataStore::weakSVGElementInstanceCallback);
-    m_domSvgObjectWithContextMap = new InternalDOMWrapperMap<void>(domData, &DOMDataStore::weakSVGObjectWithContextCallback);
+    m_domSvgElementInstanceMap = new DOMWrapperMap<SVGElementInstance>(&DOMDataStore::weakSVGElementInstanceCallback);
+    m_domSvgObjectWithContextMap = new DOMWrapperMap<void>(&DOMDataStore::weakSVGObjectWithContextCallback);
 #endif
 }
 
diff --git a/WebCore/bindings/v8/ScriptCallStack.cpp b/WebCore/bindings/v8/ScriptCallStack.cpp
index 21063ed..45e7205 100644
--- a/WebCore/bindings/v8/ScriptCallStack.cpp
+++ b/WebCore/bindings/v8/ScriptCallStack.cpp
@@ -32,29 +32,33 @@
 #include "ScriptCallStack.h"
 
 #include "ScriptController.h"
+#include "ScriptDebugServer.h"
 
 #include <v8.h>
 
 #include "V8Binding.h"
-#include "V8Proxy.h"
 
 namespace WebCore {
 
 ScriptCallStack* ScriptCallStack::create(const v8::Arguments& arguments, unsigned skipArgumentCount) {
     String sourceName;
     int sourceLineNumber;
-    if (!V8Proxy::sourceName(sourceName)) {
-        return 0;
-    }
-    if (!V8Proxy::sourceLineNumber(sourceLineNumber)) {
-        return 0;
-    }
-    sourceLineNumber += 1;
-    return new ScriptCallStack(arguments, skipArgumentCount, sourceName, sourceLineNumber);
+    String funcName;
+    if (!callLocation(&sourceName, &sourceLineNumber, &funcName))
+      return 0;
+    return new ScriptCallStack(arguments, skipArgumentCount, sourceName, sourceLineNumber, funcName);
 }
 
-ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber)
-    : m_lastCaller(String(), sourceName, sourceLineNumber, arguments, skipArgumentCount)
+bool ScriptCallStack::callLocation(String* sourceName, int* sourceLineNumber, String* functionName)
+{
+    if (!ScriptDebugServer::topStackFrame(*sourceName, *sourceLineNumber, *functionName))
+        return false;
+    *sourceLineNumber += 1;
+    return true;
+}
+
+ScriptCallStack::ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber, String functionName)
+    : m_lastCaller(functionName, sourceName, sourceLineNumber, arguments, skipArgumentCount)
     , m_scriptState(ScriptState::current())
 {
 }
diff --git a/WebCore/bindings/v8/ScriptCallStack.h b/WebCore/bindings/v8/ScriptCallStack.h
index 8ac394c..2433bde 100644
--- a/WebCore/bindings/v8/ScriptCallStack.h
+++ b/WebCore/bindings/v8/ScriptCallStack.h
@@ -47,6 +47,8 @@
         static ScriptCallStack* create(const v8::Arguments&, unsigned skipArgumentCount = 0);
         ~ScriptCallStack();
 
+        static bool callLocation(String* sourceName, int* sourceLineNumber, String* functionName);
+
         const ScriptCallFrame& at(unsigned) const;
         // FIXME: implement retrieving and storing call stack trace
         unsigned size() const { return 1; }
@@ -55,7 +57,7 @@
         ScriptState* globalState() const { return m_scriptState; }
 
     private:
-        ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber);
+        ScriptCallStack(const v8::Arguments& arguments, unsigned skipArgumentCount, String sourceName, int sourceLineNumber, String funcName);
     
         ScriptCallFrame m_lastCaller;
         ScriptState* m_scriptState;
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 40a71be..ee15eaa 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -33,7 +33,6 @@
 #include "ScriptController.h"
 
 #include "PlatformBridge.h"
-#include "CString.h"
 #include "Document.h"
 #include "DOMWindow.h"
 #include "Event.h"
@@ -48,6 +47,7 @@
 #include "NPV8Object.h"
 #include "ScriptSourceCode.h"
 #include "Settings.h"
+#include "UserGestureIndicator.h"
 #include "V8Binding.h"
 #include "V8BindingState.h"
 #include "V8DOMWindow.h"
@@ -59,6 +59,7 @@
 #include "Widget.h"
 #include "XSSAuditor.h"
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -153,9 +154,10 @@
 bool ScriptController::processingUserGesture(DOMWrapperWorld*) const
 {
     Frame* activeFrame = V8Proxy::retrieveFrameForEnteredContext();
-    // No script is running, so it must be run by users.
+    // No script is running, so it is user-initiated unless the gesture stack
+    // explicitly says it is not.
     if (!activeFrame)
-        return true;
+        return UserGestureIndicator::processingUserGesture();
 
     V8Proxy* activeProxy = activeFrame->script()->proxy();
 
@@ -176,7 +178,7 @@
     // Based on code from kjs_bindings.cpp.
     // Note: This is more liberal than Firefox's implementation.
     if (event) {
-        if (event->createdByDOM())
+        if (!UserGestureIndicator::processingUserGesture())
             return false;
 
         const AtomicString& type = event->type();
@@ -190,7 +192,7 @@
 
         if (eventOk)
             return true;
-    } else if (activeProxy->inlineCode() && !activeProxy->timerCallback()) {
+    } else if (m_sourceURL && m_sourceURL->isNull() && !activeProxy->timerCallback()) {
         // This is the <a href="javascript:window.open('...')> case -> we let it through.
         return true;
     }
@@ -219,7 +221,9 @@
 ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode)
 {
     String sourceURL = sourceCode.url();
-    
+    const String* savedSourceURL = m_sourceURL;
+    m_sourceURL = &sourceURL;
+
     if (!m_XSSAuditor->canEvaluate(sourceCode.source())) {
         // This script is not safe to be evaluated.
         return ScriptValue();
@@ -237,9 +241,11 @@
     v8::Local<v8::Value> object = m_proxy->evaluate(sourceCode, 0);
 
     // Evaluating the JavaScript could cause the frame to be deallocated
-    // so we starot the keep alive timer here.
+    // so we start the keep alive timer here.
     m_frame->keepAlive();
 
+    m_sourceURL = savedSourceURL;
+
     if (object.IsEmpty() || object->IsUndefined())
         return ScriptValue();
 
@@ -402,7 +408,7 @@
     if (m_windowScriptNPObject)
         return m_windowScriptNPObject;
 
-    if (canExecuteScripts()) {
+    if (canExecuteScripts(NotAboutToExecuteScript)) {
         // JavaScript is enabled, so there is a JavaScript window object.
         // Return an NPObject bound to the window object.
         m_windowScriptNPObject = createScriptObject(m_frame);
@@ -419,7 +425,7 @@
 NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement* plugin)
 {
     // Can't create NPObjects when JavaScript is disabled.
-    if (!canExecuteScripts())
+    if (!canExecuteScripts(NotAboutToExecuteScript))
         return createNoScriptObject();
 
     v8::HandleScope handleScope;
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index b3995b2..7e13740 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -55,6 +55,11 @@
 class Widget;
 class XSSAuditor;
 
+enum ReasonForCallingCanExecuteScripts {
+    AboutToExecuteScript,
+    NotAboutToExecuteScript
+};
+
 class ScriptController {
 public:
     ScriptController(Frame*);
@@ -113,7 +118,7 @@
     // Check if the javascript engine has been initialized.
     bool haveInterpreter() const;
 
-    bool canExecuteScripts();
+    bool canExecuteScripts(ReasonForCallingCanExecuteScripts);
 
     // FIXME: void* is a compile hack.
     void attachDebugger(void*);
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 3fe8c34..54d7694 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -29,17 +29,379 @@
  */
 
 #include "config.h"
-
 #include "ScriptDebugServer.h"
 
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "Frame.h"
+#include "JavaScriptCallFrame.h"
+#include "Page.h"
+#include "ScriptDebugListener.h"
+#include "V8Binding.h"
+#include "V8DOMWindow.h"
+#include "V8Proxy.h"
+#include <wtf/StdLibExtras.h>
+
 namespace WebCore {
 
-void ScriptDebugServer::recompileAllJSFunctions()
+v8::Persistent<v8::Context> ScriptDebugServer::s_utilityContext;
+
+ScriptDebugServer::MessageLoopDispatchHandler ScriptDebugServer::s_messageLoopDispatchHandler = 0;
+
+ScriptDebugServer& ScriptDebugServer::shared()
+{
+    DEFINE_STATIC_LOCAL(ScriptDebugServer, server, ());
+    return server;
+}
+
+ScriptDebugServer::ScriptDebugServer()
+    : m_pauseOnExceptionsState(DontPauseOnExceptions)
+    , m_currentCallFrameState(0)
 {
 }
 
-void ScriptDebugServer::recompileAllJSFunctionsSoon()
+void ScriptDebugServer::setDebuggerScriptSource(const String& scriptSource)
 {
+    m_debuggerScriptSource = scriptSource;
+}
+
+void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    v8::HandleScope scope;
+    v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+    v8::Context::Scope contextScope(debuggerContext);
+
+    if (!m_listenersMap.size()) {
+        ensureDebuggerScriptCompiled();
+        ASSERT(!m_debuggerScript.get()->IsUndefined());
+        v8::Debug::SetMessageHandler2(&ScriptDebugServer::onV8DebugMessage);
+        v8::Debug::SetHostDispatchHandler(&ScriptDebugServer::onV8DebugHostDispatch, 100 /* ms */);
+    }
+    m_listenersMap.set(page, listener);
+    V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame());
+    v8::Local<v8::Context> context = proxy->mainWorldContext();
+    String contextData = toWebCoreStringWithNullCheck(context->GetData());
+    m_contextDataMap.set(listener, contextData);
+
+    v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("getScripts")));
+    v8::Handle<v8::Value> value = v8::Debug::Call(getScriptsFunction);
+    if (value.IsEmpty())
+        return;
+    ASSERT(!value->IsUndefined() && value->IsArray());
+    v8::Handle<v8::Array> scriptsArray = v8::Handle<v8::Array>::Cast(value);
+    for (unsigned i = 0; i < scriptsArray->Length(); ++i)
+        dispatchDidParseSource(listener, v8::Handle<v8::Object>::Cast(scriptsArray->Get(v8::Integer::New(i))));
+#endif
+}
+
+void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page)
+{
+    if (!m_listenersMap.contains(page))
+        return;
+
+    m_listenersMap.remove(page);
+
+    if (m_listenersMap.isEmpty()) {
+        v8::Debug::SetMessageHandler2(0);
+        v8::Debug::SetHostDispatchHandler(0);
+    }
+    // FIXME: Remove all breakpoints set by the agent.
+    // FIXME: Force continue if detach happened in nessted message loop while
+    // debugger was paused on a breakpoint(as long as there are other
+    // attached agents v8 will wait for explicit'continue' message).
+    // FIXME: send continue command to v8 if necessary;
+}
+
+void ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumber, ScriptBreakpoint breakpoint)
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    v8::HandleScope scope;
+    v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+    v8::Context::Scope contextScope(debuggerContext);
+
+    v8::Local<v8::Object> args = v8::Object::New();
+    args->Set(v8::String::New("scriptId"), v8String(sourceID));
+    args->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
+    args->Set(v8::String::New("condition"), v8String(breakpoint.condition));
+    args->Set(v8::String::New("enabled"), v8::Boolean::New(breakpoint.enabled));
+
+    v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpoint")));
+    v8::Debug::Call(setBreakpointFunction, args);
+#endif
+}
+
+void ScriptDebugServer::removeBreakpoint(const String& sourceID, unsigned lineNumber)
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    v8::HandleScope scope;
+    v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+    v8::Context::Scope contextScope(debuggerContext);
+
+    v8::Local<v8::Object> args = v8::Object::New();
+    args->Set(v8::String::New("scriptId"), v8String(sourceID));
+    args->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
+
+    v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("removeBreakpoint")));
+    v8::Debug::Call(removeBreakpointFunction, args);
+#endif
+}
+
+void ScriptDebugServer::clearBreakpoints()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    ensureDebuggerScriptCompiled();
+    v8::HandleScope scope;
+    v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+    v8::Context::Scope contextScope(debuggerContext);
+
+    v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("clearBreakpoints")));
+    v8::Debug::Call(setBreakpointsActivated);
+#endif
+}
+
+void ScriptDebugServer::setBreakpointsActivated(bool enabled)
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    ensureDebuggerScriptCompiled();
+    v8::HandleScope scope;
+    v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+    v8::Context::Scope contextScope(debuggerContext);
+
+    v8::Local<v8::Object> args = v8::Object::New();
+    args->Set(v8::String::New("enabled"), v8::Boolean::New(enabled));
+    v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpointsActivated")));
+    v8::Debug::Call(setBreakpointsActivated, args);
+#endif
+}
+
+void ScriptDebugServer::continueProgram()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    String cmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\"}");
+    v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), new v8::Debug::ClientData());
+    didResume();
+#endif
+}
+
+void ScriptDebugServer::stepIntoStatement()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    String cmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\",\"arguments\":{\"stepaction\":\"in\"}}");
+    v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), new v8::Debug::ClientData());
+    didResume();
+#endif
+}
+
+void ScriptDebugServer::stepOverStatement()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    String cmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\",\"arguments\":{\"stepaction\":\"next\"}}");
+    v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), new v8::Debug::ClientData());
+    didResume();
+#endif
+}
+
+void ScriptDebugServer::stepOutOfFunction()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    String cmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\",\"arguments\":{\"stepaction\":\"out\"}}");
+    v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), new v8::Debug::ClientData());
+    didResume();
+#endif
+}
+
+ScriptState* ScriptDebugServer::currentCallFrameState()
+{
+    return m_currentCallFrameState;
+}
+
+v8::Handle<v8::Value> ScriptDebugServer::currentCallFrameV8()
+{
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    if (!m_currentCallFrame.get().IsEmpty())
+        return m_currentCallFrame.get();
+
+    // Check on a bp.
+    v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame")));
+    v8::Handle<v8::Value> argv[] = { m_executionState.get() };
+    v8::Handle<v8::Value> result = currentCallFrameFunction->Call(m_debuggerScript.get(), 1, argv);
+    m_currentCallFrame.set(result);
+    return result;
+#else
+    return v8::Handle<v8::Value>();
+#endif
+}
+
+PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::currentCallFrame()
+{
+    return JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8())); 
+}
+
+void ScriptDebugServer::onV8DebugMessage(const v8::Debug::Message& message)
+{
+    ScriptDebugServer::shared().handleV8DebugMessage(message);
+}
+
+void ScriptDebugServer::onV8DebugHostDispatch()
+{
+    ScriptDebugServer::shared().handleV8DebugHostDispatch();
+}
+
+void ScriptDebugServer::handleV8DebugHostDispatch()
+{
+    if (!s_messageLoopDispatchHandler)
+        return;
+
+    Vector<WebCore::Page*> pages;
+    for (ListenersMap::iterator it = m_listenersMap.begin(); it != m_listenersMap.end(); ++it)
+        pages.append(it->first);
+    
+    s_messageLoopDispatchHandler(pages);
+}
+
+void ScriptDebugServer::handleV8DebugMessage(const v8::Debug::Message& message)
+{
+    v8::HandleScope scope;
+
+    if (!message.IsEvent())
+        return;
+
+    // Ignore unsupported event types.
+    if (message.GetEvent() != v8::AfterCompile && message.GetEvent() != v8::Break)
+        return;
+
+    v8::Handle<v8::Context> context = message.GetEventContext();
+    // If the context is from one of the inpected tabs it should have its context
+    // data. Skip events from unknown contexts.
+    if (context.IsEmpty())
+        return;
+
+    // Test that context has associated global dom window object.
+    v8::Handle<v8::Object> global = context->Global();
+    if (global.IsEmpty())
+        return;
+
+    global = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), global);
+    if (global.IsEmpty())
+        return;
+
+    Frame* frame = V8Proxy::retrieveFrame(context);
+    if (frame) {
+        ScriptDebugListener* listener = m_listenersMap.get(frame->page());
+        if (listener) {
+            if (message.GetEvent() == v8::AfterCompile) {
+                v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
+                v8::Local<v8::Object> args = v8::Object::New();
+                args->Set(v8::String::New("eventData"), message.GetEventData());
+                v8::Handle<v8::Function> onAfterCompileFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("getAfterCompileScript")));
+                v8::Handle<v8::Value> argv[] = { message.GetExecutionState(), args };
+                v8::Handle<v8::Value> value = onAfterCompileFunction->Call(m_debuggerScript.get(), 2, argv);
+                ASSERT(value->IsObject());
+                v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
+                dispatchDidParseSource(listener, object);
+            } else if (message.GetEvent() == v8::Break) {
+                m_executionState.set(message.GetExecutionState());
+                m_currentCallFrameState = mainWorldScriptState(frame);
+                listener->didPause();
+                m_currentCallFrameState = 0;
+            }
+        }
+    }
+}
+
+void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object)
+{
+    String contextData = toWebCoreStringWithNullCheck(object->Get(v8::String::New("contextData")));
+    if (contextData != m_contextDataMap.get(listener))
+        return;
+
+    listener->didParseSource(
+        toWebCoreStringWithNullCheck(object->Get(v8::String::New("id"))),
+        toWebCoreStringWithNullCheck(object->Get(v8::String::New("name"))),
+        toWebCoreStringWithNullCheck(object->Get(v8::String::New("source"))),
+        object->Get(v8::String::New("lineOffset"))->ToInteger()->Value());
+}
+
+void ScriptDebugServer::ensureDebuggerScriptCompiled()
+{
+    if (m_debuggerScript.get().IsEmpty()) {
+        v8::HandleScope scope;
+        v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
+        v8::Context::Scope contextScope(debuggerContext);
+        m_debuggerScript.set(v8::Handle<v8::Object>::Cast(v8::Script::Compile(v8String(m_debuggerScriptSource))->Run()));
+    }
+}
+
+void ScriptDebugServer::didResume()
+{
+    m_currentCallFrame.clear();
+    m_executionState.clear();
+}
+
+// Create the utility context for holding JavaScript functions used internally
+// which are not visible to JavaScript executing on the page.
+void ScriptDebugServer::createUtilityContext()
+{
+    ASSERT(s_utilityContext.IsEmpty());
+
+    v8::HandleScope scope;
+    v8::Handle<v8::ObjectTemplate> globalTemplate = v8::ObjectTemplate::New();
+    s_utilityContext = v8::Context::New(0, globalTemplate);
+    v8::Context::Scope contextScope(s_utilityContext);
+
+    // Compile JavaScript function for retrieving the source line, the source
+    // name and the symbol name for the top JavaScript stack frame.
+    DEFINE_STATIC_LOCAL(const char*, topStackFrame,
+        ("function topStackFrame(exec_state) {"
+        "  if (!exec_state.frameCount())"
+        "      return undefined;"
+        "  var frame = exec_state.frame(0);"
+        "  var func = frame.func();"
+        "  var scriptName;"
+        "  if (func.resolved() && func.script())"
+        "      scriptName = func.script().name();"
+        "  return [scriptName, frame.sourceLine(), (func.name() || func.inferredName())];"
+        "}"));
+    v8::Script::Compile(v8::String::New(topStackFrame))->Run();
+}
+
+bool ScriptDebugServer::topStackFrame(String& sourceName, int& lineNumber, String& functionName)
+{
+    v8::HandleScope scope;
+    v8::Handle<v8::Context> v8UtilityContext = utilityContext();
+    if (v8UtilityContext.IsEmpty())
+        return false;
+    v8::Context::Scope contextScope(v8UtilityContext);
+    v8::Handle<v8::Function> topStackFrame;
+    topStackFrame = v8::Local<v8::Function>::Cast(v8UtilityContext->Global()->Get(v8::String::New("topStackFrame")));
+    if (topStackFrame.IsEmpty())
+        return false;
+    v8::Handle<v8::Value> value = v8::Debug::Call(topStackFrame);
+    if (value.IsEmpty())
+        return false;    
+    // If there is no top stack frame, we still return success, but fill the input params with defaults.
+    if (value->IsUndefined()) {
+      // Fallback to setting lineNumber to 0, and source and function name to "undefined".
+      sourceName = toWebCoreString(value);
+      lineNumber = 0;
+      functionName = toWebCoreString(value);
+      return true;
+    }
+    if (!value->IsArray())
+        return false;
+    v8::Local<v8::Object> jsArray = value->ToObject();
+    v8::Local<v8::Value> sourceNameValue = jsArray->Get(0);
+    v8::Local<v8::Value> lineNumberValue = jsArray->Get(1);
+    v8::Local<v8::Value> functionNameValue = jsArray->Get(2);
+    if (sourceNameValue.IsEmpty() || lineNumberValue.IsEmpty() || functionNameValue.IsEmpty())
+        return false;
+    sourceName = toWebCoreString(sourceNameValue);
+    lineNumber = lineNumberValue->Int32Value();
+    functionName = toWebCoreString(functionNameValue);
+    return true;
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/v8/ScriptDebugServer.h b/WebCore/bindings/v8/ScriptDebugServer.h
index b37af2f..04857e4 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.h
+++ b/WebCore/bindings/v8/ScriptDebugServer.h
@@ -31,16 +31,119 @@
 #ifndef ScriptDebugServer_h
 #define ScriptDebugServer_h
 
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "OwnHandle.h"
+#include "PlatformString.h"
+#include "ScriptBreakpoint.h"
+#include "ScriptState.h"
+#include "StringHash.h"
+#include "Timer.h"
+#include <v8-debug.h>
+#include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
 
+class JavaScriptCallFrame;
+class Page;
+class ScriptDebugListener;
+
 class ScriptDebugServer : public Noncopyable {
 public:
-    static void recompileAllJSFunctions();
-    static void recompileAllJSFunctionsSoon();
+    static ScriptDebugServer& shared();
+    
+    // Function for retrieving the source name, line number and function name for the top
+    // JavaScript stack frame.
+    //
+    // It will return true if the caller information was successfully retrieved and written
+    // into the function parameters, otherwise the function will return false. It may
+    // fail due to a stack overflow in the underlying JavaScript implementation, handling
+    // of such exception is up to the caller.
+    static bool topStackFrame(String& sourceName, int& lineNumber, String& functionName);
+
+    void addListener(ScriptDebugListener*, Page*);
+    void removeListener(ScriptDebugListener*, Page*);
+
+    void setBreakpoint(const String& sourceID, unsigned lineNumber, ScriptBreakpoint breakpoint);
+    void removeBreakpoint(const String& sourceID, unsigned lineNumber);
+    void clearBreakpoints();
+    void setBreakpointsActivated(bool activated);
+
+    enum PauseOnExceptionsState {
+        DontPauseOnExceptions,
+        PauseOnAllExceptions,
+        PauseOnUncaughtExceptions
+    };
+    PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
+    void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState) { m_pauseOnExceptionsState = pauseOnExceptionsState; }
+
+    void pauseProgram() { }
+    void continueProgram();
+    void stepIntoStatement();
+    void stepOverStatement();
+    void stepOutOfFunction();
+
+    void recompileAllJSFunctionsSoon() { }
+    void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) { }
+
+    ScriptState* currentCallFrameState();
+
+    void pageCreated(Page*) { }
+
+    // v8-specific methods.
+    void setDebuggerScriptSource(const String& scriptSource);
+
+    typedef void (*MessageLoopDispatchHandler)(const Vector<WebCore::Page*>&);
+    static void setMessageLoopDispatchHandler(MessageLoopDispatchHandler messageLoopDispatchHandler) { s_messageLoopDispatchHandler = messageLoopDispatchHandler; }
+
+    v8::Handle<v8::Value> currentCallFrameV8();
+    PassRefPtr<JavaScriptCallFrame> currentCallFrame();
+
+private:
+    ScriptDebugServer();
+    ~ScriptDebugServer() { }
+
+    static void onV8DebugMessage(const v8::Debug::Message& message);
+    static void onV8DebugHostDispatch();
+
+    void handleV8DebugMessage(const v8::Debug::Message& message);
+    void handleV8DebugHostDispatch();
+
+    void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> sourceObject);
+    
+    void ensureDebuggerScriptCompiled();
+    void didResume();
+
+    static void createUtilityContext();
+
+    // Returns a local handle of the utility context.
+    static v8::Local<v8::Context> utilityContext()
+    {
+      if (s_utilityContext.IsEmpty())
+          createUtilityContext();
+      return v8::Local<v8::Context>::New(s_utilityContext);
+    }
+
+    // Utility context holding JavaScript functions used internally.
+    static v8::Persistent<v8::Context> s_utilityContext;
+
+    typedef HashMap<Page*, ScriptDebugListener*> ListenersMap;
+    ListenersMap m_listenersMap;
+    typedef HashMap<ScriptDebugListener*, String> ContextDataMap;
+    ContextDataMap m_contextDataMap;
+    String m_debuggerScriptSource;
+    PauseOnExceptionsState m_pauseOnExceptionsState;
+    OwnHandle<v8::Object> m_debuggerScript;
+    ScriptState* m_currentCallFrameState;
+    OwnHandle<v8::Value> m_currentCallFrame;
+    OwnHandle<v8::Object> m_executionState;
+
+    static MessageLoopDispatchHandler s_messageLoopDispatchHandler;
 };
 
 } // namespace WebCore
 
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
 #endif // ScriptDebugServer_h
diff --git a/WebCore/bindings/v8/ScriptEventListener.cpp b/WebCore/bindings/v8/ScriptEventListener.cpp
index b318d2e..fdb6076 100644
--- a/WebCore/bindings/v8/ScriptEventListener.cpp
+++ b/WebCore/bindings/v8/ScriptEventListener.cpp
@@ -56,7 +56,7 @@
 
     if (Frame* frame = node->document()->frame()) {
         ScriptController* scriptController = frame->script();
-        if (!scriptController->canExecuteScripts())
+        if (!scriptController->canExecuteScripts(AboutToExecuteScript))
             return 0;
 
         if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
@@ -89,7 +89,7 @@
     String sourceURL;
 
     ScriptController* scriptController = frame->script();
-    if (!scriptController->canExecuteScripts())
+    if (!scriptController->canExecuteScripts(AboutToExecuteScript))
         return 0;
 
     if (!scriptController->xssAuditor()->canCreateInlineEventListener(attr->localName().string(), attr->value())) {
diff --git a/WebCore/bindings/v8/ScriptGCEvent.cpp b/WebCore/bindings/v8/ScriptGCEvent.cpp
new file mode 100644
index 0000000..a58a0cd
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptGCEvent.cpp
@@ -0,0 +1,101 @@
+/*
+* 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(INSPECTOR)
+
+#include "ScriptGCEvent.h"
+#include "ScriptGCEventListener.h"
+
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+ScriptGCEvent::GCEventListeners ScriptGCEvent::s_eventListeners;
+double ScriptGCEvent::s_startTime = 0.0;
+size_t ScriptGCEvent::s_usedHeapSize = 0;
+
+void ScriptGCEvent::addEventListener(ScriptGCEventListener* eventListener)
+{
+    ASSERT(eventListener);
+    if (s_eventListeners.isEmpty()) {
+        v8::V8::AddGCPrologueCallback(ScriptGCEvent::gcPrologueCallback);
+        v8::V8::AddGCEpilogueCallback(ScriptGCEvent::gcEpilogueCallback);
+    }
+    s_eventListeners.append(eventListener);
+}
+
+void ScriptGCEvent::removeEventListener(ScriptGCEventListener* eventListener)
+{
+    ASSERT(eventListener);
+    ASSERT(!s_eventListeners.isEmpty());
+    size_t i = s_eventListeners.find(eventListener);
+    ASSERT(i != notFound);
+    s_eventListeners.remove(i);
+    if (s_eventListeners.isEmpty()) {
+        v8::V8::RemoveGCPrologueCallback(ScriptGCEvent::gcPrologueCallback);
+        v8::V8::RemoveGCEpilogueCallback(ScriptGCEvent::gcEpilogueCallback);
+    }
+}
+
+void ScriptGCEvent::getHeapSize(size_t& usedHeapSize, size_t& totalHeapSize)
+{
+    v8::HeapStatistics heapStatistics;
+    v8::V8::GetHeapStatistics(&heapStatistics);
+    usedHeapSize = heapStatistics.used_heap_size();
+    totalHeapSize = heapStatistics.total_heap_size();
+}
+
+size_t ScriptGCEvent::getUsedHeapSize()
+{
+    v8::HeapStatistics heapStatistics;
+    v8::V8::GetHeapStatistics(&heapStatistics);
+    return heapStatistics.used_heap_size();
+}
+
+void ScriptGCEvent::gcPrologueCallback(v8::GCType type, v8::GCCallbackFlags flags)
+{
+    s_startTime = WTF::currentTimeMS();
+    s_usedHeapSize = getUsedHeapSize();
+}
+
+void ScriptGCEvent::gcEpilogueCallback(v8::GCType type, v8::GCCallbackFlags flags)
+{
+    double endTime = WTF::currentTimeMS();
+    size_t collectedBytes = s_usedHeapSize - getUsedHeapSize();
+    GCEventListeners listeners(s_eventListeners);
+    for (GCEventListeners::iterator i = listeners.begin(); i != listeners.end(); ++i)
+        (*i)->didGC(s_startTime, endTime, collectedBytes);
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/v8/ScriptGCEvent.h b/WebCore/bindings/v8/ScriptGCEvent.h
new file mode 100644
index 0000000..80a5a38
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptGCEvent.h
@@ -0,0 +1,63 @@
+/*
+* 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 ScriptGCEvent_h
+#define ScriptGCEvent_h
+
+#if ENABLE(INSPECTOR)
+
+#include "v8.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class ScriptGCEventListener;
+
+class ScriptGCEvent
+{
+public:
+    static void addEventListener(ScriptGCEventListener*);
+    static void removeEventListener(ScriptGCEventListener*);
+    static void getHeapSize(size_t&, size_t&);
+private:
+    typedef Vector<ScriptGCEventListener*> GCEventListeners;
+    static GCEventListeners s_eventListeners;
+    static double s_startTime;
+    static size_t s_usedHeapSize;
+ 
+    static void gcEpilogueCallback(v8::GCType type, v8::GCCallbackFlags flags);
+    static void gcPrologueCallback(v8::GCType type, v8::GCCallbackFlags flags);
+    static size_t getUsedHeapSize();
+};
+
+} // namespace WebCore
+
+#endif // !ENABLE(INSPECTOR)
+#endif // !defined(ScriptGCEvent_h)
diff --git a/WebCore/bindings/v8/ScriptProfile.cpp b/WebCore/bindings/v8/ScriptProfile.cpp
new file mode 100644
index 0000000..beafea1
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfile.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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 "ScriptProfile.h"
+
+#include "V8Binding.h"
+
+#include <v8-profiler.h>
+
+namespace WebCore {
+
+String ScriptProfile::title() const
+{
+    return toWebCoreString(m_profile->GetTitle());
+}
+
+unsigned int ScriptProfile::uid() const
+{
+    return m_profile->GetUid();
+}
+
+PassRefPtr<ScriptProfileNode> ScriptProfile::head() const
+{
+    return ScriptProfileNode::create(m_profile->GetTopDownRoot());
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptProfile.h b/WebCore/bindings/v8/ScriptProfile.h
index 1a4d677..2f42ad2 100644
--- a/WebCore/bindings/v8/ScriptProfile.h
+++ b/WebCore/bindings/v8/ScriptProfile.h
@@ -32,29 +32,33 @@
 #define ScriptProfile_h
 
 #include "PlatformString.h"
+#include "ScriptProfileNode.h"
+
+namespace v8 {
+class CpuProfile;
+}
 
 namespace WebCore {
 
 class ScriptProfile : public RefCounted<ScriptProfile> {
 public:
-    static PassRefPtr<ScriptProfile> create(const String& title, unsigned uid)
+    static PassRefPtr<ScriptProfile> create(const v8::CpuProfile* profile)
     {
-      return adoptRef(new ScriptProfile(title, uid));
+        return adoptRef(new ScriptProfile(profile));
     }
     virtual ~ScriptProfile() {}
 
-    String title() const { return m_title; }
-    unsigned int uid() const { return m_uid; }
+    String title() const;
+    unsigned int uid() const;
+    PassRefPtr<ScriptProfileNode> head() const;
 
 protected:
-    ScriptProfile(const String& title, unsigned uid)
-        : m_title(title)
-        , m_uid(uid)
+    ScriptProfile(const v8::CpuProfile* profile)
+        : m_profile(profile)
     {}
 
 private:
-    String m_title;
-    unsigned int m_uid;
+    const v8::CpuProfile* m_profile;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptProfileNode.cpp b/WebCore/bindings/v8/ScriptProfileNode.cpp
new file mode 100644
index 0000000..3121128
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfileNode.cpp
@@ -0,0 +1,92 @@
+/*
+ * 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 "ScriptProfile.h"
+
+#include "V8Binding.h"
+
+#include <v8-profiler.h>
+
+namespace WebCore {
+
+String ScriptProfileNode::functionName() const
+{
+    return toWebCoreString(m_profileNode->GetFunctionName());
+}
+
+String ScriptProfileNode::url() const
+{
+    return toWebCoreString(m_profileNode->GetScriptResourceName());
+}
+
+unsigned long ScriptProfileNode::lineNumber() const
+{
+    return m_profileNode->GetLineNumber();
+}
+
+double ScriptProfileNode::totalTime() const
+{
+    // FIXME: use GetTotalMilliseconds once it is implemented in V8.
+    return m_profileNode->GetTotalSamplesCount();
+}
+
+double ScriptProfileNode::selfTime() const
+{
+    // FIXME: use GetSelfMilliseconds once it is implemented in V8.
+    return m_profileNode->GetSelfSamplesCount();
+}
+
+unsigned long ScriptProfileNode::numberOfCalls() const
+{
+    return 0;
+}
+
+ProfileNodesList ScriptProfileNode::children() const
+{
+    const int childrenCount = m_profileNode->GetChildrenCount();
+    ProfileNodesList result(childrenCount);
+    for (int i = 0; i < childrenCount; ++i)
+        result[i] = ScriptProfileNode::create(m_profileNode->GetChild(i));
+    return result;
+}
+
+bool ScriptProfileNode::visible() const
+{
+    return true;
+}
+
+unsigned long ScriptProfileNode::callUID() const
+{
+    return m_profileNode->GetCallUid();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptProfileNode.h b/WebCore/bindings/v8/ScriptProfileNode.h
new file mode 100644
index 0000000..5acf319
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptProfileNode.h
@@ -0,0 +1,75 @@
+/*
+ * 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 ScriptProfileNode_h
+#define ScriptProfileNode_h
+
+#include "PlatformString.h"
+
+namespace v8 {
+class CpuProfileNode;
+}
+
+namespace WebCore {
+
+class ScriptProfileNode;
+
+typedef Vector<RefPtr<ScriptProfileNode> > ProfileNodesList;
+
+class ScriptProfileNode : public RefCounted<ScriptProfileNode> {
+public:
+    static PassRefPtr<ScriptProfileNode> create(const v8::CpuProfileNode* profileNode)
+    {
+        return adoptRef(new ScriptProfileNode(profileNode));
+    }
+    virtual ~ScriptProfileNode() {}
+
+    String functionName() const;
+    String url() const;
+    unsigned long lineNumber() const;
+    double totalTime() const;
+    double selfTime() const;
+    unsigned long numberOfCalls() const;
+    ProfileNodesList children() const;
+    bool visible() const;
+    unsigned long callUID() const;
+
+protected:
+    ScriptProfileNode(const v8::CpuProfileNode* profileNode)
+        : m_profileNode(profileNode)
+    {}
+
+private:
+    const v8::CpuProfileNode* m_profileNode;
+};
+
+} // namespace WebCore
+
+#endif // ScriptProfileNode_h
diff --git a/WebCore/bindings/v8/ScriptProfiler.cpp b/WebCore/bindings/v8/ScriptProfiler.cpp
index f238f6f..1f09420 100644
--- a/WebCore/bindings/v8/ScriptProfiler.cpp
+++ b/WebCore/bindings/v8/ScriptProfiler.cpp
@@ -31,20 +31,23 @@
 #include "config.h"
 
 #include "ScriptProfiler.h"
+#include "ScriptString.h"
+
+#include <v8-profiler.h>
 
 namespace WebCore {
 
 void ScriptProfiler::start(ScriptState* state, const String& title)
 {
-    v8::HandleScope scope;
-    v8::Context::Scope contextScope(v8::Context::GetCurrent());
-    v8::V8::ResumeProfiler();
+    v8::HandleScope hs;
+    v8::CpuProfiler::StartProfiling(v8String(title));
 }
 
 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
 {
-    v8::V8::PauseProfiler();
-    return 0;
+    v8::HandleScope hs;
+    const v8::CpuProfile* profile = v8::CpuProfiler::StopProfiling(v8String(title));
+    return profile ? ScriptProfile::create(profile) : 0;
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptState.h b/WebCore/bindings/v8/ScriptState.h
index 5c5ce6c..ce350da 100644
--- a/WebCore/bindings/v8/ScriptState.h
+++ b/WebCore/bindings/v8/ScriptState.h
@@ -37,55 +37,77 @@
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
-    class DOMWrapperWorld;
-    class Frame;
-    class Node;
-    class Page;
+class DOMWrapperWorld;
+class Frame;
+class Node;
+class Page;
 
-    class ScriptState : public Noncopyable {
-    public:
-        bool hadException() { return !m_exception.IsEmpty(); }
-        void setException(v8::Local<v8::Value> exception)
-        {
-            m_exception = exception;
+class ScriptState : public Noncopyable {
+public:
+    bool hadException() { return !m_exception.IsEmpty(); }
+    void setException(v8::Local<v8::Value> exception)
+    {
+        m_exception = exception;
+    }
+    v8::Local<v8::Value> exception() { return m_exception; }
+
+    v8::Local<v8::Context> context() const
+    {
+        return v8::Local<v8::Context>::New(m_context);
+    }
+
+    static ScriptState* forContext(v8::Local<v8::Context>);
+    static ScriptState* current();
+
+protected:
+    ScriptState() { }
+    ~ScriptState();
+
+private:
+    friend ScriptState* mainWorldScriptState(Frame*);
+    explicit ScriptState(v8::Handle<v8::Context>);
+
+    static void weakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter);
+
+    v8::Local<v8::Value> m_exception;
+    v8::Persistent<v8::Context> m_context;
+};
+
+class EmptyScriptState : public ScriptState {
+public:
+    EmptyScriptState() : ScriptState() { }
+    ~EmptyScriptState() { }
+};
+
+class ScriptStateProtectedPtr : public Noncopyable {
+public:
+    ScriptStateProtectedPtr() : m_scriptState(0) { }
+    ScriptStateProtectedPtr(ScriptState* scriptState) : m_scriptState(scriptState)
+    {
+        v8::HandleScope handleScope;
+        // Keep the context from being GC'ed. ScriptState is guaranteed to be live while the context is live.
+        m_context = v8::Persistent<v8::Context>::New(scriptState->context());
+    }
+    ~ScriptStateProtectedPtr()
+    {
+        if (!m_context.IsEmpty()) {
+            m_context.Dispose();
+            m_context.Clear();
         }
-        v8::Local<v8::Value> exception() { return m_exception; }
+    }
+    ScriptState* get() { return m_scriptState; }
+private:
+    ScriptState* m_scriptState;
+    v8::Persistent<v8::Context> m_context;
+};
 
-        v8::Local<v8::Context> context() const
-        {
-            return v8::Local<v8::Context>::New(m_context);
-        }
+ScriptState* mainWorldScriptState(Frame*);
 
-        static ScriptState* forContext(v8::Local<v8::Context>);
-        static ScriptState* current();
+ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
+ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
 
-    protected:
-        ScriptState() { }
-        ~ScriptState();
-
-    private:
-        friend ScriptState* mainWorldScriptState(Frame*);
-        explicit ScriptState(v8::Handle<v8::Context>);
-
-        static void weakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter);
-
-        v8::Local<v8::Value> m_exception;
-        v8::Persistent<v8::Context> m_context;
-    };
-
-    class EmptyScriptState : public ScriptState {
-    public:
-        EmptyScriptState() : ScriptState() { }
-        ~EmptyScriptState() { }
-    };
-
-    ScriptState* mainWorldScriptState(Frame*);
-
-    ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*);
-    ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*);
-
-    inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
-    inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
+inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
+inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
 
 }
 
diff --git a/WebCore/bindings/v8/ScriptValue.h b/WebCore/bindings/v8/ScriptValue.h
index 1713f80..8241205 100644
--- a/WebCore/bindings/v8/ScriptValue.h
+++ b/WebCore/bindings/v8/ScriptValue.h
@@ -127,6 +127,8 @@
     PassRefPtr<SerializedScriptValue> serialize(ScriptState*);
     static ScriptValue deserialize(ScriptState*, SerializedScriptValue*);
 
+    static ScriptValue undefined() { return ScriptValue(v8::Undefined()); }
+
     void clear()
     {
         if (m_value.IsEmpty())
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index bac7f20..50ac86b 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -31,7 +31,18 @@
 #include "config.h"
 #include "SerializedScriptValue.h"
 
+#include "Blob.h"
+#include "ByteArray.h"
+#include "CanvasPixelArray.h"
+#include "File.h"
+#include "FileList.h"
+#include "ImageData.h"
 #include "SharedBuffer.h"
+#include "V8Blob.h"
+#include "V8File.h"
+#include "V8FileList.h"
+#include "V8ImageData.h"
+#include "V8Proxy.h"
 
 #include <v8.h>
 #include <wtf/Assertions.h>
@@ -40,7 +51,6 @@
 
 // FIXME:
 // - catch V8 exceptions
-// - be ready to get empty handles
 // - consider crashing in debug mode on deserialization errors
 
 namespace WebCore {
@@ -60,19 +70,18 @@
     FalseTag = 'F',
     StringTag = 'S',
     Int32Tag = 'I',
+    Uint32Tag = 'U',
+    DateTag = 'D',
     NumberTag = 'N',
-    ObjectTag = '{',
+    BlobTag = 'b',
+    FileTag = 'f',
+    FileListTag = 'l',
+    ImageDataTag = '#',
     ArrayTag = '[',
+    ObjectTag = '{',
+    SparseArrayTag = '@',
 };
 
-// Helpers to do verbose handle casts.
-
-template <typename T, typename U>
-static v8::Handle<T> handleCast(v8::Handle<U> handle) { return v8::Handle<T>::Cast(handle); }
-
-template <typename T, typename U>
-static v8::Local<T> handleCast(v8::Local<U> handle) { return v8::Local<T>::Cast(handle); }
-
 static bool shouldCheckForCycles(int depth)
 {
     ASSERT(depth >= 0);
@@ -118,7 +127,8 @@
 // information used to reconstruct composite types.
 class Writer : Noncopyable {
 public:
-    Writer() : m_position(0)
+    Writer()
+        : m_position(0)
     {
     }
 
@@ -134,9 +144,17 @@
 
     void writeString(const char* data, int length)
     {
+        ASSERT(length >= 0);
         append(StringTag);
-        doWriteUint32(static_cast<uint32_t>(length));
-        append(data, length);
+        doWriteString(data, length);
+    }
+
+    void writeWebCoreString(const String& string)
+    {
+        // Uses UTF8 encoding so we can read it back as either V8 or
+        // WebCore string.
+        append(StringTag);
+        doWriteWebCoreString(string);
     }
 
     void writeInt32(int32_t value)
@@ -145,19 +163,71 @@
         doWriteUint32(ZigZag::encode(static_cast<uint32_t>(value)));
     }
 
+    void writeUint32(uint32_t value)
+    {
+        append(Uint32Tag);
+        doWriteUint32(value);
+    }
+
+    void writeDate(double numberValue)
+    {
+        append(DateTag);
+        doWriteNumber(numberValue);
+    }
+
     void writeNumber(double number)
     {
         append(NumberTag);
-        append(reinterpret_cast<char*>(&number), sizeof(number));
+        doWriteNumber(number);
     }
 
-    // Records that a composite object can be constructed by using
-    // |length| previously stored values.
-    void endComposite(SerializationTag tag, int32_t length)
+    void writeBlob(const String& path)
     {
-        ASSERT(tag == ObjectTag || tag == ArrayTag);
-        append(tag);
-        doWriteUint32(static_cast<uint32_t>(length));
+        append(BlobTag);
+        doWriteWebCoreString(path);
+    }
+
+    void writeFile(const String& path)
+    {
+        append(FileTag);
+        doWriteWebCoreString(path);
+    }
+
+    void writeFileList(const FileList& fileList)
+    {
+        append(FileListTag);
+        uint32_t length = fileList.length();
+        doWriteUint32(length);
+        for (unsigned i = 0; i < length; ++i)
+            doWriteWebCoreString(fileList.item(i)->path());
+    }
+
+    void writeImageData(uint32_t width, uint32_t height, const uint8_t* pixelData, uint32_t pixelDataLength)
+    {
+        append(ImageDataTag);
+        doWriteUint32(width);
+        doWriteUint32(height);
+        doWriteUint32(pixelDataLength);
+        append(pixelData, pixelDataLength);
+    }
+
+    void writeArray(uint32_t length)
+    {
+        append(ArrayTag);
+        doWriteUint32(length);
+    }
+
+    void writeObject(uint32_t numProperties)
+    {
+        append(ObjectTag);
+        doWriteUint32(numProperties);
+    }
+
+    void writeSparseArray(uint32_t numProperties, uint32_t length)
+    {
+        append(SparseArrayTag);
+        doWriteUint32(numProperties);
+        doWriteUint32(length);
     }
 
     Vector<BufferValueType>& data()
@@ -167,10 +237,22 @@
     }
 
 private:
+    void doWriteString(const char* data, int length)
+    {
+        doWriteUint32(static_cast<uint32_t>(length));
+        append(reinterpret_cast<const uint8_t*>(data), length);
+    }
+
+    void doWriteWebCoreString(const String& string)
+    {
+        RefPtr<SharedBuffer> buffer = utf8Buffer(string);
+        doWriteString(buffer->data(), buffer->size());
+    }
+
     void doWriteUint32(uint32_t value)
     {
         while (true) {
-            char b = (value & varIntMask);
+            uint8_t b = (value & varIntMask);
             value >>= varIntShift;
             if (!value) {
                 append(b);
@@ -180,21 +262,26 @@
         }
     }
 
+    void doWriteNumber(double number)
+    {
+        append(reinterpret_cast<uint8_t*>(&number), sizeof(number));
+    }
+
     void append(SerializationTag tag)
     {
-        append(static_cast<char>(tag));
+        append(static_cast<uint8_t>(tag));
     }
 
-    void append(char b)
+    void append(uint8_t b)
     {
         ensureSpace(1);
-        *charAt(m_position++) = b;
+        *byteAt(m_position++) = b;
     }
 
-    void append(const char* data, int length)
+    void append(const uint8_t* data, int length)
     {
         ensureSpace(length);
-        memcpy(charAt(m_position), data, length);
+        memcpy(byteAt(m_position), data, length);
         m_position += length;
     }
 
@@ -210,41 +297,54 @@
         // If the writer is at odd position in the buffer, then one of
         // the bytes in the last UChar is not initialized.
         if (m_position % 2)
-            *charAt(m_position) = static_cast<char>(PaddingTag);
+            *byteAt(m_position) = static_cast<uint8_t>(PaddingTag);
     }
 
-    char* charAt(int position) { return reinterpret_cast<char*>(m_buffer.data()) + position; }
+    uint8_t* byteAt(int position) { return reinterpret_cast<uint8_t*>(m_buffer.data()) + position; }
 
     Vector<BufferValueType> m_buffer;
     unsigned m_position;
 };
 
 class Serializer {
+    class StateBase;
 public:
     explicit Serializer(Writer& writer)
         : m_writer(writer)
-        , m_state(0)
         , m_depth(0)
+        , m_hasError(false)
     {
     }
 
     bool serialize(v8::Handle<v8::Value> value)
     {
         v8::HandleScope scope;
-        StackCleaner cleaner(&m_state);
-        if (!doSerialize(value))
-            return false;
-        while (top()) {
-            int length;
-            while (!top()->isDone(&length)) {
-                // Note that doSerialize() can change current top().
-                if (!doSerialize(top()->advance()))
-                    return false;
-            }
-            m_writer.endComposite(top()->tag(), length);
-            pop();
-        }
-        return true;
+        StateBase* state = doSerialize(value, 0);
+        while (state)
+            state = state->advance(*this);
+        return !m_hasError;
+    }
+
+    // Functions used by serialization states.
+
+    StateBase* doSerialize(v8::Handle<v8::Value> value, StateBase* next);
+
+    StateBase* writeArray(uint32_t length, StateBase* state)
+    {
+        m_writer.writeArray(length);
+        return pop(state);
+    }
+
+    StateBase* writeObject(uint32_t numProperties, StateBase* state)
+    {
+        m_writer.writeObject(numProperties);
+        return pop(state);
+    }
+
+    StateBase* writeSparseArray(uint32_t numProperties, uint32_t length, StateBase* state)
+    {
+        m_writer.writeSparseArray(numProperties, length);
+        return pop(state);
     }
 
 private:
@@ -254,221 +354,308 @@
 
         // Link to the next state to form a stack.
         StateBase* nextState() { return m_next; }
-        void setNextState(StateBase* next) { m_next = next; }
 
         // Composite object we're processing in this state.
         v8::Handle<v8::Value> composite() { return m_composite; }
 
-        // Serialization tag for the current composite.
-        virtual SerializationTag tag() const = 0;
-
-        // Returns whether iteration over subobjects of the current
-        // composite object is done. If yes, |*length| is set to the
-        // number of subobjects.
-        virtual bool isDone(int* length) = 0;
-
-        // Advances to the next subobject.
-        // Requires: !this->isDone().
-        virtual v8::Local<v8::Value> advance() = 0;
+        // Serializes (a part of) the current composite and returns
+        // the next state to process or null when this is the final
+        // state.
+        virtual StateBase* advance(Serializer&) = 0;
 
     protected:
-        StateBase(v8::Handle<v8::Value> composite)
-            : m_next(0)
-            , m_composite(composite)
+        StateBase(v8::Handle<v8::Value> composite, StateBase* next)
+            : m_composite(composite)
+            , m_next(next)
         {
         }
 
     private:
-        StateBase* m_next;
         v8::Handle<v8::Value> m_composite;
+        StateBase* m_next;
     };
 
-    template <typename T, SerializationTag compositeTag>
+    // Dummy state that is used to signal serialization errors.
+    class ErrorState : public StateBase {
+    public:
+        ErrorState()
+            : StateBase(v8::Handle<v8::Value>(), 0)
+        {
+        }
+
+        virtual StateBase* advance(Serializer&)
+        {
+            delete this;
+            return 0;
+        }
+    };
+
+    template <typename T>
     class State : public StateBase {
     public:
-        v8::Handle<T> composite() { return handleCast<T>(StateBase::composite()); }
-
-        virtual SerializationTag tag() const { return compositeTag; }
+        v8::Handle<T> composite() { return v8::Handle<T>::Cast(StateBase::composite()); }
 
     protected:
-        explicit State(v8::Handle<T> composite) : StateBase(composite)
+        State(v8::Handle<T> composite, StateBase* next)
+            : StateBase(composite, next)
         {
         }
     };
 
-    // Helper to clean up the state stack in case of errors.
-    class StackCleaner : Noncopyable {
+#if 0
+    // Currently unused, see comment in newArrayState.
+    class ArrayState : public State<v8::Array> {
     public:
-        explicit StackCleaner(StateBase** stack) : m_stack(stack)
+        ArrayState(v8::Handle<v8::Array> array, StateBase* next)
+            : State<v8::Array>(array, next)
+            , m_index(-1)
         {
         }
 
-        ~StackCleaner()
+        virtual StateBase* advance(Serializer& serializer)
         {
-            StateBase* state = *m_stack;
-            while (state) {
-                StateBase* tmp = state->nextState();
-                delete state;
-                state = tmp;
+            ++m_index;
+            for (; m_index < composite()->Length(); ++m_index) {
+                if (StateBase* newState = serializer.doSerialize(composite()->Get(m_index), this))
+                    return newState;
             }
-            *m_stack = 0;
-        }
-
-    private:
-        StateBase** m_stack;
-    };
-
-    class ArrayState : public State<v8::Array, ArrayTag> {
-    public:
-        ArrayState(v8::Handle<v8::Array> array)
-            : State<v8::Array, ArrayTag>(array)
-            , m_index(0)
-        {
-        }
-
-        virtual bool isDone(int* length)
-        {
-            *length = composite()->Length();
-            return static_cast<int>(m_index) >= *length;
-        }
-
-        virtual v8::Local<v8::Value> advance()
-        {
-            ASSERT(m_index < composite()->Length());
-            v8::HandleScope scope;
-            return scope.Close(composite()->Get(v8::Integer::New(m_index++)));
+            return serializer.writeArray(composite()->Length(), this);
         }
 
     private:
         unsigned m_index;
     };
+#endif
 
-    class ObjectState : public State<v8::Object, ObjectTag> {
+    class AbstractObjectState : public State<v8::Object> {
     public:
-        ObjectState(v8::Handle<v8::Object> object)
-            : State<v8::Object, ObjectTag>(object)
+        AbstractObjectState(v8::Handle<v8::Object> object, StateBase* next)
+            : State<v8::Object>(object, next)
             , m_propertyNames(object->GetPropertyNames())
             , m_index(-1)
-            , m_length(0)
+            , m_numSerializedProperties(0)
+            , m_nameDone(false)
         {
-            nextProperty();
         }
 
-        virtual bool isDone(int* length)
+        virtual StateBase* advance(Serializer& serializer)
         {
-            *length = m_length;
-            return m_index >= 2 * m_propertyNames->Length();
-        }
-
-        virtual v8::Local<v8::Value> advance()
-        {
-            ASSERT(m_index < 2 * m_propertyNames->Length());
-            if (!(m_index % 2)) {
-                ++m_index;
-                return m_propertyName;
+            ++m_index;
+            for (; m_index < m_propertyNames->Length(); ++m_index) {
+                if (m_propertyName.IsEmpty()) {
+                    v8::Local<v8::Value> propertyName = m_propertyNames->Get(m_index);
+                    if ((propertyName->IsString() && composite()->HasRealNamedProperty(propertyName.As<v8::String>()))
+                        || (propertyName->IsUint32() && composite()->HasRealIndexedProperty(propertyName->Uint32Value()))) {
+                        m_propertyName = propertyName;
+                    } else
+                        continue;
+                }
+                ASSERT(!m_propertyName.IsEmpty());
+                if (!m_nameDone) {
+                    m_nameDone = true;
+                    if (StateBase* newState = serializer.doSerialize(m_propertyName, this))
+                        return newState;
+                }
+                v8::Local<v8::Value> value = composite()->Get(m_propertyName);
+                m_nameDone = false;
+                m_propertyName.Clear();
+                ++m_numSerializedProperties;
+                if (StateBase* newState = serializer.doSerialize(value, this))
+                    return newState;
             }
-            v8::Local<v8::Value> result = composite()->Get(m_propertyName);
-            nextProperty();
-            return result;
+            return objectDone(m_numSerializedProperties, serializer);
         }
 
+    protected:
+        virtual StateBase* objectDone(unsigned numProperties, Serializer&) = 0;
+
     private:
-        void nextProperty()
-        {
-            v8::HandleScope scope;
-            ++m_index;
-            ASSERT(!(m_index % 2));
-            for (; m_index < 2 * m_propertyNames->Length(); m_index += 2) {
-                v8::Local<v8::Value> propertyName = m_propertyNames->Get(v8::Integer::New(m_index / 2));
-                if ((propertyName->IsString() && composite()->HasRealNamedProperty(handleCast<v8::String>(propertyName)))
-                    || (propertyName->IsInt32() && composite()->HasRealIndexedProperty(propertyName->Uint32Value()))) {
-                    m_propertyName = scope.Close(propertyName);
-                    m_length += 2;
-                    return;
-                }
-            }
-        }
-
         v8::Local<v8::Array> m_propertyNames;
         v8::Local<v8::Value> m_propertyName;
         unsigned m_index;
-        unsigned m_length;
+        unsigned m_numSerializedProperties;
+        bool m_nameDone;
     };
 
-    bool doSerialize(v8::Handle<v8::Value> value)
-    {
-        if (value->IsUndefined())
-            m_writer.writeUndefined();
-        else if (value->IsNull())
-            m_writer.writeNull();
-        else if (value->IsTrue())
-            m_writer.writeTrue();
-        else if (value->IsFalse())
-            m_writer.writeFalse();
-        else if (value->IsInt32())
-            m_writer.writeInt32(value->Int32Value());
-        else if (value->IsNumber())
-            m_writer.writeNumber(handleCast<v8::Number>(value)->Value());
-        else if (value->IsString()) {
-            v8::String::Utf8Value stringValue(value);
-            m_writer.writeString(*stringValue, stringValue.length());
-        } else if (value->IsArray()) {
-            if (!checkComposite(value))
-                return false;
-            push(new ArrayState(handleCast<v8::Array>(value)));
-        } else if (value->IsObject()) {
-            if (!checkComposite(value))
-                return false;
-            push(new ObjectState(handleCast<v8::Object>(value)));
-            // FIXME:
-            // - check not a wrapper
-            // - support File, ImageData, etc.
+    class ObjectState : public AbstractObjectState {
+    public:
+        ObjectState(v8::Handle<v8::Object> object, StateBase* next)
+            : AbstractObjectState(object, next)
+        {
         }
-        return true;
-    }
 
-    void push(StateBase* state)
+    protected:
+        virtual StateBase* objectDone(unsigned numProperties, Serializer& serializer)
+        {
+            return serializer.writeObject(numProperties, this);
+        }
+    };
+
+    class SparseArrayState : public AbstractObjectState {
+    public:
+        SparseArrayState(v8::Handle<v8::Array> array, StateBase* next)
+            : AbstractObjectState(array, next)
+        {
+        }
+
+    protected:
+        virtual StateBase* objectDone(unsigned numProperties, Serializer& serializer)
+        {
+            return serializer.writeSparseArray(numProperties, composite().As<v8::Array>()->Length(), this);
+        }
+    };
+
+    StateBase* push(StateBase* state)
     {
-        state->setNextState(m_state);
-        m_state = state;
+        ASSERT(state);
         ++m_depth;
+        return checkComposite(state) ? state : handleError(state);
     }
 
-    StateBase* top() { return m_state; }
-
-    void pop()
+    StateBase* pop(StateBase* state)
     {
-        if (!m_state)
-            return;
-        StateBase* top = m_state;
-        m_state = top->nextState();
-        delete top;
+        ASSERT(state);
         --m_depth;
+        StateBase* next = state->nextState();
+        delete state;
+        return next;
     }
 
-    bool checkComposite(v8::Handle<v8::Value> composite)
+    StateBase* handleError(StateBase* state)
     {
+        m_hasError = true;
+        while (state) {
+            StateBase* tmp = state->nextState();
+            delete state;
+            state = tmp;
+        }
+        return new ErrorState;
+    }
+
+    bool checkComposite(StateBase* top)
+    {
+        ASSERT(top);
         if (m_depth > maxDepth)
             return false;
         if (!shouldCheckForCycles(m_depth))
             return true;
-        for (StateBase* state = top(); state; state = state->nextState()) {
+        v8::Handle<v8::Value> composite = top->composite();
+        for (StateBase* state = top->nextState(); state; state = state->nextState()) {
             if (state->composite() == composite)
                 return false;
         }
         return true;
     }
 
+    void writeString(v8::Handle<v8::Value> value)
+    {
+        v8::String::Utf8Value stringValue(value);
+        m_writer.writeString(*stringValue, stringValue.length());
+    }
+
+    void writeBlob(v8::Handle<v8::Value> value)
+    {
+        Blob* blob = V8Blob::toNative(value.As<v8::Object>());
+        if (!blob)
+            return;
+        m_writer.writeBlob(blob->path());
+    }
+
+    void writeFile(v8::Handle<v8::Value> value)
+    {
+        File* file = V8File::toNative(value.As<v8::Object>());
+        if (!file)
+            return;
+        m_writer.writeFile(file->path());
+    }
+
+    void writeFileList(v8::Handle<v8::Value> value)
+    {
+        FileList* fileList = V8FileList::toNative(value.As<v8::Object>());
+        if (!fileList)
+            return;
+        m_writer.writeFileList(*fileList);
+    }
+
+    void writeImageData(v8::Handle<v8::Value> value)
+    {
+        ImageData* imageData = V8ImageData::toNative(value.As<v8::Object>());
+        if (!imageData)
+            return;
+        WTF::ByteArray* pixelArray = imageData->data()->data();
+        m_writer.writeImageData(imageData->width(), imageData->height(), pixelArray->data(), pixelArray->length());
+    }
+
+    static StateBase* newArrayState(v8::Handle<v8::Array> array, StateBase* next)
+    {
+        // FIXME: use plain Array state when we can quickly check that
+        // an array is not sparse and has only indexed properties.
+        return new SparseArrayState(array, next);
+    }
+
+    static StateBase* newObjectState(v8::Handle<v8::Object> object, StateBase* next)
+    {
+        // FIXME:
+        // - check not a wrapper
+        // - support File, etc.
+        return new ObjectState(object, next);
+    }
+
     Writer& m_writer;
-    StateBase* m_state;
     int m_depth;
+    bool m_hasError;
+};
+
+Serializer::StateBase* Serializer::doSerialize(v8::Handle<v8::Value> value, StateBase* next)
+{
+    if (value->IsUndefined())
+        m_writer.writeUndefined();
+    else if (value->IsNull())
+        m_writer.writeNull();
+    else if (value->IsTrue())
+        m_writer.writeTrue();
+    else if (value->IsFalse())
+        m_writer.writeFalse();
+    else if (value->IsInt32())
+        m_writer.writeInt32(value->Int32Value());
+    else if (value->IsUint32())
+        m_writer.writeUint32(value->Uint32Value());
+    else if (value->IsDate())
+        m_writer.writeDate(value->NumberValue());
+    else if (value->IsNumber())
+        m_writer.writeNumber(value.As<v8::Number>()->Value());
+    else if (value->IsString())
+        writeString(value);
+    else if (value->IsArray())
+        return push(newArrayState(value.As<v8::Array>(), next));
+    else if (V8File::HasInstance(value))
+        writeFile(value);
+    else if (V8Blob::HasInstance(value))
+        writeBlob(value);
+    else if (V8FileList::HasInstance(value))
+        writeFileList(value);
+    else if (V8ImageData::HasInstance(value))
+        writeImageData(value);
+    else if (value->IsObject())
+        return push(newObjectState(value.As<v8::Object>(), next));
+    return 0;
+}
+
+// Interface used by Reader to create objects of composite types.
+class CompositeCreator {
+public:
+    virtual ~CompositeCreator() { }
+
+    virtual bool createArray(uint32_t length, v8::Handle<v8::Value>* value) = 0;
+    virtual bool createObject(uint32_t numProperties, v8::Handle<v8::Value>* value) = 0;
+    virtual bool createSparseArray(uint32_t numProperties, uint32_t length, v8::Handle<v8::Value>* value) = 0;
 };
 
 // Reader is responsible for deserializing primitive types and
 // restoring information about saved objects of composite types.
 class Reader {
 public:
-    Reader(const char* buffer, int length)
+    Reader(const uint8_t* buffer, int length)
         : m_buffer(buffer)
         , m_length(length)
         , m_position(0)
@@ -478,16 +665,16 @@
 
     bool isEof() const { return m_position >= m_length; }
 
-    bool read(SerializationTag* tag, v8::Handle<v8::Value>* value, int* length)
+    bool read(v8::Handle<v8::Value>* value, CompositeCreator& creator)
     {
-        uint32_t rawLength;
-        if (!readTag(tag))
+        SerializationTag tag;
+        if (!readTag(&tag))
             return false;
-        switch (*tag) {
+        switch (tag) {
         case InvalidTag:
             return false;
         case PaddingTag:
-            break;
+            return true;
         case UndefinedTag:
             *value = v8::Undefined();
             break;
@@ -508,18 +695,65 @@
             if (!readInt32(value))
                 return false;
             break;
+        case Uint32Tag:
+            if (!readUint32(value))
+                return false;
+            break;
+        case DateTag:
+            if (!readDate(value))
+                return false;
+            break;
         case NumberTag:
             if (!readNumber(value))
                 return false;
             break;
-        case ObjectTag:
-        case ArrayTag:
-            if (!doReadUint32(&rawLength))
+        case BlobTag:
+            if (!readBlob(value))
                 return false;
-            *length = rawLength;
+            break;
+        case FileTag:
+            if (!readFile(value))
+                return false;
+            break;
+        case FileListTag:
+            if (!readFileList(value))
+                return false;
+            break;
+        case ImageDataTag:
+            if (!readImageData(value))
+                return false;
+            break;
+        case ArrayTag: {
+            uint32_t length;
+            if (!doReadUint32(&length))
+                return false;
+            if (!creator.createArray(length, value))
+                return false;
             break;
         }
-        return true;
+        case ObjectTag: {
+            uint32_t numProperties;
+            if (!doReadUint32(&numProperties))
+                return false;
+            if (!creator.createObject(numProperties, value))
+                return false;
+            break;
+        }
+        case SparseArrayTag: {
+            uint32_t numProperties;
+            uint32_t length;
+            if (!doReadUint32(&numProperties))
+                return false;
+            if (!doReadUint32(&length))
+                return false;
+            if (!creator.createSparseArray(numProperties, length, value))
+                return false;
+            break;
+        }
+        default:
+            return false;
+        }
+        return !value->IsEmpty();
     }
 
 private:
@@ -538,7 +772,19 @@
             return false;
         if (m_position + length > m_length)
             return false;
-        *value = v8::String::New(m_buffer + m_position, length);
+        *value = v8::String::New(reinterpret_cast<const char*>(m_buffer + m_position), length);
+        m_position += length;
+        return true;
+    }
+
+    bool readWebCoreString(String* string)
+    {
+        uint32_t length;
+        if (!doReadUint32(&length))
+            return false;
+        if (m_position + length > m_length)
+            return false;
+        *string = String::fromUTF8(reinterpret_cast<const char*>(m_buffer + m_position), length);
         m_position += length;
         return true;
     }
@@ -552,22 +798,96 @@
         return true;
     }
 
+    bool readUint32(v8::Handle<v8::Value>* value)
+    {
+        uint32_t rawValue;
+        if (!doReadUint32(&rawValue))
+            return false;
+        *value = v8::Integer::New(rawValue);
+        return true;
+    }
+
+    bool readDate(v8::Handle<v8::Value>* value)
+    {
+        double numberValue;
+        if (!doReadNumber(&numberValue))
+            return false;
+        *value = v8::Date::New(numberValue);
+        return true;
+    }
+
     bool readNumber(v8::Handle<v8::Value>* value)
     {
-        if (m_position + sizeof(double) > m_length)
-            return false;
         double number;
-        char* numberAsByteArray = reinterpret_cast<char*>(&number);
-        for (unsigned i = 0; i < sizeof(double); ++i)
-            numberAsByteArray[i] = m_buffer[m_position++];
+        if (!doReadNumber(&number))
+            return false;
         *value = v8::Number::New(number);
         return true;
     }
 
+    bool readImageData(v8::Handle<v8::Value>* value)
+    {
+        uint32_t width;
+        uint32_t height;
+        uint32_t pixelDataLength;
+        if (!doReadUint32(&width))
+            return false;
+        if (!doReadUint32(&height))
+            return false;
+        if (!doReadUint32(&pixelDataLength))
+            return false;
+        if (m_position + pixelDataLength > m_length)
+            return false;
+        PassRefPtr<ImageData> imageData = ImageData::create(width, height);
+        WTF::ByteArray* pixelArray = imageData->data()->data();
+        ASSERT(pixelArray);
+        ASSERT(pixelArray->length() >= pixelDataLength);
+        memcpy(pixelArray->data(), m_buffer + m_position, pixelDataLength);
+        m_position += pixelDataLength;
+        *value = toV8(imageData);
+        return true;
+    }
+
+    bool readBlob(v8::Handle<v8::Value>* value)
+    {
+        String path;
+        if (!readWebCoreString(&path))
+            return false;
+        PassRefPtr<Blob> blob = Blob::create(path);
+        *value = toV8(blob);
+        return true;
+    }
+
+    bool readFile(v8::Handle<v8::Value>* value)
+    {
+        String path;
+        if (!readWebCoreString(&path))
+            return false;
+        PassRefPtr<File> file = File::create(path);
+        *value = toV8(file);
+        return true;
+    }
+
+    bool readFileList(v8::Handle<v8::Value>* value)
+    {
+        uint32_t length;
+        if (!doReadUint32(&length))
+            return false;
+        PassRefPtr<FileList> fileList = FileList::create();
+        for (unsigned i = 0; i < length; ++i) {
+            String path;
+            if (!readWebCoreString(&path))
+                return false;
+            fileList->append(File::create(path));
+        }
+        *value = toV8(fileList);
+        return true;
+    }
+
     bool doReadUint32(uint32_t* value)
     {
         *value = 0;
-        char currentByte;
+        uint8_t currentByte;
         int shift = 0;
         do {
             if (m_position >= m_length)
@@ -579,64 +899,94 @@
         return true;
     }
 
-    const char* m_buffer;
+    bool doReadNumber(double* number)
+    {
+        if (m_position + sizeof(double) > m_length)
+            return false;
+        uint8_t* numberAsByteArray = reinterpret_cast<uint8_t*>(number);
+        for (unsigned i = 0; i < sizeof(double); ++i)
+            numberAsByteArray[i] = m_buffer[m_position++];
+        return true;
+    }
+
+    const uint8_t* m_buffer;
     const unsigned m_length;
     unsigned m_position;
 };
 
-class Deserializer {
+class Deserializer : public CompositeCreator {
 public:
-    explicit Deserializer(Reader& reader) : m_reader(reader)
+    explicit Deserializer(Reader& reader)
+        : m_reader(reader)
     {
     }
 
-    v8::Local<v8::Value> deserialize()
+    v8::Handle<v8::Value> deserialize()
     {
         v8::HandleScope scope;
         while (!m_reader.isEof()) {
             if (!doDeserialize())
-                return v8::Local<v8::Value>();
+                return v8::Null();
         }
         if (stackDepth() != 1)
-            return v8::Local<v8::Value>();
+            return v8::Null();
         return scope.Close(element(0));
     }
 
+    virtual bool createArray(uint32_t length, v8::Handle<v8::Value>* value)
+    {
+        if (length > stackDepth())
+            return false;
+        v8::Local<v8::Array> array = v8::Array::New(length);
+        if (array.IsEmpty())
+            return false;
+        const int depth = stackDepth() - length;
+        for (unsigned i = 0; i < length; ++i)
+            array->Set(i, element(depth + i));
+        pop(length);
+        *value = array;
+        return true;
+    }
+
+    virtual bool createObject(uint32_t numProperties, v8::Handle<v8::Value>* value)
+    {
+        v8::Local<v8::Object> object = v8::Object::New();
+        if (object.IsEmpty())
+            return false;
+        return initializeObject(object, numProperties, value);
+    }
+
+    virtual bool createSparseArray(uint32_t numProperties, uint32_t length, v8::Handle<v8::Value>* value)
+    {
+        v8::Local<v8::Array> array = v8::Array::New(length);
+        if (array.IsEmpty())
+            return false;
+        return initializeObject(array, numProperties, value);
+    }
+
 private:
+    bool initializeObject(v8::Handle<v8::Object> object, uint32_t numProperties, v8::Handle<v8::Value>* value)
+    {
+        unsigned length = 2 * numProperties;
+        if (length > stackDepth())
+            return false;
+        for (unsigned i = stackDepth() - length; i < stackDepth(); i += 2) {
+            v8::Local<v8::Value> propertyName = element(i);
+            v8::Local<v8::Value> propertyValue = element(i + 1);
+            object->Set(propertyName, propertyValue);
+        }
+        pop(length);
+        *value = object;
+        return true;
+    }
+
     bool doDeserialize()
     {
-        SerializationTag tag;
         v8::Local<v8::Value> value;
-        int length = 0;
-        if (!m_reader.read(&tag, &value, &length))
+        if (!m_reader.read(&value, *this))
             return false;
-        if (!value.IsEmpty()) {
+        if (!value.IsEmpty())
             push(value);
-        } else if (tag == ObjectTag) {
-            if (length > stackDepth())
-                return false;
-            v8::Local<v8::Object> object = v8::Object::New();
-            for (int i = stackDepth() - length; i < stackDepth(); i += 2) {
-                v8::Local<v8::Value> propertyName = element(i);
-                v8::Local<v8::Value> propertyValue = element(i + 1);
-                object->Set(propertyName, propertyValue);
-            }
-            pop(length);
-            push(object);
-        } else if (tag == ArrayTag) {
-            if (length > stackDepth())
-                return false;
-            v8::Local<v8::Array> array = v8::Array::New(length);
-            const int depth = stackDepth() - length;
-            {
-                v8::HandleScope scope;
-                for (int i = 0; i < length; ++i)
-                    array->Set(v8::Integer::New(i), element(depth + i));
-            }
-            pop(length);
-            push(array);
-        } else if (tag != PaddingTag)
-            return false;
         return true;
     }
 
@@ -648,7 +998,7 @@
         m_stack.shrink(m_stack.size() - length);
     }
 
-    int stackDepth() const { return m_stack.size(); }
+    unsigned stackDepth() const { return m_stack.size(); }
 
     v8::Local<v8::Value> element(unsigned index)
     {
@@ -662,12 +1012,14 @@
 
 } // namespace
 
-SerializedScriptValue::SerializedScriptValue(v8::Handle<v8::Value> value)
+SerializedScriptValue::SerializedScriptValue(v8::Handle<v8::Value> value, bool& didThrow)
 {
+    didThrow = false;
     Writer writer;
     Serializer serializer(writer);
     if (!serializer.serialize(value)) {
-        // FIXME: throw exception
+        throwError(NOT_SUPPORTED_ERR);
+        didThrow = true;
         return;
     }
     m_data = StringImpl::adopt(writer.data());
@@ -679,19 +1031,18 @@
         m_data = data;
     else {
         ASSERT(mode == StringValue);
-        RefPtr<SharedBuffer> buffer = utf8Buffer(data);
         Writer writer;
-        writer.writeString(buffer->data(), buffer->size());
+        writer.writeWebCoreString(data);
         m_data = StringImpl::adopt(writer.data());
     }
 }
 
-v8::Local<v8::Value> SerializedScriptValue::deserialize()
+v8::Handle<v8::Value> SerializedScriptValue::deserialize()
 {
     if (!m_data.impl())
-        return v8::Local<v8::Value>();
+        return v8::Null();
     COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
-    Reader reader(reinterpret_cast<const char*>(m_data.impl()->characters()), 2 * m_data.length());
+    Reader reader(reinterpret_cast<const uint8_t*>(m_data.impl()->characters()), 2 * m_data.length());
     Deserializer deserializer(reader);
     return deserializer.deserialize();
 }
diff --git a/WebCore/bindings/v8/SerializedScriptValue.h b/WebCore/bindings/v8/SerializedScriptValue.h
index 7eb8935..8205a42 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.h
+++ b/WebCore/bindings/v8/SerializedScriptValue.h
@@ -40,10 +40,36 @@
 
 class SerializedScriptValue : public RefCounted<SerializedScriptValue> {
 public:
+    // Deserializes the given value and sets it as a property on the
+    // object.
+    static void deserializeAndSetProperty(v8::Handle<v8::Object> object,
+                                          const char* propertyName,
+                                          v8::PropertyAttribute attribute,
+                                          SerializedScriptValue* value)
+    {
+        if (!value)
+            return;
+        v8::Handle<v8::Value> deserialized = value->deserialize();
+        object->ForceSet(v8::String::NewSymbol(propertyName), deserialized, attribute);
+    }
+
     // Creates a serialized representation of the given V8 value.
     static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value> value)
     {
-        return adoptRef(new SerializedScriptValue(value));
+        bool didThrow;
+        return adoptRef(new SerializedScriptValue(value, didThrow));
+    }
+
+    // Creates a serialized representation of the given V8 value.
+    //
+    // If a serialization error occurs (e.g., cyclic input value) this
+    // function returns an empty representation, schedules a V8 exception to
+    // be thrown using v8::ThrowException(), and sets |didThrow|. In this case
+    // the caller must not invoke any V8 operations until control returns to
+    // V8. When serialization is successful, |didThrow| is false.
+    static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value> value, bool& didThrow)
+    {
+        return adoptRef(new SerializedScriptValue(value, didThrow));
     }
 
     // Creates a serialized value with the given data obtained from a
@@ -74,9 +100,9 @@
 
     String toWireString() const { return m_data; }
 
-    // Deserializes the value (in the current context). Returns an
-    // empty handle in case of failure.
-    v8::Local<v8::Value> deserialize();
+    // Deserializes the value (in the current context). Returns a null value in
+    // case of failure.
+    v8::Handle<v8::Value> deserialize();
 
 private:
     enum StringDataMode {
@@ -86,7 +112,7 @@
 
     SerializedScriptValue() { }
 
-    explicit SerializedScriptValue(v8::Handle<v8::Value>);
+    SerializedScriptValue(v8::Handle<v8::Value>, bool& didThrow);
 
     SerializedScriptValue(String data, StringDataMode mode);
 
diff --git a/WebCore/bindings/v8/StaticDOMDataStore.cpp b/WebCore/bindings/v8/StaticDOMDataStore.cpp
index 722051b..0b0d531 100644
--- a/WebCore/bindings/v8/StaticDOMDataStore.cpp
+++ b/WebCore/bindings/v8/StaticDOMDataStore.cpp
@@ -36,11 +36,11 @@
 StaticDOMDataStore::StaticDOMDataStore(DOMData* domData)
     : DOMDataStore(domData)
     , m_staticDomNodeMap(&DOMDataStore::weakNodeCallback)
-    , m_staticDomObjectMap(domData, &DOMDataStore::weakDOMObjectCallback)
-    , m_staticActiveDomObjectMap(domData, &DOMDataStore::weakActiveDOMObjectCallback)
+    , m_staticDomObjectMap(&DOMDataStore::weakDOMObjectCallback)
+    , m_staticActiveDomObjectMap(&DOMDataStore::weakActiveDOMObjectCallback)
 #if ENABLE(SVG)
-    , m_staticDomSvgElementInstanceMap(domData, &DOMDataStore::weakSVGElementInstanceCallback)
-    , m_staticDomSvgObjectWithContextMap(domData, &DOMDataStore::weakSVGObjectWithContextCallback)
+    , m_staticDomSvgElementInstanceMap(&DOMDataStore::weakSVGElementInstanceCallback)
+    , m_staticDomSvgObjectWithContextMap(&DOMDataStore::weakSVGObjectWithContextCallback)
 #endif
 {
     m_domNodeMap = &m_staticDomNodeMap;
diff --git a/WebCore/bindings/v8/StaticDOMDataStore.h b/WebCore/bindings/v8/StaticDOMDataStore.h
index 64a90e0..d1e5a30 100644
--- a/WebCore/bindings/v8/StaticDOMDataStore.h
+++ b/WebCore/bindings/v8/StaticDOMDataStore.h
@@ -49,11 +49,11 @@
 
 private:
     IntrusiveDOMWrapperMap m_staticDomNodeMap;
-    InternalDOMWrapperMap<void> m_staticDomObjectMap;
-    InternalDOMWrapperMap<void> m_staticActiveDomObjectMap;
+    DOMWrapperMap<void> m_staticDomObjectMap;
+    DOMWrapperMap<void> m_staticActiveDomObjectMap;
 #if ENABLE(SVG)
-    InternalDOMWrapperMap<SVGElementInstance> m_staticDomSvgElementInstanceMap;
-    InternalDOMWrapperMap<void> m_staticDomSvgObjectWithContextMap;
+    DOMWrapperMap<SVGElementInstance> m_staticDomSvgElementInstanceMap;
+    DOMWrapperMap<void> m_staticDomSvgObjectWithContextMap;
 #endif
 };
 
diff --git a/WebCore/bindings/v8/V8AbstractEventListener.cpp b/WebCore/bindings/v8/V8AbstractEventListener.cpp
index 944fd57..6dc2b29 100644
--- a/WebCore/bindings/v8/V8AbstractEventListener.cpp
+++ b/WebCore/bindings/v8/V8AbstractEventListener.cpp
@@ -88,8 +88,6 @@
     v8::Handle<v8::Value> jsEvent = toV8(event);
 
     invokeEventHandler(context, event, jsEvent);
-
-    Document::updateStyleForAllDocuments();
 }
 
 void V8AbstractEventListener::disposeListenerObject()
@@ -147,11 +145,8 @@
         if (!tryCatch.CanContinue())
             return;
 
-        // If an error occurs while handling the event, it should be reported.
-        if (tryCatch.HasCaught()) {
-            reportException(0, tryCatch);
-            tryCatch.Reset();
-        }
+        // If an error occurs while handling the event, it should be reported in a regular way.
+        tryCatch.Reset();
 
         // Restore the old event. This must be done for all exit paths through this method.
         if (savedEvent.IsEmpty())
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index 34020be..e0904d7 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -32,7 +32,6 @@
 #include "V8Binding.h"
 
 #include "AtomicString.h"
-#include "CString.h"
 #include "Element.h"
 #include "MathExtras.h"
 #include "PlatformString.h"
@@ -43,6 +42,7 @@
 #include "Threading.h"
 #include "V8Element.h"
 #include "V8Proxy.h"
+#include <wtf/text/CString.h>
 
 #include <v8.h>
 
@@ -174,6 +174,53 @@
     return intValue->Value();
 }
     
+uint32_t toUInt32(v8::Handle<v8::Value> value, bool& ok)
+{
+    ok = true;
+
+    // FIXME: there is currently no Value::IsUint32(). This code does
+    // some contortions to avoid silently converting out-of-range
+    // values to uint32_t.
+
+    // Fast case.  The value is already a 32-bit positive integer.
+    if (value->IsInt32()) {
+        int32_t result = value->Int32Value();
+        if (result >= 0)
+            return result;
+    }
+
+    // Can the value be converted to a number?
+    v8::Local<v8::Number> numberObject = value->ToNumber();
+    if (numberObject.IsEmpty()) {
+        ok = false;
+        return 0;
+    }
+
+    // Does the value convert to nan or to an infinity?
+    double numberValue = numberObject->Value();
+    if (isnan(numberValue) || isinf(numberValue)) {
+        ok = false;
+        return 0;
+    }
+
+    // Can the value be converted to a 32-bit unsigned integer?
+    v8::Local<v8::Uint32> uintValue = value->ToUint32();
+    if (uintValue.IsEmpty()) {
+        ok = false;
+        return 0;
+    }
+
+    // FIXME: v8::Uint32::Value is not defined!
+    // http://code.google.com/p/v8/issues/detail?id=624
+    v8::Local<v8::Int32> intValue = value->ToInt32();
+    if (intValue.IsEmpty()) {
+        ok = false;
+        return 0;
+    }
+
+    return static_cast<uint32_t>(intValue->Value());
+}
+
 String toWebCoreString(const v8::Arguments& args, int index) {
     return v8ValueToWebCoreString(args[index]);
 }
diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h
index 0be0ebd..696cd1a 100644
--- a/WebCore/bindings/v8/V8Binding.h
+++ b/WebCore/bindings/v8/V8Binding.h
@@ -108,6 +108,17 @@
         return toInt32(value, ok);
     }
 
+    // Convert a value to a 32-bit unsigned integer.  The conversion fails if the
+    // value cannot be converted to an unsigned integer or converts to nan or to an infinity.
+    uint32_t toUInt32(v8::Handle<v8::Value> value, bool& ok);
+
+    // Convert a value to a 32-bit unsigned integer assuming the conversion cannot fail.
+    inline uint32_t toUInt32(v8::Handle<v8::Value> value)
+    {
+        bool ok;
+        return toUInt32(value, ok);
+    }
+
     inline float toFloat(v8::Local<v8::Value> value)
     {
         return static_cast<float>(value->NumberValue());
diff --git a/WebCore/bindings/v8/V8Collection.h b/WebCore/bindings/v8/V8Collection.h
index 9611571..1757c85 100644
--- a/WebCore/bindings/v8/V8Collection.h
+++ b/WebCore/bindings/v8/V8Collection.h
@@ -34,6 +34,7 @@
 #include "HTMLFormElement.h"
 #include "HTMLSelectElement.h"
 #include "V8Binding.h"
+#include "V8Node.h"
 #include "V8Proxy.h"
 #include <v8.h>
 
@@ -63,7 +64,7 @@
 {
     // FIXME: assert object is a collection type
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
-    ASSERT(V8DOMWrapper::domWrapperType(object) != V8ClassIndex::NODE);
+    ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
     Collection* collection = toNativeCollection<Collection>(object);
     AtomicString propertyName = toAtomicWebCoreStringWithNullCheck(name);
     return getV8Object<ItemType>(collection->namedItem(propertyName));
@@ -89,7 +90,7 @@
 {
     // FIXME: Assert that object must be a collection type.
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
-    ASSERT(V8DOMWrapper::domWrapperType(object) != V8ClassIndex::NODE);
+    ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
     Collection* collection = toNativeCollection<Collection>(object);
     return getV8Object<ItemType>(collection->item(index));
 }
@@ -154,17 +155,16 @@
 
 
 // Add indexed getter to the function template for a collection.
-template<class Collection, class ItemType> static void setCollectionIndexedGetter(v8::Handle<v8::FunctionTemplate> desc, V8ClassIndex::V8WrapperType type)
+template<class Collection, class ItemType> static void setCollectionIndexedGetter(v8::Handle<v8::FunctionTemplate> desc)
 {
-    desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionIndexedPropertyGetter<Collection, ItemType>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>,
-                                                        v8::Integer::New(V8ClassIndex::ToInt(type)));
+    desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionIndexedPropertyGetter<Collection, ItemType>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>);
 }
 
 
 // Add named getter to the function template for a collection.
-template<class Collection, class ItemType> static void setCollectionNamedGetter(v8::Handle<v8::FunctionTemplate> desc, V8ClassIndex::V8WrapperType type)
+template<class Collection, class ItemType> static void setCollectionNamedGetter(v8::Handle<v8::FunctionTemplate> desc)
 {
-    desc->InstanceTemplate()->SetNamedPropertyHandler(collectionNamedPropertyGetter<Collection, ItemType>, 0, 0, 0, 0, v8::Integer::New(V8ClassIndex::ToInt(type)));
+    desc->InstanceTemplate()->SetNamedPropertyHandler(collectionNamedPropertyGetter<Collection, ItemType>, 0, 0, 0, 0);
 }
 
 // Add indexed getter returning a string or null to a function template for a collection.
diff --git a/WebCore/bindings/v8/V8DOMMap.cpp b/WebCore/bindings/v8/V8DOMMap.cpp
index fa2fba3..b478d06 100644
--- a/WebCore/bindings/v8/V8DOMMap.cpp
+++ b/WebCore/bindings/v8/V8DOMMap.cpp
@@ -33,7 +33,6 @@
 
 #include "DOMData.h"
 #include "DOMDataStore.h"
-#include "DOMObjectsInclude.h"
 #include "MainThreadDOMData.h"
 #include "ScopedDOMDataStore.h"
 
@@ -95,13 +94,10 @@
 
 #endif // ENABLE(SVG)
 
-static void removeAllDOMObjectsInCurrentThreadHelper()
+void removeAllDOMObjectsInCurrentThread()
 {
     v8::HandleScope scope;
 
-    // Deref all objects in the delayed queue.
-    DOMData::getCurrent()->derefDelayedObjects();
-
     // The DOM objects with the following types only exist on the main thread.
     if (WTF::isMainThread()) {
         // Remove all DOM nodes.
@@ -123,17 +119,6 @@
     DOMData::removeObjectsFromWrapperMap<void>(getActiveDOMObjectMap());
 }
 
-void removeAllDOMObjectsInCurrentThread()
-{
-    // Use the locker only if it has already been invoked before, as by worker thread.
-    if (v8::Locker::IsActive()) {
-        v8::Locker locker;
-        removeAllDOMObjectsInCurrentThreadHelper();
-    } else
-        removeAllDOMObjectsInCurrentThreadHelper();
-}
-
-
 void visitDOMNodesInCurrentThread(DOMWrapperMap<Node>::Visitor* visitor)
 {
     v8::HandleScope scope;
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index cdf4393..6087479 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -31,12 +31,10 @@
 #include "config.h"
 #include "V8DOMWindowShell.h"
 
-#include "CString.h"
 #include "PlatformBridge.h"
 #include "CSSMutableStyleDeclaration.h"
 #include "DateExtension.h"
 #include "DocumentLoader.h"
-#include "DOMObjectsInclude.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
 #include "InspectorTimelineAgent.h"
@@ -51,9 +49,9 @@
 #include "V8DOMMap.h"
 #include "V8DOMWindow.h"
 #include "V8Document.h"
+#include "V8GCForContextDispose.h"
 #include "V8HiddenPropertyName.h"
 #include "V8History.h"
-#include "V8Index.h"
 #include "V8Location.h"
 #include "V8Proxy.h"
 #include "WorkerContextExecutionProxy.h"
@@ -68,6 +66,7 @@
 #include <wtf/StdLibExtras.h>
 #include <wtf/StringExtras.h>
 #include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
 
 #ifdef ANDROID_INSTRUMENT
 #include "TimeCounter.h"
@@ -96,28 +95,20 @@
 static Frame* getTargetFrame(v8::Local<v8::Object> host, v8::Local<v8::Value> data)
 {
     Frame* target = 0;
-    switch (V8ClassIndex::FromInt(data->Int32Value())) {
-    case V8ClassIndex::DOMWINDOW: {
+    WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
+    if (V8DOMWindow::info.equals(type)) {
         v8::Handle<v8::Object> window = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), host);
         if (window.IsEmpty())
             return target;
 
         DOMWindow* targetWindow = V8DOMWindow::toNative(window);
         target = targetWindow->frame();
-        break;
-    }
-    case V8ClassIndex::LOCATION: {
+    } else if (V8History::info.equals(type)) {
         History* history = V8History::toNative(host);
         target = history->frame();
-        break;
-    }
-    case V8ClassIndex::HISTORY: {
+    } else if (V8Location::info.equals(type)) {
         Location* location = V8Location::toNative(host);
         target = location->frame();
-        break;
-    }
-    default:
-        break;
     }
     return target;
 }
@@ -144,7 +135,6 @@
     // m_context, m_global, and m_wrapperBoilerplates should
     // all be non-empty if if m_context is non-empty.
     ASSERT(m_context.IsEmpty() || !m_global.IsEmpty());
-    ASSERT(m_context.IsEmpty() || !m_wrapperBoilerplates.IsEmpty());
     return !m_context.IsEmpty();
 }
 
@@ -154,15 +144,20 @@
         m_frame->loader()->client()->didDestroyScriptContextForFrame();
         m_context.Dispose();
         m_context.Clear();
+
+        // It's likely that disposing the context has created a lot of
+        // garbage. Notify V8 about this so it'll have a chance of cleaning
+        // it up when idle.
+        V8GCForContextDispose::instance().notifyContextDisposed();
     }
 
-    if (!m_wrapperBoilerplates.IsEmpty()) {
-#ifndef NDEBUG
-        V8GCController::unregisterGlobalHandle(this, m_wrapperBoilerplates);
-#endif
-        m_wrapperBoilerplates.Dispose();
-        m_wrapperBoilerplates.Clear();
+    WrapperBoilerplateMap::iterator it = m_wrapperBoilerplates.begin();
+    for (; it != m_wrapperBoilerplates.end(); ++it) {
+        v8::Persistent<v8::Object> wrapper = it->second;
+        wrapper.Dispose();
+        wrapper.Clear();
     }
+    m_wrapperBoilerplates.clear();
 }
 
 void V8DOMWindowShell::destroyGlobal()
@@ -299,19 +294,15 @@
 #endif
     }
 
-    installHiddenObjectPrototype(v8Context);
-    m_wrapperBoilerplates = v8::Persistent<v8::Array>::New(v8::Array::New(V8ClassIndex::WRAPPER_TYPE_COUNT));
-    // Bail out if allocation failed.
-    if (m_wrapperBoilerplates.IsEmpty()) {
+    if (!installHiddenObjectPrototype(v8Context)) {
         disposeContextHandles();
         return;
     }
-#ifndef NDEBUG
-    V8GCController::registerGlobalHandle(PROXY, this, m_wrapperBoilerplates);
-#endif
 
-    if (!installDOMWindow(v8Context, m_frame->domWindow()))
+    if (!installDOMWindow(v8Context, m_frame->domWindow())) {
         disposeContextHandles();
+        return;
+    }
 
     updateDocument();
 
@@ -357,7 +348,7 @@
         // Note: we check the loader URL here instead of the document URL
         // because we might be currently loading an URL into a blank page.
         // See http://code.google.com/p/chromium/issues/detail?id=10924
-        if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_frame->loader()->activeDocumentLoader()->url().protocol() || extensions[i].scheme != m_frame->page()->mainFrame()->loader()->activeDocumentLoader()->url().protocol()))
+        if (extensions[i].scheme.length() > 0 && (extensions[i].scheme != m_frame->loader()->activeDocumentLoader()->url().protocol()))
             continue;
 
         extensionNames[index++] = extensions[i].extension->name();
@@ -369,6 +360,19 @@
 }
 
 void V8DOMWindowShell::setContext(v8::Handle<v8::Context> context)
+<<<<<<< HEAD
+{
+    // if we already have a context, clear it before setting the new one.
+    if (!m_context.IsEmpty()) {
+        m_context.Dispose();
+        m_context.Clear();
+    }
+    m_context = v8::Persistent<v8::Context>::New(context);
+}
+
+bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWindow* window)
+=======
+>>>>>>> webkit.org at r58033
 {
     // if we already have a context, clear it before setting the new one.
     if (!m_context.IsEmpty()) {
@@ -380,28 +384,24 @@
 
 bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWindow* window)
 {
-    v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
-    if (implicitProtoString.IsEmpty())
-        return false;
-
     // Create a new JS window object and use it as the prototype for the  shadow global object.
-    v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::getConstructor(V8ClassIndex::DOMWINDOW, getHiddenObjectPrototype(context));
+    v8::Handle<v8::Function> windowConstructor = V8DOMWrapper::getConstructor(&V8DOMWindow::info, getHiddenObjectPrototype(context));
     v8::Local<v8::Object> jsWindow = SafeAllocation::newInstance(windowConstructor);
     // Bail out if allocation failed.
     if (jsWindow.IsEmpty())
         return false;
 
     // Wrap the window.
-    V8DOMWrapper::setDOMWrapper(jsWindow, V8ClassIndex::ToInt(V8ClassIndex::DOMWINDOW), window);
-    V8DOMWrapper::setDOMWrapper(v8::Handle<v8::Object>::Cast(jsWindow->GetPrototype()), V8ClassIndex::ToInt(V8ClassIndex::DOMWINDOW), window);
+    V8DOMWrapper::setDOMWrapper(jsWindow, &V8DOMWindow::info, window);
+    V8DOMWrapper::setDOMWrapper(v8::Handle<v8::Object>::Cast(jsWindow->GetPrototype()), &V8DOMWindow::info, window);
 
     window->ref();
     V8DOMWrapper::setJSWrapperForDOMObject(window, v8::Persistent<v8::Object>::New(jsWindow));
 
     // Insert the window instance as the prototype of the shadow object.
-    v8::Handle<v8::Object> v8Global = context->Global();
-    V8DOMWrapper::setDOMWrapper(v8::Handle<v8::Object>::Cast(v8Global->GetPrototype()), V8ClassIndex::ToInt(V8ClassIndex::DOMWINDOW), window);
-    v8Global->Set(implicitProtoString, jsWindow);
+    v8::Handle<v8::Object> v8RealGlobal = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
+    V8DOMWrapper::setDOMWrapper(v8RealGlobal, &V8DOMWindow::info, window);
+    v8RealGlobal->SetPrototype(jsWindow);
     return true;
 }
 
@@ -533,31 +533,38 @@
     return context->Global()->GetHiddenValue(V8HiddenPropertyName::objectPrototype());
 }
 
-void V8DOMWindowShell::installHiddenObjectPrototype(v8::Handle<v8::Context> context)
+bool V8DOMWindowShell::installHiddenObjectPrototype(v8::Handle<v8::Context> context)
 {
     v8::Handle<v8::String> objectString = v8::String::New("Object");
     v8::Handle<v8::String> prototypeString = v8::String::New("prototype");
     v8::Handle<v8::String> hiddenObjectPrototypeString = V8HiddenPropertyName::objectPrototype();
     // Bail out if allocation failed.
     if (objectString.IsEmpty() || prototypeString.IsEmpty() || hiddenObjectPrototypeString.IsEmpty())
-        return;
+        return false;
 
     v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global()->Get(objectString));
+    // Bail out if fetching failed.
+    if (object.IsEmpty())
+        return false;
     v8::Handle<v8::Value> objectPrototype = object->Get(prototypeString);
+    // Bail out if fetching failed.
+    if (objectPrototype.IsEmpty())
+        return false;
 
     context->Global()->SetHiddenValue(hiddenObjectPrototypeString, objectPrototype);
+
+    return true;
 }
 
-v8::Local<v8::Object> V8DOMWindowShell::createWrapperFromCacheSlowCase(V8ClassIndex::V8WrapperType type)
+v8::Local<v8::Object> V8DOMWindowShell::createWrapperFromCacheSlowCase(WrapperTypeInfo* type)
 {
     // Not in cache.
-    int classIndex = V8ClassIndex::ToInt(type);
     initContextIfNeeded();
     v8::Context::Scope scope(m_context);
     v8::Local<v8::Function> function = V8DOMWrapper::getConstructor(type, getHiddenObjectPrototype(m_context));
     v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
     if (!instance.IsEmpty()) {
-        m_wrapperBoilerplates->Set(v8::Integer::New(classIndex), instance);
+        m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance));
         return instance->Clone();
     }
     return notHandledByInterceptor();
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.h b/WebCore/bindings/v8/V8DOMWindowShell.h
index 6b8952d..f4eaff2 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.h
+++ b/WebCore/bindings/v8/V8DOMWindowShell.h
@@ -31,7 +31,8 @@
 #ifndef V8DOMWindowShell_h
 #define V8DOMWindowShell_h
 
-#include "V8Index.h"
+#include "WrapperTypeInfo.h"
+#include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -73,16 +74,15 @@
 
     static v8::Handle<v8::Value> getHiddenObjectPrototype(v8::Handle<v8::Context>);
     // WARNING: Call |installHiddenObjectPrototype| only on fresh contexts!
-    static void installHiddenObjectPrototype(v8::Handle<v8::Context>);
+    static bool installHiddenObjectPrototype(v8::Handle<v8::Context>);
 
     // To create JS Wrapper objects, we create a cache of a 'boiler plate'
     // object, and then simply Clone that object each time we need a new one.
     // This is faster than going through the full object creation process.
-    v8::Local<v8::Object> createWrapperFromCache(V8ClassIndex::V8WrapperType type)
+    v8::Local<v8::Object> createWrapperFromCache(WrapperTypeInfo* type)
     {
-        int classIndex = V8ClassIndex::ToInt(type);
-        v8::Local<v8::Object> clone(m_wrapperBoilerplates->CloneElementAt(classIndex));
-        return clone.IsEmpty() ? createWrapperFromCacheSlowCase(type) : clone;
+        v8::Persistent<v8::Object> boilerplate = m_wrapperBoilerplates.get(type);
+        return boilerplate.IsEmpty() ? createWrapperFromCacheSlowCase(type) : boilerplate->Clone();
     }
 
     static void setLocation(DOMWindow*, const String& relativeURL);
@@ -102,15 +102,14 @@
     void updateDocumentWrapperCache();
     void clearDocumentWrapperCache();
 
-    v8::Local<v8::Object> createWrapperFromCacheSlowCase(V8ClassIndex::V8WrapperType);
+    v8::Local<v8::Object> createWrapperFromCacheSlowCase(WrapperTypeInfo*);
 
     Frame* m_frame;
 
     // For each possible type of wrapper, we keep a boilerplate object.
-    // The boilerplate is used to create additional wrappers of the same
-    // type.  We keep a single persistent handle to an array of the
-    // activated boilerplates.
-    v8::Persistent<v8::Array> m_wrapperBoilerplates;
+    // The boilerplate is used to create additional wrappers of the same type.
+    typedef WTF::HashMap<WrapperTypeInfo*, v8::Persistent<v8::Object> > WrapperBoilerplateMap;
+    WrapperBoilerplateMap m_wrapperBoilerplates;
 
     v8::Persistent<v8::Context> m_context;
     v8::Persistent<v8::Object> m_global;
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index cf11e6c..ac29170 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -1,10 +1,10 @@
 /*
  * Copyright (C) 2009 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
@@ -14,7 +14,7 @@
  *     * 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
@@ -33,44 +33,50 @@
 
 #include "CSSMutableStyleDeclaration.h"
 #include "DOMDataStore.h"
-#include "DOMObjectsInclude.h"
 #include "DocumentLoader.h"
 #include "FrameLoaderClient.h"
 #include "Notification.h"
-#include "SVGElementInstance.h"
-#include "SVGPathSeg.h"
 #include "ScriptController.h"
 #include "V8AbstractEventListener.h"
 #include "V8Binding.h"
 #include "V8Collection.h"
 #include "V8CustomEventListener.h"
+#include "V8DedicatedWorkerContext.h"
 #include "V8DOMApplicationCache.h"
 #include "V8DOMMap.h"
 #include "V8DOMWindow.h"
 #include "V8EventListenerList.h"
+#include "V8EventSource.h"
 #include "V8HTMLCollection.h"
 #include "V8HTMLDocument.h"
-#include "V8Index.h"
 #include "V8IsolatedContext.h"
 #include "V8Location.h"
 #include "V8MessageChannel.h"
 #include "V8NamedNodeMap.h"
 #include "V8Node.h"
+#include "V8NodeFilterCondition.h"
 #include "V8NodeList.h"
 #include "V8Notification.h"
 #include "V8Proxy.h"
-#include "V8SVGElementInstance.h"
 #include "V8SharedWorker.h"
 #include "V8SharedWorkerContext.h"
 #include "V8StyleSheet.h"
 #include "V8WebSocket.h"
 #include "V8Worker.h"
 #include "V8WorkerContext.h"
+#include "V8WorkerContextEventListener.h"
 #include "V8XMLHttpRequest.h"
 #include "WebGLArray.h"
 #include "WebGLContextAttributes.h"
 #include "WebGLUniformLocation.h"
 #include "WorkerContextExecutionProxy.h"
+#include "WrapperTypeInfo.h"
+
+#if ENABLE(SVG)
+#include "SVGElementInstance.h"
+#include "SVGPathSeg.h"
+#include "V8SVGElementInstance.h"
+#endif
 
 #include <algorithm>
 #include <utility>
@@ -86,60 +92,11 @@
 typedef HashMap<Node*, v8::Object*> DOMNodeMap;
 typedef HashMap<void*, v8::Object*> DOMObjectMap;
 
-#if ENABLE(3D_CANVAS)
-void V8DOMWrapper::setIndexedPropertiesToExternalArray(v8::Handle<v8::Object> wrapper,
-                                                       int index,
-                                                       void* address,
-                                                       int length)
-{
-    v8::ExternalArrayType array_type = v8::kExternalByteArray;
-    V8ClassIndex::V8WrapperType classIndex = V8ClassIndex::FromInt(index);
-    switch (classIndex) {
-    case V8ClassIndex::WEBGLBYTEARRAY:
-        array_type = v8::kExternalByteArray;
-        break;
-    case V8ClassIndex::WEBGLUNSIGNEDBYTEARRAY:
-        array_type = v8::kExternalUnsignedByteArray;
-        break;
-    case V8ClassIndex::WEBGLSHORTARRAY:
-        array_type = v8::kExternalShortArray;
-        break;
-    case V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY:
-        array_type = v8::kExternalUnsignedShortArray;
-        break;
-    case V8ClassIndex::WEBGLINTARRAY:
-        array_type = v8::kExternalIntArray;
-        break;
-    case V8ClassIndex::WEBGLUNSIGNEDINTARRAY:
-        array_type = v8::kExternalUnsignedIntArray;
-        break;
-    case V8ClassIndex::WEBGLFLOATARRAY:
-        array_type = v8::kExternalFloatArray;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    wrapper->SetIndexedPropertiesToExternalArrayData(address,
-                                                     array_type,
-                                                     length);
-}
-#endif
-
 // The caller must have increased obj's ref count.
 void V8DOMWrapper::setJSWrapperForDOMObject(void* object, v8::Persistent<v8::Object> wrapper)
 {
     ASSERT(V8DOMWrapper::maybeDOMWrapper(wrapper));
-#ifndef NDEBUG
-    V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
-    switch (type) {
-#define MAKE_CASE(TYPE, NAME) case V8ClassIndex::TYPE:
-        ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE)
-        ASSERT_NOT_REACHED();
-#undef MAKE_CASE
-    default:
-        break;
-    }
-#endif
+    ASSERT(!domWrapperType(wrapper)->toActiveDOMObjectFunction);
     getDOMObjectMap().set(object, wrapper);
 }
 
@@ -147,16 +104,7 @@
 void V8DOMWrapper::setJSWrapperForActiveDOMObject(void* object, v8::Persistent<v8::Object> wrapper)
 {
     ASSERT(V8DOMWrapper::maybeDOMWrapper(wrapper));
-#ifndef NDEBUG
-    V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
-    switch (type) {
-#define MAKE_CASE(TYPE, NAME) case V8ClassIndex::TYPE: break;
-        ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE)
-    default: 
-        ASSERT_NOT_REACHED();
-#undef MAKE_CASE
-    }
-#endif
+    ASSERT(domWrapperType(wrapper)->toActiveDOMObjectFunction);
     getActiveDOMObjectMap().set(object, wrapper);
 }
 
@@ -167,7 +115,7 @@
     getDOMNodeMap().set(node, wrapper);
 }
 
-v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Value> objectPrototype)
+v8::Local<v8::Function> V8DOMWrapper::getConstructor(WrapperTypeInfo* type, v8::Handle<v8::Value> objectPrototype)
 {
     // A DOM constructor is a function instance created from a DOM constructor
     // template. There is one instance per context. A DOM constructor is
@@ -178,7 +126,7 @@
     // The reason for 2) is that, in Safari, a DOM constructor is a normal JS
     // object, but not a function. Hotmail relies on the fact that, in Safari,
     // HTMLElement.__proto__ == Object.prototype.
-    v8::Handle<v8::FunctionTemplate> functionTemplate = V8ClassIndex::getTemplate(type);
+    v8::Handle<v8::FunctionTemplate> functionTemplate = type->getTemplate();
     // Getting the function might fail if we're running out of
     // stack or memory.
     v8::TryCatch tryCatch;
@@ -187,11 +135,11 @@
         return v8::Local<v8::Function>();
     // Hotmail fix, see comments above.
     if (!objectPrototype.IsEmpty())
-        value->Set(v8::String::New("__proto__"), objectPrototype);
+        value->SetPrototype(objectPrototype);
     return value;
 }
 
-v8::Local<v8::Function> V8DOMWrapper::getConstructorForContext(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Context> context)
+v8::Local<v8::Function> V8DOMWrapper::getConstructorForContext(WrapperTypeInfo* type, v8::Handle<v8::Context> context)
 {
     // Enter the scope for this context to get the correct constructor.
     v8::Context::Scope scope(context);
@@ -199,7 +147,7 @@
     return getConstructor(type, V8DOMWindowShell::getHiddenObjectPrototype(context));
 }
 
-v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, DOMWindow* window)
+v8::Local<v8::Function> V8DOMWrapper::getConstructor(WrapperTypeInfo* type, DOMWindow* window)
 {
     Frame* frame = window->frame();
     if (!frame)
@@ -213,9 +161,14 @@
 }
 
 #if ENABLE(WORKERS)
+<<<<<<< HEAD
 v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, WorkerContext*)
+=======
+v8::Local<v8::Function> V8DOMWrapper::getConstructor(WrapperTypeInfo* type, WorkerContext*)
+>>>>>>> webkit.org at r58033
 {
-    WorkerContextExecutionProxy* proxy = WorkerContextExecutionProxy::retrieve();
+    WorkerScriptController* controller = WorkerScriptController::controllerForContext();
+    WorkerContextExecutionProxy* proxy = controller ? controller->proxy() : 0;
     if (!proxy)
         return v8::Local<v8::Function>();
 
@@ -226,8 +179,22 @@
     return getConstructorForContext(type, context);
 }
 #endif
+<<<<<<< HEAD
+=======
 
-void V8DOMWrapper::setHiddenWindowReference(Frame* frame, const int internalIndex, v8::Handle<v8::Object> jsObject)
+void V8DOMWrapper::setHiddenReference(v8::Handle<v8::Object> parent, v8::Handle<v8::Value> child)
+{
+    v8::Local<v8::Value> hiddenReferenceObject = parent->GetInternalField(v8DOMHiddenReferenceArrayIndex);
+    if (hiddenReferenceObject->IsNull() || hiddenReferenceObject->IsUndefined()) {
+        hiddenReferenceObject = v8::Array::New();
+        parent->SetInternalField(v8DOMHiddenReferenceArrayIndex, hiddenReferenceObject);
+    }
+    v8::Local<v8::Array> hiddenReferenceArray = v8::Local<v8::Array>::Cast(hiddenReferenceObject);
+    hiddenReferenceArray->Set(v8::Integer::New(hiddenReferenceArray->Length()), child);
+}
+>>>>>>> webkit.org at r58033
+
+void V8DOMWrapper::setHiddenWindowReference(Frame* frame, v8::Handle<v8::Value> jsObject)
 {
     // Get DOMWindow
     if (!frame)
@@ -236,21 +203,18 @@
     if (context.IsEmpty())
         return;
 
-    ASSERT(internalIndex < V8DOMWindow::internalFieldCount);
-
     v8::Handle<v8::Object> global = context->Global();
     // Look for real DOM wrapper.
     global = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), global);
     ASSERT(!global.IsEmpty());
-    ASSERT(global->GetInternalField(internalIndex)->IsUndefined());
-    global->SetInternalField(internalIndex, jsObject);
+
+    setHiddenReference(global, jsObject);
 }
 
-V8ClassIndex::V8WrapperType V8DOMWrapper::domWrapperType(v8::Handle<v8::Object> object)
+WrapperTypeInfo* V8DOMWrapper::domWrapperType(v8::Handle<v8::Object> object)
 {
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
-    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
-    return V8ClassIndex::FromInt(type->Int32Value());
+    return static_cast<WrapperTypeInfo*>(object->GetPointerFromInternalField(v8DOMWrapperTypeIndex));
 }
 
 PassRefPtr<NodeFilter> V8DOMWrapper::wrapNativeNodeFilter(v8::Handle<v8::Value> filter)
@@ -275,15 +239,24 @@
 #if ENABLE(SHARED_WORKERS)
     // We can identify what type of context the global object is wrapping by looking at the
     // internal field count of its prototype. This assumes WorkerContexts and DOMWindows have different numbers
-    // of internal fields, so a COMPILE_ASSERT is included to warn if this ever changes. DOMWindow has
-    // traditionally had far more internal fields than any other class.
-    COMPILE_ASSERT(V8DOMWindow::internalFieldCount != V8WorkerContext::internalFieldCount && V8DOMWindow::internalFieldCount != V8SharedWorkerContext::internalFieldCount,
+    // of internal fields, so a COMPILE_ASSERT is included to warn if this ever changes.
+#if ENABLE(WORKERS)
+    COMPILE_ASSERT(V8DOMWindow::internalFieldCount != V8WorkerContext::internalFieldCount,
         DOMWindowAndWorkerContextHaveUnequalFieldCounts);
+<<<<<<< HEAD
+=======
+    COMPILE_ASSERT(V8DOMWindow::internalFieldCount != V8DedicatedWorkerContext::internalFieldCount,
+        DOMWindowAndDedicatedWorkerContextHaveUnequalFieldCounts);
+#endif
+#if ENABLE(SHARED_WORKERS)
+    COMPILE_ASSERT(V8DOMWindow::internalFieldCount != V8SharedWorkerContext::internalFieldCount,
+        DOMWindowAndSharedWorkerContextHaveUnequalFieldCounts);
+>>>>>>> webkit.org at r58033
 #endif
     return objectPrototype->InternalFieldCount() == V8DOMWindow::internalFieldCount;
 }
 
-v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, V8ClassIndex::V8WrapperType type, void* impl)
+v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo* type, void* impl)
 {
     WorkerContext* workerContext = 0;
     if (V8IsolatedContext::getEntered()) {
@@ -316,12 +289,16 @@
             function = getConstructor(type, workerContext);
         else
 #endif
+<<<<<<< HEAD
             function = V8ClassIndex::getTemplate(type)->GetFunction();
+=======
+            function = type->getTemplate()->GetFunction();
+>>>>>>> webkit.org at r58033
         instance = SafeAllocation::newInstance(function);
     }
     if (!instance.IsEmpty()) {
         // Avoid setting the DOM wrapper for failed allocations.
-        setDOMWrapper(instance, V8ClassIndex::ToInt(type), impl);
+        setDOMWrapper(instance, type, impl);
     }
     return instance;
 }
@@ -338,10 +315,6 @@
 
     ASSERT(object->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
 
-    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
-    ASSERT(type->IsInt32());
-    ASSERT(V8ClassIndex::INVALID_CLASS_INDEX < type->Int32Value() && type->Int32Value() < V8ClassIndex::CLASSINDEX_END);
-
     v8::Handle<v8::Value> wrapper = object->GetInternalField(v8DOMWrapperObjectIndex);
     ASSERT(wrapper->IsNumber() || wrapper->IsExternal());
 
@@ -356,7 +329,7 @@
     return v8::Handle<v8::Object>::Cast(value)->InternalFieldCount();
 }
 
-bool V8DOMWrapper::isWrapperOfType(v8::Handle<v8::Value> value, V8ClassIndex::V8WrapperType classType)
+bool V8DOMWrapper::isWrapperOfType(v8::Handle<v8::Value> value, WrapperTypeInfo* type)
 {
     if (!isValidDOMObject(value))
         return false;
@@ -367,11 +340,8 @@
     v8::Handle<v8::Value> wrapper = object->GetInternalField(v8DOMWrapperObjectIndex);
     ASSERT(wrapper->IsNumber() || wrapper->IsExternal());
 
-    v8::Handle<v8::Value> type = object->GetInternalField(v8DOMWrapperTypeIndex);
-    ASSERT(type->IsInt32());
-    ASSERT(V8ClassIndex::INVALID_CLASS_INDEX < type->Int32Value() && type->Int32Value() < V8ClassIndex::CLASSINDEX_END);
-
-    return V8ClassIndex::FromInt(type->Int32Value()) == classType;
+    WrapperTypeInfo* typeInfo = static_cast<WrapperTypeInfo*>(object->GetPointerFromInternalField(v8DOMWrapperTypeIndex));
+    return typeInfo == type;
 }
 
 v8::Handle<v8::Object> V8DOMWrapper::getWrapper(Node* node)
@@ -440,9 +410,6 @@
         return wrapper;
     }
 
-    if (XMLHttpRequest* xhr = target->toXMLHttpRequest())
-        return toV8(xhr);
-
     // MessagePort is created within its JS counterpart
     if (MessagePort* port = target->toMessagePort()) {
         v8::Handle<v8::Object> wrapper = getActiveDOMObjectMap().get(port);
@@ -470,6 +437,7 @@
     return notHandledByInterceptor();
 }
 
+<<<<<<< HEAD
 PassRefPtr<EventListener> V8DOMWrapper::getEventListener(Node* node, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
 {
     return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
@@ -530,37 +498,23 @@
 
 #if ENABLE(EVENTSOURCE)
 PassRefPtr<EventListener> V8DOMWrapper::getEventListener(EventSource* eventSource, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
+=======
+PassRefPtr<EventListener> V8DOMWrapper::getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
+>>>>>>> webkit.org at r58033
 {
-    if (V8Proxy::retrieve(eventSource->scriptExecutionContext()))
-        return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-
+    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    if (context.IsEmpty())
+        return 0;
+    if (lookup == ListenerFindOnly)
+        return V8EventListenerList::findWrapper(value, isAttribute);
+    v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
+    if (globalObjectPrototypeIsDOMWindow(globalPrototype))
+        return V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
 #if ENABLE(WORKERS)
-    WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
-    if (workerContextProxy)
-        return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
-#endif
-
+    return V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(value, isAttribute);
+#else
     return 0;
-}
 #endif
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(EventTarget* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
-    if (V8Proxy::retrieve(eventTarget->scriptExecutionContext()))
-        return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
-
-#if ENABLE(WORKERS)
-    WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
-    if (workerContextProxy)
-        return workerContextProxy->findOrCreateEventListener(value, isAttribute, lookup == ListenerFindOnly);
-#endif
-
-    return 0;
-}
-
-PassRefPtr<EventListener> V8DOMWrapper::getEventListener(V8Proxy* proxy, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
-{
-    return (lookup == ListenerFindOnly) ? V8EventListenerList::findWrapper(value, isAttribute) : V8EventListenerList::findOrCreateWrapper<V8EventListener>(value, isAttribute);
 }
 
 }  // namespace WebCore
diff --git a/WebCore/bindings/v8/V8DOMWrapper.h b/WebCore/bindings/v8/V8DOMWrapper.h
index 8a3fa3f..97e269a 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.h
+++ b/WebCore/bindings/v8/V8DOMWrapper.h
@@ -39,62 +39,19 @@
 #include "V8CustomXPathNSResolver.h"
 #include "V8DOMMap.h"
 #include "V8Event.h"
-#include "V8Index.h"
 #include "V8Utilities.h"
 #include "V8XPathNSResolver.h"
+#include "WrapperTypeInfo.h"
 #include "XPathNSResolver.h"
 #include <v8.h>
 
 namespace WebCore {
 
-    // FIXME: This probably aren't all needed.
-    class CSSRule;
-    class CSSRuleList;
-    class CSSStyleDeclaration;
-    class CSSValue;
-    class CSSValueList;
-    class ClientRectList;
-    class DOMImplementation;
     class DOMWindow;
-    class Document;
-    class Element;
-    class Event;
-    class EventListener;
     class EventTarget;
     class Frame;
-    class HTMLCollection;
-    class HTMLDocument;
-    class HTMLElement;
-    class HTMLOptionsCollection;
-    class MediaList;
-    class MimeType;
-    class MimeTypeArray;
-    class NamedNodeMap;
-    class Navigator;
     class Node;
-    class NodeFilter;
-    class NodeList;
-    class Plugin;
-    class PluginArray;
-    class SVGElement;
-#if ENABLE(SVG)
-    class SVGElementInstance;
-#endif
-    class Screen;
-    class ScriptExecutionContext;
-#if ENABLE(DOM_STORAGE)
-    class Storage;
-    class StorageEvent;
-#endif
-    class String;
-    class StyleSheet;
-    class StyleSheetList;
-    class V8EventListener;
-    class V8ObjectEventListener;
     class V8Proxy;
-#if ENABLE(WEB_SOCKETS)
-    class WebSocket;
-#endif
     class WorkerContext;
 
     enum ListenerLookupType {
@@ -110,11 +67,11 @@
 #endif
 
         // Sets contents of a DOM wrapper.
-        static void setDOMWrapper(v8::Handle<v8::Object> object, int type, void* cptr)
+        static void setDOMWrapper(v8::Handle<v8::Object> object, WrapperTypeInfo* type, void* cptr)
         {
             ASSERT(object->InternalFieldCount() >= 2);
             object->SetPointerInInternalField(v8DOMWrapperObjectIndex, cptr);
-            object->SetInternalField(v8DOMWrapperTypeIndex, v8::Integer::New(type));
+            object->SetPointerInInternalField(v8DOMWrapperTypeIndex, type);
         }
 
         static v8::Handle<v8::Object> lookupDOMWrapper(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Handle<v8::Object> object)
@@ -122,7 +79,7 @@
             return object.IsEmpty() ? object : object->FindInstanceInPrototypeChain(functionTemplate);
         }
 
-        static V8ClassIndex::V8WrapperType domWrapperType(v8::Handle<v8::Object>);
+        static WrapperTypeInfo* domWrapperType(v8::Handle<v8::Object>);
 
         static v8::Handle<v8::Value> convertEventTargetToV8Object(PassRefPtr<EventTarget> eventTarget)
         {
@@ -131,27 +88,7 @@
 
         static v8::Handle<v8::Value> convertEventTargetToV8Object(EventTarget*);
 
-        static PassRefPtr<EventListener> getEventListener(Node* node, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-        static PassRefPtr<EventListener> getEventListener(SVGElementInstance* element, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-        static PassRefPtr<EventListener> getEventListener(AbstractWorker* worker, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-#if ENABLE(NOTIFICATIONS)
-        static PassRefPtr<EventListener> getEventListener(Notification* notification, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-#endif
-
-        static PassRefPtr<EventListener> getEventListener(WorkerContext* workerContext, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-        static PassRefPtr<EventListener> getEventListener(XMLHttpRequestUpload* upload, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-#if ENABLE(EVENTSOURCE)
-        static PassRefPtr<EventListener> getEventListener(EventSource* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-#endif
-
-        static PassRefPtr<EventListener> getEventListener(EventTarget* eventTarget, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
-
-        static PassRefPtr<EventListener> getEventListener(V8Proxy* proxy, v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
+        static PassRefPtr<EventListener> getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
 
 #if ENABLE(XPATH)
         // XPath-related utilities
@@ -161,7 +98,7 @@
             if (V8XPathNSResolver::HasInstance(value))
                 resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value));
             else if (value->IsObject())
-                resolver = V8CustomXPathNSResolver::create(proxy, value->ToObject());
+                resolver = V8CustomXPathNSResolver::create(value->ToObject());
             return resolver;
         }
 #endif
@@ -169,10 +106,12 @@
         // Wrap JS node filter in C++.
         static PassRefPtr<NodeFilter> wrapNativeNodeFilter(v8::Handle<v8::Value>);
 
-        static v8::Local<v8::Function> getConstructorForContext(V8ClassIndex::V8WrapperType, v8::Handle<v8::Context>);
-        static v8::Local<v8::Function> getConstructor(V8ClassIndex::V8WrapperType, v8::Handle<v8::Value> objectPrototype);
-        static v8::Local<v8::Function> getConstructor(V8ClassIndex::V8WrapperType, DOMWindow*);
-        static v8::Local<v8::Function> getConstructor(V8ClassIndex::V8WrapperType, WorkerContext*);
+        static v8::Local<v8::Function> getConstructorForContext(WrapperTypeInfo*, v8::Handle<v8::Context>);
+        static v8::Local<v8::Function> getConstructor(WrapperTypeInfo*, v8::Handle<v8::Value> objectPrototype);
+        static v8::Local<v8::Function> getConstructor(WrapperTypeInfo*, DOMWindow*);
+#if ENABLE(WORKERS)
+        static v8::Local<v8::Function> getConstructor(WrapperTypeInfo*, WorkerContext*);
+#endif
 
         // Set JS wrapper of a DOM object, the caller in charge of increase ref.
         static void setJSWrapperForDOMObject(void*, v8::Persistent<v8::Object>);
@@ -182,18 +121,14 @@
         static bool isValidDOMObject(v8::Handle<v8::Value>);
 
         // Check whether a V8 value is a wrapper of type |classType|.
-        static bool isWrapperOfType(v8::Handle<v8::Value>, V8ClassIndex::V8WrapperType);
+        static bool isWrapperOfType(v8::Handle<v8::Value>, WrapperTypeInfo*);
 
-#if ENABLE(3D_CANVAS)
-        static void setIndexedPropertiesToExternalArray(v8::Handle<v8::Object>,
-                                                        int,
-                                                        void*,
-                                                        int);
-#endif
+        static void setHiddenReference(v8::Handle<v8::Object> parent, v8::Handle<v8::Value> child);
+
         // Set hidden references in a DOMWindow object of a frame.
-        static void setHiddenWindowReference(Frame*, const int internalIndex, v8::Handle<v8::Object>);
+        static void setHiddenWindowReference(Frame*, v8::Handle<v8::Value>);
 
-        static v8::Local<v8::Object> instantiateV8Object(V8Proxy* proxy, V8ClassIndex::V8WrapperType type, void* impl);
+        static v8::Local<v8::Object> instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo*, void* impl);
 
         static v8::Handle<v8::Object> getWrapper(Node*);
     };
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp
index b478636..61b2a88 100644
--- a/WebCore/bindings/v8/V8GCController.cpp
+++ b/WebCore/bindings/v8/V8GCController.cpp
@@ -31,11 +31,18 @@
 #include "config.h"
 #include "V8GCController.h"
 
+#include "ActiveDOMObject.h"
+#include "Attr.h"
 #include "DOMDataStore.h"
-#include "DOMObjectsInclude.h"
+#include "Frame.h"
+#include "HTMLImageElement.h"
+#include "HTMLNames.h"
+#include "MessagePort.h"
+#include "SVGElement.h"
 #include "V8DOMMap.h"
-#include "V8Index.h"
+#include "V8MessagePort.h"
 #include "V8Proxy.h"
+#include "WrapperTypeInfo.h"
 
 #include <algorithm>
 #include <utility>
@@ -112,7 +119,7 @@
 {
     for (DOMObjectMap::iterator it = wrapperMap.begin(), end = wrapperMap.end(); it != end; ++it) {
         v8::Persistent<v8::Object> wrapper(it->second);
-        V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
+        WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(wrapper);
         void* object = it->first;
         UNUSED_PARAM(type);
         UNUSED_PARAM(object);
@@ -123,7 +130,7 @@
 public:
     void visitDOMWrapper(void* object, v8::Persistent<v8::Object> wrapper)
     {
-        V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
+        WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(wrapper);
         UNUSED_PARAM(type);
         UNUSED_PARAM(object);
     }
@@ -181,36 +188,26 @@
 public:
     void visitDOMWrapper(void* object, v8::Persistent<v8::Object> wrapper)
     {
-        ASSERT(wrapper.IsWeak());
-        V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
-        switch (type) {
-#define MAKE_CASE(TYPE, NAME)                             \
-        case V8ClassIndex::TYPE: {                    \
-            NAME* impl = static_cast<NAME*>(object);  \
-            if (impl->hasPendingActivity())           \
-                wrapper.ClearWeak();                  \
-            break;                                    \
-        }
-    ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE)
-    default:
-        ASSERT_NOT_REACHED();
-#undef MAKE_CASE
-        }
+        WrapperTypeInfo* typeInfo = V8DOMWrapper::domWrapperType(wrapper);  
 
-    // Additional handling of message port ensuring that entangled ports also
-    // have their wrappers entangled. This should ideally be handled when the
-    // ports are actually entangled in MessagePort::entangle, but to avoid
-    // forking MessagePort.* this is postponed to GC time. Having this postponed
-    // has the drawback that the wrappers are "entangled/unentangled" for each
-    // GC even though their entaglement most likely is still the same.
-    if (type == V8ClassIndex::MESSAGEPORT) {
-        // Mark each port as in-use if it's entangled. For simplicity's sake, we assume all ports are remotely entangled,
-        // since the Chromium port implementation can't tell the difference.
-        MessagePort* port1 = static_cast<MessagePort*>(object);
-        if (port1->isEntangled())
-            wrapper.ClearWeak();
+        // Additional handling of message port ensuring that entangled ports also
+        // have their wrappers entangled. This should ideally be handled when the
+        // ports are actually entangled in MessagePort::entangle, but to avoid
+        // forking MessagePort.* this is postponed to GC time. Having this postponed
+        // has the drawback that the wrappers are "entangled/unentangled" for each
+        // GC even though their entaglement most likely is still the same.
+        if (V8MessagePort::info.equals(typeInfo)) {
+            // Mark each port as in-use if it's entangled. For simplicity's sake, we assume all ports are remotely entangled,
+            // since the Chromium port implementation can't tell the difference.
+            MessagePort* port1 = static_cast<MessagePort*>(object);
+            if (port1->isEntangled() || port1->hasPendingActivity())
+                wrapper.ClearWeak();
+        } else {
+            ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper);
+            if (activeDOMObject && activeDOMObject->hasPendingActivity())
+                wrapper.ClearWeak();
+        }
     }
-}
 };
 
 class GrouperItem {
@@ -369,30 +366,20 @@
 public:
     void visitDOMWrapper(void* object, v8::Persistent<v8::Object> wrapper)
     {
-        V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper);
-        switch (type) {
-#define MAKE_CASE(TYPE, NAME)                                                   \
-        case V8ClassIndex::TYPE: {                                              \
-          NAME* impl = static_cast<NAME*>(object);                              \
-          if (impl->hasPendingActivity()) {                                     \
-            ASSERT(!wrapper.IsWeak());                                          \
-            wrapper.MakeWeak(impl, &DOMDataStore::weakActiveDOMObjectCallback); \
-          }                                                                     \
-          break;                                                                \
-        }
-ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE)
-        default:
-            ASSERT_NOT_REACHED();
-#undef MAKE_CASE
-        }
-
-        if (type == V8ClassIndex::MESSAGEPORT) {
+        WrapperTypeInfo* typeInfo = V8DOMWrapper::domWrapperType(wrapper);
+        if (V8MessagePort::info.equals(typeInfo)) {
             MessagePort* port1 = static_cast<MessagePort*>(object);
             // We marked this port as reachable in GCPrologueVisitor.  Undo this now since the
             // port could be not reachable in the future if it gets disentangled (and also
             // GCPrologueVisitor expects to see all handles marked as weak).
-            if (!wrapper.IsWeak() && !wrapper.IsNearDeath())
+            if ((!wrapper.IsWeak() && !wrapper.IsNearDeath()) || port1->hasPendingActivity())
                 wrapper.MakeWeak(port1, &DOMDataStore::weakActiveDOMObjectCallback);
+        } else {
+            ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper);
+            if (activeDOMObject && activeDOMObject->hasPendingActivity()) {
+                ASSERT(!wrapper.IsWeak());
+                wrapper.MakeWeak(activeDOMObject, &DOMDataStore::weakActiveDOMObjectCallback);
+            }
         }
     }
 };
diff --git a/WebCore/bindings/v8/V8GCForContextDispose.cpp b/WebCore/bindings/v8/V8GCForContextDispose.cpp
new file mode 100644
index 0000000..06a0555
--- /dev/null
+++ b/WebCore/bindings/v8/V8GCForContextDispose.cpp
@@ -0,0 +1,72 @@
+/*
+ * 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 "V8GCForContextDispose.h"
+
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+V8GCForContextDispose::V8GCForContextDispose()
+    : m_pseudoIdleTimer(this, &V8GCForContextDispose::pseudoIdleTimerFired)
+{
+}
+
+void V8GCForContextDispose::notifyContextDisposed()
+{
+    v8::V8::ContextDisposedNotification();
+    if (!m_pseudoIdleTimer.isActive())
+        m_pseudoIdleTimer.startOneShot(0.8);
+}
+
+void V8GCForContextDispose::notifyIdleSooner(double maximumFireInterval)
+{
+    if (m_pseudoIdleTimer.isActive()) {
+        double nextFireInterval = m_pseudoIdleTimer.nextFireInterval();
+        if (nextFireInterval > maximumFireInterval) {
+            m_pseudoIdleTimer.stop();
+            m_pseudoIdleTimer.startOneShot(maximumFireInterval);
+        }
+    }
+}
+
+V8GCForContextDispose& V8GCForContextDispose::instance()
+{
+    DEFINE_STATIC_LOCAL(V8GCForContextDispose, staticInstance, ());
+    return staticInstance;
+}
+
+void V8GCForContextDispose::pseudoIdleTimerFired(Timer<V8GCForContextDispose>*)
+{
+    v8::V8::IdleNotification();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8GCForContextDispose.h b/WebCore/bindings/v8/V8GCForContextDispose.h
new file mode 100644
index 0000000..b15c5af
--- /dev/null
+++ b/WebCore/bindings/v8/V8GCForContextDispose.h
@@ -0,0 +1,55 @@
+/*
+ * 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 V8GCForContextDispose_h
+#define V8GCForContextDispose_h
+
+#include "Timer.h"
+#include <v8.h>
+
+namespace WebCore {
+
+class V8GCForContextDispose {
+public:
+    void notifyContextDisposed();
+    void notifyIdleSooner(double maximumFireInterval);
+
+    static V8GCForContextDispose& instance();
+
+private:
+    V8GCForContextDispose(); // Use instance() instead.
+    void pseudoIdleTimerFired(Timer<V8GCForContextDispose>*);
+
+    Timer<V8GCForContextDispose> m_pseudoIdleTimer;
+};
+
+}
+
+#endif // V8GCForContextDispose_h
diff --git a/WebCore/bindings/v8/V8Helpers.cpp b/WebCore/bindings/v8/V8Helpers.cpp
index a690017..486bc48 100644
--- a/WebCore/bindings/v8/V8Helpers.cpp
+++ b/WebCore/bindings/v8/V8Helpers.cpp
@@ -33,16 +33,10 @@
 
 #include "DOMWindow.h"
 #include "NPV8Object.h"
-#include "V8Index.h"
 #include "V8Proxy.h"
 
 namespace WebCore {
 
-void wrapNPObject(v8::Handle<v8::Object> object, NPObject* npObject)
-{
-    V8DOMWrapper::setDOMWrapper(object, V8ClassIndex::NPOBJECT, npObject);
-}
-
 v8::Local<v8::Context> toV8Context(NPP npp, NPObject* npObject)
 {
     V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
diff --git a/WebCore/bindings/v8/V8Helpers.h b/WebCore/bindings/v8/V8Helpers.h
index 469833e..e90f5d6 100644
--- a/WebCore/bindings/v8/V8Helpers.h
+++ b/WebCore/bindings/v8/V8Helpers.h
@@ -37,9 +37,6 @@
 namespace WebCore {
     class V8Proxy;
 
-    // Associates an NPObject with a V8 object.
-    void wrapNPObject(v8::Handle<v8::Object>, NPObject*);
-
     v8::Local<v8::Context> toV8Context(NPP, NPObject*);
 
     V8Proxy* toV8Proxy(NPObject*);
diff --git a/WebCore/bindings/v8/V8IsolatedContext.h b/WebCore/bindings/v8/V8IsolatedContext.h
index 70ca270..5cd9c65 100644
--- a/WebCore/bindings/v8/V8IsolatedContext.h
+++ b/WebCore/bindings/v8/V8IsolatedContext.h
@@ -34,7 +34,6 @@
 #include "IsolatedWorld.h"
 #include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode
 #include "V8DOMWindow.h"
-#include "V8Index.h"
 #include "V8Proxy.h"
 #include "V8Utilities.h"
 #include <v8.h>
diff --git a/WebCore/bindings/v8/V8LazyEventListener.h b/WebCore/bindings/v8/V8LazyEventListener.h
index 078dcf1..f174d23 100644
--- a/WebCore/bindings/v8/V8LazyEventListener.h
+++ b/WebCore/bindings/v8/V8LazyEventListener.h
@@ -60,6 +60,12 @@
 
         virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext*, v8::Handle<v8::Value> jsEvent, Event*);
 
+        // Needs to return true for all event handlers implemented in JavaScript so that
+        // the SVG code does not add the event handler in both
+        // SVGUseElement::buildShadowTree and again in
+        // SVGUseElement::transferEventListenersToShadowTree
+        virtual bool wasCreatedFromMarkup() const { return true; }
+
         String m_functionName;
         bool m_isSVGEvent;
         String m_code;
diff --git a/WebCore/bindings/v8/V8NPObject.cpp b/WebCore/bindings/v8/V8NPObject.cpp
index b873d5f..1ea6487 100644
--- a/WebCore/bindings/v8/V8NPObject.cpp
+++ b/WebCore/bindings/v8/V8NPObject.cpp
@@ -375,7 +375,7 @@
     if (value.IsEmpty())
         return value;
 
-    wrapNPObject(value, object);
+    V8DOMWrapper::setDOMWrapper(value, npObjectTypeInfo(), object);
 
     // KJS retains the object as part of its wrapper (see Bindings::CInstance).
     _NPN_RetainObject(object);
@@ -394,7 +394,7 @@
     if (staticNPObjectMap.contains(object)) {
         v8::HandleScope scope;
         v8::Persistent<v8::Object> handle(staticNPObjectMap.get(object));
-        V8DOMWrapper::setDOMWrapper(handle, WebCore::V8ClassIndex::NPOBJECT, 0);
+        V8DOMWrapper::setDOMWrapper(handle, npObjectTypeInfo(), 0);
         staticNPObjectMap.forget(object);
         _NPN_ReleaseObject(object);
     }
diff --git a/WebCore/bindings/v8/V8NodeFilterCondition.cpp b/WebCore/bindings/v8/V8NodeFilterCondition.cpp
index a8868b5..2170698 100644
--- a/WebCore/bindings/v8/V8NodeFilterCondition.cpp
+++ b/WebCore/bindings/v8/V8NodeFilterCondition.cpp
@@ -72,10 +72,7 @@
     OwnArrayPtr<v8::Handle<v8::Value> > args(new v8::Handle<v8::Value>[1]);
     args[0] = toV8(node);
 
-    V8Proxy* proxy = V8Proxy::retrieve();
-    ASSERT(proxy);
-
-    v8::Handle<v8::Value> result = proxy->callFunction(callback, object, 1, args.get());
+    v8::Handle<v8::Value> result = V8Proxy::callFunctionWithoutFrame(callback, object, 1, args.get());
 
     if (exceptionCatcher.HasCaught()) {
         state->setException(exceptionCatcher.Exception());
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 85db554..878b86a 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -33,14 +33,16 @@
 
 #include "CSSMutableStyleDeclaration.h"
 #include "DateExtension.h"
-#include "DOMObjectsInclude.h"
 #include "DocumentLoader.h"
+#include "Frame.h"
 #include "FrameLoaderClient.h"
 #include "InspectorTimelineAgent.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "PlatformBridge.h"
+#include "SVGElement.h"
 #include "ScriptController.h"
+#include "Settings.h"
 #include "StorageNamespace.h"
 #include "V8Binding.h"
 #include "V8BindingState.h"
@@ -51,19 +53,21 @@
 #include "V8DOMWindow.h"
 #include "V8EventException.h"
 #include "V8HiddenPropertyName.h"
-#include "V8Index.h"
 #include "V8IsolatedContext.h"
 #include "V8RangeException.h"
-#include "V8SVGException.h"
 #include "V8XMLHttpRequestException.h"
 #include "V8XPathException.h"
+#include "WorkerContext.h"
 #include "WorkerContextExecutionProxy.h"
 
+#if ENABLE(SVG)
+#include "V8SVGException.h"
+#endif
+
 #include <algorithm>
 #include <stdio.h>
 #include <utility>
 #include <v8.h>
-#include <v8-debug.h>
 #include <wtf/Assertions.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/StdLibExtras.h>
@@ -80,8 +84,6 @@
 
 namespace WebCore {
 
-v8::Persistent<v8::Context> V8Proxy::m_utilityContext;
-
 // Static list of registered extensions
 V8Extensions V8Proxy::m_extensions;
 
@@ -501,9 +503,32 @@
         // execution finishs before firing the timer.
         m_frame->keepAlive();
 
+#if ENABLE(INSPECTOR)
+        Page* inspectedPage = InspectorTimelineAgent::instanceCount() ? m_frame->page(): 0;
+        if (inspectedPage)
+            if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent()) {
+                v8::ScriptOrigin origin = function->GetScriptOrigin();
+                String resourceName("undefined");
+                int lineNumber = 1;
+                if (!origin.ResourceName().IsEmpty()) {
+                    resourceName = toWebCoreString(origin.ResourceName());
+                    lineNumber = function->GetScriptLineNumber() + 1;
+                }
+                timelineAgent->willCallFunction(resourceName, lineNumber);
+            } else
+                inspectedPage = 0;
+#endif // !ENABLE(INSPECTOR)
+
         m_recursion++;
         result = function->Call(receiver, argc, args);
         m_recursion--;
+
+#if ENABLE(INSPECTOR)
+        if (inspectedPage)
+            if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent())
+                timelineAgent->didCallFunction();
+#endif // !ENABLE(INSPECTOR)
+
     }
 
     // Release the storage mutex if applicable.
@@ -518,6 +543,17 @@
     return result;
 }
 
+v8::Local<v8::Value> V8Proxy::callFunctionWithoutFrame(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
+{
+    V8GCController::checkMemoryUsage();
+    v8::Local<v8::Value> result = function->Call(receiver, argc, args);
+
+    if (v8::V8::IsDead())
+        handleFatalErrorInV8();
+
+    return result;
+}
+
 v8::Local<v8::Value> V8Proxy::newInstance(v8::Handle<v8::Function> constructor, int argc, v8::Handle<v8::Value> args[])
 {
     // No artificial limitations on the depth of recursion, see comment in
@@ -594,7 +630,7 @@
 {
     if (!frame)
         return 0;
-    return frame->script()->canExecuteScripts() ? frame->script()->proxy() : 0;
+    return frame->script()->canExecuteScripts(NotAboutToExecuteScript) ? frame->script()->proxy() : 0;
 }
 
 V8Proxy* V8Proxy::retrieve(ScriptExecutionContext* context)
@@ -675,10 +711,12 @@
         exception = toV8(XPathException::create(description));
         break;
 #endif
+    default:
+        ASSERT_NOT_REACHED();
     }
 
-    ASSERT(!exception.IsEmpty());
-    v8::ThrowException(exception);
+    if (!exception.IsEmpty())
+        v8::ThrowException(exception);
 }
 
 v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message)
@@ -754,95 +792,11 @@
     return args.This();
 }
 
-void V8Proxy::bindJsObjectToWindow(Frame* frame, const char* name, int type, v8::Handle<v8::FunctionTemplate> descriptor, void* impl)
-{
-    // Get environment.
-    v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame);
-    if (v8Context.IsEmpty())
-        return; // JS not enabled.
-
-    v8::Context::Scope scope(v8Context);
-    v8::Handle<v8::Object> instance = descriptor->GetFunction();
-    V8DOMWrapper::setDOMWrapper(instance, type, impl);
-
-    v8::Handle<v8::Object> global = v8Context->Global();
-    global->Set(v8::String::New(name), instance);
-}
-
 void V8Proxy::processConsoleMessages()
 {
     V8ConsoleMessage::processDelayed();
 }
 
-// Create the utility context for holding JavaScript functions used internally
-// which are not visible to JavaScript executing on the page.
-void V8Proxy::createUtilityContext()
-{
-    ASSERT(m_utilityContext.IsEmpty());
-
-    v8::HandleScope scope;
-    v8::Handle<v8::ObjectTemplate> globalTemplate = v8::ObjectTemplate::New();
-    m_utilityContext = v8::Context::New(0, globalTemplate);
-    v8::Context::Scope contextScope(m_utilityContext);
-
-    // Compile JavaScript function for retrieving the source line of the top
-    // JavaScript stack frame.
-    DEFINE_STATIC_LOCAL(const char*, frameSourceLineSource,
-        ("function frameSourceLine(exec_state) {"
-        "  return exec_state.frame(0).sourceLine();"
-        "}"));
-    v8::Script::Compile(v8::String::New(frameSourceLineSource))->Run();
-
-    // Compile JavaScript function for retrieving the source name of the top
-    // JavaScript stack frame.
-    DEFINE_STATIC_LOCAL(const char*, frameSourceNameSource,
-        ("function frameSourceName(exec_state) {"
-        "  var frame = exec_state.frame(0);"
-        "  if (frame.func().resolved() && "
-        "      frame.func().script() && "
-        "      frame.func().script().name()) {"
-        "    return frame.func().script().name();"
-        "  }"
-        "}"));
-    v8::Script::Compile(v8::String::New(frameSourceNameSource))->Run();
-}
-
-bool V8Proxy::sourceLineNumber(int& result)
-{
-    v8::HandleScope scope;
-    v8::Handle<v8::Context> v8UtilityContext = V8Proxy::utilityContext();
-    if (v8UtilityContext.IsEmpty())
-        return false;
-    v8::Context::Scope contextScope(v8UtilityContext);
-    v8::Handle<v8::Function> frameSourceLine;
-    frameSourceLine = v8::Local<v8::Function>::Cast(v8UtilityContext->Global()->Get(v8::String::New("frameSourceLine")));
-    if (frameSourceLine.IsEmpty())
-        return false;
-    v8::Handle<v8::Value> value = v8::Debug::Call(frameSourceLine);
-    if (value.IsEmpty())
-        return false;
-    result = value->Int32Value();
-    return true;
-}
-
-bool V8Proxy::sourceName(String& result)
-{
-    v8::HandleScope scope;
-    v8::Handle<v8::Context> v8UtilityContext = utilityContext();
-    if (v8UtilityContext.IsEmpty())
-        return false;
-    v8::Context::Scope contextScope(v8UtilityContext);
-    v8::Handle<v8::Function> frameSourceName;
-    frameSourceName = v8::Local<v8::Function>::Cast(v8UtilityContext->Global()->Get(v8::String::New("frameSourceName")));
-    if (frameSourceName.IsEmpty())
-        return false;
-    v8::Handle<v8::Value> value = v8::Debug::Call(frameSourceName);
-    if (value.IsEmpty())
-        return false;
-    result = toWebCoreString(value);
-    return true;
-}
-
 void V8Proxy::registerExtensionWithV8(v8::Extension* extension)
 {
     // If the extension exists in our list, it was already registered with V8.
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index 44ed506..98bc902 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -39,7 +39,7 @@
 #include "V8DOMWindowShell.h"
 #include "V8DOMWrapper.h"
 #include "V8GCController.h"
-#include "V8Index.h"
+#include "WrapperTypeInfo.h"
 #include <v8.h>
 #include <wtf/PassRefPtr.h> // so generated bindings don't have to
 #include <wtf/Vector.h>
@@ -76,7 +76,7 @@
         const char* const name;
         v8::AccessorGetter getter;
         v8::AccessorSetter setter;
-        V8ClassIndex::V8WrapperType data;
+        WrapperTypeInfo* data;
         v8::AccessControl settings;
         v8::PropertyAttribute attribute;
         bool onProto;
@@ -89,7 +89,7 @@
         (attribute.onProto ? proto : instance)->SetAccessor(v8::String::New(attribute.name),
             attribute.getter,
             attribute.setter,
-            attribute.data == V8ClassIndex::INVALID_CLASS_INDEX ? v8::Handle<v8::Value>() : v8::Integer::New(V8ClassIndex::ToInt(attribute.data)),
+            v8::External::Wrap(attribute.data),
             attribute.settings,
             attribute.attribute);
     }
@@ -224,6 +224,9 @@
         // Call the function with the given receiver and arguments.
         v8::Local<v8::Value> callFunction(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
 
+        // Call the function with the given receiver and arguments.
+        static v8::Local<v8::Value> callFunctionWithoutFrame(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
+
         // Call the function as constructor with the given arguments.
         v8::Local<v8::Value> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);
 
@@ -298,26 +301,12 @@
         // Schedule an error object to be thrown.
         static v8::Handle<v8::Value> throwError(ErrorType, const char* message);
 
-        // Create an instance of a function descriptor and set to the global object
-        // as a named property. Used by v8_test_shell.
-        static void bindJsObjectToWindow(Frame*, const char* name, int type, v8::Handle<v8::FunctionTemplate>, void*);
-
-        template <int tag, typename T>
-        static v8::Handle<v8::Value> constructDOMObject(const v8::Arguments&);
+        template <typename T>
+        static v8::Handle<v8::Value> constructDOMObject(const v8::Arguments&, WrapperTypeInfo*);
 
         // Process any pending JavaScript console messages.
         static void processConsoleMessages();
 
-        // Function for retrieving the line number and source name for the top
-        // JavaScript stack frame.
-        //
-        // It will return true if the line number was successfully retrieved and written
-        // into the |result| parameter, otherwise the function will return false. It may
-        // fail due to a stck overflow in the underlying JavaScript implentation, handling
-        // of such exception is up to the caller.
-        static bool sourceLineNumber(int& result);
-        static bool sourceName(String& result);
-
         v8::Local<v8::Context> context();
         v8::Local<v8::Context> mainWorldContext();
 
@@ -368,23 +357,10 @@
         static const char* svgExceptionName(int exceptionCode);
 #endif
 
-        static void createUtilityContext();
-
-        // Returns a local handle of the utility context.
-        static v8::Local<v8::Context> utilityContext()
-        {
-            if (m_utilityContext.IsEmpty())
-                createUtilityContext();
-            return v8::Local<v8::Context>::New(m_utilityContext);
-        }
-
         Frame* m_frame;
 
         // For the moment, we have one of these.  Soon we will have one per DOMWrapperWorld.
         RefPtr<V8DOMWindowShell> m_windowShell;
-        
-        // Utility context holding JavaScript functions used internally.
-        static v8::Persistent<v8::Context> m_utilityContext;
 
         int m_handlerLineNumber;
 
@@ -418,8 +394,8 @@
         IsolatedWorldMap m_isolatedWorlds;
     };
 
-    template <int tag, typename T>
-    v8::Handle<v8::Value> V8Proxy::constructDOMObject(const v8::Arguments& args)
+    template <typename T>
+    v8::Handle<v8::Value> V8Proxy::constructDOMObject(const v8::Arguments& args, WrapperTypeInfo* type)
     {
         if (!args.IsConstructCall())
             return throwError(V8Proxy::TypeError, "DOM object constructor cannot be called as a function.");
@@ -427,7 +403,7 @@
         // Note: it's OK to let this RefPtr go out of scope because we also call
         // SetDOMWrapper(), which effectively holds a reference to obj.
         RefPtr<T> obj = T::create();
-        V8DOMWrapper::setDOMWrapper(args.Holder(), tag, obj.get());
+        V8DOMWrapper::setDOMWrapper(args.Holder(), type, obj.get());
         obj->ref();
         V8DOMWrapper::setJSWrapperForDOMObject(obj.get(), v8::Persistent<v8::Object>::New(args.Holder()));
         return args.Holder();
@@ -449,19 +425,22 @@
     }
     inline v8::Handle<v8::Primitive> throwError(const char* message, V8Proxy::ErrorType type = V8Proxy::TypeError)
     {
-        V8Proxy::throwError(type, message);
+        if (!v8::V8::IsExecutionTerminating())
+            V8Proxy::throwError(type, message);
         return v8::Undefined();
     }
 
     inline v8::Handle<v8::Primitive> throwError(ExceptionCode ec)
     {
-        V8Proxy::setDOMException(ec);
+        if (!v8::V8::IsExecutionTerminating())
+            V8Proxy::setDOMException(ec);
         return v8::Undefined();
     }
 
     inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception)
     {
-        v8::ThrowException(exception);
+        if (!v8::V8::IsExecutionTerminating())
+            v8::ThrowException(exception);
         return v8::Undefined();
     }
 
diff --git a/WebCore/bindings/v8/V8SVGPODTypeWrapper.h b/WebCore/bindings/v8/V8SVGPODTypeWrapper.h
index d4cdcf8..c044a06 100644
--- a/WebCore/bindings/v8/V8SVGPODTypeWrapper.h
+++ b/WebCore/bindings/v8/V8SVGPODTypeWrapper.h
@@ -396,13 +396,13 @@
 class V8SVGPODTypeUtil {
 public:
     template <class P>
-    static P toSVGPODType(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Value> object, bool& ok);
+    static P toSVGPODType(WrapperTypeInfo* info, v8::Handle<v8::Value> object, bool& ok);
 };
 
 template <class P>
-P V8SVGPODTypeUtil::toSVGPODType(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Value> object, bool& ok)
+P V8SVGPODTypeUtil::toSVGPODType(WrapperTypeInfo* info, v8::Handle<v8::Value> object, bool& ok)
 {
-    if (!V8DOMWrapper::isWrapperOfType(object, type)) {
+    if (!V8DOMWrapper::isWrapperOfType(object, info)) {
         ok = false;
         return P();
     }
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index c7314f1..ffccb06 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -125,54 +125,17 @@
         frame->redirectScheduler()->scheduleLocationChange(url.string(), callingFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGesture());
 }
 
-ScriptExecutionContext* getScriptExecutionContext(ScriptState* scriptState)
+ScriptExecutionContext* getScriptExecutionContext()
 {
 #if ENABLE(WORKERS)
-    WorkerContextExecutionProxy* proxy = WorkerContextExecutionProxy::retrieve();
-    if (proxy)
-        return proxy->workerContext()->scriptExecutionContext();
+    if (WorkerScriptController* controller = WorkerScriptController::controllerForContext())
+        return controller->workerContext();
 #endif
 
-    Frame* frame;
-    if (scriptState) {
-        v8::HandleScope handleScope;
-        frame = V8Proxy::retrieveFrame(scriptState->context());
-    } else
-        frame = V8Proxy::retrieveFrameForCurrentContext();
-
-    if (frame)
+    if (Frame* frame = V8Proxy::retrieveFrameForCurrentContext())
         return frame->document()->scriptExecutionContext();
 
     return 0;
 }
 
-void reportException(ScriptState* scriptState, v8::TryCatch& exceptionCatcher)
-{
-    String errorMessage;
-    int lineNumber = 0;
-    String sourceURL;
-
-    // There can be a situation that an exception is thrown without setting a message.
-    v8::Local<v8::Message> message = exceptionCatcher.Message();
-    if (message.IsEmpty()) {
-        v8::Local<v8::String> exceptionString = exceptionCatcher.Exception()->ToString();
-        // Conversion of the exception object to string can fail if an
-        // exception is thrown during conversion.
-        if (!exceptionString.IsEmpty())
-            errorMessage = toWebCoreString(exceptionString);
-    } else {
-        errorMessage = toWebCoreString(message->Get());
-        lineNumber = message->GetLineNumber();
-        sourceURL = toWebCoreString(message->GetScriptResourceName());
-    }
-
-    // Do not report the exception if the current execution context is Document because we do not want to lead to duplicate error messages in the console.
-    // FIXME (31171): need better design to solve the duplicate error message reporting problem.
-    ScriptExecutionContext* context = getScriptExecutionContext(scriptState);
-    // During the frame teardown, there may not be a valid context.
-    if (context && !context->isDocument())
-        context->reportException(errorMessage, lineNumber, sourceURL);
-    exceptionCatcher.Reset();
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/V8Utilities.h b/WebCore/bindings/v8/V8Utilities.h
index 944823a..cbe7a7b 100644
--- a/WebCore/bindings/v8/V8Utilities.h
+++ b/WebCore/bindings/v8/V8Utilities.h
@@ -54,12 +54,7 @@
     KURL completeURL(const String& relativeURL);
     void navigateIfAllowed(Frame*, const KURL&, bool lockHistory, bool lockBackForwardList);
 
-    ScriptExecutionContext* getScriptExecutionContext(ScriptState*);
-    inline ScriptExecutionContext* getScriptExecutionContext() {
-        return getScriptExecutionContext(0);
-    }
-
-    void reportException(ScriptState*, v8::TryCatch&);
+    ScriptExecutionContext* getScriptExecutionContext();
 
     class AllowAllocation {
     public:
diff --git a/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp b/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp
new file mode 100644
index 0000000..5a75a40
--- /dev/null
+++ b/WebCore/bindings/v8/V8WorkerContextErrorHandler.cpp
@@ -0,0 +1,66 @@
+/*
+ * 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(WORKERS)
+
+#include "V8WorkerContextErrorHandler.h"
+
+#include "ErrorEvent.h"
+#include "V8Binding.h"
+
+namespace WebCore {
+
+V8WorkerContextErrorHandler::V8WorkerContextErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
+    : V8WorkerContextEventListener(listener, isInline, worldContext)
+{
+}
+
+v8::Local<v8::Value> V8WorkerContextErrorHandler::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
+{
+    ASSERT(event->isErrorEvent());
+    v8::Local<v8::Object> listener = getListenerObject(context);
+    v8::Local<v8::Value> returnValue;
+    if (!listener.IsEmpty() && listener->IsFunction()) {
+        ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
+        v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
+        v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
+        v8::Handle<v8::Value> parameters[3] = { v8String(errorEvent->message()), v8String(errorEvent->filename()), v8::Integer::New(errorEvent->lineno()) };
+        returnValue = callFunction->Call(thisValue, 3, parameters);
+        if (!returnValue.IsEmpty() && returnValue->IsBoolean() && !returnValue->BooleanValue())
+            event->preventDefault();
+    }
+    return returnValue;
+}
+
+} // namespace WebCore
+
+#endif // WORKERS
diff --git a/WebCore/bindings/v8/V8WorkerContextErrorHandler.h b/WebCore/bindings/v8/V8WorkerContextErrorHandler.h
new file mode 100644
index 0000000..cd1e0e6
--- /dev/null
+++ b/WebCore/bindings/v8/V8WorkerContextErrorHandler.h
@@ -0,0 +1,59 @@
+/*
+ * 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 V8WorkerContextErrorHandler_h
+#define V8WorkerContextErrorHandler_h
+
+#if ENABLE(WORKERS)
+
+#include "V8WorkerContextEventListener.h"
+#include <v8.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class V8WorkerContextErrorHandler : public V8WorkerContextEventListener {
+public:
+    static PassRefPtr<V8WorkerContextErrorHandler> create(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext)
+    {
+        return adoptRef(new V8WorkerContextErrorHandler(listener, isInline, worldContext));
+    }
+
+private:
+    V8WorkerContextErrorHandler(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext);
+
+    virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext*, v8::Handle<v8::Value> jsEvent, Event*);
+};
+
+} // namespace WebCore
+
+#endif // WORKERS
+
+#endif // V8WorkerContextErrorHandler_h
diff --git a/WebCore/bindings/v8/V8WorkerContextEventListener.cpp b/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
index fa89ae6..30b9865 100644
--- a/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
+++ b/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
@@ -82,56 +82,6 @@
     invokeEventHandler(context, event, jsEvent);
 }
 
-bool V8WorkerContextEventListener::reportError(ScriptExecutionContext* context, const String& message, const String& url, int lineNumber)
-{
-    if (!context)
-        return false;
-
-    // The callback function can clear the event listener and destroy 'this' object. Keep a local reference to it.
-    RefPtr<V8AbstractEventListener> protect(this);
-
-    v8::HandleScope handleScope;
-
-    WorkerContextExecutionProxy* proxy = workerProxy(context);
-    if (!proxy)
-        return false;
-
-    v8::Handle<v8::Context> v8Context = proxy->context();
-    if (v8Context.IsEmpty())
-        return false;
-
-    // Enter the V8 context in which to perform the event handling.
-    v8::Context::Scope scope(v8Context);
-
-    v8::Local<v8::Object> listener = getListenerObject(context);
-    v8::Local<v8::Value> returnValue;
-    {
-        // Catch exceptions thrown in calling the function so they do not propagate to javascript code that caused the event to fire.
-        v8::TryCatch tryCatch;
-        tryCatch.SetVerbose(true);
-
-        // Call the function.
-        if (!listener.IsEmpty() && listener->IsFunction()) {
-            v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
-            v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
-
-            v8::Handle<v8::Value> parameters[3] = { v8String(message), v8String(url), v8::Integer::New(lineNumber) };
-            returnValue = callFunction->Call(thisValue, 3, parameters);
-        }
-
-        // If an error occurs while handling the script error, it should be bubbled up.
-        if (tryCatch.HasCaught()) {
-            tryCatch.Reset();
-            return false;
-        }
-    }
-
-    // If the function returns false, then the error is handled. Otherwise, the error is not handled.
-    bool errorHandled = returnValue->IsBoolean() && !returnValue->BooleanValue();
-
-    return errorHandled;
-}
-
 v8::Local<v8::Value> V8WorkerContextEventListener::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
 {
     v8::Local<v8::Function> handlerFunction = getListenerFunction(context);
diff --git a/WebCore/bindings/v8/V8WorkerContextEventListener.h b/WebCore/bindings/v8/V8WorkerContextEventListener.h
index 4487497..1d0bfc8 100644
--- a/WebCore/bindings/v8/V8WorkerContextEventListener.h
+++ b/WebCore/bindings/v8/V8WorkerContextEventListener.h
@@ -50,11 +50,11 @@
         }
 
         virtual void handleEvent(ScriptExecutionContext*, Event*);
-        virtual bool reportError(ScriptExecutionContext*, const String& message, const String& url, int lineNumber);
 
-    private:
+    protected:
         V8WorkerContextEventListener(v8::Local<v8::Object> listener, bool isInline, const WorldContextHandle& worldContext);
 
+    private:
         virtual v8::Local<v8::Value> callListenerFunction(ScriptExecutionContext*, v8::Handle<v8::Value> jsEvent, Event*);
         v8::Local<v8::Object> getReceiverObject(ScriptExecutionContext*, Event*);
     };
diff --git a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
index e4b417e..16e0b41 100644
--- a/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
+++ b/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
@@ -35,33 +35,20 @@
 
 #include "WorkerContextExecutionProxy.h"
 
-#include "DOMCoreException.h"
 #include "DedicatedWorkerContext.h"
 #include "Event.h"
-#include "EventSource.h"
-#include "Notification.h"
-#include "NotificationCenter.h"
-#include "EventException.h"
-#include "MessagePort.h"
-#include "RangeException.h"
 #include "SharedWorker.h"
 #include "SharedWorkerContext.h"
 #include "V8Binding.h"
+#include "V8ConsoleMessage.h"
 #include "V8DOMMap.h"
-#include "V8Index.h"
+#include "V8DedicatedWorkerContext.h"
 #include "V8Proxy.h"
-#include "V8WorkerContext.h"
-#include "V8WorkerContextEventListener.h"
-#if ENABLE(WEB_SOCKETS)
-#include "WebSocket.h"
-#endif
+#include "V8SharedWorkerContext.h"
 #include "Worker.h"
 #include "WorkerContext.h"
-#include "WorkerLocation.h"
-#include "WorkerNavigator.h"
 #include "WorkerScriptController.h"
-#include "XMLHttpRequest.h"
-#include "XMLHttpRequestException.h"
+#include "WrapperTypeInfo.h"
 
 namespace WebCore {
 
@@ -71,6 +58,26 @@
     CRASH();
 }
 
+static void v8MessageHandler(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data)
+{
+    static bool isReportingException = false;
+    // Exceptions that occur in error handler should be ignored since in that case
+    // WorkerContext::reportException will send the exception to the worker object.
+    if (isReportingException)
+        return;
+    isReportingException = true;
+
+    // During the frame teardown, there may not be a valid context.
+    if (ScriptExecutionContext* context = getScriptExecutionContext()) {
+        String errorMessage = toWebCoreString(message->Get());
+        int lineNumber = message->GetLineNumber();
+        String sourceURL = toWebCoreString(message->GetScriptResourceName());
+        context->reportException(errorMessage, lineNumber, sourceURL);
+    }
+
+    isReportingException = false;
+}
+
 WorkerContextExecutionProxy::WorkerContextExecutionProxy(WorkerContext* workerContext)
     : m_workerContext(workerContext)
     , m_recursion(0)
@@ -100,21 +107,6 @@
     }
 }
 
-WorkerContextExecutionProxy* WorkerContextExecutionProxy::retrieve()
-{
-    // Happens on frame destruction, check otherwise GetCurrent() will crash.
-    if (!v8::Context::InContext())
-        return 0;
-    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
-    v8::Handle<v8::Object> global = context->Global();
-    global = V8DOMWrapper::lookupDOMWrapper(V8WorkerContext::GetTemplate(), global);
-    // Return 0 if the current executing context is not the worker context.
-    if (global.IsEmpty())
-        return 0;
-    WorkerContext* workerContext = V8WorkerContext::toNative(global);
-    return workerContext->script()->proxy();
-}
-
 void WorkerContextExecutionProxy::initV8IfNeeded()
 {
     static bool v8Initialized = false;
@@ -134,46 +126,53 @@
     v8Initialized = true;
 }
 
-void WorkerContextExecutionProxy::initContextIfNeeded()
+bool WorkerContextExecutionProxy::initContextIfNeeded()
 {
     // Bail out if the context has already been initialized.
     if (!m_context.IsEmpty())
-        return;
+        return true;
+
+    // Setup the security handlers and message listener. This only has
+    // to be done once.
+    static bool isV8Initialized = false;
+    if (!isV8Initialized)
+        v8::V8::AddMessageListener(&v8MessageHandler);
 
     // Create a new environment
     v8::Persistent<v8::ObjectTemplate> globalTemplate;
     m_context = v8::Context::New(0, globalTemplate);
+    if (m_context.IsEmpty())
+        return false;
 
     // Starting from now, use local context only.
     v8::Local<v8::Context> context = v8::Local<v8::Context>::New(m_context);
+
     v8::Context::Scope scope(context);
 
-    // Allocate strings used during initialization.
-    v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
-
     // Create a new JS object and use it as the prototype for the shadow global object.
-    V8ClassIndex::V8WrapperType contextType = V8ClassIndex::DEDICATEDWORKERCONTEXT;
+    WrapperTypeInfo* contextType = &V8DedicatedWorkerContext::info;
 #if ENABLE(SHARED_WORKERS)
     if (!m_workerContext->isDedicatedWorkerContext())
-        contextType = V8ClassIndex::SHAREDWORKERCONTEXT;
+        contextType = &V8SharedWorkerContext::info;
 #endif
     v8::Handle<v8::Function> workerContextConstructor = V8DOMWrapper::getConstructorForContext(contextType, context);
     v8::Local<v8::Object> jsWorkerContext = SafeAllocation::newInstance(workerContextConstructor);
     // Bail out if allocation failed.
     if (jsWorkerContext.IsEmpty()) {
         dispose();
-        return;
+        return false;
     }
 
     // Wrap the object.
-    V8DOMWrapper::setDOMWrapper(jsWorkerContext, V8ClassIndex::ToInt(contextType), m_workerContext);
+    V8DOMWrapper::setDOMWrapper(jsWorkerContext, contextType, m_workerContext);
 
     V8DOMWrapper::setJSWrapperForDOMObject(m_workerContext, v8::Persistent<v8::Object>::New(jsWorkerContext));
     m_workerContext->ref();
 
     // Insert the object instance as the prototype of the shadow object.
-    v8::Handle<v8::Object> globalObject = m_context->Global();
-    globalObject->Set(implicitProtoString, jsWorkerContext);
+    v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_context->Global()->GetPrototype());
+    globalObject->SetPrototype(jsWorkerContext);
+    return true;
 }
 
 bool WorkerContextExecutionProxy::forgetV8EventObject(Event* event)
@@ -189,7 +188,9 @@
 {
     v8::HandleScope hs;
 
-    initContextIfNeeded();
+    if (!initContextIfNeeded())
+        return ScriptValue();
+
     v8::Context::Scope scope(m_context);
 
     v8::TryCatch exceptionCatcher;
@@ -198,6 +199,9 @@
     v8::Handle<v8::Script> compiledScript = V8Proxy::compileScript(scriptString, fileName, baseLine);
     v8::Local<v8::Value> result = runScript(compiledScript);
 
+    if (!exceptionCatcher.CanContinue())
+        return ScriptValue();
+
     if (exceptionCatcher.HasCaught()) {
         v8::Local<v8::Message> message = exceptionCatcher.Message();
         state->hadException = true;
@@ -247,11 +251,6 @@
     return result;
 }
 
-PassRefPtr<V8EventListener> WorkerContextExecutionProxy::findOrCreateEventListener(v8::Local<v8::Value> object, bool isInline, bool findOnly)
-{
-    return findOnly ? V8EventListenerList::findWrapper(object, isInline) : V8EventListenerList::findOrCreateWrapper<V8WorkerContextEventListener>(object, isInline);
-}
-
 void WorkerContextExecutionProxy::trackEvent(Event* event)
 {
     m_events.append(event);
diff --git a/WebCore/bindings/v8/WorkerContextExecutionProxy.h b/WebCore/bindings/v8/WorkerContextExecutionProxy.h
index 67a472b..58824b9 100644
--- a/WebCore/bindings/v8/WorkerContextExecutionProxy.h
+++ b/WebCore/bindings/v8/WorkerContextExecutionProxy.h
@@ -35,8 +35,6 @@
 #if ENABLE(WORKERS)
 
 #include "ScriptValue.h"
-#include "V8EventListenerList.h"
-#include "V8Index.h"
 #include <v8.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
@@ -45,8 +43,6 @@
 
     class Event;
     class EventTarget;
-    class V8EventListener;
-    class V8WorkerContextEventListener;
     class WorkerContext;
 
     struct WorkerContextExecutionState {
@@ -64,9 +60,6 @@
         WorkerContextExecutionProxy(WorkerContext*);
         ~WorkerContextExecutionProxy();
 
-        // Finds/creates event listener wrappers.
-        PassRefPtr<V8EventListener> findOrCreateEventListener(v8::Local<v8::Value> listener, bool isInline, bool findOnly);
-
         // Track the event so that we can detach it from the JS wrapper when a worker
         // terminates. This is needed because we need to be able to dispose these
         // events and releases references to their event targets: WorkerContext.
@@ -78,15 +71,9 @@
         // Returns a local handle of the context.
         v8::Local<v8::Context> context() { return v8::Local<v8::Context>::New(m_context); }
 
-        // Returns WorkerContext object.
-        WorkerContext* workerContext() { return m_workerContext; }
-
-        // Returns WorkerContextExecutionProxy object of the currently executing context. 0 will be returned if the current executing context is not the worker context.
-        static WorkerContextExecutionProxy* retrieve();
-
     private:
         void initV8IfNeeded();
-        void initContextIfNeeded();
+        bool initContextIfNeeded();
         void dispose();
 
         // Run an already compiled script.
diff --git a/WebCore/bindings/v8/WorkerScriptController.cpp b/WebCore/bindings/v8/WorkerScriptController.cpp
index f2311bf..7db0d8d 100644
--- a/WebCore/bindings/v8/WorkerScriptController.cpp
+++ b/WebCore/bindings/v8/WorkerScriptController.cpp
@@ -41,6 +41,7 @@
 #include "DOMTimer.h"
 #include "V8DOMMap.h"
 #include "V8Proxy.h"
+#include "V8WorkerContext.h"
 #include "WorkerContext.h"
 #include "WorkerContextExecutionProxy.h"
 #include "WorkerObjectProxy.h"
@@ -85,11 +86,13 @@
     return result;
 }
 
-void WorkerScriptController::forbidExecution()
+void WorkerScriptController::forbidExecution(ForbidExecutionOption option)
 {
-    // This function is called from another thread.
+    // This function may be called from another thread.
     MutexLocker lock(m_sharedDataMutex);
     m_executionForbidden = true;
+    if (option == TerminateRunningScript)
+        v8::V8::TerminateExecution();
 }
 
 void WorkerScriptController::setException(ScriptValue exception)
@@ -97,6 +100,21 @@
     throwError(*exception.v8Value());
 }
 
+WorkerScriptController* WorkerScriptController::controllerForContext()
+{
+    // Happens on frame destruction, check otherwise GetCurrent() will crash.
+    if (!v8::Context::InContext())
+        return 0;
+    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    v8::Handle<v8::Object> global = context->Global();
+    global = V8DOMWrapper::lookupDOMWrapper(V8WorkerContext::GetTemplate(), global);
+    // Return 0 if the current executing context is not the worker context.
+    if (global.IsEmpty())
+        return 0;
+    WorkerContext* workerContext = V8WorkerContext::toNative(global);
+    return workerContext->script();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/v8/WorkerScriptController.h b/WebCore/bindings/v8/WorkerScriptController.h
index 07e224c..616697a 100644
--- a/WebCore/bindings/v8/WorkerScriptController.h
+++ b/WebCore/bindings/v8/WorkerScriptController.h
@@ -48,14 +48,19 @@
         WorkerScriptController(WorkerContext*);
         ~WorkerScriptController();
 
-        WorkerContextExecutionProxy* proxy() { return m_proxy.get(); }
+        WorkerContextExecutionProxy* proxy() { return m_executionForbidden ? 0 : m_proxy.get(); }
+        WorkerContext* workerContext() { return m_workerContext; }
 
         ScriptValue evaluate(const ScriptSourceCode&);
         ScriptValue evaluate(const ScriptSourceCode&, ScriptValue* exception);
 
         void setException(ScriptValue);
 
-        void forbidExecution();
+        enum ForbidExecutionOption { TerminateRunningScript, LetRunningScriptFinish };
+        void forbidExecution(ForbidExecutionOption);
+
+        // Returns WorkerScriptController for the currently executing context. 0 will be returned if the current executing context is not the worker context.
+        static WorkerScriptController* controllerForContext();
 
     private:
         WorkerContext* m_workerContext;
diff --git a/WebCore/bindings/v8/WrapperTypeInfo.h b/WebCore/bindings/v8/WrapperTypeInfo.h
new file mode 100644
index 0000000..1d1cbfd
--- /dev/null
+++ b/WebCore/bindings/v8/WrapperTypeInfo.h
@@ -0,0 +1,86 @@
+/*
+ * 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 WrapperTypeInfo_h
+#define WrapperTypeInfo_h
+
+#include <v8.h>
+
+namespace WebCore {
+    
+    class ActiveDOMObject;
+    
+    static const int v8DOMWrapperTypeIndex = 0;
+    static const int v8DOMWrapperObjectIndex = 1;
+    static const int v8DOMHiddenReferenceArrayIndex = 2;
+    static const int v8DefaultWrapperInternalFieldCount = 3;
+    
+    typedef v8::Persistent<v8::FunctionTemplate> (*GetTemplateFunction)();
+    typedef void (*DerefObjectFunction)(void*);
+    typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
+    
+    // This struct provides a way to store a bunch of information that is helpful when unwrapping
+    // v8 objects. Each v8 bindings class has exactly one static WrapperTypeInfo member, so
+    // comparing pointers is a safe way to determine if types match.
+    struct WrapperTypeInfo {
+        
+        static WrapperTypeInfo* unwrap(v8::Handle<v8::Value> typeInfoWrapper)
+        {
+            return reinterpret_cast<WrapperTypeInfo*>(v8::External::Unwrap(typeInfoWrapper));
+        }
+        
+        
+        bool equals(const WrapperTypeInfo* that) const
+        {
+            return this == that;
+        }
+        
+        v8::Persistent<v8::FunctionTemplate> getTemplate() { return getTemplateFunction(); }
+        
+        void derefObject(void* object)
+        {
+            if (derefObjectFunction) 
+                derefObjectFunction(object);
+        }
+        
+        ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object> object)
+        {
+            if (!toActiveDOMObjectFunction)
+                return 0;
+            return toActiveDOMObjectFunction(object);
+        }
+        
+        const GetTemplateFunction getTemplateFunction;
+        const DerefObjectFunction derefObjectFunction;
+        const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
+    };
+}
+
+#endif // WrapperTypeInfo_h
diff --git a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp b/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
deleted file mode 100644
index e776438..0000000
--- a/WebCore/bindings/v8/custom/V8AbstractWorkerCustom.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2009 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(WORKERS)
-#include "V8AbstractWorker.h"
-
-#include "AbstractWorker.h"
-#include "ExceptionCode.h"
-#include "ScriptExecutionContext.h"
-#include "V8Binding.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "WorkerContextExecutionProxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8AbstractWorker::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS(L"DOM.AbstractWorker.addEventListener()");
-    AbstractWorker* worker = V8AbstractWorker::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(worker, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        worker->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8AbstractWorker::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS(L"DOM.AbstractWorker.removeEventListener()");
-    AbstractWorker* worker = V8AbstractWorker::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(worker, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        worker->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/v8/custom/V8BarInfoCustom.cpp b/WebCore/bindings/v8/custom/V8BarInfoCustom.cpp
deleted file mode 100644
index 44f0b62..0000000
--- a/WebCore/bindings/v8/custom/V8BarInfoCustom.cpp
+++ /dev/null
@@ -1,73 +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 "V8BarInfo.h"
-
-#include "V8DOMWindow.h"
-#include "V8DOMWrapper.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> toV8(BarInfo* impl)
-{
-    if (!impl)
-        return v8::Null();
-    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
-    if (wrapper.IsEmpty()) {
-        wrapper = V8BarInfo::wrap(impl);
-        if (!wrapper.IsEmpty()) {
-            Frame* frame = impl->frame();
-            switch (impl->type()) {
-            case BarInfo::Locationbar:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::locationbarIndex, wrapper);
-                break;
-            case BarInfo::Menubar:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::menubarIndex, wrapper);
-                break;
-            case BarInfo::Personalbar:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::personalbarIndex, wrapper);
-                break;
-            case BarInfo::Scrollbars:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::scrollbarsIndex, wrapper);
-                break;
-            case BarInfo::Statusbar:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::statusbarIndex, wrapper);
-                break;
-            case BarInfo::Toolbar:
-                V8DOMWrapper::setHiddenWindowReference(frame, V8DOMWindow::toolbarIndex, wrapper);
-                break;
-            }
-        }
-    }
-    return wrapper;
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp b/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp
index 5dcc966..9effca3 100644
--- a/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "V8CSSStyleSheet.h"
 
+#include "V8DOMWrapper.h"
 #include "V8Node.h"
 
 namespace WebCore {
@@ -43,7 +44,7 @@
     // Add a hidden reference from stylesheet object to its owner node.
     Node* ownerNode = impl->ownerNode();
     if (ownerNode && !wrapper.IsEmpty())
-        wrapper->SetInternalField(V8CSSStyleSheet::ownerNodeIndex, toV8(ownerNode));
+        V8DOMWrapper::setHiddenReference(wrapper, toV8(ownerNode));
     return wrapper;
 }
 
diff --git a/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp b/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp
index b06bc3c..601a62a 100644
--- a/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp
@@ -33,9 +33,12 @@
 
 #include "V8CSSPrimitiveValue.h"
 #include "V8CSSValueList.h"
+#include "V8WebKitCSSTransformValue.h"
+
+#if ENABLE(SVG)
 #include "V8SVGColor.h"
 #include "V8SVGPaint.h"
-#include "V8WebKitCSSTransformValue.h"
+#endif
 
 namespace WebCore {
 
diff --git a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
index 9a05d72..26fc626 100644
--- a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
@@ -98,362 +98,4 @@
     impl->setFillStyle(toCanvasStyle(value));
 }
 
-// TODO: SetStrokeColor and SetFillColor are similar except function names,
-// consolidate them into one.
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::setStrokeColorCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.setStrokeColor()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-    switch (args.Length()) {
-    case 1:
-        if (args[0]->IsString())
-            context->setStrokeColor(toWebCoreString(args[0]));
-        else
-            context->setStrokeColor(toFloat(args[0]));
-        break;
-    case 2:
-        if (args[0]->IsString())
-            context->setStrokeColor(toWebCoreString(args[0]), toFloat(args[1]));
-        else
-            context->setStrokeColor(toFloat(args[0]), toFloat(args[1]));
-        break;
-    case 4:
-        context->setStrokeColor(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]));
-        break;
-    case 5:
-        context->setStrokeColor(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]));
-        break;
-    default:
-        V8Proxy::throwError(V8Proxy::SyntaxError, "setStrokeColor: Invalid number of arguments");
-        break;
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::setFillColorCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.setFillColor()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-    switch (args.Length()) {
-    case 1:
-        if (args[0]->IsString())
-            context->setFillColor(toWebCoreString(args[0]));
-        else 
-            context->setFillColor(toFloat(args[0]));
-        break;
-    case 2:
-        if (args[0]->IsString())
-            context->setFillColor(toWebCoreString(args[0]), toFloat(args[1]));
-        else
-            context->setFillColor(toFloat(args[0]), toFloat(args[1]));
-        break;
-    case 4:
-        context->setFillColor(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]));
-        break;
-    case 5:
-        context->setFillColor(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]));
-        break;
-    default:
-        V8Proxy::throwError(V8Proxy::SyntaxError, "setFillColor: Invalid number of arguments");
-        break;
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::strokeRectCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.strokeRect()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-    if (args.Length() == 5)
-        context->strokeRect(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]));
-    else if (args.Length() == 4)
-        context->strokeRect(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]));
-    else {
-        V8Proxy::setDOMException(INDEX_SIZE_ERR);
-        return notHandledByInterceptor();
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::setShadowCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.setShadow()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    switch (args.Length()) {
-    case 3:
-        context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]));
-        break;
-    case 4:
-        if (args[3]->IsString())
-            context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toWebCoreString(args[3]));
-        else
-            context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]));
-        break;
-    case 5:
-        if (args[3]->IsString())
-            context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toWebCoreString(args[3]), toFloat(args[4]));
-        else
-            context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]));
-        break;
-    case 7:
-        context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]));
-        break;
-    case 8:
-        context->setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]), toFloat(args[7]));
-        break;
-    default:
-        V8Proxy::throwError(V8Proxy::SyntaxError, "setShadow: Invalid number of arguments");
-        break;
-    }
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::drawImageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.drawImage()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    v8::Handle<v8::Value> arg = args[0];
-
-    if (V8HTMLImageElement::HasInstance(arg)) {
-        ExceptionCode ec = 0;
-        HTMLImageElement* imageElement = V8HTMLImageElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        switch (args.Length()) {
-        case 3:
-            context->drawImage(imageElement, toFloat(args[1]), toFloat(args[2]));
-            break;
-        case 5:
-            context->drawImage(imageElement, toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        case 9:
-            context->drawImage(imageElement, 
-                FloatRect(toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4])), 
-                FloatRect(toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8])),
-                ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        default:
-            return throwError("drawImage: Invalid number of arguments", V8Proxy::SyntaxError);
-        }
-        return v8::Undefined();
-    }
-
-    // HTMLCanvasElement
-    if (V8HTMLCanvasElement::HasInstance(arg)) {
-        ExceptionCode ec = 0;
-        HTMLCanvasElement* canvasElement = V8HTMLCanvasElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        switch (args.Length()) {
-        case 3:
-            context->drawImage(canvasElement, toFloat(args[1]), toFloat(args[2]));
-            break;
-        case 5:
-            context->drawImage(canvasElement, toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        case 9:
-            context->drawImage(canvasElement,
-                FloatRect(toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4])),
-                FloatRect(toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8])),
-                ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        default:
-            return throwError("drawImage: Invalid number of arguments", V8Proxy::SyntaxError);
-        }
-        return v8::Undefined();
-    }
-
-#if ENABLE(VIDEO)
-    // HTMLVideoElement
-    if (V8HTMLVideoElement::HasInstance(arg)) {
-        ExceptionCode ec = 0;
-        HTMLVideoElement* videoElement = V8HTMLVideoElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        switch (args.Length()) {
-        case 3:
-            context->drawImage(videoElement, toFloat(args[1]), toFloat(args[2]));
-            break;
-        case 5:
-            context->drawImage(videoElement, toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        case 9:
-            context->drawImage(videoElement,
-                FloatRect(toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4])),
-                FloatRect(toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8])),
-                ec);
-            if (ec != 0) {
-                V8Proxy::setDOMException(ec);
-                return notHandledByInterceptor();
-            }
-            break;
-        default:
-            return throwError("drawImage: Invalid number of arguments", V8Proxy::SyntaxError);
-        }
-        return v8::Undefined();
-    }
-#endif
-
-    V8Proxy::setDOMException(TYPE_MISMATCH_ERR);
-    return notHandledByInterceptor();
-}
-
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::drawImageFromRectCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.drawImageFromRect()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    v8::Handle<v8::Value> arg = args[0];
-
-    if (V8HTMLImageElement::HasInstance(arg)) {
-        HTMLImageElement* imageElement = V8HTMLImageElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        context->drawImageFromRect(imageElement,  toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8]), toWebCoreString(args[9]));
-    } else
-        V8Proxy::throwError(V8Proxy::TypeError, "drawImageFromRect: Invalid type of arguments");
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::createPatternCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.createPattern()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    v8::Handle<v8::Value> arg = args[0];
-
-    if (V8HTMLImageElement::HasInstance(arg)) {
-        HTMLImageElement* imageElement = V8HTMLImageElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        ExceptionCode ec = 0;
-        RefPtr<CanvasPattern> pattern = context->createPattern(imageElement, toWebCoreStringWithNullCheck(args[1]), ec);
-        if (ec != 0) {
-            V8Proxy::setDOMException(ec);
-            return notHandledByInterceptor();
-        }
-        return toV8(pattern.release());
-    }
-
-    if (V8HTMLCanvasElement::HasInstance(arg)) {
-        HTMLCanvasElement* canvasElement = V8HTMLCanvasElement::toNative(v8::Handle<v8::Object>::Cast(arg));
-        ExceptionCode ec = 0;
-        RefPtr<CanvasPattern> pattern = context->createPattern(canvasElement, toWebCoreStringWithNullCheck(args[1]), ec);
-        if (ec != 0) {
-            V8Proxy::setDOMException(ec);
-            return notHandledByInterceptor();
-        }
-        return toV8(pattern.release());
-    }
-
-    V8Proxy::setDOMException(TYPE_MISMATCH_ERR);
-    return notHandledByInterceptor();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::fillTextCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.fillText()");
-
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    // Two forms:
-    // * fillText(text, x, y)
-    // * fillText(text, x, y, maxWidth)
-    if (args.Length() < 3 || args.Length() > 4) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
-
-    String text = toWebCoreString(args[0]);
-    float x = toFloat(args[1]);
-    float y = toFloat(args[2]);
-
-    if (args.Length() == 4) {
-        float maxWidth = toFloat(args[3]);
-        context->fillText(text, x, y, maxWidth);
-    } else
-        context->fillText(text, x, y);
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::strokeTextCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.strokeText()");
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    // Two forms:
-    // * strokeText(text, x, y)
-    // * strokeText(text, x, y, maxWidth)
-    if (args.Length() < 3 || args.Length() > 4) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
-
-    String text = toWebCoreString(args[0]);
-    float x = toFloat(args[1]);
-    float y = toFloat(args[2]);
-
-    if (args.Length() == 4) {
-        float maxWidth = toFloat(args[3]);
-        context->strokeText(text, x, y, maxWidth);
-    } else
-        context->strokeText(text, x, y);
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8CanvasRenderingContext2D::putImageDataCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.CanvasRenderingContext2D.putImageData()");
-
-    // Two froms:
-    // * putImageData(ImageData, x, y)
-    // * putImageData(ImageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight)
-    if (args.Length() != 3 && args.Length() != 7) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
-
-    CanvasRenderingContext2D* context = V8CanvasRenderingContext2D::toNative(args.Holder());
-
-    ImageData* imageData = 0;
-
-    // Need to check that the argument is of the correct type, since
-    // toNative() expects it to be correct. If the argument was incorrect
-    // we leave it null, and putImageData() will throw the correct exception
-    // (TYPE_MISMATCH_ERR).
-    if (V8DOMWrapper::isWrapperOfType(args[0], V8ClassIndex::IMAGEDATA))
-        imageData = V8ImageData::toNative(v8::Handle<v8::Object>::Cast(args[0]));
-
-    ExceptionCode ec = 0;
-
-    if (args.Length() == 7)
-        context->putImageData(imageData, toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]), ec);
-    else
-        context->putImageData(imageData, toFloat(args[1]), toFloat(args[2]), ec);
-
-    if (ec != 0) {
-        V8Proxy::setDOMException(ec);
-        return notHandledByInterceptor();
-    }
-
-    return v8::Undefined();
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
new file mode 100644
index 0000000..9026420
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
@@ -0,0 +1,58 @@
+/*
+ * 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 "V8Console.h"
+
+#include "Console.h"
+#include "ScriptProfile.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
+#include "V8ScriptProfile.h"
+
+namespace WebCore {
+
+typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
+
+v8::Handle<v8::Value> V8Console::profilesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.Console.profilesAccessorGetter");
+    Console* imp = V8Console::toNative(info.Holder());
+    const ProfilesArray& profiles = imp->profiles();
+    v8::Handle<v8::Array> result = v8::Array::New(profiles.size());
+    int index = 0;
+    ProfilesArray::const_iterator end = profiles.end();
+    for (ProfilesArray::const_iterator iter = profiles.begin(); iter != end; ++iter)
+        result->Set(v8::Integer::New(index++), toV8(iter->get()));
+    return result;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
deleted file mode 100644
index e69de29..0000000
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ /dev/null
diff --git a/WebCore/bindings/v8/custom/V8CustomIDBCallbacks.h b/WebCore/bindings/v8/custom/V8CustomIDBCallbacks.h
new file mode 100644
index 0000000..1517f15
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8CustomIDBCallbacks.h
@@ -0,0 +1,123 @@
+/*
+ * 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 V8CustomIDBCallbacks_h
+#define V8CustomIDBCallbacks_h
+
+#include "Document.h"
+#include "Frame.h"
+#include "IDBDatabaseError.h"
+#include "V8CustomVoidCallback.h"
+#include "V8IDBDatabaseError.h"
+#include "WorldContextHandle.h"
+#include <v8.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// FIXME: Maybe split common parts into a base class.
+template <typename ResultType, typename ResultWrapperType>
+class V8CustomIDBCallbacks : public IDBCallbacks<ResultType> {
+public:
+    static PassRefPtr<V8CustomIDBCallbacks> create(v8::Local<v8::Value> onSuccess, v8::Local<v8::Value> onError, ScriptExecutionContext* scriptExecutionContext)
+    {
+        return adoptRef(new V8CustomIDBCallbacks(onSuccess, onError, scriptExecutionContext));
+    }
+
+    virtual ~V8CustomIDBCallbacks()
+    {
+        m_onSuccess.Dispose();
+        m_onError.Dispose();
+    }
+
+    // FIXME: Handle suspend/resume correctly.
+
+private:
+    V8CustomIDBCallbacks(v8::Local<v8::Value> onSuccess, v8::Local<v8::Value> onError, ScriptExecutionContext* scriptExecutionContext)
+        : IDBCallbacks<ResultType>(scriptExecutionContext, this)
+        , m_onSuccess(onSuccess->IsObject() ? v8::Persistent<v8::Object>::New(onSuccess->ToObject()) : v8::Persistent<v8::Object>())
+        , m_onError(onError->IsObject() ? v8::Persistent<v8::Object>::New(onError->ToObject()) : v8::Persistent<v8::Object>())
+        , m_worldContext(UseCurrentWorld)
+    {
+    }
+
+    template <typename Type>
+    void onEvent(v8::Persistent<v8::Object> callback, PassRefPtr<Type> value)
+    {
+        if (!ActiveDOMObject::scriptExecutionContext())
+            return;
+        if (callback.IsEmpty())
+            return;
+
+        v8::HandleScope handleScope;
+        v8::Handle<v8::Context> context = toV8Context(ActiveDOMObject::scriptExecutionContext(), m_worldContext);
+        if (context.IsEmpty())
+            return;
+
+        v8::Context::Scope scope(context);
+        v8::Handle<v8::Value> argv[] = {
+            toV8(value)
+        };
+
+        // FIXME: Make this work for workers.
+        ASSERT(ActiveDOMObject::scriptExecutionContext()->isDocument());
+        RefPtr<Frame> protector(static_cast<Document*>(ActiveDOMObject::scriptExecutionContext())->frame());
+
+        bool callbackReturnValue = false;
+        // FIXME: Do we care if this thing returns true (i.e. it raised an exception)?
+        invokeCallback(callback, 1, argv, callbackReturnValue);
+    }
+
+    virtual void onSuccessAsync(PassRefPtr<ResultType> result)
+    {
+        onEvent(m_onSuccess, ResultWrapperType::create(result));
+    }
+
+    virtual void onErrorAsync(PassRefPtr<IDBDatabaseError> error)
+    {
+        onEvent(m_onError, error);
+    }
+
+    // FIXME: Use OwnHandles.
+    v8::Persistent<v8::Object> m_onSuccess;
+    v8::Persistent<v8::Object> m_onError;
+
+    WorldContextHandle m_worldContext;
+};
+
+}
+
+#endif
+
+#endif // V8CustomIDBCallbacks_h
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp
index d30b95a..df0cc53 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp
@@ -35,6 +35,7 @@
 #include "V8CustomSQLStatementCallback.h"
 
 #include "Frame.h"
+#include "ScriptExecutionContext.h"
 #include "V8CustomVoidCallback.h"
 #include "V8SQLResultSet.h"
 #include "V8SQLTransaction.h"
@@ -44,6 +45,7 @@
 V8CustomSQLStatementCallback::V8CustomSQLStatementCallback(v8::Local<v8::Object> callback, Frame* frame)
     : m_callback(v8::Persistent<v8::Object>::New(callback))
     , m_frame(frame)
+    , m_worldContext(UseCurrentWorld)
 {
 }
 
@@ -52,15 +54,15 @@
     m_callback.Dispose();
 }
 
-void V8CustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
+void V8CustomSQLStatementCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
 {
     v8::HandleScope handleScope;
 
-    v8::Handle<v8::Context> context = V8Proxy::context(m_frame.get());
-    if (context.IsEmpty())
+    v8::Handle<v8::Context> v8Context = toV8Context(context, m_worldContext);
+    if (v8Context.IsEmpty())
         return;
 
-    v8::Context::Scope scope(context);
+    v8::Context::Scope scope(v8Context);
 
     v8::Handle<v8::Value> argv[] = {
         toV8(transaction),
@@ -77,4 +79,3 @@
 } // namespace WebCore
 
 #endif
-
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h
index 58ee943..31f53e4 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h
+++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h
@@ -34,9 +34,9 @@
 #if ENABLE(DATABASE)
 
 #include "SQLStatementCallback.h"
+#include "WorldContextHandle.h"
 #include <v8.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -51,12 +51,13 @@
     }
     virtual ~V8CustomSQLStatementCallback();
 
-    virtual void handleEvent(SQLTransaction*, SQLResultSet*, bool& raisedException);
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLResultSet*, bool& raisedException);
 private:
     V8CustomSQLStatementCallback(v8::Local<v8::Object>, Frame*);
 
     v8::Persistent<v8::Object> m_callback;
     RefPtr<Frame> m_frame;
+    WorldContextHandle m_worldContext;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
index f733ede..2545f24 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp
@@ -35,6 +35,7 @@
 #include "V8CustomSQLStatementErrorCallback.h"
 
 #include "Frame.h"
+#include "ScriptExecutionContext.h"
 #include "V8CustomVoidCallback.h"
 #include "V8SQLError.h"
 #include "V8SQLTransaction.h"
@@ -44,6 +45,7 @@
 V8CustomSQLStatementErrorCallback::V8CustomSQLStatementErrorCallback(v8::Local<v8::Object> callback, Frame* frame)
     : m_callback(v8::Persistent<v8::Object>::New(callback))
     , m_frame(frame)
+    , m_worldContext(UseCurrentWorld)
 {
 }
 
@@ -52,15 +54,15 @@
     m_callback.Dispose();
 }
 
-bool V8CustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLError* error)
+bool V8CustomSQLStatementErrorCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLError* error)
 {
     v8::HandleScope handleScope;
 
-    v8::Handle<v8::Context> context = V8Proxy::context(m_frame.get());
-    if (context.IsEmpty())
+    v8::Handle<v8::Context> v8Context = toV8Context(context, m_worldContext);
+    if (v8Context.IsEmpty())
         return true;
 
-    v8::Context::Scope scope(context);
+    v8::Context::Scope scope(v8Context);
 
     v8::Handle<v8::Value> argv[] = {
         toV8(transaction),
@@ -75,7 +77,7 @@
     // statement, if any, or onto the next overall step otherwise. Otherwise,
     // the error callback did not return false, or there was no error callback.
     // Jump to the last step in the overall steps.
-    return invokeCallbackTreatOnlyExplicitFalseAsFalse(m_callback, 2, argv, callbackReturnValue) || callbackReturnValue;
+    return invokeCallback(m_callback, 2, argv, callbackReturnValue) || callbackReturnValue;
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h
index 685efc6..c3d7f79 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h
+++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h
@@ -34,8 +34,7 @@
 #if ENABLE(DATABASE)
 
 #include "SQLStatementErrorCallback.h"
-
-#include "SQLStatementErrorCallback.h"
+#include "WorldContextHandle.h"
 #include <v8.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
@@ -53,12 +52,13 @@
     }
     virtual ~V8CustomSQLStatementErrorCallback();
 
-    virtual bool handleEvent(SQLTransaction*, SQLError*);
+    virtual bool handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLError*);
 private:
     V8CustomSQLStatementErrorCallback(v8::Local<v8::Object>, Frame*);
 
     v8::Persistent<v8::Object> m_callback;
     RefPtr<Frame> m_frame;
+    WorldContextHandle m_worldContext;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp
index 68002d7..efe415c 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp
@@ -35,6 +35,7 @@
 #include "V8CustomSQLTransactionCallback.h"
 
 #include "Frame.h"
+#include "ScriptExecutionContext.h"
 #include "V8CustomVoidCallback.h"
 #include "V8SQLTransaction.h"
 
@@ -43,6 +44,7 @@
 V8CustomSQLTransactionCallback::V8CustomSQLTransactionCallback(v8::Local<v8::Object> callback, Frame* frame)
     : m_callback(v8::Persistent<v8::Object>::New(callback))
     , m_frame(frame)
+    , m_worldContext(UseCurrentWorld)
 {
 }
 
@@ -52,15 +54,15 @@
 }
 
 
-void V8CustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bool& raisedException)
+void V8CustomSQLTransactionCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, bool& raisedException)
 {
     v8::HandleScope handleScope;
 
-    v8::Handle<v8::Context> context = V8Proxy::context(m_frame.get());
-    if (context.IsEmpty())
+    v8::Handle<v8::Context> v8Context = toV8Context(context, m_worldContext);
+    if (v8Context.IsEmpty())
         return;
 
-    v8::Context::Scope scope(context);
+    v8::Context::Scope scope(v8Context);
 
     v8::Handle<v8::Value> argv[] = {
         toV8(transaction)
@@ -79,4 +81,3 @@
 } // namespace WebCore
 
 #endif
-
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h
index 665404d..60ad529 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h
+++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h
@@ -34,9 +34,9 @@
 #if ENABLE(DATABASE)
 
 #include "SQLTransactionCallback.h"
+#include "WorldContextHandle.h"
 #include <v8.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -51,12 +51,13 @@
     }
     virtual ~V8CustomSQLTransactionCallback();
 
-    virtual void handleEvent(SQLTransaction*, bool& raisedException);
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, bool& raisedException);
 private:
     V8CustomSQLTransactionCallback(v8::Local<v8::Object>, Frame*);
 
     v8::Persistent<v8::Object> m_callback;
     RefPtr<Frame> m_frame;
+    WorldContextHandle m_worldContext;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp
index cf5a0ef..1ef711a 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp
@@ -35,6 +35,7 @@
 #include "V8CustomSQLTransactionErrorCallback.h"
 
 #include "Frame.h"
+#include "ScriptExecutionContext.h"
 #include "V8CustomVoidCallback.h"
 #include "V8SQLError.h"
 
@@ -43,6 +44,7 @@
 V8CustomSQLTransactionErrorCallback::V8CustomSQLTransactionErrorCallback(v8::Local<v8::Object> callback, Frame* frame)
     : m_callback(v8::Persistent<v8::Object>::New(callback))
     , m_frame(frame)
+    , m_worldContext(UseCurrentWorld)
 {
 }
 
@@ -51,15 +53,15 @@
     m_callback.Dispose();
 }
 
-void V8CustomSQLTransactionErrorCallback::handleEvent(SQLError* error)
+void V8CustomSQLTransactionErrorCallback::handleEvent(ScriptExecutionContext* context, SQLError* error)
 {
     v8::HandleScope handleScope;
 
-    v8::Handle<v8::Context> context = V8Proxy::context(m_frame.get());
-    if (context.IsEmpty())
+    v8::Handle<v8::Context> v8Context = toV8Context(context, m_worldContext);
+    if (v8Context.IsEmpty())
         return;
 
-    v8::Context::Scope scope(context);
+    v8::Context::Scope scope(v8Context);
 
     v8::Handle<v8::Value> argv[] = {
         toV8(error)
@@ -75,4 +77,3 @@
 } // namespace WebCore
 
 #endif
-
diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h
index 0387deb..72e9e7a 100644
--- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h
+++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h
@@ -34,9 +34,9 @@
 #if ENABLE(DATABASE)
 
 #include "SQLTransactionErrorCallback.h"
+#include "WorldContextHandle.h"
 #include <v8.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -51,13 +51,14 @@
     }
     virtual ~V8CustomSQLTransactionErrorCallback();
 
-    virtual void handleEvent(SQLError*);
+    virtual void handleEvent(ScriptExecutionContext*, SQLError*);
 
 private:
     V8CustomSQLTransactionErrorCallback(v8::Local<v8::Object>, Frame*);
 
     v8::Persistent<v8::Object> m_callback;
     RefPtr<Frame> m_frame;
+    WorldContextHandle m_worldContext;
 };
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
index 8c69e76..f4ea62a 100644
--- a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
@@ -29,10 +29,10 @@
  */
 
 #include "config.h"
-#include "V8Binding.h"
 #include "V8CustomVoidCallback.h"
 
 #include "Frame.h"
+#include "V8Binding.h"
 
 namespace WebCore {
 
@@ -64,7 +64,7 @@
     invokeCallback(m_callback, 0, 0, callbackReturnValue);
 }
 
-static bool invokeCallbackHelper(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], v8::Handle<v8::Value>& returnValue)
+bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
 {
     v8::TryCatch exceptionCatcher;
 
@@ -73,9 +73,8 @@
         callbackFunction = v8::Local<v8::Function>::New(v8::Persistent<v8::Function>::Cast(callback));
     } else if (callback->IsObject()) {
         v8::Local<v8::Value> handleEventFunction = callback->Get(v8::String::NewSymbol("handleEvent"));
-        if (handleEventFunction->IsFunction()) {
+        if (handleEventFunction->IsFunction())
             callbackFunction = v8::Local<v8::Function>::Cast(handleEventFunction);
-        }
     } else
         return false;
 
@@ -87,7 +86,8 @@
     V8Proxy* proxy = V8Proxy::retrieve();
     ASSERT(proxy);
 
-    returnValue = proxy->callFunction(callbackFunction, thisObject, argc, argv);
+    v8::Handle<v8::Value> result = proxy->callFunction(callbackFunction, thisObject, argc, argv);
+    callbackReturnValue = !result.IsEmpty() && result->BooleanValue();
 
     if (exceptionCatcher.HasCaught()) {
         v8::Local<v8::Message> message = exceptionCatcher.Message();
@@ -98,20 +98,4 @@
     return false;
 }
 
-bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
-{
-    v8::Handle<v8::Value> returnValue;
-    bool result = invokeCallbackHelper(callback, argc, argv, returnValue);
-    callbackReturnValue = !returnValue.IsEmpty() && returnValue->IsBoolean() && returnValue->BooleanValue();
-    return result;
-}
-
-bool invokeCallbackTreatOnlyExplicitFalseAsFalse(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
-{
-    v8::Handle<v8::Value> returnValue;
-    bool result = invokeCallbackHelper(callback, argc, argv, returnValue);
-    callbackReturnValue = !returnValue.IsEmpty() && !returnValue->IsFalse();
-    return result;
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8CustomVoidCallback.h b/WebCore/bindings/v8/custom/V8CustomVoidCallback.h
index 6b7b3e8..586296b 100644
--- a/WebCore/bindings/v8/custom/V8CustomVoidCallback.h
+++ b/WebCore/bindings/v8/custom/V8CustomVoidCallback.h
@@ -60,7 +60,6 @@
 
 // Returns false if callback failed (null, wrong type, or threw exception).
 bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue);
-bool invokeCallbackTreatOnlyExplicitFalseAsFalse(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue);
 
 } // namespace WebCore
 
diff --git a/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp b/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
index e45cba0..01448d9 100644
--- a/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp
@@ -38,14 +38,13 @@
 
 namespace WebCore {
 
-PassRefPtr<V8CustomXPathNSResolver> V8CustomXPathNSResolver::create(V8Proxy* proxy, v8::Handle<v8::Object> resolver)
+PassRefPtr<V8CustomXPathNSResolver> V8CustomXPathNSResolver::create(v8::Handle<v8::Object> resolver)
 {
-    return adoptRef(new V8CustomXPathNSResolver(proxy, resolver));
+    return adoptRef(new V8CustomXPathNSResolver(resolver));
 }
 
-V8CustomXPathNSResolver::V8CustomXPathNSResolver(V8Proxy* proxy, v8::Handle<v8::Object> resolver)
-        : m_proxy(proxy)
-        , m_resolver(resolver)
+V8CustomXPathNSResolver::V8CustomXPathNSResolver(v8::Handle<v8::Object> resolver)
+    : m_resolver(resolver)
 {
 }
 
@@ -55,14 +54,6 @@
 
 String V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
 {
-    V8Proxy* proxy = m_proxy;
-
-    if (!proxy) {
-        proxy = V8Proxy::retrieve();
-        if (!proxy)
-            return String();
-    }
-
     v8::Handle<v8::Function> lookupNamespaceURIFunc;
     v8::Handle<v8::String> lookupNamespaceURIName = v8::String::New("lookupNamespaceURI");
 
@@ -74,8 +65,10 @@
     }
 
     if (lookupNamespaceURIFunc.IsEmpty() && !m_resolver->IsFunction()) {
-        Frame* frame = proxy->frame();
-        logInfo(frame, "XPathNSResolver does not have a lookupNamespaceURI method.", String());
+        if (V8Proxy* proxy = V8Proxy::retrieve()) {
+            if (Frame* frame = proxy->frame())
+                logInfo(frame, "XPathNSResolver does not have a lookupNamespaceURI method.", String());
+        }
         return String();
     }
 
@@ -87,7 +80,7 @@
     v8::Handle<v8::Value> argv[argc] = { v8String(prefix) };
     v8::Handle<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Handle<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc;
 
-    v8::Handle<v8::Value> retval = proxy->callFunction(function, m_resolver, argc, argv);
+    v8::Handle<v8::Value> retval = V8Proxy::callFunctionWithoutFrame(function, m_resolver, argc, argv);
 
     // Eat exceptions from namespace resolver and return an empty string. This will most likely cause NAMESPACE_ERR.
     if (try_catch.HasCaught())
diff --git a/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.h b/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.h
index 15ac27d..cf84438 100644
--- a/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.h
+++ b/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.h
@@ -49,15 +49,14 @@
 // must not exceed the lifetime of the passed handle.
 class V8CustomXPathNSResolver : public XPathNSResolver {
 public:
-    static PassRefPtr<V8CustomXPathNSResolver> create(V8Proxy* proxy, v8::Handle<v8::Object> resolver);
+    static PassRefPtr<V8CustomXPathNSResolver> create(v8::Handle<v8::Object> resolver);
 
     virtual ~V8CustomXPathNSResolver();
     virtual String lookupNamespaceURI(const String& prefix);
 
 private:
-    V8CustomXPathNSResolver(V8Proxy* proxy, v8::Handle<v8::Object> resolver);
+    explicit V8CustomXPathNSResolver(v8::Handle<v8::Object> resolver);
 
-    V8Proxy* m_proxy;
     v8::Handle<v8::Object> m_resolver;  // Handle to resolver object.
 };
 
diff --git a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
deleted file mode 100644
index 61760b3..0000000
--- a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 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 "V8DOMApplicationCache.h"
-
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-
-#include "ApplicationCacheHost.h"
-#include "DOMApplicationCache.h"
-#include "V8Binding.h"
-#include "V8Document.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "WorkerContextExecutionProxy.h"
-
-namespace WebCore {
-
-// Handles appcache.addEventListner(name, func, capture) method calls
-v8::Handle<v8::Value> V8DOMApplicationCache::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOMApplicationCache.addEventListener()");
-    DOMApplicationCache* appcache = V8DOMApplicationCache::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-        String eventType = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        appcache->addEventListener(eventType, listener, useCapture);
-    }
-    return v8::Undefined();
-}
-
-// Handles appcache.removeEventListner(name, func, capture) method calls
-v8::Handle<v8::Value> V8DOMApplicationCache::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOMApplicationCache.removeEventListener()");
-    DOMApplicationCache* appcache = V8DOMApplicationCache::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(appcache, args[1], false, ListenerFindOnly);
-    if (listener) {
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-        String eventType = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        appcache->removeEventListener(eventType, listener.get(), useCapture);
-    }
-    return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif  // ENABLE(OFFLINE_WEB_APPLICATIONS)
diff --git a/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
new file mode 100644
index 0000000..8a39332
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
@@ -0,0 +1,65 @@
+/*
+ * 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 "V8DOMFormData.h"
+
+#include "DOMFormData.h"
+#include "V8Binding.h"
+#include "V8Blob.h"
+#include "V8Proxy.h"
+#include "V8Utilities.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.FormData.append()");
+    
+    if (args.Length() < 2)
+        return throwError("Not enough arguments", V8Proxy::SyntaxError);
+
+    DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder());
+
+    String name = toWebCoreStringWithNullCheck(args[0]);
+
+    v8::Handle<v8::Value> arg = args[1];
+    if (V8Blob::HasInstance(arg)) {
+        v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+        Blob* blob = V8Blob::toNative(object);
+        ASSERT(blob);
+        domFormData->append(name, blob);
+    } else
+        domFormData->append(name, toWebCoreStringWithNullCheck(arg));
+
+    return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DOMSelectionCustom.cpp b/WebCore/bindings/v8/custom/V8DOMSelectionCustom.cpp
deleted file mode 100644
index 0c9e745..0000000
--- a/WebCore/bindings/v8/custom/V8DOMSelectionCustom.cpp
+++ /dev/null
@@ -1,51 +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 "V8DOMSelection.h"
-
-#include "V8DOMWindow.h"
-#include "V8DOMWrapper.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> toV8(DOMSelection* impl)
-{
-    if (!impl)
-        return v8::Null();
-    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
-    if (wrapper.IsEmpty()) {
-        wrapper = V8DOMSelection::wrap(impl);
-        V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::domSelectionIndex, wrapper);
-    }
-    return wrapper;
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 9719837..6a53a1f 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "V8DOMWindow.h"
 
-#include "Base64.h"
 #include "Chrome.h"
 #include "Database.h"
 #include "DOMTimer.h"
@@ -55,7 +54,13 @@
 #include "V8BindingDOMWindow.h"
 #include "V8BindingState.h"
 #include "V8CustomEventListener.h"
+#include "V8Database.h"
+#include "V8DatabaseCallback.h"
+#include "V8GCForContextDispose.h"
+#include "V8HTMLAudioElementConstructor.h"
 #include "V8HTMLCollection.h"
+#include "V8HTMLImageElementConstructor.h"
+#include "V8HTMLOptionElementConstructor.h"
 #include "V8MessagePortCustom.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
@@ -135,40 +140,16 @@
         id = DOMTimer::install(scriptContext, new ScheduledAction(V8Proxy::context(imp->frame()), functionString), timeout, singleShot);
     }
 
+    // Try to do the idle notification before the timeout expires to get better
+    // use of any idle time. Aim for the middle of the interval for simplicity.
+    if (timeout > 0) {
+        double maximumFireInterval = static_cast<double>(timeout) / 1000 / 2;
+        V8GCForContextDispose::instance().notifyIdleSooner(maximumFireInterval);
+    }
+
     return v8::Integer::New(id);
 }
 
-static bool isAscii(const String& str)
-{
-    for (size_t i = 0; i < str.length(); i++) {
-        if (str[i] > 0xFF)
-            return false;
-    }
-    return true;
-}
-
-static v8::Handle<v8::Value> convertBase64(const String& str, bool encode)
-{
-    if (!isAscii(str)) {
-        V8Proxy::setDOMException(INVALID_CHARACTER_ERR);
-        return notHandledByInterceptor();
-    }
-
-    Vector<char> inputCharacters(str.length());
-    for (size_t i = 0; i < str.length(); i++)
-        inputCharacters[i] = static_cast<char>(str[i]);
-    Vector<char> outputCharacters;
-
-    if (encode)
-        base64Encode(inputCharacters, outputCharacters);
-    else {
-        if (!base64Decode(inputCharacters, outputCharacters))
-            return throwError("Cannot decode base64", V8Proxy::GeneralError);
-    }
-
-    return v8String(String(outputCharacters.data(), outputCharacters.size()));
-}
-
 v8::Handle<v8::Value> V8DOMWindow::eventAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), info.This());
@@ -250,7 +231,7 @@
 v8::Handle<v8::Value> V8DOMWindow::AudioAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     DOMWindow* window = V8DOMWindow::toNative(info.Holder());
-    return V8DOMWrapper::getConstructor(V8ClassIndex::AUDIO, window);
+    return V8DOMWrapper::getConstructor(&V8HTMLAudioElementConstructor::info, window);
 }
 
 #endif
@@ -258,13 +239,13 @@
 v8::Handle<v8::Value> V8DOMWindow::ImageAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     DOMWindow* window = V8DOMWindow::toNative(info.Holder());
-    return V8DOMWrapper::getConstructor(V8ClassIndex::IMAGE, window);
+    return V8DOMWrapper::getConstructor(&V8HTMLImageElementConstructor::info, window);
 }
 
 v8::Handle<v8::Value> V8DOMWindow::OptionAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     DOMWindow* window = V8DOMWindow::toNative(info.Holder());
-    return V8DOMWrapper::getConstructor(V8ClassIndex::OPTION, window);
+    return V8DOMWrapper::getConstructor(&V8HTMLOptionElementConstructor::info, window);
 }
 
 v8::Handle<v8::Value> V8DOMWindow::addEventListenerCallback(const v8::Arguments& args)
@@ -289,11 +270,11 @@
     if (!proxy)
         return v8::Undefined();
 
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(proxy, args[1], false, ListenerFindOrCreate);
+    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
 
     if (listener) {
         imp->addEventListener(eventType, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
+        createHiddenDependency(args.Holder(), args[1], eventListenerCacheIndex);
     }
 
     return v8::Undefined();
@@ -321,11 +302,11 @@
     if (!proxy)
         return v8::Undefined();
 
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(proxy, args[1], false, ListenerFindOnly);
+    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
 
     if (listener) {
         imp->removeEventListener(eventType, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
+        removeHiddenDependency(args.Holder(), args[1], eventListenerCacheIndex);
     }
 
     return v8::Undefined();
@@ -339,8 +320,11 @@
     DOMWindow* source = V8Proxy::retrieveFrameForCallingContext()->domWindow();
     ASSERT(source->frame());
 
-    v8::TryCatch tryCatch;
-    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
+
     MessagePortArray portArray;
     String targetOrigin;
 
@@ -348,6 +332,7 @@
     //   postMessage(message, port, targetOrigin);
     // or
     //   postMessage(message, targetOrigin);
+    v8::TryCatch tryCatch;
     if (args.Length() > 2) {
         if (!getMessagePortArray(args[1], portArray))
             return v8::Undefined();
@@ -364,44 +349,6 @@
     return throwError(ec);
 }
 
-v8::Handle<v8::Value> V8DOMWindow::atobCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DOMWindow.atob()");
-
-    if (args[0]->IsNull())
-        return v8String("");
-    String str = toWebCoreString(args[0]);
-
-    DOMWindow* imp = V8DOMWindow::toNative(args.Holder());
-
-    if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
-        return v8::Undefined();
-
-    if (args.Length() < 1)
-        return throwError("Not enough arguments", V8Proxy::SyntaxError);
-
-    return convertBase64(str, false);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::btoaCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DOMWindow.btoa()");
-
-    if (args[0]->IsNull())
-        return v8String("");
-    String str = toWebCoreString(args[0]);
-
-    DOMWindow* imp = V8DOMWindow::toNative(args.Holder());
-
-    if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
-        return v8::Undefined();
-
-    if (args.Length() < 1)
-        return throwError("Not enough arguments", V8Proxy::SyntaxError);
-
-    return convertBase64(str, true);
-}
-
 // FIXME(fqian): returning string is cheating, and we should
 // fix this by calling toString function on the receiver.
 // However, V8 implements toString in JavaScript, which requires
@@ -768,39 +715,33 @@
     return WindowSetTimeoutImpl(args, false);
 }
 
-
-void ClearTimeoutImpl(const v8::Arguments& args)
+v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args)
 {
-    int handle = toInt32(args[0]);
+    INC_STATS("DOM.DOMWindow.openDatabase");
+    if (args.Length() < 4)
+        return v8::Undefined();
 
-    v8::Handle<v8::Object> holder = args.Holder();
-    DOMWindow* imp = V8DOMWindow::toNative(holder);
+    DOMWindow* imp = V8DOMWindow::toNative(args.Holder());
     if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
-        return;
-    ScriptExecutionContext* context = static_cast<ScriptExecutionContext*>(imp->document());
-    if (!context)
-        return;
-    DOMTimer::removeById(context, handle);
+        return v8::Undefined();
+
+    ExceptionCode ec = 0;
+    String name = toWebCoreString(args[0]);
+    String version = toWebCoreString(args[1]);
+    String displayName = toWebCoreString(args[2]);
+    unsigned long estimatedSize = args[3]->IntegerValue();
+    RefPtr<DatabaseCallback> creationCallback;
+    if ((args.Length() >= 5) && args[4]->IsObject())
+        creationCallback = V8DatabaseCallback::create(args[4], imp->frame());
+
+    v8::Handle<v8::Value> result = toV8(imp->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec));
+
+    V8Proxy::setDOMException(ec);
+    return result;
 }
 
-
-v8::Handle<v8::Value> V8DOMWindow::clearTimeoutCallback(const v8::Arguments& args)
+bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
 {
-    INC_STATS("DOM.DOMWindow.clearTimeout");
-    ClearTimeoutImpl(args);
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8DOMWindow::clearIntervalCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DOMWindow.clearInterval");
-    ClearTimeoutImpl(args);
-    return v8::Undefined();
-}
-
-bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value> data)
-{
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::DOMWINDOW);
     v8::Handle<v8::Object> window = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), host);
     if (window.IsEmpty())
         return false;  // the frame is gone.
@@ -824,9 +765,8 @@
     return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, false);
 }
 
-bool V8DOMWindow::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value> data)
+bool V8DOMWindow::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
 {
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::DOMWINDOW);
     v8::Handle<v8::Object> window = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), host);
     if (window.IsEmpty())
         return false;
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCallback.cpp b/WebCore/bindings/v8/custom/V8DatabaseCallback.cpp
new file mode 100644
index 0000000..088d89f
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DatabaseCallback.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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(DATABASE)
+
+#include "V8DatabaseCallback.h"
+
+#include "Frame.h"
+#include "ScriptExecutionContext.h"
+#include "V8CustomVoidCallback.h"
+#include "V8Database.h"
+
+namespace WebCore {
+
+V8DatabaseCallback::V8DatabaseCallback(v8::Local<v8::Object> callback, Frame* frame)
+    : m_callback(v8::Persistent<v8::Object>::New(callback))
+    , m_frame(frame)
+    , m_worldContext(UseCurrentWorld)
+{
+}
+
+V8DatabaseCallback::~V8DatabaseCallback()
+{
+    m_callback.Dispose();
+}
+
+void V8DatabaseCallback::handleEvent(ScriptExecutionContext* context, Database* database)
+{
+    v8::HandleScope handleScope;
+
+    v8::Handle<v8::Context> v8Context = toV8Context(context, m_worldContext);
+    if (v8Context.IsEmpty())
+        return;
+
+    v8::Context::Scope scope(v8Context);
+
+    v8::Handle<v8::Value> argv[] = {
+        toV8(database)
+    };
+
+    // Protect the frame until the callback returns.
+    RefPtr<Frame> protector(m_frame);
+
+    bool callbackReturnValue = false;
+    invokeCallback(m_callback, 1, argv, callbackReturnValue);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCallback.h b/WebCore/bindings/v8/custom/V8DatabaseCallback.h
new file mode 100644
index 0000000..064a9a7
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DatabaseCallback.h
@@ -0,0 +1,68 @@
+/*
+ * 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 V8DatabaseCallback_h
+#define V8DatabaseCallback_h
+
+#if ENABLE(DATABASE)
+
+#include "DatabaseCallback.h"
+#include "WorldContextHandle.h"
+#include <v8.h>
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+class Frame;
+
+class V8DatabaseCallback : public DatabaseCallback {
+public:
+    static PassRefPtr<V8DatabaseCallback> create(v8::Local<v8::Value> value, Frame* frame)
+    {
+        ASSERT(value->IsObject());
+        return adoptRef(new V8DatabaseCallback(value->ToObject(), frame));
+    }
+    virtual ~V8DatabaseCallback();
+
+    virtual void handleEvent(ScriptExecutionContext*, Database*);
+
+private:
+    V8DatabaseCallback(v8::Local<v8::Object>, Frame*);
+
+    v8::Persistent<v8::Object> m_callback;
+    RefPtr<Frame> m_frame;
+    WorldContextHandle m_worldContext;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // V8DatabaseCallback_h
diff --git a/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
index 4486dbe..8fcf9a8 100644
--- a/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
@@ -46,7 +46,10 @@
 {
     INC_STATS(L"DOM.DedicatedWorkerContext.postMessage");
     DedicatedWorkerContext* workerContext = V8DedicatedWorkerContext::toNative(args.Holder());
-    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
     MessagePortArray portArray;
     if (args.Length() > 1) {
         if (!getMessagePortArray(args[1], portArray))
diff --git a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
index 8968707..9fa9f80 100644
--- a/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
@@ -46,11 +46,16 @@
 #include "V8IsolatedContext.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
-#include "V8SVGDocument.h"
+#if ENABLE(3D_CANVAS)
 #include "V8WebGLRenderingContext.h"
+#endif
 #include "V8XPathNSResolver.h"
 #include "V8XPathResult.h"
 
+#if ENABLE(SVG)
+#include "V8SVGDocument.h"
+#endif
+
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -67,7 +72,7 @@
     if (V8Node::HasInstance(args[1]))
         contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1]));
 
-    RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2], V8Proxy::retrieve(V8Proxy::retrieveFrameForCallingContext()));
+    RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]);
     if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined())
         return throwError(TYPE_MISMATCH_ERR);
 
diff --git a/WebCore/bindings/v8/custom/V8ElementCustom.cpp b/WebCore/bindings/v8/custom/V8ElementCustom.cpp
index 86f134e..8256110 100644
--- a/WebCore/bindings/v8/custom/V8ElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ElementCustom.cpp
@@ -45,7 +45,10 @@
 #include "V8BindingState.h"
 #include "V8HTMLElement.h"
 #include "V8Proxy.h"
+
+#if ENABLE(SVG)
 #include "V8SVGElement.h"
+#endif
 
 #include <wtf/RefPtr.h>
 
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index 79bddc0..b2728ec 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -33,11 +33,13 @@
 
 #include "Clipboard.h"
 #include "ClipboardEvent.h"
+#include "CustomEvent.h"
 #include "Event.h"
 #include "V8BeforeLoadEvent.h"
 #include "V8Binding.h"
 #include "V8Clipboard.h"
 #include "V8CompositionEvent.h"
+#include "V8CustomEvent.h"
 #include "V8ErrorEvent.h"
 #include "V8KeyboardEvent.h"
 #include "V8MessageEvent.h"
@@ -48,7 +50,6 @@
 #include "V8PopStateEvent.h"
 #include "V8ProgressEvent.h"
 #include "V8Proxy.h"
-#include "V8SVGZoomEvent.h"
 #include "V8StorageEvent.h"
 #include "V8TextEvent.h"
 #include "V8TouchEvent.h"
@@ -58,6 +59,10 @@
 #include "V8WheelEvent.h"
 #include "V8XMLHttpRequestProgressEvent.h"
 
+#if ENABLE(SVG)
+#include "V8SVGZoomEvent.h"
+#endif
+
 namespace WebCore {
 
 void V8Event::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -140,6 +145,8 @@
 #endif
     if (impl->isBeforeLoadEvent())
         return toV8(static_cast<BeforeLoadEvent*>(impl));
+    if (impl->isCustomEvent())
+        return toV8(static_cast<CustomEvent*>(impl));
     return V8Event::wrap(impl);
 }
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp b/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp
index 793ffb6..01e9c44 100644
--- a/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp
@@ -56,17 +56,17 @@
     if (!context)
         return throwError("EventSource constructor's associated context is not available", V8Proxy::ReferenceError);
     if (args.Length() != 1)
-        return throwError("EventSource constructor wrong number of parameters", V8Proxy::TypeError);
+        return throwError("Not enough arguments", V8Proxy::SyntaxError);
 
     ExceptionCode ec = 0;
     String url = toWebCoreString(args[0]);
 
     RefPtr<EventSource> eventSource = EventSource::create(url, context, ec);
-    
+
     if (ec)
         return throwError(ec);
 
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::EVENTSOURCE), eventSource.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, eventSource.get());
 
     // Add object to the wrapper map.
     eventSource->ref();
diff --git a/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp b/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp
deleted file mode 100644
index a7f79db..0000000
--- a/WebCore/bindings/v8/custom/V8EventSourceCustom.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * 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"
-
-#if ENABLE(EVENTSOURCE)
-#include "V8EventSource.h"
-
-#include "EventSource.h"
-
-#include "V8Binding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8EventSource::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.EventSource.addEventListener()");
-    EventSource* eventSource = V8EventSource::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(eventSource, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        eventSource->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8EventSource::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.EventSource.removeEventListener()");
-    EventSource* eventSource = V8EventSource::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(eventSource, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        eventSource->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(EVENTSOURCE)
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
index 9b75db8..df16501 100644
--- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
@@ -44,6 +44,8 @@
 
 namespace WebCore {
 
+WrapperTypeInfo V8HTMLAudioElementConstructor::info = { V8HTMLAudioElementConstructor::GetTemplate, 0, false };
+
 static v8::Handle<v8::Value> v8HTMLAudioElementConstructorCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.HTMLAudioElement.Contructor");
@@ -69,7 +71,7 @@
         src = toWebCoreString(args[0]);
     RefPtr<HTMLAudioElement> audio = HTMLAudioElement::createForJSConstructor(document, src);
 
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::AUDIO), audio.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &V8HTMLAudioElementConstructor::info, audio.get());
     audio->ref();
     V8DOMWrapper::setJSWrapperForDOMNode(audio.get(), v8::Persistent<v8::Object>::New(args.Holder()));
     return args.Holder();
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
index 711f539..8bc5f2c 100755
--- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
@@ -31,6 +31,8 @@
 #ifndef V8HTMLAudioElementConstructor_h
 #define V8HTMLAudioElementConstructor_h
 
+#include "WrapperTypeInfo.h"
+
 #include <v8.h>
 
 namespace WebCore {
@@ -38,6 +40,7 @@
 class V8HTMLAudioElementConstructor {
 public:
     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+    static WrapperTypeInfo info;
 };
 
 }
diff --git a/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
index 54a003c..67ba38b 100644
--- a/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
@@ -39,7 +39,9 @@
 #include "V8CanvasRenderingContext2D.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
+#if ENABLE(3D_CANVAS)
 #include "V8WebGLRenderingContext.h"
+#endif
 
 namespace WebCore {
 
@@ -54,7 +56,7 @@
     if (contextId == "experimental-webgl" || contextId == "webkit-3d") {
         attrs = WebGLContextAttributes::create();
         WebGLContextAttributes* webGLAttrs = static_cast<WebGLContextAttributes*>(attrs.get());
-        if (args.Length() > 1 && args[0]->IsObject()) {
+        if (args.Length() > 1 && args[1]->IsObject()) {
             v8::Handle<v8::Object> jsAttrs = args[1]->ToObject();
             v8::Handle<v8::String> alpha = v8::String::New("alpha");
             if (jsAttrs->Has(alpha))
diff --git a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
index 29b4813..4751224 100644
--- a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
@@ -44,6 +44,8 @@
 
 namespace WebCore {
 
+WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, false };
+
 static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.HTMLImageElement.Contructor");
@@ -80,7 +82,7 @@
     }
 
     RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(document, optionalWidth, optionalHeight);
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::IMAGE), image.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &V8HTMLImageElementConstructor::info, image.get());
     image->ref();
     V8DOMWrapper::setJSWrapperForDOMNode(image.get(), v8::Persistent<v8::Object>::New(args.Holder()));
     return args.Holder();
diff --git a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
index 19ee944..5db4946 100755
--- a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
@@ -31,6 +31,8 @@
 #ifndef V8HTMLImageElementConstructor_h
 #define V8HTMLImageElementConstructor_h
 
+#include "WrapperTypeInfo.h"
+
 #include <v8.h>
 
 namespace WebCore {
@@ -38,6 +40,7 @@
 class V8HTMLImageElementConstructor {
 public:
     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+    static WrapperTypeInfo info;
 };
 
 }
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
index 1ff1d2e..6b84856 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
@@ -44,6 +44,8 @@
 
 namespace WebCore {
 
+WrapperTypeInfo V8HTMLOptionElementConstructor::info = { V8HTMLOptionElementConstructor::GetTemplate, 0, false };
+
 static v8::Handle<v8::Value> v8HTMLOptionElementConstructorCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.HTMLOptionElement.Contructor");
@@ -78,7 +80,7 @@
     if (ec)
         throwError(ec);
 
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::OPTION), option.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &V8HTMLOptionElementConstructor::info, option.get());
     option->ref();
     V8DOMWrapper::setJSWrapperForDOMNode(option.get(), v8::Persistent<v8::Object>::New(args.Holder()));
     return args.Holder();
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
index 905a745..2adf0fe 100755
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
@@ -31,6 +31,8 @@
 #ifndef V8HTMLOptionElementConstructor_h
 #define V8HTMLOptionElementConstructor_h
 
+#include "WrapperTypeInfo.h"
+
 #include <v8.h>
 
 namespace WebCore {
@@ -38,6 +40,7 @@
 class V8HTMLOptionElementConstructor {
 public:
     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+    static WrapperTypeInfo info;
 };
 
 }
diff --git a/WebCore/bindings/v8/custom/V8HistoryCustom.cpp b/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
index 6075ec5..ad2b9a9 100644
--- a/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
@@ -43,7 +43,10 @@
 
 v8::Handle<v8::Value> V8History::pushStateCallback(const v8::Arguments& args)
 {
-    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
 
     v8::TryCatch tryCatch;
     String title = toWebCoreStringWithNullOrUndefinedCheck(args[1]);
@@ -64,7 +67,10 @@
 
 v8::Handle<v8::Value> V8History::replaceStateCallback(const v8::Arguments& args)
 {
-    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
 
     v8::TryCatch tryCatch;
     String title = toWebCoreStringWithNullOrUndefinedCheck(args[1]);
@@ -83,33 +89,18 @@
     return throwError(ec);
 }
 
-bool V8History::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value> data)
+bool V8History::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
 {
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY);
     // Only allow same origin access.
     History* history = V8History::toNative(host);
     return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), history->frame(), false);
 }
 
-bool V8History::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value> data)
+bool V8History::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
 {
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY);
     // Only allow same origin access.
     History* history = V8History::toNative(host);
     return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), history->frame(), false);
 }
 
-v8::Handle<v8::Value> toV8(History* impl)
-{
-    if (!impl)
-        return v8::Null();
-    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
-    if (wrapper.IsEmpty()) {
-        wrapper = V8History::wrap(impl);
-        if (!wrapper.IsEmpty())
-            V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::historyIndex, wrapper);
-    }
-    return wrapper;
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp b/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp
deleted file mode 100644
index ccf4d0e..0000000
--- a/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp
+++ /dev/null
@@ -1,53 +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(INDEXED_DATABASE)
-#include "V8IDBRequest.h"
-
-#include "SerializedScriptValue.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8IDBRequest::resultAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
-    IDBRequest* request = V8IDBRequest::toNative(info.Holder());
-    SerializedScriptValue* result = request->result();
-    if (!result)
-        return v8::Null();
-
-    return result->deserialize();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
index 0fd182c..e8c2b68 100644
--- a/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
@@ -33,7 +33,12 @@
 #if ENABLE(INDEXED_DATABASE)
 #include "V8IndexedDatabaseRequest.h"
 
+#include "IDBDatabaseError.h"
+#include "IDBDatabaseRequest.h"
 #include "V8Binding.h"
+#include "V8CustomIDBCallbacks.h"
+#include "V8IDBDatabaseError.h"
+#include "V8IDBDatabaseRequest.h"
 #include "V8Proxy.h"
 
 namespace WebCore {
@@ -45,12 +50,32 @@
         return throwError(V8Proxy::TypeError);
     V8Parameter<> name = args[0];
     V8Parameter<> description = args[1];
+
     bool modifyDatabase = true;
-    if (args.Length() > 2)
+    if (args.Length() > 2 && !args[2]->IsUndefined() && !args[2]->IsNull())
         modifyDatabase = args[2]->BooleanValue();
 
+    v8::Local<v8::Value> onError;
+    v8::Local<v8::Value> onSuccess;
+    if (args.Length() > 3 && !args[3]->IsUndefined() && !args[3]->IsNull()) {
+        if (!args[3]->IsObject())
+            return throwError("onerror callback was not the proper type");
+        onError = args[3];
+    }
+    if (args.Length() > 4 && !args[4]->IsUndefined() && !args[4]->IsNull()) {
+        if (!args[4]->IsObject())
+            return throwError("onsuccess callback was not the proper type");
+        onSuccess = args[4];
+    }
+    if (!onError->IsObject() && !onSuccess->IsObject())
+        return throwError("Neither the onerror nor the onsuccess callbacks were set.");
+
+    Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+    RefPtr<V8CustomIDBCallbacks<IDBDatabase, IDBDatabaseRequest> > callbacks =
+        V8CustomIDBCallbacks<IDBDatabase, IDBDatabaseRequest>::create(onSuccess, onError, frame->document());
+
     ExceptionCode ec = 0;
-    imp->open(name, description, modifyDatabase, ec);
+    imp->open(name, description, modifyDatabase, callbacks, ec);
     if (ec)
         return throwError(ec);
     return v8::Handle<v8::Value>();
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 054f9ba..4c091c8 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -39,10 +39,14 @@
 #include "InspectorController.h"
 #include "Node.h"
 #include "Page.h"
+#include "ScriptDebugServer.h"
 #include "SerializedScriptValue.h"
 
 #include "V8Binding.h"
+#include "V8BindingState.h"
+#include "V8DOMWindow.h"
 #include "V8Database.h"
+#include "V8JavaScriptCallFrame.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
 #include "V8Storage.h"
@@ -59,7 +63,6 @@
 
 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHost* host)
 {
-    V8ClassIndex::V8WrapperType descriptorType = V8ClassIndex::INJECTEDSCRIPTHOST;
     v8::Local<v8::Function> function = V8InjectedScriptHost::GetTemplate()->GetFunction();
     if (function.IsEmpty()) {
         // Return if allocation failed.
@@ -70,7 +73,7 @@
         // Avoid setting the wrapper if allocation failed.
         return v8::Local<v8::Object>();
     }
-    V8DOMWrapper::setDOMWrapper(instance, V8ClassIndex::ToInt(descriptorType), host);
+    V8DOMWrapper::setDOMWrapper(instance, &V8InjectedScriptHost::info, host);
     // Create a weak reference to the v8 wrapper of InspectorBackend to deref
     // InspectorBackend when the wrapper is garbage collected.
     host->ref();
@@ -79,7 +82,7 @@
     return instance;
 }
 
-static ScriptObject createInjectedScript(const String& scriptSource, InjectedScriptHost* injectedScriptHost, ScriptState* inspectedScriptState, long id)
+ScriptObject InjectedScriptHost::createInjectedScript(const String& scriptSource, ScriptState* inspectedScriptState, long id)
 {
     v8::HandleScope scope;
 
@@ -90,7 +93,7 @@
     // instead of calling toV8() that would create the
     // wrapper in the current context.
     // FIXME: make it possible to use generic bindings factory for InjectedScriptHost.
-    v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(injectedScriptHost);
+    v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(this);
     if (scriptHostWrapper.IsEmpty())
         return ScriptObject();
 
@@ -109,9 +112,10 @@
     v8::Handle<v8::Value> args[] = {
       scriptHostWrapper,
       windowGlobal,
-      v8::Number::New(id)
+      v8::Number::New(id),
+      v8::String::New("v8")
     };
-    v8::Local<v8::Value> injectedScriptValue = v8::Function::Cast(*v)->Call(windowGlobal, 3, args);
+    v8::Local<v8::Value> injectedScriptValue = v8::Function::Cast(*v)->Call(windowGlobal, 4, args);
     v8::Local<v8::Object> injectedScript(v8::Object::Cast(*injectedScriptValue));
     return ScriptObject(inspectedScriptState, injectedScript);
 }
@@ -151,6 +155,20 @@
     return v8::Undefined();
 }
 
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+v8::Handle<v8::Value> V8InjectedScriptHost::currentCallFrameCallback(const v8::Arguments& args)
+{
+    INC_STATS("InjectedScriptHost.currentCallFrame()");
+    return toV8(ScriptDebugServer::shared().currentCallFrame());
+}
+
+v8::Handle<v8::Value> V8InjectedScriptHost::isActivationCallback(const v8::Arguments& args)
+{
+    INC_STATS("InjectedScriptHost.isActivation()");
+    return v8::Boolean::New(true);
+}
+#endif
+
 #if ENABLE(DATABASE)
 v8::Handle<v8::Value> V8InjectedScriptHost::databaseForIdCallback(const v8::Arguments& args)
 {
@@ -226,12 +244,27 @@
         return InjectedScript(ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val)));
 
     ASSERT(!m_injectedScriptSource.isEmpty());
-    ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, inspectedScriptState, m_nextInjectedScriptId);
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
-    ++m_nextInjectedScriptId;
-    global->SetHiddenValue(key, injectedScriptObject.v8Object());
+    pair<long, ScriptObject> injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState);
+    InjectedScript result(injectedScript.second);
+    m_idToInjectedScript.set(injectedScript.first, result);
+    global->SetHiddenValue(key, injectedScript.second.v8Object());
     return result;
 }
 
+bool InjectedScriptHost::canAccessInspectedWindow(ScriptState* scriptState)
+{
+    v8::HandleScope handleScope;
+    v8::Local<v8::Context> context = scriptState->context();
+    v8::Local<v8::Object> global = context->Global();
+    if (global.IsEmpty())
+        return false;
+    v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), global);
+    if (holder.IsEmpty())
+        return false;
+    Frame* frame = V8DOMWindow::toNative(holder)->frame();
+
+    v8::Context::Scope contextScope(context);
+    return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), frame, false);
+}
+
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
index b823034..7f4ccf7 100644
--- a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
@@ -35,12 +35,65 @@
 #include "InspectorFrontendHost.h"
 
 #include "V8Binding.h"
+#include "V8MouseEvent.h"
 #include "V8Proxy.h"
 
 namespace WebCore {
 
+v8::Handle<v8::Value> V8InspectorFrontendHost::platformCallback(const v8::Arguments&)
+{
+#if defined(OS_MACOSX)
+    return v8String("mac");
+#elif defined(OS_LINUX)
+    return v8String("linux");
+#elif defined(OS_WIN)
+    return v8String("windows");
+#else
+    return v8String("unknown");
+#endif
+}
+
+v8::Handle<v8::Value> V8InspectorFrontendHost::portCallback(const v8::Arguments&)
+{
+    return v8::Undefined();
+}
+
 v8::Handle<v8::Value> V8InspectorFrontendHost::showContextMenuCallback(const v8::Arguments& args)
 {
+    if (args.Length() < 2)
+        return v8::Undefined();
+
+    v8::Local<v8::Object> eventWrapper = v8::Local<v8::Object>::Cast(args[0]);
+    if (!V8MouseEvent::info.equals(V8DOMWrapper::domWrapperType(eventWrapper)))
+        return v8::Undefined();
+
+    Event* event = V8Event::toNative(eventWrapper);
+    if (!args[1]->IsArray())
+        return v8::Undefined();
+
+    v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(args[1]);
+    Vector<ContextMenuItem*> items;
+
+    for (size_t i = 0; i < array->Length(); ++i) {
+        v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(array->Get(v8::Integer::New(i)));
+        v8::Local<v8::Value> label = item->Get(v8::String::New("label"));
+        v8::Local<v8::Value> id = item->Get(v8::String::New("id"));
+        if (label->IsUndefined() || id->IsUndefined()) {
+          items.append(new ContextMenuItem(SeparatorType,
+                                           ContextMenuItemTagNoAction,
+                                           String()));
+        } else {
+          ContextMenuAction typedId = static_cast<ContextMenuAction>(
+              ContextMenuItemBaseCustomTag + id->ToInt32()->Value());
+          items.append(new ContextMenuItem(ActionType,
+                                           typedId,
+                                           toWebCoreStringWithNullCheck(label)));
+        }
+    }
+
+    InspectorFrontendHost* frontendHost = V8InspectorFrontendHost::toNative(args.Holder());
+    frontendHost->showContextMenu(event, items);
+
     return v8::Undefined();
 }
 
diff --git a/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp b/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
new file mode 100644
index 0000000..e2a691d
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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 "V8JavaScriptCallFrame.h"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8JavaScriptCallFrame::evaluateCallback(const v8::Arguments& args)
+{
+    INC_STATS("V8JavaScriptCallFrame.evaluateCallback()");
+    JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(args.Holder());
+    String expression = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
+    return impl->evaluate(expression);
+}
+
+v8::Handle<v8::Value> V8JavaScriptCallFrame::scopeChainAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("V8JavaScriptCallFrame.scopeChainAccessorGetter()");
+    JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
+    return impl->scopeChain();
+}
+
+v8::Handle<v8::Value> V8JavaScriptCallFrame::scopeTypeCallback(const v8::Arguments& args)
+{
+    INC_STATS("V8JavaScriptCallFrame.scopeTypeCallback()");
+    JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(args.Holder());
+    int scopeIndex = args[0]->Int32Value();
+    return v8::Int32::New(impl->scopeType(scopeIndex));
+}
+
+v8::Handle<v8::Value> V8JavaScriptCallFrame::thisObjectAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("V8JavaScriptCallFrame.thisObjectAccessorGetter()");
+    JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(info.Holder());
+    return impl->thisObject();
+}
+
+v8::Handle<v8::Value> V8JavaScriptCallFrame::typeAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("V8JavaScriptCallFrame.typeAccessorGetter()");
+    return v8String("function");
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
index b5df601..ac305c9 100644
--- a/WebCore/bindings/v8/custom/V8LocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
@@ -75,9 +75,14 @@
 
     if (hash.startsWith("#"))
         hash = hash.substring(1);
-    if (oldRef == hash || (oldRef.isNull() && hash.isEmpty()))
-        return;
+
+    // Note that by parsing the URL and *then* comparing fragments, we are
+    // comparing fragments post-canonicalization, and so this handles the
+    // cases where fragment identifiers are ignored or invalid.
     url.setFragmentIdentifier(hash);
+    String newRef = url.fragmentIdentifier();
+    if (oldRef == newRef || (oldRef.isNull() && newRef.isEmpty()))
+        return;
 
     navigateIfAllowed(frame, url, false, false);
 }
@@ -185,7 +190,10 @@
         return;
 
     KURL url = frame->loader()->url();
-    url.setProtocol(protocol);
+    if (!url.setProtocol(protocol)) {
+        throwError("Can't set protocol", V8Proxy::SyntaxError);
+        return;
+    }
 
     navigateIfAllowed(frame, url, false, false);
 }
@@ -342,17 +350,15 @@
     return v8String(result);
 }
 
-bool V8Location::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value> data)
+bool V8Location::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
 {
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION);
     // Only allow same origin access
     Location* imp =  V8Location::toNative(host);
     return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), false);
 }
 
-bool V8Location::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value> data)
+bool V8Location::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
 {
-    ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::LOCATION);
     // Only allow same origin access
     Location* imp = V8Location::toNative(host);
     return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), false);
@@ -366,7 +372,7 @@
     if (wrapper.IsEmpty()) {
         wrapper = V8Location::wrap(impl);
         if (!wrapper.IsEmpty())
-            V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::locationIndex, wrapper);
+            V8DOMWrapper::setHiddenWindowReference(impl->frame(), wrapper);
     }
     return wrapper;
 }
diff --git a/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp b/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
index 4fb82ba..b966e42 100644
--- a/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
@@ -67,11 +67,11 @@
     // Create references from the MessageChannel wrapper to the two
     // MessagePort wrappers to make sure that the MessagePort wrappers
     // stay alive as long as the MessageChannel wrapper is around.
-    messageChannel->SetInternalField(V8MessageChannel::port1Index, toV8(obj->port1()));
-    messageChannel->SetInternalField(V8MessageChannel::port2Index, toV8(obj->port2()));
+    V8DOMWrapper::setHiddenReference(messageChannel, toV8(obj->port1()));
+    V8DOMWrapper::setHiddenReference(messageChannel, toV8(obj->port2()));
 
     // Setup the standard wrapper object internal fields.
-    V8DOMWrapper::setDOMWrapper(messageChannel, V8ClassIndex::MESSAGECHANNEL, obj.get());
+    V8DOMWrapper::setDOMWrapper(messageChannel, &info, obj.get());
     return toV8(obj.release(), messageChannel);
 }
 
diff --git a/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp b/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
index d41a785..cca4a24 100644
--- a/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
@@ -84,6 +84,8 @@
             return v8::Undefined();
     }
     event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg.release(), originArg, lastEventIdArg, sourceArg, portArray.release());
+    v8::PropertyAttribute dataAttr = static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly);
+    SerializedScriptValue::deserializeAndSetProperty(args.Holder(), "data", dataAttr, event->data());
     return v8::Undefined();
   }
 
diff --git a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
index 9890668..c41ed38 100644
--- a/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
@@ -42,42 +42,14 @@
 
 namespace WebCore {
 
-v8::Handle<v8::Value> V8MessagePort::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.MessagePort.addEventListener()");
-    MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(messagePort, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        messagePort->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8MessagePort::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.MessagePort.removeEventListener()");
-    MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(messagePort, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        messagePort->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.MessagePort.postMessage");
     MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
-    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
     MessagePortArray portArray;
     if (args.Length() > 1) {
         if (!getMessagePortArray(args[1], portArray))
diff --git a/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp b/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
index 611ab94..4e1dd21 100644
--- a/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
@@ -32,7 +32,9 @@
 #include "V8NamedNodeMap.h"
 
 #include "NamedNodeMap.h"
+#include "V8Attr.h"
 #include "V8Binding.h"
+#include "V8BindingState.h"
 #include "V8Element.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
@@ -73,6 +75,48 @@
     return toV8(result.release());
 }
 
+v8::Handle<v8::Value> V8NamedNodeMap::setNamedItemNSCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.NamedNodeMap.setNamedItemNS");
+    NamedNodeMap* imp = V8NamedNodeMap::toNative(args.Holder());
+    Node* newNode = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+
+    if (newNode && newNode->nodeType() == Node::ATTRIBUTE_NODE && imp->element()) {
+        if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), imp->element(), newNode->nodeName(), newNode->nodeValue()))
+            return v8::Handle<v8::Value>();
+    }
+
+    ExceptionCode ec = 0;
+    RefPtr<Node> result = imp->setNamedItemNS(newNode, ec);
+    if (UNLIKELY(ec)) {
+        throwError(ec);
+        return v8::Handle<v8::Value>();
+    }
+
+    return toV8(result.release());
+}
+
+v8::Handle<v8::Value> V8NamedNodeMap::setNamedItemCallback(const v8::Arguments & args)
+{
+    INC_STATS("DOM.NamedNodeMap.setNamedItem");
+    NamedNodeMap* imp = V8NamedNodeMap::toNative(args.Holder());
+    Node* newNode = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+
+    if (newNode && newNode->nodeType() == Node::ATTRIBUTE_NODE && imp->element()) {
+      if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), imp->element(), newNode->nodeName(), newNode->nodeValue()))
+            return v8::Handle<v8::Value>();
+    }
+
+    ExceptionCode ec = 0;
+    RefPtr<Node> result = imp->setNamedItem(newNode, ec);
+    if (UNLIKELY(ec)) {
+        throwError(ec);
+        return v8::Handle<v8::Value>();
+    }
+
+    return toV8(result.release());
+}
+
 v8::Handle<v8::Value> toV8(NamedNodeMap* impl)
 {
     if (!impl)
@@ -80,10 +124,8 @@
     v8::Handle<v8::Object> wrapper = V8NamedNodeMap::wrap(impl);
     // Add a hidden reference from named node map to its owner node.
     Element* element = impl->element();
-    if (!wrapper.IsEmpty() && element) {
-        v8::Handle<v8::Value> owner = toV8(element);
-        wrapper->SetInternalField(V8NamedNodeMap::ownerNodeIndex, owner);
-    }
+    if (!wrapper.IsEmpty() && element)
+        V8DOMWrapper::setHiddenReference(wrapper, toV8(element));
     return wrapper;
 }
 
diff --git a/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
index 7907283..0a7198a 100644
--- a/WebCore/bindings/v8/custom/V8NodeCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
@@ -37,6 +37,7 @@
 #include "V8AbstractEventListener.h"
 #include "V8Attr.h"
 #include "V8Binding.h"
+#include "V8BindingState.h"
 #include "V8CDATASection.h"
 #include "V8Comment.h"
 #include "V8CustomEventListener.h"
@@ -56,38 +57,43 @@
 
 namespace WebCore {
 
-v8::Handle<v8::Value> V8Node::addEventListenerCallback(const v8::Arguments& args)
+static inline bool isFrameSrc(Element *element, const String& name)
 {
-    INC_STATS("DOM.Node.addEventListener()");
-    Node* node = V8Node::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(node, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        node->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
+    return element && (element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag)) && equalIgnoringCase(name, "src");
 }
 
-v8::Handle<v8::Value> V8Node::removeEventListenerCallback(const v8::Arguments& args)
+void V8Node::textContentAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
 {
-    INC_STATS("DOM.Node.removeEventListener()");
-    Node* node = V8Node::toNative(args.Holder());
+    Node* imp = V8Node::toNative(info.Holder());
+    String nodeValue = toWebCoreStringWithNullCheck(value);
 
-    // It is possbile that the owner document of the node is detached
-    // from the frame.
-    // See issue http://b/878909
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(node, args[1], false, ListenerFindOnly);
-    if (listener) {
-        AtomicString type = v8ValueToAtomicWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        node->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE) {
+        Element * ownerElement = V8Attr::toNative(info.Holder())->ownerElement();
+        if (ownerElement && !V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), ownerElement, imp->nodeName(), nodeValue))
+            return;
     }
 
-    return v8::Undefined();
+    ExceptionCode ec = 0;
+    imp->setTextContent(nodeValue, ec);
+    if (ec)
+        throwError(ec);
+}
+
+void V8Node::nodeValueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    Node* imp = V8Node::toNative(info.Holder());
+    String nodeValue = toWebCoreStringWithNullCheck(value);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE) {
+        Element * ownerElement = V8Attr::toNative(info.Holder())->ownerElement();
+        if (ownerElement && !V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), ownerElement, imp->nodeName(), nodeValue))
+            return;
+    }
+
+    ExceptionCode ec = 0;
+    imp->setNodeValue(nodeValue, ec);
+    if (ec)
+        throwError(ec);
 }
 
 // This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
@@ -96,6 +102,12 @@
     INC_STATS("DOM.Node.insertBefore");
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isFrameSrc(V8Attr::toNative(holder)->ownerElement(), imp->nodeName())) {
+        V8Proxy::setDOMException(NOT_SUPPORTED_ERR);
+        return v8::Handle<v8::Value>();
+    }
+
     ExceptionCode ec = 0;
     Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     Node* refChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
@@ -115,6 +127,12 @@
     INC_STATS("DOM.Node.replaceChild");
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isFrameSrc(V8Attr::toNative(holder)->ownerElement(), imp->nodeName())) {
+        V8Proxy::setDOMException(NOT_SUPPORTED_ERR);
+        return v8::Handle<v8::Value>();
+    }
+
     ExceptionCode ec = 0;
     Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     Node* oldChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
@@ -133,6 +151,12 @@
     INC_STATS("DOM.Node.removeChild");
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isFrameSrc(V8Attr::toNative(holder)->ownerElement(), imp->nodeName())) {
+        V8Proxy::setDOMException(NOT_SUPPORTED_ERR);
+        return v8::Handle<v8::Value>();
+    }
+
     ExceptionCode ec = 0;
     Node* oldChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     bool success = imp->removeChild(oldChild, ec);
@@ -151,6 +175,12 @@
     INC_STATS("DOM.Node.appendChild");
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
+
+    if (imp->nodeType() == Node::ATTRIBUTE_NODE && isFrameSrc(V8Attr::toNative(holder)->ownerElement(), imp->nodeName())) {
+        V8Proxy::setDOMException(NOT_SUPPORTED_ERR);
+        return v8::Handle<v8::Value>();
+    }
+
     ExceptionCode ec = 0;
     Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     bool success = imp->appendChild(newChild, ec, true );
diff --git a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
index 9c3ab45..30773e3 100644
--- a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
@@ -46,38 +46,6 @@
 
 namespace WebCore {
 
-v8::Handle<v8::Value> V8Notification::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.Notification.addEventListener()");
-    Notification* notification = V8Notification::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(notification, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        notification->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8Notification::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.Notification.removeEventListener()");
-    Notification* notification = V8Notification::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(notification, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        notification->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> V8NotificationCenter::createHTMLNotificationCallback(const v8::Arguments& args)
 {
     INC_STATS(L"DOM.NotificationCenter.CreateHTMLNotification()");
diff --git a/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp b/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
index 46e9929..cdb160d 100644
--- a/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
@@ -35,6 +35,8 @@
 #include "SerializedScriptValue.h"
 #include "V8Proxy.h"
 
+#include <v8.h>
+
 namespace WebCore {
 
 v8::Handle<v8::Value> V8PopStateEvent::initPopStateEventCallback(const v8::Arguments& args)
@@ -44,7 +46,11 @@
     String typeArg = v8ValueToWebCoreString(args[0]);
     bool canBubbleArg = args[1]->BooleanValue();
     bool cancelableArg = args[2]->BooleanValue();
-    RefPtr<SerializedScriptValue> stateArg = SerializedScriptValue::create(args[3]);
+
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> stateArg = SerializedScriptValue::create(args[3], didThrow);
+    if (didThrow)
+        return v8::Undefined();
 
     PopStateEvent* event = V8PopStateEvent::toNative(args.Holder());
     event->initPopStateEvent(typeArg, canBubbleArg, cancelableArg, stateArg.release());
diff --git a/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp b/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp
index 558c03b..8dce61b 100644
--- a/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp
@@ -29,6 +29,8 @@
  */
 
 #include "config.h"
+
+#if ENABLE(SVG)
 #include "V8SVGDocument.h"
 
 #include "V8IsolatedContext.h"
@@ -51,3 +53,5 @@
 }
 
 } // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/v8/custom/V8SVGElementCustom.cpp b/WebCore/bindings/v8/custom/V8SVGElementCustom.cpp
index 0ce48ce..7ad5f41 100644
--- a/WebCore/bindings/v8/custom/V8SVGElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGElementCustom.cpp
@@ -29,10 +29,10 @@
  */
 
 #include "config.h"
-#include "V8SVGElement.h"
 
 #if ENABLE(SVG)
 
+#include "V8SVGElement.h"
 #include "V8SVGElementWrapperFactory.h"
 
 namespace WebCore {
diff --git a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp b/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
deleted file mode 100644
index 56c37bd..0000000
--- a/WebCore/bindings/v8/custom/V8SVGElementInstanceCustom.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2009 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(SVG)
-#include "V8SVGElementInstance.h"
-
-#include "EventListener.h"
-#include "SVGElementInstance.h"
-
-#include "V8Binding.h"
-#include "V8CustomEventListener.h"
-#include "V8SVGPODTypeWrapper.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8SVGElementInstance::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.SVGElementInstance.AddEventListener()");
-    SVGElementInstance* instance = V8SVGElementInstance::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(instance, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        instance->addEventListener(type, listener, useCapture);
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8SVGElementInstance::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.SVGElementInstance.RemoveEventListener()");
-    SVGElementInstance* instance = V8SVGElementInstance::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(instance, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        instance->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/v8/custom/V8SVGPathSegCustom.cpp b/WebCore/bindings/v8/custom/V8SVGPathSegCustom.cpp
index a96d55e..5544f83 100644
--- a/WebCore/bindings/v8/custom/V8SVGPathSegCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGPathSegCustom.cpp
@@ -29,6 +29,8 @@
  */
 
 #include "config.h"
+
+#if ENABLE(SVG)
 #include "V8SVGPathSeg.h"
 
 #include "V8DOMWindow.h"
@@ -104,3 +106,5 @@
 }
 
 } // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/v8/custom/V8ScreenCustom.cpp b/WebCore/bindings/v8/custom/V8ScreenCustom.cpp
deleted file mode 100644
index 98d9dd7..0000000
--- a/WebCore/bindings/v8/custom/V8ScreenCustom.cpp
+++ /dev/null
@@ -1,52 +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 "V8Screen.h"
-
-#include "V8DOMWindow.h"
-#include "V8DOMWrapper.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> toV8(Screen* impl)
-{
-    if (!impl)
-        return v8::Null();
-    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
-    if (wrapper.IsEmpty()) {
-        wrapper = V8Screen::wrap(impl);
-        if (!wrapper.IsEmpty())
-            V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::screenIndex, wrapper);
-    }
-    return wrapper;
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp b/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
new file mode 100644
index 0000000..ddaabb0
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
@@ -0,0 +1,61 @@
+/*
+ * 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 "V8ScriptProfile.h"
+
+#include "ScriptProfile.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+#include <v8-profiler.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> toV8(ScriptProfile* impl)
+{
+    if (!impl)
+        return v8::Null();
+    v8::Local<v8::Function> function = V8ScriptProfile::GetTemplate()->GetFunction();
+    if (function.IsEmpty()) {
+        // Return if allocation failed.
+        return v8::Local<v8::Object>();
+    }
+    v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+    if (instance.IsEmpty()) {
+        // Avoid setting the wrapper if allocation failed.
+        return v8::Local<v8::Object>();
+    }
+    impl->ref();
+    V8DOMWrapper::setDOMWrapper(instance, &V8ScriptProfile::info, impl);
+    return instance;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp b/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp
new file mode 100644
index 0000000..a4deeeb
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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 "V8ScriptProfileNode.h"
+
+#include "ScriptProfileNode.h"
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+#include <v8-profiler.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8ScriptProfileNode::childrenAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.ScriptProfileNode.childrenAccessorGetter");
+    ScriptProfileNode* imp = V8ScriptProfileNode::toNative(info.Holder());
+    const ProfileNodesList& children = imp->children();
+    v8::Handle<v8::Array> result = v8::Array::New(children.size());
+    int index = 0;
+    ProfileNodesList::const_iterator end = children.end();
+    for (ProfileNodesList::const_iterator iter = children.begin(); iter != end; ++iter)
+        result->Set(v8::Integer::New(index++), toV8(iter->get()));
+    return result;
+}
+
+v8::Handle<v8::Value> V8ScriptProfileNode::callUIDAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.ScriptProfileNode.callUIDAccessorGetter");
+    ScriptProfileNode* imp = V8ScriptProfileNode::toNative(info.Holder());
+    return v8::Number::New(imp->callUID());
+}
+
+v8::Handle<v8::Value> toV8(ScriptProfileNode* impl)
+{
+    if (!impl)
+        return v8::Null();
+    v8::Local<v8::Function> function = V8ScriptProfileNode::GetTemplate()->GetFunction();
+    if (function.IsEmpty()) {
+        // Return if allocation failed.
+        return v8::Local<v8::Object>();
+    }
+    v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
+    if (instance.IsEmpty()) {
+        // Avoid setting the wrapper if allocation failed.
+        return v8::Local<v8::Object>();
+    }
+    impl->ref();
+    V8DOMWrapper::setDOMWrapper(instance, &V8ScriptProfileNode::info, impl);
+    return instance;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp b/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp
index f69675a..2d72c37 100644
--- a/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp
@@ -80,7 +80,7 @@
 
     // Setup the standard wrapper object internal fields.
     v8::Handle<v8::Object> wrapperObject = args.Holder();
-    V8DOMWrapper::setDOMWrapper(wrapperObject, V8ClassIndex::SHAREDWORKER, obj.get());
+    V8DOMWrapper::setDOMWrapper(wrapperObject, &info, obj.get());
 
     obj->ref();
     V8DOMWrapper::setJSWrapperForActiveDOMObject(obj.get(), v8::Persistent<v8::Object>::New(wrapperObject));
diff --git a/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp b/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
index b062cdc..b3f6ff7 100644
--- a/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "V8StyleSheet.h"
 
+#include "V8DOMWrapper.h"
 #include "V8CSSStyleSheet.h"
 #include "V8Node.h"
 
@@ -45,10 +46,8 @@
     v8::Handle<v8::Object> wrapper = V8StyleSheet::wrap(impl);
     // Add a hidden reference from stylesheet object to its owner node.
     Node* ownerNode = impl->ownerNode();
-    if (ownerNode && !wrapper.IsEmpty()) {
-        v8::Handle<v8::Object> owner = v8::Handle<v8::Object>::Cast(toV8(ownerNode));
-        wrapper->SetInternalField(V8StyleSheet::ownerNodeIndex, owner);
-    }
+    if (ownerNode && !wrapper.IsEmpty())
+        V8DOMWrapper::setHiddenReference(wrapper, toV8(ownerNode));
     return wrapper;
 }
 
diff --git a/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
index 5b54563..d3e6cb5 100644
--- a/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
@@ -72,9 +72,13 @@
         len = toInt32(args[0]);
     }
 
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(len);
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(len, 1);
+    if (!buffer.get()) {
+        V8Proxy::setDOMException(INDEX_SIZE_ERR);
+        return v8::Undefined();
+    }
     // Transform the holder into a wrapper object for the array.
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::WEBGLARRAYBUFFER), buffer.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, buffer.get());
     return toV8(buffer.release(), args.Holder());
 }
 
diff --git a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.cpp
index a92e4f2..e15fa11 100644
--- a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.cpp
@@ -33,6 +33,8 @@
 #if ENABLE(3D_CANVAS)
 #include "V8WebGLArray.h"
 
+#include "V8Binding.h"
+#include "V8Proxy.h"
 #include "V8WebGLByteArray.h"
 #include "V8WebGLFloatArray.h"
 #include "V8WebGLIntArray.h"
@@ -64,6 +66,30 @@
     return v8::Handle<v8::Value>();
 }
 
+v8::Handle<v8::Value> V8WebGLArray::sliceCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.WebGLArray.slice");
+    // Forms:
+    // * slice(long start, long end);
+
+    WebGLArray* imp = V8WebGLArray::toNative(args.Holder());
+    int start, end;
+    switch (args.Length()) {
+    case 0:
+        start = 0;
+        end = imp->length();
+        break;
+    case 1:
+        start = toInt32(args[0]);
+        end = imp->length();
+        break;
+    default:
+        start = toInt32(args[0]);
+        end = toInt32(args[1]);
+    }
+    return toV8(imp->slice(start, end));
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
index beea8e6..02bce9c 100644
--- a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
+++ b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
@@ -41,9 +41,8 @@
 namespace WebCore {
 
 // Template function used by the WebGLArray*Constructor callbacks.
-template<class ArrayClass>
-v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args,
-                                          int classIndex)
+template<class ArrayClass, class ElementType>
+v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType)
 {
     if (!args.IsConstructCall())
         return throwError("DOM object constructor cannot be called as a function.");
@@ -71,96 +70,64 @@
 
     // See whether the first argument is a WebGLArrayBuffer.
     if (V8WebGLArrayBuffer::HasInstance(args[0])) {
-        if (argLen > 3)
-            return throwError("Wrong number of arguments to new WebGL<T>Array(WebGLArrayBuffer, int, int)");
-
         WebGLArrayBuffer* buf = V8WebGLArrayBuffer::toNative(args[0]->ToObject());
-        if (buf == NULL)
+        if (!buf)
             return throwError("Could not convert argument 0 to a WebGLArrayBuffer");
         bool ok;
-        int offset = 0;
+        uint32_t offset = 0;
         if (argLen > 1) {
-            offset = toInt32(args[1], ok);
+            offset = toUInt32(args[1], ok);
             if (!ok)
-                return throwError("Could not convert argument 1 to an integer");
+                return throwError("Could not convert argument 1 to a number");
         }
-        int length = buf->byteLength() - offset;
+        uint32_t length = (buf->byteLength() - offset) / sizeof(ElementType);
         if (argLen > 2) {
-            length = toInt32(args[2], ok);
+            length = toUInt32(args[2], ok);
             if (!ok)
-                return throwError("Could not convert argument 2 to an integer");
+                return throwError("Could not convert argument 2 to a number");
         }
-        if (length < 0)
-            return throwError("Length / offset out of range");
 
         RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length);
-        if (array == NULL)
-            return throwError("Invalid arguments to new WebGL<T>Array(WebGLArrayBuffer, int, int)");
+        if (!array)
+            return throwError("Out-of-range offset and/or length");
         // Transform the holder into a wrapper object for the array.
-        V8DOMWrapper::setDOMWrapper(args.Holder(), classIndex, array.get());
-        V8DOMWrapper::setIndexedPropertiesToExternalArray(args.Holder(),
-                                                          classIndex,
-                                                          array.get()->baseAddress(),
-                                                          array.get()->length());
+        V8DOMWrapper::setDOMWrapper(args.Holder(), type, array.get());
+        args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
         return toV8(array.release(), args.Holder());
     }
 
-    int len = 0;
+    uint32_t len = 0;
     v8::Handle<v8::Object> srcArray;
-    if (argLen != 1)
-        return throwError("Wrong number of arguments to new WebGL<T>Array(int / array)");
 
     if (args[0]->IsInt32()) {
-        len = toInt32(args[0]);
+        len = toUInt32(args[0]);
     } else if (args[0]->IsObject()) {
         srcArray = args[0]->ToObject();
         if (srcArray.IsEmpty())
-            return throwError("Could not convert argument 0 to an object");
-        len = toInt32(srcArray->Get(v8::String::New("length")));
+            return throwError("Could not convert argument 0 to an array");
+        len = toUInt32(srcArray->Get(v8::String::New("length")));
     } else
-        return throwError("Could not convert argument 0 to either an int32 or an object");
+        return throwError("Could not convert argument 0 to either a number or an array");
 
     RefPtr<ArrayClass> array = ArrayClass::create(len);
+    if (!array.get()) {
+        V8Proxy::setDOMException(INDEX_SIZE_ERR);
+        return v8::Undefined();
+    }
     if (!srcArray.IsEmpty()) {
         // Need to copy the incoming array into the newly created WebGLArray.
-        for (int i = 0; i < len; i++) {
-            v8::Local<v8::Value> val = srcArray->Get(v8::Integer::New(i));
+        for (unsigned i = 0; i < len; i++) {
+            v8::Local<v8::Value> val = srcArray->Get(v8::Integer::NewFromUnsigned(i));
             array->set(i, val->NumberValue());
         }
     }
 
     // Transform the holder into a wrapper object for the array.
-    V8DOMWrapper::setDOMWrapper(args.Holder(), classIndex, array.get());
-    V8DOMWrapper::setIndexedPropertiesToExternalArray(args.Holder(),
-                                                      classIndex,
-                                                      array.get()->baseAddress(),
-                                                      array.get()->length());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), type, array.get());
+    args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
     return toV8(array.release(), args.Holder());
 }
 
-template <class T, typename ElementType>
-v8::Handle<v8::Value> getWebGLArrayElement(const v8::Arguments& args,
-                                           V8ClassIndex::V8WrapperType wrapperType)
-{
-    if (args.Length() != 1) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
-    bool ok;
-    uint32_t index = toInt32(args[0], ok);
-    if (!ok) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
-    T* array = reinterpret_cast<T*>(args.Holder()->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-    if (index >= array->length())
-        return v8::Undefined();
-    ElementType result;
-    if (!array->get(index, result))
-        return v8::Undefined();
-    return v8::Number::New(result);
-}
-
 template <class T>
 v8::Handle<v8::Value> setWebGLArrayFromArray(T* webGLArray, const v8::Arguments& args)
 {
@@ -169,21 +136,23 @@
         v8::Local<v8::Object> array = args[0]->ToObject();
         uint32_t offset = 0;
         if (args.Length() == 2)
-            offset = toInt32(args[1]);
-        uint32_t length = toInt32(array->Get(v8::String::New("length")));
-        if (offset + length > webGLArray->length())
+            offset = toUInt32(args[1]);
+        uint32_t length = toUInt32(array->Get(v8::String::New("length")));
+        if (offset > webGLArray->length() ||
+            offset + length > webGLArray->length() ||
+            offset + length < offset)
+            // Out of range offset or overflow
             V8Proxy::setDOMException(INDEX_SIZE_ERR);
         else
             for (uint32_t i = 0; i < length; i++)
-                webGLArray->set(offset + i, array->Get(v8::Integer::New(i))->NumberValue());
+                webGLArray->set(offset + i, array->Get(v8::Integer::NewFromUnsigned(i))->NumberValue());
     }
 
     return v8::Undefined();
 }
 
 template <class CPlusPlusArrayType, class JavaScriptWrapperArrayType>
-v8::Handle<v8::Value> setWebGLArray(const v8::Arguments& args,
-                                    V8ClassIndex::V8WrapperType wrapperType)
+v8::Handle<v8::Value> setWebGLArray(const v8::Arguments& args)
 {
     if (args.Length() < 1 || args.Length() > 2) {
         V8Proxy::setDOMException(SYNTAX_ERR);
@@ -192,9 +161,10 @@
 
     CPlusPlusArrayType* array = JavaScriptWrapperArrayType::toNative(args.Holder());
 
+    // FIXME: change to IsUInt32() when available
     if (args.Length() == 2 && args[0]->IsInt32()) {
         // void set(in unsigned long index, in {long|float} value);
-        uint32_t index = toInt32(args[0]);
+        uint32_t index = toUInt32(args[0]);
         array->set(index, args[1]->NumberValue());
         return v8::Undefined();
     }
@@ -204,7 +174,7 @@
         CPlusPlusArrayType* src = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
         uint32_t offset = 0;
         if (args.Length() == 2)
-            offset = toInt32(args[1]);
+            offset = toUInt32(args[1]);
         ExceptionCode ec = 0;
         array->set(src, offset, ec);
         V8Proxy::setDOMException(ec);
diff --git a/WebCore/bindings/v8/custom/V8WebGLByteArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLByteArrayCustom.cpp
index dd6163a..8487ace 100644
--- a/WebCore/bindings/v8/custom/V8WebGLByteArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLByteArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLByteArray.Contructor");
 
-    return constructWebGLArray<WebGLByteArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLBYTEARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLByteArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLByteArray.get()");
-    return getWebGLArrayElement<WebGLByteArray, signed char>(args, V8ClassIndex::WEBGLBYTEARRAY);
+    return constructWebGLArray<WebGLByteArray, signed char>(args, &info, v8::kExternalByteArray);
 }
 
 v8::Handle<v8::Value> V8WebGLByteArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLByteArray.set()");
-    return setWebGLArray<WebGLByteArray, V8WebGLByteArray>(args, V8ClassIndex::WEBGLBYTEARRAY);
+    return setWebGLArray<WebGLByteArray, V8WebGLByteArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLByteArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLFloatArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLFloatArrayCustom.cpp
index 3fb8865..77223ea 100644
--- a/WebCore/bindings/v8/custom/V8WebGLFloatArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLFloatArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLFloatArray.Contructor");
 
-    return constructWebGLArray<WebGLFloatArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLFLOATARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLFloatArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLFloatArray.get()");
-    return getWebGLArrayElement<WebGLFloatArray, float>(args, V8ClassIndex::WEBGLFLOATARRAY);
+    return constructWebGLArray<WebGLFloatArray, float>(args, &info, v8::kExternalFloatArray);
 }
 
 v8::Handle<v8::Value> V8WebGLFloatArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLFloatArray.set()");
-    return setWebGLArray<WebGLFloatArray, V8WebGLFloatArray>(args, V8ClassIndex::WEBGLFLOATARRAY);
+    return setWebGLArray<WebGLFloatArray, V8WebGLFloatArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLFloatArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLIntArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLIntArrayCustom.cpp
index 0141a0b..532bdef 100644
--- a/WebCore/bindings/v8/custom/V8WebGLIntArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLIntArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLIntArray.Contructor");
 
-    return constructWebGLArray<WebGLIntArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLINTARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLIntArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLIntArray.get()");
-    return getWebGLArrayElement<WebGLIntArray, int>(args, V8ClassIndex::WEBGLINTARRAY);
+    return constructWebGLArray<WebGLIntArray, int>(args, &info, v8::kExternalIntArray);
 }
 
 v8::Handle<v8::Value> V8WebGLIntArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLIntArray.set()");
-    return setWebGLArray<WebGLIntArray, V8WebGLIntArray>(args, V8ClassIndex::WEBGLINTARRAY);
+    return setWebGLArray<WebGLIntArray, V8WebGLIntArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLIntArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 78de5e6..1b8936d 100644
--- a/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -2,7 +2,7 @@
  * Copyright (C) 2009 Google Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions areV8ClassIndex::WEBGL
+ * modification, are permitted provided that the following conditions are
  * met:
  * 
  *     * Redistributions of source code must retain the above copyright
@@ -429,10 +429,6 @@
     bool ok = false;
     WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok);
 
-    if (!ok) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
     WebGLGetInfo info = context->getUniform(program, location, ec);
     if (ec) {
         V8Proxy::setDOMException(ec);
@@ -786,10 +782,6 @@
 
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
 
-    if (!ok) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
     if (V8WebGLFloatArray::HasInstance(args[1])) {
         WebGLFloatArray* array = V8WebGLFloatArray::toNative(args[1]->ToObject());
         ASSERT(array != NULL);
@@ -862,10 +854,6 @@
     bool ok = false;
     WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
 
-    if (!ok) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
     if (V8WebGLIntArray::HasInstance(args[1])) {
         WebGLIntArray* array = V8WebGLIntArray::toNative(args[1]->ToObject());
         ASSERT(array != NULL);
@@ -979,10 +967,6 @@
     bool ok = false;
     WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
     
-    if (!ok) {
-        V8Proxy::setDOMException(SYNTAX_ERR);
-        return notHandledByInterceptor();
-    }
     bool transpose = args[1]->BooleanValue();
     if (V8WebGLFloatArray::HasInstance(args[2])) {
         WebGLFloatArray* array = V8WebGLFloatArray::toNative(args[2]->ToObject());
diff --git a/WebCore/bindings/v8/custom/V8WebGLShortArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLShortArrayCustom.cpp
index 5a2408e..328f227 100644
--- a/WebCore/bindings/v8/custom/V8WebGLShortArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLShortArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLShortArray.Contructor");
 
-    return constructWebGLArray<WebGLShortArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLSHORTARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLShortArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLShortArray.get()");
-    return getWebGLArrayElement<WebGLShortArray, short>(args, V8ClassIndex::WEBGLSHORTARRAY);
+    return constructWebGLArray<WebGLShortArray, short>(args, &info, v8::kExternalShortArray);
 }
 
 v8::Handle<v8::Value> V8WebGLShortArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLShortArray.set()");
-    return setWebGLArray<WebGLShortArray, V8WebGLShortArray>(args, V8ClassIndex::WEBGLSHORTARRAY);
+    return setWebGLArray<WebGLShortArray, V8WebGLShortArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLShortArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp
index 5a30ace..5185298 100644
--- a/WebCore/bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLUnsignedByteArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLUnsignedByteArray.Contructor");
 
-    return constructWebGLArray<WebGLUnsignedByteArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLUNSIGNEDBYTEARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLUnsignedByteArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLUnsignedByteArray.get()");
-    return getWebGLArrayElement<WebGLUnsignedByteArray, unsigned char>(args, V8ClassIndex::WEBGLUNSIGNEDBYTEARRAY);
+    return constructWebGLArray<WebGLUnsignedByteArray, unsigned char>(args, &info, v8::kExternalUnsignedByteArray);
 }
 
 v8::Handle<v8::Value> V8WebGLUnsignedByteArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLUnsignedByteArray.set()");
-    return setWebGLArray<WebGLUnsignedByteArray, V8WebGLUnsignedByteArray>(args, V8ClassIndex::WEBGLUNSIGNEDBYTEARRAY);
+    return setWebGLArray<WebGLUnsignedByteArray, V8WebGLUnsignedByteArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLUnsignedByteArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp
index cefc60e..14aa1bb 100644
--- a/WebCore/bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLUnsignedIntArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLUnsignedIntArray.Contructor");
 
-    return constructWebGLArray<WebGLUnsignedIntArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLUNSIGNEDINTARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLUnsignedIntArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLUnsignedIntArray.get()");
-    return getWebGLArrayElement<WebGLUnsignedIntArray, unsigned int>(args, V8ClassIndex::WEBGLUNSIGNEDINTARRAY);
+    return constructWebGLArray<WebGLUnsignedIntArray, unsigned int>(args, &info, v8::kExternalUnsignedIntArray);
 }
 
 v8::Handle<v8::Value> V8WebGLUnsignedIntArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLUnsignedIntArray.set()");
-    return setWebGLArray<WebGLUnsignedIntArray, V8WebGLUnsignedIntArray>(args, V8ClassIndex::WEBGLUNSIGNEDINTARRAY);
+    return setWebGLArray<WebGLUnsignedIntArray, V8WebGLUnsignedIntArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLUnsignedIntArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp
index 56e34b8..e9ebb4f 100644
--- a/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp
@@ -47,19 +47,13 @@
 {
     INC_STATS("DOM.WebGLUnsignedShortArray.Contructor");
 
-    return constructWebGLArray<WebGLUnsignedShortArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY));
-}
-
-v8::Handle<v8::Value> V8WebGLUnsignedShortArray::getCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebGLUnsignedShortArray.get()");
-    return getWebGLArrayElement<WebGLUnsignedShortArray, unsigned short>(args, V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY);
+    return constructWebGLArray<WebGLUnsignedShortArray, unsigned short>(args, &info, v8::kExternalUnsignedShortArray);
 }
 
 v8::Handle<v8::Value> V8WebGLUnsignedShortArray::setCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLUnsignedShortArray.set()");
-    return setWebGLArray<WebGLUnsignedShortArray, V8WebGLUnsignedShortArray>(args, V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY);
+    return setWebGLArray<WebGLUnsignedShortArray, V8WebGLUnsignedShortArray>(args);
 }
 
 v8::Handle<v8::Value> toV8(WebGLUnsignedShortArray* impl)
diff --git a/WebCore/bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp b/WebCore/bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp
index 55518d2..b97d0e8 100644
--- a/WebCore/bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp
@@ -63,7 +63,7 @@
         throwError(ec);
 
     // Transform the holder into a wrapper object for the matrix.
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::WEBKITCSSMATRIX), matrix.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, matrix.get());
     return toV8(matrix.release(), args.Holder());
 }
 
diff --git a/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp b/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
index 1959454..cb29f82 100755
--- a/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
@@ -33,8 +33,8 @@
 
 #include "V8Binding.h"
 #include "V8DOMWrapper.h"
-#include "V8Index.h"
 #include "V8Proxy.h"
+#include "WrapperTypeInfo.h"
 
 #include <wtf/MathExtras.h>
 
@@ -63,7 +63,7 @@
     }
     PassRefPtr<WebKitPoint> point = WebKitPoint::create(x, y);
     point->ref();
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::WEBKITPOINT, point.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, point.get());
     return args.Holder();
 }
 
diff --git a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index 2451b90..b931053 100644
--- a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -45,37 +45,6 @@
 
 namespace WebCore {
 
-v8::Handle<v8::Value> V8WebSocket::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebSocket.addEventListener()");
-    WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(webSocket, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        webSocket->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8WebSocket::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.WebSocket.removeEventListener()");
-    WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(webSocket, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        webSocket->removeEventListener(type, listener.get(), useCapture);
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebSocket.Constructor");
@@ -115,7 +84,7 @@
         return throwError(ec);
 
     // Setup the standard wrapper object internal fields.
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::WEBSOCKET), webSocket.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, webSocket.get());
 
     // Add object to the wrapper map.
     webSocket->ref();
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 7677e27..46bd966 100755
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -58,7 +58,11 @@
     int32_t timeout = argumentCount >= 2 ? args[1]->Int32Value() : 0;
     int timerId;
 
-    v8::Handle<v8::Context> v8Context = workerContext->script()->proxy()->context();
+    WorkerContextExecutionProxy* proxy = workerContext->script()->proxy();
+    if (!proxy)
+        return v8::Undefined();
+
+    v8::Handle<v8::Context> v8Context = proxy->context();
     if (function->IsString()) {
         WebCore::String stringFunction = toWebCoreString(function);
         timerId = DOMTimer::install(workerContext, new ScheduledAction(v8Context, stringFunction, workerContext->url()), timeout, singleShot);
@@ -86,14 +90,6 @@
     if (!args.Length())
         return v8::Undefined();
 
-    String callerURL;
-    if (!V8Proxy::sourceName(callerURL))
-        return v8::Undefined();
-    int callerLine;
-    if (!V8Proxy::sourceLineNumber(callerLine))
-        return v8::Undefined();
-    callerLine += 1;
-
     Vector<String> urls;
     for (int i = 0; i < args.Length(); i++) {
         v8::TryCatch tryCatch;
@@ -106,7 +102,7 @@
     WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
 
     ExceptionCode ec = 0;
-    workerContext->importScripts(urls, callerURL, callerLine, ec);
+    workerContext->importScripts(urls, ec);
 
     if (ec)
         return throwError(ec);
@@ -126,44 +122,16 @@
     return SetTimeoutOrInterval(args, false);
 }
 
-v8::Handle<v8::Value> V8WorkerContext::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS(L"DOM.WorkerContext.addEventListener()");
-    WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(workerContext, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        workerContext->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8WorkerContext::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS(L"DOM.WorkerContext.removeEventListener()");
-    WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(workerContext, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        workerContext->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> toV8(WorkerContext* impl)
 {
     if (!impl)
         return v8::Null();
 
-    v8::Handle<v8::Object> global = impl->script()->proxy()->context()->Global();
+    WorkerContextExecutionProxy* proxy = impl->script()->proxy();
+    if (!proxy)
+        return v8::Null();
+
+    v8::Handle<v8::Object> global = proxy->context()->Global();
     ASSERT(!global.IsEmpty());
     return global;
 }
diff --git a/WebCore/bindings/v8/custom/V8WorkerCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
index 6b41246..fdc6815 100755
--- a/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
@@ -79,7 +79,7 @@
 
     // Setup the standard wrapper object internal fields.
     v8::Handle<v8::Object> wrapperObject = args.Holder();
-    V8DOMWrapper::setDOMWrapper(wrapperObject, V8ClassIndex::WORKER, obj.get());
+    V8DOMWrapper::setDOMWrapper(wrapperObject, &info, obj.get());
 
     obj->ref();
     V8DOMWrapper::setJSWrapperForActiveDOMObject(obj.get(), v8::Persistent<v8::Object>::New(wrapperObject));
@@ -91,7 +91,10 @@
 {
     INC_STATS("DOM.Worker.postMessage");
     Worker* worker = V8Worker::toNative(args.Holder());
-    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0]);
+    bool didThrow = false;
+    RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], didThrow);
+    if (didThrow)
+        return v8::Undefined();
     MessagePortArray portArray;
     if (args.Length() > 1) {
         if (!getMessagePortArray(args[1], portArray))
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
index f50248b..6b5b64f 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
@@ -53,7 +53,7 @@
     if (!context)
         return throwError("XMLHttpRequest constructor's associated context is not available", V8Proxy::ReferenceError);
     RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context);
-    V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::XMLHTTPREQUEST), xmlHttpRequest.get());
+    V8DOMWrapper::setDOMWrapper(args.Holder(), &info, xmlHttpRequest.get());
 
     // Add object to the wrapper map.
     xmlHttpRequest->ref();
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index d10c418..4e9c715 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 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
@@ -34,6 +34,7 @@
 #include "Frame.h"
 #include "V8Binding.h"
 #include "V8Blob.h"
+#include "V8DOMFormData.h"
 #include "V8Document.h"
 #include "V8HTMLDocument.h"
 #include "V8Proxy.h"
@@ -51,39 +52,6 @@
     return xmlHttpRequest->responseText().v8StringOrNull();
 }
 
-v8::Handle<v8::Value> V8XMLHttpRequest::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequest.addEventListener()");
-    XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        xmlHttpRequest->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8XMLHttpRequest::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequest.removeEventListener()");
-    XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        xmlHttpRequest->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.XMLHttpRequest.open()");
@@ -106,20 +74,23 @@
 
     KURL url = context->completeURL(urlstring);
 
-    bool async = (args.Length() < 3) ? true : args[2]->BooleanValue();
-
     ExceptionCode ec = 0;
-    String user, passwd;
-    if (args.Length() >= 4 && !args[3]->IsUndefined()) {
-        user = toWebCoreStringWithNullCheck(args[3]);
 
-        if (args.Length() >= 5 && !args[4]->IsUndefined()) {
-            passwd = toWebCoreStringWithNullCheck(args[4]);
-            xmlHttpRequest->open(method, url, async, user, passwd, ec);
+    if (args.Length() >= 3) {
+        bool async = args[2]->BooleanValue();
+
+        if (args.Length() >= 4 && !args[3]->IsUndefined()) {
+            String user = toWebCoreStringWithNullCheck(args[3]);
+            
+            if (args.Length() >= 5 && !args[4]->IsUndefined()) {
+                String passwd = toWebCoreStringWithNullCheck(args[4]);
+                xmlHttpRequest->open(method, url, async, user, passwd, ec);
+            } else
+                xmlHttpRequest->open(method, url, async, user, ec);
         } else
-            xmlHttpRequest->open(method, url, async, user, ec);
+            xmlHttpRequest->open(method, url, async, ec);
     } else
-        xmlHttpRequest->open(method, url, async, ec);
+        xmlHttpRequest->open(method, url, ec);
 
     if (ec)
         return throwError(ec);
@@ -127,7 +98,7 @@
     return v8::Undefined();
 }
 
-static bool IsDocumentType(v8::Handle<v8::Value> value)
+static bool isDocumentType(v8::Handle<v8::Value> value)
 {
     // FIXME: add other document types.
     return V8Document::HasInstance(value) || V8HTMLDocument::HasInstance(value);
@@ -143,7 +114,9 @@
         xmlHttpRequest->send(ec);
     else {
         v8::Handle<v8::Value> arg = args[0];
-        if (IsDocumentType(arg)) {
+        if (isUndefinedOrNull(arg))
+            xmlHttpRequest->send(ec);
+        else if (isDocumentType(arg)) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             Document* document = V8Document::toNative(object);
             ASSERT(document);
@@ -153,6 +126,11 @@
             Blob* blob = V8Blob::toNative(object);
             ASSERT(blob);
             xmlHttpRequest->send(blob, ec);
+        } else if (V8DOMFormData::HasInstance(arg)) {
+            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+            DOMFormData* domFormData = V8DOMFormData::toNative(object);
+            ASSERT(domFormData);
+            xmlHttpRequest->send(domFormData, ec);
         } else
             xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec);
     }
@@ -206,10 +184,4 @@
     return v8::Undefined();
 }
 
-v8::Handle<v8::Value> V8XMLHttpRequest::dispatchEventCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequest.dispatchEvent()");
-    return v8::Undefined();
-}
-
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
deleted file mode 100644
index c6c31bf..0000000
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 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 "V8XMLHttpRequestUpload.h"
-
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8Proxy.h"
-#include "V8Utilities.h"
-#include "XMLHttpRequest.h"
-#include "XMLHttpRequestUpload.h"
-
-#include <wtf/Assertions.h>
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8XMLHttpRequestUpload::addEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequestUpload.addEventListener()");
-    XMLHttpRequestUpload* xmlHttpRequestUpload = V8XMLHttpRequestUpload::toNative(args.Holder());
-
-    XMLHttpRequest* xmlHttpRequest = xmlHttpRequestUpload->associatedXMLHttpRequest();
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOrCreate);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        xmlHttpRequestUpload->addEventListener(type, listener, useCapture);
-
-        createHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8XMLHttpRequestUpload::removeEventListenerCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequestUpload.removeEventListener()");
-    XMLHttpRequestUpload* xmlHttpRequestUpload = V8XMLHttpRequestUpload::toNative(args.Holder());
-
-    XMLHttpRequest* xmlHttpRequest = xmlHttpRequestUpload->associatedXMLHttpRequest();
-
-    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(xmlHttpRequest, args[1], false, ListenerFindOnly);
-    if (listener) {
-        String type = toWebCoreString(args[0]);
-        bool useCapture = args[2]->BooleanValue();
-        xmlHttpRequestUpload->removeEventListener(type, listener.get(), useCapture);
-
-        removeHiddenDependency(args.Holder(), args[1], cacheIndex);
-    }
-
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8XMLHttpRequestUpload::dispatchEventCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.XMLHttpRequestUpload.dispatchEvent()");
-    return throwError(NOT_SUPPORTED_ERR);
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp b/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp
index 89f804c..b624fcf 100644
--- a/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp
@@ -49,7 +49,7 @@
 v8::Handle<v8::Value> V8XSLTProcessor::constructorCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.XSLTProcessor.Constructor");
-    return V8Proxy::constructDOMObject<V8ClassIndex::XSLTPROCESSOR, XSLTProcessor>(args);
+    return V8Proxy::constructDOMObject<XSLTProcessor>(args, &info);
 }
 
 
diff --git a/WebCore/bindings/v8/test/TestObj.idl b/WebCore/bindings/v8/test/TestObj.idl
new file mode 100644
index 0000000..662ac64
--- /dev/null
+++ b/WebCore/bindings/v8/test/TestObj.idl
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS 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.
+ */
+
+// This IDL file is for testing the V8 generator and for tracking changes
+// in its ouput.
+module test {
+    interface TestObj {
+        // Attributes
+        readonly attribute long            readOnlyIntAttr;
+        readonly attribute DOMString       readOnlyStringAttr;
+        readonly attribute TestObj         readOnlyTestObjAttr;
+        attribute long                     intAttr;
+        attribute DOMString                stringAttr;
+        attribute TestObj                  testObjAttr;
+
+        // Methods
+        void    voidMethod();
+        void    voidMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
+        long    intMethod();
+        long    intMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
+        TestObj objMethod();
+        TestObj objMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
+
+        // Exceptions
+        void    methodWithException() raises(DOMException);
+        attribute long attrWithException raises(DOMException);
+        attribute long attrWithSetterException getraises(DOMException);
+        attribute long attrWithGetterException setraises(DOMException);
+
+        // 'Custom' extended attribute
+        attribute [Custom] long            customAttr;
+        [Custom] void customMethod();
+        [Custom] void customMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
+
+        // 'Optional' extended attribute
+        void    methodWithOptionalArg(in [Optional] long opt);
+        void    methodWithNonOptionalArgAndOptionalArg(in long nonOpt, in [Optional] long opt);
+        void    methodWithNonOptionalArgAndTwoOptionalArgs(in long nonOpt, in [Optional] long opt1, in long opt2);
+
+        // Overloads
+        void    overloadedMethod(in TestObj objArg, in DOMString strArg);
+        void    overloadedMethod(in TestObj objArg, in [Optional] long intArg);
+        void    overloadedMethod(in DOMString strArg);
+        void    overloadedMethod(in long intArg);
+    };
+}
diff --git a/WebCore/bindings/v8/test/V8TestObj.cpp b/WebCore/bindings/v8/test/V8TestObj.cpp
new file mode 100644
index 0000000..d51884e
--- /dev/null
+++ b/WebCore/bindings/v8/test/V8TestObj.cpp
@@ -0,0 +1,459 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    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., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestObj.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingState.h"
+#include "V8DOMWrapper.h"
+#include "V8IsolatedContext.h"
+#include "V8Proxy.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0 };
+
+namespace TestObjInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> readOnlyIntAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.readOnlyIntAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8::Integer::New(imp->readOnlyIntAttr());
+}
+
+static v8::Handle<v8::Value> readOnlyStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.readOnlyStringAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8String(imp->readOnlyStringAttr());
+}
+
+static v8::Handle<v8::Value> readOnlyTestObjAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.readOnlyTestObjAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    RefPtr<TestObj> result = imp->readOnlyTestObjAttr();
+    v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>();
+    if (wrapper.IsEmpty()) {
+        wrapper = toV8(result.get());
+        if (!wrapper.IsEmpty())
+            V8DOMWrapper::setHiddenReference(info.Holder(), wrapper);
+    }
+    return wrapper;
+}
+
+static v8::Handle<v8::Value> intAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.intAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8::Integer::New(imp->intAttr());
+}
+
+static void intAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.intAttr._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    int v = toInt32(value);
+    imp->setIntAttr(v);
+    return;
+}
+
+static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.stringAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8String(imp->stringAttr());
+}
+
+static void stringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.stringAttr._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    V8Parameter<> v = value;
+    imp->setStringAttr(v);
+    return;
+}
+
+static v8::Handle<v8::Value> testObjAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.testObjAttr._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return toV8(imp->testObjAttr());
+}
+
+static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.testObjAttr._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+    imp->setTestObjAttr(WTF::getPtr(v));
+    return;
+}
+
+static v8::Handle<v8::Value> attrWithExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithException._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8::Integer::New(imp->attrWithException());
+}
+
+static void attrWithExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithException._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    int v = toInt32(value);
+    imp->setAttrWithException(v);
+    return;
+}
+
+static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithSetterException._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8::Integer::New(imp->attrWithSetterException());
+}
+
+static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithSetterException._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    int v = toInt32(value);
+    imp->setAttrWithSetterException(v);
+    return;
+}
+
+static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithGetterException._get");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    return v8::Integer::New(imp->attrWithGetterException());
+}
+
+static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.TestObj.attrWithGetterException._set");
+    TestObj* imp = V8TestObj::toNative(info.Holder());
+    int v = toInt32(value);
+    imp->setAttrWithGetterException(v);
+    return;
+}
+
+static v8::Handle<v8::Value> voidMethodCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.voidMethod");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    imp->voidMethod();
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> voidMethodWithArgsCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.voidMethodWithArgs");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int intArg = toInt32(args[0]);
+    V8Parameter<> strArg = args[1];
+    TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+    imp->voidMethodWithArgs(intArg, strArg, objArg);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> intMethodCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.intMethod");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    return v8::Integer::New(imp->intMethod());
+}
+
+static v8::Handle<v8::Value> intMethodWithArgsCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.intMethodWithArgs");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int intArg = toInt32(args[0]);
+    V8Parameter<> strArg = args[1];
+    TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+    return v8::Integer::New(imp->intMethodWithArgs(intArg, strArg, objArg));
+}
+
+static v8::Handle<v8::Value> objMethodCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.objMethod");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    return toV8(imp->objMethod());
+}
+
+static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.objMethodWithArgs");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int intArg = toInt32(args[0]);
+    V8Parameter<> strArg = args[1];
+    TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+    return toV8(imp->objMethodWithArgs(intArg, strArg, objArg));
+}
+
+static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.methodWithException");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    ExceptionCode ec = 0;
+    {
+    imp->methodWithException(ec);
+    if (UNLIKELY(ec))
+        goto fail;
+    return v8::Handle<v8::Value>();
+    }
+    fail:
+    V8Proxy::setDOMException(ec);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> methodWithOptionalArgCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.methodWithOptionalArg");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    if (args.Length() <= 0) {
+        imp->methodWithOptionalArg();
+        return v8::Handle<v8::Value>();
+    }
+    int opt = toInt32(args[0]);
+    imp->methodWithOptionalArg(opt);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndOptionalArg");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int nonOpt = toInt32(args[0]);
+    if (args.Length() <= 1) {
+        imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
+        return v8::Handle<v8::Value>();
+    }
+    int opt = toInt32(args[1]);
+    imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndTwoOptionalArgs");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int nonOpt = toInt32(args[0]);
+    if (args.Length() <= 1) {
+        imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
+        return v8::Handle<v8::Value>();
+    }
+    int opt1 = toInt32(args[1]);
+    int opt2 = toInt32(args[2]);
+    imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.overloadedMethod1");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    TestObj* objArg = V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    V8Parameter<> strArg = args[1];
+    imp->overloadedMethod(objArg, strArg);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> overloadedMethod2Callback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.overloadedMethod2");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    TestObj* objArg = V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    if (args.Length() <= 1) {
+        imp->overloadedMethod(objArg);
+        return v8::Handle<v8::Value>();
+    }
+    int intArg = toInt32(args[1]);
+    imp->overloadedMethod(objArg, intArg);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> overloadedMethod3Callback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.overloadedMethod3");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    V8Parameter<> strArg = args[0];
+    imp->overloadedMethod(strArg);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> overloadedMethod4Callback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.overloadedMethod4");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    int intArg = toInt32(args[0]);
+    imp->overloadedMethod(intArg);
+    return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.overloadedMethod");
+    if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0])) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
+        return overloadedMethod1Callback(args);
+    if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))) || (args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0]))))
+        return overloadedMethod2Callback(args);
+    if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
+        return overloadedMethod3Callback(args);
+    if (args.Length() == 1)
+        return overloadedMethod4Callback(args);
+    V8Proxy::setDOMException(SYNTAX_ERR);
+    return notHandledByInterceptor();
+}
+
+} // namespace TestObjInternal
+
+static const BatchedAttribute TestObjAttrs[] = {
+    // Attribute 'readOnlyIntAttr' (Type: 'readonly attribute' ExtAttr: '')
+    {"readOnlyIntAttr", TestObjInternal::readOnlyIntAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'readOnlyStringAttr' (Type: 'readonly attribute' ExtAttr: '')
+    {"readOnlyStringAttr", TestObjInternal::readOnlyStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'readOnlyTestObjAttr' (Type: 'readonly attribute' ExtAttr: '')
+    {"readOnlyTestObjAttr", TestObjInternal::readOnlyTestObjAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'intAttr' (Type: 'attribute' ExtAttr: '')
+    {"intAttr", TestObjInternal::intAttrAttrGetter, TestObjInternal::intAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '')
+    {"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
+    {"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'attrWithException' (Type: 'attribute' ExtAttr: '')
+    {"attrWithException", TestObjInternal::attrWithExceptionAttrGetter, TestObjInternal::attrWithExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
+    {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '')
+    {"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    // Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
+    {"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+};
+static const BatchedCallback TestObjCallbacks[] = {
+    {"voidMethod", TestObjInternal::voidMethodCallback},
+    {"intMethod", TestObjInternal::intMethodCallback},
+    {"objMethod", TestObjInternal::objMethodCallback},
+    {"methodWithException", TestObjInternal::methodWithExceptionCallback},
+    {"customMethod", V8TestObj::customMethodCallback},
+    {"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
+    {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback},
+    {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback},
+    {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback},
+    {"overloadedMethod", TestObjInternal::overloadedMethodCallback},
+};
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestObj", v8::Persistent<v8::FunctionTemplate>(), V8TestObj::internalFieldCount,
+        TestObjAttrs, sizeof(TestObjAttrs) / sizeof(*TestObjAttrs),
+        TestObjCallbacks, sizeof(TestObjCallbacks) / sizeof(*TestObjCallbacks));
+    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+    
+
+    // Custom Signature 'voidMethodWithArgs'
+    const int voidMethodWithArgsArgc = 3;
+    v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
+    v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
+    proto->Set(v8::String::New("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::voidMethodWithArgsCallback, v8::Handle<v8::Value>(), voidMethodWithArgsSignature));
+
+    // Custom Signature 'intMethodWithArgs'
+    const int intMethodWithArgsArgc = 3;
+    v8::Handle<v8::FunctionTemplate> intMethodWithArgsArgv[intMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
+    v8::Handle<v8::Signature> intMethodWithArgsSignature = v8::Signature::New(desc, intMethodWithArgsArgc, intMethodWithArgsArgv);
+    proto->Set(v8::String::New("intMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::intMethodWithArgsCallback, v8::Handle<v8::Value>(), intMethodWithArgsSignature));
+
+    // Custom Signature 'objMethodWithArgs'
+    const int objMethodWithArgsArgc = 3;
+    v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
+    v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
+    proto->Set(v8::String::New("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjInternal::objMethodWithArgsCallback, v8::Handle<v8::Value>(), objMethodWithArgsSignature));
+
+    // Custom toString template
+    desc->Set(getToStringName(), getToStringTemplate());
+    return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestObj::GetRawTemplate()
+{
+    static v8::Persistent<v8::FunctionTemplate> V8TestObjRawCache = createRawTemplate();
+    return V8TestObjRawCache;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
+{
+    static v8::Persistent<v8::FunctionTemplate> V8TestObjCache = ConfigureV8TestObjTemplate(GetRawTemplate());
+    return V8TestObjCache;
+}
+
+TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)
+{
+    return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+}
+
+bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
+{
+    return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+{
+    v8::Handle<v8::Object> wrapper;
+    V8Proxy* proxy = 0;
+        wrapper = getDOMObjectMap().get(impl);
+        if (!wrapper.IsEmpty())
+            return wrapper;
+    wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+    if (wrapper.IsEmpty())
+        return wrapper;
+
+    impl->ref();
+    getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper));
+    return wrapper;
+}
+
+v8::Handle<v8::Value> toV8(PassRefPtr<TestObj > impl)
+{
+    return toV8(impl.get());
+}
+
+v8::Handle<v8::Value> toV8(TestObj* impl)
+{
+    if (!impl)
+        return v8::Null();
+    return V8TestObj::wrap(impl);
+}
+
+void V8TestObj::derefObject(void* object)
+{
+    static_cast<TestObj*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/test/V8TestObj.h b/WebCore/bindings/v8/test/V8TestObj.h
new file mode 100644
index 0000000..5d6770a
--- /dev/null
+++ b/WebCore/bindings/v8/test/V8TestObj.h
@@ -0,0 +1,53 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    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., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestObj_h
+#define V8TestObj_h
+
+#include "StringHash.h"
+#include "TestObj.h"
+#include "WrapperTypeInfo.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+class V8TestObj {
+
+public:
+    static bool HasInstance(v8::Handle<v8::Value> value);
+    static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+    static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+    static TestObj* toNative(v8::Handle<v8::Object>);
+    static v8::Handle<v8::Object> wrap(TestObj*);
+    static void derefObject(void*);
+    static WrapperTypeInfo info;
+    static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&);
+    static v8::Handle<v8::Value> customMethodWithArgsCallback(const v8::Arguments&);
+    static v8::Handle<v8::Value> customAttrAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
+    static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+};
+
+v8::Handle<v8::Value> toV8(TestObj*);
+v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >);
+}
+
+#endif // V8TestObj_h
diff --git a/WebCore/bindings/v8/test/run_tests.py b/WebCore/bindings/v8/test/run_tests.py
new file mode 100644
index 0000000..e27d559
--- /dev/null
+++ b/WebCore/bindings/v8/test/run_tests.py
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+#
+# 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:
+# 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 COMPUTER, 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.
+#
+
+# This script generates h and cpp file for TestObj.idl using the V8 code
+# generator. Please execute the script whenever changes are made to
+# CodeGeneratorV8.pm, and submit the changes in V8TestObj.h/cpp in the same
+# patch. This makes it easier to track and review changes in generated code.
+# To execute, invoke: 'python run_tests.py'
+
+import os
+import sys
+
+
+def test(idlFilePath):
+    cmd = ['perl', '-w',
+         '-I../../scripts',
+         '../../scripts/generate-bindings.pl',
+         # idl include directories (path relative to generate-bindings.pl)
+         '--include .',
+         # place holder for defines (generate-bindings.pl requires it)
+         '--defines xxx',
+         '--generator V8',
+         '--outputDir .',
+         idlFilePath]
+    os.system(' '.join(cmd))
+
+
+def main(argv):
+    scriptDir = os.path.dirname(__file__)
+    os.chdir(scriptDir)
+    test('TestObj.idl')
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
diff --git a/WebCore/bridge/IdentifierRep.cpp b/WebCore/bridge/IdentifierRep.cpp
index 11560e3..bc599de 100644
--- a/WebCore/bridge/IdentifierRep.cpp
+++ b/WebCore/bridge/IdentifierRep.cpp
@@ -25,6 +25,7 @@
 
 #include "config.h"
 #include "IdentifierRep.h"
+#include "JSDOMBinding.h"
 
 #include "PlatformString.h"
 #include <runtime/UString.h>
@@ -91,7 +92,7 @@
     if (!name)
         return 0;
   
-    UString string = String::fromUTF8WithLatin1Fallback(name, strlen(name));
+    UString string = stringToUString(String::fromUTF8WithLatin1Fallback(name, strlen(name)));
     pair<StringIdentifierMap::iterator, bool> result = stringIdentifierMap().add(string.rep(), 0);
     if (result.second) {
         ASSERT(!result.first->second);
diff --git a/WebCore/bridge/NP_jsobject.cpp b/WebCore/bridge/NP_jsobject.cpp
index 2b1d17f..d983f6a 100644
--- a/WebCore/bridge/NP_jsobject.cpp
+++ b/WebCore/bridge/NP_jsobject.cpp
@@ -230,7 +230,7 @@
             return false;
         ExecState* exec = rootObject->globalObject()->globalExec();
         JSLock lock(SilenceAssertionsOnly);
-        JSValue function = obj->imp->get(exec, identifierFromNPIdentifier(i->string()));
+        JSValue function = obj->imp->get(exec, identifierFromNPIdentifier(exec, i->string()));
         CallData callData;
         CallType callType = function.getCallData(callData);
         if (callType == CallTypeNone)
@@ -311,7 +311,7 @@
         JSLock lock(SilenceAssertionsOnly);
         JSValue result;
         if (i->isString())
-            result = obj->imp->get(exec, identifierFromNPIdentifier(i->string()));
+            result = obj->imp->get(exec, identifierFromNPIdentifier(exec, i->string()));
         else
             result = obj->imp->get(exec, i->number());
 
@@ -345,7 +345,7 @@
 
         if (i->isString()) {
             PutPropertySlot slot;
-            obj->imp->put(exec, identifierFromNPIdentifier(i->string()), convertNPVariantToValue(exec, variant, rootObject), slot);
+            obj->imp->put(exec, identifierFromNPIdentifier(exec, i->string()), convertNPVariantToValue(exec, variant, rootObject), slot);
         } else
             obj->imp->put(exec, i->number(), convertNPVariantToValue(exec, variant, rootObject));
         exec->clearException();
@@ -370,7 +370,7 @@
         ExecState* exec = rootObject->globalObject()->globalExec();
         IdentifierRep* i = static_cast<IdentifierRep*>(propertyName);
         if (i->isString()) {
-            if (!obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->string()))) {
+            if (!obj->imp->hasProperty(exec, identifierFromNPIdentifier(exec, i->string()))) {
                 exec->clearException();
                 return false;
             }
@@ -383,7 +383,7 @@
 
         JSLock lock(SilenceAssertionsOnly);
         if (i->isString())
-            obj->imp->deleteProperty(exec, identifierFromNPIdentifier(i->string()));
+            obj->imp->deleteProperty(exec, identifierFromNPIdentifier(exec, i->string()));
         else
             obj->imp->deleteProperty(exec, i->number());
 
@@ -406,7 +406,7 @@
         IdentifierRep* i = static_cast<IdentifierRep*>(propertyName);
         JSLock lock(SilenceAssertionsOnly);
         if (i->isString()) {
-            bool result = obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->string()));
+            bool result = obj->imp->hasProperty(exec, identifierFromNPIdentifier(exec, i->string()));
             exec->clearException();
             return result;
         }
@@ -437,7 +437,7 @@
 
         ExecState* exec = rootObject->globalObject()->globalExec();
         JSLock lock(SilenceAssertionsOnly);
-        JSValue func = obj->imp->get(exec, identifierFromNPIdentifier(i->string()));
+        JSValue func = obj->imp->get(exec, identifierFromNPIdentifier(exec, i->string()));
         exec->clearException();
         return !func.isUndefined();
     }
@@ -474,7 +474,7 @@
         NPIdentifier* identifiers = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier) * size));
         
         for (unsigned i = 0; i < size; ++i)
-            identifiers[i] = _NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().c_str());
+            identifiers[i] = _NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().data());
 
         *identifier = identifiers;
         *count = size;
diff --git a/WebCore/bridge/c/CRuntimeObject.cpp b/WebCore/bridge/c/CRuntimeObject.cpp
new file mode 100644
index 0000000..47425a2
--- /dev/null
+++ b/WebCore/bridge/c/CRuntimeObject.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 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"
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
+#include "CRuntimeObject.h"
+#include "c_instance.h"
+
+namespace JSC {
+namespace Bindings {
+
+const ClassInfo CRuntimeObject::s_info = { "CRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+
+CRuntimeObject::CRuntimeObject(ExecState* exec, PassRefPtr<CInstance> instance)
+    : RuntimeObject(exec, instance)
+{
+}
+
+CRuntimeObject::~CRuntimeObject()
+{
+}
+
+CInstance* CRuntimeObject::getInternalCInstance() const
+{
+    return static_cast<CInstance*>(getInternalInstance());
+}
+
+
+}
+}
+
+#endif
diff --git a/WebCore/bridge/c/CRuntimeObject.h b/WebCore/bridge/c/CRuntimeObject.h
new file mode 100644
index 0000000..b53387a
--- /dev/null
+++ b/WebCore/bridge/c/CRuntimeObject.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 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 CRuntimeObject_h
+#define CRuntimeObject_h
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
+#include "runtime_object.h"
+
+namespace JSC {
+namespace Bindings {
+
+class CInstance;
+
+class CRuntimeObject : public RuntimeObject {
+public:
+    CRuntimeObject(ExecState*, PassRefPtr<CInstance>);
+    virtual ~CRuntimeObject();
+
+    CInstance* getInternalCInstance() const;
+
+    static const ClassInfo s_info;
+
+private:
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+};
+
+}
+}
+
+#endif
+#endif
diff --git a/WebCore/bridge/c/c_class.cpp b/WebCore/bridge/c/c_class.cpp
index e8499cb..ea71638 100644
--- a/WebCore/bridge/c/c_class.cpp
+++ b/WebCore/bridge/c/c_class.cpp
@@ -34,6 +34,7 @@
 #include "npruntime_impl.h"
 #include <runtime/Identifier.h>
 #include <runtime/JSLock.h>
+#include <wtf/text/StringHash.h>
 
 namespace JSC { namespace Bindings {
 
diff --git a/WebCore/bridge/c/c_instance.cpp b/WebCore/bridge/c/c_instance.cpp
index 1b05259..7dbc1d9 100644
--- a/WebCore/bridge/c/c_instance.cpp
+++ b/WebCore/bridge/c/c_instance.cpp
@@ -29,15 +29,17 @@
 
 #include "c_instance.h"
 
+#include "CRuntimeObject.h"
+#include "IdentifierRep.h"
 #include "c_class.h"
 #include "c_runtime.h"
 #include "c_utility.h"
-#include "IdentifierRep.h"
 #include "npruntime_impl.h"
+#include "runtime_method.h"
 #include "runtime_root.h"
+#include <interpreter/CallFrame.h>
 #include <runtime/ArgList.h>
 #include <runtime/Error.h>
-#include <interpreter/CallFrame.h>
 #include <runtime/JSLock.h>
 #include <runtime/JSNumberCell.h>
 #include <runtime/PropertyNameArray.h>
@@ -89,6 +91,11 @@
     _NPN_ReleaseObject(_object);
 }
 
+RuntimeObject* CInstance::newRuntimeObject(ExecState* exec)
+{
+    return new (exec) CRuntimeObject(exec, this);
+}
+
 Class *CInstance::getClass() const
 {
     if (!_class)
@@ -101,8 +108,33 @@
     return _object->_class->invokeDefault;
 }
 
-JSValue CInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList& args)
+class CRuntimeMethod : public RuntimeMethod {
+public:
+    CRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)
+        : RuntimeMethod(exec, name, list)
+    {
+    }
+
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+
+    static const ClassInfo s_info;
+};
+
+const ClassInfo CRuntimeMethod::s_info = { "CRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+
+JSValue CInstance::getMethod(ExecState* exec, const Identifier& propertyName)
 {
+    MethodList methodList = getClass()->methodsNamed(propertyName, this);
+    return new (exec) CRuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue CInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod, const ArgList& args)
+{
+    if (!asObject(runtimeMethod)->inherits(&CRuntimeMethod::s_info))
+        return throwError(exec, TypeError, "Attempt to invoke non-plug-in method on plug-in object.");
+
+    const MethodList& methodList = *runtimeMethod->methods();
+
     // Overloading methods are not allowed by NPObjects.  Should only be one
     // name match for a particular method.
     ASSERT(methodList.size() == 1);
@@ -271,7 +303,7 @@
         IdentifierRep* identifier = static_cast<IdentifierRep*>(identifiers[i]);
 
         if (identifier->isString())
-            nameArray.add(identifierFromNPIdentifier(identifier->string()));
+            nameArray.add(identifierFromNPIdentifier(exec, identifier->string()));
         else
             nameArray.add(Identifier::from(exec, identifier->number()));
     }
diff --git a/WebCore/bridge/c/c_instance.h b/WebCore/bridge/c/c_instance.h
index abbabad..be4a4cb 100644
--- a/WebCore/bridge/c/c_instance.h
+++ b/WebCore/bridge/c/c_instance.h
@@ -59,7 +59,8 @@
     virtual JSValue valueOf(ExecState*) const;
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
 
-    virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList&);
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
+    virtual JSValue invokeMethod(ExecState*, RuntimeMethod* method, const ArgList&);
     virtual bool supportsInvokeDefaultMethod() const;
     virtual JSValue invokeDefaultMethod(ExecState*, const ArgList&);
 
@@ -77,6 +78,8 @@
 private:
     CInstance(NPObject*, PassRefPtr<RootObject>);
 
+    virtual RuntimeObject* newRuntimeObject(ExecState*);
+
     mutable CClass *_class;
     NPObject *_object;
 };
diff --git a/WebCore/bridge/c/c_utility.cpp b/WebCore/bridge/c/c_utility.cpp
index 7ff77e7..3e65eb9 100644
--- a/WebCore/bridge/c/c_utility.cpp
+++ b/WebCore/bridge/c/c_utility.cpp
@@ -30,6 +30,7 @@
 
 #include "c_utility.h"
 
+#include "CRuntimeObject.h"
 #include "JSDOMWindow.h"
 #include "NP_jsobject.h"
 #include "c_instance.h"
@@ -75,7 +76,7 @@
     if (value.isString()) {
         UString ustring = value.toString(exec);
         CString cstring = ustring.UTF8String();
-        NPString string = { (const NPUTF8*)cstring.c_str(), static_cast<uint32_t>(cstring.size()) };
+        NPString string = { (const NPUTF8*)cstring.data(), static_cast<uint32_t>(cstring.length()) };
         NPN_InitializeVariantWithStringCopy(result, &string);
     } else if (value.isNumber()) {
         DOUBLE_TO_NPVARIANT(value.toNumber(exec), *result);
@@ -85,9 +86,9 @@
         NULL_TO_NPVARIANT(*result);
     } else if (value.isObject()) {
         JSObject* object = asObject(value);
-        if (object->classInfo() == &RuntimeObjectImp::s_info) {
-            RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
-            CInstance* instance = static_cast<CInstance*>(imp->getInternalInstance());
+        if (object->classInfo() == &CRuntimeObject::s_info) {
+            CRuntimeObject* runtimeObject = static_cast<CRuntimeObject*>(object);
+            CInstance* instance = runtimeObject->getInternalCInstance();
             if (instance) {
                 NPObject* obj = instance->getObject();
                 _NPN_RetainObject(obj);
@@ -142,9 +143,9 @@
     return String::fromUTF8WithLatin1Fallback(string->UTF8Characters, string->UTF8Length);
 }
 
-Identifier identifierFromNPIdentifier(const NPUTF8* name)
+Identifier identifierFromNPIdentifier(ExecState* exec, const NPUTF8* name)
 {
-    return Identifier(WebCore::JSDOMWindow::commonJSGlobalData(), convertUTF8ToUTF16WithLatin1Fallback(name, -1));
+    return Identifier(exec, stringToUString(convertUTF8ToUTF16WithLatin1Fallback(name, -1)));
 }
 
 } }
diff --git a/WebCore/bridge/c/c_utility.h b/WebCore/bridge/c/c_utility.h
index f69bba6..6af8fb6 100644
--- a/WebCore/bridge/c/c_utility.h
+++ b/WebCore/bridge/c/c_utility.h
@@ -49,7 +49,7 @@
 WebCore::String convertNPStringToUTF16(const NPString *string);
 void convertValueToNPVariant(ExecState*, JSValue, NPVariant* result);
 JSValue convertNPVariantToValue(ExecState*, const NPVariant*, RootObject*);
-Identifier identifierFromNPIdentifier(const NPUTF8* name);
+Identifier identifierFromNPIdentifier(ExecState*, const NPUTF8* name);
 
 } }
 
diff --git a/WebCore/bridge/jni/JNIBridge.cpp b/WebCore/bridge/jni/JNIBridge.cpp
index f8a3979..28e8698 100644
--- a/WebCore/bridge/jni/JNIBridge.cpp
+++ b/WebCore/bridge/jni/JNIBridge.cpp
@@ -29,19 +29,10 @@
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 
-#include "CString.h"
 #include "StringBuilder.h"
+#include <wtf/text/CString.h>
 
 
-#ifdef NDEBUG
-#define JS_LOG(formatAndArgs...) ((void)0)
-#else
-#define JS_LOG(formatAndArgs...) { \
-    fprintf(stderr, "%s:%d -- %s:  ", __FILE__, __LINE__, __FUNCTION__); \
-    fprintf(stderr, formatAndArgs); \
-}
-#endif
-
 using namespace JSC;
 using namespace JSC::Bindings;
 using namespace WebCore;
diff --git a/WebCore/bridge/jni/JNIUtility.cpp b/WebCore/bridge/jni/JNIUtility.cpp
index e558955..ece39ed 100644
--- a/WebCore/bridge/jni/JNIUtility.cpp
+++ b/WebCore/bridge/jni/JNIUtility.cpp
@@ -77,7 +77,7 @@
     if (jniError == JNI_OK && nJVMs > 0)
         jvm = jvmArray[0];
     else
-        fprintf(stderr, "%s: JNI_GetCreatedJavaVMs failed, returned %ld\n", __PRETTY_FUNCTION__, static_cast<long>(jniError));
+        LOG_ERROR("JNI_GetCreatedJavaVMs failed, returned %ld", static_cast<long>(jniError));
 
     return jvm;
 }
@@ -93,7 +93,7 @@
     jniError = getJavaVM()->AttachCurrentThread(&u.dummy, 0);
     if (jniError == JNI_OK)
         return u.env;
-    fprintf(stderr, "%s: AttachCurrentThread failed, returned %ld\n", __PRETTY_FUNCTION__, static_cast<long>(jniError));
+    LOG_ERROR("AttachCurrentThread failed, returned %ld", static_cast<long>(jniError));
     return 0;
 }
 
@@ -319,10 +319,10 @@
                     result.d = env->functions->GetDoubleField(env, obj, field);
                     break;
                 default:
-                    fprintf(stderr, "%s: invalid field type (%d)\n", __PRETTY_FUNCTION__, static_cast<int>(type));
+                    LOG_ERROR("Invalid field type (%d)", static_cast<int>(type));
                 }
             } else {
-                fprintf(stderr, "%s: Could not find field: %s\n", __PRETTY_FUNCTION__, name);
+                LOG_ERROR("Could not find field: %s", name);
                 env->ExceptionDescribe();
                 env->ExceptionClear();
                 fprintf(stderr, "\n");
@@ -330,7 +330,7 @@
 
             env->DeleteLocalRef(cls);
         } else
-            fprintf(stderr, "%s: Could not find class for object\n", __PRETTY_FUNCTION__);
+            LOG_ERROR("Could not find class for object");
     }
 
     return result;
diff --git a/WebCore/bridge/jni/JNIUtility.h b/WebCore/bridge/jni/JNIUtility.h
index c832ef3..0eb889c 100644
--- a/WebCore/bridge/jni/JNIUtility.h
+++ b/WebCore/bridge/jni/JNIUtility.h
@@ -212,14 +212,14 @@
                 env->DeleteLocalRef(cls);
                 return JNICaller<T>::callV(obj, mid, args);
             }
-            fprintf(stderr, "%s: Could not find method: %s for %p\n", __PRETTY_FUNCTION__, name, obj);
+            LOG_ERROR("Could not find method: %s for %p", name, obj);
             env->ExceptionDescribe();
             env->ExceptionClear();
             fprintf(stderr, "\n");
 
             env->DeleteLocalRef(cls);
         } else
-            fprintf(stderr, "%s: Could not find class for %p\n", __PRETTY_FUNCTION__, obj);
+            LOG_ERROR("Could not find class for %p", obj);
     }
 
     return 0;
@@ -254,7 +254,7 @@
         if (mid)
             result = JNICaller<T>::callStaticV(cls, mid, args);
         else {
-            fprintf(stderr, "%s: Could not find method: %s for %p\n", __PRETTY_FUNCTION__, methodName, cls);
+            LOG_ERROR("Could not find method: %s for %p", methodName, cls);
             env->ExceptionDescribe();
             env->ExceptionClear();
             fprintf(stderr, "\n");
diff --git a/WebCore/bridge/jni/jni_jsobject.mm b/WebCore/bridge/jni/jni_jsobject.mm
index 603624f..5e036ab 100644
--- a/WebCore/bridge/jni/jni_jsobject.mm
+++ b/WebCore/bridge/jni/jni_jsobject.mm
@@ -29,10 +29,12 @@
 #if ENABLE(MAC_JAVA_BRIDGE)
 
 #include "Frame.h"
+#include "JavaRuntimeObject.h"
 #include "JNIBridge.h"
 #include "JNIUtility.h"
 #include "JNIUtilityPrivate.h"
 #include "JSDOMBinding.h"
+#include "Logging.h"
 #include "ScriptController.h"
 #include "StringSourceProvider.h"
 #include "WebCoreFrameView.h"
@@ -42,21 +44,12 @@
 #include <runtime/Completion.h>
 #include <runtime/JSGlobalObject.h>
 #include <runtime/JSLock.h>
-#include <wtf/Assertions.h>
 
 using WebCore::Frame;
 
 using namespace JSC::Bindings;
 using namespace JSC;
-
-#ifdef NDEBUG
-#define JS_LOG(formatAndArgs...) ((void)0)
-#else
-#define JS_LOG(formatAndArgs...) { \
-    fprintf (stderr, "%s(%p,%p):  ", __PRETTY_FUNCTION__, _performJavaScriptRunLoop, CFRunLoopGetCurrent()); \
-    fprintf(stderr, formatAndArgs); \
-}
-#endif
+using namespace WebCore;
 
 #define UndefinedHandle 1
 
@@ -68,12 +61,12 @@
 
 static void completedJavaScriptAccess (void *i)
 {
-    assert (CFRunLoopGetCurrent() != _performJavaScriptRunLoop);
+    ASSERT(CFRunLoopGetCurrent() != _performJavaScriptRunLoop);
     
     JSObjectCallContext *callContext = (JSObjectCallContext *)i;
     CFRunLoopRef runLoop = (CFRunLoopRef)callContext->originatingLoop;
     
-    assert (CFRunLoopGetCurrent() == runLoop);
+    ASSERT(CFRunLoopGetCurrent() == runLoop);
     
     CFRunLoopStop(runLoop);
 }
@@ -115,7 +108,7 @@
     
     CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
     
-    assert (currentRunLoop != _performJavaScriptRunLoop);
+    ASSERT(currentRunLoop != _performJavaScriptRunLoop);
     
     // Setup a source to signal once the invocation of the JavaScript
     // call completes.
@@ -144,7 +137,7 @@
 
 static void performJavaScriptAccess(void*)
 {
-    assert (CFRunLoopGetCurrent() == _performJavaScriptRunLoop);
+    ASSERT(CFRunLoopGetCurrent() == _performJavaScriptRunLoop);
     
     // Dispatch JavaScript calls here.
     CFRunLoopSourceContext sourceContext;
@@ -205,7 +198,7 @@
         else {
             JSObject *imp = jlong_to_impptr(nativeHandle);
             if (!findProtectingRootObject(imp)) {
-                fprintf (stderr, "%s:%d:  Attempt to access JavaScript from destroyed applet, type %d.\n", __FILE__, __LINE__, context->type);
+                LOG_ERROR("Attempt to access JavaScript from destroyed applet, type %d.", context->type);
                 return result;
             }
 
@@ -256,7 +249,7 @@
                 }
                 
                 default: {
-                    fprintf (stderr, "%s:  invalid JavaScript call\n", __PRETTY_FUNCTION__);
+                    LOG_ERROR("invalid JavaScript call");
                 }
             }
         }
@@ -283,7 +276,7 @@
 
 jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
 {
-    JS_LOG ("methodName = %s\n", JavaString(methodName).UTF8String());
+    LOG(LiveConnect, "JavaJSObject::call methodName = %s", JavaString(methodName).UTF8String());
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -312,7 +305,7 @@
 
 jobject JavaJSObject::eval(jstring script) const
 {
-    JS_LOG ("script = %s\n", JavaString(script).UTF8String());
+    LOG(LiveConnect, "JavaJSObject::eval script = %s", JavaString(script).UTF8String());
     
     JSValue result;
 
@@ -339,7 +332,7 @@
 
 jobject JavaJSObject::getMember(jstring memberName) const
 {
-    JS_LOG ("(%p) memberName = %s\n", _imp, JavaString(memberName).UTF8String());
+    LOG(LiveConnect, "JavaJSObject::getMember (%p) memberName = %s", _imp, JavaString(memberName).UTF8String());
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -355,7 +348,7 @@
 
 void JavaJSObject::setMember(jstring memberName, jobject value) const
 {
-    JS_LOG ("memberName = %s, value = %p\n", JavaString(memberName).UTF8String(), value);
+    LOG(LiveConnect, "JavaJSObject::setMember memberName = %s, value = %p", JavaString(memberName).UTF8String(), value);
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -371,7 +364,7 @@
 
 void JavaJSObject::removeMember(jstring memberName) const
 {
-    JS_LOG ("memberName = %s\n", JavaString(memberName).UTF8String());
+    LOG(LiveConnect, "JavaJSObject::removeMember memberName = %s", JavaString(memberName).UTF8String());
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -385,11 +378,7 @@
 
 jobject JavaJSObject::getSlot(jint index) const
 {
-#ifdef __LP64__
-    JS_LOG ("index = %d\n", index);
-#else
-    JS_LOG ("index = %ld\n", index);
-#endif
+    LOG(LiveConnect, "JavaJSObject::getSlot index = %ld", static_cast<long>(index));
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -406,11 +395,7 @@
 
 void JavaJSObject::setSlot(jint index, jobject value) const
 {
-#ifdef __LP64__
-    JS_LOG ("index = %d, value = %p\n", index, value);
-#else
-    JS_LOG ("index = %ld, value = %p\n", index, value);
-#endif
+    LOG(LiveConnect, "JavaJSObject::setSlot index = %ld, value = %p", static_cast<long>(index), value);
 
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -424,7 +409,7 @@
 
 jstring JavaJSObject::toString() const
 {
-    JS_LOG ("\n");
+    LOG(LiveConnect, "JavaJSObject::toString");
     
     RootObject* rootObject = this->rootObject();
     if (!rootObject)
@@ -434,7 +419,7 @@
     JSObject *thisObj = const_cast<JSObject*>(_imp);
     ExecState* exec = rootObject->globalObject()->globalExec();
     
-    return (jstring)convertValueToJValue (exec, thisObj, object_type, "java.lang.String").l;
+    return static_cast<jstring>(convertValueToJValue(exec, rootObject, thisObj, object_type, "java.lang.String").l);
 }
 
 void JavaJSObject::finalize() const
@@ -462,7 +447,7 @@
 // another JavaJSObject.
 jlong JavaJSObject::createNative(jlong nativeHandle)
 {
-    JS_LOG ("nativeHandle = %d\n", (int)nativeHandle);
+    LOG(LiveConnect, "JavaJSObject::createNative nativeHandle = %d", static_cast<int>(nativeHandle));
 
     if (nativeHandle == UndefinedHandle)
         return nativeHandle;
@@ -528,27 +513,25 @@
         jlong nativeHandle;
         
         if (value.isObject()) {
-            JSObject* imp = asObject(value);
+            JSObject* object = asObject(value);
             
             // We either have a wrapper around a Java instance or a JavaScript
             // object.  If we have a wrapper around a Java instance, return that
             // instance, otherwise create a new Java JavaJSObject with the JSObject*
             // as its nativeHandle.
-            if (imp->classInfo() && strcmp(imp->classInfo()->className, "RuntimeObject") == 0) {
-                RuntimeObjectImp* runtimeImp = static_cast<RuntimeObjectImp*>(imp);
-                JavaInstance *runtimeInstance = static_cast<JavaInstance *>(runtimeImp->getInternalInstance());
+            if (object->inherits(&JavaRuntimeObject::s_info)) {
+                JavaRuntimeObject* runtimeObject = static_cast<JavaRuntimeObject*>(object);
+                JavaInstance* runtimeInstance = runtimeObject->getInternalJavaInstance();
                 if (!runtimeInstance)
                     return 0;
                 
                 return runtimeInstance->javaInstance();
+            } else {
+                nativeHandle = ptr_to_jlong(object);
+                rootObject->gcProtect(object);
             }
-            else {
-                nativeHandle = ptr_to_jlong(imp);
-                rootObject->gcProtect(imp);
-            }
-        }
+        } else {
         // All other types will result in an undefined object.
-        else {
             nativeHandle = UndefinedHandle;
         }
         
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
index 8776cd2..6de1011 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
@@ -30,22 +30,14 @@
 #if ENABLE(MAC_JAVA_BRIDGE)
 
 #include "JNIUtilityPrivate.h"
+#include "Logging.h"
 #include "runtime_array.h"
 #include "runtime_object.h"
 #include <runtime/Error.h>
 
-#ifdef NDEBUG
-#define JS_LOG(formatAndArgs...) ((void)0)
-#else
-#define JS_LOG(formatAndArgs...) { \
-    fprintf(stderr, "%s:%d -- %s:  ", __FILE__, __LINE__, __FUNCTION__); \
-    fprintf(stderr, formatAndArgs); \
-}
-#endif
-
 using namespace JSC;
 using namespace JSC::Bindings;
-
+using namespace WebCore;
 
 JavaField::JavaField(JNIEnv* env, jobject aField)
 {
@@ -116,6 +108,9 @@
             jvalue result = dispatchValueFromInstance(exec, instance, "get", "(Ljava/lang/Object;)Ljava/lang/Object;", object_type);
             jobject anObject = result.l;
 
+            if (!anObject)
+                return jsNull();
+
             const char* arrayType = type();
             if (arrayType[0] == '[')
                 jsresult = JavaArray::convertJObjectToArray(exec, anObject, arrayType, instance->rootObject());
@@ -155,7 +150,7 @@
         break;
     }
 
-    JS_LOG("getting %s = %s\n", UString(name()).UTF8String().c_str(), jsresult.toString(exec).ascii());
+    LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name()).UTF8String().data(), jsresult.toString(exec).ascii());
 
     return jsresult;
 }
@@ -189,9 +184,9 @@
 void JavaField::setValueToInstance(ExecState* exec, const Instance* i, JSValue aValue) const
 {
     const JavaInstance* instance = static_cast<const JavaInstance*>(i);
-    jvalue javaValue = convertValueToJValue(exec, aValue, m_JNIType, type());
+    jvalue javaValue = convertValueToJValue(exec, i->rootObject(), aValue, m_JNIType, type());
 
-    JS_LOG("setting value %s to %s\n", UString(name()).UTF8String().c_str(), aValue.toString(exec).ascii());
+    LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name()).UTF8String().data(), aValue.toString(exec).ascii());
 
     switch (m_JNIType) {
     case array_type:
@@ -261,7 +256,6 @@
     JNIEnv* env = getJNIEnv();
     m_length = env->GetArrayLength(static_cast<jarray>(m_array->m_instance));
     m_type = strdup(type);
-    m_rootObject = rootObject;
 }
 
 JavaArray::~JavaArray()
@@ -287,7 +281,7 @@
         javaClassName = strdup(&m_type[2]);
         javaClassName[strchr(javaClassName, ';')-javaClassName] = 0;
     }
-    jvalue aJValue = convertValueToJValue(exec, aValue, arrayType, javaClassName);
+    jvalue aJValue = convertValueToJValue(exec, m_rootObject.get(), aValue, arrayType, javaClassName);
 
     switch (arrayType) {
     case object_type:
diff --git a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
index 8ce150f..69782f3 100644
--- a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
+++ b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2003, 2010 Apple, Inc.  All rights reserved.
  * Copyright 2009, The Android Open Source Project
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 
+#include "JavaRuntimeObject.h"
 #include "JNIBridgeJSC.h"
 #include "runtime_array.h"
 #include "runtime_object.h"
@@ -168,59 +169,94 @@
     return jarray;
 }
 
-jvalue convertValueToJValue(ExecState* exec, JSValue value, JNIType jniType, const char* javaClassName)
+jvalue convertValueToJValue(ExecState* exec, RootObject* rootObject, JSValue value, JNIType jniType, const char* javaClassName)
 {
     JSLock lock(SilenceAssertionsOnly);
 
     jvalue result;
+    memset(&result, 0, sizeof(jvalue));
 
     switch (jniType) {
     case array_type:
     case object_type:
         {
-            result.l = (jobject)0;
+            // FIXME: JavaJSObject::convertValueToJObject functionality is almost exactly the same,
+            // these functions should use common code.
 
-            // First see if we have a Java instance.
             if (value.isObject()) {
-                JSObject* objectImp = asObject(value);
-                if (objectImp->classInfo() == &RuntimeObjectImp::s_info) {
-                    RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(objectImp);
-                    JavaInstance* instance = static_cast<JavaInstance*>(imp->getInternalInstance());
+                JSObject* object = asObject(value);
+                if (object->inherits(&JavaRuntimeObject::s_info)) {
+                    // Unwrap a Java instance.
+                    JavaRuntimeObject* runtimeObject = static_cast<JavaRuntimeObject*>(object);
+                    JavaInstance* instance = runtimeObject->getInternalJavaInstance();
                     if (instance)
                         result.l = instance->javaInstance();
-                } else if (objectImp->classInfo() == &RuntimeArray::s_info) {
+                } else if (object->classInfo() == &RuntimeArray::s_info) {
                     // Input is a JavaScript Array that was originally created from a Java Array
-                    RuntimeArray* imp = static_cast<RuntimeArray*>(objectImp);
+                    RuntimeArray* imp = static_cast<RuntimeArray*>(object);
                     JavaArray* array = static_cast<JavaArray*>(imp->getConcreteArray());
                     result.l = array->javaArray();
-                } else if (objectImp->classInfo() == &JSArray::info) {
+                } else if (object->classInfo() == &JSArray::info) {
                     // Input is a Javascript Array. We need to create it to a Java Array.
                     result.l = convertArrayInstanceToJavaArray(exec, asArray(value), javaClassName);
+                } else if (!result.l && (!strcmp(javaClassName, "java.lang.Object")) || (!strcmp(javaClassName, "netscape.javascript.JSObject"))) {
+                    // Wrap objects in JSObject instances.
+                    JNIEnv* env = getJNIEnv();
+                    jclass jsObjectClass = env->FindClass("sun/plugin/javascript/webkit/JSObject");
+                    jmethodID constructorID = env->GetMethodID(jsObjectClass, "<init>", "(J)V");
+                    if (constructorID) {
+                        jlong nativeHandle = ptr_to_jlong(object);
+                        rootObject->gcProtect(object);
+                        result.l = env->NewObject(jsObjectClass, constructorID, nativeHandle);
+                    }
                 }
             }
 
-            // Now convert value to a string if the target type is a java.lang.string, and we're not
-            // converting from a Null.
-            if (!result.l && !strcmp(javaClassName, "java.lang.String")) {
-#ifdef CONVERT_NULL_TO_EMPTY_STRING
-                if (value->isNull()) {
+            // Create an appropriate Java object if target type is java.lang.Object.
+            if (!result.l && !strcmp(javaClassName, "java.lang.Object")) {
+                if (value.isString()) {
+                    UString stringValue = asString(value)->value(exec);
                     JNIEnv* env = getJNIEnv();
-                    jchar buf[2];
-                    jobject javaString = env->functions->NewString(env, buf, 0);
+                    jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
                     result.l = javaString;
-                } else
-#else
-                if (!value.isNull())
-#endif
-                {
-                    UString stringValue = value.toString(exec);
+                } else if (value.isNumber()) {
+                    double doubleValue = value.uncheckedGetNumber();
                     JNIEnv* env = getJNIEnv();
-                    jobject javaString = env->functions->NewString(env, (const jchar *)stringValue.data(), stringValue.size());
+                    jclass clazz = env->FindClass("java/lang/Double");
+                    jmethodID constructor = env->GetMethodID(clazz, "<init>", "(D)V");
+                    jobject javaDouble = env->functions->NewObject(env, clazz, constructor, doubleValue);
+                    result.l = javaDouble;
+                } else if (value.isBoolean()) {
+                    bool boolValue = value.getBoolean();
+                    JNIEnv* env = getJNIEnv();
+                    jclass clazz = env->FindClass("java/lang/Boolean");
+                    jmethodID constructor = env->GetMethodID(clazz, "<init>", "(Z)V");
+                    jobject javaBoolean = env->functions->NewObject(env, clazz, constructor, boolValue);
+                    result.l = javaBoolean;
+                } else if (value.isUndefined()) {
+                    UString stringValue = "undefined";
+                    JNIEnv* env = getJNIEnv();
+                    jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
                     result.l = javaString;
                 }
+            }
+
+            // Convert value to a string if the target type is a java.lang.String, and we're not
+            // converting from a null.
+            if (!result.l && !strcmp(javaClassName, "java.lang.String")) {
+                if (!value.isNull()) {
+                    UString stringValue = value.toString(exec);
+                    JNIEnv* env = getJNIEnv();
+                    jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
+                    result.l = javaString;
+                }
+<<<<<<< HEAD
             } else if (!result.l)
                 // ANDROID
                 memset(&result, 0, sizeof(jvalue)); // Handle it the same as a void case
+=======
+            }
+>>>>>>> webkit.org at r58033
         }
         break;
 
@@ -272,15 +308,15 @@
         }
         break;
 
-        break;
-
     case invalid_type:
-    default:
     case void_type:
+<<<<<<< HEAD
         {
             // ANDROID
             memset(&result, 0, sizeof(jvalue));
         }
+=======
+>>>>>>> webkit.org at r58033
         break;
     }
     return result;
diff --git a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.h b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.h
index 0297f97..8d4652d 100644
--- a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.h
+++ b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.h
@@ -39,7 +39,9 @@
 
 namespace Bindings {
 
-jvalue convertValueToJValue(ExecState*, JSValue, JNIType, const char* javaClassName);
+class RootObject;
+
+jvalue convertValueToJValue(ExecState*, RootObject*, JSValue, JNIType, const char* javaClassName);
 bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValue& exceptionDescription);
 
 } // namespace Bindings
diff --git a/WebCore/bridge/jni/jsc/JavaClassJSC.cpp b/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
index ec5c172..e1b8b4c 100644
--- a/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
@@ -40,7 +40,7 @@
     jobject aClass = callJNIMethod<jobject>(anInstance, "getClass", "()Ljava/lang/Class;");
 
     if (!aClass) {
-        fprintf(stderr, "%s:  unable to call getClass on instance %p\n", __PRETTY_FUNCTION__, anInstance);
+        LOG_ERROR("Unable to call getClass on instance %p", anInstance);
         m_name = fastStrDup("<Unknown>");
         return;
     }
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index f2a2cf4..666df54 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -28,16 +28,20 @@
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 
+#include "JavaRuntimeObject.h"
 #include "JNIBridgeJSC.h"
 #include "JNIUtility.h"
 #include "JNIUtilityPrivate.h"
 #include "JavaClassJSC.h"
+#include "Logging.h"
+#include "runtime_method.h"
 #include "runtime_object.h"
 #include "runtime_root.h"
 #include <runtime/ArgList.h>
 #include <runtime/Error.h>
 #include <runtime/JSLock.h>
 
+<<<<<<< HEAD
 #if PLATFORM(ANDROID)
 #include <assert.h>
 #endif
@@ -56,8 +60,11 @@
 #define LOG_TAG JavaInstanceJSC.cpp
 #endif
 
+=======
+>>>>>>> webkit.org at r58033
 using namespace JSC::Bindings;
 using namespace JSC;
+using namespace WebCore;
 
 JavaInstance::JavaInstance(jobject instance, PassRefPtr<RootObject> rootObject)
     : Instance(rootObject)
@@ -71,6 +78,11 @@
     delete m_class;
 }
 
+RuntimeObject* JavaInstance::newRuntimeObject(ExecState* exec)
+{
+    return new (exec) JavaRuntimeObject(exec, this);
+}
+
 #define NUM_LOCAL_REFS 64
 
 void JavaInstance::virtualBegin()
@@ -119,10 +131,35 @@
     return jsBoolean(booleanValue);
 }
 
-JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList &args)
+class JavaRuntimeMethod : public RuntimeMethod {
+public:
+    JavaRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)
+        : RuntimeMethod(exec, name, list)
+    {
+    }
+
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+
+    static const ClassInfo s_info;
+};
+
+const ClassInfo JavaRuntimeMethod::s_info = { "JavaRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+
+JSValue JavaInstance::getMethod(ExecState* exec, const Identifier& propertyName)
 {
-    int i, count = args.size();
-    jvalue* jArgs;
+    MethodList methodList = getClass()->methodsNamed(propertyName, this);
+    return new (exec) JavaRuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod, const ArgList &args)
+{
+    if (!asObject(runtimeMethod)->inherits(&JavaRuntimeMethod::s_info))
+        return throwError(exec, TypeError, "Attempt to invoke non-Java method on Java object.");
+
+    const MethodList& methodList = *runtimeMethod->methods();
+
+    int i;
+    int count = args.size();
     JSValue resultValue;
     Method* method = 0;
     size_t numMethods = methodList.size();
@@ -132,31 +169,27 @@
     // notion of method overloading and Java does.  We could
     // get a bit more sophisticated and attempt to does some
     // type checking as we as checking the number of parameters.
-    Method* aMethod;
     for (size_t methodIndex = 0; methodIndex < numMethods; methodIndex++) {
-        aMethod = methodList[methodIndex];
+        Method* aMethod = methodList[methodIndex];
         if (aMethod->numParameters() == count) {
             method = aMethod;
             break;
         }
     }
     if (!method) {
-        JS_LOG("unable to find an appropiate method\n");
+        LOG(LiveConnect, "JavaInstance::invokeMethod unable to find an appropiate method");
         return jsUndefined();
     }
 
     const JavaMethod* jMethod = static_cast<const JavaMethod*>(method);
-    JS_LOG("call %s %s on %p\n", UString(jMethod->name()).UTF8String().c_str(), jMethod->signature(), m_instance->m_instance);
+    LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", UString(jMethod->name()).UTF8String().data(), jMethod->signature(), m_instance->m_instance);
 
-    if (count > 0)
-        jArgs = (jvalue*)malloc(count * sizeof(jvalue));
-    else
-        jArgs = 0;
+    Vector<jvalue> jArgs(count);
 
     for (i = 0; i < count; i++) {
         JavaParameter* aParameter = jMethod->parameterAt(i);
-        jArgs[i] = convertValueToJValue(exec, args.at(i), aParameter->getJNIType(), aParameter->type());
-        JS_LOG("arg[%d] = %s\n", i, args.at(i).toString(exec).ascii());
+        jArgs[i] = convertValueToJValue(exec, m_rootObject.get(), args.at(i), aParameter->getJNIType(), aParameter->type());
+        LOG(LiveConnect, "JavaInstance::invokeMethod arg[%d] = %s", i, args.at(i).toString(exec).ascii());
     }
 
     jvalue result;
@@ -173,55 +206,53 @@
         jobject obj = m_instance->m_instance;
         JSValue exceptionDescription;
         const char *callingURL = 0; // FIXME, need to propagate calling URL to Java
-        handled = dispatchJNICall(exec, rootObject->nativeHandle(), obj, jMethod->isStatic(), jMethod->JNIReturnType(), jMethod->methodID(obj), jArgs, result, callingURL, exceptionDescription);
+        handled = dispatchJNICall(exec, rootObject->nativeHandle(), obj, jMethod->isStatic(), jMethod->JNIReturnType(), jMethod->methodID(obj), jArgs.data(), result, callingURL, exceptionDescription);
         if (exceptionDescription) {
             throwError(exec, GeneralError, exceptionDescription.toString(exec));
-            free(jArgs);
             return jsUndefined();
         }
     }
 
-    // The following code can be conditionally removed once we have a Tiger update that
-    // contains the new Java plugin.  It is needed for builds prior to Tiger.
+#ifdef BUILDING_ON_TIGER
     if (!handled) {
         jobject obj = m_instance->m_instance;
         switch (jMethod->JNIReturnType()) {
         case void_type:
-            callJNIMethodIDA<void>(obj, jMethod->methodID(obj), jArgs);
+            callJNIMethodIDA<void>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case object_type:
-            result.l = callJNIMethodIDA<jobject>(obj, jMethod->methodID(obj), jArgs);
+            result.l = callJNIMethodIDA<jobject>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case boolean_type:
-            result.z = callJNIMethodIDA<jboolean>(obj, jMethod->methodID(obj), jArgs);
+            result.z = callJNIMethodIDA<jboolean>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case byte_type:
-            result.b = callJNIMethodIDA<jbyte>(obj, jMethod->methodID(obj), jArgs);
+            result.b = callJNIMethodIDA<jbyte>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case char_type:
-            result.c = callJNIMethodIDA<jchar>(obj, jMethod->methodID(obj), jArgs);
+            result.c = callJNIMethodIDA<jchar>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case short_type:
-            result.s = callJNIMethodIDA<jshort>(obj, jMethod->methodID(obj), jArgs);
+            result.s = callJNIMethodIDA<jshort>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case int_type:
-            result.i = callJNIMethodIDA<jint>(obj, jMethod->methodID(obj), jArgs);
+            result.i = callJNIMethodIDA<jint>(obj, jMethod->methodID(obj), jArgs.data());
             break;
-
         case long_type:
-            result.j = callJNIMethodIDA<jlong>(obj, jMethod->methodID(obj), jArgs);
+            result.j = callJNIMethodIDA<jlong>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case float_type:
-            result.f = callJNIMethodIDA<jfloat>(obj, jMethod->methodID(obj), jArgs);
+            result.f = callJNIMethodIDA<jfloat>(obj, jMethod->methodID(obj), jArgs.data());
             break;
         case double_type:
-            result.d = callJNIMethodIDA<jdouble>(obj, jMethod->methodID(obj), jArgs);
+            result.d = callJNIMethodIDA<jdouble>(obj, jMethod->methodID(obj), jArgs.data());
             break;
+        case array_type:
         case invalid_type:
-        default:
             break;
         }
     }
+#endif
 
     switch (jMethod->JNIReturnType()) {
     case void_type:
@@ -233,13 +264,28 @@
     case object_type:
         {
             if (result.l) {
+                // FIXME: array_type return type is handled below, can we actually get an array here?
                 const char* arrayType = jMethod->returnType();
                 if (arrayType[0] == '[')
                     resultValue = JavaArray::convertJObjectToArray(exec, result.l, arrayType, rootObject);
-                else
-                    resultValue = JavaInstance::create(result.l, rootObject)->createRuntimeObject(exec);
+                else {
+                    jobject classOfInstance = callJNIMethod<jobject>(result.l, "getClass", "()Ljava/lang/Class;");
+                    jstring className = static_cast<jstring>(callJNIMethod<jobject>(classOfInstance, "getName", "()Ljava/lang/String;"));
+                    if (!strcmp(JavaString(className).UTF8String(), "sun.plugin.javascript.webkit.JSObject")) {
+                        // Pull the nativeJSObject value from the Java instance.  This is a pointer to the JSObject.
+                        JNIEnv* env = getJNIEnv();
+                        jfieldID fieldID = env->GetFieldID(static_cast<jclass>(classOfInstance), "nativeJSObject", "J");
+                        jlong nativeHandle = env->GetLongField(result.l, fieldID);
+                        // FIXME: Handling of undefined values differs between functions in JNIUtilityPrivate.cpp and those in those in jni_jsobject.mm,
+                        // and so it does between different versions of LiveConnect spec. There should not be multiple code paths to do the same work.
+                        if (nativeHandle == 1 /* UndefinedHandle */)
+                            return jsUndefined();
+                        return static_cast<JSObject*>(jlong_to_ptr(nativeHandle));
+                    } else
+                        return JavaInstance::create(result.l, rootObject)->createRuntimeObject(exec);
+                }
             } else
-                resultValue = jsUndefined();
+                return jsUndefined();
         }
         break;
 
@@ -291,16 +337,21 @@
         }
         break;
 
+    case array_type:
+        {
+            const char* arrayType = jMethod->returnType();
+            ASSERT(arrayType[0] == '[');
+            resultValue = JavaArray::convertJObjectToArray(exec, result.l, arrayType, rootObject);
+        }
+        break;
+
     case invalid_type:
-    default:
         {
             resultValue = jsUndefined();
         }
         break;
     }
 
-    free(jArgs);
-
     return resultValue;
 }
 
@@ -328,11 +379,15 @@
 JObjectWrapper::JObjectWrapper(jobject instance)
     : m_refCount(0)
 {
+<<<<<<< HEAD
     assert(instance);
 #if PLATFORM(ANDROID)
     if (!instance)
         LOGE("Attempted to create JObjectWrapper for null object");
 #endif
+=======
+    ASSERT(instance);
+>>>>>>> webkit.org at r58033
 
     // Cache the JNIEnv used to get the global ref for this java instance.
     // It'll be used to delete the reference.
@@ -340,19 +395,24 @@
 
     m_instance = m_env->NewGlobalRef(instance);
 
-    JS_LOG("new global ref %p for %p\n", m_instance, instance);
+    LOG(LiveConnect, "JObjectWrapper ctor new global ref %p for %p", m_instance, instance);
 
+<<<<<<< HEAD
     if  (!m_instance)
 #if PLATFORM(ANDROID)
         LOGE("%s:  could not get GlobalRef for %p\n", __PRETTY_FUNCTION__, instance);
 #else
         fprintf(stderr, "%s:  could not get GlobalRef for %p\n", __PRETTY_FUNCTION__, instance);
 #endif
+=======
+    if (!m_instance)
+        LOG_ERROR("Could not get GlobalRef for %p", instance);
+>>>>>>> webkit.org at r58033
 }
 
 JObjectWrapper::~JObjectWrapper()
 {
-    JS_LOG("deleting global ref %p\n", m_instance);
+    LOG(LiveConnect, "JObjectWrapper dtor deleting global ref %p", m_instance);
     m_env->DeleteGlobalRef(m_instance);
 }
 
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.h b/WebCore/bridge/jni/jsc/JavaInstanceJSC.h
index a46c6d3..d395cc8 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.h
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.h
@@ -82,7 +82,8 @@
     virtual JSValue valueOf(ExecState*) const;
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
 
-    virtual JSValue invokeMethod(ExecState* exec, const MethodList& method, const ArgList& args);
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
+    virtual JSValue invokeMethod(ExecState* exec, RuntimeMethod* method, const ArgList& args);
 
     jobject javaInstance() const { return m_instance->m_instance; }
 
@@ -92,6 +93,9 @@
 
 protected:
     JavaInstance(jobject instance, PassRefPtr<RootObject>);
+
+    virtual RuntimeObject* newRuntimeObject(ExecState*);
+
     virtual void virtualBegin();
     virtual void virtualEnd();
 
diff --git a/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp b/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
new file mode 100644
index 0000000..dc58b71
--- /dev/null
+++ b/WebCore/bridge/jni/jsc/JavaRuntimeObject.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 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 "JavaInstanceJSC.h"
+#include "JavaRuntimeObject.h"
+
+namespace JSC {
+namespace Bindings {
+
+const ClassInfo JavaRuntimeObject::s_info = { "JavaRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+
+JavaRuntimeObject::JavaRuntimeObject(ExecState* exec, PassRefPtr<JavaInstance> instance)
+    : RuntimeObject(exec, instance)
+{
+}
+
+JavaRuntimeObject::~JavaRuntimeObject()
+{
+}
+
+JavaInstance* JavaRuntimeObject::getInternalJavaInstance() const
+{
+    return static_cast<JavaInstance*>(getInternalInstance());
+}
+
+
+
+}
+}
diff --git a/WebCore/bridge/jni/jsc/JavaRuntimeObject.h b/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
new file mode 100644
index 0000000..d9bf693
--- /dev/null
+++ b/WebCore/bridge/jni/jsc/JavaRuntimeObject.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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 JavaRuntimeObject_h
+#define JavaRuntimeObject_h
+
+#include "runtime_object.h"
+
+namespace JSC {
+namespace Bindings {
+
+class JavaInstance;
+
+class JavaRuntimeObject : public RuntimeObject {
+public:
+    JavaRuntimeObject(ExecState*, PassRefPtr<JavaInstance>);
+    virtual ~JavaRuntimeObject();
+
+    JavaInstance* getInternalJavaInstance() const;
+
+    static const ClassInfo s_info;
+
+private:
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+};
+
+}
+}
+
+#endif
diff --git a/WebCore/bridge/jni/jsc/JavaStringJSC.h b/WebCore/bridge/jni/jsc/JavaStringJSC.h
index 7c37f70..0a7dad5 100644
--- a/WebCore/bridge/jni/jsc/JavaStringJSC.h
+++ b/WebCore/bridge/jni/jsc/JavaStringJSC.h
@@ -62,13 +62,13 @@
 
     const char* UTF8String() const
     {
-        if (!m_utf8String.c_str()) {
+        if (!m_utf8String.data()) {
             JSLock lock(SilenceAssertionsOnly);
             m_utf8String = UString(m_rep).UTF8String();
         }
-        return m_utf8String.c_str();
+        return m_utf8String.data();
     }
-    const jchar* uchars() const { return (const jchar*)m_rep->data(); }
+    const jchar* uchars() const { return (const jchar*)m_rep->characters(); }
     int length() const { return m_rep->length(); }
     UString uString() const { return UString(m_rep); }
 
diff --git a/WebCore/bridge/jni/v8/JavaStringV8.h b/WebCore/bridge/jni/v8/JavaStringV8.h
index 08d4b95..21420b7 100644
--- a/WebCore/bridge/jni/v8/JavaStringV8.h
+++ b/WebCore/bridge/jni/v8/JavaStringV8.h
@@ -26,8 +26,8 @@
 #ifndef JavaStringV8_h
 #define JavaStringV8_h
 
-#include "CString.h"
 #include "JNIUtility.h"
+#include <wtf/text/CString.h>
 
 
 namespace JSC {
@@ -42,7 +42,7 @@
     {
         int size = e->GetStringLength(s);
         const char* cs = getCharactersFromJStringInEnv(e, s);
-        m_utf8String = WebCore::CString(cs, size);
+        m_utf8String = WTF::CString(cs, size);
         releaseCharactersForJStringInEnv(e, s, cs);
     }
 
@@ -51,7 +51,7 @@
     int length() const { return m_utf8String.length(); }
 
 private:
-    WebCore::CString m_utf8String;
+    WTF::CString m_utf8String;
 };
 
 } // namespace Bindings
diff --git a/WebCore/bridge/jsc/BridgeJSC.cpp b/WebCore/bridge/jsc/BridgeJSC.cpp
index ed582d3..3d8f62d 100644
--- a/WebCore/bridge/jsc/BridgeJSC.cpp
+++ b/WebCore/bridge/jsc/BridgeJSC.cpp
@@ -83,7 +83,7 @@
     virtualEnd();
 }
 
-RuntimeObjectImp* Instance::createRuntimeObject(ExecState* exec)
+RuntimeObject* Instance::createRuntimeObject(ExecState* exec)
 {
     ASSERT(m_rootObject);
     ASSERT(m_rootObject->isValid());
@@ -95,10 +95,10 @@
     return m_runtimeObject;
 }
 
-RuntimeObjectImp* Instance::newRuntimeObject(ExecState* exec)
+RuntimeObject* Instance::newRuntimeObject(ExecState* exec)
 {
     JSLock lock(SilenceAssertionsOnly);
-    return new (exec)RuntimeObjectImp(exec, this);
+    return new (exec)RuntimeObject(exec, this);
 }
 
 void Instance::willDestroyRuntimeObject()
diff --git a/WebCore/bridge/jsc/BridgeJSC.h b/WebCore/bridge/jsc/BridgeJSC.h
index 8e2cb2b..8379170 100644
--- a/WebCore/bridge/jsc/BridgeJSC.h
+++ b/WebCore/bridge/jsc/BridgeJSC.h
@@ -40,13 +40,14 @@
 class Identifier;
 class JSGlobalObject;
 class PropertyNameArray;
-class RuntimeObjectImp;
+class RuntimeMethod;
 
 namespace Bindings {
 
 class Instance;
 class Method;
 class RootObject;
+class RuntimeObject;
 
 typedef Vector<Method*> MethodList;
 
@@ -83,14 +84,15 @@
     void end();
 
     virtual Class* getClass() const = 0;
-    RuntimeObjectImp* createRuntimeObject(ExecState*);
+    RuntimeObject* createRuntimeObject(ExecState*);
     void willInvalidateRuntimeObject();
     void willDestroyRuntimeObject();
 
     // Returns false if the value was not set successfully.
     virtual bool setValueOfUndefinedField(ExecState*, const Identifier&, JSValue) { return false; }
 
-    virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList& args) = 0;
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName) = 0;
+    virtual JSValue invokeMethod(ExecState*, RuntimeMethod* method, const ArgList& args) = 0;
 
     virtual bool supportsInvokeDefaultMethod() const { return false; }
     virtual JSValue invokeDefaultMethod(ExecState*, const ArgList&) { return jsUndefined(); }
@@ -115,12 +117,12 @@
 protected:
     virtual void virtualBegin() { }
     virtual void virtualEnd() { }
-    virtual RuntimeObjectImp* newRuntimeObject(ExecState*);
+    virtual RuntimeObject* newRuntimeObject(ExecState*);
 
     RefPtr<RootObject> m_rootObject;
 
 private:
-    RuntimeObjectImp* m_runtimeObject;
+    RuntimeObject* m_runtimeObject;
 };
 
 class Array : public Noncopyable {
diff --git a/WebCore/bridge/npapi.h b/WebCore/bridge/npapi.h
index 351b414..f82d25e 100644
--- a/WebCore/bridge/npapi.h
+++ b/WebCore/bridge/npapi.h
@@ -50,7 +50,7 @@
 #define JRIEnv  void
 #endif
 
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__SYMBIAN32__)
 #    ifndef XP_WIN
 #        define XP_WIN 1
 #    endif /* XP_WIN */
diff --git a/WebCore/bridge/objc/ObjCRuntimeObject.h b/WebCore/bridge/objc/ObjCRuntimeObject.h
new file mode 100644
index 0000000..5c44157
--- /dev/null
+++ b/WebCore/bridge/objc/ObjCRuntimeObject.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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 ObjCRuntimeObject_h
+#define ObjCRuntimeObject_h
+
+#include "runtime_object.h"
+
+namespace JSC {
+namespace Bindings {
+
+class ObjcInstance;
+
+class ObjCRuntimeObject : public RuntimeObject {
+public:
+    ObjCRuntimeObject(ExecState*, PassRefPtr<ObjcInstance>);
+    virtual ~ObjCRuntimeObject();
+
+    ObjcInstance* getInternalObjCInstance() const;
+
+    static const ClassInfo s_info;
+
+private:
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+};
+
+}
+}
+
+#endif
diff --git a/WebCore/bridge/objc/ObjCRuntimeObject.mm b/WebCore/bridge/objc/ObjCRuntimeObject.mm
new file mode 100644
index 0000000..c7c4e98
--- /dev/null
+++ b/WebCore/bridge/objc/ObjCRuntimeObject.mm
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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. 
+ */
+
+#import "config.h"
+
+#import "ObjCRuntimeObject.h"
+#import "objc_instance.h"
+
+namespace JSC {
+namespace Bindings {
+
+const ClassInfo ObjCRuntimeObject::s_info = { "ObjCRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+
+ObjCRuntimeObject::ObjCRuntimeObject(ExecState* exec, PassRefPtr<ObjcInstance> instance)
+    : RuntimeObject(exec, instance)
+{
+}
+
+ObjCRuntimeObject::~ObjCRuntimeObject()
+{
+}
+
+ObjcInstance* ObjCRuntimeObject::getInternalObjCInstance() const
+{
+    return static_cast<ObjcInstance*>(getInternalInstance());
+}
+
+
+}
+}
diff --git a/WebCore/bridge/objc/objc_instance.h b/WebCore/bridge/objc/objc_instance.h
index 64cd491..7e87188 100644
--- a/WebCore/bridge/objc/objc_instance.h
+++ b/WebCore/bridge/objc/objc_instance.h
@@ -46,8 +46,10 @@
         
     virtual JSValue valueOf(ExecState*) const;
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
-    
-    virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList&);
+
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
+    JSValue invokeObjcMethod(ExecState*, ObjcMethod* method, const ArgList&);
+    virtual JSValue invokeMethod(ExecState*, RuntimeMethod* method, const ArgList&);
     virtual bool supportsInvokeDefaultMethod() const;
     virtual JSValue invokeDefaultMethod(ExecState*, const ArgList&);
 
@@ -68,7 +70,9 @@
     static void moveGlobalExceptionToExecState(ExecState*);
 
     ObjcInstance(ObjectStructPtr, PassRefPtr<RootObject>);
-    
+
+    virtual RuntimeObject* newRuntimeObject(ExecState*);
+
     RetainPtr<ObjectStructPtr> _instance;
     mutable ObjcClass *_class;
     ObjectStructPtr _pool;
diff --git a/WebCore/bridge/objc/objc_instance.mm b/WebCore/bridge/objc/objc_instance.mm
index 86b701b..de330ae 100644
--- a/WebCore/bridge/objc/objc_instance.mm
+++ b/WebCore/bridge/objc/objc_instance.mm
@@ -26,7 +26,9 @@
 #import "config.h"
 #import "objc_instance.h"
 
+#import "runtime_method.h"
 #import "FoundationExtras.h"
+#import "ObjCRuntimeObject.h"
 #import "WebScriptObject.h"
 #import <objc/objc-auto.h>
 #import <runtime/Error.h>
@@ -52,15 +54,20 @@
 static NSMapTable *createInstanceWrapperCache()
 {
 #ifdef BUILDING_ON_TIGER
-    return NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0);
+    return NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0);
 #else
     // NSMapTable with zeroing weak pointers is the recommended way to build caches like this under garbage collection.
-    NSPointerFunctionsOptions keyOptions = NSPointerFunctionsZeroingWeakMemory | NSPointerFunctionsObjectPersonality;
+    NSPointerFunctionsOptions keyOptions = NSPointerFunctionsZeroingWeakMemory | NSPointerFunctionsOpaquePersonality;
     NSPointerFunctionsOptions valueOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality;
     return [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0];
 #endif
 }
 
+RuntimeObject* ObjcInstance::newRuntimeObject(ExecState* exec)
+{
+    return new (exec) ObjCRuntimeObject(exec, this);
+}
+
 void ObjcInstance::setGlobalException(NSString* exception, JSGlobalObject* exceptionEnvironment)
 {
     HardRelease(s_exception);
@@ -167,7 +174,41 @@
     return [_instance.get() respondsToSelector:@selector(invokeDefaultMethodWithArguments:)];
 }
 
-JSValue ObjcInstance::invokeMethod(ExecState* exec, const MethodList &methodList, const ArgList &args)
+class ObjCRuntimeMethod : public RuntimeMethod {
+public:
+    ObjCRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)
+        : RuntimeMethod(exec, name, list)
+    {
+    }
+
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+
+    static const ClassInfo s_info;
+};
+
+const ClassInfo ObjCRuntimeMethod::s_info = { "ObjCRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+
+JSValue ObjcInstance::getMethod(ExecState* exec, const Identifier& propertyName)
+{
+    MethodList methodList = getClass()->methodsNamed(propertyName, this);
+    return new (exec) ObjCRuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue ObjcInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod, const ArgList &args)
+{
+    if (!asObject(runtimeMethod)->inherits(&ObjCRuntimeMethod::s_info))
+        return throwError(exec, TypeError, "Attempt to invoke non-plug-in method on plug-in object.");
+
+    const MethodList& methodList = *runtimeMethod->methods();
+
+    // Overloading methods is not allowed in ObjectiveC.  Should only be one
+    // name match for a particular method.
+    ASSERT(methodList.size() == 1);
+
+    return invokeObjcMethod(exec, static_cast<ObjcMethod*>(methodList[0]), args);
+}
+
+JSValue ObjcInstance::invokeObjcMethod(ExecState* exec, ObjcMethod* method, const ArgList &args)
 {
     JSValue result = jsUndefined();
     
@@ -175,13 +216,7 @@
 
     setGlobalException(nil);
     
-    // Overloading methods is not allowed in ObjectiveC.  Should only be one
-    // name match for a particular method.
-    ASSERT(methodList.size() == 1);
-
 @try {
-    ObjcMethod* method = 0;
-    method = static_cast<ObjcMethod*>(methodList[0]);
     NSMethodSignature* signature = method->getMethodSignature();
     NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature];
     [invocation setSelector:method->selector()];
diff --git a/WebCore/bridge/objc/objc_runtime.mm b/WebCore/bridge/objc/objc_runtime.mm
index 772695c..f845a00 100644
--- a/WebCore/bridge/objc/objc_runtime.mm
+++ b/WebCore/bridge/objc/objc_runtime.mm
@@ -27,6 +27,7 @@
 #include "objc_runtime.h"
 
 #include "JSDOMBinding.h"
+#include "ObjCRuntimeObject.h"
 #include "WebScriptObject.h"
 #include "objc_instance.h"
 #include "runtime_array.h"
@@ -216,34 +217,31 @@
 
 static JSValue JSC_HOST_CALL callObjCFallbackObject(ExecState* exec, JSObject* function, JSValue thisValue, const ArgList& args)
 {
-    if (!thisValue.inherits(&RuntimeObjectImp::s_info))
+    if (!thisValue.inherits(&ObjCRuntimeObject::s_info))
         return throwError(exec, TypeError);
 
     JSValue result = jsUndefined();
 
-    RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(asObject(thisValue));
-    Instance* instance = imp->getInternalInstance();
+    ObjCRuntimeObject* runtimeObject = static_cast<ObjCRuntimeObject*>(asObject(thisValue));
+    ObjcInstance* objcInstance = runtimeObject->getInternalObjCInstance();
 
-    if (!instance)
-        return RuntimeObjectImp::throwInvalidAccessError(exec);
+    if (!objcInstance)
+        return RuntimeObject::throwInvalidAccessError(exec);
     
-    instance->begin();
+    objcInstance->begin();
 
-    ObjcInstance* objcInstance = static_cast<ObjcInstance*>(instance);
     id targetObject = objcInstance->getObject();
     
     if ([targetObject respondsToSelector:@selector(invokeUndefinedMethodFromWebScript:withArguments:)]){
-        ObjcClass* objcClass = static_cast<ObjcClass*>(instance->getClass());
+        ObjcClass* objcClass = static_cast<ObjcClass*>(objcInstance->getClass());
         OwnPtr<ObjcMethod> fallbackMethod(new ObjcMethod(objcClass->isa(), @selector(invokeUndefinedMethodFromWebScript:withArguments:)));
         const Identifier& nameIdentifier = static_cast<ObjcFallbackObjectImp*>(function)->propertyName();
         RetainPtr<CFStringRef> name(AdoptCF, CFStringCreateWithCharacters(0, nameIdentifier.data(), nameIdentifier.size()));
         fallbackMethod->setJavaScriptName(name.get());
-        MethodList methodList;
-        methodList.append(fallbackMethod.get());
-        result = instance->invokeMethod(exec, methodList, args);
+        result = objcInstance->invokeObjcMethod(exec, fallbackMethod.get(), args);
     }
             
-    instance->end();
+    objcInstance->end();
 
     return result;
 }
diff --git a/WebCore/bridge/qt/qt_class.cpp b/WebCore/bridge/qt/qt_class.cpp
index 09a1544..cfd74d9 100644
--- a/WebCore/bridge/qt/qt_class.cpp
+++ b/WebCore/bridge/qt/qt_class.cpp
@@ -127,7 +127,7 @@
 
     QObject* obj = qtinst->getObject();
     UString ustring = identifier.ustring();
-    QString objName((const QChar*)ustring.rep()->data(), ustring.size());
+    QString objName((const QChar*)ustring.rep()->characters(), ustring.size());
     QByteArray ba = objName.toAscii();
 
     // First check for a cached field
@@ -139,6 +139,7 @@
             // other types so we can delete them later
             if (f->fieldType() == QtField::MetaProperty)
                 return f;
+#ifndef QT_NO_PROPERTIES
             else if (f->fieldType() == QtField::DynamicProperty) {
                 if (obj->dynamicPropertyNames().indexOf(ba) >= 0)
                     return f;
@@ -147,7 +148,9 @@
                     qtinst->m_fields.remove(objName);
                     delete f;
                 }
-            } else {
+            }
+#endif
+            else {
                 QList<QObject*> children = obj->children();
                 for (int index = 0; index < children.count(); ++index) {
                     QObject *child = children.at(index);
@@ -172,6 +175,7 @@
             }
         }
 
+#ifndef QT_NO_PROPERTIES
         // Dynamic properties
         index = obj->dynamicPropertyNames().indexOf(ba);
         if (index >= 0) {
@@ -179,6 +183,7 @@
             qtinst->m_fields.insert(objName, f);
             return f;
         }
+#endif
 
         // Child objects
 
@@ -202,12 +207,14 @@
         if (qtinst->m_methods.contains(ba))
             return 0;
 
+#ifndef QT_NO_PROPERTIES
         // deleted qobject, but can't throw an error from here (no exec)
         // create a fake QtField that will throw upon access
         if (!f) {
             f = new QtField(ba);
             qtinst->m_fields.insert(objName, f);
         }
+#endif
         return f;
     }
 }
diff --git a/WebCore/bridge/qt/qt_instance.cpp b/WebCore/bridge/qt/qt_instance.cpp
index fcfe1cd..4e39371 100644
--- a/WebCore/bridge/qt/qt_instance.cpp
+++ b/WebCore/bridge/qt/qt_instance.cpp
@@ -44,15 +44,15 @@
 static QObjectInstanceMap cachedInstances;
 
 // Derived RuntimeObject
-class QtRuntimeObjectImp : public RuntimeObjectImp {
+class QtRuntimeObject : public RuntimeObject {
 public:
-    QtRuntimeObjectImp(ExecState*, PassRefPtr<Instance>);
+    QtRuntimeObject(ExecState*, PassRefPtr<Instance>);
 
     static const ClassInfo s_info;
 
     virtual void markChildren(MarkStack& markStack)
     {
-        RuntimeObjectImp::markChildren(markStack);
+        RuntimeObject::markChildren(markStack);
         QtInstance* instance = static_cast<QtInstance*>(getInternalInstance());
         if (instance)
             instance->markAggregate(markStack);
@@ -64,16 +64,16 @@
     }
 
 protected:
-    static const unsigned StructureFlags = RuntimeObjectImp::StructureFlags | OverridesMarkChildren;
+    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren;
 
 private:
     virtual const ClassInfo* classInfo() const { return &s_info; }
 };
 
-const ClassInfo QtRuntimeObjectImp::s_info = { "QtRuntimeObject", &RuntimeObjectImp::s_info, 0, 0 };
+const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0 };
 
-QtRuntimeObjectImp::QtRuntimeObjectImp(ExecState* exec, PassRefPtr<Instance> instance)
-    : RuntimeObjectImp(exec, WebCore::deprecatedGetDOMStructure<QtRuntimeObjectImp>(exec), instance)
+QtRuntimeObject::QtRuntimeObject(ExecState* exec, PassRefPtr<Instance> instance)
+    : RuntimeObject(exec, WebCore::deprecatedGetDOMStructure<QtRuntimeObject>(exec), instance)
 {
 }
 
@@ -164,22 +164,24 @@
 {
     if (!object)
         return 0;
-    if (!object->inherits(&QtRuntimeObjectImp::s_info))
+    if (!object->inherits(&QtRuntimeObject::s_info))
         return 0;
-    return static_cast<QtInstance*>(static_cast<RuntimeObjectImp*>(object)->getInternalInstance());
+    return static_cast<QtInstance*>(static_cast<RuntimeObject*>(object)->getInternalInstance());
 }
 
 Class* QtInstance::getClass() const
 {
+    if (!m_object)
+        return 0;
     if (!m_class)
         m_class = QtClass::classForObject(m_object);
     return m_class;
 }
 
-RuntimeObjectImp* QtInstance::newRuntimeObject(ExecState* exec)
+RuntimeObject* QtInstance::newRuntimeObject(ExecState* exec)
 {
     JSLock lock(SilenceAssertionsOnly);
-    return new (exec) QtRuntimeObjectImp(exec, this);
+    return new (exec) QtRuntimeObject(exec, this);
 }
 
 void QtInstance::markAggregate(MarkStack& markStack)
@@ -220,10 +222,12 @@
             }
         }
 
+#ifndef QT_NO_PROPERTIES
         QList<QByteArray> dynProps = obj->dynamicPropertyNames();
         foreach(QByteArray ba, dynProps) {
             array.add(Identifier(exec, ba.constData()));
         }
+#endif
 
         for (i=0; i < meta->methodCount(); i++) {
             QMetaMethod method = meta->method(i);
@@ -234,13 +238,20 @@
     }
 }
 
-JSValue QtInstance::invokeMethod(ExecState*, const MethodList&, const ArgList&)
+JSValue QtInstance::getMethod(ExecState* exec, const Identifier& propertyName)
+{
+    if (!getClass())
+        return jsNull();
+    MethodList methodList = m_class->methodsNamed(propertyName, this);
+    return new (exec) RuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue QtInstance::invokeMethod(ExecState*, RuntimeMethod*, const ArgList&)
 {
     // Implemented via fallbackMethod & QtRuntimeMetaMethod::callAsFunction
     return jsUndefined();
 }
 
-
 JSValue QtInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
 {
     if (hint == PreferString)
@@ -252,12 +263,15 @@
 
 JSValue QtInstance::stringValue(ExecState* exec) const
 {
+    QObject* obj = getObject();
+    if (!obj)
+        return jsNull();
+
     // Hmm.. see if there is a toString defined
     QByteArray buf;
     bool useDefault = true;
     getClass();
-    QObject* obj = getObject();
-    if (m_class && obj) {
+    if (m_class) {
         // Cheat and don't use the full name resolution
         int index = obj->metaObject()->indexOfMethod("toString()");
         if (index >= 0) {
@@ -302,7 +316,7 @@
 JSValue QtInstance::booleanValue() const
 {
     // ECMA 9.2
-    return jsBoolean(true);
+    return jsBoolean(getObject());
 }
 
 JSValue QtInstance::valueOf(ExecState* exec) const
@@ -320,8 +334,10 @@
         return m_property.name();
     else if (m_type == ChildObject && m_childObject)
         return m_childObject->objectName().toLatin1();
+#ifndef QT_NO_PROPERTIES
     else if (m_type == DynamicProperty)
         return m_dynamicProperty.constData();
+#endif
     return ""; // deleted child object
 }
 
@@ -339,9 +355,10 @@
                 return jsUndefined();
         } else if (m_type == ChildObject)
             val = QVariant::fromValue((QObject*) m_childObject);
+#ifndef QT_NO_PROPERTIES
         else if (m_type == DynamicProperty)
             val = obj->property(m_dynamicProperty);
-
+#endif
         return convertQVariantToValue(exec, inst->rootObject(), val);
     } else {
         QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name()));
@@ -366,8 +383,11 @@
         if (m_type == MetaProperty) {
             if (m_property.isWritable())
                 m_property.write(obj, val);
-        } else if (m_type == DynamicProperty)
+        }
+#ifndef QT_NO_PROPERTIES
+        else if (m_type == DynamicProperty)
             obj->setProperty(m_dynamicProperty.constData(), val);
+#endif
     } else {
         QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name()));
         throwError(exec, GeneralError, msg.toLatin1().constData());
diff --git a/WebCore/bridge/qt/qt_instance.h b/WebCore/bridge/qt/qt_instance.h
index 1fc253a..607f133 100644
--- a/WebCore/bridge/qt/qt_instance.h
+++ b/WebCore/bridge/qt/qt_instance.h
@@ -40,7 +40,7 @@
     ~QtInstance();
 
     virtual Class* getClass() const;
-    virtual RuntimeObjectImp* newRuntimeObject(ExecState*);
+    virtual RuntimeObject* newRuntimeObject(ExecState*);
 
     virtual void begin();
     virtual void end();
@@ -50,7 +50,8 @@
 
     void markAggregate(MarkStack&);
 
-    virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList&);
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
+    virtual JSValue invokeMethod(ExecState*, RuntimeMethod*, const ArgList&);
 
     virtual void getPropertyNames(ExecState*, PropertyNameArray&);
 
diff --git a/WebCore/bridge/qt/qt_pixmapruntime.cpp b/WebCore/bridge/qt/qt_pixmapruntime.cpp
index 5978804..803316d 100644
--- a/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -33,6 +33,7 @@
 #include <QVariant>
 #include <runtime_object.h>
 #include <runtime_root.h>
+#include <runtime_method.h>
 
 using namespace WebCore;
 namespace JSC {
@@ -142,9 +143,9 @@
 } qt_pixmap_metaData;
 
 // Derived RuntimeObject
-class QtPixmapRuntimeObjectImp : public RuntimeObjectImp {
+class QtPixmapRuntimeObject : public RuntimeObject {
 public:
-    QtPixmapRuntimeObjectImp(ExecState*, PassRefPtr<Instance>);
+    QtPixmapRuntimeObject(ExecState*, PassRefPtr<Instance>);
 
     static const ClassInfo s_info;
 
@@ -154,18 +155,18 @@
     }
 
 protected:
-    static const unsigned StructureFlags = RuntimeObjectImp::StructureFlags | OverridesMarkChildren;
+    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren;
 
 private:
     virtual const ClassInfo* classInfo() const { return &s_info; }
 };
 
-QtPixmapRuntimeObjectImp::QtPixmapRuntimeObjectImp(ExecState* exec, PassRefPtr<Instance> instance)
-    : RuntimeObjectImp(exec, WebCore::deprecatedGetDOMStructure<QtPixmapRuntimeObjectImp>(exec), instance)
+QtPixmapRuntimeObject::QtPixmapRuntimeObject(ExecState* exec, PassRefPtr<Instance> instance)
+    : RuntimeObject(exec, WebCore::deprecatedGetDOMStructure<QtPixmapRuntimeObject>(exec), instance)
 {
 }
 
-const ClassInfo QtPixmapRuntimeObjectImp::s_info = { "QtPixmapRuntimeObject", &RuntimeObjectImp::s_info, 0, 0 };
+const ClassInfo QtPixmapRuntimeObject::s_info = { "QtPixmapRuntimeObject", &RuntimeObject::s_info, 0, 0 };
 
 QtPixmapClass::QtPixmapClass()
 {
@@ -177,8 +178,16 @@
     return &qt_pixmap_metaData.cls;
 }
 
-JSValue QtPixmapInstance::invokeMethod(ExecState* exec, const MethodList& methods, const ArgList& args)
+JSValue QtPixmapInstance::getMethod(ExecState* exec, const Identifier& propertyName)
 {
+    MethodList methodList = getClass()->methodsNamed(propertyName, this);
+    return new (exec) RuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue QtPixmapInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod, const ArgList& args)
+{
+    const MethodList& methods = *runtimeMethod->methods();
+
     if (methods.size() == 1) {
         QtPixmapRuntimeMethod* method = static_cast<QtPixmapRuntimeMethod*>(methods[0]);
         return method->invoke(exec, this, args);
@@ -317,9 +326,9 @@
                   : QVariant::fromValue<QImage>(pixmap->toImage());
     }
 
-    if (object->inherits(&QtPixmapRuntimeObjectImp::s_info)) {
-        QtPixmapRuntimeObjectImp* imp = static_cast<QtPixmapRuntimeObjectImp*>(object);
-        QtPixmapInstance* instance = static_cast<QtPixmapInstance*>(imp->getInternalInstance());
+    if (object->inherits(&QtPixmapRuntimeObject::s_info)) {
+        QtPixmapRuntimeObject* runtimeObject = static_cast<QtPixmapRuntimeObject*>(object);
+        QtPixmapInstance* instance = static_cast<QtPixmapInstance*>(runtimeObject->getInternalInstance());
         if (!instance)
             goto returnEmptyVariant;
 
@@ -340,7 +349,7 @@
 JSObject* QtPixmapInstance::createRuntimeObject(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& data)
 {
     JSLock lock(SilenceAssertionsOnly);
-    return new(exec) QtPixmapRuntimeObjectImp(exec, new QtPixmapInstance(root, data));
+    return new(exec) QtPixmapRuntimeObject(exec, new QtPixmapInstance(root, data));
 }
 
 bool QtPixmapInstance::canHandle(QMetaType::Type hint)
diff --git a/WebCore/bridge/qt/qt_pixmapruntime.h b/WebCore/bridge/qt/qt_pixmapruntime.h
index 5455298..a0e0e26 100644
--- a/WebCore/bridge/qt/qt_pixmapruntime.h
+++ b/WebCore/bridge/qt/qt_pixmapruntime.h
@@ -32,7 +32,8 @@
 public:
     QtPixmapInstance(PassRefPtr<RootObject> rootObj, const QVariant& newData);
     virtual Class* getClass() const;
-    virtual JSValue invokeMethod(ExecState*, const MethodList&, const ArgList& args);
+    virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
+    virtual JSValue invokeMethod(ExecState*, RuntimeMethod*, const ArgList& args);
     virtual void getPropertyNames(ExecState*, PropertyNameArray&);
 
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index ada9f01..40ff6a1 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -154,7 +154,7 @@
             return Date;
         else if (object->inherits(&RegExpObject::info))
             return RegExp;
-        else if (object->inherits(&RuntimeObjectImp::s_info))
+        else if (object->inherits(&RuntimeObject::s_info))
             return QObj;
         return Object;
     }
@@ -308,7 +308,7 @@
                     dist = 6;
             } else {
                 UString str = value.toString(exec);
-                ret = QVariant(QChar(str.size() ? *(const ushort*)str.rep()->data() : 0));
+                ret = QVariant(QChar(str.size() ? *(const ushort*)str.rep()->characters() : 0));
                 if (type == String)
                     dist = 3;
                 else
@@ -323,7 +323,7 @@
                 return QString();
             } else {
                 UString ustring = value.toString(exec);
-                ret = QVariant(QString((const QChar*)ustring.rep()->data(), ustring.size()));
+                ret = QVariant(QString((const QChar*)ustring.rep()->characters(), ustring.size()));
                 if (type == String)
                     dist = 0;
                 else
@@ -332,7 +332,7 @@
             break;
         }
 
-        case QMetaType::QVariantMap: 
+        case QMetaType::QVariantMap:
             if (type == Object || type == Array || type == RTArray) {
                 // Enumerate the contents of the object
                 PropertyNameArray properties(exec);
@@ -347,7 +347,7 @@
                         QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects);
                         if (objdist >= 0) {
                             UString ustring = (*it).ustring();
-                            QString id = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                            QString id = QString((const QChar*)ustring.rep()->characters(), ustring.size());
                             result.insert(id, v);
                         }
                     }
@@ -422,7 +422,7 @@
                 for (int i = 0; i < len; ++i) {
                     JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
                     UString ustring = val.toString(exec);
-                    QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                    QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
 
                     result.append(qstring);
                 }
@@ -436,7 +436,7 @@
                 for (int i = 0; i < len; ++i) {
                     JSValue val = array->get(exec, i);
                     UString ustring = val.toString(exec);
-                    QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                    QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
 
                     result.append(qstring);
                 }
@@ -445,7 +445,7 @@
             } else {
                 // Make a single length array
                 UString ustring = value.toString(exec);
-                QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
                 QStringList result;
                 result.append(qstring);
                 ret = QVariant(result);
@@ -461,7 +461,7 @@
                 dist = 0;
             } else {
                 UString ustring = value.toString(exec);
-                ret = QVariant(QString((const QChar*)ustring.rep()->data(), ustring.size()).toLatin1());
+                ret = QVariant(QString((const QChar*)ustring.rep()->characters(), ustring.size()).toLatin1());
                 if (type == String)
                     dist = 5;
                 else
@@ -503,7 +503,7 @@
                 }
             } else if (type == String) {
                 UString ustring = value.toString(exec);
-                QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
 
                 if (hint == QMetaType::QDateTime) {
                     QDateTime dt = QDateTime::fromString(qstring, Qt::ISODate);
@@ -552,7 +552,7 @@
 */
                 // Attempt to convert.. a bit risky
                 UString ustring = value.toString(exec);
-                QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
 
                 // this is of the form '/xxxxxx/i'
                 int firstSlash = qstring.indexOf(QLatin1Char('/'));
@@ -572,7 +572,7 @@
                 }
             } else if (type == String) {
                 UString ustring = value.toString(exec);
-                QString qstring = QString((const QChar*)ustring.rep()->data(), ustring.size());
+                QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
 
                 QRegExp re(qstring);
                 if (re.isValid()) {
@@ -871,6 +871,8 @@
 
     if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) {
         QObject* obj = variant.value<QObject*>();
+        if (!obj)
+            return jsNull();
         return QtInstance::getQtInstance(obj, root, QScriptEngine::QtOwnership)->createRuntimeObject(exec);
     }
 
@@ -1471,15 +1473,15 @@
     QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
 }
 
-JSValue QtRuntimeMetaMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
+JSValue QtRuntimeMetaMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
 {
     // QtScript always returns 0
     return jsNumber(exec, 0);
 }
 
-JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
+JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, JSValue slotBase, const Identifier& ident)
 {
-    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slot.slotBase()));
+    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
     QW_DS(QtRuntimeMetaMethod, thisObj);
 
     if (!d->m_connect)
@@ -1487,9 +1489,9 @@
     return d->m_connect;
 }
 
-JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, const Identifier& ident, const PropertySlot& slot)
+JSValue QtRuntimeMetaMethod::disconnectGetter(ExecState* exec, JSValue slotBase, const Identifier& ident)
 {
-    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slot.slotBase()));
+    QtRuntimeMetaMethod* thisObj = static_cast<QtRuntimeMetaMethod*>(asObject(slotBase));
     QW_DS(QtRuntimeMetaMethod, thisObj);
 
     if (!d->m_disconnect)
@@ -1677,7 +1679,7 @@
     QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
 }
 
-JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot&)
+JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
 {
     // we have one formal argument, and one optional
     return jsNumber(exec, 1);
diff --git a/WebCore/bridge/qt/qt_runtime.h b/WebCore/bridge/qt/qt_runtime.h
index c3fa8b4..0951e5b 100644
--- a/WebCore/bridge/qt/qt_runtime.h
+++ b/WebCore/bridge/qt/qt_runtime.h
@@ -40,7 +40,9 @@
 
     typedef enum {
         MetaProperty,
+#ifndef QT_NO_PROPERTIES
         DynamicProperty,
+#endif
         ChildObject
     } QtFieldType;
 
@@ -48,9 +50,11 @@
         : m_type(MetaProperty), m_property(p)
         {}
 
+#ifndef QT_NO_PROPERTIES
     QtField(const QByteArray &b)
         : m_type(DynamicProperty), m_dynamicProperty(b)
         {}
+#endif
 
     QtField(QObject *child)
         : m_type(ChildObject), m_childObject(child)
@@ -179,9 +183,9 @@
 private:
     virtual CallType getCallData(CallData&);
     static JSValue JSC_HOST_CALL call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args);
-    static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue connectGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue disconnectGetter(ExecState*, const Identifier&, const PropertySlot&);
+    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue connectGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue disconnectGetter(ExecState*, JSValue, const Identifier&);
 };
 
 class QtConnectionObject;
@@ -200,7 +204,7 @@
 private:
     virtual CallType getCallData(CallData&);
     static JSValue JSC_HOST_CALL call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args);
-    static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
+    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
     static QMultiMap<QObject *, QtConnectionObject *> connections;
     friend class QtConnectionObject;
 };
diff --git a/WebCore/bridge/runtime_array.cpp b/WebCore/bridge/runtime_array.cpp
index 9e8da85..1f2bfe7 100644
--- a/WebCore/bridge/runtime_array.cpp
+++ b/WebCore/bridge/runtime_array.cpp
@@ -40,21 +40,26 @@
 RuntimeArray::RuntimeArray(ExecState* exec, Bindings::Array* array)
     // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
     // We need to pass in the right global object for "array".
-    : JSObject(deprecatedGetDOMStructure<RuntimeArray>(exec))
-    , _array(array)
+    : JSArray(deprecatedGetDOMStructure<RuntimeArray>(exec))
 {
+    setSubclassData(array);
 }
 
-JSValue RuntimeArray::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+RuntimeArray::~RuntimeArray()
 {
-    RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slot.slotBase()));
+    delete getConcreteArray();
+}
+
+JSValue RuntimeArray::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+    RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));
     return jsNumber(exec, thisObj->getLength());
 }
 
-JSValue RuntimeArray::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue RuntimeArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
 {
-    RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slot.slotBase()));
-    return thisObj->getConcreteArray()->valueAt(exec, slot.index());
+    RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));
+    return thisObj->getConcreteArray()->valueAt(exec, index);
 }
 
 void RuntimeArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
@@ -72,7 +77,7 @@
 bool RuntimeArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
     if (propertyName == exec->propertyNames().length) {
-        slot.setCustom(this, lengthGetter);
+        slot.setCacheableCustom(this, lengthGetter);
         return true;
     }
     
diff --git a/WebCore/bridge/runtime_array.h b/WebCore/bridge/runtime_array.h
index 6c6cacd..e301268 100644
--- a/WebCore/bridge/runtime_array.h
+++ b/WebCore/bridge/runtime_array.h
@@ -27,29 +27,30 @@
 #define RUNTIME_ARRAY_H_
 
 #include "Bridge.h"
-#include <runtime/JSGlobalObject.h>
+#include <runtime/ArrayPrototype.h>
 
 namespace JSC {
     
-class RuntimeArray : public JSObject {
+class RuntimeArray : public JSArray {
 public:
     RuntimeArray(ExecState*, Bindings::Array*);
+    virtual ~RuntimeArray();
 
     virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
-    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
-    virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
-    virtual bool getOwnPropertyDescriptor(ExecState *, const Identifier&, PropertyDescriptor&);
+    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+    virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&);
+    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
     virtual void put(ExecState*, unsigned propertyName, JSValue);
     
-    virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
-    virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
+    virtual bool deleteProperty(ExecState* exec, const Identifier &propertyName);
+    virtual bool deleteProperty(ExecState* exec, unsigned propertyName);
     
-    virtual const ClassInfo *classInfo() const { return &s_info; }
+    virtual const ClassInfo* classInfo() const { return &s_info; }
     
     unsigned getLength() const { return getConcreteArray()->getLength(); }
     
-    Bindings::Array *getConcreteArray() const { return _array.get(); }
+    Bindings::Array* getConcreteArray() const { return static_cast<Bindings::Array*>(subclassData()); }
 
     static const ClassInfo s_info;
 
@@ -58,17 +59,10 @@
         return globalObject->arrayPrototype();
     }
 
-    static PassRefPtr<Structure> createStructure(JSValue prototype)
-    {
-        return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
-    }
-
 private:
     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
-    static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue indexGetter(ExecState*, const Identifier&, const PropertySlot&);
-
-    OwnPtr<Bindings::Array> _array;
+    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue indexGetter(ExecState*, JSValue, unsigned);
 };
     
 } // namespace JSC
diff --git a/WebCore/bridge/runtime_method.cpp b/WebCore/bridge/runtime_method.cpp
index ffe4c0a..29145b6 100644
--- a/WebCore/bridge/runtime_method.cpp
+++ b/WebCore/bridge/runtime_method.cpp
@@ -27,6 +27,8 @@
 #include "runtime_method.h"
 
 #include "JSDOMBinding.h"
+#include "JSHTMLElement.h"
+#include "JSPluginElementFunctions.h"
 #include "runtime_object.h"
 #include <runtime/Error.h>
 #include <runtime/FunctionPrototype.h>
@@ -39,7 +41,7 @@
 
 ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod);
 
-const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", 0, 0, 0 };
+const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", &InternalFunction::info, 0, 0 };
 
 RuntimeMethod::RuntimeMethod(ExecState* exec, const Identifier& ident, Bindings::MethodList& m)
     // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
@@ -50,9 +52,9 @@
 {
 }
 
-JSValue RuntimeMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
+JSValue RuntimeMethod::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
 {
-    RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slot.slotBase()));
+    RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slotBase));
 
     // Ick!  There may be more than one method with this name.  Arbitrarily
     // just pick the first method.  The fundamental problem here is that 
@@ -66,7 +68,7 @@
 bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
     if (propertyName == exec->propertyNames().length) {
-        slot.setCustom(this, lengthGetter);
+        slot.setCacheableCustom(this, lengthGetter);
         return true;
     }
     
@@ -91,27 +93,27 @@
 
     if (method->methods()->isEmpty())
         return jsUndefined();
-    
-    RuntimeObjectImp* imp;
 
-    if (thisValue.inherits(&RuntimeObjectImp::s_info)) {
-        imp = static_cast<RuntimeObjectImp*>(asObject(thisValue));
+    RefPtr<Instance> instance;
+
+    if (thisValue.inherits(&RuntimeObject::s_info)) {
+        RuntimeObject* runtimeObject = static_cast<RuntimeObject*>(asObject(thisValue));
+        instance = runtimeObject->getInternalInstance();
+        if (!instance) 
+            return RuntimeObject::throwInvalidAccessError(exec);
     } else {
-        // If thisObj is the DOM object for a plugin, get the corresponding
-        // runtime object from the DOM object.
-        JSValue value = thisValue.get(exec, Identifier(exec, "__apple_runtime_object"));
-        if (value.inherits(&RuntimeObjectImp::s_info))    
-            imp = static_cast<RuntimeObjectImp*>(asObject(value));
-        else
+        // Calling a runtime object of a plugin element?
+        if (thisValue.inherits(&JSHTMLElement::s_info)) {
+            HTMLElement* element = static_cast<JSHTMLElement*>(asObject(thisValue))->impl();
+            instance = pluginInstance(element);
+        }
+        if (!instance)
             return throwError(exec, TypeError);
     }
+    ASSERT(instance);
 
-    RefPtr<Instance> instance = imp->getInternalInstance();
-    if (!instance) 
-        return RuntimeObjectImp::throwInvalidAccessError(exec);
-        
     instance->begin();
-    JSValue result = instance->invokeMethod(exec, *method->methods(), args);
+    JSValue result = instance->invokeMethod(exec, method, args);
     instance->end();
     return result;
 }
diff --git a/WebCore/bridge/runtime_method.h b/WebCore/bridge/runtime_method.h
index 914ab00..9c80ba1 100644
--- a/WebCore/bridge/runtime_method.h
+++ b/WebCore/bridge/runtime_method.h
@@ -50,9 +50,11 @@
         return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
     }
 
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+
 private:
     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | InternalFunction::StructureFlags;
-    static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
+    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     virtual CallType getCallData(CallData&);
diff --git a/WebCore/bridge/runtime_object.cpp b/WebCore/bridge/runtime_object.cpp
index 26b85f9..83aae74 100644
--- a/WebCore/bridge/runtime_object.cpp
+++ b/WebCore/bridge/runtime_object.cpp
@@ -34,32 +34,31 @@
 using namespace WebCore;
 
 namespace JSC {
+namespace Bindings {
 
-using namespace Bindings;
+const ClassInfo RuntimeObject::s_info = { "RuntimeObject", 0, 0, 0 };
 
-const ClassInfo RuntimeObjectImp::s_info = { "RuntimeObject", 0, 0, 0 };
-
-RuntimeObjectImp::RuntimeObjectImp(ExecState* exec, PassRefPtr<Instance> instance)
+RuntimeObject::RuntimeObject(ExecState* exec, PassRefPtr<Instance> instance)
     // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
     // We need to pass in the right global object for "i".
-    : JSObject(deprecatedGetDOMStructure<RuntimeObjectImp>(exec))
+    : JSObject(deprecatedGetDOMStructure<RuntimeObject>(exec))
     , m_instance(instance)
 {
 }
 
-RuntimeObjectImp::RuntimeObjectImp(ExecState*, NonNullPassRefPtr<Structure> structure, PassRefPtr<Instance> instance)
+RuntimeObject::RuntimeObject(ExecState*, NonNullPassRefPtr<Structure> structure, PassRefPtr<Instance> instance)
     : JSObject(structure)
     , m_instance(instance)
 {
 }
 
-RuntimeObjectImp::~RuntimeObjectImp()
+RuntimeObject::~RuntimeObject()
 {
     if (m_instance)
         m_instance->willDestroyRuntimeObject();
 }
 
-void RuntimeObjectImp::invalidate()
+void RuntimeObject::invalidate()
 {
     ASSERT(m_instance);
     if (m_instance)
@@ -67,9 +66,9 @@
     m_instance = 0;
 }
 
-JSValue RuntimeObjectImp::fallbackObjectGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue RuntimeObject::fallbackObjectGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    RuntimeObjectImp* thisObj = static_cast<RuntimeObjectImp*>(asObject(slot.slotBase()));
+    RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));
     RefPtr<Instance> instance = thisObj->m_instance;
 
     if (!instance)
@@ -85,9 +84,9 @@
     return result;
 }
 
-JSValue RuntimeObjectImp::fieldGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue RuntimeObject::fieldGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {    
-    RuntimeObjectImp* thisObj = static_cast<RuntimeObjectImp*>(asObject(slot.slotBase()));
+    RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));
     RefPtr<Instance> instance = thisObj->m_instance;
 
     if (!instance)
@@ -104,9 +103,9 @@
     return result;
 }
 
-JSValue RuntimeObjectImp::methodGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValue RuntimeObject::methodGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    RuntimeObjectImp* thisObj = static_cast<RuntimeObjectImp*>(asObject(slot.slotBase()));
+    RuntimeObject* thisObj = static_cast<RuntimeObject*>(asObject(slotBase));
     RefPtr<Instance> instance = thisObj->m_instance;
 
     if (!instance)
@@ -114,16 +113,14 @@
     
     instance->begin();
 
-    Class *aClass = instance->getClass();
-    MethodList methodList = aClass->methodsNamed(propertyName, instance.get());
-    JSValue result = new (exec) RuntimeMethod(exec, propertyName, methodList);
+    JSValue method = instance->getMethod(exec, propertyName);
 
     instance->end();
             
-    return result;
+    return method;
 }
 
-bool RuntimeObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool RuntimeObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
     if (!m_instance) {
         throwInvalidAccessError(exec);
@@ -168,7 +165,7 @@
     return instance->getOwnPropertySlot(this, exec, propertyName, slot);
 }
 
-bool RuntimeObjectImp::getOwnPropertyDescriptor(ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+bool RuntimeObject::getOwnPropertyDescriptor(ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
     if (!m_instance) {
         throwInvalidAccessError(exec);
@@ -217,7 +214,7 @@
     return instance->getOwnPropertyDescriptor(this, exec, propertyName, descriptor);
 }
 
-void RuntimeObjectImp::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
+void RuntimeObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
     if (!m_instance) {
         throwInvalidAccessError(exec);
@@ -237,13 +234,13 @@
     instance->end();
 }
 
-bool RuntimeObjectImp::deleteProperty(ExecState*, const Identifier&)
+bool RuntimeObject::deleteProperty(ExecState*, const Identifier&)
 {
     // Can never remove a property of a RuntimeObject.
     return false;
 }
 
-JSValue RuntimeObjectImp::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
+JSValue RuntimeObject::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
 {
     if (!m_instance)
         return throwInvalidAccessError(exec);
@@ -258,14 +255,15 @@
 
 static JSValue JSC_HOST_CALL callRuntimeObject(ExecState* exec, JSObject* function, JSValue, const ArgList& args)
 {
-    RefPtr<Instance> instance(static_cast<RuntimeObjectImp*>(function)->getInternalInstance());
+    ASSERT(function->inherits(&RuntimeObject::s_info));
+    RefPtr<Instance> instance(static_cast<RuntimeObject*>(function)->getInternalInstance());
     instance->begin();
     JSValue result = instance->invokeDefaultMethod(exec, args);
     instance->end();
     return result;
 }
 
-CallType RuntimeObjectImp::getCallData(CallData& callData)
+CallType RuntimeObject::getCallData(CallData& callData)
 {
     if (!m_instance)
         return CallTypeNone;
@@ -280,7 +278,8 @@
 
 static JSObject* callRuntimeConstructor(ExecState* exec, JSObject* constructor, const ArgList& args)
 {
-    RefPtr<Instance> instance(static_cast<RuntimeObjectImp*>(constructor)->getInternalInstance());
+    ASSERT(constructor->inherits(&RuntimeObject::s_info));
+    RefPtr<Instance> instance(static_cast<RuntimeObject*>(constructor)->getInternalInstance());
     instance->begin();
     JSValue result = instance->invokeConstruct(exec, args);
     instance->end();
@@ -289,7 +288,7 @@
     return result.isObject() ? static_cast<JSObject*>(result.asCell()) : constructor;
 }
 
-ConstructType RuntimeObjectImp::getConstructData(ConstructData& constructData)
+ConstructType RuntimeObject::getConstructData(ConstructData& constructData)
 {
     if (!m_instance)
         return ConstructTypeNone;
@@ -302,7 +301,7 @@
     return ConstructTypeHost;
 }
 
-void RuntimeObjectImp::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode)
+void RuntimeObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode)
 {
     if (!m_instance) {
         throwInvalidAccessError(exec);
@@ -316,9 +315,10 @@
     instance->end();
 }
 
-JSObject* RuntimeObjectImp::throwInvalidAccessError(ExecState* exec)
+JSObject* RuntimeObject::throwInvalidAccessError(ExecState* exec)
 {
     return throwError(exec, ReferenceError, "Trying to access object from destroyed plug-in.");
 }
 
 }
+}
diff --git a/WebCore/bridge/runtime_object.h b/WebCore/bridge/runtime_object.h
index ef5a2f7..b735e36 100644
--- a/WebCore/bridge/runtime_object.h
+++ b/WebCore/bridge/runtime_object.h
@@ -30,11 +30,12 @@
 #include <runtime/JSGlobalObject.h>
 
 namespace JSC {
+namespace Bindings {
 
-class RuntimeObjectImp : public JSObject {
+class RuntimeObject : public JSObject {
 public:
-    RuntimeObjectImp(ExecState*, PassRefPtr<Bindings::Instance>);
-    virtual ~RuntimeObjectImp();
+    RuntimeObject(ExecState*, PassRefPtr<Instance>);
+    virtual ~RuntimeObject();
 
     virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);
@@ -48,7 +49,7 @@
 
     void invalidate();
 
-    Bindings::Instance* getInternalInstance() const { return m_instance.get(); }
+    Instance* getInternalInstance() const { return m_instance.get(); }
 
     static JSObject* throwInvalidAccessError(ExecState*);
 
@@ -66,18 +67,19 @@
 
 protected:
     static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
-    RuntimeObjectImp(ExecState*, NonNullPassRefPtr<Structure>, PassRefPtr<Bindings::Instance>);
+    RuntimeObject(ExecState*, NonNullPassRefPtr<Structure>, PassRefPtr<Instance>);
 
 private:
     virtual const ClassInfo* classInfo() const { return &s_info; }
     
-    static JSValue fallbackObjectGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue fieldGetter(ExecState*, const Identifier&, const PropertySlot&);
-    static JSValue methodGetter(ExecState*, const Identifier&, const PropertySlot&);
+    static JSValue fallbackObjectGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue fieldGetter(ExecState*, JSValue, const Identifier&);
+    static JSValue methodGetter(ExecState*, JSValue, const Identifier&);
 
-    RefPtr<Bindings::Instance> m_instance;
+    RefPtr<Instance> m_instance;
 };
     
-} // namespace
+}
+}
 
 #endif
diff --git a/WebCore/bridge/runtime_root.cpp b/WebCore/bridge/runtime_root.cpp
index b179d56..09fd43b 100644
--- a/WebCore/bridge/runtime_root.cpp
+++ b/WebCore/bridge/runtime_root.cpp
@@ -101,8 +101,8 @@
         return;
 
     {
-        HashSet<RuntimeObjectImp*>::iterator end = m_runtimeObjects.end();
-        for (HashSet<RuntimeObjectImp*>::iterator it = m_runtimeObjects.begin(); it != end; ++it)
+        HashSet<RuntimeObject*>::iterator end = m_runtimeObjects.end();
+        for (HashSet<RuntimeObject*>::iterator it = m_runtimeObjects.begin(); it != end; ++it)
             (*it)->invalidate();
         
         m_runtimeObjects.clear();
@@ -168,7 +168,7 @@
     return m_globalObject;
 }
 
-void RootObject::addRuntimeObject(RuntimeObjectImp* object)
+void RootObject::addRuntimeObject(RuntimeObject* object)
 {
     ASSERT(m_isValid);
     ASSERT(!m_runtimeObjects.contains(object));
@@ -176,7 +176,7 @@
     m_runtimeObjects.add(object);
 }        
     
-void RootObject::removeRuntimeObject(RuntimeObjectImp* object)
+void RootObject::removeRuntimeObject(RuntimeObject* object)
 {
     ASSERT(m_isValid);
     ASSERT(m_runtimeObjects.contains(object));
diff --git a/WebCore/bridge/runtime_root.h b/WebCore/bridge/runtime_root.h
index a81afb8..04f382a 100644
--- a/WebCore/bridge/runtime_root.h
+++ b/WebCore/bridge/runtime_root.h
@@ -41,11 +41,11 @@
 
 class Interpreter;
 class JSGlobalObject;
-class RuntimeObjectImp;
 
 namespace Bindings {
 
 class RootObject;
+class RuntimeObject;
 
 typedef HashCountedSet<JSObject*> ProtectCountSet;
 
@@ -70,8 +70,8 @@
     const void* nativeHandle() const;
     JSGlobalObject* globalObject() const;
 
-    void addRuntimeObject(RuntimeObjectImp*);
-    void removeRuntimeObject(RuntimeObjectImp*);
+    void addRuntimeObject(RuntimeObject*);
+    void removeRuntimeObject(RuntimeObject*);
 
     struct InvalidationCallback {
         virtual void operator()(RootObject*) = 0;
@@ -88,7 +88,7 @@
     ProtectedPtr<JSGlobalObject> m_globalObject;
 
     ProtectCountSet m_protectCountSet;
-    HashSet<RuntimeObjectImp*> m_runtimeObjects;    
+    HashSet<RuntimeObject*> m_runtimeObjects;    
 
     HashSet<InvalidationCallback*> m_invalidationCallbacks;
 };
diff --git a/WebCore/config.h b/WebCore/config.h
index b61c2ad..1e2860f 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -43,8 +43,6 @@
 #define WEBKIT_EXPORTDATA
 #endif
 
-#define MOBILE 0
-
 #ifdef __APPLE__
 #define HAVE_FUNC_USLEEP 1
 #endif /* __APPLE__ */
@@ -212,9 +210,6 @@
 // On MSW, wx headers need to be included before windows.h is.
 // The only way we can always ensure this is if we include wx here.
 #if PLATFORM(WX)
-// The defines in KeyboardCodes.h conflict with Windows as well, and the only way I've found
-// to address the problem is include KeyboarddCodes.h before windows.h, so do it here.
-#include "KeyboardCodes.h"
 #include <wx/defs.h>
 #endif
 
@@ -227,7 +222,7 @@
 
 #if COMPILER(MSVC)
 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
-#else
+#elif !COMPILER(WINSCW)
 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
 #endif
 
@@ -266,19 +261,7 @@
 #endif // PLATFORM(MAC)
 
 #if OS(SYMBIAN)
-#undef WIN32
-#undef _WIN32
-#undef SKIP_STATIC_CONSTRUCTORS_ON_GCC
 #define USE_SYSTEM_MALLOC 1
-#define U_HAVE_INT8_T 0
-#define U_HAVE_INT16_T 0
-#define U_HAVE_INT32_T 0
-#define U_HAVE_INT64_T 0
-#define U_HAVE_INTTYPES_H 0
-
-#include <stdio.h>
-#include <limits.h>
-#include <wtf/MathExtras.h>
 #endif
 
 #if PLATFORM(CHROMIUM)
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 7ed9385..d7f585f 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -31,6 +31,7 @@
 #include "CSSProperty.h"
 #include "CSSPropertyNames.h"
 #include "CSSReflectValue.h"
+#include "CSSSelector.h"
 #include "CSSTimingFunctionValue.h"
 #include "CSSValueList.h"
 #include "Document.h"
@@ -150,6 +151,7 @@
     CSSPropertyWebkitAnimationDelay,
     CSSPropertyWebkitAnimationDirection,
     CSSPropertyWebkitAnimationDuration,
+    CSSPropertyWebkitAnimationFillMode,
     CSSPropertyWebkitAnimationIterationCount,
     CSSPropertyWebkitAnimationName,
     CSSPropertyWebkitAnimationPlayState,
@@ -299,28 +301,28 @@
     
     // Create the slices.
     RefPtr<CSSPrimitiveValue> top;
-    if (image.m_slices.top().isPercent())
-        top = CSSPrimitiveValue::create(image.m_slices.top().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
+    if (image.slices().top().isPercent())
+        top = CSSPrimitiveValue::create(image.slices().top().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
     else
-        top = CSSPrimitiveValue::create(image.m_slices.top().value(), CSSPrimitiveValue::CSS_NUMBER);
+        top = CSSPrimitiveValue::create(image.slices().top().value(), CSSPrimitiveValue::CSS_NUMBER);
         
     RefPtr<CSSPrimitiveValue> right;
-    if (image.m_slices.right().isPercent())
-        right = CSSPrimitiveValue::create(image.m_slices.right().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
+    if (image.slices().right().isPercent())
+        right = CSSPrimitiveValue::create(image.slices().right().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
     else
-        right = CSSPrimitiveValue::create(image.m_slices.right().value(), CSSPrimitiveValue::CSS_NUMBER);
+        right = CSSPrimitiveValue::create(image.slices().right().value(), CSSPrimitiveValue::CSS_NUMBER);
         
     RefPtr<CSSPrimitiveValue> bottom;
-    if (image.m_slices.bottom().isPercent())
-        bottom = CSSPrimitiveValue::create(image.m_slices.bottom().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
+    if (image.slices().bottom().isPercent())
+        bottom = CSSPrimitiveValue::create(image.slices().bottom().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
     else
-        bottom = CSSPrimitiveValue::create(image.m_slices.bottom().value(), CSSPrimitiveValue::CSS_NUMBER);
+        bottom = CSSPrimitiveValue::create(image.slices().bottom().value(), CSSPrimitiveValue::CSS_NUMBER);
     
     RefPtr<CSSPrimitiveValue> left;
-    if (image.m_slices.left().isPercent())
-        left = CSSPrimitiveValue::create(image.m_slices.left().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
+    if (image.slices().left().isPercent())
+        left = CSSPrimitiveValue::create(image.slices().left().value(), CSSPrimitiveValue::CSS_PERCENTAGE);
     else
-        left = CSSPrimitiveValue::create(image.m_slices.left().value(), CSSPrimitiveValue::CSS_NUMBER);
+        left = CSSPrimitiveValue::create(image.slices().left().value(), CSSPrimitiveValue::CSS_NUMBER);
 
     RefPtr<Rect> rect = Rect::create();
     rect->setTop(top);
@@ -328,7 +330,7 @@
     rect->setBottom(bottom);
     rect->setLeft(left);
 
-    return CSSBorderImageValue::create(imageValue, rect, valueForRepeatRule(image.m_horizontalRule), valueForRepeatRule(image.m_verticalRule));
+    return CSSBorderImageValue::create(imageValue, rect, valueForRepeatRule(image.horizontalRule()), valueForRepeatRule(image.verticalRule()));
 }
 
 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection)
@@ -507,9 +509,13 @@
     return list.release();
 }
 
-CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(PassRefPtr<Node> n)
+CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(PassRefPtr<Node> n, bool allowVisitedStyle, const String& pseudoElementName)
     : m_node(n)
+    , m_allowVisitedStyle(allowVisitedStyle)
 {
+    unsigned nameWithoutColonsStart = pseudoElementName[0] == ':' ? (pseudoElementName[1] == ':' ? 2 : 1) : 0;
+    m_pseudoElementSpecifier = CSSSelector::pseudoId(CSSSelector::parsePseudoType(
+        AtomicString(pseudoElementName.substring(nameWithoutColonsStart))));
 }
 
 CSSComputedStyleDeclaration::~CSSComputedStyleDeclaration()
@@ -552,7 +558,7 @@
 
     node->document()->updateLayoutIgnorePendingStylesheets();
 
-    RefPtr<RenderStyle> style = node->computedStyle();
+    RefPtr<RenderStyle> style = node->computedStyle(m_pseudoElementSpecifier);
     if (!style)
         return 0;
 
@@ -570,13 +576,13 @@
     CSSPropertyID propertyID = static_cast<CSSPropertyID>(id);
 
     RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-    for (const ShadowData* s = shadow; s; s = s->next) {
-        RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread, CSSPrimitiveValue::CSS_PX);
-        RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);
-        RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color.rgb());
+    for (const ShadowData* s = shadow; s; s = s->next()) {
+        RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x(), CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y(), CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur(), CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread(), CSSPrimitiveValue::CSS_PX);
+        RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style() == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);
+        RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color().rgb());
         list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release()));
     }
     return list.release();
@@ -637,9 +643,9 @@
     // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand.
     if (xRepeat == yRepeat)
         return CSSPrimitiveValue::create(xRepeat);
-    if (xRepeat == CSSValueRepeat && yRepeat == CSSValueNoRepeat)
+    if (xRepeat == RepeatFill && yRepeat == NoRepeatFill)
         return CSSPrimitiveValue::createIdentifier(CSSValueRepeatX);
-    if (xRepeat == CSSValueNoRepeat && yRepeat == CSSValueRepeat)
+    if (xRepeat == NoRepeatFill && yRepeat == RepeatFill)
         return CSSPrimitiveValue::createIdentifier(CSSValueRepeatY);
 
     RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
@@ -670,10 +676,15 @@
     RenderObject* renderer = node->renderer();
 
     RefPtr<RenderStyle> style;
-    if (renderer && hasCompositedLayer(renderer) && AnimationController::supportsAcceleratedAnimationOfProperty(static_cast<CSSPropertyID>(propertyID)))
+    if (renderer && hasCompositedLayer(renderer) && AnimationController::supportsAcceleratedAnimationOfProperty(static_cast<CSSPropertyID>(propertyID))) {
         style = renderer->animation()->getAnimatedStyleForRenderer(renderer);
-    else
-       style = node->computedStyle();
+        if (m_pseudoElementSpecifier) {
+            // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
+            style = style->getCachedPseudoStyle(m_pseudoElementSpecifier);
+        }
+    } else
+        style = node->computedStyle(m_pseudoElementSpecifier);
+
     if (!style)
         return 0;
 
@@ -686,7 +697,7 @@
             break;
 
         case CSSPropertyBackgroundColor:
-            return CSSPrimitiveValue::createColor(style->backgroundColor().rgb());
+            return CSSPrimitiveValue::createColor(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor().rgb());
         case CSSPropertyBackgroundImage:
             if (style->backgroundImage())
                 return style->backgroundImage()->cssValue();
@@ -743,13 +754,13 @@
         case CSSPropertyWebkitBorderVerticalSpacing:
             return CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX);
         case CSSPropertyBorderTopColor:
-            return currentColorOrValidColor(style.get(), style->borderTopColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style.get(), style->borderTopColor());
         case CSSPropertyBorderRightColor:
-            return currentColorOrValidColor(style.get(), style->borderRightColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidColor(style.get(), style->borderRightColor());
         case CSSPropertyBorderBottomColor:
-            return currentColorOrValidColor(style.get(), style->borderBottomColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValidColor(style.get(), style->borderBottomColor());
         case CSSPropertyBorderLeftColor:
-            return currentColorOrValidColor(style.get(), style->borderLeftColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidColor(style.get(), style->borderLeftColor());
         case CSSPropertyBorderTopStyle:
             return CSSPrimitiveValue::create(style->borderTopStyle());
         case CSSPropertyBorderRightStyle:
@@ -799,7 +810,7 @@
         case CSSPropertyClear:
             return CSSPrimitiveValue::create(style->clear());
         case CSSPropertyColor:
-            return CSSPrimitiveValue::createColor(style->color().rgb());
+            return CSSPrimitiveValue::createColor(m_allowVisitedStyle ? style->visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb());
         case CSSPropertyWebkitColumnCount:
             if (style->hasAutoColumnCount())
                 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
@@ -809,7 +820,7 @@
                 return CSSPrimitiveValue::createIdentifier(CSSValueNormal);
             return CSSPrimitiveValue::create(style->columnGap(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitColumnRuleColor:
-            return currentColorOrValidColor(style.get(), style->columnRuleColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style.get(), style->columnRuleColor());
         case CSSPropertyWebkitColumnRuleStyle:
             return CSSPrimitiveValue::create(style->columnRuleStyle());
         case CSSPropertyWebkitColumnRuleWidth:
@@ -830,7 +841,7 @@
             if (cursors && cursors->size() > 0) {
                 list = CSSValueList::createCommaSeparated();
                 for (unsigned i = 0; i < cursors->size(); ++i)
-                    list->append(CSSPrimitiveValue::create((*cursors)[i].cursorImage->url(), CSSPrimitiveValue::CSS_URI));
+                    list->append(CSSPrimitiveValue::create((*cursors)[i].image()->url(), CSSPrimitiveValue::CSS_URI));
             }
             RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor());
             if (list) {
@@ -972,9 +983,14 @@
                 return style->maskImage()->cssValue();
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyWebkitMaskSize: {
+            EFillSizeType size = style->maskSizeType();
+            if (size == Contain)
+                return CSSPrimitiveValue::createIdentifier(CSSValueContain);
+            if (size == Cover)
+                return CSSPrimitiveValue::createIdentifier(CSSValueCover);
             RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
-            list->append(CSSPrimitiveValue::create(style->maskSize().width()));
-            list->append(CSSPrimitiveValue::create(style->maskSize().height()));
+            list->append(CSSPrimitiveValue::create(style->maskSizeLength().width()));
+            list->append(CSSPrimitiveValue::create(style->maskSizeLength().height()));
             return list.release();
         }  
         case CSSPropertyWebkitMaskRepeat:
@@ -1023,7 +1039,7 @@
         case CSSPropertyOrphans:
             return CSSPrimitiveValue::create(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyOutlineColor:
-            return currentColorOrValidColor(style.get(), style->outlineColor());
+            return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style.get(), style->outlineColor());
         case CSSPropertyOutlineStyle:
             if (style->outlineStyleIsAuto())
                 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
@@ -1241,6 +1257,30 @@
         }
         case CSSPropertyWebkitAnimationDuration:
             return getDurationValue(style->animations());
+        case CSSPropertyWebkitAnimationFillMode: {
+            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+            const AnimationList* t = style->animations();
+            if (t) {
+                for (size_t i = 0; i < t->size(); ++i) {
+                    switch (t->animation(i)->fillMode()) {
+                    case AnimationFillModeNone:
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueNone));
+                        break;
+                    case AnimationFillModeForwards:
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueForwards));
+                        break;
+                    case AnimationFillModeBackwards:
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueBackwards));
+                        break;
+                    case AnimationFillModeBoth:
+                        list->append(CSSPrimitiveValue::createIdentifier(CSSValueBoth));
+                        break;
+                    }
+                }
+            } else
+                list->append(CSSPrimitiveValue::createIdentifier(CSSValueNone));
+            return list.release();
+        }
         case CSSPropertyWebkitAnimationIterationCount: {
             RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
             const AnimationList* t = style->animations();
@@ -1512,7 +1552,7 @@
     if (!node)
         return 0;
 
-    RenderStyle* style = node->computedStyle();
+    RenderStyle* style = node->computedStyle(m_pseudoElementSpecifier);
     if (!style)
         return 0;
 
@@ -1531,7 +1571,7 @@
 {
     if (property->id() == CSSPropertyFontSize && property->value()->isPrimitiveValue() && m_node) {
         m_node->document()->updateLayoutIgnorePendingStylesheets();
-        RenderStyle* style = m_node->computedStyle();
+        RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier);
         if (style && style->fontDescription().keywordSize()) {
             int sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(property->value());
diff --git a/WebCore/css/CSSComputedStyleDeclaration.h b/WebCore/css/CSSComputedStyleDeclaration.h
index 842a995..eb93bad 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.h
+++ b/WebCore/css/CSSComputedStyleDeclaration.h
@@ -23,6 +23,7 @@
 
 #include "CSSStyleDeclaration.h"
 #include "Node.h"
+#include "RenderStyleConstants.h"
 
 namespace WebCore {
 
@@ -33,7 +34,7 @@
 
 class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
 public:
-    friend PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node>);
+    friend PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node>, bool allowVisitedStyle, const String& pseudoElementName);
     virtual ~CSSComputedStyleDeclaration();
 
     virtual String cssText() const;
@@ -60,7 +61,7 @@
     virtual bool cssPropertyMatches(const CSSProperty*) const;
 
 private:
-    CSSComputedStyleDeclaration(PassRefPtr<Node>);
+    CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
 
     virtual void setCssText(const String&, ExceptionCode&);
 
@@ -70,11 +71,13 @@
     PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int) const;
 
     RefPtr<Node> m_node;
+    PseudoId m_pseudoElementSpecifier;
+    bool m_allowVisitedStyle;
 };
 
-inline PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node> node)
+inline PassRefPtr<CSSComputedStyleDeclaration> computedStyle(PassRefPtr<Node> node,  bool allowVisitedStyle = false, const String& pseudoElementName = String())
 {
-    return adoptRef(new CSSComputedStyleDeclaration(node));
+    return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoElementName));
 }
 
 } // namespace WebCore
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index 1354e68..921b149 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -36,7 +36,9 @@
 #include "SimpleFontData.h"
 
 #if ENABLE(SVG_FONTS)
+#if !PLATFORM(WX)
 #include "FontCustomPlatformData.h"
+#endif
 #include "HTMLNames.h"
 #include "SVGFontData.h"
 #include "SVGFontElement.h"
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 9d5eb6e..ec0c141 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -246,6 +246,7 @@
 
 %type <integer> match
 %type <integer> unary_operator
+%type <integer> maybe_unary_operator
 %type <character> operator
 
 %type <valueList> expr
@@ -767,6 +768,11 @@
   | '>' maybe_space { $$ = CSSSelector::Child; }
   ;
 
+maybe_unary_operator:
+    unary_operator { $$ = $1; }
+    | { $$ = 1; }
+    ;
+
 unary_operator:
     '-' { $$ = -1; }
   | '+' { $$ = 1; }
@@ -786,6 +792,7 @@
             deleteAllValues(*$$);
             $$->shrink(0);
             $$->append(p->sinkFloatingSelector($1));
+            p->updateLastSelectorLine();
         }
     }
     | selector_list ',' maybe_space selector %prec UNIMPORTANT_TOK {
@@ -793,6 +800,7 @@
             CSSParser* p = static_cast<CSSParser*>(parser);
             $$ = $1;
             $$->append(p->sinkFloatingSelector($4));
+            p->updateLastSelectorLine();
         } else
             $$ = 0;
     }
@@ -1087,6 +1095,10 @@
             CSSParser* p = static_cast<CSSParser*>(parser);
             if (Document* doc = p->document())
                 doc->setUsesBeforeAfterRules(true);
+        } else if (type == CSSSelector::PseudoLink || type == CSSSelector::PseudoVisited) {
+            CSSParser* p = static_cast<CSSParser*>(parser);
+            if (Document* doc = p->document())
+                doc->setUsesLinkRules(true);
         }
     }
     | ':' ':' IDENT {
@@ -1127,11 +1139,11 @@
         }
     }
     // used by :nth-*
-    | ':' FUNCTION maybe_space INTEGER maybe_space ')' {
+    | ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space ')' {
         CSSParser *p = static_cast<CSSParser*>(parser);
         $$ = p->createFloatingSelector();
         $$->m_match = CSSSelector::PseudoClass;
-        $$->setArgument(String::number($4));
+        $$->setArgument(String::number($4 * $5));
         $$->m_value = $2;
         CSSSelector::PseudoType type = $$->pseudoType();
         if (type == CSSSelector::PseudoUnknown)
@@ -1165,7 +1177,7 @@
     }
     // used by :not
     | ':' NOTFUNCTION maybe_space simple_selector maybe_space ')' {
-        if (!$4 || $4->simpleSelector() || $4->tagHistory())
+        if (!$4 || !$4->isSimple())
             $$ = 0;
         else {
             CSSParser* p = static_cast<CSSParser*>(parser);
diff --git a/WebCore/css/CSSImportRule.cpp b/WebCore/css/CSSImportRule.cpp
index 95ed032..b4d7e69 100644
--- a/WebCore/css/CSSImportRule.cpp
+++ b/WebCore/css/CSSImportRule.cpp
@@ -88,7 +88,10 @@
         // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
         DEFINE_STATIC_LOCAL(const String, slashKHTMLFixesDotCss, ("/KHTMLFixes.css"));
         DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));
-        if (baseURL.string().endsWith(slashKHTMLFixesDotCss) && sheetText == mediaWikiKHTMLFixesStyleSheet) {
+        // There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
+        // while the other lacks the second trailing newline.
+        if (baseURL.string().endsWith(slashKHTMLFixesDotCss) && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
+                && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.length() - 1) {
             ASSERT(m_styleSheet->length() == 1);
             ExceptionCode ec;
             m_styleSheet->deleteRule(0, ec);
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index f5b2cbc..466e741 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "CSSParser.h"
 
-#include "CString.h"
 #include "CSSTimingFunctionValue.h"
 #include "CSSBorderImageValue.h"
 #include "CSSCanvasValue.h"
@@ -66,6 +65,7 @@
 #include "Pair.h"
 #include "Rect.h"
 #include "ShadowValue.h"
+#include "StringBuffer.h"
 #include "WebKitCSSKeyframeRule.h"
 #include "WebKitCSSKeyframesRule.h"
 #include "WebKitCSSTransformValue.h"
@@ -147,6 +147,8 @@
     , m_defaultNamespace(starAtom)
     , m_data(0)
     , yy_start(1)
+    , m_line(0)
+    , m_lastSelectorLine(0)
     , m_allowImportRules(true)
     , m_allowVariablesRules(true)
     , m_allowNamespaceDeclarations(true)
@@ -421,7 +423,7 @@
 
 void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool important)
 {
-    auto_ptr<CSSProperty> prop(new CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand));
+    OwnPtr<CSSProperty> prop(new CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand));
     if (m_numParsedProperties >= m_maxParsedProperties) {
         m_maxParsedProperties += 32;
         if (m_maxParsedProperties > UINT_MAX / sizeof(CSSProperty*))
@@ -993,7 +995,7 @@
         if (id == CSSValueThin || id == CSSValueMedium || id == CSSValueThick)
             validPrimitive = true;
         else
-            validPrimitive = validUnit(value, FLength, m_strict);
+            validPrimitive = validUnit(value, FLength | FNonNeg, m_strict);
         break;
 
     case CSSPropertyLetterSpacing:       // normal | <length> | inherit
@@ -1445,6 +1447,7 @@
     case CSSPropertyWebkitAnimationDelay:
     case CSSPropertyWebkitAnimationDirection:
     case CSSPropertyWebkitAnimationDuration:
+    case CSSPropertyWebkitAnimationFillMode:
     case CSSPropertyWebkitAnimationName:
     case CSSPropertyWebkitAnimationPlayState:
     case CSSPropertyWebkitAnimationIterationCount:
@@ -1950,7 +1953,8 @@
                                 CSSPropertyWebkitAnimationTimingFunction,
                                 CSSPropertyWebkitAnimationDelay,
                                 CSSPropertyWebkitAnimationIterationCount,
-                                CSSPropertyWebkitAnimationDirection };
+                                CSSPropertyWebkitAnimationDirection,
+                                CSSPropertyWebkitAnimationFillMode };
     const int numProperties = sizeof(properties) / sizeof(properties[0]);
     
     ShorthandScope scope(this, CSSPropertyWebkitAnimation);
@@ -2631,6 +2635,14 @@
     return 0;
 }
 
+PassRefPtr<CSSValue> CSSParser::parseAnimationFillMode()
+{
+    CSSParserValue* value = m_valueList->current();
+    if (value->id == CSSValueNone || value->id == CSSValueForwards || value->id == CSSValueBackwards || value->id == CSSValueBoth)
+        return CSSPrimitiveValue::createIdentifier(value->id);
+    return 0;
+}
+
 PassRefPtr<CSSValue> CSSParser::parseAnimationIterationCount()
 {
     CSSParserValue* value = m_valueList->current();
@@ -2773,6 +2785,11 @@
                     if (currValue)
                         m_valueList->next();
                     break;
+                case CSSPropertyWebkitAnimationFillMode:
+                    currValue = parseAnimationFillMode();
+                    if (currValue)
+                        m_valueList->next();
+                    break;
                 case CSSPropertyWebkitAnimationIterationCount:
                     currValue = parseAnimationIterationCount();
                     if (currValue)
@@ -3551,19 +3568,66 @@
     return true;
 }
 
+static inline bool isCSSWhitespace(UChar c)
+{
+    return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f';
+}
+
+static inline bool parseInt(const UChar*& string, const UChar* end, UChar terminator, int& value)
+{
+    const UChar* current = string;
+    int localValue = 0;
+    bool negative = false;
+    while (current != end && isCSSWhitespace(*current)) 
+        current++;
+    if (current != end && *current == '-') {
+        negative = true;
+        current++;
+    }
+    if (current == end || !isASCIIDigit(*current))
+        return false;
+    while (current != end && isASCIIDigit(*current))
+        localValue = localValue * 10 + *current++ - '0';
+    while (current != end && isCSSWhitespace(*current))
+        current++;
+    if (current == end || *current++ != terminator)
+        return false;
+    // Clamp negative values at zero.
+    value = negative ? 0 : localValue;
+    string = current;
+    return true;
+}
+
 bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
 {
     if (!strict && Color::parseHexColor(name, rgb))
         return true;
 
-    // try a little harder
+    // Try rgb() syntax.
+    if (name.startsWith("rgb(")) {
+        const UChar* current = name.characters() + 4;
+        const UChar* end = name.characters() + name.length();
+        int red;
+        int green;
+        int blue;
+        if (!parseInt(current, end, ',', red))
+            return false;
+        if (!parseInt(current, end, ',', green))
+            return false;
+        if (!parseInt(current, end, ')', blue))
+            return false;
+        if (current != end)
+            return false;
+        rgb = makeRGB(red, green, blue);
+        return true;
+    }        
+    // Try named colors.
     Color tc;
     tc.setNamedColor(name);
     if (tc.isValid()) {
         rgb = tc.rgb();
         return true;
     }
-
     return false;
 }
 
@@ -3596,7 +3660,9 @@
         v = args->next();
         if (!validUnit(v, FNumber, true))
             return false;
-        colorArray[3] = static_cast<int>(max(0.0, min(1.0, v->fValue)) * 255);
+        // Convert the floating pointer number of alpha to an integer in the range [0, 256),
+        // with an equal distribution across all 256 values.
+        colorArray[3] = static_cast<int>(max(0.0, min(1.0, v->fValue)) * nextafter(256.0, 0.0));
     }
     return true;
 }
@@ -4688,7 +4754,7 @@
 {
     YYSTYPE* yylval = static_cast<YYSTYPE*>(yylvalWithoutType);
     int length;
-    
+
     lex();
 
     UChar* t = text(&length);
@@ -4762,11 +4828,6 @@
     return token();
 }
 
-static inline bool isCSSWhitespace(UChar c)
-{
-    return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f';
-}
-
 void CSSParser::recheckAtKeyword(const UChar* str, int len)
 {
     String ruleName(str, len);
@@ -4918,6 +4979,14 @@
     return start;
 }
 
+void CSSParser::countLines()
+{
+    for (UChar* current = yytext; current < yytext + yyleng; ++current) {
+        if (*current == '\n')
+            ++m_line;
+    }
+}
+
 CSSSelector* CSSParser::createFloatingSelector()
 {
     CSSSelector* selector = fastNew<CSSSelector>();
@@ -5087,7 +5156,7 @@
     m_allowImportRules = m_allowNamespaceDeclarations = m_allowVariablesRules = false;
     CSSStyleRule* result = 0;
     if (selectors) {
-        RefPtr<CSSStyleRule> rule = CSSStyleRule::create(m_styleSheet);
+        RefPtr<CSSStyleRule> rule = CSSStyleRule::create(m_styleSheet, m_lastSelectorLine);
         rule->adoptSelectorVector(*selectors);
         if (m_hasFontFaceOnlyValues)
             deleteFontFaceOnlyValues();
@@ -5398,6 +5467,120 @@
     return hashTableEntry ? hashTableEntry->id : 0;
 }
 
+// "ident" from the CSS tokenizer, minus backslash-escape sequences
+static bool isCSSTokenizerIdentifier(const String& string)
+{
+    const UChar* p = string.characters();
+    const UChar* end = p + string.length();
+
+    // -?
+    if (p != end && p[0] == '-')
+        ++p;
+
+    // {nmstart}
+    if (p == end || !(p[0] == '_' || p[0] >= 128 || isASCIIAlpha(p[0])))
+        return false;
+    ++p;
+
+    // {nmchar}*
+    for (; p != end; ++p) {
+        if (!(p[0] == '_' || p[0] == '-' || p[0] >= 128 || isASCIIAlphanumeric(p[0])))
+            return false;
+    }
+
+    return true;
+}
+
+// "url" from the CSS tokenizer, minus backslash-escape sequences
+static bool isCSSTokenizerURL(const String& string)
+{
+    const UChar* p = string.characters();
+    const UChar* end = p + string.length();
+
+    for (; p != end; ++p) {
+        UChar c = p[0];
+        switch (c) {
+            case '!':
+            case '#':
+            case '$':
+            case '%':
+            case '&':
+                break;
+            default:
+                if (c < '*')
+                    return false;
+                if (c <= '~')
+                    break;
+                if (c < 128)
+                    return false;
+        }
+    }
+
+    return true;
+}
+
+// We use single quotes for now because markup.cpp uses double quotes.
+String quoteCSSString(const String& string)
+{
+    // For efficiency, we first pre-calculate the length of the quoted string, then we build the actual one.
+    // Please see below for the actual logic.
+    unsigned quotedStringSize = 2; // Two quotes surrounding the entire string.
+    bool afterEscape = false;
+    for (unsigned i = 0; i < string.length(); ++i) {
+        UChar ch = string[i];
+        if (ch == '\\' || ch == '\'') {
+            quotedStringSize += 2;
+            afterEscape = false;
+        } else if (ch < 0x20 || ch == 0x7F) {
+            quotedStringSize += 2 + (ch >= 0x10);
+            afterEscape = true;
+        } else {
+            quotedStringSize += 1 + (afterEscape && (isASCIIHexDigit(ch) || ch == ' '));
+            afterEscape = false;
+        }
+    }
+
+    StringBuffer buffer(quotedStringSize);
+    unsigned index = 0;
+    buffer[index++] = '\'';
+    afterEscape = false;
+    for (unsigned i = 0; i < string.length(); ++i) {
+        UChar ch = string[i];
+        if (ch == '\\' || ch == '\'') {
+            buffer[index++] = '\\';
+            buffer[index++] = ch;
+            afterEscape = false;
+        } else if (ch < 0x20 || ch == 0x7F) { // Control characters.
+            static const char hexDigits[17] = "0123456789abcdef";
+            buffer[index++] = '\\';
+            if (ch >= 0x10)
+                buffer[index++] = hexDigits[ch >> 4];
+            buffer[index++] = hexDigits[ch & 0xF];
+            afterEscape = true;
+        } else {
+            // Space character may be required to separate backslash-escape sequence and normal characters.
+            if (afterEscape && (isASCIIHexDigit(ch) || ch == ' '))
+                buffer[index++] = ' ';
+            buffer[index++] = ch;
+            afterEscape = false;
+        }
+    }
+    buffer[index++] = '\'';
+
+    ASSERT(quotedStringSize == index);
+    return String::adopt(buffer);
+}
+
+String quoteCSSStringIfNeeded(const String& string)
+{
+    return isCSSTokenizerIdentifier(string) ? string : quoteCSSString(string);
+}
+
+String quoteCSSURLIfNeeded(const String& string)
+{
+    return isCSSTokenizerURL(string) ? string : quoteCSSString(string);
+}
+
 #define YY_DECL int CSSParser::lex()
 #define yyconst const
 typedef int yy_state_type;
diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h
index 3922a2a..ca8c66a 100644
--- a/WebCore/css/CSSParser.h
+++ b/WebCore/css/CSSParser.h
@@ -95,6 +95,7 @@
         PassRefPtr<CSSValue> parseAnimationDelay();
         PassRefPtr<CSSValue> parseAnimationDirection();
         PassRefPtr<CSSValue> parseAnimationDuration();
+        PassRefPtr<CSSValue> parseAnimationFillMode();
         PassRefPtr<CSSValue> parseAnimationIterationCount();
         PassRefPtr<CSSValue> parseAnimationName();
         PassRefPtr<CSSValue> parseAnimationPlayState();
@@ -194,9 +195,11 @@
         bool checkForVariables(CSSParserValueList*);
         void addUnresolvedProperty(int propId, bool important);
         void invalidBlockHit();
-        
+
         Vector<CSSSelector*>* reusableSelectorVector() { return &m_reusableSelectorVector; }
 
+        void updateLastSelectorLine() { m_lastSelectorLine = m_line; }
+
         bool m_strict;
         bool m_important;
         int m_id;
@@ -226,6 +229,7 @@
         int lex(void* yylval);
         int token() { return yyTok; }
         UChar* text(int* length);
+        void countLines();
         int lex();
         
     private:
@@ -252,6 +256,8 @@
         int yyleng;
         int yyTok;
         int yy_start;
+        int m_line;
+        int m_lastSelectorLine;
 
         bool m_allowImportRules;
         bool m_allowVariablesRules;
@@ -314,6 +320,10 @@
         CSSParser* m_parser;
     };
 
+    String quoteCSSString(const String&);
+    String quoteCSSStringIfNeeded(const String&);
+    String quoteCSSURLIfNeeded(const String&);
+
 } // namespace WebCore
 
 #endif // CSSParser_h
diff --git a/WebCore/css/CSSPrimitiveValue.cpp b/WebCore/css/CSSPrimitiveValue.cpp
index 012aa56..210d6f5 100644
--- a/WebCore/css/CSSPrimitiveValue.cpp
+++ b/WebCore/css/CSSPrimitiveValue.cpp
@@ -22,6 +22,7 @@
 #include "CSSPrimitiveValue.h"
 
 #include "CSSHelper.h"
+#include "CSSParser.h"
 #include "CSSPropertyNames.h"
 #include "CSSStyleSheet.h"
 #include "CSSValueKeywords.h"
@@ -116,83 +117,30 @@
     return adoptRef(new CSSPrimitiveValue(value, type));
 }
 
-static const char* valueOrPropertyName(int valueOrPropertyID)
+static const AtomicString& valueOrPropertyName(int valueOrPropertyID)
 {
-    if (const char* valueName = getValueName(valueOrPropertyID))
-        return valueName;
-    return getPropertyName(static_cast<CSSPropertyID>(valueOrPropertyID));
-}
+    ASSERT_ARG(valueOrPropertyID, valueOrPropertyID >= 0);
+    ASSERT_ARG(valueOrPropertyID, valueOrPropertyID < numCSSValueKeywords || (valueOrPropertyID >= firstCSSProperty && valueOrPropertyID < firstCSSProperty + numCSSProperties));
 
-// "ident" from the CSS tokenizer, minus backslash-escape sequences
-static bool isCSSTokenizerIdentifier(const String& string)
-{
-    const UChar* p = string.characters();
-    const UChar* end = p + string.length();
+    if (valueOrPropertyID < 0)
+        return nullAtom;
 
-    // -?
-    if (p != end && p[0] == '-')
-        ++p;
-
-    // {nmstart}
-    if (p == end || !(p[0] == '_' || p[0] >= 128 || isASCIIAlpha(p[0])))
-        return false;
-    ++p;
-
-    // {nmchar}*
-    for (; p != end; ++p) {
-        if (!(p[0] == '_' || p[0] == '-' || p[0] >= 128 || isASCIIAlphanumeric(p[0])))
-            return false;
+    if (valueOrPropertyID < numCSSValueKeywords) {
+        static AtomicString* cssValueKeywordStrings[numCSSValueKeywords];
+        if (!cssValueKeywordStrings[valueOrPropertyID])
+            cssValueKeywordStrings[valueOrPropertyID] = new AtomicString(getValueName(valueOrPropertyID));
+        return *cssValueKeywordStrings[valueOrPropertyID];
     }
 
-    return true;
-}
-
-// "url" from the CSS tokenizer, minus backslash-escape sequences
-static bool isCSSTokenizerURL(const String& string)
-{
-    const UChar* p = string.characters();
-    const UChar* end = p + string.length();
-
-    for (; p != end; ++p) {
-        UChar c = p[0];
-        switch (c) {
-            case '!':
-            case '#':
-            case '$':
-            case '%':
-            case '&':
-                break;
-            default:
-                if (c < '*')
-                    return false;
-                if (c <= '~')
-                    break;
-                if (c < 128)
-                    return false;
-        }
+    if (valueOrPropertyID >= firstCSSProperty && valueOrPropertyID < firstCSSProperty + numCSSProperties) {
+        static AtomicString* cssPropertyStrings[numCSSProperties];
+        int propertyIndex = valueOrPropertyID - firstCSSProperty;
+        if (!cssPropertyStrings[propertyIndex])
+            cssPropertyStrings[propertyIndex] = new AtomicString(getPropertyName(static_cast<CSSPropertyID>(valueOrPropertyID)));
+        return *cssPropertyStrings[propertyIndex];
     }
 
-    return true;
-}
-
-// We use single quotes for now because markup.cpp uses double quotes.
-static String quoteString(const String& string)
-{
-    // FIXME: Also need to escape characters like '\n'.
-    String s = string;
-    s.replace('\\', "\\\\");
-    s.replace('\'', "\\'");
-    return "'" + s + "'";
-}
-
-static String quoteStringIfNeeded(const String& string)
-{
-    return isCSSTokenizerIdentifier(string) ? string : quoteString(string);
-}
-
-static String quoteURLIfNeeded(const String& string)
-{
-    return isCSSTokenizerURL(string) ? string : quoteString(string);
+    return nullAtom;
 }
 
 CSSPrimitiveValue::CSSPrimitiveValue()
@@ -317,6 +265,7 @@
     }
 
     m_type = 0;
+    m_cachedCSSText = String();
 }
 
 int CSSPrimitiveValue::computeLengthInt(RenderStyle* style, RenderStyle* rootStyle)
@@ -484,7 +433,6 @@
 
     cleanup();
 
-    //if(m_type > CSS_DIMENSION) throw DOMException(INVALID_ACCESS_ERR);
     m_value.num = floatValue;
     m_type = unitType;
 }
@@ -685,6 +633,9 @@
 {
     // FIXME: return the original value instead of a generated one (e.g. color
     // name if it was specified) - check what spec says about this
+    if (!m_cachedCSSText.isNull())
+        return m_cachedCSSText;
+
     String text;
     switch (m_type) {
         case CSS_UNKNOWN:
@@ -752,10 +703,10 @@
             // FIXME
             break;
         case CSS_STRING:
-            text = quoteStringIfNeeded(m_value.string);
+            text = quoteCSSStringIfNeeded(m_value.string);
             break;
         case CSS_URI:
-            text = "url(" + quoteURLIfNeeded(m_value.string) + ")";
+            text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")";
             break;
         case CSS_IDENT:
             text = valueOrPropertyName(m_value.ident);
@@ -770,7 +721,8 @@
             append(result, m_value.string);
             result.uncheckedAppend(')');
 
-            return String::adopt(result);
+            text = String::adopt(result);
+            break;
         }
         case CSS_COUNTER:
             text = "counter(";
@@ -798,7 +750,8 @@
             append(result, rectVal->left()->cssText());
             result.append(')');
 
-            return String::adopt(result);
+            text = String::adopt(result);
+            break;
         }
         case CSS_RGBCOLOR:
         case CSS_PARSER_HEXCOLOR: {
@@ -827,11 +780,12 @@
             appendNumber(result, static_cast<unsigned char>(color.blue()));
             if (color.hasAlpha()) {
                 append(result, commaSpace);
-                append(result, String::number(static_cast<float>(color.alpha()) / 256.0f));
+                append(result, String::number(color.alpha() / 256.0f));
             }
 
             result.append(')');
-            return String::adopt(result);
+            text = String::adopt(result);
+            break;
         }
         case CSS_PAIR:
             text = m_value.pair->first()->cssText();
@@ -880,9 +834,10 @@
             break;
         }
         case CSS_PARSER_IDENTIFIER:
-            text = quoteStringIfNeeded(m_value.string);
+            text = quoteCSSStringIfNeeded(m_value.string);
             break;
     }
+    m_cachedCSSText = text;
     return text;
 }
 
@@ -927,7 +882,7 @@
             break;
         case CSS_IDENT: {
             value.id = m_value.ident;
-            String name = valueOrPropertyName(m_value.ident);
+            const AtomicString& name = valueOrPropertyName(m_value.ident);
             value.string.characters = const_cast<UChar*>(name.characters());
             value.string.length = name.length();
             break;
diff --git a/WebCore/css/CSSPrimitiveValue.h b/WebCore/css/CSSPrimitiveValue.h
index d417619..943ad04 100644
--- a/WebCore/css/CSSPrimitiveValue.h
+++ b/WebCore/css/CSSPrimitiveValue.h
@@ -211,6 +211,7 @@
         Pair* pair;
         DashboardRegion* region;
     } m_value;
+    mutable String m_cachedCSSText;
 };
 
 } // namespace WebCore
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index c20448e..223b515 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -275,6 +275,11 @@
         case OuterSpinButtonPart:
             m_value.ident = CSSValueOuterSpinButton;
             break;
+        case ProgressBarPart:
+#if ENABLE(PROGRESS_BAR)
+            m_value.ident = CSSValueProgressBar;
+#endif
+            break;
         case SliderHorizontalPart:
             m_value.ident = CSSValueSliderHorizontal;
             break;
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index fe610de..aed7063 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -151,6 +151,7 @@
 -webkit-animation-delay
 -webkit-animation-direction
 -webkit-animation-duration
+-webkit-animation-fill-mode
 -webkit-animation-iteration-count
 -webkit-animation-name
 -webkit-animation-play-state
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index 9ae9b9f..23a89f6 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -28,6 +28,7 @@
 #include "wtf/Assertions.h"
 #include "HTMLNames.h"
 
+#include <wtf/HashMap.h>
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
@@ -65,11 +66,148 @@
     return s & 0xffffff;
 }
 
-void CSSSelector::extractPseudoType() const
+PseudoId CSSSelector::pseudoId(PseudoType type)
 {
-    if (m_match != PseudoClass && m_match != PseudoElement)
-        return;
+    switch (type) {
+    case PseudoFirstLine:
+        return FIRST_LINE;
+    case PseudoFirstLetter:
+        return FIRST_LETTER;
+    case PseudoSelection:
+        return SELECTION;
+    case PseudoBefore:
+        return BEFORE;
+    case PseudoAfter:
+        return AFTER;
+    case PseudoFileUploadButton:
+        return FILE_UPLOAD_BUTTON;
+    case PseudoInputPlaceholder:
+        return INPUT_PLACEHOLDER;
+    case PseudoSliderThumb:
+        return SLIDER_THUMB;
+    case PseudoSearchCancelButton:
+        return SEARCH_CANCEL_BUTTON;
+    case PseudoSearchDecoration:
+        return SEARCH_DECORATION;
+    case PseudoSearchResultsDecoration:
+        return SEARCH_RESULTS_DECORATION;
+    case PseudoSearchResultsButton:
+        return SEARCH_RESULTS_BUTTON;
+    case PseudoMediaControlsPanel:
+        return MEDIA_CONTROLS_PANEL;
+    case PseudoMediaControlsMuteButton:
+        return MEDIA_CONTROLS_MUTE_BUTTON;
+    case PseudoMediaControlsPlayButton:
+        return MEDIA_CONTROLS_PLAY_BUTTON;
+    case PseudoMediaControlsTimelineContainer:
+        return MEDIA_CONTROLS_TIMELINE_CONTAINER;
+    case PseudoMediaControlsVolumeSliderContainer:
+        return MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER;
+    case PseudoMediaControlsCurrentTimeDisplay:
+        return MEDIA_CONTROLS_CURRENT_TIME_DISPLAY;
+    case PseudoMediaControlsTimeRemainingDisplay:
+        return MEDIA_CONTROLS_TIME_REMAINING_DISPLAY;
+    case PseudoMediaControlsTimeline:
+        return MEDIA_CONTROLS_TIMELINE;
+    case PseudoMediaControlsVolumeSlider:
+        return MEDIA_CONTROLS_VOLUME_SLIDER;
+    case PseudoMediaControlsSeekBackButton:
+        return MEDIA_CONTROLS_SEEK_BACK_BUTTON;
+    case PseudoMediaControlsSeekForwardButton:
+        return MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;
+    case PseudoMediaControlsRewindButton:
+        return MEDIA_CONTROLS_REWIND_BUTTON;
+    case PseudoMediaControlsReturnToRealtimeButton:
+        return MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON;
+    case PseudoMediaControlsToggleClosedCaptions:
+        return MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON;
+    case PseudoMediaControlsStatusDisplay:
+        return MEDIA_CONTROLS_STATUS_DISPLAY;
+    case PseudoMediaControlsFullscreenButton:
+        return MEDIA_CONTROLS_FULLSCREEN_BUTTON;
+    case PseudoScrollbar:
+        return SCROLLBAR;
+    case PseudoScrollbarButton:
+        return SCROLLBAR_BUTTON;
+    case PseudoScrollbarCorner:
+        return SCROLLBAR_CORNER;
+    case PseudoScrollbarThumb:
+        return SCROLLBAR_THUMB;
+    case PseudoScrollbarTrack:
+        return SCROLLBAR_TRACK;
+    case PseudoScrollbarTrackPiece:
+        return SCROLLBAR_TRACK_PIECE;
+    case PseudoResizer:
+        return RESIZER;
+    case PseudoInnerSpinButton:
+        return INNER_SPIN_BUTTON;
+    case PseudoOuterSpinButton:
+        return OUTER_SPIN_BUTTON;
+    case PseudoInputListButton:
+#if ENABLE(DATALIST)
+        return INPUT_LIST_BUTTON;
+#endif
+    case PseudoUnknown:
+    case PseudoEmpty:
+    case PseudoFirstChild:
+    case PseudoFirstOfType:
+    case PseudoLastChild:
+    case PseudoLastOfType:
+    case PseudoOnlyChild:
+    case PseudoOnlyOfType:
+    case PseudoNthChild:
+    case PseudoNthOfType:
+    case PseudoNthLastChild:
+    case PseudoNthLastOfType:
+    case PseudoLink:
+    case PseudoVisited:
+    case PseudoAnyLink:
+    case PseudoAutofill:
+    case PseudoHover:
+    case PseudoDrag:
+    case PseudoFocus:
+    case PseudoActive:
+    case PseudoChecked:
+    case PseudoEnabled:
+    case PseudoFullPageMedia:
+    case PseudoDefault:
+    case PseudoDisabled:
+    case PseudoOptional:
+    case PseudoRequired:
+    case PseudoReadOnly:
+    case PseudoReadWrite:
+    case PseudoValid:
+    case PseudoInvalid:
+    case PseudoIndeterminate:
+    case PseudoTarget:
+    case PseudoLang:
+    case PseudoNot:
+    case PseudoRoot:
+    case PseudoScrollbarBack:
+    case PseudoScrollbarForward:
+    case PseudoWindowInactive:
+    case PseudoCornerPresent:
+    case PseudoDecrement:
+    case PseudoIncrement:
+    case PseudoHorizontal:
+    case PseudoVertical:
+    case PseudoStart:
+    case PseudoEnd:
+    case PseudoDoubleButton:
+    case PseudoSingleButton:
+    case PseudoNoButton:
+        return NOPSEUDO;
+    case PseudoNotParsed:
+        ASSERT_NOT_REACHED();
+        return NOPSEUDO;
+    }
 
+    ASSERT_NOT_REACHED();
+    return NOPSEUDO;
+}
+
+static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap()
+{
     DEFINE_STATIC_LOCAL(AtomicString, active, ("active"));
     DEFINE_STATIC_LOCAL(AtomicString, after, ("after"));
     DEFINE_STATIC_LOCAL(AtomicString, anyLink, ("-webkit-any-link"));
@@ -129,6 +267,9 @@
     DEFINE_STATIC_LOCAL(AtomicString, onlyOfType, ("only-of-type"));
     DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional"));
     DEFINE_STATIC_LOCAL(AtomicString, outerSpinButton, ("-webkit-outer-spin-button"));
+#if ENABLE(PROGRESS_BAR)
+    DEFINE_STATIC_LOCAL(AtomicString, progressBar, ("-webkit-progress-bar"));
+#endif
     DEFINE_STATIC_LOCAL(AtomicString, required, ("required"));
     DEFINE_STATIC_LOCAL(AtomicString, resizer, ("-webkit-resizer"));
     DEFINE_STATIC_LOCAL(AtomicString, root, ("root"));
@@ -158,232 +299,218 @@
     DEFINE_STATIC_LOCAL(AtomicString, noButton, ("no-button"));
     DEFINE_STATIC_LOCAL(AtomicString, cornerPresent, ("corner-present"));
 
+    static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0;
+    if (!nameToPseudoType) {
+        nameToPseudoType = new HashMap<AtomicStringImpl*, CSSSelector::PseudoType>;
+        nameToPseudoType->set(active.impl(), CSSSelector::PseudoActive);
+        nameToPseudoType->set(after.impl(), CSSSelector::PseudoAfter);
+        nameToPseudoType->set(anyLink.impl(), CSSSelector::PseudoAnyLink);
+        nameToPseudoType->set(autofill.impl(), CSSSelector::PseudoAutofill);
+        nameToPseudoType->set(before.impl(), CSSSelector::PseudoBefore);
+        nameToPseudoType->set(checked.impl(), CSSSelector::PseudoChecked);
+        nameToPseudoType->set(fileUploadButton.impl(), CSSSelector::PseudoFileUploadButton);
+        nameToPseudoType->set(defaultString.impl(), CSSSelector::PseudoDefault);
+        nameToPseudoType->set(disabled.impl(), CSSSelector::PseudoDisabled);
+        nameToPseudoType->set(readOnly.impl(), CSSSelector::PseudoReadOnly);
+        nameToPseudoType->set(readWrite.impl(), CSSSelector::PseudoReadWrite);
+        nameToPseudoType->set(valid.impl(), CSSSelector::PseudoValid);
+        nameToPseudoType->set(invalid.impl(), CSSSelector::PseudoInvalid);
+        nameToPseudoType->set(drag.impl(), CSSSelector::PseudoDrag);
+        nameToPseudoType->set(dragAlias.impl(), CSSSelector::PseudoDrag);
+        nameToPseudoType->set(enabled.impl(), CSSSelector::PseudoEnabled);
+        nameToPseudoType->set(empty.impl(), CSSSelector::PseudoEmpty);
+        nameToPseudoType->set(firstChild.impl(), CSSSelector::PseudoFirstChild);
+        nameToPseudoType->set(fullPageMedia.impl(), CSSSelector::PseudoFullPageMedia);
+#if ENABLE(DATALIST)
+        nameToPseudoType->set(inputListButton.impl(), CSSSelector::PseudoInputListButton);
+#endif
+        nameToPseudoType->set(inputPlaceholder.impl(), CSSSelector::PseudoInputPlaceholder);
+        nameToPseudoType->set(lastChild.impl(), CSSSelector::PseudoLastChild);
+        nameToPseudoType->set(lastOfType.impl(), CSSSelector::PseudoLastOfType);
+        nameToPseudoType->set(onlyChild.impl(), CSSSelector::PseudoOnlyChild);
+        nameToPseudoType->set(onlyOfType.impl(), CSSSelector::PseudoOnlyOfType);
+        nameToPseudoType->set(firstLetter.impl(), CSSSelector::PseudoFirstLetter);
+        nameToPseudoType->set(firstLine.impl(), CSSSelector::PseudoFirstLine);
+        nameToPseudoType->set(firstOfType.impl(), CSSSelector::PseudoFirstOfType);
+        nameToPseudoType->set(focus.impl(), CSSSelector::PseudoFocus);
+        nameToPseudoType->set(hover.impl(), CSSSelector::PseudoHover);
+        nameToPseudoType->set(indeterminate.impl(), CSSSelector::PseudoIndeterminate);
+        nameToPseudoType->set(innerSpinButton.impl(), CSSSelector::PseudoInnerSpinButton);
+        nameToPseudoType->set(link.impl(), CSSSelector::PseudoLink);
+        nameToPseudoType->set(lang.impl(), CSSSelector::PseudoLang);
+        nameToPseudoType->set(mediaControlsPanel.impl(), CSSSelector::PseudoMediaControlsPanel);
+        nameToPseudoType->set(mediaControlsMuteButton.impl(), CSSSelector::PseudoMediaControlsMuteButton);
+        nameToPseudoType->set(mediaControlsPlayButton.impl(), CSSSelector::PseudoMediaControlsPlayButton);
+        nameToPseudoType->set(mediaControlsCurrentTimeDisplay.impl(), CSSSelector::PseudoMediaControlsCurrentTimeDisplay);
+        nameToPseudoType->set(mediaControlsTimeRemainingDisplay.impl(), CSSSelector::PseudoMediaControlsTimeRemainingDisplay);
+        nameToPseudoType->set(mediaControlsTimeline.impl(), CSSSelector::PseudoMediaControlsTimeline);
+        nameToPseudoType->set(mediaControlsVolumeSlider.impl(), CSSSelector::PseudoMediaControlsVolumeSlider);
+        nameToPseudoType->set(mediaControlsSeekBackButton.impl(), CSSSelector::PseudoMediaControlsSeekBackButton);
+        nameToPseudoType->set(mediaControlsSeekForwardButton.impl(), CSSSelector::PseudoMediaControlsSeekForwardButton);
+        nameToPseudoType->set(mediaControlsRewindButton.impl(), CSSSelector::PseudoMediaControlsRewindButton);
+        nameToPseudoType->set(mediaControlsReturnToRealtimeButton.impl(), CSSSelector::PseudoMediaControlsReturnToRealtimeButton);
+        nameToPseudoType->set(mediaControlsToggleClosedCaptionsButton.impl(), CSSSelector::PseudoMediaControlsToggleClosedCaptions);
+        nameToPseudoType->set(mediaControlsStatusDisplay.impl(), CSSSelector::PseudoMediaControlsStatusDisplay);
+        nameToPseudoType->set(mediaControlsFullscreenButton.impl(), CSSSelector::PseudoMediaControlsFullscreenButton);
+        nameToPseudoType->set(mediaControlsTimelineContainer.impl(), CSSSelector::PseudoMediaControlsTimelineContainer);
+        nameToPseudoType->set(mediaControlsVolumeSliderContainer.impl(), CSSSelector::PseudoMediaControlsVolumeSliderContainer);
+        nameToPseudoType->set(notStr.impl(), CSSSelector::PseudoNot);
+        nameToPseudoType->set(nthChild.impl(), CSSSelector::PseudoNthChild);
+        nameToPseudoType->set(nthOfType.impl(), CSSSelector::PseudoNthOfType);
+        nameToPseudoType->set(nthLastChild.impl(), CSSSelector::PseudoNthLastChild);
+        nameToPseudoType->set(nthLastOfType.impl(), CSSSelector::PseudoNthLastOfType);
+        nameToPseudoType->set(outerSpinButton.impl(), CSSSelector::PseudoOuterSpinButton);
+        nameToPseudoType->set(root.impl(), CSSSelector::PseudoRoot);
+        nameToPseudoType->set(windowInactive.impl(), CSSSelector::PseudoWindowInactive);
+        nameToPseudoType->set(decrement.impl(), CSSSelector::PseudoDecrement);
+        nameToPseudoType->set(increment.impl(), CSSSelector::PseudoIncrement);
+        nameToPseudoType->set(start.impl(), CSSSelector::PseudoStart);
+        nameToPseudoType->set(end.impl(), CSSSelector::PseudoEnd);
+        nameToPseudoType->set(horizontal.impl(), CSSSelector::PseudoHorizontal);
+        nameToPseudoType->set(vertical.impl(), CSSSelector::PseudoVertical);
+        nameToPseudoType->set(doubleButton.impl(), CSSSelector::PseudoDoubleButton);
+        nameToPseudoType->set(singleButton.impl(), CSSSelector::PseudoSingleButton);
+        nameToPseudoType->set(noButton.impl(), CSSSelector::PseudoNoButton);
+        nameToPseudoType->set(optional.impl(), CSSSelector::PseudoOptional);
+        nameToPseudoType->set(required.impl(), CSSSelector::PseudoRequired);
+        nameToPseudoType->set(resizer.impl(), CSSSelector::PseudoResizer);
+        nameToPseudoType->set(scrollbar.impl(), CSSSelector::PseudoScrollbar);
+        nameToPseudoType->set(scrollbarButton.impl(), CSSSelector::PseudoScrollbarButton);
+        nameToPseudoType->set(scrollbarCorner.impl(), CSSSelector::PseudoScrollbarCorner);
+        nameToPseudoType->set(scrollbarThumb.impl(), CSSSelector::PseudoScrollbarThumb);
+        nameToPseudoType->set(scrollbarTrack.impl(), CSSSelector::PseudoScrollbarTrack);
+        nameToPseudoType->set(scrollbarTrackPiece.impl(), CSSSelector::PseudoScrollbarTrackPiece);
+        nameToPseudoType->set(cornerPresent.impl(), CSSSelector::PseudoCornerPresent);
+        nameToPseudoType->set(searchCancelButton.impl(), CSSSelector::PseudoSearchCancelButton);
+        nameToPseudoType->set(searchDecoration.impl(), CSSSelector::PseudoSearchDecoration);
+        nameToPseudoType->set(searchResultsDecoration.impl(), CSSSelector::PseudoSearchResultsDecoration);
+        nameToPseudoType->set(searchResultsButton.impl(), CSSSelector::PseudoSearchResultsButton);
+        nameToPseudoType->set(selection.impl(), CSSSelector::PseudoSelection);
+        nameToPseudoType->set(sliderThumb.impl(), CSSSelector::PseudoSliderThumb);
+        nameToPseudoType->set(target.impl(), CSSSelector::PseudoTarget);
+        nameToPseudoType->set(visited.impl(), CSSSelector::PseudoVisited);
+    }
+    return nameToPseudoType;
+}
+
+CSSSelector::PseudoType CSSSelector::parsePseudoType(const AtomicString& name)
+{
+    if (name.isNull())
+        return PseudoUnknown;
+    HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = nameToPseudoTypeMap();
+    HashMap<AtomicStringImpl*, CSSSelector::PseudoType>::iterator slot = nameToPseudoType->find(name.impl());
+    return slot == nameToPseudoType->end() ? PseudoUnknown : slot->second;
+}
+
+void CSSSelector::extractPseudoType() const
+{
+    if (m_match != PseudoClass && m_match != PseudoElement)
+        return;
+
+    m_pseudoType = parsePseudoType(m_value);
+
     bool element = false; // pseudo-element
     bool compat = false; // single colon compatbility mode
 
-    m_pseudoType = PseudoUnknown;
-    if (m_value == active)
-        m_pseudoType = PseudoActive;
-    else if (m_value == after) {
-        m_pseudoType = PseudoAfter;
-        element = true;
+    switch (m_pseudoType) {
+    case PseudoAfter:
+    case PseudoBefore:
+    case PseudoFirstLetter:
+    case PseudoFirstLine:
         compat = true;
-    } else if (m_value == anyLink)
-        m_pseudoType = PseudoAnyLink;
-    else if (m_value == autofill)
-        m_pseudoType = PseudoAutofill;
-    else if (m_value == before) {
-        m_pseudoType = PseudoBefore;
+    case PseudoFileUploadButton:
+    case PseudoInputListButton:
+    case PseudoInputPlaceholder:
+    case PseudoInnerSpinButton:
+    case PseudoMediaControlsPanel:
+    case PseudoMediaControlsMuteButton:
+    case PseudoMediaControlsPlayButton:
+    case PseudoMediaControlsCurrentTimeDisplay:
+    case PseudoMediaControlsTimeRemainingDisplay:
+    case PseudoMediaControlsTimeline:
+    case PseudoMediaControlsVolumeSlider:
+    case PseudoMediaControlsSeekBackButton:
+    case PseudoMediaControlsSeekForwardButton:
+    case PseudoMediaControlsRewindButton:
+    case PseudoMediaControlsReturnToRealtimeButton:
+    case PseudoMediaControlsToggleClosedCaptions:
+    case PseudoMediaControlsStatusDisplay:
+    case PseudoMediaControlsFullscreenButton:
+    case PseudoMediaControlsTimelineContainer:
+    case PseudoMediaControlsVolumeSliderContainer:
+    case PseudoOuterSpinButton:
+    case PseudoResizer:
+    case PseudoScrollbar:
+    case PseudoScrollbarCorner:
+    case PseudoScrollbarButton:
+    case PseudoScrollbarThumb:
+    case PseudoScrollbarTrack:
+    case PseudoScrollbarTrackPiece:
+    case PseudoSearchCancelButton:
+    case PseudoSearchDecoration:
+    case PseudoSearchResultsDecoration:
+    case PseudoSearchResultsButton:
+    case PseudoSelection:
+    case PseudoSliderThumb:
         element = true;
-        compat = true;
-    } else if (m_value == checked)
-        m_pseudoType = PseudoChecked;
-    else if (m_value == fileUploadButton) {
-        m_pseudoType = PseudoFileUploadButton;
-        element = true;
-    } else if (m_value == defaultString)
-        m_pseudoType = PseudoDefault;
-    else if (m_value == disabled)
-        m_pseudoType = PseudoDisabled;
-    else if (m_value == readOnly)
-        m_pseudoType = PseudoReadOnly;
-    else if (m_value == readWrite)
-        m_pseudoType = PseudoReadWrite;
-    else if (m_value == valid)
-        m_pseudoType = PseudoValid;
-    else if (m_value == invalid)
-        m_pseudoType = PseudoInvalid;
-    else if (m_value == drag || m_value == dragAlias)
-        m_pseudoType = PseudoDrag;
-    else if (m_value == enabled)
-        m_pseudoType = PseudoEnabled;
-    else if (m_value == empty)
-        m_pseudoType = PseudoEmpty;
-    else if (m_value == firstChild)
-        m_pseudoType = PseudoFirstChild;
-    else if (m_value == fullPageMedia)
-        m_pseudoType = PseudoFullPageMedia;
-    else
-#if ENABLE(DATALIST)
-    if (m_value == inputListButton) {
-        m_pseudoType = PseudoInputListButton;
-        element = true;
-    } else
-#endif
-    if (m_value == inputPlaceholder) {
-        m_pseudoType = PseudoInputPlaceholder;
-        element = true;
-    } else if (m_value == lastChild)
-        m_pseudoType = PseudoLastChild;
-    else if (m_value == lastOfType)
-        m_pseudoType = PseudoLastOfType;
-    else if (m_value == onlyChild)
-        m_pseudoType = PseudoOnlyChild;
-    else if (m_value == onlyOfType)
-        m_pseudoType = PseudoOnlyOfType;
-    else if (m_value == firstLetter) {
-        m_pseudoType = PseudoFirstLetter;
-        element = true;
-        compat = true;
-    } else if (m_value == firstLine) {
-        m_pseudoType = PseudoFirstLine;
-        element = true;
-        compat = true;
-    } else if (m_value == firstOfType)
-        m_pseudoType = PseudoFirstOfType;
-    else if (m_value == focus)
-        m_pseudoType = PseudoFocus;
-    else if (m_value == hover)
-        m_pseudoType = PseudoHover;
-    else if (m_value == indeterminate)
-        m_pseudoType = PseudoIndeterminate;
-    else if (m_value == innerSpinButton) {
-        m_pseudoType = PseudoInnerSpinButton;
-        element = true;
-    } else if (m_value == link)
-        m_pseudoType = PseudoLink;
-    else if (m_value == lang)
-        m_pseudoType = PseudoLang;
-    else if (m_value == mediaControlsPanel) {
-        m_pseudoType = PseudoMediaControlsPanel;
-        element = true;
-    } else if (m_value == mediaControlsMuteButton) {
-        m_pseudoType = PseudoMediaControlsMuteButton;
-        element = true;
-    } else if (m_value == mediaControlsPlayButton) {
-        m_pseudoType = PseudoMediaControlsPlayButton;
-        element = true;
-    } else if (m_value == mediaControlsCurrentTimeDisplay) {
-        m_pseudoType = PseudoMediaControlsCurrentTimeDisplay;
-        element = true;
-    } else if (m_value == mediaControlsTimeRemainingDisplay) {
-        m_pseudoType = PseudoMediaControlsTimeRemainingDisplay;
-        element = true;
-    } else if (m_value == mediaControlsTimeline) {
-        m_pseudoType = PseudoMediaControlsTimeline;
-        element = true;
-    } else if (m_value == mediaControlsVolumeSlider) {
-        m_pseudoType = PseudoMediaControlsVolumeSlider;
-        element = true;
-    } else if (m_value == mediaControlsSeekBackButton) {
-        m_pseudoType = PseudoMediaControlsSeekBackButton;
-        element = true;
-    } else if (m_value == mediaControlsSeekForwardButton) {
-        m_pseudoType = PseudoMediaControlsSeekForwardButton;
-        element = true;
-    } else if (m_value == mediaControlsRewindButton) {
-        m_pseudoType = PseudoMediaControlsRewindButton;
-        element = true;
-    } else if (m_value == mediaControlsReturnToRealtimeButton) {
-        m_pseudoType = PseudoMediaControlsReturnToRealtimeButton;
-        element = true;
-    } else if (m_value == mediaControlsToggleClosedCaptionsButton) {
-        m_pseudoType = PseudoMediaControlsToggleClosedCaptions;
-        element = true;
-    } else if (m_value == mediaControlsStatusDisplay) {
-        m_pseudoType = PseudoMediaControlsStatusDisplay;
-        element = true;
-    } else if (m_value == mediaControlsFullscreenButton) {
-        m_pseudoType = PseudoMediaControlsFullscreenButton;
-        element = true;
-    } else if (m_value == mediaControlsTimelineContainer) {
-        m_pseudoType = PseudoMediaControlsTimelineContainer;
-        element = true;
-    } else if (m_value == mediaControlsVolumeSliderContainer) {
-        m_pseudoType = PseudoMediaControlsVolumeSliderContainer;
-        element = true;
-    } else if (m_value == notStr)
-        m_pseudoType = PseudoNot;
-    else if (m_value == nthChild)
-        m_pseudoType = PseudoNthChild;
-    else if (m_value == nthOfType)
-        m_pseudoType = PseudoNthOfType;
-    else if (m_value == nthLastChild)
-        m_pseudoType = PseudoNthLastChild;
-    else if (m_value == nthLastOfType)
-        m_pseudoType = PseudoNthLastOfType;
-    else if (m_value == outerSpinButton) {
-        m_pseudoType = PseudoOuterSpinButton;
-        element = true;
-    } else if (m_value == root)
-        m_pseudoType = PseudoRoot;
-    else if (m_value == windowInactive)
-        m_pseudoType = PseudoWindowInactive;
-    else if (m_value == decrement)
-        m_pseudoType = PseudoDecrement;
-    else if (m_value == increment)
-        m_pseudoType = PseudoIncrement;
-    else if (m_value == start)
-        m_pseudoType = PseudoStart;
-    else if (m_value == end)
-        m_pseudoType = PseudoEnd;
-    else if (m_value == horizontal)
-        m_pseudoType = PseudoHorizontal;
-    else if (m_value == vertical)
-        m_pseudoType = PseudoVertical;
-    else if (m_value == doubleButton)
-        m_pseudoType = PseudoDoubleButton;
-    else if (m_value == singleButton)
-        m_pseudoType = PseudoSingleButton;
-    else if (m_value == noButton)
-        m_pseudoType = PseudoNoButton;
-    else if (m_value == optional)
-        m_pseudoType = PseudoOptional;
-    else if (m_value == required)
-        m_pseudoType = PseudoRequired;
-    else if (m_value == scrollbarCorner) {
-        element = true;
-        m_pseudoType = PseudoScrollbarCorner;
-    } else if (m_value == resizer) {
-        element = true;
-        m_pseudoType = PseudoResizer;
-    } else if (m_value == scrollbar) {
-        element = true;
-        m_pseudoType = PseudoScrollbar;
-    } else if (m_value == scrollbarButton) {
-        element = true;
-        m_pseudoType = PseudoScrollbarButton;
-    } else if (m_value == scrollbarCorner) {
-        element = true;
-        m_pseudoType = PseudoScrollbarCorner;
-    } else if (m_value == scrollbarThumb) {
-        element = true;
-        m_pseudoType = PseudoScrollbarThumb;
-    } else if (m_value == scrollbarTrack) {
-        element = true;
-        m_pseudoType = PseudoScrollbarTrack;
-    } else if (m_value == scrollbarTrackPiece) {
-        element = true;
-        m_pseudoType = PseudoScrollbarTrackPiece;
-    } else if (m_value == cornerPresent)
-         m_pseudoType = PseudoCornerPresent;
-    else if (m_value == searchCancelButton) {
-        m_pseudoType = PseudoSearchCancelButton;
-        element = true;
-    } else if (m_value == searchDecoration) {
-        m_pseudoType = PseudoSearchDecoration;
-        element = true;
-    } else if (m_value == searchResultsDecoration) {
-        m_pseudoType = PseudoSearchResultsDecoration;
-        element = true;
-    } else if (m_value == searchResultsButton) {
-        m_pseudoType = PseudoSearchResultsButton;
-        element = true;
-    }  else if (m_value == selection) {
-        m_pseudoType = PseudoSelection;
-        element = true;
-    } else if (m_value == sliderThumb) {
-        m_pseudoType = PseudoSliderThumb;
-        element = true;
-    } else if (m_value == target)
-        m_pseudoType = PseudoTarget;
-    else if (m_value == visited)
-        m_pseudoType = PseudoVisited;
+        break;
+    case PseudoUnknown:
+    case PseudoEmpty:
+    case PseudoFirstChild:
+    case PseudoFirstOfType:
+    case PseudoLastChild:
+    case PseudoLastOfType:
+    case PseudoOnlyChild:
+    case PseudoOnlyOfType:
+    case PseudoNthChild:
+    case PseudoNthOfType:
+    case PseudoNthLastChild:
+    case PseudoNthLastOfType:
+    case PseudoLink:
+    case PseudoVisited:
+    case PseudoAnyLink:
+    case PseudoAutofill:
+    case PseudoHover:
+    case PseudoDrag:
+    case PseudoFocus:
+    case PseudoActive:
+    case PseudoChecked:
+    case PseudoEnabled:
+    case PseudoFullPageMedia:
+    case PseudoDefault:
+    case PseudoDisabled:
+    case PseudoOptional:
+    case PseudoRequired:
+    case PseudoReadOnly:
+    case PseudoReadWrite:
+    case PseudoValid:
+    case PseudoInvalid:
+    case PseudoIndeterminate:
+    case PseudoTarget:
+    case PseudoLang:
+    case PseudoNot:
+    case PseudoRoot:
+    case PseudoScrollbarBack:
+    case PseudoScrollbarForward:
+    case PseudoWindowInactive:
+    case PseudoCornerPresent:
+    case PseudoDecrement:
+    case PseudoIncrement:
+    case PseudoHorizontal:
+    case PseudoVertical:
+    case PseudoStart:
+    case PseudoEnd:
+    case PseudoDoubleButton:
+    case PseudoSingleButton:
+    case PseudoNoButton:
+    case PseudoNotParsed:
+        break;
+    }
 
     if (m_match == PseudoClass && element) {
-        if (!compat) 
+        if (!compat)
             m_pseudoType = PseudoUnknown;
-        else 
+        else
            m_match = PseudoElement;
     } else if (m_match == PseudoElement && !element)
         m_pseudoType = PseudoUnknown;
@@ -563,10 +690,35 @@
     return m_data.m_rareData->matchNth(count);
 }
 
+bool CSSSelector::isSimple() const
+{
+    if (simpleSelector() || tagHistory() || matchesPseudoElement())
+        return false;
+
+    int numConditions = 0;
+
+    // hasTag() cannot be be used here because namespace may not be nullAtom.
+    // Example:
+    //     @namespace "http://www.w3.org/2000/svg";
+    //     svg:not(:root) { ...
+    if (m_tag != starAtom)
+        numConditions++;
+
+    if (m_match == Id || m_match == Class || m_match == PseudoClass)
+        numConditions++;
+
+    if (m_hasRareData && m_data.m_rareData->m_attribute != anyQName())
+        numConditions++;
+
+    // numConditions is 0 for a universal selector.
+    // numConditions is 1 for other simple selectors.
+    return numConditions <= 1;
+}
+
 // a helper function for parsing nth-arguments
 bool CSSSelector::RareData::parseNth()
-{    
-    const String& argument = m_argument;
+{
+    String argument = m_argument.lower();
     
     if (argument.isEmpty())
         return false;
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index 70f2574..f8748c7 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -22,6 +22,7 @@
 #ifndef CSSSelector_h
 #define CSSSelector_h
 
+#include "RenderStyleConstants.h"
 #include "QualifiedName.h"
 #include <wtf/Noncopyable.h>
 #include <wtf/OwnPtr.h>
@@ -194,7 +195,10 @@
                 extractPseudoType();
             return static_cast<PseudoType>(m_pseudoType);
         }
-        
+
+        static PseudoType parsePseudoType(const AtomicString&);
+        static PseudoId pseudoId(PseudoType);
+
         CSSSelector* tagHistory() const { return m_hasRareData ? m_data.m_rareData->m_tagHistory.get() : m_data.m_tagHistory; }
         void setTagHistory(CSSSelector* tagHistory);
 
@@ -212,10 +216,18 @@
         bool parseNth();
         bool matchNth(int count);
 
+        bool matchesPseudoElement() const 
+        { 
+            if (m_pseudoType == PseudoUnknown)
+                extractPseudoType();
+            return m_match == PseudoElement;
+        }
+
         Relation relation() const { return static_cast<Relation>(m_relation); }
 
         bool isLastInSelectorList() const { return m_isLastInSelectorList; }
         void setLastInSelectorList() { m_isLastInSelectorList = true; }
+        bool isSimple() const;
 
         mutable AtomicString m_value;
         QualifiedName m_tag;
diff --git a/WebCore/css/CSSStyleRule.cpp b/WebCore/css/CSSStyleRule.cpp
index aaac254..1036e8f 100644
--- a/WebCore/css/CSSStyleRule.cpp
+++ b/WebCore/css/CSSStyleRule.cpp
@@ -27,8 +27,9 @@
 
 namespace WebCore {
 
-CSSStyleRule::CSSStyleRule(CSSStyleSheet* parent)
+CSSStyleRule::CSSStyleRule(CSSStyleSheet* parent, int sourceLine)
     : CSSRule(parent)
+    , m_sourceLine(sourceLine)
 {
 }
 
diff --git a/WebCore/css/CSSStyleRule.h b/WebCore/css/CSSStyleRule.h
index 23d8648..835f2a2 100644
--- a/WebCore/css/CSSStyleRule.h
+++ b/WebCore/css/CSSStyleRule.h
@@ -34,9 +34,9 @@
 
 class CSSStyleRule : public CSSRule {
 public:
-    static PassRefPtr<CSSStyleRule> create(CSSStyleSheet* parent)
+    static PassRefPtr<CSSStyleRule> create(CSSStyleSheet* parent, int sourceLine)
     {
-        return adoptRef(new CSSStyleRule(parent));
+        return adoptRef(new CSSStyleRule(parent, sourceLine));
     }
     virtual ~CSSStyleRule();
 
@@ -58,8 +58,10 @@
 
     virtual void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
 
+    int sourceLine() { return m_sourceLine; }
+
 private:
-    CSSStyleRule(CSSStyleSheet* parent);
+    CSSStyleRule(CSSStyleSheet* parent, int sourceLine);
 
     virtual bool isStyleRule() { return true; }
 
@@ -68,6 +70,7 @@
 
     RefPtr<CSSMutableStyleDeclaration> m_style;
     CSSSelectorList m_selectorList;
+    int m_sourceLine;
 };
 
 } // namespace WebCore
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index f7f2707..dd4fed9 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -361,9 +361,9 @@
     void addToRuleSet(AtomicStringImpl* key, AtomRuleMap& map,
                       CSSStyleRule* rule, CSSSelector* sel);
     
-    CSSRuleDataList* getIDRules(AtomicStringImpl* key) { m_idRules.checkConsistency(); return m_idRules.get(key); }
-    CSSRuleDataList* getClassRules(AtomicStringImpl* key) { m_classRules.checkConsistency(); return m_classRules.get(key); }
-    CSSRuleDataList* getTagRules(AtomicStringImpl* key) { m_tagRules.checkConsistency(); return m_tagRules.get(key); }
+    CSSRuleDataList* getIDRules(AtomicStringImpl* key) { return m_idRules.get(key); }
+    CSSRuleDataList* getClassRules(AtomicStringImpl* key) { return m_classRules.get(key); }
+    CSSRuleDataList* getTagRules(AtomicStringImpl* key) { return m_tagRules.get(key); }
     CSSRuleDataList* getUniversalRules() { return m_universalRules; }
     
 public:
@@ -382,8 +382,6 @@
 
 RenderStyle* CSSStyleSelector::s_styleNotYetAvailable;
 
-static PseudoState pseudoState;
-
 static void loadFullDefaultStyle();
 static void loadSimpleDefaultStyle();
 // FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
@@ -710,7 +708,7 @@
             // we really just matched a pseudo-element.
             if (m_dynamicPseudo != NOPSEUDO && m_checker.m_pseudoStyle == NOPSEUDO) {
                 if (m_checker.m_collectRulesOnly)
-                    return;
+                    continue;
                 if (m_dynamicPseudo < FIRST_INTERNAL_PSEUDOID)
                     m_style->setHasPseudoStyle(m_dynamicPseudo);
             } else {
@@ -802,14 +800,10 @@
         m_matchedRules[i] = rulesMergeBuffer[i - start];
 }
 
-void CSSStyleSelector::initElementAndPseudoState(Element* e)
+void CSSStyleSelector::initElement(Element* e)
 {
     m_element = e;
-    if (m_element && m_element->isStyledElement())
-        m_styledElement = static_cast<StyledElement*>(m_element);
-    else
-        m_styledElement = 0;
-    pseudoState = PseudoUnknown;
+    m_styledElement = m_element && m_element->isStyledElement() ? static_cast<StyledElement*>(m_element) : 0;
 }
 
 void CSSStyleSelector::initForStyleResolve(Element* e, RenderStyle* parentStyle, PseudoId pseudoID)
@@ -876,57 +870,56 @@
     , m_collectRulesOnly(false)
     , m_pseudoStyle(NOPSEUDO)
     , m_documentIsHTML(document->isHTMLDocument())
+    , m_matchVisitedPseudoClass(false)
 {
 }
 
-PseudoState CSSStyleSelector::SelectorChecker::checkPseudoState(Element* element, bool checkVisited) const
+EInsideLink CSSStyleSelector::SelectorChecker::determineLinkState(Element* element) const
 {
+    if (!element->isLink())
+        return NotInsideLink;
+    
     const AtomicString* attr = linkAttribute(element);
     if (!attr || attr->isNull())
-        return PseudoNone;
-
-    if (!checkVisited)
-        return PseudoAnyLink;
+        return NotInsideLink;
 
 #if PLATFORM(QT)
     Vector<UChar, 512> url;
     visitedURL(m_document->baseURL(), *attr, url);
     if (url.isEmpty())
-        return PseudoLink;
+        return InsideUnvisitedLink;
 
     // If the Qt4.4 interface for the history is used, we will have to fallback
     // to the old global history.
     QWebHistoryInterface* iface = QWebHistoryInterface::defaultInterface();
     if (iface)
-        return iface->historyContains(QString(reinterpret_cast<QChar*>(url.data()), url.size())) ? PseudoVisited : PseudoLink;
+        return iface->historyContains(QString(reinterpret_cast<QChar*>(url.data()), url.size())) ? InsideVisitedLink : InsideUnvisitedLink;
 
     LinkHash hash = visitedLinkHash(url.data(), url.size());
     if (!hash)
-        return PseudoLink;
+        return InsideUnvisitedLink;
 #else
     LinkHash hash = visitedLinkHash(m_document->baseURL(), *attr);
     if (!hash)
-        return PseudoLink;
+        return InsideUnvisitedLink;
 #endif
 
     Frame* frame = m_document->frame();
     if (!frame)
-        return PseudoLink;
+        return InsideUnvisitedLink;
 
     Page* page = frame->page();
     if (!page)
-        return PseudoLink;
+        return InsideUnvisitedLink;
 
     m_linksCheckedForVisitedState.add(hash);
-    return page->group().isLinkVisited(hash) ? PseudoVisited : PseudoLink;
+    return page->group().isLinkVisited(hash) ? InsideVisitedLink : InsideUnvisitedLink;
 }
 
 bool CSSStyleSelector::SelectorChecker::checkSelector(CSSSelector* sel, Element* element) const
 {
-    pseudoState = PseudoUnknown;
     PseudoId dynamicPseudo = NOPSEUDO;
-
-    return checkSelector(sel, element, 0, dynamicPseudo, true, false) == SelectorMatches;
+    return checkSelector(sel, element, 0, dynamicPseudo, false, false) == SelectorMatches;
 }
 
 #ifdef STYLE_SHARING_STATS
@@ -1031,20 +1024,11 @@
                 if (s->hasMappedAttributes())
                     mappedAttrsMatch = s->mappedAttributes()->mapsEquivalent(m_styledElement->mappedAttributes());
                 if (mappedAttrsMatch) {
-                    bool linksMatch = true;
-
                     if (s->isLink()) {
-                        // We need to check to see if the visited state matches.
-                        if (pseudoState == PseudoUnknown) {
-                            const Color& linkColor = m_element->document()->linkColor();
-                            const Color& visitedColor = m_element->document()->visitedLinkColor();
-                            pseudoState = m_checker.checkPseudoState(m_element, style->pseudoState() != PseudoAnyLink || linkColor != visitedColor);
-                        }
-                        linksMatch = (pseudoState == style->pseudoState());
+                        if (m_checker.determineLinkState(m_element) != style->insideLink())
+                            return false;
                     }
-                    
-                    if (linksMatch)
-                        return true;
+                    return true;
                 }
             }
         }
@@ -1134,7 +1118,7 @@
 // If resolveForRootDefault is true, style based on user agent style sheet only. This is used in media queries, where
 // relative units are interpreted according to document root element style, styled only with UA stylesheet
 
-PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyle* defaultParent, bool allowSharing, bool resolveForRootDefault)
+PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyle* defaultParent, bool allowSharing, bool resolveForRootDefault, bool matchVisitedRules)
 {
     // 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.
@@ -1150,7 +1134,7 @@
         return s_styleNotYetAvailable;
     }
 
-    initElementAndPseudoState(e);
+    initElement(e);
     if (allowSharing) {
         RenderStyle* sharedStyle = locateSharedStyle();
         if (sharedStyle)
@@ -1158,6 +1142,24 @@
     }
     initForStyleResolve(e, defaultParent);
 
+    // Compute our style allowing :visited to match first.
+    RefPtr<RenderStyle> visitedStyle;
+    if (!matchVisitedRules && m_parentStyle && (m_parentStyle->insideLink() || e->isLink()) && e->document()->usesLinkRules()) {
+        // Fetch our parent style.
+        RenderStyle* parentStyle = m_parentStyle;
+        if (!e->isLink()) {
+            // Use the parent's visited style if one exists.
+            RenderStyle* parentVisitedStyle = m_parentStyle->getCachedPseudoStyle(VISITED_LINK);
+            if (parentVisitedStyle)
+                parentStyle = parentVisitedStyle;
+        }
+        visitedStyle = styleForElement(e, parentStyle, false, false, true);
+        visitedStyle->setStyleType(VISITED_LINK);
+        initForStyleResolve(e, defaultParent);
+    }
+
+    m_checker.m_matchVisitedPseudoClass = matchVisitedRules;
+
     m_style = RenderStyle::create();
 
     if (m_parentStyle)
@@ -1165,6 +1167,11 @@
     else
         m_parentStyle = style();
 
+    if (e->isLink()) {
+        m_style->setIsLink(true);
+        m_style->setInsideLink(m_checker.determineLinkState(e));
+    }
+    
     if (simpleDefaultStyleSheet && !elementCanUseSimpleDefaultStyle(e))
         loadFullDefaultStyle();
 
@@ -1276,6 +1283,9 @@
         }
     }
 
+    // Reset the value back before applying properties, so that -webkit-link knows what color to use.
+    m_checker.m_matchVisitedPseudoClass = matchVisitedRules;
+    
     // Now we have all of the matched rules in the appropriate order.  Walk the rules and apply
     // high-priority properties first, i.e., those properties that other properties depend on.
     // The order is (1) high-priority not important, (2) high-priority important, (3) normal not important
@@ -1318,14 +1328,23 @@
     // Clean up our style object's display and text decorations (among other fixups).
     adjustRenderStyle(style(), e);
 
-    // If we are a link, cache the determined pseudo-state.
-    if (e->isLink())
-        m_style->setPseudoState(pseudoState);
-
     // If we have first-letter pseudo style, do not share this style
     if (m_style->hasPseudoStyle(FIRST_LETTER))
         m_style->setUnique();
 
+    if (visitedStyle) {
+        // Copy any pseudo bits that the visited style has to the primary style so that
+        // pseudo element styles will continue to work for pseudo elements inside :visited
+        // links.
+        for (unsigned pseudo = FIRST_PUBLIC_PSEUDOID; pseudo < FIRST_INTERNAL_PSEUDOID; ++pseudo) {
+            if (visitedStyle->hasPseudoStyle(static_cast<PseudoId>(pseudo)))
+                m_style->setHasPseudoStyle(static_cast<PseudoId>(pseudo));
+        }
+        
+        // Add the visited style off the main style.
+        m_style->addCachedPseudoStyle(visitedStyle.release());
+    }
+
     // Now return the style.
     return m_style.release();
 }
@@ -1348,7 +1367,7 @@
     // Construct and populate the style for each keyframe
     for (unsigned i = 0; i < rule->length(); ++i) {
         // Apply the declaration to the style. This is a simplified version of the logic in styleForElement
-        initElementAndPseudoState(e);
+        initElement(e);
         initForStyleResolve(e);
         
         const WebKitCSSKeyframeRule* kf = rule->item(i);
@@ -1412,15 +1431,28 @@
         list.clear();
 }
 
-PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo, Element* e, RenderStyle* parentStyle)
+PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo, Element* e, RenderStyle* parentStyle, bool matchVisitedLinks)
 {
     if (!e)
         return 0;
 
-    initElementAndPseudoState(e);
+    // Compute our :visited style first, so that we know whether or not we'll need to create a normal style just to hang it
+    // off of.
+    RefPtr<RenderStyle> visitedStyle;
+    if (!matchVisitedLinks && parentStyle && parentStyle->insideLink()) {
+        // Fetch our parent style with :visited in effect.
+        RenderStyle* parentVisitedStyle = parentStyle->getCachedPseudoStyle(VISITED_LINK);
+        visitedStyle = pseudoStyleForElement(pseudo, e, parentVisitedStyle ? parentVisitedStyle : parentStyle, true);
+        if (visitedStyle)
+            visitedStyle->setStyleType(VISITED_LINK);
+    }
+
+    initElement(e);
     initForStyleResolve(e, parentStyle, pseudo);
     m_style = parentStyle;
     
+    m_checker.m_matchVisitedPseudoClass = matchVisitedLinks;
+
     // Since we don't use pseudo-elements in any of our quirk/print user agent rules, don't waste time walking
     // those rules.
     
@@ -1433,16 +1465,20 @@
         matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule);
     }
 
-    if (m_matchedDecls.isEmpty())
+    if (m_matchedDecls.isEmpty() && !visitedStyle)
         return 0;
-    
+
     m_style = RenderStyle::create();
     if (parentStyle)
         m_style->inheritFrom(parentStyle);
 
-    m_style->noninherited_flags._styleType = pseudo;
+    m_style->setStyleType(pseudo);
     
     m_lineHeightValue = 0;
+    
+    // Reset the value back before applying properties, so that -webkit-link knows what color to use.
+    m_checker.m_matchVisitedPseudoClass = matchVisitedLinks;
+
     // High-priority properties.
     applyDeclarations(true, false, 0, m_matchedDecls.size() - 1);
     applyDeclarations(true, true, firstAuthorRule, lastAuthorRule);
@@ -1472,9 +1508,14 @@
     // go ahead and update it a second time.
     if (m_fontDirty)
         updateFont();
+
     // Clean up our style object's display and text decorations (among other fixups).
     adjustRenderStyle(style(), 0);
 
+    // Hang our visited style off m_style.
+    if (visitedStyle)
+        m_style->addCachedPseudoStyle(visitedStyle.release());
+        
     // Now return the style.
     return m_style.release();
 }
@@ -1722,13 +1763,18 @@
 
 PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly)
 {
+    return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly);
+}
+
+PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly)
+{
     if (!e || !e->document()->haveStylesheetsLoaded())
         return 0;
 
     m_checker.m_collectRulesOnly = true;
 
-    initElementAndPseudoState(e);
-    initForStyleResolve(e);
+    initElement(e);
+    initForStyleResolve(e, 0, pseudoId);
 
     if (!authorOnly) {
         int firstUARule = -1, lastUARule = -1;
@@ -1753,18 +1799,12 @@
     return m_ruleList.release();
 }
 
-PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element*, const String&, bool)
-{
-    // FIXME: Implement this.
-    return 0;
-}
-
 bool CSSStyleSelector::checkSelector(CSSSelector* sel)
 {
     m_dynamicPseudo = NOPSEUDO;
 
     // Check the selector
-    SelectorMatch match = m_checker.checkSelector(sel, m_element, &m_selectorAttrs, m_dynamicPseudo, true, false, style(), m_parentStyle);
+    SelectorMatch match = m_checker.checkSelector(sel, m_element, &m_selectorAttrs, m_dynamicPseudo, false, false, style(), m_parentStyle);
     if (match != SelectorMatches)
         return false;
 
@@ -1779,7 +1819,7 @@
 // * SelectorMatches         - the selector matches the element e
 // * SelectorFailsLocally    - the selector fails for the element e
 // * SelectorFailsCompletely - the selector fails for e and any sibling or ancestor of e
-CSSStyleSelector::SelectorMatch CSSStyleSelector::SelectorChecker::checkSelector(CSSSelector* sel, Element* e, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isAncestor, bool isSubSelector, RenderStyle* elementStyle, RenderStyle* elementParentStyle) const
+CSSStyleSelector::SelectorMatch CSSStyleSelector::SelectorChecker::checkSelector(CSSSelector* sel, Element* e, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isSubSelector, bool encounteredLink, RenderStyle* elementStyle, RenderStyle* elementParentStyle) const
 {
 #if ENABLE(SVG)
     // Spec: CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree
@@ -1789,7 +1829,7 @@
 #endif
 
     // first selector has to match
-    if (!checkOneSelector(sel, e, selectorAttrs, dynamicPseudo, isAncestor, isSubSelector, elementStyle, elementParentStyle))
+    if (!checkOneSelector(sel, e, selectorAttrs, dynamicPseudo, isSubSelector, elementStyle, elementParentStyle))
         return SelectorFailsLocally;
 
     // The rest of the selectors has to match
@@ -1805,6 +1845,17 @@
         if (m_pseudoStyle != NOPSEUDO && m_pseudoStyle != dynamicPseudo)
             return SelectorFailsCompletely;
 
+    // Check for nested links.
+    if (m_matchVisitedPseudoClass && !isSubSelector) {
+        RenderStyle* currentStyle = elementStyle ? elementStyle : e->renderStyle();
+        if (currentStyle && currentStyle->insideLink() && e->isLink()) {
+            if (encounteredLink)
+                m_matchVisitedPseudoClass = false; // This link is not relevant to the style being resolved, so disable matching.
+            else
+                encounteredLink = true;
+        }
+    }
+
     switch (relation) {
         case CSSSelector::Descendant:
             while (true) {
@@ -1812,7 +1863,7 @@
                 if (!n || !n->isElementNode())
                     return SelectorFailsCompletely;
                 e = static_cast<Element*>(n);
-                SelectorMatch match = checkSelector(sel, e, selectorAttrs, dynamicPseudo, true, false);
+                SelectorMatch match = checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, encounteredLink);
                 if (match != SelectorFailsLocally)
                     return match;
             }
@@ -1823,7 +1874,7 @@
             if (!n || !n->isElementNode())
                 return SelectorFailsCompletely;
             e = static_cast<Element*>(n);
-            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, true, false);
+            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, encounteredLink);
         }
         case CSSSelector::DirectAdjacent:
         {
@@ -1838,7 +1889,8 @@
             if (!n)
                 return SelectorFailsLocally;
             e = static_cast<Element*>(n);
-            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, false); 
+            m_matchVisitedPseudoClass = false;
+            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, encounteredLink); 
         }
         case CSSSelector::IndirectAdjacent:
             if (!m_collectRulesOnly && e->parentNode() && e->parentNode()->isElementNode()) {
@@ -1853,7 +1905,8 @@
                 if (!n)
                     return SelectorFailsLocally;
                 e = static_cast<Element*>(n);
-                SelectorMatch match = checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, false);
+                m_matchVisitedPseudoClass = false;
+                SelectorMatch match = checkSelector(sel, e, selectorAttrs, dynamicPseudo, false, encounteredLink);
                 if (match != SelectorFailsLocally)
                     return match;
             };
@@ -1862,10 +1915,10 @@
             // a selector is invalid if something follows a pseudo-element
             // We make an exception for scrollbar pseudo elements and allow a set of pseudo classes (but nothing else)
             // to follow the pseudo elements.
-            if (elementStyle && dynamicPseudo != NOPSEUDO && dynamicPseudo != SELECTION &&
+            if ((elementStyle || m_collectRulesOnly) && dynamicPseudo != NOPSEUDO && dynamicPseudo != SELECTION &&
                 !((RenderScrollbar::scrollbarForStyleResolve() || dynamicPseudo == SCROLLBAR_CORNER || dynamicPseudo == RESIZER) && sel->m_match == CSSSelector::PseudoClass))
                 return SelectorFailsCompletely;
-            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, isAncestor, true, elementStyle, elementParentStyle);
+            return checkSelector(sel, e, selectorAttrs, dynamicPseudo, true, encounteredLink, elementStyle, elementParentStyle);
     }
 
     return SelectorFailsCompletely;
@@ -1938,7 +1991,7 @@
     return isPossibleHTMLAttr && htmlCaseInsensitiveAttributesSet->contains(attr.localName().impl());
 }
 
-bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Element* e, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isAncestor, bool isSubSelector, RenderStyle* elementStyle, RenderStyle* elementParentStyle) const
+bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Element* e, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isSubSelector, RenderStyle* elementStyle, RenderStyle* elementParentStyle) const
 {
     if (!e)
         return false;
@@ -2039,7 +2092,7 @@
                 // the parser enforces that this never occurs
                 ASSERT(!subSel->simpleSelector());
 
-                if (!checkOneSelector(subSel, e, selectorAttrs, dynamicPseudo, isAncestor, true, elementStyle, elementParentStyle))
+                if (!checkOneSelector(subSel, e, selectorAttrs, dynamicPseudo, true, elementStyle, elementParentStyle))
                     return true;
             }
         } else if (dynamicPseudo != NOPSEUDO && (RenderScrollbar::scrollbarForStyleResolve() || dynamicPseudo == SCROLLBAR_CORNER || dynamicPseudo == RESIZER)) {
@@ -2347,9 +2400,7 @@
                     return true;
                 break;
             case CSSSelector::PseudoAnyLink:
-                if (pseudoState == PseudoUnknown)
-                    pseudoState = checkPseudoState(e, false);
-                if (pseudoState == PseudoAnyLink || pseudoState == PseudoLink || pseudoState == PseudoVisited)
+                if (e && e->isLink())
                     return true;
                 break;
             case CSSSelector::PseudoAutofill: {
@@ -2360,16 +2411,12 @@
                 break;
             }
             case CSSSelector::PseudoLink:
-                if (pseudoState == PseudoUnknown || pseudoState == PseudoAnyLink)
-                    pseudoState = checkPseudoState(e);
-                if (pseudoState == PseudoLink)
-                    return true;
+                if (e && e->isLink())
+                    return !m_matchVisitedPseudoClass;
                 break;
             case CSSSelector::PseudoVisited:
-                if (pseudoState == PseudoUnknown || pseudoState == PseudoAnyLink)
-                    pseudoState = checkPseudoState(e);
-                if (pseudoState == PseudoVisited)
-                    return true;
+                if (e && e->isLink())
+                    return m_matchVisitedPseudoClass;
                 break;
             case CSSSelector::PseudoDrag: {
                 if (elementStyle)
@@ -2410,15 +2457,8 @@
                 }
                 break;
             case CSSSelector::PseudoEnabled:
-                if (e && e->isFormControlElement()) {
-                    InputElement* inputElement = toInputElement(e);
-                    if (inputElement && inputElement->isInputTypeHidden())
-                        break;
-                    // The UI spec states that you can't match :enabled unless you are an object that can
-                    // "receive focus and be activated."  We will limit matching of this pseudo-class to elements
-                    // that are non-"hidden" controls.
+                if (e && e->isFormControlElement())
                     return e->isEnabledFormControl();
-                }
                 break;
             case CSSSelector::PseudoFullPageMedia:
                 return e && e->document() && e->document()->isMediaDocument();
@@ -2426,16 +2466,8 @@
             case CSSSelector::PseudoDefault:
                 return e && e->isDefaultButtonForForm();
             case CSSSelector::PseudoDisabled:
-                if (e && e->isFormControlElement()) {
-                    InputElement* inputElement = toInputElement(e);
-                    if (inputElement && inputElement->isInputTypeHidden())
-                        break;
-
-                    // The UI spec states that you can't match :enabled unless you are an object that can
-                    // "receive focus and be activated."  We will limit matching of this pseudo-class to elements
-                    // that are non-"hidden" controls.
+                if (e && e->isFormControlElement())
                     return !e->isEnabledFormControl();
-                }
                 break;
             case CSSSelector::PseudoReadOnly: {
                 if (!e || !e->isFormControlElement())
@@ -2517,135 +2549,19 @@
         return false;
     }
     if (sel->m_match == CSSSelector::PseudoElement) {
-        if (!elementStyle)
+        if (!elementStyle && !m_collectRulesOnly)
             return false;
 
-        switch (sel->pseudoType()) {
-            // Pseudo-elements:
-            case CSSSelector::PseudoFirstLine:
-                dynamicPseudo = FIRST_LINE;
-                return true;
-            case CSSSelector::PseudoFirstLetter:
-                dynamicPseudo = FIRST_LETTER;
-                if (Document* doc = e->document())
-                    doc->setUsesFirstLetterRules(true);
-                return true;
-            case CSSSelector::PseudoSelection:
-                dynamicPseudo = SELECTION;
-                return true;
-            case CSSSelector::PseudoBefore:
-                dynamicPseudo = BEFORE;
-                return true;
-            case CSSSelector::PseudoAfter:
-                dynamicPseudo = AFTER;
-                return true;
-            case CSSSelector::PseudoFileUploadButton:
-                dynamicPseudo = FILE_UPLOAD_BUTTON;
-                return true;
-#if ENABLE(DATALIST)
-            case CSSSelector::PseudoInputListButton:
-                dynamicPseudo = INPUT_LIST_BUTTON;
-                return true;
-#endif
-            case CSSSelector::PseudoInputPlaceholder:
-                dynamicPseudo = INPUT_PLACEHOLDER;
-                return true;
-            case CSSSelector::PseudoSliderThumb:
-                dynamicPseudo = SLIDER_THUMB;
-                return true; 
-            case CSSSelector::PseudoSearchCancelButton:
-                dynamicPseudo = SEARCH_CANCEL_BUTTON;
-                return true; 
-            case CSSSelector::PseudoSearchDecoration:
-                dynamicPseudo = SEARCH_DECORATION;
-                return true;
-            case CSSSelector::PseudoSearchResultsDecoration:
-                dynamicPseudo = SEARCH_RESULTS_DECORATION;
-                return true;
-            case CSSSelector::PseudoSearchResultsButton:
-                dynamicPseudo = SEARCH_RESULTS_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsPanel:
-                dynamicPseudo = MEDIA_CONTROLS_PANEL;
-                return true;
-            case CSSSelector::PseudoMediaControlsMuteButton:
-                dynamicPseudo = MEDIA_CONTROLS_MUTE_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsPlayButton:
-                dynamicPseudo = MEDIA_CONTROLS_PLAY_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsTimelineContainer:
-                dynamicPseudo = MEDIA_CONTROLS_TIMELINE_CONTAINER;
-                return true;
-            case CSSSelector::PseudoMediaControlsVolumeSliderContainer:
-                dynamicPseudo = MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER;
-                return true;
-            case CSSSelector::PseudoMediaControlsCurrentTimeDisplay:
-                dynamicPseudo = MEDIA_CONTROLS_CURRENT_TIME_DISPLAY;
-                return true;
-            case CSSSelector::PseudoMediaControlsTimeRemainingDisplay:
-                dynamicPseudo = MEDIA_CONTROLS_TIME_REMAINING_DISPLAY;
-                return true;
-            case CSSSelector::PseudoMediaControlsTimeline:
-                dynamicPseudo = MEDIA_CONTROLS_TIMELINE;
-                return true;
-            case CSSSelector::PseudoMediaControlsVolumeSlider:
-                dynamicPseudo = MEDIA_CONTROLS_VOLUME_SLIDER;
-                return true;
-            case CSSSelector::PseudoMediaControlsSeekBackButton:
-                dynamicPseudo = MEDIA_CONTROLS_SEEK_BACK_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsSeekForwardButton:
-                dynamicPseudo = MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsRewindButton:
-                dynamicPseudo = MEDIA_CONTROLS_REWIND_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsReturnToRealtimeButton:
-                dynamicPseudo = MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsToggleClosedCaptions:
-                dynamicPseudo = MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON;
-                return true;
-            case CSSSelector::PseudoMediaControlsStatusDisplay:
-                dynamicPseudo = MEDIA_CONTROLS_STATUS_DISPLAY;
-                return true;
-            case CSSSelector::PseudoMediaControlsFullscreenButton:
-                dynamicPseudo = MEDIA_CONTROLS_FULLSCREEN_BUTTON;
-                return true;
-            case CSSSelector::PseudoScrollbar:
-                dynamicPseudo = SCROLLBAR;
-                return true;
-            case CSSSelector::PseudoScrollbarButton:
-                dynamicPseudo = SCROLLBAR_BUTTON;
-                return true;
-            case CSSSelector::PseudoScrollbarCorner:
-                dynamicPseudo = SCROLLBAR_CORNER;
-                return true;
-            case CSSSelector::PseudoScrollbarThumb:
-                dynamicPseudo = SCROLLBAR_THUMB;
-                return true;
-            case CSSSelector::PseudoScrollbarTrack:
-                dynamicPseudo = SCROLLBAR_TRACK;
-                return true;
-            case CSSSelector::PseudoScrollbarTrackPiece:
-                dynamicPseudo = SCROLLBAR_TRACK_PIECE;
-                return true;
-            case CSSSelector::PseudoResizer:
-                dynamicPseudo = RESIZER;
-                return true;
-            case CSSSelector::PseudoInnerSpinButton:
-                dynamicPseudo = INNER_SPIN_BUTTON;
-                return true;
-            case CSSSelector::PseudoOuterSpinButton:
-                dynamicPseudo = OUTER_SPIN_BUTTON;
-                return true;
-            case CSSSelector::PseudoUnknown:
-            case CSSSelector::PseudoNotParsed:
-            default:
-                ASSERT_NOT_REACHED();
-                break;
+        PseudoId pseudoId = CSSSelector::pseudoId(sel->pseudoType());
+        if (pseudoId == FIRST_LETTER) {
+            if (Document* document = e->document())
+                document->setUsesFirstLetterRules(true);
         }
+        if (pseudoId != NOPSEUDO) {
+            dynamicPseudo = pseudoId;
+            return true;
+        }
+        ASSERT_NOT_REACHED();
         return false;
     }
     // ### add the rest of the checks...
@@ -2970,7 +2886,7 @@
 
 void CSSStyleSelector::applyPropertyToStyle(int id, CSSValue *value, RenderStyle* style)
 {
-    initElementAndPseudoState(0);
+    initElement(0);
     initForStyleResolve(0, style);
     m_style = style;
     applyProperty(id, value);
@@ -5291,6 +5207,9 @@
     case CSSPropertyWebkitAnimationDuration:
         HANDLE_ANIMATION_VALUE(duration, Duration, value)
         return;
+    case CSSPropertyWebkitAnimationFillMode:
+        HANDLE_ANIMATION_VALUE(fillMode, FillMode, value)
+        return;
     case CSSPropertyWebkitAnimationIterationCount:
         HANDLE_ANIMATION_VALUE(iterationCount, IterationCount, value)
         return;
@@ -5661,6 +5580,30 @@
         animation->setDuration(primitiveValue->getFloatValue()/1000.0f);
 }
 
+void CSSStyleSelector::mapAnimationFillMode(Animation* layer, CSSValue* value)
+{
+    if (value->cssValueType() == CSSValue::CSS_INITIAL) {
+        layer->setFillMode(Animation::initialAnimationFillMode());
+        return;
+    }
+
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getIdent()) {
+    case CSSValueNone:
+        layer->setFillMode(AnimationFillModeNone);
+        break;
+    case CSSValueForwards:
+        layer->setFillMode(AnimationFillModeForwards);
+        break;
+    case CSSValueBackwards:
+        layer->setFillMode(AnimationFillModeBackwards);
+        break;
+    case CSSValueBoth:
+        layer->setFillMode(AnimationFillModeBoth);
+        break;
+    }
+}
+
 void CSSStyleSelector::mapAnimationIterationCount(Animation* animation, CSSValue* value)
 {
     if (value->cssValueType() == CSSValue::CSS_INITIAL) {
@@ -5769,10 +5712,10 @@
     CSSBorderImageValue* borderImage = static_cast<CSSBorderImageValue*>(value);
     
     // Set the image (this kicks off the load).
-    image.m_image = styleImage(borderImage->imageValue());
+    image.setImage(styleImage(borderImage->imageValue()));
 
     // Set up a length box to represent our image slices.
-    LengthBox& l = image.m_slices;
+    LengthBox l;
     Rect* r = borderImage->m_imageSliceRect.get();
     if (r->top()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
         l.m_top = Length(r->top()->getDoubleValue(), Percent);
@@ -5790,31 +5733,36 @@
         l.m_right = Length(r->right()->getDoubleValue(), Percent);
     else
         l.m_right = Length(r->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
-    
+    image.setSlices(l);
+
     // Set the appropriate rules for stretch/round/repeat of the slices
+    ENinePieceImageRule horizontalRule;
     switch (borderImage->m_horizontalSizeRule) {
         case CSSValueStretch:
-            image.m_horizontalRule = StretchImageRule;
+            horizontalRule = StretchImageRule;
             break;
         case CSSValueRound:
-            image.m_horizontalRule = RoundImageRule;
+            horizontalRule = RoundImageRule;
             break;
         default: // CSSValueRepeat
-            image.m_horizontalRule = RepeatImageRule;
+            horizontalRule = RepeatImageRule;
             break;
     }
+    image.setHorizontalRule(horizontalRule);
 
+    ENinePieceImageRule verticalRule;
     switch (borderImage->m_verticalSizeRule) {
         case CSSValueStretch:
-            image.m_verticalRule = StretchImageRule;
+            verticalRule = StretchImageRule;
             break;
         case CSSValueRound:
-            image.m_verticalRule = RoundImageRule;
+            verticalRule = RoundImageRule;
             break;
         default: // CSSValueRepeat
-            image.m_verticalRule = RepeatImageRule;
+            verticalRule = RepeatImageRule;
             break;
     }
+    image.setVerticalRule(verticalRule);
 }
 
 void CSSStyleSelector::checkForTextSizeAdjust()
@@ -6047,17 +5995,9 @@
     if (ident) {
         if (ident == CSSValueWebkitText)
             col = m_element->document()->textColor();
-        else if (ident == CSSValueWebkitLink) {
-            const Color& linkColor = m_element->document()->linkColor();
-            const Color& visitedColor = m_element->document()->visitedLinkColor();
-            if (linkColor == visitedColor)
-                col = linkColor;
-            else {
-                if (pseudoState == PseudoUnknown || pseudoState == PseudoAnyLink)
-                    pseudoState = m_checker.checkPseudoState(m_element);
-                col = (pseudoState == PseudoLink) ? linkColor : visitedColor;
-            }
-        } else if (ident == CSSValueWebkitActivelink)
+        else if (ident == CSSValueWebkitLink)
+            col = m_element->isLink() && m_checker.m_matchVisitedPseudoClass ? m_element->document()->visitedLinkColor() : m_element->document()->linkColor();
+        else if (ident == CSSValueWebkitActivelink)
             col = m_element->document()->activeLinkColor();
         else if (ident == CSSValueWebkitFocusRingColor)
             col = RenderTheme::focusRingColor();
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 644051c..80a186b 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -85,12 +85,12 @@
                          bool strictParsing, bool matchAuthorAndUserStyles);
         ~CSSStyleSelector();
 
-        void initElementAndPseudoState(Element*);
+        void initElement(Element*);
         void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO);
-        PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, bool allowSharing = true, bool resolveForRootDefault = false);
+        PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, bool allowSharing = true, bool resolveForRootDefault = false, bool matchVisitedLinks = false);
         void keyframeStylesForAnimation(Element*, const RenderStyle*, KeyframeList& list);
 
-        PassRefPtr<RenderStyle> pseudoStyleForElement(PseudoId, Element*, RenderStyle* parentStyle = 0);
+        PassRefPtr<RenderStyle> pseudoStyleForElement(PseudoId, Element*, RenderStyle* parentStyle = 0, bool matchVisitedLinks = false);
 
         static PassRefPtr<RenderStyle> styleForDocument(Document*);
 
@@ -110,7 +110,7 @@
     public:
         // These methods will give back the set of rules that matched for a given element (or a pseudo-element).
         PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly);
-        PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, const String& pseudoStyle, bool authorOnly);
+        PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly);
 
         // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
         // the correct font size scaled relative to the user's default (medium).
@@ -196,11 +196,11 @@
             SelectorChecker(Document*, bool strictParsing);
 
             bool checkSelector(CSSSelector*, Element*) const;
-            SelectorMatch checkSelector(CSSSelector*, Element*, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isAncestor, bool isSubSelector, RenderStyle* = 0, RenderStyle* elementParentStyle = 0) const;
-            bool checkOneSelector(CSSSelector*, Element*, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isAncestor, bool isSubSelector, RenderStyle*, RenderStyle* elementParentStyle) const;
-            PseudoState checkPseudoState(Element*, bool checkVisited = true) const;
+            SelectorMatch checkSelector(CSSSelector*, Element*, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isSubSelector, bool encounteredLink, RenderStyle* = 0, RenderStyle* elementParentStyle = 0) const;
+            bool checkOneSelector(CSSSelector*, Element*, HashSet<AtomicStringImpl*>* selectorAttrs, PseudoId& dynamicPseudo, bool isSubSelector, RenderStyle*, RenderStyle* elementParentStyle) const;
             bool checkScrollbarPseudoClass(CSSSelector*, PseudoId& dynamicPseudo) const;
 
+            EInsideLink determineLinkState(Element* element) const;
             void allVisitedStateChanged();
             void visitedStateChanged(LinkHash visitedHash);
 
@@ -209,6 +209,7 @@
             bool m_collectRulesOnly;
             PseudoId m_pseudoStyle;
             bool m_documentIsHTML;
+            mutable bool m_matchVisitedPseudoClass;
             mutable HashSet<LinkHash, LinkHashHash> m_linksCheckedForVisitedState;
         };
 
@@ -235,6 +236,7 @@
         void mapAnimationDelay(Animation*, CSSValue*);
         void mapAnimationDirection(Animation*, CSSValue*);
         void mapAnimationDuration(Animation*, CSSValue*);
+        void mapAnimationFillMode(Animation*, CSSValue*);
         void mapAnimationIterationCount(Animation*, CSSValue*);
         void mapAnimationName(Animation*, CSSValue*);
         void mapAnimationPlayState(Animation*, CSSValue*);
@@ -278,7 +280,7 @@
         CSSValue* m_lineHeightValue;
         bool m_fontDirty;
         bool m_matchAuthorAndUserStyles;
-
+        
         RefPtr<CSSFontSelector> m_fontSelector;
         HashSet<AtomicStringImpl*> m_selectorAttrs;
         Vector<CSSMutableStyleDeclaration*> m_additionalAttributeStyleDecls;
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
index 9c9aa18..fb25374 100644
--- a/WebCore/css/CSSStyleSheet.cpp
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -96,9 +96,24 @@
         return 0;
     }
 
-    // ###
-    // HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index e.g. if an
-    //@import rule is inserted after a standard rule set or other at-rule.
+    // Throw a HIERARCHY_REQUEST_ERR exception if the rule cannot be inserted at the specified index.  The best
+    // example of this is an @import rule inserted after regular rules.
+    if (index > 0) {
+        if (r->isImportRule()) {
+            // Check all the rules that come before this one to make sure they are only @charset and @import rules.
+            for (unsigned i = 0; i < index; ++i) {
+                if (!item(i)->isCharsetRule() && !item(i)->isImportRule()) {
+                    ec = HIERARCHY_REQUEST_ERR;
+                    return 0;
+                }
+            }
+        } else if (r->isCharsetRule()) {
+            // The @charset rule has to come first and there can be only one.
+            ec = HIERARCHY_REQUEST_ERR;
+            return 0;
+        }
+    }
+
     insert(index, r.release());
     
     styleSheetChanged();
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index ca2a47a..09d969a 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -582,6 +582,7 @@
 menulist-text
 menulist-textfield
 outer-spin-button
+progress-bar
 slider-horizontal
 slider-vertical
 sliderthumb-horizontal
@@ -639,6 +640,13 @@
 # alternate
 
 #
+# CSS_PROP__WEBKIT_ANIMATION_FILL_MODE
+#
+# forwards
+# backwards
+# both
+
+#
 # CSS_PROP__WEBKIT_ANIMATION_ITERATION_COUNT
 #
 # infinite
@@ -701,3 +709,9 @@
 # -webkit-color-correction
 #default
 sRGB
+
+# (-webkit-view-mode:) media feature:
+mini
+floating
+application
+fullscreen
diff --git a/WebCore/css/FontFamilyValue.cpp b/WebCore/css/FontFamilyValue.cpp
index 90a8c9d..ebe9645 100644
--- a/WebCore/css/FontFamilyValue.cpp
+++ b/WebCore/css/FontFamilyValue.cpp
@@ -21,45 +21,10 @@
 #include "config.h"
 #include "FontFamilyValue.h"
 
+#include "CSSParser.h"
+
 namespace WebCore {
 
-// FIXME: This appears identical to isCSSTokenizerIdentifier from CSSPrimitiveValue.cpp, we should use a single function.
-static bool isValidCSSIdentifier(const String& string)
-{
-    unsigned length = string.length();
-    if (!length)
-        return false;
-
-    const UChar* characters = string.characters();
-    UChar c = characters[0];
-    if (!(c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '-' || c >= 0x80))
-        return false;
-
-    for (unsigned i = 1; i < length; ++i) {
-        c = characters[i];
-        if (!(c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c >= 0x80))
-            return false;
-    }
-
-    return true;
-}
-
-// Quotes the string if it needs quoting.
-// We use single quotes because serialization code uses double quotes, and it's nice to
-// avoid having to turn all the quote marks into &quot; as we would have to.
-static String quoteStringIfNeeded(const String& string)
-{
-    if (isValidCSSIdentifier(string))
-        return string;
-
-    // FIXME: Also need to transform control characters (00-1F) into \ sequences.
-    // FIXME: This is inefficient -- should use a Vector<UChar> instead.
-    String quotedString = string;
-    quotedString.replace('\\', "\\\\");
-    quotedString.replace('\'', "\\'");
-    return "'" + quotedString + "'";
-}
-
 FontFamilyValue::FontFamilyValue(const String& familyName)
     : CSSPrimitiveValue(String(), CSS_STRING)
     , m_familyName(familyName)
@@ -101,7 +66,7 @@
 
 String FontFamilyValue::cssText() const
 {
-    return quoteStringIfNeeded(m_familyName);
+    return quoteCSSStringIfNeeded(m_familyName);
 }
 
 }
diff --git a/WebCore/css/MediaFeatureNames.cpp b/WebCore/css/MediaFeatureNames.cpp
index a7799c1..85b8cbc 100644
--- a/WebCore/css/MediaFeatureNames.cpp
+++ b/WebCore/css/MediaFeatureNames.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #include "MediaFeatureNames.h"
-#include "StaticConstructors.h"
+#include <wtf/StaticConstructors.h>
 
 namespace WebCore {
 namespace MediaFeatureNames {
diff --git a/WebCore/css/MediaFeatureNames.h b/WebCore/css/MediaFeatureNames.h
index 2799004..8aaedb2 100644
--- a/WebCore/css/MediaFeatureNames.h
+++ b/WebCore/css/MediaFeatureNames.h
@@ -25,6 +25,13 @@
 namespace WebCore {
     namespace MediaFeatureNames {
 
+#if ENABLE(WIDGETS_10_SUPPORT)
+#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro) \
+    macro(view_mode, "-webkit-view-mode")
+#else
+#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
+#endif
+
 #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
     macro(color, "color") \
     macro(grid, "grid") \
@@ -59,6 +66,8 @@
     macro(transform_3d, "-webkit-transform-3d") \
     macro(transition, "-webkit-transition") \
     macro(animation, "-webkit-animation") \
+    CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
+
 // end of macro
 
 #ifndef CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
diff --git a/WebCore/css/MediaQueryEvaluator.cpp b/WebCore/css/MediaQueryEvaluator.cpp
index 4963ed4..ded40b5 100644
--- a/WebCore/css/MediaQueryEvaluator.cpp
+++ b/WebCore/css/MediaQueryEvaluator.cpp
@@ -29,6 +29,7 @@
 #include "MediaQueryEvaluator.h"
 
 #include "Chrome.h"
+#include "ChromeClient.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSStyleSelector.h"
 #include "CSSValueList.h"
@@ -47,7 +48,7 @@
 #include "PlatformScreen.h"
 #include <wtf/HashMap.h>
 
-#if ENABLE(3D_RENDERING)
+#if ENABLE(3D_RENDERING) && USE(ACCELERATED_COMPOSITING)
 #include "RenderLayerCompositor.h"
 #endif
 
@@ -474,8 +475,10 @@
 
 #if ENABLE(3D_RENDERING)
     bool threeDEnabled = false;
+#if USE(ACCELERATED_COMPOSITING)
     if (RenderView* view = frame->contentRenderer())
         threeDEnabled = view->compositor()->hasAcceleratedCompositing();
+#endif
 
     returnValueIfNoParameter = threeDEnabled;
     have3dRendering = threeDEnabled ? 1 : 0;
@@ -492,6 +495,29 @@
     return returnValueIfNoParameter;
 }
 
+#if ENABLE(WIDGETS_10_SUPPORT)
+static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
+{
+    if (value) {
+        String mode = static_cast<CSSPrimitiveValue*>(value)->getStringValue();
+        if (ChromeClient* client = frame->page()->chrome()->client()) {
+            if (mode == "windowed" && client->isWindowed())
+                return true;
+            if (mode == "floating" && client->isFloating())
+                return true;
+            if (mode == "fullscreen" && client->isFullscreen())
+                return true;
+            if (mode == "maximized" && client->isMaximized())
+                return true;
+            if (mode == "minimized" && client->isMinimized())
+                return true;
+            return false;
+        }
+    }
+    return true;
+}
+#endif
+
 static void createFunctionMap()
 {
     // Create the table.
diff --git a/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
index f184b1b..25da148 100644
--- a/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
@@ -102,16 +102,16 @@
         case CSSPropertyWritingMode:
             return CSSPrimitiveValue::create(svgStyle->writingMode());
         case CSSPropertyClipPath:
-            if (!svgStyle->clipPath().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->clipPath(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->clipperResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->clipperResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMask:
-            if (!svgStyle->maskElement().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->maskElement(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->maskerResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->maskerResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyFilter:
-            if (!svgStyle->filter().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->filter(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->filterResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->filterResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyFloodColor:
             return CSSPrimitiveValue::createColor(svgStyle->floodColor().rgb());
@@ -124,16 +124,16 @@
         case CSSPropertyKerning:
             return svgStyle->kerning();
         case CSSPropertyMarkerEnd:
-            if (!svgStyle->endMarker().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->endMarker(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->markerEndResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->markerEndResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMarkerMid:
-            if (!svgStyle->midMarker().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->midMarker(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->markerMidResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->markerMidResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMarkerStart:
-            if (!svgStyle->startMarker().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->startMarker(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle->markerStartResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle->markerStartResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyStroke:
             return svgStyle->strokePaint();
diff --git a/WebCore/css/SVGCSSStyleSelector.cpp b/WebCore/css/SVGCSSStyleSelector.cpp
index 5651a0a..75d48b7 100644
--- a/WebCore/css/SVGCSSStyleSelector.cpp
+++ b/WebCore/css/SVGCSSStyleSelector.cpp
@@ -58,7 +58,6 @@
 else if (isInitial) \
     svgstyle->set##Prop(SVGRenderStyle::initial##Prop());
 
-
 namespace WebCore {
 
 static float roundToNearestGlyphOrientationAngle(float angle)
@@ -321,7 +320,7 @@
         }
         case CSSPropertyMarkerStart:
         {
-            HANDLE_INHERIT_AND_INITIAL(startMarker, StartMarker)
+            HANDLE_INHERIT_AND_INITIAL(markerStartResource, MarkerStartResource)
             if (!primitiveValue)
                 return;
 
@@ -332,12 +331,12 @@
             else
                 return;
 
-            svgstyle->setStartMarker(SVGURIReference::getTarget(s));
+            svgstyle->setMarkerStartResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyMarkerMid:
         {
-            HANDLE_INHERIT_AND_INITIAL(midMarker, MidMarker)
+            HANDLE_INHERIT_AND_INITIAL(markerMidResource, MarkerMidResource)
             if (!primitiveValue)
                 return;
 
@@ -348,12 +347,12 @@
             else
                 return;
 
-            svgstyle->setMidMarker(SVGURIReference::getTarget(s));
+            svgstyle->setMarkerMidResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyMarkerEnd:
         {
-            HANDLE_INHERIT_AND_INITIAL(endMarker, EndMarker)
+            HANDLE_INHERIT_AND_INITIAL(markerEndResource, MarkerEndResource)
             if (!primitiveValue)
                 return;
 
@@ -364,7 +363,7 @@
             else
                 return;
 
-            svgstyle->setEndMarker(SVGURIReference::getTarget(s));
+            svgstyle->setMarkerEndResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyStrokeLinecap:
@@ -392,7 +391,7 @@
         }
         case CSSPropertyFilter:
         {
-            HANDLE_INHERIT_AND_INITIAL(filter, Filter)
+            HANDLE_INHERIT_AND_INITIAL(filterResource, FilterResource)
             if (!primitiveValue)
                 return;
 
@@ -402,12 +401,13 @@
                 s = primitiveValue->getStringValue();
             else
                 return;
-            svgstyle->setFilter(SVGURIReference::getTarget(s));
+
+            svgstyle->setFilterResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyMask:
         {
-            HANDLE_INHERIT_AND_INITIAL(maskElement, MaskElement)
+            HANDLE_INHERIT_AND_INITIAL(maskerResource, MaskerResource)
             if (!primitiveValue)
                 return;
 
@@ -417,13 +417,13 @@
                 s = primitiveValue->getStringValue();
             else
                 return;
-
-            svgstyle->setMaskElement(SVGURIReference::getTarget(s));
+            
+            svgstyle->setMaskerResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyClipPath:
         {
-            HANDLE_INHERIT_AND_INITIAL(clipPath, ClipPath)
+            HANDLE_INHERIT_AND_INITIAL(clipperResource, ClipperResource)
             if (!primitiveValue)
                 return;
 
@@ -434,7 +434,7 @@
             else
                 return;
 
-            svgstyle->setClipPath(SVGURIReference::getTarget(s));
+            svgstyle->setClipperResource(SVGURIReference::getTarget(s));
             break;
         }
         case CSSPropertyTextAnchor:
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index 9d9225c..3f7818e 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -72,7 +72,7 @@
     display: block
 }
 
-article, aside, footer, header, nav, section {
+article, aside, footer, header, hgroup, nav, section {
     display: block
 }
 
@@ -515,6 +515,20 @@
     font-weight: normal;
 }
 
+/* progress */
+
+progress {
+    -webkit-appearance: progress-bar;
+    display: inline-block;
+    height: 1em;
+    width: 10em;
+    vertical-align: -0.2em;
+}
+
+progress::-webkit-progress-bar {
+    -webkit-appearance: progress-bar;
+}
+
 /* datagrid */
 
 datagrid {
diff --git a/WebCore/css/make-css-file-arrays.pl b/WebCore/css/make-css-file-arrays.pl
index 05c8fd1..dad530c 100755
--- a/WebCore/css/make-css-file-arrays.pl
+++ b/WebCore/css/make-css-file-arrays.pl
@@ -23,14 +23,6 @@
 use strict;
 use Getopt::Long;
 
-my $preprocessor;
-
-GetOptions('preprocessor=s' => \$preprocessor);
-
-if (!$preprocessor) {
-    $preprocessor = "/usr/bin/gcc -E -P -x c++";
-}
-
 my $header = $ARGV[0];
 shift;
 
@@ -48,7 +40,7 @@
     my $name = $1;
 
     # Slurp in the CSS file.
-    open IN, $preprocessor . " " . $in . "|" or die;
+    open IN, "<", $in or die;
     my $text; { local $/; $text = <IN>; }
     close IN;
 
diff --git a/WebCore/css/mathml.css b/WebCore/css/mathml.css
index b56a24b..8b4da3e 100644
--- a/WebCore/css/mathml.css
+++ b/WebCore/css/mathml.css
@@ -1,7 +1,7 @@
 @namespace "http://www.w3.org/1998/Math/MathML";
 
 math {
-    font-family: Symbol, STIXGeneral, "Times New Roman";
+    font-family: Symbol, "Times New Roman";
     display: inline-block;
     padding: 0px;
     margin: 0px;
diff --git a/WebCore/css/mediaControlsQt.css b/WebCore/css/mediaControlsQt.css
index a9c3609..d49fe96 100644
--- a/WebCore/css/mediaControlsQt.css
+++ b/WebCore/css/mediaControlsQt.css
@@ -51,8 +51,6 @@
 }
 
 audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
-    left: auto;
-    right: 5px;
     width: 12px;
     height: 12px;
     padding: 6px;
@@ -60,7 +58,6 @@
 }
 
 audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
-    left: 5px;
     width: 9px;
     height: 12px;
     padding: 6px 12px 6px 11px;
@@ -72,7 +69,21 @@
 }
 
 audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display {
-    display: none;
+    -webkit-appearance: media-current-time-display;
+    -webkit-user-select: none;
+    display: inline-block;
+    height: 12px;
+    padding: 6px;
+    margin: 5px 3px;
+
+    overflow: hidden;
+    cursor: default;
+
+    text-align: center;
+    font-size: 10px;
+    font-family: Verdana;
+    font-weight: bold;
+    color: white;
 }
 
 audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display {
@@ -80,51 +91,38 @@
 }
 
 audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
-    left: 42px;
-    right: 34px;
     height: 12px;
     padding: 6px 8px;
-    margin: 5px 0px;
+    margin: 5px 3px;
 }
 
 audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container {
-    display: none;
+    -webkit-appearance: media-volume-slider-container;
+    position: absolute;
+    height: 103px;
+    width: 24px;
 }
 
 audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider {
-    display: none;
+    -webkit-appearance: media-volume-slider;
+    display: inline;
+    position: absolute;
+
+    width: 12px;
+    padding: 6px;
+    height: 88px;
+    margin: 0 0 3px 0;
 }
 
 audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
-    /* Since MediaControlElements are always created with a renderer we have to hide
-       the controls we don't use, so they don't mess up activation and event handling */
-    left: 0px;
-    top: 0px;
-    width: 0px;
-    height: 0px;
-
     display: none;
 }
 
 audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button {
-    /* Since MediaControlElements are always created with a renderer we have to hide
-       the controls we don't use, so they don't mess up activation and event handling */
-    left: 0px;
-    top: 0px;
-    width: 0px;
-    height: 0px;
-
     display: none;
 }
 
 audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button {
-    /* Since MediaControlElements are always created with a renderer we have to hide
-       the controls we don't use, so they don't mess up activation and event handling */
-    left: 0px;
-    top: 0px;
-    width: 0px;
-    height: 0px;
-
     display: none;
 }
 
@@ -136,3 +134,7 @@
     display: none;
 }
 
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+    display: none;
+}
+
diff --git a/WebCore/css/themeQtMaemo5.css b/WebCore/css/themeQtMaemo5.css
new file mode 100644
index 0000000..c568d5d
--- /dev/null
+++ b/WebCore/css/themeQtMaemo5.css
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 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.
+ */
+
+input[type="button"],
+input[type="submit"],
+input[type="reset"],
+input[type="file"]::-webkit-file-upload-button, button,
+select {
+    padding: 2px 18px 3px 18px;
+    border: 1px solid black;
+    -webkit-border-radius:5px;
+    background-color: ButtonFace;
+}
+
+input[type="button"]:disabled,
+input[type="submit"]:disabled,
+input[type="reset"]:disabled,
+input[type="file"]:disabled::-webkit-file-upload-button,
+button:disabled,
+select:disabled {
+    border: 1px solid gray;
+}
+
+input[type="button"]:active,
+input[type="submit"]:active,
+input[type="reset"]:active,
+input[type="file"]:active::-webkit-file-upload-button,
+button:active,
+select:active{
+    background-color: ButtonShadow;
+}
+
+input[type="button"]:active:disabled,
+input[type="submit"]:active:disabled,
+input[type="reset"]:active:disabled,
+input[type="file"]:active:disabled::-webkit-file-upload-button,
+button:active:disabled,
+select:active:disabled {
+    border: 1px solid gray;
+}
+
+input:not([type]),
+input[type="text"],
+input[type="password"],
+textarea {
+    border: 1px solid black;
+}
+
+input:not([type]):disabled,
+input[type="text"]:disabled,
+input[type="password"]:disabled,
+textarea:disabled {
+    border: 1px solid grey;
+    background-color:ButtonHighlight;
+}
+
+input:not([type]):active,
+input[type="text"]:active,
+input[type="password"]:active,
+textarea:active {
+    background-color:ButtonShadow;
+}
diff --git a/WebCore/css/themeQtNoListboxes.css b/WebCore/css/themeQtNoListboxes.css
new file mode 100644
index 0000000..4c5e44a
--- /dev/null
+++ b/WebCore/css/themeQtNoListboxes.css
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 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.
+ */
+
+select[size],
+select[multiple],
+select[size][multiple] {
+    -webkit-appearance: menulist;
+    -webkit-box-align: center;
+    border: 1px solid;
+    -webkit-border-radius: 5px;
+    white-space: pre;
+}
diff --git a/WebCore/css/tokenizer.flex b/WebCore/css/tokenizer.flex
index 1569ee2..3af725c 100644
--- a/WebCore/css/tokenizer.flex
+++ b/WebCore/css/tokenizer.flex
@@ -24,13 +24,13 @@
 w               [ \t\r\n\f]*
 nl              \n|\r\n|\r|\f
 range           \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
-nth             (-?[0-9]*n[\+-][0-9]+)|(-?[0-9]*n)
+nth             [\+-]?{intnum}*n([\+-]{intnum})?
 
 %%
 
-\/\*[^*]*\*+([^/*][^*]*\*+)*\/  /* ignore comments */
+\/\*[^*]*\*+([^/*][^*]*\*+)*\/ {countLines(); /* ignore comments */ }
 
-[ \t\r\n\f]+            {yyTok = WHITESPACE; return yyTok;}
+[ \t\r\n\f]+            {countLines(); yyTok = WHITESPACE; return yyTok;}
 
 "<!--"                  {yyTok = SGML_CD; return yyTok;}
 "-->"                   {yyTok = SGML_CD; return yyTok;}
diff --git a/WebCore/dom/Attr.idl b/WebCore/dom/Attr.idl
index af84478..3c73bc0 100644
--- a/WebCore/dom/Attr.idl
+++ b/WebCore/dom/Attr.idl
@@ -28,7 +28,9 @@
         // DOM Level 1
 
         readonly attribute [ConvertNullStringTo=Null] DOMString name;
+
         readonly attribute boolean specified;
+
                  attribute [ConvertNullStringTo=Null, ConvertNullToNullString, CustomSetter] DOMString value 
                      setter raises(DOMException);
 
diff --git a/WebCore/dom/CanvasSurface.cpp b/WebCore/dom/CanvasSurface.cpp
new file mode 100644
index 0000000..dc7e4e1
--- /dev/null
+++ b/WebCore/dom/CanvasSurface.cpp
@@ -0,0 +1,180 @@
+/*
+ * 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:
+ * 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 COMPUTER, 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 "CanvasSurface.h"
+
+#include "AffineTransform.h"
+#include "ExceptionCode.h"
+#include "FloatRect.h"
+#include "GraphicsContext.h"
+#include "HTMLCanvasElement.h"
+#include "ImageBuffer.h"
+#include "MIMETypeRegistry.h"
+
+namespace WebCore {
+
+// These values come from the WhatWG spec.
+const int CanvasSurface::DefaultWidth = 300;
+const int CanvasSurface::DefaultHeight = 150;
+
+// Firefox limits width/height to 32767 pixels, but slows down dramatically before it
+// reaches that limit. We limit by area instead, giving us larger maximum dimensions,
+// in exchange for a smaller maximum canvas size.
+const float CanvasSurface::MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
+
+CanvasSurface::CanvasSurface(float pageScaleFactor)
+    : m_size(DefaultWidth, DefaultHeight)
+    , m_pageScaleFactor(pageScaleFactor)
+    , m_originClean(true)
+    , m_hasCreatedImageBuffer(false)
+{
+}
+
+CanvasSurface::~CanvasSurface()
+{
+}
+
+void CanvasSurface::setSurfaceSize(const IntSize& size)
+{
+    m_size = size;
+    m_hasCreatedImageBuffer = false;
+    m_imageBuffer.clear();
+}
+
+String CanvasSurface::toDataURL(const String& mimeType, ExceptionCode& ec)
+{
+    if (!m_originClean) {
+        ec = SECURITY_ERR;
+        return String();
+    }
+
+    if (m_size.isEmpty() || !buffer())
+        return String("data:,");
+
+    // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this method to be used on a worker thread).
+    if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType))
+        return buffer()->toDataURL("image/png");
+
+    return buffer()->toDataURL(mimeType);
+}
+
+void CanvasSurface::willDraw(const FloatRect&)
+{
+    if (m_imageBuffer)
+        m_imageBuffer->clearImage();
+}
+
+IntRect CanvasSurface::convertLogicalToDevice(const FloatRect& logicalRect) const
+{
+    return IntRect(convertLogicalToDevice(logicalRect.location()), convertLogicalToDevice(logicalRect.size()));
+}
+
+IntSize CanvasSurface::convertLogicalToDevice(const FloatSize& logicalSize) const
+{
+    float wf = ceilf(logicalSize.width() * m_pageScaleFactor);
+    float hf = ceilf(logicalSize.height() * m_pageScaleFactor);
+
+    if (!(wf >= 1 && hf >= 1 && wf * hf <= MaxCanvasArea))
+        return IntSize();
+
+    return IntSize(static_cast<unsigned>(wf), static_cast<unsigned>(hf));
+}
+
+IntPoint CanvasSurface::convertLogicalToDevice(const FloatPoint& logicalPos) const
+{
+    float xf = logicalPos.x() * m_pageScaleFactor;
+    float yf = logicalPos.y() * m_pageScaleFactor;
+
+    return IntPoint(static_cast<unsigned>(xf), static_cast<unsigned>(yf));
+}
+
+void CanvasSurface::createImageBuffer() const
+{
+    ASSERT(!m_imageBuffer);
+
+    m_hasCreatedImageBuffer = true;
+
+    FloatSize unscaledSize(width(), height());
+    IntSize size = convertLogicalToDevice(unscaledSize);
+    if (!size.width() || !size.height())
+        return;
+
+    m_imageBuffer = ImageBuffer::create(size);
+    // The convertLogicalToDevice MaxCanvasArea check should prevent common cases
+    // where ImageBuffer::create() returns 0, however we could still be low on memory.
+    if (!m_imageBuffer)
+        return;
+    m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()));
+    m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
+}
+
+GraphicsContext* CanvasSurface::drawingContext() const
+{
+    return buffer() ? m_imageBuffer->context() : 0;
+}
+
+ImageBuffer* CanvasSurface::buffer() const
+{
+    if (!m_hasCreatedImageBuffer)
+        createImageBuffer();
+    return m_imageBuffer.get();
+}
+
+AffineTransform CanvasSurface::baseTransform() const
+{
+    ASSERT(m_hasCreatedImageBuffer);
+    FloatSize unscaledSize(width(), height());
+    IntSize size = convertLogicalToDevice(unscaledSize);
+    AffineTransform transform;
+    if (size.width() && size.height())
+        transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height());
+    transform.multiply(m_imageBuffer->baseTransform());
+    return transform;
+}
+
+// FIXME: Everything below here relies on CanvasSurface really being
+// a HTMLCanvasElement.
+const SecurityOrigin& CanvasSurface::securityOrigin() const
+{
+    return *(static_cast<const HTMLCanvasElement*>(this)->document()->securityOrigin());
+}
+
+RenderBox* CanvasSurface::renderBox() const
+{
+    return static_cast<const HTMLCanvasElement*>(this)->renderBox();
+}
+
+RenderStyle* CanvasSurface::computedStyle()
+{
+    return static_cast<HTMLCanvasElement*>(this)->computedStyle();
+}
+
+CSSStyleSelector* CanvasSurface::styleSelector()
+{
+    return static_cast<HTMLCanvasElement*>(this)->document()->styleSelector();
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/CanvasSurface.h b/WebCore/dom/CanvasSurface.h
new file mode 100644
index 0000000..f5317e5
--- /dev/null
+++ b/WebCore/dom/CanvasSurface.h
@@ -0,0 +1,109 @@
+/*
+ * 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:
+ * 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 COMPUTER, 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 CanvasSurface_h
+#define CanvasSurface_h
+
+#include "AffineTransform.h"
+#include "IntSize.h"
+
+#include <wtf/OwnPtr.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class AffineTransform;
+class FloatPoint;
+class FloatRect;
+class FloatSize;
+class GraphicsContext;
+class ImageBuffer;
+class IntPoint;
+class String;
+
+class CSSStyleSelector;
+class RenderBox;
+class RenderStyle;
+class SecurityOrigin;
+
+typedef int ExceptionCode;
+
+class CanvasSurface : public Noncopyable {
+public:
+    CanvasSurface(float pageScaleFactor);
+    virtual ~CanvasSurface();
+
+    int width() const { return m_size.width(); }
+    int height() const { return m_size.height(); }
+
+    String toDataURL(const String& mimeType, ExceptionCode&);
+
+    const IntSize& size() const { return m_size; }
+
+    virtual void willDraw(const FloatRect&);
+
+    GraphicsContext* drawingContext() const;
+
+    ImageBuffer* buffer() const;
+
+    IntRect convertLogicalToDevice(const FloatRect&) const;
+    IntSize convertLogicalToDevice(const FloatSize&) const;
+    IntPoint convertLogicalToDevice(const FloatPoint&) const;
+
+    void setOriginTainted() { m_originClean = false; }
+    bool originClean() const { return m_originClean; }
+
+    AffineTransform baseTransform() const;
+
+    const SecurityOrigin& securityOrigin() const;
+    RenderBox* renderBox() const;
+    RenderStyle* computedStyle();
+    CSSStyleSelector* styleSelector();
+
+protected:
+    void setSurfaceSize(const IntSize&);
+    bool hasCreatedImageBuffer() const { return m_hasCreatedImageBuffer; }
+
+    static const int DefaultWidth;
+    static const int DefaultHeight;
+
+private:
+    void createImageBuffer() const;
+
+    static const float MaxCanvasArea;
+
+    IntSize m_size;
+
+    float m_pageScaleFactor;
+    bool m_originClean;
+
+    // m_createdImageBuffer means we tried to malloc the buffer.  We didn't necessarily get it.
+    mutable bool m_hasCreatedImageBuffer;
+    mutable OwnPtr<ImageBuffer> m_imageBuffer;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/dom/CharacterData.cpp b/WebCore/dom/CharacterData.cpp
index 3c3dc37..f5adb6c 100644
--- a/WebCore/dom/CharacterData.cpp
+++ b/WebCore/dom/CharacterData.cpp
@@ -22,7 +22,6 @@
 #include "config.h"
 #include "CharacterData.h"
 
-#include "CString.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "MutationEvent.h"
diff --git a/WebCore/dom/Clipboard.cpp b/WebCore/dom/Clipboard.cpp
index 7f33aac..d644bcc 100644
--- a/WebCore/dom/Clipboard.cpp
+++ b/WebCore/dom/Clipboard.cpp
@@ -27,7 +27,6 @@
 #include "Clipboard.h"
 
 #include "CachedImage.h"
-#include "DOMImplementation.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "Image.h"
@@ -36,7 +35,7 @@
 
 Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) 
     : m_policy(policy)
-    , m_dropEffect("none")
+    , m_dropEffect("uninitialized")
     , m_effectAllowed("uninitialized")
     , m_dragStarted(false)
     , m_forDragging(isForDragging)
@@ -66,7 +65,7 @@
     if (op == "link")
         return DragOperationLink;
     if (op == "move")
-        return DragOperationGeneric;    // FIXME: Why is this DragOperationGeneric? <http://webkit.org/b/33697>
+        return (DragOperation)(DragOperationGeneric | DragOperationMove);
     if (op == "copyLink")
         return (DragOperation)(DragOperationCopy | DragOperationLink);
     if (op == "copyMove")
@@ -110,7 +109,7 @@
 DragOperation Clipboard::destinationOperation() const
 {
     DragOperation op = dragOpFromIEOp(m_dropEffect);
-    ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric || op == DragOperationMove);
+    ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == (DragOperation)(DragOperationGeneric | DragOperationMove) || op == DragOperationEvery);
     return op;
 }
 
@@ -122,7 +121,7 @@
 
 void Clipboard::setDestinationOperation(DragOperation op)
 {
-    ASSERT_ARG(op, op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric || op == DragOperationMove);
+    ASSERT_ARG(op, op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric || op == DragOperationMove || op == (DragOperation)(DragOperationGeneric | DragOperationMove));
     m_dropEffect = IEOpFromDragOp(op);
 }
 
diff --git a/WebCore/dom/Clipboard.h b/WebCore/dom/Clipboard.h
index 2f4dc6f..4018e4f 100644
--- a/WebCore/dom/Clipboard.h
+++ b/WebCore/dom/Clipboard.h
@@ -43,8 +43,9 @@
         // Is this operation a drag-drop or a copy-paste?
         bool isForDragging() const { return m_forDragging; }
 
-        String dropEffect() const { return m_dropEffect; }
+        String dropEffect() const { return dropEffectIsUninitialized() ? "none" : m_dropEffect; }
         void setDropEffect(const String&);
+        bool dropEffectIsUninitialized() const { return m_dropEffect == "uninitialized"; }
         String effectAllowed() const { return m_effectAllowed; }
         void setEffectAllowed(const String&);
     
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 39cd3b4..f42b9cf 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -40,18 +40,32 @@
 #include "RootInlineBox.h"
 #include "loader.h"
 #include <wtf/CurrentTime.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
+static void notifyChildInserted(Node*);
 static void dispatchChildInsertionEvents(Node*);
 static void dispatchChildRemovalEvents(Node*);
 
 typedef Vector<std::pair<NodeCallback, RefPtr<Node> > > NodeCallbackQueue;
+typedef Vector<RefPtr<Node>, 1> NodeVector;
 static NodeCallbackQueue* s_postAttachCallbackQueue;
 
 static size_t s_attachDepth;
 static bool s_shouldReEnableMemoryCacheCallsAfterAttach;
 
+static void collectTargetNodes(Node* node, NodeVector& nodes)
+{
+    if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
+        nodes.append(node);
+        return;
+    }
+
+    for (Node* child = node->firstChild(); child; child = child->nextSibling())
+        nodes.append(child);
+}
+
 void ContainerNode::removeAllChildren()
 {
     removeAllChildrenInContainer<Node, ContainerNode>(this);
@@ -85,11 +99,9 @@
         return false;
     }
 
-    bool isFragment = newChild->nodeType() == DOCUMENT_FRAGMENT_NODE;
-
-    // If newChild is a DocumentFragment with no children; there's nothing to do.
-    // Just return true
-    if (isFragment && !newChild->firstChild())
+    NodeVector targets;
+    collectTargetNodes(newChild.get(), targets);
+    if (targets.isEmpty())
         return true;
 
     // Now actually add the child(ren)
@@ -98,16 +110,14 @@
 
     RefPtr<Node> next = refChild;
     RefPtr<Node> refChildPreviousSibling = refChild->previousSibling();
-
-    RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
-    while (child) {
-        RefPtr<Node> nextChild = isFragment ? child->nextSibling() : 0;
+    for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); ++it) {
+        Node* child = it->get();
 
         // If child is already present in the tree, first remove it from the old location.
         if (Node* oldParent = child->parentNode())
-            oldParent->removeChild(child.get(), ec);
+            oldParent->removeChild(child, ec);
         if (ec)
-            return 0;
+            return false;
 
         // FIXME: After sending the mutation events, "this" could be destroyed.
         // We can prevent that by doing a "ref", but first we have to make sure
@@ -130,23 +140,23 @@
         forbidEventDispatch();
         Node* prev = next->previousSibling();
         ASSERT(m_lastChild != prev);
-        next->setPreviousSibling(child.get());
+        next->setPreviousSibling(child);
         if (prev) {
             ASSERT(m_firstChild != next);
             ASSERT(prev->nextSibling() == next);
-            prev->setNextSibling(child.get());
+            prev->setNextSibling(child);
         } else {
             ASSERT(m_firstChild == next);
-            m_firstChild = child.get();
+            m_firstChild = child;
         }
         child->setParent(this);
         child->setPreviousSibling(prev);
         child->setNextSibling(next.get());
         allowEventDispatch();
 
-        // Dispatch the mutation events.
+        // Send notification about the children change.
         childrenChanged(false, refChildPreviousSibling.get(), next.get(), 1);
-        dispatchChildInsertionEvents(child.get());
+        notifyChildInserted(child);
                 
         // Add child to the rendering tree.
         if (attached() && !child->attached() && child->parent() == this) {
@@ -156,7 +166,9 @@
                 child->attach();
         }
 
-        child = nextChild.release();
+        // Now that the child is attached to the render tree, dispatch
+        // the relevant mutation events.
+        dispatchChildInsertionEvents(child);
     }
 
     dispatchSubtreeModifiedEvent();
@@ -256,8 +268,7 @@
         child->setNextSibling(next);
         allowEventDispatch();
 
-        // Dispatch the mutation events
-        dispatchChildInsertionEvents(child.get());
+        notifyChildInserted(child.get());
                 
         // Add child to the rendering tree
         if (attached() && !child->attached() && child->parent() == this) {
@@ -267,6 +278,10 @@
                 child->attach();
         }
 
+        // Now that the child is attached to the render tree, dispatch
+        // the relevant mutation events.
+        dispatchChildInsertionEvents(child.get());
+
         prev = child;
         child = nextChild.release();
     }
@@ -332,7 +347,14 @@
     }
 
     document()->removeFocusedNodeOfSubtree(child.get());
-    
+
+    // Events fired when blurring currently focused node might have moved this
+    // child into a different parent.
+    if (child->parentNode() != this) {
+        ec = NOT_FOUND_ERR;
+        return false;
+    }
+
     // FIXME: After sending the mutation events, "this" could be destroyed.
     // We can prevent that by doing a "ref", but first we have to make sure
     // that no callers call with ref count == 0 and parent = 0 (as of this
@@ -396,33 +418,43 @@
     document()->removeFocusedNodeOfSubtree(this, true);
 
     forbidEventDispatch();
-    int childCountDelta = 0;
+    Vector<RefPtr<Node> > removedChildren;
     while (RefPtr<Node> n = m_firstChild) {
-        childCountDelta--;
-
         Node* next = n->nextSibling();
         
-        // Remove the node from the tree before calling detach or removedFromDocument (4427024, 4129744)
+        // Remove the node from the tree before calling detach or removedFromDocument (4427024, 4129744).
+        // removeChild() does this after calling detach(). There is no explanation for
+        // this discrepancy between removeChild() and its optimized version removeChildren().
         n->setPreviousSibling(0);
         n->setNextSibling(0);
         n->setParent(0);
-        
+
         m_firstChild = next;
         if (n == m_lastChild)
             m_lastChild = 0;
 
         if (n->attached())
             n->detach();
-        
-        if (n->inDocument())
-            n->removedFromDocument();
+
+        removedChildren.append(n.release());
     }
     allowEventDispatch();
 
+    size_t removedChildrenCount = removedChildren.size();
+
     // Dispatch a single post-removal mutation event denoting a modified subtree.
-    childrenChanged(false, 0, 0, childCountDelta);
+    childrenChanged(false, 0, 0, -static_cast<int>(removedChildrenCount));
     dispatchSubtreeModifiedEvent();
 
+    for (size_t i = 0; i < removedChildrenCount; ++i) {
+        Node* removedChild = removedChildren[i].get();
+        if (removedChild->inDocument())
+            removedChild->removedFromDocument();
+        // removeChild() calls removedFromTree(true) if the child was not in the
+        // document. There is no explanation for this discrepancy between removeChild()
+        // and its optimized version removeChildren().
+    }
+
     return true;
 }
 
@@ -437,31 +469,26 @@
     // Make sure adding the new child is ok
     checkAddChild(newChild.get(), ec);
     if (ec)
-        return 0;
-    
+        return false;
+
     if (newChild == m_lastChild) // nothing to do
         return newChild;
 
-    bool isFragment = newChild->nodeType() == DOCUMENT_FRAGMENT_NODE;
-
-    // If newChild is a DocumentFragment with no children.... there's nothing to do.
-    // Just return the document fragment
-    if (isFragment && !newChild->firstChild())
+    NodeVector targets;
+    collectTargetNodes(newChild.get(), targets);
+    if (targets.isEmpty())
         return true;
 
     // Now actually add the child(ren)
     RefPtr<Node> prev = lastChild();
-    RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
-    while (child) {
-        // For a fragment we have more children to do.
-        RefPtr<Node> nextChild = isFragment ? child->nextSibling() : 0;
-
+    for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); ++it) {
+        Node* child = it->get();
         // If child is already present in the tree, first remove it
         if (Node* oldParent = child->parentNode()) {
-            oldParent->removeChild(child.get(), ec);
+            oldParent->removeChild(child, ec);
             if (ec)
-                return 0;
-            
+                return false;
+
             // If the child has a parent again, just stop what we're doing, because
             // that means someone is doing something with DOM mutation -- can't re-parent
             // a child that already has a parent.
@@ -474,15 +501,15 @@
         child->setParent(this);
         if (m_lastChild) {
             child->setPreviousSibling(m_lastChild);
-            m_lastChild->setNextSibling(child.get());
+            m_lastChild->setNextSibling(child);
         } else
-            m_firstChild = child.get();
-        m_lastChild = child.get();
+            m_firstChild = child;
+        m_lastChild = child;
         allowEventDispatch();
 
-        // Dispatch the mutation events
+        // Send notification about the children change.
         childrenChanged(false, prev.get(), 0, 1);
-        dispatchChildInsertionEvents(child.get());
+        notifyChildInserted(child);
 
         // Add child to the rendering tree
         if (attached() && !child->attached() && child->parent() == this) {
@@ -491,8 +518,10 @@
             else
                 child->attach();
         }
-        
-        child = nextChild.release();
+
+        // Now that the child is attached to the render tree, dispatch
+        // the relevant mutation events.
+        dispatchChildInsertionEvents(child);
     }
 
     dispatchSubtreeModifiedEvent();
@@ -866,7 +895,7 @@
     return n;
 }
 
-static void dispatchChildInsertionEvents(Node* child)
+static void notifyChildInserted(Node* child)
 {
     ASSERT(!eventDispatchForbidden());
 
@@ -886,6 +915,14 @@
         c->insertedIntoTree(true);
 
     document->incDOMTreeVersion();
+}
+
+static void dispatchChildInsertionEvents(Node* child)
+{
+    ASSERT(!eventDispatchForbidden());
+
+    RefPtr<Node> c = child;
+    RefPtr<Document> document = child->document();
 
     if (c->parentNode() && document->hasListenerType(Document::DOMNODEINSERTED_LISTENER))
         c->dispatchEvent(MutationEvent::create(eventNames().DOMNodeInsertedEvent, true, c->parentNode()));
diff --git a/WebCore/dom/CustomEvent.cpp b/WebCore/dom/CustomEvent.cpp
new file mode 100644
index 0000000..c377063
--- /dev/null
+++ b/WebCore/dom/CustomEvent.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 COMPUTER, 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 "CustomEvent.h"
+
+#include "EventNames.h"
+
+namespace WebCore {
+
+CustomEvent::CustomEvent()
+{
+}
+
+void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue detail)
+{
+    if (dispatched())
+        return;
+
+    initEvent(type, canBubble, cancelable);
+
+    m_detail = detail;
+}
+
+bool CustomEvent::isCustomEvent() const
+{
+    return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/CustomEvent.h b/WebCore/dom/CustomEvent.h
new file mode 100644
index 0000000..d910767
--- /dev/null
+++ b/WebCore/dom/CustomEvent.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 COMPUTER, 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 CustomEvent_h
+#define CustomEvent_h
+
+#include "AtomicString.h"
+#include "Event.h"
+#include "ScriptValue.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class CustomEvent : public Event {
+public:
+    static PassRefPtr<CustomEvent> create()
+    {
+        return adoptRef(new CustomEvent);
+    }
+
+    void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue detail);
+
+    virtual bool isCustomEvent() const;
+
+    ScriptValue detail() const { return m_detail; }
+
+private:
+    CustomEvent();
+
+    ScriptValue m_detail;
+};
+
+} // namespace WebCore
+
+#endif // CustomEvent_h
diff --git a/WebCore/dom/CustomEvent.idl b/WebCore/dom/CustomEvent.idl
new file mode 100644
index 0000000..1ab468c
--- /dev/null
+++ b/WebCore/dom/CustomEvent.idl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 COMPUTER, 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. 
+ */
+
+module events {
+
+    // Introduced in DOM Level 3:
+    interface CustomEvent : Event {
+
+       readonly attribute DOMObject detail;
+
+       void initCustomEvent(in DOMString typeArg, 
+                            in boolean canBubbleArg, 
+                            in boolean cancelableArg, 
+                            in DOMObject detailArg);
+    };
+
+}
diff --git a/WebCore/dom/DOMCoreException.idl b/WebCore/dom/DOMCoreException.idl
index 9baea1b..2cbc589 100644
--- a/WebCore/dom/DOMCoreException.idl
+++ b/WebCore/dom/DOMCoreException.idl
@@ -28,7 +28,9 @@
 
 module core {
 
-    interface DOMCoreException {
+    interface [
+        NoStaticTables
+    ] DOMCoreException {
 
         readonly attribute unsigned short   code;
         readonly attribute DOMString        name;
diff --git a/WebCore/dom/DOMImplementation.cpp b/WebCore/dom/DOMImplementation.cpp
index f7c8242..4b7a743 100644
--- a/WebCore/dom/DOMImplementation.cpp
+++ b/WebCore/dom/DOMImplementation.cpp
@@ -31,6 +31,7 @@
 #include "Element.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "FrameLoaderClient.h"
 #include "FTPDirectoryDocument.h"
 #include "HTMLDocument.h"
 #include "HTMLNames.h"
@@ -272,16 +273,6 @@
     return sheet.release();
 }
 
-PassRefPtr<Document> DOMImplementation::createDocument(Frame* frame)
-{
-    return Document::create(frame);
-}
-
-PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(Frame* frame)
-{
-    return HTMLDocument::create(frame);
-}
-
 bool DOMImplementation::isXMLMIMEType(const String& mimeType)
 {
     if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "text/xsl")
@@ -293,9 +284,10 @@
 
 bool DOMImplementation::isTextMIMEType(const String& mimeType)
 {
-    if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) ||
-        (mimeType.startsWith("text/") && mimeType != "text/html" &&
-         mimeType != "text/xml" && mimeType != "text/xsl"))
+    if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType)
+        || mimeType == "application/json" // Render JSON as text/plain.
+        || (mimeType.startsWith("text/") && mimeType != "text/html"
+            && mimeType != "text/xml" && mimeType != "text/xsl"))
         return true;
 
     return false;
@@ -337,7 +329,7 @@
 #endif
 
     PluginData* pluginData = 0;
-    if (frame && frame->page() && frame->page()->settings()->arePluginsEnabled())
+    if (frame && frame->page() && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         pluginData = frame->page()->pluginData();
 
     // PDF is one image type for which a plugin can override built-in support.
diff --git a/WebCore/dom/DOMImplementation.h b/WebCore/dom/DOMImplementation.h
index 9e6f9a9..b776d22 100644
--- a/WebCore/dom/DOMImplementation.h
+++ b/WebCore/dom/DOMImplementation.h
@@ -57,8 +57,6 @@
 
     // Other methods (not part of DOM)
     static PassRefPtr<Document> createDocument(const String& MIMEType, Frame*, bool inViewSourceMode);
-    static PassRefPtr<Document> createDocument(Frame*);
-    static PassRefPtr<HTMLDocument> createHTMLDocument(Frame*);
 
     static bool isXMLMIMEType(const String& MIMEType);
     static bool isTextMIMEType(const String& MIMEType);
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index ae23960..5422d02 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -34,13 +34,13 @@
 #include "CSSStyleSelector.h"
 #include "CSSStyleSheet.h"
 #include "CSSValueKeywords.h"
-#include "CString.h"
 #include "CachedCSSStyleSheet.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "Comment.h"
 #include "Console.h"
 #include "CookieJar.h"
+#include "CustomEvent.h"
 #include "DOMImplementation.h"
 #include "DOMWindow.h"
 #include "DocLoader.h"
@@ -126,6 +126,7 @@
 #include "TreeWalker.h"
 #include "UIEvent.h"
 #include "UserContentURLPattern.h"
+#include "ViewportArguments.h"
 #include "WebKitAnimationEvent.h"
 #include "WebKitTransitionEvent.h"
 #include "WheelEvent.h"
@@ -408,7 +409,7 @@
     , m_normalWorldWrapperCache(0)
 #endif
     , m_usingGeolocation(false)
-    , m_storageEventTimer(this, &Document::storageEventTimerFired)
+    , m_pendingEventTimer(this, &Document::pendingEventTimerFired)
 #if ENABLE(WML)
     , m_containsWMLContent(false)
 #endif
@@ -448,6 +449,7 @@
     m_usesFirstLetterRules = false;
     m_usesBeforeAfterRules = false;
     m_usesRemUnits = false;
+    m_usesLinkRules = false;
 
     m_gotoAnchorNeededAfterStylesheetsLoad = false;
  
@@ -471,7 +473,7 @@
     static int docID = 0;
     m_docID = docID++;
 #if ENABLE(XHTMLMP)
-    m_shouldProcessNoScriptElement = settings() && !settings()->isJavaScriptEnabled();
+    m_shouldProcessNoScriptElement = m_frame->script()->canExecuteScripts(NotAboutToExecuteScript);
 #endif
 }
 
@@ -533,7 +535,7 @@
     removeAllEventListeners();
 
 #if USE(JSC)
-    forgetAllDOMNodesForDocument(this);
+    destroyAllWrapperCaches();
 #endif
 
     m_tokenizer.clear();
@@ -565,15 +567,30 @@
 #if USE(JSC)
 Document::JSWrapperCache* Document::createWrapperCache(DOMWrapperWorld* world)
 {
-    JSWrapperCache* wrapperCache = new JSWrapperCache();
+    JSWrapperCache* wrapperCache = new JSWrapperCache;
     m_wrapperCacheMap.set(world, wrapperCache);
     if (world->isNormal()) {
         ASSERT(!m_normalWorldWrapperCache);
         m_normalWorldWrapperCache = wrapperCache;
     }
-    world->rememberDocument(this);
+    world->didCreateWrapperCache(this);
     return wrapperCache;
 }
+
+void Document::destroyWrapperCache(DOMWrapperWorld* world)
+{
+    Document::JSWrapperCache* wrappers = wrapperCacheMap().take(world);
+    ASSERT(wrappers);
+    delete wrappers;
+    world->didDestroyWrapperCache(this);
+}
+
+void Document::destroyAllWrapperCaches()
+{
+    JSWrapperCacheMap& wrapperCacheMap = this->wrapperCacheMap();
+    while (!wrapperCacheMap.isEmpty())
+        destroyWrapperCache(wrapperCacheMap.begin()->first);
+}
 #endif
 
 void Document::resetLinkColor()
@@ -1227,7 +1244,7 @@
     m_rawTitle = title;
     updateTitle();
 
-    if (m_titleSetExplicitly && m_titleElement && m_titleElement->hasTagName(titleTag))
+    if (m_titleSetExplicitly && m_titleElement && m_titleElement->hasTagName(titleTag) && !titleElement)
         static_cast<HTMLTitleElement*>(m_titleElement.get())->setText(m_title);
 }
 
@@ -1799,7 +1816,7 @@
     if (frame) {
         // This code calls implicitClose() if all loading has completed.
         FrameLoader* frameLoader = frame->loader();
-        frameLoader->endIfNotLoadingMainResource();
+        frameLoader->writer()->endIfNotLoadingMainResource();
         frameLoader->checkCompleted();
     } else {
         // Because we have no frame, we don't know if all loading has completed,
@@ -1866,9 +1883,9 @@
     ImageLoader::dispatchPendingBeforeLoadEvents();
     ImageLoader::dispatchPendingLoadEvents();
     dispatchWindowLoadEvent();
-    dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, false), this);
+    enqueuePageshowEvent(PageshowEventNotPersisted);
     if (m_pendingStateObject)
-        dispatchWindowEvent(PopStateEvent::create(m_pendingStateObject.release()));
+        enqueuePopstateEvent(m_pendingStateObject.release());
     
     if (f)
         f->loader()->handledOnloadEvents();
@@ -2386,6 +2403,78 @@
     }
 }
 
+// Though isspace() considers \t and \v to be whitespace, Win IE doesn't.
+static bool isSeparator(UChar c)
+{
+    return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ',' || c == '\0';
+}
+
+void Document::processArguments(const String& features, void* data, ArgumentsCallback callback)
+{
+    // Tread lightly in this code -- it was specifically designed to mimic Win IE's parsing behavior.
+    int keyBegin, keyEnd;
+    int valueBegin, valueEnd;
+
+    int i = 0;
+    int length = features.length();
+    String buffer = features.lower();
+    while (i < length) {
+        // skip to first non-separator, but don't skip past the end of the string
+        while (isSeparator(buffer[i])) {
+            if (i >= length)
+                break;
+            i++;
+        }
+        keyBegin = i;
+
+        // skip to first separator
+        while (!isSeparator(buffer[i]))
+            i++;
+        keyEnd = i;
+
+        // skip to first '=', but don't skip past a ',' or the end of the string
+        while (buffer[i] != '=') {
+            if (buffer[i] == ',' || i >= length)
+                break;
+            i++;
+        }
+
+        // skip to first non-separator, but don't skip past a ',' or the end of the string
+        while (isSeparator(buffer[i])) {
+            if (buffer[i] == ',' || i >= length)
+                break;
+            i++;
+        }
+        valueBegin = i;
+
+        // skip to first separator
+        while (!isSeparator(buffer[i]))
+            i++;
+        valueEnd = i;
+
+        ASSERT(i <= length);
+
+        String keyString = buffer.substring(keyBegin, keyEnd - keyBegin);
+        String valueString = buffer.substring(valueBegin, valueEnd - valueBegin);
+        callback(keyString, valueString, this, data);
+    }
+}
+
+void Document::processViewport(const String& features)
+{
+    ASSERT(!features.isNull());
+
+    Frame* frame = this->frame();
+    if (!frame)
+        return;
+
+    ViewportArguments arguments;
+    processArguments(features, (void*)&arguments, &setViewportFeature);
+
+    if (frame->page())
+        frame->page()->chrome()->client()->didReceiveViewportArguments(frame, arguments);
+}
+
 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const IntPoint& documentPoint, const PlatformMouseEvent& event)
 {
     ASSERT(!renderer() || renderer()->isRenderView());
@@ -2587,7 +2676,13 @@
 #endif
 
     recalcStyleSelector();
+    // This recalcStyle initiates a new recalc cycle. We need to bracket it to
+    // make sure animations get the correct update time
+    if (m_frame)
+        m_frame->animation()->beginAnimationUpdate();
     recalcStyle(Force);
+    if (m_frame)
+        m_frame->animation()->endAnimationUpdate();
 
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!ownerElement())
@@ -2865,7 +2960,9 @@
             focusChangeBlocked = true;
             newFocusedNode = 0;
         }
-        oldFocusedNode->dispatchUIEvent(eventNames().DOMFocusOutEvent, 0, 0);
+        
+        oldFocusedNode->dispatchUIEvent(eventNames().focusoutEvent, 0, 0); // DOM level 3 name for the bubbling blur event.
+
         if (m_focusedNode) {
             // handler shifted focus
             focusChangeBlocked = true;
@@ -2895,7 +2992,9 @@
             focusChangeBlocked = true;
             goto SetFocusedNodeDone;
         }
-        m_focusedNode->dispatchUIEvent(eventNames().DOMFocusInEvent, 0, 0);
+
+        m_focusedNode->dispatchUIEvent(eventNames().focusinEvent, 0, 0); // DOM level 3 bubbling focus event.
+
         if (m_focusedNode != newFocusedNode) { 
             // handler shifted focus
             focusChangeBlocked = true;
@@ -3098,22 +3197,22 @@
     domWindow->dispatchLoadEvent();
 }
 
-void Document::enqueueStorageEvent(PassRefPtr<Event> storageEvent)
+void Document::enqueueEvent(PassRefPtr<Event> event)
 {
-    m_storageEventQueue.append(storageEvent);
-    if (!m_storageEventTimer.isActive())
-        m_storageEventTimer.startOneShot(0);
+    m_pendingEventQueue.append(event);
+    if (!m_pendingEventTimer.isActive())
+        m_pendingEventTimer.startOneShot(0);
 }
 
-void Document::storageEventTimerFired(Timer<Document>*)
+void Document::pendingEventTimerFired(Timer<Document>*)
 {
-    ASSERT(!m_storageEventTimer.isActive());
-    Vector<RefPtr<Event> > storageEventQueue;
-    storageEventQueue.swap(m_storageEventQueue);
+    ASSERT(!m_pendingEventTimer.isActive());
+    Vector<RefPtr<Event> > eventQueue;
+    eventQueue.swap(m_pendingEventQueue);
 
     typedef Vector<RefPtr<Event> >::const_iterator Iterator;
-    Iterator end = storageEventQueue.end();
-    for (Iterator it = storageEventQueue.begin(); it != end; ++it)
+    Iterator end = eventQueue.end();
+    for (Iterator it = eventQueue.begin(); it != end; ++it)
         dispatchWindowEvent(*it);
 }
 
@@ -3122,6 +3221,8 @@
     RefPtr<Event> event;
     if (eventType == "Event" || eventType == "Events" || eventType == "HTMLEvents")
         event = Event::create();
+    else if (eventType == "CustomEvent")
+        event = CustomEvent::create();
     else if (eventType == "KeyboardEvent" || eventType == "KeyboardEvents")
         event = KeyboardEvent::create();
     else if (eventType == "MessageEvent")
@@ -3160,10 +3261,9 @@
     else if (eventType == "TouchEvent")
         event = TouchEvent::create();
 #endif
-    if (event) {
-        event->setCreatedByDOM(true);
+    if (event)
         return event.release();
-    }
+
     ec = NOT_SUPPORTED_ERR;
     return 0;
 }
@@ -4289,7 +4389,17 @@
 {
     setParsing(false);
     dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, true, false));
+
     if (Frame* f = frame()) {
+        // FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
+        // resource loads are complete. HTMLObjectElements can start loading their resources from
+        // post attach callbacks triggered by recalcStyle().  This means if we parse out an <object>
+        // tag and then reach the end of the document without updating styles, we might not have yet
+        // started the resource load and might fire the window load event too early.  To avoid this
+        // we force the styles to be up to date before calling FrameLoader::finishedParsing().
+        // See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around comment 35.
+        updateStyleIfNeeded();
+
         f->loader()->finishedParsing();
 
 #if ENABLE(INSPECTOR)
@@ -4309,13 +4419,15 @@
     typedef ListHashSet<Element*>::const_iterator Iterator;
     Iterator end = m_formElementsWithState.end();
     for (Iterator it = m_formElementsWithState.begin(); it != end; ++it) {
-        Element* e = *it;
+        Element* elementWithState = *it;
         String value;
-        if (e->saveFormControlState(value)) {
-            stateVector.append(e->formControlName().string());
-            stateVector.append(e->formControlType().string());
-            stateVector.append(value);
-        }
+        if (!elementWithState->shouldSaveAndRestoreFormControlState())
+            continue;
+        if (!elementWithState->saveFormControlState(value))
+            continue;
+        stateVector.append(elementWithState->formControlName().string());
+        stateVector.append(elementWithState->formControlType().string());
+        stateVector.append(value);
     }
     return stateVector;
 }
@@ -4485,7 +4597,7 @@
         return;
         
     m_useSecureKeyboardEntryWhenActive = usesSecureKeyboard;
-    m_frame->updateSecureKeyboardEntryIfActive();
+    m_frame->selection()->updateSecureKeyboardEntryIfActive();
 }
 
 bool Document::useSecureKeyboardEntryWhenActive() const
@@ -4536,7 +4648,7 @@
         } else if (!settings->allowFileAccessFromFileURLs() && securityOrigin()->isLocal()) {
           // Some clients want file:// URLs to have even tighter restrictions by
           // default, and not be able to access other local files.
-          securityOrigin()->makeUnique();
+          securityOrigin()->enforceFilePathSeparation();
         }
     }
 
@@ -4606,7 +4718,7 @@
         return;
     
     if (f->loader()->isComplete())
-        dispatchWindowEvent(PopStateEvent::create(stateObject));
+        enqueuePopstateEvent(stateObject);
     else
         m_pendingStateObject = stateObject;
 }
@@ -4745,70 +4857,15 @@
 
 void Document::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
 {
+    addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
+}
+
+void Document::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+{
     if (DOMWindow* window = domWindow())
-        window->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, errorMessage, lineNumber, sourceURL);
+        window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
-void Document::addMessage(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
-{
-    switch (destination) {
-#if ENABLE(INSPECTOR)
-    case InspectorControllerDestination:
-        if (page())
-            page()->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
-        return;
-#endif
-    case ConsoleDestination:
-        if (DOMWindow* window = domWindow())
-            window->console()->addMessage(source, type, level, message, lineNumber, sourceURL);
-        return;
-    }
-    ASSERT_NOT_REACHED();
-}
-
-void Document::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
-{
-#if ENABLE(INSPECTOR)
-    if (page())
-        page()->inspectorController()->resourceRetrievedByXMLHttpRequest(identifier, sourceString);
-#endif
-    Frame* frame = this->frame();
-    if (frame) {
-        FrameLoader* frameLoader = frame->loader();
-        frameLoader->notifier()->didLoadResourceByXMLHttpRequest(identifier, sourceString);
-    }
-}
-
-void Document::scriptImported(unsigned long identifier, const String& sourceString)
-{
-#if ENABLE(INSPECTOR)
-    if (page())
-        page()->inspectorController()->scriptImported(identifier, sourceString);
-#else
-    UNUSED_PARAM(identifier);
-    UNUSED_PARAM(sourceString);
-#endif
-}
-
-class ScriptExecutionContextTaskTimer : public TimerBase {
-public:
-    ScriptExecutionContextTaskTimer(PassRefPtr<Document> context, PassOwnPtr<ScriptExecutionContext::Task> task)
-        : m_context(context)
-        , m_task(task)
-    {
-    }
-
-private:
-    virtual void fired()
-    {
-        m_task->performTask(m_context.get());
-        delete this;
-    }
-
-    RefPtr<Document> m_context;
-    OwnPtr<ScriptExecutionContext::Task> m_task;
-};
-
 struct PerformTaskContext : Noncopyable {
     PerformTaskContext(PassRefPtr<DocumentWeakReference> documentReference, PassOwnPtr<ScriptExecutionContext::Task> task)
         : documentReference(documentReference)
@@ -4835,12 +4892,7 @@
 
 void Document::postTask(PassOwnPtr<Task> task)
 {
-    if (isMainThread()) {
-        ScriptExecutionContextTaskTimer* timer = new ScriptExecutionContextTaskTimer(static_cast<Document*>(this), task);
-        timer->startOneShot(0);
-    } else {
-        callOnMainThread(performTask, new PerformTaskContext(m_weakReference, task));
-    }
+    callOnMainThread(performTask, new PerformTaskContext(m_weakReference, task));
 }
 
 Element* Document::findAnchor(const String& name)
@@ -4886,6 +4938,26 @@
         m_decoder->encoding().displayBuffer(buffer, len);
 }
 
+void Document::enqueuePageshowEvent(PageshowEventPersistence persisted)
+{
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36334 Pageshow event needs to fire asynchronously.
+    dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, persisted), this);
+}
+
+void Document::enqueueHashchangeEvent(const String& /*oldURL*/, const String& /*newURL*/)
+{
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36201 Hashchange event needs to fire asynchronously.
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36335 Hashchange event is now its own interface and takes two
+    //   URL arguments which we need to pass in here.
+    dispatchWindowEvent(Event::create(eventNames().hashchangeEvent, false, false));
+}
+
+void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)
+{
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36202 Popstate event needs to fire asynchronously
+    dispatchWindowEvent(PopStateEvent::create(stateObject));
+}
+
 #if ENABLE(XHTMLMP)
 bool Document::isXHTMLMPDocument() const
 {
@@ -4893,8 +4965,9 @@
         return false;
     // As per section 7.2 of OMA-WAP-XHTMLMP-V1_1-20061020-A.pdf, a conforming user agent
     // MUST accept XHTMLMP document identified as "application/vnd.wap.xhtml+xml"
-    // and SHOULD accept it identified as "application/xhtml+xml"
-    return frame()->loader()->responseMIMEType() == "application/vnd.wap.xhtml+xml" || frame()->loader()->responseMIMEType() == "application/xhtml+xml";
+    // and SHOULD accept it identified as "application/xhtml+xml" , "application/xhtml+xml" is a 
+    // general MIME type for all XHTML documents, not only for XHTMLMP
+    return frame()->loader()->responseMIMEType() == "application/vnd.wap.xhtml+xml";
 }
 #endif
 
@@ -4903,6 +4976,11 @@
 {
     return page() ? page()->inspectorTimelineAgent() : 0;
 }
+
+InspectorController* Document::inspectorController() const 
+{
+    return page() ? page()->inspectorController() : 0;
+}
 #endif
 
 } // namespace WebCore
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 3ddcaab..98d5764 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -175,6 +175,11 @@
     static bool isDeletedValue(const FormElementKey& value) { return value.isHashTableDeletedValue(); }
 };
 
+enum PageshowEventPersistence {
+    PageshowEventNotPersisted = 0,
+    PageshowEventPersisted = 1
+};
+    
 class Document : public ContainerNode, public ScriptExecutionContext {
 public:
     static PassRefPtr<Document> create(Frame* frame)
@@ -435,6 +440,8 @@
     void setUsesBeforeAfterRules(bool b) { m_usesBeforeAfterRules = b; }
     bool usesRemUnits() const { return m_usesRemUnits; }
     void setUsesRemUnits(bool b) { m_usesRemUnits = b; }
+    bool usesLinkRules() const { return linkColor() != visitedLinkColor() || m_usesLinkRules; }
+    void setUsesLinkRules(bool b) { m_usesLinkRules = b; }
 
     // Machinery for saving and restoring state when you leave and then go back to a page.
     void registerFormElementWithState(Element* e) { m_formElementsWithState.add(e); }
@@ -450,6 +457,7 @@
     Settings* settings() const; // can be NULL
 #if ENABLE(INSPECTOR)
     InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
+    virtual InspectorController* inspectorController() const; // can be NULL
 #endif
 
     PassRefPtr<Range> createRange();
@@ -626,9 +634,6 @@
     void dispatchWindowEvent(PassRefPtr<Event>, PassRefPtr<EventTarget> = 0);
     void dispatchWindowLoadEvent();
 
-    void enqueueStorageEvent(PassRefPtr<Event>);
-    void storageEventTimerFired(Timer<Document>*);
-
     PassRefPtr<Event> createEvent(const String& eventType, ExceptionCode&);
 
     // keep track of what types of event listeners are registered, so we don't
@@ -695,6 +700,7 @@
      * @param content The header value (value of the meta tag's "content" attribute)
      */
     void processHttpEquiv(const String& equiv, const String& content);
+<<<<<<< HEAD
     
 #ifdef ANDROID_META_SUPPORT
     /**
@@ -703,6 +709,9 @@
      */
     void processMetadataSettings(const String& content);
 #endif
+=======
+    void processViewport(const String& features);
+>>>>>>> webkit.org at r58033
 
     // Returns the owning element in the parent document.
     // Returns 0 if this is the top level document.
@@ -722,8 +731,28 @@
 
     String lastModified() const;
 
+    // The cookieURL is used to query the cookie database for this document's
+    // cookies. For example, if the cookie URL is http://example.com, we'll
+    // use the non-Secure cookies for example.com when computing
+    // document.cookie.
+    //
+    // Q: How is the cookieURL different from the document's URL?
+    // A: The two URLs are the same almost all the time.  However, if one
+    //    document inherits the security context of another document, it
+    //    inherits its cookieURL but not its URL.
+    //
     const KURL& cookieURL() const { return m_cookieURL; }
 
+    // The firstPartyForCookies is used to compute whether this document
+    // appears in a "third-party" context for the purpose of third-party
+    // cookie blocking.  The document is in a third-party context if the
+    // cookieURL and the firstPartyForCookies are from different hosts.
+    //
+    // Note: Some ports (including possibly Apple's) only consider the
+    //       document in a third-party context if the cookieURL and the
+    //       firstPartyForCookies have a different registry-controlled
+    //       domain.
+    //
     const KURL& firstPartyForCookies() const { return m_firstPartyForCookies; }
     void setFirstPartyForCookies(const KURL& url) { m_firstPartyForCookies = url; }
     
@@ -853,9 +882,7 @@
     void parseDNSPrefetchControlHeader(const String&);
 
     virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
-    virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
-    virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
-    virtual void scriptImported(unsigned long, const String&);
+    virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
     virtual void postTask(PassOwnPtr<Task>); // Executes the task on context's thread asynchronously.
 
 #if USE(JSC)
@@ -864,6 +891,8 @@
     JSWrapperCacheMap& wrapperCacheMap() { return m_wrapperCacheMap; }
     JSWrapperCache* getWrapperCache(DOMWrapperWorld* world);
     JSWrapperCache* createWrapperCache(DOMWrapperWorld*);
+    void destroyWrapperCache(DOMWrapperWorld*);
+    void destroyAllWrapperCaches();
 #endif
 
     virtual void finishedParsing();
@@ -947,6 +976,10 @@
     bool containsValidityStyleRules() const { return m_containsValidityStyleRules; }
     void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; }
 
+    void enqueueEvent(PassRefPtr<Event>);
+    void enqueuePageshowEvent(PageshowEventPersistence);
+    void enqueueHashchangeEvent(const String& oldURL, const String& newURL);
+
 protected:
     Document(Frame*, bool isXHTML, bool isHTML);
 
@@ -954,6 +987,10 @@
 
 
 private:
+
+    typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data);
+    void processArguments(const String& features, void* data, ArgumentsCallback);
+
     virtual bool isDocument() const { return true; }
     virtual void removedLastRef();
     virtual void determineParseMode() { }
@@ -986,6 +1023,9 @@
 
     void createStyleSelector();
 
+    void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject);
+    void pendingEventTimerFired(Timer<Document>*);
+
     OwnPtr<CSSStyleSelector> m_styleSelector;
     bool m_didCalculateStyleSelector;
 
@@ -1082,6 +1122,7 @@
     bool m_usesFirstLetterRules;
     bool m_usesBeforeAfterRules;
     bool m_usesRemUnits;
+    bool m_usesLinkRules;
     bool m_gotoAnchorNeededAfterStylesheetsLoad;
     bool m_isDNSPrefetchEnabled;
     bool m_haveExplicitlyDisabledDNSPrefetch;
@@ -1205,8 +1246,8 @@
 
     bool m_usingGeolocation;
 
-    Timer<Document> m_storageEventTimer;
-    Vector<RefPtr<Event> > m_storageEventQueue;
+    Timer<Document> m_pendingEventTimer;
+    Vector<RefPtr<Event> > m_pendingEventQueue;
 
 #if ENABLE(WML)
     bool m_containsWMLContent;
diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl
index 26ed7fd..88bd639 100644
--- a/WebCore/dom/Document.idl
+++ b/WebCore/dom/Document.idl
@@ -306,12 +306,10 @@
         attribute [DontEnum] EventListener onreset;
         attribute [DontEnum] EventListener onsearch;
         attribute [DontEnum] EventListener onselectstart;
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        attribute [DontEnum] EventListener ontouchstart;
-        attribute [DontEnum] EventListener ontouchmove;
-        attribute [DontEnum] EventListener ontouchend;
-        attribute [DontEnum] EventListener ontouchcancel;
-#endif
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchstart;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchmove;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchend;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchcancel;
 #endif
     };
 
diff --git a/WebCore/dom/DocumentType.cpp b/WebCore/dom/DocumentType.cpp
index b8185e7..9012b68 100644
--- a/WebCore/dom/DocumentType.cpp
+++ b/WebCore/dom/DocumentType.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "DocumentType.h"
 
-#include "DOMImplementation.h"
 #include "Document.h"
 #include "NamedNodeMap.h"
 
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 9e4b48d..3363e95 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -31,10 +31,10 @@
 #include "CSSParser.h"
 #include "CSSSelectorList.h"
 #include "CSSStyleSelector.h"
-#include "CString.h"
 #include "ClientRect.h"
 #include "ClientRectList.h"
 #include "Document.h"
+#include "DocumentFragment.h"
 #include "ElementRareData.h"
 #include "ExceptionCode.h"
 #include "FocusController.h"
@@ -42,6 +42,7 @@
 #include "FrameView.h"
 #include "HTMLElement.h"
 #include "HTMLNames.h"
+#include "HTMLTokenizer.h"
 #include "InspectorController.h"
 #include "NamedNodeMap.h"
 #include "NodeList.h"
@@ -51,6 +52,8 @@
 #include "RenderWidget.h"
 #include "TextIterator.h"
 #include "XMLNames.h"
+#include "XMLTokenizer.h"
+#include <wtf/text/CString.h>
 
 #if ENABLE(SVG)
 #include "SVGNames.h"
@@ -93,6 +96,51 @@
 {
     return new ElementRareData;
 }
+
+PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
+{
+    RefPtr<DocumentFragment> fragment = DocumentFragment::create(document());
+    
+    if (document()->isHTMLDocument())
+        parseHTMLDocumentFragment(markup, fragment.get(), scriptingPermission);
+    else {
+        if (!parseXMLDocumentFragment(markup, fragment.get(), this, scriptingPermission))
+            // FIXME: We should propagate a syntax error exception out here.
+            return 0;
+    }
+    
+    // Exceptions are ignored because none ought to happen here.
+    ExceptionCode ignoredExceptionCode;
+    
+    // We need to pop <html> and <body> elements and remove <head> to
+    // accommodate folks passing complete HTML documents to make the
+    // child of an element.
+    
+    RefPtr<Node> nextNode;
+    for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
+        nextNode = node->nextSibling();
+        if (node->hasTagName(htmlTag) || node->hasTagName(bodyTag)) {
+            Node* firstChild = node->firstChild();
+            if (firstChild)
+                nextNode = firstChild;
+            RefPtr<Node> nextChild;
+            for (RefPtr<Node> child = firstChild; child; child = nextChild) {
+                nextChild = child->nextSibling();
+                node->removeChild(child.get(), ignoredExceptionCode);
+                ASSERT(!ignoredExceptionCode);
+                fragment->insertBefore(child, node.get(), ignoredExceptionCode);
+                ASSERT(!ignoredExceptionCode);
+            }
+            fragment->removeChild(node.get(), ignoredExceptionCode);
+            ASSERT(!ignoredExceptionCode);
+        } else if (node->hasTagName(headTag)) {
+            fragment->removeChild(node.get(), ignoredExceptionCode);
+            ASSERT(!ignoredExceptionCode);
+        }
+    }
+    
+    return fragment.release();
+}
     
 PassRefPtr<Node> Element::cloneNode(bool deep)
 {
@@ -600,7 +648,8 @@
     } else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == altAttr || attrName == titleAttr) {
         // If the content of an element changes due to an attribute change, notify accessibility.
         document()->axObjectCache()->contentChanged(renderer());
-    }
+    } else if (attrName == aria_selectedAttr)
+        document()->axObjectCache()->selectedChildrenChanged(renderer());
 }
     
 void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
@@ -813,18 +862,25 @@
     if (!renderer() || !currentStyle)
         return false;
 
-    RenderStyle::PseudoStyleCache pseudoStyleCache;
-    currentStyle->getPseudoStyleCache(pseudoStyleCache);
-    size_t cacheSize = pseudoStyleCache.size();
+    const PseudoStyleCache* pseudoStyleCache = currentStyle->cachedPseudoStyles();
+    if (!pseudoStyleCache)
+        return false;
+
+    size_t cacheSize = pseudoStyleCache->size();
     for (size_t i = 0; i < cacheSize; ++i) {
         RefPtr<RenderStyle> newPseudoStyle;
-        PseudoId pseudoId = pseudoStyleCache[i]->styleType();
-        if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED)
+        PseudoId pseudoId = pseudoStyleCache->at(i)->styleType();
+        if (pseudoId == VISITED_LINK) {
+            newPseudoStyle =  newStyle->getCachedPseudoStyle(VISITED_LINK); // This pseudo-style was aggressively computed already when we first called styleForElement on the new style.
+            if (!newPseudoStyle || *newPseudoStyle != *pseudoStyleCache->at(i))
+                return true;
+        } else if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED)
             newPseudoStyle = renderer()->uncachedFirstLineStyle(newStyle);
         else
             newPseudoStyle = renderer()->getUncachedPseudoStyle(pseudoId, newStyle, newStyle);
-
-        if (*newPseudoStyle != *pseudoStyleCache[i]) {
+        if (!newPseudoStyle)
+            return true;
+        if (*newPseudoStyle != *pseudoStyleCache->at(i)) {
             if (pseudoId < FIRST_INTERNAL_PSEUDOID)
                 newStyle->setHasPseudoStyle(pseudoId);
             newStyle->addCachedPseudoStyle(newPseudoStyle);
@@ -1288,13 +1344,8 @@
             frame->selection()->setSelection(newSelection);
             frame->revealSelection();
         }
-    }
-    // FIXME: I'm not sure all devices will want this off, but this is
-    // currently turned off for Android.
-#if !ENABLE(DIRECTIONAL_PAD_NAVIGATION)
-    else if (renderer() && !renderer()->isWidget())
+    } else if (renderer() && !renderer()->isWidget())
         renderer()->enclosingLayer()->scrollRectToVisible(getRect());
-#endif
 }
 
 void Element::blur()
@@ -1347,10 +1398,13 @@
     ensureRareData()->m_minimumSizeForResizing = size;
 }
 
-RenderStyle* Element::computedStyle()
+RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
 {
+    // FIXME: Find and use the renderer from the pseudo element instead of the actual element so that the 'length'
+    // properties, which are only known by the renderer because it did the layout, will be correct and so that the
+    // values returned for the ":selection" pseudo-element will be correct.
     if (RenderStyle* usedStyle = renderStyle())
-        return usedStyle;
+        return pseudoElementSpecifier ? usedStyle->getCachedPseudoStyle(pseudoElementSpecifier) : usedStyle;
 
     if (!attached())
         // FIXME: Try to do better than this. Ensure that styleForElement() works for elements that are not in the
@@ -1360,7 +1414,7 @@
     ElementRareData* data = ensureRareData();
     if (!data->m_computedStyle)
         data->m_computedStyle = document()->styleForElementIgnoringPendingStylesheets(this);
-    return data->m_computedStyle.get();
+    return pseudoElementSpecifier ? data->m_computedStyle->getCachedPseudoStyle(pseudoElementSpecifier) : data->m_computedStyle.get();
 }
 
 void Element::cancelFocusAppearanceUpdate()
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index a5c4e96..eefaeb1 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -98,6 +98,8 @@
     DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel);
 #endif
 
+    virtual PassRefPtr<DocumentFragment> createContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
+
     const AtomicString& getIDAttribute() const;
     bool hasAttribute(const QualifiedName&) const;
     const AtomicString& getAttribute(const QualifiedName&) const;
@@ -199,7 +201,7 @@
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     virtual void recalcStyle(StyleChange = NoChange);
 
-    virtual RenderStyle* computedStyle();
+    RenderStyle* computedStyle(PseudoId = NOPSEUDO);
 
     void dispatchAttrRemovalEvent(Attribute*);
     void dispatchAttrAdditionEvent(Attribute*);
@@ -263,6 +265,7 @@
     virtual const AtomicString& formControlName() const { return nullAtom; }
     virtual const AtomicString& formControlType() const { return nullAtom; }
 
+    virtual bool shouldSaveAndRestoreFormControlState() const { return true; }
     virtual bool saveFormControlState(String&) const { return false; }
     virtual void restoreFormControlState(const String&) { }
 
@@ -309,6 +312,7 @@
     virtual const AtomicString& virtualPrefix() const { return prefix(); }
     virtual const AtomicString& virtualLocalName() const { return localName(); }
     virtual const AtomicString& virtualNamespaceURI() const { return namespaceURI(); }
+    virtual RenderStyle* virtualComputedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO) { return computedStyle(pseudoElementSpecifier); }
     
     // cloneNode is private so that non-virtual cloneElementWithChildren and cloneElementWithoutChildren
     // are used instead.
diff --git a/WebCore/dom/Element.idl b/WebCore/dom/Element.idl
index e565bc0..1368503 100644
--- a/WebCore/dom/Element.idl
+++ b/WebCore/dom/Element.idl
@@ -195,12 +195,10 @@
         attribute [DontEnum] EventListener onreset;
         attribute [DontEnum] EventListener onsearch;
         attribute [DontEnum] EventListener onselectstart;
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        attribute [DontEnum] EventListener ontouchstart;
-        attribute [DontEnum] EventListener ontouchmove;
-        attribute [DontEnum] EventListener ontouchend;
-        attribute [DontEnum] EventListener ontouchcancel;
-#endif
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchstart;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchmove;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchend;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchcancel;
 #endif
     };
 
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index b6abb2a..506d945 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -24,6 +24,7 @@
 #include "Event.h"
 
 #include "AtomicString.h"
+#include "UserGestureIndicator.h"
 #include <wtf/CurrentTime.h>
 
 namespace WebCore {
@@ -32,10 +33,10 @@
     : m_canBubble(false)
     , m_cancelable(false)
     , m_propagationStopped(false)
+    , m_immediatePropagationStopped(false)
     , m_defaultPrevented(false)
     , m_defaultHandled(false)
     , m_cancelBubble(false)
-    , m_createdByDOM(false)
     , m_eventPhase(0)
     , m_currentTarget(0)
     , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
@@ -47,10 +48,10 @@
     , m_canBubble(canBubbleArg)
     , m_cancelable(cancelableArg)
     , m_propagationStopped(false)
+    , m_immediatePropagationStopped(false)
     , m_defaultPrevented(false)
     , m_defaultHandled(false)
     , m_cancelBubble(false)
-    , m_createdByDOM(false)
     , m_eventPhase(0)
     , m_currentTarget(0)
     , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
@@ -71,6 +72,11 @@
     m_cancelable = cancelableArg;
 }
 
+bool Event::isCustomEvent() const
+{
+    return false;
+}
+
 bool Event::isUIEvent() const
 {
     return false;
@@ -196,7 +202,7 @@
 
 bool Event::fromUserGesture()
 {
-    if (createdByDOM())
+    if (!UserGestureIndicator::processingUserGesture())
         return false;
 
     const AtomicString& type = this->type();
@@ -247,4 +253,25 @@
     m_underlyingEvent = ue;
 }
 
+const AtomicString& Event::aliasedType() const
+{
+    if (type() == eventNames().focusinEvent)
+        return eventNames().DOMFocusInEvent;
+    if (type() == eventNames().focusoutEvent)
+        return eventNames().DOMFocusOutEvent;
+    if (type() == eventNames().DOMFocusInEvent)
+        return eventNames().focusinEvent;
+    if (type() == eventNames().DOMFocusOutEvent)
+        return eventNames().focusoutEvent;
+    
+    ASSERT_NOT_REACHED();
+    return type();
+}
+
+bool Event::hasAliasedType() const
+{
+    return type() == eventNames().focusinEvent || type() == eventNames().focusoutEvent ||
+           type() == eventNames().DOMFocusInEvent || type() == eventNames().DOMFocusOutEvent;
+}
+
 } // namespace WebCore
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index 0a05863..00b3341 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -75,6 +75,9 @@
         void initEvent(const AtomicString& type, bool canBubble, bool cancelable);
 
         const AtomicString& type() const { return m_type; }
+        
+        const AtomicString& aliasedType() const;
+        bool hasAliasedType() const;
 
         EventTarget* target() const { return m_target.get(); }
         void setTarget(PassRefPtr<EventTarget>);
@@ -88,8 +91,10 @@
         bool bubbles() const { return m_canBubble; }
         bool cancelable() const { return m_cancelable; }
         DOMTimeStamp timeStamp() const { return m_createTime; }
-        void stopPropagation() { m_propagationStopped = true; }
 
+        void stopPropagation() { m_propagationStopped = true; }
+        void stopImmediatePropagation() { m_immediatePropagationStopped = true; }
+        
         // IE Extensions
         EventTarget* srcElement() const { return target(); } // MSIE extension - "the object that fired the event"
 
@@ -98,6 +103,7 @@
 
         Clipboard* clipboardData() const { return isClipboardEvent() ? clipboard() : 0; }
 
+        virtual bool isCustomEvent() const;
         virtual bool isUIEvent() const;
         virtual bool isMouseEvent() const;
         virtual bool isMutationEvent() const;
@@ -131,7 +137,8 @@
 #endif
         bool fromUserGesture();
         
-        bool propagationStopped() const { return m_propagationStopped; }
+        bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }
+        bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 
         bool defaultPrevented() const { return m_defaultPrevented; }
         void preventDefault() { if (m_cancelable) m_defaultPrevented = true; }
@@ -151,9 +158,6 @@
 
         virtual Clipboard* clipboard() const { return 0; }
 
-        bool createdByDOM() const { return m_createdByDOM; }
-        void setCreatedByDOM(bool createdByDOM) { m_createdByDOM = createdByDOM; }
-
     protected:
         Event();
         Event(const AtomicString& type, bool canBubble, bool cancelable);
@@ -167,13 +171,11 @@
         bool m_cancelable;
 
         bool m_propagationStopped;
+        bool m_immediatePropagationStopped;
         bool m_defaultPrevented;
         bool m_defaultHandled;
         bool m_cancelBubble;
 
-        // Whether this event was created by document.createEvent().
-        bool m_createdByDOM;
-
         unsigned short m_eventPhase;
         EventTarget* m_currentTarget;
         RefPtr<EventTarget> m_target;
diff --git a/WebCore/dom/Event.idl b/WebCore/dom/Event.idl
index d64d122..919fc90 100644
--- a/WebCore/dom/Event.idl
+++ b/WebCore/dom/Event.idl
@@ -66,6 +66,10 @@
                                       in boolean canBubbleArg, 
                                       in boolean cancelableArg);
 
+        // DOM Level 3 Additions.
+        readonly attribute boolean defaultPrevented;
+        void stopImmediatePropagation();
+
         // IE Extensions
         readonly attribute EventTarget      srcElement;
                  attribute boolean          returnValue;
diff --git a/WebCore/dom/EventListener.h b/WebCore/dom/EventListener.h
index c0d045d..249d3eb 100644
--- a/WebCore/dom/EventListener.h
+++ b/WebCore/dom/EventListener.h
@@ -47,8 +47,6 @@
         virtual ~EventListener() { }
         virtual bool operator==(const EventListener&) = 0;
         virtual void handleEvent(ScriptExecutionContext*, Event*) = 0;
-        // Return true to indicate that the error is handled.
-        virtual bool reportError(ScriptExecutionContext*, const String& /*message*/, const String& /*url*/, int /*lineNumber*/) { return false; }
         virtual bool wasCreatedFromMarkup() const { return false; }
 
 #if USE(JSC)
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index b20eaa8..c50cfb2 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -60,6 +60,8 @@
     macro(drop) \
     macro(error) \
     macro(focus) \
+    macro(focusin) \
+    macro(focusout) \
     macro(hashchange) \
     macro(input) \
     macro(invalid) \
@@ -100,10 +102,10 @@
     macro(zoom) \
     \
     macro(DOMActivate) \
-    macro(DOMAttrModified) \
-    macro(DOMCharacterDataModified) \
     macro(DOMFocusIn) \
     macro(DOMFocusOut) \
+    macro(DOMAttrModified) \
+    macro(DOMCharacterDataModified) \
     macro(DOMNodeInserted) \
     macro(DOMNodeInsertedIntoDocument) \
     macro(DOMNodeRemoved) \
diff --git a/WebCore/dom/EventTarget.cpp b/WebCore/dom/EventTarget.cpp
index 65d751a..1598790 100644
--- a/WebCore/dom/EventTarget.cpp
+++ b/WebCore/dom/EventTarget.cpp
@@ -272,10 +272,22 @@
         return true;
 
     EventListenerMap::iterator result = d->eventListenerMap.find(event->type());
-    if (result == d->eventListenerMap.end())
-        return false;
-    EventListenerVector& entry = *result->second;
-
+    if (result != d->eventListenerMap.end())
+        fireEventListeners(event, d, *result->second);
+    
+    // Alias DOMFocusIn/DOMFocusOut to focusin/focusout (and vice versa). Just consider them to be the
+    // same event (triggering one another's handlers).  This mechanism allows us to deprecate or change event
+    // names in the future and still make them be interoperable.
+    if (event->hasAliasedType() && !event->immediatePropagationStopped()) {
+        EventListenerMap::iterator result = d->eventListenerMap.find(event->aliasedType());
+        if (result != d->eventListenerMap.end())
+            fireEventListeners(event, d, *result->second);
+    }
+    return !event->defaultPrevented();
+}
+        
+void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventListenerVector& entry)
+{
     RefPtr<EventTarget> protect = this;
 
     // Fire all listeners registered for this event. Don't fire listeners removed
@@ -292,13 +304,17 @@
             continue;
         if (event->eventPhase() == Event::BUBBLING_PHASE && registeredListener.useCapture)
             continue;
+
+        // If stopImmediatePropagation has been called, we just break out immediately, without
+        // handling any more events on this target.
+        if (event->immediatePropagationStopped())
+            break;
+
         // To match Mozilla, the AT_TARGET phase fires both capturing and bubbling
         // event listeners, even though that violates some versions of the DOM spec.
         registeredListener.listener->handleEvent(scriptExecutionContext(), event);
     }
     d->firingEventIterators.removeLast();
-
-    return !event->defaultPrevented();
 }
 
 const EventListenerVector& EventTarget::getEventListeners(const AtomicString& eventType)
diff --git a/WebCore/dom/EventTarget.h b/WebCore/dom/EventTarget.h
index ece0f34..da98d98 100644
--- a/WebCore/dom/EventTarget.h
+++ b/WebCore/dom/EventTarget.h
@@ -153,6 +153,8 @@
     private:
         virtual void refEventTarget() = 0;
         virtual void derefEventTarget() = 0;
+        
+        void fireEventListeners(Event*, EventTargetData*, EventListenerVector&);
     };
 
     #define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index 13bb0b2..52812f9 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -151,7 +151,7 @@
     string.replace('\r', ' ');
     string.replace('\n', ' ');
 
-    unsigned newLength = string.numCharactersInGraphemeClusters(maxLength);
+    unsigned newLength = numCharactersInGraphemeClusters(string, maxLength);
     for (unsigned i = 0; i < newLength; ++i) {
         const UChar current = string[i];
         if (current < ' ' && current != '\t') {
@@ -170,10 +170,10 @@
     // We use RenderTextControlSingleLine::text() instead of InputElement::value()
     // because they can be mismatched by sanitizeValue() in
     // RenderTextControlSingleLine::subtreeHasChanged() in some cases.
-    unsigned oldLength = toRenderTextControlSingleLine(element->renderer())->text().numGraphemeClusters();
+    unsigned oldLength = numGraphemeClusters(toRenderTextControlSingleLine(element->renderer())->text());
 
     // selection() may be a pre-edit text.
-    unsigned selectionLength = plainText(element->document()->frame()->selection()->selection().toNormalizedRange().get()).numGraphemeClusters();
+    unsigned selectionLength = numGraphemeClusters(plainText(element->document()->frame()->selection()->selection().toNormalizedRange().get()));
     ASSERT(oldLength >= selectionLength);
 
     // Selected characters will be removed by the next text event.
diff --git a/WebCore/dom/KeyboardEvent.cpp b/WebCore/dom/KeyboardEvent.cpp
index 99c9220..7b0f3af 100644
--- a/WebCore/dom/KeyboardEvent.cpp
+++ b/WebCore/dom/KeyboardEvent.cpp
@@ -131,7 +131,7 @@
     // Firefox: 0 for keydown/keyup events, character code for keypress
     // We match Firefox, unless in backward compatibility mode, where we always return the character code.
     bool backwardCompatibilityMode = false;
-    if (view())
+    if (view() && view()->frame())
         backwardCompatibilityMode = view()->frame()->eventHandler()->needsKeyboardEventDisambiguationQuirks();
 
     if (!m_keyEvent || (type() != eventNames().keypressEvent && !backwardCompatibilityMode))
diff --git a/WebCore/dom/MessagePort.idl b/WebCore/dom/MessagePort.idl
index 62cf63a..9312430 100644
--- a/WebCore/dom/MessagePort.idl
+++ b/WebCore/dom/MessagePort.idl
@@ -43,12 +43,12 @@
         attribute EventListener onmessage;
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 #endif
diff --git a/WebCore/dom/NamedNodeMap.idl b/WebCore/dom/NamedNodeMap.idl
index 4d36577..7bfbf23 100644
--- a/WebCore/dom/NamedNodeMap.idl
+++ b/WebCore/dom/NamedNodeMap.idl
@@ -28,7 +28,7 @@
 
         Node getNamedItem(in DOMString name);
 
-        Node setNamedItem(in Node node)
+        [Custom] Node setNamedItem(in Node node)
             raises(DOMException);
 
         Node removeNamedItem(in DOMString name)
@@ -46,7 +46,7 @@
             // FIXME: the implementation does take an exceptioncode parameter.
             /*raises(DOMException)*/;
 
-        Node setNamedItemNS(in Node node)
+        [Custom] Node setNamedItemNS(in Node node)
             raises(DOMException);
 
         [OldStyleObjC] Node removeNamedItemNS(in [ConvertNullToNullString] DOMString namespaceURI, 
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 49006fc..a8ffc37 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
  *
@@ -39,7 +39,6 @@
 #include "CSSStyleRule.h"
 #include "CSSStyleSelector.h"
 #include "CSSStyleSheet.h"
-#include "CString.h"
 #include "ChildNodeList.h"
 #include "ClassNodeList.h"
 #include "ContextMenuController.h"
@@ -85,6 +84,7 @@
 #include "WheelEvent.h"
 #include "XMLNames.h"
 #include "htmlediting.h"
+#include <wtf/text/CString.h>
 #include <wtf/HashSet.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RefCountedLeakCounter.h>
@@ -1087,8 +1087,7 @@
 
 void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec)
 {
-    // Perform error checking as required by spec for adding a new child. Used by
-    // appendChild(), replaceChild() and insertBefore()
+    // Perform error checking as required by spec for adding a new child. Used by replaceChild().
     
     // Not mentioned in spec: throw NOT_FOUND_ERR if newChild is null
     if (!newChild) {
@@ -1143,8 +1142,7 @@
 
 void Node::checkAddChild(Node *newChild, ExceptionCode& ec)
 {
-    // Perform error checking as required by spec for adding a new child. Used by
-    // appendChild(), replaceChild() and insertBefore()
+    // Perform error checking as required by spec for adding a new child. Used by appendChild() and insertBefore().
 
     // Not mentioned in spec: throw NOT_FOUND_ERR if newChild is null
     if (!newChild) {
@@ -1441,9 +1439,9 @@
         m_renderer->setAnimatableStyle(s); 
 }
 
-RenderStyle* Node::computedStyle()
+RenderStyle* Node::virtualComputedStyle(PseudoId pseudoElementSpecifier)
 {
-    return parent() ? parent()->computedStyle() : 0;
+    return parent() ? parent()->computedStyle(pseudoElementSpecifier) : 0;
 }
 
 int Node::maxCharacterOffset() const
@@ -2688,10 +2686,13 @@
     }
 
 #if ENABLE(INSPECTOR)
-    InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
-    bool timelineAgentIsActive = timelineAgent && eventHasListeners(event->type(), targetForWindowEvents, this, ancestors);
-    if (timelineAgentIsActive)
-        timelineAgent->willDispatchEvent(*event);
+    Page* inspectedPage = InspectorTimelineAgent::instanceCount() ? document()->page() : 0;
+    if (inspectedPage) {
+        if (InspectorTimelineAgent* timelineAgent = eventHasListeners(event->type(), targetForWindowEvents, this, ancestors) ? inspectedPage->inspectorTimelineAgent() : 0)
+            timelineAgent->willDispatchEvent(*event);
+        else
+            inspectedPage = 0;
+    }
 #endif
 
     // Give the target node a chance to do some work before DOM event handlers get a crack.
@@ -2775,12 +2776,11 @@
 
 doneWithDefault:
 #if ENABLE(INSPECTOR)
-    if (timelineAgentIsActive && (timelineAgent = document()->inspectorTimelineAgent()))
-        timelineAgent->didDispatchEvent();
+    if (inspectedPage)
+        if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent())
+            timelineAgent->didDispatchEvent();
 #endif
 
-    Document::updateStyleForAllDocuments();
-
     return !event->defaultPrevented();
 }
 
@@ -2801,7 +2801,8 @@
 void Node::dispatchUIEvent(const AtomicString& eventType, int detail, PassRefPtr<Event> underlyingEvent)
 {
     ASSERT(!eventDispatchForbidden());
-    ASSERT(eventType == eventNames().DOMFocusInEvent || eventType == eventNames().DOMFocusOutEvent || eventType == eventNames().DOMActivateEvent);
+    ASSERT(eventType == eventNames().focusinEvent || eventType == eventNames().focusoutEvent || 
+           eventType == eventNames().DOMFocusInEvent || eventType == eventNames().DOMFocusOutEvent || eventType == eventNames().DOMActivateEvent);
     
     bool cancelable = eventType == eventNames().DOMActivateEvent;
     
@@ -2943,7 +2944,7 @@
     if (eventType == eventNames().clickEvent && detail == 2) {
         RefPtr<Event> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent,
             true, cancelable, document()->defaultView(),
-            detail, screenX, screenY, pageX, pageY,
+            detail, screenX, screenY, adjustedPageX, adjustedPageY,
             ctrlKey, altKey, shiftKey, metaKey, button,
             relatedTarget, 0, isSimulated);
         doubleClickEvent->setUnderlyingEvent(underlyingEvent.get());
@@ -2980,14 +2981,27 @@
         }
     }
     
-    RefPtr<WheelEvent> we = WheelEvent::create(e.wheelTicksX(), e.wheelTicksY(),
+    WheelEvent::Granularity granularity;
+    switch (e.granularity()) {
+    case ScrollByPageWheelEvent:
+        granularity = WheelEvent::Page;
+        break;
+    case ScrollByPixelWheelEvent:
+    default:
+        granularity = WheelEvent::Pixel;
+        break;
+    }
+    
+    RefPtr<WheelEvent> we = WheelEvent::create(e.wheelTicksX(), e.wheelTicksY(), e.deltaX(), e.deltaY(), granularity,
         document()->defaultView(), e.globalX(), e.globalY(), adjustedPageX, adjustedPageY,
         e.ctrlKey(), e.altKey(), e.shiftKey(), e.metaKey());
 
     we->setAbsoluteLocation(IntPoint(pos.x(), pos.y()));
 
-    if (!dispatchEvent(we.release()))
+    if (!dispatchEvent(we) || we->defaultHandled())
         e.accept();
+
+    we.release();
 }
 
 void Node::dispatchFocusEvent()
@@ -3044,6 +3058,18 @@
             }
         }
 #endif
+    } else if (eventType == eventNames().mousewheelEvent && event->isWheelEvent()) {
+        WheelEvent* wheelEvent = static_cast<WheelEvent*>(event);
+        
+        // If we don't have a renderer, send the wheel event to the first node we find with a renderer.
+        // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
+        Node* startNode = this;
+        while (startNode && !startNode->renderer())
+            startNode = startNode->parent();
+        
+        if (startNode && startNode->renderer())
+            if (Frame* frame = document()->frame())
+                frame->eventHandler()->defaultWheelEventHandler(startNode, wheelEvent);
     }
 }
 
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 495bca9..b2af8fc 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -27,6 +27,7 @@
 
 #include "EventTarget.h"
 #include "KURLHash.h"
+#include "RenderStyleConstants.h"
 #include "ScriptWrappable.h"
 #include "TreeShared.h"
 #include <wtf/ListHashSet.h>
@@ -445,7 +446,7 @@
     RenderStyle* renderStyle() const;
     virtual void setRenderStyle(PassRefPtr<RenderStyle>);
 
-    virtual RenderStyle* computedStyle();
+    RenderStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO) { return virtualComputedStyle(pseudoElementSpecifier); }
 
     // -----------------------------------------------------------------------------
     // Notification of document structure changes
@@ -599,8 +600,6 @@
     virtual void refEventTarget() { ref(); }
     virtual void derefEventTarget() { deref(); }
 
-    void removeAllEventListenersSlowCase();
-
     virtual NodeRareData* createRareData();
     Node* containerChildNode(unsigned index) const;
     unsigned containerChildNodeCount() const;
@@ -613,6 +612,7 @@
     virtual const AtomicString& virtualPrefix() const;
     virtual const AtomicString& virtualLocalName() const;
     virtual const AtomicString& virtualNamespaceURI() const;
+    virtual RenderStyle* virtualComputedStyle(PseudoId = NOPSEUDO);
 
     Element* ancestorElement() const;
 
diff --git a/WebCore/dom/Node.idl b/WebCore/dom/Node.idl
index c6cd4b9..c0f159c 100644
--- a/WebCore/dom/Node.idl
+++ b/WebCore/dom/Node.idl
@@ -21,6 +21,7 @@
 module core {
 
     interface [
+        CustomHeader,
         CustomMarkFunction,
         CustomPushEventHandlerScope,
         CustomToJS,
@@ -50,7 +51,7 @@
         readonly attribute [ConvertNullStringTo=Null] DOMString        nodeName;
 
                  // FIXME: the spec says this can also raise on retrieval.
-                 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString        nodeValue
+                 attribute [CustomSetter, ConvertNullStringTo=Null, ConvertNullToNullString] DOMString        nodeValue
                      setter raises(DOMException);
 
         readonly attribute unsigned short   nodeType;
@@ -61,7 +62,9 @@
         readonly attribute Node             previousSibling;
         readonly attribute Node             nextSibling;
         readonly attribute NamedNodeMap     attributes;
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
         readonly attribute Document         ownerDocument;
+#endif
 
         [OldStyleObjC, Custom] Node insertBefore(in [Return] Node newChild,
                                                  in Node refChild)
@@ -95,7 +98,7 @@
         readonly attribute [ConvertNullStringTo=Null] DOMString       baseURI;
 
                  // FIXME: the spec says this can also raise on retrieval.
-                 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString       textContent
+                 attribute [CustomSetter, ConvertNullStringTo=Null, ConvertNullToNullString] DOMString       textContent
                      setter raises(DOMException);
 
         boolean            isSameNode(in Node other);
@@ -132,15 +135,17 @@
 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event event)
             raises(EventException);
 #endif
+#endif
     };
 
 }
diff --git a/WebCore/dom/OptionElement.h b/WebCore/dom/OptionElement.h
index a765d53..232c3ee 100644
--- a/WebCore/dom/OptionElement.h
+++ b/WebCore/dom/OptionElement.h
@@ -34,6 +34,7 @@
 public:
     virtual ~OptionElement() { }
 
+    virtual bool disabled() const = 0;
     virtual bool selected() const = 0;
     virtual void setSelectedState(bool) = 0;
 
diff --git a/WebCore/dom/Position.cpp b/WebCore/dom/Position.cpp
index c0f6fa3..fa994e3 100644
--- a/WebCore/dom/Position.cpp
+++ b/WebCore/dom/Position.cpp
@@ -27,7 +27,6 @@
 #include "Position.h"
 
 #include "CSSComputedStyleDeclaration.h"
-#include "CString.h"
 #include "CharacterNames.h"
 #include "Logging.h"
 #include "PositionIterator.h"
@@ -38,6 +37,7 @@
 #include "htmlediting.h"
 #include "visible_units.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
   
 namespace WebCore {
 
@@ -946,14 +946,7 @@
 
 void Position::getInlineBoxAndOffset(EAffinity affinity, InlineBox*& inlineBox, int& caretOffset) const
 {
-    TextDirection primaryDirection = LTR;
-    for (RenderObject* r = node()->renderer(); r; r = r->parent()) {
-        if (r->isBlockFlow()) {
-            primaryDirection = r->style()->direction();
-            break;
-        }
-    }
-    getInlineBoxAndOffset(affinity, primaryDirection, inlineBox, caretOffset);
+    getInlineBoxAndOffset(affinity, primaryDirection(), inlineBox, caretOffset);
 }
 
 static bool isNonTextLeafChild(RenderObject* object)
@@ -1018,7 +1011,7 @@
             inlineBox = toRenderBox(renderer)->inlineBoxWrapper();
             if (!inlineBox || (caretOffset > inlineBox->caretMinOffset() && caretOffset < inlineBox->caretMaxOffset()))
                 return;
-        } else if (node()->isContentEditable()) {
+        } else if (!node()->isLink() && node()->isContentEditable()) {
             Position pos = positionInParentBeforeNode(node()).upstream();
             pos.getInlineBoxAndOffset(DOWNSTREAM, primaryDirection, inlineBox, caretOffset);
             return;
@@ -1041,7 +1034,8 @@
                 return;
             }
 
-            if ((caretOffset == caretMinOffset) ^ (affinity == UPSTREAM))
+            if (((caretOffset == caretMaxOffset) ^ (affinity == DOWNSTREAM))
+                || ((caretOffset == caretMinOffset) ^ (affinity == UPSTREAM)))
                 break;
 
             candidate = box;
@@ -1146,6 +1140,20 @@
     }
 }
 
+TextDirection Position::primaryDirection() const
+{
+    TextDirection primaryDirection = LTR;
+    for (const RenderObject* r = m_anchorNode->renderer(); r; r = r->parent()) {
+        if (r->isBlockFlow()) {
+            primaryDirection = r->style()->direction();
+            break;
+        }
+    }
+
+    return primaryDirection;
+}
+
+
 void Position::debugPosition(const char* msg) const
 {
     if (isNull())
diff --git a/WebCore/dom/Position.h b/WebCore/dom/Position.h
index fc5849f..591b0e6 100644
--- a/WebCore/dom/Position.h
+++ b/WebCore/dom/Position.h
@@ -158,6 +158,8 @@
     void getInlineBoxAndOffset(EAffinity, InlineBox*&, int& caretOffset) const;
     void getInlineBoxAndOffset(EAffinity, TextDirection primaryDirection, InlineBox*&, int& caretOffset) const;
 
+    TextDirection primaryDirection() const;
+
     static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*);
     static bool nodeIsUserSelectNone(Node*);
     
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index 122a175..544882c 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -165,7 +165,7 @@
             {
                 String charset = attrs.get("charset");
                 if (charset.isEmpty())
-                    charset = document()->frame()->loader()->encoding();
+                    charset = document()->frame()->loader()->writer()->encoding();
 
                 m_cachedSheet = document()->docLoader()->requestCSSStyleSheet(url, charset);
             }
diff --git a/WebCore/dom/QualifiedName.cpp b/WebCore/dom/QualifiedName.cpp
index 795bdb6..6f5a74f 100644
--- a/WebCore/dom/QualifiedName.cpp
+++ b/WebCore/dom/QualifiedName.cpp
@@ -26,9 +26,9 @@
 #endif
 
 #include "QualifiedName.h"
-#include "StaticConstructors.h"
 #include <wtf/Assertions.h>
 #include <wtf/HashSet.h>
+#include <wtf/StaticConstructors.h>
 
 namespace WebCore {
 
diff --git a/WebCore/dom/Range.cpp b/WebCore/dom/Range.cpp
index 52d1785..c704262 100644
--- a/WebCore/dom/Range.cpp
+++ b/WebCore/dom/Range.cpp
@@ -25,7 +25,6 @@
 #include "Range.h"
 #include "RangeException.h"
 
-#include "CString.h"
 #include "ClientRect.h"
 #include "ClientRectList.h"
 #include "DocumentFragment.h"
@@ -40,6 +39,7 @@
 #include "markup.h"
 #include "visible_units.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/RefCountedLeakCounter.h>
 
 namespace WebCore {
@@ -1661,15 +1661,13 @@
 #undef FormatBufferSize
 #endif
 
-bool operator==(const Range& a, const Range& b)
+bool areRangesEqual(const Range* a, const Range* b)
 {
-    if (&a == &b)
+    if (a == b)
         return true;
-    // Not strictly legal C++, but in practice this can happen, and this check works
-    // fine with GCC to detect such cases and return false rather than crashing.
-    if (!&a || !&b)
+    if (!a || !b)
         return false;
-    return a.startPosition() == b.startPosition() && a.endPosition() == b.endPosition();
+    return a->startPosition() == b->startPosition() && a->endPosition() == b->endPosition();
 }
 
 PassRefPtr<Range> rangeOfContents(Node* node)
diff --git a/WebCore/dom/Range.h b/WebCore/dom/Range.h
index fd0f66a..b1ed786 100644
--- a/WebCore/dom/Range.h
+++ b/WebCore/dom/Range.h
@@ -153,8 +153,7 @@
 
 PassRefPtr<Range> rangeOfContents(Node*);
 
-bool operator==(const Range&, const Range&);
-inline bool operator!=(const Range& a, const Range& b) { return !(a == b); }
+bool areRangesEqual(const Range*, const Range*);
 
 } // namespace
 
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 9a80e16..22d6981 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -177,7 +177,7 @@
         return;
 
     if (Frame* frame = m_element->document()->frame()) {
-        if (!frame->script()->canExecuteScripts())
+        if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
             return;
 
         m_evaluated = true;
@@ -246,7 +246,13 @@
     // and we support the for syntax in script tags, this check can be removed and we should just
     // return 'true' here.
     String forAttribute = m_scriptElement->forAttributeValue();
-    return forAttribute.isEmpty();
+    String eventAttribute = m_scriptElement->eventAttributeValue();
+    if (forAttribute.isEmpty() || eventAttribute.isEmpty())
+        return true;
+    
+    forAttribute = forAttribute.stripWhiteSpace();
+    eventAttribute = eventAttribute.stripWhiteSpace();
+    return equalIgnoringCase(forAttribute, "window") && (equalIgnoringCase(eventAttribute, "onload") || equalIgnoringCase(eventAttribute, "onload()"));
 }
 
 String ScriptElementData::scriptCharset() const
@@ -257,7 +263,7 @@
     // If charset has not been declared in script tag, fall back to frame encoding.
     if (charset.isEmpty()) {
         if (Frame* frame = m_element->document()->frame())
-            charset = frame->loader()->encoding();
+            charset = frame->loader()->writer()->encoding();
     }
 
     return charset;
diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h
index 0aed5e8..fad6fe7 100644
--- a/WebCore/dom/ScriptElement.h
+++ b/WebCore/dom/ScriptElement.h
@@ -43,6 +43,7 @@
     virtual String typeAttributeValue() const = 0;
     virtual String languageAttributeValue() const = 0;
     virtual String forAttributeValue() const = 0;
+    virtual String eventAttributeValue() const = 0;
 
     virtual void dispatchLoadEvent() = 0;
     virtual void dispatchErrorEvent() = 0;
diff --git a/WebCore/dom/ScriptExecutionContext.cpp b/WebCore/dom/ScriptExecutionContext.cpp
index c2fe120..226aad8 100644
--- a/WebCore/dom/ScriptExecutionContext.cpp
+++ b/WebCore/dom/ScriptExecutionContext.cpp
@@ -31,6 +31,9 @@
 #include "Database.h"
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+#include "FileThread.h"
+#endif
 #include "MessagePort.h"
 #include "SecurityOrigin.h"
 #include "WorkerContext.h"
@@ -83,6 +86,12 @@
         m_databaseThread = 0;
     }
 #endif
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+    if (m_fileThread) {
+        m_fileThread->stop();
+        m_fileThread = 0;
+    }
+#endif
 }
 
 #if ENABLE(DATABASE)
@@ -261,6 +270,18 @@
     return m_timeouts.get(timeoutId);
 }
 
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+FileThread* ScriptExecutionContext::fileThread()
+{
+    if (!m_fileThread) {
+        m_fileThread = FileThread::create();
+        if (!m_fileThread->start())
+            m_fileThread = 0;
+    }
+    return m_fileThread.get();
+}
+#endif
+
 ScriptExecutionContext::Task::~Task()
 {
 }
diff --git a/WebCore/dom/ScriptExecutionContext.h b/WebCore/dom/ScriptExecutionContext.h
index 709bc69..d0f2e26 100644
--- a/WebCore/dom/ScriptExecutionContext.h
+++ b/WebCore/dom/ScriptExecutionContext.h
@@ -45,17 +45,16 @@
     class DatabaseThread;
 #endif
     class DOMTimer;
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+    class FileThread;
+#endif
     class MessagePort;
     class SecurityOrigin;
     class ScriptString;
     class String;
-
-    enum MessageDestination {
 #if ENABLE(INSPECTOR)
-        InspectorControllerDestination,
+    class InspectorController;
 #endif
-        ConsoleDestination,
-    };
 
     class ScriptExecutionContext {
     public:
@@ -84,11 +83,12 @@
         virtual String userAgent(const KURL&) const = 0;
 
         SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
+#if ENABLE(INSPECTOR)
+        virtual InspectorController* inspectorController() const { return 0; }
+#endif
 
         virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
-        virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
-        virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString) = 0;
-        virtual void scriptImported(unsigned long, const String&) = 0;
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
         
         // Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
         bool canSuspendActiveDOMObjects();
@@ -130,6 +130,11 @@
         JSC::JSGlobalData* globalData();
 #endif
 
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+        FileThread* fileThread();
+        void stopFileThread();
+#endif
+
     protected:
         // Explicitly override the security origin for this script context.
         // Note: It is dangerous to change the security origin of a script context
@@ -157,6 +162,10 @@
         typedef HashSet<Database* > DatabaseSet;
         OwnPtr<DatabaseSet> m_openDatabaseSet;
 #endif
+
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+        RefPtr<FileThread> m_fileThread;
+#endif
     };
 
 } // namespace WebCore
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index 866b6ca..4af90c9 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -150,7 +150,7 @@
 
 void SelectElement::updateListBoxSelection(SelectElementData& data, Element* element, bool deselectOtherOptions)
 {
-    ASSERT(element->renderer() && element->renderer()->isListBox());
+    ASSERT(element->renderer() && (element->renderer()->isListBox() || data.multiple()));
     ASSERT(data.activeSelectionAnchorIndex() >= 0);
 
     unsigned start = min(data.activeSelectionAnchorIndex(), data.activeSelectionEndIndex());
@@ -176,7 +176,7 @@
 
 void SelectElement::listBoxOnChange(SelectElementData& data, Element* element)
 {
-    ASSERT(!data.usesMenuList());
+    ASSERT(!data.usesMenuList() || data.multiple());
 
     Vector<bool>& lastOnChangeSelection = data.lastOnChangeSelection(); 
     const Vector<Element*>& items = data.listItems(element);
@@ -270,11 +270,11 @@
         if (OptionElement* optionElement = toOptionElement(current)) {
             listItems.append(current);
 
-            if (updateSelectedStates) {
-                if (!foundSelected && (data.usesMenuList() || (!data.multiple() && optionElement->selected()))) {
+            if (updateSelectedStates && !data.multiple()) {
+                if (!foundSelected && (data.size() <= 1 || optionElement->selected())) {
                     foundSelected = optionElement;
                     foundSelected->setSelectedState(true);
-                } else if (foundSelected && !data.multiple() && optionElement->selected()) {
+                } else if (foundSelected && optionElement->selected()) {
                     foundSelected->setSelectedState(false);
                     foundSelected = optionElement;
                 }
@@ -464,27 +464,15 @@
 
     for (unsigned i = 0; i < items.size(); ++i) {
         OptionElement* optionElement = toOptionElement(items[i]);
-        if (optionElement && optionElement->selected()) {
+        if (optionElement && optionElement->selected() && !optionElement->disabled()) {
             list.appendData(name, optionElement->value());
             successful = true;
         }
     }
 
-    // FIXME: This case should not happen. Make sure that we select the first option
-    // in any case, otherwise we have no consistency with the DOM interface.
-    // We return the first one if it was a combobox select
-    if (!successful && !data.multiple() && data.size() <= 1 && items.size()) {
-        OptionElement* optionElement = toOptionElement(items[0]);
-        if (optionElement) {
-            const AtomicString& value = optionElement->value();
-            if (value.isNull())
-                list.appendData(name, optionElement->text().stripWhiteSpace());
-            else
-                list.appendData(name, value);
-            successful = true;
-        }
-    }
-
+    // It's possible that this is a menulist with multiple options and nothing
+    // will be submitted (!successful). We won't send a unselected non-disabled
+    // option as fallback. This behavior matches to other browsers.
     return successful;
 } 
 
@@ -511,7 +499,7 @@
             firstOption = optionElement;
     }
 
-    if (!selectedOption && firstOption && data.usesMenuList())
+    if (!selectedOption && firstOption && !data.multiple() && data.size() <= 1)
         firstOption->setSelectedState(true);
 
     setOptionsChangedOnRenderer(data, element);
@@ -659,6 +647,52 @@
     }
 }
 
+void SelectElement::updateSelectedState(SelectElementData& data, Element* element, int listIndex,
+                                        bool multi, bool shift)
+{
+    ASSERT(listIndex >= 0);
+
+    // Save the selection so it can be compared to the new selection when dispatching change events during mouseup, or after autoscroll finishes.
+    saveLastSelection(data, element);
+
+    data.setActiveSelectionState(true);
+
+    bool shiftSelect = data.multiple() && shift;
+    bool multiSelect = data.multiple() && multi && !shift;
+
+    Element* clickedElement = data.listItems(element)[listIndex];
+    OptionElement* option = toOptionElement(clickedElement);
+    if (option) {
+        // Keep track of whether an active selection (like during drag selection), should select or deselect
+        if (option->selected() && multi)
+            data.setActiveSelectionState(false);
+
+        if (!data.activeSelectionState())
+            option->setSelectedState(false);
+    }
+
+    // If we're not in any special multiple selection mode, then deselect all other items, excluding the clicked option.
+    // If no option was clicked, then this will deselect all items in the list.
+    if (!shiftSelect && !multiSelect)
+        deselectItems(data, element, clickedElement);
+
+    // If the anchor hasn't been set, and we're doing a single selection or a shift selection, then initialize the anchor to the first selected index.
+    if (data.activeSelectionAnchorIndex() < 0 && !multiSelect)
+        setActiveSelectionAnchorIndex(data, element, selectedIndex(data, element));
+
+    // Set the selection state of the clicked option
+    if (option && !clickedElement->disabled())
+        option->setSelectedState(true);
+
+    // If there was no selectedIndex() for the previous initialization, or
+    // If we're doing a single selection, or a multiple selection (using cmd or ctrl), then initialize the anchor index to the listIndex that just got clicked.
+    if (data.activeSelectionAnchorIndex() < 0 || !shiftSelect)
+        setActiveSelectionAnchorIndex(data, element, listIndex);
+
+    setActiveSelectionEndIndex(data, listIndex);
+    updateListBoxSelection(data, element, !multiSelect);
+}
+
 void SelectElement::listBoxDefaultEventHandler(SelectElementData& data, Element* element, Event* event, HTMLFormElement* htmlForm)
 {
     const Vector<Element*>& listItems = data.listItems(element);
@@ -671,53 +705,11 @@
         IntPoint localOffset = roundedIntPoint(element->renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
         int listIndex = toRenderListBox(element->renderer())->listIndexAtOffset(localOffset.x(), localOffset.y());
         if (listIndex >= 0) {
-            // Save the selection so it can be compared to the new selection when dispatching change events during mouseup, or after autoscroll finishes.
-            saveLastSelection(data, element);
-
-            data.setActiveSelectionState(true);
-            
-            bool multiSelectKeyPressed = false;
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-            multiSelectKeyPressed = mouseEvent->metaKey();
+            updateSelectedState(data, element, listIndex, mouseEvent->metaKey(), mouseEvent->shiftKey());
 #else
-            multiSelectKeyPressed = mouseEvent->ctrlKey();
+            updateSelectedState(data, element, listIndex, mouseEvent->ctrlKey(), mouseEvent->shiftKey());
 #endif
-
-            bool shiftSelect = data.multiple() && mouseEvent->shiftKey();
-            bool multiSelect = data.multiple() && multiSelectKeyPressed && !mouseEvent->shiftKey();
-
-            Element* clickedElement = listItems[listIndex];            
-            OptionElement* option = toOptionElement(clickedElement);
-            if (option) {
-                // Keep track of whether an active selection (like during drag selection), should select or deselect
-                if (option->selected() && multiSelectKeyPressed)
-                    data.setActiveSelectionState(false);
-
-                if (!data.activeSelectionState())
-                    option->setSelectedState(false);
-            }
-            
-            // If we're not in any special multiple selection mode, then deselect all other items, excluding the clicked option.
-            // If no option was clicked, then this will deselect all items in the list.
-            if (!shiftSelect && !multiSelect)
-                deselectItems(data, element, clickedElement);
-
-            // If the anchor hasn't been set, and we're doing a single selection or a shift selection, then initialize the anchor to the first selected index.
-            if (data.activeSelectionAnchorIndex() < 0 && !multiSelect)
-                setActiveSelectionAnchorIndex(data, element, selectedIndex(data, element));
-
-            // Set the selection state of the clicked option
-            if (option && !clickedElement->disabled())
-                option->setSelectedState(true);
-            
-            // If there was no selectedIndex() for the previous initialization, or
-            // If we're doing a single selection, or a multiple selection (using cmd or ctrl), then initialize the anchor index to the listIndex that just got clicked.
-            if (listIndex >= 0 && (data.activeSelectionAnchorIndex() < 0 || !shiftSelect))
-                setActiveSelectionAnchorIndex(data, element, listIndex);
-            
-            setActiveSelectionEndIndex(data, listIndex);
-            updateListBoxSelection(data, element, !multiSelect);
-
             if (Frame* frame = element->document()->frame())
                 frame->eventHandler()->setMouseDownMayStartAutoscroll();
 
@@ -750,7 +742,7 @@
             // Save the selection so it can be compared to the new selection when dispatching change events immediately after making the new selection.
             saveLastSelection(data, element);
 
-            ASSERT(endIndex >= 0 && (unsigned) endIndex < listItems.size()); 
+            ASSERT_UNUSED(listItems, endIndex >= 0 && (unsigned) endIndex < listItems.size());
             setActiveSelectionEndIndex(data, endIndex);
             
             // If the anchor is unitialized, or if we're going to deselect all other options, then set the anchor index equal to the end index.
@@ -954,7 +946,7 @@
 void SelectElementData::checkListItems(const Element* element) const
 {
 #if !ASSERT_DISABLED
-    const Vector<Element*>& items = m_listItems;
+    Vector<Element*> items = m_listItems;
     SelectElement::recalcListItems(*const_cast<SelectElementData*>(this), element, false);
     ASSERT(items == m_listItems);
 #else
diff --git a/WebCore/dom/SelectElement.h b/WebCore/dom/SelectElement.h
index 6891c22..dcb6879 100644
--- a/WebCore/dom/SelectElement.h
+++ b/WebCore/dom/SelectElement.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http//www.torchmobile.com/)
  *
  * This library is free software; you can redistribute it and/or
@@ -60,6 +61,8 @@
     virtual void setSelectedIndex(int index, bool deselect = true) = 0;
     virtual void setSelectedIndexByUser(int index, bool deselect = true, bool fireOnChangeNow = false) = 0;
 
+    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true) = 0;
+
 protected:
     virtual ~SelectElement() { }
 
@@ -95,6 +98,9 @@
     static void insertedIntoTree(SelectElementData&, Element*);
     static void accessKeySetSelectedIndex(SelectElementData&, Element*, int index);
     static unsigned optionCount(const SelectElementData&, const Element*);
+
+    static void updateSelectedState(SelectElementData& data, Element* element, int listIndex,
+                                    bool multi, bool shift);
  
 private:
     static void menuListDefaultEventHandler(SelectElementData&, Element*, Event*, HTMLFormElement*);
@@ -114,7 +120,14 @@
     int size() const { return m_size; }
     void setSize(int value) { m_size = value; }
 
-    bool usesMenuList() const { return !m_multiple && m_size <= 1; }
+    bool usesMenuList() const
+    {
+#if ENABLE(NO_LISTBOX_RENDERING)
+        return true;
+#else
+        return !m_multiple && m_size <= 1;
+#endif
+    }
 
     int lastOnChangeIndex() const { return m_lastOnChangeIndex; }
     void setLastOnChangeIndex(int value) { m_lastOnChangeIndex = value; }
diff --git a/WebCore/dom/Text.cpp b/WebCore/dom/Text.cpp
index 1ce074a..cf98817 100644
--- a/WebCore/dom/Text.cpp
+++ b/WebCore/dom/Text.cpp
@@ -22,10 +22,10 @@
 #include "config.h"
 #include "Text.h"
 
-#include "CString.h"
 #include "ExceptionCode.h"
 #include "RenderText.h"
 #include "TextBreakIterator.h"
+#include <wtf/text/CString.h>
 
 #if ENABLE(SVG)
 #include "RenderSVGInlineText.h"
diff --git a/WebCore/dom/UserGestureIndicator.cpp b/WebCore/dom/UserGestureIndicator.cpp
new file mode 100644
index 0000000..9fb30d3
--- /dev/null
+++ b/WebCore/dom/UserGestureIndicator.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "UserGestureIndicator.h"
+
+namespace WebCore {
+
+bool UserGestureIndicator::s_processingUserGesture = false;
+
+UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state)
+    : m_previousValue(s_processingUserGesture)
+{
+    if (state == DefinitelyProcessingUserGesture)
+        s_processingUserGesture = true;
+}
+
+UserGestureIndicator::~UserGestureIndicator()
+{
+    s_processingUserGesture = m_previousValue;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/UserGestureIndicator.h b/WebCore/dom/UserGestureIndicator.h
new file mode 100644
index 0000000..d83d968
--- /dev/null
+++ b/WebCore/dom/UserGestureIndicator.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 UserGestureIndicator_h
+#define UserGestureIndicator_h
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+enum ProcessingUserGestureState {
+    DefinitelyProcessingUserGesture,
+    PossiblyProcessingUserGesture
+};
+
+class UserGestureIndicator : public Noncopyable {
+public:
+    static bool processingUserGesture() { return s_processingUserGesture; }
+
+    explicit UserGestureIndicator(ProcessingUserGestureState);
+    ~UserGestureIndicator();
+
+private:
+    static bool s_processingUserGesture;
+    bool m_previousValue;
+};    
+
+} // namespace WebCore
+
+#endif // UserGestureIndicator_h
diff --git a/WebCore/dom/ViewportArguments.cpp b/WebCore/dom/ViewportArguments.cpp
new file mode 100644
index 0000000..d585896
--- /dev/null
+++ b/WebCore/dom/ViewportArguments.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ *           (C) 2001 Dirk Mueller (mueller@kde.org)
+ *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ *
+ * 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 "ViewportArguments.h"
+
+#include "Chrome.h"
+#include "Console.h"
+#include "DOMWindow.h"
+#include "Document.h"
+#include "Frame.h"
+#include "Page.h"
+#include "PlatformString.h"
+#include "Tokenizer.h"
+
+namespace WebCore {
+
+void setViewportFeature(const String& keyString, const String& valueString, Document* document, void* data)
+{
+    ViewportArguments* arguments = static_cast<ViewportArguments*>(data);
+    float value = ViewportArguments::ValueUndefined;
+    bool didUseConstants = false;
+
+    if (equalIgnoringCase(valueString, "yes"))
+        value = 1;
+    else if (equalIgnoringCase(valueString, "device-width")) {
+        didUseConstants = true;
+        if (document->page())
+            value = document->page()->chrome()->windowRect().width();
+    } else if (equalIgnoringCase(valueString, "device-height")) {
+        didUseConstants = true;
+        if (document->page())
+            value = document->page()->chrome()->windowRect().height();
+    } else if (equalIgnoringCase(valueString, "default")) // This allows us to distinguish the omission of a key from asking for the default value.
+        value = -2;
+    else if (valueString.length()) // listing a key with no value is shorthand for key=default
+        value = valueString.toFloat();
+
+    if (keyString == "initial-scale")
+        arguments->initialScale = value;
+    else if (keyString == "minimum-scale")
+        arguments->minimumScale = value;
+    else if (keyString == "maximum-scale") {
+        arguments->maximumScale = value;
+        if (value > 10.0)
+            reportViewportWarning(document, MaximumScaleTooLargeError, keyString);
+    } else if (keyString == "user-scalable")
+        arguments->userScalable = value;
+    else if (keyString == "width") {
+        if (document->page() && value == document->page()->chrome()->windowRect().width() && !didUseConstants)
+            reportViewportWarning(document, DeviceWidthShouldBeUsedWarning, keyString);
+        else if (document->page() && value == document->page()->chrome()->windowRect().height() && !didUseConstants)
+            reportViewportWarning(document, DeviceHeightShouldBeUsedWarning, keyString);
+
+        arguments->width = value;
+    } else if (keyString == "height") {
+        if (document->page() && value == document->page()->chrome()->windowRect().width() && !didUseConstants)
+            reportViewportWarning(document, DeviceWidthShouldBeUsedWarning, keyString);
+        else if (document->page() && value == document->page()->chrome()->windowRect().height() && !didUseConstants)
+            reportViewportWarning(document, DeviceHeightShouldBeUsedWarning, keyString);
+        
+        arguments->height = value;
+    } else
+        reportViewportWarning(document, UnrecognizedViewportArgumentError, keyString);
+}
+
+static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode)
+{
+    static const char* const errors[] = { 
+        "Viewport width or height set to physical device width, try using \"device-width\" constant instead for future compatibility.",
+        "Viewport height or height set to physical device height, try using \"device-height\" constant instead for future compatibility.",
+        "Viewport argument \"%replacement\" not recognized. Content ignored.",
+        "Viewport maximum-scale cannot be larger than 10.0.  The maximum-scale will be set to 10.0."
+    };
+
+    return errors[errorCode];
+}
+
+static MessageLevel viewportErrorMessageLevel(ViewportErrorCode errorCode)
+{
+    return errorCode == UnrecognizedViewportArgumentError || errorCode == MaximumScaleTooLargeError ? ErrorMessageLevel : TipMessageLevel;
+}
+
+void reportViewportWarning(Document* document, ViewportErrorCode errorCode, const String& replacement)
+{
+    Tokenizer* tokenizer = document->tokenizer();
+
+    Frame* frame = document->frame();
+    if (!frame)
+        return;
+
+    String message = viewportErrorMessageTemplate(errorCode);
+    message.replace("%replacement", replacement);
+
+    frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, viewportErrorMessageLevel(errorCode), message, tokenizer ? tokenizer->lineNumber() + 1 : 0, document->url().string());
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/ViewportArguments.h b/WebCore/dom/ViewportArguments.h
new file mode 100644
index 0000000..29eec8e
--- /dev/null
+++ b/WebCore/dom/ViewportArguments.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ *           (C) 2001 Dirk Mueller (mueller@kde.org)
+ *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ *
+ * 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 ViewportArguments_h
+#define ViewportArguments_h
+
+namespace WebCore {
+
+class Document;
+class String;
+
+enum ViewportErrorCode {
+    DeviceWidthShouldBeUsedWarning,
+    DeviceHeightShouldBeUsedWarning,
+    UnrecognizedViewportArgumentError,
+    MaximumScaleTooLargeError
+};
+
+struct ViewportArguments {
+
+    enum { ValueUndefined = -1 };
+
+    ViewportArguments()
+        : initialScale(ValueUndefined)
+        , minimumScale(ValueUndefined)
+        , maximumScale(ValueUndefined)
+        , width(ValueUndefined)
+        , height(ValueUndefined)
+        , userScalable(ValueUndefined)
+    {
+    }
+
+    float initialScale;
+    float minimumScale;
+    float maximumScale;
+    float width;
+    float height;
+
+    float userScalable;
+
+    bool hasCustomArgument() const
+    {
+        return initialScale != ValueUndefined || minimumScale != ValueUndefined || maximumScale != ValueUndefined || width != ValueUndefined || height != ValueUndefined || userScalable != ValueUndefined;
+    }
+};
+
+void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data);
+void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement);
+
+} // namespace WebCore
+
+#endif // ViewportArguments_h
diff --git a/WebCore/dom/WheelEvent.cpp b/WebCore/dom/WheelEvent.cpp
index 2039541..0981a57 100644
--- a/WebCore/dom/WheelEvent.cpp
+++ b/WebCore/dom/WheelEvent.cpp
@@ -2,7 +2,7 @@
  * Copyright (C) 2001 Peter Kelly (pmk@post.com)
  * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
  * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -31,21 +31,28 @@
 WheelEvent::WheelEvent()
     : m_wheelDeltaX(0)
     , m_wheelDeltaY(0)
+    , m_rawDeltaX(0)
+    , m_rawDeltaY(0)
+    , m_granularity(Pixel)
 {
 }
 
-WheelEvent::WheelEvent(float wheelTicksX, float wheelTicksY, PassRefPtr<AbstractView> view,
+WheelEvent::WheelEvent(float wheelTicksX, float wheelTicksY, float rawDeltaX, float rawDeltaY,
+                       Granularity granularity, PassRefPtr<AbstractView> view,
                        int screenX, int screenY, int pageX, int pageY,
                        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
     : MouseRelatedEvent(eventNames().mousewheelEvent,
-                        true, true, view, 0, screenX, screenY, pageX, pageY, 
+                        true, true, view, 0, screenX, screenY, pageX, pageY,
                         ctrlKey, altKey, shiftKey, metaKey)
     , m_wheelDeltaX(lroundf(wheelTicksX * 120))
     , m_wheelDeltaY(lroundf(wheelTicksY * 120)) // Normalize to the Windows 120 multiple
+    , m_rawDeltaX(rawDeltaX)
+    , m_rawDeltaY(rawDeltaY)
+    , m_granularity(granularity)
 {
 }
 
-void WheelEvent::initWheelEvent(int wheelDeltaX, int wheelDeltaY, PassRefPtr<AbstractView> view,
+void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view,
                                 int screenX, int screenY, int pageX, int pageY,
                                 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
 {
@@ -60,12 +67,25 @@
     m_altKey = altKey;
     m_shiftKey = shiftKey;
     m_metaKey = metaKey;
-    m_wheelDeltaX = wheelDeltaX;
-    m_wheelDeltaY = wheelDeltaY;
+    
+    // Normalize to the Windows 120 multiple
+    m_wheelDeltaX = rawDeltaX * 120;
+    m_wheelDeltaY = rawDeltaY * 120;
+    
+    m_rawDeltaX = rawDeltaX;
+    m_rawDeltaY = rawDeltaY;
+    m_granularity = Pixel;
     
     initCoordinates(pageX, pageY);
 }
 
+void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view,
+                                      int screenX, int screenY, int pageX, int pageY,
+                                      bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+{
+    initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY,
+                   ctrlKey, altKey, shiftKey, metaKey);
+}
 
 bool WheelEvent::isWheelEvent() const
 {
diff --git a/WebCore/dom/WheelEvent.h b/WebCore/dom/WheelEvent.h
index 04d5421..b085e86 100644
--- a/WebCore/dom/WheelEvent.h
+++ b/WebCore/dom/WheelEvent.h
@@ -2,7 +2,7 @@
  * Copyright (C) 2001 Peter Kelly (pmk@post.com)
  * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
  * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -31,39 +31,55 @@
     // extension: mouse wheel event
     class WheelEvent : public MouseRelatedEvent {
     public:
+        enum Granularity { Pixel, Line, Page };
+
         static PassRefPtr<WheelEvent> create()
         {
             return adoptRef(new WheelEvent);
         }
-        static PassRefPtr<WheelEvent> create(float wheelTicksX, float wheelTicksY, PassRefPtr<AbstractView> view,
+        static PassRefPtr<WheelEvent> create(float wheelTicksX, float wheelTicksY,
+            float rawDeltaX, float rawDeltaY, Granularity granularity, PassRefPtr<AbstractView> view,
             int screenX, int screenY, int pageX, int pageY,
             bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
         {
-            return adoptRef(new WheelEvent(wheelTicksX, wheelTicksY, view, screenX, screenY, pageX, pageY,
+            return adoptRef(new WheelEvent(wheelTicksX, wheelTicksY, rawDeltaX, rawDeltaY,
+                granularity, view, screenX, screenY, pageX, pageY,
                 ctrlKey, altKey, shiftKey, metaKey));
         }
 
-        void initWheelEvent(int wheelDeltaX, int wheelDeltaY, PassRefPtr<AbstractView>,
+        void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
                             int screenX, int screenY, int pageX, int pageY,
                             bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
 
+        void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
+                                  int screenX, int screenY, int pageX, int pageY,
+                                  bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
+
         int wheelDelta() const { if (m_wheelDeltaY == 0) return m_wheelDeltaX; return m_wheelDeltaY; }
         int wheelDeltaX() const { return m_wheelDeltaX; }
         int wheelDeltaY() const { return m_wheelDeltaY; }
+        int rawDeltaX() const { return m_rawDeltaX; }
+        int rawDeltaY() const { return m_rawDeltaY; }
+        Granularity granularity() const { return m_granularity; }
 
         // Needed for Objective-C legacy support
         bool isHorizontal() const { return m_wheelDeltaX; }
 
     private:
         WheelEvent();
-        WheelEvent(float wheelTicksX, float wheelTicksY, PassRefPtr<AbstractView>,
+        WheelEvent(float wheelTicksX, float wheelTicksY, float rawDeltaX, float rawDeltaY,
+                   Granularity granularity, PassRefPtr<AbstractView>,
                    int screenX, int screenY, int pageX, int pageY,
                    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
 
         virtual bool isWheelEvent() const;
-
+        
         int m_wheelDeltaX;
         int m_wheelDeltaY;
+
+        int m_rawDeltaX;
+        int m_rawDeltaY;
+        Granularity m_granularity;
     };
 
 } // namespace WebCore
diff --git a/WebCore/dom/WheelEvent.idl b/WebCore/dom/WheelEvent.idl
index a8481a0..4c709ce 100644
--- a/WebCore/dom/WheelEvent.idl
+++ b/WebCore/dom/WheelEvent.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
@@ -57,6 +57,19 @@
                             in boolean shiftKey,
                             in boolean metaKey);
 #endif /* !defined(LANGUAGE_JAVASCRIPT) */
-    };
 
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+        void initWebKitWheelEvent(in long wheelDeltaX,
+                                  in long wheelDeltaY, 
+                                  in DOMWindow view, 
+                                  in long screenX,
+                                  in long screenY,
+                                  in long clientX,
+                                  in long clientY,
+                                  in boolean ctrlKey,
+                                  in boolean altKey,
+                                  in boolean shiftKey,
+                                  in boolean metaKey);
+#endif /* defined(LANGUAGE_JAVASCRIPT) */
+    };
 }
diff --git a/WebCore/dom/XMLTokenizer.cpp b/WebCore/dom/XMLTokenizer.cpp
index 1c43322..818dacd 100644
--- a/WebCore/dom/XMLTokenizer.cpp
+++ b/WebCore/dom/XMLTokenizer.cpp
@@ -27,7 +27,6 @@
 #include "XMLTokenizer.h"
 
 #include "CDATASection.h"
-#include "CString.h"
 #include "CachedScript.h"
 #include "Comment.h"
 #include "DocLoader.h"
@@ -51,7 +50,7 @@
 #include "ScriptSourceCode.h"
 #include "ScriptValue.h"
 #include "TextResourceDecoder.h"
-#include <wtf/Platform.h>
+#include <wtf/text/CString.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
@@ -68,6 +67,7 @@
 using namespace HTMLNames;
 
 const int maxErrors = 25;
+const size_t maxNestingDepth = 4096;
 
 #if ENABLE(WML)
 bool XMLTokenizer::isWMLDocument() const
@@ -87,6 +87,8 @@
         n->ref();
     m_currentNodeStack.append(m_currentNode);
     m_currentNode = n;
+    if (m_currentNodeStack.size() > maxNestingDepth)
+        handleError(fatal, "Excessive node nesting.", lineNumber(), columnNumber());
 }
 
 void XMLTokenizer::popCurrentNode()
@@ -206,7 +208,11 @@
 void XMLTokenizer::end()
 {
     doEnd();
-    
+
+    // doEnd() could process a script tag, thus pausing parsing.
+    if (m_parserPaused)
+        return;
+
     if (m_sawError)
         insertErrorMessageBlock();
     else {
diff --git a/WebCore/dom/XMLTokenizerLibxml2.cpp b/WebCore/dom/XMLTokenizerLibxml2.cpp
index fcb3718..c0976a9 100644
--- a/WebCore/dom/XMLTokenizerLibxml2.cpp
+++ b/WebCore/dom/XMLTokenizerLibxml2.cpp
@@ -27,7 +27,6 @@
 #include "XMLTokenizer.h"
 
 #include "CDATASection.h"
-#include "CString.h"
 #include "CachedScript.h"
 #include "Comment.h"
 #include "DocLoader.h"
@@ -55,7 +54,7 @@
 #include "XMLTokenizerScope.h"
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
-#include <wtf/Platform.h>
+#include <wtf/text/CString.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Threading.h>
 #include <wtf/UnusedParam.h>
@@ -786,7 +785,7 @@
     }
 
     ScriptController* jsProxy = m_doc->frame() ? m_doc->frame()->script() : 0;
-    if (jsProxy && m_doc->frame()->script()->canExecuteScripts())
+    if (jsProxy && m_doc->frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
         jsProxy->setEventHandlerLineNumber(lineNumber());
 
     handleElementAttributes(newElement.get(), libxmlAttributes, nb_attributes, ec, m_scriptingPermission);
@@ -1059,13 +1058,7 @@
         }
 #endif
 
-#if ENABLE(XHTMLMP)
-        m_doc->addChild(DocumentType::create(m_doc, dtdName, extId, toString(systemID)));
-#elif ENABLE(WML)
-        m_doc->addChild(DocumentType::create(m_doc, toString(name), extId, toString(systemID)));
-#else
         m_doc->addChild(DocumentType::create(m_doc, toString(name), toString(externalID), toString(systemID)));
-#endif
     }
 }
 
@@ -1252,7 +1245,7 @@
         || (extId == "-//W3C//DTD XHTML Basic 1.0//EN")
         || (extId == "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN")
         || (extId == "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN")
-#if !ENABLE(XHTMLMP)
+#if ENABLE(XHTMLMP)
         || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.0//EN")
 #endif
        )
@@ -1314,6 +1307,9 @@
     }
 #endif
 
+    if (m_parserStopped)
+        return;
+
     if (m_context) {
         // Tell libxml we're done.
         {
diff --git a/WebCore/dom/XMLTokenizerQt.cpp b/WebCore/dom/XMLTokenizerQt.cpp
index 5335b07..2f76b28 100644
--- a/WebCore/dom/XMLTokenizerQt.cpp
+++ b/WebCore/dom/XMLTokenizerQt.cpp
@@ -27,7 +27,6 @@
 #include "XMLTokenizer.h"
 
 #include "CDATASection.h"
-#include "CString.h"
 #include "CachedScript.h"
 #include "Comment.h"
 #include "DocLoader.h"
@@ -52,10 +51,10 @@
 #include "TextResourceDecoder.h"
 #include "TransformSource.h"
 #include <QDebug>
-#include <wtf/Platform.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 #if ENABLE(XHTMLMP)
 #include "HTMLNames.h"
@@ -329,7 +328,7 @@
     for (int i = 0; i < ns.count(); ++i) {
         const QXmlStreamNamespaceDeclaration &decl = ns[i];
         String namespaceURI = decl.namespaceUri();
-        String namespaceQName = decl.prefix().isEmpty() ? String("xmlns") : String("xmlns:") + decl.prefix();
+        String namespaceQName = decl.prefix().isEmpty() ? String("xmlns") : String("xmlns:") + String(decl.prefix());
         newElement->setAttributeNS("http://www.w3.org/2000/xmlns/", namespaceQName, namespaceURI, ec, scriptingPermission);
         if (ec) // exception setting attributes
             return;
diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl
index 083e309..57006d2 100755
--- a/WebCore/dom/make_names.pl
+++ b/WebCore/dom/make_names.pl
@@ -47,7 +47,14 @@
 my %attrs = ();
 my %parameters = ();
 my $extraDefines = 0;
-my $preprocessor = "/usr/bin/gcc -E -P -x c++";
+require Config;
+my $gccLocation = "";
+if (($Config::Config{'osname'}) =~ /solaris/i) {
+    $gccLocation = "/usr/sfw/bin/gcc";
+} else {
+    $gccLocation = "/usr/bin/gcc";
+}
+my $preprocessor = $gccLocation . " -E -P -x c++";
 
 GetOptions(
     'tags=s' => \$tagsFile, 
@@ -280,8 +287,10 @@
     # Handle media elements.
     if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
         print F <<END
-    if (!MediaPlayer::isAvailable())
+    Settings* settings = document->settings();
+    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
         return HTMLElement::create($constructorTagName, document);
+    
 END
 ;
     }
@@ -491,7 +500,7 @@
 
 
 print F "#include \"$parameters{namespace}Names.h\"\n\n";
-print F "#include \"StaticConstructors.h\"\n";
+print F "#include <wtf/StaticConstructors.h>\n";
 
 print F "namespace WebCore {\n\n namespace $parameters{namespace}Names {
 
@@ -631,7 +640,7 @@
 print F <<END
 #include <wtf/HashMap.h>
 
-#if ENABLE(DASHBOARD_SUPPORT)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(VIDEO)
 #include "Document.h"
 #include "Settings.h"
 #endif
@@ -832,7 +841,8 @@
                 print F <<END
 static JSNode* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
 {
-    if (!MediaPlayer::isAvailable())
+    Settings* settings = element->document()->settings();
+    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
         return CREATE_DOM_NODE_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
     return CREATE_DOM_NODE_WRAPPER(exec, globalObject, ${JSInterfaceName}, element.get());
 }
@@ -850,14 +860,29 @@
 ;
             }
         } elsif ($wrapperFactoryType eq "V8") {
+            if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
+                print F <<END
+static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
+{
+    Settings* settings = element->document()->settings();
+    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
+        return toV8(static_cast<$parameters{namespace}Element*>(element));
+    return toV8(static_cast<${JSInterfaceName}*>(element));
+}
+
+END
+;
+            } else {
             print F <<END
 static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
 {
     return toV8(static_cast<${JSInterfaceName}*>(element));
 }
 
+
 END
 ;
+            }
         }
 
         if ($conditional) {
@@ -888,7 +913,16 @@
 
     printElementIncludes($F);
 
-    print F "\n#include <wtf/StdLibExtras.h>\n\n";
+    print F <<END
+#include <wtf/StdLibExtras.h>
+
+#if ENABLE(VIDEO)
+#include "Document.h"
+#include "Settings.h"
+#endif
+
+END
+;
 
     if ($wrapperFactoryType eq "JS") {    
         print F <<END
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index e9b6971..9dc918d 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -930,8 +930,11 @@
 
     // FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It
     // shouldn't matter though, since moved paragraphs will usually be quite small.
-    RefPtr<DocumentFragment> fragment = startOfParagraphToMove != endOfParagraphToMove ? createFragmentFromMarkup(document(), createMarkup(range.get(), 0, DoNotAnnotateForInterchange, true), "") : 0;
-    
+    RefPtr<DocumentFragment> fragment;
+    // This used to use a ternary for initialization, but that confused some versions of GCC, see bug 37912
+    if (startOfParagraphToMove != endOfParagraphToMove)
+        fragment = createFragmentFromMarkup(document(), createMarkup(range.get(), 0, DoNotAnnotateForInterchange, true), "");
+
     // A non-empty paragraph's style is moved when we copy and move it.  We don't move 
     // anything if we're given an empty paragraph, but an empty paragraph can have style
     // too, <div><b><br></b></div> for example.  Save it so that we can preserve it later.
@@ -950,6 +953,7 @@
     ASSERT(destination.deepEquivalent().node()->inDocument());
 
     cleanupAfterDeletion();
+    ASSERT(destination.deepEquivalent().node()->inDocument());
 
     // Add a br if pruning an empty block level element caused a collapse. For example:
     // foo^
@@ -971,6 +975,7 @@
     destinationIndex = TextIterator::rangeLength(startToDestinationRange.get(), true);
     
     setEndingSelection(destination);
+    ASSERT(endingSelection().isCaretOrRange());
     applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, true, false, !preserveStyle, false, true));
     
     // If the selection is in an empty paragraph, restore styles from the old empty paragraph to the new empty paragraph.
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index d3d9cc9..5e81d50 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -161,6 +161,20 @@
     }
 }
 
+void DeleteSelectionCommand::setStartingSelectionOnSmartDelete(const Position& start, const Position& end)
+{
+    VisiblePosition newBase;
+    VisiblePosition newExtent;
+    if (startingSelection().isBaseFirst()) {
+        newBase = start;
+        newExtent = end;
+    } else {
+        newBase = end;
+        newExtent = start;        
+    }
+    setStartingSelection(VisibleSelection(newBase, newExtent));            
+}
+    
 void DeleteSelectionCommand::initializePositionData()
 {
     Position start, end;
@@ -230,6 +244,8 @@
             m_upstreamStart = pos.upstream();
             m_downstreamStart = pos.downstream();
             m_leadingWhitespace = m_upstreamStart.leadingWhitespacePosition(visiblePos.affinity());
+
+            setStartingSelectionOnSmartDelete(m_upstreamStart, m_upstreamEnd);
         }
         
         // trailing whitespace is only considered for smart delete if there is no leading
@@ -241,6 +257,8 @@
             m_upstreamEnd = pos.upstream();
             m_downstreamEnd = pos.downstream();
             m_trailingWhitespace = m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY);
+
+            setStartingSelectionOnSmartDelete(m_downstreamStart, m_downstreamEnd);
         }
     }
     
diff --git a/WebCore/editing/DeleteSelectionCommand.h b/WebCore/editing/DeleteSelectionCommand.h
index c8872ef..20f52f4 100644
--- a/WebCore/editing/DeleteSelectionCommand.h
+++ b/WebCore/editing/DeleteSelectionCommand.h
@@ -51,6 +51,7 @@
     virtual bool preservesTypingStyle() const;
 
     void initializeStartEnd(Position&, Position&);
+    void setStartingSelectionOnSmartDelete(const Position&, const Position&);
     void initializePositionData();
     void saveTypingStyleState();
     void insertPlaceholderForAncestorBlockContent();
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 1061dd2..e171ac1 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -2703,7 +2703,7 @@
     if (m_shouldStartNewKillRingSequence)
         startNewKillRingSequence();
 
-    String text = m_frame->displayStringModifiedByEncoding(plainText(range));
+    String text = plainText(range);
     if (prepend)
         prependToKillRing(text);
     else
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 437d584..34fa46d 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -257,7 +257,7 @@
     RenderStyle* style = renderer->style();
     if (!style)
         return 0;
-    if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
+    if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focusedNode->isContentEditable()))
         return 0;
     int height = toRenderBox(renderer)->clientHeight();
     return max(max<int>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages()), 1);
diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp
index beb5d08..cd6838b 100644
--- a/WebCore/editing/InsertListCommand.cpp
+++ b/WebCore/editing/InsertListCommand.cpp
@@ -259,9 +259,16 @@
             // Update the start of content, so we don't try to move the list into itself.  bug 19066
             if (insertionPos == start.deepEquivalent())
                 start = startOfParagraph(originalStart);
+            previousList = outermostEnclosingList(previousPosition.deepEquivalent().node(), enclosingList(listElement.get()));
+            nextList = outermostEnclosingList(nextPosition.deepEquivalent().node(), enclosingList(listElement.get()));
         }
         moveParagraph(start, end, VisiblePosition(Position(placeholder.get(), 0)), true);
-        if (nextList && previousList)
+        if (m_listElement) {
+            if (canMergeLists(previousList, m_listElement.get()))
+                mergeIdenticalElements(previousList, m_listElement.get());
+            if (canMergeLists(m_listElement.get(), nextList))
+                mergeIdenticalElements(m_listElement.get(), nextList);
+        } else if (canMergeLists(nextList, previousList))
             mergeIdenticalElements(previousList, nextList);
     }
 }
diff --git a/WebCore/editing/MoveSelectionCommand.cpp b/WebCore/editing/MoveSelectionCommand.cpp
index 0a2d3f4..62f638f 100644
--- a/WebCore/editing/MoveSelectionCommand.cpp
+++ b/WebCore/editing/MoveSelectionCommand.cpp
@@ -31,8 +31,8 @@
 
 namespace WebCore {
 
-MoveSelectionCommand::MoveSelectionCommand(PassRefPtr<DocumentFragment> fragment, const Position& position, bool smartMove) 
-    : CompositeEditCommand(position.node()->document()), m_fragment(fragment), m_position(position), m_smartMove(smartMove)
+MoveSelectionCommand::MoveSelectionCommand(PassRefPtr<DocumentFragment> fragment, const Position& position, bool smartInsert, bool smartDelete) 
+    : CompositeEditCommand(position.node()->document()), m_fragment(fragment), m_position(position), m_smartInsert(smartInsert), m_smartDelete(smartDelete)
 {
     ASSERT(m_fragment);
 }
@@ -60,7 +60,7 @@
         pos = Position(positionNode, positionOffset);
     }
 
-    deleteSelection(m_smartMove);
+    deleteSelection(m_smartDelete);
 
     // If the node for the destination has been removed as a result of the deletion,
     // set the destination to the ending point after the deletion.
@@ -74,7 +74,7 @@
         // Document was modified out from under us.
         return;
     }
-    applyCommandToComposite(ReplaceSelectionCommand::create(positionNode->document(), m_fragment, true, m_smartMove));
+    applyCommandToComposite(ReplaceSelectionCommand::create(positionNode->document(), m_fragment, true, m_smartInsert));
 }
 
 EditAction MoveSelectionCommand::editingAction() const
diff --git a/WebCore/editing/MoveSelectionCommand.h b/WebCore/editing/MoveSelectionCommand.h
index 253c02c..6780caa 100644
--- a/WebCore/editing/MoveSelectionCommand.h
+++ b/WebCore/editing/MoveSelectionCommand.h
@@ -34,20 +34,21 @@
 
 class MoveSelectionCommand : public CompositeEditCommand {
 public:
-    static PassRefPtr<MoveSelectionCommand> create(PassRefPtr<DocumentFragment> fragment, const Position& position, bool smartMove = false)
+    static PassRefPtr<MoveSelectionCommand> create(PassRefPtr<DocumentFragment> fragment, const Position& position, bool smartInsert = false, bool smartDelete = false)
     {
-        return adoptRef(new MoveSelectionCommand(fragment, position, smartMove));
+        return adoptRef(new MoveSelectionCommand(fragment, position, smartInsert, smartDelete));
     }
 
 private:
-    MoveSelectionCommand(PassRefPtr<DocumentFragment>, const Position&, bool smartMove);
+    MoveSelectionCommand(PassRefPtr<DocumentFragment>, const Position&, bool smartInsert, bool smartDelete);
 
     virtual void doApply();
     virtual EditAction editingAction() const;
     
     RefPtr<DocumentFragment> m_fragment;
     Position m_position;
-    bool m_smartMove;
+    bool m_smartInsert;
+    bool m_smartDelete;
 };
 
 } // namespace WebCore
diff --git a/WebCore/editing/ReplaceSelectionCommand.cpp b/WebCore/editing/ReplaceSelectionCommand.cpp
index bac090c..e4acf85 100644
--- a/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -104,6 +104,22 @@
            static_cast<const HTMLElement *>(node)->getAttribute(classAttr) == convertedSpaceSpanClassString;
 }
 
+static Position positionAvoidingPrecedingNodes(Position pos)
+{
+    // If we're already on a break, it's probably a placeholder and we shouldn't change our position.
+    if (pos.node()->hasTagName(brTag))
+        return pos;
+
+    // We also stop when changing block flow elements because even though the visual position is the
+    // same.  E.g.,
+    //   <div>foo^</div>^
+    // The two positions above are the same visual position, but we want to stay in the same block.
+    Node* stopNode = pos.node()->enclosingBlockFlowElement();
+    while (stopNode != pos.node() && VisiblePosition(pos) == VisiblePosition(pos.next()))
+        pos = pos.next();
+    return pos;
+}
+
 ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* fragment, bool matchStyle, const VisibleSelection& selection)
     : m_document(document),
       m_fragment(fragment),
@@ -885,7 +901,12 @@
         frame->clearTypingStyle();
     
     bool handledStyleSpans = handleStyleSpansBeforeInsertion(fragment, insertionPos);
-    
+
+    // We don't want the destination to end up inside nodes that weren't selected.  To avoid that, we move the
+    // position forward without changing the visible position so we're still at the same visible location, but
+    // outside of preceding tags.
+    insertionPos = positionAvoidingPrecedingNodes(insertionPos);
+
     // FIXME: When pasting rich content we're often prevented from heading down the fast path by style spans.  Try
     // again here if they've been removed.
     
@@ -1170,26 +1191,34 @@
 
     bool isStart = isStartOfParagraph(insertPos);
     bool isEnd = isEndOfParagraph(insertPos);
-
+    bool isMiddle = !isStart && !isEnd;
     Node* lastNode = insertionBlock;
+
+    // If we're in the middle of a list item, we should split it into two separate
+    // list items and insert these nodes between them.
+    if (isMiddle) {
+        int textNodeOffset = insertPos.offsetInContainerNode();
+        if (insertPos.node()->isTextNode() && textNodeOffset > 0)
+            splitTextNode(static_cast<Text*>(insertPos.node()), textNodeOffset);
+        splitTreeToNode(insertPos.node(), lastNode, true);
+    }
+
     while (RefPtr<Node> listItem = listElement->firstChild()) {
         ExceptionCode ec = 0;
         listElement->removeChild(listItem.get(), ec);
         ASSERT(!ec);
-        if (isStart)
+        if (isStart || isMiddle)
             insertNodeBefore(listItem, lastNode);
         else if (isEnd) {
             insertNodeAfter(listItem, lastNode);
             lastNode = listItem.get();
-        } else {
-            // FIXME: If we're in the middle of a list item, we should split it into two separate
-            // list items and insert these nodes between them.  For now, just append the nodes.
-            insertNodeAfter(listItem, lastNode);
-            lastNode = listItem.get();
-        }
+        } else
+            ASSERT_NOT_REACHED();
     }
-    if (isStart)
+    if (isStart || isMiddle)
         lastNode = lastNode->previousSibling();
+    if (isMiddle)
+        insertNodeAfter(createListItemElement(document()), lastNode);
     updateNodesInserted(lastNode);
     return lastNode;
 }
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 25982d4..002226d 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "SelectionController.h"
 
-#include "CString.h"
 #include "DeleteSelectionCommand.h"
 #include "Document.h"
 #include "Editor.h"
@@ -47,12 +46,14 @@
 #include "Range.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
+#include "SecureTextInput.h"
 #include "Settings.h"
 #include "TextIterator.h"
 #include "TypingCommand.h"
 #include "htmlediting.h"
 #include "visible_units.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 
 #define EDIT_DEBUG 0
 
@@ -65,16 +66,17 @@
 SelectionController::SelectionController(Frame* frame, bool isDragCaretController)
     : m_frame(frame)
     , m_xPosForVerticalArrowNavigation(NoXPosForVerticalArrowNavigation)
+    , m_granularity(CharacterGranularity)
     , m_caretBlinkTimer(this, &SelectionController::caretBlinkTimerFired)
     , m_needsLayout(true)
     , m_absCaretBoundsDirty(true)
-    , m_lastChangeWasHorizontalExtension(false)
     , m_isDragCaretController(isDragCaretController)
     , m_isCaretBlinkingSuspended(false)
     , m_focused(frame && frame->page() && frame->page()->focusController()->focusedFrame() == frame)
     , m_caretVisible(isDragCaretController)
     , m_caretPaint(true)
 {
+    setIsDirectional(false);
 }
 
 void SelectionController::moveTo(const VisiblePosition &pos, bool userTriggered)
@@ -103,9 +105,11 @@
     setSelection(VisibleSelection(base, extent, affinity), true, true, userTriggered);
 }
 
-void SelectionController::setSelection(const VisibleSelection& s, bool closeTyping, bool clearTypingStyle, bool userTriggered)
+void SelectionController::setSelection(const VisibleSelection& s, bool closeTyping, bool clearTypingStyle, bool userTriggered, TextGranularity granularity)
 {
-    m_lastChangeWasHorizontalExtension = false;
+    m_granularity = granularity;
+
+    setIsDirectional(false);
 
     if (m_isDragCaretController) {
         invalidateCaretRect();
@@ -228,18 +232,35 @@
     if (clearDOMTreeSelection)
         setSelection(VisibleSelection(), false, false);
 }
+    
+void SelectionController::setIsDirectional(bool isDirectional)
+{
+    Settings* settings = m_frame ? m_frame->settings() : 0;
+    m_isDirectional = !settings || settings->editingBehavior() != EditingMacBehavior || isDirectional;
+}
 
 void SelectionController::willBeModified(EAlteration alter, EDirection direction)
 {
     if (alter != EXTEND)
         return;
-    if (m_lastChangeWasHorizontalExtension)
-        return;
 
     Position start = m_selection.start();
     Position end = m_selection.end();
-    // FIXME: This is probably not correct for right and left when the direction is RTL.
-    switch (direction) {
+
+    if (m_isDirectional) {
+        // Make base and extent match start and end so we extend the user-visible selection.
+        // This only matters for cases where base and extend point to different positions than
+        // start and end (e.g. after a double-click to select a word).
+        if (m_selection.isBaseFirst()) {
+            m_selection.setBase(start);
+            m_selection.setExtent(end);            
+        } else {
+            m_selection.setBase(end);
+            m_selection.setExtent(start);
+        }
+    } else {
+        // FIXME: This is probably not correct for right and left when the direction is RTL.
+        switch (direction) {
         case RIGHT:
         case FORWARD:
             m_selection.setBase(start);
@@ -250,6 +271,7 @@
             m_selection.setBase(end);
             m_selection.setExtent(start);
             break;
+        }
     }
 }
 
@@ -350,7 +372,9 @@
             pos = endOfSentence(endForPlatform());
             break;
         case LineBoundary:
-            pos = logicalEndOfLine(endForPlatform());
+            pos = endForPlatform();
+            pos.setAffinity(UPSTREAM);
+            pos = logicalEndOfLine(pos);
             break;
         case ParagraphBoundary:
             pos = endOfParagraph(endForPlatform());
@@ -588,53 +612,61 @@
 
 bool SelectionController::modify(EAlteration alter, EDirection dir, TextGranularity granularity, bool userTriggered)
 {
+    Settings* settings = m_frame ? m_frame->settings() : 0;
+    return modify(alter, dir, granularity, userTriggered, settings);
+}
+    
+static bool isBoundary(TextGranularity granularity)
+{
+    return granularity == LineBoundary || granularity == ParagraphBoundary || granularity == DocumentBoundary;
+}    
+    
+bool SelectionController::modify(EAlteration alter, EDirection direction, TextGranularity granularity, bool userTriggered, Settings* settings)
+{
     if (userTriggered) {
         SelectionController trialSelectionController;
         trialSelectionController.setSelection(m_selection);
-        trialSelectionController.setLastChangeWasHorizontalExtension(m_lastChangeWasHorizontalExtension);
-        trialSelectionController.modify(alter, dir, granularity, false);
+        trialSelectionController.setIsDirectional(m_isDirectional);
+        trialSelectionController.modify(alter, direction, granularity, false, settings);
 
         bool change = m_frame->shouldChangeSelection(trialSelectionController.selection());
         if (!change)
             return false;
     }
 
-    if (m_frame)
-        m_frame->setSelectionGranularity(granularity);
-    
-    willBeModified(alter, dir);
+    willBeModified(alter, direction);
 
-    VisiblePosition pos;
-    switch (dir) {
+    VisiblePosition position;
+    switch (direction) {
         case RIGHT:
             if (alter == MOVE)
-                pos = modifyMovingRight(granularity);
+                position = modifyMovingRight(granularity);
             else
-                pos = modifyExtendingRight(granularity);
+                position = modifyExtendingRight(granularity);
             break;
         case FORWARD:
             if (alter == EXTEND)
-                pos = modifyExtendingForward(granularity);
+                position = modifyExtendingForward(granularity);
             else
-                pos = modifyMovingForward(granularity);
+                position = modifyMovingForward(granularity);
             break;
         case LEFT:
             if (alter == MOVE)
-                pos = modifyMovingLeft(granularity);
+                position = modifyMovingLeft(granularity);
             else
-                pos = modifyExtendingLeft(granularity);
+                position = modifyExtendingLeft(granularity);
             break;
         case BACKWARD:
             if (alter == EXTEND)
-                pos = modifyExtendingBackward(granularity);
+                position = modifyExtendingBackward(granularity);
             else
-                pos = modifyMovingBackward(granularity);
+                position = modifyMovingBackward(granularity);
             break;
     }
 
-    if (pos.isNull())
+    if (position.isNull())
         return false;
-    
+
     // Some of the above operations set an xPosForVerticalArrowNavigation.
     // Setting a selection will clear it, so save it to possibly restore later.
     // Note: the START position type is arbitrary because it is unused, it would be
@@ -643,28 +675,31 @@
 
     switch (alter) {
         case MOVE:
-            moveTo(pos, userTriggered);
+            moveTo(position, userTriggered);
             break;
         case EXTEND:
-            setExtent(pos, userTriggered);
-            break;
+            if (!settings || settings->editingBehavior() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
+                setExtent(position, userTriggered);
+            else {
+                // Standard Mac behavior when extending to a boundary is grow the selection rather
+                // than leaving the base in place and moving the extent. Matches NSTextView.
+                if (direction == FORWARD || direction == RIGHT)
+                    setEnd(position, userTriggered);
+                else
+                    setStart(position, userTriggered);
+            }
     }
     
     if (granularity == LineGranularity || granularity == ParagraphGranularity)
         m_xPosForVerticalArrowNavigation = x;
 
-    if (userTriggered) {
-        // User modified selection change also sets the granularity back to character.
-        // NOTE: The one exception is that we need to keep word granularity to
-        // preserve smart delete behavior when extending by word (e.g. double-click),
-        // then shift-option-right arrow, then delete needs to smart delete, per TextEdit.
-        if (!(alter == EXTEND && granularity == WordGranularity && m_frame->selectionGranularity() == WordGranularity))
-            m_frame->setSelectionGranularity(CharacterGranularity);
-    }
+    if (userTriggered)
+        m_granularity = CharacterGranularity;
+
 
     setNeedsLayout();
 
-    m_lastChangeWasHorizontalExtension = alter == EXTEND;
+    setIsDirectional(alter == EXTEND);
 
     return true;
 }
@@ -687,7 +722,7 @@
     if (userTriggered) {
         SelectionController trialSelectionController;
         trialSelectionController.setSelection(m_selection);
-        trialSelectionController.setLastChangeWasHorizontalExtension(m_lastChangeWasHorizontalExtension);
+        trialSelectionController.setIsDirectional(m_isDirectional);
         trialSelectionController.modify(alter, verticalDistance, false);
 
         bool change = m_frame->shouldChangeSelection(trialSelectionController.selection());
@@ -755,23 +790,13 @@
     }
 
     if (userTriggered)
-        m_frame->setSelectionGranularity(CharacterGranularity);
+        m_granularity = CharacterGranularity;
 
-    m_lastChangeWasHorizontalExtension = alter == EXTEND;
+    setIsDirectional(alter == EXTEND);
 
     return true;
 }
 
-bool SelectionController::expandUsingGranularity(TextGranularity granularity)
-{
-    if (isNone())
-        return false;
-
-    m_selection.expandUsingGranularity(granularity);
-    m_needsLayout = true;
-    return true;
-}
-
 int SelectionController::xPosForVerticalArrowNavigation(EPositionType type)
 {
     int x = 0;
@@ -814,9 +839,26 @@
 
 void SelectionController::clear()
 {
+    m_granularity = CharacterGranularity;
     setSelection(VisibleSelection());
 }
 
+void SelectionController::setStart(const VisiblePosition &pos, bool userTriggered)
+{
+    if (m_selection.isBaseFirst())
+        setBase(pos, userTriggered);
+    else
+        setExtent(pos, userTriggered);
+}
+
+void SelectionController::setEnd(const VisiblePosition &pos, bool userTriggered)
+{
+    if (m_selection.isBaseFirst())
+        setExtent(pos, userTriggered);
+    else
+        setBase(pos, userTriggered);
+}
+
 void SelectionController::setBase(const VisiblePosition &pos, bool userTriggered)
 {
     setSelection(VisibleSelection(pos.deepEquivalent(), m_selection.extent(), pos.affinity()), true, true, userTriggered);
@@ -969,16 +1011,26 @@
     IntRect oldAbsoluteCaretRepaintBounds = m_absoluteCaretRepaintBounds;
     // We believe that we need to inflate the local rect before transforming it to obtain the repaint bounds.
     m_absoluteCaretRepaintBounds = caretRepaintRect();
-    
+
+#if ENABLE(TEXT_CARET)    
     if (RenderView* view = toRenderView(m_frame->document()->renderer())) {
         // FIXME: make caret repainting container-aware.
         view->repaintRectangleInViewAndCompositedLayers(oldAbsoluteCaretRepaintBounds, false);
-        view->repaintRectangleInViewAndCompositedLayers(m_absoluteCaretRepaintBounds, false);
+        if (shouldRepaintCaret(view))
+            view->repaintRectangleInViewAndCompositedLayers(m_absoluteCaretRepaintBounds, false);
     }
-
+#endif
     return true;
 }
 
+bool SelectionController::shouldRepaintCaret(const RenderView* view) const
+{
+    ASSERT(view);
+    Frame* frame = view->frameView() ? view->frameView()->frame() : 0; // The frame where the selection started.
+    bool caretBrowsing = frame && frame->settings() && frame->settings()->caretBrowsingEnabled();
+    return (caretBrowsing || isContentEditable());
+}
+
 void SelectionController::invalidateCaretRect()
 {
     if (!isCaret())
@@ -1004,7 +1056,8 @@
     m_needsLayout = true;
 
     if (!caretRectChanged) {
-        if (RenderView* view = toRenderView(d->renderer()))
+        RenderView* view = toRenderView(d->renderer());
+        if (view && shouldRepaintCaret(view))
             view->repaintRectangleInViewAndCompositedLayers(caretRepaintRect(), false);
     }
 }
@@ -1034,6 +1087,11 @@
     }
 
     context->fillRect(caret, caretColor, colorSpace);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(tx);
+    UNUSED_PARAM(ty);
+    UNUSED_PARAM(clipRect);
 #endif
 }
 
@@ -1311,7 +1369,7 @@
 
     // Secure keyboard entry is set by the active frame.
     if (m_frame->document()->useSecureKeyboardEntryWhenActive())
-        m_frame->setUseSecureKeyboardEntry(activeAndFocused);
+        setUseSecureKeyboardEntry(activeAndFocused);
 }
 
 void SelectionController::pageActivationChanged()
@@ -1319,6 +1377,20 @@
     focusedOrActiveStateChanged();
 }
 
+void SelectionController::updateSecureKeyboardEntryIfActive()
+{
+    if (m_frame->document() && isFocusedAndActive())
+        setUseSecureKeyboardEntry(m_frame->document()->useSecureKeyboardEntryWhenActive());
+}
+
+void SelectionController::setUseSecureKeyboardEntry(bool enable)
+{
+    if (enable)
+        enableSecureTextInput();
+    else
+        disableSecureTextInput();
+}
+
 void SelectionController::setFocused(bool flag)
 {
     if (m_focused == flag)
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 6849cb6..9a407fc 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -37,6 +37,8 @@
 class Frame;
 class GraphicsContext;
 class RenderObject;
+class RenderView;
+class Settings;
 class VisiblePosition;
 
 class SelectionController : public Noncopyable {
@@ -58,7 +60,8 @@
     void moveTo(const Position&, const Position&, EAffinity, bool userTriggered = false);
 
     const VisibleSelection& selection() const { return m_selection; }
-    void setSelection(const VisibleSelection&, bool closeTyping = true, bool clearTypingStyle = true, bool userTriggered = false);
+    void setSelection(const VisibleSelection&, bool closeTyping = true, bool clearTypingStyle = true, bool userTriggered = false, TextGranularity = CharacterGranularity);
+    void setSelection(const VisibleSelection& selection, TextGranularity granularity) { setSelection(selection, true, true, false, granularity); }
     bool setSelectedRange(Range*, EAffinity, bool closeTyping);
     void selectAll();
     void clear();
@@ -74,8 +77,11 @@
 
     bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered = false);
     bool modify(EAlteration, int verticalDistance, bool userTriggered = false);
-    bool expandUsingGranularity(TextGranularity);
+    TextGranularity granularity() const { return m_granularity; }
 
+    void setStart(const VisiblePosition &, bool userTriggered = false);
+    void setEnd(const VisiblePosition &, bool userTriggered = false);
+    
     void setBase(const VisiblePosition&, bool userTriggered = false);
     void setBase(const Position&, EAffinity, bool userTriggered = false);
     void setExtent(const VisiblePosition&, bool userTriggered = false);
@@ -95,7 +101,7 @@
     IntRect absoluteCaretBounds();
     void setNeedsLayout(bool flag = true);
 
-    void setLastChangeWasHorizontalExtension(bool b) { m_lastChangeWasHorizontalExtension = b; }
+    void setIsDirectional(bool);
     void willBeModified(EAlteration, EDirection);
     
     bool isNone() const { return m_selection.isNone(); }
@@ -130,6 +136,8 @@
     // Painting.
     void updateAppearance();
 
+    void updateSecureKeyboardEntryIfActive();
+
 #ifndef NDEBUG
     void formatForDebugger(char* buffer, unsigned length) const;
     void showTreeForThis() const;
@@ -144,6 +152,8 @@
     VisiblePosition startForPlatform() const;
     VisiblePosition endForPlatform() const;
 
+    bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered, Settings*);
+
     VisiblePosition modifyExtendingRight(TextGranularity);
     VisiblePosition modifyExtendingForward(TextGranularity);
     VisiblePosition modifyMovingRight(TextGranularity);
@@ -155,6 +165,7 @@
 
     void layout();
     IntRect caretRepaintRect() const;
+    bool shouldRepaintCaret(const RenderView* view) const;
 
     int xPosForVerticalArrowNavigation(EPositionType);
     
@@ -167,11 +178,14 @@
 
     void caretBlinkTimerFired(Timer<SelectionController>*);
 
+    void setUseSecureKeyboardEntry(bool);
+
     Frame* m_frame;
 
     int m_xPosForVerticalArrowNavigation;
 
     VisibleSelection m_selection;
+    TextGranularity m_granularity;
 
     Timer<SelectionController> m_caretBlinkTimer;
 
@@ -181,7 +195,7 @@
     
     bool m_needsLayout; // true if m_caretRect and m_absCaretBounds need to be calculated
     bool m_absCaretBoundsDirty;
-    bool m_lastChangeWasHorizontalExtension;
+    bool m_isDirectional;
     bool m_isDragCaretController;
     bool m_isCaretBlinkingSuspended;
     bool m_focused;
diff --git a/WebCore/editing/TextAffinity.h b/WebCore/editing/TextAffinity.h
index a5565c7..5310ca9 100644
--- a/WebCore/editing/TextAffinity.h
+++ b/WebCore/editing/TextAffinity.h
@@ -26,8 +26,6 @@
 #ifndef TextAffinity_h
 #define TextAffinity_h
 
-#include <wtf/Platform.h>
-
 #ifdef __OBJC__
 #include <AppKit/NSTextView.h>
 #endif
diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp
index 923f537..e022e3b 100644
--- a/WebCore/editing/TextIterator.cpp
+++ b/WebCore/editing/TextIterator.cpp
@@ -256,10 +256,11 @@
     , m_lastCharacter(0)
     , m_emitCharactersBetweenAllVisiblePositions(false)
     , m_enterTextControls(false)
+    , m_emitsTextWithoutTranscoding(false)
 {
 }
 
-TextIterator::TextIterator(const Range* r, bool emitCharactersBetweenAllVisiblePositions, bool enterTextControls) 
+TextIterator::TextIterator(const Range* r, bool emitCharactersBetweenAllVisiblePositions, bool enterTextControls)
     : m_startContainer(0) 
     , m_startOffset(0)
     , m_endContainer(0)
@@ -269,6 +270,27 @@
     , m_textLength(0)
     , m_emitCharactersBetweenAllVisiblePositions(emitCharactersBetweenAllVisiblePositions)
     , m_enterTextControls(enterTextControls)
+    , m_emitsTextWithoutTranscoding(false)
+{
+    init(r);
+}
+
+TextIterator::TextIterator(const Range* r, TextIteratorBehavior behavior)
+    : m_startContainer(0)
+    , m_startOffset(0)
+    , m_endContainer(0)
+    , m_endOffset(0)
+    , m_positionNode(0)
+    , m_textCharacters(0)
+    , m_textLength(0)
+    , m_emitCharactersBetweenAllVisiblePositions(behavior & TextIteratorBehaviorEmitCharactersBetweenAllVisiblePositions)
+    , m_enterTextControls(behavior & TextIteratorBehaviorEnterTextControls)
+    , m_emitsTextWithoutTranscoding(behavior & TextIteratorBehaviorEmitsTextsWithoutTranscoding)
+{
+    init(r);
+}
+
+void TextIterator::init(const Range* r)
 {
     if (!r)
         return;
@@ -889,7 +911,7 @@
 void TextIterator::emitText(Node* textNode, int textStartOffset, int textEndOffset)
 {
     RenderText* renderer = toRenderText(m_node->renderer());
-    String str = renderer->text();
+    String str = m_emitsTextWithoutTranscoding ? renderer->textWithoutTranscoding() : renderer->text();
     ASSERT(str.characters());
 
     m_positionNode = textNode;
@@ -2037,16 +2059,25 @@
         
         // Fix textRunRange->endPosition(), but only if foundStart || foundEnd, because it is only
         // in those cases that textRunRange is used.
-        if (foundStart || foundEnd) {
+        if (foundEnd) {
             // FIXME: This is a workaround for the fact that the end of a run is often at the wrong
             // position for emitted '\n's.
             if (len == 1 && it.characters()[0] == '\n') {
-                Position runStart = textRunRange->startPosition();
-                Position runEnd = VisiblePosition(runStart).next().deepEquivalent();
-                if (runEnd.isNotNull()) {
+                scope->document()->updateLayoutIgnorePendingStylesheets();
+                it.advance();
+                if (!it.atEnd()) {
+                    RefPtr<Range> range = it.range();
                     ExceptionCode ec = 0;
-                    textRunRange->setEnd(runEnd.node(), runEnd.deprecatedEditingOffset(), ec);
+                    textRunRange->setEnd(range->startContainer(), range->startOffset(), ec);
                     ASSERT(!ec);
+                } else {
+                    Position runStart = textRunRange->startPosition();
+                    Position runEnd = VisiblePosition(runStart).next().deepEquivalent();
+                    if (runEnd.isNotNull()) {
+                        ExceptionCode ec = 0;
+                        textRunRange->setEnd(runEnd.node(), runEnd.deprecatedEditingOffset(), ec);
+                        ASSERT(!ec);
+                    }
                 }
             }
         }
@@ -2095,7 +2126,7 @@
 
 // --------
     
-UChar* plainTextToMallocAllocatedBuffer(const Range* r, unsigned& bufferLength, bool isDisplayString) 
+UChar* plainTextToMallocAllocatedBuffer(const Range* r, unsigned& bufferLength, bool isDisplayString)
 {
     UChar* result = 0;
 
@@ -2107,7 +2138,7 @@
     Vector<TextSegment>* textSegments = 0;
     Vector<UChar> textBuffer;
     textBuffer.reserveInitialCapacity(cMaxSegmentSize);
-    for (TextIterator it(r); !it.atEnd(); it.advance()) {
+    for (TextIterator it(r, isDisplayString ? TextIteratorBehaviorDefault : TextIteratorBehaviorEmitsTextsWithoutTranscoding); !it.atEnd(); it.advance()) {
         if (textBuffer.size() && textBuffer.size() + it.length() > cMaxSegmentSize) {
             UChar* newSegmentBuffer = static_cast<UChar*>(malloc(textBuffer.size() * sizeof(UChar)));
             if (!newSegmentBuffer)
diff --git a/WebCore/editing/TextIterator.h b/WebCore/editing/TextIterator.h
index 44af3e5..abd8161 100644
--- a/WebCore/editing/TextIterator.h
+++ b/WebCore/editing/TextIterator.h
@@ -68,11 +68,19 @@
 // at points where replaced elements break up the text flow.  The text comes back in
 // chunks so as to optimize for performance of the iteration.
 
+enum TextIteratorBehavior {
+    TextIteratorBehaviorDefault = 0,
+    TextIteratorBehaviorEmitCharactersBetweenAllVisiblePositions = 1 << 0,
+    TextIteratorBehaviorEnterTextControls = 1 << 1,
+    TextIteratorBehaviorEmitsTextsWithoutTranscoding = 1 << 2,
+};
+
 class TextIterator {
 public:
     TextIterator();
     explicit TextIterator(const Range*, bool emitCharactersBetweenAllVisiblePositions = false, bool enterTextControls = false);
-    
+    TextIterator(const Range*, TextIteratorBehavior);
+
     bool atEnd() const { return !m_positionNode; }
     void advance();
     
@@ -87,6 +95,7 @@
     static PassRefPtr<Range> subrange(Range* entireRange, int characterOffset, int characterCount);
     
 private:
+    void init(const Range*);
     void exitNode();
     bool shouldRepresentNodeOffsetZero();
     bool shouldEmitSpaceBeforeAndAfterNode(Node*);
@@ -147,6 +156,9 @@
     // moveParagraphs to not clone/destroy moved content.
     bool m_emitCharactersBetweenAllVisiblePositions;
     bool m_enterTextControls;
+
+    // Used when we want texts for copying, pasting, and transposing.
+    bool m_emitsTextWithoutTranscoding;
 };
 
 // Iterates through the DOM range, returning all the text, and 0-length boundaries
diff --git a/WebCore/editing/VisiblePosition.cpp b/WebCore/editing/VisiblePosition.cpp
index 2db6d31..1b4a514 100644
--- a/WebCore/editing/VisiblePosition.cpp
+++ b/WebCore/editing/VisiblePosition.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "VisiblePosition.h"
 
-#include "CString.h"
 #include "Document.h"
 #include "FloatQuad.h"
 #include "HTMLElement.h"
@@ -38,6 +37,7 @@
 #include "htmlediting.h"
 #include "visible_units.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -110,13 +110,7 @@
         return Position();
 
     Position downstreamStart = p.downstream();
-    TextDirection primaryDirection = LTR;
-    for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) {
-        if (r->isBlockFlow()) {
-            primaryDirection = r->style()->direction();
-            break;
-        }
-    }
+    TextDirection primaryDirection = p.primaryDirection();
 
     while (true) {
         InlineBox* box;
@@ -252,13 +246,7 @@
         return Position();
 
     Position downstreamStart = p.downstream();
-    TextDirection primaryDirection = LTR;
-    for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) {
-        if (r->isBlockFlow()) {
-            primaryDirection = r->style()->direction();
-            break;
-        }
-    }
+    TextDirection primaryDirection = p.primaryDirection();
 
     while (true) {
         InlineBox* box;
@@ -462,6 +450,7 @@
     if (!node)
         return Position();
 
+    ASSERT(node->document());
     node->document()->updateLayoutIgnorePendingStylesheets();
 
     Position candidate = position.upstream();
diff --git a/WebCore/editing/VisibleSelection.cpp b/WebCore/editing/VisibleSelection.cpp
index baef2b5..6784631 100644
--- a/WebCore/editing/VisibleSelection.cpp
+++ b/WebCore/editing/VisibleSelection.cpp
@@ -27,7 +27,6 @@
 #include "VisibleSelection.h"
 
 #include "CharacterNames.h"
-#include "CString.h"
 #include "Document.h"
 #include "Element.h"
 #include "htmlediting.h"
@@ -37,13 +36,13 @@
 #include "Range.h"
 
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 #include <stdio.h>
 
 namespace WebCore {
 
 VisibleSelection::VisibleSelection()
     : m_affinity(DOWNSTREAM)
-    , m_granularity(CharacterGranularity)
     , m_selectionType(NoSelection)
     , m_baseIsFirst(true)
 {
@@ -53,7 +52,6 @@
     : m_base(pos)
     , m_extent(pos)
     , m_affinity(affinity)
-    , m_granularity(CharacterGranularity)
 {
     validate();
 }
@@ -62,7 +60,6 @@
     : m_base(base)
     , m_extent(extent)
     , m_affinity(affinity)
-    , m_granularity(CharacterGranularity)
 {
     validate();
 }
@@ -71,7 +68,6 @@
     : m_base(pos.deepEquivalent())
     , m_extent(pos.deepEquivalent())
     , m_affinity(pos.affinity())
-    , m_granularity(CharacterGranularity)
 {
     validate();
 }
@@ -80,7 +76,6 @@
     : m_base(base.deepEquivalent())
     , m_extent(extent.deepEquivalent())
     , m_affinity(base.affinity())
-    , m_granularity(CharacterGranularity)
 {
     validate();
 }
@@ -89,7 +84,6 @@
     : m_base(range->startPosition())
     , m_extent(range->endPosition())
     , m_affinity(affinity)
-    , m_granularity(CharacterGranularity)
 {
     validate();
 }
@@ -190,8 +184,7 @@
     if (isNone())
         return false;
 
-    m_granularity = granularity;
-    validate();
+    validate(granularity);
     return true;
 }
 
@@ -268,7 +261,7 @@
         m_baseIsFirst = comparePositions(m_base, m_extent) <= 0;
 }
 
-void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity()
+void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(TextGranularity granularity)
 {
     if (m_baseIsFirst) {
         m_start = m_base;
@@ -278,7 +271,7 @@
         m_end = m_base;
     }
 
-    switch (m_granularity) {
+    switch (granularity) {
         case CharacterGranularity:
             // Don't do any expansion.
             break;
@@ -408,10 +401,10 @@
         m_affinity = DOWNSTREAM;
 }
 
-void VisibleSelection::validate()
+void VisibleSelection::validate(TextGranularity granularity)
 {
     setBaseAndExtentToDeepEquivalents();
-    setStartAndEndFromBaseAndExtentRespectingGranularity();
+    setStartAndEndFromBaseAndExtentRespectingGranularity(granularity);
     adjustSelectionToAvoidCrossingEditingBoundaries();
     updateSelectionType();
 
@@ -441,7 +434,6 @@
     ASSERT(!extent.isNull());
     ASSERT(base != extent);
     ASSERT(m_affinity == DOWNSTREAM);
-    ASSERT(m_granularity == CharacterGranularity);
     m_base = base;
     m_extent = extent;
     m_baseIsFirst = comparePositions(base, extent) <= 0;
diff --git a/WebCore/editing/VisibleSelection.h b/WebCore/editing/VisibleSelection.h
index bbcecf2..4ce2b92 100644
--- a/WebCore/editing/VisibleSelection.h
+++ b/WebCore/editing/VisibleSelection.h
@@ -81,8 +81,7 @@
     void appendTrailingWhitespace();
 
     bool expandUsingGranularity(TextGranularity granularity);
-    TextGranularity granularity() const { return m_granularity; }
-
+    
     // We don't yet support multi-range selections, so we only ever have one range to return.
     PassRefPtr<Range> firstRange() const;
 
@@ -106,11 +105,11 @@
     void setWithoutValidation(const Position&, const Position&);
 
 private:
-    void validate();
+    void validate(TextGranularity = CharacterGranularity);
 
     // Support methods for validate()
     void setBaseAndExtentToDeepEquivalents();
-    void setStartAndEndFromBaseAndExtentRespectingGranularity();
+    void setStartAndEndFromBaseAndExtentRespectingGranularity(TextGranularity);
     void adjustSelectionToAvoidCrossingEditingBoundaries();
     void updateSelectionType();
 
@@ -125,7 +124,6 @@
     Position m_end;    // Rightmost position when expanded to respect granularity
 
     EAffinity m_affinity;           // the upstream/downstream affinity of the caret
-    TextGranularity m_granularity;  // granularity of start/end selection
 
     // these are cached, can be recalculated by validate()
     SelectionType m_selectionType;    // None, Caret, Range
@@ -134,7 +132,7 @@
 
 inline bool operator==(const VisibleSelection& a, const VisibleSelection& b)
 {
-    return a.start() == b.start() && a.end() == b.end() && a.affinity() == b.affinity() && a.granularity() == b.granularity() && a.isBaseFirst() == b.isBaseFirst();
+    return a.start() == b.start() && a.end() == b.end() && a.affinity() == b.affinity() && a.isBaseFirst() == b.isBaseFirst();
 }
 
 inline bool operator!=(const VisibleSelection& a, const VisibleSelection& b)
diff --git a/WebCore/editing/htmlediting.cpp b/WebCore/editing/htmlediting.cpp
index c0a9b63..b7a062b 100644
--- a/WebCore/editing/htmlediting.cpp
+++ b/WebCore/editing/htmlediting.cpp
@@ -489,6 +489,7 @@
         blockTags.add(h5Tag.localName());
         blockTags.add(h6Tag.localName());
         blockTags.add(headerTag.localName());
+        blockTags.add(hgroupTag.localName());
         blockTags.add(navTag.localName());
         blockTags.add(pTag.localName());
         blockTags.add(preTag.localName());
@@ -811,13 +812,18 @@
     return listChildNode;
 }
 
-HTMLElement* outermostEnclosingList(Node* node)
+HTMLElement* outermostEnclosingList(Node* node, Node* rootList)
 {
     HTMLElement* list = enclosingList(node);
     if (!list)
         return 0;
-    while (HTMLElement* nextList = enclosingList(list))
+
+    while (HTMLElement* nextList = enclosingList(list)) {
+        if (nextList == rootList)
+            break;
         list = nextList;
+    }
+
     return list;
 }
 
diff --git a/WebCore/editing/htmlediting.h b/WebCore/editing/htmlediting.h
index 1559fa5..e60ada9 100644
--- a/WebCore/editing/htmlediting.h
+++ b/WebCore/editing/htmlediting.h
@@ -195,7 +195,7 @@
 PassRefPtr<HTMLElement> createHTMLElement(Document*, const AtomicString&);
 
 HTMLElement* enclosingList(Node*);
-HTMLElement* outermostEnclosingList(Node*);
+HTMLElement* outermostEnclosingList(Node*, Node* rootList = 0);
 HTMLElement* enclosingListChild(Node*);
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp
index dc6cbc2..a2363e6 100644
--- a/WebCore/editing/markup.cpp
+++ b/WebCore/editing/markup.cpp
@@ -970,7 +970,7 @@
     
     Node* body = enclosingNodeWithTag(Position(commonAncestor, 0), bodyTag);
     // FIXME: Do this for all fully selected blocks, not just the body.
-    Node* fullySelectedRoot = body && *VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange() == *updatedRange ? body : 0;
+    Node* fullySelectedRoot = body && areRangesEqual(VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange().get(), updatedRange.get()) ? body : 0;
     RefPtr<CSSMutableStyleDeclaration> fullySelectedRootStyle = fullySelectedRoot ? styleFromMatchedRulesAndInlineDecl(fullySelectedRoot) : 0;
     if (annotate && fullySelectedRoot) {
         if (shouldIncludeWrapperForFullySelectedRoot(fullySelectedRoot, fullySelectedRootStyle.get()))
@@ -1058,11 +1058,7 @@
 
 PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const String& markup, const String& baseURL, FragmentScriptingPermission scriptingPermission)
 {
-    ASSERT(document->documentElement()->isHTMLElement());
-    // FIXME: What if the document element is not an HTML element?
-    HTMLElement *element = static_cast<HTMLElement*>(document->documentElement());
-
-    RefPtr<DocumentFragment> fragment = element->createContextualFragment(markup, scriptingPermission);
+    RefPtr<DocumentFragment> fragment = document->documentElement()->createContextualFragment(markup, scriptingPermission);
 
     if (fragment && !baseURL.isEmpty() && baseURL != blankURL() && baseURL != document->baseURL())
         completeURLs(fragment.get(), baseURL);
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index 84ace83..3d85ad1 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -31,6 +31,7 @@
 #include "HTMLNames.h"
 #include "RenderBlock.h"
 #include "RenderLayer.h"
+#include "RenderObject.h"
 #include "TextBoundaries.h"
 #include "TextBreakIterator.h"
 #include "TextIterator.h"
@@ -253,6 +254,12 @@
     return VisiblePosition(pos, VP_UPSTREAM_IF_POSSIBLE);
 }
 
+static bool canHaveCursor(RenderObject* o)
+{
+    return (o->isText() && toRenderText(o)->linesBoundingBox().height())
+        || (o->isBox() && toRenderBox(o)->borderBoundingBox().height());
+}
+
 // ---------
 
 static unsigned startWordBoundary(const UChar* characters, unsigned length, unsigned offset, BoundarySearchContextAvailability mayHaveMoreContext, bool& needMoreContext)
@@ -569,8 +576,12 @@
     visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
     if (box) {
         root = box->root()->prevRootBox();
-        if (root)
+        // We want to skip zero height boxes.
+        // This could happen in case it is a TrailingFloatsRootInlineBox.
+        if (root && root->height())
             containingBlock = renderer->containingBlock();
+        else
+            root = 0;
     }
 
     if (!root) {
@@ -586,17 +597,20 @@
                 break;
             Position pos(n, caretMinOffset(n));
             if (pos.isCandidate()) {
-                ASSERT(n->renderer());
-                Position maxPos(n, caretMaxOffset(n));
-                maxPos.getInlineBoxAndOffset(DOWNSTREAM, box, ignoredCaretOffset);
-                if (box) {
-                    // previous root line box found
-                    root = box->root();
-                    containingBlock = n->renderer()->containingBlock();
-                    break;
-                }
+                RenderObject* o = n->renderer();
+                ASSERT(o);
+                if (canHaveCursor(o)) {
+                    Position maxPos(n, caretMaxOffset(n));
+                    maxPos.getInlineBoxAndOffset(DOWNSTREAM, box, ignoredCaretOffset);
+                    if (box) {
+                        // previous root line box found
+                        root = box->root();
+                        containingBlock = n->renderer()->containingBlock();
+                        break;
+                    }
 
-                return VisiblePosition(pos, DOWNSTREAM);
+                    return VisiblePosition(pos, DOWNSTREAM);
+                }
             }
             n = previousLeafWithSameEditability(n);
         }
@@ -671,8 +685,12 @@
     visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
     if (box) {
         root = box->root()->nextRootBox();
-        if (root)
+        // We want to skip zero height boxes.
+        // This could happen in case it is a TrailingFloatsRootInlineBox.
+        if (root && root->height())
             containingBlock = renderer->containingBlock();
+        else
+            root = 0;
     }
 
     if (!root) {
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index a7261dd..8881066 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -27,7 +27,6 @@
 #include "CachedPage.h"
 
 #include "CachedFramePlatformData.h"
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "ExceptionCode.h"
 #include "EventNames.h"
@@ -36,6 +35,7 @@
 #include "FrameView.h"
 #include "Logging.h"
 #include "PageTransitionEvent.h"
+#include <wtf/text/CString.h>
 #include <wtf/RefCountedLeakCounter.h>
 
 #if ENABLE(SVG)
@@ -105,7 +105,7 @@
     for (unsigned i = 0; i < m_childFrames.size(); ++i)
         m_childFrames[i]->open();
 
-    m_document->dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), m_document);
+    m_document->enqueuePageshowEvent(PageshowEventPersisted);
 #if ENABLE(TOUCH_EVENTS)
     if (m_document->hasListenerType(Document::TOUCH_LISTENER))
         m_document->page()->chrome()->client()->needTouchEvents(true);
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index d641d4e..03aa450 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -26,13 +26,13 @@
 #include "config.h"
 #include "HistoryItem.h"
 
-#include "CString.h"
 #include "CachedPage.h"
 #include "Document.h"
 #include "IconDatabase.h"
 #include "PageCache.h"
 #include "ResourceRequest.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 
 namespace WebCore {
diff --git a/WebCore/history/qt/HistoryItemQt.cpp b/WebCore/history/qt/HistoryItemQt.cpp
index c5fb069..beb842c 100644
--- a/WebCore/history/qt/HistoryItemQt.cpp
+++ b/WebCore/history/qt/HistoryItemQt.cpp
@@ -20,8 +20,8 @@
 #include "config.h"
 #include "HistoryItem.h"
 
-#include "CString.h"
 #include "FormData.h"
+#include <wtf/text/CString.h>
 
 bool WebCore::HistoryItem::restoreState(QDataStream& in, int version)
 {
diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp
index 0b677ea..83bbdc0 100644
--- a/WebCore/html/Blob.cpp
+++ b/WebCore/html/Blob.cpp
@@ -35,19 +35,84 @@
 
 namespace WebCore {
 
+#if ENABLE(BLOB_SLICE)
+const int Blob::toEndOfFile = -1;
+const double Blob::doNotCheckFileChange = 0;
+#endif
+
 Blob::Blob(const String& path)
     : m_path(path)
+#if ENABLE(BLOB_SLICE)
+    , m_start(0)
+    , m_length(toEndOfFile)
+    , m_snapshotCaptured(false)
+    , m_snapshotSize(0)
+    , m_snapshotModificationTime(doNotCheckFileChange)
+#endif
 {
 }
 
+#if ENABLE(BLOB_SLICE)
+Blob::Blob(const String& path, long long start, long long length, long long snapshotSize, double snapshotModificationTime)
+    : m_path(path)
+    , m_start(start)
+    , m_length(length)
+    , m_snapshotCaptured(true)
+    , m_snapshotSize(snapshotSize)
+    , m_snapshotModificationTime(snapshotModificationTime)
+{
+    ASSERT(start >= 0 && length >= 0 && start + length <= snapshotSize && snapshotModificationTime);
+}
+#endif
+
 unsigned long long Blob::size() const
 {
     // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to
     // come up with an exception to throw if file size is not represetable.
+#if ENABLE(BLOB_SLICE)
+    if (m_snapshotCaptured)
+        return m_length;
+#endif
     long long size;
     if (!getFileSize(m_path, size))
         return 0;
     return static_cast<unsigned long long>(size);
 }
 
+#if ENABLE(BLOB_SLICE)
+PassRefPtr<Blob> Blob::slice(long long start, long long length) const
+{
+    // When we slice a file for the first time, we obtain a snapshot of the file by capturing its current size and modification time.
+    // The modification time will be used to verify if the file has been changed or not, when the underlying data are accessed.
+    long long snapshotSize;
+    double snapshotModificationTime;
+    if (m_snapshotCaptured) {
+        snapshotSize = m_snapshotSize;
+        snapshotModificationTime = m_snapshotModificationTime;
+    } else {
+        // If we fail to retrieve the size or modification time, probably due to that the file has been deleted, an empty blob will be returned.
+        time_t modificationTime;
+        if (!getFileSize(m_path, snapshotSize) || !getFileModificationTime(m_path, modificationTime)) {
+            snapshotSize = 0;
+            snapshotModificationTime = 0;
+        } else
+            snapshotModificationTime = modificationTime;
+    }
+
+    // Clamp the range if it exceeds the size limit.
+    if (start < 0)
+        start = 0;
+    if (length < 0)
+        length = 0;
+
+    if (start > snapshotSize) {
+        start = 0;
+        length = 0;
+    } else if (start + length > snapshotSize)
+        length = snapshotSize - start;
+
+    return adoptRef(new Blob(m_path, m_start + start, length, snapshotSize, snapshotModificationTime));
+}
+#endif
+
 } // namespace WebCore
diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h
index b910e8f..e8b5f3f 100644
--- a/WebCore/html/Blob.h
+++ b/WebCore/html/Blob.h
@@ -33,6 +33,7 @@
 
 #include "ExceptionCode.h"
 #include "PlatformString.h"
+#include <time.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
@@ -40,6 +41,11 @@
 
 class Blob : public RefCounted<Blob> {
 public:
+#if ENABLE(BLOB_SLICE)
+    static const int toEndOfFile;
+    static const double doNotCheckFileChange;
+#endif
+
     static PassRefPtr<Blob> create(const String& path)
     {
         return adoptRef(new Blob(path));
@@ -47,14 +53,47 @@
 
     virtual ~Blob() { }
 
+    virtual bool isFile() const { return false; }
+
+#if ENABLE(BLOB_SLICE)
+    PassRefPtr<Blob> slice(long long start, long long length) const;
+#endif
+
     const String& path() const { return m_path; }
     unsigned long long size() const;
+#if ENABLE(BLOB_SLICE)
+    long long start() const { return m_start; }
+    long long length() const { return m_length; }
+    double modificationTime() const { return m_snapshotModificationTime; }
+#endif
 
 protected:
     Blob(const String& path);
 
 private:
+#if ENABLE(BLOB_SLICE)
+    Blob(const String& path, long long start, long long length, long long snapshotSize, double snapshotModificationTime);
+#endif
+
+    // The underlying path of the file-based blob. 
     String m_path;
+
+#if ENABLE(BLOB_SLICE)
+    // The starting position of the file-based blob.
+    long long m_start;
+
+    // The length of the file-based blob. The value of -1 means to the end of the file.
+    long long m_length;
+
+    // A flag to tell if a snapshot has been captured.
+    bool m_snapshotCaptured;
+
+    // The size of the file when a snapshot is captured. It can be 0 if the file is empty.
+    long long m_snapshotSize;
+
+    // The last modification time of the file when a snapshot is captured. The value of 0 also means that the snapshot is not captured.
+    double m_snapshotModificationTime;
+#endif
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/Blob.idl b/WebCore/html/Blob.idl
index 573be35..8db6064 100644
--- a/WebCore/html/Blob.idl
+++ b/WebCore/html/Blob.idl
@@ -32,6 +32,10 @@
 
     interface Blob {
         readonly attribute unsigned long long size;
+        
+#if defined(ENABLE_BLOB_SLICE) && ENABLE_BLOB_SLICE
+        Blob slice(in long long start, in long long length);
+#endif
     };
 
 }
diff --git a/WebCore/html/DOMFormData.cpp b/WebCore/html/DOMFormData.cpp
new file mode 100644
index 0000000..f848898
--- /dev/null
+++ b/WebCore/html/DOMFormData.cpp
@@ -0,0 +1,57 @@
+/*
+ * 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 "DOMFormData.h"
+
+#include "Blob.h"
+#include "PlatformString.h"
+#include "TextEncoding.h"
+
+namespace WebCore {
+
+DOMFormData::DOMFormData(const TextEncoding& encoding)
+    : FormDataList(encoding)
+{
+}
+
+void DOMFormData::append(const String& name, const String& value)
+{
+    if (!name.isEmpty())
+        appendData(name, value);
+}
+
+void DOMFormData::append(const String& name, Blob* blob)
+{
+    if (!name.isEmpty())
+        appendBlob(name, blob);
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DOMFormData.h b/WebCore/html/DOMFormData.h
new file mode 100644
index 0000000..f071d4a
--- /dev/null
+++ b/WebCore/html/DOMFormData.h
@@ -0,0 +1,58 @@
+/*
+ * 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 DOMFormData_h
+#define DOMFormData_h
+
+#include "FormDataList.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob;
+class String;
+class TextEncoding;
+
+class DOMFormData : public FormDataList, public RefCounted<DOMFormData> {
+public:
+    static PassRefPtr<DOMFormData> create() { return adoptRef(new DOMFormData(UTF8Encoding())); }
+    static PassRefPtr<DOMFormData> create(const TextEncoding& encoding) { return adoptRef(new DOMFormData(encoding)); }
+
+    void append(const String& name, const String& value);
+    void append(const String& name, Blob*);
+
+private:
+    DOMFormData(const TextEncoding&);
+};
+
+} // namespace WebCore
+
+#endif // DOMFormData_h
diff --git a/WebCore/html/DOMFormData.idl b/WebCore/html/DOMFormData.idl
new file mode 100644
index 0000000..c339381
--- /dev/null
+++ b/WebCore/html/DOMFormData.idl
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+module html {
+
+    interface [
+        CanBeConstructed,
+        GenerateNativeConverter,
+        GenerateToJS
+    ] DOMFormData {
+        // void append(DOMString name, Blob value);
+        [Custom] void append(in DOMString name, in DOMString value);
+    };
+
+}
diff --git a/WebCore/html/DateComponents.cpp b/WebCore/html/DateComponents.cpp
index 9c62d30..39dd733 100644
--- a/WebCore/html/DateComponents.cpp
+++ b/WebCore/html/DateComponents.cpp
@@ -145,8 +145,8 @@
 static bool beforeGregorianStartDate(int year, int month, int monthDay)
 {
     return year < gregorianStartYear
-        || year == gregorianStartYear && month < gregorianStartMonth
-        || year == gregorianStartYear && month == gregorianStartMonth && monthDay < gregorianStartDay;
+        || (year == gregorianStartYear && month < gregorianStartMonth)
+        || (year == gregorianStartYear && month == gregorianStartMonth && monthDay < gregorianStartDay);
 }
 
 bool DateComponents::addDay(int dayDiff)
diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp
index 25e28e4..97fdc45 100644
--- a/WebCore/html/File.cpp
+++ b/WebCore/html/File.cpp
@@ -27,6 +27,7 @@
 #include "File.h"
 
 #include "FileSystem.h"
+#include "MIMETypeRegistry.h"
 
 namespace WebCore {
 
@@ -34,6 +35,10 @@
     : Blob(path)
     , m_name(pathGetFileName(path))
 {
+    // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure.
+    int index = m_name.reverseFind('.');
+    if (index != -1)
+        m_type = MIMETypeRegistry::getMIMETypeForExtension(m_name.substring(index + 1));
 }
 
 } // namespace WebCore
diff --git a/WebCore/html/File.h b/WebCore/html/File.h
index be53e30..065dd86 100644
--- a/WebCore/html/File.h
+++ b/WebCore/html/File.h
@@ -39,7 +39,10 @@
         return adoptRef(new File(path));
     }
 
+    virtual bool isFile() const { return true; }
+
     const String& name() const { return m_name; }
+    const String& type() const { return m_type; }
 
     // FIXME: obsolete attributes. To be removed.
     const String& fileName() const { return m_name; }
@@ -49,6 +52,7 @@
     File(const String& path);
 
     String m_name;
+    String m_type;
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/File.idl b/WebCore/html/File.idl
index 2632a4d..94287ff 100644
--- a/WebCore/html/File.idl
+++ b/WebCore/html/File.idl
@@ -30,6 +30,7 @@
         GenerateToJS
     ] File : Blob {
         readonly attribute DOMString name;
+        readonly attribute DOMString type;
 
         // FIXME: obsolete attributes. To be removed.
         readonly attribute DOMString fileName;
diff --git a/WebCore/html/FileStream.cpp b/WebCore/html/FileStream.cpp
new file mode 100644
index 0000000..84a28d6
--- /dev/null
+++ b/WebCore/html/FileStream.cpp
@@ -0,0 +1,105 @@
+/*
+ * 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(FILE_READER) || ENABLE(FILE_WRITER)
+
+#include "FileStream.h"
+
+#include "Blob.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+FileStream::FileStream(FileStreamClient* client)
+    : m_client(client)
+    , m_handle(invalidPlatformFileHandle)
+{
+}
+
+FileStream::~FileStream()
+{
+    ASSERT(!isHandleValid(m_handle));
+}
+
+void FileStream::start()
+{
+    ASSERT(!isMainThread());
+    m_client->didStart();
+}
+
+void FileStream::stop()
+{
+    ASSERT(!isMainThread());
+    close();
+    m_client->didStop();
+}
+
+void FileStream::openForRead(Blob*)
+{
+    ASSERT(!isMainThread());
+    // FIXME: to be implemented.
+}
+
+void FileStream::openForWrite(const String&)
+{
+    ASSERT(!isMainThread());
+    // FIXME: to be implemented.
+}
+
+void FileStream::close()
+{
+    ASSERT(!isMainThread());
+    if (isHandleValid(m_handle))
+        closeFile(m_handle);
+}
+
+void FileStream::read(char*, int)
+{
+    ASSERT(!isMainThread());
+    // FIXME: to be implemented.
+}
+
+void FileStream::write(Blob*, long long, int)
+{
+    ASSERT(!isMainThread());
+    // FIXME: to be implemented.
+}
+
+void FileStream::truncate(long long)
+{
+    ASSERT(!isMainThread());
+    // FIXME: to be implemented.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER) || ENABLE_FILE_READER)
diff --git a/WebCore/html/FileStream.h b/WebCore/html/FileStream.h
new file mode 100644
index 0000000..bda8fc7
--- /dev/null
+++ b/WebCore/html/FileStream.h
@@ -0,0 +1,76 @@
+/*
+ * 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 FileStream_h
+#define FileStream_h
+
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#include "FileStreamClient.h"
+#include "FileSystem.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob;
+class String;
+
+// All methods are synchronous and should be called on File or Worker thread.
+class FileStream : public RefCounted<FileStream> {
+public:
+    static PassRefPtr<FileStream> create(FileStreamClient* client)
+    {
+        return adoptRef(new FileStream(client));
+    }
+    virtual ~FileStream();
+
+    void start();
+    void stop();
+
+    void openForRead(Blob*);
+    void openForWrite(const String& path);
+    void close();
+    void read(char* buffer, int length);
+    void write(Blob* blob, long long position, int length);
+    void truncate(long long position);
+
+private:
+    FileStream(FileStreamClient*);
+
+    FileStreamClient* m_client;
+    PlatformFileHandle m_handle;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#endif // FileStream_h
diff --git a/WebCore/html/FileStreamClient.h b/WebCore/html/FileStreamClient.h
new file mode 100644
index 0000000..e1aec53
--- /dev/null
+++ b/WebCore/html/FileStreamClient.h
@@ -0,0 +1,64 @@
+/*
+ * 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 FileStreamClient_h
+#define FileStreamClient_h
+
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#include "ExceptionCode.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class FileStreamClient {
+public:
+    // For reading.
+    virtual void didRead(const char*, int) { }
+
+    // For writing.
+    virtual void didWrite(int) { }
+
+    // For both reading and writing.
+    virtual void didStart() { }
+    virtual void didStop() { }
+    virtual void didFinish() { }
+    virtual void didFail(ExceptionCode) { }
+    virtual void didGetSize(long long) { }
+
+protected:
+    virtual ~FileStreamClient() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#endif // FileStreamClient_h
diff --git a/WebCore/html/FileStreamProxy.cpp b/WebCore/html/FileStreamProxy.cpp
new file mode 100644
index 0000000..6b41f32
--- /dev/null
+++ b/WebCore/html/FileStreamProxy.cpp
@@ -0,0 +1,193 @@
+/*
+ * 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(FILE_READER) || ENABLE(FILE_WRITER)
+
+#include "FileStreamProxy.h"
+
+#include "Blob.h"
+#include "FileStream.h"
+#include "FileThread.h"
+#include "FileThreadTask.h"
+#include "GenericWorkerTask.h"
+#include "PlatformString.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+FileStreamProxy::FileStreamProxy(ScriptExecutionContext* context, FileStreamClient* client)
+    : m_context(context)
+    , m_client(client)
+    , m_stream(FileStream::create(this))
+{
+    // Holds an extra ref so that the instance will not get deleted while there can be any tasks on the file thread.
+    ref();
+
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::start));
+}
+
+FileStreamProxy::~FileStreamProxy()
+{
+}
+
+void FileStreamProxy::openForRead(Blob* blob)
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::openForRead, blob));
+}
+
+void FileStreamProxy::openForWrite(const String& path)
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::openForWrite, path));
+}
+
+void FileStreamProxy::close()
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::close));
+}
+
+void FileStreamProxy::read(char* buffer, int length)
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::read, buffer, length));
+}
+
+void FileStreamProxy::write(Blob* blob, long long position, int length)
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::write, blob, position, length));
+}
+
+void FileStreamProxy::truncate(long long position)
+{
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::truncate, position));
+}
+
+FileThread* FileStreamProxy::fileThread()
+{
+    ASSERT(m_context->isContextThread());
+    ASSERT(m_context->fileThread());
+    return m_context->fileThread();
+}
+
+void FileStreamProxy::stop()
+{
+    // Clear the client so that we won't be calling callbacks on the client.
+    m_client = 0;
+
+    fileThread()->unscheduleTasks(m_stream.get());
+    fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::stop));
+}
+
+static void notifyGetSizeOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, long long size)
+{
+    if (proxy->client())
+        proxy->client()->didGetSize(size);
+}
+
+void FileStreamProxy::didGetSize(long long size)
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyGetSizeOnContext, this, size));
+}
+
+static void notifyReadOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, const char* data, int bytesRead)
+{
+    if (proxy->client())
+        proxy->client()->didRead(data, bytesRead);
+}
+
+void FileStreamProxy::didRead(const char* data, int bytesRead)
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyReadOnContext, this, data, bytesRead));
+}
+
+static void notifyWriteOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, int bytesWritten)
+{
+    if (proxy->client())
+        proxy->client()->didWrite(bytesWritten);
+}
+
+void FileStreamProxy::didWrite(int bytesWritten)
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyWriteOnContext, this, bytesWritten));
+}
+
+static void notifyStartOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+{
+    if (proxy->client())
+        proxy->client()->didStart();
+}
+
+void FileStreamProxy::didStart()
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyStartOnContext, this));
+}
+
+static void notifyFinishOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+{
+    if (proxy->client())
+        proxy->client()->didFinish();
+}
+
+void FileStreamProxy::didFinish()
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyFinishOnContext, this));
+}
+
+static void notifyFailOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, ExceptionCode ec)
+{
+    if (proxy->client())
+        proxy->client()->didFail(ec);
+}
+
+void FileStreamProxy::didFail(ExceptionCode ec)
+{
+    ASSERT(!m_context->isContextThread());
+    m_context->postTask(createCallbackTask(&notifyFailOnContext, this, ec));
+}
+
+static void derefProxyOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+{
+    ASSERT(proxy->hasOneRef());
+    proxy->deref();
+}
+
+void FileStreamProxy::didStop()
+{
+    m_context->postTask(createCallbackTask(&derefProxyOnContext, this));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER)
diff --git a/WebCore/html/FileStreamProxy.h b/WebCore/html/FileStreamProxy.h
new file mode 100644
index 0000000..308da15
--- /dev/null
+++ b/WebCore/html/FileStreamProxy.h
@@ -0,0 +1,95 @@
+/*
+ * 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 FileStreamProxy_h
+#define FileStreamProxy_h
+
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#include "ExceptionCode.h"
+#include "FileStreamClient.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Blob;
+class FileStream;
+class FileThread;
+class ScriptExecutionContext;
+class String;
+
+// A proxy module that calls corresponding FileStream methods on the file thread.  Note: you must call stop() first and then release the reference to destruct the FileStreamProxy instance.
+class FileStreamProxy : public RefCounted<FileStreamProxy>, public FileStreamClient {
+public:
+    static PassRefPtr<FileStreamProxy> create(ScriptExecutionContext* context, FileStreamClient* client)
+    {
+        return adoptRef(new FileStreamProxy(context, client));
+    }
+    virtual ~FileStreamProxy();
+
+    void openForRead(Blob* blob);
+    void openForWrite(const String& path);
+    void close();
+    void read(char* buffer, int length);
+    void write(Blob* blob, long long position, int length);
+    void truncate(long long position);
+
+    // Stops the proxy and scedules it to be destructed.  All the pending tasks will be aborted and the file stream will be closed.
+    // Note: the caller should deref the instance immediately after calling stop().
+    void stop();
+
+    FileStreamClient* client() const { return m_client; }
+
+private:
+    FileStreamProxy(ScriptExecutionContext*, FileStreamClient*);
+
+    // FileStreamClient methods.
+    virtual void didGetSize(long long);
+    virtual void didRead(const char*, int);
+    virtual void didWrite(int);
+    virtual void didFinish();
+    virtual void didFail(ExceptionCode);
+    virtual void didStart();
+    virtual void didStop();
+
+    FileThread* fileThread();
+
+    RefPtr<ScriptExecutionContext> m_context;
+    FileStreamClient* m_client;
+    RefPtr<FileStream> m_stream;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+
+#endif // FileStreamProxy_h
diff --git a/WebCore/html/FileThread.cpp b/WebCore/html/FileThread.cpp
new file mode 100644
index 0000000..02b1718
--- /dev/null
+++ b/WebCore/html/FileThread.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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(FILE_WRITER) || ENABLE(FILE_READER)
+
+#include "FileThread.h"
+
+#include "AutodrainedPool.h"
+#include "Logging.h"
+
+namespace WebCore {
+
+FileThread::FileThread()
+    : m_threadID(0)
+{
+    m_selfRef = this;
+}
+
+FileThread::~FileThread()
+{
+    ASSERT(m_queue.killed());
+}
+
+bool FileThread::start()
+{
+    MutexLocker lock(m_threadCreationMutex);
+    if (m_threadID)
+        return true;
+    m_threadID = createThread(FileThread::fileThreadStart, this, "WebCore: File");
+    return m_threadID;
+}
+
+void FileThread::stop()
+{
+    return m_queue.kill();
+}
+
+void FileThread::postTask(PassOwnPtr<Task> task)
+{
+    m_queue.append(task);
+}
+
+class SameFilePredicate {
+public:
+    SameFilePredicate(const FileStream* stream) : m_stream(stream) { }
+    bool operator()(FileThread::Task* task) const { return task->stream() == m_stream; }
+private:
+    const FileStream* m_stream;
+};
+
+void FileThread::unscheduleTasks(const FileStream* stream)
+{
+    SameFilePredicate predicate(stream);
+    m_queue.removeIf(predicate);
+}
+
+void* FileThread::fileThreadStart(void* arg)
+{
+    FileThread* fileThread = static_cast<FileThread*>(arg);
+    return fileThread->runLoop();
+}
+
+void* FileThread::runLoop()
+{
+    {
+        // Wait for FileThread::start() to complete to have m_threadID
+        // established before starting the main loop.
+        MutexLocker lock(m_threadCreationMutex);
+        LOG(FileAPI, "Started FileThread %p", this);
+    }
+
+    AutodrainedPool pool;
+    while (OwnPtr<Task> task = m_queue.waitForMessage()) {
+        task->performTask();
+        pool.cycle();
+    }
+
+    LOG(FileAPI, "About to detach thread %i and clear the ref to FileThread %p, which currently has %i ref(s)", m_threadID, this, refCount());
+
+    detachThread(m_threadID);
+
+    // Clear the self refptr, possibly resulting in deletion
+    m_selfRef = 0;
+
+    return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
diff --git a/WebCore/html/FileThread.h b/WebCore/html/FileThread.h
new file mode 100644
index 0000000..d27273a
--- /dev/null
+++ b/WebCore/html/FileThread.h
@@ -0,0 +1,83 @@
+/*
+ * 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 FileThread_h
+#define FileThread_h
+
+#if ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
+
+#include <wtf/MessageQueue.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+class FileStream;
+
+class FileThread : public ThreadSafeShared<FileThread> {
+public:
+    static PassRefPtr<FileThread> create() { return adoptRef(new FileThread()); }
+    ~FileThread();
+
+    bool start();
+    void stop();
+
+    class Task : public Noncopyable {
+    public:
+        virtual ~Task() { }
+        virtual void performTask() = 0;
+        FileStream* stream() const { return m_stream; }
+    protected:
+        Task(FileStream* stream) : m_stream(stream) { }
+        FileStream* m_stream;
+    };
+
+    void postTask(PassOwnPtr<Task> task);
+    void unscheduleTasks(const FileStream*);
+
+private:
+    FileThread();
+
+    static void* fileThreadStart(void*);
+    void* runLoop();
+
+    ThreadIdentifier m_threadID;
+    RefPtr<FileThread> m_selfRef;
+    MessageQueue<Task> m_queue;
+
+    Mutex m_threadCreationMutex;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
+
+#endif // FileThread_h
diff --git a/WebCore/html/FileThreadTask.h b/WebCore/html/FileThreadTask.h
new file mode 100644
index 0000000..f4c59d8
--- /dev/null
+++ b/WebCore/html/FileThreadTask.h
@@ -0,0 +1,238 @@
+/*
+ * 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 FileThreadTask_h
+#define FileThreadTask_h
+
+#include "CrossThreadCopier.h"
+#include "FileThread.h"
+#include <memory>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/TypeTraits.h>
+
+namespace WebCore {
+
+// Traits for the Task.
+template<typename T> struct FileThreadTaskTraits {
+    typedef const T& ParamType;
+};
+
+template<typename T> struct FileThreadTaskTraits<T*> {
+    typedef T* ParamType;
+};
+
+template<typename T> struct FileThreadTaskTraits<PassRefPtr<T> > {
+    typedef PassRefPtr<T> ParamType;
+};
+
+template<typename T> struct FileThreadTaskTraits<PassOwnPtr<T> > {
+    typedef PassOwnPtr<T> ParamType;
+};
+
+class FileThreadTask0 : public FileThread::Task {
+public:
+    typedef void (FileStream::*Method)();
+    typedef FileThreadTask0 FileThreadTask;
+
+    static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method)
+    {
+        return new FileThreadTask(stream, method);
+    }
+
+private:
+    FileThreadTask0(FileStream* stream, Method method)
+        : FileThread::Task(stream)
+        , m_method(method)
+    {
+    }
+
+    virtual void performTask()
+    {
+        (*stream().*m_method)();
+    }
+
+private:
+    Method m_method;
+};
+
+template<typename P1, typename MP1>
+class FileThreadTask1 : public FileThread::Task {
+public:
+    typedef void (FileStream::*Method)(MP1);
+    typedef FileThreadTask1<P1, MP1> FileThreadTask;
+    typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
+
+    static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method, Param1 parameter1)
+    {
+        return new FileThreadTask(stream, method, parameter1);
+    }
+
+private:
+    FileThreadTask1(FileStream* stream, Method method, Param1 parameter1)
+        : FileThread::Task(stream)
+        , m_method(method)
+        , m_parameter1(parameter1)
+    {
+    }
+
+    virtual void performTask()
+    {
+        (*stream().*m_method)(m_parameter1);
+    }
+
+private:
+    Method m_method;
+    P1 m_parameter1;
+};
+
+template<typename P1, typename MP1, typename P2, typename MP2>
+class FileThreadTask2 : public FileThread::Task {
+public:
+    typedef void (FileStream::*Method)(MP1, MP2);
+    typedef FileThreadTask2<P1, MP1, P2, MP2> FileThreadTask;
+    typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
+    typedef typename FileThreadTaskTraits<P2>::ParamType Param2;
+
+    static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method, Param1 parameter1, Param2 parameter2)
+    {
+        return new FileThreadTask(stream, method, parameter1, parameter2);
+    }
+
+private:
+    FileThreadTask2(FileStream* stream, Method method, Param1 parameter1, Param2 parameter2)
+        : FileThread::Task(stream)
+        , m_method(method)
+        , m_parameter1(parameter1)
+        , m_parameter2(parameter2)
+    {
+    }
+
+    virtual void performTask()
+    {
+        (*stream().*m_method)(m_parameter1, m_parameter2);
+    }
+
+private:
+    Method m_method;
+    P1 m_parameter1;
+    P2 m_parameter2;
+};
+
+template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+class FileThreadTask3 : public FileThread::Task {
+public:
+    typedef void (FileStream::*Method)(MP1, MP2, MP3);
+    typedef FileThreadTask3<P1, MP1, P2, MP2, P3, MP3> FileThreadTask;
+    typedef typename FileThreadTaskTraits<P1>::ParamType Param1;
+    typedef typename FileThreadTaskTraits<P2>::ParamType Param2;
+    typedef typename FileThreadTaskTraits<P3>::ParamType Param3;
+
+    static PassOwnPtr<FileThreadTask> create(FileStream* stream, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3)
+    {
+        return new FileThreadTask(stream, method, parameter1, parameter2, parameter3);
+    }
+
+private:
+    FileThreadTask3(FileStream* stream, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3)
+        : FileThread::Task(stream)
+        , m_method(method)
+        , m_parameter1(parameter1)
+        , m_parameter2(parameter2)
+        , m_parameter3(parameter3)
+    {
+    }
+
+    virtual void performTask()
+    {
+        (*stream().*m_method)(m_parameter1, m_parameter2, m_parameter3);
+    }
+
+private:
+    Method m_method;
+    P1 m_parameter1;
+    P2 m_parameter2;
+    P3 m_parameter3;
+};
+
+PassOwnPtr<FileThread::Task> createFileThreadTask(
+    FileStream* const callee,
+    void (FileStream::*method)())
+{
+    return FileThreadTask0::create(
+        callee,
+        method);
+}
+
+template<typename P1, typename MP1>
+PassOwnPtr<FileThread::Task> createFileThreadTask(
+    FileStream* const callee,
+    void (FileStream::*method)(MP1),
+    const P1& parameter1)
+{
+    return FileThreadTask1<typename CrossThreadCopier<P1>::Type, MP1>::create(
+        callee,
+        method,
+        CrossThreadCopier<P1>::copy(parameter1));
+}
+
+template<typename P1, typename MP1, typename P2, typename MP2>
+PassOwnPtr<FileThread::Task> createFileThreadTask(
+    FileStream* const callee,
+    void (FileStream::*method)(MP1, MP2),
+    const P1& parameter1,
+    const P2& parameter2)
+{
+    return FileThreadTask2<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
+        callee,
+        method,
+        CrossThreadCopier<P1>::copy(parameter1),
+        CrossThreadCopier<P2>::copy(parameter2));
+}
+
+template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+PassOwnPtr<FileThread::Task> createFileThreadTask(
+    FileStream* const callee,
+    void (FileStream::*method)(MP1, MP2, MP3),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3)
+{
+    return FileThreadTask3<typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
+        callee,
+        method,
+        CrossThreadCopier<P1>::copy(parameter1),
+        CrossThreadCopier<P2>::copy(parameter2),
+        CrossThreadCopier<P3>::copy(parameter3));
+}
+
+} // namespace WebCore
+
+#endif // FileThreadTask_h
diff --git a/WebCore/html/FormDataList.h b/WebCore/html/FormDataList.h
index aec1a52..8ecf64e 100644
--- a/WebCore/html/FormDataList.h
+++ b/WebCore/html/FormDataList.h
@@ -21,9 +21,9 @@
 #ifndef FormDataList_h
 #define FormDataList_h
 
-#include "CString.h"
-#include "File.h"
+#include "Blob.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -32,32 +32,45 @@
     FormDataList(const TextEncoding&);
 
     void appendData(const String& key, const String& value)
-        { appendString(key); appendString(value); }
-    void appendData(const String& key, const CString& value)
-        { appendString(key); appendString(value); }
+    {
+        appendString(key);
+        appendString(value);
+    }
+    void appendData(const String& key, const WTF::CString& value)
+    {
+        appendString(key);
+        appendString(value);
+    }
     void appendData(const String& key, int value)
-        { appendString(key); appendString(String::number(value)); }
-    void appendFile(const String& key, PassRefPtr<File> file)
-        { appendString(key); m_list.append(file); }
+    {
+        appendString(key);
+        appendString(String::number(value));
+    }
+    void appendBlob(const String& key, PassRefPtr<Blob> blob)
+    {
+        appendString(key);
+        m_list.append(blob);
+    }
 
     class Item {
     public:
         Item() { }
-        Item(const CString& data) : m_data(data) { }
-        Item(PassRefPtr<File> file) : m_file(file) { }
+        Item(const WTF::CString& data) : m_data(data) { }
+        Item(PassRefPtr<Blob> blob) : m_blob(blob) { }
 
-        const CString& data() const { return m_data; }
-        File* file() const { return m_file.get(); }
+        const WTF::CString& data() const { return m_data; }
+        Blob* blob() const { return m_blob.get(); }
 
     private:
-        CString m_data;
-        RefPtr<File> m_file;
+        WTF::CString m_data;
+        RefPtr<Blob> m_blob;
     };
 
     const Vector<Item>& list() const { return m_list; }
+    const TextEncoding& encoding() const { return m_encoding; }
 
 private:
-    void appendString(const CString&);
+    void appendString(const WTF::CString&);
     void appendString(const String&);
 
     TextEncoding m_encoding;
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index f3b6ddd..f636020 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "HTMLAnchorElement.h"
 
-#include "DNS.h"
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameLoaderTypes.h"
@@ -35,6 +34,7 @@
 #include "MouseEvent.h"
 #include "Page.h"
 #include "RenderImage.h"
+#include "ResourceHandle.h"
 #include "Settings.h"
 
 namespace WebCore {
@@ -279,7 +279,7 @@
             String parsedURL = deprecatedParseURL(attr->value());
             if (document()->isDNSPrefetchEnabled()) {
                 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//"))
-                    prefetchDNS(document()->completeURL(parsedURL).host());
+                    ResourceHandle::prepareForURL(document()->completeURL(parsedURL));
             }
             if (document()->page() && !document()->page()->javaScriptURLsAreAllowed() && protocolIsJavaScript(parsedURL)) {
                 setIsLink(false);
diff --git a/WebCore/html/HTMLAppletElement.idl b/WebCore/html/HTMLAppletElement.idl
index 8d6803e..f5984f0 100644
--- a/WebCore/html/HTMLAppletElement.idl
+++ b/WebCore/html/HTMLAppletElement.idl
@@ -23,8 +23,7 @@
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLAppletElement : HTMLElement {
                  attribute [ConvertNullToNullString, Reflect] DOMString align;
                  attribute [ConvertNullToNullString, Reflect] DOMString alt;
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index ad13070..7a353b2 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -42,7 +42,6 @@
 aria-valuemin
 aria-valuenow
 aria-valuetext
-autobuffer
 autocomplete
 autofocus
 autoplay
@@ -88,6 +87,7 @@
 draggable
 enctype
 end
+event
 expanded
 face
 focused
@@ -163,6 +163,8 @@
 onended
 onerror
 onfocus
+onfocusin
+onfocusout
 onhashchange
 oninput
 oninvalid
@@ -222,6 +224,7 @@
 pluginurl
 poster
 precision
+preload
 primary
 profile
 progress
diff --git a/WebCore/html/HTMLAudioElement.cpp b/WebCore/html/HTMLAudioElement.cpp
index 347b8c4..6018b52 100644
--- a/WebCore/html/HTMLAudioElement.cpp
+++ b/WebCore/html/HTMLAudioElement.cpp
@@ -44,7 +44,7 @@
 PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document* document, const String& src)
 {
     RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(audioTag, document);
-    audio->setAutobuffer(true);
+    audio->setPreload("auto");
     if (!src.isNull()) {
         audio->setSrc(src);
         audio->scheduleLoad();
diff --git a/WebCore/html/HTMLBodyElement.idl b/WebCore/html/HTMLBodyElement.idl
index 95140c7..c92dcd3 100644
--- a/WebCore/html/HTMLBodyElement.idl
+++ b/WebCore/html/HTMLBodyElement.idl
@@ -30,31 +30,31 @@
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
         // Event handler attributes
-        attribute [DontEnum] EventListener onbeforeunload;
-        attribute [DontEnum] EventListener onhashchange;
-        attribute [DontEnum] EventListener onmessage;
-        attribute [DontEnum] EventListener onoffline;
-        attribute [DontEnum] EventListener ononline;
-        attribute [DontEnum] EventListener onpopstate;
-        attribute [DontEnum] EventListener onresize;
-        attribute [DontEnum] EventListener onstorage;
-        attribute [DontEnum] EventListener onunload;
+        attribute [DontEnum, WindowEventListener] EventListener onbeforeunload;
+        attribute [DontEnum, WindowEventListener] EventListener onhashchange;
+        attribute [DontEnum, WindowEventListener] EventListener onmessage;
+        attribute [DontEnum, WindowEventListener] EventListener onoffline;
+        attribute [DontEnum, WindowEventListener] EventListener ononline;
+        attribute [DontEnum, WindowEventListener] EventListener onpopstate;
+        attribute [DontEnum, WindowEventListener] EventListener onresize;
+        attribute [DontEnum, WindowEventListener] EventListener onstorage;
+        attribute [DontEnum, WindowEventListener] EventListener onunload;
 
 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
-        attribute [DontEnum] EventListener onorientationchange;
+        attribute [DontEnum, WindowEventListener] EventListener onorientationchange;
 #endif
 
-        // Overrides of Element attributes (left in for completeness).
-        // attribute [DontEnum] EventListener onblur;
-        // attribute [DontEnum] EventListener onerror;
-        // attribute [DontEnum] EventListener onfocus;
-        // attribute [DontEnum] EventListener onload;
+        // Overrides of Element attributes (with different implementation in bindings).
+        attribute [DontEnum, WindowEventListener] EventListener onblur;
+        attribute [DontEnum, WindowEventListener] EventListener onerror;
+        attribute [DontEnum, WindowEventListener] EventListener onfocus;
+        attribute [DontEnum, WindowEventListener] EventListener onload;
 
         // Not implemented yet.
-        // attribute [DontEnum] EventListener onafterprint;
-        // attribute [DontEnum] EventListener onbeforeprint;
-        // attribute [DontEnum] EventListener onredo;
-        // attribute [DontEnum] EventListener onundo;
+        // attribute [DontEnum, WindowEventListener] EventListener onafterprint;
+        // attribute [DontEnum, WindowEventListener] EventListener onbeforeprint;
+        // attribute [DontEnum, WindowEventListener] EventListener onredo;
+        // attribute [DontEnum, WindowEventListener] EventListener onundo;
 #endif
     };
 
diff --git a/WebCore/html/HTMLButtonElement.cpp b/WebCore/html/HTMLButtonElement.cpp
index 3987859..b3d358d 100644
--- a/WebCore/html/HTMLButtonElement.cpp
+++ b/WebCore/html/HTMLButtonElement.cpp
@@ -90,10 +90,6 @@
     } else if (attr->name() == alignAttr) {
         // Don't map 'align' attribute.  This matches what Firefox and IE do, but not Opera.
         // See http://bugs.webkit.org/show_bug.cgi?id=12071
-    } else if (attr->name() == onfocusAttr) {
-        setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, attr));
-    } else if (attr->name() == onblurAttr) {
-        setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr));
     } else
         HTMLFormControlElement::parseMappedAttribute(attr);
 }
diff --git a/WebCore/html/HTMLButtonElement.h b/WebCore/html/HTMLButtonElement.h
index f5b9b62..f4df571 100644
--- a/WebCore/html/HTMLButtonElement.h
+++ b/WebCore/html/HTMLButtonElement.h
@@ -57,11 +57,10 @@
     String value() const;
     void setValue(const String&);
 
-    virtual bool willValidate() const { return false; }
-    
 private:
     enum Type { SUBMIT, RESET, BUTTON };
     virtual bool isOptionalFormControl() const { return true; }
+    virtual bool recalcWillValidate() const { return false; }
 
     Type m_type;
     bool m_activeSubmit;
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index fa03dbf..0b60949 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -28,22 +28,20 @@
 #include "HTMLCanvasElement.h"
 
 #include "CanvasContextAttributes.h"
-#include "CanvasGradient.h"
-#include "CanvasPattern.h"
 #include "CanvasRenderingContext2D.h"
 #if ENABLE(3D_CANVAS)    
 #include "WebGLContextAttributes.h"
 #include "WebGLRenderingContext.h"
 #endif
+#include "CanvasGradient.h"
+#include "CanvasPattern.h"
 #include "CanvasStyle.h"
 #include "Chrome.h"
 #include "Document.h"
-#include "ExceptionCode.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "HTMLNames.h"
 #include "ImageBuffer.h"
-#include "MIMETypeRegistry.h"
 #include "MappedAttribute.h"
 #include "Page.h"
 #include "RenderHTMLCanvas.h"
@@ -55,22 +53,11 @@
 
 using namespace HTMLNames;
 
-// These values come from the WhatWG spec.
-static const int defaultWidth = 300;
-static const int defaultHeight = 150;
-
-// Firefox limits width/height to 32767 pixels, but slows down dramatically before it 
-// reaches that limit. We limit by area instead, giving us larger maximum dimensions,
-// in exchange for a smaller maximum canvas size.
-const float HTMLCanvasElement::MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
-
 HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* doc)
     : HTMLElement(tagName, doc)
-    , m_size(defaultWidth, defaultHeight)
+    , CanvasSurface(doc->frame() ? doc->frame()->page()->chrome()->scaleFactor() : 1)
     , m_observer(0)
-    , m_originClean(true)
     , m_ignoreReset(false)
-    , m_createdImageBuffer(false)
 {
     ASSERT(hasTagName(canvasTag));
 }
@@ -113,8 +100,8 @@
 
 RenderObject* HTMLCanvasElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
-    Settings* settings = document()->settings();
-    if (settings && settings->isJavaScriptEnabled()) {
+    Frame* frame = document()->frame();
+    if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
         m_rendererIsCanvas = true;
         return new (arena) RenderHTMLCanvas(this);
     }
@@ -133,22 +120,6 @@
     setAttribute(widthAttr, String::number(value));
 }
 
-String HTMLCanvasElement::toDataURL(const String& mimeType, ExceptionCode& ec)
-{
-    if (!m_originClean) {
-        ec = SECURITY_ERR;
-        return String();
-    }
-
-    if (m_size.isEmpty() || !buffer())
-        return String("data:,");
-
-    if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType))
-        return buffer()->toDataURL("image/png");
-
-    return buffer()->toDataURL(mimeType);
-}
-
 CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, CanvasContextAttributes* attrs)
 {
     // A Canvas can either be "2D" or "webgl" but never both. If you request a 2D canvas and the existing
@@ -162,13 +133,19 @@
     if (type == "2d") {
         if (m_context && !m_context->is2d())
             return 0;
-        if (!m_context)
-            m_context = new CanvasRenderingContext2D(this);
+        if (!m_context) {
+            bool usesDashbardCompatibilityMode = false;
+#if ENABLE(DASHBOARD_SUPPORT)
+            if (Settings* settings = document()->settings())
+                usesDashbardCompatibilityMode = settings->usesDashboardBackwardCompatibilityMode();
+#endif
+            m_context = new CanvasRenderingContext2D(this, document()->inCompatMode(), usesDashbardCompatibilityMode);
+        }
         return m_context.get();
     }
 #if ENABLE(3D_CANVAS)    
     Settings* settings = document()->settings();
-    if (settings && settings->webGLEnabled()) {
+    if (settings && settings->webGLEnabled() && settings->acceleratedCompositingEnabled()) {
         // Accept the legacy "webkit-3d" name as well as the provisional "experimental-webgl" name.
         // Once ratified, we will also accept "webgl" as the context name.
         if ((type == "webkit-3d") ||
@@ -193,12 +170,11 @@
 
 void HTMLCanvasElement::willDraw(const FloatRect& rect)
 {
-    if (m_imageBuffer)
-        m_imageBuffer->clearImage();
-    
+    CanvasSurface::willDraw(rect);
+
     if (RenderBox* ro = renderBox()) {
         FloatRect destRect = ro->contentBoxRect();
-        FloatRect r = mapRect(rect, FloatRect(0, 0, m_size.width(), m_size.height()), destRect);
+        FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().height()), destRect);
         r.intersect(destRect);
         if (m_dirtyRect.contains(r))
             return;
@@ -219,28 +195,26 @@
     bool ok;
     int w = getAttribute(widthAttr).toInt(&ok);
     if (!ok)
-        w = defaultWidth;
+        w = DefaultWidth;
     int h = getAttribute(heightAttr).toInt(&ok);
     if (!ok)
-        h = defaultHeight;
+        h = DefaultHeight;
 
-    IntSize oldSize = m_size;
-    m_size = IntSize(w, h);
+    IntSize oldSize = size();
+    setSurfaceSize(IntSize(w, h));
 
 #if ENABLE(3D_CANVAS)
     if (m_context && m_context->is3d())
         static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
 #endif
 
-    bool hadImageBuffer = m_createdImageBuffer;
-    m_createdImageBuffer = false;
-    m_imageBuffer.clear();
+    bool hadImageBuffer = hasCreatedImageBuffer();
     if (m_context && m_context->is2d())
         static_cast<CanvasRenderingContext2D*>(m_context.get())->reset();
 
     if (RenderObject* renderer = this->renderer()) {
         if (m_rendererIsCanvas) {
-            if (oldSize != m_size)
+            if (oldSize != size())
                 toRenderHTMLCanvas(renderer)->canvasSizeChanged();
             if (hadImageBuffer)
                 renderer->repaint();
@@ -267,10 +241,13 @@
     }
 #endif
 
-    if (m_imageBuffer) {
-        Image* image = m_imageBuffer->image();
-        if (image)
-            context->drawImage(image, DeviceColorSpace, r);
+    if (hasCreatedImageBuffer()) {
+        ImageBuffer* imageBuffer = buffer();
+        if (imageBuffer) {
+            Image* image = imageBuffer->image();
+            if (image)
+                context->drawImage(image, DeviceColorSpace, r);
+        }
     }
 
 #if ENABLE(3D_CANVAS)
@@ -279,6 +256,7 @@
 #endif
 }
 
+<<<<<<< HEAD
 IntRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect) const
 {
     return IntRect(convertLogicalToDevice(logicalRect.location()), convertLogicalToDevice(logicalRect.size()));
@@ -373,6 +351,8 @@
     return transform;
 }
 
+=======
+>>>>>>> webkit.org at r58033
 #if ENABLE(3D_CANVAS)    
 bool HTMLCanvasElement::is3D() const
 {
diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h
index d70a7e6..b2a76a1 100644
--- a/WebCore/html/HTMLCanvasElement.h
+++ b/WebCore/html/HTMLCanvasElement.h
@@ -27,7 +27,7 @@
 #ifndef HTMLCanvasElement_h
 #define HTMLCanvasElement_h
 
-#include "AffineTransform.h"
+#include "CanvasSurface.h"
 #include "FloatRect.h"
 #include "HTMLElement.h"
 #if ENABLE(3D_CANVAS)    
@@ -39,13 +39,8 @@
 
 class CanvasContextAttributes;
 class CanvasRenderingContext;
-class FloatPoint;
-class FloatRect;
-class FloatSize;
 class GraphicsContext;
 class HTMLCanvasElement;
-class ImageBuffer;
-class IntPoint;
 class IntSize;
 
 class CanvasObserver {
@@ -57,53 +52,38 @@
     virtual void canvasDestroyed(HTMLCanvasElement*) = 0;
 };
 
-class HTMLCanvasElement : public HTMLElement {
+class HTMLCanvasElement : public HTMLElement, public CanvasSurface {
 public:
     HTMLCanvasElement(const QualifiedName&, Document*);
     virtual ~HTMLCanvasElement();
 
-    int width() const { return m_size.width(); }
-    int height() const { return m_size.height(); }
     void setWidth(int);
     void setHeight(int);
 
-    String toDataURL(const String& mimeType, ExceptionCode&);
-
     CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* attributes = 0);
 
-    const IntSize& size() const { return m_size; }
-    void setSize(const IntSize& size)
+    void setSize(const IntSize& newSize)
     { 
-        if (size == m_size)
+        if (newSize == size())
             return;
         m_ignoreReset = true; 
-        setWidth(size.width());
-        setHeight(size.height());
+        setWidth(newSize.width());
+        setHeight(newSize.height());
         m_ignoreReset = false;
         reset();
     }
 
-    void willDraw(const FloatRect&);
+    virtual void willDraw(const FloatRect&);
 
     void paint(GraphicsContext*, const IntRect&);
 
-    GraphicsContext* drawingContext() const;
-
-    ImageBuffer* buffer() const;
-
-    IntRect convertLogicalToDevice(const FloatRect&) const;
-    IntSize convertLogicalToDevice(const FloatSize&) const;
-    IntPoint convertLogicalToDevice(const FloatPoint&) const;
-
-    void setOriginTainted() { m_originClean = false; } 
-    bool originClean() const { return m_originClean; }
-
     void setObserver(CanvasObserver* observer) { m_observer = observer; }
 
-    AffineTransform baseTransform() const;
-
     CanvasRenderingContext* renderingContext() const { return m_context.get(); }
 
+    RenderBox* renderBox() const { return HTMLElement::renderBox(); }
+    RenderStyle* computedStyle() { return HTMLElement::computedStyle(); }
+
 #if ENABLE(3D_CANVAS)    
     bool is3D() const;
 #endif
@@ -117,24 +97,15 @@
     virtual void parseMappedAttribute(MappedAttribute*);
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
-    void createImageBuffer() const;
     void reset();
 
-    static const float MaxCanvasArea;
-
     bool m_rendererIsCanvas;
 
     OwnPtr<CanvasRenderingContext> m_context;
-    IntSize m_size;    
     CanvasObserver* m_observer;
 
-    bool m_originClean;
     bool m_ignoreReset;
     FloatRect m_dirtyRect;
-
-    // m_createdImageBuffer means we tried to malloc the buffer.  We didn't necessarily get it.
-    mutable bool m_createdImageBuffer;
-    mutable OwnPtr<ImageBuffer> m_imageBuffer;
 };
 
 } //namespace
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index cf98755..c0e9eb7 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -55,7 +55,6 @@
 
 #include "CSSPropertyNames.h"
 #include "CSSStyleSelector.h"
-#include "CString.h"
 #include "CookieJar.h"
 #include "DocumentLoader.h"
 #include "DocumentType.h"
@@ -72,6 +71,7 @@
 #include "InspectorController.h"
 #include "KURL.h"
 #include "Page.h"
+#include <wtf/text/CString.h>
 
 #include "DocTypeStrings.cpp"
 
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index d3a7f22..816bb60 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -107,6 +107,7 @@
     map->add(centerTag.localName().impl(), 5);
     map->add(footerTag.localName().impl(), 5);
     map->add(headerTag.localName().impl(), 5);
+    map->add(hgroupTag.localName().impl(), 5);
     map->add(nobrTag.localName().impl(), 5);
     map->add(rubyTag.localName().impl(), 5);
     map->add(navTag.localName().impl(), 5);
@@ -197,6 +198,10 @@
         setAttributeEventListener(eventNames().mousewheelEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onfocusAttr) {
         setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, attr));
+    } else if (attr->name() == onfocusinAttr) {
+        setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, attr));
+    } else if (attr->name() == onfocusoutAttr) {
+        setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onblurAttr) {
         setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onkeydownAttr) {
@@ -272,9 +277,9 @@
     return createMarkup(this);
 }
 
-PassRefPtr<DocumentFragment> HTMLElement::createContextualFragment(const String &html, FragmentScriptingPermission scriptingPermission)
+PassRefPtr<DocumentFragment> HTMLElement::createContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
 {
-    // the following is in accordance with the definition as used by IE
+    // The following is in accordance with the definition as used by IE.
     if (endTagRequirement() == TagStatusForbidden)
         return 0;
 
@@ -282,47 +287,7 @@
         hasLocalName(headTag) || hasLocalName(styleTag) || hasLocalName(titleTag))
         return 0;
 
-    RefPtr<DocumentFragment> fragment = DocumentFragment::create(document());
-    
-    if (document()->isHTMLDocument())
-         parseHTMLDocumentFragment(html, fragment.get(), scriptingPermission);
-    else {
-        if (!parseXMLDocumentFragment(html, fragment.get(), this, scriptingPermission))
-            // FIXME: We should propagate a syntax error exception out here.
-            return 0;
-    }
-
-    // Exceptions are ignored because none ought to happen here.
-    int ignoredExceptionCode;
-
-    // we need to pop <html> and <body> elements and remove <head> to
-    // accommodate folks passing complete HTML documents to make the
-    // child of an element.
-
-    RefPtr<Node> nextNode;
-    for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
-        nextNode = node->nextSibling();
-        if (node->hasTagName(htmlTag) || node->hasTagName(bodyTag)) {
-            Node *firstChild = node->firstChild();
-            if (firstChild)
-                nextNode = firstChild;
-            RefPtr<Node> nextChild;
-            for (RefPtr<Node> child = firstChild; child; child = nextChild) {
-                nextChild = child->nextSibling();
-                node->removeChild(child.get(), ignoredExceptionCode);
-                ASSERT(!ignoredExceptionCode);
-                fragment->insertBefore(child, node.get(), ignoredExceptionCode);
-                ASSERT(!ignoredExceptionCode);
-            }
-            fragment->removeChild(node.get(), ignoredExceptionCode);
-            ASSERT(!ignoredExceptionCode);
-        } else if (node->hasTagName(headTag)) {
-            fragment->removeChild(node.get(), ignoredExceptionCode);
-            ASSERT(!ignoredExceptionCode);
-        }
-    }
-
-    return fragment.release();
+    return Element::createContextualFragment(markup, scriptingPermission);
 }
 
 static inline bool hasOneChild(ContainerNode* node)
@@ -415,7 +380,7 @@
 
 void HTMLElement::setInnerText(const String& text, ExceptionCode& ec)
 {
-    // follow the IE specs about when this is allowed
+    // Follow the IE specs about when this is allowed.
     if (endTagRequirement() == TagStatusForbidden) {
         ec = NO_MODIFICATION_ALLOWED_ERR;
         return;
@@ -485,7 +450,7 @@
 
 void HTMLElement::setOuterText(const String &text, ExceptionCode& ec)
 {
-    // follow the IE specs about when this is allowed
+    // Follow the IE specs about when this is allowed.
     if (endTagRequirement() == TagStatusForbidden) {
         ec = NO_MODIFICATION_ALLOWED_ERR;
         return;
@@ -513,7 +478,7 @@
     if (ec)
         return;
 
-    // is previous node a text node? if so, merge into it
+    // Is previous node a text node? If so, merge into it.
     Node* prev = t->previousSibling();
     if (prev && prev->isTextNode()) {
         Text* textPrev = static_cast<Text*>(prev);
@@ -526,7 +491,7 @@
         t = textPrev;
     }
 
-    // is next node a text node? if so, merge it in
+    // Is next node a text node? If so, merge it in.
     Node* next = t->nextSibling();
     if (next && next->isTextNode()) {
         Text* textNext = static_cast<Text*>(next);
@@ -566,7 +531,7 @@
         return 0;
     }
     
-    // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative
+    // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
     ec = NOT_SUPPORTED_ERR;
     return 0;
 }
@@ -574,7 +539,7 @@
 Element* HTMLElement::insertAdjacentElement(const String& where, Element* newChild, ExceptionCode& ec)
 {
     if (!newChild) {
-        // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative
+        // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
         ec = TYPE_MISMATCH_ERR;
         return 0;
     }
@@ -611,8 +576,8 @@
 
 void HTMLElement::addHTMLAlignmentToStyledElement(StyledElement* element, MappedAttribute* attr)
 {
-    // vertical alignment with respect to the current baseline of the text
-    // right or left means floating images
+    // Vertical alignment with respect to the current baseline of the text
+    // right or left means floating images.
     int floatValue = CSSValueInvalid;
     int verticalAlignValue = CSSValueInvalid;
 
@@ -893,6 +858,9 @@
         tagList.add(rpTag.localName().impl());
         tagList.add(rtTag.localName().impl());
         tagList.add(rubyTag.localName().impl());
+#if ENABLE(PROGRESS_TAG)
+        tagList.add(progressTag.localName().impl());
+#endif
     }
     return &tagList;
 }
@@ -921,6 +889,7 @@
         tagList.add(h5Tag.localName().impl());
         tagList.add(h6Tag.localName().impl());
         tagList.add(headerTag.localName().impl());
+        tagList.add(hgroupTag.localName().impl());
         tagList.add(hrTag.localName().impl());
         tagList.add(isindexTag.localName().impl());
         tagList.add(layerTag.localName().impl());
@@ -1011,8 +980,8 @@
 {
 #if !ENABLE(XHTMLMP)
     if (hasLocalName(noscriptTag)) {
-        Settings* settings = document()->settings();
-        if (settings && settings->isJavaScriptEnabled())
+        Frame* frame = document()->frame();
+        if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
             return false;
     }
 #endif
diff --git a/WebCore/html/HTMLElementsAllInOne.cpp b/WebCore/html/HTMLElementsAllInOne.cpp
index f9c970a..4cee927 100644
--- a/WebCore/html/HTMLElementsAllInOne.cpp
+++ b/WebCore/html/HTMLElementsAllInOne.cpp
@@ -87,6 +87,7 @@
 #include "HTMLPlugInElement.cpp"
 #include "HTMLPlugInImageElement.cpp"
 #include "HTMLPreElement.cpp"
+#include "HTMLProgressElement.cpp"
 #include "HTMLQuoteElement.cpp"
 #include "HTMLScriptElement.cpp"
 #include "HTMLSelectElement.cpp"
diff --git a/WebCore/html/HTMLEmbedElement.idl b/WebCore/html/HTMLEmbedElement.idl
index d491a0d..576bca9 100644
--- a/WebCore/html/HTMLEmbedElement.idl
+++ b/WebCore/html/HTMLEmbedElement.idl
@@ -23,8 +23,7 @@
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLEmbedElement : HTMLElement {
                  attribute [ConvertNullToNullString, Reflect] DOMString align;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
diff --git a/WebCore/html/HTMLFieldSetElement.h b/WebCore/html/HTMLFieldSetElement.h
index 0900317..457fe93 100644
--- a/WebCore/html/HTMLFieldSetElement.h
+++ b/WebCore/html/HTMLFieldSetElement.h
@@ -47,8 +47,8 @@
     virtual bool supportsFocus() const;
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     virtual const AtomicString& formControlType() const;
-
-    virtual bool willValidate() const { return false; }
+private:
+    virtual bool recalcWillValidate() const { return false; }
 };
 
 } //namespace
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 6f24e0c..bcdf40d 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -49,14 +49,16 @@
 
 using namespace HTMLNames;
 
-HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
-    : HTMLElement(tagName, doc)
+HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f, ConstructionType constructionType)
+    : HTMLElement(tagName, doc, constructionType)
     , m_form(f)
-    , m_hasName(false)
     , m_disabled(false)
     , m_readOnly(false)
     , m_required(false)
     , m_valueMatchesRenderer(false)
+    , m_willValidateInitialized(false)
+    , m_willValidate(true)
+    , m_isValid(true)
 {
     if (!m_form)
         m_form = findFormAncestor();
@@ -90,10 +92,7 @@
 
 void HTMLFormControlElement::parseMappedAttribute(MappedAttribute *attr)
 {
-    bool oldWillValidate = willValidate();
-    if (attr->name() == nameAttr)
-        m_hasName = !attr->isEmpty();
-    else if (attr->name() == disabledAttr) {
+    if (attr->name() == disabledAttr) {
         bool oldDisabled = m_disabled;
         m_disabled = !attr->isNull();
         if (oldDisabled != m_disabled) {
@@ -112,12 +111,13 @@
     } else if (attr->name() == requiredAttr) {
         bool oldRequired = m_required;
         m_required = !attr->isNull();
-        if (oldRequired != m_required)
-            setNeedsStyleRecalc();
+        if (oldRequired != m_required) {
+            setNeedsValidityCheck();
+            setNeedsStyleRecalc(); // Updates for :required :optional classes.
+        }
     } else
         HTMLElement::parseMappedAttribute(attr);
-    if (oldWillValidate != willValidate())
-        setNeedsWillValidateCheck();
+    setNeedsWillValidateCheck();
 }
 
 void HTMLFormControlElement::attach()
@@ -153,10 +153,9 @@
         // setting a form, we will already have a non-null value for m_form, 
         // and so we don't need to do anything.
         m_form = findFormAncestor();
-        if (m_form) {
+        if (m_form)
             m_form->registerFormElement(this);
-            setNeedsWillValidateCheck();
-        } else
+        else
             document()->checkedRadioButtons().addButton(this);
     }
 
@@ -183,19 +182,11 @@
     if (m_form && !(parser && parser->isHandlingResidualStyleAcrossBlocks()) && findRoot(this) != findRoot(m_form)) {
         m_form->removeFormElement(this);
         m_form = 0;
-        setNeedsWillValidateCheck();
     }
 
     HTMLElement::removedFromTree(deep);
 }
 
-void HTMLFormControlElement::formDestroyed()
-{
-    if (m_form)
-        setNeedsWillValidateCheck();
-    m_form = 0;
-}
-
 const AtomicString& HTMLFormControlElement::formControlName() const
 {
     const AtomicString& n = getAttribute(nameAttr);
@@ -299,13 +290,38 @@
     return Element::tabIndex();
 }
 
+bool HTMLFormControlElement::recalcWillValidate() const
+{
+    // FIXME: Should return false if this element has a datalist element as an
+    // ancestor. See HTML5 4.10.10 'The datalist element.'
+    return !m_disabled && !m_readOnly;
+}
+
 bool HTMLFormControlElement::willValidate() const
 {
-    // FIXME: Implementation shall be completed with these checks:
-    //      The control does not have a repetition template as an ancestor.
-    //      The control does not have a datalist element as an ancestor.
-    //      The control is not an output element.
-    return m_form && m_hasName && !m_disabled && !m_readOnly;
+    if (!m_willValidateInitialized) {
+        m_willValidateInitialized = true;
+        m_willValidate = recalcWillValidate();
+    } else {
+        // If the following assertion fails, setNeedsWillValidateCheck() is not
+        // called correctly when something which changes recalcWillValidate() result
+        // is updated.
+        ASSERT(m_willValidate == recalcWillValidate());
+    }
+    return m_willValidate;
+}
+
+void HTMLFormControlElement::setNeedsWillValidateCheck()
+{
+    // We need to recalculate willValidte immediately because willValidate
+    // change can causes style change.
+    bool newWillValidate = recalcWillValidate();
+    if (m_willValidateInitialized && m_willValidate == newWillValidate)
+        return;
+    m_willValidateInitialized = true;
+    m_willValidate = newWillValidate;
+    setNeedsStyleRecalc();
+    // FIXME: Show/hide a validation message.
 }
 
 String HTMLFormControlElement::validationMessage()
@@ -313,28 +329,35 @@
     return validity()->validationMessage();
 }
 
-void HTMLFormControlElement::setNeedsWillValidateCheck()
+bool HTMLFormControlElement::checkValidity(Vector<RefPtr<HTMLFormControlElement> >* unhandledInvalidControls)
 {
-    setNeedsStyleRecalc();
-    // FIXME: Show/hide a validation message.
+    if (!willValidate() || isValidFormControlElement())
+        return true;
+    // An event handler can deref this object.
+    RefPtr<HTMLFormControlElement> protector(this);
+    RefPtr<Document> originalDocument(document());
+    bool needsDefaultAction = dispatchEvent(Event::create(eventNames().invalidEvent, false, true));
+    if (needsDefaultAction && unhandledInvalidControls && inDocument() && originalDocument == document())
+        unhandledInvalidControls->append(this);
+    return false;
 }
 
-bool HTMLFormControlElement::checkValidity()
+bool HTMLFormControlElement::isValidFormControlElement()
 {
-    if (willValidate() && !isValidFormControlElement()) {
-        dispatchEvent(Event::create(eventNames().invalidEvent, false, true));
-        return false;
-    }
-
-    return true;
+    // If the following assertion fails, setNeedsValidityCheck() is not called
+    // correctly when something which changes validity is updated.
+    ASSERT(m_isValid == validity()->valid());
+    return m_isValid;
 }
 
 void HTMLFormControlElement::setNeedsValidityCheck()
 {
-    if (willValidate()) {
+    bool newIsValid = validity()->valid();
+    if (willValidate() && newIsValid != m_isValid) {
         // Update style for pseudo classes such as :valid :invalid.
         setNeedsStyleRecalc();
     }
+    m_isValid = newIsValid;
     // FIXME: show/hide a validation message.
 }
 
@@ -345,16 +368,16 @@
     
 void HTMLFormControlElement::dispatchFocusEvent()
 {
-    if (document()->frame() && document()->frame()->page())
-        document()->frame()->page()->chrome()->client()->formDidFocus(this);
+    if (document()->page())
+        document()->page()->chrome()->client()->formDidFocus(this);
 
     HTMLElement::dispatchFocusEvent();
 }
 
 void HTMLFormControlElement::dispatchBlurEvent()
 {
-    if (document()->frame() && document()->frame()->page())
-        document()->frame()->page()->chrome()->client()->formDidBlur(this);
+    if (document()->page())
+        document()->page()->chrome()->client()->formDidBlur(this);
 
     HTMLElement::dispatchBlurEvent();
 }
@@ -369,11 +392,6 @@
     return isSuccessfulSubmitButton() && m_form && m_form->defaultButton() == this;
 }
 
-bool HTMLFormControlElement::isValidFormControlElement()
-{
-    return validity()->valid();
-}
-
 void HTMLFormControlElement::removeFromForm()
 {
     if (!m_form)
@@ -405,9 +423,29 @@
     HTMLFormControlElement::didMoveToNewOwnerDocument();
 }
 
+bool HTMLFormControlElementWithState::autoComplete() const
+{
+    if (!form())
+        return true;
+    return form()->autoComplete();
+}
+
+bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
+{
+    // We don't save/restore control state in a form with autocomplete=off.
+    return autoComplete();
+}
+
 void HTMLFormControlElementWithState::finishParsingChildren()
 {
     HTMLFormControlElement::finishParsingChildren();
+
+    // We don't save state of a control with shouldSaveAndRestoreFormControlState()=false.
+    // But we need to skip restoring process too because a control in another
+    // form might have the same pair of name and type and saved its state.
+    if (!shouldSaveAndRestoreFormControlState())
+        return;
+
     Document* doc = document();
     if (doc->hasStateForNewFormElements()) {
         String state;
@@ -520,10 +558,6 @@
 {
     if (attr->name() == placeholderAttr)
         updatePlaceholderVisibility(true);
-    else if (attr->name() == onfocusAttr)
-        setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, attr));
-    else if (attr->name() == onblurAttr)
-        setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr));
     else if (attr->name() == onselectAttr)
         setAttributeEventListener(eventNames().selectEvent, createAttributeEventListener(this, attr));
     else if (attr->name() == onchangeAttr)
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 117087b..0045fbe 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -36,7 +36,7 @@
 
 class HTMLFormControlElement : public HTMLElement {
 public:
-    HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
+    HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*, ConstructionType = CreateElementZeroRefCount);
     virtual ~HTMLFormControlElement();
 
     virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
@@ -108,7 +108,7 @@
 
     virtual bool willValidate() const;
     String validationMessage();
-    bool checkValidity();
+    bool checkValidity(Vector<RefPtr<HTMLFormControlElement> >* unhandledInvalidControls = 0);
     // This must be called when a validation constraint or control value is changed.
     void setNeedsValidityCheck();
     void setCustomValidity(const String&);
@@ -116,7 +116,7 @@
     virtual bool patternMismatch() const { return false; }
     virtual bool tooLong() const { return false; }
 
-    void formDestroyed();
+    void formDestroyed() { m_form = 0; }
 
     virtual void dispatchFocusEvent();
     virtual void dispatchBlurEvent();
@@ -125,6 +125,7 @@
     void removeFromForm();
     // This must be called any time the result of willValidate() has changed.
     void setNeedsWillValidateCheck();
+    virtual bool recalcWillValidate() const;
 
 private:
     virtual HTMLFormElement* virtualForm() const;
@@ -133,11 +134,18 @@
 
     HTMLFormElement* m_form;
     OwnPtr<ValidityState> m_validityState;
-    bool m_hasName : 1;
     bool m_disabled : 1;
     bool m_readOnly : 1;
     bool m_required : 1;
     bool m_valueMatchesRenderer : 1;
+    // The initial value of m_willValidate depends on a subclass, and we can't
+    // initialize it with a virtual function in the constructor. m_willValidate
+    // is not deterministic during m_willValidateInitialized=false.
+    mutable bool m_willValidateInitialized: 1;
+    mutable bool m_willValidate : 1;
+    // Cache of validity()->valid().
+    // "candidate for constraint validation" doesn't affect to m_isValid.
+    bool m_isValid : 1;
 };
 
 class HTMLFormControlElementWithState : public HTMLFormControlElement {
@@ -145,6 +153,8 @@
     HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
     virtual ~HTMLFormControlElementWithState();
 
+    virtual bool autoComplete() const;
+    virtual bool shouldSaveAndRestoreFormControlState() const;
     virtual void finishParsingChildren();
 
 protected:
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 2f88894..cafa3c9 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -26,8 +26,8 @@
 #include "HTMLFormElement.h"
 
 #include "CSSHelper.h"
-#include "Chrome.h"
-#include "ChromeClient.h"
+#include "DOMFormData.h"
+#include "DOMWindow.h"
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
@@ -46,7 +46,6 @@
 #include "ScriptEventListener.h"
 #include "MIMETypeRegistry.h"
 #include "MappedAttribute.h"
-#include "Page.h"
 #include "RenderTextControl.h"
 #include "ValidityState.h"
 #include <limits>
@@ -201,83 +200,16 @@
     return m_formDataBuilder.dataEncoding(document());
 }
 
-PassRefPtr<FormData> HTMLFormElement::createFormData(const CString& boundary)
+PassRefPtr<FormData> HTMLFormElement::createFormData()
 {
-    Vector<char> encodedData;
-    TextEncoding encoding = dataEncoding().encodingForFormSubmission();
-
-    RefPtr<FormData> result = FormData::create();
-
+    RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding().encodingForFormSubmission());
     for (unsigned i = 0; i < formElements.size(); ++i) {
         HTMLFormControlElement* control = formElements[i];
-        FormDataList list(encoding);
-
-        if (!control->disabled() && control->appendFormData(list, m_formDataBuilder.isMultiPartForm())) {
-            size_t formDataListSize = list.list().size();
-            ASSERT(formDataListSize % 2 == 0);
-            for (size_t j = 0; j < formDataListSize; j += 2) {
-                const FormDataList::Item& key = list.list()[j];
-                const FormDataList::Item& value = list.list()[j + 1];
-                if (!m_formDataBuilder.isMultiPartForm()) {
-                    // Omit the name "isindex" if it's the first form data element.
-                    // FIXME: Why is this a good rule? Is this obsolete now?
-                    if (encodedData.isEmpty() && key.data() == "isindex")
-                        FormDataBuilder::encodeStringAsFormData(encodedData, value.data());
-                    else
-                        m_formDataBuilder.addKeyValuePairAsFormData(encodedData, key.data(), value.data());
-                } else {
-                    Vector<char> header;
-                    m_formDataBuilder.beginMultiPartHeader(header, boundary, key.data());
-
-                    bool shouldGenerateFile = false;
-                    // if the current type is FILE, then we also need to include the filename
-                    if (value.file()) {
-                        const String& path = value.file()->path();
-                        String fileName = value.file()->fileName();
-
-                        // Let the application specify a filename if it's going to generate a replacement file for the upload.
-                        if (!path.isEmpty()) {
-                            if (Page* page = document()->page()) {
-                                String generatedFileName;
-                                shouldGenerateFile = page->chrome()->client()->shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
-                                if (shouldGenerateFile)
-                                    fileName = generatedFileName;
-                            }
-                        }
-
-                        // We have to include the filename=".." part in the header, even if the filename is empty
-                        m_formDataBuilder.addFilenameToMultiPartHeader(header, encoding, fileName);
-
-                        if (!fileName.isEmpty()) {
-                            // FIXME: The MIMETypeRegistry function's name makes it sound like it takes a path,
-                            // not just a basename. But filename is not the path. But note that it's not safe to
-                            // just use path instead since in the generated-file case it will not reflect the
-                            // MIME type of the generated file.
-                            String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName);
-                            if (!mimeType.isEmpty())
-                                m_formDataBuilder.addContentTypeToMultiPartHeader(header, mimeType.latin1());
-                        }
-                    }
-
-                    m_formDataBuilder.finishMultiPartHeader(header);
-
-                    // Append body
-                    result->appendData(header.data(), header.size());
-                    if (size_t dataSize = value.data().length())
-                        result->appendData(value.data().data(), dataSize);
-                    else if (value.file() && !value.file()->path().isEmpty())
-                        result->appendFile(value.file()->path(), shouldGenerateFile);
-
-                    result->appendData("\r\n", 2);
-                }
-            }
-        }
+        if (!control->disabled())
+            control->appendFormData(*domFormData, m_formDataBuilder.isMultiPartForm());
     }
 
-    if (m_formDataBuilder.isMultiPartForm())
-        m_formDataBuilder.addBoundaryToMultiPartHeader(encodedData, boundary, true);
-
-    result->appendData(encodedData.data(), encodedData.size());
+    RefPtr<FormData> result = (m_formDataBuilder.isMultiPartForm()) ? FormData::createMultiPart(*domFormData, document()) : FormData::create(*domFormData);
 
     result->setIdentifier(generateFormDataIdentifier());
     return result;
@@ -288,6 +220,64 @@
     return protocolIs(m_url, "mailto");
 }
 
+static inline HTMLFormControlElement* submitElementFromEvent(const Event* event)
+{
+    Node* targetNode = event->target()->toNode();
+    if (!targetNode || !targetNode->isElementNode())
+        return 0;
+    Element* targetElement = static_cast<Element*>(targetNode);
+    if (!targetElement->isFormControlElement())
+        return 0;
+    return static_cast<HTMLFormControlElement*>(targetElement);
+}
+
+bool HTMLFormElement::validateInteractively(Event* event)
+{
+    ASSERT(event);
+    if (noValidate())
+        return true;
+
+    HTMLFormControlElement* submitElement = submitElementFromEvent(event);
+    if (submitElement && submitElement->formNoValidate())
+        return true;
+
+    Vector<RefPtr<HTMLFormControlElement> > unhandledInvalidControls;
+    collectUnhandledInvalidControls(unhandledInvalidControls);
+    if (unhandledInvalidControls.isEmpty())
+        return true;
+    // If the form has invalid controls, abort submission.
+
+    RefPtr<HTMLFormElement> protector(this);
+    // Focus on the first focusable control.
+    for (unsigned i = 0; i < unhandledInvalidControls.size(); ++i) {
+        HTMLFormControlElement* unhandled = unhandledInvalidControls[i].get();
+        if (unhandled->isFocusable() && unhandled->inDocument()) {
+            RefPtr<Document> originalDocument(unhandled->document());
+            unhandled->scrollIntoViewIfNeeded(false);
+            // scrollIntoViewIfNeeded() dispatches events, so the state
+            // of 'unhandled' might be changed so it's no longer focusable or
+            // moved to another document.
+            if (unhandled->isFocusable() && unhandled->inDocument() && originalDocument == unhandled->document()) {
+                unhandled->focus();
+                break;
+            }
+        }
+    }
+    // Warn about all of unfocusable controls.
+    if (Frame* frame = document()->frame()) {
+        for (unsigned i = 0; i < unhandledInvalidControls.size(); ++i) {
+            HTMLFormControlElement* unhandled = unhandledInvalidControls[i].get();
+            if (unhandled->isFocusable() && unhandled->inDocument())
+                continue;
+            String message("An invalid form control with name='%name' is not focusable.");
+            message.replace("%name", unhandled->name());
+            frame->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, ErrorMessageLevel, message, 0, document()->url().string());
+        }
+    }
+    m_insubmit = false;
+    return false;
+}
+
 bool HTMLFormElement::prepareSubmit(Event* event)
 {
     Frame* frame = document()->frame();
@@ -297,6 +287,10 @@
     m_insubmit = true;
     m_doingsubmit = false;
 
+    // Interactive validation must be done before dispatching the submit event.
+    if (!validateInteractively(event))
+        return false;
+
     if (dispatchEvent(Event::create(eventNames().submitEvent, true, true)) && !m_doingsubmit)
         m_doingsubmit = true;
 
@@ -389,8 +383,8 @@
             ASSERT(!m_formDataBuilder.isMultiPartForm());
         }
 
+        RefPtr<FormData> data = createFormData();
         if (!m_formDataBuilder.isMultiPartForm()) {
-            RefPtr<FormData> data = createFormData(CString());
 
             if (isMailtoForm()) {
                 // Convert the form data into a string that we put into the URL.
@@ -400,13 +394,11 @@
             }
 
             frame->loader()->submitForm("POST", m_url, data.release(), m_target, m_formDataBuilder.encodingType(), String(), lockHistory, event, formState.release());
-        } else {
-            Vector<char> boundary = m_formDataBuilder.generateUniqueBoundaryString();
-            frame->loader()->submitForm("POST", m_url, createFormData(boundary.data()), m_target, m_formDataBuilder.encodingType(), boundary.data(), lockHistory, event, formState.release());
-        }
+        } else
+            frame->loader()->submitForm("POST", m_url, data.get(), m_target, m_formDataBuilder.encodingType(), data->boundary().data(), lockHistory, event, formState.release());
     } else {
         m_formDataBuilder.setIsMultiPartForm(false);
-        frame->loader()->submitForm("GET", m_url, createFormData(CString()), m_target, String(), String(), lockHistory, event, formState.release());
+        frame->loader()->submitForm("GET", m_url, createFormData(), m_target, String(), String(), lockHistory, event, formState.release());
     }
 
     if (needButtonActivation && firstSuccessfulSubmitButton)
@@ -612,16 +604,24 @@
 
 bool HTMLFormElement::checkValidity()
 {
-    // TODO: Check for unhandled invalid controls, see #27452 for tips.
+    Vector<RefPtr<HTMLFormControlElement> > controls;
+    collectUnhandledInvalidControls(controls);
+    return controls.isEmpty();
+}
 
-    bool hasOnlyValidControls = true;
-    for (unsigned i = 0; i < formElements.size(); ++i) {
-        HTMLFormControlElement* control = formElements[i];
-        if (!control->checkValidity())
-            hasOnlyValidControls = false;
+void HTMLFormElement::collectUnhandledInvalidControls(Vector<RefPtr<HTMLFormControlElement> >& unhandledInvalidControls)
+{
+    RefPtr<HTMLFormElement> protector(this);
+    // Copy formElements because event handlers called from
+    // HTMLFormControlElement::checkValidity() might change formElements.
+    Vector<RefPtr<HTMLFormControlElement> > elements;
+    elements.reserveCapacity(formElements.size());
+    for (unsigned i = 0; i < formElements.size(); ++i)
+        elements.append(formElements[i]);
+    for (unsigned i = 0; i < elements.size(); ++i) {
+        if (elements[i]->form() == this)
+            elements[i]->checkValidity(&unhandledInvalidControls);
     }
-
-    return hasOnlyValidControls;
 }
 
 PassRefPtr<HTMLFormControlElement> HTMLFormElement::elementForAlias(const AtomicString& alias)
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index c0ce3e3..923c734 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -135,8 +135,13 @@
 
     bool isMailtoForm() const;
     TextEncoding dataEncoding() const;
-    PassRefPtr<FormData> createFormData(const CString& boundary);
+    PassRefPtr<FormData> createFormData();
     unsigned formElementIndex(HTMLFormControlElement*);
+    // Returns true if the submission should be proceeded.
+    bool validateInteractively(Event*);
+    // Validates each of the controls, and stores controls of which 'invalid'
+    // event was not canceled to the specified vector.
+    void collectUnhandledInvalidControls(Vector<RefPtr<HTMLFormControlElement> >&);
 
     friend class HTMLFormCollection;
 
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index 9d84b62..76f3ed4 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -90,7 +90,7 @@
     return true;
 }
 
-void HTMLFrameElementBase::openURL()
+void HTMLFrameElementBase::openURL(bool lockHistory, bool lockBackForwardList)
 {
     ASSERT(!m_frameName.isEmpty());
 
@@ -104,7 +104,7 @@
     if (!parentFrame)
         return;
 
-    parentFrame->loader()->requestFrame(this, m_URL, m_frameName);
+    parentFrame->loader()->requestFrame(this, m_URL, m_frameName, lockHistory, lockBackForwardList);
     if (contentFrame())
         contentFrame()->setInViewSourceMode(viewSourceMode());
 }
@@ -231,7 +231,7 @@
     m_URL = AtomicString(str);
 
     if (inDocument())
-        openURL();
+        openURL(false, false);
 }
 
 bool HTMLFrameElementBase::supportsFocus() const
diff --git a/WebCore/html/HTMLFrameElementBase.h b/WebCore/html/HTMLFrameElementBase.h
index 7717df0..6424ba7 100644
--- a/WebCore/html/HTMLFrameElementBase.h
+++ b/WebCore/html/HTMLFrameElementBase.h
@@ -73,7 +73,7 @@
     bool viewSourceMode() const { return m_viewSource; }
 
     void setNameAndOpenURL();
-    void openURL();
+    void openURL(bool lockHistory = true, bool lockBackForwardList = true);
 
     static void setNameAndOpenURLCallback(Node*);
 
diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp
index f4d1558..9cc4975 100644
--- a/WebCore/html/HTMLFrameSetElement.cpp
+++ b/WebCore/html/HTMLFrameSetElement.cpp
@@ -135,6 +135,10 @@
         document()->setWindowAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(document()->frame(), attr));
     else if (attr->name() == onfocusAttr)
         document()->setWindowAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(document()->frame(), attr));
+    else if (attr->name() == onfocusinAttr)
+        document()->setWindowAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(document()->frame(), attr));
+    else if (attr->name() == onfocusoutAttr)
+        document()->setWindowAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(document()->frame(), attr));
 #if ENABLE(ORIENTATION_EVENTS)
     else if (attr->name() == onorientationchangeAttr)
         document()->setWindowAttributeEventListener(eventNames().orientationchangeEvent, createAttributeEventListener(document()->frame(), attr));
diff --git a/WebCore/html/HTMLFrameSetElement.idl b/WebCore/html/HTMLFrameSetElement.idl
index 3a761ae..9763460 100644
--- a/WebCore/html/HTMLFrameSetElement.idl
+++ b/WebCore/html/HTMLFrameSetElement.idl
@@ -28,31 +28,31 @@
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
         // Event handler attributes
-        attribute [DontEnum] EventListener onbeforeunload;
-        attribute [DontEnum] EventListener onhashchange;
-        attribute [DontEnum] EventListener onmessage;
-        attribute [DontEnum] EventListener onoffline;
-        attribute [DontEnum] EventListener ononline;
-        attribute [DontEnum] EventListener onpopstate;
-        attribute [DontEnum] EventListener onresize;
-        attribute [DontEnum] EventListener onstorage;
-        attribute [DontEnum] EventListener onunload;
+        attribute [DontEnum, WindowEventListener] EventListener onbeforeunload;
+        attribute [DontEnum, WindowEventListener] EventListener onhashchange;
+        attribute [DontEnum, WindowEventListener] EventListener onmessage;
+        attribute [DontEnum, WindowEventListener] EventListener onoffline;
+        attribute [DontEnum, WindowEventListener] EventListener ononline;
+        attribute [DontEnum, WindowEventListener] EventListener onpopstate;
+        attribute [DontEnum, WindowEventListener] EventListener onresize;
+        attribute [DontEnum, WindowEventListener] EventListener onstorage;
+        attribute [DontEnum, WindowEventListener] EventListener onunload;
 
 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
         attribute [DontEnum] EventListener onorientationchange;
 #endif
 
-        // Overrides of Element attributes (left in for completeness).
-        // attribute [DontEnum] EventListener onblur;
-        // attribute [DontEnum] EventListener onerror;
-        // attribute [DontEnum] EventListener onfocus;
-        // attribute [DontEnum] EventListener onload;
+        // Overrides of Element attributes (with different implementation in bindings).
+        attribute [DontEnum, WindowEventListener] EventListener onblur;
+        attribute [DontEnum, WindowEventListener] EventListener onerror;
+        attribute [DontEnum, WindowEventListener] EventListener onfocus;
+        attribute [DontEnum, WindowEventListener] EventListener onload;
 
         // Not implemented yet.
-        // attribute [DontEnum] EventListener onafterprint;
-        // attribute [DontEnum] EventListener onbeforeprint;
-        // attribute [DontEnum] EventListener onredo;
-        // attribute [DontEnum] EventListener onundo;
+        // attribute [DontEnum, WindowEventListener] EventListener onafterprint;
+        // attribute [DontEnum, WindowEventListener] EventListener onbeforeprint;
+        // attribute [DontEnum, WindowEventListener] EventListener onredo;
+        // attribute [DontEnum, WindowEventListener] EventListener onundo;
 #endif
     };
 
diff --git a/WebCore/html/HTMLIFrameElement.cpp b/WebCore/html/HTMLIFrameElement.cpp
index 359bdb7..cce39df 100644
--- a/WebCore/html/HTMLIFrameElement.cpp
+++ b/WebCore/html/HTMLIFrameElement.cpp
@@ -30,7 +30,7 @@
 #include "HTMLDocument.h"
 #include "HTMLNames.h"
 #include "MappedAttribute.h"
-#include "RenderPartObject.h"
+#include "RenderIFrame.h"
 
 namespace WebCore {
 
@@ -67,6 +67,7 @@
     return HTMLFrameElementBase::mapToEntry(attrName, result);
 }
 
+#if ENABLE(SANDBOX)
 static SandboxFlags parseSandboxAttribute(MappedAttribute* attribute)
 {
     if (attribute->isNull())
@@ -94,12 +95,15 @@
             flags &= ~SandboxForms;
         else if (equalIgnoringCase(sandboxToken, "allow-scripts"))
             flags &= ~SandboxScripts;
+        else if (equalIgnoringCase(sandboxToken, "allow-top-navigation"))
+            flags &= ~SandboxTopNavigation;
 
         start = end + 1;
     }
-    
+
     return flags;
 }
+#endif
 
 void HTMLIFrameElement::parseMappedAttribute(MappedAttribute* attr)
 {
@@ -123,8 +127,11 @@
         if (!attr->isNull() && !attr->value().toInt())
             // Add a rule that nulls out our border width.
             addCSSLength(attr, CSSPropertyBorderWidth, "0");
-    } else if (attr->name() == sandboxAttr)
+    }
+#if ENABLE(SANDBOX)
+    else if (attr->name() == sandboxAttr)
         setSandboxFlags(parseSandboxAttribute(attr));
+#endif
     else
         HTMLFrameElementBase::parseMappedAttribute(attr);
 }
@@ -136,7 +143,7 @@
 
 RenderObject* HTMLIFrameElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    return new (arena) RenderPartObject(this);
+    return new (arena) RenderIFrame(this);
 }
 
 void HTMLIFrameElement::insertedIntoDocument()
diff --git a/WebCore/html/HTMLImageElement.cpp b/WebCore/html/HTMLImageElement.cpp
index d3cea92..db66533 100644
--- a/WebCore/html/HTMLImageElement.cpp
+++ b/WebCore/html/HTMLImageElement.cpp
@@ -435,4 +435,10 @@
     addSubresourceURL(urls, document()->completeURL(getAttribute(usemapAttr)));
 }
 
+void HTMLImageElement::willMoveToNewOwnerDocument()
+{
+    m_imageLoader.elementWillMoveToNewOwnerDocument();
+    HTMLElement::willMoveToNewOwnerDocument();
+}
+
 }
diff --git a/WebCore/html/HTMLImageElement.h b/WebCore/html/HTMLImageElement.h
index d7df1dc..e9b813c 100644
--- a/WebCore/html/HTMLImageElement.h
+++ b/WebCore/html/HTMLImageElement.h
@@ -105,6 +105,9 @@
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
 
+protected:
+    virtual void willMoveToNewOwnerDocument();
+
 private:
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index c3f6703..60669ef 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
  *
@@ -60,6 +60,7 @@
 #include "RenderText.h"
 #include "RenderTextControlSingleLine.h"
 #include "RenderTheme.h"
+#include "StepRange.h"
 #include "StringHash.h"
 #include "TextEvent.h"
 #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
@@ -157,13 +158,14 @@
 {
     if (m_autocomplete != Uninitialized)
         return m_autocomplete == On;
-    
-    // Assuming we're still in a Form, respect the Form's setting
-    if (HTMLFormElement* form = this->form())
-        return form->autoComplete();
-    
-    // The default is true
-    return true;
+    return HTMLTextFormControlElement::autoComplete();
+}
+
+static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement* element)
+{
+    if (HTMLFormElement* form = element->form())
+        return form->checkedRadioButtons();
+    return element->document()->checkedRadioButtons();
 }
 
 bool HTMLInputElement::valueMissing() const
@@ -190,7 +192,7 @@
         case CHECKBOX:
             return !checked();
         case RADIO:
-            return !document()->checkedRadioButtons().checkedButtonForGroup(name());
+            return !checkedRadioButtons(this).checkedButtonForGroup(name());
         case COLOR:
             return false;
         case BUTTON:
@@ -270,7 +272,7 @@
         bool userEdited = !m_data.value().isNull();
         if (!userEdited)
             return false;
-        return value().numGraphemeClusters() > static_cast<unsigned>(max);
+        return numGraphemeClusters(value()) > static_cast<unsigned>(max);
     }
     case BUTTON:
     case CHECKBOX:
@@ -305,12 +307,13 @@
     case DATETIMELOCAL:
     case MONTH:
     case NUMBER:
-    case RANGE:
     case TIME:
     case WEEK: {
         double doubleValue = parseToDouble(value(), nan);
         return isfinite(doubleValue) && doubleValue < minimum();
     }
+    case RANGE: // Guaranteed by sanitization.
+        ASSERT(parseToDouble(value(), nan) >= minimum());
     case BUTTON:
     case CHECKBOX:
     case COLOR:
@@ -341,12 +344,13 @@
     case DATETIMELOCAL:
     case MONTH:
     case NUMBER:
-    case RANGE:
     case TIME:
     case WEEK: {
         double doubleValue = parseToDouble(value(), nan);
-        return isfinite(doubleValue) && doubleValue >  maximum();
+        return isfinite(doubleValue) && doubleValue > maximum();
     }
+    case RANGE: // Guaranteed by sanitization.
+        ASSERT(parseToDouble(value(), nan) <= maximum());
     case BUTTON:
     case CHECKBOX:
     case COLOR:
@@ -499,7 +503,8 @@
     switch (inputType()) {
     case RANGE:
         // stepMismatch doesn't occur for RANGE. RenderSlider guarantees the
-        // value matches to step.
+        // value matches to step on user input, and sanitation takes care
+        // of the general case.
         return false;
     case NUMBER: {
         double doubleValue;
@@ -681,14 +686,6 @@
     applyStep(-n, ec);
 }
 
-static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
-{
-    if (HTMLFormElement* form = element->form())
-        return form->checkedRadioButtons();
-    
-    return element->document()->checkedRadioButtons();
-}
-
 bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
 {
     // If text fields can be focused, then they should always be keyboard focusable
@@ -809,7 +806,6 @@
     // type change, otherwise a JavaScript programmer would be able to set a text
     // field's value to something like /etc/passwd and then change it to a file field.
     if (inputType() != newType) {
-        bool oldWillValidate = willValidate();
         if (newType == FILE && m_haveType)
             // Set the attribute back to the old value.
             // Useful in case we were called from inside parseMappedAttribute.
@@ -828,6 +824,7 @@
             bool wasPasswordField = inputType() == PASSWORD;
             bool didRespectHeightAndWidth = respectHeightAndWidthAttrs();
             m_type = newType;
+            setNeedsWillValidateCheck();
             bool willStoreValue = storesValueSeparateFromAttribute();
             bool isPasswordField = inputType() == PASSWORD;
             bool willRespectHeightAndWidth = respectHeightAndWidthAttrs();
@@ -867,8 +864,6 @@
         }
 
         setNeedsValidityCheck();
-        if (oldWillValidate != willValidate())
-            setNeedsWillValidateCheck();
         InputElement::notifyFormStateChanged(this);
     }
     m_haveType = true;
@@ -917,9 +912,6 @@
 
 bool HTMLInputElement::saveFormControlState(String& result) const
 {
-    if (!autoComplete())
-        return false;
-
     switch (inputType()) {
         case BUTTON:
         case COLOR:
@@ -941,9 +933,13 @@
         case TEXT:
         case TIME:
         case URL:
-        case WEEK:
-            result = value();
+        case WEEK: {
+            String currentValue = value();
+            if (currentValue == defaultValue())
+                return false;
+            result = currentValue;
             return true;
+        }
         case CHECKBOX:
         case RADIO:
             result = checked() ? "on" : "off";
@@ -1150,8 +1146,14 @@
                || attr->name() == incrementalAttr)
         setNeedsStyleRecalc();
     else if (attr->name() == minAttr
-             || attr->name() == maxAttr
-             || attr->name() == multipleAttr
+             || attr->name() == maxAttr) {
+        if (inputType() == RANGE) {
+            // Sanitize the value.
+            setValue(value());
+            setNeedsStyleRecalc();
+        }
+        setNeedsValidityCheck();
+    } else if (attr->name() == multipleAttr
              || attr->name() == patternAttr
              || attr->name() == precisionAttr
              || attr->name() == stepAttr)
@@ -1359,12 +1361,12 @@
             // If no filename at all is entered, return successful but empty.
             // Null would be more logical, but Netscape posts an empty file. Argh.
             if (!numFiles) {
-                encoding.appendFile(name(), File::create(""));
+                encoding.appendBlob(name(), File::create(""));
                 return true;
             }
 
             for (unsigned i = 0; i < numFiles; ++i)
-                encoding.appendFile(name(), m_fileList->item(i));
+                encoding.appendBlob(name(), m_fileList->item(i));
             return true;
         }
     }
@@ -1447,8 +1449,8 @@
 
 void HTMLInputElement::setIndeterminate(bool _indeterminate)
 {
-    // Only checkboxes honor indeterminate.
-    if (inputType() != CHECKBOX || indeterminate() == _indeterminate)
+    // Only checkboxes and radio buttons honor indeterminate.
+    if (!allowsIndeterminate() || indeterminate() == _indeterminate)
         return;
 
     m_indeterminate = _indeterminate;
@@ -1490,10 +1492,16 @@
     String value = m_data.value();
     if (value.isNull()) {
         value = sanitizeValue(getAttribute(valueAttr));
-
-        // If no attribute exists, then just use "on" or "" based off the checked() state of the control.
-        if (value.isNull() && (inputType() == CHECKBOX || inputType() == RADIO))
-            return checked() ? "on" : "";
+        
+        // If no attribute exists, extra handling may be necessary.
+        // For Checkbox Types just use "on" or "" based off the checked() state of the control.
+        // For a Range Input use the calculated default value.
+        if (value.isNull()) {
+            if (inputType() == CHECKBOX || inputType() == RADIO)
+                return checked() ? "on" : "";
+            else if (inputType() == RANGE)
+                return serializeForNumberType(StepRange(this).defaultValue());
+        }
     }
 
     return value;
@@ -1575,18 +1583,15 @@
             m_fileList->clear();
         else {
             m_data.setValue(sanitizeValue(value));
-            if (isTextField()) {
+            if (isTextField())
                 updatePlaceholderVisibility(false);
-                if (inDocument())
-                    document()->updateStyleIfNeeded();
-            }
         }
-        if (renderer())
-            renderer()->updateFromElement();
         setNeedsStyleRecalc();
     } else
         setAttribute(valueAttr, sanitizeValue(value));
 
+    setNeedsValidityCheck();
+
     if (isTextField()) {
         unsigned max = m_data.value().length();
 #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
@@ -1606,7 +1611,6 @@
         dispatchFormControlChangeEvent();
 
     InputElement::notifyFormStateChanged(this);
-    setNeedsValidityCheck();
 }
 
 double HTMLInputElement::parseToDouble(const String& src, double defaultValue) const
@@ -1989,6 +1993,16 @@
     return false;
 }
 
+struct EventHandlingState {
+    RefPtr<HTMLInputElement> m_currRadio;
+    bool m_indeterminate;
+    bool m_checked;
+    
+    EventHandlingState(bool indeterminate, bool checked)
+        : m_indeterminate(indeterminate)
+        , m_checked(checked) { }
+};
+
 void* HTMLInputElement::preDispatchEventHandler(Event *evt)
 {
     // preventDefault or "return false" are used to reverse the automatic checking/selection we do here.
@@ -1996,17 +2010,14 @@
     void* result = 0; 
     if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
             && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+        
+        EventHandlingState* state = new EventHandlingState(indeterminate(), checked());
+
         if (inputType() == CHECKBOX) {
-            // As a way to store the state, we return 0 if we were unchecked, 1 if we were checked, and 2 for
-            // indeterminate.
-            if (indeterminate()) {
-                result = (void*)0x2;
+            if (indeterminate())
                 setIndeterminate(false);
-            } else {
-                if (checked())
-                    result = (void*)0x1;
+            else
                 setChecked(!checked(), true);
-            }
         } else {
             // For radio buttons, store the current selected radio object.
             // We really want radio groups to end up in sane states, i.e., to have something checked.
@@ -2016,11 +2027,13 @@
             if (currRadio) {
                 // We have a radio button selected that is not us.  Cache it in our result field and ref it so
                 // that it can't be destroyed.
-                currRadio->ref();
-                result = currRadio;
+                state->m_currRadio = currRadio;
             }
+            if (indeterminate())
+                setIndeterminate(false);
             setChecked(true, true);
         }
+        result = state;
     }
     return result;
 }
@@ -2029,28 +2042,30 @@
 {
     if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
             && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
-        if (inputType() == CHECKBOX) {
-            // Reverse the checking we did in preDispatch.
-            if (evt->defaultPrevented() || evt->defaultHandled()) {
-                if (data == (void*)0x2)
-                    setIndeterminate(true);
-                else
-                    setChecked(data);
-            }
-        } else if (data) {
-            HTMLInputElement* input = static_cast<HTMLInputElement*>(data);
-            if (evt->defaultPrevented() || evt->defaultHandled()) {
-                // Restore the original selected radio button if possible.
-                // Make sure it is still a radio button and only do the restoration if it still
-                // belongs to our group.
+        
+        if (EventHandlingState* state = reinterpret_cast<EventHandlingState*>(data)) {
+            if (inputType() == CHECKBOX) {
+                // Reverse the checking we did in preDispatch.
+                if (evt->defaultPrevented() || evt->defaultHandled()) {
+                    setIndeterminate(state->m_indeterminate);
+                    setChecked(state->m_checked);
+                }
+            } else {
+                HTMLInputElement* input = state->m_currRadio.get();
+                if (evt->defaultPrevented() || evt->defaultHandled()) {
+                    // Restore the original selected radio button if possible.
+                    // Make sure it is still a radio button and only do the restoration if it still
+                    // belongs to our group.
 
-                if (input->form() == form() && input->inputType() == RADIO && input->name() == name()) {
-                    // Ok, the old radio button is still in our form and in our group and is still a 
-                    // radio button, so it's safe to restore selection to it.
-                    input->setChecked(true);
+                    if (input && input->form() == form() && input->inputType() == RADIO && input->name() == name()) {
+                        // Ok, the old radio button is still in our form and in our group and is still a 
+                        // radio button, so it's safe to restore selection to it.
+                        input->setChecked(true);
+                    }
+                    setIndeterminate(state->m_indeterminate);
                 }
             }
-            input->deref();
+            delete state;
         }
 
         // Left clicks on radio buttons and check boxes already performed default actions in preDispatchEventHandler(). 
@@ -2505,6 +2520,13 @@
 {
     if (isTextField())
         return InputElement::sanitizeValue(this, proposedValue);
+
+    // If the proposedValue is null than this is a reset scenario and we
+    // want the range input's value attribute to take priority over the
+    // calculated default (middle) value.
+    if (inputType() == RANGE && !proposedValue.isNull())
+        return serializeForNumberType(StepRange(this).clampValue(proposedValue));
+
     return proposedValue;
 }
 
@@ -2592,6 +2614,9 @@
 
 void HTMLInputElement::willMoveToNewOwnerDocument()
 {
+    if (m_imageLoader)
+        m_imageLoader->elementWillMoveToNewOwnerDocument();
+
     // Always unregister for cache callbacks when leaving a document, even if we would otherwise like to be registered
     if (needsActivationCallback())
         document()->unregisterForDocumentActivationCallbacks(this);
@@ -2615,11 +2640,10 @@
     addSubresourceURL(urls, src());
 }
 
-bool HTMLInputElement::willValidate() const
+bool HTMLInputElement::recalcWillValidate() const
 {
-    // FIXME: This shall check for new WF2 input types too
-    return HTMLFormControlElementWithState::willValidate() && inputType() != HIDDEN &&
-           inputType() != BUTTON && inputType() != RESET;
+    return HTMLFormControlElementWithState::recalcWillValidate()
+        && inputType() != HIDDEN && inputType() != BUTTON && inputType() != RESET;
 }
 
 String HTMLInputElement::serializeForNumberType(double number)
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 40930ac..c3b0a73 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -131,8 +131,12 @@
 
     bool checked() const { return m_checked; }
     void setChecked(bool, bool sendChangeEvent = false);
+
+    // 'indeterminate' is a state independent of the checked state that causes the control to draw in a way that hides the actual state.
+    bool allowsIndeterminate() const { return inputType() == CHECKBOX || inputType() == RADIO; }
     bool indeterminate() const { return m_indeterminate; }
     void setIndeterminate(bool);
+
     virtual int size() const;
     virtual const AtomicString& formControlType() const;
     void setType(const String&);
@@ -257,8 +261,6 @@
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
     
-    virtual bool willValidate() const;
-
     // Converts the specified string to a floating number.
     // If the conversion fails, the return value is false. Take care that leading or trailing unnecessary characters make failures.  This returns false for an empty string input.
     // The double* parameter may be 0.
@@ -291,6 +293,7 @@
 
     virtual bool isOptionalFormControl() const { return !isRequiredFormControl(); }
     virtual bool isRequiredFormControl() const;
+    virtual bool recalcWillValidate() const;
 
     PassRefPtr<HTMLFormElement> createTemporaryFormForIsIndex();
     // Helper for getAllowedValueStep();
diff --git a/WebCore/html/HTMLLabelElement.cpp b/WebCore/html/HTMLLabelElement.cpp
index 06b3b2f..645017d 100644
--- a/WebCore/html/HTMLLabelElement.cpp
+++ b/WebCore/html/HTMLLabelElement.cpp
@@ -139,6 +139,8 @@
 {
     if (HTMLElement* element = correspondingControl())
         element->accessKeyAction(sendToAnyElement);
+    else
+        HTMLElement::accessKeyAction(sendToAnyElement);
 }
 
 String HTMLLabelElement::accessKey() const
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index daa1702..7942e67 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -26,7 +26,6 @@
 
 #include "CSSHelper.h"
 #include "CachedCSSStyleSheet.h"
-#include "DNS.h"
 #include "DocLoader.h"
 #include "Document.h"
 #include "Frame.h"
@@ -38,6 +37,7 @@
 #include "MediaList.h"
 #include "MediaQueryEvaluator.h"
 #include "Page.h"
+#include "ResourceHandle.h"
 #include "ScriptEventListener.h"
 #include "Settings.h"
 #include <wtf/StdLibExtras.h>
@@ -201,6 +201,7 @@
     if (m_rel.m_isIcon && m_url.isValid() && !m_url.isEmpty())
         document()->setIconURL(m_url.string(), type);
 
+<<<<<<< HEAD
 #ifdef ANDROID_APPLE_TOUCH_ICON
     if ((m_rel.m_isTouchIcon || m_rel.m_isPrecomposedTouchIcon) && m_url.isValid()
             && !m_url.isEmpty())
@@ -211,6 +212,10 @@
 
     if (m_rel.m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
         prefetchDNS(m_url.host());
+=======
+    if (m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
+        ResourceHandle::prepareForURL(m_url);
+>>>>>>> webkit.org at r58033
 
 #if ENABLE(LINK_PREFETCH)
     if (m_rel.m_isLinkPrefetch && m_url.isValid()) {
@@ -231,7 +236,7 @@
         
         String charset = getAttribute(charsetAttr);
         if (charset.isEmpty() && document()->frame())
-            charset = document()->frame()->loader()->encoding();
+            charset = document()->frame()->loader()->writer()->encoding();
 
         if (m_cachedSheet) {
             if (m_loading)
diff --git a/WebCore/html/HTMLMapElement.cpp b/WebCore/html/HTMLMapElement.cpp
index 9617afc..10a05d6 100644
--- a/WebCore/html/HTMLMapElement.cpp
+++ b/WebCore/html/HTMLMapElement.cpp
@@ -79,7 +79,7 @@
 
 HTMLImageElement* HTMLMapElement::imageElement() const
 {
-    RefPtr<HTMLCollection> coll = renderer()->document()->images();
+    RefPtr<HTMLCollection> coll = document()->images();
     for (Node* curr = coll->firstItem(); curr; curr = coll->nextItem()) {
         if (!curr->hasTagName(imgTag))
             continue;
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index e5594ae..20fa7f8 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -70,7 +70,7 @@
 #endif
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-#include "RenderPartObject.h"
+#include "RenderEmbeddedObject.h"
 #include "Widget.h"
 #endif
 
@@ -101,9 +101,14 @@
     , m_loadState(WaitingForSource)
     , m_currentSourceNode(0)
     , m_player(0)
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    , m_proxyWidget(0)
+#endif
     , m_restrictions(NoRestrictions)
+    , m_preload(MediaPlayer::Auto)
     , m_playing(false)
     , m_processingMediaPlayerCallback(0)
+    , m_isWaitingUntilMediaCanStart(false)
     , m_processingLoad(false)
     , m_delayingTheLoadEvent(false)
     , m_haveFiredLoadedData(false)
@@ -128,6 +133,11 @@
 
 HTMLMediaElement::~HTMLMediaElement()
 {
+    if (m_isWaitingUntilMediaCanStart) {
+        if (Page* page = document()->page())
+            page->removeMediaCanStartListener(this);
+    }
+
     document()->unregisterForDocumentActivationCallbacks(this);
     document()->unregisterForMediaVolumeCallbacks(this);
 }
@@ -158,10 +168,10 @@
 
     const QualifiedName& attrName = attr->name();
     if (attrName == srcAttr) {
-        // don't have a src or any <source> children, trigger load
-        if (inDocument() && m_loadState == WaitingForSource)
+        // Trigger a reload, as long as the 'src' attribute is present.
+        if (!getAttribute(srcAttr).isEmpty())
             scheduleLoad();
-    } 
+    }
 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     else if (attrName == controlsAttr) {
         if (!isVideo() && attached() && (controls() != (renderer() != 0))) {
@@ -178,9 +188,23 @@
 {
     const QualifiedName& attrName = attr->name();
 
-    if (attrName == autobufferAttr) {
-        if (m_player)
-            m_player->setAutobuffer(!attr->isNull());
+    if (attrName == preloadAttr) {
+        String value = attr->value();
+
+        if (equalIgnoringCase(value, "none"))
+            m_preload = MediaPlayer::None;
+        else if (equalIgnoringCase(value, "metadata"))
+            m_preload = MediaPlayer::MetaData;
+        else {
+            // The spec does not define an "invalid value default" but "auto" is suggested as the
+            // "missing value default", so use it for everything except "none" and "metadata"
+            m_preload = MediaPlayer::Auto;
+        }
+
+        // The attribute must be ignored if the autoplay attribute is present
+        if (!autoplay() && m_player)
+            m_player->setPreload(m_preload);
+
     } else if (attrName == onabortAttr)
         setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attr));
     else if (attrName == onbeforeloadAttr)
@@ -254,7 +278,11 @@
 RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    return new (arena) RenderEmbeddedObject(this);
+    // Setup the renderer if we already have a proxy widget.
+    RenderEmbeddedObject* mediaRenderer = new (arena) RenderEmbeddedObject(this);
+    if (m_proxyWidget)
+        mediaRenderer->setWidget(m_proxyWidget);
+    return mediaRenderer;
 #else
     return new (arena) RenderMedia(this);
 #endif
@@ -300,6 +328,10 @@
 
 void HTMLMediaElement::scheduleLoad()
 {
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    createMediaPlayerProxy();
+#endif
+
     if (m_loadTimer.isActive())
         return;
     prepareForLoad();
@@ -439,39 +471,30 @@
     m_sentStalledEvent = false;
     m_haveFiredLoadedData = false;
 
-    // 2 - Abort any already-running instance of the resource selection algorithm for this element.
+    // 1 - Abort any already-running instance of the resource selection algorithm for this element.
     m_currentSourceNode = 0;
 
-    // 3 - If there are any tasks from the media element's media element event task source in 
+    // 2 - If there are any tasks from the media element's media element event task source in 
     // one of the task queues, then remove those tasks.
     cancelPendingEventsAndCallbacks();
-}
-
-void HTMLMediaElement::loadInternal()
-{
-    // If the load() method for this element is already being invoked, then abort these steps.
-    if (m_processingLoad)
-        return;
-    m_processingLoad = true;
-    
-    // Steps 1 and 2 were done in prepareForLoad()
 
     // 3 - If the media element's networkState is set to NETWORK_LOADING or NETWORK_IDLE, queue
     // a task to fire a simple event named abort at the media element.
     if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE)
         scheduleEvent(eventNames().abortEvent);
 
-    // 4
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    m_player = MediaPlayer::create(this);
+#else
+    createMediaPlayerProxy();
+#endif
+
+    // 4 - If the media element's networkState is not set to NETWORK_EMPTY, then run these substeps
     if (m_networkState != NETWORK_EMPTY) {
         m_networkState = NETWORK_EMPTY;
         m_readyState = HAVE_NOTHING;
         m_paused = true;
         m_seeking = false;
-        if (m_player) {
-            m_player->pause();
-            m_playing = false;
-            m_player->seek(0);
-        }
         scheduleEvent(eventNames().emptiedEvent);
     }
 
@@ -486,6 +509,22 @@
     m_lastSeekTime = 0;
     m_closedCaptionsVisible = false;
 
+}
+
+void HTMLMediaElement::loadInternal()
+{
+    // If we can't start a load right away, start it later.
+    Page* page = document()->page();
+    if (page && !page->canStartMedia()) {
+        if (m_isWaitingUntilMediaCanStart)
+            return;
+        page->addMediaCanStartListener(this);
+        m_isWaitingUntilMediaCanStart = true;
+        return;
+    }
+
+    // Steps 1 - 6 were done in prepareForLoad
+
     // 7 - Invoke the media element's resource selection algorithm.
     selectMediaResource();
     m_processingLoad = false;
@@ -552,6 +591,11 @@
         return;
     }
 
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    // Recreate the media player for the new url
+    m_player = MediaPlayer::create(this);
+#endif
+
     m_loadState = LoadingFromSourceElement;
     loadResource(mediaURL, contentType);
 }
@@ -579,14 +623,8 @@
     if (m_sendProgressEvents) 
         startProgressEventTimer();
 
-#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    m_player = MediaPlayer::create(this);
-#else
-    if (!m_player)
-        m_player = MediaPlayer::create(this);
-#endif
-
-    m_player->setAutobuffer(autobuffer());
+    if (!autoplay())
+        m_player->setPreload(m_preload);
     m_player->setPreservesPitch(m_webkitPreservesPitch);
     updateVolume();
 
@@ -599,7 +637,7 @@
 #endif
 
     if (isVideo() && m_player->canLoadPoster()) {
-        KURL posterUrl = static_cast<HTMLVideoElement*>(this)->poster();
+        KURL posterUrl = poster();
         if (!posterUrl.isEmpty())
             m_player->setPoster(posterUrl);
     }
@@ -712,6 +750,16 @@
     }
 }
 
+Document* HTMLMediaElement::mediaPlayerOwningDocument()
+{
+    Document* d = document();
+    
+    if (!d)
+        d = ownerDocument();
+    
+    return d;
+}
+
 void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
 {
     beginProcessingMediaPlayerCallback();
@@ -755,7 +803,7 @@
 
     if (state == MediaPlayer::Idle) {
         if (m_networkState > NETWORK_IDLE) {
-            stopPeriodicTimers();
+            m_progressEventTimer.stop();
             scheduleEvent(eventNames().suspendEvent);
         }
         m_networkState = NETWORK_IDLE;
@@ -1042,7 +1090,7 @@
 
 float HTMLMediaElement::duration() const
 {
-    if (m_readyState >= HAVE_METADATA)
+    if (m_player && m_readyState >= HAVE_METADATA)
         return m_player->duration();
 
     return numeric_limits<float>::quiet_NaN();
@@ -1114,14 +1162,27 @@
     setBooleanAttribute(autoplayAttr, b);
 }
 
-bool HTMLMediaElement::autobuffer() const
+String HTMLMediaElement::preload() const
 {
-    return hasAttribute(autobufferAttr);
+    switch (m_preload) {
+    case MediaPlayer::None:
+        return "none";
+        break;
+    case MediaPlayer::MetaData:
+        return "metadata";
+        break;
+    case MediaPlayer::Auto:
+        return "auto";
+        break;
+    }
+
+    ASSERT_NOT_REACHED();
+    return String();
 }
 
-void HTMLMediaElement::setAutobuffer(bool b)
+void HTMLMediaElement::setPreload(const String& preload)
 {
-    setBooleanAttribute(autobufferAttr, b);
+    setAttribute(preloadAttr, preload);
 }
 
 void HTMLMediaElement::play(bool isUserGesture)
@@ -1200,7 +1261,7 @@
     Frame* frame = document()->frame();
 
     // always show controls when scripting is disabled
-    if (frame && !frame->script()->canExecuteScripts())
+    if (frame && !frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         return true;
 
     return hasAttribute(controlsAttr);
@@ -1241,7 +1302,7 @@
         m_muted = muted;
         // Avoid recursion when the player reports volume changes.
         if (!processingMediaPlayerCallback()) {
-            if (m_player && m_player->supportsMuting()) {
+            if (m_player) {
                 m_player->setMuted(m_muted);
                 if (renderer())
                     renderer()->updateFromElement();
@@ -1645,7 +1706,8 @@
         Page* page = document()->page();
         float volumeMultiplier = page ? page->mediaVolume() : 1;
     
-        m_player->setVolume(m_muted ? 0 : m_volume * volumeMultiplier);
+        m_player->setMuted(m_muted);
+        m_player->setVolume(m_volume * volumeMultiplier);
     }
     
     if (renderer())
@@ -1735,6 +1797,9 @@
 
     // 7 - Abort the overall resource selection algorithm.
     m_currentSourceNode = 0;
+
+    // Reset m_readyState since m_player is gone.
+    m_readyState = HAVE_NOTHING;
 }
 
 void HTMLMediaElement::documentWillBecomeInactive()
@@ -1778,12 +1843,11 @@
     updateVolume();
 }
 
-const IntRect HTMLMediaElement::screenRect()
+IntRect HTMLMediaElement::screenRect()
 {
-    IntRect elementRect;
-    if (renderer())
-        elementRect = renderer()->view()->frameView()->contentsToScreen(renderer()->absoluteBoundingBoxRect());
-    return elementRect;
+    if (!renderer())
+        return IntRect();
+    return renderer()->view()->frameView()->contentsToScreen(renderer()->absoluteBoundingBoxRect());
 }
     
 void HTMLMediaElement::defaultEventHandler(Event* event)
@@ -1816,6 +1880,12 @@
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
 
+void HTMLMediaElement::ensureMediaPlayer()
+{
+    if (!m_player)
+        m_player = MediaPlayer::create(this);
+}
+
 void HTMLMediaElement::deliverNotification(MediaPlayerProxyNotificationType notification)
 {
     if (notification == MediaPlayerNotificationPlayPauseButtonPressed) {
@@ -1829,34 +1899,76 @@
 
 void HTMLMediaElement::setMediaPlayerProxy(WebMediaPlayerProxy* proxy)
 {
-    if (m_player)
-        m_player->setMediaPlayerProxy(proxy);
+    ensureMediaPlayer();
+    m_player->setMediaPlayerProxy(proxy);
 }
 
-String HTMLMediaElement::initialURL()
+void HTMLMediaElement::getPluginProxyParams(KURL& url, Vector<String>& names, Vector<String>& values)
 {
-    KURL initialSrc = document()->completeURL(getAttribute(srcAttr));
-    
-    if (!initialSrc.isValid())
-        initialSrc = selectNextSourceChild(0, DoNothing);
+    Frame* frame = document()->frame();
+    FrameLoader* loader = frame ? frame->loader() : 0;
 
-    m_currentSrc = initialSrc.string();
+    if (isVideo()) {
+        String poster = poster();
+        if (!poster.isEmpty() && loader) {
+            KURL posterURL = loader->completeURL(poster);
+            if (posterURL.isValid() && loader->willLoadMediaElementURL(posterURL)) {
+                names.append("_media_element_poster_");
+                values.append(posterURL.string());
+            }
+        }
+    }
 
-    return initialSrc;
+    if (controls()) {
+        names.append("_media_element_controls_");
+        values.append("true");
+    }
+
+    url = src();
+    if (!url.isValid() || !isSafeToLoadURL(url, Complain))
+        url = selectNextSourceChild(0, DoNothing);
+
+    m_currentSrc = url.string();
+    if (url.isValid() && loader && loader->willLoadMediaElementURL(url)) {
+        names.append("_media_element_src_");
+        values.append(m_currentSrc);
+    }
 }
 
 void HTMLMediaElement::finishParsingChildren()
 {
     HTMLElement::finishParsingChildren();
-    if (!m_player)
-        m_player = MediaPlayer::create(this);
-    
     document()->updateStyleIfNeeded();
-    if (m_needWidgetUpdate && renderer())
-        toRenderEmbeddedObject(renderer())->updateWidget(true);
+    createMediaPlayerProxy();
 }
 
-#endif
+void HTMLMediaElement::createMediaPlayerProxy()
+{
+    ensureMediaPlayer();
+
+    if (!inDocument() && m_proxyWidget)
+        return;
+    if (inDocument() && !m_needWidgetUpdate)
+        return;
+
+    Frame* frame = document()->frame();
+    FrameLoader* loader = frame ? frame->loader() : 0;
+    if (!loader)
+        return;
+
+    KURL url;
+    Vector<String> paramNames;
+    Vector<String> paramValues;
+
+    getPluginProxyParams(url, paramNames, paramValues);
+    
+    // Hang onto the proxy widget so it won't be destroyed if the plug-in is set to
+    // display:none
+    m_proxyWidget = loader->loadMediaPlayerProxyPlugin(this, url, paramNames, paramValues);
+    if (m_proxyWidget)
+        m_needWidgetUpdate = false;
+}
+#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
 
 void HTMLMediaElement::enterFullscreen()
 {
@@ -1927,6 +2039,13 @@
     return hasClosedCaptions();
 }
 
+void HTMLMediaElement::mediaCanStart()
+{
+    ASSERT(m_isWaitingUntilMediaCanStart);
+    m_isWaitingUntilMediaCanStart = false;
+    loadInternal();
+}
+
 }
 
 #endif
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 07801da..83e1f2c 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -29,8 +29,8 @@
 #if ENABLE(VIDEO)
 
 #include "HTMLElement.h"
+#include "MediaCanStartListener.h"
 #include "MediaPlayer.h"
-#include "Timer.h"
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
 #include "MediaPlayerProxy.h"
@@ -43,23 +43,16 @@
 class MediaError;
 class KURL;
 class TimeRanges;
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+class Widget;
+#endif
 
-class HTMLMediaElement : public HTMLElement, public MediaPlayerClient {
+// FIXME: The inheritance from MediaPlayerClient here should be private inheritance.
+// 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 MediaPlayerClient, private MediaCanStartListener {
 public:
-    virtual ~HTMLMediaElement();
-
-    bool checkDTD(const Node* newChild);
-    
-    void attributeChanged(Attribute*, bool preserveDecls);
-    void parseMappedAttribute(MappedAttribute *);
-
-    virtual bool rendererIsNeeded(RenderStyle*);
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual void insertedIntoDocument();
-    virtual void removedFromDocument();
-    virtual void attach();
-    virtual void recalcStyle(StyleChange);
-    
     MediaPlayer* player() const { return m_player.get(); }
     
     virtual bool isVideo() const = 0;
@@ -71,6 +64,8 @@
 
     // Eventually overloaded in HTMLVideoElement
     virtual bool supportsFullscreen() const { return false; };
+    virtual const KURL poster() const { return KURL(); }
+
     virtual bool supportsSave() const;
     
     PlatformMedia platformMedia() const;
@@ -80,11 +75,6 @@
 
     void scheduleLoad();
     
-    virtual void defaultEventHandler(Event*);
-    
-    // Pauses playback without changing any states or generating events
-    void setPausedInternal(bool);
-    
     MediaPlayer::MovieLoadType movieLoadType() const;
     
     bool inActiveDocument() const { return m_inActiveDocument; }
@@ -100,8 +90,9 @@
 
     enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_LOADED, NETWORK_NO_SOURCE };
     NetworkState networkState() const;
-    bool autobuffer() const;    
-    void setAutobuffer(bool);
+    
+    String preload() const;    
+    void setPreload(const String&);
 
     PassRefPtr<TimeRanges> buffered() const;
     void load(bool isUserGesture, ExceptionCode&);
@@ -150,22 +141,25 @@
     void beginScrubbing();
     void endScrubbing();
 
-    const IntRect screenRect();
+    IntRect screenRect();
 
     bool canPlay() const;
 
     float percentLoaded() const;
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    void allocateMediaPlayerIfNecessary();
     void setNeedWidgetUpdate(bool needWidgetUpdate) { m_needWidgetUpdate = needWidgetUpdate; }
     void deliverNotification(MediaPlayerProxyNotificationType notification);
     void setMediaPlayerProxy(WebMediaPlayerProxy* proxy);
-    String initialURL();
+    void getPluginProxyParams(KURL& url, Vector<String>& names, Vector<String>& values);
     virtual void finishParsingChildren();
+    void createMediaPlayerProxy();
 #endif
 
     bool hasSingleSecurityOrigin() const { return !m_player || m_player->hasSingleSecurityOrigin(); }
     
+    bool isFullscreen() const { return m_isFullscreen; }
     void enterFullscreen();
     void exitFullscreen();
 
@@ -177,7 +171,25 @@
 
 protected:
     HTMLMediaElement(const QualifiedName&, Document*);
+    virtual ~HTMLMediaElement();
 
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void attach();
+
+    virtual void willMoveToNewOwnerDocument();
+    virtual void didMoveToNewOwnerDocument();
+
+private:
+    virtual bool checkDTD(const Node* newChild);    
+    virtual void attributeChanged(Attribute*, bool preserveDecls);
+    virtual bool rendererIsNeeded(RenderStyle*);
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+    virtual void insertedIntoDocument();
+    virtual void removedFromDocument();
+    virtual void recalcStyle(StyleChange);
+    
+    virtual void defaultEventHandler(Event*);
+    
     float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
     void setTimeOffsetAttribute(const QualifiedName&, float value);
     
@@ -189,10 +201,7 @@
     void setReadyState(MediaPlayer::ReadyState);
     void setNetworkState(MediaPlayer::NetworkState);
 
-    virtual void willMoveToNewOwnerDocument();
-    virtual void didMoveToNewOwnerDocument();
-
-private: // MediaPlayerClient
+    virtual Document* mediaPlayerOwningDocument();
     virtual void mediaPlayerNetworkStateChanged(MediaPlayer*);
     virtual void mediaPlayerReadyStateChanged(MediaPlayer*);
     virtual void mediaPlayerTimeChanged(MediaPlayer*);
@@ -208,7 +217,6 @@
     virtual void mediaPlayerRenderingModeChanged(MediaPlayer*);
 #endif
 
-private:
     void loadTimerFired(Timer<HTMLMediaElement>*);
     void asyncEventTimerFired(Timer<HTMLMediaElement>*);
     void progressEventTimerFired(Timer<HTMLMediaElement>*);
@@ -263,15 +271,19 @@
     float minTimeSeekable() const;
     float maxTimeSeekable() const;
 
-    // Restrictions to change default behaviors. This is a effectively a compile time choice at the moment
-    //  because there are no accessor methods.
+    // Pauses playback without changing any states or generating events
+    void setPausedInternal(bool);
+
+    virtual void mediaCanStart();
+
+    // Restrictions to change default behaviors. This is effectively a compile time choice at the moment
+    // because there are no accessor functions.
     enum BehaviorRestrictions {
         NoRestrictions = 0,
         RequireUserGestureForLoadRestriction = 1 << 0,
         RequireUserGestureForRateChangeRestriction = 1 << 1,
     };
 
-protected:
     Timer<HTMLMediaElement> m_loadTimer;
     Timer<HTMLMediaElement> m_asyncEventTimer;
     Timer<HTMLMediaElement> m_progressEventTimer;
@@ -303,18 +315,25 @@
     // loading state
     enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElement };
     LoadState m_loadState;
-    HTMLSourceElement *m_currentSourceNode;
+    HTMLSourceElement* m_currentSourceNode;
     
     OwnPtr<MediaPlayer> m_player;
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    RefPtr<Widget> m_proxyWidget;
+#endif
 
     BehaviorRestrictions m_restrictions;
+    
+    MediaPlayer::Preload m_preload;
 
     bool m_playing;
 
-    // counter incremented while processing a callback from the media player, so we can avoid
-    //  calling the media engine recursively
+    // Counter incremented while processing a callback from the media player, so we can avoid
+    // calling the media engine recursively.
     int m_processingMediaPlayerCallback;
 
+    bool m_isWaitingUntilMediaCanStart;
+
     bool m_processingLoad : 1;
     bool m_delayingTheLoadEvent : 1;
     bool m_haveFiredLoadedData : 1;
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 46a2b86..5cd3293 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -39,7 +39,7 @@
     const unsigned short NETWORK_LOADED = 3;
     const unsigned short NETWORK_NO_SOURCE = 4;
     readonly attribute unsigned short networkState;
-    attribute boolean autobuffer;
+    attribute DOMString preload;
 
     readonly attribute TimeRanges buffered;
     [NeedsUserGestureCheck] void load() 
diff --git a/WebCore/html/HTMLMetaElement.cpp b/WebCore/html/HTMLMetaElement.cpp
index f90ad0e..35fd299 100644
--- a/WebCore/html/HTMLMetaElement.cpp
+++ b/WebCore/html/HTMLMetaElement.cpp
@@ -68,6 +68,7 @@
 
 void HTMLMetaElement::process()
 {
+<<<<<<< HEAD
 #ifdef ANDROID_META_SUPPORT
     if (!inDocument() || m_content.isNull())
         return;
@@ -92,9 +93,17 @@
             android::WebViewCore::getWebViewCore(view)->updateViewport();
     }
 #endif
+=======
+    if (!inDocument() || m_content.isNull())
+        return;
+
+    if (equalIgnoringCase(name(), "viewport"))
+        document()->processViewport(m_content);
+
+>>>>>>> webkit.org at r58033
     // Get the document to process the tag, but only if we're actually part of DOM tree (changing a meta tag while
     // it's not in the tree shouldn't have any effect on the document)
-    if (inDocument() && !m_equiv.isNull() && !m_content.isNull())
+    if (!m_equiv.isNull())
         document()->processHttpEquiv(m_equiv, m_content);
 }
 
diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl
index 8d975ba..be91dc4 100644
--- a/WebCore/html/HTMLObjectElement.idl
+++ b/WebCore/html/HTMLObjectElement.idl
@@ -23,8 +23,7 @@
     interface [
         DelegatingPutFunction,
         DelegatingGetOwnPropertySlot,
-        CustomCall,
-        HasOverridingNameGetter
+        CustomCall
     ] HTMLObjectElement : HTMLElement {
         readonly attribute HTMLFormElement form;
                  attribute [ConvertNullToNullString, Reflect] DOMString       code;
diff --git a/WebCore/html/HTMLParser.cpp b/WebCore/html/HTMLParser.cpp
index 644f63e..c5839a8 100644
--- a/WebCore/html/HTMLParser.cpp
+++ b/WebCore/html/HTMLParser.cpp
@@ -400,7 +400,7 @@
         n->finishParsingChildren();
     }
 
-    if (localName == htmlTag && m_document->frame())
+    if (localName == htmlTag && m_document->frame() && !m_isParsingFragment)
         m_document->frame()->loader()->dispatchDocumentElementAvailable();
 
     return true;
@@ -446,7 +446,7 @@
             }
         } else if (h->hasLocalName(htmlTag)) {
             if (!m_current->isDocumentNode() ) {
-                if (m_document->documentElement() && m_document->documentElement()->hasTagName(htmlTag)) {
+                if (m_document->documentElement() && m_document->documentElement()->hasTagName(htmlTag) && !m_isParsingFragment) {
                     reportError(RedundantHTMLBodyError, &localName);
                     // we have another <HTML> element.... apply attributes to existing one
                     // make sure we don't overwrite already existing attributes
@@ -489,7 +489,7 @@
                 return false;
             }
         } else if (h->hasLocalName(bodyTag)) {
-            if (m_inBody && m_document->body()) {
+            if (m_inBody && m_document->body() && !m_isParsingFragment) {
                 // we have another <BODY> element.... apply attributes to existing one
                 // make sure we don't overwrite already existing attributes
                 // some sites use <body bgcolor=rightcolor>...<body bgcolor=wrongcolor>
@@ -503,8 +503,7 @@
                         existingBody->setAttribute(it->name(), it->value());
                 }
                 return false;
-            }
-            else if (!m_current->isDocumentNode())
+            } else if (!m_current->isDocumentNode())
                 return false;
         } else if (h->hasLocalName(areaTag)) {
             if (m_currentMapElement) {
@@ -551,7 +550,7 @@
                 if (!m_haveFrameSet) {
                     // Ensure that head exists.
                     // But not for older versions of Mail, where the implicit <head> isn't expected - <rdar://problem/6863795>
-                    if (shouldCreateImplicitHead(m_document))
+                    if (!m_isParsingFragment && shouldCreateImplicitHead(m_document))
                         createHead();
 
                     popBlock(headTag);
@@ -758,7 +757,7 @@
         // we can't implement that behaviour now because it could cause too many
         // regressions and the headaches are not worth the work as long as there is
         // no site actually relying on that detail (Dirk)
-        if (m_document->body())
+        if (m_document->body() && !m_isParsingFragment)
             m_document->body()->setAttribute(styleAttr, "display:none");
         m_inBody = false;
     }
@@ -876,8 +875,8 @@
 bool HTMLParser::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
 {
     if (!m_isParsingFragment) {
-        Settings* settings = m_document->settings();
-        if (settings && settings->isJavaScriptEnabled())
+        Frame* frame = m_document->frame();
+        if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
             setSkipMode(noscriptTag);
     }
     return true;
@@ -939,6 +938,7 @@
         gFunctionMap.set(h6Tag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
         gFunctionMap.set(headTag.localName().impl(), &HTMLParser::headCreateErrorCheck);
         gFunctionMap.set(headerTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
+        gFunctionMap.set(hgroupTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
         gFunctionMap.set(hrTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
         gFunctionMap.set(iTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(isindexTag.localName().impl(), &HTMLParser::isindexCreateErrorCheck);
@@ -1061,8 +1061,8 @@
             return true;
 #if !ENABLE(XHTMLMP)
         if (e->hasLocalName(noscriptTag) && !m_isParsingFragment) {
-            Settings* settings = m_document->settings();
-            if (settings && settings->isJavaScriptEnabled())
+            Frame* frame = m_document->frame();
+            if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
                 return true;
         }
 #endif
@@ -1590,12 +1590,16 @@
     if (m_head)
         return;
 
-    if (!m_document->documentElement()) {
+    if (!m_document->documentElement() && !m_isParsingFragment) {
         insertNode(new HTMLHtmlElement(htmlTag, m_document));
-        ASSERT(m_document->documentElement());
+        ASSERT(m_document->documentElement() || m_isParsingFragment);
     }
 
     m_head = new HTMLHeadElement(headTag, m_document);
+
+    if (m_isParsingFragment)
+        return;
+
     HTMLElement* body = m_document->body();
     ExceptionCode ec = 0;
     m_document->documentElement()->insertBefore(m_head.get(), body, ec);
diff --git a/WebCore/html/HTMLPlugInImageElement.cpp b/WebCore/html/HTMLPlugInImageElement.cpp
index 6dcd5fb..e2898a2 100644
--- a/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/WebCore/html/HTMLPlugInImageElement.cpp
@@ -34,10 +34,6 @@
 {
 }
 
-HTMLPlugInImageElement::~HTMLPlugInImageElement()
-{
-}
-
 bool HTMLPlugInImageElement::isImageType()
 {
     if (m_serviceType.isEmpty() && protocolIs(m_url, "data"))
@@ -51,4 +47,11 @@
     return Image::supportsType(m_serviceType);
 }
 
+void HTMLPlugInImageElement::willMoveToNewOwnerDocument()
+{
+    if (m_imageLoader)
+        m_imageLoader->elementWillMoveToNewOwnerDocument();
+    HTMLPlugInElement::willMoveToNewOwnerDocument();
+}
+
 } // namespace WebCore
diff --git a/WebCore/html/HTMLPlugInImageElement.h b/WebCore/html/HTMLPlugInImageElement.h
index 7725a5a..6f8d305 100644
--- a/WebCore/html/HTMLPlugInImageElement.h
+++ b/WebCore/html/HTMLPlugInImageElement.h
@@ -30,8 +30,6 @@
 
 class HTMLPlugInImageElement : public HTMLPlugInElement {
 public:
-    virtual ~HTMLPlugInImageElement();
-
     const String& serviceType() const { return m_serviceType; }
     const String& url() const { return m_url; }
 
@@ -43,6 +41,9 @@
     OwnPtr<HTMLImageLoader> m_imageLoader;
     String m_serviceType;
     String m_url;
+
+private:
+    virtual void willMoveToNewOwnerDocument();
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/HTMLProgressElement.cpp b/WebCore/html/HTMLProgressElement.cpp
new file mode 100644
index 0000000..6fa8043
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.cpp
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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"
+#if ENABLE(PROGRESS_TAG)
+#include "HTMLProgressElement.h"
+
+#include "EventNames.h"
+#include "FormDataList.h"
+#include "HTMLFormElement.h"
+#include "HTMLNames.h"
+#include "MappedAttribute.h"
+#include "RenderProgress.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+    : HTMLFormControlElement(tagName, document, form, CreateElement)
+{
+    ASSERT(hasTagName(progressTag));
+}
+
+PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+{
+    return adoptRef(new HTMLProgressElement(tagName, document, form));
+}
+
+RenderObject* HTMLProgressElement::createRenderer(RenderArena* arena, RenderStyle*)
+{
+    return new (arena) RenderProgress(this);
+}
+
+const AtomicString& HTMLProgressElement::formControlType() const
+{
+    DEFINE_STATIC_LOCAL(const AtomicString, progress, ("progress"));
+    return progress;
+}
+
+void HTMLProgressElement::parseMappedAttribute(MappedAttribute* attribute)
+{
+    if (attribute->name() == valueAttr) {
+        if (renderer())
+            renderer()->updateFromElement();
+    } else if (attribute->name() == maxAttr) {
+        if (renderer())
+            renderer()->updateFromElement();
+    } else
+        HTMLFormControlElement::parseMappedAttribute(attribute);
+}
+
+double HTMLProgressElement::value() const
+{
+    const AtomicString& valueString = getAttribute(valueAttr);
+    bool ok;
+    double value = valueString.toDouble(&ok);
+    if (!ok || value < 0)
+        return valueString.isNull() ? 1 : 0;
+    return (value > max()) ? max() : value;
+}
+
+void HTMLProgressElement::setValue(double value)
+{
+    setAttribute(valueAttr, String::number(value >= 0 ? value : 0));
+}
+
+double HTMLProgressElement::max() const
+{
+    bool ok;
+    double max = getAttribute(maxAttr).toDouble(&ok);
+    if (!ok || max <= 0)
+        return 1;
+    return max;
+}
+
+void HTMLProgressElement::setMax(double max)
+{
+    setAttribute(maxAttr, String::number(max > 0 ? max : 1));
+}
+
+double HTMLProgressElement::position() const
+{
+    if (!hasAttribute(valueAttr))
+        return -1;
+    return value() / max();
+}
+
+} // namespace
+#endif
diff --git a/WebCore/html/HTMLProgressElement.h b/WebCore/html/HTMLProgressElement.h
new file mode 100644
index 0000000..a925fc5
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 HTMLProgressElement_h
+#define HTMLProgressElement_h
+
+#if ENABLE(PROGRESS_TAG)
+#include "HTMLFormControlElement.h"
+
+namespace WebCore {
+
+class HTMLProgressElement : public HTMLFormControlElement {
+public:
+    static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*, HTMLFormElement* = 0);
+
+    double value() const;
+    void setValue(double);
+
+    double max() const;
+    void setMax(double);
+
+    double position() const;
+
+private:
+    HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*);
+
+    virtual bool isOptionalFormControl() const { return true; }
+
+    virtual const AtomicString& formControlType() const;
+
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+
+    virtual void parseMappedAttribute(MappedAttribute*);
+};
+
+} // namespace
+
+#endif
+#endif
diff --git a/WebCore/html/HTMLProgressElement.idl b/WebCore/html/HTMLProgressElement.idl
new file mode 100644
index 0000000..8da62aa
--- /dev/null
+++ b/WebCore/html/HTMLProgressElement.idl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ */
+
+module html {
+    interface [
+        Conditional=PROGRESS_TAG
+    ] HTMLProgressElement : HTMLElement {
+                 attribute  double                value;
+                 attribute  double                max;
+        readonly attribute  double                position;
+        readonly attribute  HTMLFormElement       form;
+    };
+
+}
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp
index 636c579..58c3b03 100644
--- a/WebCore/html/HTMLScriptElement.cpp
+++ b/WebCore/html/HTMLScriptElement.cpp
@@ -220,6 +220,11 @@
     return getAttribute(forAttr).string();
 }
 
+String HTMLScriptElement::eventAttributeValue() const
+{
+    return getAttribute(eventAttr).string();
+}
+
 void HTMLScriptElement::dispatchLoadEvent()
 {
     ASSERT(!m_data.haveFiredLoadEvent());
diff --git a/WebCore/html/HTMLScriptElement.h b/WebCore/html/HTMLScriptElement.h
index 4d18beb..b6d683f 100644
--- a/WebCore/html/HTMLScriptElement.h
+++ b/WebCore/html/HTMLScriptElement.h
@@ -83,6 +83,7 @@
     virtual String typeAttributeValue() const;
     virtual String languageAttributeValue() const;
     virtual String forAttributeValue() const;
+    virtual String eventAttributeValue() const;
 
     virtual void dispatchLoadEvent();
     virtual void dispatchErrorEvent();
diff --git a/WebCore/html/HTMLSelectElement.cpp b/WebCore/html/HTMLSelectElement.cpp
index 5f5c855..de40ff7 100644
--- a/WebCore/html/HTMLSelectElement.cpp
+++ b/WebCore/html/HTMLSelectElement.cpp
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2001 Dirk Mueller (mueller@kde.org)
@@ -87,9 +88,27 @@
 
 void HTMLSelectElement::setSelectedIndexByUser(int optionIndex, bool deselect, bool fireOnChangeNow)
 {
+    // Bail out if this index is already the selected one, to avoid running unnecessary JavaScript that can mess up
+    // autofill, when there is no actual change (see https://bugs.webkit.org/show_bug.cgi?id=35256 and rdar://7467917 ).
+    // Perhaps this logic could be moved into SelectElement, but some callers of SelectElement::setSelectedIndex()
+    // seem to expect it to fire its change event even when the index was already selected.
+    if (optionIndex == selectedIndex())
+        return;
+    
     SelectElement::setSelectedIndex(m_data, this, optionIndex, deselect, fireOnChangeNow, true);
 }
 
+void HTMLSelectElement::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
+{
+    if (!multiple())
+        setSelectedIndexByUser(listIndex, true, fireOnChangeNow);
+    else {
+        updateSelectedState(m_data, this, listIndex, allowMultiplySelections, shift);
+        if (fireOnChangeNow)
+            listBoxOnChange();
+    }
+}
+
 int HTMLSelectElement::activeSelectionStartListIndex() const
 {
     if (m_data.activeSelectionAnchorIndex() >= 0)
@@ -181,8 +200,13 @@
         String attrSize = String::number(size);
         if (attrSize != attr->value())
             attr->setValue(attrSize);
+        size = max(size, 1);
 
-        m_data.setSize(max(size, 1));
+        // Ensure that we've determined selectedness of the items at least once prior to changing the size.
+        if (oldSize != size)
+            recalcListItemsIfNeeded();
+
+        m_data.setSize(size);
         if ((oldUsesMenuList != m_data.usesMenuList() || (!oldUsesMenuList && m_data.size() != oldSize)) && attached()) {
             detach();
             attach();
@@ -195,10 +219,6 @@
     } else if (attr->name() == alignAttr) {
         // Don't map 'align' attribute.  This matches what Firefox, Opera and IE do.
         // See http://bugs.webkit.org/show_bug.cgi?id=12072
-    } else if (attr->name() == onfocusAttr) {
-        setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, attr));
-    } else if (attr->name() == onblurAttr) {
-        setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attr));
     } else if (attr->name() == onchangeAttr) {
         setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, attr));
     } else
@@ -411,11 +431,21 @@
     } else {
         const Vector<Element*>& items = listItems();
 
+        // Removing children fires mutation events, which might mutate the DOM further, so we first copy out a list
+        // of elements that we intend to remove then attempt to remove them one at a time.
+        Vector<RefPtr<Element> > itemsToRemove;
         size_t optionIndex = 0;
-        for (size_t listIndex = 0; listIndex < items.size(); listIndex++) {
-            if (items[listIndex]->hasLocalName(optionTag) && optionIndex++ >= newLen) {
-                Element *item = items[listIndex];
+        for (size_t i = 0; i < items.size(); ++i) {
+            Element* item = items[i];
+            if (item->hasLocalName(optionTag) && optionIndex++ >= newLen) {
                 ASSERT(item->parentNode());
+                itemsToRemove.append(item);
+            }
+        }
+
+        for (size_t i = 0; i < itemsToRemove.size(); ++i) {
+            Element* item = itemsToRemove[i].get();
+            if (item->parentNode()) {
                 item->parentNode()->removeChild(item, ec);
             }
         }
diff --git a/WebCore/html/HTMLSelectElement.h b/WebCore/html/HTMLSelectElement.h
index 0a2050e..8a31efc 100644
--- a/WebCore/html/HTMLSelectElement.h
+++ b/WebCore/html/HTMLSelectElement.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2000 Dirk Mueller (mueller@kde.org)
@@ -80,6 +81,8 @@
 
     void scrollToSelection();
 
+    void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
+
 private:
     virtual int tagPriority() const { return 6; }
     virtual bool checkDTD(const Node* newChild);
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index 430b8ea..9f4900c 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -55,6 +55,7 @@
 h6 interfaceName=HTMLHeadingElement, createWithNew
 head createWithNew
 header interfaceName=HTMLElement
+hgroup interfaceName=HTMLElement
 hr interfaceName=HTMLHRElement, createWithNew
 html createWithNew
 i interfaceName=HTMLElement
@@ -89,6 +90,7 @@
 param createWithNew
 plaintext interfaceName=HTMLElement
 pre createWithNew
+progress interfaceName=HTMLProgressElement, conditional=PROGRESS_TAG
 q interfaceName=HTMLQuoteElement, createWithNew
 rp interfaceName=HTMLElement, conditional=RUBY
 rt interfaceName=HTMLElement, conditional=RUBY
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index 633e5ec..2bfde03 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -90,7 +90,10 @@
 
 bool HTMLTextAreaElement::saveFormControlState(String& result) const
 {
-    result = value();
+    String currentValue = value();
+    if (currentValue == defaultValue())
+        return false;
+    result = currentValue;
     return true;
 }
 
@@ -170,6 +173,8 @@
     if (name().isEmpty())
         return false;
 
+    document()->updateLayout();
+
     // FIXME: It's not acceptable to ignore the HardWrap setting when there is no renderer.
     // While we have no evidence this has ever been a practical problem, it would be best to fix it some day.
     RenderTextControl* control = toRenderTextControl(renderer());
@@ -239,8 +244,8 @@
         return;
     unsigned unsignedMaxLength = static_cast<unsigned>(signedMaxLength);
 
-    unsigned currentLength = toRenderTextControl(renderer())->text().numGraphemeClusters();
-    unsigned selectionLength = plainText(document()->frame()->selection()->selection().toNormalizedRange().get()).numGraphemeClusters();
+    unsigned currentLength = numGraphemeClusters(toRenderTextControl(renderer())->text());
+    unsigned selectionLength = numGraphemeClusters(plainText(document()->frame()->selection()->selection().toNormalizedRange().get()));
     ASSERT(currentLength >= selectionLength);
     unsigned baseLength = currentLength - selectionLength;
     unsigned appendableLength = unsignedMaxLength > baseLength ? unsignedMaxLength - baseLength : 0;
@@ -249,7 +254,7 @@
 
 String HTMLTextAreaElement::sanitizeUserInputValue(const String& proposedValue, unsigned maxLength)
 {
-    return proposedValue.left(proposedValue.numCharactersInGraphemeClusters(maxLength));
+    return proposedValue.left(numCharactersInGraphemeClusters(proposedValue, maxLength));
 }
 
 void HTMLTextAreaElement::rendererWillBeDestroyed()
@@ -295,13 +300,11 @@
         return;
 
     m_value = normalizedValue;
+    updatePlaceholderVisibility(false);
+    setNeedsStyleRecalc();
+    setNeedsValidityCheck();
     m_isDirty = false;
     setFormControlValueMatchesRenderer(true);
-    updatePlaceholderVisibility(false);
-    if (inDocument())
-        document()->updateStyleIfNeeded();
-    if (renderer())
-        renderer()->updateFromElement();
 
     // Set the caret to the end of the text value.
     if (document()->focusedNode() == this) {
@@ -313,7 +316,6 @@
         setSelectionRange(endOfString, endOfString);
     }
 
-    setNeedsValidityCheck();
     notifyFormStateChanged(this);
 }
 
@@ -388,7 +390,7 @@
     int max = maxLength();
     if (max < 0)
         return false;
-    return value().numGraphemeClusters() > static_cast<unsigned>(max);
+    return numGraphemeClusters(value()) > static_cast<unsigned>(max);
 }
 
 void HTMLTextAreaElement::accessKeyAction(bool)
diff --git a/WebCore/html/HTMLTitleElement.cpp b/WebCore/html/HTMLTitleElement.cpp
index b9a8de7..81ecd10 100644
--- a/WebCore/html/HTMLTitleElement.cpp
+++ b/WebCore/html/HTMLTitleElement.cpp
@@ -84,10 +84,15 @@
     if (numChildren == 1 && firstChild()->isTextNode())
         static_cast<Text*>(firstChild())->setData(value, ec);
     else {  
+        // We make a copy here because entity of "value" argument can be Document::m_title,
+        // which goes empty during removeChildren() invocation below,
+        // which causes HTMLTitleElement::childrenChanged(), which ends up Document::setTitle().
+        String valueCopy(value);
+
         if (numChildren > 0)
             removeChildren();
-    
-        appendChild(document()->createTextNode(value.impl()), ec);
+
+        appendChild(document()->createTextNode(valueCopy.impl()), ec);
     }
 }
 
diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp
index 6fa3e20..390d332 100644
--- a/WebCore/html/HTMLTokenizer.cpp
+++ b/WebCore/html/HTMLTokenizer.cpp
@@ -71,25 +71,17 @@
 
 using namespace HTMLNames;
 
-#if MOBILE
-// The mobile device needs to be responsive, as such the tokenizer chunk size is reduced.
 // This value is used to define how many characters the tokenizer will process before 
 // yeilding control.
-static const int defaultTokenizerChunkSize = 256;
-#else
+// To increase responsivness reduce the tokenizer chunk size.
 static const int defaultTokenizerChunkSize = 4096;
-#endif
 
-#if MOBILE
-// As the chunks are smaller (above), the tokenizer should not yield for as long a period, otherwise
-// it will take way to long to load a page.
-static const double defaultTokenizerTimeDelay = 0.300;
-#else
 // FIXME: We would like this constant to be 200ms.
 // Yielding more aggressively results in increased responsiveness and better incremental rendering.
 // It slows down overall page-load on slower machines, though, so for now we set a value of 500.
+// For smaller chunks (above) decrease the value of TimerDelay as the the tokenizer should not 
+// yield for as long a period otherwise it will take way to long to load a page.
 static const double defaultTokenizerTimeDelay = 0.500;
-#endif
 
 static const char commentStart [] = "<!--";
 static const char doctypeStart [] = "<!doctype";
@@ -1523,7 +1515,7 @@
                 m_scriptTagSrcAttrValue = String();
                 m_scriptTagCharsetAttrValue = String();
                 if (m_currentToken.attrs && !m_fragment) {
-                    if (m_doc->frame() && m_doc->frame()->script()->canExecuteScripts()) {
+                    if (m_doc->frame() && m_doc->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) {
                         if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
                             m_scriptTagSrcAttrValue = m_doc->completeURL(deprecatedParseURL(a->value())).string();
                     }
@@ -1940,7 +1932,7 @@
 PassRefPtr<Node> HTMLTokenizer::processToken()
 {
     ScriptController* scriptController = (!m_fragment && m_doc->frame()) ? m_doc->frame()->script() : 0;
-    if (scriptController && scriptController->canExecuteScripts())
+    if (scriptController && scriptController->canExecuteScripts(NotAboutToExecuteScript))
         // FIXME: Why isn't this m_currentScriptTagStartLineNumber?  I suspect this is wrong.
         scriptController->setEventHandlerLineNumber(m_currentTagStartLineNumber + 1); // Script line numbers are 1 based.
     if (m_dest > m_buffer) {
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index be8f884..3db48f1 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -104,8 +104,8 @@
                 m_imageLoader.set(new HTMLImageLoader(this));
             m_imageLoader->updateFromElementIgnoringPreviousError();
 #else
-            if (m_player)
-                m_player->setPoster(poster());
+            if (player())
+                player()->setPoster(poster());
 #endif
         }
     } else if (attrName == widthAttr)
@@ -122,7 +122,7 @@
     if (!page) 
         return false;
 
-    if (!m_player || !m_player->supportsFullscreen() || !m_player->hasVideo())
+    if (!player() || !player()->supportsFullscreen() || !player()->hasVideo())
         return false;
 
     // Check with the platform client.
@@ -131,16 +131,16 @@
 
 unsigned HTMLVideoElement::videoWidth() const
 {
-    if (!m_player)
+    if (!player())
         return 0;
-    return m_player->naturalSize().width();
+    return player()->naturalSize().width();
 }
 
 unsigned HTMLVideoElement::videoHeight() const
 {
-    if (!m_player)
+    if (!player())
         return 0;
-    return m_player->naturalSize().height();
+    return player()->naturalSize().height();
 }
 
 unsigned HTMLVideoElement::width() const
@@ -196,16 +196,6 @@
 #endif
 }
 
-void HTMLVideoElement::paint(GraphicsContext* context, const IntRect& destRect)
-{
-    MediaPlayer* player = HTMLMediaElement::player();
-    if (!player)
-        return;
-
-    player->setVisible(true); // Make player visible or it won't draw.
-    player->paint(context, destRect);
-}
-
 void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& destRect)
 {
     MediaPlayer* player = HTMLMediaElement::player();
@@ -218,15 +208,15 @@
 
 bool HTMLVideoElement::hasAvailableVideoFrame() const
 {
-    if (!m_player)
+    if (!player())
         return false;
     
-    return m_player->hasAvailableVideoFrame();
+    return player()->hasAvailableVideoFrame();
 }
 
-void HTMLVideoElement::webkitEnterFullScreen(bool isUserGesture, ExceptionCode& ec)
+void HTMLVideoElement::webkitEnterFullscreen(bool isUserGesture, ExceptionCode& ec)
 {
-    if (m_isFullscreen)
+    if (isFullscreen())
         return;
 
     // Generate an exception if this isn't called in response to a user gesture, or if the 
@@ -239,9 +229,9 @@
     enterFullscreen();
 }
 
-void HTMLVideoElement::webkitExitFullScreen()
+void HTMLVideoElement::webkitExitFullscreen()
 {
-    if (m_isFullscreen)
+    if (isFullscreen())
         exitFullscreen();
 }
 
@@ -252,9 +242,15 @@
 
 bool HTMLVideoElement::webkitDisplayingFullscreen()
 {
-    return m_isFullscreen;
+    return isFullscreen();
 }
 
+void HTMLVideoElement::willMoveToNewOwnerDocument()
+{
+    if (m_imageLoader)
+        m_imageLoader->elementWillMoveToNewOwnerDocument();
+    HTMLMediaElement::willMoveToNewOwnerDocument();
+}
 
 }
 #endif
diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h
index d12667e..4dad3db 100644
--- a/WebCore/html/HTMLVideoElement.h
+++ b/WebCore/html/HTMLVideoElement.h
@@ -29,7 +29,6 @@
 #if ENABLE(VIDEO)
 
 #include "HTMLMediaElement.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -39,20 +38,6 @@
 public:
     HTMLVideoElement(const QualifiedName&, Document*);
 
-    virtual int tagPriority() const { return 5; }
-    virtual bool rendererIsNeeded(RenderStyle*);
-#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-#endif
-    virtual void attach();
-    virtual void detach();
-    virtual void parseMappedAttribute(MappedAttribute* attr);
-    virtual bool isVideo() const { return true; }
-    virtual bool hasVideo() const { return player() && player()->hasVideo(); }
-    virtual bool supportsFullscreen() const;
-    virtual bool isURLAttribute(Attribute*) const;
-    virtual const QualifiedName& imageSourceAttributeName() const;
-
     unsigned width() const;
     void setWidth(unsigned);
     unsigned height() const;
@@ -61,24 +46,43 @@
     unsigned videoWidth() const;
     unsigned videoHeight() const;
     
-    const KURL& poster() const { return m_posterURL; }
+    virtual const KURL poster() const { return m_posterURL; }
     void setPoster(const String&);
 
-// fullscreen
-    void webkitEnterFullScreen(bool isUserGesture, ExceptionCode&);
-    void webkitExitFullScreen();
+    // Fullscreen
+    void webkitEnterFullscreen(bool isUserGesture, ExceptionCode&);
+    void webkitExitFullscreen();
     bool webkitSupportsFullscreen();
     bool webkitDisplayingFullscreen();
 
+    // FIXME: Maintain "FullScreen" capitalization scheme for backwards compatibility.
+    // https://bugs.webkit.org/show_bug.cgi?id=36081
+    void webkitEnterFullScreen(bool isUserGesture, ExceptionCode& ec) { webkitEnterFullscreen(isUserGesture, ec); }
+    void webkitExitFullScreen() { webkitExitFullscreen(); }
+
     bool shouldDisplayPosterImage() const { return m_shouldDisplayPosterImage; }
 
-    void paint(GraphicsContext*, const IntRect&);
     // Used by canvas to gain raw pixel access
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
 
 private:
+    virtual int tagPriority() const { return 5; }
+    virtual bool rendererIsNeeded(RenderStyle*);
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+#endif
+    virtual void attach();
+    virtual void detach();
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual bool isVideo() const { return true; }
+    virtual bool hasVideo() const { return player() && player()->hasVideo(); }
+    virtual bool supportsFullscreen() const;
+    virtual bool isURLAttribute(Attribute*) const;
+    virtual const QualifiedName& imageSourceAttributeName() const;
+
     virtual bool hasAvailableVideoFrame() const;
     virtual void updatePosterImage();
+    virtual void willMoveToNewOwnerDocument();
 
     OwnPtr<HTMLImageLoader> m_imageLoader;
     KURL m_posterURL;
diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl
index c4764ac..1b21c54 100644
--- a/WebCore/html/HTMLVideoElement.idl
+++ b/WebCore/html/HTMLVideoElement.idl
@@ -33,6 +33,10 @@
 
         readonly attribute boolean webkitSupportsFullscreen;
         readonly attribute boolean webkitDisplayingFullscreen;
+
+        [NeedsUserGestureCheck] void webkitEnterFullscreen()
+            raises (DOMException);
+        void webkitExitFullscreen();
     
         [NeedsUserGestureCheck] void webkitEnterFullScreen()
             raises (DOMException);
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index ba718d1..2d800b4 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -54,7 +54,7 @@
 Tokenizer* HTMLViewSourceDocument::createTokenizer()
 {
     // Use HTMLTokenizer if applicable, otherwise use TextTokenizer.
-    if (m_type == "text/html" || m_type == "application/xhtml+xml" || m_type == "image/svg+xml" || implementation()->isXMLMIMEType(m_type)
+    if (m_type == "text/html" || m_type == "application/xhtml+xml" || m_type == "image/svg+xml" || DOMImplementation::isXMLMIMEType(m_type)
 #if ENABLE(XHTMLMP)
         || m_type == "application/vnd.wap.xhtml+xml"
 #endif
diff --git a/WebCore/html/PreloadScanner.cpp b/WebCore/html/PreloadScanner.cpp
index 527b9f8..ee7e761 100644
--- a/WebCore/html/PreloadScanner.cpp
+++ b/WebCore/html/PreloadScanner.cpp
@@ -34,13 +34,13 @@
 #include "CachedResourceClient.h"
 #include "CachedScript.h"
 #include "CSSHelper.h"
-#include "CString.h"
 #include "DocLoader.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLLinkElement.h"
 #include "HTMLNames.h"
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/unicode/Unicode.h>
 
diff --git a/WebCore/html/StepRange.cpp b/WebCore/html/StepRange.cpp
new file mode 100644
index 0000000..7c270f2
--- /dev/null
+++ b/WebCore/html/StepRange.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ *
+ * 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 "StepRange.h"
+
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "PlatformString.h"
+#include <wtf/MathExtras.h>
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+StepRange::StepRange(const HTMLInputElement* element)
+{
+    if (element->hasAttribute(precisionAttr)) {
+        step = 1.0;
+        hasStep = !equalIgnoringCase(element->getAttribute(precisionAttr), "float");
+    } else
+        hasStep = element->getAllowedValueStep(&step);
+
+    maximum = element->maximum();
+    minimum = element->minimum();
+}
+
+double StepRange::clampValue(double value)
+{
+    double clampedValue = max(minimum, min(value, maximum));
+    if (!hasStep)
+        return clampedValue;
+    // Rounds clampedValue to minimum + N * step.
+    clampedValue = minimum + round((clampedValue - minimum) / step) * step;
+    if (clampedValue > maximum)
+       clampedValue -= step;
+    ASSERT(clampedValue >= minimum);
+    ASSERT(clampedValue <= maximum);
+    return clampedValue;
+}
+
+double StepRange::clampValue(const String& stringValue)
+{
+    double value;
+    bool parseSuccess = HTMLInputElement::parseToDoubleForNumberType(stringValue, &value);
+    if (!parseSuccess)
+        value = (minimum + maximum) / 2;
+    return clampValue(value);
+}
+
+double StepRange::valueFromElement(HTMLInputElement* element, bool* wasClamped)
+{
+    double oldValue;
+    bool parseSuccess = HTMLInputElement::parseToDoubleForNumberType(element->value(), &oldValue);
+    if (!parseSuccess)
+        oldValue = (minimum + maximum) / 2;
+    double newValue = clampValue(oldValue);
+
+    if (wasClamped)
+        *wasClamped = !parseSuccess || newValue != oldValue;
+
+    return newValue;
+}
+
+}
diff --git a/WebCore/html/StepRange.h b/WebCore/html/StepRange.h
new file mode 100644
index 0000000..2f5013a
--- /dev/null
+++ b/WebCore/html/StepRange.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ *
+ * 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 StepRange_h
+#define StepRange_h
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class HTMLInputElement;
+class String;
+
+class StepRange : public Noncopyable {
+public:
+    bool hasStep;
+    double step;
+    double minimum;
+    double maximum; // maximum must be >= minimum.
+
+    explicit StepRange(const HTMLInputElement*);
+    double clampValue(double value);
+    double clampValue(const String& stringValue);
+
+    // Clamp the middle value according to the step
+    double defaultValue()
+    {
+        return clampValue((minimum + maximum) / 2);
+    }
+
+    // Map value into 0-1 range
+    double proportionFromValue(double value)
+    {
+        if (minimum == maximum)
+            return 0;
+
+        return (value - minimum) / (maximum - minimum);
+    }
+
+    // Map from 0-1 range to value
+    double valueFromProportion(double proportion)
+    {
+        return minimum + proportion * (maximum - minimum);
+    }
+
+    double valueFromElement(HTMLInputElement*, bool* wasClamped = 0);
+};
+
+}
+
+#endif // StepRange_h
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 6fe74f9..0baa0e6 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -39,7 +39,6 @@
 #include "CSSMutableStyleDeclaration.h"
 #include "CSSPropertyNames.h"
 #include "CSSStyleSelector.h"
-#include "Document.h"
 #include "ExceptionCode.h"
 #include "FloatConversion.h"
 #include "GraphicsContext.h"
@@ -90,12 +89,18 @@
     CanvasRenderingContext2D* m_canvasContext;
 };
 
-
-
-CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas)
+CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode)
     : CanvasRenderingContext(canvas)
     , m_stateStack(1)
+    , m_usesCSSCompatibilityParseMode(usesCSSCompatibilityParseMode)
+#if ENABLE(DASHBOARD_SUPPORT)
+    , m_usesDashboardCompatibilityMode(usesDashboardCompatibilityMode)
+#endif
 {
+#if !ENABLE(DASHBOARD_SUPPORT)
+   ASSERT_UNUSED(usesDashboardCompatibilityMode, !usesDashboardCompatibilityMode);
+#endif
+
     // Make sure that even if the drawingContext() has a different default
     // thickness, it is in sync with the canvas thickness.
     setLineWidth(lineWidth());
@@ -636,9 +641,8 @@
 #if ENABLE(DASHBOARD_SUPPORT)
 void CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode()
 {
-    if (Settings* settings = canvas()->document()->settings())
-        if (settings->usesDashboardBackwardCompatibilityMode())
-            m_path.clear();
+    if (m_usesDashboardCompatibilityMode)
+        m_path.clear();
 }
 #endif
 
@@ -941,7 +945,7 @@
 
 void CanvasRenderingContext2D::checkOrigin(const KURL& url)
 {
-    if (canvas()->document()->securityOrigin()->taintsCanvas(url))
+    if (canvas()->securityOrigin().taintsCanvas(url))
         canvas()->setOriginTainted();
 }
 
@@ -950,26 +954,45 @@
     checkOrigin(KURL(KURL(), url));
 }
 
-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y)
+void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec)
 {
-    ASSERT(image);
+    if (!image) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     IntSize s = size(image);
-    ExceptionCode ec;
     drawImage(image, x, y, s.width(), s.height(), ec);
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
     float x, float y, float width, float height, ExceptionCode& ec)
 {
-    ASSERT(image);
+    if (!image) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     IntSize s = size(image);
     drawImage(image, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, width, height), ec);
 }
 
+void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
+    float sx, float sy, float sw, float sh,
+    float dx, float dy, float dw, float dh, ExceptionCode& ec)
+{
+    if (!image) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
+    drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
+}
+
 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect,
     ExceptionCode& ec)
 {
-    ASSERT(image);
+    if (!image) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
 
     ec = 0;
 
@@ -1004,24 +1027,39 @@
     c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
 }
 
-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas, float x, float y)
+void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas, float x, float y, ExceptionCode& ec)
 {
-    ASSERT(canvas);
-    ExceptionCode ec;
+    if (!canvas) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     drawImage(canvas, x, y, canvas->width(), canvas->height(), ec);
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas,
     float x, float y, float width, float height, ExceptionCode& ec)
 {
-    ASSERT(canvas);
+    if (!canvas) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     drawImage(canvas, FloatRect(0, 0, canvas->width(), canvas->height()), FloatRect(x, y, width, height), ec);
 }
 
+void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas,
+    float sx, float sy, float sw, float sh,
+    float dx, float dy, float dw, float dh, ExceptionCode& ec)
+{
+    drawImage(canvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
+}
+
 void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const FloatRect& srcRect,
     const FloatRect& dstRect, ExceptionCode& ec)
 {
-    ASSERT(sourceCanvas);
+    if (!sourceCanvas) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
 
     ec = 0;
 
@@ -1057,26 +1095,41 @@
 }
 
 #if ENABLE(VIDEO)
-void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y)
+void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionCode& ec)
 {
-    ASSERT(video);
+    if (!video) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     IntSize s = size(video);
-    ExceptionCode ec;
     drawImage(video, x, y, s.width(), s.height(), ec);
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
                                          float x, float y, float width, float height, ExceptionCode& ec)
 {
-    ASSERT(video);
+    if (!video) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     IntSize s = size(video);
     drawImage(video, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, width, height), ec);
 }
 
+void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
+    float sx, float sy, float sw, float sh,
+    float dx, float dy, float dw, float dh, ExceptionCode& ec)
+{
+    drawImage(video, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
+}
+
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRect& srcRect, const FloatRect& dstRect,
                                          ExceptionCode& ec)
 {
-    ASSERT(video);
+    if (!video) {
+        ec = TYPE_MISMATCH_ERR;
+        return;
+    }
     
     ec = 0;
     FloatRect videoRect = FloatRect(FloatPoint(), size(video));
@@ -1161,9 +1214,8 @@
 void CanvasRenderingContext2D::prepareGradientForDashboard(CanvasGradient* gradient) const
 {
 #if ENABLE(DASHBOARD_SUPPORT)
-    if (Settings* settings = canvas()->document()->settings())
-        if (settings->usesDashboardBackwardCompatibilityMode())
-            gradient->setDashboardCompatibilityMode();
+    if (m_usesDashboardCompatibilityMode)
+        gradient->setDashboardCompatibilityMode();
 #else
     UNUSED_PARAM(gradient);
 #endif
@@ -1196,6 +1248,10 @@
 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLImageElement* image,
     const String& repetitionType, ExceptionCode& ec)
 {
+    if (!image) {
+        ec = TYPE_MISMATCH_ERR;
+        return 0;
+    }
     bool repeatX, repeatY;
     ec = 0;
     CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
@@ -1211,13 +1267,21 @@
     if (!cachedImage || !image->cachedImage()->image())
         return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true);
 
+<<<<<<< HEAD
     bool originClean = !canvas()->document()->securityOrigin()->taintsCanvas(KURL(KURL(), cachedImage->url())) && cachedImage->image()->hasSingleSecurityOrigin();
+=======
+    bool originClean = !canvas()->securityOrigin().taintsCanvas(KURL(KURL(), cachedImage->url())) && cachedImage->image()->hasSingleSecurityOrigin();
+>>>>>>> webkit.org at r58033
     return CanvasPattern::create(cachedImage->image(), repeatX, repeatY, originClean);
 }
 
 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElement* canvas,
     const String& repetitionType, ExceptionCode& ec)
 {
+    if (!canvas) {
+        ec = TYPE_MISMATCH_ERR;
+        return 0;
+    }
     if (!canvas->width() || !canvas->height()) {
         ec = INVALID_STATE_ERR;
         return 0;
@@ -1369,7 +1433,7 @@
 void CanvasRenderingContext2D::setFont(const String& newFont)
 {
     RefPtr<CSSMutableStyleDeclaration> tempDecl = CSSMutableStyleDeclaration::create();
-    CSSParser parser(!canvas()->document()->inCompatMode()); // Use the parse mode of the canvas' document when parsing CSS.
+    CSSParser parser(!m_usesCSSCompatibilityParseMode);
         
     String declarationText("font: ");
     declarationText += newFont;
@@ -1383,11 +1447,11 @@
     // Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work
     // relative to the canvas.
     RefPtr<RenderStyle> newStyle = RenderStyle::create();
-    if (canvas()->computedStyle())
-        newStyle->setFontDescription(canvas()->computedStyle()->fontDescription());
+    if (RenderStyle* computedStyle = canvas()->computedStyle())
+        newStyle->setFontDescription(computedStyle->fontDescription());
 
     // Now map the font property into the style.
-    CSSStyleSelector* styleSelector = canvas()->document()->styleSelector();
+    CSSStyleSelector* styleSelector = canvas()->styleSelector();
     styleSelector->applyPropertyToStyle(CSSPropertyFont, tempDecl->getPropertyCSSValue(CSSPropertyFont).get(), newStyle.get());
     
     state().m_font = newStyle->font();
@@ -1461,8 +1525,9 @@
     // FIXME: Handle maxWidth.
     // FIXME: Need to turn off font smoothing.
 
-    bool rtl = canvas()->computedStyle() ? canvas()->computedStyle()->direction() == RTL : false;
-    bool override = canvas()->computedStyle() ? canvas()->computedStyle()->unicodeBidi() == Override : false;
+    RenderStyle* computedStyle = canvas()->computedStyle();
+    bool rtl = computedStyle ? computedStyle->direction() == RTL : false;
+    bool override = computedStyle ? computedStyle->unicodeBidi() == Override : false;
 
     unsigned length = text.length();
     const UChar* string = text.characters();
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h
index 553ffd2..2bac902 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -57,7 +57,7 @@
 
     class CanvasRenderingContext2D : public CanvasRenderingContext {
     public:
-        CanvasRenderingContext2D(HTMLCanvasElement*);
+        CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
 
         virtual ~CanvasRenderingContext2D();
         
@@ -154,15 +154,18 @@
 
         void clearShadow();
 
-        void drawImage(HTMLImageElement*, float x, float y);
+        void drawImage(HTMLImageElement*, float x, float y, ExceptionCode&);
         void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&);
+        void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
         void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
-        void drawImage(HTMLCanvasElement*, float x, float y);
+        void drawImage(HTMLCanvasElement*, float x, float y, ExceptionCode&);
         void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&);
+        void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
         void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
 #if ENABLE(VIDEO)
-        void drawImage(HTMLVideoElement*, float x, float y);
+        void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&);
         void drawImage(HTMLVideoElement*, float x, float y, float width, float height, ExceptionCode&);
+        void drawImage(HTMLVideoElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&);
         void drawImage(HTMLVideoElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
 #endif
 
@@ -263,6 +266,10 @@
         void checkOrigin(const String&);
 
         Vector<State, 1> m_stateStack;
+        bool m_usesCSSCompatibilityParseMode;
+#if ENABLE(DASHBOARD_SUPPORT)
+        bool m_usesDashboardCompatibilityMode;
+#endif
     };
 
 } // namespace WebCore
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.idl b/WebCore/html/canvas/CanvasRenderingContext2D.idl
index f93a752..a3c83ca 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.idl
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.idl
@@ -20,7 +20,7 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 module html {
@@ -82,8 +82,7 @@
         attribute DOMString font;
         attribute DOMString textAlign;
         attribute DOMString textBaseline;
-        [Custom] void fillText(/* 4 */);
-        [Custom] void strokeText(/* 4 */);
+
         TextMetrics measureText(in DOMString text);
 
         // other
@@ -98,6 +97,61 @@
 
         void clearShadow();
 
+#if defined(V8_BINDING) && V8_BINDING
+        void fillText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
+        void strokeText(in DOMString text, in float x, in float y, in [Optional] float maxWidth);
+
+        void setStrokeColor(in DOMString color, in [Optional] float alpha);
+        void setStrokeColor(in float grayLevel, in [Optional] float alpha);
+        void setStrokeColor(in float r, in float g, in float b, in float a);
+        void setStrokeColor(in float c, in float m, in float y, in float k, in float a);
+
+        void setFillColor(in DOMString color, in [Optional] float alpha);
+        void setFillColor(in float grayLevel, in [Optional] float alpha);
+        void setFillColor(in float r, in float g, in float b, in float a);
+        void setFillColor(in float c, in float m, in float y, in float k, in float a);
+
+        void strokeRect(in float x, in float y, in float width, in float height, in [Optional] float lineWidth);
+
+        void drawImage(in HTMLImageElement image, in float x, in float y)
+            raises (DOMException);
+        void drawImage(in HTMLImageElement image, in float x, in float y, in float width, in float height)
+            raises (DOMException);
+        void drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+            raises (DOMException);
+        void drawImage(in HTMLCanvasElement canvas, in float x, in float y)
+            raises (DOMException);
+        void drawImage(in HTMLCanvasElement canvas, in float x, in float y, in float width, in float height)
+            raises (DOMException);
+        void drawImage(in HTMLCanvasElement canvas, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+            raises (DOMException);
+#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
+        void drawImage(in HTMLVideoElement video, in float x, in float y)
+            raises (DOMException);
+        void drawImage(in HTMLVideoElement video, in float x, in float y, in float width, in float height)
+            raises (DOMException);
+        void drawImage(in HTMLVideoElement video, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh)
+            raises (DOMException);
+#endif
+        void drawImageFromRect(in HTMLImageElement image,
+                               in float sx, in float sy, in float sw, in float sh,
+                               in float dx, in float dy, in float dw, in float dh, in DOMString compositeOperation);
+
+        void setShadow(in float width, in float height, in float blur, in [Optional] DOMString color, in [Optional] float alpha);
+        void setShadow(in float width, in float height, in float blur, in float grayLevel, in [Optional] float alpha);
+        void setShadow(in float width, in float height, in float blur, in float r, in float g, in float b, in float a);
+        void setShadow(in float width, in float height, in float blur, in float c, in float m, in float y, in float k, in float a);
+
+        CanvasPattern createPattern(in HTMLCanvasElement canvas, in [ConvertNullToNullString] DOMString repetitionType)
+            raises (DOMException);
+        CanvasPattern createPattern(in HTMLImageElement image, in [ConvertNullToNullString] DOMString repetitionType)
+            raises (DOMException);
+        void putImageData(in ImageData imagedata, in float dx, in float dy, in [Optional] float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
+            raises(DOMException);
+#else
+        // FIXME: Remove 'else' once JSC supports overloads too.
+        [Custom] void fillText(/* 4 */);
+        [Custom] void strokeText(/* 4 */);
         [Custom] void setStrokeColor(/* 1  */);
         [Custom] void setFillColor(/* 1 */);
         [Custom] void strokeRect(/* 4 */);
@@ -105,16 +159,17 @@
         [Custom] void drawImageFromRect(/* 10 */);
         [Custom] void setShadow(/* 3 */);
         [Custom] void createPattern(/* 2 */);
-        
+        [Custom] void putImageData(/* in ImageData imagedata, in float dx, in float dy [, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight] */);
+#endif // defined(V8_BINDING)
+
         attribute [Custom] custom strokeStyle;
         attribute [Custom] custom fillStyle;
-        
+
         // pixel manipulation
         ImageData createImageData(in float sw, in float sh)
             raises (DOMException);
         ImageData getImageData(in float sx, in float sy, in float sw, in float sh)
             raises(DOMException);
-        [Custom] void putImageData(/* in ImageData imagedata, in float dx, in float dy [, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight] */);
     };
 
 }
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 5352473..3515e03 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -173,22 +173,12 @@
         return;
     switch (m_type) {
         case ColorString: {
-            Color c = Color(m_color);
-            if (c.isValid()) {
-                context->setFillColor(c.rgb(), DeviceColorSpace);
-                break;
-            }
             RGBA32 rgba = 0; // default is transparent black
             if (CSSParser::parseColor(rgba, m_color))
                 context->setFillColor(rgba, DeviceColorSpace);
             break;
         }
         case ColorStringWithAlpha: {
-            Color c = Color(m_color);
-            if (c.isValid()) {
-                context->setFillColor(colorWithOverrideAlpha(c.rgb(), m_alpha), DeviceColorSpace);
-                break;
-            }
             RGBA32 color = 0; // default is transparent black
             if (CSSParser::parseColor(color, m_color))
                 context->setFillColor(colorWithOverrideAlpha(color, m_alpha), DeviceColorSpace);
diff --git a/WebCore/html/canvas/WebGLArray.cpp b/WebCore/html/canvas/WebGLArray.cpp
index c5a712d..038aea4 100644
--- a/WebCore/html/canvas/WebGLArray.cpp
+++ b/WebCore/html/canvas/WebGLArray.cpp
@@ -46,13 +46,33 @@
 
 void WebGLArray::setImpl(WebGLArray* array, unsigned byteOffset, ExceptionCode& ec)
 {
-    if (byteOffset + array->byteLength() > byteLength()) {
+    if (byteOffset > byteLength() ||
+        byteOffset + array->byteLength() > byteLength() ||
+        byteOffset + array->byteLength() < byteOffset) {
+        // Out of range offset or overflow
         ec = INDEX_SIZE_ERR;
         return;
     }
 
     char* base = static_cast<char*>(baseAddress());
-    memcpy(base + byteOffset, array->baseAddress(), array->byteLength());
+    memmove(base + byteOffset, array->baseAddress(), array->byteLength());
+}
+
+void WebGLArray::calculateOffsetAndLength(int start, int end, unsigned arraySize,
+                                          unsigned* offset, unsigned* length)
+{
+    if (start < 0)
+        start += arraySize;
+    if (start < 0)
+        start = 0;
+    if (end < 0)
+        end += arraySize;
+    if (end < 0)
+        end = 0;
+    if (end < start)
+        end = start;
+    *offset = static_cast<unsigned>(start);
+    *length = static_cast<unsigned>(end - start);
 }
 
 }
diff --git a/WebCore/html/canvas/WebGLArray.h b/WebCore/html/canvas/WebGLArray.h
index 11065cc..7d67474 100644
--- a/WebCore/html/canvas/WebGLArray.h
+++ b/WebCore/html/canvas/WebGLArray.h
@@ -26,7 +26,9 @@
 #ifndef WebGLArray_h
 #define WebGLArray_h
 
+#include <algorithm>
 #include "ExceptionCode.h"
+#include <limits.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -58,7 +60,7 @@
 
     virtual unsigned length() const = 0;
     virtual unsigned byteLength() const = 0;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length) = 0;
+    virtual PassRefPtr<WebGLArray> slice(int start, int end) = 0;
 
     virtual ~WebGLArray();
 
@@ -67,6 +69,48 @@
 
     void setImpl(WebGLArray* array, unsigned byteOffset, ExceptionCode& ec);
 
+    void calculateOffsetAndLength(int start, int end, unsigned arraySize,
+                                  unsigned* offset, unsigned* length);
+
+    // Helper to verify that a given sub-range of an ArrayBuffer is
+    // within range.
+    template <typename T>
+    static bool verifySubRange(PassRefPtr<WebGLArrayBuffer> buffer,
+                               unsigned byteOffset,
+                               unsigned numElements)
+    {
+        if (!buffer)
+            return false;
+        if (sizeof(T) > 1 && byteOffset % sizeof(T))
+            return false;
+        if (byteOffset > buffer->byteLength())
+            return false;
+        unsigned remainingElements = (buffer->byteLength() - byteOffset) / sizeof(T);
+        if (numElements > remainingElements)
+            return false;
+        return true;
+    }
+
+    // Input offset is in number of elements from this array's view;
+    // output offset is in number of bytes from the underlying buffer's view.
+    template <typename T>
+    static void clampOffsetAndNumElements(PassRefPtr<WebGLArrayBuffer> buffer,
+                                          unsigned arrayByteOffset,
+                                          unsigned *offset,
+                                          unsigned *numElements)
+    {
+        unsigned maxOffset = (UINT_MAX - arrayByteOffset) / sizeof(T);
+        if (*offset > maxOffset) {
+            *offset = buffer->byteLength();
+            *numElements = 0;
+            return;
+        }
+        *offset = arrayByteOffset + *offset * sizeof(T);
+        *offset = std::min(buffer->byteLength(), *offset);
+        unsigned remainingElements = (buffer->byteLength() - *offset) / sizeof(T);
+        *numElements = std::min(remainingElements, *numElements);
+    }
+
     // This is the address of the WebGLArrayBuffer's storage, plus the byte offset.
     void* m_baseAddress;
 
diff --git a/WebCore/html/canvas/WebGLArray.idl b/WebCore/html/canvas/WebGLArray.idl
index 02e1f51..2cc00d0 100644
--- a/WebCore/html/canvas/WebGLArray.idl
+++ b/WebCore/html/canvas/WebGLArray.idl
@@ -30,6 +30,6 @@
         readonly attribute unsigned long byteLength;
         readonly attribute unsigned long length;
 
-        WebGLArray slice(in unsigned long offset, in unsigned long length);
+        [Custom] WebGLArray slice(in long start, in long end);
     };
 }
diff --git a/WebCore/html/canvas/WebGLArrayBuffer.cpp b/WebCore/html/canvas/WebGLArrayBuffer.cpp
index c565691..7d3cd33 100644
--- a/WebCore/html/canvas/WebGLArrayBuffer.cpp
+++ b/WebCore/html/canvas/WebGLArrayBuffer.cpp
@@ -33,21 +33,27 @@
 
 namespace WebCore {
 
-PassRefPtr<WebGLArrayBuffer> WebGLArrayBuffer::create(unsigned sizeInBytes)
+PassRefPtr<WebGLArrayBuffer> WebGLArrayBuffer::create(unsigned numElements, unsigned elementByteSize)
 {
-    return adoptRef(new WebGLArrayBuffer(sizeInBytes));
+    void* data = tryAllocate(numElements, elementByteSize);
+    if (!data)
+        return 0;
+    return adoptRef(new WebGLArrayBuffer(data, numElements * elementByteSize));
 }
 
 PassRefPtr<WebGLArrayBuffer> WebGLArrayBuffer::create(WebGLArrayBuffer* other)
 {
-    RefPtr<WebGLArrayBuffer> buffer = adoptRef(new WebGLArrayBuffer(other->byteLength()));
+    void* data = tryAllocate(other->byteLength(), 1);
+    if (!data)
+        return 0;
+    RefPtr<WebGLArrayBuffer> buffer = adoptRef(new WebGLArrayBuffer(data, other->byteLength()));
     memcpy(buffer->data(), other->data(), other->byteLength());
     return buffer.release();
 }
 
-WebGLArrayBuffer::WebGLArrayBuffer(unsigned sizeInBytes) {
-    m_sizeInBytes = sizeInBytes;
-    m_data = WTF::fastZeroedMalloc(sizeInBytes);
+WebGLArrayBuffer::WebGLArrayBuffer(void* data, unsigned sizeInBytes)
+    : m_sizeInBytes(sizeInBytes)
+    , m_data(data) {
 }
 
 void* WebGLArrayBuffer::data() {
@@ -66,6 +72,19 @@
     WTF::fastFree(m_data);
 }
 
+void* WebGLArrayBuffer::tryAllocate(unsigned numElements, unsigned elementByteSize) {
+    void* result;
+    // Do not allow 32-bit overflow of the total size
+    if (numElements) {
+        unsigned totalSize = numElements * elementByteSize;
+        if (totalSize / numElements != elementByteSize)
+            return 0;
+    }
+    if (WTF::tryFastCalloc(numElements, elementByteSize).getValue(result))
+        return result;
+    return 0;
+}
+
 }
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLArrayBuffer.h b/WebCore/html/canvas/WebGLArrayBuffer.h
index a076e16..59e0ddd 100644
--- a/WebCore/html/canvas/WebGLArrayBuffer.h
+++ b/WebCore/html/canvas/WebGLArrayBuffer.h
@@ -33,7 +33,7 @@
 
 class WebGLArrayBuffer : public RefCounted<WebGLArrayBuffer> {
   public:
-    static PassRefPtr<WebGLArrayBuffer> create(unsigned sizeInBytes);
+    static PassRefPtr<WebGLArrayBuffer> create(unsigned numElements, unsigned elementByteSize);
     static PassRefPtr<WebGLArrayBuffer> create(WebGLArrayBuffer*);
 
     void* data();
@@ -43,7 +43,9 @@
     ~WebGLArrayBuffer();
 
   private:
-    WebGLArrayBuffer(unsigned sizeInBytes);
+    WebGLArrayBuffer(void* data, unsigned sizeInBytes);
+    WebGLArrayBuffer(unsigned numElements, unsigned elementByteSize);
+    static void* tryAllocate(unsigned numElements, unsigned elementByteSize);
     unsigned m_sizeInBytes;
     void* m_data;
 };
diff --git a/WebCore/html/canvas/WebGLByteArray.cpp b/WebCore/html/canvas/WebGLByteArray.cpp
index 1c2849b..603e4d1 100644
--- a/WebCore/html/canvas/WebGLByteArray.cpp
+++ b/WebCore/html/canvas/WebGLByteArray.cpp
@@ -35,7 +35,7 @@
 
 PassRefPtr<WebGLByteArray> WebGLByteArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(signed char));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(signed char));
     return create(buffer, 0, length);
 }
 
@@ -47,19 +47,16 @@
     return a;
 }
 
-PassRefPtr<WebGLByteArray> WebGLByteArray::create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+PassRefPtr<WebGLByteArray> WebGLByteArray::create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
 {
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(signed char))) > buffer->byteLength())
-            return NULL;
-    }
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<signed char>(buf, byteOffset, length))
+        return 0;
 
-    return adoptRef(new WebGLByteArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLByteArray(buf, byteOffset, length));
 }
 
-WebGLByteArray::WebGLByteArray(PassRefPtr<WebGLArrayBuffer> buffer, int offset, unsigned length)
+WebGLByteArray::WebGLByteArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned offset, unsigned length)
     : WebGLArray(buffer, offset)
     , m_size(length)
 {
@@ -73,15 +70,12 @@
     return m_size * sizeof(signed char);
 }
 
-PassRefPtr<WebGLArray> WebGLByteArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(signed char);
-    unsigned limitByte = startByte + length * sizeof(signed char);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLByteArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<signed char>(buffer().get(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLByteArray::set(WebGLByteArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLByteArray.h b/WebCore/html/canvas/WebGLByteArray.h
index c517c03..60d301c 100644
--- a/WebCore/html/canvas/WebGLByteArray.h
+++ b/WebCore/html/canvas/WebGLByteArray.h
@@ -43,13 +43,13 @@
 
     static PassRefPtr<WebGLByteArray> create(unsigned length);
     static PassRefPtr<WebGLByteArray> create(signed char* array, unsigned length);
-    static PassRefPtr<WebGLByteArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLByteArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     char* data() { return static_cast<char*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -90,7 +90,7 @@
 
   private:
     WebGLByteArray(PassRefPtr<WebGLArrayBuffer> buffer,
-                   int offset,
+                   unsigned offset,
                    unsigned length);
     unsigned m_size;
 };
diff --git a/WebCore/html/canvas/WebGLFloatArray.cpp b/WebCore/html/canvas/WebGLFloatArray.cpp
index 6192898..ca93c4c 100644
--- a/WebCore/html/canvas/WebGLFloatArray.cpp
+++ b/WebCore/html/canvas/WebGLFloatArray.cpp
@@ -34,7 +34,7 @@
 
 PassRefPtr<WebGLFloatArray> WebGLFloatArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(float));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(float));
     return create(buffer, 0, length);
 }
 
@@ -46,22 +46,16 @@
     return a;
 }
 
-PassRefPtr<WebGLFloatArray> WebGLFloatArray::create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+PassRefPtr<WebGLFloatArray> WebGLFloatArray::create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
 {
-    // Make sure the offset results in valid alignment.
-    if ((byteOffset % sizeof(float)) != 0)
-        return NULL;
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<float>(buf, byteOffset, length))
+        return 0;
 
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(float))) > buffer->byteLength())
-            return NULL;
-    }
-    return adoptRef(new WebGLFloatArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLFloatArray(buf, byteOffset, length));
 }
 
-WebGLFloatArray::WebGLFloatArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+WebGLFloatArray::WebGLFloatArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
 {
@@ -75,15 +69,12 @@
     return m_size * sizeof(float);
 }
 
-PassRefPtr<WebGLArray> WebGLFloatArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(float);
-    unsigned limitByte = startByte + length * sizeof(float);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLFloatArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<float>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLFloatArray::set(WebGLFloatArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLFloatArray.h b/WebCore/html/canvas/WebGLFloatArray.h
index 4607962..5b4e6c9 100644
--- a/WebCore/html/canvas/WebGLFloatArray.h
+++ b/WebCore/html/canvas/WebGLFloatArray.h
@@ -40,13 +40,13 @@
 
     static PassRefPtr<WebGLFloatArray> create(unsigned length);
     static PassRefPtr<WebGLFloatArray> create(float* array, unsigned length);
-    static PassRefPtr<WebGLFloatArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLFloatArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     float* data() { return static_cast<float*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -86,7 +86,7 @@
     void set(WebGLFloatArray* array, unsigned offset, ExceptionCode& ec);
 
   private:
-    WebGLFloatArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    WebGLFloatArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
     unsigned m_size;
 };
 
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index 7ade990..614437b 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -39,10 +39,28 @@
 
 WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx)
     : CanvasObject(ctx)
+    , m_isDepthAttached(false)
+    , m_isStencilAttached(false)
+    , m_isDepthStencilAttached(false)
 {
     setObject(context()->graphicsContext3D()->createFramebuffer());
 }
 
+void WebGLFramebuffer::setIsAttached(unsigned long attachment, bool isAttached)
+{
+    switch (attachment) {
+    case GraphicsContext3D::DEPTH_ATTACHMENT:
+        m_isDepthAttached = isAttached;
+        break;
+    case GraphicsContext3D::STENCIL_ATTACHMENT:
+        m_isStencilAttached = isAttached;
+        break;
+    case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+        m_isDepthStencilAttached = isAttached;
+        break;
+    }
+}
+
 void WebGLFramebuffer::_deleteObject(Platform3DObject object)
 {
     context()->graphicsContext3D()->deleteFramebuffer(object);
diff --git a/WebCore/html/canvas/WebGLFramebuffer.h b/WebCore/html/canvas/WebGLFramebuffer.h
index 10b6772..b9402a0 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.h
+++ b/WebCore/html/canvas/WebGLFramebuffer.h
@@ -39,10 +39,21 @@
         
         static PassRefPtr<WebGLFramebuffer> create(WebGLRenderingContext*);
         
+        void setIsAttached(unsigned long attachment, bool isAttached);
+
+        bool isDepthAttached() const { return m_isDepthAttached; }
+        bool isStencilAttached() const { return m_isStencilAttached; }
+        bool isDepthStencilAttached() const { return m_isDepthStencilAttached; }
+
     protected:
         WebGLFramebuffer(WebGLRenderingContext*);
         
         virtual void _deleteObject(Platform3DObject);
+
+      private:
+        bool m_isDepthAttached;
+        bool m_isStencilAttached;
+        bool m_isDepthStencilAttached;
     };
     
 } // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLIntArray.cpp b/WebCore/html/canvas/WebGLIntArray.cpp
index 4617010..21b7a88 100644
--- a/WebCore/html/canvas/WebGLIntArray.cpp
+++ b/WebCore/html/canvas/WebGLIntArray.cpp
@@ -35,7 +35,7 @@
 
 PassRefPtr<WebGLIntArray> WebGLIntArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(int));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(int));
     return create(buffer, 0, length);
 }
 
@@ -48,24 +48,17 @@
 }
 
 PassRefPtr<WebGLIntArray> WebGLIntArray::create(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                int byteOffset,
+                                                unsigned byteOffset,
                                                 unsigned length)
 {
-    // Make sure the offset results in valid alignment.
-    if ((byteOffset % sizeof(int)) != 0)
-        return NULL;
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<int>(buf, byteOffset, length))
+        return 0;
 
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(int))) > buffer->byteLength())
-            return NULL;
-    }
-
-    return adoptRef(new WebGLIntArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLIntArray(buf, byteOffset, length));
 }
 
-WebGLIntArray::WebGLIntArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+WebGLIntArray::WebGLIntArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
 {
@@ -79,15 +72,12 @@
     return m_size * sizeof(int);
 }
 
-PassRefPtr<WebGLArray> WebGLIntArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(int);
-    unsigned limitByte = startByte + length * sizeof(int);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLIntArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<int>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLIntArray::set(WebGLIntArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLIntArray.h b/WebCore/html/canvas/WebGLIntArray.h
index 25108ac..5929e75 100644
--- a/WebCore/html/canvas/WebGLIntArray.h
+++ b/WebCore/html/canvas/WebGLIntArray.h
@@ -41,13 +41,13 @@
 
     static PassRefPtr<WebGLIntArray> create(unsigned length);
     static PassRefPtr<WebGLIntArray> create(int* array, unsigned length);
-    static PassRefPtr<WebGLIntArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLIntArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     int* data() { return static_cast<int*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -87,7 +87,7 @@
 
   private:
     WebGLIntArray(PassRefPtr<WebGLArrayBuffer> buffer,
-                  int byteOffset,
+                  unsigned byteOffset,
                   unsigned length);
     unsigned m_size;
 };
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index c2606c1..750df45 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -48,6 +48,41 @@
     context()->graphicsContext3D()->deleteProgram(object);
 }
 
+bool WebGLProgram::cacheActiveAttribLocations()
+{
+    m_activeAttribLocations.clear();
+    if (!object())
+        return false;
+    GraphicsContext3D* context3d = context()->graphicsContext3D();
+    int linkStatus;
+    context3d->getProgramiv(this, GraphicsContext3D::LINK_STATUS, &linkStatus);
+    if (!linkStatus)
+        return false;
+
+    int numAttribs = 0;
+    context3d->getProgramiv(this, GraphicsContext3D::ACTIVE_ATTRIBUTES, &numAttribs);
+    m_activeAttribLocations.resize(static_cast<size_t>(numAttribs));
+    for (int i = 0; i < numAttribs; ++i) {
+        ActiveInfo info;
+        context3d->getActiveAttrib(this, i, info);
+        m_activeAttribLocations[i] = context3d->getAttribLocation(this, info.name.charactersWithNullTermination());
+    }
+
+    return true;
+}
+
+int WebGLProgram::numActiveAttribLocations()
+{
+    return static_cast<int>(m_activeAttribLocations.size());
+}
+
+int WebGLProgram::getActiveAttribLocation(int index)
+{
+    if (index < 0 || index >= numActiveAttribLocations())
+        return -1;
+    return m_activeAttribLocations[static_cast<size_t>(index)];
+}
+
 }
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLProgram.h b/WebCore/html/canvas/WebGLProgram.h
index 8804d39..56bce15 100644
--- a/WebCore/html/canvas/WebGLProgram.h
+++ b/WebCore/html/canvas/WebGLProgram.h
@@ -30,6 +30,7 @@
 
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
     
@@ -38,11 +39,20 @@
         virtual ~WebGLProgram() { deleteObject(); }
         
         static PassRefPtr<WebGLProgram> create(WebGLRenderingContext*);
+
+        // cacheActiveAttribLocation() is only called once after linkProgram()
+        // succeeds.
+        bool cacheActiveAttribLocations();
+        int numActiveAttribLocations();
+        int getActiveAttribLocation(int index);
         
     protected:
         WebGLProgram(WebGLRenderingContext*);
         
         virtual void _deleteObject(Platform3DObject);
+
+    private:
+        Vector<int> m_activeAttribLocations;
     };
     
 } // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.cpp b/WebCore/html/canvas/WebGLRenderbuffer.cpp
index 286ad2e..cad4298 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.cpp
+++ b/WebCore/html/canvas/WebGLRenderbuffer.cpp
@@ -44,12 +44,14 @@
 
 WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContext* ctx)
     : CanvasObject(ctx)
+    , m_internalformat(GraphicsContext3D::RGBA4)
 {
     setObject(context()->graphicsContext3D()->createRenderbuffer());
 }
 
 WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContext* ctx, Platform3DObject obj)
     : CanvasObject(ctx)
+    , m_internalformat(GraphicsContext3D::RGBA4)
 {
     setObject(obj, false);
 }
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.h b/WebCore/html/canvas/WebGLRenderbuffer.h
index 790fdcd..1bdf1b7 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.h
+++ b/WebCore/html/canvas/WebGLRenderbuffer.h
@@ -43,11 +43,17 @@
         // FIXME: should consider canonicalizing these objects
         static PassRefPtr<WebGLRenderbuffer> create(WebGLRenderingContext*, Platform3DObject renderbuffer);
 
+        void setInternalformat(unsigned long internalformat) { m_internalformat = internalformat; }
+        unsigned long getInternalformat() const { return m_internalformat; }
+
     protected:
         WebGLRenderbuffer(WebGLRenderingContext*);
         WebGLRenderbuffer(WebGLRenderingContext*, Platform3DObject);
         
         virtual void _deleteObject(Platform3DObject);
+
+      private:
+        unsigned long m_internalformat;
     };
     
 } // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 6cb3348..d9af757 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -30,6 +30,7 @@
 #include "WebGLRenderingContext.h"
 
 #include "CanvasPixelArray.h"
+#include "FrameView.h"
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
 #include "ImageBuffer.h"
@@ -38,6 +39,7 @@
 #include "RenderBox.h"
 #include "RenderLayer.h"
 #include "WebGLActiveInfo.h"
+#include "WebGLUnsignedShortArray.h"
 #include "WebGLBuffer.h"
 #include "WebGLContextAttributes.h"
 #include "WebGLFramebuffer.h"
@@ -46,12 +48,6 @@
 #include "WebGLTexture.h"
 #include "WebGLShader.h"
 #include "WebGLUniformLocation.h"
-#include "HTMLCanvasElement.h"
-#include "HTMLImageElement.h"
-#include "ImageBuffer.h"
-#include "NotImplemented.h"
-#include "RenderBox.h"
-#include "RenderLayer.h"
 
 #include <wtf/ByteArray.h>
 
@@ -78,7 +74,9 @@
 
 PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElement* canvas, WebGLContextAttributes* attrs)
 {
-    OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs->attributes()));
+    HostWindow* hostWindow = canvas->document()->view()->root()->hostWindow();
+    OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs->attributes(), hostWindow));
+
     if (!context)
         return 0;
         
@@ -91,12 +89,23 @@
     , m_needsUpdate(true)
     , m_markedCanvasDirty(false)
     , m_activeTextureUnit(0)
+    , m_packAlignment(4)
+    , m_unpackAlignment(4)
 {
     ASSERT(m_context);
     int numVertexAttribs = 0;
     m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &numVertexAttribs);
     m_maxVertexAttribs = numVertexAttribs;
+    int implementationColorReadFormat = GraphicsContext3D::RGBA;
+    m_context->getIntegerv(GraphicsContext3D::IMPLEMENTATION_COLOR_READ_FORMAT, &implementationColorReadFormat);
+    m_implementationColorReadFormat = implementationColorReadFormat;
+    int implementationColorReadType = GraphicsContext3D::UNSIGNED_BYTE;
+    m_context->getIntegerv(GraphicsContext3D::IMPLEMENTATION_COLOR_READ_TYPE, &implementationColorReadType);
+    // FIXME: remove the getError() when IMPLEMENTATION_COLOR_READ_FORMAT/TYPE are supported.
+    m_context->getError();
+    m_implementationColorReadType = implementationColorReadType;
     m_context->reshape(canvas()->width(), canvas()->height());
+    m_context->viewport(0, 0, canvas()->width(), canvas()->height());
 }
 
 WebGLRenderingContext::~WebGLRenderingContext()
@@ -107,9 +116,10 @@
 void WebGLRenderingContext::markContextChanged()
 {
 #if USE(ACCELERATED_COMPOSITING)
-    if (canvas()->renderBox() && canvas()->renderBox()->hasLayer()) {
-        canvas()->renderBox()->layer()->rendererContentChanged();
-    } else {
+    RenderBox* renderBox = canvas()->renderBox();
+    if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
+        renderBox->layer()->rendererContentChanged();
+    else {
 #endif
         if (!m_markedCanvasDirty) {
             // Make sure the canvas's image buffer is allocated.
@@ -141,8 +151,9 @@
 {
     if (m_needsUpdate) {
 #if USE(ACCELERATED_COMPOSITING)
-        if (canvas()->renderBox() && canvas()->renderBox()->hasLayer())
-            canvas()->renderBox()->layer()->rendererContentChanged();
+        RenderBox* renderBox = canvas()->renderBox();
+        if (renderBox && renderBox->hasLayer())
+            renderBox->layer()->rendererContentChanged();
 #endif
         m_needsUpdate = false;
     }
@@ -186,10 +197,8 @@
 void WebGLRenderingContext::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return;
-    }
     m_context->bindAttribLocation(program, index, name);
     cleanupAfterGraphicsCall(false);
 }
@@ -412,10 +421,8 @@
 void WebGLRenderingContext::compileShader(WebGLShader* shader, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(shader))
         return;
-    }
     m_context->compileShader(shader);
     cleanupAfterGraphicsCall(false);
 }
@@ -555,10 +562,8 @@
 void WebGLRenderingContext::detachShader(WebGLProgram* program, WebGLShader* shader, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this || !shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program) || !validateWebGLObject(shader))
         return;
-    }
     m_context->detachShader(program, shader);
     cleanupAfterGraphicsCall(false);
 }
@@ -691,12 +696,20 @@
 
 bool WebGLRenderingContext::validateRenderingState(long numElementsRequired)
 {
+    if (!m_currentProgram)
+        return false;
+
     // Look in each enabled vertex attrib and find the smallest buffer size
     long smallestNumElements = LONG_MAX;
-    for (unsigned i = 0; i < m_vertexAttribState.size(); ++i) {
-        const VertexAttribState& state = m_vertexAttribState[i];
-        if (state.enabled && state.numElements < smallestNumElements)
-            smallestNumElements = state.numElements;
+    int numActiveAttribLocations = m_currentProgram->numActiveAttribLocations();
+    int numAttribStates = static_cast<int>(m_vertexAttribState.size());
+    for (int i = 0; i < numActiveAttribLocations; ++i) {
+        int loc = m_currentProgram->getActiveAttribLocation(i);
+        if (loc >=0 && loc < numAttribStates) {
+            const VertexAttribState& state = m_vertexAttribState[loc];
+            if (state.enabled && state.numElements < smallestNumElements)
+                smallestNumElements = state.numElements;
+        }
     }
     
     if (smallestNumElements == LONG_MAX)
@@ -705,6 +718,19 @@
     return numElementsRequired <= smallestNumElements;
 }
 
+bool WebGLRenderingContext::validateWebGLObject(CanvasObject* object)
+{
+    if (!object) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return false;
+    }
+    if (object->context() != this) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+        return false;
+    }
+    return true;
+}
+
 void WebGLRenderingContext::drawArrays(unsigned long mode, long first, long count, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
@@ -789,6 +815,45 @@
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
+    if (buffer->object()) {
+        bool isConflicted = false;
+        bool isDepthOrStencil = true;
+        switch (attachment) {
+        case GraphicsContext3D::DEPTH_ATTACHMENT:
+            if (m_framebufferBinding->isDepthStencilAttached() || m_framebufferBinding->isStencilAttached())
+                isConflicted = true;
+            if (buffer->getInternalformat() != GraphicsContext3D::DEPTH_COMPONENT16)
+                isConflicted = true;
+            break;
+        case GraphicsContext3D::STENCIL_ATTACHMENT:
+            if (m_framebufferBinding->isDepthStencilAttached() || m_framebufferBinding->isDepthAttached())
+                isConflicted = true;
+            if (buffer->getInternalformat() != GraphicsContext3D::STENCIL_INDEX8)
+                isConflicted = true;
+            break;
+        case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+            if (m_framebufferBinding->isDepthAttached() || m_framebufferBinding->isStencilAttached())
+                isConflicted = true;
+            if (buffer->getInternalformat() != GraphicsContext3D::DEPTH_STENCIL)
+                isConflicted = true;
+            break;
+        default:
+            isDepthOrStencil = false;
+        }
+        if (isConflicted) {
+            m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+            return;
+        }
+        if (isDepthOrStencil)
+            m_framebufferBinding->setIsAttached(attachment, true);
+    } else { // Detach
+        switch (attachment) {
+        case GraphicsContext3D::DEPTH_ATTACHMENT:
+        case GraphicsContext3D::STENCIL_ATTACHMENT:
+        case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+            m_framebufferBinding->setIsAttached(attachment, false);
+        }
+    }
     m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer);
     cleanupAfterGraphicsCall(false);
 }
@@ -827,10 +892,8 @@
 {
     UNUSED_PARAM(ec);
     ActiveInfo info;
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return 0;
-    }
     if (!m_context->getActiveAttrib(program, index, info)) {
         return 0;
     }
@@ -841,10 +904,8 @@
 {
     UNUSED_PARAM(ec);
     ActiveInfo info;
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return 0;
-    }
     if (!m_context->getActiveUniform(program, index, info)) {
         return 0;
     }
@@ -896,7 +957,8 @@
     if (target != GraphicsContext3D::FRAMEBUFFER
         || (attachment != GraphicsContext3D::COLOR_ATTACHMENT0
             && attachment != GraphicsContext3D::DEPTH_ATTACHMENT
-            && attachment != GraphicsContext3D::STENCIL_ATTACHMENT)
+            && attachment != GraphicsContext3D::STENCIL_ATTACHMENT
+            && attachment != GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT)
         || (pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
             && pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
             && pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
@@ -1115,10 +1177,8 @@
 WebGLGetInfo WebGLRenderingContext::getProgramParameter(WebGLProgram* program, unsigned long pname, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return WebGLGetInfo();
-    }
 
     WebGLStateRestorer(this, false);
     int value = 0;
@@ -1145,10 +1205,8 @@
 String WebGLRenderingContext::getProgramInfoLog(WebGLProgram* program, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return "";
-    }
     WebGLStateRestorer(this, false);
     return m_context->getProgramInfoLog(program);
 }
@@ -1175,8 +1233,11 @@
         m_context->getRenderbufferParameteriv(target, pname, &value);
         return WebGLGetInfo(static_cast<long>(value));
     case GraphicsContext3D::RENDERBUFFER_INTERNAL_FORMAT:
-        m_context->getRenderbufferParameteriv(target, pname, &value);
-        return WebGLGetInfo(static_cast<unsigned long>(value));
+        if (!m_renderbufferBinding) {
+            m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+            return WebGLGetInfo();
+        }
+        return WebGLGetInfo(m_renderbufferBinding->getInternalformat());
     default:
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
         return WebGLGetInfo();
@@ -1186,10 +1247,8 @@
 WebGLGetInfo WebGLRenderingContext::getShaderParameter(WebGLShader* shader, unsigned long pname, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(shader))
         return WebGLGetInfo();
-    }
     WebGLStateRestorer(this, false);
     int value = 0;
     switch (pname) {
@@ -1213,10 +1272,8 @@
 String WebGLRenderingContext::getShaderInfoLog(WebGLShader* shader, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(shader))
         return "";
-    }
     WebGLStateRestorer(this, false);
     return m_context->getShaderInfoLog(shader);
 }
@@ -1224,10 +1281,8 @@
 String WebGLRenderingContext::getShaderSource(WebGLShader* shader, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(shader))
         return "";
-    }
     WebGLStateRestorer(this, false);
     return m_context->getShaderSource(shader);
 }
@@ -1264,7 +1319,9 @@
 WebGLGetInfo WebGLRenderingContext::getUniform(WebGLProgram* program, const WebGLUniformLocation* uniformLocation, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || uniformLocation->program() != program || program->context() != this) {
+    if (!validateWebGLObject(program))
+        return WebGLGetInfo();
+    if (uniformLocation->program() != program) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return WebGLGetInfo();
     }
@@ -1393,12 +1450,13 @@
 PassRefPtr<WebGLUniformLocation> WebGLRenderingContext::getUniformLocation(WebGLProgram* program, const String& name, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return 0;
-    }
     WebGLStateRestorer(this, false);
-    return WebGLUniformLocation::create(program, m_context->getUniformLocation(program, name));
+    long uniformLocation = m_context->getUniformLocation(program, name);
+    if (uniformLocation == -1)
+        return 0;
+    return WebGLUniformLocation::create(program, uniformLocation);
 }
 
 WebGLGetInfo WebGLRenderingContext::getVertexAttrib(unsigned long index, unsigned long pname, ExceptionCode& ec)
@@ -1519,18 +1577,26 @@
 void WebGLRenderingContext::linkProgram(WebGLProgram* program, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!program || program->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(program))
         return;
-    }
-        
     m_context->linkProgram(program);
+    program->cacheActiveAttribLocations();
     cleanupAfterGraphicsCall(false);
 }
 
 void WebGLRenderingContext::pixelStorei(unsigned long pname, long param)
 {
     m_context->pixelStorei(pname, param);
+    if (param == 1 || param == 2 || param == 4 || param == 8) {
+        switch (pname) {
+        case GraphicsContext3D::PACK_ALIGNMENT:
+            m_packAlignment = static_cast<int>(param);
+            break;
+        case GraphicsContext3D::UNPACK_ALIGNMENT:
+            m_unpackAlignment = static_cast<int>(param);
+            break;
+        }
+    }
     cleanupAfterGraphicsCall(false);
 }
 
@@ -1542,7 +1608,76 @@
 
 PassRefPtr<WebGLArray> WebGLRenderingContext::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type)
 {
-    RefPtr<WebGLArray> array = m_context->readPixels(x, y, width, height, format, type);
+    // Validate enums.
+    unsigned long componentsPerPixel = 0;
+    switch (format) {
+    case GraphicsContext3D::ALPHA:
+        componentsPerPixel = 1;
+        break;
+    case GraphicsContext3D::RGB:
+        componentsPerPixel = 3;
+        break;
+    case GraphicsContext3D::RGBA:
+        componentsPerPixel = 4;
+        break;
+    default:
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+        return 0;
+    }
+    unsigned long bytesPerComponent = 0;
+    switch (type) {
+    case GraphicsContext3D::UNSIGNED_BYTE:
+        bytesPerComponent = sizeof(unsigned char);
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
+    case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
+    case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
+        componentsPerPixel = 1;
+        bytesPerComponent = sizeof(unsigned short);
+        break;
+    default:
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+        return 0;
+    }
+    if (!(format == GraphicsContext3D::RGBA && type == GraphicsContext3D::UNSIGNED_BYTE || format == m_implementationColorReadFormat && type == m_implementationColorReadFormat)) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+        return 0;
+    }
+    // Calculate array size, taking into consideration of PACK_ALIGNMENT.
+    unsigned long bytesPerRow = componentsPerPixel * bytesPerComponent * width;
+    unsigned long padding = 0;
+    unsigned long residualBytes = bytesPerRow % m_packAlignment;
+    if (residualBytes) {
+        padding = m_packAlignment - residualBytes;
+        bytesPerRow += padding;
+    }
+    // The last row needs no padding.
+    unsigned long totalBytes = bytesPerRow * height - padding;
+    unsigned long num = totalBytes / bytesPerComponent;
+    RefPtr<WebGLArray> array;
+    if (type == GraphicsContext3D::UNSIGNED_BYTE)
+        array = WebGLUnsignedByteArray::create(num);
+    else
+        array = WebGLUnsignedShortArray::create(num);
+    void* data = array->baseAddress();
+    m_context->readPixels(x, y, width, height, format, type, data);
+#if PLATFORM(CG)
+    // FIXME: remove this section when GL driver bug on Mac is fixed, i.e.,
+    // when alpha is off, readPixels should set alpha to 255 instead of 0.
+    if ((format == GraphicsContext3D::ALPHA || format == GraphicsContext3D::RGBA) && !m_context->getContextAttributes().alpha) {
+        if (type == GraphicsContext3D::UNSIGNED_BYTE) {
+            unsigned char* pixels = reinterpret_cast<unsigned char*>(data);
+            for (unsigned long iy = 0; iy < height; ++iy) {
+                for (unsigned long ix = 0; ix < width; ++ix) {
+                    pixels[componentsPerPixel - 1] = 255;
+                    pixels += componentsPerPixel;
+                }
+                pixels += padding;
+            }
+        }
+        // FIXME: check whether we need to do the same with UNSIGNED_SHORT.
+    }
+#endif
     cleanupAfterGraphicsCall(false);
     return array;
 }
@@ -1555,8 +1690,21 @@
 
 void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
 {
-    m_context->renderbufferStorage(target, internalformat, width, height);
-    cleanupAfterGraphicsCall(false);
+    switch (internalformat) {
+    case GraphicsContext3D::DEPTH_COMPONENT16:
+    case GraphicsContext3D::RGBA4:
+    case GraphicsContext3D::RGB5_A1:
+    case GraphicsContext3D::RGB565:
+    case GraphicsContext3D::STENCIL_INDEX8:
+    case GraphicsContext3D::DEPTH_STENCIL:
+        m_context->renderbufferStorage(target, internalformat, width, height);
+        if (m_renderbufferBinding)
+            m_renderbufferBinding->setInternalformat(internalformat);
+        cleanupAfterGraphicsCall(false);
+        break;
+    default:
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+    }
 }
 
 void WebGLRenderingContext::sampleCoverage(double value, bool invert)
@@ -1574,10 +1722,8 @@
 void WebGLRenderingContext::shaderSource(WebGLShader* shader, const String& string, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!shader || shader->context() != this) {
-        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+    if (!validateWebGLObject(shader))
         return;
-    }
     m_context->shaderSource(shader, string);
     cleanupAfterGraphicsCall(false);
 }
@@ -1634,12 +1780,10 @@
                                        bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
 {
     // FIXME: For now we ignore any errors returned
-    // FIXME: Need a form of this call that can take both a pixel buffer and flipY and premultiplyAlpha flags
-    UNUSED_PARAM(flipY);
-    UNUSED_PARAM(premultiplyAlpha);
     ec = 0;
-    m_context->texImage2D(target, level, GraphicsContext3D::RGBA, pixels->width(), pixels->height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels->data()->data()->data());
-    //RLP: m_context->texImage2D(target, level, pixels, flipY, premultiplyAlpha);
+    Vector<uint8_t> data;
+    m_context->extractImageData(pixels, flipY, premultiplyAlpha, data);
+    m_context->texImage2D(target, level, GraphicsContext3D::RGBA, pixels->width(), pixels->height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data());
     cleanupAfterGraphicsCall(false);
 }
 
@@ -1724,11 +1868,10 @@
                                           ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
 {
     // FIXME: For now we ignore any errors returned
-    UNUSED_PARAM(flipY);
-    UNUSED_PARAM(premultiplyAlpha);
     ec = 0;
-    m_context->texSubImage2D(target, level, xoffset, yoffset, pixels->width(), pixels->height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels->data()->data()->data());
-    //RLP: m_context->texSubImage2D(target, level, xoffset, yoffset, pixels, flipY, premultiplyAlpha);
+    Vector<uint8_t> data;
+    m_context->extractImageData(pixels, flipY, premultiplyAlpha, data);
+    m_context->texSubImage2D(target, level, xoffset, yoffset, pixels->width(), pixels->height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data());
     cleanupAfterGraphicsCall(false);
 }
 
@@ -1790,7 +1933,12 @@
 void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1802,7 +1950,12 @@
 void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1818,7 +1971,12 @@
 void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1834,7 +1992,12 @@
 void WebGLRenderingContext::uniform1i(const WebGLUniformLocation* location, int x, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1846,7 +2009,12 @@
 void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1862,7 +2030,12 @@
 void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1878,7 +2051,12 @@
 void WebGLRenderingContext::uniform2f(const WebGLUniformLocation* location, float x, float y, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1890,7 +2068,12 @@
 void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1907,7 +2090,12 @@
 void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1924,7 +2112,12 @@
 void WebGLRenderingContext::uniform2i(const WebGLUniformLocation* location, int x, int y, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1936,7 +2129,12 @@
 void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1953,7 +2151,12 @@
 void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1970,7 +2173,12 @@
 void WebGLRenderingContext::uniform3f(const WebGLUniformLocation* location, float x, float y, float z, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1982,7 +2190,12 @@
 void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -1999,7 +2212,12 @@
 void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2016,7 +2234,12 @@
 void WebGLRenderingContext::uniform3i(const WebGLUniformLocation* location, int x, int y, int z, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2028,7 +2251,12 @@
 void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2045,7 +2273,12 @@
 void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2062,7 +2295,12 @@
 void WebGLRenderingContext::uniform4f(const WebGLUniformLocation* location, float x, float y, float z, float w, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2074,7 +2312,12 @@
 void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2091,7 +2334,12 @@
 void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2108,7 +2356,12 @@
 void WebGLRenderingContext::uniform4i(const WebGLUniformLocation* location, int x, int y, int z, int w, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2120,7 +2373,12 @@
 void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2137,7 +2395,12 @@
 void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2154,7 +2417,12 @@
 void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, bool transpose, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2171,7 +2439,12 @@
 void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, bool transpose, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2188,7 +2461,12 @@
 void WebGLRenderingContext::uniformMatrix3fv(const WebGLUniformLocation* location, bool transpose, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2205,7 +2483,12 @@
 void WebGLRenderingContext::uniformMatrix3fv(const WebGLUniformLocation* location, bool transpose, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2222,7 +2505,12 @@
 void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* location, bool transpose, WebGLFloatArray* v, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
@@ -2239,7 +2527,12 @@
 void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* location, bool transpose, float* v, int size, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
-    if (!location || location->program() != m_currentProgram) {
+    if (!location) {
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+        return;
+    }
+
+    if (location->program() != m_currentProgram) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index 90d4fab..9c58a53 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -309,6 +309,8 @@
         bool validateIndexArrayPrecise(unsigned long count, unsigned long type, long offset, long& numElementsRequired);
         bool validateRenderingState(long numElements);
 
+        bool validateWebGLObject(CanvasObject* object);
+
         OwnPtr<GraphicsContext3D> m_context;
         bool m_needsUpdate;
         bool m_markedCanvasDirty;
@@ -342,6 +344,11 @@
         TextureUnitState m_textureUnits[32];
         unsigned long m_activeTextureUnit;
 
+        int m_packAlignment;
+        int m_unpackAlignment;
+        unsigned long m_implementationColorReadFormat;
+        unsigned long m_implementationColorReadType;
+
         // Helpers for getParameter and others
         WebGLGetInfo getBooleanParameter(unsigned long pname);
         WebGLGetInfo getFloatParameter(unsigned long pname);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index ce01f43..a257452 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -423,6 +423,7 @@
         const unsigned int DEPTH_COMPONENT16              = 0x81A5;
         const unsigned int STENCIL_INDEX                  = 0x1901;
         const unsigned int STENCIL_INDEX8                 = 0x8D48;
+        const unsigned int DEPTH_STENCIL                  = 0x84F9;
 
         const unsigned int RENDERBUFFER_WIDTH             = 0x8D42;
         const unsigned int RENDERBUFFER_HEIGHT            = 0x8D43;
@@ -442,6 +443,7 @@
         const unsigned int COLOR_ATTACHMENT0              = 0x8CE0;
         const unsigned int DEPTH_ATTACHMENT               = 0x8D00;
         const unsigned int STENCIL_ATTACHMENT             = 0x8D20;
+        const unsigned int DEPTH_STENCIL_ATTACHMENT       = 0x821A;
 
         const unsigned int NONE                           = 0;
 
@@ -518,7 +520,7 @@
         void         disable(in unsigned long cap);
         void         disableVertexAttribArray(in unsigned long index) raises(DOMException);
         void         drawArrays(in unsigned long mode, in long first, in unsigned long count) raises(DOMException);
-        void         drawElements (in unsigned long mode, in long count, in unsigned long type, in unsigned long offset) raises(DOMException);
+        void         drawElements(in unsigned long mode, in long count, in unsigned long type, in unsigned long offset) raises(DOMException);
 
         void         enable(in unsigned long cap);
         void         enableVertexAttribArray(in unsigned long index) raises(DOMException);
diff --git a/WebCore/html/canvas/WebGLShortArray.cpp b/WebCore/html/canvas/WebGLShortArray.cpp
index f96a290..a9b0f0d 100644
--- a/WebCore/html/canvas/WebGLShortArray.cpp
+++ b/WebCore/html/canvas/WebGLShortArray.cpp
@@ -34,7 +34,7 @@
 
 PassRefPtr<WebGLShortArray> WebGLShortArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(short));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(short));
     return create(buffer, 0, length);
 }
 
@@ -47,24 +47,17 @@
 }
 
 PassRefPtr<WebGLShortArray> WebGLShortArray::create(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                    int byteOffset,
+                                                    unsigned byteOffset,
                                                     unsigned length)
 {
-    // Make sure the offset results in valid alignment.
-    if ((byteOffset % sizeof(short)) != 0)
-        return NULL;
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<short>(buf, byteOffset, length))
+        return 0;
 
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(short))) > buffer->byteLength())
-            return NULL;
-    }
-
-    return adoptRef(new WebGLShortArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLShortArray(buf, byteOffset, length));
 }
 
-WebGLShortArray::WebGLShortArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+WebGLShortArray::WebGLShortArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
 {
@@ -78,15 +71,12 @@
     return m_size * sizeof(short);
 }
 
-PassRefPtr<WebGLArray> WebGLShortArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(short);
-    unsigned limitByte = startByte + length * sizeof(short);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLShortArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<short>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLShortArray::set(WebGLShortArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLShortArray.h b/WebCore/html/canvas/WebGLShortArray.h
index 70c66ca..af4befb 100644
--- a/WebCore/html/canvas/WebGLShortArray.h
+++ b/WebCore/html/canvas/WebGLShortArray.h
@@ -40,13 +40,13 @@
 
     static PassRefPtr<WebGLShortArray> create(unsigned length);
     static PassRefPtr<WebGLShortArray> create(short* array, unsigned length);
-    static PassRefPtr<WebGLShortArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLShortArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     short* data() { return static_cast<short*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -85,7 +85,7 @@
     void set(WebGLShortArray* array, unsigned offset, ExceptionCode& ec);
 
   private:
-    WebGLShortArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    WebGLShortArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
     unsigned m_size;
 };
 
diff --git a/WebCore/html/canvas/WebGLUnsignedByteArray.cpp b/WebCore/html/canvas/WebGLUnsignedByteArray.cpp
index 3fd1b50..81e0135 100644
--- a/WebCore/html/canvas/WebGLUnsignedByteArray.cpp
+++ b/WebCore/html/canvas/WebGLUnsignedByteArray.cpp
@@ -35,7 +35,7 @@
 
 PassRefPtr<WebGLUnsignedByteArray> WebGLUnsignedByteArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(unsigned char));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(unsigned char));
     return create(buffer, 0, length);
 }
 
@@ -48,20 +48,17 @@
 }
 
 PassRefPtr<WebGLUnsignedByteArray> WebGLUnsignedByteArray::create(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                                  int byteOffset,
+                                                                  unsigned byteOffset,
                                                                   unsigned length)
 {
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(unsigned char))) > buffer->byteLength())
-            return NULL;
-    }
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<unsigned char>(buf, byteOffset, length))
+        return 0;
 
-    return adoptRef(new WebGLUnsignedByteArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLUnsignedByteArray(buf, byteOffset, length));
 }
 
-WebGLUnsignedByteArray::WebGLUnsignedByteArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+WebGLUnsignedByteArray::WebGLUnsignedByteArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
 {
@@ -75,15 +72,12 @@
     return m_size * sizeof(unsigned char);
 }
 
-PassRefPtr<WebGLArray> WebGLUnsignedByteArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(unsigned char);
-    unsigned limitByte = startByte + length * sizeof(unsigned char);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLUnsignedByteArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<unsigned char>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLUnsignedByteArray::set(WebGLUnsignedByteArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLUnsignedByteArray.h b/WebCore/html/canvas/WebGLUnsignedByteArray.h
index 6909de5..505b2fd 100644
--- a/WebCore/html/canvas/WebGLUnsignedByteArray.h
+++ b/WebCore/html/canvas/WebGLUnsignedByteArray.h
@@ -41,13 +41,13 @@
 
     static PassRefPtr<WebGLUnsignedByteArray> create(unsigned length);
     static PassRefPtr<WebGLUnsignedByteArray> create(unsigned char* array, unsigned length);
-    static PassRefPtr<WebGLUnsignedByteArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLUnsignedByteArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     unsigned char* data() { return static_cast<unsigned char*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -86,7 +86,7 @@
     void set(WebGLUnsignedByteArray* array, unsigned offset, ExceptionCode& ec);
 
   private:
-    WebGLUnsignedByteArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    WebGLUnsignedByteArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
     unsigned m_size;
 };
 
diff --git a/WebCore/html/canvas/WebGLUnsignedIntArray.cpp b/WebCore/html/canvas/WebGLUnsignedIntArray.cpp
index 97910f9..59d895f 100644
--- a/WebCore/html/canvas/WebGLUnsignedIntArray.cpp
+++ b/WebCore/html/canvas/WebGLUnsignedIntArray.cpp
@@ -35,7 +35,7 @@
 
 PassRefPtr<WebGLUnsignedIntArray> WebGLUnsignedIntArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(unsigned int));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(unsigned int));
     return create(buffer, 0, length);
 }
 
@@ -48,25 +48,17 @@
 }
 
 PassRefPtr<WebGLUnsignedIntArray> WebGLUnsignedIntArray::create(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                                int byteOffset,
+                                                                unsigned byteOffset,
                                                                 unsigned length)
 {
-    // Make sure the offset results in valid alignment.
-    if ((byteOffset % sizeof(unsigned int)) != 0) {
-        return NULL;
-    }
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<unsigned int>(buf, byteOffset, length))
+        return 0;
 
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(unsigned int))) > buffer->byteLength())
-            return NULL;
-    }
-
-    return adoptRef(new WebGLUnsignedIntArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLUnsignedIntArray(buf, byteOffset, length));
 }
 
-WebGLUnsignedIntArray::WebGLUnsignedIntArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length)
+WebGLUnsignedIntArray::WebGLUnsignedIntArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
 {
@@ -80,15 +72,12 @@
     return m_size * sizeof(unsigned int);
 }
 
-PassRefPtr<WebGLArray> WebGLUnsignedIntArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(unsigned int);
-    unsigned limitByte = startByte + length * sizeof(unsigned int);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLUnsignedIntArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<unsigned int>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLUnsignedIntArray::set(WebGLUnsignedIntArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLUnsignedIntArray.h b/WebCore/html/canvas/WebGLUnsignedIntArray.h
index b0d9b65..6e9b220 100644
--- a/WebCore/html/canvas/WebGLUnsignedIntArray.h
+++ b/WebCore/html/canvas/WebGLUnsignedIntArray.h
@@ -41,13 +41,13 @@
 
     static PassRefPtr<WebGLUnsignedIntArray> create(unsigned length);
     static PassRefPtr<WebGLUnsignedIntArray> create(unsigned int* array, unsigned length);
-    static PassRefPtr<WebGLUnsignedIntArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLUnsignedIntArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     unsigned int* data() { return static_cast<unsigned int*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -86,7 +86,7 @@
     void set(WebGLUnsignedIntArray* array, unsigned offset, ExceptionCode& ec);
 
   private:
-    WebGLUnsignedIntArray(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    WebGLUnsignedIntArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
     unsigned m_size;
 };
 
diff --git a/WebCore/html/canvas/WebGLUnsignedShortArray.cpp b/WebCore/html/canvas/WebGLUnsignedShortArray.cpp
index 86fae8c..c283a81 100644
--- a/WebCore/html/canvas/WebGLUnsignedShortArray.cpp
+++ b/WebCore/html/canvas/WebGLUnsignedShortArray.cpp
@@ -35,7 +35,7 @@
 
 PassRefPtr<WebGLUnsignedShortArray> WebGLUnsignedShortArray::create(unsigned length)
 {
-    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length * sizeof(unsigned short));
+    RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(length, sizeof(unsigned short));
     return create(buffer, 0, length);
 }
 
@@ -48,26 +48,18 @@
 }
 
 PassRefPtr<WebGLUnsignedShortArray> WebGLUnsignedShortArray::create(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                                    int byteOffset,
+                                                                    unsigned byteOffset,
                                                                     unsigned length)
 {
-    // Make sure the offset results in valid alignment.
-    if ((byteOffset % sizeof(unsigned short)) != 0) {
-        return NULL;
-    }
+    RefPtr<WebGLArrayBuffer> buf(buffer);
+    if (!verifySubRange<unsigned short>(buf, byteOffset, length))
+        return 0;
 
-    if (buffer) {
-        // Check to make sure we are talking about a valid region of
-        // the given WebGLArrayBuffer's storage.
-        if ((byteOffset + (length * sizeof(unsigned short))) > buffer->byteLength()) 
-            return NULL;
-    }
-
-    return adoptRef(new WebGLUnsignedShortArray(buffer, byteOffset, length));
+    return adoptRef(new WebGLUnsignedShortArray(buf, byteOffset, length));
 }
 
 WebGLUnsignedShortArray::WebGLUnsignedShortArray(PassRefPtr<WebGLArrayBuffer> buffer,
-                                                 int byteOffset,
+                                                 unsigned byteOffset,
                                                  unsigned length)
         : WebGLArray(buffer, byteOffset)
         , m_size(length)
@@ -82,15 +74,12 @@
     return m_size * sizeof(unsigned short);
 }
 
-PassRefPtr<WebGLArray> WebGLUnsignedShortArray::slice(unsigned offset, unsigned length) {
-    // Check to make sure the specified region is within the bounds of
-    // the WebGLArrayBuffer.
-    unsigned startByte = m_byteOffset + offset * sizeof(unsigned short);
-    unsigned limitByte = startByte + length * sizeof(unsigned short);
-    unsigned bufferLength = buffer()->byteLength();
-    if (startByte >= bufferLength || limitByte > bufferLength)
-        return 0;
-    return create(buffer(), startByte, length);
+PassRefPtr<WebGLArray> WebGLUnsignedShortArray::slice(int start, int end)
+{
+    unsigned offset, length;
+    calculateOffsetAndLength(start, end, m_size, &offset, &length);
+    clampOffsetAndNumElements<unsigned short>(buffer(), m_byteOffset, &offset, &length);
+    return create(buffer(), offset, length);
 }
 
 void WebGLUnsignedShortArray::set(WebGLUnsignedShortArray* array, unsigned offset, ExceptionCode& ec) {
diff --git a/WebCore/html/canvas/WebGLUnsignedShortArray.h b/WebCore/html/canvas/WebGLUnsignedShortArray.h
index 3bad1b6..94b428a 100644
--- a/WebCore/html/canvas/WebGLUnsignedShortArray.h
+++ b/WebCore/html/canvas/WebGLUnsignedShortArray.h
@@ -41,13 +41,13 @@
 
     static PassRefPtr<WebGLUnsignedShortArray> create(unsigned length);
     static PassRefPtr<WebGLUnsignedShortArray> create(unsigned short* array, unsigned length);
-    static PassRefPtr<WebGLUnsignedShortArray> create(PassRefPtr<WebGLArrayBuffer> buffer, int byteOffset, unsigned length);
+    static PassRefPtr<WebGLUnsignedShortArray> create(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset, unsigned length);
 
     unsigned short* data() { return static_cast<unsigned short*>(baseAddress()); }
 
     virtual unsigned length() const;
     virtual unsigned byteLength() const;
-    virtual PassRefPtr<WebGLArray> slice(unsigned offset, unsigned length);
+    virtual PassRefPtr<WebGLArray> slice(int start, int end);
 
     void set(unsigned index, double value)
     {
@@ -87,7 +87,7 @@
     void set(WebGLUnsignedShortArray* array, unsigned offset, ExceptionCode& ec);
 
   private:
-    WebGLUnsignedShortArray(PassRefPtr<WebGLArrayBuffer> buffer,int byteOffset,unsigned length);
+    WebGLUnsignedShortArray(PassRefPtr<WebGLArrayBuffer> buffer, unsigned byteOffset,unsigned length);
     unsigned m_size;
 };
 
diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp
index 5539e9d..934e2e9 100644
--- a/WebCore/inspector/ConsoleMessage.cpp
+++ b/WebCore/inspector/ConsoleMessage.cpp
@@ -31,9 +31,12 @@
 #include "config.h"
 #include "ConsoleMessage.h"
 
+#include "InjectedScript.h"
+#include "InjectedScriptHost.h"
 #include "InspectorFrontend.h"
 #include "ScriptCallStack.h"
 #include "ScriptObject.h"
+#include "SerializedScriptValue.h"
 
 namespace WebCore {
 
@@ -80,7 +83,7 @@
 }
 
 #if ENABLE(INSPECTOR)
-void ConsoleMessage::addToConsole(InspectorFrontend* frontend)
+void ConsoleMessage::addToFrontend(InspectorFrontend* frontend, InjectedScriptHost* injectedScriptHost)
 {
     ScriptObject jsonObj = frontend->newScriptObject();
     jsonObj.set("source", static_cast<int>(m_source));
@@ -90,7 +93,15 @@
     jsonObj.set("url", m_url);
     jsonObj.set("groupLevel", static_cast<int>(m_groupLevel));
     jsonObj.set("repeatCount", static_cast<int>(m_repeatCount));
-    frontend->addConsoleMessage(jsonObj, m_frames, m_scriptState, m_arguments,  m_message);
+    Vector<RefPtr<SerializedScriptValue> > arguments;
+    if (!m_arguments.isEmpty()) {
+        InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get());
+        for (unsigned i = 0; i < m_arguments.size(); ++i) {
+            RefPtr<SerializedScriptValue> serializedValue = injectedScript.wrapForConsole(m_arguments[i]);
+            arguments.append(serializedValue);
+        }
+    }   
+    frontend->addConsoleMessage(jsonObj, m_frames, arguments,  m_message);
 }
 
 void ConsoleMessage::updateRepeatCountInConsole(InspectorFrontend* frontend)
diff --git a/WebCore/inspector/ConsoleMessage.h b/WebCore/inspector/ConsoleMessage.h
index e9ae130..77a010c 100644
--- a/WebCore/inspector/ConsoleMessage.h
+++ b/WebCore/inspector/ConsoleMessage.h
@@ -38,40 +38,41 @@
 #include <wtf/Vector.h>
 
 namespace WebCore {
-    class InspectorFrontend;
-    class ScriptCallStack;
-    class ScriptString;
+class InjectedScriptHost;
+class InspectorFrontend;
+class ScriptCallStack;
+class ScriptString;
 
-    class ConsoleMessage : public Noncopyable {
-    public:
-        ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);        
-        ConsoleMessage(MessageSource, MessageType, MessageLevel, ScriptCallStack*, unsigned g, bool storeTrace = false);
+class ConsoleMessage : public Noncopyable {
+public:
+    ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);        
+    ConsoleMessage(MessageSource, MessageType, MessageLevel, ScriptCallStack*, unsigned g, bool storeTrace = false);
 
 #if ENABLE(INSPECTOR)
-        void addToConsole(InspectorFrontend* frontend);
-        void updateRepeatCountInConsole(InspectorFrontend* frontend);
+    void addToFrontend(InspectorFrontend*, InjectedScriptHost*);
+    void updateRepeatCountInConsole(InspectorFrontend* frontend);
 #endif
-        void incrementCount() { ++m_repeatCount; };
-        bool isEqual(ScriptState*, ConsoleMessage* msg) const;
+    void incrementCount() { ++m_repeatCount; }
+    bool isEqual(ScriptState*, ConsoleMessage* msg) const;
 
-        MessageSource source() const { return m_source; }
-        const String& message() const { return m_message; }
+    MessageSource source() const { return m_source; }
+    const String& message() const { return m_message; }
 
-    private:
-        MessageSource m_source;
-        MessageType m_type;
-        MessageLevel m_level;
-        String m_message;
+private:
+    MessageSource m_source;
+    MessageType m_type;
+    MessageLevel m_level;
+    String m_message;
 #if ENABLE(INSPECTOR)
-        Vector<ScriptValue> m_arguments;
-        ScriptState* m_scriptState;
+    Vector<ScriptValue> m_arguments;
+    ScriptStateProtectedPtr m_scriptState;
 #endif
-        Vector<ScriptString> m_frames;
-        unsigned m_line;
-        String m_url;
-        unsigned m_groupLevel;
-        unsigned m_repeatCount;
-    };
+    Vector<ScriptString> m_frames;
+    unsigned m_line;
+    String m_url;
+    unsigned m_groupLevel;
+    unsigned m_repeatCount;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp
index 42a2856..2e35e4b 100644
--- a/WebCore/inspector/InjectedScript.cpp
+++ b/WebCore/inspector/InjectedScript.cpp
@@ -47,6 +47,11 @@
 void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<SerializedScriptValue>* result, bool* hadException) 
 {
     ASSERT(!hasNoValue());
+    if (!canAccessInspectedWindow()) {
+        *hadException = true;
+        return;
+    }
+
     ScriptFunctionCall function(m_injectedScriptObject, "dispatch");
     function.appendArgument(methodName);
     function.appendArgument(arguments);
@@ -71,10 +76,13 @@
 PassRefPtr<SerializedScriptValue> InjectedScript::wrapForConsole(ScriptValue value)
 {
     ASSERT(!hasNoValue());
-    ScriptFunctionCall wrapFunction(m_injectedScriptObject, "wrapObject");
+    ScriptFunctionCall wrapFunction(m_injectedScriptObject, "wrapObjectForConsole");
     wrapFunction.appendArgument(value);
-    wrapFunction.appendArgument("console");
-    ScriptValue r = wrapFunction.call();
+    wrapFunction.appendArgument(canAccessInspectedWindow());
+    bool hadException = false;
+    ScriptValue r = wrapFunction.call(hadException);
+    if (hadException)
+        return SerializedScriptValue::create("<exception>");
     return r.serialize(m_injectedScriptObject.scriptState());
 }
 
@@ -85,6 +93,10 @@
     releaseFunction.appendArgument(objectGroup);
     releaseFunction.call();
 }
+bool InjectedScript::canAccessInspectedWindow()
+{
+    return InjectedScriptHost::canAccessInspectedWindow(m_injectedScriptObject.scriptState());
+}
 
 } // namespace WebCore
 
diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h
index db40f80..1e9b787 100644
--- a/WebCore/inspector/InjectedScript.h
+++ b/WebCore/inspector/InjectedScript.h
@@ -58,6 +58,7 @@
 private:
     friend InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState*);
     explicit InjectedScript(ScriptObject);
+    bool canAccessInspectedWindow();
     ScriptObject m_injectedScriptObject;
 };
 
diff --git a/WebCore/inspector/InjectedScriptHost.cpp b/WebCore/inspector/InjectedScriptHost.cpp
index 62db4b4..c58073d 100644
--- a/WebCore/inspector/InjectedScriptHost.cpp
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -46,10 +46,8 @@
 #include "InspectorResource.h"
 #include "Pasteboard.h"
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
-using namespace JSC;
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugServer.h"
 #endif
 
 #if ENABLE(DATABASE)
@@ -72,6 +70,7 @@
 InjectedScriptHost::InjectedScriptHost(InspectorController* inspectorController)
     : m_inspectorController(inspectorController)
     , m_nextInjectedScriptId(1)
+    , m_lastWorkerId(1 << 31) // Distinguish ids of fake workers from real ones, to minimize the chances they overlap.
 {
 }
 
@@ -130,13 +129,6 @@
     return domAgent->pushNodePathToFrontend(node);
 }
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-JavaScriptCallFrame* InjectedScriptHost::currentCallFrame() const
-{
-    return JavaScriptDebugServer::shared().currentCallFrame();
-}
-#endif
-
 #if ENABLE(DATABASE)
 Database* InjectedScriptHost::databaseForId(long databaseId)
 {
@@ -203,6 +195,31 @@
     return m_inspectorController->m_frontend.get();
 }
 
+pair<long, ScriptObject> InjectedScriptHost::injectScript(const String& source, ScriptState* scriptState)
+{
+    long id = m_nextInjectedScriptId++;
+    return std::make_pair(id, createInjectedScript(source, scriptState, id));
+}
+
+#if ENABLE(WORKERS)
+long InjectedScriptHost::nextWorkerId()
+{
+    return ++m_lastWorkerId;
+}
+
+void InjectedScriptHost::didCreateWorker(long id, const String& url, bool isSharedWorker)
+{
+    if (m_inspectorController)
+        m_inspectorController->didCreateWorker(id, url, isSharedWorker);
+}
+
+void InjectedScriptHost::didDestroyWorker(long id)
+{
+    if (m_inspectorController)
+        m_inspectorController->didDestroyWorker(id);
+}
+#endif // ENABLE(WORKERS)
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
index fb56115..beffc9d 100644
--- a/WebCore/inspector/InjectedScriptHost.h
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -44,7 +44,6 @@
 class InjectedScript;
 class InspectorDOMAgent;
 class InspectorFrontend;
-class JavaScriptCallFrame;
 class Node;
 class SerializedScriptValue;
 class Storage;
@@ -73,9 +72,6 @@
     void addNodesToSearchResult(const String& nodeIds);
     long pushNodeByPathToFrontend(const String& path);
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-    JavaScriptCallFrame* currentCallFrame() const;
-#endif
 #if ENABLE(DATABASE)
     Database* databaseForId(long databaseId);
     void selectDatabase(Database* database);
@@ -83,21 +79,31 @@
 #if ENABLE(DOM_STORAGE)
     void selectDOMStorage(Storage* storage);
 #endif
+#if ENABLE(WORKERS)
+    long nextWorkerId();
+    void didCreateWorker(long id, const String& url, bool isSharedWorker);
+    void didDestroyWorker(long id);
+#endif
     void reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);
 
+    pair<long, ScriptObject> injectScript(const String& source, ScriptState*);
     InjectedScript injectedScriptFor(ScriptState*);
     InjectedScript injectedScriptForId(long);
     void discardInjectedScripts();
     void releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup);
 
+    static bool canAccessInspectedWindow(ScriptState*);
+
 private:
     InjectedScriptHost(InspectorController* inspectorController);
     InspectorDOMAgent* inspectorDOMAgent();
     InspectorFrontend* inspectorFrontend();
+    ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id);
 
     InspectorController* m_inspectorController;
     String m_injectedScriptSource;
     long m_nextInjectedScriptId;
+    long m_lastWorkerId;
     typedef HashMap<long, InjectedScript> IdToInjectedScriptMap;
     IdToInjectedScriptMap m_idToInjectedScript;
 };
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
index bb57c3a..e3cd976 100644
--- a/WebCore/inspector/InjectedScriptHost.idl
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -41,7 +41,7 @@
         void addNodesToSearchResult(in DOMString nodeIds);
         long pushNodeByPathToFrontend(in DOMString path);
 
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
+#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         [Custom] DOMObject currentCallFrame();
         [Custom] boolean isActivation(in DOMObject object);
 #endif
@@ -55,6 +55,11 @@
         [Custom] void selectDOMStorage(in DOMObject storage);
 #endif
 
+#if defined(ENABLE_WORKERS) && ENABLE_WORKERS
+        void didCreateWorker(in long id, in DOMString url, in boolean isFakeWorker);
+        void didDestroyWorker(in long id);
+        long nextWorkerId();
+#endif
         [Custom] void reportDidDispatchOnInjectedScript(in long callId, in DOMObject result, in boolean isException);
     };
 }
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index c43be63..aed8f2b 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,18 +47,18 @@
 #include "InspectorDOMAgent.h"
 #include "InspectorFrontend.h"
 #include "InspectorResource.h"
+#include "Page.h"
 #include "Pasteboard.h"
 #include "ScriptArray.h"
+#include "ScriptBreakpoint.h"
 #include "SerializedScriptValue.h"
 
 #if ENABLE(DOM_STORAGE)
 #include "Storage.h"
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
-using namespace JSC;
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugServer.h"
 #endif
 
 #include "markup.h"
@@ -82,7 +82,7 @@
 void InspectorBackend::saveFrontendSettings(const String& settings)
 {
     if (m_inspectorController)
-        m_inspectorController->setSetting(InspectorController::FrontendSettingsSettingName, settings);
+        m_inspectorController->setSetting(InspectorController::frontendSettingsSettingName(), settings);
 }
 
 void InspectorBackend::storeLastActivePanel(const String& panelName)
@@ -91,24 +91,16 @@
         m_inspectorController->storeLastActivePanel(panelName);
 }
 
-void InspectorBackend::toggleNodeSearch()
+void InspectorBackend::enableSearchingForNode()
 {
     if (m_inspectorController)
-        m_inspectorController->toggleSearchForNodeInPage();
+        m_inspectorController->setSearchingForNode(true);
 }
 
-bool InspectorBackend::searchingForNode()
+void InspectorBackend::disableSearchingForNode()
 {
     if (m_inspectorController)
-        return m_inspectorController->searchingForNodeInPage();
-    return false;
-}
-
-bool InspectorBackend::resourceTrackingEnabled() const
-{
-    if (m_inspectorController)
-        return m_inspectorController->resourceTrackingEnabled();
-    return false;
+        m_inspectorController->setSearchingForNode(false);
 }
 
 void InspectorBackend::enableResourceTracking(bool always)
@@ -136,6 +128,12 @@
         frontend->didGetResourceContent(callId, "");
 }
 
+void InspectorBackend::reloadPage()
+{
+    if (m_inspectorController)
+        m_inspectorController->m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+}
+
 void InspectorBackend::startTimelineProfiler()
 {
     if (m_inspectorController)
@@ -148,13 +146,7 @@
         m_inspectorController->stopTimelineProfiler();
 }
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-bool InspectorBackend::debuggerEnabled() const
-{
-    if (m_inspectorController)
-        return m_inspectorController->debuggerEnabled();
-    return false;
-}
+#if ENABLE(JAVASCRIPT_DEBUGGER)
 
 void InspectorBackend::enableDebugger(bool always)
 {
@@ -168,27 +160,31 @@
         m_inspectorController->disableDebugger(always);
 }
 
-void InspectorBackend::addBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
+void InspectorBackend::setBreakpoint(const String& sourceID, unsigned lineNumber, bool enabled, const String& condition)
 {
-    intptr_t sourceIDValue = sourceID.toIntPtr();
-    JavaScriptDebugServer::shared().addBreakpoint(sourceIDValue, lineNumber, condition);
-}
-
-void InspectorBackend::updateBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
-{
-    intptr_t sourceIDValue = sourceID.toIntPtr();
-    JavaScriptDebugServer::shared().updateBreakpoint(sourceIDValue, lineNumber, condition);
+    if (m_inspectorController)
+        m_inspectorController->setBreakpoint(sourceID, lineNumber, enabled, condition);
 }
 
 void InspectorBackend::removeBreakpoint(const String& sourceID, unsigned lineNumber)
 {
-    intptr_t sourceIDValue = sourceID.toIntPtr();
-    JavaScriptDebugServer::shared().removeBreakpoint(sourceIDValue, lineNumber);
+    if (m_inspectorController)
+        m_inspectorController->removeBreakpoint(sourceID, lineNumber);
+}
+
+void InspectorBackend::activateBreakpoints()
+{
+    ScriptDebugServer::shared().setBreakpointsActivated(true);
+}
+
+void InspectorBackend::deactivateBreakpoints()
+{
+    ScriptDebugServer::shared().setBreakpointsActivated(false);
 }
 
 void InspectorBackend::pauseInDebugger()
 {
-    JavaScriptDebugServer::shared().pauseProgram();
+    ScriptDebugServer::shared().pauseProgram();
 }
 
 void InspectorBackend::resumeDebugger()
@@ -199,42 +195,29 @@
 
 void InspectorBackend::stepOverStatementInDebugger()
 {
-    JavaScriptDebugServer::shared().stepOverStatement();
+    ScriptDebugServer::shared().stepOverStatement();
 }
 
 void InspectorBackend::stepIntoStatementInDebugger()
 {
-    JavaScriptDebugServer::shared().stepIntoStatement();
+    ScriptDebugServer::shared().stepIntoStatement();
 }
 
 void InspectorBackend::stepOutOfFunctionInDebugger()
 {
-    JavaScriptDebugServer::shared().stepOutOfFunction();
-}
-
-long InspectorBackend::pauseOnExceptionsState()
-{
-    return JavaScriptDebugServer::shared().pauseOnExceptionsState();
+    ScriptDebugServer::shared().stepOutOfFunction();
 }
 
 void InspectorBackend::setPauseOnExceptionsState(long pauseState)
 {
-    JavaScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<JavaScriptDebugServer::PauseOnExceptionsState>(pauseState));
+    ScriptDebugServer::shared().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
+    if (InspectorFrontend* frontend = inspectorFrontend())
+        frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
 }
 
-JavaScriptCallFrame* InspectorBackend::currentCallFrame() const
-{
-    return JavaScriptDebugServer::shared().currentCallFrame();
-}
 #endif
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-bool InspectorBackend::profilerEnabled()
-{
-    if (m_inspectorController)
-        return m_inspectorController->profilerEnabled();
-    return false;
-}
 
 void InspectorBackend::enableProfiler(bool always)
 {
@@ -343,34 +326,77 @@
     String markup = createMarkup(node);
     Pasteboard::generalPasteboard()->writePlainText(markup);
 }
-    
+
 void InspectorBackend::removeNode(long callId, long nodeId)
 {
-    InspectorFrontend* frontend = inspectorFrontend();
-    if (!frontend)
-        return;
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->removeNode(callId, nodeId);
+}
 
-    Node* node = nodeForId(nodeId);
-    if (!node) {
-        // Use -1 to denote an error condition.
-        frontend->didRemoveNode(callId, -1);
-        return;
-    }
+void InspectorBackend::changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->changeTagName(callId, nodeId, tagName, expanded);
+}
 
-    Node* parentNode = node->parentNode();
-    if (!parentNode) {
-        frontend->didRemoveNode(callId, -1);
-        return;
-    }
+void InspectorBackend::getStyles(long callId, long nodeId, bool authorOnly)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->getStyles(callId, nodeId, authorOnly);
+}
 
-    ExceptionCode code;
-    parentNode->removeChild(node, code);
-    if (code) {
-        frontend->didRemoveNode(callId, -1);
-        return;
-    }
+void InspectorBackend::getAllStyles(long callId)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->getAllStyles(callId);
+}
 
-    frontend->didRemoveNode(callId, nodeId);
+void InspectorBackend::getInlineStyle(long callId, long nodeId)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->getInlineStyle(callId, nodeId);
+}
+
+void InspectorBackend::getComputedStyle(long callId, long nodeId)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->getComputedStyle(callId, nodeId);
+}
+
+void InspectorBackend::applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->applyStyleText(callId, styleId, styleText, propertyName);
+}
+
+void InspectorBackend::setStyleText(long callId, long styleId, const String& cssText)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->setStyleText(callId, styleId, cssText);
+}
+
+void InspectorBackend::setStyleProperty(long callId, long styleId, const String& name, const String& value)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->setStyleProperty(callId, styleId, name, value);
+}
+
+void InspectorBackend::toggleStyleEnabled(long callId, long styleId, const String& propertyName, bool disabled)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->toggleStyleEnabled(callId, styleId, propertyName, disabled);
+}
+
+void InspectorBackend::setRuleSelector(long callId, long ruleId, const String& selector, long selectedNodeId)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->setRuleSelector(callId, ruleId, selector, selectedNodeId);
+}
+
+void InspectorBackend::addRule(long callId, const String& selector, long selectedNodeId)
+{
+    if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+        domAgent->addRule(callId, selector, selectedNodeId);
 }
 
 void InspectorBackend::highlightDOMNode(long nodeId)
@@ -470,6 +496,18 @@
     return 0;
 }
 
+void InspectorBackend::addScriptToEvaluateOnLoad(const String& source)
+{
+    if (m_inspectorController)
+        m_inspectorController->addScriptToEvaluateOnLoad(source);
+}
+
+void InspectorBackend::removeAllScriptsToEvaluateOnLoad()
+{
+    if (m_inspectorController)
+        m_inspectorController->removeAllScriptsToEvaluateOnLoad();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 0df13f5..7331843 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -6,13 +6,13 @@
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     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. 
+ *     documentation and/or other materials provided with the distribution.
  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
+ *     from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -41,7 +41,6 @@
 class Database;
 class InspectorDOMAgent;
 class InspectorFrontend;
-class JavaScriptCallFrame;
 class Node;
 class Storage;
 
@@ -62,40 +61,35 @@
 
     void storeLastActivePanel(const String& panelName);
 
-    void toggleNodeSearch();
-    bool searchingForNode();
+    void enableSearchingForNode();
+    void disableSearchingForNode();
 
     void enableResourceTracking(bool always);
     void disableResourceTracking(bool always);
-    bool resourceTrackingEnabled() const;
     void getResourceContent(long callId, unsigned long identifier);
+    void reloadPage();
 
     void startTimelineProfiler();
     void stopTimelineProfiler();
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-    bool debuggerEnabled() const;
+#if ENABLE(JAVASCRIPT_DEBUGGER)
     void enableDebugger(bool always);
     void disableDebugger(bool always);
 
-    void addBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition);
-    void updateBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition);
+    void setBreakpoint(const String& sourceID, unsigned lineNumber, bool enabled, const String& condition);
     void removeBreakpoint(const String& sourceID, unsigned lineNumber);
+    void activateBreakpoints();
+    void deactivateBreakpoints();
 
     void pauseInDebugger();
     void resumeDebugger();
 
-    long pauseOnExceptionsState();
     void setPauseOnExceptionsState(long pauseState);
 
     void stepOverStatementInDebugger();
     void stepIntoStatementInDebugger();
     void stepOutOfFunctionInDebugger();
 
-    JavaScriptCallFrame* currentCallFrame() const;
-#endif
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    bool profilerEnabled();
     void enableProfiler(bool always);
     void disableProfiler(bool always);
 
@@ -108,6 +102,9 @@
 
     void setInjectedScriptSource(const String& source);
     void dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async);
+    void addScriptToEvaluateOnLoad(const String& source);
+    void removeAllScriptsToEvaluateOnLoad();
+
     void getChildNodes(long callId, long nodeId);
     void setAttribute(long callId, long elementId, const String& name, const String& value);
     void removeAttribute(long callId, long elementId, const String& name);
@@ -115,6 +112,19 @@
     void getEventListenersForNode(long callId, long nodeId);
     void copyNode(long nodeId);
     void removeNode(long callId, long nodeId);
+    void changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded);
+
+    void getStyles(long callId, long nodeId, bool authOnly);
+    void getAllStyles(long callId);
+    void getInlineStyle(long callId, long nodeId);
+    void getComputedStyle(long callId, long nodeId);
+    void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
+    void setStyleText(long callId, long styleId, const String& cssText);
+    void setStyleProperty(long callId, long styleId, const String& name, const String& value);
+    void toggleStyleEnabled(long callId, long styleId, const String& propertyName, bool disabled);
+    void setRuleSelector(long callId, long ruleId, const String& selector, long selectedNodeId);
+    void addRule(long callId, const String& selector, long selectedNodeId);
+
     void highlightDOMNode(long nodeId);
     void hideDOMNodeHighlight();
 
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index 9faae76..cf0fe01 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -36,25 +36,25 @@
 
         void saveFrontendSettings(in DOMString settings);
 
-        void toggleNodeSearch();
-        boolean searchingForNode();
+        void enableSearchingForNode();
+        void disableSearchingForNode();
 
-        boolean resourceTrackingEnabled();
         void enableResourceTracking(in boolean always);
         void disableResourceTracking(in boolean always);
         void getResourceContent(in long callId, in unsigned long identifier);
+        void reloadPage();
 
         void startTimelineProfiler();
         void stopTimelineProfiler();
 
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
-        boolean debuggerEnabled();
+#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         void enableDebugger(in boolean always);
         void disableDebugger(in boolean always);
 
-        void addBreakpoint(in DOMString sourceID, in unsigned long lineNumber, in DOMString condition);
-        void updateBreakpoint(in DOMString sourceID, in unsigned long lineNumber, in DOMString condition);
+        void setBreakpoint(in DOMString sourceID, in unsigned long lineNumber, in boolean enabled, in DOMString condition);
         void removeBreakpoint(in DOMString sourceID, in unsigned long lineNumber);
+        void activateBreakpoints();
+        void deactivateBreakpoints();
 
         void pauseInDebugger();
         void resumeDebugger();
@@ -63,11 +63,8 @@
         void stepIntoStatementInDebugger();
         void stepOutOfFunctionInDebugger();
 
-        long pauseOnExceptionsState();
         void setPauseOnExceptionsState(in long pauseOnExceptionsState);
-#endif
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
-        boolean profilerEnabled();
+
         void enableProfiler(in boolean always);
         void disableProfiler(in boolean always);
 
@@ -80,6 +77,9 @@
         void setInjectedScriptSource(in DOMString scriptSource);
         void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in DOMString methodName, in DOMString arguments, in boolean async);
 
+        void addScriptToEvaluateOnLoad(in DOMString scriptSource);
+        void removeAllScriptsToEvaluateOnLoad();
+
         void getChildNodes(in long callId, in long nodeId);
         void setAttribute(in long callId, in long elementId, in DOMString name, in DOMString value);
         void removeAttribute(in long callId, in long elementId, in DOMString name);
@@ -87,9 +87,21 @@
         void getEventListenersForNode(in long callId, in long nodeId);
         void copyNode(in long nodeId);
         void removeNode(in long callId, in long nodeId);
+        void changeTagName(in long callId, in long nodeId, in DOMString newTagName, in boolean expanded);
         void highlightDOMNode(in long nodeId);
         void hideDOMNodeHighlight();
 
+        void getStyles(in long callId, in long nodeId, in boolean authOnly);
+        void getAllStyles(in long callId);
+        void getInlineStyle(in long callId, in long nodeId);
+        void getComputedStyle(in long callId, in long nodeId);
+        void applyStyleText(in long callId, in long styleId, in DOMString styleText, in DOMString propertyName);
+        void setStyleText(in long callId, in long styleId, in DOMString styleText);
+        void setStyleProperty(in long callId, in long styleId, in DOMString name, in DOMString value);
+        void toggleStyleEnabled(in long callId, in long styleId, in DOMString propertyName, in boolean disabled);
+        void setRuleSelector(in long callId, in long ruleId, in DOMString selector, in long selectedNodeId);
+        void addRule(in long callId, in DOMString selector, in long selectedNodeId);
+
         void getCookies(in long callId);
         void deleteCookie(in DOMString cookieName, in DOMString domain);
 
diff --git a/WebCore/inspector/InspectorClient.h b/WebCore/inspector/InspectorClient.h
index e448cd2..841c15e 100644
--- a/WebCore/inspector/InspectorClient.h
+++ b/WebCore/inspector/InspectorClient.h
@@ -30,6 +30,7 @@
 
 namespace WebCore {
 
+class InspectorController;
 class Node;
 class Page;
 class String;
@@ -40,29 +41,13 @@
 
     virtual void inspectorDestroyed() = 0;
 
-    virtual Page* createPage() = 0;
-
-    virtual String localizedStringsURL() = 0;
-
-    virtual String hiddenPanels() = 0;
-
-    virtual void showWindow() = 0;
-    virtual void closeWindow() = 0;
-
-    virtual void attachWindow() = 0;
-    virtual void detachWindow() = 0;
-
-    virtual void setAttachedWindowHeight(unsigned height) = 0;
+    virtual void openInspectorFrontend(InspectorController*) = 0;
 
     virtual void highlight(Node*) = 0;
     virtual void hideHighlight() = 0;
 
-    virtual void inspectedURLChanged(const String& newURL) = 0;
-
     virtual void populateSetting(const String& key, String* value) = 0;
     virtual void storeSetting(const String& key, const String& value) = 0;
-
-    virtual void inspectorWindowObjectCleared() = 0;
 };
 
 } // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index b487ad8..c54ee5b 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,6 @@
 
 #if ENABLE(INSPECTOR)
 
-#include "CString.h"
 #include "CachedResource.h"
 #include "Chrome.h"
 #include "Console.h"
@@ -57,12 +56,12 @@
 #include "InjectedScriptHost.h"
 #include "InspectorBackend.h"
 #include "InspectorClient.h"
-#include "InspectorDOMAgent.h"
+#include "InspectorFrontendClient.h"
 #include "InspectorDOMStorageResource.h"
 #include "InspectorDatabaseResource.h"
 #include "InspectorFrontend.h"
-#include "InspectorFrontendHost.h"
 #include "InspectorResource.h"
+#include "InspectorWorkerResource.h"
 #include "InspectorTimelineAgent.h"
 #include "Page.h"
 #include "ProgressTracker.h"
@@ -70,18 +69,20 @@
 #include "RenderInline.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
+#include "ScriptBreakpoint.h"
 #include "ScriptCallStack.h"
-#include "ScriptDebugServer.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
 #include "ScriptProfile.h"
 #include "ScriptProfiler.h"
+#include "ScriptSourceCode.h"
 #include "ScriptString.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
 #include "TextEncoding.h"
 #include "TextIterator.h"
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/RefCounted.h>
@@ -96,17 +97,17 @@
 #include "StorageArea.h"
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include "JSJavaScriptCallFrame.h"
-#include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
-#include "JavaScriptProfile.h"
-
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugServer.h"
+#if USE(JSC)
 #include <runtime/JSLock.h>
 #include <runtime/UString.h>
-
-using namespace JSC;
+#include "JSScriptProfile.h"
+#else
+#include "V8ScriptProfile.h"
 #endif
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -118,7 +119,18 @@
 static const char* const profilerEnabledSettingName = "profilerEnabled";
 static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
 static const char* const lastActivePanelSettingName = "lastActivePanel";
-const char* const InspectorController::FrontendSettingsSettingName = "frontendSettings";
+
+const String& InspectorController::frontendSettingsSettingName()
+{
+    DEFINE_STATIC_LOCAL(String, settingName, ("frontendSettings"));
+    return settingName;
+}
+
+const String& InspectorController::inspectorStartsAttachedSettingName()
+{
+    DEFINE_STATIC_LOCAL(String, settingName, ("inspectorStartsAttached"));
+    return settingName;
+}
 
 static const unsigned defaultAttachedHeight = 300;
 static const float minimumAttachedHeight = 250.0f;
@@ -131,10 +143,8 @@
 InspectorController::InspectorController(Page* page, InspectorClient* client)
     : m_inspectedPage(page)
     , m_client(client)
-    , m_page(0)
+    , m_openingFrontend(false)
     , m_expiredConsoleMessageCount(0)
-    , m_frontendScriptState(0)
-    , m_windowVisible(false)
     , m_showAfterVisible(CurrentPanel)
     , m_groupLevel(0)
     , m_searchingForNode(false)
@@ -142,9 +152,8 @@
     , m_resourceTrackingEnabled(false)
     , m_resourceTrackingSettingsLoaded(false)
     , m_inspectorBackend(InspectorBackend::create(this))
-    , m_inspectorFrontendHost(InspectorFrontendHost::create(this, client))
     , m_injectedScriptHost(InjectedScriptHost::create(this))
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
     , m_debuggerEnabled(false)
     , m_attachDebuggerWhenShown(false)
 #endif
@@ -165,9 +174,7 @@
 {
     // These should have been cleared in inspectedPageDestroyed().
     ASSERT(!m_client);
-    ASSERT(!m_frontendScriptState);
     ASSERT(!m_inspectedPage);
-    ASSERT(!m_page || (m_page && !m_page->parentInspectorController()));
 
     deleteAllValues(m_frameResources);
     deleteAllValues(m_consoleMessages);
@@ -178,18 +185,14 @@
     releaseDOMAgent();
 
     m_inspectorBackend->disconnectController();
-    m_inspectorFrontendHost->disconnectController();
     m_injectedScriptHost->disconnectController();
 }
 
 void InspectorController::inspectedPageDestroyed()
 {
-    close();
+    if (m_frontend)
+        m_frontend->inspectedPageDestroyed();
 
-    if (m_frontendScriptState) {
-        ScriptGlobalObject::remove(m_frontendScriptState, "InspectorBackend");
-        ScriptGlobalObject::remove(m_frontendScriptState, "InspectorFrontendHost");
-    }
     ASSERT(m_inspectedPage);
     m_inspectedPage = 0;
 
@@ -222,20 +225,9 @@
     m_client->storeSetting(key, value);
 }
 
-// Trying to inspect something in a frame with JavaScript disabled would later lead to
-// crashes trying to create JavaScript wrappers. Some day we could fix this issue, but
-// for now prevent crashes here by never targeting a node in such a frame.
-static bool canPassNodeToJavaScript(Node* node)
-{
-    if (!node)
-        return false;
-    Frame* frame = node->document()->frame();
-    return frame && frame->script()->canExecuteScripts();
-}
-
 void InspectorController::inspect(Node* node)
 {
-    if (!canPassNodeToJavaScript(node) || !enabled())
+    if (!enabled())
         return;
 
     show();
@@ -284,48 +276,7 @@
 
 bool InspectorController::windowVisible()
 {
-    return m_windowVisible;
-}
-
-void InspectorController::setWindowVisible(bool visible, bool attached)
-{
-    if (visible == m_windowVisible || !m_frontend)
-        return;
-
-    m_windowVisible = visible;
-
-    if (m_windowVisible) {
-        setAttachedWindow(attached);
-        populateScriptObjects();
-
-        if (m_showAfterVisible == CurrentPanel) {
-          String lastActivePanelSetting = setting(lastActivePanelSettingName);
-          m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting);
-        }
-
-        if (m_nodeToFocus)
-            focusNode();
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-        if (m_attachDebuggerWhenShown)
-            enableDebugger();
-#endif
-        showPanel(m_showAfterVisible);
-    } else {
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-        // If the window is being closed with the debugger enabled,
-        // remember this state to re-enable debugger on the next window
-        // opening.
-        bool debuggerWasEnabled = m_debuggerEnabled;
-        disableDebugger();
-        if (debuggerWasEnabled)
-            m_attachDebuggerWhenShown = true;
-#endif
-        if (m_searchingForNode)
-            toggleSearchForNodeInPage();
-        resetScriptObjects();
-        stopTimelineProfiler();
-    }
-    m_showAfterVisible = CurrentPanel;
+    return m_frontend;
 }
 
 void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack)
@@ -352,16 +303,16 @@
     if (m_previousMessage && m_previousMessage->isEqual(scriptState, consoleMessage)) {
         m_previousMessage->incrementCount();
         delete consoleMessage;
-        if (windowVisible())
+        if (m_frontend)
             m_previousMessage->updateRepeatCountInConsole(m_frontend.get());
     } else {
         m_previousMessage = consoleMessage;
         m_consoleMessages.append(consoleMessage);
-        if (windowVisible())
-            m_previousMessage->addToConsole(m_frontend.get());
+        if (m_frontend)
+            m_previousMessage->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
     }
 
-    if (!windowVisible() && m_consoleMessages.size() >= maximumConsoleMessages) {
+    if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) {
         m_expiredConsoleMessageCount += expireConsoleMessagesStep;
         for (size_t i = 0; i < expireConsoleMessagesStep; ++i)
             delete m_consoleMessages[i];
@@ -406,127 +357,79 @@
         timelineAgent()->didMarkTimeline(message);
 }
 
-static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight)
-{
-    return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
-}
-
-void InspectorController::attachWindow()
-{
-    if (!enabled())
-        return;
-
-    unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight();
-
-    m_client->attachWindow();
-
-    String attachedHeight = setting(inspectorAttachedHeightName);
-    bool success = true;
-    int height = attachedHeight.toInt(&success);
-    unsigned preferredHeight = success ? height : defaultAttachedHeight;
-
-    // We need to constrain the window height here in case the user has resized the inspected page's window so that
-    // the user's preferred height would be too big to display.
-    m_client->setAttachedWindowHeight(constrainedAttachedWindowHeight(preferredHeight, inspectedPageHeight));
-}
-
-void InspectorController::detachWindow()
-{
-    if (!enabled())
-        return;
-    m_client->detachWindow();
-}
-
-void InspectorController::setAttachedWindow(bool attached)
-{
-    if (!enabled() || !m_frontend)
-        return;
-
-    m_frontend->setAttachedWindow(attached);
-}
-
-void InspectorController::setAttachedWindowHeight(unsigned height)
-{
-    if (!enabled())
-        return;
-    
-    unsigned totalHeight = m_page->mainFrame()->view()->visibleHeight() + m_inspectedPage->mainFrame()->view()->visibleHeight();
-    unsigned attachedHeight = constrainedAttachedWindowHeight(height, totalHeight);
-    
-    setSetting(inspectorAttachedHeightName, String::number(attachedHeight));
-    
-    m_client->setAttachedWindowHeight(attachedHeight);
-}
-
 void InspectorController::storeLastActivePanel(const String& panelName)
 {
     setSetting(lastActivePanelSettingName, panelName);
 }
 
-void InspectorController::toggleSearchForNodeInPage()
-{
-    if (!enabled())
-        return;
-
-    m_searchingForNode = !m_searchingForNode;
-    if (!m_searchingForNode)
-        hideHighlight();
-}
-
 void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
 {
     if (!enabled() || !m_searchingForNode)
         return;
 
     Node* node = result.innerNode();
+    while (node && node->nodeType() == Node::TEXT_NODE)
+        node = node->parentNode();
     if (node)
         highlight(node);
 }
 
-void InspectorController::handleMousePressOnNode(Node* node)
+void InspectorController::handleMousePress()
 {
     if (!enabled())
         return;
 
     ASSERT(m_searchingForNode);
-    ASSERT(node);
-    if (!node)
+    if (!m_highlightedNode)
         return;
 
-    // inspect() will implicitly call ElementsPanel's focusedNodeChanged() and the hover feedback will be stopped there.
-    inspect(node);
+    RefPtr<Node> node = m_highlightedNode;
+    setSearchingForNode(false);
+    inspect(node.get());
+}
+
+void InspectorController::setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client)
+{
+    ASSERT(!m_inspectorFrontendClient);
+    m_inspectorFrontendClient = client;
 }
 
 void InspectorController::inspectedWindowScriptObjectCleared(Frame* frame)
 {
+    // If the page is supposed to serve as InspectorFrontend notify inspetor frontend
+    // client that it's cleared so that the client can expose inspector bindings.
+    if (m_inspectorFrontendClient && frame == m_inspectedPage->mainFrame())
+        m_inspectorFrontendClient->windowObjectCleared();
+
     if (!enabled() || !m_frontend || frame != m_inspectedPage->mainFrame())
         return;
     m_injectedScriptHost->discardInjectedScripts();
 }
 
-void InspectorController::windowScriptObjectAvailable()
+void InspectorController::setSearchingForNode(bool enabled)
 {
-    if (!m_page || !enabled())
+    if (m_searchingForNode == enabled)
         return;
-
-    // Grant the inspector the ability to script the inspected page.
-    m_page->mainFrame()->document()->securityOrigin()->grantUniversalAccess();
-    m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_page);
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorBackend.get());
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_inspectorFrontendHost.get());
+    m_searchingForNode = enabled;
+    if (!m_searchingForNode)
+        hideHighlight();
+    if (m_frontend) {
+        if (enabled)
+            m_frontend->searchingForNodeWasEnabled();
+        else
+            m_frontend->searchingForNodeWasDisabled();
+    }
 }
 
-void InspectorController::scriptObjectReady()
+void InspectorController::setFrontend(PassOwnPtr<InspectorFrontend> frontend)
 {
-    ASSERT(m_frontendScriptState);
-    if (!m_frontendScriptState)
-        return;
-
-    ScriptObject webInspectorObj;
-    if (!ScriptGlobalObject::get(m_frontendScriptState, "WebInspector", webInspectorObj))
-        return;
-    setFrontendProxyObject(m_frontendScriptState, webInspectorObj);
-
+    ASSERT(frontend);
+    m_openingFrontend = false;
+    m_frontend = frontend;
+    releaseDOMAgent();
+    m_domAgent = InspectorDOMAgent::create(m_frontend.get());
+    if (m_timelineAgent)
+        m_timelineAgent->resetFrontendProxyObject(m_frontend.get());
 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
     String debuggerEnabled = setting(debuggerEnabledSettingName);
     if (debuggerEnabled == "true")
@@ -536,41 +439,39 @@
         enableProfiler();
 #endif
 
-    // Make sure our window is visible now that the page loaded
-    showWindow();
+    // Initialize Web Inspector title.
+    m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string());
 
-    m_client->inspectorWindowObjectCleared();
-}
-
-void InspectorController::setFrontendProxyObject(ScriptState* scriptState, ScriptObject webInspectorObj, ScriptObject)
-{
-    m_frontendScriptState = scriptState;
-    m_frontend.set(new InspectorFrontend(this, webInspectorObj));
-    releaseDOMAgent();
-    m_domAgent = InspectorDOMAgent::create(m_frontend.get());
-    if (m_timelineAgent)
-        m_timelineAgent->resetFrontendProxyObject(m_frontend.get());
+    populateScriptObjects();
+    
+    if (m_showAfterVisible == CurrentPanel) {
+        String lastActivePanelSetting = setting(lastActivePanelSettingName);
+        m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting);
+    }
+    
+    if (m_nodeToFocus)
+        focusNode();
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (m_attachDebuggerWhenShown)
+        enableDebugger();
+#endif
+    showPanel(m_showAfterVisible);
 }
 
 void InspectorController::show()
 {
     if (!enabled())
         return;
-    
-    if (!m_page) {
-        if (m_frontend)
-            return; // We are using custom frontend - no need to create page.
 
-        m_page = m_client->createPage();
-        if (!m_page)
-            return;
-        m_page->setParentInspectorController(this);
-
-        // showWindow() will be called after the page loads in scriptObjectReady()
+    if (m_openingFrontend)
         return;
+    
+    if (m_frontend)
+        m_frontend->bringToFront();
+    else {
+        m_openingFrontend = true;
+        m_client->openInspectorFrontend(this);
     }
-
-    showWindow();
 }
 
 void InspectorController::showPanel(SpecialPanels panel)
@@ -593,49 +494,40 @@
 
 void InspectorController::close()
 {
-    if (!enabled())
+    if (!m_frontend)
         return;
+    m_frontend->close();
+}
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-    stopUserInitiatedProfiling();
+void InspectorController::disconnectFrontend()
+{
+    if (!m_frontend)
+        return;
+    m_frontend.clear();
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    // If the window is being closed with the debugger enabled,
+    // remember this state to re-enable debugger on the next window
+    // opening.
+    bool debuggerWasEnabled = m_debuggerEnabled;
     disableDebugger();
+    if (debuggerWasEnabled)
+        m_attachDebuggerWhenShown = true;
 #endif
-    closeWindow();
+    setSearchingForNode(false);
+    unbindAllResources();
+    stopTimelineProfiler();
+
+    m_showAfterVisible = CurrentPanel;
+
+    hideHighlight();
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    stopUserInitiatedProfiling();
+#endif
 
     releaseDOMAgent();
-    m_frontend.set(0);
-    m_timelineAgent = 0;
-    m_frontendScriptState = 0;
-    if (m_page) {
-        if (!m_page->mainFrame() || !m_page->mainFrame()->loader() || !m_page->mainFrame()->loader()->isLoading()) {
-            m_page->setParentInspectorController(0);
-            m_page = 0;
-        }
-    }
-}
-
-void InspectorController::showWindow()
-{
-    ASSERT(enabled());
-
-    unsigned inspectedPageHeight = m_inspectedPage->mainFrame()->view()->visibleHeight();
-
-    m_client->showWindow();
-
-    String attachedHeight = setting(inspectorAttachedHeightName);
-    bool success = true;
-    int height = attachedHeight.toInt(&success);
-    unsigned preferredHeight = success ? height : defaultAttachedHeight;
-
-    // This call might not go through (if the window starts out detached), but if the window is initially created attached,
-    // InspectorController::attachWindow is never called, so we need to make sure to set the attachedWindowHeight.
-    // FIXME: Clean up code so we only have to call setAttachedWindowHeight in InspectorController::attachWindow
-    m_client->setAttachedWindowHeight(constrainedAttachedWindowHeight(preferredHeight, inspectedPageHeight));
-}
-
-void InspectorController::closeWindow()
-{
-    m_client->closeWindow();
+    m_timelineAgent.clear();
 }
 
 void InspectorController::releaseDOMAgent()
@@ -644,7 +536,7 @@
     // no references to the DOM agent from the DOM tree.
     if (m_domAgent)
         m_domAgent->reset();
-    m_domAgent = 0;
+    m_domAgent.clear();
 }
 
 void InspectorController::populateScriptObjects()
@@ -653,7 +545,20 @@
     if (!m_frontend)
         return;
 
-    m_frontend->populateFrontendSettings(setting(FrontendSettingsSettingName));
+    m_frontend->populateFrontendSettings(setting(frontendSettingsSettingName()));
+
+    if (m_resourceTrackingEnabled)
+        m_frontend->resourceTrackingWasEnabled();
+
+    if (m_searchingForNode)
+        m_frontend->searchingForNodeWasEnabled();
+    else
+        m_frontend->searchingForNodeWasDisabled();
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (m_profilerEnabled)
+        m_frontend->profilerWasEnabled();
+#endif
 
     ResourcesMap::iterator resourcesEnd = m_resources.end();
     for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
@@ -665,8 +570,12 @@
         m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
     unsigned messageCount = m_consoleMessages.size();
     for (unsigned i = 0; i < messageCount; ++i)
-        m_consoleMessages[i]->addToConsole(m_frontend.get());
+        m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
 
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (m_debuggerEnabled)
+        m_frontend->updatePauseOnExceptionsState(ScriptDebugServer::shared().pauseOnExceptionsState());
+#endif
 #if ENABLE(DATABASE)
     DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
     for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -677,6 +586,11 @@
     for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
         it->second->bind(m_frontend.get());
 #endif
+#if ENABLE(WORKERS)
+    WorkersMap::iterator workersEnd = m_workers.end();
+    for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it)
+        m_frontend->didCreateWorker(*it->second);
+#endif
 
     m_frontend->populateInterface();
 
@@ -686,15 +600,12 @@
     m_pendingEvaluateTestCommands.clear();
 }
 
-void InspectorController::resetScriptObjects()
+void InspectorController::unbindAllResources()
 {
-    if (!m_frontend)
-        return;
-
-    ResourcesMap::iterator resourcesEnd = m_resources.end();
-    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
-        it->second->releaseScriptObject(m_frontend.get(), false);
-
+    ResourcesMap::iterator resourcesEnd = m_resources.end(); 
+    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) 
+        it->second->releaseScriptObject(0); 
+    
 #if ENABLE(DATABASE)
     DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
     for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -705,12 +616,8 @@
     for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it)
         it->second->unbind();
 #endif
-
     if (m_timelineAgent)
         m_timelineAgent->reset();
-
-    m_frontend->reset();
-    m_domAgent->reset();
 }
 
 void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
@@ -726,8 +633,8 @@
 
         if (!loaderToKeep || !resource->isSameLoader(loaderToKeep)) {
             removeResource(resource);
-            if (windowVisible())
-                resource->releaseScriptObject(m_frontend.get(), true);
+            if (m_frontend)
+                resource->releaseScriptObject(m_frontend.get());
         }
     }
 }
@@ -740,13 +647,17 @@
     ASSERT(m_inspectedPage);
 
     if (loader->frame() == m_inspectedPage->mainFrame()) {
-        m_client->inspectedURLChanged(loader->url().string());
+        if (m_frontend)
+            m_frontend->inspectedURLChanged(loader->url().string());
 
         m_injectedScriptHost->discardInjectedScripts();
         clearConsoleMessages();
 
         m_times.clear();
         m_counts.clear();
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+        m_sourceIDToURL.clear();
+#endif
 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
         m_profiles.clear();
         m_currentUserInitiatedProfileNumber = 1;
@@ -754,8 +665,13 @@
 #endif
         // resetScriptObjects should be called before database and DOM storage
         // resources are cleared so that it has a chance to unbind them.
-        resetScriptObjects();
-
+        if (m_frontend) {
+            m_frontend->reset();
+            m_domAgent->reset();
+        }
+#if ENABLE(WORKERS)
+        m_workers.clear();
+#endif
 #if ENABLE(DATABASE)
         m_databaseResources.clear();
 #endif
@@ -769,8 +685,7 @@
                 // We don't add the main resource until its load is committed. This is
                 // needed to keep the load for a user-entered URL from showing up in the
                 // list of resources for the page they are navigating away from.
-                if (windowVisible())
-                    m_mainResource->updateScriptObject(m_frontend.get());
+                m_mainResource->updateScriptObject(m_frontend.get());
             } else {
                 // Pages loaded from the page cache are committed before
                 // m_mainResource is the right resource for this load, so we
@@ -778,16 +693,22 @@
                 // identifierForInitialRequest.
                 m_mainResource = 0;
             }
-            if (windowVisible()) {
-                m_frontend->didCommitLoad();
-                m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
-            }
+            m_frontend->didCommitLoad();
+            m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
         }
     }
 
     for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame()))
         if (ResourcesMap* resourceMap = m_frameResources.get(frame))
             pruneResources(resourceMap, loader);
+
+    if (m_scriptsToEvaluateOnLoad.size()) {
+        ScriptState* scriptState = mainWorldScriptState(loader->frame());
+        for (Vector<String>::iterator it = m_scriptsToEvaluateOnLoad.begin();
+             it != m_scriptsToEvaluateOnLoad.end(); ++it) {
+            m_injectedScriptHost->injectScript(*it, scriptState);
+        }
+    }
 }
 
 void InspectorController::frameDetachedFromParent(Frame* frame)
@@ -874,7 +795,7 @@
 
     addResource(resource.get());
 
-    if (windowVisible())
+    if (m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -898,7 +819,7 @@
 
     addResource(resource.get());
 
-    if (windowVisible() && loader->frameLoader()->isLoadingFromCachedPage() && resource == m_mainResource)
+    if (m_frontend && loader->frameLoader()->isLoadingFromCachedPage() && resource == m_mainResource)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -909,7 +830,9 @@
 
     if (m_mainResource) {
         m_mainResource->markDOMContentEventTime();
-        if (windowVisible())
+        if (m_timelineAgent)
+            m_timelineAgent->didMarkDOMContentEvent();
+        if (m_frontend)
             m_mainResource->updateScriptObject(m_frontend.get());
     }
 }
@@ -921,7 +844,9 @@
 
     if (m_mainResource) {
         m_mainResource->markLoadEventTime();
-        if (windowVisible())
+        if (m_timelineAgent)
+            m_timelineAgent->didMarkLoadEvent();
+        if (m_frontend)
             m_mainResource->updateScriptObject(m_frontend.get());
     }
 }
@@ -961,15 +886,12 @@
     resource->startTiming();
     resource->updateRequest(request);
 
-    if (resource != m_mainResource && windowVisible())
+    if (resource != m_mainResource && m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
 void InspectorController::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
 {
-    if (m_timelineAgent)
-        m_timelineAgent->didReceiveResourceResponse(identifier, response);
-
     RefPtr<InspectorResource> resource = getTrackedResource(identifier);
     if (!resource)
         return;
@@ -977,7 +899,7 @@
     resource->updateResponse(response);
     resource->markResponseReceivedTime();
 
-    if (resource != m_mainResource && windowVisible())
+    if (resource != m_mainResource && m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -989,7 +911,7 @@
 
     resource->addLength(lengthReceived);
 
-    if (resource != m_mainResource && windowVisible())
+    if (resource != m_mainResource && m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -1004,7 +926,8 @@
 
     resource->endTiming();
 
-    if (resource != m_mainResource && windowVisible())
+    // No need to mute this event for main resource since it happens after did commit load.
+    if (m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -1020,7 +943,8 @@
     resource->markFailed();
     resource->endTiming();
 
-    if (resource != m_mainResource && windowVisible())
+    // No need to mute this event for main resource since it happens after did commit load.
+    if (m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -1033,9 +957,9 @@
     if (!resource)
         return;
 
-    resource->setXMLHttpResponseText(sourceString);
+    resource->setOverrideContent(sourceString, InspectorResource::XHR);
 
-    if (windowVisible())
+    if (m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -1048,11 +972,9 @@
     if (!resource)
         return;
     
-    // FIXME: imported script and XHR response are currently viewed as the same
-    // thing by the Inspector. They should be made into distinct types.
-    resource->setXMLHttpResponseText(ScriptString(sourceString));
+    resource->setOverrideContent(ScriptString(sourceString), InspectorResource::Script);
 
-    if (windowVisible())
+    if (m_frontend)
         resource->updateScriptObject(m_frontend.get());
 }
 
@@ -1073,7 +995,7 @@
         m_frontend->resourceTrackingWasEnabled();
 
     if (reload)
-        m_inspectedPage->mainFrame()->loader()->reload();
+        m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
 }
 
 void InspectorController::disableResourceTracking(bool always)
@@ -1127,6 +1049,71 @@
         m_frontend->timelineProfilerWasStopped();
 }
 
+#if ENABLE(WORKERS)
+class PostWorkerNotificationToFrontendTask : public ScriptExecutionContext::Task {
+public:
+    static PassOwnPtr<PostWorkerNotificationToFrontendTask> create(PassRefPtr<InspectorWorkerResource> worker, InspectorController::WorkerAction action)
+    {
+        return new PostWorkerNotificationToFrontendTask(worker, action);
+    }
+
+private:
+    PostWorkerNotificationToFrontendTask(PassRefPtr<InspectorWorkerResource> worker, InspectorController::WorkerAction action)
+        : m_worker(worker)
+        , m_action(action)
+    {
+    }
+
+    virtual void performTask(ScriptExecutionContext* scriptContext)
+    {
+        if (InspectorController* inspector = scriptContext->inspectorController())
+            inspector->postWorkerNotificationToFrontend(*m_worker, m_action);
+    }
+
+private:
+    RefPtr<InspectorWorkerResource> m_worker;
+    InspectorController::WorkerAction m_action;
+};
+
+void InspectorController::postWorkerNotificationToFrontend(const InspectorWorkerResource& worker, InspectorController::WorkerAction action)
+{
+    if (!m_frontend)
+        return;
+    switch (action) {
+    case InspectorController::WorkerCreated:
+        m_frontend->didCreateWorker(worker);
+        break;
+    case InspectorController::WorkerDestroyed:
+        m_frontend->didDestroyWorker(worker);
+        break;
+    }
+}
+
+void InspectorController::didCreateWorker(intptr_t id, const String& url, bool isSharedWorker)
+{
+    if (!enabled())
+        return;
+
+    RefPtr<InspectorWorkerResource> workerResource(InspectorWorkerResource::create(id, url, isSharedWorker));
+    m_workers.set(id, workerResource);
+    if (m_inspectedPage && m_frontend)
+        m_inspectedPage->mainFrame()->document()->postTask(PostWorkerNotificationToFrontendTask::create(workerResource, InspectorController::WorkerCreated));
+}
+
+void InspectorController::didDestroyWorker(intptr_t id)
+{
+    if (!enabled())
+        return;
+
+    WorkersMap::iterator workerResource = m_workers.find(id);
+    if (workerResource == m_workers.end())
+        return;
+    if (m_inspectedPage && m_frontend)
+        m_inspectedPage->mainFrame()->document()->postTask(PostWorkerNotificationToFrontendTask::create(workerResource->second, InspectorController::WorkerDestroyed));
+    m_workers.remove(workerResource);
+}
+#endif // ENABLE(WORKERS)
+
 #if ENABLE(DATABASE)
 void InspectorController::selectDatabase(Database* database)
 {
@@ -1141,7 +1128,7 @@
     }
 }
 
-Database* InspectorController::databaseForId(int databaseId)
+Database* InspectorController::databaseForId(long databaseId)
 {
     DatabaseResourcesMap::iterator it = m_databaseResources.find(databaseId);
     if (it == m_databaseResources.end())
@@ -1159,7 +1146,7 @@
     m_databaseResources.set(resource->id(), resource);
 
     // Resources are only bound while visible.
-    if (windowVisible())
+    if (m_frontend)
         resource->bind(m_frontend.get());
 }
 #endif
@@ -1252,7 +1239,7 @@
     m_domStorageResources.set(resource->id(), resource);
 
     // Resources are only bound while visible.
-    if (windowVisible())
+    if (m_frontend)
         resource->bind(m_frontend.get());
 }
 
@@ -1263,8 +1250,9 @@
         return;
 
     Frame* frame = storage->frame();
-    bool isLocalStorage = (frame->domWindow()->localStorage() == storage);
-    int storageResourceId = 0;
+    ExceptionCode ec = 0;
+    bool isLocalStorage = (frame->domWindow()->localStorage(ec) == storage && !ec);
+    long storageResourceId = 0;
     DOMStorageResourcesMap::iterator domStorageEnd = m_domStorageResources.end();
     for (DOMStorageResourcesMap::iterator it = m_domStorageResources.begin(); it != domStorageEnd; ++it) {
         if (it->second->isSameHostAndType(frame, isLocalStorage)) {
@@ -1276,7 +1264,7 @@
         m_frontend->selectDOMStorage(storageResourceId);
 }
 
-void InspectorController::getDOMStorageEntries(int callId, int storageId)
+void InspectorController::getDOMStorageEntries(long callId, long storageId)
 {
     if (!m_frontend)
         return;
@@ -1327,7 +1315,7 @@
     m_frontend->didRemoveDOMStorageItem(callId, success);
 }
 
-InspectorDOMStorageResource* InspectorController::getDOMStorageResourceForId(int storageId)
+InspectorDOMStorageResource* InspectorController::getDOMStorageResourceForId(long storageId)
 {
     DOMStorageResourcesMap::iterator it = m_domStorageResources.find(storageId);
     if (it == m_domStorageResources.end())
@@ -1336,16 +1324,6 @@
 }
 #endif
 
-void InspectorController::moveWindowBy(float x, float y) const
-{
-    if (!m_page || !enabled())
-        return;
-
-    FloatRect frameRect = m_page->chrome()->windowRect();
-    frameRect.move(x, y);
-    m_page->chrome()->setWindowRect(frameRect);
-}
-
 #if ENABLE(JAVASCRIPT_DEBUGGER)
 void InspectorController::addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL)
 {
@@ -1357,7 +1335,7 @@
 
     if (m_frontend) {
 #if USE(JSC)
-        JSLock lock(SilenceAssertionsOnly);
+        JSC::JSLock lock(JSC::SilenceAssertionsOnly);
 #endif
         m_frontend->addProfileHeader(createProfileHeader(*profile));
     }
@@ -1369,7 +1347,12 @@
 {
     RefPtr<ScriptProfile> profile = prpProfile;
 
-    String message = String::format("Profile \"webkit-profile://%s/%s#%d\" finished.", CPUProfileType, encodeWithURLEscapeSequences(profile->title()).utf8().data(), profile->uid());
+#if USE(JSC)
+    String title = ustringToString(profile->title());
+#else
+    String title = profile->title();
+#endif
+    String message = String::format("Profile \"webkit-profile://%s/%s#%d\" finished.", CPUProfileType, encodeWithURLEscapeSequences(title).utf8().data(), profile->uid());
     addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL);
 }
 
@@ -1396,16 +1379,24 @@
     if (!m_frontend)
         return;
     ProfilesMap::iterator it = m_profiles.find(uid);
-#if USE(JSC)
     if (it != m_profiles.end())
-        m_frontend->didGetProfile(callId, toJS(m_frontendScriptState, it->second.get()));
+#if USE(JSC)
+        m_frontend->didGetProfile(callId, toJS(m_frontend->scriptState(), it->second.get()));
+#else
+        m_frontend->didGetProfile(callId, toV8(it->second.get()));
 #endif
 }
 
 ScriptObject InspectorController::createProfileHeader(const ScriptProfile& profile)
 {
+#if USE(JSC)
+    String title = ustringToString(profile.title());
+#else
+    String title = profile.title();
+#endif
+
     ScriptObject header = m_frontend->newScriptObject();
-    header.set("title", profile.title());
+    header.set("title", title);
     header.set("uid", profile.uid());
     header.set("typeId", String(CPUProfileType));
     return header;
@@ -1431,7 +1422,7 @@
 
     if (!profilerEnabled()) {
         enableProfiler(false, true);
-        ScriptDebugServer::recompileAllJSFunctions();
+        ScriptDebugServer::shared().recompileAllJSFunctions();
     }
 
     m_recordingUserInitiatedProfile = true;
@@ -1439,7 +1430,7 @@
     String title = getCurrentUserInitiatedProfileName(true);
 
 #if USE(JSC)
-    ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
+    JSC::ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
 #else
     ScriptState* scriptState = 0;
 #endif
@@ -1460,7 +1451,7 @@
     String title = getCurrentUserInitiatedProfileName();
 
 #if USE(JSC)
-    ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
+    JSC::ExecState* scriptState = toJSDOMWindow(m_inspectedPage->mainFrame(), debuggerWorld())->globalExec();
 #else
     ScriptState* scriptState = 0;
 #endif
@@ -1489,7 +1480,7 @@
     m_profilerEnabled = true;
 
     if (!skipRecompile)
-        ScriptDebugServer::recompileAllJSFunctionsSoon();
+        ScriptDebugServer::shared().recompileAllJSFunctionsSoon();
 
     if (m_frontend)
         m_frontend->profilerWasEnabled();
@@ -1505,14 +1496,14 @@
 
     m_profilerEnabled = false;
 
-    ScriptDebugServer::recompileAllJSFunctionsSoon();
+    ScriptDebugServer::shared().recompileAllJSFunctionsSoon();
 
     if (m_frontend)
         m_frontend->profilerWasDisabled();
 }
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
 void InspectorController::enableDebuggerFromFrontend(bool always)
 {
     if (always)
@@ -1520,8 +1511,8 @@
 
     ASSERT(m_inspectedPage);
 
-    JavaScriptDebugServer::shared().addListener(this, m_inspectedPage);
-    JavaScriptDebugServer::shared().clearBreakpoints();
+    ScriptDebugServer::shared().addListener(this, m_inspectedPage);
+    ScriptDebugServer::shared().clearBreakpoints();
 
     m_debuggerEnabled = true;
     m_frontend->debuggerWasEnabled();
@@ -1535,7 +1526,7 @@
     if (m_debuggerEnabled)
         return;
 
-    if (!m_frontendScriptState || !m_frontend)
+    if (!m_frontend)
         m_attachDebuggerWhenShown = true;
     else {
         m_frontend->attachDebuggerWhenShown();
@@ -1553,7 +1544,7 @@
 
     ASSERT(m_inspectedPage);
 
-    JavaScriptDebugServer::shared().removeListener(this, m_inspectedPage);
+    ScriptDebugServer::shared().removeListener(this, m_inspectedPage);
 
     m_debuggerEnabled = false;
     m_attachDebuggerWhenShown = false;
@@ -1566,25 +1557,66 @@
 {
     if (!m_debuggerEnabled)
         return;
-    JavaScriptDebugServer::shared().continueProgram();
+    ScriptDebugServer::shared().continueProgram();
+}
+
+void InspectorController::setBreakpoint(const String& sourceID, unsigned lineNumber, bool enabled, const String& condition)
+{
+    ScriptBreakpoint breakpoint(enabled, condition);
+    ScriptDebugServer::shared().setBreakpoint(sourceID, lineNumber, breakpoint);
+    String url = m_sourceIDToURL.get(sourceID);
+    if (url.isEmpty())
+        return;
+
+    HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+    if (it == m_stickyBreakpoints.end())
+        it = m_stickyBreakpoints.set(url, SourceBreakpoints()).first;
+    it->second.set(lineNumber, breakpoint);
+}
+
+void InspectorController::removeBreakpoint(const String& sourceID, unsigned lineNumber)
+{
+    ScriptDebugServer::shared().removeBreakpoint(sourceID, lineNumber);
+ 
+    String url = m_sourceIDToURL.get(sourceID);
+    if (url.isEmpty())
+        return;
+
+    HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+    if (it != m_stickyBreakpoints.end())
+        it->second.remove(lineNumber);
 }
 
 // JavaScriptDebugListener functions
 
-void InspectorController::didParseSource(ExecState*, const SourceCode& source)
+void InspectorController::didParseSource(const String& sourceID, const String& url, const String& data, int firstLine)
 {
-    m_frontend->parsedScriptSource(source);
+    m_frontend->parsedScriptSource(sourceID, url, data, firstLine);
+
+    if (url.isEmpty())
+        return;
+
+    HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+    if (it != m_stickyBreakpoints.end()) {
+        for (SourceBreakpoints::iterator breakpointIt = it->second.begin(); breakpointIt != it->second.end(); ++breakpointIt) {
+            if (firstLine <= breakpointIt->first) {
+                ScriptDebugServer::shared().setBreakpoint(sourceID, breakpointIt->first, breakpointIt->second);
+                m_frontend->restoredBreakpoint(sourceID, url, breakpointIt->first, breakpointIt->second.enabled, breakpointIt->second.condition);
+            }
+        }
+    }
+
+    m_sourceIDToURL.set(sourceID, url);
 }
 
-void InspectorController::failedToParseSource(ExecState*, const SourceCode& source, int errorLine, const UString& errorMessage)
+void InspectorController::failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
 {
-    m_frontend->failedToParseScriptSource(source, errorLine, errorMessage);
+    m_frontend->failedToParseScriptSource(url, data, firstLine, errorLine, errorMessage);
 }
 
 void InspectorController::didPause()
 {
-    JavaScriptCallFrame* callFrame = m_injectedScriptHost->currentCallFrame();
-    ScriptState* scriptState = callFrame->scopeChain()->globalObject->globalExec();
+    ScriptState* scriptState = ScriptDebugServer::shared().currentCallFrameState();
     ASSERT(scriptState);
     InjectedScript injectedScript = m_injectedScriptHost->injectedScriptFor(scriptState);
     RefPtr<SerializedScriptValue> callFrames = injectedScript.callFrames();
@@ -1809,6 +1841,8 @@
         return ProfilesPanel;
     if (panelName == "storage" || panelName == "databases")
         return StoragePanel;
+    if (panelName == "audits")
+        return AuditsPanel;
     if (panelName == "console")
         return ConsolePanel;
     return ElementsPanel;
@@ -1845,6 +1879,16 @@
     return InjectedScript();
 }
 
+void InspectorController::addScriptToEvaluateOnLoad(const String& source)
+{
+    m_scriptsToEvaluateOnLoad.append(source);
+}
+
+void InspectorController::removeAllScriptsToEvaluateOnLoad()
+{
+    m_scriptsToEvaluateOnLoad.clear();
+}
+
 } // namespace WebCore
     
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 2f25eec..3c67975 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,6 +34,7 @@
 #include "InspectorDOMAgent.h"
 #include "PlatformString.h"
 #include "ScriptArray.h"
+#include "ScriptBreakpoint.h"
 #include "ScriptObject.h"
 #include "ScriptProfile.h"
 #include "ScriptState.h"
@@ -47,12 +48,8 @@
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include "JavaScriptDebugListener.h"
-
-namespace JSC {
-class UString;
-}
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugListener.h"
 #endif
 
 namespace WebCore {
@@ -69,9 +66,8 @@
 class InspectorBackend;
 class InspectorClient;
 class InspectorFrontend;
-class InspectorFrontendHost;
+class InspectorFrontendClient;
 class InspectorTimelineAgent;
-class JavaScriptCallFrame;
 class KURL;
 class Node;
 class Page;
@@ -88,10 +84,11 @@
 class InspectorDatabaseResource;
 class InspectorDOMStorageResource;
 class InspectorResource;
+class InspectorWorkerResource;
 
 class InspectorController
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-                          : JavaScriptDebugListener, public Noncopyable
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+                          : ScriptDebugListener, public Noncopyable
 #else
                           : public Noncopyable
 #endif
@@ -103,6 +100,7 @@
     typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
 
     typedef enum {
+        AuditsPanel,
         CurrentPanel,
         ConsolePanel,
         ElementsPanel,
@@ -117,11 +115,9 @@
     ~InspectorController();
 
     InspectorBackend* inspectorBackend() { return m_inspectorBackend.get(); }
-    InspectorFrontendHost* inspectorFrontendHost() { return m_inspectorFrontendHost.get(); }
     InjectedScriptHost* injectedScriptHost() { return m_injectedScriptHost.get(); }
 
     void inspectedPageDestroyed();
-    void pageDestroyed() { m_page = 0; }
 
     bool enabled() const;
 
@@ -137,31 +133,24 @@
     void show();
     void showPanel(SpecialPanels);
     void close();
-
-    bool windowVisible();
-    void setWindowVisible(bool visible = true, bool attached = false);
+    void disconnectFrontend();
 
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*);
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
     void clearConsoleMessages();
     const Vector<ConsoleMessage*>& consoleMessages() const { return m_consoleMessages; }
 
-    void attachWindow();
-    void detachWindow();
-
-    void toggleSearchForNodeInPage();
     bool searchingForNodeInPage() const { return m_searchingForNode; }
     void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
-    void handleMousePressOnNode(Node*);
+    void handleMousePress();
 
+    void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client);
+    bool hasInspectorFrontendClient() const { return m_inspectorFrontendClient; }
+                                                        
     void inspectedWindowScriptObjectCleared(Frame*);
-    void windowScriptObjectAvailable();
 
-    void setFrontendProxyObject(ScriptState* state, ScriptObject webInspectorObj, ScriptObject injectedScriptObj = ScriptObject());
-    ScriptState* frontendScriptState() const { return m_frontendScriptState; }
-
-    void populateScriptObjects();
-    void resetScriptObjects();
+    bool windowVisible();
+    void setFrontend(PassOwnPtr<InspectorFrontend>);
 
     void didCommitLoad(DocumentLoader*);
     void frameDetachedFromParent(Frame*);
@@ -188,11 +177,17 @@
 
     void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&);
     void mainResourceFiredDOMContentEvent(DocumentLoader*, const KURL&);
-    
+
     void didInsertDOMNode(Node*);
     void didRemoveDOMNode(Node*);
     void didModifyDOMAttr(Element*);
-                                                        
+#if ENABLE(WORKERS)
+    enum WorkerAction { WorkerCreated, WorkerDestroyed };
+
+    void postWorkerNotificationToFrontend(const InspectorWorkerResource&, WorkerAction);
+    void didCreateWorker(intptr_t, const String& url, bool isSharedWorker);
+    void didDestroyWorker(intptr_t);
+#endif
     void getCookies(long callId);
 
 #if ENABLE(DATABASE)
@@ -201,7 +196,7 @@
 #if ENABLE(DOM_STORAGE)
     void didUseDOMStorage(StorageArea* storageArea, bool isLocalStorage, Frame* frame);
     void selectDOMStorage(Storage* storage);
-    void getDOMStorageEntries(int callId, int storageId);
+    void getDOMStorageEntries(long callId, long storageId);
     void setDOMStorageItem(long callId, long storageId, const String& key, const String& value);
     void removeDOMStorageItem(long callId, long storageId, const String& key);
 #endif
@@ -218,7 +213,7 @@
     void startGroup(MessageSource source, ScriptCallStack* callFrame);
     void endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL);
 
-    void markTimeline(const String& message); 
+    void markTimeline(const String& message);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     void addProfile(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
@@ -236,15 +231,15 @@
     bool profilerEnabled() const { return enabled() && m_profilerEnabled; }
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
     void enableDebugger();
     void disableDebugger(bool always = false);
     bool debuggerEnabled() const { return m_debuggerEnabled; }
 
     void resumeDebugger();
 
-    virtual void didParseSource(JSC::ExecState*, const JSC::SourceCode&);
-    virtual void failedToParseSource(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMessage);
+    virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine);
+    virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
     virtual void didPause();
     virtual void didContinue();
 #endif
@@ -252,25 +247,34 @@
     void evaluateForTestInFrontend(long callId, const String& script);
 
     InjectedScript injectedScriptForNodeId(long id);
+    void addScriptToEvaluateOnLoad(const String& source);
+    void removeAllScriptsToEvaluateOnLoad();
+
+    static const String& inspectorStartsAttachedSettingName();
 
 private:
-    static const char* const FrontendSettingsSettingName;
+    static const String& frontendSettingsSettingName();
+
     friend class InspectorBackend;
-    friend class InspectorFrontendHost;
     friend class InjectedScriptHost;
+                                                        
+    void populateScriptObjects();
+    void unbindAllResources();
+                                                        
     // Following are used from InspectorBackend and internally.
-    void scriptObjectReady();
-    void moveWindowBy(float x, float y) const;
-    void setAttachedWindow(bool);
-    void setAttachedWindowHeight(unsigned height);
+    void setSearchingForNode(bool enabled);
+
+    // Following are used from InspectorBackend and internally.
     void storeLastActivePanel(const String& panelName);
-    void closeWindow();
     InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
     void releaseDOMAgent();
 
     void deleteCookie(const String& cookieName, const String& domain);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
+    void setBreakpoint(const String& sourceID, unsigned lineNumber, bool enabled, const String& condition);
+    void removeBreakpoint(const String& sourceID, unsigned lineNumber);
+
     typedef HashMap<unsigned int, RefPtr<ScriptProfile> > ProfilesMap;
 
     void startUserInitiatedProfilingSoon();
@@ -282,10 +286,10 @@
 #endif
 #if ENABLE(DATABASE)
     void selectDatabase(Database* database);
-    Database* databaseForId(int databaseId);
+    Database* databaseForId(long databaseId);
 #endif
 #if ENABLE(DOM_STORAGE)
-    InspectorDOMStorageResource* getDOMStorageResourceForId(int storageId);
+    InspectorDOMStorageResource* getDOMStorageResourceForId(long storageId);
 #endif
                                                         
     ScriptObject buildObjectForCookie(const Cookie&);
@@ -302,8 +306,6 @@
     void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
     void removeAllResources(ResourcesMap* map) { pruneResources(map); }
 
-    void showWindow();
-
     bool isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl);
 
     SpecialPanels specialPanelForJSName(const String& panelName);
@@ -312,10 +314,11 @@
 
     Page* m_inspectedPage;
     InspectorClient* m_client;
+    OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
+    bool m_openingFrontend;
     OwnPtr<InspectorFrontend> m_frontend;
     RefPtr<InspectorDOMAgent> m_domAgent;
     OwnPtr<InspectorTimelineAgent> m_timelineAgent;
-    Page* m_page;
     RefPtr<Node> m_nodeToFocus;
     RefPtr<InspectorResource> m_mainResource;
     ResourcesMap m_resources;
@@ -331,8 +334,6 @@
 #if ENABLE(DOM_STORAGE)
     DOMStorageResourcesMap m_domStorageResources;
 #endif
-    ScriptState* m_frontendScriptState;
-    bool m_windowVisible;
     SpecialPanels m_showAfterVisible;
     RefPtr<Node> m_highlightedNode;
     unsigned m_groupLevel;
@@ -341,18 +342,19 @@
     bool m_resourceTrackingEnabled;
     bool m_resourceTrackingSettingsLoaded;
     RefPtr<InspectorBackend> m_inspectorBackend;
-    RefPtr<InspectorFrontendHost> m_inspectorFrontendHost;
     RefPtr<InjectedScriptHost> m_injectedScriptHost;
 
     typedef HashMap<String, String> Settings;
     mutable Settings m_settings;
 
     Vector<pair<long, String> > m_pendingEvaluateTestCommands;
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+    Vector<String> m_scriptsToEvaluateOnLoad;
+#if ENABLE(JAVASCRIPT_DEBUGGER)
     bool m_debuggerEnabled;
     bool m_attachDebuggerWhenShown;
-#endif
-#if ENABLE(JAVASCRIPT_DEBUGGER)
+    HashMap<String, String> m_sourceIDToURL;
+    HashMap<String, SourceBreakpoints> m_stickyBreakpoints;
+
     bool m_profilerEnabled;
     bool m_recordingUserInitiatedProfile;
     int m_currentUserInitiatedProfileNumber;
@@ -360,6 +362,11 @@
     Timer<InspectorController> m_startProfiling;
     ProfilesMap m_profiles;
 #endif
+#if ENABLE(WORKERS)
+    typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap;
+
+    WorkersMap m_workers;
+#endif
 };
 
 inline void InspectorController::didInsertDOMNode(Node* node)
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 0387f30..31fad80 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -34,6 +34,13 @@
 #if ENABLE(INSPECTOR)
 
 #include "AtomicString.h"
+#include "CSSComputedStyleDeclaration.h"
+#include "CSSMutableStyleDeclaration.h"
+#include "CSSRule.h"
+#include "CSSRuleList.h"
+#include "CSSStyleRule.h"
+#include "CSSStyleSelector.h"
+#include "CSSStyleSheet.h"
 #include "ContainerNode.h"
 #include "Cookie.h"
 #include "CookieJar.h"
@@ -45,16 +52,22 @@
 #include "EventNames.h"
 #include "EventTarget.h"
 #include "HTMLFrameOwnerElement.h"
+#include "HTMLHeadElement.h"
 #include "InspectorFrontend.h"
 #include "markup.h"
 #include "MutationEvent.h"
 #include "Node.h"
 #include "NodeList.h"
 #include "PlatformString.h"
+#include "RenderStyle.h"
+#include "RenderStyleConstants.h"
 #include "ScriptEventListener.h"
 #include "ScriptObject.h"
+#include "StyleSheetList.h"
 #include "Text.h"
 
+#include <wtf/text/CString.h>
+#include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
 
@@ -64,6 +77,8 @@
     : EventListener(InspectorDOMAgentType)
     , m_frontend(frontend)
     , m_lastNodeId(1)
+    , m_lastStyleId(1)
+    , m_lastRuleId(1)
 {
 }
 
@@ -174,7 +189,7 @@
         stopListening(frameOwner->contentDocument());
     }
 
-    int id = nodesMap->get(node);
+    long id = nodesMap->get(node);
     if (!id)
         return;
     m_idToNode.remove(id);
@@ -221,6 +236,12 @@
     m_idToNode.clear();
     releaseDanglingNodes();
     m_childrenRequested.clear();
+    m_styleToId.clear();
+    m_idToStyle.clear();
+    m_ruleToId.clear();
+    m_idToRule.clear();
+    m_idToDisabledStyle.clear();
+    m_inspectorStyleSheet = 0;
 }
 
 Node* InspectorDOMAgent::nodeForId(long id)
@@ -337,6 +358,74 @@
     }
 }
 
+void InspectorDOMAgent::removeNode(long callId, long nodeId)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node) {
+        // Use -1 to denote an error condition.
+        m_frontend->didRemoveNode(callId, -1);
+        return;
+    }
+
+    Node* parentNode = node->parentNode();
+    if (!parentNode) {
+        m_frontend->didRemoveNode(callId, -1);
+        return;
+    }
+
+    ExceptionCode code;
+    parentNode->removeChild(node, code);
+    if (code) {
+        m_frontend->didRemoveNode(callId, -1);
+        return;
+    }
+
+    m_frontend->didRemoveNode(callId, nodeId);
+}
+
+void InspectorDOMAgent::changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded)
+{
+    Node* oldNode = nodeForId(nodeId);
+    if (!oldNode || !oldNode->isElementNode()) {
+        // Use -1 to denote an error condition.
+        m_frontend->didChangeTagName(callId, -1);
+        return;
+    }
+
+    ExceptionCode code = 0;
+    RefPtr<Element> newElem = oldNode->document()->createElement(tagName, code);
+    if (code) {
+        m_frontend->didChangeTagName(callId, -1);
+        return;
+    }
+
+    // Copy over the original node's attributes.
+    Element* oldElem = static_cast<Element*>(oldNode);
+    newElem->copyNonAttributeProperties(oldElem);
+    if (oldElem->attributes())
+        newElem->attributes()->setAttributes(*(oldElem->attributes(true)));
+
+    // Copy over the original node's children.
+    Node* child;
+    while ((child = oldNode->firstChild()))
+        newElem->appendChild(child, code);
+
+    // Replace the old node with the new node
+    Node* parent = oldNode->parentNode();
+    parent->insertBefore(newElem, oldNode->nextSibling(), code);
+    parent->removeChild(oldNode, code);
+
+    if (code) {
+        m_frontend->didChangeTagName(callId, -1);
+        return;
+    }
+
+    long newId = pushNodePathToFrontend(newElem.get());
+    if (expanded)
+        pushChildNodesToFrontend(newId);
+    m_frontend->didChangeTagName(callId, newId);
+}
+
 void InspectorDOMAgent::setTextNodeValue(long callId, long nodeId, const String& value)
 {
     Node* node = nodeForId(nodeId);
@@ -671,6 +760,558 @@
     m_frontend->attributesUpdated(id, buildArrayForElementAttributes(element));
 }
 
+void InspectorDOMAgent::getStyles(long callId, long nodeId, bool authorOnly)    
+{
+    Node* node = nodeForId(nodeId);
+    if (!node || node->nodeType() != Node::ELEMENT_NODE) {
+        m_frontend->didGetStyles(callId, ScriptValue::undefined());
+        return;
+    }
+    
+    DOMWindow* defaultView = node->ownerDocument()->defaultView();
+    if (!defaultView) {
+        m_frontend->didGetStyles(callId, ScriptValue::undefined());
+        return;
+    }
+
+    Element* element = static_cast<Element*>(node);
+    RefPtr<CSSComputedStyleDeclaration> computedStyleInfo = computedStyle(node, true); // Support the viewing of :visited information in computed style.
+
+    ScriptObject result = m_frontend->newScriptObject();
+    if (element->style())
+        result.set("inlineStyle", buildObjectForStyle(element->style(), true));
+    result.set("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
+
+    CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
+    RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, authorOnly);
+    result.set("matchedCSSRules", buildArrayForCSSRules(matchedRules.get()));
+
+    result.set("styleAttributes", buildObjectForAttributeStyles(element));
+    result.set("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
+    
+    ScriptObject currentStyle = result;
+    Element* parentElement = element->parentElement();
+    while (parentElement) {
+        ScriptObject parentStyle = m_frontend->newScriptObject();
+        currentStyle.set("parent", parentStyle);
+        if (parentElement->style() && parentElement->style()->length())
+            parentStyle.set("inlineStyle", buildObjectForStyle(parentElement->style(), true));
+
+        CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
+        RefPtr<CSSRuleList> parentMatchedRules = parentSelector->styleRulesForElement(parentElement, authorOnly);
+        parentStyle.set("matchedCSSRules", buildArrayForCSSRules(parentMatchedRules.get()));
+
+        parentElement = parentElement->parentElement();
+        currentStyle = parentStyle;
+    }
+    m_frontend->didGetStyles(callId, result);
+}
+
+void InspectorDOMAgent::getAllStyles(long callId)
+{
+    ScriptArray result = m_frontend->newScriptArray();
+    unsigned counter = 0;
+    for (ListHashSet<RefPtr<Document> >::iterator it = m_documents.begin(); it != m_documents.end(); ++it) {
+        StyleSheetList* list = (*it)->styleSheets();
+        for (unsigned i = 0; i < list->length(); ++i) {
+            StyleSheet* styleSheet = list->item(i);
+            if (styleSheet->isCSSStyleSheet())
+                result.set(counter++, buildObjectForStyleSheet(static_cast<CSSStyleSheet*>(styleSheet)));
+        }
+    }
+    m_frontend->didGetAllStyles(callId, result);
+}
+
+void InspectorDOMAgent::getInlineStyle(long callId, long nodeId)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node || node->nodeType() != Node::ELEMENT_NODE) {
+        m_frontend->didGetInlineStyle(callId, ScriptValue::undefined());
+        return;
+    }
+    Element* element = static_cast<Element*>(node);
+    m_frontend->didGetInlineStyle(callId, buildObjectForStyle(element->style(), true));
+}
+
+void InspectorDOMAgent::getComputedStyle(long callId, long nodeId)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node || node->nodeType() != Node::ELEMENT_NODE) {
+        m_frontend->didGetComputedStyle(callId, ScriptValue::undefined());
+        return;
+    }
+
+    DOMWindow* defaultView = node->ownerDocument()->defaultView();
+    if (!defaultView) {
+        m_frontend->didGetComputedStyle(callId, ScriptValue::undefined());
+        return;
+    }
+
+    Element* element = static_cast<Element*>(node);
+    RefPtr<CSSStyleDeclaration> computedStyle = defaultView->getComputedStyle(element, "");
+    m_frontend->didGetComputedStyle(callId, buildObjectForStyle(computedStyle.get(), false));
+}
+
+ScriptObject InspectorDOMAgent::buildObjectForAttributeStyles(Element* element)
+{
+    ScriptObject styleAttributes = m_frontend->newScriptObject();
+    NamedNodeMap* attributes = element->attributes();
+    for (unsigned i = 0; attributes && i < attributes->length(); ++i) {
+        Attribute* attribute = attributes->attributeItem(i);
+        if (attribute->style()) {
+            String attributeName = attribute->localName();
+            styleAttributes.set(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), true));
+        }
+    }
+    return styleAttributes;
+}
+
+ScriptArray InspectorDOMAgent::buildArrayForCSSRules(CSSRuleList* matchedRules)
+{
+    ScriptArray matchedCSSRules = m_frontend->newScriptArray();
+    unsigned counter = 0;
+    for (unsigned i = 0; matchedRules && i < matchedRules->length(); ++i) {
+        CSSRule* rule = matchedRules->item(i);
+        if (rule->type() == CSSRule::STYLE_RULE)
+            matchedCSSRules.set(counter++, buildObjectForRule(static_cast<CSSStyleRule*>(rule)));
+    }
+    return matchedCSSRules;
+}
+
+ScriptArray InspectorDOMAgent::buildArrayForPseudoElements(Element* element, bool authorOnly)
+{
+    ScriptArray result = m_frontend->newScriptArray();
+    CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
+    RefPtr<RenderStyle> renderStyle = element->styleForRenderer();
+    unsigned counter = 0;
+
+    for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
+        RefPtr<CSSRuleList> matchedRules = selector->pseudoStyleRulesForElement(element, pseudoId, authorOnly);
+        if (matchedRules && matchedRules->length()) {
+            ScriptObject pseudoStyles = m_frontend->newScriptObject();
+            pseudoStyles.set("pseudoId", static_cast<int>(pseudoId));
+            pseudoStyles.set("rules", buildArrayForCSSRules(matchedRules.get()));
+            result.set(counter++, pseudoStyles);
+        }
+    }
+    return result;
+}
+
+void InspectorDOMAgent::applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName)
+{
+    IdToStyleMap::iterator it = m_idToStyle.find(styleId);
+    if (it == m_idToStyle.end()) {
+        m_frontend->didApplyStyleText(callId, false, ScriptValue::undefined(), m_frontend->newScriptArray());
+        return;
+    }
+
+    CSSStyleDeclaration* style = it->second.get();
+    int styleTextLength = styleText.length();
+
+    RefPtr<CSSMutableStyleDeclaration> tempMutableStyle = CSSMutableStyleDeclaration::create();
+    tempMutableStyle->parseDeclaration(styleText);
+    CSSStyleDeclaration* tempStyle = static_cast<CSSStyleDeclaration*>(tempMutableStyle.get());
+
+    if (tempStyle->length() || !styleTextLength) {
+        ExceptionCode ec = 0;
+        // The input was parsable or the user deleted everything, so remove the
+        // original property from the real style declaration. If this represents
+        // a shorthand remove all the longhand properties.
+        if (!style->getPropertyShorthand(propertyName).isEmpty()) {
+            Vector<String> longhandProps = longhandProperties(style, propertyName);
+            for (unsigned i = 0; !ec && i < longhandProps.size(); ++i)
+                style->removeProperty(longhandProps[i], ec);
+        } else
+            style->removeProperty(propertyName, ec);
+        if (ec) {
+            m_frontend->didApplyStyleText(callId, false, ScriptValue::undefined(), m_frontend->newScriptArray());
+            return;
+        }
+    }
+
+    // Notify caller that the property was successfully deleted.
+    if (!styleTextLength) {
+        ScriptArray changedProperties = m_frontend->newScriptArray();
+        changedProperties.set(0, propertyName);
+        m_frontend->didApplyStyleText(callId, true, ScriptValue::undefined(), changedProperties);
+        return;
+    }
+
+    if (!tempStyle->length()) {
+        m_frontend->didApplyStyleText(callId, false, ScriptValue::undefined(), m_frontend->newScriptArray());
+        return;
+    }
+
+    // Iterate of the properties on the test element's style declaration and
+    // add them to the real style declaration. We take care to move shorthands.
+    HashSet<String> foundShorthands;
+    Vector<String> changedProperties;
+
+    for (unsigned i = 0; i < tempStyle->length(); ++i) {
+        String name = tempStyle->item(i);
+        String shorthand = tempStyle->getPropertyShorthand(name);
+
+        if (!shorthand.isEmpty() && foundShorthands.contains(shorthand))
+            continue;
+
+        String value;
+        String priority;
+        if (!shorthand.isEmpty()) {
+            value = shorthandValue(tempStyle, shorthand);
+            priority = shorthandPriority(tempStyle, shorthand);
+            foundShorthands.add(shorthand);
+            name = shorthand;
+        } else {
+            value = tempStyle->getPropertyValue(name);
+            priority = tempStyle->getPropertyPriority(name);
+        }
+
+        // Set the property on the real style declaration.
+        ExceptionCode ec = 0;
+        style->setProperty(name, value, priority, ec);
+        changedProperties.append(name);
+    }
+    m_frontend->didApplyStyleText(callId, true, buildObjectForStyle(style, true), toArray(changedProperties));
+}
+
+void InspectorDOMAgent::setStyleText(long callId, long styleId, const String& cssText)
+{
+    IdToStyleMap::iterator it = m_idToStyle.find(styleId);
+    if (it == m_idToStyle.end()) {
+        m_frontend->didSetStyleText(callId, false);
+        return;
+    }
+    CSSStyleDeclaration* style = it->second.get();
+    ExceptionCode ec = 0;
+    style->setCssText(cssText, ec);
+    m_frontend->didSetStyleText(callId, !ec);
+}
+
+void InspectorDOMAgent::setStyleProperty(long callId, long styleId, const String& name, const String& value)
+{
+    IdToStyleMap::iterator it = m_idToStyle.find(styleId);
+    if (it == m_idToStyle.end()) {
+        m_frontend->didSetStyleProperty(callId, false);
+        return;
+    }
+
+    CSSStyleDeclaration* style = it->second.get();
+    ExceptionCode ec = 0;
+    style->setProperty(name, value, ec);
+    m_frontend->didSetStyleProperty(callId, !ec);
+}
+
+void InspectorDOMAgent::toggleStyleEnabled(long callId, long styleId, const String& propertyName, bool disabled)
+{
+    IdToStyleMap::iterator it = m_idToStyle.find(styleId);
+    if (it == m_idToStyle.end()) {
+        m_frontend->didToggleStyleEnabled(callId, ScriptValue::undefined());
+        return;
+    }
+    CSSStyleDeclaration* style = it->second.get();
+
+    IdToDisabledStyleMap::iterator disabledIt = m_idToDisabledStyle.find(styleId);
+    if (disabledIt == m_idToDisabledStyle.end())
+        disabledIt = m_idToDisabledStyle.set(styleId, DisabledStyleDeclaration()).first;
+
+    // TODO: make sure this works with shorthands right.
+    ExceptionCode ec = 0;
+    if (disabled) {
+        disabledIt->second.set(propertyName, std::make_pair(style->getPropertyValue(propertyName), style->getPropertyPriority(propertyName)));
+        if (!ec)
+            style->removeProperty(propertyName, ec);
+    } else if (disabledIt->second.contains(propertyName)) {
+        PropertyValueAndPriority valueAndPriority = disabledIt->second.get(propertyName);
+        style->setProperty(propertyName, valueAndPriority.first, valueAndPriority.second, ec);
+        if (!ec)
+            disabledIt->second.remove(propertyName);
+    }
+    if (ec) {
+        m_frontend->didToggleStyleEnabled(callId, ScriptValue::undefined());
+        return;
+    }
+    m_frontend->didToggleStyleEnabled(callId, buildObjectForStyle(style, true));
+}
+
+void InspectorDOMAgent::setRuleSelector(long callId, long ruleId, const String& selector, long selectedNodeId)
+{
+    IdToRuleMap::iterator it = m_idToRule.find(ruleId);
+    if (it == m_idToRule.end()) {
+        m_frontend->didSetRuleSelector(callId, ScriptValue::undefined(), false);
+        return;
+    }
+
+    CSSStyleRule* rule = it->second.get();
+    Node* node = nodeForId(selectedNodeId);
+
+    CSSStyleSheet* styleSheet = rule->parentStyleSheet();
+    ExceptionCode ec = 0;
+    styleSheet->addRule(selector, rule->style()->cssText(), ec);
+    if (ec) {
+        m_frontend->didSetRuleSelector(callId, ScriptValue::undefined(), false);
+        return;
+    }
+
+    CSSStyleRule* newRule = static_cast<CSSStyleRule*>(styleSheet->item(styleSheet->length() - 1));
+    for (unsigned i = 0; i < styleSheet->length(); ++i) {
+        if (styleSheet->item(i) == rule) {
+            styleSheet->deleteRule(i, ec);
+            break;
+        }
+    }
+
+    if (ec) {
+        m_frontend->didSetRuleSelector(callId, ScriptValue::undefined(), false);
+        return;
+    }
+
+    m_frontend->didSetRuleSelector(callId, buildObjectForRule(newRule), ruleAffectsNode(newRule, node));
+}
+
+void InspectorDOMAgent::addRule(long callId, const String& selector, long selectedNodeId)
+{
+    Node* node = nodeForId(selectedNodeId);
+    if (!node) {
+        m_frontend->didAddRule(callId, ScriptValue::undefined(), false);
+        return;
+    }
+
+    if (!m_inspectorStyleSheet.get()) {
+        Document* ownerDocument = node->ownerDocument();
+        ExceptionCode ec = 0;
+        RefPtr<Element> styleElement = ownerDocument->createElement("style", ec);
+        if (!ec)
+            styleElement->setAttribute("type", "text/css", ec);
+        if (!ec)
+            ownerDocument->head()->appendChild(styleElement, ec);
+        if (ec) {
+            m_frontend->didAddRule(callId, ScriptValue::undefined(), false);
+            return;
+        }
+        StyleSheetList* styleSheets = ownerDocument->styleSheets();
+        StyleSheet* styleSheet = styleSheets->item(styleSheets->length() - 1);
+        if (!styleSheet->isCSSStyleSheet()) {
+            m_frontend->didAddRule(callId, ScriptValue::undefined(), false);
+            return;
+        }
+        m_inspectorStyleSheet = static_cast<CSSStyleSheet*>(styleSheet);
+    }
+
+    ExceptionCode ec = 0;
+    m_inspectorStyleSheet->addRule(selector, "", ec);
+    if (ec) {
+        m_frontend->didAddRule(callId, ScriptValue::undefined(), false);
+        return;
+    }
+
+    CSSStyleRule* newRule = static_cast<CSSStyleRule*>(m_inspectorStyleSheet->item(m_inspectorStyleSheet->length() - 1));
+    m_frontend->didAddRule(callId, buildObjectForRule(newRule), ruleAffectsNode(newRule, node));
+}
+
+long InspectorDOMAgent::bindStyle(CSSStyleDeclaration* style)
+{
+    long id = m_styleToId.get(style);
+    if (!id) {
+        id = m_lastStyleId++;
+        m_idToStyle.set(id, style);
+        m_styleToId.set(style, id);
+    }
+    return id;
+}
+
+long InspectorDOMAgent::bindRule(CSSStyleRule* rule)
+{
+    long id = m_ruleToId.get(rule);
+    if (!id) {
+        id = m_lastRuleId++;
+        m_idToRule.set(id, rule);
+        m_ruleToId.set(rule, id);
+    }
+    return id;
+}
+
+ScriptObject InspectorDOMAgent::buildObjectForStyle(CSSStyleDeclaration* style, bool bind)
+{
+    ScriptObject result = m_frontend->newScriptObject();
+    if (bind) {
+        long styleId = bindStyle(style);
+        result.set("id", styleId);
+
+        IdToDisabledStyleMap::iterator disabledIt = m_idToDisabledStyle.find(styleId);
+        if (disabledIt != m_idToDisabledStyle.end())
+            result.set("disabled", buildArrayForDisabledStyleProperties(disabledIt->second));
+    }
+    result.set("width", style->getPropertyValue("width"));
+    result.set("height", style->getPropertyValue("height"));
+    populateObjectWithStyleProperties(style, result);
+    return result;
+}
+
+void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* style, ScriptObject& result)
+{
+    ScriptArray properties = m_frontend->newScriptArray();
+    ScriptObject shorthandValues = m_frontend->newScriptObject();
+    result.set("properties", properties);
+    result.set("shorthandValues", shorthandValues);
+
+    HashSet<String> foundShorthands;
+    for (unsigned i = 0; i < style->length(); ++i) {
+        ScriptObject property = m_frontend->newScriptObject();
+        String name = style->item(i);
+        property.set("name", name);
+        property.set("priority", style->getPropertyPriority(name));
+        property.set("implicit", style->isPropertyImplicit(name));
+        String shorthand =  style->getPropertyShorthand(name);
+        property.set("shorthand", shorthand);
+        if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
+            foundShorthands.add(shorthand);
+            shorthandValues.set(shorthand, shorthandValue(style, shorthand));
+        }
+        property.set("value", style->getPropertyValue(name));
+        properties.set(i, property);
+    }
+}
+
+ScriptArray InspectorDOMAgent::buildArrayForDisabledStyleProperties(DisabledStyleDeclaration& declaration)
+{
+    int counter = 0;
+    ScriptArray properties = m_frontend->newScriptArray();
+    for (DisabledStyleDeclaration::iterator it = declaration.begin(); it != declaration.end(); ++it) {
+        ScriptObject property = m_frontend->newScriptObject();
+        property.set("name", it->first);
+        property.set("value", it->second.first);
+        property.set("priority", it->second.second);
+        properties.set(counter++, property);
+    }
+    return properties;
+}
+
+ScriptObject InspectorDOMAgent::buildObjectForStyleSheet(CSSStyleSheet* styleSheet)
+{
+    ScriptObject result = m_frontend->newScriptObject();
+    result.set("disabled", styleSheet->disabled());
+    result.set("href", styleSheet->href());
+    result.set("title", styleSheet->title());
+    result.set("documentElementId", m_documentNodeToIdMap.get(styleSheet->doc()));
+    ScriptArray cssRules = m_frontend->newScriptArray();
+    result.set("cssRules", cssRules);
+    PassRefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true);
+    if (!cssRuleList)
+        return result;
+    unsigned counter = 0;
+    for (unsigned i = 0; i < cssRuleList->length(); ++i) {
+        CSSRule* rule = cssRuleList->item(i);
+        if (rule->isStyleRule())
+            cssRules.set(counter++, buildObjectForRule(static_cast<CSSStyleRule*>(rule)));
+    }
+    return result;
+}
+
+ScriptObject InspectorDOMAgent::buildObjectForRule(CSSStyleRule* rule)
+{
+    CSSStyleSheet* parentStyleSheet = rule->parentStyleSheet();
+
+    ScriptObject result = m_frontend->newScriptObject();
+    result.set("selectorText", rule->selectorText());
+    result.set("cssText", rule->cssText());
+    result.set("sourceLine", rule->sourceLine());
+    if (parentStyleSheet) {
+        ScriptObject parentStyleSheetValue = m_frontend->newScriptObject();
+        result.set("parentStyleSheet", parentStyleSheetValue);
+        parentStyleSheetValue.set("href", parentStyleSheet->href());
+    }
+    bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty();
+    bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document";
+    result.set("isUserAgent", isUserAgent);
+    result.set("isUser", isUser);
+    result.set("isViaInspector", rule->parentStyleSheet() == m_inspectorStyleSheet.get());
+
+    // Bind editable scripts only.
+    bool bind = !isUserAgent && !isUser;
+    result.set("style", buildObjectForStyle(rule->style(), bind));
+
+    if (bind)
+        result.set("id", bindRule(rule));
+    return result;
+}
+
+Vector<String> InspectorDOMAgent::longhandProperties(CSSStyleDeclaration* style, const String& shorthandProperty)
+{
+    Vector<String> properties;
+    HashSet<String> foundProperties;
+
+    for (unsigned i = 0; i < style->length(); ++i) {
+        String individualProperty = style->item(i);
+        if (foundProperties.contains(individualProperty) || style->getPropertyShorthand(individualProperty) != shorthandProperty)
+            continue;
+        foundProperties.add(individualProperty);
+        properties.append(individualProperty);
+    }
+
+    return properties;
+}
+
+String InspectorDOMAgent::shorthandValue(CSSStyleDeclaration* style, const String& shorthandProperty)
+{
+    String value = style->getPropertyValue(shorthandProperty);
+    if (value.isEmpty()) {
+        // Some shorthands (like border) return a null value, so compute a shorthand value.
+        // FIXME: remove this when http://bugs.webkit.org/show_bug.cgi?id=15823 is fixed.
+        for (unsigned i = 0; i < style->length(); ++i) {
+            String individualProperty = style->item(i);
+            if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
+                continue;
+            if (style->isPropertyImplicit(individualProperty))
+                continue;
+            String individualValue = style->getPropertyValue(individualProperty);
+            if (individualValue == "initial")
+                continue;
+            if (value.length())
+                value.append(" ");
+            value.append(individualValue);
+        }
+    }
+    return value;
+}
+
+String InspectorDOMAgent::shorthandPriority(CSSStyleDeclaration* style, const String& shorthandProperty)
+{
+    String priority = style->getPropertyPriority(shorthandProperty);
+    if (priority.isEmpty()) {
+        for (unsigned i = 0; i < style->length(); ++i) {
+            String individualProperty = style->item(i);
+            if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
+                continue;
+            priority = style->getPropertyPriority(individualProperty);
+            break;
+        }
+    }
+    return priority;
+}
+
+bool InspectorDOMAgent::ruleAffectsNode(CSSStyleRule* rule, Node* node)
+{
+    if (!node)
+        return false;
+    ExceptionCode ec = 0;
+    RefPtr<NodeList> nodes = node->ownerDocument()->querySelectorAll(rule->selectorText(), ec);
+    if (ec)
+        return false;
+    for (unsigned i = 0; i < nodes->length(); ++i) {
+        if (nodes->item(i) == node)
+            return true;
+    }
+    return false;
+}
+
+ScriptArray InspectorDOMAgent::toArray(const Vector<String>& data)
+{
+    ScriptArray result = m_frontend->newScriptArray();
+    for (unsigned i = 0; i < data.size(); ++i)
+        result.set(i, data[i]);
+    return result;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index d7334b7..7211ed2 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -45,6 +45,11 @@
 
 namespace WebCore {
     class ContainerNode;
+    class CSSRule;
+    class CSSRuleList;
+    class CSSStyleDeclaration;
+    class CSSStyleRule;
+    class CSSStyleSheet;
     class Element;
     class Event;
     class Document;
@@ -87,13 +92,27 @@
 
         virtual bool operator==(const EventListener& other);
 
-        // Methods called from the frontend.
+        // Methods called from the frontend for DOM nodes inspection.
         void getChildNodes(long callId, long nodeId);
         void setAttribute(long callId, long elementId, const String& name, const String& value);
         void removeAttribute(long callId, long elementId, const String& name);
+        void removeNode(long callId, long nodeId);
+        void changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded);
         void setTextNodeValue(long callId, long nodeId, const String& value);
         void getEventListenersForNode(long callId, long nodeId);
 
+        // Methods called from the frontend for CSS styles inspection.
+        void getStyles(long callId, long nodeId, bool authorOnly);
+        void getAllStyles(long callId);
+        void getInlineStyle(long callId, long nodeId);
+        void getComputedStyle(long callId, long nodeId);
+        void applyStyleText(long callId, long styleId, const String& styleText, const String& propertyName);
+        void setStyleText(long callId, long styleId, const String& cssText);
+        void setStyleProperty(long callId, long styleId, const String& name, const String& value);
+        void toggleStyleEnabled(long callId, long styleId, const String& propertyName, bool disabled);
+        void setRuleSelector(long callId, long ruleId, const String& selector, long selectedNodeId);
+        void addRule(long callId, const String& selector, long selectedNodeId);
+
         // Methods called from the InspectorController.
         void setDocument(Document* document);
         void releaseDanglingNodes();
@@ -107,22 +126,29 @@
         long pushNodePathToFrontend(Node* node);
         void pushChildNodesToFrontend(long nodeId);
 
-   private:
+    private:
+        typedef std::pair<String, String> PropertyValueAndPriority;
+        typedef HashMap<String, PropertyValueAndPriority> DisabledStyleDeclaration;
+
         void startListening(Document* document);
         void stopListening(Document* document);
 
         virtual void handleEvent(ScriptExecutionContext*, Event* event);
 
+        // Node-related methods.
         typedef HashMap<RefPtr<Node>, long> NodeToIdMap;
         long bind(Node* node, NodeToIdMap* nodesMap);
         void unbind(Node* node, NodeToIdMap* nodesMap);
 
         bool pushDocumentToFrontend();
 
+        ScriptObject buildObjectForAttributeStyles(Element* element);
+        ScriptArray buildArrayForCSSRules(CSSRuleList*);
+        ScriptArray buildArrayForPseudoElements(Element* element, bool authorOnly);
+
         ScriptObject buildObjectForNode(Node* node, int depth, NodeToIdMap* nodesMap);
         ScriptArray buildArrayForElementAttributes(Element* element);
         ScriptArray buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
-
         ScriptObject buildObjectForEventListener(const RegisteredEventListener& registeredEventListener, const AtomicString& eventType, Node* node);
 
         // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
@@ -136,6 +162,20 @@
 
         Document* mainFrameDocument() const;
         String documentURLString(Document* document) const;
+
+        long bindStyle(CSSStyleDeclaration*);
+        long bindRule(CSSStyleRule*);
+        ScriptObject buildObjectForStyle(CSSStyleDeclaration*, bool bind);
+        void populateObjectWithStyleProperties(CSSStyleDeclaration*, ScriptObject& result);
+        ScriptArray buildArrayForDisabledStyleProperties(DisabledStyleDeclaration&);
+        ScriptObject buildObjectForRule(CSSStyleRule*);
+        ScriptObject buildObjectForStyleSheet(CSSStyleSheet*);
+        Vector<String> longhandProperties(CSSStyleDeclaration*, const String& shorthandProperty);
+        String shorthandValue(CSSStyleDeclaration*, const String& shorthandProperty);
+        String shorthandPriority(CSSStyleDeclaration*, const String& shorthandProperty);
+        bool ruleAffectsNode(CSSStyleRule*, Node*);
+        ScriptArray toArray(const Vector<String>& data);
+
         void discardBindings();
 
         InspectorFrontend* m_frontend;
@@ -146,6 +186,21 @@
         HashMap<long, NodeToIdMap*> m_idToNodesMap;
         HashSet<long> m_childrenRequested;
         long m_lastNodeId;
+
+        typedef HashMap<CSSStyleDeclaration*, long> StyleToIdMap;
+        typedef HashMap<long, RefPtr<CSSStyleDeclaration> > IdToStyleMap;
+        StyleToIdMap m_styleToId;
+        IdToStyleMap m_idToStyle;
+        typedef HashMap<CSSStyleRule*, long> RuleToIdMap;
+        typedef HashMap<long, RefPtr<CSSStyleRule> > IdToRuleMap;
+        RuleToIdMap m_ruleToId;
+        IdToRuleMap m_idToRule;
+        typedef HashMap<long, DisabledStyleDeclaration>  IdToDisabledStyleMap;
+        IdToDisabledStyleMap m_idToDisabledStyle;
+        RefPtr<CSSStyleSheet> m_inspectorStyleSheet;
+
+        long m_lastStyleId;
+        long m_lastRuleId;
         ListHashSet<RefPtr<Document> > m_documents;
     };
 
diff --git a/WebCore/inspector/InspectorDOMStorageResource.cpp b/WebCore/inspector/InspectorDOMStorageResource.cpp
index c93e987..af0530a 100644
--- a/WebCore/inspector/InspectorDOMStorageResource.cpp
+++ b/WebCore/inspector/InspectorDOMStorageResource.cpp
@@ -104,7 +104,8 @@
     ASSERT(eventNames().storageEvent == event->type());
     StorageEvent* storageEvent = static_cast<StorageEvent*>(event);
     Storage* storage = storageEvent->storageArea();
-    bool isLocalStorage = storage->frame()->domWindow()->localStorage() == storage;
+    ExceptionCode ec = 0;
+    bool isLocalStorage = (storage->frame()->domWindow()->localStorage(ec) == storage && !ec);
     if (isSameHostAndType(storage->frame(), isLocalStorage))
         m_frontend->updateDOMStorage(m_id);
 }
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index 90b60f4..d89ae71 100755
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -37,6 +37,7 @@
 #include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorController.h"
+#include "InspectorWorkerResource.h"
 #include "Node.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
@@ -46,17 +47,10 @@
 #include "SerializedScriptValue.h"
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include <parser/SourceCode.h>
-#include <runtime/JSValue.h>
-#include <runtime/UString.h>
-#endif
-
 namespace WebCore {
 
-InspectorFrontend::InspectorFrontend(InspectorController* inspectorController, ScriptObject webInspector)
-    : m_inspectorController(inspectorController)
-    , m_webInspector(webInspector)
+InspectorFrontend::InspectorFrontend(ScriptObject webInspector)
+    : m_webInspector(webInspector)
 {
 }
 
@@ -65,6 +59,18 @@
     m_webInspector = ScriptObject();
 }
 
+void InspectorFrontend::close()
+{
+    ScriptFunctionCall function(m_webInspector, "close");
+    function.call();
+}
+
+void InspectorFrontend::inspectedPageDestroyed()
+{
+    ScriptFunctionCall function(m_webInspector, "inspectedPageDestroyed");
+    function.call();
+}
+
 ScriptArray InspectorFrontend::newScriptArray()
 {
     return ScriptArray::createNew(scriptState());
@@ -96,7 +102,7 @@
     function.call();
 }
 
-void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, ScriptState* scriptState, const Vector<ScriptValue> arguments, const String& message)
+void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<RefPtr<SerializedScriptValue> >& arguments, const String& message)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("addConsoleMessage");
@@ -105,10 +111,8 @@
         for (unsigned i = 0; i < frames.size(); ++i)
             function.appendArgument(frames[i]);
     } else if (!arguments.isEmpty()) {
-        InjectedScript injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptFor(scriptState);
         for (unsigned i = 0; i < arguments.size(); ++i) {
-            RefPtr<SerializedScriptValue> serializedValue = injectedScript.wrapForConsole(arguments[i]);
-            ScriptValue scriptValue = ScriptValue::deserialize(this->scriptState(), serializedValue.get());
+            ScriptValue scriptValue = ScriptValue::deserialize(scriptState(), arguments[i].get());
             if (scriptValue.hasNoValue()) {
                 ASSERT_NOT_REACHED();
                 return;
@@ -153,7 +157,7 @@
     function.call();
 }
 
-void InspectorFrontend::didGetResourceContent(int callId, const String& content)
+void InspectorFrontend::didGetResourceContent(long callId, const String& content)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch");
     function.appendArgument("didGetResourceContent");
@@ -182,6 +186,9 @@
 {
     const char* showFunctionName;
     switch (panel) {
+        case InspectorController::AuditsPanel:
+            showFunctionName = "showAuditsPanel";
+            break;
         case InspectorController::ConsolePanel:
             showFunctionName = "showConsolePanel";
             break;
@@ -191,15 +198,15 @@
         case InspectorController::ResourcesPanel:
             showFunctionName = "showResourcesPanel";
             break;
-        case InspectorController::ScriptsPanel:
-            showFunctionName = "showScriptsPanel";
-            break;
         case InspectorController::TimelinePanel:
             showFunctionName = "showTimelinePanel";
             break;
         case InspectorController::ProfilesPanel:
             showFunctionName = "showProfilesPanel";
             break;
+        case InspectorController::ScriptsPanel:
+            showFunctionName = "showScriptsPanel";
+            break;
         case InspectorController::StoragePanel:
             showFunctionName = "showStoragePanel";
             break;
@@ -222,6 +229,19 @@
     callSimpleFunction("reset");
 }
 
+void InspectorFrontend::bringToFront()
+{
+    callSimpleFunction("bringToFront");
+}
+
+void InspectorFrontend::inspectedURLChanged(const String& url)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch");
+    function.appendArgument("inspectedURLChanged");
+    function.appendArgument(url);
+    function.call();
+}
+
 void InspectorFrontend::resourceTrackingWasEnabled()
 {
     callSimpleFunction("resourceTrackingWasEnabled");
@@ -232,6 +252,25 @@
     callSimpleFunction("resourceTrackingWasDisabled");
 }
 
+
+void InspectorFrontend::searchingForNodeWasEnabled()
+{
+    callSimpleFunction("searchingForNodeWasEnabled");
+}
+
+void InspectorFrontend::searchingForNodeWasDisabled()
+{
+    callSimpleFunction("searchingForNodeWasDisabled");
+}
+
+void InspectorFrontend::updatePauseOnExceptionsState(long state)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("updatePauseOnExceptionsState");
+    function.appendArgument(state);
+    function.call();
+}
+
 void InspectorFrontend::timelineProfilerWasStarted()
 {
     callSimpleFunction("timelineProfilerWasStarted");
@@ -250,7 +289,7 @@
     function.call();
 }
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
 void InspectorFrontend::attachDebuggerWhenShown()
 {
     callSimpleFunction("attachDebuggerWhenShown");
@@ -266,24 +305,36 @@
     callSimpleFunction("debuggerWasDisabled");
 }
 
-void InspectorFrontend::parsedScriptSource(const JSC::SourceCode& source)
+void InspectorFrontend::parsedScriptSource(const String& sourceID, const String& url, const String& data, int firstLine)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("parsedScriptSource");
-    function.appendArgument(JSC::UString(JSC::UString::from(source.provider()->asID())));
-    function.appendArgument(source.provider()->url());
-    function.appendArgument(JSC::UString(source.data(), source.length()));
-    function.appendArgument(source.firstLine());
+    function.appendArgument(sourceID);
+    function.appendArgument(url);
+    function.appendArgument(data);
+    function.appendArgument(firstLine);
     function.call();
 }
 
-void InspectorFrontend::failedToParseScriptSource(const JSC::SourceCode& source, int errorLine, const JSC::UString& errorMessage)
+void InspectorFrontend::restoredBreakpoint(const String& sourceID, const String& url, int line, bool enabled, const String& condition)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch");
+    function.appendArgument("restoredBreakpoint");
+    function.appendArgument(sourceID);
+    function.appendArgument(url);
+    function.appendArgument(line);
+    function.appendArgument(enabled);
+    function.appendArgument(condition);
+    function.call();
+}
+
+void InspectorFrontend::failedToParseScriptSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("failedToParseScriptSource");
-    function.appendArgument(source.provider()->url());
-    function.appendArgument(JSC::UString(source.data(), source.length()));
-    function.appendArgument(source.firstLine());
+    function.appendArgument(url);
+    function.appendArgument(data);
+    function.appendArgument(firstLine);
     function.appendArgument(errorLine);
     function.appendArgument(errorMessage);
     function.call();
@@ -302,9 +353,7 @@
 {
     callSimpleFunction("resumedScript");
 }
-#endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
 void InspectorFrontend::profilerWasEnabled()
 {
     callSimpleFunction("profilerWasEnabled");
@@ -331,7 +380,7 @@
     function.call();
 }
 
-void InspectorFrontend::didGetProfileHeaders(int callId, const ScriptArray& headers)
+void InspectorFrontend::didGetProfileHeaders(long callId, const ScriptArray& headers)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetProfileHeaders");
@@ -340,7 +389,7 @@
     function.call();
 }
 
-void InspectorFrontend::didGetProfile(int callId, const ScriptValue& profile)
+void InspectorFrontend::didGetProfile(long callId, const ScriptValue& profile)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetProfile");
@@ -366,7 +415,7 @@
     function.call();
 }
 
-void InspectorFrontend::setChildNodes(int parentId, const ScriptArray& nodes)
+void InspectorFrontend::setChildNodes(long parentId, const ScriptArray& nodes)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("setChildNodes");
@@ -375,7 +424,7 @@
     function.call();
 }
 
-void InspectorFrontend::childNodeCountUpdated(int id, int newValue)
+void InspectorFrontend::childNodeCountUpdated(long id, int newValue)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("childNodeCountUpdated");
@@ -384,7 +433,7 @@
     function.call();
 }
 
-void InspectorFrontend::childNodeInserted(int parentId, int prevId, const ScriptObject& node)
+void InspectorFrontend::childNodeInserted(long parentId, long prevId, const ScriptObject& node)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("childNodeInserted");
@@ -394,7 +443,7 @@
     function.call();
 }
 
-void InspectorFrontend::childNodeRemoved(int parentId, int id)
+void InspectorFrontend::childNodeRemoved(long parentId, long id)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("childNodeRemoved");
@@ -403,7 +452,7 @@
     function.call();
 }
 
-void InspectorFrontend::attributesUpdated(int id, const ScriptArray& attributes)
+void InspectorFrontend::attributesUpdated(long id, const ScriptArray& attributes)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("attributesUpdated");
@@ -412,7 +461,7 @@
     function.call();
 }
 
-void InspectorFrontend::didRemoveNode(int callId, int nodeId)
+void InspectorFrontend::didRemoveNode(long callId, long nodeId)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didRemoveNode");
@@ -421,7 +470,16 @@
     function.call();
 }
 
-void InspectorFrontend::didGetChildNodes(int callId)
+void InspectorFrontend::didChangeTagName(long callId, long nodeId)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didChangeTagName");
+    function.appendArgument(callId);
+    function.appendArgument(nodeId);
+    function.call();
+}
+
+void InspectorFrontend::didGetChildNodes(long callId)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetChildNodes");
@@ -429,7 +487,7 @@
     function.call();
 }
 
-void InspectorFrontend::didApplyDomChange(int callId, bool success)
+void InspectorFrontend::didApplyDomChange(long callId, bool success)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didApplyDomChange");
@@ -438,7 +496,7 @@
     function.call();
 }
 
-void InspectorFrontend::didGetEventListenersForNode(int callId, int nodeId, ScriptArray& listenersArray)
+void InspectorFrontend::didGetEventListenersForNode(long callId, long nodeId, const ScriptArray& listenersArray)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetEventListenersForNode");
@@ -448,7 +506,121 @@
     function.call();
 }
 
-void InspectorFrontend::didGetCookies(int callId, const ScriptArray& cookies, const String& cookiesString)
+void InspectorFrontend::didGetStyles(long callId, const ScriptValue& styles)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didGetStyles");
+    function.appendArgument(callId);
+    function.appendArgument(styles);
+    function.call();
+}
+
+void InspectorFrontend::didGetAllStyles(long callId, const ScriptArray& styles)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch");
+    function.appendArgument("didGetAllStyles");
+    function.appendArgument(callId);
+    function.appendArgument(styles);
+    function.call();
+}
+
+void InspectorFrontend::didGetComputedStyle(long callId, const ScriptValue& style)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didGetComputedStyle");
+    function.appendArgument(callId);
+    function.appendArgument(style);
+    function.call();
+}
+
+void InspectorFrontend::didGetInlineStyle(long callId, const ScriptValue& style)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didGetInlineStyle");
+    function.appendArgument(callId);
+    function.appendArgument(style);
+    function.call();
+}
+
+void InspectorFrontend::didApplyStyleText(long callId, bool success, const ScriptValue& style, const ScriptArray& changedProperties)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didApplyStyleText");
+    function.appendArgument(callId);
+    function.appendArgument(success);
+    function.appendArgument(style);
+    function.appendArgument(changedProperties);
+    function.call();
+}
+
+void InspectorFrontend::didSetStyleText(long callId, bool success)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didSetStyleText");
+    function.appendArgument(callId);
+    function.appendArgument(success);
+    function.call();
+}
+
+void InspectorFrontend::didSetStyleProperty(long callId, bool success)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didSetStyleProperty");
+    function.appendArgument(callId);
+    function.appendArgument(success);
+    function.call();
+}
+
+void InspectorFrontend::didToggleStyleEnabled(long callId, const ScriptValue& style)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didToggleStyleEnabled");
+    function.appendArgument(callId);
+    function.appendArgument(style);
+    function.call();
+}
+
+void InspectorFrontend::didSetRuleSelector(long callId, const ScriptValue& rule, bool selectorAffectsNode)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didSetRuleSelector");
+    function.appendArgument(callId);
+    function.appendArgument(rule);
+    function.appendArgument(selectorAffectsNode);
+    function.call();
+}
+
+void InspectorFrontend::didAddRule(long callId, const ScriptValue& rule, bool selectorAffectsNode)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didAddRule");
+    function.appendArgument(callId);
+    function.appendArgument(rule);
+    function.appendArgument(selectorAffectsNode);
+    function.call();
+}
+
+#if ENABLE(WORKERS)
+void InspectorFrontend::didCreateWorker(const InspectorWorkerResource& worker)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch");
+    function.appendArgument("didCreateWorker");
+    function.appendArgument(worker.id());
+    function.appendArgument(worker.url());
+    function.appendArgument(worker.isSharedWorker());
+    function.call();
+}
+
+void InspectorFrontend::didDestroyWorker(const InspectorWorkerResource& worker)
+{
+    ScriptFunctionCall function(m_webInspector, "dispatch"); 
+    function.appendArgument("didDestroyWorker");
+    function.appendArgument(worker.id());
+    function.call();
+}
+#endif // ENABLE(WORKERS)
+
+void InspectorFrontend::didGetCookies(long callId, const ScriptArray& cookies, const String& cookiesString)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetCookies");
@@ -458,7 +630,7 @@
     function.call();
 }
 
-void InspectorFrontend::didDispatchOnInjectedScript(int callId, SerializedScriptValue* result, bool isException)
+void InspectorFrontend::didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didDispatchOnInjectedScript");
@@ -491,7 +663,8 @@
     function.appendArgument(databaseId);
     function.call();
 }
-void InspectorFrontend::didGetDatabaseTableNames(int callId, const ScriptArray& tableNames)
+
+void InspectorFrontend::didGetDatabaseTableNames(long callId, const ScriptArray& tableNames)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetDatabaseTableNames");
@@ -512,7 +685,7 @@
     return !hadException;
 }
 
-void InspectorFrontend::selectDOMStorage(int storageId)
+void InspectorFrontend::selectDOMStorage(long storageId)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("selectDOMStorage");
@@ -520,7 +693,7 @@
     function.call();
 }
 
-void InspectorFrontend::didGetDOMStorageEntries(int callId, const ScriptArray& entries)
+void InspectorFrontend::didGetDOMStorageEntries(long callId, const ScriptArray& entries)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didGetDOMStorageEntries");
@@ -529,7 +702,7 @@
     function.call();
 }
 
-void InspectorFrontend::didSetDOMStorageItem(int callId, bool success)
+void InspectorFrontend::didSetDOMStorageItem(long callId, bool success)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didSetDOMStorageItem");
@@ -538,7 +711,7 @@
     function.call();
 }
 
-void InspectorFrontend::didRemoveDOMStorageItem(int callId, bool success)
+void InspectorFrontend::didRemoveDOMStorageItem(long callId, bool success)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("didRemoveDOMStorageItem");
@@ -547,7 +720,7 @@
     function.call();
 }
 
-void InspectorFrontend::updateDOMStorage(int storageId)
+void InspectorFrontend::updateDOMStorage(long storageId)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("updateDOMStorage");
@@ -577,7 +750,7 @@
     callSimpleFunction("contextMenuCleared");
 }
 
-void InspectorFrontend::evaluateForTestInFrontend(int callId, const String& script)
+void InspectorFrontend::evaluateForTestInFrontend(long callId, const String& script)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch"); 
     function.appendArgument("evaluateForTestInFrontend");
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index 1a37256..0e7d7b3 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -35,29 +35,24 @@
 #include "ScriptState.h"
 #include <wtf/PassOwnPtr.h>
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-namespace JSC {
-    class JSValue;
-    class SourceCode;
-    class UString;
-}
-#endif
-
 namespace WebCore {
     class ConsoleMessage;
     class Database;
     class Frame;
-    class InspectorController;
     class InspectorResource;
     class Node;
     class ScriptString;
     class SerializedScriptValue;
     class Storage;
+    class InspectorWorkerResource;
 
     class InspectorFrontend : public Noncopyable {
     public:
-        InspectorFrontend(InspectorController* inspectorController, ScriptObject webInspector);
+        InspectorFrontend(ScriptObject webInspector);
         ~InspectorFrontend();
+        
+        void close();
+        void inspectedPageDestroyed();
 
         ScriptArray newScriptArray();
         ScriptObject newScriptObject();
@@ -67,74 +62,100 @@
         void populateFrontendSettings(const String& settings);
 
         void updateConsoleMessageExpiredCount(unsigned count);
-        void addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, ScriptState*, const Vector<ScriptValue> arguments, const String& message);
+        void addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<RefPtr<SerializedScriptValue> >& arguments, const String& message);
         void updateConsoleMessageRepeatCount(unsigned count);
         void clearConsoleMessages();
 
         bool updateResource(unsigned long identifier, const ScriptObject& resourceObj);
         void removeResource(unsigned long identifier);
-        void didGetResourceContent(int callId, const String& content);
+        void didGetResourceContent(long callId, const String& content);
 
         void updateFocusedNode(long nodeId);
         void setAttachedWindow(bool attached);
         void showPanel(int panel);
         void populateInterface();
         void reset();
+        
+        void bringToFront();
+        void inspectedURLChanged(const String&);
 
         void resourceTrackingWasEnabled();
         void resourceTrackingWasDisabled();
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
+        void searchingForNodeWasEnabled();
+        void searchingForNodeWasDisabled();
+
+        void updatePauseOnExceptionsState(long state);
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
         void attachDebuggerWhenShown();
         void debuggerWasEnabled();
         void debuggerWasDisabled();
-        void parsedScriptSource(const JSC::SourceCode&);
-        void failedToParseScriptSource(const JSC::SourceCode&, int errorLine, const JSC::UString& errorMessage);
+
+        void parsedScriptSource(const String& sourceID, const String& url, const String& data, int firstLine);
+        void restoredBreakpoint(const String& sourceID, const String& url, int line, bool enabled, const String& condition);
+        void failedToParseScriptSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
         void pausedScript(SerializedScriptValue* callFrames);
         void resumedScript();
-#endif
-#if ENABLE(JAVASCRIPT_DEBUGGER)
+
         void profilerWasEnabled();
         void profilerWasDisabled();
         void addProfileHeader(const ScriptValue& profile);
         void setRecordingProfile(bool isProfiling);
-        void didGetProfileHeaders(int callId, const ScriptArray& headers);
-        void didGetProfile(int callId, const ScriptValue& profile);
+        void didGetProfileHeaders(long callId, const ScriptArray& headers);
+        void didGetProfile(long callId, const ScriptValue& profile);
 #endif
 
 #if ENABLE(DATABASE)
         bool addDatabase(const ScriptObject& dbObj);
         void selectDatabase(int databaseId);
-        void didGetDatabaseTableNames(int callId, const ScriptArray& tableNames);
+        void didGetDatabaseTableNames(long callId, const ScriptArray& tableNames);
 #endif
         
 #if ENABLE(DOM_STORAGE)
         bool addDOMStorage(const ScriptObject& domStorageObj);
-        void selectDOMStorage(int storageId);
-        void didGetDOMStorageEntries(int callId, const ScriptArray& entries);
-        void didSetDOMStorageItem(int callId, bool success);
-        void didRemoveDOMStorageItem(int callId, bool success);
-        void updateDOMStorage(int storageId);
+        void selectDOMStorage(long storageId);
+        void didGetDOMStorageEntries(long callId, const ScriptArray& entries);
+        void didSetDOMStorageItem(long callId, bool success);
+        void didRemoveDOMStorageItem(long callId, bool success);
+        void updateDOMStorage(long storageId);
 #endif
 
         void setDocument(const ScriptObject& root);
         void setDetachedRoot(const ScriptObject& root);
-        void setChildNodes(int parentId, const ScriptArray& nodes);
-        void childNodeCountUpdated(int id, int newValue);
-        void childNodeInserted(int parentId, int prevId, const ScriptObject& node);
-        void childNodeRemoved(int parentId, int id);
-        void attributesUpdated(int id, const ScriptArray& attributes);
-        void didGetChildNodes(int callId);
-        void didApplyDomChange(int callId, bool success);
-        void didGetEventListenersForNode(int callId, int nodeId, ScriptArray& listenersArray);
-        void didRemoveNode(int callId, int nodeId);
+        void setChildNodes(long parentId, const ScriptArray& nodes);
+        void childNodeCountUpdated(long id, int newValue);
+        void childNodeInserted(long parentId, long prevId, const ScriptObject& node);
+        void childNodeRemoved(long parentId, long id);
+        void attributesUpdated(long id, const ScriptArray& attributes);
+        void didGetChildNodes(long callId);
+        void didApplyDomChange(long callId, bool success);
+        void didGetEventListenersForNode(long callId, long nodeId, const ScriptArray& listenersArray);
+        void didRemoveNode(long callId, long nodeId);
+        void didChangeTagName(long callId, long nodeId);
+
+        void didGetStyles(long callId, const ScriptValue& styles);
+        void didGetAllStyles(long callId, const ScriptArray& styles);
+        void didGetInlineStyle(long callId, const ScriptValue& style);
+        void didGetComputedStyle(long callId, const ScriptValue& style);
+        void didApplyStyleText(long callId, bool success, const ScriptValue& style, const ScriptArray& changedProperties);
+        void didSetStyleText(long callId, bool success);
+        void didSetStyleProperty(long callId, bool success);
+        void didToggleStyleEnabled(long callId, const ScriptValue& style);
+        void didSetRuleSelector(long callId, const ScriptValue& rule, bool selectorAffectsNode);
+        void didAddRule(long callId, const ScriptValue& rule, bool selectorAffectsNode);
 
         void timelineProfilerWasStarted();
         void timelineProfilerWasStopped();
         void addRecordToTimeline(const ScriptObject&);
 
-        void didGetCookies(int callId, const ScriptArray& cookies, const String& cookiesString);
-        void didDispatchOnInjectedScript(int callId, SerializedScriptValue* result, bool isException);
+#if ENABLE(WORKERS)
+        void didCreateWorker(const InspectorWorkerResource&);
+        void didDestroyWorker(const InspectorWorkerResource&);
+#endif // ENABLE(WORKER)
+
+        void didGetCookies(long callId, const ScriptArray& cookies, const String& cookiesString);
+        void didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);
 
         void addNodesToSearchResult(const String& nodeIds);
 
@@ -143,10 +164,9 @@
 
         ScriptState* scriptState() const { return m_webInspector.scriptState(); }
 
-        void evaluateForTestInFrontend(int callId, const String& script);
+        void evaluateForTestInFrontend(long callId, const String& script);
     private:
         void callSimpleFunction(const String& functionName);
-        InspectorController* m_inspectorController;
         ScriptObject m_webInspector;
     };
 
diff --git a/WebCore/inspector/InspectorFrontendClient.h b/WebCore/inspector/InspectorFrontendClient.h
new file mode 100644
index 0000000..515388c
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendClient.h
@@ -0,0 +1,66 @@
+/*
+ * 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 InspectorFrontendClient_h
+#define InspectorFrontendClient_h
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class ContextMenuItem;
+class Event;
+class String;
+
+class InspectorFrontendClient {
+public:
+    virtual ~InspectorFrontendClient() { }
+
+    virtual void windowObjectCleared() = 0;
+    virtual void frontendLoaded() = 0;
+
+    virtual void moveWindowBy(float x, float y) = 0;
+
+    virtual String localizedStringsURL() = 0;
+    virtual String hiddenPanels() = 0;
+
+    virtual void bringToFront() = 0;
+    virtual void closeWindow() = 0;
+
+    virtual void requestAttachWindow() = 0;
+    virtual void requestDetachWindow() = 0;
+    virtual void changeAttachedWindowHeight(unsigned) = 0;
+
+    virtual void inspectedURLChanged(const String&) = 0;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/inspector/InspectorFrontendClientLocal.cpp b/WebCore/inspector/InspectorFrontendClientLocal.cpp
new file mode 100644
index 0000000..18c52da
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendClientLocal.cpp
@@ -0,0 +1,167 @@
+/*
+ * 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 "InspectorFrontendClientLocal.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Chrome.h"
+#include "FloatRect.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "InspectorController.h"
+#include "InspectorFrontend.h"
+#include "InspectorFrontendHost.h"
+#include "Page.h"
+#include "PlatformString.h"
+#include "ScriptFunctionCall.h"
+#include "ScriptObject.h"
+
+namespace WebCore {
+
+static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
+static const unsigned defaultAttachedHeight = 300;
+static const float minimumAttachedHeight = 250.0f;
+static const float maximumAttachedHeightRatio = 0.75f;
+
+InspectorFrontendClientLocal::InspectorFrontendClientLocal(InspectorController* inspectorController, Page* frontendPage)
+    : m_inspectorController(inspectorController)
+    , m_frontendPage(frontendPage)
+    , m_frontendScriptState(0)
+{
+}
+
+InspectorFrontendClientLocal::~InspectorFrontendClientLocal()
+{
+    if (m_frontendHost)
+        m_frontendHost->disconnectClient();
+    m_frontendScriptState = 0;
+    m_frontendPage = 0;
+    m_inspectorController = 0;
+}
+    
+void InspectorFrontendClientLocal::windowObjectCleared()
+{
+    // Grant the inspector the ability to script the inspected page.
+    m_frontendPage->mainFrame()->document()->securityOrigin()->grantUniversalAccess();
+    // FIXME: don't keep reference to the script state
+    m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
+    ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorController->inspectorBackend());
+    m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
+    ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get());
+}
+
+void InspectorFrontendClientLocal::frontendLoaded()
+{
+    bringToFront();
+    // Create InspectorFrontend and set it to InspectorController.
+    ASSERT(m_frontendScriptState);
+    ScriptObject webInspectorObj;
+    if (!ScriptGlobalObject::get(m_frontendScriptState, "WebInspector", webInspectorObj)) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    m_inspectorController->setFrontend(new InspectorFrontend(webInspectorObj));
+}
+
+void InspectorFrontendClientLocal::requestAttachWindow()
+{
+    if (!canAttachWindow())
+        return;
+    attachWindow();
+    setAttachedWindow(true);
+}
+
+void InspectorFrontendClientLocal::requestDetachWindow()
+{
+    detachWindow();
+    setAttachedWindow(false);
+}
+
+bool InspectorFrontendClientLocal::canAttachWindow()
+{
+    unsigned inspectedPageHeight = m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
+
+    // Don't allow the attach if the window would be too small to accommodate the minimum inspector height.
+    return minimumAttachedHeight <= inspectedPageHeight * maximumAttachedHeightRatio;
+}
+
+void InspectorFrontendClientLocal::changeAttachedWindowHeight(unsigned height)
+{
+    unsigned totalHeight = m_frontendPage->mainFrame()->view()->visibleHeight() + m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
+    unsigned attachedHeight = constrainedAttachedWindowHeight(height, totalHeight);
+    m_inspectorController->setSetting(inspectorAttachedHeightName, String::number(attachedHeight));
+    setAttachedWindowHeight(attachedHeight);
+}
+
+void InspectorFrontendClientLocal::moveWindowBy(float x, float y)
+{
+    FloatRect frameRect = m_frontendPage->chrome()->windowRect();
+    frameRect.move(x, y);
+    m_frontendPage->chrome()->setWindowRect(frameRect);
+}
+
+void InspectorFrontendClientLocal::setAttachedWindow(bool attached)
+{
+    ScriptObject webInspectorObj;
+    if (!ScriptGlobalObject::get(m_frontendScriptState, "WebInspector", webInspectorObj)) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    ScriptFunctionCall function(webInspectorObj, "dispatch"); 
+    function.appendArgument("setAttachedWindow");
+    function.appendArgument(attached);
+    function.call();
+}
+
+void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
+{
+    unsigned inspectedPageHeight = m_inspectorController->inspectedPage()->mainFrame()->view()->visibleHeight();
+    String attachedHeight = m_inspectorController->setting(inspectorAttachedHeightName);
+    bool success = true;
+    int height = attachedHeight.toInt(&success);
+    unsigned preferredHeight = success ? height : defaultAttachedHeight;
+    
+    // This call might not go through (if the window starts out detached), but if the window is initially created attached,
+    // InspectorController::attachWindow is never called, so we need to make sure to set the attachedWindowHeight.
+    // FIXME: Clean up code so we only have to call setAttachedWindowHeight in InspectorController::attachWindow
+    setAttachedWindowHeight(constrainedAttachedWindowHeight(preferredHeight, inspectedPageHeight));
+}
+
+unsigned InspectorFrontendClientLocal::constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight)
+{
+    using namespace std;
+    return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
+}
+    
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/inspector/InspectorFrontendClientLocal.h b/WebCore/inspector/InspectorFrontendClientLocal.h
new file mode 100644
index 0000000..ce661fe
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendClientLocal.h
@@ -0,0 +1,80 @@
+/*
+ * 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 InspectorFrontendClientLocal_h
+#define InspectorFrontendClientLocal_h
+
+#include "InspectorFrontendClient.h"
+#include "ScriptState.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class InspectorController;
+class InspectorFrontendHost;
+class Page;
+
+class InspectorFrontendClientLocal : public InspectorFrontendClient, public Noncopyable {
+public:
+    InspectorFrontendClientLocal(InspectorController*, Page*);
+    virtual ~InspectorFrontendClientLocal();
+    
+    virtual void windowObjectCleared();
+    virtual void frontendLoaded();
+
+    virtual void moveWindowBy(float x, float y);
+
+    virtual void requestAttachWindow();
+    virtual void requestDetachWindow();
+    virtual void changeAttachedWindowHeight(unsigned);
+
+    virtual void attachWindow() = 0;
+    virtual void detachWindow() = 0;
+    bool canAttachWindow();
+
+protected:
+    virtual void setAttachedWindowHeight(unsigned) = 0;
+    void setAttachedWindow(bool);
+    void restoreAttachedWindowHeight();
+
+private:
+    static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight);
+
+    friend class FrontendMenuProvider;
+    InspectorController* m_inspectorController;
+    Page* m_frontendPage;
+    ScriptState* m_frontendScriptState;
+    // TODO(yurys): this ref shouldn't be needed.
+    RefPtr<InspectorFrontendHost> m_frontendHost;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp
index 1aeb1d7..70fc3ad 100644
--- a/WebCore/inspector/InspectorFrontendHost.cpp
+++ b/WebCore/inspector/InspectorFrontendHost.cpp
@@ -41,11 +41,11 @@
 #include "FrameLoader.h"
 #include "HitTestResult.h"
 #include "HTMLFrameOwnerElement.h"
-#include "InspectorClient.h"
-#include "InspectorFrontend.h"
+#include "InspectorFrontendClient.h"
 #include "InspectorResource.h"
 #include "Page.h"
 #include "Pasteboard.h"
+#include "ScriptFunctionCall.h"
 
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
@@ -54,58 +54,142 @@
 
 namespace WebCore {
 
-InspectorFrontendHost::InspectorFrontendHost(InspectorController* inspectorController, InspectorClient* client)
-    : m_inspectorController(inspectorController)
-    , m_client(client)
+#if ENABLE(CONTEXT_MENUS)
+class FrontendMenuProvider : public ContextMenuProvider {
+public:
+    static PassRefPtr<FrontendMenuProvider> create(InspectorFrontendHost* frontendHost, ScriptObject webInspector, const Vector<ContextMenuItem*>& items)
+    {
+        return adoptRef(new FrontendMenuProvider(frontendHost, webInspector, items));
+    }
+    
+    void disconnect()
+    {
+        m_webInspector = ScriptObject();
+        m_frontendHost = 0;
+    }
+    
+private:
+    FrontendMenuProvider(InspectorFrontendHost* frontendHost, ScriptObject webInspector,  const Vector<ContextMenuItem*>& items)
+        : m_frontendHost(frontendHost)
+        , m_webInspector(webInspector)
+        , m_items(items)
+    {
+    }
+
+    virtual ~FrontendMenuProvider()
+    {
+        contextMenuCleared();
+    }
+    
+    virtual void populateContextMenu(ContextMenu* menu)
+    {
+        for (size_t i = 0; i < m_items.size(); ++i)
+            menu->appendItem(*m_items[i]);
+    }
+    
+    virtual void contextMenuItemSelected(ContextMenuItem* item)
+    {
+        if (m_frontendHost) {
+            int itemNumber = item->action() - ContextMenuItemBaseCustomTag;
+
+            ScriptFunctionCall function(m_webInspector, "dispatch");
+            function.appendArgument("contextMenuItemSelected");
+            function.appendArgument(itemNumber);
+            function.call();
+        }
+    }
+    
+    virtual void contextMenuCleared()
+    {
+        if (m_frontendHost) {
+            ScriptFunctionCall function(m_webInspector, "dispatch");
+            function.appendArgument("contextMenuCleared");
+            function.call();
+
+            m_frontendHost->m_menuProvider = 0;
+        }
+        deleteAllValues(m_items);
+        m_items.clear();
+    }
+
+    InspectorFrontendHost* m_frontendHost;
+    ScriptObject m_webInspector;
+    Vector<ContextMenuItem*> m_items;
+};
+#endif
+
+InspectorFrontendHost::InspectorFrontendHost(InspectorFrontendClient* client, Page* frontendPage)
+    : m_client(client)
+    , m_frontendPage(frontendPage)
+#if ENABLE(CONTEXT_MENUS)
+    , m_menuProvider(0)
+#endif
 {
 }
 
 InspectorFrontendHost::~InspectorFrontendHost()
 {
+    ASSERT(!m_client);
+}
+
+void InspectorFrontendHost::disconnectClient()
+{
+    m_client = 0;
+#if ENABLE(CONTEXT_MENUS)
     if (m_menuProvider)
         m_menuProvider->disconnect();
+#endif
+    m_frontendPage = 0;
 }
 
 void InspectorFrontendHost::loaded()
 {
-    if (m_inspectorController)
-        m_inspectorController->scriptObjectReady();
+    if (m_client)
+        m_client->frontendLoaded();
 }
 
-void InspectorFrontendHost::attach()
+void InspectorFrontendHost::requestAttachWindow()
 {
-    if (m_inspectorController)
-        m_inspectorController->attachWindow();
+    if (m_client)
+        m_client->requestAttachWindow();
 }
 
-void InspectorFrontendHost::detach()
+void InspectorFrontendHost::requestDetachWindow()
 {
-    if (m_inspectorController)
-        m_inspectorController->detachWindow();
+    if (m_client)
+        m_client->requestDetachWindow();
 }
 
 void InspectorFrontendHost::closeWindow()
 {
-    if (m_inspectorController)
-        m_inspectorController->closeWindow();
+    if (m_client) {
+        m_client->closeWindow();
+        disconnectClient(); // Disconnect from client.
+    }
 }
 
-void InspectorFrontendHost::windowUnloading()
+void InspectorFrontendHost::bringToFront()
 {
-    if (m_inspectorController)
-        m_inspectorController->close();
+    if (m_client)
+        m_client->bringToFront();
+}
+
+void InspectorFrontendHost::inspectedURLChanged(const String& newURL)
+{
+    if (m_client)
+        m_client->inspectedURLChanged(newURL);
 }
 
 void InspectorFrontendHost::setAttachedWindowHeight(unsigned height)
 {
-    if (m_inspectorController)
-        m_inspectorController->setAttachedWindowHeight(height);
+    if (m_client)
+        m_client->changeAttachedWindowHeight(height);
 }
 
 void InspectorFrontendHost::moveWindowBy(float x, float y) const
 {
-    if (m_inspectorController)
-        m_inspectorController->moveWindowBy(x, y);
+    if (m_client)
+        m_client->moveWindowBy(x, y);
 }
 
 String InspectorFrontendHost::localizedStringsURL()
@@ -118,67 +202,27 @@
     return m_client->hiddenPanels();
 }
 
-const String& InspectorFrontendHost::platform() const
-{
-#if PLATFORM(MAC)
-    DEFINE_STATIC_LOCAL(const String, platform, ("mac"));
-#elif OS(WINDOWS)
-    DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
-#elif OS(LINUX)
-    DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
-#else
-    DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
-#endif
-    return platform;
-}
-
-const String& InspectorFrontendHost::port() const
-{
-#if PLATFORM(QT)
-    DEFINE_STATIC_LOCAL(const String, port, ("qt"));
-#elif PLATFORM(GTK)
-    DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
-#elif PLATFORM(WX)
-    DEFINE_STATIC_LOCAL(const String, port, ("wx"));
-#else
-    DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
-#endif
-
-    return port;
-}
-
 void InspectorFrontendHost::copyText(const String& text)
 {
     Pasteboard::generalPasteboard()->writePlainText(text);
 }
 
+#if ENABLE(CONTEXT_MENUS)
 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items)
 {
-    if (!m_inspectorController)
+    ASSERT(m_frontendPage);
+    ScriptState* frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
+    ScriptObject webInspectorObj;
+    if (!ScriptGlobalObject::get(frontendScriptState, "WebInspector", webInspectorObj)) {
+        ASSERT_NOT_REACHED();
         return;
-    if (!m_inspectorController->windowVisible())
-        return;
-
-
-    m_menuProvider = MenuProvider::create(this, items);
-    ContextMenuController* menuController = m_inspectorController->m_page->contextMenuController();
-    menuController->showContextMenu(event, m_menuProvider);
-}
-
-void InspectorFrontendHost::contextMenuItemSelected(ContextMenuItem* item)
-{
-    if (m_inspectorController && m_inspectorController->windowVisible()) {
-        int itemNumber = item->action() - ContextMenuItemBaseCustomTag;
-        m_inspectorController->m_frontend->contextMenuItemSelected(itemNumber);
     }
+    RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(this, webInspectorObj, items);
+    ContextMenuController* menuController = m_frontendPage->contextMenuController();
+    menuController->showContextMenu(event, menuProvider);
+    m_menuProvider = menuProvider.get();
 }
-
-void InspectorFrontendHost::contextMenuCleared()
-{
-    m_menuProvider = 0;
-    if (m_inspectorController && m_inspectorController->windowVisible())
-        m_inspectorController->m_frontend->contextMenuCleared();
-}
+#endif
 
 } // namespace WebCore
 
diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h
index 390b018..4d3e0d1 100644
--- a/WebCore/inspector/InspectorFrontendHost.h
+++ b/WebCore/inspector/InspectorFrontendHost.h
@@ -42,36 +42,34 @@
 
 class ContextMenuItem;
 class Event;
+class FrontendMenuProvider;
 class InspectorClient;
+class InspectorFrontendClient;
 class Node;
 
 class InspectorFrontendHost : public RefCounted<InspectorFrontendHost>
 {
 public:
-    static PassRefPtr<InspectorFrontendHost> create(InspectorController* inspectorController, InspectorClient* client)
+    static PassRefPtr<InspectorFrontendHost> create(InspectorFrontendClient* client, Page* frontendPage)
     {
-        return adoptRef(new InspectorFrontendHost(inspectorController, client));
+        return adoptRef(new InspectorFrontendHost(client, frontendPage));
     }
 
     ~InspectorFrontendHost();
-
-    InspectorController* inspectorController() { return m_inspectorController; }
-
-    void disconnectController() { m_inspectorController = 0; }
+    void disconnectClient();
 
     void loaded();
-    void attach();
-    void detach();
+    void requestAttachWindow();
+    void requestDetachWindow();
     void closeWindow();
-    void windowUnloading();
+    void bringToFront();
+    void inspectedURLChanged(const String&);
 
     void setAttachedWindowHeight(unsigned height);
     void moveWindowBy(float x, float y) const;
 
     String localizedStringsURL();
     String hiddenPanels();
-    const String& platform() const;
-    const String& port() const;
 
     void copyText(const String& text);
 
@@ -79,59 +77,16 @@
     void showContextMenu(Event*, const Vector<ContextMenuItem*>& items);
 
 private:
-    class MenuProvider : public ContextMenuProvider {
-    public:
-        static PassRefPtr<MenuProvider> create(InspectorFrontendHost* frontendHost, const Vector<ContextMenuItem*>& items)
-        {
-            return adoptRef(new MenuProvider(frontendHost, items));
-        }
+#if ENABLE(CONTEXT_MENUS)
+    friend class FrontendMenuProvider;
+#endif
+    InspectorFrontendHost(InspectorFrontendClient* client, Page* frontendPage);
 
-        virtual ~MenuProvider()
-        {
-            contextMenuCleared();
-        }
-
-        void disconnect()
-        {
-            m_frontendHost = 0;
-        }
-
-        virtual void populateContextMenu(ContextMenu* menu)
-        {
-            for (size_t i = 0; i < m_items.size(); ++i)
-                menu->appendItem(*m_items[i]);
-        }
-
-        virtual void contextMenuItemSelected(ContextMenuItem* item)
-        {
-            if (m_frontendHost)
-                m_frontendHost->contextMenuItemSelected(item);
-        }
-
-        virtual void contextMenuCleared()
-        {
-            if (m_frontendHost)
-                m_frontendHost->contextMenuCleared();
-            deleteAllValues(m_items);
-            m_items.clear();
-        }
-
-    private:
-        MenuProvider(InspectorFrontendHost* frontendHost,  const Vector<ContextMenuItem*>& items)
-            : m_frontendHost(frontendHost)
-            , m_items(items) { }
-        InspectorFrontendHost* m_frontendHost;
-        Vector<ContextMenuItem*> m_items;
-    };
-
-    InspectorFrontendHost(InspectorController* inspectorController, InspectorClient* client);
-
-    void contextMenuItemSelected(ContextMenuItem*);
-    void contextMenuCleared();
-
-    InspectorController* m_inspectorController;
-    InspectorClient* m_client;
-    RefPtr<MenuProvider> m_menuProvider;
+    InspectorFrontendClient* m_client;
+    Page* m_frontendPage;
+#if ENABLE(CONTEXT_MENUS)
+    FrontendMenuProvider* m_menuProvider;
+#endif
 };
 
 } // namespace WebCore
diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl
index 9de49c1..1139a1c 100644
--- a/WebCore/inspector/InspectorFrontendHost.idl
+++ b/WebCore/inspector/InspectorFrontendHost.idl
@@ -33,21 +33,22 @@
 module core {
     interface [Conditional=INSPECTOR] InspectorFrontendHost {
         void loaded();
-        void attach();
-        void detach();
         void closeWindow();
-        void windowUnloading();
+        void bringToFront();
+        void inspectedURLChanged(in DOMString newURL);
 
+        void requestAttachWindow();
+        void requestDetachWindow();
         void setAttachedWindowHeight(in unsigned long height);
         void moveWindowBy(in float x, in float y);
 
         DOMString localizedStringsURL();
         DOMString hiddenPanels();
-        DOMString platform();
-        DOMString port();
 
         void copyText(in DOMString text);
 
+        [Custom] DOMString platform();
+        [Custom] DOMString port();
         [Custom] void showContextMenu(in MouseEvent event, in DOMObject items);
     };
 }
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 6f08d58..51ed290 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -180,7 +180,7 @@
     }
 
     if (m_changes.hasChange(LengthChange)) {
-        jsonObject.set("contentLength", m_length);
+        jsonObject.set("resourceSize", m_length);
         jsonObject.set("didLengthChange", true);
     }
 
@@ -213,17 +213,15 @@
         m_changes.clearAll();
 }
 
-void InspectorResource::releaseScriptObject(InspectorFrontend* frontend, bool callRemoveResource)
+void InspectorResource::releaseScriptObject(InspectorFrontend* frontend)
 {
     m_changes.setAll();
 
     for (size_t i = 0; i < m_redirects.size(); ++i)
-        m_redirects[i]->releaseScriptObject(frontend, callRemoveResource);
+        m_redirects[i]->releaseScriptObject(frontend);
 
-    if (!callRemoveResource)
-        return;
-
-    frontend->removeResource(m_identifier);
+    if (frontend)
+        frontend->removeResource(m_identifier);
 }
 
 CachedResource* InspectorResource::cachedResource() const
@@ -264,8 +262,8 @@
 
 InspectorResource::Type InspectorResource::type() const
 {
-    if (!m_xmlHttpResponseText.isNull())
-        return XHR;
+    if (!m_overrideContent.isNull())
+        return m_overrideContentType;
 
     if (m_requestURL == m_loader->requestURL()) {
         InspectorResource::Type resourceType = cachedResourceType();
@@ -281,16 +279,17 @@
     return cachedResourceType();
 }
 
-void InspectorResource::setXMLHttpResponseText(const ScriptString& data)
+void InspectorResource::setOverrideContent(const ScriptString& data, Type type)
 {
-    m_xmlHttpResponseText = data;
+    m_overrideContent = data;
+    m_overrideContentType = type;
     m_changes.set(TypeChange);
 }
 
 String InspectorResource::sourceString() const
 {
-    if (!m_xmlHttpResponseText.isNull())
-        return String(m_xmlHttpResponseText);
+    if (!m_overrideContent.isNull())
+        return String(m_overrideContent);
 
     String textEncodingName;
     RefPtr<SharedBuffer> buffer = resourceData(&textEncodingName);
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index d347e5c..30b1280 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -79,12 +79,12 @@
 
         PassRefPtr<InspectorResource> appendRedirect(unsigned long identifier, const KURL& redirectURL);
         void updateScriptObject(InspectorFrontend* frontend);
-        void releaseScriptObject(InspectorFrontend* frontend, bool callRemoveResource);
+        void releaseScriptObject(InspectorFrontend* frontend);
 
         void updateRequest(const ResourceRequest&);
         void updateResponse(const ResourceResponse&);
 
-        void setXMLHttpResponseText(const ScriptString& data);
+        void setOverrideContent(const ScriptString& data, Type);
 
         String sourceString() const;
         PassRefPtr<SharedBuffer> resourceData(String* textEncodingName) const;
@@ -171,7 +171,8 @@
         double m_endTime;
         double m_loadEventTime;
         double m_domContentEventTime;
-        ScriptString m_xmlHttpResponseText;
+        ScriptString m_overrideContent;
+        Type m_overrideContentType;
         Changes m_changes;
         bool m_isMainResource;
         String m_requestMethod;
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index cbf6ee1..c0278c2 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -44,14 +44,47 @@
 
 namespace WebCore {
 
+int InspectorTimelineAgent::s_instanceCount = 0;
+
 InspectorTimelineAgent::InspectorTimelineAgent(InspectorFrontend* frontend)
     : m_frontend(frontend)
 {
+    ++s_instanceCount;
+    ScriptGCEvent::addEventListener(this);
     ASSERT(m_frontend);
 }
 
+void InspectorTimelineAgent::pushGCEventRecords()
+{
+    for (GCEvents::iterator i = m_gcEvents.begin(); i != m_gcEvents.end(); ++i) {
+        ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, i->startTime);
+        record.set("data", TimelineRecordFactory::createGCEventData(m_frontend, i->collectedBytes));
+        record.set("endTime", i->endTime);
+        addRecordToTimeline(record, GCEventTimelineRecordType);
+    }
+    m_gcEvents.clear();
+}
+
+void InspectorTimelineAgent::didGC(double startTime, double endTime, size_t collectedBytesCount)
+{
+    m_gcEvents.append(GCEvent(startTime, endTime, collectedBytesCount));
+}
+
 InspectorTimelineAgent::~InspectorTimelineAgent()
 {
+    ASSERT(s_instanceCount);
+    --s_instanceCount;
+    ScriptGCEvent::removeEventListener(this);
+}
+
+void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine)
+{
+    pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(m_frontend, scriptName, scriptLine), FunctionCallTimelineRecordType);
+}
+
+void InspectorTimelineAgent::didCallFunction()
+{
+    didCompleteCurrentRecord(FunctionCallTimelineRecordType);
 }
 
 void InspectorTimelineAgent::willDispatchEvent(const Event& event)
@@ -108,17 +141,19 @@
         didCompleteCurrentRecord(ParseHTMLTimelineRecordType);
     }
 }
-   
+
 void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
     record.set("data", TimelineRecordFactory::createTimerInstallData(m_frontend, timerId, timeout, singleShot));
     addRecordToTimeline(record, TimerInstallTimelineRecordType);
 }
 
 void InspectorTimelineAgent::didRemoveTimer(int timerId)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
     record.set("data", TimelineRecordFactory::createGenericTimerData(m_frontend, timerId));
     addRecordToTimeline(record, TimerRemoveTimelineRecordType);
 }
@@ -166,35 +201,66 @@
 void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, bool isMainResource,
     const ResourceRequest& request)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
     record.set("data", TimelineRecordFactory::createResourceSendRequestData(m_frontend, identifier, isMainResource, request));
     record.set("type", ResourceSendRequestTimelineRecordType);
+    setHeapSizeStatistic(record);
     m_frontend->addRecordToTimeline(record);
 }
 
-void InspectorTimelineAgent::didReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response)
+void InspectorTimelineAgent::willReceiveResourceData(unsigned long identifier)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
-    record.set("data", TimelineRecordFactory::createResourceReceiveResponseData(m_frontend, identifier, response));
-    record.set("type", ResourceReceiveResponseTimelineRecordType);
-    m_frontend->addRecordToTimeline(record);
+    pushCurrentRecord(TimelineRecordFactory::createReceiveResourceData(m_frontend, identifier), ReceiveResourceDataTimelineRecordType);
+}
+
+void InspectorTimelineAgent::didReceiveResourceData()
+{
+    didCompleteCurrentRecord(ReceiveResourceDataTimelineRecordType);
+}
+    
+void InspectorTimelineAgent::willReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response)
+{
+    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(m_frontend, identifier, response), ResourceReceiveResponseTimelineRecordType);
+}
+
+void InspectorTimelineAgent::didReceiveResourceResponse()
+{
+    didCompleteCurrentRecord(ResourceReceiveResponseTimelineRecordType);
 }
 
 void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
     record.set("data", TimelineRecordFactory::createResourceFinishData(m_frontend, identifier, didFail));
     record.set("type", ResourceFinishTimelineRecordType);
+    setHeapSizeStatistic(record);
     m_frontend->addRecordToTimeline(record);
 }
 
 void InspectorTimelineAgent::didMarkTimeline(const String& message)
 {
-    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
     record.set("data", TimelineRecordFactory::createMarkTimelineData(m_frontend, message));
     addRecordToTimeline(record, MarkTimelineRecordType);
 }
 
+void InspectorTimelineAgent::didMarkDOMContentEvent()
+{
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
+    addRecordToTimeline(record, MarkDOMContentEventType);
+}
+
+void InspectorTimelineAgent::didMarkLoadEvent()
+{
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
+    addRecordToTimeline(record, MarkLoadEventType);
+}
+
 void InspectorTimelineAgent::reset()
 {
     m_recordStack.clear();
@@ -210,6 +276,7 @@
 void InspectorTimelineAgent::addRecordToTimeline(ScriptObject record, TimelineRecordType type)
 {
     record.set("type", type);
+    setHeapSizeStatistic(record);
     if (m_recordStack.isEmpty())
         m_frontend->addRecordToTimeline(record);
     else {
@@ -218,31 +285,37 @@
     }
 }
 
+void InspectorTimelineAgent::setHeapSizeStatistic(ScriptObject record)
+{
+    size_t usedHeapSize = 0;
+    size_t totalHeapSize = 0;
+    ScriptGCEvent::getHeapSize(usedHeapSize, totalHeapSize);
+    record.set("usedHeapSize", usedHeapSize);
+    record.set("totalHeapSize", totalHeapSize);
+}
+
 void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type)
 {
     // An empty stack could merely mean that the timeline agent was turned on in the middle of
     // an event.  Don't treat as an error.
     if (!m_recordStack.isEmpty()) {
+        pushGCEventRecords();
         TimelineRecordEntry entry = m_recordStack.last();
         m_recordStack.removeLast();
         ASSERT(entry.type == type);
         entry.record.set("data", entry.data);
         entry.record.set("children", entry.children);
-        entry.record.set("endTime", currentTimeInMilliseconds());
+        entry.record.set("endTime", WTF::currentTimeMS());
         addRecordToTimeline(entry.record, type);
     }
 }
 
-double InspectorTimelineAgent::currentTimeInMilliseconds()
-{
-    return currentTime() * 1000.0;
-}
-
 void InspectorTimelineAgent::pushCurrentRecord(ScriptObject data, TimelineRecordType type)
 {
-    m_recordStack.append(TimelineRecordEntry(TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()), data, m_frontend->newScriptArray(), type));
+    pushGCEventRecords();
+    ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS());
+    m_recordStack.append(TimelineRecordEntry(record, data, m_frontend->newScriptArray(), type));
 }
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorTimelineAgent.h b/WebCore/inspector/InspectorTimelineAgent.h
index fd86ba7..18ac737 100644
--- a/WebCore/inspector/InspectorTimelineAgent.h
+++ b/WebCore/inspector/InspectorTimelineAgent.h
@@ -35,101 +35,136 @@
 
 #include "Document.h"
 #include "ScriptExecutionContext.h"
+#include "ScriptGCEvent.h"
+#include "ScriptGCEventListener.h"
 #include "ScriptObject.h"
 #include "ScriptArray.h"
 #include <wtf/Vector.h>
 
 namespace WebCore {
-    class Event;
-    class InspectorFrontend;
-    class IntRect;
-    class ResourceRequest;
-    class ResourceResponse;
+class Event;
+class InspectorFrontend;
+class IntRect;
+class ResourceRequest;
+class ResourceResponse;
 
-    // Must be kept in sync with TimelineAgent.js
-    enum TimelineRecordType {
-        EventDispatchTimelineRecordType = 0,
-        LayoutTimelineRecordType = 1,
-        RecalculateStylesTimelineRecordType = 2,
-        PaintTimelineRecordType = 3,
-        ParseHTMLTimelineRecordType = 4,
-        TimerInstallTimelineRecordType = 5,
-        TimerRemoveTimelineRecordType = 6,
-        TimerFireTimelineRecordType = 7,
-        XHRReadyStateChangeRecordType = 8,
-        XHRLoadRecordType = 9,
-        EvaluateScriptTimelineRecordType = 10,
-        MarkTimelineRecordType = 11,
-        ResourceSendRequestTimelineRecordType = 12,
-        ResourceReceiveResponseTimelineRecordType = 13,
-        ResourceFinishTimelineRecordType = 14,
+// Must be kept in sync with TimelineAgent.js
+enum TimelineRecordType {
+    EventDispatchTimelineRecordType = 0,
+    LayoutTimelineRecordType = 1,
+    RecalculateStylesTimelineRecordType = 2,
+    PaintTimelineRecordType = 3,
+    ParseHTMLTimelineRecordType = 4,
+    TimerInstallTimelineRecordType = 5,
+    TimerRemoveTimelineRecordType = 6,
+    TimerFireTimelineRecordType = 7,
+    XHRReadyStateChangeRecordType = 8,
+    XHRLoadRecordType = 9,
+    EvaluateScriptTimelineRecordType = 10,
+    MarkTimelineRecordType = 11,
+    ResourceSendRequestTimelineRecordType = 12,
+    ResourceReceiveResponseTimelineRecordType = 13,
+    ResourceFinishTimelineRecordType = 14,
+    FunctionCallTimelineRecordType = 15,
+    ReceiveResourceDataTimelineRecordType = 16,
+    GCEventTimelineRecordType = 17,
+    MarkDOMContentEventType = 18,
+    MarkLoadEventType = 19
+};
+
+class InspectorTimelineAgent : ScriptGCEventListener, public Noncopyable {
+public:
+    InspectorTimelineAgent(InspectorFrontend* frontend);
+    ~InspectorTimelineAgent();
+
+    void reset();
+    void resetFrontendProxyObject(InspectorFrontend*);
+
+    // Methods called from WebCore.
+    void willCallFunction(const String& scriptName, int scriptLine);
+    void didCallFunction();
+
+    void willDispatchEvent(const Event&);
+    void didDispatchEvent();
+
+    void willLayout();
+    void didLayout();
+
+    void willRecalculateStyle();
+    void didRecalculateStyle();
+
+    void willPaint(const IntRect&);
+    void didPaint();
+
+    void willWriteHTML(unsigned int length, unsigned int startLine);
+    void didWriteHTML(unsigned int endLine);
+        
+    void didInstallTimer(int timerId, int timeout, bool singleShot);
+    void didRemoveTimer(int timerId);
+    void willFireTimer(int timerId);
+    void didFireTimer();
+
+    void willChangeXHRReadyState(const String&, int);
+    void didChangeXHRReadyState();
+    void willLoadXHR(const String&);
+    void didLoadXHR();
+
+    void willEvaluateScript(const String&, int);
+    void didEvaluateScript();
+
+    void didMarkTimeline(const String&);
+    void didMarkDOMContentEvent();
+    void didMarkLoadEvent();
+
+    void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&);
+    void willReceiveResourceResponse(unsigned long, const ResourceResponse&);
+    void didReceiveResourceResponse();
+    void didFinishLoadingResource(unsigned long, bool didFail);
+    void willReceiveResourceData(unsigned long identifier);
+    void didReceiveResourceData();
+        
+    virtual void didGC(double, double, size_t);
+
+    static int instanceCount() { return s_instanceCount; }
+    static InspectorTimelineAgent* retrieve(ScriptExecutionContext*);
+
+private:
+    struct TimelineRecordEntry {
+        TimelineRecordEntry(ScriptObject record, ScriptObject data, ScriptArray children, TimelineRecordType type)
+            : record(record), data(data), children(children), type(type)
+        {
+        }
+        ScriptObject record;
+        ScriptObject data;
+        ScriptArray children;
+        TimelineRecordType type;
     };
-
-    class InspectorTimelineAgent : public Noncopyable {
-    public:
-        InspectorTimelineAgent(InspectorFrontend* frontend);
-        ~InspectorTimelineAgent();
-
-        void reset();
-        void resetFrontendProxyObject(InspectorFrontend*);
-
-        // Methods called from WebCore.
-        void willDispatchEvent(const Event&);
-        void didDispatchEvent();
-
-        void willLayout();
-        void didLayout();
-
-        void willRecalculateStyle();
-        void didRecalculateStyle();
-
-        void willPaint(const IntRect&);
-        void didPaint();
-
-        void willWriteHTML(unsigned int length, unsigned int startLine);
-        void didWriteHTML(unsigned int endLine);
         
-        void didInstallTimer(int timerId, int timeout, bool singleShot);
-        void didRemoveTimer(int timerId);
-        void willFireTimer(int timerId);
-        void didFireTimer();
-
-        void willChangeXHRReadyState(const String&, int);
-        void didChangeXHRReadyState();
-        void willLoadXHR(const String&);
-        void didLoadXHR();
-
-        void willEvaluateScript(const String&, int);
-        void didEvaluateScript();
-
-        void didMarkTimeline(const String&);
-
-        void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&);
-        void didReceiveResourceResponse(unsigned long, const ResourceResponse&);
-        void didFinishLoadingResource(unsigned long, bool didFail);
-
-        static InspectorTimelineAgent* retrieve(ScriptExecutionContext*);
-    private:
-        struct TimelineRecordEntry {
-            TimelineRecordEntry(ScriptObject record, ScriptObject data, ScriptArray children, TimelineRecordType type) : record(record), data(data), children(children), type(type) { }
-            ScriptObject record;
-            ScriptObject data;
-            ScriptArray children;
-            TimelineRecordType type;
-        };
+    void pushCurrentRecord(ScriptObject, TimelineRecordType);
+    void setHeapSizeStatistic(ScriptObject record);
         
-        void pushCurrentRecord(ScriptObject, TimelineRecordType);
-        
-        static double currentTimeInMilliseconds();
+    void didCompleteCurrentRecord(TimelineRecordType);
 
-        void didCompleteCurrentRecord(TimelineRecordType);
+    void addRecordToTimeline(ScriptObject, TimelineRecordType);
 
-        void addRecordToTimeline(ScriptObject, TimelineRecordType);
+    void pushGCEventRecords();
 
-        InspectorFrontend* m_frontend;
-        
-        Vector< TimelineRecordEntry > m_recordStack;
+    InspectorFrontend* m_frontend;
+
+    Vector<TimelineRecordEntry> m_recordStack;
+    static int s_instanceCount;
+    struct GCEvent {
+        GCEvent(double startTime, double endTime, size_t collectedBytes)
+            : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes)
+        {
+        }
+        double startTime;
+        double endTime;
+        size_t collectedBytes;
     };
+    typedef Vector<GCEvent> GCEvents;
+    GCEvents m_gcEvents;
+};
 
 inline InspectorTimelineAgent* InspectorTimelineAgent::retrieve(ScriptExecutionContext* context)
 {
diff --git a/WebCore/inspector/InspectorWorkerResource.h b/WebCore/inspector/InspectorWorkerResource.h
new file mode 100644
index 0000000..ef1b8c9
--- /dev/null
+++ b/WebCore/inspector/InspectorWorkerResource.h
@@ -0,0 +1,70 @@
+/*
+ * 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 InspectorWorkerResource_h
+#define InspectorWorkerResource_h
+
+#if ENABLE(WORKERS) && ENABLE(INSPECTOR)
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class InspectorWorkerResource : public RefCounted<InspectorWorkerResource> {
+public:
+    static PassRefPtr<InspectorWorkerResource> create(intptr_t id, const String& url, bool isSharedWorker)
+    {
+        return adoptRef(new InspectorWorkerResource(id, url, isSharedWorker));
+    }
+
+    intptr_t id() const { return m_id; }
+    const String& url() const { return m_url; }
+    bool isSharedWorker() const { return m_isSharedWorker; }
+private:
+    InspectorWorkerResource(intptr_t id, const String& url, bool isSharedWorker)
+        : m_id(id)
+        , m_url(url)
+        , m_isSharedWorker(isSharedWorker)
+    {
+    }
+
+    intptr_t m_id;
+    String m_url;
+    bool m_isSharedWorker;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS) && ENABLE(INSPECTOR)
+
+#endif // InspectorWorkerResource_h
diff --git a/WebCore/inspector/JavaScriptCallFrame.cpp b/WebCore/inspector/JavaScriptCallFrame.cpp
deleted file mode 100644
index e6f75b8..0000000
--- a/WebCore/inspector/JavaScriptCallFrame.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 "JavaScriptCallFrame.h"
-#include "JSDOMBinding.h"
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-
-#include "PlatformString.h"
-#include <debugger/DebuggerCallFrame.h>
-#include <runtime/JSGlobalObject.h>
-#include <runtime/Completion.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSObject.h>
-#include <runtime/JSValue.h>
-
-using namespace JSC;
-
-namespace WebCore {
-    
-JavaScriptCallFrame::JavaScriptCallFrame(const DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line)
-    : m_debuggerCallFrame(debuggerCallFrame)
-    , m_caller(caller)
-    , m_sourceID(sourceID)
-    , m_line(line)
-    , m_isValid(true)
-{
-}
-
-JavaScriptCallFrame* JavaScriptCallFrame::caller()
-{
-    return m_caller.get();
-}
-
-const JSC::ScopeChainNode* JavaScriptCallFrame::scopeChain() const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return 0;
-    return m_debuggerCallFrame.scopeChain();
-}
-
-JSC::JSGlobalObject* JavaScriptCallFrame::dynamicGlobalObject() const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return 0;
-    return m_debuggerCallFrame.dynamicGlobalObject();
-}
-
-String JavaScriptCallFrame::functionName() const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return String();
-    UString functionName = m_debuggerCallFrame.calculatedFunctionName();
-    if (functionName.isEmpty())
-        return String();
-    return functionName;
-}
-
-DebuggerCallFrame::Type JavaScriptCallFrame::type() const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return DebuggerCallFrame::ProgramType;
-    return m_debuggerCallFrame.type();
-}
-
-JSObject* JavaScriptCallFrame::thisObject() const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return 0;
-    return m_debuggerCallFrame.thisObject();
-}
-
-// Evaluate some JavaScript code in the scope of this frame.
-JSValue JavaScriptCallFrame::evaluate(const UString& script, JSValue& exception) const
-{
-    ASSERT(m_isValid);
-    if (!m_isValid)
-        return jsNull();
-
-    JSLock lock(SilenceAssertionsOnly);
-    return m_debuggerCallFrame.evaluate(script, exception);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/inspector/JavaScriptCallFrame.h b/WebCore/inspector/JavaScriptCallFrame.h
deleted file mode 100644
index bf61c4b..0000000
--- a/WebCore/inspector/JavaScriptCallFrame.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 JavaScriptCallFrame_h
-#define JavaScriptCallFrame_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-
-#include <interpreter/CallFrame.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <debugger/DebuggerCallFrame.h>
-
-namespace WebCore {
-
-    class String;
-
-    class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
-    public:
-        static PassRefPtr<JavaScriptCallFrame> create(const JSC::DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line)
-        {
-            return adoptRef(new JavaScriptCallFrame(debuggerCallFrame, caller, sourceID, line));
-        }
-
-        void invalidate()
-        {
-            m_isValid = false;
-            m_debuggerCallFrame = 0;
-        }
-
-        bool isValid() const { return m_isValid; }
-
-        JavaScriptCallFrame* caller();
-
-        intptr_t sourceID() const { return m_sourceID; }
-        int line() const { return m_line; }
-        void update(const JSC::DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int line)
-        {
-            m_debuggerCallFrame = debuggerCallFrame;
-            m_line = line;
-            m_sourceID = sourceID;
-            m_isValid = true;
-        }
-
-        String functionName() const;
-        JSC::DebuggerCallFrame::Type type() const;
-        const JSC::ScopeChainNode* scopeChain() const;
-        JSC::JSGlobalObject* dynamicGlobalObject() const;
-
-        JSC::JSObject* thisObject() const;
-        JSC::JSValue evaluate(const JSC::UString& script, JSC::JSValue& exception) const;
-        
-    private:
-        JavaScriptCallFrame(const JSC::DebuggerCallFrame&, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line);
-
-        JSC::DebuggerCallFrame m_debuggerCallFrame;
-        RefPtr<JavaScriptCallFrame> m_caller;
-        intptr_t m_sourceID;
-        int m_line;
-        bool m_isValid;
-    };
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-#endif // JavaScriptCallFrame_h
diff --git a/WebCore/inspector/JavaScriptCallFrame.idl b/WebCore/inspector/JavaScriptCallFrame.idl
index 639ecc9..28f4f34 100644
--- a/WebCore/inspector/JavaScriptCallFrame.idl
+++ b/WebCore/inspector/JavaScriptCallFrame.idl
@@ -26,12 +26,21 @@
 module inspector {
 
     interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] JavaScriptCallFrame {
+
+        // Scope type
+        const unsigned short GLOBAL_SCOPE = 0;
+        const unsigned short LOCAL_SCOPE = 1;
+        const unsigned short WITH_SCOPE = 2;
+        const unsigned short CLOSURE_SCOPE = 3;
+        const unsigned short CATCH_SCOPE = 4;
+
         [Custom] void evaluate(in DOMString script);
 
         readonly attribute JavaScriptCallFrame caller;
         readonly attribute long sourceID;
         readonly attribute long line;
         readonly attribute [CustomGetter] Array scopeChain;
+        [Custom] unsigned short scopeType(in int scopeIndex);
         readonly attribute [CustomGetter] Object thisObject;
         readonly attribute DOMString functionName;
         readonly attribute [CustomGetter] DOMString type;
diff --git a/WebCore/inspector/JavaScriptDebugListener.h b/WebCore/inspector/JavaScriptDebugListener.h
deleted file mode 100644
index 6570065..0000000
--- a/WebCore/inspector/JavaScriptDebugListener.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 JavaScriptDebugListener_h
-#define JavaScriptDebugListener_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-
-namespace JSC {
-    class ExecState;
-    class SourceCode;
-    class UString;
-}
-
-namespace WebCore {
-
-    class Frame;
-    class Page;
-
-    class JavaScriptDebugListener {
-    public:
-        virtual ~JavaScriptDebugListener() { }
-
-        virtual void didParseSource(JSC::ExecState*, const JSC::SourceCode& source) = 0;
-        virtual void failedToParseSource(JSC::ExecState*, const JSC::SourceCode& source, int errorLine, const JSC::UString& errorMessage) = 0;
-        virtual void didPause() = 0;
-        virtual void didContinue() = 0;
-    };
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-#endif // JavaScriptDebugListener_h
diff --git a/WebCore/inspector/JavaScriptDebugServer.cpp b/WebCore/inspector/JavaScriptDebugServer.cpp
deleted file mode 100644
index 03c3577..0000000
--- a/WebCore/inspector/JavaScriptDebugServer.cpp
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "JavaScriptDebugServer.h"
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-
-#include "DOMWindow.h"
-#include "EventLoop.h"
-#include "Frame.h"
-#include "FrameTree.h"
-#include "FrameView.h"
-#include "JSDOMWindowCustom.h"
-#include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugListener.h"
-#include "Page.h"
-#include "PageGroup.h"
-#include "PluginView.h"
-#include "ScrollView.h"
-#include "Widget.h"
-#include "ScriptController.h"
-#include <debugger/DebuggerCallFrame.h>
-#include <runtime/JSLock.h>
-#include <wtf/MainThread.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/UnusedParam.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-typedef JavaScriptDebugServer::ListenerSet ListenerSet;
-
-inline const UString& JavaScriptDebugServer::BreakpointInfo::condition() const
-{
-    return m_condition;
-}
-
-void JavaScriptDebugServer::BreakpointInfo::setCondition(const UString& condition)
-{
-    m_condition = condition;
-}
-
-JavaScriptDebugServer& JavaScriptDebugServer::shared()
-{
-    DEFINE_STATIC_LOCAL(JavaScriptDebugServer, server, ());
-    return server;
-}
-
-JavaScriptDebugServer::JavaScriptDebugServer()
-    : m_callingListeners(false)
-    , m_pauseOnExceptionsState(DontPauseOnExceptions)
-    , m_pauseOnNextStatement(false)
-    , m_paused(false)
-    , m_doneProcessingDebuggerEvents(true)
-    , m_pauseOnCallFrame(0)
-    , m_recompileTimer(this, &JavaScriptDebugServer::recompileAllJSFunctions)
-{
-}
-
-JavaScriptDebugServer::~JavaScriptDebugServer()
-{
-    deleteAllValues(m_pageListenersMap);
-    deleteAllValues(m_breakpoints);
-}
-
-void JavaScriptDebugServer::addListener(JavaScriptDebugListener* listener)
-{
-    ASSERT_ARG(listener, listener);
-
-    m_listeners.add(listener);
-
-    didAddListener(0);
-}
-
-void JavaScriptDebugServer::removeListener(JavaScriptDebugListener* listener)
-{
-    ASSERT_ARG(listener, listener);
-
-    m_listeners.remove(listener);
-
-    didRemoveListener(0);
-    if (!hasListeners())
-        didRemoveLastListener();
-}
-
-void JavaScriptDebugServer::addListener(JavaScriptDebugListener* listener, Page* page)
-{
-    ASSERT_ARG(listener, listener);
-    ASSERT_ARG(page, page);
-
-    pair<PageListenersMap::iterator, bool> result = m_pageListenersMap.add(page, 0);
-    if (result.second)
-        result.first->second = new ListenerSet;
-
-    ListenerSet* listeners = result.first->second;
-    listeners->add(listener);
-
-    didAddListener(page);
-}
-
-void JavaScriptDebugServer::removeListener(JavaScriptDebugListener* listener, Page* page)
-{
-    ASSERT_ARG(listener, listener);
-    ASSERT_ARG(page, page);
-
-    PageListenersMap::iterator it = m_pageListenersMap.find(page);
-    if (it == m_pageListenersMap.end())
-        return;
-
-    ListenerSet* listeners = it->second;
-    listeners->remove(listener);
-    if (listeners->isEmpty()) {
-        m_pageListenersMap.remove(it);
-        delete listeners;
-    }
-
-    didRemoveListener(page);
-    if (!hasListeners())
-        didRemoveLastListener();
-}
-
-void JavaScriptDebugServer::pageCreated(Page* page)
-{
-    ASSERT_ARG(page, page);
-
-    if (!hasListenersInterestedInPage(page))
-        return;
-    page->setDebugger(this);
-}
-
-bool JavaScriptDebugServer::hasListenersInterestedInPage(Page* page)
-{
-    ASSERT_ARG(page, page);
-
-    if (hasGlobalListeners())
-        return true;
-
-    return m_pageListenersMap.contains(page);
-}
-
-void JavaScriptDebugServer::addBreakpoint(intptr_t sourceID, unsigned lineNumber, const UString& condition)
-{
-    LineToBreakpointInfoMap* sourceBreakpoints = m_breakpoints.get(sourceID);
-    if (!sourceBreakpoints) {
-        sourceBreakpoints = new LineToBreakpointInfoMap;
-        m_breakpoints.set(sourceID, sourceBreakpoints);
-    }
-    BreakpointInfo* info = sourceBreakpoints->get(lineNumber);
-    if (!info)
-        sourceBreakpoints->set(lineNumber, new BreakpointInfo(condition));
-    else
-        updateBreakpointInfo(info, condition);
-}
-
-JavaScriptDebugServer::BreakpointInfo* JavaScriptDebugServer::breakpointInfo(intptr_t sourceID, unsigned lineNumber) const
-{
-    LineToBreakpointInfoMap* sourceBreakpoints = m_breakpoints.get(sourceID);
-    if (!sourceBreakpoints)
-        return 0;
-    return sourceBreakpoints->get(lineNumber);
-}
-
-void JavaScriptDebugServer::updateBreakpoint(intptr_t sourceID, unsigned lineNumber, const UString& condition)
-{
-    BreakpointInfo* info = breakpointInfo(sourceID, lineNumber);
-    if (!info)
-        return;
-    updateBreakpointInfo(info, condition);
-}
-
-void JavaScriptDebugServer::updateBreakpointInfo(BreakpointInfo* info, const UString& condition)
-{
-    info->setCondition(condition);
-}
-
-void JavaScriptDebugServer::removeBreakpoint(intptr_t sourceID, unsigned lineNumber)
-{
-    LineToBreakpointInfoMap* sourceBreakpoints = m_breakpoints.get(sourceID);
-    if (!sourceBreakpoints)
-        return;
-
-    BreakpointInfo* info = sourceBreakpoints->get(lineNumber);
-    if (!info)
-        return;
-
-    sourceBreakpoints->remove(lineNumber);
-    delete info;
-
-    if (sourceBreakpoints->isEmpty()) {
-        m_breakpoints.remove(sourceID);
-        delete sourceBreakpoints;
-    }
-}
-
-bool JavaScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const
-{
-    BreakpointInfo* info = breakpointInfo(sourceID, lineNumber);
-    if (!info)
-        return false;
-
-    // An empty condition counts as no condition which is equivalent to "true".
-    if (info->condition().isEmpty())
-        return true;
-
-    JSValue exception;
-    JSValue result = m_currentCallFrame->evaluate(info->condition(), exception);
-    if (exception) {
-        // An erroneous condition counts as "false".
-        return false;
-    }
-    return result.toBoolean(m_currentCallFrame->scopeChain()->globalObject->globalExec());
-}
-
-void JavaScriptDebugServer::clearBreakpoints()
-{
-    BreakpointsMap::iterator end = m_breakpoints.end();
-    for (BreakpointsMap::iterator it = m_breakpoints.begin(); it != end; ++it) {
-        deleteAllValues(*(it->second));
-        it->second->clear();
-    }
-    deleteAllValues(m_breakpoints);
-    m_breakpoints.clear();
-}
-
-void JavaScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pause)
-{
-    m_pauseOnExceptionsState = pause;
-}
-
-void JavaScriptDebugServer::pauseProgram()
-{
-    m_pauseOnNextStatement = true;
-}
-
-void JavaScriptDebugServer::continueProgram()
-{
-    if (!m_paused)
-        return;
-
-    m_pauseOnNextStatement = false;
-    m_doneProcessingDebuggerEvents = true;
-}
-
-void JavaScriptDebugServer::stepIntoStatement()
-{
-    if (!m_paused)
-        return;
-
-    m_pauseOnNextStatement = true;
-    m_doneProcessingDebuggerEvents = true;
-}
-
-void JavaScriptDebugServer::stepOverStatement()
-{
-    if (!m_paused)
-        return;
-
-    m_pauseOnCallFrame = m_currentCallFrame.get();
-    m_doneProcessingDebuggerEvents = true;
-}
-
-void JavaScriptDebugServer::stepOutOfFunction()
-{
-    if (!m_paused)
-        return;
-
-    m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame->caller() : 0;
-    m_doneProcessingDebuggerEvents = true;
-}
-
-JavaScriptCallFrame* JavaScriptDebugServer::currentCallFrame()
-{
-    if (!m_paused)
-        return 0;
-    return m_currentCallFrame.get();
-}
-
-static void dispatchDidParseSource(const ListenerSet& listeners, ExecState* exec, const JSC::SourceCode& source)
-{
-    Vector<JavaScriptDebugListener*> copy;
-    copyToVector(listeners, copy);
-    for (size_t i = 0; i < copy.size(); ++i)
-        copy[i]->didParseSource(exec, source);
-}
-
-static void dispatchFailedToParseSource(const ListenerSet& listeners, ExecState* exec, const SourceCode& source, int errorLine, const String& errorMessage)
-{
-    Vector<JavaScriptDebugListener*> copy;
-    copyToVector(listeners, copy);
-    for (size_t i = 0; i < copy.size(); ++i)
-        copy[i]->failedToParseSource(exec, source, errorLine, errorMessage);
-}
-
-static Page* toPage(JSGlobalObject* globalObject)
-{
-    ASSERT_ARG(globalObject, globalObject);
-
-    JSDOMWindow* window = asJSDOMWindow(globalObject);
-    Frame* frame = window->impl()->frame();
-    return frame ? frame->page() : 0;
-}
-
-void JavaScriptDebugServer::detach(JSGlobalObject* globalObject)
-{
-    // If we're detaching from the currently executing global object, manually tear down our
-    // stack, since we won't get further debugger callbacks to do so. Also, resume execution,
-    // since there's no point in staying paused once a window closes.
-    if (m_currentCallFrame && m_currentCallFrame->dynamicGlobalObject() == globalObject) {
-        m_currentCallFrame = 0;
-        m_pauseOnCallFrame = 0;
-        continueProgram();
-    }
-    Debugger::detach(globalObject);
-}
-
-void JavaScriptDebugServer::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMessage)
-{
-    if (m_callingListeners)
-        return;
-
-    Page* page = toPage(exec->dynamicGlobalObject());
-    if (!page)
-        return;
-
-    m_callingListeners = true;
-
-    bool isError = errorLine != -1;
-
-    if (hasGlobalListeners()) {
-        if (isError)
-            dispatchFailedToParseSource(m_listeners, exec, source, errorLine, errorMessage);
-        else
-            dispatchDidParseSource(m_listeners, exec, source);
-    }
-
-    if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
-        ASSERT(!pageListeners->isEmpty());
-        if (isError)
-            dispatchFailedToParseSource(*pageListeners, exec, source, errorLine, errorMessage);
-        else
-            dispatchDidParseSource(*pageListeners, exec, source);
-    }
-
-    m_callingListeners = false;
-}
-
-static void dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptDebugServer::JavaScriptExecutionCallback callback)
-{
-    Vector<JavaScriptDebugListener*> copy;
-    copyToVector(listeners, copy);
-    for (size_t i = 0; i < copy.size(); ++i)
-        (copy[i]->*callback)();
-}
-
-void JavaScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback callback, Page* page)
-{
-    if (m_callingListeners)
-        return;
-
-    m_callingListeners = true;
-
-    ASSERT(hasListeners());
-
-    WebCore::dispatchFunctionToListeners(m_listeners, callback);
-
-    if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
-        ASSERT(!pageListeners->isEmpty());
-        WebCore::dispatchFunctionToListeners(*pageListeners, callback);
-    }
-
-    m_callingListeners = false;
-}
-
-void JavaScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused)
-{
-    setMainThreadCallbacksPaused(paused);
-
-    const HashSet<Page*>& pages = pageGroup.pages();
-
-    HashSet<Page*>::const_iterator end = pages.end();
-    for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it)
-        setJavaScriptPaused(*it, paused);
-}
-
-void JavaScriptDebugServer::setJavaScriptPaused(Page* page, bool paused)
-{
-    ASSERT_ARG(page, page);
-
-    page->setDefersLoading(paused);
-
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
-        setJavaScriptPaused(frame, paused);
-}
-
-void JavaScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
-{
-    ASSERT_ARG(frame, frame);
-
-    if (!frame->script()->canExecuteScripts())
-        return;
-
-    frame->script()->setPaused(paused);
-
-    Document* document = frame->document();
-    if (paused)
-        document->suspendActiveDOMObjects();
-    else
-        document->resumeActiveDOMObjects();
-
-    setJavaScriptPaused(frame->view(), paused);
-}
-
-#if PLATFORM(MAC)
-
-void JavaScriptDebugServer::setJavaScriptPaused(FrameView*, bool)
-{
-}
-
-#else
-
-void JavaScriptDebugServer::setJavaScriptPaused(FrameView* view, bool paused)
-{
-    if (!view)
-        return;
-
-    const HashSet<RefPtr<Widget> >* children = view->children();
-    ASSERT(children);
-
-    HashSet<RefPtr<Widget> >::const_iterator end = children->end();
-    for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) {
-        Widget* widget = (*it).get();
-        if (!widget->isPluginView())
-            continue;
-        static_cast<PluginView*>(widget)->setJavaScriptPaused(paused);
-    }
-}
-
-#endif
-
-void JavaScriptDebugServer::pauseIfNeeded(Page* page)
-{
-    if (m_paused)
-        return;
-
-    if (!page || !hasListenersInterestedInPage(page))
-        return;
-
-    bool pauseNow = m_pauseOnNextStatement;
-    pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame);
-    pauseNow |= (m_currentCallFrame->line() > 0 && hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->line()));
-    if (!pauseNow)
-        return;
-
-    m_pauseOnCallFrame = 0;
-    m_pauseOnNextStatement = false;
-    m_paused = true;
-
-    dispatchFunctionToListeners(&JavaScriptDebugListener::didPause, page);
-
-    setJavaScriptPaused(page->group(), true);
-
-    TimerBase::fireTimersInNestedEventLoop();
-
-    EventLoop loop;
-    m_doneProcessingDebuggerEvents = false;
-    while (!m_doneProcessingDebuggerEvents && !loop.ended())
-        loop.cycle();
-
-    setJavaScriptPaused(page->group(), false);
-
-    m_paused = false;
-
-    dispatchFunctionToListeners(&JavaScriptDebugListener::didContinue, page);
-}
-
-void JavaScriptDebugServer::callEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-}
-
-void JavaScriptDebugServer::atStatement(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    ASSERT(m_currentCallFrame);
-    if (!m_currentCallFrame)
-        return;
-
-    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-}
-
-void JavaScriptDebugServer::returnEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    ASSERT(m_currentCallFrame);
-    if (!m_currentCallFrame)
-        return;
-
-    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-
-    // Treat stepping over a return statement like stepping out.
-    if (m_currentCallFrame == m_pauseOnCallFrame)
-        m_pauseOnCallFrame = m_currentCallFrame->caller();
-    m_currentCallFrame = m_currentCallFrame->caller();
-}
-
-void JavaScriptDebugServer::exception(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber, bool hasHandler)
-{
-    if (m_paused)
-        return;
-
-    ASSERT(m_currentCallFrame);
-    if (!m_currentCallFrame)
-        return;
-
-    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasHandler))
-        m_pauseOnNextStatement = true;
-
-    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-}
-
-void JavaScriptDebugServer::willExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-}
-
-void JavaScriptDebugServer::didExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    ASSERT(m_currentCallFrame);
-    if (!m_currentCallFrame)
-        return;
-
-    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-
-    // Treat stepping over the end of a program like stepping out.
-    if (m_currentCallFrame == m_pauseOnCallFrame)
-        m_pauseOnCallFrame = m_currentCallFrame->caller();
-    m_currentCallFrame = m_currentCallFrame->caller();
-}
-
-void JavaScriptDebugServer::didReachBreakpoint(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber)
-{
-    if (m_paused)
-        return;
-
-    ASSERT(m_currentCallFrame);
-    if (!m_currentCallFrame)
-        return;
-
-    m_pauseOnNextStatement = true;
-    m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
-    pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
-}
-
-void JavaScriptDebugServer::recompileAllJSFunctionsSoon()
-{
-    m_recompileTimer.startOneShot(0);
-}
-
-void JavaScriptDebugServer::recompileAllJSFunctions(Timer<JavaScriptDebugServer>*)
-{
-    JSLock lock(SilenceAssertionsOnly);
-    Debugger::recompileAllJSFunctions(JSDOMWindow::commonJSGlobalData());
-}
-
-void JavaScriptDebugServer::didAddListener(Page* page)
-{
-    recompileAllJSFunctionsSoon();
-
-    if (page)
-        page->setDebugger(this);
-    else
-        Page::setDebuggerForAllPages(this);
-}
-
-void JavaScriptDebugServer::didRemoveListener(Page* page)
-{
-    if (hasGlobalListeners() || (page && hasListenersInterestedInPage(page)))
-        return;
-
-    recompileAllJSFunctionsSoon();
-
-    if (page)
-        page->setDebugger(0);
-    else
-        Page::setDebuggerForAllPages(0);
-}
-
-void JavaScriptDebugServer::didRemoveLastListener()
-{
-    m_doneProcessingDebuggerEvents = true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/inspector/JavaScriptDebugServer.h b/WebCore/inspector/JavaScriptDebugServer.h
deleted file mode 100644
index d7c23bc..0000000
--- a/WebCore/inspector/JavaScriptDebugServer.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 JavaScriptDebugServer_h
-#define JavaScriptDebugServer_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-
-#include "Timer.h"
-#include <debugger/Debugger.h>
-#include <runtime/UString.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-
-namespace JSC {
-    class DebuggerCallFrame;
-    class JSGlobalObject;
-}
-
-namespace WebCore {
-
-    class Frame;
-    class FrameView;
-    class Page;
-    class PageGroup;
-    class JavaScriptCallFrame;
-    class JavaScriptDebugListener;
-
-    class JavaScriptDebugServer : JSC::Debugger, public Noncopyable {
-    public:
-        static JavaScriptDebugServer& shared();
-
-        void addListener(JavaScriptDebugListener*);
-        void removeListener(JavaScriptDebugListener*);
-
-        void addListener(JavaScriptDebugListener*, Page*);
-        void removeListener(JavaScriptDebugListener*, Page*);
-
-        void addBreakpoint(intptr_t sourceID, unsigned lineNumber, const JSC::UString& condition);
-        void updateBreakpoint(intptr_t sourceID, unsigned lineNumber, const JSC::UString& condition);
-        void removeBreakpoint(intptr_t sourceID, unsigned lineNumber);
-        bool hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const;
-        void clearBreakpoints();
-
-        enum PauseOnExceptionsState {
-            DontPauseOnExceptions,
-            PauseOnAllExceptions,
-            PauseOnUncaughtExceptions
-        };
-        PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
-        void setPauseOnExceptionsState(PauseOnExceptionsState);
-
-        void pauseProgram();
-        void continueProgram();
-        void stepIntoStatement();
-        void stepOverStatement();
-        void stepOutOfFunction();
-
-        void recompileAllJSFunctionsSoon();
-        void recompileAllJSFunctions(Timer<JavaScriptDebugServer>* = 0);
-
-        JavaScriptCallFrame* currentCallFrame();
-
-        void pageCreated(Page*);
-
-        typedef HashSet<JavaScriptDebugListener*> ListenerSet;
-        typedef void (JavaScriptDebugListener::*JavaScriptExecutionCallback)();
-
-    private:
-        class BreakpointInfo {
-        public:
-            BreakpointInfo(const JSC::UString& condition) : m_condition(condition) {}
-            const JSC::UString& condition() const;
-            void setCondition(const JSC::UString& condition);
-        private:
-            JSC::UString m_condition;
-        };
-
-        JavaScriptDebugServer();
-        ~JavaScriptDebugServer();
-
-        bool hasListeners() const { return !m_listeners.isEmpty() || !m_pageListenersMap.isEmpty(); }
-        bool hasGlobalListeners() const { return !m_listeners.isEmpty(); }
-        bool hasListenersInterestedInPage(Page*);
-
-        void setJavaScriptPaused(const PageGroup&, bool paused);
-        void setJavaScriptPaused(Page*, bool paused);
-        void setJavaScriptPaused(Frame*, bool paused);
-        void setJavaScriptPaused(FrameView*, bool paused);
-
-        void dispatchFunctionToListeners(JavaScriptExecutionCallback, Page*);
-        void pauseIfNeeded(Page*);
-        BreakpointInfo* breakpointInfo(intptr_t sourceID, unsigned lineNumber) const;
-        void updateBreakpointInfo(BreakpointInfo* info, const JSC::UString& condition);
-
-        virtual void detach(JSC::JSGlobalObject*);
-
-        virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg);
-        virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
-        virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int firstLine);
-        virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
-        virtual void exception(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, bool hasHandler);
-        virtual void willExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
-        virtual void didExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
-        virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno);
-
-        void didAddListener(Page*);
-        void didRemoveListener(Page*);
-        void didRemoveLastListener();
-
-        typedef HashMap<Page*, ListenerSet*> PageListenersMap;
-        typedef HashMap<unsigned, BreakpointInfo*> LineToBreakpointInfoMap;
-        typedef HashMap<intptr_t, LineToBreakpointInfoMap*> BreakpointsMap;
-
-        PageListenersMap m_pageListenersMap;
-        ListenerSet m_listeners;
-        bool m_callingListeners;
-        PauseOnExceptionsState m_pauseOnExceptionsState;
-        bool m_pauseOnNextStatement;
-        bool m_paused;
-        bool m_doneProcessingDebuggerEvents;
-        JavaScriptCallFrame* m_pauseOnCallFrame;
-        RefPtr<JavaScriptCallFrame> m_currentCallFrame;
-        BreakpointsMap m_breakpoints;
-        Timer<JavaScriptDebugServer> m_recompileTimer;
-    };
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-#endif // JavaScriptDebugServer_h
diff --git a/WebCore/inspector/ScriptBreakpoint.h b/WebCore/inspector/ScriptBreakpoint.h
new file mode 100644
index 0000000..8775901
--- /dev/null
+++ b/WebCore/inspector/ScriptBreakpoint.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 ScriptBreakpoint_h
+#define ScriptBreakpoint_h
+
+#include "PlatformString.h"
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+struct ScriptBreakpoint {
+    ScriptBreakpoint(bool enabled, const String& condition)
+        : enabled(enabled)
+        , condition(condition)
+    {
+    }
+
+    ScriptBreakpoint()
+    {
+    }
+
+    bool enabled;
+    String condition;
+};
+
+typedef HashMap<int, ScriptBreakpoint> SourceBreakpoints;
+
+} // namespace WebCore
+
+#endif // !defined(ScriptBreakpoint_h)
diff --git a/WebCore/inspector/ScriptDebugListener.h b/WebCore/inspector/ScriptDebugListener.h
new file mode 100644
index 0000000..5a85da1
--- /dev/null
+++ b/WebCore/inspector/ScriptDebugListener.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 ScriptDebugListener_h
+#define ScriptDebugListener_h
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+namespace WebCore {
+
+class String;
+
+class ScriptDebugListener {
+public:
+    virtual ~ScriptDebugListener() { }
+
+    virtual void didParseSource(const String&  sourceID, const String& url, const String& data, int firstLine) = 0;
+    virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) = 0;
+    virtual void didPause() = 0;
+    virtual void didContinue() = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+
+#endif // ScriptDebugListener_h
diff --git a/WebCore/inspector/ScriptGCEventListener.h b/WebCore/inspector/ScriptGCEventListener.h
new file mode 100644
index 0000000..0850f0c
--- /dev/null
+++ b/WebCore/inspector/ScriptGCEventListener.h
@@ -0,0 +1,48 @@
+/*
+ * 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 ScriptGCEventListener_h
+#define ScriptGCEventListener_h
+
+#if ENABLE(INSPECTOR)
+
+namespace WebCore {
+
+class ScriptGCEventListener
+{
+public:
+    virtual void didGC(double startTime, double endTime, size_t collectedBytes) = 0;
+    virtual ~ScriptGCEventListener(){}
+};
+    
+} // namespace WebCore
+
+#endif // !ENABLE(INSPECTOR)
+#endif // !defined(ScriptGCEventListener_h)
diff --git a/WebCore/inspector/ScriptProfile.idl b/WebCore/inspector/ScriptProfile.idl
new file mode 100644
index 0000000..8d4b04a
--- /dev/null
+++ b/WebCore/inspector/ScriptProfile.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * 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:
+ * 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 COMPUTER, 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.
+ */
+
+module core {
+
+    interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] ScriptProfile {
+        readonly attribute DOMString title;
+        readonly attribute unsigned long uid;
+        readonly attribute ScriptProfileNode head;
+    };
+
+}
diff --git a/WebCore/inspector/ScriptProfileNode.idl b/WebCore/inspector/ScriptProfileNode.idl
new file mode 100644
index 0000000..eff17bd
--- /dev/null
+++ b/WebCore/inspector/ScriptProfileNode.idl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * 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:
+ * 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 COMPUTER, 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.
+ */
+
+module core {
+
+    interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] ScriptProfileNode {
+        readonly attribute DOMString functionName;
+        readonly attribute DOMString url;
+        readonly attribute unsigned long lineNumber;
+        readonly attribute double totalTime;
+        readonly attribute double selfTime;
+        readonly attribute unsigned long numberOfCalls;
+        readonly attribute [CustomGetter] Array children;
+        readonly attribute boolean visible;
+        readonly attribute [CustomGetter] unsigned long callUID;
+    };
+
+}
diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp
index 525e61d..c08fc0f 100644
--- a/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/WebCore/inspector/TimelineRecordFactory.cpp
@@ -39,6 +39,7 @@
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "ScriptArray.h"
+#include "ScriptCallStack.h"
 #include "ScriptObject.h"
 
 namespace WebCore {
@@ -47,9 +48,33 @@
 {
     ScriptObject record = frontend->newScriptObject();
     record.set("startTime", startTime);
+
+    String sourceName;
+    int sourceLineNumber;
+    String functionName;
+    if (ScriptCallStack::callLocation(&sourceName, &sourceLineNumber, &functionName) && sourceName != "undefined") {
+        record.set("callerScriptName", sourceName);
+        record.set("callerScriptLine", sourceLineNumber);
+        record.set("callerFunctionName", functionName);
+    }
     return record;
 }
 
+ScriptObject TimelineRecordFactory::createGCEventData(InspectorFrontend* frontend, const size_t usedHeapSizeDelta)
+{
+    ScriptObject data = frontend->newScriptObject();
+    data.set("usedHeapSizeDelta", usedHeapSizeDelta);
+    return data;
+}
+
+ScriptObject TimelineRecordFactory::createFunctionCallData(InspectorFrontend* frontend, const String& scriptName, int scriptLine)
+{
+    ScriptObject data = frontend->newScriptObject();
+    data.set("scriptName", scriptName);
+    data.set("scriptLine", scriptLine);
+    return data;
+}
+
 ScriptObject TimelineRecordFactory::createEventDispatchData(InspectorFrontend* frontend, const Event& event)
 {
     ScriptObject data = frontend->newScriptObject();
@@ -132,6 +157,13 @@
     return data;
 }
 
+ScriptObject TimelineRecordFactory::createReceiveResourceData(InspectorFrontend* frontend, unsigned long identifier)
+{
+    ScriptObject data = frontend->newScriptObject();
+    data.set("identifier", identifier);
+    return data;
+}
+    
 ScriptObject TimelineRecordFactory::createPaintData(InspectorFrontend* frontend, const IntRect& rect)
 {
     ScriptObject data = frontend->newScriptObject();
diff --git a/WebCore/inspector/TimelineRecordFactory.h b/WebCore/inspector/TimelineRecordFactory.h
index b7437f5..2f485d3 100644
--- a/WebCore/inspector/TimelineRecordFactory.h
+++ b/WebCore/inspector/TimelineRecordFactory.h
@@ -46,6 +46,10 @@
     public:
         static ScriptObject createGenericRecord(InspectorFrontend*, double startTime);
 
+        static ScriptObject createGCEventData(InspectorFrontend* frontend, const size_t usedHeapSizeDelta);
+
+        static ScriptObject createFunctionCallData(InspectorFrontend*, const String& scriptName, int scriptLine);
+
         static ScriptObject createEventDispatchData(InspectorFrontend*, const Event&);
 
         static ScriptObject createGenericTimerData(InspectorFrontend*, int timerId);
@@ -65,6 +69,8 @@
 
         static ScriptObject createResourceReceiveResponseData(InspectorFrontend*, unsigned long identifier, const ResourceResponse&);
 
+        static ScriptObject createReceiveResourceData(InspectorFrontend*, unsigned long identifier);
+        
         static ScriptObject createResourceFinishData(InspectorFrontend*, unsigned long identifier, bool didFail);
 
         static ScriptObject createPaintData(InspectorFrontend*, const IntRect&);
diff --git a/WebCore/inspector/front-end/AbstractTimelinePanel.js b/WebCore/inspector/front-end/AbstractTimelinePanel.js
index 6c5d715..cfec9da 100644
--- a/WebCore/inspector/front-end/AbstractTimelinePanel.js
+++ b/WebCore/inspector/front-end/AbstractTimelinePanel.js
@@ -308,8 +308,10 @@
             staleItemsLength = this._staleItems.length;
         }
 
+
+        const isBarOpaqueAtLeft = this.sidebarTree.selectedTreeElement && this.sidebarTree.selectedTreeElement.isBarOpaqueAtLeft;
         for (var i = 0; i < staleItemsLength; ++i)
-            this._staleItems[i]._itemsTreeElement._itemGraph.refresh(this.calculator);
+            this._staleItems[i]._itemsTreeElement._itemGraph.refresh(this.calculator, isBarOpaqueAtLeft);
 
         this._staleItems = [];
 
diff --git a/WebCore/inspector/front-end/AuditCategories.js b/WebCore/inspector/front-end/AuditCategories.js
index 6931b5f..01b5ff9 100644
--- a/WebCore/inspector/front-end/AuditCategories.js
+++ b/WebCore/inspector/front-end/AuditCategories.js
@@ -37,9 +37,9 @@
 WebInspector.AuditCategories.PagePerformance.prototype = {
     initialize: function()
     {
-        this.addRule(new WebInspector.AuditRules.UnusedCssRule());
-        this.addRule(new WebInspector.AuditRules.CssInHeadRule({InlineURLScore: 6, InlineStylesheetScore: 21}));
-        this.addRule(new WebInspector.AuditRules.StylesScriptsOrderRule({CSSAfterJSURLScore: 11, InlineBetweenResourcesScore: 21}));
+        this.addRule(new WebInspector.AuditRules.UnusedCssRule(), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.CssInHeadRule(), WebInspector.AuditRule.Severity.Severe);
+        this.addRule(new WebInspector.AuditRules.StylesScriptsOrderRule(), WebInspector.AuditRule.Severity.Severe);
     }
 }
 
@@ -54,16 +54,16 @@
 WebInspector.AuditCategories.NetworkUtilization.prototype = {
     initialize: function()
     {
-        this.addRule(new WebInspector.AuditRules.GzipRule());
-        this.addRule(new WebInspector.AuditRules.ImageDimensionsRule({ScorePerImageUse: 5}));
-        this.addRule(new WebInspector.AuditRules.CookieSizeRule({MinBytesThreshold: 400, MaxBytesThreshold: 1000}));
-        this.addRule(new WebInspector.AuditRules.StaticCookielessRule({MinResources: 5}));
-        this.addRule(new WebInspector.AuditRules.CombineJsResourcesRule({AllowedPerDomain: 2, ScorePerResource: 11}));
-        this.addRule(new WebInspector.AuditRules.CombineCssResourcesRule({AllowedPerDomain: 2, ScorePerResource: 11}));
-        this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule({HostCountThreshold: 4, ViolationDomainScore: 6}));
-        this.addRule(new WebInspector.AuditRules.ParallelizeDownloadRule({OptimalHostnameCount: 4, MinRequestThreshold: 10, MinBalanceThreshold: 0.5}));
-        this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule());
-        this.addRule(new WebInspector.AuditRules.ProxyCacheControlRule());
+        this.addRule(new WebInspector.AuditRules.GzipRule(), WebInspector.AuditRule.Severity.Severe);
+        this.addRule(new WebInspector.AuditRules.ImageDimensionsRule(), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.CookieSizeRule(400), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.StaticCookielessRule(5), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.CombineJsResourcesRule(2), WebInspector.AuditRule.Severity.Severe);
+        this.addRule(new WebInspector.AuditRules.CombineCssResourcesRule(2), WebInspector.AuditRule.Severity.Severe);
+        this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule(4), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), WebInspector.AuditRule.Severity.Warning);
+        this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule(), WebInspector.AuditRule.Severity.Severe);
+        this.addRule(new WebInspector.AuditRules.ProxyCacheControlRule(), WebInspector.AuditRule.Severity.Warning);
     }
 }
 
diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js
index f2a2fd2..60b7c32 100644
--- a/WebCore/inspector/front-end/AuditLauncherView.js
+++ b/WebCore/inspector/front-end/AuditLauncherView.js
@@ -42,6 +42,8 @@
     this._contentElement.className = "audit-launcher-view-content";
     this.element.appendChild(this._contentElement);
 
+    this._resetResourceCount();
+
     function categorySortFunction(a, b)
     {
         var aTitle = a.displayName || "";
@@ -67,6 +69,9 @@
     {
         if (!this._auditPresentStateLabelElement)
             return;
+
+        this._resetResourceCount();
+
         if (isTracking) {
             this._auditPresentStateLabelElement.nodeValue = WebInspector.UIString("Audit Present State");
             this._auditPresentStateElement.disabled = false;
@@ -79,12 +84,63 @@
         }
     },
 
+    get totalResources()
+    {
+        return this._totalResources;
+    },
+
+    set totalResources(x)
+    {
+        if (this._totalResources === x)
+            return;
+        this._totalResources = x;
+        this._updateResourceProgress();
+    },
+
+    get loadedResources()
+    {
+        return this._loadedResources;
+    },
+
+    set loadedResources(x)
+    {
+        if (this._loadedResources === x)
+            return;
+        this._loadedResources = x;
+        this._updateResourceProgress();
+    },
+
+    _resetResourceCount: function()
+    {
+        this.loadedResources = 0;
+
+        // We never receive a resourceStarted notification for the main resource
+        // (see InspectorController.willSendRequest())
+        this.totalResources = 1;
+    },
+
+    resourceStarted: function(resource)
+    {
+        ++this.totalResources;
+    },
+
+    resourceFinished: function(resource)
+    {
+        ++this.loadedResources;
+    },
+
+    reset: function()
+    {
+        this._resetResourceCount();
+    },
+
     _setAuditRunning: function(auditRunning)
     {
         if (this._auditRunning === auditRunning)
             return;
         this._auditRunning = auditRunning;
         this._updateButton();
+        this._updateResourceProgress();
     },
 
     _launchButtonClicked: function(event)
@@ -95,12 +151,8 @@
             if (this._categoriesById[id]._checkboxElement.checked)
                 catIds.push(id);
         }
-        function profilingFinishedCallback()
-        {
-            this._setAuditRunning(false);
-        }
         this._setAuditRunning(true);
-        this._runnerCallback(catIds, this._auditPresentStateElement.checked, profilingFinishedCallback.bind(this));
+        this._runnerCallback(catIds, this._auditPresentStateElement.checked, this._setAuditRunning.bind(this, false));
     },
 
     _selectAllClicked: function(checkCategories)
@@ -121,11 +173,10 @@
 
     _createCategoryElement: function(title, id)
     {
-        var element;
         var labelElement = document.createElement("label");
         labelElement.id = this._categoryIdPrefix + id;
 
-        element = document.createElement("input");
+        var element = document.createElement("input");
         element.type = "checkbox";
         labelElement.appendChild(element);
         labelElement.appendChild(document.createTextNode(title));
@@ -166,6 +217,10 @@
         this._totalCategoriesCount = this._categoriesElement.childNodes.length;
         this._currentCategoriesCount = 0;
 
+        var flexibleSpaceElement = document.createElement("div");
+        flexibleSpaceElement.className = "flexible-space";
+        this._contentElement.appendChild(flexibleSpaceElement);
+
         this._buttonContainerElement = document.createElement("div");
         this._buttonContainerElement.className = "button-container";
 
@@ -188,10 +243,19 @@
         this._buttonContainerElement.appendChild(labelElement);
 
         this._launchButton = document.createElement("button");
-        this._launchButton.setAttribute("type", "button");
+        this._launchButton.type = "button";
+        this._launchButton.textContent = WebInspector.UIString("Run");
         this._launchButton.addEventListener("click", this._launchButtonClicked.bind(this), false);
         this._buttonContainerElement.appendChild(this._launchButton);
 
+        this._resourceProgressContainer = document.createElement("span");
+        this._resourceProgressContainer.className = "resource-progress";
+        var resourceProgressImage = document.createElement("img");
+        this._resourceProgressContainer.appendChild(resourceProgressImage);
+        this._resourceProgressTextElement = document.createElement("span");
+        this._resourceProgressContainer.appendChild(this._resourceProgressTextElement);
+        this._buttonContainerElement.appendChild(this._resourceProgressContainer);
+
         this._contentElement.appendChild(this._buttonContainerElement);
 
         this._selectAllClicked(this._selectAllCheckboxElement.checked);
@@ -199,25 +263,22 @@
         this._updateButton();
     },
 
+    _updateResourceProgress: function()
+    {
+        if (!this._resourceProgressContainer)
+            return;
+
+        if (!this._auditRunning)
+            this._resourceProgressContainer.addStyleClass("hidden");
+        else {
+            this._resourceProgressContainer.removeStyleClass("hidden");
+            this._resourceProgressTextElement.textContent = WebInspector.UIString("Loading (%d of %d)", this.loadedResources, this.totalResources);
+        }
+    },
+
     _updateButton: function()
     {
         this._launchButton.disabled = !this._currentCategoriesCount || this._auditRunning;
-        if (this._auditRunning)
-            this._launchButton.textContent = WebInspector.UIString("Running...");
-        else
-            this._launchButton.textContent = WebInspector.UIString("Run");
-    },
-
-    show: function(parentElement)
-    {
-        WebInspector.View.prototype.show.call(this, parentElement);
-        setTimeout(this.resize(), 0);
-    },
-
-    resize: function()
-    {
-        if (this._categoriesElement)
-            this._categoriesElement.style.height = (this._buttonContainerElement.totalOffsetTop - this._categoriesElement.totalOffsetTop) + "px";
     }
 }
 
diff --git a/WebCore/inspector/front-end/AuditResultView.js b/WebCore/inspector/front-end/AuditResultView.js
index ac818fb..2f4afbd 100644
--- a/WebCore/inspector/front-end/AuditResultView.js
+++ b/WebCore/inspector/front-end/AuditResultView.js
@@ -31,24 +31,14 @@
 WebInspector.AuditResultView = function(categoryResults)
 {
     WebInspector.View.call(this);
+    this.element.className = "audit-result-view";
 
-    this.element.id = "audit-result-view";
-
-    function entrySortFunction(a, b)
-    {
-        var result = b.type - a.type;
-        if (!result)
-            result = (a.value || "").localeCompare(b.value || "");
-        return result;
+    function categorySorter(a, b) {
+        return (a.title || "").localeCompare(b.title || "");
     }
-
-    for (var i = 0; i < categoryResults.length; ++i) {
-        var entries = categoryResults[i].entries;
-        if (entries) {
-            entries.sort(entrySortFunction);
-            this.element.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);
-        }
-    }
+    categoryResults.sort(categorySorter);
+    for (var i = 0; i < categoryResults.length; ++i)
+        this.element.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);
 }
 
 WebInspector.AuditResultView.prototype.__proto__ = WebInspector.View.prototype;
@@ -57,82 +47,60 @@
 WebInspector.AuditCategoryResultPane = function(categoryResult)
 {
     WebInspector.SidebarPane.call(this, categoryResult.title);
+    var treeOutlineElement = document.createElement("ol");
+    this.bodyElement.addStyleClass("audit-result-tree");
+    this.bodyElement.appendChild(treeOutlineElement);
+
+    this._treeOutline = new TreeOutline(treeOutlineElement);
+    this._treeOutline.expandTreeElementsWhenArrowing = true;
+
+    function ruleSorter(a, b)
+    {
+        var result = WebInspector.AuditRule.SeverityOrder[a.severity || 0] - WebInspector.AuditRule.SeverityOrder[b.severity || 0];
+        if (!result)
+            result = (a.value || "").localeCompare(b.value || "");
+        return result;
+    }
+
+    categoryResult.ruleResults.sort(ruleSorter);
+
+    for (var i = 0; i < categoryResult.ruleResults.length; ++i) {
+        var ruleResult = categoryResult.ruleResults[i];
+        var treeElement = this._appendResult(this._treeOutline, ruleResult);
+        treeElement.listItemElement.addStyleClass("audit-result");
+
+        if (ruleResult.severity) {
+            var severityElement = document.createElement("img");
+            severityElement.className = "severity-" + ruleResult.severity;
+            treeElement.listItemElement.appendChild(severityElement);
+        }
+    }
     this.expand();
-    for (var i = 0; i < categoryResult.entries.length; ++i)
-        this.bodyElement.appendChild(new WebInspector.AuditRuleResultPane(categoryResult.entries[i]).element);
+}
+
+WebInspector.AuditCategoryResultPane.prototype = {
+    _appendResult: function(parentTreeElement, result)
+    {
+        var title = result.value;
+        if (result.violationCount)
+            title = String.sprintf("%s (%d)", title, result.violationCount);
+
+        var treeElement = new TreeElement(title, null, !!result.children);
+        parentTreeElement.appendChild(treeElement);
+
+        if (result.className)
+            treeElement.listItemElement.addStyleClass(result.className);
+        if (result.children) {
+            for (var i = 0; i < result.children.length; ++i)
+                this._appendResult(treeElement, result.children[i]);
+        }
+        if (result.expanded) {
+            treeElement.listItemElement.removeStyleClass("parent");
+            treeElement.listItemElement.addStyleClass("parent-expanded");
+            treeElement.expand();
+        }
+        return treeElement;
+    }
 }
 
 WebInspector.AuditCategoryResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
-
-
-WebInspector.AuditRuleResultPane = function(ruleResult)
-{
-    WebInspector.SidebarPane.call(this, ruleResult.value);
-    if (!ruleResult.children)
-        return;
-
-    this._decorateRuleResult(ruleResult);
-
-    for (var i = 0; i < ruleResult.children.length; ++i) {
-        var section = new WebInspector.AuditRuleResultChildSection(ruleResult.children[i]);
-        this.bodyElement.appendChild(section.element);
-    }
-}
-
-WebInspector.AuditRuleResultPane.prototype = {
-    _decorateRuleResult: function(ruleResult)
-    {
-        if (ruleResult.type == WebInspector.AuditRuleResult.Type.NA)
-            return;
-
-        var scoreElement = document.createElement("img");
-        scoreElement.className = "score";
-        var className = (ruleResult.type == WebInspector.AuditRuleResult.Type.Violation) ? "red" : "green";
-        scoreElement.addStyleClass(className);
-        this.element.insertBefore(scoreElement, this.element.firstChild);
-    }
-}
-
-WebInspector.AuditRuleResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
-
-
-WebInspector.AuditRuleResultChildSection = function(entry)
-{
-    WebInspector.Section.call(this, entry.value);
-    var children = entry.children;
-    this._hasChildren = !!children && children.length;
-    if (!this._hasChildren)
-        this.element.addStyleClass("blank-section");
-    else {
-        this.contentElement = document.createElement("div");
-        this.contentElement.addStyleClass("section-content");
-        for (var i = 0; i < children.length; ++i) {
-            var paraElement = document.createElement("p");
-            paraElement.innerHTML = children[i].value;
-            this.contentElement.appendChild(paraElement);
-        }
-        this.contentElement.appendChild(paraElement);
-        this.element.appendChild(this.contentElement);
-    }
-}
-
-WebInspector.AuditRuleResultChildSection.prototype = {
-
-    // title is considered pure HTML
-    set title(x)
-    {
-        if (this._title === x)
-            return;
-        this._title = x;
-
-        this.titleElement.innerHTML = x;
-    },
-
-    expand: function()
-    {
-        if (this._hasChildren)
-            WebInspector.Section.prototype.expand.call(this);
-    }
-}
-
-WebInspector.AuditRuleResultChildSection.prototype.__proto__ = WebInspector.Section.prototype;
diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js
index 210b8a9..d2c5f09 100644
--- a/WebCore/inspector/front-end/AuditRules.js
+++ b/WebCore/inspector/front-end/AuditRules.js
@@ -42,27 +42,6 @@
     304: true // Underlying resource is cacheable
 }
 
-/**
- * @param {Array} array Array of Elements (outerHTML is used) or strings (plain value is used as innerHTML)
- */
-WebInspector.AuditRules.arrayAsUL = function(array, shouldLinkify)
-{
-    if (!array.length)
-        return "";
-    var ulElement = document.createElement("ul");
-    for (var i = 0; i < array.length; ++i) {
-        var liElement = document.createElement("li");
-        if (array[i] instanceof Element)
-            liElement.appendChild(array[i]);
-        else if (shouldLinkify)
-            liElement.appendChild(WebInspector.linkifyURLAsNode(array[i]));
-        else
-            liElement.innerHTML = array[i];
-        ulElement.appendChild(liElement);
-    }
-    return ulElement.outerHTML;
-}
-
 WebInspector.AuditRules.getDomainToResourcesMap = function(resources, types, regexp, needFullResources)
 {
     var domainToResourcesMap = {};
@@ -84,9 +63,9 @@
     return domainToResourcesMap;
 }
 
-WebInspector.AuditRules.evaluateInTargetWindow = function(func, callback)
+WebInspector.AuditRules.evaluateInTargetWindow = function(func, args, callback)
 {
-    InjectedScriptAccess.getDefault().evaluateOnSelf(func.toString(), callback);
+    InjectedScriptAccess.getDefault().evaluateOnSelf(func.toString(), args, callback);
 }
 
 
@@ -98,43 +77,29 @@
 WebInspector.AuditRules.GzipRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        try {
-            var commonMessage = undefined;
-            var totalSavings = 0;
-            var compressedSize = 0
-            var candidateSize = 0
-            var outputResources = [];
-            for (var i = 0, length = resources.length; i < length; ++i) {
-                var resource = resources[i];
-                if (this._shouldCompress(resource)) {
-                    var size = resource.contentLength;
-                    candidateSize += size;
-                    if (this._isCompressed(resource)) {
-                        compressedSize += size;
-                        continue;
-                    }
-                    if (!commonMessage)
-                        commonMessage = result.appendChild("");
-                    var savings = 2 * size / 3;
-                    totalSavings += savings;
-                    outputResources.push(
-                        String.sprintf("Compressing %s could save ~%s",
-                        WebInspector.linkifyURL(resource.url), Number.bytesToString(savings)));
+        var totalSavings = 0;
+        var compressedSize = 0;
+        var candidateSize = 0;
+        var summary = result.addChild("", true);
+        for (var i = 0, length = resources.length; i < length; ++i) {
+            var resource = resources[i];
+            if (this._shouldCompress(resource)) {
+                var size = resource.resourceSize;
+                candidateSize += size;
+                if (this._isCompressed(resource)) {
+                    compressedSize += size;
+                    continue;
                 }
+                var savings = 2 * size / 3;
+                totalSavings += savings;
+                summary.addChild(String.sprintf("%s could save ~%s", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings)));
+                result.violationCount++;
             }
-            if (commonMessage) {
-              commonMessage.value =
-                  String.sprintf("Compressing the following resources with gzip could reduce their " +
-                      "transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings));
-              commonMessage.appendChild(WebInspector.AuditRules.arrayAsUL(outputResources));
-              result.score = 100 * compressedSize / candidateSize;
-              result.type = WebInspector.AuditRuleResult.Type.Violation;
-            }
-        } catch(e) {
-            console.log(e);
-        } finally {
-            callback(result);
         }
+        if (!totalSavings)
+            return callback(null);
+        summary.value = String.sprintf("Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings));
+        callback(result);
     },
 
     _isCompressed: function(resource)
@@ -145,105 +110,100 @@
 
     _shouldCompress: function(resource)
     {
-        return WebInspector.Resource.Type.isTextType(resource.type) && resource.domain && resource.contentLength !== undefined && resource.contentLength > 150;
+        return WebInspector.Resource.Type.isTextType(resource.type) && resource.domain && resource.resourceSize !== undefined && resource.resourceSize > 150;
     }
 }
 
 WebInspector.AuditRules.GzipRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type, resourceTypeName, parametersObject)
+WebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type, resourceTypeName, allowedPerDomain)
 {
-    WebInspector.AuditRule.call(this, id, name, parametersObject);
+    WebInspector.AuditRule.call(this, id, name);
     this._type = type;
     this._resourceTypeName = resourceTypeName;
+    this._allowedPerDomain = allowedPerDomain;
 }
 
 WebInspector.AuditRules.CombineExternalResourcesRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        try {
-            var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type], WebInspector.URLRegExp);
-            var penalizedResourceCount = 0;
-            // TODO: refactor according to the chosen i18n approach
-            for (var domain in domainToResourcesMap) {
-                var domainResources = domainToResourcesMap[domain];
-                var extraResourceCount = domainResources.length - this.getValue("AllowedPerDomain");
-                if (extraResourceCount <= 0)
-                    continue;
-                penalizedResourceCount += extraResourceCount - 1;
-                result.appendChild(
-                    String.sprintf("There are %d %s files served from %s. Consider combining them into as few files as possible.",
-                    domainResources.length, this._resourceTypeName, domain));
-            }
-            result.score = 100 - (penalizedResourceCount * this.getValue("ScorePerResource"));
-            result.type = WebInspector.AuditRuleResult.Type.Hint;
-        } catch(e) {
-            console.log(e);
-        } finally {
-            callback(result);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type], WebInspector.URLRegExp);
+        var penalizedResourceCount = 0;
+        // TODO: refactor according to the chosen i18n approach
+        var summary = result.addChild("", true);
+        for (var domain in domainToResourcesMap) {
+            var domainResources = domainToResourcesMap[domain];
+            var extraResourceCount = domainResources.length - this._allowedPerDomain;
+            if (extraResourceCount <= 0)
+                continue;
+            penalizedResourceCount += extraResourceCount - 1;
+            summary.addChild(String.sprintf("%d %s resources served from %s.", domainResources.length, this._resourceTypeName, WebInspector.AuditRuleResult.resourceDomain(domain)));
+            result.violationCount += domainResources.length;
         }
+        if (!penalizedResourceCount)
+            return callback(null);
+
+        summary.value = "There are multiple resources served from same domain. Consider combining them into as few files as possible.";
+        callback(result);
     }
-};
+}
 
 WebInspector.AuditRules.CombineExternalResourcesRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CombineJsResourcesRule = function(parametersObject) {
-    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externaljs", "Combine external JavaScript", WebInspector.Resource.Type.Script, "JS", parametersObject);
+WebInspector.AuditRules.CombineJsResourcesRule = function(allowedPerDomain) {
+    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externaljs", "Combine external JavaScript", WebInspector.Resource.Type.Script, "JavaScript", allowedPerDomain);
 }
 
 WebInspector.AuditRules.CombineJsResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
 
 
-WebInspector.AuditRules.CombineCssResourcesRule = function(parametersObject) {
-    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externalcss", "Combine external CSS", WebInspector.Resource.Type.Stylesheet, "CSS", parametersObject);
+WebInspector.AuditRules.CombineCssResourcesRule = function(allowedPerDomain) {
+    WebInspector.AuditRules.CombineExternalResourcesRule.call(this, "page-externalcss", "Combine external CSS", WebInspector.Resource.Type.Stylesheet, "CSS", allowedPerDomain);
 }
 
 WebInspector.AuditRules.CombineCssResourcesRule.prototype.__proto__ = WebInspector.AuditRules.CombineExternalResourcesRule.prototype;
 
 
-WebInspector.AuditRules.MinimizeDnsLookupsRule = function(parametersObject) {
-    WebInspector.AuditRule.call(this, "network-minimizelookups", "Minimize DNS lookups", parametersObject);
+WebInspector.AuditRules.MinimizeDnsLookupsRule = function(hostCountThreshold) {
+    WebInspector.AuditRule.call(this, "network-minimizelookups", "Minimize DNS lookups");
+    this._hostCountThreshold = hostCountThreshold;
 }
 
 WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        try {
-            var violationDomains = [];
-            var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined, WebInspector.URLRegExp);
-            for (var domain in domainToResourcesMap) {
-                if (domainToResourcesMap[domain].length > 1)
-                    continue;
-                var match = domain.match(WebInspector.URLRegExp);
-                if (!match)
-                    continue;
-                if (!match[2].search(WebInspector.AuditRules.IPAddressRegexp))
-                    continue; // an IP address
-                violationDomains.push(match[2]);
-            }
-            if (violationDomains.length <= this.getValue("HostCountThreshold"))
-                return;
-            var commonMessage = result.appendChild(
-                "The following domains only serve one resource each. If possible, avoid the extra DNS " +
-                "lookups by serving these resources from existing domains.");
-            commonMessage.appendChild(WebInspector.AuditRules.arrayAsUL(violationDomains));
-            result.score = 100 - violationDomains.length * this.getValue("ViolationDomainScore");
-        } catch(e) {
-            console.log(e);
-        } finally {
-            callback(result);
+        var summary = result.addChild("");
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined, WebInspector.URLRegExp);
+        for (var domain in domainToResourcesMap) {
+            if (domainToResourcesMap[domain].length > 1)
+                continue;
+            var match = domain.match(WebInspector.URLRegExp);
+            if (!match)
+                continue;
+            if (!match[2].search(WebInspector.AuditRules.IPAddressRegexp))
+                continue; // an IP address
+            summary.addSnippet(match[2]);
+            result.violationCount++;
         }
+        if (!summary.children || summary.children.length <= this._hostCountThreshold)
+            return callback(null);
+
+        summary.value = "The following domains only serve one resource each. If possible, avoid the extra DNS lookups by serving these resources from existing domains.";
+        callback(result);
     }
 }
 
 WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.ParallelizeDownloadRule = function(parametersObject)
+WebInspector.AuditRules.ParallelizeDownloadRule = function(optimalHostnameCount, minRequestThreshold, minBalanceThreshold)
 {
-    WebInspector.AuditRule.call(this, "network-parallelizehosts", "Parallelize downloads across hostnames", parametersObject);
+    WebInspector.AuditRule.call(this, "network-parallelizehosts", "Parallelize downloads across hostnames");
+    this._optimalHostnameCount = optimalHostnameCount;
+    this._minRequestThreshold = minRequestThreshold;
+    this._minBalanceThreshold = minBalanceThreshold;
 }
 
 
@@ -257,65 +217,50 @@
             return (aCount < bCount) ? 1 : (aCount == bCount) ? 0 : -1;
         }
 
-        try {
-            var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(
-                resources,
-                [WebInspector.Resource.Type.Stylesheet, WebInspector.Resource.Type.Image],
-                WebInspector.URLRegExp,
-                true);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(
+            resources,
+            [WebInspector.Resource.Type.Stylesheet, WebInspector.Resource.Type.Image],
+            WebInspector.URLRegExp,
+            true);
 
-            var hosts = [];
-            for (var url in domainToResourcesMap)
-                hosts.push(url);
+        var hosts = [];
+        for (var url in domainToResourcesMap)
+            hosts.push(url);
 
-            if (!hosts.length)
-                return; // no hosts (local file or something)
+        if (!hosts.length)
+            return callback(null); // no hosts (local file or something)
 
-            hosts.sort(hostSorter);
+        hosts.sort(hostSorter);
 
-            var optimalHostnameCount = this.getValue("OptimalHostnameCount");
-            if (hosts.length > optimalHostnameCount)
-                hosts.splice(optimalHostnameCount);
+        var optimalHostnameCount = this._optimalHostnameCount;
+        if (hosts.length > optimalHostnameCount)
+            hosts.splice(optimalHostnameCount);
 
-            var busiestHostResourceCount = domainToResourcesMap[hosts[0]].length;
-            var resourceCountAboveThreshold = busiestHostResourceCount - this.getValue("MinRequestThreshold");
-            if (resourceCountAboveThreshold <= 0)
-                return;
+        var busiestHostResourceCount = domainToResourcesMap[hosts[0]].length;
+        var resourceCountAboveThreshold = busiestHostResourceCount - this._minRequestThreshold;
+        if (resourceCountAboveThreshold <= 0)
+            return callback(null);
 
-            var avgResourcesPerHost = 0;
-            for (var i = 0, size = hosts.length; i < size; ++i)
-                avgResourcesPerHost += domainToResourcesMap[hosts[i]].length;
+        var avgResourcesPerHost = 0;
+        for (var i = 0, size = hosts.length; i < size; ++i)
+            avgResourcesPerHost += domainToResourcesMap[hosts[i]].length;
 
-            // Assume optimal parallelization.
-            avgResourcesPerHost /= optimalHostnameCount;
+        // Assume optimal parallelization.
+        avgResourcesPerHost /= optimalHostnameCount;
+        avgResourcesPerHost = Math.max(avgResourcesPerHost, 1);
 
-            avgResourcesPerHost = Math.max(avgResourcesPerHost, 1);
+        var pctAboveAvg = (resourceCountAboveThreshold / avgResourcesPerHost) - 1.0;
+        var minBalanceThreshold = this._minBalanceThreshold;
+        if (pctAboveAvg < minBalanceThreshold)
+            return callback(null);
 
-            var pctAboveAvg = (resourceCountAboveThreshold / avgResourcesPerHost) - 1.0;
+        var resourcesOnBusiestHost = domainToResourcesMap[hosts[0]];
+        var entry = result.addChild(String.sprintf("This page makes %d parallelizable requests to %s. Increase download parallelization by distributing the following requests across multiple hostnames.", busiestHostResourceCount, hosts[0]), true);
+        for (var i = 0; i < resourcesOnBusiestHost.length; ++i)
+            entry.addURL(resourcesOnBusiestHost[i].url);
 
-            var minBalanceThreshold = this.getValue("MinBalanceThreshold");
-            if (pctAboveAvg < minBalanceThreshold) {
-                result.score = 100;
-                return;
-            }
-
-            result.score = (1 - (pctAboveAvg - minBalanceThreshold)) * 100;
-            result.type = WebInspector.AuditRuleResult.Type.Hint;
-
-            var resourcesOnBusiestHost = domainToResourcesMap[hosts[0]];
-            var commonMessage = result.appendChild(
-                String.sprintf("This page makes %d parallelizable requests to %s" +
-                ". Increase download parallelization by distributing the following" +
-                " requests across multiple hostnames.", busiestHostResourceCount, hosts[0]));
-            var outputResources = [];
-            for (var i = 0, size = resourcesOnBusiestHost.length; i < size; ++i)
-                outputResources.push(resourcesOnBusiestHost[i].url);
-            commonMessage.appendChild(WebInspector.AuditRules.arrayAsUL(outputResources, true));
-        } catch(e) {
-            console.log(e);
-        } finally {
-            callback(result);
-        }
+        result.violationCount = resourcesOnBusiestHost.length;
+        callback(result);
     }
 }
 
@@ -324,156 +269,132 @@
 
 // The reported CSS rule size is incorrect (parsed != original in WebKit),
 // so use percentages instead, which gives a better approximation.
-WebInspector.AuditRules.UnusedCssRule = function(parametersObject)
+WebInspector.AuditRules.UnusedCssRule = function()
 {
-    WebInspector.AuditRule.call(this, "page-unusedcss", "Remove unused CSS", parametersObject);
+    WebInspector.AuditRule.call(this, "page-unusedcss", "Remove unused CSS rules");
 }
 
 WebInspector.AuditRules.UnusedCssRule.prototype = {
-    _getUnusedStylesheetRatioMessage: function(unusedLength, type, location, styleSheetLength)
-    {
-        var url = type === "href"
-            ? WebInspector.linkifyURL(location)
-            : String.sprintf("Inline block #%s", location);
-        var pctUnused = Math.round(unusedLength / styleSheetLength * 100);
-        return String.sprintf("%s: %f%% (estimated) is not used by the current page.", url, pctUnused);
-    },
-
-    _getUnusedTotalRatioMessage: function(unusedLength, totalLength)
-    {
-        var pctUnused = Math.round(unusedLength / totalLength * 100);
-        return String.sprintf("%d%% of CSS (estimated) is not used by the current page.", pctUnused);
-    },
-
     doRun: function(resources, result, callback)
     {
         var self = this;
-        function evalCallback(evalResult, isException) {
-            try {
-              if (isException)
-                  return;
+        function evalCallback(styleSheets) {
+            if (!styleSheets.length)
+                return callback(null);
 
-              var totalLength = 0;
-              var totalUnusedLength = 0;
-              var topMessage;
-              var styleSheetMessage;
-              for (var i = 0; i < evalResult.length; ) {
-                  var type = evalResult[i++];
-                  if (type === "totalLength") {
-                      totalLength = evalResult[i++];
-                      continue;
-                  }
+            var pseudoSelectorRegexp = /:hover|:link|:active|:visited|:focus|:before|:after/;
+            var selectors = [];
+            var testedSelectors = {};
+            for (var i = 0; i < styleSheets.length; ++i) {
+                var styleSheet = styleSheets[i];
+                for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
+                    var rule = styleSheet.cssRules[curRule];
+                    if (rule.selectorText.match(pseudoSelectorRegexp))
+                        continue;
+                    selectors.push(rule.selectorText);
+                    testedSelectors[rule.selectorText] = 1;
+                }
+            }
 
-                  var styleSheetLength = evalResult[i++];
-                  var location = evalResult[i++];
-                  var unusedRules = evalResult[i++];
-                  styleSheetMessage = undefined;
-                  if (!topMessage)
-                      topMessage = result.appendChild("");
+            function selectorsCallback(callback, styleSheets, testedSelectors, foundSelectors)
+            {
+                var inlineBlockOrdinal = 0;
+                var totalStylesheetSize = 0;
+                var totalUnusedStylesheetSize = 0;
+                var summary;
 
-                  var totalUnusedRuleLength = 0;
-                  var ruleSelectors = [];
-                  for (var j = 0; j < unusedRules.length; ++j) {
-                      var rule = unusedRules[j];
-                      totalUnusedRuleLength += parseInt(rule[1]);
-                      if (!styleSheetMessage)
-                          styleSheetMessage = result.appendChild("");
-                      ruleSelectors.push(rule[0]);
-                  }
-                  styleSheetMessage.appendChild(WebInspector.AuditRules.arrayAsUL(ruleSelectors));
+                for (var i = 0; i < styleSheets.length; ++i) {
+                    var styleSheet = styleSheets[i];
+                    var stylesheetSize = 0;
+                    var unusedStylesheetSize = 0;
+                    var unusedRules = [];
+                    for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
+                        var rule = styleSheet.cssRules[curRule];
+                        var textLength = rule.cssText ? rule.cssText.length : 0;
+                        stylesheetSize += textLength;
+                        if (!testedSelectors[rule.selectorText] || foundSelectors[rule.selectorText])
+                            continue;
+                        unusedStylesheetSize += textLength;
+                        unusedRules.push(rule.selectorText);
+                    }
+                    totalStylesheetSize += stylesheetSize;
+                    totalUnusedStylesheetSize += unusedStylesheetSize;
 
-                  styleSheetMessage.value = self._getUnusedStylesheetRatioMessage(totalUnusedRuleLength, type, location, styleSheetLength);
-                  totalUnusedLength += totalUnusedRuleLength;
-              }
-              if (totalUnusedLength) {
-                  var totalUnusedPercent = totalUnusedLength / totalLength;
-                  topMessage.value = self._getUnusedTotalRatioMessage(totalUnusedLength, totalLength);
-                  var pctMultiplier = Math.log(Math.max(200, totalUnusedLength - 800)) / 7 - 0.6;
-                  result.score = (1 - totalUnusedPercent * pctMultiplier) * 100;
-                  result.type = WebInspector.AuditRuleResult.Type.Hint;
-              } else
-                  result.score = 100;
-            } catch(e) {
-                console.log(e);
-            } finally {
+                    if (!unusedRules.length)
+                        continue;
+
+                    var url = styleSheet.href ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.href) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
+                    var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);
+                    if (!summary)
+                        summary = result.addChild("", true);
+                    var entry = summary.addChild(String.sprintf("%s: %d%% (estimated) is not used by the current page.", url, pctUnused));
+
+                    for (var j = 0; j < unusedRules.length; ++j)
+                        entry.addSnippet(unusedRules[j]);
+
+                    result.violationCount += unusedRules.length;
+                }
+
+                if (!totalUnusedStylesheetSize)
+                    return callback(null);
+
+                var totalUnusedPercent = Math.round(100 * totalUnusedStylesheetSize / totalStylesheetSize);
+                summary.value = String.sprintf("%d%% of CSS (estimated) is not used by the current page.", totalUnusedPercent);
+
                 callback(result);
             }
+
+            function routine(selectorArray)
+            {
+                var result = {};
+                for (var i = 0; i < selectorArray.length; ++i) {
+                    try {
+                        var nodes = document.querySelectorAll(selectorArray[i]);
+                        if (nodes && nodes.length)
+                            result[selectorArray[i]] = true;
+                    } catch(e) {
+                        // ignore and mark as unused
+                    }
+                }
+                return result;
+            }
+
+            WebInspector.AuditRules.evaluateInTargetWindow(routine, [selectors], selectorsCallback.bind(null, callback, styleSheets, testedSelectors));
         }
 
         function routine()
         {
             var styleSheets = document.styleSheets;
             if (!styleSheets)
-                return {};
-            var styleSheetToUnusedRules = [];
-            var inlineBlockOrdinal = 0;
-            var totalCSSLength = 0;
-            var pseudoSelectorRegexp = /:hover|:link|:active|:visited|:focus/;
-            for (var i = 0; i < styleSheets.length; ++i) {
-                var styleSheet = styleSheets[i];
-                if (!styleSheet.cssRules)
-                    continue;
-                var currentStyleSheetSize = 0;
-                var unusedRules = [];
-                for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
-                    var rule = styleSheet.cssRules[curRule];
-                    var textLength = rule.cssText ? rule.cssText.length : 0;
-                    currentStyleSheetSize += textLength;
-                    totalCSSLength += textLength;
-                    if (rule.type !== 1 || rule.selectorText.match(pseudoSelectorRegexp))
-                        continue;
-                    var nodes = document.querySelectorAll(rule.selectorText);
-                    if (nodes && nodes.length)
-                        continue;
-                    unusedRules.push([rule.selectorText, textLength]);
-                }
-                if (unusedRules.length) {
-                    styleSheetToUnusedRules.push(styleSheet.href ? "href" : "inline");
-                    styleSheetToUnusedRules.push(currentStyleSheetSize);
-                    styleSheetToUnusedRules.push(styleSheet.href ? styleSheet.href : ++inlineBlockOrdinal);
-                    styleSheetToUnusedRules.push(unusedRules);
-                }
-            }
-            styleSheetToUnusedRules.push("totalLength");
-            styleSheetToUnusedRules.push(totalCSSLength);
-            return styleSheetToUnusedRules;
+                return false;
+
+            return routineResult;
         }
 
-        WebInspector.AuditRules.evaluateInTargetWindow(routine, evalCallback);
+        InspectorBackend.getAllStyles(WebInspector.Callback.wrap(evalCallback));
     }
 }
 
 WebInspector.AuditRules.UnusedCssRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CacheControlRule = function(id, name, parametersObject)
+WebInspector.AuditRules.CacheControlRule = function(id, name)
 {
-    WebInspector.AuditRule.call(this, id, name, parametersObject);
+    WebInspector.AuditRule.call(this, id, name);
 }
 
 WebInspector.AuditRules.CacheControlRule.MillisPerMonth = 1000 * 60 * 60 * 24 * 30;
 
 WebInspector.AuditRules.CacheControlRule.prototype = {
 
-    InfoCheck: -1,
-    FailCheck: 0,
-    WarningCheck: 1,
-    SevereCheck: 2,
-
     doRun: function(resources, result, callback)
     {
-        try {
-            var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(resources);
-            if (cacheableAndNonCacheableResources[0].length) {
-                result.score = 100;
-                this.runChecks(cacheableAndNonCacheableResources[0], result);
-            }
-            this.handleNonCacheableResources(cacheableAndNonCacheableResources[1], result);
-        } catch(e) {
-            console.log(e);
-        } finally {
-            callback(result);
-        }
+        var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(resources);
+        if (cacheableAndNonCacheableResources[0].length)
+            this.runChecks(cacheableAndNonCacheableResources[0], result);
+        this.handleNonCacheableResources(cacheableAndNonCacheableResources[1], result);
+
+        callback(result);
     },
 
     handleNonCacheableResources: function()
@@ -495,36 +416,19 @@
         return processedResources;
     },
 
-    execCheck: function(messageText, resourceCheckFunction, resources, severity, result)
+    execCheck: function(messageText, resourceCheckFunction, resources, result)
     {
-        var topMessage;
-        var failingResources = 0;
         var resourceCount = resources.length;
-        var outputResources = [];
+        var urls = [];
         for (var i = 0; i < resourceCount; ++i) {
-            if (resourceCheckFunction.call(this, resources[i])) {
-                ++failingResources;
-                if (!topMessage)
-                    topMessage = result.appendChild(messageText);
-                outputResources.push(resources[i].url);
-            }
+            if (resourceCheckFunction.call(this, resources[i]))
+                urls.push(resources[i].url);
         }
-        if (topMessage)
-            topMessage.appendChild(WebInspector.AuditRules.arrayAsUL(outputResources, true));
-        if (failingResources) {
-            switch (severity) {
-                case this.FailCheck:
-                    result.score = 0;
-                    result.type = WebInspector.AuditRuleResult.Type.Violation;
-                    break;
-                case this.SevereCheck:
-                case this.WarningCheck:
-                    result.score -= 50 * severity * failingResources / resourceCount;
-                    result.type = WebInspector.AuditRuleResult.Type.Hint;
-                    break;
-            }
+        if (urls.length) {
+            var entry = result.addChild(messageText, true);
+            entry.addURLs(urls);
+            result.violationCount += urls.length;
         }
-        return topMessage;
     },
 
     freshnessLifetimeGreaterThan: function(resource, timeMs)
@@ -612,47 +516,34 @@
 WebInspector.AuditRules.CacheControlRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.BrowserCacheControlRule = function(parametersObject)
+WebInspector.AuditRules.BrowserCacheControlRule = function()
 {
-    WebInspector.AuditRules.CacheControlRule.call(this, "http-browsercache", "Leverage browser caching", parametersObject);
+    WebInspector.AuditRules.CacheControlRule.call(this, "http-browsercache", "Leverage browser caching");
 }
 
 WebInspector.AuditRules.BrowserCacheControlRule.prototype = {
     handleNonCacheableResources: function(resources, result)
     {
         if (resources.length) {
-            var message = result.appendChild(
-                "The following resources are explicitly non-cacheable. Consider making them cacheable if possible:");
-            var resourceOutput = [];
+            var entry = result.addChild("The following resources are explicitly non-cacheable. Consider making them cacheable if possible:", true);
+            result.violationCount += resources.length;
             for (var i = 0; i < resources.length; ++i)
-                resourceOutput.push(resources[i].url);
-            message.appendChild(WebInspector.AuditRules.arrayAsUL(resourceOutput, true));
+                entry.addURL(resources[i].url);
         }
     },
 
     runChecks: function(resources, result, callback)
     {
-        this.execCheck(
-            "The following resources are missing a cache expiration." +
-            " Resources that do not specify an expiration may not be" +
-            " cached by browsers:",
-            this._missingExpirationCheck, resources, this.SevereCheck, result);
-        this.execCheck(
-            "The following resources specify a \"Vary\" header that" +
-            " disables caching in most versions of Internet Explorer:",
-            this._varyCheck, resources, this.SevereCheck, result);
-        this.execCheck(
-            "The following cacheable resources have a short" +
-            " freshness lifetime:",
-            this._oneMonthExpirationCheck, resources, this.WarningCheck, result);
+        this.execCheck("The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers:",
+            this._missingExpirationCheck, resources, result);
+        this.execCheck("The following resources specify a \"Vary\" header that disables caching in most versions of Internet Explorer:",
+            this._varyCheck, resources, result);
+        this.execCheck("The following cacheable resources have a short freshness lifetime:",
+            this._oneMonthExpirationCheck, resources, result);
 
         // Unable to implement the favicon check due to the WebKit limitations.
-
-        this.execCheck(
-            "To further improve cache hit rate, specify an expiration" +
-            " one year in the future for the following cacheable" +
-            " resources:",
-            this._oneYearExpirationCheck, resources, this.InfoCheck, result);
+        this.execCheck("To further improve cache hit rate, specify an expiration one year in the future for the following cacheable resources:",
+            this._oneYearExpirationCheck, resources, result);
     },
 
     _missingExpirationCheck: function(resource)
@@ -691,26 +582,19 @@
 WebInspector.AuditRules.BrowserCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
 
 
-WebInspector.AuditRules.ProxyCacheControlRule = function(parametersObject) {
-    WebInspector.AuditRules.CacheControlRule.call(this, "http-proxycache", "Leverage proxy caching", parametersObject);
+WebInspector.AuditRules.ProxyCacheControlRule = function() {
+    WebInspector.AuditRules.CacheControlRule.call(this, "http-proxycache", "Leverage proxy caching");
 }
 
 WebInspector.AuditRules.ProxyCacheControlRule.prototype = {
     runChecks: function(resources, result, callback)
     {
-        this.execCheck(
-            "Resources with a \"?\" in the URL are not cached by most" +
-            " proxy caching servers:",
-            this._questionMarkCheck, resources, this.WarningCheck, result);
-        this.execCheck(
-            "Consider adding a \"Cache-Control: public\" header to the" +
-            " following resources:",
-            this._publicCachingCheck, resources, this.InfoCheck, result);
-        this.execCheck(
-            "The following publicly cacheable resources contain" +
-            " a Set-Cookie header. This security vulnerability" +
-            " can cause cookies to be shared by multiple users.",
-            this._setCookieCacheableCheck, resources, this.FailCheck, result);
+        this.execCheck("Resources with a \"?\" in the URL are not cached by most proxy caching servers:",
+            this._questionMarkCheck, resources, result);
+        this.execCheck("Consider adding a \"Cache-Control: public\" header to the following resources:",
+            this._publicCachingCheck, resources, result);
+        this.execCheck("The following publicly cacheable resources contain a Set-Cookie header. This security vulnerability can cause cookies to be shared by multiple users.",
+            this._setCookieCacheableCheck, resources, result);
     },
 
     _questionMarkCheck: function(resource)
@@ -735,102 +619,104 @@
 WebInspector.AuditRules.ProxyCacheControlRule.prototype.__proto__ = WebInspector.AuditRules.CacheControlRule.prototype;
 
 
-WebInspector.AuditRules.ImageDimensionsRule = function(parametersObject)
+WebInspector.AuditRules.ImageDimensionsRule = function()
 {
-    WebInspector.AuditRule.call(this, "page-imagedims", "Specify image dimensions", parametersObject);
+    WebInspector.AuditRule.call(this, "page-imagedims", "Specify image dimensions");
 }
 
 WebInspector.AuditRules.ImageDimensionsRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        function evalCallback(evalResult, isException)
+        function doneCallback(context)
         {
-            try {
-                if (isException)
-                    return;
-                if (!evalResult || !evalResult.totalImages)
-                    return;
-                result.score = 100;
-                var topMessage = result.appendChild(
-                    "A width and height should be specified for all images in order to " +
-                    "speed up page display. The following image(s) are missing a width and/or height:");
-                var map = evalResult.map;
-                var outputResources = [];
-                for (var url in map) {
-                    var value = WebInspector.linkifyURL(url);
-                    if (map[url] > 1)
-                        value += " (" + map[url] + " uses)";
-                    outputResources.push(value);
-                    result.score -= this.getValue("ScorePerImageUse") * map[url];
-                    result.type = WebInspector.AuditRuleResult.Type.Hint;
-                }
-                topMessage.appendChild(WebInspector.AuditRules.arrayAsUL(outputResources));
-            } catch(e) {
-                console.log(e);
-            } finally {
-                callback(result);
+            var map = context.urlToNoDimensionCount;
+            for (var url in map) {
+                var entry = entry || result.addChild("A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:", true);
+                var value = WebInspector.AuditRuleResult.linkifyDisplayName(url);
+                if (map[url] > 1)
+                    value += String.sprintf(" (%d uses)", map[url]);
+                entry.addChild(value);
+                result.violationCount++;
             }
+            callback(entry ? result : null);
         }
 
-        function routine()
+        function imageStylesReady(imageId, context, styles)
         {
-            var images = document.getElementsByTagName("img");
-            const widthRegExp = /width[^:;]*:/gim;
-            const heightRegExp = /height[^:;]*:/gim;
+            --context.imagesLeft;
 
-            function hasDimension(element, cssText, rules, regexp, attributeName) {
-                if (element.attributes.getNamedItem(attributeName) != null || (cssText && cssText.match(regexp)))
-                    return true;
-
-                if (!rules)
-                    return false;
-                for (var i = 0; i < rules.length; ++i) {
-                    if (rules.item(i).style.cssText.match(regexp))
-                        return true;
-                }
-                return false;
-            }
-
-            function hasWidth(element, cssText, rules) {
-                return hasDimension(element, cssText, rules, widthRegExp, "width");
-            }
-
-            function hasHeight(element, cssText, rules) {
-                return hasDimension(element, cssText, rules, heightRegExp, "height");
-            }
-
-            var urlToNoDimensionCount = {};
-            var found = false;
-            for (var i = 0; i < images.length; ++i) {
-                var image = images[i];
-                if (!image.src)
-                    continue;
-                var position = document.defaultView.getComputedStyle(image).getPropertyValue("position");
-                if (position === "absolute")
-                    continue;
-                var cssText = (image.style && image.style.cssText) ? image.style.cssText : "";
-                var rules = document.defaultView.getMatchedCSSRules(image, "", true);
-                if (!hasWidth(image, cssText, rules) || !hasHeight(image, cssText, rules)) {
-                    found = true;
-                    if (urlToNoDimensionCount.hasOwnProperty(image.src))
-                        ++urlToNoDimensionCount[image.src];
-                    else
-                        urlToNoDimensionCount[image.src] = 1;
+            const node = WebInspector.domAgent.nodeForId(imageId);
+            var src = node.getAttribute("src");
+            for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {
+                if (frameOwnerCandidate.documentURL) {
+                    var completeSrc = WebInspector.completeURL(frameOwnerCandidate.documentURL, src);
+                    break;
                 }
             }
-            return found ? {totalImages: images.length, map: urlToNoDimensionCount} : null;
+            if (completeSrc)
+                src = completeSrc;
+
+            const computedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+            if (computedStyle.getPropertyValue("position") === "absolute") {
+                if (!context.imagesLeft)
+                    doneCallback(context);
+                return;
+            }
+
+            var widthFound = "width" in styles.styleAttributes;
+            var heightFound = "height" in styles.styleAttributes;
+
+            for (var i = styles.matchedCSSRules.length - 1; i >= 0 && !(widthFound && heightFound); --i) {
+                var style = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]).style;
+                if (style.getPropertyValue("width") !== "")
+                    widthFound = true;
+                if (style.getPropertyValue("height") !== "")
+                    heightFound = true;
+            }
+            
+            if (!widthFound || !heightFound) {
+                if (src in context.urlToNoDimensionCount)
+                    ++context.urlToNoDimensionCount[src];
+                else
+                    context.urlToNoDimensionCount[src] = 1;
+            }
+
+            if (!context.imagesLeft)
+                doneCallback(context);
         }
 
-        WebInspector.AuditRules.evaluateInTargetWindow(routine, evalCallback.bind(this));
+        function receivedImages(imageIds)
+        {
+            if (!imageIds || !imageIds.length)
+                return callback(null);
+            var context = {imagesLeft: imageIds.length, urlToNoDimensionCount: {}};
+            for (var i = imageIds.length - 1; i >= 0; --i)
+                InspectorBackend.getStyles(WebInspector.Callback.wrap(imageStylesReady.bind(this, imageIds[i], context)), imageIds[i], true);
+        }
+
+        function pushImageNodes()
+        {
+            const nodeIds = [];
+            var nodes = document.getElementsByTagName("img");
+            for (var i = 0; i < nodes.length; ++i) {
+                if (!nodes[i].src)
+                    continue;
+                var nodeId = this.getNodeId(nodes[i]);
+                nodeIds.push(nodeId);
+            }
+            return nodeIds;
+        }
+
+        WebInspector.AuditRules.evaluateInTargetWindow(pushImageNodes, null, receivedImages);
     }
 }
 
 WebInspector.AuditRules.ImageDimensionsRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CssInHeadRule = function(parametersObject)
+WebInspector.AuditRules.CssInHeadRule = function()
 {
-    WebInspector.AuditRule.call(this, "page-cssinhead", "Put CSS in the document head", parametersObject);
+    WebInspector.AuditRule.call(this, "page-cssinhead", "Put CSS in the document head");
 }
 
 WebInspector.AuditRules.CssInHeadRule.prototype = {
@@ -838,36 +724,24 @@
     {
         function evalCallback(evalResult, isException)
         {
-            try {
-                if (isException)
-                    return;
-                if (!evalResult)
-                    return;
-                result.score = 100;
-                var outputMessages = [];
-                for (var url in evalResult) {
-                    var urlViolations = evalResult[url];
-                    var topMessage = result.appendChild(
-                        String.sprintf("CSS in the %s document body adversely impacts rendering performance.",
-                        WebInspector.linkifyURL(url)));
-                    if (urlViolations[0]) {
-                        outputMessages.push(
-                            String.sprintf("%s style block(s) in the body should be moved to the document head.", urlViolations[0]));
-                        result.score -= this.getValue("InlineURLScore") * urlViolations[0];
-                    }
-                    for (var i = 0; i < urlViolations[1].length; ++i) {
-                        outputMessages.push(
-                            String.sprintf("Link node %s should be moved to the document head", WebInspector.linkifyURL(urlViolations[1])));
-                    }
-                    result.score -= this.getValue("InlineStylesheetScore") * urlViolations[1];
-                    result.type = WebInspector.AuditRuleResult.Type.Hint;
+            if (isException || !evalResult)
+                return callback(null);
+
+            var summary = result.addChild("");
+
+            var outputMessages = [];
+            for (var url in evalResult) {
+                var urlViolations = evalResult[url];
+                if (urlViolations[0]) {
+                    result.addChild(String.sprintf("%s style block(s) in the %s body should be moved to the document head.", urlViolations[0], WebInspector.AuditRuleResult.linkifyDisplayName(url)));
+                    result.violationCount += urlViolations[0];
                 }
-                topMessage.appendChild(WebInspector.AuditRules.arrayAsUL(outputMessages));
-            } catch(e) {
-                console.log(e);
-            } finally {
-                callback(result);
+                for (var i = 0; i < urlViolations[1].length; ++i)
+                    result.addChild(String.sprintf("Link node %s should be moved to the document head in %s", WebInspector.AuditRuleResult.linkifyDisplayName(urlViolations[1][i]), WebInspector.AuditRuleResult.linkifyDisplayName(url)));
+                result.violationCount += urlViolations[1].length;
             }
+            summary.value = String.sprintf("CSS in the document body adversely impacts rendering performance.");
+            callback(result);
         }
 
         function routine()
@@ -891,112 +765,81 @@
             var urlToViolationsArray = {};
             var found = false;
             for (var i = 0; i < views.length; ++i) {
-              var view = views[i];
-              if (!view.document)
-                  continue;
+                var view = views[i];
+                if (!view.document)
+                    continue;
 
-              var inlineStyles = view.document.querySelectorAll("body style");
-              var inlineStylesheets = view.document.querySelectorAll(
-                  "body link[rel~='stylesheet'][href]");
-              if (!inlineStyles.length && !inlineStylesheets.length)
-                  continue;
+                var inlineStyles = view.document.querySelectorAll("body style");
+                var inlineStylesheets = view.document.querySelectorAll("body link[rel~='stylesheet'][href]");
+                if (!inlineStyles.length && !inlineStylesheets.length)
+                    continue;
 
-              found = true;
-              var inlineStylesheetHrefs = [];
-              for (var j = 0; j < inlineStylesheets.length; ++j)
-                  inlineStylesheetHrefs.push(inlineStylesheets[j].href);
-
-              urlToViolationsArray[view.location.href] =
-                  [inlineStyles.length, inlineStylesheetHrefs];
+                found = true;
+                var inlineStylesheetHrefs = [];
+                for (var j = 0; j < inlineStylesheets.length; ++j)
+                    inlineStylesheetHrefs.push(inlineStylesheets[j].href);
+                urlToViolationsArray[view.location.href] = [inlineStyles.length, inlineStylesheetHrefs];
             }
             return found ? urlToViolationsArray : null;
         }
 
-        WebInspector.AuditRules.evaluateInTargetWindow(routine, evalCallback);
+        WebInspector.AuditRules.evaluateInTargetWindow(routine, null, evalCallback);
     }
 }
 
 WebInspector.AuditRules.CssInHeadRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.StylesScriptsOrderRule = function(parametersObject)
+WebInspector.AuditRules.StylesScriptsOrderRule = function()
 {
-    WebInspector.AuditRule.call(this, "page-stylescriptorder", "Optimize the order of styles and scripts", parametersObject);
+    WebInspector.AuditRule.call(this, "page-stylescriptorder", "Optimize the order of styles and scripts");
 }
 
 WebInspector.AuditRules.StylesScriptsOrderRule.prototype = {
     doRun: function(resources, result, callback)
     {
-        function evalCallback(evalResult, isException)
+        function evalCallback(resultValue, isException)
         {
-            try {
-                if (isException)
-                    return;
-                if (!evalResult)
-                    return;
+            if (isException || !resultValue)
+                return callback(null);
 
-                result.score = 100;
-                var lateCssUrls = evalResult['late'];
-                if (lateCssUrls) {
-                    var lateMessage = result.appendChild(
-                        'The following external CSS files were included after ' +
-                        'an external JavaScript file in the document head. To ' +
-                        'ensure CSS files are downloaded in parallel, always ' +
-                        'include external CSS before external JavaScript.');
-                    lateMessage.appendChild(WebInspector.AuditRules.arrayAsUL(lateCssUrls, true));
-                    result.score -= this.getValue("InlineBetweenResourcesScore") * lateCssUrls.length;
-                    result.type = WebInspector.AuditRuleResult.Type.Violation;
-                }
-                if (evalResult['cssBeforeInlineCount']) {
-                  var count = evalResult['cssBeforeInlineCount'];
-                  result.appendChild(count + ' inline script block' +
-                      (count > 1 ? 's were' : ' was') + ' found in the head between an ' +
-                      'external CSS file and another resource. To allow parallel ' +
-                      'downloading, move the inline script before the external CSS ' +
-                      'file, or after the next resource.');
-                  result.score -= this.getValue("CSSAfterJSURLScore") * count;
-                  result.type = WebInspector.AuditRuleResult.Type.Violation;
-                }
-            } catch(e) {
-                console.log(e);
-            } finally {
-                callback(result);
+            var lateCssUrls = resultValue[0];
+            var cssBeforeInlineCount = resultValue[1];
+
+            var entry = result.addChild("The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.", true);
+            entry.addURLs(lateCssUrls);
+            result.violationCount += lateCssUrls.length;
+
+            if (cssBeforeInlineCount) {
+                result.addChild(String.sprintf(" %d inline script block%s found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.", cssBeforeInlineCount, cssBeforeInlineCount > 1 ? "s were" : " was"));
+                result.violationCount += cssBeforeInlineCount;
             }
+            callback(result);
         }
 
         function routine()
         {
-            var lateStyles = document.querySelectorAll(
-                "head script[src] ~ link[rel~='stylesheet'][href]");
-            var stylesBeforeInlineScript = document.querySelectorAll(
-                "head link[rel~='stylesheet'][href] ~ script:not([src])");
+            var lateStyles = document.querySelectorAll("head script[src] ~ link[rel~='stylesheet'][href]");
+            var cssBeforeInlineCount = document.querySelectorAll("head link[rel~='stylesheet'][href] ~ script:not([src])").length;
+            if (!lateStyles.length && !cssBeforeInlineCount)
+                return null;
 
-            var resultObject;
-            if (!lateStyles.length && !stylesBeforeInlineScript.length)
-                resultObject = null;
-            else {
-                resultObject = {};
-                if (lateStyles.length) {
-                  lateStyleUrls = [];
-                  for (var i = 0; i < lateStyles.length; ++i)
-                      lateStyleUrls.push(lateStyles[i].href);
-                  resultObject["late"] = lateStyleUrls;
-                }
-                resultObject["cssBeforeInlineCount"] = stylesBeforeInlineScript.length;
-            }
-            return resultObject;
+            var lateStyleUrls = [];
+            for (var i = 0; i < lateStyles.length; ++i)
+                lateStyleUrls.push(lateStyles[i].href);
+            return [ lateStyleUrls, cssBeforeInlineCount ];
         }
 
-        WebInspector.AuditRules.evaluateInTargetWindow(routine, evalCallback.bind(this));
+        WebInspector.AuditRules.evaluateInTargetWindow(routine, null, evalCallback.bind(this));
     }
 }
 
 WebInspector.AuditRules.StylesScriptsOrderRule.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CookieRuleBase = function(id, name, parametersObject)
+WebInspector.AuditRules.CookieRuleBase = function(id, name)
 {
-    WebInspector.AuditRule.call(this, id, name, parametersObject);
+    WebInspector.AuditRule.call(this, id, name);
 }
 
 WebInspector.AuditRules.CookieRuleBase.prototype = {
@@ -1004,13 +847,8 @@
     {
         var self = this;
         function resultCallback(receivedCookies, isAdvanced) {
-            try {
-                self.processCookies(isAdvanced ? receivedCookies : [], resources, result);
-            } catch(e) {
-                console.log(e);
-            } finally {
-                callback(result);
-            }
+            self.processCookies(isAdvanced ? receivedCookies : [], resources, result);
+            callback(result);
         }
         WebInspector.Cookies.getCookiesAsync(resultCallback);
     },
@@ -1039,9 +877,11 @@
 WebInspector.AuditRules.CookieRuleBase.prototype.__proto__ = WebInspector.AuditRule.prototype;
 
 
-WebInspector.AuditRules.CookieSizeRule = function(parametersObject)
+WebInspector.AuditRules.CookieSizeRule = function(avgBytesThreshold)
 {
-    WebInspector.AuditRules.CookieRuleBase.call(this, "http-cookiesize", "Minimize cookie size", parametersObject);
+    WebInspector.AuditRules.CookieRuleBase.call(this, "http-cookiesize", "Minimize cookie size");
+    this._avgBytesThreshold = avgBytesThreshold;
+    this._maxBytesThreshold = 1000;
 }
 
 WebInspector.AuditRules.CookieSizeRule.prototype = {
@@ -1097,7 +937,6 @@
         var matchingResourceData = {};
         this.mapResourceCookies(domainToResourcesMap, allCookies, collectorCallback.bind(this));
 
-        result.score = 100;
         for (var resourceDomain in cookiesPerResourceDomain) {
             var cookies = cookiesPerResourceDomain[resourceDomain];
             sortedCookieSizes.push({
@@ -1111,13 +950,10 @@
         var hugeCookieDomains = [];
         sortedCookieSizes.sort(maxSizeSorter);
 
-        var maxBytesThreshold = this.getValue("MaxBytesThreshold");
-        var minBytesThreshold = this.getValue("MinBytesThreshold");
-
         for (var i = 0, len = sortedCookieSizes.length; i < len; ++i) {
             var maxCookieSize = sortedCookieSizes[i].maxCookieSize;
-            if (maxCookieSize > maxBytesThreshold)
-                hugeCookieDomains.push(sortedCookieSizes[i].domain + ": " + Number.bytesToString(maxCookieSize));
+            if (maxCookieSize > this._maxBytesThreshold)
+                hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ": " + Number.bytesToString(maxCookieSize));
         }
 
         var bigAvgCookieDomains = [];
@@ -1125,45 +961,33 @@
         for (var i = 0, len = sortedCookieSizes.length; i < len; ++i) {
             var domain = sortedCookieSizes[i].domain;
             var avgCookieSize = sortedCookieSizes[i].avgCookieSize;
-            if (avgCookieSize > minBytesThreshold && avgCookieSize < maxBytesThreshold)
-                bigAvgCookieDomains.push(domain + ": " + Number.bytesToString(avgCookieSize));
+            if (avgCookieSize > this._avgBytesThreshold && avgCookieSize < this._maxBytesThreshold)
+                bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + ": " + Number.bytesToString(avgCookieSize));
         }
-        result.appendChild("The average cookie size for all requests on this page is " + Number.bytesToString(avgAllCookiesSize));
+        result.addChild(String.sprintf("The average cookie size for all requests on this page is %s", Number.bytesToString(avgAllCookiesSize)));
 
         var message;
         if (hugeCookieDomains.length) {
-            result.score = 75;
-            result.type = WebInspector.AuditRuleResult.Type.Violation;
-            message = result.appendChild(
-                String.sprintf("The following domains have a cookie size in excess of %d " +
-                " bytes. This is harmful because requests with cookies larger than 1KB" +
-                " typically cannot fit into a single network packet.", maxBytesThreshold));
-            message.appendChild(WebInspector.AuditRules.arrayAsUL(hugeCookieDomains));
+            var entry = result.addChild("The following domains have a cookie size in excess of 1KB. This is harmful because requests with cookies larger than 1KB typically cannot fit into a single network packet.", true);
+            entry.addURLs(hugeCookieDomains);
+            result.violationCount += hugeCookieDomains.length;
         }
 
         if (bigAvgCookieDomains.length) {
-            this.score -= Math.max(0, avgAllCookiesSize - minBytesThreshold) /
-                (minBytesThreshold - minBytesThreshold) / this.getValue("TotalPoints");
-            if (!result.type)
-                result.type = WebInspector.AuditRuleResult.Type.Hint;
-            message = result.appendChild(
-                String.sprintf("The following domains have an average cookie size in excess of %d" +
-                 " bytes. Reducing the size of cookies" +
-                 " for these domains can reduce the time it takes to send requests.", minBytesThreshold));
-            message.appendChild(WebInspector.AuditRules.arrayAsUL(bigAvgCookieDomains));
+            var entry = result.addChild(String.sprintf("The following domains have an average cookie size in excess of %d bytes. Reducing the size of cookies for these domains can reduce the time it takes to send requests.", this._avgBytesThreshold), true);
+            entry.addURLs(bigAvgCookieDomains);
+            result.violationCount += bigAvgCookieDomains.length;
         }
-
-        if (!bigAvgCookieDomains.length && !hugeCookieDomains.length)
-            result.score = WebInspector.AuditCategoryResult.ScoreNA;
     }
 }
 
 WebInspector.AuditRules.CookieSizeRule.prototype.__proto__ = WebInspector.AuditRules.CookieRuleBase.prototype;
 
 
-WebInspector.AuditRules.StaticCookielessRule = function(parametersObject)
+WebInspector.AuditRules.StaticCookielessRule = function(minResources)
 {
-    WebInspector.AuditRules.CookieRuleBase.call(this, "http-staticcookieless", "Serve static content from a cookieless domain", parametersObject);
+    WebInspector.AuditRules.CookieRuleBase.call(this, "http-staticcookieless", "Serve static content from a cookieless domain");
+    this._minResources = minResources;
 }
 
 WebInspector.AuditRules.StaticCookielessRule.prototype = {
@@ -1175,10 +999,9 @@
                 WebInspector.URLRegExp,
                 true);
         var totalStaticResources = 0;
-        var minResources = this.getValue("MinResources");
         for (var domain in domainToResourcesMap)
             totalStaticResources += domainToResourcesMap[domain].length;
-        if (totalStaticResources < minResources)
+        if (totalStaticResources < this._minResources)
             return;
         var matchingResourceData = {};
         this.mapResourceCookies(domainToResourcesMap, allCookies, this._collectorCallback.bind(this, matchingResourceData));
@@ -1189,19 +1012,12 @@
             badUrls.push(url);
             cookieBytes += matchingResourceData[url]
         }
-        if (badUrls.length < minResources)
+        if (badUrls.length < this._minResources)
             return;
 
-        result.score = 100;
-        var badPoints = cookieBytes / 75;
-        var violationPct = Math.max(badUrls.length / totalStaticResources, 0.6);
-        badPoints *= violationPct;
-        result.score -= badPoints;
-        result.score = Math.max(result.score, 0);
-        result.type = WebInspector.AuditRuleResult.Type.Violation;
-        result.appendChild(String.sprintf("%s of cookies were sent with the following static resources.", Number.bytesToString(cookieBytes)));
-        var message = result.appendChild("Serve these static resources from a domain that does not set cookies:");
-        message.appendChild(WebInspector.AuditRules.arrayAsUL(badUrls, true));
+        var entry = result.addChild(String.sprintf("%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:", Number.bytesToString(cookieBytes)), true);
+        entry.addURLs(badUrls);
+        result.violationCount = badUrls.length;
     },
 
     _collectorCallback: function(matchingResourceData, resource, cookie)
diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js
index fcadb82..c3318ce 100644
--- a/WebCore/inspector/front-end/AuditsPanel.js
+++ b/WebCore/inspector/front-end/AuditsPanel.js
@@ -37,6 +37,7 @@
     this.createSidebar();
     this.auditsTreeElement = new WebInspector.SidebarSectionTreeElement("", {}, true);
     this.sidebarTree.appendChild(this.auditsTreeElement);
+    this.auditsTreeElement.listItemElement.addStyleClass("hidden");
     this.auditsTreeElement.expand();
 
     this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement();
@@ -54,6 +55,8 @@
     this.viewsContainerElement = document.createElement("div");
     this.viewsContainerElement.id = "audit-views";
     this.element.appendChild(this.viewsContainerElement);
+
+    this._launcherView = new WebInspector.AuditLauncherView(this.categoriesById, this.initiateAudit.bind(this));
 }
 
 WebInspector.AuditsPanel.prototype = {
@@ -95,9 +98,14 @@
         return this._auditCategoriesById;
     },
 
-    get visibleView()
+    resourceStarted: function(resource)
     {
-        return this._visibleView;
+        this._launcherView.resourceStarted(resource);
+    },
+
+    resourceFinished: function(resource)
+    {
+        this._launcherView.resourceFinished(resource);
     },
 
     _constructCategories: function()
@@ -125,8 +133,8 @@
 
         function ruleResultReadyCallback(categoryResult, ruleResult)
         {
-            if (ruleResult.children)
-                categoryResult.entries.push(ruleResult);
+            if (ruleResult && ruleResult.children)
+                categoryResult.addRuleResult(ruleResult);
 
             --rulesRemaining;
 
@@ -188,18 +196,18 @@
     {
         this._resourceTrackingCallback = callback;
 
-        if (!InspectorBackend.resourceTrackingEnabled()) {
+        if (!WebInspector.panels.resources.resourceTrackingEnabled) {
             InspectorBackend.enableResourceTracking(false);
             this._updateLauncherViewControls(true);
         } else
-            InjectedScriptAccess.getDefault().evaluate("window.location.reload()", switchCallback);
+            InspectorBackend.reloadPage();
     },
 
     _didMainResourceLoad: function()
     {
         if (this._resourceTrackingCallback) {
             var callback = this._resourceTrackingCallback;
-            this._resourceTrackingCallback = null;
+            delete this._resourceTrackingCallback;
             callback();
         }
     },
@@ -209,36 +217,42 @@
         if (!categoryResults._resultView)
             categoryResults._resultView = new WebInspector.AuditResultView(categoryResults);
 
-        this.showView(categoryResults._resultView);
+        this.visibleView = categoryResults._resultView;
     },
 
     showLauncherView: function()
     {
-        if (!this._launcherView)
-            this._launcherView = new WebInspector.AuditLauncherView(this.categoriesById, this.initiateAudit.bind(this));
-
-        this.showView(this._launcherView);
+        this.visibleView = this._launcherView;
+    },
+    
+    get visibleView()
+    {
+        return this._visibleView;
     },
 
-    showView: function(view)
+    set visibleView(x)
     {
-        if (view) {
-            if (this._visibleView === view)
-                return;
-            this._closeVisibleView();
-            this._visibleView = view;
-        }
-        var visibleView = this.visibleView;
-        if (visibleView)
-            visibleView.show(this.viewsContainerElement);
+        if (this._visibleView === x)
+            return;
+
+        if (this._visibleView)
+            this._visibleView.hide();
+
+        this._visibleView = x;
+
+        if (x)
+            x.show(this.viewsContainerElement);
     },
 
     show: function()
     {
         WebInspector.Panel.prototype.show.call(this);
+        this._updateLauncherViewControls(WebInspector.panels.resources.resourceTrackingEnabled);
+    },
 
-        this.showView();
-        this._updateLauncherViewControls(InspectorBackend.resourceTrackingEnabled());
+    reset: function()
+    {
+        this._launcherView.reset();
     },
 
     attach: function()
@@ -264,12 +278,6 @@
         this.auditsItemTreeElement.reveal();
         this.auditsItemTreeElement.select();
         this.auditResultsTreeElement.removeChildren();
-    },
-
-    _closeVisibleView: function()
-    {
-        if (this.visibleView)
-            this.visibleView.hide();
     }
 }
 
@@ -301,8 +309,9 @@
         return this._rules.length;
     },
 
-    addRule: function(rule)
+    addRule: function(rule, severity)
     {
+        rule.severity = severity;
         this._rules.push(rule);
     },
 
@@ -324,11 +333,22 @@
 }
 
 
-WebInspector.AuditRule = function(id, displayName, parametersObject)
+WebInspector.AuditRule = function(id, displayName)
 {
     this._id = id;
     this._displayName = displayName;
-    this._parametersObject = parametersObject;
+}
+
+WebInspector.AuditRule.Severity = {
+    Info: "info",
+    Warning: "warning",
+    Severe: "severe"
+}
+
+WebInspector.AuditRule.SeverityOrder = {
+    "info": 3,
+    "warning": 2,
+    "severe": 1
 }
 
 WebInspector.AuditRule.prototype = {
@@ -342,83 +362,82 @@
         return this._displayName;
     },
 
+    set severity(severity)
+    {
+        this._severity = severity;
+    },
+
     run: function(resources, callback)
     {
-        this.doRun(resources, new WebInspector.AuditRuleResult(this.displayName), callback);
+        var result = new WebInspector.AuditRuleResult(this.displayName);
+        result.severity = this._severity;
+        this.doRun(resources, result, callback);
     },
 
     doRun: function(resources, result, callback)
     {
         throw new Error("doRun() not implemented");
-    },
-
-    getValue: function(key)
-    {
-        if (key in this._parametersObject)
-            return this._parametersObject[key];
-        else
-            throw new Error(key + " not found in rule parameters");
     }
 }
 
-
 WebInspector.AuditCategoryResult = function(category)
 {
     this.title = category.displayName;
-    this.entries = [];
+    this.ruleResults = [];
 }
 
 WebInspector.AuditCategoryResult.prototype = {
-    addEntry: function(value)
+    addRuleResult: function(ruleResult)
     {
-        var entry = new WebInspector.AuditRuleResult(value);
-        this.entries.push(entry);
-        return entry;
+        this.ruleResults.push(ruleResult);
     }
 }
 
-/**
- * @param {string} value The result message HTML contents.
- */
-WebInspector.AuditRuleResult = function(value)
+WebInspector.AuditRuleResult = function(value, expanded, className)
 {
     this.value = value;
-    this.type = WebInspector.AuditRuleResult.Type.NA;
+    this.className = className;
+    this.expanded = expanded;
+    this.violationCount = 0;
 }
 
-WebInspector.AuditRuleResult.Type = {
-    // Does not denote a discovered flaw but rather represents an informational message.
-    NA: 0,
+WebInspector.AuditRuleResult.linkifyDisplayName = function(url)
+{
+    return WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url));
+}
 
-    // Denotes a minor impact on the checked metric.
-    Hint: 1,
-
-    // Denotes a major impact on the checked metric.
-    Violation: 2
+WebInspector.AuditRuleResult.resourceDomain = function(domain)
+{
+    return domain || WebInspector.UIString("[empty domain]");
 }
 
 WebInspector.AuditRuleResult.prototype = {
-    appendChild: function(value)
+    addChild: function(value, expanded, className)
     {
         if (!this.children)
             this.children = [];
-        var entry = new WebInspector.AuditRuleResult(value);
+        var entry = new WebInspector.AuditRuleResult(value, expanded, className);
         this.children.push(entry);
         return entry;
     },
 
-    set type(x)
+    addURL: function(url)
     {
-        this._type = x;
+        return this.addChild(WebInspector.AuditRuleResult.linkifyDisplayName(url));
     },
 
-    get type()
+    addURLs: function(urls)
     {
-        return this._type;
+        for (var i = 0; i < urls.length; ++i)
+            this.addURL(urls[i]);
+    },
+
+    addSnippet: function(snippet)
+    {
+        return this.addChild(snippet, false, "source-code");
     }
 }
 
-
 WebInspector.AuditsSidebarTreeElement = function()
 {
     this.small = false;
diff --git a/WebCore/inspector/front-end/Breakpoint.js b/WebCore/inspector/front-end/Breakpoint.js
index 5d46cc9..7f3ef17 100644
--- a/WebCore/inspector/front-end/Breakpoint.js
+++ b/WebCore/inspector/front-end/Breakpoint.js
@@ -89,7 +89,7 @@
         this.dispatchEventToListeners("condition-changed");
 
         if (this.enabled)
-            InspectorBackend.updateBreakpoint(this.sourceID, this.line, c);
+            InspectorBackend.setBreakpoint(this.sourceID, this.line, this.enabled, this.condition);
     }
 }
 
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 8865f0b..fcfd2ab 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -40,6 +40,16 @@
 }
 
 WebInspector.BreakpointsSidebarPane.prototype = {
+    reset: function()
+    {
+        this.breakpoints = {};
+        this.listElement.removeChildren();
+        if (this.listElement.parentElement) {
+            this.bodyElement.removeChild(this.listElement);
+            this.bodyElement.appendChild(this.emptyElement);
+        }
+    },
+
     addBreakpoint: function(breakpoint)
     {
         if (this.breakpoints[breakpoint.id])
@@ -58,11 +68,7 @@
             this.bodyElement.appendChild(this.listElement);
         }
 
-        if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
-            return;
-
-        if (breakpoint.enabled)
-            InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
+        InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
     },
 
     _appendBreakpointElement: function(breakpoint)
@@ -77,9 +83,7 @@
 
         function breakpointClicked()
         {
-            var script = WebInspector.panels.scripts.scriptOrResourceForID(breakpoint.sourceID);
-            if (script)
-                WebInspector.panels.scripts.showScript(script, breakpoint.line);
+            WebInspector.panels.scripts.showSourceLine(breakpoint.url, breakpoint.line);
         }
 
         var breakpointElement = document.createElement("li");
@@ -135,9 +139,6 @@
             this.bodyElement.appendChild(this.emptyElement);
         }
 
-        if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
-            return;
-
         InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
     },
 
@@ -147,14 +148,7 @@
 
         var checkbox = breakpoint._breakpointListElement.firstChild;
         checkbox.checked = breakpoint.enabled;
-
-        if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
-            return;
-
-        if (breakpoint.enabled)
-            InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
-        else
-            InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
+        InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
     },
 
     _breakpointTextChanged: function(event)
diff --git a/WebCore/inspector/front-end/Checkbox.js b/WebCore/inspector/front-end/Checkbox.js
new file mode 100644
index 0000000..b30da70
--- /dev/null
+++ b/WebCore/inspector/front-end/Checkbox.js
@@ -0,0 +1,56 @@
+/*
+ * 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:
+ * 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 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.
+ */
+
+WebInspector.Checkbox = function(label, callback, checked, className, tooltip)
+{
+    this.element = document.createElement('label');
+    this._inputElement = document.createElement('input');
+
+    function callbackWrapper(event)
+    {
+        if (callback)
+            callback(event);
+        event.stopPropagation();
+        return true;
+    }
+    this._inputElement.type = "checkbox";
+    this._inputElement.checked = checked;
+    this._inputElement.addEventListener("click", callbackWrapper, false);
+
+    this.element.className = className;
+    this.element.appendChild(this._inputElement);
+    this.element.appendChild(document.createTextNode(label));
+    if (tooltip)
+        this.element.title = tooltip;
+    this.element.addEventListener("click", callbackWrapper, false);
+}
+
+WebInspector.Checkbox.prototype = {
+    checked: function()
+    {
+        return this._inputElement.checked;
+    }
+}
+
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 07d9812..f840a81 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -48,6 +48,7 @@
     this.promptElement.className = "source-code";
     this.promptElement.addEventListener("keydown", this._promptKeyDown.bind(this), true);
     this.prompt = new WebInspector.TextPrompt(this.promptElement, this.completions.bind(this), ExpressionStopCharacters + ".");
+    WebInspector.settings.addEventListener("loaded", this._settingsLoaded, this);
 
     this.topGroup = new WebInspector.ConsoleGroup(null, 0);
     this.messagesElement.insertBefore(this.topGroup.element, this.promptElement);
@@ -92,11 +93,13 @@
     this._shortcuts = {};
 
     var shortcut;
-    var clearConsoleHandler = this.requestClearMessages.bind(this);
 
     shortcut = WebInspector.KeyboardShortcut.makeKey("k", WebInspector.KeyboardShortcut.Modifiers.Meta);
-    this._shortcuts[shortcut] = clearConsoleHandler;
+    // This case requires a separate bound function as its isMacOnly property should not be shared among different shortcut handlers.
+    this._shortcuts[shortcut] = this.requestClearMessages.bind(this);
     this._shortcuts[shortcut].isMacOnly = true;
+
+    var clearConsoleHandler = this.requestClearMessages.bind(this);
     shortcut = WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl);
     this._shortcuts[shortcut] = clearConsoleHandler;
 
@@ -115,6 +118,10 @@
 }
 
 WebInspector.ConsoleView.prototype = {
+    _settingsLoaded: function()
+    {
+        this.prompt.history = WebInspector.settings.consoleHistory;
+    },
     
     _updateFilter: function(e)
     {
@@ -215,6 +222,19 @@
         this.toggleConsoleButton.title = WebInspector.UIString("Show console.");
     },
 
+    _scheduleScrollIntoView: function()
+    {
+        if (this._scrollIntoViewTimer)
+            return;
+
+        function scrollIntoView()
+        {
+            this.promptElement.scrollIntoView(false);
+            delete this._scrollIntoViewTimer;
+        }
+        this._scrollIntoViewTimer = setTimeout(scrollIntoView.bind(this), 20);
+    },
+
     addMessage: function(msg)
     {
         if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {
@@ -256,7 +276,7 @@
             this.currentGroup.addMessage(msg);
         }
 
-        this.promptElement.scrollIntoView(false);
+        this._scheduleScrollIntoView();
     },
 
     updateMessageRepeatCount: function(count)
@@ -491,6 +511,9 @@
             self.prompt.history.push(str);
             self.prompt.historyOffset = 0;
             self.prompt.text = "";
+
+            WebInspector.settings.consoleHistory = self.prompt.history.slice(-30);
+
             self.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
         }
         this.evalInInspectedWindow(str, "console", printResult);
@@ -504,7 +527,7 @@
         var formatter = this._customFormatters[type];
         if (!formatter || !isProxy) {
             formatter = this._formatvalue;
-            output = output.description || output;
+            output = output.description;
         }
 
         var span = document.createElement("span");
@@ -568,7 +591,7 @@
         for (var i = 0; i < properties.length; ++i) {
             var name = properties[i].name;
             if (name == parseInt(name))
-                elements[name] = this._format(properties[i].value);
+                elements[name] = this._formatAsArrayEntry(properties[i].value);
         }
 
         elem.appendChild(document.createTextNode("["));
@@ -582,6 +605,13 @@
                 elem.appendChild(document.createTextNode(", "));
         }
         elem.appendChild(document.createTextNode("]"));
+    },
+
+    _formatAsArrayEntry: function(output)
+    {
+        var type = Object.proxyType(output);
+        // Prevent infinite expansion of cross-referencing arrays.
+        return this._format(output, type === "array");
     }
 }
 
diff --git a/WebCore/inspector/front-end/CookieItemsView.js b/WebCore/inspector/front-end/CookieItemsView.js
index b5674b8..1baf4a6 100644
--- a/WebCore/inspector/front-end/CookieItemsView.js
+++ b/WebCore/inspector/front-end/CookieItemsView.js
@@ -122,7 +122,7 @@
 
         for (var id in WebInspector.resources) {
             var resource = WebInspector.resources[id];
-            var match = resource.documentURL.match(WebInspector.URLRegExp);
+            var match = resource.documentURL.match(WebInspector.GenericURLRegExp);
             if (match && match[2] === this._cookieDomain)
                 resourceURLsForDocumentURL.push(resource.url);
         }
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 834f527..46ff0bf 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -211,30 +211,6 @@
         };
         this._attributesMap[name] = attr;
         this.attributes.push(attr);
-    },
-
-    _setStyles: function(computedStyle, inlineStyle, styleAttributes, matchedCSSRules)
-    {
-        this._computedStyle = new WebInspector.CSSStyleDeclaration(computedStyle);
-        this.style = new WebInspector.CSSStyleDeclaration(inlineStyle);
-
-        for (var name in styleAttributes) {
-            if (this._attributesMap[name])
-                this._attributesMap[name].style = new WebInspector.CSSStyleDeclaration(styleAttributes[name]);
-        }
-
-        this._matchedCSSRules = [];
-        for (var i = 0; i < matchedCSSRules.length; i++)
-            this._matchedCSSRules.push(WebInspector.CSSStyleDeclaration.parseRule(matchedCSSRules[i]));
-    },
-
-    _clearStyles: function()
-    {
-        this.computedStyle = null;
-        this.style = null;
-        for (var name in this._attributesMap)
-            this._attributesMap[name].style = null;
-        this._matchedCSSRules = null;
     }
 }
 
@@ -308,16 +284,6 @@
 
     Object: function()
     {
-    },
-
-    getComputedStyle: function(node)
-    {
-        return node._computedStyle;
-    },
-
-    getMatchedCSSRules: function(node, pseudoElement, authorOnly)
-    {
-        return node._matchedCSSRules;
     }
 }
 
@@ -489,7 +455,7 @@
 
 WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL)
 {
-    var match = resourceURL.match(WebInspector.URLRegExp);
+    var match = resourceURL.match(WebInspector.GenericURLRegExp);
     if (!match)
         return false;
     // See WebInspector.URLRegExp for definitions of the group index constants.
@@ -523,13 +489,20 @@
 WebInspector.CSSStyleDeclaration = function(payload)
 {
     this.id = payload.id;
-    this.injectedScriptId = payload.injectedScriptId;
     this.width = payload.width;
     this.height = payload.height;
-    this.__disabledProperties = payload.__disabledProperties;
-    this.__disabledPropertyValues = payload.__disabledPropertyValues;
-    this.__disabledPropertyPriorities = payload.__disabledPropertyPriorities;
-    this.uniqueStyleProperties = payload.uniqueStyleProperties;
+    this.__disabledProperties = {};
+    this.__disabledPropertyValues = {};
+    this.__disabledPropertyPriorities = {};
+    if (payload.disabled) {
+        for (var i = 0; i < payload.disabled.length; ++i) {
+            var property = payload.disabled[i];
+            this.__disabledProperties[property.name] = true;
+            this.__disabledPropertyValues[property.name] = property.value;
+            this.__disabledPropertyPriorities[property.name] = property.priority;
+        }
+    }
+
     this._shorthandValues = payload.shorthandValues;
     this._propertyMap = {};
     this._longhandProperties = {};
@@ -540,12 +513,8 @@
         var name = property.name;
         this[i] = name;
         this._propertyMap[name] = property;
-    }
 
-    // Index longhand properties.
-    for (var i = 0; i < this.uniqueStyleProperties.length; ++i) {
-        var name = this.uniqueStyleProperties[i];
-        var property = this._propertyMap[name];
+        // Index longhand properties.
         if (property.shorthand) {
             var longhands = this._longhandProperties[property.shorthand];
             if (!longhands) {
@@ -566,13 +535,13 @@
 {
     var rule = {};
     rule.id = payload.id;
-    rule.injectedScriptId = payload.injectedScriptId;
     rule.selectorText = payload.selectorText;
     rule.style = new WebInspector.CSSStyleDeclaration(payload.style);
     rule.style.parentRule = rule;
     rule.isUserAgent = payload.isUserAgent;
     rule.isUser = payload.isUser;
     rule.isViaInspector = payload.isViaInspector;
+    rule.sourceLine = payload.sourceLine;
     if (payload.parentStyleSheet)
         rule.parentStyleSheet = { href: payload.parentStyleSheet.href };
 
@@ -697,4 +666,17 @@
 WebInspector.didApplyDomChange = WebInspector.Callback.processCallback;
 WebInspector.didRemoveAttribute = WebInspector.Callback.processCallback;
 WebInspector.didSetTextNodeValue = WebInspector.Callback.processCallback;
+WebInspector.didRemoveNode = WebInspector.Callback.processCallback;
+WebInspector.didChangeTagName = WebInspector.Callback.processCallback;
 WebInspector.didGetEventListenersForNode = WebInspector.Callback.processCallback;
+
+WebInspector.didGetStyles = WebInspector.Callback.processCallback;
+WebInspector.didGetAllStyles = WebInspector.Callback.processCallback;
+WebInspector.didGetInlineStyle = WebInspector.Callback.processCallback;
+WebInspector.didGetComputedStyle = WebInspector.Callback.processCallback;
+WebInspector.didApplyStyleText = WebInspector.Callback.processCallback;
+WebInspector.didSetStyleText = WebInspector.Callback.processCallback;
+WebInspector.didSetStyleProperty = WebInspector.Callback.processCallback;
+WebInspector.didToggleStyleEnabled = WebInspector.Callback.processCallback;
+WebInspector.didSetRuleSelector = WebInspector.Callback.processCallback;
+WebInspector.didAddRule = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/DatabaseQueryView.js b/WebCore/inspector/front-end/DatabaseQueryView.js
index cc902e7..38c8df4 100644
--- a/WebCore/inspector/front-end/DatabaseQueryView.js
+++ b/WebCore/inspector/front-end/DatabaseQueryView.js
@@ -140,13 +140,15 @@
     _queryFinished: function(query, result)
     {
         var dataGrid = WebInspector.panels.storage.dataGridForResult(result);
-        if (!dataGrid)
-            return;
-        dataGrid.element.addStyleClass("inline");
-        this._appendQueryResult(query, dataGrid.element);
-        dataGrid.autoSizeColumns(5);
+        var trimmedQuery = query.trim();
 
-        if (query.match(/^create /i) || query.match(/^drop table /i))
+        if (dataGrid) {
+            dataGrid.element.addStyleClass("inline");
+            this._appendQueryResult(trimmedQuery, dataGrid.element);
+            dataGrid.autoSizeColumns(5);            
+        }
+
+        if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i))
             WebInspector.panels.storage.updateDatabaseTables(this.database);
     },
 
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 897fdd1..e2ca838 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -58,10 +58,6 @@
         this.panel.updateProperties();
         this.panel.updateEventListeners();
 
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.panel.nodeSearchButton.toggled = false;
-        }
         if (this._focusedDOMNode)
             InjectedScriptAccess.get(this._focusedDOMNode.injectedScriptId).addInspectedNode(this._focusedDOMNode.id, function() {});
     };
@@ -102,10 +98,8 @@
     this.sidebarResizeElement.className = "sidebar-resizer-vertical";
     this.sidebarResizeElement.addEventListener("mousedown", this.rightSidebarResizerDragStart.bind(this), false);
 
-    this.nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
-    this.nodeSearchButton.addEventListener("click", this._nodeSearchButtonClicked.bind(this), false);
-
-    this.searchingForNode = false;
+    this._nodeSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
+    this._nodeSearchButton.addEventListener("click", this._nodeSearchButtonClicked.bind(this), false);
 
     this.element.appendChild(this.contentElement);
     this.element.appendChild(this.sidebarElement);
@@ -126,7 +120,7 @@
 
     get statusBarItems()
     {
-        return [this.nodeSearchButton.element, this.crumbsElement];
+        return [this._nodeSearchButton.element, this.crumbsElement];
     },
 
     get defaultFocusedElement()
@@ -154,11 +148,7 @@
         WebInspector.Panel.prototype.hide.call(this);
 
         WebInspector.hoveredDOMNode = null;
-
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.nodeSearchButton.toggled = false;
-        }
+        InspectorBackend.disableSearchingForNode();
     },
 
     resize: function()
@@ -185,11 +175,6 @@
 
         WebInspector.hoveredDOMNode = null;
 
-        if (InspectorBackend.searchingForNode()) {
-            InspectorBackend.toggleNodeSearch();
-            this.nodeSearchButton.toggled = false;
-        }
-
         this.recentlyModifiedNodes = [];
 
         delete this.currentQuery;
@@ -268,7 +253,17 @@
         this._matchesCountUpdateTimeout = null;
         this._searchQuery = query;
 
-        InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery, function() {});
+        InjectedScriptAccess.getDefault().performSearch(whitespaceTrimmedQuery, false, function() {});
+    },
+
+    searchingForNodeWasEnabled: function()
+    {
+        this._nodeSearchButton.toggled = true;
+    },
+
+    searchingForNodeWasDisabled: function()
+    {
+        this._nodeSearchButton.toggled = false;
     },
 
     _updateMatchesCount: function()
@@ -678,47 +673,7 @@
             var crumbTitle;
             switch (current.nodeType) {
                 case Node.ELEMENT_NODE:
-                    crumbTitle = current.nodeName.toLowerCase();
-
-                    var nameElement = document.createElement("span");
-                    nameElement.textContent = crumbTitle;
-                    crumb.appendChild(nameElement);
-
-                    var idAttribute = current.getAttribute("id");
-                    if (idAttribute) {
-                        var idElement = document.createElement("span");
-                        crumb.appendChild(idElement);
-
-                        var part = "#" + idAttribute;
-                        crumbTitle += part;
-                        idElement.appendChild(document.createTextNode(part));
-
-                        // Mark the name as extra, since the ID is more important.
-                        nameElement.className = "extra";
-                    }
-
-                    var classAttribute = current.getAttribute("class");
-                    if (classAttribute) {
-                        var classes = classAttribute.split(/\s+/);
-                        var foundClasses = {};
-
-                        if (classes.length) {
-                            var classesElement = document.createElement("span");
-                            classesElement.className = "extra";
-                            crumb.appendChild(classesElement);
-
-                            for (var i = 0; i < classes.length; ++i) {
-                                var className = classes[i];
-                                if (className && !(className in foundClasses)) {
-                                    var part = "." + className;
-                                    crumbTitle += part;
-                                    classesElement.appendChild(document.createTextNode(part));
-                                    foundClasses[className] = true;
-                                }
-                            }
-                        }
-                    }
-
+                    this.decorateNodeLabel(current, crumb);
                     break;
 
                 case Node.TEXT_NODE:
@@ -737,17 +692,16 @@
                     break;
 
                 default:
-                    crumbTitle = current.nodeName.toLowerCase();
+                    crumbTitle = this.treeOutline.nodeNameToCorrectCase(current.nodeName);
             }
 
             if (!crumb.childNodes.length) {
                 var nameElement = document.createElement("span");
                 nameElement.textContent = crumbTitle;
                 crumb.appendChild(nameElement);
+                crumb.title = crumbTitle;
             }
 
-            crumb.title = crumbTitle;
-
             if (foundRoot)
                 crumb.addStyleClass("dimmed");
             if (current === this.focusedDOMNode)
@@ -764,6 +718,51 @@
         this.updateBreadcrumbSizes();
     },
 
+    decorateNodeLabel: function(node, parentElement)
+    {
+        var title = this.treeOutline.nodeNameToCorrectCase(node.nodeName);
+
+        var nameElement = document.createElement("span");
+        nameElement.textContent = title;
+        parentElement.appendChild(nameElement);
+
+        var idAttribute = node.getAttribute("id");
+        if (idAttribute) {
+            var idElement = document.createElement("span");
+            parentElement.appendChild(idElement);
+
+            var part = "#" + idAttribute;
+            title += part;
+            idElement.appendChild(document.createTextNode(part));
+
+            // Mark the name as extra, since the ID is more important.
+            nameElement.className = "extra";
+        }
+
+        var classAttribute = node.getAttribute("class");
+        if (classAttribute) {
+            var classes = classAttribute.split(/\s+/);
+            var foundClasses = {};
+
+            if (classes.length) {
+                var classesElement = document.createElement("span");
+                classesElement.className = "extra";
+                parentElement.appendChild(classesElement);
+
+                for (var i = 0; i < classes.length; ++i) {
+                    var className = classes[i];
+                    if (className && !(className in foundClasses)) {
+                        var part = "." + className;
+                        title += part;
+                        classesElement.appendChild(document.createTextNode(part));
+                        foundClasses[className] = true;
+                    }
+                }
+            }
+        }
+        parentElement.title = title;
+    },
+
     updateBreadcrumbSizes: function(focusedCrumb)
     {
         if (!this.visible)
@@ -1108,9 +1107,10 @@
 
     _nodeSearchButtonClicked: function(event)
     {
-        InspectorBackend.toggleNodeSearch();
-
-        this.nodeSearchButton.toggled = InspectorBackend.searchingForNode();
+        if (!this._nodeSearchButton.toggled)
+            InspectorBackend.enableSearchingForNode();
+        else
+            InspectorBackend.disableSearchingForNode();
     }
 }
 
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index fe7ae53..1add6cc 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -69,6 +69,11 @@
         return this._isXMLMimeType;
     },
 
+    nodeNameToCorrectCase: function(nodeName)
+    {
+        return this.isXMLMimeType ? nodeName : nodeName.toLowerCase();
+    },
+
     get focusedDOMNode()
     {
         return this._focusedDOMNode;
@@ -177,9 +182,16 @@
         return null;
     },
 
+    set suppressRevealAndSelect(x)
+    {
+        if (this._suppressRevealAndSelect === x)
+            return;
+        this._suppressRevealAndSelect = x;
+    },
+
     revealAndSelectNode: function(node)
     {
-        if (!node)
+        if (!node || this._suppressRevealAndSelect)
             return;
 
         var treeElement = this.createTreeElementFor(node);
@@ -213,7 +225,7 @@
 
         return element;
     },
-    
+
     _keyDown: function(event)
     {
         if (event.target !== this.treeOutline.element)
@@ -225,6 +237,9 @@
 
         if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Backspace ||
                 event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Delete) {
+            var startTagTreeElement = this.findTreeElement(selectedElement.representedObject);
+            if (selectedElement !== startTagTreeElement)
+                selectedElement = startTagTreeElement;
             selectedElement.remove();
             event.preventDefault();
             event.stopPropagation();
@@ -267,12 +282,12 @@
             delete this._previousHoveredElement;
         }
 
-        if (element && !element.elementCloseTag) {
+        if (element) {
             element.hovered = true;
             this._previousHoveredElement = element;
         }
 
-        WebInspector.hoveredDOMNode = (element && !element.elementCloseTag ? element.representedObject : null);
+        WebInspector.hoveredDOMNode = (element ? element.representedObject : null);
     },
 
     _onmouseout: function(event)
@@ -309,14 +324,15 @@
 
 WebInspector.ElementsTreeOutline.prototype.__proto__ = TreeOutline.prototype;
 
-WebInspector.ElementsTreeElement = function(node)
+WebInspector.ElementsTreeElement = function(node, elementCloseTag)
 {
-    var hasChildrenOverride = node.hasChildNodes() && !this._showInlineText(node);
+    this._elementCloseTag = elementCloseTag;
+    var hasChildrenOverride = !elementCloseTag && node.hasChildNodes() && !this._showInlineText(node);
 
     // The title will be updated in onattach.
     TreeElement.call(this, "", node, hasChildrenOverride);
 
-    if (this.representedObject.nodeType == Node.ELEMENT_NODE)
+    if (this.representedObject.nodeType == Node.ELEMENT_NODE && !elementCloseTag)
         this._canAddAttributes = true;
     this._searchQuery = null;
     this._expandedChildrenLimit = WebInspector.ElementsTreeElement.InitialChildrenLimit;
@@ -332,6 +348,11 @@
     "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source"
 ].keySet();
 
+// These tags we do not allow editing their tag name.
+WebInspector.ElementsTreeElement.EditTagBlacklist = [
+    "html", "head", "body"
+].keySet();
+
 WebInspector.ElementsTreeElement.prototype = {
     highlightSearchResults: function(searchQuery)
     {
@@ -382,7 +403,7 @@
     get expandedChildCount()
     {
         var count = this.children.length;
-        if (count && this.children[count - 1].elementCloseTag)
+        if (count && this.children[count - 1]._elementCloseTag)
             count--;
         if (count && this.children[count - 1].expandAllButton)
             count--;
@@ -391,6 +412,9 @@
 
     showChild: function(index)
     {
+        if (this._elementCloseTag)
+            return;
+
         if (index >= this.expandedChildrenLimit) {
             this._expandedChildrenLimit = index + 1;
             this._updateChildren(true);
@@ -402,6 +426,9 @@
 
     createTooltipForImageNode: function(node, callback)
     {
+        if (this._elementCloseTag)
+            return;
+
         function createTooltipThenCallback(properties)
         {
             if (!properties) {
@@ -443,8 +470,6 @@
 
     onattach: function()
     {
-        this.listItemElement.addEventListener("mousedown", this.onmousedown.bind(this), false);
-
         if (this._hovered) {
             this.updateSelection();
             this.listItemElement.addStyleClass("hovered");
@@ -467,20 +492,23 @@
 
     onpopulate: function()
     {
-        if (this.children.length || this._showInlineText(this.representedObject))
+        if (this.children.length || this._showInlineText(this.representedObject) || this._elementCloseTag)
             return;
 
         this.updateChildren();
     },
-    
+
     updateChildren: function(fullRefresh)
     {
+        if (this._elementCloseTag)
+            return;
+
         WebInspector.domAgent.getChildNodesAsync(this.representedObject, this._updateChildren.bind(this, fullRefresh));
     },
 
-    insertChildElement: function(child, index)
+    insertChildElement: function(child, index, closingTag)
     {
-        var newElement = new WebInspector.ElementsTreeElement(child);
+        var newElement = new WebInspector.ElementsTreeElement(child, closingTag);
         newElement.selectable = this.treeOutline.selectEnabled;
         this.insertChild(newElement, index);
         return newElement;
@@ -489,10 +517,10 @@
     moveChild: function(child, targetIndex)
     {
         var wasSelected = child.selected;
-        treeElement.removeChild(child);
-        treeElement.insertChild(child, targetIndex);
+        this.removeChild(child);
+        this.insertChild(child, targetIndex);
         if (wasSelected)
-            existingTreeElement.select();
+            child.select();
     },
 
     _updateChildren: function(fullRefresh)
@@ -554,9 +582,6 @@
 
         // Remove any tree elements that no longer have this node (or this node's contentDocument) as their parent.
         for (var i = (this.children.length - 1); i >= 0; --i) {
-            if ("elementCloseTag" in this.children[i])
-                continue;
-
             var currentChild = this.children[i];
             var currentNode = currentChild.representedObject;
             var currentParentNode = currentNode.parentNode;
@@ -575,13 +600,8 @@
         this.adjustCollapsedRange(false);
 
         var lastChild = this.children[this.children.length - 1];
-        if (this.representedObject.nodeType == Node.ELEMENT_NODE && (!lastChild || !lastChild.elementCloseTag)) {
-            var title = "<span class=\"webkit-html-tag close\">&lt;/" + this.representedObject.nodeName.toLowerCase().escapeHTML() + "&gt;</span>";
-            var item = new TreeElement(title, null, false);
-            item.selectable = false;
-            item.elementCloseTag = true;
-            this.appendChild(item);
-        }
+        if (this.representedObject.nodeType == Node.ELEMENT_NODE && (!lastChild || !lastChild._elementCloseTag))
+            this.insertChildElement(this.representedObject, this.children.length, true);
 
         // We want to restore the original selection and tree scroll position after a full refresh, if possible.
         if (fullRefresh && elementToSelect) {
@@ -635,12 +655,18 @@
 
     onexpand: function()
     {
+        if (this._elementCloseTag)
+            return;
+
         this.updateTitle();
         this.treeOutline.updateSelection();
     },
 
     oncollapse: function()
     {
+        if (this._elementCloseTag)
+            return;
+
         this.updateTitle();
         this.treeOutline.updateSelection();
     },
@@ -653,19 +679,20 @@
 
     onselect: function()
     {
+        this.treeOutline.suppressRevealAndSelect = true;
         this.treeOutline.focusedDOMNode = this.representedObject;
         this.updateSelection();
+        this.treeOutline.suppressRevealAndSelect = false;
     },
 
-    onmousedown: function(event)
+    selectOnMouseDown: function(event)
     {
+        TreeElement.prototype.selectOnMouseDown.call(this, event);
+
         if (this._editing)
             return;
 
-        if (this.isEventWithinDisclosureTriangle(event))
-            return;
-
-        if (this.treeOutline.showInElementsPanelEnabled) {    
+        if (this.treeOutline.showInElementsPanelEnabled) {
             WebInspector.showElementsPanel();
             WebInspector.panels.elements.focusedDOMNode = this.representedObject;
         }
@@ -677,10 +704,10 @@
 
     ondblclick: function(event)
     {
-        if (this._editing)
+        if (this._editing || this._elementCloseTag)
             return;
 
-        if (this._startEditingFromEvent(event))
+        if (this._startEditingTarget(event.target))
             return;
 
         if (this.hasChildren && !this.expanded)
@@ -702,7 +729,7 @@
         this.updateSelection();
     },
 
-    _startEditingFromEvent: function(event)
+    _startEditingTarget: function(eventTarget)
     {
         if (this.treeOutline.focusedDOMNode != this.representedObject)
             return;
@@ -710,15 +737,19 @@
         if (this.representedObject.nodeType != Node.ELEMENT_NODE && this.representedObject.nodeType != Node.TEXT_NODE)
             return false;
 
-        var textNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");
+        var textNode = eventTarget.enclosingNodeOrSelfWithClass("webkit-html-text-node");
         if (textNode)
             return this._startEditingTextNode(textNode);
 
-        var attribute = event.target.enclosingNodeOrSelfWithClass("webkit-html-attribute");
+        var attribute = eventTarget.enclosingNodeOrSelfWithClass("webkit-html-attribute");
         if (attribute)
-            return this._startEditingAttribute(attribute, event.target);
+            return this._startEditingAttribute(attribute, eventTarget);
 
-        var newAttribute = event.target.enclosingNodeOrSelfWithClass("add-attribute");
+        var tagName = eventTarget.enclosingNodeOrSelfWithClass("webkit-html-tag-name");
+        if (tagName)
+            return this._startEditingTagName(tagName);
+
+        var newAttribute = eventTarget.enclosingNodeOrSelfWithClass("add-attribute");
         if (newAttribute)
             return this._addNewAttribute();
 
@@ -736,7 +767,7 @@
             contextMenu.appendItem(WebInspector.UIString("Edit Attribute"), this._startEditingAttribute.bind(this, attribute, event.target));
         contextMenu.appendSeparator();
 
-        // Add node-related actions.
+        // Add free-form node-related actions.
         contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this));
         contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
         contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
@@ -772,17 +803,13 @@
 
     _addNewAttribute: function()
     {
-        var attr = document.createElement("span");
-        attr.className = "webkit-html-attribute";
+        // Cannot just convert the textual html into an element without
+        // a parent node. Use a temporary span container for the HTML.
+        var container = document.createElement("span");
+        container.innerHTML = this._attributeHTML(" ", "");
+        var attr = container.firstChild;
         attr.style.marginLeft = "2px"; // overrides the .editing margin rule
         attr.style.marginRight = "2px"; // overrides the .editing margin rule
-        var name = document.createElement("span");
-        name.className = "webkit-html-attribute-name new-attribute";
-        name.textContent = " ";
-        var value = document.createElement("span");
-        value.className = "webkit-html-attribute-value";
-        attr.appendChild(name);
-        attr.appendChild(value);
 
         var tag = this.listItemElement.getElementsByClassName("webkit-html-tag")[0];
         this._insertInLastAttributePosition(tag, attr);
@@ -799,7 +826,7 @@
                         continue;
 
                     if (elem.hasStyleClass("webkit-html-attribute-value"))
-                        return this._startEditingAttribute(attributeElements[i].parentNode, elem);
+                        return this._startEditingAttribute(elem.parentNode, elem);
                 }
             }
         }
@@ -833,9 +860,7 @@
         // Remove zero-width spaces that were added by nodeTitleInfo.
         removeZeroWidthSpaceRecursive(attribute);
 
-        this._editing = true;
-
-        WebInspector.startEditing(attribute, this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
+        this._editing = WebInspector.startEditing(attribute, this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
         window.getSelection().setBaseAndExtent(elementForSelection, 0, elementForSelection, 1);
 
         return true;
@@ -846,21 +871,59 @@
         if (WebInspector.isBeingEdited(textNode))
             return true;
 
-        this._editing = true;
-
-        WebInspector.startEditing(textNode, this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this));
+        this._editing = WebInspector.startEditing(textNode, this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this));
         window.getSelection().setBaseAndExtent(textNode, 0, textNode, 1);
 
         return true;
     },
 
+    _startEditingTagName: function(tagNameElement)
+    {
+        if (!tagNameElement) {
+            tagNameElement = this.listItemElement.getElementsByClassName("webkit-html-tag-name")[0];
+            if (!tagNameElement)
+                return false;
+        }
+
+        var tagName = tagNameElement.textContent;
+        if (WebInspector.ElementsTreeElement.EditTagBlacklist[tagName.toLowerCase()])
+            return false;
+
+        if (WebInspector.isBeingEdited(tagNameElement))
+            return true;
+
+        var closingTagElement = this._distinctClosingTagElement();
+
+        function keyupListener(event)
+        {
+            if (closingTagElement)
+                closingTagElement.textContent = "</" + tagNameElement.textContent + ">";
+        }
+
+        function editingComitted(element, newTagName)
+        {
+            tagNameElement.removeEventListener('keyup', keyupListener, false);
+            this._tagNameEditingCommitted.apply(this, arguments);
+        }
+
+        function editingCancelled()
+        {
+            tagNameElement.removeEventListener('keyup', keyupListener, false);
+            this._editingCancelled.apply(this, arguments);
+        }
+
+        tagNameElement.addEventListener('keyup', keyupListener, false);
+
+        this._editing = WebInspector.startEditing(tagNameElement, editingComitted.bind(this), editingCancelled.bind(this), tagName);
+        window.getSelection().setBaseAndExtent(tagNameElement, 0, tagNameElement, 1);
+        return true;
+    },
+
     _startEditingAsHTML: function(commitCallback, initialValue)
     {
         if (this._htmlEditElement && WebInspector.isBeingEdited(this._htmlEditElement))
             return true;
 
-        this._editing = true;
-
         this._htmlEditElement = document.createElement("div");
         this._htmlEditElement.className = "source-code elements-tree-editor";
         this._htmlEditElement.textContent = initialValue;
@@ -905,7 +968,7 @@
             this.updateSelection();
         }
 
-        WebInspector.startEditing(this._htmlEditElement, commit.bind(this), dispose.bind(this), null, true);
+        this._editing = WebInspector.startEditing(this._htmlEditElement, commit.bind(this), dispose.bind(this), null, true);
     },
 
     _attributeEditingCommitted: function(element, newText, oldText, attributeName, moveDirection)
@@ -914,34 +977,59 @@
 
         // Before we do anything, determine where we should move
         // next based on the current element's settings
-        var moveToAttribute;
-        var newAttribute;
+        var moveToAttribute, moveToTagName, moveToNewAttribute;
         if (moveDirection) {
             var found = false;
+
+            // Search for the attribute's position, and then decide where to move to.
             var attributes = this.representedObject.attributes;
-            for (var i = 0, len = attributes.length; i < len; ++i) {
+            for (var i = 0; i < attributes.length; ++i) {
                 if (attributes[i].name === attributeName) {
                     found = true;
-                    if (moveDirection === "backward" && i > 0)
-                        moveToAttribute = attributes[i - 1].name;
-                    else if (moveDirection === "forward" && i < attributes.length - 1)
-                        moveToAttribute = attributes[i + 1].name;
-                    else if (moveDirection === "forward" && i === attributes.length - 1)
-                        newAttribute = true;
+                    if (moveDirection === "backward") {
+                        if (i === 0)
+                            moveToTagName = true;
+                        else
+                            moveToAttribute = attributes[i - 1].name;
+                    } else if (moveDirection === "forward") {
+                        if (i === attributes.length - 1)
+                            moveToNewAttribute = true;
+                        else
+                            moveToAttribute = attributes[i + 1].name;
+                    }
                 }
             }
 
-            if (!found && moveDirection === "backward" && attributes.length > 0)
-                moveToAttribute = attributes[attributes.length - 1].name;
-            else if (!found && moveDirection === "forward" && !/^\s*$/.test(newText))
-                newAttribute = true;
+            // Moving From the "New Attribute" position.
+            if (!found) {
+                if (moveDirection === "backward" && attributes.length > 0)
+                    moveToAttribute = attributes[attributes.length - 1].name;
+                else if (moveDirection === "forward" && !/^\s*$/.test(newText))
+                    moveToNewAttribute = true;
+            }
         }
 
-        function moveToNextAttributeIfNeeded() {
+        function moveToNextAttributeIfNeeded()
+        {
+            // Cleanup empty new attribute sections.
+            if (element.textContent.trim().length === 0)
+                element.parentNode.removeChild(element);
+
+            // Make the move.
             if (moveToAttribute)
                 this._triggerEditAttribute(moveToAttribute);
-            else if (newAttribute)
-                this._addNewAttribute(this.listItemElement);
+            else if (moveToNewAttribute)
+                this._addNewAttribute();
+            else if (moveToTagName)
+                this._startEditingTagName();
+        }
+
+        function regenerateStyledAttribute(name, value)
+        {
+            var previous = element.previousSibling;
+            if (!previous || previous.nodeType !== Node.TEXT_NODE)
+                element.parentNode.insertBefore(document.createTextNode(" "), element);
+            element.outerHTML = this._attributeHTML(name, value);
         }
 
         var parseContainerElement = document.createElement("span");
@@ -966,6 +1054,7 @@
             foundOriginalAttribute = foundOriginalAttribute || attr.name === attributeName;
             try {
                 this.representedObject.setAttribute(attr.name, attr.value);
+                regenerateStyledAttribute.call(this, attr.name, attr.value);
             } catch(e) {} // ignore invalid attribute (innerHTML doesn't throw errors, but this can)
         }
 
@@ -977,6 +1066,64 @@
         moveToNextAttributeIfNeeded.call(this);
     },
 
+    _tagNameEditingCommitted: function(element, newText, oldText, tagName, moveDirection)
+    {
+        delete this._editing;
+        var self = this;
+
+        function cancel()
+        {
+            var closingTagElement = self._distinctClosingTagElement();
+            if (closingTagElement)
+                closingTagElement.textContent = "</" + tagName + ">";
+
+            self._editingCancelled(element, tagName);
+            moveToNextAttributeIfNeeded.call(self);
+        }
+
+        function moveToNextAttributeIfNeeded()
+        {
+            if (moveDirection !== "forward")
+                return;
+
+            var attributes = this.representedObject.attributes;
+            if (attributes.length > 0)
+                this._triggerEditAttribute(attributes[0].name);
+            else
+                this._addNewAttribute();
+        }
+
+        newText = newText.trim();
+        if (newText === oldText) {
+            cancel();
+            return;
+        }
+
+        var treeOutline = this.treeOutline;
+        var wasExpanded = this.expanded;
+
+        function changeTagNameCallback(nodeId)
+        {
+            if (nodeId === -1) {
+                cancel();
+                return;
+            }
+
+            // Select it and expand if necessary. We force tree update so that it processes dom events and is up to date.
+            WebInspector.panels.elements.updateModifiedNodes();
+
+            WebInspector.updateFocusedNode(nodeId);
+            var newTreeItem = treeOutline.findTreeElement(WebInspector.domAgent.nodeForId(nodeId));
+            if (wasExpanded)
+                newTreeItem.expand();
+
+            moveToNextAttributeIfNeeded.call(newTreeItem);
+        }
+
+        var callId = WebInspector.Callback.wrap(changeTagNameCallback);
+        InspectorBackend.changeTagName(callId, this.representedObject.id, newText, wasExpanded);
+    },
+
     _textNodeEditingCommitted: function(element, newText)
     {
         delete this._editing;
@@ -1003,6 +1150,24 @@
         this.updateTitle();
     },
 
+    _distinctClosingTagElement: function()
+    {
+        // FIXME: Improve the Tree Element / Outline Abstraction to prevent crawling the DOM
+
+        // For an expanded element, it will be the last element with class "close"
+        // in the child element list.
+        if (this.expanded) {
+            var closers = this._childrenListNode.querySelectorAll(".close");
+            return closers[closers.length-1];
+        }
+
+        // Remaining cases are single line non-expanded elements with a closing
+        // tag, or HTML elements without a closing tag (such as <br>). Return
+        // null in the case where there isn't a closing tag.
+        var tags = this.listItemElement.getElementsByClassName("webkit-html-tag");
+        return (tags.length === 1 ? null : tags[tags.length-1]);
+    },
+
     updateTitle: function()
     {
         // If we are editing, return early to prevent canceling the edit.
@@ -1051,92 +1216,117 @@
         return hrefValue;
     },
 
+    _attributeHTML: function(name, value, node, linkify, tooltipText)
+    {
+        var hasText = (value.length > 0);
+        var html = "<span class=\"webkit-html-attribute\"><span class=\"webkit-html-attribute-name\">" + name.escapeHTML() + "</span>";
+
+        if (hasText)
+            html += "=&#8203;\"";
+
+        if (linkify && (name === "src" || name === "href")) {
+            value = value.replace(/([\/;:\)\]\}])/g, "$1\u200B");
+            html += linkify(this._rewriteAttrHref(node, value), value, "webkit-html-attribute-value", node.nodeName.toLowerCase() === "a", tooltipText);
+        } else {
+            value = value.escapeHTML().replace(/([\/;:\)\]\}])/g, "$1&#8203;");
+            html += "<span class=\"webkit-html-attribute-value\">" + value + "</span>";
+        }
+
+        if (hasText)
+            html += "\"";
+
+        html += "</span>";
+        return html;
+    },
+
+    _tagHTML: function(tagName, isClosingTag, isDistinctTreeElement, linkify, tooltipText)
+    {
+        var node = this.representedObject;
+        var result = "<span class=\"webkit-html-tag" + (isClosingTag && isDistinctTreeElement ? " close" : "")  + "\">&lt;";
+        result += "<span " + (isClosingTag ? "" : "class=\"webkit-html-tag-name\"") + ">" + (isClosingTag ? "/" : "") + tagName + "</span>";
+        if (!isClosingTag && node.hasAttributes()) {
+            for (var i = 0; i < node.attributes.length; ++i) {
+                var attr = node.attributes[i];
+                result += " " + this._attributeHTML(attr.name, attr.value, node, linkify, tooltipText);
+            }
+        }
+        result += "&gt;</span>&#8203;";
+
+        return result;
+    },
+
     _nodeTitleInfo: function(linkify, tooltipText)
     {
         var node = this.representedObject;
         var info = {title: "", hasChildren: this.hasChildren};
-        
+
         switch (node.nodeType) {
             case Node.DOCUMENT_NODE:
                 info.title = "Document";
                 break;
-                
+
             case Node.DOCUMENT_FRAGMENT_NODE:
                 info.title = "Document Fragment";
                 break;
 
             case Node.ELEMENT_NODE:
-                var tagName = node.nodeName.toLowerCase().escapeHTML();
-                info.title = "<span class=\"webkit-html-tag\">&lt;" + tagName;
-                
-                if (node.hasAttributes()) {
-                    for (var i = 0; i < node.attributes.length; ++i) {
-                        var attr = node.attributes[i];
-                        info.title += " <span class=\"webkit-html-attribute\"><span class=\"webkit-html-attribute-name\">" + attr.name.escapeHTML() + "</span>=&#8203;\"";
-                        
-                        var value = attr.value;
-                        if (linkify && (attr.name === "src" || attr.name === "href")) {
-                            var value = value.replace(/([\/;:\)\]\}])/g, "$1\u200B");
-                            info.title += linkify(this._rewriteAttrHref(node, attr.value), value, "webkit-html-attribute-value", node.nodeName.toLowerCase() == "a", tooltipText);
-                        } else {
-                            var value = value.escapeHTML();
-                            value = value.replace(/([\/;:\)\]\}])/g, "$1&#8203;");
-                            info.title += "<span class=\"webkit-html-attribute-value\">" + value + "</span>";
-                        }
-                        info.title += "\"</span>";
-                    }
+                var tagName = this.treeOutline.nodeNameToCorrectCase(node.nodeName).escapeHTML();
+                if (this._elementCloseTag) {
+                    info.title = this._tagHTML(tagName, true, true);
+                    info.hasChildren = false;
+                    break;
                 }
-                info.title += "&gt;</span>&#8203;";
-                
-                const closingTagHTML = "<span class=\"webkit-html-tag\">&lt;/" + tagName + "&gt;</span>&#8203;";
+
+                info.title = this._tagHTML(tagName, false, false, linkify, tooltipText);
+
                 var textChild = onlyTextChild.call(node);
                 var showInlineText = textChild && textChild.textContent.length < Preferences.maxInlineTextChildLength;
 
                 if (!this.expanded && (!showInlineText && (this.treeOutline.isXMLMimeType || !WebInspector.ElementsTreeElement.ForbiddenClosingTagElements[tagName]))) {
                     if (this.hasChildren)
                         info.title += "<span class=\"webkit-html-text-node\">&#8230;</span>&#8203;";
-                    info.title += closingTagHTML;
+                    info.title += this._tagHTML(tagName, true, false);
                 }
 
                 // If this element only has a single child that is a text node,
                 // just show that text and the closing tag inline rather than
                 // create a subtree for them
                 if (showInlineText) {
-                    info.title += "<span class=\"webkit-html-text-node\">" + textChild.nodeValue.escapeHTML() + "</span>&#8203;" + closingTagHTML;
+                    info.title += "<span class=\"webkit-html-text-node\">" + textChild.nodeValue.escapeHTML() + "</span>&#8203;" + this._tagHTML(tagName, true, false);
                     info.hasChildren = false;
                 }
                 break;
-                
+
             case Node.TEXT_NODE:
                 if (isNodeWhitespace.call(node))
                     info.title = "(whitespace)";
                 else {
-                    if (node.parentNode && node.parentNode.nodeName.toLowerCase() == "script") {
+                    if (node.parentNode && node.parentNode.nodeName.toLowerCase() === "script") {
                         var newNode = document.createElement("span");
                         newNode.textContent = node.textContent;
 
                         var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript");
                         javascriptSyntaxHighlighter.syntaxHighlightNode(newNode);
-                        
+
                         info.title = "<span class=\"webkit-html-text-node webkit-html-js-node\">" + newNode.innerHTML.replace(/^[\n\r]*/, "").replace(/\s*$/, "") + "</span>";
-                    } else if (node.parentNode && node.parentNode.nodeName.toLowerCase() == "style") {
+                    } else if (node.parentNode && node.parentNode.nodeName.toLowerCase() === "style") {
                         var newNode = document.createElement("span");
                         newNode.textContent = node.textContent;
-                        
+
                         var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css");
                         cssSyntaxHighlighter.syntaxHighlightNode(newNode);
-                        
+
                         info.title = "<span class=\"webkit-html-text-node webkit-html-css-node\">" + newNode.innerHTML.replace(/^[\n\r]*/, "").replace(/\s*$/, "") + "</span>";
                     } else {
-                        info.title = "\"<span class=\"webkit-html-text-node\">" + node.nodeValue.escapeHTML() + "</span>\""; 
+                        info.title = "\"<span class=\"webkit-html-text-node\">" + node.nodeValue.escapeHTML() + "</span>\"";
                     }
-                } 
+                }
                 break;
-                
+
             case Node.COMMENT_NODE:
                 info.title = "<span class=\"webkit-html-comment\">&lt;!--" + node.nodeValue.escapeHTML() + "--&gt;</span>";
                 break;
-                
+
             case Node.DOCUMENT_TYPE_NODE:
                 info.title = "<span class=\"webkit-html-doctype\">&lt;!DOCTYPE " + node.nodeName;
                 if (node.publicId) {
@@ -1150,9 +1340,9 @@
                 info.title += "&gt;</span>";
                 break;
             default:
-                info.title = node.nodeName.toLowerCase().collapseWhitespace().escapeHTML();
+                info.title = this.treeOutline.nodeNameToCorrectCase(node.nodeName).collapseWhitespace().escapeHTML();
         }
-        
+
         return info;
     },
 
@@ -1165,7 +1355,7 @@
         }
         return false;
     },
-    
+
     remove: function()
     {
         var parentElement = this.parent;
@@ -1242,5 +1432,3 @@
 }
 
 WebInspector.ElementsTreeElement.prototype.__proto__ = TreeElement.prototype;
-
-WebInspector.didRemoveNode = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/ImageView.js b/WebCore/inspector/front-end/ImageView.js
index 96e1a6e..c13c9a5 100644
--- a/WebCore/inspector/front-end/ImageView.js
+++ b/WebCore/inspector/front-end/ImageView.js
@@ -31,45 +31,48 @@
     WebInspector.ResourceView.call(this, resource);
 
     this.element.addStyleClass("image");
-
-    var container = document.createElement("div");
-    container.className = "image";
-    this.contentElement.appendChild(container);
-
-    this.imagePreviewElement = document.createElement("img");
-    this.imagePreviewElement.addStyleClass("resource-image-view");
-    this.imagePreviewElement.setAttribute("src", this.resource.url);
-
-    container.appendChild(this.imagePreviewElement);
-
-    container = document.createElement("div");
-    container.className = "info";
-    this.contentElement.appendChild(container);
-
-    var imageNameElement = document.createElement("h1");
-    imageNameElement.className = "title";
-    imageNameElement.textContent = this.resource.displayName;
-    container.appendChild(imageNameElement);
-
-    var infoListElement = document.createElement("dl");
-    infoListElement.className = "infoList";
-
-    var imageProperties = [
-        { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", this.imagePreviewElement.naturalWidth, this.imagePreviewElement.height) },
-        { name: WebInspector.UIString("File size"), value: Number.bytesToString(this.resource.contentLength, WebInspector.UIString.bind(WebInspector)) },
-        { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType }
-    ];
-
-    var listHTML = '';
-    for (var i = 0; i < imageProperties.length; ++i)
-        listHTML += "<dt>" + imageProperties[i].name + "</dt><dd>" + imageProperties[i].value + "</dd>";
-
-    infoListElement.innerHTML = listHTML;
-    container.appendChild(infoListElement);
 }
 
 WebInspector.ImageView.prototype = {
-    
+    contentTabSelected: function()
+    {
+        if (this._container)
+            return;
+        this._container = document.createElement("div");
+        this._container.className = "image";
+        this.contentElement.appendChild(this._container);
+
+        this.imagePreviewElement = document.createElement("img");
+        this.imagePreviewElement.addStyleClass("resource-image-view");
+        this.imagePreviewElement.setAttribute("src", this.resource.url);
+
+        this._container.appendChild(this.imagePreviewElement);
+
+        this._container = document.createElement("div");
+        this._container.className = "info";
+        this.contentElement.appendChild(this._container);
+
+        var imageNameElement = document.createElement("h1");
+        imageNameElement.className = "title";
+        imageNameElement.textContent = this.resource.displayName;
+        this._container.appendChild(imageNameElement);
+
+        var infoListElement = document.createElement("dl");
+        infoListElement.className = "infoList";
+
+        var imageProperties = [
+            { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", this.imagePreviewElement.naturalWidth, this.imagePreviewElement.height) },
+            { name: WebInspector.UIString("File size"), value: Number.bytesToString(this.resource.resourceSize, WebInspector.UIString.bind(WebInspector)) },
+            { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType }
+        ];
+
+        var listHTML = '';
+        for (var i = 0; i < imageProperties.length; ++i)
+            listHTML += "<dt>" + imageProperties[i].name + "</dt><dd>" + imageProperties[i].value + "</dd>";
+
+        infoListElement.innerHTML = listHTML;
+        this._container.appendChild(infoListElement);
+    }
 }
 
 WebInspector.ImageView.prototype.__proto__ = WebInspector.ResourceView.prototype;
diff --git a/WebCore/inspector/front-end/Images/auditsIcon.png b/WebCore/inspector/front-end/Images/auditsIcon.png
new file mode 100644
index 0000000..8d1f752
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/auditsIcon.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointBorder.png b/WebCore/inspector/front-end/Images/breakpointBorder.png
new file mode 100644
index 0000000..0b1b550
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointBorder.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointConditionalBorder.png b/WebCore/inspector/front-end/Images/breakpointConditionalBorder.png
new file mode 100644
index 0000000..430e37e
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointConditionalBorder.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointConditionalCounterBorder.png b/WebCore/inspector/front-end/Images/breakpointConditionalCounterBorder.png
new file mode 100644
index 0000000..b4a5030
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointConditionalCounterBorder.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointCounterBorder.png b/WebCore/inspector/front-end/Images/breakpointCounterBorder.png
new file mode 100644
index 0000000..8b77b61
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointCounterBorder.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointsActivateButtonGlyph.png b/WebCore/inspector/front-end/Images/breakpointsActivateButtonGlyph.png
new file mode 100644
index 0000000..ce49aac
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointsActivateButtonGlyph.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/breakpointsDeactivateButtonGlyph.png b/WebCore/inspector/front-end/Images/breakpointsDeactivateButtonGlyph.png
new file mode 100644
index 0000000..5c5fcf6
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/breakpointsDeactivateButtonGlyph.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/programCounterBorder.png b/WebCore/inspector/front-end/Images/programCounterBorder.png
new file mode 100644
index 0000000..fed2f3e
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/programCounterBorder.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/spinner.gif b/WebCore/inspector/front-end/Images/spinner.gif
new file mode 100644
index 0000000..5f68c02
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/spinner.gif
Binary files differ
diff --git a/WebCore/inspector/front-end/InjectedFakeWorker.js b/WebCore/inspector/front-end/InjectedFakeWorker.js
new file mode 100644
index 0000000..7176844
--- /dev/null
+++ b/WebCore/inspector/front-end/InjectedFakeWorker.js
@@ -0,0 +1,345 @@
+/*
+ * 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.
+ */
+
+var InjectedFakeWorker = function(InjectedScriptHost, inspectedWindow, injectedScriptId)
+{
+
+Worker = function(url)
+{
+    var impl = new FakeWorker(this, url);
+    if (impl === null)
+        return null;
+
+    this.isFake = true;
+    this.postMessage = bind(impl.postMessage, impl);
+    this.terminate = bind(impl.terminate, impl);
+
+    function onmessageGetter()
+    {
+        return impl.channel.port1.onmessage;
+    }
+    function onmessageSetter(callback)
+    {
+        impl.channel.port1.onmessage = callback;
+    }
+    this.__defineGetter__("onmessage", onmessageGetter);
+    this.__defineSetter__("onmessage", onmessageSetter);
+    this.addEventListener = bind(impl.channel.port1.addEventListener, impl.channel.port1);
+    this.removeEventListener = bind(impl.channel.port1.removeEventListener, impl.channel.port1);
+    this.dispatchEvent = bind(impl.channel.port1.dispatchEvent, impl.channel.port1);
+}
+
+function FakeWorker(worker, url)
+{
+    var scriptURL = this._expandURLAndCheckOrigin(document.baseURI, location.href, url);
+
+    this._worker = worker;
+    this._id = InjectedScriptHost.nextWorkerId();
+    this.channel = new MessageChannel();
+    this._listeners = [];
+    this._buildWorker(scriptURL);
+
+    InjectedScriptHost.didCreateWorker(this._id, scriptURL.url, false);
+}
+
+FakeWorker.prototype = {
+    postMessage: function(msg, opt_ports)
+    {
+        if (this._frame != null)
+            this.channel.port1.postMessage.apply(this.channel.port1, arguments);
+        else if (this._pendingMessages)
+            this._pendingMessages.push(arguments)
+        else
+            this._pendingMessages = [ arguments ];
+    },
+
+    terminate: function()
+    {
+        InjectedScriptHost.didDestroyWorker(this._id);
+
+        this.channel.port1.close();
+        this.channel.port2.close();
+        if (this._frame != null)
+            this._frame.frameElement.parentNode.removeChild(this._frame.frameElement);
+        this._frame = null;
+        this._worker = null; // Break reference loop.
+    },
+
+    _buildWorker: function(url)
+    {
+        var code = this._loadScript(url.url);
+        var iframeElement = document.createElement("iframe");
+        iframeElement.style.display = "none";
+
+        this._document = document;
+        iframeElement.onload = bind(this._onWorkerFrameLoaded, this, iframeElement, url, code);
+
+        if (document.body)
+            this._attachWorkerFrameToDocument(iframeElement, url, code);
+        else
+            window.addEventListener("load", bind(this._attachWorkerFrameToDocument, this, iframeElement), false);
+    },
+
+    _attachWorkerFrameToDocument: function(iframeElement)
+    {
+        document.body.appendChild(iframeElement);
+    },
+
+    _onWorkerFrameLoaded: function(iframeElement, url, code)
+    {
+        var frame = iframeElement.contentWindow;
+        this._frame = frame;
+        this._setupWorkerContext(frame, url);
+
+        var frameContents = '(function() { var location = __devtools.location; var window; ' + code + '})();\n' + '//@ sourceURL=' + url.url;
+
+        frame.eval(frameContents);
+        if (this._pendingMessages) {
+            for (var msg = 0; msg < this._pendingMessages.length; ++msg)
+                this.postMessage.apply(this, this._pendingMessages[msg]);
+            delete this._pendingMessages;
+        }
+    },
+
+    _setupWorkerContext: function(workerFrame, url)
+    {
+        workerFrame.__devtools = {
+            handleException: bind(this._handleException, this),
+            location: url.mockLocation()
+        };
+
+        var self = this;
+
+        function onmessageGetter()
+        {
+            return self.channel.port2.onmessage ? self.channel.port2.onmessage.originalCallback : null;
+        }
+
+        function onmessageSetter(callback)
+        {
+            var wrappedCallback = bind(self._callbackWrapper, self, callback);
+            wrappedCallback.originalCallback = callback;
+            self.channel.port2.onmessage = wrappedCallback;
+        }
+
+        workerFrame.__defineGetter__("onmessage", onmessageGetter);
+        workerFrame.__defineSetter__("onmessage", onmessageSetter);
+        workerFrame.addEventListener = bind(this._addEventListener, this);
+        workerFrame.removeEventListener = bind(this._removeEventListener, this);
+        workerFrame.dispatchEvent = bind(this.channel.port2.dispatchEvent, this.channel.port2);
+        workerFrame.postMessage = bind(this.channel.port2.postMessage, this.channel.port2);
+        workerFrame.importScripts = bind(this._importScripts, this, workerFrame);
+        workerFrame.close = bind(this.terminate, this);
+    },
+
+    _addEventListener: function(type, callback, useCapture)
+    {
+        var wrappedCallback = bind(this._callbackWrapper, this, callback);
+        wrappedCallback.originalCallback = callback;
+        wrappedCallback.type = type;
+        wrappedCallback.useCapture = Boolean(useCapture);
+
+        this.channel.port2.addEventListener(type, wrappedCallback, useCapture);
+        this._listeners.push(wrappedCallback);
+    },
+
+    _removeEventListener: function(type, callback, useCapture)
+    {
+        var listeners = this._listeners;
+        for (var i = 0; i < listeners.length; ++i) {
+            if (listeners[i].originalCallback === callback &&
+                listeners[i].type === type && 
+                listeners[i].useCapture === Boolean(useCapture)) {
+                this.channel.port2.removeEventListener(type, listeners[i], useCapture);
+                listeners[i] = listeners[listeners.length - 1];
+                listeners.pop();
+                break;
+            }
+        }
+    },
+
+    _callbackWrapper: function(callback, msg)
+    {
+        // Shortcut -- if no exception handlers installed, avoid try/catch so as not to obscure line number.
+        if (!this._frame.onerror && !this._worker.onerror) {
+            callback(msg);
+            return;
+        }
+
+        try {
+            callback(msg);
+        } catch (e) {
+            this._handleException(e, this._frame.onerror, this._worker.onerror);
+        }
+    },
+
+    _handleException: function(e)
+    {
+        // NB: it should be an ErrorEvent, but creating it from script is not
+        // currently supported, so emulate it on top of plain vanilla Event.
+        var errorEvent = this._document.createEvent("Event");
+        errorEvent.initEvent("Event", false, false);
+        errorEvent.message = "Uncaught exception";
+
+        for (var i = 1; i < arguments.length; ++i) {
+            if (arguments[i] && arguments[i](errorEvent))
+                return;
+        }
+
+        throw e;
+    },
+
+    _importScripts: function(targetFrame)
+    {
+        for (var i = 1; i < arguments.length; ++i) {
+            var workerOrigin = targetFrame.__devtools.location.href;
+            var url = this._expandURLAndCheckOrigin(workerOrigin, workerOrigin, arguments[i]);
+            targetFrame.eval(this._loadScript(url.url) + "\n//@ sourceURL= " + url.url);
+        }
+    },
+
+    _loadScript: function(url)
+    {
+        var xhr = new XMLHttpRequest();
+        xhr.open("GET", url, false);
+        xhr.send(null);
+
+        var text = xhr.responseText;
+        if (xhr.status != 0 && xhr.status/100 !== 2) { // We're getting status === 0 when using file://.
+            console.error("Failed to load worker: " + url + "[" + xhr.status + "]");
+            text = ""; // We've got error message, not worker code.
+        }
+        return text;
+    },
+
+    _expandURLAndCheckOrigin: function(baseURL, origin, url)
+    {
+        var scriptURL = new URL(baseURL).completeWith(url);
+
+        if (!scriptURL.sameOrigin(origin))
+            throw new DOMCoreException("SECURITY_ERR",18);
+        return scriptURL;
+    }
+};
+
+function URL(url)
+{
+    this.url = url;
+    this.split();
+}
+
+URL.prototype = {
+    urlRegEx: (/^(http[s]?|file):\/\/([^\/:]*)(:[\d]+)?(?:(\/[^#?]*)(\?[^#]*)?(?:#(.*))?)?$/i),
+
+    split: function()
+    {
+        function emptyIfNull(str)
+        {
+            return str == null ? "" : str;
+        }
+        var parts = this.urlRegEx.exec(this.url);
+
+        this.schema = parts[1];
+        this.host = parts[2];
+        this.port = emptyIfNull(parts[3]);
+        this.path = emptyIfNull(parts[4]);
+        this.query = emptyIfNull(parts[5]);
+        this.fragment = emptyIfNull(parts[6]);
+    },
+
+    mockLocation: function()
+    {
+        var host = this.host.replace(/^[^@]*@/, "");
+
+        return {
+            href:     this.url,
+            protocol: this.schema + ":",
+            host:     host,
+            hostname: host,
+            port:     this.port,
+            pathname: this.path,
+            search:   this.query,
+            hash:     this.fragment
+        };
+    },
+
+    completeWith: function(url)
+    {
+        if (url === "" || /^[^/]*:/.exec(url)) // If given absolute url, return as is now.
+            return new URL(url);
+
+        var relParts = /^([^#?]*)(.*)$/.exec(url); // => [ url, path, query-andor-fragment ]
+
+        var path = (relParts[1].slice(0, 1) === "/" ? "" : this.path.replace(/[^/]*$/, "")) + relParts[1];
+        path = path.replace(/(\/\.)+(\/|$)/g, "/").replace(/[^/]*\/\.\.(\/|$)/g, "");
+
+        return new URL(this.schema + "://" + this.host + this.port + path + relParts[2]);
+    },
+
+    sameOrigin: function(url)
+    {
+        function normalizePort(schema, port)
+        {
+            var portNo = port.slice(1);
+            return (schema === "https" && portNo == 443 || schema === "http" && portNo == 80) ? "" : port;
+        }
+
+        var other = new URL(url);
+
+        return this.schema === other.schema &&
+            this.host === other.host &&
+            normalizePort(this.schema, this.port) === normalizePort(other.schema, other.port);
+    }
+};
+
+function DOMCoreException(name, code)
+{
+    function formatError()
+    {
+        return "Error: " + this.message;
+    }
+
+    this.name = name;
+    this.message = name + ": DOM Exception " + code;
+    this.code = code;
+    this.toString = bind(formatError, this);
+}
+
+function bind(func, thisObject)
+{
+    var args = Array.prototype.slice.call(arguments, 2);
+    return function() { return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0))); };
+}
+
+function noop()
+{
+}
+
+}
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 8d8fa88..8984d0e 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -26,28 +26,43 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-var injectedScriptConstructor = (function (InjectedScriptHost, inspectedWindow, injectedScriptId) {
+var injectedScriptConstructor = (function (InjectedScriptHost, inspectedWindow, injectedScriptId, jsEngine) {
 
 var InjectedScript = {};
 
 InjectedScript.lastBoundObjectId = 1;
 InjectedScript.idToWrappedObject = {};
 InjectedScript.objectGroups = {};
+
+InjectedScript.wrapObjectForConsole = function(object, canAccessInspectedWindow)
+{
+    if (canAccessInspectedWindow)
+        return InjectedScript.wrapObject(object, "console");
+    var result = {};
+    result.type = typeof object;
+    result.description = InjectedScript._toString(object);
+    return result;
+}
+
 InjectedScript.wrapObject = function(object, objectGroupName)
 {
-    var objectId;
-    if (typeof object === "object" || typeof object === "function" ||
-        (typeof object === "undefined" && object instanceof inspectedWindow.HTMLAllCollection)) { // FIXME(33716)
-        var id = InjectedScript.lastBoundObjectId++;
-        objectId = "object#" + id;
-        InjectedScript.idToWrappedObject[objectId] = object;
+    try {
+        var objectId;
+        if (typeof object === "object" || typeof object === "function" || InjectedScript._isHTMLAllCollection(object)) {
+            var id = InjectedScript.lastBoundObjectId++;
+            objectId = "object#" + id;
+            InjectedScript.idToWrappedObject[objectId] = object;
 
-        var group = InjectedScript.objectGroups[objectGroupName];
-        if (!group) {
-            group = [];
-            InjectedScript.objectGroups[objectGroupName] = group;
+            var group = InjectedScript.objectGroups[objectGroupName];
+            if (!group) {
+                group = [];
+                InjectedScript.objectGroups[objectGroupName] = group;
+            }
+            group.push(objectId);
         }
-        group.push(objectId);
+        return InjectedScript.createProxyObject(object, objectId);
+    } catch (e) {
+        return InjectedScript.createProxyObject("[ Exception: " + e.toString() + " ]");
     }
     return InjectedScript.createProxyObject(object, objectId);
 };
@@ -68,10 +83,6 @@
 // Called from within InspectorController on the 'inspected page' side.
 InjectedScript.reset = function()
 {
-    InjectedScript._styles = {};
-    InjectedScript._styleRules = {};
-    InjectedScript._lastStyleId = 0;
-    InjectedScript._lastStyleRuleId = 0;
     InjectedScript._searchResults = [];
     InjectedScript._includedInSearchResultsPropertyName = "__includedInInspectorSearchResults";
 }
@@ -85,384 +96,12 @@
         argsArray.splice(0, 0, callId);  // Methods that run asynchronously have a call back id parameter.
     var result = InjectedScript[methodName].apply(InjectedScript, argsArray);
     if (typeof result === "undefined") {
-        InjectedScript._window().console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
+        inspectedWindow.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
         result = null;
     }
     return result;
 }
 
-InjectedScript.getStyles = function(nodeId, authorOnly)
-{
-    var node = InjectedScript._nodeForId(nodeId);
-    if (!node)
-        return false;
-    var defaultView = node.ownerDocument.defaultView;
-    var matchedRules = defaultView.getMatchedCSSRules(node, "", authorOnly);
-    var matchedCSSRules = [];
-    for (var i = 0; matchedRules && i < matchedRules.length; ++i)
-        matchedCSSRules.push(InjectedScript._serializeRule(matchedRules[i]));
-
-    var styleAttributes = {};
-    var attributes = node.attributes;
-    for (var i = 0; attributes && i < attributes.length; ++i) {
-        if (attributes[i].style)
-            styleAttributes[attributes[i].name] = InjectedScript._serializeStyle(attributes[i].style, true);
-    }
-    var result = {};
-    result.inlineStyle = InjectedScript._serializeStyle(node.style, true);
-    result.computedStyle = InjectedScript._serializeStyle(defaultView.getComputedStyle(node));
-    result.matchedCSSRules = matchedCSSRules;
-    result.styleAttributes = styleAttributes;
-    return result;
-}
-
-InjectedScript.getComputedStyle = function(nodeId)
-{
-    var node = InjectedScript._nodeForId(nodeId);
-    if (!node)
-        return false;
-    return InjectedScript._serializeStyle(node.ownerDocument.defaultView.getComputedStyle(node));
-}
-
-InjectedScript.getInlineStyle = function(nodeId)
-{
-    var node = InjectedScript._nodeForId(nodeId);
-    if (!node)
-        return false;
-    return InjectedScript._serializeStyle(node.style, true);
-}
-
-InjectedScript.applyStyleText = function(styleId, styleText, propertyName)
-{
-    var style = InjectedScript._styles[styleId];
-    if (!style)
-        return false;
-
-    var styleTextLength = styleText.length;
-
-    // Create a new element to parse the user input CSS.
-    var parseElement = document.createElement("span");
-    parseElement.setAttribute("style", styleText);
-
-    var tempStyle = parseElement.style;
-    if (tempStyle.length || !styleTextLength) {
-        // The input was parsable or the user deleted everything, so remove the
-        // original property from the real style declaration. If this represents
-        // a shorthand remove all the longhand properties.
-        if (style.getPropertyShorthand(propertyName)) {
-            var longhandProperties = InjectedScript._getLonghandProperties(style, propertyName);
-            for (var i = 0; i < longhandProperties.length; ++i)
-                style.removeProperty(longhandProperties[i]);
-        } else
-            style.removeProperty(propertyName);
-    }
-
-    // Notify caller that the property was successfully deleted.
-    if (!styleTextLength)
-        return [null, [propertyName]];
-
-    if (!tempStyle.length)
-        return false;
-
-    // Iterate of the properties on the test element's style declaration and
-    // add them to the real style declaration. We take care to move shorthands.
-    var foundShorthands = {};
-    var changedProperties = [];
-    var uniqueProperties = InjectedScript._getUniqueStyleProperties(tempStyle);
-    for (var i = 0; i < uniqueProperties.length; ++i) {
-        var name = uniqueProperties[i];
-        var shorthand = tempStyle.getPropertyShorthand(name);
-
-        if (shorthand && shorthand in foundShorthands)
-            continue;
-
-        if (shorthand) {
-            var value = InjectedScript._getShorthandValue(tempStyle, shorthand);
-            var priority = InjectedScript._getShorthandPriority(tempStyle, shorthand);
-            foundShorthands[shorthand] = true;
-        } else {
-            var value = tempStyle.getPropertyValue(name);
-            var priority = tempStyle.getPropertyPriority(name);
-        }
-
-        // Set the property on the real style declaration.
-        style.setProperty((shorthand || name), value, priority);
-        changedProperties.push(shorthand || name);
-    }
-    return [InjectedScript._serializeStyle(style, true), changedProperties];
-}
-
-InjectedScript.setStyleText = function(style, cssText)
-{
-    style.cssText = cssText;
-    return true;
-}
-
-InjectedScript.toggleStyleEnabled = function(styleId, propertyName, disabled)
-{
-    var style = InjectedScript._styles[styleId];
-    if (!style)
-        return false;
-
-    if (disabled) {
-        if (!style.__disabledPropertyValues || !style.__disabledPropertyPriorities) {
-            style.__disabledProperties = {};
-            style.__disabledPropertyValues = {};
-            style.__disabledPropertyPriorities = {};
-        }
-
-        style.__disabledPropertyValues[propertyName] = style.getPropertyValue(propertyName);
-        style.__disabledPropertyPriorities[propertyName] = style.getPropertyPriority(propertyName);
-
-        if (style.getPropertyShorthand(propertyName)) {
-            var longhandProperties = InjectedScript._getLonghandProperties(style, propertyName);
-            for (var i = 0; i < longhandProperties.length; ++i) {
-                style.__disabledProperties[longhandProperties[i]] = true;
-                style.removeProperty(longhandProperties[i]);
-            }
-        } else {
-            style.__disabledProperties[propertyName] = true;
-            style.removeProperty(propertyName);
-        }
-    } else if (style.__disabledProperties && style.__disabledProperties[propertyName]) {
-        var value = style.__disabledPropertyValues[propertyName];
-        var priority = style.__disabledPropertyPriorities[propertyName];
-
-        style.setProperty(propertyName, value, priority);
-        delete style.__disabledProperties[propertyName];
-        delete style.__disabledPropertyValues[propertyName];
-        delete style.__disabledPropertyPriorities[propertyName];
-    }
-    return InjectedScript._serializeStyle(style, true);
-}
-
-InjectedScript.applyStyleRuleText = function(ruleId, newContent, selectedNodeId)
-{
-    var rule = InjectedScript._styleRules[ruleId];
-    if (!rule)
-        return false;
-
-    var selectedNode = InjectedScript._nodeForId(selectedNodeId);
-
-    try {
-        var stylesheet = rule.parentStyleSheet;
-        stylesheet.addRule(newContent);
-        var newRule = stylesheet.cssRules[stylesheet.cssRules.length - 1];
-        newRule.style.cssText = rule.style.cssText;
-
-        var parentRules = stylesheet.cssRules;
-        for (var i = 0; i < parentRules.length; ++i) {
-            if (parentRules[i] === rule) {
-                rule.parentStyleSheet.removeRule(i);
-                break;
-            }
-        }
-
-        return [InjectedScript._serializeRule(newRule), InjectedScript._doesSelectorAffectNode(newContent, selectedNode)];
-    } catch(e) {
-        // Report invalid syntax.
-        return false;
-    }
-}
-
-InjectedScript.addStyleSelector = function(newContent, selectedNodeId)
-{
-    var selectedNode = InjectedScript._nodeForId(selectedNodeId);
-    if (!selectedNode)
-        return false;
-    var ownerDocument = selectedNode.ownerDocument;
-
-    var stylesheet = ownerDocument.__stylesheet;
-    if (!stylesheet) {
-        var head = ownerDocument.head;
-        var styleElement = ownerDocument.createElement("style");
-        styleElement.type = "text/css";
-        head.appendChild(styleElement);
-        stylesheet = ownerDocument.styleSheets[ownerDocument.styleSheets.length - 1];
-        ownerDocument.__stylesheet = stylesheet;
-    }
-
-    try {
-        stylesheet.addRule(newContent);
-    } catch (e) {
-        // Invalid Syntax for a Selector
-        return false;
-    }
-
-    var rule = stylesheet.cssRules[stylesheet.cssRules.length - 1];
-    rule.__isViaInspector = true;
-
-    return [ InjectedScript._serializeRule(rule), InjectedScript._doesSelectorAffectNode(newContent, selectedNode) ];
-}
-
-InjectedScript._doesSelectorAffectNode = function(selectorText, node)
-{
-    if (!node)
-        return false;
-    var nodes = node.ownerDocument.querySelectorAll(selectorText);
-    for (var i = 0; i < nodes.length; ++i) {
-        if (nodes[i] === node) {
-            return true;
-        }
-    }
-    return false;
-}
-
-InjectedScript.setStyleProperty = function(styleId, name, value)
-{
-    var style = InjectedScript._styles[styleId];
-    if (!style)
-        return false;
-
-    style.setProperty(name, value, "");
-    return true;
-}
-
-InjectedScript._serializeRule = function(rule)
-{
-    var parentStyleSheet = rule.parentStyleSheet;
-
-    var ruleValue = {};
-    ruleValue.selectorText = rule.selectorText;
-    if (parentStyleSheet) {
-        ruleValue.parentStyleSheet = {};
-        ruleValue.parentStyleSheet.href = parentStyleSheet.href;
-    }
-    ruleValue.isUserAgent = parentStyleSheet && !parentStyleSheet.ownerNode && !parentStyleSheet.href;
-    ruleValue.isUser = parentStyleSheet && parentStyleSheet.ownerNode && parentStyleSheet.ownerNode.nodeName == "#document";
-    ruleValue.isViaInspector = !!rule.__isViaInspector;
-
-    // Bind editable scripts only.
-    var doBind = !ruleValue.isUserAgent && !ruleValue.isUser;
-    ruleValue.style = InjectedScript._serializeStyle(rule.style, doBind);
-
-    if (doBind) {
-        if (!rule.id) {
-            rule.id = InjectedScript._lastStyleRuleId++;
-            InjectedScript._styleRules[rule.id] = rule;
-        }
-        ruleValue.id = rule.id;
-        ruleValue.injectedScriptId = injectedScriptId;
-    }
-    return ruleValue;
-}
-
-InjectedScript._serializeStyle = function(style, doBind)
-{
-    var result = {};
-    result.width = style.width;
-    result.height = style.height;
-    result.__disabledProperties = style.__disabledProperties;
-    result.__disabledPropertyValues = style.__disabledPropertyValues;
-    result.__disabledPropertyPriorities = style.__disabledPropertyPriorities;
-    result.properties = [];
-    result.shorthandValues = {};
-    var foundShorthands = {};
-    for (var i = 0; i < style.length; ++i) {
-        var property = {};
-        var name = style[i];
-        property.name = name;
-        property.priority = style.getPropertyPriority(name);
-        property.implicit = style.isPropertyImplicit(name);
-        var shorthand =  style.getPropertyShorthand(name);
-        property.shorthand = shorthand;
-        if (shorthand && !(shorthand in foundShorthands)) {
-            foundShorthands[shorthand] = true;
-            result.shorthandValues[shorthand] = InjectedScript._getShorthandValue(style, shorthand);
-        }
-        property.value = style.getPropertyValue(name);
-        result.properties.push(property);
-    }
-    result.uniqueStyleProperties = InjectedScript._getUniqueStyleProperties(style);
-
-    if (doBind) {
-        if (!style.id) {
-            style.id = InjectedScript._lastStyleId++;
-            InjectedScript._styles[style.id] = style;
-        }
-        result.id = style.id;
-        result.injectedScriptId = injectedScriptId;
-    }
-    return result;
-}
-
-InjectedScript._getUniqueStyleProperties = function(style)
-{
-    var properties = [];
-    var foundProperties = {};
-
-    for (var i = 0; i < style.length; ++i) {
-        var property = style[i];
-        if (property in foundProperties)
-            continue;
-        foundProperties[property] = true;
-        properties.push(property);
-    }
-
-    return properties;
-}
-
-
-InjectedScript._getLonghandProperties = function(style, shorthandProperty)
-{
-    var properties = [];
-    var foundProperties = {};
-
-    for (var i = 0; i < style.length; ++i) {
-        var individualProperty = style[i];
-        if (individualProperty in foundProperties || style.getPropertyShorthand(individualProperty) !== shorthandProperty)
-            continue;
-        foundProperties[individualProperty] = true;
-        properties.push(individualProperty);
-    }
-
-    return properties;
-}
-
-InjectedScript._getShorthandValue = function(style, shorthandProperty)
-{
-    var value = style.getPropertyValue(shorthandProperty);
-    if (!value) {
-        // Some shorthands (like border) return a null value, so compute a shorthand value.
-        // FIXME: remove this when http://bugs.webkit.org/show_bug.cgi?id=15823 is fixed.
-
-        var foundProperties = {};
-        for (var i = 0; i < style.length; ++i) {
-            var individualProperty = style[i];
-            if (individualProperty in foundProperties || style.getPropertyShorthand(individualProperty) !== shorthandProperty)
-                continue;
-
-            var individualValue = style.getPropertyValue(individualProperty);
-            if (style.isPropertyImplicit(individualProperty) || individualValue === "initial")
-                continue;
-
-            foundProperties[individualProperty] = true;
-
-            if (!value)
-                value = "";
-            else if (value.length)
-                value += " ";
-            value += individualValue;
-        }
-    }
-    return value;
-}
-
-InjectedScript._getShorthandPriority = function(style, shorthandProperty)
-{
-    var priority = style.getPropertyPriority(shorthandProperty);
-    if (!priority) {
-        for (var i = 0; i < style.length; ++i) {
-            var individualProperty = style[i];
-            if (style.getPropertyShorthand(individualProperty) !== shorthandProperty)
-                continue;
-            priority = style.getPropertyPriority(individualProperty);
-            break;
-        }
-    }
-    return priority;
-}
-
 InjectedScript.getPrototypes = function(nodeId)
 {
     var node = InjectedScript._nodeForId(nodeId);
@@ -486,10 +125,32 @@
     if (!InjectedScript._isDefined(object))
         return false;
     var properties = [];
+    
     var propertyNames = ignoreHasOwnProperty ? InjectedScript._getPropertyNames(object) : Object.getOwnPropertyNames(object);
     if (!ignoreHasOwnProperty && object.__proto__)
         propertyNames.push("__proto__");
 
+    if (jsEngine === "v8") {
+        // Check if the object is a scope.
+        if (InjectedScript._isScopeProxy(objectProxy)) {
+            propertyNames = [];
+            for (var name in object)
+                propertyNames.push(name);
+        } else {
+            // FIXME(http://crbug.com/41243): Object.getOwnPropertyNames may return duplicated names.
+            var a = [];
+            propertyNames.sort();
+            var prev;
+            for (var i = 0; i < propertyNames.length; i++) {
+                var n = propertyNames[i];
+                if (n != prev)
+                    a.push(n);
+                prev = n;
+            }
+            propertyNames = a;
+        }
+    }
+    
     // Go over properties, prepare results.
     for (var i = 0; i < propertyNames.length; ++i) {
         var propertyName = propertyNames[i];
@@ -498,7 +159,7 @@
         property.name = propertyName + "";
         property.parentObjectProxy = objectProxy;
         var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
-        if (!property.isGetter) {
+        if (!isGetter) {
             try {
                 var childObject = object[propertyName];
                 var childObjectProxy = new InjectedScript.createProxyObject(childObject, objectProxy.objectId, abbreviate);
@@ -519,6 +180,12 @@
     return properties;
 }
 
+InjectedScript._isScopeProxy = function(objectProxy)
+{
+    var objectId = objectProxy.objectId;
+    return typeof objectId === "object" && !objectId.thisObject;
+} 
+
 InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression)
 {
     var object = InjectedScript._resolveObject(objectProxy);
@@ -538,13 +205,13 @@
         // There is a regression introduced here: eval is now happening against global object,
         // not call frame while on a breakpoint.
         // TODO: bring evaluation against call frame back.
-        var result = InjectedScript._window().eval("(" + expression + ")");
+        var result = inspectedWindow.eval("(" + expression + ")");
         // Store the result in the property.
         object[propertyName] = result;
         return true;
     } catch(e) {
         try {
-            var result = InjectedScript._window().eval("\"" + InjectedScript._escapeCharacters(expression, "\"") + "\"");
+            var result = inspectedWindow.eval("\"" + InjectedScript._escapeCharacters(expression, "\"") + "\"");
             object[propertyName] = result;
             return true;
         } catch(e) {
@@ -606,7 +273,7 @@
             if (!callFrame)
                 return props;
             if (expression)
-                expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression);
+                expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression, true);
             else {
                 // Evaluate into properties in scope of the selected call frame.
                 var scopeChain = callFrame.scopeChain;
@@ -616,12 +283,12 @@
         } else {
             if (!expression)
                 expression = "this";
-            expressionResult = InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression);
+            expressionResult = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression);
         }
         if (typeof expressionResult == "object")
             InjectedScript._populatePropertyNames(expressionResult, props);
         if (includeInspectorCommandLineAPI)
-            for (var prop in InjectedScript._window().console._inspectorCommandLineAPI)
+            for (var prop in inspectedWindow.console._inspectorCommandLineAPI)
                 if (prop.charAt(0) !== '_')
                     props[prop] = true;
     } catch(e) {
@@ -631,14 +298,14 @@
 
 InjectedScript.evaluate = function(expression, objectGroup)
 {
-    return InjectedScript._evaluateAndWrap(InjectedScript._window().eval, InjectedScript._window(), expression, objectGroup);
+    return InjectedScript._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup);
 }
 
-InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup)
+InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI)
 {
     var result = {};
     try {
-        result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression), objectGroup);
+        result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
 
         // Handle error that might have happened while describing result.
         if (result.value.errorText) {
@@ -652,12 +319,14 @@
     return result;
 }
 
-InjectedScript._evaluateOn = function(evalFunction, object, expression)
+InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
 {
     InjectedScript._ensureCommandLineAPIInstalled(evalFunction, object);
     // Surround the expression in with statements to inject our command line API so that
     // the window object properties still take more precedent than our API functions.
-    expression = "with (window.console._inspectorCommandLineAPI) { with (window) {\n" + expression + "\n} }";
+    if (!dontUseCommandLineAPI)
+        expression = "with (window.console._inspectorCommandLineAPI) { with (window) {\n" + expression + "\n} }";
+
     var value = evalFunction.call(object, expression);
 
     // When evaluating on call frame error is not thrown, but returned as a value.
@@ -673,15 +342,20 @@
     if (!node)
         return false;
 
-    InjectedScript._ensureCommandLineAPIInstalled(InjectedScript._window().eval, InjectedScript._window());
-    var inspectedNodes = InjectedScript._window().console._inspectorCommandLineAPI._inspectedNodes;
+    InjectedScript._ensureCommandLineAPIInstalled(inspectedWindow.eval, inspectedWindow);
+    var inspectedNodes = inspectedWindow.console._inspectorCommandLineAPI._inspectedNodes;
     inspectedNodes.unshift(node);
     if (inspectedNodes.length >= 5)
         inspectedNodes.pop();
     return true;
 }
 
-InjectedScript.performSearch = function(whitespaceTrimmedQuery)
+InjectedScript.getNodeId = function(node)
+{
+    return InjectedScriptHost.pushNodePathToFrontend(node, false, false);
+}
+
+InjectedScript.performSearch = function(whitespaceTrimmedQuery, runSynchronously)
 {
     // FIXME: Few things are missing here:
     // 1) Search works with node granularity - number of matches within node is not calculated.
@@ -830,7 +504,7 @@
             delete InjectedScript._searchResults[i][searchResultsProperty];
     }
 
-    const mainFrameDocument = InjectedScript._window().document;
+    const mainFrameDocument = inspectedWindow.document;
     const searchDocuments = [mainFrameDocument];
     var searchFunctions;
     if (tagNameQuery && startTagFound && endTagFound)
@@ -849,8 +523,7 @@
         searchFunctions = [matchExactItems, matchStyleSelector, matchPartialTagNamesAndAttributeValues, matchPlainText, matchXPathQuery];
 
     // Find all frames, iframes and object elements to search their documents.
-    const querySelectorAllFunction = InjectedScript._window().Document.prototype.querySelectorAll;
-    const subdocumentResult = querySelectorAllFunction.call(mainFrameDocument, "iframe, frame, object");
+    const subdocumentResult = mainFrameDocument.querySelectorAll("iframe, frame, object");
 
     for (var i = 0; i < subdocumentResult.length; ++i) {
         var element = subdocumentResult.item(i);
@@ -879,26 +552,27 @@
                     delete panel._currentSearchChunkIntervalIdentifier;
                 clearInterval(chunkIntervalIdentifier);
                 finishedSearching.call(panel);
-                return;
+                return false;
             }
 
             searchDocument = searchDocuments[documentIndex];
         }
 
-        if (!searchDocument || !searchFunction)
-            return;
-
         try {
             searchFunction.call(panel, searchDocument);
         } catch(err) {
             // ignore any exceptions. the query might be malformed, but we allow that.
         }
+        return true;
     }
 
-    processChunk();
-
-    chunkIntervalIdentifier = setInterval(processChunk, 25);
-    InjectedScript._currentSearchChunkIntervalIdentifier = chunkIntervalIdentifier;
+    if (runSynchronously)
+        while (processChunk()) {}
+    else {
+        processChunk();
+        chunkIntervalIdentifier = setInterval(processChunk, 25);
+        InjectedScript._currentSearchChunkIntervalIdentifier = chunkIntervalIdentifier;
+    }
     return true;
 }
 
@@ -926,7 +600,7 @@
 {
     // Don't call window.open on wrapper - popup blocker mutes it.
     // URIs should have no double quotes.
-    InjectedScript._window().eval("window.open(\"" + url + "\")");
+    inspectedWindow.eval("window.open(\"" + url + "\")");
     return true;
 }
 
@@ -950,7 +624,7 @@
     var callFrame = InjectedScript._callFrameForId(callFrameId);
     if (!callFrame)
         return false;
-    return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup);
+    return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
 }
 
 InjectedScript._callFrameForId = function(id)
@@ -1088,13 +762,6 @@
     return object;
 }
 
-InjectedScript._window = function()
-{
-    // TODO: replace with 'return window;' once this script is injected into
-    // the page's context.
-    return inspectedWindow;
-}
-
 InjectedScript._nodeForId = function(nodeId)
 {
     if (!nodeId)
@@ -1158,9 +825,10 @@
     return result;
 }
 
-InjectedScript.evaluateOnSelf = function(funcBody)
+InjectedScript.evaluateOnSelf = function(funcBody, args)
 {
-    return window.eval("(" + funcBody + ")();");
+    var func = window.eval("(" + funcBody + ")");
+    return func.apply(this, args || []);
 }
 
 InjectedScript.CallFrameProxy = function(id, callFrame)
@@ -1173,6 +841,59 @@
     this.scopeChain = this._wrapScopeChain(callFrame);
 }
 
+// FIXME(37663): unify scope chain representation and remove this if.
+if (jsEngine === "v8") {
+
+InjectedScript.CallFrameProxy.prototype = {
+    _wrapScopeChain: function(callFrame)
+    {
+        const GLOBAL_SCOPE = 0;
+        const LOCAL_SCOPE = 1;
+        const WITH_SCOPE = 2;
+        const CLOSURE_SCOPE = 3;
+        const CATCH_SCOPE = 4;
+    
+        var scopeChain = callFrame.scopeChain;
+        var scopeChainProxy = [];
+        for (var i = 0; i < scopeChain.length; i++) {
+            var scopeType = callFrame.scopeType(i);
+            var scopeObject = scopeChain[i];
+            var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
+
+            var foundLocalScope = false;
+            switch(scopeType) {
+                case LOCAL_SCOPE: {
+                    foundLocalScope = true;
+                    scopeObjectProxy.isLocal = true;
+                    scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
+                    break;
+                }
+                case CLOSURE_SCOPE: {
+                    scopeObjectProxy.isClosure = true;
+                    break;
+                }
+                case WITH_SCOPE:
+                case CATCH_SCOPE: {
+                    scopeObjectProxy.isWithBlock = true;
+                    break;
+                }
+            }
+
+            if (foundLocalScope) {
+                if (scopeObject instanceof inspectedWindow.Element)
+                    scopeObjectProxy.isElement = true;
+                else if (scopeObject instanceof inspectedWindow.Document)
+                    scopeObjectProxy.isDocument = true;
+            }
+ 
+            scopeChainProxy.push(scopeObjectProxy);
+        }
+        return scopeChainProxy;
+    }
+}
+
+} else {
+
 InjectedScript.CallFrameProxy.prototype = {
     _wrapScopeChain: function(callFrame)
     {
@@ -1190,9 +911,9 @@
                     scopeObjectProxy.isClosure = true;
                 foundLocalScope = true;
                 scopeObjectProxy.isLocal = true;
-            } else if (foundLocalScope && scopeObject instanceof InjectedScript._window().Element)
+            } else if (foundLocalScope && scopeObject instanceof inspectedWindow.Element)
                 scopeObjectProxy.isElement = true;
-            else if (foundLocalScope && scopeObject instanceof InjectedScript._window().Document)
+            else if (foundLocalScope && scopeObject instanceof inspectedWindow.Document)
                 scopeObjectProxy.isDocument = true;
             else if (!foundLocalScope)
                 scopeObjectProxy.isWithBlock = true;
@@ -1202,6 +923,8 @@
     }
 }
 
+}
+
 InjectedScript.executeSql = function(callId, databaseId, query)
 {
     function successCallback(tx, result)
@@ -1243,7 +966,13 @@
 
 InjectedScript._isDefined = function(object)
 {
-    return object || object instanceof inspectedWindow.HTMLAllCollection;
+    return object || InjectedScript._isHTMLAllCollection(object);
+}
+
+InjectedScript._isHTMLAllCollection = function(object)
+{
+    // document.all is reported as undefined, but we still want to process it.
+    return (typeof object === "undefined") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;
 }
 
 InjectedScript._type = function(obj)
@@ -1251,35 +980,38 @@
     if (obj === null)
         return "null";
 
-    // FIXME(33716): typeof document.all is always 'undefined'.
-    if (obj instanceof inspectedWindow.HTMLAllCollection)
-        return "array";
-
     var type = typeof obj;
-    if (type !== "object" && type !== "function")
+    if (type !== "object" && type !== "function") {
+        // FIXME(33716): typeof document.all is always 'undefined'.
+        if (InjectedScript._isHTMLAllCollection(obj))
+            return "array";
+        return type;
+    }
+
+    // If owning frame has navigated to somewhere else window properties will be undefined.
+    // In this case just return result of the typeof.
+    if (!inspectedWindow.document)
         return type;
 
-    var win = InjectedScript._window();
-
-    if (obj instanceof win.Node)
+    if (obj instanceof inspectedWindow.Node)
         return (obj.nodeType === undefined ? type : "node");
-    if (obj instanceof win.String)
+    if (obj instanceof inspectedWindow.String)
         return "string";
-    if (obj instanceof win.Array)
+    if (obj instanceof inspectedWindow.Array)
         return "array";
-    if (obj instanceof win.Boolean)
+    if (obj instanceof inspectedWindow.Boolean)
         return "boolean";
-    if (obj instanceof win.Number)
+    if (obj instanceof inspectedWindow.Number)
         return "number";
-    if (obj instanceof win.Date)
+    if (obj instanceof inspectedWindow.Date)
         return "date";
-    if (obj instanceof win.RegExp)
+    if (obj instanceof inspectedWindow.RegExp)
         return "regexp";
-    if (obj instanceof win.NodeList)
+    if (obj instanceof inspectedWindow.NodeList)
         return "array";
-    if (obj instanceof win.HTMLCollection || obj instanceof win.HTMLAllCollection)
+    if (obj instanceof inspectedWindow.HTMLCollection)
         return "array";
-    if (obj instanceof win.Error)
+    if (obj instanceof inspectedWindow.Error)
         return "error";
     return type;
 }
@@ -1301,20 +1033,27 @@
             return "\"" + obj.substring(0, 100) + "\u2026\"";
         return "\"" + obj + "\"";
     case "function":
-        var objectText = String(obj);
+        var objectText = InjectedScript._toString(obj);
         if (!/^function /.test(objectText))
             objectText = (type2 == "object") ? type1 : type2;
         else if (abbreviated)
             objectText = /.*/.exec(obj)[0].replace(/ +$/g, "");
         return objectText;
     default:
-        return String(obj);
+        return InjectedScript._toString(obj);
     }
 }
 
+InjectedScript._toString = function(obj)
+{
+    // We don't use String(obj) because inspectedWindow.String is undefined if owning frame navigated to another page.
+    return "" + obj;
+}
+
 InjectedScript._className = function(obj)
 {
-    return Object.prototype.toString.call(obj).replace(/^\[object (.*)\]$/i, "$1")
+    var str = inspectedWindow.Object ? inspectedWindow.Object.prototype.toString.call(obj) : InjectedScript._toString(obj);
+    return str.replace(/^\[object (.*)\]$/i, "$1");
 }
 
 InjectedScript._escapeCharacters = function(str, chars)
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index ed03f73..4670af1 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -34,9 +34,6 @@
 {
     this._searchingForNode = false;
     this._attachedWindowHeight = 0;
-    this._debuggerEnabled = true;
-    this._profilerEnabled = true;
-    this._resourceTrackingEnabled = false;
     this._timelineEnabled = false;
 }
 
@@ -126,39 +123,42 @@
         return "";
     },
 
-    debuggerEnabled: function()
-    {
-        return this._debuggerEnabled;
-    },
-
     enableResourceTracking: function()
     {
-        this._resourceTrackingEnabled = true;
         WebInspector.resourceTrackingWasEnabled();
     },
 
     disableResourceTracking: function()
     {
-        this._resourceTrackingEnabled = false;
         WebInspector.resourceTrackingWasDisabled();
     },
 
-    resourceTrackingEnabled: function()
+
+    enableSearchingForNode: function()
     {
-        return this._resourceTrackingEnabled;
+        WebInspector.searchingForNodeWasEnabled();
+    },
+
+    disableSearchingForNode: function()
+    {
+        WebInspector.searchingForNodeWasDisabled();
+    },
+
+    reloadPage: function()
+    {
     },
 
     enableDebugger: function()
     {
-        this._debuggerEnabled = true;
+        WebInspector.debuggerWasEnabled();
     },
 
     disableDebugger: function()
     {
-        this._debuggerEnabled = false;
+        WebInspector.debuggerWasDisabled();
     },
 
-    addBreakpoint: function(sourceID, line, condition)
+    setBreakpoint: function(sourceID, line, enabled, condition)
     {
     },
 
@@ -166,40 +166,37 @@
     {
     },
 
-    updateBreakpoint: function(sourceID, line, condition)
+    activateBreakpoints: function()
     {
+        this._breakpointsActivated = true;
+    },
+
+    deactivateBreakpoints: function()
+    {
+        this._breakpointsActivated = false;
     },
 
     pauseInDebugger: function()
     {
     },
 
-    pauseOnExceptionsState: function()
-    {
-        return 0;
-    },
-
     setPauseOnExceptionsState: function(value)
     {
+        WebInspector.updatePauseOnExceptionsState(value);
     },
 
     resumeDebugger: function()
     {
     },
 
-    profilerEnabled: function()
-    {
-        return true;
-    },
-
     enableProfiler: function()
     {
-        this._profilerEnabled = true;
+        WebInspector.profilerWasEnabled();
     },
 
     disableProfiler: function()
     {
-        this._profilerEnabled = false;
+        WebInspector.profilerWasDisabled();
     },
 
     startProfiling: function()
@@ -217,10 +214,6 @@
 
     getProfile: function(callId, uid)
     {
-        if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))
-        {
-            WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);
-        }
     },
 
     takeHeapSnapshot: function()
@@ -258,6 +251,14 @@
 
     setInjectedScriptSource: function()
     {
+    },
+    
+    addScriptToEvaluateOnLoad: function()
+    {
+    },
+
+    removeAllScriptsToEvaluateOnLoad: function()
+    {
     }
 }
 
diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
index f1decb6..5456069 100644
--- a/WebCore/inspector/front-end/InspectorFrontendHostStub.js
+++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -48,6 +48,11 @@
         return "unknown";
     },
 
+    bringToFront: function()
+    {
+        this._windowVisible = true;
+    },
+
     closeWindow: function()
     {
         this._windowVisible = false;
@@ -87,12 +92,17 @@
         return "";
     },
 
-    windowUnloading: function()
+    inspectedURLChanged: function(url)
     {
     },
 
     copyText: function()
     {
+    },
+
+    canAttachWindow: function()
+    {
+        return false;
     }
 }
 
diff --git a/WebCore/inspector/front-end/MetricsSidebarPane.js b/WebCore/inspector/front-end/MetricsSidebarPane.js
index 767da1f..ed5a7ec 100644
--- a/WebCore/inspector/front-end/MetricsSidebarPane.js
+++ b/WebCore/inspector/front-end/MetricsSidebarPane.js
@@ -30,7 +30,6 @@
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics"));
     this._inlineStyleId = null;
-    this._inlineStyleInjectedScriptId = null;
 }
 
 WebInspector.MetricsSidebarPane.prototype = {
@@ -53,15 +52,14 @@
             var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload);
             self._update(style);
         };
-        InjectedScriptAccess.get(node.injectedScriptId).getComputedStyle(node.id, callback);
+        InspectorBackend.getComputedStyle(WebInspector.Callback.wrap(callback), node.id);
 
         var inlineStyleCallback = function(stylePayload) {
             if (!stylePayload)
                 return;
             self._inlineStyleId = stylePayload.id;
-            self._inlineStyleInjectedScriptId = stylePayload.injectedScriptId;
         };
-        InjectedScriptAccess.get(node.injectedScriptId).getInlineStyle(node.id, inlineStyleCallback);
+        InspectorBackend.getInlineStyle(WebInspector.Callback.wrap(inlineStyleCallback), node.id);
     },
 
     _update: function(style)
@@ -187,6 +185,11 @@
 
     editingCommitted: function(element, userInput, previousContent, context)
     {
+        if (!this._inlineStyleId) {
+            // Element has no renderer.
+            return this.editingCancelled(element, context); // nothing changed, so cancel
+        }
+
         if (userInput === previousContent)
             return this.editingCancelled(element, context); // nothing changed, so cancel
 
@@ -206,7 +209,8 @@
             self.dispatchEventToListeners("metrics edited");
             self.update();
         };
-        InjectedScriptAccess.get(this._inlineStyleInjectedScriptId).setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback);
+
+        InspectorBackend.setStyleProperty(WebInspector.Callback.wrap(callback), this._inlineStyleId, context.styleProperty, userInput);
     }
 }
 
diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js
index 5b01191..b916708 100644
--- a/WebCore/inspector/front-end/Panel.js
+++ b/WebCore/inspector/front-end/Panel.js
@@ -373,12 +373,12 @@
             visibleView.resize();
     },
 
-    canShowSourceLineForURL: function(url)
+    canShowSourceLine: function(url, line)
     {
         return false;
     },
 
-    showSourceLineForURL: function(url, line)
+    showSourceLine: function(url, line)
     {
         return false;
     },
diff --git a/WebCore/inspector/front-end/Popover.js b/WebCore/inspector/front-end/Popover.js
index 70e4ac9..848c99e 100644
--- a/WebCore/inspector/front-end/Popover.js
+++ b/WebCore/inspector/front-end/Popover.js
@@ -38,6 +38,8 @@
     this.element.appendChild(this._popupArrowElement);
 
     this.contentElement = contentElement;
+    this._contentDiv = document.createElement("div");
+    this._contentDiv.className = "content";
 }
 
 WebInspector.Popover.prototype = {
@@ -54,25 +56,28 @@
         var preferredWidth = preferredWidth || this.contentElement.offsetWidth;
         var preferredHeight = preferredHeight || this.contentElement.offsetHeight;
 
-        this.contentElement.addStyleClass("content");
-        this.element.appendChild(this.contentElement);
+        this._contentDiv.appendChild(this.contentElement);
+        this.element.appendChild(this._contentDiv);
         document.body.appendChild(this.element);
         this._positionElement(anchor, preferredWidth, preferredHeight);
     },
 
     hide: function()
     {
-        delete WebInspector.Popover._popoverElement;
-        document.body.removeChild(this.element);
+        if (WebInspector.Popover._popoverElement) {
+            delete WebInspector.Popover._popoverElement;
+            document.body.removeChild(this.element);
+        }
     },
 
     _positionElement: function(anchorElement, preferredWidth, preferredHeight)
     {
         const borderWidth = 25;
         const scrollerWidth = 11;
-        const arrowHeight = 10;
-        const arrowOffset = 15;
-        
+        const arrowHeight = 15;
+        const arrowOffset = 10;
+        const borderRadius = 10;
+
         // Skinny tooltips are not pretty, their arrow location is not nice.
         preferredWidth = Math.max(preferredWidth, 50);
         const totalWidth = window.innerWidth;
@@ -87,7 +92,7 @@
             anchorElement = anchorElement.parentElement;
         }
 
-        var newElementPosition = { x: 0, y: 0, width: preferredWidth + borderWidth * 2, height: preferredHeight + borderWidth * 2 };
+        var newElementPosition = { x: 0, y: 0, width: preferredWidth + scrollerWidth, height: preferredHeight };
 
         var verticalAlignment;
         var roomAbove = anchorBox.y;
@@ -95,53 +100,140 @@
 
         if (roomAbove > roomBelow) {
             // Positioning above the anchor.
-            if (anchorBox.y > newElementPosition.height)
-                newElementPosition.y = anchorBox.y - newElementPosition.height;
+            if (anchorBox.y > newElementPosition.height + arrowHeight + borderRadius)
+                newElementPosition.y = anchorBox.y - newElementPosition.height - arrowHeight;
             else {
-                newElementPosition.y = 0;
-                newElementPosition.height = anchorBox.y - newElementPosition.y;
-                // Reserve room for vertical scroller anyways.
-                newElementPosition.width += scrollerWidth;
+                newElementPosition.y = borderRadius * 2;
+                newElementPosition.height = anchorBox.y - borderRadius * 2 - arrowHeight;
             }
             verticalAlignment = "bottom";
         } else {
             // Positioning below the anchor.
-            newElementPosition.y = anchorBox.y + anchorBox.height;
-            if (newElementPosition.y + newElementPosition.height >= totalHeight) {
-                newElementPosition.height = totalHeight - anchorBox.y - anchorBox.height;
-                // Reserve room for vertical scroller.
-                newElementPosition.width += scrollerWidth;
-            }
+            newElementPosition.y = anchorBox.y + anchorBox.height + arrowHeight;
+            if (newElementPosition.y + newElementPosition.height + arrowHeight - borderWidth >= totalHeight)
+                newElementPosition.height = totalHeight - anchorBox.y - anchorBox.height - borderRadius * 2 - arrowHeight;
             // Align arrow.
-            newElementPosition.y -= arrowHeight;
             verticalAlignment = "top";
         }
 
         var horizontalAlignment;
         if (anchorBox.x + newElementPosition.width < totalWidth) {
-            newElementPosition.x = Math.max(0, anchorBox.x) - borderWidth - arrowOffset;
+            newElementPosition.x = Math.max(borderRadius, anchorBox.x - borderRadius - arrowOffset);
             horizontalAlignment = "left";
-        } else if (newElementPosition.width < totalWidth) {
-            newElementPosition.x = totalWidth - newElementPosition.width;
+        } else if (newElementPosition.width + borderRadius * 2 < totalWidth) {
+            newElementPosition.x = totalWidth - newElementPosition.width - borderRadius;
             horizontalAlignment = "right";
             // Position arrow accurately.
-            this._popupArrowElement.style.right = totalWidth - anchorBox.x - borderWidth - anchorBox.width + "px";
+            var arrowRightPosition = Math.max(0, totalWidth - anchorBox.x - anchorBox.width - borderRadius - arrowOffset);
+            arrowRightPosition += anchorBox.width / 2;
+            this._popupArrowElement.style.right = arrowRightPosition + "px";
         } else {
-            newElementPosition.x = 0;
-            newElementPosition.width = totalWidth;
+            newElementPosition.x = borderRadius;
+            newElementPosition.width = totalWidth - borderRadius * 2;
+            newElementPosition.height += scrollerWidth;
             horizontalAlignment = "left";
             if (verticalAlignment === "bottom")
                 newElementPosition.y -= scrollerWidth;
             // Position arrow accurately.
-            this._popupArrowElement.style.left = anchorBox.x - borderWidth + "px";
+            this._popupArrowElement.style.left = Math.max(0, anchorBox.x - borderRadius * 2 - arrowOffset) + "px";
+            this._popupArrowElement.style.left += anchorBox.width / 2;
         }
 
-        // Reserve room for horizontal scroller.
-        newElementPosition.height += scrollerWidth;
-
         this.element.className = "popover " + verticalAlignment + "-" + horizontalAlignment + "-arrow";
-        this.element.positionAt(newElementPosition.x, newElementPosition.y);
-        this.element.style.width = newElementPosition.width  + "px";
-        this.element.style.height = newElementPosition.height  + "px";
+        this.element.positionAt(newElementPosition.x - borderWidth, newElementPosition.y - borderWidth);
+        this.element.style.width = newElementPosition.width + borderWidth * 2 + "px";
+        this.element.style.height = newElementPosition.height + borderWidth * 2 + "px";
+    }
+}
+
+WebInspector.PopoverHelper = function(panelElement, getAnchor, showPopup, showOnClick, onHide)
+{
+    this._panelElement = panelElement;
+    this._getAnchor = getAnchor;
+    this._showPopup = showPopup;
+    this._showOnClick = showOnClick;
+    this._onHide = onHide;
+    panelElement.addEventListener("mousedown", this._mouseDown.bind(this), false);
+    panelElement.addEventListener("mousemove", this._mouseMove.bind(this), false);
+}
+
+WebInspector.PopoverHelper.prototype = {
+    _mouseDown: function(event)
+    {
+        this._killHidePopupTimer();
+        this._handleMouseAction(event, true);
+    },
+
+    _mouseMove: function(event)
+    {
+        // Pretend that nothing has happened.
+        if (this._hoverElement === event.target || (this._hoverElement && this._hoverElement.isAncestor(event.target)))
+            return;
+
+        // User has 500ms to reach the popup.
+        if (this._popup && !this._hidePopupTimer) {
+            var self = this;
+            function doHide()
+            {
+                self.hidePopup();
+                delete self._hidePopupTimer;
+            }
+            this._hidePopupTimer = setTimeout(doHide, 500);
+        }
+
+        this._handleMouseAction(event);
+    },
+
+    _handleMouseAction: function(event, isMouseDown)
+    {
+        this._resetHoverTimer();
+
+        this._hoverElement = this._getAnchor(event.target);
+        if (!this._hoverElement)
+            return;
+
+        const toolTipDelay = isMouseDown ? 0 : (this._popup ? 600 : 1000);
+        this._hoverTimer = setTimeout(this._mouseHover.bind(this, this._hoverElement), toolTipDelay);
+    },
+
+    _resetHoverTimer: function()
+    {
+        if (this._hoverTimer) {
+            clearTimeout(this._hoverTimer);
+            delete this._hoverTimer;
+        }
+    },
+
+    hidePopup: function()
+    {
+        if (!this._popup)
+            return;
+
+        if (this._onHide)
+            this._onHide();
+
+        this._popup.hide();
+        delete this._popup;
+    },
+
+    _mouseHover: function(element)
+    {
+        delete this._hoverTimer;
+
+        this._popup = this._showPopup(element);
+        if (this._popup)
+            this._popup.contentElement.addEventListener("mousemove", this._killHidePopupTimer.bind(this), true);
+    },
+
+    _killHidePopupTimer: function()
+    {
+        if (this._hidePopupTimer) {
+            clearTimeout(this._hidePopupTimer);
+            delete this._hidePopupTimer;
+
+            // We know that we reached the popup, but we might have moved over other elements.
+            // Discard pending command.
+            this._resetHoverTimer();
+        }
     }
 }
diff --git a/WebCore/inspector/front-end/ProfileView.js b/WebCore/inspector/front-end/ProfileView.js
index 1efa0dc..817f1f5 100644
--- a/WebCore/inspector/front-end/ProfileView.js
+++ b/WebCore/inspector/front-end/ProfileView.js
@@ -83,7 +83,7 @@
     var self = this;
     function profileCallback(profile)
     {
-        self.profile = profile;
+        self.profile.head = profile.head;
         self._assignParentsInProfile();
       
         self.profileDataGridTree = self.bottomUpProfileDataGridTree;
@@ -601,7 +601,7 @@
 
     get welcomeMessage()
     {
-        return WebInspector.UIString("Start CPU profiling by pressing<br>the %s button on the status bar.");
+        return WebInspector.UIString("Control CPU profiling by pressing the %s button on the status bar.");
     },
 
     setRecordingProfile: function(isProfiling)
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index dd049a1..2f9d38d 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -120,6 +120,7 @@
     this.element.appendChild(this.welcomeView.element);
 
     this._profiles = [];
+    this._profilerEnabled = Preferences.profilerAlwaysEnabled;
     this.reset();
 }
 
@@ -163,6 +164,7 @@
 
     populateInterface: function()
     {
+        this.reset();
         if (this.visible)
             this._populateProfiles();
         else
@@ -171,12 +173,19 @@
 
     profilerWasEnabled: function()
     {
-        this.reset();
+        if (this._profilerEnabled)
+            return;
+
+        this._profilerEnabled = true;
         this.populateInterface();
     },
 
     profilerWasDisabled: function()
     {
+        if (!this._profilerEnabled)
+            return;
+
+        this._profilerEnabled = false;
         this.reset();
     },
 
@@ -230,7 +239,6 @@
             container.appendChild(part1);
      
             var button = new WebInspector.StatusBarButton(profileType.buttonTooltip, profileType.buttonStyle, profileType.buttonCaption);
-            button.element.addEventListener("click", profileType.buttonClicked.bind(profileType), false);
             container.appendChild(button.element);
        
             var part2 = document.createElement("span");
@@ -429,7 +437,7 @@
     _updateInterface: function()
     {
         // FIXME: Replace ProfileType-specific button visibility changes by a single ProfileType-agnostic "combo-button" visibility change.
-        if (InspectorBackend.profilerEnabled()) {
+        if (this._profilerEnabled) {
             this.enableToggleButton.title = WebInspector.UIString("Profiling enabled. Click to disable.");
             this.enableToggleButton.toggled = true;
             for (var typeId in this._profileTypeButtonsByIdMap)
@@ -448,14 +456,14 @@
 
     _enableProfiling: function()
     {
-        if (InspectorBackend.profilerEnabled())
+        if (this._profilerEnabled)
             return;
         this._toggleProfiling(this.panelEnablerView.alwaysEnabled);
     },
 
     _toggleProfiling: function(optionalAlways)
     {
-        if (InspectorBackend.profilerEnabled())
+        if (this._profilerEnabled)
             InspectorBackend.disableProfiler(true);
         else
             InspectorBackend.enableProfiler(!!optionalAlways);
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index 9860300..4ee5f28 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -272,22 +272,28 @@
         return this._responseReceivedTime - this._startTime;
     },
 
-    get contentLength()
+    get resourceSize()
     {
-        return this._contentLength || 0;
+        return this._resourceSize || 0;
     },
 
-    set contentLength(x)
+    set resourceSize(x)
     {
-        if (this._contentLength === x)
+        if (this._resourceSize === x)
             return;
 
-        this._contentLength = x;
+        this._resourceSize = x;
 
         if (WebInspector.panels.resources)
             WebInspector.panels.resources.refreshResource(this);
     },
 
+    get transferSize()
+    {
+        // FIXME: this is wrong for chunked-encoding resources.
+        return this.cached ? 0 : Number(this.responseHeaders["Content-Length"] || this.resourceSize || 0);
+    },
+
     get expectedContentLength()
     {
         return this._expectedContentLength || 0;
@@ -603,9 +609,15 @@
 
 WebInspector.Resource.CompareBySize = function(a, b)
 {
-    return a.contentLength - b.contentLength;
+    return a.resourceSize - b.resourceSize;
 }
 
+WebInspector.Resource.CompareByTransferSize = function(a, b)
+{
+    return a.transferSize - b.transferSize;
+}
+
+
 WebInspector.Resource.StatusTextForCode = function(code)
 {
     return code ? code + " " + WebInspector.Resource.StatusText[code] : "";
diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js
index b7b01ac..618a935 100644
--- a/WebCore/inspector/front-end/ResourceView.js
+++ b/WebCore/inspector/front-end/ResourceView.js
@@ -47,7 +47,7 @@
     this.tabsElement.appendChild(this.contentTabElement);
 
     this.headersTabElement.addEventListener("click", this._selectHeadersTab.bind(this), false);
-    this.contentTabElement.addEventListener("click", this._selectContentTab.bind(this), false);
+    this.contentTabElement.addEventListener("click", this.selectContentTab.bind(this), false);
 
     this.headersElement = document.createElement("div");
     this.headersElement.className = "resource-view-headers";
@@ -155,7 +155,7 @@
             if (WebInspector.settings.resourceViewTab === "headers")
                 this._selectHeadersTab();
             else
-                this._selectContentTab();
+                this.selectContentTab();
         } else
             this._innerSelectContentTab();
     },
@@ -169,7 +169,7 @@
         this.contentElement.addStyleClass("hidden");
     },
 
-    _selectContentTab: function()
+    selectContentTab: function()
     {
         WebInspector.settings.resourceViewTab = "content";
         this._innerSelectContentTab();
@@ -183,8 +183,17 @@
         this.headersElement.addStyleClass("hidden");
         if ("resize" in this)
             this.resize();
-        if ("contentTabSelected" in this)
-            this.contentTabSelected();
+        this.contentTabSelected();
+    },
+
+    contentTabSelected: function()
+    {
+        if (!this._contentPlaceholderElement) {
+            this._contentPlaceholderElement = document.createElement("div");
+            this._contentPlaceholderElement.className = "resource-content-unavailable";
+            this._contentPlaceholderElement.textContent = WebInspector.UIString("No Content Available");
+            this.contentElement.appendChild(this._contentPlaceholderElement);
+        }
     },
 
     _refreshURL: function()
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 19325bb..5284e68 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -47,6 +47,7 @@
     this.reset();
     this.filter(this.filterAllElement, false);
     this.graphsTreeElement.children[0].select();
+    this._resourceTrackingEnabled = false;
 }
 
 WebInspector.ResourcesPanel.prototype = {
@@ -98,6 +99,7 @@
             { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator },
         ];
 
+        timeGraphItem.isBarOpaqueAtLeft = false;
         timeGraphItem.selectedSortingOptionIndex = 1;
 
         var sizeGraphItem = new WebInspector.SidebarTreeElement("resources-size-graph-sidebar-item", WebInspector.UIString("Size"));
@@ -105,9 +107,11 @@
 
         var transferSizeCalculator = new WebInspector.ResourceTransferSizeCalculator();
         sizeGraphItem.sortingOptions = [
+            { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator },
             { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator },
         ];
 
+        sizeGraphItem.isBarOpaqueAtLeft = true;
         sizeGraphItem.selectedSortingOptionIndex = 0;
 
         this.graphsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("GRAPHS"), {}, true);
@@ -123,6 +127,11 @@
         this.itemsTreeElement.expand();
     },
 
+    get resourceTrackingEnabled()
+    {
+        return this._resourceTrackingEnabled;
+    },
+
     _createPanelEnabler: function()
     {
         var panelEnablerHeading = WebInspector.UIString("You need to enable resource tracking to use this panel.");
@@ -279,7 +288,7 @@
     {
         if (this.visibleResource)
             return this.visibleResource._resourcesView;
-        return InspectorBackend.resourceTrackingEnabled() ? null : this.panelEnablerView;
+        return this._resourceTrackingEnabled ? null : this.panelEnablerView;
     },
 
     get sortingFunction()
@@ -308,11 +317,13 @@
 
     resourceTrackingWasEnabled: function()
     {
+        this._resourceTrackingEnabled = true;
         this.reset();
     },
 
     resourceTrackingWasDisabled: function()
     {
+        this._resourceTrackingEnabled = false;
         this.reset();
     },
 
@@ -344,7 +355,7 @@
 
         this.summaryBar.reset();
 
-        if (InspectorBackend.resourceTrackingEnabled()) {
+        if (this._resourceTrackingEnabled) {
             this.enableToggleButton.title = WebInspector.UIString("Resource tracking enabled. Click to disable.");
             this.enableToggleButton.toggled = true;
             this.largerResourcesButton.visible = true;
@@ -450,14 +461,16 @@
 
         if (oldViewParentNode)
             newView.show(oldViewParentNode);
+
+        WebInspector.panels.scripts.viewRecreated(oldView, newView);
     },
 
-    canShowSourceLineForURL: function(url)
+    canShowSourceLine: function(url, line)
     {
-        return !!WebInspector.resourceForURL(url);
+        return this._resourceTrackingEnabled && !!WebInspector.resourceForURL(url);
     },
 
-    showSourceLineForURL: function(url, line)
+    showSourceLine: function(url, line)
     {
         this.showResource(WebInspector.resourceForURL(url), line);
     },
@@ -477,6 +490,7 @@
         view.show(this.viewsContainerElement);
 
         if (line) {
+            view.selectContentTab();
             if (view.revealLine)
                 view.revealLine(line);
             if (view.highlightLine)
@@ -564,7 +578,7 @@
             var percent = this.calculator.computePercentageFromEventTime(this.mainResourceLoadTime);
 
             var loadDivider = document.createElement("div");
-            loadDivider.className = "resources-onload-divider";
+            loadDivider.className = "resources-event-divider resources-red-divider";
 
             var loadDividerPadding = document.createElement("div");
             loadDividerPadding.className = "resources-event-divider-padding";
@@ -579,7 +593,7 @@
             var percent = this.calculator.computePercentageFromEventTime(this.mainResourceDOMContentTime);
 
             var domContentDivider = document.createElement("div");
-            domContentDivider.className = "resources-ondomcontent-divider";
+            domContentDivider.className = "resources-event-divider resources-blue-divider";
             
             var domContentDividerPadding = document.createElement("div");
             domContentDividerPadding.className = "resources-event-divider-padding";
@@ -685,16 +699,18 @@
 
     _enableResourceTracking: function()
     {
-        if (InspectorBackend.resourceTrackingEnabled())
+        if (this._resourceTrackingEnabled)
             return;
         this._toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
     },
 
     _toggleResourceTracking: function(optionalAlways)
     {
-        if (InspectorBackend.resourceTrackingEnabled()) {
+        if (this._resourceTrackingEnabled) {
             this.largerResourcesButton.visible = false;
             this.sortingSelectElement.visible = false;
+            WebInspector.resources = {};
+            WebInspector.resourceURLMap = {};
             InspectorBackend.disableResourceTracking(true);
         } else {
             this.largerResourcesButton.visible = true;
@@ -824,18 +840,20 @@
 
     computeBarGraphLabels: function(resource)
     {
-        var leftLabel = "";
-        if (resource.latency > 0)
-            leftLabel = this.formatValue(resource.latency);
-
         var rightLabel = "";
         if (resource.responseReceivedTime !== -1 && resource.endTime !== -1)
             rightLabel = this.formatValue(resource.endTime - resource.responseReceivedTime);
 
-        if (leftLabel && rightLabel) {
+        var hasLatency = resource.latency > 0;
+        if (hasLatency)
+            var leftLabel = this.formatValue(resource.latency);
+        else
+            var leftLabel = rightLabel;
+
+        if (hasLatency && rightLabel) {
             var total = this.formatValue(resource.duration);
             var tooltip = WebInspector.UIString("%s latency, %s download (%s total)", leftLabel, rightLabel, total);
-        } else if (leftLabel)
+        } else if (hasLatency)
             var tooltip = WebInspector.UIString("%s latency", leftLabel);
         else if (rightLabel)
             var tooltip = WebInspector.UIString("%s download", rightLabel);
@@ -939,16 +957,39 @@
 WebInspector.ResourceTransferSizeCalculator.prototype = {
     computeBarGraphLabels: function(resource)
     {
-        const label = this.formatValue(this._value(resource));
-        var tooltip = label;
+        var networkBytes = this._networkBytes(resource);
+        var resourceBytes = this._value(resource);
+        if (networkBytes && networkBytes !== resourceBytes) {
+            // Transferred size is not the same as reported resource length.
+            var networkBytesString = this.formatValue(networkBytes);
+            var left = networkBytesString;
+            var right = this.formatValue(resourceBytes);
+            var tooltip = right ? WebInspector.UIString("%s (%s transferred)", right, networkBytesString) : right;
+        } else {
+            var left = this.formatValue(resourceBytes);
+            var right = left;
+            var tooltip = left;
+        }
         if (resource.cached)
             tooltip = WebInspector.UIString("%s (from cache)", tooltip);
-        return {left: label, right: label, tooltip: tooltip};
+        return {left: left, right: right, tooltip: tooltip};
+    },
+
+    computeBarGraphPercentages: function(item)
+    {
+        const resourceBytesAsPercent = (this._value(item) / this.boundarySpan) * 100;
+        const networkBytesAsPercent = this._networkBytes(item) ? (this._networkBytes(item) / this.boundarySpan) * 100 : resourceBytesAsPercent;
+        return {start: 0, middle: networkBytesAsPercent, end: resourceBytesAsPercent};
     },
 
     _value: function(resource)
     {
-        return resource.contentLength;
+        return resource.resourceSize;
+    },
+
+    _networkBytes: function(resource)
+    {
+        return resource.transferSize;
     },
 
     formatValue: function(value)
@@ -1139,6 +1180,11 @@
     return -1 * WebInspector.Resource.CompareBySize(a.resource, b.resource);
 }
 
+WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize = function(a, b)
+{
+    return -1 * WebInspector.Resource.CompareByTransferSize(a.resource, b.resource);
+}
+
 WebInspector.ResourceSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
 
 WebInspector.ResourceGraph = function(resource)
@@ -1196,8 +1242,15 @@
         const labelPadding = 10;
         const barRightElementOffsetWidth = this._barRightElement.offsetWidth;
         const barLeftElementOffsetWidth = this._barLeftElement.offsetWidth;
-        const rightBarWidth = (barRightElementOffsetWidth - labelPadding);
-        const leftBarWidth = ((barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding);
+
+        if (this._isBarOpaqueAtLeft) {
+            var leftBarWidth = barLeftElementOffsetWidth - labelPadding;
+            var rightBarWidth = (barRightElementOffsetWidth - barLeftElementOffsetWidth) - labelPadding;
+        } else {
+            var leftBarWidth = (barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding;
+            var rightBarWidth = barRightElementOffsetWidth - labelPadding;
+        }
+
         const labelLeftElementOffsetWidth = this._labelLeftElement.offsetWidth;
         const labelRightElementOffsetWidth = this._labelRightElement.offsetWidth;
 
@@ -1205,8 +1258,22 @@
         const labelAfter = (labelRightElementOffsetWidth > rightBarWidth);
         const graphElementOffsetWidth = this._graphElement.offsetWidth;
 
+        if (labelBefore && (graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10))
+            var leftHidden = true;
+
+        if (labelAfter && (graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10))
+            var rightHidden = true;
+
+        if (barLeftElementOffsetWidth == barRightElementOffsetWidth) {
+            // The left/right label data are the same, so a before/after label can be replaced by an on-bar label.
+            if (labelBefore && !labelAfter)
+                leftHidden = true;
+            else if (labelAfter && !labelBefore)
+                rightHidden = true;
+        }
+
         if (labelBefore) {
-            if ((graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10))
+            if (leftHidden)
                 this._labelLeftElement.addStyleClass("hidden");
             this._labelLeftElement.style.setProperty("right", (100 - this._percentages.start) + "%");
             this._labelLeftElement.addStyleClass("before");
@@ -1216,7 +1283,7 @@
         }
 
         if (labelAfter) {
-            if ((graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10))
+            if (rightHidden)
                 this._labelRightElement.addStyleClass("hidden");
             this._labelRightElement.style.setProperty("left", this._percentages.end + "%");
             this._labelRightElement.addStyleClass("after");
@@ -1226,7 +1293,7 @@
         }
     },
 
-    refresh: function(calculator)
+    refresh: function(calculator, isBarOpaqueAtLeft)
     {
         var percentages = calculator.computeBarGraphPercentages(this.resource);
         var labels = calculator.computeBarGraphLabels(this.resource);
@@ -1241,11 +1308,32 @@
         }
 
         this._barLeftElement.style.setProperty("left", percentages.start + "%");
-        this._barLeftElement.style.setProperty("right", (100 - percentages.end) + "%");
-
-        this._barRightElement.style.setProperty("left", percentages.middle + "%");
         this._barRightElement.style.setProperty("right", (100 - percentages.end) + "%");
 
+        if (!isBarOpaqueAtLeft) {
+            this._barLeftElement.style.setProperty("right", (100 - percentages.end) + "%");
+            this._barRightElement.style.setProperty("left", percentages.middle + "%");
+
+            if (this._isBarOpaqueAtLeft != isBarOpaqueAtLeft) {
+                this._barLeftElement.addStyleClass("waiting");
+                this._barRightElement.removeStyleClass("waiting-right");
+                this._labelLeftElement.addStyleClass("waiting");
+                this._labelRightElement.removeStyleClass("waiting-right");
+            }
+        } else {
+            this._barLeftElement.style.setProperty("right", (100 - percentages.middle) + "%");
+            this._barRightElement.style.setProperty("left", percentages.start + "%");
+
+            if (this._isBarOpaqueAtLeft != isBarOpaqueAtLeft) {
+                this._barLeftElement.removeStyleClass("waiting");
+                this._barRightElement.addStyleClass("waiting-right");
+                this._labelLeftElement.removeStyleClass("waiting");
+                this._labelRightElement.addStyleClass("waiting-right");
+            }
+        }
+
+        this._isBarOpaqueAtLeft = isBarOpaqueAtLeft;
+
         this._labelLeftElement.textContent = labels.left;
         this._labelRightElement.textContent = labels.right;
 
diff --git a/WebCore/inspector/front-end/Script.js b/WebCore/inspector/front-end/Script.js
index e6413a9..79004f3 100644
--- a/WebCore/inspector/front-end/Script.js
+++ b/WebCore/inspector/front-end/Script.js
@@ -42,9 +42,20 @@
         var match = pattern.exec(source);
 
         if (match)
-            this.sourceURL = WebInspector.UIString("(program): %s", match[1]);
+            this.sourceURL = match[1];
     }
 }
 
 WebInspector.Script.prototype = {
+    get linesCount()
+    {
+        if (!this.source)
+            return 0;
+        this._linesCount = 0;
+        var lastIndex = this.source.indexOf("\n");
+        while (lastIndex !== -1) {
+            lastIndex = this.source.indexOf("\n", lastIndex + 1)
+            this._linesCount++;
+        }
+    }
 }
diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js
index c5a8b81..e55a685 100644
--- a/WebCore/inspector/front-end/ScriptView.js
+++ b/WebCore/inspector/front-end/ScriptView.js
@@ -33,7 +33,8 @@
 
     this._frameNeedsSetup = true;
     this._sourceFrameSetup = false;
-    this.sourceFrame = new WebInspector.SourceFrame(this.element, this._addBreakpoint.bind(this), this._removeBreakpoint.bind(this));
+    var canEditScripts = WebInspector.panels.scripts.canEditScripts();
+    this.sourceFrame = new WebInspector.SourceFrame(this.element, this._addBreakpoint.bind(this), this._removeBreakpoint.bind(this), canEditScripts ? this._editLine.bind(this) : null);
 }
 
 WebInspector.ScriptView.prototype = {
@@ -52,11 +53,18 @@
 
         this.attach();
 
-        this.sourceFrame.setContent("text/javascript", this.script.source);
+        this.sourceFrame.setContent("text/javascript", this._prependWhitespace(this.script.source));
         this._sourceFrameSetup = true;
         delete this._frameNeedsSetup;
     },
 
+    _prependWhitespace: function(content) {
+        var prefix = "";
+        for (var i = 0; i < this.script.startingLine - 1; ++i)
+            prefix += "\n";
+        return prefix + content;
+    },
+
     attach: function()
     {
         if (!this.element.parentNode)
@@ -69,6 +77,17 @@
         WebInspector.panels.scripts.addBreakpoint(breakpoint);
     },
 
+    _editLine: function(line, newContent)
+    {
+        WebInspector.panels.scripts.editScriptLine(this.script.sourceID, line, newContent, this._editLineComplete.bind(this));
+    },
+
+    _editLineComplete: function(newBody)
+    {
+        this.script.source = newBody;
+        this.sourceFrame.updateContent(this._prependWhitespace(newBody));
+    },
+
     // The follow methods are pulled from SourceView, since they are
     // generic and work with ScriptView just fine.
 
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index da24ed2..987bdf2 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -105,6 +105,12 @@
     this.stepOutButton.appendChild(document.createElement("img"));
     this.sidebarButtonsElement.appendChild(this.stepOutButton);
 
+    this.toggleBreakpointsButton = new WebInspector.StatusBarButton("", "toggle-breakpoints");
+    this.toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked.bind(this), false);
+    this.sidebarButtonsElement.appendChild(this.toggleBreakpointsButton.element);
+    // Breakpoints should be activated by default, so emulate a click to toggle on.
+    this._toggleBreakpointsClicked();
+
     this.debuggerStatusElement = document.createElement("div");
     this.debuggerStatusElement.id = "scripts-debugger-status";
     this.sidebarButtonsElement.appendChild(this.debuggerStatusElement);
@@ -129,6 +135,7 @@
     this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();
     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
     this.sidebarPanes.breakpoints = new WebInspector.BreakpointsSidebarPane();
+    this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();
 
     for (var pane in this.sidebarPanes)
         this.sidebarElement.appendChild(this.sidebarPanes[pane].element);
@@ -154,10 +161,9 @@
     this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
     this.enableToggleButton.addEventListener("click", this._toggleDebugging.bind(this), false);
 
-    this.pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
-    this.pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
-
-    this._breakpointsURLMap = {};
+    this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
+    this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions.bind(this), false);
+    this._pauseOnExceptionButton.state = WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions;
 
     this._shortcuts = {};
     var handler, shortcut;
@@ -191,10 +197,13 @@
     shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Semicolon, WebInspector.KeyboardShortcut.Modifiers.Shift, platformSpecificModifier);
     this._shortcuts[shortcut] = handler;
 
+    this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;
+    if (Preferences.debuggerAlwaysEnabled)
+        this._attachDebuggerWhenShown = true;
     this.reset();
 }
 
-// Keep these in sync with WebCore::JavaScriptDebugServer
+// Keep these in sync with WebCore::ScriptDebugServer
 WebInspector.ScriptsPanel.PauseOnExceptionsState = {
     DontPauseOnExceptions : 0,
     PauseOnAllExceptions : 1,
@@ -211,7 +220,7 @@
 
     get statusBarItems()
     {
-        return [this.enableToggleButton.element, this.pauseOnExceptionButton.element];
+        return [this.enableToggleButton.element, this._pauseOnExceptionButton.element];
     },
 
     get defaultFocusedElement()
@@ -234,16 +243,6 @@
                 this.visibleView.headersVisible = false;
             this.visibleView.show(this.viewsContainerElement);
         }
-        // Hide any views that are visible that are not this panel's current visible view.
-        // This can happen when a ResourceView is visible in the Resources panel then switched
-        // to the this panel.
-        for (var sourceID in this._sourceIDMap) {
-            var scriptOrResource = this._sourceIDMap[sourceID];
-            var view = this._sourceViewForScriptOrResource(scriptOrResource);
-            if (!view || view === this.visibleView)
-                continue;
-            view.visible = false;
-        }
         if (this._attachDebuggerWhenShown) {
             InspectorBackend.enableDebugger(false);
             delete this._attachDebuggerWhenShown;
@@ -252,89 +251,74 @@
 
     get searchableViews()
     {
-        var views = [];
+        return [ this.visibleView ];
+    },
 
-        const visibleView = this.visibleView;
-        if (visibleView && visibleView.performSearch) {
-            visibleView.alreadySearching = true;
-            views.push(visibleView);
-        }
-
-        for (var sourceID in this._sourceIDMap) {
-            var scriptOrResource = this._sourceIDMap[sourceID];
-            var view = this._sourceViewForScriptOrResource(scriptOrResource);
-            if (!view || !view.performSearch || view.alreadySearching)
-                continue;
-
-            view.alreadySearching = true;
-            views.push(view);
-        }
-
-        for (var i = 0; i < views.length; ++i)
-            delete views[i].alreadySearching;
-
-        return views;
+    get breakpointsActivated()
+    {
+        return this.toggleBreakpointsButton.toggled;
     },
 
     addScript: function(sourceID, sourceURL, source, startingLine, errorLine, errorMessage)
     {
         var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, errorLine, errorMessage);
+        this._sourceIDMap[sourceID] = script;
 
-        if (sourceURL in WebInspector.resourceURLMap) {
-            var resource = WebInspector.resourceURLMap[sourceURL];
-            resource.addScript(script);
-        }
-
-        sourceURL = script.sourceURL;
-
-        if (sourceID)
-            this._sourceIDMap[sourceID] = (resource || script);
-
-        if (sourceURL in this._breakpointsURLMap && sourceID) {
-            var breakpoints = this._breakpointsURLMap[sourceURL];
-            var breakpointsLength = breakpoints.length;
-            for (var i = 0; i < breakpointsLength; ++i) {
-                var breakpoint = breakpoints[i];
-
-                if (startingLine <= breakpoint.line) {
-                    // remove and add the breakpoint, to clean up things like the sidebar
-                    this.removeBreakpoint(breakpoint);
-                    breakpoint.sourceID = sourceID;
-                    this.addBreakpoint(breakpoint);
-                    
-                    if (breakpoint.enabled)
-                        InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
+        var resource = WebInspector.resourceURLMap[sourceURL];
+        if (resource) {
+            if (resource.finished) {
+                // Resource is finished, bind the script right away.
+                resource.addScript(script);
+                this._sourceIDMap[sourceID] = resource;
+            } else {
+                // Resource is not finished, bind the script later.
+                if (!resource._scriptsPendingResourceLoad) {
+                    resource._scriptsPendingResourceLoad = [];
+                    resource.addEventListener("finished", this._resourceLoadingFinished, this);
                 }
+                resource._scriptsPendingResourceLoad.push(script);
             }
         }
-
         this._addScriptToFilesMenu(script);
     },
 
-    scriptOrResourceForID: function(id)
+    _resourceLoadingFinished: function(e)
     {
-        return this._sourceIDMap[id];
-    },
+        var resource = e.target;
+        for (var i = 0; i < resource._scriptsPendingResourceLoad.length; ++i) {
+            // Bind script to resource.
+            var script = resource._scriptsPendingResourceLoad[i];
+            resource.addScript(script);
+            this._sourceIDMap[script.sourceID] = resource;
 
-    scriptForURL: function(url)
-    {
-        return this._scriptsForURLsInFilesSelect[url];
+            // Remove script from the files list.
+            script.filesSelectOption.parentElement.removeChild(script.filesSelectOption);
+            
+            // Move breakpoints to the resource's frame.
+            if (script._scriptView) {
+                var sourceFrame = script._scriptView.sourceFrame;
+                var resourceFrame = this._sourceFrameForScriptOrResource(resource);
+                for (var j = 0; j < sourceFrame.breakpoints; ++j)
+                    resourceFrame.addBreakpoint(sourceFrame.breakpoints[j]);
+            }
+        }
+        // Adding first script will add resource.
+        this._addScriptToFilesMenu(resource._scriptsPendingResourceLoad[0]);
+        delete resource._scriptsPendingResourceLoad;
     },
 
     addBreakpoint: function(breakpoint)
     {
+        if (!this.breakpointsActivated)
+            this._toggleBreakpointsClicked();
+
         this.sidebarPanes.breakpoints.addBreakpoint(breakpoint);
 
         var sourceFrame;
         if (breakpoint.url) {
-            if (!(breakpoint.url in this._breakpointsURLMap))
-                this._breakpointsURLMap[breakpoint.url] = [];
-            this._breakpointsURLMap[breakpoint.url].unshift(breakpoint);
-
-            if (breakpoint.url in WebInspector.resourceURLMap) {
-                var resource = WebInspector.resourceURLMap[breakpoint.url];
+            var resource = WebInspector.resourceURLMap[breakpoint.url];
+            if (resource && resource.finished)
                 sourceFrame = this._sourceFrameForScriptOrResource(resource);
-            }
         }
 
         if (breakpoint.sourceID && !sourceFrame) {
@@ -351,16 +335,10 @@
         this.sidebarPanes.breakpoints.removeBreakpoint(breakpoint);
 
         var sourceFrame;
-        if (breakpoint.url && breakpoint.url in this._breakpointsURLMap) {
-            var breakpoints = this._breakpointsURLMap[breakpoint.url];
-            breakpoints.remove(breakpoint);
-            if (!breakpoints.length)
-                delete this._breakpointsURLMap[breakpoint.url];
-
-            if (breakpoint.url in WebInspector.resourceURLMap) {
-                var resource = WebInspector.resourceURLMap[breakpoint.url];
+        if (breakpoint.url) {
+            var resource = WebInspector.resourceURLMap[breakpoint.url];
+            if (resource && resource.finished)
                 sourceFrame = this._sourceFrameForScriptOrResource(resource);
-            }
         }
 
         if (breakpoint.sourceID && !sourceFrame) {
@@ -372,6 +350,40 @@
             sourceFrame.removeBreakpoint(breakpoint);
     },
 
+    canEditScripts: function()
+    {
+        return !!InspectorBackend.editScriptLine;
+    },
+
+    editScriptLine: function(sourceID, line, newContent, callback)
+    {
+        if (!this.canEditScripts())
+            return;
+
+        // Need to clear breakpoints and re-create them later when editing source.
+        var breakpointsPanel = this.sidebarPanes.breakpoints;
+        var newBreakpoints = [];
+        for (var id in breakpointsPanel.breakpoints) {
+            var breakpoint = breakpointsPanel.breakpoints[id];
+            breakpointsPanel.removeBreakpoint(breakpoint);
+            newBreakpoints.push(breakpoint);
+        }
+
+        var linesCountToShift = newContent.split("\n").length - 1;
+        function mycallback(newBody)
+        {
+            callback(newBody);
+            for (var i = 0; i < newBreakpoints.length; ++i) {
+                var breakpoint = newBreakpoints[i];
+                if (breakpoint.line >= line)
+                    breakpoint.line += linesCountToShift;
+                this.addBreakpoint(breakpoint);
+            }
+        };
+        var callbackId = WebInspector.Callback.wrap(mycallback.bind(this))
+        InspectorBackend.editScriptLine(callbackId, sourceID, line, newContent);
+    },
+
     selectedCallFrameId: function()
     {
         var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;
@@ -444,22 +456,30 @@
 
     debuggerWasEnabled: function()
     {
-        this.reset();
+        if (this._debuggerEnabled)
+            return;
+
+        this._debuggerEnabled = true;
+        this.reset(true);
     },
 
     debuggerWasDisabled: function()
     {
-        this.reset();
+        if (!this._debuggerEnabled)
+            return;
+
+        this._debuggerEnabled = false;
+        this.reset(true);
     },
 
-    reset: function()
+    reset: function(preserveWorkers)
     {
         this.visibleView = null;
 
         delete this.currentQuery;
         this.searchCanceled();
 
-        if (!InspectorBackend.debuggerEnabled()) {
+        if (!this._debuggerEnabled) {
             this._paused = false;
             this._waitingToPause = false;
             this._stepping = false;
@@ -471,7 +491,7 @@
         this._currentBackForwardIndex = -1;
         this._updateBackAndForwardButtons();
 
-        this._scriptsForURLsInFilesSelect = {};
+        this._resourceForURLInFilesSelect = {};
         this.filesSelectElement.removeChildren();
         this.functionsSelectElement.removeChildren();
         this.viewsContainerElement.removeChildren();
@@ -487,6 +507,9 @@
         this._sourceIDMap = {};
         
         this.sidebarPanes.watchExpressions.refreshExpressions();
+        this.sidebarPanes.breakpoints.reset();
+        if (!preserveWorkers)
+            this.sidebarPanes.workers.reset();
     },
 
     get visibleView()
@@ -508,36 +531,50 @@
             x.show(this.viewsContainerElement);
     },
 
-    canShowSourceLineForURL: function(url)
+    viewRecreated: function(oldView, newView)
     {
-        return InspectorBackend.debuggerEnabled() &&
-            !!(WebInspector.resourceForURL(url) || this.scriptForURL(url));
+        if (this._visibleView === oldView)
+            this._visibleView = newView;
     },
 
-    showSourceLineForURL: function(url, line)
+    canShowSourceLine: function(url, line)
     {
-        var resource = WebInspector.resourceForURL(url);
-        if (resource)
-            this.showResource(resource, line);
-        else
-            this.showScript(this.scriptForURL(url), line);
+        if (!this._debuggerEnabled)
+            return false;
+        return !!this._scriptOrResourceForURLAndLine(url, line);
     },
 
-    showScript: function(script, line)
+    showSourceLine: function(url, line)
     {
-        this._showScriptOrResource(script, {line: line, shouldHighlightLine: true});
+        var scriptOrResource = this._scriptOrResourceForURLAndLine(url, line);
+        this._showScriptOrResource(scriptOrResource, {line: line, shouldHighlightLine: true});
     },
 
-    showResource: function(resource, line)
+    _scriptOrResourceForURLAndLine: function(url, line) 
     {
-        this._showScriptOrResource(resource, {line: line, shouldHighlightLine: true});
+        var scriptWithMatchingUrl = null;
+        for (var sourceID in this._sourceIDMap) {
+            var scriptOrResource = this._sourceIDMap[sourceID];
+            if (scriptOrResource instanceof WebInspector.Script) {
+                if (scriptOrResource.sourceURL !== url)
+                    continue;
+                scriptWithMatchingUrl = scriptOrResource;
+                if (scriptWithMatchingUrl.startingLine <= line && scriptWithMatchingUrl.startingLine + scriptWithMatchingUrl.linesCount > line)
+                    return scriptWithMatchingUrl;
+            } else {
+                var resource = scriptOrResource;
+                if (resource.url === url)
+                    return resource;
+            }
+        }
+        return scriptWithMatchingUrl;
     },
 
     showView: function(view)
     {
         if (!view)
             return;
-        this._showScriptOrResource((view.resource || view.script));
+        this._showScriptOrResource(view.resource || view.script);
     },
 
     handleShortcut: function(event)
@@ -574,24 +611,10 @@
         return view.sourceFrame;
     },
 
-    _sourceViewForScriptOrResource: function(scriptOrResource)
-    {
-        if (scriptOrResource instanceof WebInspector.Resource) {
-            if (!WebInspector.panels.resources)
-                return null;
-            return WebInspector.panels.resources.resourceViewForResource(scriptOrResource);
-        }
-        if (scriptOrResource instanceof WebInspector.Script)
-            return this.scriptViewForScript(scriptOrResource);
-    },
-
     _sourceFrameForScriptOrResource: function(scriptOrResource)
     {
-        if (scriptOrResource instanceof WebInspector.Resource) {
-            if (!WebInspector.panels.resources)
-                return null;
+        if (scriptOrResource instanceof WebInspector.Resource)
             return WebInspector.panels.resources.sourceFrameForResource(scriptOrResource);
-        }
         if (scriptOrResource instanceof WebInspector.Script)
             return this.sourceFrameForScript(scriptOrResource);
     },
@@ -610,15 +633,13 @@
             if (!WebInspector.panels.resources)
                 return null;
             view = WebInspector.panels.resources.resourceViewForResource(scriptOrResource);
-            view.headersVisible = false; 
-
-            if (scriptOrResource.url in this._breakpointsURLMap) {
-                var sourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource);
-                if (sourceFrame && !sourceFrame.breakpoints.length) {
-                    var breakpoints = this._breakpointsURLMap[scriptOrResource.url];
-                    var breakpointsLength = breakpoints.length;
-                    for (var i = 0; i < breakpointsLength; ++i)
-                        sourceFrame.addBreakpoint(breakpoints[i]);
+            view.headersVisible = false;
+            var breakpoints = this.sidebarPanes.breakpoints.breakpoints;
+            for (var breakpointId in breakpoints) {
+                var breakpoint = breakpoints[breakpointId];
+                if (breakpoint.url === scriptOrResource.url) {
+                    var sourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource);
+                    sourceFrame.addBreakpoint(breakpoint);
                 }
             }
         } else if (scriptOrResource instanceof WebInspector.Script)
@@ -666,55 +687,50 @@
             // hasn't been added yet - happens for stepping in evals,
             // so use the force option to force the script into the menu.
             if (!option) {
-                this._addScriptToFilesMenu(scriptOrResource, {force: true});
+                this._addScriptToFilesMenu(scriptOrResource, true);
                 option = scriptOrResource.filesSelectOption;
             }
 
             console.assert(option);
-        } else {
-            var script = this.scriptForURL(url);
-            if (script)
-               option = script.filesSelectOption;
-        }
+        } else
+            option = scriptOrResource.filesSelectOption;
 
         if (option)
             this.filesSelectElement.selectedIndex = option.index;
     },
 
-    _addScriptToFilesMenu: function(script, options)
+    _addScriptToFilesMenu: function(script, force)
     {
-        var force = options && options.force;
-
         if (!script.sourceURL && !force)
             return;
 
-        if (script.resource && this._scriptsForURLsInFilesSelect[script.sourceURL])
-            return;
-
-        this._scriptsForURLsInFilesSelect[script.sourceURL] = script;
+        if (script.resource) {
+            if (this._resourceForURLInFilesSelect[script.resource.url])
+                return;
+            this._resourceForURLInFilesSelect[script.resource.url] = script.resource;
+        }
+ 
+        var displayName = script.sourceURL ? WebInspector.displayNameForURL(script.sourceURL) : WebInspector.UIString("(program)");
 
         var select = this.filesSelectElement;
-
         var option = document.createElement("option");
-        option.representedObject = (script.resource || script);
-        option.text = (script.sourceURL ? WebInspector.displayNameForURL(script.sourceURL) : WebInspector.UIString("(program)"));
+        option.representedObject = script.resource || script;
+        option.url = displayName;
+        option.startingLine = script.startingLine;
+        option.text = script.resource || script.startingLine === 1 ? displayName : String.sprintf("%s:%d", displayName, script.startingLine);
 
         function optionCompare(a, b)
         {
-            var aTitle = a.text.toLowerCase();
-            var bTitle = b.text.toLowerCase();
-            if (aTitle < bTitle)
+            if (a.url < b.url)
                 return -1;
-            else if (aTitle > bTitle)
+            else if (a.url > b.url)
                 return 1;
 
-            var aSourceID = a.representedObject.sourceID;
-            var bSourceID = b.representedObject.sourceID;
-            if (aSourceID < bSourceID)
+            if (typeof a.startingLine !== "number")
                 return -1;
-            else if (aSourceID > bSourceID)
-                return 1;
-            return 0;
+            if (typeof b.startingLine !== "number")
+                return -1;
+            return a.startingLine - b.startingLine;
         }
 
         var insertionIndex = insertionIndexForObjectInListSortedByFunction(option, select.childNodes, optionCompare);
@@ -723,7 +739,10 @@
         else
             select.insertBefore(option, select.childNodes.item(insertionIndex));
 
-        script.filesSelectOption = option;
+        if (script.resource)
+            script.resource.filesSelectOption = option;
+        else
+            script.filesSelectOption = option;
 
         // Call _showScriptOrResource if the option we just appended ended up being selected.
         // This will happen for the first item added to the menu.
@@ -803,35 +822,32 @@
         event.preventDefault();
     },
     
-    _updatePauseOnExceptionsButton: function()
+    updatePauseOnExceptionsState: function(pauseOnExceptionsState)
     {
-        if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
-            this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
-        else if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
-            this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
-        else if (InspectorBackend.pauseOnExceptionsState() == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
-            this.pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
-        
-        this.pauseOnExceptionButton.state = InspectorBackend.pauseOnExceptionsState();
-        
+        if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
+        else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnAllExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
+        else if (pauseOnExceptionsState == WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
+            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
+
+        this._pauseOnExceptionButton.state = pauseOnExceptionsState;
     },
 
     _updateDebuggerButtons: function()
     {
-        if (InspectorBackend.debuggerEnabled()) {
+        if (this._debuggerEnabled) {
             this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
             this.enableToggleButton.toggled = true;
-            this.pauseOnExceptionButton.visible = true;
+            this._pauseOnExceptionButton.visible = true;
             this.panelEnablerView.visible = false;
         } else {
             this.enableToggleButton.title = WebInspector.UIString("Debugging disabled. Click to enable.");
             this.enableToggleButton.toggled = false;
-            this.pauseOnExceptionButton.visible = false;
+            this._pauseOnExceptionButton.visible = false;
             this.panelEnablerView.visible = true;
         }
 
-        this._updatePauseOnExceptionsButton();
-
         if (this._paused) {
             this.pauseButton.addStyleClass("paused");
 
@@ -897,7 +913,7 @@
 
     _enableDebugging: function()
     {
-        if (InspectorBackend.debuggerEnabled())
+        if (this._debuggerEnabled)
             return;
         this._toggleDebugging(this.panelEnablerView.alwaysEnabled);
     },
@@ -908,7 +924,7 @@
         this._waitingToPause = false;
         this._stepping = false;
 
-        if (InspectorBackend.debuggerEnabled())
+        if (this._debuggerEnabled)
             InspectorBackend.disableDebugger(true);
         else
             InspectorBackend.enableDebugger(!!optionalAlways);
@@ -916,8 +932,7 @@
 
     _togglePauseOnExceptions: function()
     {
-        InspectorBackend.setPauseOnExceptionsState((InspectorBackend.pauseOnExceptionsState() + 1) % this.pauseOnExceptionButton.states);
-        this._updatePauseOnExceptionsButton();
+        InspectorBackend.setPauseOnExceptionsState((this._pauseOnExceptionButton.state + 1) % this._pauseOnExceptionButton.states);
     },
 
     _togglePause: function()
@@ -963,7 +978,23 @@
         this._clearInterface();
 
         InspectorBackend.stepOutOfFunctionInDebugger();
+    },
+
+    _toggleBreakpointsClicked: function()
+    {
+        this.toggleBreakpointsButton.toggled = !this.toggleBreakpointsButton.toggled;
+        if (this.toggleBreakpointsButton.toggled) {
+            InspectorBackend.activateBreakpoints();
+            this.toggleBreakpointsButton.title = WebInspector.UIString("Deactivate all breakpoints.");
+            document.getElementById("main-panels").removeStyleClass("breakpoints-deactivated");
+        } else {
+            InspectorBackend.deactivateBreakpoints();
+            this.toggleBreakpointsButton.title = WebInspector.UIString("Activate all breakpoints.");
+            document.getElementById("main-panels").addStyleClass("breakpoints-deactivated");
+        }
     }
 }
 
 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.didEditScriptLine = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index e6fc0c3..b9b5f75 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -38,7 +38,10 @@
     styleRulesExpandedState: {},
     showMissingLocalizedStrings: false,
     samplingCPUProfiler: false,
-    showColorNicknames: true
+    showColorNicknames: true,
+    debuggerAlwaysEnabled: false,
+    profilerAlwaysEnabled: false,
+    auditsPanelEnabled: true
 }
 
 WebInspector.populateFrontendSettings = function(settingsString)
@@ -68,6 +71,7 @@
         this._installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false);
         this._installSetting("showUserAgentStyles", "show-user-agent-styles", true);
         this._installSetting("resourceViewTab", "resource-view-tab", "content");
+        this._installSetting("consoleHistory", "console-history", []);
         this.dispatchEventToListeners("loaded");
     },
 
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.js b/WebCore/inspector/front-end/SourceCSSTokenizer.js
index 599cfb3..f7d7d51 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.js
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
+/* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -99,35 +99,35 @@
     
     this._valueKeywords = [
         "above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll",
-        "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "armenian", "auto", "avoid",
-        "background", "backwards", "baseline", "below", "bidi-override", "black", "blink", "block", "block-axis", "blue", "bold",
-        "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button", "button-bevel", "buttonface",
-        "buttonhighlight", "buttonshadow", "buttontext", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell",
-        "center", "checkbox", "circle", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
-        "col-resize", "collapse", "compact", "condensed", "contain", "content", "content-box", "context-menu", "continuous", "copy",
-        "cover", "crop", "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", "decimal-leading-zero", "default",
-        "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "disc", "discard", "document",
+        "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian",
+        "auto", "avoid", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "black", "blink",
+        "block", "block-axis", "blue", "bold", "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button",
+        "button-bevel", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", "capitalize", "caps-lock-indicator",
+        "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic",
+        "clear", "clip", "close-quote", "col-resize", "collapse", "compact", "condensed", "contain", "content", "content-box", "context-menu",
+        "continuous", "copy", "cover", "crop", "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", "decimal-leading-zero", "default",
+        "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", "disc", "discard", "document",
         "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element",
         "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez",
         "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et",
         "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et",
         "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded",
         "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "forwards", "from", "fuchsia", "geometricPrecision",
-        "georgian", "gray", "graytext", "green", "grey", "groove", "hand", "hangul", "hangul-consonant", "hebrew", "help", "hidden", "hide",
-        "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
+        "georgian", "gray", "graytext", "green", "grey", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help",
+        "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
         "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline",
-        "inline-axis", "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "justify", "katakana",
-        "katakana-iroha", "landscape", "large", "larger", "left", "level", "lighter", "lime", "line-through", "linear", "lines",
-        "list-button", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-greek", "lower-latin",
-        "lower-norwegian", "lower-roman", "lowercase", "ltr", "maroon", "match", "media-controls-background", "media-current-time-display",
+        "inline-axis", "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "justify", "kannada", "katakana",
+        "katakana-iroha", "khmer", "landscape", "lao", "large", "larger", "left", "level", "lighter", "lime", "line-through", "linear", "lines",
+        "list-button", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-greek", "lower-hexadecimal", "lower-latin",
+        "lower-norwegian", "lower-roman", "lowercase", "ltr", "malayalam", "maroon", "match", "media-controls-background", "media-current-time-display",
         "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button",
         "media-seek-back-button", "media-seek-forward-button", "media-slider", "media-sliderthumb", "media-time-remaining-display",
         "media-volume-slider", "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button",
-        "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", "mix", "monospace", "move", "multiple",
-        "n-resize", "narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none",
-        "normal", "not-allowed", "nowrap", "ns-resize", "nw-resize", "nwse-resize", "oblique", "olive", "open-quote", "optimizeLegibility",
-        "optimizeSpeed", "orange", "oromo", "outset", "outside", "overlay", "overline", "padding", "padding-box", "painted", "paused",
-        "plus-darker", "plus-lighter", "pointer", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "purple",
+        "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", "mix", "mongolian", "monospace", "move", "multiple",
+        "myanmar", "n-resize", "narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none",
+        "normal", "not-allowed", "nowrap", "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "olive", "open-quote", "optimizeLegibility",
+        "optimizeSpeed", "orange", "oriya", "oromo", "outset", "outside", "overlay", "overline", "padding", "padding-box", "painted", "paused",
+        "persian", "plus-darker", "plus-lighter", "pointer", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "purple",
         "push-button", "radio", "read-only", "read-write", "read-write-plaintext-only", "red", "relative", "repeat", "repeat-x",
         "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", "s-resize", "sans-serif",
         "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
@@ -136,15 +136,15 @@
         "small", "small-caps", "small-caption", "smaller", "solid", "somali", "source-atop", "source-in", "source-out", "source-over",
         "space", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super",
         "sw-resize", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group",
-        "table-row", "table-row-group", "teal", "text", "text-bottom", "text-top", "textarea", "textfield", "thick", "thin", "threeddarkshadow",
-        "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et",
-        "tigrinya-et-abegede", "to", "top", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-greek",
-        "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "url", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
-        "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext", "x-large", "x-small",
-        "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle", "-webkit-body",
-        "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing", "-webkit-gradient", "-webkit-inline-box",
-        "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-right", "-webkit-small-control",
-        "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
+        "table-row", "table-row-group", "teal", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin",
+        "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede",
+        "tigrinya-et", "tigrinya-et-abegede", "to", "top", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-greek",
+        "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "vertical", "vertical-text", "visible",
+        "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext",
+        "x-large", "x-small", "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle",
+        "-webkit-body", "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing",
+        "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-right",
+        "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
     ].keySet();
 
     this._mediaTypes = ["all", "aural", "braille", "embossed", "handheld", "import", "print", "projection", "screen", "tty", "tv"].keySet();
@@ -183,7 +183,7 @@
 
     _isPropertyValue: function()
     {
-        return this._parseCondition === this._parseConditions.PROPERTY_VALUE || this._parseCondition === this._parseConditions.AT_RULE;
+        return this._condition.parseCondition === this._parseConditions.PROPERTY_VALUE || this._condition.parseCondition === this._parseConditions.AT_RULE;
     },
 
     nextToken: function(cursor)
@@ -423,18 +423,18 @@
 case 32:
             {
                     var token = this._line.substring(cursorOnEnter, cursor);
-                    if (this._parseCondition === this._parseConditions.INITIAL) {
+                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {
                         if (token === "@import" || token === "@media") {
                             this.tokenType = "css-at-rule";
-                            this._parseCondition = this._parseConditions.AT_RULE;
+                            this._condition.parseCondition = this._parseConditions.AT_RULE;
                         } else if (token.indexOf("@") === 0)
                             this.tokenType = "css-at-rule";
                         else
                             this.tokenType = "css-selector";
                     }
-                    else if (this._parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
+                    else if (this._condition.parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
                         this.tokenType = "css-keyword";
-                    else if (this._parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)
+                    else if (this._condition.parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)
                         this.tokenType = "css-property";
                     else if (this._isPropertyValue() && token in this._valueKeywords)
                         this.tokenType = "css-keyword";
@@ -647,35 +647,35 @@
             ++cursor;
             {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.PROPERTY)
-                        this._parseCondition = this._parseConditions.PROPERTY_VALUE;
+                    if (this._condition.parseCondition === this._parseConditions.PROPERTY)
+                        this._condition.parseCondition = this._parseConditions.PROPERTY_VALUE;
                     return cursor;
                 }
 case 42:
             ++cursor;
             {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.AT_RULE)
-                        this._parseCondition = this._parseConditions.INITIAL;
+                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)
+                        this._condition.parseCondition = this._parseConditions.INITIAL;
                     else
-                        this._parseCondition = this._parseConditions.PROPERTY;
+                        this._condition.parseCondition = this._parseConditions.PROPERTY;
                     return cursor;
                 }
 case 44:
             ++cursor;
             {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.AT_RULE)
-                        this._parseCondition = this._parseConditions.INITIAL;
+                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)
+                        this._condition.parseCondition = this._parseConditions.INITIAL;
                     else
-                        this._parseCondition = this._parseConditions.PROPERTY;
+                        this._condition.parseCondition = this._parseConditions.PROPERTY;
                     return cursor;
                 }
 case 46:
             ++cursor;
             {
                     this.tokenType = null;
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 case 48:
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
index ac22bd4..6ba9f60 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
@@ -182,7 +182,7 @@
 
     _isPropertyValue: function()
     {
-        return this._parseCondition === this._parseConditions.PROPERTY_VALUE || this._parseCondition === this._parseConditions.AT_RULE;
+        return this._condition.parseCondition === this._parseConditions.PROPERTY_VALUE || this._condition.parseCondition === this._parseConditions.AT_RULE;
     },
 
     nextToken: function(cursor)
@@ -244,35 +244,35 @@
                 <INITIAL> OpenCurlyBracket
                 {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.AT_RULE)
-                        this._parseCondition = this._parseConditions.INITIAL;
+                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)
+                        this._condition.parseCondition = this._parseConditions.INITIAL;
                     else
-                        this._parseCondition = this._parseConditions.PROPERTY;
+                        this._condition.parseCondition = this._parseConditions.PROPERTY;
                     return cursor;
                 }
 
                 <INITIAL> CloseCurlyBracket
                 {
                     this.tokenType = null;
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
                 <INITIAL> Colon
                 {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.PROPERTY)
-                        this._parseCondition = this._parseConditions.PROPERTY_VALUE;
+                    if (this._condition.parseCondition === this._parseConditions.PROPERTY)
+                        this._condition.parseCondition = this._parseConditions.PROPERTY_VALUE;
                     return cursor;
                 }
 
                 <INITIAL> Semicolon
                 {
                     this.tokenType = null;
-                    if (this._parseCondition === this._parseConditions.AT_RULE)
-                        this._parseCondition = this._parseConditions.INITIAL;
+                    if (this._condition.parseCondition === this._parseConditions.AT_RULE)
+                        this._condition.parseCondition = this._parseConditions.INITIAL;
                     else
-                        this._parseCondition = this._parseConditions.PROPERTY;
+                        this._condition.parseCondition = this._parseConditions.PROPERTY;
                     return cursor;
                 }
 
@@ -288,18 +288,18 @@
                 <INITIAL> Identifier
                 {
                     var token = this._line.substring(cursorOnEnter, cursor);
-                    if (this._parseCondition === this._parseConditions.INITIAL) {
+                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {
                         if (token === "@import" || token === "@media") {
                             this.tokenType = "css-at-rule";
-                            this._parseCondition = this._parseConditions.AT_RULE;
+                            this._condition.parseCondition = this._parseConditions.AT_RULE;
                         } else if (token.indexOf("@") === 0)
                             this.tokenType = "css-at-rule";
                         else
                             this.tokenType = "css-selector";
                     }
-                    else if (this._parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
+                    else if (this._condition.parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
                         this.tokenType = "css-keyword";
-                    else if (this._parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)
+                    else if (this._condition.parseCondition === this._parseConditions.PROPERTY && token in this._propertyKeywords)
                         this.tokenType = "css-property";
                     else if (this._isPropertyValue() && token in this._valueKeywords)
                         this.tokenType = "css-keyword";
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 799628e..99280fc 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, removeBreakpointDelegate)
+WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, removeBreakpointDelegate, editDelegate)
 {
     this._parentElement = parentElement;
 
@@ -45,6 +45,7 @@
 
     this._addBreakpointDelegate = addBreakpointDelegate;
     this._removeBreakpointDelegate = removeBreakpointDelegate;
+    this._editDelegate = editDelegate;
     this._popoverObjectGroup = "popover";
 }
 
@@ -143,6 +144,11 @@
         this._createViewerIfNeeded();
     },
 
+    updateContent: function(content)
+    {
+        this._textModel.setText(null, content);
+    },
+
     highlightLine: function(line)
     {
         if (this._textViewer)
@@ -192,6 +198,8 @@
             delete this._lineToHighlight;
         }
         this._textViewer.endUpdates();
+        if (this._editDelegate)
+            this._textViewer.editCallback = this._editDelegate;
     },
 
     findSearchMatches: function(query)
@@ -288,8 +296,6 @@
         if (!this._executionLine)
             return;
 
-        this._drawProgramCounterImageIfNeeded();
-
         if (this._executionLine < this._textModel.linesCount)
             this._textViewer.addDecoration(this._executionLine - 1, "webkit-execution-line");
     },
@@ -369,7 +375,6 @@
 
         this._textModel.setAttribute(lineNumber, "breakpoint", breakpoint);
         breakpoint.sourceText = this._textModel.line(breakpoint.line - 1);
-        this._drawBreakpointImagesIfNeeded();
 
         this._textViewer.beginUpdates();
         this._textViewer.addDecoration(lineNumber, "webkit-breakpoint");
@@ -393,9 +398,10 @@
 
     _contextMenu: function(event)
     {
-        if (event.target.className !== "webkit-line-number")
+        var target = event.target.enclosingNodeOrSelfWithClass("webkit-line-number");
+        if (!target)
             return;
-        var row = event.target.parentElement;
+        var row = target.parentElement;
 
         var lineNumber = row.lineNumber;
         var contextMenu = new WebInspector.ContextMenu();
@@ -435,18 +441,22 @@
     {
         this._resetHoverTimer();
         this._hidePopup();
-        if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
+        if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey)
             return;
-        if (event.target.className !== "webkit-line-number")
+        var target = event.target.enclosingNodeOrSelfWithClass("webkit-line-number");
+        if (!target)
             return;
-        var row = event.target.parentElement;
+        var row = target.parentElement;
 
         var lineNumber = row.lineNumber;
 
         var breakpoint = this._textModel.getAttribute(lineNumber, "breakpoint");
-        if (breakpoint)
-            this._removeBreakpointDelegate(breakpoint);
-        else if (this._addBreakpointDelegate)
+        if (breakpoint) {
+            if (event.shiftKey)
+                breakpoint.enabled = !breakpoint.enabled;
+            else
+                this._removeBreakpointDelegate(breakpoint);
+        } else
             this._addBreakpointDelegate(lineNumber + 1);
         event.preventDefault();
     },
@@ -454,11 +464,10 @@
     _mouseMove: function(event)
     {
         // Pretend that nothing has happened.
-        if (this._hoverElement === event.target)
+        if (this._hoverElement === event.target || event.target.hasStyleClass("source-frame-eval-expression"))
             return;
 
         this._resetHoverTimer();
-
         // User has 500ms to reach the popup.
         if (this._popup) {
             var self = this;
@@ -483,7 +492,7 @@
         } else if (!this._hoverElement.hasStyleClass("webkit-javascript-ident"))
             return;
 
-        const toolTipDelay = 1500;
+        const toolTipDelay = this._popup ? 600 : 1000;
         this._hoverTimer = setTimeout(this._mouseHover.bind(this, this._hoverElement), toolTipDelay);
     },
 
@@ -497,11 +506,22 @@
 
     _hidePopup: function()
     {
-        if (this._popup) {
-            this._popup.hide();
-            delete this._popup;
-            InspectorBackend.releaseWrapperObjectGroup(0, this._popoverObjectGroup);
+        if (!this._popup)
+            return;
+
+        // Replace higlight element with its contents inplace.
+        var parentElement = this._popup.highlightElement.parentElement;
+        var child = this._popup.highlightElement.firstChild;
+        while (child) {
+            var nextSibling = child.nextSibling;
+            parentElement.insertBefore(child, this._popup.highlightElement);
+            child = nextSibling;
         }
+        parentElement.removeChild(this._popup.highlightElement);
+
+        this._popup.hide();
+        delete this._popup;
+        InspectorBackend.releaseWrapperObjectGroup(0, this._popoverObjectGroup);
     },
 
     _mouseHover: function(element)
@@ -515,27 +535,26 @@
         if (!lineRow)
             return;
 
-        // Find text offset of the hovered node (iterate over text nodes until we hit ours).
-        var offset = 0;
-        var node = lineRow.lastChild.traverseNextTextNode(lineRow.lastChild);
-        while (node && node !== element.firstChild) {
-            offset += node.nodeValue.length;
-            node = node.traverseNextTextNode(lineRow.lastChild);
+        // Collect tokens belonging to evaluated exression.
+        var tokens = [ element ];
+        var token = element.previousSibling;
+        while (token && (token.className === "webkit-javascript-ident" || token.className === "webkit-javascript-keyword" || token.textContent.trim() === ".")) {
+            tokens.push(token);
+            token = token.previousSibling;
         }
+        tokens.reverse();
 
-        // Imagine that the line is "foo(A.B.C.D)" and we hit C. Following code goes through following steps:
-        // "foo(A.B.C" -> "C.B.A(oof" -> "C.B.A" -> "A.B.C" (target eval expression).
-        var lineNumber = lineRow.lineNumber;
-        var prefix = this._textModel.line(lineNumber).substring(0, offset + element.textContent.length);
-        var reversedPrefix = prefix.split("").reverse().join("");
-        var match = /[a-zA-Z\x80-\xFF\_$0-9.]+/.exec(reversedPrefix);
-        if (!match)
-            return;
-        var expression = match[0].split("").reverse().join("");
-        this._showPopup(element, expression);
+        // Wrap them with highlight element.
+        var parentElement = element.parentElement;
+        var nextElement = element.nextSibling;
+        var container = document.createElement("span");
+        for (var i = 0; i < tokens.length; ++i)
+            container.appendChild(tokens[i]);
+        parentElement.insertBefore(container, nextElement);
+        this._showPopup(container);
     },
 
-    _showPopup: function(element, expression)
+    _showPopup: function(element)
     {
         function killHidePopupTimer()
         {
@@ -549,20 +568,6 @@
             }
         }
 
-        function showTextPopup(text)
-        {
-            if (!WebInspector.panels.scripts.paused)
-                return;
-
-            var popupContentElement = document.createElement("span");
-            popupContentElement.className = "monospace";
-            popupContentElement.style.whiteSpace = "pre";
-            popupContentElement.textContent = text;
-            this._popup = new WebInspector.Popover(popupContentElement);
-            this._popup.show(element);
-            popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
-        }
-
         function showObjectPopup(result)
         {
             if (!WebInspector.panels.scripts.paused)
@@ -595,6 +600,8 @@
                 const popupHeight = 250;
                 this._popup.show(element, popupWidth, popupHeight);
             }
+            this._popup.highlightElement = element;
+            this._popup.highlightElement.addStyleClass("source-frame-eval-expression");
             popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
         }
 
@@ -606,7 +613,7 @@
                 return;
             showObjectPopup.call(this, result);
         }
-        WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, this._popoverObjectGroup, evaluateCallback.bind(this));
+        WebInspector.panels.scripts.evaluateInSelectedCallFrame(element.textContent, false, this._popoverObjectGroup, evaluateCallback.bind(this));
     },
 
     _editBreakpointCondition: function(breakpoint)
@@ -695,134 +702,6 @@
     {
         if (this._textViewer)
             this._textViewer.resize();
-    },
-
-    _drawProgramCounterInContext: function(ctx, glow)
-    {
-        if (glow)
-            ctx.save();
-
-        ctx.beginPath();
-        ctx.moveTo(17, 2);
-        ctx.lineTo(19, 2);
-        ctx.lineTo(19, 0);
-        ctx.lineTo(21, 0);
-        ctx.lineTo(26, 5.5);
-        ctx.lineTo(21, 11);
-        ctx.lineTo(19, 11);
-        ctx.lineTo(19, 9);
-        ctx.lineTo(17, 9);
-        ctx.closePath();
-        ctx.fillStyle = "rgb(142, 5, 4)";
-
-        if (glow) {
-            ctx.shadowBlur = 4;
-            ctx.shadowColor = "rgb(255, 255, 255)";
-            ctx.shadowOffsetX = -1;
-            ctx.shadowOffsetY = 0;
-        }
-
-        ctx.fill();
-        ctx.fill(); // Fill twice to get a good shadow and darker anti-aliased pixels.
-
-        if (glow)
-            ctx.restore();
-    },
-
-    _drawProgramCounterImageIfNeeded: function()
-    {
-        if (!this._needsProgramCounterImage)
-            return;
-
-        var ctx = document.getCSSCanvasContext("2d", "program-counter", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        this._drawProgramCounterInContext(ctx, true);
-
-        delete this._needsProgramCounterImage;
-    },
-
-    _drawBreakpointImagesIfNeeded: function(conditional)
-    {
-        if (!this._needsBreakpointImages)
-            return;
-
-        function drawBreakpoint(ctx, disabled, conditional)
-        {
-            ctx.beginPath();
-            ctx.moveTo(0, 2);
-            ctx.lineTo(2, 0);
-            ctx.lineTo(21, 0);
-            ctx.lineTo(26, 5.5);
-            ctx.lineTo(21, 11);
-            ctx.lineTo(2, 11);
-            ctx.lineTo(0, 9);
-            ctx.closePath();
-            ctx.fillStyle = conditional ? "rgb(217, 142, 1)" : "rgb(1, 142, 217)";
-            ctx.strokeStyle = conditional ? "rgb(205, 103, 0)" : "rgb(0, 103, 205)";
-            ctx.lineWidth = 3;
-            ctx.fill();
-            ctx.save();
-            ctx.clip();
-            ctx.stroke();
-            ctx.restore();
-
-            if (!disabled)
-                return;
-
-            ctx.save();
-            ctx.globalCompositeOperation = "destination-out";
-            ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
-            ctx.fillRect(0, 0, 26, 11);
-            ctx.restore();
-        }
-
-
-        // Unconditional breakpoints.
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-program-counter", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx);
-        ctx.clearRect(20, 0, 6, 11);
-        this._drawProgramCounterInContext(ctx, true);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-disabled", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, true);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-disabled-program-counter", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, true);
-        ctx.clearRect(20, 0, 6, 11);
-        this._drawProgramCounterInContext(ctx, true);
-
-
-        // Conditional breakpoints.
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-conditional", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, false, true);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-conditional-program-counter", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, false, true);
-        ctx.clearRect(20, 0, 6, 11);
-        this._drawProgramCounterInContext(ctx, true);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-disabled-conditional", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, true, true);
-
-        var ctx = document.getCSSCanvasContext("2d", "breakpoint-disabled-conditional-program-counter", 26, 11);
-        ctx.clearRect(0, 0, 26, 11);
-        drawBreakpoint(ctx, true, true);
-        ctx.clearRect(20, 0, 6, 11);
-        this._drawProgramCounterInContext(ctx, true);
-
-        delete this._needsBreakpointImages;
     }
 }
 
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 3c9bd8c..cfbc44f 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Feb 15 19:30:21 2010 */
+/* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -71,31 +71,43 @@
     };
 
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
+    this.condition = this.initialCondition;
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
+    set line(line) {
+        if (this._internalJavaScriptTokenizer) {
+            var match = /<\/script/i.exec(line);
+            if (match) {
+                this._internalJavaScriptTokenizer.line = line.substring(0, match.index);
+            } else
+                this._internalJavaScriptTokenizer.line = line;
+        }
+        this._line = line;
+    },
+
     _isExpectingAttribute: function()
     {
-        return this._parseCondition & this._parseConditions.ATTRIBUTE;
+        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;
     },
 
     _isExpectingAttributeValue: function()
     {
-        return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
+        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _setExpectingAttribute: function()
     {
         if (this._isExpectingAttributeValue())
-            this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
-        this._parseCondition |= this._parseConditions.ATTRIBUTE;
+            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
+        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;
     },
 
     _setExpectingAttributeValue: function()
     {
         if (this._isExpectingAttribute())
-            this._parseCondition ^= this._parseConditions.ATTRIBUTE;
-        this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
+            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;
+        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _stringToken: function(cursor, stringEnds)
@@ -112,8 +124,8 @@
 
     _attrValueTokenType: function()
     {
-        if (this._parseCondition & this._parseConditions.LINKIFY) {
-            if (this._parseCondition & this._parseConditions.A_NODE)
+        if (this._condition.parseCondition & this._parseConditions.LINKIFY) {
+            if (this._condition.parseCondition & this._parseConditions.A_NODE)
                 return "html-external-link";
             return "html-resource-link";
         }
@@ -122,6 +134,20 @@
 
     nextToken: function(cursor)
     {
+        if (this._internalJavaScriptTokenizer) {
+            // Re-set line to force </script> detection first.
+            this.line = this._line;
+            if (cursor !== this._internalJavaScriptTokenizer._line.length) {
+                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.
+                this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;
+                var result = this._internalJavaScriptTokenizer.nextToken(cursor);
+                this.tokenType = this._internalJavaScriptTokenizer.tokenType;
+                this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;
+                return result;
+            } else if (cursor !== this._line.length)
+                delete this._internalJavaScriptTokenizer;
+        }
+
         var cursorOnEnter = cursor;
         var gotoCase = 1;
         while (1) {
@@ -305,14 +331,14 @@
 case 40:
             this.setLexCondition(this._lexConditions.TAG);
             {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
                         // Do not tokenize script tag contents, keep lexer state although processing "<".
                         this.setLexCondition(this._lexConditions.INITIAL);
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     this.tokenType = "html-tag";
                     return cursor;
                 }
@@ -413,14 +439,14 @@
             ++cursor;
             this.setLexCondition(this._lexConditions.TAG);
             {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
                         // Do not tokenize script tag contents, keep lexer state although processing "<".
                         this.setLexCondition(this._lexConditions.INITIAL);
                         this.tokenType = null;
                         return cursor;
                     }
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.SCRIPT;
+                    this._condition.parseCondition = this._parseConditions.SCRIPT;
                     this._setExpectingAttribute();
                     return cursor;
                 }
@@ -449,7 +475,7 @@
             this.setLexCondition(this._lexConditions.TAG);
             {
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 /* *********************************** */
@@ -527,26 +553,26 @@
             { gotoCase = 109; continue; };
 case 89:
             {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition === this._parseConditions.SCRIPT) {
                         // Fall through if expecting attributes.
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    if (this._parseCondition === this._parseConditions.INITIAL) {
+                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {
                         this.tokenType = "html-tag";
                         this._setExpectingAttribute();
                         var token = this._line.substring(cursorOnEnter, cursor);
                         if (token === "a")
-                            this._parseCondition |= this._parseConditions.A_NODE;
-                        else if (this._parseCondition & this._parseConditions.A_NODE)
-                            this._parseCondition ^= this._parseConditions.A_NODE;
+                            this._condition.parseCondition |= this._parseConditions.A_NODE;
+                        else if (this._condition.parseCondition & this._parseConditions.A_NODE)
+                            this._condition.parseCondition ^= this._parseConditions.A_NODE;
                     } else if (this._isExpectingAttribute()) {
                         var token = this._line.substring(cursorOnEnter, cursor);
                         if (token === "href" || token === "src")
-                            this._parseCondition |= this._parseConditions.LINKIFY;
-                        else if (this._parseCondition |= this._parseConditions.LINKIFY)
-                            this._parseCondition ^= this._parseConditions.LINKIFY;
+                            this._condition.parseCondition |= this._parseConditions.LINKIFY;
+                        else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)
+                            this._condition.parseCondition ^= this._parseConditions.LINKIFY;
                         this.tokenType = "html-attribute-name";
                     } else if (this._isExpectingAttributeValue())
                         this.tokenType = this._attrValueTokenType();
@@ -577,14 +603,17 @@
             ++cursor;
             this.setLexCondition(this._lexConditions.INITIAL);
             {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    this.tokenType = "html-tag";
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
+                        if (!this._internalJavaScriptTokenizer) {
+                            this._internalJavaScriptTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/javascript");
+                            this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.initialCondition;
+                        }
                         // Do not tokenize script tag contents.
-                        this.tokenType = null;
                         return cursor;
                     }
 
-                    this._parseCondition = this._parseConditions.INITIAL;
-                    this.tokenType = "html-tag";
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 case 98:
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index cfa8834..44c62b3 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -70,31 +70,43 @@
     };
 
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
+    this.condition = this.initialCondition;
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
+    set line(line) {
+        if (this._internalJavaScriptTokenizer) {
+            var match = /<\/script/i.exec(line);
+            if (match) {
+                this._internalJavaScriptTokenizer.line = line.substring(0, match.index);
+            } else
+                this._internalJavaScriptTokenizer.line = line;
+        }
+        this._line = line;
+    },
+
     _isExpectingAttribute: function()
     {
-        return this._parseCondition & this._parseConditions.ATTRIBUTE;
+        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;
     },
 
     _isExpectingAttributeValue: function()
     {
-        return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
+        return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _setExpectingAttribute: function()
     {
         if (this._isExpectingAttributeValue())
-            this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
-        this._parseCondition |= this._parseConditions.ATTRIBUTE;
+            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
+        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;
     },
 
     _setExpectingAttributeValue: function()
     {
         if (this._isExpectingAttribute())
-            this._parseCondition ^= this._parseConditions.ATTRIBUTE;
-        this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
+            this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;
+        this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _stringToken: function(cursor, stringEnds)
@@ -111,8 +123,8 @@
 
     _attrValueTokenType: function()
     {
-        if (this._parseCondition & this._parseConditions.LINKIFY) {
-            if (this._parseCondition & this._parseConditions.A_NODE)
+        if (this._condition.parseCondition & this._parseConditions.LINKIFY) {
+            if (this._condition.parseCondition & this._parseConditions.A_NODE)
                 return "html-external-link";
             return "html-resource-link";
         }
@@ -121,6 +133,20 @@
 
     nextToken: function(cursor)
     {
+        if (this._internalJavaScriptTokenizer) {
+            // Re-set line to force </script> detection first.
+            this.line = this._line;
+            if (cursor !== this._internalJavaScriptTokenizer._line.length) {
+                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.
+                this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;
+                var result = this._internalJavaScriptTokenizer.nextToken(cursor);
+                this.tokenType = this._internalJavaScriptTokenizer.tokenType;
+                this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;
+                return result;
+            } else if (cursor !== this._line.length)
+                delete this._internalJavaScriptTokenizer;
+        }
+
         var cursorOnEnter = cursor;
         var gotoCase = 1;
         while (1) {
@@ -174,14 +200,14 @@
 
                 <INITIAL> ScriptStart => TAG
                 {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
                         // Do not tokenize script tag contents, keep lexer state although processing "<".
                         this.setLexCondition(this._lexConditions.INITIAL);
                         this.tokenType = null;
                         return cursor;
                     }
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.SCRIPT;
+                    this._condition.parseCondition = this._parseConditions.SCRIPT;
                     this._setExpectingAttribute();
                     return cursor;
                 }
@@ -189,34 +215,37 @@
                 <INITIAL> ScriptEnd => TAG
                 {
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
                 <INITIAL> LT => TAG
                 {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
                         // Do not tokenize script tag contents, keep lexer state although processing "<".
                         this.setLexCondition(this._lexConditions.INITIAL);
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    this._parseCondition = this._parseConditions.INITIAL;
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     this.tokenType = "html-tag";
                     return cursor;
                 }
-
+  
                 <TAG> GT => INITIAL
                 {
-                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                    this.tokenType = "html-tag";
+                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
+                        if (!this._internalJavaScriptTokenizer) {
+                            this._internalJavaScriptTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/javascript");
+                            this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.initialCondition;
+                        }
                         // Do not tokenize script tag contents.
-                        this.tokenType = null;
                         return cursor;
                     }
 
-                    this._parseCondition = this._parseConditions.INITIAL;
-                    this.tokenType = "html-tag";
+                    this._condition.parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
@@ -238,26 +267,26 @@
 
                 <TAG> Identifier
                 {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._condition.parseCondition === this._parseConditions.SCRIPT) {
                         // Fall through if expecting attributes.
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    if (this._parseCondition === this._parseConditions.INITIAL) {
+                    if (this._condition.parseCondition === this._parseConditions.INITIAL) {
                         this.tokenType = "html-tag";
                         this._setExpectingAttribute();
                         var token = this._line.substring(cursorOnEnter, cursor);
                         if (token === "a")
-                            this._parseCondition |= this._parseConditions.A_NODE;
-                        else if (this._parseCondition & this._parseConditions.A_NODE)
-                            this._parseCondition ^= this._parseConditions.A_NODE;
+                            this._condition.parseCondition |= this._parseConditions.A_NODE;
+                        else if (this._condition.parseCondition & this._parseConditions.A_NODE)
+                            this._condition.parseCondition ^= this._parseConditions.A_NODE;
                     } else if (this._isExpectingAttribute()) {
                         var token = this._line.substring(cursorOnEnter, cursor);
                         if (token === "href" || token === "src")
-                            this._parseCondition |= this._parseConditions.LINKIFY;
-                        else if (this._parseCondition |= this._parseConditions.LINKIFY)
-                            this._parseCondition ^= this._parseConditions.LINKIFY;
+                            this._condition.parseCondition |= this._parseConditions.LINKIFY;
+                        else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)
+                            this._condition.parseCondition ^= this._parseConditions.LINKIFY;
                         this.tokenType = "html-attribute-name";
                     } else if (this._isExpectingAttributeValue())
                         this.tokenType = this._attrValueTokenType();
diff --git a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
index 75abeee..fbd44d7 100644
--- a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
+++ b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:23 2010 */
+/* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -69,6 +69,7 @@
     this.case_REGEX = 1005;
 
     this.initialCondition = { lexCondition: this._lexConditions.NODIV }
+    this.condition = this.initialCondition;
 }
 
 WebInspector.SourceJavaScriptTokenizer.prototype = {
diff --git a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
index 053c82f..ae71efe 100644
--- a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
@@ -68,6 +68,7 @@
     this.case_REGEX = 1005;
 
     this.initialCondition = { lexCondition: this._lexConditions.NODIV }
+    this.condition = this.initialCondition;
 }
 
 WebInspector.SourceJavaScriptTokenizer.prototype = {
diff --git a/WebCore/inspector/front-end/SourceTokenizer.js b/WebCore/inspector/front-end/SourceTokenizer.js
index d498028..d30744c 100644
--- a/WebCore/inspector/front-end/SourceTokenizer.js
+++ b/WebCore/inspector/front-end/SourceTokenizer.js
@@ -40,28 +40,27 @@
 
     set condition(condition)
     {
-        this._lexCondition = condition.lexCondition;
-        this._parseCondition = condition.parseCondition;
+        this._condition = condition;
     },
 
     get condition()
     {
-        return { lexCondition: this._lexCondition, parseCondition: this._parseCondition };
+        return this._condition;
     },
 
-    hasCondition: function(condition)
+    get subTokenizer()
     {
-        return this._lexCondition === condition.lexCondition && this._parseCondition === condition.parseCondition;
+        return this._condition.subTokenizer;
     },
 
     getLexCondition: function()
     {
-        return this._lexCondition;
+        return this.condition.lexCondition;
     },
 
     setLexCondition: function(lexCondition)
     {
-        this._lexCondition = lexCondition;
+        this.condition.lexCondition = lexCondition;
     },
 
     _charAt: function(cursor)
@@ -76,9 +75,7 @@
     this._tokenizerConstructors = {
         "text/css": "SourceCSSTokenizer",
         "text/html": "SourceHTMLTokenizer",
-        "text/javascript": "SourceJavaScriptTokenizer",
-        "application/javascript": "SourceJavaScriptTokenizer",
-        "application/x-javascript": "SourceJavaScriptTokenizer"
+        "text/javascript": "SourceJavaScriptTokenizer"
     };
 }
 
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index b401c12..9fbd161 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -37,6 +37,14 @@
     this._frameNeedsSetup = true;
 }
 
+// This is a map from resource.type to mime types
+// found in WebInspector.SourceTokenizer.Registry.
+WebInspector.SourceView.DefaultMIMETypeForResourceType = {
+    0: "text/html",
+    1: "text/css",
+    4: "text/javascript"
+}
+
 WebInspector.SourceView.prototype = {
     show: function(parentElement)
     {
@@ -76,10 +84,16 @@
 
     _contentLoaded: function(content)
     {
-        this.sourceFrame.setContent(this.resource.mimeType, content, this.resource.url);
+        var mimeType = this._canonicalMimeType(this.resource);
+        this.sourceFrame.setContent(mimeType, content, this.resource.url);
         this._sourceFrameSetupFinished();
     },
 
+    _canonicalMimeType: function(resource)
+    {
+        return WebInspector.SourceView.DefaultMIMETypeForResourceType[resource.type] || resource.mimeType;
+    },
+
     _resourceLoadingFinished: function(event)
     {
         this._frameNeedsSetup = true;
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 265e488..eb5e012 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -65,6 +65,33 @@
     this.titleElement.appendChild(this.settingsSelectElement);
 }
 
+// Taken from http://www.w3.org/TR/CSS21/propidx.html.
+WebInspector.StylesSidebarPane.InheritedProperties = [
+    "azimuth", "border-collapse", "border-spacing", "caption-side", "color", "cursor", "direction", "elevation",
+    "empty-cells", "font-family", "font-size", "font-style", "font-variant", "font-weight", "font", "letter-spacing",
+    "line-height", "list-style-image", "list-style-position", "list-style-type", "list-style", "orphans", "pitch-range",
+    "pitch", "quotes", "richness", "speak-header", "speak-numeral", "speak-punctuation", "speak", "speech-rate", "stress",
+    "text-align", "text-indent", "text-transform", "visibility", "voice-family", "volume", "white-space", "widows", "word-spacing"
+].keySet();
+
+// Keep in sync with RenderStyleConstants.h PseudoId enum. Array below contains pseudo id names for corresponding enum indexes.
+// First item is empty due to its artificial NOPSEUDO nature in the enum.
+// FIXME: find a way of generating this mapping or getting it from combination of RenderStyleConstants and CSSSelector.cpp at
+// runtime.
+WebInspector.StylesSidebarPane.PseudoIdNames = [
+    "", "first-line", "first-letter", "before", "after", "selection", "", "-webkit-scrollbar", "-webkit-file-upload-button",
+    "-webkit-input-placeholder", "-webkit-slider-thumb", "-webkit-search-cancel-button", "-webkit-search-decoration",
+    "-webkit-search-results-decoration", "-webkit-search-results-button", "-webkit-media-controls-panel",
+    "-webkit-media-controls-play-button", "-webkit-media-controls-mute-button", "-webkit-media-controls-timeline",
+    "-webkit-media-controls-timeline-container", "-webkit-media-controls-volume-slider",
+    "-webkit-media-controls-volume-slider-container", "-webkit-media-controls-current-time-display",
+    "-webkit-media-controls-time-remaining-display", "-webkit-media-controls-seek-back-button", "-webkit-media-controls-seek-forward-button",
+    "-webkit-media-controls-fullscreen-button", "-webkit-media-controls-rewind-button", "-webkit-media-controls-return-to-realtime-button",
+    "-webkit-media-controls-toggle-closed-captions-button", "-webkit-media-controls-status-display", "-webkit-scrollbar-thumb",
+    "-webkit-scrollbar-button", "-webkit-scrollbar-track", "-webkit-scrollbar-track-piece", "-webkit-scrollbar-corner",
+    "-webkit-resizer", "-webkit-input-list-button", "-webkit-inner-spin-button", "-webkit-outer-spin-button"
+];
+
 WebInspector.StylesSidebarPane.prototype = {
     _settingsLoaded: function()
     {
@@ -102,76 +129,173 @@
 
         if (!node) {
             body.removeChildren();
-            this.sections = [];
+            this.sections = {};
             return;
         }
 
-        var self = this;
-        function callback(styles)
+        function getStylesCallback(styles)
         {
-            if (!styles)
-                return;
-            node._setStyles(styles.computedStyle, styles.inlineStyle, styles.styleAttributes, styles.matchedCSSRules);
-            self._update(refresh, body, node, editedSection, forceUpdate);
+            if (styles)
+                this._rebuildUpdate(node, styles);
         }
 
-        InjectedScriptAccess.get(node.injectedScriptId).getStyles(node.id, !WebInspector.settings.showUserAgentStyles, callback);
+        function getComputedStyleCallback(computedStyle)
+        {
+            if (computedStyle)
+                this._refreshUpdate(node, computedStyle, editedSection);
+        };
+
+        if (refresh)
+            InspectorBackend.getComputedStyle(WebInspector.Callback.wrap(getComputedStyleCallback.bind(this)), node.id);
+        else
+            InspectorBackend.getStyles(WebInspector.Callback.wrap(getStylesCallback.bind(this)), node.id, !WebInspector.settings.showUserAgentStyles);
     },
 
-    _update: function(refresh, body, node, editedSection, forceUpdate)
+    _refreshUpdate: function(node, computedStyle, editedSection)
     {
-        if (!refresh) {
-            body.removeChildren();
-            this.sections = [];
+        for (var pseudoId in this.sections) {
+            var styleRules = this._refreshStyleRules(this.sections[pseudoId], computedStyle);
+            var usedProperties = {};
+            var disabledComputedProperties = {};
+            this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);
+            this._refreshSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, editedSection);
         }
+    },
+
+    _rebuildUpdate: function(node, styles)
+    {
+        this.bodyElement.removeChildren();
+        var styleRules = this._rebuildStyleRules(node, styles);
+        var usedProperties = {};
+        var disabledComputedProperties = {};
+        this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);
+        this.sections[0] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, 0);
+
+        for (var i = 0; i < styles.pseudoElements.length; ++i) {
+            var pseudoElementCSSRules = styles.pseudoElements[i];
+
+            styleRules = [];
+            var pseudoId = pseudoElementCSSRules.pseudoId;
+
+            var entry = { isStyleSeparator: true, pseudoId: pseudoId };
+            styleRules.push(entry);
+
+            // Add rules in reverse order to match the cascade order.
+            for (var j = pseudoElementCSSRules.rules.length - 1; j >= 0; --j) {
+                var rule = WebInspector.CSSStyleDeclaration.parseRule(pseudoElementCSSRules.rules[j]);
+                styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+            }
+            usedProperties = {};
+            disabledComputedProperties = {};
+            this._markUsedProperties(styleRules, usedProperties, disabledComputedProperties);
+            this.sections[pseudoId] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, disabledComputedProperties, pseudoId);
+        }
+    },
+
+    _refreshStyleRules: function(sections, computedStyle)
+    {
+        var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(computedStyle);
+        var styleRules = [];
+        for (var i = 0; sections && i < sections.length; ++i) {
+            var section = sections[i];
+            if (section instanceof WebInspector.BlankStylePropertiesSection)
+                continue;
+            if (section.computedStyle)
+                section.styleRule.style = nodeComputedStyle;
+            var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule };
+            styleRules.push(styleRule);
+        }
+        return styleRules;
+    },
+
+    _rebuildStyleRules: function(node, styles)
+    {
+        var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+        this.sections = {};
 
         var styleRules = [];
 
-        if (refresh) {
-            for (var i = 0; i < this.sections.length; ++i) {
-                var section = this.sections[i];
-                if (section instanceof WebInspector.BlankStylePropertiesSection)
-                    continue;
-                if (section.computedStyle)
-                    section.styleRule.style = node.ownerDocument.defaultView.getComputedStyle(node);
-                var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule };
-                styleRules.push(styleRule);
-            }
-        } else {
-            var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
-            styleRules.push({ computedStyle: true, selectorText: WebInspector.UIString("Computed Style"), style: computedStyle, editable: false });
+        styleRules.push({ computedStyle: true, selectorText: WebInspector.UIString("Computed Style"), style: nodeComputedStyle, editable: false });
 
-            var nodeName = node.nodeName.toLowerCase();
-            for (var i = 0; i < node.attributes.length; ++i) {
-                var attr = node.attributes[i];
-                if (attr.style) {
-                    var attrStyle = { style: attr.style, editable: false };
-                    attrStyle.subtitle = WebInspector.UIString("element’s “%s” attribute", attr.name);
-                    attrStyle.selectorText = nodeName + "[" + attr.name;
-                    if (attr.value.length)
-                        attrStyle.selectorText += "=" + attr.value;
-                    attrStyle.selectorText += "]";
-                    styleRules.push(attrStyle);
-                }
-            }
-
-            // Always Show element's Style Attributes
-            if (node.nodeType === Node.ELEMENT_NODE) {
-                var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: node.style, isAttribute: true };
-                inlineStyle.subtitle = WebInspector.UIString("element’s “%s” attribute", "style");
-                styleRules.push(inlineStyle);
-            }
-
-            var matchedStyleRules = node.ownerDocument.defaultView.getMatchedCSSRules(node, "", !WebInspector.settings.showUserAgentStyles);
-            if (matchedStyleRules) {
-                // Add rules in reverse order to match the cascade order.
-                for (var i = (matchedStyleRules.length - 1); i >= 0; --i) {
-                    var rule = matchedStyleRules[i];
-                    styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
-                }
-            }
+        var styleAttributes = {};
+        for (var name in styles.styleAttributes) {
+            var attrStyle = { style: new WebInspector.CSSStyleDeclaration(styles.styleAttributes[name]), editable: false };
+            attrStyle.subtitle = WebInspector.UIString("element’s “%s” attribute", name);
+            attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName) + "[" + name;
+            if (node.getAttribute(name))
+                attrStyle.selectorText += "=" + node.getAttribute(name);
+            attrStyle.selectorText += "]";
+            styleRules.push(attrStyle);
         }
 
+        // Show element's Style Attributes
+        if (styles.inlineStyle && node.nodeType === Node.ELEMENT_NODE) {
+            var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: new WebInspector.CSSStyleDeclaration(styles.inlineStyle), isAttribute: true };
+            inlineStyle.subtitle = WebInspector.UIString("element’s “%s” attribute", "style");
+            styleRules.push(inlineStyle);
+        }
+
+        // Add rules in reverse order to match the cascade order.
+        for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {
+            var rule = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]);
+            styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+        }
+
+        // Collect used properties first in order to identify inherited ones.
+        var userPropertyNames = {};
+        for (var i = 0; i < styleRules.length; ++i) {
+            var styleRule = styleRules[i];
+            if (styleRule.computedStyle)
+                continue;
+            var style = styleRule.style;
+            for (var j = 0; j < style.length; ++j)
+                userPropertyNames[style[j]] = true;
+        }
+
+        // Walk the node structure and identify styles with inherited properties.
+        var parentStyles = styles.parent;
+        var parentNode = node.parentNode;
+        function insertInheritedNodeSeparator(node)
+        {
+            var entry = {};
+            entry.isStyleSeparator = true;
+            entry.node = node;
+            styleRules.push(entry);
+        }
+
+        while (parentStyles) {
+            var separatorInserted = false;
+            if (parentStyles.inlineStyle) {
+                if (this._containsInherited(parentStyles.inlineStyle)) {
+                    var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: new WebInspector.CSSStyleDeclaration(parentStyles.inlineStyle), isAttribute: true, isInherited: true };
+                    inlineStyle.subtitle = WebInspector.UIString("element’s “%s” attribute", "style");
+                    if (!separatorInserted) {
+                        insertInheritedNodeSeparator(parentNode);
+                        separatorInserted = true;
+                    }
+                    styleRules.push(inlineStyle);
+                }
+            }
+
+            for (var i = parentStyles.matchedCSSRules.length - 1; i >= 0; --i) {
+                var rulePayload = parentStyles.matchedCSSRules[i];
+                if (!this._containsInherited(rulePayload.style))
+                    continue;
+                var rule = WebInspector.CSSStyleDeclaration.parseRule(rulePayload);
+                if (!separatorInserted) {
+                    insertInheritedNodeSeparator(parentNode);
+                    separatorInserted = true;
+                }
+                styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule, isInherited: true });
+            }
+            parentStyles = parentStyles.parent;
+            parentNode = parentNode.parentNode;
+        }
+        return styleRules;
+    },
+
+    _markUsedProperties: function(styleRules, usedProperties, disabledComputedProperties)
+    {
         function deleteDisabledProperty(style, name)
         {
             if (!style || !name)
@@ -184,14 +308,12 @@
                 delete style.__disabledProperties[name];
         }
 
-        var usedProperties = {};
-        var disabledComputedProperties = {};
         var priorityUsed = false;
 
         // Walk the style rules and make a list of all used and overloaded properties.
         for (var i = 0; i < styleRules.length; ++i) {
             var styleRule = styleRules[i];
-            if (styleRule.computedStyle)
+            if (styleRule.computedStyle || styleRule.isStyleSeparator)
                 continue;
             if (styleRule.section && styleRule.section.noAffect)
                 continue;
@@ -245,13 +367,12 @@
 
             // Walk in reverse to match the order !important overrides.
             for (var i = (styleRules.length - 1); i >= 0; --i) {
-                if (styleRules[i].computedStyle)
+                if (styleRules[i].computedStyle || styleRules[i].isStyleSeparator)
                     continue;
 
                 var style = styleRules[i].style;
-                var uniqueProperties = style.uniqueStyleProperties;
-                for (var j = 0; j < uniqueProperties.length; ++j) {
-                    var name = uniqueProperties[j];
+                for (var j = 0; j < style.length; ++j) {
+                    var name = style[j];
                     if (style.getPropertyPriority(name).length) {
                         if (!(name in foundPriorityProperties))
                             styleRules[i].usedProperties[name] = true;
@@ -263,60 +384,96 @@
                 }
             }
         }
+    },
 
-        if (refresh) {
-            // Walk the style rules and update the sections with new overloaded and used properties.
-            for (var i = 0; i < styleRules.length; ++i) {
-                var styleRule = styleRules[i];
-                var section = styleRule.section;
-                if (styleRule.computedStyle)
-                    section.disabledComputedProperties = disabledComputedProperties;
-                section._usedProperties = (styleRule.usedProperties || usedProperties);
-                section.update((section === editedSection) || styleRule.computedStyle);
-            }
-        } else {
-            // Make a property section for each style rule.
-            for (var i = 0; i < styleRules.length; ++i) {
-                var styleRule = styleRules[i];
-                var subtitle = styleRule.subtitle;
-                delete styleRule.subtitle;
-
-                var computedStyle = styleRule.computedStyle;
-                delete styleRule.computedStyle;
-
-                var ruleUsedProperties = styleRule.usedProperties;
-                delete styleRule.usedProperties;
-
-                var editable = styleRule.editable;
-                delete styleRule.editable;
-
-                var isAttribute = styleRule.isAttribute;
-                delete styleRule.isAttribute;
-
-                // Default editable to true if it was omitted.
-                if (typeof editable === "undefined")
-                    editable = true;
-
-                var section = new WebInspector.StylePropertiesSection(styleRule, subtitle, computedStyle, (ruleUsedProperties || usedProperties), editable);
-                if (computedStyle)
-                    section.disabledComputedProperties = disabledComputedProperties;
-                section.pane = this;
-
-                if (Preferences.styleRulesExpandedState && section.identifier in Preferences.styleRulesExpandedState)
-                    section.expanded = Preferences.styleRulesExpandedState[section.identifier];
-                else if (computedStyle)
-                    section.collapse(true);
-                else if (isAttribute && styleRule.style.length === 0)
-                    section.collapse(true);
-                else
-                    section.expand(true);
-
-                body.appendChild(section.element);
-                this.sections.push(section);
-            }
+    _refreshSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, editedSection)
+    {
+        // Walk the style rules and update the sections with new overloaded and used properties.
+        for (var i = 0; i < styleRules.length; ++i) {
+            var styleRule = styleRules[i];
+            var section = styleRule.section;
+            if (styleRule.computedStyle)
+                section.disabledComputedProperties = disabledComputedProperties;
+            section._usedProperties = (styleRule.usedProperties || usedProperties);
+            section.update((section === editedSection) || styleRule.computedStyle);
         }
     },
 
+    _rebuildSectionsForStyleRules: function(styleRules, usedProperties, disabledComputedProperties, pseudoId)
+    {
+        // Make a property section for each style rule.
+        var sections = [];
+        for (var i = 0; i < styleRules.length; ++i) {
+            var styleRule = styleRules[i];
+            if (styleRule.isStyleSeparator) {
+                var separatorElement = document.createElement("div");
+                separatorElement.className = "styles-sidebar-separator";
+                if (styleRule.node) {
+                    var link = document.createElement("a");
+                    link.href = "";
+                    link.addEventListener("mousedown", this._selectNode.bind(this, styleRule.node.id), false);
+                    WebInspector.panels.elements.decorateNodeLabel(styleRule.node, link);
+                    separatorElement.appendChild(document.createTextNode(WebInspector.UIString("Inherited from") + " "));
+                    separatorElement.appendChild(link);
+                } else if ("pseudoId" in styleRule) {
+                    var pseudoName = WebInspector.StylesSidebarPane.PseudoIdNames[styleRule.pseudoId];
+                    if (pseudoName)
+                        separatorElement.textContent = WebInspector.UIString("Pseudo ::%s element", pseudoName);
+                    else
+                        separatorElement.textContent = WebInspector.UIString("Pseudo element");
+                }
+                this.bodyElement.appendChild(separatorElement);
+                continue;
+            }
+            var computedStyle = styleRule.computedStyle;
+
+            // Default editable to true if it was omitted.
+            var editable = styleRule.editable;
+            if (typeof editable === "undefined")
+                editable = true;
+
+            var section = new WebInspector.StylePropertiesSection(styleRule, styleRule.subtitle, styleRule.computedStyle, (styleRule.usedProperties || usedProperties), editable, styleRule.isInherited);
+            if (computedStyle)
+                section.disabledComputedProperties = disabledComputedProperties;
+            section.pane = this;
+
+            if (Preferences.styleRulesExpandedState && section.identifier in Preferences.styleRulesExpandedState)
+                section.expanded = Preferences.styleRulesExpandedState[section.identifier];
+            else if (computedStyle)
+                section.collapse(true);
+            else if (styleRule.isAttribute && styleRule.style.length === 0)
+                section.collapse(true);
+            else if (styleRule.isInherited)
+                section.collapse(true);
+            else
+                section.expand(true);
+
+            this.bodyElement.appendChild(section.element);
+            sections.push(section);
+        }
+        return sections;
+    },
+
+    _selectNode: function(nodeId, e)
+    {
+        WebInspector.updateFocusedNode(nodeId);
+        e.preventDefault();
+    },
+
+    _containsInherited: function(payload)
+    {
+        var properties = [];
+        for (var i = 0; i < payload.properties.length; ++i) {
+            var property = payload.properties[i];
+            // Does this style contain non-overriden inherited property?
+            if (property.name in WebInspector.StylesSidebarPane.InheritedProperties)
+                return true;
+        }
+        if (payload.disabled && this._containsInherited(payload.disabled))
+            return true;
+        return false;
+    },
+
     _changeSetting: function(event)
     {
         var options = this.settingsSelectElement.options;
@@ -340,8 +497,11 @@
         var selectedOption = this.settingsSelectElement[this.settingsSelectElement.selectedIndex];
         WebInspector.settings.colorFormat = selectedOption.value;
 
-        for (var i = 0; i < this.sections.length; ++i)
-            this.sections[i].update(true);
+        for (var pseudoId in this.sections) {
+            var sections = this.sections[pseudoId];
+            for (var i = 0; i < sections.length; ++i)
+                sections[i].update(true);
+        }
     },
 
     _createNewRule: function(event)
@@ -354,39 +514,43 @@
         var blankSection = new WebInspector.BlankStylePropertiesSection(appropriateSelectorForNode(this.node, true));
         blankSection.pane = this;
 
-        var elementStyleSection = this.sections[1];
+        var elementStyleSection = this.sections[0][1];
         this.bodyElement.insertBefore(blankSection.element, elementStyleSection.element.nextSibling);
 
-        this.sections.splice(2, 0, blankSection);
+        this.sections[0].splice(2, 0, blankSection);
 
         return blankSection;
     },
 
     removeSection: function(section)
     {
-        var index = this.sections.indexOf(section);
-        if (index === -1)
-            return;
-        this.sections.splice(index, 1);
-        if (section.element.parentNode)
-            section.element.parentNode.removeChild(section.element);
+        for (var pseudoId in this.sections) {
+            var sections = this.sections[pseudoId];
+            var index = sections.indexOf(section);
+            if (index === -1)
+                continue;
+            sections.splice(index, 1);
+            if (section.element.parentNode)
+                section.element.parentNode.removeChild(section.element);
+        }
     }
 }
 
 WebInspector.StylesSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
 
-WebInspector.StylePropertiesSection = function(styleRule, subtitle, computedStyle, usedProperties, editable)
+WebInspector.StylePropertiesSection = function(styleRule, subtitle, computedStyle, usedProperties, editable, isInherited)
 {
     WebInspector.PropertiesSection.call(this, styleRule.selectorText);
 
-    this.titleElement.addEventListener("click", this._clickSelector.bind(this), false);
-    this.titleElement.addEventListener("dblclick", this._dblclickSelector.bind(this), false);
-    this.element.addEventListener("dblclick", this._dblclickEmptySpace.bind(this), false);
+    this.titleElement.addEventListener("dblclick", this._handleSelectorDoubleClick.bind(this), false);
+    this.titleElement.addEventListener("click", this._handleSelectorClick.bind(this), false);
+    this.element.addEventListener("dblclick", this._handleEmptySpaceDoubleClick.bind(this), false);
 
     this.styleRule = styleRule;
     this.rule = this.styleRule.rule;
     this.computedStyle = computedStyle;
     this.editable = (editable && !computedStyle);
+    this.isInherited = isInherited;
 
     // Prevent editing the user agent and user rules.
     var isUserAgent = this.rule && this.rule.isUserAgent;
@@ -398,38 +562,34 @@
 
     this._usedProperties = usedProperties;
 
+    if (this.rule)
+        this.titleElement.addStyleClass("styles-selector");
+
     if (computedStyle) {
         this.element.addStyleClass("computed-style");
 
         if (WebInspector.settings.showInheritedComputedStyleProperties)
             this.element.addStyleClass("show-inherited");
 
-        var showInheritedLabel = document.createElement("label");
-        var showInheritedInput = document.createElement("input");
-        showInheritedInput.type = "checkbox";
-        showInheritedInput.checked = WebInspector.settings.showInheritedComputedStyleProperties;
-
         var computedStyleSection = this;
         var showInheritedToggleFunction = function(event) {
-            WebInspector.settings.showInheritedComputedStyleProperties = showInheritedInput.checked;
+            WebInspector.settings.showInheritedComputedStyleProperties = computedStyleSection._showInheritedCheckbox.checked();
             if (WebInspector.settings.showInheritedComputedStyleProperties)
                 computedStyleSection.element.addStyleClass("show-inherited");
             else
                 computedStyleSection.element.removeStyleClass("show-inherited");
-            event.stopPropagation();
         };
 
-        showInheritedLabel.addEventListener("click", showInheritedToggleFunction, false);
+        this._showInheritedCheckbox = new WebInspector.Checkbox(WebInspector.UIString("Show inherited"),
+                                                                showInheritedToggleFunction,
+                                                                WebInspector.settings.showInheritedComputedStyleProperties);
 
-        showInheritedLabel.appendChild(showInheritedInput);
-        showInheritedLabel.appendChild(document.createTextNode(WebInspector.UIString("Show inherited")));
-        this.subtitleElement.appendChild(showInheritedLabel);
+        this.subtitleElement.appendChild(this._showInheritedCheckbox.element);
     } else {
         if (!subtitle) {
             if (this.styleRule.parentStyleSheet && this.styleRule.parentStyleSheet.href) {
                 var url = this.styleRule.parentStyleSheet.href;
-                subtitle = WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url));
-                this.subtitleElement.addStyleClass("file");
+                this.subtitleElement.appendChild(WebInspector.linkifyResourceAsNode(url, "resources", this.rule.sourceLine + 1));
             } else if (isUserAgent)
                 subtitle = WebInspector.UIString("user agent stylesheet");
             else if (isUser)
@@ -439,8 +599,10 @@
             else
                 subtitle = WebInspector.UIString("inline stylesheet");
         }
-
-        this.subtitle = subtitle;
+        if (isInherited)
+            this.element.addStyleClass("show-inherited");
+        if (subtitle)
+            this.subtitle = subtitle;
     }
 
     this.identifier = styleRule.selectorText;
@@ -484,6 +646,12 @@
 
     isPropertyInherited: function(property)
     {
+        if (this.isInherited) {
+            // While rendering inherited stylesheet, reverse meaning of this property.
+            // Render truly inherited properties with black, i.e. return them as non-inherited.
+            return !(property in WebInspector.StylesSidebarPane.InheritedProperties);
+        }
+
         if (!this.computedStyle || !this._usedProperties || this.noAffect)
             return false;
         // These properties should always show for Computed Style.
@@ -496,6 +664,11 @@
         if (this.computedStyle || !this._usedProperties || this.noAffect)
             return false;
 
+        if (this.isInherited && !(property in WebInspector.StylesSidebarPane.InheritedProperties)) {
+            // In the inherited sections, only show overrides for the potentially inherited properties.
+            return false;
+        }
+
         var used = (property in this.usedProperties);
         if (used || !shorthand)
             return !used;
@@ -512,11 +685,6 @@
         return true;
     },
 
-    isInspectorStylesheet: function()
-    {
-        return (this.styleRule.parentStyleSheet === WebInspector.panels.elements.stylesheet);
-    },
-
     update: function(full)
     {
         if (full || this.computedStyle) {
@@ -546,9 +714,12 @@
         var style = this.styleRule.style;
 
         var foundShorthands = {};
-        var uniqueProperties = style.uniqueStyleProperties;
         var disabledProperties = style.__disabledPropertyValues || {};
 
+        var uniqueProperties = [];
+        for (var i = 0; i < style.length; ++i)
+            uniqueProperties.push(style[i]);
+
         for (var name in disabledProperties)
             uniqueProperties.push(name);
 
@@ -599,26 +770,28 @@
         return item;
     },
 
-    _clickSelector: function(event)
+    _handleEmptySpaceDoubleClick: function(event)
     {
-        event.stopPropagation();
-
-        // Don't search "Computed Styles", "Style Attribute", or Mapped Attributes.
-        if (this.computedStyle || !this.rule || this.rule.isUser)
+        if (event.target.hasStyleClass("header")) {
+            event.stopPropagation();
             return;
-
-        var searchElement = document.getElementById("search");
-        searchElement.value = this.styleRule.selectorText;
-        WebInspector.performSearch({ target: searchElement });
-    },
-
-    _dblclickEmptySpace: function(event)
-    {
+        }
         this.expand();
         this.addNewBlankProperty().startEditing();
     },
 
-    _dblclickSelector: function(event)
+    _handleSelectorClick: function(event)
+    {
+        event.stopPropagation();
+    },
+
+    _handleSelectorDoubleClick: function(event)
+    {
+        this._startEditingOnMouseEvent();
+        event.stopPropagation();
+    },
+
+    _startEditingOnMouseEvent: function()
     {
         if (!this.editable)
             return;
@@ -633,7 +806,6 @@
             return;
 
         this.startEditingSelector();
-        event.stopPropagation();
     },
 
     startEditingSelector: function()
@@ -665,16 +837,14 @@
             return moveToNextIfNeeded.call(this);
 
         var self = this;
-        function callback(result)
+        function callback(newRulePayload, doesAffectSelectedNode)
         {
-            if (!result) {
+            if (!newRulePayload) {
                 // Invalid Syntax for a Selector
                 moveToNextIfNeeded.call(self);
                 return;
             }
 
-            var newRulePayload = result[0];
-            var doesAffectSelectedNode = result[1];
             if (!doesAffectSelectedNode) {
                 self.noAffect = true;
                 self.element.addStyleClass("no-affect");
@@ -697,7 +867,7 @@
             moveToNextIfNeeded.call(self);
         }
 
-        InjectedScriptAccess.get(this.rule.injectedScriptId).applyStyleRuleText(this.rule.id, newContent, this.pane.node.id, callback);
+        InspectorBackend.setRuleSelector(WebInspector.Callback.wrap(callback), this.rule.id, newContent, this.pane.node.id);
     },
 
     editingSelectorCancelled: function()
@@ -724,17 +894,14 @@
     editingSelectorCommitted: function(element, newContent, oldContent, context)
     {
         var self = this;
-        function callback(result)
+        function callback(rule, doesSelectorAffectSelectedNode)
         {
-            if (!result) {
+            if (!rule) {
                 // Invalid Syntax for a Selector
                 self.editingSelectorCancelled();
                 return;
             }
 
-            var rule = result[0];
-            var doesSelectorAffectSelectedNode = result[1];
-
             var styleRule = WebInspector.CSSStyleDeclaration.parseRule(rule);
             styleRule.rule = rule;
 
@@ -751,7 +918,7 @@
             self.addNewBlankProperty().startEditing();
         }
 
-        InjectedScriptAccess.get(this.pane.node.injectedScriptId).addStyleSelector(newContent, this.pane.node.id, callback);
+        InspectorBackend.addRule(WebInspector.Callback.wrap(callback), newContent, this.pane.node.id);
     },
 
     editingSelectorCancelled: function()
@@ -994,7 +1161,7 @@
                 return container;
             }
 
-            var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b)/g;
+            var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;
             var colorProcessor = processValue.bind(window, colorRegex, processColor, null);
 
             valueElement.appendChild(processValue(/url\(([^)]+)\)/g, linkifyURL, colorProcessor, value));
@@ -1058,7 +1225,7 @@
             self.updateAll(true);
         }
 
-        InjectedScriptAccess.get(this.style.injectedScriptId).toggleStyleEnabled(this.style.id, this.name, disabled, callback);
+        InspectorBackend.toggleStyleEnabled(WebInspector.Callback.wrap(callback), this.style.id, this.name, disabled);
     },
 
     updateState: function()
@@ -1211,7 +1378,6 @@
         selection.removeAllRanges();
         selection.addRange(finalSelectionRange);
 
-        event.preventDefault();
         event.handled = true;
 
         if (!this.originalCSSText) {
@@ -1221,7 +1387,7 @@
         } else {
             // Restore the original CSS text before applying user changes. This is needed to prevent
             // new properties from sticking around if the user adds one, then removes it.
-            InjectedScriptAccess.get(this.style.injectedScriptId).setStyleText(this.style.id, this.originalCSSText);
+            InspectorBackend.setStyleText(WebInspector.Callback.wrap(null), this.style.id, this.originalCSSText);
         }
 
         this.applyStyleText(this.listItemElement.textContent);
@@ -1241,7 +1407,7 @@
         if (this._newProperty)
             this.treeOutline.removeChild(this);
         else if (this.originalCSSText) {
-            InjectedScriptAccess.get(this.style.injectedScriptId).setStyleText(this.style.id, this.originalCSSText);
+            InspectorBackend.setStyleText(WebInspector.Callback.wrap(null), this.style.id, this.originalCSSText);
 
             if (this.treeOutline.section && this.treeOutline.section.pane)
                 this.treeOutline.section.pane.dispatchEventToListeners("style edited");
@@ -1314,7 +1480,8 @@
     {
         var section = this.treeOutline.section;
         var elementsPanel = WebInspector.panels.elements;
-        var styleTextLength = styleText.trim().length;
+        styleText = styleText.replace(/\s/g, " ").trim(); // replace &nbsp; with whitespace.
+        var styleTextLength = styleText.length;
         if (!styleTextLength && updateInterface) {
             if (this._newProperty) {
                 // The user deleted everything, so remove the tree element and update.
@@ -1327,9 +1494,9 @@
         }
 
         var self = this;
-        function callback(result)
+        function callback(success, newPayload, changedProperties)
         {
-            if (!result) {
+            if (!success) {
                 // The user typed something, but it didn't parse. Just abort and restore
                 // the original title for this property.  If this was a new attribute and
                 // we couldn't parse, then just remove it.
@@ -1342,8 +1509,6 @@
                 return;
             }
 
-            var newPayload = result[0];
-            var changedProperties = result[1];
             elementsPanel.removeStyleChange(section.identifier, self.style, self.name);
 
             if (!styleTextLength) {
@@ -1361,12 +1526,8 @@
 
             if (updateInterface)
                 self.updateAll(true);
-
-            if (!section.rule)
-                WebInspector.panels.elements.treeOutline.update();
         }
-
-        InjectedScriptAccess.get(this.style.injectedScriptId).applyStyleText(this.style.id, styleText.trim(), this.name, callback);
+        InspectorBackend.applyStyleText(WebInspector.Callback.wrap(callback), this.style.id, styleText, this.name);
     }
 }
 
diff --git a/WebCore/inspector/front-end/TextEditorHighlighter.js b/WebCore/inspector/front-end/TextEditorHighlighter.js
index cf0b590..4ac831e 100644
--- a/WebCore/inspector/front-end/TextEditorHighlighter.js
+++ b/WebCore/inspector/front-end/TextEditorHighlighter.js
@@ -34,24 +34,31 @@
     this._textModel = textModel;
     this._tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/html");
     this._damageCallback = damageCallback;
+    this.reset();
 }
 
 WebInspector.TextEditorHighlighter.prototype = {
     set mimeType(mimeType)
     {
         var tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);
-        if (tokenizer)
+        if (tokenizer) {
             this._tokenizer = tokenizer;
+            this._tokenizerCondition = this._tokenizer.initialCondition;
+        }
+    },
+
+    reset: function()
+    {
+        this._lastHighlightedLine = 0;
+        this._lastHighlightedColumn = 0;
+        this._tokenizerCondition = this._tokenizer.initialCondition;
     },
 
     highlight: function(endLine)
     {
         // First check if we have work to do.
-        var state = this._textModel.getAttribute(endLine - 1, "highlighter-state")
-        if (state && !state.outOfDate) {
-            // Last line is highlighted, just exit.
+        if (endLine <= this._lastHighlightedLine)
             return;
-        }
 
         this._requestedEndLine = endLine;
 
@@ -60,110 +67,66 @@
             return;
         }
 
-        // We will be highlighting. First rewind to the last highlighted line to gain proper highlighter context.
-        var startLine = endLine;
-        while (startLine > 0) {
-            var state = this._textModel.getAttribute(startLine - 1, "highlighter-state");
-            if (state && !state.outOfDate)
-                break;
-            startLine--;
-        }
-
         // Do small highlight synchronously. This will provide instant highlight on PageUp / PageDown, gentle scrolling.
-        var toLine = Math.min(startLine + 200, endLine);
-        this._highlightInChunks(startLine, toLine);
+        this._highlightInChunks(endLine);
 
         // Schedule tail highlight if necessary.
-        if (endLine > toLine)
-            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, toLine, endLine), 100);
+        if (this._lastHighlightedLine < endLine)
+            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, endLine), 100);
     },
 
-    _highlightInChunks: function(startLine, endLine)
+    _highlightInChunks: function(endLine)
     {
         delete this._highlightTimer;
 
         // First we always check if we have work to do. Could be that user scrolled back and we can quit.
-        var state = this._textModel.getAttribute(this._requestedEndLine - 1, "highlighter-state");
-        if (state && !state.outOfDate)
+        if (this._requestedEndLine <= this._lastHighlightedLine)
             return;
 
         if (this._requestedEndLine !== endLine) {
             // User keeps updating the job in between of our timer ticks. Just reschedule self, don't eat CPU (they must be scrolling).
-            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, startLine, this._requestedEndLine), 100);
+            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, this._requestedEndLine), 100);
             return;
         }
 
-        // Highlight 500 lines chunk.
-        var toLine = Math.min(startLine + 500, this._requestedEndLine);
-        this._highlightLines(startLine, toLine);
+        this._highlightLines(this._requestedEndLine);
 
         // Schedule tail highlight if necessary.
-        if (toLine < this._requestedEndLine)
-            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, toLine, this._requestedEndLine), 10);
+        if (this._lastHighlightedLine < this._requestedEndLine)
+            this._highlightTimer = setTimeout(this._highlightInChunks.bind(this, this._requestedEndLine), 10);
     },
 
-    updateHighlight: function(startLine, endLine)
+    _highlightLines: function(endLine)
     {
-        // Start line was edited, we should highlight everything until endLine synchronously.
-        if (startLine) {
-            var state = this._textModel.getAttribute(startLine - 1, "highlighter-state");
-            if (!state || state.outOfDate) {
-                // Highlighter did not reach this point yet, nothing to update. It will reach it on subsequent timer tick and do the job.
-                return;
-            }
+        // Tokenizer is stateless and reused accross viewers, restore its condition before highlight and save it after.
+        this._tokenizer.condition = this._tokenizerCondition;
+        var tokensCount = 0;
+        for (var lineNumber = this._lastHighlightedLine; lineNumber < endLine; ++lineNumber) {
+            var line = this._textModel.line(lineNumber);
+            this._tokenizer.line = line;
+            var attributes = this._textModel.getAttribute(lineNumber, "highlight") || {};
+
+            // Highlight line.
+            do {
+                var newColumn = this._tokenizer.nextToken(this._lastHighlightedColumn);
+                var tokenType = this._tokenizer.tokenType;
+                if (tokenType)
+                    attributes[this._lastHighlightedColumn] = { length: newColumn - this._lastHighlightedColumn, tokenType: tokenType, subTokenizer: this._tokenizer.subTokenizer };
+                this._lastHighlightedColumn = newColumn;
+                if (++tokensCount > 1000)
+                    break;
+            } while (this._lastHighlightedColumn < line.length)
+
+            this._textModel.setAttribute(lineNumber, "highlight", attributes);
+            if (this._lastHighlightedColumn < line.length) {
+                // Too much work for single chunk - exit.
+                break;
+            } else
+                this._lastHighlightedColumn = 0;
         }
 
-        var restored = this._highlightLines(startLine, endLine);
-
-        // Set invalidated flag to the subsequent lines.
-        for (var i = endLine; i < this._textModel.linesCount; ++i) {
-            var highlighterState = this._textModel.getAttribute(i, "highlighter-state");
-            if (highlighterState)
-                highlighterState.outOfDate = !restored;
-            else
-                return;
-        }
-    },
-
-    _highlightLines: function(startLine, endLine)
-    {
-        // Restore highlighter context taken from previous line.
-        var state = this._textModel.getAttribute(startLine - 1, "highlighter-state");
-        if (state)
-            this._tokenizer.condition = state.postCondition;
-        else
-            this._tokenizer.condition = this._tokenizer.initialCondition;
-
-        for (var i = startLine; i < endLine; ++i) {
-            state = {};
-            state.preCondition = this._tokenizer.condition;
-            state.attributes = {};
-
-            this._lex(this._textModel.line(i), i, state.attributes);
-
-            state.postCondition = this._tokenizer.condition;
-            this._textModel.setAttribute(i, "highlighter-state", state);
-
-            var nextLineState = this._textModel.getAttribute(i + 1, "highlighter-state");
-            if (nextLineState && this._tokenizer.hasCondition(nextLineState.preCondition)) {
-                // Following lines are up to date, no need re-highlight.
-                this._damageCallback(startLine, i + 1);
-                return true;
-            }
-        }
-        this._damageCallback(startLine, endLine);
-        return false;
-    },
-
-    _lex: function(line, lineNumber, attributes) {
-         this._tokenizer.line = line;
-         var column = 0;
-         do {
-             var newColumn = this._tokenizer.nextToken(column);
-             var tokenType = this._tokenizer.tokenType;
-             if (tokenType)
-                 attributes[column] = { length: newColumn - column, tokenType: tokenType };
-             column = newColumn;
-         } while (column < line.length)
+        this._damageCallback(this._lastHighlightedLine, lineNumber);
+        this._tokenizerCondition = this._tokenizer.condition;
+        this._lastHighlightedLine = lineNumber;
     }
 }
diff --git a/WebCore/inspector/front-end/TextEditorModel.js b/WebCore/inspector/front-end/TextEditorModel.js
index e56c269..f23ce76 100644
--- a/WebCore/inspector/front-end/TextEditorModel.js
+++ b/WebCore/inspector/front-end/TextEditorModel.js
@@ -200,6 +200,9 @@
 
     copyRange: function(range)
     {
+        if (!range)
+            range = new WebInspector.TextRange(0, 0, this._lines.length - 1, this._lines[this._lines.length - 1].length);
+
         var clip = [];
         if (range.startLine === range.endLine) {
             clip.push(this._lines[range.startLine].substring(range.startColumn, range.endColumn));
diff --git a/WebCore/inspector/front-end/TextPrompt.js b/WebCore/inspector/front-end/TextPrompt.js
index 8554a28..d179a9a 100644
--- a/WebCore/inspector/front-end/TextPrompt.js
+++ b/WebCore/inspector/front-end/TextPrompt.js
@@ -99,6 +99,22 @@
                 }
                 defaultAction.call(this);
                 break;
+            case "U+0041": // Ctrl+A = Move caret to the start of prompt on non-Mac.
+                if (!WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {
+                    handled = true;
+                    this._moveCaretToStartOfPrompt();
+                    break;
+                }
+                defaultAction.call(this);
+                break;
+            case "U+0045": // Ctrl+E = Move caret to the end of prompt on non-Mac.
+                if (!WebInspector.isMac() && event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {
+                    handled = true;
+                    this.moveCaretToEndOfPrompt();
+                    break;
+                }
+                defaultAction.call(this);
+                break;
             default:
                 defaultAction.call(this);
                 break;
@@ -149,6 +165,7 @@
             return;
 
         this._userEnteredRange.deleteContents();
+        this.element.pruneEmptyTextNodes();
 
         var userTextNode = document.createTextNode(this._userEnteredText);
         this._userEnteredRange.insertNode(userTextNode);
@@ -171,7 +188,7 @@
             this._completeTimeout = setTimeout(this.complete.bind(this, true), 250);
     },
 
-    complete: function(auto)
+    complete: function(auto, reverse)
     {
         this.clearAutoComplete(true);
         var selection = window.getSelection();
@@ -184,10 +201,10 @@
         if (auto && !this.isCaretAtEndOfPrompt())
             return;
         var wordPrefixRange = selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, this.completionStopCharacters, this.element, "backward");
-        this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange));
+        this.completions(wordPrefixRange, auto, this._completionsReady.bind(this, selection, auto, wordPrefixRange, reverse));
     },
 
-    _completionsReady: function(selection, auto, originalWordPrefixRange, completions)
+    _completionsReady: function(selection, auto, originalWordPrefixRange, reverse, completions)
     {
         if (!completions || !completions.length)
             return;
@@ -211,10 +228,13 @@
                 if (completions[i] === currentText)
                     foundIndex = i;
 
-            if (foundIndex === null || (foundIndex + 1) >= completions.length)
+            var nextIndex = foundIndex + (reverse ? -1 : 1);
+            if (foundIndex === null || nextIndex >= completions.length)
                 var completionText = completions[0];
+            else if (nextIndex < 0)
+                var completionText = completions[completions.length - 1];
             else
-                var completionText = completions[foundIndex + 1];
+                var completionText = completions[nextIndex];
         }
 
         var wordPrefixLength = originalWordPrefixRange.toString().length;
@@ -223,6 +243,7 @@
         this._userEnteredText = fullWordRange.toString();
 
         fullWordRange.deleteContents();
+        this.element.pruneEmptyTextNodes();
 
         var finalSelectionRange = document.createRange();
 
@@ -334,6 +355,18 @@
         return true;
     },
 
+    _moveCaretToStartOfPrompt: function()
+    {
+        var selection = window.getSelection();
+        var selectionRange = document.createRange();
+
+        selectionRange.setStart(this.element, 0);
+        selectionRange.setEnd(this.element, 0);
+
+        selection.removeAllRanges();
+        selection.addRange(selectionRange);
+    },
+
     moveCaretToEndOfPrompt: function()
     {
         var selection = window.getSelection();
@@ -352,7 +385,7 @@
         event.preventDefault();
         event.stopPropagation();
 
-        this.complete();
+        this.complete(false, event.shiftKey);
     },
 
     _upKeyPressed: function(event)
diff --git a/WebCore/inspector/front-end/TextViewer.js b/WebCore/inspector/front-end/TextViewer.js
index 9be6a00..de04641 100644
--- a/WebCore/inspector/front-end/TextViewer.js
+++ b/WebCore/inspector/front-end/TextViewer.js
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 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
@@ -39,6 +40,10 @@
     this.element.tabIndex = 0;
 
     this.element.addEventListener("scroll", this._scroll.bind(this), false);
+    this.element.addEventListener("keydown", this._handleKeyDown.bind(this), false);
+    this.element.addEventListener("beforecopy", this._beforeCopy.bind(this), false);
+    this.element.addEventListener("copy", this._copy.bind(this), false);
+    this.element.addEventListener("dblclick", this._handleDoubleClick.bind(this), false);
 
     this._url = url;
 
@@ -75,6 +80,11 @@
         chunk.element.scrollIntoViewIfNeeded();
     },
 
+    set editCallback(editCallback)
+    {
+        this._editCallback = editCallback;
+    },
+
     addDecoration: function(lineNumber, decoration)
     {
         var chunk = this._makeLineAChunk(lineNumber);
@@ -134,7 +144,9 @@
             this._textChunks.push(chunk);
             this._linesContainerElement.appendChild(chunk.element);
         }
+
         this._indexChunks();
+        this._highlighter.reset();
         this._repaintAll();
     },
 
@@ -203,6 +215,74 @@
         }.bind(this), 50);
     },
 
+    _handleKeyDown: function()
+    {
+        if (this._editingLine || event.metaKey || event.shiftKey || event.ctrlKey || event.altKey)
+            return;
+
+        var scrollValue = 0;
+        if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Up)
+            scrollValue = -1;
+        else if (event.keyCode == WebInspector.KeyboardShortcut.KeyCodes.Down)
+            scrollValue = 1;
+        
+        if (scrollValue) {
+            event.preventDefault();
+            event.stopPropagation();
+            this.element.scrollByLines(scrollValue);
+            return;
+        }
+        
+        scrollValue = 0;
+        if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Left)
+            scrollValue = -40;
+        else if (event.keyCode == WebInspector.KeyboardShortcut.KeyCodes.Right)
+            scrollValue = 40;
+        
+        if (scrollValue) {
+            event.preventDefault();
+            event.stopPropagation();
+            this.element.scrollLeft += scrollValue;
+        }
+    },
+
+    _handleDoubleClick: function(e)
+    {
+        if (!this._editCallback)
+            return;
+
+        var lineRow = e.target.enclosingNodeOrSelfWithNodeName("TR");
+        if (!lineRow)
+            return;
+        var oldContent = lineRow.lastChild.innerHTML;
+        this._editingLine = WebInspector.startEditing(lineRow.lastChild, this._commitEditingLine.bind(this, lineRow.lineNumber, lineRow.lastChild), this._cancelEditingLine.bind(this, lineRow.lastChild, oldContent), null, true);
+    },
+
+    _commitEditingLine: function(lineNumber, element)
+    {
+        this._editCallback(lineNumber, element.textContent)
+        delete this._editingLine;
+    },
+
+    _cancelEditingLine: function(element, oldContent, e)
+    {
+        element.innerHTML = oldContent;
+        delete this._editingLine;
+    },
+
+    _beforeCopy: function(e)
+    {
+        e.preventDefault();
+    },
+
+    _copy: function(e)
+    {
+        var range = this._getSelection();
+        var text = this._textModel.copyRange(range);
+        InspectorFrontendHost.copyText(text);
+        e.preventDefault();
+    },
+
     beginUpdates: function(enabled)
     {
         this._paintCoalescingLevel++;
@@ -330,25 +410,25 @@
     _paintLine: function(lineRow, lineNumber)
     {
         var element = lineRow.lastChild;
-        var highlighterState = this._textModel.getAttribute(lineNumber, "highlighter-state");
-        var line = this._textModel.line(lineNumber);
-
-        if (!highlighterState) {
+        var highlight = this._textModel.getAttribute(lineNumber, "highlight");
+        if (!highlight) {
             if (this._rangeToMark && this._rangeToMark.startLine === lineNumber)
                 this._markedRangeElement = highlightSearchResult(element, this._rangeToMark.startColumn, this._rangeToMark.endColumn - this._rangeToMark.startColumn);
             return;
         }
 
         element.removeChildren();
+        var line = this._textModel.line(lineNumber);
 
         var plainTextStart = -1;
         for (var j = 0; j < line.length;) {
             if (j > 1000) {
                 // This line is too long - do not waste cycles on minified js highlighting.
-                plainTextStart = j;
+                if (plainTextStart === -1)
+                    plainTextStart = j;
                 break;
             }
-            var attribute = highlighterState && highlighterState.attributes[j];
+            var attribute = highlight[j];
             if (!attribute || !attribute.tokenType) {
                 if (plainTextStart === -1)
                     plainTextStart = j;
@@ -576,7 +656,18 @@
         lineNumbers.push(i + 1);
         lines.push(this._textModel.line(i));
     }
-    this._lineNumberElement.textContent = lineNumbers.join("\n");
+    if (this.linesCount === 1) {
+        // Single line chunks are typically created for decorations. Host line number in
+        // the sub-element in order to allow flexible border / margin management.
+        var innerSpan = document.createElement("span");
+        innerSpan.className = "webkit-line-number-inner";
+        innerSpan.textContent = startLine + 1;
+        var outerSpan = document.createElement("div");
+        outerSpan.className = "webkit-line-number-outer";
+        outerSpan.appendChild(innerSpan);
+        this._lineNumberElement.appendChild(outerSpan);
+    } else
+        this._lineNumberElement.textContent = lineNumbers.join("\n");
     this._lineContentElement.textContent = lines.join("\n");
 }
 
diff --git a/WebCore/inspector/front-end/TimelineAgent.js b/WebCore/inspector/front-end/TimelineAgent.js
index c9e9d64..387d491 100644
--- a/WebCore/inspector/front-end/TimelineAgent.js
+++ b/WebCore/inspector/front-end/TimelineAgent.js
@@ -48,7 +48,12 @@
     MarkTimeline : 11,
     ResourceSendRequest : 12,
     ResourceReceiveResponse : 13,
-    ResourceFinish : 14
+    ResourceFinish : 14,
+    FunctionCall : 15,
+    ResourceReceiveData: 16,
+    GCEvent : 17,
+    MarkDOMContentEventType : 18,
+    MarkLoadEventType : 19
 };
 
 WebInspector.addRecordToTimeline = function(record) {
diff --git a/WebCore/inspector/front-end/TimelineGrid.js b/WebCore/inspector/front-end/TimelineGrid.js
index 12b889a..fb93b8f 100644
--- a/WebCore/inspector/front-end/TimelineGrid.js
+++ b/WebCore/inspector/front-end/TimelineGrid.js
@@ -37,15 +37,15 @@
     this.element.appendChild(this._itemsGraphsElement);
 
     this._dividersElement = document.createElement("div");
-    this._dividersElement.id = "resources-dividers";
+    this._dividersElement.className = "resources-dividers";
     this.element.appendChild(this._dividersElement);
 
     this._eventDividersElement = document.createElement("div");
-    this._eventDividersElement.id = "resources-event-dividers";
+    this._eventDividersElement.className = "resources-event-dividers";
     this.element.appendChild(this._eventDividersElement);
 
     this._dividersLabelBarElement = document.createElement("div");
-    this._dividersLabelBarElement.id = "resources-dividers-label-bar";
+    this._dividersLabelBarElement.className = "resources-dividers-label-bar";
     this.element.appendChild(this._dividersLabelBarElement);
 }
 
@@ -135,6 +135,11 @@
         this._eventDividersElement.appendChild(divider);
     },
 
+    removeEventDividers: function()
+    {
+        this._eventDividersElement.removeChildren();
+    },
+
     setScrollAndDividerTop: function(scrollTop, dividersTop)
     {
         this._dividersElement.style.top = scrollTop + "px";
diff --git a/WebCore/inspector/front-end/TimelineOverviewPane.js b/WebCore/inspector/front-end/TimelineOverviewPane.js
index 8ae8352..7191ef8 100644
--- a/WebCore/inspector/front-end/TimelineOverviewPane.js
+++ b/WebCore/inspector/front-end/TimelineOverviewPane.js
@@ -92,7 +92,6 @@
     this.windowRight = 1.0;
 }
 
-
 WebInspector.TimelineOverviewPane.prototype = {
     _onCheckboxClicked: function (category, event) {
         if (event.target.checked)
@@ -103,8 +102,9 @@
         this.dispatchEventToListeners("filter changed");
     },
 
-    update: function(records)
+    update: function(records, showShortEvents)
     {
+        this._showShortEvents = showShortEvents;
         // Clear summary bars.
         var timelines = {};
         for (var category in this._categories) {
@@ -128,6 +128,8 @@
 
         function markTimeline(record)
         {
+            if (!(this._showShortEvents || record.isLong()))
+                return;
             var percentages = this._overviewCalculator.computeBarGraphPercentages(record);
 
             var end = Math.round(percentages.end);
@@ -161,6 +163,18 @@
         this._overviewGrid.updateDividers(true, this._overviewCalculator);
     },
 
+    updateEventDividers: function(records, dividerConstructor)
+    {
+        this._overviewGrid.removeEventDividers();
+        for (var i = 0; i < records.length; ++i) {
+            var record = records[i];
+            var positions = this._overviewCalculator.computeBarGraphPercentages(record);
+            var divider = dividerConstructor(record);
+            divider.style.left = positions.start + "%";
+            this._overviewGrid.addEventDivider(divider);
+        }
+    },
+
     setSidebarWidth: function(width)
     {
         this._overviewSidebarElement.style.width = width + "px";
@@ -175,7 +189,10 @@
     {
         this.windowLeft = 0.0;
         this.windowRight = 1.0;
-        this._setWindowPosition(0, this._overviewGrid.element.clientWidth);
+        this._overviewWindowElement.style.left = "0%";
+        this._overviewWindowElement.style.width = "100%";
+        this._leftResizeElement.style.left = "0%";
+        this._rightResizeElement.style.left = "100%";
         this._overviewCalculator.reset();
         this._overviewGrid.updateDividers(true, this._overviewCalculator);
     },
diff --git a/WebCore/inspector/front-end/TimelinePanel.js b/WebCore/inspector/front-end/TimelinePanel.js
index b6d5fde..7b3e3b0 100644
--- a/WebCore/inspector/front-end/TimelinePanel.js
+++ b/WebCore/inspector/front-end/TimelinePanel.js
@@ -37,6 +37,7 @@
     this._overviewPane.addEventListener("window changed", this._windowChanged, this);
     this._overviewPane.addEventListener("filter changed", this._refresh, this);
     this.element.appendChild(this._overviewPane.element);
+    this.element.tabIndex = 0;
 
     this._sidebarBackgroundElement = document.createElement("div");
     this._sidebarBackgroundElement.className = "sidebar timeline-sidebar-background";
@@ -75,14 +76,31 @@
     this._bottomGapElement.className = "timeline-gap";
     this._itemsGraphsElement.appendChild(this._bottomGapElement);
 
+    this._rootRecord = this._createRootRecord();
+    this._sendRequestRecords = {};
+    this._timerRecords = {};
+
+    this._calculator = new WebInspector.TimelineCalculator();
+    this._calculator._showShortEvents = false;
+    var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold, WebInspector.UIString.bind(WebInspector));
+    this._showShortRecordsTitleText = WebInspector.UIString("Show the records that are shorter than %s", shortRecordThresholdTitle);
+    this._hideShortRecordsTitleText = WebInspector.UIString("Hide the records that are shorter than %s", shortRecordThresholdTitle);
     this._createStatusbarButtons();
 
-    this._records = [];
-    this._sendRequestRecords = {};
-    this._calculator = new WebInspector.TimelineCalculator();
     this._boundariesAreValid = true;
+    this._scrollTop = 0;
+
+    this._popoverHelper = new WebInspector.PopoverHelper(this._containerElement, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true);
+
+    // Disable short events filter by default.
+    this.toggleFilterButton.toggled = true;
+    this._calculator._showShortEvents = this.toggleFilterButton.toggled;
+    this._markTimelineRecords = [];
+    this._expandOffset = 15;
 }
 
+WebInspector.TimelinePanel.shortRecordThreshold = 0.015;
+
 WebInspector.TimelinePanel.prototype = {
     toolbarItemClass: "timeline",
 
@@ -93,7 +111,7 @@
 
     get statusBarItems()
     {
-        return [this.toggleTimelineButton.element, this.clearButton.element];
+        return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element, this.recordsCounter];
     },
 
     get categories()
@@ -108,21 +126,117 @@
         return this._categories;
     },
 
+    get defaultFocusedElement()
+    {
+        return this.element;
+    },
+
+    get _recordStyles()
+    {
+        if (!this._recordStylesArray) {
+            var recordTypes = WebInspector.TimelineAgent.RecordType;
+            var recordStyles = {};
+            recordStyles[recordTypes.EventDispatch] = { title: WebInspector.UIString("Event"), category: this.categories.scripting };
+            recordStyles[recordTypes.Layout] = { title: WebInspector.UIString("Layout"), category: this.categories.rendering };
+            recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString("Recalculate Style"), category: this.categories.rendering };
+            recordStyles[recordTypes.Paint] = { title: WebInspector.UIString("Paint"), category: this.categories.rendering };
+            recordStyles[recordTypes.ParseHTML] = { title: WebInspector.UIString("Parse"), category: this.categories.loading };
+            recordStyles[recordTypes.TimerInstall] = { title: WebInspector.UIString("Install Timer"), category: this.categories.scripting };
+            recordStyles[recordTypes.TimerRemove] = { title: WebInspector.UIString("Remove Timer"), category: this.categories.scripting };
+            recordStyles[recordTypes.TimerFire] = { title: WebInspector.UIString("Timer Fired"), category: this.categories.scripting };
+            recordStyles[recordTypes.XHRReadyStateChange] = { title: WebInspector.UIString("XHR Ready State Change"), category: this.categories.scripting };
+            recordStyles[recordTypes.XHRLoad] = { title: WebInspector.UIString("XHR Load"), category: this.categories.scripting };
+            recordStyles[recordTypes.EvaluateScript] = { title: WebInspector.UIString("Evaluate Script"), category: this.categories.scripting };
+            recordStyles[recordTypes.MarkTimeline] = { title: WebInspector.UIString("Mark"), category: this.categories.scripting };
+            recordStyles[recordTypes.ResourceSendRequest] = { title: WebInspector.UIString("Send Request"), category: this.categories.loading };
+            recordStyles[recordTypes.ResourceReceiveResponse] = { title: WebInspector.UIString("Receive Response"), category: this.categories.loading };
+            recordStyles[recordTypes.ResourceFinish] = { title: WebInspector.UIString("Finish Loading"), category: this.categories.loading };
+            recordStyles[recordTypes.FunctionCall] = { title: WebInspector.UIString("Function Call"), category: this.categories.scripting };
+            recordStyles[recordTypes.ResourceReceiveData] = { title: WebInspector.UIString("Receive Data"), category: this.categories.loading };
+            recordStyles[recordTypes.GCEvent] = { title: WebInspector.UIString("GC Event"), category: this.categories.scripting };
+            recordStyles[recordTypes.MarkDOMContentEventType] = { title: WebInspector.UIString("DOMContent event"), category: this.categories.scripting };
+            recordStyles[recordTypes.MarkLoadEventType] = { title: WebInspector.UIString("Load event"), category: this.categories.scripting };
+            this._recordStylesArray = recordStyles;
+        }
+        return this._recordStylesArray;
+    },
+
     _createStatusbarButtons: function()
     {
-        this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record-profile-status-bar-item");
+        this.toggleTimelineButton = new WebInspector.StatusBarButton(WebInspector.UIString("Record"), "record-profile-status-bar-item");
         this.toggleTimelineButton.addEventListener("click", this._toggleTimelineButtonClicked.bind(this), false);
 
-        this.clearButton = new WebInspector.StatusBarButton("", "timeline-clear-status-bar-item");
-        this.clearButton.addEventListener("click", this.reset.bind(this), false);
+        this.clearButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear"), "timeline-clear-status-bar-item");
+        this.clearButton.addEventListener("click", this._clearPanel.bind(this), false);
+
+        this.toggleFilterButton = new WebInspector.StatusBarButton(this._hideShortRecordsTitleText, "timeline-filter-status-bar-item");
+        this.toggleFilterButton.addEventListener("click", this._toggleFilterButtonClicked.bind(this), false);
+
+        this.recordsCounter = document.createElement("span");
+        this.recordsCounter.className = "timeline-records-counter";
+    },
+
+    _updateRecordsCounter: function()
+    {
+        this.recordsCounter.textContent = WebInspector.UIString("%d of %d captured records are visible", this._rootRecord._visibleRecordsCount, this._rootRecord._allRecordsCount);
+    },
+
+    _updateEventDividers: function()
+    {
+        this._timelineGrid.removeEventDividers();
+        var clientWidth = this._graphRowsElement.offsetWidth - this._expandOffset;
+        for (var i = 0; i < this._markTimelineRecords.length; ++i) {
+            var record = this._markTimelineRecords[i];
+            var positions = this._calculator.computeBarGraphWindowPosition(record, clientWidth);
+            if (positions.left < 0 || positions.left >= clientWidth)
+                continue;
+
+            var divider = this._createEventDivider(record);
+            divider.style.left = (positions.left + this._expandOffset) + "px";
+
+            this._timelineGrid.addEventDivider(divider);
+        }
+        this._overviewPane.updateEventDividers(this._markTimelineRecords, this._createEventDivider.bind(this));
+    },
+
+    _createEventDivider: function(record)
+    {
+        var eventDivider = document.createElement("div");
+        eventDivider.className = "resources-event-divider";
+        var recordTypes = WebInspector.TimelineAgent.RecordType;
+
+        var eventDividerPadding = document.createElement("div");
+        eventDividerPadding.className = "resources-event-divider-padding";
+        eventDividerPadding.title = record.title;
+
+        if (record.type === recordTypes.MarkDOMContentEventType)
+            eventDivider.className += " resources-blue-divider";
+        else if (record.type === recordTypes.MarkLoadEventType)
+            eventDivider.className += " resources-red-divider";
+        else if (record.type === recordTypes.MarkTimeline) {
+            eventDivider.className += " resources-orange-divider";
+            eventDividerPadding.title = record.data.message;
+        }
+        eventDividerPadding.appendChild(eventDivider);
+        return eventDividerPadding;
     },
 
     _toggleTimelineButtonClicked: function()
     {
         if (this.toggleTimelineButton.toggled)
             InspectorBackend.stopTimelineProfiler();
-        else
+        else {
+            this._clearPanel();
             InspectorBackend.startTimelineProfiler();
+        }
+    },
+
+    _toggleFilterButtonClicked: function()
+    {
+        this.toggleFilterButton.toggled = !this.toggleFilterButton.toggled;
+        this._calculator._showShortEvents = this.toggleFilterButton.toggled;
+        this.toggleFilterButton.element.title = this._calculator._showShortEvents ? this._hideShortRecordsTitleText : this._showShortRecordsTitleText;
+        this._scheduleRefresh(true);
     },
 
     timelineWasStarted: function()
@@ -137,116 +251,71 @@
 
     addRecordToTimeline: function(record)
     {
-        this._innerAddRecordToTimeline(record, this._records);
+        if (record.type == WebInspector.TimelineAgent.RecordType.ResourceSendRequest && record.data.isMainResource) {
+            if (this._mainResourceIdentifier != record.data.identifier) {
+                // We are loading new main resource -> clear the panel. Check above is necessary since
+                // there may be several resource loads with main resource marker upon redirects, redirects are reported with
+                // the original identifier.
+                this._mainResourceIdentifier = record.data.identifier;
+                this._clearPanel();
+            }
+        }
+        this._innerAddRecordToTimeline(record, this._rootRecord);
         this._scheduleRefresh();
     },
 
-    _innerAddRecordToTimeline: function(record, collection)
-    {
-        var formattedRecord = this._formatRecord(record);
-
-        // Glue subsequent records with same category and title together if they are closer than 100ms to each other.
-        if (this._lastRecord && (!record.children || !record.children.length) &&
-                this._lastRecord.category == formattedRecord.category &&
-                this._lastRecord.title == formattedRecord.title &&
-                this._lastRecord.details == formattedRecord.details &&
-                formattedRecord.startTime - this._lastRecord.endTime < 0.1) {
-            this._lastRecord.endTime = formattedRecord.endTime;
-            this._lastRecord.count++;
-        } else {
-            collection.push(formattedRecord);
-            for (var i = 0; record.children && i < record.children.length; ++i) {
-                if (!formattedRecord.children)
-                    formattedRecord.children = [];
-                var formattedChild = this._innerAddRecordToTimeline(record.children[i], formattedRecord.children);
-                formattedChild.parent = formattedRecord;
-            }
-            this._lastRecord = record.children && record.children.length ? null : formattedRecord;
-        }
-        return formattedRecord;
-    },
-
-    _formatRecord: function(record)
+    _findParentRecord: function(record)
     {
         var recordTypes = WebInspector.TimelineAgent.RecordType;
-        if (!this._recordStyles) {
-            this._recordStyles = {};
-            this._recordStyles[recordTypes.EventDispatch] = { title: WebInspector.UIString("Event"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.Layout] = { title: WebInspector.UIString("Layout"), category: this.categories.rendering };
-            this._recordStyles[recordTypes.RecalculateStyles] = { title: WebInspector.UIString("Recalculate Style"), category: this.categories.rendering };
-            this._recordStyles[recordTypes.Paint] = { title: WebInspector.UIString("Paint"), category: this.categories.rendering };
-            this._recordStyles[recordTypes.ParseHTML] = { title: WebInspector.UIString("Parse"), category: this.categories.loading };
-            this._recordStyles[recordTypes.TimerInstall] = { title: WebInspector.UIString("Install Timer"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.TimerRemove] = { title: WebInspector.UIString("Remove Timer"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.TimerFire] = { title: WebInspector.UIString("Timer Fired"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.XHRReadyStateChange] = { title: WebInspector.UIString("XHR Ready State Change"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.XHRLoad] = { title: WebInspector.UIString("XHR Load"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.EvaluateScript] = { title: WebInspector.UIString("Evaluate Script"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.MarkTimeline] = { title: WebInspector.UIString("Mark"), category: this.categories.scripting };
-            this._recordStyles[recordTypes.ResourceSendRequest] = { title: WebInspector.UIString("Send Request"), category: this.categories.loading };
-            this._recordStyles[recordTypes.ResourceReceiveResponse] = { title: WebInspector.UIString("Receive Response"), category: this.categories.loading };
-            this._recordStyles[recordTypes.ResourceFinish] = { title: WebInspector.UIString("Finish Loading"), category: this.categories.loading };
-        }
-
-        var style = this._recordStyles[record.type];
-        if (!style)
-            style = this._recordStyles[recordTypes.EventDispatch];
-
-        var formattedRecord = {};
-        formattedRecord.category = style.category;
-        formattedRecord.title = style.title;
-        formattedRecord.startTime = record.startTime / 1000;
-        formattedRecord.data = record.data;
-        formattedRecord.count = 1;
-        formattedRecord.type = record.type;
-        formattedRecord.endTime = (typeof record.endTime !== "undefined") ? record.endTime / 1000 : formattedRecord.startTime;
-        formattedRecord.record = record;
-
-        // Make resource receive record last since request was sent; make finish record last since response received.
-        if (record.type === WebInspector.TimelineAgent.RecordType.ResourceSendRequest) {
-            this._sendRequestRecords[record.data.identifier] = formattedRecord;
-        } else if (record.type === WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse) {
-            var sendRequestRecord = this._sendRequestRecords[record.data.identifier];
-            if (sendRequestRecord) { // False if we started instrumentation in the middle of request.
-                sendRequestRecord._responseReceivedFormattedTime = formattedRecord.startTime;
-                formattedRecord.startTime = sendRequestRecord.startTime;
-                sendRequestRecord.details = this._getRecordDetails(record);
-            }
-        } else if (record.type === WebInspector.TimelineAgent.RecordType.ResourceFinish) {
-            var sendRequestRecord = this._sendRequestRecords[record.data.identifier];
-            if (sendRequestRecord) // False for main resource.
-                formattedRecord.startTime = sendRequestRecord._responseReceivedFormattedTime;
-        }
-        formattedRecord.details = this._getRecordDetails(record);
-
-        return formattedRecord;
+        var parentRecord;
+        if (record.type === recordTypes.ResourceReceiveResponse ||
+            record.type === recordTypes.ResourceFinish ||
+            record.type === recordTypes.ResourceReceiveData)
+            parentRecord = this._sendRequestRecords[record.data.identifier];
+        else if (record.type === recordTypes.TimerFire)
+            parentRecord = this._timerRecords[record.data.timerId];
+        return parentRecord;
     },
 
-    _getRecordDetails: function(record)
+    _innerAddRecordToTimeline: function(record, parentRecord)
     {
-        switch (record.type) {
-        case WebInspector.TimelineAgent.RecordType.EventDispatch:
-            return record.data ? record.data.type : "";
-        case WebInspector.TimelineAgent.RecordType.Paint:
-            return record.data.width + "\u2009\u00d7\u2009" + record.data.height;
-        case WebInspector.TimelineAgent.RecordType.TimerInstall:
-        case WebInspector.TimelineAgent.RecordType.TimerRemove:
-        case WebInspector.TimelineAgent.RecordType.TimerFire:
-            return record.data.timerId;
-        case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:
-        case WebInspector.TimelineAgent.RecordType.XHRLoad:
-        case WebInspector.TimelineAgent.RecordType.EvaluateScript:
-        case WebInspector.TimelineAgent.RecordType.ResourceSendRequest:
-            return WebInspector.displayNameForURL(record.data.url);
-        case WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse:
-        case WebInspector.TimelineAgent.RecordType.ResourceFinish:
-            var sendRequestRecord = this._sendRequestRecords[record.data.identifier];
-            return sendRequestRecord ? WebInspector.displayNameForURL(sendRequestRecord.data.url) : "";
-        case WebInspector.TimelineAgent.RecordType.MarkTimeline:
-            return record.data.message;
-        default:
-            return "";
+        var connectedToOldRecord = false;
+        if (parentRecord === this._rootRecord) {
+            var newParentRecord = this._findParentRecord(record);
+            if (newParentRecord) {
+                parentRecord = newParentRecord;
+                connectedToOldRecord = true;
+            }
         }
+        var recordTypes = WebInspector.TimelineAgent.RecordType;
+
+        var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this._recordStyles, this._sendRequestRecords, this._timerRecords);
+
+        if (record.type === recordTypes.MarkDOMContentEventType || record.type === recordTypes.MarkLoadEventType) {
+            // No bar entry for load events.
+            this._markTimelineRecords.push(formattedRecord);
+            return;
+        }
+
+        ++this._rootRecord._allRecordsCount;
+
+        if (parentRecord === this._rootRecord)
+            formattedRecord.collapsed = true;
+
+        for (var i = 0; record.children && i < record.children.length; ++i)
+            this._innerAddRecordToTimeline(record.children[i], formattedRecord);
+
+        if (connectedToOldRecord) {
+            var record = formattedRecord;
+            while (record.parent && record.parent._lastChildEndTime < record._lastChildEndTime) {
+                record.parent._lastChildEndTime = record._lastChildEndTime;
+                record = record.parent;
+            }
+        }
+
+        // Keep bar entry for mark timeline since nesting might be interesting to the user.
+        if (record.type === recordTypes.MarkTimeline)
+            this._markTimelineRecords.push(formattedRecord);
     },
 
     setSidebarWidth: function(width)
@@ -263,31 +332,52 @@
         this._overviewPane.updateMainViewWidth(width);
     },
 
-    resize: function() {
+    resize: function()
+    {
+        this._closeRecordDetails();
         this._scheduleRefresh();
     },
 
-    reset: function()
+    _createRootRecord: function()
     {
-        this._lastRecord = null;
+        var rootRecord = {};
+        rootRecord.children = [];
+        rootRecord._visibleRecordsCount = 0;
+        rootRecord._allRecordsCount = 0;
+        return rootRecord;
+    },
+
+    _clearPanel: function()
+    {
+        this._markTimelineRecords = [];
         this._sendRequestRecords = {};
-        this._records = [];
+        this._timerRecords = {};
+        this._rootRecord = this._createRootRecord();
         this._boundariesAreValid = false;
         this._overviewPane.reset();
         this._adjustScrollPosition(0);
         this._refresh();
+        this._closeRecordDetails();
     },
 
     show: function()
     {
         WebInspector.Panel.prototype.show.call(this);
-
-        if (this._needsRefresh)
+        if (typeof this._scrollTop === "number")
+            this._containerElement.scrollTop = this._scrollTop;
+        else if (this._needsRefresh)
             this._refresh();
     },
 
+    hide: function()
+    {
+        WebInspector.Panel.prototype.hide.call(this);
+        this._closeRecordDetails();
+    },
+
     _onScroll: function(event)
     {
+        this._closeRecordDetails();
         var scrollTop = this._containerElement.scrollTop;
         var dividersTop = Math.max(0, scrollTop);
         this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);
@@ -296,11 +386,13 @@
 
     _windowChanged: function()
     {
+        this._closeRecordDetails();
         this._scheduleRefresh();
     },
 
     _scheduleRefresh: function(preserveBoundaries)
     {
+        this._closeRecordDetails();
         this._boundariesAreValid &= preserveBoundaries;
         if (this._needsRefresh)
             return;
@@ -321,49 +413,72 @@
             clearTimeout(this._refreshTimeout);
             delete this._refreshTimeout;
         }
-      
-        if (!this._boundariesAreValid)
-            this._overviewPane.update(this._records);
+
+        this._overviewPane.update(this._rootRecord.children, this._calculator._showShortEvents);
         this._refreshRecords(!this._boundariesAreValid);
+        this._updateRecordsCounter();
+        this._updateEventDividers();
         this._boundariesAreValid = true;
     },
 
+    _updateBoundaries: function()
+    {
+        this._calculator.reset();
+        this._calculator.windowLeft = this._overviewPane.windowLeft;
+        this._calculator.windowRight = this._overviewPane.windowRight;
+
+        for (var i = 0; i < this._rootRecord.children.length; ++i)
+            this._calculator.updateBoundaries(this._rootRecord.children[i]);
+
+        this._calculator.calculateWindow();
+    },
+
+    _addToRecordsWindow: function(record, recordsWindow, parentIsCollapsed)
+    {
+        if (!this._calculator._showShortEvents && !record.isLong())
+            return;
+        var percentages = this._calculator.computeBarGraphPercentages(record);
+        if (percentages.start < 100 && percentages.endWithChildren >= 0 && !record.category.hidden) {
+            ++this._rootRecord._visibleRecordsCount;
+            ++record.parent._invisibleChildrenCount;
+            if (!parentIsCollapsed)
+                recordsWindow.push(record);
+        }
+
+        var index = recordsWindow.length;
+        record._invisibleChildrenCount = 0;
+        for (var i = 0; i < record.children.length; ++i)
+            this._addToRecordsWindow(record.children[i], recordsWindow, parentIsCollapsed || record.collapsed);
+        record._visibleChildrenCount = recordsWindow.length - index;
+    },
+
+    _filterRecords: function()
+    {
+        var recordsInWindow = [];
+        this._rootRecord._visibleRecordsCount = 0;
+        for (var i = 0; i < this._rootRecord.children.length; ++i)
+            this._addToRecordsWindow(this._rootRecord.children[i], recordsInWindow);
+        return recordsInWindow;
+    },
+
     _refreshRecords: function(updateBoundaries)
     {
-        if (updateBoundaries) {
-            this._calculator.reset();
-            this._calculator.windowLeft = this._overviewPane.windowLeft;
-            this._calculator.windowRight = this._overviewPane.windowRight;
+        if (updateBoundaries)
+            this._updateBoundaries();
 
-            for (var i = 0; i < this._records.length; ++i)
-                this._calculator.updateBoundaries(this._records[i]);
-
-            this._calculator.calculateWindow();
-        }
-
-        var recordsInWindow = [];
-        for (var i = 0; i < this._records.length; ++i) {
-            var record = this._records[i];
-            var percentages = this._calculator.computeBarGraphPercentages(record);
-            if (percentages.start < 100 && percentages.end >= 0 && !record.category.hidden)
-                this._addToRecordsWindow(record, recordsInWindow);
-        }
+        var recordsInWindow = this._filterRecords();
 
         // Calculate the visible area.
-        var visibleTop = this._containerElement.scrollTop;
+        this._scrollTop = this._containerElement.scrollTop;
+        var visibleTop = this._scrollTop;
         var visibleBottom = visibleTop + this._containerElement.clientHeight;
 
         // Define row height, should be in sync with styles for timeline graphs.
         const rowHeight = 18;
-        const expandOffset = 15;
 
         // Convert visible area to visible indexes. Always include top-level record for a visible nested record.
         var startIndex = Math.max(0, Math.min(Math.floor(visibleTop / rowHeight) - 1, recordsInWindow.length - 1));
-        while (startIndex > 0 && recordsInWindow[startIndex].parent)
-            startIndex--;
         var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom / rowHeight));
-        while (endIndex < recordsInWindow.length - 1 && recordsInWindow[endIndex].parent)
-            endIndex++;
 
         // Resize gaps first.
         const top = (startIndex * rowHeight) + "px";
@@ -378,6 +493,7 @@
         this._itemsGraphsElement.removeChild(this._graphRowsElement);
         var graphRowElement = this._graphRowsElement.firstChild;
         var scheduleRefreshCallback = this._scheduleRefresh.bind(this, true);
+
         for (var i = startIndex; i < endIndex; ++i) {
             var record = recordsInWindow[i];
             var isEven = !(i % 2);
@@ -391,8 +507,8 @@
                 this._graphRowsElement.appendChild(graphRowElement);
             }
 
-            listRowElement.listRow.update(record, isEven);
-            graphRowElement.graphRow.update(record, isEven, this._calculator, width, expandOffset, i);
+            listRowElement.row.update(record, isEven, this._calculator, visibleTop);
+            graphRowElement.row.update(record, isEven, this._calculator, width, this._expandOffset, i);
 
             listRowElement = listRowElement.nextSibling;
             graphRowElement = graphRowElement.nextSibling;
@@ -401,45 +517,52 @@
         // Remove extra rows.
         while (listRowElement) {
             var nextElement = listRowElement.nextSibling;
-            listRowElement.listRow.dispose();
+            listRowElement.row.dispose();
             listRowElement = nextElement;
         }
         while (graphRowElement) {
             var nextElement = graphRowElement.nextSibling;
-            graphRowElement.graphRow.dispose();
+            graphRowElement.row.dispose();
             graphRowElement = nextElement;
         }
 
         this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bottomGapElement);
+        this.sidebarResizeElement.style.height = this.sidebarElement.clientHeight + "px";
         // Reserve some room for expand / collapse controls to the left for records that start at 0ms.
-        var timelinePaddingLeft = this._calculator.windowLeft === 0 ? expandOffset : 0;
+        var timelinePaddingLeft = this._calculator.windowLeft === 0 ? this._expandOffset : 0;
         if (updateBoundaries)
             this._timelineGrid.updateDividers(true, this._calculator, timelinePaddingLeft);
         this._adjustScrollPosition((recordsInWindow.length + 1) * rowHeight);
     },
 
-    _addToRecordsWindow: function(record, recordsWindow)
-    {
-        recordsWindow.push(record);
-        if (!record.collapsed) {
-            var index = recordsWindow.length;
-            for (var i = 0; record.children && i < record.children.length; ++i)
-                this._addToRecordsWindow(record.children[i], recordsWindow);
-            record.visibleChildrenCount = recordsWindow.length - index;
-        }
-    },
-
     _adjustScrollPosition: function(totalHeight)
     {
         // Prevent the container from being scrolled off the end.
         if ((this._containerElement.scrollTop + this._containerElement.offsetHeight) > totalHeight + 1)
             this._containerElement.scrollTop = (totalHeight - this._containerElement.offsetHeight);
+    },
+
+    _getPopoverAnchor: function(element)
+    {
+        return element.enclosingNodeOrSelfWithClass("timeline-graph-bar") || element.enclosingNodeOrSelfWithClass("timeline-tree-item");
+    },
+
+    _showPopover: function(anchor)
+    {
+        var record = anchor.row._record;
+        var popover = new WebInspector.Popover(record._generatePopupContent(this._calculator));
+        popover.show(anchor);
+        return popover;
+    },
+
+    _closeRecordDetails: function()
+    {
+        this._popoverHelper.hidePopup();
     }
 }
 
 WebInspector.TimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;
 
-
 WebInspector.TimelineCategory = function(name, title, color)
 {
     this.name = name;
@@ -447,7 +570,6 @@
     this.color = color;
 }
 
-
 WebInspector.TimelineCalculator = function()
 {
     this.reset();
@@ -461,7 +583,22 @@
     {
         var start = (record.startTime - this.minimumBoundary) / this.boundarySpan * 100;
         var end = (record.endTime - this.minimumBoundary) / this.boundarySpan * 100;
-        return {start: start, end: end};
+        var endWithChildren = (record._lastChildEndTime - this.minimumBoundary) / this.boundarySpan * 100;
+        return {start: start, end: end, endWithChildren: endWithChildren};
+    },
+
+    computeBarGraphWindowPosition: function(record, clientWidth)
+    {
+        const minWidth = 5;
+        const borderWidth = 4;
+        var workingArea = clientWidth - minWidth - borderWidth;
+        var percentages = this.computeBarGraphPercentages(record);
+        var left = percentages.start / 100 * workingArea;
+        var width = (percentages.end - percentages.start) / 100 * workingArea + minWidth;
+        var widthWithChildren =  (percentages.endWithChildren - percentages.start) / 100 * workingArea;
+        if (percentages.endWithChildren > percentages.end)
+            widthWithChildren += borderWidth + minWidth;
+        return {left: left, width: width, widthWithChildren: widthWithChildren};
     },
 
     calculateWindow: function()
@@ -483,7 +620,9 @@
         if (this._absoluteMinimumBoundary === -1 || lowerBound < this._absoluteMinimumBoundary)
             this._absoluteMinimumBoundary = lowerBound;
 
-        var upperBound = record.endTime;
+        const minimumTimeFrame = 0.1;
+        const minimumDeltaForZeroSizeEvents = 0.01;
+        var upperBound = Math.max(record._lastChildEndTime + minimumDeltaForZeroSizeEvents, lowerBound + minimumTimeFrame);
         if (this._absoluteMaximumBoundary === -1 || upperBound > this._absoluteMaximumBoundary)
             this._absoluteMaximumBoundary = upperBound;
     },
@@ -498,7 +637,8 @@
 WebInspector.TimelineRecordListRow = function()
 {
     this.element = document.createElement("div");
-    this.element.listRow = this;
+    this.element.row = this;
+    this.element.style.cursor = "pointer";
     var iconElement = document.createElement("span");
     iconElement.className = "timeline-tree-icon";
     this.element.appendChild(iconElement);
@@ -523,18 +663,19 @@
 }
 
 WebInspector.TimelineRecordListRow.prototype = {
-    update: function(record, isEven)
+    update: function(record, isEven, calculator, offset)
     {
+        this._record = record;
+        this._calculator = calculator;
+        this._offset = offset;
+
         this.element.className = "timeline-tree-item timeline-category-" + record.category.name + (isEven ? " even" : "");
         this._typeElement.textContent = record.title;
 
-        if (record.details) {
+        if (record.details)
             this._dataElement.textContent = "(" + record.details + ")";
-            this._dataElement.title = record.details;
-        } else {
+        else
             this._dataElement.textContent = "";
-            this._dataElement.title = "";
-        }
 
         if (record.count > 1)
             this._repeatCountElement.textContent = "\u2009\u00d7\u2009" + record.count;
@@ -548,18 +689,23 @@
     }
 }
 
-
-WebInspector.TimelineRecordGraphRow = function(graphContainer, refreshCallback, rowHeight)
+WebInspector.TimelineRecordGraphRow = function(graphContainer, scheduleRefresh, rowHeight)
 {
     this.element = document.createElement("div");
-    this.element.graphRow = this;
+    this.element.row = this;
 
     this._barAreaElement = document.createElement("div");
     this._barAreaElement.className = "timeline-graph-bar-area";
     this.element.appendChild(this._barAreaElement);
 
+    this._barWithChildrenElement = document.createElement("div");
+    this._barWithChildrenElement.className = "timeline-graph-bar with-children";
+    this._barWithChildrenElement.row = this;
+    this._barAreaElement.appendChild(this._barWithChildrenElement);
+
     this._barElement = document.createElement("div");
     this._barElement.className = "timeline-graph-bar";
+    this._barElement.row = this;
     this._barAreaElement.appendChild(this._barElement);
 
     this._expandElement = document.createElement("div");
@@ -571,8 +717,9 @@
     this._expandElement.appendChild(leftBorder);
 
     this._expandElement.addEventListener("click", this._onClick.bind(this));
-    this._refreshCallback = refreshCallback;
     this._rowHeight = rowHeight;
+
+    this._scheduleRefresh = scheduleRefresh;
 }
 
 WebInspector.TimelineRecordGraphRow.prototype = {
@@ -580,18 +727,18 @@
     {
         this._record = record;
         this.element.className = "timeline-graph-side timeline-category-" + record.category.name + (isEven ? " even" : "");
-        var percentages = calculator.computeBarGraphPercentages(record);
-        var left = percentages.start / 100 * clientWidth;
-        var width = (percentages.end - percentages.start) / 100 * clientWidth;
-        this._barElement.style.left = (left + expandOffset) + "px";
-        this._barElement.style.width = width + "px";
+        var barPosition = calculator.computeBarGraphWindowPosition(record, clientWidth - expandOffset);
+        this._barWithChildrenElement.style.left = barPosition.left + expandOffset + "px";
+        this._barWithChildrenElement.style.width = barPosition.widthWithChildren + "px";
+        this._barElement.style.left = barPosition.left + expandOffset + "px";
+        this._barElement.style.width =  barPosition.width + "px";
 
-        if (record.visibleChildrenCount) {
+        if (record._visibleChildrenCount || record._invisibleChildrenCount) {
             this._expandElement.style.top = index * this._rowHeight + "px";
-            this._expandElement.style.left = left + "px";
-            this._expandElement.style.width = Math.max(12, width + 25) + "px";
+            this._expandElement.style.left = barPosition.left + "px";
+            this._expandElement.style.width = Math.max(12, barPosition.width + 25) + "px";
             if (!record.collapsed) {
-                this._expandElement.style.height = (record.visibleChildrenCount + 1) * this._rowHeight + "px";
+                this._expandElement.style.height = (record._visibleChildrenCount + 1) * this._rowHeight + "px";
                 this._expandElement.addStyleClass("timeline-expandable-expanded");
                 this._expandElement.removeStyleClass("timeline-expandable-collapsed");
             } else {
@@ -608,7 +755,7 @@
     _onClick: function(event)
     {
         this._record.collapsed = !this._record.collapsed;
-        this._refreshCallback();
+        this._scheduleRefresh();
     },
 
     dispose: function()
@@ -617,3 +764,199 @@
         this._expandElement.parentElement.removeChild(this._expandElement);
     }
 }
+
+WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, recordStyles, sendRequestRecords, timerRecords)
+{
+    var recordTypes = WebInspector.TimelineAgent.RecordType;
+    var style = recordStyles[record.type];
+
+    this.parent = parentRecord;
+    parentRecord.children.push(this);
+    this.category = style.category;
+    this.title = style.title;
+    this.startTime = record.startTime / 1000;
+    this.data = record.data;
+    this.count = 1;
+    this.type = record.type;
+    this.endTime = (typeof record.endTime !== "undefined") ? record.endTime / 1000 : this.startTime;
+    this._lastChildEndTime = this.endTime;
+    this.originalRecordForTests = record;
+    this.callerScriptName = record.callerScriptName;
+    this.callerScriptLine = record.callerScriptLine;
+    this.totalHeapSize = record.totalHeapSize;
+    this.usedHeapSize = record.usedHeapSize;
+
+    // Make resource receive record last since request was sent; make finish record last since response received.
+    if (record.type === recordTypes.ResourceSendRequest) {
+        sendRequestRecords[record.data.identifier] = this;
+    } else if (record.type === recordTypes.ResourceReceiveResponse) {
+        var sendRequestRecord = sendRequestRecords[record.data.identifier];
+        if (sendRequestRecord) { // False if we started instrumentation in the middle of request.
+            record.data.url = sendRequestRecord.data.url;
+            // Now that we have resource in the collection, recalculate details in order to display short url.
+            sendRequestRecord.details = this._getRecordDetails(sendRequestRecord, sendRequestRecords);
+        }
+    } else if (record.type === recordTypes.ResourceReceiveData) {
+        var sendRequestRecord = sendRequestRecords[record.data.identifier];
+        if (sendRequestRecord) // False for main resource.
+            record.data.url = sendRequestRecord.data.url;
+    } else if (record.type === recordTypes.ResourceFinish) {
+        var sendRequestRecord = sendRequestRecords[record.data.identifier];
+        if (sendRequestRecord) // False for main resource.
+            record.data.url = sendRequestRecord.data.url;
+    } else if (record.type === recordTypes.TimerInstall) {
+        this.timeout = record.data.timeout;
+        this.singleShot = record.data.singleShot;
+        timerRecords[record.data.timerId] = this;
+    } else if (record.type === recordTypes.TimerFire) {
+        var timerInstalledRecord = timerRecords[record.data.timerId];
+        if (timerInstalledRecord) {
+            this.callSiteScriptName = timerInstalledRecord.callerScriptName;
+            this.callSiteScriptLine = timerInstalledRecord.callerScriptLine;
+            this.timeout = timerInstalledRecord.timeout;
+            this.singleShot = timerInstalledRecord.singleShot;
+        }
+    }
+    this.details = this._getRecordDetails(record, sendRequestRecords);
+}
+
+WebInspector.TimelinePanel.FormattedRecord.prototype = {
+    isLong: function()
+    {
+        return (this._lastChildEndTime - this.startTime) > WebInspector.TimelinePanel.shortRecordThreshold;
+    },
+
+    _createCell: function(content, styleName)
+    {
+        var text = document.createElement("label");
+        text.appendChild(document.createTextNode(content));
+        var cell = document.createElement("td");
+        cell.className = "timeline-details";
+        if (styleName)
+            cell.className += " " + styleName;
+        cell.textContent = content;
+        return cell;
+    },
+
+    get children()
+    {
+        if (!this._children)
+            this._children = [];
+        return this._children;
+    },
+
+    _createRow: function(title, content)
+    {
+        var row = document.createElement("tr");
+        row.appendChild(this._createCell(title, "timeline-details-row-title"));
+        row.appendChild(this._createCell(content, "timeline-details-row-data"));
+        return row;
+    },
+
+    _createLinkRow: function(title, content)
+    {
+        var row = document.createElement("tr");
+        row.appendChild(this._createCell(title, "timeline-details-row-title"));
+        var cell = document.createElement("td");
+        cell.appendChild(content);
+        row.appendChild(cell);
+        return row;
+    },
+
+    _generatePopupContent: function(calculator)
+    {
+        var recordContentTable = document.createElement("table");
+        var titleCell = this._createCell(WebInspector.UIString("%s - Details", this.title), "timeline-details-title");
+        titleCell.colSpan = 2;
+        var titleRow = document.createElement("tr");
+        titleRow.appendChild(titleCell);
+        recordContentTable.appendChild(titleRow);
+        var text = Number.secondsToString(this.endTime - this.startTime) + " (@" +
+        calculator.formatValue(this.startTime - calculator.minimumBoundary) + ")";
+        recordContentTable.appendChild(this._createRow(WebInspector.UIString("Duration"), text));
+
+        const recordTypes = WebInspector.TimelineAgent.RecordType;
+        if (this.details) {
+            if (this.type === recordTypes.GCEvent )
+                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta)));
+            else if (this.type === recordTypes.TimerInstall ||
+                this.type === recordTypes.TimerFire ||
+                this.type === recordTypes.TimerRemove) {
+                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Timer Id"), this.data.timerId));
+                if (typeof this.timeout === "number") {
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Timeout"), this.timeout));
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Repeats"), !this.singleShot));
+                }
+                if (typeof this.callSiteScriptLine === "number") {
+                    var link = WebInspector.linkifyResourceAsNode(this.callSiteScriptName, "scripts", this.callSiteScriptLine, "timeline-details");
+                    recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Call Site"), link));
+                }
+            } else if (this.type === recordTypes.FunctionCall) {
+                var link = WebInspector.linkifyResourceAsNode(this.data.scriptName, "scripts", this.data.scriptLine, "timeline-details");
+                recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Location"), link));
+            } else if (this.type === recordTypes.ResourceSendRequest ||
+                       this.type === recordTypes.ResourceReceiveResponse ||
+                       this.type === recordTypes.ResourceReceiveData ||
+                       this.type === recordTypes.ResourceFinish) {
+                var link = WebInspector.linkifyResourceAsNode(this.data.url, "resources", null, "timeline-details");
+                recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Resource"), link));
+                if (this.data.requestMethod)
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Request Method"), this.data.requestMethod));
+                if (typeof this.data.statusCode === "number")
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Status Code"), this.data.statusCode));
+                if (this.data.mimeType)
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Mime Type"), this.data.mimeType));
+                if (typeof this.data.expectedContentLength === "number" && this.data.expectedContentLength !== -1)
+                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Expected Content Length"), this.data.expectedContentLength));
+            } else if (this.type === recordTypes.EvaluateScript) {
+                var link = WebInspector.linkifyResourceAsNode(this.data.url, "scripts", null, "timeline-details");
+                recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Script"), link));
+            } else if (this.type === recordTypes.Paint) {
+                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Location"), this.data.x + "\u2009\u00d7\u2009" + this.data.y));
+                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Dimensions"), this.data.width + "\u2009\u00d7\u2009" + this.data.height));
+            } else
+                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Details"), this.details));
+        }
+
+        if (this.type !== recordTypes.GCEvent && this.callerScriptName) {
+            var link = WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine);
+            recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Caller"), link));
+        }
+        if (this.usedHeapSize) {
+            recordContentTable.appendChild(this._createRow(WebInspector.UIString("Used Heap Size"), Number.bytesToString(this.usedHeapSize)));
+            recordContentTable.appendChild(this._createRow(WebInspector.UIString("Total Heap Size"), Number.bytesToString(this.totalHeapSize)));
+        }
+        return recordContentTable;
+    },
+
+    _getRecordDetails: function(record, sendRequestRecords)
+    {
+        switch (record.type) {
+            case WebInspector.TimelineAgent.RecordType.GCEvent:
+                return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta));
+            case WebInspector.TimelineAgent.RecordType.FunctionCall:
+                return WebInspector.displayNameForURL(record.data.scriptName) + ":" + record.data.scriptLine;
+            case WebInspector.TimelineAgent.RecordType.EventDispatch:
+                return record.data ? record.data.type : "";
+            case WebInspector.TimelineAgent.RecordType.Paint:
+                return record.data.width + "\u2009\u00d7\u2009" + record.data.height;
+            case WebInspector.TimelineAgent.RecordType.TimerInstall:
+            case WebInspector.TimelineAgent.RecordType.TimerRemove:
+            case WebInspector.TimelineAgent.RecordType.TimerFire:
+                return record.data.timerId;
+            case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:
+            case WebInspector.TimelineAgent.RecordType.XHRLoad:
+            case WebInspector.TimelineAgent.RecordType.EvaluateScript:
+            case WebInspector.TimelineAgent.RecordType.ResourceSendRequest:
+            case WebInspector.TimelineAgent.RecordType.ResourceReceiveData:
+            case WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse:
+            case WebInspector.TimelineAgent.RecordType.ResourceFinish:
+                return WebInspector.displayNameForURL(record.data.url);
+            case WebInspector.TimelineAgent.RecordType.MarkTimeline:
+                return record.data.message;
+            default:
+                return "";
+        }
+    }
+}
+
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 73309d1..47a2e90 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -13,6 +13,7 @@
     <file>Callback.js</file>
     <file>CallStackSidebarPane.js</file>
     <file>ChangesView.js</file>
+    <file>Checkbox.js</file>
     <file>Color.js</file>
     <file>ConsolePanel.js</file>
     <file>ConsoleView.js</file>
@@ -32,6 +33,7 @@
     <file>EventListenersSidebarPane.js</file>
     <file>FontView.js</file>
     <file>ImageView.js</file>
+    <file>InjectedFakeWorker.js</file>
     <file>InjectedScript.js</file>
     <file>InjectedScriptAccess.js</file>
     <file>inspector.js</file>
@@ -88,12 +90,20 @@
     <file>View.js</file>
     <file>WatchExpressionsSidebarPane.js</file>
     <file>WelcomeView.js</file>
+    <file>WorkersSidebarPane.js</file>
     <file>audits.css</file>
     <file>inspector.css</file>
     <file>inspectorSyntaxHighlight.css</file>
     <file>popover.css</file>
     <file>textViewer.css</file>
+    <file>Images/auditsIcon.png</file>
     <file>Images/back.png</file>
+    <file>Images/breakpointBorder.png</file>
+    <file>Images/breakpointConditionalBorder.png</file>
+    <file>Images/breakpointConditionalCounterBorder.png</file>
+    <file>Images/breakpointCounterBorder.png</file>
+    <file>Images/breakpointsActivateButtonGlyph.png</file>
+    <file>Images/breakpointsDeactivateButtonGlyph.png</file>
     <file>Images/checker.png</file>
     <file>Images/clearConsoleButtonGlyph.png</file>
     <file>Images/closeButtons.png</file>
@@ -151,6 +161,7 @@
     <file>Images/profilesIcon.png</file>
     <file>Images/profileSmallIcon.png</file>
     <file>Images/profilesSilhouette.png</file>
+    <file>Images/programCounterBorder.png</file>
     <file>Images/radioDot.png</file>
     <file>Images/recordButtonGlyph.png</file>
     <file>Images/recordToggledButtonGlyph.png</file>
@@ -178,6 +189,7 @@
     <file>Images/segmentSelected.png</file>
     <file>Images/segmentSelectedEnd.png</file>
     <file>Images/sessionStorage.png</file>
+    <file>Images/spinner.gif</file>
     <file>Images/splitviewDimple.png</file>
     <file>Images/splitviewDividerBackground.png</file>
     <file>Images/statusbarBackground.png</file>
diff --git a/WebCore/inspector/front-end/WorkersSidebarPane.js b/WebCore/inspector/front-end/WorkersSidebarPane.js
new file mode 100644
index 0000000..ed2b1c4
--- /dev/null
+++ b/WebCore/inspector/front-end/WorkersSidebarPane.js
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+
+WebInspector.WorkersSidebarPane = function()
+{
+    WebInspector.SidebarPane.call(this, WebInspector.UIString("Workers"));
+    
+    this._workers = {};
+
+    this._enableWorkersCheckbox = new WebInspector.Checkbox(
+        WebInspector.UIString("Debug"),
+        this._onTriggerInstrument.bind(this),
+        false,
+        "sidebar-pane-subtitle",
+        WebInspector.UIString("Allow debugging workers. Enabling this option will replace native workers with the iframe-based JavaScript implementation"));
+
+    this.titleElement.insertBefore(this._enableWorkersCheckbox.element, this.titleElement.firstChild);
+
+    this._listElement = document.createElement("ol");
+    this._listElement.className = "workers-list";
+
+    this.bodyElement.appendChild(this._listElement);
+    this._treeOutline = new TreeOutline(this._listElement);
+}
+
+WebInspector.WorkersSidebarPane.prototype = {
+    addWorker: function(id, url, isShared)
+    {
+        if (id in this._workers) 
+            return;
+        var worker = new WebInspector.Worker(id, url, isShared);
+        this._workers[id] = worker;
+
+        var title = WebInspector.linkifyURL(url, WebInspector.displayNameForURL(url), "worker-item", true, url);
+        var treeElement = new TreeElement(title, worker, false);
+        this._treeOutline.appendChild(treeElement);
+    },
+
+    removeWorker: function(id)
+    {
+        if (id in this._workers) {
+            this._treeOutline.removeChild(this._treeOutline.findTreeElement(this._workers[id]));
+            delete this._workers[id];
+        }
+    },
+
+    setInstrumentation: function(enabled)
+    {
+        InspectorBackend.removeAllScriptsToEvaluateOnLoad();
+        if (enabled)
+            InspectorBackend.addScriptToEvaluateOnLoad("(" + InjectedFakeWorker + ")");
+    },
+
+    reset: function()
+    {
+        InspectorBackend.removeAllScriptsToEvaluateOnLoad();
+        this.setInstrumentation(this._enableWorkersCheckbox.checked());
+        this._treeOutline.removeChildren();
+        this._workers = {};
+    },
+
+    _onTriggerInstrument: function(event)
+    {
+        this.setInstrumentation(this._enableWorkersCheckbox.checked());
+    }
+};
+
+WebInspector.WorkersSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
+
+WebInspector.Worker = function(id, url, shared)
+{
+    this.id = id;
+    this.url = url;
+    this.shared = shared;
+}
+
+WebInspector.didCreateWorker = function()
+{
+    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+    workersPane.addWorker.apply(workersPane, arguments);
+}
+
+WebInspector.didDestroyWorker = function()
+{
+    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+    workersPane.removeWorker.apply(workersPane, arguments);
+}
diff --git a/WebCore/inspector/front-end/audits.css b/WebCore/inspector/front-end/audits.css
index 9d02c80..ad12db3 100644
--- a/WebCore/inspector/front-end/audits.css
+++ b/WebCore/inspector/front-end/audits.css
@@ -50,104 +50,6 @@
     -webkit-mask-image: url(Images/clearConsoleButtonGlyph.png);
 }
 
-#audit-result-view {
-    display: none;
-    overflow: auto;
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    background-color: rgb(245, 245, 245);
-    cursor: default;
-    overflow: auto;
-}
-
-#audit-result-view.visible {
-    display: block;
-}
-
-#audit-result-view > .pane img.score {
-    float: left;
-    margin-top: 2px;
-    position: relative;
-    height: 16px;
-    width: 16px;
-    z-index: 100;
-}
-
-#audit-result-view > .pane img.score.red {
-    content: url(Images/errorRedDot.png);
-}
-
-#audit-result-view > .pane img.score.green {
-    content: url(Images/successGreenDot.png);
-}
-
-#audit-result-view > .pane.expanded:nth-last-of-type(1) {
-    border-bottom: 1px solid rgb(189, 189, 189) !important;
-}
-
-#audit-result-view .pane.expanded:nth-last-of-type(1) {
-    border-bottom: 0px transparent none;
-}
-
-#audit-result-view > .pane > .body > .pane > .title {
-    padding-left: 16px;
-    background-image: none;
-    border-bottom: none;
-}
-
-#audit-result-view > .pane > .body > .pane > .body {
-    background-color: transparent;
-}
-
-#audit-result-view > .pane > .body > .pane .section {
-    margin-left: 16px;
-}
-
-#audit-result-view .section .header {
-    border: 0;
-    background-image: none;
-    background-color: transparent;
-}
-
-#audit-result-view .section .header > .title {
-    color: rgb(0, 0, 0);
-}
-
-#audit-result-view .section .section-content {
-    width: 100%;
-    padding-left: 18px;
-    display: none;
-}
-
-#audit-result-view .section.expanded .section-content {
-    display: block;
-}
-
-#audit-result-view .section.expanded .section-content > p:nth-of-type(1) {
-    margin-top: 0;
-}
-
-#audit-result-view .section.expanded .section-content > p:nth-of-type(1) > *:nth-child(1) {
-    margin-top: 0;
-}
-
-#audit-result-view .section .header::before {
-    content: url(Images/treeRightTriangleBlack.png);
-}
-
-#audit-result-view .section.expanded .header::before {
-    content: url(Images/treeDownTriangleBlack.png);
-}
-
-div.panel.audits .sidebar > ol.sidebar-tree > li:nth-child(1) {
-    height: 0px;
-    padding-top: 0;
-    padding-bottom: 0;
-}
-
 .audit-launcher-view {
     z-index: 1000;
     position: absolute;
@@ -174,6 +76,8 @@
     bottom: 0;
     padding: 0 0 0 16px;
     white-space: nowrap;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
 }
 
 .audit-launcher-view h1 {
@@ -192,10 +96,13 @@
 }
 
 .audit-launcher-view div.button-container {
-    position: absolute;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
     width: 100%;
-    bottom: 16px;
-    padding-top: 16px;
+    padding: 16px 0;
+}
+.audit-launcher-view .flexible-space {
+    -webkit-box-flex: 1;
 }
 
 .audit-launcher-view div.audit-categories-container {
@@ -270,3 +177,109 @@
     background: url(Images/radioDot.png) center no-repeat,
                 -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
 }
+
+.audit-launcher-view .resource-progress > img {
+    content: url(Images/spinner.gif);
+    vertical-align: text-top;
+    margin: 0 4px 0 8px;
+}
+
+.audit-result-view {
+    overflow: auto;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    display: none;
+}
+
+.audit-result-view.visible {
+    display: block;
+}
+
+.audit-result-view .severity-severe {
+    content: url(Images/errorRedDot.png);
+}
+
+.audit-result-view .severity-warning {
+    content: url(Images/warningOrangeDot.png);
+}
+
+.audit-result-view .severity-info {
+    content: url(Images/successGreenDot.png);
+}
+
+.audit-result-tree li.parent::before {
+    content: url(Images/treeRightTriangleBlack.png);
+    float: left;
+    width: 8px;
+    height: 8px;
+    margin-top: 1px;
+    padding-right: 2px;
+}
+
+.audit-result-tree {
+    font-size: 11px;
+    line-height: 14px;
+    -webkit-user-select: text;
+}
+
+.audit-result-tree > ol {
+    position: relative;
+    padding: 2px 6px !important;
+    margin: 0;
+    color: rgb(84, 84, 84);
+    cursor: default;
+    min-width: 100%;
+}
+
+.audit-result-tree, .audit-result-tree ol {
+    list-style-type: none;
+    -webkit-padding-start: 12px;
+    margin: 0;
+}
+
+.audit-result-tree li {
+    padding: 0 0 0 14px;
+    margin-top: 1px;
+    margin-bottom: 1px;
+    word-wrap: break-word;
+    text-indent: -2px;
+}
+
+.audit-result-tree li.parent {
+    text-indent: -12px
+}
+
+.audit-result-tree li.parent::before {
+    content: url(Images/treeRightTriangleBlack.png);
+    float: left;
+    width: 8px;
+    height: 8px;
+    margin-top: 0;
+    padding-right: 2px;
+}
+
+.audit-result-tree li.parent.expanded::before {
+    content: url(Images/treeDownTriangleBlack.png);
+}
+
+.audit-result-tree ol.children {
+    display: none;
+}
+
+.audit-result-tree ol.children.expanded {
+    display: block;
+}
+
+.audit-result {
+    font-weight: bold;
+    color: black;
+}
+
+.audit-result img {
+    float: left;
+    margin-left: -40px;
+    margin-top: -1px;
+}
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 76b31fc..581c75a 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -219,6 +219,10 @@
     background-image: url(Images/profilesIcon.png);
 }
 
+.toolbar-item.audits .toolbar-icon {
+    background-image: url(Images/auditsIcon.png);
+}
+
 .toolbar-item.console .toolbar-icon {
     background-image: url(Images/consoleIcon.png);
 }
@@ -520,6 +524,11 @@
     font-family: Consolas, Lucida Console, monospace;
 }
 
+body.platform-linux .monospace, body.platform-linux .source-code {
+    font-size: 11px;
+    font-family: dejavu sans mono, monospace;
+}
+
 #console-messages {
     position: absolute;
     z-index: 0;
@@ -877,6 +886,7 @@
     right: 0;
     left: 0;
     bottom: 0;
+    overflow: auto;
 }
 
 .resource-view.headers-visible .resource-view-content {
@@ -969,7 +979,7 @@
     position: absolute;
     top: 0;
     left: 0;
-    right: 225px;
+    right: 300px;
     bottom: 0;
 }
 
@@ -978,7 +988,7 @@
     top: 0;
     right: 0;
     bottom: 0;
-    width: 225px;
+    width: 300px;
     background-color: rgb(245, 245, 245);
     border-left: 1px solid rgb(64%, 64%, 64%);
     cursor: default;
@@ -1323,15 +1333,6 @@
     display: inline;
 }
 
-.section .header input[type=checkbox] {
-    height: 10px;
-    width: 10px;
-    margin-left: 0;
-    margin-top: 0;
-    margin-bottom: 0;
-    vertical-align: 2px;
-}
-
 .section .header .subtitle, .event-bar .header .subtitle {
     float: right;
     font-size: 10px;
@@ -1496,6 +1497,10 @@
     text-decoration: none !important;
 }
 
+.editing br {
+    display: none;
+}
+
 .elements-tree-editor {
     -webkit-user-select: text;
     -webkit-user-modify: read-write-plaintext-only;
@@ -1571,6 +1576,10 @@
     display: block;
 }
 
+.section .properties li.disabled .enabled-button {
+    display: block;
+}
+
 .section .properties .name, .event-properties .name {
     color: rgb(136, 19, 145);
 }
@@ -1653,7 +1662,6 @@
 }
 
 .pane > .title > select {
-    display: none;
     float: right;
     width: 23px;
     height: 17px;
@@ -1668,10 +1676,6 @@
     -webkit-appearance: none;
 }
 
-.pane.expanded:hover > .title > select {
-    display: inline-block;
-}
-
 .pane > .title > select:hover {
     background-position: -23px 0px;
 }
@@ -1716,6 +1720,21 @@
     height: 5px;
 }
 
+.sidebar-pane-subtitle {
+    float: right;
+    overflow: hidden;
+}
+
+.sidebar-pane-subtitle input, .section .header input[type=checkbox] {
+    font-size: inherit;
+    hight: 1em;
+    width: 1em;
+    margin-left: 0;
+    margin-top: 0;
+    margin-bottom: 0.25em;
+    vertical-align: bottom;
+}
+
 .metrics {
     padding: 8px;
     font-size: 10px;
@@ -2287,7 +2306,6 @@
 .panel-enabler-view.welcome .instructions {
     display: inline-block;
     vertical-align: middle;
-    width: 330px;
     margin: 0;
     white-space: normal;
     line-height: 175%;
@@ -2298,7 +2316,8 @@
 }
 
 .panel-enabler-view.welcome button.status-bar-item {
-    vertical-align: middle;
+    background-image: none;
+    vertical-align: top;
 }
 
 .pane button {
@@ -2410,6 +2429,15 @@
     content: url(Images/debuggerStepOut.png);
 }
 
+.toggle-breakpoints .glyph {
+    -webkit-mask-image: url(Images/breakpointsActivateButtonGlyph.png);
+    background-color: rgb(96, 96, 96) !important;
+}
+
+.toggle-breakpoints.toggled-on .glyph {
+    -webkit-mask-image: url(Images/breakpointsDeactivateButtonGlyph.png);
+}
+
 #scripts-debugger-status {
     position: absolute;
     line-height: 24px;
@@ -2639,7 +2667,7 @@
     margin-right: 3px;
 }
 
-#resources-dividers {
+.resources-dividers {
     position: absolute;
     left: 0;
     right: 0;
@@ -2648,7 +2676,7 @@
     z-index: -100;
 }
 
-#resources-event-dividers {
+.resources-event-dividers {
     position: absolute;
     left: 0;
     right: 0;
@@ -2658,7 +2686,11 @@
     pointer-events: none;
 }
 
-#resources-dividers-label-bar {
+.timeline .resources-event-dividers {
+    height: 19px;
+}
+
+.resources-dividers-label-bar {
     position: absolute;
     top: 0;
     left: 0px;
@@ -2686,24 +2718,26 @@
     pointer-events: auto;
 }
 
-.resources-onload-divider {
+.resources-event-divider {
     position: absolute;
     width: 2px;
     top: 0;
     bottom: 0;
     z-index: 300;
+}
+
+.resources-red-divider {
     background-color: rgba(255, 0, 0, 0.5);
 }
 
-.resources-ondomcontent-divider {
-    position: absolute;
-    width: 2px;
-    top: 0;
-    bottom: 0;
-    z-index: 300;
+.resources-blue-divider {
     background-color: rgba(0, 0, 255, 0.5);
 }
 
+.resources-orange-divider {
+    background-color: rgba(255, 178, 23, 0.5);
+}
+
 .resources-divider.last {
     background-color: transparent;
 }
@@ -2747,6 +2781,10 @@
     margin-right: 5px;
 }
 
+.resources-graph-label.waiting-right {
+    margin-left: 5px;
+}
+
 .resources-graph-label.before {
     color: rgba(0, 0, 0, 0.7);
     text-shadow: none;
@@ -2815,7 +2853,7 @@
     display: block;
 }
 
-.resources-graph-bar.waiting {
+.resources-graph-bar.waiting, .resources-graph-bar.waiting-right {
     opacity: 0.35;
 }
 
@@ -3305,6 +3343,10 @@
     height: 80px;
 }
 
+#timeline-overview-panel .timeline-graph-bar {
+    pointer-events: none;
+}
+
 .timeline-sidebar-background {
     top: 90px;
     bottom: 0;
@@ -3558,7 +3600,12 @@
     min-width: 5px;
     opacity: 0.8;
     -webkit-border-image: url(Images/timelineBarGray.png) 4 4 5 4;
-    pointer-events: none;
+    z-index: 180;
+    pointer-events: visibleFill;
+}
+
+.timeline-graph-bar.with-children {
+    opacity: 0.3;
 }
 
 .timeline-graph-side.even {
@@ -3589,6 +3636,41 @@
     background-position-y: 72px;
 }
 
+.timeline-details {
+    -webkit-user-select: text;
+}
+
+.timeline-details-row-title {
+    font-weight: bold;
+    text-align: right;
+    white-space: nowrap;
+}
+
+.timeline-details-row-data {
+    white-space: nowrap;
+}
+
+.timeline-details-title {
+    font-weight: bold;
+    white-space: nowrap;
+}
+
+.timeline-filter-status-bar-item .glyph {
+    -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png);
+}
+
+.timeline-filter-status-bar-item.toggled-on .glyph {
+    background-color: rgb(66, 129, 235) !important;
+}
+
+.timeline-records-counter {
+    font-size: 11px;
+    position: relative;
+    top: 5px;
+    margin-left: 5px;
+    text-shadow: white 0 1px 0;
+}
+
 /* Profiler Style */
 
 #profile-views {
@@ -3824,7 +3906,7 @@
 }
 
 .source-frame-popover-tree {
-    border-top: 1px solid rgb(190, 190, 190);
+    border-top: 1px solid rgb(194, 194, 147);
     overflow: auto;
     position: absolute;
     top: 15px;
@@ -3832,3 +3914,58 @@
     left: 0;
     right: 0;
 }
+
+.source-frame-eval-expression {
+    border: 1px solid rgb(163, 41, 34);
+    margin: -1px;
+    background-color: rgb(255, 255, 194);
+}
+
+.styles-sidebar-separator {
+    background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(243, 243, 243)), color-stop(0.05, rgb(243, 243, 243)), color-stop(0.05, rgb(230, 230, 230)), to(rgb(209, 209, 209)));
+    padding: 0 5px;
+    border-top: 1px solid rgb(189, 189, 189);
+    border-bottom: 1px solid rgb(189, 189, 189);
+    color: rgb(110, 110, 110);
+    text-shadow: white 0 1px 0;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+}
+
+.styles-selector {
+    cursor: text;
+    -webkit-user-select: text;
+}
+
+.workers-list {
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+ 
+.workers-list > li {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    margin-left: 1em;
+    font-size: 12px;
+}
+
+a.worker-item {
+    color: rgb(33%, 33%, 33%);
+    cursor: pointer;
+    text-decoration: none;
+}
+
+a.worker-item:hover {
+    color: rgb(15%, 15%, 15%);
+}
+
+.resource-content-unavailable {
+    color: rgb(50%, 50%, 50%);
+    font-style: italic;
+    font-size: 14px;
+    text-align: center;
+    padding: 32px;
+}
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 85633b5..4fa8ddc 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -41,6 +41,7 @@
     <script type="text/javascript" src="InspectorFrontendHostStub.js"></script>
     <script type="text/javascript" src="Object.js"></script>
     <script type="text/javascript" src="Settings.js"></script>
+    <script type="text/javascript" src="Checkbox.js"></script>
     <script type="text/javascript" src="ContextMenu.js"></script>
     <script type="text/javascript" src="KeyboardShortcut.js"></script>
     <script type="text/javascript" src="TextPrompt.js"></script>
@@ -74,6 +75,7 @@
     <script type="text/javascript" src="CallStackSidebarPane.js"></script>
     <script type="text/javascript" src="ScopeChainSidebarPane.js"></script>
     <script type="text/javascript" src="WatchExpressionsSidebarPane.js"></script>
+    <script type="text/javascript" src="WorkersSidebarPane.js"></script>
     <script type="text/javascript" src="MetricsSidebarPane.js"></script>
     <script type="text/javascript" src="PropertiesSidebarPane.js"></script>
     <script type="text/javascript" src="EventListenersSidebarPane.js"></script>
@@ -85,6 +87,7 @@
     <script type="text/javascript" src="SummaryBar.js"></script>
     <script type="text/javascript" src="ElementsPanel.js"></script>
     <script type="text/javascript" src="ResourcesPanel.js"></script>
+    <script type="text/javascript" src="InjectedFakeWorker.js"></script>
     <script type="text/javascript" src="ScriptsPanel.js"></script>
     <script type="text/javascript" src="StoragePanel.js"></script>
     <script type="text/javascript" src="ProfilesPanel.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 8bcdf63..c75dd9c 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -63,6 +63,7 @@
     // 4 - ?path
     // 5 - ?fragment
     URLRegExp: /^(http[s]?|file):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i,
+    GenericURLRegExp: /^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i,
 
     get platform()
     {
@@ -209,14 +210,10 @@
             this.panels.profiles = new WebInspector.ProfilesPanel();
             this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType());
         }
-
         if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
             this.panels.storage = new WebInspector.StoragePanel();
-
-        // FIXME: Uncomment when ready.
-        // if (hiddenPanels.indexOf("audits") === -1)
-        //    this.panels.audits = new WebInspector.AuditsPanel();
-
+        if (Preferences.auditsPanelEnabled && hiddenPanels.indexOf("audits") === -1)
+            this.panels.audits = new WebInspector.AuditsPanel();
         if (hiddenPanels.indexOf("console") === -1)
             this.panels.console = new WebInspector.ConsolePanel();
     },
@@ -239,12 +236,10 @@
         var body = document.body;
 
         if (x) {
-            InspectorFrontendHost.attach();
             body.removeStyleClass("detached");
             body.addStyleClass("attached");
             dockToggleButton.title = WebInspector.UIString("Undock into separate window.");
         } else {
-            InspectorFrontendHost.detach();
             body.removeStyleClass("attached");
             body.addStyleClass("detached");
             dockToggleButton.title = WebInspector.UIString("Dock to main window.");
@@ -481,7 +476,6 @@
 
     this.addMainEventListeners(document);
 
-    window.addEventListener("unload", this.windowUnload.bind(this), true);
     window.addEventListener("resize", this.windowResize.bind(this), true);
 
     document.addEventListener("focus", this.focusChanged.bind(this), true);
@@ -565,11 +559,6 @@
     setTimeout(delayDispatch, 0);
 }
 
-WebInspector.windowUnload = function(event)
-{
-    InspectorFrontendHost.windowUnloading();
-}
-
 WebInspector.windowResize = function(event)
 {
     if (this.currentPanel)
@@ -607,9 +596,29 @@
 
 WebInspector.close = function(event)
 {
+    if (this._isClosing)
+        return;
+    this._isClosing = true;
     InspectorFrontendHost.closeWindow();
 }
 
+WebInspector.inspectedPageDestroyed = function()
+{
+    WebInspector.close();
+}
+
+WebInspector.documentMouseOver = function(event)
+{
+    if (event.target.tagName !== "A")
+        return;
+
+    const anchor = event.target;
+    if (!anchor.hasStyleClass("webkit-html-resource-link"))
+        return;
+    if (anchor.href && anchor.href.indexOf("/data:") != -1)
+        return;
+}
+
 WebInspector.documentClick = function(event)
 {
     var anchor = event.target.enclosingNodeOrSelfWithNodeName("a");
@@ -618,22 +627,38 @@
 
     // Prevent the link from navigating, since we don't do any navigation by following links normally.
     event.preventDefault();
+    event.stopPropagation();
 
     function followLink()
     {
         // FIXME: support webkit-html-external-link links here.
-        if (WebInspector.canShowSourceLineForURL(anchor.href, anchor.preferredPanel)) {
+        if (WebInspector.canShowSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel)) {
             if (anchor.hasStyleClass("webkit-html-external-link")) {
                 anchor.removeStyleClass("webkit-html-external-link");
                 anchor.addStyleClass("webkit-html-resource-link");
             }
 
-            WebInspector.showSourceLineForURL(anchor.href, anchor.lineNumber, anchor.preferredPanel);
-        } else {
-            var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
-            if (profileString)
-                WebInspector.showProfileForURL(anchor.href);
+            WebInspector.showSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel);
+            return;
         }
+
+        const profileMatch = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
+        if (profileMatch) {
+            WebInspector.showProfileForURL(anchor.href);
+            return;
+        }
+
+        const urlMatch = WebInspector.GenericURLRegExp.exec(anchor.href);
+        if (urlMatch && urlMatch[1] === "webkit-link-action") {
+            if (urlMatch[2] === "show-panel") {
+                const panel = urlMatch[4].substring(1);
+                if (WebInspector.panels[panel])
+                    WebInspector.currentPanel = WebInspector.panels[panel];
+            }
+            return;
+        }
+
+        WebInspector.showResourcesPanel();
     }
 
     if (WebInspector.followLinkTimeout)
@@ -652,6 +677,9 @@
 
 WebInspector.documentKeyDown = function(event)
 {
+    if (WebInspector.isEditingAnyField())
+        return;
+
     if (this.currentFocusElement && this.currentFocusElement.handleKeyEvent) {
         this.currentFocusElement.handleKeyEvent(event);
         if (event.handled) {
@@ -689,7 +717,13 @@
                 WebInspector.focusSearchField();
                 event.preventDefault();
             }
+            break;
 
+        case "F3":
+            if (!isMac) {
+                WebInspector.focusSearchField();
+                event.preventDefault();
+            }
             break;
 
         case "U+0047": // G key
@@ -743,21 +777,15 @@
 
             break;
 
-        case "U+0041": // A key
-            if (isMac)
-                var shouldShowAuditsPanel = event.metaKey && !event.shiftKey && !event.ctrlKey && event.altKey;
-            else
-                var shouldShowAuditsPanel = event.ctrlKey && !event.shiftKey && !event.metaKey && event.altKey;
-
-            if (shouldShowAuditsPanel) {
-                if (!this.panels.audits) {
-                    this.panels.audits = new WebInspector.AuditsPanel();
-                    var toolbarElement = document.getElementById("toolbar");
-                    WebInspector.addPanelToolbarIcon(toolbarElement, this.panels.audits, this.panels.console.toolbarItem);
-                }
-                this.currentPanel = this.panels.audits;
+        case "U+0052": // R key
+            if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) {
+                InspectorBackend.reloadPage();
+                event.preventDefault();
             }
-
+            break;
+        case "F5":
+            if (!isMac)
+                InspectorBackend.reloadPage();
             break;
     }
 }
@@ -885,8 +913,10 @@
 
 WebInspector.toggleAttach = function()
 {
-    this.attached = !this.attached;
-    this.drawer.resize();
+    if (!this.attached)
+        InspectorFrontendHost.requestAttachWindow();
+    else
+        InspectorFrontendHost.requestDetachWindow();
 }
 
 WebInspector.toolbarDragStart = function(event)
@@ -1015,6 +1045,11 @@
     this.currentPanel = this.panels.console;
 }
 
+WebInspector.showAuditsPanel = function()
+{
+    this.currentPanel = this.panels.audits;
+}
+
 WebInspector.clearConsoleMessages = function()
 {
     WebInspector.console.clearMessages();
@@ -1041,6 +1076,8 @@
         this.resourceURLMap[resource.url] = resource;
         if (this.panels.resources)
             this.panels.resources.addResource(resource);
+        if (this.panels.audits)
+            this.panels.audits.resourceStarted(resource);
     }
 
     if (payload.didRequestChange) {
@@ -1057,11 +1094,10 @@
         if (resource.mainResource)
             this.mainResource = resource;
 
-        var match = payload.documentURL.match(WebInspector.URLRegExp);
+        var match = payload.documentURL.match(WebInspector.GenericURLRegExp);
         if (match) {
             var protocol = match[1].toLowerCase();
-            if (protocol.indexOf("http") === 0 || protocol === "file")
-                this._addCookieDomain(protocol === "file" ? "" : match[2]);
+            this._addCookieDomain(match[2]);
         }
     }
 
@@ -1079,12 +1115,14 @@
     }
 
     if (payload.didLengthChange) {
-        resource.contentLength = payload.contentLength;
+        resource.resourceSize = payload.resourceSize;
     }
 
     if (payload.didCompletionChange) {
         resource.failed = payload.failed;
         resource.finished = payload.finished;
+        if (this.panels.audits)
+            this.panels.audits.resourceFinished(resource);
     }
 
     if (payload.didTimingChange) {
@@ -1182,6 +1220,17 @@
     this.panels.resources.resourceTrackingWasDisabled();
 }
 
+
+WebInspector.searchingForNodeWasEnabled = function()
+{
+    this.panels.elements.searchingForNodeWasEnabled();
+}
+
+WebInspector.searchingForNodeWasDisabled = function()
+{
+    this.panels.elements.searchingForNodeWasDisabled();
+}
+
 WebInspector.attachDebuggerWhenShown = function()
 {
     this.panels.scripts.attachDebuggerWhenShown();
@@ -1192,6 +1241,11 @@
     this.panels.scripts.debuggerWasEnabled();
 }
 
+WebInspector.updatePauseOnExceptionsState = function(pauseOnExceptionsState)
+{
+    this.panels.scripts.updatePauseOnExceptionsState(pauseOnExceptionsState);
+}
+
 WebInspector.debuggerWasDisabled = function()
 {
     this.panels.scripts.debuggerWasDisabled();
@@ -1212,6 +1266,13 @@
     this.panels.scripts.addScript(sourceID, sourceURL, source, startingLine);
 }
 
+WebInspector.restoredBreakpoint = function(sourceID, sourceURL, line, enabled, condition)
+{
+    var breakpoint = new WebInspector.Breakpoint(sourceURL, line, sourceID, condition);
+    breakpoint.enabled = enabled;
+    this.panels.scripts.addBreakpoint(breakpoint);
+}
+
 WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLine, errorLine, errorMessage)
 {
     this.panels.scripts.addScript(null, sourceURL, source, startingLine, errorLine, errorMessage);
@@ -1257,6 +1318,16 @@
     this.console.clearMessages();
 }
 
+WebInspector.bringToFront = function()
+{
+    InspectorFrontendHost.bringToFront();
+}
+
+WebInspector.inspectedURLChanged = function(url)
+{
+    InspectorFrontendHost.inspectedURLChanged(url);
+}
+
 WebInspector.resourceURLChanged = function(resource, oldURL)
 {
     delete this.resourceURLMap[oldURL];
@@ -1294,7 +1365,7 @@
     this.console.updateMessageRepeatCount(count);
 }
 
-WebInspector.log = function(message)
+WebInspector.log = function(message, messageLevel)
 {
     // remember 'this' for setInterval() callback
     var self = this;
@@ -1348,7 +1419,7 @@
         var msg = new WebInspector.ConsoleMessage(
             WebInspector.ConsoleMessage.MessageSource.Other,
             WebInspector.ConsoleMessage.MessageType.Log,
-            WebInspector.ConsoleMessage.MessageLevel.Debug,
+            messageLevel || WebInspector.ConsoleMessage.MessageLevel.Debug,
             -1,
             null,
             null,
@@ -1437,7 +1508,19 @@
     var resource = this.resourceURLMap[url];
     if (resource)
         return resource.displayName;
-    return url.trimURL(WebInspector.mainResource ? WebInspector.mainResource.domain : "");
+
+    if (!WebInspector.mainResource)
+        return url.trimURL("");
+
+    var lastPathComponent = WebInspector.mainResource.lastPathComponent;
+    var index = WebInspector.mainResource.url.indexOf(lastPathComponent);
+    if (index !== -1 && index + lastPathComponent.length === WebInspector.mainResource.url.length) {
+        var baseURL = WebInspector.mainResource.url.substring(0, index);
+        if (url.indexOf(baseURL) === 0)
+            return url.substring(index);
+    }
+
+    return url.trimURL(WebInspector.mainResource.domain);
 }
 
 WebInspector.resourceForURL = function(url)
@@ -1455,27 +1538,27 @@
     return null;
 }
 
-WebInspector._choosePanelToShowSourceLineForURL = function(url, preferredPanel)
+WebInspector._choosePanelToShowSourceLine = function(url, line, preferredPanel)
 {
     preferredPanel = preferredPanel || "resources";
     var panel = this.panels[preferredPanel];
-    if (panel && panel.canShowSourceLineForURL(url))
+    if (panel && panel.canShowSourceLine(url, line))
         return panel;
     panel = this.panels.resources;
-    return panel.canShowSourceLineForURL(url) ? panel : null;
+    return panel.canShowSourceLine(url, line) ? panel : null;
 }
 
-WebInspector.canShowSourceLineForURL = function(url, preferredPanel)
+WebInspector.canShowSourceLine = function(url, line, preferredPanel)
 {
-    return !!this._choosePanelToShowSourceLineForURL(url, preferredPanel);
+    return !!this._choosePanelToShowSourceLine(url, line, preferredPanel);
 }
 
-WebInspector.showSourceLineForURL = function(url, line, preferredPanel)
+WebInspector.showSourceLine = function(url, line, preferredPanel)
 {
-    this.currentPanel = this._choosePanelToShowSourceLineForURL(url, preferredPanel);
+    this.currentPanel = this._choosePanelToShowSourceLine(url, line, preferredPanel);
     if (!this.currentPanel)
         return false;
-    this.currentPanel.showSourceLineForURL(url, line);
+    this.currentPanel.showSourceLine(url, line);
     return true;
 }
 
@@ -1540,6 +1623,17 @@
     return WebInspector.linkifyURLAsNode(url, linkText, classes, isExternal, tooltipText).outerHTML;
 }
 
+WebInspector.linkifyResourceAsNode = function(url, preferredPanel, lineNumber, classes, tooltipText)
+{
+    var linkText = WebInspector.displayNameForURL(url);
+    if (lineNumber)
+        linkText += ":" + lineNumber;
+    var node = WebInspector.linkifyURLAsNode(url, linkText, classes, false, tooltipText);
+    node.lineNumber = lineNumber;
+    node.preferredPanel = preferredPanel;
+    return node;
+}
+
 WebInspector.completeURL = function(baseURL, href)
 {
     var match = baseURL.match(WebInspector.URLRegExp);
@@ -1559,6 +1653,7 @@
     doc.defaultView.addEventListener("focus", this.windowFocused.bind(this), false);
     doc.defaultView.addEventListener("blur", this.windowBlurred.bind(this), false);
     doc.addEventListener("click", this.documentClick.bind(this), true);
+    doc.addEventListener("mouseover", this.documentMouseOver.bind(this), true);
 }
 
 WebInspector._searchFieldManualFocus = function(event)
@@ -1721,11 +1816,17 @@
     return element.__editing;
 }
 
+WebInspector.isEditingAnyField = function()
+{
+    return this.__editing;
+}
+
 WebInspector.startEditing = function(element, committedCallback, cancelledCallback, context, multiline)
 {
     if (element.__editing)
         return;
     element.__editing = true;
+    WebInspector.__editing = true;
 
     var oldText = getContent(element);
     var moveDirection = "";
@@ -1749,6 +1850,7 @@
 
     function cleanUpAfterEditing() {
         delete this.__editing;
+        delete WebInspector.__editing;
 
         this.removeStyleClass("editing");
         this.tabIndex = oldTabIndex;
@@ -1801,6 +1903,10 @@
     element.addEventListener("keydown", keyDownEventListener, true);
 
     WebInspector.currentFocusElement = element;
+    return {
+        cancel: editingCancelled.bind(element),
+        commit: editingCommitted.bind(element)
+    };
 }
 
 WebInspector._toolbarItemClicked = function(event)
diff --git a/WebCore/inspector/front-end/textViewer.css b/WebCore/inspector/front-end/textViewer.css
index 1447dfd..b69545f 100644
--- a/WebCore/inspector/front-end/textViewer.css
+++ b/WebCore/inspector/front-end/textViewer.css
@@ -10,7 +10,6 @@
 
 .text-editor-lines {
     border: 0;
-    width: 100%;
     -webkit-border-horizontal-spacing: 0;
     -webkit-border-vertical-spacing: 0;
     -webkit-user-select: text;
@@ -61,66 +60,81 @@
 
 .webkit-line-number {
     color: rgb(128, 128, 128);
+    background-color: rgb(240, 240, 240);
+    border-right: 1px solid rgb(187, 187, 187);
     text-align: right;
     word-break: normal;
     -webkit-user-select: none;
-    background-color: rgb(240, 240, 240);
-    border-right: 1px solid rgb(187, 187, 187) !important;
-    padding-left: 2px;
-    padding-right: 2px;
-    background-repeat: no-repeat;
-    background-position: right 1px;
+	padding-right: 4px;
+	padding-left: 6px;
+}
+
+.webkit-line-number-outer {
+    margin-right: -4px;
+    margin-left: -4px;
+    border-color: transparent;
+    border-style: solid;
+    border-width: 0 0 0px 2px;
     vertical-align: top;
 }
 
+.webkit-line-number-inner {
+    margin-right: 4px;
+}
+
+.webkit-breakpoint .webkit-line-number-inner, .webkit-breakpoint-conditional .webkit-line-number-inner, .webkit-execution-line .webkit-line-number-inner {
+    margin-right: -10px;
+}
+
 .webkit-line-content {
+    width: 100%;
     padding-left: 2px;
     vertical-align: top;
 }
 
-.webkit-execution-line .webkit-line-number {
-    color: transparent;
-    background-image: -webkit-canvas(program-counter);
-}
-
-.webkit-breakpoint .webkit-line-number {
+.webkit-breakpoint .webkit-line-number-outer {
     color: white;
-    background-image: -webkit-canvas(breakpoint);
+    border-width: 0 14px 0px 2px;
+    -webkit-border-image: url(Images/breakpointBorder.png) 0 14 0 2;
 }
 
-.webkit-breakpoint-disabled .webkit-line-number {
+.webkit-breakpoint-conditional .webkit-line-number-outer {
     color: white;
-    background-image: -webkit-canvas(breakpoint-disabled);
+    border-width: 0 14px 0px 2px;
+    -webkit-border-image: url(Images/breakpointConditionalBorder.png) 0 14 0 2;
 }
 
-.webkit-breakpoint.webkit-execution-line .webkit-line-number {
+.webkit-execution-line .webkit-line-number-outer {
     color: transparent;
-    background-image: -webkit-canvas(breakpoint-program-counter);
+    border-width: 0 14px 0px 2px;
+    -webkit-border-image: url(Images/programCounterBorder.png) 0 14 0 2;
 }
 
-.webkit-breakpoint-disabled.webkit-execution-line .webkit-line-number {
-    color: transparent;
-    background-image: -webkit-canvas(breakpoint-disabled-program-counter);
-}
-
-.webkit-breakpoint.webkit-breakpoint-conditional .webkit-line-number {
+.webkit-breakpoint.webkit-execution-line .webkit-line-number-outer {
     color: white;
-    background-image: -webkit-canvas(breakpoint-conditional);
+    -webkit-border-image: url(Images/breakpointCounterBorder.png) 0 14 0 2;
 }
 
-.webkit-breakpoint-disabled.webkit-breakpoint-conditional .webkit-line-number {
-    color: white;
-    background-image: -webkit-canvas(breakpoint-disabled-conditional);
-}
-
-.webkit-breakpoint.webkit-breakpoint-conditional.webkit-execution-line .webkit-line-number {
+.webkit-breakpoint.webkit-execution-line .webkit-line-number-outer {
     color: transparent;
-    background-image: -webkit-canvas(breakpoint-conditional-program-counter);
+    -webkit-border-image: url(Images/breakpointCounterBorder.png) 0 14 0 2;
 }
 
-.webkit-breakpoint-disabled.webkit-breakpoint-conditional.webkit-execution-line .webkit-line-number {
+.webkit-breakpoint-conditional.webkit-execution-line .webkit-line-number-outer {
     color: transparent;
-    background-image: -webkit-canvas(breakpoint-disabled-conditional-program-counter);
+    -webkit-border-image: url(Images/breakpointConditionalCounterBorder.png) 0 14 0 2;
+}
+
+.webkit-breakpoint-disabled .webkit-line-number-outer {
+    opacity: 0.5;
+}
+
+.breakpoints-deactivated .webkit-breakpoint .webkit-line-number-outer {
+    opacity: 0.5;
+}
+
+.breakpoints-deactivated .webkit-breakpoint-disabled .webkit-line-number-outer {
+    opacity: 0.3;
 }
 
 .webkit-execution-line .webkit-line-content {
diff --git a/WebCore/inspector/front-end/treeoutline.js b/WebCore/inspector/front-end/treeoutline.js
index b6e35bb..799d8af 100644
--- a/WebCore/inspector/front-end/treeoutline.js
+++ b/WebCore/inspector/front-end/treeoutline.js
@@ -287,7 +287,7 @@
     if (cachedElement)
         return cachedElement;
 
-    // The representedObject isn't know, so we start at the top of the tree and work down to find the first
+    // The representedObject isn't known, so we start at the top of the tree and work down to find the first
     // tree element that represents representedObject or one of its ancestors.
     var item;
     var found = false;
@@ -567,7 +567,7 @@
         if (this.selected)
             this._listItemNode.addStyleClass("selected");
 
-        this._listItemNode.addEventListener("mousedown", TreeElement.treeElementSelected, false);
+        this._listItemNode.addEventListener("mousedown", TreeElement.treeElementMouseDown, false);
         this._listItemNode.addEventListener("click", TreeElement.treeElementToggled, false);
         this._listItemNode.addEventListener("dblclick", TreeElement.treeElementDoubleClicked, false);
 
@@ -595,7 +595,7 @@
         this._childrenListNode.parentNode.removeChild(this._childrenListNode);
 }
 
-TreeElement.treeElementSelected = function(event)
+TreeElement.treeElementMouseDown = function(event)
 {
     var element = event.currentTarget;
     if (!element || !element.treeElement || !element.treeElement.selectable)
@@ -604,7 +604,7 @@
     if (element.treeElement.isEventWithinDisclosureTriangle(event))
         return;
 
-    element.treeElement.select();
+    element.treeElement.selectOnMouseDown(event);
 }
 
 TreeElement.treeElementToggled = function(event)
@@ -767,6 +767,11 @@
     return true;
 }
 
+TreeElement.prototype.selectOnMouseDown = function(event)
+{
+    this.select();
+}
+
 TreeElement.prototype.select = function(supressOnSelect)
 {
     if (!this.treeOutline || !this.selectable || this.selected)
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index f30ab9f..98f34b9 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -219,6 +219,17 @@
     this.style.top = y + "px";
 }
 
+Element.prototype.pruneEmptyTextNodes = function()
+{
+    var sibling = this.firstChild;
+    while (sibling) {
+        var nextSibling = sibling.nextSibling;
+        if (sibling.nodeType === this.TEXT_NODE && sibling.nodeValue === "")
+            this.removeChild(sibling);
+        sibling = nextSibling;
+    }
+}
+
 Node.prototype.enclosingNodeOrSelfWithNodeNameInArray = function(nameArray)
 {
     for (var node = this; node && node !== this.ownerDocument; node = node.parentNode)
@@ -359,7 +370,7 @@
 
 String.prototype.trimURL = function(baseURLDomain)
 {
-    var result = this.replace(/^https?:\/\//i, "");
+    var result = this.replace(/^(https|http|file):\/\//i, "");
     if (baseURLDomain)
         result = result.replace(new RegExp("^" + baseURLDomain.escapeForRegExp(), "i"), "");
     return result;
diff --git a/WebCore/loader/CachedCSSStyleSheet.cpp b/WebCore/loader/CachedCSSStyleSheet.cpp
index 3fc28ff..245d944 100644
--- a/WebCore/loader/CachedCSSStyleSheet.cpp
+++ b/WebCore/loader/CachedCSSStyleSheet.cpp
@@ -31,6 +31,7 @@
 #include "CachedResourceClientWalker.h"
 #include "HTTPParsers.h"
 #include "TextResourceDecoder.h"
+#include "SharedBuffer.h"
 #include "loader.h"
 #include <wtf/Vector.h>
 
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index 3d9eeb9..d295618 100644
--- a/WebCore/loader/CachedFont.cpp
+++ b/WebCore/loader/CachedFont.cpp
@@ -34,15 +34,16 @@
 #include "Cache.h"
 #include "CachedResourceClient.h"
 #include "CachedResourceClientWalker.h"
-#include "DOMImplementation.h"
 #include "FontPlatformData.h"
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
-#include "FontCustomPlatformData.h"
-#endif
+#include "SharedBuffer.h"
 #include "TextResourceDecoder.h"
 #include "loader.h"
 #include <wtf/Vector.h>
 
+#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
+#include "FontCustomPlatformData.h"
+#endif
+
 #if ENABLE(SVG_FONTS)
 #include "HTMLNames.h"
 #include "NodeList.h"
@@ -156,7 +157,7 @@
 SVGFontElement* CachedFont::getSVGFontById(const String& fontName) const
 {
     ASSERT(m_isSVGFont);
-    RefPtr<NodeList> list = m_externalSVGDocument->getElementsByTagName(SVGNames::fontTag.localName());
+    RefPtr<NodeList> list = m_externalSVGDocument->getElementsByTagNameNS(SVGNames::fontTag.namespaceURI(), SVGNames::fontTag.localName());
     if (!list)
         return 0;
 
diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp
index dd93041..8831d3b 100644
--- a/WebCore/loader/CachedImage.cpp
+++ b/WebCore/loader/CachedImage.cpp
@@ -34,6 +34,7 @@
 #include "FrameView.h"
 #include "Request.h"
 #include "Settings.h"
+#include "SharedBuffer.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/Vector.h>
diff --git a/WebCore/loader/CachedImage.h b/WebCore/loader/CachedImage.h
index 2aa35ac..cda03a2 100644
--- a/WebCore/loader/CachedImage.h
+++ b/WebCore/loader/CachedImage.h
@@ -25,7 +25,6 @@
 
 #include "CachedResource.h"
 #include "ImageObserver.h"
-#include "Image.h"
 #include "IntRect.h"
 #include "Timer.h"
 #include <wtf/Vector.h>
diff --git a/WebCore/loader/CachedResource.cpp b/WebCore/loader/CachedResource.cpp
index 640d1f7..c69791d 100644
--- a/WebCore/loader/CachedResource.cpp
+++ b/WebCore/loader/CachedResource.cpp
@@ -32,6 +32,7 @@
 #include "KURL.h"
 #include "PurgeableBuffer.h"
 #include "Request.h"
+#include "SharedBuffer.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/MathExtras.h>
 #include <wtf/RefCountedLeakCounter.h>
diff --git a/WebCore/loader/CachedResource.h b/WebCore/loader/CachedResource.h
index bad632b..2539729 100644
--- a/WebCore/loader/CachedResource.h
+++ b/WebCore/loader/CachedResource.h
@@ -27,7 +27,6 @@
 #include "FrameLoaderTypes.h"
 #include "PlatformString.h"
 #include "ResourceResponse.h"
-#include "SharedBuffer.h"
 #include <wtf/HashCountedSet.h>
 #include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
diff --git a/WebCore/loader/CachedScript.cpp b/WebCore/loader/CachedScript.cpp
index 31483d6..28e6137 100644
--- a/WebCore/loader/CachedScript.cpp
+++ b/WebCore/loader/CachedScript.cpp
@@ -29,6 +29,7 @@
 
 #include "CachedResourceClient.h"
 #include "CachedResourceClientWalker.h"
+#include "SharedBuffer.h"
 #include "TextResourceDecoder.h"
 #include <wtf/Vector.h>
 
diff --git a/WebCore/loader/CachedXSLStyleSheet.cpp b/WebCore/loader/CachedXSLStyleSheet.cpp
index 59c3907..430ad46 100644
--- a/WebCore/loader/CachedXSLStyleSheet.cpp
+++ b/WebCore/loader/CachedXSLStyleSheet.cpp
@@ -29,6 +29,7 @@
 
 #include "CachedResourceClient.h"
 #include "CachedResourceClientWalker.h"
+#include "SharedBuffer.h"
 #include "TextResourceDecoder.h"
 #include <wtf/Vector.h>
 
diff --git a/WebCore/loader/CrossOriginPreflightResultCache.h b/WebCore/loader/CrossOriginPreflightResultCache.h
index faf55e5..f8a7c55 100644
--- a/WebCore/loader/CrossOriginPreflightResultCache.h
+++ b/WebCore/loader/CrossOriginPreflightResultCache.h
@@ -24,6 +24,9 @@
  *
  */
 
+#ifndef CrossOriginPreflightResultCacheItem_h
+#define CrossOriginPreflightResultCacheItem_h
+
 #include "KURLHash.h"
 #include "StringHash.h"
 #include <wtf/HashMap.h>
@@ -77,3 +80,5 @@
     };
 
 } // namespace WebCore
+
+#endif
diff --git a/WebCore/loader/DocLoader.cpp b/WebCore/loader/DocLoader.cpp
index 08dfa33..6862616 100644
--- a/WebCore/loader/DocLoader.cpp
+++ b/WebCore/loader/DocLoader.cpp
@@ -34,7 +34,6 @@
 #include "CachedScript.h"
 #include "CachedXSLStyleSheet.h"
 #include "Console.h"
-#include "CString.h"
 #include "Document.h"
 #include "DOMWindow.h"
 #include "HTMLElement.h"
@@ -44,9 +43,13 @@
 #include "loader.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
+<<<<<<< HEAD
 #if ENABLE(LINK_PREFETCH)
 #include "CachedLinkPrefetch.h"
 #endif
+=======
+#include <wtf/text/CString.h>
+>>>>>>> webkit.org at r58033
 
 #define PRELOAD_DEBUG 0
 
@@ -473,7 +476,7 @@
 {
     String encoding;
     if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
-        encoding = charset.isEmpty() ? m_doc->frame()->loader()->encoding() : charset;
+        encoding = charset.isEmpty() ? m_doc->frame()->loader()->writer()->encoding() : charset;
 
     CachedResource* resource = requestResource(type, url, encoding, true);
     if (!resource || m_preloads.contains(resource))
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index dca416e..e835f80 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -269,7 +269,7 @@
     commitIfReady();
     if (FrameLoader* loader = frameLoader()) {
         loader->finishedLoadingDocument(this);
-        loader->end();
+        loader->writer()->end();
     }
 }
 
@@ -311,7 +311,7 @@
     }
     
     frameLoader()->finishedLoadingDocument(this);
-    m_frame->loader()->end();
+    m_frame->loader()->writer()->end();
     
     frameLoader()->setReplacing();
     m_gotFirstByte = false;
diff --git a/WebCore/loader/DocumentThreadableLoader.cpp b/WebCore/loader/DocumentThreadableLoader.cpp
index d0f6c04..3bebbe6 100644
--- a/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/WebCore/loader/DocumentThreadableLoader.cpp
@@ -217,6 +217,10 @@
     ASSERT(m_client);
     ASSERT_UNUSED(loader, loader == m_loader);
 
+    // Ignore response body of preflight requests.
+    if (m_actualRequest)
+        return;
+
     m_client->didReceiveData(data, lengthReceived);
 }
 
diff --git a/WebCore/loader/DocumentWriter.cpp b/WebCore/loader/DocumentWriter.cpp
new file mode 100644
index 0000000..ba0695e
--- /dev/null
+++ b/WebCore/loader/DocumentWriter.cpp
@@ -0,0 +1,251 @@
+/*
+ * Copyright (C) 2010. Adam Barth. 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "DocumentWriter.h"
+
+#include "DOMImplementation.h"
+#include "DOMWindow.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
+#include "FrameView.h"
+#include "PlaceholderDocument.h"
+#include "PluginDocument.h"
+#include "SecurityOrigin.h"
+#include "SegmentedString.h"
+#include "Settings.h"
+#include "TextResourceDecoder.h"
+#include "Tokenizer.h"
+
+namespace WebCore {
+
+static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame) 
+{
+    return parentFrame && parentFrame->document()->securityOrigin()->canAccess(frame->document()->securityOrigin());
+}
+    
+DocumentWriter::DocumentWriter(Frame* frame)
+    : m_frame(frame)
+    , m_receivedData(false)
+    , m_encodingWasChosenByUser(false)
+{
+}
+
+void DocumentWriter::replaceDocument(const String& html)
+{
+    m_frame->loader()->stopAllLoaders();
+    begin(m_frame->loader()->url(), true, m_frame->document()->securityOrigin());
+    addData(html);
+    end();
+}
+
+void DocumentWriter::clear()
+{
+    m_decoder = 0;
+    m_receivedData = false;
+    if (!m_encodingWasChosenByUser)
+        m_encoding = String();
+}
+
+void DocumentWriter::begin()
+{
+    begin(KURL());
+}
+
+PassRefPtr<Document> DocumentWriter::createDocument()
+{
+    if (!m_frame->loader()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldUsePluginDocument(m_mimeType))
+        return PluginDocument::create(m_frame);
+    if (!m_frame->loader()->client()->hasHTMLView())
+        return PlaceholderDocument::create(m_frame);
+    return DOMImplementation::createDocument(m_mimeType, m_frame, m_frame->inViewSourceMode());
+}
+
+void DocumentWriter::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
+{
+    // We need to take a reference to the security origin because |clear|
+    // might destroy the document that owns it.
+    RefPtr<SecurityOrigin> forcedSecurityOrigin = origin;
+
+    // Create a new document before clearing the frame, because it may need to
+    // inherit an aliased security context.
+    RefPtr<Document> document = createDocument();
+
+    bool resetScripting = !(m_frame->loader()->isDisplayingInitialEmptyDocument() && m_frame->document()->securityOrigin()->isSecureTransitionTo(url));
+    m_frame->loader()->clear(resetScripting, resetScripting);
+    if (resetScripting)
+        m_frame->script()->updatePlatformScriptObjects();
+
+    m_frame->loader()->setURL(url);
+    document->setURL(url);
+    m_frame->setDocument(document);
+
+    if (m_decoder)
+        document->setDecoder(m_decoder.get());
+    if (forcedSecurityOrigin)
+        document->setSecurityOrigin(forcedSecurityOrigin.get());
+
+    m_frame->domWindow()->setURL(document->url());
+    m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
+
+    m_frame->loader()->didBeginDocument(dispatch);
+
+    document->implicitOpen();
+
+    if (m_frame->view() && m_frame->loader()->client()->hasHTMLView())
+        m_frame->view()->setContentsSize(IntSize());
+}
+
+void DocumentWriter::addData(const char* str, int len, bool flush)
+{
+    if (len == 0 && !flush)
+        return;
+
+    if (len == -1)
+        len = strlen(str);
+
+    Tokenizer* tokenizer = m_frame->document()->tokenizer();
+    if (tokenizer && tokenizer->wantsRawData()) {
+        if (len > 0)
+            tokenizer->writeRawData(str, len);
+        return;
+    }
+    
+    if (!m_decoder) {
+        if (Settings* settings = m_frame->settings()) {
+            m_decoder = TextResourceDecoder::create(m_mimeType,
+                settings->defaultTextEncodingName(),
+                settings->usesEncodingDetector());
+            Frame* parentFrame = m_frame->tree()->parent();
+            // Set the hint encoding to the parent frame encoding only if
+            // the parent and the current frames share the security origin.
+            // We impose this condition because somebody can make a child frame 
+            // containing a carefully crafted html/javascript in one encoding
+            // that can be mistaken for hintEncoding (or related encoding) by
+            // an auto detector. When interpreted in the latter, it could be
+            // an attack vector.
+            // FIXME: This might be too cautious for non-7bit-encodings and
+            // we may consider relaxing this later after testing.
+            if (canReferToParentFrameEncoding(m_frame, parentFrame))
+                m_decoder->setHintEncoding(parentFrame->document()->decoder());
+        } else
+            m_decoder = TextResourceDecoder::create(m_mimeType, String());
+        Frame* parentFrame = m_frame->tree()->parent();
+        if (m_encoding.isEmpty()) {
+            if (canReferToParentFrameEncoding(m_frame, parentFrame))
+                m_decoder->setEncoding(parentFrame->document()->inputEncoding(), TextResourceDecoder::EncodingFromParentFrame);
+        } else {
+            m_decoder->setEncoding(m_encoding,
+                m_encodingWasChosenByUser ? TextResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHeader);
+        }
+        m_frame->document()->setDecoder(m_decoder.get());
+    }
+
+    String decoded = m_decoder->decode(str, len);
+    if (flush)
+        decoded += m_decoder->flush();
+    if (decoded.isEmpty())
+        return;
+
+    if (!m_receivedData) {
+        m_receivedData = true;
+        if (m_decoder->encoding().usesVisualOrdering())
+            m_frame->document()->setVisuallyOrdered();
+        m_frame->document()->recalcStyle(Node::Force);
+    }
+
+    if (tokenizer) {
+        ASSERT(!tokenizer->wantsRawData());
+        tokenizer->write(decoded, true);
+    }
+}
+
+void DocumentWriter::addData(const String& str)
+{
+    if (str.isNull())
+        return;
+
+    if (!m_receivedData) {
+        m_receivedData = true;
+        m_frame->document()->setParseMode(Document::Strict);
+    }
+
+    if (Tokenizer* tokenizer = m_frame->document()->tokenizer())
+        tokenizer->write(str, true);
+}
+
+void DocumentWriter::end()
+{
+    m_frame->loader()->didEndDocument();
+    endIfNotLoadingMainResource();
+}
+
+void DocumentWriter::endIfNotLoadingMainResource()
+{
+    if (m_frame->loader()->isLoadingMainResource() || !m_frame->page() || !m_frame->document())
+        return;
+
+    // http://bugs.webkit.org/show_bug.cgi?id=10854
+    // The frame's last ref may be removed and it can be deleted by checkCompleted(), 
+    // so we'll add a protective refcount
+    RefPtr<Frame> protector(m_frame);
+
+    // make sure nothing's left in there
+    addData(0, 0, true);
+    m_frame->document()->finishParsing();
+}
+
+String DocumentWriter::encoding() const
+{
+    if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
+        return m_encoding;
+    if (m_decoder && m_decoder->encoding().isValid())
+        return m_decoder->encoding().name();
+    Settings* settings = m_frame->settings();
+    return settings ? settings->defaultTextEncodingName() : String();
+}
+
+void DocumentWriter::setEncoding(const String& name, bool userChosen)
+{
+    m_frame->loader()->willSetEncoding();
+    m_encoding = name;
+    m_encodingWasChosenByUser = userChosen;
+}
+
+void DocumentWriter::setDecoder(TextResourceDecoder* decoder)
+{
+    m_decoder = decoder;
+}
+
+String DocumentWriter::deprecatedFrameEncoding() const
+{
+    return m_frame->loader()->url().isEmpty() ? m_encoding : encoding();
+}
+
+} // namespace WebCore
diff --git a/WebCore/loader/DocumentWriter.h b/WebCore/loader/DocumentWriter.h
new file mode 100644
index 0000000..a06fb7f
--- /dev/null
+++ b/WebCore/loader/DocumentWriter.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010. Adam Barth. 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. 
+ * 3.  Neither the name of Adam Barth. ("Adam Barth") 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 APPLE AND ITS 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 APPLE OR ITS 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 DocumentWriter_h
+#define DocumentWriter_h
+
+#include "KURL.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class Document;
+class Frame;
+class SecurityOrigin;
+class TextResourceDecoder;
+
+class DocumentWriter : public Noncopyable {
+public:
+    DocumentWriter(Frame*);
+
+    void replaceDocument(const String&);
+
+    void begin();
+    void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityOrigin* forcedSecurityOrigin = 0);
+    void addData(const char* string, int length = -1, bool flush = false);
+    void addData(const String&);
+    void end();
+    void endIfNotLoadingMainResource();
+    void clear();
+
+    String encoding() const;
+    void setEncoding(const String& encoding, bool userChosen);
+
+    // FIXME: It's really unforunate to need to expose this piece of state.
+    // I suspect a better design is to disentangle user-provided encodings,
+    // default encodings, and the decoding we're currently using.
+    String deprecatedFrameEncoding() const;
+
+    const String& mimeType() const { return m_mimeType; }
+    void setMIMEType(const String& type) { m_mimeType = type; }
+
+    void setDecoder(TextResourceDecoder*);
+
+private:
+    PassRefPtr<Document> createDocument();
+
+    Frame* m_frame;
+
+    bool m_receivedData;
+    String m_mimeType;
+
+    bool m_encodingWasChosenByUser;
+    String m_encoding;
+    RefPtr<TextResourceDecoder> m_decoder;
+};
+
+} // namespace WebCore
+
+#endif // DocumentWriter_h
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 0d25818..9c764b9 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -36,12 +36,10 @@
 #include "EditorClient.h"
 #include "FloatRect.h"
 #include "FocusDirection.h"
-#include "FormState.h"
 #include "FrameLoaderClient.h"
 #include "InspectorClient.h"
 #include "PluginHalterClient.h"
 #include "ResourceError.h"
-#include "SharedBuffer.h"
 
 /*
  This file holds empty Client stubs for use by WebCore.
@@ -119,12 +117,12 @@
     virtual bool tabsToLinks() const { return false; }
 
     virtual IntRect windowResizerRect() const { return IntRect(); }
-    virtual void addToDirtyRegion(const IntRect&) { }
-    virtual void scrollBackingStore(int, int, const IntRect&, const IntRect&) { }
-    virtual void updateBackingStore() { }
 
-    virtual void repaint(const IntRect&, bool, bool, bool) { }
+    virtual void invalidateWindow(const IntRect&, bool) { }
+    virtual void invalidateContentsAndWindow(const IntRect&, bool) { }
+    virtual void invalidateContentsForSlowScroll(const IntRect&, bool) {};
     virtual void scroll(const IntSize&, const IntRect&, const IntRect&) { }
+
     virtual IntPoint screenToWindow(const IntPoint& p) const { return p; }
     virtual IntRect windowToScreen(const IntRect& r) const { return r; }
     virtual PlatformPageClient platformPageClient() const { return 0; }
@@ -150,7 +148,7 @@
 #endif
 
     virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) { }
-    virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>) { }
+    virtual void chooseIconForFiles(const Vector<String>&, FileChooser*) { }
 
     virtual void formStateDidChange(const Node*) { }
 
@@ -164,7 +162,11 @@
     virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
 
     virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*) {}
+<<<<<<< HEAD
     virtual void cancelGeolocationPermissionRequestForFrame(Frame*) {}
+=======
+    virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) {}
+>>>>>>> webkit.org at r58033
 
 #if USE(ACCELERATED_COMPOSITING)
     virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) {};
@@ -205,7 +207,6 @@
     virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long) { }
     virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&) { }
     virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) { return false; }
-    virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&) { }
 
     virtual void dispatchDidHandleOnloadEvents() { }
     virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() { }
@@ -305,6 +306,9 @@
     virtual void didTransferChildFrameToNewDocument() { }
     virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
     virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    virtual PassRefPtr<Widget> createMediaPlayerProxyPlugin(const IntSize&, HTMLMediaElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&) { return 0; }
+#endif
 
     virtual ObjectContentType objectContentType(const KURL&, const String&) { return ObjectContentType(); }
     virtual String overrideMediaType() const { return String(); }
@@ -481,29 +485,14 @@
     virtual ~EmptyInspectorClient() { }
 
     virtual void inspectorDestroyed() { }
-
-    virtual Page* createPage() { return 0; };
-
-    virtual String localizedStringsURL() { return String(); }
-
-    virtual String hiddenPanels() { return String(); }
-
-    virtual void showWindow() { }
-    virtual void closeWindow() { }
-
-    virtual void attachWindow() { }
-    virtual void detachWindow() { }
-
-    virtual void setAttachedWindowHeight(unsigned) { }
+    
+    virtual void openInspectorFrontend(InspectorController*) { }
 
     virtual void highlight(Node*) { }
     virtual void hideHighlight() { }
-    virtual void inspectedURLChanged(const String&) { }
 
     virtual void populateSetting(const String&, String*) { }
     virtual void storeSetting(const String&, const String&) { }
-
-    virtual void inspectorWindowObjectCleared() { }
 };
 
 }
diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp
index 62173f5..66136b5 100644
--- a/WebCore/loader/FTPDirectoryDocument.cpp
+++ b/WebCore/loader/FTPDirectoryDocument.cpp
@@ -27,7 +27,6 @@
 #include "FTPDirectoryDocument.h"
 
 #include "CharacterNames.h"
-#include "CString.h"
 #include "HTMLNames.h"
 #include "HTMLTableElement.h"
 #include "HTMLTokenizer.h"
@@ -39,6 +38,7 @@
 #include "SharedBuffer.h"
 #include "Text.h"
 
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/StdLibExtras.h>
 
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index d28dc50..5e592a5 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
  * Copyright (C) 2008 Alp Toker <alp@atoker.com>
@@ -39,7 +39,6 @@
 #include "ArchiveFactory.h"
 #endif
 #include "BackForwardList.h"
-#include "CString.h"
 #include "Cache.h"
 #include "CachedPage.h"
 #include "Chrome.h"
@@ -64,6 +63,9 @@
 #include "HTMLAppletElement.h"
 #include "HTMLFormElement.h"
 #include "HTMLFrameElement.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#endif
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTTPParsers.h"
@@ -83,9 +85,11 @@
 #include "PluginDatabase.h"
 #include "PluginDocument.h"
 #include "ProgressTracker.h"
-#include "RenderPart.h"
+#include "RenderEmbeddedObject.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "RenderVideo.h"
+#endif
 #include "RenderView.h"
-#include "RenderWidget.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
 #include "ScriptController.h"
@@ -105,6 +109,7 @@
 #include "XMLHttpRequest.h"
 #include "XMLTokenizer.h"
 #include "XSSAuditor.h"
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/StdLibExtras.h>
 
@@ -177,6 +182,7 @@
     , m_policyChecker(frame)
     , m_history(frame)
     , m_notifer(frame)
+    , m_writer(frame)
     , m_state(FrameStateCommittedPage)
     , m_loadType(FrameLoadTypeStandard)
     , m_delegateIsHandlingProvisionalLoadError(false)
@@ -192,7 +198,6 @@
     , m_isLoadingMainResource(false)
     , m_needsClear(false)
     , m_receivedData(false)
-    , m_encodingWasChosenByUser(false)
     , m_containsPlugIns(false)
     , m_checkTimer(this, &FrameLoader::checkTimerFired)
     , m_shouldCallCheckCompleted(false)
@@ -205,6 +210,7 @@
     , m_loadingFromCachedPage(false)
     , m_suppressOpenerInNewFrame(false)
     , m_sandboxFlags(SandboxAll)
+    , m_forcedSandboxFlags(SandboxNone)
 #ifndef NDEBUG
     , m_didDispatchDidCommitLoad(false)
 #endif
@@ -232,8 +238,8 @@
     setState(FrameStateProvisional);
     m_provisionalDocumentLoader->setResponse(ResourceResponse(KURL(), "text/html", 0, String(), String()));
     m_provisionalDocumentLoader->finishedLoading();
-    begin(KURL(), false);
-    end();
+    writer()->begin(KURL(), false);
+    writer()->end();
     m_frame->document()->cancelParsing();
     m_creatingInitialEmptyDocument = false;
     m_didCallImplicitClose = true;
@@ -276,7 +282,11 @@
             return frame;
         }
     }
-    
+
+    // Sandboxed frames cannot open new auxiliary browsing contexts.
+    if (isDocumentSandboxed(SandboxNavigation))
+        return 0;
+
     // FIXME: Setting the referrer should be the caller's responsibility.
     FrameLoadRequest requestWithReferrer = request;
     requestWithReferrer.resourceRequest().setHTTPReferrer(m_outgoingReferrer);
@@ -366,7 +376,7 @@
     m_suppressOpenerInNewFrame = false;
 }
 
-bool FrameLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const String& urlString, const AtomicString& frameName)
+bool FrameLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const String& urlString, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList)
 {
     // Support for <frame src="javascript:string">
     KURL scriptURL;
@@ -379,7 +389,7 @@
 
     Frame* frame = ownerElement->contentFrame();
     if (frame)
-        frame->redirectScheduler()->scheduleLocationChange(url.string(), m_outgoingReferrer, true, true, isProcessingUserGesture());
+        frame->redirectScheduler()->scheduleLocationChange(url.string(), m_outgoingReferrer, lockHistory, lockBackForwardList, isProcessingUserGesture());
     else
         frame = loadSubframe(ownerElement, url, frameName, m_outgoingReferrer);
     
@@ -484,6 +494,9 @@
     if (!shouldAllowNavigation(targetFrame))
         return;
     if (!targetFrame) {
+        if (!DOMWindow::allowPopUp(m_frame) && !isProcessingUserGesture())
+            return;
+
         targetFrame = m_frame;
         frameRequest.setFrameName(targetOrBaseTarget);
     }
@@ -709,14 +722,6 @@
     m_frame->script()->updatePlatformScriptObjects();
 }
 
-void FrameLoader::replaceDocument(const String& html)
-{
-    stopAllLoaders();
-    begin(m_URL, true, m_frame->document()->securityOrigin());
-    write(html);
-    end();
-}
-
 void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView)
 {
     m_frame->editor()->clear();
@@ -747,12 +752,10 @@
     if (clearFrameView && m_frame->view())
         m_frame->view()->clear();
 
-    m_frame->setSelectionGranularity(CharacterGranularity);
-
     // Do not drop the document before the ScriptController and view are cleared
     // as some destructors might still try to access the document.
     m_frame->setDocument(0);
-    m_decoder = 0;
+    writer()->clear();
 
     m_containsPlugIns = false;
 
@@ -765,16 +768,12 @@
     m_shouldCallCheckCompleted = false;
     m_shouldCallCheckLoadComplete = false;
 
-    m_receivedData = false;
     m_isDisplayingInitialEmptyDocument = false;
-
-    if (!m_encodingWasChosenByUser)
-        m_encoding = String();
 }
 
 void FrameLoader::receivedFirstData()
 {
-    begin(m_workingURL, false);
+    writer()->begin(m_workingURL, false);
 
     dispatchDidCommitLoad();
     dispatchDidClearWindowObjectsInAllWorlds();
@@ -805,193 +804,57 @@
     m_frame->redirectScheduler()->scheduleRedirect(delay, url);
 }
 
-const String& FrameLoader::responseMIMEType() const
+void FrameLoader::setURL(const KURL& url)
 {
-    return m_responseMIMEType;
-}
-
-void FrameLoader::setResponseMIMEType(const String& type)
-{
-    m_responseMIMEType = type;
-}
-    
-void FrameLoader::begin()
-{
-    begin(KURL());
-}
-
-void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
-{
-    // We need to take a reference to the security origin because |clear|
-    // might destroy the document that owns it.
-    RefPtr<SecurityOrigin> forcedSecurityOrigin = origin;
-
-    RefPtr<Document> document;
-
-    // Create a new document before clearing the frame, because it may need to inherit an aliased security context.
-    if (!m_isDisplayingInitialEmptyDocument && m_client->shouldUsePluginDocument(m_responseMIMEType))
-        document = PluginDocument::create(m_frame);
-    else if (!m_client->hasHTMLView())
-        document = PlaceholderDocument::create(m_frame);
-    else
-        document = DOMImplementation::createDocument(m_responseMIMEType, m_frame, m_frame->inViewSourceMode());
-
-    bool resetScripting = !(m_isDisplayingInitialEmptyDocument && m_frame->document()->securityOrigin()->isSecureTransitionTo(url));
-    clear(resetScripting, resetScripting);
-    if (resetScripting)
-        m_frame->script()->updatePlatformScriptObjects();
-
-    m_needsClear = true;
-    m_isComplete = false;
-    m_didCallImplicitClose = false;
-    m_isLoadingMainResource = true;
-    m_isDisplayingInitialEmptyDocument = m_creatingInitialEmptyDocument;
-
     KURL ref(url);
     ref.setUser(String());
     ref.setPass(String());
     ref.removeFragmentIdentifier();
     m_outgoingReferrer = ref.string();
     m_URL = url;
+}
 
-    document->setURL(m_URL);
-    m_frame->setDocument(document);
+void FrameLoader::didBeginDocument(bool dispatch)
+{
+    m_needsClear = true;
+    m_isComplete = false;
+    m_didCallImplicitClose = false;
+    m_isLoadingMainResource = true;
+    m_isDisplayingInitialEmptyDocument = m_creatingInitialEmptyDocument;
 
     if (m_pendingStateObject) {
-        document->statePopped(m_pendingStateObject.get());
+        m_frame->document()->statePopped(m_pendingStateObject.get());
         m_pendingStateObject.clear();
     }
-    
-    if (m_decoder)
-        document->setDecoder(m_decoder.get());
-    if (forcedSecurityOrigin)
-        document->setSecurityOrigin(forcedSecurityOrigin.get());
-
-    m_frame->domWindow()->setURL(document->url());
-    m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
 
     if (dispatch)
         dispatchDidClearWindowObjectsInAllWorlds();
-    
+
     updateFirstPartyForCookies();
 
+<<<<<<< HEAD
     Settings* settings = document->settings();
     document->docLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
 #ifdef ANDROID_BLOCK_NETWORK_IMAGE
     document->docLoader()->setBlockNetworkImage(settings && settings->blockNetworkImage());
 #endif
+=======
+    Settings* settings = m_frame->document()->settings();
+    m_frame->document()->docLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
+>>>>>>> webkit.org at r58033
 
     if (m_documentLoader) {
         String dnsPrefetchControl = m_documentLoader->response().httpHeaderField("X-DNS-Prefetch-Control");
         if (!dnsPrefetchControl.isEmpty())
-            document->parseDNSPrefetchControlHeader(dnsPrefetchControl);
+            m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl);
     }
 
     history()->restoreDocumentState();
-
-    document->implicitOpen();
-    
-    if (m_frame->view() && m_client->hasHTMLView())
-        m_frame->view()->setContentsSize(IntSize());
 }
 
-void FrameLoader::write(const char* str, int len, bool flush)
-{
-    if (len == 0 && !flush)
-        return;
-    
-    if (len == -1)
-        len = strlen(str);
-
-    Tokenizer* tokenizer = m_frame->document()->tokenizer();
-    if (tokenizer && tokenizer->wantsRawData()) {
-        if (len > 0)
-            tokenizer->writeRawData(str, len);
-        return;
-    }
-    
-    if (!m_decoder) {
-        if (Settings* settings = m_frame->settings()) {
-            m_decoder = TextResourceDecoder::create(m_responseMIMEType,
-                settings->defaultTextEncodingName(),
-                settings->usesEncodingDetector());
-            Frame* parentFrame = m_frame->tree()->parent();
-            // Set the hint encoding to the parent frame encoding only if
-            // the parent and the current frames share the security origin.
-            // We impose this condition because somebody can make a child frame 
-            // containing a carefully crafted html/javascript in one encoding
-            // that can be mistaken for hintEncoding (or related encoding) by
-            // an auto detector. When interpreted in the latter, it could be
-            // an attack vector.
-            // FIXME: This might be too cautious for non-7bit-encodings and
-            // we may consider relaxing this later after testing.
-            if (canReferToParentFrameEncoding(m_frame, parentFrame))
-                m_decoder->setHintEncoding(parentFrame->document()->decoder());
-        } else
-            m_decoder = TextResourceDecoder::create(m_responseMIMEType, String());
-        Frame* parentFrame = m_frame->tree()->parent();
-        if (m_encoding.isEmpty()) {
-            if (canReferToParentFrameEncoding(m_frame, parentFrame))
-                m_decoder->setEncoding(parentFrame->document()->inputEncoding(), TextResourceDecoder::EncodingFromParentFrame);
-        } else {
-            m_decoder->setEncoding(m_encoding,
-                m_encodingWasChosenByUser ? TextResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHeader);
-        }
-        m_frame->document()->setDecoder(m_decoder.get());
-    }
-
-    String decoded = m_decoder->decode(str, len);
-    if (flush)
-        decoded += m_decoder->flush();
-    if (decoded.isEmpty())
-        return;
-
-    if (!m_receivedData) {
-        m_receivedData = true;
-        if (m_decoder->encoding().usesVisualOrdering())
-            m_frame->document()->setVisuallyOrdered();
-        m_frame->document()->recalcStyle(Node::Force);
-    }
-
-    if (tokenizer) {
-        ASSERT(!tokenizer->wantsRawData());
-        tokenizer->write(decoded, true);
-    }
-}
-
-void FrameLoader::write(const String& str)
-{
-    if (str.isNull())
-        return;
-
-    if (!m_receivedData) {
-        m_receivedData = true;
-        m_frame->document()->setParseMode(Document::Strict);
-    }
-
-    if (Tokenizer* tokenizer = m_frame->document()->tokenizer())
-        tokenizer->write(str, true);
-}
-
-void FrameLoader::end()
+void FrameLoader::didEndDocument()
 {
     m_isLoadingMainResource = false;
-    endIfNotLoadingMainResource();
-}
-
-void FrameLoader::endIfNotLoadingMainResource()
-{
-    if (m_isLoadingMainResource || !m_frame->page() || !m_frame->document())
-        return;
-
-    // http://bugs.webkit.org/show_bug.cgi?id=10854
-    // The frame's last ref may be removed and it can be deleted by checkCompleted(), 
-    // so we'll add a protective refcount
-    RefPtr<Frame> protector(m_frame);
-
-    // make sure nothing's left in there
-    write(0, 0, true);
-    m_frame->document()->finishParsing();
 }
 
 void FrameLoader::iconLoadDecisionAvailable()
@@ -1277,17 +1140,7 @@
 }
 #endif
 
-String FrameLoader::encoding() const
-{
-    if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
-        return m_encoding;
-    if (m_decoder && m_decoder->encoding().isValid())
-        return m_decoder->encoding().name();
-    Settings* settings = m_frame->settings();
-    return settings ? settings->defaultTextEncodingName() : String();
-}
-
-bool FrameLoader::requestObject(RenderPart* renderer, const String& url, const AtomicString& frameName,
+bool FrameLoader::requestObject(RenderEmbeddedObject* renderer, const String& url, const AtomicString& frameName,
     const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
 {
     if (url.isEmpty() && mimeType.isEmpty())
@@ -1305,7 +1158,11 @@
     bool useFallback;
     if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
         Settings* settings = m_frame->settings();
-        if (!m_client->allowPlugins(settings && settings->arePluginsEnabled())
+        if ((!allowPlugins(AboutToInstantiatePlugin)
+             // Application plugins are plugins implemented by the user agent, for example Qt plugins,
+             // as opposed to third-party code such as flash. The user agent decides whether or not they are
+             // permitted, rather than WebKit.
+             && !MIMETypeRegistry::isApplicationPluginMIMEType(mimeType))
             || (!settings->isJavaEnabled() && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
             return false;
         if (isDocumentSandboxed(SandboxPlugins))
@@ -1374,19 +1231,13 @@
     if (!node)
         return 0;
 
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    ASSERT(node->hasTagName(objectTag) || node->hasTagName(embedTag) 
-        || node->hasTagName(videoTag) || node->hasTagName(audioTag)
-        || node->hasTagName(appletTag));
-#else
     ASSERT(node->hasTagName(objectTag) || node->hasTagName(embedTag) 
         || node->hasTagName(appletTag));
-#endif
 
     return static_cast<HTMLPlugInElement*>(node);
 }
     
-bool FrameLoader::loadPlugin(RenderPart* renderer, const KURL& url, const String& mimeType, 
+bool FrameLoader::loadPlugin(RenderEmbeddedObject* renderer, const KURL& url, const String& mimeType, 
     const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
 {
     RefPtr<Widget> widget;
@@ -1407,12 +1258,59 @@
         if (widget) {
             renderer->setWidget(widget);
             m_containsPlugIns = true;
-        }
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+            renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+#endif
+        } else
+            renderer->setShowsMissingPluginIndicator();
     }
 
     return widget != 0;
 }
 
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url, 
+    const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+    ASSERT(node->hasTagName(videoTag) || node->hasTagName(audioTag));
+
+    if (!m_frame->script()->xssAuditor()->canLoadObject(url.string()))
+        return 0;
+
+    KURL completedURL;
+    if (!url.isEmpty())
+        completedURL = completeURL(url);
+
+    if (!SecurityOrigin::canLoad(completedURL, String(), frame()->document())) {
+        FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
+        return 0;
+    }
+
+    HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node);
+    RenderPart* renderer = toRenderPart(node->renderer());
+    IntSize size;
+
+    if (renderer)
+        size = IntSize(renderer->contentWidth(), renderer->contentHeight());
+    else if (mediaElement->isVideo())
+        size = RenderVideo::defaultSize();
+
+    checkIfRunInsecureContent(m_frame->document()->securityOrigin(), completedURL);
+
+    RefPtr<Widget> widget = m_client->createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
+                                         paramNames, paramValues, "application/x-media-element-proxy-plugin");
+
+    if (widget && renderer) {
+        renderer->setWidget(widget);
+        m_containsPlugIns = true;
+        renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+    }
+
+    return widget ? widget.release() : 0;
+}
+#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+
 String FrameLoader::outgoingReferrer() const
 {
     return m_outgoingReferrer;
@@ -1428,7 +1326,7 @@
     if (context->protocol() != "https")
         return false;  // We only care about HTTPS security origins.
 
-    if (!url.isValid() || url.protocolIs("https") || url.protocolIs("about") || url.protocolIs("data"))
+    if (!url.isValid() || SecurityOrigin::shouldTreatURLSchemeAsSecure(url.protocol()))
         return false;  // Loading these protocols is secure.
 
     return true;
@@ -1499,7 +1397,7 @@
 bool FrameLoader::isProcessingUserGesture()
 {
     Frame* frame = m_frame->tree()->top();
-    if (!frame->script()->canExecuteScripts())
+    if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         return true; // If JavaScript is disabled, a user gesture must have initiated the navigation.
     return frame->script()->processingUserGesture(mainThreadNormalWorld()); // FIXME: Use pageIsProcessingUserGesture.
 }
@@ -1509,12 +1407,10 @@
     m_submittedFormURL = KURL();
 }
 
-void FrameLoader::setEncoding(const String& name, bool userChosen)
+void FrameLoader::willSetEncoding()
 {
     if (!m_workingURL.isEmpty())
         receivedFirstData();
-    m_encoding = name;
-    m_encodingWasChosenByUser = userChosen;
 }
 
 void FrameLoader::addData(const char* bytes, int length)
@@ -1522,7 +1418,7 @@
     ASSERT(m_workingURL.isEmpty());
     ASSERT(m_frame->document());
     ASSERT(m_frame->document()->parsing());
-    write(bytes, length);
+    writer()->addData(bytes, length);
 }
 
 #if ENABLE(WML)
@@ -1778,7 +1674,10 @@
         history()->updateBackForwardListForFragmentScroll();
     }
     
+    String oldURL;
     bool hashChange = equalIgnoringFragmentIdentifier(url, m_URL) && url.fragmentIdentifier() != m_URL.fragmentIdentifier();
+    oldURL = m_URL;
+    
     m_URL = url;
     history()->updateForSameDocumentNavigation();
 
@@ -1789,11 +1688,11 @@
     // It's important to model this as a load that starts and immediately finishes.
     // Otherwise, the parent frame may think we never finished loading.
     started();
-    
-    if (hashChange) {
-        if (FrameView* view = m_frame->view())
-            view->scrollToFragment(m_URL);
-    }
+
+    // We need to scroll to the fragment whether or not a hash change occurred, since
+    // the user might have scrolled since the previous navigation.
+    if (FrameView* view = m_frame->view())
+        view->scrollToFragment(m_URL);
     
     m_isComplete = false;
     checkCompleted();
@@ -1805,13 +1704,15 @@
         checkLoadComplete();
     }
 
+    m_client->dispatchDidNavigateWithinPage();
+
     if (stateObject) {
         m_frame->document()->statePopped(stateObject);
         m_client->dispatchDidPopStateWithinPage();
     }
     
     if (hashChange) {
-        m_frame->document()->dispatchWindowEvent(Event::create(eventNames().hashchangeEvent, false, false));
+        m_frame->document()->enqueueHashchangeEvent(oldURL, m_URL);
         m_client->dispatchDidChangeLocationWithinPage();
     }
     
@@ -1844,6 +1745,15 @@
         frame->loader()->m_isComplete = false;
 }
 
+bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
+{
+    Settings* settings = m_frame->settings();
+    bool allowed = m_client->allowPlugins(settings && settings->arePluginsEnabled());
+    if (!allowed && reason == AboutToInstantiatePlugin)
+        m_frame->loader()->client()->didNotAllowPlugins();
+    return allowed;
+}
+
 bool FrameLoader::containsPlugins() const 
 { 
     return m_containsPlugIns;
@@ -2297,16 +2207,16 @@
     if (m_frame == targetFrame)
         return true;
 
-    // A sandboxed frame can only navigate itself and its descendants.
-    if (isDocumentSandboxed(SandboxNavigation) && !targetFrame->tree()->isDescendantOf(m_frame))
-        return false;
-
     // Let a frame navigate the top-level window that contains it.  This is
     // important to allow because it lets a site "frame-bust" (escape from a
     // frame created by another web site).
-    if (targetFrame == m_frame->tree()->top())
+    if (!isDocumentSandboxed(SandboxTopNavigation) && targetFrame == m_frame->tree()->top())
         return true;
 
+    // A sandboxed frame can only navigate itself and its descendants.
+    if (isDocumentSandboxed(SandboxNavigation) && !targetFrame->tree()->isDescendantOf(m_frame))
+        return false;
+
     // Let a frame navigate its opener if the opener is a top-level window.
     if (!targetFrame->tree()->parent() && m_frame->loader()->opener() == targetFrame)
         return true;
@@ -2645,7 +2555,7 @@
             ASSERT_NOT_REACHED();
     }
 
-    m_responseMIMEType = dl->responseMIMEType();
+    writer()->setMIMEType(dl->responseMIMEType());
 
     // Tell the client we've committed this URL.
     ASSERT(m_frame->view());
@@ -2692,7 +2602,7 @@
     // load as part of the original navigation. If we don't have a document loader, we have
     // no "original" load on which to base a redirect, so we treat the redirect as a normal load.
     // Loads triggered by JavaScript form submissions never count as quick redirects.
-    m_quickRedirectComing = lockBackForwardList && m_documentLoader && !m_isExecutingJavaScriptFormAction;
+    m_quickRedirectComing = (lockBackForwardList || history()->currentItemShouldBeReplaced()) && m_documentLoader && !m_isExecutingJavaScriptFormAction;
 }
 
 bool FrameLoader::shouldReload(const KURL& currentURL, const KURL& destinationURL)
@@ -2737,7 +2647,7 @@
     closeURL();
     
     // Delete old status bar messages (if it _was_ activated on last URL).
-    if (m_frame->script()->canExecuteScripts()) {
+    if (m_frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
         m_frame->setJSStatusBarText(String());
         m_frame->setJSDefaultStatusBarText(String());
     }
@@ -2790,7 +2700,7 @@
     m_frame->domWindow()->setURL(document->url());
     m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
 
-    m_decoder = document->decoder();
+    writer()->setDecoder(document->decoder());
 
     updateFirstPartyForCookies();
 
@@ -2858,7 +2768,15 @@
     
 #if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size
     // If loading a webarchive, run through webarchive machinery
+#if PLATFORM(CHROMIUM)
+    // https://bugs.webkit.org/show_bug.cgi?id=36426
+    // FIXME: For debugging purposes, should be removed before closing the bug.
+    // Make real copy of the string so we fail here if the responseMIMEType
+    // string is bad.
+    const String responseMIMEType = loader->responseMIMEType();
+#else
     const String& responseMIMEType = loader->responseMIMEType();
+#endif
 
     // FIXME: Mac's FrameLoaderClient::finishedLoading() method does work that is required even with Archive loads
     // so we still need to call it.  Other platforms should only call finishLoading for non-archive loads
@@ -2883,14 +2801,14 @@
     ArchiveResource* mainResource = archive->mainResource();
     loader->setParsedArchiveData(mainResource->data());
 
-    m_responseMIMEType = mainResource->mimeType();
+    writer()->setMIMEType(mainResource->mimeType());
 
     closeURL();
     didOpenURL(mainResource->url());
 
     String userChosenEncoding = documentLoader()->overrideEncoding();
     bool encodingIsUserChosen = !userChosenEncoding.isNull();
-    setEncoding(encodingIsUserChosen ? userChosenEncoding : mainResource->textEncoding(), encodingIsUserChosen);
+    writer()->setEncoding(encodingIsUserChosen ? userChosenEncoding : mainResource->textEncoding(), encodingIsUserChosen);
 
     ASSERT(m_frame->document());
 
@@ -3307,7 +3225,7 @@
     // Always try UTF-8. If that fails, try frame encoding (if any) and then the default.
     // For a newly opened frame with an empty URL, encoding() should not be used, because this methods asks decoder, which uses ISO-8859-1.
     Settings* settings = m_frame->settings();
-    request.setResponseContentDispositionEncodingFallbackArray("UTF-8", m_URL.isEmpty() ? m_encoding : encoding(), settings ? settings->defaultTextEncodingName() : String());
+    request.setResponseContentDispositionEncodingFallbackArray("UTF-8", writer()->deprecatedFrameEncoding(), settings ? settings->defaultTextEncodingName() : String());
 }
 
 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, String origin)
@@ -3769,7 +3687,7 @@
 {
     Frame* frame = m_frame->tree()->find(name);
     if (!shouldAllowNavigation(frame))
-        return 0;  
+        return 0;
     return frame;
 }
 
@@ -3896,9 +3814,11 @@
     // - The HistoryItem has a history state object
     // - Navigating to an anchor within the page, with no form data stored on the target item or the current history entry,
     //   and the URLs in the frame tree match the history item for fragment scrolling.
+    // - The HistoryItem is not the same as the current item, because such cases are treated as a new load.
     HistoryItem* currentItem = history()->currentItem();
-    bool sameDocumentNavigation = (!item->formData() && !(currentItem && currentItem->formData()) && history()->urlsMatchItem(item))
-                                  || (currentItem && item->documentSequenceNumber() == currentItem->documentSequenceNumber());
+    bool sameDocumentNavigation = ((!item->formData() && !(currentItem && currentItem->formData()) && history()->urlsMatchItem(item))
+                                  || (currentItem && item->documentSequenceNumber() == currentItem->documentSequenceNumber()))
+                                  && item != currentItem;
 
 #if ENABLE(WML)
     // All WML decks should go through the real load mechanism, not the scroll-to-anchor code
@@ -3986,7 +3906,7 @@
 
 void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 {
-    if (!m_frame->script()->canExecuteScripts())
+    if (!m_frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         return;
 
     Vector<DOMWrapperWorld*> worlds;
@@ -3997,7 +3917,7 @@
 
 void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
 {
-    if (!m_frame->script()->canExecuteScripts() || !m_frame->script()->existingWindowShell(world))
+    if (!m_frame->script()->canExecuteScripts(NotAboutToExecuteScript) || !m_frame->script()->existingWindowShell(world))
         return;
 
     m_client->dispatchDidClearWindowObjectInWorld(world);
@@ -4009,15 +3929,13 @@
     if (Page* page = m_frame->page()) {
         if (InspectorController* inspector = page->inspectorController())
             inspector->inspectedWindowScriptObjectCleared(m_frame);
-        if (InspectorController* inspector = page->parentInspectorController())
-            inspector->windowScriptObjectAvailable();
     }
 #endif
 }
 
 void FrameLoader::updateSandboxFlags()
 {
-    SandboxFlags flags = SandboxNone;
+    SandboxFlags flags = m_forcedSandboxFlags;
     if (Frame* parentFrame = m_frame->tree()->parent())
         flags |= parentFrame->loader()->sandboxFlags();
     if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index abe3b3a..adfebd4 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -32,6 +32,7 @@
 #define FrameLoader_h
 
 #include "CachePolicy.h"
+#include "DocumentWriter.h"
 #include "FrameLoaderTypes.h"
 #include "HistoryController.h"
 #include "PolicyCallback.h"
@@ -67,7 +68,10 @@
 class IconLoader;
 class IntSize;
 class NavigationAction;
-class RenderPart;
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+class Node;
+#endif
+class RenderEmbeddedObject;
 class ResourceError;
 class ResourceLoader;
 class ResourceResponse;
@@ -98,6 +102,7 @@
     PolicyChecker* policyChecker() const { return &m_policyChecker; }
     HistoryController* history() const { return &m_history; }
     ResourceLoadNotifier* notifier() const { return &m_notifer; }
+    DocumentWriter* writer() const { return &m_writer; }
 
     // FIXME: This is not cool, people. There are too many different functions that all start loads.
     // We should aim to consolidate these into a smaller set of functions, and try to reuse more of
@@ -215,7 +220,7 @@
 
     void changeLocation(const KURL&, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false, bool refresh = false);
     void urlSelected(const ResourceRequest&, const String& target, PassRefPtr<Event>, bool lockHistory, bool lockBackForwardList, bool userGesture, ReferrerPolicy);
-    bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName);
+    bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName, bool lockHistory = true, bool lockBackForwardList = true);
 
     void submitForm(const char* action, const String& url,
         PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary,
@@ -227,24 +232,16 @@
 
     void didExplicitOpen();
 
+    // Callbacks from DocumentWriter
+    void didBeginDocument(bool dispatchWindowObjectAvailable);
+    void didEndDocument();
+    void willSetEncoding();
+
     KURL iconURL();
     void commitIconURLToIconDatabase(const KURL&);
 
     KURL baseURL() const;
 
-    void replaceDocument(const String&);
-
-    void begin();
-    void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityOrigin* forcedSecurityOrigin = 0);
-
-    void write(const char* string, int length = -1, bool flush = false);
-    void write(const String&);
-    void end();
-    void endIfNotLoadingMainResource();
-
-    void setEncoding(const String& encoding, bool userChosen);
-    String encoding() const;
-
     void tokenizerProcessedData();
 
     void handledOnloadEvents();
@@ -260,6 +257,9 @@
 
     bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
     SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
+    // The following sandbox flags will be forced, regardless of changes to
+    // the sandbox attribute of any parent frames.
+    void setForcedSandboxFlags(SandboxFlags flags) { m_forcedSandboxFlags = flags; m_sandboxFlags |= flags; }
 
     // Mixed content related functions.
     static bool isMixedContent(SecurityOrigin* context, const KURL&);
@@ -281,9 +281,10 @@
 
     const KURL& url() const { return m_URL; }
 
-    void setResponseMIMEType(const String&);
-    const String& responseMIMEType() const;
+    // setURL is a low-level setter and does not trigger loading.
+    void setURL(const KURL&);
 
+    bool allowPlugins(ReasonForCallingAllowPlugins);
     bool containsPlugins() const;
 
     void loadDone();
@@ -294,7 +295,7 @@
 
     bool isComplete() const;
 
-    bool requestObject(RenderPart* frame, const String& url, const AtomicString& frameName,
+    bool requestObject(RenderEmbeddedObject*, const String& url, const AtomicString& frameName,
         const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
 
     KURL completeURL(const String& url);
@@ -323,6 +324,10 @@
 
     void open(CachedFrameBase&);
 
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    PassRefPtr<Widget> loadMediaPlayerProxyPlugin(Node*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+#endif
+
     // FIXME: Should these really be public?
     void completed();
     bool allAncestorsAreComplete() const; // including this
@@ -340,6 +345,10 @@
 
     static ObjectContentType defaultObjectContentType(const KURL& url, const String& mimeType);
 
+    bool isDisplayingInitialEmptyDocument() const { return m_isDisplayingInitialEmptyDocument; }
+
+    void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
+    
 private:
     bool canCachePageContainingThisFrame();
 #ifndef NDEBUG
@@ -352,8 +361,8 @@
     void started();
 
     bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
-    bool loadPlugin(RenderPart*, const KURL&, const String& mimeType,
-    const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
+    bool loadPlugin(RenderEmbeddedObject*, const KURL&, const String& mimeType,
+        const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
     
     void navigateWithinDocument(HistoryItem*);
     void navigateToDifferentDocument(HistoryItem*, FrameLoadType);
@@ -404,8 +413,6 @@
 
     void updateHistoryAfterClientRedirect();
 
-    void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
-
     bool shouldReloadToHandleUnreachableURL(DocumentLoader*);
 
     void dispatchDidCommitLoad();
@@ -465,6 +472,7 @@
     mutable PolicyChecker m_policyChecker;
     mutable HistoryController m_history;
     mutable ResourceLoadNotifier m_notifer;
+    mutable DocumentWriter m_writer;
 
     FrameState m_state;
     FrameLoadType m_loadType;
@@ -488,8 +496,6 @@
 
     bool m_isExecutingJavaScriptFormAction;
 
-    String m_responseMIMEType;
-
     bool m_didCallImplicitClose;
     bool m_wasUnloadEventEmitted;
     bool m_unloadEventBeingDispatched;
@@ -509,10 +515,6 @@
     bool m_needsClear;
     bool m_receivedData;
 
-    bool m_encodingWasChosenByUser;
-    String m_encoding;
-    RefPtr<TextResourceDecoder> m_decoder;
-
     bool m_containsPlugIns;
 
     KURL m_submittedFormURL;
@@ -533,6 +535,7 @@
     bool m_suppressOpenerInNewFrame;
     
     SandboxFlags m_sandboxFlags;
+    SandboxFlags m_forcedSandboxFlags;
 
 #ifndef NDEBUG
     bool m_didDispatchDidCommitLoad;
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 4f78805..b2931c8 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,6 @@
 #include "FrameLoaderTypes.h"
 #include "ScrollTypes.h"
 #include <wtf/Forward.h>
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 typedef class _jobject* jobject;
@@ -56,6 +55,9 @@
     class HistoryItem;
     class HTMLAppletElement;
     class HTMLFrameOwnerElement;
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    class HTMLMediaElement;
+#endif
     class HTMLPlugInElement;
     class IntSize;
     class KURL;
@@ -110,12 +112,12 @@
         virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) = 0;
         virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&) = 0;
         virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length) = 0;
-        virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString&) = 0;
 
         virtual void dispatchDidHandleOnloadEvents() = 0;
         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
         virtual void dispatchDidCancelClientRedirect() = 0;
         virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate) = 0;
+        virtual void dispatchDidNavigateWithinPage() { }
         virtual void dispatchDidChangeLocationWithinPage() = 0;
         virtual void dispatchDidPushStateWithinPage() = 0;
         virtual void dispatchDidReplaceStateWithinPage() = 0;
@@ -226,6 +228,9 @@
         virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) = 0;
 
         virtual void dispatchDidFailToStartPlugin(const PluginView*) const { }
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+        virtual PassRefPtr<Widget> createMediaPlayerProxyPlugin(const IntSize&, HTMLMediaElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&) = 0;
+#endif
 
         virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) = 0;
         virtual String overrideMediaType() const = 0;
@@ -263,6 +268,15 @@
         virtual bool allowJavaScript(bool enabledPerSettings) { return enabledPerSettings; }
         virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; }
         virtual bool allowImages(bool enabledPerSettings) { return enabledPerSettings; }
+
+        // This callback notifies the client that the frame was about to run
+        // JavaScript but did not because allowJavaScript returned false. We
+        // have a separate callback here because there are a number of places
+        // that need to know if JavaScript is enabled but are not necessarily
+        // preparing to execute script.
+        virtual void didNotAllowScript() { }
+        // This callback is similar, but for plugins.
+        virtual void didNotAllowPlugins() { }
     };
 
 } // namespace WebCore
diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h
index 8288bce..34872ad 100644
--- a/WebCore/loader/FrameLoaderTypes.h
+++ b/WebCore/loader/FrameLoaderTypes.h
@@ -92,7 +92,7 @@
         SendReferrer,
         NoReferrer
     };
-    
+
     enum SandboxFlag {
         SandboxNone = 0,
         SandboxNavigation = 1,
@@ -100,14 +100,20 @@
         SandboxOrigin = 1 << 2,
         SandboxForms = 1 << 3,
         SandboxScripts = 1 << 4,
+        SandboxTopNavigation = 1 << 5,
         SandboxAll = -1 // Mask with all bits set to 1.
     };
-    
+
     enum SecurityCheckPolicy {
         SkipSecurityCheck,
         DoSecurityCheck
     };
 
+    enum ReasonForCallingAllowPlugins {
+        AboutToInstantiatePlugin,
+        NotAboutToInstantiatePlugin
+    };
+
     typedef int SandboxFlags;
 }
 
diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp
index 55b68dc..e3d3b6b 100644
--- a/WebCore/loader/HistoryController.cpp
+++ b/WebCore/loader/HistoryController.cpp
@@ -33,7 +33,6 @@
 
 #include "BackForwardList.h"
 #include "CachedPage.h"
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -46,6 +45,7 @@
 #include "PageCache.h"
 #include "PageGroup.h"
 #include "Settings.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -445,6 +445,15 @@
         m_currentItem->setTitle(title);
 }
 
+bool HistoryController::currentItemShouldBeReplaced() const
+{
+    // From the HTML5 spec for location.assign():
+    //  "If the browsing context's session history contains only one Document,
+    //   and that was the about:blank Document created when the browsing context
+    //   was created, then the navigation must be done with replacement enabled."
+    return m_currentItem && !m_previousItem && equalIgnoringCase(m_currentItem->urlString(), blankURL());
+}
+
 void HistoryController::setProvisionalItem(HistoryItem* item)
 {
     m_provisionalItem = item;
@@ -656,15 +665,17 @@
 
 void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
 {
-    Page* page = m_frame->page();
-    ASSERT(page);
-    HistoryItem* current = page->backForwardList()->currentItem();
-    ASSERT(current);
+    // FIXME: We should always have m_currentItem here!!
+    // https://bugs.webkit.org/show_bug.cgi?id=36464
+    if (!m_currentItem) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
 
     if (!urlString.isEmpty())
-        current->setURLString(urlString);
-    current->setTitle(title);
-    current->setStateObject(stateObject);
+        m_currentItem->setURLString(urlString);
+    m_currentItem->setTitle(title);
+    m_currentItem->setStateObject(stateObject);
 }
 
 } // namespace WebCore
diff --git a/WebCore/loader/HistoryController.h b/WebCore/loader/HistoryController.h
index 7c4a1ac..64f7854 100644
--- a/WebCore/loader/HistoryController.h
+++ b/WebCore/loader/HistoryController.h
@@ -72,6 +72,7 @@
     HistoryItem* currentItem() const { return m_currentItem.get(); }
     void setCurrentItem(HistoryItem*);
     void setCurrentItemTitle(const String&);
+    bool currentItemShouldBeReplaced() const;
 
     HistoryItem* provisionalItem() const { return m_provisionalItem.get(); }
     void setProvisionalItem(HistoryItem*);
diff --git a/WebCore/loader/ImageLoader.cpp b/WebCore/loader/ImageLoader.cpp
index 929b28a..5625b52 100644
--- a/WebCore/loader/ImageLoader.cpp
+++ b/WebCore/loader/ImageLoader.cpp
@@ -277,6 +277,11 @@
     loadEventSender().dispatchPendingEvents();
 }
 
+void ImageLoader::elementWillMoveToNewOwnerDocument()
+{
+    setImage(0);
+}
+
 ImageEventSender::ImageEventSender(const AtomicString& eventType)
     : m_eventType(eventType)
     , m_timer(this, &ImageEventSender::timerFired)
diff --git a/WebCore/loader/ImageLoader.h b/WebCore/loader/ImageLoader.h
index 44fe98e..a585354 100644
--- a/WebCore/loader/ImageLoader.h
+++ b/WebCore/loader/ImageLoader.h
@@ -45,6 +45,8 @@
     // doesn't change; starts new load unconditionally (matches Firefox and Opera behavior).
     void updateFromElementIgnoringPreviousError();
 
+    void elementWillMoveToNewOwnerDocument();
+
     Element* element() const { return m_element; }
     bool imageComplete() const { return m_imageComplete; }
 
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 3e75880..28587e2 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -285,7 +285,7 @@
 #if PLATFORM(QT)
 void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResponse& r)
 {
-    if (!m_frame->settings()->arePluginsEnabled())
+    if (!m_frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return;
 
     String filename = r.url().lastPathComponent();
@@ -517,7 +517,7 @@
     else if (shouldLoadEmpty || frameLoader()->representationExistsForURLScheme(url.protocol()))
         handleEmptyLoad(url, !shouldLoadEmpty);
     else
-        m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true, true);
+        m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true);
 
     return false;
 }
diff --git a/WebCore/loader/MainResourceLoader.h b/WebCore/loader/MainResourceLoader.h
index eaaf2e8..5ed0cc8 100644
--- a/WebCore/loader/MainResourceLoader.h
+++ b/WebCore/loader/MainResourceLoader.h
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef MainResourceLoader_h
+#define MainResourceLoader_h
+
 #include "FrameLoaderTypes.h"
 #include "ResourceLoader.h"
 #include "SubstituteData.h"
@@ -107,3 +110,5 @@
     };
 
 }
+
+#endif
diff --git a/WebCore/loader/MediaDocument.cpp b/WebCore/loader/MediaDocument.cpp
index a2d6276..27361fc 100644
--- a/WebCore/loader/MediaDocument.cpp
+++ b/WebCore/loader/MediaDocument.cpp
@@ -227,7 +227,7 @@
         embedElement->setAttribute(heightAttr, "100%");
         embedElement->setAttribute(nameAttr, "plugin");
         embedElement->setAttribute(srcAttr, url().string());
-        embedElement->setAttribute(typeAttr, frame()->loader()->responseMIMEType());
+        embedElement->setAttribute(typeAttr, frame()->loader()->writer()->mimeType());
 
         ExceptionCode ec;
         videoElement->parent()->replaceChild(embedElement, videoElement, ec);
diff --git a/WebCore/loader/PluginDocument.cpp b/WebCore/loader/PluginDocument.cpp
index 788691f..7024333 100644
--- a/WebCore/loader/PluginDocument.cpp
+++ b/WebCore/loader/PluginDocument.cpp
@@ -34,6 +34,7 @@
 #include "HTMLNames.h"
 #include "MainResourceLoader.h"
 #include "Page.h"
+#include "RenderEmbeddedObject.h"
 #include "RenderWidget.h"
 #include "SegmentedString.h"
 #include "Settings.h"
@@ -47,6 +48,7 @@
 class PluginTokenizer : public Tokenizer {
 public:
     PluginTokenizer(Document* doc) : m_doc(doc), m_embedElement(0) {}
+    static Widget* pluginWidgetFromDocument(Document* doc);
         
 private:
     virtual void write(const SegmentedString&, bool appendData);
@@ -62,7 +64,21 @@
     Document* m_doc;
     HTMLEmbedElement* m_embedElement;
 };
-    
+
+Widget* PluginTokenizer::pluginWidgetFromDocument(Document* doc)
+{
+    ASSERT(doc);
+    RefPtr<Element> body = doc->body();
+    if (body) {
+        RefPtr<Node> node = body->firstChild();
+        if (node && node->renderer()) {
+            ASSERT(node->renderer()->isEmbeddedObject());
+            return toRenderEmbeddedObject(node->renderer())->widget();
+        }
+    }
+    return 0;
+}
+
 void PluginTokenizer::write(const SegmentedString&, bool)
 {
     ASSERT_NOT_REACHED();
@@ -89,7 +105,7 @@
     
     m_embedElement->setAttribute(nameAttr, "plugin");
     m_embedElement->setAttribute(srcAttr, m_doc->url().string());
-    m_embedElement->setAttribute(typeAttr, m_doc->frame()->loader()->responseMIMEType());
+    m_embedElement->setAttribute(typeAttr, m_doc->frame()->loader()->writer()->mimeType());
     
     body->appendChild(embedElement, ec);    
 }
@@ -104,7 +120,7 @@
 
     if (Frame* frame = m_doc->frame()) {
         Settings* settings = frame->settings();
-        if (settings && settings->arePluginsEnabled()) {
+        if (settings && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin)) {
             m_doc->updateLayout();
 
             if (RenderWidget* renderer = toRenderWidget(m_embedElement->renderer())) {
@@ -146,5 +162,19 @@
 {
     return new PluginTokenizer(this);
 }
-    
+
+Widget* PluginDocument::pluginWidget()
+{
+    return PluginTokenizer::pluginWidgetFromDocument(this);
+}
+
+Node* PluginDocument::pluginNode()
+{
+    RefPtr<Element> body_element = body();
+    if (body_element)
+        return body_element->firstChild();
+
+    return 0;
+}
+
 }
diff --git a/WebCore/loader/PluginDocument.h b/WebCore/loader/PluginDocument.h
index 1d5c964..7b4b36b 100644
--- a/WebCore/loader/PluginDocument.h
+++ b/WebCore/loader/PluginDocument.h
@@ -28,7 +28,9 @@
 #include "HTMLDocument.h"
 
 namespace WebCore {
-    
+
+class Node;
+class Widget;
 class PluginDocument : public HTMLDocument {
 public:
     static PassRefPtr<PluginDocument> create(Frame* frame)
@@ -36,6 +38,9 @@
         return adoptRef(new PluginDocument(frame));
     }
 
+    Widget* pluginWidget();
+    Node* pluginNode();
+
 private:
     PluginDocument(Frame*);
 
diff --git a/WebCore/loader/ProgressTracker.cpp b/WebCore/loader/ProgressTracker.cpp
index 458de68..2e12204 100644
--- a/WebCore/loader/ProgressTracker.cpp
+++ b/WebCore/loader/ProgressTracker.cpp
@@ -26,13 +26,13 @@
 #include "config.h"
 #include "ProgressTracker.h"
 
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "Logging.h"
 #include "ResourceResponse.h"
+#include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 
 using std::min;
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index 4b44422..fbbfb0c 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -43,91 +43,168 @@
 #include "HTMLFormElement.h"
 #include "HTMLFrameOwnerElement.h"
 #include "Page.h"
+#include "UserGestureIndicator.h"
 #include <wtf/CurrentTime.h>
 
 namespace WebCore {
 
-struct ScheduledRedirection : Noncopyable {
-    enum Type { redirection, locationChange, historyNavigation, formSubmission };
-
-    const Type type;
-    const double delay;
-    const String url;
-    const String referrer;
-    const FrameLoadRequest frameRequest;
-    const RefPtr<Event> event;
-    const RefPtr<FormState> formState;
-    const int historySteps;
-    const bool lockHistory;
-    const bool lockBackForwardList;
-    const bool wasUserGesture;
-    const bool wasRefresh;
-    const bool wasDuringLoad;
-    bool toldClient;
-
-    ScheduledRedirection(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool refresh)
-        : type(redirection)
-        , delay(delay)
-        , url(url)
-        , historySteps(0)
-        , lockHistory(lockHistory)
-        , lockBackForwardList(lockBackForwardList)
-        , wasUserGesture(wasUserGesture)
-        , wasRefresh(refresh)
-        , wasDuringLoad(false)
-        , toldClient(false)
+class ScheduledNavigation : public Noncopyable {
+public:
+    ScheduledNavigation(double delay, bool lockHistory, bool lockBackForwardList, bool wasDuringLoad)
+        : m_delay(delay)
+        , m_lockHistory(lockHistory)
+        , m_lockBackForwardList(lockBackForwardList)
+        , m_wasDuringLoad(wasDuringLoad)
     {
-        ASSERT(!url.isEmpty());
     }
+    virtual ~ScheduledNavigation() { }
 
-    ScheduledRedirection(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool refresh, bool duringLoad)
-        : type(locationChange)
-        , delay(0)
-        , url(url)
-        , referrer(referrer)
-        , historySteps(0)
-        , lockHistory(lockHistory)
-        , lockBackForwardList(lockBackForwardList)
-        , wasUserGesture(wasUserGesture)
-        , wasRefresh(refresh)
-        , wasDuringLoad(duringLoad)
-        , toldClient(false)
-    {
-        ASSERT(!url.isEmpty());
-    }
+    virtual void fire(Frame*) = 0;
 
-    explicit ScheduledRedirection(int historyNavigationSteps)
-        : type(historyNavigation)
-        , delay(0)
-        , historySteps(historyNavigationSteps)
-        , lockHistory(false)
-        , lockBackForwardList(false)
-        , wasUserGesture(false)
-        , wasRefresh(false)
-        , wasDuringLoad(false)
-        , toldClient(false)
+    // This method feels a bit like RTTI, but I don't see a cleaner way to get the behavior we want.
+    virtual bool isLocationChange() const { return true; }
+
+    virtual bool shouldStartTimer(Frame*) { return true; }
+    virtual void didStartTimer(Frame*, Timer<RedirectScheduler>*) { }
+    virtual void didStopTimer(Frame*, bool /* newLoadInProgress */) { }
+
+    double delay() const { return m_delay; }
+    bool lockHistory() const { return m_lockHistory; }
+    bool lockBackForwardList() const { return m_lockBackForwardList; }
+    bool wasDuringLoad() const { return m_wasDuringLoad; }
+
+private:
+    double m_delay;
+    bool m_lockHistory;
+    bool m_lockBackForwardList;
+    bool m_wasDuringLoad;
+};
+
+class ScheduledURLNavigation : public ScheduledNavigation {
+public:
+    ScheduledURLNavigation(double delay, const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad)
+        : ScheduledNavigation(delay, lockHistory, lockBackForwardList, duringLoad)
+        , m_url(url)
+        , m_referrer(referrer)
+        , m_wasUserGesture(wasUserGesture)
+        , m_haveToldClient(false)
     {
     }
 
-    ScheduledRedirection(const FrameLoadRequest& frameRequest,
-            bool lockHistory, bool lockBackForwardList, PassRefPtr<Event> event, PassRefPtr<FormState> formState,
-            bool duringLoad)
-        : type(formSubmission)
-        , delay(0)
-        , frameRequest(frameRequest)
-        , event(event)
-        , formState(formState)
-        , historySteps(0)
-        , lockHistory(lockHistory)
-        , lockBackForwardList(lockBackForwardList)
-        , wasUserGesture(false)
-        , wasRefresh(false)
-        , wasDuringLoad(duringLoad)
-        , toldClient(false)
+    virtual void fire(Frame* frame)
+    {
+        frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), m_wasUserGesture, false);
+    }
+
+    virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
+    {
+        if (m_haveToldClient)
+            return;
+        m_haveToldClient = true;
+        frame->loader()->clientRedirected(KURL(ParsedURLString, m_url), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
+    }
+
+    virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
+    {
+        if (!m_haveToldClient)
+            return;
+        frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
+    }
+
+    String url() const { return m_url; }
+    String referrer() const { return m_referrer; }
+    bool wasUserGesture() const { return m_wasUserGesture; }
+
+private:
+    String m_url;
+    String m_referrer;
+    bool m_wasUserGesture;
+    bool m_haveToldClient;
+};
+
+class ScheduledRedirect : public ScheduledURLNavigation {
+public:
+    ScheduledRedirect(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
+        : ScheduledURLNavigation(delay, url, String(), lockHistory, lockBackForwardList, wasUserGesture, false) { }
+
+    virtual bool isLocationChange() const { return false; }
+    virtual bool shouldStartTimer(Frame* frame) { return frame->loader()->allAncestorsAreComplete(); }
+};
+
+class ScheduledLocationChange : public ScheduledURLNavigation {
+public:
+    ScheduledLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad)
+        : ScheduledURLNavigation(0.0, url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad) { }
+};
+
+class ScheduledRefresh : public ScheduledURLNavigation {
+public:
+    ScheduledRefresh(const String& url, const String& referrer, bool wasUserGesture)
+        : ScheduledURLNavigation(0.0, url, referrer, true, true, wasUserGesture, false) { }
+
+    virtual void fire(Frame* frame)
+    {
+        frame->loader()->changeLocation(KURL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), wasUserGesture(), true);
+    }
+};
+
+class ScheduledHistoryNavigation : public ScheduledNavigation {
+public:
+    explicit ScheduledHistoryNavigation(int historySteps) : ScheduledNavigation(0, false, false, false), m_historySteps(historySteps) { }
+
+    virtual void fire(Frame* frame)
+    {
+        FrameLoader* loader = frame->loader();
+        if (!m_historySteps) {
+            // Special case for go(0) from a frame -> reload only the frame
+            loader->urlSelected(loader->url(), "", 0, lockHistory(), lockBackForwardList(), false, SendReferrer);
+            return;
+        }
+        // go(i!=0) from a frame navigates into the history of the frame only,
+        // in both IE and NS (but not in Mozilla). We can't easily do that.
+        frame->page()->goBackOrForward(m_historySteps);
+    }
+
+private:
+    int m_historySteps;
+};
+
+class ScheduledFormSubmission : public ScheduledNavigation {
+public:
+    ScheduledFormSubmission(const FrameLoadRequest& frameRequest, bool lockHistory, bool lockBackForwardList, PassRefPtr<Event> event, PassRefPtr<FormState> formState, bool duringLoad)
+        : ScheduledNavigation(0, lockHistory, lockBackForwardList, duringLoad)
+        , m_frameRequest(frameRequest)
+        , m_event(event)
+        , m_formState(formState)
+        , m_wasProcessingUserGesture(UserGestureIndicator::processingUserGesture())
     {
         ASSERT(!frameRequest.isEmpty());
-        ASSERT(this->formState);
+        ASSERT(m_formState);
     }
+
+    virtual void fire(Frame* frame)
+    {
+        UserGestureIndicator gestureIndicator(m_wasProcessingUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
+
+        // The submitForm function will find a target frame before using the redirection timer.
+        // Now that the timer has fired, we need to repeat the security check which normally is done when
+        // selecting a target, in case conditions have changed. Other code paths avoid this by targeting
+        // without leaving a time window. If we fail the check just silently drop the form submission.
+        if (!m_formState->sourceFrame()->loader()->shouldAllowNavigation(frame))
+            return;
+        frame->loader()->loadFrameRequest(m_frameRequest, lockHistory(), lockBackForwardList(), m_event, m_formState, SendReferrer);
+    }
+
+    // FIXME: Implement didStartTimer? It would make sense to report form
+    // submissions as client redirects too. But we didn't do that in the past
+    // when form submission used a separate delay mechanism, so doing it will
+    // be a behavior change.
+
+private:
+    const FrameLoadRequest m_frameRequest;
+    const RefPtr<Event> m_event;
+    const RefPtr<FormState> m_formState;
+    bool m_wasProcessingUserGesture;
 };
 
 RedirectScheduler::RedirectScheduler(Frame* frame)
@@ -142,29 +219,27 @@
 
 bool RedirectScheduler::redirectScheduledDuringLoad()
 {
-    return m_scheduledRedirection && m_scheduledRedirection->wasDuringLoad;
+    return m_redirect && m_redirect->wasDuringLoad();
 }
 
 void RedirectScheduler::clear()
 {
     m_timer.stop();
-    m_scheduledRedirection.clear();
+    m_redirect.clear();
 }
 
 void RedirectScheduler::scheduleRedirect(double delay, const String& url)
 {
-    if (delay < 0 || delay > INT_MAX / 1000)
-        return;
-        
     if (!m_frame->page())
         return;
-
+    if (delay < 0 || delay > INT_MAX / 1000)
+        return;
     if (url.isEmpty())
         return;
 
     // We want a new history item if the refresh timeout is > 1 second.
-    if (!m_scheduledRedirection || delay <= m_scheduledRedirection->delay)
-        schedule(new ScheduledRedirection(delay, url, true, delay <= 1, false, false));
+    if (!m_redirect || delay <= m_redirect->delay())
+        schedule(new ScheduledRedirect(delay, url, true, delay <= 1, false));
 }
 
 bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame)
@@ -172,7 +247,7 @@
     // Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
     // The definition of "during load" is any time before all handlers for the load event have been run.
     // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
-    
+
     for (Frame* ancestor = targetFrame->tree()->parent(); ancestor; ancestor = ancestor->tree()->parent()) {
         Document* document = ancestor->document();
         if (!ancestor->loader()->isComplete() || (document && document->processingLoadEvent()))
@@ -185,7 +260,6 @@
 {
     if (!m_frame->page())
         return;
-
     if (url.isEmpty())
         return;
 
@@ -205,7 +279,7 @@
     // This may happen when a frame changes the location of another frame.
     bool duringLoad = !loader->committedFirstRealDocumentLoad();
 
-    schedule(new ScheduledRedirection(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, false, duringLoad));
+    schedule(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad));
 }
 
 void RedirectScheduler::scheduleFormSubmission(const FrameLoadRequest& frameRequest,
@@ -227,37 +301,25 @@
 
     bool lockBackForwardList = mustLockBackForwardList(m_frame) || (formState->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
 
-    schedule(new ScheduledRedirection(frameRequest, lockHistory, lockBackForwardList, event, formState, duringLoad));
+    schedule(new ScheduledFormSubmission(frameRequest, lockHistory, lockBackForwardList, event, formState, duringLoad));
 }
 
 void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
 {
     if (!m_frame->page())
         return;
-    
     const KURL& url = m_frame->loader()->url();
-
     if (url.isEmpty())
         return;
 
-    schedule(new ScheduledRedirection(url.string(), m_frame->loader()->outgoingReferrer(), true, true, wasUserGesture, true, false));
+    schedule(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture));
 }
 
 bool RedirectScheduler::locationChangePending()
 {
-    if (!m_scheduledRedirection)
+    if (!m_redirect)
         return false;
-
-    switch (m_scheduledRedirection->type) {
-        case ScheduledRedirection::redirection:
-            return false;
-        case ScheduledRedirection::historyNavigation:
-        case ScheduledRedirection::locationChange:
-        case ScheduledRedirection::formSubmission:
-            return true;
-    }
-    ASSERT_NOT_REACHED();
-    return false;
+    return m_redirect->isLocationChange();
 }
 
 void RedirectScheduler::scheduleHistoryNavigation(int steps)
@@ -284,119 +346,64 @@
 #endif
     
     // In all other cases, schedule the history traversal to occur asynchronously.
-    schedule(new ScheduledRedirection(steps));
+    schedule(new ScheduledHistoryNavigation(steps));
 }
 
 void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
 {
     if (!m_frame->page())
         return;
-
     if (m_frame->page()->defersLoading())
         return;
 
-    OwnPtr<ScheduledRedirection> redirection(m_scheduledRedirection.release());
-    FrameLoader* loader = m_frame->loader();
-
-    switch (redirection->type) {
-        case ScheduledRedirection::redirection:
-        case ScheduledRedirection::locationChange:
-            loader->changeLocation(KURL(ParsedURLString, redirection->url), redirection->referrer,
-                redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture, redirection->wasRefresh);
-            return;
-        case ScheduledRedirection::historyNavigation:
-            if (redirection->historySteps == 0) {
-                // Special case for go(0) from a frame -> reload only the frame
-                loader->urlSelected(loader->url(), "", 0, redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture, SendReferrer);
-                return;
-            }
-            // go(i!=0) from a frame navigates into the history of the frame only,
-            // in both IE and NS (but not in Mozilla). We can't easily do that.
-            m_frame->page()->goBackOrForward(redirection->historySteps);
-            return;
-        case ScheduledRedirection::formSubmission:
-            // The submitForm function will find a target frame before using the redirection timer.
-            // Now that the timer has fired, we need to repeat the security check which normally is done when
-            // selecting a target, in case conditions have changed. Other code paths avoid this by targeting
-            // without leaving a time window. If we fail the check just silently drop the form submission.
-            if (!redirection->formState->sourceFrame()->loader()->shouldAllowNavigation(m_frame))
-                return;
-            loader->loadFrameRequest(redirection->frameRequest, redirection->lockHistory, redirection->lockBackForwardList,
-                redirection->event, redirection->formState, SendReferrer);
-            return;
-    }
-
-    ASSERT_NOT_REACHED();
+    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
+    redirect->fire(m_frame);
 }
 
-void RedirectScheduler::schedule(PassOwnPtr<ScheduledRedirection> redirection)
+void RedirectScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
 {
     ASSERT(m_frame->page());
-    FrameLoader* loader = m_frame->loader();
 
     // If a redirect was scheduled during a load, then stop the current load.
     // Otherwise when the current load transitions from a provisional to a 
     // committed state, pending redirects may be cancelled. 
-    if (redirection->wasDuringLoad) {
-        if (DocumentLoader* provisionalDocumentLoader = loader->provisionalDocumentLoader())
+    if (redirect->wasDuringLoad()) {
+        if (DocumentLoader* provisionalDocumentLoader = m_frame->loader()->provisionalDocumentLoader())
             provisionalDocumentLoader->stopLoading();
-        loader->stopLoading(UnloadEventPolicyUnloadAndPageHide);   
+        m_frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);   
     }
 
     cancel();
-    m_scheduledRedirection = redirection;
-    if (!loader->isComplete() && m_scheduledRedirection->type != ScheduledRedirection::redirection)
-        loader->completed();
+    m_redirect = redirect;
+
+    if (!m_frame->loader()->isComplete() && m_redirect->isLocationChange())
+        m_frame->loader()->completed();
+
     startTimer();
 }
 
 void RedirectScheduler::startTimer()
 {
-    if (!m_scheduledRedirection)
+    if (!m_redirect)
         return;
 
     ASSERT(m_frame->page());
-    
-    FrameLoader* loader = m_frame->loader();
-
     if (m_timer.isActive())
         return;
-
-    if (m_scheduledRedirection->type == ScheduledRedirection::redirection && !loader->allAncestorsAreComplete())
+    if (!m_redirect->shouldStartTimer(m_frame))
         return;
 
-    m_timer.startOneShot(m_scheduledRedirection->delay);
-
-    switch (m_scheduledRedirection->type) {
-        case ScheduledRedirection::locationChange:
-        case ScheduledRedirection::redirection:
-            if (m_scheduledRedirection->toldClient)
-                return;
-            m_scheduledRedirection->toldClient = true;
-            loader->clientRedirected(KURL(ParsedURLString, m_scheduledRedirection->url),
-                m_scheduledRedirection->delay,
-                currentTime() + m_timer.nextFireInterval(),
-                m_scheduledRedirection->lockBackForwardList);
-            return;
-        case ScheduledRedirection::formSubmission:
-            // FIXME: It would make sense to report form submissions as client redirects too.
-            // But we didn't do that in the past when form submission used a separate delay
-            // mechanism, so doing it will be a behavior change.
-            return;
-        case ScheduledRedirection::historyNavigation:
-            // Don't report history navigations.
-            return;
-    }
-    ASSERT_NOT_REACHED();
+    m_timer.startOneShot(m_redirect->delay());
+    m_redirect->didStartTimer(m_frame, &m_timer);
 }
 
 void RedirectScheduler::cancel(bool newLoadInProgress)
 {
     m_timer.stop();
 
-    OwnPtr<ScheduledRedirection> redirection(m_scheduledRedirection.release());
-    if (redirection && redirection->toldClient)
-        m_frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
+    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
+    if (redirect)
+        redirect->didStopTimer(m_frame, newLoadInProgress);
 }
 
 } // namespace WebCore
diff --git a/WebCore/loader/RedirectScheduler.h b/WebCore/loader/RedirectScheduler.h
index 005a173..ac3731c 100644
--- a/WebCore/loader/RedirectScheduler.h
+++ b/WebCore/loader/RedirectScheduler.h
@@ -44,7 +44,7 @@
 class String;
 
 struct FrameLoadRequest;
-struct ScheduledRedirection;
+class ScheduledNavigation;
 
 class RedirectScheduler : public Noncopyable {
 public:
@@ -67,13 +67,13 @@
 
 private:
     void timerFired(Timer<RedirectScheduler>*);
-    void schedule(PassOwnPtr<ScheduledRedirection>);
+    void schedule(PassOwnPtr<ScheduledNavigation>);
 
     static bool mustLockBackForwardList(Frame* targetFrame);
 
     Frame* m_frame;
     Timer<RedirectScheduler> m_timer;
-    OwnPtr<ScheduledRedirection> m_scheduledRedirection;
+    OwnPtr<ScheduledNavigation> m_redirect;
 };
 
 } // namespace WebCore
diff --git a/WebCore/loader/ResourceLoadNotifier.cpp b/WebCore/loader/ResourceLoadNotifier.cpp
index 9280434..d225cb8 100644
--- a/WebCore/loader/ResourceLoadNotifier.cpp
+++ b/WebCore/loader/ResourceLoadNotifier.cpp
@@ -103,11 +103,6 @@
 #endif
 }
 
-void ResourceLoadNotifier::didLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
-{
-    m_frame->loader()->client()->dispatchDidLoadResourceByXMLHttpRequest(identifier, sourceString);
-}
-
 void ResourceLoadNotifier::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
 {
     m_frame->loader()->client()->assignIdentifierToInitialRequest(identifier, loader, request);
diff --git a/WebCore/loader/ResourceLoadNotifier.h b/WebCore/loader/ResourceLoadNotifier.h
index 23e4246..b0a5cbf 100644
--- a/WebCore/loader/ResourceLoadNotifier.h
+++ b/WebCore/loader/ResourceLoadNotifier.h
@@ -55,7 +55,6 @@
     void didReceiveData(ResourceLoader*, const char*, int, int lengthReceived);
     void didFinishLoad(ResourceLoader*);
     void didFailToLoad(ResourceLoader*, const ResourceError&);
-    void didLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
 
     void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
     void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp
index d14afc8..183d2ce 100644
--- a/WebCore/loader/ResourceLoader.cpp
+++ b/WebCore/loader/ResourceLoader.cpp
@@ -34,6 +34,7 @@
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
+#include "InspectorTimelineAgent.h"
 #include "Page.h"
 #include "ProgressTracker.h"
 #include "ResourceHandle.h"
@@ -111,6 +112,17 @@
     ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
     
     ResourceRequest clientRequest(r);
+    
+    // https://bugs.webkit.org/show_bug.cgi?id=26391
+    // The various plug-in implementations call directly to ResourceLoader::load() instead of piping requests
+    // through FrameLoader. As a result, they miss the FrameLoader::addExtraFieldsToRequest() step which sets
+    // up the 1st party for cookies URL. Until plug-in implementations can be reigned in to pipe through that
+    // method, we need to make sure there is always a 1st party for cookies set.
+    if (clientRequest.firstPartyForCookies().isNull()) {
+        if (Document* document = m_frame->document())
+            clientRequest.setFirstPartyForCookies(document->firstPartyForCookies());
+    }
+
     willSendRequest(clientRequest, ResourceResponse());
     if (clientRequest.isNull()) {
         didFail(frameLoader()->cancelledError(r));
@@ -132,7 +144,7 @@
         return true;
     }
     
-    m_handle = ResourceHandle::create(clientRequest, this, m_frame.get(), m_defersLoading, m_shouldContentSniff, true);
+    m_handle = ResourceHandle::create(clientRequest, this, m_frame.get(), m_defersLoading, m_shouldContentSniff);
 
     return true;
 }
@@ -397,16 +409,44 @@
 
 void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
 {
+#if ENABLE(INSPECTOR)
+    if (InspectorTimelineAgent::instanceCount()) {
+        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
+        if (timelineAgent)
+            timelineAgent->willReceiveResourceResponse(identifier(), response);
+    }
+#endif
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
     if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForResponse(this, response))
         return;
 #endif
     didReceiveResponse(response);
+#if ENABLE(INSPECTOR)
+    if (InspectorTimelineAgent::instanceCount()) {
+        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
+        if (timelineAgent)
+            timelineAgent->didReceiveResourceResponse();
+    }
+#endif
 }
 
 void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, int length, int lengthReceived)
 {
+#if ENABLE(INSPECTOR)
+    if (InspectorTimelineAgent::instanceCount()) {
+        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
+        if (timelineAgent)
+            timelineAgent->willReceiveResourceData(identifier());
+    }
+#endif
     didReceiveData(data, length, lengthReceived, false);
+#if ENABLE(INSPECTOR)
+    if (InspectorTimelineAgent::instanceCount()) {
+        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
+        if (timelineAgent)
+            timelineAgent->didReceiveResourceData();
+    }
+#endif
 }
 
 void ResourceLoader::didFinishLoading(ResourceHandle*)
diff --git a/WebCore/loader/WorkerThreadableLoader.cpp b/WebCore/loader/WorkerThreadableLoader.cpp
index 6837ca1..2583498 100644
--- a/WebCore/loader/WorkerThreadableLoader.cpp
+++ b/WebCore/loader/WorkerThreadableLoader.cpp
@@ -42,7 +42,6 @@
 #include "WorkerContext.h"
 #include "WorkerLoaderProxy.h"
 #include "WorkerThread.h"
-#include <memory>
 #include <wtf/OwnPtr.h>
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
@@ -101,7 +100,7 @@
 {
 }
 
-void WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader(ScriptExecutionContext* context, MainThreadBridge* thisPtr, auto_ptr<CrossThreadResourceRequestData> requestData, ThreadableLoaderOptions options)
+void WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader(ScriptExecutionContext* context, MainThreadBridge* thisPtr, PassOwnPtr<CrossThreadResourceRequestData> requestData, ThreadableLoaderOptions options)
 {
     ASSERT(isMainThread());
     ASSERT(context->isDocument());
@@ -174,7 +173,7 @@
     m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidSendData, m_workerClientWrapper, bytesSent, totalBytesToBeSent), m_taskMode);
 }
 
-static void workerContextDidReceiveResponse(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, auto_ptr<CrossThreadResourceResponseData> responseData)
+static void workerContextDidReceiveResponse(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<CrossThreadResourceResponseData> responseData)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
     OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData));
@@ -186,7 +185,7 @@
     m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveResponse, m_workerClientWrapper, response), m_taskMode);
 }
 
-static void workerContextDidReceiveData(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, auto_ptr<Vector<char> > vectorData)
+static void workerContextDidReceiveData(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vector<char> > vectorData)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
     workerClientWrapper->didReceiveData(vectorData->data(), vectorData->size());
@@ -194,9 +193,9 @@
 
 void WorkerThreadableLoader::MainThreadBridge::didReceiveData(const char* data, int lengthReceived)
 {
-    auto_ptr<Vector<char> > vector(new Vector<char>(lengthReceived)); // needs to be an auto_ptr for usage with createCallbackTask.
+    OwnPtr<Vector<char> > vector(new Vector<char>(lengthReceived)); // needs to be an OwnPtr for usage with createCallbackTask.
     memcpy(vector->data(), data, lengthReceived);
-    m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveData, m_workerClientWrapper, vector), m_taskMode);
+    m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveData, m_workerClientWrapper, vector.release()), m_taskMode);
 }
 
 static void workerContextDidFinishLoading(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, unsigned long identifier)
@@ -232,7 +231,7 @@
     m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidFailRedirectCheck, m_workerClientWrapper), m_taskMode);
 }
 
-static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, auto_ptr<CrossThreadResourceResponseData> responseData)
+static void workerContextDidReceiveAuthenticationCancellation(ScriptExecutionContext* context, RefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<CrossThreadResourceResponseData> responseData)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
     OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData));
diff --git a/WebCore/loader/WorkerThreadableLoader.h b/WebCore/loader/WorkerThreadableLoader.h
index 09f8f85..81da2e0 100644
--- a/WebCore/loader/WorkerThreadableLoader.h
+++ b/WebCore/loader/WorkerThreadableLoader.h
@@ -38,7 +38,7 @@
 #include "ThreadableLoaderClient.h"
 #include "ThreadableLoaderClientWrapper.h"
 
-#include <memory>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -109,7 +109,7 @@
             static void mainThreadDestroy(ScriptExecutionContext*, MainThreadBridge*);
             ~MainThreadBridge();
 
-            static void mainThreadCreateLoader(ScriptExecutionContext*, MainThreadBridge*, std::auto_ptr<CrossThreadResourceRequestData>, ThreadableLoaderOptions);
+            static void mainThreadCreateLoader(ScriptExecutionContext*, MainThreadBridge*, PassOwnPtr<CrossThreadResourceRequestData>, ThreadableLoaderOptions);
             static void mainThreadCancel(ScriptExecutionContext*, MainThreadBridge*);
             virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
             virtual void didReceiveResponse(const ResourceResponse&);
diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index c8a485a..526043b 100644
--- a/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -443,7 +443,7 @@
         }
     }
     
-    return ResourceHandle::create(request, this, m_frame, false, true, false);
+    return ResourceHandle::create(request, this, m_frame, false, true);
 }
 
 void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const ResourceResponse& response)
diff --git a/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/WebCore/loader/appcache/ApplicationCacheStorage.cpp
index 1e97d78..2d82c21 100644
--- a/WebCore/loader/appcache/ApplicationCacheStorage.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheStorage.cpp
@@ -32,11 +32,11 @@
 #include "ApplicationCacheHost.h"
 #include "ApplicationCacheGroup.h"
 #include "ApplicationCacheResource.h"
-#include "CString.h"
 #include "FileSystem.h"
 #include "KURL.h"
 #include "SQLiteStatement.h"
 #include "SQLiteTransaction.h"
+#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/StringExtras.h>
 
diff --git a/WebCore/loader/appcache/DOMApplicationCache.h b/WebCore/loader/appcache/DOMApplicationCache.h
index 077cae0..b398756 100644
--- a/WebCore/loader/appcache/DOMApplicationCache.h
+++ b/WebCore/loader/appcache/DOMApplicationCache.h
@@ -50,6 +50,7 @@
     static PassRefPtr<DOMApplicationCache> create(Frame* frame) { return adoptRef(new DOMApplicationCache(frame)); }
     ~DOMApplicationCache() { ASSERT(!m_frame); }
 
+    Frame* frame() const { return m_frame; }
     void disconnectFrame();
 
     unsigned short status() const;
diff --git a/WebCore/loader/appcache/DOMApplicationCache.idl b/WebCore/loader/appcache/DOMApplicationCache.idl
index 9c3a359..9794baf 100644
--- a/WebCore/loader/appcache/DOMApplicationCache.idl
+++ b/WebCore/loader/appcache/DOMApplicationCache.idl
@@ -55,12 +55,12 @@
         attribute EventListener onobsolete;
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
index 3141e98..931b159 100644
--- a/WebCore/loader/archive/cf/LegacyWebArchive.cpp
+++ b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "LegacyWebArchive.h"
 
-#include "CString.h"
 #include "Cache.h"
 #include "Document.h"
 #include "DocumentLoader.h"
@@ -47,6 +46,7 @@
 #include "Range.h"
 #include "SelectionController.h"
 #include "SharedBuffer.h"
+#include <wtf/text/CString.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/RetainPtr.h>
 
diff --git a/WebCore/loader/icon/IconFetcher.cpp b/WebCore/loader/icon/IconFetcher.cpp
index d1aa2f3..3d3df39 100644
--- a/WebCore/loader/icon/IconFetcher.cpp
+++ b/WebCore/loader/icon/IconFetcher.cpp
@@ -32,6 +32,7 @@
 #include "HTMLNames.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
+#include "SharedBuffer.h"
 
 namespace WebCore {
 
diff --git a/WebCore/loader/icon/IconLoader.cpp b/WebCore/loader/icon/IconLoader.cpp
index 5dd000e..eb49087 100644
--- a/WebCore/loader/icon/IconLoader.cpp
+++ b/WebCore/loader/icon/IconLoader.cpp
@@ -49,9 +49,9 @@
 {
 }
 
-auto_ptr<IconLoader> IconLoader::create(Frame* frame)
+PassOwnPtr<IconLoader> IconLoader::create(Frame* frame)
 {
-    return auto_ptr<IconLoader>(new IconLoader(frame));
+    return new IconLoader(frame);
 }
 
 IconLoader::~IconLoader()
diff --git a/WebCore/loader/icon/IconLoader.h b/WebCore/loader/icon/IconLoader.h
index 7b96ed8..1ebac48 100644
--- a/WebCore/loader/icon/IconLoader.h
+++ b/WebCore/loader/icon/IconLoader.h
@@ -27,7 +27,6 @@
 #define IconLoader_h
 
 #include "SubresourceLoaderClient.h"
-#include <memory>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
@@ -40,7 +39,7 @@
 
 class IconLoader : private SubresourceLoaderClient, public Noncopyable {
 public:
-    static std::auto_ptr<IconLoader> create(Frame*);
+    static PassOwnPtr<IconLoader> create(Frame*);
     ~IconLoader();
     
     void startLoading();
diff --git a/WebCore/loader/icon/wince/IconDatabaseWince.cpp b/WebCore/loader/icon/wince/IconDatabaseWince.cpp
index e6d686c..54a36e5 100644
--- a/WebCore/loader/icon/wince/IconDatabaseWince.cpp
+++ b/WebCore/loader/icon/wince/IconDatabaseWince.cpp
@@ -22,12 +22,12 @@
 #include "IconDatabase.h"
 
 #include "AutodrainedPool.h"
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "FileSystem.h"
 #include "IconDatabaseClient.h"
 #include "IconRecord.h"
 #include "Image.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index 24f141f..808ae54 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -27,7 +27,6 @@
 #include "Cache.h"
 #include "CachedImage.h"
 #include "CachedResource.h"
-#include "CString.h"
 #include "DocLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -37,6 +36,7 @@
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "SecurityOrigin.h"
+#include "SharedBuffer.h"
 #include "SubresourceLoader.h"
 #include <wtf/Assertions.h>
 #include <wtf/Vector.h>
@@ -295,6 +295,8 @@
 {
     --m_nonCachedRequestsInFlight;
     ASSERT(m_nonCachedRequestsInFlight >= 0);
+
+    cache()->loader()->scheduleServePendingRequests();
 }
 
 bool Loader::Host::hasRequests() const
@@ -331,7 +333,6 @@
         bool shouldLimitRequests = !m_name.isNull() || docLoader->doc()->parsing() || !docLoader->doc()->haveStylesheetsLoaded();
         if (shouldLimitRequests && m_requestsLoading.size() + m_nonCachedRequestsInFlight >= m_maxRequestsInFlight) {
             serveLowerPriority = false;
-            cache()->loader()->scheduleServePendingRequests();
             return;
         }
         requestsPending.removeFirst();
diff --git a/WebCore/manual-tests/WebKitSite.webarchive b/WebCore/manual-tests/WebKitSite.webarchive
new file mode 100644
index 0000000..d9f9c88
--- /dev/null
+++ b/WebCore/manual-tests/WebKitSite.webarchive
Binary files differ
diff --git a/WebCore/manual-tests/chromium/no-autofill-on-readonly.html b/WebCore/manual-tests/chromium/no-autofill-on-readonly.html
new file mode 100644
index 0000000..9724aaa
--- /dev/null
+++ b/WebCore/manual-tests/chromium/no-autofill-on-readonly.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+</head>
+<body>
+    <p>This page tests that the autofill popup is not shown for read-only and disabled text inputs.</p>
+    <p>Do the following:</p>
+    <ul>
+      <li>Enter a name in the input text in Form 1 and press submit. This is so the autofill has a value for that field.</li>
+      <li>Reload the page so the input text is empty. Click twice on the Form 1 text input. An autofill popup with the name you entered previously should be shown.</li>
+      <li>Click twice on the Form 2 text input. No autofill popup should be shown.</li>
+      <li>Click twice on the Form 3 text input. No autofill popup should be shown.</li>
+    </ul>
+
+    <h1>Form 1 (text input non read-only)</h1>
+    <form action="no-autofill-on-readonly.html">
+      Name:<input type="text" name="name"></input><br>
+      <input type="submit"></input>
+    </form>
+
+    <h1>Form 2 (text input read-only)</h1>
+    <form action="no-autofill-on-readonly.html">
+      Name:<input type="text" name="name" READONLY></input><br>
+      <input type="submit"></input>
+    </form>
+
+    <h1>Form 3 (text input disabled)</h1>
+    <form action="no-autofill-on-readonly.html">
+      Name:<input type="text" name="name" DISABLED></input><br>
+      <input type="submit"></input>
+    </form>
+
+</body>
+</html>
diff --git a/WebCore/manual-tests/clearTimeout-crash-bug29832.html b/WebCore/manual-tests/clearTimeout-crash-bug29832.html
new file mode 100644
index 0000000..d9ec5c7
--- /dev/null
+++ b/WebCore/manual-tests/clearTimeout-crash-bug29832.html
@@ -0,0 +1,20 @@
+<script>
+var w;
+function clear() {
+    w.clearTimeout(153);
+}
+
+function test() {
+    w = window.open("data:text/html,"+
+        "<script>" +
+        "function navigate() { location.href='data:text/html,<body>Close this page and wait.</body>'};" +
+        "setTimeout(navigate,0);</" + 
+        "script>");
+
+    setInterval(clear, 0);
+}
+</script>
+<body>
+<p>This test reproduces the crash in DOMWindow::clearTimeout that happens when DOMWindow is disconnected from the Frame (as in back/forward cache expiration case tested here).
+<p>This is the link to the bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=29832">https://bugs.webkit.org/show_bug.cgi?id=29832</a>
+<p>To reproduce the crash, click the link below, the popup window opens, which will immediately navigate to another one, so the b/f cache entry will be created. Close the popup window. Wait a few seconds (~10), for the page cache to start deleting pages it doesn't need - crash will happen.<br><a href="javascript:test()">Crash me!</a>
diff --git a/WebCore/manual-tests/crash-on-find-with-no-selection.html b/WebCore/manual-tests/crash-on-find-with-no-selection.html
new file mode 100644
index 0000000..9dd108c
--- /dev/null
+++ b/WebCore/manual-tests/crash-on-find-with-no-selection.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+</head>
+<body>
+<p>This test can be used to verify that we do not crash when searching for text on a page when nothing on the page is currently selected.</p>
+<ol>
+    <li>Ensure that you have not clicked anywhere on this page and that nothing on this page is currently selected.</li>
+    <li>Search for the word &quot;crash&quot; in this page (In Safari for Mac, select Edit->Find->Find or press Cmd-F on your keyboard to open the Find banner to search for a word in the page).
+    <li>This test PASSED if we do not crash and the word &quot;crash&quot; is highlighted in at least the first sentence on this page.</li>
+</ol>
+</body>
+</html>
diff --git a/WebCore/manual-tests/dom/progressbar.html b/WebCore/manual-tests/dom/progressbar.html
new file mode 100644
index 0000000..95e64f2
--- /dev/null
+++ b/WebCore/manual-tests/dom/progressbar.html
@@ -0,0 +1,8 @@
+<html><body>
+<h1>Indeterminate progress bar</h1>
+This is an example of <progress value=7 max=10></progress> a determinate progress bar.<br>
+This is an example of <progress></progress> an indeterminate progress bar.<br>
+This is an example of <progress dir=rtl value=7 max=10></progress> a right-to-left determinate progress bar.<br>
+This is an example of <progress dir=rtl></progress> a right-to-left indeterminate progress bar.<br>
+
+</body></html>
diff --git a/WebCore/manual-tests/modal-dialog-blur-selfclose.html b/WebCore/manual-tests/modal-dialog-blur-selfclose.html
new file mode 100644
index 0000000..c6b2da8
--- /dev/null
+++ b/WebCore/manual-tests/modal-dialog-blur-selfclose.html
@@ -0,0 +1,3 @@
+<script>
+window.close()
+</script>
diff --git a/WebCore/manual-tests/modal-dialog-blur.html b/WebCore/manual-tests/modal-dialog-blur.html
new file mode 100644
index 0000000..bd72aa5
--- /dev/null
+++ b/WebCore/manual-tests/modal-dialog-blur.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head><title>
+Tests blur/focus events with modal dialogs
+</title></head>
+<script>
+var failed = "";
+function failBlur() {
+  failed = "blur";
+}
+function failFocus() {
+  failed = "focus";
+}
+
+var inputElement;
+
+function test() {
+  inputElement = document.getElementById("i")
+  inputElement.focus();
+  inputElement.addEventListener("blur", failBlur, false);
+  inputElement.addEventListener("focus", failFocus, false);
+  window.showModalDialog("modal-dialog-blur-selfclose.html");
+  if (failed) {
+    document.getElementById("status").innerHTML = "FAIL, " + failed;
+  } else {
+    document.getElementById("status").innerHTML = "SUCCESS";
+  }
+}
+</script>
+<body onload="test()">
+<input id="i"></input>
+<div id="status">RUNNING...</div>
+</body>
+</html>
diff --git a/WebCore/manual-tests/no-listbox-rendering.html b/WebCore/manual-tests/no-listbox-rendering.html
new file mode 100644
index 0000000..f4467a6
--- /dev/null
+++ b/WebCore/manual-tests/no-listbox-rendering.html
@@ -0,0 +1,32 @@
+<html>
+<body>
+<style>
+td {padding: 20px}
+</style>
+<br><br>
+This test just makes sense if webkit was build with NO_LISTBOX_RENDERING enabled.<br><br>
+You should see in the following table three comboboxes and no listboxes.<br><br>
+At the right cell you see a description of what should be the state of the elements just after loading this page.<br><br>
+<form>
+<table border="1">
+    <tr>
+        <td><select><option>1</option><option>2</option></select></td>
+        <td>combobox in previos cell should have option '1' selected.</td>
+    </tr>
+    <tr>
+        <td><select multiple><option>1</option><option>2</option></select></td>
+        <td>combobox in previos cell should have no selected option.</td>
+    </tr>
+    <tr>
+        <td><select size="5"><option>1</option><option>2</option>s</select></td>
+        <td>combobox in previos cell should have no selected option.</td>
+    </tr>
+    <tr>
+        <td><input type="reset"</td>
+        <td>after pressing this button all the combo boxes should go back to the state discribed above.</td>
+    </tr>
+</table>
+</form>
+</body>
+</html>
+
diff --git a/WebCore/manual-tests/onbeforeunload-focused-iframe.html b/WebCore/manual-tests/onbeforeunload-focused-iframe.html
deleted file mode 100644
index 9ef0dfa..0000000
--- a/WebCore/manual-tests/onbeforeunload-focused-iframe.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-        "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="en">
-<head>
-</head>
-<BODY onbeforeunload="return 'onBeforeUnloadHandler return string is displayed here.';">
-<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=27481">27481</a> onbeforeunload not called at window close + frame or iframe focused</p>
-
-<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b> 
-<ol>
-    <li>Close this browser window while the inner frame has focus.
-</ol>
-</p>
-
-<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
-After the close button is clicked, you should see a dialog that reads:</p>
-<pre>Are you sure you want to navigate away from this page?
-
-onBeforeUnloadHandler return string is displayed here.
-
-Press OK to continue or Cancel to stay on the current page.</pre>
-
-<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
-No dialog (as described above) when closing the browser window.
-</p>
-
-<BODY onbeforeunload="return 'onBeforeUnloadHandler return string is displayed here.';">
-<iframe src="resources/focused-iframe.html"></iframe>
-<p>Close this browser window.</p>
-</body>
-</html>
diff --git a/WebCore/manual-tests/plugin-in-iframe-scroll.html b/WebCore/manual-tests/plugin-in-iframe-scroll.html
new file mode 100644
index 0000000..182c43c
--- /dev/null
+++ b/WebCore/manual-tests/plugin-in-iframe-scroll.html
@@ -0,0 +1,7 @@
+<p>This test requires that accelerated compositing be disabled. Please scroll down to the bottom.</p>
+<p>Both squares should be orange, with no red visible at any time.</p>
+<iframe src="resources/plugin-in-iframe-scroll-iframe.html" width="300" height="300" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="border:1px"></iframe>
+
+<div style="height:1000px">&nbsp;</div>
+<iframe src="resources/plugin-in-iframe-scroll-iframe.html" width="300" height="300" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="border:1px"></iframe>
+<div style="height:1000px">&nbsp;</div>
diff --git a/WebCore/manual-tests/plugin-visible-rect-change.html b/WebCore/manual-tests/plugin-visible-rect-change.html
new file mode 100644
index 0000000..3fe12e9
--- /dev/null
+++ b/WebCore/manual-tests/plugin-visible-rect-change.html
@@ -0,0 +1,25 @@
+<p>
+    This test requires that accelerated compositing be disabled. Clicking the Test button should completely reveal the black-bordered box.
+    The orange video should completely fill the box, with the controller visible and touching the bottom of the box. There should be
+    not be any red visible.
+</p>
+<p>
+    <button onclick="test()">Test</button>
+</p>
+<div style="overflow: hidden; border: solid blue; position: relative;">
+    <div style="height: 100px; padding: 0 8px;">
+    </div>
+    <object type="video/quicktime" style="background-color: red; width: 300px; height: 241px; position: absolute; top: 50px; left: 40px; border: solid black;">
+        <param name="src" value="resources/orange.mov">
+        <param name="controller" value="true">
+        <param name="autoplay" value="false">
+        <param name="scale" value="tofit">
+    </object>
+    <div id="target"></div>
+    <script>
+        function test()
+        {
+            document.getElementById("target").style.height = "500px";
+        }
+    </script>
+</div>
diff --git a/WebCore/manual-tests/plugins/flip4mac-update-alert-over-navigation.html b/WebCore/manual-tests/plugins/flip4mac-update-alert-over-navigation.html
new file mode 100644
index 0000000..2391717
--- /dev/null
+++ b/WebCore/manual-tests/plugins/flip4mac-update-alert-over-navigation.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+    <title>Test case for &lt;rdar://problem/7313430&gt; Many crashes in Safari inside Flip4Mac below -[NSAlert didEndAlert:returnCode:contextInfo:]</title>
+</head>
+<body>
+    <h1>Test case for &lt;<a href='rdar://problem/7313430'>rdar://problem/7313430</a>&gt; Many crashes in Safari inside Flip4Mac below -[NSAlert didEndAlert:returnCode:contextInfo:]</h1>
+
+    <p>This test requires Flip4Mac to be installed and an update to be available for the version that is installed.  Previous versions
+       of Flip4Mac can be downloaded from <a href='http://dynamic.telestream.net/downloads/download-flip4macwmv.htm'>Telestream's website</a>.
+       As of the writing of this test on 2010-04-21 the latest available version of Flip4Mac is 2.3.2.6.  The prior version to that,
+       version 2.3.1.2, is therefore currently the most recent version that will reproduce this bug due to it being the most recent version
+       with an update available.
+    </p>
+
+    <p>Once Flip4Mac is installed, you can test the bug by doing the following.</p>
+    <ol>
+        <li>Launch the browser with <code>NSZombieEnabled=YES</code> and <code>NSDeallocateZombies=NO</code> set in the enrivonment.</li>
+        <li>Load this page.  A Flip4Mac update alert will be displayed, and soon after the page will navigate.</li>
+        <li>After the new page has loaded click the "Cancel" button on the update alert.The browser should not crash.</li>
+    </ol>
+
+    <p>If you have the correct version of Flip4Mac installed but do not see the update alert displayed when loading this page then you may need to delete
+       the Flip4Mac preferences to force it to check for updates.  You can do this by removing <code>~/Library/Preferences/net.telestream.wmv.*</code>
+       and then relaunching the browser.</p>
+
+    <object type="application/asx"></object>
+
+    <script>window.setTimeout(function() { window.location = "data:text/html,If the browser does not crash when you click 'Cancel' in the Flip4Mac update alert sheet then the bug is not present."; }, 10000)</script>
+</body>
+</html>
diff --git a/WebCore/manual-tests/plugins/object-clipping.html b/WebCore/manual-tests/plugins/object-clipping.html
new file mode 100644
index 0000000..23fd630
--- /dev/null
+++ b/WebCore/manual-tests/plugins/object-clipping.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <title>clipping objects</title>
+    <style type="text/css" media="screen">
+        object {
+            margin: 30px;
+            border: 20px solid green;
+        }
+    </style>
+</head>
+<body>
+    <p>You should see a clipped video surrounded by a thick green border.</p>
+    <p><a href="https://bugs.webkit.org/show_bug.cgi?id=35555">https://bugs.webkit.org/show_bug.cgi?id=35555</a></p>
+    <object type="video/quicktime" data="../../../LayoutTests/media/content/test.mp4" width="200" height="150">
+        <param value="false" name="autoplay">
+        <param value="false" name="controller">
+    </object>
+
+</body>
+</html>
diff --git a/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.html b/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.html
new file mode 100644
index 0000000..53fc1b7
--- /dev/null
+++ b/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.html
@@ -0,0 +1,25 @@
+<html>

+<head>

+    <title>Test case for &lt;rdar://problem/7856151&gt; REGRESSION: NPP_Destroy is not called when page navigates when plug-in is displaying modal dialog</title>

+

+    <meta http-equiv="refresh" content="3; data:text/html,If we did not crash or hang and there is no Adobe Flash dialog on screen then this test was a success.<p><a href='javascript:history.back();'>Run again</a>.</p><p><a href='rdar://problem/7856151'>&amp;lt;rdar://problem/7856151&amp;gt;</a>.</p>">

+</head>

+<body>

+    <h1>Test case for &lt;<a href='rdar://problem/7856151'>rdar://problem/7856151</a>&gt; REGRESSION: NPP_Destroy is not called when page navigates when plug-in is displaying modal dialog</h1>

+

+    <p>This page loads some Adobe Flash content that results in the Flash Player plug-in displaying a modal alert window.  The page then triggers

+       a navigation while this alert is on-screen.  After the navigation completes the Flash Player plug-in's modal alert should no longer be

+       visible on-screen and the plug-in host and browser application should not crash.

+    </p>

+

+    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="550" height="400" align="middle">

+        <param name="allowScriptAccess" value="sameDomain">

+        <param name="allowFullScreen" value="false">

+        <param name="movie" value="timeout-dialog-displayed-over-navigation.swf">

+        <param name="quality" value="high">

+        <param name="bgcolor" value="#ffffff">

+        <embed src="timeout-dialog-displayed-over-navigation.swf" quality="high" bgcolor="#ffffff" width="550" height="400" align="middle"

+               allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">

+     </object>

+</body>

+</html>

diff --git a/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.swf b/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.swf
new file mode 100644
index 0000000..7e7c3d9
--- /dev/null
+++ b/WebCore/manual-tests/plugins/timeout-dialog-displayed-over-navigation.swf
Binary files differ
diff --git a/WebCore/manual-tests/qt/qt-anim.gif b/WebCore/manual-tests/qt/qt-anim.gif
new file mode 100644
index 0000000..8bca4a8
--- /dev/null
+++ b/WebCore/manual-tests/qt/qt-anim.gif
Binary files differ
diff --git a/WebCore/manual-tests/qt/qt-gif-test.html b/WebCore/manual-tests/qt/qt-gif-test.html
new file mode 100644
index 0000000..06505f4
--- /dev/null
+++ b/WebCore/manual-tests/qt/qt-gif-test.html
@@ -0,0 +1,12 @@
+<html>
+<body>
+<div>
+    <img src="qt-anim.gif">
+    <p>This should animate</p>
+</div>
+<div>
+    <img src="qt-noanim.gif">
+    <p>This should not animate and you should see a cross</p>
+</div
+</body>
+</html>
diff --git a/WebCore/manual-tests/qt/qt-noanim.gif b/WebCore/manual-tests/qt/qt-noanim.gif
new file mode 100644
index 0000000..b6a8540
--- /dev/null
+++ b/WebCore/manual-tests/qt/qt-noanim.gif
Binary files differ
diff --git a/WebCore/manual-tests/quit-inside-unload.html b/WebCore/manual-tests/quit-inside-unload.html
new file mode 100644
index 0000000..23ae71d
--- /dev/null
+++ b/WebCore/manual-tests/quit-inside-unload.html
@@ -0,0 +1,14 @@
+<script>
+    var showedAlert = false;
+    function handleUnload()
+    {
+        if (showedAlert)
+            return;
+
+        showedAlert = true;
+        alert("Now Quit Safari. Do not dismiss this alert first.");
+    }
+</script>
+<body onunload="handleUnload()">
+    Close this window
+</body>
diff --git a/WebCore/manual-tests/resources/focused-iframe.html b/WebCore/manual-tests/resources/focused-iframe.html
deleted file mode 100644
index 50b49a5..0000000
--- a/WebCore/manual-tests/resources/focused-iframe.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<html>
-<body onload="load()">
-    This frame should get the focus.
-    <input id="box"></input>
-    <script>
-        function load()
-        {
-            document.getElementById("box").focus();
-        }
-    </script>
-</body>
-</html>
diff --git a/WebCore/manual-tests/resources/plugin-in-iframe-scroll-iframe.html b/WebCore/manual-tests/resources/plugin-in-iframe-scroll-iframe.html
new file mode 100644
index 0000000..b2593b0
--- /dev/null
+++ b/WebCore/manual-tests/resources/plugin-in-iframe-scroll-iframe.html
@@ -0,0 +1,6 @@
+<object type="video/quicktime" style="background-color: red; width: 298px; height: 298px; border:solid 1px">
+    <param name="src" value="orange.mov">
+    <param name="controller" value="false">
+    <param name="autoplay" value="false">
+    <param name="scale" value="tofit">
+</object>
diff --git a/WebCore/manual-tests/resources/video-tab.html b/WebCore/manual-tests/resources/video-tab.html
new file mode 100644
index 0000000..fec915f
--- /dev/null
+++ b/WebCore/manual-tests/resources/video-tab.html
@@ -0,0 +1 @@
+<video src="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_r640-9cie.mov" controls autoplay>
diff --git a/WebCore/manual-tests/select_dropdown_box_alignment.html b/WebCore/manual-tests/select_dropdown_box_alignment.html
new file mode 100644
index 0000000..07035b7
--- /dev/null
+++ b/WebCore/manual-tests/select_dropdown_box_alignment.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+<title>Test <select> drop-down box's alignment</title>
+<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
+</head>
+<body>
+<p>
+For RTL, select drop-down box's should be right aligned with the &lt;select&gt;
+element and expands to left instead of right.
+<p>
+The drop-down box in the following &lt;select&gt; should be left-aligned and expand to right.
+<br>
+<select style="width:100px">
+<option>Arabic</option>
+<option>Hebrew</option>
+<option>English (United States)</option>
+<option>Chinese (Simplified Chiense)</option>
+</select>
+<br>
+The drop-down box in the second &lt;select&gt; should be right-aligned and expand to left.
+<p>
+<select dir="rtl" style="width:100px">
+<option>Arabic</option>
+<option>Hebrew</option>
+<option>English (United States)</option>
+<option>Chinese (Simplified Chiense)</option>
+</select>
+</body>
+</html>
diff --git a/WebCore/manual-tests/spatial-navigation/frameset.html b/WebCore/manual-tests/spatial-navigation/frameset.html
new file mode 100644
index 0000000..fe82e4a
--- /dev/null
+++ b/WebCore/manual-tests/spatial-navigation/frameset.html
@@ -0,0 +1,7 @@
+<html>
+  <frameset border=1 rows="10%,10%,*">
+    <frame src="links.html"/>
+    <frame src="links.html"/>
+    <frame src="spatial-navigation-test-cases.html"/>
+  </frameset><br><br>
+</html>
diff --git a/WebCore/manual-tests/spatial-navigation/links.html b/WebCore/manual-tests/spatial-navigation/links.html
new file mode 100755
index 0000000..18cfd62
--- /dev/null
+++ b/WebCore/manual-tests/spatial-navigation/links.html
@@ -0,0 +1,8 @@
+<html>
+  <body>
+    <p>
+      <a href="a">x</a>
+      <a href="a">y</a>
+      <a href="a">z</a>
+  </body>
+</html>
diff --git a/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html b/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html
new file mode 100755
index 0000000..bf00c23
--- /dev/null
+++ b/WebCore/manual-tests/spatial-navigation/spatial-navigation-test-cases.html
@@ -0,0 +1,147 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+    <title>Spatial Navigation Test Cases</title>
+  </head>
+  <body>
+
+    <div style="margin-left: 40px; text-align: center;">
+      <h1 style="text-align: left;">Spatial Navigation Fun</h1>
+      <h2 style="text-align: left;">3x3 Centered Table Test</h2>
+    </div>
+
+    <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2">
+      <tbody>
+        <tr>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+        </tr>
+        <tr>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+        </tr>
+        <tr>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+          <td style="vertical-align: top; text-align: center;"><a href="a">test</a></td>
+        </tr>
+      </tbody>
+    </table>
+
+    <div style="margin-left: 40px; text-align: left;"><br>
+
+      <div style="text-align: left;">
+        <h2>Vertical Sine Test</h2><br>
+      </div>
+
+      <div style="text-align: left;">
+        <a href="a">test<br></a>
+      </div>
+
+      <div style="margin-left: 40px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <div style="margin-left: 80px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <div style="margin-left: 40px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <a href="a">test<br></a>
+
+      <div style="margin-left: 40px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <div style="margin-left: 80px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <div style="margin-left: 40px;">
+        <a href="a">test<br></a>
+      </div>
+
+      <a href="a">test<br></a>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="a">test<br></a>
+
+      <h2>Increasing sentence length</h2>
+      <a href="a">H</a><br>
+      <a href="p">Ho<br></a>
+      <a href="p">How<br></a>
+      <a href="p">How <br></a>
+      <a href="p">How N</a><br>
+      <a href="p">How No</a><br>
+      <a href="p">How Now</a><br>
+      <a href="p">How Now </a><br>
+      <a href="p">How Now B</a><br>
+      <a href="p">How Now Br</a><br>
+      <a href="p">How Now Bro</a><br>
+      <a href="p">How Now Brow</a><br>
+      <a href="p">How Now Brown</a><br>
+      <a href="p">How Now Brown </a><br>
+      <a href="p">How Now Brown C</a><br>
+      <a href="p">How Now Brown Co</a><br>
+      <a href="p">How Now Brown Cow</a><br>
+      <br>
+
+      <h2>Split sentence<br></h2><br>
+      <a href="p">H</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a href="p">ow Now Brown Cow</a><br>
+      <a href="p">Ho</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <a href="p">w Now Brown Cow</a><br>
+      <a href="p">How</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="p">Now Brown Cow</a><br>
+      <a href="p">How N</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <a href="p">ow Brown Cow</a><br>
+      <a href="p">How No</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">w Brown Cow</a><br>
+      <a href="p">How Now </a>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">Brown Cow</a><br>
+      <a href="p">How Now B</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">rown Cow</a><br>
+      <a href="p">How Now Br</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">own Cow</a><br>
+      <a href="p">How Now Bro</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">wn Cow</a><br>
+      <a href="p">How Now Brow</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="p">n Cow</a><br>
+      <a href="p">How Now Brown</a> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; <a href="p">Cow</a><br>
+      <a href="p">How Now Brown C</a> &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">ow</a><br>
+      <a href="p">How Now Brown Co</a> &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="p">w</a><br>
+      <a href="p">How Now Brown Cow</a><br><br>
+
+      <h2>Line Wrap Test</h2><br>
+
+      <table style="text-align: left; width: 393px; height: 72px;" border="1" cellpadding="2" cellspacing="2">
+        <tbody>
+          <tr>
+            <td style="vertical-align: top;">
+              <span class="huge">
+                <a href="a">Which of the following constanst do you like the most, one is g, one is pi, and the other is e. </a><br>
+             </span>
+            </td>
+
+            <td style="vertical-align: top;">
+              <a href="a">3.14</a><br>
+              <a href="a">2.71</a><br>
+              <a href="a">6.67</a><br>
+            </td>
+          </tr>
+        </tbody>
+      </table><br>
+
+      <h2>Javascript Focus/Blur Test</h2>
+        When going to any link from the following link, you should see a dialog.<br><br>
+      <a href="a" onblur='alert("onBlurt")'>Test</a><br><br>
+
+      <h2>IFrames</h2><br>
+      <iframe src="links.html"></iframe><br><br><br>
+
+      <h2>DIVs</h2><br>
+      <div id=v>
+        <a href="a">a</a>
+        <div id="Div1">
+          <a href="a">b</a>
+        </div>
+        <a href="a">c</a>
+      </div><br><br>
+    <a href="last">last</a>
+    </div>
+</body>
+</html>
diff --git a/WebCore/manual-tests/video-in-non-frontmost-tab.html b/WebCore/manual-tests/video-in-non-frontmost-tab.html
new file mode 100644
index 0000000..d1fe4a8
--- /dev/null
+++ b/WebCore/manual-tests/video-in-non-frontmost-tab.html
@@ -0,0 +1,4 @@
+This tests that video does not play if it's not in the frontmost tab.
+Command-Click  <a href="resources/video-tab.html">this link</a> to open it in a non-frontmost tab.
+If you hear music before switching tabs, then the test failed.
+If not, click on the tab and the video should then play.
diff --git a/WebCore/manual-tests/webarchive-test.html b/WebCore/manual-tests/webarchive-test.html
new file mode 100644
index 0000000..ab64422
--- /dev/null
+++ b/WebCore/manual-tests/webarchive-test.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>webarchive test</title>
+</head>
+<body>
+<p>This test verifies that webarchive files larger than 4KB can be loaded. This functionality had previously regressed due to <a href="https://bugs.webkit.org/show_bug.cgi?id=36196">https://bugs.webkit.org/show_bug.cgi?id=36196</a>. If you see a snapshot of <a href="http://webkit.org">webkit.org</a> in the iframe below, the test passed.</p>
+<iframe src="WebKitSite.webarchive" width="800" height="600"></iframe>
+</body>
+</html>
diff --git a/WebCore/manual-tests/win/horizontal-scroll-composited.html b/WebCore/manual-tests/win/horizontal-scroll-composited.html
deleted file mode 100644
index c977300..0000000
--- a/WebCore/manual-tests/win/horizontal-scroll-composited.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<div>
-<b>Scroll test for composited elements on Windows.</b>
-</div>
-<div>Make sure you browser window is smaller than 1000 pixels so that you see an horizontal scroll bar.
-<br />
-Try scolling right and left and verify that the content is displayed correctly. 
-</div>
-<div style="-webkit-transform: translatez(0); width: 1000px; height: 800px; border-style: solid; border-color: Red; border-width: 3px; background-image: url(../resources/apple.jpg); background-repeat:repeat"></div>
diff --git a/WebCore/manual-tests/win/milliondollar.html b/WebCore/manual-tests/win/milliondollar.html
new file mode 100644
index 0000000..e1d51ff
--- /dev/null
+++ b/WebCore/manual-tests/win/milliondollar.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Million dollar test</title>
+<style type="text/css" media="screen">
+    body {
+        padding: 0px; margin: 0px; font-size: 12px; font-family:"Lucida Grande", Verdana, Arial, sans-serif;
+        background:#303030;
+    }
+    .ie {text-align: left; width:1000px;position:relative;visibility:hidden;z-index:1;}
+    .grid {height: 1000px; width:1000px; position:relative;z-index:153;xoverflow:hidden;}
+    .row {background:url(100grid_inv.png) #000;height: 100px; text-align: left; position:relative;width:1000px;z-index:10;}
+    #lq {width:1000px;position:relative;z-index:0;text-align:left;}
+    .bz {-webkit-perspective: 1500;-webkit-perspective-origin: 50% 325px;}
+    .fc {-webkit-transform-style: preserve-3d;-webkit-transform:  rotateY(0deg) ;opacity: 1.0;}
+    @-webkit-keyframes spin_3d {
+    0%    { -webkit-transform: rotateY(0)       rotateZ(0); }
+    33%   { -webkit-transform: rotateY(-20deg)  rotateZ(-20deg); }
+    65%   { -webkit-transform: rotateY(20deg) rotateZ(20deg); }
+    100%  { -webkit-transform: rotateY(0deg) rotateZ(0deg); }
+    }
+    .plane > a {display:block;height:100%;width:100%;}
+    .plane {
+        position: absolute;
+        opacity:0.5;
+        background-repeat:no-repeat;
+        -webkit-transition: -webkit-transform 0.3s, opacity 0s;-webkit-backface-visibility: visible;}
+</style>
+
+<script type="text/javascript">
+function loadBlocks() {
+    document.getElementById("ie").style.visibility = "visible";
+    document.getElementById("ie").className = document.getElementById("ie").className + " bz";
+    document.getElementById("grid").className = document.getElementById("grid").className + " fc";
+    document.getElementById("lq").style.display = "none";
+
+    var cubes;
+
+    cubify(200,0,250,50);
+    cubify(800,500,900,600);
+    cubify(250,350,300,400);
+    cubify(600,600,650,650);
+    cubify(850,0,900,50);
+    cubify(650,450,700,500);
+    cubify(100,500,250,650);
+    cubify(400,600,500,700);
+    cubify(700,600,800,700);
+    cubify(350,0,500,150);
+    cubify(450,200,500,250);
+    cubify(550,250,600,300);
+    cubify(0,400,100,450);
+    cubify(600,150,650,200);
+    cubify(600,700,650,750);
+    cubify(150,850,450,950);
+    cubify(200,100,300,200);
+    cubify(750,200,950,400);
+    cubify(250,700,350,800);
+    cubify(600,800,700,900);
+    cubify(100,300,150,350);
+    cubify(0,300,50,350);
+    cubify(850,650,950,700);
+    cubify(900,100,950,150);
+    cubify(200,400,250,450);
+    cubify(200,250,250,300);
+    cubify(300,600,350,650);
+    cubify(50,200,100,250);
+    cubify(100,100,150,150);
+    cubify(0,0,5,5);
+    cubify(470,430,475,435);
+    cubify(520,480,525,485);
+    cubify(570,380,575,385);
+    cubify(550,0,600,50);
+    cubify(650,0,700,50);
+    cubify(425,390,455,400);
+    cubify(435,400,445,430);
+    cubify(525,425,530,430);
+    cubify(450,500,465,515);
+    cubify(650,100,750,200);
+    cubify(0,0,50,50);
+    cubify(700,750,900,800);
+    cubify(495,390,510,405);
+    cubify(495,445,500,450);
+    cubify(560,450,565,455);
+    cubify(460,460,465,465);
+    cubify(525,370,530,375);
+    cubify(490,420,495,425);
+    cubify(520,440,525,445);
+    cubify(510,420,515,425);
+    cubify(495,465,500,470);
+    cubify(475,405,480,410);
+    cubify(545,400,550,405);
+    cubify(485,370,490,375);
+    cubify(430,365,435,370);
+
+    document.getElementById("grid").innerHTML = cubes + document.getElementById("grid").innerHTML;
+
+    function cubify(x1, y1, x2, y2)
+    {
+        var width, height,dw;
+        width = x2 - x1;
+        height = y2 - y1;
+        if (width < height) {
+            dw = width;
+        } else {
+            dw = height;
+        }
+        cubes += addBlock(x1,y1,width,height,dw);
+    }
+    
+    function addBlock(x1,y1,xf,qp,dw)
+    {
+       return "<div class='a_cube'><div class='plane one' style='background-color: red;height:"+dw+"px;width:"+dw+"px;top:"+y1+"px;left:"+x1+"px;-webkit-transform:rotateY(90deg) rotateZ(-90deg) translateX(0px) translateY(-"+(dw/2)+"px) translateZ("+(dw/2)+"px) translateY(0px);position:absolute;'></div><div class='plane two' style='background-color: blue;height:"+dw+"px;width:"+dw+"px;top:"+y1+"px;left:"+x1+"px;-webkit-transform:rotateY(90deg) rotateX(180deg) rotateZ(-90deg) translateX(0px) translateY(-"+(dw/2)+"px) translateZ("+(dw/2)+"px) translateY(0px);position:absolute;'></div><div class='plane three' style='background-color: green;height:"+dw+"px;width:"+dw+"px;top:"+y1+"px;left:"+x1+"px;-webkit-transform:rotateX(-90deg) translateX(0px) translateZ("+(dw/2)+"px) translateY(-"+(dw/2)+"px);position:absolute;'></div><div class='plane four' style='background-color: yellow;height:"+dw+"px;width:"+dw+"px;top:"+y1+"px;left:"+x1+"px;-webkit-transform:rotateY(90deg) rotateX(90deg) rotateZ(-90deg) translateY(-"+(dw/2)+"px) translateX(0px) translateZ("+(dw/2)+"px) translateY(0px);position:absolute;'></div><div class='plane five' style='background-color: gray;height:"+dw+"px;width:"+dw+"px;top:"+y1+"px;left:"+x1+"px;-webkit-transform:rotateY(0deg) translateX(0px) translateZ("+(dw)+"px) translateY(0px);position:absolute;'></div></div>";
+    }
+
+    document.getElementById("grid").style.webkitAnimation = "spin_3d 36s infinite linear";
+};
+
+</script>
+</head>
+<body onload="loadBlocks()">
+<center>
+    <div id="lq">
+        <div style="top: 252px; left: 203px; width: 196px; height: 196px; position: relative;
+            z-index: 0; text-align: left; border: 0px solid #999; padding: 0px; background: #333;
+            -moz-border-radius: 0px; -webkit-border-radius: 0px; text-align: center;">
+            $1 a pixel
+        </div>
+    </div>
+    <div class="ie" id="ie">
+        <div class="grid" id="grid">
+            <div class="row" id="row0"></div><div class="row" id="row1"></div><div class="row" id="row2"></div><div class="row" id="row3"></div><div class="row" id="row4"></div><div class="row" id="row5"></div><div class="row" id="row6"></div><div class="row" id="row7"></div><div class="row" id="row8"></div><div class="row" id="row9"></div>
+        </div>
+    </div>
+</center>
+</body>
+</html>
diff --git a/WebCore/mathml/MathMLInlineContainerElement.cpp b/WebCore/mathml/MathMLInlineContainerElement.cpp
index 019c4ce..2d682a2 100644
--- a/WebCore/mathml/MathMLInlineContainerElement.cpp
+++ b/WebCore/mathml/MathMLInlineContainerElement.cpp
@@ -31,6 +31,11 @@
 
 #include "MathMLNames.h"
 #include "RenderMathMLBlock.h"
+#include "RenderMathMLFraction.h"
+#include "RenderMathMLMath.h"
+#include "RenderMathMLRow.h"
+#include "RenderMathMLSubSup.h"
+#include "RenderMathMLUnderOver.h"
 
 namespace WebCore {
     
@@ -48,8 +53,27 @@
 
 RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)
 {
-    // FIXME: This method will contain the specialized renderers based on element name
-    RenderObject* object = new (arena) RenderMathMLBlock(this);
+    RenderObject* object = 0;
+    if (hasLocalName(MathMLNames::mrowTag))
+        object = new (arena) RenderMathMLRow(this);
+    else if (hasLocalName(MathMLNames::mathTag))
+        object = new (arena) RenderMathMLMath(this);
+    else if (hasLocalName(MathMLNames::msubTag))
+        object = new (arena) RenderMathMLSubSup(this);
+    else if (hasLocalName(MathMLNames::msupTag))
+        object = new (arena) RenderMathMLSubSup(this);
+    else if (hasLocalName(MathMLNames::msubsupTag))
+        object = new (arena) RenderMathMLSubSup(this);
+    else if (hasLocalName(MathMLNames::moverTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else if (hasLocalName(MathMLNames::munderTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else if (hasLocalName(MathMLNames::munderoverTag))
+        object = new (arena) RenderMathMLUnderOver(this);
+    else if (hasLocalName(MathMLNames::mfracTag))
+        object = new (arena) RenderMathMLFraction(this);
+    else
+        object = new (arena) RenderMathMLBlock(this);
     object->setStyle(style);
     return object;
 }
diff --git a/WebCore/mathml/MathMLTextElement.cpp b/WebCore/mathml/MathMLTextElement.cpp
index 11d46c4..6f6bcbc 100644
--- a/WebCore/mathml/MathMLTextElement.cpp
+++ b/WebCore/mathml/MathMLTextElement.cpp
@@ -30,7 +30,7 @@
 #include "MathMLTextElement.h"
 
 #include "MathMLNames.h"
-#include "RenderObject.h"
+#include "RenderMathMLOperator.h"
 
 namespace WebCore {
     
@@ -46,8 +46,14 @@
     return new MathMLTextElement(tagName, document);
 }
 
-RenderObject* MathMLTextElement::createRenderer(RenderArena* , RenderStyle* style)
+RenderObject* MathMLTextElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
+    if (hasLocalName(MathMLNames::moTag)) {
+        RenderObject* object = new (arena) RenderMathMLOperator(this);
+        object->setStyle(style);
+        return object;
+    }
+
     return RenderObject::createObject(this, style);
 }
 
diff --git a/WebCore/mathml/RenderMathMLBlock.h b/WebCore/mathml/RenderMathMLBlock.h
index e01a325..f05122a 100644
--- a/WebCore/mathml/RenderMathMLBlock.h
+++ b/WebCore/mathml/RenderMathMLBlock.h
@@ -52,6 +52,42 @@
 #endif
     
 protected:
+    int getBoxModelObjectHeight(RenderObject* object) 
+    {
+        if (object && object->isBoxModelObject()) {
+            RenderBoxModelObject* box = toRenderBoxModelObject(object);
+            return box->offsetHeight();
+        }
+        
+        return 0;
+    }
+    int getBoxModelObjectHeight(const RenderObject* object) 
+    {
+        if (object && object->isBoxModelObject()) {
+            const RenderBoxModelObject* box = toRenderBoxModelObject(object);
+            return box->offsetHeight();
+        }
+        
+        return 0;
+    }
+    int getBoxModelObjectWidth(RenderObject* object) 
+    {
+        if (object && object->isBoxModelObject()) {
+            RenderBoxModelObject* box = toRenderBoxModelObject(object);
+            return box->offsetWidth();
+        }
+        
+        return 0;
+    }
+    int getBoxModelObjectWidth(const RenderObject* object) 
+    {
+        if (object && object->isBoxModelObject()) {
+            const RenderBoxModelObject* box = toRenderBoxModelObject(object);
+            return box->offsetWidth();
+        }
+        
+        return 0;
+    }
     virtual PassRefPtr<RenderStyle> makeBlockStyle();
     
 };
@@ -67,7 +103,7 @@
     ASSERT(!object || object->isRenderMathMLBlock());
     return static_cast<const RenderMathMLBlock*>(object);
 }
-    
+
 }
 
 
diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp
new file mode 100644
index 0000000..3399e55
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLFraction.cpp
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 François Sausset (sausset@gmail.com). 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 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(MATHML)
+
+#include "RenderMathMLFraction.h"
+
+#include "GraphicsContext.h"
+#include "MathMLNames.h"
+#include "RenderText.h"
+
+namespace WebCore {
+    
+using namespace MathMLNames;
+
+static const double gHorizontalPad = 0.2;
+static const int gLineThin = 1;
+static const int gLineMedium = 3;
+static const int gLineThick = 5;
+static const double gFractionAlignment = 0.25;
+static const double gFractionBarWidth = 0.05;
+static const double gDenominatorPad = 0.1;
+
+RenderMathMLFraction::RenderMathMLFraction(Element* fraction) 
+    : RenderMathMLBlock(fraction)
+    , m_lineThickness(gLineThin)
+{
+    setChildrenInline(false);
+}
+
+void RenderMathMLFraction::updateFromElement()
+{
+    // FIXME: mfrac where bevelled=true will need to reorganize the descendants
+    if (isEmpty()) 
+        return;
+    
+    Element* fraction = static_cast<Element*>(node());
+    
+    RenderObject* numerator = firstChild();
+    String nalign = fraction->getAttribute(MathMLNames::numalignAttr);
+    if (equalIgnoringCase(nalign, "left"))
+        numerator->style()->setTextAlign(LEFT);
+    else if (equalIgnoringCase(nalign, "right"))
+        numerator->style()->setTextAlign(RIGHT);
+    else
+        numerator->style()->setTextAlign(CENTER);
+    
+    RenderObject* denominator = numerator->nextSibling();
+    if (!denominator)
+        return;
+    
+    String dalign = fraction->getAttribute(MathMLNames::denomalignAttr);
+    if (equalIgnoringCase(dalign, "left"))
+        denominator->style()->setTextAlign(LEFT);
+    else if (equalIgnoringCase(dalign, "right"))
+        denominator->style()->setTextAlign(RIGHT);
+    else
+        denominator->style()->setTextAlign(CENTER);
+    
+    // FIXME: parse units
+    String thickness = fraction->getAttribute(MathMLNames::linethicknessAttr);
+    m_lineThickness = gLineThin;
+    if (equalIgnoringCase(thickness, "thin"))
+        m_lineThickness = gLineThin;
+    else if (equalIgnoringCase(thickness, "medium"))
+        m_lineThickness = gLineMedium;
+    else if (equalIgnoringCase(thickness, "thick"))
+        m_lineThickness = gLineThick;
+    else if (equalIgnoringCase(thickness, "0"))
+        m_lineThickness = 0;
+
+    // Update the style for the padding of the denominator for the line thickness
+    lastChild()->style()->setPaddingTop(Length(static_cast<int>(m_lineThickness + style()->fontSize() * gDenominatorPad), Fixed));
+}
+
+void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* beforeChild)
+{
+    RenderBlock* row = new (renderArena()) RenderMathMLBlock(node());
+    RefPtr<RenderStyle> rowStyle = makeBlockStyle();
+    
+    rowStyle->setTextAlign(CENTER);
+    Length pad(static_cast<int>(rowStyle->fontSize() * gHorizontalPad), Fixed);
+    rowStyle->setPaddingLeft(pad);
+    rowStyle->setPaddingRight(pad);
+    
+    // Only add padding for rows as denominators
+    bool isNumerator = isEmpty();
+    if (!isNumerator) 
+        rowStyle->setPaddingTop(Length(2, Fixed));
+    
+    row->setStyle(rowStyle.release());
+    RenderBlock::addChild(row, beforeChild);
+    row->addChild(child);
+    updateFromElement();
+}
+
+void RenderMathMLFraction::layout()
+{
+    updateFromElement();
+    
+    // Adjust the fraction line thickness for the zoom
+    if (lastChild() && lastChild()->isRenderBlock())
+        m_lineThickness = m_lineThickness * ceil(gFractionBarWidth * style()->fontSize());
+    
+    if (previousSibling() && previousSibling()->isRenderBlock()) {
+        RenderBlock* sibling = toRenderBlock(previousSibling());
+        verticalAlignCompute(sibling);
+    } else if (nextSibling() && nextSibling()->isRenderBlock()) {
+        RenderBlock* sibling = toRenderBlock(nextSibling());
+        verticalAlignCompute(sibling);
+    }
+
+    RenderBlock::layout();
+    
+    // The row layout can affect the numerator/denominator width.
+    // FIXME: This is probably only needed if one of the children
+    // contains an mrow.
+    setNeedsLayoutAndPrefWidthsRecalc();
+    markContainingBlocksForLayout();
+    
+    RenderBlock::layout();
+    
+}
+    
+void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
+{
+    RenderMathMLBlock::paint(info, tx, ty);
+    if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground)
+        return;
+    
+    if (!firstChild() ||!m_lineThickness)
+        return;
+
+    int verticalOffset = 0;
+    // The children are always RenderMathMLBlock instances
+    if (firstChild()->isRenderMathMLBlock()) {
+        int adjustForThickness = m_lineThickness > 1 ? m_lineThickness / 2 : 1;
+        if (m_lineThickness % 2 == 1)
+            adjustForThickness++;
+        RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild());
+        if (numerator->isRenderMathMLRow())
+            verticalOffset = numerator->offsetHeight() + adjustForThickness;
+        else 
+            verticalOffset = numerator->offsetHeight();        
+    }
+    
+    tx += x();
+    ty += y() + verticalOffset;
+    
+    info.context->save();
+    
+    info.context->setStrokeThickness(static_cast<float>(m_lineThickness));
+    info.context->setStrokeStyle(SolidStroke);
+    info.context->setStrokeColor(Color(0, 0, 0), sRGBColorSpace);
+    
+    info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
+    
+    info.context->restore();
+}
+
+void RenderMathMLFraction::verticalAlignCompute(RenderBlock* sibling)
+{
+    if (sibling->isRenderMathMLBlock()) {
+        RenderMathMLBlock* op = toRenderMathMLBlock(sibling);
+        style()->setVerticalAlign(LENGTH);
+        int verticalShift = static_cast<int>(ceil(gFractionAlignment * op->offsetHeight() + 0.5 * lastChild()->style()->borderTopWidth()));
+        style()->setVerticalAlignLength(Length(verticalShift, Fixed));
+    }
+}
+
+int RenderMathMLFraction::baselinePosition(bool firstLine, bool isRootLineBox) const
+{
+    if (firstChild()->isRenderMathMLBlock()) {
+        RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild());
+        return numerator->offsetHeight();
+    }
+    return RenderBlock::baselinePosition(firstLine, isRootLineBox);
+}
+
+}
+
+
+#endif // ENABLE(MATHML)
diff --git a/WebCore/mathml/RenderMathMLFraction.h b/WebCore/mathml/RenderMathMLFraction.h
new file mode 100644
index 0000000..30162ac
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLFraction.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 François Sausset (sausset@gmail.com). 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 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 RenderMathMLFraction_h
+#define RenderMathMLFraction_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+
+class RenderMathMLFraction : public RenderMathMLBlock {
+public:
+    RenderMathMLFraction(Element* fraction);
+    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
+    virtual void updateFromElement();
+    virtual int baselinePosition(bool , bool) const; 
+    virtual void paint(PaintInfo&, int tx, int ty);
+protected:
+    virtual void layout();
+private:
+    void verticalAlignCompute(RenderBlock*);
+    int m_lineThickness;
+};
+
+}
+
+#endif // ENABLE(MATHML)
+
+#endif // RenderMathMLFraction_h
diff --git a/WebCore/mathml/RenderMathMLMath.cpp b/WebCore/mathml/RenderMathMLMath.cpp
new file mode 100644
index 0000000..2b65f69
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLMath.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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(MATHML)
+
+#include "RenderMathMLMath.h"
+
+#include "MathMLNames.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+RenderMathMLMath::RenderMathMLMath(Node* math)
+    : RenderMathMLRow(math)
+{
+}
+
+}
+
+#endif // ENABLE(MATHML)
+
diff --git a/WebCore/mathml/RenderMathMLMath.h b/WebCore/mathml/RenderMathMLMath.h
new file mode 100644
index 0000000..26f2093
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLMath.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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 RenderMathMLMath_h
+#define RenderMathMLMath_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLRow.h"
+
+namespace WebCore {
+    
+class RenderMathMLMath : public RenderMathMLRow {
+public:
+    RenderMathMLMath(Node* container);
+    virtual bool isRenderMathMLMath() const { return true; }
+};
+    
+}
+
+
+#endif // ENABLE(MATHML)
+#endif // RenderMathMLMath_h
diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp
new file mode 100644
index 0000000..da9e8ec
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLOperator.cpp
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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(MATHML)
+
+#include "RenderMathMLOperator.h"
+
+#include "FontSelector.h"
+#include "MathMLNames.h"
+#include "RenderText.h"
+
+namespace WebCore {
+    
+using namespace MathMLNames;
+
+RenderMathMLOperator::RenderMathMLOperator(Node* container)
+    : RenderMathMLBlock(container),
+      m_stretchHeight(0),
+      m_operator(0)
+{
+}
+    
+RenderMathMLOperator::RenderMathMLOperator(Node* container, UChar operatorChar)
+    : RenderMathMLBlock(container),
+      m_stretchHeight(0),
+      m_operator(operatorChar)
+{
+}
+    
+bool RenderMathMLOperator::isChildAllowed(RenderObject*, RenderStyle*) const
+{
+    return false;
+}
+
+void  RenderMathMLOperator::stretchToHeight(int height)
+{
+    if (height == m_stretchHeight)
+        return;
+    m_stretchHeight = height;
+    
+    updateBoxModelInfoFromStyle();
+    setNeedsLayoutAndPrefWidthsRecalc();
+    markContainingBlocksForLayout();
+}
+
+void RenderMathMLOperator::layout() 
+{
+    // FIXME: This probably shouldn't be called here but when the operator
+    // isn't stretched (e.g. outside of a mrow), it needs to be called somehow
+    updateFromElement();
+    RenderBlock::layout();
+}
+
+// This is a table of stretchy characters.
+// FIXME: Should this be read from the unicode characteristics somehow?
+// table:  stretchy operator, top char, extension char, bottom char, middle char
+static struct StretchyCharacter {
+    UChar character;
+    UChar topGlyph;
+    UChar extensionGlyph;
+    UChar bottomGlyph;
+    UChar middleGlyph;
+} stretchyCharacters[9] = {
+{ 0x28  , 0x239b, 0x239c, 0x239d, 0x0    }, // left parenthesis
+{ 0x29  , 0x239e, 0x239f, 0x23a0, 0x0    }, // right parenthesis
+{ 0x5b  , 0x23a1, 0x23a2, 0x23a3, 0x0    }, // left square bracket
+{ 0x5d  , 0x23a4, 0x23a5, 0x23a6, 0x0    }, // right square bracket
+{ 0x7b  , 0x23a7, 0x23aa, 0x23a9, 0x23a8 }, // left curly bracket
+{ 0x7c  , 0x23d0, 0x23d0, 0x23d0, 0x0    }, // vertical bar
+{ 0x7d  , 0x23ab, 0x23aa, 0x23ad, 0x23ac }, // right curly bracket
+{ 0x222b, 0x2320, 0x23ae, 0x2321, 0x0    } // integral sign
+};
+
+// We stack glyphs using a 14px height with a displayed glyph height
+// of 10px.  The line height is set to less than the 14px so that there
+// are no blank spaces between the stacked glyphs.
+//
+// Certain glyphs (e.g. middle and bottom) need to be adjusted upwards
+// in the stack so that there isn't a gap.
+//
+// All of these settings are represented in the constants below.
+
+static const int gGlyphFontSize = 14;
+static const int gGlyphLineHeight = 12;
+static const int gMinimumStretchHeight = 24;
+static const int gGlyphHeight = 10;
+static const int gMiddleGlyphTopAdjust = -2;
+static const int gBottomGlyphTopAdjust = -4;
+
+void RenderMathMLOperator::updateFromElement()
+{
+    // clear our children
+    while (firstChild()) {
+       RenderObject* obj = firstChild();
+       removeChild(obj);
+    }
+    
+    // If the operator is fixed, it will be contained in m_operator
+    UChar firstChar = m_operator;
+    
+    // This boolean indicates whether stretching is disabled via the markup.
+    bool stretchDisabled = false;
+    
+    // We made need the element later if we can't stretch.
+    if (node()->nodeType() == Node::ELEMENT_NODE) {
+        if (Element* mo = static_cast<Element*>(node())) {
+            AtomicString stretchyAttr = mo->getAttribute(MathMLNames::stretchyAttr);
+            stretchDisabled = equalIgnoringCase(stretchyAttr, "false");
+            
+            // If stretching isn't disabled, get the character from the text content.
+            if (!stretchDisabled && !firstChar) {
+                String opText = mo->textContent();
+                for (unsigned int i = 0; !firstChar && i < opText.length(); i++) {
+                    if (!isSpaceOrNewline(opText[i]))
+                       firstChar = opText[i];
+                }
+            }
+        }
+    }
+    
+    // The 'index' holds the stretchable character's glyph information
+    int index = -1;
+    
+    // isStretchy indicates whether the character is streatchable via a number of factors.
+    bool isStretchy = false;
+    
+    // Check for a stretchable character.
+    if (!stretchDisabled && firstChar) {
+        const int maxIndex = sizeof(stretchyCharacters) / sizeof(stretchyCharacters[0]);
+        for (index++; index < maxIndex; index++) {
+            if (stretchyCharacters[index].character == firstChar) {
+                isStretchy = true;
+                break;
+            }
+        }
+    }
+    
+    // We only stretch character if the stretch height is larger than a minimum size (e.g. 24px).
+    bool shouldStretch = isStretchy && m_stretchHeight>gMinimumStretchHeight;
+    
+    // Either stretch is disabled or we don't have a stretchable character over the minimum height
+    if (stretchDisabled || !shouldStretch) {
+        m_isStacked = false;
+        RenderBlock* container = new (renderArena()) RenderBlock(node());
+        
+        RefPtr<RenderStyle> newStyle = RenderStyle::create();
+        newStyle->inheritFrom(style());
+        newStyle->setDisplay(BLOCK);
+
+        // Check for a stretchable character that is under the minimum height and use the
+        // font size to adjust the glyph size.
+        int currentFontSize = style()->fontSize();
+        if (!stretchDisabled && isStretchy && m_stretchHeight > 0 && m_stretchHeight <= gMinimumStretchHeight  && m_stretchHeight > currentFontSize) {
+            FontDescription* desc = new FontDescription();
+            desc->setIsAbsoluteSize(true);
+            desc->setSpecifiedSize(m_stretchHeight);
+            desc->setComputedSize(m_stretchHeight);
+            newStyle->setFontDescription(*desc);
+            newStyle->font().update(newStyle->font().fontSelector());
+        }
+        
+        newStyle->setVerticalAlign(BASELINE);
+        container->setStyle(newStyle.release());
+        addChild(container);
+     
+        // Build the text of the operator.  
+        RenderText* text = 0;
+        if (m_operator) 
+            text = new (renderArena()) RenderText(node(), StringImpl::create(&m_operator, 1));
+        else if (node()->nodeType() == Node::ELEMENT_NODE)
+            if (Element* mo = static_cast<Element*>(node()))
+                text = new (renderArena()) RenderText(node(), StringImpl::create(mo->textContent()));
+        // If we can't figure out the text, leave it blank.
+        if (text) {
+            text->setStyle(container->style());
+            container->addChild(text);
+        }
+    } else {
+        // Build stretchable characters as a stack of glyphs.
+        m_isStacked = true;
+        
+        if (stretchyCharacters[index].middleGlyph) {
+            // We have a middle glyph (e.g. a curly bracket) that requires special processing.
+            int half = (m_stretchHeight - gGlyphHeight) / 2;
+            if (half <= gGlyphHeight) {
+                // We only have enough space for a single middle glyph.
+                createGlyph(stretchyCharacters[index].topGlyph, half);
+                createGlyph(stretchyCharacters[index].middleGlyph, gGlyphHeight, gMiddleGlyphTopAdjust);
+                createGlyph(stretchyCharacters[index].bottomGlyph, 0, gBottomGlyphTopAdjust);
+            } else {
+                // We have to extend both the top and bottom to the middle.
+                createGlyph(stretchyCharacters[index].topGlyph, gGlyphHeight);
+                int remaining = half - gGlyphHeight;
+                while (remaining > 0) {
+                    if (remaining < gGlyphHeight) {
+                        createGlyph(stretchyCharacters[index].extensionGlyph, remaining);
+                        remaining = 0;
+                    } else {
+                        createGlyph(stretchyCharacters[index].extensionGlyph, gGlyphHeight);
+                        remaining -= gGlyphHeight;
+                    }
+                }
+                
+                // The middle glyph in the stack.
+                createGlyph(stretchyCharacters[index].middleGlyph, gGlyphHeight, gMiddleGlyphTopAdjust);
+                
+                // The remaining is the top half minus the middle glyph height.
+                remaining = half - gGlyphHeight;
+                // We need to make sure we have the full height in case the height is odd.
+                if (m_stretchHeight % 2 == 1)
+                    remaining++;
+                
+                // Extend to the bottom glyph.
+                while (remaining > 0) {
+                    if (remaining < gGlyphHeight) {
+                        createGlyph(stretchyCharacters[index].extensionGlyph, remaining);
+                        remaining = 0;
+                    } else {
+                        createGlyph(stretchyCharacters[index].extensionGlyph, gGlyphHeight);
+                        remaining -= gGlyphHeight;
+                    }
+                }
+                
+                // The bottom glyph in the stack.
+                createGlyph(stretchyCharacters[index].bottomGlyph, 0, gBottomGlyphTopAdjust);
+            }
+        } else {
+            // We do not have a middle glyph and so we just extend from the top to the bottom glyph.
+            int remaining = m_stretchHeight - 2 * gGlyphHeight;
+            createGlyph(stretchyCharacters[index].topGlyph, gGlyphHeight);
+            while (remaining > 0) {
+                if (remaining < gGlyphHeight) {
+                    createGlyph(stretchyCharacters[index].extensionGlyph, remaining);
+                    remaining = 0;
+                } else {
+                    createGlyph(stretchyCharacters[index].extensionGlyph, gGlyphHeight);
+                    remaining -= gGlyphHeight;
+                }
+            }
+            createGlyph(stretchyCharacters[index].bottomGlyph, 0, gBottomGlyphTopAdjust);
+        }
+    }
+}
+
+RefPtr<RenderStyle> RenderMathMLOperator::createStackableStyle(int size, int topRelative)
+{
+    RefPtr<RenderStyle> newStyle = RenderStyle::create();
+    newStyle->inheritFrom(style());
+    newStyle->setDisplay(BLOCK);
+
+    FontDescription* desc = new FontDescription();
+    desc->setIsAbsoluteSize(true);
+    desc->setSpecifiedSize(gGlyphFontSize);
+    desc->setComputedSize(gGlyphFontSize);
+    newStyle->setFontDescription(*desc);
+    newStyle->font().update(newStyle->font().fontSelector());
+    newStyle->setLineHeight(Length(gGlyphLineHeight, Fixed));
+    newStyle->setVerticalAlign(TOP);
+    
+    if (size > 0)
+        newStyle->setMaxHeight(Length(size, Fixed));
+        
+    newStyle->setOverflowY(OHIDDEN);
+    newStyle->setOverflowX(OHIDDEN);
+    if (topRelative) {
+        newStyle->setTop(Length(topRelative, Fixed));
+        newStyle->setPosition(RelativePosition);
+    }
+    
+    return newStyle;
+}
+
+RenderBlock* RenderMathMLOperator::createGlyph(UChar glyph, int size, int charRelative, int topRelative)
+{
+    RenderBlock* container = new (renderArena()) RenderBlock(node());
+    container->setStyle(createStackableStyle(size, topRelative).release());
+    addChild(container);
+    RenderBlock* parent = container;
+    if (charRelative) {
+        RenderBlock* charBlock = new (renderArena()) RenderBlock(node());
+        RefPtr<RenderStyle> charStyle = RenderStyle::create();
+        charStyle->inheritFrom(container->style());
+        charStyle->setDisplay(INLINE_BLOCK);
+        charStyle->setTop(Length(charRelative, Fixed));
+        charStyle->setPosition(RelativePosition);
+        charBlock->setStyle(charStyle);
+        parent->addChild(charBlock);
+        parent = charBlock;
+    }
+     
+    RenderText* text = new (renderArena()) RenderText(node(), StringImpl::create(&glyph, 1));
+    text->setStyle(container->style());
+    parent->addChild(text);
+    return container;
+}
+
+int RenderMathMLOperator::baselinePosition(bool firstLine, bool isRootLineBox) const
+{
+    return !m_isStacked && firstChild() ? firstChild()->baselinePosition(firstLine, isRootLineBox) : offsetHeight();
+}
+
+}
+
+#endif
diff --git a/WebCore/mathml/RenderMathMLOperator.h b/WebCore/mathml/RenderMathMLOperator.h
new file mode 100644
index 0000000..6566dd7
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLOperator.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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 RenderMathMLOperator_h
+#define RenderMathMLOperator_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+    
+class RenderMathMLOperator : public RenderMathMLBlock {
+public:
+    RenderMathMLOperator(Node* container);
+    RenderMathMLOperator(Node* container, UChar operatorChar);
+    virtual bool isRenderMathMLOperator() const { return true; }
+    virtual void stretchToHeight(int pixelHeight);
+    virtual void updateFromElement(); 
+    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
+    virtual int baselinePosition(bool , bool) const;    
+    
+protected:
+    virtual void layout();
+    virtual RefPtr<RenderStyle> createStackableStyle(int size, int topRelative);
+    virtual RenderBlock* createGlyph(UChar glyph, int size = 0, int charRelative = 0, int topRelative = 0);
+    
+private:
+    int m_stretchHeight;
+    bool m_isStacked;
+    UChar m_operator;
+};
+
+inline RenderMathMLOperator* toRenderMathMLOperator(RenderMathMLBlock* block)
+{ 
+    ASSERT(!block || block->isRenderMathMLOperator());
+    return static_cast<RenderMathMLOperator*>(block);
+}
+
+inline const RenderMathMLOperator* toRenderMathMLOperator(const RenderMathMLBlock* block)
+{ 
+    ASSERT(!block || block->isRenderMathMLOperator());
+    return static_cast<const RenderMathMLOperator*>(block);
+}
+    
+}
+
+
+#endif // ENABLE(MATHML)
+#endif // RenderMathMLOperator_h
diff --git a/WebCore/mathml/RenderMathMLRow.cpp b/WebCore/mathml/RenderMathMLRow.cpp
new file mode 100644
index 0000000..1bb656f
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLRow.cpp
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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(MATHML)
+
+#include "RenderMathMLRow.h"
+
+#include "MathMLNames.h"
+#include "RenderMathMLOperator.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+RenderMathMLRow::RenderMathMLRow(Node* row)
+    : RenderMathMLBlock(row)
+{
+}
+
+int RenderMathMLRow::nonOperatorHeight() const
+{
+    int maxHeight = 0;
+    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+        if (current->isRenderMathMLBlock()) {
+            RenderMathMLBlock* block = toRenderMathMLBlock(current);
+            int blockHeight = block->nonOperatorHeight();
+            // Check to see if this box has a larger height
+            if (blockHeight > maxHeight)
+                maxHeight = blockHeight;
+        } else if (current->isBoxModelObject()) {
+            RenderBoxModelObject* box = toRenderBoxModelObject(current);
+            // Check to see if this box has a larger height
+            if (box->offsetHeight() > maxHeight)
+                maxHeight = box->offsetHeight();
+        }
+        
+    }
+    return maxHeight;
+}
+
+void RenderMathMLRow::layout() 
+{
+    RenderBlock::layout();
+    
+    // Calculate the maximum height of the row without the operators.
+    int maxHeight = nonOperatorHeight();
+    
+    // Set the maximum height of the row for intermediate layouts.
+    style()->setHeight(Length(maxHeight, Fixed));
+
+    // Notify contained operators they may need to re-layout their stretched operators.
+    // We need to keep track of the number of children and operators because a row of
+    // operators needs some special handling.
+    int childCount = 0;
+    int operatorCount = 0;
+    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+        childCount++;
+        if (current->isRenderMathMLBlock()) {
+            RenderMathMLBlock* block = toRenderMathMLBlock(current);
+            block->stretchToHeight(maxHeight);
+            if (block->isRenderMathMLOperator()) 
+                operatorCount++;
+        }
+    }
+    
+    // Layout the non-operators which have just been stretched.
+    setNeedsLayoutAndPrefWidthsRecalc();
+    markContainingBlocksForLayout();
+    RenderBlock::layout();
+
+    // Make a second pass with the real height of the operators.
+    int operatorHeight = 0;
+    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+        if (current->isRenderMathMLBlock()) {
+            RenderMathMLBlock* block = toRenderMathMLBlock(current);
+            if (!block->hasBase() && !block->isRenderMathMLOperator()) {
+                // Check to see if this box has a larger height.
+                if (block->offsetHeight() > maxHeight)
+                    maxHeight = block->offsetHeight();
+            }
+            if (block->isRenderMathMLOperator())
+                if (block->offsetHeight() > operatorHeight)
+                    operatorHeight = block->offsetHeight();
+        } else if (current->isBoxModelObject()) {
+            RenderBoxModelObject* box = toRenderBoxModelObject(current);
+            // Check to see if this box has a larger height.
+            if (box->offsetHeight() > maxHeight)
+                maxHeight = box->offsetHeight();
+        }
+    }
+    
+    if (childCount > 0 && childCount == operatorCount) {
+        // We have only operators and so set the max height to the operator height.
+        maxHeight = operatorHeight;
+    }
+    
+    int stretchHeight = maxHeight;
+    
+    // Stretch the operators again and re-calculate the row height.
+    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+        if (current->isRenderMathMLBlock()) {
+            RenderMathMLBlock* block = toRenderMathMLBlock(current);
+            if (block->isRenderMathMLOperator()) {
+                RenderMathMLOperator* mathop = toRenderMathMLOperator(block);
+                mathop->stretchToHeight(stretchHeight);
+            } else {
+                block->stretchToHeight(stretchHeight);
+                RenderBoxModelObject* box = toRenderBoxModelObject(current);
+                // Check to see if this box has a larger height
+                if (box->offsetHeight() > maxHeight)
+                    maxHeight = box->offsetHeight();
+            }
+        } else if (current->isBoxModelObject()) {
+            RenderBoxModelObject* box = toRenderBoxModelObject(current);
+            // Check to see if this box has a larger height
+            if (box->offsetHeight() > maxHeight)
+                maxHeight = box->offsetHeight();
+        }
+    }
+
+    // Set the maximum height of the row based on the calculations.
+    style()->setHeight(Length(maxHeight, Fixed));
+    
+    // Do the final layout by calling our parent's layout again.
+    setNeedsLayoutAndPrefWidthsRecalc();
+    markContainingBlocksForLayout();
+    RenderBlock::layout();
+}
+
+}
+
+#endif // ENABLE(MATHML)
+
diff --git a/WebCore/mathml/RenderMathMLRow.h b/WebCore/mathml/RenderMathMLRow.h
new file mode 100644
index 0000000..a88b212
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLRow.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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 RenderMathMLRow_h
+#define RenderMathMLRow_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+    
+class RenderMathMLRow : public RenderMathMLBlock {
+public:
+    RenderMathMLRow(Node* container);
+    virtual bool isRenderMathMLRow() const { return true; }
+    virtual int nonOperatorHeight() const;
+protected:
+    virtual void layout();
+};
+    
+}
+
+
+#endif // ENABLE(MATHML)
+#endif // RenderMathMLRow_h
diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp
new file mode 100644
index 0000000..3124ac9
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLSubSup.cpp
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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(MATHML)
+
+#include "RenderMathMLSubSup.h"
+
+#include "FontSelector.h"
+#include "MathMLNames.h"
+#include "RenderInline.h"
+#include "RenderTable.h"
+#include "RenderTableCell.h"
+#include "RenderTableRow.h"
+#include "RenderTableSection.h"
+#include "RenderText.h"
+
+namespace WebCore {
+    
+using namespace MathMLNames;
+
+static const int gTopAdjustDivisor = 3;
+static const int gSubsupScriptMargin = 1;
+static const float gSubSupStretch = 1.2;
+
+RenderMathMLSubSup::RenderMathMLSubSup(Element* element) 
+    : RenderMathMLBlock(element)
+    , m_scripts(0)
+{
+    // Determine what kind of under/over expression we have by element name
+    if (element->hasLocalName(MathMLNames::msubTag))
+        m_kind = Sub;
+    else if (element->hasLocalName(MathMLNames::msupTag))
+        m_kind = Sup;
+    else if (element->hasLocalName(MathMLNames::msubsupTag))
+        m_kind = SubSup;
+    else 
+        m_kind = SubSup;
+}
+
+void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild)
+{
+    if (firstChild()) {
+        // We already have a base, so this is the super/subscripts being added.
+        
+        if (m_kind == SubSup) {
+            if (!m_scripts) {
+                m_scripts = new (renderArena()) RenderMathMLBlock(node());
+                RefPtr<RenderStyle> scriptsStyle = RenderStyle::create();
+                scriptsStyle->inheritFrom(style());
+                scriptsStyle->setDisplay(INLINE_BLOCK);
+                scriptsStyle->setVerticalAlign(MIDDLE);
+                scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed));
+                scriptsStyle->setTextAlign(LEFT);
+                m_scripts->setStyle(scriptsStyle.release());
+                RenderMathMLBlock::addChild(m_scripts, beforeChild);
+            }
+            
+            RenderBlock* script = new (renderArena()) RenderMathMLBlock(node());
+            RefPtr<RenderStyle> scriptStyle = RenderStyle::create();
+            scriptStyle->inheritFrom(m_scripts->style());
+            scriptStyle->setDisplay(BLOCK);
+            script->setStyle(scriptStyle.release());
+            
+            m_scripts->addChild(script, m_scripts->firstChild());
+            script->addChild(child);
+        } else
+            RenderMathMLBlock::addChild(child, beforeChild);
+        
+    } else {
+        RenderMathMLBlock* wrapper = new (renderArena()) RenderMathMLBlock(node());
+        RefPtr<RenderStyle> wrapperStyle = RenderStyle::create();
+        wrapperStyle->inheritFrom(style());
+        wrapperStyle->setDisplay(INLINE_BLOCK);
+        wrapperStyle->setVerticalAlign(MIDDLE);
+        wrapper->setStyle(wrapperStyle.release());
+        RenderMathMLBlock::addChild(wrapper, beforeChild);
+        wrapper->addChild(child);
+    }
+}
+
+void  RenderMathMLSubSup::stretchToHeight(int height)
+{
+    RenderObject* base = firstChild();
+    if (!base)
+        return;
+    
+    if (base->isRenderMathMLBlock()) {
+        RenderMathMLBlock* block = toRenderMathMLBlock(base);
+        block->stretchToHeight(static_cast<int>(gSubSupStretch * height));
+    }
+    if (height > 0 && m_kind == SubSup && m_scripts) {
+        RenderObject* script = m_scripts->firstChild();
+        if (script) {
+            // Calculate the script height without the container margins.
+            RenderObject* top = script;
+            int topHeight = getBoxModelObjectHeight(top->firstChild());
+            int topAdjust = topHeight / gTopAdjustDivisor;
+            top->style()->setMarginTop(Length(-topAdjust, Fixed));
+            top->style()->setMarginBottom(Length(height - topHeight + topAdjust, Fixed));
+            if (top->isBoxModelObject()) {
+                RenderBoxModelObject* topBox = toRenderBoxModelObject(top);
+                topBox->updateBoxModelInfoFromStyle();
+            }
+            m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
+            m_scripts->markContainingBlocksForLayout();
+        }
+    }
+    updateBoxModelInfoFromStyle();
+    setNeedsLayoutAndPrefWidthsRecalc();
+    markContainingBlocksForLayout();
+}
+
+int RenderMathMLSubSup::nonOperatorHeight() const 
+{
+    return 0;
+}
+
+void RenderMathMLSubSup::layout() 
+{
+    RenderBlock::layout();
+    
+    if (m_kind == SubSup) {
+        int width = 0;
+        RenderObject* current = firstChild();
+        while (current) {
+            width += getBoxModelObjectWidth(current);
+            current = current->nextSibling();
+        }
+        width++;
+        // 1 + margin of scripts
+        if (m_scripts) 
+            width += gSubsupScriptMargin;
+        style()->setWidth(Length(width, Fixed));
+
+        setNeedsLayoutAndPrefWidthsRecalc();
+        markContainingBlocksForLayout();
+        RenderBlock::layout();
+    }    
+}
+
+int RenderMathMLSubSup::baselinePosition(bool firstLine, bool isRootLineBox) const
+{
+    RenderObject* base = firstChild();
+    if (!base) 
+        return offsetHeight();
+    base = base->firstChild();
+    if (!base) 
+        return offsetHeight();
+    
+    int baseline = offsetHeight();
+    
+    switch (m_kind) {
+    case SubSup:
+        if (m_scripts) {
+            int topAdjust = 0;
+            if (base->isBoxModelObject()) {
+                RenderBoxModelObject* box = toRenderBoxModelObject(base);
+                topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
+            }
+            return topAdjust + (base ? base->baselinePosition(firstLine, isRootLineBox) : 0) + 4;
+        }
+        break;
+    case Sup:
+        if (base) {
+            baseline = base->baselinePosition(firstLine, isRootLineBox) + 4;
+            // FIXME: The extra amount of the superscript ascending above the base's box
+            // isn't taken into account.  This should be calculated in a more reliable
+            // way.
+            RenderObject* sup = base->nextSibling();
+            if (sup && sup->isBoxModelObject()) {
+                RenderBoxModelObject* box = toRenderBoxModelObject(sup);
+                // we'll take half of the sup's box height into account in the baseline
+                baseline += static_cast<int>(box->offsetHeight() * 0.5);
+            }
+            baseline++;
+        }
+        break;
+    case Sub:
+        if (base) 
+            baseline = base->baselinePosition(true) + 4;
+    }
+    
+    return baseline;
+    
+}
+    
+}    
+
+#endif // ENABLE(MATHML)
diff --git a/WebCore/mathml/RenderMathMLSubSup.h b/WebCore/mathml/RenderMathMLSubSup.h
new file mode 100644
index 0000000..037ef89
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLSubSup.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 Alex Milowski (alex@milowski.com). 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 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 RenderMathMLSubSup_h
+#define RenderMathMLSubSup_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+#include "RenderTable.h"
+
+namespace WebCore {
+    
+class RenderMathMLSubSup : public RenderMathMLBlock {
+public:
+    RenderMathMLSubSup(Element* fraction);
+    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
+    virtual bool hasBase() const { return true; }
+    virtual int nonOperatorHeight() const;
+    virtual void stretchToHeight(int pixelHeight);
+    virtual int baselinePosition(bool, bool) const;    
+
+protected:
+    virtual void layout();
+    
+private:
+    enum SubSupType { Sub, Sup, SubSup };
+    SubSupType m_kind;
+    RenderBlock* m_scripts;
+};
+    
+}
+
+#endif // ENABLE(MATHML)
+
+#endif // RenderMathMLSubSup_h
+
diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp
new file mode 100644
index 0000000..514b872
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLUnderOver.cpp
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). 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 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(MATHML)
+
+#include "RenderMathMLUnderOver.h"
+
+#include "FontSelector.h"
+#include "MathMLNames.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+    
+static const double gOverSpacingAdjustment = 0.5;
+    
+RenderMathMLUnderOver::RenderMathMLUnderOver(Node* expression) 
+    : RenderMathMLBlock(expression) 
+{
+    Element* element = static_cast<Element*>(expression);
+    // Determine what kind of under/over expression we have by element name
+    
+    if (element->hasLocalName(MathMLNames::munderTag))
+        m_kind = Under;
+    else if (element->hasLocalName(MathMLNames::moverTag))
+        m_kind = Over;
+    else if (element->hasLocalName(MathMLNames::munderoverTag))
+        m_kind = UnderOver;
+    else 
+        m_kind = Under;
+    
+}
+
+void RenderMathMLUnderOver::addChild(RenderObject* child, RenderObject* beforeChild)
+{    
+    RenderMathMLBlock* row = new (renderArena()) RenderMathMLBlock(node());
+    RefPtr<RenderStyle> rowStyle = makeBlockStyle();
+    row->setStyle(rowStyle.release());
+    
+    // look through the children for rendered elements counting the blocks so we know what child
+    // we are adding
+    int blocks = 0;
+    RenderObject* current = this->firstChild();
+    while (current) {
+        blocks++;
+        current = current->nextSibling();
+    }
+    
+    switch (blocks) {
+    case 0:
+        // this is the base so just append it
+        RenderBlock::addChild(row, beforeChild);
+        break;
+    case 1:
+        // the under or over
+        // FIXME: text-align: center does not work
+        row->style()->setTextAlign(CENTER);
+        if (m_kind == Over) {
+            // add the over as first
+            RenderBlock::addChild(row, firstChild());
+        } else {
+            // add the under as last
+            RenderBlock::addChild(row, beforeChild);
+        }
+        break;
+    case 2:
+        // the under or over
+        // FIXME: text-align: center does not work
+        row->style()->setTextAlign(CENTER);
+        if (m_kind == UnderOver) {
+            // add the over as first
+            RenderBlock::addChild(row, firstChild());
+        } else {
+            // we really shouldn't get here as only munderover should have three children
+            RenderBlock::addChild(row, beforeChild);
+        }
+        break;
+    default:
+        // munderover shouldn't have more than three children.  In theory we shouldn't 
+        // get here if the MathML is correctly formed, but that isn't a guarantee.
+        // We will treat this as another under element and they'll get something funky.
+        RenderBlock::addChild(row, beforeChild);
+    }
+    row->addChild(child);    
+}
+
+inline int getOffsetHeight(RenderObject* obj) 
+{
+    if (obj->isBoxModelObject()) {
+        RenderBoxModelObject* box = toRenderBoxModelObject(obj);
+        return box->offsetHeight();
+    }
+   
+    return 0;
+}
+
+void  RenderMathMLUnderOver::stretchToHeight(int height)
+{
+
+    RenderObject* base = firstChild();
+    if (!base)
+        return;
+        
+    // For over or underover, the base is the sibling of the first child
+    if (m_kind != Under) 
+        base = base->nextSibling();
+        
+    if (!base)
+        return;
+        
+    // use the child of the row which is the actual base
+    base = base->firstChild();
+    
+    if (base && base->isRenderMathMLBlock()) {
+        RenderMathMLBlock* block = toRenderMathMLBlock(base);
+        block->stretchToHeight(height);
+        updateBoxModelInfoFromStyle();
+        setNeedsLayoutAndPrefWidthsRecalc();
+        markContainingBlocksForLayout();
+    }
+}
+
+void RenderMathMLUnderOver::layout() 
+{
+    RenderBlock::layout();
+    RenderObject* over = 0;
+    RenderObject* base = 0;
+    switch (m_kind) {
+    case Over:
+        // We need to calculate the baseline over the over versus the start of the base and 
+        // adjust the placement of the base.
+        over = firstChild();
+        if (over) {
+            // FIXME: descending glyphs intrude into base (e.g. lowercase y over base)
+            // FIXME: bases that ascend higher than the line box intrude into the over
+            int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - over->firstChild()->baselinePosition(true)));
+            
+            // base row wrapper
+            base = over->nextSibling();
+            if (base) {
+                if (overSpacing > 0) 
+                    base->style()->setMarginTop(Length(-overSpacing, Fixed));
+                else 
+                    base->style()->setMarginTop(Length(0, Fixed));
+            }
+            
+        }
+        break;
+    case Under:
+        // FIXME: Non-ascending glyphs in the under should be moved closer to the base
+
+        // We need to calculate the baseline of the base versus the start of the under block and
+        // adjust the placement of the under block.
+        
+        // base row wrapper
+        base = firstChild();
+        if (base) {
+            int baseHeight = getOffsetHeight(base);
+            // actual base
+            base = base->firstChild();
+            // FIXME: We need to look at the space between a single maximum height of
+            //        the line boxes and the baseline and squeeze them together
+            int underSpacing = baseHeight - base->baselinePosition(true);
+            
+            // adjust the base's intrusion into the under
+            RenderObject* under = lastChild();
+            if (under && underSpacing > 0)
+                under->style()->setMarginTop(Length(-underSpacing, Fixed));
+        }
+        break;
+    case UnderOver:
+        // FIXME: Non-descending glyphs in the over should be moved closer to the base
+        // FIXME: Non-ascending glyphs in the under should be moved closer to the base
+        
+        // We need to calculate the baseline of the over versus the start of the base and 
+        // adjust the placement of the base.
+        
+        over = firstChild();
+        if (over) {
+            // FIXME: descending glyphs intrude into base (e.g. lowercase y over base)
+            // FIXME: bases that ascend higher than the line box intrude into the over
+            int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - over->firstChild()->baselinePosition(true)));
+            
+            // base row wrapper
+            base = over->nextSibling();
+            
+            if (base) {
+                if (overSpacing > 0)
+                    base->style()->setMarginTop(Length(-overSpacing, Fixed));
+                
+                // We need to calculate the baseline of the base versus the start of the under block and
+                // adjust the placement of the under block.
+                
+                int baseHeight = getOffsetHeight(base);
+                // actual base
+                base = base->firstChild();
+                // FIXME: We need to look at the space between a single maximum height of
+                //        the line boxes and the baseline and squeeze them together
+                int underSpacing = baseHeight - base->baselinePosition(true);
+                
+                RenderObject* under = lastChild();
+                if (under && under->firstChild()->isRenderInline() && underSpacing > 0)
+                    under->style()->setMarginTop(Length(-underSpacing, Fixed));
+                
+            }
+        }
+        break;
+    }
+    setNeedsLayoutAndPrefWidthsRecalc();
+    RenderBlock::layout();
+}
+
+int RenderMathMLUnderOver::baselinePosition(bool, bool) const
+{
+    int baseline = 0;
+    RenderObject* current = 0;
+    switch (m_kind) {
+    case UnderOver:
+    case Over:
+        current = firstChild();
+        baseline += getOffsetHeight(current);
+        current = current->nextSibling();
+        if (current) {
+            // actual base
+            RenderObject* base = current->firstChild();
+            baseline += base->baselinePosition(true);
+            // added the negative top margin
+            baseline += current->style()->marginTop().value();
+        }
+        break;
+    case Under:
+        current = firstChild();
+        if (current) {
+            RenderObject* base = current->firstChild();
+            baseline += base->baselinePosition(true);
+        }
+    }
+    return baseline;
+}
+
+
+int RenderMathMLUnderOver::nonOperatorHeight() const 
+{
+    return 0;
+}
+
+}
+
+
+#endif // ENABLE(MATHML)
diff --git a/WebCore/mathml/RenderMathMLUnderOver.h b/WebCore/mathml/RenderMathMLUnderOver.h
new file mode 100644
index 0000000..5917126
--- /dev/null
+++ b/WebCore/mathml/RenderMathMLUnderOver.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 Alex Milowski (alex@milowski.com). 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 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 RenderMathMLUnderOver_h
+#define RenderMathMLUnderOver_h
+
+#if ENABLE(MATHML)
+
+#include "RenderMathMLBlock.h"
+
+namespace WebCore {
+    
+class RenderMathMLUnderOver : public RenderMathMLBlock {
+public:
+    RenderMathMLUnderOver(Node* expression);
+    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
+    virtual void layout();
+    virtual bool hasBase() const { return true; }
+    virtual int nonOperatorHeight() const;
+    virtual int baselinePosition(bool , bool) const;    
+    virtual void stretchToHeight(int pixelHeight);
+private:
+    enum UnderOverType { Under, Over, UnderOver };
+    UnderOverType m_kind;
+};
+    
+}
+
+#endif // ENABLE(MATHML)
+
+#endif // RenderMathMLUnderOver_h
diff --git a/WebCore/mathml/mathtags.in b/WebCore/mathml/mathtags.in
index c853fca..36333a8 100644
--- a/WebCore/mathml/mathtags.in
+++ b/WebCore/mathml/mathtags.in
@@ -12,9 +12,10 @@
 munderover interfaceName=MathMLInlineContainerElement
 msqrt interfaceName=MathMLInlineContainerElement
 mroot interfaceName=MathMLInlineContainerElement
-mi interfaceName=MathMLElement, createWithNew
-mn interfaceName=MathMLElement, createWithNew
-mo interfaceName=MathMLElement, createWithNew
+mi interfaceName=MathMLTextElement
+mn interfaceName=MathMLTextElement
+mo interfaceName=MathMLTextElement
+mtext interfaceName=MathMLTextElement
 msub interfaceName=MathMLElement, createWithNew
 msup interfaceName=MathMLElement, createWithNew
 
diff --git a/WebCore/notifications/Notification.cpp b/WebCore/notifications/Notification.cpp
index ed30800..182f713 100644
--- a/WebCore/notifications/Notification.cpp
+++ b/WebCore/notifications/Notification.cpp
@@ -42,24 +42,24 @@
 
 namespace WebCore {
 
-Notification::Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider)
+Notification::Notification(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider)
     : ActiveDOMObject(context, this)
     , m_isHTML(true)
     , m_isShowing(false)
     , m_presenter(provider)
 {
     ASSERT(m_presenter);
-    Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
-    if (m_presenter->checkPermission(context->url(), document) != NotificationPresenter::PermissionAllowed) {
+    if (m_presenter->checkPermission(context->url()) != NotificationPresenter::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
 
-    m_notificationURL = context->completeURL(url);
-    if (url.isEmpty() || !m_notificationURL.isValid()) {
+    if (url.isEmpty() || !url.isValid()) {
         ec = SYNTAX_ERR;
         return;
     }
+
+    m_notificationURL = url;
 }
 
 Notification::Notification(const NotificationContents& contents, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider)
@@ -70,14 +70,12 @@
     , m_presenter(provider)
 {
     ASSERT(m_presenter);
-    Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
-    if (m_presenter->checkPermission(context->url(), document) != NotificationPresenter::PermissionAllowed) {
+    if (m_presenter->checkPermission(context->url()) != NotificationPresenter::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
-    
-    KURL icon = context->completeURL(contents.icon());
-    if (!icon.isEmpty() && !icon.isValid()) {
+
+    if (!contents.icon().isEmpty() && !contents.icon().isValid()) {
         ec = SYNTAX_ERR;
         return;
     }
diff --git a/WebCore/notifications/Notification.h b/WebCore/notifications/Notification.h
index 6545579..98cbfdf 100644
--- a/WebCore/notifications/Notification.h
+++ b/WebCore/notifications/Notification.h
@@ -55,7 +55,7 @@
 
     class Notification : public RefCounted<Notification>, public ActiveDOMObject, public EventTarget { 
     public:
-        static Notification* create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(url, context, ec, provider); }
+        static Notification* create(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(url, context, ec, provider); }
         static Notification* create(const NotificationContents& contents, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(contents, context, ec, provider); }
         
         virtual ~Notification();
@@ -65,6 +65,7 @@
     
         bool isHTML() { return m_isHTML; }
         KURL url() { return m_notificationURL; }
+        KURL iconURL() { return m_contents.icon(); }
         NotificationContents& contents() { return m_contents; }
 
         DEFINE_ATTRIBUTE_EVENT_LISTENER(display);
@@ -79,8 +80,8 @@
         virtual Notification* toNotification() { return this; }
 
     private:
-        Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider);
-        Notification(const NotificationContents& fields, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider);
+        Notification(const KURL&, ScriptExecutionContext*, ExceptionCode&, NotificationPresenter*);
+        Notification(const NotificationContents&, ScriptExecutionContext*, ExceptionCode&, NotificationPresenter*);
 
         // EventTarget interface
         virtual void refEventTarget() { ref(); }
diff --git a/WebCore/notifications/Notification.idl b/WebCore/notifications/Notification.idl
index b17546a..b99da96 100644
--- a/WebCore/notifications/Notification.idl
+++ b/WebCore/notifications/Notification.idl
@@ -43,12 +43,12 @@
         attribute EventListener onclose;
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/notifications/NotificationCenter.cpp b/WebCore/notifications/NotificationCenter.cpp
index ad9fbec..8089d87 100644
--- a/WebCore/notifications/NotificationCenter.cpp
+++ b/WebCore/notifications/NotificationCenter.cpp
@@ -49,9 +49,7 @@
 {
     if (!presenter())
         return NotificationPresenter::PermissionDenied;
-    return m_notificationPresenter->checkPermission(
-        m_scriptExecutionContext->url(),
-        m_scriptExecutionContext->isDocument() ? static_cast<Document*>(m_scriptExecutionContext) : 0);
+    return m_notificationPresenter->checkPermission(m_scriptExecutionContext->url());
 }
 
 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
diff --git a/WebCore/notifications/NotificationCenter.h b/WebCore/notifications/NotificationCenter.h
index ae3dc02..acf1ae5 100644
--- a/WebCore/notifications/NotificationCenter.h
+++ b/WebCore/notifications/NotificationCenter.h
@@ -55,7 +55,11 @@
                 ec = INVALID_STATE_ERR;
                 return 0;
             }
-            return Notification::create(KURL(ParsedURLString, URI), context(), ec, presenter());
+            if (URI.isEmpty()) {
+                ec = SYNTAX_ERR;
+                return 0;
+            }
+            return Notification::create(m_scriptExecutionContext->completeURL(URI), context(), ec, presenter());
         }
 
         Notification* createNotification(const String& iconURI, const String& title, const String& body, ExceptionCode& ec)
@@ -64,7 +68,7 @@
                 ec = INVALID_STATE_ERR;
                 return 0;
             }
-            NotificationContents contents(iconURI, title, body);
+            NotificationContents contents(iconURI.isEmpty() ? KURL() : m_scriptExecutionContext->completeURL(iconURI), title, body);
             return Notification::create(contents, context(), ec, presenter());
         }
 
diff --git a/WebCore/notifications/NotificationContents.h b/WebCore/notifications/NotificationContents.h
index ebdc514..5807f30 100644
--- a/WebCore/notifications/NotificationContents.h
+++ b/WebCore/notifications/NotificationContents.h
@@ -38,17 +38,17 @@
     class NotificationContents { 
     public:
         NotificationContents() {}
-        NotificationContents(const String& iconUrl, const String& title, const String& body) 
+        NotificationContents(const KURL& iconUrl, const String& title, const String& body)
             : m_icon(iconUrl)
             , m_title(title)
             , m_body(body) {}
 
-        String icon() const { return m_icon; }
+        KURL icon() const { return m_icon; }
         String title() const { return m_title; }
         String body() const { return m_body; }
 
     private:
-        String m_icon;
+        KURL m_icon;
         String m_title;
         String m_body;
     };
diff --git a/WebCore/notifications/NotificationPresenter.h b/WebCore/notifications/NotificationPresenter.h
index 3df03bb..193eb2b 100644
--- a/WebCore/notifications/NotificationPresenter.h
+++ b/WebCore/notifications/NotificationPresenter.h
@@ -71,10 +71,8 @@
         // made a decision.
         virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>) = 0;
 
-        // Checks the current level of permission for the specified URL. If the
-        // URL is a document (as opposed to a worker or other ScriptExecutionContext),
-        // |document| will also be provided.
-        virtual Permission checkPermission(const KURL&, Document*) = 0;
+        // Checks the current level of permission.
+        virtual Permission checkPermission(const KURL&) = 0;
     };
 
 } // namespace WebCore
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index cb7f6bf..b3df888 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -67,9 +67,19 @@
     m_client->chromeDestroyed();
 }
 
-void Chrome::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void Chrome::invalidateWindow(const IntRect& updateRect, bool immediate)
 {
-    m_client->repaint(windowRect, contentChanged, immediate, repaintContentOnly);
+    m_client->invalidateWindow(updateRect, immediate);
+}
+
+void Chrome::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+{
+    m_client->invalidateContentsAndWindow(updateRect, immediate);
+}
+
+void Chrome::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
+{
+    m_client->invalidateContentsForSlowScroll(updateRect, immediate);
 }
 
 void Chrome::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
@@ -334,7 +344,7 @@
     if (result.innerNode()) {
         Document* document = result.innerNode()->document();
         if (document && document->isDNSPrefetchEnabled())
-            prefetchDNS(result.absoluteLinkURL().host());
+            ResourceHandle::prepareForURL(result.absoluteLinkURL());
     }
     m_client->mouseDidMoveOverElement(result, modifierFlags);
 
@@ -417,9 +427,15 @@
     m_client->requestGeolocationPermissionForFrame(frame, geolocation);
 }
 
+<<<<<<< HEAD
 void Chrome::cancelGeolocationPermissionRequestForFrame(Frame* frame)
 {
     m_client->cancelGeolocationPermissionRequestForFrame(frame);
+=======
+void Chrome::cancelGeolocationPermissionRequestForFrame(Frame* frame, Geolocation* geolocation)
+{
+    m_client->cancelGeolocationPermissionRequestForFrame(frame, geolocation);
+>>>>>>> webkit.org at r58033
 }
 
 void Chrome::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser)
@@ -427,9 +443,9 @@
     m_client->runOpenPanel(frame, fileChooser);
 }
 
-void Chrome::iconForFiles(const Vector<String>& filenames, PassRefPtr<FileChooser> fileChooser)
+void Chrome::chooseIconForFiles(const Vector<String>& filenames, FileChooser* fileChooser)
 {
-    m_client->iconForFiles(filenames, fileChooser);
+    m_client->chooseIconForFiles(filenames, fileChooser);
 }
 
 bool Chrome::setCursor(PlatformCursorHandle cursor)
diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h
index 9227f87..ec58de2 100644
--- a/WebCore/page/Chrome.h
+++ b/WebCore/page/Chrome.h
@@ -60,8 +60,11 @@
         ChromeClient* client() { return m_client; }
 
         // HostWindow methods.
-        virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
-        virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
+        virtual void invalidateWindow(const IntRect&, bool);
+        virtual void invalidateContentsAndWindow(const IntRect&, bool);
+        virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
+        virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
         virtual IntPoint screenToWindow(const IntPoint&) const;
         virtual IntRect windowToScreen(const IntRect&) const;
         virtual PlatformPageClient platformPageClient() const;
@@ -133,10 +136,14 @@
         void print(Frame*);
 
         void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+<<<<<<< HEAD
         void cancelGeolocationPermissionRequestForFrame(Frame*);
+=======
+        void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*);
+>>>>>>> webkit.org at r58033
 
         void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
-        void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>);
+        void chooseIconForFiles(const Vector<String>&, FileChooser*);
 
         bool setCursor(PlatformCursorHandle);
 
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 1b8b734..e0b70e0 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -56,6 +56,7 @@
     class Widget;
 
     struct FrameLoadRequest;
+    struct ViewportArguments;
     struct WindowFeatures;
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -133,8 +134,10 @@
         virtual IntRect windowResizerRect() const = 0;
 
         // Methods used by HostWindow.
-        virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;
-        virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
+        virtual void invalidateWindow(const IntRect&, bool) = 0;
+        virtual void invalidateContentsAndWindow(const IntRect&, bool) = 0;
+        virtual void invalidateContentsForSlowScroll(const IntRect&, bool) = 0;
+        virtual void scroll(const IntSize&, const IntRect&, const IntRect&) = 0;
         virtual IntPoint screenToWindow(const IntPoint&) const = 0;
         virtual IntRect windowToScreen(const IntRect&) const = 0;
         virtual PlatformPageClient platformPageClient() const = 0;
@@ -147,6 +150,8 @@
 
         virtual void setToolTip(const String&, TextDirection) = 0;
 
+        virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const { }
+
         virtual void print(Frame*) = 0;
 
 #if ENABLE(DATABASE)
@@ -187,12 +192,15 @@
         // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
         // to use Geolocation.
         virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*) = 0;
+<<<<<<< HEAD
         virtual void cancelGeolocationPermissionRequestForFrame(Frame*) = 0;
+=======
+        virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) = 0;
+>>>>>>> webkit.org at r58033
             
         virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) = 0;
         // Asynchronous request to load an icon for specified filenames.
-        // This is called only if Icon::createIconForFiles() returns 0.
-        virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>) = 0;
+        virtual void chooseIconForFiles(const Vector<String>&, FileChooser*) = 0;
 
         virtual bool setCursor(PlatformCursorHandle) = 0;
 
@@ -214,6 +222,9 @@
         // Sets a flag to specify that the view needs to be updated, so we need
         // to do an eager layout before the drawing.
         virtual void scheduleCompositingLayerSync() = 0;
+        // Returns whether or not the client can render the composited layer,
+        // regardless of the settings.
+        virtual bool allowsAcceleratedCompositing() const { return true; }
 #endif
 
         virtual bool supportsFullscreenForNode(const Node*) { return false; }
@@ -233,6 +244,14 @@
         virtual void needTouchEvents(bool) = 0;
 #endif
 
+#if ENABLE(WIDGETS_10_SUPPORT)
+        virtual bool isWindowed() { return false; }
+        virtual bool isFloating() { return false; }
+        virtual bool isFullscreen() { return false; }
+        virtual bool isMaximized() { return false; }
+        virtual bool isMinimized() { return false; }
+#endif
+
     protected:
         virtual ~ChromeClient() { }
     };
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 99b3106..d5ff7bc 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "Console.h"
 
-#include "CString.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "ConsoleMessage.h"
@@ -45,6 +44,7 @@
 #include "ScriptProfile.h"
 #include "ScriptProfiler.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/UnusedParam.h>
 
 namespace WebCore {
diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl
index c08fcc0..b3c0c24 100644
--- a/WebCore/page/Console.idl
+++ b/WebCore/page/Console.idl
@@ -30,8 +30,7 @@
 
     interface [OmitConstructor] Console {
 
-        // Not enabled in V8 because it requires request-reply style.
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING)
+#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         readonly attribute [CustomGetter] Array profiles;
 #endif
     
diff --git a/WebCore/page/DOMSelection.cpp b/WebCore/page/DOMSelection.cpp
index 0d21c56..a583176 100644
--- a/WebCore/page/DOMSelection.cpp
+++ b/WebCore/page/DOMSelection.cpp
@@ -207,6 +207,10 @@
         ec = INDEX_SIZE_ERR;
         return;
     }
+
+    if (!isValidForPosition(node))
+        return;
+
     m_frame->selection()->moveTo(VisiblePosition(node, offset, DOWNSTREAM));
 }
 
@@ -244,6 +248,10 @@
         ec = INDEX_SIZE_ERR;
         return;
     }
+
+    if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode))
+        return;
+
     VisiblePosition visibleBase = VisiblePosition(baseNode, baseOffset, DOWNSTREAM);
     VisiblePosition visibleExtent = VisiblePosition(extentNode, extentOffset, DOWNSTREAM);
 
@@ -258,6 +266,10 @@
         ec = INDEX_SIZE_ERR;
         return;
     }
+
+    if (!isValidForPosition(node))
+        return;
+
     m_frame->selection()->moveTo(VisiblePosition(node, offset, DOWNSTREAM));
 }
 
@@ -320,14 +332,16 @@
         ec = TYPE_MISMATCH_ERR;
         return;
     }
+
     if (offset < 0 || offset > (node->offsetInCharacters() ? caretMaxOffset(node) : (int)node->childNodeCount())) {
         ec = INDEX_SIZE_ERR;
         return;
     }
 
-    SelectionController* selection = m_frame->selection();
-    selection->expandUsingGranularity(CharacterGranularity);
-    selection->setExtent(VisiblePosition(node, offset, DOWNSTREAM));
+    if (!isValidForPosition(node))
+        return;
+
+    m_frame->selection()->setExtent(VisiblePosition(node, offset, DOWNSTREAM));
 }
 
 PassRefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionCode& ec)
@@ -429,7 +443,7 @@
 
     SelectionController* selection = m_frame->selection();
 
-    if (!n || selection->isNone())
+    if (!n || m_frame->document() != n->document() || selection->isNone())
         return false;
 
     Node* parentNode = n->parentNode();
@@ -472,4 +486,12 @@
     return plainText(m_frame->selection()->selection().toNormalizedRange().get());
 }
 
+bool DOMSelection::isValidForPosition(Node* node) const
+{
+    ASSERT(m_frame);
+    if (!node)
+        return true;
+    return node->document() == m_frame->document();
+}
+
 } // namespace WebCore
diff --git a/WebCore/page/DOMSelection.h b/WebCore/page/DOMSelection.h
index e0fe1e3..0287e44 100644
--- a/WebCore/page/DOMSelection.h
+++ b/WebCore/page/DOMSelection.h
@@ -96,6 +96,7 @@
         // Convenience method for accessors, does not NULL check m_frame.
         const VisibleSelection& visibleSelection() const;
 
+        bool isValidForPosition(Node*) const;
         Frame* m_frame;
     };
 
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 6af22c3..c74cfaf 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -26,15 +26,16 @@
 #include "config.h"
 #include "DOMWindow.h"
 
+#include "Base64.h"
 #include "BarInfo.h"
 #include "BeforeUnloadEvent.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSRuleList.h"
 #include "CSSStyleSelector.h"
-#include "CString.h"
 #include "Chrome.h"
 #include "Console.h"
 #include "Database.h"
+#include "DatabaseCallback.h"
 #include "DOMApplicationCache.h"
 #include "DOMSelection.h"
 #include "DOMTimer.h"
@@ -52,6 +53,8 @@
 #include "FrameView.h"
 #include "HTMLFrameOwnerElement.h"
 #include "History.h"
+#include "IndexedDatabase.h"
+#include "IndexedDatabaseRequest.h"
 #include "InspectorController.h"
 #include "InspectorTimelineAgent.h"
 #include "Location.h"
@@ -73,6 +76,7 @@
 #include "SuddenTermination.h"
 #include "WebKitPoint.h"
 #include <algorithm>
+#include <wtf/text/CString.h>
 #include <wtf/MathExtras.h>
 
 using std::min;
@@ -466,6 +470,12 @@
         m_notifications->disconnectFrame();
     m_notifications = 0;
 #endif
+
+#if ENABLE(INDEXED_DATABASE)
+    if (m_indexedDatabaseRequest)
+        m_indexedDatabaseRequest->disconnectFrame();
+    m_indexedDatabaseRequest = 0;
+#endif
 }
 
 #if ENABLE(ORIENTATION_EVENTS)
@@ -573,9 +583,6 @@
     Document* document = this->document();
     if (!document)
         return 0;
-    
-    if (!document->securityOrigin()->canAccessStorage())
-        return 0;
 
     Page* page = document->page();
     if (!page)
@@ -590,7 +597,7 @@
     return m_sessionStorage.get();
 }
 
-Storage* DOMWindow::localStorage() const
+Storage* DOMWindow::localStorage(ExceptionCode& ec) const
 {
     if (m_localStorage)
         return m_localStorage.get();
@@ -599,8 +606,10 @@
     if (!document)
         return 0;
     
-    if (!document->securityOrigin()->canAccessStorage())
+    if (!document->securityOrigin()->canAccessLocalStorage()) {
+        ec = SECURITY_ERR;
         return 0;
+    }
         
     Page* page = document->page();
     if (!page)
@@ -644,7 +653,23 @@
 #if ENABLE(INDEXED_DATABASE)
 IndexedDatabaseRequest* DOMWindow::indexedDB() const
 {
-    return 0;
+    if (m_indexedDatabaseRequest)
+        return m_indexedDatabaseRequest.get();
+
+    Document* document = this->document();
+    if (!document)
+        return 0;
+
+    // FIXME: See if access is allowed.
+
+    Page* page = document->page();
+    if (!page)
+        return 0;
+
+    // FIXME: See if indexedDatabase access is allowed.
+
+    m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase(), m_frame);
+    return m_indexedDatabaseRequest.get();
 }
 #endif
 
@@ -826,6 +851,57 @@
     return String();
 }
 
+static bool isSafeToConvertCharList(const String& string)
+{
+    for (unsigned i = 0; i < string.length(); i++) {
+        if (string[i] > 0xFF)
+            return false;
+    }
+
+    return true;
+}
+
+String DOMWindow::btoa(const String& stringToEncode, ExceptionCode& ec)
+{
+    if (stringToEncode.isNull())
+        return String();
+
+    if (!isSafeToConvertCharList(stringToEncode)) {
+        ec = INVALID_CHARACTER_ERR;
+        return String();
+    }
+
+    Vector<char> in;
+    in.append(stringToEncode.characters(), stringToEncode.length());
+    Vector<char> out;
+
+    base64Encode(in, out);
+
+    return String(out.data(), out.size());
+}
+
+String DOMWindow::atob(const String& encodedString, ExceptionCode& ec)
+{
+    if (encodedString.isNull())
+        return String();
+
+    if (!isSafeToConvertCharList(encodedString)) {
+        ec = INVALID_CHARACTER_ERR;
+        return String();
+    }
+
+    Vector<char> in;
+    in.append(encodedString.characters(), encodedString.length());
+    Vector<char> out;
+
+    if (!base64Decode(in, out)) {
+        ec = INVALID_CHARACTER_ERR;
+        return String();
+    }
+
+    return String(out.data(), out.size());
+}
+
 bool DOMWindow::find(const String& string, bool caseSensitive, bool backwards, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/) const
 {
     if (!m_frame)
@@ -1067,24 +1143,20 @@
     return m_media.get();
 }
 
-PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String&) const
+PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String& pseudoElt) const
 {
     if (!elt)
         return 0;
 
-    // FIXME: This needs take pseudo elements into account.
-    return computedStyle(elt);
+    return computedStyle(elt, false, pseudoElt);
 }
 
-PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String& pseudoElt, bool authorOnly) const
+PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String&, bool authorOnly) const
 {
     if (!m_frame)
         return 0;
 
     Document* doc = m_frame->document();
-
-    if (!pseudoElt.isEmpty())
-        return doc->styleSelector()->pseudoStyleRulesForElement(elt, pseudoElt, authorOnly);
     return doc->styleSelector()->styleRulesForElement(elt, authorOnly);
 }
 
@@ -1125,20 +1197,16 @@
 }
 
 #if ENABLE(DATABASE)
-PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode& ec)
+PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
 {
-    if (!m_frame)
-        return 0;
+    RefPtr<Database> database = 0;
+    if (m_frame && Database::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase())
+        database = Database::openDatabase(m_frame->document(), name, version, displayName, estimatedSize, creationCallback, ec);
 
-    Document* document = m_frame->document();
-    if (!document->securityOrigin()->canAccessDatabase())
-        return 0;
+    if (!database && !ec)
+        ec = SECURITY_ERR;
 
-    Settings* settings = m_frame->settings();
-    if (!settings || !settings->databasesEnabled())
-        return 0;
-
-    return Database::openDatabase(document, name, version, displayName, estimatedSize, ec);
+    return database;
 }
 #endif
 
@@ -1359,20 +1427,21 @@
     event->setEventPhase(Event::AT_TARGET);
 
 #if ENABLE(INSPECTOR)
-    InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
-    bool timelineAgentIsActive = timelineAgent && hasEventListeners(event->type());
-    if (timelineAgentIsActive)
-        timelineAgent->willDispatchEvent(*event);
+    Page* inspectedPage = InspectorTimelineAgent::instanceCount() && frame() ? frame()->page() : 0;
+    if (inspectedPage) {
+        if (InspectorTimelineAgent* timelineAgent = hasEventListeners(event->type()) ? inspectedPage->inspectorTimelineAgent() : 0)
+            timelineAgent->willDispatchEvent(*event);
+        else
+            inspectedPage = 0;
+    }
 #endif
 
     bool result = fireEventListeners(event.get());
 
 #if ENABLE(INSPECTOR)
-    if (timelineAgentIsActive) {
-      timelineAgent = inspectorTimelineAgent();
-      if (timelineAgent)
+    if (inspectedPage)
+        if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent())
             timelineAgent->didDispatchEvent();
-    }
 #endif
 
     return result;
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 4452dbb..c3a781c 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -45,6 +45,7 @@
     class Console;
     class DOMSelection;
     class Database;
+    class DatabaseCallback;
     class Document;
     class Element;
     class Event;
@@ -139,6 +140,8 @@
         void alert(const String& message);
         bool confirm(const String& message);
         String prompt(const String& message, const String& defaultValue);
+        String btoa(const String& stringToEncode, ExceptionCode&);
+        String atob(const String& encodedString, ExceptionCode&);
 
         bool find(const String&, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) const;
 
@@ -198,13 +201,13 @@
 
 #if ENABLE(DATABASE)
         // HTML 5 client-side database
-        PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode&);
+        PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
 #endif
 
 #if ENABLE(DOM_STORAGE)
         // HTML 5 key/value storage
         Storage* sessionStorage() const;
-        Storage* localStorage() const;
+        Storage* localStorage(ExceptionCode&) const;
 #endif
 
         Console* console() const;
@@ -398,6 +401,9 @@
 #if ENABLE(NOTIFICATIONS)
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
+#if ENABLE(INDEXED_DATABASE)
+        mutable RefPtr<IndexedDatabaseRequest> m_indexedDatabaseRequest;
+#endif
 
         EventTargetData m_eventTargetData;
     };
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index a4b72d2..018b4de 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -160,12 +160,13 @@
         readonly attribute [EnabledAtRuntime] DOMApplicationCache applicationCache;
 #endif    
 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
-        [EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize)
+        [EnabledAtRuntime, Custom] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in DatabaseCallback creationCallback)
             raises(DOMException);
 #endif
 #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
         readonly attribute [EnabledAtRuntime] Storage sessionStorage;
-        readonly attribute [EnabledAtRuntime] Storage localStorage;
+        readonly attribute [EnabledAtRuntime] Storage localStorage
+            getter raises(DOMException);
 #endif
 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
         readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
@@ -204,9 +205,9 @@
         void clearInterval(in long handle);
 
         // Base64
-        [Custom] DOMString atob(in DOMString string)
+        DOMString atob(in [ConvertNullToNullString] DOMString string)
             raises(DOMException);
-        [Custom] DOMString btoa(in DOMString string)
+        DOMString btoa(in [ConvertNullToNullString] DOMString string)
             raises(DOMException);
 
         // Events
@@ -293,12 +294,10 @@
 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
         attribute EventListener onorientationchange;
 #endif
- #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        attribute [DontEnum] EventListener ontouchstart;
-        attribute [DontEnum] EventListener ontouchmove;
-        attribute [DontEnum] EventListener ontouchend;
-        attribute [DontEnum] EventListener ontouchcancel;
- #endif
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchstart;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchmove;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchend;
+        attribute [DontEnum,Conditional=TOUCH_EVENTS] EventListener ontouchcancel;
 
         // EventTarget interface
         [Custom] void addEventListener(in DOMString type,
@@ -421,6 +420,9 @@
         attribute HTMLParagraphElementConstructor HTMLParagraphElement;
         attribute HTMLParamElementConstructor HTMLParamElement;
         attribute HTMLPreElementConstructor HTMLPreElement;
+#if defined(ENABLE_PROGRESS_TAG) && ENABLE_PROGRESS_TAG
+        attribute HTMLProgressElementConstructor HTMLProgressElement;
+#endif
         attribute HTMLQuoteElementConstructor HTMLQuoteElement;
         attribute HTMLScriptElementConstructor HTMLScriptElement;
         attribute HTMLSelectElementConstructor HTMLSelectElement;
@@ -443,17 +445,17 @@
 
         attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D;
         attribute ImageDataConstructor ImageData;
-        attribute [Conditional=3D_CANVAS] WebGLRenderingContextConstructor WebGLRenderingContext;
+        attribute [Conditional=3D_CANVAS,EnabledAtRuntime] WebGLRenderingContextConstructor WebGLRenderingContext;
         attribute TextMetricsConstructor TextMetrics;
 
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLArrayBufferConstructor WebGLArrayBuffer; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLByteArrayConstructor WebGLByteArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedByteArrayConstructor WebGLUnsignedByteArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLShortArrayConstructor WebGLShortArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedShortArrayConstructor WebGLUnsignedShortArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLIntArrayConstructor WebGLIntArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedIntArrayConstructor WebGLUnsignedIntArray; // Usable with new operator
-        attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLFloatArrayConstructor WebGLFloatArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLArrayBufferConstructor WebGLArrayBuffer; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLByteArrayConstructor WebGLByteArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedByteArrayConstructor WebGLUnsignedByteArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLShortArrayConstructor WebGLShortArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedShortArrayConstructor WebGLUnsignedShortArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLIntArrayConstructor WebGLIntArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedIntArrayConstructor WebGLUnsignedIntArray; // Usable with new operator
+        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLFloatArrayConstructor WebGLFloatArray; // Usable with new operator
 
         attribute EventConstructor Event;
         attribute BeforeLoadEventConstructor BeforeLoadEvent;
@@ -709,9 +711,9 @@
 #endif
 #endif
 
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        attribute TouchEventConstructor TouchEvent;
-#endif
+        attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent;
+
+        attribute DOMFormDataConstructor FormData;
 
 #endif // defined(LANGUAGE_JAVASCRIPT)
 
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index 18e3195..f238b27 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -53,6 +53,7 @@
 #include "MoveSelectionCommand.h"
 #include "Node.h"
 #include "Page.h"
+#include "PlatformKeyboardEvent.h"
 #include "RenderFileUploadControl.h"
 #include "RenderImage.h"
 #include "RenderView.h"
@@ -70,10 +71,12 @@
 
 static PlatformMouseEvent createMouseEvent(DragData* dragData)
 {
-    // FIXME: We should fake modifier keys here.
+    bool shiftKey, ctrlKey, altKey, metaKey;
+    shiftKey = ctrlKey = altKey = metaKey = false;
+    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
     return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPosition(),
-                              LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime());
-
+                              LeftButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey,
+                              metaKey, currentTime());
 }
 
 DragController::DragController(Page* page, DragClient* client)
@@ -429,10 +432,11 @@
 
         m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
         if (dragIsMove(innerFrame->selection())) {
-            bool smartMove = innerFrame->selectionGranularity() == WordGranularity
-                          && innerFrame->editor()->smartInsertDeleteEnabled()
-                          && dragData->canSmartReplace();
-            applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartMove));
+            // NSTextView behavior is to always smart delete on moving a selection,
+            // but only to smart insert if the selection granularity is word granularity.
+            bool smartDelete = innerFrame->editor()->smartInsertDeleteEnabled();
+            bool smartInsert = smartDelete && innerFrame->selectionGranularity() == WordGranularity && dragData->canSmartReplace();
+            applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartInsert, smartDelete));
         } else {
             if (setSelectionToDragCaret(innerFrame, dragCaret, range, point))
                 applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse, fragment, true, dragData->canSmartReplace(), chosePlainText));
@@ -482,6 +486,25 @@
     return true;
 }
 
+static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
+{
+    // This is designed to match IE's operation fallback for the case where
+    // the page calls preventDefault() in a drag event but doesn't set dropEffect.
+    if (srcOpMask == DragOperationEvery)
+        return DragOperationCopy;
+    if (srcOpMask == DragOperationNone)
+        return DragOperationNone;
+    if (srcOpMask & DragOperationMove || srcOpMask & DragOperationGeneric)
+        return DragOperationMove;
+    if (srcOpMask & DragOperationCopy)
+        return DragOperationCopy;
+    if (srcOpMask & DragOperationLink)
+        return DragOperationLink;
+    
+    // FIXME: Does IE really return "generic" even if no operations were allowed by the source?
+    return DragOperationGeneric;
+}
+
 bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
 {
     ASSERT(dragData);
@@ -503,7 +526,9 @@
     }
 
     operation = clipboard->destinationOperation();
-    if (!(srcOpMask & operation)) {
+    if (clipboard->dropEffectIsUninitialized())
+        operation = defaultOperationForDrag(srcOpMask);
+    else if (!(srcOpMask & operation)) {
         // The element picked an operation which is not supported by the source
         operation = DragOperationNone;
     }
@@ -512,7 +537,7 @@
     return true;
 }
 
-bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPoint& framePos)
+bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPoint& framePos, Node* node)
 {
     ASSERT(frame);
     ASSERT(frame->settings());
@@ -523,6 +548,8 @@
     HitTestResult mouseDownTarget = HitTestResult(framePos);
 
     mouseDownTarget = frame->eventHandler()->hitTestResultAtPoint(framePos, true);
+    if (node)
+        mouseDownTarget.setInnerNonSharedNode(node);
 
     if (mouseDownTarget.image()
         && !mouseDownTarget.absoluteImageURL().isEmpty()
@@ -532,7 +559,8 @@
 
     if (!mouseDownTarget.absoluteLinkURL().isEmpty()
         && m_dragSourceAction & DragSourceActionLink
-        && mouseDownTarget.isLiveLink())
+        && mouseDownTarget.isLiveLink()
+        && mouseDownTarget.URLElement()->renderer() && mouseDownTarget.URLElement()->renderer()->style()->userDrag() != DRAG_NONE)
         return true;
 
     if (mouseDownTarget.isSelected()
@@ -540,7 +568,6 @@
         return true;
 
     return false;
-
 }
 
 static CachedImage* getCachedImage(Element* element)
diff --git a/WebCore/page/DragController.h b/WebCore/page/DragController.h
index 3d59ebf..3b2b083 100644
--- a/WebCore/page/DragController.h
+++ b/WebCore/page/DragController.h
@@ -77,7 +77,7 @@
         DragDestinationAction dragDestinationAction() const { return m_dragDestinationAction; }
         DragSourceAction delegateDragSourceAction(const IntPoint& pagePoint);
         
-        bool mayStartDragAtEventLocation(const Frame*, const IntPoint& framePos);
+        bool mayStartDragAtEventLocation(const Frame*, const IntPoint& framePos, Node*);
         void dragEnded();
         
         void placeDragCaret(const IntPoint&);
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index a950407..df8759a 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
  *
  * Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,11 @@
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformWheelEvent.h"
+<<<<<<< HEAD
 #include "PluginView.h"
+=======
+#include "PluginDocument.h"
+>>>>>>> webkit.org at r58033
 #include "RenderFrameSet.h"
 #include "RenderTextControlSingleLine.h"
 #include "RenderView.h"
@@ -66,7 +70,10 @@
 #include "SelectionController.h"
 #include "Settings.h"
 #include "TextEvent.h"
+#include "UserGestureIndicator.h"
+#include "WheelEvent.h"
 #include "htmlediting.h" // for comparePositions()
+#include <wtf/CurrentTime.h>
 #include <wtf/StdLibExtras.h>
 
 #if ENABLE(SVG)
@@ -110,25 +117,33 @@
 // When the autoscroll or the panScroll is triggered when do the scroll every 0.05s to make it smooth
 const double autoscrollInterval = 0.05;
 
+const double fakeMouseMoveInterval = 0.1;
+
 static Frame* subframeForHitTestResult(const MouseEventWithHitTestResults&);
 
-static inline void scrollAndAcceptEvent(float delta, ScrollDirection positiveDirection, ScrollDirection negativeDirection, PlatformWheelEvent& e, Node* node, Node** stopNode)
+static inline bool scrollNode(float delta, WheelEvent::Granularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Node** stopNode)
 {
     if (!delta)
-        return;
-        
+        return false;
+    
+    if (!node->renderer())
+        return false;
+    
     // Find the nearest enclosing box.
     RenderBox* enclosingBox = node->renderer()->enclosingBox();
 
-    if (e.granularity() == ScrollByPageWheelEvent) {
-        if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByPage, 1, stopNode))
-            e.accept();
-        return;
-    }
+    float absDelta = delta > 0 ? delta : -delta;
+    
+    if (granularity == WheelEvent::Page)
+        return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByPage, absDelta, stopNode);
 
-    float pixelsToScroll = delta > 0 ? delta : -delta;
-    if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByPixel, pixelsToScroll, stopNode))
-        e.accept();
+    if (granularity == WheelEvent::Line)
+        return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByLine, absDelta, stopNode);
+
+    if (granularity == WheelEvent::Pixel)
+        return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByPixel, absDelta, stopNode);
+        
+    return false;
 }
 
 #if !PLATFORM(MAC) || ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
@@ -166,6 +181,7 @@
     , m_autoscrollInProgress(false)
     , m_mouseDownMayStartAutoscroll(false)
     , m_mouseDownWasInSubframe(false)
+    , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFired)
 #if ENABLE(SVG)
     , m_svgPan(false)
 #endif
@@ -185,6 +201,7 @@
 
 EventHandler::~EventHandler()
 {
+    ASSERT(!m_fakeMouseMoveEventTimer.isActive());
 }
     
 #if ENABLE(DRAG_SUPPORT)
@@ -198,6 +215,7 @@
 void EventHandler::clear()
 {
     m_hoverTimer.stop();
+    m_fakeMouseMoveEventTimer.stop();
     m_resizeLayer = 0;
     m_nodeUnderMouse = 0;
     m_lastNodeUnderMouse = 0;
@@ -233,20 +251,21 @@
 
     if (innerNode && innerNode->renderer() && m_mouseDownMayStartSelect) {
         VisiblePosition pos(innerNode->renderer()->positionForPoint(result.localPoint()));
+        TextGranularity granularity = CharacterGranularity;
         if (pos.isNotNull()) {
             newSelection = VisibleSelection(pos);
             newSelection.expandUsingGranularity(WordGranularity);
         }
     
         if (newSelection.isRange()) {
-            m_frame->setSelectionGranularity(WordGranularity);
+            granularity = WordGranularity;
             m_beganSelectingText = true;
             if (result.event().clickCount() == 2 && m_frame->editor()->isSelectTrailingWhitespaceEnabled()) 
                 newSelection.appendTrailingWhitespace();            
         }
         
         if (m_frame->shouldChangeSelection(newSelection))
-            m_frame->selection()->setSelection(newSelection);
+            m_frame->selection()->setSelection(newSelection, granularity);
     }
 }
 
@@ -264,13 +283,14 @@
         if (pos.isNotNull() && pos.deepEquivalent().node()->isDescendantOf(URLElement))
             newSelection = VisibleSelection::selectionFromContentsOfNode(URLElement);
     
+        TextGranularity granularity = CharacterGranularity;
         if (newSelection.isRange()) {
-            m_frame->setSelectionGranularity(WordGranularity);
+            granularity = WordGranularity;
             m_beganSelectingText = true;
         }
 
         if (m_frame->shouldChangeSelection(newSelection))
-            m_frame->selection()->setSelection(newSelection);
+            m_frame->selection()->setSelection(newSelection, granularity);
     }
 }
 
@@ -307,13 +327,15 @@
         newSelection = VisibleSelection(pos);
         newSelection.expandUsingGranularity(ParagraphGranularity);
     }
+    
+    TextGranularity granularity = CharacterGranularity;
     if (newSelection.isRange()) {
-        m_frame->setSelectionGranularity(ParagraphGranularity);
+        granularity = ParagraphGranularity;
         m_beganSelectingText = true;
     }
     
     if (m_frame->shouldChangeSelection(newSelection))
-        m_frame->selection()->setSelection(newSelection);
+        m_frame->selection()->setSelection(newSelection, granularity);
 
     return true;
 }
@@ -343,8 +365,10 @@
     Position pos = visiblePos.deepEquivalent();
     
     VisibleSelection newSelection = m_frame->selection()->selection();
+    TextGranularity granularity = CharacterGranularity;
+
     if (extendSelection && newSelection.isCaretOrRange()) {
-        m_frame->selection()->setLastChangeWasHorizontalExtension(false);
+        m_frame->selection()->setIsDirectional(false);
         
         // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection 
         // was created right-to-left
@@ -355,16 +379,17 @@
         else
             newSelection = VisibleSelection(start, pos);
 
-        if (m_frame->selectionGranularity() != CharacterGranularity)
+        if (m_frame->selectionGranularity() != CharacterGranularity) {
+            granularity = m_frame->selectionGranularity();
             newSelection.expandUsingGranularity(m_frame->selectionGranularity());
+        }
+
         m_beganSelectingText = true;
-    } else {
+    } else
         newSelection = VisibleSelection(visiblePos);
-        m_frame->setSelectionGranularity(CharacterGranularity);
-    }
     
     if (m_frame->shouldChangeSelection(newSelection))
-        m_frame->selection()->setSelection(newSelection);
+        m_frame->selection()->setSelection(newSelection, granularity);
 
     return true;
 }
@@ -376,6 +401,8 @@
     dragState().m_dragSrc = 0;
 #endif
 
+    cancelFakeMouseMoveEvent();
+
     if (ScrollView* scrollView = m_frame->view()) {
         if (scrollView->isPointInScrollbarCorner(event.event().pos()))
             return false;
@@ -576,8 +603,8 @@
         newSelection.expandUsingGranularity(m_frame->selectionGranularity());
 
     if (m_frame->shouldChangeSelection(newSelection)) {
-        m_frame->selection()->setLastChangeWasHorizontalExtension(false);
-        m_frame->selection()->setSelection(newSelection);
+        m_frame->selection()->setIsDirectional(false);
+        m_frame->selection()->setSelection(newSelection, m_frame->selectionGranularity());
     }
 }
 #endif // ENABLE(DRAG_SUPPORT)
@@ -1005,8 +1032,8 @@
     if (style && style->cursors()) {
         const CursorList* cursors = style->cursors();
         for (unsigned i = 0; i < cursors->size(); ++i) {
-            CachedImage* cimage = (*cursors)[i].cursorImage.get();
-            IntPoint hotSpot = (*cursors)[i].hotSpot;
+            const CachedImage* cimage = (*cursors)[i].image();
+            IntPoint hotSpot = (*cursors)[i].hotSpot();
             if (!cimage)
                 continue;
             // Limit the size of cursors so that they cannot be used to cover UI elements in chrome.
@@ -1151,6 +1178,9 @@
 {
     RefPtr<FrameView> protector(m_frame->view());
 
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+
+    cancelFakeMouseMoveEvent();
     m_mousePressed = true;
     m_capturesDragging = true;
     m_currentMousePosition = mouseEvent.pos();
@@ -1185,7 +1215,7 @@
     if (Page* page = m_frame->page()) {
         InspectorController* inspector = page->inspectorController();
         if (inspector && inspector->enabled() && inspector->searchingForNodeInPage()) {
-            inspector->handleMousePressOnNode(m_mousePressNode.get());
+            inspector->handleMousePress();
             invalidateClick();
             return true;
         }
@@ -1279,6 +1309,8 @@
 {
     RefPtr<FrameView> protector(m_frame->view());
 
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+
     // We get this instead of a second mouse-up 
     m_mousePressed = false;
     m_currentMousePosition = mouseEvent.pos();
@@ -1342,6 +1374,8 @@
     if (m_hoverTimer.isActive())
         m_hoverTimer.stop();
 
+    cancelFakeMouseMoveEvent();
+
 #if ENABLE(SVG)
     if (m_svgPan) {
         static_cast<SVGDocument*>(m_frame->document())->updatePan(m_currentMousePosition);
@@ -1404,8 +1438,18 @@
             scrollbar->mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering.
         if (Page* page = m_frame->page()) {
             if ((!m_resizeLayer || !m_resizeLayer->inResizeMode()) && !page->mainFrame()->eventHandler()->panScrollInProgress()) {
-                if (FrameView* view = m_frame->view())
-                    view->setCursor(selectCursor(mev, scrollbar));
+                // Plugins set cursor on their own. The only case WebKit intervenes is resetting cursor to arrow on mouse enter,
+                // in case the particular plugin doesn't manipulate cursor at all. Thus,  even a CSS cursor set on body has no
+                // effect on plugins (which matches Firefox).
+                bool overPluginElement = false;
+                if (mev.targetNode() && mev.targetNode()->isHTMLElement()) {
+                    HTMLElement* el = static_cast<HTMLElement*>(mev.targetNode());
+                    overPluginElement = el->hasTagName(appletTag) || el->hasTagName(objectTag) || el->hasTagName(embedTag);
+                }
+                if (!overPluginElement) {
+                    if (FrameView* view = m_frame->view())
+                        view->setCursor(selectCursor(mev, scrollbar));
+                }
             }
         }
     }
@@ -1433,6 +1477,8 @@
 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
 {
     RefPtr<FrameView> protector(m_frame->view());
+    
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
 
 #if ENABLE(PAN_SCROLLING)
     if (mouseEvent.button() == MiddleButton)
@@ -1863,21 +1909,6 @@
         node->dispatchWheelEvent(e);
         if (e.isAccepted())
             return true;
-
-        // If we don't have a renderer, send the wheel event to the first node we find with a renderer.
-        // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
-        while (node && !node->renderer())
-            node = node->parent();
-
-        if (node && node->renderer()) {
-            // Just break up into two scrolls if we need to.  Diagonal movement on 
-            // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
-            Node* stopNode = m_previousWheelScrolledNode.get();
-            scrollAndAcceptEvent(e.deltaX(), ScrollLeft, ScrollRight, e, node, &stopNode);
-            scrollAndAcceptEvent(e.deltaY(), ScrollUp, ScrollDown, e, node, &stopNode);
-            if (!m_useLatchedWheelEventNode)
-                m_previousWheelScrolledNode = stopNode;
-        }
     }
 
     if (e.isAccepted())
@@ -1890,6 +1921,25 @@
     view->wheelEvent(e);
     return e.isAccepted();
 }
+    
+void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
+{
+    if (!startNode || !wheelEvent)
+        return;
+    
+    Node* stopNode = m_previousWheelScrolledNode.get();
+    
+    // Break up into two scrolls if we need to.  Diagonal movement on 
+    // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
+    if (scrollNode(wheelEvent->rawDeltaX(), wheelEvent->granularity(), ScrollLeft, ScrollRight, startNode, &stopNode))
+        wheelEvent->setDefaultHandled();
+    
+    if (scrollNode(wheelEvent->rawDeltaY(), wheelEvent->granularity(), ScrollUp, ScrollDown, startNode, &stopNode))
+        wheelEvent->setDefaultHandled();
+    
+    if (!m_useLatchedWheelEventNode)
+        m_previousWheelScrolledNode = stopNode;
+}
 
 #if ENABLE(CONTEXT_MENUS)
 bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
@@ -1930,6 +1980,43 @@
         m_hoverTimer.startOneShot(0);
 }
 
+void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad)
+{
+    FrameView* view = m_frame->view();
+    if (!view)
+        return;
+
+    if (m_mousePressed || !quad.containsPoint(view->windowToContents(m_currentMousePosition)))
+        return;
+
+    if (!m_fakeMouseMoveEventTimer.isActive())
+        m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveInterval);
+}
+
+void EventHandler::cancelFakeMouseMoveEvent()
+{
+    m_fakeMouseMoveEventTimer.stop();
+}
+
+void EventHandler::fakeMouseMoveEventTimerFired(Timer<EventHandler>* timer)
+{
+    ASSERT_UNUSED(timer, timer == &m_fakeMouseMoveEventTimer);
+    ASSERT(!m_mousePressed);
+
+    FrameView* view = m_frame->view();
+    if (!view)
+        return;
+
+    bool shiftKey;
+    bool ctrlKey;
+    bool altKey;
+    bool metaKey;
+    PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
+    IntPoint globalPoint = view->contentsToScreen(IntRect(view->windowToContents(m_currentMousePosition), IntSize())).location();
+    PlatformMouseEvent fakeMouseMoveEvent(m_currentMousePosition, globalPoint, NoButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime());
+    mouseMoved(fakeMouseMoveEvent);
+}
+
 // Whether or not a mouse down can begin the creation of a selection.  Fires the selectStart event.
 bool EventHandler::canMouseDownStartSelect(Node* node)
 {
@@ -1996,6 +2083,7 @@
     if (!doc)
         return 0;
     Node* node = doc->focusedNode();
+<<<<<<< HEAD
 
 #if defined(ANDROID_PLUGINS)
     if (!node && doc->frame() && doc->frame()->view())
@@ -2003,6 +2091,12 @@
                                      ->cursorNodeIsPlugin();
 #endif
 
+=======
+    if (!node && doc->isPluginDocument()) {
+        PluginDocument* pluginDocument = static_cast<PluginDocument*>(doc);
+        node =  pluginDocument->pluginNode();
+    }
+>>>>>>> webkit.org at r58033
     if (!node && doc->isHTMLDocument())
         node = doc->body();
     if (!node)
@@ -2055,6 +2149,8 @@
     if (!node)
         return false;
 
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+
     if (FrameView* view = m_frame->view())
         view->resetDeferredRepaintDelay();
 
@@ -2171,10 +2267,15 @@
             return;
         if (event->keyIdentifier() == "U+0009")
             defaultTabEventHandler(event);
+        else {
+            FocusDirection direction = focusDirectionForKey(event->keyIdentifier());
+            if (direction != FocusDirectionNone)
+                defaultArrowEventHandler(direction, event);
+        }
 
-       // provides KB navigation and selection for enhanced accessibility users
-       if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
-           handleKeyboardSelectionMovement(event);       
+        // provides KB navigation and selection for enhanced accessibility users
+        if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
+            handleKeyboardSelectionMovement(event);
     }
     if (event->type() == eventNames().keypressEvent) {
         m_frame->editor()->handleKeyboardEvent(event);
@@ -2185,6 +2286,27 @@
     }
 }
 
+FocusDirection EventHandler::focusDirectionForKey(const AtomicString& keyIdentifier) const
+{
+    DEFINE_STATIC_LOCAL(AtomicString, Down, ("Down"));
+    DEFINE_STATIC_LOCAL(AtomicString, Up, ("Up"));
+    DEFINE_STATIC_LOCAL(AtomicString, Left, ("Left"));
+    DEFINE_STATIC_LOCAL(AtomicString, Right, ("Right"));
+
+    FocusDirection retVal = FocusDirectionNone;
+
+    if (keyIdentifier == Down)
+        retVal = FocusDirectionDown;
+    else if (keyIdentifier == Up)
+        retVal = FocusDirectionUp;
+    else if (keyIdentifier == Left)
+        retVal = FocusDirectionLeft;
+    else if (keyIdentifier == Right)
+        retVal = FocusDirectionRight;
+
+    return retVal;
+}
+
 #if ENABLE(DRAG_SUPPORT)
 bool EventHandler::dragHysteresisExceeded(const FloatPoint& floatDragViewportLocation) const
 {
@@ -2222,7 +2344,7 @@
     if (!node || !m_frame->view())
         return false;
     Page* page = m_frame->page();
-    return page && page->dragController()->mayStartDragAtEventLocation(m_frame, point);
+    return page && page->dragController()->mayStartDragAtEventLocation(m_frame, point, node);
 }
 
 void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperation operation)
@@ -2332,7 +2454,7 @@
                 // FIXME: This doesn't work correctly with transforms.
                 FloatPoint absPos = renderer->localToAbsolute();
                 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);
-                dragState().m_dragClipboard->setDragImageElement(dragState().m_dragSrc.get(), IntPoint() + delta);
+                dragState().m_dragClipboard->setDragImageElement(dragState().m_dragSrc.get(), toPoint(delta));
             } else {
                 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden
                 // the element in some way.  In this case we just kill the drag.
@@ -2412,8 +2534,7 @@
     return event->defaultHandled();
 }
     
-    
-#if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(HAIKU)
+#if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(HAIKU) && !PLATFORM(EFL)
 bool EventHandler::invertSenseOfTabsToLinks(KeyboardEvent*) const
 {
     return false;
@@ -2479,6 +2600,27 @@
 
 #endif
 
+void EventHandler::defaultArrowEventHandler(FocusDirection focusDirection, KeyboardEvent* event)
+{
+    if (event->ctrlKey() || event->metaKey() || event->altGraphKey() || event->shiftKey())
+        return;
+
+    Page* page = m_frame->page();
+    if (!page)
+        return;
+
+    if (!page->settings() || !page->settings()->isSpatialNavigationEnabled())
+        return;
+
+    // Arrows and other possible directional navigation keys can be used in design
+    // mode editing.
+    if (m_frame->document()->inDesignMode())
+        return;
+
+    if (page->focusController()->advanceFocus(focusDirection, event))
+        event->setDefaultHandled();
+}
+
 void EventHandler::defaultTabEventHandler(KeyboardEvent* event)
 {
     // We should only advance focus on tabs if no special modifier keys are held down.
@@ -2576,6 +2718,11 @@
     const Vector<PlatformTouchPoint>& points = event.touchPoints();
     AtomicString* eventName = 0;
 
+<<<<<<< HEAD
+=======
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+
+>>>>>>> webkit.org at r58033
     for (unsigned i = 0; i < points.size(); ++i) {
         const PlatformTouchPoint& point = points[i];
         IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
@@ -2602,13 +2749,18 @@
 
         // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
         unsigned touchPointTargetKey = point.id() + 1;
+<<<<<<< HEAD
         RefPtr<EventTarget> touchTarget;
+=======
+        EventTarget* touchTarget = 0;
+>>>>>>> webkit.org at r58033
         if (point.state() == PlatformTouchPoint::TouchPressed) {
             m_originatingTouchPointTargets.set(touchPointTargetKey, target);
             touchTarget = target;
         } else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == 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.
+<<<<<<< HEAD
             touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
         } else
             touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
@@ -2617,6 +2769,16 @@
             continue;
 
         RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
+=======
+            touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get();
+        } else
+            touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get();
+
+        if (!touchTarget)
+            continue;
+
+        RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, point.id(),
+>>>>>>> webkit.org at r58033
                                             point.screenPos().x(), point.screenPos().y(),
                                             adjustedPageX, adjustedPageY);
 
@@ -2625,6 +2787,7 @@
             touches->append(touch);
 
         // Now build up the correct list for changedTouches.
+<<<<<<< HEAD
         // 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
         // only be present in the touches list. They may also be added to the
@@ -2632,6 +2795,8 @@
         // 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.
+=======
+>>>>>>> webkit.org at r58033
         if (point.state() == PlatformTouchPoint::TouchReleased)
             releasedTouches->append(touch);
         else if (point.state() == PlatformTouchPoint::TouchCancelled)
@@ -2694,6 +2859,7 @@
 
         RefPtr<TouchList> targetTouches = assembleTargetTouches(changedTouch, touches.get());
 
+<<<<<<< HEAD
 #if PLATFORM(ANDROID)
         if (event.type() == TouchLongPress) {
             eventName = &eventNames().touchlongpressEvent;
@@ -2717,6 +2883,8 @@
             defaultPrevented |= doubleTapEv->defaultPrevented();
         } else {
 #endif
+=======
+>>>>>>> webkit.org at r58033
         eventName = &eventNames().touchstartEvent;
         RefPtr<TouchEvent> startEv =
             TouchEvent::create(touches.get(), targetTouches.get(), pressedTouches.get(),
diff --git a/WebCore/page/EventHandler.h b/WebCore/page/EventHandler.h
index a268adb..282100d 100644
--- a/WebCore/page/EventHandler.h
+++ b/WebCore/page/EventHandler.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +27,7 @@
 #define EventHandler_h
 
 #include "DragActions.h"
+#include "FocusDirection.h"
 #include "PlatformMouseEvent.h"
 #include "ScrollTypes.h"
 #include "Timer.h"
@@ -49,6 +50,7 @@
 class Event;
 class EventTarget;
 class FloatPoint;
+class FloatQuad;
 class Frame;
 class HitTestRequest;
 class HitTestResult;
@@ -67,6 +69,7 @@
 class SVGElementInstance;
 class TextEvent;
 class TouchEvent;
+class WheelEvent;
 class Widget;
     
 #if ENABLE(DRAG_SUPPORT)
@@ -100,6 +103,8 @@
     RenderObject* autoscrollRenderer() const;
     void updateAutoscrollRenderer();
 
+    void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
+
     HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars);
 
     bool mousePressed() const { return m_mousePressed; }
@@ -146,6 +151,7 @@
     bool handleMouseMoveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = 0);
     bool handleMouseReleaseEvent(const PlatformMouseEvent&);
     bool handleWheelEvent(PlatformWheelEvent&);
+    void defaultWheelEventHandler(Node*, WheelEvent*);
 
 #if ENABLE(CONTEXT_MENUS)
     bool sendContextMenuEvent(const PlatformMouseEvent&);
@@ -263,6 +269,9 @@
     void setAutoscrollRenderer(RenderObject*);
     void autoscrollTimerFired(Timer<EventHandler>*);
 
+    void fakeMouseMoveEventTimerFired(Timer<EventHandler>*);
+    void cancelFakeMouseMoveEvent();
+
     void invalidateClick();
 
     Node* nodeUnderMouse() const;
@@ -306,6 +315,7 @@
 
     void defaultSpaceEventHandler(KeyboardEvent*);
     void defaultTabEventHandler(KeyboardEvent*);
+    void defaultArrowEventHandler(FocusDirection, KeyboardEvent*);
 
 #if ENABLE(DRAG_SUPPORT)
     void allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const;
@@ -328,6 +338,8 @@
     
     void setFrameWasScrolledByUser();
 
+    FocusDirection focusDirectionForKey(const AtomicString&) const;
+
     bool capturesDragging() const { return m_capturesDragging; }
 
 #if PLATFORM(MAC) && defined(__OBJC__) && !ENABLE(EXPERIMENTAL_SINGLE_VIEW_MODE)
@@ -367,6 +379,8 @@
     bool m_mouseDownMayStartAutoscroll;
     bool m_mouseDownWasInSubframe;
 
+    Timer<EventHandler> m_fakeMouseMoveEventTimer;
+
 #if ENABLE(SVG)
     bool m_svgPan;
     RefPtr<SVGElementInstance> m_instanceUnderMouse;
diff --git a/WebCore/page/EventSource.cpp b/WebCore/page/EventSource.cpp
index 0c79998..9ccccd7 100644
--- a/WebCore/page/EventSource.cpp
+++ b/WebCore/page/EventSource.cpp
@@ -250,8 +250,10 @@
 void EventSource::parseEventStreamLine(unsigned int bufPos, int fieldLength, int lineLength)
 {
     if (!lineLength) {
-        if (!m_data.isEmpty())
+        if (!m_data.isEmpty()) {
+            m_data.removeLast();
             dispatchEvent(createMessageEvent());
+        }
         if (!m_eventName.isEmpty())
             m_eventName = "";
     } else if (fieldLength) {
@@ -269,10 +271,9 @@
         int valueLength = lineLength - step;
 
         if (field == "data") {
-            if (m_data.size() > 0)
-                m_data.append('\n');
             if (valueLength)
                 m_data.append(&m_receiveBuf[bufPos], valueLength);
+            m_data.append('\n');
         } else if (field == "event")
             m_eventName = valueLength ? String(&m_receiveBuf[bufPos], valueLength) : "";
         else if (field == "id")
diff --git a/WebCore/page/EventSource.idl b/WebCore/page/EventSource.idl
index ec42556..57bd807 100644
--- a/WebCore/page/EventSource.idl
+++ b/WebCore/page/EventSource.idl
@@ -53,12 +53,12 @@
         void close();
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type,
-                                      in EventListener listener,
-                                      in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type,
+        [JSCCustom] void addEventListener(in DOMString type,
                                           in EventListener listener,
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type,
+                                             in EventListener listener,
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index bdd3151..e07e2ea 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -49,18 +49,26 @@
 #include "RenderWidget.h"
 #include "SelectionController.h"
 #include "Settings.h"
+#include "SpatialNavigation.h"
 #include "Widget.h"
-#include <wtf/Platform.h>
 
 namespace WebCore {
 
 using namespace HTMLNames;
+using namespace std;
 
 static inline void dispatchEventsOnWindowAndFocusedNode(Document* document, bool focused)
 {
     // If we have a focused node we should dispatch blur on it before we blur the window.
     // If we have a focused node we should dispatch focus on it after we focus the window.
     // https://bugs.webkit.org/show_bug.cgi?id=27105
+
+    // Do not fire events while modal dialogs are up.  See https://bugs.webkit.org/show_bug.cgi?id=33962
+    if (Page* page = document->page()) {
+        if (page->defersLoading())
+            return;
+    }
+
     if (!focused && document->focusedNode())
         document->focusedNode()->dispatchBlurEvent();
     document->dispatchWindowEvent(Event::create(focused ? eventNames().focusEvent : eventNames().blurEvent, false, false));
@@ -153,6 +161,24 @@
 
 bool FocusController::advanceFocus(FocusDirection direction, KeyboardEvent* event, bool initialFocus)
 {
+    switch (direction) {
+    case FocusDirectionForward:
+    case FocusDirectionBackward:
+        return advanceFocusInDocumentOrder(direction, event, initialFocus);
+    case FocusDirectionLeft:
+    case FocusDirectionRight:
+    case FocusDirectionUp:
+    case FocusDirectionDown:
+        return advanceFocusDirectionally(direction, event);
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    return false;
+}
+
+bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, KeyboardEvent* event, bool initialFocus)
+{
     Frame* frame = focusedOrMainFrame();
     ASSERT(frame);
     Document* document = frame->document();
@@ -257,6 +283,175 @@
     return true;
 }
 
+bool FocusController::advanceFocusDirectionally(FocusDirection direction, KeyboardEvent* event)
+{
+    Frame* frame = focusedOrMainFrame();
+    ASSERT(frame);
+    Document* focusedDocument = frame->document();
+    if (!focusedDocument)
+        return false;
+
+    Node* focusedNode = focusedDocument->focusedNode();
+    if (!focusedNode) {
+        // Just move to the first focusable node.
+        FocusDirection tabDirection = (direction == FocusDirectionUp || direction == FocusDirectionLeft) ?
+                                       FocusDirectionForward : FocusDirectionBackward;
+        // 'initialFocus' is set to true so the chrome is not focused.
+        return advanceFocusInDocumentOrder(tabDirection, event, true);
+    }
+
+    // Move up in the chain of nested frames.
+    frame = frame->tree()->top();
+
+    FocusCandidate focusCandidate;
+    findFocusableNodeInDirection(frame->document(), focusedNode, direction, event, focusCandidate);
+
+    Node* node = focusCandidate.node;
+    if (!node || !node->isElementNode()) {
+        // FIXME: May need a way to focus a document here.
+        Frame* frame = focusedOrMainFrame();
+        scrollInDirection(frame, direction);
+        return false;
+    }
+
+    // In order to avoid crazy jump between links that are either far away from each other,
+    // or just not currently visible, lets do a scroll in the given direction and bail out
+    // if |node| element is not in the viewport.
+    if (hasOffscreenRect(node)) {
+        Frame* frame = node->document()->view()->frame();
+        scrollInDirection(frame, direction);
+        return true;
+    }
+
+    Document* newDocument = node->document();
+
+    if (newDocument != focusedDocument) {
+        // Focus is going away from the originally focused document, so clear the focused node.
+        focusedDocument->setFocusedNode(0);
+    }
+
+    if (newDocument)
+        setFocusedFrame(newDocument->frame());
+
+    Element* element = static_cast<Element*>(node);
+    ASSERT(element);
+
+    scrollIntoView(element);
+    element->focus(false);
+    return true;
+}
+
+// FIXME: Make this method more modular, and simpler to understand and maintain.
+static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest)
+{
+    bool sameDocument = candidate.document() == closest.document();
+    if (sameDocument) {
+        if (closest.alignment > candidate.alignment
+         || (closest.parentAlignment && candidate.alignment > closest.parentAlignment))
+            return;
+    } else if (closest.alignment > candidate.alignment
+            && (closest.parentAlignment && candidate.alignment > closest.parentAlignment))
+        return;
+
+    if (candidate.alignment != None
+     || (closest.parentAlignment >= candidate.alignment
+     && closest.document() == candidate.document())) {
+
+        // If we are now in an higher precedent case, lets reset the current closest's
+        // distance so we force it to be bigger than any result we will get from
+        // spatialDistance().
+        if (closest.alignment < candidate.alignment
+         && closest.parentAlignment < candidate.alignment)
+            closest.distance = maxDistance();
+    }
+
+    // Bail out if candidate's distance is larger than that of the closest candidate.
+    if (candidate.distance >= closest.distance)
+        return;
+
+    if (closest.isNull()) {
+        closest = candidate;
+        return;
+    }
+
+    // If the focused node and the candadate are in the same document and current
+    // closest candidate is not in an {i}frame that is preferable to get focused ...
+    if (focusedNode->document() == candidate.document()
+        && candidate.distance < closest.parentDistance)
+        closest = candidate;
+    else if (focusedNode->document() != candidate.document()) {
+        // If the focusedNode is in an inner document and candidate is in a
+        // different document, we only consider to change focus if there is not
+        // another already good focusable candidate in the same document as focusedNode.
+        if (!((isInRootDocument(candidate.node) && !isInRootDocument(focusedNode))
+            && focusedNode->document() == closest.document()))
+            closest = candidate;
+    }
+}
+
+void FocusController::findFocusableNodeInDirection(Document* document, Node* focusedNode,
+                                                   FocusDirection direction, KeyboardEvent* event,
+                                                   FocusCandidate& closestFocusCandidate,
+                                                   const FocusCandidate& candidateParent)
+{
+    ASSERT(document);
+    ASSERT(candidateParent.isNull() || static_cast<HTMLFrameOwnerElement*>(candidateParent.node));
+
+    // Walk all the child nodes and update closestFocusCandidate if we find a nearer node.
+    for (Node* candidate = document->firstChild(); candidate; candidate = candidate->traverseNextNode()) {
+        // Inner documents case.
+
+        if (candidate->isFrameOwnerElement())
+            deepFindFocusableNodeInDirection(focusedNode, candidate, direction, event, closestFocusCandidate);
+        else if (candidate != focusedNode && candidate->isKeyboardFocusable(event)) {
+            FocusCandidate currentFocusCandidate(candidate);
+
+            // Get distance and alignment from current candidate.
+            distanceDataForNode(direction, focusedNode, currentFocusCandidate);
+
+            // Bail out if distance is maximum.
+            if (currentFocusCandidate.distance == maxDistance())
+                continue;
+
+            // If candidateParent is not null, it means that we are in a recursive call
+            // from deepFineFocusableNodeInDirection (i.e. processing an element in an iframe),
+            // and holds the distance and alignment data of the iframe element itself.
+            if (!candidateParent.isNull()) {
+                currentFocusCandidate.parentAlignment = candidateParent.alignment;
+                currentFocusCandidate.parentDistance = candidateParent.distance;
+            }
+
+            updateFocusCandidateIfCloser(focusedNode, currentFocusCandidate, closestFocusCandidate);
+        }
+    }
+}
+
+void FocusController::deepFindFocusableNodeInDirection(Node* focusedNode, Node* candidate,
+                                                       FocusDirection direction, KeyboardEvent* event,
+                                                       FocusCandidate& closestFocusCandidate)
+{
+    HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(candidate);
+    if (!owner->contentFrame())
+        return;
+
+    Document* innerDocument = owner->contentFrame()->document();
+    if (!innerDocument)
+        return;
+
+    if (innerDocument == focusedNode->document())
+        findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, closestFocusCandidate);
+    else {
+        // Check if the current {i}frame element itself is a good candidate
+        // to move focus to. If it is, then we traverse its inner nodes.
+        FocusCandidate candidateParent = FocusCandidate(candidate);
+        distanceDataForNode(direction, focusedNode, candidateParent);
+
+        // FIXME: Consider alignment?
+        if (candidateParent.distance < closestFocusCandidate.distance)
+            findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, closestFocusCandidate, candidateParent);
+    }
+}
+
 static bool relinquishesEditingFocus(Node *node)
 {
     ASSERT(node);
diff --git a/WebCore/page/FocusController.h b/WebCore/page/FocusController.h
index 32d4060..dfa3780 100644
--- a/WebCore/page/FocusController.h
+++ b/WebCore/page/FocusController.h
@@ -27,12 +27,14 @@
 #define FocusController_h
 
 #include "FocusDirection.h"
+#include "SpatialNavigation.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
+class Document;
 class Frame;
 class KeyboardEvent;
 class Node;
@@ -58,6 +60,13 @@
     bool isFocused() const { return m_isFocused; }
 
 private:
+    bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
+    bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus);
+
+    void findFocusableNodeInDirection(Document*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate& closestFocusCandidate,
+                                      const FocusCandidate& parentCandidate = FocusCandidate());
+    void deepFindFocusableNodeInDirection(Node*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate&);
+
     Page* m_page;
     RefPtr<Frame> m_focusedFrame;
     bool m_isActive;
diff --git a/WebCore/page/FocusDirection.h b/WebCore/page/FocusDirection.h
index 261c745..8a6d51f 100644
--- a/WebCore/page/FocusDirection.h
+++ b/WebCore/page/FocusDirection.h
@@ -28,8 +28,13 @@
 
 namespace WebCore {
     enum FocusDirection {
-        FocusDirectionForward = 0,
-        FocusDirectionBackward
+        FocusDirectionNone = 0,
+        FocusDirectionForward,
+        FocusDirectionBackward,
+        FocusDirectionUp,
+        FocusDirectionDown,
+        FocusDirectionLeft,
+        FocusDirectionRight
     };
 }
 
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 87c9733..a8d58fd 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -49,6 +49,7 @@
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
+#include "GraphicsLayer.h"
 #include "HTMLDocument.h"
 #include "HTMLFormControlElement.h"
 #include "HTMLFormElement.h"
@@ -84,8 +85,8 @@
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StdLibExtras.h>
 
-#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-#import <Carbon/Carbon.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include "RenderLayerCompositor.h"
 #endif
 
 #if USE(JSC)
@@ -112,6 +113,10 @@
 #include "MathMLNames.h"
 #endif
 
+#if ENABLE(TILED_BACKING_STORE)
+#include "TiledBackingStore.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -136,7 +141,6 @@
     , m_redirectScheduler(this)
     , m_ownerElement(ownerElement)
     , m_script(this)
-    , m_selectionGranularity(CharacterGranularity)
     , m_selectionController(this)
     , m_editor(this)
     , m_eventHandler(this)
@@ -175,9 +179,13 @@
     XMLNSNames::init();
     XMLNames::init();
 
-    if (!ownerElement)
+    if (!ownerElement) {
         page->setMainFrame(this);
-    else {
+#if ENABLE(TILED_BACKING_STORE)
+        // Top level frame only for now.
+        setTiledBackingStoreEnabled(page->settings()->tiledBackingStoreEnabled());
+#endif
+    } else {
         page->incrementFrameCount();
         // Make sure we will not end up with two frames referencing the same owner element.
         ASSERT((!(ownerElement->m_contentFrame)) || (ownerElement->m_contentFrame->ownerElement() != ownerElement));
@@ -265,6 +273,11 @@
     // Since this part may be getting reused as a result of being
     // pulled from the back/forward cache, reset this flag.
     loader()->resetMultipleFormSubmissionProtection();
+    
+#if ENABLE(TILED_BACKING_STORE)
+    if (m_view && tiledBackingStore())
+        m_view->setPaintsEntireContents(true);
+#endif
 }
 
 ScriptController* Frame::script()
@@ -285,8 +298,7 @@
     }
 
     m_doc = newDoc;
-    if (m_doc && selection()->isFocusedAndActive())
-        setUseSecureKeyboardEntry(m_doc->useSecureKeyboardEntryWhenActive());
+    selection()->updateSecureKeyboardEntryIfActive();
 
     if (m_doc && !m_doc->attached())
         m_doc->attach();
@@ -366,12 +378,7 @@
 
 TextGranularity Frame::selectionGranularity() const
 {
-    return m_selectionGranularity;
-}
-
-void Frame::setSelectionGranularity(TextGranularity granularity)
-{
-    m_selectionGranularity = granularity;
+    return m_selectionController.granularity();
 }
 
 SelectionController* Frame::dragCaretController() const
@@ -657,6 +664,11 @@
     ASSERT(dragCaretController->selection().isCaret());
     if (dragCaretController->selection().start().node()->document()->frame() == this)
         dragCaretController->paintCaret(p, tx, ty, clipRect);
+#else
+    UNUSED_PARAM(p);
+    UNUSED_PARAM(tx);
+    UNUSED_PARAM(ty);
+    UNUSED_PARAM(clipRect);
 #endif
 }
 
@@ -665,28 +677,24 @@
     return m_zoomFactor;
 }
 
-bool Frame::isZoomFactorTextOnly() const
+ZoomMode Frame::zoomMode() const
 {
-    return m_page->settings()->zoomsTextOnly();
+    return m_page->settings()->zoomMode();
 }
 
 bool Frame::shouldApplyTextZoom() const
 {
-    if (m_zoomFactor == 1.0f || !isZoomFactorTextOnly())
-        return false;
-    return true;
+    return m_zoomFactor != 1.0f && zoomMode() == ZoomTextOnly;
 }
 
 bool Frame::shouldApplyPageZoom() const
 {
-    if (m_zoomFactor == 1.0f || isZoomFactorTextOnly())
-        return false;
-    return true;
+    return m_zoomFactor != 1.0f && zoomMode() == ZoomPage;
 }
 
-void Frame::setZoomFactor(float percent, bool isTextOnly)
+void Frame::setZoomFactor(float percent, ZoomMode mode)
 {
-    if (m_zoomFactor == percent && isZoomFactorTextOnly() == isTextOnly)
+    if (m_zoomFactor == percent && zoomMode() == mode)
         return;
 
 #if ENABLE(SVG)
@@ -700,7 +708,7 @@
     }
 #endif
 
-    if (!isTextOnly) {
+    if (mode == ZoomPage) {
         // Update the scroll position when doing a full page zoom, so the content stays in relatively the same position.
         IntPoint scrollPosition = view()->scrollPosition();
         float percentDifference = (percent / m_zoomFactor);
@@ -708,12 +716,12 @@
     }
 
     m_zoomFactor = percent;
-    m_page->settings()->setZoomsTextOnly(isTextOnly);
+    m_page->settings()->setZoomMode(mode);
 
     m_doc->recalcStyle(Node::Force);
 
     for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
-        child->setZoomFactor(m_zoomFactor, isTextOnly);
+        child->setZoomFactor(m_zoomFactor, mode);
 
     if (m_doc->renderer() && m_doc->renderer()->needsLayout() && view()->didFirstLayout())
         view()->layout();
@@ -722,7 +730,8 @@
 void Frame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize)
 {
     m_doc->setPrinting(printing);
-    view()->setMediaType(printing ? "print" : "screen");
+    view()->adjustMediaTypeForPrinting(printing);
+
     m_doc->updateStyleSelector();
     view()->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize);
 
@@ -850,43 +859,6 @@
     return m_doc->inDesignMode();
 }
 
-#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-const short enableRomanKeyboardsOnly = -23;
-#endif
-void Frame::setUseSecureKeyboardEntry(bool enable)
-{
-#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-    if (enable == IsSecureEventInputEnabled())
-        return;
-    if (enable) {
-        EnableSecureEventInput();
-#ifdef BUILDING_ON_TIGER
-        KeyScript(enableRomanKeyboardsOnly);
-#else
-        // WebKit substitutes nil for input context when in password field, which corresponds to null TSMDocument. So, there is
-        // no need to call TSMGetActiveDocument(), which may return an incorrect result when selection hasn't been yet updated
-        // after focusing a node.
-        CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
-        TSMSetDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
-        CFRelease(inputSources);
-#endif
-    } else {
-        DisableSecureEventInput();
-#ifdef BUILDING_ON_TIGER
-        KeyScript(smKeyEnableKybds);
-#else
-        TSMRemoveDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag);
-#endif
-    }
-#endif
-}
-
-void Frame::updateSecureKeyboardEntryIfActive()
-{
-    if (selection()->isFocusedAndActive())
-        setUseSecureKeyboardEntry(m_doc->useSecureKeyboardEntryWhenActive());
-}
-
 CSSMutableStyleDeclaration *Frame::typingStyle() const
 {
     return m_typingStyle.get();
@@ -1423,7 +1395,7 @@
     // If we started in the selection and the found range exactly matches the existing selection, 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 (startInSelection && *VisibleSelection(resultRange.get()).toNormalizedRange() == *selection.toNormalizedRange()) {
+    if (startInSelection && areRangesEqual(VisibleSelection(resultRange.get()).toNormalizedRange().get(), selection.toNormalizedRange().get())) {
         searchRange = rangeOfContents(document());
         if (forward)
             setStart(searchRange.get(), selection.visibleEnd());
@@ -1818,7 +1790,8 @@
 void Frame::createView(const IntSize& viewportSize,
                        const Color& backgroundColor, bool transparent,
                        const IntSize& fixedLayoutSize, bool useFixedLayout,
-                       ScrollbarMode horizontalScrollbarMode, ScrollbarMode verticalScrollbarMode)
+                       ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
+                       ScrollbarMode verticalScrollbarMode, bool verticalLock)
 {
     ASSERT(this);
     ASSERT(m_page);
@@ -1838,7 +1811,7 @@
     } else
         frameView = FrameView::create(this);
 
-    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode);
+    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock);
 
     setView(frameView);
 
@@ -1855,4 +1828,67 @@
         view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
 }
 
+#if ENABLE(TILED_BACKING_STORE)
+void Frame::setTiledBackingStoreEnabled(bool enabled)
+{
+    if (!enabled) {
+        m_tiledBackingStore.clear();
+        return;
+    }
+    if (m_tiledBackingStore)
+        return;
+    m_tiledBackingStore.set(new TiledBackingStore(this));
+    if (m_view)
+        m_view->setPaintsEntireContents(true);
+}
+
+void Frame::tiledBackingStorePaintBegin()
+{
+    if (!m_view)
+        return;
+    m_view->layoutIfNeededRecursive();
+    m_view->flushDeferredRepaints();
+}
+
+void Frame::tiledBackingStorePaint(GraphicsContext* context, const IntRect& rect)
+{
+    if (!m_view)
+        return;
+    m_view->paintContents(context, rect);
+}
+
+void Frame::tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea)
+{
+    if (!m_page || !m_view)
+        return;
+    unsigned size = paintedArea.size();
+    // Request repaint from the system
+    for (int n = 0; n < size; ++n)
+        m_page->chrome()->invalidateContentsAndWindow(m_view->contentsToWindow(paintedArea[n]), false);
+}
+
+IntRect Frame::tiledBackingStoreContentsRect()
+{
+    if (!m_view)
+        return IntRect();
+    return IntRect(IntPoint(), m_view->contentsSize());
+}
+#endif
+
+String Frame::layerTreeAsText() const
+{
+#if USE(ACCELERATED_COMPOSITING)
+    if (!contentRenderer())
+        return String();
+
+    GraphicsLayer* rootLayer = contentRenderer()->compositor()->rootPlatformLayer();
+    if (!rootLayer)
+        return String();
+        
+    return rootLayer->layerTreeAsText();
+#else
+    return String();
+#endif
+}
+
 } // namespace WebCore
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index 26d1efa..4a7cdaf 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -38,11 +38,16 @@
 #include "ScrollBehavior.h"
 #include "SelectionController.h"
 #include "UserScriptTypes.h"
+#include "ZoomMode.h"
 
 #if PLATFORM(WIN)
 #include "FrameWin.h"
 #endif
 
+#if ENABLE(TILED_BACKING_STORE)
+#include "TiledBackingStoreClient.h"
+#endif
+
 #if PLATFORM(MAC)
 #ifndef __OBJC__
 class NSArray;
@@ -62,8 +67,14 @@
     class CSSMutableStyleDeclaration;
     class HTMLTableCellElement;
     class RegularExpression;
+    class RenderPart;
+    class TiledBackingStore;
 
-    class Frame : public RefCounted<Frame> {
+    class Frame : public RefCounted<Frame>
+#if ENABLE(TILED_BACKING_STORE)
+        , public TiledBackingStoreClient
+#endif
+    {
     public:
         static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
         {
@@ -108,9 +119,12 @@
         void setExcludeFromTextSearch(bool);
 
         void createView(const IntSize&, const Color&, bool, const IntSize &, bool,
-                        ScrollbarMode = ScrollbarAuto, ScrollbarMode = ScrollbarAuto);
+                        ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
+                        ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
 
         void injectUserScripts(UserScriptInjectionTime);
+        
+        String layerTreeAsText() const;
 
     private:
         void injectUserScriptsForWorld(DOMWrapperWorld*, const UserScriptVector&, UserScriptInjectionTime);
@@ -163,15 +177,20 @@
             return document() ? document()->displayStringModifiedByEncoding(str) : str;
         }
 
+#if ENABLE(TILED_BACKING_STORE)
+        TiledBackingStore* tiledBackingStore() const { return m_tiledBackingStore.get(); }
+        void setTiledBackingStoreEnabled(bool);
+#endif
+
     private:
         void lifeSupportTimerFired(Timer<Frame>*);
 
     // === to be moved into FrameView
 
     public:
-        void setZoomFactor(float scale, bool isTextOnly);
+        void setZoomFactor(float scale, ZoomMode);
         float zoomFactor() const;
-        bool isZoomFactorTextOnly() const;
+        ZoomMode zoomMode() const;
         bool shouldApplyTextZoom() const;
         bool shouldApplyPageZoom() const;
         float pageZoomFactor() const { return shouldApplyPageZoom() ? zoomFactor() : 1.0f; }
@@ -232,7 +251,6 @@
 
     public:
         TextGranularity selectionGranularity() const;
-        void setSelectionGranularity(TextGranularity);
 
         bool shouldChangeSelection(const VisibleSelection&) const;
         bool shouldDeleteSelection(const VisibleSelection&) const;
@@ -243,8 +261,6 @@
 
         bool isContentEditable() const; // if true, everything in frame is editable
 
-        void updateSecureKeyboardEntryIfActive();
-
         CSSMutableStyleDeclaration* typingStyle() const;
         void setTypingStyle(CSSMutableStyleDeclaration*);
         void clearTypingStyle();
@@ -258,8 +274,6 @@
         void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
         void setSelectionFromNone();
 
-        void setUseSecureKeyboardEntry(bool);
-
         SelectionController* dragCaretController() const;
 
         String searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell);
@@ -268,6 +282,15 @@
 
         VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
         Document* documentAtPoint(const IntPoint& windowPoint);
+        
+    private:
+#if ENABLE(TILED_BACKING_STORE)
+        // TiledBackingStoreClient interface
+        virtual void tiledBackingStorePaintBegin();
+        virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&);
+        virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
+        virtual IntRect tiledBackingStoreContentsRect();
+#endif
 
     #if PLATFORM(MAC)
 
@@ -325,8 +348,6 @@
 
         float m_zoomFactor;
 
-        TextGranularity m_selectionGranularity;
-
         mutable SelectionController m_selectionController;
         mutable VisibleSelection m_mark;
         mutable Editor m_editor;
@@ -346,6 +367,10 @@
         bool m_needsReapplyStyles;
         bool m_isDisconnected;
         bool m_excludeFromTextSearch;
+
+#if ENABLE(TILED_BACKING_STORE)        
+        OwnPtr<TiledBackingStore> m_tiledBackingStore;
+#endif
     };
 
 } // namespace WebCore
diff --git a/WebCore/page/FrameTree.cpp b/WebCore/page/FrameTree.cpp
index 41caa9c..d6170e1 100644
--- a/WebCore/page/FrameTree.cpp
+++ b/WebCore/page/FrameTree.cpp
@@ -25,7 +25,6 @@
 #include "Page.h"
 #include "PageGroup.h"
 #include <stdarg.h>
-#include <wtf/Platform.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Vector.h>
 
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 356ada2..f784c1b 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -75,10 +75,16 @@
 #include "SVGViewSpec.h"
 #endif
 
+<<<<<<< HEAD
 #if PLATFORM(ANDROID)
 #include "WebCoreFrameBridge.h"
 #endif
 
+=======
+#if ENABLE(TILED_BACKING_STORE)
+#include "TiledBackingStore.h"
+#endif
+>>>>>>> webkit.org at r58033
 
 namespace WebCore {
 
@@ -117,6 +123,7 @@
     : m_frame(frame)
     , m_canHaveScrollbars(true)
     , m_slowRepaintObjectCount(0)
+    , m_fixedObjectCount(0)
     , m_layoutTimer(this, &FrameView::layoutTimerFired)
     , m_layoutRoot(0)
     , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
@@ -301,7 +308,7 @@
 {
     if (!parent()) {
         if (hostWindow())
-            hostWindow()->repaint(rect, true);
+            hostWindow()->invalidateContentsAndWindow(rect, false /*immediate*/);
         return;
     }
 
@@ -330,6 +337,23 @@
     m_margins.setHeight(h);
 }
 
+bool FrameView::avoidScrollbarCreation()
+{
+    ASSERT(m_frame);
+
+    // with frame flattening no subframe can have scrollbars
+    // but we also cannot turn scrollbars of as we determine
+    // our flattening policy using that.
+
+    if (!m_frame->ownerElement())
+        return false;
+
+    if (!m_frame->settings() || m_frame->settings()->frameFlatteningEnabled())
+        return true;
+
+    return false;
+}
+
 void FrameView::setCanHaveScrollbars(bool canHaveScrollbars)
 {
     m_canHaveScrollbars = canHaveScrollbars;
@@ -385,7 +409,7 @@
         return;
 
     page->chrome()->contentsSizeChanged(frame(), size); //notify only
-    
+
     m_deferSetNeedsLayouts--;
     
     if (!m_deferSetNeedsLayouts)
@@ -398,6 +422,7 @@
     RenderView* root = m_frame->contentRenderer();
     if (!root)
         return;
+
     setContentsSize(IntSize(root->rightLayoutOverflow(), root->bottomLayoutOverflow()));
 }
 
@@ -628,7 +653,7 @@
         RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0;
         Node* body = document->body();
         if (body && body->renderer()) {
-            if (body->hasTagName(framesetTag) && !m_frame->settings()->frameSetFlatteningEnabled()) {
+            if (body->hasTagName(framesetTag) && !m_frame->settings()->frameFlatteningEnabled()) {
                 body->renderer()->setChildNeedsLayout(true);
                 vMode = ScrollbarAlwaysOff;
                 hMode = ScrollbarAlwaysOff;
@@ -665,8 +690,9 @@
         ScrollbarMode currentVMode = verticalScrollbarMode();
 
         if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode)) {
-            setScrollbarsSuppressed(true);
             if (m_firstLayout) {
+                setScrollbarsSuppressed(true);
+
                 m_firstLayout = false;
                 m_firstLayoutCallbackPending = true;
                 m_lastLayoutSize = IntSize(width(), height());
@@ -678,9 +704,11 @@
                 // Set the initial hMode to AlwaysOff if we're auto.
                 if (hMode == ScrollbarAuto)
                     setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear.
-            }
-            setScrollbarModes(hMode, vMode);
-            setScrollbarsSuppressed(false, true);
+
+                setScrollbarModes(hMode, vMode);
+                setScrollbarsSuppressed(false, true);
+            } else
+                setScrollbarModes(hMode, vMode);
         }
 
         IntSize oldSize = m_size;
@@ -728,10 +756,12 @@
 
     // Now update the positions of all layers.
     beginDeferredRepaints();
+    IntPoint cachedOffset;
     layer->updateLayerPositions((m_doFullRepaint ? RenderLayer::DoFullRepaint : 0)
                                 | RenderLayer::CheckForRepaint
                                 | RenderLayer::IsCompositingUpdateRoot
-                                | RenderLayer::UpdateCompositingLayers);
+                                | RenderLayer::UpdateCompositingLayers,
+                                subtree ? 0 : &cachedOffset);
     endDeferredRepaints();
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -815,14 +845,27 @@
     return m_mediaType;
 }
 
+void FrameView::adjustMediaTypeForPrinting(bool printing)
+{
+    if (printing) {
+        if (m_mediaTypeWhenNotPrinting.isNull())
+            m_mediaTypeWhenNotPrinting = mediaType();
+            setMediaType("print");
+    } else {
+        if (!m_mediaTypeWhenNotPrinting.isNull())
+            setMediaType(m_mediaTypeWhenNotPrinting);
+        m_mediaTypeWhenNotPrinting = String();
+    }
+}
+
 bool FrameView::useSlowRepaints() const
 {
-    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || m_isOverlapped || !m_contentIsOpaque;
+    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || m_isOverlapped || !m_contentIsOpaque;
 }
 
 bool FrameView::useSlowRepaintsIfNotOverlapped() const
 {
-    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || !m_contentIsOpaque;
+    return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || !m_contentIsOpaque;
 }
 
 void FrameView::setUseSlowRepaints()
@@ -846,6 +889,17 @@
         setCanBlitOnScroll(!useSlowRepaints());
 }
 
+void FrameView::addFixedObject()
+{
+    ++m_fixedObjectCount;
+}
+
+void FrameView::removeFixedObject()
+{
+    ASSERT(m_fixedObjectCount > 0);
+    --m_fixedObjectCount;
+}
+
 void FrameView::setIsOverlapped(bool isOverlapped)
 {
     if (isOverlapped == m_isOverlapped)
@@ -982,10 +1036,10 @@
 
     // For fixed position elements, update widget positions and compositing layers after scrolling,
     // but only if we're not inside of layout.
-    // FIXME: we could skip this if we knew the page had no fixed position elements.
-    if (!m_nestedLayoutCount) {
+    if (!m_nestedLayoutCount && hasFixedObjects()) {
         if (RenderView* root = m_frame->contentRenderer()) {
             root->updateWidgetPositions();
+            root->layer()->updateRepaintRectsAfterScroll();
 #if USE(ACCELERATED_COMPOSITING)
             if (root->usesCompositing())
                 root->compositor()->updateCompositingLayers(CompositingUpdateOnScroll);
@@ -1040,6 +1094,12 @@
     if (!immediate && isOffscreen() && !shouldUpdateWhileOffscreen())
         return;
 
+#if ENABLE(TILED_BACKING_STORE)
+    if (frame()->tiledBackingStore()) {
+        frame()->tiledBackingStore()->invalidate(r);
+        return;
+    }
+#endif
     ScrollView::repaintContentRectangle(r, immediate);
 }
 
@@ -1111,8 +1171,15 @@
         return;
     }
     unsigned size = m_repaintRects.size();
-    for (unsigned i = 0; i < size; i++)
+    for (unsigned i = 0; i < size; i++) {
+#if ENABLE(TILED_BACKING_STORE)
+        if (frame()->tiledBackingStore()) {
+            frame()->tiledBackingStore()->invalidate(m_repaintRects[i]);
+            continue;
+        }
+#endif
         ScrollView::repaintContentRectangle(m_repaintRects[i], false);
+    }
     m_repaintRects.clear();
     m_repaintCount = 0;
     
@@ -1182,6 +1249,7 @@
     if (!m_frame->document()->shouldScheduleLayout())
         return;
 
+<<<<<<< HEAD
 #if defined(FLATTEN_IFRAME) || defined(FLATTEN_FRAMESET)
     // This is the Android frame flattening code. The common code below is not
     // used as frameSetFlatteningEnabled() is false on Android.
@@ -1190,9 +1258,14 @@
 #endif
 
     // When frameset flattening is enabled, the contents of the frame affects layout of the parent frames.
+=======
+    // When frame flattening is enabled, the contents of the frame affects layout of the parent frames.
+>>>>>>> webkit.org at r58033
     // Also invalidate parent frame starting from the owner element of this frame.
-    if (m_frame->settings()->frameSetFlatteningEnabled() && m_frame->ownerRenderer())
-        m_frame->ownerRenderer()->setNeedsLayout(true, true);
+    if (m_frame->settings()->frameFlatteningEnabled() && m_frame->ownerRenderer()) {
+        if (m_frame->ownerElement()->hasTagName(iframeTag) || m_frame->ownerElement()->hasTagName(frameTag))
+            m_frame->ownerRenderer()->setNeedsLayout(true, true);
+    }
 
     int delay = m_frame->document()->minimumLayoutDelay();
     if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
@@ -1403,20 +1476,30 @@
     if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEmpty())
         return true;
     
-    Vector<RenderEmbeddedObject*> objectVector;
-    copyToVector(*m_widgetUpdateSet, objectVector);
-    size_t size = objectVector.size();
-    for (size_t i = 0; i < size; ++i) {
-        RenderEmbeddedObject* object = objectVector[i];
-        object->updateWidget(false);
-        
-        // updateWidget() can destroy the RenderPartObject, so we need to make sure it's
-        // alive by checking if it's still in m_widgetUpdateSet.
-        if (m_widgetUpdateSet->contains(object)) {
-            object->updateWidgetPosition();
-            m_widgetUpdateSet->remove(object);
-        }
+    size_t size = m_widgetUpdateSet->size();
+
+    Vector<RenderEmbeddedObject*> objects;
+    objects.reserveCapacity(size);
+
+    RenderEmbeddedObjectSet::const_iterator end = m_widgetUpdateSet->end();
+    for (RenderEmbeddedObjectSet::const_iterator it = m_widgetUpdateSet->begin(); it != end; ++it) {
+        objects.uncheckedAppend(*it);
+        (*it)->ref();
     }
+
+    for (size_t i = 0; i < size; ++i) {
+        RenderEmbeddedObject* object = objects[i];
+
+        // The object may have been destroyed, but our manual ref() keeps the object from being deleted.
+        object->updateWidget(false);
+        object->updateWidgetPosition();
+
+        m_widgetUpdateSet->remove(object);
+    }
+
+    RenderArena* arena = m_frame->document()->renderArena();
+    for (size_t i = 0; i < size; ++i)
+        objects[i]->deref(arena);
     
     return m_widgetUpdateSet->isEmpty();
 }
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 1d5a312..cbd0cb9 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -77,6 +77,8 @@
 
     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
 
+    virtual bool avoidScrollbarCreation();
+
     virtual void setContentsSize(const IntSize&);
 
     void layout(bool allowSubtree = true);
@@ -141,6 +143,7 @@
 
     String mediaType() const;
     void setMediaType(const String&);
+    void adjustMediaTypeForPrinting(bool printing);
 
     void setUseSlowRepaints();
     void setIsOverlapped(bool);
@@ -149,6 +152,9 @@
     void addSlowRepaintObject();
     void removeSlowRepaintObject();
 
+    void addFixedObject();
+    void removeFixedObject();
+
     void beginDeferredRepaints();
     void endDeferredRepaints();
     void checkStopDelayingDeferredRepaints();
@@ -215,6 +221,8 @@
     bool useSlowRepaints() const;
     bool useSlowRepaintsIfNotOverlapped() const;
 
+    bool hasFixedObjects() const { return m_fixedObjectCount > 0; }
+
     void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
 
     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
@@ -272,6 +280,7 @@
     bool m_isOverlapped;
     bool m_contentIsOpaque;
     unsigned m_slowRepaintObjectCount;
+    unsigned m_fixedObjectCount;
 
     int m_borderX, m_borderY;
 
@@ -293,7 +302,8 @@
     float m_lastZoomFactor;
 
     String m_mediaType;
-    
+    String m_mediaTypeWhenNotPrinting;
+
     unsigned m_enqueueEvents;
     Vector<ScheduledEvent*> m_scheduledEvents;
     
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index a885062..55fdef5 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -28,7 +28,10 @@
 #include "config.h"
 #include "Geolocation.h"
 
+#if ENABLE(GEOLOCATION)
+
 #include "Chrome.h"
+<<<<<<< HEAD
 // ANDROID
 #include "DOMWindow.h"
 // END ANDROID
@@ -41,6 +44,10 @@
 #if PLATFORM(ANDROID)
 #include "PlatformBridge.h"
 #endif
+=======
+#include "Frame.h"
+#include "Page.h"
+>>>>>>> webkit.org at r58033
 #include <wtf/CurrentTime.h>
 
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
@@ -217,7 +224,10 @@
     , m_service(GeolocationService::create(this))
 #endif
     , m_allowGeolocation(Unknown)
+<<<<<<< HEAD
     , m_shouldClearCache(false)
+=======
+>>>>>>> webkit.org at r58033
     , m_positionCache(new GeolocationPositionCache)
 {
     if (!m_frame)
@@ -241,6 +251,8 @@
 
 void Geolocation::disconnectFrame()
 {
+    if (m_frame && m_frame->page() && m_allowGeolocation == InProgress)
+        m_frame->page()->chrome()->cancelGeolocationPermissionRequestForFrame(m_frame, this);
     stopUpdating();
     if (m_frame) {
         if (m_frame->document())
@@ -253,6 +265,8 @@
 
 Geoposition* Geolocation::lastPosition()
 {
+    ASSERT(isAllowed());
+
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     if (!m_frame)
         return 0;
@@ -323,6 +337,7 @@
 }
 
 void Geolocation::requestUsesCachedPosition(GeoNotifier* notifier)
+<<<<<<< HEAD
 {
     // This is called asynchronously, so the permissions could have been denied
     // since we last checked in startRequest.
@@ -372,6 +387,73 @@
 }
 
 void Geolocation::requestTimedOut(GeoNotifier* notifier)
+=======
+>>>>>>> webkit.org at r58033
+{
+    // This is called asynchronously, so the permissions could have been denied
+    // since we last checked in startRequest.
+    if (isDenied()) {
+        notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
+        return;
+    }
+
+    m_requestsAwaitingCachedPosition.add(notifier);
+
+    // If permissions are allowed, make the callback
+    if (isAllowed()) {
+        makeCachedPositionCallbacks();
+        return;
+    }
+
+    // Request permissions, which may be synchronous or asynchronous.
+    requestPermission();
+}
+
+void Geolocation::makeCachedPositionCallbacks()
+{
+    // All modifications to m_requestsAwaitingCachedPosition are done
+    // asynchronously, so we don't need to worry about it being modified from
+    // the callbacks.
+    GeoNotifierSet::const_iterator end = m_requestsAwaitingCachedPosition.end();
+    for (GeoNotifierSet::const_iterator iter = m_requestsAwaitingCachedPosition.begin(); iter != end; ++iter) {
+        GeoNotifier* notifier = iter->get();
+        notifier->runSuccessCallback(m_positionCache->cachedPosition());
+
+        // If this is a one-shot request, stop it. Otherwise, if the watch still
+        // exists, start the service to get updates.
+        if (m_oneShots.contains(notifier))
+            m_oneShots.remove(notifier);
+        else if (m_watchers.contains(notifier)) {
+            if (notifier->hasZeroTimeout() || startUpdating(notifier))
+                notifier->startTimerIfNeeded();
+            else
+                notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
+        }
+    }
+
+    m_requestsAwaitingCachedPosition.clear();
+
+    if (!hasListeners())
+        stopUpdating();
+}
+
+<<<<<<< HEAD
+bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
+{
+    if (!m_positionCache->cachedPosition())
+        return false;
+    if (!options->hasMaximumAge())
+        return true;
+    if (!options->maximumAge())
+        return false;
+    DOMTimeStamp currentTimeMillis = currentTime() * 1000.0;
+    return m_positionCache->cachedPosition()->timestamp() > currentTimeMillis - options->maximumAge();
+}
+
+void Geolocation::clearWatch(int watchId)
+=======
+void Geolocation::requestTimedOut(GeoNotifier* notifier)
+>>>>>>> webkit.org at r58033
 {
     // If this is a one-shot request, stop it.
     m_oneShots.remove(notifier);
@@ -400,22 +482,6 @@
         stopUpdating();
 }
 
-void Geolocation::suspend()
-{
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
-    if (hasListeners())
-        m_service->suspend();
-#endif
-}
-
-void Geolocation::resume()
-{
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
-    if (hasListeners())
-        m_service->resume();
-#endif
-}
-
 void Geolocation::setIsAllowed(bool allowed)
 {
     // This may be due to either a new position from the service, or a cached
@@ -557,7 +623,7 @@
 
 void Geolocation::positionChanged(PassRefPtr<Geoposition> newPosition)
 {
-    m_currentPosition = newPosition;
+    m_positionCache->setCachedPosition(newPosition.get());
 
     m_positionCache->setCachedPosition(m_currentPosition.get());
 
@@ -578,7 +644,7 @@
 
 void Geolocation::makeSuccessCallbacks()
 {
-    ASSERT(m_currentPosition);
+    ASSERT(lastPosition());
     ASSERT(isAllowed());
     
     Vector<RefPtr<GeoNotifier> > oneShotsCopy;
@@ -592,8 +658,8 @@
     // further callbacks to these notifiers.
     m_oneShots.clear();
 
-    sendPosition(oneShotsCopy, m_currentPosition.get());
-    sendPosition(watchersCopy, m_currentPosition.get());
+    sendPosition(oneShotsCopy, lastPosition());
+    sendPosition(watchersCopy, lastPosition());
 
     if (!hasListeners())
         stopUpdating();
@@ -709,3 +775,19 @@
 // END ANDROID
 
 } // namespace WebCore
+
+#else
+
+namespace WebCore {
+
+void Geolocation::disconnectFrame() {}
+
+Geolocation::Geolocation(Frame*) {}
+
+Geolocation::~Geolocation() {}
+
+void Geolocation::setIsAllowed(bool) {}
+
+}
+                                                        
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index 358e4a3..30db435 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -27,9 +27,12 @@
 #ifndef Geolocation_h
 #define Geolocation_h
 
+<<<<<<< HEAD
 // ANDROID
 #include "EventListener.h"
 // END ANDROID
+=======
+>>>>>>> webkit.org at r58033
 #include "GeolocationPositionCache.h"
 #include "GeolocationService.h"
 #include "Geoposition.h"
@@ -38,14 +41,6 @@
 #include "PositionErrorCallback.h"
 #include "PositionOptions.h"
 #include "Timer.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/Platform.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
 
 namespace WebCore {
 
@@ -56,35 +51,30 @@
 class GeolocationError;
 #endif
 
+<<<<<<< HEAD
 // ANDROID
 class Geolocation : public EventListener
 // END ANDROID
 #if !ENABLE(CLIENT_BASED_GEOLOCATION)
+=======
+class Geolocation : public RefCounted<Geolocation>
+#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
+>>>>>>> webkit.org at r58033
     , public GeolocationServiceClient
 #endif
 {
 public:
     static PassRefPtr<Geolocation> create(Frame* frame) { return adoptRef(new Geolocation(frame)); }
 
-    virtual ~Geolocation();
+    ~Geolocation();
 
     void disconnectFrame();
     
-    Geoposition* lastPosition();
-
     void getCurrentPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
     int watchPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
     void clearWatch(int watchId);
 
-    void suspend();
-    void resume();
-
     void setIsAllowed(bool);
-    bool isAllowed() const { return m_allowGeolocation == Yes; }
-    bool isDenied() const { return m_allowGeolocation == No; }
-    
-    void setShouldClearCache(bool shouldClearCache) { m_shouldClearCache = shouldClearCache; }
-    bool shouldClearCache() const { return m_shouldClearCache; }
     Frame* frame() const { return m_frame; }
 
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
@@ -95,6 +85,11 @@
 #endif
 
 private:
+    Geoposition* lastPosition();
+
+    bool isAllowed() const { return m_allowGeolocation == Yes; }
+    bool isDenied() const { return m_allowGeolocation == No; }
+    
     Geolocation(Frame*);
 
     class GeoNotifier : public RefCounted<GeoNotifier> {
@@ -155,7 +150,7 @@
     bool startUpdating(GeoNotifier*);
     void stopUpdating();
 
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
     // GeolocationServiceClient
     virtual void geolocationServicePositionChanged(GeolocationService*);
     virtual void geolocationServiceErrorOccurred(GeolocationService*);
@@ -186,7 +181,6 @@
     RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
 #endif
     RefPtr<Geoposition> m_lastPosition;
-    RefPtr<Geoposition> m_currentPosition;
 
     enum {
         Unknown,
@@ -194,9 +188,16 @@
         Yes,
         No
     } m_allowGeolocation;
+<<<<<<< HEAD
     bool m_shouldClearCache;
 
     OwnPtr<GeolocationPositionCache> m_positionCache;
+=======
+
+#if ENABLE(GEOLOCATION)
+    OwnPtr<GeolocationPositionCache> m_positionCache;
+#endif
+>>>>>>> webkit.org at r58033
     GeoNotifierSet m_requestsAwaitingCachedPosition;
 };
     
diff --git a/WebCore/page/Geolocation.idl b/WebCore/page/Geolocation.idl
index 76056a3..aa5b59f 100644
--- a/WebCore/page/Geolocation.idl
+++ b/WebCore/page/Geolocation.idl
@@ -25,9 +25,7 @@
 
 module core {
 
-    interface [OmitConstructor] Geolocation {
-        readonly attribute Geoposition lastPosition;
-
+    interface [Conditional=GEOLOCATION, OmitConstructor] Geolocation {
         [Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
 
         [Custom] long watchPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
diff --git a/WebCore/page/GeolocationPositionCache.cpp b/WebCore/page/GeolocationPositionCache.cpp
index 5796191..76d2b0b 100644
--- a/WebCore/page/GeolocationPositionCache.cpp
+++ b/WebCore/page/GeolocationPositionCache.cpp
@@ -26,6 +26,11 @@
 #include "config.h"
 #include "GeolocationPositionCache.h"
 
+<<<<<<< HEAD
+=======
+#if ENABLE(GEOLOCATION)
+
+>>>>>>> webkit.org at r58033
 #include "Geoposition.h"
 #include "SQLValue.h"
 #include "SQLiteDatabase.h"
@@ -33,7 +38,10 @@
 #include "SQLiteStatement.h"
 #include "SQLiteTransaction.h"
 
+<<<<<<< HEAD
 
+=======
+>>>>>>> webkit.org at r58033
 namespace WebCore {
 
 static const char* databaseName = "CachedGeoposition.db";
@@ -173,3 +181,8 @@
 }
 
 } // namespace WebCore
+<<<<<<< HEAD
+=======
+
+#endif // ENABLE(GEOLOCATION)
+>>>>>>> webkit.org at r58033
diff --git a/WebCore/page/Geoposition.idl b/WebCore/page/Geoposition.idl
index 6fa12ff..41a2262 100644
--- a/WebCore/page/Geoposition.idl
+++ b/WebCore/page/Geoposition.idl
@@ -25,7 +25,7 @@
 
 module core {
 
-    interface [OmitConstructor] Geoposition {
+    interface [Conditional=GEOLOCATION, OmitConstructor] Geoposition {
         readonly attribute Coordinates coords;
         readonly attribute DOMTimeStamp timestamp;
     };
diff --git a/WebCore/page/History.idl b/WebCore/page/History.idl
index 3fc2771..d1be5ae 100644
--- a/WebCore/page/History.idl
+++ b/WebCore/page/History.idl
@@ -41,9 +41,9 @@
         [DoNotCheckDomainSecurity] void forward();
         [DoNotCheckDomainSecurity] void go(in long distance);
         
-        [Custom] void pushState(in any data, in DOMString title, in optional DOMString url)
+        [Custom, EnabledAtRuntime] void pushState(in any data, in DOMString title, in optional DOMString url)
             raises(DOMException);
-        [Custom] void replaceState(in any data, in DOMString title, in optional DOMString url)
+        [Custom, EnabledAtRuntime] void replaceState(in any data, in DOMString title, in optional DOMString url)
             raises(DOMException);
     };
 
diff --git a/WebCore/page/Location.cpp b/WebCore/page/Location.cpp
index 5adc48d..5754357 100644
--- a/WebCore/page/Location.cpp
+++ b/WebCore/page/Location.cpp
@@ -82,7 +82,7 @@
     // Note: this is the IE spec. The NS spec swaps the two, it says
     // "The hostname property is the concatenation of the host and port properties, separated by a colon."
     const KURL& url = this->url();
-    return url.port() ? url.host() + ":" + String::number((static_cast<int>(url.port()))) : url.host();
+    return url.port() ? url.host() + ":" + String::number(url.port()) : url.host();
 }
 
 String Location::hostname() const
@@ -99,7 +99,7 @@
         return String();
 
     const KURL& url = this->url();
-    return url.port() ? String::number(static_cast<int>(url.port())) : "";
+    return url.port() ? String::number(url.port()) : "";
 }
 
 String Location::pathname() const
diff --git a/WebCore/page/OriginAccessEntry.cpp b/WebCore/page/OriginAccessEntry.cpp
index 98c280c..7ff67cc 100644
--- a/WebCore/page/OriginAccessEntry.cpp
+++ b/WebCore/page/OriginAccessEntry.cpp
@@ -40,7 +40,6 @@
     , m_host(host.lower())
     , m_subdomainSettings(subdomainSetting)
 {
-    ASSERT(m_protocol == "http" || m_protocol == "https");
     ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSubdomains);
 
     // Assume that any host that ends with a digit is trying to be an IP address.
diff --git a/WebCore/page/OriginAccessEntry.h b/WebCore/page/OriginAccessEntry.h
index 767d75f..7c8d556 100644
--- a/WebCore/page/OriginAccessEntry.h
+++ b/WebCore/page/OriginAccessEntry.h
@@ -47,15 +47,28 @@
     // If host is empty string and SubdomainSetting is AllowSubdomains, the entry will match all domains in the specified protocol.
     OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting);
     bool matchesOrigin(const SecurityOrigin&) const;
-    
+
+    const String& protocol() const { return m_protocol; }
+    const String& host() const { return m_host; }
+    SubdomainSetting subdomainSettings() const { return m_subdomainSettings; }
+
 private:
     String m_protocol;
     String m_host;
     SubdomainSetting m_subdomainSettings;
     bool m_hostIsIPAddress;
-    
 };
 
+inline bool operator==(const OriginAccessEntry& a, const OriginAccessEntry& b)
+{
+    return equalIgnoringCase(a.protocol(), b.protocol()) && equalIgnoringCase(a.host(), b.host()) && a.subdomainSettings() == b.subdomainSettings();
+}
+
+inline bool operator!=(const OriginAccessEntry& a, const OriginAccessEntry& b)
+{
+    return !(a == b);
+}
+
 } // namespace WebCore
 
 #endif // CrossOriginAccess_h
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index d348d73..ee5c052 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -30,10 +30,10 @@
 #include "ContextMenuController.h"
 #include "DOMWindow.h"
 #include "DragController.h"
-#include "ExceptionCode.h"
 #include "EditorClient.h"
-#include "EventNames.h"
 #include "Event.h"
+#include "EventNames.h"
+#include "ExceptionCode.h"
 #include "FileSystem.h"
 #include "FocusController.h"
 #include "Frame.h"
@@ -52,12 +52,14 @@
 #include "PageGroup.h"
 #include "PluginData.h"
 #include "PluginHalter.h"
+#include "PluginView.h"
 #include "ProgressTracker.h"
-#include "RenderWidget.h"
 #include "RenderTheme.h"
+#include "RenderWidget.h"
 #include "ScriptController.h"
 #include "SelectionController.h"
 #include "Settings.h"
+#include "SharedBuffer.h"
 #include "StringHash.h"
 #include "TextResourceDecoder.h"
 #include "Widget.h"
@@ -70,8 +72,8 @@
 #include "StorageNamespace.h"
 #endif
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-#include "JavaScriptDebugServer.h"
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugServer.h"
 #endif
 
 #if ENABLE(WML)
@@ -151,9 +153,6 @@
     , m_areMemoryCacheClientCallsEnabled(true)
     , m_mediaVolume(1)
     , m_javaScriptURLsAreAllowed(true)
-#if ENABLE(INSPECTOR)
-    , m_parentInspectorController(0)
-#endif
     , m_didLoadUserStyleSheet(false)
     , m_userStyleSheetModificationTime(0)
     , m_group(0)
@@ -192,8 +191,8 @@
         m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime());
     }
 
-#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-    JavaScriptDebugServer::shared().pageCreated(this);
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    ScriptDebugServer::shared().pageCreated(this);
 #endif
 
 #ifndef NDEBUG
@@ -212,8 +211,6 @@
 
     m_editorClient->pageDestroyed();
 #if ENABLE(INSPECTOR)
-    if (m_parentInspectorController)
-        m_parentInspectorController->pageDestroyed();
     m_inspectorController->inspectedPageDestroyed();
 #endif
 
@@ -310,7 +307,7 @@
 {
     // Abort any current load unless we're navigating the current document to a new state object
     HistoryItem* currentItem = m_mainFrame->loader()->history()->currentItem();
-    if (!item->stateObject() || !currentItem || item->documentSequenceNumber() != currentItem->documentSequenceNumber()) {
+    if (!item->stateObject() || !currentItem || item->documentSequenceNumber() != currentItem->documentSequenceNumber() || item == currentItem) {
         // Define what to do with any open database connections. By default we stop them and terminate the database thread.
         DatabasePolicy databasePolicy = DatabasePolicyStop;
 
@@ -407,7 +404,7 @@
 
 PluginData* Page::pluginData() const
 {
-    if (!settings()->arePluginsEnabled())
+    if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return 0;
     if (!m_pluginData)
         m_pluginData = PluginData::create(this);
@@ -725,7 +722,7 @@
 StorageNamespace* Page::sessionStorage(bool optionalCreate)
 {
     if (!m_sessionStorage && optionalCreate)
-        m_sessionStorage = StorageNamespace::sessionStorageNamespace(this);
+        m_sessionStorage = StorageNamespace::sessionStorageNamespace(this, m_settings->sessionStorageQuota());
 
     return m_sessionStorage.get();
 }
@@ -793,6 +790,35 @@
 }
 #endif
 
+void Page::privateBrowsingStateChanged()
+{
+    bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();
+
+    // Collect the PluginViews in to a vector to ensure that action the plug-in takes
+    // from below privateBrowsingStateChanged does not affect their lifetime.
+
+    Vector<RefPtr<PluginView>, 32> pluginViews;
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        FrameView* view = frame->view();
+        if (!view)
+            return;
+
+        const HashSet<RefPtr<Widget> >* children = view->children();
+        ASSERT(children);
+
+        HashSet<RefPtr<Widget> >::const_iterator end = children->end();
+        for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) {
+            Widget* widget = (*it).get();
+            if (!widget->isPluginView())
+                continue;
+            pluginViews.append(static_cast<PluginView*>(widget));
+        }
+    }
+
+    for (size_t i = 0; i < pluginViews.size(); i++)
+        pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled);
+}
+
 void Page::pluginAllowedRunTimeChanged()
 {
     if (m_pluginHalter)
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index 04a545c..94e6dd5 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -31,10 +31,6 @@
 #include "SchedulePair.h"
 #endif
 
-#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN))
-typedef struct HINSTANCE__* HINSTANCE;
-#endif
-
 namespace JSC {
     class Debugger;
 }
@@ -153,11 +149,6 @@
 #endif
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }
-
-#if ENABLE(INSPECTOR)
-        void setParentInspectorController(InspectorController* controller) { m_parentInspectorController = controller; }
-        InspectorController* parentInspectorController() const { return m_parentInspectorController; }
-#endif
         
         void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
         bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
@@ -197,6 +188,8 @@
         void userStyleSheetLocationChanged();
         const String& userStyleSheet() const;
 
+        void privateBrowsingStateChanged();
+
         void didStartPlugin(HaltablePlugin*);
         void didStopPlugin(HaltablePlugin*);
         void pluginAllowedRunTimeChanged();
@@ -205,12 +198,6 @@
         void setDebugger(JSC::Debugger*);
         JSC::Debugger* debugger() const { return m_debugger; }
 
-#if PLATFORM(WIN) || (PLATFORM(WX) && OS(WINDOWS)) || (PLATFORM(QT) && defined(Q_WS_WIN))
-        // The global DLL or application instance used for all windows.
-        static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
-        static HINSTANCE instanceHandle() { return s_instanceHandle; }
-#endif
-
         static void removeAllVisitedLinks();
 
         static void allVisitedStateChanged(PageGroup*);
@@ -294,10 +281,6 @@
 
         bool m_javaScriptURLsAreAllowed;
 
-#if ENABLE(INSPECTOR)
-        InspectorController* m_parentInspectorController;
-#endif
-
         String m_userStyleSheetPath;
         mutable String m_userStyleSheet;
         mutable bool m_didLoadUserStyleSheet;
@@ -320,10 +303,6 @@
         RefPtr<StorageNamespace> m_sessionStorage;
 #endif
 
-#if PLATFORM(WIN) || (PLATFORM(WX) && defined(__WXMSW__)) || (PLATFORM(QT) && defined(Q_WS_WIN))
-        static HINSTANCE s_instanceHandle;
-#endif
-
 #if ENABLE(WML)
         OwnPtr<WMLPageState> m_wmlPageState;
 #endif
diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp
index f376d52..f6c746d 100644
--- a/WebCore/page/PageGroup.cpp
+++ b/WebCore/page/PageGroup.cpp
@@ -30,12 +30,10 @@
 #include "ChromeClient.h"
 #include "Document.h"
 #include "Frame.h"
+#include "IndexedDatabase.h"
 #include "Page.h"
 #include "Settings.h"
-
-#if ENABLE(DOM_STORAGE)
 #include "StorageNamespace.h"
-#endif
 
 #if PLATFORM(CHROMIUM)
 #include "ChromiumBridge.h"
@@ -191,6 +189,9 @@
 {
     if (!m_localStorage) {
         // Need a page in this page group to query the settings for the local storage database path.
+        // Having these parameters attached to the page settings is unfortunate since these settings are
+        // not per-page (and, in fact, we simply grab the settings from some page at random), but
+        // at this point we're stuck with it.
         Page* page = *m_pages.begin();
         const String& path = page->settings()->localStorageDatabasePath();
         unsigned quota = page->settings()->localStorageQuota();
@@ -201,6 +202,17 @@
 }
 #endif
 
+#if ENABLE(INDEXED_DATABASE)
+IndexedDatabase* PageGroup::indexedDatabase()
+{
+    // Do not add page setting based access control here since this object is shared by all pages in
+    // the group and having per-page controls is misleading.
+    if (!m_indexedDatabase)
+        m_indexedDatabase = IndexedDatabase::create();
+    return m_indexedDatabase.get();
+}
+#endif
+
 void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,  PassOwnPtr<Vector<String> > whitelist,
                                      PassOwnPtr<Vector<String> > blacklist, UserScriptInjectionTime injectionTime)
 {
diff --git a/WebCore/page/PageGroup.h b/WebCore/page/PageGroup.h
index 446f0c7..c1d25fa 100644
--- a/WebCore/page/PageGroup.h
+++ b/WebCore/page/PageGroup.h
@@ -36,6 +36,7 @@
 namespace WebCore {
 
     class KURL;
+    class IndexedDatabase;
     class Page;
     class StorageNamespace;
 
@@ -69,6 +70,9 @@
         StorageNamespace* localStorage();
         bool hasLocalStorage() { return m_localStorage; }
 #endif
+#if ENABLE(DOM_STORAGE)
+        IndexedDatabase* indexedDatabase();
+#endif
 
         void addUserScriptToWorld(DOMWrapperWorld*, const String& source, const KURL&, 
                                   PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
@@ -101,6 +105,9 @@
 #if ENABLE(DOM_STORAGE)
         RefPtr<StorageNamespace> m_localStorage;
 #endif
+#if ENABLE(INDEXED_DATABASE)
+        RefPtr<IndexedDatabase> m_indexedDatabase;
+#endif
 
         OwnPtr<UserScriptMap> m_userScripts;
         OwnPtr<UserStyleSheetMap> m_userStyleSheets;
diff --git a/WebCore/page/PositionCallback.h b/WebCore/page/PositionCallback.h
index 9f36d7a..5b7a202 100644
--- a/WebCore/page/PositionCallback.h
+++ b/WebCore/page/PositionCallback.h
@@ -26,7 +26,6 @@
 #ifndef PositionCallback_h
 #define PositionCallback_h
 
-#include <wtf/Platform.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
diff --git a/WebCore/page/PositionError.idl b/WebCore/page/PositionError.idl
index 1f28d95..5870e0d 100644
--- a/WebCore/page/PositionError.idl
+++ b/WebCore/page/PositionError.idl
@@ -25,7 +25,7 @@
 
 module core {
 
-    interface PositionError {
+    interface [Conditional=GEOLOCATION] PositionError {
         readonly attribute unsigned short code;
         readonly attribute DOMString message;
 
diff --git a/WebCore/page/PositionErrorCallback.h b/WebCore/page/PositionErrorCallback.h
index c23e883..e784297 100644
--- a/WebCore/page/PositionErrorCallback.h
+++ b/WebCore/page/PositionErrorCallback.h
@@ -26,7 +26,6 @@
 #ifndef PositionErrorCallback_h
 #define PositionErrorCallback_h
 
-#include <wtf/Platform.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index 31c8777..e0235de 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -32,11 +32,13 @@
 
 PrintContext::PrintContext(Frame* frame)
     : m_frame(frame)
+    , m_isPrinting(false)
 {
 }
 
 PrintContext::~PrintContext()
 {
+    ASSERT(!m_isPrinting);
     m_pageRects.clear();
 }
 
@@ -58,18 +60,18 @@
     if (!m_frame->document() || !m_frame->view() || !m_frame->document()->renderer())
         return;
 
-    RenderView* root = toRenderView(m_frame->document()->renderer());
-
-    if (!root) {
-        LOG_ERROR("document to be printed has no renderer");
+    if (userScaleFactor <= 0) {
+        LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
         return;
     }
 
+    RenderView* root = toRenderView(m_frame->document()->renderer());
+
     float ratio = printRect.height() / printRect.width();
 
     float pageWidth  = (float)root->rightLayoutOverflow();
     float pageHeight = pageWidth * ratio;
-    outPageHeight = pageHeight;   // this is the height of the page adjusted by margins
+    outPageHeight = pageHeight; // this is the height of the page adjusted by margins
     pageHeight -= headerHeight + footerHeight;
 
     if (pageHeight <= 0) {
@@ -77,26 +79,25 @@
         return;
     }
 
-    computePageRectsWithPageSize(FloatSize(pageWidth, pageHeight), userScaleFactor);
+    computePageRectsWithPageSizeInternal(FloatSize(pageWidth / userScaleFactor, pageHeight / userScaleFactor), false);
 }
 
-void PrintContext::computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, float userScaleFactor)
+void PrintContext::computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, bool allowHorizontalMultiPages)
 {
+    m_pageRects.clear();
+    computePageRectsWithPageSizeInternal(pageSizeInPixels, allowHorizontalMultiPages);
+}
+
+void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels, bool allowHorizontalMultiPages)
+{
+    if (!m_frame->document() || !m_frame->view() || !m_frame->document()->renderer())
+        return;
     RenderView* root = toRenderView(m_frame->document()->renderer());
 
-    if (!root) {
-        LOG_ERROR("document to be printed has no renderer");
-        return;
-    }
-
-    if (userScaleFactor <= 0) {
-        LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
-        return;
-    }
-
-    float currPageHeight = pageSizeInPixels.height() / userScaleFactor;
-    float docHeight = root->layer()->height();
-    float currPageWidth = pageSizeInPixels.width() / userScaleFactor;
+    const float pageWidth = pageSizeInPixels.width();
+    const float docWidth = root->layer()->width();
+    const float docHeight = root->layer()->height();
+    float currPageHeight = pageSizeInPixels.height();
 
     // always return at least one page, since empty files should print a blank page
     float printedPagesHeight = 0;
@@ -104,14 +105,20 @@
         float proposedBottom = std::min(docHeight, printedPagesHeight + pageSizeInPixels.height());
         m_frame->view()->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
         currPageHeight = max(1.0f, proposedBottom - printedPagesHeight);
-
-        m_pageRects.append(IntRect(0, (int)printedPagesHeight, (int)currPageWidth, (int)currPageHeight));
+        if (allowHorizontalMultiPages) {
+            for (float curWidth = 0; curWidth < docWidth; curWidth += pageWidth)
+                m_pageRects.append(IntRect(curWidth, (int)printedPagesHeight, (int)pageWidth, (int)currPageHeight));
+        } else
+            m_pageRects.append(IntRect(0, (int)printedPagesHeight, (int)pageWidth, (int)currPageHeight));
         printedPagesHeight += currPageHeight;
     } while (printedPagesHeight < docHeight);
 }
 
 void PrintContext::begin(float width)
 {
+    ASSERT(!m_isPrinting);
+    m_isPrinting = true;
+
     // By imaging to a width a little wider than the available pixels,
     // thin pages will be scaled down a little, matching the way they
     // print in IE and Camino. This lets them use fewer sheets than they
@@ -148,6 +155,8 @@
 
 void PrintContext::end()
 {
+    ASSERT(m_isPrinting);
+    m_isPrinting = false;
     m_frame->setPrinting(false, 0, 0, true);
 }
 
@@ -175,17 +184,18 @@
     FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels);
     PrintContext printContext(frame);
     printContext.begin(pageRect.width());
-    printContext.computePageRectsWithPageSize(pageSizeInPixels, 1);
+    printContext.computePageRectsWithPageSize(pageSizeInPixels, false);
 
     int top = box->offsetTop();
     int left = box->offsetLeft();
-    for (int pageNumber = 0; pageNumber < printContext.pageCount(); pageNumber++) {
+    int pageNumber = 0;
+    for (; pageNumber < printContext.pageCount(); pageNumber++) {
         const IntRect& page = printContext.pageRect(pageNumber);
         if (page.x() <= left && left < page.right() && page.y() <= top && top < page.bottom())
-            return pageNumber;
+            break;
     }
     printContext.end();
-    return -1;
+    return (pageNumber < printContext.pageCount() ? pageNumber : -1);
 }
 
 int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels)
@@ -195,7 +205,7 @@
     FloatRect pageRect(FloatPoint(0, 0), pageSizeInPixels);
     PrintContext printContext(frame);
     printContext.begin(pageRect.width());
-    printContext.computePageRectsWithPageSize(pageSizeInPixels, 1);
+    printContext.computePageRectsWithPageSize(pageSizeInPixels, false);
     printContext.end();
     return printContext.pageCount();
 }
diff --git a/WebCore/page/PrintContext.h b/WebCore/page/PrintContext.h
index ec15b84..1891144 100644
--- a/WebCore/page/PrintContext.h
+++ b/WebCore/page/PrintContext.h
@@ -42,6 +42,7 @@
     const Vector<IntRect>& pageRects() const { return m_pageRects; }
 
     void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight);
+    void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, bool allowHorizontalMultiPages);
 
     // TODO: eliminate width param
     void begin(float width);
@@ -56,10 +57,14 @@
     static int numberOfPages(Frame*, const FloatSize& pageSizeInPixels);
 
 protected:
-    void computePageRectsWithPageSize(const FloatSize& pageSizeInPixels, float userScaleFactor);
-
     Frame* m_frame;
     Vector<IntRect> m_pageRects;
+
+private:
+    void computePageRectsWithPageSizeInternal(const FloatSize& pageSizeInPixels, bool allowHorizontalMultiPages);
+
+    // Used to prevent misuses of begin() and end() (e.g., call end without begin).
+    bool m_isPrinting;
 };
 
 }
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp
index fe6efbd..265c643 100644
--- a/WebCore/page/SecurityOrigin.cpp
+++ b/WebCore/page/SecurityOrigin.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "SecurityOrigin.h"
 
-#include "CString.h"
 #include "Document.h"
 #include "KURL.h"
 #include "OriginAccessEntry.h"
@@ -65,6 +64,19 @@
     return localSchemes;
 }
 
+static URLSchemesMap& secureSchemes()
+{
+    DEFINE_STATIC_LOCAL(URLSchemesMap, secureSchemes, ());
+
+    if (secureSchemes.isEmpty()) {
+        secureSchemes.add("https");
+        secureSchemes.add("about");
+        secureSchemes.add("data");
+    }
+
+    return secureSchemes;
+}
+
 static URLSchemesMap& schemesWithUniqueOrigins()
 {
     DEFINE_STATIC_LOCAL(URLSchemesMap, schemesWithUniqueOrigins, ());
@@ -85,6 +97,7 @@
     , m_isUnique(isSandboxed(SandboxOrigin) || shouldTreatURLSchemeAsNoAccess(m_protocol))
     , m_universalAccess(false)
     , m_domainWasSetInDOM(false)
+    , m_enforceFilePathSeparation(false)
 {
     // These protocols do not create security origins; the owner frame provides the origin
     if (m_protocol == "about" || m_protocol == "javascript")
@@ -99,6 +112,8 @@
         // Directories should never be readable.
         if (!url.hasPath() || url.path().endsWith("/"))
             m_isUnique = true;
+        // Store the path in case we are doing per-file origin checking.
+        m_filePath = url.path();
     }
 
     if (isDefaultPortForProtocol(m_port, m_protocol))
@@ -109,12 +124,15 @@
     : m_sandboxFlags(other->m_sandboxFlags)
     , m_protocol(other->m_protocol.threadsafeCopy())
     , m_host(other->m_host.threadsafeCopy())
+    , m_encodedHost(other->m_encodedHost.threadsafeCopy())
     , m_domain(other->m_domain.threadsafeCopy())
+    , m_filePath(other->m_filePath.threadsafeCopy())
     , m_port(other->m_port)
     , m_isUnique(other->m_isUnique)
     , m_universalAccess(other->m_universalAccess)
     , m_domainWasSetInDOM(other->m_domainWasSetInDOM)
     , m_canLoadLocalResources(other->m_canLoadLocalResources)
+    , m_enforceFilePathSeparation(other->m_enforceFilePathSeparation)
 {
 }
 
@@ -172,7 +190,7 @@
 }
 
 bool SecurityOrigin::canAccess(const SecurityOrigin* other) const
-{  
+{
     if (m_universalAccess)
         return true;
 
@@ -199,17 +217,31 @@
     // Opera 9 allows access when only one page has set document.domain, but
     // this is a security vulnerability.
 
+    bool canAccess = false;
     if (m_protocol == other->m_protocol) {
         if (!m_domainWasSetInDOM && !other->m_domainWasSetInDOM) {
             if (m_host == other->m_host && m_port == other->m_port)
-                return true;
+                canAccess = true;
         } else if (m_domainWasSetInDOM && other->m_domainWasSetInDOM) {
             if (m_domain == other->m_domain)
-                return true;
+                canAccess = true;
         }
     }
-    
-    return false;
+
+    if (canAccess && isLocal())
+       canAccess = passesFileCheck(other);
+
+    return canAccess;
+}
+
+bool SecurityOrigin::passesFileCheck(const SecurityOrigin* other) const
+{
+    ASSERT(isLocal() && other->isLocal());
+
+    if (!m_enforceFilePathSeparation && !other->m_enforceFilePathSeparation)
+        return true;
+
+    return (m_filePath == other->m_filePath);
 }
 
 bool SecurityOrigin::canRequest(const KURL& url) const
@@ -229,12 +261,8 @@
     if (isSameSchemeHostPort(targetOrigin.get()))
         return true;
 
-    if (OriginAccessWhiteList* list = originAccessMap().get(toString())) {
-        for (size_t i = 0; i < list->size(); ++i) {
-            if (list->at(i).matchesOrigin(*targetOrigin))
-                return true;
-        }
-    }
+    if (isAccessWhiteListed(targetOrigin.get()))
+        return true;
 
     return false;
 }
@@ -256,15 +284,32 @@
     return true;
 }
 
+bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) const
+{
+    if (OriginAccessWhiteList* list = originAccessMap().get(toString())) {
+        for (size_t i = 0; i < list->size();  ++i) {
+           if (list->at(i).matchesOrigin(*targetOrigin))
+               return true;
+       }
+    }
+    return false;
+}
+  
 bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document* document)
 {
     if (!shouldTreatURLAsLocal(url.string()))
         return true;
 
-    // If we were provided a document, we let its local file policy dictate the result,
-    // otherwise we allow local loads only if the supplied referrer is also local.
-    if (document)
-        return document->securityOrigin()->canLoadLocalResources();
+    // If we were provided a document, we first check if the access has been white listed.
+    // Then we let its local file police dictate the result.
+    // Otherwise we allow local loads only if the supplied referrer is also local.
+    if (document) {
+        SecurityOrigin* documentOrigin = document->securityOrigin();
+        RefPtr<SecurityOrigin> targetOrigin = SecurityOrigin::create(url);
+        if (documentOrigin->isAccessWhiteListed(targetOrigin.get()))
+            return true;
+        return documentOrigin->canLoadLocalResources();
+    }
     if (!referrer.isEmpty())
         return shouldTreatURLAsLocal(referrer);
     return false;
@@ -286,9 +331,10 @@
     m_universalAccess = true;
 }
 
-void SecurityOrigin::makeUnique()
+void SecurityOrigin::enforceFilePathSeparation()
 {
-    m_isUnique = true;
+    ASSERT(isLocal());
+    m_enforceFilePathSeparation = true;
 }
 
 bool SecurityOrigin::isLocal() const
@@ -314,8 +360,11 @@
     if (isUnique())
         return "null";
 
-    if (m_protocol == "file")
-        return String("file://");
+    if (m_protocol == "file") {
+        if (m_enforceFilePathSeparation)
+            return "null";
+        return "file://";
+    }
 
     Vector<UChar> result;
     result.reserveInitialCapacity(m_protocol.length() + m_host.length() + 10);
@@ -368,13 +417,92 @@
     // Split out the 3 sections of data
     String protocol = databaseIdentifier.substring(0, separator1);
     String host = databaseIdentifier.substring(separator1 + 1, separator2 - separator1 - 1);
+    
+    host = decodeURLEscapeSequences(host);
     return create(KURL(KURL(), protocol + "://" + host + ":" + String::number(port)));
 }
 
+// The following lower-ASCII characters need escaping to be used in a filename
+// across all systems, including Windows:
+//     - Unprintable ASCII (00-1F)
+//     - Space             (20)
+//     - Double quote      (22)
+//     - Percent           (25) (escaped because it is our escape character)
+//     - Asterisk          (2A)
+//     - Slash             (2F)
+//     - Colon             (3A)
+//     - Less-than         (3C)
+//     - Greater-than      (3E)
+//     - Question Mark     (3F)
+//     - Backslash         (5C)
+//     - Pipe              (7C)
+//     - Delete            (7F)
+
+static const bool needsEscaping[128] = {
+    /* 00-07 */ true,  true,  true,  true,  true,  true,  true,  true, 
+    /* 08-0F */ true,  true,  true,  true,  true,  true,  true,  true, 
+
+    /* 10-17 */ true,  true,  true,  true,  true,  true,  true,  true, 
+    /* 18-1F */ true,  true,  true,  true,  true,  true,  true,  true, 
+
+    /* 20-27 */ true,  false, true,  false, false, true,  false, false, 
+    /* 28-2F */ false, false, true,  false, false, false, false, true, 
+    
+    /* 30-37 */ false, false, false, false, false, false, false, false, 
+    /* 38-3F */ false, false, true,  false, true,  false, true,  true, 
+    
+    /* 40-47 */ false, false, false, false, false, false, false, false, 
+    /* 48-4F */ false, false, false, false, false, false, false, false,
+    
+    /* 50-57 */ false, false, false, false, false, false, false, false, 
+    /* 58-5F */ false, false, false, false, true,  false, false, false,
+    
+    /* 60-67 */ false, false, false, false, false, false, false, false, 
+    /* 68-6F */ false, false, false, false, false, false, false, false,
+    
+    /* 70-77 */ false, false, false, false, false, false, false, false, 
+    /* 78-7F */ false, false, false, false, true,  false, false, true, 
+};
+
+static inline bool shouldEscapeUChar(UChar c)
+{
+    return c > 127 ? false : needsEscaping[c];
+}
+
+static const char hexDigits[17] = "0123456789ABCDEF";
+
+static String encodedHost(const String& host)
+{
+    unsigned length = host.length();
+    Vector<UChar, 512> buffer(length * 3 + 1);
+    UChar* p = buffer.data();
+
+    const UChar* str = host.characters();
+    const UChar* strEnd = str + length;
+
+    while (str < strEnd) {
+        UChar c = *str++;
+        if (shouldEscapeUChar(c)) {
+            *p++ = '%';
+            *p++ = hexDigits[(c >> 4) & 0xF];
+            *p++ = hexDigits[c & 0xF];
+        } else
+            *p++ = c;
+    }
+
+    ASSERT(p - buffer.data() <= static_cast<int>(buffer.size()));
+
+    return String(buffer.data(), p - buffer.data());
+}
+
 String SecurityOrigin::databaseIdentifier() const 
 {
-    DEFINE_STATIC_LOCAL(String, separatorString, (&SeparatorCharacter, 1));
-    return m_protocol + separatorString + m_host + separatorString + String::number(m_port); 
+    String separatorString(&SeparatorCharacter, 1);
+
+    if (m_encodedHost.isEmpty())
+        m_encodedHost = encodedHost(m_host);
+
+    return m_protocol + separatorString + m_encodedHost + separatorString + String::number(m_port); 
 }
 
 bool SecurityOrigin::equal(const SecurityOrigin* other) const 
@@ -405,6 +533,9 @@
     if (m_port != other->m_port)
         return false;
 
+    if (isLocal() && !passesFileCheck(other))
+        return false;
+
     return true;
 }
 
@@ -477,6 +608,16 @@
     return schemesWithUniqueOrigins().contains(scheme);
 }
 
+void SecurityOrigin::registerURLSchemeAsSecure(const String& scheme)
+{
+    secureSchemes().add(scheme);
+}
+
+bool SecurityOrigin::shouldTreatURLSchemeAsSecure(const String& scheme)
+{
+    return secureSchemes().contains(scheme);
+}
+
 bool SecurityOrigin::shouldHideReferrer(const KURL& url, const String& referrer)
 {
     bool referrerIsSecureURL = protocolIs(referrer, "https");
@@ -508,7 +649,7 @@
     return localLoadPolicy != SecurityOrigin::AllowLocalLoadsForLocalOnly;
 }
 
-void SecurityOrigin::whiteListAccessFromOrigin(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains)
+void SecurityOrigin::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains)
 {
     ASSERT(isMainThread());
     ASSERT(!sourceOrigin.isEmpty());
@@ -516,15 +657,42 @@
         return;
 
     String sourceString = sourceOrigin.toString();
-    OriginAccessWhiteList* list = originAccessMap().get(sourceString);
-    if (!list) {
-        list = new OriginAccessWhiteList;
-        originAccessMap().set(sourceString, list);
-    }
+    pair<OriginAccessMap::iterator, bool> result = originAccessMap().add(sourceString, 0);
+    if (result.second)
+        result.first->second = new OriginAccessWhiteList;
+
+    OriginAccessWhiteList* list = result.first->second;
     list->append(OriginAccessEntry(destinationProtocol, destinationDomains, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
 }
 
-void SecurityOrigin::resetOriginAccessWhiteLists()
+void SecurityOrigin::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains)
+{
+    ASSERT(isMainThread());
+    ASSERT(!sourceOrigin.isEmpty());
+    if (sourceOrigin.isEmpty())
+        return;
+
+    String sourceString = sourceOrigin.toString();
+    OriginAccessMap& map = originAccessMap();
+    OriginAccessMap::iterator it = map.find(sourceString);
+    if (it == map.end())
+        return;
+
+    OriginAccessWhiteList* list = it->second;
+    size_t index = list->find(OriginAccessEntry(destinationProtocol, destinationDomains, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
+    if (index == notFound)
+        return;
+
+    list->remove(index);
+
+    if (!list->isEmpty())
+        return;
+
+    map.remove(it);
+    delete list;
+}
+
+void SecurityOrigin::resetOriginAccessWhitelists()
 {
     ASSERT(isMainThread());
     OriginAccessMap& map = originAccessMap();
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index c96bb83..d732664 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -117,7 +117,7 @@
     bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
 
     bool canAccessDatabase() const { return !isUnique(); }
-    bool canAccessStorage() const { return !isUnique(); }
+    bool canAccessLocalStorage() const { return !isUnique(); }
     bool canAccessCookies() const { return !isUnique(); }
 
     bool isSecureTransitionTo(const KURL&) const;
@@ -138,8 +138,8 @@
     // addition, the SandboxOrigin flag is inherited by iframes.
     bool isUnique() const { return m_isUnique; }
 
-    // Marks an origin as being unique.
-    void makeUnique();
+    // Marks a file:// origin as being in a domain defined by its path.
+    void enforceFilePathSeparation();
 
     // Convert this SecurityOrigin into a string. The string
     // representation of a SecurityOrigin is similar to a URL, except it
@@ -174,6 +174,12 @@
     static bool shouldTreatURLAsLocal(const String&);
     static bool shouldTreatURLSchemeAsLocal(const String&);
 
+    // Secure schemes do not trigger mixed content warnings. For example,
+    // https and data are secure schemes because they cannot be corrupted by
+    // active network attackers.
+    static void registerURLSchemeAsSecure(const String&);
+    static bool shouldTreatURLSchemeAsSecure(const String&);
+
     static bool shouldHideReferrer(const KURL&, const String& referrer);
 
     enum LocalLoadPolicy {
@@ -188,22 +194,30 @@
     static void registerURLSchemeAsNoAccess(const String&);
     static bool shouldTreatURLSchemeAsNoAccess(const String&);
 
-    static void whiteListAccessFromOrigin(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
-    static void resetOriginAccessWhiteLists();
+    static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
+    static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomains, bool allowDestinationSubdomains);
+    static void resetOriginAccessWhitelists();
 
 private:
     SecurityOrigin(const KURL&, SandboxFlags);
     explicit SecurityOrigin(const SecurityOrigin*);
 
+    bool passesFileCheck(const SecurityOrigin* other) const;
+
+    bool isAccessWhiteListed(const SecurityOrigin* targetOrigin) const;
+
     SandboxFlags m_sandboxFlags;
     String m_protocol;
     String m_host;
+    mutable String m_encodedHost;
     String m_domain;
+    String m_filePath;
     unsigned short m_port;
     bool m_isUnique;
     bool m_universalAccess;
     bool m_domainWasSetInDOM;
     bool m_canLoadLocalResources;
+    bool m_enforceFilePathSeparation;
 };
 
 } // namespace WebCore
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index c59bdd0..e1b848a 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -27,12 +27,14 @@
 #include "Settings.h"
 
 #include "BackForwardList.h"
+#include "Database.h"
 #include "Frame.h"
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HistoryItem.h"
 #include "Page.h"
 #include "PageCache.h"
+#include "StorageMap.h"
 #include <limits>
 
 using namespace std;
@@ -74,15 +76,20 @@
     , m_blockNetworkImage(false)
 #endif
     , m_maximumDecodedImageSize(numeric_limits<size_t>::max())
+#if ENABLE(DOM_STORAGE)            
     , m_localStorageQuota(5 * 1024 * 1024)  // Suggested by the HTML5 spec.
+    , m_sessionStorageQuota(StorageMap::noQuota)
+#endif
     , m_pluginAllowedRunTime(numeric_limits<unsigned>::max())
+    , m_zoomMode(ZoomPage)
+    , m_isSpatialNavigationEnabled(false)
     , m_isJavaEnabled(false)
     , m_loadsImagesAutomatically(false)
     , m_privateBrowsingEnabled(false)
     , m_caretBrowsingEnabled(false)
     , m_areImagesEnabled(true)
+    , m_isMediaEnabled(true)
     , m_arePluginsEnabled(false)
-    , m_databasesEnabled(false)
     , m_localStorageEnabled(false)
     , m_isJavaScriptEnabled(false)
     , m_isWebSecurityEnabled(true)
@@ -108,13 +115,12 @@
     , m_authorAndUserStylesEnabled(true)
     , m_needsSiteSpecificQuirks(false)
     , m_fontRenderingMode(0)
-    , m_frameSetFlatteningEnabled(false)
+    , m_frameFlatteningEnabled(false)
     , m_webArchiveDebugModeEnabled(false)
     , m_localFileContentSniffingEnabled(false)
     , m_inApplicationChromeMode(false)
     , m_offlineWebApplicationCacheEnabled(false)
     , m_shouldPaintCustomScrollbars(false)
-    , m_zoomsTextOnly(false)
     , m_enforceCSSMIMETypeInStrictMode(true)
     , m_usesEncodingDetector(false)
     , m_allowScriptsToCloseWindows(false)
@@ -135,11 +141,14 @@
     , m_showRepaintCounter(false)
     , m_experimentalNotificationsEnabled(false)
     , m_webGLEnabled(false)
-    , m_geolocationEnabled(true)
     , m_loadDeferringEnabled(true)
+<<<<<<< HEAD
 #ifdef ANDROID_PLUGINS
     , m_pluginsOnDemand(false)
 #endif
+=======
+    , m_tiledBackingStoreEnabled(false)
+>>>>>>> webkit.org at r58033
 {
     // A Frame may not have been created yet, so we initialize the AtomicString 
     // hash before trying to use it.
@@ -271,6 +280,11 @@
     m_allowFileAccessFromFileURLs = allowFileAccessFromFileURLs;
 }
 
+void Settings::setSpatialNavigationEnabled(bool isSpatialNavigationEnabled)
+{
+    m_isSpatialNavigationEnabled = isSpatialNavigationEnabled;
+}
+
 void Settings::setJavaEnabled(bool isJavaEnabled)
 {
     m_isJavaEnabled = isJavaEnabled;
@@ -281,29 +295,40 @@
     m_areImagesEnabled = areImagesEnabled;
 }
 
+void Settings::setMediaEnabled(bool isMediaEnabled)
+{
+    m_isMediaEnabled = isMediaEnabled;
+}
+
 void Settings::setPluginsEnabled(bool arePluginsEnabled)
 {
     m_arePluginsEnabled = arePluginsEnabled;
 }
 
-void Settings::setDatabasesEnabled(bool databasesEnabled)
-{
-    m_databasesEnabled = databasesEnabled;
-}
-
 void Settings::setLocalStorageEnabled(bool localStorageEnabled)
 {
     m_localStorageEnabled = localStorageEnabled;
 }
 
+#if ENABLE(DOM_STORAGE)        
 void Settings::setLocalStorageQuota(unsigned localStorageQuota)
 {
     m_localStorageQuota = localStorageQuota;
 }
 
+void Settings::setSessionStorageQuota(unsigned sessionStorageQuota)
+{
+    m_sessionStorageQuota = sessionStorageQuota;
+}
+#endif
+
 void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
 {
+    if (m_privateBrowsingEnabled == privateBrowsingEnabled)
+        return;
+
     m_privateBrowsingEnabled = privateBrowsingEnabled;
+    m_page->privateBrowsingStateChanged();
 }
 
 void Settings::setJavaScriptCanOpenWindowsAutomatically(bool javaScriptCanOpenWindowsAutomatically)
@@ -631,9 +656,9 @@
     m_needsSiteSpecificQuirks = needsQuirks;
 }
 
-void Settings::setFrameSetFlatteningEnabled(bool frameSetFlatteningEnabled)
+void Settings::setFrameFlatteningEnabled(bool frameFlatteningEnabled)
 {
-    m_frameSetFlatteningEnabled = frameSetFlatteningEnabled;
+    m_frameFlatteningEnabled = frameFlatteningEnabled;
 }
 
 void Settings::setWebArchiveDebugModeEnabled(bool enabled)
@@ -666,12 +691,12 @@
     m_shouldPaintCustomScrollbars = shouldPaintCustomScrollbars;
 }
 
-void Settings::setZoomsTextOnly(bool zoomsTextOnly)
+void Settings::setZoomMode(ZoomMode mode)
 {
-    if (zoomsTextOnly == m_zoomsTextOnly)
+    if (mode == m_zoomMode)
         return;
     
-    m_zoomsTextOnly = zoomsTextOnly;
+    m_zoomMode = mode;
     setNeedsReapplyStylesInAllFrames(m_page);
 }
 
@@ -762,14 +787,18 @@
     m_webGLEnabled = enabled;
 }
 
-void Settings::setGeolocationEnabled(bool enabled)
-{
-    m_geolocationEnabled = enabled;
-}
-
 void Settings::setLoadDeferringEnabled(bool enabled)
 {
     m_loadDeferringEnabled = enabled;
 }
 
+void Settings::setTiledBackingStoreEnabled(bool enabled)
+{
+    m_tiledBackingStoreEnabled = enabled;
+#if ENABLE(TILED_BACKING_STORE)
+    if (m_page->mainFrame())
+        m_page->mainFrame()->setTiledBackingStoreEnabled(enabled);
+#endif
+}
+
 } // namespace WebCore
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 44b4642..6893eae 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -30,6 +30,7 @@
 #include "AtomicString.h"
 #include "FontRenderingMode.h"
 #include "KURL.h"
+#include "ZoomMode.h"
 
 namespace WebCore {
 
@@ -127,6 +128,9 @@
         bool blockNetworkImage() const { return m_blockNetworkImage; }
 #endif
         void setJavaScriptEnabled(bool);
+        // Instead of calling isJavaScriptEnabled directly, please consider calling
+        // ScriptController::canExecuteScripts, which takes things like the
+        // HTML sandbox attribute into account.
         bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; }
 
         void setWebSecurityEnabled(bool);
@@ -141,15 +145,22 @@
         void setJavaScriptCanOpenWindowsAutomatically(bool);
         bool javaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically; }
 
+        void setSpatialNavigationEnabled(bool);
+        bool isSpatialNavigationEnabled() const { return m_isSpatialNavigationEnabled; }
+
         void setJavaEnabled(bool);
         bool isJavaEnabled() const { return m_isJavaEnabled; }
 
         void setImagesEnabled(bool);
         bool areImagesEnabled() const { return m_areImagesEnabled; }
 
+        void setMediaEnabled(bool);
+        bool isMediaEnabled() const { return m_isMediaEnabled; }
+
         void setPluginsEnabled(bool);
         bool arePluginsEnabled() const { return m_arePluginsEnabled; }
 
+<<<<<<< HEAD
 #ifdef ANDROID_PLUGINS
         void setPluginsOnDemand(bool onDemand) { m_pluginsOnDemand = onDemand; }
         bool arePluginsOnDemand() const { return m_pluginsOnDemand; }
@@ -158,12 +169,22 @@
         void setDatabasesEnabled(bool);
         bool databasesEnabled() const { return m_databasesEnabled; }
 
+=======
+>>>>>>> webkit.org at r58033
         void setLocalStorageEnabled(bool);
         bool localStorageEnabled() const { return m_localStorageEnabled; }
 
+#if ENABLE(DOM_STORAGE)        
         void setLocalStorageQuota(unsigned);
         unsigned localStorageQuota() const { return m_localStorageQuota; }
 
+        // Allow clients concerned with memory consumption to set a quota on session storage
+        // since the memory used won't be released until the Page is destroyed.
+        // Default is noQuota.
+        void setSessionStorageQuota(unsigned);
+        unsigned sessionStorageQuota() const { return m_sessionStorageQuota; }
+#endif
+
         void setPrivateBrowsingEnabled(bool);
         bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
 
@@ -232,8 +253,8 @@
         void setDeveloperExtrasEnabled(bool);
         bool developerExtrasEnabled() const { return m_developerExtrasEnabled; }
 
-        void setFrameSetFlatteningEnabled(bool);
-        bool frameSetFlatteningEnabled() const { return m_frameSetFlatteningEnabled; }
+        void setFrameFlatteningEnabled(bool);
+        bool frameFlatteningEnabled() const { return m_frameFlatteningEnabled; }
 
 #ifdef ANDROID_META_SUPPORT
         void resetMetadataSettings();
@@ -300,8 +321,8 @@
         void setShouldPaintCustomScrollbars(bool);
         bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; }
 
-        void setZoomsTextOnly(bool);
-        bool zoomsTextOnly() const { return m_zoomsTextOnly; }
+        void setZoomMode(ZoomMode);
+        ZoomMode zoomMode() const { return m_zoomMode; }
         
         void setEnforceCSSMIMETypeInStrictMode(bool);
         bool enforceCSSMIMETypeInStrictMode() { return m_enforceCSSMIMETypeInStrictMode; }
@@ -350,11 +371,11 @@
         void setWebGLEnabled(bool);
         bool webGLEnabled() const { return m_webGLEnabled; }
 
-        void setGeolocationEnabled(bool);
-        bool geolocationEnabled() const { return m_geolocationEnabled; }
-
         void setLoadDeferringEnabled(bool);
         bool loadDeferringEnabled() const { return m_loadDeferringEnabled; }
+        
+        void setTiledBackingStoreEnabled(bool);
+        bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; }
 
     private:
         Page* m_page;
@@ -413,15 +434,20 @@
         bool m_blockNetworkImage : 1;
 #endif
         size_t m_maximumDecodedImageSize;
+#if ENABLE(DOM_STORAGE)        
         unsigned m_localStorageQuota;
+        unsigned m_sessionStorageQuota;
+#endif
         unsigned m_pluginAllowedRunTime;
+        ZoomMode m_zoomMode;
+        bool m_isSpatialNavigationEnabled : 1;
         bool m_isJavaEnabled : 1;
         bool m_loadsImagesAutomatically : 1;
         bool m_privateBrowsingEnabled : 1;
         bool m_caretBrowsingEnabled : 1;
         bool m_areImagesEnabled : 1;
+        bool m_isMediaEnabled : 1;
         bool m_arePluginsEnabled : 1;
-        bool m_databasesEnabled : 1;
         bool m_localStorageEnabled : 1;
         bool m_isJavaScriptEnabled : 1;
         bool m_isWebSecurityEnabled : 1;
@@ -447,13 +473,12 @@
         bool m_authorAndUserStylesEnabled : 1;
         bool m_needsSiteSpecificQuirks : 1;
         unsigned m_fontRenderingMode : 1;
-        bool m_frameSetFlatteningEnabled : 1;
+        bool m_frameFlatteningEnabled : 1;
         bool m_webArchiveDebugModeEnabled : 1;
         bool m_localFileContentSniffingEnabled : 1;
         bool m_inApplicationChromeMode : 1;
         bool m_offlineWebApplicationCacheEnabled : 1;
         bool m_shouldPaintCustomScrollbars : 1;
-        bool m_zoomsTextOnly : 1;
         bool m_enforceCSSMIMETypeInStrictMode : 1;
         bool m_usesEncodingDetector : 1;
         bool m_allowScriptsToCloseWindows : 1;
@@ -465,11 +490,14 @@
         bool m_showRepaintCounter : 1;
         bool m_experimentalNotificationsEnabled : 1;
         bool m_webGLEnabled : 1;
-        bool m_geolocationEnabled : 1;
         bool m_loadDeferringEnabled : 1;
+<<<<<<< HEAD
 #ifdef ANDROID_PLUGINS
         bool m_pluginsOnDemand : 1;
 #endif
+=======
+        bool m_tiledBackingStoreEnabled : 1;
+>>>>>>> webkit.org at r58033
 
 #if USE(SAFARI_THEME)
         static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
new file mode 100644
index 0000000..890eacd
--- /dev/null
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -0,0 +1,530 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>
+ *
+ * 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 COMPUTER, 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 "SpatialNavigation.h"
+
+#include "Frame.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "HTMLFrameOwnerElement.h"
+#include "IntRect.h"
+#include "Node.h"
+#include "Page.h"
+
+namespace WebCore {
+
+static long long spatialDistance(FocusDirection, const IntRect&, const IntRect&);
+static IntRect renderRectRelativeToRootDocument(RenderObject*);
+static RectsAlignment alignmentForRects(FocusDirection, const IntRect&, const IntRect&);
+static bool areRectsFullyAligned(FocusDirection, const IntRect&, const IntRect&);
+static bool areRectsPartiallyAligned(FocusDirection, const IntRect&, const IntRect&);
+static bool isRectInDirection(FocusDirection, const IntRect&, const IntRect&);
+static void deflateIfOverlapped(IntRect&, IntRect&);
+static bool checkNegativeCoordsForNode(Node*, const IntRect&);
+
+void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate)
+{
+    RenderObject* startRender = start->renderer();
+    if (!startRender) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    RenderObject* destRender = candidate.node->renderer();
+    if (!destRender) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    IntRect curRect = renderRectRelativeToRootDocument(startRender);
+    IntRect targetRect  = renderRectRelativeToRootDocument(destRender);
+
+    // The bounding rectangle of two consecutive nodes can overlap. In such cases,
+    // deflate both.
+    deflateIfOverlapped(curRect, targetRect);
+
+    // If empty rects or negative width or height, bail out.
+    if (curRect.isEmpty() || targetRect.isEmpty()
+     || targetRect.width() <= 0 || targetRect.height() <= 0) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    // Negative coordinates can be used if node is scrolled up offscreen.
+    if (!checkNegativeCoordsForNode(start, curRect)) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    if (!checkNegativeCoordsForNode(candidate.node, targetRect)) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    if (!isRectInDirection(direction, curRect, targetRect)) {
+        candidate.distance = maxDistance();
+        return;
+    }
+
+    // The distance between two nodes is not to be considered alone when evaluating/looking
+    // for the best focus candidate node. Alignment of rects can be also a good point to be
+    // considered in order to make the algorithm to behavior in a more intuitive way.
+    candidate.alignment = alignmentForRects(direction, curRect, targetRect);
+    candidate.distance = spatialDistance(direction, curRect, targetRect);
+}
+
+// FIXME: This function does not behave correctly with transformed frames.
+static IntRect renderRectRelativeToRootDocument(RenderObject* render)
+{
+    ASSERT(render);
+
+    IntRect rect(render->absoluteClippedOverflowRect());
+
+    if (rect.isEmpty()) {
+        Element* e = static_cast<Element*>(render->node());
+        rect = e->getRect();
+    }
+
+    // In cases when the |render|'s associated node is in a scrollable inner
+    // document, we only consider its scrollOffset if it is not offscreen.
+    Node* node = render->node();
+    Document* mainDocument = node->document()->page()->mainFrame()->document();
+    bool considerScrollOffset = !(hasOffscreenRect(node) && node->document() != mainDocument);
+
+    if (considerScrollOffset) {
+        if (FrameView* frameView = render->node()->document()->view())
+            rect.move(-frameView->scrollOffset());
+    }
+
+    // Handle nested frames.
+    for (Frame* frame = render->document()->frame(); frame; frame = frame->tree()->parent()) {
+        if (HTMLFrameOwnerElement* ownerElement = frame->ownerElement())
+            rect.move(ownerElement->offsetLeft(), ownerElement->offsetTop());
+    }
+
+    return rect;
+}
+
+static RectsAlignment alignmentForRects(FocusDirection direction, const IntRect& curRect, const IntRect& targetRect)
+{
+    if (areRectsFullyAligned(direction, curRect, targetRect))
+        return Full;
+
+    if (areRectsPartiallyAligned(direction, curRect, targetRect))
+        return Partial;
+
+    return None;
+}
+
+static inline bool isHorizontalMove(FocusDirection direction)
+{
+    return direction == FocusDirectionLeft || direction == FocusDirectionRight;
+}
+
+static inline int start(FocusDirection direction, const IntRect& rect)
+{
+    return isHorizontalMove(direction) ? rect.y() : rect.x();
+}
+
+static inline int middle(FocusDirection direction, const IntRect& rect)
+{
+    IntPoint center(rect.center());
+    return isHorizontalMove(direction) ? center.y(): center.x();
+}
+
+static inline int end(FocusDirection direction, const IntRect& rect)
+{
+    return isHorizontalMove(direction) ? rect.bottom() : rect.right();
+}
+
+// This method checks if rects |a| and |b| are fully aligned either vertically or
+// horizontally. In general, rects whose central point falls between the top or
+// bottom of each other are considered fully aligned.
+// Rects that match this criteria are preferable target nodes in move focus changing
+// operations.
+// * a = Current focused node's rect.
+// * b = Focus candidate node's rect.
+static bool areRectsFullyAligned(FocusDirection direction, const IntRect& a, const IntRect& b)
+{
+    int aStart, bStart, aEnd, bEnd;
+
+    switch (direction) {
+    case FocusDirectionLeft:
+        aStart = a.x();
+        bEnd = b.right();
+        break;
+    case FocusDirectionRight:
+        aStart = b.x();
+        bEnd = a.right();
+        break;
+    case FocusDirectionUp:
+        aStart = a.y();
+        bEnd = b.y();
+        break;
+    case FocusDirectionDown:
+        aStart = b.y();
+        bEnd = a.y();
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+
+    if (aStart < bEnd)
+        return false;
+
+    aStart = start(direction, a);
+    bStart = start(direction, b);
+
+    int aMiddle = middle(direction, a);
+    int bMiddle = middle(direction, b);
+
+    aEnd = end(direction, a);
+    bEnd = end(direction, b);
+
+    // Picture of the totally aligned logic:
+    //
+    //     Horizontal    Vertical        Horizontal     Vertical
+    //  ****************************  *****************************
+    //  *  _          *   _ _ _ _  *  *         _   *      _ _    *
+    //  * |_|     _   *  |_|_|_|_| *  *  _     |_|  *     |_|_|   *
+    //  * |_|....|_|  *      .     *  * |_|....|_|  *       .     *
+    //  * |_|    |_| (1)     .     *  * |_|    |_| (2)      .     *
+    //  * |_|         *     _._    *  *        |_|  *    _ _._ _  *
+    //  *             *    |_|_|   *  *             *   |_|_|_|_| *
+    //  *             *            *  *             *             *
+    //  ****************************  *****************************
+
+    //     Horizontal    Vertical        Horizontal     Vertical
+    //  ****************************  *****************************
+    //  *  _......_   *   _ _ _ _  *  *  _          *    _ _ _ _  *
+    //  * |_|    |_|  *  |_|_|_|_| *  * |_|     _   *   |_|_|_|_| *
+    //  * |_|    |_|  *  .         *  * |_|    |_|  *           . *
+    //  * |_|        (3) .         *  * |_|....|_| (4)          . *
+    //  *             *  ._ _      *  *             *        _ _. *
+    //  *             *  |_|_|     *  *             *       |_|_| *
+    //  *             *            *  *             *             *
+    //  ****************************  *****************************
+
+    return ((bMiddle >= aStart && bMiddle <= aEnd) // (1)
+            || (aMiddle >= bStart && aMiddle <= bEnd) // (2)
+            || (bStart == aStart) // (3)
+            || (bEnd == aEnd)); // (4)
+}
+
+// This method checks if |start| and |dest| have a partial intersection, either
+// horizontally or vertically.
+// * a = Current focused node's rect.
+// * b = Focus candidate node's rect.
+static bool areRectsPartiallyAligned(FocusDirection direction, const IntRect& a, const IntRect& b)
+{
+    int aStart  = start(direction, a);
+    int bStart  = start(direction, b);
+    int bMiddle = middle(direction, b);
+    int aEnd = end(direction, a);
+    int bEnd = end(direction, b);
+
+    // Picture of the partially aligned logic:
+    //
+    //    Horizontal       Vertical
+    // ********************************
+    // *  _            *   _ _ _      *
+    // * |_|           *  |_|_|_|     *
+    // * |_|.... _     *      . .     *
+    // * |_|    |_|    *      . .     *
+    // * |_|....|_|    *      ._._ _  *
+    // *        |_|    *      |_|_|_| *
+    // *        |_|    *              *
+    // *               *              *
+    // ********************************
+    //
+    // ... and variants of the above cases.
+    return ((bStart >= aStart && bStart <= aEnd)
+            || (bStart >= aStart && bStart <= aEnd)
+            || (bEnd >= aStart && bEnd <= aEnd)
+            || (bMiddle >= aStart && bMiddle <= aEnd)
+            || (bEnd >= aStart && bEnd <= aEnd));
+}
+
+// Return true if rect |a| is below |b|. False otherwise.
+static inline bool below(const IntRect& a, const IntRect& b)
+{
+    return a.y() > b.bottom();
+}
+
+// Return true if rect |a| is on the right of |b|. False otherwise.
+static inline bool rightOf(const IntRect& a, const IntRect& b)
+{
+    return a.x() > b.right();
+}
+
+// * a = Current focused node's rect.
+// * b = Focus candidate node's rect.
+static long long spatialDistance(FocusDirection direction, const IntRect& a, const IntRect& b)
+{
+    int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+
+    if (direction == FocusDirectionLeft) {
+        // #1  |--|
+        //
+        // #2  |--|  |--|
+        //
+        // #3  |--|
+
+        x1 = a.x();
+        x2 = b.right();
+
+        if (below(a, b)) {
+            // #1 The a rect is below b.
+            y1 = a.y();
+            y2 = b.bottom();
+        } else if (below(b, a)) {
+            // #3 The b rect is below a.
+            y1 = a.bottom();
+            y2 = b.y();
+        } else {
+            // #2 Both b and a share some common y's.
+            y1 = 0;
+            y2 = 0;
+        }
+    } else if (direction == FocusDirectionRight) {
+        //        |--|  #1
+        //
+        //  |--|  |--|  #2
+        //
+        //        |--|  #3
+
+        x1 = a.right();
+        x2 = b.x();
+
+        if (below(a, b)) {
+            // #1 The b rect is above a.
+            y1 = a.y();
+            y2 = b.bottom();
+        } else if (below(b, a)) {
+            // #3 The b rect is below a.
+            y1 = a.bottom();
+            y2 = b.y();
+        } else {
+            // #2 Both b and a share some common y's.
+            y1 = 0;
+            y2 = 0;
+        }
+    } else if (direction == FocusDirectionUp) {
+        //
+        //   #1    #2    #3
+        //
+        //  |--|  |--|  |--|
+        //
+        //        |--|
+
+        y1 = a.y();
+        y2 = b.bottom();
+
+        if (rightOf(a, b)) {
+            // #1 The b rect is to the left of a.
+            x1 = a.x();
+            x2 = b.right();
+        } else if (rightOf(b, a)) {
+            // #3 The b rect is to the right of a.
+            x1 = a.right();
+            x2 = b.x();
+        } else {
+            // #2 Both b and a share some common x's.
+            x1 = 0;
+            x2 = 0;
+        }
+    } else if (direction == FocusDirectionDown) {
+        //        |--|
+        //
+        //  |--|  |--|  |--|
+        //
+        //   #1    #2    #3
+
+        y1 = a.bottom();
+        y2 = b.y();
+
+        if (rightOf(a, b)) {
+            // #1 The b rect is to the left of a.
+            x1 = a.x();
+            x2 = b.right();
+        } else if (rightOf(b, a)) {
+            // #3 The b rect is to the right of a
+            x1 = a.right();
+            x2 = b.x();
+        } else {
+            // #2 Both b and a share some common x's.
+            x1 = 0;
+            x2 = 0;
+        }
+    }
+
+    long long dx = x1 - x2;
+    long long dy = y1 - y2;
+
+    long long distance = (dx * dx) + (dy * dy);
+
+    if (distance < 0)
+        distance *= -1;
+
+    return distance;
+}
+
+static bool isRectInDirection(FocusDirection direction, const IntRect& curRect, const IntRect& targetRect)
+{
+    IntPoint center(targetRect.center());
+    int targetMiddle = isHorizontalMove(direction) ? center.x() : center.y();
+
+    switch (direction) {
+    case FocusDirectionLeft:
+        return targetMiddle < curRect.x();
+    case FocusDirectionRight:
+        return targetMiddle > curRect.right();
+    case FocusDirectionUp:
+        return targetMiddle < curRect.y();
+    case FocusDirectionDown:
+        return targetMiddle > curRect.bottom();
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    return false;
+}
+
+// Checks if |node| is offscreen the visible area (viewport) of its container
+// document. In case it is, one can scroll in direction or take any different
+// desired action later on.
+bool hasOffscreenRect(Node* node)
+{
+    // Get the FrameView in which |node| is (which means the current viewport if |node|
+    // is not in an inner document), so we can check if its content rect is visible
+    // before we actually move the focus to it.
+    FrameView* frameView = node->document()->view();
+    if (!frameView)
+        return true;
+
+    IntRect containerViewportRect = frameView->visibleContentRect();
+
+    RenderObject* render = node->renderer();
+    if (!render)
+        return true;
+
+    IntRect rect(render->absoluteClippedOverflowRect());
+    if (rect.isEmpty())
+        return true;
+
+    return !containerViewportRect.intersects(rect);
+}
+
+// In a bottom-up way, this method tries to scroll |frame| in a given direction
+// |direction|, going up in the frame tree hierarchy in case it does not succeed.
+bool scrollInDirection(Frame* frame, FocusDirection direction)
+{
+    if (!frame)
+        return false;
+
+    ScrollDirection scrollDirection;
+
+    switch (direction) {
+    case FocusDirectionLeft:
+        scrollDirection = ScrollLeft;
+        break;
+    case FocusDirectionRight:
+        scrollDirection = ScrollRight;
+        break;
+    case FocusDirectionUp:
+        scrollDirection = ScrollUp;
+        break;
+    case FocusDirectionDown:
+        scrollDirection = ScrollDown;
+        break;
+    default:
+        return false;
+    }
+
+    return frame->eventHandler()->scrollRecursively(scrollDirection, ScrollByLine);
+}
+
+void scrollIntoView(Element* element)
+{
+    // NOTE: Element's scrollIntoView method could had been used here, but
+    // it is preferable to inflate |element|'s bounding rect a bit before
+    // scrolling it for accurate reason.
+    // Element's scrollIntoView method does not provide this flexibility.
+    static const int fudgeFactor = 2;
+    IntRect bounds = element->getRect();
+    bounds.inflate(fudgeFactor);
+    element->renderer()->enclosingLayer()->scrollRectToVisible(bounds);
+}
+
+bool isInRootDocument(Node* node)
+{
+    if (!node)
+        return false;
+
+    Document* rootDocument = node->document()->page()->mainFrame()->document();
+    return node->document() == rootDocument;
+}
+
+static void deflateIfOverlapped(IntRect& a, IntRect& b)
+{
+    if (!a.intersects(b) || a.contains(b) || b.contains(a))
+        return;
+
+    static const int fudgeFactor = -2;
+
+    // Avoid negative width or height values.
+    if ((a.width() + 2 * fudgeFactor > 0) && (a.height() + 2 * fudgeFactor > 0))
+        a.inflate(fudgeFactor);
+
+    if ((b.width() + 2 * fudgeFactor > 0) && (b.height() + 2 * fudgeFactor > 0))
+        b.inflate(fudgeFactor);
+}
+
+static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
+{
+    ASSERT(node || node->renderer());
+
+    if (curRect.x() > 0 && curRect.y() > 0)
+        return true;
+
+    bool canBeScrolled = false;
+
+    RenderObject* renderer = node->renderer();
+    for (; renderer; renderer = renderer->parent()) {
+        if (renderer->isBox() && toRenderBox(renderer)->canBeScrolledAndHasScrollableArea()) {
+            canBeScrolled = true;
+            break;
+        }
+    }
+
+    return canBeScrolled;
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h
new file mode 100644
index 0000000..90ff1cf
--- /dev/null
+++ b/WebCore/page/SpatialNavigation.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.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 SpatialNavigation_h
+#define SpatialNavigation_h
+
+#include "FocusDirection.h"
+#include "Node.h"
+
+#include <limits>
+
+namespace WebCore {
+
+class Element;
+class Frame;
+class IntRect;
+class RenderObject;
+
+using namespace std;
+
+inline long long maxDistance()
+{
+    return numeric_limits<long long>::max();
+}
+
+// Spatially speaking, two given elements in a web page can be:
+// 1) Fully aligned: There is a full intersection between the rects, either
+//    vertically or horizontally.
+//
+// * Horizontally       * Vertically
+//    _
+//   |_|                   _ _ _ _ _ _
+//   |_|...... _          |_|_|_|_|_|_|
+//   |_|      |_|         .       .
+//   |_|......|_|   OR    .       .
+//   |_|      |_|         .       .
+//   |_|......|_|          _ _ _ _
+//   |_|                  |_|_|_|_|
+//
+//
+// 2) Partially aligned: There is a partial intersection between the rects, either
+//    vertically or horizontally.
+//
+// * Horizontally       * Vertically
+//    _                   _ _ _ _ _
+//   |_|                 |_|_|_|_|_|
+//   |_|.... _      OR           . .
+//   |_|    |_|                  . .
+//   |_|....|_|                  ._._ _
+//          |_|                  |_|_|_|
+//          |_|
+//
+// 3) Or, otherwise, not aligned at all.
+//
+// * Horizontally       * Vertically
+//         _              _ _ _ _
+//        |_|            |_|_|_|_|
+//        |_|                    .
+//        |_|                     .
+//       .          OR             .
+//    _ .                           ._ _ _ _ _
+//   |_|                            |_|_|_|_|_|
+//   |_|
+//   |_|
+//
+// "Totally Aligned" elements are preferable candidates to move
+// focus to over "Partially Aligned" ones, that on its turns are
+// more preferable than "Not Aligned".
+enum RectsAlignment {
+    None = 0,
+    Partial,
+    Full
+};
+
+struct FocusCandidate {
+    FocusCandidate()
+        : node(0)
+        , distance(maxDistance())
+        , parentDistance(maxDistance())
+        , alignment(None)
+        , parentAlignment(None)
+    {
+    }
+
+    FocusCandidate(Node* n)
+        : node(n)
+        , distance(maxDistance())
+        , parentDistance(maxDistance())
+        , alignment(None)
+        , parentAlignment(None)
+    {
+    }
+
+    bool isNull() const { return !node; }
+    Document* document() const { return node ? node->document() : 0; }
+
+    Node* node;
+    long long distance;
+    long long parentDistance;
+    RectsAlignment alignment;
+    RectsAlignment parentAlignment;
+};
+
+void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate);
+bool scrollInDirection(Frame*, FocusDirection);
+void scrollIntoView(Element*);
+bool hasOffscreenRect(Node*);
+bool isInRootDocument(Node*);
+
+} // namspace WebCore
+
+#endif // SpatialNavigation_h
diff --git a/WebCore/page/UserContentURLPattern.cpp b/WebCore/page/UserContentURLPattern.cpp
index 5f0a311..09eb678 100644
--- a/WebCore/page/UserContentURLPattern.cpp
+++ b/WebCore/page/UserContentURLPattern.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -75,28 +75,26 @@
 
     int pathStartPos = 0;
 
-    if (m_scheme == "file")
+    if (equalIgnoringCase(m_scheme, "file"))
         pathStartPos = hostStartPos;
     else {
         int hostEndPos = pattern.find("/", hostStartPos);
         if (hostEndPos == -1)
             return false;
-    
-        m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos);
 
-        // The first component can be '*', which means to match all subdomains.
-        Vector<String> hostComponents;
-        m_host.split(".", hostComponents); 
-        if (hostComponents[0] == "*") {
-            m_matchSubdomains = true;
+        m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos);
+        m_matchSubdomains = false;
+
+        if (m_host == "*") {
+            // The pattern can be just '*', which means match all domains.
             m_host = "";
-            for (unsigned i = 1; i < hostComponents.size(); ++i) {
-                m_host = m_host + hostComponents[i];
-                if (i < hostComponents.size() - 1)
-                    m_host = m_host + ".";
-            }
+            m_matchSubdomains = true;
+        } else if (m_host.startsWith("*.")) {
+            // The first component can be '*', which means to match all subdomains.
+            m_host = m_host.substring(2); // Length of "*."
+            m_matchSubdomains = true;
         }
-        
+
         // No other '*' can occur in the host.
         if (m_host.find("*") != -1)
             return false;
@@ -114,10 +112,10 @@
     if (m_invalid)
         return false;
 
-    if (test.protocol() != m_scheme)
+    if (!equalIgnoringCase(test.protocol(), m_scheme))
         return false;
 
-    if (!matchesHost(test))
+    if (!equalIgnoringCase(m_scheme, "file") && !matchesHost(test))
         return false;
 
     return matchesPath(test);
@@ -125,7 +123,8 @@
 
 bool UserContentURLPattern::matchesHost(const KURL& test) const
 {
-    if (test.host() == m_host)
+    const String& host = test.host();
+    if (equalIgnoringCase(host, m_host))
         return true;
 
     if (!m_matchSubdomains)
@@ -136,8 +135,14 @@
     if (!m_host.length())
         return true;
 
-    // Check if the test host is a subdomain of our host.
-    return test.host().endsWith(m_host, false);
+    // Check if the domain is a subdomain of our host.
+    if (!host.endsWith(m_host, false))
+        return false;
+
+    ASSERT(host.length() > m_host.length());
+
+    // Check that the character before the suffix is a period.
+    return host[host.length() - m_host.length() - 1] == '.';
 }
 
 struct MatchTester
diff --git a/WebCore/page/UserContentURLPattern.h b/WebCore/page/UserContentURLPattern.h
index 0b1a248..3450ed1 100644
--- a/WebCore/page/UserContentURLPattern.h
+++ b/WebCore/page/UserContentURLPattern.h
@@ -35,12 +35,16 @@
 
 class UserContentURLPattern {
 public:
+    UserContentURLPattern() : m_invalid(true), m_matchSubdomains(false) { }
+
     UserContentURLPattern(const String& pattern)
     : m_matchSubdomains(false)
     {
         m_invalid = !parse(pattern);
     }
 
+    bool isValid() const { return !m_invalid; }
+
     bool matches(const KURL&) const;
 
     const String& scheme() const { return m_scheme; }
diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp
index b71fa49..9e225ff 100644
--- a/WebCore/page/XSSAuditor.cpp
+++ b/WebCore/page/XSSAuditor.cpp
@@ -31,7 +31,6 @@
 #include <wtf/Vector.h>
 
 #include "Console.h"
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "DOMWindow.h"
 #include "Frame.h"
@@ -41,6 +40,7 @@
 #include "ScriptSourceCode.h"
 #include "Settings.h"
 #include "TextResourceDecoder.h"
+#include <wtf/text/CString.h>
 
 using namespace WTF;
 
@@ -70,6 +70,16 @@
     return (c == '\'' || c == '"' || c == '<' || c == '>');
 }
 
+String XSSAuditor::CachingURLCanonicalizer::canonicalizeURL(FormData* formData, const TextEncoding& encoding, bool decodeEntities, 
+                                                            bool decodeURLEscapeSequencesTwice)
+{
+    if (decodeEntities == m_decodeEntities && decodeURLEscapeSequencesTwice == m_decodeURLEscapeSequencesTwice 
+        && encoding == m_encoding && formData == m_formData)
+        return m_cachedCanonicalizedURL;
+    m_formData = formData;
+    return canonicalizeURL(formData->flattenToString(), encoding, decodeEntities, decodeURLEscapeSequencesTwice);
+}
+
 String XSSAuditor::CachingURLCanonicalizer::canonicalizeURL(const String& url, const TextEncoding& encoding, bool decodeEntities, 
                                                             bool decodeURLEscapeSequencesTwice)
 {
@@ -82,11 +92,19 @@
     m_encoding = encoding;
     m_decodeEntities = decodeEntities;
     m_decodeURLEscapeSequencesTwice = decodeURLEscapeSequencesTwice;
+    ++m_generation;
     return m_cachedCanonicalizedURL;
 }
 
+void XSSAuditor::CachingURLCanonicalizer::clear()
+{
+    m_formData.clear();
+    m_inputURL = String();
+}
+
 XSSAuditor::XSSAuditor(Frame* frame)
     : m_frame(frame)
+    , m_generationOfSuffixTree(-1)
 {
 }
 
@@ -290,21 +308,15 @@
     return (m_frame->document()->url().host() == resourceURL.host() && resourceURL.query().isEmpty());
 }
 
-bool XSSAuditor::shouldFullPageBlockForXSSProtectionHeader() const
+XSSProtectionDisposition XSSAuditor::xssProtection() const
 {
-    // If we detect an XSS attack and find the HTTP header "X-XSS-Protection: 12" then
-    // we will stop loading the page as opposed to ignoring the script. The value "12"
-    // came from a personal communication, see <https://bugs.webkit.org/show_bug.cgi?id=27312>
-    // for more details.
     DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection"));
 
     Frame* frame = m_frame;
     if (frame->document()->url() == blankURL())
         frame = m_frame->tree()->parent();
 
-    // We strip any whitespace characters to conform to the behavior in Internet Explorer.
-    String xssProtectionValue = frame->loader()->documentLoader()->response().httpHeaderField(XSSProtectionHeader).stripWhiteSpace();
-    return (xssProtectionValue.length() >= 2 && xssProtectionValue[0] == '1' && xssProtectionValue[1] == '2');
+    return parseXSSProtectionHeader(frame->loader()->documentLoader()->response().httpHeaderField(XSSProtectionHeader));
 }
 
 bool XSSAuditor::findInRequest(const FindTask& task) const
@@ -318,11 +330,24 @@
         result = findInRequest(m_frame, task);
         blockFrame = m_frame;
     }
-    if (result && blockFrame && shouldFullPageBlockForXSSProtectionHeader()) {
-        blockFrame->loader()->stopAllLoaders();
-        blockFrame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
+    if (!result)
+        return false;
+
+    switch (xssProtection()) {
+    case XSSProtectionDisabled:
+        return false;
+    case XSSProtectionEnabled:
+        break;
+    case XSSProtectionBlockEnabled:
+        if (blockFrame) {
+            blockFrame->loader()->stopAllLoaders();
+            blockFrame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
+        }
+        break;
+    default:
+        ASSERT_NOT_REACHED();
     }
-    return result;
+    return true;
 }
 
 bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const
@@ -341,6 +366,12 @@
     const bool hasFormData = formDataObj && !formDataObj->isEmpty();
     String pageURL = frame->document()->url().string();
 
+    if (!hasFormData) {
+        // We clear out our form data caches, in case we're holding onto a bunch of memory.
+        m_formDataCache.clear();
+        m_formDataSuffixTree.clear();
+    }
+
     String canonicalizedString;
     if (!hasFormData && task.string.length() > 2 * pageURL.length()) {
         // Q: Why do we bother to do this check at all?
@@ -368,7 +399,7 @@
     if (!task.context.isEmpty())
         canonicalizedString = task.context + canonicalizedString;
 
-    String decodedPageURL = m_cache.canonicalizeURL(pageURL, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
+    String decodedPageURL = m_pageURLCache.canonicalizeURL(pageURL, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
 
     if (task.allowRequestIfNoIllegalURICharacters && !hasFormData && decodedPageURL.find(&isIllegalURICharacter, 0) == -1)
         return false; // Injection is impossible because the request does not contain any illegal URI characters.
@@ -377,7 +408,17 @@
         return true; // We've found the string in the GET data.
 
     if (hasFormData) {
-        String decodedFormData = m_cache.canonicalizeURL(formDataObj->flattenToString(), frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
+        String decodedFormData = m_formDataCache.canonicalizeURL(formDataObj, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
+
+        if (m_generationOfSuffixTree != m_formDataCache.generation()) {
+            m_formDataSuffixTree = new SuffixTree<ASCIICodebook>(decodedFormData, 5);
+            m_generationOfSuffixTree = m_formDataCache.generation();
+        }
+
+        // Try a fast-reject via the suffixTree.
+        if (m_formDataSuffixTree && !m_formDataSuffixTree->mightContain(canonicalizedString))
+            return false;
+
         if (decodedFormData.find(canonicalizedString, 0, false) != -1)
             return true; // We found the string in the POST data.
     }
diff --git a/WebCore/page/XSSAuditor.h b/WebCore/page/XSSAuditor.h
index 3ad50a1..d2f525d 100644
--- a/WebCore/page/XSSAuditor.h
+++ b/WebCore/page/XSSAuditor.h
@@ -27,11 +27,14 @@
 #ifndef XSSAuditor_h
 #define XSSAuditor_h
 
+#include "HTTPParsers.h"
 #include "PlatformString.h"
+#include "SuffixTree.h"
 #include "TextEncoding.h"
 
 namespace WebCore {
 
+    class FormData;
     class Frame;
     class ScriptSourceCode;
 
@@ -105,16 +108,26 @@
         class CachingURLCanonicalizer
         {
         public:
-            CachingURLCanonicalizer() : m_decodeEntities(false), m_decodeURLEscapeSequencesTwice(false) { }
+            CachingURLCanonicalizer() : m_decodeEntities(false), m_decodeURLEscapeSequencesTwice(false), m_generation(0) { }
+            String canonicalizeURL(FormData*, const TextEncoding& encoding, bool decodeEntities, 
+                                   bool decodeURLEscapeSequencesTwice);
             String canonicalizeURL(const String& url, const TextEncoding& encoding, bool decodeEntities, 
                                    bool decodeURLEscapeSequencesTwice);
 
+            void clear();
+
+            int generation() const { return m_generation; }
+
         private:
             // The parameters we were called with last.
             String m_inputURL;
             TextEncoding m_encoding;
             bool m_decodeEntities;
             bool m_decodeURLEscapeSequencesTwice;
+            RefPtr<FormData> m_formData;
+
+            // Incremented every time we see a new URL.
+            int m_generation;
 
             // The cached result.
             String m_cachedCanonicalizedURL;
@@ -144,13 +157,22 @@
         bool findInRequest(const FindTask&) const;
         bool findInRequest(Frame*, const FindTask&) const;
 
-        bool shouldFullPageBlockForXSSProtectionHeader() const;
+        XSSProtectionDisposition xssProtection() const;
 
         // The frame to audit.
         Frame* m_frame;
 
         // A state store to help us avoid canonicalizing the same URL repeated.
-        mutable CachingURLCanonicalizer m_cache;
+        // When a page has form data, we need two caches: one to store the
+        // canonicalized URL and another to store the cannonicalized form
+        // data. If we only had one cache, we'd always generate a cache miss
+        // and load some pages extremely slowly.
+        // https://bugs.webkit.org/show_bug.cgi?id=35373
+        mutable CachingURLCanonicalizer m_pageURLCache;
+        mutable CachingURLCanonicalizer m_formDataCache;
+
+        mutable OwnPtr<SuffixTree<ASCIICodebook> > m_formDataSuffixTree;
+        mutable int m_generationOfSuffixTree;
     };
 
 } // namespace WebCore
diff --git a/WebCore/page/ZoomMode.h b/WebCore/page/ZoomMode.h
new file mode 100644
index 0000000..3f02184
--- /dev/null
+++ b/WebCore/page/ZoomMode.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 Research in Motion Ltd. http://www.rim.com/
+ *
+ * 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 ZoomMode_h
+#define ZoomMode_h
+
+namespace WebCore {
+
+enum ZoomMode {
+    ZoomPage,
+    ZoomTextOnly
+};
+
+}
+
+#endif
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index 2a2ab4b..d9282cb 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -33,7 +33,6 @@
 #include "CSSMutableStyleDeclaration.h"
 #include "CSSPropertyLonghand.h"
 #include "CSSPropertyNames.h"
-#include "CString.h"
 #include "CompositeAnimation.h"
 #include "Document.h"
 #include "EventNames.h"
@@ -136,9 +135,9 @@
 static inline ShadowData* blendFunc(const AnimationBase* anim, const ShadowData* from, const ShadowData* to, double progress)
 {  
     ASSERT(from && to);
-    return new ShadowData(blendFunc(anim, from->x, to->x, progress), blendFunc(anim, from->y, to->y, progress), 
-                          blendFunc(anim, from->blur, to->blur, progress), blendFunc(anim, from->spread, to->spread, progress),
-                          blendFunc(anim, from->style, to->style, progress), blendFunc(anim, from->color, to->color, progress));
+    return new ShadowData(blendFunc(anim, from->x(), to->x(), progress), blendFunc(anim, from->y(), to->y(), progress), 
+                          blendFunc(anim, from->blur(), to->blur(), progress), blendFunc(anim, from->spread(), to->spread(), progress),
+                          blendFunc(anim, from->style(), to->style(), progress), blendFunc(anim, from->color(), to->color(), progress));
 }
 
 static inline TransformOperations blendFunc(const AnimationBase* anim, const TransformOperations& from, const TransformOperations& to, double progress)
@@ -297,18 +296,19 @@
 };
 #endif // USE(ACCELERATED_COMPOSITING)
 
-class PropertyWrapperShadow : public PropertyWrapperGetter<ShadowData*> {
+class PropertyWrapperShadow : public PropertyWrapperBase {
 public:
-    PropertyWrapperShadow(int prop, ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(ShadowData*, bool))
-        : PropertyWrapperGetter<ShadowData*>(prop, getter)
+    PropertyWrapperShadow(int prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(ShadowData*, bool))
+        : PropertyWrapperBase(prop)
+        , m_getter(getter)
         , m_setter(setter)
     {
     }
 
     virtual bool equals(const RenderStyle* a, const RenderStyle* b) const
     {
-        ShadowData* shadowA = (a->*m_getter)();
-        ShadowData* shadowB = (b->*m_getter)();
+        const ShadowData* shadowA = (a->*m_getter)();
+        const ShadowData* shadowB = (b->*m_getter)();
         
         while (true) {
             if (!shadowA && !shadowB)   // end of both lists
@@ -320,8 +320,8 @@
             if (*shadowA != *shadowB)
                 return false;
         
-            shadowA = shadowA->next;
-            shadowB = shadowB->next;
+            shadowA = shadowA->next();
+            shadowB = shadowB->next();
         }
 
         return true;
@@ -329,29 +329,30 @@
 
     virtual void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const
     {
-        ShadowData* shadowA = (a->*m_getter)();
-        ShadowData* shadowB = (b->*m_getter)();
+        const ShadowData* shadowA = (a->*m_getter)();
+        const ShadowData* shadowB = (b->*m_getter)();
         ShadowData defaultShadowData(0, 0, 0, 0, Normal, Color::transparent);
 
         ShadowData* newShadowData = 0;
         
         while (shadowA || shadowB) {
-            ShadowData* srcShadow = shadowA ? shadowA : &defaultShadowData;
-            ShadowData* dstShadow = shadowB ? shadowB : &defaultShadowData;
+            const ShadowData* srcShadow = shadowA ? shadowA : &defaultShadowData;
+            const ShadowData* dstShadow = shadowB ? shadowB : &defaultShadowData;
             
             if (!newShadowData)
                 newShadowData = blendFunc(anim, srcShadow, dstShadow, progress);
             else
-                newShadowData->next = blendFunc(anim, srcShadow, dstShadow, progress);
+                newShadowData->setNext(blendFunc(anim, srcShadow, dstShadow, progress));
 
-            shadowA = shadowA ? shadowA->next : 0;
-            shadowB = shadowB ? shadowB->next : 0;
+            shadowA = shadowA ? shadowA->next() : 0;
+            shadowB = shadowB ? shadowB->next() : 0;
         }
         
         (dst->*m_setter)(newShadowData, false);
     }
 
 private:
+    const ShadowData* (RenderStyle::*m_getter)() const;
     void (RenderStyle::*m_setter)(ShadowData*, bool);
 };
 
@@ -918,8 +919,8 @@
     // Execute state machine
     switch (m_animState) {
         case AnimationStateNew:
-            ASSERT(input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunnning || input == AnimationStateInputPlayStatePaused);
-            if (input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunnning) {
+            ASSERT(input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunning || input == AnimationStateInputPlayStatePaused);
+            if (input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunning) {
                 m_requestedStartTime = beginAnimationUpdateTime();
                 m_animState = AnimationStateStartWaitTimer;
             }
@@ -1021,6 +1022,7 @@
             ASSERT(input == AnimationStateInputEndTimerFired || input == AnimationStateInputPlayStatePaused);
 
             if (input == AnimationStateInputEndTimerFired) {
+
                 ASSERT(param >= 0);
                 // End timer fired, finish up
                 onAnimationEnd(param);
@@ -1028,7 +1030,10 @@
                 m_animState = AnimationStateDone;
                 
                 if (m_object) {
-                    resumeOverriddenAnimations();
+                    if (m_animation->fillsForwards())
+                        m_animState = AnimationStateFillingForwards;
+                    else
+                        resumeOverriddenAnimations();
 
                     // Fire off another style change so we can set the final value
                     m_compAnim->animationController()->addNodeChangeToDispatch(m_object->node());
@@ -1042,7 +1047,7 @@
             // |this| may be deleted here
             break;
         case AnimationStatePausedWaitTimer:
-            ASSERT(input == AnimationStateInputPlayStateRunnning);
+            ASSERT(input == AnimationStateInputPlayStateRunning);
             ASSERT(paused());
             // Update the times
             m_startTime += beginAnimationUpdateTime() - m_pauseTime;
@@ -1058,7 +1063,7 @@
             // AnimationStatePausedWaitResponse, we don't yet have a valid startTime, so we send 0 to startAnimation.
             // When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice
             // that we have already set the startTime and will ignore it.
-            ASSERT(input == AnimationStateInputPlayStateRunnning || input == AnimationStateInputStartTimeSet);
+            ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet);
             ASSERT(paused());
             
             // If we are paused, but we get the callback that notifies us that an accelerated animation started,
@@ -1093,6 +1098,7 @@
                 m_fallbackAnimating = !started;
             }
             break;
+        case AnimationStateFillingForwards:
         case AnimationStateDone:
             // We're done. Stay in this state until we are deleted
             break;
@@ -1152,14 +1158,14 @@
 void AnimationBase::updatePlayState(bool run)
 {
     if (paused() == run || isNew())
-        updateStateMachine(run ? AnimationStateInputPlayStateRunnning : AnimationStateInputPlayStatePaused, -1);
+        updateStateMachine(run ? AnimationStateInputPlayStateRunning : AnimationStateInputPlayStatePaused, -1);
 }
 
 double AnimationBase::timeToNextService()
 {
     // Returns the time at which next service is required. -1 means no service is required. 0 means 
     // service is required now, and > 0 means service is required that many seconds in the future.
-    if (paused() || isNew())
+    if (paused() || isNew() || m_animState == AnimationStateFillingForwards)
         return -1;
     
     if (m_animState == AnimationStateStartWaitTimer) {
@@ -1184,8 +1190,10 @@
     if (m_animation->iterationCount() > 0)
         dur *= m_animation->iterationCount();
 
-    if (postActive() || !m_animation->duration() || (m_animation->iterationCount() > 0 && elapsedTime >= dur))
+    if (postActive() || !m_animation->duration())
         return 1.0;
+    if (m_animation->iterationCount() > 0 && elapsedTime >= dur)
+        return (m_animation->iterationCount() % 2) ? 1.0 : 0.0;
 
     // Compute the fractional time, taking into account direction.
     // There is no need to worry about iterations, we assume that we would have
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index c367e0a..a957119 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -71,7 +71,8 @@
         AnimationStatePausedWaitTimer,      // in pause mode when animation started
         AnimationStatePausedWaitResponse,   // animation paused when in STARTING state
         AnimationStatePausedRun,            // animation paused when in LOOPING or ENDING state
-        AnimationStateDone                  // end timer fired, animation finished and removed
+        AnimationStateDone,                 // end timer fired, animation finished and removed
+        AnimationStateFillingForwards       // animation has ended and is retaining its final value
     };
 
     enum AnimStateInput {
@@ -85,7 +86,7 @@
         AnimationStateInputEndTimerFired,     // end timer fired
         AnimationStateInputPauseOverride,     // pause an animation due to override
         AnimationStateInputResumeOverride,    // resume an overridden animation
-        AnimationStateInputPlayStateRunnning, // play state paused -> running
+        AnimationStateInputPlayStateRunning,  // play state paused -> running
         AnimationStateInputPlayStatePaused,   // play state running -> paused
         AnimationStateInputEndAnimation       // force an end from any state
     };
diff --git a/WebCore/page/animation/AnimationController.cpp b/WebCore/page/animation/AnimationController.cpp
index 422c154..cb609a5 100644
--- a/WebCore/page/animation/AnimationController.cpp
+++ b/WebCore/page/animation/AnimationController.cpp
@@ -134,6 +134,9 @@
 
 void AnimationControllerPrivate::updateStyleIfNeededDispatcherFired(Timer<AnimationControllerPrivate>*)
 {
+    // Protect the frame from getting destroyed in the event handler
+    RefPtr<Frame> protector = m_frame;
+
     // fire all the events
     Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = m_eventsToDispatch.end();
     for (Vector<EventToDispatch>::const_iterator it = m_eventsToDispatch.begin(); it != eventsToDispatchEnd; ++it) {
diff --git a/WebCore/page/animation/CompositeAnimation.cpp b/WebCore/page/animation/CompositeAnimation.cpp
index 34f03c7..0f238fd 100644
--- a/WebCore/page/animation/CompositeAnimation.cpp
+++ b/WebCore/page/animation/CompositeAnimation.cpp
@@ -233,7 +233,7 @@
                     keyframeAnim->setAnimation(anim);
                     keyframeAnim->setIndex(i);
                 } else if ((anim->duration() || anim->delay()) && anim->iterationCount()) {
-                    keyframeAnim = KeyframeAnimation::create(const_cast<Animation*>(anim), renderer, i, this, currentStyle ? currentStyle : targetStyle);
+                    keyframeAnim = KeyframeAnimation::create(const_cast<Animation*>(anim), renderer, i, this, targetStyle);
                     m_keyframeAnimations.set(keyframeAnim->name().impl(), keyframeAnim);
                 }
                 
diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp
index c5e3660..4c2cbc8 100644
--- a/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/WebCore/page/animation/KeyframeAnimation.cpp
@@ -68,6 +68,11 @@
     double elapsedTime = getElapsedTime();
 
     double t = m_animation->duration() ? (elapsedTime / m_animation->duration()) : 1;
+
+    ASSERT(t >= 0);
+    if (t < 0)
+        t = 0;
+
     int i = static_cast<int>(t);
     t -= i;
     if (m_animation->direction() && (i & 1))
@@ -120,9 +125,11 @@
     }
 
     // If we are waiting for the start timer, we don't want to change the style yet.
-    // Special case - if the delay time is 0, then we do want to set the first frame of the
+    // Special case 1 - if the delay time is 0, then we do want to set the first frame of the
     // animation right away. This avoids a flash when the animation starts.
-    if (waitingToStart() && m_animation->delay() > 0)
+    // Special case 2 - if there is a backwards fill mode, then we want to continue
+    // through to the style blend so that we get the fromStyle.
+    if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards())
         return;
 
     // FIXME: we need to be more efficient about determining which keyframes we are animating between.
@@ -163,6 +170,11 @@
 
 void KeyframeAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle)
 {
+    // If we're in the delay phase and we're not backwards filling, tell the caller
+    // to use the current style.
+    if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards())
+        return;
+
     // Get the from/to styles and progress between
     const RenderStyle* fromStyle = 0;
     const RenderStyle* toStyle = 0;
@@ -260,7 +272,10 @@
 void KeyframeAnimation::onAnimationEnd(double elapsedTime)
 {
     sendAnimationEvent(eventNames().webkitAnimationEndEvent, elapsedTime);
-    endAnimation();
+    // End the animation if we don't fill forwards. Forward filling
+    // animations are ended properly in the class destructor.
+    if (!m_animation->fillsForwards())
+        endAnimation();
 }
 
 bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double elapsedTime)
diff --git a/WebCore/page/brew/EventHandlerBrew.cpp b/WebCore/page/brew/EventHandlerBrew.cpp
new file mode 100644
index 0000000..e3b6645
--- /dev/null
+++ b/WebCore/page/brew/EventHandlerBrew.cpp
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc.
+ * Copyright 2009, The Android Open Source Project
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * 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 COMPUTER, 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 "EventHandler.h"
+
+#include "ClipboardBrew.h"
+#include "EventNames.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "HitTestResult.h"
+#include "KeyboardEvent.h"
+#include "MouseEventWithHitTestResults.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformWheelEvent.h"
+#include "RenderWidget.h"
+
+namespace WebCore {
+
+bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
+{
+    return true;
+}
+
+void EventHandler::focusDocumentView()
+{
+    Page* page = m_frame->page();
+    if (page)
+        page->focusController()->setFocusedFrame(m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+    // Figure out which view to send the event to.
+    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
+    if (!target || !target->isWidget())
+        return false;
+    return passMouseDownEventToWidget(toRenderWidget(target)->widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+    return passMouseDownEventToWidget(renderWidget->widget());
+}
+
+// This function is used to route the mouse down event to the native widgets, it seems like a
+// work around for the Mac platform which does not support double clicks, but browsers do.
+bool EventHandler::passMouseDownEventToWidget(Widget* widget)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+{
+    notImplemented();
+    return false;
+}
+
+// This function is called for mouse events by FrameView::handleMousePressEvent().
+// It is used to ensure that events are sync'ed correctly between frames. For example
+// if the user presses down in one frame and up in another frame, this function will
+// returns true, and pass the event to the correct frame.
+bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe, HitTestResult*)
+{
+    notImplemented();
+    return false;
+}
+
+// This is called to route wheel events to child widgets when they are RenderWidget
+// as the parent usually gets wheel event. Don't have a mouse with a wheel to confirm
+// the operation of this function.
+bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+    return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+unsigned EventHandler::accessKeyModifiers()
+{
+    return PlatformKeyboardEvent::AltKey;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h
index fc42250..e897c15 100644
--- a/WebCore/page/chromium/ChromeClientChromium.h
+++ b/WebCore/page/chromium/ChromeClientChromium.h
@@ -48,7 +48,10 @@
     // If handleExternal is true, then drawing and input handling for the
     // popup will be handled by the external embedder.
     virtual void popupOpened(PopupContainer* popupContainer, const IntRect& bounds,
-                             bool focusOnShow, bool handleExternal) = 0;
+                             bool handleExternal) = 0;
+                             
+    // Notifies the client a popup was closed.
+    virtual void popupClosed(PopupContainer* popupContainer) = 0;
 
     // Notifies embedder that the state of an accessibility object has changed.
     virtual void didChangeAccessibilityObjectState(AccessibilityObject*) = 0;
diff --git a/WebCore/page/chromium/DragControllerChromium.cpp b/WebCore/page/chromium/DragControllerChromium.cpp
index 7b0958d..de53d19 100644
--- a/WebCore/page/chromium/DragControllerChromium.cpp
+++ b/WebCore/page/chromium/DragControllerChromium.cpp
@@ -66,7 +66,12 @@
     
 const IntSize& DragController::maxDragImageSize()
 {
+#if OS(DARWIN)
+    // Match Safari's drag image size.
+    static const IntSize maxDragImageSize(400, 400);
+#else
     static const IntSize maxDragImageSize(200, 200);
+#endif
     return maxDragImageSize;
 }
 
diff --git a/WebCore/page/efl/DragControllerEfl.cpp b/WebCore/page/efl/DragControllerEfl.cpp
new file mode 100644
index 0000000..0c5f002
--- /dev/null
+++ b/WebCore/page/efl/DragControllerEfl.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2007 Apple Inc.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * 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 COMPUTER, 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 "DragController.h"
+
+#include "DragData.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "Page.h"
+
+namespace WebCore {
+
+const int DragController::LinkDragBorderInset = 2;
+const int DragController::MaxOriginalImageArea = 1500 * 1500;
+const int DragController::DragIconRightInset = 7;
+const int DragController::DragIconBottomInset = 3;
+
+const float DragController::DragImageAlpha = 0.75f;
+
+bool DragController::isCopyKeyDown()
+{
+    return false;
+}
+
+DragOperation DragController::dragOperation(DragData* dragData)
+{
+    if (dragData->containsURL())
+        return DragOperationCopy;
+
+    return DragOperationNone;
+}
+
+const IntSize& DragController::maxDragImageSize()
+{
+    static const IntSize maxDragImageSize(400, 400);
+
+    return maxDragImageSize;
+}
+
+void DragController::cleanupAfterSystemDrag()
+{}
+
+}
diff --git a/WebCore/page/efl/EventHandlerEfl.cpp b/WebCore/page/efl/EventHandlerEfl.cpp
new file mode 100644
index 0000000..df5c276
--- /dev/null
+++ b/WebCore/page/efl/EventHandlerEfl.cpp
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009,2010 ProFUSION embedded systems
+ * Copyright (C) 2009,2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "EventHandler.h"
+
+#include "ClipboardEfl.h"
+#include "EventNames.h"
+#include "FloatPoint.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "KeyboardEvent.h"
+#include "MouseEventWithHitTestResults.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformWheelEvent.h"
+#include "RenderWidget.h"
+#include "Scrollbar.h"
+
+namespace WebCore {
+
+const double EventHandler::TextDragDelay = 0.0;
+
+static bool isKeyboardOptionTab(KeyboardEvent* event)
+{
+    return event
+        && (event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent)
+        && event->altKey()
+        && event->keyIdentifier() == "U+0009";
+}
+
+bool EventHandler::invertSenseOfTabsToLinks(KeyboardEvent* event) const
+{
+    return isKeyboardOptionTab(event);
+}
+
+bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
+{
+    return true;
+}
+
+void EventHandler::focusDocumentView()
+{
+    if (Page* page = m_frame->page())
+        page->focusController()->setFocusedFrame(m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
+
+    if (!target || !target->isWidget())
+        return false;
+
+    return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+    return passMouseDownEventToWidget(renderWidget->widget());
+}
+
+bool EventHandler::passMouseDownEventToWidget(Widget* widget)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+{
+    ASSERT(widget);
+    if (!widget->isFrameView())
+        return false;
+
+    return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(event);
+}
+
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
+{
+    return new ClipboardEfl(ClipboardWritable, true);
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    subframe->eventHandler()->handleMousePressEvent(mev.event());
+    return true;
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+    subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode);
+    return true;
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    subframe->eventHandler()->handleMouseReleaseEvent(mev.event());
+    return true;
+}
+
+unsigned EventHandler::accessKeyModifiers()
+{
+    return PlatformKeyboardEvent::AltKey;
+}
+}
diff --git a/WebCore/page/efl/FrameEfl.cpp b/WebCore/page/efl/FrameEfl.cpp
new file mode 100644
index 0000000..783df7e
--- /dev/null
+++ b/WebCore/page/efl/FrameEfl.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "Frame.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+DragImageRef Frame::dragImageForSelection()
+{
+    notImplemented();
+    return 0;
+}
+
+}
diff --git a/WebCore/page/haiku/EventHandlerHaiku.cpp b/WebCore/page/haiku/EventHandlerHaiku.cpp
index 203344e..450414d 100644
--- a/WebCore/page/haiku/EventHandlerHaiku.cpp
+++ b/WebCore/page/haiku/EventHandlerHaiku.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
  * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,7 +40,6 @@
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
-#include "PlatformScrollBar.h"
 #include "PlatformWheelEvent.h"
 #include "RenderWidget.h"
 
@@ -56,7 +56,7 @@
         && (event->type() == eventNames().keydownEvent
             || event->type() == eventNames().keypressEvent)
         && event->altKey()
-        && event->keyIdentifier() == "U+000009";
+        && event->keyIdentifier() == "U+0009";
 }
 
 bool EventHandler::invertSenseOfTabsToLinks(KeyboardEvent* event) const
@@ -74,8 +74,10 @@
 void EventHandler::focusDocumentView()
 {
     BView* view = m_frame->view()->platformWidget();
-    if (view)
-        view->MakeFocus();
+    if (view && view->LockLooperWithTimeout(5000) == B_OK) {
+        view->MakeFocus(true);
+        view->UnlockLooper();
+    }
 
     Page* page = m_frame->page();
     if (page)
@@ -102,18 +104,14 @@
     return false;
 }
 
-bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
 {
-    notImplemented();
+    // On Haiku, clicks which activate the window in non focus-follows-mouse mode
+    // are not passed to the window, so any event we generate is not the activation
+    // event.
     return false;
 }
 
-bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe, HitTestResult*)
-{
-    notImplemented();
-    return true;
-}
-
 bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
 {
     if (!widget->isFrameView())
@@ -129,21 +127,27 @@
 
 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
 {
-    return passSubframeEventToSubframe(mev, subframe);
+    subframe->eventHandler()->handleMousePressEvent(mev.event());
+    return true;
 }
 
 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
 {
-    return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+    subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode);
+    return true;
 }
 
 bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
 {
-    return passSubframeEventToSubframe(mev, subframe);
+    subframe->eventHandler()->handleMouseReleaseEvent(mev.event());
+    return true;
 }
 
 unsigned EventHandler::accessKeyModifiers()
 {
+    // NOTE: On Haiku, the user can choose Alt or Ctrl as access key, but
+    // the PlatformKeyboardEvent already takes care of this, internally,
+    // we always use Alt.
     return PlatformKeyboardEvent::AltKey;
 }
 
diff --git a/WebCore/page/mac/FrameMac.mm b/WebCore/page/mac/FrameMac.mm
index 9e77387..356503f 100644
--- a/WebCore/page/mac/FrameMac.mm
+++ b/WebCore/page/mac/FrameMac.mm
@@ -416,12 +416,12 @@
     if (style->color().isValid() && style->color() != Color::black)
         [result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
 
-    ShadowData* shadow = style->textShadow();
+    const ShadowData* shadow = style->textShadow();
     if (shadow) {
         NSShadow* s = [[NSShadow alloc] init];
-        [s setShadowOffset:NSMakeSize(shadow->x, shadow->y)];
-        [s setShadowBlurRadius:shadow->blur];
-        [s setShadowColor:nsColor(shadow->color)];
+        [s setShadowOffset:NSMakeSize(shadow->x(), shadow->y())];
+        [s setShadowBlurRadius:shadow->blur()];
+        [s setShadowColor:nsColor(shadow->color())];
         [result setObject:s forKey:NSShadowAttributeName];
     }
 
diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h
index fef856a..db70b6d 100644
--- a/WebCore/page/mac/WebCoreViewFactory.h
+++ b/WebCore/page/mac/WebCoreViewFactory.h
@@ -142,6 +142,9 @@
 - (NSString *)AXMenuListPopupActionVerb;
 - (NSString *)AXMenuListActionVerb;
 
+- (NSString *)missingPluginText;
+- (NSString *)crashedPluginText;
+
 - (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles;
 // FTP Directory Related
 - (NSString *)unknownFileSizeText;
diff --git a/WebCore/page/qt/EventHandlerQt.cpp b/WebCore/page/qt/EventHandlerQt.cpp
index 3425289..d7982fa 100644
--- a/WebCore/page/qt/EventHandlerQt.cpp
+++ b/WebCore/page/qt/EventHandlerQt.cpp
@@ -132,7 +132,11 @@
 
 unsigned EventHandler::accessKeyModifiers()
 {
-    return PlatformKeyboardEvent::CtrlKey;
+#if OS(DARWIN)
+    return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
+#else
+    return PlatformKeyboardEvent::AltKey;
+#endif
 }
 
 }
diff --git a/WebCore/page/win/PageWin.cpp b/WebCore/page/win/PageWin.cpp
deleted file mode 100644
index 3ef7728..0000000
--- a/WebCore/page/win/PageWin.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 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 COMPUTER, 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 "Page.h"
-
-namespace WebCore {
-
-HINSTANCE Page::s_instanceHandle = 0;
-
-} // namespace WebCore
diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp
index 236279e..8ca40f5 100644
--- a/WebCore/platform/ContextMenu.cpp
+++ b/WebCore/platform/ContextMenu.cpp
@@ -34,7 +34,6 @@
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSProperty.h"
 #include "CSSPropertyNames.h"
-#include "CString.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Editor.h"
@@ -49,7 +48,7 @@
 #include "SelectionController.h"
 #include "Settings.h"
 #include "TextIterator.h"
-#include <memory>
+#include <wtf/text/CString.h>
 
 using namespace std;
 using namespace WTF;
@@ -66,9 +65,9 @@
     return 0;
 }
 
-static auto_ptr<ContextMenuItem> separatorItem()
+static PassOwnPtr<ContextMenuItem> separatorItem()
 {
-    return auto_ptr<ContextMenuItem>(new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String()));
+    return new ContextMenuItem(SeparatorType, ContextMenuItemTagNoAction, String());
 }
 
 static void createAndAppendFontSubMenu(const HitTestResult& result, ContextMenuItem& fontMenuItem)
@@ -103,7 +102,7 @@
     fontMenuItem.setSubMenu(&fontMenu);
 }
 
-#ifndef BUILDING_ON_TIGER
+#if !defined(BUILDING_ON_TIGER) && !PLATFORM(GTK)
 static void createAndAppendSpellingAndGrammarSubMenu(const HitTestResult& result, ContextMenuItem& spellingAndGrammarMenuItem)
 {
     ContextMenu spellingAndGrammarMenu(result);
@@ -360,6 +359,9 @@
                 appendItem(SpeechMenuItem);
 #endif                
             } else {
+#if ENABLE(INSPECTOR)
+                if (!(frame->page() && frame->page()->inspectorController()->hasInspectorFrontendClient())) {
+#endif
 #if PLATFORM(GTK)
                 appendItem(BackItem);
                 appendItem(ForwardItem);
@@ -379,6 +381,9 @@
                 else
                     appendItem(ReloadItem);
 #endif
+#if ENABLE(INSPECTOR)
+                }
+#endif
 
                 if (frame->page() && frame != frame->page()->mainFrame())
                     appendItem(OpenFrameItem);
@@ -551,7 +556,6 @@
         return;
 
     ContextMenuItem InspectElementItem(ActionType, ContextMenuItemTagInspectElement, contextMenuItemTagInspectElement());
-    appendItem(*separatorItem());
     appendItem(InspectElementItem);
 }
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/platform/CrossThreadCopier.h b/WebCore/platform/CrossThreadCopier.h
index 0a9aeeb..e35a6b3 100644
--- a/WebCore/platform/CrossThreadCopier.h
+++ b/WebCore/platform/CrossThreadCopier.h
@@ -31,7 +31,6 @@
 #ifndef CrossThreadCopier_h
 #define CrossThreadCopier_h
 
-#include <memory>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
@@ -88,14 +87,6 @@
         }
     };
 
-    template<typename T> struct CrossThreadCopierBase<false, false, std::auto_ptr<T> > {
-        typedef std::auto_ptr<T> Type;
-        static Type copy(const std::auto_ptr<T>& autoPtr)
-        {
-            return std::auto_ptr<T>(*const_cast<std::auto_ptr<T>*>(&autoPtr));
-        }
-    };
-
     template<> struct CrossThreadCopierBase<false, false, KURL> {
         typedef KURL Type;
         static Type copy(const KURL&);
@@ -112,12 +103,12 @@
     };
 
     template<> struct CrossThreadCopierBase<false, false, ResourceRequest> {
-        typedef std::auto_ptr<CrossThreadResourceRequestData> Type;
+        typedef PassOwnPtr<CrossThreadResourceRequestData> Type;
         static Type copy(const ResourceRequest&);
     };
 
     template<> struct CrossThreadCopierBase<false, false, ResourceResponse> {
-        typedef std::auto_ptr<CrossThreadResourceResponseData> Type;
+        typedef PassOwnPtr<CrossThreadResourceResponseData> Type;
         static Type copy(const ResourceResponse&);
     };
 
diff --git a/WebCore/platform/Cursor.h b/WebCore/platform/Cursor.h
index ae8043e..76f19e9 100644
--- a/WebCore/platform/Cursor.h
+++ b/WebCore/platform/Cursor.h
@@ -26,8 +26,6 @@
 #ifndef Cursor_h
 #define Cursor_h
 
-#include <wtf/Platform.h>
-
 #if PLATFORM(WIN)
 typedef struct HICON__* HICON;
 typedef HICON HCURSOR;
@@ -84,6 +82,9 @@
 #elif PLATFORM(GTK)
     typedef GdkCursor* PlatformCursor;
     typedef GdkCursor* PlatformCursorHandle;
+#elif PLATFORM(EFL)
+    typedef const char* PlatformCursor;
+    typedef const char* PlatformCursorHandle;
 #elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
     typedef QCursor PlatformCursor;
     typedef QCursor* PlatformCursorHandle;
@@ -104,7 +105,7 @@
     class Cursor {
     public:
         Cursor()
-#if !PLATFORM(QT)
+#if !PLATFORM(QT) && !PLATFORM(EFL)
         : m_impl(0)
 #endif
         { }
diff --git a/WebCore/platform/DragData.h b/WebCore/platform/DragData.h
index 116ffdd..53f320e 100644
--- a/WebCore/platform/DragData.h
+++ b/WebCore/platform/DragData.h
@@ -61,6 +61,8 @@
 #elif PLATFORM(HAIKU)
 class BMessage;
 typedef class BMessage* DragDataRef;
+#elif PLATFORM(EFL)
+typedef void* DragDataRef;
 #endif
 
 
diff --git a/WebCore/platform/DragImage.h b/WebCore/platform/DragImage.h
index 3045e03..b905432 100644
--- a/WebCore/platform/DragImage.h
+++ b/WebCore/platform/DragImage.h
@@ -80,7 +80,11 @@
     typedef BBitmap* DragImageRef;
 #elif PLATFORM(BREWMP)
     typedef IImage* DragImageRef;
+<<<<<<< HEAD
 #elif PLATFORM(ANDROID)
+=======
+#elif PLATFORM(EFL)
+>>>>>>> webkit.org at r58033
     typedef void* DragImageRef;
 #endif
     
diff --git a/WebCore/platform/FileChooser.cpp b/WebCore/platform/FileChooser.cpp
index a2d4770..90dd567 100644
--- a/WebCore/platform/FileChooser.cpp
+++ b/WebCore/platform/FileChooser.cpp
@@ -39,9 +39,11 @@
 
 inline FileChooser::FileChooser(FileChooserClient* client, const Vector<String>& initialFilenames)
     : m_client(client)
+    , m_isInitializing(true)
 {
     m_filenames = initialFilenames;
     loadIcon();
+    m_isInitializing = false;
 }
 
 PassRefPtr<FileChooser> FileChooser::create(FileChooserClient* client, const Vector<String>& initialFilenames)
@@ -78,16 +80,14 @@
 
 void FileChooser::loadIcon()
 {
-    m_icon = Icon::createIconForFiles(m_filenames);
-    // If synchronous icon loading failed, try asynchronous loading.
-    if (!m_icon && m_filenames.size() && m_client)
-        m_client->iconForFiles(m_filenames);
+    if (m_filenames.size() && m_client)
+        m_client->chooseIconForFiles(this, m_filenames);
 }
 
 void FileChooser::iconLoaded(PassRefPtr<Icon> icon)
 {
     m_icon = icon;
-    if (m_icon && m_client)
+    if (!m_isInitializing && m_icon && m_client)
         m_client->repaint();
 }
 
diff --git a/WebCore/platform/FileChooser.h b/WebCore/platform/FileChooser.h
index e7feb3e..e93b9ac 100644
--- a/WebCore/platform/FileChooser.h
+++ b/WebCore/platform/FileChooser.h
@@ -35,6 +35,7 @@
 
 namespace WebCore {
 
+class FileChooser;
 class Font;
 class Icon;
 
@@ -44,7 +45,7 @@
     virtual void repaint() = 0;
     virtual bool allowsMultipleFiles() = 0;
     virtual String acceptTypes() = 0;
-    virtual void iconForFiles(const Vector<String>&) = 0;
+    virtual void chooseIconForFiles(FileChooser*, const Vector<String>&) = 0;
     virtual ~FileChooserClient();
 };
 
@@ -79,6 +80,7 @@
     FileChooserClient* m_client;
     Vector<String> m_filenames;
     RefPtr<Icon> m_icon;
+    bool m_isInitializing;
 };
 
 } // namespace WebCore
diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h
index c5395a9..39c79bb4 100644
--- a/WebCore/platform/FileSystem.h
+++ b/WebCore/platform/FileSystem.h
@@ -26,7 +26,7 @@
  * (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 FileSystem_h
 #define FileSystem_h
 
@@ -45,12 +45,9 @@
 #include <CoreFoundation/CFBundle.h>
 #endif
 
-#include <time.h>
-
-#include <wtf/Platform.h>
-#include <wtf/Vector.h>
-
 #include "PlatformString.h"
+#include <time.h>
+#include <wtf/Vector.h>
 
 typedef const struct __CFData* CFDataRef;
 
@@ -62,9 +59,12 @@
 typedef HINSTANCE HMODULE;
 #endif
 
-namespace WebCore {
-
+namespace WTF {
 class CString;
+}
+using WTF::CString;
+
+namespace WebCore {
 
 // PlatformModule
 #if OS(WINDOWS)
@@ -72,9 +72,11 @@
 #elif PLATFORM(QT)
 #if defined(Q_WS_MAC)
 typedef CFBundleRef PlatformModule;
-#else
+#elif !defined(QT_NO_LIBRARY)
 typedef QLibrary* PlatformModule;
-#endif // defined(Q_WS_MAC)
+#else
+typedef void* PlatformModule;
+#endif
 #elif PLATFORM(GTK)
 typedef GModule* PlatformModule;
 #elif PLATFORM(CF)
@@ -120,6 +122,17 @@
 const PlatformFileHandle invalidPlatformFileHandle = -1;
 #endif
 
+enum FileOpenMode {
+    OpenForRead = 0,
+    OpenForWrite
+};
+
+enum FileSeekOrigin {
+    SeekFromBeginning = 0,
+    SeekFromCurrent,
+    SeekFromEnd
+};
+
 bool fileExists(const String&);
 bool deleteFile(const String&);
 bool deleteEmptyDirectory(const String&);
@@ -133,14 +146,21 @@
 
 Vector<String> listDirectory(const String& path, const String& filter = String());
 
-CString fileSystemRepresentation(const String&);
+WTF::CString fileSystemRepresentation(const String&);
 
 inline bool isHandleValid(const PlatformFileHandle& handle) { return handle != invalidPlatformFileHandle; }
 
 // Prefix is what the filename should be prefixed with, not the full path.
-CString openTemporaryFile(const char* prefix, PlatformFileHandle&);
+WTF::CString openTemporaryFile(const char* prefix, PlatformFileHandle&);
+PlatformFileHandle openFile(const String& path, FileOpenMode);
 void closeFile(PlatformFileHandle&);
+// Returns the resulting offset from the beginning of the file if successful, -1 otherwise.
+long long seekFile(PlatformFileHandle, long long offset, FileSeekOrigin);
+bool truncateFile(PlatformFileHandle, long long offset);
+// Returns number of bytes actually read if successful, -1 otherwise.
 int writeToFile(PlatformFileHandle, const char* data, int length);
+// Returns number of bytes actually written if successful, -1 otherwise.
+int readFromFile(PlatformFileHandle, char* data, int length);
 
 // Methods for dealing with loadable modules
 bool unloadModule(PlatformModule);
@@ -162,6 +182,10 @@
 String pathGetDisplayFileName(const String&);
 #endif
 
+#if PLATFORM(EFL)
+char *filenameFromString(const String&);
+#endif
+
 } // namespace WebCore
 
 #endif // FileSystem_h
diff --git a/WebCore/platform/FloatConversion.h b/WebCore/platform/FloatConversion.h
index 9b26597..655ab44 100644
--- a/WebCore/platform/FloatConversion.h
+++ b/WebCore/platform/FloatConversion.h
@@ -29,7 +29,6 @@
 #ifndef FloatConversion_h
 #define FloatConversion_h
 
-#include <wtf/Platform.h>
 #if PLATFORM(CG)
 #include <CoreGraphics/CGBase.h>
 #endif
diff --git a/WebCore/platform/GeolocationService.cpp b/WebCore/platform/GeolocationService.cpp
index 7e1f755..4676006 100644
--- a/WebCore/platform/GeolocationService.cpp
+++ b/WebCore/platform/GeolocationService.cpp
@@ -49,6 +49,7 @@
     return (*s_factoryFunction)(client);
 }
 
+#if ENABLE(GEOLOCATION)
 void GeolocationService::useMock()
 {
     s_factoryFunction = &GeolocationServiceMock::create;
@@ -70,4 +71,6 @@
     m_geolocationServiceClient->geolocationServiceErrorOccurred(this);
 }
 
+#endif
+
 } // namespace WebCore
diff --git a/WebCore/platform/HostWindow.h b/WebCore/platform/HostWindow.h
index 80f6bdc..dc681a1 100644
--- a/WebCore/platform/HostWindow.h
+++ b/WebCore/platform/HostWindow.h
@@ -35,14 +35,17 @@
 public:
     virtual ~HostWindow() { }
 
-    // The repaint method asks the host window to repaint a rect in the window's coordinate space.  The
-    // contentChanged boolean indicates whether or not the Web page content actually changed (or if a repaint
-    // of unchanged content is being requested).
-    virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;
+    // Requests the host invalidate the window, not the contents.  If immediate is true do so synchronously, otherwise async.
+    virtual void invalidateWindow(const IntRect& updateRect, bool immediate) = 0;
+
+    // Requests the host invalidate the contents and the window.  If immediate is true do so synchronously, otherwise async.
+    virtual void invalidateContentsAndWindow(const IntRect& updateRect, bool immediate) = 0;
+
+    // Requests the host scroll backingstore by the specified delta, rect to scroll, and clip rect.
     virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
 
-    // The paint method just causes a synchronous update of the window to happen for platforms that need it (Windows).
-    void paint() { repaint(IntRect(), false, true); }
+    // Requests the host invalidate the contents, not the window.  This is the slow path for scrolling.
+    virtual void invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate) = 0;
     
     // Methods for doing coordinate conversions to and from screen coordinates.
     virtual IntPoint screenToWindow(const IntPoint&) const = 0;
diff --git a/WebCore/platform/KURL.cpp b/WebCore/platform/KURL.cpp
index 79bb6e2..12ba4a2 100644
--- a/WebCore/platform/KURL.cpp
+++ b/WebCore/platform/KURL.cpp
@@ -29,9 +29,9 @@
 
 #include "KURL.h"
 
-#include "CString.h"
 #include "StringHash.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 #include <wtf/HashMap.h>
 #include <wtf/StdLibExtras.h>
 
@@ -41,7 +41,7 @@
 #include <QUrl>
 #elif USE(GLIB_UNICODE)
 #include <glib.h>
-#include <wtf/gtk/GOwnPtr.h>
+#include "GOwnPtr.h"
 #endif
 
 #include <stdio.h>
@@ -215,6 +215,9 @@
     /* 252 */ BadChar, /* 253 */ BadChar, /* 254 */ BadChar, /* 255 */ BadChar
 };
 
+static const unsigned maximumValidPortNumber = 0xFFFE;
+static const unsigned invalidPortNumber = 0xFFFF;
+
 static int copyPathRemovingDots(char* dst, const char* src, int srcStart, int srcEnd);
 static void encodeRelativeString(const String& rel, const TextEncoding&, CharBuffer& ouput);
 static String substituteBackslashes(const String&);
@@ -573,12 +576,17 @@
 
 unsigned short KURL::port() const
 {
-    if (m_hostEnd == m_portEnd)
+    // We return a port of 0 if there is no port specified. This can happen in two situations:
+    // 1) The URL contains no colon after the host name and before the path component of the URL.
+    // 2) The URL contains a colon but there's no port number before the path component of the URL begins.
+    if (m_hostEnd == m_portEnd || m_hostEnd == m_portEnd - 1)
         return 0;
 
-    int number = m_string.substring(m_hostEnd + 1, m_portEnd - m_hostEnd - 1).toInt();
-    if (number < 0 || number > 0xFFFF)
-        return 0;
+    const UChar* stringData = m_string.characters();
+    bool ok = false;
+    unsigned number = charactersToUIntStrict(stringData + m_hostEnd + 1, m_portEnd - m_hostEnd - 1, &ok);
+    if (!ok || number > maximumValidPortNumber)
+        return invalidPortNumber;
     return number;
 }
 
@@ -1757,7 +1765,7 @@
         6667, // Standard IRC [Apple addition]
         6668, // Alternate IRC [Apple addition]
         6669, // Alternate IRC [Apple addition]
-
+        invalidPortNumber, // Used to block all invalid port numbers
     };
     const unsigned short* const blockedPortListEnd = blockedPortList + sizeof(blockedPortList) / sizeof(blockedPortList[0]);
 
diff --git a/WebCore/platform/KURL.h b/WebCore/platform/KURL.h
index 6cd8f96..e5e8ec4 100644
--- a/WebCore/platform/KURL.h
+++ b/WebCore/platform/KURL.h
@@ -179,9 +179,6 @@
     unsigned pathEnd() const;
     unsigned pathAfterLastSlash() const;
     operator const String&() const { return string(); }
-#if USE(JSC)
-    operator JSC::UString() const { return string(); }
-#endif
 
 #if PLATFORM(CF)
     KURL(CFURLRef);
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index 65ca346..97446bd 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -40,13 +40,13 @@
 
 #include <algorithm>
 
-#include "CString.h"
 #include "StringHash.h"
 #include "NotImplemented.h"
 #include "TextEncoding.h"
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 #include <googleurl/src/url_canon_internal.h>
 #include <googleurl/src/url_util.h>
@@ -57,6 +57,9 @@
 
 namespace WebCore {
 
+static const int maximumValidPortNumber = 0xFFFE;
+static const int invalidPortNumber = 0xFFFF;
+
 // Wraps WebCore's text encoding in a character set converter for the
 // canonicalizer.
 class KURLCharsetConverter : public url_canon::CharsetConverter {
@@ -491,18 +494,21 @@
     return m_url.componentString(m_url.m_parsed.host);
 }
 
-// Returns 0 when there is no port or it is invalid.
+// Returns 0 when there is no port.
 //
 // We treat URL's with out-of-range port numbers as invalid URLs, and they will
 // be rejected by the canonicalizer. KURL.cpp will allow them in parsing, but
-// return 0 from this port() function, so we mirror that behavior here.
+// return invalidPortNumber from this port() function, so we mirror that behavior here.
 unsigned short KURL::port() const
 {
     if (!m_url.m_isValid || m_url.m_parsed.port.len <= 0)
         return 0;
     int port = url_parse::ParsePort(m_url.utf8String().data(), m_url.m_parsed.port);
-    if (port == url_parse::PORT_UNSPECIFIED)
-        return 0;
+    ASSERT(port != url_parse::PORT_UNSPECIFIED); // Checked port.len <= 0 before.
+
+    if (port == url_parse::PORT_INVALID || port > maximumValidPortNumber) // Mimic KURL::port()
+        port = invalidPortNumber;
+
     return static_cast<unsigned short>(port);
 }
 
@@ -572,10 +578,32 @@
 
 bool KURL::setProtocol(const String& protocol)
 {
+    // Firefox and IE remove everything after the first ':'.
+    int separatorPosition = protocol.find(':');
+    String newProtocol = protocol.substring(0, separatorPosition);
+
+    // If KURL is given an invalid scheme, it returns failure without modifying
+    // the URL at all. This is in contrast to most other setters which modify
+    // the URL and set "m_isValid."
+    url_canon::RawCanonOutputT<char> canonProtocol;
+    url_parse::Component protocolComponent;
+    if (!url_canon::CanonicalizeScheme(newProtocol.characters(),
+                                       url_parse::Component(0, newProtocol.length()),
+                                       &canonProtocol, &protocolComponent)
+        || !protocolComponent.is_nonempty())
+        return false;
+
     KURLGooglePrivate::Replacements replacements;
-    replacements.SetScheme(CharactersOrEmpty(protocol),
-                           url_parse::Component(0, protocol.length()));
+    replacements.SetScheme(CharactersOrEmpty(newProtocol),
+                           url_parse::Component(0, newProtocol.length()));
     m_url.replaceComponents(replacements);
+
+    // isValid could be false but we still return true here. This is because
+    // WebCore or JS scripts can build up a URL by setting individual
+    // components, and a JS exception is based on the return value of this
+    // function. We want to throw the exception and stop the script only when
+    // its trying to set a bad protocol, and not when it maybe just hasn't
+    // finished building up its final scheme.
     return true;
 }
 
@@ -622,7 +650,7 @@
     KURLGooglePrivate::Replacements replacements;
     String portStr;
     if (i) {
-        portStr = String::number(static_cast<int>(i));
+        portStr = String::number(i);
         replacements.SetPort(
             reinterpret_cast<const url_parse::UTF16Char*>(portStr.characters()),
             url_parse::Component(0, portStr.length()));
@@ -831,6 +859,12 @@
         3659, // apple-sasl / PasswordServer [Apple addition]
         4045, // lockd
         6000, // X11
+        6665, // Alternate IRC [Apple addition]
+        6666, // Alternate IRC [Apple addition]
+        6667, // Standard IRC [Apple addition]
+        6668, // Alternate IRC [Apple addition]
+        6669, // Alternate IRC [Apple addition]
+        invalidPortNumber, // Used to block all invalid port numbers
     };
     const unsigned short* const blockedPortListEnd = blockedPortList + sizeof(blockedPortList) / sizeof(blockedPortList[0]);
 
@@ -1015,7 +1049,6 @@
         return false;
     return url_util::IsStandard(
         &m_url.utf8String().data()[m_url.m_parsed.scheme.begin],
-        m_url.utf8String().length(),
         m_url.m_parsed.scheme);
 }
 
@@ -1094,12 +1127,10 @@
 {
     // Do the comparison without making a new string object.
     assertProtocolIsGood(protocol);
-    for (int i = 0; ; ++i) {
-        if (!protocol[i])
-            return url[i] == ':';
-        if (toASCIILower(url[i]) != protocol[i])
-            return false;
-    }
+
+    // Check the scheme like GURL does.
+    return url_util::FindAndCompareScheme(url.characters(), url.length(), 
+        protocol, NULL); 
 }
 
 inline bool KURL::protocolIs(const String& string, const char* protocol)
diff --git a/WebCore/platform/KURLGooglePrivate.h b/WebCore/platform/KURLGooglePrivate.h
index a70cce5..c71e56b 100644
--- a/WebCore/platform/KURLGooglePrivate.h
+++ b/WebCore/platform/KURLGooglePrivate.h
@@ -31,7 +31,7 @@
 #ifndef KURLGooglePrivate_h
 #define KURLGooglePrivate_h
 
-#include "CString.h"
+#include <wtf/text/CString.h>
 
 #include <googleurl/src/url_parse.h>
 #include <googleurl/src/url_canon.h>
diff --git a/WebCore/platform/KeyboardCodes.h b/WebCore/platform/KeyboardCodes.h
deleted file mode 100644
index 04ee071..0000000
--- a/WebCore/platform/KeyboardCodes.h
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- *
- * 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 COMPUTER, 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 KeyboardCodes_h
-#define KeyboardCodes_h
-
-#include <wtf/Platform.h>
-
-// FIXME: We should get rid of these Chromium-related ifdefs.
-#if PLATFORM(CHROMIUM)
-
-#if OS(WINDOWS)
-#include "KeyboardCodesWin.h"
-#else
-#include "KeyboardCodesPosix.h"
-#endif
-
-#else
-
-namespace WebCore {
-
-#if !OS(WINDOWS)
-// VK_LBUTTON (01) Left mouse button
-// VK_RBUTTON (02) Right mouse button
-// VK_CANCEL (03) Control-break processing
-// VK_MBUTTON (04) Middle mouse button (three-button mouse)
-// VK_XBUTTON1 (05)
-// VK_XBUTTON2 (06)
-
-// VK_BACK (08) BACKSPACE key
-const int VK_BACK = 0x08;
-
-// VK_TAB (09) TAB key
-const int VK_TAB = 0x09;
-
-// VK_CLEAR (0C) CLEAR key
-const int VK_CLEAR = 0x0C;
-
-// VK_RETURN (0D)
-const int VK_RETURN = 0x0D;
-
-// VK_SHIFT (10) SHIFT key
-const int VK_SHIFT = 0x10;
-
-// VK_CONTROL (11) CTRL key
-const int VK_CONTROL = 0x11;
-
-// VK_MENU (12) ALT key
-const int VK_MENU = 0x12;
-
-// VK_PAUSE (13) PAUSE key
-const int VK_PAUSE = 0x13;
-
-// VK_CAPITAL (14) CAPS LOCK key
-const int VK_CAPITAL = 0x14;
-
-// VK_KANA (15) Input Method Editor (IME) Kana mode
-const int VK_KANA = 0x15;
-
-// VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
-// VK_HANGUL (15) IME Hangul mode
-const int VK_HANGUL = 0x15;
-
-// VK_JUNJA (17) IME Junja mode
-const int VK_JUNJA = 0x17;
-
-// VK_FINAL (18) IME final mode
-const int VK_FINAL = 0x18;
-
-// VK_HANJA (19) IME Hanja mode
-const int VK_HANJA = 0x19;
-
-// VK_KANJI (19) IME Kanji mode
-const int VK_KANJI = 0x19;
-
-// VK_ESCAPE (1B) ESC key
-const int VK_ESCAPE = 0x1B;
-
-// VK_CONVERT (1C) IME convert
-const int VK_CONVERT = 0x1C;
-
-// VK_NONCONVERT (1D) IME nonconvert
-const int VK_NONCONVERT = 0x1D;
-
-// VK_ACCEPT (1E) IME accept
-const int VK_ACCEPT = 0x1E;
-
-// VK_MODECHANGE (1F) IME mode change request
-const int VK_MODECHANGE = 0x1F;
-
-// VK_SPACE (20) SPACEBAR
-const int VK_SPACE = 0x20;
-
-// VK_PRIOR (21) PAGE UP key
-const int VK_PRIOR = 0x21;
-
-// VK_NEXT (22) PAGE DOWN key
-const int VK_NEXT = 0x22;
-
-// VK_END (23) END key
-const int VK_END = 0x23;
-
-// VK_HOME (24) HOME key
-const int VK_HOME = 0x24;
-
-// VK_LEFT (25) LEFT ARROW key
-const int VK_LEFT = 0x25;
-
-// VK_UP (26) UP ARROW key
-const int VK_UP = 0x26;
-
-// VK_RIGHT (27) RIGHT ARROW key
-const int VK_RIGHT = 0x27;
-
-// VK_DOWN (28) DOWN ARROW key
-const int VK_DOWN = 0x28;
-
-// VK_SELECT (29) SELECT key
-const int VK_SELECT = 0x29;
-
-// VK_PRINT (2A) PRINT key
-const int VK_PRINT = 0x2A;
-
-// VK_EXECUTE (2B) EXECUTE key
-const int VK_EXECUTE = 0x2B;
-
-// VK_SNAPSHOT (2C) PRINT SCREEN key
-const int VK_SNAPSHOT = 0x2C;
-
-// VK_INSERT (2D) INS key
-const int VK_INSERT = 0x2D;
-
-// VK_DELETE (2E) DEL key
-const int VK_DELETE = 0x2E;
-
-// VK_HELP (2F) HELP key
-const int VK_HELP = 0x2F;
-
-#endif // OS(WINDOWS)
-
-// (30) 0 key
-const int VK_0 = 0x30;
-
-// (31) 1 key
-const int VK_1 = 0x31;
-
-// (32) 2 key
-const int VK_2 = 0x32;
-
-// (33) 3 key
-const int VK_3 = 0x33;
-
-// (34) 4 key
-const int VK_4 = 0x34;
-
-// (35) 5 key;
-
-const int VK_5 = 0x35;
-
-// (36) 6 key
-const int VK_6 = 0x36;
-
-// (37) 7 key
-const int VK_7 = 0x37;
-
-// (38) 8 key
-const int VK_8 = 0x38;
-
-// (39) 9 key
-const int VK_9 = 0x39;
-
-// (41) A key
-const int VK_A = 0x41;
-
-// (42) B key
-const int VK_B = 0x42;
-
-// (43) C key
-const int VK_C = 0x43;
-
-// (44) D key
-const int VK_D = 0x44;
-
-// (45) E key
-const int VK_E = 0x45;
-
-// (46) F key
-const int VK_F = 0x46;
-
-// (47) G key
-const int VK_G = 0x47;
-
-// (48) H key
-const int VK_H = 0x48;
-
-// (49) I key
-const int VK_I = 0x49;
-
-// (4A) J key
-const int VK_J = 0x4A;
-
-// (4B) K key
-const int VK_K = 0x4B;
-
-// (4C) L key
-const int VK_L = 0x4C;
-
-// (4D) M key
-const int VK_M = 0x4D;
-
-// (4E) N key
-const int VK_N = 0x4E;
-
-// (4F) O key
-const int VK_O = 0x4F;
-
-// (50) P key
-const int VK_P = 0x50;
-
-// (51) Q key
-const int VK_Q = 0x51;
-
-// (52) R key
-const int VK_R = 0x52;
-
-// (53) S key
-const int VK_S = 0x53;
-
-// (54) T key
-const int VK_T = 0x54;
-
-// (55) U key
-const int VK_U = 0x55;
-
-// (56) V key
-const int VK_V = 0x56;
-
-// (57) W key
-const int VK_W = 0x57;
-
-// (58) X key
-const int VK_X = 0x58;
-
-// (59) Y key
-const int VK_Y = 0x59;
-
-// (5A) Z key
-const int VK_Z = 0x5A;
-
-#if !OS(WINDOWS)
-
-// VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-const int VK_LWIN = 0x5B;
-
-// VK_RWIN (5C) Right Windows key (Natural keyboard)
-const int VK_RWIN = 0x5C;
-
-// VK_APPS (5D) Applications key (Natural keyboard)
-const int VK_APPS = 0x5D;
-
-// VK_SLEEP (5F) Computer Sleep key
-const int VK_SLEEP = 0x5F;
-
-// VK_NUMPAD0 (60) Numeric keypad 0 key
-const int VK_NUMPAD0 = 0x60;
-
-// VK_NUMPAD1 (61) Numeric keypad 1 key
-const int VK_NUMPAD1 = 0x61;
-
-// VK_NUMPAD2 (62) Numeric keypad 2 key
-const int VK_NUMPAD2 = 0x62;
-
-// VK_NUMPAD3 (63) Numeric keypad 3 key
-const int VK_NUMPAD3 = 0x63;
-
-// VK_NUMPAD4 (64) Numeric keypad 4 key
-const int VK_NUMPAD4 = 0x64;
-
-// VK_NUMPAD5 (65) Numeric keypad 5 key
-const int VK_NUMPAD5 = 0x65;
-
-// VK_NUMPAD6 (66) Numeric keypad 6 key
-const int VK_NUMPAD6 = 0x66;
-
-// VK_NUMPAD7 (67) Numeric keypad 7 key
-const int VK_NUMPAD7 = 0x67;
-
-// VK_NUMPAD8 (68) Numeric keypad 8 key
-const int VK_NUMPAD8 = 0x68;
-
-// VK_NUMPAD9 (69) Numeric keypad 9 key
-const int VK_NUMPAD9 = 0x69;
-
-// VK_MULTIPLY (6A) Multiply key
-const int VK_MULTIPLY = 0x6A;
-
-// VK_ADD (6B) Add key
-const int VK_ADD = 0x6B;
-
-// VK_SEPARATOR (6C) Separator key
-const int VK_SEPARATOR = 0x6C;
-
-// VK_SUBTRACT (6D) Subtract key
-const int VK_SUBTRACT = 0x6D;
-
-// VK_DECIMAL (6E) Decimal key
-const int VK_DECIMAL = 0x6E;
-
-// VK_DIVIDE (6F) Divide key
-const int VK_DIVIDE = 0x6F;
-
-// VK_F1 (70) F1 key
-const int VK_F1 = 0x70;
-
-// VK_F2 (71) F2 key
-const int VK_F2 = 0x71;
-
-// VK_F3 (72) F3 key
-const int VK_F3 = 0x72;
-
-// VK_F4 (73) F4 key
-const int VK_F4 = 0x73;
-
-// VK_F5 (74) F5 key
-const int VK_F5 = 0x74;
-
-// VK_F6 (75) F6 key
-const int VK_F6 = 0x75;
-
-// VK_F7 (76) F7 key
-const int VK_F7 = 0x76;
-
-// VK_F8 (77) F8 key
-const int VK_F8 = 0x77;
-
-// VK_F9 (78) F9 key
-const int VK_F9 = 0x78;
-
-// VK_F10 (79) F10 key
-const int VK_F10 = 0x79;
-
-// VK_F11 (7A) F11 key
-const int VK_F11 = 0x7A;
-
-// VK_F12 (7B) F12 key
-const int VK_F12 = 0x7B;
-
-// VK_F13 (7C) F13 key
-const int VK_F13 = 0x7C;
-
-// VK_F14 (7D) F14 key
-const int VK_F14 = 0x7D;
-
-// VK_F15 (7E) F15 key
-const int VK_F15 = 0x7E;
-
-// VK_F16 (7F) F16 key
-const int VK_F16 = 0x7F;
-
-// VK_F17 (80H) F17 key
-const int VK_F17 = 0x80;
-
-// VK_F18 (81H) F18 key
-const int VK_F18 = 0x81;
-
-// VK_F19 (82H) F19 key
-const int VK_F19 = 0x82;
-
-// VK_F20 (83H) F20 key
-const int VK_F20 = 0x83;
-
-// VK_F21 (84H) F21 key
-const int VK_F21 = 0x84;
-
-// VK_F22 (85H) F22 key
-const int VK_F22 = 0x85;
-
-// VK_F23 (86H) F23 key
-const int VK_F23 = 0x86;
-
-// VK_F24 (87H) F24 key
-const int VK_F24 = 0x87;
-
-// VK_NUMLOCK (90) NUM LOCK key
-const int VK_NUMLOCK = 0x90;
-
-// VK_SCROLL (91) SCROLL LOCK key
-const int VK_SCROLL = 0x91;
-
-// VK_LSHIFT (A0) Left SHIFT key
-const int VK_LSHIFT = 0xA0;
-
-// VK_RSHIFT (A1) Right SHIFT key
-const int VK_RSHIFT = 0xA1;
-
-// VK_LCONTROL (A2) Left CONTROL key
-const int VK_LCONTROL = 0xA2;
-
-// VK_RCONTROL (A3) Right CONTROL key
-const int VK_RCONTROL = 0xA3;
-
-// VK_LMENU (A4) Left MENU key
-const int VK_LMENU = 0xA4;
-
-// VK_RMENU (A5) Right MENU key
-const int VK_RMENU = 0xA5;
-
-// VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-const int VK_BROWSER_BACK = 0xA6;
-
-// VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-const int VK_BROWSER_FORWARD = 0xA7;
-
-// VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-const int VK_BROWSER_REFRESH = 0xA8;
-
-// VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-const int VK_BROWSER_STOP = 0xA9;
-
-// VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-const int VK_BROWSER_SEARCH = 0xAA;
-
-// VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-const int VK_BROWSER_FAVORITES = 0xAB;
-
-// VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-const int VK_BROWSER_HOME = 0xAC;
-
-// VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-const int VK_VOLUME_MUTE = 0xAD;
-
-// VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-const int VK_VOLUME_DOWN = 0xAE;
-
-// VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-const int VK_VOLUME_UP = 0xAF;
-
-// VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-const int VK_MEDIA_NEXT_TRACK = 0xB0;
-
-// VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-const int VK_MEDIA_PREV_TRACK = 0xB1;
-
-// VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-const int VK_MEDIA_STOP = 0xB2;
-
-// VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-const int VK_MEDIA_PLAY_PAUSE = 0xB3;
-
-// VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
-
-// VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
-
-// VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
-
-// VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
-
-#endif // !OS(WINDOWS)
-
-#if !OS(WINDOWS) || OS(WINCE)
-
-// VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
-const int VK_OEM_1 = 0xBA;
-
-// VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-const int VK_OEM_PLUS = 0xBB;
-
-// VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-const int VK_OEM_COMMA = 0xBC;
-
-// VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-const int VK_OEM_MINUS = 0xBD;
-
-// VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-const int VK_OEM_PERIOD = 0xBE;
-
-// VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-const int VK_OEM_2 = 0xBF;
-
-// VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-const int VK_OEM_3 = 0xC0;
-
-// VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-const int VK_OEM_4 = 0xDB;
-
-// VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-const int VK_OEM_5 = 0xDC;
-
-// VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-const int VK_OEM_6 = 0xDD;
-
-// VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-const int VK_OEM_7 = 0xDE;
-
-// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
-const int VK_OEM_8 = 0xDF;
-
-#endif // !OS(WINDOWS) || OS(WINCE)
-
-#if !OS(WINDOWS)
-
-// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-const int VK_OEM_102 = 0xE2;
-
-// VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-const int VK_PROCESSKEY = 0xE5;
-
-// VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-const int VK_PACKET = 0xE7;
-
-// VK_ATTN (F6) Attn key
-const int VK_ATTN = 0xF6;
-
-// VK_CRSEL (F7) CrSel key
-const int VK_CRSEL = 0xF7;
-
-// VK_EXSEL (F8) ExSel key
-const int VK_EXSEL = 0xF8;
-
-// VK_EREOF (F9) Erase EOF key
-const int VK_EREOF = 0xF9;
-
-// VK_PLAY (FA) Play key
-const int VK_PLAY = 0xFA;
-
-// VK_ZOOM (FB) Zoom key
-const int VK_ZOOM = 0xFB;
-
-// VK_NONAME (FC) Reserved for future use
-const int VK_NONAME = 0xFC;
-
-// VK_PA1 (FD) PA1 key
-const int VK_PA1 = 0xFD;
-
-// VK_OEM_CLEAR (FE) Clear key
-const int VK_OEM_CLEAR = 0xFE;
-
-const int VK_UNKNOWN = 0;
-
-#endif // OS(WINDOWS)
-
-}
-
-#endif // PLATFORM(CHROMIUM)
-
-#endif
diff --git a/WebCore/platform/LinkHash.cpp b/WebCore/platform/LinkHash.cpp
index c399aa2..0bd589c 100644
--- a/WebCore/platform/LinkHash.cpp
+++ b/WebCore/platform/LinkHash.cpp
@@ -154,10 +154,11 @@
 
 void visitedURL(const KURL& base, const AtomicString& attributeURL, Vector<UChar, 512>& buffer)
 {
+    if (attributeURL.isNull())
+        return;
+
     const UChar* characters = attributeURL.characters();
     unsigned length = attributeURL.length();
-    if (!length)
-        return;
 
     // This is a poor man's completeURL. Faster with less memory allocation.
     // FIXME: It's missing a lot of what completeURL does and a lot of what KURL does.
@@ -186,16 +187,20 @@
         return;
     }
 
-    switch (characters[0]) {
-        case '/':
-            buffer.append(base.string().characters(), base.pathStart());
-            break;
-        case '#':
-            buffer.append(base.string().characters(), base.pathEnd());
-            break;
-        default:
-            buffer.append(base.string().characters(), base.pathAfterLastSlash());
-            break;
+    if (!length)
+        buffer.append(base.string().characters(), base.string().length());
+    else {
+        switch (characters[0]) {
+            case '/':
+                buffer.append(base.string().characters(), base.pathStart());
+                break;
+            case '#':
+                buffer.append(base.string().characters(), base.pathEnd());
+                break;
+            default:
+                buffer.append(base.string().characters(), base.pathAfterLastSlash());
+                break;
+        }
     }
     buffer.append(characters, length);
     cleanPath(buffer);
diff --git a/WebCore/platform/LocalizedStrings.h b/WebCore/platform/LocalizedStrings.h
index 6ca5773..56d44b3 100644
--- a/WebCore/platform/LocalizedStrings.h
+++ b/WebCore/platform/LocalizedStrings.h
@@ -128,6 +128,8 @@
     String AXMenuListPopupActionVerb();
     String AXLinkActionVerb();
 
+    String missingPluginText();
+    String crashedPluginText();
     String multipleFileUploadText(unsigned numberOfFiles);
     String unknownFileSizeText();
 
diff --git a/WebCore/platform/Logging.cpp b/WebCore/platform/Logging.cpp
index 2358d41..7fb15b1 100644
--- a/WebCore/platform/Logging.cpp
+++ b/WebCore/platform/Logging.cpp
@@ -20,7 +20,7 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -38,7 +38,7 @@
 
 WTFLogChannel LogEvents =            { 0x00000080, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogEditing =           { 0x00000100, "WebCoreLogLevel", WTFLogChannelOff };
-WTFLogChannel LogTextConversion =    { 0x00000200, "WebCoreLogLevel", WTFLogChannelOff };
+WTFLogChannel LogLiveConnect =       { 0x00000200, "WebCoreLogLevel", WTFLogChannelOff };
 
 WTFLogChannel LogIconDatabase =      { 0x00000400, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogSQLDatabase =       { 0x00000800, "WebCoreLogLevel", WTFLogChannelOff };
@@ -60,6 +60,7 @@
 WTFLogChannel LogPlugins =           { 0x02000000, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogArchives =          { 0x04000000, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogProgress =          { 0x08000000, "WebCoreLogLevel", WTFLogChannelOff };
+WTFLogChannel LogFileAPI =           { 0x10000000, "WebCoreLogLevel", WTFLogChannelOff };
 
 WTFLogChannel* getChannelFromName(const String& channelName)
 {
@@ -113,7 +114,7 @@
 
     if (equalIgnoringCase(channelName, String("Progress")))
         return &LogProgress;
-        
+
     if (equalIgnoringCase(channelName, String("SpellingAndGrammar")))
         return &LogSpellingAndGrammar;
 
@@ -123,12 +124,15 @@
     if (equalIgnoringCase(channelName, String("StorageAPI")))
         return &LogStorageAPI;
 
-    if (equalIgnoringCase(channelName, String("TextConversion")))
-        return &LogTextConversion;
+    if (equalIgnoringCase(channelName, String("LiveConnect")))
+        return &LogLiveConnect;
 
     if (equalIgnoringCase(channelName, String("Threading")))
         return &LogThreading;
 
+    if (equalIgnoringCase(channelName, String("FileAPI")))
+        return &LogFileAPI;
+
     return 0;
 }
 
diff --git a/WebCore/platform/Logging.h b/WebCore/platform/Logging.h
index a3dfe62..45b6d23 100644
--- a/WebCore/platform/Logging.h
+++ b/WebCore/platform/Logging.h
@@ -42,7 +42,7 @@
     extern WTFLogChannel LogPopupBlocking;
     extern WTFLogChannel LogEvents;
     extern WTFLogChannel LogEditing;
-    extern WTFLogChannel LogTextConversion;
+    extern WTFLogChannel LogLiveConnect;
     extern WTFLogChannel LogIconDatabase;
     extern WTFLogChannel LogSQLDatabase;
     extern WTFLogChannel LogSpellingAndGrammar;
@@ -58,6 +58,7 @@
     extern WTFLogChannel LogPlugins;
     extern WTFLogChannel LogArchives;
     extern WTFLogChannel LogProgress;
+    extern WTFLogChannel LogFileAPI;
 
     void InitializeLoggingChannelsIfNecessary();
     WTFLogChannel* getChannelFromName(const String& channelName);
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 978a611..2f3bf92 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -224,11 +224,10 @@
         "text/",
         "application/xml",
         "application/xhtml+xml",
-#if ENABLE(XHTMLMP)
         "application/vnd.wap.xhtml+xml",
-#endif
         "application/rss+xml",
         "application/atom+xml",
+        "application/json",
 #if ENABLE(SVG)
         "image/svg+xml",
 #endif
@@ -236,7 +235,12 @@
         "application/x-ftp-directory",
 #endif
         "multipart/x-mixed-replace"
+        // Note: ADDING a new type here will probably render it as HTML. This can
+        // result in cross-site scripting.
     };
+    COMPILE_ASSERT(sizeof(types) / sizeof(types[0]) <= 16,
+                   nonimage_mime_types_must_be_less_than_or_equal_to_16);
+
     for (size_t i = 0; i < sizeof(types)/sizeof(types[0]); ++i)
         supportedNonImageMIMETypes->add(types[i]);
 
@@ -395,6 +399,8 @@
 
 bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType)
 {
+    ASSERT(isMainThread());
+
     if (mimeType.isEmpty())
         return false;
     if (!supportedImageMIMETypesForEncoding)
diff --git a/WebCore/platform/MIMETypeRegistry.h b/WebCore/platform/MIMETypeRegistry.h
index 8801ac1..27c2c3a 100644
--- a/WebCore/platform/MIMETypeRegistry.h
+++ b/WebCore/platform/MIMETypeRegistry.h
@@ -67,6 +67,10 @@
     // Check to see if a mime type is a valid Java applet mime type
     static bool isJavaAppletMIMEType(const String& mimeType);
 
+    // Check to see if a mime type is a plugin implemented by the
+    // browser (e.g. a Qt Plugin).
+    static bool isApplicationPluginMIMEType(const String& mimeType);
+
     static HashSet<String>& getSupportedImageMIMETypes();
     static HashSet<String>& getSupportedImageResourceMIMETypes();
     static HashSet<String>& getSupportedImageMIMETypesForEncoding();
diff --git a/WebCore/platform/NotImplemented.h b/WebCore/platform/NotImplemented.h
index 03ab424..61e4424 100644
--- a/WebCore/platform/NotImplemented.h
+++ b/WebCore/platform/NotImplemented.h
@@ -29,7 +29,7 @@
 #include "Logging.h"
 #include <wtf/Assertions.h>
 
-#if PLATFORM(GTK)
+#if PLATFORM(GTK) || PLATFORM(EFL)
     #define supressNotImplementedWarning() getenv("DISABLE_NI_WARNING")
 #elif PLATFORM(QT)
     #include <QByteArray>
diff --git a/WebCore/platform/Pasteboard.h b/WebCore/platform/Pasteboard.h
index 7a47f00..c3476a9 100644
--- a/WebCore/platform/Pasteboard.h
+++ b/WebCore/platform/Pasteboard.h
@@ -57,6 +57,11 @@
 #include "PasteboardPrivate.h"
 #endif
 
+namespace WTF {
+class CString;
+}
+using WTF::CString;
+
 namespace WebCore {
 
 #if PLATFORM(MAC)
@@ -67,7 +72,6 @@
 extern NSString *WebURLsWithTitlesPboardType;
 #endif
 
-class CString;
 class DocumentFragment;
 class Frame;
 class HitTestResult;
@@ -104,7 +108,7 @@
 
 #if PLATFORM(GTK)
     void setHelper(PasteboardHelper*);
-    PasteboardHelper* m_helper;
+    PasteboardHelper* helper();
 #endif
 
 private:
@@ -127,6 +131,10 @@
 #if PLATFORM(CHROMIUM)
     PasteboardPrivate p;
 #endif
+
+#if PLATFORM(GTK)
+    PasteboardHelper* m_helper;
+#endif
 };
 
 } // namespace WebCore
diff --git a/WebCore/platform/PlatformKeyboardEvent.h b/WebCore/platform/PlatformKeyboardEvent.h
index b2dfe03..ddb1680 100644
--- a/WebCore/platform/PlatformKeyboardEvent.h
+++ b/WebCore/platform/PlatformKeyboardEvent.h
@@ -28,7 +28,6 @@
 #define PlatformKeyboardEvent_h
 
 #include "PlatformString.h"
-#include <wtf/Platform.h>
 
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
@@ -63,6 +62,10 @@
 class BMessage;
 #endif
 
+#if PLATFORM(EFL)
+#include <Evas.h>
+#endif
+
 #if PLATFORM(BREWMP)
 typedef unsigned short    uint16;
 typedef unsigned long int uint32;
@@ -94,6 +97,28 @@
             ShiftKey = 1 << 3,
         };
 
+        PlatformKeyboardEvent()
+            : m_type(KeyDown)
+            , m_autoRepeat(false)
+            , m_windowsVirtualKeyCode(0)
+            , m_nativeVirtualKeyCode(0)
+            , m_isKeypad(false)
+            , m_shiftKey(false)
+            , m_ctrlKey(false)
+            , m_altKey(false)
+            , m_metaKey(false)
+#if PLATFORM(WIN) || PLATFORM(CHROMIUM)
+            , m_isSystemKey(false)
+#endif
+#if PLATFORM(GTK)
+            , m_gdkEventKey(0)
+#endif
+#if PLATFORM(QT)
+            , m_qtEvent(0)
+#endif
+        {
+        }
+        
         Type type() const { return m_type; }
         void disambiguateKeyDownEvent(Type, bool backwardCompatibilityMode = false); // Only used on platforms that need it, i.e. those that generate KeyDown events.
 
@@ -134,9 +159,9 @@
         }
 
         static bool currentCapsLockState();
+        static void getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey);
 
 #if PLATFORM(MAC)
-        PlatformKeyboardEvent();
         PlatformKeyboardEvent(NSEvent*);
         NSEvent* macEvent() const { return m_macEvent.get(); }
 #endif
@@ -178,6 +203,11 @@
         bool isSystemKey() const { return m_isSystemKey; }
 #endif
 
+#if PLATFORM(EFL)
+        PlatformKeyboardEvent(const Evas_Event_Key_Down*);
+        PlatformKeyboardEvent(const Evas_Event_Key_Up*);
+#endif
+
     protected:
         Type m_type;
         String m_text;
diff --git a/WebCore/platform/PlatformMouseEvent.h b/WebCore/platform/PlatformMouseEvent.h
index d8f6318..5121995 100644
--- a/WebCore/platform/PlatformMouseEvent.h
+++ b/WebCore/platform/PlatformMouseEvent.h
@@ -33,6 +33,10 @@
 typedef struct _GdkEventMotion GdkEventMotion;
 #endif
 
+#if PLATFORM(EFL)
+#include <Evas.h>
+#endif
+
 #if PLATFORM(QT)
 QT_BEGIN_NAMESPACE
 class QInputEvent;
@@ -120,6 +124,13 @@
         PlatformMouseEvent(GdkEventMotion*);
 #endif
 
+#if PLATFORM(EFL)
+        void setClickCount(Evas_Button_Flags);
+        PlatformMouseEvent(const Evas_Event_Mouse_Down*, IntPoint);
+        PlatformMouseEvent(const Evas_Event_Mouse_Up*, IntPoint);
+        PlatformMouseEvent(const Evas_Event_Mouse_Move*, IntPoint);
+#endif
+
 #if PLATFORM(MAC)
 #if defined(__OBJC__)
         PlatformMouseEvent(NSEvent *, NSView *windowView);
diff --git a/WebCore/platform/PlatformTouchEvent.h b/WebCore/platform/PlatformTouchEvent.h
index d300a82..c3a0283 100644
--- a/WebCore/platform/PlatformTouchEvent.h
+++ b/WebCore/platform/PlatformTouchEvent.h
@@ -71,7 +71,7 @@
     bool shiftKey() const { return m_shiftKey; }
     bool metaKey() const { return m_metaKey; }
 
-private:
+protected:
     TouchEventType m_type;
     Vector<PlatformTouchPoint> m_touchPoints;
     bool m_ctrlKey;
diff --git a/WebCore/platform/PlatformTouchPoint.h b/WebCore/platform/PlatformTouchPoint.h
index d4f855e..202a2d4 100644
--- a/WebCore/platform/PlatformTouchPoint.h
+++ b/WebCore/platform/PlatformTouchPoint.h
@@ -21,7 +21,6 @@
 #define PlatformTouchPoint_h
 
 #include "IntPoint.h"
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 #if ENABLE(TOUCH_EVENTS)
@@ -55,7 +54,11 @@
     IntPoint screenPos() const { return m_screenPos; }
     IntPoint pos() const { return m_pos; }
     
+<<<<<<< HEAD
 private:
+=======
+protected:
+>>>>>>> webkit.org at r58033
     unsigned m_id;
     State m_state;
     IntPoint m_screenPos;
diff --git a/WebCore/platform/PlatformWheelEvent.h b/WebCore/platform/PlatformWheelEvent.h
index b8e0bb4..6651334 100644
--- a/WebCore/platform/PlatformWheelEvent.h
+++ b/WebCore/platform/PlatformWheelEvent.h
@@ -32,6 +32,10 @@
 typedef struct _GdkEventScroll GdkEventScroll;
 #endif
 
+#if PLATFORM(EFL)
+#include <Evas.h>
+#endif
+
 #if PLATFORM(QT)
 QT_BEGIN_NAMESPACE
 class QWheelEvent;
@@ -120,6 +124,10 @@
         PlatformWheelEvent(GdkEventScroll*);
 #endif
 
+#if PLATFORM(EFL)
+        PlatformWheelEvent(const Evas_Event_Mouse_Wheel*);
+#endif
+
 #if PLATFORM(MAC) && defined(__OBJC__)
         PlatformWheelEvent(NSEvent *, NSView *windowView);
 #endif
diff --git a/WebCore/platform/PopupMenu.h b/WebCore/platform/PopupMenu.h
index 449d475..4df0dcd 100644
--- a/WebCore/platform/PopupMenu.h
+++ b/WebCore/platform/PopupMenu.h
@@ -61,7 +61,9 @@
 #elif PLATFORM(CHROMIUM)
 #include "PopupMenuPrivate.h"
 #elif PLATFORM(HAIKU)
-class BMenu;
+namespace WebCore {
+class PopupMenuHaiku;
+}
 #endif
 
 namespace WebCore {
@@ -186,7 +188,7 @@
 #elif PLATFORM(CHROMIUM)
     PopupMenuPrivate p;
 #elif PLATFORM(HAIKU)
-    BMenu* m_menu;
+    PopupMenuHaiku* m_menu;
 #endif
 
 };
diff --git a/WebCore/platform/PopupMenuClient.h b/WebCore/platform/PopupMenuClient.h
index 2614fe2..2f3f892 100644
--- a/WebCore/platform/PopupMenuClient.h
+++ b/WebCore/platform/PopupMenuClient.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 2006 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -40,6 +41,7 @@
 
     virtual String itemText(unsigned listIndex) const = 0;
     virtual String itemToolTip(unsigned listIndex) const = 0;
+    virtual String itemAccessibilityText(unsigned listIndex) const = 0;
     virtual bool itemIsEnabled(unsigned listIndex) const = 0;
     virtual PopupMenuStyle itemStyle(unsigned listIndex) const = 0;
     virtual PopupMenuStyle menuStyle() const = 0;
@@ -63,6 +65,15 @@
     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
 };
 
+#if ENABLE(NO_LISTBOX_RENDERING)
+class ListPopupMenuClient : public PopupMenuClient {
+public:
+    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true) = 0;
+    virtual bool multiple() = 0;
+};
+#endif
+
+
 }
 
 #endif
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 69ecac2..28f9c2f 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -34,6 +34,7 @@
 #include "ScrollbarTheme.h"
 #include <wtf/StdLibExtras.h>
 
+
 using std::max;
 
 namespace WebCore {
@@ -41,6 +42,8 @@
 ScrollView::ScrollView()
     : m_horizontalScrollbarMode(ScrollbarAuto)
     , m_verticalScrollbarMode(ScrollbarAuto)
+    , m_horizontalScrollbarLock(false)
+    , m_verticalScrollbarLock(false)
     , m_prohibitsScrolling(false)
     , m_canBlitOnScroll(true)
     , m_scrollbarsAvoidingResizer(0)
@@ -80,6 +83,9 @@
 
 void ScrollView::setHasHorizontalScrollbar(bool hasBar)
 {
+    if (hasBar && avoidScrollbarCreation())
+        return;
+
     if (hasBar && !m_horizontalScrollbar) {
         m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
         addChild(m_horizontalScrollbar.get());
@@ -92,6 +98,9 @@
 
 void ScrollView::setHasVerticalScrollbar(bool hasBar)
 {
+    if (hasBar && avoidScrollbarCreation())
+        return;
+
     if (hasBar && !m_verticalScrollbar) {
         m_verticalScrollbar = createScrollbar(VerticalScrollbar);
         addChild(m_verticalScrollbar.get());
@@ -108,12 +117,30 @@
     return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
 }
 
-void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode)
+void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode,
+                                   bool horizontalLock, bool verticalLock)
 {
-    if (horizontalMode == horizontalScrollbarMode() && verticalMode == verticalScrollbarMode())
+    bool needsUpdate = false;
+
+    if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLock) {
+        m_horizontalScrollbarMode = horizontalMode;
+        needsUpdate = true;
+    }
+
+    if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) {
+        m_verticalScrollbarMode = verticalMode;
+        needsUpdate = true;
+    }
+
+    if (horizontalLock)
+        setHorizontalScrollbarLock();
+
+    if (verticalLock)
+        setVerticalScrollbarLock();
+
+    if (!needsUpdate)
         return;
-    m_horizontalScrollbarMode = horizontalMode;
-    m_verticalScrollbarMode = verticalMode;
+
     if (platformWidget())
         platformSetScrollbarModes();
     else
@@ -452,8 +479,6 @@
         int clientHeight = visibleHeight();
         m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
         int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
-        if (pageStep < 0)
-            pageStep = clientHeight;
         IntRect oldRect(m_verticalScrollbar->frameRect());
         IntRect vBarRect = IntRect(width() - m_verticalScrollbar->width(), 
                                    0,
@@ -505,31 +530,30 @@
     updateRect.intersect(scrollViewRect);
 
     // Invalidate the window (not the backing store).
-    hostWindow()->repaint(updateRect, false);
+    hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
 
     if (m_drawPanScrollIcon) {
         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
         panScrollIconDirtyRect.intersect(clipRect);
-        hostWindow()->repaint(panScrollIconDirtyRect, true);
+        hostWindow()->invalidateContentsAndWindow(panScrollIconDirtyRect, false /*immediate*/);
     }
 
     if (canBlitOnScroll()) { // The main frame can just blit the WebView window
-       // FIXME: Find a way to blit subframes without blitting overlapping content
-       hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
+        // FIXME: Find a way to scroll subframes with this faster path
+        hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
     } else { 
        // We need to go ahead and repaint the entire backing store.  Do it now before moving the
        // windowed plugins.
-       hostWindow()->repaint(updateRect, true, false, true); // Invalidate the backing store and repaint it synchronously
+       hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
     }
 
     // This call will move children with native widgets (plugins) and invalidate them as well.
     frameRectsChanged();
 
-    // Now update the window (which should do nothing but a blit of the backing store's updateRect and so should
-    // be very fast).
-    hostWindow()->paint();
+    // Now blit the backingstore into the window which should be very fast.
+    hostWindow()->invalidateWindow(IntRect(), true);
 }
 
 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
@@ -722,7 +746,7 @@
     }
 
     if (hostWindow())
-        hostWindow()->repaint(contentsToWindow(paintRect), true, now);
+        hostWindow()->invalidateContentsAndWindow(contentsToWindow(paintRect), now /*immediate*/);
 }
 
 IntRect ScrollView::scrollCornerRect() const
@@ -940,7 +964,7 @@
         return;
     m_drawPanScrollIcon = true;    
     m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
-    hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength,panIconSizeLength)), true, true);    
+    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
 void ScrollView::removePanScrollIcon()
@@ -948,10 +972,10 @@
     if (!hostWindow())
         return;
     m_drawPanScrollIcon = false; 
-    hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true, true);
+    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
-#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT)
+#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL)
 
 void ScrollView::platformInit()
 {
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 63ae0f0..52afbf9 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -83,15 +83,25 @@
     // Auto means show a scrollbar only when one is needed.
     // Note that for platforms with native widgets, these modes are considered advisory.  In other words the underlying native
     // widget may choose not to honor the requested modes.
-    void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode);
-    void setHorizontalScrollbarMode(ScrollbarMode mode) { setScrollbarModes(mode, verticalScrollbarMode()); }
-    void setVerticalScrollbarMode(ScrollbarMode mode) { setScrollbarModes(horizontalScrollbarMode(), mode); }
+    void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool horizontalLock = false, bool verticalLock = false);
+    void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); }
+    void setVerticalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(horizontalScrollbarMode(), mode, horizontalScrollbarLock(), lock); };
     void scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const;
     ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; }
     ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; }
+
+    void setHorizontalScrollbarLock(bool lock = true) { m_horizontalScrollbarLock = lock; }
+    bool horizontalScrollbarLock() const { return m_horizontalScrollbarLock; }
+    void setVerticalScrollbarLock(bool lock = true) { m_verticalScrollbarLock = lock; }
+    bool verticalScrollbarLock() const { return m_verticalScrollbarLock; }
+
+    void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m_verticalScrollbarLock = lock; }
+
     virtual void setCanHaveScrollbars(bool);
     bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
 
+    virtual bool avoidScrollbarCreation() { return false; }
+
     // By default you only receive paint events for the area that is visible. In the case of using a
     // tiled backing store, this method can be set, so that the view paints the entire contents.
     bool paintsEntireContents() const { return m_paintsEntireContents; }
@@ -249,12 +259,16 @@
     IntRect scrollCornerRect() const;
     virtual void updateScrollCorner();
     virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
-    
+
 private:
     RefPtr<Scrollbar> m_horizontalScrollbar;
     RefPtr<Scrollbar> m_verticalScrollbar;
     ScrollbarMode m_horizontalScrollbarMode;
     ScrollbarMode m_verticalScrollbarMode;
+
+    bool m_horizontalScrollbarLock;
+    bool m_verticalScrollbarLock;
+
     bool m_prohibitsScrolling;
 
     HashSet<RefPtr<Widget> > m_children;
diff --git a/WebCore/platform/Scrollbar.cpp b/WebCore/platform/Scrollbar.cpp
index 1b4f100..fc4b2f1 100644
--- a/WebCore/platform/Scrollbar.cpp
+++ b/WebCore/platform/Scrollbar.cpp
@@ -42,7 +42,7 @@
 
 namespace WebCore {
 
-#if !PLATFORM(GTK)
+#if !PLATFORM(GTK) && !PLATFORM(EFL)
 PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
 {
     return adoptRef(new Scrollbar(client, orientation, size));
diff --git a/WebCore/platform/SecureTextInput.cpp b/WebCore/platform/SecureTextInput.cpp
new file mode 100644
index 0000000..bebb37e
--- /dev/null
+++ b/WebCore/platform/SecureTextInput.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2006, 2007 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 COMPUTER, 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 "SecureTextInput.h"
+
+#if USE(CARBON_SECURE_INPUT_MODE)
+#import <Carbon/Carbon.h>
+#endif
+
+namespace WebCore {
+
+#if USE(CARBON_SECURE_INPUT_MODE)
+
+#ifdef BUILDING_ON_TIGER
+const short enableRomanKeyboardsOnly = -23;
+#endif
+
+void enableSecureTextInput()
+{
+    if (IsSecureEventInputEnabled())
+        return;
+    EnableSecureEventInput();
+#ifdef BUILDING_ON_TIGER
+    KeyScript(enableRomanKeyboardsOnly);
+#else
+    // WebKit substitutes nil for input context when in password field, which corresponds to null TSMDocument. So, there is
+    // no need to call TSMGetActiveDocument(), which may return an incorrect result when selection hasn't been yet updated
+    // after focusing a node.
+    CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
+    TSMSetDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
+    CFRelease(inputSources);
+#endif
+}
+
+void disableSecureTextInput()
+{
+    if (!IsSecureEventInputEnabled())
+        return;
+    DisableSecureEventInput();
+#ifdef BUILDING_ON_TIGER
+    KeyScript(smKeyEnableKybds);
+#else
+    TSMRemoveDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag);
+#endif
+}
+
+#endif // USE(CARBON_SECURE_INPUT_MODE)
+
+} // namespace WebCore
diff --git a/WebCore/platform/SecureTextInput.h b/WebCore/platform/SecureTextInput.h
new file mode 100644
index 0000000..c55981e
--- /dev/null
+++ b/WebCore/platform/SecureTextInput.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009, 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 SecureTextInput_h
+#define SecureTextInput_h
+
+#include <wtf/Platform.h>
+
+namespace WebCore {
+
+// Once enableSecureTextInput is called, secure text input mode is set until
+// disableSecureTextInput has been called.
+void enableSecureTextInput();
+void disableSecureTextInput();
+
+#if !USE(CARBON_SECURE_INPUT_MODE)
+inline void enableSecureTextInput() { }
+inline void disableSecureTextInput() { }
+#endif
+
+} // namespace WebCore
+
+#endif // SecureTextInput_h
diff --git a/WebCore/platform/StaticConstructors.h b/WebCore/platform/StaticConstructors.h
deleted file mode 100644
index c0a9a53..0000000
--- a/WebCore/platform/StaticConstructors.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * 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 StaticConstructors_h
-#define StaticConstructors_h
-
-// For WebCore we need to avoid having static constructors. We achieve this
-// with two separate methods for GCC and MSVC. Both methods prevent the static
-// initializers from being registered and called on program startup. On GCC, we
-// declare the global objects with a different type that can be POD default
-// initialized by the linker/loader. On MSVC we use a special compiler feature
-// to have the CRT ignore our static initializers. The constructors will never
-// be called and the objects will be left uninitialized.
-//
-// With both of these approaches, we must define and explicitly call an init
-// routine that uses placement new to create the objects and overwrite the
-// uninitialized placeholders.
-//
-// This is not completely portable, but is what we have for now without
-// changing how a lot of code accesses these global objects.
-
-#ifdef SKIP_STATIC_CONSTRUCTORS_ON_MSVC
-// - Assume that all includes of this header want ALL of their static
-//   initializers ignored. This is currently the case. This means that if
-//   a .cc includes this header (or it somehow gets included), all static
-//   initializers after the include will not be executed.
-// - We do this with a pragma, so that all of the static initializer pointers
-//   go into our own section, and the CRT won't call them. Eventually it would
-//   be nice if the section was discarded, because we don't want the pointers.
-//   See: http://msdn.microsoft.com/en-us/library/7977wcck(VS.80).aspx
-#pragma warning(disable:4075)
-#pragma init_seg(".unwantedstaticinits")
-#endif
-
-#ifndef SKIP_STATIC_CONSTRUCTORS_ON_GCC
-    // Define an global in the normal way.
-#if COMPILER(MSVC7)
-#define DEFINE_GLOBAL(type, name) \
-    const type name;
-#elif COMPILER(WINSCW)
-#define DEFINE_GLOBAL(type, name, arg...) \
-    const type name;
-#else
-#define DEFINE_GLOBAL(type, name, ...) \
-    const type name;
-#endif
-
-#else
-// Define an correctly-sized array of pointers to avoid static initialization.
-// Use an array of pointers instead of an array of char in case there is some alignment issue.
-#if COMPILER(MSVC7)
-#define DEFINE_GLOBAL(type, name) \
-    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
-#elif COMPILER(WINSCW)
-#define DEFINE_GLOBAL(type, name, arg...) \
-    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
-#else
-#define DEFINE_GLOBAL(type, name, ...) \
-    void * name[(sizeof(type) + sizeof(void *) - 1) / sizeof(void *)];
-#endif
-#endif
-
-#endif // StaticConstructors_h
diff --git a/WebCore/platform/SuddenTermination.h b/WebCore/platform/SuddenTermination.h
index 3fc5b0f..2c1cfe7 100644
--- a/WebCore/platform/SuddenTermination.h
+++ b/WebCore/platform/SuddenTermination.h
@@ -26,8 +26,6 @@
 #ifndef SuddenTermination_h
 #define SuddenTermination_h
 
-#include <wtf/Platform.h>
-
 namespace WebCore {
 
     // Once disabled via one or more more calls to disableSuddenTermination(), fast shutdown
diff --git a/WebCore/platform/ThemeTypes.h b/WebCore/platform/ThemeTypes.h
index 9c2366e..07a11fb 100644
--- a/WebCore/platform/ThemeTypes.h
+++ b/WebCore/platform/ThemeTypes.h
@@ -52,7 +52,7 @@
     MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
     MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
     MediaControlsBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
-    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, OuterSpinButtonPart,
+    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, OuterSpinButtonPart, ProgressBarPart,
     SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart,
     SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart,
     SearchFieldResultsDecorationPart, SearchFieldResultsButtonPart,
diff --git a/WebCore/platform/ThreadGlobalData.cpp b/WebCore/platform/ThreadGlobalData.cpp
index 5c3c294..434ee5a 100644
--- a/WebCore/platform/ThreadGlobalData.cpp
+++ b/WebCore/platform/ThreadGlobalData.cpp
@@ -31,6 +31,7 @@
 #include "StringImpl.h"
 #include "ThreadTimers.h"
 #include <wtf/UnusedParam.h>
+#include <wtf/WTFThreadData.h>
 
 #if USE(ICU_UNICODE)
 #include "TextCodecICU.h"
@@ -55,9 +56,7 @@
 #endif
 
 ThreadGlobalData::ThreadGlobalData()
-    : m_emptyString(new StringImpl)
-    , m_atomicStringTable(new HashSet<StringImpl*>)
-    , m_eventNames(new EventNames)
+    : m_eventNames(new EventNames)
     , m_threadTimers(new ThreadTimers)
 #ifndef NDEBUG
     , m_isMainThread(isMainThread())
@@ -69,6 +68,12 @@
     , m_cachedConverterTEC(new TECConverterWrapper)
 #endif
 {
+    // This constructor will have been called on the main thread before being called on
+    // any other thread, and is only called once per thread – this makes this a convenient
+    // point to call methods that internally perform a one-time initialization that is not
+    // threadsafe.
+    wtfThreadData();
+    StringImpl::empty();
 }
 
 ThreadGlobalData::~ThreadGlobalData()
@@ -80,16 +85,7 @@
     delete m_cachedConverterICU;
 #endif
     delete m_eventNames;
-    delete m_atomicStringTable;
     delete m_threadTimers;
-
-    // Using member variable m_isMainThread instead of calling WTF::isMainThread() directly
-    // to avoid issues described in https://bugs.webkit.org/show_bug.cgi?id=25973.
-    // In short, some pthread-based platforms and ports can not use WTF::CurrentThread() and WTF::isMainThread()
-    // in destructors of thread-specific data.
-    ASSERT(m_isMainThread || m_emptyString->hasOneRef()); // We intentionally don't clean up static data on application quit, so there will be many strings remaining on the main thread.
-
-    delete m_emptyString;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/ThreadGlobalData.h b/WebCore/platform/ThreadGlobalData.h
index 9f7865d..3d73932 100644
--- a/WebCore/platform/ThreadGlobalData.h
+++ b/WebCore/platform/ThreadGlobalData.h
@@ -51,11 +51,9 @@
         ~ThreadGlobalData();
 
         EventNames& eventNames() { return *m_eventNames; }
-        StringImpl* emptyString() { return m_emptyString; }
-        HashSet<StringImpl*>& atomicStringTable() { return *m_atomicStringTable; }
         ThreadTimers& threadTimers() { return *m_threadTimers; }
 
-#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
+#if USE(ICU_UNICODE)
         ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; }
 #endif
 
@@ -64,8 +62,6 @@
 #endif
 
     private:
-        StringImpl* m_emptyString;
-        HashSet<StringImpl*>* m_atomicStringTable;
         EventNames* m_eventNames;
         ThreadTimers* m_threadTimers;
 
@@ -73,7 +69,7 @@
         bool m_isMainThread;
 #endif
 
-#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
+#if USE(ICU_UNICODE)
         ICUConverterWrapper* m_cachedConverterICU;
 #endif
 
diff --git a/WebCore/platform/UUID.cpp b/WebCore/platform/UUID.cpp
new file mode 100644
index 0000000..d8ac749
--- /dev/null
+++ b/WebCore/platform/UUID.cpp
@@ -0,0 +1,90 @@
+/*
+* 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 "UUID.h"
+
+#include "NotImplemented.h"
+
+#if OS(WINDOWS)
+#include <objbase.h>
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(a)           (sizeof(a) / sizeof((a)[0]))
+#endif
+#elif OS(DARWIN)
+#include <CoreFoundation/CoreFoundation.h>
+#elif OS(LINUX)
+#include <stdio.h>
+#endif
+
+namespace WebCore {
+
+static const char uuidVersionRequired = '4';
+static const int uuidVersionIdentifierIndex = 14;
+
+String createCanonicalUUIDString()
+{
+#if OS(WINDOWS)
+    GUID uuid = { 0 };
+    HRESULT hr = CoCreateGuid(&uuid);
+    if (FAILED(hr))
+        return String();
+    wchar_t uuidStr[40];
+    int num = StringFromGUID2(uuid, reinterpret_cast<LPOLESTR>(uuidStr), ARRAYSIZE(uuidStr));
+    ASSERT(num == 39);
+    String canonicalUuidStr = String(uuidStr + 1, num - 3).lower(); // remove opening and closing bracket and make it lower.
+    ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
+    return canonicalUuidStr;
+#elif OS(DARWIN)
+    CFUUIDRef uuid = CFUUIDCreate(0);
+    CFStringRef uuidStrRef = CFUUIDCreateString(0, uuid);
+    String uuidStr(uuidStrRef);
+    CFRelease(uuidStrRef);
+    CFRelease(uuid);
+    String canonicalUuidStr = uuidStr.lower(); // make it lower.
+    ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
+    return canonicalUuidStr;
+#elif OS(LINUX)
+    FILE* fptr = fopen("/proc/sys/kernel/random/uuid", "r");
+    if (!fptr)
+        return String();
+    char uuidStr[37] = {0};
+    fgets(uuidStr, sizeof(uuidStr) - 1, fptr);
+    fclose(fptr);
+    String canonicalUuidStr = String(uuidStr).lower(); // make it lower.
+    ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
+    return canonicalUuidStr;
+#else
+    notImplemented();
+    return String();
+#endif    
+}
+
+}
diff --git a/WebCore/platform/UUID.h b/WebCore/platform/UUID.h
new file mode 100644
index 0000000..85e111f
--- /dev/null
+++ b/WebCore/platform/UUID.h
@@ -0,0 +1,54 @@
+/*
+* 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 UUID_h
+#define UUID_h
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+// Creates a UUID that consists of 32 hexadecimal digits and returns its canonical form.
+// The canonical form is displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters.
+// The hexadecimal values "a" through "f" are output as lower case characters.
+//
+// Note: for security reason, we should always generate version 4 UUID that use a scheme relying only on random numbers.
+// This algorithm sets the version number as well as two reserved bits. All other bits are set using a random or pseudorandom
+// data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits for x and one of 8,
+// 9, A, or B for y.
+//
+// On Windows, version 4 UUIDs are used since Windows 2000 (http://msdn.microsoft.com/en-us/library/aa446557.aspx).
+// On MacOSX, version 4 UUIDs are used since Tiger (http://developer.apple.com/mac/library/technotes/tn/tn1103.html#TNTAG8).
+// On Linux, the kernel offers the procfs pseudo-file /proc/sys/kernel/random/uuid that yields version 4 UUIDs (http://hbfs.wordpress.com/2008/09/30/ueid-unique-enough-ids/).
+String createCanonicalUUIDString();
+
+}
+
+#endif
diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h
index 803bf3b..677fe34 100644
--- a/WebCore/platform/Widget.h
+++ b/WebCore/platform/Widget.h
@@ -21,14 +21,12 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef Widget_h
 #define Widget_h
 
-#include <wtf/Platform.h>
-
 #if PLATFORM(MAC)
 #ifdef __OBJC__
 @class NSView;
@@ -124,13 +122,20 @@
 
     PlatformWidget platformWidget() const { return m_widget; }
     void setPlatformWidget(PlatformWidget widget)
-    { 
+    {
         if (widget != m_widget) {
             releasePlatformWidget();
             m_widget = widget;
             retainPlatformWidget();
         }
     }
+#if PLATFORM(HAIKU)
+    PlatformWidget topLevelPlatformWidget() const { return m_topLevelPlatformWidget; }
+    void setTopLevelPlatformWidget(PlatformWidget widget)
+    {
+        m_topLevelPlatformWidget = widget;
+    }
+#endif
 
     int x() const { return frameRect().x(); }
     int y() const { return frameRect().y(); }
@@ -168,7 +173,7 @@
 
     virtual bool isFrameView() const { return false; }
     virtual bool isPluginView() const { return false; }
-    // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginWidget and PluginView can become one class. 
+    // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginWidget and PluginView can become one class.
     virtual bool isPluginWidget() const { return false; }
     virtual bool isScrollbar() const { return false; }
 
@@ -185,15 +190,18 @@
     // when converting window rects.
     IntRect convertToContainingWindow(const IntRect&) const;
     IntRect convertFromContainingWindow(const IntRect&) const;
-    
+
     IntPoint convertToContainingWindow(const IntPoint&) const;
     IntPoint convertFromContainingWindow(const IntPoint&) const;
 
     virtual void frameRectsChanged() {}
 
+    // Notifies this widget that other widgets on the page have been repositioned.
+    virtual void widgetPositionsUpdated() {}
+
 #if PLATFORM(MAC)
     NSView* getOuterView() const;
-    
+
     static void beforeMouseDown(NSView*, Widget*);
     static void afterMouseDown(NSView*, Widget*);
 
@@ -211,12 +219,12 @@
 
     void releasePlatformWidget();
     void retainPlatformWidget();
-    
+
     // These methods are used to convert from the root widget to the containing window,
     // which has behavior that may differ between platforms (e.g. Mac uses flipped window coordinates).
     static IntRect convertFromRootToContainingWindow(const Widget* rootWidget, const IntRect&);
     static IntRect convertFromContainingWindowToRoot(const Widget* rootWidget, const IntRect&);
-    
+
     static IntPoint convertFromRootToContainingWindow(const Widget* rootWidget, const IntPoint&);
     static IntPoint convertFromContainingWindowToRoot(const Widget* rootWidget, const IntPoint&);
 
@@ -225,15 +233,20 @@
     PlatformWidget m_widget;
     bool m_selfVisible;
     bool m_parentVisible;
-    
+
     IntRect m_frame; // Not used when a native widget exists.
 
 #if PLATFORM(MAC)
     WidgetPrivate* m_data;
 #endif
+<<<<<<< HEAD
 #if PLATFORM(ANDROID)
 public:
     int screenWidth() const;
+=======
+#if PLATFORM(HAIKU)
+    PlatformWidget m_topLevelPlatformWidget;
+>>>>>>> webkit.org at r58033
 #endif
 };
 
diff --git a/WebCore/platform/WindowsKeyboardCodes.h b/WebCore/platform/WindowsKeyboardCodes.h
new file mode 100644
index 0000000..86c77ea
--- /dev/null
+++ b/WebCore/platform/WindowsKeyboardCodes.h
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 VK_UNKNOWN
+
+#define VK_UNKNOWN 0
+
+// Left mouse button
+// Right mouse button
+// Control-break processing
+// Middle mouse button (three-button mouse)
+// VK_XBUTTON1 (05)
+// VK_XBUTTON2 (06)
+
+#define VK_BACK 0x08
+#define VK_TAB 0x09
+#define VK_CLEAR 0x0C
+#define VK_RETURN 0x0D
+#define VK_SHIFT 0x10
+#define VK_CONTROL 0x11 // CTRL key
+#define VK_MENU 0x12 // ALT key
+#define VK_PAUSE 0x13 // PAUSE key
+#define VK_CAPITAL 0x14 // CAPS LOCK key
+#define VK_KANA 0x15 // Input Method Editor (IME) Kana mode
+#define VK_HANGUL 0x15 // IME Hangul mode
+#define VK_JUNJA 0x17 // IME Junja mode
+#define VK_FINAL 0x18 // IME final mode
+#define VK_HANJA 0x19 // IME Hanja mode 
+#define VK_KANJI 0x19 // IME Kanji mode
+#define VK_ESCAPE 0x1B // ESC key
+#define VK_CONVERT 0x1C // IME convert
+#define VK_NONCONVERT 0x1D // IME nonconvert
+#define VK_ACCEPT 0x1E // IME accept
+#define VK_MODECHANGE 0x1F // IME mode change request
+#define VK_SPACE 0x20 // SPACE key
+#define VK_PRIOR 0x21 // PAGE UP key
+#define VK_NEXT 0x22 // PAGE DOWN key
+#define VK_END 0x23 // END key
+#define VK_HOME 0x24 // HOME key
+#define VK_LEFT 0x25 // LEFT ARROW key
+#define VK_UP 0x26 // UP ARROW key
+#define VK_RIGHT 0x27 // RIGHT ARROW key
+#define VK_DOWN 0x28 // DOWN ARROW key
+#define VK_SELECT 0x29 // SELECT key
+#define VK_PRINT 0x2A // PRINT key
+#define VK_EXECUTE 0x2B // EXECUTE key
+#define VK_SNAPSHOT 0x2C // PRINT SCREEN key
+#define VK_INSERT 0x2D // INS key
+#define VK_DELETE 0x2E // DEL key
+#define VK_HELP 0x2F // HELP key
+
+#define VK_0 0x30
+#define VK_1 0x31
+#define VK_2 0x32
+#define VK_3 0x33
+#define VK_4 0x34
+#define VK_5 0x35
+#define VK_6 0x36
+#define VK_7 0x37
+#define VK_8 0x38
+#define VK_9 0x39
+#define VK_A 0x41
+#define VK_B 0x42
+#define VK_C 0x43
+#define VK_D 0x44
+#define VK_E 0x45
+#define VK_F 0x46
+#define VK_G 0x47
+#define VK_H 0x48
+#define VK_I 0x49
+#define VK_J 0x4A
+#define VK_K 0x4B
+#define VK_L 0x4C
+#define VK_M 0x4D
+#define VK_N 0x4E
+#define VK_O 0x4F
+#define VK_P 0x50
+#define VK_Q 0x51
+#define VK_R 0x52
+#define VK_S 0x53
+#define VK_T 0x54
+#define VK_U 0x55
+#define VK_V 0x56
+#define VK_W 0x57
+#define VK_X 0x58
+#define VK_Y 0x59
+#define VK_Z 0x5A
+
+#define VK_LWIN 0x5B // Left Windows key (Microsoft Natural keyboard)
+
+#define VK_RWIN 0x5C // Right Windows key (Natural keyboard)
+
+#define VK_APPS 0x5D // Applications key (Natural keyboard)
+
+#define VK_SLEEP 0x5F // Computer Sleep key
+
+// Num pad keys
+#define VK_NUMPAD0 0x60
+#define VK_NUMPAD1 0x61
+#define VK_NUMPAD2 0x62
+#define VK_NUMPAD3 0x63
+#define VK_NUMPAD4 0x64
+#define VK_NUMPAD5 0x65
+#define VK_NUMPAD6 0x66
+#define VK_NUMPAD7 0x67
+#define VK_NUMPAD8 0x68
+#define VK_NUMPAD9 0x69
+#define VK_MULTIPLY 0x6A
+#define VK_ADD 0x6B
+#define VK_SEPARATOR 0x6C
+#define VK_SUBTRACT 0x6D
+#define VK_DECIMAL 0x6E
+#define VK_DIVIDE 0x6F
+
+#define VK_F1 0x70
+#define VK_F2 0x71
+#define VK_F3 0x72
+#define VK_F4 0x73
+#define VK_F5 0x74
+#define VK_F6 0x75
+#define VK_F7 0x76
+#define VK_F8 0x77
+#define VK_F9 0x78
+#define VK_F10 0x79
+#define VK_F11 0x7A
+#define VK_F12 0x7B
+#define VK_F13 0x7C
+#define VK_F14 0x7D
+#define VK_F15 0x7E
+#define VK_F16 0x7F
+#define VK_F17 0x80
+#define VK_F18 0x81
+#define VK_F19 0x82
+#define VK_F20 0x83
+#define VK_F21 0x84
+#define VK_F22 0x85
+#define VK_F23 0x86
+#define VK_F24 0x87
+
+#define VK_NUMLOCK 0x90
+#define VK_SCROLL 0x91
+#define VK_LSHIFT 0xA0
+#define VK_RSHIFT 0xA1
+#define VK_LCONTROL 0xA2
+#define VK_RCONTROL 0xA3
+#define VK_LMENU 0xA4
+#define VK_RMENU 0xA5
+
+#define VK_BROWSER_BACK 0xA6 // Windows 2000/XP: Browser Back key
+#define VK_BROWSER_FORWARD 0xA7 // Windows 2000/XP: Browser Forward key
+#define VK_BROWSER_REFRESH 0xA8 // Windows 2000/XP: Browser Refresh key
+#define VK_BROWSER_STOP 0xA9 // Windows 2000/XP: Browser Stop key
+#define VK_BROWSER_SEARCH 0xAA // Windows 2000/XP: Browser Search key
+#define VK_BROWSER_FAVORITES 0xAB // Windows 2000/XP: Browser Favorites key
+#define VK_BROWSER_HOME 0xAC // Windows 2000/XP: Browser Start and Home key
+#define VK_VOLUME_MUTE 0xAD // Windows 2000/XP: Volume Mute key
+#define VK_VOLUME_DOWN 0xAE // Windows 2000/XP: Volume Down key
+#define VK_VOLUME_UP 0xAF // Windows 2000/XP: Volume Up key
+#define VK_MEDIA_NEXT_TRACK 0xB0 // Windows 2000/XP: Next Track key
+#define VK_MEDIA_PREV_TRACK 0xB1 // Windows 2000/XP: Previous Track key
+#define VK_MEDIA_STOP 0xB2 // Windows 2000/XP: Stop Media key
+#define VK_MEDIA_PLAY_PAUSE 0xB3 // Windows 2000/XP: Play/Pause Media key
+#define VK_MEDIA_LAUNCH_MAIL 0xB4 // Windows 2000/XP: Start Mail key
+#define VK_MEDIA_LAUNCH_MEDIA_SELECT 0xB5 // Windows 2000/XP: Select Media key
+#define VK_MEDIA_LAUNCH_APP1 0xB6 // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
+#define VK_MEDIA_LAUNCH_APP2 0xB7 // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
+
+// VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
+#define VK_OEM_1 0xBA
+
+// Windows 2000/XP: For any country/region, the '+' key
+#define VK_OEM_PLUS 0xBB
+
+// Windows 2000/XP: For any country/region, the ',' key
+#define VK_OEM_COMMA 0xBC
+
+// Windows 2000/XP: For any country/region, the '-' key
+#define VK_OEM_MINUS 0xBD
+
+// Windows 2000/XP: For any country/region, the '.' key
+#define VK_OEM_PERIOD 0xBE
+
+// VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
+#define VK_OEM_2 0xBF
+
+// VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
+#define VK_OEM_3 0xC0
+
+// VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
+#define VK_OEM_4 0xDB
+
+// VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
+#define VK_OEM_5 0xDC
+
+// VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
+#define VK_OEM_6 0xDD
+
+// VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
+#define VK_OEM_7 0xDE
+
+// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
+#define VK_OEM_8 0xDF
+
+// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
+#define VK_OEM_102 0xE2
+
+// Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
+#define VK_PROCESSKEY 0xE5
+
+// Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
+#define VK_PACKET 0xE7
+
+#define VK_ATTN 0xF6 // Attn key
+#define VK_CRSEL 0xF7 // CrSel key
+#define VK_EXSEL 0xF8 // ExSel key
+#define VK_EREOF 0xF9 // Erase EOF key
+#define VK_PLAY 0xFA // Play key
+#define VK_ZOOM 0xFB // Zoom key
+
+#define VK_NONAME 0xFC // Reserved for future use
+
+#define VK_PA1 0xFD // VK_PA1 (FD) PA1 key
+
+#define VK_OEM_CLEAR 0xFE // Clear key
+
+#endif // VK_UNKNOWN
diff --git a/WebCore/platform/android/FileSystemAndroid.cpp b/WebCore/platform/android/FileSystemAndroid.cpp
index 46c1297..80df73b 100644
--- a/WebCore/platform/android/FileSystemAndroid.cpp
+++ b/WebCore/platform/android/FileSystemAndroid.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "StringBuilder.h"
 #include "cutils/log.h"
 #include <dirent.h>
@@ -36,6 +35,7 @@
 #include <errno.h>
 #include <fnmatch.h>
 #include <sys/stat.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/android/KeyEventAndroid.cpp b/WebCore/platform/android/KeyEventAndroid.cpp
index af29598..09bd0b5 100644
--- a/WebCore/platform/android/KeyEventAndroid.cpp
+++ b/WebCore/platform/android/KeyEventAndroid.cpp
@@ -31,8 +31,8 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
+#include "WindowsKeyboardCodes.h"
 #include <ui/KeycodeLabels.h>
 
 namespace WebCore {
@@ -251,6 +251,15 @@
     return false;
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    notImplemented();
+    shiftKey = false;
+    ctrlKey = false;
+    altKey = false;
+    metaKey = false;
+}
+
 void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
 {
     // Copied with modification from the mac port.
diff --git a/WebCore/platform/android/KeyboardCodes.h b/WebCore/platform/android/KeyboardCodes.h
deleted file mode 100644
index 321e9da..0000000
--- a/WebCore/platform/android/KeyboardCodes.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * Copyright 2009, The Android Open Source Project
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- *
- * 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 COMPUTER, 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 KeyboardCodes_H
-#define KeyboardCodes_H
-
-namespace WebCore {
-
-// VK_LBUTTON (01) Left mouse button
-// VK_RBUTTON (02) Right mouse button
-// VK_CANCEL (03) Control-break processing
-// VK_MBUTTON (04) Middle mouse button (three-button mouse)
-// VK_XBUTTON1 (05)
-// VK_XBUTTON2 (06)
-
-// VK_BACK (08) BACKSPACE key
-const int VK_BACK = 0x08;
-
-// VK_TAB (09) TAB key
-const int VK_TAB = 0x09;
-
-// VK_CLEAR (0C) CLEAR key
-const int VK_CLEAR = 0x0C;
-
-// VK_RETURN (0D)
-const int VK_RETURN = 0x0D;
-
-// VK_SHIFT (10) SHIFT key
-const int VK_SHIFT = 0x10;
-
-// VK_CONTROL (11) CTRL key
-const int VK_CONTROL = 0x11;
-
-// VK_MENU (12) ALT key
-const int VK_MENU = 0x12;
-
-// VK_PAUSE (13) PAUSE key
-const int VK_PAUSE = 0x13;
-
-// VK_CAPITAL (14) CAPS LOCK key
-const int VK_CAPITAL = 0x14;
-
-// VK_KANA (15) Input Method Editor (IME) Kana mode
-const int VK_KANA = 0x15;
-
-// VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
-// VK_HANGUL (15) IME Hangul mode
-const int VK_HANGUL = 0x15;
-
-// VK_JUNJA (17) IME Junja mode
-const int VK_JUNJA = 0x17;
-
-// VK_FINAL (18) IME final mode
-const int VK_FINAL = 0x18;
-
-// VK_HANJA (19) IME Hanja mode
-const int VK_HANJA = 0x19;
-
-// VK_KANJI (19) IME Kanji mode
-const int VK_KANJI = 0x19;
-
-// VK_ESCAPE (1B) ESC key
-const int VK_ESCAPE = 0x1B;
-
-// VK_CONVERT (1C) IME convert
-const int VK_CONVERT = 0x1C;
-
-// VK_NONCONVERT (1D) IME nonconvert
-const int VK_NONCONVERT = 0x1D;
-
-// VK_ACCEPT (1E) IME accept
-const int VK_ACCEPT = 0x1E;
-
-// VK_MODECHANGE (1F) IME mode change request
-const int VK_MODECHANGE = 0x1F;
-
-// VK_SPACE (20) SPACEBAR
-const int VK_SPACE = 0x20;
-
-// VK_PRIOR (21) PAGE UP key
-const int VK_PRIOR = 0x21;
-
-// VK_NEXT (22) PAGE DOWN key
-const int VK_NEXT = 0x22;
-
-// VK_END (23) END key
-const int VK_END = 0x23;
-
-// VK_HOME (24) HOME key
-const int VK_HOME = 0x24;
-
-// VK_LEFT (25) LEFT ARROW key
-const int VK_LEFT = 0x25;
-
-// VK_UP (26) UP ARROW key
-const int VK_UP = 0x26;
-
-// VK_RIGHT (27) RIGHT ARROW key
-const int VK_RIGHT = 0x27;
-
-// VK_DOWN (28) DOWN ARROW key
-const int VK_DOWN = 0x28;
-
-// VK_SELECT (29) SELECT key
-const int VK_SELECT = 0x29;
-
-// VK_PRINT (2A) PRINT key
-const int VK_PRINT = 0x2A;
-
-// VK_EXECUTE (2B) EXECUTE key
-const int VK_EXECUTE = 0x2B;
-
-// VK_SNAPSHOT (2C) PRINT SCREEN key
-const int VK_SNAPSHOT = 0x2C;
-
-// VK_INSERT (2D) INS key
-const int VK_INSERT = 0x2D;
-
-// VK_DELETE (2E) DEL key
-const int VK_DELETE = 0x2E;
-
-// VK_HELP (2F) HELP key
-const int VK_HELP = 0x2F;
-
-// (30) 0 key
-const int VK_0 = 0x30;
-
-// (31) 1 key
-const int VK_1 = 0x31;
-
-// (32) 2 key
-const int VK_2 = 0x32;
-
-// (33) 3 key
-const int VK_3 = 0x33;
-
-// (34) 4 key
-const int VK_4 = 0x34;
-
-// (35) 5 key;
-
-const int VK_5 = 0x35;
-
-// (36) 6 key
-const int VK_6 = 0x36;
-
-// (37) 7 key
-const int VK_7 = 0x37;
-
-// (38) 8 key
-const int VK_8 = 0x38;
-
-// (39) 9 key
-const int VK_9 = 0x39;
-
-// (41) A key
-const int VK_A = 0x41;
-
-// (42) B key
-const int VK_B = 0x42;
-
-// (43) C key
-const int VK_C = 0x43;
-
-// (44) D key
-const int VK_D = 0x44;
-
-// (45) E key
-const int VK_E = 0x45;
-
-// (46) F key
-const int VK_F = 0x46;
-
-// (47) G key
-const int VK_G = 0x47;
-
-// (48) H key
-const int VK_H = 0x48;
-
-// (49) I key
-const int VK_I = 0x49;
-
-// (4A) J key
-const int VK_J = 0x4A;
-
-// (4B) K key
-const int VK_K = 0x4B;
-
-// (4C) L key
-const int VK_L = 0x4C;
-
-// (4D) M key
-const int VK_M = 0x4D;
-
-// (4E) N key
-const int VK_N = 0x4E;
-
-// (4F) O key
-const int VK_O = 0x4F;
-
-// (50) P key
-const int VK_P = 0x50;
-
-// (51) Q key
-const int VK_Q = 0x51;
-
-// (52) R key
-const int VK_R = 0x52;
-
-// (53) S key
-const int VK_S = 0x53;
-
-// (54) T key
-const int VK_T = 0x54;
-
-// (55) U key
-const int VK_U = 0x55;
-
-// (56) V key
-const int VK_V = 0x56;
-
-// (57) W key
-const int VK_W = 0x57;
-
-// (58) X key
-const int VK_X = 0x58;
-
-// (59) Y key
-const int VK_Y = 0x59;
-
-// (5A) Z key
-const int VK_Z = 0x5A;
-
-// VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-const int VK_LWIN = 0x5B;
-
-// VK_RWIN (5C) Right Windows key (Natural keyboard)
-const int VK_RWIN = 0x5C;
-
-// VK_APPS (5D) Applications key (Natural keyboard)
-const int VK_APPS = 0x5D;
-
-// VK_SLEEP (5F) Computer Sleep key
-const int VK_SLEEP = 0x5F;
-
-// VK_NUMPAD0 (60) Numeric keypad 0 key
-const int VK_NUMPAD0 = 0x60;
-
-// VK_NUMPAD1 (61) Numeric keypad 1 key
-const int VK_NUMPAD1 = 0x61;
-
-// VK_NUMPAD2 (62) Numeric keypad 2 key
-const int VK_NUMPAD2 = 0x62;
-
-// VK_NUMPAD3 (63) Numeric keypad 3 key
-const int VK_NUMPAD3 = 0x63;
-
-// VK_NUMPAD4 (64) Numeric keypad 4 key
-const int VK_NUMPAD4 = 0x64;
-
-// VK_NUMPAD5 (65) Numeric keypad 5 key
-const int VK_NUMPAD5 = 0x65;
-
-// VK_NUMPAD6 (66) Numeric keypad 6 key
-const int VK_NUMPAD6 = 0x66;
-
-// VK_NUMPAD7 (67) Numeric keypad 7 key
-const int VK_NUMPAD7 = 0x67;
-
-// VK_NUMPAD8 (68) Numeric keypad 8 key
-const int VK_NUMPAD8 = 0x68;
-
-// VK_NUMPAD9 (69) Numeric keypad 9 key
-const int VK_NUMPAD9 = 0x69;
-
-// VK_MULTIPLY (6A) Multiply key
-const int VK_MULTIPLY = 0x6A;
-
-// VK_ADD (6B) Add key
-const int VK_ADD = 0x6B;
-
-// VK_SEPARATOR (6C) Separator key
-const int VK_SEPARATOR = 0x6C;
-
-// VK_SUBTRACT (6D) Subtract key
-const int VK_SUBTRACT = 0x6D;
-
-// VK_DECIMAL (6E) Decimal key
-const int VK_DECIMAL = 0x6E;
-
-// VK_DIVIDE (6F) Divide key
-const int VK_DIVIDE = 0x6F;
-
-// VK_F1 (70) F1 key
-const int VK_F1 = 0x70;
-
-// VK_F2 (71) F2 key
-const int VK_F2 = 0x71;
-
-// VK_F3 (72) F3 key
-const int VK_F3 = 0x72;
-
-// VK_F4 (73) F4 key
-const int VK_F4 = 0x73;
-
-// VK_F5 (74) F5 key
-const int VK_F5 = 0x74;
-
-// VK_F6 (75) F6 key
-const int VK_F6 = 0x75;
-
-// VK_F7 (76) F7 key
-const int VK_F7 = 0x76;
-
-// VK_F8 (77) F8 key
-const int VK_F8 = 0x77;
-
-// VK_F9 (78) F9 key
-const int VK_F9 = 0x78;
-
-// VK_F10 (79) F10 key
-const int VK_F10 = 0x79;
-
-// VK_F11 (7A) F11 key
-const int VK_F11 = 0x7A;
-
-// VK_F12 (7B) F12 key
-const int VK_F12 = 0x7B;
-
-// VK_F13 (7C) F13 key
-const int VK_F13 = 0x7C;
-
-// VK_F14 (7D) F14 key
-const int VK_F14 = 0x7D;
-
-// VK_F15 (7E) F15 key
-const int VK_F15 = 0x7E;
-
-// VK_F16 (7F) F16 key
-const int VK_F16 = 0x7F;
-
-// VK_F17 (80H) F17 key
-const int VK_F17 = 0x80;
-
-// VK_F18 (81H) F18 key
-const int VK_F18 = 0x81;
-
-// VK_F19 (82H) F19 key
-const int VK_F19 = 0x82;
-
-// VK_F20 (83H) F20 key
-const int VK_F20 = 0x83;
-
-// VK_F21 (84H) F21 key
-const int VK_F21 = 0x84;
-
-// VK_F22 (85H) F22 key
-const int VK_F22 = 0x85;
-
-// VK_F23 (86H) F23 key
-const int VK_F23 = 0x86;
-
-// VK_F24 (87H) F24 key
-const int VK_F24 = 0x87;
-
-// VK_NUMLOCK (90) NUM LOCK key
-const int VK_NUMLOCK = 0x90;
-
-// VK_SCROLL (91) SCROLL LOCK key
-const int VK_SCROLL = 0x91;
-
-// VK_LSHIFT (A0) Left SHIFT key
-const int VK_LSHIFT = 0xA0;
-
-// VK_RSHIFT (A1) Right SHIFT key
-const int VK_RSHIFT = 0xA1;
-
-// VK_LCONTROL (A2) Left CONTROL key
-const int VK_LCONTROL = 0xA2;
-
-// VK_RCONTROL (A3) Right CONTROL key
-const int VK_RCONTROL = 0xA3;
-
-// VK_LMENU (A4) Left MENU key
-const int VK_LMENU = 0xA4;
-
-// VK_RMENU (A5) Right MENU key
-const int VK_RMENU = 0xA5;
-
-// VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-const int VK_BROWSER_BACK = 0xA6;
-
-// VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-const int VK_BROWSER_FORWARD = 0xA7;
-
-// VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-const int VK_BROWSER_REFRESH = 0xA8;
-
-// VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-const int VK_BROWSER_STOP = 0xA9;
-
-// VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-const int VK_BROWSER_SEARCH = 0xAA;
-
-// VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-const int VK_BROWSER_FAVORITES = 0xAB;
-
-// VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-const int VK_BROWSER_HOME = 0xAC;
-
-// VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-const int VK_VOLUME_MUTE = 0xAD;
-
-// VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-const int VK_VOLUME_DOWN = 0xAE;
-
-// VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-const int VK_VOLUME_UP = 0xAF;
-
-// VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-const int VK_MEDIA_NEXT_TRACK = 0xB0;
-
-// VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-const int VK_MEDIA_PREV_TRACK = 0xB1;
-
-// VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-const int VK_MEDIA_STOP = 0xB2;
-
-// VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-const int VK_MEDIA_PLAY_PAUSE = 0xB3;
-
-// VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
-
-// VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
-
-// VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
-
-// VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
-
-// VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
-const int VK_OEM_1 = 0xBA;
-
-// VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-const int VK_OEM_PLUS = 0xBB;
-
-// VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-const int VK_OEM_COMMA = 0xBC;
-
-// VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-const int VK_OEM_MINUS = 0xBD;
-
-// VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-const int VK_OEM_PERIOD = 0xBE;
-
-// VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-const int VK_OEM_2 = 0xBF;
-
-// VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-const int VK_OEM_3 = 0xC0;
-
-// VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-const int VK_OEM_4 = 0xDB;
-
-// VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-const int VK_OEM_5 = 0xDC;
-
-// VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-const int VK_OEM_6 = 0xDD;
-
-// VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-const int VK_OEM_7 = 0xDE;
-
-// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
-const int VK_OEM_8 = 0xDF;
-
-// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-const int VK_OEM_102 = 0xE2;
-
-// VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-const int VK_PROCESSKEY = 0xE5;
-
-// VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-const int VK_PACKET = 0xE7;
-
-// VK_ATTN (F6) Attn key
-const int VK_ATTN = 0xF6;
-
-// VK_CRSEL (F7) CrSel key
-const int VK_CRSEL = 0xF7;
-
-// VK_EXSEL (F8) ExSel key
-const int VK_EXSEL = 0xF8;
-
-// VK_EREOF (F9) Erase EOF key
-const int VK_EREOF = 0xF9;
-
-// VK_PLAY (FA) Play key
-const int VK_PLAY = 0xFA;
-
-// VK_ZOOM (FB) Zoom key
-const int VK_ZOOM = 0xFB;
-
-// VK_NONAME (FC) Reserved for future use
-const int VK_NONAME = 0xFC;
-
-// VK_PA1 (FD) PA1 key
-const int VK_PA1 = 0xFD;
-
-// VK_OEM_CLEAR (FE) Clear key
-const int VK_OEM_CLEAR = 0xFE;
-
-const int VK_UNKNOWN = 0;
-
-}
-
-#endif // KeyboardCodes_h
diff --git a/WebCore/platform/android/TemporaryLinkStubs.cpp b/WebCore/platform/android/TemporaryLinkStubs.cpp
index 6dac5ef..85e6195 100644
--- a/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -29,7 +29,6 @@
 #define ANDROID_COMPILE_HACK
 
 #include "AXObjectCache.h"
-#include "CString.h"
 #include "CachedPage.h"
 #include "CachedResource.h"
 #include "Clipboard.h"
@@ -79,13 +78,13 @@
 #include "loader.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <wtf/text/CString.h>
 
 #if USE(JSC)
 #include "API/JSClassRef.h"
 #include "JNIUtilityPrivate.h"
 #include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
-#include "JavaScriptProfile.h"
+#include "ScriptDebugServer.h"
 #endif
 
 using namespace WebCore;
diff --git a/WebCore/platform/animation/Animation.cpp b/WebCore/platform/animation/Animation.cpp
index 05761f8..bc33a9e 100644
--- a/WebCore/platform/animation/Animation.cpp
+++ b/WebCore/platform/animation/Animation.cpp
@@ -32,10 +32,12 @@
     , m_duration(initialAnimationDuration())
     , m_timingFunction(initialAnimationTimingFunction())
     , m_direction(initialAnimationDirection())
+    , m_fillMode(initialAnimationFillMode())
     , m_playState(initialAnimationPlayState())
     , m_delaySet(false)
     , m_directionSet(false)
     , m_durationSet(false)
+    , m_fillModeSet(false)
     , m_iterationCountSet(false)
     , m_nameSet(false)
     , m_playStateSet(false)
@@ -54,10 +56,12 @@
     , m_duration(o.m_duration)
     , m_timingFunction(o.m_timingFunction)
     , m_direction(o.m_direction)
+    , m_fillMode(o.m_fillMode)
     , m_playState(o.m_playState)
     , m_delaySet(o.m_delaySet)
     , m_directionSet(o.m_directionSet)
     , m_durationSet(o.m_durationSet)
+    , m_fillModeSet(o.m_fillModeSet)
     , m_iterationCountSet(o.m_iterationCountSet)
     , m_nameSet(o.m_nameSet)
     , m_playStateSet(o.m_playStateSet)
@@ -76,11 +80,13 @@
     m_duration = o.m_duration;
     m_timingFunction = o.m_timingFunction;
     m_direction = o.m_direction;
+    m_fillMode = o.m_fillMode;
     m_playState = o.m_playState;
 
     m_delaySet = o.m_delaySet;
     m_directionSet = o.m_directionSet;
     m_durationSet = o.m_durationSet;
+    m_fillModeSet = o.m_fillModeSet;
     m_iterationCountSet = o.m_iterationCountSet;
     m_nameSet = o.m_nameSet;
     m_playStateSet = o.m_playStateSet;
@@ -107,9 +113,11 @@
                   m_duration == o->m_duration &&
                   m_timingFunction == o->m_timingFunction &&
                   m_direction == o->m_direction &&
+                  m_fillMode == o->m_fillMode &&
                   m_delaySet == o->m_delaySet &&
                   m_directionSet == o->m_directionSet &&
                   m_durationSet == o->m_durationSet &&
+                  m_fillModeSet == o->m_fillModeSet &&
                   m_iterationCountSet == o->m_iterationCountSet &&
                   m_nameSet == o->m_nameSet &&
                   m_propertySet == o->m_propertySet &&
diff --git a/WebCore/platform/animation/Animation.h b/WebCore/platform/animation/Animation.h
index 306a1b9..a629f43 100644
--- a/WebCore/platform/animation/Animation.h
+++ b/WebCore/platform/animation/Animation.h
@@ -44,6 +44,7 @@
     bool isDelaySet() const { return m_delaySet; }
     bool isDirectionSet() const { return m_directionSet; }
     bool isDurationSet() const { return m_durationSet; }
+    bool isFillModeSet() const { return m_fillModeSet; }
     bool isIterationCountSet() const { return m_iterationCountSet; }
     bool isNameSet() const { return m_nameSet; }
     bool isPlayStateSet() const { return m_playStateSet; }
@@ -58,8 +59,9 @@
 
     bool isEmpty() const
     {
-        return (!m_directionSet && !m_durationSet && !m_nameSet && !m_playStateSet && 
-               !m_iterationCountSet && !m_delaySet && !m_timingFunctionSet && !m_propertySet);
+        return (!m_directionSet && !m_durationSet && !m_fillModeSet
+                && !m_nameSet && !m_playStateSet && !m_iterationCountSet
+                && !m_delaySet && !m_timingFunctionSet && !m_propertySet);
     }
 
     bool isEmptyOrZeroDuration() const
@@ -70,6 +72,7 @@
     void clearDelay() { m_delaySet = false; }
     void clearDirection() { m_directionSet = false; }
     void clearDuration() { m_durationSet = false; }
+    void clearFillMode() { m_fillModeSet = false; }
     void clearIterationCount() { m_iterationCountSet = false; }
     void clearName() { m_nameSet = false; }
     void clearPlayState() { m_playStateSet = AnimPlayStatePlaying; }
@@ -81,6 +84,8 @@
     enum AnimationDirection { AnimationDirectionNormal, AnimationDirectionAlternate };
     AnimationDirection direction() const { return m_direction; }
 
+    unsigned fillMode() const { return m_fillMode; }
+
     double duration() const { return m_duration; }
 
     enum { IterationCountInfinite = -1 };
@@ -93,6 +98,7 @@
     void setDelay(double c) { m_delay = c; m_delaySet = true; }
     void setDirection(AnimationDirection d) { m_direction = d; m_directionSet = true; }
     void setDuration(double d) { ASSERT(d >= 0); m_duration = d; m_durationSet = true; }
+    void setFillMode(unsigned f) { m_fillMode = f; m_fillModeSet = true; }
     void setIterationCount(int c) { m_iterationCount = c; m_iterationCountSet = true; }
     void setName(const String& n) { m_name = n; m_nameSet = true; }
     void setPlayState(unsigned d) { m_playState = d; m_playStateSet = true; }
@@ -110,6 +116,9 @@
     bool operator==(const Animation& o) const { return animationsMatch(&o); }
     bool operator!=(const Animation& o) const { return !(*this == o); }
 
+    bool fillsBackwards() const { return m_fillModeSet && (m_fillMode == AnimationFillModeBackwards || m_fillMode == AnimationFillModeBoth); }
+    bool fillsForwards() const { return m_fillModeSet && (m_fillMode == AnimationFillModeForwards || m_fillMode == AnimationFillModeBoth); }
+
 private:
     Animation();
     Animation(const Animation& o);
@@ -121,12 +130,14 @@
     double m_duration;
     TimingFunction m_timingFunction;
     AnimationDirection m_direction : 1;
+    unsigned m_fillMode : 2;
 
     unsigned m_playState     : 2;
 
     bool m_delaySet          : 1;
     bool m_directionSet      : 1;
     bool m_durationSet       : 1;
+    bool m_fillModeSet       : 1;
     bool m_iterationCountSet : 1;
     bool m_nameSet           : 1;
     bool m_playStateSet      : 1;
@@ -139,6 +150,7 @@
     static float initialAnimationDelay() { return 0; }
     static AnimationDirection initialAnimationDirection() { return AnimationDirectionNormal; }
     static double initialAnimationDuration() { return 0; }
+    static unsigned initialAnimationFillMode() { return AnimationFillModeNone; }
     static int initialAnimationIterationCount() { return 1; }
     static String initialAnimationName() { return String("none"); }
     static unsigned initialAnimationPlayState() { return AnimPlayStatePlaying; }
diff --git a/WebCore/platform/animation/AnimationList.cpp b/WebCore/platform/animation/AnimationList.cpp
index 804dede..bd5fdee 100644
--- a/WebCore/platform/animation/AnimationList.cpp
+++ b/WebCore/platform/animation/AnimationList.cpp
@@ -37,6 +37,7 @@
     FILL_UNSET_PROPERTY(isDelaySet, delay, setDelay);
     FILL_UNSET_PROPERTY(isDirectionSet, direction, setDirection);
     FILL_UNSET_PROPERTY(isDurationSet, duration, setDuration);
+    FILL_UNSET_PROPERTY(isFillModeSet, fillMode, setFillMode);
     FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, setIterationCount);
     FILL_UNSET_PROPERTY(isPlayStateSet, playState, setPlayState);
     FILL_UNSET_PROPERTY(isNameSet, name, setName);
diff --git a/WebCore/platform/animation/TimingFunction.h b/WebCore/platform/animation/TimingFunction.h
index f114596..d3f71ff 100644
--- a/WebCore/platform/animation/TimingFunction.h
+++ b/WebCore/platform/animation/TimingFunction.h
@@ -29,7 +29,7 @@
 
 namespace WebCore {
 
-struct TimingFunction {
+struct TimingFunction : FastAllocBase {
     TimingFunction()
         : m_type(CubicBezierTimingFunction)
         , m_x1(0.25)
@@ -39,6 +39,16 @@
     {
     }
 
+    // This explicit copy constructor works around an inlining bug in GCC 4.2 (only reproed on mac, but may exist on other platforms).
+    TimingFunction(const TimingFunction& that)
+        : m_type(that.m_type)
+        , m_x1(that.m_x1)
+        , m_y1(that.m_y1)
+        , m_x2(that.m_x2)
+        , m_y2(that.m_y2)
+    {
+    }
+
     TimingFunction(ETimingFunctionType timingFunction, double x1 = 0.0, double y1 = 0.0, double x2 = 1.0, double y2 = 1.0)
         : m_type(timingFunction)
         , m_x1(x1)
diff --git a/WebCore/platform/brew/KURLBrew.cpp b/WebCore/platform/brew/KURLBrew.cpp
index e0fb303..3f21ddd 100644
--- a/WebCore/platform/brew/KURLBrew.cpp
+++ b/WebCore/platform/brew/KURLBrew.cpp
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "KURL.h"
 
-#include "CString.h"
+#include <wtf/text/CString.h>
 
 #include <AEEFile.h>
 
diff --git a/WebCore/platform/brew/MIMETypeRegistryBrew.cpp b/WebCore/platform/brew/MIMETypeRegistryBrew.cpp
index d194116..0a538c2 100644
--- a/WebCore/platform/brew/MIMETypeRegistryBrew.cpp
+++ b/WebCore/platform/brew/MIMETypeRegistryBrew.cpp
@@ -76,5 +76,10 @@
     return "text/plain";
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 } // namespace WebCore
 
diff --git a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
index 758d15c..9d172a3 100644
--- a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
+++ b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
+#include "WindowsKeyboardCodes.h"
 
 #include <AEEEvent.h>
 #include <AEEStdDef.h>
@@ -170,5 +170,13 @@
     return false;
 }
 
-} // namespace WebCore
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    notImplemented();
+    shiftKey = false;
+    ctrlKey = false;
+    altKey = false;
+    metaKey = false;
+}
 
+} // namespace WebCore
diff --git a/WebCore/platform/cf/FileSystemCF.cpp b/WebCore/platform/cf/FileSystemCF.cpp
index b6cc645..e3a144c 100644
--- a/WebCore/platform/cf/FileSystemCF.cpp
+++ b/WebCore/platform/cf/FileSystemCF.cpp
@@ -28,8 +28,8 @@
 #import "config.h"
 #import "FileSystem.h"
 
-#import "CString.h"
 #import "PlatformString.h"
+#import <wtf/text/CString.h>
 #import <wtf/RetainPtr.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/cf/SharedBufferCF.cpp b/WebCore/platform/cf/SharedBufferCF.cpp
index 33e25ae..18a65c2 100644
--- a/WebCore/platform/cf/SharedBufferCF.cpp
+++ b/WebCore/platform/cf/SharedBufferCF.cpp
@@ -48,7 +48,9 @@
         return m_cfData.get();
     }
 
-    return CFDataCreate(0, reinterpret_cast<const UInt8*>(m_buffer.data()), m_buffer.size());
+    // Internal data in SharedBuffer can be segmented. We need to get the contiguous buffer.
+    const Vector<char>& contiguousBuffer = buffer();
+    return CFDataCreate(0, reinterpret_cast<const UInt8*>(contiguousBuffer.data()), contiguousBuffer.size());
 }
 #endif
 
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index 5a085be..e582241 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -57,6 +57,7 @@
     class GeolocationServiceChromium;
     class GraphicsContext;
     class Image;
+    class IndexedDatabase;
     class IntRect;
     class KURL;
     class String;
@@ -64,6 +65,7 @@
 
     struct Cookie;
     struct PluginInfo;
+    struct FontRenderStyle;
 
     // An interface to the embedding layer, which has the ability to answer
     // questions about the system and so on...
@@ -113,6 +115,7 @@
         static bool ensureFontLoaded(HFONT font);
 #endif
 #if OS(LINUX)
+        static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
         static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
 #endif
 
@@ -134,6 +137,9 @@
         static long long databaseGetFileSize(const String& vfsFileName);
 #endif
 
+        // IndexedDB ----------------------------------------------------------
+        static PassRefPtr<IndexedDatabase> indexedDatabase();
+
         // JavaScript ---------------------------------------------------------
         static void notifyJSOutOfMemory(Frame*);
         static bool allowScriptDespiteSettings(const KURL& documentURL);
diff --git a/WebCore/platform/chromium/ChromiumDataObject.cpp b/WebCore/platform/chromium/ChromiumDataObject.cpp
index 77a5f0f..5c67c65 100644
--- a/WebCore/platform/chromium/ChromiumDataObject.cpp
+++ b/WebCore/platform/chromium/ChromiumDataObject.cpp
@@ -35,11 +35,17 @@
 
 void ChromiumDataObject::clear()
 {
+    clearAllExceptFiles();
+    filenames.clear();
+}
+
+void ChromiumDataObject::clearAllExceptFiles()
+{
     url = KURL();
     urlTitle = "";
+    uriList.clear();
     downloadMetadata = "";
     fileExtension = "";
-    filenames.clear();
     plainText = "";
     textHtml = "";
     htmlBaseUrl = KURL();
@@ -51,6 +57,7 @@
 bool ChromiumDataObject::hasData() const
 {
     return !url.isEmpty()
+        || !uriList.isEmpty()
         || !downloadMetadata.isEmpty()
         || !fileExtension.isEmpty()
         || !filenames.isEmpty()
@@ -60,8 +67,7 @@
 }
 
 ChromiumDataObject::ChromiumDataObject(const ChromiumDataObject& other)
-    : url(other.url)
-    , urlTitle(other.urlTitle)
+    : urlTitle(other.urlTitle)
     , downloadMetadata(other.downloadMetadata)
     , fileExtension(other.fileExtension)
     , filenames(other.filenames)
@@ -69,6 +75,8 @@
     , textHtml(other.textHtml)
     , htmlBaseUrl(other.htmlBaseUrl)
     , fileContentFilename(other.fileContentFilename)
+    , url(other.url)
+    , uriList(other.uriList)
 {
     if (other.fileContent.get())
         fileContent = other.fileContent->copy();
diff --git a/WebCore/platform/chromium/ChromiumDataObject.h b/WebCore/platform/chromium/ChromiumDataObject.h
index 5fae3e3..625cb8c 100644
--- a/WebCore/platform/chromium/ChromiumDataObject.h
+++ b/WebCore/platform/chromium/ChromiumDataObject.h
@@ -33,6 +33,7 @@
 
 #include "KURL.h"
 #include "PlatformString.h"
+#include "SharedBuffer.h"
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
@@ -54,9 +55,33 @@
         }
 
         void clear();
+        void clearAllExceptFiles();
         bool hasData() const;
 
-        KURL url;
+        void clearURL()
+        {
+            url = KURL();
+            uriList.clear();
+            urlTitle = "";
+        }
+
+        bool hasValidURL() const
+        {
+            return url.isValid();
+        }
+
+        KURL getURL() const
+        {
+            return url;
+        }
+
+        void setURL(const KURL& newURL)
+        {
+            url = newURL;
+            uriList.clear();
+            uriList.append(newURL.string());
+        }
+
         String urlTitle;
 
         String downloadMetadata;
@@ -73,8 +98,14 @@
         RefPtr<SharedBuffer> fileContent;
 
     private:
+        // URL and uri-list are linked, so they should not be accessed individually.
+        KURL url;
+        Vector<String> uriList;
+
         ChromiumDataObject() {}
         ChromiumDataObject(const ChromiumDataObject&);
+
+        friend class ClipboardChromium;
     };
 
 } // namespace WebCore
diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp
index a1f60a6..21d7edf 100644
--- a/WebCore/platform/chromium/ClipboardChromium.cpp
+++ b/WebCore/platform/chromium/ClipboardChromium.cpp
@@ -36,15 +36,16 @@
 #include "FileList.h"
 #include "Frame.h"
 #include "HTMLNames.h"
-#include "NamedAttrMap.h"
+#include "Image.h"
 #include "MIMETypeRegistry.h"
-#include "markup.h"
+#include "NamedAttrMap.h"
 #include "NamedNodeMap.h"
 #include "Pasteboard.h"
 #include "PlatformString.h"
 #include "Range.h"
 #include "RenderImage.h"
 #include "StringBuilder.h"
+#include "markup.h"
 
 namespace WebCore {
 
@@ -53,21 +54,40 @@
 // We provide the IE clipboard types (URL and Text), and the clipboard types specified in the WHATWG Web Applications 1.0 draft
 // see http://www.whatwg.org/specs/web-apps/current-work/ Section 6.3.5.3
 
-enum ClipboardDataType { ClipboardDataTypeNone, ClipboardDataTypeURL, ClipboardDataTypeText, ClipboardDataTypeDownloadURL };
+enum ClipboardDataType {
+    ClipboardDataTypeNone,
+
+    ClipboardDataTypeURL,
+    ClipboardDataTypeURIList,
+    ClipboardDataTypeDownloadURL,
+    ClipboardDataTypePlainText,
+    ClipboardDataTypeHTML,
+
+    ClipboardDataTypeOther,
+};
+
+// Per RFC 2483, the line separator for "text/..." MIME types is CR-LF.
+static char const* const textMIMETypeLineSeparator = "\r\n";
 
 static ClipboardDataType clipboardTypeFromMIMEType(const String& type)
 {
     String cleanType = type.stripWhiteSpace().lower();
+    if (cleanType.isEmpty())
+        return ClipboardDataTypeNone;
 
-    // two special cases for IE compatibility
+    // Includes two special cases for IE compatibility.
     if (cleanType == "text" || cleanType == "text/plain" || cleanType.startsWith("text/plain;"))
-        return ClipboardDataTypeText;
-    if (cleanType == "url" || cleanType == "text/uri-list")
+        return ClipboardDataTypePlainText;
+    if (cleanType == "url")
         return ClipboardDataTypeURL;
+    if (cleanType == "text/uri-list")
+        return ClipboardDataTypeURIList;
     if (cleanType == "downloadurl")
         return ClipboardDataTypeDownloadURL;
+    if (cleanType == "text/html")
+        return ClipboardDataTypeHTML;
 
-    return ClipboardDataTypeNone;
+    return ClipboardDataTypeOther;
 }
 
 ClipboardChromium::ClipboardChromium(bool isForDragging,
@@ -90,14 +110,37 @@
         return;
 
     ClipboardDataType dataType = clipboardTypeFromMIMEType(type);
+    switch (dataType) {
+    case ClipboardDataTypeNone:
+        // If called with no arguments, everything except the file list must be cleared.
+        // (See HTML5 spec, "The DragEvent and DataTransfer interfaces")
+        m_dataObject->clearAllExceptFiles();
+        return;
 
-    if (dataType == ClipboardDataTypeURL) {
-        m_dataObject->url = KURL();
-        m_dataObject->urlTitle = "";
+    case ClipboardDataTypeURL:
+    case ClipboardDataTypeURIList:
+        m_dataObject->clearURL();
+        return;
+
+    case ClipboardDataTypeDownloadURL:
+        m_dataObject->downloadMetadata = "";
+        return;
+        
+    case ClipboardDataTypePlainText:
+        m_dataObject->plainText = "";
+        return;
+
+    case ClipboardDataTypeHTML:
+        m_dataObject->textHtml = "";
+        m_dataObject->htmlBaseUrl = KURL();
+        return;
+
+    case ClipboardDataTypeOther:
+        // Not yet implemented, see https://bugs.webkit.org/show_bug.cgi?id=34410
+        return;
     }
 
-    if (dataType == ClipboardDataTypeText)
-        m_dataObject->plainText = "";
+    ASSERT_NOT_REACHED();
 }
 
 void ClipboardChromium::clearAllData()
@@ -115,8 +158,52 @@
         return String();
 
     ClipboardDataType dataType = clipboardTypeFromMIMEType(type);
-    String text;
-    if (dataType == ClipboardDataTypeText) {
+    switch (dataType) {
+    case ClipboardDataTypeNone:
+        return String();
+
+    case ClipboardDataTypeURIList:
+        {
+            String text;
+            for (size_t i = 0; i < m_dataObject->uriList.size(); ++i) {
+                const String& uri = m_dataObject->uriList[i];
+                ASSERT(!uri.isEmpty());
+                if (!text.isEmpty())
+                    text.append(textMIMETypeLineSeparator);
+                // URIs have already been canonicalized, so copy everything verbatim.
+                text.append(uri);
+            }
+            // Also create file:// URLs out of the entries in the file list.
+            for (size_t i = 0; i < m_dataObject->filenames.size(); ++i) {
+                String fileURL = ChromiumBridge::filePathToURL(m_dataObject->filenames[i]);
+                ASSERT(!fileURL.isEmpty());
+                if (!text.isEmpty())
+                    text.append(textMIMETypeLineSeparator);
+                text.append(fileURL);
+            }
+            success = !text.isEmpty();
+            return text;
+        }
+
+    case ClipboardDataTypeURL:
+        // In case of a previous setData('text/uri-list'), setData() has already
+        // prepared the 'url' member, so we can just retrieve it here.
+        if (!m_dataObject->url.isEmpty()) {
+            success = true;
+            return m_dataObject->url.string();
+        }
+        // Otherwise check if we have a file that we could convert to a file:// URL.
+        if (!m_dataObject->filenames.isEmpty()) {
+            success = true;
+            return ChromiumBridge::filePathToURL(m_dataObject->filenames[0]);
+        }
+        return String();
+
+    case ClipboardDataTypeDownloadURL:
+        success = !m_dataObject->downloadMetadata.isEmpty();
+        return m_dataObject->downloadMetadata;
+    
+    case ClipboardDataTypePlainText:
         if (!isForDragging()) {
             // If this isn't for a drag, it's for a cut/paste event handler.
             // In this case, we need to check the clipboard.
@@ -124,22 +211,39 @@
                 Pasteboard::generalPasteboard()->isSelectionMode() ?
                 PasteboardPrivate::SelectionBuffer : 
                 PasteboardPrivate::StandardBuffer;
-            text = ChromiumBridge::clipboardReadPlainText(buffer);
+            String text = ChromiumBridge::clipboardReadPlainText(buffer);
             success = !text.isEmpty();
-        } else if (!m_dataObject->plainText.isEmpty()) {
-            success = true;
-            text = m_dataObject->plainText;
+            return text;
         }
-    } else if (dataType == ClipboardDataTypeURL) {
-        // FIXME: Handle the cut/paste event.  This requires adding a new IPC
-        // message to get the URL from the clipboard directly.
-        if (!m_dataObject->url.isEmpty()) {
-            success = true;
-            text = m_dataObject->url.string();
+        // Otherwise return whatever is stored in plainText.
+        success = !m_dataObject->plainText.isEmpty();
+        return m_dataObject->plainText;
+
+    case ClipboardDataTypeHTML:
+        if (!isForDragging()) {
+            // If this isn't for a drag, it's for a cut/paste event handler.
+            // In this case, we need to check the clipboard.
+            PasteboardPrivate::ClipboardBuffer buffer = 
+                Pasteboard::generalPasteboard()->isSelectionMode() ?
+                PasteboardPrivate::SelectionBuffer : 
+                PasteboardPrivate::StandardBuffer;
+            String htmlText;
+            KURL sourceURL;
+            ChromiumBridge::clipboardReadHTML(buffer, &htmlText, &sourceURL);
+            success = !htmlText.isEmpty();
+            return htmlText;
         }
+        // Otherwise return whatever is stored in textHtml.
+        success = !m_dataObject->textHtml.isEmpty();
+        return m_dataObject->textHtml;
+
+    case ClipboardDataTypeOther:
+        // not yet implemented, see https://bugs.webkit.org/show_bug.cgi?id=34410
+        return String();
     }
 
-    return text;
+    ASSERT_NOT_REACHED();
+    return String();
 }
 
 bool ClipboardChromium::setData(const String& type, const String& data)
@@ -147,23 +251,68 @@
     if (policy() != ClipboardWritable)
         return false;
 
-    ClipboardDataType winType = clipboardTypeFromMIMEType(type);
+    ClipboardDataType dataType = clipboardTypeFromMIMEType(type);
+    switch (dataType) {
+    case ClipboardDataTypeNone:
+        return false;
 
-    if (winType == ClipboardDataTypeURL) {
-        m_dataObject->url = KURL(ParsedURLString, data);
-        return m_dataObject->url.isValid();
-    }
-
-    if (winType == ClipboardDataTypeText) {
-        m_dataObject->plainText = data;
+    case ClipboardDataTypeURL:
+        // For setData(), "URL" must be treated as "text/uri-list".
+        // (See HTML5 spec, "The DragEvent and DataTransfer interfaces")
+    case ClipboardDataTypeURIList:
+        m_dataObject->url = KURL();
+        // Line separator is \r\n per RFC 2483 - however, for compatibility reasons
+        // we also allow just \n here. 
+        data.split('\n', m_dataObject->uriList);
+        // Strip white space on all lines, including trailing \r from above split.
+        // If this leaves a line empty, remove it completely.
+        //
+        // Also, copy the first valid URL into the 'url' member as well.
+        // In case no entry is a valid URL (i.e., remarks only), then we leave 'url' empty.
+        // I.e., in that case subsequent calls to getData("URL") will get an empty string.
+        // This is in line with the HTML5 spec (see "The DragEvent and DataTransfer interfaces").
+        for (size_t i = 0; i < m_dataObject->uriList.size(); /**/) {
+            String& line = m_dataObject->uriList[i];
+            line = line.stripWhiteSpace();
+            if (line.isEmpty()) {
+                m_dataObject->uriList.remove(i);
+                continue;
+            }
+            ++i;
+            // Only copy the first valid URL.
+            if (m_dataObject->url.isValid())
+                continue;
+            // Skip remarks.
+            if (line[0] == '#')
+                continue;
+            KURL url = KURL(ParsedURLString, line);
+            if (url.isValid())
+                m_dataObject->url = url;
+        }
+        if (m_dataObject->uriList.isEmpty()) {
+            ASSERT(m_dataObject->url.isEmpty());
+            return data.isEmpty();
+        }
         return true;
-    }
-    
-    if (winType == ClipboardDataTypeDownloadURL) {
+
+    case ClipboardDataTypeDownloadURL:
         m_dataObject->downloadMetadata = data;
         return true;
-    }
 
+    case ClipboardDataTypePlainText:
+        m_dataObject->plainText = data;
+        return true;
+
+    case ClipboardDataTypeHTML:
+        m_dataObject->textHtml = data;
+        return true;
+
+    case ClipboardDataTypeOther:
+        // Not yet implemented, see https://bugs.webkit.org/show_bug.cgi?id=34410
+        return false;
+    }
+    
+    ASSERT_NOT_REACHED();
     return false;
 }
 
@@ -177,11 +326,19 @@
     if (!m_dataObject)
         return results;
 
-    if (!m_dataObject->filenames.isEmpty())
+    if (!m_dataObject->filenames.isEmpty()) {
+        results.add("text/uri-list");
         results.add("Files");
+    }
 
     if (m_dataObject->url.isValid()) {
+        ASSERT(!m_dataObject->uriList.isEmpty());
         results.add("URL");
+    }
+
+    if (!m_dataObject->uriList.isEmpty()) {
+        // Note that even if the URI list is not empty, it may not actually
+        // contain a valid URL, so we can't return "URL" here.
         results.add("text/uri-list");
     }
 
diff --git a/WebCore/platform/chromium/DragDataChromium.cpp b/WebCore/platform/chromium/DragDataChromium.cpp
index 9b67fc0..8fb40de 100644
--- a/WebCore/platform/chromium/DragDataChromium.cpp
+++ b/WebCore/platform/chromium/DragDataChromium.cpp
@@ -64,8 +64,8 @@
 String DragData::asURL(String* title) const
 {
     String url;
-    if (m_platformDragData->url.isValid())
-        url = m_platformDragData->url.string();
+    if (m_platformDragData->hasValidURL())
+        url = m_platformDragData->getURL().string();
     else if (m_platformDragData->filenames.size() == 1) {
         String fileName = m_platformDragData->filenames[0];
         fileName = ChromiumBridge::getAbsolutePath(fileName);
@@ -113,7 +113,7 @@
     // ClipboardWin::writeRange is called).  For example, dragging a link
     // should not result in a space being added.
     return !m_platformDragData->plainText.isEmpty()
-        && !m_platformDragData->url.isValid();
+        && !m_platformDragData->hasValidURL();
 }
 
 bool DragData::containsCompatibleContent() const
diff --git a/WebCore/platform/chromium/DragImageChromium.cpp b/WebCore/platform/chromium/DragImageChromium.cpp
deleted file mode 100644
index 8c1484e..0000000
--- a/WebCore/platform/chromium/DragImageChromium.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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 "DragImage.h"
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-IntSize dragImageSize(DragImageRef image)
-{
-    notImplemented();
-    return IntSize();
-}
-
-void deleteDragImage(DragImageRef image)
-{
-    notImplemented();
-}
-
-DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
-{
-    notImplemented();
-    return 0;
-}
-    
-DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
-{
-    notImplemented();
-    return image;
-}
-        
-DragImageRef createDragImageFromImage(Image* img)
-{    
-    notImplemented();
-    return 0;
-}
-    
-DragImageRef createDragImageIconForCachedImage(CachedImage*)
-{
-    notImplemented();
-    return 0;     
-}
-    
-} // namespace WebCore
diff --git a/WebCore/platform/chromium/DragImageChromiumMac.cpp b/WebCore/platform/chromium/DragImageChromiumMac.cpp
new file mode 100644
index 0000000..a0c2e20
--- /dev/null
+++ b/WebCore/platform/chromium/DragImageChromiumMac.cpp
@@ -0,0 +1,114 @@
+/*
+ * 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 "DragImage.h"
+
+#include "Image.h"
+#include "NotImplemented.h"
+#include <wtf/RetainPtr.h>
+
+#include <CoreGraphics/CGBitmapContext.h>
+#include <CoreGraphics/CGImage.h>
+
+namespace WebCore {
+
+IntSize dragImageSize(DragImageRef image)
+{
+    if (!image)
+        return IntSize();
+    return IntSize(CGImageGetWidth(image), CGImageGetHeight(image));
+}
+
+void deleteDragImage(DragImageRef image)
+{
+    CGImageRelease(image);
+}
+
+DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
+{
+    if (!image)
+        return 0;
+    size_t width = roundf(CGImageGetWidth(image) * scale.width());
+    size_t height = roundf(CGImageGetHeight(image) * scale.height());
+
+    RetainPtr<CGColorSpaceRef> deviceRGB(WTF::AdoptCF, CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB));
+    CGContextRef context = CGBitmapContextCreate(0, width, height, 8, width * 4, deviceRGB.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
+
+    if (!context)
+        return 0;
+    CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
+    CGImageRelease(image);
+
+    CGImageRef scaledImage = CGBitmapContextCreateImage(context);
+    CGContextRelease(context);
+    return scaledImage;
+}
+
+DragImageRef dissolveDragImageToFraction(DragImageRef image, float delta)
+{
+    if (!image)
+        return 0;
+    size_t width = CGImageGetWidth(image);
+    size_t height = CGImageGetHeight(image);
+
+    RetainPtr<CGColorSpaceRef> deviceRGB(WTF::AdoptCF, CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB));
+    CGContextRef context = CGBitmapContextCreate(0, width, height, 8, width * 4, deviceRGB.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
+
+    if (!context)
+        return 0;
+    // From CGContext.h:
+    //     The Porter-Duff "source over" mode is called `kCGBlendModeNormal':
+    //       R = S + D*(1 - Sa)
+    //  This is the same as NSCompositeSourceOver, which is what -[NSImage dissolveToPoint:fraction:] uses.
+    CGContextSetAlpha(context, delta);
+    CGContextSetBlendMode(context, kCGBlendModeNormal);
+    CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
+    CGImageRelease(image);
+
+    CGImageRef dissolvedImage = CGBitmapContextCreateImage(context);
+    CGContextRelease(context);
+    return dissolvedImage;
+}
+
+DragImageRef createDragImageFromImage(Image* image)
+{
+    if (!image)
+        return 0;
+    return CGImageCreateCopy(image->nativeImageForCurrentFrame());
+}
+
+DragImageRef createDragImageIconForCachedImage(CachedImage*)
+{
+    notImplemented();
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/chromium/DragImageChromiumSkia.cpp b/WebCore/platform/chromium/DragImageChromiumSkia.cpp
new file mode 100644
index 0000000..24bd8fd
--- /dev/null
+++ b/WebCore/platform/chromium/DragImageChromiumSkia.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2008, 2009, 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 "DragImage.h"
+
+#include "Image.h"
+#include "NativeImageSkia.h"
+#include "NotImplemented.h"
+#include "RefPtr.h"
+#include "SkBitmap.h"
+
+#include "skia/ext/image_operations.h"
+
+namespace WebCore {
+
+IntSize dragImageSize(DragImageRef image)
+{
+    if (!image)
+        return IntSize();
+
+    return IntSize(image->width(), image->height());
+}
+
+void deleteDragImage(DragImageRef image)
+{
+    delete image;
+}
+
+DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
+{
+    if (!image)
+        return 0;
+
+    int imageWidth = scale.width() * image->width();
+    int imageHeight = scale.height() * image->height();
+    DragImageRef scaledImage = new SkBitmap(
+        skia::ImageOperations::Resize(*image, skia::ImageOperations::RESIZE_LANCZOS3,
+                                      imageWidth, imageHeight));
+    delete image;
+    return scaledImage;
+}
+
+DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
+{
+    notImplemented();
+    return image;
+}
+
+DragImageRef createDragImageFromImage(Image* image)
+{
+    if (!image)
+        return 0;
+
+    NativeImageSkia* bitmap = image->nativeImageForCurrentFrame();
+    return bitmap ? new SkBitmap(*bitmap) : 0;
+}
+
+DragImageRef createDragImageIconForCachedImage(CachedImage*)
+{
+    notImplemented();
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/chromium/DragImageRef.h b/WebCore/platform/chromium/DragImageRef.h
index 53edd4f..a2d7f8d 100644
--- a/WebCore/platform/chromium/DragImageRef.h
+++ b/WebCore/platform/chromium/DragImageRef.h
@@ -29,11 +29,19 @@
 #ifndef DragImageRef_h
 #define DragImageRef_h
 
+#if OS(DARWIN)
+typedef struct CGImage* CGImageRef;
+#else
+class SkBitmap;
+#endif
+
 namespace WebCore {
 
-    // FIXME: Need to support image drag-n-drop.  For now, we just allow things
-    // to compile by defining this dummy type.
-    typedef void* DragImageRef;
+#if OS(DARWIN)
+typedef CGImageRef DragImageRef;
+#else
+typedef SkBitmap* DragImageRef;
+#endif
 
 } // namespace WebCore
 
diff --git a/WebCore/platform/chromium/FramelessScrollView.cpp b/WebCore/platform/chromium/FramelessScrollView.cpp
index 114eabb..3fbf2d6 100644
--- a/WebCore/platform/chromium/FramelessScrollView.cpp
+++ b/WebCore/platform/chromium/FramelessScrollView.cpp
@@ -59,7 +59,7 @@
 void FramelessScrollView::invalidateRect(const IntRect& rect)
 {
     if (HostWindow* h = hostWindow())
-        h->repaint(rect, true);
+        h->invalidateContentsAndWindow(rect, false /*immediate*/);
 }
 
 HostWindow* FramelessScrollView::hostWindow() const
diff --git a/WebCore/platform/chromium/GLES2Context.h b/WebCore/platform/chromium/GLES2Context.h
new file mode 100644
index 0000000..93a343c
--- /dev/null
+++ b/WebCore/platform/chromium/GLES2Context.h
@@ -0,0 +1,62 @@
+/*
+ * 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 GLES2Context_h
+#define GLES2Context_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class GLES2ContextInternal;
+class Page;
+
+class GLES2Context : public Noncopyable {
+public:
+    // If a Page is specified then the resulting GL ES context draws directly
+    // to the window associated with the Page, otherwise an off-screen GL ES context is
+    // created.
+    static PassOwnPtr<GLES2Context> create(Page*);
+    ~GLES2Context();
+
+    bool makeCurrent();
+    bool destroy();
+    bool swapBuffers();
+
+private:
+    friend class GLES2ContextInternal;
+    OwnPtr<GLES2ContextInternal> m_internal;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/platform/chromium/GeolocationServiceChromium.cpp b/WebCore/platform/chromium/GeolocationServiceChromium.cpp
index 4e00908..4402fe4 100644
--- a/WebCore/platform/chromium/GeolocationServiceChromium.cpp
+++ b/WebCore/platform/chromium/GeolocationServiceChromium.cpp
@@ -1,10 +1,10 @@
 /*
  * 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
@@ -14,7 +14,7 @@
  *     * 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
@@ -39,19 +39,18 @@
         : GeolocationService(c),
           m_geolocation(reinterpret_cast<Geolocation*>(c)),
           m_geolocationServiceBridge(ChromiumBridge::createGeolocationServiceBridge(this)),
-          m_lastPosition(Geoposition::create(Coordinates::create(0.0, 0.0, false, 0.0, 0.0, false, 0.0, false, 0.0, false, 0.0), 0)),
           m_lastError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ""))
 {
 }
 
 void GeolocationServiceChromium::setIsAllowed(bool allowed)
 {
-    m_geolocation->setIsAllowed(allowed);  
+    m_geolocation->setIsAllowed(allowed);
 }
 
-void GeolocationServiceChromium::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp)
+void GeolocationServiceChromium::setLastPosition(PassRefPtr<Geoposition> geoposition)
 {
-    m_lastPosition = Geoposition::create(Coordinates::create(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed), timestamp);
+    m_lastPosition = geoposition;
     positionChanged();
 }
 
diff --git a/WebCore/platform/chromium/GeolocationServiceChromium.h b/WebCore/platform/chromium/GeolocationServiceChromium.h
index e32de8b..000c770 100644
--- a/WebCore/platform/chromium/GeolocationServiceChromium.h
+++ b/WebCore/platform/chromium/GeolocationServiceChromium.h
@@ -1,10 +1,10 @@
 /*
  * 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
@@ -14,7 +14,7 @@
  *     * 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
@@ -61,7 +61,7 @@
 
     GeolocationServiceBridge* geolocationServiceBridge() const { return m_geolocationServiceBridge.get(); }
     void setIsAllowed(bool allowed);
-    void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp);
+    void setLastPosition(PassRefPtr<Geoposition>);
     void setLastError(int errorCode, const String& message);
     Frame* frame();
 
@@ -75,7 +75,7 @@
 
 private:
     Geolocation* m_geolocation;
-    OwnPtr<GeolocationServiceBridge> m_geolocationServiceBridge;    
+    OwnPtr<GeolocationServiceBridge> m_geolocationServiceBridge;
     RefPtr<Geoposition> m_lastPosition;
     RefPtr<PositionError> m_lastError;
 };
diff --git a/WebCore/platform/chromium/KeyboardCodes.h b/WebCore/platform/chromium/KeyboardCodes.h
new file mode 100644
index 0000000..ee4024a
--- /dev/null
+++ b/WebCore/platform/chromium/KeyboardCodes.h
@@ -0,0 +1,555 @@
+/*
+ * Copyright (c) 2008, 2009, 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 KeyboardCodesWin_h
+#define KeyboardCodesWin_h
+
+#if OS(WINDOWS)
+#include <windows.h>
+#endif
+
+#include "WindowsKeyboardCodes.h"
+
+namespace WebCore {
+
+    enum {
+        // VKEY_LBUTTON (01) Left mouse button
+        // VKEY_RBUTTON (02) Right mouse button
+        // VKEY_CANCEL (03) Control-break processing
+        // VKEY_MBUTTON (04) Middle mouse button (three-button mouse)
+        // VKEY_XBUTTON1 (05)
+        // VKEY_XBUTTON2 (06)
+
+        // VKEY_BACK (08) BACKSPACE key
+        VKEY_BACK = VK_BACK,
+
+        // VKEY_TAB (09) TAB key
+        VKEY_TAB = VK_TAB,
+
+        // VKEY_CLEAR (0C) CLEAR key
+        VKEY_CLEAR = VK_CLEAR,
+
+        // VKEY_RETURN (0D)
+        VKEY_RETURN = VK_RETURN,
+
+        // VKEY_SHIFT (10) SHIFT key
+        VKEY_SHIFT = VK_SHIFT,
+
+        // VKEY_CONTROL (11) CTRL key
+        VKEY_CONTROL = VK_CONTROL,
+
+        // VKEY_MENU (12) ALT key
+        VKEY_MENU = VK_MENU,
+
+        // VKEY_PAUSE (13) PAUSE key
+        VKEY_PAUSE = VK_PAUSE,
+
+        // VKEY_CAPITAL (14) CAPS LOCK key
+        VKEY_CAPITAL = VK_CAPITAL,
+
+        // VKEY_KANA (15) Input Method Editor (IME) Kana mode
+        VKEY_KANA = VK_KANA,
+
+        // VKEY_HANGUEL (15) IME Hanguel mode (maintained for compatibility, use VKEY_HANGUL)
+        // VKEY_HANGUL (15) IME Hangul mode
+        VKEY_HANGUL = VK_HANGUL,
+
+        // VKEY_JUNJA (17) IME Junja mode
+        VKEY_JUNJA = VK_JUNJA,
+
+        // VKEY_FINAL (18) IME final mode
+        VKEY_FINAL = VK_FINAL,
+
+        // VKEY_HANJA (19) IME Hanja mode
+        VKEY_HANJA = VK_HANJA,
+
+        // VKEY_KANJI (19) IME Kanji mode
+        VKEY_KANJI = VK_KANJI,
+
+        // VKEY_ESCAPE (1B) ESC key
+        VKEY_ESCAPE = VK_ESCAPE,
+
+        // VKEY_CONVERT (1C) IME convert
+        VKEY_CONVERT = VK_CONVERT,
+
+        // VKEY_NONCONVERT (1D) IME nonconvert
+        VKEY_NONCONVERT = VK_NONCONVERT,
+
+        // VKEY_ACCEPT (1E) IME accept
+        VKEY_ACCEPT = VK_ACCEPT,
+
+        // VKEY_MODECHANGE (1F) IME mode change request
+        VKEY_MODECHANGE = VK_MODECHANGE,
+
+        // VKEY_SPACE (20) SPACEBAR
+        VKEY_SPACE = VK_SPACE,
+
+        // VKEY_PRIOR (21) PAGE UP key
+        VKEY_PRIOR = VK_PRIOR,
+
+        // VKEY_NEXT (22) PAGE DOWN key
+        VKEY_NEXT = VK_NEXT,
+
+        // VKEY_END (23) END key
+        VKEY_END = VK_END,
+
+        // VKEY_HOME (24) HOME key
+        VKEY_HOME = VK_HOME,
+
+        // VKEY_LEFT (25) LEFT ARROW key
+        VKEY_LEFT = VK_LEFT,
+
+        // VKEY_UP (26) UP ARROW key
+        VKEY_UP = VK_UP,
+
+        // VKEY_RIGHT (27) RIGHT ARROW key
+        VKEY_RIGHT = VK_RIGHT,
+
+        // VKEY_DOWN (28) DOWN ARROW key
+        VKEY_DOWN = VK_DOWN,
+
+        // VKEY_SELECT (29) SELECT key
+        VKEY_SELECT = VK_SELECT,
+
+        // VKEY_PRINT (2A) PRINT key
+        VKEY_PRINT = VK_PRINT,
+
+        // VKEY_EXECUTE (2B) EXECUTE key
+        VKEY_EXECUTE = VK_EXECUTE,
+
+        // VKEY_SNAPSHOT (2C) PRINT SCREEN key
+        VKEY_SNAPSHOT = VK_SNAPSHOT,
+
+        // VKEY_INSERT (2D) INS key
+        VKEY_INSERT = VK_INSERT,
+
+        // VKEY_DELETE (2E) DEL key
+        VKEY_DELETE = VK_DELETE,
+
+        // VKEY_HELP (2F) HELP key
+        VKEY_HELP = VK_HELP,
+
+        // (30) 0 key
+        VKEY_0 = '0',
+
+        // (31) 1 key
+        VKEY_1 = '1',
+
+        // (32) 2 key
+        VKEY_2 = '2',
+
+        // (33) 3 key
+        VKEY_3 = '3',
+
+        // (34) 4 key
+        VKEY_4 = '4',
+
+        // (35) 5 key,
+
+        VKEY_5 = '5',
+
+        // (36) 6 key
+        VKEY_6 = '6',
+
+        // (37) 7 key
+        VKEY_7 = '7',
+
+        // (38) 8 key
+        VKEY_8 = '8',
+
+        // (39) 9 key
+        VKEY_9 = '9',
+
+        // (41) A key
+        VKEY_A = 'A',
+
+        // (42) B key
+        VKEY_B = 'B',
+
+        // (43) C key
+        VKEY_C = 'C',
+
+        // (44) D key
+        VKEY_D = 'D',
+
+        // (45) E key
+        VKEY_E = 'E',
+
+        // (46) F key
+        VKEY_F = 'F',
+
+        // (47) G key
+        VKEY_G = 'G',
+
+        // (48) H key
+        VKEY_H = 'H',
+
+        // (49) I key
+        VKEY_I = 'I',
+
+        // (4A) J key
+        VKEY_J = 'J',
+
+        // (4B) K key
+        VKEY_K = 'K',
+
+        // (4C) L key
+        VKEY_L = 'L',
+
+        // (4D) M key
+        VKEY_M = 'M',
+
+        // (4E) N key
+        VKEY_N = 'N',
+
+        // (4F) O key
+        VKEY_O = 'O',
+
+        // (50) P key
+        VKEY_P = 'P',
+
+        // (51) Q key
+        VKEY_Q = 'Q',
+
+        // (52) R key
+        VKEY_R = 'R',
+
+        // (53) S key
+        VKEY_S = 'S',
+
+        // (54) T key
+        VKEY_T = 'T',
+
+        // (55) U key
+        VKEY_U = 'U',
+
+        // (56) V key
+        VKEY_V = 'V',
+
+        // (57) W key
+        VKEY_W = 'W',
+
+        // (58) X key
+        VKEY_X = 'X',
+
+        // (59) Y key
+        VKEY_Y = 'Y',
+
+        // (5A) Z key
+        VKEY_Z = 'Z',
+
+        // VKEY_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
+        VKEY_LWIN = VK_LWIN,
+
+        // VKEY_RWIN (5C) Right Windows key (Natural keyboard)
+        VKEY_RWIN = VK_RWIN,
+
+        // VKEY_APPS (5D) Applications key (Natural keyboard)
+        VKEY_APPS = VK_APPS,
+
+        // VKEY_SLEEP (5F) Computer Sleep key
+        VKEY_SLEEP = VK_SLEEP,
+
+        // VKEY_NUMPAD0 (60) Numeric keypad 0 key
+        VKEY_NUMPAD0 = VK_NUMPAD0,
+
+        // VKEY_NUMPAD1 (61) Numeric keypad 1 key
+        VKEY_NUMPAD1 = VK_NUMPAD1,
+
+        // VKEY_NUMPAD2 (62) Numeric keypad 2 key
+        VKEY_NUMPAD2 = VK_NUMPAD2,
+
+        // VKEY_NUMPAD3 (63) Numeric keypad 3 key
+        VKEY_NUMPAD3 = VK_NUMPAD3,
+
+        // VKEY_NUMPAD4 (64) Numeric keypad 4 key
+        VKEY_NUMPAD4 = VK_NUMPAD4,
+
+        // VKEY_NUMPAD5 (65) Numeric keypad 5 key
+        VKEY_NUMPAD5 = VK_NUMPAD5,
+
+        // VKEY_NUMPAD6 (66) Numeric keypad 6 key
+        VKEY_NUMPAD6 = VK_NUMPAD6,
+
+        // VKEY_NUMPAD7 (67) Numeric keypad 7 key
+        VKEY_NUMPAD7 = VK_NUMPAD7,
+
+        // VKEY_NUMPAD8 (68) Numeric keypad 8 key
+        VKEY_NUMPAD8 = VK_NUMPAD8,
+
+        // VKEY_NUMPAD9 (69) Numeric keypad 9 key
+        VKEY_NUMPAD9 = VK_NUMPAD9,
+
+        // VKEY_MULTIPLY (6A) Multiply key
+        VKEY_MULTIPLY = VK_MULTIPLY,
+
+        // VKEY_ADD (6B) Add key
+        VKEY_ADD = VK_ADD,
+
+        // VKEY_SEPARATOR (6C) Separator key
+        VKEY_SEPARATOR = VK_SEPARATOR,
+
+        // VKEY_SUBTRACT (6D) Subtract key
+        VKEY_SUBTRACT = VK_SUBTRACT,
+
+        // VKEY_DECIMAL (6E) Decimal key
+        VKEY_DECIMAL = VK_DECIMAL,
+
+        // VKEY_DIVIDE (6F) Divide key
+        VKEY_DIVIDE = VK_DIVIDE,
+
+        // VKEY_F1 (70) F1 key
+        VKEY_F1 = VK_F1,
+
+        // VKEY_F2 (71) F2 key
+        VKEY_F2 = VK_F2,
+
+        // VKEY_F3 (72) F3 key
+        VKEY_F3 = VK_F3,
+
+        // VKEY_F4 (73) F4 key
+        VKEY_F4 = VK_F4,
+
+        // VKEY_F5 (74) F5 key
+        VKEY_F5 = VK_F5,
+
+        // VKEY_F6 (75) F6 key
+        VKEY_F6 = VK_F6,
+
+        // VKEY_F7 (76) F7 key
+        VKEY_F7 = VK_F7,
+
+        // VKEY_F8 (77) F8 key
+        VKEY_F8 = VK_F8,
+
+        // VKEY_F9 (78) F9 key
+        VKEY_F9 = VK_F9,
+
+        // VKEY_F10 (79) F10 key
+        VKEY_F10 = VK_F10,
+
+        // VKEY_F11 (7A) F11 key
+        VKEY_F11 = VK_F11,
+
+        // VKEY_F12 (7B) F12 key
+        VKEY_F12 = VK_F12,
+
+        // VKEY_F13 (7C) F13 key
+        VKEY_F13 = VK_F13,
+
+        // VKEY_F14 (7D) F14 key
+        VKEY_F14 = VK_F14,
+
+        // VKEY_F15 (7E) F15 key
+        VKEY_F15 = VK_F15,
+
+        // VKEY_F16 (7F) F16 key
+        VKEY_F16 = VK_F16,
+
+        // VKEY_F17 (80H) F17 key
+        VKEY_F17 = VK_F17,
+
+        // VKEY_F18 (81H) F18 key
+        VKEY_F18 = VK_F18,
+
+        // VKEY_F19 (82H) F19 key
+        VKEY_F19 = VK_F19,
+
+        // VKEY_F20 (83H) F20 key
+        VKEY_F20 = VK_F20,
+
+        // VKEY_F21 (84H) F21 key
+        VKEY_F21 = VK_F21,
+
+        // VKEY_F22 (85H) F22 key
+        VKEY_F22 = VK_F22,
+
+        // VKEY_F23 (86H) F23 key
+        VKEY_F23 = VK_F23,
+
+        // VKEY_F24 (87H) F24 key
+        VKEY_F24 = VK_F24,
+
+        // VKEY_NUMLOCK (90) NUM LOCK key
+        VKEY_NUMLOCK = VK_NUMLOCK,
+
+        // VKEY_SCROLL (91) SCROLL LOCK key
+        VKEY_SCROLL = VK_SCROLL,
+
+        // VKEY_LSHIFT (A0) Left SHIFT key
+        VKEY_LSHIFT = VK_LSHIFT,
+
+        // VKEY_RSHIFT (A1) Right SHIFT key
+        VKEY_RSHIFT = VK_RSHIFT,
+
+        // VKEY_LCONTROL (A2) Left CONTROL key
+        VKEY_LCONTROL = VK_LCONTROL,
+
+        // VKEY_RCONTROL (A3) Right CONTROL key
+        VKEY_RCONTROL = VK_RCONTROL,
+
+        // VKEY_LMENU (A4) Left MENU key
+        VKEY_LMENU = VK_LMENU,
+
+        // VKEY_RMENU (A5) Right MENU key
+        VKEY_RMENU = VK_RMENU,
+
+        // VKEY_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
+        VKEY_BROWSER_BACK = VK_BROWSER_BACK,
+
+        // VKEY_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
+        VKEY_BROWSER_FORWARD = VK_BROWSER_FORWARD,
+
+        // VKEY_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
+        VKEY_BROWSER_REFRESH = VK_BROWSER_REFRESH,
+
+        // VKEY_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
+        VKEY_BROWSER_STOP = VK_BROWSER_STOP,
+
+        // VKEY_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
+        VKEY_BROWSER_SEARCH = VK_BROWSER_SEARCH,
+
+        // VKEY_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
+        VKEY_BROWSER_FAVORITES = VK_BROWSER_FAVORITES,
+
+        // VKEY_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
+        VKEY_BROWSER_HOME = VK_BROWSER_HOME,
+
+        // VKEY_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
+        VKEY_VOLUME_MUTE = VK_VOLUME_MUTE,
+
+        // VKEY_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
+        VKEY_VOLUME_DOWN = VK_VOLUME_DOWN,
+
+        // VKEY_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
+        VKEY_VOLUME_UP = VK_VOLUME_UP,
+
+        // VKEY_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
+        VKEY_MEDIA_NEXT_TRACK = VK_MEDIA_NEXT_TRACK,
+
+        // VKEY_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
+        VKEY_MEDIA_PREV_TRACK = VK_MEDIA_PREV_TRACK,
+
+        // VKEY_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
+        VKEY_MEDIA_STOP = VK_MEDIA_STOP,
+
+        // VKEY_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
+        VKEY_MEDIA_PLAY_PAUSE = VK_MEDIA_PLAY_PAUSE,
+
+        // VKEY_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
+        VKEY_MEDIA_LAUNCH_MAIL = 0xB4,
+
+        // VKEY_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
+        VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
+
+        // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
+        VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
+
+        // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
+        VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
+
+        // VKEY_OEM_1 (BA) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ',:' key
+        VKEY_OEM_1 = VK_OEM_1,
+
+        // VKEY_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
+        VKEY_OEM_PLUS = VK_OEM_PLUS,
+
+        // VKEY_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
+        VKEY_OEM_COMMA = VK_OEM_COMMA,
+
+        // VKEY_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
+        VKEY_OEM_MINUS = VK_OEM_MINUS,
+
+        // VKEY_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
+        VKEY_OEM_PERIOD = VK_OEM_PERIOD,
+
+        // VKEY_OEM_2 (BF) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
+        VKEY_OEM_2 = VK_OEM_2,
+
+        // VKEY_OEM_3 (C0) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
+        VKEY_OEM_3 = VK_OEM_3,
+
+        // VKEY_OEM_4 (DB) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
+        VKEY_OEM_4 = VK_OEM_4,
+
+        // VKEY_OEM_5 (DC) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
+        VKEY_OEM_5 = VK_OEM_5,
+
+        // VKEY_OEM_6 (DD) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
+        VKEY_OEM_6 = VK_OEM_6,
+
+        // VKEY_OEM_7 (DE) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
+        VKEY_OEM_7 = VK_OEM_7,
+
+        // VKEY_OEM_8 (DF) Used for miscellaneous characters, it can vary by keyboard.
+        VKEY_OEM_8 = VK_OEM_8,
+
+        // VKEY_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
+        VKEY_OEM_102 = VK_OEM_102,
+
+        // VKEY_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
+        VKEY_PROCESSKEY = VK_PROCESSKEY,
+
+        // VKEY_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VKEY_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
+        VKEY_PACKET = VK_PACKET,
+
+        // VKEY_ATTN (F6) Attn key
+        VKEY_ATTN = VK_ATTN,
+
+        // VKEY_CRSEL (F7) CrSel key
+        VKEY_CRSEL = VK_CRSEL,
+
+        // VKEY_EXSEL (F8) ExSel key
+        VKEY_EXSEL = VK_EXSEL,
+
+        // VKEY_EREOF (F9) Erase EOF key
+        VKEY_EREOF = VK_EREOF,
+
+        // VKEY_PLAY (FA) Play key
+        VKEY_PLAY = VK_PLAY,
+
+        // VKEY_ZOOM (FB) Zoom key
+        VKEY_ZOOM = VK_ZOOM,
+
+        // VKEY_NONAME (FC) Reserved for future use
+        VKEY_NONAME = VK_NONAME,
+
+        // VKEY_PA1 (FD) PA1 key
+        VKEY_PA1 = VK_PA1,
+
+        // VKEY_OEM_CLEAR (FE) Clear key
+        VKEY_OEM_CLEAR = VK_OEM_CLEAR,
+
+        VKEY_UNKNOWN = 0
+    };
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/platform/chromium/KeyboardCodesPosix.h b/WebCore/platform/chromium/KeyboardCodesPosix.h
deleted file mode 100644
index 1dfe77e..0000000
--- a/WebCore/platform/chromium/KeyboardCodesPosix.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com. All rights reserved.
- * Copyright (C) 2008, 2009 Google Inc.
- *
- * 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 COMPUTER, 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 KeyboardCodesPosix_h
-#define KeyboardCodesPosix_h
-
-namespace WebCore {
-
-    enum {
-        // VKEY_LBUTTON (01) Left mouse button
-        // VKEY_RBUTTON (02) Right mouse button
-        // VKEY_CANCEL (03) Control-break processing
-        // VKEY_MBUTTON (04) Middle mouse button (three-button mouse)
-        // VKEY_XBUTTON1 (05)
-        // VKEY_XBUTTON2 (06)
-
-        // VKEY_BACK (08) BACKSPACE key
-        VKEY_BACK = 0x08,
-
-        // VKEY_TAB (09) TAB key
-        VKEY_TAB = 0x09,
-
-        // VKEY_CLEAR (0C) CLEAR key
-        VKEY_CLEAR = 0x0C,
-
-        // VKEY_RETURN (0D)
-        VKEY_RETURN = 0x0D,
-
-        // VKEY_SHIFT (10) SHIFT key
-        VKEY_SHIFT = 0x10,
-
-        // VKEY_CONTROL (11) CTRL key
-        VKEY_CONTROL = 0x11,
-
-        // VKEY_MENU (12) ALT key
-        VKEY_MENU = 0x12,
-
-        // VKEY_PAUSE (13) PAUSE key
-        VKEY_PAUSE = 0x13,
-
-        // VKEY_CAPITAL (14) CAPS LOCK key
-        VKEY_CAPITAL = 0x14,
-
-        // VKEY_KANA (15) Input Method Editor (IME) Kana mode
-        VKEY_KANA = 0x15,
-
-        // VKEY_HANGUEL (15) IME Hanguel mode (maintained for compatibility, use VKEY_HANGUL)
-        // VKEY_HANGUL (15) IME Hangul mode
-        VKEY_HANGUL = 0x15,
-
-        // VKEY_JUNJA (17) IME Junja mode
-        VKEY_JUNJA = 0x17,
-
-        // VKEY_FINAL (18) IME final mode
-        VKEY_FINAL = 0x18,
-
-        // VKEY_HANJA (19) IME Hanja mode
-        VKEY_HANJA = 0x19,
-
-        // VKEY_KANJI (19) IME Kanji mode
-        VKEY_KANJI = 0x19,
-
-        // VKEY_ESCAPE (1B) ESC key
-        VKEY_ESCAPE = 0x1B,
-
-        // VKEY_CONVERT (1C) IME convert
-        VKEY_CONVERT = 0x1C,
-
-        // VKEY_NONCONVERT (1D) IME nonconvert
-        VKEY_NONCONVERT = 0x1D,
-
-        // VKEY_ACCEPT (1E) IME accept
-        VKEY_ACCEPT = 0x1E,
-
-        // VKEY_MODECHANGE (1F) IME mode change request
-        VKEY_MODECHANGE = 0x1F,
-
-        // VKEY_SPACE (20) SPACEBAR
-        VKEY_SPACE = 0x20,
-
-        // VKEY_PRIOR (21) PAGE UP key
-        VKEY_PRIOR = 0x21,
-
-        // VKEY_NEXT (22) PAGE DOWN key
-        VKEY_NEXT = 0x22,
-
-        // VKEY_END (23) END key
-        VKEY_END = 0x23,
-
-        // VKEY_HOME (24) HOME key
-        VKEY_HOME = 0x24,
-
-        // VKEY_LEFT (25) LEFT ARROW key
-        VKEY_LEFT = 0x25,
-
-        // VKEY_UP (26) UP ARROW key
-        VKEY_UP = 0x26,
-
-        // VKEY_RIGHT (27) RIGHT ARROW key
-        VKEY_RIGHT = 0x27,
-
-        // VKEY_DOWN (28) DOWN ARROW key
-        VKEY_DOWN = 0x28,
-
-        // VKEY_SELECT (29) SELECT key
-        VKEY_SELECT = 0x29,
-
-        // VKEY_PRINT (2A) PRINT key
-        VKEY_PRINT = 0x2A,
-
-        // VKEY_EXECUTE (2B) EXECUTE key
-        VKEY_EXECUTE = 0x2B,
-
-        // VKEY_SNAPSHOT (2C) PRINT SCREEN key
-        VKEY_SNAPSHOT = 0x2C,
-
-        // VKEY_INSERT (2D) INS key
-        VKEY_INSERT = 0x2D,
-
-        // VKEY_DELETE (2E) DEL key
-        VKEY_DELETE = 0x2E,
-
-        // VKEY_HELP (2F) HELP key
-        VKEY_HELP = 0x2F,
-
-        // (30) 0 key
-        VKEY_0 = 0x30,
-
-        // (31) 1 key
-        VKEY_1 = 0x31,
-
-        // (32) 2 key
-        VKEY_2 = 0x32,
-
-        // (33) 3 key
-        VKEY_3 = 0x33,
-
-        // (34) 4 key
-        VKEY_4 = 0x34,
-
-        // (35) 5 key,
-
-        VKEY_5 = 0x35,
-
-        // (36) 6 key
-        VKEY_6 = 0x36,
-
-        // (37) 7 key
-        VKEY_7 = 0x37,
-
-        // (38) 8 key
-        VKEY_8 = 0x38,
-
-        // (39) 9 key
-        VKEY_9 = 0x39,
-
-        // (41) A key
-        VKEY_A = 0x41,
-
-        // (42) B key
-        VKEY_B = 0x42,
-
-        // (43) C key
-        VKEY_C = 0x43,
-
-        // (44) D key
-        VKEY_D = 0x44,
-
-        // (45) E key
-        VKEY_E = 0x45,
-
-        // (46) F key
-        VKEY_F = 0x46,
-
-        // (47) G key
-        VKEY_G = 0x47,
-
-        // (48) H key
-        VKEY_H = 0x48,
-
-        // (49) I key
-        VKEY_I = 0x49,
-
-        // (4A) J key
-        VKEY_J = 0x4A,
-
-        // (4B) K key
-        VKEY_K = 0x4B,
-
-        // (4C) L key
-        VKEY_L = 0x4C,
-
-        // (4D) M key
-        VKEY_M = 0x4D,
-
-        // (4E) N key
-        VKEY_N = 0x4E,
-
-        // (4F) O key
-        VKEY_O = 0x4F,
-
-        // (50) P key
-        VKEY_P = 0x50,
-
-        // (51) Q key
-        VKEY_Q = 0x51,
-
-        // (52) R key
-        VKEY_R = 0x52,
-
-        // (53) S key
-        VKEY_S = 0x53,
-
-        // (54) T key
-        VKEY_T = 0x54,
-
-        // (55) U key
-        VKEY_U = 0x55,
-
-        // (56) V key
-        VKEY_V = 0x56,
-
-        // (57) W key
-        VKEY_W = 0x57,
-
-        // (58) X key
-        VKEY_X = 0x58,
-
-        // (59) Y key
-        VKEY_Y = 0x59,
-
-        // (5A) Z key
-        VKEY_Z = 0x5A,
-
-        // VKEY_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-        VKEY_LWIN = 0x5B,
-
-        // VKEY_RWIN (5C) Right Windows key (Natural keyboard)
-        VKEY_RWIN = 0x5C,
-
-        // VKEY_APPS (5D) Applications key (Natural keyboard)
-        VKEY_APPS = 0x5D,
-
-        // VKEY_SLEEP (5F) Computer Sleep key
-        VKEY_SLEEP = 0x5F,
-
-        // VKEY_NUMPAD0 (60) Numeric keypad 0 key
-        VKEY_NUMPAD0 = 0x60,
-
-        // VKEY_NUMPAD1 (61) Numeric keypad 1 key
-        VKEY_NUMPAD1 = 0x61,
-
-        // VKEY_NUMPAD2 (62) Numeric keypad 2 key
-        VKEY_NUMPAD2 = 0x62,
-
-        // VKEY_NUMPAD3 (63) Numeric keypad 3 key
-        VKEY_NUMPAD3 = 0x63,
-
-        // VKEY_NUMPAD4 (64) Numeric keypad 4 key
-        VKEY_NUMPAD4 = 0x64,
-
-        // VKEY_NUMPAD5 (65) Numeric keypad 5 key
-        VKEY_NUMPAD5 = 0x65,
-
-        // VKEY_NUMPAD6 (66) Numeric keypad 6 key
-        VKEY_NUMPAD6 = 0x66,
-
-        // VKEY_NUMPAD7 (67) Numeric keypad 7 key
-        VKEY_NUMPAD7 = 0x67,
-
-        // VKEY_NUMPAD8 (68) Numeric keypad 8 key
-        VKEY_NUMPAD8 = 0x68,
-
-        // VKEY_NUMPAD9 (69) Numeric keypad 9 key
-        VKEY_NUMPAD9 = 0x69,
-
-        // VKEY_MULTIPLY (6A) Multiply key
-        VKEY_MULTIPLY = 0x6A,
-
-        // VKEY_ADD (6B) Add key
-        VKEY_ADD = 0x6B,
-
-        // VKEY_SEPARATOR (6C) Separator key
-        VKEY_SEPARATOR = 0x6C,
-
-        // VKEY_SUBTRACT (6D) Subtract key
-        VKEY_SUBTRACT = 0x6D,
-
-        // VKEY_DECIMAL (6E) Decimal key
-        VKEY_DECIMAL = 0x6E,
-
-        // VKEY_DIVIDE (6F) Divide key
-        VKEY_DIVIDE = 0x6F,
-
-        // VKEY_F1 (70) F1 key
-        VKEY_F1 = 0x70,
-
-        // VKEY_F2 (71) F2 key
-        VKEY_F2 = 0x71,
-
-        // VKEY_F3 (72) F3 key
-        VKEY_F3 = 0x72,
-
-        // VKEY_F4 (73) F4 key
-        VKEY_F4 = 0x73,
-
-        // VKEY_F5 (74) F5 key
-        VKEY_F5 = 0x74,
-
-        // VKEY_F6 (75) F6 key
-        VKEY_F6 = 0x75,
-
-        // VKEY_F7 (76) F7 key
-        VKEY_F7 = 0x76,
-
-        // VKEY_F8 (77) F8 key
-        VKEY_F8 = 0x77,
-
-        // VKEY_F9 (78) F9 key
-        VKEY_F9 = 0x78,
-
-        // VKEY_F10 (79) F10 key
-        VKEY_F10 = 0x79,
-
-        // VKEY_F11 (7A) F11 key
-        VKEY_F11 = 0x7A,
-
-        // VKEY_F12 (7B) F12 key
-        VKEY_F12 = 0x7B,
-
-        // VKEY_F13 (7C) F13 key
-        VKEY_F13 = 0x7C,
-
-        // VKEY_F14 (7D) F14 key
-        VKEY_F14 = 0x7D,
-
-        // VKEY_F15 (7E) F15 key
-        VKEY_F15 = 0x7E,
-
-        // VKEY_F16 (7F) F16 key
-        VKEY_F16 = 0x7F,
-
-        // VKEY_F17 (80H) F17 key
-        VKEY_F17 = 0x80,
-
-        // VKEY_F18 (81H) F18 key
-        VKEY_F18 = 0x81,
-
-        // VKEY_F19 (82H) F19 key
-        VKEY_F19 = 0x82,
-
-        // VKEY_F20 (83H) F20 key
-        VKEY_F20 = 0x83,
-
-        // VKEY_F21 (84H) F21 key
-        VKEY_F21 = 0x84,
-
-        // VKEY_F22 (85H) F22 key
-        VKEY_F22 = 0x85,
-
-        // VKEY_F23 (86H) F23 key
-        VKEY_F23 = 0x86,
-
-        // VKEY_F24 (87H) F24 key
-        VKEY_F24 = 0x87,
-
-        // VKEY_NUMLOCK (90) NUM LOCK key
-        VKEY_NUMLOCK = 0x90,
-
-        // VKEY_SCROLL (91) SCROLL LOCK key
-        VKEY_SCROLL = 0x91,
-
-        // VKEY_LSHIFT (A0) Left SHIFT key
-        VKEY_LSHIFT = 0xA0,
-
-        // VKEY_RSHIFT (A1) Right SHIFT key
-        VKEY_RSHIFT = 0xA1,
-
-        // VKEY_LCONTROL (A2) Left CONTROL key
-        VKEY_LCONTROL = 0xA2,
-
-        // VKEY_RCONTROL (A3) Right CONTROL key
-        VKEY_RCONTROL = 0xA3,
-
-        // VKEY_LMENU (A4) Left MENU key
-        VKEY_LMENU = 0xA4,
-
-        // VKEY_RMENU (A5) Right MENU key
-        VKEY_RMENU = 0xA5,
-
-        // VKEY_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-        VKEY_BROWSER_BACK = 0xA6,
-
-        // VKEY_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-        VKEY_BROWSER_FORWARD = 0xA7,
-
-        // VKEY_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-        VKEY_BROWSER_REFRESH = 0xA8,
-
-        // VKEY_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-        VKEY_BROWSER_STOP = 0xA9,
-
-        // VKEY_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-        VKEY_BROWSER_SEARCH = 0xAA,
-
-        // VKEY_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-        VKEY_BROWSER_FAVORITES = 0xAB,
-
-        // VKEY_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-        VKEY_BROWSER_HOME = 0xAC,
-
-        // VKEY_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-        VKEY_VOLUME_MUTE = 0xAD,
-
-        // VKEY_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-        VKEY_VOLUME_DOWN = 0xAE,
-
-        // VKEY_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-        VKEY_VOLUME_UP = 0xAF,
-
-        // VKEY_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-        VKEY_MEDIA_NEXT_TRACK = 0xB0,
-
-        // VKEY_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-        VKEY_MEDIA_PREV_TRACK = 0xB1,
-
-        // VKEY_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-        VKEY_MEDIA_STOP = 0xB2,
-
-        // VKEY_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-        VKEY_MEDIA_PLAY_PAUSE = 0xB3,
-
-        // VKEY_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-        VKEY_MEDIA_LAUNCH_MAIL = 0xB4,
-
-        // VKEY_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-        VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
-
-        // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-        VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
-
-        // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-        VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
-
-        // VKEY_OEM_1 (BA) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ',:' key
-        VKEY_OEM_1 = 0xBA,
-
-        // VKEY_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-        VKEY_OEM_PLUS = 0xBB,
-
-        // VKEY_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-        VKEY_OEM_COMMA = 0xBC,
-
-        // VKEY_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-        VKEY_OEM_MINUS = 0xBD,
-
-        // VKEY_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-        VKEY_OEM_PERIOD = 0xBE,
-
-        // VKEY_OEM_2 (BF) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-        VKEY_OEM_2 = 0xBF,
-
-        // VKEY_OEM_3 (C0) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-        VKEY_OEM_3 = 0xC0,
-
-        // VKEY_OEM_4 (DB) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-        VKEY_OEM_4 = 0xDB,
-
-        // VKEY_OEM_5 (DC) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-        VKEY_OEM_5 = 0xDC,
-
-        // VKEY_OEM_6 (DD) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-        VKEY_OEM_6 = 0xDD,
-
-        // VKEY_OEM_7 (DE) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-        VKEY_OEM_7 = 0xDE,
-
-        // VKEY_OEM_8 (DF) Used for miscellaneous characters, it can vary by keyboard.
-        VKEY_OEM_8 = 0xDF,
-
-        // VKEY_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-        VKEY_OEM_102 = 0xE2,
-
-        // VKEY_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-        VKEY_PROCESSKEY = 0xE5,
-
-        // VKEY_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VKEY_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-        VKEY_PACKET = 0xE7,
-
-        // VKEY_ATTN (F6) Attn key
-        VKEY_ATTN = 0xF6,
-
-        // VKEY_CRSEL (F7) CrSel key
-        VKEY_CRSEL = 0xF7,
-
-        // VKEY_EXSEL (F8) ExSel key
-        VKEY_EXSEL = 0xF8,
-
-        // VKEY_EREOF (F9) Erase EOF key
-        VKEY_EREOF = 0xF9,
-
-        // VKEY_PLAY (FA) Play key
-        VKEY_PLAY = 0xFA,
-
-        // VKEY_ZOOM (FB) Zoom key
-        VKEY_ZOOM = 0xFB,
-
-        // VKEY_NONAME (FC) Reserved for future use
-        VKEY_NONAME = 0xFC,
-
-        // VKEY_PA1 (FD) PA1 key
-        VKEY_PA1 = 0xFD,
-
-        // VKEY_OEM_CLEAR (FE) Clear key
-        VKEY_OEM_CLEAR = 0xFE,
-
-        VKEY_UNKNOWN = 0
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/platform/chromium/KeyboardCodesWin.h b/WebCore/platform/chromium/KeyboardCodesWin.h
deleted file mode 100644
index bccd017..0000000
--- a/WebCore/platform/chromium/KeyboardCodesWin.h
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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 KeyboardCodesWin_h
-#define KeyboardCodesWin_h
-
-#include <windows.h>
-
-namespace WebCore {
-
-    enum {
-        // VKEY_LBUTTON (01) Left mouse button
-        // VKEY_RBUTTON (02) Right mouse button
-        // VKEY_CANCEL (03) Control-break processing
-        // VKEY_MBUTTON (04) Middle mouse button (three-button mouse)
-        // VKEY_XBUTTON1 (05)
-        // VKEY_XBUTTON2 (06)
-
-        // VKEY_BACK (08) BACKSPACE key
-        VKEY_BACK = VK_BACK,
-
-        // VKEY_TAB (09) TAB key
-        VKEY_TAB = VK_TAB,
-
-        // VKEY_CLEAR (0C) CLEAR key
-        VKEY_CLEAR = VK_CLEAR,
-
-        // VKEY_RETURN (0D)
-        VKEY_RETURN = VK_RETURN,
-
-        // VKEY_SHIFT (10) SHIFT key
-        VKEY_SHIFT = VK_SHIFT,
-
-        // VKEY_CONTROL (11) CTRL key
-        VKEY_CONTROL = VK_CONTROL,
-
-        // VKEY_MENU (12) ALT key
-        VKEY_MENU = VK_MENU,
-
-        // VKEY_PAUSE (13) PAUSE key
-        VKEY_PAUSE = VK_PAUSE,
-
-        // VKEY_CAPITAL (14) CAPS LOCK key
-        VKEY_CAPITAL = VK_CAPITAL,
-
-        // VKEY_KANA (15) Input Method Editor (IME) Kana mode
-        VKEY_KANA = VK_KANA,
-
-        // VKEY_HANGUEL (15) IME Hanguel mode (maintained for compatibility, use VKEY_HANGUL)
-        // VKEY_HANGUL (15) IME Hangul mode
-        VKEY_HANGUL = VK_HANGUL,
-
-        // VKEY_JUNJA (17) IME Junja mode
-        VKEY_JUNJA = VK_JUNJA,
-
-        // VKEY_FINAL (18) IME final mode
-        VKEY_FINAL = VK_FINAL,
-
-        // VKEY_HANJA (19) IME Hanja mode
-        VKEY_HANJA = VK_HANJA,
-
-        // VKEY_KANJI (19) IME Kanji mode
-        VKEY_KANJI = VK_KANJI,
-
-        // VKEY_ESCAPE (1B) ESC key
-        VKEY_ESCAPE = VK_ESCAPE,
-
-        // VKEY_CONVERT (1C) IME convert
-        VKEY_CONVERT = VK_CONVERT,
-
-        // VKEY_NONCONVERT (1D) IME nonconvert
-        VKEY_NONCONVERT = VK_NONCONVERT,
-
-        // VKEY_ACCEPT (1E) IME accept
-        VKEY_ACCEPT = VK_ACCEPT,
-
-        // VKEY_MODECHANGE (1F) IME mode change request
-        VKEY_MODECHANGE = VK_MODECHANGE,
-
-        // VKEY_SPACE (20) SPACEBAR
-        VKEY_SPACE = VK_SPACE,
-
-        // VKEY_PRIOR (21) PAGE UP key
-        VKEY_PRIOR = VK_PRIOR,
-
-        // VKEY_NEXT (22) PAGE DOWN key
-        VKEY_NEXT = VK_NEXT,
-
-        // VKEY_END (23) END key
-        VKEY_END = VK_END,
-
-        // VKEY_HOME (24) HOME key
-        VKEY_HOME = VK_HOME,
-
-        // VKEY_LEFT (25) LEFT ARROW key
-        VKEY_LEFT = VK_LEFT,
-
-        // VKEY_UP (26) UP ARROW key
-        VKEY_UP = VK_UP,
-
-        // VKEY_RIGHT (27) RIGHT ARROW key
-        VKEY_RIGHT = VK_RIGHT,
-
-        // VKEY_DOWN (28) DOWN ARROW key
-        VKEY_DOWN = VK_DOWN,
-
-        // VKEY_SELECT (29) SELECT key
-        VKEY_SELECT = VK_SELECT,
-
-        // VKEY_PRINT (2A) PRINT key
-        VKEY_PRINT = VK_PRINT,
-
-        // VKEY_EXECUTE (2B) EXECUTE key
-        VKEY_EXECUTE = VK_EXECUTE,
-
-        // VKEY_SNAPSHOT (2C) PRINT SCREEN key
-        VKEY_SNAPSHOT = VK_SNAPSHOT,
-
-        // VKEY_INSERT (2D) INS key
-        VKEY_INSERT = VK_INSERT,
-
-        // VKEY_DELETE (2E) DEL key
-        VKEY_DELETE = VK_DELETE,
-
-        // VKEY_HELP (2F) HELP key
-        VKEY_HELP = VK_HELP,
-
-        // (30) 0 key
-        VKEY_0 = '0',
-
-        // (31) 1 key
-        VKEY_1 = '1',
-
-        // (32) 2 key
-        VKEY_2 = '2',
-
-        // (33) 3 key
-        VKEY_3 = '3',
-
-        // (34) 4 key
-        VKEY_4 = '4',
-
-        // (35) 5 key,
-
-        VKEY_5 = '5',
-
-        // (36) 6 key
-        VKEY_6 = '6',
-
-        // (37) 7 key
-        VKEY_7 = '7',
-
-        // (38) 8 key
-        VKEY_8 = '8',
-
-        // (39) 9 key
-        VKEY_9 = '9',
-
-        // (41) A key
-        VKEY_A = 'A',
-
-        // (42) B key
-        VKEY_B = 'B',
-
-        // (43) C key
-        VKEY_C = 'C',
-
-        // (44) D key
-        VKEY_D = 'D',
-
-        // (45) E key
-        VKEY_E = 'E',
-
-        // (46) F key
-        VKEY_F = 'F',
-
-        // (47) G key
-        VKEY_G = 'G',
-
-        // (48) H key
-        VKEY_H = 'H',
-
-        // (49) I key
-        VKEY_I = 'I',
-
-        // (4A) J key
-        VKEY_J = 'J',
-
-        // (4B) K key
-        VKEY_K = 'K',
-
-        // (4C) L key
-        VKEY_L = 'L',
-
-        // (4D) M key
-        VKEY_M = 'M',
-
-        // (4E) N key
-        VKEY_N = 'N',
-
-        // (4F) O key
-        VKEY_O = 'O',
-
-        // (50) P key
-        VKEY_P = 'P',
-
-        // (51) Q key
-        VKEY_Q = 'Q',
-
-        // (52) R key
-        VKEY_R = 'R',
-
-        // (53) S key
-        VKEY_S = 'S',
-
-        // (54) T key
-        VKEY_T = 'T',
-
-        // (55) U key
-        VKEY_U = 'U',
-
-        // (56) V key
-        VKEY_V = 'V',
-
-        // (57) W key
-        VKEY_W = 'W',
-
-        // (58) X key
-        VKEY_X = 'X',
-
-        // (59) Y key
-        VKEY_Y = 'Y',
-
-        // (5A) Z key
-        VKEY_Z = 'Z',
-
-        // VKEY_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-        VKEY_LWIN = VK_LWIN,
-
-        // VKEY_RWIN (5C) Right Windows key (Natural keyboard)
-        VKEY_RWIN = VK_RWIN,
-
-        // VKEY_APPS (5D) Applications key (Natural keyboard)
-        VKEY_APPS = VK_APPS,
-
-        // VKEY_SLEEP (5F) Computer Sleep key
-        VKEY_SLEEP = VK_SLEEP,
-
-        // VKEY_NUMPAD0 (60) Numeric keypad 0 key
-        VKEY_NUMPAD0 = VK_NUMPAD0,
-
-        // VKEY_NUMPAD1 (61) Numeric keypad 1 key
-        VKEY_NUMPAD1 = VK_NUMPAD1,
-
-        // VKEY_NUMPAD2 (62) Numeric keypad 2 key
-        VKEY_NUMPAD2 = VK_NUMPAD2,
-
-        // VKEY_NUMPAD3 (63) Numeric keypad 3 key
-        VKEY_NUMPAD3 = VK_NUMPAD3,
-
-        // VKEY_NUMPAD4 (64) Numeric keypad 4 key
-        VKEY_NUMPAD4 = VK_NUMPAD4,
-
-        // VKEY_NUMPAD5 (65) Numeric keypad 5 key
-        VKEY_NUMPAD5 = VK_NUMPAD5,
-
-        // VKEY_NUMPAD6 (66) Numeric keypad 6 key
-        VKEY_NUMPAD6 = VK_NUMPAD6,
-
-        // VKEY_NUMPAD7 (67) Numeric keypad 7 key
-        VKEY_NUMPAD7 = VK_NUMPAD7,
-
-        // VKEY_NUMPAD8 (68) Numeric keypad 8 key
-        VKEY_NUMPAD8 = VK_NUMPAD8,
-
-        // VKEY_NUMPAD9 (69) Numeric keypad 9 key
-        VKEY_NUMPAD9 = VK_NUMPAD9,
-
-        // VKEY_MULTIPLY (6A) Multiply key
-        VKEY_MULTIPLY = VK_MULTIPLY,
-
-        // VKEY_ADD (6B) Add key
-        VKEY_ADD = VK_ADD,
-
-        // VKEY_SEPARATOR (6C) Separator key
-        VKEY_SEPARATOR = VK_SEPARATOR,
-
-        // VKEY_SUBTRACT (6D) Subtract key
-        VKEY_SUBTRACT = VK_SUBTRACT,
-
-        // VKEY_DECIMAL (6E) Decimal key
-        VKEY_DECIMAL = VK_DECIMAL,
-
-        // VKEY_DIVIDE (6F) Divide key
-        VKEY_DIVIDE = VK_DIVIDE,
-
-        // VKEY_F1 (70) F1 key
-        VKEY_F1 = VK_F1,
-
-        // VKEY_F2 (71) F2 key
-        VKEY_F2 = VK_F2,
-
-        // VKEY_F3 (72) F3 key
-        VKEY_F3 = VK_F3,
-
-        // VKEY_F4 (73) F4 key
-        VKEY_F4 = VK_F4,
-
-        // VKEY_F5 (74) F5 key
-        VKEY_F5 = VK_F5,
-
-        // VKEY_F6 (75) F6 key
-        VKEY_F6 = VK_F6,
-
-        // VKEY_F7 (76) F7 key
-        VKEY_F7 = VK_F7,
-
-        // VKEY_F8 (77) F8 key
-        VKEY_F8 = VK_F8,
-
-        // VKEY_F9 (78) F9 key
-        VKEY_F9 = VK_F9,
-
-        // VKEY_F10 (79) F10 key
-        VKEY_F10 = VK_F10,
-
-        // VKEY_F11 (7A) F11 key
-        VKEY_F11 = VK_F11,
-
-        // VKEY_F12 (7B) F12 key
-        VKEY_F12 = VK_F12,
-
-        // VKEY_F13 (7C) F13 key
-        VKEY_F13 = VK_F13,
-
-        // VKEY_F14 (7D) F14 key
-        VKEY_F14 = VK_F14,
-
-        // VKEY_F15 (7E) F15 key
-        VKEY_F15 = VK_F15,
-
-        // VKEY_F16 (7F) F16 key
-        VKEY_F16 = VK_F16,
-
-        // VKEY_F17 (80H) F17 key
-        VKEY_F17 = VK_F17,
-
-        // VKEY_F18 (81H) F18 key
-        VKEY_F18 = VK_F18,
-
-        // VKEY_F19 (82H) F19 key
-        VKEY_F19 = VK_F19,
-
-        // VKEY_F20 (83H) F20 key
-        VKEY_F20 = VK_F20,
-
-        // VKEY_F21 (84H) F21 key
-        VKEY_F21 = VK_F21,
-
-        // VKEY_F22 (85H) F22 key
-        VKEY_F22 = VK_F22,
-
-        // VKEY_F23 (86H) F23 key
-        VKEY_F23 = VK_F23,
-
-        // VKEY_F24 (87H) F24 key
-        VKEY_F24 = VK_F24,
-
-        // VKEY_NUMLOCK (90) NUM LOCK key
-        VKEY_NUMLOCK = VK_NUMLOCK,
-
-        // VKEY_SCROLL (91) SCROLL LOCK key
-        VKEY_SCROLL = VK_SCROLL,
-
-        // VKEY_LSHIFT (A0) Left SHIFT key
-        VKEY_LSHIFT = VK_LSHIFT,
-
-        // VKEY_RSHIFT (A1) Right SHIFT key
-        VKEY_RSHIFT = VK_RSHIFT,
-
-        // VKEY_LCONTROL (A2) Left CONTROL key
-        VKEY_LCONTROL = VK_LCONTROL,
-
-        // VKEY_RCONTROL (A3) Right CONTROL key
-        VKEY_RCONTROL = VK_RCONTROL,
-
-        // VKEY_LMENU (A4) Left MENU key
-        VKEY_LMENU = VK_LMENU,
-
-        // VKEY_RMENU (A5) Right MENU key
-        VKEY_RMENU = VK_RMENU,
-
-        // VKEY_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-        VKEY_BROWSER_BACK = VK_BROWSER_BACK,
-
-        // VKEY_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-        VKEY_BROWSER_FORWARD = VK_BROWSER_FORWARD,
-
-        // VKEY_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-        VKEY_BROWSER_REFRESH = VK_BROWSER_REFRESH,
-
-        // VKEY_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-        VKEY_BROWSER_STOP = VK_BROWSER_STOP,
-
-        // VKEY_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-        VKEY_BROWSER_SEARCH = VK_BROWSER_SEARCH,
-
-        // VKEY_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-        VKEY_BROWSER_FAVORITES = VK_BROWSER_FAVORITES,
-
-        // VKEY_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-        VKEY_BROWSER_HOME = VK_BROWSER_HOME,
-
-        // VKEY_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-        VKEY_VOLUME_MUTE = VK_VOLUME_MUTE,
-
-        // VKEY_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-        VKEY_VOLUME_DOWN = VK_VOLUME_DOWN,
-
-        // VKEY_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-        VKEY_VOLUME_UP = VK_VOLUME_UP,
-
-        // VKEY_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-        VKEY_MEDIA_NEXT_TRACK = VK_MEDIA_NEXT_TRACK,
-
-        // VKEY_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-        VKEY_MEDIA_PREV_TRACK = VK_MEDIA_PREV_TRACK,
-
-        // VKEY_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-        VKEY_MEDIA_STOP = VK_MEDIA_STOP,
-
-        // VKEY_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-        VKEY_MEDIA_PLAY_PAUSE = VK_MEDIA_PLAY_PAUSE,
-
-        // VKEY_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-        VKEY_MEDIA_LAUNCH_MAIL = 0xB4,
-
-        // VKEY_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-        VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
-
-        // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-        VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
-
-        // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-        VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
-
-        // VKEY_OEM_1 (BA) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ',:' key
-        VKEY_OEM_1 = VK_OEM_1,
-
-        // VKEY_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-        VKEY_OEM_PLUS = VK_OEM_PLUS,
-
-        // VKEY_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-        VKEY_OEM_COMMA = VK_OEM_COMMA,
-
-        // VKEY_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-        VKEY_OEM_MINUS = VK_OEM_MINUS,
-
-        // VKEY_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-        VKEY_OEM_PERIOD = VK_OEM_PERIOD,
-
-        // VKEY_OEM_2 (BF) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-        VKEY_OEM_2 = VK_OEM_2,
-
-        // VKEY_OEM_3 (C0) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-        VKEY_OEM_3 = VK_OEM_3,
-
-        // VKEY_OEM_4 (DB) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-        VKEY_OEM_4 = VK_OEM_4,
-
-        // VKEY_OEM_5 (DC) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-        VKEY_OEM_5 = VK_OEM_5,
-
-        // VKEY_OEM_6 (DD) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-        VKEY_OEM_6 = VK_OEM_6,
-
-        // VKEY_OEM_7 (DE) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-        VKEY_OEM_7 = VK_OEM_7,
-
-        // VKEY_OEM_8 (DF) Used for miscellaneous characters, it can vary by keyboard.
-        VKEY_OEM_8 = VK_OEM_8,
-
-        // VKEY_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-        VKEY_OEM_102 = VK_OEM_102,
-
-        // VKEY_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-        VKEY_PROCESSKEY = VK_PROCESSKEY,
-
-        // VKEY_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VKEY_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-        VKEY_PACKET = VK_PACKET,
-
-        // VKEY_ATTN (F6) Attn key
-        VKEY_ATTN = VK_ATTN,
-
-        // VKEY_CRSEL (F7) CrSel key
-        VKEY_CRSEL = VK_CRSEL,
-
-        // VKEY_EXSEL (F8) ExSel key
-        VKEY_EXSEL = VK_EXSEL,
-
-        // VKEY_EREOF (F9) Erase EOF key
-        VKEY_EREOF = VK_EREOF,
-
-        // VKEY_PLAY (FA) Play key
-        VKEY_PLAY = VK_PLAY,
-
-        // VKEY_ZOOM (FB) Zoom key
-        VKEY_ZOOM = VK_ZOOM,
-
-        // VKEY_NONAME (FC) Reserved for future use
-        VKEY_NONAME = VK_NONAME,
-
-        // VKEY_PA1 (FD) PA1 key
-        VKEY_PA1 = VK_PA1,
-
-        // VKEY_OEM_CLEAR (FE) Clear key
-        VKEY_OEM_CLEAR = VK_OEM_CLEAR,
-
-        VKEY_UNKNOWN = 0
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp b/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp
index ff0be82..23f7926 100644
--- a/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp
+++ b/WebCore/platform/chromium/MIMETypeRegistryChromium.cpp
@@ -32,9 +32,9 @@
 #include "MIMETypeRegistry.h"
 
 #include "ChromiumBridge.h"
-#include "CString.h"
 #include "MediaPlayer.h"
 #include "PluginDataChromium.h"
+#include <wtf/text/CString.h>
 
 // NOTE: Unlike other ports, we don't use the shared implementation bits in
 // MIMETypeRegistry.cpp.  Instead, we need to route most functions via the
@@ -130,6 +130,11 @@
     return String();
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 static HashSet<String>& dummyHashSet()
 {
     ASSERT_NOT_REACHED();
diff --git a/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp b/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
index 74643f7..4e515e5 100644
--- a/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
+++ b/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
@@ -37,6 +37,10 @@
 
 namespace WebCore {
 
+#if OS(WINDOWS)
+static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000;
+#endif
+
 void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
 {
 #if OS(WINDOWS)
@@ -82,4 +86,22 @@
 #endif
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+#if OS(WINDOWS)
+    shiftKey = GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT;
+    ctrlKey = GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT;
+    altKey = GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT;
+    metaKey = false;
+#elif OS(DARWIN)
+    UInt32 currentModifiers = GetCurrentKeyModifiers();
+    shiftKey = currentModifiers & ::shiftKey;
+    ctrlKey = currentModifiers & ::controlKey;
+    altKey = currentModifiers & ::optionKey;
+    metaKey = currentModifiers & ::cmdKey;
+#else
+    notImplemented();
+#endif
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index cab7ced..72803cf 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -74,7 +74,6 @@
 // The settings used for the drop down menu.
 // This is the delegate used if none is provided.
 static const PopupContainerSettings dropDownSettings = {
-    true,   // focusOnShow
     true,   // setTextOnIndexChange
     true,   // acceptOnAbandon
     false,  // loopSelectionNavigation
@@ -141,6 +140,10 @@
     // Gets the height of a row.
     int getRowHeight(int index);
 
+    void setMaxHeight(int maxHeight) { m_maxHeight = maxHeight; }
+
+    void disconnectClient() { m_popupClient = 0; }
+
     const Vector<PopupItem*>& items() const { return m_items; }
 
 private:
@@ -154,6 +157,7 @@
         , m_acceptedIndexOnAbandon(-1)
         , m_visibleRows(0)
         , m_baseWidth(0)
+        , m_maxHeight(kMaxHeight)
         , m_popupClient(client)
         , m_repeatingChar(0)
         , m_lastCharTime(0)
@@ -166,8 +170,6 @@
         clear();
     }
 
-    void disconnectClient() { m_popupClient = 0; }
-
     // Closes the popup
     void abandon();
 
@@ -241,6 +243,9 @@
     // Our suggested width, not including scrollbar.
     int m_baseWidth;
 
+    // The maximum height we can be without being off-screen.
+    int m_maxHeight;
+
     // A list of the options contained within the <select>
     Vector<PopupItem*> m_items;
 
@@ -297,15 +302,19 @@
 
 // static
 PassRefPtr<PopupContainer> PopupContainer::create(PopupMenuClient* client,
+                                                  PopupType popupType,
                                                   const PopupContainerSettings& settings)
 {
-    return adoptRef(new PopupContainer(client, settings));
+    return adoptRef(new PopupContainer(client, popupType, settings));
 }
 
 PopupContainer::PopupContainer(PopupMenuClient* client,
+                               PopupType popupType,
                                const PopupContainerSettings& settings)
     : m_listBox(PopupListBox::create(client, settings))
     , m_settings(settings)
+    , m_popupType(popupType)
+    , m_popupOpen(false)
 {
     setScrollbarModes(ScrollbarAlwaysOff, ScrollbarAlwaysOff);
 }
@@ -321,21 +330,45 @@
     // Pre-layout, our size matches the <select> dropdown control.
     int selectHeight = frameRect().height();
 
+    // Reset the max height to its default value, it will be recomputed below
+    // if necessary.
+    m_listBox->setMaxHeight(kMaxHeight);
+
     // Lay everything out to figure out our preferred size, then tell the view's
     // WidgetClient about it.  It should assign us a client.
     layout();
 
-    ChromeClientChromium* chromeClient = static_cast<ChromeClientChromium*>(
-        view->frame()->page()->chrome()->client());
+    m_frameView = view;
+    ChromeClientChromium* chromeClient = chromeClientChromium();
     if (chromeClient) {
         // If the popup would extend past the bottom of the screen, open upwards
         // instead.
         FloatRect screen = screenAvailableRect(view);
         IntRect widgetRect = chromeClient->windowToScreen(frameRect());
-        if (widgetRect.bottom() > static_cast<int>(screen.bottom()))
-            widgetRect.move(0, -(widgetRect.height() + selectHeight));
 
-        chromeClient->popupOpened(this, widgetRect, m_settings.focusOnShow, false);
+        if (widgetRect.bottom() > static_cast<int>(screen.bottom())) {
+            if (widgetRect.y() - widgetRect.height() - selectHeight > 0) {
+                // There is enough room to open upwards.
+                widgetRect.move(0, -(widgetRect.height() + selectHeight));
+            } else {
+                // Figure whether upwards or downwards has more room and set the
+                // maximum number of items.
+                int spaceAbove = widgetRect.y() - selectHeight;
+                int spaceBelow = screen.bottom() - widgetRect.y();
+                if (spaceAbove > spaceBelow)
+                    m_listBox->setMaxHeight(spaceAbove);
+                else
+                    m_listBox->setMaxHeight(spaceBelow);
+                layout();
+                // Our size has changed, recompute the widgetRect.
+                widgetRect = chromeClient->windowToScreen(frameRect());
+                // And move upwards if necessary.
+                if (spaceAbove > spaceBelow)
+                    widgetRect.move(0, -(widgetRect.height() + selectHeight));
+            }
+        }
+        chromeClient->popupOpened(this, widgetRect, false);
+        m_popupOpen = true;
     }
 
     if (!m_listBox->parent())
@@ -368,9 +401,8 @@
     IntRect popupRect(location, rect.size());
 
     // Get the ChromeClient and pass it the popup menu's listbox data.
-    ChromeClientChromium* client = static_cast<ChromeClientChromium*>(
-         v->frame()->page()->chrome()->client());
-    client->popupOpened(this, popupRect, true, true);
+    m_frameView = v;
+    chromeClientChromium()->popupOpened(this, popupRect, true);
 
     // The popup sends its "closed" notification through its parent. Set the
     // parent, even though external popups have no real on-screen widget but a
@@ -384,6 +416,14 @@
     listBox()->hidePopup();
 }
 
+void PopupContainer::notifyPopupHidden()
+{
+    if (!m_popupOpen)
+        return;
+    m_popupOpen = false;
+    chromeClientChromium()->popupClosed(this);
+}
+
 void PopupContainer::layout()
 {
     m_listBox->layout();
@@ -391,9 +431,21 @@
     // Place the listbox within our border.
     m_listBox->move(kBorderSize, kBorderSize);
 
+    // popupWidth is the width of <select> element. Record it before resize frame.
+    int popupWidth = frameRect().width();
     // Size ourselves to contain listbox + border.
-    resize(m_listBox->width() + kBorderSize * 2, m_listBox->height() + kBorderSize * 2);
+    int listBoxWidth = m_listBox->width() + kBorderSize * 2;
+    resize(listBoxWidth, m_listBox->height() + kBorderSize * 2);
 
+    // Adjust the starting x-axis for RTL dropdown. For RTL dropdown, the right edge
+    // of dropdown box should be aligned with the right edge of <select> element box,
+    // and the dropdown box should be expanded to left if more space needed.
+    PopupMenuClient* popupClient = m_listBox->m_popupClient;
+    if (popupClient) {
+        bool rightAligned = m_listBox->m_popupClient->menuStyle().textDirection() == RTL;
+        if (rightAligned)
+            move(x() + popupWidth - listBoxWidth, y());
+    }
     invalidate();
 }
 
@@ -470,6 +522,11 @@
     return m_listBox->isInterestedInEventForKey(keyCode);
 }
 
+ChromeClientChromium* PopupContainer::chromeClientChromium()
+{
+    return static_cast<ChromeClientChromium*>(m_frameView->frame()->page()->chrome()->client());
+}
+
 void PopupContainer::show(const IntRect& r, FrameView* v, int index)
 {
     // The rect is the size of the select box. It's usually larger than we need.
@@ -511,6 +568,11 @@
     return m_listBox->getRowHeight(0);
 }
 
+int PopupContainer::menuItemFontSize() const
+{
+    return m_listBox->getRowFont(0).size();
+}
+
 const WTF::Vector<PopupItem*>& PopupContainer:: popupData() const
 {
     return m_listBox->items();
@@ -674,12 +736,14 @@
         setOriginalIndex(m_selectedIndex);
         if (m_settings.setTextOnIndexChange)
             m_popupClient->setTextFromItem(m_selectedIndex);
-    } else if (!m_settings.setTextOnIndexChange &&
-               event.windowsVirtualKeyCode() == VKEY_TAB) {
+    }
+    if (event.windowsVirtualKeyCode() == VKEY_TAB) {
         // TAB is a special case as it should select the current item if any and
         // advance focus.
         if (m_selectedIndex >= 0)
             m_popupClient->setTextFromItem(m_selectedIndex);
+        // Call abandon() so we honor m_acceptedIndexOnAbandon if set.
+        abandon();
         // Return false so the TAB key event is propagated to the page.
         return false;
     }
@@ -887,7 +951,8 @@
     hidePopup();
 
     if (m_acceptedIndexOnAbandon >= 0) {
-        m_popupClient->valueChanged(m_acceptedIndexOnAbandon);
+        if (m_popupClient)
+            m_popupClient->valueChanged(m_acceptedIndexOnAbandon);
         m_acceptedIndexOnAbandon = -1;
     }
 }
@@ -1082,9 +1147,11 @@
         PopupContainer* container = static_cast<PopupContainer*>(parent());
         if (container->client())
             container->client()->popupClosed(container);
+        container->notifyPopupHidden();
     }
 
-    m_popupClient->popupDidHide();
+    if (m_popupClient)
+        m_popupClient->popupDidHide();
 }
 
 void PopupListBox::updateFromElement()
@@ -1151,7 +1218,7 @@
         int rowHeight = getRowHeight(i);
 #if !OS(DARWIN)
         // Only clip the window height for non-Mac platforms.
-        if (windowHeight + rowHeight > kMaxHeight) {
+        if (windowHeight + rowHeight > m_maxHeight) {
             m_visibleRows = i;
             break;
         }
@@ -1216,6 +1283,10 @@
 
 PopupMenu::~PopupMenu()
 {
+    // When the PopupMenu is destroyed, the client could already have been
+    // deleted.
+    if (p.popup)
+        p.popup->listBox()->disconnectClient();
     hide();
 }
 
@@ -1226,7 +1297,7 @@
 void PopupMenu::show(const IntRect& r, FrameView* v, int index)
 {
     if (!p.popup)
-        p.popup = PopupContainer::create(client(), dropDownSettings);
+        p.popup = PopupContainer::create(client(), PopupContainer::Select, dropDownSettings);
 #if OS(DARWIN)
     p.popup->showExternal(r, v, index);
 #else
diff --git a/WebCore/platform/chromium/PopupMenuChromium.h b/WebCore/platform/chromium/PopupMenuChromium.h
index ee094b3..538a94a 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.h
+++ b/WebCore/platform/chromium/PopupMenuChromium.h
@@ -39,146 +39,164 @@
 
 namespace WebCore {
 
-    class FrameView;
-    class PopupListBox;
+class ChromeClientChromium;
+class FrameView;
+class PopupListBox;
 
-    // A container for the data for each menu item (e.g. represented by <option>
-    // or <optgroup> in a <select> widget) and is used by PopupListBox.
-    struct PopupItem {
-        enum Type {
-            TypeOption,
-            TypeGroup,
-            TypeSeparator
-        };
-
-        PopupItem(const String& label, Type type)
-            : label(label)
-            , type(type)
-            , yOffset(0)
-        {
-        }
-        String label;
-        Type type;
-        int yOffset;  // y offset of this item, relative to the top of the popup.
-        bool enabled;
+// A container for the data for each menu item (e.g. represented by <option>
+// or <optgroup> in a <select> widget) and is used by PopupListBox.
+struct PopupItem {
+    enum Type {
+        TypeOption,
+        TypeGroup,
+        TypeSeparator
     };
 
-    // FIXME: Our FramelessScrollView classes should probably implement HostWindow!
+    PopupItem(const String& label, Type type)
+        : label(label)
+        , type(type)
+        , yOffset(0)
+    {
+    }
+    String label;
+    Type type;
+    int yOffset; // y offset of this item, relative to the top of the popup.
+    bool enabled;
+};
 
-    // The PopupContainer class holds a PopupListBox (see cpp file).  Its sole purpose is to be
-    // able to draw a border around its child.  All its paint/event handling is
-    // just forwarded to the child listBox (with the appropriate transforms).
-    // NOTE: this class is exposed so it can be instantiated direcly for the
-    // autofill popup.  We cannot use the Popup class directly in that case as the
-    // autofill popup should not be focused when shown and we want to forward the
-    // key events to it (through handleKeyEvent).
+// FIXME: Our FramelessScrollView classes should probably implement HostWindow!
 
-    struct PopupContainerSettings {
-        // Whether the popup should get the focus when displayed.
-        bool focusOnShow;
+// The PopupContainer class holds a PopupListBox (see cpp file).  Its sole purpose is to be
+// able to draw a border around its child.  All its paint/event handling is
+// just forwarded to the child listBox (with the appropriate transforms).
+// NOTE: this class is exposed so it can be instantiated direcly for the
+// autofill popup.  We cannot use the Popup class directly in that case as the
+// autofill popup should not be focused when shown and we want to forward the
+// key events to it (through handleKeyEvent).
 
-        // Whether the PopupMenuClient should be told to change its text when a
-        // new item is selected by using the arrow keys.
-        bool setTextOnIndexChange;
+struct PopupContainerSettings {
+    // Whether the PopupMenuClient should be told to change its text when a
+    // new item is selected by using the arrow keys.
+    bool setTextOnIndexChange;
 
-        // Whether the selection should be accepted when the popup menu is
-        // closed (through ESC being pressed or the focus going away).
-        // Note that when TAB is pressed, the selection is always accepted
-        // regardless of this setting.
-        bool acceptOnAbandon;
+    // Whether the selection should be accepted when the popup menu is
+    // closed (through ESC being pressed or the focus going away).
+    // Note that when TAB is pressed, the selection is always accepted
+    // regardless of this setting.
+    bool acceptOnAbandon;
 
-        // Whether we should move the selection to the first/last item when
-        // the user presses down/up arrow keys and the last/first item is
-        // selected.
-        bool loopSelectionNavigation;
+    // Whether we should move the selection to the first/last item when
+    // the user presses down/up arrow keys and the last/first item is
+    // selected.
+    bool loopSelectionNavigation;
 
-        // Whether we should restrict the width of the PopupListBox or not.
-        // Autocomplete popups are restricted, combo-boxes (select tags) aren't.
-        bool restrictWidthOfListBox;
+    // Whether we should restrict the width of the PopupListBox or not.
+    // Autocomplete popups are restricted, combo-boxes (select tags) aren't.
+    bool restrictWidthOfListBox;
 
-        // A hint on the display directionality of the item text in popup menu.
-        //
-        // We could either display the items in the drop-down using its DOM element's
-        // directionality, or we could display the items in the drop-down using heuristics:
-        // such as in its first strong directionality character's direction.
-        // Please refer to the discussion (especially comment #7 and #10) in
-        // https://bugs.webkit.org/show_bug.cgi?id=27889 for details.
-        enum DirectionalityHint {
-            // Use the DOM element's directionality to display the item text in popup menu.
-            DOMElementDirection,
-            // Use the item text's first strong-directional character's directionality
-            // to display the item text in popup menu.
-            FirstStrongDirectionalCharacterDirection,
-        };
-        DirectionalityHint itemTextDirectionalityHint;
+    // A hint on the display directionality of the item text in popup menu.
+    //
+    // We could either display the items in the drop-down using its DOM element's
+    // directionality, or we could display the items in the drop-down using heuristics:
+    // such as in its first strong directionality character's direction.
+    // Please refer to the discussion (especially comment #7 and #10) in
+    // https://bugs.webkit.org/show_bug.cgi?id=27889 for details.
+    enum DirectionalityHint {
+        // Use the DOM element's directionality to display the item text in popup menu.
+        DOMElementDirection,
+        // Use the item text's first strong-directional character's directionality
+        // to display the item text in popup menu.
+        FirstStrongDirectionalCharacterDirection,
+    };
+    DirectionalityHint itemTextDirectionalityHint;
+};
+
+class PopupContainer : public FramelessScrollView {
+public:
+    enum PopupType {
+        Select, // HTML select popup.
+        Suggestion, // Autocomplete/autofill popup.
     };
 
-    class PopupContainer : public FramelessScrollView {
-    public:
-        static PassRefPtr<PopupContainer> create(PopupMenuClient*,
-                                                 const PopupContainerSettings&);
+    static PassRefPtr<PopupContainer> create(PopupMenuClient*, PopupType,
+                                             const PopupContainerSettings&);
 
-        // Whether a key event should be sent to this popup.
-        virtual bool isInterestedInEventForKey(int keyCode);
+    // Whether a key event should be sent to this popup.
+    virtual bool isInterestedInEventForKey(int keyCode);
 
-        // FramelessScrollView
-        virtual void paint(GraphicsContext*, const IntRect&);
-        virtual void hide();
-        virtual bool handleMouseDownEvent(const PlatformMouseEvent&);
-        virtual bool handleMouseMoveEvent(const PlatformMouseEvent&);
-        virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&);
-        virtual bool handleWheelEvent(const PlatformWheelEvent&);
-        virtual bool handleKeyEvent(const PlatformKeyboardEvent&);
+    // FramelessScrollView
+    virtual void paint(GraphicsContext*, const IntRect&);
+    virtual void hide();
+    virtual bool handleMouseDownEvent(const PlatformMouseEvent&);
+    virtual bool handleMouseMoveEvent(const PlatformMouseEvent&);
+    virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&);
+    virtual bool handleWheelEvent(const PlatformWheelEvent&);
+    virtual bool handleKeyEvent(const PlatformKeyboardEvent&);
 
-        // PopupContainer methods
+    // PopupContainer methods
 
-        // Show the popup
-        void showPopup(FrameView*);
+    // Show the popup
+    void showPopup(FrameView*);
 
-        // Used on Mac Chromium for HTML select popup menus.
-        void showExternal(const IntRect&, FrameView*, int index);
+    // Used on Mac Chromium for HTML select popup menus.
+    void showExternal(const IntRect&, FrameView*, int index);
 
-        // Show the popup in the specified rect for the specified frame.
-        // Note: this code was somehow arbitrarily factored-out of the Popup class
-        // so WebViewImpl can create a PopupContainer. This method is used for
-        // displaying auto complete popup menus on Mac Chromium, and for all
-        // popups on other platforms.
-        void show(const IntRect&, FrameView*, int index);
+    // Show the popup in the specified rect for the specified frame.
+    // Note: this code was somehow arbitrarily factored-out of the Popup class
+    // so WebViewImpl can create a PopupContainer. This method is used for
+    // displaying auto complete popup menus on Mac Chromium, and for all
+    // popups on other platforms.
+    void show(const IntRect&, FrameView*, int index);
 
-        // Hide the popup.
-        void hidePopup();
+    // Hides the popup.
+    void hidePopup();
 
-        // Compute size of widget and children.
-        void layout();
+    // The popup was hidden.
+    void notifyPopupHidden();
 
-        PopupListBox* listBox() const { return m_listBox.get(); }
+    // Compute size of widget and children.
+    void layout();
 
-        // Gets the index of the item that the user is currently moused-over or
-        // has selected with the keyboard up/down arrows.
-        int selectedIndex() const;
+    PopupListBox* listBox() const { return m_listBox.get(); }
 
-        // Refresh the popup values from the PopupMenuClient.
-        void refresh();
+    // Gets the index of the item that the user is currently moused-over or
+    // has selected with the keyboard up/down arrows.
+    int selectedIndex() const;
 
-        // The menu per-item data.
-        const WTF::Vector<PopupItem*>& popupData() const;
+    // Refresh the popup values from the PopupMenuClient.
+    void refresh();
 
-        // The height of a row in the menu.
-        int menuItemHeight() const;
+    // The menu per-item data.
+    const WTF::Vector<PopupItem*>& popupData() const;
 
-    private:
-        friend class WTF::RefCounted<PopupContainer>;
+    // The height of a row in the menu.
+    int menuItemHeight() const;
 
-        PopupContainer(PopupMenuClient*, const PopupContainerSettings&);
-        ~PopupContainer();
+    // The size of the font being used.
+    int menuItemFontSize() const;
 
-        // Paint the border.
-        void paintBorder(GraphicsContext*, const IntRect&);
+    PopupType popupType() const { return m_popupType; }
 
-        RefPtr<PopupListBox> m_listBox;
+private:
+    friend class WTF::RefCounted<PopupContainer>;
 
-        PopupContainerSettings m_settings;
-    };
+    PopupContainer(PopupMenuClient*, PopupType popupType, const PopupContainerSettings&);
+    ~PopupContainer();
+
+    // Paint the border.
+    void paintBorder(GraphicsContext*, const IntRect&);
+
+    // Returns the ChromeClient of the page this popup is associated with.
+    ChromeClientChromium* chromeClientChromium();
+
+    RefPtr<PopupListBox> m_listBox;
+    RefPtr<FrameView> m_frameView;
+
+    PopupContainerSettings m_settings;
+    PopupType m_popupType;
+    // Whether the popup is currently open.
+    bool m_popupOpen;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/platform/cocoa/KeyEventCocoa.h b/WebCore/platform/cocoa/KeyEventCocoa.h
new file mode 100644
index 0000000..8d486ad
--- /dev/null
+++ b/WebCore/platform/cocoa/KeyEventCocoa.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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 COMPUTER, 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 KeyEventCocoa_h
+#define KeyEventCocoa_h
+
+namespace WebCore {
+
+class String;
+
+String keyIdentifierForCharCode(unichar charCode);
+
+int windowsKeyCodeForKeyCode(uint16_t keyCode);
+int windowsKeyCodeForCharCode(unichar charCode);
+
+}
+
+#endif
diff --git a/WebCore/platform/cocoa/KeyEventCocoa.mm b/WebCore/platform/cocoa/KeyEventCocoa.mm
new file mode 100644
index 0000000..522c420
--- /dev/null
+++ b/WebCore/platform/cocoa/KeyEventCocoa.mm
@@ -0,0 +1,533 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 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 COMPUTER, 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.
+ */
+
+#import "config.h"
+#import "KeyEventCocoa.h"
+
+#import "Logging.h"
+#import "PlatformString.h"
+#import "WindowsKeyboardCodes.h"
+#import <wtf/ASCIICType.h>
+
+#if PLATFORM(IPHONE)
+#import "KeyEventCodesIPhone.h"
+#endif
+
+using namespace WTF;
+
+namespace WebCore {
+
+String keyIdentifierForCharCode(unichar charCode)
+{
+    switch (charCode) {
+        // Each identifier listed in the DOM spec is listed here.
+        // Many are simply commented out since they do not appear on standard Macintosh keyboards
+        // or are on a key that doesn't have a corresponding character.
+
+        // "Accept"
+        // "AllCandidates"
+
+        // "Alt"
+        case NSMenuFunctionKey:
+            return "Alt";
+
+        // "Apps"
+        // "BrowserBack"
+        // "BrowserForward"
+        // "BrowserHome"
+        // "BrowserRefresh"
+        // "BrowserSearch"
+        // "BrowserStop"
+        // "CapsLock"
+
+        // "Clear"
+        case NSClearLineFunctionKey:
+            return "Clear";
+
+        // "CodeInput"
+        // "Compose"
+        // "Control"
+        // "Crsel"
+        // "Convert"
+        // "Copy"
+        // "Cut"
+
+        // "Down"
+        case NSDownArrowFunctionKey:
+            return "Down";
+        // "End"
+        case NSEndFunctionKey:
+            return "End";
+        // "Enter"
+        case 0x3: case 0xA: case 0xD: // Macintosh calls the one on the main keyboard Return, but Windows calls it Enter, so we'll do the same for the DOM
+            return "Enter";
+
+        // "EraseEof"
+
+        // "Execute"
+        case NSExecuteFunctionKey:
+            return "Execute";
+
+        // "Exsel"
+
+        // "F1"
+        case NSF1FunctionKey:
+            return "F1";
+        // "F2"
+        case NSF2FunctionKey:
+            return "F2";
+        // "F3"
+        case NSF3FunctionKey:
+            return "F3";
+        // "F4"
+        case NSF4FunctionKey:
+            return "F4";
+        // "F5"
+        case NSF5FunctionKey:
+            return "F5";
+        // "F6"
+        case NSF6FunctionKey:
+            return "F6";
+        // "F7"
+        case NSF7FunctionKey:
+            return "F7";
+        // "F8"
+        case NSF8FunctionKey:
+            return "F8";
+        // "F9"
+        case NSF9FunctionKey:
+            return "F9";
+        // "F10"
+        case NSF10FunctionKey:
+            return "F10";
+        // "F11"
+        case NSF11FunctionKey:
+            return "F11";
+        // "F12"
+        case NSF12FunctionKey:
+            return "F12";
+        // "F13"
+        case NSF13FunctionKey:
+            return "F13";
+        // "F14"
+        case NSF14FunctionKey:
+            return "F14";
+        // "F15"
+        case NSF15FunctionKey:
+            return "F15";
+        // "F16"
+        case NSF16FunctionKey:
+            return "F16";
+        // "F17"
+        case NSF17FunctionKey:
+            return "F17";
+        // "F18"
+        case NSF18FunctionKey:
+            return "F18";
+        // "F19"
+        case NSF19FunctionKey:
+            return "F19";
+        // "F20"
+        case NSF20FunctionKey:
+            return "F20";
+        // "F21"
+        case NSF21FunctionKey:
+            return "F21";
+        // "F22"
+        case NSF22FunctionKey:
+            return "F22";
+        // "F23"
+        case NSF23FunctionKey:
+            return "F23";
+        // "F24"
+        case NSF24FunctionKey:
+            return "F24";
+
+        // "FinalMode"
+
+        // "Find"
+        case NSFindFunctionKey:
+            return "Find";
+
+        // "FullWidth"
+        // "HalfWidth"
+        // "HangulMode"
+        // "HanjaMode"
+
+        // "Help"
+        case NSHelpFunctionKey:
+            return "Help";
+
+        // "Hiragana"
+
+        // "Home"
+        case NSHomeFunctionKey:
+            return "Home";
+        // "Insert"
+        case NSInsertFunctionKey:
+            return "Insert";
+
+        // "JapaneseHiragana"
+        // "JapaneseKatakana"
+        // "JapaneseRomaji"
+        // "JunjaMode"
+        // "KanaMode"
+        // "KanjiMode"
+        // "Katakana"
+        // "LaunchApplication1"
+        // "LaunchApplication2"
+        // "LaunchMail"
+
+        // "Left"
+        case NSLeftArrowFunctionKey:
+            return "Left";
+
+        // "Meta"
+        // "MediaNextTrack"
+        // "MediaPlayPause"
+        // "MediaPreviousTrack"
+        // "MediaStop"
+
+        // "ModeChange"
+        case NSModeSwitchFunctionKey:
+            return "ModeChange";
+
+        // "Nonconvert"
+        // "NumLock"
+
+        // "PageDown"
+        case NSPageDownFunctionKey:
+            return "PageDown";
+        // "PageUp"
+        case NSPageUpFunctionKey:
+            return "PageUp";
+
+        // "Paste"
+
+        // "Pause"
+        case NSPauseFunctionKey:
+            return "Pause";
+
+        // "Play"
+        // "PreviousCandidate"
+
+        // "PrintScreen"
+        case NSPrintScreenFunctionKey:
+            return "PrintScreen";
+
+        // "Process"
+        // "Props"
+
+        // "Right"
+        case NSRightArrowFunctionKey:
+            return "Right";
+
+        // "RomanCharacters"
+
+        // "Scroll"
+        case NSScrollLockFunctionKey:
+            return "Scroll";
+        // "Select"
+        case NSSelectFunctionKey:
+            return "Select";
+
+        // "SelectMedia"
+        // "Shift"
+
+        // "Stop"
+        case NSStopFunctionKey:
+            return "Stop";
+        // "Up"
+        case NSUpArrowFunctionKey:
+            return "Up";
+        // "Undo"
+        case NSUndoFunctionKey:
+            return "Undo";
+
+        // "VolumeDown"
+        // "VolumeMute"
+        // "VolumeUp"
+        // "Win"
+        // "Zoom"
+
+        // More function keys, not in the key identifier specification.
+        case NSF25FunctionKey:
+            return "F25";
+        case NSF26FunctionKey:
+            return "F26";
+        case NSF27FunctionKey:
+            return "F27";
+        case NSF28FunctionKey:
+            return "F28";
+        case NSF29FunctionKey:
+            return "F29";
+        case NSF30FunctionKey:
+            return "F30";
+        case NSF31FunctionKey:
+            return "F31";
+        case NSF32FunctionKey:
+            return "F32";
+        case NSF33FunctionKey:
+            return "F33";
+        case NSF34FunctionKey:
+            return "F34";
+        case NSF35FunctionKey:
+            return "F35";
+
+        // Turn 0x7F into 0x08, because backspace needs to always be 0x08.
+        case 0x7F:
+            return "U+0008";
+        // Standard says that DEL becomes U+007F.
+        case NSDeleteFunctionKey:
+            return "U+007F";
+
+        // Always use 0x09 for tab instead of AppKit's backtab character.
+        case NSBackTabCharacter:
+            return "U+0009";
+
+        case NSBeginFunctionKey:
+        case NSBreakFunctionKey:
+        case NSClearDisplayFunctionKey:
+        case NSDeleteCharFunctionKey:
+        case NSDeleteLineFunctionKey:
+        case NSInsertCharFunctionKey:
+        case NSInsertLineFunctionKey:
+        case NSNextFunctionKey:
+        case NSPrevFunctionKey:
+        case NSPrintFunctionKey:
+        case NSRedoFunctionKey:
+        case NSResetFunctionKey:
+        case NSSysReqFunctionKey:
+        case NSSystemFunctionKey:
+        case NSUserFunctionKey:
+            // FIXME: We should use something other than the vendor-area Unicode values for the above keys.
+            // For now, just fall through to the default.
+        default:
+            return String::format("U+%04X", toASCIIUpper(charCode));
+    }
+}
+
+int windowsKeyCodeForKeyCode(uint16_t keyCode)
+{
+    static const int windowsKeyCode[] = {
+        /* 0 */ VK_A,
+        /* 1 */ VK_S,
+        /* 2 */ VK_D,
+        /* 3 */ VK_F,
+        /* 4 */ VK_H,
+        /* 5 */ VK_G,
+        /* 6 */ VK_Z,
+        /* 7 */ VK_X,
+        /* 8 */ VK_C,
+        /* 9 */ VK_V,
+        /* 0x0A */ VK_OEM_3, // "Section" - key to the left from 1 (ISO Keyboard Only)
+        /* 0x0B */ VK_B,
+        /* 0x0C */ VK_Q,
+        /* 0x0D */ VK_W,
+        /* 0x0E */ VK_E,
+        /* 0x0F */ VK_R,
+        /* 0x10 */ VK_Y,
+        /* 0x11 */ VK_T,
+        /* 0x12 */ VK_1,
+        /* 0x13 */ VK_2,
+        /* 0x14 */ VK_3,
+        /* 0x15 */ VK_4,
+        /* 0x16 */ VK_6,
+        /* 0x17 */ VK_5,
+        /* 0x18 */ VK_OEM_PLUS, // =+
+        /* 0x19 */ VK_9,
+        /* 0x1A */ VK_7,
+        /* 0x1B */ VK_OEM_MINUS, // -_
+        /* 0x1C */ VK_8,
+        /* 0x1D */ VK_0,
+        /* 0x1E */ VK_OEM_6, // ]}
+        /* 0x1F */ VK_O,
+        /* 0x20 */ VK_U,
+        /* 0x21 */ VK_OEM_4, // {[
+        /* 0x22 */ VK_I,
+        /* 0x23 */ VK_P,
+        /* 0x24 */ VK_RETURN, // Return
+        /* 0x25 */ VK_L,
+        /* 0x26 */ VK_J,
+        /* 0x27 */ VK_OEM_7, // '"
+        /* 0x28 */ VK_K,
+        /* 0x29 */ VK_OEM_1, // ;:
+        /* 0x2A */ VK_OEM_5, // \|
+        /* 0x2B */ VK_OEM_COMMA, // ,<
+        /* 0x2C */ VK_OEM_2, // /?
+        /* 0x2D */ VK_N,
+        /* 0x2E */ VK_M,
+        /* 0x2F */ VK_OEM_PERIOD, // .>
+        /* 0x30 */ VK_TAB,
+        /* 0x31 */ VK_SPACE,
+        /* 0x32 */ VK_OEM_3, // `~
+        /* 0x33 */ VK_BACK, // Backspace
+        /* 0x34 */ 0, // n/a
+        /* 0x35 */ VK_ESCAPE,
+        /* 0x36 */ VK_APPS, // Right Command
+        /* 0x37 */ VK_LWIN, // Left Command
+        /* 0x38 */ VK_SHIFT, // Left Shift
+        /* 0x39 */ VK_CAPITAL, // Caps Lock
+        /* 0x3A */ VK_MENU, // Left Option
+        /* 0x3B */ VK_CONTROL, // Left Ctrl
+        /* 0x3C */ VK_SHIFT, // Right Shift
+        /* 0x3D */ VK_MENU, // Right Option
+        /* 0x3E */ VK_CONTROL, // Right Ctrl
+        /* 0x3F */ 0, // fn
+        /* 0x40 */ VK_F17,
+        /* 0x41 */ VK_DECIMAL, // Num Pad .
+        /* 0x42 */ 0, // n/a
+        /* 0x43 */ VK_MULTIPLY, // Num Pad *
+        /* 0x44 */ 0, // n/a
+        /* 0x45 */ VK_ADD, // Num Pad +
+        /* 0x46 */ 0, // n/a
+        /* 0x47 */ VK_CLEAR, // Num Pad Clear
+        /* 0x48 */ VK_VOLUME_UP,
+        /* 0x49 */ VK_VOLUME_DOWN,
+        /* 0x4A */ VK_VOLUME_MUTE,
+        /* 0x4B */ VK_DIVIDE, // Num Pad /
+        /* 0x4C */ VK_RETURN, // Num Pad Enter
+        /* 0x4D */ 0, // n/a
+        /* 0x4E */ VK_SUBTRACT, // Num Pad -
+        /* 0x4F */ VK_F18,
+        /* 0x50 */ VK_F19,
+        /* 0x51 */ VK_OEM_PLUS, // Num Pad =. There is no such key on common PC keyboards, mapping to normal "+=".
+        /* 0x52 */ VK_NUMPAD0,
+        /* 0x53 */ VK_NUMPAD1,
+        /* 0x54 */ VK_NUMPAD2,
+        /* 0x55 */ VK_NUMPAD3,
+        /* 0x56 */ VK_NUMPAD4,
+        /* 0x57 */ VK_NUMPAD5,
+        /* 0x58 */ VK_NUMPAD6,
+        /* 0x59 */ VK_NUMPAD7,
+        /* 0x5A */ VK_F20,
+        /* 0x5B */ VK_NUMPAD8,
+        /* 0x5C */ VK_NUMPAD9,
+        /* 0x5D */ 0, // Yen (JIS Keyboard Only)
+        /* 0x5E */ 0, // Underscore (JIS Keyboard Only)
+        /* 0x5F */ 0, // KeypadComma (JIS Keyboard Only)
+        /* 0x60 */ VK_F5,
+        /* 0x61 */ VK_F6,
+        /* 0x62 */ VK_F7,
+        /* 0x63 */ VK_F3,
+        /* 0x64 */ VK_F8,
+        /* 0x65 */ VK_F9,
+        /* 0x66 */ 0, // Eisu (JIS Keyboard Only)
+        /* 0x67 */ VK_F11,
+        /* 0x68 */ 0, // Kana (JIS Keyboard Only)
+        /* 0x69 */ VK_F13,
+        /* 0x6A */ VK_F16,
+        /* 0x6B */ VK_F14,
+        /* 0x6C */ 0, // n/a
+        /* 0x6D */ VK_F10,
+        /* 0x6E */ 0, // n/a (Windows95 key?)
+        /* 0x6F */ VK_F12,
+        /* 0x70 */ 0, // n/a
+        /* 0x71 */ VK_F15,
+        /* 0x72 */ VK_INSERT, // Help
+        /* 0x73 */ VK_HOME, // Home
+        /* 0x74 */ VK_PRIOR, // Page Up
+        /* 0x75 */ VK_DELETE, // Forward Delete
+        /* 0x76 */ VK_F4,
+        /* 0x77 */ VK_END, // End
+        /* 0x78 */ VK_F2,
+        /* 0x79 */ VK_NEXT, // Page Down
+        /* 0x7A */ VK_F1,
+        /* 0x7B */ VK_LEFT, // Left Arrow
+        /* 0x7C */ VK_RIGHT, // Right Arrow
+        /* 0x7D */ VK_DOWN, // Down Arrow
+        /* 0x7E */ VK_UP, // Up Arrow
+        /* 0x7F */ 0 // n/a
+    };
+
+    if (keyCode >= 0x80)
+        return 0;
+
+     return windowsKeyCode[keyCode];
+}
+
+int windowsKeyCodeForCharCode(unichar charCode)
+{
+    switch (charCode) {
+        case 'a': case 'A': return VK_A; 
+        case 'b': case 'B': return VK_B; 
+        case 'c': case 'C': return VK_C; 
+        case 'd': case 'D': return VK_D; 
+        case 'e': case 'E': return VK_E; 
+        case 'f': case 'F': return VK_F; 
+        case 'g': case 'G': return VK_G; 
+        case 'h': case 'H': return VK_H; 
+        case 'i': case 'I': return VK_I; 
+        case 'j': case 'J': return VK_J; 
+        case 'k': case 'K': return VK_K; 
+        case 'l': case 'L': return VK_L; 
+        case 'm': case 'M': return VK_M; 
+        case 'n': case 'N': return VK_N; 
+        case 'o': case 'O': return VK_O; 
+        case 'p': case 'P': return VK_P; 
+        case 'q': case 'Q': return VK_Q; 
+        case 'r': case 'R': return VK_R; 
+        case 's': case 'S': return VK_S; 
+        case 't': case 'T': return VK_T; 
+        case 'u': case 'U': return VK_U; 
+        case 'v': case 'V': return VK_V; 
+        case 'w': case 'W': return VK_W; 
+        case 'x': case 'X': return VK_X; 
+        case 'y': case 'Y': return VK_Y; 
+        case 'z': case 'Z': return VK_Z; 
+
+        // AppKit generates Unicode PUA character codes for some function keys; using these when key code is not known.
+        case NSPauseFunctionKey: return VK_PAUSE;
+        case NSSelectFunctionKey: return VK_SELECT;
+        case NSPrintFunctionKey: return VK_PRINT;
+        case NSExecuteFunctionKey: return VK_EXECUTE;
+        case NSPrintScreenFunctionKey: return VK_SNAPSHOT;
+        case NSInsertFunctionKey: return VK_INSERT;
+        case NSF21FunctionKey: return VK_F21;
+        case NSF22FunctionKey: return VK_F22;
+        case NSF23FunctionKey: return VK_F23;
+        case NSF24FunctionKey: return VK_F24;
+        case NSScrollLockFunctionKey: return VK_SCROLL;
+
+        // This is for U.S. keyboard mapping, and doesn't necessarily make sense for different keyboard layouts.
+        // For example, '"' on Windows Russian layout is VK_2, not VK_OEM_7.
+        case ';': case ':': return VK_OEM_1; 
+        case '=': case '+': return VK_OEM_PLUS; 
+        case ',': case '<': return VK_OEM_COMMA; 
+        case '-': case '_': return VK_OEM_MINUS; 
+        case '.': case '>': return VK_OEM_PERIOD; 
+        case '/': case '?': return VK_OEM_2; 
+        case '`': case '~': return VK_OEM_3; 
+        case '[': case '{': return VK_OEM_4; 
+        case '\\': case '|': return VK_OEM_5; 
+        case ']': case '}': return VK_OEM_6; 
+        case '\'': case '"': return VK_OEM_7; 
+
+    }
+
+    return 0;
+}
+
+}
diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp
new file mode 100644
index 0000000..6ef51cf
--- /dev/null
+++ b/WebCore/platform/efl/ClipboardEfl.cpp
@@ -0,0 +1,141 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "ClipboardEfl.h"
+
+#include "Editor.h"
+#include "FileList.h"
+#include "NotImplemented.h"
+#include "StringHash.h"
+
+namespace WebCore {
+PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
+{
+    return new ClipboardEfl(policy, false);
+}
+
+ClipboardEfl::ClipboardEfl(ClipboardAccessPolicy policy, bool forDragging)
+    : Clipboard(policy, forDragging)
+{
+    notImplemented();
+}
+
+ClipboardEfl::~ClipboardEfl()
+{
+    notImplemented();
+}
+
+void ClipboardEfl::clearData(const String&)
+{
+    notImplemented();
+}
+
+void ClipboardEfl::writePlainText(const WebCore::String&)
+{
+    notImplemented();
+}
+
+void ClipboardEfl::clearAllData()
+{
+    notImplemented();
+}
+
+String ClipboardEfl::getData(const String&, bool &success) const
+{
+    notImplemented();
+    success = false;
+    return String();
+}
+
+bool ClipboardEfl::setData(const String&, const String&)
+{
+    notImplemented();
+    return false;
+}
+
+HashSet<String> ClipboardEfl::types() const
+{
+    notImplemented();
+    return HashSet<String>();
+}
+
+PassRefPtr<FileList> ClipboardEfl::files() const
+{
+    notImplemented();
+    return 0;
+}
+
+IntPoint ClipboardEfl::dragLocation() const
+{
+    notImplemented();
+    return IntPoint(0, 0);
+}
+
+CachedImage* ClipboardEfl::dragImage() const
+{
+    notImplemented();
+    return 0;
+}
+
+void ClipboardEfl::setDragImage(CachedImage*, const IntPoint&)
+{
+    notImplemented();
+}
+
+Node* ClipboardEfl::dragImageElement()
+{
+    notImplemented();
+    return 0;
+}
+
+void ClipboardEfl::setDragImageElement(Node*, const IntPoint&)
+{
+    notImplemented();
+}
+
+DragImageRef ClipboardEfl::createDragImage(IntPoint&) const
+{
+    notImplemented();
+    return 0;
+}
+
+void ClipboardEfl::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*)
+{
+    notImplemented();
+}
+
+void ClipboardEfl::writeURL(const KURL&, const String&, Frame*)
+{
+    notImplemented();
+}
+
+void ClipboardEfl::writeRange(Range*, Frame*)
+{
+    notImplemented();
+}
+
+bool ClipboardEfl::hasData()
+{
+    notImplemented();
+    return false;
+}
+
+}
diff --git a/WebCore/platform/efl/ClipboardEfl.h b/WebCore/platform/efl/ClipboardEfl.h
new file mode 100644
index 0000000..c8de431
--- /dev/null
+++ b/WebCore/platform/efl/ClipboardEfl.h
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef ClipboardEfl_h
+#define ClipboardEfl_h
+
+#include "Clipboard.h"
+
+namespace WebCore {
+class CachedImage;
+
+class ClipboardEfl : public Clipboard {
+public:
+    ClipboardEfl(ClipboardAccessPolicy, bool);
+    ~ClipboardEfl();
+
+    void clearData(const String&);
+    void clearAllData();
+    String getData(const String&, bool&) const;
+    bool setData(const String&, const String&);
+
+    HashSet<String> types() const;
+    virtual PassRefPtr<FileList> files() const;
+
+    IntPoint dragLocation() const;
+    CachedImage* dragImage() const;
+    void setDragImage(CachedImage*, const IntPoint&);
+    Node* dragImageElement();
+    void setDragImageElement(Node*, const IntPoint&);
+
+    virtual DragImageRef createDragImage(IntPoint&) const;
+    virtual void declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*);
+    virtual void writeURL(const KURL&, const String&, Frame*);
+    virtual void writeRange(Range*, Frame*);
+
+    virtual bool hasData();
+
+    virtual void writePlainText(const WebCore::String&);
+};
+}
+
+#endif
diff --git a/WebCore/platform/efl/ContextMenuEfl.cpp b/WebCore/platform/efl/ContextMenuEfl.cpp
new file mode 100644
index 0000000..240f106
--- /dev/null
+++ b/WebCore/platform/efl/ContextMenuEfl.cpp
@@ -0,0 +1,62 @@
+/*
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "ContextMenu.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+ContextMenu::ContextMenu(const HitTestResult& result)
+    : m_hitTestResult(result)
+    , m_platformDescription(0)
+{
+    notImplemented();
+}
+
+ContextMenu::~ContextMenu()
+{
+    notImplemented();
+}
+
+void ContextMenu::appendItem(ContextMenuItem&)
+{
+    notImplemented();
+}
+
+void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
+{
+    m_platformDescription = menu;
+}
+
+PlatformMenuDescription ContextMenu::platformDescription() const
+{
+    return m_platformDescription;
+}
+
+PlatformMenuDescription ContextMenu::releasePlatformDescription()
+{
+    notImplemented();
+    return 0;
+}
+
+}
diff --git a/WebCore/platform/efl/ContextMenuItemEfl.cpp b/WebCore/platform/efl/ContextMenuItemEfl.cpp
new file mode 100644
index 0000000..d669130
--- /dev/null
+++ b/WebCore/platform/efl/ContextMenuItemEfl.cpp
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "ContextMenuItem.h"
+
+#include "ContextMenu.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription)
+{
+    notImplemented();
+}
+
+ContextMenuItem::ContextMenuItem(ContextMenu*)
+{
+    notImplemented();
+}
+
+ContextMenuItem::ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, ContextMenu*)
+{
+    notImplemented();
+}
+
+ContextMenuItem::~ContextMenuItem()
+{
+    notImplemented();
+}
+
+PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription()
+{
+    notImplemented();
+    return m_platformDescription;
+}
+
+ContextMenuItemType ContextMenuItem::type() const
+{
+    notImplemented();
+    return ActionType;
+}
+
+void ContextMenuItem::setType(ContextMenuItemType)
+{
+    notImplemented();
+}
+
+ContextMenuAction ContextMenuItem::action() const
+{
+    notImplemented();
+    return ContextMenuItemTagNoAction;
+}
+
+void ContextMenuItem::setAction(ContextMenuAction)
+{
+    notImplemented();
+}
+
+String ContextMenuItem::title() const
+{
+    notImplemented();
+    return String();
+}
+
+void ContextMenuItem::setTitle(const String&)
+{
+    notImplemented();
+}
+
+PlatformMenuDescription ContextMenuItem::platformSubMenu() const
+{
+    notImplemented();
+    return 0;
+}
+
+void ContextMenuItem::setSubMenu(ContextMenu*)
+{
+    notImplemented();
+}
+
+void ContextMenuItem::setChecked(bool)
+{
+    notImplemented();
+}
+
+void ContextMenuItem::setEnabled(bool)
+{
+    notImplemented();
+}
+
+}
diff --git a/WebCore/platform/efl/CookieJarEfl.cpp b/WebCore/platform/efl/CookieJarEfl.cpp
new file mode 100644
index 0000000..01dcddb
--- /dev/null
+++ b/WebCore/platform/efl/CookieJarEfl.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "CookieJar.h"
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include "StringHash.h"
+
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+static HashMap<String, String> cookieJar;
+
+void setCookies(Document* document, const KURL& url, const KURL& policyURL, const String& value)
+{
+    cookieJar.set(url.string(), value);
+}
+
+String cookies(const Document* document, const KURL& url)
+{
+    return cookieJar.get(url.string());
+}
+
+bool cookiesEnabled(const Document* document)
+{
+    return true;
+}
+
+}
diff --git a/WebCore/platform/efl/CursorEfl.cpp b/WebCore/platform/efl/CursorEfl.cpp
new file mode 100644
index 0000000..c88830e
--- /dev/null
+++ b/WebCore/platform/efl/CursorEfl.cpp
@@ -0,0 +1,409 @@
+/*
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Charles Samuels <charles@kde.org>
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "Cursor.h"
+
+#include "NotImplemented.h"
+
+#include <Edje.h>
+#include <Evas.h>
+#include <stdio.h>
+#include <wtf/Assertions.h>
+
+namespace WebCore {
+
+Cursor::Cursor(PlatformCursor p)
+{
+    m_impl = eina_stringshare_add(p);
+}
+
+Cursor::Cursor(const Cursor& other)
+{
+    m_impl = eina_stringshare_ref(other.m_impl);
+}
+
+Cursor::~Cursor()
+{
+    if (m_impl) {
+        eina_stringshare_del(m_impl);
+        m_impl = 0;
+    }
+}
+
+Cursor::Cursor(Image* image, const IntPoint& hotspot)
+    : m_impl(0)
+{
+    notImplemented();
+}
+
+Cursor& Cursor::operator=(const Cursor& other)
+{
+    eina_stringshare_ref(other.m_impl);
+    eina_stringshare_del(m_impl);
+    m_impl = other.m_impl;
+    return *this;
+}
+
+namespace {
+
+class Cursors {
+protected:
+    Cursors()
+        : PointerCursor("cursor/pointer")
+        , MoveCursor("cursor/move")
+        , CrossCursor("cursor/cross")
+        , HandCursor("cursor/hand")
+        , IBeamCursor("cursor/i_beam")
+        , WaitCursor("cursor/wait")
+        , HelpCursor("cursor/help")
+        , EastResizeCursor("cursor/east_resize")
+        , NorthResizeCursor("cursor/north_resize")
+        , NorthEastResizeCursor("cursor/north_east_resize")
+        , NorthWestResizeCursor("cursor/north_west_resize")
+        , SouthResizeCursor("cursor/south_resize")
+        , SouthEastResizeCursor("cursor/south_east_resize")
+        , SouthWestResizeCursor("cursor/south_west_resize")
+        , WestResizeCursor("cursor/west_resize")
+        , NorthSouthResizeCursor("cursor/north_south_resize")
+        , EastWestResizeCursor("cursor/east_west_resize")
+        , NorthEastSouthWestResizeCursor("cursor/north_east_south_west_resize")
+        , NorthWestSouthEastResizeCursor("cursor/north_west_south_east_resize")
+        , ColumnResizeCursor("cursor/column_resize")
+        , RowResizeCursor("cursor/row_resize")
+        , MiddlePanningCursor("cursor/middle_panning")
+        , EastPanningCursor("cursor/east_panning")
+        , NorthPanningCursor("cursor/north_panning")
+        , NorthEastPanningCursor("cursor/north_east_panning")
+        , NorthWestPanningCursor("cursor/north_west_panning")
+        , SouthPanningCursor("cursor/south_panning")
+        , SouthEastPanningCursor("cursor/south_east_panning")
+        , SouthWestPanningCursor("cursor/south_west_panning")
+        , WestPanningCursor("cursor/west_panning")
+        , VerticalTextCursor("cursor/vertical_text")
+        , CellCursor("cursor/cell")
+        , ContextMenuCursor("cursor/context_menu")
+        , NoDropCursor("cursor/no_drop")
+        , CopyCursor("cursor/copy")
+        , ProgressCursor("cursor/progress")
+        , AliasCursor("cursor/alias")
+        , NoneCursor("cursor/none")
+        , NotAllowedCursor("cursor/not_allowed")
+        , ZoomInCursor("cursor/zoom_in")
+        , ZoomOutCursor("cursor/zoom_out")
+        , GrabCursor("cursor/grab")
+        , GrabbingCursor("cursor/grabbing")
+    {
+    }
+
+    ~Cursors()
+    {
+    }
+
+public:
+    static Cursors* self();
+    static Cursors* s_self;
+
+    Cursor PointerCursor;
+    Cursor MoveCursor;
+    Cursor CrossCursor;
+    Cursor HandCursor;
+    Cursor IBeamCursor;
+    Cursor WaitCursor;
+    Cursor HelpCursor;
+    Cursor EastResizeCursor;
+    Cursor NorthResizeCursor;
+    Cursor NorthEastResizeCursor;
+    Cursor NorthWestResizeCursor;
+    Cursor SouthResizeCursor;
+    Cursor SouthEastResizeCursor;
+    Cursor SouthWestResizeCursor;
+    Cursor WestResizeCursor;
+    Cursor NorthSouthResizeCursor;
+    Cursor EastWestResizeCursor;
+    Cursor NorthEastSouthWestResizeCursor;
+    Cursor NorthWestSouthEastResizeCursor;
+    Cursor ColumnResizeCursor;
+    Cursor RowResizeCursor;
+    Cursor MiddlePanningCursor;
+    Cursor EastPanningCursor;
+    Cursor NorthPanningCursor;
+    Cursor NorthEastPanningCursor;
+    Cursor NorthWestPanningCursor;
+    Cursor SouthPanningCursor;
+    Cursor SouthEastPanningCursor;
+    Cursor SouthWestPanningCursor;
+    Cursor WestPanningCursor;
+    Cursor VerticalTextCursor;
+    Cursor CellCursor;
+    Cursor ContextMenuCursor;
+    Cursor NoDropCursor;
+    Cursor CopyCursor;
+    Cursor ProgressCursor;
+    Cursor AliasCursor;
+    Cursor NoneCursor;
+    Cursor NotAllowedCursor;
+    Cursor ZoomInCursor;
+    Cursor ZoomOutCursor;
+    Cursor GrabCursor;
+    Cursor GrabbingCursor;
+};
+
+Cursors* Cursors::s_self = 0;
+
+Cursors* Cursors::self()
+{
+    if (!s_self)
+        s_self = new Cursors();
+
+    return s_self;
+}
+
+}
+
+const Cursor& pointerCursor()
+{
+    return Cursors::self()->PointerCursor;
+}
+
+const Cursor& moveCursor()
+{
+    return Cursors::self()->MoveCursor;
+}
+
+const Cursor& crossCursor()
+{
+    return Cursors::self()->CrossCursor;
+}
+
+const Cursor& handCursor()
+{
+    return Cursors::self()->HandCursor;
+}
+
+const Cursor& iBeamCursor()
+{
+    return Cursors::self()->IBeamCursor;
+}
+
+const Cursor& waitCursor()
+{
+    return Cursors::self()->WaitCursor;
+}
+
+const Cursor& helpCursor()
+{
+    return Cursors::self()->HelpCursor;
+}
+
+const Cursor& eastResizeCursor()
+{
+    return Cursors::self()->EastResizeCursor;
+}
+
+const Cursor& northResizeCursor()
+{
+    return Cursors::self()->NorthResizeCursor;
+}
+
+const Cursor& northEastResizeCursor()
+{
+    return Cursors::self()->NorthEastResizeCursor;
+}
+
+const Cursor& northWestResizeCursor()
+{
+    return Cursors::self()->NorthWestResizeCursor;
+}
+
+const Cursor& southResizeCursor()
+{
+    return Cursors::self()->SouthResizeCursor;
+}
+
+const Cursor& southEastResizeCursor()
+{
+    return Cursors::self()->SouthEastResizeCursor;
+}
+
+const Cursor& southWestResizeCursor()
+{
+    return Cursors::self()->SouthWestResizeCursor;
+}
+
+const Cursor& westResizeCursor()
+{
+    return Cursors::self()->WestResizeCursor;
+}
+
+const Cursor& northSouthResizeCursor()
+{
+    return Cursors::self()->NorthSouthResizeCursor;
+}
+
+const Cursor& eastWestResizeCursor()
+{
+    return Cursors::self()->EastWestResizeCursor;
+}
+
+const Cursor& northEastSouthWestResizeCursor()
+{
+    return Cursors::self()->NorthEastSouthWestResizeCursor;
+}
+
+const Cursor& northWestSouthEastResizeCursor()
+{
+    return Cursors::self()->NorthWestSouthEastResizeCursor;
+}
+
+const Cursor& columnResizeCursor()
+{
+    return Cursors::self()->ColumnResizeCursor;
+}
+
+const Cursor& rowResizeCursor()
+{
+    return Cursors::self()->RowResizeCursor;
+}
+
+const Cursor& middlePanningCursor()
+{
+    return Cursors::self()->MiddlePanningCursor;
+}
+
+const Cursor& eastPanningCursor()
+{
+    return Cursors::self()->EastPanningCursor;
+}
+
+const Cursor& northPanningCursor()
+{
+    return Cursors::self()->NorthPanningCursor;
+}
+
+const Cursor& northEastPanningCursor()
+{
+    return Cursors::self()->NorthEastPanningCursor;
+}
+
+const Cursor& northWestPanningCursor()
+{
+    return Cursors::self()->NorthWestPanningCursor;
+}
+
+const Cursor& southPanningCursor()
+{
+    return Cursors::self()->SouthPanningCursor;
+}
+
+const Cursor& southEastPanningCursor()
+{
+    return Cursors::self()->SouthEastPanningCursor;
+}
+
+const Cursor& southWestPanningCursor()
+{
+    return Cursors::self()->SouthWestPanningCursor;
+}
+
+const Cursor& westPanningCursor()
+{
+    return Cursors::self()->WestPanningCursor;
+}
+
+const Cursor& verticalTextCursor()
+{
+    return Cursors::self()->VerticalTextCursor;
+}
+
+const Cursor& cellCursor()
+{
+    return Cursors::self()->CellCursor;
+}
+
+const Cursor& contextMenuCursor()
+{
+    return Cursors::self()->ContextMenuCursor;
+}
+
+const Cursor& noDropCursor()
+{
+    return Cursors::self()->NoDropCursor;
+}
+
+const Cursor& copyCursor()
+{
+    return Cursors::self()->CopyCursor;
+}
+
+const Cursor& progressCursor()
+{
+    return Cursors::self()->ProgressCursor;
+}
+
+const Cursor& aliasCursor()
+{
+    return Cursors::self()->AliasCursor;
+}
+
+const Cursor& noneCursor()
+{
+    return Cursors::self()->NoneCursor;
+}
+
+const Cursor& notAllowedCursor()
+{
+    return Cursors::self()->NotAllowedCursor;
+}
+
+const Cursor& zoomInCursor()
+{
+    return Cursors::self()->ZoomInCursor;
+}
+
+const Cursor& zoomOutCursor()
+{
+    return Cursors::self()->ZoomOutCursor;
+}
+
+const Cursor& grabCursor()
+{
+    return Cursors::self()->GrabCursor;
+}
+
+const Cursor& grabbingCursor()
+{
+    return Cursors::self()->GrabbingCursor;
+}
+
+}
diff --git a/WebCore/platform/efl/DragDataEfl.cpp b/WebCore/platform/efl/DragDataEfl.cpp
new file mode 100644
index 0000000..3f9eccb
--- /dev/null
+++ b/WebCore/platform/efl/DragDataEfl.cpp
@@ -0,0 +1,89 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "DragData.h"
+
+#include "Clipboard.h"
+#include "Document.h"
+#include "DocumentFragment.h"
+
+namespace WebCore {
+
+bool DragData::canSmartReplace() const
+{
+    return false;
+}
+
+bool DragData::containsColor() const
+{
+    return false;
+}
+
+bool DragData::containsFiles() const
+{
+    return false;
+}
+
+void DragData::asFilenames(Vector<String>& result) const
+{
+}
+
+bool DragData::containsPlainText() const
+{
+    return false;
+}
+
+String DragData::asPlainText() const
+{
+    return String();
+}
+
+Color DragData::asColor() const
+{
+    return Color();
+}
+
+PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy) const
+{
+    return 0;
+}
+
+bool DragData::containsCompatibleContent() const
+{
+    return false;
+}
+
+bool DragData::containsURL() const
+{
+    return false;
+}
+
+String DragData::asURL(String* title) const
+{
+    return String();
+}
+
+PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const
+{
+    return 0;
+}
+
+}
diff --git a/WebCore/platform/efl/DragImageEfl.cpp b/WebCore/platform/efl/DragImageEfl.cpp
new file mode 100644
index 0000000..4b0f417
--- /dev/null
+++ b/WebCore/platform/efl/DragImageEfl.cpp
@@ -0,0 +1,65 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "DragImage.h"
+
+#include "CachedImage.h"
+#include "Image.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+IntSize dragImageSize(DragImageRef)
+{
+    notImplemented();
+    return IntSize(0, 0);
+}
+
+void deleteDragImage(DragImageRef)
+{
+    notImplemented();
+}
+
+DragImageRef scaleDragImage(DragImageRef image, FloatSize)
+{
+    notImplemented();
+    return image;
+}
+
+DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
+{
+    notImplemented();
+    return image;
+}
+
+DragImageRef createDragImageFromImage(Image*)
+{
+    notImplemented();
+    return 0;
+}
+
+DragImageRef createDragImageIconForCachedImage(CachedImage*)
+{
+    notImplemented();
+    return 0;
+}
+
+}
diff --git a/WebCore/platform/efl/EventLoopEfl.cpp b/WebCore/platform/efl/EventLoopEfl.cpp
new file mode 100644
index 0000000..533ffe9
--- /dev/null
+++ b/WebCore/platform/efl/EventLoopEfl.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "EventLoop.h"
+
+#include <Ecore.h>
+
+namespace WebCore {
+
+void EventLoop::cycle()
+{
+    ecore_main_loop_iterate();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/efl/FileChooserEfl.cpp b/WebCore/platform/efl/FileChooserEfl.cpp
new file mode 100644
index 0000000..866caae
--- /dev/null
+++ b/WebCore/platform/efl/FileChooserEfl.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008, 2009 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "FileChooser.h"
+
+#include "LocalizedStrings.h"
+
+namespace WebCore {
+
+String FileChooser::basenameForWidth(const Font& font, int width) const
+{
+    if (width <= 0)
+        return String();
+
+    if (m_filenames.isEmpty())
+        return fileButtonNoFileSelectedLabel();
+}
+
+}
diff --git a/WebCore/platform/efl/FileSystemEfl.cpp b/WebCore/platform/efl/FileSystemEfl.cpp
new file mode 100644
index 0000000..f612793
--- /dev/null
+++ b/WebCore/platform/efl/FileSystemEfl.cpp
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ * Copyright (C) 2008 Kenneth Rohde Christiansen.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "FileSystem.h"
+
+#include "NotImplemented.h"
+
+#include <Ecore.h>
+#include <Ecore_File.h>
+#include <Eina.h>
+#include <dirent.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <fnmatch.h>
+#include <glib.h> // TODO: remove me after following TODO is solved.
+#include <limits.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+CString fileSystemRepresentation(const String& path)
+{
+    return path.utf8();
+}
+
+char* filenameFromString(const String& string)
+{
+// WARNING: this is just used by platform/network/soup, thus must be GLIB!!!
+// TODO: move this to CString and use it instead in both, being more standard
+#if PLATFORM(WIN_OS)
+    return g_strdup(string.utf8().data());
+#else
+    return g_uri_unescape_string(string.utf8().data(), 0);
+#endif
+}
+
+CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
+{
+    char buffer[PATH_MAX];
+    const char* tmpDir = getenv("TMPDIR");
+
+    if (!tmpDir)
+        tmpDir = "/tmp";
+
+    if (snprintf(buffer, PATH_MAX, "%s/%sXXXXXX", tmpDir, prefix) >= PATH_MAX)
+        goto end;
+
+    handle = mkstemp(buffer);
+    if (handle < 0)
+        goto end;
+
+    return CString(buffer);
+
+end:
+    handle = invalidPlatformFileHandle;
+    return CString();
+}
+
+bool unloadModule(PlatformModule module)
+{
+    // caution, closing handle will make memory vanish and any remaining
+    // timer, idler, threads or any other left-over will crash,
+    // maybe just ignore this is a safer solution?
+    return !dlclose(module);
+}
+
+String homeDirectoryPath()
+{
+    const char *home = getenv("HOME");
+    if (!home) {
+        home = getenv("TMPDIR");
+        if (!home)
+            home = "/tmp";
+    }
+    return String::fromUTF8(home);
+}
+
+Vector<String> listDirectory(const String& path, const String& filter)
+{
+    Vector<String> entries;
+    CString cpath = path.utf8();
+    CString cfilter = filter.utf8();
+    char filePath[PATH_MAX];
+    char* fileName;
+    size_t fileNameSpace;
+    DIR* dir;
+
+    if (cpath.length() + NAME_MAX >= sizeof(filePath))
+        return entries;
+    // loop invariant: directory part + '/'
+    memcpy(filePath, cpath.data(), cpath.length());
+    fileName = filePath + cpath.length();
+    if (cpath.length() > 0 && filePath[cpath.length() - 1] != '/') {
+        fileName[0] = '/';
+        fileName++;
+    }
+    fileNameSpace = sizeof(filePath) - (fileName - filePath) - 1;
+
+    dir = opendir(cpath.data());
+    if (!dir)
+        return entries;
+
+    struct dirent* de;
+    while (de = readdir(dir)) {
+        size_t nameLen;
+        if (de->d_name[0] == '.') {
+            if (de->d_name[1] == '\0')
+                continue;
+            if (de->d_name[1] == '.' && de->d_name[2] == '\0')
+                continue;
+        }
+        if (fnmatch(cfilter.data(), de->d_name, 0))
+            continue;
+
+        nameLen = strlen(de->d_name);
+        if (nameLen >= fileNameSpace)
+            continue; // maybe assert? it should never happen anyway...
+
+        memcpy(fileName, de->d_name, nameLen + 1);
+        entries.append(filePath);
+    }
+    closedir(dir);
+    return entries;
+}
+
+}
diff --git a/WebCore/platform/efl/KURLEfl.cpp b/WebCore/platform/efl/KURLEfl.cpp
new file mode 100644
index 0000000..69af7ba
--- /dev/null
+++ b/WebCore/platform/efl/KURLEfl.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "KURL.h"
+
+namespace WebCore {
+
+String KURL::fileSystemPath() const
+{
+    if (!isValid() || !protocolIs("file"))
+        return String();
+
+    return String(path());
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/efl/Language.cpp b/WebCore/platform/efl/Language.cpp
new file mode 100644
index 0000000..1da7925
--- /dev/null
+++ b/WebCore/platform/efl/Language.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "Language.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String defaultLanguage()
+{
+    notImplemented();
+    return String();
+}
+
+}
diff --git a/WebCore/platform/efl/LocalizedStringsEfl.cpp b/WebCore/platform/efl/LocalizedStringsEfl.cpp
new file mode 100644
index 0000000..b53ca82
--- /dev/null
+++ b/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -0,0 +1,418 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
+ * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2008 INdT Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "LocalizedStrings.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String submitButtonDefaultLabel()
+{
+    return String::fromUTF8("Submit");
+}
+
+String inputElementAltText()
+{
+    return String::fromUTF8("Submit");
+}
+
+String resetButtonDefaultLabel()
+{
+    return String::fromUTF8("Reset");
+}
+
+String searchableIndexIntroduction()
+{
+    return String::fromUTF8("_Searchable Index");
+}
+
+String fileButtonChooseFileLabel()
+{
+    return String::fromUTF8("Choose File");
+}
+
+String fileButtonNoFileSelectedLabel()
+{
+    return String::fromUTF8("No file selected");
+}
+
+String contextMenuItemTagOpenLinkInNewWindow()
+{
+    return String::fromUTF8("Open Link in New _Window");
+}
+
+String contextMenuItemTagDownloadLinkToDisk()
+{
+    return String::fromUTF8("_Download Linked File");
+}
+
+String contextMenuItemTagCopyLinkToClipboard()
+{
+    return String::fromUTF8("Copy Link Loc_ation");
+}
+
+String contextMenuItemTagOpenImageInNewWindow()
+{
+    return String::fromUTF8("Open _Image in New Window");
+}
+
+String contextMenuItemTagDownloadImageToDisk()
+{
+    return String::fromUTF8("Sa_ve Image As");
+}
+
+String contextMenuItemTagCopyImageToClipboard()
+{
+    return String::fromUTF8("Cop_y Image");
+}
+
+String contextMenuItemTagOpenFrameInNewWindow()
+{
+    return String::fromUTF8("Open _Frame in New Window");
+}
+
+String contextMenuItemTagCopy()
+{
+    static String stockLabel = String::fromUTF8("Copy");
+    return stockLabel;
+}
+
+String contextMenuItemTagDelete()
+{
+    static String stockLabel = String::fromUTF8("Delete");
+    return stockLabel;
+}
+
+String contextMenuItemTagSelectAll()
+{
+    static String stockLabel = String::fromUTF8("Select _All");
+    return stockLabel;
+}
+
+String contextMenuItemTagUnicode()
+{
+    return String::fromUTF8("_Insert Unicode Control Character");
+}
+
+String contextMenuItemTagInputMethods()
+{
+    return String::fromUTF8("Input _Methods");
+}
+
+String contextMenuItemTagGoBack()
+{
+    static String stockLabel = String::fromUTF8("Go_Back");
+    return stockLabel;
+}
+
+String contextMenuItemTagGoForward()
+{
+    static String stockLabel = String::fromUTF8("Go_Forward");
+    return stockLabel;
+}
+
+String contextMenuItemTagStop()
+{
+    static String stockLabel = String::fromUTF8("Stop");
+    return stockLabel;
+}
+
+String contextMenuItemTagReload()
+{
+    return String::fromUTF8("_Reload");
+}
+
+String contextMenuItemTagCut()
+{
+    static String stockLabel = String::fromUTF8("Cut");
+    return stockLabel;
+}
+
+String contextMenuItemTagPaste()
+{
+    static String stockLabel = String::fromUTF8("Paste");
+    return stockLabel;
+}
+
+String contextMenuItemTagNoGuessesFound()
+{
+    return String::fromUTF8("No Guesses Found");
+}
+
+String contextMenuItemTagIgnoreSpelling()
+{
+    return String::fromUTF8("_Ignore Spelling");
+}
+
+String contextMenuItemTagLearnSpelling()
+{
+    return String::fromUTF8("_Learn Spelling");
+}
+
+String contextMenuItemTagSearchWeb()
+{
+    return String::fromUTF8("_Search the Web");
+}
+
+String contextMenuItemTagLookUpInDictionary()
+{
+    return String::fromUTF8("_Look Up in Dictionary");
+}
+
+String contextMenuItemTagOpenLink()
+{
+    return String::fromUTF8("_Open Link");
+}
+
+String contextMenuItemTagIgnoreGrammar()
+{
+    return String::fromUTF8("Ignore _Grammar");
+}
+
+String contextMenuItemTagSpellingMenu()
+{
+    return String::fromUTF8("Spelling and _Grammar");
+}
+
+String contextMenuItemTagShowSpellingPanel(bool show)
+{
+    return String::fromUTF8(show ? "Show Spelling and Grammar" : "Hide Spelling and Grammar");
+}
+
+String contextMenuItemTagCheckSpelling()
+{
+    return String::fromUTF8("_Check Document Now");
+}
+
+String contextMenuItemTagCheckSpellingWhileTyping()
+{
+    return String::fromUTF8("Check Spelling While _Typing");
+}
+
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+    return String::fromUTF8("Check _Grammar With Spelling");
+}
+
+String contextMenuItemTagFontMenu()
+{
+    return String::fromUTF8("_Font");
+}
+
+String contextMenuItemTagBold()
+{
+    static String stockLabel = String::fromUTF8("Bold");
+    return stockLabel;
+}
+
+String contextMenuItemTagItalic()
+{
+    static String stockLabel = String::fromUTF8("Italic");
+    return stockLabel;
+}
+
+String contextMenuItemTagUnderline()
+{
+    static String stockLabel = String::fromUTF8("Underline");
+    return stockLabel;
+}
+
+String contextMenuItemTagOutline()
+{
+    return String::fromUTF8("_Outline");
+}
+
+String contextMenuItemTagInspectElement()
+{
+    return String::fromUTF8("Inspect _Element");
+}
+
+String contextMenuItemTagRightToLeft()
+{
+    return String();
+}
+
+String contextMenuItemTagLeftToRight()
+{
+    return String();
+}
+
+String contextMenuItemTagWritingDirectionMenu()
+{
+    return String();
+}
+
+String contextMenuItemTagTextDirectionMenu()
+{
+    return String();
+}
+
+String contextMenuItemTagDefaultDirection()
+{
+    return String();
+}
+
+String searchMenuNoRecentSearchesText()
+{
+    return String::fromUTF8("No recent searches");
+}
+
+String searchMenuRecentSearchesText()
+{
+    return String::fromUTF8("Recent searches");
+}
+
+String searchMenuClearRecentSearchesText()
+{
+    return String::fromUTF8("_Clear recent searches");
+}
+
+String AXDefinitionListTermText()
+{
+    return String::fromUTF8("term");
+}
+
+String AXDefinitionListDefinitionText()
+{
+    return String::fromUTF8("definition");
+}
+
+String AXButtonActionVerb()
+{
+    return String::fromUTF8("press");
+}
+
+String AXRadioButtonActionVerb()
+{
+    return String::fromUTF8("select");
+}
+
+String AXTextFieldActionVerb()
+{
+    return String::fromUTF8("activate");
+}
+
+String AXCheckedCheckBoxActionVerb()
+{
+    return String::fromUTF8("uncheck");
+}
+
+String AXUncheckedCheckBoxActionVerb()
+{
+    return String::fromUTF8("check");
+}
+
+String AXLinkActionVerb()
+{
+    return String::fromUTF8("jump");
+}
+
+String unknownFileSizeText()
+{
+    return String::fromUTF8("Unknown");
+}
+
+String imageTitle(const String& filename, const IntSize& size)
+{
+    notImplemented();
+    return String();
+}
+
+String mediaElementLoadingStateText()
+{
+    return String::fromUTF8("Loading...");
+}
+
+String mediaElementLiveBroadcastStateText()
+{
+    return String::fromUTF8("Live Broadcast");
+}
+
+String validationMessagePatternMismatchText()
+{
+    return String::fromUTF8("pattern mismatch");
+}
+
+String validationMessageRangeOverflowText()
+{
+    return String::fromUTF8("range overflow");
+}
+
+String validationMessageRangeUnderflowText()
+{
+    return String::fromUTF8("range underflow");
+}
+
+String validationMessageStepMismatchText()
+{
+    return String::fromUTF8("step mismatch");
+}
+
+String validationMessageTooLongText()
+{
+    return String::fromUTF8("too long");
+}
+
+String validationMessageTypeMismatchText()
+{
+    return String::fromUTF8("type mismatch");
+}
+
+String validationMessageValueMissingText()
+{
+    return String::fromUTF8("value missing");
+}
+
+String AXMenuListPopupActionVerb()
+{
+    return String();
+}
+
+String AXMenuListActionVerb()
+{
+    return String();
+}
+
+String missingPluginText()
+{
+    return String::fromUTF8("Missing Plug-in");
+}
+
+String crashedPluginText()
+{
+    return String::fromUTF8("Plug-in Crashed");
+}
+
+}
diff --git a/WebCore/platform/efl/LoggingEfl.cpp b/WebCore/platform/efl/LoggingEfl.cpp
new file mode 100644
index 0000000..1829c80
--- /dev/null
+++ b/WebCore/platform/efl/LoggingEfl.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "Logging.h"
+
+namespace WebCore {
+
+void InitializeLoggingChannelsIfNecessary()
+{
+    LogNotYetImplemented.state = WTFLogChannelOn;
+}
+
+}
diff --git a/WebCore/platform/efl/MIMETypeRegistryEfl.cpp b/WebCore/platform/efl/MIMETypeRegistryEfl.cpp
new file mode 100644
index 0000000..b98c818
--- /dev/null
+++ b/WebCore/platform/efl/MIMETypeRegistryEfl.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Torch Mobile Inc.  http://www.torchmobile.com/
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "MIMETypeRegistry.h"
+
+namespace WebCore {
+
+struct ExtensionMap {
+    const char* extension;
+    const char* mimeType;
+};
+
+static const ExtensionMap extensionMap[] = {
+    { "bmp", "image/bmp" },
+    { "css", "text/css" },
+    { "gif", "image/gif" },
+    { "html", "text/html" },
+    { "htm", "text/html" },
+    { "ico", "image/x-icon" },
+    { "jpeg", "image/jpeg" },
+    { "jpg", "image/jpeg" },
+    { "js", "application/x-javascript" },
+    { "mng", "video/x-mng" },
+    { "pbm", "image/x-portable-bitmap" },
+    { "pgm", "image/x-portable-graymap" },
+    { "pdf", "application/pdf" },
+    { "png", "image/png" },
+    { "ppm", "image/x-portable-pixmap" },
+    { "rss", "application/rss+xml" },
+    { "svg", "image/svg+xml" },
+    { "text", "text/plain" },
+    { "tif", "image/tiff" },
+    { "tiff", "image/tiff" },
+    { "txt", "text/plain" },
+    { "xbm", "image/x-xbitmap" },
+    { "xml", "text/xml" },
+    { "xpm", "image/x-xpm" },
+    { "xsl", "text/xsl" },
+    { "xhtml", "application/xhtml+xml" },
+    { "wml", "text/vnd.wap.wml" },
+    { "wmlc", "application/vnd.wap.wmlc" },
+    { 0, 0 }
+};
+
+String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
+{
+    String s = ext.lower();
+    const ExtensionMap *e = extensionMap;
+    while (e->extension) {
+        if (s == e->extension)
+            return e->mimeType;
+        ++e;
+    }
+
+    return "application/octet-stream";
+}
+
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
+}
diff --git a/WebCore/platform/efl/PasteboardEfl.cpp b/WebCore/platform/efl/PasteboardEfl.cpp
new file mode 100644
index 0000000..1af5a92
--- /dev/null
+++ b/WebCore/platform/efl/PasteboardEfl.cpp
@@ -0,0 +1,98 @@
+/*
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *  Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "Pasteboard.h"
+
+#include "DocumentFragment.h"
+#include "Frame.h"
+#include "Image.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "RenderImage.h"
+#include "markup.h"
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+Pasteboard* Pasteboard::generalPasteboard()
+{
+    static Pasteboard* pasteboard = new Pasteboard();
+    return pasteboard;
+}
+
+Pasteboard::Pasteboard()
+{
+    notImplemented();
+}
+
+Pasteboard::~Pasteboard()
+{
+    notImplemented();
+}
+
+void Pasteboard::writePlainText(const String&)
+{
+    notImplemented();
+}
+
+void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
+{
+    notImplemented();
+}
+
+void Pasteboard::writeURL(const KURL&, const String&, Frame*)
+{
+    notImplemented();
+}
+
+void Pasteboard::writeImage(Node* node, const KURL&, const String&)
+{
+    notImplemented();
+}
+
+void Pasteboard::clear()
+{
+    notImplemented();
+}
+
+bool Pasteboard::canSmartReplace()
+{
+    notImplemented();
+    return false;
+}
+
+PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context,
+                                                          bool allowPlainText, bool& chosePlainText)
+{
+    notImplemented();
+    return 0;
+}
+
+String Pasteboard::plainText(Frame*)
+{
+    notImplemented();
+    return String();
+}
+
+}
diff --git a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
new file mode 100644
index 0000000..692ddf4
--- /dev/null
+++ b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2008 Diego Hidalgo C. Gonzalez
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "PlatformKeyboardEvent.h"
+
+#include "NotImplemented.h"
+#include "StringHash.h"
+#include "TextEncoding.h"
+#include "WindowsKeyboardCodes.h"
+
+#include <stdio.h>
+#include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+typedef HashMap<String, String> KeyMap;
+typedef HashMap<String, int> WindowsKeyMap;
+
+static KeyMap gKeyMap;
+static WindowsKeyMap gWindowsKeyMap;
+
+static void createKeyMap()
+{
+    for (unsigned int i = 1; i < 25; i++) {
+        String key = String::format("F%d", i);
+        gKeyMap.set(key, key);
+    }
+    gKeyMap.set("Alt_L", "Alt");
+    gKeyMap.set("ISO_Level3_Shift", "Alt");
+    gKeyMap.set("Menu", "Alt");
+    gKeyMap.set("Shift_L", "Shift");
+    gKeyMap.set("Shift_R", "Shift");
+    gKeyMap.set("Down", "Down");
+    gKeyMap.set("End", "End");
+    gKeyMap.set("Return", "Enter");
+    gKeyMap.set("KP_Enter", "Enter");
+    gKeyMap.set("Home", "Home");
+    gKeyMap.set("Insert", "Insert");
+    gKeyMap.set("Left", "Left");
+    gKeyMap.set("Down", "Down");
+    gKeyMap.set("Next", "PageDown");
+    gKeyMap.set("Prior", "PageUp");
+    gKeyMap.set("Right", "Right");
+    gKeyMap.set("Up", "Up");
+    gKeyMap.set("Delete", "U+007F");
+    gKeyMap.set("Tab", "U+0009");
+    gKeyMap.set("ISO_Left_Tab", "U+0009");
+}
+
+static void createWindowsKeyMap()
+{
+    gWindowsKeyMap.set("Return",     VK_RETURN);
+    gWindowsKeyMap.set("KP_Return",  VK_RETURN);
+    gWindowsKeyMap.set("Alt_L",      VK_MENU);
+    gWindowsKeyMap.set("ISO_Level3_Shift", VK_MENU);
+    gWindowsKeyMap.set("Menu",       VK_MENU);
+    gWindowsKeyMap.set("Shift_L",    VK_SHIFT);
+    gWindowsKeyMap.set("Shift_R",    VK_SHIFT);
+    gWindowsKeyMap.set("Control_L",  VK_CONTROL);
+    gWindowsKeyMap.set("Control_R",  VK_CONTROL);
+    gWindowsKeyMap.set("Pause",      VK_PAUSE);
+    gWindowsKeyMap.set("Break",      VK_PAUSE);
+    gWindowsKeyMap.set("Caps_Lock",  VK_CAPITAL);
+    gWindowsKeyMap.set("Scroll_Lock", VK_SCROLL);
+    gWindowsKeyMap.set("Num_Lock",   VK_NUMLOCK);
+    gWindowsKeyMap.set("Escape",     VK_ESCAPE);
+    gWindowsKeyMap.set("Tab",        VK_TAB);
+    gWindowsKeyMap.set("ISO_Left_Tab", VK_TAB);
+    gWindowsKeyMap.set("BackSpace",  VK_BACK);
+    gWindowsKeyMap.set("Space",      VK_SPACE);
+    gWindowsKeyMap.set("Next",       VK_NEXT);
+    gWindowsKeyMap.set("Prior",      VK_PRIOR);
+    gWindowsKeyMap.set("Home",       VK_HOME);
+    gWindowsKeyMap.set("End",        VK_END);
+    gWindowsKeyMap.set("Right",      VK_RIGHT);
+    gWindowsKeyMap.set("Left",       VK_LEFT);
+    gWindowsKeyMap.set("Up",         VK_UP);
+    gWindowsKeyMap.set("Down",       VK_DOWN);
+    gWindowsKeyMap.set("Print",      VK_PRINT);
+    gWindowsKeyMap.set("Insert",     VK_INSERT);
+    gWindowsKeyMap.set("Delete",     VK_DELETE);
+
+    gWindowsKeyMap.set("comma",        VK_OEM_COMMA);
+    gWindowsKeyMap.set("less",         VK_OEM_COMMA);
+    gWindowsKeyMap.set("period",       VK_OEM_PERIOD);
+    gWindowsKeyMap.set("greater",      VK_OEM_PERIOD);
+    gWindowsKeyMap.set("semicolon",    VK_OEM_1);
+    gWindowsKeyMap.set("colon",        VK_OEM_1);
+    gWindowsKeyMap.set("slash",        VK_OEM_2);
+    gWindowsKeyMap.set("question",     VK_OEM_2);
+    gWindowsKeyMap.set("grave",        VK_OEM_3);
+    gWindowsKeyMap.set("asciitilde",   VK_OEM_3);
+    gWindowsKeyMap.set("bracketleft",  VK_OEM_4);
+    gWindowsKeyMap.set("braceleft",    VK_OEM_4);
+    gWindowsKeyMap.set("backslash",    VK_OEM_5);
+    gWindowsKeyMap.set("bar",          VK_OEM_5);
+    gWindowsKeyMap.set("bracketright", VK_OEM_6);
+    gWindowsKeyMap.set("braceright",   VK_OEM_6);
+    gWindowsKeyMap.set("apostrophe",   VK_OEM_7);
+    gWindowsKeyMap.set("quotedbl",     VK_OEM_7);
+
+    // Alphabet
+    String alphabet = "abcdefghijklmnopqrstuvwxyz";
+    for (unsigned int i = 0; i < 26; i++) {
+        String key = String::format("%c", alphabet[i]);
+        gWindowsKeyMap.set(key, VK_A + i);
+    }
+
+    // Digits
+    for (unsigned int i = 0; i < 10; i++) {
+        String key = String::format("%d", i);
+        gWindowsKeyMap.set(key, VK_0 + i);
+    }
+
+    // Shifted digits
+    gWindowsKeyMap.set("exclam",    VK_1);
+    gWindowsKeyMap.set("at",        VK_2);
+    gWindowsKeyMap.set("numbersign", VK_3);
+    gWindowsKeyMap.set("dollar",    VK_4);
+    gWindowsKeyMap.set("percent",   VK_5);
+    gWindowsKeyMap.set("asciicircum", VK_6);
+    gWindowsKeyMap.set("ampersand", VK_7);
+    gWindowsKeyMap.set("asterisk",  VK_8);
+    gWindowsKeyMap.set("parenleft", VK_9);
+    gWindowsKeyMap.set("parenright", VK_0);
+    gWindowsKeyMap.set("minus",     VK_OEM_MINUS);
+    gWindowsKeyMap.set("underscore", VK_OEM_MINUS);
+    gWindowsKeyMap.set("equal",     VK_OEM_PLUS);
+    gWindowsKeyMap.set("plus",      VK_OEM_PLUS);
+
+    // F_XX
+    for (unsigned int i = 1; i < 25; i++) {
+        String key = String::format("F%d", i);
+        gWindowsKeyMap.set(key, VK_F1 + i);
+    }
+}
+
+static String keyIdentifierForEvasKeyName(String& keyName)
+{
+    if (gKeyMap.isEmpty())
+        createKeyMap();
+
+    if (gKeyMap.contains(keyName))
+        return gKeyMap.get(keyName);
+
+    return keyName;
+}
+
+static int windowsKeyCodeForEvasKeyName(String& keyName)
+{
+    if (gWindowsKeyMap.isEmpty())
+        createWindowsKeyMap();
+
+    if (gWindowsKeyMap.contains(keyName))
+        return gWindowsKeyMap.get(keyName);
+
+    return 0;
+}
+
+PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Down* ev)
+    : m_type(KeyDown)
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_text(String::fromUTF8(ev->string))
+{
+    String keyName = String(ev->key);
+    m_keyIdentifier = keyIdentifierForEvasKeyName(keyName);
+    m_windowsVirtualKeyCode = windowsKeyCodeForEvasKeyName(keyName);
+
+    // FIXME:
+    m_isKeypad = false;
+    m_autoRepeat = false;
+}
+
+PlatformKeyboardEvent::PlatformKeyboardEvent(const Evas_Event_Key_Up* ev)
+    : m_type(KeyUp)
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_text(String::fromUTF8(ev->string))
+{
+    String keyName = String(ev->key);
+    m_keyIdentifier = keyIdentifierForEvasKeyName(keyName);
+    m_windowsVirtualKeyCode = windowsKeyCodeForEvasKeyName(keyName);
+
+    // FIXME:
+    m_isKeypad = false;
+    m_autoRepeat = false;
+}
+
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
+{
+    ASSERT(m_type == KeyDown);
+    m_type = type;
+
+    if (type == RawKeyDown) {
+        m_text = String();
+        m_unmodifiedText = String();
+    } else {
+        m_keyIdentifier = String();
+        m_windowsVirtualKeyCode = 0;
+    }
+}
+
+bool PlatformKeyboardEvent::currentCapsLockState()
+{
+    notImplemented();
+    return false;
+}
+
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    notImplemented();
+    shiftKey = false;
+    ctrlKey = false;
+    altKey = false;
+    metaKey = false;
+}
+
+}
diff --git a/WebCore/platform/efl/PlatformMouseEventEfl.cpp b/WebCore/platform/efl/PlatformMouseEventEfl.cpp
new file mode 100644
index 0000000..194e15a
--- /dev/null
+++ b/WebCore/platform/efl/PlatformMouseEventEfl.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2008, 2009 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "PlatformMouseEvent.h"
+
+#include <Evas.h>
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+void PlatformMouseEvent::setClickCount(Evas_Button_Flags flags)
+{
+    if (flags & EVAS_BUTTON_TRIPLE_CLICK)
+        m_clickCount = 3;
+    else if (flags & EVAS_BUTTON_DOUBLE_CLICK)
+        m_clickCount = 2;
+    else
+        m_clickCount = 1;
+}
+
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Down* ev, IntPoint pos)
+    : m_timestamp(currentTime())
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
+    , m_position(IntPoint(ev->canvas.x - pos.x(), ev->canvas.y - pos.y()))
+    , m_button(MouseButton(ev->button - 1))
+    , m_eventType(MouseEventPressed)
+{
+    setClickCount(ev->flags);
+}
+
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Up* ev, IntPoint pos)
+    : m_timestamp(currentTime())
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
+    , m_position(IntPoint(ev->canvas.x - pos.x(), ev->canvas.y - pos.y()))
+    , m_button(MouseButton(ev->button - 1))
+    , m_eventType(MouseEventReleased)
+{
+    setClickCount(ev->flags);
+}
+
+PlatformMouseEvent::PlatformMouseEvent(const Evas_Event_Mouse_Move* ev, IntPoint pos)
+    : m_timestamp(currentTime())
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_globalPosition(IntPoint(ev->cur.canvas.x, ev->cur.canvas.y))
+    , m_position(IntPoint(ev->cur.canvas.x - pos.x(), ev->cur.canvas.y - pos.y()))
+    , m_clickCount(0)
+    , m_button(MouseButton(ev->buttons - 1))
+    , m_eventType(MouseEventMoved)
+{
+}
+
+}
diff --git a/WebCore/platform/efl/PlatformScreenEfl.cpp b/WebCore/platform/efl/PlatformScreenEfl.cpp
new file mode 100644
index 0000000..c60ae95
--- /dev/null
+++ b/WebCore/platform/efl/PlatformScreenEfl.cpp
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "PlatformScreen.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "Widget.h"
+#include <wtf/text/CString.h>
+
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#include <X11/Xlib.h>
+#endif
+
+namespace WebCore {
+
+int screenDepth(Widget* widget)
+{
+    notImplemented();
+    return 8;
+}
+
+int screenDepthPerComponent(Widget*)
+{
+    notImplemented();
+    return 8;
+}
+
+bool screenIsMonochrome(Widget*)
+{
+    notImplemented();
+    return false;
+}
+
+FloatRect screenRect(Widget* widget)
+{
+    int x = 0, y = 0, w = 0, h = 0;
+
+#ifdef HAVE_ECORE_X
+    Ecore_X_Display* display = ecore_x_display_get();
+    int def = DefaultScreen(display);
+    Screen* screen = ScreenOfDisplay(display, def);
+    x = 0;
+    y = 0;
+    w = screen->width;
+    h = screen->height;
+#endif
+
+    return FloatRect(x, y, w, h);
+}
+
+FloatRect screenAvailableRect(Widget* widget)
+{
+    notImplemented();
+    return screenRect(widget);
+}
+
+}
diff --git a/WebCore/platform/efl/PlatformWheelEventEfl.cpp b/WebCore/platform/efl/PlatformWheelEventEfl.cpp
new file mode 100644
index 0000000..406844d
--- /dev/null
+++ b/WebCore/platform/efl/PlatformWheelEventEfl.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *           (C) 2006 Michael Emmel mike.emmel@gmail.com.  All rights reserved.
+ *           (C) 2008 Kenneth Rohde Christiansen.  All rights reserved.
+ *           (C) 2009 INdT - Instituto Nokia de Tecnologia.
+ *           (C) 2009-2010 ProFUSION embedded systems
+ *           (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "PlatformWheelEvent.h"
+
+#include "Scrollbar.h"
+
+namespace WebCore {
+
+enum {
+    VerticalScrollDirection = 0,
+    HorizontalScrollDirection = 1
+};
+
+PlatformWheelEvent::PlatformWheelEvent(const Evas_Event_Mouse_Wheel* ev)
+    : m_granularity(ScrollByPixelWheelEvent)
+    , m_isAccepted(false)
+    , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
+    , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
+    , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
+    , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta"))
+    , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
+    , m_position(IntPoint(ev->canvas.x, ev->canvas.y))
+{
+    // A negative z value means (in EFL) that we are scrolling down, so we need
+    // to invert the value.
+    if (ev->direction == VerticalScrollDirection) {
+        m_deltaX = 0;
+        m_deltaY = - ev->z;
+    } else if (ev->direction == HorizontalScrollDirection) {
+        m_deltaX = - ev->z;
+        m_deltaY = 0;
+    }
+
+    // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
+    m_wheelTicksX = m_deltaX;
+    m_wheelTicksY = m_deltaY;
+    m_deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+    m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+}
+
+}
diff --git a/WebCore/platform/efl/PopupMenuEfl.cpp b/WebCore/platform/efl/PopupMenuEfl.cpp
new file mode 100644
index 0000000..80096c2
--- /dev/null
+++ b/WebCore/platform/efl/PopupMenuEfl.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "PopupMenu.h"
+
+#include "FrameView.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+PopupMenu::PopupMenu(PopupMenuClient* client)
+    : m_popupClient(client)
+{
+}
+
+PopupMenu::~PopupMenu()
+{
+}
+
+void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
+{
+    ASSERT(client());
+    notImplemented();
+}
+
+void PopupMenu::hide()
+{
+    notImplemented();
+}
+
+void PopupMenu::updateFromElement()
+{
+    client()->setTextFromItem(client()->selectedIndex());
+}
+
+bool PopupMenu::itemWritingDirectionIsNatural()
+{
+    return true;
+}
+
+}
diff --git a/WebCore/platform/efl/RenderThemeEfl.cpp b/WebCore/platform/efl/RenderThemeEfl.cpp
new file mode 100644
index 0000000..85201ff
--- /dev/null
+++ b/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -0,0 +1,931 @@
+/*
+ * Copyright (C) 2007 Apple Inc.
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "RenderThemeEfl.h"
+
+#include "FileSystem.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "RenderBox.h"
+#include "RenderObject.h"
+#include <wtf/text/CString.h>
+
+#include <Edje.h>
+namespace WebCore {
+
+// TODO: change from object count to ecore_evas size (bytes)
+// TODO: as objects are webpage/user defined and they can be very large.
+#define RENDER_THEME_EFL_PART_CACHE_MAX 32
+
+void RenderThemeEfl::adjustSizeConstraints(RenderStyle* style, FormType type) const
+{
+    const struct ThemePartDesc* desc = m_partDescs + (size_t)type;
+
+    if (style->minWidth().isIntrinsicOrAuto())
+        style->setMinWidth(desc->min.width());
+    if (style->minHeight().isIntrinsicOrAuto())
+        style->setMinHeight(desc->min.height());
+
+    if (desc->max.width().value() > 0 && style->maxWidth().isIntrinsicOrAuto())
+        style->setMaxWidth(desc->max.width());
+    if (desc->max.height().value() > 0 && style->maxHeight().isIntrinsicOrAuto())
+        style->setMaxHeight(desc->max.height());
+
+    style->setPaddingTop(desc->padding.top());
+    style->setPaddingBottom(desc->padding.bottom());
+    style->setPaddingLeft(desc->padding.left());
+    style->setPaddingRight(desc->padding.right());
+}
+
+bool RenderThemeEfl::themePartCacheEntryReset(struct ThemePartCacheEntry* ce, FormType type)
+{
+    const char *file, *group;
+
+    ASSERT(ce);
+
+    edje_object_file_get(m_edje, &file, 0);
+    group = edjeGroupFromFormType(type);
+    ASSERT(file);
+    ASSERT(group);
+
+    if (!edje_object_file_set(ce->o, file, group)) {
+        int err = edje_object_load_error_get(ce->o);
+        const char *errmsg = edje_load_error_str(err);
+        EINA_LOG_ERR("Could not load '%s' from theme %s: %s",
+                     group, file, errmsg);
+        return false;
+    }
+    return true;
+}
+
+bool RenderThemeEfl::themePartCacheEntrySurfaceCreate(struct ThemePartCacheEntry* ce)
+{
+    int w, h;
+    cairo_status_t status;
+
+    ASSERT(ce);
+    ASSERT(ce->ee);
+
+    ecore_evas_geometry_get(ce->ee, 0, 0, &w, &h);
+    ASSERT(w > 0);
+    ASSERT(h > 0);
+
+    ce->surface = cairo_image_surface_create_for_data((unsigned char *)ecore_evas_buffer_pixels_get(ce->ee),
+                                                      CAIRO_FORMAT_ARGB32, w, h, w * 4);
+    status = cairo_surface_status(ce->surface);
+    if (status != CAIRO_STATUS_SUCCESS) {
+        EINA_LOG_ERR("Could not create cairo surface: %s",
+                     cairo_status_to_string(status));
+        return false;
+    }
+
+    return true;
+}
+
+// allocate a new entry and fill it with edje group
+struct RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::cacheThemePartNew(FormType type, const IntSize& size)
+{
+    struct ThemePartCacheEntry *ce = new struct ThemePartCacheEntry;
+
+    if (!ce) {
+        EINA_LOG_ERR("could not allocate ThemePartCacheEntry.");
+        return 0;
+    }
+
+    ce->ee = ecore_evas_buffer_new(size.width(), size.height());
+    if (!ce->ee) {
+        EINA_LOG_ERR("ecore_evas_buffer_new(%d, %d) failed.",
+                     size.width(), size.height());
+        delete ce;
+        return 0;
+    }
+
+    ce->o = edje_object_add(ecore_evas_get(ce->ee));
+    ASSERT(ce->o);
+    if (!themePartCacheEntryReset(ce, type)) {
+        evas_object_del(ce->o);
+        ecore_evas_free(ce->ee);
+        delete ce;
+        return 0;
+    }
+
+    if (!themePartCacheEntrySurfaceCreate(ce)) {
+        evas_object_del(ce->o);
+        ecore_evas_free(ce->ee);
+        delete ce;
+        return 0;
+    }
+
+    evas_object_resize(ce->o, size.width(), size.height());
+    evas_object_show(ce->o);
+
+    ce->type = type;
+    ce->size = size;
+
+    m_partCache.prepend(ce);
+    return ce;
+}
+
+// just change the edje group and return the same entry
+struct RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::cacheThemePartReset(FormType type, struct RenderThemeEfl::ThemePartCacheEntry* ce)
+{
+    if (!themePartCacheEntryReset(ce, type)) {
+        ce->type = FormTypeLast; // invalidate
+        m_partCache.append(ce);
+        return 0;
+    }
+    ce->type = type;
+    m_partCache.prepend(ce);
+    return ce;
+}
+
+// resize entry and reset it
+struct RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::cacheThemePartResizeAndReset(FormType type, const IntSize& size, struct RenderThemeEfl::ThemePartCacheEntry* ce)
+{
+    cairo_surface_finish(ce->surface);
+    ecore_evas_resize(ce->ee, size.width(), size.height());
+    evas_object_resize(ce->o, size.width(), size.height());
+
+    if (!themePartCacheEntrySurfaceCreate(ce)) {
+        evas_object_del(ce->o);
+        ecore_evas_free(ce->ee);
+        delete ce;
+        return 0;
+    }
+
+    return cacheThemePartReset(type, ce);
+}
+
+// general purpose get (will create, reuse and all)
+struct RenderThemeEfl::ThemePartCacheEntry* RenderThemeEfl::cacheThemePartGet(FormType type, const IntSize& size)
+{
+    Vector<struct ThemePartCacheEntry *>::iterator itr, end;
+    struct ThemePartCacheEntry *ce_last_size = 0;
+    int i, idxLastSize = -1;
+
+    itr = m_partCache.begin();
+    end = m_partCache.end();
+    for (i = 0; itr != end; i++, itr++) {
+        struct ThemePartCacheEntry *ce = *itr;
+        if (ce->size == size) {
+            if (ce->type == type)
+                return ce;
+            ce_last_size = ce;
+            idxLastSize = i;
+        }
+    }
+
+    if (m_partCache.size() < RENDER_THEME_EFL_PART_CACHE_MAX)
+        return cacheThemePartNew(type, size);
+
+    if (ce_last_size && ce_last_size != m_partCache.first()) {
+        m_partCache.remove(idxLastSize);
+        return cacheThemePartReset(type, ce_last_size);
+    }
+
+    ThemePartCacheEntry* ce = m_partCache.last();
+    m_partCache.removeLast();
+    return cacheThemePartResizeAndReset(type, size, ce);
+}
+
+void RenderThemeEfl::cacheThemePartFlush()
+{
+    Vector<struct ThemePartCacheEntry *>::iterator itr, end;
+
+    itr = m_partCache.begin();
+    end = m_partCache.end();
+    for (; itr != end; itr++) {
+        struct ThemePartCacheEntry *ce = *itr;
+        cairo_surface_finish(ce->surface);
+        evas_object_del(ce->o);
+        ecore_evas_free(ce->ee);
+        delete ce;
+    }
+    m_partCache.clear();
+}
+
+void RenderThemeEfl::applyEdjeStateFromForm(Evas_Object* o, ControlStates states)
+{
+    const char *signals[] = { // keep in sync with WebCore/platform/ThemeTypes.h
+        "hovered",
+        "pressed",
+        "focused",
+        "enabled",
+        "checked",
+        "read-only",
+        "default",
+        "window-inactive",
+        "indeterminate"
+    };
+    size_t i, last = sizeof(signals) / sizeof(signals[0]);
+
+    edje_object_signal_emit(o, "reset", "");
+
+    for (i = 0; i < last; i++) {
+        if (states & (1 << i))
+            edje_object_signal_emit(o, signals[i], "");
+    }
+}
+
+bool RenderThemeEfl::paintThemePart(RenderObject* o, FormType type, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    struct ThemePartCacheEntry* ce;
+    Eina_List* updates;
+    cairo_t* cairo;
+
+    ASSERT(m_canvas);
+    ASSERT(m_edje);
+
+    ce = cacheThemePartGet(type, rect.size());
+    ASSERT(ce);
+    if (!ce)
+        return false;
+
+    applyEdjeStateFromForm(ce->o, controlStatesForRenderer(o));
+
+    cairo = i.context->platformContext();
+    ASSERT(cairo);
+
+    edje_object_calc_force(ce->o);
+    edje_object_message_signal_process(ce->o);
+    updates = evas_render_updates(ecore_evas_get(ce->ee));
+    evas_render_updates_free(updates);
+
+    cairo_save(cairo);
+    cairo_set_source_surface(cairo, ce->surface, rect.x(), rect.y());
+    cairo_paint_with_alpha(cairo, 1.0);
+    cairo_restore(cairo);
+
+    return false;
+}
+
+PassRefPtr<RenderTheme> RenderThemeEfl::create(Page* page)
+{
+    return adoptRef(new RenderThemeEfl(page));
+}
+
+PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
+{
+    if (page)
+        return RenderThemeEfl::create(page);
+
+    static RenderTheme* fallback = RenderThemeEfl::create(0).releaseRef();
+    return fallback;
+}
+
+static void renderThemeEflColorClassSelectionActive(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setActiveSelectionColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+static void renderThemeEflColorClassSelectionInactive(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setInactiveSelectionColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+static void renderThemeEflColorClassFocusRing(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, 0, 0, 0, 0, 0, 0, 0, 0))
+        return;
+
+    that->setFocusRingColor(fr, fg, fb, fa);
+}
+
+static void renderThemeEflColorClassButtonText(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setButtonTextColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+static void renderThemeEflColorClassComboText(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setComboTextColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+static void renderThemeEflColorClassEntryText(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setEntryTextColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+static void renderThemeEflColorClassSearchText(void* data, Evas_Object* o, const char* signal, const char* source)
+{
+    RenderThemeEfl::RenderThemeEfl* that = static_cast<RenderThemeEfl::RenderThemeEfl *>(data);
+    int fr, fg, fb, fa, br, bg, bb, ba;
+    if (!edje_object_color_class_get(o, source, &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, 0, 0, 0, 0))
+        return;
+
+    that->setSearchTextColor(fr, fg, fb, fa, br, bg, bb, ba);
+}
+
+void RenderThemeEfl::createCanvas()
+{
+    ASSERT(!m_canvas);
+    m_canvas = ecore_evas_buffer_new(1, 1);
+    ASSERT(m_canvas);
+}
+
+void RenderThemeEfl::createEdje()
+{
+    ASSERT(!m_edje);
+    Frame* frame = m_page ? m_page->mainFrame() : 0;
+    FrameView* view = frame ? frame->view() : 0;
+    String theme = view ? view->edjeThemeRecursive() : "";
+    if (theme.isEmpty())
+        EINA_LOG_ERR("No theme defined, unable to set RenderThemeEfl.");
+    else {
+        m_edje = edje_object_add(ecore_evas_get(m_canvas));
+        if (!m_edje)
+            EINA_LOG_ERR("Could not create base edje object.");
+        else if (!edje_object_file_set(m_edje, theme.utf8().data(), "webkit/base")) {
+            int err = edje_object_load_error_get(m_edje);
+            const char* errmsg = edje_load_error_str(err);
+            EINA_LOG_ERR("Could not load 'webkit/base' from theme %s: %s",
+                         theme.utf8().data(), errmsg);
+            evas_object_del(m_edje);
+            m_edje = 0;
+        } else {
+#define CONNECT(cc, func)                                               \
+            edje_object_signal_callback_add(m_edje, "color_class,set",  \
+                                            "webkit/"cc, func, this)
+
+            CONNECT("selection/active",
+                    renderThemeEflColorClassSelectionActive);
+            CONNECT("selection/inactive",
+                    renderThemeEflColorClassSelectionInactive);
+            CONNECT("focus_ring", renderThemeEflColorClassFocusRing);
+            CONNECT("button/text", renderThemeEflColorClassButtonText);
+            CONNECT("combo/text", renderThemeEflColorClassComboText);
+            CONNECT("entry/text", renderThemeEflColorClassEntryText);
+            CONNECT("search/text", renderThemeEflColorClassSearchText);
+#undef CONNECT
+        }
+    }
+    ASSERT(m_edje);
+}
+
+void RenderThemeEfl::applyEdjeColors()
+{
+    int fr, fg, fb, fa, br, bg, bb, ba;
+    ASSERT(m_edje);
+#define COLOR_GET(cls)                                                  \
+    edje_object_color_class_get(m_edje, "webkit/"cls,                   \
+                                &fr, &fg, &fb, &fa, &br, &bg, &bb, &ba, \
+                                0, 0, 0, 0)
+
+    if (COLOR_GET("selection/active")) {
+        m_activeSelectionForegroundColor = Color(fr, fg, fb, fa);
+        m_activeSelectionBackgroundColor = Color(br, bg, bb, ba);
+    }
+    if (COLOR_GET("selection/inactive")) {
+        m_inactiveSelectionForegroundColor = Color(fr, fg, fb, fa);
+        m_inactiveSelectionBackgroundColor = Color(br, bg, bb, ba);
+    }
+    if (COLOR_GET("focus_ring")) {
+        m_focusRingColor = Color(fr, fg, fb, fa);
+        // webkit just use platformFocusRingColor() for default theme (without page)
+        // this is ugly, but no other way to do it unless we change
+        // it to use page themes as much as possible.
+        RenderTheme::setCustomFocusRingColor(m_focusRingColor);
+    }
+    if (COLOR_GET("button/text")) {
+        m_buttonTextForegroundColor = Color(fr, fg, fb, fa);
+        m_buttonTextBackgroundColor = Color(br, bg, bb, ba);
+    }
+    if (COLOR_GET("combo/text")) {
+        m_comboTextForegroundColor = Color(fr, fg, fb, fa);
+        m_comboTextBackgroundColor = Color(br, bg, bb, ba);
+    }
+    if (COLOR_GET("entry/text")) {
+        m_entryTextForegroundColor = Color(fr, fg, fb, fa);
+        m_entryTextBackgroundColor = Color(br, bg, bb, ba);
+    }
+    if (COLOR_GET("search/text")) {
+        m_searchTextForegroundColor = Color(fr, fg, fb, fa);
+        m_searchTextBackgroundColor = Color(br, bg, bb, ba);
+    }
+#undef COLOR_GET
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::applyPartDescriptionFallback(struct ThemePartDesc* desc)
+{
+    desc->min.setWidth(Length(0, Fixed));
+    desc->min.setHeight(Length(0, Fixed));
+
+    desc->max.setWidth(Length(0, Fixed));
+    desc->max.setHeight(Length(0, Fixed));
+
+    desc->padding = LengthBox(0, 0, 0, 0);
+}
+
+void RenderThemeEfl::applyPartDescription(Evas_Object* o, struct ThemePartDesc* desc)
+{
+    Evas_Coord minw, minh, maxw, maxh;
+
+    edje_object_size_min_get(o, &minw, &minh);
+    if (!minw && !minh)
+        edje_object_size_min_calc(o, &minw, &minh);
+
+    desc->min.setWidth(Length(minw, Fixed));
+    desc->min.setHeight(Length(minh, Fixed));
+
+    edje_object_size_max_get(o, &maxw, &maxh);
+    desc->max.setWidth(Length(maxw, Fixed));
+    desc->max.setHeight(Length(maxh, Fixed));
+
+    if (!edje_object_part_exists(o, "text_confinement"))
+        desc->padding = LengthBox(0, 0, 0, 0);
+    else {
+        Evas_Coord px, py, pw, ph;
+        Evas_Coord ox = 0, oy = 0, ow = 0, oh = 0;
+        int t, r, b, l;
+
+        if (minw > 0)
+            ow = minw;
+        else
+            ow = 100;
+        if (minh > 0)
+            oh = minh;
+        else
+            oh = 100;
+        if (maxw > 0 && ow > maxw)
+            ow = maxw;
+        if (maxh > 0 && oh > maxh)
+            oh = maxh;
+
+        evas_object_move(o, ox, oy);
+        evas_object_resize(o, ow, oh);
+        edje_object_calc_force(o);
+        edje_object_message_signal_process(o);
+        edje_object_part_geometry_get(o, "text_confinement", &px, &py, &pw, &ph);
+
+        t = py - oy;
+        b = (oh + oy) - (ph + py);
+
+        l = px - ox;
+        r = (ow + ox) - (pw + px);
+
+        desc->padding = LengthBox(t, r, b, l);
+    }
+}
+
+const char* RenderThemeEfl::edjeGroupFromFormType(FormType type) const
+{
+    static const char* groups[] = {
+#define W(n) "webkit/widget/"n
+        W("button"),
+        W("radio"),
+        W("entry"),
+        W("checkbox"),
+        W("combo"),
+        W("search/field"),
+        W("search/decoration"),
+        W("search/results_button"),
+        W("search/results_decoration"),
+        W("search/cancel_button"),
+#undef W
+        0
+    };
+    ASSERT(type >= 0);
+    ASSERT((size_t)type < sizeof(groups) / sizeof(groups[0])); // out of sync?
+    return groups[type];
+}
+
+void RenderThemeEfl::applyPartDescriptions()
+{
+    Evas_Object* o;
+    unsigned int i;
+    const char* file;
+
+    ASSERT(m_canvas);
+    ASSERT(m_edje);
+
+    edje_object_file_get(m_edje, &file, 0);
+    ASSERT(file);
+
+    o = edje_object_add(ecore_evas_get(m_canvas));
+    if (!o) {
+        EINA_LOG_ERR("Could not create Edje object.");
+        return;
+    }
+
+    for (i = 0; i < FormTypeLast; i++) {
+        FormType type = static_cast<FormType>(i);
+        const char* group = edjeGroupFromFormType(type);
+        m_partDescs[i].type = type;
+        if (!edje_object_file_set(o, file, group)) {
+            int err = edje_object_load_error_get(o);
+            const char* errmsg = edje_load_error_str(err);
+            EINA_LOG_ERR("Could not set theme group '%s' of file '%s': %s",
+                         group, file, errmsg);
+
+            applyPartDescriptionFallback(m_partDescs + i);
+        } else
+            applyPartDescription(o, m_partDescs + i);
+    }
+    evas_object_del(o);
+}
+
+void RenderThemeEfl::themeChanged()
+{
+    cacheThemePartFlush();
+
+    if (!m_canvas) {
+        createCanvas();
+        if (!m_canvas)
+            return;
+    }
+
+    if (!m_edje) {
+        createEdje();
+        if (!m_edje)
+            return;
+    }
+
+    applyEdjeColors();
+    applyPartDescriptions();
+}
+
+RenderThemeEfl::RenderThemeEfl(Page* page)
+    : RenderTheme()
+    , m_page(page)
+    , m_activeSelectionBackgroundColor(0, 0, 255)
+    , m_activeSelectionForegroundColor(255, 255, 255)
+    , m_inactiveSelectionBackgroundColor(0, 0, 128)
+    , m_inactiveSelectionForegroundColor(200, 200, 200)
+    , m_focusRingColor(32, 32, 224, 224)
+    , m_buttonTextBackgroundColor(0, 0, 0, 0)
+    , m_buttonTextForegroundColor(0, 0, 0)
+    , m_comboTextBackgroundColor(0, 0, 0, 0)
+    , m_comboTextForegroundColor(0, 0, 0)
+    , m_entryTextBackgroundColor(0, 0, 0, 0)
+    , m_entryTextForegroundColor(0, 0, 0)
+    , m_searchTextBackgroundColor(0, 0, 0, 0)
+    , m_searchTextForegroundColor(0, 0, 0)
+    , m_canvas(0)
+    , m_edje(0)
+{
+    if (page && page->mainFrame() && page->mainFrame()->view())
+        themeChanged();
+}
+
+RenderThemeEfl::~RenderThemeEfl()
+{
+    cacheThemePartFlush();
+
+    if (m_canvas) {
+        if (m_edje)
+            evas_object_del(m_edje);
+        ecore_evas_free(m_canvas);
+    }
+}
+
+void RenderThemeEfl::setActiveSelectionColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_activeSelectionForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_activeSelectionBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setInactiveSelectionColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_inactiveSelectionForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_inactiveSelectionBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setFocusRingColor(int r, int g, int b, int a)
+{
+    m_focusRingColor = Color(r, g, b, a);
+    // webkit just use platformFocusRingColor() for default theme (without page)
+    // this is ugly, but no other way to do it unless we change
+    // it to use page themes as much as possible.
+    RenderTheme::setCustomFocusRingColor(m_focusRingColor);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setButtonTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_buttonTextForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_buttonTextBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setComboTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_comboTextForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_comboTextBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setEntryTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_entryTextForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_entryTextBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+void RenderThemeEfl::setSearchTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA)
+{
+    m_searchTextForegroundColor = Color(foreR, foreG, foreB, foreA);
+    m_searchTextBackgroundColor = Color(backR, backG, backB, backA);
+    platformColorsDidChange();
+}
+
+static bool supportsFocus(ControlPart appearance)
+{
+    switch (appearance) {
+    case PushButtonPart:
+    case ButtonPart:
+    case TextFieldPart:
+    case TextAreaPart:
+    case SearchFieldPart:
+    case MenulistPart:
+    case RadioPart:
+    case CheckboxPart:
+        return true;
+    default:
+        return false;
+    }
+}
+
+bool RenderThemeEfl::supportsFocusRing(const RenderStyle* style) const
+{
+    return supportsFocus(style->appearance());
+}
+
+bool RenderThemeEfl::controlSupportsTints(const RenderObject* o) const
+{
+    return isEnabled(o);
+}
+
+int RenderThemeEfl::baselinePosition(const RenderObject* o) const
+{
+    if (!o->isBox())
+        return 0;
+
+    if (o->style()->appearance() == CheckboxPart
+    ||  o->style()->appearance() == RadioPart)
+        return toRenderBox(o)->marginTop() + toRenderBox(o)->height() - 3;
+
+    return RenderTheme::baselinePosition(o);
+}
+
+void RenderThemeEfl::adjustCheckboxStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustCheckboxStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, CheckBox);
+    style->resetBorder();
+
+    const struct ThemePartDesc *desc = m_partDescs + (size_t)CheckBox;
+    if (style->width().value() < desc->min.width().value())
+        style->setWidth(desc->min.width());
+    if (style->height().value() < desc->min.height().value())
+        style->setHeight(desc->min.height());
+}
+
+bool RenderThemeEfl::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, CheckBox, i, rect);
+}
+
+void RenderThemeEfl::adjustRadioStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustRadioStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, RadioButton);
+    style->resetBorder();
+
+    const struct ThemePartDesc *desc = m_partDescs + (size_t)RadioButton;
+    if (style->width().value() < desc->min.width().value())
+        style->setWidth(desc->min.width());
+    if (style->height().value() < desc->min.height().value())
+        style->setHeight(desc->min.height());
+}
+
+bool RenderThemeEfl::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, RadioButton, i, rect);
+}
+
+void RenderThemeEfl::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustButtonStyle(selector, style, e);
+        return;
+    }
+
+    adjustSizeConstraints(style, Button);
+
+    if (style->appearance() == PushButtonPart) {
+        style->resetBorder();
+        style->setWhiteSpace(PRE);
+        style->setHeight(Length(Auto));
+        style->setColor(m_buttonTextForegroundColor);
+        style->setBackgroundColor(m_buttonTextBackgroundColor);
+    }
+}
+
+bool RenderThemeEfl::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, Button, i, rect);
+}
+
+void RenderThemeEfl::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustMenuListStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, ComboBox);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+    style->setColor(m_comboTextForegroundColor);
+    style->setBackgroundColor(m_comboTextBackgroundColor);
+}
+
+bool RenderThemeEfl::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, ComboBox, i, rect);
+}
+
+void RenderThemeEfl::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustTextFieldStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, TextField);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+    style->setColor(m_entryTextForegroundColor);
+    style->setBackgroundColor(m_entryTextBackgroundColor);
+}
+
+bool RenderThemeEfl::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, TextField, i, rect);
+}
+
+void RenderThemeEfl::adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    adjustTextFieldStyle(selector, style, e);
+}
+
+bool RenderThemeEfl::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{
+    return paintTextField(o, i, r);
+}
+
+void RenderThemeEfl::adjustSearchFieldDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustSearchFieldDecorationStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, SearchFieldDecoration);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+}
+
+bool RenderThemeEfl::paintSearchFieldDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, SearchFieldDecoration, i, rect);
+}
+
+void RenderThemeEfl::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustSearchFieldResultsButtonStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, SearchFieldResultsButton);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+}
+
+bool RenderThemeEfl::paintSearchFieldResultsButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, SearchFieldResultsButton, i, rect);
+}
+
+void RenderThemeEfl::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustSearchFieldResultsDecorationStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, SearchFieldResultsDecoration);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+}
+
+bool RenderThemeEfl::paintSearchFieldResultsDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, SearchFieldResultsDecoration, i, rect);
+}
+
+void RenderThemeEfl::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustSearchFieldCancelButtonStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, SearchFieldCancelButton);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+}
+
+bool RenderThemeEfl::paintSearchFieldCancelButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, SearchFieldCancelButton, i, rect);
+}
+
+void RenderThemeEfl::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+    if (!m_page && e && e->document()->page()) {
+        static_cast<RenderThemeEfl::RenderThemeEfl*>(e->document()->page()->theme())->adjustSearchFieldStyle(selector, style, e);
+        return;
+    }
+    adjustSizeConstraints(style, SearchField);
+    style->resetBorder();
+    style->setWhiteSpace(PRE);
+    style->setColor(m_searchTextForegroundColor);
+    style->setBackgroundColor(m_searchTextBackgroundColor);
+}
+
+bool RenderThemeEfl::paintSearchField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
+{
+    return paintThemePart(o, SearchField, i, rect);
+}
+
+void RenderThemeEfl::systemFont(int, FontDescription&) const
+{
+    // If you remove this notImplemented(), replace it with an comment that explains why.
+    notImplemented();
+}
+
+}
diff --git a/WebCore/platform/efl/RenderThemeEfl.h b/WebCore/platform/efl/RenderThemeEfl.h
new file mode 100644
index 0000000..3ebd29d
--- /dev/null
+++ b/WebCore/platform/efl/RenderThemeEfl.h
@@ -0,0 +1,201 @@
+/*
+ * This file is part of the WebKit project.
+ *
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * All rights reserved.
+ *
+ * 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 RenderThemeEfl_h
+#define RenderThemeEfl_h
+
+#include "RenderTheme.h"
+
+#include <Ecore_Evas.h>
+#include <Evas.h>
+#include <cairo.h>
+
+namespace WebCore {
+
+enum FormType { // KEEP IN SYNC WITH edjeGroupFromFormType()
+    Button,
+    RadioButton,
+    TextField,
+    CheckBox,
+    ComboBox,
+    SearchField,
+    SearchFieldDecoration,
+    SearchFieldResultsButton,
+    SearchFieldResultsDecoration,
+    SearchFieldCancelButton,
+    FormTypeLast
+};
+
+class RenderThemeEfl : public RenderTheme {
+private:
+    RenderThemeEfl(Page*);
+    ~RenderThemeEfl();
+
+public:
+    static PassRefPtr<RenderTheme> create(Page*);
+
+    // A method asking if the theme's controls actually care about redrawing when hovered.
+    virtual bool supportsHover(const RenderStyle*) const { return true; }
+
+    // A method asking if the theme is able to draw the focus ring.
+    virtual bool supportsFocusRing(const RenderStyle*) const;
+
+    // A method asking if the control changes its tint when the window has focus or not.
+    virtual bool controlSupportsTints(const RenderObject*) const;
+
+    // A general method asking if any control tinting is supported at all.
+    virtual bool supportsControlTints() const { return true; }
+
+    // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
+    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
+    // controls that need to do this.
+    virtual int baselinePosition(const RenderObject*) const;
+
+    virtual Color platformActiveSelectionBackgroundColor() const { return m_activeSelectionBackgroundColor; }
+    virtual Color platformInactiveSelectionBackgroundColor() const { return m_inactiveSelectionBackgroundColor; }
+    virtual Color platformActiveSelectionForegroundColor() const { return m_activeSelectionForegroundColor; }
+    virtual Color platformInactiveSelectionForegroundColor() const { return m_inactiveSelectionForegroundColor; }
+    virtual Color platformFocusRingColor() const { return m_focusRingColor; }
+
+    virtual void themeChanged();
+
+    // Set platform colors and notify they changed
+    void setActiveSelectionColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+    void setInactiveSelectionColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+    void setFocusRingColor(int r, int g, int b, int a);
+
+    void setButtonTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+    void setComboTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+    void setEntryTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+    void setSearchTextColor(int foreR, int foreG, int foreB, int foreA, int backR, int backG, int backB, int backA);
+
+    void adjustSizeConstraints(RenderStyle* style, FormType type) const;
+
+
+    // System fonts.
+    virtual void systemFont(int propId, FontDescription&) const;
+
+    virtual void adjustCheckboxStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustRadioStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintSearchFieldDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+    virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+
+private:
+    void createCanvas();
+    void createEdje();
+    void applyEdjeColors();
+    void applyPartDescriptions();
+    const char* edjeGroupFromFormType(FormType type) const;
+    void applyEdjeStateFromForm(Evas_Object* o, ControlStates states);
+    bool paintThemePart(RenderObject* o, FormType type, const RenderObject::PaintInfo& i, const IntRect& rect);
+
+    Page* m_page;
+    Color m_activeSelectionBackgroundColor;
+    Color m_activeSelectionForegroundColor;
+    Color m_inactiveSelectionBackgroundColor;
+    Color m_inactiveSelectionForegroundColor;
+    Color m_focusRingColor;
+    Color m_buttonTextBackgroundColor;
+    Color m_buttonTextForegroundColor;
+    Color m_comboTextBackgroundColor;
+    Color m_comboTextForegroundColor;
+    Color m_entryTextBackgroundColor;
+    Color m_entryTextForegroundColor;
+    Color m_searchTextBackgroundColor;
+    Color m_searchTextForegroundColor;
+    Ecore_Evas* m_canvas;
+    Evas_Object* m_edje;
+
+    struct ThemePartDesc {
+        FormType type;
+        LengthSize min;
+        LengthSize max;
+        LengthBox padding;
+    };
+    void applyPartDescriptionFallback(struct ThemePartDesc* desc);
+    void applyPartDescription(Evas_Object* o, struct ThemePartDesc* desc);
+
+    struct ThemePartCacheEntry {
+        FormType type;
+        IntSize size;
+        Ecore_Evas* ee;
+        Evas_Object* o;
+        cairo_surface_t* surface;
+    };
+
+    struct ThemePartDesc m_partDescs[FormTypeLast];
+
+    // this should be small and not so frequently used,
+    // so use a vector and do linear searches
+    Vector<struct ThemePartCacheEntry *> m_partCache;
+
+    // get (use, create or replace) entry from cache
+    struct ThemePartCacheEntry* cacheThemePartGet(FormType type, const IntSize& size);
+    // flush cache, deleting all entries
+    void cacheThemePartFlush();
+
+    // internal, used by cacheThemePartGet()
+    bool themePartCacheEntryReset(struct ThemePartCacheEntry* ce, FormType type);
+    bool themePartCacheEntrySurfaceCreate(struct ThemePartCacheEntry* ce);
+    struct ThemePartCacheEntry* cacheThemePartNew(FormType type, const IntSize& size);
+    struct ThemePartCacheEntry* cacheThemePartReset(FormType type, struct ThemePartCacheEntry* ce);
+    struct ThemePartCacheEntry* cacheThemePartResizeAndReset(FormType type, const IntSize& size, struct ThemePartCacheEntry* ce);
+
+};
+}
+
+#endif // RenderThemeEfl_h
diff --git a/WebCore/platform/efl/ScrollViewEfl.cpp b/WebCore/platform/efl/ScrollViewEfl.cpp
new file mode 100644
index 0000000..6768a4a
--- /dev/null
+++ b/WebCore/platform/efl/ScrollViewEfl.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009, 2010 ProFUSION embedded systems
+ * Copyright (C) 2009, 2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "ScrollView.h"
+
+#include "FloatRect.h"
+#include "FrameView.h"
+#include "HostWindow.h"
+#include "IntRect.h"
+#include "NotImplemented.h"
+#include "ScrollbarTheme.h"
+
+#include <Ecore_Evas.h>
+#include <Evas.h>
+
+using namespace std;
+
+namespace WebCore {
+
+void ScrollView::platformInit()
+{
+}
+
+void ScrollView::platformDestroy()
+{
+}
+
+}
diff --git a/WebCore/platform/efl/ScrollbarEfl.cpp b/WebCore/platform/efl/ScrollbarEfl.cpp
new file mode 100644
index 0000000..df8580d
--- /dev/null
+++ b/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -0,0 +1,215 @@
+/*
+ *  Copyright (C) 2007 Holger Hans Peter Freyther zecke@selfish.org
+ *            (C) 2009 Kenneth Rohde Christiansen
+ *            (C) 2009 INdT, Instituto Nokia de Technologia
+ *            (C) 2009-2010 ProFUSION embedded systems
+ *            (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "ScrollbarEfl.h"
+
+#include "ChromeClient.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "HostWindow.h"
+#include "IntRect.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "ScrollbarTheme.h"
+
+#include <Ecore.h>
+#include <Edje.h>
+#include <string>
+#include <wtf/text/CString.h>
+
+using namespace std;
+using namespace WebCore;
+
+PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+{
+    return adoptRef(new ScrollbarEfl(client, orientation, size));
+}
+
+ScrollbarEfl::ScrollbarEfl(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+    : Scrollbar(client, orientation, controlSize)
+    , m_lastPos(0)
+    , m_lastTotalSize(0)
+    , m_lastVisibleSize(0)
+{
+    Widget::setFrameRect(IntRect(0, 0, 0, 0));
+}
+
+ScrollbarEfl::~ScrollbarEfl()
+{
+    if (!evasObject())
+        return;
+    evas_object_del(evasObject());
+    setEvasObject(0);
+}
+
+static void scrollbarEflEdjeMessage(void* data, Evas_Object* o, Edje_Message_Type type, int id, void* msg)
+{
+    ScrollbarEfl::ScrollbarEfl* that = static_cast<ScrollbarEfl::ScrollbarEfl*>(data);
+    Edje_Message_Float* m;
+    int v;
+
+    if (!id) {
+        EINA_LOG_ERR("Unknown message id '%d' from scroll bar theme.", id);
+        return;
+    }
+
+    if (type != EDJE_MESSAGE_FLOAT) {
+        EINA_LOG_ERR("Message id '%d' of incorrect type from scroll bar theme. "
+                     "Expected '%d', got '%d'.",
+                     id, EDJE_MESSAGE_FLOAT, type);
+        return;
+    }
+
+    m = static_cast<Edje_Message_Float*>(msg);
+    v = m->val * (that->totalSize() - that->visibleSize());
+    that->setValue(v);
+}
+
+void ScrollbarEfl::setParent(ScrollView* view)
+{
+    Evas_Object* o = evasObject();
+    Evas_Coord w, h;
+
+    Widget::setParent(view);
+
+    if (!o) {
+        if (!view)
+            return;
+
+        o = edje_object_add(view->evas());
+        if (!o) {
+            EINA_LOG_ERR("Could not create edje object for view=%p (evas=%p)",
+                         view, view->evas());
+            return;
+        }
+        edje_object_message_handler_set(o, scrollbarEflEdjeMessage, this);
+        setEvasObject(o);
+    } else if (!view) {
+        evas_object_hide(o);
+        return;
+    }
+
+    const char* group = (orientation() == HorizontalScrollbar)
+        ? "scrollbar.horizontal" : "scrollbar.vertical";
+    String theme(edjeThemeRecursive());
+
+    if (theme.isEmpty()) {
+        EINA_LOG_ERR("Could not load theme '%s': no theme path set.", group);
+        evas_object_hide(o);
+        return;
+    }
+
+    if (!edje_object_file_set(o, theme.utf8().data(), group)) {
+        int err = edje_object_load_error_get(o);
+        const char* errmsg = edje_load_error_str(err);
+        EINA_LOG_ERR("Could not load theme '%s' from file '%s': #%d '%s'",
+                     theme.utf8().data(), group, err, errmsg);
+        return;
+    }
+
+    setPlatformWidget(o);
+    evas_object_smart_member_add(o, view->evasObject());
+    evas_object_show(o);
+
+    edje_object_size_min_get(o, &w, &h);
+
+    IntRect rect = frameRect();
+    rect.setSize(IntSize(w, h));
+    setFrameRect(rect);
+}
+
+void ScrollbarEfl::updateThumbPosition()
+{
+    updateThumbPositionAndProportion();
+}
+
+void ScrollbarEfl::updateThumbProportion()
+{
+    updateThumbPositionAndProportion();
+}
+
+void ScrollbarEfl::updateThumbPositionAndProportion()
+{
+    if (!platformWidget())
+        return;
+
+    int pos = currentPos();
+    int tSize = totalSize();
+    int vSize = visibleSize();
+
+    if (m_lastPos == pos
+        && m_lastTotalSize == tSize
+        && m_lastVisibleSize == vSize)
+        return;
+
+    m_lastPos = pos;
+    m_lastTotalSize = tSize;
+    m_lastVisibleSize = vSize;
+
+    Edje_Message_Float_Set* msg = static_cast<Edje_Message_Float_Set*>
+        (alloca(sizeof(Edje_Message_Float_Set) + sizeof(float)));
+    msg->count = 2;
+
+    if (tSize - vSize > 0)
+        msg->val[0] = pos / (float)(tSize - vSize);
+    else
+        msg->val[0] = 0.0;
+
+    if (tSize > 0)
+        msg->val[1] = vSize / (float)tSize;
+    else
+        msg->val[1] = 0.0;
+
+    edje_object_message_send(platformWidget(), EDJE_MESSAGE_FLOAT_SET, 0, msg);
+}
+
+void ScrollbarEfl::setFrameRect(const IntRect& rect)
+{
+    Widget::setFrameRect(rect);
+    frameRectsChanged();
+}
+
+void ScrollbarEfl::frameRectsChanged()
+{
+    Evas_Object* o = platformWidget();
+    Evas_Coord x, y;
+
+    if (!parent() || !o)
+        return;
+
+    IntRect rect = frameRect();
+    if (parent()->isScrollViewScrollbar(this))
+        rect.setLocation(parent()->convertToContainingWindow(rect.location()));
+    else
+        rect.setLocation(parent()->contentsToWindow(rect.location()));
+
+    evas_object_geometry_get(root()->evasObject(), &x, &y, 0, 0);
+    evas_object_move(o, x + rect.x(), y + rect.y());
+    evas_object_resize(o, rect.width(), rect.height());
+}
+
+void ScrollbarEfl::paint(GraphicsContext* context, const IntRect& rect)
+{
+}
+
diff --git a/WebCore/platform/efl/ScrollbarEfl.h b/WebCore/platform/efl/ScrollbarEfl.h
new file mode 100644
index 0000000..cd85888
--- /dev/null
+++ b/WebCore/platform/efl/ScrollbarEfl.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 ScrollbarEfl_h
+#define ScrollbarEfl_h
+
+#include "Scrollbar.h"
+#include <Evas.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class ScrollbarEfl : public Scrollbar {
+public:
+    friend class Scrollbar;
+
+    virtual ~ScrollbarEfl();
+
+    virtual void setFrameRect(const IntRect&);
+
+    virtual bool handleMouseMoveEvent(const PlatformMouseEvent&) { return false; }
+    virtual bool handleMouseOutEvent(const PlatformMouseEvent&) { return false; }
+    virtual bool handleMousePressEvent(const PlatformMouseEvent&) { return false; }
+    virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&) { return false; }
+
+    virtual void frameRectsChanged();
+
+    virtual void paint(GraphicsContext* context, const IntRect& damageRect);
+
+protected:
+    ScrollbarEfl(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+
+    virtual void updateThumbPositionAndProportion();
+    virtual void updateThumbPosition();
+    virtual void updateThumbProportion();
+
+    virtual void setParent(ScrollView* view);
+
+private:
+    int m_lastPos;
+    int m_lastTotalSize;
+    int m_lastVisibleSize;
+};
+
+}
+
+#endif // ScrollbarEfl_h
diff --git a/WebCore/platform/efl/ScrollbarThemeEfl.cpp b/WebCore/platform/efl/ScrollbarThemeEfl.cpp
new file mode 100644
index 0000000..62df005
--- /dev/null
+++ b/WebCore/platform/efl/ScrollbarThemeEfl.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 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 "ScrollbarThemeEfl.h"
+
+#include "NotImplemented.h"
+#include <stdio.h>
+
+namespace WebCore {
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    static ScrollbarThemeEfl theme;
+    return &theme;
+}
+
+ScrollbarThemeEfl::~ScrollbarThemeEfl()
+{
+}
+
+int ScrollbarThemeEfl::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    return 0; // we paint on top
+}
+
+void ScrollbarThemeEfl::registerScrollbar(Scrollbar* scrollbar)
+{
+}
+
+void ScrollbarThemeEfl::unregisterScrollbar(Scrollbar* scrollbar)
+{
+}
+
+}
+
diff --git a/WebCore/platform/efl/ScrollbarThemeEfl.h b/WebCore/platform/efl/ScrollbarThemeEfl.h
new file mode 100644
index 0000000..0fe1688
--- /dev/null
+++ b/WebCore/platform/efl/ScrollbarThemeEfl.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 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 ScrollbarThemeEfl_h
+#define ScrollbarThemeEfl_h
+
+#include "ScrollbarTheme.h"
+
+namespace WebCore {
+
+class ScrollbarThemeEfl : public ScrollbarTheme {
+public:
+    virtual ~ScrollbarThemeEfl();
+
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
+
+    virtual void registerScrollbar(Scrollbar* scrollbar);
+    virtual void unregisterScrollbar(Scrollbar* scrollbar);
+};
+
+}
+#endif // ScrollbarThemeEfl_h
+
diff --git a/WebCore/platform/efl/SearchPopupMenuEfl.cpp b/WebCore/platform/efl/SearchPopupMenuEfl.cpp
new file mode 100644
index 0000000..d18174f
--- /dev/null
+++ b/WebCore/platform/efl/SearchPopupMenuEfl.cpp
@@ -0,0 +1,50 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "SearchPopupMenu.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
+    : PopupMenu(client)
+{
+    notImplemented();
+}
+
+void SearchPopupMenu::saveRecentSearches(const AtomicString&, const Vector<String>&)
+{
+    notImplemented();
+}
+
+void SearchPopupMenu::loadRecentSearches(const AtomicString&, Vector<String>&)
+{
+    notImplemented();
+}
+
+bool SearchPopupMenu::enabled()
+{
+    notImplemented();
+    return true;
+}
+
+}
diff --git a/WebCore/platform/efl/SharedBufferEfl.cpp b/WebCore/platform/efl/SharedBufferEfl.cpp
new file mode 100644
index 0000000..1025e33
--- /dev/null
+++ b/WebCore/platform/efl/SharedBufferEfl.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *               2008 Kenneth Rohde Christiansen
+ *               2009-2010 ProFUSION embedded systems
+ *               2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "SharedBuffer.h"
+
+#include <wtf/text/CString.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+namespace WebCore {
+
+PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
+{
+    FILE* file;
+    struct stat fileStat;
+    RefPtr<SharedBuffer> result;
+
+    if (filePath.isEmpty())
+        return 0;
+
+    if (!(file = fopen(filePath.utf8().data(), "rb")))
+        return 0;
+
+    if (fstat(fileno(file), &fileStat)) {
+        fclose(file);
+        return 0;
+    }
+
+    result = SharedBuffer::create();
+    result->m_buffer.resize(fileStat.st_size);
+    if (result->m_buffer.size() != fileStat.st_size) {
+        fclose(file);
+        return 0;
+    }
+
+    fread(result->m_buffer.data(), 1, fileStat.st_size, file);
+    fclose(file);
+
+    return result.release();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/efl/SharedTimerEfl.cpp b/WebCore/platform/efl/SharedTimerEfl.cpp
new file mode 100644
index 0000000..122c8c3
--- /dev/null
+++ b/WebCore/platform/efl/SharedTimerEfl.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ *           (C) 2008 Afonso Rabelo Costa Jr.
+ *           (C) 2009-2010 ProFUSION embedded systems
+ *           (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "SharedTimer.h"
+
+#include <Ecore.h>
+#include <stdio.h>
+#include <wtf/Assertions.h>
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+static Ecore_Timer *g_sharedTimer = 0;
+
+static void (*g_timerFunction)();
+
+void setSharedTimerFiredFunction(void (*func)())
+{
+    g_timerFunction = func;
+}
+
+static int timerEvent(void*)
+{
+    if (g_timerFunction)
+        g_timerFunction();
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
+void stopSharedTimer()
+{
+    if (g_sharedTimer) {
+        ecore_timer_del(g_sharedTimer);
+        g_sharedTimer = 0;
+    }
+}
+
+void setSharedTimerFireTime(double fireTime)
+{
+    double interval = fireTime - currentTime();
+
+    stopSharedTimer();
+    g_sharedTimer = ecore_timer_add(interval, timerEvent, 0);
+}
+
+}
+
diff --git a/WebCore/platform/efl/SoundEfl.cpp b/WebCore/platform/efl/SoundEfl.cpp
new file mode 100644
index 0000000..c3b1eb3
--- /dev/null
+++ b/WebCore/platform/efl/SoundEfl.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "Sound.h"
+
+#include "NotImplemented.h"
+
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#include <X11/Xlib.h>
+#endif
+
+namespace WebCore {
+
+void systemBeep()
+{
+#ifdef HAVE_ECORE_X
+    Display* display = (Display*) ecore_x_display_get();
+    XBell(display, 0);
+#endif
+}
+
+}
diff --git a/WebCore/platform/efl/SystemTimeEfl.cpp b/WebCore/platform/efl/SystemTimeEfl.cpp
new file mode 100644
index 0000000..de8c87c
--- /dev/null
+++ b/WebCore/platform/efl/SystemTimeEfl.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 INdT. All rights reserved.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "SystemTime.h"
+
+#include <Ecore.h>
+
+namespace WebCore {
+
+double currentTime()
+{
+    return ecore_time_get();
+}
+
+}
diff --git a/WebCore/platform/efl/TemporaryLinkStubs.cpp b/WebCore/platform/efl/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..24f1111
--- /dev/null
+++ b/WebCore/platform/efl/TemporaryLinkStubs.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * 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 COMPUTER, 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 "AXObjectCache.h"
+#include "Editor.h"
+#include "FTPDirectoryDocument.h"
+#include "FrameView.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "PluginView.h"
+#include "ScrollbarTheme.h"
+#include "SharedBuffer.h"
+
+#include <float.h>
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void getSupportedKeySizes(Vector<String>&)
+{
+    notImplemented();
+}
+
+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url)
+{
+    return String();
+}
+
+float userIdleTime()
+{
+    notImplemented();
+    return FLT_MAX;
+}
+
+}
+
diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp
new file mode 100644
index 0000000..168477a
--- /dev/null
+++ b/WebCore/platform/efl/WidgetEfl.cpp
@@ -0,0 +1,371 @@
+/*
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * 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 COMPUTER, 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 "Widget.h"
+
+#include "ChromeClient.h"
+#include "Cursor.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "IntRect.h"
+#include "NotImplemented.h"
+#include "Page.h"
+
+#include <Ecore.h>
+#include <Edje.h>
+#include <Evas.h>
+
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#include <Ecore_X_Cursor.h>
+#endif
+
+#include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+#ifdef HAVE_ECORE_X
+class CursorMap {
+private:
+    HashMap<String, unsigned short> m_cursorStringMap;
+
+public:
+    CursorMap();
+    unsigned int cursor(String);
+};
+
+unsigned int CursorMap::cursor(String cursorGroup)
+{
+    int ret = m_cursorStringMap.get(cursorGroup);
+
+    if (ret < ECORE_X_CURSOR_X || ret > ECORE_X_CURSOR_XTERM)
+        ret = ECORE_X_CURSOR_LEFT_PTR;
+
+    return ret;
+}
+
+CursorMap::CursorMap()
+{
+    m_cursorStringMap.set("cursor/pointer", ECORE_X_CURSOR_LEFT_PTR);
+    m_cursorStringMap.set("cursor/move", ECORE_X_CURSOR_FLEUR);
+    m_cursorStringMap.set("cursor/cross", ECORE_X_CURSOR_CROSS);
+    m_cursorStringMap.set("cursor/hand", ECORE_X_CURSOR_HAND2);
+    m_cursorStringMap.set("cursor/i_beam", ECORE_X_CURSOR_XTERM);
+    m_cursorStringMap.set("cursor/wait", ECORE_X_CURSOR_WATCH);
+    m_cursorStringMap.set("cursor/help", ECORE_X_CURSOR_QUESTION_ARROW);
+    m_cursorStringMap.set("cursor/east_resize", ECORE_X_CURSOR_RIGHT_SIDE);
+    m_cursorStringMap.set("cursor/north_resize", ECORE_X_CURSOR_TOP_SIDE);
+    m_cursorStringMap.set("cursor/north_east_resize", ECORE_X_CURSOR_TOP_RIGHT_CORNER);
+    m_cursorStringMap.set("cursor/north_west_resize", ECORE_X_CURSOR_TOP_LEFT_CORNER);
+    m_cursorStringMap.set("cursor/south_resize", ECORE_X_CURSOR_BOTTOM_SIDE);
+    m_cursorStringMap.set("cursor/south_east_resize", ECORE_X_CURSOR_BOTTOM_RIGHT_CORNER);
+    m_cursorStringMap.set("cursor/south_west_resize", ECORE_X_CURSOR_BOTTOM_LEFT_CORNER);
+    m_cursorStringMap.set("cursor/west_resize", ECORE_X_CURSOR_LEFT_SIDE);
+    m_cursorStringMap.set("cursor/north_south_resize", ECORE_X_CURSOR_SB_H_DOUBLE_ARROW);
+    m_cursorStringMap.set("cursor/east_west_resize", ECORE_X_CURSOR_SB_V_DOUBLE_ARROW);
+    m_cursorStringMap.set("cursor/north_east_south_west_resize", ECORE_X_CURSOR_SIZING);
+    m_cursorStringMap.set("cursor/north_west_south_east_resize", ECORE_X_CURSOR_SIZING);
+    m_cursorStringMap.set("cursor/column_resize", ECORE_X_CURSOR_SB_V_DOUBLE_ARROW);
+    m_cursorStringMap.set("cursor/row_resize", ECORE_X_CURSOR_SB_H_DOUBLE_ARROW);
+    m_cursorStringMap.set("cursor/middle_panning",  ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/east_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/north_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/north_east_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/north_west_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/south_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/south_east_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/south_west_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/west_panning", ECORE_X_CURSOR_CROSS_REVERSE);
+    m_cursorStringMap.set("cursor/vertical_text", ECORE_X_CURSOR_SB_DOWN_ARROW);
+    m_cursorStringMap.set("cursor/cell", ECORE_X_CURSOR_ICON);
+    m_cursorStringMap.set("cursor/context_menu", ECORE_X_CURSOR_HAND2);
+    m_cursorStringMap.set("cursor/no_drop", ECORE_X_CURSOR_DOT_BOX_MASK);
+    m_cursorStringMap.set("cursor/copy", ECORE_X_CURSOR_ICON);
+    m_cursorStringMap.set("cursor/progress", ECORE_X_CURSOR_WATCH);
+    m_cursorStringMap.set("cursor/alias", ECORE_X_CURSOR_MAN);
+    m_cursorStringMap.set("cursor/none", ECORE_X_CURSOR_X);
+    m_cursorStringMap.set("cursor/not_allowed", ECORE_X_CURSOR_X);
+    m_cursorStringMap.set("cursor/zoom_in", ECORE_X_CURSOR_DIAMOND_CROSS);
+    m_cursorStringMap.set("cursor/zoom_out", ECORE_X_CURSOR_DIAMOND_CROSS);
+    m_cursorStringMap.set("cursor/grab", ECORE_X_CURSOR_HAND2);
+    m_cursorStringMap.set("cursor/grabbing", ECORE_X_CURSOR_HAND2);
+}
+
+static CursorMap cursorStringMap = CursorMap();
+#endif
+
+class WidgetPrivate {
+public:
+    Evas* m_evas;
+    Evas_Object* m_evasObject;
+    String m_theme;
+
+    WidgetPrivate()
+        : m_evas(0)
+        , m_evasObject(0)
+        , m_cursorObject(0)
+#ifdef HAVE_ECORE_X
+        , m_isUsingEcoreX(false)
+#endif
+    {}
+
+    /* cursor */
+    String m_cursorGroup;
+    Evas_Object* m_cursorObject;
+
+#ifdef HAVE_ECORE_X
+    bool m_isUsingEcoreX;
+#endif
+};
+
+Widget::Widget(PlatformWidget widget)
+    : m_parent(0)
+    , m_widget(0)
+    , m_selfVisible(false)
+    , m_parentVisible(false)
+    , m_frame(0, 0, 0, 0)
+    , m_data(new WidgetPrivate)
+{
+    init(widget);
+}
+
+Widget::~Widget()
+{
+    ASSERT(!parent());
+
+    if (m_data->m_cursorObject)
+        evas_object_del(m_data->m_cursorObject);
+
+    delete m_data;
+}
+
+IntRect Widget::frameRect() const
+{
+    return m_frame;
+}
+
+void Widget::setFrameRect(const IntRect& rect)
+{
+    m_frame = rect;
+    Widget::frameRectsChanged();
+}
+
+void Widget::frameRectsChanged()
+{
+    Evas_Object* o = evasObject();
+    Evas_Coord x, y;
+
+    if (!parent() || !o)
+        return;
+
+    IntRect rect = frameRect();
+    if (parent()->isScrollViewScrollbar(this))
+        rect.setLocation(parent()->convertToContainingWindow(rect.location()));
+    else
+        rect.setLocation(parent()->contentsToWindow(rect.location()));
+
+    evas_object_geometry_get(root()->evasObject(), &x, &y, 0, 0);
+    evas_object_move(o, x + rect.x(), y + rect.y());
+    evas_object_resize(o, rect.width(), rect.height());
+}
+
+void Widget::setFocus()
+{
+}
+
+void Widget::applyFallbackCursor()
+{
+#if HAVE_ECORE_X
+    if (m_data->m_isUsingEcoreX && !m_data->m_cursorGroup.isNull()) {
+        int shape = cursorStringMap.cursor(m_data->m_cursorGroup.utf8().data());
+
+        if (shape < ECORE_X_CURSOR_X || shape > ECORE_X_CURSOR_XTERM) {
+            fprintf(stderr, "ERROR: cannot map an equivalent X cursor for"
+                    " cursor group %s", m_data->m_cursorGroup.utf8().data());
+            shape = ECORE_X_CURSOR_LEFT_PTR;
+        }
+
+        Ecore_X_Window win = ecore_evas_software_x11_window_get(ecoreEvas());
+        Ecore_X_Cursor cur = ecore_x_cursor_shape_get(shape);
+        ecore_x_window_cursor_set(win, cur);
+        return;
+    }
+#else
+    fprintf(stderr, "ERROR: Ooops, no fallback to set cursor %s!\n",
+            m_data->m_cursorGroup.utf8().data());
+#endif
+}
+
+void Widget::applyCursor()
+{
+    const char *file;
+    Evas_Coord x, y;
+
+    String theme = edjeThemeRecursive();
+    if (!theme.isNull())
+        file = edjeThemeRecursive().utf8().data();
+
+    m_data->m_cursorObject = edje_object_add(evas());
+    if (!edje_object_file_set(m_data->m_cursorObject, file, m_data->m_cursorGroup.utf8().data())) {
+        evas_object_del(m_data->m_cursorObject);
+        m_data->m_cursorObject = 0;
+        ecore_evas_object_cursor_set(ecoreEvas(), 0, 0, 0, 0);
+        applyFallbackCursor();
+    } else {
+        Evas_Coord w, h;
+        const char *d;
+
+        edje_object_size_min_get(m_data->m_cursorObject, &w, &h);
+        if ((w <= 0) || (h <= 0))
+            edje_object_size_min_calc(m_data->m_cursorObject, &w, &h);
+        if ((w <= 0) || (h <= 0))
+            w = h = 16;
+        evas_object_resize(m_data->m_cursorObject, w, h);
+
+        d = edje_object_data_get(m_data->m_cursorObject, "hot.x");
+        x = d ? atoi(d) : 0;
+
+        d = edje_object_data_get(m_data->m_cursorObject, "hot.y");
+        y = d ? atoi(d) : 0;
+
+        ecore_evas_object_cursor_set(ecoreEvas(), m_data->m_cursorObject,
+                                     EVAS_LAYER_MAX, x, y);
+    }
+}
+
+void Widget::setCursor(const Cursor& cursor)
+{
+    if (!platformWidget() || !evas())
+         return;
+
+    const char *group = cursor.impl();
+    if (!group || String(group) == m_data->m_cursorGroup)
+        return;
+
+    m_data->m_cursorGroup = group;
+
+    applyCursor();
+}
+
+void Widget::show()
+{
+    if (!platformWidget())
+         return;
+
+    evas_object_show(platformWidget());
+}
+
+void Widget::hide()
+{
+    if (!platformWidget())
+         return;
+
+    evas_object_hide(platformWidget());
+}
+
+void Widget::paint(GraphicsContext* context, const IntRect&)
+{
+    notImplemented();
+}
+
+void Widget::setIsSelected(bool)
+{
+    notImplemented();
+}
+
+const String Widget::edjeTheme() const
+{
+    return m_data->m_theme;
+}
+
+void Widget::setEdjeTheme(const String& themePath)
+{
+    if (m_data->m_theme == themePath)
+        return;
+
+    m_data->m_theme = themePath;
+}
+
+const String Widget::edjeThemeRecursive() const
+{
+    if (!m_data->m_theme.isNull())
+        return m_data->m_theme;
+    if (m_parent)
+        return m_parent->edjeThemeRecursive();
+
+    return String();
+}
+
+Evas* Widget::evas() const
+{
+    return m_data->m_evas;
+}
+
+Ecore_Evas* Widget::ecoreEvas() const
+{
+    // FIXME EFL: XXX assume evas was created by ecore_evas
+    return static_cast<Ecore_Evas*>(evas_data_attach_get(evas()));
+}
+
+void Widget::setEvasObject(Evas_Object *o)
+{
+    // FIXME: study platformWidget() and use it
+    // FIXME: right now platformWidget() requires implementing too much
+    if (m_data->m_evasObject == o)
+        return;
+    m_data->m_evasObject = o;
+    if (!o) {
+        m_data->m_evas = 0;
+        m_data->m_isUsingEcoreX = false;
+        return;
+    }
+
+    m_data->m_evas = evas_object_evas_get(o);
+
+#ifdef HAVE_ECORE_X
+    const char *engine = ecore_evas_engine_name_get(ecoreEvas());
+    m_data->m_isUsingEcoreX = (!strcmp(engine, "software_x11")
+                               || !strcmp(engine, "software_xcb")
+                               || !strcmp(engine, "software_16_x11")
+                               || !strncmp(engine, "xrender", sizeof("xrender") - 1));
+#endif
+
+    Widget::frameRectsChanged();
+}
+
+Evas_Object* Widget::evasObject() const
+{
+    return m_data->m_evasObject;
+}
+
+}
diff --git a/WebCore/platform/graphics/BitmapImage.cpp b/WebCore/platform/graphics/BitmapImage.cpp
index 0cd3907..e3db752 100644
--- a/WebCore/platform/graphics/BitmapImage.cpp
+++ b/WebCore/platform/graphics/BitmapImage.cpp
@@ -270,6 +270,11 @@
     if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
         return;
 
+    // If we aren't already animating, set now as the animation start time.
+    const double time = currentTime();
+    if (!m_desiredFrameStartTime)
+        m_desiredFrameStartTime = time;
+
     // Don't advance the animation to an incomplete frame.
     size_t nextFrame = (m_currentFrame + 1) % frameCount();
     if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
@@ -286,19 +291,14 @@
     // in this calculation, we make the animation appear to run at its desired
     // rate regardless of how fast it's being repainted.
     const double currentDuration = frameDurationAtIndex(m_currentFrame);
-    const double time = currentTime();
-    if (m_desiredFrameStartTime == 0) {
-        m_desiredFrameStartTime = time + currentDuration;
-    } else {
-        m_desiredFrameStartTime += currentDuration;
+    m_desiredFrameStartTime += currentDuration;
 
-        // When an animated image is more than five minutes out of date, the
-        // user probably doesn't care about resyncing and we could burn a lot of
-        // time looping through frames below.  Just reset the timings.
-        const double cAnimationResyncCutoff = 5 * 60;
-        if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
-            m_desiredFrameStartTime = time + currentDuration;
-    }
+    // When an animated image is more than five minutes out of date, the
+    // user probably doesn't care about resyncing and we could burn a lot of
+    // time looping through frames below.  Just reset the timings.
+    const double cAnimationResyncCutoff = 5 * 60;
+    if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
+        m_desiredFrameStartTime = time + currentDuration;
 
     // The image may load more slowly than it's supposed to animate, so that by
     // the time we reach the end of the first repetition, we're well behind.
@@ -311,7 +311,7 @@
     // switch tabs (and thus stop drawing the animation, which will pause it)
     // during that initial loop, then switch back later.
     if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time)
-      m_desiredFrameStartTime = time;
+        m_desiredFrameStartTime = time;
 
     if (!catchUpIfNecessary || time < m_desiredFrameStartTime) {
         // Haven't yet reached time for next frame to start; delay until then.
diff --git a/WebCore/platform/graphics/Color.h b/WebCore/platform/graphics/Color.h
index c348166..b8d19e0 100644
--- a/WebCore/platform/graphics/Color.h
+++ b/WebCore/platform/graphics/Color.h
@@ -27,7 +27,6 @@
 #define Color_h
 
 #include <wtf/FastAllocBase.h>
-#include <wtf/Platform.h>
 
 #if PLATFORM(CG)
 typedef struct CGColor* CGColorRef;
diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h
index bf568d4..7443e97 100644
--- a/WebCore/platform/graphics/FloatPoint.h
+++ b/WebCore/platform/graphics/FloatPoint.h
@@ -30,7 +30,6 @@
 #include "FloatSize.h"
 #include "IntPoint.h"
 #include <wtf/MathExtras.h>
-#include <wtf/Platform.h>
 
 #if PLATFORM(CG)
 typedef struct CGPoint CGPoint;
@@ -71,6 +70,9 @@
     FloatPoint(float x, float y) : m_x(x), m_y(y) { }
     FloatPoint(const IntPoint&);
 
+
+    static FloatPoint zero() { return FloatPoint(); }
+
     static FloatPoint narrowPrecision(double x, double y);
 
     float x() const { return m_x; }
diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h
index b265121..4c3a382 100644
--- a/WebCore/platform/graphics/FloatRect.h
+++ b/WebCore/platform/graphics/FloatRect.h
@@ -29,6 +29,10 @@
 
 #include "FloatPoint.h"
 
+#if PLATFORM(EFL)
+#include <Evas.h>
+#endif
+
 #if PLATFORM(CG)
 typedef struct CGRect CGRect;
 #endif
@@ -145,6 +149,11 @@
     operator QRectF() const;
 #endif
 
+#if PLATFORM(EFL)
+    explicit FloatRect(const Eina_Rectangle&);
+    operator Eina_Rectangle() const;
+#endif
+
 #if PLATFORM(WX) && USE(WXGC)
     FloatRect(const wxRect2DDouble&);
     operator wxRect2DDouble() const;
diff --git a/WebCore/platform/graphics/FloatSize.h b/WebCore/platform/graphics/FloatSize.h
index a3233d1..97ee00d 100644
--- a/WebCore/platform/graphics/FloatSize.h
+++ b/WebCore/platform/graphics/FloatSize.h
@@ -30,7 +30,6 @@
 
 #include "IntSize.h"
 #include <wtf/MathExtras.h>
-#include <wtf/Platform.h>
 
 #if PLATFORM(CG)
 typedef struct CGSize CGSize;
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index 7d0e5a9..7bdefba 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -182,7 +182,7 @@
     return drawComplexText(context, run, point, from, to);
 }
 
-float Font::floatWidth(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidth(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
 #if ENABLE(SVG_FONTS)
     if (primaryFont()->isSVGFont())
@@ -198,7 +198,7 @@
     }
 #endif
 
-    return floatWidthForComplexText(run, fallbackFonts);
+    return floatWidthForComplexText(run, fallbackFonts, glyphOverflow);
 }
 
 float Font::floatWidth(const TextRun& run, int extraCharsAvailable, int& charsConsumed, String& glyphName) const
@@ -267,12 +267,13 @@
 
 String Font::normalizeSpaces(const String& string)
 {
+    const UChar* characters = string.characters();
     unsigned length = string.length();
     Vector<UChar, 256> buffer(length);
     bool didReplacement = false;
 
     for (unsigned i = 0; i < length; ++i) {
-        UChar originalCharacter = string[i];
+        UChar originalCharacter = characters[i];
         buffer[i] = normalizeSpaces(originalCharacter);
         if (buffer[i] != originalCharacter)
             didReplacement = true;
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index 3c07be7..62525b0 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -56,6 +56,21 @@
 
 const unsigned defaultUnitsPerEm = 1000;
 
+struct GlyphOverflow {
+    GlyphOverflow()
+        : left(0)
+        , right(0)
+        , top(0)
+        , bottom(0)
+    {
+    }
+
+    int left;
+    int right;
+    int top;
+    int bottom;
+};
+
 class Font {
 public:
     Font();
@@ -81,8 +96,8 @@
 
     void drawText(GraphicsContext*, const TextRun&, const FloatPoint&, int from = 0, int to = -1) const;
 
-    int width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts = 0) const { return lroundf(floatWidth(run, fallbackFonts)); }
-    float floatWidth(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0) const;
+    int width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* glyphOverflow = 0) const { return lroundf(floatWidth(run, fallbackFonts, glyphOverflow)); }
+    float floatWidth(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* glyphOverflow = 0) const;
     float floatWidth(const TextRun& run, int extraCharsAvailable, int& charsConsumed, String& glyphName) const;
 
     int offsetForPosition(const TextRun&, int position, bool includePartialGlyphs) const;
@@ -159,7 +174,7 @@
 #endif
 
     void drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
-    float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0) const;
+    float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
     int offsetForPositionForComplexText(const TextRun&, int position, bool includePartialGlyphs) const;
     FloatRect selectionRectForComplexText(const TextRun&, const IntPoint&, int h, int from, int to) const;
 
diff --git a/WebCore/platform/graphics/FontFastPath.cpp b/WebCore/platform/graphics/FontFastPath.cpp
index 428e85e..6e2a744 100644
--- a/WebCore/platform/graphics/FontFastPath.cpp
+++ b/WebCore/platform/graphics/FontFastPath.cpp
@@ -24,17 +24,17 @@
 #include "Font.h"
 
 #include "CharacterNames.h"
+#include "FloatRect.h"
 #include "FontCache.h"
 #include "FontFallbackList.h"
-#include "FloatRect.h"
 #include "GlyphBuffer.h"
 #include "GlyphPageTreeNode.h"
 #include "IntPoint.h"
 #include "SimpleFontData.h"
 #include "WidthIterator.h"
 
-#include <wtf/unicode/Unicode.h>
 #include <wtf/MathExtras.h>
+#include <wtf/unicode/Unicode.h>
 
 using namespace WTF;
 using namespace Unicode;
@@ -234,6 +234,13 @@
         if (c <= 0x194F)
             return false;
 
+        // FIXME: we should not use complex text path for these characters.
+        
+        if (c < 0x1E00)     // U+1E00 through U+2000 characters with diacritics and stacked diacritics
+            continue;
+        if (c <= 0x2000)
+            return false;
+
         if (c < 0x20D0)     // U+20D0 through U+20FF Combining marks for symbols
             continue;
         if (c <= 0x20FF)
diff --git a/WebCore/platform/graphics/GlyphMetricsMap.cpp b/WebCore/platform/graphics/GlyphMetricsMap.cpp
new file mode 100644
index 0000000..d3c3180
--- /dev/null
+++ b/WebCore/platform/graphics/GlyphMetricsMap.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2006, 2009 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "GlyphMetricsMap.h"
+
+namespace WebCore {
+
+GlyphMetricsMap::GlyphMetricsPage* GlyphMetricsMap::locatePageSlowCase(unsigned pageNumber)
+{
+    GlyphMetricsPage* page;
+    if (!pageNumber) {
+        ASSERT(!m_filledPrimaryPage);
+        page = &m_primaryPage;
+        m_filledPrimaryPage = true;
+    } else {
+        if (m_pages) {
+            if ((page = m_pages->get(pageNumber)))
+                return page;
+        } else
+            m_pages.set(new HashMap<int, GlyphMetricsPage*>);
+        page = new GlyphMetricsPage;
+        m_pages->set(pageNumber, page);
+    }
+
+    GlyphMetrics unknownMetrics;
+    unknownMetrics.horizontalAdvance = cGlyphSizeUnknown;
+    unknownMetrics.boundingBox.setWidth(cGlyphSizeUnknown);
+    unknownMetrics.boundingBox.setHeight(cGlyphSizeUnknown);
+    // Fill in the whole page with the unknown glyph information.
+    for (unsigned i = 0; i < GlyphMetricsPage::size; i++)
+        page->setMetricsForIndex(i, unknownMetrics);
+
+    return page;
+}
+
+}
diff --git a/WebCore/platform/graphics/GlyphMetricsMap.h b/WebCore/platform/graphics/GlyphMetricsMap.h
new file mode 100644
index 0000000..49854be
--- /dev/null
+++ b/WebCore/platform/graphics/GlyphMetricsMap.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2006, 2009 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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 GlyphMetricsMap_h
+#define GlyphMetricsMap_h
+
+#include "FloatRect.h"
+#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/unicode/Unicode.h>
+
+namespace WebCore {
+
+typedef unsigned short Glyph;
+
+const float cGlyphSizeUnknown = -1;
+
+struct GlyphMetrics {
+    float horizontalAdvance;
+    FloatRect boundingBox;
+};
+
+class GlyphMetricsMap : public Noncopyable {
+public:
+    GlyphMetricsMap() : m_filledPrimaryPage(false) { }
+    ~GlyphMetricsMap()
+    { 
+        if (m_pages)
+            deleteAllValues(*m_pages);
+    }
+
+    GlyphMetrics metricsForGlyph(Glyph glyph)
+    {
+        return locatePage(glyph / GlyphMetricsPage::size)->metricsForGlyph(glyph);
+    }
+
+    float widthForGlyph(Glyph glyph)
+    {
+        return locatePage(glyph / GlyphMetricsPage::size)->metricsForGlyph(glyph).horizontalAdvance;
+    }
+
+    void setMetricsForGlyph(Glyph glyph, const GlyphMetrics& metrics)
+    {
+        locatePage(glyph / GlyphMetricsPage::size)->setMetricsForGlyph(glyph, metrics);
+    }
+
+private:
+    struct GlyphMetricsPage {
+        static const size_t size = 256; // Usually covers Latin-1 in a single page.
+        GlyphMetrics m_metrics[size];
+
+        GlyphMetrics metricsForGlyph(Glyph glyph) const { return m_metrics[glyph % size]; }
+        void setMetricsForGlyph(Glyph glyph, const GlyphMetrics& metrics)
+        {
+            setMetricsForIndex(glyph % size, metrics);
+        }
+        void setMetricsForIndex(unsigned index, const GlyphMetrics& metrics)
+        {
+            m_metrics[index] = metrics;
+        }
+    };
+    
+    GlyphMetricsPage* locatePage(unsigned pageNumber)
+    {
+        if (!pageNumber && m_filledPrimaryPage)
+            return &m_primaryPage;
+        return locatePageSlowCase(pageNumber);
+    }
+
+    GlyphMetricsPage* locatePageSlowCase(unsigned pageNumber);
+    
+    bool m_filledPrimaryPage;
+    GlyphMetricsPage m_primaryPage; // We optimize for the page that contains glyph indices 0-255.
+    OwnPtr<HashMap<int, GlyphMetricsPage*> > m_pages;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/platform/graphics/GlyphPageTreeNode.cpp b/WebCore/platform/graphics/GlyphPageTreeNode.cpp
index 9f53f0b..59a5efb 100644
--- a/WebCore/platform/graphics/GlyphPageTreeNode.cpp
+++ b/WebCore/platform/graphics/GlyphPageTreeNode.cpp
@@ -29,10 +29,12 @@
 #include "config.h"
 #include "GlyphPageTreeNode.h"
 
-#include "CString.h"
 #include "CharacterNames.h"
+#include "PlatformString.h"
 #include "SegmentedFontData.h"
 #include "SimpleFontData.h"
+#include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/unicode/Unicode.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/graphics/GlyphWidthMap.cpp b/WebCore/platform/graphics/GlyphWidthMap.cpp
deleted file mode 100644
index 43cab65..0000000
--- a/WebCore/platform/graphics/GlyphWidthMap.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2006, 2009 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "GlyphWidthMap.h"
-
-namespace WebCore {
-
-GlyphWidthMap::GlyphWidthPage* GlyphWidthMap::locatePageSlowCase(unsigned pageNumber)
-{
-    GlyphWidthPage* page;
-    if (pageNumber == 0) {
-        ASSERT(!m_filledPrimaryPage);
-        page = &m_primaryPage;
-        m_filledPrimaryPage = true;
-    } else {
-        if (m_pages) {
-            if ((page = m_pages->get(pageNumber)))
-                return page;
-        } else
-            m_pages.set(new HashMap<int, GlyphWidthPage*>);
-        page = new GlyphWidthPage;
-        m_pages->set(pageNumber, page);
-    }
-
-    // Fill in the whole page with the unknown glyph width value.
-    for (unsigned i = 0; i < GlyphWidthPage::size; i++)
-        page->setWidthForIndex(i, cGlyphWidthUnknown);
-
-    return page;
-}
-
-}
diff --git a/WebCore/platform/graphics/GlyphWidthMap.h b/WebCore/platform/graphics/GlyphWidthMap.h
deleted file mode 100644
index 66dea1f..0000000
--- a/WebCore/platform/graphics/GlyphWidthMap.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2006, 2009 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 GlyphWidthMap_h
-#define GlyphWidthMap_h
-
-#include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/unicode/Unicode.h>
-
-namespace WebCore {
-
-typedef unsigned short Glyph;
-
-const float cGlyphWidthUnknown = -1;
-
-class GlyphWidthMap : public Noncopyable {
-public:
-    GlyphWidthMap() : m_filledPrimaryPage(false) { }
-    ~GlyphWidthMap() { if (m_pages) { deleteAllValues(*m_pages); } }
-
-    float widthForGlyph(Glyph glyph)
-    {
-        return locatePage(glyph / GlyphWidthPage::size)->widthForGlyph(glyph);
-    }
-
-    void setWidthForGlyph(Glyph glyph, float width)
-    {
-        locatePage(glyph / GlyphWidthPage::size)->setWidthForGlyph(glyph, width);
-    }
-
-private:
-    struct GlyphWidthPage {
-        static const size_t size = 256; // Usually covers Latin-1 in a single page.
-        float m_widths[size];
-
-        float widthForGlyph(Glyph glyph) const { return m_widths[glyph % size]; }
-        void setWidthForGlyph(Glyph glyph, float width)
-        {
-            setWidthForIndex(glyph % size, width);
-        }
-        void setWidthForIndex(unsigned index, float width)
-        {
-            m_widths[index] = width;
-        }
-    };
-    
-    GlyphWidthPage* locatePage(unsigned pageNumber)
-    {
-        if (!pageNumber && m_filledPrimaryPage)
-            return &m_primaryPage;
-        return locatePageSlowCase(pageNumber);
-    }
-
-    GlyphWidthPage* locatePageSlowCase(unsigned pageNumber);
-    
-    bool m_filledPrimaryPage;
-    GlyphWidthPage m_primaryPage; // We optimize for the page that contains glyph indices 0-255.
-    OwnPtr<HashMap<int, GlyphWidthPage*> > m_pages;
-};
-
-}
-
-#endif
diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h
index 0efd3bf..371cad7 100644
--- a/WebCore/platform/graphics/Gradient.h
+++ b/WebCore/platform/graphics/Gradient.h
@@ -63,7 +63,13 @@
 class SkShader;
 typedef class SkShader* PlatformGradient;
 typedef class SkShader* PlatformPattern;
+<<<<<<< HEAD
 #endif
+=======
+#elif PLATFORM(HAIKU)
+class BGradient;
+typedef BGradient* PlatformGradient;
+>>>>>>> webkit.org at r58033
 #else
 typedef void* PlatformGradient;
 #endif
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 45b516a..caa0a7c 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -35,7 +35,7 @@
 #include "Path.h"
 #include "TextDirection.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/Platform.h>
+#include <wtf/PassOwnPtr.h>
 
 #if PLATFORM(CG)
 typedef struct CGContext PlatformGraphicsContext;
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 3eb9818..97465e2 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -31,6 +31,7 @@
 #include "GraphicsContext3D.h"
 
 #include "Image.h"
+#include "ImageData.h"
 
 namespace WebCore {
 
@@ -57,6 +58,28 @@
     return true;
 }
 
+bool GraphicsContext3D::extractImageData(ImageData* imageData,
+                                         bool flipY,
+                                         bool premultiplyAlpha,
+                                         Vector<uint8_t>& data)
+{
+    if (!imageData)
+        return false;
+    int width = imageData->width();
+    int height = imageData->height();
+    int dataBytes = width * height * 4;
+    data.resize(dataBytes);
+    uint8_t* dst = data.data();
+    uint8_t* src = imageData->data()->data()->data();
+    memcpy(dst, src, dataBytes);
+    processImageData(dst,
+                     width,
+                     height,
+                     flipY,
+                     premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing);
+    return true;
+}
+
 void GraphicsContext3D::processImageData(uint8_t* imageData,
                                          unsigned width,
                                          unsigned height,
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index 0a41dc6..45f6f06 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -33,7 +33,7 @@
 #include <wtf/PassOwnPtr.h>
 
 // FIXME: Find a better way to avoid the name confliction for NO_ERROR.
-#if ((PLATFORM(CHROMIUM) && OS(WINDOWS)) || PLATFORM(WIN))
+#if ((PLATFORM(CHROMIUM) && OS(WINDOWS)) || PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS)))
 #undef NO_ERROR
 #endif
 
@@ -44,6 +44,13 @@
 const  PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
 typedef GLuint Platform3DObject;
 const Platform3DObject NullPlatform3DObject = 0;
+#elif PLATFORM(QT)
+#include <QtOpenGL/QtOpenGL>
+
+typedef void* PlatformGraphicsContext3D;
+const  PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
+typedef int Platform3DObject;
+const Platform3DObject NullPlatform3DObject = 0;
 #else
 typedef void* PlatformGraphicsContext3D;
 const  PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
@@ -65,6 +72,8 @@
     class WebGLShader;
     class WebGLTexture;
     class Image;
+    class ImageData;
+    class HostWindow;
 
     struct ActiveInfo {
         String name;
@@ -73,7 +82,7 @@
     };
 
     // FIXME: ideally this would be used on all platforms.
-#if PLATFORM(CHROMIUM)
+#if PLATFORM(CHROMIUM) || PLATFORM(QT)
     class GraphicsContext3DInternal;
 #endif
 
@@ -354,6 +363,7 @@
             DEPTH_COMPONENT16 = 0x81A5,
             STENCIL_INDEX = 0x1901,
             STENCIL_INDEX8 = 0x8D48,
+            DEPTH_STENCIL = 0x84F9,
             RENDERBUFFER_WIDTH = 0x8D42,
             RENDERBUFFER_HEIGHT = 0x8D43,
             RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
@@ -370,6 +380,7 @@
             COLOR_ATTACHMENT0 = 0x8CE0,
             DEPTH_ATTACHMENT = 0x8D00,
             STENCIL_ATTACHMENT = 0x8D20,
+            DEPTH_STENCIL_ATTACHMENT = 0x821A,
             NONE = 0,
             FRAMEBUFFER_COMPLETE = 0x8CD5,
             FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6,
@@ -400,7 +411,7 @@
             bool premultipliedAlpha;
         };
 
-        static PassOwnPtr<GraphicsContext3D> create(Attributes attrs);
+        static PassOwnPtr<GraphicsContext3D> create(Attributes attrs, HostWindow* hostWindow);
         virtual ~GraphicsContext3D();
 
 #if PLATFORM(MAC)
@@ -409,12 +420,20 @@
 #elif PLATFORM(CHROMIUM)
         PlatformGraphicsContext3D platformGraphicsContext3D() const;
         Platform3DObject platformTexture() const;
+#elif PLATFORM(QT)
+        PlatformGraphicsContext3D platformGraphicsContext3D();
+        Platform3DObject platformTexture() const;
 #else
         PlatformGraphicsContext3D platformGraphicsContext3D() const { return NullPlatformGraphicsContext3D; }
         Platform3DObject platformTexture() const { return NullPlatform3DObject; }
 #endif
         void makeContextCurrent();
-        
+
+#if PLATFORM(MAC)
+        // With multisampling on, blit from multisampleFBO to regular FBO.
+        void prepareTexture();
+#endif
+
         // Helper to return the size in bytes of OpenGL data types
         // like GL_FLOAT, GL_INT, etc.
         int sizeInBytes(int type);
@@ -435,6 +454,14 @@
                               unsigned int* format,
                               unsigned int* internalFormat);
 
+        // Extracts the contents of the given ImageData into the passed
+        // Vector, obeying the flipY and premultiplyAlpha flags.
+        // Returns true upon success.
+        bool extractImageData(ImageData*,
+                              bool flipY,
+                              bool premultiplyAlpha,
+                              Vector<uint8_t>& data);
+
         // Processes the given image data in preparation for uploading
         // via texImage2D or texSubImage2D. The input data must be in
         // 4-component format with the alpha channel last (i.e., RGBA
@@ -566,7 +593,7 @@
         void pixelStorei(unsigned long pname, long param);
         void polygonOffset(double factor, double units);
         
-        PassRefPtr<WebGLArray> readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type);
+        void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
         
         void releaseShaderCompiler();
         void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
@@ -659,7 +686,7 @@
         void synthesizeGLError(unsigned long error);
 
     private:        
-        GraphicsContext3D(Attributes attrs);
+        GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
 
         // Helpers for texture uploading.
         void premultiplyAlpha(unsigned char* rgbaData, int numPixels);
@@ -689,6 +716,14 @@
                           AlphaOp* neededAlphaOp,
                           unsigned int* format);
 
+#if PLATFORM(MAC)
+        // Take into account the user's requested context creation attributes,
+        // in particular stencil and antialias, and determine which could or
+        // could not be honored based on the capabilities of the OpenGL
+        // implementation.
+        void validateAttributes();
+#endif
+
         int m_currentWidth, m_currentHeight;
         
 #if PLATFORM(MAC)
@@ -698,13 +733,22 @@
         CGLContextObj m_contextObj;
         GLuint m_texture;
         GLuint m_fbo;
-        GLuint m_depthBuffer;
+        GLuint m_depthStencilBuffer;
+
+        // For tracking which FBO is bound
+        GLuint m_boundFBO;
+
+        // For multisampling
+        GLuint m_multisampleFBO;
+        GLuint m_multisampleDepthStencilBuffer;
+        GLuint m_multisampleColorBuffer;
+
         // Errors raised by synthesizeGLError().
         ListHashSet<unsigned long> m_syntheticErrors;
 #endif        
 
         // FIXME: ideally this would be used on all platforms.
-#if PLATFORM(CHROMIUM)
+#if PLATFORM(CHROMIUM) || PLATFORM(QT)
         friend class GraphicsContext3DInternal;
         OwnPtr<GraphicsContext3DInternal> m_internal;
 #endif
diff --git a/WebCore/platform/graphics/GraphicsLayer.cpp b/WebCore/platform/graphics/GraphicsLayer.cpp
index 2336d0b..b7567bf 100644
--- a/WebCore/platform/graphics/GraphicsLayer.cpp
+++ b/WebCore/platform/graphics/GraphicsLayer.cpp
@@ -32,6 +32,11 @@
 #include "FloatPoint.h"
 #include "RotateTransformOperation.h"
 #include "TextStream.h"
+#include <wtf/text/CString.h>
+
+#ifndef NDEBUG
+#include <stdio.h>
+#endif
 
 namespace WebCore {
 
@@ -388,17 +393,23 @@
         ts << "  ";
 }
 
-void GraphicsLayer::dumpLayer(TextStream& ts, int indent) const
+void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
 {
     writeIndent(ts, indent);
-    ts << "(" << "GraphicsLayer" << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
-    ts << " \"" << m_name << "\"\n";
-    dumpProperties(ts, indent);
+    ts << "(" << "GraphicsLayer";
+
+    if (behavior & LayerTreeAsTextDebug) {
+        ts << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
+        ts << " \"" << m_name << "\"";
+    }
+
+    ts << "\n";
+    dumpProperties(ts, indent, behavior);
     writeIndent(ts, indent);
     ts << ")\n";
 }
 
-void GraphicsLayer::dumpProperties(TextStream& ts, int indent) const
+void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
 {
     writeIndent(ts, indent + 1);
     ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
@@ -416,21 +427,23 @@
     ts << "(usingTiledLayer " << m_usingTiledLayer << ")\n";
 
     writeIndent(ts, indent + 1);
-    ts << "(m_preserves3D " << m_preserves3D << ")\n";
+    ts << "(preserves3D " << m_preserves3D << ")\n";
 
     writeIndent(ts, indent + 1);
     ts << "(drawsContent " << m_drawsContent << ")\n";
 
     writeIndent(ts, indent + 1);
-    ts << "(m_backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
+    ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
 
-    writeIndent(ts, indent + 1);
-    ts << "(client ";
-    if (m_client)
-        ts << static_cast<void*>(m_client);
-    else
-        ts << "none";
-    ts << ")\n";
+    if (behavior & LayerTreeAsTextDebug) {
+        writeIndent(ts, indent + 1);
+        ts << "(";
+        if (m_client)
+            ts << "client " << static_cast<void*>(m_client);
+        else
+            ts << "no client";
+        ts << ")\n";
+    }
 
     writeIndent(ts, indent + 1);
     ts << "(backgroundColor ";
@@ -466,13 +479,19 @@
 
     if (m_replicaLayer) {
         writeIndent(ts, indent + 1);
-        ts << "(replica layer " << m_replicaLayer << ")\n";
-        m_replicaLayer->dumpLayer(ts, indent+2);
+        ts << "(replica layer";
+        if (behavior & LayerTreeAsTextDebug)
+            ts << " " << m_replicaLayer;
+        ts << ")\n";
+        m_replicaLayer->dumpLayer(ts, indent + 2, behavior);
     }
 
     if (m_replicatedLayer) {
         writeIndent(ts, indent + 1);
-        ts << "(replicated layer " << m_replicatedLayer << ")\n";
+        ts << "(replicated layer";
+        if (behavior & LayerTreeAsTextDebug)
+            ts << " " << m_replicatedLayer;;
+        ts << ")\n";
     }
     
     if (m_children.size()) {
@@ -481,12 +500,31 @@
         
         unsigned i;
         for (i = 0; i < m_children.size(); i++)
-            m_children[i]->dumpLayer(ts, indent+2);
+            m_children[i]->dumpLayer(ts, indent + 2, behavior);
         writeIndent(ts, indent + 1);
         ts << ")\n";
     }
 }
 
+String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
+{
+    TextStream ts;
+
+    dumpLayer(ts, 0, behavior);
+    return ts.release();
+}
+
 } // namespace WebCore
 
+#ifndef NDEBUG
+void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
+{
+    if (!layer)
+        return;
+
+    WebCore::String output = layer->layerTreeAsText(LayerTreeAsTextDebug);
+    fprintf(stderr, "%s\n", output.utf8().data());
+}
+#endif
+
 #endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index a097620..340b911 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -60,14 +60,28 @@
 typedef void* NativeLayer;
 }
 #elif PLATFORM(QT)
+QT_BEGIN_NAMESPACE
 class QGraphicsItem;
+QT_END_NAMESPACE
 typedef QGraphicsItem PlatformLayer;
 typedef QGraphicsItem* NativeLayer;
+#elif PLATFORM(CHROMIUM)
+namespace WebCore {
+class LayerChromium;
+typedef LayerChromium PlatformLayer;
+typedef void* NativeLayer;
+}
 #else
 typedef void* PlatformLayer;
 typedef void* NativeLayer;
 #endif
 
+enum LayerTreeAsTextBehaviorFlags {
+    LayerTreeAsTextBehaviorNormal = 0,
+    LayerTreeAsTextDebug = 1 << 0, // Dump extra debugging info like layer addresses.
+};
+typedef unsigned LayerTreeAsTextBehavior;
+
 namespace WebCore {
 
 class FloatPoint3D;
@@ -298,7 +312,7 @@
     
     virtual PlatformLayer* platformLayer() const { return 0; }
     
-    void dumpLayer(TextStream&, int indent = 0) const;
+    void dumpLayer(TextStream&, int indent = 0, LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
 
     int repaintCount() const { return m_repaintCount; }
     int incrementRepaintCount() { return ++m_repaintCount; }
@@ -333,6 +347,10 @@
     // Some compositing systems may do internal batching to synchronize compositing updates
     // with updates drawn into the window. This is a signal to flush any internal batched state.
     virtual void syncCompositingState() { }
+    
+    // Return a string with a human readable form of the layer tree, If debug is true 
+    // pointers for the layers and timing data will be included in the returned string.
+    String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const;
 
 protected:
 
@@ -349,7 +367,7 @@
 
     GraphicsLayer(GraphicsLayerClient*);
 
-    void dumpProperties(TextStream&, int indent) const;
+    void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const;
 
     GraphicsLayerClient* m_client;
     String m_name;
@@ -398,6 +416,11 @@
 
 } // namespace WebCore
 
+#ifndef NDEBUG
+// Outside the WebCore namespace for ease of invocation from gdb.
+void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
+#endif
+
 #endif // USE(ACCELERATED_COMPOSITING)
 
 #endif // GraphicsLayer_h
diff --git a/WebCore/platform/graphics/Icon.h b/WebCore/platform/graphics/Icon.h
index e9f2dc7..59c732f 100644
--- a/WebCore/platform/graphics/Icon.h
+++ b/WebCore/platform/graphics/Icon.h
@@ -39,6 +39,8 @@
 #include <QIcon>
 #elif PLATFORM(GTK)
 typedef struct _GdkPixbuf GdkPixbuf;
+#elif PLATFORM(EFL)
+#include <Evas.h>
 #elif PLATFORM(CHROMIUM)
 #include "PlatformIcon.h"
 #endif
@@ -51,8 +53,6 @@
     
 class Icon : public RefCounted<Icon> {
 public:
-    // Deprecated.  This function will be removed.
-    // FIXME: Remove it when all implementations are moved to ChromeClient::iconForFiles().
     static PassRefPtr<Icon> createIconForFiles(const Vector<String>& filenames);
 
     ~Icon();
@@ -76,6 +76,9 @@
 #elif PLATFORM(GTK)
     Icon();
     GdkPixbuf* m_icon;
+#elif PLATFORM(EFL)
+    Icon();
+    Evas_Object* m_icon;
 #elif PLATFORM(CHROMIUM)
     Icon(const PlatformIcon&);
     PlatformIcon m_icon;
diff --git a/WebCore/platform/graphics/Image.cpp b/WebCore/platform/graphics/Image.cpp
index 8263faa..6f2311c 100644
--- a/WebCore/platform/graphics/Image.cpp
+++ b/WebCore/platform/graphics/Image.cpp
@@ -32,9 +32,9 @@
 #include "GraphicsContext.h"
 #include "IntRect.h"
 #include "MIMETypeRegistry.h"
-#include <wtf/StdLibExtras.h>
-
+#include "SharedBuffer.h"
 #include <math.h>
+#include <wtf/StdLibExtras.h>
 
 #if PLATFORM(CG)
 #include <CoreFoundation/CoreFoundation.h>
@@ -53,6 +53,7 @@
 
 Image* Image::nullImage()
 {
+    ASSERT(isMainThread());
     DEFINE_STATIC_LOCAL(RefPtr<Image>, nullImage, (BitmapImage::create()));;
     return nullImage.get();
 }
diff --git a/WebCore/platform/graphics/Image.h b/WebCore/platform/graphics/Image.h
index b786106..212175c 100644
--- a/WebCore/platform/graphics/Image.h
+++ b/WebCore/platform/graphics/Image.h
@@ -32,8 +32,9 @@
 #include "GraphicsTypes.h"
 #include "ImageSource.h"
 #include "IntRect.h"
-#include "SharedBuffer.h"
+#include "PlatformString.h"
 #include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 #if PLATFORM(MAC)
@@ -73,7 +74,6 @@
 class FloatSize;
 class GraphicsContext;
 class SharedBuffer;
-class String;
 class AffineTransform;
 
 // This class gets notified when an image creates or destroys decoded frames and when it advances animation frames.
diff --git a/WebCore/platform/graphics/IntPoint.h b/WebCore/platform/graphics/IntPoint.h
index 5137485..d4ea2f2 100644
--- a/WebCore/platform/graphics/IntPoint.h
+++ b/WebCore/platform/graphics/IntPoint.h
@@ -27,7 +27,6 @@
 #define IntPoint_h
 
 #include "IntSize.h"
-#include <wtf/Platform.h>
 
 #if PLATFORM(QT)
 #include <QDataStream>
@@ -57,6 +56,8 @@
 typedef struct _GdkPoint GdkPoint;
 #elif PLATFORM(HAIKU)
 class BPoint;
+#elif PLATFORM(EFL)
+typedef struct _Evas_Point Evas_Point;
 #endif
 
 #if PLATFORM(WX)
@@ -80,6 +81,8 @@
     IntPoint(int x, int y) : m_x(x), m_y(y) { }
     explicit IntPoint(const IntSize& size) : m_x(size.width()), m_y(size.height()) { }
 
+    static IntPoint zero() { return IntPoint(); }
+
     int x() const { return m_x; }
     int y() const { return m_y; }
 
@@ -103,7 +106,7 @@
 
     void clampNegativeToZero()
     {
-        *this = expandedTo(IntPoint());
+        *this = expandedTo(zero());
     }
 
 #if PLATFORM(CG)
@@ -130,6 +133,9 @@
 #elif PLATFORM(HAIKU)
     explicit IntPoint(const BPoint&);
     operator BPoint() const;
+#elif PLATFORM(EFL)
+    explicit IntPoint(const Evas_Point&);
+    operator Evas_Point() const;
 #endif
 
 #if PLATFORM(WX)
@@ -189,6 +195,11 @@
     return a.x() != b.x() || a.y() != b.y();
 }
 
+inline IntPoint toPoint(const IntSize& size)
+{
+    return IntPoint(size.width(), size.height());
+}
+
 #if PLATFORM(QT)
 inline QDataStream& operator<<(QDataStream& stream, const IntPoint& point)
 {
diff --git a/WebCore/platform/graphics/IntPointHash.h b/WebCore/platform/graphics/IntPointHash.h
new file mode 100644
index 0000000..bf25b14
--- /dev/null
+++ b/WebCore/platform/graphics/IntPointHash.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 IntPointHash_h
+#define IntPointHash_h
+
+#include "IntPoint.h"
+#include <wtf/HashFunctions.h>
+#include <wtf/HashTraits.h>
+
+namespace WTF {
+    
+// The empty value is (0, INT_MIN), the deleted value is (INT_MIN, 0)
+struct IntPointHash {
+    static unsigned hash(const WebCore::IntPoint& p) { return WTF::intHash(static_cast<uint64_t>(p.x()) << 32 | p.y()); }
+    static bool equal(const WebCore::IntPoint& a, const WebCore::IntPoint& b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+template<> struct HashTraits<WebCore::IntPoint> : GenericHashTraits<WebCore::IntPoint> {
+    static const bool needsDestruction = false;
+    static WebCore::IntPoint emptyValue() { return WebCore::IntPoint(0, std::numeric_limits<int>::min()); }
+    
+    static void constructDeletedValue(WebCore::IntPoint& slot) { slot = WebCore::IntPoint(std::numeric_limits<int>::min(), 0); }
+    static bool isDeletedValue(const WebCore::IntPoint& slot) { return slot == WebCore::IntPoint(std::numeric_limits<int>::min(), 0); }
+};
+template<> struct DefaultHash<WebCore::IntPoint> {
+    typedef IntPointHash Hash;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h
index e3633df..5c5eae1 100644
--- a/WebCore/platform/graphics/IntRect.h
+++ b/WebCore/platform/graphics/IntRect.h
@@ -27,7 +27,6 @@
 #define IntRect_h
 
 #include "IntPoint.h"
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 #if PLATFORM(CG)
@@ -52,6 +51,8 @@
 typedef struct _GdkRectangle GdkRectangle;
 #elif PLATFORM(HAIKU)
 class BRect;
+#elif PLATFORM(EFL)
+#include <Evas.h>
 #endif
 
 #if PLATFORM(WX)
@@ -105,6 +106,10 @@
     int right() const { return x() + width(); }
     int bottom() const { return y() + height(); }
 
+    // NOTE: The result is rounded to integer values, and thus may be not the exact
+    // center point.
+    IntPoint center() const { return IntPoint(x() + width() / 2, y() + height() / 2); }
+
     void move(const IntSize& s) { m_location += s; } 
     void move(int dx, int dy) { m_location.move(dx, dy); } 
 
@@ -150,6 +155,9 @@
 #elif PLATFORM(HAIKU)
     explicit IntRect(const BRect&);
     operator BRect() const;
+#elif PLATFORM(EFL)
+    explicit IntRect(const Eina_Rectangle&);
+    operator Eina_Rectangle() const;
 #endif
 
 #if PLATFORM(CG)
diff --git a/WebCore/platform/graphics/IntSize.h b/WebCore/platform/graphics/IntSize.h
index 6938afd..b60338c 100644
--- a/WebCore/platform/graphics/IntSize.h
+++ b/WebCore/platform/graphics/IntSize.h
@@ -26,8 +26,6 @@
 #ifndef IntSize_h
 #define IntSize_h
 
-#include <wtf/Platform.h>
-
 #if PLATFORM(CG)
 typedef struct CGSize CGSize;
 #endif
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index 9a7f7b3..813b29c 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -37,6 +37,10 @@
 #include "Document.h"
 #include "TimeRanges.h"
 
+#if PLATFORM(QT)
+#include <QtGlobal>
+#endif
+
 #if PLATFORM(MAC)
 #include "MediaPlayerPrivateQTKit.h"
 #elif OS(WINCE) && !PLATFORM(QT)
@@ -46,7 +50,11 @@
 #elif PLATFORM(GTK)
 #include "MediaPlayerPrivateGStreamer.h"
 #elif PLATFORM(QT)
+#if QT_VERSION < 0x040700
 #include "MediaPlayerPrivatePhonon.h"
+#else
+#include "MediaPlayerPrivateQt.h"
+#endif
 #elif PLATFORM(CHROMIUM)
 #include "MediaPlayerPrivateChromium.h"
 #elif PLATFORM(ANDROID)
@@ -153,7 +161,14 @@
 
     if (!enginesQueried) {
         enginesQueried = true;
+#if USE(GSTREAMER)
+        MediaPlayerPrivateGStreamer::registerMediaEngine(addMediaEngine);
+#else
+        // FIXME: currently all the MediaEngines are named
+        // MediaPlayerPrivate. This code will need an update when bug
+        // 36663 is adressed.
         MediaPlayerPrivate::registerMediaEngine(addMediaEngine);
+#endif
 
         // register additional engines here
     }
@@ -198,15 +213,19 @@
     , m_private(createNullMediaPlayer(this))
     , m_currentMediaEngine(0)
     , m_frameView(0)
+    , m_preload(Auto)
     , m_visible(false)
     , m_rate(1.0f)
     , m_volume(1.0f)
     , m_muted(false)
     , m_preservesPitch(true)
+<<<<<<< HEAD
     , m_autobuffer(false)
 #if PLATFORM(ANDROID)
     , m_mediaElementType(Video)
 #endif
+=======
+>>>>>>> webkit.org at r58033
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     , m_playerProxy(0)
 #endif
@@ -257,7 +276,7 @@
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
         m_private->setMediaPlayerProxy(m_playerProxy);
 #endif
-        m_private->setAutobuffer(autobuffer());
+        m_private->setPreload(m_preload);
         m_private->setPreservesPitch(preservesPitch());
     }
 
@@ -395,7 +414,9 @@
 void MediaPlayer::setVolume(float volume)
 {
     m_volume = volume;
-    m_private->setVolume(volume);   
+
+    if (m_private->supportsMuting() || !m_muted)
+        m_private->setVolume(volume);
 }
 
 bool MediaPlayer::muted() const
@@ -403,15 +424,14 @@
     return m_muted;
 }
 
-bool MediaPlayer::supportsMuting() const
-{
-    return m_private->supportsMuting();
-}
-
 void MediaPlayer::setMuted(bool muted)
 {
     m_muted = muted;
-    m_private->setMuted(muted);
+
+    if (m_private->supportsMuting())
+        m_private->setMuted(muted);
+    else
+        m_private->setVolume(muted ? 0 : m_volume);
 }
 
 bool MediaPlayer::hasClosedCaptions() const
@@ -478,17 +498,15 @@
     m_private->setVisible(b);
 }
 
-bool MediaPlayer::autobuffer() const
+MediaPlayer::Preload MediaPlayer::preload() const
 {
-    return m_autobuffer;
+    return m_preload;
 }
 
-void MediaPlayer::setAutobuffer(bool b)
+void MediaPlayer::setPreload(MediaPlayer::Preload preload)
 {
-    if (m_autobuffer != b) {
-        m_autobuffer = b;
-        m_private->setAutobuffer(b);
-    }
+    m_preload = preload;
+    m_private->setPreload(preload);
 }
 
 void MediaPlayer::paint(GraphicsContext* p, const IntRect& r)
diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h
index f067cc9..24f4225 100644
--- a/WebCore/platform/graphics/MediaPlayer.h
+++ b/WebCore/platform/graphics/MediaPlayer.h
@@ -32,6 +32,7 @@
 #include "MediaPlayerProxy.h"
 #endif
 
+#include "Document.h"
 #include "IntRect.h"
 #include "StringHash.h"
 #include <wtf/HashSet.h>
@@ -75,6 +76,9 @@
 public:
     virtual ~MediaPlayerClient() { }
 
+    // Get the document which the media player is owned by
+    virtual Document* mediaPlayerOwningDocument() { return 0; }
+
     // the network state has changed
     virtual void mediaPlayerNetworkStateChanged(MediaPlayer*) { }
 
@@ -189,15 +193,14 @@
     float volume() const;
     void setVolume(float);
 
-    bool supportsMuting() const;
     bool muted() const;
     void setMuted(bool);
 
     bool hasClosedCaptions() const;
     void setClosedCaptionsVisible(bool closedCaptionsVisible);
 
-    bool autobuffer() const;    
-    void setAutobuffer(bool);
+    bool autoplay() const;    
+    void setAutoplay(bool);
 
     void paint(GraphicsContext*, const IntRect&);
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
@@ -211,6 +214,10 @@
     enum MovieLoadType { Unknown, Download, StoredStream, LiveStream };
     MovieLoadType movieLoadType() const;
 
+    enum Preload { None, MetaData, Auto };
+    Preload preload() const;
+    void setPreload(Preload);
+
     void networkStateChanged();
     void readyStateChanged();
     void volumeChanged(float);
@@ -253,15 +260,19 @@
     void* m_currentMediaEngine;
     FrameView* m_frameView;
     IntSize m_size;
+    Preload m_preload;
     bool m_visible;
     float m_rate;
     float m_volume;
     bool m_muted;
     bool m_preservesPitch;
+<<<<<<< HEAD
     bool m_autobuffer;
 #if PLATFORM(ANDROID)
     MediaElementType m_mediaElementType;
 #endif
+=======
+>>>>>>> webkit.org at r58033
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     WebMediaPlayerProxy* m_playerProxy;    // not owned or used, passed to m_private
 #endif
diff --git a/WebCore/platform/graphics/MediaPlayerPrivate.h b/WebCore/platform/graphics/MediaPlayerPrivate.h
index 3bb8475..16ff543 100644
--- a/WebCore/platform/graphics/MediaPlayerPrivate.h
+++ b/WebCore/platform/graphics/MediaPlayerPrivate.h
@@ -97,7 +97,7 @@
 
     virtual void paintCurrentFrameInContext(GraphicsContext* c, const IntRect& r) { paint(c, r); }
 
-    virtual void setAutobuffer(bool) { };
+    virtual void setPreload(MediaPlayer::Preload) { };
 
     virtual bool hasAvailableVideoFrame() const { return readyState() >= MediaPlayer::HaveCurrentData; }
 
diff --git a/WebCore/platform/graphics/Path.cpp b/WebCore/platform/graphics/Path.cpp
index e30703c..af94be7 100644
--- a/WebCore/platform/graphics/Path.cpp
+++ b/WebCore/platform/graphics/Path.cpp
@@ -39,6 +39,7 @@
                               // to simulate a quarter of a circle.
 namespace WebCore {
 
+#if !PLATFORM(OPENVG)
 static void pathLengthApplierFunction(void* info, const PathElement* element)
 {
     PathTraversalState& traversalState = *static_cast<PathTraversalState*>(info);
@@ -107,6 +108,7 @@
     ok = traversalState.m_success;
     return traversalState.m_normalAngle;
 }
+#endif
 
 Path Path::createRoundedRectangle(const FloatRect& rectangle, const FloatSize& roundingRadii)
 {
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index 533ef8f..b69670f 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -33,6 +33,11 @@
 
 #if PLATFORM(CG)
 typedef struct CGPath PlatformPath;
+#elif PLATFORM(OPENVG)
+namespace WebCore {
+class PlatformPathOpenVG;
+}
+typedef WebCore::PlatformPathOpenVG PlatformPath;
 #elif PLATFORM(QT)
 #include <qpainterpath.h>
 typedef QPainterPath PlatformPath;
diff --git a/WebCore/platform/graphics/Pattern.h b/WebCore/platform/graphics/Pattern.h
index b0cf283..48e8d8b 100644
--- a/WebCore/platform/graphics/Pattern.h
+++ b/WebCore/platform/graphics/Pattern.h
@@ -87,6 +87,9 @@
     void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
     void setPlatformPatternSpaceTransform();
 
+    bool repeatX() const { return m_repeatX; }
+    bool repeatY() const { return m_repeatY; }
+
 private:
     Pattern(Image*, bool repeatX, bool repeatY);
 
diff --git a/WebCore/platform/graphics/SimpleFontData.cpp b/WebCore/platform/graphics/SimpleFontData.cpp
index 2ec8abb..04b6ab1 100644
--- a/WebCore/platform/graphics/SimpleFontData.cpp
+++ b/WebCore/platform/graphics/SimpleFontData.cpp
@@ -157,9 +157,11 @@
     // are mapped to the ZERO WIDTH SPACE glyph.
     Glyph zeroWidthSpaceGlyph = glyphPageZero->glyphDataForCharacter(0).glyph;
     if (zeroWidthSpaceGlyph) {
-        if (zeroWidthSpaceGlyph != m_spaceGlyph)
-            m_glyphToWidthMap.setWidthForGlyph(zeroWidthSpaceGlyph, 0);
-        else
+        if (zeroWidthSpaceGlyph != m_spaceGlyph) {
+            GlyphMetrics metrics;
+            metrics.horizontalAdvance = 0;
+            m_glyphToMetricsMap.setMetricsForGlyph(zeroWidthSpaceGlyph, metrics);
+        } else
             LOG_ERROR("Font maps SPACE and ZERO WIDTH SPACE to the same glyph. Glyph width not overridden.");
     }
 
diff --git a/WebCore/platform/graphics/SimpleFontData.h b/WebCore/platform/graphics/SimpleFontData.h
index 0366e3b..efdbba4 100644
--- a/WebCore/platform/graphics/SimpleFontData.h
+++ b/WebCore/platform/graphics/SimpleFontData.h
@@ -26,8 +26,8 @@
 
 #include "FontData.h"
 #include "FontPlatformData.h"
+#include "GlyphMetricsMap.h"
 #include "GlyphPageTreeNode.h"
-#include "GlyphWidthMap.h"
 #include "TypesettingFeatures.h"
 #include <wtf/OwnPtr.h>
 
@@ -58,9 +58,9 @@
 class FontPlatformData;
 class SharedBuffer;
 class SVGFontData;
-class WidthMap;
 
 enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
+enum GlyphMetricsMode { GlyphBoundingBox, GlyphWidthOnly };
 
 class SimpleFontData : public FontData {
 public:
@@ -81,8 +81,9 @@
     float xHeight() const { return m_xHeight; }
     unsigned unitsPerEm() const { return m_unitsPerEm; }
 
-    float widthForGlyph(Glyph) const;
-    float platformWidthForGlyph(Glyph) const;
+    float widthForGlyph(Glyph glyph) const { return metricsForGlyph(glyph, GlyphWidthOnly).horizontalAdvance; }
+    GlyphMetrics metricsForGlyph(Glyph, GlyphMetricsMode = GlyphBoundingBox) const;
+    GlyphMetrics platformMetricsForGlyph(Glyph, GlyphMetricsMode) const;
 
     float spaceWidth() const { return m_spaceWidth; }
     float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; }
@@ -167,7 +168,7 @@
     || (OS(WINDOWS) && PLATFORM(WX))
     void initGDIFont();
     void platformCommonDestroy();
-    float widthForGDIGlyph(Glyph glyph) const;
+    GlyphMetrics metricsForGDIGlyph(Glyph glyph) const;
 #endif
 
     int m_ascent;
@@ -181,7 +182,7 @@
 
     FontPlatformData m_platformData;
 
-    mutable GlyphWidthMap m_glyphToWidthMap;
+    mutable GlyphMetricsMap m_glyphToMetricsMap;
 
     bool m_treatAsFixedPitch;
 
@@ -237,16 +238,16 @@
     
     
 #if !PLATFORM(QT)
-ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
+ALWAYS_INLINE GlyphMetrics SimpleFontData::metricsForGlyph(Glyph glyph, GlyphMetricsMode metricsMode) const
 {
-    float width = m_glyphToWidthMap.widthForGlyph(glyph);
-    if (width != cGlyphWidthUnknown)
-        return width;
-    
-    width = platformWidthForGlyph(glyph);
-    m_glyphToWidthMap.setWidthForGlyph(glyph, width);
-    
-    return width;
+    GlyphMetrics metrics = m_glyphToMetricsMap.metricsForGlyph(glyph);
+    if ((metricsMode == GlyphWidthOnly && metrics.horizontalAdvance != cGlyphSizeUnknown) || (metricsMode == GlyphBoundingBox && metrics.boundingBox.width() != cGlyphSizeUnknown))
+        return metrics;
+
+    metrics = platformMetricsForGlyph(glyph, metricsMode);
+    m_glyphToMetricsMap.setMetricsForGlyph(glyph, metrics);
+
+    return metrics;
 }
 #endif
 
diff --git a/WebCore/platform/graphics/Tile.h b/WebCore/platform/graphics/Tile.h
new file mode 100644
index 0000000..c623ec9
--- /dev/null
+++ b/WebCore/platform/graphics/Tile.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 Tile_h
+#define Tile_h
+
+#if ENABLE(TILED_BACKING_STORE)
+
+#include "IntPoint.h"
+#include "IntPointHash.h"
+#include "IntRect.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+#if PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QPixmap;
+class QRegion;
+QT_END_NAMESPACE
+#endif
+
+namespace WebCore {
+    
+class GraphicsContext;
+class TiledBackingStore;
+
+class Tile : public RefCounted<Tile> {
+public:
+    typedef IntPoint Coordinate;
+
+    static PassRefPtr<Tile> create(TiledBackingStore* backingStore, const Coordinate& tileCoordinate) { return adoptRef(new Tile(backingStore, tileCoordinate)); }
+    ~Tile();
+    
+    bool isDirty() const;
+    void invalidate(const IntRect&);
+    void updateBackBuffer();
+    void swapBackBufferToFront();
+    bool isReadyToPaint() const;
+    void paint(GraphicsContext*, const IntRect&);
+
+    const Tile::Coordinate& coordinate() const { return m_coordinate; }
+    const IntRect& rect() const { return m_rect; }
+    
+    static void paintCheckerPattern(GraphicsContext*, const FloatRect&);
+
+private:
+    Tile(TiledBackingStore*, const Coordinate&);
+    
+    TiledBackingStore* m_backingStore;
+    Coordinate m_coordinate;
+    IntRect m_rect;
+
+#if PLATFORM(QT)
+    QPixmap* m_buffer;
+    QPixmap* m_backBuffer;
+    QRegion* m_dirtyRegion;
+#endif
+};
+
+}
+#endif
+#endif
diff --git a/WebCore/platform/graphics/TiledBackingStore.cpp b/WebCore/platform/graphics/TiledBackingStore.cpp
new file mode 100644
index 0000000..6214f1b
--- /dev/null
+++ b/WebCore/platform/graphics/TiledBackingStore.cpp
@@ -0,0 +1,378 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 "TiledBackingStore.h"
+
+#if ENABLE(TILED_BACKING_STORE)
+
+#include "GraphicsContext.h"
+#include "TiledBackingStoreClient.h"
+
+namespace WebCore {
+    
+static const int defaultTileWidth = 512;
+static const int defaultTileHeight = 512;
+
+TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client)
+    : m_client(client)
+    , m_tileBufferUpdateTimer(new TileTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired))
+    , m_tileCreationTimer(new TileTimer(this, &TiledBackingStore::tileCreationTimerFired))
+    , m_tileSize(defaultTileWidth, defaultTileHeight)
+    , m_contentsScale(1.f)
+    , m_pendingScale(0)
+    , m_contentsFrozen(false)
+{
+}
+
+TiledBackingStore::~TiledBackingStore()
+{
+    delete m_tileBufferUpdateTimer;
+    delete m_tileCreationTimer;
+}
+
+void TiledBackingStore::invalidate(const IntRect& contentsDirtyRect)
+{
+    IntRect dirtyRect(mapFromContents(contentsDirtyRect));
+    
+    Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.topLeft());
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(dirtyRect.bottomRight());
+    
+    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+            RefPtr<Tile> currentTile = tileAt(Tile::Coordinate(xCoordinate, yCoordinate));
+            if (!currentTile)
+                continue;
+            currentTile->invalidate(dirtyRect);
+        }
+    }
+
+    startTileBufferUpdateTimer();
+}
+
+void TiledBackingStore::updateTileBuffers()
+{
+    if (m_contentsFrozen)
+        return;
+    
+    Vector<IntRect> paintedArea;
+    Vector<RefPtr<Tile> > dirtyTiles;
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it) {
+        if (!it->second->isDirty())
+            continue;
+        dirtyTiles.append(it->second);
+        // FIXME: should not request system repaint for the full tile.
+        paintedArea.append(mapToContents(it->second->rect()));
+    }
+    
+    if (dirtyTiles.isEmpty())
+        return;
+    
+    m_client->tiledBackingStorePaintBegin();
+
+    // FIXME: In single threaded case, tile back buffers could be updated asynchronously 
+    // one by one and then swapped to front in one go. This would minimize the time spent
+    // blocking on tile updates.
+    unsigned size = dirtyTiles.size();
+    for (unsigned n = 0; n < size; ++n)
+        dirtyTiles[n]->updateBackBuffer();
+
+    for (unsigned n = 0; n < size; ++n)
+        dirtyTiles[n]->swapBackBufferToFront();
+
+    m_client->tiledBackingStorePaintEnd(paintedArea);
+}
+
+void TiledBackingStore::paint(GraphicsContext* context, const IntRect& rect)
+{
+    context->save();
+    
+    // Assumes the backing store is painted with the scale transform applied.
+    // Since tile content is already scaled, first revert the scaling from the painter.
+    context->scale(FloatSize(1.f / m_contentsScale, 1.f / m_contentsScale));
+    
+    IntRect dirtyRect = mapFromContents(rect);
+    
+    Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.topLeft());
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(dirtyRect.bottomRight());
+
+    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+            Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
+            RefPtr<Tile> currentTile = tileAt(currentCoordinate);
+            if (currentTile && currentTile->isReadyToPaint())
+                currentTile->paint(context, dirtyRect);
+            else {
+                FloatRect tileRect = tileRectForCoordinate(currentCoordinate);
+                FloatRect target = intersection(tileRect, FloatRect(rect));
+                Tile::paintCheckerPattern(context, target);
+            }
+        }
+    }
+    context->restore();
+}
+
+void TiledBackingStore::viewportChanged(const IntRect& contentsViewport)
+{
+    IntRect viewport = mapFromContents(contentsViewport);
+    if (m_viewport == viewport)
+        return;
+
+    m_viewport = viewport;
+
+    startTileCreationTimer();
+}
+
+void TiledBackingStore::setContentsScale(float scale)
+{
+    if (m_pendingScale == m_contentsScale) {
+        m_pendingScale = 0;
+        return;
+    }
+    m_pendingScale = scale;
+    if (m_contentsFrozen)
+        return;
+    commitScaleChange();
+}
+    
+void TiledBackingStore::commitScaleChange()
+{
+    m_contentsScale = m_pendingScale;
+    m_pendingScale = 0;
+    m_tiles.clear();
+    createTiles();
+}
+
+double TiledBackingStore::tileDistance(const IntRect& viewport, const Tile::Coordinate& tileCoordinate)
+{
+    if (viewport.intersects(tileRectForCoordinate(tileCoordinate)))
+        return 0;
+    
+    IntPoint viewCenter = viewport.location() + IntSize(viewport.width() / 2, viewport.height() / 2);
+    Tile::Coordinate centerCoordinate = tileCoordinateForPoint(viewCenter);
+    
+    // Manhattan distance, biased so that vertical distances are shorter.
+    const double horizontalBias = 1.3;
+    return abs(centerCoordinate.y() - tileCoordinate.y()) + horizontalBias * abs(centerCoordinate.x() - tileCoordinate.x());
+}
+
+void TiledBackingStore::createTiles()
+{
+    if (m_contentsFrozen)
+        return;
+
+    if (m_viewport.isEmpty())
+        return;
+
+    // Remove tiles that extend outside the current contents rect.
+    dropOverhangingTiles();
+
+    // FIXME: Make configurable/adapt to memory.
+    IntRect keepRect = m_viewport;
+    keepRect.inflateX(m_viewport.width());
+    keepRect.inflateY(3 * m_viewport.height());
+    keepRect.intersect(contentsRect());
+    
+    dropTilesOutsideRect(keepRect);
+    
+    IntRect coverRect = m_viewport;
+    coverRect.inflateX(m_viewport.width() / 2);
+    coverRect.inflateY(2 * m_viewport.height());
+    coverRect.intersect(contentsRect());
+    
+    // Search for the tile position closest to the viewport center that does not yet contain a tile. 
+    // Which position is considered the closest depends on the tileDistance function.
+    double shortestDistance = std::numeric_limits<double>::infinity();
+    Vector<Tile::Coordinate> tilesToCreate;
+    unsigned requiredTileCount = 0;
+    Tile::Coordinate topLeft = tileCoordinateForPoint(coverRect.topLeft());
+    Tile::Coordinate bottomRight = tileCoordinateForPoint(coverRect.bottomRight());
+    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+            Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
+            if (tileAt(currentCoordinate))
+                continue;
+            ++requiredTileCount;
+            // Distance is 0 for all currently visible tiles.
+            double distance = tileDistance(m_viewport, currentCoordinate);
+            if (distance > shortestDistance)
+                continue;
+            if (distance < shortestDistance) {
+                tilesToCreate.clear();
+                shortestDistance = distance;
+            }
+            tilesToCreate.append(currentCoordinate);
+        }
+    }
+    
+    // Now construct the tile(s)
+    unsigned tilesToCreateCount = tilesToCreate.size();
+    for (unsigned n = 0; n < tilesToCreateCount; ++n) {
+        Tile::Coordinate coordinate = tilesToCreate[n];
+        setTile(coordinate, Tile::create(this, coordinate));
+    }
+    requiredTileCount -= tilesToCreateCount;
+    
+    // Paint the content of the newly created tiles
+    if (tilesToCreateCount)
+        updateTileBuffers();
+
+    // Keep creating tiles until the whole coverRect is covered.
+    if (requiredTileCount)
+        m_tileCreationTimer->startOneShot(0);
+}
+
+void TiledBackingStore::dropOverhangingTiles()
+{    
+    IntRect contentsRect = this->contentsRect();
+
+    Vector<Tile::Coordinate> tilesToRemove;
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it) {
+        Tile::Coordinate tileCoordinate = it->second->coordinate();
+        IntRect tileRect = it->second->rect();
+        IntRect expectedTileRect = tileRectForCoordinate(tileCoordinate);
+        if (expectedTileRect != tileRect || !contentsRect.contains(tileRect))
+            tilesToRemove.append(tileCoordinate);
+    }
+    unsigned removeCount = tilesToRemove.size();
+    for (unsigned n = 0; n < removeCount; ++n)
+        removeTile(tilesToRemove[n]);
+}
+
+void TiledBackingStore::dropTilesOutsideRect(const IntRect& keepRect)
+{
+    FloatRect keepRectF = keepRect;
+
+    Vector<Tile::Coordinate> toRemove;
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it) {
+        Tile::Coordinate coordinate = it->second->coordinate();
+        FloatRect tileRect = it->second->rect();
+        if (!tileRect.intersects(keepRectF))
+            toRemove.append(coordinate);
+    }
+    unsigned removeCount = toRemove.size();
+    for (unsigned n = 0; n < removeCount; ++n)
+        removeTile(toRemove[n]);
+}
+
+PassRefPtr<Tile> TiledBackingStore::tileAt(const Tile::Coordinate& coordinate) const
+{
+    return m_tiles.get(coordinate);
+}
+
+void TiledBackingStore::setTile(const Tile::Coordinate& coordinate, PassRefPtr<Tile> tile)
+{
+    m_tiles.set(coordinate, tile);
+}
+
+void TiledBackingStore::removeTile(const Tile::Coordinate& coordinate)
+{
+    m_tiles.remove(coordinate);
+}
+
+IntRect TiledBackingStore::mapToContents(const IntRect& rect) const
+{
+    return enclosingIntRect(FloatRect(rect.x() / m_contentsScale,
+        rect.y() / m_contentsScale,
+        rect.width() / m_contentsScale,
+        rect.height() / m_contentsScale));
+}
+
+IntRect TiledBackingStore::mapFromContents(const IntRect& rect) const
+{
+    return enclosingIntRect(FloatRect(rect.x() * m_contentsScale,
+        rect.y() * m_contentsScale,
+        rect.width() * m_contentsScale,
+        rect.height() * m_contentsScale));
+}
+
+IntRect TiledBackingStore::contentsRect() const
+{
+    return mapFromContents(m_client->tiledBackingStoreContentsRect());
+}
+
+IntRect TiledBackingStore::tileRectForCoordinate(const Tile::Coordinate& coordinate) const
+{
+    IntRect rect(coordinate.x() * m_tileSize.width(),
+        coordinate.y() * m_tileSize.height(),
+        m_tileSize.width(),
+        m_tileSize.height());
+
+    rect.intersect(contentsRect());
+    return rect;
+}
+    
+Tile::Coordinate TiledBackingStore::tileCoordinateForPoint(const IntPoint& point) const
+{
+    int x = point.x() / m_tileSize.width();
+    int y = point.y() / m_tileSize.height();
+    return Tile::Coordinate(std::max(x, 0), std::max(y, 0));
+}
+
+
+void TiledBackingStore::startTileBufferUpdateTimer()
+{
+    if (m_tileBufferUpdateTimer->isActive() || m_contentsFrozen)
+        return;
+    m_tileBufferUpdateTimer->startOneShot(0);
+}
+
+void TiledBackingStore::tileBufferUpdateTimerFired(TileTimer*)
+{
+    updateTileBuffers();
+}
+
+void TiledBackingStore::startTileCreationTimer()
+{
+    if (m_tileCreationTimer->isActive() || m_contentsFrozen)
+        return;
+    m_tileCreationTimer->startOneShot(0);
+}
+
+void TiledBackingStore::tileCreationTimerFired(TileTimer*)
+{
+    createTiles();
+}
+
+void TiledBackingStore::setContentsFrozen(bool freeze)
+{
+    if (m_contentsFrozen == freeze)
+        return;
+
+    m_contentsFrozen = freeze;
+
+    // Restart the timers. There might be pending invalidations that
+    // were not painted or created because tiles are not created or
+    // painted when in frozen state.
+    if (m_contentsFrozen)
+        return;
+    if (m_pendingScale)
+        commitScaleChange();
+    else {
+        startTileCreationTimer();
+        startTileBufferUpdateTimer();
+    }
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/TiledBackingStore.h b/WebCore/platform/graphics/TiledBackingStore.h
new file mode 100644
index 0000000..8ed4336
--- /dev/null
+++ b/WebCore/platform/graphics/TiledBackingStore.h
@@ -0,0 +1,110 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 TiledBackingStore_h
+#define TiledBackingStore_h
+
+#if ENABLE(TILED_BACKING_STORE)
+
+#include "FloatSize.h"
+#include "IntPoint.h"
+#include "IntRect.h"
+#include "Tile.h"
+#include "Timer.h"
+#include <wtf/Assertions.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class GraphicsContext;
+class TiledBackingStoreClient;
+
+class TiledBackingStore : public Noncopyable {
+public:
+    TiledBackingStore(TiledBackingStoreClient*);
+    ~TiledBackingStore();
+
+    void viewportChanged(const IntRect& viewportRect);
+    
+    float contentsScale() { return m_contentsScale; }
+    void setContentsScale(float);
+    
+    bool contentsFrozen() const { return m_contentsFrozen; }
+    void setContentsFrozen(bool);
+
+    void invalidate(const IntRect& dirtyRect);
+    void paint(GraphicsContext*, const IntRect&);
+
+private:
+    void startTileBufferUpdateTimer();
+    void startTileCreationTimer();
+    
+    typedef Timer<TiledBackingStore> TileTimer;
+
+    void tileBufferUpdateTimerFired(TileTimer*);
+    void tileCreationTimerFired(TileTimer*);
+    
+    void updateTileBuffers();
+    void createTiles();
+    
+    void commitScaleChange();
+
+    void dropOverhangingTiles();
+    void dropTilesOutsideRect(const IntRect&);
+    
+    PassRefPtr<Tile> tileAt(const Tile::Coordinate&) const;
+    void setTile(const Tile::Coordinate& coordinate, PassRefPtr<Tile> tile);
+    void removeTile(const Tile::Coordinate& coordinate);
+
+    IntRect mapToContents(const IntRect&) const;
+    IntRect mapFromContents(const IntRect&) const;
+    
+    IntRect contentsRect() const;
+    
+    IntRect tileRectForCoordinate(const Tile::Coordinate&) const;
+    Tile::Coordinate tileCoordinateForPoint(const IntPoint&) const;
+    double tileDistance(const IntRect& viewport, const Tile::Coordinate&);
+    
+    void paintCheckerPattern(GraphicsContext*, const IntRect&, const Tile::Coordinate&);
+
+private:
+    TiledBackingStoreClient* m_client;
+
+    typedef HashMap<Tile::Coordinate, RefPtr<Tile> > TileMap;
+    TileMap m_tiles;
+
+    TileTimer* m_tileBufferUpdateTimer;
+    TileTimer* m_tileCreationTimer;
+
+    IntSize m_tileSize;
+    
+    IntRect m_viewport;
+    float m_contentsScale;
+    float m_pendingScale;
+
+    bool m_contentsFrozen;
+
+    friend class Tile;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/platform/graphics/TiledBackingStoreClient.h b/WebCore/platform/graphics/TiledBackingStoreClient.h
new file mode 100644
index 0000000..4adbbab
--- /dev/null
+++ b/WebCore/platform/graphics/TiledBackingStoreClient.h
@@ -0,0 +1,40 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 TiledBackingStoreClient_h
+#define TiledBackingStoreClient_h
+
+namespace WebCore {
+
+#if ENABLE(TILED_BACKING_STORE)
+class TiledBackingStoreClient {
+public:
+    virtual void tiledBackingStorePaintBegin() = 0;
+    virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&) = 0;
+    virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) = 0;
+    virtual IntRect tiledBackingStoreContentsRect() = 0;
+};
+
+#else
+class TiledBackingStoreClient {};
+#endif
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/gtk/FontCacheGtk.cpp b/WebCore/platform/graphics/cairo/FontCacheCairo.cpp
similarity index 100%
rename from WebCore/platform/graphics/gtk/FontCacheGtk.cpp
rename to WebCore/platform/graphics/cairo/FontCacheCairo.cpp
diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp
index 169c74c..c2aae49 100644
--- a/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -3,6 +3,7 @@
  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
  * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
  * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Holger Hans Peter Freyther
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -157,7 +158,11 @@
         }
     }
 
-    if (context->textDrawingMode() & cTextStroke) {
+    // Prevent running into a long computation within cairo. If the stroke width is
+    // twice the size of the width of the text we will not ask cairo to stroke
+    // the text as even one single stroke would cover the full wdth of the text.
+    //  See https://bugs.webkit.org/show_bug.cgi?id=33759.
+    if (context->textDrawingMode() & cTextStroke && context->strokeThickness() < 2 * offset) {
         if (context->strokeGradient()) {
             cairo_set_source(cr, context->strokeGradient()->platformGradient());
             if (context->getAlpha() < 1.0f) {
diff --git a/WebCore/platform/graphics/gtk/FontCustomPlatformData.cpp b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
similarity index 100%
rename from WebCore/platform/graphics/gtk/FontCustomPlatformData.cpp
rename to WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
diff --git a/WebCore/platform/graphics/gtk/FontCustomPlatformData.h b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
similarity index 100%
rename from WebCore/platform/graphics/gtk/FontCustomPlatformData.h
rename to WebCore/platform/graphics/cairo/FontCustomPlatformData.h
diff --git a/WebCore/platform/graphics/cairo/FontPlatformData.h b/WebCore/platform/graphics/cairo/FontPlatformData.h
new file mode 100644
index 0000000..3c926fe
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/FontPlatformData.h
@@ -0,0 +1,187 @@
+/*
+ * This file is part of the internal font implementation.  It should not be included by anyone other than
+ * FontMac.cpp, FontWin.cpp and Font.cpp.
+ *
+ * Copyright (C) 2006, 2007, 2008 Apple Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * All rights reserved.
+ *
+ * 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 FontPlatformData_h
+#define FontPlatformData_h
+
+#include "FontDescription.h"
+#include "GlyphBuffer.h"
+#include <cairo.h>
+#if defined(USE_FREETYPE)
+#include <cairo-ft.h>
+#include <fontconfig/fcfreetype.h>
+#elif defined(USE_PANGO)
+#include <pango/pangocairo.h>
+#elif PLATFORM(WIN)
+#include <cairo-win32.h>
+#include "RefCountedHFONT.h"
+#include "StringImpl.h"
+#else
+#error "Must defined a font backend"
+#endif
+
+#if PLATFORM(WIN)
+typedef struct HFONT__* HFONT;
+#endif
+namespace WebCore {
+
+class String;
+
+class FontPlatformData {
+public:
+    FontPlatformData(WTF::HashTableDeletedValueType)
+#if defined(USE_FREETYPE)
+        : m_pattern(hashTableDeletedFontValue())
+        , m_fallbacks(0)
+#elif defined(USE_PANGO)
+        : m_context(0)
+        , m_font(hashTableDeletedFontValue())
+#elif PLATFORM(WIN)
+        : m_fontFace(0)
+        , m_useGDI(false)
+        , m_font(WTF::HashTableDeletedValue)
+#else
+#error "Must defined a font backend"
+#endif
+        , m_size(0)
+        , m_syntheticBold(false)
+        , m_syntheticOblique(false)
+        , m_scaledFont(0)
+        { }
+
+    FontPlatformData()
+#if defined(USE_FREETYPE)
+        : m_pattern(0)
+        , m_fallbacks(0)
+#elif defined(USE_PANGO)
+        : m_context(0)
+        , m_font(0)
+#elif PLATFORM(WIN)
+        : m_fontFace(0)
+        , m_useGDI(false)
+#else
+#error "Must defined a font backend"
+#endif
+        , m_size(0)
+        , m_syntheticBold(false)
+        , m_syntheticOblique(false)
+        , m_scaledFont(0)
+        { }
+
+#if PLATFORM(WIN)
+    FontPlatformData(HFONT, float size, bool bold, bool oblique, bool useGDI);
+#else
+    FontPlatformData(const FontDescription&, const AtomicString& family);
+#endif
+
+    FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic);
+    FontPlatformData(float size, bool bold, bool italic);
+    FontPlatformData(const FontPlatformData&);
+
+    ~FontPlatformData();
+
+#if !PLATFORM(WIN)
+    static bool init();
+#else
+    HFONT hfont() const { return m_font->hfont(); }
+    bool useGDI() const { return m_useGDI; }
+    cairo_font_face_t* fontFace() const { return m_fontFace; }
+#endif
+
+    bool isFixedPitch();
+    float size() const { return m_size; }
+    void setSize(float size) { m_size = size; }
+    bool syntheticBold() const { return m_syntheticBold; }
+    bool syntheticOblique() const { return m_syntheticOblique; }
+
+    cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
+
+    unsigned hash() const
+    {
+#if PLATFORM(WIN)
+        return m_font->hash();
+#else
+#if defined(USE_FREETYPE)
+        if (m_pattern)
+            return FcPatternHash(m_pattern);
+#endif
+        uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
+        return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+#endif
+    }
+
+    bool operator==(const FontPlatformData&) const;
+    FontPlatformData& operator=(const FontPlatformData&);
+    bool isHashTableDeletedValue() const
+    {
+#if defined(USE_FREETYPE)
+        return m_pattern == hashTableDeletedFontValue();
+#elif defined(USE_PANGO)
+        return m_font == hashTableDeletedFontValue();
+#elif PLATFORM(WIN)
+        return m_font.isHashTableDeletedValue();
+#endif
+    }
+
+#ifndef NDEBUG
+    String description() const;
+#endif
+
+#if defined(USE_FREETYPE)
+    FcPattern* m_pattern;
+    FcFontSet* m_fallbacks;
+#elif defined(USE_PANGO)
+    static PangoFontMap* m_fontMap;
+    static GHashTable* m_hashTable;
+
+    PangoContext* m_context;
+    PangoFont* m_font;
+#elif PLATFORM(WIN)
+private:
+    void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
+
+    RefPtr<RefCountedHFONT> m_font;
+    cairo_font_face_t* m_fontFace;
+    bool m_useGDI;
+#else
+#error "Must defined a font backend"
+#endif
+    float m_size;
+    bool m_syntheticBold;
+    bool m_syntheticOblique;
+    cairo_scaled_font_t* m_scaledFont;
+private:
+#if defined(USE_FREETYPE)
+    static FcPattern *hashTableDeletedFontValue() { return reinterpret_cast<FcPattern*>(-1); }
+#elif defined(USE_PANGO)
+    static PangoFont *hashTableDeletedFontValue() { return reinterpret_cast<PangoFont*>(-1); }
+#endif
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
new file mode 100644
index 0000000..974c195
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataCairo.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2009 Igalia S.L.
+ * All rights reserved.
+ *
+ * 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 "FontPlatformData.h"
+
+#include "PlatformString.h"
+#include "FontDescription.h"
+#include <wtf/text/CString.h>
+
+#include <cairo-ft.h>
+#include <cairo.h>
+#include <fontconfig/fcfreetype.h>
+#include <gdk/gdk.h>
+
+namespace WebCore {
+
+FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
+    : m_pattern(0)
+    , m_fallbacks(0)
+    , m_size(fontDescription.computedPixelSize())
+    , m_syntheticBold(false)
+    , m_syntheticOblique(false)
+    , m_scaledFont(0)
+{
+    FontPlatformData::init();
+
+    CString familyNameString = familyName.string().utf8();
+    const char* fcfamily = familyNameString.data();
+    int fcslant = FC_SLANT_ROMAN;
+    // FIXME: Map all FontWeight values to fontconfig weights.
+    int fcweight = FC_WEIGHT_NORMAL;
+    double fcsize = fontDescription.computedPixelSize();
+    if (fontDescription.italic())
+        fcslant = FC_SLANT_ITALIC;
+    if (fontDescription.weight() >= FontWeight600)
+        fcweight = FC_WEIGHT_BOLD;
+
+    int type = fontDescription.genericFamily();
+
+    FcPattern* pattern = FcPatternCreate();
+    cairo_font_face_t* fontFace;
+    static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
+    const cairo_font_options_t* options = NULL;
+    cairo_matrix_t fontMatrix;
+
+    if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
+        goto freePattern;
+
+    switch (type) {
+    case FontDescription::SerifFamily:
+        fcfamily = "serif";
+        break;
+    case FontDescription::SansSerifFamily:
+        fcfamily = "sans-serif";
+        break;
+    case FontDescription::MonospaceFamily:
+        fcfamily = "monospace";
+        break;
+    case FontDescription::StandardFamily:
+        fcfamily = "sans-serif";
+        break;
+    case FontDescription::NoFamily:
+    default:
+        fcfamily = NULL;
+        break;
+    }
+
+    if (fcfamily && !FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
+        goto freePattern;
+    if (!FcPatternAddInteger(pattern, FC_WEIGHT, fcweight))
+        goto freePattern;
+    if (!FcPatternAddInteger(pattern, FC_SLANT, fcslant))
+        goto freePattern;
+    if (!FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fcsize))
+        goto freePattern;
+
+    FcConfigSubstitute(NULL, pattern, FcMatchPattern);
+    FcDefaultSubstitute(pattern);
+
+    FcResult fcresult;
+    m_pattern = FcFontMatch(NULL, pattern, &fcresult);
+    // FIXME: should we set some default font?
+    if (!m_pattern)
+        goto freePattern;
+    fontFace = cairo_ft_font_face_create_for_pattern(m_pattern);
+    cairo_matrix_t ctm;
+    cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
+    cairo_matrix_init_identity(&ctm);
+
+    if (GdkScreen* screen = gdk_screen_get_default())
+        options = gdk_screen_get_font_options(screen);
+
+    // gdk_screen_get_font_options() returns NULL if no default options are
+    // set, so we always have to check.
+    if (!options)
+        options = defaultOptions;
+
+    m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
+    cairo_font_face_destroy(fontFace);
+
+freePattern:
+    FcPatternDestroy(pattern);
+}
+
+FontPlatformData::FontPlatformData(float size, bool bold, bool italic)
+    : m_pattern(0)
+    , m_fallbacks(0)
+    , m_size(size)
+    , m_syntheticBold(bold)
+    , m_syntheticOblique(italic)
+    , m_scaledFont(0)
+{
+}
+
+FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic)
+    : m_pattern(0)
+    , m_fallbacks(0)
+    , m_size(size)
+    , m_syntheticBold(bold)
+    , m_syntheticOblique(italic)
+    , m_scaledFont(0)
+{
+    cairo_matrix_t fontMatrix;
+    cairo_matrix_init_scale(&fontMatrix, size, size);
+    cairo_matrix_t ctm;
+    cairo_matrix_init_identity(&ctm);
+    static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
+    const cairo_font_options_t* options = NULL;
+
+    if (GdkScreen* screen = gdk_screen_get_default())
+        options = gdk_screen_get_font_options(screen);
+
+    // gdk_screen_get_font_options() returns NULL if no default options are
+    // set, so we always have to check.
+    if (!options)
+        options = defaultOptions;
+
+    m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
+}
+
+FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
+{
+    // Check for self-assignment.
+    if (this == &other)
+        return *this;
+
+    m_size = other.m_size;
+    m_syntheticBold = other.m_syntheticBold;
+    m_syntheticOblique = other.m_syntheticOblique;
+
+    if (other.m_scaledFont)
+        cairo_scaled_font_reference(other.m_scaledFont);
+    if (m_scaledFont)
+        cairo_scaled_font_destroy(m_scaledFont);
+    m_scaledFont = other.m_scaledFont;
+
+    if (other.m_pattern)
+        FcPatternReference(other.m_pattern);
+    if (m_pattern)
+        FcPatternDestroy(m_pattern);
+    m_pattern = other.m_pattern;
+
+    if (m_fallbacks) {
+        FcFontSetDestroy(m_fallbacks);
+        // This will be re-created on demand.
+        m_fallbacks = 0;
+    }
+
+    return *this;
+}
+
+FontPlatformData::FontPlatformData(const FontPlatformData& other)
+    : m_pattern(0)
+    , m_fallbacks(0)
+    , m_scaledFont(0)
+{
+    *this = other;
+}
+
+bool FontPlatformData::init()
+{
+    static bool initialized = false;
+    if (initialized)
+        return true;
+    if (!FcInit()) {
+        fprintf(stderr, "Can't init font config library\n");
+        return false;
+    }
+    initialized = true;
+    return true;
+}
+
+FontPlatformData::~FontPlatformData()
+{
+    if (m_pattern && ((FcPattern*)-1 != m_pattern)) {
+        FcPatternDestroy(m_pattern);
+        m_pattern = 0;
+    }
+
+    if (m_fallbacks) {
+        FcFontSetDestroy(m_fallbacks);
+        m_fallbacks = 0;
+    }
+
+    if (m_scaledFont)
+        cairo_scaled_font_destroy(m_scaledFont);
+}
+
+bool FontPlatformData::isFixedPitch()
+{
+    // TODO: Support isFixedPitch() for custom fonts.
+    if (!m_pattern)
+        return false;
+
+    int spacing;
+    if (FcPatternGetInteger(m_pattern, FC_SPACING, 0, &spacing) == FcResultMatch)
+        return spacing == FC_MONO;
+    return false;
+}
+
+bool FontPlatformData::operator==(const FontPlatformData& other) const
+{
+    if (m_pattern == other.m_pattern)
+        return true;
+    if (m_pattern == 0 || m_pattern == reinterpret_cast<FcPattern*>(-1)
+            || other.m_pattern == 0 || other.m_pattern == reinterpret_cast<FcPattern*>(-1))
+        return false;
+    return FcPatternEqual(m_pattern, other.m_pattern);
+}
+
+#ifndef NDEBUG
+String FontPlatformData::description() const
+{
+    return String();
+}
+#endif
+
+}
diff --git a/WebCore/platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp b/WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
similarity index 100%
rename from WebCore/platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp
rename to WebCore/platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index bc68b37..91cecd3 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -89,7 +89,7 @@
 void Path::translate(const FloatSize& p)
 {
     cairo_t* cr = platformPath()->m_cr;
-    cairo_translate(cr, p.width(), p.height());
+    cairo_translate(cr, -p.width(), -p.height());
 }
 
 void Path::moveTo(const FloatPoint& p)
@@ -267,9 +267,6 @@
 
 bool Path::contains(const FloatPoint& point, WindRule rule) const
 {
-    if (!boundingRect().contains(point))
-        return false;
-
     cairo_t* cr = platformPath()->m_cr;
     cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
     cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
diff --git a/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
new file mode 100644
index 0000000..0be45f6
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "SimpleFontData.h"
+
+#include "FloatRect.h"
+#include "Font.h"
+#include "FontCache.h"
+#include "FontDescription.h"
+#include "GlyphBuffer.h"
+#include <cairo.h>
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+void SimpleFontData::platformInit()
+{
+    cairo_font_extents_t font_extents;
+    cairo_text_extents_t text_extents;
+    cairo_scaled_font_extents(m_platformData.m_scaledFont, &font_extents);
+    m_ascent = static_cast<int>(lroundf(font_extents.ascent));
+    m_descent = static_cast<int>(lroundf(font_extents.descent));
+    m_lineSpacing = static_cast<int>(lroundf(font_extents.height));
+    // There seems to be some rounding error in cairo (or in how we
+    // use cairo) with some fonts, like DejaVu Sans Mono, which makes
+    // cairo report a height smaller than ascent + descent, which is
+    // wrong and confuses WebCore's layout system. Workaround this
+    // while we figure out what's going on.
+    if (m_lineSpacing < m_ascent + m_descent)
+        m_lineSpacing = m_ascent + m_descent;
+    cairo_scaled_font_text_extents(m_platformData.m_scaledFont, "x", &text_extents);
+    m_xHeight = text_extents.height;
+    cairo_scaled_font_text_extents(m_platformData.m_scaledFont, " ", &text_extents);
+    m_spaceWidth = static_cast<float>(text_extents.x_advance);
+    m_lineGap = m_lineSpacing - m_ascent - m_descent;
+    m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
+}
+
+void SimpleFontData::platformCharWidthInit()
+{
+    m_avgCharWidth = 0.f;
+    m_maxCharWidth = 0.f;
+    initCharWidths();
+}
+
+void SimpleFontData::platformDestroy()
+{
+    delete m_smallCapsFontData;
+    m_smallCapsFontData = 0;
+}
+
+SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
+{
+    if (!m_smallCapsFontData) {
+        FontDescription desc = FontDescription(fontDescription);
+        desc.setComputedSize(0.70f*fontDescription.computedSize());
+        const FontPlatformData* pdata = new FontPlatformData(desc, desc.family().family());
+        m_smallCapsFontData = new SimpleFontData(*pdata);
+    }
+    return m_smallCapsFontData;
+}
+
+bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
+{
+    FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.m_scaledFont);
+
+    if (!face)
+        return false;
+
+    for (int i = 0; i < length; i++) {
+        if (FcFreeTypeCharIndex(face, characters[i]) == 0) {
+            cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
+            return false;
+        }
+    }
+
+    cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
+
+    return true;
+}
+
+void SimpleFontData::determinePitch()
+{
+    m_treatAsFixedPitch = m_platformData.isFixedPitch();
+}
+
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
+{
+    ASSERT(m_platformData.m_scaledFont);
+
+    cairo_glyph_t cglyph = { glyph, 0, 0 };
+    cairo_text_extents_t extents;
+    cairo_scaled_font_glyph_extents(m_platformData.m_scaledFont, &cglyph, 1, &extents);
+
+    float w = (float)m_spaceWidth;
+    if (cairo_scaled_font_status(m_platformData.m_scaledFont) == CAIRO_STATUS_SUCCESS && extents.x_advance != 0)
+        w = (float)extents.x_advance;
+    
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = w;
+    return metrics;
+}
+
+}
diff --git a/WebCore/platform/graphics/cg/FontPlatformData.h b/WebCore/platform/graphics/cg/FontPlatformData.h
new file mode 100644
index 0000000..da2b7e3
--- /dev/null
+++ b/WebCore/platform/graphics/cg/FontPlatformData.h
@@ -0,0 +1,102 @@
+/*
+ * This file is part of the internal font implementation.  It should not be included by anyone other than
+ * FontMac.cpp, FontWin.cpp and Font.cpp.
+ *
+ * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc.
+ *
+ * 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 FontPlatformData_h
+#define FontPlatformData_h
+
+#include "RefCountedHFONT.h"
+#include "StringImpl.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RetainPtr.h>
+
+typedef struct HFONT__* HFONT;
+typedef struct CGFont* CGFontRef;
+
+namespace WebCore {
+
+class FontDescription;
+class String;
+
+class FontPlatformData {
+public:
+    FontPlatformData()
+        : m_size(0)
+        , m_syntheticBold(false)
+        , m_syntheticOblique(false)
+        , m_useGDI(false)
+    {
+    }
+
+    FontPlatformData(HFONT, float size, bool bold, bool oblique, bool useGDI);
+    FontPlatformData(float size, bool bold, bool oblique);
+
+    FontPlatformData(HFONT, CGFontRef, float size, bool bold, bool oblique, bool useGDI);
+    ~FontPlatformData();
+
+    FontPlatformData(WTF::HashTableDeletedValueType) : m_font(WTF::HashTableDeletedValue) { }
+    bool isHashTableDeletedValue() const { return m_font.isHashTableDeletedValue(); }
+
+    HFONT hfont() const { return m_font->hfont(); }
+    CGFontRef cgFont() const { return m_cgFont.get(); }
+
+    float size() const { return m_size; }
+    void setSize(float size) { m_size = size; }
+    bool syntheticBold() const { return m_syntheticBold; }
+    bool syntheticOblique() const { return m_syntheticOblique; }
+    bool useGDI() const { return m_useGDI; }
+
+    unsigned hash() const
+    {
+        return m_font->hash();
+    }
+
+    bool operator==(const FontPlatformData& other) const
+    { 
+        return m_font == other.m_font
+            && m_cgFont == other.m_cgFont
+            && m_size == other.m_size
+            && m_syntheticBold == other.m_syntheticBold
+            && m_syntheticOblique == other.m_syntheticOblique
+            && m_useGDI == other.m_useGDI;
+    }
+
+#ifndef NDEBUG
+    String description() const;
+#endif
+
+private:
+    void platformDataInit(HFONT, float size, HDC, WCHAR* faceName);
+
+    RefPtr<RefCountedHFONT> m_font;
+    RetainPtr<CGFontRef> m_cgFont;
+
+    float m_size;
+    bool m_syntheticBold;
+    bool m_syntheticOblique;
+    bool m_useGDI;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/cg/GradientCG.cpp b/WebCore/platform/graphics/cg/GradientCG.cpp
index 9c91700..4aaaeaf 100644
--- a/WebCore/platform/graphics/cg/GradientCG.cpp
+++ b/WebCore/platform/graphics/cg/GradientCG.cpp
@@ -29,8 +29,8 @@
 
 #include "CSSParser.h"
 #include "GraphicsContext.h"
-
 #include <ApplicationServices/ApplicationServices.h>
+#include <wtf/RetainPtr.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h b/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
index b1efba1..aac4f45 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
+++ b/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
@@ -23,6 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+#include <wtf/RetainPtr.h>
 #include <CoreGraphics/CGContext.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index 0dc7a53..c82ebdc 100644
--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -29,15 +29,16 @@
 
 #include "Base64.h"
 #include "BitmapImage.h"
-#include "CString.h"
 #include "GraphicsContext.h"
 #include "ImageData.h"
 #include "MIMETypeRegistry.h"
 #include "PlatformString.h"
 #include <ApplicationServices/ApplicationServices.h>
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/Threading.h>
 #include <math.h>
 
 using namespace std;
@@ -254,6 +255,8 @@
     RetainPtr<CFStringRef> mimeTypeCFString(AdoptCF, mimeType.createCFString());
     return RetainPtr<CFStringRef>(AdoptCF, UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeTypeCFString.get(), 0));
 #else
+    ASSERT(isMainThread()); // It is unclear if CFSTR is threadsafe.
+
     // FIXME: Add Windows support for all the supported UTIs when a way to convert from MIMEType to UTI reliably is found.
     // For now, only support PNG, JPEG, and GIF. See <rdar://problem/6095286>.
     static const CFStringRef kUTTypePNG = CFSTR("public.png");
diff --git a/WebCore/platform/graphics/cg/ImageSourceCG.cpp b/WebCore/platform/graphics/cg/ImageSourceCG.cpp
index 2b2c6b0..b4e1ca9 100644
--- a/WebCore/platform/graphics/cg/ImageSourceCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageSourceCG.cpp
@@ -74,7 +74,7 @@
 
 void ImageSource::clear(bool destroyAllFrames, size_t, SharedBuffer* data, bool allDataReceived)
 {
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     // Recent versions of ImageIO discard previously decoded image frames if the client
     // application no longer holds references to them, so there's no need to throw away
     // the decoder unless we're explicitly asked to destroy all of the frames.
@@ -119,14 +119,22 @@
 
 void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
 {
-    if (!m_decoder)
-        m_decoder = CGImageSourceCreateIncremental(NULL);
 #if PLATFORM(MAC)
+    if (!m_decoder)
+        m_decoder = CGImageSourceCreateIncremental(0);
     // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge.  We use SharedBuffer's ability
     // to wrap itself inside CFData to get around this, ensuring that ImageIO is really looking at the SharedBuffer.
     RetainPtr<CFDataRef> cfData(AdoptCF, data->createCFData());
     CGImageSourceUpdateData(m_decoder, cfData.get(), allDataReceived);
 #else
+    if (!m_decoder) {
+        m_decoder = CGImageSourceCreateIncremental(0);
+    } else if (allDataReceived) {
+        // 10.6 bug workaround: image sources with final=false fail to draw into PDF contexts, so re-create image source
+        // when data is complete. <rdar://problem/7874035> (<http://openradar.appspot.com/7874035>)
+        CFRelease(m_decoder);
+        m_decoder = CGImageSourceCreateIncremental(0);
+    }
     // Create a CGDataProvider to wrap the SharedBuffer.
     data->ref();
     // We use the GetBytesAtPosition callback rather than the GetBytePointer one because SharedBuffer
@@ -234,7 +242,22 @@
 
 bool ImageSource::frameIsCompleteAtIndex(size_t index)
 {
-    return CGImageSourceGetStatusAtIndex(m_decoder, index) == kCGImageStatusComplete;
+    ASSERT(frameCount());
+
+    // CGImageSourceGetStatusAtIndex claims that all frames of a multi-frame image are incomplete
+    // when we've not yet received the complete data for an image that is using an incremental data
+    // source (<rdar://problem/7679174>). We work around this by special-casing all frames except the
+    // last in an image and treating them as complete if they are present and reported as being
+    // incomplete. We do this on the assumption that loading new data can only modify the existing last
+    // frame or append new frames. The last frame is only treated as being complete if the image source
+    // reports it as such. This ensures that it is truly the last frame of the image rather than just
+    // the last that we currently have data for.
+
+    CGImageSourceStatus frameStatus = CGImageSourceGetStatusAtIndex(m_decoder, index);
+    if (index < frameCount() - 1)
+        return frameStatus >= kCGImageStatusIncomplete;
+
+    return frameStatus == kCGImageStatusComplete;
 }
 
 float ImageSource::frameDurationAtIndex(size_t index)
diff --git a/WebCore/platform/graphics/cg/PDFDocumentImage.cpp b/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
index 67333ae..8bf04f1 100644
--- a/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
+++ b/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
@@ -31,7 +31,9 @@
 
 #include "GraphicsContext.h"
 #include "ImageObserver.h"
+#include "SharedBuffer.h"
 #include <wtf/MathExtras.h>
+#include <wtf/RetainPtr.h>
 
 #if !PLATFORM(MAC)
 #include "ImageSourceCG.h"
@@ -54,6 +56,11 @@
     CGPDFDocumentRelease(m_document);
 }
 
+String PDFDocumentImage::filenameExtension() const
+{
+    return "pdf";
+}
+
 IntSize PDFDocumentImage::size() const
 {
     const float sina = sinf(-m_rotation);
diff --git a/WebCore/platform/graphics/cg/PDFDocumentImage.h b/WebCore/platform/graphics/cg/PDFDocumentImage.h
index 12ab46c..790d620 100644
--- a/WebCore/platform/graphics/cg/PDFDocumentImage.h
+++ b/WebCore/platform/graphics/cg/PDFDocumentImage.h
@@ -46,6 +46,8 @@
     private:
         virtual ~PDFDocumentImage();
 
+        virtual String filenameExtension() const;
+
         virtual bool hasSingleSecurityOrigin() const { return true; }
 
         virtual bool dataChanged(bool allDataReceived);
diff --git a/WebCore/platform/graphics/cg/PathCG.cpp b/WebCore/platform/graphics/cg/PathCG.cpp
index 81454b3..eb196d9 100644
--- a/WebCore/platform/graphics/cg/PathCG.cpp
+++ b/WebCore/platform/graphics/cg/PathCG.cpp
@@ -30,14 +30,14 @@
 #if PLATFORM(CG)
 
 #include "AffineTransform.h"
-#include <ApplicationServices/ApplicationServices.h>
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "IntRect.h"
 #include "PlatformString.h"
 #include "StrokeStyleApplier.h"
-
+#include <ApplicationServices/ApplicationServices.h>
 #include <wtf/MathExtras.h>
+#include <wtf/RetainPtr.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index 8dac612..6f46f7e 100644
--- a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -140,6 +140,9 @@
         // 宋体, SimSun
         {L"\x5B8B\x4F53", {L"SimSun", simplifiedChineseCodepage}},
         {L"simsun", {L"\x5B8B\x4F53", simplifiedChineseCodepage}},
+        // 宋体-ExtB, SimSun-ExtB
+        {L"\x5B8B\x4F53-ExtB", {L"SimSun-ExtB", simplifiedChineseCodepage}},
+        {L"simsun-extb", {L"\x5B8B\x4F53-extb", simplifiedChineseCodepage}},
         // 黑体, SimHei
         {L"\x9ED1\x4F53", {L"SimHei", simplifiedChineseCodepage}},
         {L"simhei", {L"\x9ED1\x4F53", simplifiedChineseCodepage}},
@@ -164,9 +167,15 @@
         // 新細明體, PMingLiu
         {L"\x65B0\x7D30\x660E\x9AD4", {L"PMingLiu", traditionalChineseCodepage}},
         {L"pmingliu", {L"\x65B0\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
+        // 新細明體-ExtB, PMingLiu-ExtB
+        {L"\x65B0\x7D30\x660E\x9AD4-ExtB", {L"PMingLiu-ExtB", traditionalChineseCodepage}},
+        {L"pmingliu-extb", {L"\x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
         // 細明體, MingLiu
         {L"\x7D30\x660E\x9AD4", {L"MingLiu", traditionalChineseCodepage}},
         {L"mingliu", {L"\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
+        // 細明體-ExtB, MingLiu-ExtB
+        {L"\x7D30\x660E\x9AD4-ExtB", {L"MingLiu-ExtB", traditionalChineseCodepage}},
+        {L"mingliu-extb", {L"x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
         // 微軟正黑體, Microsoft JhengHei
         {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", {L"Microsoft JhengHei", traditionalChineseCodepage}},
         {L"microsoft jhengHei", {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", traditionalChineseCodepage}},
@@ -363,8 +372,10 @@
         L"lucida sans unicode",
         L"microsoft sans serif",
         L"palatino linotype",
-        // Four fonts below (and code2000 at the end) are not from MS, but
+        // Six fonts below (and code2000 at the end) are not from MS, but
         // once installed, cover a very wide range of characters.
+        L"dejavu serif",
+        L"dejavu sasns",
         L"freeserif",
         L"freesans",
         L"gentium",
diff --git a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
index 03d23c7..ececd13 100644
--- a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
@@ -33,7 +33,6 @@
 
 #include "AtomicString.h"
 #include "ChromiumBridge.h"
-#include "CString.h"
 #include "Font.h"
 #include "FontDescription.h"
 #include "FontPlatformData.h"
@@ -47,6 +46,7 @@
 
 #include <unicode/utf16.h>
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -107,7 +107,9 @@
     const char* name = 0;
     CString s;
 
-    if (family.length() == 0) {
+    // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
+    // the fallback name (like "monospace") that fontconfig understands.
+    if (!family.length() || family.startsWith("-webkit-")) {
         static const struct {
             FontDescription::GenericFamilyType mType;
             const char* mName;
@@ -145,6 +147,7 @@
 
     FontPlatformData* result =
         new FontPlatformData(tf,
+                             name,
                              fontDescription.computedSize(),
                              (style & SkTypeface::kBold) && !tf->isBold(),
                              (style & SkTypeface::kItalic) && !tf->isItalic());
diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
index 9f8f354..9538a8d 100644
--- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
@@ -503,7 +503,7 @@
     context->canvas()->endPlatformPaint();
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
 {
     UniscribeHelperTextRun state(run, *this);
     return static_cast<float>(state.width());
diff --git a/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp b/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
index 6432e17..74f1e26 100644
--- a/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/chromium/FontCustomPlatformData.cpp
@@ -101,7 +101,7 @@
     return FontPlatformData(hfont, size);
 #elif OS(LINUX)
     ASSERT(m_fontReference);
-    return FontPlatformData(m_fontReference, size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
+    return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
 #else
     notImplemented();
     return FontPlatformData();
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index e76eca8..fa549cd 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -521,7 +521,7 @@
     }
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
 {
     TextRunWalker walker(run, 0, this);
     return walker.widthOfFullRun();
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
index bf4697f..2475e65 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "FontPlatformData.h"
 
+#include "ChromiumBridge.h"
 #include "HarfbuzzSkia.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
@@ -66,31 +67,37 @@
 
 FontPlatformData::FontPlatformData(const FontPlatformData& src)
     : m_typeface(src.m_typeface)
+    , m_family(src.m_family)
     , m_textSize(src.m_textSize)
     , m_fakeBold(src.m_fakeBold)
     , m_fakeItalic(src.m_fakeItalic)
+    , m_style(src.m_style)
     , m_harfbuzzFace(src.m_harfbuzzFace)
 {
     m_typeface->safeRef();
 }
 
-FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize, bool fakeBold, bool fakeItalic)
+FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float textSize, bool fakeBold, bool fakeItalic)
     : m_typeface(tf)
+    , m_family(family)
     , m_textSize(textSize)
     , m_fakeBold(fakeBold)
     , m_fakeItalic(fakeItalic)
 {
     m_typeface->safeRef();
+    querySystemForRenderStyle();
 }
 
 FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
     : m_typeface(src.m_typeface)
+    , m_family(src.m_family)
     , m_textSize(textSize)
     , m_fakeBold(src.m_fakeBold)
     , m_fakeItalic(src.m_fakeItalic)
     , m_harfbuzzFace(src.m_harfbuzzFace)
 {
     m_typeface->safeRef();
+    querySystemForRenderStyle();
 }
 
 FontPlatformData::~FontPlatformData()
@@ -102,10 +109,12 @@
 {
     SkRefCnt_SafeAssign(m_typeface, src.m_typeface);
 
+    m_family = src.m_family;
     m_textSize = src.m_textSize;
     m_fakeBold = src.m_fakeBold;
     m_fakeItalic = src.m_fakeItalic;
     m_harfbuzzFace = src.m_harfbuzzFace;
+    m_style = src.m_style;
 
     return *this;
 }
@@ -121,13 +130,26 @@
 {
     const float ts = m_textSize > 0 ? m_textSize : 12;
 
-    paint->setAntiAlias(isSkiaAntiAlias);
-    paint->setHinting(skiaHinting);
-    paint->setLCDRenderText(isSkiaSubpixelGlyphs);
+    paint->setAntiAlias(m_style.useAntiAlias == FontRenderStyle::NoPreference ? isSkiaAntiAlias : m_style.useAntiAlias);
+    switch (m_style.useHinting) {
+    case FontRenderStyle::NoPreference:
+        paint->setHinting(skiaHinting);
+        break;
+    case 0:
+        paint->setHinting(SkPaint::kNo_Hinting);
+        break;
+    default:
+        paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle));
+        break;
+    }
+
     paint->setTextSize(SkFloatToScalar(ts));
     paint->setTypeface(m_typeface);
     paint->setFakeBoldText(m_fakeBold);
     paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
+
+    if (m_style.useAntiAlias == 1 || m_style.useAntiAlias == FontRenderStyle::NoPreference && isSkiaAntiAlias)
+        paint->setLCDRenderText(m_style.useSubpixel == FontRenderStyle::NoPreference ? isSkiaSubpixelGlyphs : m_style.useSubpixel);
 }
 
 SkFontID FontPlatformData::uniqueID() const
@@ -184,4 +206,21 @@
     return m_harfbuzzFace->face();
 }
 
+void FontPlatformData::querySystemForRenderStyle()
+{
+    if (!m_family.length()) {
+        // We don't have a family for this. Probably because it's a webfont. We
+        // set all the values to 'no preference' and take the defaults passed
+        // in from XSETTINGS.
+        m_style.useBitmaps = FontRenderStyle::NoPreference;
+        m_style.useAutoHint = FontRenderStyle::NoPreference;
+        m_style.useHinting = FontRenderStyle::NoPreference;
+        m_style.useAntiAlias = FontRenderStyle::NoPreference;
+        m_style.useSubpixel = FontRenderStyle::NoPreference;
+        return;
+    }
+
+    ChromiumBridge::getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3), &m_style);
+}
+
 }  // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
index 29ce8e7..e2abe2e 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
@@ -31,8 +31,10 @@
 #ifndef FontPlatformDataLinux_h
 #define FontPlatformDataLinux_h
 
+#include "FontRenderStyle.h"
 #include "StringImpl.h"
 #include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
 #include <SkPaint.h>
 
 class SkTypeface;
@@ -79,7 +81,7 @@
         { }
 
     FontPlatformData(const FontPlatformData&);
-    FontPlatformData(SkTypeface*, float textSize, bool fakeBold, bool fakeItalic);
+    FontPlatformData(SkTypeface*, const char* name, float textSize, bool fakeBold, bool fakeItalic);
     FontPlatformData(const FontPlatformData& src, float textSize);
     ~FontPlatformData();
 
@@ -140,11 +142,15 @@
         HB_FaceRec_* m_harfbuzzFace;
     };
 
+    void querySystemForRenderStyle();
+
     // FIXME: Could SkAutoUnref be used here?
     SkTypeface* m_typeface;
+    CString m_family;
     float m_textSize;
     bool m_fakeBold;
     bool m_fakeItalic;
+    FontRenderStyle m_style;
     mutable RefPtr<RefCountedHarfbuzzFace> m_harfbuzzFace;
 
     SkTypeface* hashTableDeletedFontValue() const { return reinterpret_cast<SkTypeface*>(-1); }
diff --git a/WebCore/platform/graphics/chromium/FontRenderStyle.h b/WebCore/platform/graphics/chromium/FontRenderStyle.h
new file mode 100644
index 0000000..1a3c736
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/FontRenderStyle.h
@@ -0,0 +1,56 @@
+/* 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 FontRenderStyle_h
+#define FontRenderStyle_h
+
+namespace WebCore {
+
+// FontRenderStyle describes the user's preferences for rendering a font at a
+// given size.
+struct FontRenderStyle {
+    enum {
+        NoPreference = 2,
+    };
+
+    // Each of the use* members below can take one of three values:
+    //   0: off
+    //   1: on
+    //   NoPreference: no preference expressed
+    char useBitmaps; // use embedded bitmap strike if possible
+    char useAutoHint; // use 'auto' hinting (FreeType specific)
+    char useHinting; // hint glyphs to the pixel grid
+    char hintStyle; // level of hinting, 0..3
+    char useAntiAlias; // antialias glyph shapes
+    char useSubpixel; // use subpixel antialias
+};
+
+}
+
+#endif // FontRenderStyle_h
diff --git a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
index 4e2a226..8dba49e 100644
--- a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
@@ -60,6 +60,7 @@
         {USCRIPT_GREEK, L"times new roman"},
         {USCRIPT_CYRILLIC, L"times new roman"},
         {USCRIPT_SIMPLIFIED_HAN, L"simsun"},
+        {USCRIPT_TRADITIONAL_HAN, L"pmingliu"},
         {USCRIPT_HIRAGANA, L"ms pgothic"},
         {USCRIPT_KATAKANA, L"ms pgothic"},
         {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"},
@@ -106,14 +107,10 @@
         localeFamily = scriptFontMap[USCRIPT_HIRAGANA];
     else if (locale == icu::Locale::getKorean())
         localeFamily = scriptFontMap[USCRIPT_HANGUL];
+    else if (locale == icu::Locale::getTraditionalChinese())
+        localeFamily = scriptFontMap[USCRIPT_TRADITIONAL_HAN];
     else {
-        // Use Simplified Chinese font for all other locales including
-        // Traditional Chinese because Simsun (SC font) has a wider
-        // coverage (covering both SC and TC) than PMingLiu (TC font).
-        // Note that |fontMap| does not have a separate entry for
-        // USCRIPT_TRADITIONAL_HAN for that reason.
-        // This also speeds up the TC version of Chrome when rendering SC
-        // pages.
+        // For other locales, use the simplified Chinese font for Han.
         localeFamily = scriptFontMap[USCRIPT_SIMPLIFIED_HAN];
     }
     if (localeFamily)
@@ -270,16 +267,27 @@
     if (script == USCRIPT_COMMON)
         script = getScriptBasedOnUnicodeBlock(ucs4);
 
-    // Another lame work-around to cover non-BMP characters.
     const UChar* family = getFontFamilyForScript(script, generic);
-    if (!family) {
+    // Another lame work-around to cover non-BMP characters.
+    // If the font family for script is not found or the character is
+    // not in BMP (> U+FFFF), we resort to the hard-coded list of
+    // fallback fonts for now.
+    if (!family || ucs4 > 0xFFFF) {
         int plane = ucs4 >> 16;
         switch (plane) {
         case 1:
             family = L"code2001";
             break;
         case 2:
-            family = L"simsun-extb";
+            // Use a Traditional Chinese ExtB font if in Traditional Chinese locale.
+            // Otherwise, use a Simplified Chinese ExtB font. Windows Japanese
+            // fonts do support a small subset of ExtB (that are included in JIS X 0213),
+            // but its coverage is rather sparse.
+            // Eventually, this should be controlled by lang/xml:lang.
+            if (icu::Locale::getDefault() == icu::Locale::getTraditionalChinese())
+              family = L"pmingliu-extb";
+            else
+              family = L"simsun-extb";
             break;
         default:
             family = L"lucida sans unicode";
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
new file mode 100644
index 0000000..1227a6a
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -0,0 +1,561 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 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:
+ *
+ *     * 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.
+ */
+
+
+/** FIXME
+ * This file borrows code heavily from platform/graphics/win/GraphicsLayerCACF.cpp
+ * (and hence it includes both copyrights)
+ * Ideally the common code (mostly the code that keeps track of the layer hierarchy)
+ * should be kept separate and shared between platforms. It would be a well worthwhile
+ * effort once the Windows implementation (binaries and headers) of CoreAnimation is
+ * checked in to the WebKit repository. Until then only Apple can make this happen.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "GraphicsLayerChromium.h"
+
+#include "FloatConversion.h"
+#include "FloatRect.h"
+#include "Image.h"
+#include "LayerChromium.h"
+#include "PlatformString.h"
+#include "SystemTime.h"
+#include <wtf/CurrentTime.h>
+#include <wtf/StringExtras.h>
+#include <wtf/text/CString.h>
+
+using namespace std;
+
+namespace WebCore {
+
+static void setLayerBorderColor(LayerChromium& layer, const Color& color)
+{
+    layer.setBorderColor(color);
+}
+
+static void clearBorderColor(LayerChromium& layer)
+{
+    layer.setBorderColor(0);
+}
+
+static void setLayerBackgroundColor(LayerChromium& layer, const Color& color)
+{
+    layer.setBackgroundColor(color);
+}
+
+static void clearLayerBackgroundColor(LayerChromium& layer)
+{
+    layer.setBackgroundColor(0);
+}
+
+GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayer::compositingCoordinatesOrientation()
+{
+    return CompositingCoordinatesBottomUp;
+}
+
+PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
+{
+    return new GraphicsLayerChromium(client);
+}
+
+GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client)
+    : GraphicsLayer(client)
+    , m_contentsLayerPurpose(NoContentsLayer)
+    , m_contentsLayerHasBackgroundColor(false)
+{
+    m_layer = LayerChromium::create(LayerChromium::Layer, this);
+
+    updateDebugIndicators();
+}
+
+GraphicsLayerChromium::~GraphicsLayerChromium()
+{
+    // Clean up the Skia layer.
+    if (m_layer)
+        m_layer->removeFromSuperlayer();
+
+    if (m_transformLayer)
+        m_transformLayer->removeFromSuperlayer();
+}
+
+void GraphicsLayerChromium::setName(const String& inName)
+{
+    String name = String::format("GraphicsLayerChromium(%p) GraphicsLayer(%p) ", m_layer.get(), this) + inName;
+    GraphicsLayer::setName(name);
+}
+
+NativeLayer GraphicsLayerChromium::nativeLayer() const
+{
+    return m_layer.get();
+}
+
+bool GraphicsLayerChromium::setChildren(const Vector<GraphicsLayer*>& children)
+{
+    bool childrenChanged = GraphicsLayer::setChildren(children);
+    // FIXME: GraphicsLayer::setChildren calls addChild() for each sublayer, which
+    // will end up calling updateSublayerList() N times.
+    if (childrenChanged)
+        updateSublayerList();
+
+    return childrenChanged;
+}
+
+void GraphicsLayerChromium::addChild(GraphicsLayer* childLayer)
+{
+    GraphicsLayer::addChild(childLayer);
+    updateSublayerList();
+}
+
+void GraphicsLayerChromium::addChildAtIndex(GraphicsLayer* childLayer, int index)
+{
+    GraphicsLayer::addChildAtIndex(childLayer, index);
+    updateSublayerList();
+}
+
+void GraphicsLayerChromium::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
+{
+    GraphicsLayer::addChildBelow(childLayer, sibling);
+    updateSublayerList();
+}
+
+void GraphicsLayerChromium::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer *sibling)
+{
+    GraphicsLayer::addChildAbove(childLayer, sibling);
+    updateSublayerList();
+}
+
+bool GraphicsLayerChromium::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
+{
+    if (GraphicsLayer::replaceChild(oldChild, newChild)) {
+        updateSublayerList();
+        return true;
+    }
+    return false;
+}
+
+void GraphicsLayerChromium::removeFromParent()
+{
+    GraphicsLayer::removeFromParent();
+    layerForSuperlayer()->removeFromSuperlayer();
+}
+
+void GraphicsLayerChromium::setPosition(const FloatPoint& point)
+{
+    GraphicsLayer::setPosition(point);
+    updateLayerPosition();
+}
+
+void GraphicsLayerChromium::setAnchorPoint(const FloatPoint3D& point)
+{
+    if (point == m_anchorPoint)
+        return;
+
+    GraphicsLayer::setAnchorPoint(point);
+    updateAnchorPoint();
+}
+
+void GraphicsLayerChromium::setSize(const FloatSize& size)
+{
+    if (size == m_size)
+        return;
+
+    GraphicsLayer::setSize(size);
+    updateLayerSize();
+}
+
+void GraphicsLayerChromium::setTransform(const TransformationMatrix& transform)
+{
+    if (transform == m_transform)
+        return;
+
+    GraphicsLayer::setTransform(transform);
+    updateTransform();
+}
+
+void GraphicsLayerChromium::setChildrenTransform(const TransformationMatrix& transform)
+{
+    if (transform == m_childrenTransform)
+        return;
+
+    GraphicsLayer::setChildrenTransform(transform);
+    updateChildrenTransform();
+}
+
+void GraphicsLayerChromium::setPreserves3D(bool preserves3D)
+{
+    if (preserves3D == m_preserves3D)
+        return;
+
+    GraphicsLayer::setPreserves3D(preserves3D);
+    updateLayerPreserves3D();
+}
+
+void GraphicsLayerChromium::setMasksToBounds(bool masksToBounds)
+{
+    if (masksToBounds == m_masksToBounds)
+        return;
+
+    GraphicsLayer::setMasksToBounds(masksToBounds);
+    updateMasksToBounds();
+}
+
+void GraphicsLayerChromium::setDrawsContent(bool drawsContent)
+{
+    if (drawsContent == m_drawsContent)
+        return;
+
+    GraphicsLayer::setDrawsContent(drawsContent);
+    updateLayerDrawsContent();
+}
+
+void GraphicsLayerChromium::setBackgroundColor(const Color& color)
+{
+    if (m_backgroundColorSet && m_backgroundColor == color)
+        return;
+
+    GraphicsLayer::setBackgroundColor(color);
+
+    m_contentsLayerHasBackgroundColor = true;
+    updateLayerBackgroundColor();
+}
+
+void GraphicsLayerChromium::clearBackgroundColor()
+{
+    if (!m_backgroundColorSet)
+        return;
+
+    GraphicsLayer::clearBackgroundColor();
+    clearLayerBackgroundColor(*m_contentsLayer);
+}
+
+void GraphicsLayerChromium::setContentsOpaque(bool opaque)
+{
+    if (m_contentsOpaque == opaque)
+        return;
+
+    GraphicsLayer::setContentsOpaque(opaque);
+    updateContentsOpaque();
+}
+
+void GraphicsLayerChromium::setBackfaceVisibility(bool visible)
+{
+    if (m_backfaceVisibility == visible)
+        return;
+
+    GraphicsLayer::setBackfaceVisibility(visible);
+    updateBackfaceVisibility();
+}
+
+void GraphicsLayerChromium::setOpacity(float opacity)
+{
+    float clampedOpacity = max(min(opacity, 1.0f), 0.0f);
+
+    if (m_opacity == clampedOpacity)
+        return;
+
+    GraphicsLayer::setOpacity(clampedOpacity);
+    primaryLayer()->setOpacity(opacity);
+}
+
+void GraphicsLayerChromium::setNeedsDisplay()
+{
+    if (drawsContent())
+        m_layer->setNeedsDisplay();
+}
+
+void GraphicsLayerChromium::setNeedsDisplayInRect(const FloatRect& rect)
+{
+    if (drawsContent())
+        m_layer->setNeedsDisplay(rect);
+}
+
+void GraphicsLayerChromium::setContentsRect(const IntRect& rect)
+{
+    if (rect == m_contentsRect)
+        return;
+
+    GraphicsLayer::setContentsRect(rect);
+    updateContentsRect();
+}
+
+void GraphicsLayerChromium::setContentsToImage(Image* image)
+{
+    // FIXME: Implement
+}
+
+void GraphicsLayerChromium::setContentsToVideo(PlatformLayer* videoLayer)
+{
+    // FIXME: Implement
+}
+
+void GraphicsLayerChromium::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
+{
+    if (orientation == m_geometryOrientation)
+        return;
+
+    GraphicsLayer::setGeometryOrientation(orientation);
+    updateGeometryOrientation();
+}
+
+PlatformLayer* GraphicsLayerChromium::hostLayerForSublayers() const
+{
+    return m_transformLayer ? m_transformLayer.get() : m_layer.get();
+}
+
+PlatformLayer* GraphicsLayerChromium::layerForSuperlayer() const
+{
+    return m_transformLayer ? m_transformLayer.get() : m_layer.get();
+}
+
+PlatformLayer* GraphicsLayerChromium::platformLayer() const
+{
+    return primaryLayer();
+}
+
+void GraphicsLayerChromium::setDebugBackgroundColor(const Color& color)
+{
+    if (color.isValid())
+        setLayerBackgroundColor(*m_layer, color);
+    else
+        clearLayerBackgroundColor(*m_layer);
+}
+
+void GraphicsLayerChromium::setDebugBorder(const Color& color, float borderWidth)
+{
+    if (color.isValid()) {
+        setLayerBorderColor(*m_layer, color);
+        m_layer->setBorderWidth(borderWidth);
+    } else {
+        clearBorderColor(*m_layer);
+        m_layer->setBorderWidth(0);
+    }
+}
+
+void GraphicsLayerChromium::updateSublayerList()
+{
+    Vector<RefPtr<LayerChromium> > newSublayers;
+
+    if (m_transformLayer) {
+        // Add the primary layer first. Even if we have negative z-order children, the primary layer always comes behind.
+        newSublayers.append(m_layer.get());
+    } else if (m_contentsLayer) {
+        // FIXME: add the contents layer in the correct order with negative z-order children.
+        // This does not cause visible rendering issues because currently contents layers are only used
+        // for replaced elements that don't have children.
+        newSublayers.append(m_contentsLayer.get());
+    }
+
+    const Vector<GraphicsLayer*>& childLayers = children();
+    size_t numChildren = childLayers.size();
+    for (size_t i = 0; i < numChildren; ++i) {
+        GraphicsLayerChromium* curChild = static_cast<GraphicsLayerChromium*>(childLayers[i]);
+
+        LayerChromium* childLayer = curChild->layerForSuperlayer();
+        newSublayers.append(childLayer);
+    }
+
+    for (size_t i = 0; i < newSublayers.size(); ++i)
+        newSublayers[i]->removeFromSuperlayer();
+
+    if (m_transformLayer) {
+        m_transformLayer->setSublayers(newSublayers);
+
+        if (m_contentsLayer) {
+            // If we have a transform layer, then the contents layer is parented in the
+            // primary layer (which is itself a child of the transform layer).
+            m_layer->removeAllSublayers();
+            m_layer->addSublayer(m_contentsLayer);
+        }
+    } else
+        m_layer->setSublayers(newSublayers);
+}
+
+void GraphicsLayerChromium::updateLayerPosition()
+{
+    // Position is offset on the layer by the layer anchor point.
+    FloatPoint layerPosition(m_position.x() + m_anchorPoint.x() * m_size.width(),
+                             m_position.y() + m_anchorPoint.y() * m_size.height());
+
+    primaryLayer()->setPosition(layerPosition);
+}
+
+void GraphicsLayerChromium::updateLayerSize()
+{
+    IntSize layerSize(m_size.width(), m_size.height());
+    if (m_transformLayer) {
+        m_transformLayer->setBounds(layerSize);
+        // The anchor of the contents layer is always at 0.5, 0.5, so the position is center-relative.
+        FloatPoint centerPoint(m_size.width() / 2, m_size.height() / 2);
+        m_layer->setPosition(centerPoint);
+    }
+
+    m_layer->setBounds(layerSize);
+
+    // Note that we don't resize m_contentsLayer. It's up the caller to do that.
+
+    // If we've changed the bounds, we need to recalculate the position
+    // of the layer, taking anchor point into account.
+    updateLayerPosition();
+}
+
+void GraphicsLayerChromium::updateAnchorPoint()
+{
+    primaryLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
+    primaryLayer()->setAnchorPointZ(m_anchorPoint.z());
+    updateLayerPosition();
+}
+
+void GraphicsLayerChromium::updateTransform()
+{
+    primaryLayer()->setTransform(m_transform);
+}
+
+void GraphicsLayerChromium::updateChildrenTransform()
+{
+    primaryLayer()->setSublayerTransform(m_childrenTransform);
+}
+
+void GraphicsLayerChromium::updateMasksToBounds()
+{
+    m_layer->setMasksToBounds(m_masksToBounds);
+    updateDebugIndicators();
+}
+
+void GraphicsLayerChromium::updateContentsOpaque()
+{
+    m_layer->setOpaque(m_contentsOpaque);
+}
+
+void GraphicsLayerChromium::updateBackfaceVisibility()
+{
+    m_layer->setDoubleSided(m_backfaceVisibility);
+}
+
+void GraphicsLayerChromium::updateLayerPreserves3D()
+{
+    // FIXME: implement
+}
+
+void GraphicsLayerChromium::updateLayerDrawsContent()
+{
+    if (m_drawsContent)
+        m_layer->setNeedsDisplay();
+
+    updateDebugIndicators();
+}
+
+void GraphicsLayerChromium::updateLayerBackgroundColor()
+{
+    if (!m_contentsLayer)
+        return;
+
+    // We never create the contents layer just for background color yet.
+    if (m_backgroundColorSet)
+        setLayerBackgroundColor(*m_contentsLayer, m_backgroundColor);
+    else
+        clearLayerBackgroundColor(*m_contentsLayer);
+}
+
+void GraphicsLayerChromium::updateContentsImage()
+{
+    // FIXME: Implement
+}
+
+void GraphicsLayerChromium::updateContentsVideo()
+{
+    // FIXME: Implement
+}
+
+void GraphicsLayerChromium::updateContentsRect()
+{
+    if (!m_contentsLayer)
+        return;
+
+    m_contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
+    m_contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
+}
+
+void GraphicsLayerChromium::updateGeometryOrientation()
+{
+    switch (geometryOrientation()) {
+    case CompositingCoordinatesTopDown:
+        m_layer->setGeometryFlipped(false);
+        break;
+
+    case CompositingCoordinatesBottomUp:
+        m_layer->setGeometryFlipped(true);
+        break;
+    }
+    // Geometry orientation is mapped onto children transform in older QuartzCores,
+    // so is handled via setGeometryOrientation().
+}
+
+void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
+{
+    if (contentsLayer == m_contentsLayer)
+        return;
+
+    if (m_contentsLayer) {
+        m_contentsLayer->removeFromSuperlayer();
+        m_contentsLayer = 0;
+    }
+
+    if (contentsLayer) {
+        m_contentsLayer = contentsLayer;
+
+        m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
+
+        // Insert the content layer first. Video elements require this, because they have
+        // shadow content that must display in front of the video.
+        m_layer->insertSublayer(m_contentsLayer.get(), 0);
+
+        updateContentsRect();
+
+        if (showDebugBorders()) {
+            setLayerBorderColor(*m_contentsLayer, Color(0, 0, 128, 180));
+            m_contentsLayer->setBorderWidth(1);
+        }
+    }
+    updateDebugIndicators();
+}
+
+// This function simply mimics the operation of GraphicsLayerCA
+void GraphicsLayerChromium::updateOpacityOnLayer()
+{
+    primaryLayer()->setOpacity(m_opacity);
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
new file mode 100644
index 0000000..03a6d41
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -0,0 +1,149 @@
+/*
+ * 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 GraphicsLayerChromium_h
+#define GraphicsLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "GraphicsContext.h"
+#include "GraphicsLayer.h"
+
+namespace WebCore {
+
+class LayerChromium;
+
+class GraphicsLayerChromium : public GraphicsLayer {
+public:
+    GraphicsLayerChromium(GraphicsLayerClient*);
+    virtual ~GraphicsLayerChromium();
+
+    virtual void setName(const String&);
+
+    // for hosting this GraphicsLayer in a native layer hierarchy
+    virtual NativeLayer nativeLayer() const;
+
+    virtual bool setChildren(const Vector<GraphicsLayer*>&);
+    virtual void addChild(GraphicsLayer*);
+    virtual void addChildAtIndex(GraphicsLayer*, int index);
+    virtual void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling);
+    virtual void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling);
+    virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
+
+    virtual void removeFromParent();
+
+    virtual void setPosition(const FloatPoint&);
+    virtual void setAnchorPoint(const FloatPoint3D&);
+    virtual void setSize(const FloatSize&);
+
+    virtual void setTransform(const TransformationMatrix&);
+
+    virtual void setChildrenTransform(const TransformationMatrix&);
+
+    virtual void setPreserves3D(bool);
+    virtual void setMasksToBounds(bool);
+    virtual void setDrawsContent(bool);
+
+    virtual void setBackgroundColor(const Color&);
+    virtual void clearBackgroundColor();
+
+    virtual void setContentsOpaque(bool);
+    virtual void setBackfaceVisibility(bool);
+
+    virtual void setOpacity(float);
+
+    virtual void setNeedsDisplay();
+    virtual void setNeedsDisplayInRect(const FloatRect&);
+
+    virtual void setContentsRect(const IntRect&);
+
+    virtual void setContentsToImage(Image*);
+    virtual void setContentsToVideo(PlatformLayer*);
+
+    virtual PlatformLayer* platformLayer() const;
+
+    virtual void setDebugBackgroundColor(const Color&);
+    virtual void setDebugBorder(const Color&, float borderWidth);
+
+    virtual void setGeometryOrientation(CompositingCoordinatesOrientation);
+
+    void notifySyncRequired()
+    {
+        if (m_client)
+            m_client->notifySyncRequired(this);
+    }
+
+private:
+    void updateOpacityOnLayer();
+
+    LayerChromium* primaryLayer() const  { return m_transformLayer.get() ? m_transformLayer.get() : m_layer.get(); }
+    LayerChromium* hostLayerForSublayers() const;
+    LayerChromium* layerForSuperlayer() const;
+
+    void updateSublayerList();
+    void updateLayerPosition();
+    void updateLayerSize();
+    void updateAnchorPoint();
+    void updateTransform();
+    void updateChildrenTransform();
+    void updateMasksToBounds();
+    void updateContentsOpaque();
+    void updateBackfaceVisibility();
+    void updateLayerPreserves3D();
+    void updateLayerDrawsContent();
+    void updateLayerBackgroundColor();
+
+    void updateContentsImage();
+    void updateContentsVideo();
+    void updateContentsRect();
+    void updateGeometryOrientation();
+
+    void setupContentsLayer(LayerChromium*);
+    LayerChromium* contentsLayer() const { return m_contentsLayer.get(); }
+
+    RefPtr<LayerChromium> m_layer;
+    RefPtr<LayerChromium> m_transformLayer;
+    RefPtr<LayerChromium> m_contentsLayer;
+
+    enum ContentsLayerPurpose {
+        NoContentsLayer = 0,
+        ContentsLayerForImage,
+        ContentsLayerForVideo
+    };
+
+    ContentsLayerPurpose m_contentsLayerPurpose;
+    bool m_contentsLayerHasBackgroundColor : 1;
+};
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/IconChromiumLinux.cpp b/WebCore/platform/graphics/chromium/IconChromiumLinux.cpp
index 1386163..16f55e2 100644
--- a/WebCore/platform/graphics/chromium/IconChromiumLinux.cpp
+++ b/WebCore/platform/graphics/chromium/IconChromiumLinux.cpp
@@ -46,12 +46,6 @@
 {
 }
 
-PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
-{
-    notImplemented();
-    return 0;
-}
-
 void Icon::paint(GraphicsContext*, const IntRect&)
 {
     notImplemented();
diff --git a/WebCore/platform/graphics/chromium/IconChromiumMac.cpp b/WebCore/platform/graphics/chromium/IconChromiumMac.cpp
index 23ca698..a24afb2 100644
--- a/WebCore/platform/graphics/chromium/IconChromiumMac.cpp
+++ b/WebCore/platform/graphics/chromium/IconChromiumMac.cpp
@@ -39,11 +39,6 @@
  
 namespace WebCore {
 
-PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
-{
-    return 0;
-}
-
 Icon::~Icon()
 {
 }
diff --git a/WebCore/platform/graphics/chromium/IconChromiumWin.cpp b/WebCore/platform/graphics/chromium/IconChromiumWin.cpp
index b0145f8..e958d4a 100644
--- a/WebCore/platform/graphics/chromium/IconChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/IconChromiumWin.cpp
@@ -52,13 +52,6 @@
         DestroyIcon(m_icon);
 }
 
-PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
-{
-    // FIXME: We can't access icons directly from renderer processes.
-    // http://code.google.com/p/chromium/issues/detail?id=4092
-    return 0;
-}
-
 void Icon::paint(GraphicsContext* context, const IntRect& rect)
 {
     if (context->paintingDisabled())
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
new file mode 100644
index 0000000..4540ac1
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -0,0 +1,251 @@
+/*
+ * 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 USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+#include "PlatformContextSkia.h"
+#include "RenderLayerBacking.h"
+#include "skia/ext/platform_canvas.h"
+
+namespace WebCore {
+
+using namespace std;
+
+PassRefPtr<LayerChromium> LayerChromium::create(LayerType type, GraphicsLayerChromium* owner)
+{
+    return adoptRef(new LayerChromium(type, owner));
+}
+
+LayerChromium::LayerChromium(LayerType type, GraphicsLayerChromium* owner)
+    : m_needsDisplayOnBoundsChange(false)
+    , m_owner(owner)
+    , m_layerType(type)
+    , m_superlayer(0)
+    , m_borderWidth(0)
+    , m_borderColor(0, 0, 0, 0)
+    , m_backgroundColor(0, 0, 0, 0)
+    , m_anchorPointZ(0)
+    , m_clearsContext(false)
+    , m_doubleSided(false)
+    , m_edgeAntialiasingMask(0)
+    , m_hidden(false)
+    , m_masksToBounds(false)
+    , m_contentsGravity(Bottom)
+    , m_opacity(1.0)
+    , m_opaque(true)
+    , m_zPosition(0.0)
+    , m_canvas(0)
+    , m_skiaContext(0)
+    , m_graphicsContext(0)
+    , m_geometryFlipped(false)
+{
+    updateGraphicsContext(m_backingStoreRect);
+}
+
+LayerChromium::~LayerChromium()
+{
+    // Our superlayer should be holding a reference to us, so there should be no way for us to be destroyed while we still have a superlayer.
+    ASSERT(!superlayer());
+}
+
+void LayerChromium::updateGraphicsContext(const IntSize& size)
+{
+#if PLATFORM(SKIA)
+    // Create new canvas and context. OwnPtr takes care of freeing up
+    // the old ones.
+    m_canvas = new skia::PlatformCanvas(size.width(), size.height(), false);
+    m_skiaContext = new PlatformContextSkia(m_canvas.get());
+
+    // This is needed to get text to show up correctly. Without it,
+    // GDI renders with zero alpha and the text becomes invisible.
+    // Unfortunately, setting this to true disables cleartype.
+    m_skiaContext->setDrawingToImageBuffer(true);
+
+    m_graphicsContext = new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()));
+#else
+#error "Need to implement for your platform."
+#endif
+    // The backing store allocated for a layer can be smaller than the layer's bounds.
+    // This is mostly true for the root layer whose backing store is sized based on the visible
+    // portion of the layer rather than the actual page size.
+    m_backingStoreRect = size;
+}
+
+void LayerChromium::updateContents()
+{
+    RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_owner->client());
+
+    if (backing && !backing->paintingGoesToWindow())
+        m_owner->paintGraphicsLayerContents(*m_graphicsContext, IntRect(0, 0, m_bounds.width(), m_bounds.height()));
+}
+
+void LayerChromium::drawDebugBorder()
+{
+    m_graphicsContext->setStrokeColor(m_borderColor, DeviceColorSpace);
+    m_graphicsContext->setStrokeThickness(m_borderWidth);
+    m_graphicsContext->drawLine(IntPoint(0, 0), IntPoint(m_bounds.width(), 0));
+    m_graphicsContext->drawLine(IntPoint(0, 0), IntPoint(0, m_bounds.height()));
+    m_graphicsContext->drawLine(IntPoint(m_bounds.width(), 0), IntPoint(m_bounds.width(), m_bounds.height()));
+    m_graphicsContext->drawLine(IntPoint(0, m_bounds.height()), IntPoint(m_bounds.width(), m_bounds.height()));
+}
+
+void LayerChromium::setNeedsCommit()
+{
+    // Call notifySyncRequired(), which in this implementation plumbs through to
+    // call setRootLayerNeedsDisplay() on the WebView, which will cause LayerRendererSkia
+    // to render a frame.
+    if (m_owner)
+        m_owner->notifySyncRequired();
+}
+
+void LayerChromium::addSublayer(PassRefPtr<LayerChromium> sublayer)
+{
+    insertSublayer(sublayer, numSublayers());
+}
+
+void LayerChromium::insertSublayer(PassRefPtr<LayerChromium> sublayer, size_t index)
+{
+    index = min(index, m_sublayers.size());
+    m_sublayers.insert(index, sublayer);
+    sublayer->setSuperlayer(this);
+    setNeedsCommit();
+}
+
+void LayerChromium::removeFromSuperlayer()
+{
+    LayerChromium* superlayer = this->superlayer();
+    if (!superlayer)
+        return;
+
+    superlayer->removeSublayer(this);
+}
+
+void LayerChromium::removeSublayer(LayerChromium* sublayer)
+{
+    int foundIndex = indexOfSublayer(sublayer);
+    if (foundIndex == -1)
+        return;
+
+    m_sublayers.remove(foundIndex);
+    sublayer->setSuperlayer(0);
+    setNeedsCommit();
+}
+
+int LayerChromium::indexOfSublayer(const LayerChromium* reference)
+{
+    for (size_t i = 0; i < m_sublayers.size(); i++) {
+        if (m_sublayers[i] == reference)
+            return i;
+    }
+    return -1;
+}
+
+void LayerChromium::setBackingStoreRect(const IntSize& rect)
+{
+    if (m_backingStoreRect == rect)
+        return;
+
+    updateGraphicsContext(rect);
+}
+
+void LayerChromium::setBounds(const IntSize& rect)
+{
+    if (rect == m_bounds)
+        return;
+
+    m_bounds = rect;
+
+    // Re-create the canvas and associated contexts.
+    updateGraphicsContext(m_bounds);
+
+    // Layer contents need to be redrawn as the backing surface
+    // was recreated above.
+    updateContents();
+
+    setNeedsCommit();
+}
+
+void LayerChromium::setFrame(const FloatRect& rect)
+{
+    if (rect == m_frame)
+      return;
+
+    m_frame = rect;
+    setNeedsCommit();
+}
+
+const LayerChromium* LayerChromium::rootLayer() const
+{
+    const LayerChromium* layer = this;
+    for (LayerChromium* superlayer = layer->superlayer(); superlayer; layer = superlayer, superlayer = superlayer->superlayer()) { }
+    return layer;
+}
+
+void LayerChromium::removeAllSublayers()
+{
+    m_sublayers.clear();
+    setNeedsCommit();
+}
+
+void LayerChromium::setSublayers(const Vector<RefPtr<LayerChromium> >& sublayers)
+{
+    m_sublayers = sublayers;
+}
+
+void LayerChromium::setSuperlayer(LayerChromium* superlayer)
+{
+    m_superlayer = superlayer;
+}
+
+LayerChromium* LayerChromium::superlayer() const
+{
+    return m_superlayer;
+}
+
+void LayerChromium::setNeedsDisplay(const FloatRect& dirtyRect)
+{
+    // Redraw the contents of the layer.
+    updateContents();
+
+    setNeedsCommit();
+}
+
+void LayerChromium::setNeedsDisplay()
+{
+    // FIXME: implement
+}
+
+}
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h
new file mode 100644
index 0000000..55b1288
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -0,0 +1,227 @@
+/*
+ * 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 LayerChromium_h
+#define LayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "FloatPoint.h"
+#include "GraphicsContext.h"
+#include "GraphicsLayerChromium.h"
+#include "PlatformString.h"
+#include "StringHash.h"
+#include "TransformationMatrix.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+
+namespace skia {
+class PlatformCanvas;
+}
+
+namespace WebCore {
+
+class LayerChromium : public RefCounted<LayerChromium> {
+public:
+    enum LayerType { Layer, TransformLayer };
+    enum FilterType { Linear, Nearest, Trilinear, Lanczos };
+    enum ContentsGravityType { Center, Top, Bottom, Left, Right, TopLeft, TopRight,
+                               BottomLeft, BottomRight, Resize, ResizeAspect, ResizeAspectFill };
+
+    static PassRefPtr<LayerChromium> create(LayerType, GraphicsLayerChromium* owner = 0);
+
+    ~LayerChromium();
+
+    void display(PlatformGraphicsContext*);
+
+    void addSublayer(PassRefPtr<LayerChromium>);
+    void insertSublayer(PassRefPtr<LayerChromium>, size_t index);
+    void removeFromSuperlayer();
+
+    void setAnchorPoint(const FloatPoint& anchorPoint) { m_anchorPoint = anchorPoint; setNeedsCommit(); }
+    FloatPoint anchorPoint() const { return m_anchorPoint; }
+
+    void setAnchorPointZ(float anchorPointZ) { m_anchorPointZ = anchorPointZ; setNeedsCommit(); }
+    float anchorPointZ() const { return m_anchorPointZ; }
+
+    void setBackgroundColor(const Color& color) { m_backgroundColor = color; setNeedsCommit(); }
+    Color backgroundColor() const { return m_backgroundColor; }
+
+    void setBorderColor(const Color& color) { m_borderColor = color; setNeedsCommit(); }
+    Color borderColor() const { return m_borderColor; }
+
+    void setBorderWidth(float width) { m_borderWidth = width; setNeedsCommit(); }
+    float borderWidth() const { return m_borderWidth; }
+
+    void setBounds(const IntSize&);
+    IntSize bounds() const { return m_bounds; }
+
+    void setClearsContext(bool clears) { m_clearsContext = clears; setNeedsCommit(); }
+    bool clearsContext() const { return m_clearsContext; }
+
+    void setContentsGravity(ContentsGravityType gravityType) { m_contentsGravity = gravityType; setNeedsCommit(); }
+    ContentsGravityType contentsGravity() const { return m_contentsGravity; }
+
+    void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
+    bool doubleSided() const { return m_doubleSided; }
+
+    void setEdgeAntialiasingMask(uint32_t mask) { m_edgeAntialiasingMask = mask; setNeedsCommit(); }
+    uint32_t edgeAntialiasingMask() const { return m_edgeAntialiasingMask; }
+
+    void setFrame(const FloatRect&);
+    FloatRect frame() const { return m_frame; }
+
+    void setHidden(bool hidden) { m_hidden = hidden; setNeedsCommit(); }
+    bool isHidden() const { return m_hidden; }
+
+    void setMasksToBounds(bool masksToBounds) { m_masksToBounds = masksToBounds; }
+    bool masksToBounds() const { return m_masksToBounds; }
+
+    void setName(const String& name) { m_name = name; }
+    String name() const { return m_name; }
+
+    void setNeedsDisplay(const FloatRect& dirtyRect);
+    void setNeedsDisplay();
+
+    void setNeedsDisplayOnBoundsChange(bool needsDisplay) { m_needsDisplayOnBoundsChange = needsDisplay; }
+
+    void setOpacity(float opacity) { m_opacity = opacity; setNeedsCommit(); }
+    float opacity() const { return m_opacity; }
+
+    void setOpaque(bool opaque) { m_opaque = opaque; setNeedsCommit(); }
+    bool opaque() const { return m_opaque; }
+
+    void setPosition(const FloatPoint& position) { m_position = position;  setNeedsCommit(); }
+
+    FloatPoint position() const { return m_position; }
+
+    void setZPosition(float zPosition) { m_zPosition = zPosition; setNeedsCommit(); }
+    float zPosition() const {  return m_zPosition; }
+
+    const LayerChromium* rootLayer() const;
+
+    void removeAllSublayers();
+
+    void setSublayers(const Vector<RefPtr<LayerChromium> >&);
+
+    const Vector<RefPtr<LayerChromium> >& getSublayers() const { return m_sublayers; }
+
+    void setSublayerTransform(const TransformationMatrix& transform) { m_sublayerTransform = transform; setNeedsCommit(); }
+    const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
+
+    void setSuperlayer(LayerChromium* superlayer);
+    LayerChromium* superlayer() const;
+
+
+    void setTransform(const TransformationMatrix& transform) { m_transform = transform; setNeedsCommit(); }
+    const TransformationMatrix& transform() const { return m_transform; }
+
+    void setGeometryFlipped(bool flipped) { m_geometryFlipped = flipped; setNeedsCommit(); }
+    bool geometryFlipped() const { return m_geometryFlipped; }
+
+    void updateContents();
+
+    skia::PlatformCanvas* platformCanvas() { return m_canvas.get(); }
+    GraphicsContext* graphicsContext() { return m_graphicsContext.get(); }
+
+    void setBackingStoreRect(const IntSize&);
+
+    void drawDebugBorder();
+
+private:
+    LayerChromium(LayerType, GraphicsLayerChromium* owner);
+
+    void setNeedsCommit();
+
+    void paintMe();
+
+    size_t numSublayers() const
+    {
+        return m_sublayers.size();
+    }
+
+    // Returns the index of the sublayer or -1 if not found.
+    int indexOfSublayer(const LayerChromium*);
+
+    // This should only be called from removeFromSuperlayer.
+    void removeSublayer(LayerChromium*);
+
+    // Re-create the canvas and graphics context. This method
+    // must be called every time the layer is resized.
+    void updateGraphicsContext(const IntSize&);
+
+    Vector<RefPtr<LayerChromium> > m_sublayers;
+    LayerChromium* m_superlayer;
+
+    GraphicsLayerChromium* m_owner;
+    OwnPtr<skia::PlatformCanvas> m_canvas;
+    OwnPtr<PlatformContextSkia> m_skiaContext;
+    OwnPtr<GraphicsContext> m_graphicsContext;
+
+    LayerType m_layerType;
+
+    IntSize m_bounds;
+    IntSize m_backingStoreRect;
+    FloatPoint m_position;
+    FloatPoint m_anchorPoint;
+    Color m_backgroundColor;
+    Color m_borderColor;
+
+    FloatRect m_frame;
+    TransformationMatrix m_transform;
+    TransformationMatrix m_sublayerTransform;
+
+    uint32_t m_edgeAntialiasingMask;
+    float m_opacity;
+    float m_zPosition;
+    float m_anchorPointZ;
+    float m_borderWidth;
+
+    bool m_clearsContext;
+    bool m_doubleSided;
+    bool m_hidden;
+    bool m_masksToBounds;
+    bool m_opaque;
+    bool m_geometryFlipped;
+    bool m_needsDisplayOnBoundsChange;
+
+    ContentsGravityType m_contentsGravity;
+    String m_name;
+};
+
+}
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
new file mode 100644
index 0000000..722c80c
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -0,0 +1,138 @@
+/*
+ * 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 USE(ACCELERATED_COMPOSITING)
+#include "LayerRendererChromium.h"
+
+#include "LayerChromium.h"
+#include "PlatformContextSkia.h"
+#include "skia/ext/platform_canvas.h"
+
+namespace WebCore {
+
+PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create()
+{
+    return new LayerRendererChromium();
+}
+
+LayerRendererChromium::LayerRendererChromium()
+    : m_rootLayer(0)
+    , m_needsDisplay(false)
+{
+}
+
+LayerRendererChromium::~LayerRendererChromium()
+{
+}
+
+void LayerRendererChromium::updateLayerContents()
+{
+    if (m_rootLayer)
+        updateLayerContentsRecursive(m_rootLayer.get());
+}
+
+#if PLATFORM(SKIA)
+void LayerRendererChromium::drawLayersInCanvas(skia::PlatformCanvas* canvas, const IntRect& clipRect)
+{
+    if (!m_rootLayer)
+        return;
+
+    canvas->save();
+    canvas->clipRect(SkRect(clipRect));
+
+    // First composite the root layer into the canvas.
+    canvas->drawBitmap(m_rootLayer->platformCanvas()->getDevice()->accessBitmap(false), 0, 0, 0);
+
+    // Account for the scroll offset before compositing the remaining layers.
+    // Note that the root layer's painting takes into account the scroll offset already.
+    canvas->translate(-m_scrollFrame.fLeft, -m_scrollFrame.fTop);
+
+    float opacity = 1.0f;
+    const Vector<RefPtr<LayerChromium> >& sublayers = m_rootLayer->getSublayers();
+    for (size_t i = 0; i < sublayers.size(); i++)
+        drawLayerInCanvasRecursive(canvas, sublayers[i].get(), opacity);
+
+    canvas->restore();
+
+    m_needsDisplay = false;
+}
+
+void LayerRendererChromium::drawLayerInCanvasRecursive(skia::PlatformCanvas* canvas, LayerChromium* layer, float opacity)
+{
+    // Guarantees that the canvas is restored to a known state on destruction.
+    SkAutoCanvasRestore autoRestoreCanvas(canvas, true);
+
+    FloatPoint position = layer->position();
+    FloatPoint anchorPoint = layer->anchorPoint();
+    SkMatrix transform = layer->transform().toAffineTransform();
+    IntSize bounds = layer->bounds();
+
+    canvas->translate(position.x(), position.y());
+
+    SkScalar tx = SkScalarMul(anchorPoint.x(), bounds.width());
+    SkScalar ty = SkScalarMul(anchorPoint.y(), bounds.height());
+    canvas->translate(tx, ty);
+    canvas->concat(transform);
+    canvas->translate(-tx, -ty);
+
+    // The position we get is for the center of the layer, but
+    // drawBitmap starts at the upper-left corner, and therefore
+    // we need to adjust our transform.
+    canvas->translate(-0.5f * bounds.width(), -0.5f * bounds.height());
+
+    layer->drawDebugBorder();
+
+    SkPaint opacityPaint;
+    opacity *= layer->opacity();
+    opacityPaint.setAlpha(opacity * 255);
+
+    canvas->drawBitmap(layer->platformCanvas()->getDevice()->accessBitmap(false), 0, 0, &opacityPaint);
+
+    const Vector<RefPtr<LayerChromium> >& sublayers = layer->getSublayers();
+    for (size_t i = 0; i < sublayers.size(); i++)
+        drawLayerInCanvasRecursive(canvas, sublayers[i].get(), opacity);
+}
+#endif // PLATFORM(SKIA)
+
+void LayerRendererChromium::updateLayerContentsRecursive(LayerChromium* layer)
+{
+    layer->updateContents();
+
+    const Vector<RefPtr<LayerChromium> >& sublayers = layer->getSublayers();
+    for (size_t i = 0; i < sublayers.size(); i++)
+        updateLayerContentsRecursive(sublayers[i].get());
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
new file mode 100644
index 0000000..7eb429f
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -0,0 +1,84 @@
+/*
+ * 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 LayerRendererChromium_h
+#define LayerRendererChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "IntRect.h"
+#include "LayerChromium.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace skia {
+class PlatformCanvas;
+}
+
+namespace WebCore {
+
+class LayerRendererChromium : public Noncopyable {
+public:
+    static PassOwnPtr<LayerRendererChromium> create();
+
+    LayerRendererChromium();
+    ~LayerRendererChromium();
+
+#if PLATFORM(SKIA)
+    void drawLayersInCanvas(skia::PlatformCanvas*, const IntRect& clipRect);
+#endif
+    void updateLayerContents();
+
+    void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
+    LayerChromium* rootLayer() { return m_rootLayer.get(); }
+
+    void setNeedsDisplay() { m_needsDisplay = true; }
+
+    void setScrollFrame(SkIRect& scrollFrame) { m_scrollFrame = scrollFrame; }
+
+private:
+#if PLATFORM(SKIA)
+    void drawLayerInCanvasRecursive(skia::PlatformCanvas*, LayerChromium*, float opacity);
+#endif
+    void updateLayerContentsRecursive(LayerChromium*);
+
+    RefPtr<LayerChromium> m_rootLayer;
+
+    bool m_needsDisplay;
+    SkIRect m_scrollFrame;
+};
+
+}
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
index 3d68ea8..72bbfb4 100644
--- a/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
@@ -151,7 +151,7 @@
     ReleaseDC(0, dc);
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
 {
     HDC dc = GetDC(0);
     HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
@@ -170,7 +170,9 @@
     SelectObject(dc, oldFont);
     ReleaseDC(0, dc);
 
-    return static_cast<float>(width);
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = static_cast<float>(width);
+    return metrics;
 }
 
 }  // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp b/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
index 3bff83f..8c639aa 100644
--- a/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
@@ -172,7 +172,7 @@
     m_treatAsFixedPitch = platformData().isFixedPitch();
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode /* metricsMode */) const
 {
     SkASSERT(sizeof(glyph) == 2);   // compile-time assert
 
@@ -183,7 +183,12 @@
     paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
     SkScalar width = paint.measureText(&glyph, 2);
 
-    return SkScalarToFloat(width);
+    // Though WebKit supports non-integral advances, Skia only supports them
+    // for "subpixel" (distinct from LCD subpixel antialiasing) text, which
+    // we don't use.
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = round(SkScalarToFloat(width));
+    return metrics;
 }
 
 }  // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/UniscribeHelper.cpp b/WebCore/platform/graphics/chromium/UniscribeHelper.cpp
index 10fcdf6..dda84a9 100644
--- a/WebCore/platform/graphics/chromium/UniscribeHelper.cpp
+++ b/WebCore/platform/graphics/chromium/UniscribeHelper.cpp
@@ -398,7 +398,6 @@
                                                &shaping.m_advance[fromGlyph],
                                                justify,
                                                &shaping.m_offsets[fromGlyph]);
-                    ASSERT(S_OK == hr);
                     textOutOk = (hr == S_OK);
                 } else {
                     SkPoint origin;
diff --git a/WebCore/platform/graphics/efl/FloatRectEfl.cpp b/WebCore/platform/graphics/efl/FloatRectEfl.cpp
new file mode 100644
index 0000000..12f8d03
--- /dev/null
+++ b/WebCore/platform/graphics/efl/FloatRectEfl.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "FloatRect.h"
+
+namespace WebCore {
+
+FloatRect::FloatRect(const Eina_Rectangle& r)
+    : m_location(FloatPoint(r.x, r.y))
+    , m_size(r.w, r.h)
+{
+}
+
+FloatRect::operator Eina_Rectangle() const // NOLINT
+{
+    Eina_Rectangle r = {(int) round(x()), (int) round(y()), (int) round(width()), (int) round(height())};
+    return r;
+}
+
+}
+
diff --git a/WebCore/platform/graphics/efl/FontEfl.cpp b/WebCore/platform/graphics/efl/FontEfl.cpp
new file mode 100644
index 0000000..2aeb397
--- /dev/null
+++ b/WebCore/platform/graphics/efl/FontEfl.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2003, 2006 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "Font.h"
+
+#include "GraphicsContext.h"
+#include "NotImplemented.h"
+#include "SimpleFontData.h"
+
+#include <cairo.h>
+
+namespace WebCore {
+
+void Font::drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const
+{
+    notImplemented();
+}
+
+bool Font::canReturnFallbackFontsForComplexText()
+{
+    return false;
+}
+
+float Font::floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
+{
+    notImplemented();
+    return 0.0f;
+}
+
+int Font::offsetForPositionForComplexText(const TextRun&, int, bool) const
+{
+    notImplemented();
+    return 0;
+}
+
+FloatRect Font::selectionRectForComplexText(const TextRun&, const IntPoint&, int, int, int) const
+{
+    notImplemented();
+    return FloatRect();
+}
+
+}
diff --git a/WebCore/platform/graphics/efl/IconEfl.cpp b/WebCore/platform/graphics/efl/IconEfl.cpp
new file mode 100644
index 0000000..6b3de04
--- /dev/null
+++ b/WebCore/platform/graphics/efl/IconEfl.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "Icon.h"
+
+#include "GraphicsContext.h"
+#include "MIMETypeRegistry.h"
+#include "NotImplemented.h"
+#include "PassRefPtr.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+Icon::Icon()
+    : m_icon(0)
+{
+    notImplemented();
+}
+
+Icon::~Icon()
+{
+}
+
+PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
+{
+    notImplemented();
+    return 0;
+}
+
+void Icon::paint(GraphicsContext* context, const IntRect& rect)
+{
+    notImplemented();
+}
+
+}
diff --git a/WebCore/platform/graphics/efl/ImageEfl.cpp b/WebCore/platform/graphics/efl/ImageEfl.cpp
new file mode 100644
index 0000000..112770f
--- /dev/null
+++ b/WebCore/platform/graphics/efl/ImageEfl.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Kenneth Rohde Christiansen.  All rights reserved.
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "Image.h"
+
+#include "BitmapImage.h"
+#include "SharedBuffer.h"
+
+#include <cairo.h>
+
+namespace WebCore {
+
+void BitmapImage::initPlatformData()
+{
+}
+
+void BitmapImage::invalidatePlatformData()
+{
+}
+
+static PassRefPtr<SharedBuffer> loadResourceSharedBufferFallback()
+{
+    return SharedBuffer::create(); // TODO: fallback image?
+}
+
+static PassRefPtr<SharedBuffer> loadResourceSharedBuffer(const char* name)
+{
+    RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(String::format(DATA_DIR "/webkit-1.0/images/%s.png", name));
+    if (buffer)
+        return buffer.release();
+    return loadResourceSharedBufferFallback();
+}
+
+PassRefPtr<Image> Image::loadPlatformResource(const char* name)
+{
+    RefPtr<BitmapImage> img = BitmapImage::create();
+    RefPtr<SharedBuffer> buffer = loadResourceSharedBuffer(name);
+    img->setData(buffer.release(), true);
+    return img.release();
+}
+
+}
diff --git a/WebCore/platform/graphics/efl/IntPointEfl.cpp b/WebCore/platform/graphics/efl/IntPointEfl.cpp
new file mode 100644
index 0000000..76a25e1
--- /dev/null
+++ b/WebCore/platform/graphics/efl/IntPointEfl.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "IntPoint.h"
+
+#include <Evas.h>
+
+namespace WebCore {
+
+IntPoint::IntPoint(const Evas_Point& p)
+    : m_x(p.x)
+    , m_y(p.y)
+{
+}
+
+IntPoint::operator Evas_Point() const // NOLINT
+{
+    Evas_Point p = { x(), y() };
+    return p;
+}
+
+}
diff --git a/WebCore/platform/graphics/efl/IntRectEfl.cpp b/WebCore/platform/graphics/efl/IntRectEfl.cpp
new file mode 100644
index 0000000..5ff8626
--- /dev/null
+++ b/WebCore/platform/graphics/efl/IntRectEfl.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "IntRect.h"
+
+namespace WebCore {
+
+IntRect::IntRect(const Eina_Rectangle& r)
+    : m_location(IntPoint(r.x, r.y))
+    , m_size(r.w, r.h)
+{
+}
+
+IntRect::operator Eina_Rectangle() const // NOLINT
+{
+    Eina_Rectangle r = { x(), y(), width(), height() };
+    return r;
+}
+
+}
+
diff --git a/WebCore/platform/graphics/gtk/DataSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp
similarity index 100%
rename from WebCore/platform/graphics/gtk/DataSourceGStreamer.cpp
rename to WebCore/platform/graphics/gstreamer/DataSourceGStreamer.cpp
diff --git a/WebCore/platform/graphics/gtk/DataSourceGStreamer.h b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
similarity index 100%
rename from WebCore/platform/graphics/gtk/DataSourceGStreamer.h
rename to WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
diff --git a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp
new file mode 100644
index 0000000..1d14b5a
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp
@@ -0,0 +1,35 @@
+/*
+ *  Copyright (C) 2010 Igalia S.L
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#include "config.h"
+#include "GOwnPtrGStreamer.h"
+
+#if ENABLE(VIDEO)
+#include <gst/gstelement.h>
+
+namespace WTF {
+
+template <> void freeOwnedGPtr<GstElement>(GstElement* ptr)
+{
+    if (ptr)
+        gst_object_unref(ptr);
+}
+#endif
+
+}
diff --git a/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h
new file mode 100644
index 0000000..6655f38
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h
@@ -0,0 +1,33 @@
+/*
+ *  Copyright (C) 2010 Igalia S.L
+ *
+ *  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 GOwnPtrGStreamer_h
+#define GOwnPtrGStreamer_h
+
+#include "GOwnPtr.h"
+
+typedef struct _GstElement GstElement;
+
+namespace WTF {
+
+template<> void freeOwnedGPtr<GstElement>(GstElement* ptr);
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
new file mode 100644
index 0000000..2e97b4d
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Igalia S.L
+ *
+ * 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 ImageGStreamer_h
+#define ImageGStreamer_h
+
+#if ENABLE(VIDEO)
+
+#include "BitmapImage.h"
+
+#include <gst/gst.h>
+#include <gst/video/video.h>
+#include <wtf/PassRefPtr.h>
+
+#if PLATFORM(CAIRO)
+#include <cairo.h>
+#endif
+
+namespace WebCore {
+class IntSize;
+
+class ImageGStreamer : public RefCounted<ImageGStreamer> {
+    public:
+        static PassRefPtr<ImageGStreamer> createImage(GstBuffer*);
+        ~ImageGStreamer();
+
+        PassRefPtr<BitmapImage> image()
+        {
+            ASSERT(m_image);
+            return m_image.get();
+        }
+
+    private:
+        RefPtr<BitmapImage> m_image;
+
+#if PLATFORM(CAIRO)
+        ImageGStreamer(GstBuffer*&, IntSize, cairo_format_t&);
+        cairo_surface_t* m_surface;
+#endif
+
+    };
+}
+
+#endif
+
+#endif
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
new file mode 100644
index 0000000..6f975a4
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Igalia S.L
+ *
+ * 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 "GOwnPtr.h"
+#include "ImageGStreamer.h"
+
+using namespace std;
+
+using namespace WebCore;
+
+PassRefPtr<ImageGStreamer> ImageGStreamer::createImage(GstBuffer* buffer)
+{
+    int width = 0, height = 0;
+    GstCaps* caps = gst_buffer_get_caps(buffer);
+    GstVideoFormat format;
+    if (!gst_video_format_parse_caps(caps, &format, &width, &height)) {
+        gst_caps_unref(caps);
+        return 0;
+    }
+
+    gst_caps_unref(caps);
+
+    cairo_format_t cairoFormat;
+    if (format == GST_VIDEO_FORMAT_ARGB || format == GST_VIDEO_FORMAT_BGRA)
+        cairoFormat = CAIRO_FORMAT_ARGB32;
+    else
+        cairoFormat = CAIRO_FORMAT_RGB24;
+
+    return adoptRef(new ImageGStreamer(buffer, IntSize(width, height), cairoFormat));
+}
+
+ImageGStreamer::ImageGStreamer(GstBuffer*& buffer, IntSize size, cairo_format_t& cairoFormat)
+    : m_image(0)
+    , m_surface(0)
+{
+    m_surface = cairo_image_surface_create_for_data(GST_BUFFER_DATA(buffer), cairoFormat,
+                                                    size.width(), size.height(),
+                                                    cairo_format_stride_for_width(cairoFormat, size.width()));
+    ASSERT(cairo_surface_status(m_surface) == CAIRO_STATUS_SUCCESS);
+    m_image = BitmapImage::create(m_surface);
+}
+
+ImageGStreamer::~ImageGStreamer()
+{
+    if (m_image)
+        m_image.clear();
+
+    m_image = 0;
+
+    if (m_surface && cairo_surface_get_reference_count(m_surface))
+        cairo_surface_destroy(m_surface);
+
+    m_surface = 0;
+}
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
new file mode 100644
index 0000000..0afb971
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -0,0 +1,1407 @@
+/*
+ * Copyright (C) 2007, 2009 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007 Collabora Ltd.  All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
+ * Copyright (C) 2009, 2010 Igalia S.L
+ *
+ * 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
+ * aint 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"
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayerPrivateGStreamer.h"
+
+
+#include "ColorSpace.h"
+#include "DataSourceGStreamer.h"
+#include "Document.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GOwnPtrGStreamer.h"
+#include "GraphicsContext.h"
+#include "GraphicsTypes.h"
+#include "ImageGStreamer.h"
+#include "IntRect.h"
+#include "KURL.h"
+#include "MIMETypeRegistry.h"
+#include "MediaPlayer.h"
+#include "NotImplemented.h"
+#include "ScrollView.h"
+#include "SecurityOrigin.h"
+#include "TimeRanges.h"
+#include "VideoSinkGStreamer.h"
+#include "WebKitWebSourceGStreamer.h"
+#include "Widget.h"
+#include <wtf/text/CString.h>
+
+#include <GOwnPtr.h>
+#include <gst/gst.h>
+#include <gst/interfaces/mixer.h>
+#include <gst/interfaces/xoverlay.h>
+#include <gst/video/video.h>
+#include <limits>
+#include <math.h>
+
+// GstPlayFlags flags from playbin2. It is the policy of GStreamer to
+// not publicly expose element-specific enums. That's why this
+// GstPlayFlags enum has been copied here.
+typedef enum {
+    GST_PLAY_FLAG_VIDEO         = 0x00000001,
+    GST_PLAY_FLAG_AUDIO         = 0x00000002,
+    GST_PLAY_FLAG_TEXT          = 0x00000004,
+    GST_PLAY_FLAG_VIS           = 0x00000008,
+    GST_PLAY_FLAG_SOFT_VOLUME   = 0x00000010,
+    GST_PLAY_FLAG_NATIVE_AUDIO  = 0x00000020,
+    GST_PLAY_FLAG_NATIVE_VIDEO  = 0x00000040,
+    GST_PLAY_FLAG_DOWNLOAD      = 0x00000080,
+    GST_PLAY_FLAG_BUFFERING     = 0x000000100
+} GstPlayFlags;
+
+using namespace std;
+
+namespace WebCore {
+
+static int greatestCommonDivisor(int a, int b)
+{
+    while (b) {
+        int temp = a;
+        a = b;
+        b = temp % b;
+    }
+
+    return ABS(a);
+}
+
+gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data)
+{
+    GOwnPtr<GError> err;
+    GOwnPtr<gchar> debug;
+    MediaPlayer::NetworkState error;
+    MediaPlayerPrivateGStreamer* mp = reinterpret_cast<MediaPlayerPrivateGStreamer*>(data);
+    bool issueError = true;
+    bool attemptNextLocation = false;
+    GstElement* pipeline = mp->pipeline();
+
+    if (message->structure) {
+        const gchar* messageTypeName = gst_structure_get_name(message->structure);
+
+        // Redirect messages are sent from elements, like qtdemux, to
+        // notify of the new location(s) of the media.
+        if (!g_strcmp0(messageTypeName, "redirect")) {
+            mp->mediaLocationChanged(message);
+            return true;
+        }
+    }
+
+    switch (GST_MESSAGE_TYPE(message)) {
+    case GST_MESSAGE_ERROR:
+        if (mp && mp->pipelineReset())
+            break;
+        gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
+        LOG_VERBOSE(Media, "Error: %d, %s", err->code,  err->message);
+
+        error = MediaPlayer::Empty;
+        if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND
+            || err->code == GST_STREAM_ERROR_WRONG_TYPE
+            || err->code == GST_STREAM_ERROR_FAILED
+            || err->code == GST_CORE_ERROR_MISSING_PLUGIN
+            || err->code == GST_RESOURCE_ERROR_NOT_FOUND)
+            error = MediaPlayer::FormatError;
+        else if (err->domain == GST_STREAM_ERROR) {
+            error = MediaPlayer::DecodeError;
+            attemptNextLocation = true;
+        } else if (err->domain == GST_RESOURCE_ERROR)
+            error = MediaPlayer::NetworkError;
+
+        if (mp) {
+            if (attemptNextLocation)
+                issueError = !mp->loadNextLocation();
+            if (issueError)
+                mp->loadingFailed(error);
+        }
+        break;
+    case GST_MESSAGE_EOS:
+        LOG_VERBOSE(Media, "End of Stream");
+        mp->didEnd();
+        break;
+    case GST_MESSAGE_STATE_CHANGED:
+        // Ignore state changes from internal elements. They are
+        // forwarded to playbin2 anyway.
+        if (GST_MESSAGE_SRC(message) == reinterpret_cast<GstObject*>(pipeline))
+            mp->updateStates();
+        break;
+    case GST_MESSAGE_BUFFERING:
+        mp->processBufferingStats(message);
+        break;
+    case GST_MESSAGE_DURATION:
+        LOG_VERBOSE(Media, "Duration changed");
+        mp->durationChanged();
+        break;
+    default:
+        LOG_VERBOSE(Media, "Unhandled GStreamer message type: %s",
+                    GST_MESSAGE_TYPE_NAME(message));
+        break;
+    }
+    return true;
+}
+
+void mediaPlayerPrivateSourceChangedCallback(GObject *object, GParamSpec *pspec, gpointer data)
+{
+    MediaPlayerPrivateGStreamer* mp = reinterpret_cast<MediaPlayerPrivateGStreamer*>(data);
+    GOwnPtr<GstElement> element;
+
+    g_object_get(mp->m_playBin, "source", &element.outPtr(), NULL);
+    gst_object_replace((GstObject**) &mp->m_source, (GstObject*) element.get());
+
+    if (WEBKIT_IS_WEB_SRC(element.get())) {
+        Frame* frame = mp->m_player->frameView() ? mp->m_player->frameView()->frame() : 0;
+
+        if (frame)
+            webKitWebSrcSetFrame(WEBKIT_WEB_SRC(element.get()), frame);
+    }
+}
+
+void mediaPlayerPrivateVolumeChangedCallback(GObject *element, GParamSpec *pspec, gpointer data)
+{
+    // This is called when playbin receives the notify::volume signal.
+    MediaPlayerPrivateGStreamer* mp = reinterpret_cast<MediaPlayerPrivateGStreamer*>(data);
+    mp->volumeChanged();
+}
+
+void mediaPlayerPrivateMuteChangedCallback(GObject *element, GParamSpec *pspec, gpointer data)
+{
+    // This is called when playbin receives the notify::mute signal.
+    MediaPlayerPrivateGStreamer* mp = reinterpret_cast<MediaPlayerPrivateGStreamer*>(data);
+    mp->muteChanged();
+}
+
+static float playbackPosition(GstElement* playbin)
+{
+
+    float ret = 0.0;
+
+    GstQuery* query = gst_query_new_position(GST_FORMAT_TIME);
+    if (!gst_element_query(playbin, query)) {
+        LOG_VERBOSE(Media, "Position query failed...");
+        gst_query_unref(query);
+        return ret;
+    }
+
+    gint64 position;
+    gst_query_parse_position(query, 0, &position);
+
+    // Position is available only if the pipeline is not in GST_STATE_NULL or
+    // GST_STATE_READY state.
+    if (position !=  static_cast<gint64>(GST_CLOCK_TIME_NONE))
+        ret = static_cast<float>(position) / static_cast<float>(GST_SECOND);
+
+    LOG_VERBOSE(Media, "Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
+
+    gst_query_unref(query);
+
+    return ret;
+}
+
+
+void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer *buffer, MediaPlayerPrivateGStreamer* playerPrivate)
+{
+    g_return_if_fail(GST_IS_BUFFER(buffer));
+    gst_buffer_replace(&playerPrivate->m_buffer, buffer);
+    playerPrivate->repaint();
+}
+
+MediaPlayerPrivateInterface* MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
+{
+    return new MediaPlayerPrivateGStreamer(player);
+}
+
+void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar)
+{
+    if (isAvailable())
+        registrar(create, getSupportedTypes, supportsType);
+}
+
+static bool gstInitialized = false;
+
+static bool doGstInit()
+{
+    // FIXME: We should pass the arguments from the command line
+    if (!gstInitialized) {
+        GOwnPtr<GError> error;
+        gstInitialized = gst_init_check(0, 0, &error.outPtr());
+        if (!gstInitialized) {
+            LOG_VERBOSE(Media, "Could not initialize GStreamer: %s",
+                        error ? error->message : "unknown error occurred");
+        } else {
+            gst_element_register(0, "webkitmediasrc", GST_RANK_PRIMARY,
+                                 WEBKIT_TYPE_DATA_SRC);
+            gst_element_register(0, "webkitwebsrc", GST_RANK_PRIMARY + 100,
+                                 WEBKIT_TYPE_WEB_SRC);
+        }
+
+    }
+    return gstInitialized;
+}
+
+bool MediaPlayerPrivateGStreamer::isAvailable()
+{
+    if (!doGstInit())
+        return false;
+
+    GstElementFactory* factory = gst_element_factory_find("playbin2");
+    if (factory) {
+        gst_object_unref(GST_OBJECT(factory));
+        return true;
+    }
+    return false;
+}
+
+MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer* player)
+    : m_player(player)
+    , m_playBin(0)
+    , m_videoSink(0)
+    , m_fpsSink(0)
+    , m_source(0)
+    , m_seekTime(0)
+    , m_changingRate(false)
+    , m_endTime(numeric_limits<float>::infinity())
+    , m_networkState(MediaPlayer::Empty)
+    , m_readyState(MediaPlayer::HaveNothing)
+    , m_isStreaming(false)
+    , m_size(IntSize())
+    , m_buffer(0)
+    , m_mediaLocations(0)
+    , m_mediaLocationCurrentIndex(0)
+    , m_resetPipeline(false)
+    , m_paused(true)
+    , m_seeking(false)
+    , m_buffering(false)
+    , m_playbackRate(1)
+    , m_errorOccured(false)
+    , m_mediaDuration(0)
+    , m_startedBuffering(false)
+    , m_fillTimer(this, &MediaPlayerPrivateGStreamer::fillTimerFired)
+    , m_maxTimeLoaded(0)
+    , m_bufferingPercentage(0)
+    , m_preload(MediaPlayer::Auto)
+    , m_delayingLoad(false)
+    , m_mediaDurationKnown(true)
+{
+    if (doGstInit())
+        createGSTPlayBin();
+}
+
+MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
+{
+    if (m_fillTimer.isActive())
+        m_fillTimer.stop();
+
+    if (m_buffer)
+        gst_buffer_unref(m_buffer);
+    m_buffer = 0;
+
+    if (m_mediaLocations) {
+        gst_structure_free(m_mediaLocations);
+        m_mediaLocations = 0;
+    }
+
+    if (m_source) {
+        gst_object_unref(m_source);
+        m_source = 0;
+    }
+
+    if (m_playBin) {
+        gst_element_set_state(m_playBin, GST_STATE_NULL);
+        gst_object_unref(GST_OBJECT(m_playBin));
+    }
+
+    if (m_videoSink) {
+        g_object_unref(m_videoSink);
+        m_videoSink = 0;
+    }
+
+    if (m_fpsSink) {
+        g_object_unref(m_fpsSink);
+        m_fpsSink = 0;
+    }
+}
+
+void MediaPlayerPrivateGStreamer::load(const String& url)
+{
+    g_object_set(m_playBin, "uri", url.utf8().data(), NULL);
+
+    LOG_VERBOSE(Media, "Load %s", url.utf8().data());
+
+    if (m_preload == MediaPlayer::None) {
+        LOG_VERBOSE(Media, "Delaying load.");
+        m_delayingLoad = true;
+        return;
+    }
+
+    commitLoad();
+}
+
+void MediaPlayerPrivateGStreamer::commitLoad()
+{
+    // GStreamer needs to have the pipeline set to a paused state to
+    // start providing anything useful.
+    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+
+    LOG_VERBOSE(Media, "Committing load.");
+    if (m_networkState != MediaPlayer::Loading) {
+        m_networkState = MediaPlayer::Loading;
+        m_player->networkStateChanged();
+    }
+    if (m_readyState != MediaPlayer::HaveNothing) {
+        m_readyState = MediaPlayer::HaveNothing;
+        m_player->readyStateChanged();
+    }
+}
+
+bool MediaPlayerPrivateGStreamer::changePipelineState(GstState newState)
+{
+    ASSERT(newState == GST_STATE_PLAYING || newState == GST_STATE_PAUSED);
+
+    GstState currentState;
+    GstState pending;
+
+    gst_element_get_state(m_playBin, &currentState, &pending, 0);
+    if (currentState != newState && pending != newState) {
+        GstStateChangeReturn ret = gst_element_set_state(m_playBin, newState);
+        GstState pausedOrPlaying = newState == GST_STATE_PLAYING ? GST_STATE_PAUSED : GST_STATE_PLAYING;
+        if (currentState != pausedOrPlaying && ret == GST_STATE_CHANGE_FAILURE) {
+            loadingFailed(MediaPlayer::Empty);
+            return false;
+        }
+    }
+    return true;
+}
+
+void MediaPlayerPrivateGStreamer::prepareToPlay()
+{
+    if (m_delayingLoad) {
+        m_delayingLoad = false;
+        commitLoad();
+    }
+}
+
+void MediaPlayerPrivateGStreamer::play()
+{
+    if (changePipelineState(GST_STATE_PLAYING))
+        LOG_VERBOSE(Media, "Play");
+}
+
+void MediaPlayerPrivateGStreamer::pause()
+{
+    if (changePipelineState(GST_STATE_PAUSED))
+        LOG_VERBOSE(Media, "Pause");
+}
+
+float MediaPlayerPrivateGStreamer::duration() const
+{
+    if (!m_playBin)
+        return 0.0;
+
+    if (m_errorOccured)
+        return 0.0;
+
+    // Media duration query failed already, don't attempt new useless queries.
+    if (!m_mediaDurationKnown)
+        return numeric_limits<float>::infinity();
+
+    if (m_mediaDuration)
+        return m_mediaDuration;
+
+    GstFormat timeFormat = GST_FORMAT_TIME;
+    gint64 timeLength = 0;
+
+    if (!gst_element_query_duration(m_playBin, &timeFormat, &timeLength) || timeFormat != GST_FORMAT_TIME || static_cast<guint64>(timeLength) == GST_CLOCK_TIME_NONE) {
+        LOG_VERBOSE(Media, "Time duration query failed.");
+        return numeric_limits<float>::infinity();
+    }
+
+    LOG_VERBOSE(Media, "Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(timeLength));
+
+    return (float) ((guint64) timeLength / 1000000000.0);
+    // FIXME: handle 3.14.9.5 properly
+}
+
+float MediaPlayerPrivateGStreamer::currentTime() const
+{
+    if (!m_playBin)
+        return 0;
+
+    if (m_errorOccured)
+        return 0;
+
+    if (m_seeking)
+        return m_seekTime;
+
+    return playbackPosition(m_playBin);
+
+}
+
+void MediaPlayerPrivateGStreamer::seek(float time)
+{
+    // Avoid useless seeking.
+    if (time == playbackPosition(m_playBin))
+        return;
+
+    if (!m_playBin)
+        return;
+
+    if (m_errorOccured)
+        return;
+
+    GstClockTime sec = (GstClockTime)(time * GST_SECOND);
+    LOG_VERBOSE(Media, "Seek: %" GST_TIME_FORMAT, GST_TIME_ARGS(sec));
+    if (!gst_element_seek(m_playBin, m_player->rate(),
+            GST_FORMAT_TIME,
+            (GstSeekFlags)(GST_SEEK_FLAG_FLUSH),
+            GST_SEEK_TYPE_SET, sec,
+            GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+        LOG_VERBOSE(Media, "Seek to %f failed", time);
+    else {
+        m_seeking = true;
+        m_seekTime = sec;
+    }
+}
+
+void MediaPlayerPrivateGStreamer::startEndPointTimerIfNeeded()
+{
+    notImplemented();
+}
+
+void MediaPlayerPrivateGStreamer::cancelSeek()
+{
+    notImplemented();
+}
+
+void MediaPlayerPrivateGStreamer::endPointTimerFired(Timer<MediaPlayerPrivateGStreamer>*)
+{
+    notImplemented();
+}
+
+bool MediaPlayerPrivateGStreamer::paused() const
+{
+    return m_paused;
+}
+
+bool MediaPlayerPrivateGStreamer::seeking() const
+{
+    return m_seeking;
+}
+
+// Returns the size of the video
+IntSize MediaPlayerPrivateGStreamer::naturalSize() const
+{
+    if (!hasVideo())
+        return IntSize();
+
+    GstPad* pad = gst_element_get_static_pad(m_videoSink, "sink");
+    if (!pad)
+        return IntSize();
+
+    int width = 0, height = 0;
+    GstCaps* caps = GST_PAD_CAPS(pad);
+    int pixelAspectRatioNumerator, pixelAspectRatioDenominator;
+    int displayWidth, displayHeight, displayAspectRatioGCD;
+    int originalWidth = 0, originalHeight = 0;
+
+    // TODO: handle possible clean aperture data. See
+    // https://bugzilla.gnome.org/show_bug.cgi?id=596571
+    // TODO: handle possible transformation matrix. See
+    // https://bugzilla.gnome.org/show_bug.cgi?id=596326
+
+    // Get the video PAR and original size.
+    if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps)
+        || !gst_video_format_parse_caps(caps, 0, &originalWidth, &originalHeight)
+        || !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
+                                                    &pixelAspectRatioDenominator)) {
+        gst_object_unref(GST_OBJECT(pad));
+        return IntSize();
+    }
+
+    gst_object_unref(GST_OBJECT(pad));
+
+    LOG_VERBOSE(Media, "Original video size: %dx%d", originalWidth, originalHeight);
+    LOG_VERBOSE(Media, "Pixel aspect ratio: %d/%d", pixelAspectRatioNumerator, pixelAspectRatioDenominator);
+
+    // Calculate DAR based on PAR and video size.
+    displayWidth = originalWidth * pixelAspectRatioNumerator;
+    displayHeight = originalHeight * pixelAspectRatioDenominator;
+
+    // Divide display width and height by their GCD to avoid possible overflows.
+    displayAspectRatioGCD = greatestCommonDivisor(displayWidth, displayHeight);
+    displayWidth /= displayAspectRatioGCD;
+    displayHeight /= displayAspectRatioGCD;
+
+    // Apply DAR to original video size. This is the same behavior as in xvimagesink's setcaps function.
+    if (!(originalHeight % displayHeight)) {
+        LOG_VERBOSE(Media, "Keeping video original height");
+        width = gst_util_uint64_scale_int(originalHeight, displayWidth, displayHeight);
+        height = originalHeight;
+    } else if (!(originalWidth % displayWidth)) {
+        LOG_VERBOSE(Media, "Keeping video original width");
+        height = gst_util_uint64_scale_int(originalWidth, displayHeight, displayWidth);
+        width = originalWidth;
+    } else {
+        LOG_VERBOSE(Media, "Approximating while keeping original video height");
+        width = gst_util_uint64_scale_int(originalHeight, displayWidth, displayHeight);
+        height = originalHeight;
+    }
+
+    LOG_VERBOSE(Media, "Natural size: %dx%d", width, height);
+    return IntSize(width, height);
+}
+
+bool MediaPlayerPrivateGStreamer::hasVideo() const
+{
+    gint currentVideo = -1;
+    if (m_playBin)
+        g_object_get(m_playBin, "current-video", &currentVideo, NULL);
+    return currentVideo > -1;
+}
+
+bool MediaPlayerPrivateGStreamer::hasAudio() const
+{
+    gint currentAudio = -1;
+    if (m_playBin)
+        g_object_get(m_playBin, "current-audio", &currentAudio, NULL);
+    return currentAudio > -1;
+}
+
+void MediaPlayerPrivateGStreamer::setVolume(float volume)
+{
+    if (!m_playBin)
+        return;
+
+    g_object_set(m_playBin, "volume", static_cast<double>(volume), NULL);
+}
+
+void MediaPlayerPrivateGStreamer::volumeChangedTimerFired(Timer<MediaPlayerPrivateGStreamer>*)
+{
+    double volume;
+    g_object_get(m_playBin, "volume", &volume, NULL);
+    m_player->volumeChanged(static_cast<float>(volume));
+}
+
+void MediaPlayerPrivateGStreamer::volumeChanged()
+{
+    Timer<MediaPlayerPrivateGStreamer> volumeChangedTimer(this, &MediaPlayerPrivateGStreamer::volumeChangedTimerFired);
+    volumeChangedTimer.startOneShot(0);
+}
+
+void MediaPlayerPrivateGStreamer::setRate(float rate)
+{
+    // Avoid useless playback rate update.
+    if (m_playbackRate == rate)
+        return;
+
+    GstState state;
+    GstState pending;
+
+    gst_element_get_state(m_playBin, &state, &pending, 0);
+    if ((state != GST_STATE_PLAYING && state != GST_STATE_PAUSED)
+        || (pending == GST_STATE_PAUSED))
+        return;
+
+    if (m_isStreaming)
+        return;
+
+    m_playbackRate = rate;
+    m_changingRate = true;
+    float currentPosition = playbackPosition(m_playBin) * GST_SECOND;
+    GstSeekFlags flags = (GstSeekFlags)(GST_SEEK_FLAG_FLUSH);
+    gint64 start, end;
+    bool mute = false;
+
+    LOG_VERBOSE(Media, "Set Rate to %f", rate);
+    if (rate >= 0) {
+        // Mute the sound if the playback rate is too extreme.
+        // TODO: in other cases we should perform pitch adjustments.
+        mute = (bool) (rate < 0.8 || rate > 2);
+        start = currentPosition;
+        end = GST_CLOCK_TIME_NONE;
+    } else {
+        start = 0;
+        mute = true;
+
+        // If we are at beginning of media, start from the end to
+        // avoid immediate EOS.
+        if (currentPosition <= 0)
+            end = duration() * GST_SECOND;
+        else
+            end = currentPosition;
+    }
+
+    LOG_VERBOSE(Media, "Need to mute audio: %d", (int) mute);
+
+    if (!gst_element_seek(m_playBin, rate, GST_FORMAT_TIME, flags,
+                          GST_SEEK_TYPE_SET, start,
+                          GST_SEEK_TYPE_SET, end))
+        LOG_VERBOSE(Media, "Set rate to %f failed", rate);
+    else
+        g_object_set(m_playBin, "mute", mute, NULL);
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivateGStreamer::networkState() const
+{
+    return m_networkState;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivateGStreamer::readyState() const
+{
+    return m_readyState;
+}
+
+PassRefPtr<TimeRanges> MediaPlayerPrivateGStreamer::buffered() const
+{
+    RefPtr<TimeRanges> timeRanges = TimeRanges::create();
+    float loaded = maxTimeLoaded();
+    if (!m_errorOccured && !m_isStreaming && loaded > 0)
+        timeRanges->add(0, loaded);
+    return timeRanges.release();
+}
+
+void MediaPlayerPrivateGStreamer::processBufferingStats(GstMessage* message)
+{
+    // This is the immediate buffering that needs to happen so we have
+    // enough to play right now.
+    m_buffering = true;
+    const GstStructure *structure = gst_message_get_structure(message);
+    gst_structure_get_int(structure, "buffer-percent", &m_bufferingPercentage);
+
+    LOG_VERBOSE(Media, "[Buffering] Buffering: %d%%.", m_bufferingPercentage);
+
+    GstBufferingMode mode;
+    gst_message_parse_buffering_stats(message, &mode, 0, 0, 0);
+    if (mode != GST_BUFFERING_DOWNLOAD) {
+        updateStates();
+        return;
+    }
+
+    // This is on-disk buffering, that allows us to download much more
+    // than needed for right now.
+    if (!m_startedBuffering) {
+        LOG_VERBOSE(Media, "[Buffering] Starting on-disk buffering.");
+
+        m_startedBuffering = true;
+
+        if (m_fillTimer.isActive())
+            m_fillTimer.stop();
+
+        m_fillTimer.startRepeating(0.2);
+    }
+}
+
+void MediaPlayerPrivateGStreamer::fillTimerFired(Timer<MediaPlayerPrivateGStreamer>*)
+{
+    GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
+
+    if (!gst_element_query(m_playBin, query)) {
+        gst_query_unref(query);
+        return;
+    }
+
+    gint64 start, stop;
+    gdouble fillStatus = 100.0;
+
+    gst_query_parse_buffering_range(query, 0, &start, &stop, 0);
+    gst_query_unref(query);
+
+    if (stop != -1)
+        fillStatus = 100.0 * stop / GST_FORMAT_PERCENT_MAX;
+
+    LOG_VERBOSE(Media, "[Buffering] Download buffer filled up to %f%%", fillStatus);
+
+    if (!m_mediaDuration)
+        durationChanged();
+
+    // Update maxTimeLoaded only if the media duration is
+    // available. Otherwise we can't compute it.
+    if (m_mediaDuration) {
+        if (fillStatus == 100.0)
+            m_maxTimeLoaded = m_mediaDuration;
+        else
+            m_maxTimeLoaded = static_cast<float>((fillStatus * m_mediaDuration) / 100.0);
+        LOG_VERBOSE(Media, "[Buffering] Updated maxTimeLoaded: %f", m_maxTimeLoaded);
+    }
+
+    if (fillStatus != 100.0) {
+        updateStates();
+        return;
+    }
+
+    // Media is now fully loaded. It will play even if network
+    // connection is cut. Buffering is done, remove the fill source
+    // from the main loop.
+    m_fillTimer.stop();
+    m_startedBuffering = false;
+    updateStates();
+}
+
+float MediaPlayerPrivateGStreamer::maxTimeSeekable() const
+{
+    if (m_errorOccured)
+        return 0.0;
+
+    LOG_VERBOSE(Media, "maxTimeSeekable");
+    // infinite duration means live stream
+    if (isinf(duration()))
+        return 0.0;
+
+    return maxTimeLoaded();
+}
+
+float MediaPlayerPrivateGStreamer::maxTimeLoaded() const
+{
+    if (m_errorOccured)
+        return 0.0;
+
+    float loaded = m_maxTimeLoaded;
+    if (!loaded && !m_fillTimer.isActive())
+        loaded = duration();
+    LOG_VERBOSE(Media, "maxTimeLoaded: %f", loaded);
+    return loaded;
+}
+
+unsigned MediaPlayerPrivateGStreamer::bytesLoaded() const
+{
+    if (!m_playBin)
+        return 0;
+
+    if (!m_mediaDuration)
+        return 0;
+
+    unsigned loaded = totalBytes() * maxTimeLoaded() / m_mediaDuration;
+    LOG_VERBOSE(Media, "bytesLoaded: %d", loaded);
+    return loaded;
+}
+
+unsigned MediaPlayerPrivateGStreamer::totalBytes() const
+{
+    if (!m_source)
+        return 0;
+
+    if (m_errorOccured)
+        return 0;
+
+    GstFormat fmt = GST_FORMAT_BYTES;
+    gint64 length = 0;
+    gst_element_query_duration(m_source, &fmt, &length);
+    LOG_VERBOSE(Media, "totalBytes %" G_GINT64_FORMAT, length);
+
+    return length;
+}
+
+void MediaPlayerPrivateGStreamer::cancelLoad()
+{
+    if (m_networkState < MediaPlayer::Loading || m_networkState == MediaPlayer::Loaded)
+        return;
+
+    if (m_playBin)
+        gst_element_set_state(m_playBin, GST_STATE_NULL);
+}
+
+void MediaPlayerPrivateGStreamer::updateStates()
+{
+    if (!m_playBin)
+        return;
+
+    if (m_errorOccured)
+        return;
+
+    MediaPlayer::NetworkState oldNetworkState = m_networkState;
+    MediaPlayer::ReadyState oldReadyState = m_readyState;
+    GstState state;
+    GstState pending;
+
+    GstStateChangeReturn ret = gst_element_get_state(m_playBin,
+        &state, &pending, 250 * GST_NSECOND);
+
+    bool shouldUpdateAfterSeek = false;
+    switch (ret) {
+    case GST_STATE_CHANGE_SUCCESS:
+        LOG_VERBOSE(Media, "State: %s, pending: %s",
+            gst_element_state_get_name(state),
+            gst_element_state_get_name(pending));
+
+        m_resetPipeline = state <= GST_STATE_READY;
+
+        // Try to figure out ready and network states.
+        if (state == GST_STATE_READY) {
+            m_readyState = MediaPlayer::HaveNothing;
+            m_networkState = MediaPlayer::Empty;
+        } else if (maxTimeLoaded() == duration()) {
+            m_networkState = MediaPlayer::Loaded;
+            m_readyState = MediaPlayer::HaveEnoughData;
+        } else {
+            m_readyState = currentTime() < maxTimeLoaded() ? MediaPlayer::HaveFutureData : MediaPlayer::HaveCurrentData;
+            m_networkState = MediaPlayer::Loading;
+        }
+
+        if (m_buffering && state != GST_STATE_READY) {
+            m_readyState = MediaPlayer::HaveCurrentData;
+            m_networkState = MediaPlayer::Loading;
+        }
+
+        // Now let's try to get the states in more detail using
+        // information from GStreamer, while we sync states where
+        // needed.
+        if (state == GST_STATE_PAUSED) {
+            if (m_buffering && m_bufferingPercentage == 100) {
+                m_buffering = false;
+                m_bufferingPercentage = 0;
+                m_readyState = MediaPlayer::HaveEnoughData;
+
+                LOG_VERBOSE(Media, "[Buffering] Complete.");
+
+                if (!m_paused) {
+                    LOG_VERBOSE(Media, "[Buffering] Restarting playback.");
+                    gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+                }
+            } else if (!m_buffering && (currentTime() < duration())) {
+                m_paused = true;
+            }
+        } else if (state == GST_STATE_PLAYING) {
+            m_readyState = MediaPlayer::HaveEnoughData;
+            m_paused = false;
+
+            if (!m_mediaDuration) {
+                float newDuration = duration();
+                m_mediaDurationKnown = !isinf(newDuration);
+                if (m_mediaDurationKnown)
+                    m_mediaDuration = newDuration;
+            }
+
+            if (m_buffering) {
+                m_readyState = MediaPlayer::HaveCurrentData;
+                m_networkState = MediaPlayer::Loading;
+
+                LOG_VERBOSE(Media, "[Buffering] Pausing stream for buffering.");
+
+                gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+            }
+        } else
+            m_paused = true;
+
+        // Is on-disk buffering in progress?
+        if (m_fillTimer.isActive())
+            m_networkState = MediaPlayer::Loading;
+
+        if (m_changingRate) {
+            m_player->rateChanged();
+            m_changingRate = false;
+        }
+
+        if (m_seeking) {
+            shouldUpdateAfterSeek = true;
+            m_seeking = false;
+        }
+
+        break;
+    case GST_STATE_CHANGE_ASYNC:
+        LOG_VERBOSE(Media, "Async: State: %s, pending: %s",
+            gst_element_state_get_name(state),
+            gst_element_state_get_name(pending));
+        // Change in progress
+
+        if (!m_isStreaming)
+            return;
+
+        // Resume playback if a seek was performed in a live pipeline.
+        if (m_seeking) {
+            shouldUpdateAfterSeek = true;
+            m_seeking = false;
+            if (m_paused)
+                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+        }
+        break;
+    case GST_STATE_CHANGE_FAILURE:
+        LOG_VERBOSE(Media, "Failure: State: %s, pending: %s",
+            gst_element_state_get_name(state),
+            gst_element_state_get_name(pending));
+        // Change failed
+        return;
+    case GST_STATE_CHANGE_NO_PREROLL:
+        LOG_VERBOSE(Media, "No preroll: State: %s, pending: %s",
+            gst_element_state_get_name(state),
+            gst_element_state_get_name(pending));
+
+        if (state == GST_STATE_READY)
+            m_readyState = MediaPlayer::HaveNothing;
+        else if (state == GST_STATE_PAUSED) {
+            m_readyState = MediaPlayer::HaveEnoughData;
+            m_paused = true;
+            // Live pipelines go in PAUSED without prerolling.
+            m_isStreaming = true;
+        } else if (state == GST_STATE_PLAYING)
+            m_paused = false;
+
+        if (m_seeking) {
+            shouldUpdateAfterSeek = true;
+            m_seeking = false;
+            if (!m_paused)
+                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+        } else if (!m_paused)
+            gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+
+        m_networkState = MediaPlayer::Loading;
+        break;
+    default:
+        LOG_VERBOSE(Media, "Else : %d", ret);
+        break;
+    }
+
+    if (seeking())
+        m_readyState = MediaPlayer::HaveNothing;
+
+    if (shouldUpdateAfterSeek)
+        timeChanged();
+
+    if (m_networkState != oldNetworkState) {
+        LOG_VERBOSE(Media, "Network State Changed from %u to %u",
+            oldNetworkState, m_networkState);
+        m_player->networkStateChanged();
+    }
+    if (m_readyState != oldReadyState) {
+        LOG_VERBOSE(Media, "Ready State Changed from %u to %u",
+            oldReadyState, m_readyState);
+        m_player->readyStateChanged();
+    }
+}
+
+void MediaPlayerPrivateGStreamer::mediaLocationChanged(GstMessage* message)
+{
+    if (m_mediaLocations)
+        gst_structure_free(m_mediaLocations);
+
+    if (message->structure) {
+        // This structure can contain:
+        // - both a new-location string and embedded locations structure
+        // - or only a new-location string.
+        m_mediaLocations = gst_structure_copy(message->structure);
+        const GValue* locations = gst_structure_get_value(m_mediaLocations, "locations");
+
+        if (locations)
+            m_mediaLocationCurrentIndex = static_cast<int>(gst_value_list_get_size(locations)) -1;
+
+        loadNextLocation();
+    }
+}
+
+bool MediaPlayerPrivateGStreamer::loadNextLocation()
+{
+    if (!m_mediaLocations)
+        return false;
+
+    const GValue* locations = gst_structure_get_value(m_mediaLocations, "locations");
+    const gchar* newLocation = 0;
+
+    if (!locations) {
+        // Fallback on new-location string.
+        newLocation = gst_structure_get_string(m_mediaLocations, "new-location");
+        if (!newLocation)
+            return false;
+    }
+
+    if (!newLocation) {
+        if (m_mediaLocationCurrentIndex < 0) {
+            m_mediaLocations = 0;
+            return false;
+        }
+
+        const GValue* location = gst_value_list_get_value(locations,
+                                                          m_mediaLocationCurrentIndex);
+        const GstStructure* structure = gst_value_get_structure(location);
+
+        if (!structure) {
+            m_mediaLocationCurrentIndex--;
+            return false;
+        }
+
+        newLocation = gst_structure_get_string(structure, "new-location");
+    }
+
+    if (newLocation) {
+        // Found a candidate. new-location is not always an absolute url
+        // though. We need to take the base of the current url and
+        // append the value of new-location to it.
+
+        gchar* currentLocation = 0;
+        g_object_get(m_playBin, "uri", &currentLocation, NULL);
+
+        KURL currentUrl(KURL(), currentLocation);
+        g_free(currentLocation);
+
+        KURL newUrl;
+
+        if (gst_uri_is_valid(newLocation))
+            newUrl = KURL(KURL(), newLocation);
+        else
+            newUrl = KURL(KURL(), currentUrl.baseAsString() + newLocation);
+
+        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(currentUrl);
+        if (securityOrigin->canRequest(newUrl)) {
+            LOG_VERBOSE(Media, "New media url: %s", newUrl.string().utf8().data());
+
+            // Reset player states.
+            m_networkState = MediaPlayer::Loading;
+            m_player->networkStateChanged();
+            m_readyState = MediaPlayer::HaveNothing;
+            m_player->readyStateChanged();
+
+            // Reset pipeline state.
+            m_resetPipeline = true;
+            gst_element_set_state(m_playBin, GST_STATE_READY);
+
+            GstState state;
+            gst_element_get_state(m_playBin, &state, 0, 0);
+            if (state <= GST_STATE_READY) {
+                // Set the new uri and start playing.
+                g_object_set(m_playBin, "uri", newUrl.string().utf8().data(), NULL);
+                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+                return true;
+            }
+        }
+    }
+    m_mediaLocationCurrentIndex--;
+    return false;
+
+}
+
+void MediaPlayerPrivateGStreamer::loadStateChanged()
+{
+    updateStates();
+}
+
+void MediaPlayerPrivateGStreamer::sizeChanged()
+{
+    notImplemented();
+}
+
+void MediaPlayerPrivateGStreamer::timeChanged()
+{
+    updateStates();
+    m_player->timeChanged();
+}
+
+void MediaPlayerPrivateGStreamer::didEnd()
+{
+    // EOS was reached but in case of reverse playback the position is
+    // not always 0. So to not confuse the HTMLMediaElement we
+    // synchronize position and duration values.
+    float now = currentTime();
+    if (now > 0) {
+        m_mediaDuration = now;
+        m_player->durationChanged();
+    }
+
+    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+
+    timeChanged();
+}
+
+void MediaPlayerPrivateGStreamer::durationChanged()
+{
+    // Reset cached media duration
+    m_mediaDuration = 0;
+
+    // And re-cache it if possible.
+    GstState state;
+    gst_element_get_state(m_playBin, &state, 0, 0);
+    float newDuration = duration();
+
+    if (state <= GST_STATE_READY) {
+        // Don't set m_mediaDurationKnown yet if the pipeline is not
+        // paused. This allows duration() query to fail at least once
+        // before playback starts and duration becomes known.
+        if (!isinf(newDuration))
+            m_mediaDuration = newDuration;
+    } else {
+        m_mediaDurationKnown = !isinf(newDuration);
+        if (m_mediaDurationKnown)
+            m_mediaDuration = newDuration;
+    }
+
+    if (!isinf(newDuration))
+        m_mediaDuration = newDuration;
+
+    m_player->durationChanged();
+}
+
+bool MediaPlayerPrivateGStreamer::supportsMuting() const
+{
+    return true;
+}
+
+void MediaPlayerPrivateGStreamer::setMuted(bool muted)
+{
+    if (!m_playBin)
+        return;
+
+    g_object_set(m_playBin, "mute", muted, NULL);
+}
+
+void MediaPlayerPrivateGStreamer::muteChangedTimerFired(Timer<MediaPlayerPrivateGStreamer>*)
+{
+    gboolean muted;
+    g_object_get(m_playBin, "mute", &muted, NULL);
+    m_player->muteChanged(static_cast<bool>(muted));
+}
+
+void MediaPlayerPrivateGStreamer::muteChanged()
+{
+    Timer<MediaPlayerPrivateGStreamer> muteChangedTimer(this, &MediaPlayerPrivateGStreamer::muteChangedTimerFired);
+    muteChangedTimer.startOneShot(0);
+}
+
+void MediaPlayerPrivateGStreamer::loadingFailed(MediaPlayer::NetworkState error)
+{
+    m_errorOccured = true;
+    if (m_networkState != error) {
+        m_networkState = error;
+        m_player->networkStateChanged();
+    }
+    if (m_readyState != MediaPlayer::HaveNothing) {
+        m_readyState = MediaPlayer::HaveNothing;
+        m_player->readyStateChanged();
+    }
+}
+
+void MediaPlayerPrivateGStreamer::setSize(const IntSize& size)
+{
+    m_size = size;
+}
+
+void MediaPlayerPrivateGStreamer::setVisible(bool visible)
+{
+}
+
+void MediaPlayerPrivateGStreamer::repaint()
+{
+    m_player->repaint();
+}
+
+void MediaPlayerPrivateGStreamer::paint(GraphicsContext* context, const IntRect& rect)
+{
+    if (context->paintingDisabled())
+        return;
+
+    if (!m_player->visible())
+        return;
+    if (!m_buffer)
+        return;
+
+    RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_buffer);
+    if (!gstImage)
+        return;
+
+    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), sRGBColorSpace,
+                       rect, CompositeCopy, false);
+}
+
+static HashSet<String> mimeTypeCache()
+{
+
+    doGstInit();
+
+    DEFINE_STATIC_LOCAL(HashSet<String>, cache, ());
+    static bool typeListInitialized = false;
+
+    if (!typeListInitialized) {
+        // Build a whitelist of mime-types known to be supported by
+        // GStreamer.
+        HashSet<String> handledApplicationSubtypes;
+        handledApplicationSubtypes.add(String("ogg"));
+        handledApplicationSubtypes.add(String("x-3gp"));
+        handledApplicationSubtypes.add(String("vnd.rn-realmedia"));
+        handledApplicationSubtypes.add(String("x-pn-realaudio"));
+
+        GList* factories = gst_type_find_factory_get_list();
+        for (GList* iterator = factories; iterator; iterator = iterator->next) {
+            GstTypeFindFactory* factory = GST_TYPE_FIND_FACTORY(iterator->data);
+            GstCaps* caps = gst_type_find_factory_get_caps(factory);
+
+            if (!caps)
+                continue;
+
+            for (guint structureIndex = 0; structureIndex < gst_caps_get_size(caps); structureIndex++) {
+                GstStructure* structure = gst_caps_get_structure(caps, structureIndex);
+                const gchar* name = gst_structure_get_name(structure);
+                bool cached = false;
+
+                // These formats are supported by GStreamer, but not
+                // correctly advertised.
+                if (g_str_equal(name, "video/x-h264")
+                    || g_str_equal(name, "audio/x-m4a")) {
+                    cache.add(String("video/mp4"));
+                    cache.add(String("audio/aac"));
+                    cached = true;
+                }
+
+                if (g_str_equal(name, "video/x-theora")) {
+                    cache.add(String("video/ogg"));
+                    cached = true;
+                }
+
+                if (g_str_equal(name, "audio/x-vorbis")) {
+                    cache.add(String("audio/ogg"));
+                    cached = true;
+                }
+
+                if (g_str_equal(name, "audio/x-wav")) {
+                    cache.add(String("audio/wav"));
+                    cached = true;
+                }
+
+                if (g_str_equal(name, "audio/mpeg")) {
+                    cache.add(String(name));
+                    cached = true;
+
+                    // This is what we are handling:
+                    // mpegversion=(int)1, layer=(int)[ 1, 3 ]
+                    gint mpegVersion = 0;
+                    if (gst_structure_get_int(structure, "mpegversion", &mpegVersion) && (mpegVersion == 1)) {
+                        const GValue* layer = gst_structure_get_value(structure, "layer");
+                        if (G_VALUE_TYPE(layer) == GST_TYPE_INT_RANGE) {
+                            gint minLayer = gst_value_get_int_range_min(layer);
+                            gint maxLayer = gst_value_get_int_range_max(layer);
+                            if (minLayer <= 1 && 1 <= maxLayer)
+                                cache.add(String("audio/mp1"));
+                            if (minLayer <= 2 && 2 <= maxLayer)
+                                cache.add(String("audio/mp2"));
+                            if (minLayer <= 3 && 3 <= maxLayer)
+                                cache.add(String("audio/mp3"));
+                        }
+                    }
+                }
+
+                if (!cached) {
+                    // GStreamer plugins can be capable of supporting
+                    // types which WebKit supports by default. In that
+                    // case, we should not consider these types
+                    // supportable by GStreamer.  Examples of what
+                    // GStreamer can support but should not be added:
+                    // text/plain, text/html, image/jpeg,
+                    // application/xml
+                    gchar** mimetype = g_strsplit(name, "/", 2);
+                    if (g_str_equal(mimetype[0], "audio")
+                        || g_str_equal(mimetype[0], "video")
+                        || (g_str_equal(mimetype[0], "application")
+                            && handledApplicationSubtypes.contains(String(mimetype[1]))))
+                        cache.add(String(name));
+
+                    g_strfreev(mimetype);
+                }
+            }
+        }
+
+        gst_plugin_feature_list_free(factories);
+        typeListInitialized = true;
+    }
+
+    return cache;
+}
+
+void MediaPlayerPrivateGStreamer::getSupportedTypes(HashSet<String>& types)
+{
+    types = mimeTypeCache();
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const String& type, const String& codecs)
+{
+    if (type.isNull() || type.isEmpty())
+        return MediaPlayer::IsNotSupported;
+
+    // spec says we should not return "probably" if the codecs string is empty
+    if (mimeTypeCache().contains(type))
+        return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
+    return MediaPlayer::IsNotSupported;
+}
+
+bool MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin() const
+{
+    return true;
+}
+
+bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
+{
+    return true;
+}
+
+void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload)
+{
+    ASSERT(m_playBin);
+
+    m_preload = preload;
+
+    GstPlayFlags flags;
+    g_object_get(m_playBin, "flags", &flags, NULL);
+    if (preload == MediaPlayer::None)
+        g_object_set(m_playBin, "flags", flags & ~GST_PLAY_FLAG_DOWNLOAD, NULL);
+    else
+        g_object_set(m_playBin, "flags", flags | GST_PLAY_FLAG_DOWNLOAD, NULL);
+
+    if (m_delayingLoad && m_preload != MediaPlayer::None) {
+        m_delayingLoad = false;
+        commitLoad();
+    }
+}
+
+void MediaPlayerPrivateGStreamer::createGSTPlayBin()
+{
+    ASSERT(!m_playBin);
+    m_playBin = gst_element_factory_make("playbin2", "play");
+
+    GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_playBin));
+    gst_bus_add_signal_watch(bus);
+    g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this);
+    gst_object_unref(bus);
+
+    g_signal_connect(m_playBin, "notify::volume", G_CALLBACK(mediaPlayerPrivateVolumeChangedCallback), this);
+    g_signal_connect(m_playBin, "notify::source", G_CALLBACK(mediaPlayerPrivateSourceChangedCallback), this);
+    g_signal_connect(m_playBin, "notify::mute", G_CALLBACK(mediaPlayerPrivateMuteChangedCallback), this);
+
+    m_videoSink = webkit_video_sink_new();
+
+    g_object_ref_sink(m_videoSink);
+
+    WTFLogChannel* channel = getChannelFromName("Media");
+    if (channel->state == WTFLogChannelOn) {
+        m_fpsSink = gst_element_factory_make("fpsdisplaysink", "sink");
+        if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) {
+            g_object_set(m_fpsSink, "video-sink", m_videoSink, NULL);
+            g_object_ref_sink(m_fpsSink);
+            g_object_set(m_playBin, "video-sink", m_fpsSink, NULL);
+        } else {
+            m_fpsSink = 0;
+            g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
+            LOG_VERBOSE(Media, "Can't display FPS statistics, you need gst-plugins-bad >= 0.10.18");
+        }
+    } else
+        g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
+
+    g_signal_connect(m_videoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
new file mode 100644
index 0000000..06519fa
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2007, 2009 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2009, 2010 Igalia S.L
+ *
+ * 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
+ * aint 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 MediaPlayerPrivateGStreamer_h
+#define MediaPlayerPrivateGStreamer_h
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayerPrivate.h"
+#include "Timer.h"
+
+#include <glib.h>
+#include <gst/gst.h>
+
+typedef struct _WebKitVideoSink WebKitVideoSink;
+typedef struct _GstBuffer GstBuffer;
+typedef struct _GstMessage GstMessage;
+typedef struct _GstElement GstElement;
+typedef struct _GstBus GstBus;
+
+namespace WebCore {
+
+class GraphicsContext;
+class IntSize;
+class IntRect;
+class String;
+
+gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data);
+void mediaPlayerPrivateVolumeChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
+void mediaPlayerPrivateMuteChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
+void mediaPlayerPrivateSourceChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
+
+class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
+        friend gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data);
+        friend void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer* buffer, MediaPlayerPrivateGStreamer* playerPrivate);
+        friend void mediaPlayerPrivateSourceChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
+
+        public:
+            static void registerMediaEngine(MediaEngineRegistrar);
+
+            IntSize naturalSize() const;
+            bool hasVideo() const;
+            bool hasAudio() const;
+
+            void load(const String &url);
+            void commitLoad();
+            void cancelLoad();
+            bool loadNextLocation();
+
+            void prepareToPlay();
+            void play();
+            void pause();
+
+            bool paused() const;
+            bool seeking() const;
+
+            float duration() const;
+            float currentTime() const;
+            void seek(float);
+
+            void setRate(float);
+
+            void setVolume(float);
+            void volumeChanged();
+            void volumeChangedTimerFired(Timer<MediaPlayerPrivateGStreamer>*);
+
+            bool supportsMuting() const;
+            void setMuted(bool);
+            void muteChanged();
+            void muteChangedTimerFired(Timer<MediaPlayerPrivateGStreamer>*);
+
+            void setPreload(MediaPlayer::Preload);
+            void fillTimerFired(Timer<MediaPlayerPrivateGStreamer>*);
+
+            MediaPlayer::NetworkState networkState() const;
+            MediaPlayer::ReadyState readyState() const;
+
+            PassRefPtr<TimeRanges> buffered() const;
+            float maxTimeSeekable() const;
+            unsigned bytesLoaded() const;
+            unsigned totalBytes() const;
+
+            void setVisible(bool);
+            void setSize(const IntSize&);
+
+            void mediaLocationChanged(GstMessage*);
+            void loadStateChanged();
+            void sizeChanged();
+            void timeChanged();
+            void didEnd();
+            void durationChanged();
+            void loadingFailed(MediaPlayer::NetworkState);
+
+            void repaint();
+            void paint(GraphicsContext*, const IntRect&);
+
+            bool hasSingleSecurityOrigin() const;
+
+            bool supportsFullscreen() const;
+
+            GstElement* pipeline() const { return m_playBin; }
+            bool pipelineReset() const { return m_resetPipeline; }
+
+        private:
+            MediaPlayerPrivateGStreamer(MediaPlayer*);
+            ~MediaPlayerPrivateGStreamer();
+
+            static MediaPlayerPrivateInterface* create(MediaPlayer* player);
+
+            static void getSupportedTypes(HashSet<String>&);
+            static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+            static bool isAvailable();
+
+            void updateStates();
+            void cancelSeek();
+            void endPointTimerFired(Timer<MediaPlayerPrivateGStreamer>*);
+            float maxTimeLoaded() const;
+            void startEndPointTimerIfNeeded();
+
+            void createGSTPlayBin();
+            bool changePipelineState(GstState state);
+
+            void processBufferingStats(GstMessage* message);
+
+        private:
+            MediaPlayer* m_player;
+            GstElement* m_playBin;
+            GstElement* m_videoSink;
+            GstElement* m_fpsSink;
+            GstElement* m_source;
+            GstClockTime m_seekTime;
+            bool m_changingRate;
+            float m_endTime;
+            bool m_isEndReached;
+            MediaPlayer::NetworkState m_networkState;
+            MediaPlayer::ReadyState m_readyState;
+            mutable bool m_isStreaming;
+            IntSize m_size;
+            GstBuffer* m_buffer;
+            GstStructure* m_mediaLocations;
+            int m_mediaLocationCurrentIndex;
+            bool m_resetPipeline;
+            bool m_paused;
+            bool m_seeking;
+            bool m_buffering;
+            float m_playbackRate;
+            bool m_errorOccured;
+            gfloat m_mediaDuration;
+            bool m_startedBuffering;
+            Timer<MediaPlayerPrivateGStreamer> m_fillTimer;
+            float m_maxTimeLoaded;
+            int m_bufferingPercentage;
+            MediaPlayer::Preload m_preload;
+            bool m_delayingLoad;
+            bool m_mediaDurationKnown;
+    };
+}
+
+#endif
+#endif
diff --git a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
new file mode 100644
index 0000000..dd8c3ee
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
@@ -0,0 +1,372 @@
+/*
+ *  Copyright (C) 2007 OpenedHand
+ *  Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/**
+ * SECTION:webkit-video-sink
+ * @short_description: GStreamer video sink
+ *
+ * #WebKitVideoSink is a GStreamer sink element that triggers
+ * repaints in the WebKit GStreamer media player for the
+ * current video buffer.
+ */
+
+#include "config.h"
+#include "VideoSinkGStreamer.h"
+
+#include <glib.h>
+#include <gst/gst.h>
+#include <gst/video/video.h>
+
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink",
+                                                                   GST_PAD_SINK, GST_PAD_ALWAYS,
+// CAIRO_FORMAT_RGB24 used to render the video buffers is little/big endian dependant.
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+                                                                   GST_STATIC_CAPS(GST_VIDEO_CAPS_BGRx ";" GST_VIDEO_CAPS_BGRA)
+#else
+                                                                   GST_STATIC_CAPS(GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_ARGB)
+#endif
+);
+
+GST_DEBUG_CATEGORY_STATIC(webkit_video_sink_debug);
+#define GST_CAT_DEFAULT webkit_video_sink_debug
+
+enum {
+    REPAINT_REQUESTED,
+    LAST_SIGNAL
+};
+
+enum {
+    PROP_0
+};
+
+static guint webkit_video_sink_signals[LAST_SIGNAL] = { 0, };
+
+struct _WebKitVideoSinkPrivate {
+    GstBuffer* buffer;
+    guint timeout_id;
+    GMutex* buffer_mutex;
+    GCond* data_cond;
+
+    // If this is TRUE all processing should finish ASAP
+    // This is necessary because there could be a race between
+    // unlock() and render(), where unlock() wins, signals the
+    // GCond, then render() tries to render a frame although
+    // everything else isn't running anymore. This will lead
+    // to deadlocks because render() holds the stream lock.
+    //
+    // Protected by the buffer mutex
+    gboolean unlocked;
+};
+
+#define _do_init(bla) \
+    GST_DEBUG_CATEGORY_INIT(webkit_video_sink_debug, \
+                            "webkitsink", \
+                            0, \
+                            "webkit video sink")
+
+GST_BOILERPLATE_FULL(WebKitVideoSink,
+                     webkit_video_sink,
+                     GstVideoSink,
+                     GST_TYPE_VIDEO_SINK,
+                     _do_init);
+
+static void
+webkit_video_sink_base_init(gpointer g_class)
+{
+    GstElementClass* element_class = GST_ELEMENT_CLASS(g_class);
+
+    gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&sinktemplate));
+    gst_element_class_set_details_simple(element_class, "WebKit video sink",
+            "Sink/Video", "Sends video data from a GStreamer pipeline to a Cairo surface",
+            "Alp Toker <alp@atoker.com>");
+}
+
+static void
+webkit_video_sink_init(WebKitVideoSink* sink, WebKitVideoSinkClass* klass)
+{
+    WebKitVideoSinkPrivate* priv;
+
+    sink->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, WEBKIT_TYPE_VIDEO_SINK, WebKitVideoSinkPrivate);
+    priv->data_cond = g_cond_new();
+    priv->buffer_mutex = g_mutex_new();
+}
+
+static gboolean
+webkit_video_sink_timeout_func(gpointer data)
+{
+    WebKitVideoSink* sink = reinterpret_cast<WebKitVideoSink*>(data);
+    WebKitVideoSinkPrivate* priv = sink->priv;
+    GstBuffer* buffer;
+
+    g_mutex_lock(priv->buffer_mutex);
+    buffer = priv->buffer;
+    priv->buffer = 0;
+    priv->timeout_id = 0;
+
+    if (!buffer || priv->unlocked || G_UNLIKELY(!GST_IS_BUFFER(buffer))) {
+        g_cond_signal(priv->data_cond);
+        g_mutex_unlock(priv->buffer_mutex);
+        return FALSE;
+    }
+
+    g_signal_emit(sink, webkit_video_sink_signals[REPAINT_REQUESTED], 0, buffer);
+    gst_buffer_unref(buffer);
+    g_cond_signal(priv->data_cond);
+    g_mutex_unlock(priv->buffer_mutex);
+
+    return FALSE;
+}
+
+static GstFlowReturn
+webkit_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer)
+{
+    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(bsink);
+    WebKitVideoSinkPrivate* priv = sink->priv;
+
+    g_mutex_lock(priv->buffer_mutex);
+
+    if (priv->unlocked) {
+        g_mutex_unlock(priv->buffer_mutex);
+        return GST_FLOW_OK;
+    }
+
+    priv->buffer = gst_buffer_ref(buffer);
+
+    // For the unlikely case where the buffer has no caps, the caps
+    // are implicitely the caps of the pad. This shouldn't happen.
+    if (G_UNLIKELY(!GST_BUFFER_CAPS(buffer))) {
+        buffer = priv->buffer = gst_buffer_make_metadata_writable(priv->buffer);
+        gst_buffer_set_caps(priv->buffer, GST_PAD_CAPS(GST_BASE_SINK_PAD(bsink)));
+    }
+
+    GstCaps *caps = GST_BUFFER_CAPS(buffer);
+    GstVideoFormat format;
+    int width, height;
+    if (G_UNLIKELY(!gst_video_format_parse_caps(caps, &format, &width, &height))) {
+        gst_buffer_unref(buffer);
+        g_mutex_unlock(priv->buffer_mutex);
+        return GST_FLOW_ERROR;
+    }
+
+    // Cairo's ARGB has pre-multiplied alpha while GStreamer's doesn't.
+    // Here we convert to Cairo's ARGB.
+    if (format == GST_VIDEO_FORMAT_ARGB || format == GST_VIDEO_FORMAT_BGRA) {
+        // Because GstBaseSink::render() only owns the buffer reference in the
+        // method scope we can't use gst_buffer_make_writable() here. Also
+        // The buffer content should not be changed here because the same buffer
+        // could be passed multiple times to this method (in theory)
+        GstBuffer *newBuffer = gst_buffer_try_new_and_alloc(GST_BUFFER_SIZE(buffer));
+
+        // Check if allocation failed
+        if (G_UNLIKELY(!newBuffer)) {
+            gst_buffer_unref(buffer);
+            g_mutex_unlock(priv->buffer_mutex);
+            return GST_FLOW_ERROR;
+        }
+
+        gst_buffer_copy_metadata(newBuffer, buffer, (GstBufferCopyFlags) GST_BUFFER_COPY_ALL);
+
+        // We don't use Color::premultipliedARGBFromColor() here because
+        // one function call per video pixel is just too expensive:
+        // For 720p/PAL for example this means 1280*720*25=23040000
+        // function calls per second!
+        unsigned short alpha;
+        const guint8 *source = GST_BUFFER_DATA(buffer);
+        guint8 *destination = GST_BUFFER_DATA(newBuffer);
+
+        for (int x = 0; x < height; x++) {
+            for (int y = 0; y < width; y++) {
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+                alpha = source[3];
+                destination[0] = (source[0] * alpha + 128) / 255;
+                destination[1] = (source[1] * alpha + 128) / 255;
+                destination[2] = (source[2] * alpha + 128) / 255;
+                destination[3] = alpha;
+#else
+                alpha = source[0];
+                destination[0] = alpha;
+                destination[1] = (source[1] * alpha + 128) / 255;
+                destination[2] = (source[2] * alpha + 128) / 255;
+                destination[3] = (source[3] * alpha + 128) / 255;
+#endif
+                source += 4;
+                destination += 4;
+            }
+        }
+        gst_buffer_unref(buffer);
+        buffer = priv->buffer = newBuffer;
+    }
+
+    // This should likely use a lower priority, but glib currently starves
+    // lower priority sources.
+    // See: https://bugzilla.gnome.org/show_bug.cgi?id=610830.
+    priv->timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT, 0,
+                                          webkit_video_sink_timeout_func,
+                                          gst_object_ref(sink),
+                                          (GDestroyNotify)gst_object_unref);
+
+    g_cond_wait(priv->data_cond, priv->buffer_mutex);
+    g_mutex_unlock(priv->buffer_mutex);
+    return GST_FLOW_OK;
+}
+
+static void
+webkit_video_sink_dispose(GObject* object)
+{
+    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
+    WebKitVideoSinkPrivate* priv = sink->priv;
+
+    if (priv->data_cond) {
+        g_cond_free(priv->data_cond);
+        priv->data_cond = 0;
+    }
+
+    if (priv->buffer_mutex) {
+        g_mutex_free(priv->buffer_mutex);
+        priv->buffer_mutex = 0;
+    }
+
+    G_OBJECT_CLASS(parent_class)->dispose(object);
+}
+
+static void
+unlock_buffer_mutex(WebKitVideoSinkPrivate* priv)
+{
+    g_mutex_lock(priv->buffer_mutex);
+
+    if (priv->buffer) {
+        gst_buffer_unref(priv->buffer);
+        priv->buffer = 0;
+    }
+
+    priv->unlocked = TRUE;
+
+    g_cond_signal(priv->data_cond);
+    g_mutex_unlock(priv->buffer_mutex);
+}
+
+static gboolean
+webkit_video_sink_unlock(GstBaseSink* object)
+{
+    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
+
+    unlock_buffer_mutex(sink->priv);
+
+    return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock,
+                                        (object), TRUE);
+}
+
+static gboolean
+webkit_video_sink_unlock_stop(GstBaseSink* object)
+{
+    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
+    WebKitVideoSinkPrivate* priv = sink->priv;
+
+    g_mutex_lock(priv->buffer_mutex);
+    priv->unlocked = FALSE;
+    g_mutex_unlock(priv->buffer_mutex);
+
+    return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock_stop,
+                                        (object), TRUE);
+}
+
+static gboolean
+webkit_video_sink_stop(GstBaseSink* base_sink)
+{
+    WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(base_sink)->priv;
+
+    unlock_buffer_mutex(priv);
+    return TRUE;
+}
+
+static gboolean
+webkit_video_sink_start(GstBaseSink* base_sink)
+{
+    WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(base_sink)->priv;
+
+    g_mutex_lock(priv->buffer_mutex);
+    priv->unlocked = FALSE;
+    g_mutex_unlock(priv->buffer_mutex);
+    return TRUE;
+}
+
+static void
+marshal_VOID__MINIOBJECT(GClosure * closure, GValue * return_value,
+                         guint n_param_values, const GValue * param_values,
+                         gpointer invocation_hint, gpointer marshal_data)
+{
+  typedef void (*marshalfunc_VOID__MINIOBJECT) (gpointer obj, gpointer arg1, gpointer data2);
+  marshalfunc_VOID__MINIOBJECT callback;
+  GCClosure *cc = (GCClosure *) closure;
+  gpointer data1, data2;
+
+  g_return_if_fail(n_param_values == 2);
+
+  if (G_CCLOSURE_SWAP_DATA(closure)) {
+      data1 = closure->data;
+      data2 = g_value_peek_pointer(param_values + 0);
+  } else {
+      data1 = g_value_peek_pointer(param_values + 0);
+      data2 = closure->data;
+  }
+  callback = (marshalfunc_VOID__MINIOBJECT) (marshal_data ? marshal_data : cc->callback);
+
+  callback(data1, gst_value_get_mini_object(param_values + 1), data2);
+}
+
+static void
+webkit_video_sink_class_init(WebKitVideoSinkClass* klass)
+{
+    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
+    GstBaseSinkClass* gstbase_sink_class = GST_BASE_SINK_CLASS(klass);
+
+    g_type_class_add_private(klass, sizeof(WebKitVideoSinkPrivate));
+
+    gobject_class->dispose = webkit_video_sink_dispose;
+
+    gstbase_sink_class->unlock = webkit_video_sink_unlock;
+    gstbase_sink_class->unlock_stop = webkit_video_sink_unlock_stop;
+    gstbase_sink_class->render = webkit_video_sink_render;
+    gstbase_sink_class->preroll = webkit_video_sink_render;
+    gstbase_sink_class->stop = webkit_video_sink_stop;
+    gstbase_sink_class->start = webkit_video_sink_start;
+
+    webkit_video_sink_signals[REPAINT_REQUESTED] = g_signal_new("repaint-requested",
+            G_TYPE_FROM_CLASS(klass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            0,
+            0,
+            0,
+            marshal_VOID__MINIOBJECT,
+            G_TYPE_NONE, 1, GST_TYPE_BUFFER);
+}
+
+/**
+ * webkit_video_sink_new:
+ *
+ * Creates a new GStreamer video sink.
+ *
+ * Return value: a #GstElement for the newly created video sink
+ */
+GstElement*
+webkit_video_sink_new(void)
+{
+    return (GstElement*)g_object_new(WEBKIT_TYPE_VIDEO_SINK, 0);
+}
+
diff --git a/WebCore/platform/graphics/gtk/VideoSinkGStreamer.h b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
similarity index 100%
rename from WebCore/platform/graphics/gtk/VideoSinkGStreamer.h
rename to WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
diff --git a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
new file mode 100644
index 0000000..daee506
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -0,0 +1,763 @@
+/*
+ *  Copyright (C) 2009, 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "WebKitWebSourceGStreamer.h"
+
+#include "Document.h"
+#include "GOwnPtr.h"
+#include "GRefPtr.h"
+#include "Noncopyable.h"
+#include "NotImplemented.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include <wtf/text/CString.h>
+#include <gst/app/gstappsrc.h>
+#include <gst/pbutils/missing-plugins.h>
+
+using namespace WebCore;
+
+class StreamingClient : public Noncopyable, public ResourceHandleClient {
+    public:
+        StreamingClient(WebKitWebSrc*);
+        virtual ~StreamingClient();
+
+        virtual void willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse&);
+        virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
+        virtual void didReceiveData(ResourceHandle*, const char*, int, int);
+        virtual void didFinishLoading(ResourceHandle*);
+        virtual void didFail(ResourceHandle*, const ResourceError&);
+        virtual void wasBlocked(ResourceHandle*);
+        virtual void cannotShowURL(ResourceHandle*);
+
+    private:
+        WebKitWebSrc* m_src;
+};
+
+#define WEBKIT_WEB_SRC_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SRC, WebKitWebSrcPrivate))
+struct _WebKitWebSrcPrivate {
+    GstAppSrc* appsrc;
+    GstPad* srcpad;
+    gchar* uri;
+
+    RefPtr<WebCore::Frame> frame;
+
+    StreamingClient* client;
+    RefPtr<ResourceHandle> resourceHandle;
+
+    guint64 offset;
+    guint64 size;
+    gboolean seekable;
+    gboolean paused;
+
+    guint64 requestedOffset;
+
+    guint needDataID;
+    guint enoughDataID;
+    guint seekID;
+
+    // icecast stuff
+    gboolean iradioMode;
+    gchar* iradioName;
+    gchar* iradioGenre;
+    gchar* iradioUrl;
+    gchar* iradioTitle;
+
+    // TRUE if appsrc's version is >= 0.10.27, see
+    // https://bugzilla.gnome.org/show_bug.cgi?id=609423
+    gboolean haveAppSrc27;
+};
+
+enum {
+    PROP_IRADIO_MODE = 1,
+    PROP_IRADIO_NAME,
+    PROP_IRADIO_GENRE,
+    PROP_IRADIO_URL,
+    PROP_IRADIO_TITLE
+};
+
+static GstStaticPadTemplate srcTemplate = GST_STATIC_PAD_TEMPLATE("src",
+                                                                  GST_PAD_SRC,
+                                                                  GST_PAD_ALWAYS,
+                                                                  GST_STATIC_CAPS_ANY);
+
+GST_DEBUG_CATEGORY_STATIC(webkit_web_src_debug);
+#define GST_CAT_DEFAULT webkit_web_src_debug
+
+static void webKitWebSrcUriHandlerInit(gpointer gIface,
+                                            gpointer ifaceData);
+
+static void webKitWebSrcFinalize(GObject* object);
+static void webKitWebSrcSetProperty(GObject* object, guint propID, const GValue* value, GParamSpec* pspec);
+static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value, GParamSpec* pspec);
+static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStateChange transition);
+
+static void webKitWebSrcNeedDataCb(GstAppSrc* appsrc, guint length, gpointer userData);
+static void webKitWebSrcEnoughDataCb(GstAppSrc* appsrc, gpointer userData);
+static gboolean webKitWebSrcSeekDataCb(GstAppSrc* appsrc, guint64 offset, gpointer userData);
+
+static void webKitWebSrcStop(WebKitWebSrc* src, bool seeking);
+
+static GstAppSrcCallbacks appsrcCallbacks = {
+    webKitWebSrcNeedDataCb,
+    webKitWebSrcEnoughDataCb,
+    webKitWebSrcSeekDataCb,
+    { 0 }
+};
+
+static void doInit(GType gtype)
+{
+    static const GInterfaceInfo uriHandlerInfo = {
+        webKitWebSrcUriHandlerInit,
+        0, 0
+    };
+
+    GST_DEBUG_CATEGORY_INIT(webkit_web_src_debug, "webkitwebsrc", 0, "websrc element");
+    g_type_add_interface_static(gtype, GST_TYPE_URI_HANDLER,
+                                &uriHandlerInfo);
+}
+
+GST_BOILERPLATE_FULL(WebKitWebSrc, webkit_web_src, GstBin, GST_TYPE_BIN, doInit);
+
+static void webkit_web_src_base_init(gpointer klass)
+{
+    GstElementClass* eklass = GST_ELEMENT_CLASS(klass);
+
+    gst_element_class_add_pad_template(eklass,
+                                       gst_static_pad_template_get(&srcTemplate));
+    gst_element_class_set_details_simple(eklass,
+                                         (gchar*) "WebKit Web source element",
+                                         (gchar*) "Source",
+                                         (gchar*) "Handles HTTP/HTTPS uris",
+                                         (gchar*) "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
+}
+
+static void webkit_web_src_class_init(WebKitWebSrcClass* klass)
+{
+    GObjectClass* oklass = G_OBJECT_CLASS(klass);
+    GstElementClass* eklass = GST_ELEMENT_CLASS(klass);
+
+    oklass->finalize = webKitWebSrcFinalize;
+    oklass->set_property = webKitWebSrcSetProperty;
+    oklass->get_property = webKitWebSrcGetProperty;
+
+    // icecast stuff
+    g_object_class_install_property(oklass,
+                                    PROP_IRADIO_MODE,
+                                    g_param_spec_boolean("iradio-mode",
+                                                         "iradio-mode",
+                                                         "Enable internet radio mode (extraction of shoutcast/icecast metadata)",
+                                                         FALSE,
+                                                         (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
+
+    g_object_class_install_property(oklass,
+                                    PROP_IRADIO_NAME,
+                                    g_param_spec_string("iradio-name",
+                                                        "iradio-name",
+                                                        "Name of the stream",
+                                                        0,
+                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
+
+    g_object_class_install_property(oklass,
+                                    PROP_IRADIO_GENRE,
+                                    g_param_spec_string("iradio-genre",
+                                                        "iradio-genre",
+                                                        "Genre of the stream",
+                                                        0,
+                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
+                                                        
+    g_object_class_install_property(oklass,
+                                    PROP_IRADIO_URL,
+                                    g_param_spec_string("iradio-url",
+                                                        "iradio-url",
+                                                        "Homepage URL for radio stream",
+                                                        0,
+                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
+
+    g_object_class_install_property(oklass,
+                                    PROP_IRADIO_TITLE,
+                                    g_param_spec_string("iradio-title",
+                                                        "iradio-title",
+                                                        "Name of currently playing song",
+                                                        0,
+                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
+
+    eklass->change_state = webKitWebSrcChangeState;
+
+    g_type_class_add_private(klass, sizeof(WebKitWebSrcPrivate));
+}
+
+static void webkit_web_src_init(WebKitWebSrc* src,
+                                WebKitWebSrcClass* gKlass)
+{
+    GstPadTemplate* padTemplate = gst_static_pad_template_get(&srcTemplate);
+    GstPad* targetpad;
+    WebKitWebSrcPrivate* priv = WEBKIT_WEB_SRC_GET_PRIVATE(src);
+
+    src->priv = priv;
+
+    priv->client = new StreamingClient(src);
+
+    priv->srcpad = gst_ghost_pad_new_no_target_from_template("src",
+                                                             padTemplate);
+
+    gst_element_add_pad(GST_ELEMENT(src), priv->srcpad);
+
+    priv->appsrc = GST_APP_SRC(gst_element_factory_make("appsrc", 0));
+    if (!priv->appsrc) {
+        GST_ERROR_OBJECT(src, "Failed to create appsrc");
+        return;
+    }
+
+    GstElementFactory* factory = GST_ELEMENT_FACTORY(GST_ELEMENT_GET_CLASS(priv->appsrc)->elementfactory);
+    priv->haveAppSrc27 = gst_plugin_feature_check_version(GST_PLUGIN_FEATURE(factory), 0, 10, 27);
+
+    gst_bin_add(GST_BIN(src), GST_ELEMENT(priv->appsrc));
+
+    targetpad = gst_element_get_static_pad(GST_ELEMENT(priv->appsrc), "src");
+    gst_ghost_pad_set_target(GST_GHOST_PAD(priv->srcpad), targetpad);
+    gst_object_unref(targetpad);
+
+    gst_app_src_set_callbacks(priv->appsrc, &appsrcCallbacks, src, 0);
+    gst_app_src_set_emit_signals(priv->appsrc, FALSE);
+    gst_app_src_set_stream_type(priv->appsrc, GST_APP_STREAM_TYPE_SEEKABLE);
+
+    // 512k is a abitrary number but we should choose a value
+    // here to not pause/unpause the SoupMessage too often and
+    // to make sure there's always some data available for
+    // GStreamer to handle.
+    gst_app_src_set_max_bytes(priv->appsrc, 512 * 1024);
+
+    // Emit the need-data signal if the queue contains less
+    // than 20% of data. Without this the need-data signal
+    // is emitted when the queue is empty, we then dispatch
+    // the soup message unpausing to the main loop and from
+    // there unpause the soup message. This already takes
+    // quite some time and libsoup even needs some more time
+    // to actually provide data again. If we do all this
+    // already if the queue is 20% empty, it's much more
+    // likely that libsoup already provides new data before
+    // the queue is really empty.
+    // This might need tweaking for ports not using libsoup.
+    if (priv->haveAppSrc27)
+        g_object_set(priv->appsrc, "min-percent", 20, NULL);
+
+    webKitWebSrcStop(src, false);
+}
+
+static void webKitWebSrcFinalize(GObject* object)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    delete priv->client;
+
+    g_free(priv->uri);
+
+    GST_CALL_PARENT(G_OBJECT_CLASS, finalize, ((GObject* )(src)));
+}
+
+static void webKitWebSrcSetProperty(GObject* object, guint propID, const GValue* value, GParamSpec* pspec)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    switch (propID) {
+    case PROP_IRADIO_MODE:
+        priv->iradioMode = g_value_get_boolean(value);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
+        break;
+    }
+}
+
+static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value, GParamSpec* pspec)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    switch (propID) {
+    case PROP_IRADIO_MODE:
+        g_value_set_boolean(value, priv->iradioMode);
+        break;
+    case PROP_IRADIO_NAME:
+        g_value_set_string(value, priv->iradioName);
+        break;
+    case PROP_IRADIO_GENRE:
+        g_value_set_string(value, priv->iradioGenre);
+        break;
+    case PROP_IRADIO_URL:
+        g_value_set_string(value, priv->iradioUrl);
+        break;
+    case PROP_IRADIO_TITLE:
+        g_value_set_string(value, priv->iradioTitle);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
+        break;
+    }
+}
+
+
+static void webKitWebSrcStop(WebKitWebSrc* src, bool seeking)
+{
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    if (priv->resourceHandle) {
+        priv->resourceHandle->cancel();
+        priv->resourceHandle.release();
+    }
+    priv->resourceHandle = 0;
+
+    if (priv->frame)
+        priv->frame.release();
+
+    if (priv->needDataID)
+        g_source_remove(priv->needDataID);
+    priv->needDataID = 0;
+
+    if (priv->enoughDataID)
+        g_source_remove(priv->enoughDataID);
+    priv->enoughDataID = 0;
+
+    if (priv->seekID)
+        g_source_remove(priv->seekID);
+    priv->seekID = 0;
+
+    priv->paused = FALSE;
+
+    g_free(priv->iradioName);
+    priv->iradioName = 0;
+
+    g_free(priv->iradioGenre);
+    priv->iradioGenre = 0;
+
+    g_free(priv->iradioUrl);
+    priv->iradioUrl = 0;
+
+    g_free(priv->iradioTitle);
+    priv->iradioTitle = 0;
+
+    if (priv->appsrc) {
+        gst_app_src_set_caps(priv->appsrc, 0);
+        if (!seeking)
+            gst_app_src_set_size(priv->appsrc, -1);
+    }
+
+    priv->offset = 0;
+    priv->seekable = FALSE;
+
+    if (!seeking) {
+        priv->size = 0;
+        priv->requestedOffset = 0;
+    }
+
+    GST_DEBUG_OBJECT(src, "Stopped request");
+}
+
+static bool webKitWebSrcStart(WebKitWebSrc* src)
+{
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    if (!priv->uri) {
+        GST_ERROR_OBJECT(src, "No URI provided");
+        return false;
+    }
+    
+    KURL url = KURL(KURL(), priv->uri);
+
+    ResourceRequest request(url);
+    request.setTargetType(ResourceRequestBase::TargetIsMedia);
+    request.setAllowCookies(true);
+
+    // Let Apple web servers know we want to access their nice movie trailers.
+    if (!g_ascii_strcasecmp("movies.apple.com", url.host().utf8().data()))
+        request.setHTTPUserAgent("Quicktime/7.2.0");
+
+    if (priv->frame) {
+        Document* document = priv->frame->document();
+        if (document)
+            request.setHTTPReferrer(document->documentURI());
+
+        FrameLoader* loader = priv->frame->loader();
+        if (loader)
+            loader->addExtraFieldsToSubresourceRequest(request);
+    }
+
+    if (priv->requestedOffset) {
+        GOwnPtr<gchar> val;
+
+        val.set(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", priv->requestedOffset));
+        request.setHTTPHeaderField("Range", val.get());
+    }
+
+    if (priv->iradioMode)
+        request.setHTTPHeaderField("icy-metadata", "1");
+
+    // Needed to use DLNA streaming servers
+    request.setHTTPHeaderField("transferMode.dlna", "Streaming");
+
+    priv->resourceHandle = ResourceHandle::create(request, priv->client, 0, false, false);
+    if (!priv->resourceHandle) {
+        GST_ERROR_OBJECT(src, "Failed to create ResourceHandle");
+        return false;
+    }
+
+    GST_DEBUG_OBJECT(src, "Started request");
+
+    return true;
+}
+
+static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStateChange transition)
+{
+    GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(element);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    switch (transition) {
+    case GST_STATE_CHANGE_NULL_TO_READY:
+        if (!priv->appsrc) {
+            gst_element_post_message(element,
+                                     gst_missing_element_message_new(element, "appsrc"));
+            GST_ELEMENT_ERROR(src, CORE, MISSING_PLUGIN, (0), ("no appsrc"));
+            return GST_STATE_CHANGE_FAILURE;
+        }
+        break;
+    default:
+        break;
+    }
+
+    ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
+    if (G_UNLIKELY(ret == GST_STATE_CHANGE_FAILURE)) {
+        GST_DEBUG_OBJECT(src, "State change failed");
+        return ret;
+    }
+
+    switch (transition) {
+    case GST_STATE_CHANGE_READY_TO_PAUSED:
+        GST_DEBUG_OBJECT(src, "READY->PAUSED");
+        if (!webKitWebSrcStart(src))
+            ret = GST_STATE_CHANGE_FAILURE;
+        break;
+    case GST_STATE_CHANGE_PAUSED_TO_READY:
+        GST_DEBUG_OBJECT(src, "PAUSED->READY");
+        webKitWebSrcStop(src, false);
+        break;
+    default:
+        break;
+    }
+
+    return ret;
+}
+
+// uri handler interface
+
+static GstURIType webKitWebSrcUriGetType(void)
+{
+    return GST_URI_SRC;
+}
+
+static gchar** webKitWebSrcGetProtocols(void)
+{
+    static gchar* protocols[] = {(gchar*) "http", (gchar*) "https", 0 };
+
+    return protocols;
+}
+
+static const gchar* webKitWebSrcGetUri(GstURIHandler* handler)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(handler);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    return priv->uri;
+}
+
+static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(handler);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    if (GST_STATE(src) >= GST_STATE_PAUSED) {
+        GST_ERROR_OBJECT(src, "URI can only be set in states < PAUSED");
+        return FALSE;
+    }
+
+    g_free(priv->uri);
+    priv->uri = 0;
+
+    if (!uri)
+        return TRUE;
+
+    KURL url(KURL(), uri);
+
+    if (!url.isValid() || !url.protocolInHTTPFamily()) {
+        GST_ERROR_OBJECT(src, "Invalid URI '%s'", uri);
+        return FALSE;
+    }
+
+    priv->uri = g_strdup(url.string().utf8().data());
+    return TRUE;
+}
+
+static void webKitWebSrcUriHandlerInit(gpointer gIface, gpointer ifaceData)
+{
+    GstURIHandlerInterface* iface = (GstURIHandlerInterface *) gIface;
+
+    iface->get_type = webKitWebSrcUriGetType;
+    iface->get_protocols = webKitWebSrcGetProtocols;
+    iface->get_uri = webKitWebSrcGetUri;
+    iface->set_uri = webKitWebSrcSetUri;
+}
+
+// appsrc callbacks
+
+static gboolean webKitWebSrcNeedDataMainCb(WebKitWebSrc* src)
+{
+    WebKitWebSrcPrivate* priv = src->priv;
+
+#if USE(NETWORK_SOUP)
+    ResourceHandleInternal* d = priv->resourceHandle->getInternal();
+    if (d->m_msg)
+        soup_session_unpause_message(ResourceHandle::defaultSession(), d->m_msg);
+#endif
+    // Ports not using libsoup need to call the unpause/schedule API of their
+    // underlying network implementation here.
+
+    priv->paused = FALSE;
+    priv->needDataID = 0;
+    return FALSE;
+}
+
+static void webKitWebSrcNeedDataCb(GstAppSrc* appsrc, guint length, gpointer userData)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    GST_DEBUG_OBJECT(src, "Need more data: %u", length);
+    if (priv->needDataID || !priv->paused)
+        return;
+
+    priv->needDataID = g_timeout_add_full(G_PRIORITY_DEFAULT, 0, (GSourceFunc) webKitWebSrcNeedDataMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
+}
+
+static gboolean webKitWebSrcEnoughDataMainCb(WebKitWebSrc* src)
+{
+    WebKitWebSrcPrivate* priv = src->priv;
+
+#if USE(NETWORK_SOUP)
+    ResourceHandleInternal* d = priv->resourceHandle->getInternal();
+    soup_session_pause_message(ResourceHandle::defaultSession(), d->m_msg);
+#endif
+    // Ports not using libsoup need to call the pause/unschedule API of their
+    // underlying network implementation here.
+
+    priv->paused = TRUE;
+    priv->enoughDataID = 0;
+    return FALSE;
+}
+
+static void webKitWebSrcEnoughDataCb(GstAppSrc* appsrc, gpointer userData)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    GST_DEBUG_OBJECT(src, "Have enough data");
+    if (priv->enoughDataID || priv->paused)
+        return;
+
+    priv->enoughDataID = g_timeout_add_full(G_PRIORITY_DEFAULT, 0, (GSourceFunc) webKitWebSrcEnoughDataMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
+}
+
+static gboolean webKitWebSrcSeekMainCb(WebKitWebSrc* src)
+{
+    webKitWebSrcStop(src, true);
+    webKitWebSrcStart(src);
+
+    return FALSE;
+}
+
+static gboolean webKitWebSrcSeekDataCb(GstAppSrc* appsrc, guint64 offset, gpointer userData)
+{
+    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    GST_DEBUG_OBJECT(src, "Seeking to offset: %" G_GUINT64_FORMAT, offset);
+    if (offset == priv->offset)
+        return TRUE;
+
+    if (!priv->seekable)
+        return FALSE;
+    if (offset > priv->size)
+        return FALSE;
+
+    GST_DEBUG_OBJECT(src, "Doing range-request seek");
+    priv->requestedOffset = offset;
+    if (priv->seekID)
+        g_source_remove(priv->seekID);
+    priv->seekID = g_timeout_add_full(G_PRIORITY_DEFAULT, 0, (GSourceFunc) webKitWebSrcSeekMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
+    
+    return TRUE;
+}
+
+void webKitWebSrcSetFrame(WebKitWebSrc* src, WebCore::Frame* frame)
+{
+    WebKitWebSrcPrivate* priv = src->priv;
+
+    priv->frame = frame;
+}
+
+StreamingClient::StreamingClient(WebKitWebSrc* src) : m_src(src)
+{
+
+}
+
+StreamingClient::~StreamingClient()
+{
+
+}
+
+void StreamingClient::willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse&)
+{
+}
+
+void StreamingClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
+{
+    WebKitWebSrcPrivate* priv = m_src->priv;
+
+    GST_DEBUG_OBJECT(m_src, "Received response: %d", response.httpStatusCode());
+
+    // If we seeked we need 206 == PARTIAL_CONTENT
+    if (priv->requestedOffset && response.httpStatusCode() != 206) {
+        GST_ELEMENT_ERROR(m_src, RESOURCE, READ, (0), (0));
+        gst_app_src_end_of_stream(priv->appsrc);
+        webKitWebSrcStop(m_src, false);
+        return;
+    }
+
+    long long length = response.expectedContentLength();
+    if (length > 0) {
+        length += priv->requestedOffset;
+        gst_app_src_set_size(priv->appsrc, length);
+        if (!priv->haveAppSrc27) {
+            gst_segment_set_duration(&GST_BASE_SRC(priv->appsrc)->segment, GST_FORMAT_BYTES, length);
+            gst_element_post_message(GST_ELEMENT(priv->appsrc),
+                                     gst_message_new_duration(GST_OBJECT(priv->appsrc),
+                                                              GST_FORMAT_BYTES, length));
+        }
+    }
+
+    priv->size = length >= 0 ? length : 0;
+    priv->seekable = length > 0 && g_ascii_strcasecmp("none", response.httpHeaderField("Accept-Ranges").utf8().data());
+
+    // icecast stuff
+    String value = response.httpHeaderField("icy-metaint");
+    if (!value.isEmpty()) {
+        gchar* endptr = 0;
+        gint64 icyMetaInt = g_ascii_strtoll(value.utf8().data(), &endptr, 10);
+            
+        if (endptr && *endptr == '\0' && icyMetaInt > 0) {
+            GstCaps* caps = gst_caps_new_simple("application/x-icy", "metadata-interval", G_TYPE_INT, (gint) icyMetaInt, NULL);
+
+            gst_app_src_set_caps(priv->appsrc, caps);
+            gst_caps_unref(caps);
+        }
+    }
+
+    GstTagList* tags = gst_tag_list_new();
+    value = response.httpHeaderField("icy-name");
+    if (!value.isEmpty()) {
+        g_free(priv->iradioName);
+        priv->iradioName = g_strdup(value.utf8().data());
+        g_object_notify(G_OBJECT(m_src), "iradio-name");
+        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_ORGANIZATION, priv->iradioName, NULL);
+    }
+    value = response.httpHeaderField("icy-genre");
+    if (!value.isEmpty()) {
+        g_free(priv->iradioGenre);
+        priv->iradioGenre = g_strdup(value.utf8().data());
+        g_object_notify(G_OBJECT(m_src), "iradio-genre");
+        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_GENRE, priv->iradioGenre, NULL);
+    }
+    value = response.httpHeaderField("icy-url");
+    if (!value.isEmpty()) {
+        g_free(priv->iradioUrl);
+        priv->iradioUrl = g_strdup(value.utf8().data());
+        g_object_notify(G_OBJECT(m_src), "iradio-url");
+        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_LOCATION, priv->iradioUrl, NULL);
+    }
+    value = response.httpHeaderField("icy-title");
+    if (!value.isEmpty()) {
+        g_free(priv->iradioTitle);
+        priv->iradioTitle = g_strdup(value.utf8().data());
+        g_object_notify(G_OBJECT(m_src), "iradio-title");
+        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE, priv->iradioTitle, NULL);
+    }
+
+    if (gst_tag_list_is_empty(tags))
+        gst_tag_list_free(tags);
+    else
+        gst_element_found_tags_for_pad(GST_ELEMENT(m_src), m_src->priv->srcpad, tags);
+}
+
+void StreamingClient::didReceiveData(ResourceHandle* handle, const char* data, int length, int lengthReceived)
+{
+    WebKitWebSrcPrivate* priv = m_src->priv;
+
+    GST_LOG_OBJECT(m_src, "Have %d bytes of data", length);
+
+    if (priv->seekID || handle != priv->resourceHandle) {
+        GST_DEBUG_OBJECT(m_src, "Seek in progress, ignoring data");
+        return;
+    }
+
+    GstBuffer* buffer = gst_buffer_new_and_alloc(length);
+
+    memcpy(GST_BUFFER_DATA(buffer), data, length);
+    GST_BUFFER_OFFSET(buffer) = priv->offset;
+    priv->offset += length;
+    GST_BUFFER_OFFSET_END(buffer) = priv->offset;
+
+    GstFlowReturn ret = gst_app_src_push_buffer(priv->appsrc, buffer);
+    if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
+        GST_ELEMENT_ERROR(m_src, CORE, FAILED, (0), (0));
+}
+
+void StreamingClient::didFinishLoading(ResourceHandle*)
+{
+    GST_DEBUG_OBJECT(m_src, "Have EOS");
+    gst_app_src_end_of_stream(m_src->priv->appsrc);
+}
+
+void StreamingClient::didFail(ResourceHandle*, const ResourceError& error)
+{
+    GST_ERROR_OBJECT(m_src, "Have failure: %s", error.localizedDescription().utf8().data());
+    GST_ELEMENT_ERROR(m_src, RESOURCE, FAILED, ("%s", error.localizedDescription().utf8().data()), (0));
+    gst_app_src_end_of_stream(m_src->priv->appsrc);
+}
+
+void StreamingClient::wasBlocked(ResourceHandle*)
+{
+}
+
+void StreamingClient::cannotShowURL(ResourceHandle*)
+{
+}
+
diff --git a/WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.h b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
similarity index 100%
rename from WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.h
rename to WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.h
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index 5c320e0..29b83dc 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -288,7 +288,7 @@
     return layout;
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow*) const
 {
     if (run.length() == 0)
         return 0.0f;
diff --git a/WebCore/platform/graphics/gtk/FontPlatformData.h b/WebCore/platform/graphics/gtk/FontPlatformData.h
deleted file mode 100644
index d30b480..0000000
--- a/WebCore/platform/graphics/gtk/FontPlatformData.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * This file is part of the internal font implementation.  It should not be included by anyone other than
- * FontMac.cpp, FontWin.cpp and Font.cpp.
- *
- * Copyright (C) 2006 Apple Computer, Inc.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2007 Pioneer Research Center USA, Inc.
- * All rights reserved.
- *
- * 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 FontPlatformData_h
-#define FontPlatformData_h
-
-#include "GlyphBuffer.h"
-#include "FontDescription.h"
-#include <cairo.h>
-#if defined(USE_FREETYPE)
-#include <cairo-ft.h>
-#include <fontconfig/fcfreetype.h>
-#elif defined(USE_PANGO)
-#include <pango/pangocairo.h>
-#else
-#error "Must defined a font backend"
-#endif
-
-namespace WebCore {
-
-class String;
-
-class FontPlatformData {
-public:
-    FontPlatformData(WTF::HashTableDeletedValueType)
-#if defined(USE_FREETYPE)
-        : m_pattern(hashTableDeletedFontValue())
-        , m_fallbacks(0)
-#elif defined(USE_PANGO)
-        : m_context(0)
-        , m_font(hashTableDeletedFontValue())
-#else
-#error "Must defined a font backend"
-#endif
-        , m_scaledFont(0)
-        { }
-
-    FontPlatformData()
-#if defined(USE_FREETYPE)
-        : m_pattern(0)
-        , m_fallbacks(0)
-#elif defined(USE_PANGO)
-        : m_context(0)
-        , m_font(0)
-#else
-#error "Must defined a font backend"
-#endif
-        , m_scaledFont(0)
-        { }
-
-    FontPlatformData(const FontDescription&, const AtomicString& family);
-
-    FontPlatformData(float size, bool bold, bool italic);
-    FontPlatformData(cairo_font_face_t* fontFace, int size, bool bold, bool italic);
-    FontPlatformData(const FontPlatformData&);
-
-    ~FontPlatformData();
-
-    static bool init();
-
-    bool isFixedPitch();
-    float size() const { return m_size; }
-    bool syntheticBold() const { return m_syntheticBold; }
-    bool syntheticOblique() const { return m_syntheticOblique; }
-
-    cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
-
-    unsigned hash() const
-    {
-#if defined(USE_FREETYPE)
-        if (m_pattern)
-            return FcPatternHash(m_pattern);
-#endif
-        uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
-        return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
-    }
-
-    bool operator==(const FontPlatformData&) const;
-    FontPlatformData& operator=(const FontPlatformData&);
-    bool isHashTableDeletedValue() const {
-#if defined(USE_FREETYPE)
-        return m_pattern == hashTableDeletedFontValue();
-#elif defined(USE_PANGO)
-        return m_font == hashTableDeletedFontValue();
-#endif
-    };
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-#if defined(USE_FREETYPE)
-    FcPattern* m_pattern;
-    FcFontSet* m_fallbacks;
-#elif defined(USE_PANGO)
-    static PangoFontMap* m_fontMap;
-    static GHashTable* m_hashTable;
-
-    PangoContext* m_context;
-    PangoFont* m_font;
-#else
-#error "Must defined a font backend"
-#endif
-    float m_size;
-    bool m_syntheticBold;
-    bool m_syntheticOblique;
-    cairo_scaled_font_t* m_scaledFont;
-private:
-#if defined(USE_FREETYPE)
-    static FcPattern *hashTableDeletedFontValue() { return reinterpret_cast<FcPattern*>(-1); }
-#elif defined(USE_PANGO)
-    static PangoFont *hashTableDeletedFontValue() { return reinterpret_cast<PangoFont*>(-1); }
-#endif
-};
-
-}
-
-#endif
diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp b/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
deleted file mode 100644
index 0b1280e..0000000
--- a/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2009 Igalia S.L.
- * All rights reserved.
- *
- * 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 "FontPlatformData.h"
-
-#include "CString.h"
-#include "PlatformString.h"
-#include "FontDescription.h"
-
-#include <cairo-ft.h>
-#include <cairo.h>
-#include <fontconfig/fcfreetype.h>
-#include <gtk/gtk.h>
-
-namespace WebCore {
-
-FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
-    : m_pattern(0)
-    , m_fallbacks(0)
-    , m_size(fontDescription.computedPixelSize())
-    , m_syntheticBold(false)
-    , m_syntheticOblique(false)
-    , m_scaledFont(0)
-{
-    FontPlatformData::init();
-
-    CString familyNameString = familyName.string().utf8();
-    const char* fcfamily = familyNameString.data();
-    int fcslant = FC_SLANT_ROMAN;
-    // FIXME: Map all FontWeight values to fontconfig weights.
-    int fcweight = FC_WEIGHT_NORMAL;
-    double fcsize = fontDescription.computedPixelSize();
-    if (fontDescription.italic())
-        fcslant = FC_SLANT_ITALIC;
-    if (fontDescription.weight() >= FontWeight600)
-        fcweight = FC_WEIGHT_BOLD;
-
-    int type = fontDescription.genericFamily();
-
-    FcPattern* pattern = FcPatternCreate();
-    cairo_font_face_t* fontFace;
-    static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
-    const cairo_font_options_t* options = NULL;
-    cairo_matrix_t fontMatrix;
-
-    if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
-        goto freePattern;
-
-    switch (type) {
-    case FontDescription::SerifFamily:
-        fcfamily = "serif";
-        break;
-    case FontDescription::SansSerifFamily:
-        fcfamily = "sans-serif";
-        break;
-    case FontDescription::MonospaceFamily:
-        fcfamily = "monospace";
-        break;
-    case FontDescription::StandardFamily:
-        fcfamily = "sans-serif";
-        break;
-    case FontDescription::NoFamily:
-    default:
-        fcfamily = NULL;
-        break;
-    }
-
-    if (fcfamily && !FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
-        goto freePattern;
-    if (!FcPatternAddInteger(pattern, FC_WEIGHT, fcweight))
-        goto freePattern;
-    if (!FcPatternAddInteger(pattern, FC_SLANT, fcslant))
-        goto freePattern;
-    if (!FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fcsize))
-        goto freePattern;
-
-    FcConfigSubstitute(NULL, pattern, FcMatchPattern);
-    FcDefaultSubstitute(pattern);
-
-    FcResult fcresult;
-    m_pattern = FcFontMatch(NULL, pattern, &fcresult);
-    // FIXME: should we set some default font?
-    if (!m_pattern)
-        goto freePattern;
-    fontFace = cairo_ft_font_face_create_for_pattern(m_pattern);
-    cairo_matrix_t ctm;
-    cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
-    cairo_matrix_init_identity(&ctm);
-
-    if (GdkScreen* screen = gdk_screen_get_default())
-        options = gdk_screen_get_font_options(screen);
-
-    // gdk_screen_get_font_options() returns NULL if no default options are
-    // set, so we always have to check.
-    if (!options)
-        options = defaultOptions;
-
-    m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
-    cairo_font_face_destroy(fontFace);
-
-freePattern:
-    FcPatternDestroy(pattern);
-}
-
-FontPlatformData::FontPlatformData(float size, bool bold, bool italic)
-    : m_pattern(0)
-    , m_fallbacks(0)
-    , m_size(size)
-    , m_syntheticBold(bold)
-    , m_syntheticOblique(italic)
-    , m_scaledFont(0)
-{
-}
-
-FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, int size, bool bold, bool italic)
-    : m_pattern(0)
-    , m_fallbacks(0)
-    , m_size(size)
-    , m_syntheticBold(bold)
-    , m_syntheticOblique(italic)
-    , m_scaledFont(0)
-{
-    cairo_matrix_t fontMatrix;
-    cairo_matrix_init_scale(&fontMatrix, size, size);
-    cairo_matrix_t ctm;
-    cairo_matrix_init_identity(&ctm);
-    static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
-    const cairo_font_options_t* options = NULL;
-
-    if (GdkScreen* screen = gdk_screen_get_default())
-        options = gdk_screen_get_font_options(screen);
-
-    // gdk_screen_get_font_options() returns NULL if no default options are
-    // set, so we always have to check.
-    if (!options)
-        options = defaultOptions;
-
-    m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
-}
-
-FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
-{
-    // Check for self-assignment.
-    if (this == &other)
-        return *this;
-
-    m_size = other.m_size;
-    m_syntheticBold = other.m_syntheticBold;
-    m_syntheticOblique = other.m_syntheticOblique;
-
-    if (other.m_scaledFont)
-        cairo_scaled_font_reference(other.m_scaledFont);
-    if (m_scaledFont)
-        cairo_scaled_font_destroy(m_scaledFont);
-    m_scaledFont = other.m_scaledFont;
-
-    if (other.m_pattern)
-        FcPatternReference(other.m_pattern);
-    if (m_pattern)
-        FcPatternDestroy(m_pattern);
-    m_pattern = other.m_pattern;
-
-    if (m_fallbacks) {
-        FcFontSetDestroy(m_fallbacks);
-        // This will be re-created on demand.
-        m_fallbacks = 0;
-    }
-
-    return *this;
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& other)
-    : m_pattern(0)
-    , m_fallbacks(0)
-    , m_scaledFont(0)
-{
-    *this = other;
-}
-
-bool FontPlatformData::init()
-{
-    static bool initialized = false;
-    if (initialized)
-        return true;
-    if (!FcInit()) {
-        fprintf(stderr, "Can't init font config library\n");
-        return false;
-    }
-    initialized = true;
-    return true;
-}
-
-FontPlatformData::~FontPlatformData()
-{
-    if (m_pattern && ((FcPattern*)-1 != m_pattern)) {
-        FcPatternDestroy(m_pattern);
-        m_pattern = 0;
-    }
-
-    if (m_fallbacks) {
-        FcFontSetDestroy(m_fallbacks);
-        m_fallbacks = 0;
-    }
-
-    if (m_scaledFont)
-        cairo_scaled_font_destroy(m_scaledFont);
-}
-
-bool FontPlatformData::isFixedPitch()
-{
-    // TODO: Support isFixedPitch() for custom fonts.
-    if (!m_pattern)
-        return false;
-
-    int spacing;
-    if (FcPatternGetInteger(m_pattern, FC_SPACING, 0, &spacing) == FcResultMatch)
-        return spacing == FC_MONO;
-    return false;
-}
-
-bool FontPlatformData::operator==(const FontPlatformData& other) const
-{
-    if (m_pattern == other.m_pattern)
-        return true;
-    if (m_pattern == 0 || m_pattern == reinterpret_cast<FcPattern*>(-1)
-            || other.m_pattern == 0 || other.m_pattern == reinterpret_cast<FcPattern*>(-1))
-        return false;
-    return FcPatternEqual(m_pattern, other.m_pattern);
-}
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
-    return String();
-}
-#endif
-
-}
diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp b/WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp
index 8a1a5f1..59cd3da 100644
--- a/WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp
+++ b/WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp
@@ -25,9 +25,9 @@
 #include "config.h"
 #include "FontPlatformData.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "FontDescription.h"
+#include <wtf/text/CString.h>
 #include <cairo.h>
 #include <assert.h>
 
@@ -137,7 +137,7 @@
 {
 }
 
-FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, int size, bool bold, bool italic)
+FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, float size, bool bold, bool italic)
     : m_context(0)
     , m_font(0)
     , m_size(size)
diff --git a/WebCore/platform/graphics/gtk/IconGtk.cpp b/WebCore/platform/graphics/gtk/IconGtk.cpp
index 71b897e..d56b52d 100644
--- a/WebCore/platform/graphics/gtk/IconGtk.cpp
+++ b/WebCore/platform/graphics/gtk/IconGtk.cpp
@@ -30,10 +30,10 @@
 #include "config.h"
 #include "Icon.h"
 
-#include "CString.h"
 #include "GraphicsContext.h"
 #include "MIMETypeRegistry.h"
 #include "PassRefPtr.h"
+#include <wtf/text/CString.h>
 
 #include <gtk/gtk.h>
 
diff --git a/WebCore/platform/graphics/gtk/ImageGtk.cpp b/WebCore/platform/graphics/gtk/ImageGtk.cpp
index c62d988..daa70ef 100644
--- a/WebCore/platform/graphics/gtk/ImageGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageGtk.cpp
@@ -26,12 +26,72 @@
 #include "config.h"
 
 #include "BitmapImage.h"
-#include "CString.h"
 #include "GOwnPtr.h"
-
+#include "SharedBuffer.h"
+#include <wtf/text/CString.h>
 #include <cairo.h>
 #include <gtk/gtk.h>
 
+#ifdef _WIN32
+#  include <mbstring.h>
+#  include <shlobj.h>
+/* search for data relative to where we are installed */
+
+static HMODULE hmodule;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL,
+    DWORD     fdwReason,
+    LPVOID    lpvReserved)
+{
+    switch (fdwReason) {
+    case DLL_PROCESS_ATTACH:
+        hmodule = hinstDLL;
+        break;
+    }
+
+    return TRUE;
+}
+#ifdef __cplusplus
+}
+#endif
+
+static char *
+get_webkit_datadir(void)
+{
+    static char retval[1000];
+    static int beenhere = 0;
+
+    unsigned char *p;
+
+    if (beenhere)
+        return retval;
+
+    if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10))
+        return DATA_DIR;
+
+    p = _mbsrchr((const unsigned char *) retval, '\\');
+    *p = '\0';
+    p = _mbsrchr((const unsigned char *) retval, '\\');
+    if (p) {
+        if (!stricmp((const char *) (p+1), "bin"))
+            *p = '\0';
+    }
+    strcat(retval, "\\share");
+
+    beenhere = 1;
+
+    return retval;
+}
+
+#undef DATA_DIR
+#define DATA_DIR get_webkit_datadir ()
+#endif
+
+
 namespace WTF {
 
 template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo* info)
@@ -96,8 +156,13 @@
     CString fileName;
     if (!strcmp("missingImage", name))
         fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
-    if (fileName.isNull())
-        fileName = String::format("%s/webkit-1.0/images/%s.png", DATA_DIR, name).utf8();
+    if (fileName.isNull()) {
+        gchar* imagename = g_strdup_printf("%s.png", name);
+        gchar* glibFileName = g_build_filename(DATA_DIR, "webkit-1.0", "images", imagename, 0);
+        fileName = glibFileName;
+        g_free(imagename);
+        g_free(glibFileName);
+    }
 
     return loadImageFromFile(fileName);
 }
@@ -107,12 +172,12 @@
     return loadImageFromFile(getThemeIconFileName(name, size));
 }
 
-static inline unsigned char* getCairoSurfacePixel(unsigned char* data, uint x, uint y, uint rowStride)
+static inline unsigned char* getCairoSurfacePixel(unsigned char* data, unsigned x, unsigned y, unsigned rowStride)
 {
     return data + (y * rowStride) + x * 4;
 }
 
-static inline guchar* getGdkPixbufPixel(guchar* data, uint x, uint y, uint rowStride)
+static inline guchar* getGdkPixbufPixel(guchar* data, unsigned x, unsigned y, unsigned rowStride)
 {
     return data + (y * rowStride) + x * 4;
 }
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
deleted file mode 100644
index e1c9fd2..0000000
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ /dev/null
@@ -1,1386 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 Apple Inc.  All rights reserved.
- * Copyright (C) 2007 Collabora Ltd.  All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
- * Copyright (C) 2009, 2010 Igalia S.L
- *
- * 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
- * aint 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"
-
-#if ENABLE(VIDEO)
-
-#include "MediaPlayerPrivateGStreamer.h"
-
-
-#include "CString.h"
-#include "DataSourceGStreamer.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "GOwnPtrGtk.h"
-#include "GraphicsContext.h"
-#include "IntRect.h"
-#include "KURL.h"
-#include "MIMETypeRegistry.h"
-#include "MediaPlayer.h"
-#include "NotImplemented.h"
-#include "ScrollView.h"
-#include "SecurityOrigin.h"
-#include "TimeRanges.h"
-#include "VideoSinkGStreamer.h"
-#include "WebKitWebSourceGStreamer.h"
-#include "Widget.h"
-
-#include <gst/gst.h>
-#include <gst/interfaces/mixer.h>
-#include <gst/interfaces/xoverlay.h>
-#include <gst/video/video.h>
-#include <limits>
-#include <math.h>
-#include <wtf/gtk/GOwnPtr.h>
-
-// GstPlayFlags flags from playbin2. It is the policy of GStreamer to
-// not publicly expose element-specific enums. That's why this
-// GstPlayFlags enum has been copied here.
-typedef enum {
-    GST_PLAY_FLAG_VIDEO         = 0x00000001,
-    GST_PLAY_FLAG_AUDIO         = 0x00000002,
-    GST_PLAY_FLAG_TEXT          = 0x00000004,
-    GST_PLAY_FLAG_VIS           = 0x00000008,
-    GST_PLAY_FLAG_SOFT_VOLUME   = 0x00000010,
-    GST_PLAY_FLAG_NATIVE_AUDIO  = 0x00000020,
-    GST_PLAY_FLAG_NATIVE_VIDEO  = 0x00000040,
-    GST_PLAY_FLAG_DOWNLOAD      = 0x00000080,
-    GST_PLAY_FLAG_BUFFERING     = 0x000000100
-} GstPlayFlags;
-
-using namespace std;
-
-namespace WebCore {
-
-static int greatestCommonDivisor(int a, int b)
-{
-    while (b) {
-        int temp = a;
-        a = b;
-        b = temp % b;
-    }
-
-    return ABS(a);
-}
-
-gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data)
-{
-    GOwnPtr<GError> err;
-    GOwnPtr<gchar> debug;
-    MediaPlayer::NetworkState error;
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    bool issueError = true;
-    bool attemptNextLocation = false;
-
-    if (message->structure) {
-        const gchar* messageTypeName = gst_structure_get_name(message->structure);
-
-        // Redirect messages are sent from elements, like qtdemux, to
-        // notify of the new location(s) of the media.
-        if (!g_strcmp0(messageTypeName, "redirect")) {
-            mp->mediaLocationChanged(message);
-            return true;
-        }
-    }
-
-    switch (GST_MESSAGE_TYPE(message)) {
-    case GST_MESSAGE_ERROR:
-        if (mp && mp->pipelineReset())
-            break;
-        gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
-        LOG_VERBOSE(Media, "Error: %d, %s", err->code,  err->message);
-
-        error = MediaPlayer::Empty;
-        if (err->code == GST_STREAM_ERROR_CODEC_NOT_FOUND
-            || err->code == GST_STREAM_ERROR_WRONG_TYPE
-            || err->code == GST_STREAM_ERROR_FAILED
-            || err->code == GST_CORE_ERROR_MISSING_PLUGIN
-            || err->code == GST_RESOURCE_ERROR_NOT_FOUND)
-            error = MediaPlayer::FormatError;
-        else if (err->domain == GST_STREAM_ERROR) {
-            error = MediaPlayer::DecodeError;
-            attemptNextLocation = true;
-        } else if (err->domain == GST_RESOURCE_ERROR)
-            error = MediaPlayer::NetworkError;
-
-        if (mp) {
-            if (attemptNextLocation)
-                issueError = !mp->loadNextLocation();
-            if (issueError)
-                mp->loadingFailed(error);
-        }
-        break;
-    case GST_MESSAGE_EOS:
-        LOG_VERBOSE(Media, "End of Stream");
-        mp->didEnd();
-        break;
-    case GST_MESSAGE_STATE_CHANGED:
-        mp->updateStates();
-        break;
-    case GST_MESSAGE_BUFFERING:
-        mp->processBufferingStats(message);
-        break;
-    case GST_MESSAGE_DURATION:
-        LOG_VERBOSE(Media, "Duration changed");
-        mp->durationChanged();
-        break;
-    default:
-        LOG_VERBOSE(Media, "Unhandled GStreamer message type: %s",
-                    GST_MESSAGE_TYPE_NAME(message));
-        break;
-    }
-    return true;
-}
-
-void mediaPlayerPrivateSourceChangedCallback(GObject *object, GParamSpec *pspec, gpointer data)
-{
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    GOwnPtr<GstElement> element;
-
-    g_object_get(mp->m_playBin, "source", &element.outPtr(), NULL);
-    gst_object_replace((GstObject**) &mp->m_source, (GstObject*) element.get());
-
-    if (WEBKIT_IS_WEB_SRC(element.get())) {
-        Frame* frame = mp->m_player->frameView() ? mp->m_player->frameView()->frame() : 0;
-
-        if (frame)
-            webKitWebSrcSetFrame(WEBKIT_WEB_SRC(element.get()), frame);
-    }
-}
-
-void mediaPlayerPrivateVolumeChangedCallback(GObject *element, GParamSpec *pspec, gpointer data)
-{
-    // This is called when playbin receives the notify::volume signal.
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    mp->volumeChanged();
-}
-
-gboolean notifyVolumeIdleCallback(gpointer data)
-{
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    mp->volumeChangedCallback();
-    return FALSE;
-}
-
-void mediaPlayerPrivateMuteChangedCallback(GObject *element, GParamSpec *pspec, gpointer data)
-{
-    // This is called when playbin receives the notify::mute signal.
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    mp->muteChanged();
-}
-
-gboolean notifyMuteIdleCallback(gpointer data)
-{
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    mp->muteChangedCallback();
-    return FALSE;
-}
-
-gboolean bufferingTimeoutCallback(gpointer data)
-{
-    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
-    return mp->queryBufferingStats();
-}
-
-static float playbackPosition(GstElement* playbin)
-{
-
-    float ret = 0.0;
-
-    GstQuery* query = gst_query_new_position(GST_FORMAT_TIME);
-    if (!gst_element_query(playbin, query)) {
-        LOG_VERBOSE(Media, "Position query failed...");
-        gst_query_unref(query);
-        return ret;
-    }
-
-    gint64 position;
-    gst_query_parse_position(query, 0, &position);
-
-    // Position is available only if the pipeline is not in GST_STATE_NULL or
-    // GST_STATE_READY state.
-    if (position !=  static_cast<gint64>(GST_CLOCK_TIME_NONE))
-        ret = static_cast<float>(position) / static_cast<float>(GST_SECOND);
-
-    LOG_VERBOSE(Media, "Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
-
-    gst_query_unref(query);
-
-    return ret;
-}
-
-
-void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer *buffer, MediaPlayerPrivate* playerPrivate)
-{
-    g_return_if_fail(GST_IS_BUFFER(buffer));
-    gst_buffer_replace(&playerPrivate->m_buffer, buffer);
-    playerPrivate->repaint();
-}
-
-MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
-{
-    return new MediaPlayerPrivate(player);
-}
-
-void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
-{
-    if (isAvailable())
-        registrar(create, getSupportedTypes, supportsType);
-}
-
-static bool gstInitialized = false;
-
-static bool doGstInit()
-{
-    // FIXME: We should pass the arguments from the command line
-    if (!gstInitialized) {
-        GOwnPtr<GError> error;
-        gstInitialized = gst_init_check(0, 0, &error.outPtr());
-        if (!gstInitialized) {
-            LOG_VERBOSE(Media, "Could not initialize GStreamer: %s",
-                        error ? error->message : "unknown error occurred");
-        } else {
-            gst_element_register(0, "webkitmediasrc", GST_RANK_PRIMARY,
-                                 WEBKIT_TYPE_DATA_SRC);
-            gst_element_register(0, "webkitwebsrc", GST_RANK_PRIMARY + 100,
-                                 WEBKIT_TYPE_WEB_SRC);
-        }
-
-    }
-    return gstInitialized;
-}
-
-bool MediaPlayerPrivate::isAvailable()
-{
-    if (!doGstInit())
-        return false;
-
-    GstElementFactory* factory = gst_element_factory_find("playbin2");
-    if (factory) {
-        gst_object_unref(GST_OBJECT(factory));
-        return true;
-    }
-    return false;
-}
-
-MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
-    : m_player(player)
-    , m_playBin(0)
-    , m_videoSink(0)
-    , m_fpsSink(0)
-    , m_source(0)
-    , m_seekTime(0)
-    , m_changingRate(false)
-    , m_endTime(numeric_limits<float>::infinity())
-    , m_networkState(MediaPlayer::Empty)
-    , m_readyState(MediaPlayer::HaveNothing)
-    , m_startedPlaying(false)
-    , m_isStreaming(false)
-    , m_size(IntSize())
-    , m_buffer(0)
-    , m_mediaLocations(0)
-    , m_mediaLocationCurrentIndex(0)
-    , m_resetPipeline(false)
-    , m_paused(true)
-    , m_seeking(false)
-    , m_playbackRate(1)
-    , m_errorOccured(false)
-    , m_volumeIdleId(0)
-    , m_mediaDuration(0)
-    , m_muteIdleId(0)
-    , m_startedBuffering(false)
-    , m_fillTimeoutId(0)
-    , m_maxTimeLoaded(0)
-    , m_fillStatus(0)
-{
-    if (doGstInit())
-        createGSTPlayBin();
-}
-
-MediaPlayerPrivate::~MediaPlayerPrivate()
-{
-    if (m_fillTimeoutId) {
-        g_source_remove(m_fillTimeoutId);
-        m_fillTimeoutId = 0;
-    }
-
-    if (m_volumeIdleId) {
-        g_source_remove(m_volumeIdleId);
-        m_volumeIdleId = 0;
-    }
-
-    if (m_muteIdleId) {
-        g_source_remove(m_muteIdleId);
-        m_muteIdleId = 0;
-    }
-
-    if (m_buffer)
-        gst_buffer_unref(m_buffer);
-    m_buffer = 0;
-
-    if (m_mediaLocations) {
-        gst_structure_free(m_mediaLocations);
-        m_mediaLocations = 0;
-    }
-
-    if (m_source) {
-        gst_object_unref(m_source);
-        m_source = 0;
-    }
-
-    if (m_playBin) {
-        gst_element_set_state(m_playBin, GST_STATE_NULL);
-        gst_object_unref(GST_OBJECT(m_playBin));
-    }
-
-    if (m_videoSink) {
-        g_object_unref(m_videoSink);
-        m_videoSink = 0;
-    }
-
-    if (m_fpsSink) {
-        g_object_unref(m_fpsSink);
-        m_fpsSink = 0;
-    }
-}
-
-void MediaPlayerPrivate::load(const String& url)
-{
-    LOG_VERBOSE(Media, "Load %s", url.utf8().data());
-    if (m_networkState != MediaPlayer::Loading) {
-        m_networkState = MediaPlayer::Loading;
-        m_player->networkStateChanged();
-    }
-    if (m_readyState != MediaPlayer::HaveNothing) {
-        m_readyState = MediaPlayer::HaveNothing;
-        m_player->readyStateChanged();
-    }
-
-    g_object_set(m_playBin, "uri", url.utf8().data(), NULL);
-    pause();
-}
-
-bool MediaPlayerPrivate::changePipelineState(GstState newState)
-{
-    ASSERT(newState == GST_STATE_PLAYING || newState == GST_STATE_PAUSED);
-
-    GstState currentState;
-    GstState pending;
-
-    gst_element_get_state(m_playBin, &currentState, &pending, 0);
-    if (currentState != newState && pending != newState) {
-        GstStateChangeReturn ret = gst_element_set_state(m_playBin, newState);
-        GstState pausedOrPlaying = newState == GST_STATE_PLAYING ? GST_STATE_PAUSED : GST_STATE_PLAYING;
-        if (currentState != pausedOrPlaying && ret == GST_STATE_CHANGE_FAILURE) {
-            loadingFailed(MediaPlayer::Empty);
-            return false;
-        }
-    }
-    return true;
-}
-
-void MediaPlayerPrivate::play()
-{
-    if (changePipelineState(GST_STATE_PLAYING))
-        LOG_VERBOSE(Media, "Play");
-}
-
-void MediaPlayerPrivate::pause()
-{
-    if (changePipelineState(GST_STATE_PAUSED))
-        LOG_VERBOSE(Media, "Pause");
-}
-
-float MediaPlayerPrivate::duration() const
-{
-    if (!m_playBin)
-        return 0.0;
-
-    if (m_errorOccured)
-        return 0.0;
-
-    if (m_mediaDuration)
-        return m_mediaDuration;
-
-    GstFormat timeFormat = GST_FORMAT_TIME;
-    gint64 timeLength = 0;
-
-    if (!gst_element_query_duration(m_playBin, &timeFormat, &timeLength) || timeFormat != GST_FORMAT_TIME || static_cast<guint64>(timeLength) == GST_CLOCK_TIME_NONE) {
-        LOG_VERBOSE(Media, "Time duration query failed.");
-        return numeric_limits<float>::infinity();
-    }
-
-    LOG_VERBOSE(Media, "Duration: %" GST_TIME_FORMAT, GST_TIME_ARGS(timeLength));
-
-    return (float) ((guint64) timeLength / 1000000000.0);
-    // FIXME: handle 3.14.9.5 properly
-}
-
-float MediaPlayerPrivate::currentTime() const
-{
-    if (!m_playBin)
-        return 0;
-
-    if (m_errorOccured)
-        return 0;
-
-    if (m_seeking)
-        return m_seekTime;
-
-    return playbackPosition(m_playBin);
-
-}
-
-void MediaPlayerPrivate::seek(float time)
-{
-    // Avoid useless seeking.
-    if (time == playbackPosition(m_playBin))
-        return;
-
-    if (!m_playBin)
-        return;
-
-    if (m_errorOccured)
-        return;
-
-    GstClockTime sec = (GstClockTime)(time * GST_SECOND);
-    LOG_VERBOSE(Media, "Seek: %" GST_TIME_FORMAT, GST_TIME_ARGS(sec));
-    if (!gst_element_seek(m_playBin, m_player->rate(),
-            GST_FORMAT_TIME,
-            (GstSeekFlags)(GST_SEEK_FLAG_FLUSH),
-            GST_SEEK_TYPE_SET, sec,
-            GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
-        LOG_VERBOSE(Media, "Seek to %f failed", time);
-    else {
-        m_seeking = true;
-        m_seekTime = sec;
-    }
-}
-
-void MediaPlayerPrivate::startEndPointTimerIfNeeded()
-{
-    notImplemented();
-}
-
-void MediaPlayerPrivate::cancelSeek()
-{
-    notImplemented();
-}
-
-void MediaPlayerPrivate::endPointTimerFired(Timer<MediaPlayerPrivate>*)
-{
-    notImplemented();
-}
-
-bool MediaPlayerPrivate::paused() const
-{
-    return m_paused;
-}
-
-bool MediaPlayerPrivate::seeking() const
-{
-    return m_seeking;
-}
-
-// Returns the size of the video
-IntSize MediaPlayerPrivate::naturalSize() const
-{
-    if (!hasVideo())
-        return IntSize();
-
-    GstPad* pad = gst_element_get_static_pad(m_videoSink, "sink");
-    if (!pad)
-        return IntSize();
-
-    int width = 0, height = 0;
-    GstCaps* caps = GST_PAD_CAPS(pad);
-    int pixelAspectRatioNumerator, pixelAspectRatioDenominator;
-    int displayWidth, displayHeight, displayAspectRatioGCD;
-    int originalWidth = 0, originalHeight = 0;
-
-    // TODO: handle possible clean aperture data. See
-    // https://bugzilla.gnome.org/show_bug.cgi?id=596571
-    // TODO: handle possible transformation matrix. See
-    // https://bugzilla.gnome.org/show_bug.cgi?id=596326
-
-    // Get the video PAR and original size.
-    if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps)
-        || !gst_video_format_parse_caps(caps, 0, &originalWidth, &originalHeight)
-        || !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
-                                                    &pixelAspectRatioDenominator)) {
-        gst_object_unref(GST_OBJECT(pad));
-        return IntSize();
-    }
-
-    gst_object_unref(GST_OBJECT(pad));
-
-    LOG_VERBOSE(Media, "Original video size: %dx%d", originalWidth, originalHeight);
-    LOG_VERBOSE(Media, "Pixel aspect ratio: %d/%d", pixelAspectRatioNumerator, pixelAspectRatioDenominator);
-
-    // Calculate DAR based on PAR and video size.
-    displayWidth = originalWidth * pixelAspectRatioNumerator;
-    displayHeight = originalHeight * pixelAspectRatioDenominator;
-
-    // Divide display width and height by their GCD to avoid possible overflows.
-    displayAspectRatioGCD = greatestCommonDivisor(displayWidth, displayHeight);
-    displayWidth /= displayAspectRatioGCD;
-    displayHeight /= displayAspectRatioGCD;
-
-    // Apply DAR to original video size. This is the same behavior as in xvimagesink's setcaps function.
-    if (!(originalHeight % displayHeight)) {
-        LOG_VERBOSE(Media, "Keeping video original height");
-        width = gst_util_uint64_scale_int(originalHeight, displayWidth, displayHeight);
-        height = originalHeight;
-    } else if (!(originalWidth % displayWidth)) {
-        LOG_VERBOSE(Media, "Keeping video original width");
-        height = gst_util_uint64_scale_int(originalWidth, displayHeight, displayWidth);
-        width = originalWidth;
-    } else {
-        LOG_VERBOSE(Media, "Approximating while keeping original video height");
-        width = gst_util_uint64_scale_int(originalHeight, displayWidth, displayHeight);
-        height = originalHeight;
-    }
-
-    LOG_VERBOSE(Media, "Natural size: %dx%d", width, height);
-    return IntSize(width, height);
-}
-
-bool MediaPlayerPrivate::hasVideo() const
-{
-    gint currentVideo = -1;
-    if (m_playBin)
-        g_object_get(m_playBin, "current-video", &currentVideo, NULL);
-    return currentVideo > -1;
-}
-
-bool MediaPlayerPrivate::hasAudio() const
-{
-    gint currentAudio = -1;
-    if (m_playBin)
-        g_object_get(m_playBin, "current-audio", &currentAudio, NULL);
-    return currentAudio > -1;
-}
-
-void MediaPlayerPrivate::setVolume(float volume)
-{
-    if (!m_playBin)
-        return;
-
-    g_object_set(m_playBin, "volume", static_cast<double>(volume), NULL);
-}
-
-void MediaPlayerPrivate::volumeChangedCallback()
-{
-    double volume;
-    g_object_get(m_playBin, "volume", &volume, NULL);
-    m_player->volumeChanged(static_cast<float>(volume));
-}
-
-void MediaPlayerPrivate::volumeChanged()
-{
-    if (m_volumeIdleId)
-        g_source_remove(m_volumeIdleId);
-    m_volumeIdleId = g_idle_add((GSourceFunc) notifyVolumeIdleCallback, this);
-}
-
-void MediaPlayerPrivate::setRate(float rate)
-{
-    // Avoid useless playback rate update.
-    if (m_playbackRate == rate)
-        return;
-
-    GstState state;
-    GstState pending;
-
-    gst_element_get_state(m_playBin, &state, &pending, 0);
-    if ((state != GST_STATE_PLAYING && state != GST_STATE_PAUSED)
-        || (pending == GST_STATE_PAUSED))
-        return;
-
-    if (m_isStreaming)
-        return;
-
-    m_playbackRate = rate;
-    m_changingRate = true;
-    float currentPosition = playbackPosition(m_playBin) * GST_SECOND;
-    GstSeekFlags flags = (GstSeekFlags)(GST_SEEK_FLAG_FLUSH);
-    gint64 start, end;
-    bool mute = false;
-
-    LOG_VERBOSE(Media, "Set Rate to %f", rate);
-    if (rate >= 0) {
-        // Mute the sound if the playback rate is too extreme.
-        // TODO: in other cases we should perform pitch adjustments.
-        mute = (bool) (rate < 0.8 || rate > 2);
-        start = currentPosition;
-        end = GST_CLOCK_TIME_NONE;
-    } else {
-        start = 0;
-        mute = true;
-
-        // If we are at beginning of media, start from the end to
-        // avoid immediate EOS.
-        if (currentPosition <= 0)
-            end = duration() * GST_SECOND;
-        else
-            end = currentPosition;
-    }
-
-    LOG_VERBOSE(Media, "Need to mute audio: %d", (int) mute);
-
-    if (!gst_element_seek(m_playBin, rate, GST_FORMAT_TIME, flags,
-                          GST_SEEK_TYPE_SET, start,
-                          GST_SEEK_TYPE_SET, end))
-        LOG_VERBOSE(Media, "Set rate to %f failed", rate);
-    else
-        g_object_set(m_playBin, "mute", mute, NULL);
-}
-
-MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
-{
-    return m_networkState;
-}
-
-MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
-{
-    return m_readyState;
-}
-
-PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
-{
-    RefPtr<TimeRanges> timeRanges = TimeRanges::create();
-    float loaded = maxTimeLoaded();
-    if (!m_errorOccured && !m_isStreaming && loaded > 0)
-        timeRanges->add(0, loaded);
-    return timeRanges.release();
-}
-
-void MediaPlayerPrivate::processBufferingStats(GstMessage* message)
-{
-    GstBufferingMode mode;
-
-    gst_message_parse_buffering_stats(message, &mode, 0, 0, 0);
-    if (mode != GST_BUFFERING_DOWNLOAD)
-        return;
-
-    if (!m_startedBuffering) {
-        m_startedBuffering = true;
-
-        if (m_fillTimeoutId > 0)
-            g_source_remove(m_fillTimeoutId);
-
-        m_fillTimeoutId = g_timeout_add(200, (GSourceFunc) bufferingTimeoutCallback, this);
-    }
-}
-
-bool MediaPlayerPrivate::queryBufferingStats()
-{
-    GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
-
-    if (!gst_element_query(m_playBin, query)) {
-        gst_query_unref(query);
-        return TRUE;
-    }
-
-    gint64 start, stop;
-
-    gst_query_parse_buffering_range(query, 0, &start, &stop, 0);
-    gst_query_unref(query);
-
-    if (stop != -1)
-        m_fillStatus = 100.0 * stop / GST_FORMAT_PERCENT_MAX;
-    else
-        m_fillStatus = 100.0;
-
-    LOG_VERBOSE(Media, "Download buffer filled up to %f%%", m_fillStatus);
-
-    if (!m_mediaDuration)
-        durationChanged();
-
-    // Update maxTimeLoaded only if the media duration is
-    // available. Otherwise we can't compute it.
-    if (m_mediaDuration) {
-        m_maxTimeLoaded = static_cast<float>((m_fillStatus * m_mediaDuration) / 100.0);
-        LOG_VERBOSE(Media, "Updated maxTimeLoaded: %f", m_maxTimeLoaded);
-    }
-
-    if (m_fillStatus != 100.0) {
-        updateStates();
-        return TRUE;
-    }
-
-    // Media is now fully loaded. It will play even if network
-    // connection is cut. Buffering is done, remove the fill source
-    // from the main loop.
-    m_fillTimeoutId = 0;
-    m_startedBuffering = false;
-    updateStates();
-    return FALSE;
-}
-
-float MediaPlayerPrivate::maxTimeSeekable() const
-{
-    if (m_errorOccured)
-        return 0.0;
-
-    LOG_VERBOSE(Media, "maxTimeSeekable");
-    // infinite duration means live stream
-    if (isinf(duration()))
-        return 0.0;
-
-    return maxTimeLoaded();
-}
-
-float MediaPlayerPrivate::maxTimeLoaded() const
-{
-    if (m_errorOccured)
-        return 0.0;
-
-    float loaded = m_maxTimeLoaded;
-    if (!loaded && !m_fillTimeoutId)
-        loaded = duration();
-    LOG_VERBOSE(Media, "maxTimeLoaded: %f", loaded);
-    return loaded;
-}
-
-unsigned MediaPlayerPrivate::bytesLoaded() const
-{
-    if (!m_playBin)
-        return 0;
-
-    if (!m_mediaDuration)
-        return 0;
-
-    unsigned loaded = totalBytes() * maxTimeLoaded() / m_mediaDuration;
-    LOG_VERBOSE(Media, "bytesLoaded: %d", loaded);
-    return loaded;
-}
-
-unsigned MediaPlayerPrivate::totalBytes() const
-{
-    if (!m_source)
-        return 0;
-
-    if (m_errorOccured)
-        return 0;
-
-    GstFormat fmt = GST_FORMAT_BYTES;
-    gint64 length = 0;
-    gst_element_query_duration(m_source, &fmt, &length);
-    LOG_VERBOSE(Media, "totalBytes %" G_GINT64_FORMAT, length);
-
-    return length;
-}
-
-void MediaPlayerPrivate::cancelLoad()
-{
-    if (m_networkState < MediaPlayer::Loading || m_networkState == MediaPlayer::Loaded)
-        return;
-
-    if (m_playBin)
-        gst_element_set_state(m_playBin, GST_STATE_NULL);
-}
-
-void MediaPlayerPrivate::updateStates()
-{
-    // There is no (known) way to get such level of information about
-    // the state of GStreamer, therefore, when in PAUSED state,
-    // we are sure we can display the first frame and go to play
-
-    if (!m_playBin)
-        return;
-
-    if (m_errorOccured)
-        return;
-
-    MediaPlayer::NetworkState oldNetworkState = m_networkState;
-    MediaPlayer::ReadyState oldReadyState = m_readyState;
-    GstState state;
-    GstState pending;
-
-    GstStateChangeReturn ret = gst_element_get_state(m_playBin,
-        &state, &pending, 250 * GST_NSECOND);
-
-    bool shouldUpdateAfterSeek = false;
-    switch (ret) {
-    case GST_STATE_CHANGE_SUCCESS:
-        LOG_VERBOSE(Media, "State: %s, pending: %s",
-            gst_element_state_get_name(state),
-            gst_element_state_get_name(pending));
-
-        m_resetPipeline = state <= GST_STATE_READY;
-
-        if (state == GST_STATE_READY)
-            m_readyState = MediaPlayer::HaveNothing;
-        else if (state == GST_STATE_PAUSED)
-            m_readyState = MediaPlayer::HaveEnoughData;
-
-        if (state == GST_STATE_PLAYING) {
-            m_readyState = MediaPlayer::HaveEnoughData;
-            m_paused = false;
-            m_startedPlaying = true;
-            if (!m_mediaDuration) {
-                float newDuration = duration();
-                if (!isinf(newDuration))
-                    m_mediaDuration = newDuration;
-            }
-        } else
-            m_paused = true;
-
-        // Is on-disk buffering in progress?
-        if (m_fillTimeoutId) {
-            m_networkState = MediaPlayer::Loading;
-            // Buffering has just started, we should now have enough
-            // data to restart playback if it was internally paused by
-            // GStreamer.
-            if (m_paused && !m_startedPlaying)
-                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
-        }
-
-        if (maxTimeLoaded() == duration()) {
-            m_networkState = MediaPlayer::Loaded;
-            if (state == GST_STATE_READY)
-                m_readyState = MediaPlayer::HaveNothing;
-            else if (state == GST_STATE_PAUSED)
-                m_readyState = MediaPlayer::HaveEnoughData;
-        } else
-            if (state == GST_STATE_READY)
-                m_readyState = MediaPlayer::HaveNothing;
-            else if (m_paused)
-                m_readyState = currentTime() < maxTimeLoaded() ? MediaPlayer::HaveFutureData : MediaPlayer::HaveCurrentData;
-
-        if (m_changingRate) {
-            m_player->rateChanged();
-            m_changingRate = false;
-        }
-
-        if (m_seeking) {
-            shouldUpdateAfterSeek = true;
-            m_seeking = false;
-        }
-
-        break;
-    case GST_STATE_CHANGE_ASYNC:
-        LOG_VERBOSE(Media, "Async: State: %s, pending: %s",
-            gst_element_state_get_name(state),
-            gst_element_state_get_name(pending));
-        // Change in progress
-
-        if (!m_isStreaming)
-            return;
-
-        // Resume playback if a seek was performed in a live pipeline.
-        if (m_seeking) {
-            shouldUpdateAfterSeek = true;
-            m_seeking = false;
-            if (m_paused)
-                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
-        }
-        break;
-    case GST_STATE_CHANGE_FAILURE:
-        LOG_VERBOSE(Media, "Failure: State: %s, pending: %s",
-            gst_element_state_get_name(state),
-            gst_element_state_get_name(pending));
-        // Change failed
-        return;
-    case GST_STATE_CHANGE_NO_PREROLL:
-        LOG_VERBOSE(Media, "No preroll: State: %s, pending: %s",
-            gst_element_state_get_name(state),
-            gst_element_state_get_name(pending));
-
-        if (state == GST_STATE_READY)
-            m_readyState = MediaPlayer::HaveNothing;
-        else if (state == GST_STATE_PAUSED) {
-            m_readyState = MediaPlayer::HaveEnoughData;
-            m_paused = true;
-            // Live pipelines go in PAUSED without prerolling.
-            m_isStreaming = true;
-        } else if (state == GST_STATE_PLAYING) {
-            m_startedPlaying = true;
-            m_paused = false;
-        }
-
-        if (m_paused && !m_startedPlaying)
-            gst_element_set_state(m_playBin, GST_STATE_PLAYING);
-
-        if (m_seeking) {
-            shouldUpdateAfterSeek = true;
-            m_seeking = false;
-            if (m_paused)
-                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
-        }
-
-        m_networkState = MediaPlayer::Loading;
-        break;
-    default:
-        LOG_VERBOSE(Media, "Else : %d", ret);
-        break;
-    }
-
-    if (seeking())
-        m_readyState = MediaPlayer::HaveNothing;
-
-    if (shouldUpdateAfterSeek)
-        timeChanged();
-
-    if (m_networkState != oldNetworkState) {
-        LOG_VERBOSE(Media, "Network State Changed from %u to %u",
-            oldNetworkState, m_networkState);
-        m_player->networkStateChanged();
-    }
-    if (m_readyState != oldReadyState) {
-        LOG_VERBOSE(Media, "Ready State Changed from %u to %u",
-            oldReadyState, m_readyState);
-        m_player->readyStateChanged();
-    }
-}
-
-void MediaPlayerPrivate::mediaLocationChanged(GstMessage* message)
-{
-    if (m_mediaLocations)
-        gst_structure_free(m_mediaLocations);
-
-    if (message->structure) {
-        // This structure can contain:
-        // - both a new-location string and embedded locations structure
-        // - or only a new-location string.
-        m_mediaLocations = gst_structure_copy(message->structure);
-        const GValue* locations = gst_structure_get_value(m_mediaLocations, "locations");
-
-        if (locations)
-            m_mediaLocationCurrentIndex = gst_value_list_get_size(locations) -1;
-
-        loadNextLocation();
-    }
-}
-
-bool MediaPlayerPrivate::loadNextLocation()
-{
-    if (!m_mediaLocations)
-        return false;
-
-    const GValue* locations = gst_structure_get_value(m_mediaLocations, "locations");
-    const gchar* newLocation = 0;
-
-    if (!locations) {
-        // Fallback on new-location string.
-        newLocation = gst_structure_get_string(m_mediaLocations, "new-location");
-        if (!newLocation)
-            return false;
-    }
-
-    if (!newLocation) {
-        if (m_mediaLocationCurrentIndex < 0) {
-            m_mediaLocations = 0;
-            return false;
-        }
-
-        const GValue* location = gst_value_list_get_value(locations,
-                                                          m_mediaLocationCurrentIndex);
-        const GstStructure* structure = gst_value_get_structure(location);
-
-        if (!structure) {
-            m_mediaLocationCurrentIndex--;
-            return false;
-        }
-
-        newLocation = gst_structure_get_string(structure, "new-location");
-    }
-
-    if (newLocation) {
-        // Found a candidate. new-location is not always an absolute url
-        // though. We need to take the base of the current url and
-        // append the value of new-location to it.
-
-        gchar* currentLocation = 0;
-        g_object_get(m_playBin, "uri", &currentLocation, NULL);
-
-        KURL currentUrl(KURL(), currentLocation);
-        g_free(currentLocation);
-
-        KURL newUrl;
-
-        if (gst_uri_is_valid(newLocation))
-            newUrl = KURL(KURL(), newLocation);
-        else
-            newUrl = KURL(KURL(), currentUrl.baseAsString() + newLocation);
-
-        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(currentUrl);
-        if (securityOrigin->canRequest(newUrl)) {
-            LOG_VERBOSE(Media, "New media url: %s", newUrl.string().utf8().data());
-
-            // Reset player states.
-            m_networkState = MediaPlayer::Loading;
-            m_player->networkStateChanged();
-            m_readyState = MediaPlayer::HaveNothing;
-            m_player->readyStateChanged();
-
-            // Reset pipeline state.
-            m_resetPipeline = true;
-            gst_element_set_state(m_playBin, GST_STATE_READY);
-
-            GstState state;
-            gst_element_get_state(m_playBin, &state, 0, 0);
-            if (state <= GST_STATE_READY) {
-                // Set the new uri and start playing.
-                g_object_set(m_playBin, "uri", newUrl.string().utf8().data(), NULL);
-                gst_element_set_state(m_playBin, GST_STATE_PLAYING);
-                return true;
-            }
-        }
-    }
-    m_mediaLocationCurrentIndex--;
-    return false;
-
-}
-
-void MediaPlayerPrivate::loadStateChanged()
-{
-    updateStates();
-}
-
-void MediaPlayerPrivate::sizeChanged()
-{
-    notImplemented();
-}
-
-void MediaPlayerPrivate::timeChanged()
-{
-    updateStates();
-    m_player->timeChanged();
-}
-
-void MediaPlayerPrivate::didEnd()
-{
-    // EOS was reached but in case of reverse playback the position is
-    // not always 0. So to not confuse the HTMLMediaElement we
-    // synchronize position and duration values.
-    float now = currentTime();
-    if (now > 0) {
-        m_mediaDuration = now;
-        m_player->durationChanged();
-    }
-
-    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
-
-    timeChanged();
-}
-
-void MediaPlayerPrivate::durationChanged()
-{
-    // Reset cached media duration
-    m_mediaDuration = 0;
-
-    // And re-cache it if possible.
-    float newDuration = duration();
-    if (!isinf(newDuration))
-        m_mediaDuration = newDuration;
-
-    m_player->durationChanged();
-}
-
-bool MediaPlayerPrivate::supportsMuting() const
-{
-    return true;
-}
-
-void MediaPlayerPrivate::setMuted(bool muted)
-{
-    if (!m_playBin)
-        return;
-
-    g_object_set(m_playBin, "mute", muted, NULL);
-}
-
-void MediaPlayerPrivate::muteChangedCallback()
-{
-    gboolean muted;
-    g_object_get(m_playBin, "mute", &muted, NULL);
-    m_player->muteChanged(static_cast<bool>(muted));
-}
-
-void MediaPlayerPrivate::muteChanged()
-{
-    if (m_muteIdleId)
-        g_source_remove(m_muteIdleId);
-
-    m_muteIdleId = g_idle_add((GSourceFunc) notifyMuteIdleCallback, this);
-}
-
-void MediaPlayerPrivate::loadingFailed(MediaPlayer::NetworkState error)
-{
-    m_errorOccured = true;
-    if (m_networkState != error) {
-        m_networkState = error;
-        m_player->networkStateChanged();
-    }
-    if (m_readyState != MediaPlayer::HaveNothing) {
-        m_readyState = MediaPlayer::HaveNothing;
-        m_player->readyStateChanged();
-    }
-}
-
-void MediaPlayerPrivate::setSize(const IntSize& size)
-{
-    m_size = size;
-}
-
-void MediaPlayerPrivate::setVisible(bool visible)
-{
-}
-
-void MediaPlayerPrivate::repaint()
-{
-    m_player->repaint();
-}
-
-void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
-{
-    if (context->paintingDisabled())
-        return;
-
-    if (!m_player->visible())
-        return;
-    if (!m_buffer)
-        return;
-
-    int width = 0, height = 0;
-    GstCaps* caps = gst_buffer_get_caps(m_buffer);
-    GstVideoFormat format;
-
-    if (!gst_video_format_parse_caps(caps, &format, &width, &height)) {
-      gst_caps_unref(caps);
-      return;
-    }
-
-    cairo_format_t cairoFormat;
-    if (format == GST_VIDEO_FORMAT_ARGB || format == GST_VIDEO_FORMAT_BGRA)
-        cairoFormat = CAIRO_FORMAT_ARGB32;
-    else
-        cairoFormat = CAIRO_FORMAT_RGB24;
-
-    cairo_t* cr = context->platformContext();
-    cairo_surface_t* src = cairo_image_surface_create_for_data(GST_BUFFER_DATA(m_buffer),
-                                                               cairoFormat,
-                                                               width, height,
-                                                               4 * width);
-
-    cairo_save(cr);
-
-    // translate and scale the context to correct size
-    cairo_translate(cr, rect.x(), rect.y());
-    cairo_scale(cr, static_cast<double>(rect.width()) / width, static_cast<double>(rect.height()) / height);
-
-    // And paint it.
-    cairo_set_source_surface(cr, src, 0, 0);
-    cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_PAD);
-    cairo_rectangle(cr, 0, 0, width, height);
-    cairo_fill(cr);
-    cairo_restore(cr);
-
-    cairo_surface_destroy(src);
-    gst_caps_unref(caps);
-}
-
-static HashSet<String> mimeTypeCache()
-{
-
-    doGstInit();
-
-    static HashSet<String> cache;
-    static bool typeListInitialized = false;
-
-    if (!typeListInitialized) {
-        // Build a whitelist of mime-types known to be supported by
-        // GStreamer.
-        HashSet<String> handledApplicationSubtypes;
-        handledApplicationSubtypes.add(String("ogg"));
-        handledApplicationSubtypes.add(String("x-3gp"));
-        handledApplicationSubtypes.add(String("vnd.rn-realmedia"));
-        handledApplicationSubtypes.add(String("x-pn-realaudio"));
-
-        GList* factories = gst_type_find_factory_get_list();
-        for (GList* iterator = factories; iterator; iterator = iterator->next) {
-            GstTypeFindFactory* factory = GST_TYPE_FIND_FACTORY(iterator->data);
-            GstCaps* caps = gst_type_find_factory_get_caps(factory);
-
-            if (!caps)
-                continue;
-
-            for (guint structureIndex = 0; structureIndex < gst_caps_get_size(caps); structureIndex++) {
-                GstStructure* structure = gst_caps_get_structure(caps, structureIndex);
-                const gchar* name = gst_structure_get_name(structure);
-                bool cached = false;
-
-                // These formats are supported by GStreamer, but not
-                // correctly advertised.
-                if (g_str_equal(name, "video/x-h264")
-                    || g_str_equal(name, "audio/x-m4a")) {
-                    cache.add(String("video/mp4"));
-                    cache.add(String("audio/aac"));
-                    cached = true;
-                }
-
-                if (g_str_equal(name, "video/x-theora")) {
-                    cache.add(String("video/ogg"));
-                    cached = true;
-                }
-
-                if (g_str_equal(name, "audio/x-vorbis")) {
-                    cache.add(String("audio/ogg"));
-                    cached = true;
-                }
-
-                if (g_str_equal(name, "audio/x-wav")) {
-                    cache.add(String("audio/wav"));
-                    cached = true;
-                }
-
-                if (g_str_equal(name, "audio/mpeg")) {
-                    cache.add(String(name));
-                    cached = true;
-
-                    // This is what we are handling:
-                    // mpegversion=(int)1, layer=(int)[ 1, 3 ]
-                    gint mpegVersion = 0;
-                    if (gst_structure_get_int(structure, "mpegversion", &mpegVersion) && (mpegVersion == 1)) {
-                        const GValue* layer = gst_structure_get_value(structure, "layer");
-                        if (G_VALUE_TYPE(layer) == GST_TYPE_INT_RANGE) {
-                            gint minLayer = gst_value_get_int_range_min(layer);
-                            gint maxLayer = gst_value_get_int_range_max(layer);
-                            if (minLayer <= 1 && 1 <= maxLayer)
-                                cache.add(String("audio/mp1"));
-                            if (minLayer <= 2 && 2 <= maxLayer)
-                                cache.add(String("audio/mp2"));
-                            if (minLayer <= 3 && 3 <= maxLayer)
-                                cache.add(String("audio/mp3"));
-                        }
-                    }
-                }
-
-                if (!cached) {
-                    // GStreamer plugins can be capable of supporting
-                    // types which WebKit supports by default. In that
-                    // case, we should not consider these types
-                    // supportable by GStreamer.  Examples of what
-                    // GStreamer can support but should not be added:
-                    // text/plain, text/html, image/jpeg,
-                    // application/xml
-                    gchar** mimetype = g_strsplit(name, "/", 2);
-                    if (g_str_equal(mimetype[0], "audio")
-                        || g_str_equal(mimetype[0], "video")
-                        || (g_str_equal(mimetype[0], "application")
-                            && handledApplicationSubtypes.contains(String(mimetype[1]))))
-                        cache.add(String(name));
-
-                    g_strfreev(mimetype);
-                }
-            }
-        }
-
-        gst_plugin_feature_list_free(factories);
-        typeListInitialized = true;
-    }
-
-    return cache;
-}
-
-void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
-{
-    types = mimeTypeCache();
-}
-
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
-{
-    if (type.isNull() || type.isEmpty())
-        return MediaPlayer::IsNotSupported;
-
-    // spec says we should not return "probably" if the codecs string is empty
-    if (mimeTypeCache().contains(type))
-        return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
-    return MediaPlayer::IsNotSupported;
-}
-
-bool MediaPlayerPrivate::hasSingleSecurityOrigin() const
-{
-    return true;
-}
-
-bool MediaPlayerPrivate::supportsFullscreen() const
-{
-    return true;
-}
-
-void MediaPlayerPrivate::setAutobuffer(bool autoBuffer)
-{
-    ASSERT(m_playBin);
-
-    GstPlayFlags flags;
-    g_object_get(m_playBin, "flags", &flags, NULL);
-    if (autoBuffer)
-        g_object_set(m_playBin, "flags", flags | GST_PLAY_FLAG_DOWNLOAD, NULL);
-    else
-        g_object_set(m_playBin, "flags", flags & ~GST_PLAY_FLAG_DOWNLOAD, NULL);
-}
-
-void MediaPlayerPrivate::createGSTPlayBin()
-{
-    ASSERT(!m_playBin);
-    m_playBin = gst_element_factory_make("playbin2", "play");
-
-    GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_playBin));
-    gst_bus_add_signal_watch(bus);
-    g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this);
-    gst_object_unref(bus);
-
-    g_signal_connect(m_playBin, "notify::volume", G_CALLBACK(mediaPlayerPrivateVolumeChangedCallback), this);
-    g_signal_connect(m_playBin, "notify::source", G_CALLBACK(mediaPlayerPrivateSourceChangedCallback), this);
-    g_signal_connect(m_playBin, "notify::mute", G_CALLBACK(mediaPlayerPrivateMuteChangedCallback), this);
-
-    m_videoSink = webkit_video_sink_new();
-
-    g_object_ref_sink(m_videoSink);
-
-    WTFLogChannel* channel = getChannelFromName("Media");
-    if (channel->state == WTFLogChannelOn) {
-        m_fpsSink = gst_element_factory_make("fpsdisplaysink", "sink");
-        if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) {
-            g_object_set(m_fpsSink, "video-sink", m_videoSink, NULL);
-            g_object_ref_sink(m_fpsSink);
-            g_object_set(m_playBin, "video-sink", m_fpsSink, NULL);
-        } else {
-            m_fpsSink = 0;
-            g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
-            LOG_VERBOSE(Media, "Can't display FPS statistics, you need gst-plugins-bad >= 0.10.18");
-        }
-    } else
-        g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
-
-    g_signal_connect(m_videoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
-}
-
-}
-
-#endif
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
deleted file mode 100644
index e19b686..0000000
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 Apple Inc.  All rights reserved.
- * Copyright (C) 2007 Collabora Ltd. All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2009, 2010 Igalia S.L
- *
- * 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
- * aint 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 MediaPlayerPrivateGStreamer_h
-#define MediaPlayerPrivateGStreamer_h
-
-#if ENABLE(VIDEO)
-
-#include "MediaPlayerPrivate.h"
-#include "Timer.h"
-
-#include <cairo.h>
-#include <glib.h>
-#include <gst/gst.h>
-
-typedef struct _WebKitVideoSink WebKitVideoSink;
-typedef struct _GstBuffer GstBuffer;
-typedef struct _GstMessage GstMessage;
-typedef struct _GstElement GstElement;
-typedef struct _GstBus GstBus;
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntSize;
-class IntRect;
-class String;
-
-gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data);
-void mediaPlayerPrivateVolumeChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
-void mediaPlayerPrivateSourceChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
-
-class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
-        friend gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data);
-        friend void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer* buffer, MediaPlayerPrivate* playerPrivate);
-        friend void mediaPlayerPrivateSourceChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
-
-        public:
-            static void registerMediaEngine(MediaEngineRegistrar);
-            ~MediaPlayerPrivate();
-
-            IntSize naturalSize() const;
-            bool hasVideo() const;
-            bool hasAudio() const;
-
-            void load(const String &url);
-            void cancelLoad();
-            bool loadNextLocation();
-
-            void play();
-            void pause();
-
-            bool paused() const;
-            bool seeking() const;
-
-            float duration() const;
-            float currentTime() const;
-            void seek(float);
-
-            void setRate(float);
-
-            void setVolume(float);
-            void volumeChanged();
-            void volumeChangedCallback();
-
-            bool supportsMuting() const;
-            void setMuted(bool);
-            void muteChanged();
-            void muteChangedCallback();
-
-            void setAutobuffer(bool);
-            bool queryBufferingStats();
-
-            MediaPlayer::NetworkState networkState() const;
-            MediaPlayer::ReadyState readyState() const;
-
-            PassRefPtr<TimeRanges> buffered() const;
-            float maxTimeSeekable() const;
-            unsigned bytesLoaded() const;
-            unsigned totalBytes() const;
-
-            void setVisible(bool);
-            void setSize(const IntSize&);
-
-            void mediaLocationChanged(GstMessage*);
-            void loadStateChanged();
-            void sizeChanged();
-            void timeChanged();
-            void didEnd();
-            void durationChanged();
-            void loadingFailed(MediaPlayer::NetworkState);
-
-            void repaint();
-            void paint(GraphicsContext*, const IntRect&);
-
-            bool hasSingleSecurityOrigin() const;
-
-            bool supportsFullscreen() const;
-
-            bool pipelineReset() const { return m_resetPipeline; }
-
-        private:
-            MediaPlayerPrivate(MediaPlayer*);
-            static MediaPlayerPrivateInterface* create(MediaPlayer* player);
-
-            static void getSupportedTypes(HashSet<String>&);
-            static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
-            static bool isAvailable();
-
-            void updateStates();
-            void cancelSeek();
-            void endPointTimerFired(Timer<MediaPlayerPrivate>*);
-            float maxTimeLoaded() const;
-            void startEndPointTimerIfNeeded();
-
-            void createGSTPlayBin();
-            bool changePipelineState(GstState state);
-
-            void processBufferingStats(GstMessage* message);
-
-        private:
-            MediaPlayer* m_player;
-            GstElement* m_playBin;
-            GstElement* m_videoSink;
-            GstElement* m_fpsSink;
-            GstElement* m_source;
-            GstClockTime m_seekTime;
-            bool m_changingRate;
-            float m_endTime;
-            bool m_isEndReached;
-            MediaPlayer::NetworkState m_networkState;
-            MediaPlayer::ReadyState m_readyState;
-            bool m_startedPlaying;
-            mutable bool m_isStreaming;
-            IntSize m_size;
-            GstBuffer* m_buffer;
-            GstStructure* m_mediaLocations;
-            gint m_mediaLocationCurrentIndex;
-            bool m_resetPipeline;
-            bool m_paused;
-            bool m_seeking;
-            float m_playbackRate;
-            bool m_errorOccured;
-            guint m_volumeIdleId;
-            gfloat m_mediaDuration;
-            guint m_muteIdleId;
-            bool m_startedBuffering;
-            guint m_fillTimeoutId;
-            float m_maxTimeLoaded;
-            gdouble m_fillStatus;
-    };
-}
-
-#endif
-#endif
diff --git a/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp b/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
deleted file mode 100644
index df25393..0000000
--- a/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com>
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "SimpleFontData.h"
-
-#include "FloatRect.h"
-#include "Font.h"
-#include "FontCache.h"
-#include "FontDescription.h"
-#include "GlyphBuffer.h"
-#include <cairo.h>
-#include <wtf/MathExtras.h>
-
-namespace WebCore {
-
-void SimpleFontData::platformInit()
-{
-    cairo_font_extents_t font_extents;
-    cairo_text_extents_t text_extents;
-    cairo_scaled_font_extents(m_platformData.m_scaledFont, &font_extents);
-    m_ascent = static_cast<int>(lroundf(font_extents.ascent));
-    m_descent = static_cast<int>(lroundf(font_extents.descent));
-    m_lineSpacing = static_cast<int>(lroundf(font_extents.height));
-    // There seems to be some rounding error in cairo (or in how we
-    // use cairo) with some fonts, like DejaVu Sans Mono, which makes
-    // cairo report a height smaller than ascent + descent, which is
-    // wrong and confuses WebCore's layout system. Workaround this
-    // while we figure out what's going on.
-    if (m_lineSpacing < m_ascent + m_descent)
-        m_lineSpacing = m_ascent + m_descent;
-    cairo_scaled_font_text_extents(m_platformData.m_scaledFont, "x", &text_extents);
-    m_xHeight = text_extents.height;
-    cairo_scaled_font_text_extents(m_platformData.m_scaledFont, " ", &text_extents);
-    m_spaceWidth = static_cast<float>(text_extents.x_advance);
-    m_lineGap = m_lineSpacing - m_ascent - m_descent;
-    m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
-}
-
-void SimpleFontData::platformCharWidthInit()
-{
-    m_avgCharWidth = 0.f;
-    m_maxCharWidth = 0.f;
-    initCharWidths();
-}
-
-void SimpleFontData::platformDestroy()
-{
-    delete m_smallCapsFontData;
-    m_smallCapsFontData = 0;
-}
-
-SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
-{
-    if (!m_smallCapsFontData) {
-        FontDescription desc = FontDescription(fontDescription);
-        desc.setComputedSize(0.70f*fontDescription.computedSize());
-        const FontPlatformData* pdata = new FontPlatformData(desc, desc.family().family());
-        m_smallCapsFontData = new SimpleFontData(*pdata);
-    }
-    return m_smallCapsFontData;
-}
-
-bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
-{
-    FT_Face face = cairo_ft_scaled_font_lock_face(m_platformData.m_scaledFont);
-
-    if (!face)
-        return false;
-
-    for (int i = 0; i < length; i++) {
-        if (FcFreeTypeCharIndex(face, characters[i]) == 0) {
-            cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
-            return false;
-        }
-    }
-
-    cairo_ft_scaled_font_unlock_face(m_platformData.m_scaledFont);
-
-    return true;
-}
-
-void SimpleFontData::determinePitch()
-{
-    m_treatAsFixedPitch = m_platformData.isFixedPitch();
-}
-
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
-{
-    ASSERT(m_platformData.m_scaledFont);
-
-    cairo_glyph_t cglyph = { glyph, 0, 0 };
-    cairo_text_extents_t extents;
-    cairo_scaled_font_glyph_extents(m_platformData.m_scaledFont, &cglyph, 1, &extents);
-
-    float w = (float)m_spaceWidth;
-    if (cairo_scaled_font_status(m_platformData.m_scaledFont) == CAIRO_STATUS_SUCCESS && extents.x_advance != 0)
-        w = (float)extents.x_advance;
-    return w;
-}
-
-}
diff --git a/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp b/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
index 975143e..0ed5393 100644
--- a/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
+++ b/WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp
@@ -119,7 +119,7 @@
     m_treatAsFixedPitch = m_platformData.isFixedPitch();
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
 {
     ASSERT(m_platformData.m_scaledFont);
 
@@ -130,7 +130,10 @@
     float w = (float)m_spaceWidth;
     if (cairo_scaled_font_status(m_platformData.m_scaledFont) == CAIRO_STATUS_SUCCESS && extents.x_advance != 0)
         w = (float)extents.x_advance;
-    return w;
+    
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = w;
+    return metrics;
 }
 
 }
diff --git a/WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp b/WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp
deleted file mode 100644
index 5e0f8e2..0000000
--- a/WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- *  Copyright (C) 2007 OpenedHand
- *  Copyright (C) 2007 Alp Toker <alp@atoker.com>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/**
- * SECTION:webkit-video-sink
- * @short_description: GStreamer video sink
- *
- * #WebKitVideoSink is a GStreamer sink element that triggers
- * repaints in the WebKit GStreamer media player for the
- * current video buffer.
- */
-
-#include "config.h"
-#include "VideoSinkGStreamer.h"
-
-#include <glib.h>
-#include <gst/gst.h>
-#include <gst/video/video.h>
-
-static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink",
-                                                                   GST_PAD_SINK, GST_PAD_ALWAYS,
-// CAIRO_FORMAT_RGB24 used to render the video buffers is little/big endian dependant.
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-                                                                   GST_STATIC_CAPS(GST_VIDEO_CAPS_BGRx ";" GST_VIDEO_CAPS_BGRA)
-#else
-                                                                   GST_STATIC_CAPS(GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_ARGB)
-#endif
-);
-
-GST_DEBUG_CATEGORY_STATIC(webkit_video_sink_debug);
-#define GST_CAT_DEFAULT webkit_video_sink_debug
-
-enum {
-    REPAINT_REQUESTED,
-    LAST_SIGNAL
-};
-
-enum {
-    PROP_0
-};
-
-static guint webkit_video_sink_signals[LAST_SIGNAL] = { 0, };
-
-struct _WebKitVideoSinkPrivate {
-    GstBuffer* buffer;
-    guint timeout_id;
-    GMutex* buffer_mutex;
-    GCond* data_cond;
-
-    // If this is TRUE all processing should finish ASAP
-    // This is necessary because there could be a race between
-    // unlock() and render(), where unlock() wins, signals the
-    // GCond, then render() tries to render a frame although
-    // everything else isn't running anymore. This will lead
-    // to deadlocks because render() holds the stream lock.
-    //
-    // Protected by the buffer mutex
-    gboolean unlocked;
-};
-
-#define _do_init(bla) \
-    GST_DEBUG_CATEGORY_INIT(webkit_video_sink_debug, \
-                            "webkitsink", \
-                            0, \
-                            "webkit video sink")
-
-GST_BOILERPLATE_FULL(WebKitVideoSink,
-                     webkit_video_sink,
-                     GstVideoSink,
-                     GST_TYPE_VIDEO_SINK,
-                     _do_init);
-
-static void
-webkit_video_sink_base_init(gpointer g_class)
-{
-    GstElementClass* element_class = GST_ELEMENT_CLASS(g_class);
-
-    gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&sinktemplate));
-    gst_element_class_set_details_simple(element_class, "WebKit video sink",
-            "Sink/Video", "Sends video data from a GStreamer pipeline to a Cairo surface",
-            "Alp Toker <alp@atoker.com>");
-}
-
-static void
-webkit_video_sink_init(WebKitVideoSink* sink, WebKitVideoSinkClass* klass)
-{
-    WebKitVideoSinkPrivate* priv;
-
-    sink->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, WEBKIT_TYPE_VIDEO_SINK, WebKitVideoSinkPrivate);
-    priv->data_cond = g_cond_new();
-    priv->buffer_mutex = g_mutex_new();
-}
-
-static gboolean
-webkit_video_sink_timeout_func(gpointer data)
-{
-    WebKitVideoSink* sink = reinterpret_cast<WebKitVideoSink*>(data);
-    WebKitVideoSinkPrivate* priv = sink->priv;
-    GstBuffer* buffer;
-
-    g_mutex_lock(priv->buffer_mutex);
-    buffer = priv->buffer;
-    priv->buffer = 0;
-    priv->timeout_id = 0;
-
-    if (!buffer || priv->unlocked || G_UNLIKELY(!GST_IS_BUFFER(buffer))) {
-        g_cond_signal(priv->data_cond);
-        g_mutex_unlock(priv->buffer_mutex);
-        return FALSE;
-    }
-
-    g_signal_emit(sink, webkit_video_sink_signals[REPAINT_REQUESTED], 0, buffer);
-    gst_buffer_unref(buffer);
-    g_cond_signal(priv->data_cond);
-    g_mutex_unlock(priv->buffer_mutex);
-
-    return FALSE;
-}
-
-static GstFlowReturn
-webkit_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer)
-{
-    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(bsink);
-    WebKitVideoSinkPrivate* priv = sink->priv;
-
-    g_mutex_lock(priv->buffer_mutex);
-
-    if (priv->unlocked) {
-        g_mutex_unlock(priv->buffer_mutex);
-        return GST_FLOW_OK;
-    }
-
-    priv->buffer = gst_buffer_ref(buffer);
-
-    // For the unlikely case where the buffer has no caps, the caps
-    // are implicitely the caps of the pad. This shouldn't happen.
-    if (G_UNLIKELY(!GST_BUFFER_CAPS(buffer))) {
-        buffer = priv->buffer = gst_buffer_make_metadata_writable(priv->buffer);
-        gst_buffer_set_caps(priv->buffer, GST_PAD_CAPS(GST_BASE_SINK_PAD(bsink)));
-    }
-
-    GstCaps *caps = GST_BUFFER_CAPS(buffer);
-    GstVideoFormat format;
-    int width, height;
-    if (G_UNLIKELY(!gst_video_format_parse_caps(caps, &format, &width, &height))) {
-        gst_buffer_unref(buffer);
-        g_mutex_unlock(priv->buffer_mutex);
-        return GST_FLOW_ERROR;
-    }
-
-    // Cairo's ARGB has pre-multiplied alpha while GStreamer's doesn't.
-    // Here we convert to Cairo's ARGB.
-    if (format == GST_VIDEO_FORMAT_ARGB || format == GST_VIDEO_FORMAT_BGRA) {
-        // Because GstBaseSink::render() only owns the buffer reference in the
-        // method scope we can't use gst_buffer_make_writable() here. Also
-        // The buffer content should not be changed here because the same buffer
-        // could be passed multiple times to this method (in theory)
-        GstBuffer *newBuffer = gst_buffer_try_new_and_alloc(GST_BUFFER_SIZE(buffer));
-
-        // Check if allocation failed
-        if (G_UNLIKELY(!newBuffer)) {
-            gst_buffer_unref(buffer);
-            g_mutex_unlock(priv->buffer_mutex);
-            return GST_FLOW_ERROR;
-        }
-
-        gst_buffer_copy_metadata(newBuffer, buffer, (GstBufferCopyFlags) GST_BUFFER_COPY_ALL);
-
-        // We don't use Color::premultipliedARGBFromColor() here because
-        // one function call per video pixel is just too expensive:
-        // For 720p/PAL for example this means 1280*720*25=23040000
-        // function calls per second!
-        unsigned short alpha;
-        const guint8 *source = GST_BUFFER_DATA(buffer);
-        guint8 *destination = GST_BUFFER_DATA(newBuffer);
-
-        for (int x = 0; x < height; x++) {
-            for (int y = 0; y < width; y++) {
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-                alpha = source[3];
-                destination[0] = (source[0] * alpha + 128) / 255;
-                destination[1] = (source[1] * alpha + 128) / 255;
-                destination[2] = (source[2] * alpha + 128) / 255;
-                destination[3] = alpha;
-#else
-                alpha = source[0];
-                destination[0] = alpha;
-                destination[1] = (source[1] * alpha + 128) / 255;
-                destination[2] = (source[2] * alpha + 128) / 255;
-                destination[3] = (source[3] * alpha + 128) / 255;
-#endif
-                source += 4;
-                destination += 4;
-            }
-        }
-        gst_buffer_unref(buffer);
-        buffer = priv->buffer = newBuffer;
-    }
-
-    // Use HIGH_IDLE+20 priority, like Gtk+ for redrawing operations.
-    priv->timeout_id = g_timeout_add_full(G_PRIORITY_HIGH_IDLE + 20, 0,
-                                          webkit_video_sink_timeout_func,
-                                          gst_object_ref(sink),
-                                          (GDestroyNotify)gst_object_unref);
-
-    g_cond_wait(priv->data_cond, priv->buffer_mutex);
-    g_mutex_unlock(priv->buffer_mutex);
-    return GST_FLOW_OK;
-}
-
-static void
-webkit_video_sink_dispose(GObject* object)
-{
-    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
-    WebKitVideoSinkPrivate* priv = sink->priv;
-
-    if (priv->data_cond) {
-        g_cond_free(priv->data_cond);
-        priv->data_cond = 0;
-    }
-
-    if (priv->buffer_mutex) {
-        g_mutex_free(priv->buffer_mutex);
-        priv->buffer_mutex = 0;
-    }
-
-    G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-static void
-unlock_buffer_mutex(WebKitVideoSinkPrivate* priv)
-{
-    g_mutex_lock(priv->buffer_mutex);
-
-    if (priv->buffer) {
-        gst_buffer_unref(priv->buffer);
-        priv->buffer = 0;
-    }
-
-    priv->unlocked = TRUE;
-
-    g_cond_signal(priv->data_cond);
-    g_mutex_unlock(priv->buffer_mutex);
-}
-
-static gboolean
-webkit_video_sink_unlock(GstBaseSink* object)
-{
-    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
-
-    unlock_buffer_mutex(sink->priv);
-
-    return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock,
-                                        (object), TRUE);
-}
-
-static gboolean
-webkit_video_sink_unlock_stop(GstBaseSink* object)
-{
-    WebKitVideoSink* sink = WEBKIT_VIDEO_SINK(object);
-    WebKitVideoSinkPrivate* priv = sink->priv;
-
-    g_mutex_lock(priv->buffer_mutex);
-    priv->unlocked = FALSE;
-    g_mutex_unlock(priv->buffer_mutex);
-
-    return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock_stop,
-                                        (object), TRUE);
-}
-
-static gboolean
-webkit_video_sink_stop(GstBaseSink* base_sink)
-{
-    WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(base_sink)->priv;
-
-    unlock_buffer_mutex(priv);
-    return TRUE;
-}
-
-static gboolean
-webkit_video_sink_start(GstBaseSink* base_sink)
-{
-    WebKitVideoSinkPrivate* priv = WEBKIT_VIDEO_SINK(base_sink)->priv;
-
-    g_mutex_lock(priv->buffer_mutex);
-    priv->unlocked = FALSE;
-    g_mutex_unlock(priv->buffer_mutex);
-    return TRUE;
-}
-
-static void
-marshal_VOID__MINIOBJECT(GClosure * closure, GValue * return_value,
-                         guint n_param_values, const GValue * param_values,
-                         gpointer invocation_hint, gpointer marshal_data)
-{
-  typedef void (*marshalfunc_VOID__MINIOBJECT) (gpointer obj, gpointer arg1, gpointer data2);
-  marshalfunc_VOID__MINIOBJECT callback;
-  GCClosure *cc = (GCClosure *) closure;
-  gpointer data1, data2;
-
-  g_return_if_fail(n_param_values == 2);
-
-  if (G_CCLOSURE_SWAP_DATA(closure)) {
-      data1 = closure->data;
-      data2 = g_value_peek_pointer(param_values + 0);
-  } else {
-      data1 = g_value_peek_pointer(param_values + 0);
-      data2 = closure->data;
-  }
-  callback = (marshalfunc_VOID__MINIOBJECT) (marshal_data ? marshal_data : cc->callback);
-
-  callback(data1, gst_value_get_mini_object(param_values + 1), data2);
-}
-
-static void
-webkit_video_sink_class_init(WebKitVideoSinkClass* klass)
-{
-    GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
-    GstBaseSinkClass* gstbase_sink_class = GST_BASE_SINK_CLASS(klass);
-
-    g_type_class_add_private(klass, sizeof(WebKitVideoSinkPrivate));
-
-    gobject_class->dispose = webkit_video_sink_dispose;
-
-    gstbase_sink_class->unlock = webkit_video_sink_unlock;
-    gstbase_sink_class->unlock_stop = webkit_video_sink_unlock_stop;
-    gstbase_sink_class->render = webkit_video_sink_render;
-    gstbase_sink_class->preroll = webkit_video_sink_render;
-    gstbase_sink_class->stop = webkit_video_sink_stop;
-    gstbase_sink_class->start = webkit_video_sink_start;
-
-    webkit_video_sink_signals[REPAINT_REQUESTED] = g_signal_new("repaint-requested",
-            G_TYPE_FROM_CLASS(klass),
-            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
-            0,
-            0,
-            0,
-            marshal_VOID__MINIOBJECT,
-            G_TYPE_NONE, 1, GST_TYPE_BUFFER);
-}
-
-/**
- * webkit_video_sink_new:
- *
- * Creates a new GStreamer video sink.
- *
- * Return value: a #GstElement for the newly created video sink
- */
-GstElement*
-webkit_video_sink_new(void)
-{
-    return (GstElement*)g_object_new(WEBKIT_TYPE_VIDEO_SINK, 0);
-}
-
diff --git a/WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.cpp b/WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.cpp
deleted file mode 100644
index 74a7852..0000000
--- a/WebCore/platform/graphics/gtk/WebKitWebSourceGStreamer.cpp
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- *  Copyright (C) 2009, 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "WebKitWebSourceGStreamer.h"
-
-#include "CString.h"
-#include "Document.h"
-#include "GOwnPtr.h"
-#include "GRefPtr.h"
-#include "Noncopyable.h"
-#include "NotImplemented.h"
-#include "ResourceHandleClient.h"
-#include "ResourceHandleInternal.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include <gst/app/gstappsrc.h>
-#include <gst/pbutils/missing-plugins.h>
-
-using namespace WebCore;
-
-class StreamingClient : public Noncopyable, public ResourceHandleClient {
-    public:
-        StreamingClient(WebKitWebSrc*);
-        virtual ~StreamingClient();
-
-        virtual void willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse&);
-        virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
-        virtual void didReceiveData(ResourceHandle*, const char*, int, int);
-        virtual void didFinishLoading(ResourceHandle*);
-        virtual void didFail(ResourceHandle*, const ResourceError&);
-        virtual void wasBlocked(ResourceHandle*);
-        virtual void cannotShowURL(ResourceHandle*);
-
-    private:
-        WebKitWebSrc* m_src;
-};
-
-#define WEBKIT_WEB_SRC_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SRC, WebKitWebSrcPrivate))
-struct _WebKitWebSrcPrivate {
-    GstAppSrc* appsrc;
-    GstPad* srcpad;
-    gchar* uri;
-
-    RefPtr<WebCore::Frame> frame;
-
-    StreamingClient* client;
-    RefPtr<ResourceHandle> resourceHandle;
-
-    guint64 offset;
-    guint64 size;
-    gboolean seekable;
-    gboolean paused;
-
-    guint64 requestedOffset;
-
-    guint needDataID;
-    guint enoughDataID;
-    guint seekID;
-
-    // icecast stuff
-    gboolean iradioMode;
-    gchar* iradioName;
-    gchar* iradioGenre;
-    gchar* iradioUrl;
-    gchar* iradioTitle;
-
-    // TRUE if appsrc's version is >= 0.10.27, see
-    // https://bugzilla.gnome.org/show_bug.cgi?id=609423
-    gboolean haveAppSrc27;
-};
-
-enum {
-    PROP_IRADIO_MODE = 1,
-    PROP_IRADIO_NAME,
-    PROP_IRADIO_GENRE,
-    PROP_IRADIO_URL,
-    PROP_IRADIO_TITLE
-};
-
-static GstStaticPadTemplate srcTemplate = GST_STATIC_PAD_TEMPLATE("src",
-                                                                  GST_PAD_SRC,
-                                                                  GST_PAD_ALWAYS,
-                                                                  GST_STATIC_CAPS_ANY);
-
-GST_DEBUG_CATEGORY_STATIC(webkit_web_src_debug);
-#define GST_CAT_DEFAULT webkit_web_src_debug
-
-static void webKitWebSrcUriHandlerInit(gpointer gIface,
-                                            gpointer ifaceData);
-
-static void webKitWebSrcFinalize(GObject* object);
-static void webKitWebSrcSetProperty(GObject* object, guint propID, const GValue* value, GParamSpec* pspec);
-static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value, GParamSpec* pspec);
-static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStateChange transition);
-
-static void webKitWebSrcNeedDataCb(GstAppSrc* appsrc, guint length, gpointer userData);
-static void webKitWebSrcEnoughDataCb(GstAppSrc* appsrc, gpointer userData);
-static gboolean webKitWebSrcSeekDataCb(GstAppSrc* appsrc, guint64 offset, gpointer userData);
-
-static void webKitWebSrcStop(WebKitWebSrc* src, bool seeking);
-
-static GstAppSrcCallbacks appsrcCallbacks = {
-    webKitWebSrcNeedDataCb,
-    webKitWebSrcEnoughDataCb,
-    webKitWebSrcSeekDataCb,
-    { 0 }
-};
-
-static void doInit(GType gtype)
-{
-    static const GInterfaceInfo uriHandlerInfo = {
-        webKitWebSrcUriHandlerInit,
-        0, 0
-    };
-
-    GST_DEBUG_CATEGORY_INIT(webkit_web_src_debug, "webkitwebsrc", 0, "websrc element");
-    g_type_add_interface_static(gtype, GST_TYPE_URI_HANDLER,
-                                &uriHandlerInfo);
-}
-
-GST_BOILERPLATE_FULL(WebKitWebSrc, webkit_web_src, GstBin, GST_TYPE_BIN, doInit);
-
-static void webkit_web_src_base_init(gpointer klass)
-{
-    GstElementClass* eklass = GST_ELEMENT_CLASS(klass);
-
-    gst_element_class_add_pad_template(eklass,
-                                       gst_static_pad_template_get(&srcTemplate));
-    gst_element_class_set_details_simple(eklass,
-                                         (gchar*) "WebKit Web source element",
-                                         (gchar*) "Source",
-                                         (gchar*) "Handles HTTP/HTTPS uris",
-                                         (gchar*) "Sebastian Dröge <sebastian.droege@collabora.co.uk>");
-}
-
-static void webkit_web_src_class_init(WebKitWebSrcClass* klass)
-{
-    GObjectClass* oklass = G_OBJECT_CLASS(klass);
-    GstElementClass* eklass = GST_ELEMENT_CLASS(klass);
-
-    oklass->finalize = webKitWebSrcFinalize;
-    oklass->set_property = webKitWebSrcSetProperty;
-    oklass->get_property = webKitWebSrcGetProperty;
-
-    // icecast stuff
-    g_object_class_install_property(oklass,
-                                    PROP_IRADIO_MODE,
-                                    g_param_spec_boolean("iradio-mode",
-                                                         "iradio-mode",
-                                                         "Enable internet radio mode (extraction of shoutcast/icecast metadata)",
-                                                         FALSE,
-                                                         (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
-
-    g_object_class_install_property(oklass,
-                                    PROP_IRADIO_NAME,
-                                    g_param_spec_string("iradio-name",
-                                                        "iradio-name",
-                                                        "Name of the stream",
-                                                        0,
-                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
-
-    g_object_class_install_property(oklass,
-                                    PROP_IRADIO_GENRE,
-                                    g_param_spec_string("iradio-genre",
-                                                        "iradio-genre",
-                                                        "Genre of the stream",
-                                                        0,
-                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
-                                                        
-    g_object_class_install_property(oklass,
-                                    PROP_IRADIO_URL,
-                                    g_param_spec_string("iradio-url",
-                                                        "iradio-url",
-                                                        "Homepage URL for radio stream",
-                                                        0,
-                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
-
-    g_object_class_install_property(oklass,
-                                    PROP_IRADIO_TITLE,
-                                    g_param_spec_string("iradio-title",
-                                                        "iradio-title",
-                                                        "Name of currently playing song",
-                                                        0,
-                                                        (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)));
-
-    eklass->change_state = webKitWebSrcChangeState;
-
-    g_type_class_add_private(klass, sizeof(WebKitWebSrcPrivate));
-}
-
-static void webkit_web_src_init(WebKitWebSrc* src,
-                                WebKitWebSrcClass* gKlass)
-{
-    GstPadTemplate* padTemplate = gst_static_pad_template_get(&srcTemplate);
-    GstPad* targetpad;
-    WebKitWebSrcPrivate* priv = WEBKIT_WEB_SRC_GET_PRIVATE(src);
-
-    src->priv = priv;
-
-    priv->client = new StreamingClient(src);
-
-    priv->srcpad = gst_ghost_pad_new_no_target_from_template("src",
-                                                             padTemplate);
-
-    gst_element_add_pad(GST_ELEMENT(src), priv->srcpad);
-
-    priv->appsrc = GST_APP_SRC(gst_element_factory_make("appsrc", 0));
-    if (!priv->appsrc) {
-        GST_ERROR_OBJECT(src, "Failed to create appsrc");
-        return;
-    }
-
-    GstElementFactory* factory = GST_ELEMENT_FACTORY(GST_ELEMENT_GET_CLASS(priv->appsrc)->elementfactory);
-    priv->haveAppSrc27 = gst_plugin_feature_check_version(GST_PLUGIN_FEATURE(factory), 0, 10, 27);
-
-    gst_bin_add(GST_BIN(src), GST_ELEMENT(priv->appsrc));
-
-    targetpad = gst_element_get_static_pad(GST_ELEMENT(priv->appsrc), "src");
-    gst_ghost_pad_set_target(GST_GHOST_PAD(priv->srcpad), targetpad);
-    gst_object_unref(targetpad);
-
-    gst_app_src_set_callbacks(priv->appsrc, &appsrcCallbacks, src, 0);
-    gst_app_src_set_emit_signals(priv->appsrc, FALSE);
-    gst_app_src_set_stream_type(priv->appsrc, GST_APP_STREAM_TYPE_SEEKABLE);
-
-    // 512k is a abitrary number but we should choose a value
-    // here to not pause/unpause the SoupMessage too often and
-    // to make sure there's always some data available for
-    // GStreamer to handle.
-    gst_app_src_set_max_bytes(priv->appsrc, 512 * 1024);
-
-    // Emit the need-data signal if the queue contains less
-    // than 20% of data. Without this the need-data signal
-    // is emitted when the queue is empty, we then dispatch
-    // the soup message unpausing to the main loop and from
-    // there unpause the soup message. This already takes
-    // quite some time and libsoup even needs some more time
-    // to actually provide data again. If we do all this
-    // already if the queue is 20% empty, it's much more
-    // likely that libsoup already provides new data before
-    // the queue is really empty.
-    if (priv->haveAppSrc27)
-        g_object_set(priv->appsrc, "min-percent", 20, NULL);
-
-    webKitWebSrcStop(src, false);
-}
-
-static void webKitWebSrcFinalize(GObject* object)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    delete priv->client;
-
-    g_free(priv->uri);
-
-    GST_CALL_PARENT(G_OBJECT_CLASS, finalize, ((GObject* )(src)));
-}
-
-static void webKitWebSrcSetProperty(GObject* object, guint propID, const GValue* value, GParamSpec* pspec)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    switch (propID) {
-    case PROP_IRADIO_MODE:
-        priv->iradioMode = g_value_get_boolean(value);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
-        break;
-    }
-}
-
-static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value, GParamSpec* pspec)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(object);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    switch (propID) {
-    case PROP_IRADIO_MODE:
-        g_value_set_boolean(value, priv->iradioMode);
-        break;
-    case PROP_IRADIO_NAME:
-        g_value_set_string(value, priv->iradioName);
-        break;
-    case PROP_IRADIO_GENRE:
-        g_value_set_string(value, priv->iradioGenre);
-        break;
-    case PROP_IRADIO_URL:
-        g_value_set_string(value, priv->iradioUrl);
-        break;
-    case PROP_IRADIO_TITLE:
-        g_value_set_string(value, priv->iradioTitle);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
-        break;
-    }
-}
-
-
-static void webKitWebSrcStop(WebKitWebSrc* src, bool seeking)
-{
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    if (priv->resourceHandle) {
-        priv->resourceHandle->cancel();
-        priv->resourceHandle.release();
-    }
-    priv->resourceHandle = 0;
-
-    if (priv->frame)
-        priv->frame.release();
-
-    if (priv->needDataID)
-        g_source_remove(priv->needDataID);
-    priv->needDataID = 0;
-
-    if (priv->enoughDataID)
-        g_source_remove(priv->enoughDataID);
-    priv->enoughDataID = 0;
-
-    if (priv->seekID)
-        g_source_remove(priv->seekID);
-    priv->seekID = 0;
-
-    priv->paused = FALSE;
-
-    g_free(priv->iradioName);
-    priv->iradioName = 0;
-
-    g_free(priv->iradioGenre);
-    priv->iradioGenre = 0;
-
-    g_free(priv->iradioUrl);
-    priv->iradioUrl = 0;
-
-    g_free(priv->iradioTitle);
-    priv->iradioTitle = 0;
-
-    if (priv->appsrc) {
-        gst_app_src_set_caps(priv->appsrc, 0);
-        if (!seeking)
-            gst_app_src_set_size(priv->appsrc, -1);
-    }
-
-    priv->offset = 0;
-    priv->seekable = FALSE;
-
-    if (!seeking) {
-        priv->size = 0;
-        priv->requestedOffset = 0;
-    }
-
-    GST_DEBUG_OBJECT(src, "Stopped request");
-}
-
-static bool webKitWebSrcStart(WebKitWebSrc* src)
-{
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    if (!priv->uri) {
-        GST_ERROR_OBJECT(src, "No URI provided");
-        return false;
-    }
-    
-    KURL url = KURL(KURL(), priv->uri);
-
-    ResourceRequest request(url);
-    request.setTargetType(ResourceRequestBase::TargetIsMedia);
-    request.setAllowCookies(true);
-
-    // Let Apple web servers know we want to access their nice movie trailers.
-    if (!g_ascii_strcasecmp("movies.apple.com", url.host().utf8().data()))
-        request.setHTTPUserAgent("Quicktime/7.2.0");
-
-    if (priv->frame) {
-        Document* document = priv->frame->document();
-        if (document)
-            request.setHTTPReferrer(document->documentURI());
-
-        FrameLoader* loader = priv->frame->loader();
-        if (loader)
-            loader->addExtraFieldsToSubresourceRequest(request);
-    }
-
-    if (priv->requestedOffset) {
-        GOwnPtr<gchar> val;
-
-        val.set(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", priv->requestedOffset));
-        request.setHTTPHeaderField("Range", val.get());
-    }
-
-    if (priv->iradioMode)
-        request.setHTTPHeaderField("icy-metadata", "1");
-
-    // Needed to use DLNA streaming servers
-    request.setHTTPHeaderField("transferMode.dlna", "Streaming");
-
-    priv->resourceHandle = ResourceHandle::create(request, priv->client, 0, false, false, false);
-    if (!priv->resourceHandle) {
-        GST_ERROR_OBJECT(src, "Failed to create ResourceHandle");
-        return false;
-    }
-
-    GST_DEBUG_OBJECT(src, "Started request");
-
-    return true;
-}
-
-static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStateChange transition)
-{
-    GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(element);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    switch (transition) {
-    case GST_STATE_CHANGE_NULL_TO_READY:
-        if (!priv->appsrc) {
-            gst_element_post_message(element,
-                                     gst_missing_element_message_new(element, "appsrc"));
-            GST_ELEMENT_ERROR(src, CORE, MISSING_PLUGIN, (0), ("no appsrc"));
-            return GST_STATE_CHANGE_FAILURE;
-        }
-        break;
-    default:
-        break;
-    }
-
-    ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
-    if (G_UNLIKELY(ret == GST_STATE_CHANGE_FAILURE)) {
-        GST_DEBUG_OBJECT(src, "State change failed");
-        return ret;
-    }
-
-    switch (transition) {
-    case GST_STATE_CHANGE_READY_TO_PAUSED:
-        GST_DEBUG_OBJECT(src, "READY->PAUSED");
-        if (!webKitWebSrcStart(src))
-            ret = GST_STATE_CHANGE_FAILURE;
-        break;
-    case GST_STATE_CHANGE_PAUSED_TO_READY:
-        GST_DEBUG_OBJECT(src, "PAUSED->READY");
-        webKitWebSrcStop(src, false);
-        break;
-    default:
-        break;
-    }
-
-    return ret;
-}
-
-// uri handler interface
-
-static GstURIType webKitWebSrcUriGetType(void)
-{
-    return GST_URI_SRC;
-}
-
-static gchar** webKitWebSrcGetProtocols(void)
-{
-    static gchar* protocols[] = {(gchar*) "http", (gchar*) "https", 0 };
-
-    return protocols;
-}
-
-static const gchar* webKitWebSrcGetUri(GstURIHandler* handler)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(handler);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    return priv->uri;
-}
-
-static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(handler);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    if (GST_STATE(src) >= GST_STATE_PAUSED) {
-        GST_ERROR_OBJECT(src, "URI can only be set in states < PAUSED");
-        return FALSE;
-    }
-
-    g_free(priv->uri);
-    priv->uri = 0;
-
-    if (!uri)
-        return TRUE;
-
-    SoupURI* soupUri = soup_uri_new(uri);
-
-    if (!soupUri || !SOUP_URI_VALID_FOR_HTTP(soupUri)) {
-        GST_ERROR_OBJECT(src, "Invalid URI '%s'", uri);
-        soup_uri_free(soupUri);
-        return FALSE;
-    }
-
-    priv->uri = soup_uri_to_string(soupUri, FALSE);
-    soup_uri_free(soupUri);
-
-    return TRUE;
-}
-
-static void webKitWebSrcUriHandlerInit(gpointer gIface, gpointer ifaceData)
-{
-    GstURIHandlerInterface* iface = (GstURIHandlerInterface *) gIface;
-
-    iface->get_type = webKitWebSrcUriGetType;
-    iface->get_protocols = webKitWebSrcGetProtocols;
-    iface->get_uri = webKitWebSrcGetUri;
-    iface->set_uri = webKitWebSrcSetUri;
-}
-
-// appsrc callbacks
-
-static gboolean webKitWebSrcNeedDataMainCb(WebKitWebSrc* src)
-{
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    ResourceHandleInternal* d = priv->resourceHandle->getInternal();
-    if (d->m_msg)
-        soup_session_unpause_message(ResourceHandle::defaultSession(), d->m_msg);
-
-    priv->paused = FALSE;
-    priv->needDataID = 0;
-    return FALSE;
-}
-
-static void webKitWebSrcNeedDataCb(GstAppSrc* appsrc, guint length, gpointer userData)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    GST_DEBUG_OBJECT(src, "Need more data: %u", length);
-    if (priv->needDataID || !priv->paused)
-        return;
-
-    priv->needDataID = g_timeout_add_full(G_PRIORITY_HIGH, 0, (GSourceFunc) webKitWebSrcNeedDataMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
-}
-
-static gboolean webKitWebSrcEnoughDataMainCb(WebKitWebSrc* src)
-{
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    ResourceHandleInternal* d = priv->resourceHandle->getInternal();
-    soup_session_pause_message(ResourceHandle::defaultSession(), d->m_msg);
-    
-    priv->paused = TRUE;
-    priv->enoughDataID = 0;
-    return FALSE;
-}
-
-static void webKitWebSrcEnoughDataCb(GstAppSrc* appsrc, gpointer userData)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    GST_DEBUG_OBJECT(src, "Have enough data");
-    if (priv->enoughDataID || priv->paused)
-        return;
-
-    priv->enoughDataID = g_timeout_add_full(G_PRIORITY_HIGH, 0, (GSourceFunc) webKitWebSrcEnoughDataMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
-}
-
-static gboolean webKitWebSrcSeekMainCb(WebKitWebSrc* src)
-{
-    webKitWebSrcStop(src, true);
-    webKitWebSrcStart(src);
-
-    return FALSE;
-}
-
-static gboolean webKitWebSrcSeekDataCb(GstAppSrc* appsrc, guint64 offset, gpointer userData)
-{
-    WebKitWebSrc* src = WEBKIT_WEB_SRC(userData);
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    GST_DEBUG_OBJECT(src, "Seeking to offset: %" G_GUINT64_FORMAT, offset);
-    if (offset == priv->offset)
-        return TRUE;
-
-    if (!priv->seekable)
-        return FALSE;
-    if (offset > priv->size)
-        return FALSE;
-
-    GST_DEBUG_OBJECT(src, "Doing range-request seek");
-    priv->requestedOffset = offset;
-    if (priv->seekID)
-        g_source_remove(priv->seekID);
-    priv->seekID = g_timeout_add_full(G_PRIORITY_HIGH, 0, (GSourceFunc) webKitWebSrcSeekMainCb, gst_object_ref(src), (GDestroyNotify) gst_object_unref);
-    
-    return TRUE;
-}
-
-void webKitWebSrcSetFrame(WebKitWebSrc* src, WebCore::Frame* frame)
-{
-    WebKitWebSrcPrivate* priv = src->priv;
-
-    priv->frame = frame;
-}
-
-StreamingClient::StreamingClient(WebKitWebSrc* src) : m_src(src)
-{
-
-}
-
-StreamingClient::~StreamingClient()
-{
-
-}
-
-void StreamingClient::willSendRequest(ResourceHandle*, ResourceRequest&, const ResourceResponse&)
-{
-}
-
-void StreamingClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
-{
-    WebKitWebSrcPrivate* priv = m_src->priv;
-
-    GST_DEBUG_OBJECT(m_src, "Received response: %d", response.httpStatusCode());
-
-    // If we seeked we need 206 == PARTIAL_CONTENT
-    if (priv->requestedOffset && response.httpStatusCode() != 206) {
-        GST_ELEMENT_ERROR(m_src, RESOURCE, READ, (0), (0));
-        gst_app_src_end_of_stream(priv->appsrc);
-        webKitWebSrcStop(m_src, false);
-        return;
-    }
-
-    long long length = response.expectedContentLength();
-    if (length > 0) {
-        length += priv->requestedOffset;
-        gst_app_src_set_size(priv->appsrc, length);
-        if (!priv->haveAppSrc27) {
-            gst_segment_set_duration(&GST_BASE_SRC(priv->appsrc)->segment, GST_FORMAT_BYTES, length);
-            gst_element_post_message(GST_ELEMENT(priv->appsrc),
-                                     gst_message_new_duration(GST_OBJECT(priv->appsrc),
-                                                              GST_FORMAT_BYTES, length));
-        }
-    }
-
-    priv->size = length >= 0 ? length : 0;
-    priv->seekable = length > 0 && g_ascii_strcasecmp("none", response.httpHeaderField("Accept-Ranges").utf8().data());
-
-    // icecast stuff
-    String value = response.httpHeaderField("icy-metaint");
-    if (!value.isEmpty()) {
-        gchar* endptr = 0;
-        gint64 icyMetaInt = g_ascii_strtoll(value.utf8().data(), &endptr, 10);
-            
-        if (endptr && *endptr == '\0' && icyMetaInt > 0) {
-            GstCaps* caps = gst_caps_new_simple("application/x-icy", "metadata-interval", G_TYPE_INT, (gint) icyMetaInt, NULL);
-
-            gst_app_src_set_caps(priv->appsrc, caps);
-            gst_caps_unref(caps);
-        }
-    }
-
-    GstTagList* tags = gst_tag_list_new();
-    value = response.httpHeaderField("icy-name");
-    if (!value.isEmpty()) {
-        g_free(priv->iradioName);
-        priv->iradioName = g_strdup(value.utf8().data());
-        g_object_notify(G_OBJECT(m_src), "iradio-name");
-        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_ORGANIZATION, priv->iradioName, NULL);
-    }
-    value = response.httpHeaderField("icy-genre");
-    if (!value.isEmpty()) {
-        g_free(priv->iradioGenre);
-        priv->iradioGenre = g_strdup(value.utf8().data());
-        g_object_notify(G_OBJECT(m_src), "iradio-genre");
-        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_GENRE, priv->iradioGenre, NULL);
-    }
-    value = response.httpHeaderField("icy-url");
-    if (!value.isEmpty()) {
-        g_free(priv->iradioUrl);
-        priv->iradioUrl = g_strdup(value.utf8().data());
-        g_object_notify(G_OBJECT(m_src), "iradio-url");
-        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_LOCATION, priv->iradioUrl, NULL);
-    }
-    value = response.httpHeaderField("icy-title");
-    if (!value.isEmpty()) {
-        g_free(priv->iradioTitle);
-        priv->iradioTitle = g_strdup(value.utf8().data());
-        g_object_notify(G_OBJECT(m_src), "iradio-title");
-        gst_tag_list_add(tags, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE, priv->iradioTitle, NULL);
-    }
-
-    if (gst_tag_list_is_empty(tags))
-        gst_tag_list_free(tags);
-    else
-        gst_element_found_tags_for_pad(GST_ELEMENT(m_src), m_src->priv->srcpad, tags);
-}
-
-void StreamingClient::didReceiveData(ResourceHandle* handle, const char* data, int length, int lengthReceived)
-{
-    WebKitWebSrcPrivate* priv = m_src->priv;
-
-    GST_LOG_OBJECT(m_src, "Have %d bytes of data", length);
-
-    if (priv->seekID || handle != priv->resourceHandle) {
-        GST_DEBUG_OBJECT(m_src, "Seek in progress, ignoring data");
-        return;
-    }
-
-    GstBuffer* buffer = gst_buffer_new_and_alloc(length);
-
-    memcpy(GST_BUFFER_DATA(buffer), data, length);
-    GST_BUFFER_OFFSET(buffer) = priv->offset;
-    priv->offset += length;
-    GST_BUFFER_OFFSET_END(buffer) = priv->offset;
-
-    GstFlowReturn ret = gst_app_src_push_buffer(priv->appsrc, buffer);
-    if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
-        GST_ELEMENT_ERROR(m_src, CORE, FAILED, (0), (0));
-}
-
-void StreamingClient::didFinishLoading(ResourceHandle*)
-{
-    GST_DEBUG_OBJECT(m_src, "Have EOS");
-    gst_app_src_end_of_stream(m_src->priv->appsrc);
-}
-
-void StreamingClient::didFail(ResourceHandle*, const ResourceError& error)
-{
-    GST_ERROR_OBJECT(m_src, "Have failure: %s", error.localizedDescription().utf8().data());
-    GST_ELEMENT_ERROR(m_src, RESOURCE, FAILED, ("%s", error.localizedDescription().utf8().data()), (0));
-    gst_app_src_end_of_stream(m_src->priv->appsrc);
-}
-
-void StreamingClient::wasBlocked(ResourceHandle*)
-{
-}
-
-void StreamingClient::cannotShowURL(ResourceHandle*)
-{
-}
-
diff --git a/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp b/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
index 7ade370..f8c2aa0 100644
--- a/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/FontCacheHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -37,7 +38,7 @@
 #include "FontPlatformData.h"
 #include "NotImplemented.h"
 #include <String.h>
-
+#include <interface/Font.h>
 
 namespace WebCore {
 
@@ -59,10 +60,11 @@
 
 SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
-    // FIXME: Would be even better to somehow get the user's default font here.
-    // For now we'll pick the default that the user would get without changing any prefs.
-    static AtomicString defaultString("DejaVu Serif");
-    return getCachedFontData(fontDescription, defaultString);
+    font_family family;
+    font_style style;
+    be_plain_font->GetFamilyAndStyle(&family, &style);
+    AtomicString plainFontFamily(family);
+    return getCachedFontData(fontDescription, plainFontFamily);
 }
 
 FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
diff --git a/WebCore/platform/graphics/haiku/FontHaiku.cpp b/WebCore/platform/graphics/haiku/FontHaiku.cpp
index 48744d9..d4622cb 100644
--- a/WebCore/platform/graphics/haiku/FontHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/FontHaiku.cpp
@@ -94,7 +94,7 @@
 }
 
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     notImplemented();
     return 0;
diff --git a/WebCore/platform/graphics/haiku/GradientHaiku.cpp b/WebCore/platform/graphics/haiku/GradientHaiku.cpp
index 469a17f..fdc4690 100644
--- a/WebCore/platform/graphics/haiku/GradientHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GradientHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>  All rights reserved.
  * Copyright (C) 2009 Maxime Simon <simon.maxime@theolliviers.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,26 +28,45 @@
 #include "config.h"
 #include "Gradient.h"
 
-#include "CSSParser.h"
-#include "NotImplemented.h"
+#include "GraphicsContext.h"
+#include <GradientLinear.h>
+#include <GradientRadial.h>
+#include <View.h>
 
 
 namespace WebCore {
 
 void Gradient::platformDestroy()
 {
-    notImplemented();
+    delete m_gradient;
 }
 
 PlatformGradient Gradient::platformGradient()
 {
-    notImplemented();
-    return 0;
+    if (m_gradient)
+        return m_gradient;
+
+    if (m_radial) {
+        // TODO: Support m_r0?
+        m_gradient = new BGradientRadial(m_p0, m_r1);
+    } else
+        m_gradient = new BGradientLinear(m_p0, m_p1);
+    size_t size = m_stops.size();
+    for (size_t i = 0; i < size; i++) {
+        const ColorStop& stop = m_stops[i];
+        rgb_color color;
+        color.red = static_cast<uint8>(stop.red * 255);
+        color.green = static_cast<uint8>(stop.green * 255);
+        color.blue = static_cast<uint8>(stop.blue * 255);
+        color.alpha = static_cast<uint8>(stop.alpha * 255);
+        m_gradient->AddColor(color, stop.stop);
+    }
+    return m_gradient;
 }
 
-void Gradient::fill(GraphicsContext*, const FloatRect&)
+void Gradient::fill(GraphicsContext* context, const FloatRect& rect)
 {
-    notImplemented();
+    context->platformContext()->FillRect(rect, *platformGradient());
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 7ab3a40..8db512c 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -29,13 +29,13 @@
 #include "GraphicsContext.h"
 
 #include "AffineTransform.h"
-#include "CString.h"
 #include "Color.h"
 #include "Font.h"
 #include "FontData.h"
 #include "NotImplemented.h"
 #include "Path.h"
 #include "Pen.h"
+#include <wtf/text/CString.h>
 #include <GraphicsDefs.h>
 #include <Region.h>
 #include <View.h>
diff --git a/WebCore/platform/graphics/haiku/ImageHaiku.cpp b/WebCore/platform/graphics/haiku/ImageHaiku.cpp
index 976154c..5a55d7c 100644
--- a/WebCore/platform/graphics/haiku/ImageHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/ImageHaiku.cpp
@@ -39,6 +39,7 @@
 #include "ImageObserver.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
+#include "SharedBuffer.h"
 #include "TransformationMatrix.h"
 #include <Application.h>
 #include <Bitmap.h>
@@ -120,7 +121,7 @@
         imageObserver()->didDraw(this);
 }
 
-void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& srcPoint, ColorSpace, CompositeOperator op, const FloatRect& dstRect)
+void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& dstRect)
 {
     BBitmap* image = nativeImageForCurrentFrame();
     if (!image || !image->IsValid()) // If the image hasn't fully loaded.
diff --git a/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp b/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
index adb7573..f429ab5 100644
--- a/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
@@ -93,7 +93,7 @@
     m_treatAsFixedPitch = m_platformData.font() && m_platformData.font()->IsFixed();
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
 {
     if (!m_platformData.font())
         return 0;
@@ -103,7 +103,9 @@
 
     charUnicodeToUTF8HACK(glyph, charArray);
     m_platformData.font()->GetEscapements(charArray, 1, escapements);
-    return escapements[0] * m_platformData.font()->Size();
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = escapements[0] * m_platformData.font()->Size();
+    return metrics;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/haiku/StillImageHaiku.cpp b/WebCore/platform/graphics/haiku/StillImageHaiku.cpp
new file mode 100644
index 0000000..7f9fb15
--- /dev/null
+++ b/WebCore/platform/graphics/haiku/StillImageHaiku.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
+ *
+ * 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 COMPUTER, 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 "StillImageHaiku.h"
+
+#include "GraphicsContext.h"
+#include "IntSize.h"
+#include <View.h>
+
+namespace WebCore {
+
+StillImage::StillImage(const BBitmap& bitmap)
+    : m_bitmap(&bitmap)
+{
+}
+
+void StillImage::destroyDecodedData(bool destroyAll)
+{
+    // This is used for "large" animations to free image data.
+    // It appears it would not apply to StillImage.
+}
+
+unsigned StillImage::decodedSize() const
+{
+    // FIXME: It could be wise to return 0 here, since we don't want WebCore
+    // to think we eat up memory, since we are not freeing any in
+    // destroyDecodedData() either.
+    return m_bitmap.BitsLength();
+}
+
+IntSize StillImage::size() const
+{
+    return IntSize(m_bitmap.Bounds().IntegerWidth() + 1, m_bitmap.Bounds().IntegerHeight() + 1);
+}
+
+NativeImagePtr StillImage::nativeImageForCurrentFrame()
+{
+    return &m_bitmap;
+}
+
+void StillImage::draw(GraphicsContext* context, const FloatRect& destRect,
+                      const FloatRect& sourceRect, ColorSpace, CompositeOperator op)
+{
+    if (!m_bitmap.IsValid())
+        return;
+
+    context->save();
+    context->setCompositeOperation(op);
+    context->platformContext()->DrawBitmap(&m_bitmap, sourceRect, destRect);
+    context->restore();
+}
+
+}
diff --git a/WebCore/platform/graphics/haiku/StillImageHaiku.h b/WebCore/platform/graphics/haiku/StillImageHaiku.h
new file mode 100644
index 0000000..f4bcbe1
--- /dev/null
+++ b/WebCore/platform/graphics/haiku/StillImageHaiku.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
+ *
+ * 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 COMPUTER, 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 StillImageHaiku_h
+#define StillImageHaiku_h
+
+#include "Image.h"
+#include <Bitmap.h>
+
+namespace WebCore {
+
+class StillImage : public Image {
+public:
+    static PassRefPtr<StillImage> create(const BBitmap& bitmap)
+    {
+        return adoptRef(new StillImage(bitmap));
+    }
+
+    virtual void destroyDecodedData(bool destroyAll = true);
+    virtual unsigned decodedSize() const;
+
+    virtual IntSize size() const;
+    virtual NativeImagePtr nativeImageForCurrentFrame();
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator);
+
+private:
+    StillImage(const BBitmap&);
+    
+    BBitmap m_bitmap;
+};
+
+} // namespace WebCore
+
+#endif // StillImageHaiku_h
diff --git a/WebCore/platform/graphics/mac/Canvas3DLayer.h b/WebCore/platform/graphics/mac/Canvas3DLayer.h
index 122ef39..4609010 100644
--- a/WebCore/platform/graphics/mac/Canvas3DLayer.h
+++ b/WebCore/platform/graphics/mac/Canvas3DLayer.h
@@ -32,16 +32,18 @@
 
 namespace WebCore {
     class GraphicsLayer;
+    class GraphicsContext3D;
 }
 
 @interface Canvas3DLayer : CAOpenGLLayer 
 {
     WebCore::GraphicsLayer* m_layerOwner;
+    WebCore::GraphicsContext3D* m_context;
     CGLContextObj m_contextObj;
     GLuint m_texture;
 }
 
-- (id)initWithContext:(CGLContextObj)context texture:(GLuint)texture;
+- (id)initWithContext:(WebCore::GraphicsContext3D*)context;
 
 - (CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace;
 
diff --git a/WebCore/platform/graphics/mac/Canvas3DLayer.mm b/WebCore/platform/graphics/mac/Canvas3DLayer.mm
index 59a7384..22a0a10 100644
--- a/WebCore/platform/graphics/mac/Canvas3DLayer.mm
+++ b/WebCore/platform/graphics/mac/Canvas3DLayer.mm
@@ -41,10 +41,11 @@
 
 @implementation Canvas3DLayer
 
--(id)initWithContext:(CGLContextObj)context texture:(GLuint)texture
+-(id)initWithContext:(GraphicsContext3D*)context
 {
-    m_contextObj = context;
-    m_texture = texture;
+    m_context = context;
+    m_contextObj = static_cast<CGLContextObj>(context->platformGraphicsContext3D());
+    m_texture = static_cast<GLuint>(context->platformTexture());
     self = [super init];
     return self;
 }
@@ -70,8 +71,8 @@
 
 -(void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
 {
-    CGLSetCurrentContext(m_contextObj);
-    glFinish();
+    m_context->prepareTexture();
+
     CGLSetCurrentContext(glContext);
 
     CGRect frame = [self frame];
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.cpp b/WebCore/platform/graphics/mac/ComplexTextController.cpp
index 543d885..b501293 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -68,6 +68,10 @@
     , m_characterInCurrentGlyph(0)
     , m_finalRoundingWidth(0)
     , m_fallbackFonts(fallbackFonts)
+    , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
+    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
     , m_lastRoundingGlyph(0)
 {
     m_padding = m_run.padding();
@@ -394,7 +398,12 @@
             // FIXME: Instead of dividing the glyph's advance equially between the characters, this
             // could use the glyph's "ligature carets". However, there is no Core Text API to get the
             // ligature carets.
-            m_runWidthSoFar += adjustedAdvance.width * (m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
+            if (glyphStartOffset == glyphEndOffset) {
+                // When there are multiple glyphs per character we need to advance by the full width of the glyph.
+                ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph);
+                m_runWidthSoFar += adjustedAdvance.width;
+            } else
+                m_runWidthSoFar += adjustedAdvance.width * (m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
 
             if (glyphEndOffset + complexTextRun.stringLocation() > m_currentCharacter)
                 return;
@@ -433,6 +442,7 @@
         CGFloat roundedSpaceWidth = roundCGFloat(fontData->spaceWidth());
         bool roundsAdvances = !m_font.isPrinterFont() && fontData->platformData().roundsGlyphAdvances();
         bool hasExtraSpacing = (m_font.letterSpacing() || m_font.wordSpacing() || m_padding) && !m_run.spacingDisabled();
+        CGPoint glyphOrigin = CGPointZero;
         CFIndex lastCharacterIndex = m_run.ltr() ? numeric_limits<CFIndex>::min() : numeric_limits<CFIndex>::max();
         bool isMonotonic = true;
 
@@ -536,6 +546,16 @@
             advance.height *= -1;
             m_adjustedAdvances.append(advance);
             m_adjustedGlyphs.append(glyph);
+            
+            GlyphMetrics glyphMetrics = fontData->metricsForGlyph(glyph);
+            glyphMetrics.boundingBox.move(glyphOrigin.x, glyphOrigin.y);
+            m_minGlyphBoundingBoxX = min(m_minGlyphBoundingBoxX, glyphMetrics.boundingBox.x());
+            m_maxGlyphBoundingBoxX = max(m_maxGlyphBoundingBoxX, glyphMetrics.boundingBox.right());
+            m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, glyphMetrics.boundingBox.y());
+            m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, glyphMetrics.boundingBox.bottom());
+            glyphOrigin.x += advance.width;
+            glyphOrigin.y += advance.height;
+            
             lastCharacterIndex = characterIndex;
         }
         if (!isMonotonic)
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.h b/WebCore/platform/graphics/mac/ComplexTextController.h
index 53e8f7a..280327f 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.h
+++ b/WebCore/platform/graphics/mac/ComplexTextController.h
@@ -62,6 +62,11 @@
     // Extra width to the left of the leftmost glyph.
     float finalRoundingWidth() const { return m_finalRoundingWidth; }
 
+    float minGlyphBoundingBoxX() const { return m_minGlyphBoundingBoxX; }
+    float maxGlyphBoundingBoxX() const { return m_maxGlyphBoundingBoxX; }
+    float minGlyphBoundingBoxY() const { return m_minGlyphBoundingBoxY; }
+    float maxGlyphBoundingBoxY() const { return m_maxGlyphBoundingBoxY; }
+    
 private:
     class ComplexTextRun : public RefCounted<ComplexTextRun> {
     public:
@@ -173,6 +178,11 @@
 
     HashSet<const SimpleFontData*>* m_fallbackFonts;
 
+    float m_minGlyphBoundingBoxX;
+    float m_maxGlyphBoundingBoxX;
+    float m_minGlyphBoundingBoxY;
+    float m_maxGlyphBoundingBoxY;
+    
     unsigned m_lastRoundingGlyph;
 };
 
diff --git a/WebCore/platform/graphics/mac/FontComplexTextMac.cpp b/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
index 0db2601..b7ed0e9 100644
--- a/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
+++ b/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
@@ -33,6 +33,8 @@
 #include "SimpleFontData.h"
 #include <wtf/MathExtras.h>
 
+using namespace std;
+
 namespace WebCore {
 
 FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& point, int h,
@@ -83,9 +85,15 @@
     drawGlyphBuffer(context, glyphBuffer, run, startPoint);
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     ComplexTextController controller(this, run, true, fallbackFonts);
+    if (glyphOverflow) {
+        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - ascent());
+        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(controller.maxGlyphBoundingBoxY()) - descent());
+        glyphOverflow->left = max<int>(0, ceilf(-controller.minGlyphBoundingBoxX()));
+        glyphOverflow->right = max<int>(0, ceilf(controller.maxGlyphBoundingBoxX() - controller.totalWidth()));
+    }
     return controller.totalWidth();
 }
 
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index bb9561e..87057fa 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2006 Apple Computer, Inc.
+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -47,6 +47,28 @@
     return true;
 }
 
+static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+{
+    if (!font.isColorBitmapFont())
+        CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+    else {
+        if (!count)
+            return;
+
+        Vector<CGPoint, 256> positions(count);
+        CGAffineTransform matrix = CGAffineTransformInvert(CGContextGetTextMatrix(context));
+        positions[0] = CGPointZero;
+        for (size_t i = 1; i < count; ++i) {
+            CGSize advance = CGSizeApplyAffineTransform(advances[i - 1], matrix);
+            positions[i].x = positions[i - 1].x + advance.width;
+            positions[i].y = positions[i - 1].y + advance.height;
+        }
+        CTFontDrawGlyphs(toCTFontRef(font.font()), glyphs, positions.data(), count, context);
+    }
+#endif
+}
+
 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const
 {
     CGContextRef cgContext = context->platformContext();
@@ -98,7 +120,7 @@
     CGContextSetFont(cgContext, platformData.cgFont());
 
     CGAffineTransform matrix = CGAffineTransformIdentity;
-    if (drawFont)
+    if (drawFont && !platformData.isColorBitmapFont())
         memcpy(&matrix, [drawFont matrix], sizeof(matrix));
     matrix.b = -matrix.b;
     matrix.d = -matrix.d;
@@ -112,13 +134,14 @@
     } else
         CGContextSetFontSize(cgContext, platformData.m_size);
 
+
     IntSize shadowSize;
     int shadowBlur;
     Color shadowColor;
     ColorSpace fillColorSpace = context->fillColorSpace();
     context->getShadow(shadowSize, shadowBlur, shadowColor);
 
-    bool hasSimpleShadow = context->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur;
+    bool hasSimpleShadow = context->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont();
     if (hasSimpleShadow) {
         // Paint simple shadows ourselves instead of relying on CG shadows, to avoid losing subpixel antialiasing.
         context->clearShadow();
@@ -126,19 +149,19 @@
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
         context->setFillColor(shadowFillColor, fillColorSpace);
         CGContextSetTextPosition(cgContext, point.x() + shadowSize.width(), point.y() + shadowSize.height());
-        CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+        showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         if (font->syntheticBoldOffset()) {
             CGContextSetTextPosition(cgContext, point.x() + shadowSize.width() + font->syntheticBoldOffset(), point.y() + shadowSize.height());
-            CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+            showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         }
         context->setFillColor(fillColor, fillColorSpace);
     }
 
     CGContextSetTextPosition(cgContext, point.x(), point.y());
-    CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+    showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     if (font->syntheticBoldOffset()) {
         CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y());
-        CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+        showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     }
 
     if (hasSimpleShadow)
diff --git a/WebCore/platform/graphics/mac/FontPlatformData.h b/WebCore/platform/graphics/mac/FontPlatformData.h
index faf5f2e..23016e7 100644
--- a/WebCore/platform/graphics/mac/FontPlatformData.h
+++ b/WebCore/platform/graphics/mac/FontPlatformData.h
@@ -61,6 +61,7 @@
 #ifdef BUILDING_ON_TIGER
         , m_cgFont(0)
 #endif
+        , m_isColorBitmapFont(false)
     {
     }
 
@@ -73,6 +74,7 @@
         , m_size(size)
         , m_font(0)
         , m_cgFont(cgFont)
+        , m_isColorBitmapFont(false)
     {
     }
 
@@ -113,6 +115,7 @@
 
     bool roundsGlyphAdvances() const;
     bool allowsLigatures() const;
+    bool isColorBitmapFont() const { return m_isColorBitmapFont; }
 
 #ifndef BUILDING_ON_TIGER
     CGFontRef cgFont() const { return m_cgFont.get(); }
@@ -133,6 +136,8 @@
 #else
     CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced.
 #endif
+
+    bool m_isColorBitmapFont;
 };
 
 }
diff --git a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
index 0118c8b..53b0282 100644
--- a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
+++ b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
@@ -1,7 +1,7 @@
 /*
  * This file is part of the internal font implementation.
  *
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -33,6 +33,11 @@
     : m_syntheticBold(syntheticBold)
     , m_syntheticOblique(syntheticOblique)
     , m_font(nsFont)
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+    , m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait)
+#else
+    , m_isColorBitmapFont(false)
+#endif
 {
     if (nsFont)
         CFRetain(nsFont);
@@ -54,6 +59,7 @@
     m_size = f.m_size;
     m_cgFont = f.m_cgFont;
     m_atsuFontID = f.m_atsuFontID;
+    m_isColorBitmapFont = f.m_isColorBitmapFont;
 }
 
 FontPlatformData:: ~FontPlatformData()
@@ -76,6 +82,7 @@
     if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
         CFRelease(m_font);
     m_font = f.m_font;
+    m_isColorBitmapFont = f.m_isColorBitmapFont;
     return *this;
 }
 
@@ -96,6 +103,9 @@
     m_cgFont = wkGetCGFontFromNSFont(font);
     m_atsuFontID = wkGetNSFontATSUFontId(font);
 #endif
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+    m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(font)) & kCTFontColorGlyphsTrait;
+#endif
 }
 
 bool FontPlatformData::roundsGlyphAdvances() const
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp b/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
index 096cdbd..82c314e 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
@@ -30,14 +30,13 @@
 #include "GraphicsContext3D.h"
 
 #include "CanvasObject.h"
-#include "CString.h"
 #include "ImageBuffer.h"
 #include "NotImplemented.h"
 #include "WebGLActiveInfo.h"
 #include "WebGLArray.h"
 #include "WebGLBuffer.h"
-#include "WebGLFramebuffer.h"
 #include "WebGLFloatArray.h"
+#include "WebGLFramebuffer.h"
 #include "WebGLIntArray.h"
 #include "WebGLProgram.h"
 #include "WebGLRenderbuffer.h"
@@ -46,7 +45,9 @@
 #include "WebGLUnsignedByteArray.h"
 #include <CoreGraphics/CGBitmapContext.h>
 #include <OpenGL/CGLRenderers.h>
+#include <OpenGL/gl.h>
 #include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -75,28 +76,26 @@
     attribs.append(static_cast<CGLPixelFormatAttribute>(0));
 }
 
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs)
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
 {
-    OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs));
+    OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
     return context->m_contextObj ? context.release() : 0;
 }
 
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs)
-    : m_attrs(attrs)
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+    : m_currentWidth(0)
+    , m_currentHeight(0)
+    , m_attrs(attrs)
     , m_contextObj(0)
     , m_texture(0)
     , m_fbo(0)
-    , m_depthBuffer(0)
+    , m_depthStencilBuffer(0)
+    , m_boundFBO(0)
+    , m_multisampleFBO(0)
+    , m_multisampleDepthStencilBuffer(0)
+    , m_multisampleColorBuffer(0)
 {
-    // FIXME: we need to take into account the user's requested
-    // context creation attributes, in particular stencil and
-    // antialias, and determine which could and could not be honored
-    // based on the capabilities of the OpenGL implementation.
-    m_attrs.alpha = true;
-    m_attrs.depth = true;
-    m_attrs.stencil = false;
-    m_attrs.antialias = false;
-    m_attrs.premultipliedAlpha = true;
+    UNUSED_PARAM(hostWindow);
 
     Vector<CGLPixelFormatAttribute> attribs;
     CGLPixelFormatObj pixelFormatObj = 0;
@@ -145,6 +144,8 @@
     // Set the current context to the one given to us.
     CGLSetCurrentContext(m_contextObj);
     
+    validateAttributes();
+
     // create a texture to render into
     ::glGenTextures(1, &m_texture);
     ::glBindTexture(GL_TEXTURE_2D, m_texture);
@@ -152,21 +153,27 @@
     ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
     ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
-    ::glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
     ::glBindTexture(GL_TEXTURE_2D, 0);
     
     // create an FBO
     ::glGenFramebuffersEXT(1, &m_fbo);
     ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
     
-    ::glGenRenderbuffersEXT(1, &m_depthBuffer);
-    ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthBuffer);
-    ::glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, 1, 1);
-    ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+    m_boundFBO = m_fbo;
+    if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth))
+        ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer);
+
+    // create an multisample FBO
+    if (m_attrs.antialias) {
+        ::glGenFramebuffersEXT(1, &m_multisampleFBO);
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+        m_boundFBO = m_multisampleFBO;
+        ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer);
+        if (m_attrs.stencil || m_attrs.depth)
+            ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
+    }
     
-    ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
-    ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthBuffer);
-    
+    ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
     ::glClearColor(0, 0, 0, 0);
 }
 
@@ -174,14 +181,46 @@
 {
     if (m_contextObj) {
         CGLSetCurrentContext(m_contextObj);
-        ::glDeleteRenderbuffersEXT(1, & m_depthBuffer);
         ::glDeleteTextures(1, &m_texture);
+        if (m_attrs.antialias) {
+            ::glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
+            if (m_attrs.stencil || m_attrs.depth)
+                ::glDeleteRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
+            ::glDeleteFramebuffersEXT(1, &m_multisampleFBO);
+        } else {
+            if (m_attrs.stencil || m_attrs.depth)
+                ::glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
+        }
         ::glDeleteFramebuffersEXT(1, &m_fbo);
         CGLSetCurrentContext(0);
         CGLDestroyContext(m_contextObj);
     }
 }
 
+void GraphicsContext3D::validateAttributes()
+{
+    const char* extensions = reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS));
+    if (m_attrs.stencil) {
+        if (std::strstr(extensions, "GL_EXT_packed_depth_stencil")) {
+            if (!m_attrs.depth)
+                m_attrs.depth = true;
+        } else
+            m_attrs.stencil = false;
+    }
+    if (m_attrs.antialias) {
+        bool isValidVendor = true;
+        // Currently in Mac we only turn on antialias if vendor is NVIDIA.
+        const char* vendor = reinterpret_cast<const char*>(::glGetString(GL_VENDOR));
+        if (!std::strstr(vendor, "NVIDIA"))
+            isValidVendor = false;
+        if (!isValidVendor || !std::strstr(extensions, "GL_EXT_framebuffer_multisample"))
+            m_attrs.antialias = false;
+    }
+    // FIXME: instead of enforcing premultipliedAlpha = true, implement the
+    // correct behavior when premultipliedAlpha = false is requested.
+    m_attrs.premultipliedAlpha = true;
+}
+
 void GraphicsContext3D::makeContextCurrent()
 {
     CGLSetCurrentContext(m_contextObj);
@@ -206,24 +245,86 @@
     
     CGLSetCurrentContext(m_contextObj);
     
+    GLuint internalColorFormat, colorFormat, internalDepthStencilFormat = 0;
+    if (m_attrs.alpha) {
+        internalColorFormat = GL_RGBA8;
+        colorFormat = GL_RGBA;
+    } else {
+        internalColorFormat = GL_RGB8;
+        colorFormat = GL_RGB;
+    }
+    if (m_attrs.stencil || m_attrs.depth) {
+        // We don't allow the logic where stencil is required and depth is not.
+        // See GraphicsContext3D constructor.
+        if (m_attrs.stencil && m_attrs.depth)
+            internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
+        else
+            internalDepthStencilFormat = GL_DEPTH_COMPONENT;
+    }
+
+    bool mustRestoreFBO = false;
+
+    // resize multisample FBO
+    if (m_attrs.antialias) {
+        GLint maxSampleCount;
+        ::glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
+        GLint sampleCount = std::min(8, maxSampleCount);
+        if (sampleCount > maxSampleCount)
+            sampleCount = maxSampleCount;
+        if (m_boundFBO != m_multisampleFBO) {
+            ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+            mustRestoreFBO = true;
+        }
+        ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+        ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalColorFormat, width, height);
+        ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+        if (m_attrs.stencil || m_attrs.depth) {
+            ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+            ::glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height);
+            if (m_attrs.stencil)
+                ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+            if (m_attrs.depth)
+                ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+        }
+        ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+        if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
+            // FIXME: cleanup.
+            notImplemented();
+        }
+    }
+
+    // resize regular FBO
+    if (m_boundFBO != m_fbo) {
+        mustRestoreFBO = true;
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+    }
     ::glBindTexture(GL_TEXTURE_2D, m_texture);
-    ::glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-    ::glBindTexture(GL_TEXTURE_2D, 0);
-    
-    ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
-    ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthBuffer);
-    ::glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
-    ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
-    
+    ::glTexImage2D(GL_TEXTURE_2D, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
-    ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthBuffer);
-    GLenum status = ::glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
-    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+    ::glBindTexture(GL_TEXTURE_2D, 0);
+    if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) {
+        ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        ::glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalDepthStencilFormat, width, height);
+        if (m_attrs.stencil)
+            ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        if (m_attrs.depth)
+            ::glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+    }
+    if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) {
         // FIXME: cleanup
         notImplemented();
     }
 
-    ::glClear(GL_COLOR_BUFFER_BIT);
+    if (mustRestoreFBO)
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+
+    GLenum clearMask = GL_COLOR_BUFFER_BIT;
+    if (m_attrs.depth)
+        clearMask |= GL_DEPTH_BUFFER_BIT;
+    if (m_attrs.stencil)
+        clearMask |= GL_STENCIL_BUFFER_BIT;
+    ::glClear(clearMask);
     ::glFlush();
 }
 
@@ -237,6 +338,18 @@
         CGLSetCurrentContext(context);
 }
 
+void GraphicsContext3D::prepareTexture()
+{
+    if (m_attrs.antialias) {
+        ensureContext(m_contextObj);
+        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        ::glBlitFramebufferEXT(0, 0, m_currentWidth, m_currentHeight, 0, 0, m_currentWidth, m_currentHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+    }
+    ::glFinish();
+}
+
 void GraphicsContext3D::activeTexture(unsigned long texture)
 {
     ensureContext(m_contextObj);
@@ -268,7 +381,15 @@
 void GraphicsContext3D::bindFramebuffer(unsigned long target, WebGLFramebuffer* buffer)
 {
     ensureContext(m_contextObj);
-    ::glBindFramebufferEXT(target, (buffer && buffer->object()) ? (GLuint) buffer->object() : m_fbo);
+    GLuint fbo;
+    if (buffer && buffer->object())
+        fbo = (GLuint)buffer->object();
+    else
+        fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
+    if (fbo != m_boundFBO) {
+        ::glBindFramebufferEXT(target, fbo);
+        m_boundFBO = fbo;
+    }
 }
 
 void GraphicsContext3D::bindRenderbuffer(unsigned long target, WebGLRenderbuffer* renderbuffer)
@@ -384,13 +505,29 @@
 void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
 {
     ensureContext(m_contextObj);
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+    }
     ::glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
 }
 
 void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
 {
     ensureContext(m_contextObj);
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+    }
     ::glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
 }
 
 void GraphicsContext3D::cullFace(unsigned long mode)
@@ -476,7 +613,12 @@
 void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer* buffer)
 {
     ensureContext(m_contextObj);
-    ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer ? (GLuint) buffer->object() : 0);
+    GLuint renderbuffer = (buffer ? (GLuint) buffer->object() : 0);
+    if (attachment == DEPTH_STENCIL_ATTACHMENT) {
+        ::glFramebufferRenderbufferEXT(target, DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
+        ::glFramebufferRenderbufferEXT(target, STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer);
+    } else
+        ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
 }
 
 void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture* texture, long level)
@@ -665,20 +807,22 @@
     ::glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
 }
 
-PassRefPtr<WebGLArray> GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type)
+void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
 {
+    // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
+    // all previous rendering calls should be done before reading pixels.
     ensureContext(m_contextObj);
-    
-    // FIXME: For now we only accept GL_UNSIGNED_BYTE/GL_RGBA. In reality OpenGL ES 2.0 accepts that pair and one other
-    // as specified by GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE. But for now we will
-    // not accept those.
-    // FIXME: Also, we should throw when an unacceptable value is passed
-    if (type != GL_UNSIGNED_BYTE || format != GL_RGBA)
-        return 0;
-        
-    RefPtr<WebGLUnsignedByteArray> array = WebGLUnsignedByteArray::create(width * height * 4);
-    ::glReadPixels(x, y, width, height, format, type, (GLvoid*) array->data());
-    return array;    
+    ::glFlush();
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
+        ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        ::glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        ::glFlush();
+    }
+    ::glReadPixels(x, y, width, height, format, type, data);
+    if (m_attrs.antialias && m_boundFBO == m_multisampleFBO)
+        ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
 }
 
 void GraphicsContext3D::releaseShaderCompiler()
@@ -691,6 +835,10 @@
 void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
 {
     ensureContext(m_contextObj);
+    if (internalformat == DEPTH_STENCIL)
+        internalformat = GL_DEPTH24_STENCIL8_EXT;
+    else if (internalformat == DEPTH_COMPONENT16)
+        internalformat = GL_DEPTH_COMPONENT;
     ::glRenderbufferStorageEXT(target, internalformat, width, height);
 }
 
@@ -986,6 +1134,8 @@
 void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value)
 {
     ensureContext(m_contextObj);
+    if (attachment == DEPTH_STENCIL_ATTACHMENT)
+        attachment = DEPTH_ATTACHMENT; // Or STENCIL_ATTACHMENT, either works.
     ::glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
 }
 
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index 5362562..49aebba 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -340,6 +340,7 @@
 
     RetainPtr<WebAnimationDelegate> m_animationDelegate;
 
+    RetainPtr<CGImageRef> m_uncorrectedContentsImage;
     RetainPtr<CGImageRef> m_pendingContentsImage;
     
     struct LayerAnimation {
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index 22e39f5..294c82f 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -34,7 +34,6 @@
 #if ENABLE(3D_CANVAS)
 #import "Canvas3DLayer.h"
 #endif
-#import "CString.h"
 #import "FloatConversion.h"
 #import "FloatRect.h"
 #import "Image.h"
@@ -769,7 +768,17 @@
 void GraphicsLayerCA::setContentsToImage(Image* image)
 {
     if (image) {
-        m_pendingContentsImage = image->nativeImageForCurrentFrame();
+        CGImageRef newImage = image->nativeImageForCurrentFrame();
+        if (!newImage)
+            return;
+
+        // Check to see if the image changed; we have to do this because the call to
+        // CGImageCreateCopyWithColorSpace() below can create a new image every time.
+        if (m_uncorrectedContentsImage && m_uncorrectedContentsImage.get() == newImage)
+            return;
+        
+        m_uncorrectedContentsImage = newImage;
+        m_pendingContentsImage = newImage;
         CGColorSpaceRef colorSpace = CGImageGetColorSpace(m_pendingContentsImage.get());
 
         static CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
@@ -783,6 +792,7 @@
         if (!m_contentsLayer)
             noteSublayersChanged();
     } else {
+        m_uncorrectedContentsImage = 0;
         m_pendingContentsImage = 0;
         m_contentsLayerPurpose = NoContentsLayer;
         if (m_contentsLayer)
@@ -1716,7 +1726,7 @@
 
     if (m_platformGraphicsContext3D != NullPlatformGraphicsContext3D && m_platformTexture != NullPlatform3DObject) {
         // create the inner 3d layer
-        m_contentsLayer.adoptNS([[Canvas3DLayer alloc] initWithContext:static_cast<CGLContextObj>(m_platformGraphicsContext3D) texture:static_cast<GLuint>(m_platformTexture)]);
+        m_contentsLayer.adoptNS([[Canvas3DLayer alloc] initWithContext:const_cast<GraphicsContext3D*>(graphicsContext3D)]);
 #ifndef NDEBUG
         [m_contentsLayer.get() setName:@"3D Layer"];
 #endif
@@ -1859,12 +1869,28 @@
     else if (anim->direction() == Animation::AnimationDirectionAlternate)
         repeatCount /= 2;
 
+    NSString* fillMode = 0;
+    switch (anim->fillMode()) {
+    case AnimationFillModeNone:
+        fillMode = kCAFillModeForwards; // Use "forwards" rather than "removed" because the style system will remove the animation when it is finished. This avoids a flash.
+        break;
+    case AnimationFillModeBackwards:
+        fillMode = kCAFillModeBoth; // Use "both" rather than "backwards" because the style system will remove the animation when it is finished. This avoids a flash.
+        break;
+    case AnimationFillModeForwards:
+       fillMode = kCAFillModeForwards;
+       break;
+    case AnimationFillModeBoth:
+       fillMode = kCAFillModeBoth;
+       break;
+    }
+
     [propertyAnim setDuration:duration];
     [propertyAnim setRepeatCount:repeatCount];
     [propertyAnim setAutoreverses:anim->direction()];
     [propertyAnim setRemovedOnCompletion:NO];
     [propertyAnim setAdditive:additive];
-    [propertyAnim setFillMode:@"extended"];
+    [propertyAnim setFillMode:fillMode];
 
     [propertyAnim setDelegate:m_animationDelegate.get()];
 }
@@ -2226,6 +2252,7 @@
 {
     // Turn off implicit animations on the inner layer.
     [contentsLayer setStyle:[NSDictionary dictionaryWithObject:nullActionsDictionary() forKey:@"actions"]];
+    [contentsLayer setMasksToBounds:YES];
 
     if (defaultContentsOrientation() == CompositingCoordinatesBottomUp) {
         CATransform3D flipper = {
diff --git a/WebCore/platform/graphics/mac/ImageMac.mm b/WebCore/platform/graphics/mac/ImageMac.mm
index 672c3c8..96b93be 100644
--- a/WebCore/platform/graphics/mac/ImageMac.mm
+++ b/WebCore/platform/graphics/mac/ImageMac.mm
@@ -30,6 +30,7 @@
 #import "FoundationExtras.h"
 #import "GraphicsContext.h"
 #import "PlatformString.h"
+#import "SharedBuffer.h"
 
 @interface WebCoreBundleFinder : NSObject
 @end
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
index 355aa68..2636aeb 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
@@ -59,7 +59,6 @@
 public:
     static void registerMediaEngine(MediaEngineRegistrar);
 
-    ~MediaPlayerPrivate();
 
     void repaint();
     void loadStateChanged();
@@ -70,6 +69,7 @@
 
 private:
     MediaPlayerPrivate(MediaPlayer*);
+    ~MediaPlayerPrivate();
 
     // engine support
     static MediaPlayerPrivateInterface* create(MediaPlayer* player);
@@ -89,9 +89,12 @@
     
     void load(const String& url);
     void cancelLoad();
+    void loadInternal(const String& url);
+    void resumeLoad();
     
     void play();
     void pause();    
+    void prepareToPlay();
     
     bool paused() const;
     bool seeking() const;
@@ -107,6 +110,8 @@
     bool hasClosedCaptions() const;
     void setClosedCaptionsVisible(bool);
 
+    void setPreload(MediaPlayer::Preload);
+
     MediaPlayer::NetworkState networkState() const { return m_networkState; }
     MediaPlayer::ReadyState readyState() const { return m_readyState; }
     
@@ -172,6 +177,7 @@
     RetainPtr<QTMovieView> m_qtMovieView;
     RetainPtr<QTVideoRendererWebKitOnly> m_qtVideoRenderer;
     RetainPtr<WebCoreMovieObserver> m_objcObserver;
+    String m_movieURL;
     float m_seekTo;
     Timer<MediaPlayerPrivate> m_seekTimer;
     MediaPlayer::NetworkState m_networkState;
@@ -184,11 +190,13 @@
     float m_cachedDuration;
     float m_timeToRestore;
     RetainPtr<QTMovieLayer> m_qtVideoLayer;
+    MediaPlayer::Preload m_preload;
     bool m_startedPlaying;
     bool m_isStreaming;
     bool m_visible;
     bool m_hasUnsupportedTracks;
     bool m_videoFrameHasDrawn;
+    bool m_delayingLoad;
 #if DRAW_FRAME_RATE
     int  m_frameCountWhilePlaying;
     double m_timeStartedPlaying;
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 2b90f7a..c837b51 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -211,6 +211,7 @@
     , m_reportedDuration(-1)
     , m_cachedDuration(-1)
     , m_timeToRestore(-1)
+    , m_preload(MediaPlayer::Auto)
     , m_startedPlaying(false)
     , m_isStreaming(false)
     , m_visible(false)
@@ -549,8 +550,30 @@
     return QTMakeTime(time * timeScale, timeScale);
 }
 
+void MediaPlayerPrivate::resumeLoad()
+{
+    m_delayingLoad = false;
+
+    if (m_movieURL)
+        loadInternal(m_movieURL);
+}
+
 void MediaPlayerPrivate::load(const String& url)
 {
+    m_movieURL = url;
+
+    // If the element is not supposed to load any data return immediately because QTKit
+    // doesn't have API to throttle loading.
+    if (m_preload == MediaPlayer::None) {
+        m_delayingLoad = true;
+        return;
+    }
+
+    loadInternal(url);
+}
+
+void MediaPlayerPrivate::loadInternal(const String& url)
+{
     if (m_networkState != MediaPlayer::Loading) {
         m_networkState = MediaPlayer::Loading;
         m_player->networkStateChanged();
@@ -570,6 +593,12 @@
     [m_objcObserver.get() setDelayCallbacks:NO];
 }
 
+void MediaPlayerPrivate::prepareToPlay()
+{
+    if (!m_qtMovie || m_delayingLoad)
+        resumeLoad();
+}
+
 PlatformMedia MediaPlayerPrivate::platformMedia() const
 {
     PlatformMedia plaftformMedia = { m_qtMovie.get() };
@@ -910,6 +939,7 @@
             loadState = QTMovieLoadStateError;
 
         if (loadState != QTMovieLoadStateError) {
+            wkQTMovieSelectPreferredAlternates(m_qtMovie.get());
             cacheMovieScale();
             MediaPlayer::MovieLoadType movieType = movieLoadType();
             m_isStreaming = movieType == MediaPlayer::StoredStream || movieType == MediaPlayer::LiveStream;
@@ -1437,6 +1467,12 @@
     return movieType;
 }
 
+void MediaPlayerPrivate::setPreload(MediaPlayer::Preload preload)
+{
+    m_preload = preload;
+    if (m_delayingLoad && m_preload != MediaPlayer::None)
+        resumeLoad();
+}
 
 } // namespace WebCore
 
diff --git a/WebCore/platform/graphics/mac/MediaPlayerProxy.h b/WebCore/platform/graphics/mac/MediaPlayerProxy.h
index 6060484..cc7ec95 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerProxy.h
+++ b/WebCore/platform/graphics/mac/MediaPlayerProxy.h
@@ -40,8 +40,8 @@
     MediaPlayerNotificationStartUsingNetwork,
     MediaPlayerNotificationStopUsingNetwork,
 
-    MediaPlayerNotificationEnteredFullScreen,
-    MediaPlayerNotificationExitedFullScreen,
+    MediaPlayerNotificationEnteredFullscreen,
+    MediaPlayerNotificationExitedFullscreen,
     
     MediaPlayerNotificationReadyForInspection,
     MediaPlayerNotificationReadyForPlayback,
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 09947d8..562f56e 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -407,17 +407,29 @@
            [name caseInsensitiveCompare:@"MonotypeCorsiva"] != NSOrderedSame;
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode metricsMode) const
 {
-    NSFont* font = m_platformData.font();
-    float pointSize = m_platformData.m_size;
+    NSFont* font = platformData().font();
+    float pointSize = platformData().m_size;
     CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
     CGSize advance;
-    if (!wkGetGlyphTransformedAdvances(m_platformData.cgFont(), font, &m, &glyph, &advance)) {
+    if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
         LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
         advance.width = 0;
     }
-    return advance.width + m_syntheticBoldOffset;
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = advance.width + m_syntheticBoldOffset;
+    if (metricsMode == GlyphBoundingBox) {
+#ifndef BUILDING_ON_TIGER
+        CGRect boundingBox;
+        CGFontGetGlyphBBoxes(platformData().cgFont(), &glyph, 1, &boundingBox);
+        CGFloat scale = pointSize / unitsPerEm();
+        metrics.boundingBox = CGRectApplyAffineTransform(boundingBox, CGAffineTransformMakeScale(scale, -scale));
+        if (m_syntheticBoldOffset)
+            metrics.boundingBox.setWidth(metrics.boundingBox.width() + m_syntheticBoldOffset);
+#endif
+    }
+    return metrics;
 }
 
 #if USE(ATSUI)
diff --git a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
index 3c7eaf2..d681d75 100644
--- a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.cpp
@@ -263,6 +263,30 @@
     return surface;
 }
 
+EGLSurface EGLDisplayOpenVG::createPbufferFromClientBuffer(
+    EGLClientBuffer clientBuffer, EGLenum bufferType, const EGLConfig& config, EGLint* errorCode)
+{
+    EGLSurface surface = eglCreatePbufferFromClientBuffer(m_display,
+        bufferType, clientBuffer, config, 0 /* attribList */);
+
+    if (errorCode)
+        *errorCode = eglGetError();
+    else
+        ASSERT_EGL_NO_ERROR();
+
+    if (surface == EGL_NO_SURFACE)
+        return EGL_NO_SURFACE;
+
+    EGLint surfaceConfigId;
+    EGLBoolean success = eglGetConfigAttrib(m_display, config, EGL_CONFIG_ID, &surfaceConfigId);
+    ASSERT(success == EGL_TRUE);
+    ASSERT(surfaceConfigId != EGL_BAD_ATTRIBUTE);
+
+    ASSERT(!m_surfaceConfigIds.contains(surface));
+    m_surfaceConfigIds.set(surface, surfaceConfigId);
+    return surface;
+}
+
 EGLSurface EGLDisplayOpenVG::surfaceForWindow(EGLNativeWindowType wId, const EGLConfig& config)
 {
     if (m_windowSurfaces.contains(wId))
diff --git a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
index fd8353d..0dff6c9 100644
--- a/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
+++ b/WebCore/platform/graphics/openvg/EGLDisplayOpenVG.h
@@ -51,6 +51,7 @@
      * If no surface could be created and errorCode is zero, this method
      * will trigger an assertion by itself. */
     EGLSurface createPbufferSurface(const IntSize&, const EGLConfig&, EGLint* errorCode = 0);
+    EGLSurface createPbufferFromClientBuffer(EGLClientBuffer, EGLenum bufferType, const EGLConfig&, EGLint* errorCode = 0);
 
     EGLSurface surfaceForWindow(EGLNativeWindowType, const EGLConfig&);
 
diff --git a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
index 5ed892c..54cc7ee 100644
--- a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
@@ -20,11 +20,12 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "GraphicsContextPrivate.h"
+#include "KURL.h"
 #include "NotImplemented.h"
 #include "PainterOpenVG.h"
 #include "SurfaceOpenVG.h"
-#include "TransformationMatrix.h"
 
 #include <wtf/Assertions.h>
 #include <wtf/MathExtras.h>
@@ -69,12 +70,12 @@
     return m_data->baseSurface();
 }
 
-TransformationMatrix GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM() const
 {
     if (paintingDisabled())
-        return TransformationMatrix();
+        return AffineTransform();
 
-    return m_data->transformationMatrix();
+    return m_data->transformation();
 }
 
 void GraphicsContext::savePlatformState()
@@ -143,7 +144,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
+    m_data->drawPath(VG_FILL_PATH, m_common->state.fillRule);
 }
 
 void GraphicsContext::strokePath()
@@ -151,7 +152,15 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
+    m_data->drawPath(VG_STROKE_PATH, m_common->state.fillRule);
+}
+
+void GraphicsContext::drawPath()
+{
+    if (paintingDisabled())
+        return;
+
+    m_data->drawPath(VG_FILL_PATH | VG_STROKE_PATH, m_common->state.fillRule);
 }
 
 void GraphicsContext::fillRect(const FloatRect& rect)
@@ -193,7 +202,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
+    m_data->beginPath();
 }
 
 void GraphicsContext::addPath(const Path& path)
@@ -201,7 +210,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
+    m_data->addPath(path);
 }
 
 void GraphicsContext::clip(const FloatRect& rect)
@@ -217,8 +226,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(clipRule);
+    m_data->clipPath(*(m_data->currentPath()), PainterOpenVG::IntersectClip, clipRule);
 }
 
 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
@@ -281,7 +289,7 @@
     if (paintingDisabled())
         return FloatRect();
 
-    return FloatRect(enclosingIntRect(m_data->transformationMatrix().mapRect(rect)));
+    return FloatRect(enclosingIntRect(m_data->transformation().mapRect(rect)));
 }
 
 void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Color& color, ColorSpace colorSpace)
@@ -404,8 +412,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(path);
+    m_data->clipPath(path, PainterOpenVG::IntersectClip, m_common->state.fillRule);
 }
 
 void GraphicsContext::canvasClip(const Path& path)
@@ -418,8 +425,7 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(path);
+    m_data->clipPath(path, PainterOpenVG::SubtractClip, m_common->state.fillRule);
 }
 
 void GraphicsContext::scale(const FloatSize& scaleFactors)
@@ -451,8 +457,8 @@
     if (paintingDisabled())
         return IntPoint();
 
-    TransformationMatrix matrix = m_data->transformationMatrix();
-    return IntPoint(roundf(matrix.m41()), roundf(matrix.m42()));
+    AffineTransform transformation = m_data->transformation();
+    return IntPoint(roundf(transformation.e()), roundf(transformation.f()));
 }
 
 void GraphicsContext::clipOut(const IntRect& rect)
@@ -460,8 +466,9 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(rect);
+    Path path;
+    path.addRect(rect);
+    m_data->clipPath(path, PainterOpenVG::SubtractClip, m_common->state.fillRule);
 }
 
 void GraphicsContext::clipOutEllipseInRect(const IntRect& rect)
@@ -469,8 +476,9 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(rect);
+    Path path;
+    path.addEllipse(rect);
+    m_data->clipPath(path, PainterOpenVG::SubtractClip, m_common->state.fillRule);
 }
 
 void GraphicsContext::clipToImageBuffer(const FloatRect& rect, const ImageBuffer* imageBuffer)
@@ -488,17 +496,20 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
-    UNUSED_PARAM(rect);
-    UNUSED_PARAM(thickness);
+    Path path;
+    path.addEllipse(rect);
+    path.addEllipse(FloatRect(rect.x() + thickness, rect.y() + thickness,
+        rect.width() - (thickness * 2), rect.height() - (thickness * 2)));
+
+    m_data->clipPath(path, PainterOpenVG::IntersectClip, m_common->state.fillRule);
 }
 
-void GraphicsContext::concatCTM(const TransformationMatrix& transform)
+void GraphicsContext::concatCTM(const AffineTransform& transformation)
 {
     if (paintingDisabled())
         return;
 
-    m_data->concatTransformationMatrix(transform);
+    m_data->concatTransformation(transformation);
 }
 
 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
diff --git a/WebCore/platform/graphics/openvg/PainterOpenVG.cpp b/WebCore/platform/graphics/openvg/PainterOpenVG.cpp
index 3b7cf85..5842afd 100644
--- a/WebCore/platform/graphics/openvg/PainterOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/PainterOpenVG.cpp
@@ -20,6 +20,7 @@
 #include "config.h"
 #include "PainterOpenVG.h"
 
+#include "AffineTransform.h"
 #include "Color.h"
 #include "DashArray.h"
 #include "FloatPoint.h"
@@ -28,8 +29,8 @@
 #include "IntRect.h"
 #include "IntSize.h"
 #include "NotImplemented.h"
+#include "PlatformPathOpenVG.h"
 #include "SurfaceOpenVG.h"
-#include "TransformationMatrix.h"
 #include "VGUtils.h"
 
 #if PLATFORM(EGL)
@@ -43,12 +44,9 @@
 
 namespace WebCore {
 
-static bool isNonRotatedAffineTransformation(const TransformationMatrix& matrix)
+static bool isNonRotatedAffineTransformation(const AffineTransform& t)
 {
-    return matrix.m12() <= FLT_EPSILON && matrix.m13() <= FLT_EPSILON && matrix.m14() <= FLT_EPSILON
-        && matrix.m21() <= FLT_EPSILON && matrix.m23() <= FLT_EPSILON && matrix.m24() <= FLT_EPSILON
-        && matrix.m31() <= FLT_EPSILON && matrix.m32() <= FLT_EPSILON && matrix.m34() <= FLT_EPSILON
-        && matrix.m44() >= 1 - FLT_EPSILON;
+    return t.b() <= FLT_EPSILON && t.c() <= FLT_EPSILON;
 }
 
 static VGCapStyle toVGCapStyle(LineCap lineCap)
@@ -103,12 +101,16 @@
 
 
 struct PlatformPainterState {
-    TransformationMatrix surfaceTransformationMatrix;
+    AffineTransform surfaceTransformation;
     CompositeOperator compositeOperation;
     float opacity;
 
     bool scissoringEnabled;
     FloatRect scissorRect;
+#ifdef OPENVG_VERSION_1_1
+    bool maskingChangedAndEnabled;
+    VGMaskLayer mask;
+#endif
 
     Color fillColor;
     StrokeStyle strokeStyle;
@@ -120,12 +122,17 @@
     DashArray strokeDashArray;
     float strokeDashOffset;
 
+    int textDrawingMode;
     bool antialiasingEnabled;
 
     PlatformPainterState()
         : compositeOperation(CompositeSourceOver)
         , opacity(1.0)
         , scissoringEnabled(false)
+#ifdef OPENVG_VERSION_1_1
+        , maskingChangedAndEnabled(false)
+        , mask(VG_INVALID_HANDLE)
+#endif
         , fillColor(Color::black)
         , strokeStyle(NoStroke)
         , strokeThickness(0.0)
@@ -133,19 +140,40 @@
         , strokeLineJoin(MiterJoin)
         , strokeMiterLimit(4.0)
         , strokeDashOffset(0.0)
+        , textDrawingMode(cTextFill)
         , antialiasingEnabled(true)
     {
     }
 
+    ~PlatformPainterState()
+    {
+#ifdef OPENVG_VERSION_1_1
+        if (maskingChangedAndEnabled && mask != VG_INVALID_HANDLE) {
+            vgDestroyMaskLayer(mask);
+            ASSERT_VG_NO_ERROR();
+            mask = VG_INVALID_HANDLE;
+        }
+#endif
+    }
+
     PlatformPainterState(const PlatformPainterState& state)
     {
-        surfaceTransformationMatrix = state.surfaceTransformationMatrix;
+        surfaceTransformation = state.surfaceTransformation;
 
         scissoringEnabled = state.scissoringEnabled;
         scissorRect = state.scissorRect;
+#ifdef OPENVG_VERSION_1_1
+        maskingChangedAndEnabled = false;
+        mask = state.mask;
+#endif
         copyPaintState(&state);
     }
 
+    inline bool maskingEnabled()
+    {
+        return maskingChangedAndEnabled || mask != VG_INVALID_HANDLE;
+    }
+
     void copyPaintState(const PlatformPainterState* other)
     {
         compositeOperation = other->compositeOperation;
@@ -161,6 +189,7 @@
         strokeDashArray = other->strokeDashArray;
         strokeDashOffset = other->strokeDashOffset;
 
+        textDrawingMode = other->textDrawingMode;
         antialiasingEnabled = other->antialiasingEnabled;
     }
 
@@ -184,8 +213,18 @@
         applyBlending(painter);
         applyStrokeStyle();
 
-        applyTransformationMatrix(painter);
+        applyTransformation(painter);
         applyScissorRect();
+
+#ifdef OPENVG_VERSION_1_1
+        if (maskingEnabled()) {
+            vgSeti(VG_MASKING, VG_TRUE);
+            if (mask != VG_INVALID_HANDLE)
+                vgMask(mask, VG_SET_MASK, 0, 0, painter->surface()->width(), painter->surface()->height());
+        } else
+            vgSeti(VG_MASKING, VG_FALSE);
+#endif
+        ASSERT_VG_NO_ERROR();
     }
 
     void applyBlending(PainterOpenVG* painter)
@@ -267,12 +306,12 @@
         ASSERT_VG_NO_ERROR();
     }
 
-    void applyTransformationMatrix(PainterOpenVG* painter)
+    void applyTransformation(PainterOpenVG* painter)
     {
         // There are *five* separate transforms that can be applied to OpenVG as of 1.1
         // but it is not clear that we need to set them separately.  Instead we set them
         // all right here and let this be a call to essentially set the world transformation!
-        VGMatrix vgMatrix(surfaceTransformationMatrix);
+        VGMatrix vgMatrix(surfaceTransformation);
         const VGfloat* vgFloatArray = vgMatrix.toVGfloat();
 
         vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
@@ -337,18 +376,36 @@
     {
         return (compositeOperation == CompositeSourceOver && !fillColor.alpha());
     }
+
+    void saveMaskIfNecessary(PainterOpenVG* painter)
+    {
+#ifdef OPENVG_VERSION_1_1
+        if (maskingChangedAndEnabled) {
+            if (mask != VG_INVALID_HANDLE) {
+                vgDestroyMaskLayer(mask);
+                ASSERT_VG_NO_ERROR();
+            }
+            mask = vgCreateMaskLayer(painter->surface()->width(), painter->surface()->height());
+            ASSERT(mask != VG_INVALID_HANDLE);
+            vgCopyMask(mask, 0, 0, 0, 0, painter->surface()->width(), painter->surface()->height());
+            ASSERT_VG_NO_ERROR();
+        }
+#endif
+    }
 };
 
 
 PainterOpenVG::PainterOpenVG()
     : m_state(0)
     , m_surface(0)
+    , m_currentPath(0)
 {
 }
 
 PainterOpenVG::PainterOpenVG(SurfaceOpenVG* surface)
     : m_state(0)
     , m_surface(0)
+    , m_currentPath(0)
 {
     ASSERT(surface);
     begin(surface);
@@ -357,6 +414,7 @@
 PainterOpenVG::~PainterOpenVG()
 {
     end();
+    delete m_currentPath;
 }
 
 void PainterOpenVG::begin(SurfaceOpenVG* surface)
@@ -417,31 +475,53 @@
     m_surface->flush();
 }
 
-TransformationMatrix PainterOpenVG::transformationMatrix() const
+AffineTransform PainterOpenVG::transformation() const
 {
     ASSERT(m_state);
-    return m_state->surfaceTransformationMatrix;
+    return m_state->surfaceTransformation;
 }
 
-void PainterOpenVG::concatTransformationMatrix(const TransformationMatrix& matrix)
+void PainterOpenVG::concatTransformation(const AffineTransform& transformation)
 {
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    // We do the multiplication ourself using WebCore's TransformationMatrix rather than
-    // offloading this to VG via vgMultMatrix to keep things simple and so we can maintain
-    // state ourselves.
-    m_state->surfaceTransformationMatrix.multLeft(matrix);
-    m_state->applyTransformationMatrix(this);
+    // We do the multiplication ourself using WebCore's AffineTransform rather
+    // than offloading this to VG via vgMultMatrix() to keep things simple and
+    // so we can maintain state ourselves.
+    m_state->surfaceTransformation.multLeft(transformation);
+    m_state->applyTransformation(this);
 }
 
-void PainterOpenVG::setTransformationMatrix(const TransformationMatrix& matrix)
+void PainterOpenVG::setTransformation(const AffineTransform& transformation)
 {
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    m_state->surfaceTransformationMatrix = matrix;
-    m_state->applyTransformationMatrix(this);
+    m_state->surfaceTransformation = transformation;
+    m_state->applyTransformation(this);
+}
+
+void PainterOpenVG::transformPath(VGPath dst, VGPath src, const AffineTransform& transformation)
+{
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+
+    // Save the transform state
+    VGfloat currentMatrix[9];
+    vgGetMatrix(currentMatrix);
+    ASSERT_VG_NO_ERROR();
+
+    // Load the new transform
+    vgLoadMatrix(VGMatrix(transformation).toVGfloat());
+    ASSERT_VG_NO_ERROR();
+
+    // Apply the new transform
+    vgTransformPath(dst, src);
+    ASSERT_VG_NO_ERROR();
+
+    // Restore the transform state
+    vgLoadMatrix(currentMatrix);
+    ASSERT_VG_NO_ERROR();
 }
 
 CompositeOperator PainterOpenVG::compositeOperation() const
@@ -575,6 +655,18 @@
     setVGSolidColor(VG_FILL_PATH, color);
 }
 
+int PainterOpenVG::textDrawingMode() const
+{
+    ASSERT(m_state);
+    return m_state->textDrawingMode;
+}
+
+void PainterOpenVG::setTextDrawingMode(int mode)
+{
+    ASSERT(m_state);
+    m_state->textDrawingMode = mode;
+}
+
 bool PainterOpenVG::antialiasingEnabled() const
 {
     ASSERT(m_state);
@@ -599,9 +691,9 @@
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    TransformationMatrix matrix = m_state->surfaceTransformationMatrix;
-    matrix.scaleNonUniform(scaleFactors.width(), scaleFactors.height());
-    setTransformationMatrix(matrix);
+    AffineTransform transformation = m_state->surfaceTransformation;
+    transformation.scaleNonUniform(scaleFactors.width(), scaleFactors.height());
+    setTransformation(transformation);
 }
 
 void PainterOpenVG::rotate(float radians)
@@ -609,9 +701,9 @@
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    TransformationMatrix matrix = m_state->surfaceTransformationMatrix;
-    matrix.rotate(rad2deg(radians));
-    setTransformationMatrix(matrix);
+    AffineTransform transformation = m_state->surfaceTransformation;
+    transformation.rotate(rad2deg(radians));
+    setTransformation(transformation);
 }
 
 void PainterOpenVG::translate(float dx, float dy)
@@ -619,9 +711,50 @@
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    TransformationMatrix matrix = m_state->surfaceTransformationMatrix;
-    matrix.translate(dx, dy);
-    setTransformationMatrix(matrix);
+    AffineTransform transformation = m_state->surfaceTransformation;
+    transformation.translate(dx, dy);
+    setTransformation(transformation);
+}
+
+void PainterOpenVG::beginPath()
+{
+    delete m_currentPath;
+    m_currentPath = new Path();
+}
+
+void PainterOpenVG::addPath(const Path& path)
+{
+    m_currentPath->platformPath()->makeCompatibleContextCurrent();
+
+    vgAppendPath(m_currentPath->platformPath()->vgPath(), path.platformPath()->vgPath());
+    ASSERT_VG_NO_ERROR();
+}
+
+Path* PainterOpenVG::currentPath() const
+{
+    return m_currentPath;
+}
+
+void PainterOpenVG::drawPath(VGbitfield specifiedPaintModes, WindRule fillRule)
+{
+    ASSERT(m_state);
+
+    VGbitfield paintModes = 0;
+    if (!m_state->strokeDisabled())
+        paintModes |= VG_STROKE_PATH;
+    if (!m_state->fillDisabled())
+        paintModes |= VG_FILL_PATH;
+
+    paintModes &= specifiedPaintModes;
+
+    if (!paintModes)
+        return;
+
+    m_surface->makeCurrent();
+
+    vgSeti(VG_FILL_RULE, toVGFillRule(fillRule));
+    vgDrawPath(m_currentPath->platformPath()->vgPath(), paintModes);
+    ASSERT_VG_NO_ERROR();
 }
 
 void PainterOpenVG::intersectScissorRect(const FloatRect& rect)
@@ -649,7 +782,7 @@
     ASSERT(m_state);
     m_surface->makeCurrent();
 
-    if (m_state->surfaceTransformationMatrix.isIdentity()) {
+    if (m_state->surfaceTransformation.isIdentity()) {
         // No transformation required, skip all the complex stuff.
         intersectScissorRect(rect);
         return;
@@ -660,18 +793,51 @@
     // (potentially more expensive) path clipping. Note that scissoring is not
     // subject to transformations, so we need to do the transformation to
     // surface coordinates by ourselves.
-    FloatQuad effectiveScissorQuad =
-        m_state->surfaceTransformationMatrix.mapQuad(FloatQuad(rect));
+    FloatQuad effectiveScissorQuad = m_state->surfaceTransformation.mapQuad(FloatQuad(rect));
 
     if (effectiveScissorQuad.isRectilinear())
         intersectScissorRect(effectiveScissorQuad.boundingBox());
     else {
         // The transformed scissorRect cannot be represented as FloatRect
-        // anymore, so we need to perform masking instead. Not yet implemented.
-        notImplemented();
+        // anymore, so we need to perform masking instead.
+        Path scissorRectPath;
+        scissorRectPath.addRect(rect);
+        clipPath(scissorRectPath, PainterOpenVG::IntersectClip);
     }
 }
 
+void PainterOpenVG::clipPath(const Path& path, PainterOpenVG::ClipOperation maskOp, WindRule clipRule)
+{
+#ifdef OPENVG_VERSION_1_1
+    ASSERT(m_state);
+    m_surface->makeCurrent();
+
+    if (m_state->mask != VG_INVALID_HANDLE && !m_state->maskingChangedAndEnabled) {
+        // The parent's mask has been inherited - dispose the handle so that
+        // it won't be overwritten.
+        m_state->maskingChangedAndEnabled = true;
+        m_state->mask = VG_INVALID_HANDLE;
+    } else if (!m_state->maskingEnabled()) {
+        // None of the parent painter states had a mask enabled yet.
+        m_state->maskingChangedAndEnabled = true;
+        vgSeti(VG_MASKING, VG_TRUE);
+        // Make sure not to inherit previous mask state from previously written
+        // (but disabled) masks. For VG_FILL_MASK the first argument is ignored,
+        // we pass VG_INVALID_HANDLE which is what the OpenVG spec suggests.
+        vgMask(VG_INVALID_HANDLE, VG_FILL_MASK, 0, 0, m_surface->width(), m_surface->height());
+    }
+
+    // Intersect the path from the mask, or subtract it from there.
+    // (In either case we always decrease the visible area, never increase it,
+    // which means masking never has to modify scissor rectangles.)
+    vgSeti(VG_FILL_RULE, toVGFillRule(clipRule));
+    vgRenderToMask(path.platformPath()->vgPath(), VG_FILL_PATH, (VGMaskOperation) maskOp);
+    ASSERT_VG_NO_ERROR();
+#elseif
+    notImplemented();
+#endif
+}
+
 void PainterOpenVG::drawRect(const FloatRect& rect, VGbitfield specifiedPaintModes)
 {
     ASSERT(m_state);
@@ -919,6 +1085,58 @@
     ASSERT_VG_NO_ERROR();
 }
 
+#ifdef OPENVG_VERSION_1_1
+void PainterOpenVG::drawText(VGFont vgFont, Vector<VGuint>& characters, VGfloat* adjustmentsX, VGfloat* adjustmentsY, const FloatPoint& point)
+{
+    ASSERT(m_state);
+
+    VGbitfield paintModes = 0;
+
+    if (m_state->textDrawingMode & cTextClip)
+        return; // unsupported for every port except CG at the time of writing
+    if (m_state->textDrawingMode & cTextFill && !m_state->fillDisabled())
+        paintModes |= VG_FILL_PATH;
+    if (m_state->textDrawingMode & cTextStroke && !m_state->strokeDisabled())
+        paintModes |= VG_STROKE_PATH;
+
+    m_surface->makeCurrent();
+
+    FloatPoint effectivePoint = m_state->surfaceTransformation.mapPoint(point);
+    FloatPoint p = point;
+    AffineTransform* originalTransformation = 0;
+
+    // In case the font isn't drawn at a pixel-exact baseline and we can easily
+    // fix that (which is the case for non-rotated affine transforms), let's
+    // align the starting point to the pixel boundary in order to prevent
+    // font rendering issues such as glyphs that appear off by a pixel.
+    // This causes us to have inconsistent spacing between baselines in a
+    // larger paragraph, but that seems to be the least of all evils.
+    if ((fmod(effectivePoint.x() + 0.01, 1.0) > 0.02 || fmod(effectivePoint.y() + 0.01, 1.0) > 0.02)
+        && isNonRotatedAffineTransformation(m_state->surfaceTransformation))
+    {
+        originalTransformation = new AffineTransform(m_state->surfaceTransformation);
+        setTransformation(AffineTransform(
+            m_state->surfaceTransformation.a(), 0,
+            0, m_state->surfaceTransformation.d(),
+            roundf(effectivePoint.x()), roundf(effectivePoint.y())));
+        p = FloatPoint();
+    }
+
+    const VGfloat vgPoint[2] = { p.x(), p.y() };
+    vgSetfv(VG_GLYPH_ORIGIN, 2, vgPoint);
+    ASSERT_VG_NO_ERROR();
+
+    vgDrawGlyphs(vgFont, characters.size(), characters.data(),
+        adjustmentsX, adjustmentsY, paintModes, VG_TRUE /* allow autohinting */);
+    ASSERT_VG_NO_ERROR();
+
+    if (originalTransformation) {
+        setTransformation(*originalTransformation);
+        delete originalTransformation;
+    }
+}
+#endif
+
 void PainterOpenVG::save(PainterOpenVG::SaveMode saveMode)
 {
     ASSERT(m_state);
@@ -930,15 +1148,18 @@
     m_surface->makeCurrent(SurfaceOpenVG::DontSaveOrApplyPainterState);
 
     if (saveMode == PainterOpenVG::CreateNewState) {
+        m_state->saveMaskIfNecessary(this);
         PlatformPainterState* state = new PlatformPainterState(*m_state);
         m_stateStack.append(state);
         m_state = m_stateStack.last();
-    } else { // if (saveMode == PainterOpenVG::CreateNewStateWithPaintStateOnly) {
+    } else if (saveMode == PainterOpenVG::CreateNewStateWithPaintStateOnly) {
+        m_state->saveMaskIfNecessary(this);
         PlatformPainterState* state = new PlatformPainterState();
         state->copyPaintState(m_state);
         m_stateStack.append(state);
         m_state = m_stateStack.last();
-    }
+    } else // if (saveMode == PainterOpenVG::KeepCurrentState)
+        m_state->saveMaskIfNecessary(this);
 }
 
 void PainterOpenVG::restore()
diff --git a/WebCore/platform/graphics/openvg/PainterOpenVG.h b/WebCore/platform/graphics/openvg/PainterOpenVG.h
index 6936eee..30cdf31 100644
--- a/WebCore/platform/graphics/openvg/PainterOpenVG.h
+++ b/WebCore/platform/graphics/openvg/PainterOpenVG.h
@@ -26,17 +26,17 @@
 #include <openvg.h>
 
 #include <wtf/Noncopyable.h>
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
 
+class AffineTransform;
 class FloatPoint;
 class FloatRect;
 class IntRect;
 class IntSize;
+class Path;
 class SurfaceOpenVG;
-class TransformationMatrix;
 
 struct PlatformPainterState;
 
@@ -47,8 +47,13 @@
 
     enum SaveMode {
         CreateNewState,
+        KeepCurrentState,
         CreateNewStateWithPaintStateOnly // internal usage only, do not use outside PainterOpenVG
     };
+    enum ClipOperation {
+        IntersectClip = VG_INTERSECT_MASK,
+        SubtractClip = VG_SUBTRACT_MASK
+    };
 
     PainterOpenVG();
     PainterOpenVG(SurfaceOpenVG*);
@@ -57,9 +62,11 @@
     void begin(SurfaceOpenVG*);
     void end();
 
-    TransformationMatrix transformationMatrix() const;
-    void setTransformationMatrix(const TransformationMatrix&);
-    void concatTransformationMatrix(const TransformationMatrix&);
+    AffineTransform transformation() const;
+    void setTransformation(const AffineTransform&);
+    void concatTransformation(const AffineTransform&);
+
+    static void transformPath(VGPath dst, VGPath src, const AffineTransform&);
 
     CompositeOperator compositeOperation() const;
     void setCompositeOperation(CompositeOperator);
@@ -82,6 +89,9 @@
     Color fillColor() const;
     void setFillColor(const Color&);
 
+    int textDrawingMode() const;
+    void setTextDrawingMode(int mode);
+
     bool antialiasingEnabled() const;
     void setAntialiasingEnabled(bool);
 
@@ -91,12 +101,21 @@
     void drawArc(const IntRect& ellipseBounds, int startAngle, int angleSpan, VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH));
     void drawEllipse(const IntRect& bounds, VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH));
     void drawPolygon(size_t numPoints, const FloatPoint* points, VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH));
+#ifdef OPENVG_VERSION_1_1
+    void drawText(VGFont, Vector<VGuint>& characters, VGfloat* adjustmentsX, VGfloat* adjustmentsY, const FloatPoint&);
+#endif
 
     void scale(const FloatSize& scaleFactors);
     void rotate(float radians);
     void translate(float dx, float dy);
 
+    void beginPath();
+    void addPath(const Path&);
+    Path* currentPath() const;
+    void drawPath(VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH), WindRule fillRule = RULE_NONZERO);
+
     void intersectClipRect(const FloatRect&);
+    void clipPath(const Path&, PainterOpenVG::ClipOperation, WindRule clipRule = RULE_NONZERO);
 
     void save(PainterOpenVG::SaveMode saveMode = CreateNewState);
     void restore();
@@ -114,6 +133,7 @@
     Vector<PlatformPainterState*> m_stateStack;
     PlatformPainterState* m_state;
     SurfaceOpenVG* m_surface;
+    Path* m_currentPath;
 };
 
 }
diff --git a/WebCore/platform/graphics/openvg/PathOpenVG.cpp b/WebCore/platform/graphics/openvg/PathOpenVG.cpp
new file mode 100644
index 0000000..2c366ee
--- /dev/null
+++ b/WebCore/platform/graphics/openvg/PathOpenVG.cpp
@@ -0,0 +1,502 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 "Path.h"
+
+#include "AffineTransform.h"
+#include "FloatRect.h"
+#include "GraphicsContext.h"
+#include "NotImplemented.h"
+#include "PainterOpenVG.h"
+#include "PlatformPathOpenVG.h"
+#include "PlatformString.h"
+#include "StrokeStyleApplier.h"
+#include "VGUtils.h"
+
+#include <openvg.h>
+#include <wtf/MathExtras.h>
+
+#define WEBKIT_VG_PATH_CAPABILITIES VG_PATH_CAPABILITY_ALL
+
+#define FUZZY_COMPARE(number, reference, delta) \
+    (number >= (reference - delta) && number <= (reference + delta))
+
+namespace WebCore {
+
+PlatformPathOpenVG::PlatformPathOpenVG()
+    : SharedResourceOpenVG()
+{
+    createPath();
+}
+
+PlatformPathOpenVG::PlatformPathOpenVG(const PlatformPathOpenVG& other)
+    : SharedResourceOpenVG()
+    , m_currentPoint(other.m_currentPoint)
+    , m_subpathStartPoint(other.m_subpathStartPoint)
+{
+    createPath();
+    // makeCompatibleContextCurrent() is called by createPath(), so not necessary here.
+    vgAppendPath(m_vgPath, other.m_vgPath);
+    ASSERT_VG_NO_ERROR();
+}
+
+PlatformPathOpenVG& PlatformPathOpenVG::operator=(const PlatformPathOpenVG& other)
+{
+    if (&other != this) {
+        clear();
+        // makeCompatibleContextCurrent() is called by clear(), so not necessary here.
+        vgAppendPath(m_vgPath, other.m_vgPath);
+        ASSERT_VG_NO_ERROR();
+    }
+    return *this;
+}
+
+PlatformPathOpenVG::~PlatformPathOpenVG()
+{
+    makeCompatibleContextCurrent();
+
+    vgDestroyPath(m_vgPath);
+    ASSERT_VG_NO_ERROR();
+}
+
+void PlatformPathOpenVG::clear()
+{
+    makeCompatibleContextCurrent();
+
+    vgClearPath(m_vgPath, WEBKIT_VG_PATH_CAPABILITIES);
+    ASSERT_VG_NO_ERROR();
+
+    m_subpathStartPoint.setX(0);
+    m_subpathStartPoint.setY(0);
+    m_currentPoint = m_subpathStartPoint;
+}
+
+void PlatformPathOpenVG::createPath()
+{
+    makeSharedContextCurrent();
+
+    m_vgPath = vgCreatePath(
+        VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,
+        1.0 /* scale */, 0.0 /* bias */,
+        0 /* expected number of segments */,
+        0 /* expected number of total coordinates */,
+        WEBKIT_VG_PATH_CAPABILITIES);
+    ASSERT_VG_NO_ERROR();
+}
+
+
+Path::Path()
+{
+    m_path = new PlatformPathOpenVG();
+}
+
+Path::~Path()
+{
+    delete m_path;
+}
+
+Path::Path(const Path& other)
+{
+    m_path = new PlatformPathOpenVG(*(other.m_path));
+}
+
+Path& Path::operator=(const Path& other)
+{
+    *m_path = *(other.m_path);
+    return *this;
+}
+
+bool Path::contains(const FloatPoint& point, WindRule rule) const
+{
+    notImplemented();
+
+    // OpenVG has no path-contains function, so for now we approximate by
+    // using the bounding rect of the path.
+    return boundingRect().contains(point);
+}
+
+bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
+{
+    notImplemented();
+
+    // OpenVG has no path-contains function, so for now we approximate by
+    // using the stroke bounding rect of the path.
+    return (const_cast<Path*>(this))->strokeBoundingRect().contains(point);
+}
+
+void Path::translate(const FloatSize& size)
+{
+    AffineTransform transformation;
+    transformation.translate(size.width(), size.height());
+    transform(transformation);
+}
+
+FloatRect Path::boundingRect() const
+{
+    VGfloat minX;
+    VGfloat minY;
+    VGfloat width;
+    VGfloat height;
+
+    m_path->makeCompatibleContextCurrent();
+    vgPathBounds(m_path->vgPath(), &minX, &minY, &width, &height);
+    ASSERT_VG_NO_ERROR();
+
+    return FloatRect(FloatPoint(minX, minY), FloatSize(width, height));
+}
+
+FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
+{
+    notImplemented();
+
+    // vgPathBounds() ignores stroke parameters, and we don't currently have
+    // an approximation that takes stroke parameters into account.
+    return boundingRect();
+}
+
+void Path::moveTo(const FloatPoint& point)
+{
+    static const VGubyte pathSegments[] = { VG_MOVE_TO_ABS };
+    const VGfloat pathData[] = { point.x(), point.y() };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = m_path->m_subpathStartPoint = point;
+}
+
+void Path::addLineTo(const FloatPoint& point)
+{
+    static const VGubyte pathSegments[] = { VG_LINE_TO_ABS };
+    const VGfloat pathData[] = { point.x(), point.y() };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = point;
+}
+
+void Path::addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& endPoint)
+{
+    static const VGubyte pathSegments[] = { VG_QUAD_TO_ABS };
+    const VGfloat pathData[] = { controlPoint.x(), controlPoint.y(), endPoint.x(), endPoint.y() };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = endPoint;
+}
+
+void Path::addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& endPoint)
+{
+    static const VGubyte pathSegments[] = { VG_CUBIC_TO_ABS };
+    const VGfloat pathData[] = { controlPoint1.x(), controlPoint1.y(), controlPoint2.x(), controlPoint2.y(), endPoint.x(), endPoint.y() };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = endPoint;
+}
+
+void Path::addArcTo(const FloatPoint& point1, const FloatPoint& point2, float radius)
+{
+    // See http://philip.html5.org/tests/canvas/suite/tests/spec.html#arcto.
+
+    const FloatPoint& point0 = m_path->m_currentPoint;
+    if (!radius || point0 == point1 || point1 == point2) {
+        addLineTo(point1);
+        return;
+    }
+
+    FloatSize v01 = point0 - point1;
+    FloatSize v21 = point2 - point1;
+
+    // sin(A - B) = sin(A) * cos(B) - sin(B) * cos(A)
+    double cross = v01.width() * v21.height() - v01.height() * v21.width();
+
+    if (fabs(cross) < 1E-10) {
+        // on one line
+        addLineTo(point1);
+        return;
+    }
+
+    double d01 = hypot(v01.width(), v01.height());
+    double d21 = hypot(v21.width(), v21.height());
+    double angle = (piDouble - fabs(asin(cross / (d01 * d21)))) * 0.5;
+    double span = radius * tan(angle);
+    double rate = span / d01;
+    FloatPoint startPoint = FloatPoint(point1.x() + v01.width() * rate,
+                                       point1.y() + v01.height() * rate);
+    rate = span / d21;
+    FloatPoint endPoint = FloatPoint(point1.x() + v21.width() * rate,
+                                     point1.y() + v21.height() * rate);
+
+    // Fa: large arc flag, makes the difference between SCWARC_TO and LCWARC_TO
+    //     respectively SCCWARC_TO and LCCWARC_TO arcs. We always use small
+    //     arcs for arcTo(), as the arc is defined as the "shortest arc" of the
+    //     circle specified in HTML 5.
+
+    // Fs: sweep flag, specifying whether the arc is drawn in increasing (true)
+    //     or decreasing (0) direction.
+    const bool anticlockwise = cross < 0;
+
+    // Translate the large arc and sweep flags into an OpenVG segment command.
+    const VGubyte segmentCommand = anticlockwise ? VG_SCCWARC_TO_ABS : VG_SCWARC_TO_ABS;
+
+    const VGubyte pathSegments[] = {
+        VG_LINE_TO_ABS,
+        segmentCommand
+    };
+    const VGfloat pathData[] = {
+        startPoint.x(), startPoint.y(),
+        radius, radius, 0, endPoint.x(), endPoint.y()
+    };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 2, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = endPoint;
+}
+
+void Path::closeSubpath()
+{
+    static const VGubyte pathSegments[] = { VG_CLOSE_PATH };
+    // pathData must not be 0, but certain compilers also don't create
+    // zero-size arrays. So let's use a random aligned value (sizeof(VGfloat)),
+    // it won't be accessed anyways as VG_CLOSE_PATH doesn't take coordinates.
+    static const VGfloat* pathData = reinterpret_cast<VGfloat*>(sizeof(VGfloat));
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = m_path->m_subpathStartPoint;
+}
+
+void Path::addArc(const FloatPoint& center, float radius, float startAngle, float endAngle, bool anticlockwise)
+{
+    // The OpenVG spec says nothing about inf as radius or start/end angle.
+    // WebKit seems to pass those (e.g. https://bugs.webkit.org/show_bug.cgi?id=16449),
+    // so abort instead of risking undefined behavior.
+    if (!isfinite(radius) || !isfinite(startAngle) || !isfinite(endAngle))
+        return;
+
+    // For some reason, the HTML 5 spec defines the angle as going clockwise
+    // from the positive X axis instead of going standard anticlockwise.
+    // So let's make it a proper angle in order to keep sanity.
+    startAngle = fmod((2.0 * piDouble) - startAngle, 2.0 * piDouble);
+    endAngle = fmod((2.0 * piDouble) - endAngle, 2.0 * piDouble);
+
+    // Make it so that endAngle > startAngle. fmod() above takes care of
+    // keeping the difference below 360 degrees.
+    if (endAngle <= startAngle)
+        endAngle += 2.0 * piDouble;
+
+    const VGfloat angleDelta = anticlockwise
+        ? (endAngle - startAngle)
+        : (startAngle - endAngle + (2.0 * piDouble));
+
+    // OpenVG uses endpoint parameterization while this method receives its
+    // values in center parameterization. It lacks an ellipse rotation
+    // parameter so we use 0 for that, and also the radius is only a single
+    // value which makes for rh == rv. In order to convert from endpoint to
+    // center parameterization, we use the formulas from the OpenVG/SVG specs:
+
+    // (x,y) = (cos rot, -sin rot; sin rot, -cos rot) * (rh * cos angle, rv * sin angle) + (center.x, center.y)
+    // rot is 0, which simplifies this a bit:
+    // (x,y) = (1, 0; 0, -1) * (rh * cos angle, rv * sin angle) + (center.x, center.y)
+    //       = (1 * rh * cos angle + 0 * rv * sin angle, 0 * rh * cos angle + -1 * rv * sin angle) + (center.x, center.y)
+    //       = (rh * cos angle, -rv * sin angle) + (center.x, center.y)
+    // (Set angle = {startAngle, endAngle} to retrieve the respective endpoints.)
+
+    const VGfloat startX = radius * cos(startAngle) + center.x();
+    const VGfloat startY = -radius * sin(startAngle) + center.y();
+    const VGfloat endX = radius * cos(endAngle) + center.x();
+    const VGfloat endY = -radius * sin(endAngle) + center.y();
+
+    // Fa: large arc flag, makes the difference between SCWARC_TO and LCWARC_TO
+    //     respectively SCCWARC_TO and LCCWARC_TO arcs.
+    const bool largeArc = (angleDelta > piDouble);
+
+    // Fs: sweep flag, specifying whether the arc is drawn in increasing (true)
+    //     or decreasing (0) direction. No need to calculate this value, as it
+    //     we already get it passed as a parameter (Fs == !anticlockwise).
+
+    // Translate the large arc and sweep flags into an OpenVG segment command.
+    // As OpenVG thinks of everything upside down, we need to reverse the
+    // anticlockwise parameter in order to get the specified rotation.
+    const VGubyte segmentCommand = !anticlockwise
+        ? (largeArc ? VG_LCCWARC_TO_ABS : VG_SCCWARC_TO_ABS)
+        : (largeArc ? VG_LCWARC_TO_ABS : VG_SCWARC_TO_ABS);
+
+    // So now, we've got all the parameters in endpoint parameterization format
+    // as OpenVG requires it. Which means we can just pass it like this.
+    const VGubyte pathSegments[] = {
+        hasCurrentPoint() ? VG_LINE_TO_ABS : VG_MOVE_TO_ABS,
+        segmentCommand
+    };
+    const VGfloat pathData[] = {
+        startX, startY,
+        radius, radius, 0, endX, endY
+    };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 2, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint.setX(endX);
+    m_path->m_currentPoint.setY(endY);
+}
+
+void Path::addRect(const FloatRect& rect)
+{
+    static const VGubyte pathSegments[] = {
+        VG_MOVE_TO_ABS,
+        VG_HLINE_TO_REL,
+        VG_VLINE_TO_REL,
+        VG_HLINE_TO_REL,
+        VG_CLOSE_PATH
+    };
+    const VGfloat pathData[] = {
+        rect.x(), rect.y(),
+        rect.width(),
+        rect.height(),
+        -rect.width()
+    };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 5, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+
+    m_path->m_currentPoint = m_path->m_subpathStartPoint = rect.location();
+}
+
+void Path::addEllipse(const FloatRect& rect)
+{
+    static const VGubyte pathSegments[] = {
+        VG_MOVE_TO_ABS,
+        VG_SCCWARC_TO_REL,
+        VG_SCCWARC_TO_REL,
+        VG_CLOSE_PATH
+    };
+    const VGfloat pathData[] = {
+        rect.x() + rect.width() / 2.0, rect.y(),
+        rect.width() / 2.0, rect.height() / 2.0, 0, 0, rect.height(),
+        rect.width() / 2.0, rect.height() / 2.0, 0, 0, -rect.height()
+    };
+
+    m_path->makeCompatibleContextCurrent();
+    vgAppendPathData(m_path->vgPath(), 4, pathSegments, pathData);
+    ASSERT_VG_NO_ERROR();
+}
+
+void Path::clear()
+{
+    m_path->clear();
+}
+
+bool Path::isEmpty() const
+{
+    m_path->makeCompatibleContextCurrent();
+    return !vgGetParameteri(m_path->vgPath(), VG_PATH_NUM_SEGMENTS);
+}
+
+bool Path::hasCurrentPoint() const
+{
+    m_path->makeCompatibleContextCurrent();
+    return vgGetParameteri(m_path->vgPath(), VG_PATH_NUM_SEGMENTS) > 0;
+}
+
+String Path::debugString() const
+{
+    String debugString = "";
+
+    // OpenVG provides no means to retrieve path segment information.
+    // This is a bit unfortunate, we might need to store the segments in
+    // memory if we want to implement this function properly.
+    notImplemented();
+
+    return debugString;
+}
+
+void Path::apply(void* info, PathApplierFunction function) const
+{
+    // OpenVG provides no means to retrieve path segment information.
+    // This is *very* unfortunate, we might need to store the segments in
+    // memory if we want to implement this function properly.
+    // See http://www.khronos.org/message_boards/viewtopic.php?f=6&t=1887
+    notImplemented();
+}
+
+void Path::transform(const AffineTransform& transformation)
+{
+    PlatformPathOpenVG* dst = new PlatformPathOpenVG();
+    // dst->makeCompatibleContextCurrent() is called by the platform path
+    // constructor, therefore not necessary to call it again here.
+    PainterOpenVG::transformPath(dst->vgPath(), m_path->vgPath(), transformation);
+    delete m_path;
+    m_path = dst;
+
+    m_path->m_currentPoint = transform.mapPoint(m_path->m_currentPoint);
+    m_path->m_subpathStartPoint = transform.mapPoint(m_path->m_subpathStartPoint);
+}
+
+
+// Path::length(), Path::pointAtLength() and Path::normalAngleAtLength() are
+// reimplemented here instead of in Path.cpp, because OpenVG has its own
+// functions and Path::apply() doesn't really work as long as we rely on VGPath
+// as primary path storage.
+
+float Path::length()
+{
+    m_path->makeCompatibleContextCurrent();
+    VGfloat length = vgPathLength(m_path->vgPath(), 0, vgGetParameteri(m_path->vgPath(), VG_PATH_NUM_SEGMENTS));
+    ASSERT_VG_NO_ERROR();
+    return length;
+}
+
+FloatPoint Path::pointAtLength(float length, bool& ok)
+{
+    VGfloat x = 0, y = 0;
+    m_path->makeCompatibleContextCurrent();
+
+    vgPointAlongPath(m_path->vgPath(), 0, vgGetParameteri(m_path->vgPath(), VG_PATH_NUM_SEGMENTS),
+                     length, &x, &y, 0, 0);
+    ok = (vgGetError() == VG_NO_ERROR);
+    return FloatPoint(x, y);
+}
+
+float Path::normalAngleAtLength(float length, bool& ok)
+{
+    VGfloat tangentX, tangentY;
+    m_path->makeCompatibleContextCurrent();
+
+    vgPointAlongPath(m_path->vgPath(), 0, vgGetParameteri(m_path->vgPath(), VG_PATH_NUM_SEGMENTS),
+                     length, 0, 0, &tangentX, &tangentY);
+    ok = (vgGetError() == VG_NO_ERROR);
+    return atan2f(tangentY, tangentX) * 180.0 / piFloat; // convert to degrees
+}
+
+}
diff --git a/WebCore/platform/graphics/openvg/PlatformPathOpenVG.h b/WebCore/platform/graphics/openvg/PlatformPathOpenVG.h
new file mode 100644
index 0000000..286da53
--- /dev/null
+++ b/WebCore/platform/graphics/openvg/PlatformPathOpenVG.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 PlatformPathOpenVG_h
+#define PlatformPathOpenVG_h
+
+#include "FloatPoint.h"
+#include "SharedResourceOpenVG.h"
+
+#include <openvg.h>
+
+namespace WebCore {
+
+class PlatformPathOpenVG : public SharedResourceOpenVG {
+public:
+    PlatformPathOpenVG();
+    PlatformPathOpenVG(const PlatformPathOpenVG&);
+    ~PlatformPathOpenVG();
+
+    PlatformPathOpenVG& operator=(const PlatformPathOpenVG&);
+
+    VGPath vgPath() { return m_vgPath; }
+    void clear();
+
+public:
+    FloatPoint m_currentPoint;
+    FloatPoint m_subpathStartPoint;
+
+private:
+    void createPath();
+
+    VGPath m_vgPath;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/openvg/SharedResourceOpenVG.cpp b/WebCore/platform/graphics/openvg/SharedResourceOpenVG.cpp
new file mode 100644
index 0000000..a843db5
--- /dev/null
+++ b/WebCore/platform/graphics/openvg/SharedResourceOpenVG.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ *
+ * 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 "SharedResourceOpenVG.h"
+
+#include "SurfaceOpenVG.h"
+
+#if PLATFORM(EGL)
+#include "EGLDisplayOpenVG.h"
+#endif
+
+namespace WebCore {
+
+void SharedResourceOpenVG::makeSharedContextCurrent()
+{
+#if PLATFORM(EGL)
+    EGLDisplayOpenVG::current()->sharedPlatformSurface()->makeCurrent();
+#endif
+}
+
+void SharedResourceOpenVG::makeCompatibleContextCurrent()
+{
+#if PLATFORM(EGL)
+    EGLDisplayOpenVG::current()->sharedPlatformSurface()->makeCompatibleCurrent();
+#endif
+}
+
+}
diff --git a/WebCore/platform/graphics/openvg/SharedResourceOpenVG.h b/WebCore/platform/graphics/openvg/SharedResourceOpenVG.h
new file mode 100644
index 0000000..436ae90
--- /dev/null
+++ b/WebCore/platform/graphics/openvg/SharedResourceOpenVG.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ *
+ * 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 SharedResourceOpenVG_h
+#define SharedResourceOpenVG_h
+
+namespace WebCore {
+
+class SharedResourceOpenVG {
+public:
+    void makeSharedContextCurrent();
+    void makeCompatibleContextCurrent();
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp b/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
index 9539f2c..6700c6f 100644
--- a/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp
@@ -64,6 +64,25 @@
     EGLDisplayOpenVG::registerPlatformSurface(this);
 }
 
+SurfaceOpenVG::SurfaceOpenVG(EGLClientBuffer buffer, EGLenum bufferType, const EGLDisplay& display, EGLConfig* confPtr, EGLint* errorCode)
+    : m_activePainter(0)
+    , m_eglDisplay(display)
+    , m_eglSurface(EGL_NO_SURFACE)
+    , m_eglContext(EGL_NO_CONTEXT)
+{
+    ASSERT(m_eglDisplay != EGL_NO_DISPLAY);
+
+    EGLDisplayOpenVG* displayManager = EGLDisplayOpenVG::forDisplay(m_eglDisplay);
+    EGLConfig config = confPtr ? (*confPtr) : displayManager->defaultPbufferConfig();
+    m_eglSurface = displayManager->createPbufferFromClientBuffer(buffer, bufferType, config, errorCode);
+
+    if (m_eglSurface == EGL_NO_SURFACE)
+        return;
+
+    m_eglContext = displayManager->contextForSurface(m_eglSurface);
+    EGLDisplayOpenVG::registerPlatformSurface(this);
+}
+
 SurfaceOpenVG::SurfaceOpenVG(EGLNativeWindowType window, const EGLDisplay& display, EGLConfig* confPtr)
     : m_activePainter(0)
     , m_eglDisplay(display)
@@ -173,6 +192,11 @@
     ASSERT_EGL_NO_ERROR();
 
     if (currentSurface != m_eglSurface) {
+        // Save other context before switching over.
+        if (s_currentPainter && mode != DontSaveOrApplyPainterState
+            && s_currentPainter->surface()->m_eglSurface == currentSurface)
+            s_currentPainter->save(PainterOpenVG::KeepCurrentState);
+
         eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
         ASSERT_EGL_NO_ERROR();
         s_currentPainter = 0;
@@ -202,6 +226,10 @@
             s_currentPainter = m_activePainter;
         }
     } else if (!EGLDisplayOpenVG::forDisplay(m_eglDisplay)->surfacesCompatible(currentSurface, m_eglSurface)) {
+        // Save other context before switching over.
+        if (s_currentPainter && s_currentPainter->surface()->m_eglSurface == currentSurface)
+            s_currentPainter->save(PainterOpenVG::KeepCurrentState);
+
         eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
         ASSERT_EGL_NO_ERROR();
         s_currentPainter = 0;
diff --git a/WebCore/platform/graphics/openvg/SurfaceOpenVG.h b/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
index dc288dd..46d1646 100644
--- a/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
+++ b/WebCore/platform/graphics/openvg/SurfaceOpenVG.h
@@ -25,7 +25,6 @@
 #endif
 
 #include <wtf/Noncopyable.h>
-#include <wtf/Platform.h>
 
 namespace WebCore {
 
@@ -48,6 +47,7 @@
     enum MakeCurrentMode {
         ApplyPainterStateOnSurfaceSwitch,
         DontApplyPainterState,
+        DontSaveOrApplyPainterState
     };
 
     static SurfaceOpenVG* currentSurface();
@@ -68,6 +68,26 @@
     SurfaceOpenVG(const IntSize& size, const EGLDisplay& display, EGLConfig* config = 0, EGLint* errorCode = 0);
 
     /**
+     * Create a new EGL pbuffer surface that will be bound to the given
+     * client buffer (read: VGImage), with the specified config on the
+     * given display. If config is not specified, the display's default
+     * pbuffer config is used.
+     *
+     * After the surface is created, you will only be able to access the
+     * client buffer image if the surface is not current. The recommended way
+     * to ensure this is to call surface->sharedSurface()->makeCurrent() if you
+     * simply want to access the image's pixel contents, or if you intend to
+     * draw the image directly, making the draw target surface current.
+     *
+     * This constructor will trigger an assertion if creation of the surface
+     * fails, unless you pledge to manually process the error code by passing
+     * a non-zero pointer as errorCode parameter. The error code returned by
+     * eglGetError() will be written to that variable.
+     */
+    SurfaceOpenVG(EGLClientBuffer buffer, EGLenum bufferType,
+        const EGLDisplay& display, EGLConfig* config = 0, EGLint* errorCode = 0);
+
+    /**
      * Create a new EGL window surface with the specified native window handle
      * and config on the given display. If config is not specified, the
      * display's default window config is used.
diff --git a/WebCore/platform/graphics/openvg/VGUtils.cpp b/WebCore/platform/graphics/openvg/VGUtils.cpp
index 72ba5b2..ce9bcd2 100644
--- a/WebCore/platform/graphics/openvg/VGUtils.cpp
+++ b/WebCore/platform/graphics/openvg/VGUtils.cpp
@@ -20,6 +20,7 @@
 #include "config.h"
 #include "VGUtils.h"
 
+#include "AffineTransform.h"
 #include "FloatRect.h"
 #include "TransformationMatrix.h"
 
@@ -38,6 +39,19 @@
     m_data[8] = data[8];
 }
 
+VGMatrix::VGMatrix(const AffineTransform& transformation)
+{
+    m_data[0] = transformation.a();
+    m_data[1] = transformation.b();
+    m_data[2] = 0;
+    m_data[3] = transformation.c();
+    m_data[4] = transformation.d();
+    m_data[5] = 0;
+    m_data[6] = transformation.e();
+    m_data[7] = transformation.f();
+    m_data[8] = 1;
+}
+
 VGMatrix::VGMatrix(const TransformationMatrix& matrix)
 {
     m_data[0] = matrix.m11();
@@ -51,21 +65,30 @@
     m_data[8] = matrix.m44();
 }
 
+VGMatrix::operator AffineTransform() const
+{
+    AffineTransform transformation(
+        m_data[0], m_data[1],
+        m_data[3], m_data[4],
+        m_data[6], m_data[7]);
+    return transformation;
+}
+
 VGMatrix::operator TransformationMatrix() const
 {
-    TransformationMatrix matrix;
-    matrix.setM11(m_data[0]);
-    matrix.setM12(m_data[1]);
-    matrix.setM14(m_data[2]);
-    matrix.setM21(m_data[3]);
-    matrix.setM22(m_data[4]);
-    matrix.setM24(m_data[5]);
-    matrix.setM41(m_data[6]);
-    matrix.setM42(m_data[7]);
-    matrix.setM44(m_data[8]);
+    TransformationMatrix matrix(
+        m_data[0], m_data[1], 0, m_data[2],
+        m_data[3], m_data[4], 0, m_data[5],
+        0,         0,         1, 0,
+        m_data[6], m_data[7], 0, m_data[8]);
     return matrix;
 }
 
+AffineTransform::operator VGMatrix() const
+{
+    return VGMatrix(*this);
+}
+
 TransformationMatrix::operator VGMatrix() const
 {
     return VGMatrix(*this);
diff --git a/WebCore/platform/graphics/openvg/VGUtils.h b/WebCore/platform/graphics/openvg/VGUtils.h
index 083c15a..3a290cb 100644
--- a/WebCore/platform/graphics/openvg/VGUtils.h
+++ b/WebCore/platform/graphics/openvg/VGUtils.h
@@ -59,14 +59,17 @@
 
 namespace WebCore {
 
+class AffineTransform;
 class FloatRect;
 class TransformationMatrix;
 
 class VGMatrix {
 public:
     VGMatrix(const VGfloat data[9]);
+    VGMatrix(const AffineTransform&);
     VGMatrix(const TransformationMatrix&);
     const VGfloat* toVGfloat() const { return m_data; }
+    operator AffineTransform() const;
     operator TransformationMatrix() const;
 private:
     VGfloat m_data[9];
diff --git a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
index 0a1075f..0565deb 100644
--- a/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+++ b/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
@@ -58,6 +58,9 @@
     font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
     const bool smallCaps = description.smallCaps();
     font.setCapitalization(smallCaps ? QFont::SmallCaps : QFont::MixedCase);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+    font.setStyleStrategy(QFont::ForceIntegerMetrics);
+#endif
 
     m_data->bold = font.bold();
     m_data->size = font.pointSizeF();
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index 9ff7c1a..974c179 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -1,6 +1,6 @@
 /*
     Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2008 Holger Hans Peter Freyther
+    Copyright (C) 2008, 2010 Holger Hans Peter Freyther
     Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
 
     This library is free software; you can redistribute it and/or
@@ -134,7 +134,7 @@
             clip.adjust(dx1, dx2, dy1, dy2);
         }
         p->save();
-        p->setClipRect(clip.toRect());
+        p->setClipRect(clip.toRect(), Qt::IntersectClip);
         QPointF pt(point.x(), point.y() - ascent);
         if (hasShadow) {
             p->save();
@@ -169,17 +169,24 @@
         p->drawText(pt, string, flags, run.padding());
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
 {
     if (!run.length())
         return 0;
 
+    if (run.length() == 1 && treatAsSpace(run[0]))
+        return QFontMetrics(font()).width(run[0]) - m_wordSpacing + run.padding();
+
     String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
     QString string = fromRawDataWithoutRef(sanitized);
 
     QTextLayout layout(string, font());
     QTextLine line = setupLayout(&layout, run);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+    int w = int(line.horizontalAdvance());
+#else
     int w = int(line.naturalTextWidth());
+#endif
     // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
     if (treatAsSpace(run[0]))
         w -= m_wordSpacing;
@@ -216,8 +223,10 @@
 QFont Font::font() const
 {
     QFont f = primaryFont()->getQtFont();
-    f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
-    f.setWordSpacing(m_wordSpacing);
+    if (m_letterSpacing != 0)
+        f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
+    if (m_wordSpacing != 0)
+        f.setWordSpacing(m_wordSpacing);
     return f;
 }
 
diff --git a/WebCore/platform/graphics/qt/GradientQt.cpp b/WebCore/platform/graphics/qt/GradientQt.cpp
index 9b9acc2..8b9e2d7 100644
--- a/WebCore/platform/graphics/qt/GradientQt.cpp
+++ b/WebCore/platform/graphics/qt/GradientQt.cpp
@@ -51,6 +51,8 @@
     else
         m_gradient = new QLinearGradient(m_p0.x(), m_p0.y(), m_p1.x(), m_p1.y());
 
+    sortStopsIfNecessary();
+
     QColor stopColor;
     Vector<ColorStop>::iterator stopIterator = m_stops.begin();
     qreal lastStop(0.0);
@@ -64,9 +66,17 @@
         if (m_radial && m_r0)
             lastStop = m_r0 / m_r1 + lastStop * (1.0f - m_r0 / m_r1);
         m_gradient->setColorAt(lastStop, stopColor);
+        // Keep the lastStop as orginal value, since the following stopColor depend it
+        lastStop = stopIterator->stop;
         ++stopIterator;
     }
 
+    if (m_stops.isEmpty()) {
+        // The behavior of QGradient with no stops is defined differently from HTML5 spec,
+        // where the latter requires the gradient to be transparent black.
+        m_gradient->setColorAt(0.0, QColor(0, 0, 0, 0));
+    }
+
     switch (m_spreadMethod) {
     case SpreadMethodPad:
         m_gradient->setSpread(QGradient::PadSpread);
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
new file mode 100644
index 0000000..b0dd289
--- /dev/null
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -0,0 +1,1651 @@
+/*
+    Copyright (C) 2010 Tieto Corporation.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 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
+    Lesser General Public License for more details.
+     
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include "config.h"
+
+#include "GraphicsContext3D.h"
+
+#include "CanvasObject.h"
+#include "GraphicsContext.h"
+#include "HTMLCanvasElement.h"
+#include "HostWindow.h"
+#include "ImageBuffer.h"
+#include "NotImplemented.h"
+#include "QWebPageClient.h"
+#include "WebGLActiveInfo.h"
+#include "WebGLArray.h"
+#include "WebGLBuffer.h"
+#include "WebGLFloatArray.h"
+#include "WebGLFramebuffer.h"
+#include "WebGLIntArray.h"
+#include "WebGLProgram.h"
+#include "WebGLRenderbuffer.h"
+#include "WebGLRenderingContext.h"
+#include "WebGLShader.h"
+#include "WebGLTexture.h"
+#include "WebGLUnsignedByteArray.h"
+#include <QAbstractScrollArea>
+#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
+
+#if ENABLE(3D_CANVAS)
+
+namespace WebCore {
+
+#if !defined(GLchar)
+typedef char GLchar;
+#endif
+
+#if !defined(APIENTRY)
+#define APIENTRY
+#endif
+
+typedef ptrdiff_t GLsizeiptrType;
+typedef ptrdiff_t GLintptrType;
+
+typedef void (APIENTRY* glActiveTextureType) (GLenum);
+typedef void (APIENTRY* glAttachShaderType) (GLuint, GLuint);
+typedef void (APIENTRY* glBindAttribLocationType) (GLuint, GLuint, const char*);
+typedef void (APIENTRY* glBindBufferType) (GLenum, GLuint);
+typedef void (APIENTRY* glBindFramebufferType) (GLenum, GLuint);
+typedef void (APIENTRY* glBindRenderbufferType) (GLenum, GLuint);
+typedef void (APIENTRY* glBlendColorType) (GLclampf, GLclampf, GLclampf, GLclampf);
+typedef void (APIENTRY* glBlendEquationType) (GLenum);
+typedef void (APIENTRY* glBlendEquationSeparateType)(GLenum, GLenum);
+typedef void (APIENTRY* glBlendFuncSeparateType)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (APIENTRY* glBufferDataType) (GLenum, GLsizeiptrType, const GLvoid*, GLenum);
+typedef void (APIENTRY* glBufferSubDataType) (GLenum, GLintptrType, GLsizeiptrType, const GLvoid*);
+typedef GLenum (APIENTRY* glCheckFramebufferStatusType) (GLenum);
+typedef void (APIENTRY* glCompileShaderType) (GLuint);
+typedef GLuint (APIENTRY* glCreateProgramType) ();
+typedef GLuint (APIENTRY* glCreateShaderType) (GLenum);
+typedef void (APIENTRY* glDeleteBuffersType) (GLsizei, const GLuint*);
+typedef void (APIENTRY* glDeleteFramebuffersType) (GLsizei n, const GLuint*);
+typedef void (APIENTRY* glDeleteProgramType) (GLuint);
+typedef void (APIENTRY* glDeleteRenderbuffersType) (GLsizei n, const GLuint*);
+typedef void (APIENTRY* glDeleteShaderType) (GLuint);
+typedef void (APIENTRY* glDetachShaderType) (GLuint, GLuint);
+typedef void (APIENTRY* glDisableVertexAttribArrayType) (GLuint);
+typedef void (APIENTRY* glEnableVertexAttribArrayType) (GLuint);
+typedef void (APIENTRY* glFramebufferRenderbufferType) (GLenum, GLenum, GLenum, GLuint);
+typedef void (APIENTRY* glFramebufferTexture2DType) (GLenum, GLenum, GLenum, GLuint, GLint);
+typedef void (APIENTRY* glGenBuffersType) (GLsizei, GLuint*);
+typedef void (APIENTRY* glGenerateMipmapType) (GLenum target);
+typedef void (APIENTRY* glGenFramebuffersType) (GLsizei, GLuint*);
+typedef void (APIENTRY* glGenRenderbuffersType) (GLsizei, GLuint*);
+typedef void (APIENTRY* glGetActiveAttribType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
+typedef void (APIENTRY* glGetActiveUniformType) (GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
+typedef GLint (APIENTRY* glGetAttribLocationType) (GLuint, const char*);
+typedef void (APIENTRY* glGetBufferParameterivType) (GLenum, GLenum, GLint*);
+typedef void (APIENTRY* glGetFramebufferAttachmentParameterivType) (GLenum, GLenum, GLenum, GLint* params);
+typedef void (APIENTRY* glGetProgramInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
+typedef void (APIENTRY* glGetProgramivType) (GLuint, GLenum, GLint*);
+typedef void (APIENTRY* glGetRenderbufferParameterivType) (GLenum, GLenum, GLint*);
+typedef void (APIENTRY* glGetShaderInfoLogType) (GLuint, GLsizei, GLsizei*, char*);
+typedef void (APIENTRY* glGetShaderivType) (GLuint, GLenum, GLint*);
+typedef void (APIENTRY* glGetShaderSourceType) (GLuint, GLsizei, GLsizei*, char*);
+typedef GLint (APIENTRY* glGetUniformLocationType) (GLuint, const char*);
+typedef void (APIENTRY* glGetUniformfvType) (GLuint, GLint, GLfloat*);
+typedef void (APIENTRY* glGetUniformivType) (GLuint, GLint, GLint*);
+typedef void (APIENTRY* glGetVertexAttribfvType) (GLuint, GLenum, GLfloat*);
+typedef void (APIENTRY* glGetVertexAttribivType) (GLuint, GLenum, GLint*);
+typedef void (APIENTRY* glGetVertexAttribPointervType) (GLuint, GLenum, GLvoid**);
+typedef GLboolean (APIENTRY* glIsBufferType) (GLuint);
+typedef GLboolean (APIENTRY* glIsFramebufferType) (GLuint);
+typedef GLboolean (APIENTRY* glIsProgramType) (GLuint);
+typedef GLboolean (APIENTRY* glIsRenderbufferType) (GLuint);
+typedef GLboolean (APIENTRY* glIsShaderType) (GLuint);
+typedef void (APIENTRY* glLinkProgramType) (GLuint);
+typedef void (APIENTRY* glRenderbufferStorageType) (GLenum, GLenum, GLsizei, GLsizei);
+typedef void (APIENTRY* glSampleCoverageType) (GLclampf, GLboolean);
+typedef void (APIENTRY* glShaderSourceType) (GLuint, GLsizei, const char**, const GLint*);
+typedef void (APIENTRY* glStencilFuncSeparateType) (GLenum, GLenum, GLint, GLuint);
+typedef void (APIENTRY* glStencilMaskSeparateType) (GLenum, GLuint);
+typedef void (APIENTRY* glStencilOpSeparateType) (GLenum, GLenum, GLenum, GLenum);
+typedef void (APIENTRY* glUniform1fType) (GLint, GLfloat);
+typedef void (APIENTRY* glUniform1fvType) (GLint, GLsizei, const GLfloat*);
+typedef void (APIENTRY* glUniform1iType) (GLint, GLint);
+typedef void (APIENTRY* glUniform1ivType) (GLint, GLsizei, const GLint*);
+typedef void (APIENTRY* glUniform2fType) (GLint, GLfloat, GLfloat);
+typedef void (APIENTRY* glUniform2fvType) (GLint, GLsizei, const GLfloat*);
+typedef void (APIENTRY* glUniform2iType) (GLint, GLint, GLint);
+typedef void (APIENTRY* glUniform2ivType) (GLint, GLsizei, const GLint*);
+typedef void (APIENTRY* glUniform3fType) (GLint, GLfloat, GLfloat, GLfloat);
+typedef void (APIENTRY* glUniform3fvType) (GLint, GLsizei, const GLfloat*);
+typedef void (APIENTRY* glUniform3iType) (GLint, GLint, GLint, GLint);
+typedef void (APIENTRY* glUniform3ivType) (GLint, GLsizei, const GLint*);
+typedef void (APIENTRY* glUniform4fType) (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (APIENTRY* glUniform4fvType) (GLint, GLsizei, const GLfloat*);
+typedef void (APIENTRY* glUniform4iType) (GLint, GLint, GLint, GLint, GLint);
+typedef void (APIENTRY* glUniform4ivType) (GLint, GLsizei, const GLint*);
+typedef void (APIENTRY* glUniformMatrix2fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (APIENTRY* glUniformMatrix3fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (APIENTRY* glUniformMatrix4fvType) (GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (APIENTRY* glUseProgramType) (GLuint);
+typedef void (APIENTRY* glValidateProgramType) (GLuint);
+typedef void (APIENTRY* glVertexAttrib1fType) (GLuint, const GLfloat);
+typedef void (APIENTRY* glVertexAttrib1fvType) (GLuint, const GLfloat*);
+typedef void (APIENTRY* glVertexAttrib2fType) (GLuint, const GLfloat, const GLfloat);
+typedef void (APIENTRY* glVertexAttrib2fvType) (GLuint, const GLfloat*);
+typedef void (APIENTRY* glVertexAttrib3fType) (GLuint, const GLfloat, const GLfloat, const GLfloat);
+typedef void (APIENTRY* glVertexAttrib3fvType) (GLuint, const GLfloat*);
+typedef void (APIENTRY* glVertexAttrib4fType) (GLuint, const GLfloat, const GLfloat, const GLfloat, const GLfloat);
+typedef void (APIENTRY* glVertexAttrib4fvType) (GLuint, const GLfloat*);
+typedef void (APIENTRY* glVertexAttribPointerType) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
+
+class GraphicsContext3DInternal {
+public:
+    GraphicsContext3DInternal(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow);
+    ~GraphicsContext3DInternal();
+
+    bool isContextValid() { return m_contextValid; }
+
+
+
+    glActiveTextureType activeTexture;
+    glAttachShaderType attachShader;
+    glBindAttribLocationType bindAttribLocation;
+    glBindBufferType bindBuffer;
+    glBindFramebufferType bindFramebuffer;
+    glBindRenderbufferType bindRenderbuffer;
+    glBlendColorType blendColor;
+    glBlendEquationType blendEquation;
+    glBlendEquationSeparateType blendEquationSeparate;
+    glBlendFuncSeparateType blendFuncSeparate;
+    glBufferDataType bufferData;
+    glBufferSubDataType bufferSubData;
+    glCheckFramebufferStatusType checkFramebufferStatus;
+    glCompileShaderType compileShader;
+    glCreateProgramType createProgram;
+    glCreateShaderType createShader;
+    glDeleteBuffersType deleteBuffers;
+    glDeleteFramebuffersType deleteFramebuffers;
+    glDeleteProgramType deleteProgram;
+    glDeleteRenderbuffersType deleteRenderbuffers;
+    glDeleteShaderType deleteShader;
+    glDetachShaderType detachShader;
+    glDisableVertexAttribArrayType disableVertexAttribArray;
+    glEnableVertexAttribArrayType enableVertexAttribArray;
+    glFramebufferRenderbufferType framebufferRenderbuffer;
+    glFramebufferTexture2DType framebufferTexture2D;
+    glGenBuffersType genBuffers;
+    glGenerateMipmapType generateMipmap;
+    glGenFramebuffersType genFramebuffers;
+    glGenRenderbuffersType genRenderbuffers;
+    glGetActiveAttribType getActiveAttrib;
+    glGetActiveUniformType getActiveUniform;
+    glGetAttribLocationType getAttribLocation;
+    glGetBufferParameterivType getBufferParameteriv;
+    glGetFramebufferAttachmentParameterivType getFramebufferAttachmentParameteriv;
+    glGetProgramInfoLogType getProgramInfoLog;
+    glGetProgramivType getProgramiv;
+    glGetRenderbufferParameterivType getRenderbufferParameteriv;
+    glGetShaderInfoLogType getShaderInfoLog;
+    glGetShaderivType getShaderiv;
+    glGetShaderSourceType getShaderSource;
+    glGetUniformfvType getUniformfv;
+    glGetUniformivType getUniformiv;
+    glGetUniformLocationType getUniformLocation;
+    glGetVertexAttribfvType getVertexAttribfv;
+    glGetVertexAttribivType getVertexAttribiv;
+    glGetVertexAttribPointervType getVertexAttribPointerv;
+    glIsBufferType isBuffer;
+    glIsFramebufferType isFramebuffer;
+    glIsProgramType isProgram;
+    glIsRenderbufferType isRenderbuffer;
+    glIsShaderType isShader;
+    glLinkProgramType linkProgram;
+    glRenderbufferStorageType renderbufferStorage;
+    glSampleCoverageType sampleCoverage;
+    glShaderSourceType shaderSource;
+    glStencilFuncSeparateType stencilFuncSeparate;
+    glStencilMaskSeparateType stencilMaskSeparate;
+    glStencilOpSeparateType stencilOpSeparate;
+    glUniform1fType uniform1f;
+    glUniform1fvType uniform1fv;
+    glUniform1iType uniform1i;
+    glUniform1ivType uniform1iv;
+    glUniform2fType uniform2f;
+    glUniform2fvType uniform2fv;
+    glUniform2iType uniform2i;
+    glUniform2ivType uniform2iv;
+    glUniform3fType uniform3f;
+    glUniform3fvType uniform3fv;
+    glUniform3iType uniform3i;
+    glUniform3ivType uniform3iv;
+    glUniform4fType uniform4f;
+    glUniform4fvType uniform4fv;
+    glUniform4iType uniform4i;
+    glUniform4ivType uniform4iv;
+    glUniformMatrix2fvType uniformMatrix2fv;
+    glUniformMatrix3fvType uniformMatrix3fv;
+    glUniformMatrix4fvType uniformMatrix4fv;
+    glUseProgramType useProgram;
+    glValidateProgramType validateProgram;
+    glVertexAttrib1fType vertexAttrib1f;
+    glVertexAttrib1fvType vertexAttrib1fv;
+    glVertexAttrib2fType vertexAttrib2f;
+    glVertexAttrib2fvType vertexAttrib2fv;
+    glVertexAttrib3fType vertexAttrib3f;
+    glVertexAttrib3fvType vertexAttrib3fv;
+    glVertexAttrib4fType vertexAttrib4f;
+    glVertexAttrib4fvType vertexAttrib4fv;
+    glVertexAttribPointerType vertexAttribPointer;
+
+    GraphicsContext3D::Attributes m_attrs;
+    QGLWidget* m_glWidget;
+    GLuint m_texture;
+    GLuint m_mainFbo;
+    GLuint m_currentFbo;
+    GLuint m_depthBuffer;
+    QImage m_pixels;
+    ListHashSet<unsigned long> m_syntheticErrors;
+
+private:
+
+    QGLWidget* getOwnerGLWidget(QWebPageClient* webPageClient);
+    void* getProcAddress(const String& proc);
+    bool m_contextValid;
+};
+
+#if defined (QT_OPENGL_ES_2) 
+#define GET_PROC_ADDRESS(Proc) Proc
+#else
+#define GET_PROC_ADDRESS(Proc) reinterpret_cast<Proc##Type>(getProcAddress(#Proc));
+#endif
+ 
+GraphicsContext3DInternal::GraphicsContext3DInternal(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+    : m_attrs(attrs)
+    , m_glWidget(0)
+    , m_texture(0)
+    , m_mainFbo(0)
+    , m_currentFbo(0)
+    , m_depthBuffer(0)
+    , m_contextValid(true)
+{
+    QWebPageClient* webPageClient = hostWindow->platformPageClient();
+    QGLWidget* ownerGLWidget  = getOwnerGLWidget(webPageClient);
+
+    if (ownerGLWidget) 
+        m_glWidget = new QGLWidget(0, ownerGLWidget);
+    else {
+        QGLFormat format;
+        format.setDepth(true);
+        format.setSampleBuffers(true);
+        format.setStencil(false);
+
+        m_glWidget = new QGLWidget(format);
+    }
+
+    if (!m_glWidget->isValid()) {
+        LOG_ERROR("GraphicsContext3D: QGLWidget does not have a valid context");
+        m_contextValid = false;
+        return;
+    }
+ 
+    QGLFormat format = m_glWidget->format();
+
+    m_attrs.alpha = format.alpha();
+    m_attrs.depth = format.depth();
+    m_attrs.stencil = format.stencil();
+    m_attrs.antialias = false;
+    m_attrs.premultipliedAlpha = true;
+
+    m_glWidget->makeCurrent();
+
+    activeTexture = GET_PROC_ADDRESS(glActiveTexture);
+    attachShader = GET_PROC_ADDRESS(glAttachShader);
+    bindAttribLocation = GET_PROC_ADDRESS(glBindAttribLocation);
+    bindBuffer = GET_PROC_ADDRESS(glBindBuffer);
+    bindFramebuffer = GET_PROC_ADDRESS(glBindFramebuffer);
+    bindRenderbuffer = GET_PROC_ADDRESS(glBindRenderbuffer);
+    blendColor = GET_PROC_ADDRESS(glBlendColor);
+    blendEquation = GET_PROC_ADDRESS(glBlendEquation);
+    blendEquationSeparate = GET_PROC_ADDRESS(glBlendEquationSeparate);
+    blendFuncSeparate = GET_PROC_ADDRESS(glBlendFuncSeparate);
+    bufferData = GET_PROC_ADDRESS(glBufferData);
+    bufferSubData = GET_PROC_ADDRESS(glBufferSubData);
+    checkFramebufferStatus = GET_PROC_ADDRESS(glCheckFramebufferStatus);
+    compileShader = GET_PROC_ADDRESS(glCompileShader);
+    createProgram = GET_PROC_ADDRESS(glCreateProgram);
+    createShader = GET_PROC_ADDRESS(glCreateShader);
+    deleteBuffers = GET_PROC_ADDRESS(glDeleteBuffers);
+    deleteFramebuffers = GET_PROC_ADDRESS(glDeleteFramebuffers);
+    deleteProgram = GET_PROC_ADDRESS(glDeleteProgram);
+    deleteRenderbuffers = GET_PROC_ADDRESS(glDeleteRenderbuffers);
+    deleteShader = GET_PROC_ADDRESS(glDeleteShader);
+    detachShader = GET_PROC_ADDRESS(glDetachShader);
+    disableVertexAttribArray = GET_PROC_ADDRESS(glDisableVertexAttribArray);
+    enableVertexAttribArray = GET_PROC_ADDRESS(glEnableVertexAttribArray);
+    framebufferRenderbuffer = GET_PROC_ADDRESS(glFramebufferRenderbuffer);
+    framebufferTexture2D = GET_PROC_ADDRESS(glFramebufferTexture2D);
+    genBuffers = GET_PROC_ADDRESS(glGenBuffers);
+    generateMipmap = GET_PROC_ADDRESS(glGenerateMipmap);
+    genFramebuffers = GET_PROC_ADDRESS(glGenFramebuffers);
+    genRenderbuffers = GET_PROC_ADDRESS(glGenRenderbuffers);
+    getActiveAttrib = GET_PROC_ADDRESS(glGetActiveAttrib);
+    getActiveUniform = GET_PROC_ADDRESS(glGetActiveUniform);
+    getAttribLocation = GET_PROC_ADDRESS(glGetAttribLocation);
+    getBufferParameteriv = GET_PROC_ADDRESS(glGetBufferParameteriv);
+    getFramebufferAttachmentParameteriv = GET_PROC_ADDRESS(glGetFramebufferAttachmentParameteriv);
+    getProgramInfoLog = GET_PROC_ADDRESS(glGetProgramInfoLog);
+    getProgramiv = GET_PROC_ADDRESS(glGetProgramiv);
+    getRenderbufferParameteriv = GET_PROC_ADDRESS(glGetRenderbufferParameteriv);
+    getShaderInfoLog = GET_PROC_ADDRESS(glGetShaderInfoLog);
+    getShaderiv = GET_PROC_ADDRESS(glGetShaderiv);
+    getShaderSource = GET_PROC_ADDRESS(glGetShaderSource);
+    getUniformfv = GET_PROC_ADDRESS(glGetUniformfv);
+    getUniformiv = GET_PROC_ADDRESS(glGetUniformiv);
+    getUniformLocation = GET_PROC_ADDRESS(glGetUniformLocation);
+    getVertexAttribfv = GET_PROC_ADDRESS(glGetVertexAttribfv);
+    getVertexAttribiv = GET_PROC_ADDRESS(glGetVertexAttribiv);
+    getVertexAttribPointerv = GET_PROC_ADDRESS(glGetVertexAttribPointerv);
+    isBuffer = GET_PROC_ADDRESS(glIsBuffer);
+    isFramebuffer = GET_PROC_ADDRESS(glIsFramebuffer);
+    isProgram = GET_PROC_ADDRESS(glIsProgram);
+    isRenderbuffer = GET_PROC_ADDRESS(glIsRenderbuffer);
+    isShader = GET_PROC_ADDRESS(glIsShader);
+    linkProgram = GET_PROC_ADDRESS(glLinkProgram);
+    renderbufferStorage = GET_PROC_ADDRESS(glRenderbufferStorage);
+    sampleCoverage = GET_PROC_ADDRESS(glSampleCoverage);
+    shaderSource = GET_PROC_ADDRESS(glShaderSource);
+    stencilFuncSeparate = GET_PROC_ADDRESS(glStencilFuncSeparate);
+    stencilMaskSeparate = GET_PROC_ADDRESS(glStencilMaskSeparate);
+    stencilOpSeparate = GET_PROC_ADDRESS(glStencilOpSeparate);
+    uniform1f = GET_PROC_ADDRESS(glUniform1f);
+    uniform1fv = GET_PROC_ADDRESS(glUniform1fv);
+    uniform1i = GET_PROC_ADDRESS(glUniform1i);
+    uniform1iv = GET_PROC_ADDRESS(glUniform1iv);
+    uniform2f = GET_PROC_ADDRESS(glUniform2f);
+    uniform2fv = GET_PROC_ADDRESS(glUniform2fv);
+    uniform2i = GET_PROC_ADDRESS(glUniform2i);
+    uniform2iv = GET_PROC_ADDRESS(glUniform2iv);
+    uniform3f = GET_PROC_ADDRESS(glUniform3f);
+    uniform3fv = GET_PROC_ADDRESS(glUniform3fv);
+    uniform3i = GET_PROC_ADDRESS(glUniform3i);
+    uniform3iv = GET_PROC_ADDRESS(glUniform3iv);
+    uniform4f = GET_PROC_ADDRESS(glUniform4f);
+    uniform4fv = GET_PROC_ADDRESS(glUniform4fv);
+    uniform4i = GET_PROC_ADDRESS(glUniform4i);
+    uniform4iv = GET_PROC_ADDRESS(glUniform4iv);
+    uniformMatrix2fv = GET_PROC_ADDRESS(glUniformMatrix2fv);
+    uniformMatrix3fv = GET_PROC_ADDRESS(glUniformMatrix3fv);
+    uniformMatrix4fv = GET_PROC_ADDRESS(glUniformMatrix4fv);
+    useProgram = GET_PROC_ADDRESS(glUseProgram);
+    validateProgram = GET_PROC_ADDRESS(glValidateProgram);
+    vertexAttrib1f = GET_PROC_ADDRESS(glVertexAttrib1f);
+    vertexAttrib1fv = GET_PROC_ADDRESS(glVertexAttrib1fv);
+    vertexAttrib2f = GET_PROC_ADDRESS(glVertexAttrib2f);
+    vertexAttrib2fv = GET_PROC_ADDRESS(glVertexAttrib2fv);
+    vertexAttrib3f = GET_PROC_ADDRESS(glVertexAttrib3f);
+    vertexAttrib3fv = GET_PROC_ADDRESS(glVertexAttrib3fv);
+    vertexAttrib4f = GET_PROC_ADDRESS(glVertexAttrib4f);
+    vertexAttrib4fv = GET_PROC_ADDRESS(glVertexAttrib4fv);
+    vertexAttribPointer = GET_PROC_ADDRESS(glVertexAttribPointer);
+
+    if (!m_contextValid) {
+        LOG_ERROR("GraphicsContext3D: All needed OpenGL extensions are not available");
+        m_contextValid = false;
+        return;
+    }
+
+    glGenTextures(1, &m_texture);
+    glBindTexture(GraphicsContext3D::TEXTURE_2D, m_texture);
+    glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+    glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+    glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+    glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+    glTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, 1, 1, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0);
+    glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+
+    genFramebuffers(/* count */ 1, &m_mainFbo);
+    m_currentFbo = m_mainFbo;
+
+    bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_mainFbo);
+
+    genRenderbuffers(/* count */ 1, &m_depthBuffer);
+    bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+#if defined(QT_OPENGL_ES_2)
+    renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT16, /* width */ 1, /* height */ 1);
+#else
+    renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT, /* width */ 1, /* height */ 1);
+#endif
+
+    bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
+ 
+    framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_texture, 0);
+    framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+    glClearColor(/* red */ 0, /* green */ 0, /* blue */ 0, /* alpha */ 0);
+
+    if (checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+        LOG_ERROR("GraphicsContext3D: Wasn't able to create the main framebuffer");
+        m_contextValid = false;
+    }
+}
+
+GraphicsContext3DInternal::~GraphicsContext3DInternal()
+{
+    delete m_glWidget;
+    m_glWidget = 0;
+}
+
+QGLWidget* GraphicsContext3DInternal::getOwnerGLWidget(QWebPageClient* webPageClient)
+{
+    QAbstractScrollArea* scrollArea = qobject_cast<QAbstractScrollArea*>(webPageClient->ownerWidget());
+
+    if (scrollArea) 
+        return qobject_cast<QGLWidget*>(scrollArea->viewport());
+
+    return 0;
+}
+
+void* GraphicsContext3DInternal::getProcAddress(const String& proc)
+{
+    String ext[3] = { "", "ARB", "EXT" };
+
+    for (int i = 0; i < 3; i++) {
+        String nameWithExt = proc + ext[i];
+
+        void* addr = m_glWidget->context()->getProcAddress(nameWithExt.utf8().data());
+        if (addr) 
+            return addr;
+    }
+
+    LOG_ERROR("GraphicsContext3D: Did not find GL function %s", proc.utf8().data());
+    m_contextValid = false;
+    return 0;
+}
+
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+{
+    OwnPtr<GraphicsContext3D> context(new GraphicsContext3D(attrs, hostWindow));
+    return context->m_internal ? context.release() : 0;
+}
+
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+    : m_internal(new GraphicsContext3DInternal(attrs, hostWindow))
+{
+    if (!m_internal->isContextValid()) 
+        m_internal = 0;
+}
+
+GraphicsContext3D::~GraphicsContext3D()
+{
+}
+
+PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
+{
+    return m_internal->m_glWidget;
+}
+
+Platform3DObject GraphicsContext3D::platformTexture() const
+{
+    return m_internal->m_texture;
+}
+
+void GraphicsContext3D::makeContextCurrent()
+{
+    m_internal->m_glWidget->makeCurrent();
+}
+
+void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
+{
+    m_internal->m_glWidget->makeCurrent();
+
+    HTMLCanvasElement* canvas = context->canvas();
+    ImageBuffer* imageBuffer = canvas->buffer();
+
+    m_internal->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_internal->m_mainFbo);
+
+    glReadPixels(/* x */ 0, /* y */ 0, m_currentWidth, m_currentHeight, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, m_internal->m_pixels.bits());
+
+    QPainter* p = imageBuffer->context()->platformContext();
+    p->drawImage(/* x */ 0, /* y */ 0, m_internal->m_pixels.transformed(QMatrix().rotate(180)));
+
+    m_internal->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_internal->m_currentFbo);
+}
+
+void GraphicsContext3D::endPaint()
+{
+}
+
+void GraphicsContext3D::reshape(int width, int height)
+{
+    if (((width == m_currentWidth) && (height == m_currentHeight)) || (!m_internal))
+        return;
+    
+    m_currentWidth = width;
+    m_currentHeight = height;
+
+    m_internal->m_pixels = QImage(m_currentWidth, m_currentHeight, QImage::Format_ARGB32);
+
+    m_internal->m_glWidget->makeCurrent();
+
+    glBindTexture(GraphicsContext3D::TEXTURE_2D, m_internal->m_texture);
+    glTexImage2D(GraphicsContext3D::TEXTURE_2D, /* level */ 0, GraphicsContext3D::RGBA, width, height, /* border */ 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, /* data */ 0);
+    glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+   
+    m_internal->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_internal->m_mainFbo);
+    m_internal->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_internal->m_depthBuffer);
+#if defined(QT_OPENGL_ES_2)
+    renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT16, width, height);
+#else
+    renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT, width, height);
+#endif
+    m_internal->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
+    
+    m_internal->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_internal->m_texture, 0);
+    m_internal->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_internal->m_depthBuffer);
+
+    GLenum status = m_internal->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER);
+    if (status != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+        LOG_ERROR("GraphicsContext3D: Wasn't able to reshape the main framebuffer");
+        notImplemented();
+    }
+
+    glClear(GraphicsContext3D::COLOR_BUFFER_BIT);
+    glFlush();
+}
+
+void GraphicsContext3D::activeTexture(unsigned long texture)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->activeTexture(texture);
+}
+
+void GraphicsContext3D::attachShader(WebGLProgram* program, WebGLShader* shader)
+{
+    ASSERT(program);
+    ASSERT(shader);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->attachShader((GLuint) program->object(), (GLuint) shader->object());
+}
+
+void GraphicsContext3D::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name)
+{
+    ASSERT(program);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bindAttribLocation((GLuint) program->object(), index, name.utf8().data());
+}
+
+void GraphicsContext3D::bindBuffer(unsigned long target, WebGLBuffer* buffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bindBuffer(target, buffer ? (GLuint) buffer->object() : 0);
+}
+
+void GraphicsContext3D::bindFramebuffer(unsigned long target, WebGLFramebuffer* buffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->m_currentFbo = (buffer && buffer->object()) ? (GLuint) buffer->object() : m_internal->m_mainFbo;
+    m_internal->bindFramebuffer(target, m_internal->m_currentFbo);
+}
+
+void GraphicsContext3D::bindRenderbuffer(unsigned long target, WebGLRenderbuffer* renderbuffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bindRenderbuffer(target, renderbuffer ? (GLuint) renderbuffer->object() : 0);
+}
+
+void GraphicsContext3D::bindTexture(unsigned long target, WebGLTexture* texture)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glBindTexture(target, texture ? (GLuint) texture->object() : 0);
+}
+
+void GraphicsContext3D::blendColor(double red, double green, double blue, double alpha)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->blendColor(static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue), static_cast<float>(alpha));
+}
+
+void GraphicsContext3D::blendEquation(unsigned long mode)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->blendEquation(mode);
+}
+
+void GraphicsContext3D::blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->blendEquationSeparate(modeRGB, modeAlpha);
+}
+
+void GraphicsContext3D::blendFunc(unsigned long sfactor, unsigned long dfactor)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glBlendFunc(sfactor, dfactor);
+}       
+
+void GraphicsContext3D::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+}
+
+void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bufferData(target, size, /* data */ 0, usage);
+}
+
+void GraphicsContext3D::bufferData(unsigned long target, WebGLArray* array, unsigned long usage)
+{
+    if (!array || !array->length())
+        return;
+    
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bufferData(target, array->byteLength(), array->baseAddress(), usage);
+}
+
+void GraphicsContext3D::bufferSubData(unsigned long target, long offset, WebGLArray* array)
+{
+    if (!array || !array->length())
+        return;
+    
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->bufferSubData(target, offset, array->byteLength(), array->baseAddress());
+}
+
+unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
+{
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->checkFramebufferStatus(target);
+}
+
+void GraphicsContext3D::clearColor(double r, double g, double b, double a)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glClearColor(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a));
+}
+
+void GraphicsContext3D::clear(unsigned long mask)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glClear(mask);
+}
+
+void GraphicsContext3D::clearDepth(double depth)
+{
+    m_internal->m_glWidget->makeCurrent();
+#if defined(QT_OPENGL_ES_2)
+    glClearDepthf(depth);
+#else
+    glClearDepth(depth);
+#endif
+}
+
+void GraphicsContext3D::clearStencil(long s)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glClearStencil(s);
+}
+
+void GraphicsContext3D::colorMask(bool red, bool green, bool blue, bool alpha)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glColorMask(red, green, blue, alpha);
+}
+
+void GraphicsContext3D::compileShader(WebGLShader* shader)
+{
+    ASSERT(shader);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->compileShader((GLuint) shader->object());
+}
+
+void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+}
+
+void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+}
+
+void GraphicsContext3D::cullFace(unsigned long mode)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glCullFace(mode);
+}
+
+void GraphicsContext3D::depthFunc(unsigned long func)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDepthFunc(func);
+}
+
+void GraphicsContext3D::depthMask(bool flag)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDepthMask(flag);
+}
+
+void GraphicsContext3D::depthRange(double zNear, double zFar)
+{
+    m_internal->m_glWidget->makeCurrent();
+#if defined(QT_OPENGL_ES_2)
+    glDepthRangef(zNear, zFar);
+#else
+    glDepthRange(zNear, zFar);
+#endif
+}
+
+void GraphicsContext3D::detachShader(WebGLProgram* program, WebGLShader* shader)
+{
+    ASSERT(program);
+    ASSERT(shader);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->detachShader((GLuint) program->object(), (GLuint) shader->object());
+}
+
+void GraphicsContext3D::disable(unsigned long cap)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDisable(cap);
+}
+
+void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->disableVertexAttribArray(index);
+}
+
+void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDrawArrays(mode, first, count);
+}
+
+void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+void GraphicsContext3D::enable(unsigned long cap)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glEnable(cap);
+}
+
+void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->enableVertexAttribArray(index);
+}
+
+void GraphicsContext3D::finish()
+{
+    m_internal->m_glWidget->makeCurrent();
+    glFinish();
+}
+
+void GraphicsContext3D::flush()
+{
+    m_internal->m_glWidget->makeCurrent();
+    glFlush();
+}
+
+void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer* buffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer ? (GLuint) buffer->object() : 0);
+}
+
+void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture* texture, long level)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->framebufferTexture2D(target, attachment, textarget, texture ? (GLuint) texture->object() : 0, level);
+}
+
+void GraphicsContext3D::frontFace(unsigned long mode)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glFrontFace(mode);
+}
+
+void GraphicsContext3D::generateMipmap(unsigned long target)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->generateMipmap(target);
+}
+
+bool GraphicsContext3D::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
+{
+    if (!program->object()) {
+        synthesizeGLError(INVALID_VALUE);
+        return false;
+    }
+
+    m_internal->m_glWidget->makeCurrent();
+
+    GLint maxLength;
+    m_internal->getProgramiv(static_cast<GLuint>(program->object()), GraphicsContext3D::ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
+
+    GLchar* name = (GLchar*) fastMalloc(maxLength);
+    GLsizei nameLength;
+    GLint size;
+    GLenum type;
+
+    m_internal->getActiveAttrib(static_cast<GLuint>(program->object()), index, maxLength, &nameLength, &size, &type, name);
+
+    if (!nameLength) {
+        fastFree(name);
+        return false;
+    }
+
+    info.name = String(name, nameLength);
+    info.type = type;
+    info.size = size;
+
+    fastFree(name);
+    return true;
+}
+    
+bool GraphicsContext3D::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
+{
+    if (!program->object()) {
+        synthesizeGLError(INVALID_VALUE);
+        return false;
+    }
+
+    m_internal->m_glWidget->makeCurrent();
+
+    GLint maxLength;
+    m_internal->getProgramiv(static_cast<GLuint>(program->object()), GraphicsContext3D::ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
+
+    GLchar* name = (GLchar*) fastMalloc(maxLength);
+    GLsizei nameLength;
+    GLint size;
+    GLenum type;
+
+    m_internal->getActiveUniform(static_cast<GLuint>(program->object()), index, maxLength, &nameLength, &size, &type, name);
+
+    if (!nameLength) {
+        fastFree(name);
+        return false;
+    }
+
+    info.name = String(name, nameLength);
+    info.type = type;
+    info.size = size;
+
+    fastFree(name);
+    return true;
+}
+
+int GraphicsContext3D::getAttribLocation(WebGLProgram* program, const String& name)
+{
+    if (!program)
+        return -1;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->getAttribLocation((GLuint) program->object(), name.utf8().data());
+}
+
+GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
+{
+    return m_internal->m_attrs;
+}
+
+unsigned long GraphicsContext3D::getError()
+{
+    if (m_internal->m_syntheticErrors.size() > 0) {
+        ListHashSet<unsigned long>::iterator iter = m_internal->m_syntheticErrors.begin();
+        unsigned long err = *iter;
+        m_internal->m_syntheticErrors.remove(iter);
+        return err;
+    }
+
+    m_internal->m_glWidget->makeCurrent();
+    return glGetError();
+}
+
+String GraphicsContext3D::getString(unsigned long name)
+{
+    m_internal->m_glWidget->makeCurrent();
+    return String((const char*) glGetString(name));
+}
+
+void GraphicsContext3D::hint(unsigned long target, unsigned long mode)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glHint(target, mode);
+}
+
+bool GraphicsContext3D::isBuffer(WebGLBuffer* buffer)
+{
+    if (!buffer)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->isBuffer((GLuint) buffer->object());
+}
+
+bool GraphicsContext3D::isEnabled(unsigned long cap)
+{
+    m_internal->m_glWidget->makeCurrent();
+    return glIsEnabled(cap);
+}
+
+bool GraphicsContext3D::isFramebuffer(WebGLFramebuffer* framebuffer)
+{
+    if (!framebuffer)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->isFramebuffer((GLuint) framebuffer->object());
+}
+
+bool GraphicsContext3D::isProgram(WebGLProgram* program)
+{
+    if (!program)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->isProgram((GLuint) program->object());
+}
+
+bool GraphicsContext3D::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
+{
+    if (!renderbuffer)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->isRenderbuffer((GLuint) renderbuffer->object());
+}
+
+bool GraphicsContext3D::isShader(WebGLShader* shader)
+{
+    if (!shader)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->isShader((GLuint) shader->object());
+}
+
+bool GraphicsContext3D::isTexture(WebGLTexture* texture)
+{
+    if (!texture)
+        return false;
+    
+    m_internal->m_glWidget->makeCurrent();
+    return glIsTexture((GLuint) texture->object());
+}
+
+void GraphicsContext3D::lineWidth(double width)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glLineWidth(static_cast<float>(width));
+}
+
+void GraphicsContext3D::linkProgram(WebGLProgram* program)
+{
+    ASSERT(program);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->linkProgram((GLuint) program->object());
+}
+
+void GraphicsContext3D::pixelStorei(unsigned long paramName, long param)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glPixelStorei(paramName, param);
+}
+
+void GraphicsContext3D::polygonOffset(double factor, double units)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
+}
+
+void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
+{
+    m_internal->m_glWidget->makeCurrent();
+    
+    if (type != GraphicsContext3D::UNSIGNED_BYTE || format != GraphicsContext3D::RGBA)
+        return;
+        
+    glReadPixels(x, y, width, height, format, type, (GLvoid*) data);
+}
+
+void GraphicsContext3D::releaseShaderCompiler()
+{
+    m_internal->m_glWidget->makeCurrent();
+    notImplemented();
+}
+
+void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->renderbufferStorage(target, internalformat, width, height);
+}
+
+void GraphicsContext3D::sampleCoverage(double value, bool invert)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->sampleCoverage(static_cast<float>(value), invert);
+}
+
+void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned long height)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glScissor(x, y, width, height);
+}
+
+void GraphicsContext3D::shaderSource(WebGLShader* shader, const String& source)
+{
+    ASSERT(shader);
+    
+    m_internal->m_glWidget->makeCurrent();
+
+    CString sourceCS = source.utf8();
+    const char* data = sourceCS.data();
+    int length = source.length();
+    m_internal->shaderSource((GLuint) shader->object(), /* count */ 1, &data, &length);
+}
+
+void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glStencilFunc(func, ref, mask);
+}
+
+void GraphicsContext3D::stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->stencilFuncSeparate(face, func, ref, mask);
+}
+
+void GraphicsContext3D::stencilMask(unsigned long mask)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glStencilMask(mask);
+}
+
+void GraphicsContext3D::stencilMaskSeparate(unsigned long face, unsigned long mask)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->stencilMaskSeparate(face, mask);
+}
+
+void GraphicsContext3D::stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glStencilOp(fail, zfail, zpass);
+}
+
+void GraphicsContext3D::stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->stencilOpSeparate(face, fail, zfail, zpass);
+}
+
+void GraphicsContext3D::texParameterf(unsigned target, unsigned paramName, float value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glTexParameterf(target, paramName, static_cast<float>(value));
+}
+
+void GraphicsContext3D::texParameteri(unsigned target, unsigned paramName, int value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glTexParameteri(target, paramName, static_cast<float>(value));
+}
+
+void GraphicsContext3D::uniform1f(long location, float v0)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform1f(location, v0);
+}
+
+void GraphicsContext3D::uniform1fv(long location, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform1fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform2f(long location, float v0, float v1)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform2f(location, v0, v1);
+}
+
+void GraphicsContext3D::uniform2fv(long location, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform2fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform3f(long location, float v0, float v1, float v2)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform3f(location, v0, v1, v2);
+}
+
+void GraphicsContext3D::uniform3fv(long location, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform3fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform4f(long location, float v0, float v1, float v2, float v3)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform4f(location, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::uniform4fv(long location, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform4fv(location, size, array);
+}
+
+void GraphicsContext3D::uniform1i(long location, int v0)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform1i(location, v0);
+}
+
+void GraphicsContext3D::uniform1iv(long location, int* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform1iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform2i(long location, int v0, int v1)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform2i(location, v0, v1);
+}
+
+void GraphicsContext3D::uniform2iv(long location, int* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform2iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform3i(long location, int v0, int v1, int v2)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform3i(location, v0, v1, v2);
+}
+
+void GraphicsContext3D::uniform3iv(long location, int* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform3iv(location, size, array);
+}
+
+void GraphicsContext3D::uniform4i(long location, int v0, int v1, int v2, int v3)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform4i(location, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::uniform4iv(long location, int* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniform4iv(location, size, array);
+}
+
+void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniformMatrix2fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniformMatrix3fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* array, int size)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->uniformMatrix4fv(location, size, transpose, array);
+}
+
+void GraphicsContext3D::useProgram(WebGLProgram* program)
+{
+    ASSERT(program);
+    
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->useProgram((GLuint) program->object());
+}
+
+void GraphicsContext3D::validateProgram(WebGLProgram* program)
+{
+    ASSERT(program);
+    
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->validateProgram((GLuint) program->object());
+}
+
+void GraphicsContext3D::vertexAttrib1f(unsigned long indx, float v0)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib1f(indx, v0);
+}
+
+void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* array)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib1fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib2f(unsigned long indx, float v0, float v1)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib2f(indx, v0, v1);
+}
+
+void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* array)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib2fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib3f(unsigned long indx, float v0, float v1, float v2)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib3f(indx, v0, v1, v2);
+}
+
+void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* array)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib3fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttrib4f(unsigned long indx, float v0, float v1, float v2, float v3)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib4f(indx, v0, v1, v2, v3);
+}
+
+void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* array)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttrib4fv(indx, array);
+}
+
+void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, unsigned long stride, unsigned long offset)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->vertexAttribPointer(indx, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glViewport(static_cast<GLint>(x), static_cast<GLint>(y), static_cast<GLsizei>(width), static_cast<GLsizei>(height));
+}
+
+void GraphicsContext3D::getBooleanv(unsigned long paramName, unsigned char* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glGetBooleanv(paramName, value);
+}
+
+void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getBufferParameteriv(target, paramName, value);
+}
+
+void GraphicsContext3D::getFloatv(unsigned long paramName, float* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glGetFloatv(paramName, value);
+}
+
+void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getFramebufferAttachmentParameteriv(target, attachment, paramName, value);
+}
+
+void GraphicsContext3D::getIntegerv(unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glGetIntegerv(paramName, value);
+}
+
+void GraphicsContext3D::getProgramiv(WebGLProgram* program, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getProgramiv((GLuint) program->object(), paramName, value);
+}
+
+String GraphicsContext3D::getProgramInfoLog(WebGLProgram* program)
+{
+    m_internal->m_glWidget->makeCurrent();
+
+    GLint length;
+    m_internal->getProgramiv((GLuint) program->object(), GraphicsContext3D::INFO_LOG_LENGTH, &length);
+
+    GLsizei size;
+
+    GLchar* info = (GLchar*) fastMalloc(length);
+    if (!info)
+        return "";
+
+    m_internal->getProgramInfoLog((GLuint) program->object(), length, &size, info);
+
+    String result(info);
+    fastFree(info);
+
+    return result;
+}
+
+void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getRenderbufferParameteriv(target, paramName, value);
+}
+
+void GraphicsContext3D::getShaderiv(WebGLShader* shader, unsigned long paramName, int* value)
+{
+    ASSERT(shader);
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getShaderiv((GLuint) shader->object(), paramName, value);
+}
+
+String GraphicsContext3D::getShaderInfoLog(WebGLShader* shader)
+{
+    m_internal->m_glWidget->makeCurrent();
+
+    GLint length;
+    m_internal->getShaderiv((GLuint) shader->object(), GraphicsContext3D::INFO_LOG_LENGTH, &length);
+
+    GLsizei size;
+    GLchar* info = (GLchar*) fastMalloc(length);
+    if (!info)
+        return "";
+
+    m_internal->getShaderInfoLog((GLuint) shader->object(), length, &size, info);
+
+    String result(info);
+    fastFree(info);
+
+    return result;
+}
+
+String GraphicsContext3D::getShaderSource(WebGLShader* shader)
+{
+    m_internal->m_glWidget->makeCurrent();
+
+    GLint length;
+    m_internal->getShaderiv((GLuint) shader->object(), GraphicsContext3D::SHADER_SOURCE_LENGTH, &length);
+
+    GLsizei size;
+    GLchar* info = (GLchar*) fastMalloc(length);
+    if (!info)
+        return "";
+
+    m_internal->getShaderSource((GLuint) shader->object(), length, &size, info);
+
+    String result(info);
+    fastFree(info);
+
+    return result;
+}
+
+void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long paramName, float* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glGetTexParameterfv(target, paramName, value);
+}
+
+void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glGetTexParameteriv(target, paramName, value);
+}
+
+void GraphicsContext3D::getUniformfv(WebGLProgram* program, long location, float* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getUniformfv((GLuint) program->object(), location, value);
+}
+
+void GraphicsContext3D::getUniformiv(WebGLProgram* program, long location, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getUniformiv((GLuint) program->object(), location, value);
+}
+
+long GraphicsContext3D::getUniformLocation(WebGLProgram* program, const String& name)
+{
+    ASSERT(program);
+    
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->getUniformLocation((GLuint) program->object(), name.utf8().data());
+}
+
+void GraphicsContext3D::getVertexAttribfv(unsigned long index, unsigned long paramName, float* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getVertexAttribfv(index, paramName, value);
+}
+
+void GraphicsContext3D::getVertexAttribiv(unsigned long index, unsigned long paramName, int* value)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->getVertexAttribiv(index, paramName, value);
+}
+
+long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long paramName)
+{
+    m_internal->m_glWidget->makeCurrent();
+    
+    void* pointer;
+    m_internal->getVertexAttribPointerv(index, paramName, &pointer);
+    return reinterpret_cast<long>(pointer);
+}
+
+int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+{
+    glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    return 0;
+}
+
+int GraphicsContext3D::texImage2D(unsigned target, unsigned level, Image* image, bool flipY, bool premultiplyAlpha)
+{
+    ASSERT(image);
+    
+    m_internal->m_glWidget->makeCurrent();
+
+    Vector<uint8_t> imageData;
+    GLuint format;
+    GLuint internalFormat;
+
+    if (!extractImageData(image, flipY, premultiplyAlpha, imageData, &format, &internalFormat)) {
+        LOG_ERROR("GraphicsContext3D::texImage2D: could not extract Image data");
+        return -1;
+    }
+
+    glTexImage2D(target, level, internalFormat, image->width(), image->height(), 
+                 /* border */ 0, format, GraphicsContext3D::UNSIGNED_BYTE, imageData.data());
+
+    return 0;
+}
+    
+int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+{
+    glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
+    return 0;
+}
+
+int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, Image* image, bool flipY, bool premultiplyAlpha)
+{
+    ASSERT(image);
+
+    Vector<uint8_t> imageData;
+    GLuint format;
+    GLuint internalFormat;
+
+    if (!extractImageData(image, flipY, premultiplyAlpha, imageData, &format, &internalFormat)) {
+        LOG_ERROR("GraphicsContext3D::texSubImage2D: could not extract Image data");
+        return -1;
+    }
+
+    glTexSubImage2D(target, level, xoff, yoff, image->width(), image->height(), 
+                    format, GraphicsContext3D::UNSIGNED_BYTE, imageData.data());
+
+    return 0;
+}
+
+unsigned GraphicsContext3D::createBuffer()
+{
+    m_internal->m_glWidget->makeCurrent();
+    GLuint handle;
+    m_internal->genBuffers(/* count */ 1, &handle);
+    return handle;
+}
+
+unsigned GraphicsContext3D::createFramebuffer()
+{
+    m_internal->m_glWidget->makeCurrent();
+    GLuint handle;
+    m_internal->genFramebuffers(/* count */ 1, &handle);
+    return handle;
+}
+
+unsigned GraphicsContext3D::createProgram()
+{
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->createProgram();
+}
+
+unsigned GraphicsContext3D::createRenderbuffer()
+{
+    m_internal->m_glWidget->makeCurrent();
+    GLuint handle;
+    m_internal->genRenderbuffers(/* count */ 1, &handle);
+    return handle;
+}
+
+unsigned GraphicsContext3D::createShader(unsigned long type)
+{
+    m_internal->m_glWidget->makeCurrent();
+    return m_internal->createShader((type == FRAGMENT_SHADER) ? GraphicsContext3D::FRAGMENT_SHADER : GraphicsContext3D::VERTEX_SHADER);
+}
+
+unsigned GraphicsContext3D::createTexture()
+{
+    m_internal->m_glWidget->makeCurrent();
+    GLuint handle;
+    glGenTextures(1, &handle);
+    return handle;
+}
+
+void GraphicsContext3D::deleteBuffer(unsigned buffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->deleteBuffers(1, &buffer);
+}
+
+void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->deleteFramebuffers(1, &framebuffer);
+}
+
+void GraphicsContext3D::deleteProgram(unsigned program)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->deleteProgram(program);
+}
+
+void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->deleteRenderbuffers(1, &renderbuffer);
+}
+
+void GraphicsContext3D::deleteShader(unsigned shader)
+{
+    m_internal->m_glWidget->makeCurrent();
+    m_internal->deleteShader(shader);
+}
+
+void GraphicsContext3D::deleteTexture(unsigned texture)
+{
+    m_internal->m_glWidget->makeCurrent();
+    glDeleteTextures(1, &texture);
+}
+
+int GraphicsContext3D::sizeInBytes(int type)
+{
+    switch (type) {
+    case GraphicsContext3D::BYTE:
+        return sizeof(GLbyte);
+    case GraphicsContext3D::UNSIGNED_BYTE:
+        return sizeof(GLubyte);
+    case GraphicsContext3D::SHORT:
+        return sizeof(GLshort);
+    case GraphicsContext3D::UNSIGNED_SHORT:
+        return sizeof(GLushort);
+    case GraphicsContext3D::INT:
+        return sizeof(GLint);
+    case GraphicsContext3D::UNSIGNED_INT:
+        return sizeof(GLuint);
+    case GraphicsContext3D::FLOAT:
+        return sizeof(GLfloat);
+    default:
+        return 0;
+    }
+}
+
+void GraphicsContext3D::synthesizeGLError(unsigned long error)
+{
+    m_internal->m_syntheticErrors.add(error);
+}
+
+bool GraphicsContext3D::getImageData(Image* image,
+                                     Vector<uint8_t>& outputVector,
+                                     bool premultiplyAlpha,
+                                     bool* hasAlphaChannel,
+                                     AlphaOp* neededAlphaOp,
+                                     unsigned int* format)
+{
+    QImage::Format imageFormat = (!premultiplyAlpha) ? 
+        QImage::Format_ARGB32 :
+        QImage::Format_ARGB32_Premultiplied;
+ 
+    QPixmap* nativePixmap = image->nativeImageForCurrentFrame(); 
+
+    *hasAlphaChannel = true;
+    *neededAlphaOp = kAlphaDoNothing;
+    *format = GraphicsContext3D::RGBA;
+
+    QImage nativeImage = nativePixmap->toImage().convertToFormat(imageFormat);
+    outputVector.append(nativeImage.bits(), nativeImage.byteCount());
+
+    return true;
+}
+
+}
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 8bcda2e..edac268 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -312,14 +312,16 @@
     const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
     p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
 
-    IntSize shadowSize;
-    int shadowBlur;
-    Color shadowColor;
-    if (getShadow(shadowSize, shadowBlur, shadowColor)) {
-        IntRect shadowRect = rect;
-        shadowRect.move(shadowSize.width(), shadowSize.height());
-        shadowRect.inflate(static_cast<int>(p->pen().widthF()));
-        p->fillRect(shadowRect, QColor(shadowColor));
+    if (m_common->state.shadowColor.isValid()) {
+        IntSize shadowSize;
+        int shadowBlur;
+        Color shadowColor;
+        if (getShadow(shadowSize, shadowBlur, shadowColor)) {
+            IntRect shadowRect = rect;
+            shadowRect.move(shadowSize.width(), shadowSize.height());
+            shadowRect.inflate(static_cast<int>(p->pen().widthF()));
+            p->fillRect(shadowRect, QColor(shadowColor));
+        }
     }
 
     p->drawRect(rect);
@@ -410,7 +412,7 @@
                     patternOffset = patWidth / 2;
             } else {
                 if (remainder)
-                    patternOffset = (patWidth - remainder)/2;
+                    patternOffset = (patWidth - remainder) / 2;
             }
         }
 
@@ -614,10 +616,20 @@
     QPainter* p = m_data->p();
 
     if (m_common->state.fillPattern || m_common->state.fillGradient || fillColor().alpha()) {
-        drawBorderlessRectShadow(this, p, rect);
+        if (m_common->state.shadowColor.isValid())
+            drawBorderlessRectShadow(this, p, rect);
         if (m_common->state.fillPattern) {
             AffineTransform affine;
-            p->fillRect(rect, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
+            FloatRect rectM(rect);
+            QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine));
+            QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame();
+
+            if (!m_common->state.fillPattern->repeatX() && image)
+                rectM.setWidth(image->width());
+            if (!m_common->state.fillPattern->repeatY() && image)
+                rectM.setHeight(image->height());
+            p->fillRect(rectM, brush);
+
         } else if (m_common->state.fillGradient) {
             QBrush brush(*m_common->state.fillGradient->platformGradient());
             brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
@@ -636,7 +648,8 @@
 
     m_data->solidColor.setColor(c);
     QPainter* p = m_data->p();
-    drawBorderlessRectShadow(this, p, rect);
+    if (m_common->state.shadowColor.isValid())
+        drawBorderlessRectShadow(this, p, rect);
     p->fillRect(rect, m_data->solidColor);
 }
 
@@ -1006,11 +1019,11 @@
     if (paintingDisabled())
         return;
 
-    m_data->p()->rotate(180/M_PI*radians);
+    m_data->p()->rotate(180 / M_PI*radians);
 
     if (!m_data->currentPath.isEmpty()) {
         QTransform matrix;
-        m_data->currentPath = m_data->currentPath * matrix.rotate(-180/M_PI*radians);
+        m_data->currentPath = m_data->currentPath * matrix.rotate(-180 / M_PI*radians);
         m_common->state.pathTransform.rotate(radians);
     }
 }
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index 0fd0f1a..834cd4f 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -29,6 +29,7 @@
 #include "UnitBezier.h"
 #include <QtCore/qabstractanimation.h>
 #include <QtCore/qdebug.h>
+#include <QtCore/qmetaobject.h>
 #include <QtCore/qset.h>
 #include <QtCore/qtimer.h>
 #include <QtGui/qbitmap.h>
@@ -101,31 +102,37 @@
     // modified by the compositor, so we can know what to look for in the next flush
     enum ChangeMask {
         NoChanges =                 0,
+
+        ParentChange =              (1L << 0),
         ChildrenChange =            (1L << 1),
         MaskLayerChange =           (1L << 2),
         PositionChange =            (1L << 3),
+
         AnchorPointChange =         (1L << 4),
         SizeChange  =               (1L << 5),
         TransformChange =           (1L << 6),
         ContentChange =             (1L << 7),
+
         GeometryOrientationChange = (1L << 8),
         ContentsOrientationChange = (1L << 9),
         OpacityChange =             (1L << 10),
         ContentsRectChange =        (1L << 11),
+
         Preserves3DChange =         (1L << 12),
         MasksToBoundsChange =       (1L << 13),
         DrawsContentChange =        (1L << 14),
         ContentsOpaqueChange =      (1L << 15),
+
         BackfaceVisibilityChange =  (1L << 16),
         ChildrenTransformChange =   (1L << 17),
         DisplayChange =             (1L << 18),
         BackgroundColorChange =     (1L << 19),
-        ParentChange =              (1L << 20),
-        DistributesOpacityChange =  (1L << 21)
+
+        DistributesOpacityChange =  (1L << 20)
     };
 
     // the compositor lets us special-case images and colors, so we try to do so
-    enum StaticContentType { HTMLContentType, PixmapContentType, ColorContentType};
+    enum StaticContentType { HTMLContentType, PixmapContentType, ColorContentType, MediaContentType};
 
     GraphicsLayerQtImpl(GraphicsLayerQt* newLayer);
     virtual ~GraphicsLayerQtImpl();
@@ -149,10 +156,6 @@
     // or ChromeClientQt::scheduleCompositingLayerSync (meaning the sync will happen ASAP)
     void flushChanges(bool recursive = true, bool forceTransformUpdate = false);
 
-    // optimization: when we have an animation running on an element with no contents, that has child-elements with contents,
-    // ALL of them have to have ItemCoordinateCache and not DeviceCoordinateCache
-    void adjustCachingRecursively(bool animationIsRunning);
-
     // optimization: returns true if this or an ancestor has a transform animation running.
     // this enables us to use ItemCoordinatesCache while the animation is running, otherwise we have to recache for every frame
     bool isTransformAnimationRunning() const;
@@ -161,6 +164,9 @@
     // we need to notify the client (aka the layer compositor) when the animation actually starts
     void notifyAnimationStarted();
 
+    // we notify WebCore of a layer changed asynchronously; otherwise we end up calling flushChanges too often.
+    void notifySyncRequired();
+
 signals:
     // optimization: we don't want to use QTimer::singleShot
     void notifyAnimationStartedAsync();
@@ -179,6 +185,7 @@
         bool updateAll;
         QColor contentsBackgroundColor;
         QColor backgroundColor;
+        QWeakPointer<QGraphicsObject> mediaLayer;
         StaticContentType contentType;
         float opacity;
         ContentData()
@@ -196,7 +203,9 @@
     int m_changeMask;
 
     QSizeF m_size;
+#ifndef QT_NO_ANIMATION
     QList<QWeakPointer<QAbstractAnimation> > m_animations;
+#endif
     QTimer m_suspendTimer;
 
     struct State {
@@ -227,7 +236,9 @@
         }
     } m_state;
 
+#ifndef QT_NO_ANIMATION
     friend class AnimationQtBase;
+#endif
 };
 
 GraphicsLayerQtImpl::GraphicsLayerQtImpl(GraphicsLayerQt* newLayer)
@@ -245,7 +256,7 @@
     setEnabled(true);
 
     // we'll set the cache when we know what's going on
-    setCacheMode(NoCache);
+    setCacheMode(ItemCoordinateCache);
 
     connect(this, SIGNAL(notifyAnimationStartedAsync()), this, SLOT(notifyAnimationStarted()), Qt::QueuedConnection);
 }
@@ -263,26 +274,13 @@
             item->setParentItem(0);
         }
     }
-    
+
+#ifndef QT_NO_ANIMATION
     // we do, however, own the animations...
     for (QList<QWeakPointer<QAbstractAnimation> >::iterator it = m_animations.begin(); it != m_animations.end(); ++it)
         if (QAbstractAnimation* anim = it->data())
             delete anim;
-}
-
-void GraphicsLayerQtImpl::adjustCachingRecursively(bool animationIsRunning)
-{
-    // optimization: we make sure all our children have ItemCoordinateCache -
-    // otherwise we end up re-rendering them during the animation
-    const QList<QGraphicsItem*> children = childItems();
-
-    for (QList<QGraphicsItem*>::const_iterator it = children.begin(); it != children.end(); ++it) {
-        if (QGraphicsItem* item = *it)
-            if (GraphicsLayerQtImpl* layer = qobject_cast<GraphicsLayerQtImpl*>(item->toGraphicsObject())) {
-                if (layer->m_layer->drawsContent() && layer->m_currentContent.contentType == HTMLContentType)
-                    layer->setCacheMode(animationIsRunning ? QGraphicsItem::ItemCoordinateCache : QGraphicsItem::DeviceCoordinateCache);
-            }
-    }    
+#endif
 }
 
 void GraphicsLayerQtImpl::updateTransform()
@@ -307,29 +305,26 @@
     // this has to do with how WebCore implements -webkit-perspective and -webkit-perspective-origin, which are the CSS
     // attribute that call setChildrenTransform
     QPointF offset = -pos() - boundingRect().bottomRight() / 2;
-    const GraphicsLayerQtImpl* ancestor = this;
-    while ((ancestor = qobject_cast<GraphicsLayerQtImpl*>(ancestor->parentObject()))) {
+
+    for (const GraphicsLayerQtImpl* ancestor = this; (ancestor = qobject_cast<GraphicsLayerQtImpl*>(ancestor->parentObject())); ) {
         if (!ancestor->m_state.childrenTransform.isIdentity()) {
-            offset += ancestor->boundingRect().bottomRight() / 2;
+            const QPointF offset = mapFromItem(ancestor, QPointF(ancestor->m_size.width() / 2, ancestor->m_size.height() / 2));
             computedTransform
                 .translate(offset.x(), offset.y())
                 .multLeft(ancestor->m_state.childrenTransform)
                 .translate(-offset.x(), -offset.y());
             break;
         }
-        offset -= ancestor->pos();
     }
 
-    computedTransform.multLeft(baseTransform);
-
     // webkit has relative-to-size originPoint, graphics-view has a pixel originPoint, here we convert
     // we have to manage this ourselves because QGraphicsView's transformOrigin is incompatible
     const qreal originX = m_state.anchorPoint.x() * m_size.width();
     const qreal originY = m_state.anchorPoint.y() * m_size.height();
-    computedTransform = TransformationMatrix()
-                            .translate(originX, originY)
-                            .multiply(computedTransform)
-                            .translate(-originX, -originY);
+    computedTransform
+            .translate3d(originX, originY, m_state.anchorPoint.z())
+            .multLeft(baseTransform)
+            .translate3d(-originX, -originY, -m_state.anchorPoint.z());
 
     // now we project to 2D
     return QTransform(computedTransform);
@@ -353,6 +348,7 @@
     else {
         if (m_state.contentsOpaque
             || (m_currentContent.contentType == ColorContentType && m_currentContent.contentsBackgroundColor.alpha() == 0xff)
+            || (m_currentContent.contentType == MediaContentType)
             || (m_currentContent.contentType == PixmapContentType && !m_currentContent.pixmap.hasAlpha())) {
 
             painterPath.addRect(m_state.contentsRect);
@@ -369,14 +365,14 @@
 void GraphicsLayerQtImpl::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     if (m_currentContent.backgroundColor.isValid())
-        painter->fillRect(option->exposedRect, QColor(m_currentContent.backgroundColor));
+        painter->fillRect(option->rect, QColor(m_currentContent.backgroundColor));
 
     switch (m_currentContent.contentType) {
     case HTMLContentType:
         if (m_state.drawsContent) {
             // this is the expensive bit. we try to minimize calls to this area by proper caching
             GraphicsContext gc(painter);
-            m_layer->paintGraphicsLayerContents(gc, option->exposedRect.toAlignedRect());
+            m_layer->paintGraphicsLayerContents(gc, option->rect);
         }
         break;
     case PixmapContentType:
@@ -385,17 +381,23 @@
     case ColorContentType:
         painter->fillRect(m_state.contentsRect, m_currentContent.contentsBackgroundColor);
         break;
+    case MediaContentType:
+        // we don't need to paint anything: we have a QGraphicsItem from the media element
+        break;
     }
 }
 
+void GraphicsLayerQtImpl::notifySyncRequired()
+{
+    if (m_layer->client())
+        m_layer->client()->notifySyncRequired(m_layer);
+}
+
 void GraphicsLayerQtImpl::notifyChange(ChangeMask changeMask)
 {
-    Q_ASSERT(this);
-
     m_changeMask |= changeMask;
-
-    if (m_layer->client())
-        m_layer->client()->notifySyncRequired(m_layer);
+    static QMetaMethod syncMethod = staticMetaObject.method(staticMetaObject.indexOfMethod("notifySyncRequired()"));
+    syncMethod.invoke(this, Qt::QueuedConnection);
 }
 
 void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform)
@@ -433,7 +435,7 @@
                 w->setParentItem(this);
 
         for (QSet<QGraphicsItem*>::const_iterator it = childrenToRemove.begin(); it != childrenToRemove.end(); ++it)
-             if (QGraphicsItem* w = *it)
+             if (GraphicsLayerQtImpl* w = qobject_cast<GraphicsLayerQtImpl*>((*it)->toGraphicsObject()))
                 w->setParentItem(0);
 
         // children are ordered by z-value, let graphics-view know.
@@ -450,7 +452,6 @@
         if (m_layer->maskLayer()) {
             if (GraphicsLayerQtImpl* mask = qobject_cast<GraphicsLayerQtImpl*>(m_layer->maskLayer()->platformLayer()->toGraphicsObject())) {
                 mask->m_maskEffect = new MaskEffectQt(this, mask);
-                mask->setCacheMode(NoCache);
                 setGraphicsEffect(mask->m_maskEffect.data());
             }
         }
@@ -465,11 +466,11 @@
             m_size = QSizeF(m_layer->size().width(), m_layer->size().height());
         }
     }
-
     // FIXME: this is a hack, due to a probable QGraphicsScene bug when rapidly modifying the perspective
     // but without this line we get graphic artifacts
     if ((m_changeMask & ChildrenTransformChange) && m_state.childrenTransform != m_layer->childrenTransform())
-        scene()->update();
+        if (scene())
+            scene()->update();
 
     if (m_changeMask & (ChildrenTransformChange | Preserves3DChange | TransformChange | AnchorPointChange | SizeChange)) {
         // due to the differences between the way WebCore handles transforms and the way Qt handles transforms,
@@ -483,11 +484,19 @@
             update();
             setFlag(ItemHasNoContents, false);
 
+            // no point in caching a directly composited pixmap into another pixmap
+            setCacheMode(NoCache);
+
+            break;
+        case MediaContentType:
+            setFlag(ItemHasNoContents, true);
+            setCacheMode(NoCache);
+            m_pendingContent.mediaLayer.data()->setParentItem(this);
             break;
 
         case ColorContentType:
             // no point in caching a solid-color rectangle
-            setCacheMode(m_layer->maskLayer() ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
+            setCacheMode(NoCache);
             if (m_pendingContent.contentType != m_currentContent.contentType || m_pendingContent.contentsBackgroundColor != m_currentContent.contentsBackgroundColor)
                 update();
             m_state.drawsContent = false;
@@ -500,19 +509,11 @@
         case HTMLContentType:
             if (m_pendingContent.contentType != m_currentContent.contentType)
                 update();
-            if (!m_state.drawsContent && m_layer->drawsContent())
+            if (!m_state.drawsContent && m_layer->drawsContent()) {
                 update();
-                if (m_layer->drawsContent() && !m_maskEffect) {
-                    const QGraphicsItem::CacheMode mewCacheMode = isTransformAnimationRunning() ? ItemCoordinateCache : DeviceCoordinateCache;
-
-                    // optimization: QGraphicsItem doesn't always perform this test
-                    if (mewCacheMode != cacheMode())
-                        setCacheMode(mewCacheMode);
-
-                    // HTML content: we want to use exposedRect so we don't use WebCore rendering if we don't have to
-                    setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
-                }
-            else
+                if (m_layer->drawsContent() && !m_maskEffect)
+                    setCacheMode(ItemCoordinateCache);
+            } else if (!m_layer->drawsContent())
                 setCacheMode(NoCache);
 
             setFlag(ItemHasNoContents, !m_layer->drawsContent());
@@ -520,7 +521,7 @@
         }
     }
 
-    if ((m_changeMask & OpacityChange) && m_state.opacity != m_layer->opacity())
+    if ((m_changeMask & OpacityChange) && m_state.opacity != m_layer->opacity() && !m_opacityAnimationRunning)
         setOpacity(m_layer->opacity());
 
     if (m_changeMask & ContentsRectChange) {
@@ -569,6 +570,7 @@
     m_state.childrenTransform = m_layer->childrenTransform();
     m_currentContent.pixmap = m_pendingContent.pixmap;
     m_currentContent.contentType = m_pendingContent.contentType;
+    m_currentContent.mediaLayer = m_pendingContent.mediaLayer;
     m_currentContent.backgroundColor = m_pendingContent.backgroundColor;
     m_currentContent.regionToUpdate |= m_pendingContent.regionToUpdate;
     m_currentContent.contentsBackgroundColor = m_pendingContent.contentsBackgroundColor;
@@ -707,116 +709,140 @@
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setMaskLayer(GraphicsLayer* layer)
+void GraphicsLayerQt::setMaskLayer(GraphicsLayer* value)
 {
-    GraphicsLayer::setMaskLayer(layer);
+    if (value == maskLayer())
+        return;
+    GraphicsLayer::setMaskLayer(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::MaskLayerChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setPosition(const FloatPoint& p)
+void GraphicsLayerQt::setPosition(const FloatPoint& value)
 {
-    if (position() != p)
-       m_impl->notifyChange(GraphicsLayerQtImpl::PositionChange);
-    GraphicsLayer::setPosition(p);
+    if (value == position())
+        return;
+    GraphicsLayer::setPosition(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::PositionChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setAnchorPoint(const FloatPoint3D& p)
+void GraphicsLayerQt::setAnchorPoint(const FloatPoint3D& value)
 {
-    if (anchorPoint() != p)
-        m_impl->notifyChange(GraphicsLayerQtImpl::AnchorPointChange);
-    GraphicsLayer::setAnchorPoint(p);
+    if (value == anchorPoint())
+        return;
+    GraphicsLayer::setAnchorPoint(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::AnchorPointChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setSize(const FloatSize& size)
+void GraphicsLayerQt::setSize(const FloatSize& value)
 {
-    if (this->size() != size)
-        m_impl->notifyChange(GraphicsLayerQtImpl::SizeChange);
-    GraphicsLayer::setSize(size);
+    if (value == size())
+        return;
+    GraphicsLayer::setSize(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::SizeChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setTransform(const TransformationMatrix& t)
+void GraphicsLayerQt::setTransform(const TransformationMatrix& value)
 {
-    if (!m_impl->m_transformAnimationRunning && transform() != t)
-       m_impl->notifyChange(GraphicsLayerQtImpl::TransformChange);
-    GraphicsLayer::setTransform(t);
+    if (value == transform())
+        return;
+    GraphicsLayer::setTransform(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::TransformChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setChildrenTransform(const TransformationMatrix& t)
+void GraphicsLayerQt::setChildrenTransform(const TransformationMatrix& value)
 {
-    GraphicsLayer::setChildrenTransform(t);
+    if (value == childrenTransform())
+        return;
+    GraphicsLayer::setChildrenTransform(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::ChildrenTransformChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setPreserves3D(bool b)
+void GraphicsLayerQt::setPreserves3D(bool value)
 {
-    if (b != preserves3D());
-       m_impl->notifyChange(GraphicsLayerQtImpl::Preserves3DChange);
-    GraphicsLayer::setPreserves3D(b);
+    if (value == preserves3D())
+        return;
+    GraphicsLayer::setPreserves3D(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::Preserves3DChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setMasksToBounds(bool b)
+void GraphicsLayerQt::setMasksToBounds(bool value)
 {
-    GraphicsLayer::setMasksToBounds(b);
+    if (value == masksToBounds())
+        return;
+    GraphicsLayer::setMasksToBounds(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::MasksToBoundsChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setDrawsContent(bool b)
+void GraphicsLayerQt::setDrawsContent(bool value)
 {
+    if (value == drawsContent())
+        return;
     m_impl->notifyChange(GraphicsLayerQtImpl::DrawsContentChange);
-    GraphicsLayer::setDrawsContent(b);
+    GraphicsLayer::setDrawsContent(value);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setBackgroundColor(const Color& c)
+void GraphicsLayerQt::setBackgroundColor(const Color& value)
 {
+    if (value == m_impl->m_pendingContent.backgroundColor)
+        return;
+    m_impl->m_pendingContent.backgroundColor = value;
+    GraphicsLayer::setBackgroundColor(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::BackgroundColorChange);
-    m_impl->m_pendingContent.backgroundColor = c;
-    GraphicsLayer::setBackgroundColor(c);
 }
 
 // reimp from GraphicsLayer.h
 void GraphicsLayerQt::clearBackgroundColor()
 {
+    if (!m_impl->m_pendingContent.backgroundColor.isValid())
+        return;
     m_impl->m_pendingContent.backgroundColor = QColor();
-    m_impl->notifyChange(GraphicsLayerQtImpl::BackgroundColorChange);
     GraphicsLayer::clearBackgroundColor();
+    m_impl->notifyChange(GraphicsLayerQtImpl::BackgroundColorChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setContentsOpaque(bool b)
+void GraphicsLayerQt::setContentsOpaque(bool value)
 {
+    if (value == contentsOpaque())
+        return;
     m_impl->notifyChange(GraphicsLayerQtImpl::ContentsOpaqueChange);
-    GraphicsLayer::setContentsOpaque(b);
+    GraphicsLayer::setContentsOpaque(value);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setBackfaceVisibility(bool b)
+void GraphicsLayerQt::setBackfaceVisibility(bool value)
 {
+    if (value == backfaceVisibility())
+        return;
+    GraphicsLayer::setBackfaceVisibility(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::BackfaceVisibilityChange);
-    GraphicsLayer::setBackfaceVisibility(b);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setOpacity(float o)
+void GraphicsLayerQt::setOpacity(float value)
 {
-    if (!m_impl->m_opacityAnimationRunning && opacity() != o)
-       m_impl->notifyChange(GraphicsLayerQtImpl::OpacityChange);
-    GraphicsLayer::setOpacity(o);
+    if (value == opacity())
+        return;
+    GraphicsLayer::setOpacity(value);
+    m_impl->notifyChange(GraphicsLayerQtImpl::OpacityChange);
 }
 
 // reimp from GraphicsLayer.h
-void GraphicsLayerQt::setContentsRect(const IntRect& r)
+void GraphicsLayerQt::setContentsRect(const IntRect& value)
 {
+    if (value == contentsRect())
+        return;
+    GraphicsLayer::setContentsRect(value);
     m_impl->notifyChange(GraphicsLayerQtImpl::ContentsRectChange);
-    GraphicsLayer::setContentsRect(r);
 }
 
 // reimp from GraphicsLayer.h
@@ -845,6 +871,19 @@
     GraphicsLayer::setContentsBackgroundColor(color);
 }
 
+void GraphicsLayerQt::setContentsToMedia(PlatformLayer* media)
+{
+    if (media) {
+        m_impl->m_pendingContent.contentType = GraphicsLayerQtImpl::MediaContentType;
+        m_impl->m_pendingContent.mediaLayer = media->toGraphicsObject();
+    } else
+        m_impl->m_pendingContent.contentType = GraphicsLayerQtImpl::HTMLContentType;
+
+    m_impl->notifyChange(GraphicsLayerQtImpl::ContentChange);
+    GraphicsLayer::setContentsToMedia(media);
+}
+
+
 // reimp from GraphicsLayer.h
 void GraphicsLayerQt::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
 {
@@ -913,18 +952,18 @@
 
 // we want the timing function to be as close as possible to what the web-developer intended, so we're using the same function used by WebCore when compositing is disabled
 // Using easing-curves would probably work for some of the cases, but wouldn't really buy us anything as we'd have to convert the bezier function back to an easing curve
-static inline qreal applyTimingFunction(const TimingFunction& timingFunction, qreal progress, int duration)
+static inline qreal applyTimingFunction(const TimingFunction& timingFunction, qreal progress, double duration)
 {
-        if (timingFunction.type() == LinearTimingFunction)
-            return progress;
-        if (timingFunction.type() == CubicBezierTimingFunction) {
-            return solveCubicBezierFunction(timingFunction.x1(),
-                                            timingFunction.y1(),
-                                            timingFunction.x2(),
-                                            timingFunction.y2(),
-                                            double(progress), double(duration) / 1000);
-        }
+    if (timingFunction.type() == LinearTimingFunction)
         return progress;
+    if (timingFunction.type() == CubicBezierTimingFunction) {
+        return solveCubicBezierFunction(timingFunction.x1(),
+                                        timingFunction.y1(),
+                                        timingFunction.x2(),
+                                        timingFunction.y2(),
+                                        double(progress), double(duration) / 1000);
+    }
+    return progress;
 }
 
 // helper functions to safely get a value out of WebCore's AnimationValue*
@@ -943,6 +982,7 @@
     realValue = animationValue ? static_cast<const FloatAnimationValue*>(animationValue)->value() : 0;
 }
 
+#ifndef QT_NO_ANIMATION
 // we put a bit of the functionality in a base class to allow casting and to save some code size
 class AnimationQtBase : public QAbstractAnimation {
 public:
@@ -953,7 +993,9 @@
         , m_duration(anim->duration() * 1000)
         , m_isAlternate(anim->direction() == Animation::AnimationDirectionAlternate)
         , m_webkitPropertyID(values.property())
+        , m_webkitAnimation(anim)
         , m_keyframesName(name)
+        , m_fillsForwards(false)
     {
     }
 
@@ -973,7 +1015,11 @@
     int m_duration;
     bool m_isAlternate;
     AnimatedPropertyID m_webkitPropertyID;
+
+    // we might need this in case the same animation is added again (i.e. resumed by WebCore)
+    const Animation* m_webkitAnimation;
     QString m_keyframesName;
+    bool m_fillsForwards;
 };
 
 // we'd rather have a templatized QAbstractAnimation than QPropertyAnimation / QVariantAnimation;
@@ -992,6 +1038,8 @@
             KeyframeValueQt<T> keyframeValue;
             if (animationValue->timingFunction())
                 keyframeValue.timingFunction = *animationValue->timingFunction();
+            else
+                keyframeValue.timingFunction = anim->timingFunction();
             webkitAnimationToQtAnimationValue(animationValue, keyframeValue.value);
             m_keyframeValues[animationValue->keyTime()] = keyframeValue;
         }
@@ -1028,7 +1076,7 @@
 
         typename QMap<qreal, KeyframeValueQt<T> >::iterator it2 = it+1;
         if (it2 == m_keyframeValues.end())
-            it2 = m_keyframeValues.begin();
+            it2 = it;
         const KeyframeValueQt<T>& fromKeyframe = it.value();
         const KeyframeValueQt<T>& toKeyframe = it2.value();
 
@@ -1040,7 +1088,7 @@
         // we can now process the progress and apply the frame
         progress = (!progress || progress == 1 || it.key() == it2.key())
                                          ? progress
-                                         : applyTimingFunction(timingFunc, (progress - it.key()) / (it2.key() - it.key()), duration() / 1000);
+                                         : applyTimingFunction(timingFunc, (progress - it.key()) / (it2.key() - it.key()), duration());
         applyFrame(fromValue, toValue, progress);
     }
 
@@ -1056,10 +1104,10 @@
 
     ~TransformAnimationQt()
     {
-        // this came up during the compositing/animation LayoutTests
-        // when the animation dies, the transform has to go back to default
-        if (m_layer)
-            m_layer.data()->updateTransform();
+        if (m_fillsForwards)
+            setCurrentTime(1);
+        else if (m_layer && m_layer.data()->m_layer)
+            m_layer.data()->setBaseTransform(m_layer.data()->m_layer->transform());
     }
 
     // the idea is that we let WebCore manage the transform-operations
@@ -1077,15 +1125,29 @@
             sourceOperations.apply(m_boxSize, sourceMatrix);
             transformMatrix = m_sourceMatrix;
             transformMatrix.blend(sourceMatrix, 1 - progress);
-        } else if (targetOperations.size() != sourceOperations.size()) {
-            transformMatrix = m_sourceMatrix;
-            targetOperations.apply(m_boxSize, transformMatrix);
-            transformMatrix.blend(m_sourceMatrix, progress);
         } else {
-            for (size_t i = 0; i < targetOperations.size(); ++i)
-                targetOperations.operations()[i]->blend(sourceOperations.at(i), progress)->apply(transformMatrix, m_boxSize);
+            bool validTransformLists = true;
+            const int sourceOperationCount = sourceOperations.size();
+            if (sourceOperationCount) {
+                if (targetOperations.size() != sourceOperationCount)
+                    validTransformLists = false;
+                else
+                    for (size_t j = 0; j < sourceOperationCount && validTransformLists; ++j)
+                        if (!sourceOperations.operations()[j]->isSameType(*targetOperations.operations()[j]))
+                            validTransformLists = false;
+            }
+
+            if (validTransformLists) {
+                for (size_t i = 0; i < targetOperations.size(); ++i)
+                    targetOperations.operations()[i]->blend(sourceOperations.at(i), progress)->apply(transformMatrix, m_boxSize);
+            } else {
+                targetOperations.apply(m_boxSize, transformMatrix);
+                transformMatrix.blend(m_sourceMatrix, progress);
+            }
         }
         m_layer.data()->setBaseTransform(transformMatrix);
+        if (m_fillsForwards)
+            m_layer.data()->m_layer->setTransform(m_layer.data()->m_baseTransform);
     }
 
     virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
@@ -1100,10 +1162,8 @@
         if (newState == QAbstractAnimation::Running) {
             m_sourceMatrix = m_layer.data()->m_layer->transform();
             m_layer.data()->m_transformAnimationRunning = true;
-            m_layer.data()->adjustCachingRecursively(true);
-        } else {
+        } else if (newState == QAbstractAnimation::Stopped) {
             m_layer.data()->m_transformAnimationRunning = false;
-            m_layer.data()->adjustCachingRecursively(false);
         }
     }
 
@@ -1117,9 +1177,25 @@
     {
     }
 
+    ~OpacityAnimationQt()
+    {
+        if (m_fillsForwards)
+            setCurrentTime(1);
+        else if (m_layer && m_layer.data()->m_layer)
+            m_layer.data()->setOpacity(m_layer.data()->m_layer->opacity());
+    }
     virtual void applyFrame(const qreal& fromValue, const qreal& toValue, qreal progress)
     {
-        m_layer.data()->setOpacity(qMin<qreal>(qMax<qreal>(fromValue + (toValue-fromValue)*progress, 0), 1));
+        qreal opacity = qBound(qreal(0), fromValue + (toValue-fromValue)*progress, qreal(1));
+
+        // FIXME: this is a hack, due to a probable QGraphicsScene bug.
+        // Without this the opacity change doesn't always have immediate effect.
+        if (!m_layer.data()->opacity() && opacity)
+            m_layer.data()->scene()->update();
+
+        m_layer.data()->setOpacity(opacity);
+        if (m_fillsForwards)
+            m_layer.data()->m_layer->setOpacity(opacity);
     }
 
     virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
@@ -1136,33 +1212,51 @@
     if (!anim->duration() || !anim->iterationCount())
         return false;
 
-    QAbstractAnimation* newAnim;
+    AnimationQtBase* newAnim = 0;
 
-    switch (values.property()) {
-    case AnimatedPropertyOpacity:
-        newAnim = new OpacityAnimationQt(m_impl.get(), values, boxSize, anim, keyframesName);
-        break;
-    case AnimatedPropertyWebkitTransform:
-        newAnim = new TransformAnimationQt(m_impl.get(), values, boxSize, anim, keyframesName);
-        break;
-    default:
-        return false;
+    // fixed: we might already have the Qt animation object associated with this WebCore::Animation object
+    for (QList<QWeakPointer<QAbstractAnimation> >::iterator it = m_impl->m_animations.begin(); it != m_impl->m_animations.end(); ++it) {
+        if (*it) {
+            AnimationQtBase* curAnimation = static_cast<AnimationQtBase*>(it->data());
+            if (curAnimation && curAnimation->m_webkitAnimation == anim)
+                newAnim = curAnimation;
+        }
     }
 
-    // we make sure WebCore::Animation and QAnimation are on the same terms
-    newAnim->setLoopCount(anim->iterationCount());
-    m_impl->m_animations.append(QWeakPointer<QAbstractAnimation>(newAnim));
-    QObject::connect(&m_impl->m_suspendTimer, SIGNAL(timeout()), newAnim, SLOT(resume()));
-    timeOffset += anim->delay();
+    if (!newAnim) {
+        switch (values.property()) {
+        case AnimatedPropertyOpacity:
+            newAnim = new OpacityAnimationQt(m_impl.get(), values, boxSize, anim, keyframesName);
+            break;
+        case AnimatedPropertyWebkitTransform:
+            newAnim = new TransformAnimationQt(m_impl.get(), values, boxSize, anim, keyframesName);
+            break;
+        default:
+            return false;
+        }
+
+        // we make sure WebCore::Animation and QAnimation are on the same terms
+        newAnim->setLoopCount(anim->iterationCount());
+        newAnim->m_fillsForwards = anim->fillsForwards();
+        m_impl->m_animations.append(QWeakPointer<QAbstractAnimation>(newAnim));
+        QObject::connect(&m_impl->m_suspendTimer, SIGNAL(timeout()), newAnim, SLOT(resume()));
+    }
 
     // flush now or flicker...
     m_impl->flushChanges(false);
 
-    if (timeOffset)
-        QTimer::singleShot(timeOffset * 1000, newAnim, SLOT(start()));
+    // when fill-mode is backwards/both, we set the value to 0 before the delay takes place
+    if (anim->fillsBackwards())
+        newAnim->setCurrentTime(0);
+
+    if (anim->delay())
+        QTimer::singleShot(anim->delay() * 1000, newAnim, SLOT(start()));
     else
         newAnim->start();
 
+    // we synchronize the animation's clock to WebCore's timeOffset
+    newAnim->setCurrentTime(timeOffset * 1000);
+
     // we don't need to manage the animation object's lifecycle:
     // WebCore would call removeAnimations when it's time to delete.
 
@@ -1204,8 +1298,11 @@
             continue;
 
         AnimationQtBase* anim = static_cast<AnimationQtBase*>((*it).data());
-        if (anim && anim->m_keyframesName == QString(name))
-            QTimer::singleShot(timeOffset * 1000, anim, SLOT(pause()));
+        if (anim && anim->m_keyframesName == QString(name)) {
+            // we synchronize the animation's clock to WebCore's timeOffset
+            anim->setCurrentTime(timeOffset * 1000);
+            anim->pause();
+        }
     }
 }
 
@@ -1235,6 +1332,7 @@
     }
 }
 
+#endif // QT_NO_ANIMATION
 }
 
 #include <GraphicsLayerQt.moc>
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.h b/WebCore/platform/graphics/qt/GraphicsLayerQt.h
index 3a53bd9..9e5832f 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.h
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.h
@@ -63,13 +63,16 @@
     virtual void setBackfaceVisibility(bool b);
     virtual void setOpacity(float opacity);
     virtual void setContentsRect(const IntRect& r);
+#ifndef QT_NO_ANIMATION
     virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& keyframesName, double timeOffset);
     virtual void removeAnimationsForProperty(AnimatedPropertyID);
     virtual void removeAnimationsForKeyframes(const String& keyframesName);
     virtual void pauseAnimation(const String& keyframesName, double timeOffset);
     virtual void suspendAnimations(double time);
     virtual void resumeAnimations();
+#endif // QT_NO_ANIMATION
     virtual void setContentsToImage(Image*);
+    virtual void setContentsToMedia(PlatformLayer*);
     virtual void setContentsBackgroundColor(const Color&);
     virtual void setGeometryOrientation(CompositingCoordinatesOrientation orientation);
     virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation);
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index d831566..4b85a18 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -28,11 +28,11 @@
 #include "config.h"
 #include "ImageBuffer.h"
 
-#include "CString.h"
 #include "GraphicsContext.h"
 #include "ImageData.h"
 #include "MIMETypeRegistry.h"
 #include "StillImageQt.h"
+#include <wtf/text/CString.h>
 
 #include <QBuffer>
 #include <QColor>
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index 18e7f08..b48b278 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -57,7 +57,7 @@
 
 void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
 {
-    if (m_failed)
+    if (failed())
         return;
 
     // No progressive loading possible
@@ -75,7 +75,7 @@
     QByteArray imageData = QByteArray::fromRawData(m_data->data(), m_data->size());
     m_buffer.set(new QBuffer);
     m_buffer->setData(imageData);
-    m_buffer->open(QBuffer::ReadOnly);
+    m_buffer->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
     m_reader.set(new QImageReader(m_buffer.get(), m_format));
 
     // This will force the JPEG decoder to use JDCT_IFAST
@@ -106,9 +106,8 @@
                 forceLoadEverything();
             else
                 m_frameBufferCache.resize(imageCount);
-        } else {
+        } else
             m_frameBufferCache.resize(1);
-        }
     }
 
     return m_frameBufferCache.size();
@@ -116,8 +115,21 @@
 
 int ImageDecoderQt::repetitionCount() const
 {
-    if (m_reader && m_reader->supportsAnimation())
-        m_repetitionCount = qMax(0, m_reader->loopCount());
+    if (m_reader && m_reader->supportsAnimation()) {
+        m_repetitionCount = m_reader->loopCount();
+
+        // Qt and WebCore have a incompatible understanding of
+        // the loop count and we can not completely map everything.
+        //  Qt   |   WebCore          | description
+        //  -1   |     0              | infinite animation
+        //   0   | cAnimationLoopOnce | show every frame once
+        //   n   |     n              | no idea if that is supported
+        //  n/a  | cAnimationNone     | show only the first frame
+        if (m_repetitionCount == -1)
+            m_repetitionCount = 0;
+        else if (m_repetitionCount == 0)
+            m_repetitionCount = cAnimationLoopOnce;
+    }
 
     return m_repetitionCount;
 }
@@ -133,7 +145,7 @@
     // yet how many images we are going to have and need to
     // find that out now.
     size_t count = m_frameBufferCache.size();
-    if (!m_failed && !count) {
+    if (!failed() && !count) {
         internalDecodeSize();
         count = frameCount();
     }
@@ -157,8 +169,10 @@
 
     // If we have a QSize() something failed
     QSize size = m_reader->size();
-    if (size.isEmpty())
-        return failRead();
+    if (size.isEmpty()) {
+        setFailed();
+        return clearPointers();
+    }
 
     setSize(size.width(), size.height());
 }
@@ -169,26 +183,33 @@
 
     if (m_reader->supportsAnimation())
         m_reader->jumpToImage(frameIndex);
-    else if (frameIndex != 0)
-        return failRead();
+    else if (frameIndex) {
+        setFailed();
+        return clearPointers();
+    }
 
-    internalHandleCurrentImage(frameIndex);
+    if (!internalHandleCurrentImage(frameIndex))
+      setFailed();
 
     // Attempt to return some memory
-    for (int i = 0; i < m_frameBufferCache.size(); ++i)
+    for (int i = 0; i < m_frameBufferCache.size(); ++i) {
         if (m_frameBufferCache[i].status() != RGBA32Buffer::FrameComplete)
             return;
+    }
 
-    m_reader.clear();
-    m_buffer.clear();
+    clearPointers();
 }
 
-void ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
+bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
 {
     // Now get the QImage from Qt and place it in the RGBA32Buffer
     QImage img;
-    if (!m_reader->read(&img))
-        return failRead();
+    if (!m_reader->read(&img)) {
+        frameCount();
+        repetitionCount();
+        clearPointers();
+        return false;
+    }
 
     // now into the RGBA32Buffer - even if the image is not
     QSize imageSize = img.size();
@@ -197,6 +218,7 @@
     buffer->setStatus(RGBA32Buffer::FrameComplete);
     buffer->setDuration(m_reader->nextImageDelay());
     buffer->setDecodedImage(img);
+    return true;
 }
 
 // The QImageIOHandler is not able to tell us how many frames
@@ -204,8 +226,8 @@
 // increasing the m_frameBufferCache by one and try to parse
 // the image. We stop when QImage::read fails and then need
 // to resize the m_frameBufferCache to the final size and update
-// the m_failed. In case we failed to decode the first image
-// we want to keep m_failed set to true.
+// the failed bit. If we failed to decode the first image
+// then we truly failed to decode, otherwise we're OK.
 
 // TODO: Do not increment the m_frameBufferCache.size() by one but more than one
 void ImageDecoderQt::forceLoadEverything()
@@ -214,20 +236,19 @@
 
     do {
         m_frameBufferCache.resize(++imageCount);
-        internalHandleCurrentImage(imageCount - 1);
-    } while (!m_failed);
+    } while (internalHandleCurrentImage(imageCount - 1));
 
     // If we failed decoding the first image we actually
-    // have no images and need to keep m_failed set to
-    // true otherwise we want to reset it and forget about
+    // have no images and need to set the failed bit.
+    // Otherwise, we want to forget about
     // the last attempt to decode a image.
     m_frameBufferCache.resize(imageCount - 1);
-    m_failed = imageCount == 1;
+    if (imageCount == 1)
+      setFailed();
 }
 
-void ImageDecoderQt::failRead()
+void ImageDecoderQt::clearPointers()
 {
-    setFailed();
     m_reader.clear();
     m_buffer.clear();
 }
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.h b/WebCore/platform/graphics/qt/ImageDecoderQt.h
index be9a9b0..ceef884 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.h
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.h
@@ -61,9 +61,9 @@
 private:
     void internalDecodeSize();
     void internalReadImage(size_t);
-    void internalHandleCurrentImage(size_t);
+    bool internalHandleCurrentImage(size_t);
     void forceLoadEverything();
-    void failRead();
+    void clearPointers();
 
 private:
     QByteArray m_format;
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
index 3274db5..21e670c 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
@@ -23,23 +23,25 @@
 
 #include <limits>
 
-#include "CString.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
+#include "MIMETypeRegistry.h"
 #include "NotImplemented.h"
 #include "TimeRanges.h"
 #include "Widget.h"
 #include <wtf/HashSet.h>
+#include <wtf/text/CString.h>
 
 #include <QDebug>
+#include <QEvent>
+#include <QMetaEnum>
 #include <QPainter>
 #include <QWidget>
-#include <QMetaEnum>
 #include <QUrl>
-#include <QEvent>
 
-#include <phonon/path.h>
 #include <phonon/audiooutput.h>
+#include <phonon/backendcapabilities.h>
+#include <phonon/path.h>
 #include <phonon/mediaobject.h>
 #include <phonon/videowidget.h>
 
@@ -143,15 +145,62 @@
     m_mediaObject = 0;
 }
 
-void MediaPlayerPrivate::getSupportedTypes(HashSet<String>&)
+HashSet<String>& MediaPlayerPrivate::supportedTypesCache()
 {
-    notImplemented();
+    static HashSet<String> supportedTypes;
+    if (!supportedTypes.isEmpty())
+        return supportedTypes;
+
+    // FIXME: we should rebuild the MIME type cache every time the backend is changed,
+    // however, this would have no effect on MIMETypeRegistry anyway, because it
+    // pulls this data only once.
+
+    QStringList types = Phonon::BackendCapabilities::availableMimeTypes();
+    foreach (const QString& type, types) {
+        QString first = type.split(QLatin1Char('/')).at(0);
+
+        // We're only interested in types which are not supported by WebCore itself.
+        if (first != QLatin1String("video")
+            && first != QLatin1String("audio")
+            && first != QLatin1String("application"))
+            continue;
+        if (MIMETypeRegistry::isSupportedNonImageMIMEType(type))
+            continue;
+
+        supportedTypes.add(String(type));
+    }
+
+    // These formats are supported by GStreamer, but not correctly advertised.
+    if (supportedTypes.contains(String("video/x-h264"))
+        || supportedTypes.contains(String("audio/x-m4a"))) {
+        supportedTypes.add(String("video/mp4"));
+        supportedTypes.add(String("audio/aac"));
+    }
+
+    if (supportedTypes.contains(String("video/x-theora")))
+        supportedTypes.add(String("video/ogg"));
+
+    if (supportedTypes.contains(String("audio/x-vorbis")))
+        supportedTypes.add(String("audio/ogg"));
+
+    if (supportedTypes.contains(String("audio/x-wav")))
+        supportedTypes.add(String("audio/wav"));
+
+    return supportedTypes;
 }
 
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String&, const String&)
+void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
 {
-    // FIXME: do the real thing
-    notImplemented();
+    types = supportedTypesCache();
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
+{
+    if (type.isEmpty())
+        return MediaPlayer::IsNotSupported;
+
+    if (supportedTypesCache().contains(type))
+        return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
     return MediaPlayer::IsNotSupported;
 }
 
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
index e7630a1..ff6a01c 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
@@ -132,6 +132,7 @@
 
         static void getSupportedTypes(HashSet<String>&);
         static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+        static HashSet<String>& supportedTypesCache();
         static bool isAvailable() { return true; }
 
         void updateStates();
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
new file mode 100644
index 0000000..bdac2a4
--- /dev/null
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -0,0 +1,571 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 "MediaPlayerPrivateQt.h"
+
+#include "FrameLoaderClientQt.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "HTMLMediaElement.h"
+#include "HTMLVideoElement.h"
+#include "TimeRanges.h"
+#include "Widget.h"
+#include "qwebframe.h"
+#include "qwebpage.h"
+
+#include <QGraphicsScene>
+#include <QGraphicsVideoItem>
+#include <QMediaPlayerControl>
+#include <QMediaService>
+#include <QNetworkAccessManager>
+#include <QNetworkCookieJar>
+#include <QNetworkRequest>
+#include <QPainter>
+#include <QPoint>
+#include <QRect>
+#include <QTime>
+#include <QTimer>
+#include <QUrl>
+#include <limits>
+#include <wtf/HashSet.h>
+#include <wtf/text/CString.h>
+
+using namespace WTF;
+
+namespace WebCore {
+
+MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
+{
+    return new MediaPlayerPrivate(player);
+}
+
+void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar)
+{
+    registrar(create, getSupportedTypes, supportsType);
+}
+
+void MediaPlayerPrivate::getSupportedTypes(HashSet<String> &supported)
+{
+    QStringList types = QMediaPlayer::supportedMimeTypes();
+
+    for (int i = 0; i < types.size(); i++) {
+        QString mime = types.at(i);
+        if (mime.startsWith("audio/") || mime.startsWith("video/"))
+            supported.add(mime);
+    }
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& mime, const String& codec)
+{
+    if (!mime.startsWith("audio/") && !mime.startsWith("video/"))
+        return MediaPlayer::IsNotSupported;
+
+    if (QMediaPlayer::hasSupport(mime, QStringList(codec)) >= QtMultimedia::ProbablySupported)
+        return MediaPlayer::IsSupported;
+
+    return MediaPlayer::MayBeSupported;
+}
+
+MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
+    : m_player(player)
+    , m_mediaPlayer(new QMediaPlayer)
+    , m_mediaPlayerControl(0)
+    , m_videoItem(new QGraphicsVideoItem)
+    , m_videoScene(new QGraphicsScene)
+    , m_networkState(MediaPlayer::Empty)
+    , m_readyState(MediaPlayer::HaveNothing)
+    , m_isVisible(false)
+    , m_isSeeking(false)
+    , m_composited(false)
+    , m_queuedSeek(-1)
+{
+    m_videoItem->setMediaObject(m_mediaPlayer);
+    m_videoScene->addItem(m_videoItem);
+
+    // Signal Handlers
+    connect(m_mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
+            this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
+    connect(m_mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
+            this, SLOT(stateChanged(QMediaPlayer::State)));
+    connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)),
+            this, SLOT(handleError(QMediaPlayer::Error)));
+    connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)),
+            this, SLOT(durationChanged(qint64)));
+    connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)),
+            this, SLOT(positionChanged(qint64)));
+    connect(m_mediaPlayer, SIGNAL(volumeChanged(int)),
+            this, SLOT(volumeChanged(int)));
+    connect(m_mediaPlayer, SIGNAL(mutedChanged(bool)),
+            this, SLOT(mutedChanged(bool)));
+    connect(m_videoScene, SIGNAL(changed(QList<QRectF>)),
+            this, SLOT(repaint()));
+    connect(m_videoItem, SIGNAL(nativeSizeChanged(QSizeF)),
+           this, SLOT(nativeSizeChanged(QSizeF)));
+
+    // Grab the player control
+    QMediaService* service = m_mediaPlayer->service();
+    if (service) {
+        m_mediaPlayerControl = qobject_cast<QMediaPlayerControl *>(
+                service->control(QMediaPlayerControl_iid));
+    }
+}
+
+MediaPlayerPrivate::~MediaPlayerPrivate()
+{
+    delete m_mediaPlayer;
+    delete m_videoScene;
+}
+
+bool MediaPlayerPrivate::hasVideo() const
+{
+    return m_mediaPlayer->isVideoAvailable();
+}
+
+bool MediaPlayerPrivate::hasAudio() const
+{
+    return true;
+}
+
+void MediaPlayerPrivate::load(const String& url)
+{
+    // We are now loading
+    if (m_networkState != MediaPlayer::Loading) {
+        m_networkState = MediaPlayer::Loading;
+        m_player->networkStateChanged();
+    }
+
+    // And we don't have any data yet
+    if (m_readyState != MediaPlayer::HaveNothing) {
+        m_readyState = MediaPlayer::HaveNothing;
+        m_player->readyStateChanged();
+    }
+
+    const QUrl rUrl = QUrl(QString(url));
+    const QString scheme = rUrl.scheme().toLower();
+
+    // Grab the client media element
+    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_player->mediaPlayerClient());
+
+    // Construct the media content with a network request if the resource is http[s]
+    if (scheme == "http" || scheme == "https") {
+        QNetworkRequest request = QNetworkRequest(rUrl);
+
+        // Grab the current document
+        Document* document = element->document();
+        if (!document)
+            document = element->ownerDocument();
+
+        // Grab the frame and network manager
+        Frame* frame = document ? document->frame() : 0;
+        FrameLoaderClientQt* frameLoader =  frame ? static_cast<FrameLoaderClientQt*>(frame->loader()->client()) : 0;
+        QNetworkAccessManager* manager = frameLoader ? frameLoader->webFrame()->page()->networkAccessManager() : 0;
+
+        if (document && manager) {
+            // Set the cookies
+            QNetworkCookieJar* jar = manager->cookieJar();
+            QList<QNetworkCookie> cookies = jar->cookiesForUrl(rUrl);
+
+            // Don't set the header if there are no cookies.
+            // This prevents a warning from being emitted.
+            if (!cookies.isEmpty())
+                request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies));
+
+            // Set the refferer, but not when requesting insecure content from a secure page
+            QUrl documentUrl = QUrl(QString(document->documentURI()));
+            if (documentUrl.scheme().toLower() == "http" || scheme == "https")
+                request.setRawHeader("Referer", documentUrl.toEncoded());
+
+            // Set the user agent
+            request.setRawHeader("User-Agent", frameLoader->userAgent(rUrl).utf8().data());
+        }
+
+        m_mediaPlayer->setMedia(QMediaContent(request));
+    } else {
+        // Otherwise, just use the URL
+        m_mediaPlayer->setMedia(QMediaContent(rUrl));
+    }
+
+    // Set the current volume and mute status
+    // We get these from the element, rather than the player, in case we have
+    // transitioned from a media engine which doesn't support muting, to a media
+    // engine which does.
+    m_mediaPlayer->setMuted(element->muted());
+    m_mediaPlayer->setVolume(static_cast<int>(element->volume() * 100.0));
+}
+
+void MediaPlayerPrivate::cancelLoad()
+{
+    m_mediaPlayer->setMedia(QMediaContent());
+    updateStates();
+}
+
+void MediaPlayerPrivate::play()
+{
+    if (m_mediaPlayer->state() != QMediaPlayer::PlayingState)
+        m_mediaPlayer->play();
+}
+
+void MediaPlayerPrivate::pause()
+{
+    if (m_mediaPlayer->state() == QMediaPlayer::PlayingState)
+        m_mediaPlayer->pause();
+}
+
+bool MediaPlayerPrivate::paused() const
+{
+    return (m_mediaPlayer->state() != QMediaPlayer::PlayingState);
+}
+
+void MediaPlayerPrivate::seek(float position)
+{
+    if (!m_mediaPlayer->isSeekable())
+        return;
+
+    if (m_mediaPlayerControl && !m_mediaPlayerControl->availablePlaybackRanges().contains(position * 1000))
+        return;
+
+    if (m_isSeeking)
+        return;
+
+    if (position > duration())
+        position = duration();
+
+    // Seeking is most reliable when we're paused.
+    // Webkit will try to pause before seeking, but due to the asynchronous nature
+    // of the backend, the player may not actually be paused yet.
+    // In this case, we should queue the seek and wait until pausing has completed
+    // before attempting to seek.
+    if (m_mediaPlayer->state() == QMediaPlayer::PlayingState) {
+        m_mediaPlayer->pause();
+        m_isSeeking = true;
+        m_queuedSeek = static_cast<qint64>(position * 1000);
+
+        // Set a timeout, so that in the event that we don't get a state changed
+        // signal, we still attempt the seek.
+        QTimer::singleShot(1000, this, SLOT(queuedSeekTimeout()));
+    } else {
+        m_isSeeking = true;
+        m_mediaPlayer->setPosition(static_cast<qint64>(position * 1000));
+
+        // Set a timeout, in case we don't get a position changed signal
+        QTimer::singleShot(10000, this, SLOT(seekTimeout()));
+    }
+}
+
+bool MediaPlayerPrivate::seeking() const
+{
+    return m_isSeeking;
+}
+
+float MediaPlayerPrivate::duration() const
+{
+    if (m_readyState < MediaPlayer::HaveMetadata)
+        return 0.0f;
+
+    float duration = m_mediaPlayer->duration() / 1000.0f;
+
+    // We are streaming
+    if (duration <= 0.0f)
+        duration = std::numeric_limits<float>::infinity();
+
+    return duration;
+}
+
+float MediaPlayerPrivate::currentTime() const
+{
+    float currentTime = m_mediaPlayer->position() / 1000.0f;
+    return currentTime;
+}
+
+PassRefPtr<TimeRanges> MediaPlayerPrivate::buffered() const
+{
+    RefPtr<TimeRanges> buffered = TimeRanges::create();
+
+    if (!m_mediaPlayerControl)
+        return buffered;
+
+    QMediaTimeRange playbackRanges = m_mediaPlayerControl->availablePlaybackRanges();
+
+    foreach (const QMediaTimeInterval interval, playbackRanges.intervals()) {
+        float rangeMin = static_cast<float>(interval.start()) / 1000.0f;
+        float rangeMax = static_cast<float>(interval.end()) / 1000.0f;
+        buffered->add(rangeMin, rangeMax);
+    }
+
+    return buffered.release();
+}
+
+float MediaPlayerPrivate::maxTimeSeekable() const
+{
+    if (!m_mediaPlayerControl)
+        return 0;
+
+    return static_cast<float>(m_mediaPlayerControl->availablePlaybackRanges().latestTime()) / 1000.0f;
+}
+
+unsigned MediaPlayerPrivate::bytesLoaded() const
+{
+    unsigned percentage = m_mediaPlayer->bufferStatus();
+
+    if (percentage == 100) {
+        if (m_networkState != MediaPlayer::Idle) {
+            m_networkState = MediaPlayer::Idle;
+            m_player->networkStateChanged();
+        }
+        if (m_readyState != MediaPlayer::HaveEnoughData) {
+            m_readyState = MediaPlayer::HaveEnoughData;
+            m_player->readyStateChanged();
+        }
+    }
+
+    QLatin1String bytesLoadedKey("bytes-loaded");
+    if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
+        return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
+
+    return percentage;
+}
+
+unsigned MediaPlayerPrivate::totalBytes() const
+{
+    if (m_mediaPlayer->availableMetaData().contains(QtMultimedia::Size))
+        return m_mediaPlayer->metaData(QtMultimedia::Size).toInt();
+
+    return 100;
+}
+
+void MediaPlayerPrivate::setRate(float rate)
+{
+    m_mediaPlayer->setPlaybackRate(rate);
+}
+
+void MediaPlayerPrivate::setVolume(float volume)
+{
+    m_mediaPlayer->setVolume(static_cast<int>(volume * 100.0));
+}
+
+bool MediaPlayerPrivate::supportsMuting() const
+{
+    return true;
+}
+
+void MediaPlayerPrivate::setMuted(bool muted)
+{
+    m_mediaPlayer->setMuted(muted);
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
+{
+    return m_networkState;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
+{
+    return m_readyState;
+}
+
+void MediaPlayerPrivate::setVisible(bool visible)
+{
+    m_isVisible = visible;
+}
+
+void MediaPlayerPrivate::mediaStatusChanged(QMediaPlayer::MediaStatus)
+{
+    updateStates();
+}
+
+void MediaPlayerPrivate::handleError(QMediaPlayer::Error)
+{
+    updateStates();
+}
+
+void MediaPlayerPrivate::stateChanged(QMediaPlayer::State state)
+{
+    if (state != QMediaPlayer::PlayingState && m_isSeeking && m_queuedSeek >= 0) {
+        m_mediaPlayer->setPosition(m_queuedSeek);
+        m_queuedSeek = -1;
+    }
+}
+
+void MediaPlayerPrivate::nativeSizeChanged(const QSizeF&)
+{
+    m_player->sizeChanged();
+}
+
+void MediaPlayerPrivate::queuedSeekTimeout()
+{
+    // If we haven't heard anything, assume the player is now paused
+    // and we can attempt the seek
+    if (m_isSeeking && m_queuedSeek >= 0) {
+        m_mediaPlayer->setPosition(m_queuedSeek);
+        m_queuedSeek = -1;
+
+        // Set a timeout, in case we don't get a position changed signal
+        QTimer::singleShot(10000, this, SLOT(seekTimeout()));
+    }
+}
+
+void MediaPlayerPrivate::seekTimeout()
+{
+    // If we haven't heard anything, assume the seek succeeded
+    if (m_isSeeking) {
+        m_player->timeChanged();
+        m_isSeeking = false;
+    }
+}
+
+void MediaPlayerPrivate::positionChanged(qint64)
+{
+    // Only propogate this event if we are seeking
+    if (m_isSeeking && m_queuedSeek == -1) {
+        m_player->timeChanged();
+        m_isSeeking = false;
+    }
+}
+
+void MediaPlayerPrivate::durationChanged(qint64)
+{
+    m_player->durationChanged();
+}
+
+void MediaPlayerPrivate::volumeChanged(int volume)
+{
+    m_player->volumeChanged(static_cast<float>(volume) / 100.0);
+}
+
+void MediaPlayerPrivate::mutedChanged(bool muted)
+{
+    m_player->muteChanged(muted);
+}
+
+void MediaPlayerPrivate::updateStates()
+{
+    // Store the old states so that we can detect a change and raise change events
+    MediaPlayer::NetworkState oldNetworkState = m_networkState;
+    MediaPlayer::ReadyState oldReadyState = m_readyState;
+
+    QMediaPlayer::MediaStatus currentStatus = m_mediaPlayer->mediaStatus();
+    QMediaPlayer::Error currentError = m_mediaPlayer->error();
+
+    if (currentError != QMediaPlayer::NoError) {
+        m_readyState = MediaPlayer::HaveNothing;
+        if (currentError == QMediaPlayer::FormatError)
+            m_networkState = MediaPlayer::FormatError;
+        else
+            m_networkState = MediaPlayer::NetworkError;
+    } else if (currentStatus == QMediaPlayer::UnknownMediaStatus
+               || currentStatus == QMediaPlayer::NoMedia) {
+        m_networkState = MediaPlayer::Idle;
+        m_readyState = MediaPlayer::HaveNothing;
+    } else if (currentStatus == QMediaPlayer::LoadingMedia) {
+        m_networkState = MediaPlayer::Loading;
+        m_readyState = MediaPlayer::HaveNothing;
+    } else if (currentStatus == QMediaPlayer::LoadedMedia) {
+        m_networkState = MediaPlayer::Loading;
+        m_readyState = MediaPlayer::HaveMetadata;
+    } else if (currentStatus == QMediaPlayer::BufferingMedia) {
+        m_networkState = MediaPlayer::Loading;
+        m_readyState = MediaPlayer::HaveFutureData;
+    } else if (currentStatus == QMediaPlayer::StalledMedia) {
+        m_networkState = MediaPlayer::Loading;
+        m_readyState = MediaPlayer::HaveCurrentData;
+    } else if (currentStatus == QMediaPlayer::BufferedMedia
+               || currentStatus == QMediaPlayer::EndOfMedia) {
+        m_networkState = MediaPlayer::Idle;
+        m_readyState = MediaPlayer::HaveEnoughData;
+    } else if (currentStatus == QMediaPlayer::InvalidMedia) {
+        m_networkState = MediaPlayer::NetworkError;
+        m_readyState = MediaPlayer::HaveNothing;
+    }
+
+    // Log the state changes and raise the state change events
+    // NB: The readyStateChanged event must come before the networkStateChanged event.
+    // Breaking this invariant will cause the resource selection algorithm for multiple
+    // sources to fail.
+    if (m_readyState != oldReadyState)
+        m_player->readyStateChanged();
+
+    if (m_networkState != oldNetworkState)
+        m_player->networkStateChanged();
+}
+
+void MediaPlayerPrivate::setSize(const IntSize& size)
+{
+    if (size == m_currentSize)
+        return;
+
+    m_currentSize = size;
+    m_videoItem->setSize(QSizeF(QSize(size)));
+}
+
+IntSize MediaPlayerPrivate::naturalSize() const
+{
+    if (!hasVideo() || m_readyState < MediaPlayer::HaveMetadata)
+        return IntSize();
+
+    return IntSize(m_videoItem->nativeSize().toSize());
+}
+
+void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
+{
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_composited)
+        return;
+#endif
+    if (context->paintingDisabled())
+        return;
+
+    if (!m_isVisible)
+        return;
+
+    // Grab the painter and widget
+    QPainter* painter = context->platformContext();
+
+    // Render the video
+    m_videoScene->render(painter, QRectF(QRect(rect)), m_videoItem->sceneBoundingRect());
+}
+
+void MediaPlayerPrivate::repaint()
+{
+    m_player->repaint();
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+void MediaPlayerPrivate::acceleratedRenderingStateChanged()
+{
+    bool composited = m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player);
+    if (composited == m_composited)
+        return;
+
+    m_composited = composited;
+    if (composited)
+        m_videoScene->removeItem(m_videoItem);
+    else
+        m_videoScene->addItem(m_videoItem);
+}
+
+PlatformLayer* MediaPlayerPrivate::platformLayer() const
+{
+    return m_composited ? m_videoItem : 0;
+}
+#endif
+
+} // namespace WebCore
+
+#include "moc_MediaPlayerPrivateQt.cpp"
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
new file mode 100644
index 0000000..d72404c
--- /dev/null
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -0,0 +1,133 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    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 MediaPlayerPrivateQt_h
+#define MediaPlayerPrivateQt_h
+
+#include "MediaPlayerPrivate.h"
+
+#include <QMediaPlayer>
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+class QMediaPlayerControl;
+class QGraphicsVideoItem;
+class QGraphicsScene;
+QT_END_NAMESPACE
+
+namespace WebCore {
+
+class MediaPlayerPrivate : public QObject, public MediaPlayerPrivateInterface {
+
+    Q_OBJECT
+
+public:
+    static MediaPlayerPrivateInterface* create(MediaPlayer* player);
+    ~MediaPlayerPrivate();
+
+    static void registerMediaEngine(MediaEngineRegistrar);
+    static void getSupportedTypes(HashSet<String>&);
+    static MediaPlayer::SupportsType supportsType(const String&, const String&);
+    static bool isAvailable() { return true; }
+
+    bool hasVideo() const;
+    bool hasAudio() const;
+
+    void load(const String &url);
+    void cancelLoad();
+
+    void play();
+    void pause();
+
+    bool paused() const;
+    bool seeking() const;
+
+    float duration() const;
+    float currentTime() const;
+    void seek(float);
+
+    void setRate(float);
+    void setVolume(float);
+
+    bool supportsMuting() const;
+    void setMuted(bool);
+
+    MediaPlayer::NetworkState networkState() const;
+    MediaPlayer::ReadyState readyState() const;
+
+    PassRefPtr<TimeRanges> buffered() const;
+    float maxTimeSeekable() const;
+    unsigned bytesLoaded() const;
+    unsigned totalBytes() const;
+
+    void setVisible(bool);
+
+    IntSize naturalSize() const;
+    void setSize(const IntSize&);
+
+    void paint(GraphicsContext*, const IntRect&);
+
+    bool supportsFullscreen() const { return false; }
+
+#if USE(ACCELERATED_COMPOSITING)
+    // whether accelerated rendering is supported by the media engine for the current media.
+    virtual bool supportsAcceleratedRendering() const { return true; }
+    // called when the rendering system flips the into or out of accelerated rendering mode.
+    virtual void acceleratedRenderingStateChanged();
+    // returns an object that can be directly composited via GraphicsLayerQt (essentially a QGraphicsItem*)
+    virtual PlatformLayer* platformLayer() const;
+#endif
+
+private slots:
+    void mediaStatusChanged(QMediaPlayer::MediaStatus);
+    void handleError(QMediaPlayer::Error);
+    void stateChanged(QMediaPlayer::State);
+    void nativeSizeChanged(const QSizeF&);
+    void queuedSeekTimeout();
+    void seekTimeout();
+    void positionChanged(qint64);
+    void durationChanged(qint64);
+    void volumeChanged(int);
+    void mutedChanged(bool);
+    void repaint();
+
+private:
+    void updateStates();
+
+private:
+    MediaPlayerPrivate(MediaPlayer*);
+
+    MediaPlayer* m_player;
+    QMediaPlayer* m_mediaPlayer;
+    QMediaPlayerControl* m_mediaPlayerControl;
+    QGraphicsVideoItem* m_videoItem;
+    QGraphicsScene* m_videoScene;
+
+    mutable MediaPlayer::NetworkState m_networkState;
+    mutable MediaPlayer::ReadyState m_readyState;
+
+    IntSize m_currentSize;
+    bool m_isVisible;
+    bool m_isSeeking;
+    bool m_composited;
+    qint64 m_queuedSeek;
+};
+}
+
+#endif // MediaPlayerPrivateQt_h
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index 507f029..ee4af7f 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -269,10 +269,12 @@
         span += ea - sa;
     }
 
-    m_path.moveTo(QPointF(xc + radius  * cos(sar),
+    // connect to the previous point by a straight line
+    m_path.lineTo(QPointF(xc + radius  * cos(sar),
                           yc - radius  * sin(sar)));
 
     m_path.arcTo(xs, ys, width, height, sa, span);
+
 }
 
 void Path::addRect(const FloatRect& r)
diff --git a/WebCore/platform/graphics/qt/StillImageQt.cpp b/WebCore/platform/graphics/qt/StillImageQt.cpp
index 1db04a7..4653c58 100644
--- a/WebCore/platform/graphics/qt/StillImageQt.cpp
+++ b/WebCore/platform/graphics/qt/StillImageQt.cpp
@@ -57,8 +57,43 @@
 
     ctxt->save();
     ctxt->setCompositeOperation(op);
+
+    // To support width or height is negative
+    float sx = src.x();
+    float sy = src.y();
+    float sw = src.width();
+    float sh = src.height();
+
+    if (sw < 0) {
+        sx = sx + sw;
+        sw = -sw;
+    }
+
+    if (sh < 0) {
+        sy = sy + sh;
+        sh = -sh;
+    }
+
+    float dx = dst.x();
+    float dy = dst.y();
+    float dw = dst.width();
+    float dh = dst.height();
+
+    if (dw < 0) {
+        dx = dx + dw;
+        dw = -dw;
+    }
+
+    if (dh < 0) {
+        dy = dy + dh;
+        dh = -dh;
+    }
+
+    FloatRect srcM(sx, sy, sw, sh);
+    FloatRect dstM(dx, dy, dw, dh);
     QPainter* painter(ctxt->platformContext());
-    painter->drawPixmap(dst, m_pixmap, src);
+
+    painter->drawPixmap(dstM, m_pixmap, srcM);
     ctxt->restore();
 }
 
diff --git a/WebCore/platform/graphics/qt/TileQt.cpp b/WebCore/platform/graphics/qt/TileQt.cpp
new file mode 100644
index 0000000..9628448
--- /dev/null
+++ b/WebCore/platform/graphics/qt/TileQt.cpp
@@ -0,0 +1,178 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ 
+ 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 "Tile.h"
+
+#if ENABLE(TILED_BACKING_STORE)
+
+#include "GraphicsContext.h"
+#include "TiledBackingStore.h"
+#include "TiledBackingStoreClient.h"
+#include <QApplication>
+#include <QObject>
+#include <QPainter>
+#include <QRegion>
+
+namespace WebCore {
+    
+static const unsigned checkerSize = 16;
+static const unsigned checkerColor1 = 0xff555555;
+static const unsigned checkerColor2 = 0xffaaaaaa;
+    
+static QPixmap& checkeredPixmap()
+{
+    static QPixmap* pixmap;
+    if (!pixmap) {
+        pixmap = new QPixmap(checkerSize, checkerSize);
+        QPainter painter(pixmap);
+        QColor color1(checkerColor1);
+        QColor color2(checkerColor2);
+        for (unsigned y = 0; y < checkerSize; y += checkerSize / 2) {
+            bool alternate = y % checkerSize;
+            for (unsigned x = 0; x < checkerSize; x += checkerSize / 2) {
+                painter.fillRect(x, y, checkerSize / 2, checkerSize / 2, alternate ? color1 : color2);
+                alternate = !alternate;
+            }
+        }
+    }
+    return *pixmap;
+}
+    
+Tile::Tile(TiledBackingStore* backingStore, const Coordinate& tileCoordinate)
+    : m_backingStore(backingStore)
+    , m_coordinate(tileCoordinate)
+    , m_rect(m_backingStore->tileRectForCoordinate(tileCoordinate))
+    , m_buffer(0)
+    , m_backBuffer(0)
+    , m_dirtyRegion(new QRegion(m_rect))
+{
+}
+
+Tile::~Tile()
+{
+    delete m_buffer;
+    delete m_backBuffer;
+    delete m_dirtyRegion;
+}
+
+bool Tile::isDirty() const 
+{ 
+    return !m_dirtyRegion->isEmpty(); 
+}
+
+bool Tile::isReadyToPaint() const
+{ 
+    return m_buffer; 
+}
+
+void Tile::invalidate(const IntRect& dirtyRect)
+{
+    IntRect tileDirtyRect = intersection(dirtyRect, m_rect);
+    if (tileDirtyRect.isEmpty())
+        return;
+
+    *m_dirtyRegion += tileDirtyRect;
+}
+    
+void Tile::updateBackBuffer()
+{
+    if (m_buffer && !isDirty())
+        return;
+
+    if (!m_backBuffer) {
+        if (!m_buffer)
+            m_backBuffer = new QPixmap(m_backingStore->m_tileSize.width(), m_backingStore->m_tileSize.height());
+        else {
+            // Currently all buffers are updated synchronously at the same time so there is no real need
+            // to have separate back and front buffers. Just use the existing buffer.
+            m_backBuffer = m_buffer;
+            m_buffer = 0;
+        }
+    }
+
+    QVector<QRect> dirtyRects = m_dirtyRegion->rects();
+    *m_dirtyRegion = QRegion();
+    
+    QPainter painter(m_backBuffer);
+    GraphicsContext context(&painter);
+    context.translate(-m_rect.x(), -m_rect.y());
+
+    int size = dirtyRects.size();
+    for (int n = 0; n < size; ++n)  {
+        context.save();
+        IntRect rect = dirtyRects[n];
+        context.clip(FloatRect(rect));
+        context.scale(FloatSize(m_backingStore->m_contentsScale, m_backingStore->m_contentsScale));
+        m_backingStore->m_client->tiledBackingStorePaint(&context, m_backingStore->mapToContents(rect));
+        context.restore();
+    }
+}
+
+void Tile::swapBackBufferToFront()
+{
+    if (!m_backBuffer)
+        return;
+    delete m_buffer;
+    m_buffer = m_backBuffer;
+    m_backBuffer = 0;
+}
+
+void Tile::paint(GraphicsContext* context, const IntRect& rect)
+{
+    if (!m_buffer)
+        return;
+    
+    IntRect target = intersection(rect, m_rect);
+    IntRect source((target.x() - m_rect.x()),
+                   (target.y() - m_rect.y()),
+                   target.width(),
+                   target.height());
+    
+    context->platformContext()->drawPixmap(target, *m_buffer, source);
+}
+    
+void Tile::paintCheckerPattern(GraphicsContext* context, const FloatRect& target)
+{
+    QPainter* painter = context->platformContext();
+    QTransform worldTransform = painter->worldTransform();
+    qreal scaleX = worldTransform.m11();
+    qreal scaleY = worldTransform.m22();
+    
+    QRect targetViewRect = QRectF(target.x() * scaleX,
+                                  target.y() * scaleY,
+                                  target.width() * scaleX,
+                                  target.height() * scaleY).toAlignedRect();
+    
+    QTransform adjustedTransform(1., worldTransform.m12(), worldTransform.m13(),
+                  worldTransform.m21(), 1., worldTransform.m23(),
+                  worldTransform.m31(), worldTransform.m32(), worldTransform.m33());
+    painter->setWorldTransform(adjustedTransform);
+    
+    painter->drawTiledPixmap(targetViewRect,
+                             checkeredPixmap(),
+                             QPoint(targetViewRect.left() % checkerSize,
+                                    targetViewRect.top() % checkerSize));
+    
+    painter->setWorldTransform(worldTransform);
+}
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index cd86e6d..cc4ca2e 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -33,6 +33,8 @@
 #include "Image.h"
 #include "NativeImageSkia.h"
 
+#include <algorithm>
+
 namespace WebCore {
 
 bool GraphicsContext3D::getImageData(Image* image,
@@ -59,13 +61,17 @@
     ASSERT(rowBytes == width * 4);
     uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels());
     outputVector.resize(rowBytes * height);
-    memcpy(outputVector.data(), pixels, rowBytes * height);
+    int size = rowBytes * height;
+    memcpy(outputVector.data(), pixels, size);
     *hasAlphaChannel = true;
     if (!premultiplyAlpha)
         // FIXME: must fetch the image data before the premultiplication step
         *neededAlphaOp = kAlphaDoUnmultiply;
-    // FIXME: remove this dependency on desktop OpenGL
-    *format = 0x80E1; // GL_BGRA
+    // Convert from BGRA to RGBA. FIXME: add GL_BGRA extension support
+    // to all underlying OpenGL implementations.
+    for (int i = 0; i < size; i += 4)
+        std::swap(outputVector[i], outputVector[i + 2]);
+    *format = RGBA;
     return true;
 }
 
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index ba9f824..b1bfbdd 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -457,8 +457,7 @@
 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create(const SkBitmap& bitmap)
 {
     RefPtr<BitmapImageSingleFrameSkia> image(adoptRef(new BitmapImageSingleFrameSkia()));
-    if (!bitmap.copyTo(&image->m_nativeImage, bitmap.config()))
-        return 0;
+    bitmap.copyTo(&image->m_nativeImage, bitmap.config());
     return image.release();
 }
 
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.cpp b/WebCore/platform/graphics/transforms/AffineTransform.cpp
index d6688d2..be18e07 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.cpp
+++ b/WebCore/platform/graphics/transforms/AffineTransform.cpp
@@ -314,14 +314,28 @@
         return mappedRect;
     }
 
-    FloatQuad q(rect);
+    FloatQuad result;
+    result.setP1(mapPoint(rect.location()));
+    result.setP2(mapPoint(FloatPoint(rect.right(), rect.y())));
+    result.setP3(mapPoint(FloatPoint(rect.right(), rect.bottom())));
+    result.setP4(mapPoint(FloatPoint(rect.x(), rect.bottom())));
+    return result.boundingBox();
+}
+
+FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const
+{
+    if (isIdentityOrTranslation()) {
+        FloatQuad mappedQuad(q);
+        mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
+        return mappedQuad;
+    }
 
     FloatQuad result;
     result.setP1(mapPoint(q.p1()));
     result.setP2(mapPoint(q.p2()));
     result.setP3(mapPoint(q.p3()));
     result.setP4(mapPoint(q.p4()));
-    return result.boundingBox();
+    return result;
 }
 
 void AffineTransform::blend(const AffineTransform& from, double progress)
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.h b/WebCore/platform/graphics/transforms/AffineTransform.h
index 00631c2..289ec54 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.h
+++ b/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -36,6 +36,8 @@
 #include <CoreGraphics/CGAffineTransform.h>
 #elif PLATFORM(CAIRO)
 #include <cairo.h>
+#elif PLATFORM(OPENVG)
+#include "VGUtils.h"
 #elif PLATFORM(QT)
 #include <QTransform>
 #elif PLATFORM(SKIA)
@@ -74,6 +76,7 @@
     IntRect mapRect(const IntRect&) const;
 
     FloatRect mapRect(const FloatRect&) const;
+    FloatQuad mapQuad(const FloatQuad&) const;
 
     bool isIdentity() const;
 
@@ -120,6 +123,11 @@
     {
         return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && m_transform[3] == 1;
     }
+    
+    bool isIdentityOrTranslationOrFlipped() const
+    {
+        return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && (m_transform[3] == 1 || m_transform[3] == -1);
+    }
 
     bool operator== (const AffineTransform& m2) const
     {
@@ -152,6 +160,8 @@
     operator CGAffineTransform() const;
 #elif PLATFORM(CAIRO)
     operator cairo_matrix_t() const;
+#elif PLATFORM(OPENVG)
+    operator VGMatrix() const;
 #elif PLATFORM(QT)
     operator QTransform() const;
 #elif PLATFORM(SKIA)
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index 8ed8712..e4eb159 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -321,12 +321,9 @@
         ASSERT_NOT_REACHED();
     }
 
-    if (font->platformData().useGDI()) {
-        static bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
-        if (!shouldUseFontSmoothing || !canCreateCGFontWithLOGFONT && (graphicsContext->textDrawingMode() & cTextStroke)) {
-            drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
-            return;
-        }
+    if (font->platformData().useGDI() && !shouldUseFontSmoothing) {
+        drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
+        return;
     }
 
     uint32_t oldFontSmoothingStyle = wkSetFontSmoothingStyle(cgContext, shouldUseFontSmoothing);
diff --git a/WebCore/platform/graphics/win/FontCacheWin.cpp b/WebCore/platform/graphics/win/FontCacheWin.cpp
index 8869a90..d050243 100644
--- a/WebCore/platform/graphics/win/FontCacheWin.cpp
+++ b/WebCore/platform/graphics/win/FontCacheWin.cpp
@@ -301,22 +301,68 @@
     return 0;
 }
 
+static SimpleFontData* fontDataFromDescriptionAndLogFont(FontCache* fontCache, const FontDescription& fontDescription, const LOGFONT& font, AtomicString& outFontFamilyName)
+{
+    AtomicString familyName = String(font.lfFaceName, wcsnlen(font.lfFaceName, LF_FACESIZE));
+    SimpleFontData* fontData = fontCache->getCachedFontData(fontDescription, familyName);
+    if (fontData)
+        outFontFamilyName = familyName;
+    return fontData;
+}
+
 SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription)
 {
+    DEFINE_STATIC_LOCAL(AtomicString, fallbackFontName, ());
+    if (!fallbackFontName.isEmpty())
+        return getCachedFontData(fontDescription, fallbackFontName);
+
     // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
     // the default that the user would get without changing any prefs.
-    static AtomicString timesStr("Times New Roman");
-    if (SimpleFontData* simpleFont = getCachedFontData(fontDescription, timesStr))
-        return simpleFont;
 
-    DEFINE_STATIC_LOCAL(String, defaultGUIFontFamily, ());
-    if (defaultGUIFontFamily.isEmpty()) {
-        HFONT defaultGUIFont = static_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT));
-        LOGFONT logFont;
-        GetObject(defaultGUIFont, sizeof(logFont), &logFont);
-        defaultGUIFontFamily = String(logFont.lfFaceName, wcsnlen(logFont.lfFaceName, LF_FACESIZE));
+    // Search all typical Windows-installed full Unicode fonts.
+    // Sorted by most to least glyphs according to http://en.wikipedia.org/wiki/Unicode_typefaces
+    // Start with Times New Roman also since it is the default if the user doesn't change prefs.
+    static AtomicString fallbackFonts[] = {
+        AtomicString("Times New Roman"),
+        AtomicString("Microsoft Sans Serif"),
+        AtomicString("Tahoma"),
+        AtomicString("Lucida Sans Unicode"),
+        AtomicString("Arial")
+    };
+    SimpleFontData* simpleFont;
+    for (int i = 0; i < ARRAYSIZE(fallbackFonts); ++i) {
+        if (simpleFont = getCachedFontData(fontDescription, fallbackFonts[i])) {
+            fallbackFontName = fallbackFonts[i];
+            return simpleFont;
+        }
     }
-    return getCachedFontData(fontDescription, defaultGUIFontFamily);
+
+    // Fall back to the DEFAULT_GUI_FONT if no known Unicode fonts are available.
+    if (HFONT defaultGUIFont = static_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT))) {
+        LOGFONT defaultGUILogFont;
+        GetObject(defaultGUIFont, sizeof(defaultGUILogFont), &defaultGUILogFont);
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, defaultGUILogFont, fallbackFontName))
+            return simpleFont;
+    }
+
+    // Fall back to Non-client metrics fonts.
+    NONCLIENTMETRICS nonClientMetrics = {0};
+    nonClientMetrics.cbSize = sizeof(nonClientMetrics);
+    if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nonClientMetrics), &nonClientMetrics, 0)) {
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, nonClientMetrics.lfMessageFont, fallbackFontName))
+            return simpleFont;
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, nonClientMetrics.lfMenuFont, fallbackFontName))
+            return simpleFont;
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, nonClientMetrics.lfStatusFont, fallbackFontName))
+            return simpleFont;
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, nonClientMetrics.lfCaptionFont, fallbackFontName))
+            return simpleFont;
+        if (simpleFont = fontDataFromDescriptionAndLogFont(this, fontDescription, nonClientMetrics.lfSmCaptionFont, fallbackFontName))
+            return simpleFont;
+    }
+    
+    ASSERT_NOT_REACHED();
+    return 0;
 }
 
 static LONG toGDIFontWeight(FontWeight fontWeight)
@@ -517,14 +563,9 @@
     // This masks rounding errors related to the HFONT metrics being  different from the CGFont metrics.
     // FIXME: We will eventually want subpixel precision for GDI mode, but the scaled rendering doesn't
     // look as nice. That may be solvable though.
-#if PLATFORM(CG)
-    bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
-#else
-    bool canCreateCGFontWithLOGFONT = true;
-#endif
     LONG weight = adjustedGDIFontWeight(toGDIFontWeight(fontDescription.weight()), family);
     HFONT hfont = createGDIFont(family, weight, fontDescription.italic(),
-                                fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI && canCreateCGFontWithLOGFONT);
+                                fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI);
 
     if (!hfont)
         return 0;
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
index b2d1b32..e9f83ab 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
@@ -48,7 +48,6 @@
 
 FontCustomPlatformData::~FontCustomPlatformData()
 {
-    CGFontRelease(m_cgFont);
     if (m_fontReference) {
         if (m_name.isNull()) {
             ASSERT(T2embedLibrary());
@@ -61,7 +60,6 @@
 
 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
 {
-    ASSERT(wkCanCreateCGFontWithLOGFONT() || m_cgFont);
     ASSERT(m_fontReference);
     ASSERT(T2embedLibrary());
 
@@ -88,35 +86,8 @@
 
     HFONT hfont = CreateFontIndirect(&logFont);
 
-    if (wkCanCreateCGFontWithLOGFONT()) {
-        RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
-        return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
-    }
-
-    wkSetFontPlatformInfo(m_cgFont, &logFont, free);
-    return FontPlatformData(hfont, m_cgFont, size, bold, italic, renderingMode == AlternateRenderingMode);
-}
-
-const void* getData(void* info)
-{
-    SharedBuffer* buffer = static_cast<SharedBuffer*>(info);
-    buffer->ref();
-    return (void*)buffer->data();
-}
-
-void releaseData(void* info, const void* data)
-{
-    static_cast<SharedBuffer*>(info)->deref();
-}
-
-size_t getBytesWithOffset(void *info, void* buffer, size_t offset, size_t count)
-{
-    SharedBuffer* sharedBuffer = static_cast<SharedBuffer*>(info);
-    size_t availBytes = count;
-    if (offset + count > sharedBuffer->size())
-        availBytes -= (offset + count) - sharedBuffer->size();
-    memcpy(buffer, sharedBuffer->data() + offset, availBytes);
-    return availBytes;
+    RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
+    return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
 }
 
 // Streams the concatenation of a header and font data.
@@ -196,16 +167,6 @@
     ASSERT_ARG(buffer, buffer);
     ASSERT(T2embedLibrary());
 
-    RetainPtr<CGFontRef> cgFont;
-    if (!wkCanCreateCGFontWithLOGFONT()) {
-        // Get CG to create the font.
-        CGDataProviderDirectAccessCallbacks callbacks = { &getData, &releaseData, &getBytesWithOffset, NULL };
-        RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateDirectAccess(buffer, buffer->size(), &callbacks));
-        cgFont.adoptCF(CGFontCreateWithDataProvider(dataProvider.get()));
-        if (!cgFont)
-            return 0;
-    }
-
     // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's
     // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
     // entire process first). TTLoadEmbeddedFont lets us override the font family name, so using a unique name
@@ -236,7 +197,7 @@
             return 0;
     }
 
-    return new FontCustomPlatformData(cgFont.releaseRef(), fontReference, fontName);
+    return new FontCustomPlatformData(fontReference, fontName);
 }
 
 }
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.h b/WebCore/platform/graphics/win/FontCustomPlatformData.h
index 34a9851..f75f12a 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.h
@@ -33,9 +33,8 @@
 class SharedBuffer;
 
 struct FontCustomPlatformData : Noncopyable {
-    FontCustomPlatformData(CGFontRef cgFont, HANDLE fontReference, const String& name)
-        : m_cgFont(cgFont)
-        , m_fontReference(fontReference)
+    FontCustomPlatformData(HANDLE fontReference, const String& name)
+        : m_fontReference(fontReference)
         , m_name(name)
     {
     }
@@ -44,7 +43,6 @@
 
     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
 
-    CGFontRef m_cgFont;
     HANDLE m_fontReference;
     String m_name;
 };
diff --git a/WebCore/platform/graphics/win/FontDatabase.cpp b/WebCore/platform/graphics/win/FontDatabase.cpp
deleted file mode 100644
index 22ad4a6..0000000
--- a/WebCore/platform/graphics/win/FontDatabase.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "FontDatabase.h"
-
-#include "CString.h"
-#include "FileSystem.h"
-#include "PlatformString.h"
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#include <shlobj.h>
-#include <wtf/RetainPtr.h>
-
-namespace WebCore {
-
-static String systemFontsDirectory()
-{
-    static bool initialized;
-    static String directory;
-
-    if (!initialized) {
-        initialized = true;
-
-        Vector<UChar> buffer(MAX_PATH);
-        if (FAILED(SHGetFolderPath(0, CSIDL_FONTS | CSIDL_FLAG_CREATE, 0, 0, buffer.data())))
-            return directory;
-        buffer.resize(wcslen(buffer.data()));
-
-        directory = String::adopt(buffer);
-    }
-
-    return directory;
-}
-
-static String fontsPlistPath()
-{
-    static String path = pathByAppendingComponent(localUserSpecificStorageDirectory(), "FontsList.plist");
-    return path;
-}
-
-static bool systemHasFontsNewerThanFontsPlist()
-{
-    WIN32_FILE_ATTRIBUTE_DATA plistAttributes = {0};
-    if (!GetFileAttributesEx(fontsPlistPath().charactersWithNullTermination(), GetFileExInfoStandard, &plistAttributes))
-        return true;
-
-    WIN32_FILE_ATTRIBUTE_DATA fontsDirectoryAttributes = {0};
-    if (!GetFileAttributesEx(systemFontsDirectory().charactersWithNullTermination(), GetFileExInfoStandard, &fontsDirectoryAttributes))
-        return true;
-
-    return CompareFileTime(&plistAttributes.ftLastWriteTime, &fontsDirectoryAttributes.ftLastWriteTime) < 0;
-}
-
-static RetainPtr<CFPropertyListRef> readFontPlist()
-{
-    CString plistPath = fontsPlistPath().utf8();
-
-    RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateFromFileSystemRepresentation(0, reinterpret_cast<const UInt8*>(plistPath.data()), plistPath.length(), false));
-    if (!url)
-        return 0;
-
-    RetainPtr<CFReadStreamRef> stream(AdoptCF, CFReadStreamCreateWithFile(0, url.get()));
-    if (!stream)
-        return 0;
-
-    if (!CFReadStreamOpen(stream.get()))
-        return 0;
-
-    CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0;
-    RetainPtr<CFPropertyListRef> plist(AdoptCF, CFPropertyListCreateFromStream(0, stream.get(), 0, kCFPropertyListMutableContainersAndLeaves, &format, 0));
-
-    CFReadStreamClose(stream.get());
-
-    return plist;
-}
-
-static bool populateFontDatabaseFromPlist(CFPropertyListRef plist)
-{
-    if (!plist)
-        return false;
-
-    wkAddFontsFromPlist(plist);
-    return true;
-}
-
-static bool populateFontDatabaseFromFileSystem()
-{
-    RetainPtr<CFStringRef> directory(AdoptCF, systemFontsDirectory().createCFString());
-    if (!directory)
-        return false;
-
-    wkAddFontsInDirectory(directory.get());
-    return true;
-}
-
-static CFStringRef fontFilenamesFromRegistryKey()
-{
-    static CFStringRef key = CFSTR("WebKitFontFilenamesFromRegistry");
-    return key;
-}
-
-static void writeFontDatabaseToPlist(CFPropertyListRef cgFontDBPropertyList, CFPropertyListRef filenamesFromRegistry)
-{
-    if (!cgFontDBPropertyList)
-        return;
-
-    RetainPtr<CFDataRef> data;
-
-    if (!filenamesFromRegistry || CFGetTypeID(cgFontDBPropertyList) != CFDictionaryGetTypeID())
-        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, cgFontDBPropertyList));
-    else {
-        RetainPtr<CFMutableDictionaryRef> dictionary(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, static_cast<CFDictionaryRef>(cgFontDBPropertyList)));
-        CFDictionarySetValue(dictionary.get(), fontFilenamesFromRegistryKey(), filenamesFromRegistry);
-        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get()));
-    }
-
-    if (!data)
-        return;
-
-    safeCreateFile(fontsPlistPath(), data.get());
-}
-
-static RetainPtr<CFArrayRef> fontFilenamesFromRegistry()
-{
-    RetainPtr<CFMutableArrayRef> filenames(AdoptCF, CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
-
-    HKEY key;
-    if (FAILED(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"), 0, KEY_READ, &key)))
-        return filenames;
-
-    DWORD valueCount;
-    DWORD maxNameLength;
-    DWORD maxValueLength;
-    if (FAILED(RegQueryInfoKey(key, 0, 0, 0, 0, 0, 0, &valueCount, &maxNameLength, &maxValueLength, 0, 0))) {
-        RegCloseKey(key);
-        return filenames;
-    }
-
-    Vector<TCHAR> name(maxNameLength + 1);
-    Vector<BYTE> value(maxValueLength + 1);
-
-    for (size_t i = 0; i < valueCount; ++i) {
-        DWORD nameLength = name.size();
-        DWORD valueLength = value.size();
-        DWORD type;
-        if (FAILED(RegEnumValue(key, i, name.data(), &nameLength, 0, &type, value.data(), &valueLength)))
-            continue;
-        if (type != REG_SZ)
-            continue;
-
-        RetainPtr<CFDataRef> filename(AdoptCF, CFDataCreate(kCFAllocatorDefault, value.data(), valueLength));
-        CFArrayAppendValue(filenames.get(), filename.get());
-    }
-
-    RegCloseKey(key);
-    return filenames;
-}
-
-void populateFontDatabase()
-{
-    static bool initialized;
-    if (initialized)
-        return;
-    initialized = true;
-
-    if (wkCanCreateCGFontWithLOGFONT())
-        return;
-
-    RetainPtr<CFPropertyListRef> propertyList = readFontPlist();
-    RetainPtr<CFArrayRef> lastFilenamesFromRegistry;
-    if (propertyList && CFGetTypeID(propertyList.get()) == CFDictionaryGetTypeID()) {
-        CFDictionaryRef dictionary = static_cast<CFDictionaryRef>(propertyList.get());
-        CFArrayRef array = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionary, fontFilenamesFromRegistryKey()));
-        if (array && CFGetTypeID(array) == CFArrayGetTypeID())
-            lastFilenamesFromRegistry = array;
-    }
-    RetainPtr<CFArrayRef> currentFilenamesFromRegistry = fontFilenamesFromRegistry();
-    bool registryChanged = !lastFilenamesFromRegistry || !CFEqual(lastFilenamesFromRegistry.get(), currentFilenamesFromRegistry.get());
-
-    if (!registryChanged && !systemHasFontsNewerThanFontsPlist()) {
-        if (populateFontDatabaseFromPlist(propertyList.get()))
-            return;
-    }
-
-    if (populateFontDatabaseFromFileSystem()) {
-        wkAddFontsFromRegistry();
-        RetainPtr<CFPropertyListRef> cgFontDBPropertyList(AdoptCF, wkCreateFontsPlist());
-        writeFontDatabaseToPlist(cgFontDBPropertyList.get(), currentFilenamesFromRegistry.get());
-    }
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/graphics/win/FontDatabase.h b/WebCore/platform/graphics/win/FontDatabase.h
deleted file mode 100644
index 4f76c9e..0000000
--- a/WebCore/platform/graphics/win/FontDatabase.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2007 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 FontDatabase_h
-#define FontDatabase_h
-
-namespace WebCore {
-
-    void populateFontDatabase();
-
-} // namespace WebCore
-
-#endif // !defined(FontDatabase_h)
diff --git a/WebCore/platform/graphics/win/FontPlatformData.h b/WebCore/platform/graphics/win/FontPlatformData.h
deleted file mode 100644
index 5084469..0000000
--- a/WebCore/platform/graphics/win/FontPlatformData.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * This file is part of the internal font implementation.  It should not be included by anyone other than
- * FontMac.cpp, FontWin.cpp and Font.cpp.
- *
- * Copyright (C) 2006, 2007, 2008 Apple Inc.
- *
- * 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 FontPlatformData_H
-#define FontPlatformData_H
-
-#include "StringImpl.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/RefCounted.h>
-
-#if PLATFORM(CAIRO)
-#include <cairo-win32.h>
-#endif
-
-typedef struct HFONT__* HFONT;
-typedef struct CGFont* CGFontRef;
-
-namespace WebCore {
-
-class FontDescription;
-class String;
-
-class FontPlatformData {
-public:
-    FontPlatformData()
-#if PLATFORM(CAIRO)
-        : m_fontFace(0)
-        , m_scaledFont(0)
-        ,
-#else
-        :
-#endif
-          m_size(0)
-        , m_syntheticBold(false)
-        , m_syntheticOblique(false)
-        , m_useGDI(false)
-    {
-    }
-
-    FontPlatformData(HFONT, float size, bool bold, bool oblique, bool useGDI);
-    FontPlatformData(float size, bool bold, bool oblique);
-
-#if PLATFORM(CG)
-    FontPlatformData(HFONT, CGFontRef, float size, bool bold, bool oblique, bool useGDI);
-#elif PLATFORM(CAIRO)
-    FontPlatformData(cairo_font_face_t*, float size, bool bold, bool oblique);
-    FontPlatformData(const FontPlatformData&);
-
-    FontPlatformData& operator=(const FontPlatformData&);
-#endif
-    ~FontPlatformData();
-
-    FontPlatformData(WTF::HashTableDeletedValueType) : m_font(WTF::HashTableDeletedValue) { }
-    bool isHashTableDeletedValue() const { return m_font.isHashTableDeletedValue(); }
-
-    HFONT hfont() const { return m_font->hfont(); }
-#if PLATFORM(CG)
-    CGFontRef cgFont() const { return m_cgFont.get(); }
-#elif PLATFORM(CAIRO)
-    cairo_font_face_t* fontFace() const { return m_fontFace; }
-    cairo_scaled_font_t* scaledFont() const { return m_scaledFont; }
-#endif
-
-    float size() const { return m_size; }
-    void setSize(float size) { m_size = size; }
-    bool syntheticBold() const { return m_syntheticBold; }
-    bool syntheticOblique() const { return m_syntheticOblique; }
-    bool useGDI() const { return m_useGDI; }
-
-    unsigned hash() const
-    {
-        return m_font->hash();
-    }
-
-    bool operator==(const FontPlatformData& other) const
-    { 
-        return m_font == other.m_font &&
-#if PLATFORM(CG)
-               m_cgFont == other.m_cgFont &&
-#elif PLATFORM(CAIRO)
-               m_fontFace == other.m_fontFace &&
-               m_scaledFont == other.m_scaledFont &&
-#endif
-               m_size == other.m_size &&
-               m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique &&
-               m_useGDI == other.m_useGDI;
-    }
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-private:
-    class RefCountedHFONT : public RefCounted<RefCountedHFONT> {
-    public:
-        static PassRefPtr<RefCountedHFONT> create(HFONT hfont) { return adoptRef(new RefCountedHFONT(hfont)); }
-        static PassRefPtr<RefCountedHFONT> createDeleted() { return adoptRef(new RefCountedHFONT(reinterpret_cast<HFONT>(-1))); }
-
-            ~RefCountedHFONT() { if (m_hfont != reinterpret_cast<HFONT>(-1)) DeleteObject(m_hfont); }
-
-        HFONT hfont() const { return m_hfont; }
-        unsigned hash() const
-        {
-            return StringImpl::computeHash(reinterpret_cast<const UChar*>(&m_hfont), sizeof(HFONT) / sizeof(UChar));
-        }
-
-    private:
-        RefCountedHFONT(HFONT hfont)
-            : m_hfont(hfont)
-        {
-        }
-
-        HFONT m_hfont;
-    };
-
-    void platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName);
-
-    RefPtr<RefCountedHFONT> m_font;
-#if PLATFORM(CG)
-    RetainPtr<CGFontRef> m_cgFont;
-#elif PLATFORM(CAIRO)
-    cairo_font_face_t* m_fontFace;
-    cairo_scaled_font_t* m_scaledFont;
-#endif
-
-    float m_size;
-    bool m_syntheticBold;
-    bool m_syntheticOblique;
-    bool m_useGDI;
-};
-
-}
-
-#endif
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
index d605cf9..ed9073f 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
@@ -1,5 +1,5 @@
 /*
- * This file is part of the internal font implementation.  It should not be included by anyone other than
+ * This file is part of the internal font implementation. It should not be included by anyone other than
  * FontMac.cpp, FontWin.cpp and Font.cpp.
  *
  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.
@@ -109,29 +109,9 @@
 
 void FontPlatformData::platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName)
 {
-    if (wkCanCreateCGFontWithLOGFONT()) {
-        LOGFONT logfont;
-        GetObject(font, sizeof(logfont), &logfont);
-        m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
-        return;
-    }
-
-    // Try the face name first.  Windows may end up localizing this name, and CG doesn't know about
-    // the localization.  If the create fails, we'll try the PostScript name.
-    RetainPtr<CFStringRef> fullName(AdoptCF, CFStringCreateWithCharacters(NULL, (const UniChar*)faceName, wcslen(faceName)));
-    m_cgFont.adoptCF(CGFontCreateWithFontName(fullName.get()));
-    if (!m_cgFont) {
-        CFStringRef postScriptName = getPostScriptName(fullName.get(), hdc);
-        if (postScriptName) {
-            m_cgFont.adoptCF(CGFontCreateWithFontName(postScriptName));
-            ASSERT(m_cgFont);
-        }
-    }
-    if (m_useGDI) {
-        LOGFONT* logfont = static_cast<LOGFONT*>(malloc(sizeof(LOGFONT)));
-        GetObject(font, sizeof(*logfont), logfont);
-        wkSetFontPlatformInfo(m_cgFont.get(), logfont, free);
-    }
+    LOGFONT logfont;
+    GetObject(font, sizeof(logfont), &logfont);
+    m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
 }
 
 FontPlatformData::FontPlatformData(HFONT hfont, CGFontRef font, float size, bool bold, bool oblique, bool useGDI)
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
index 9fce68a..9b916bd 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2006, 2007, 2008 Apple Inc.
  * Copyright (C) 2007 Alp Toker
- * Copyright (C) 2008 Brent Fulgham
+ * Copyright (C) 2008, 2010 Brent Fulgham
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -34,7 +34,7 @@
 
 #include <cairo-win32.h>
 
-using std::min;
+using namespace std;
 
 namespace WebCore {
 
@@ -47,8 +47,7 @@
     cairo_matrix_init_scale(&sizeMatrix, size, size);
 
     static cairo_font_options_t* fontOptions = 0;
-    if (!fontOptions)
-    {
+    if (!fontOptions) {
        fontOptions = cairo_font_options_create();
        cairo_font_options_set_antialias(fontOptions, CAIRO_ANTIALIAS_SUBPIXEL);
     }
@@ -130,4 +129,15 @@
     return *this;
 }
 
+bool FontPlatformData::operator==(const FontPlatformData& other) const
+{ 
+    return m_font == other.m_font
+        && m_fontFace == other.m_fontFace
+        && m_scaledFont == other.m_scaledFont
+        && m_size == other.m_size
+        && m_syntheticBold == other.m_syntheticBold
+        && m_syntheticOblique == other.m_syntheticOblique
+        && m_useGDI == other.m_useGDI;
+}
+
 }
diff --git a/WebCore/platform/graphics/win/FontWin.cpp b/WebCore/platform/graphics/win/FontWin.cpp
index 27d8dee..717171f 100644
--- a/WebCore/platform/graphics/win/FontWin.cpp
+++ b/WebCore/platform/graphics/win/FontWin.cpp
@@ -34,6 +34,8 @@
 #include "UniscribeController.h"
 #include <wtf/MathExtras.h>
 
+using namespace std;
+
 namespace WebCore {
 
 bool Font::canReturnFallbackFontsForComplexText()
@@ -89,10 +91,16 @@
     drawGlyphBuffer(context, glyphBuffer, run, startPoint);
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     UniscribeController controller(this, run, fallbackFonts);
     controller.advance(run.length());
+    if (glyphOverflow) {
+        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - ascent());
+        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(controller.maxGlyphBoundingBoxY()) - descent());
+        glyphOverflow->left = max<int>(0, ceilf(-controller.minGlyphBoundingBoxX()));
+        glyphOverflow->right = max<int>(0, ceilf(controller.maxGlyphBoundingBoxX() - controller.runWidthSoFar()));
+    }
     return controller.runWidthSoFar();
 }
 
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index 49b5af3..0065191 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -29,21 +29,132 @@
 
 #include "GraphicsLayerCACF.h"
 
-#include "CString.h"
 #include "FloatConversion.h"
 #include "FloatRect.h"
+#include "Font.h"
+#include "FontSelector.h"
 #include "Image.h"
 #include "PlatformString.h"
 #include "SystemTime.h"
 #include "WKCACFLayer.h"
-#include <QuartzCoreInterface/QuartzCoreInterface.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/StringExtras.h>
+#include <wtf/text/CString.h>
 
 using namespace std;
 
 namespace WebCore {
 
+class WebLayer : public WKCACFLayer {
+public:
+    static PassRefPtr<WKCACFLayer> create(LayerType layerType, GraphicsLayerCACF* owner)
+    {
+        return adoptRef(new WebLayer(layerType, owner));
+    }
+
+    virtual void setNeedsDisplay(const CGRect* dirtyRect)
+    {
+        if (m_owner) {
+            if (m_owner->showRepaintCounter()) {
+                CGRect layerBounds = bounds();
+                CGRect repaintCounterRect = layerBounds;
+                // We assume a maximum of 4 digits and a font size of 22.
+                repaintCounterRect.size.width = 48;
+                repaintCounterRect.size.height = 25;
+                if (m_owner->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown)
+                    repaintCounterRect.origin.y = layerBounds.size.height - (layerBounds.origin.y + repaintCounterRect.size.height);
+                WKCACFLayer::setNeedsDisplay(&repaintCounterRect);
+            }
+            if (dirtyRect && m_owner->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) {
+                CGRect flippedDirtyRect = *dirtyRect;
+                flippedDirtyRect.origin.y = bounds().size.height - (flippedDirtyRect.origin.y + flippedDirtyRect.size.height);
+                WKCACFLayer::setNeedsDisplay(&flippedDirtyRect);
+                return;
+            }
+        }
+        WKCACFLayer::setNeedsDisplay(dirtyRect);
+    }
+
+    virtual void drawInContext(PlatformGraphicsContext* context)
+    {
+        if (!m_owner)
+            return;
+
+        CGContextSaveGState(context);
+
+        CGRect layerBounds = bounds();
+        if (m_owner->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) {
+            CGContextScaleCTM(context, 1, -1);
+            CGContextTranslateCTM(context, 0, -layerBounds.size.height);
+        }
+
+        if (m_owner->client()) {
+            GraphicsContext graphicsContext(context);
+
+            // It's important to get the clip from the context, because it may be significantly
+            // smaller than the layer bounds (e.g. tiled layers)
+            CGRect clipBounds = CGContextGetClipBoundingBox(context);
+            IntRect clip(enclosingIntRect(clipBounds));
+            m_owner->paintGraphicsLayerContents(graphicsContext, clip);
+        }
+#ifndef NDEBUG
+        else {
+            ASSERT_NOT_REACHED();
+
+            // FIXME: ideally we'd avoid calling -setNeedsDisplay on a layer that is a plain color,
+            // so CA never makes backing store for it (which is what -setNeedsDisplay will do above).
+            CGContextSetRGBFillColor(context, 0.0f, 1.0f, 0.0f, 1.0f);
+            CGContextFillRect(context, layerBounds);
+        }
+#endif
+
+        if (m_owner->showRepaintCounter()) {
+            String text = String::format("%d", m_owner->incrementRepaintCount());;
+
+            CGContextSaveGState(context);
+            CGContextSetRGBFillColor(context, 1.0f, 0.0f, 0.0f, 0.8f);
+            
+            CGRect aBounds = layerBounds;
+
+            aBounds.size.width = 10 + 12 * text.length();
+            aBounds.size.height = 25;
+            CGContextFillRect(context, aBounds);
+            
+            FontDescription desc;
+
+            NONCLIENTMETRICS metrics;
+            metrics.cbSize = sizeof(metrics);
+            SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
+            FontFamily family;
+            family.setFamily(metrics.lfSmCaptionFont.lfFaceName);
+            desc.setFamily(family);
+
+            desc.setComputedSize(22);
+            
+            Font font = Font(desc, 0, 0);
+            font.update(0);
+
+            GraphicsContext cg(context);
+            cg.setFillColor(Color::black, DeviceColorSpace);
+            cg.drawText(font, TextRun(text), IntPoint(aBounds.origin.x + 3, aBounds.origin.y + 20));
+
+            CGContextRestoreGState(context);        
+        }
+
+        CGContextRestoreGState(context);
+    }
+
+protected:
+    WebLayer(LayerType layerType, GraphicsLayerCACF* owner)
+     : WKCACFLayer(layerType)
+     , m_owner(owner)
+    {
+    }
+
+private:
+    GraphicsLayer* m_owner;
+};
+
 static inline void copyTransform(CATransform3D& toT3D, const TransformationMatrix& t)
 {
     toT3D.m11 = narrowPrecisionToFloat(t.m11());
@@ -124,7 +235,7 @@
     , m_contentsLayerPurpose(NoContentsLayer)
     , m_contentsLayerHasBackgroundColor(false)
 {
-    m_layer = WKCACFLayer::create(WKCACFLayer::Layer, this);
+    m_layer = WebLayer::create(WKCACFLayer::Layer, this);
     
     updateDebugIndicators();
 }
@@ -142,12 +253,12 @@
         m_transformLayer->removeFromSuperlayer();
 }
 
-void GraphicsLayerCACF::setName(const String& inName)
+void GraphicsLayerCACF::setName(const String& name)
 {
-    String name = String::format("CALayer(%p) GraphicsLayer(%p) ", m_layer.get(), this) + inName;
-    GraphicsLayer::setName(name);
+    String longName = String::format("CALayer(%p) GraphicsLayer(%p) ", m_layer.get(), this) + name;
+    GraphicsLayer::setName(longName);
     
-    m_layer->setName(inName);
+    m_layer->setName(longName);
 }
 
 NativeLayer GraphicsLayerCACF::nativeLayer() const
@@ -331,8 +442,10 @@
 
 void GraphicsLayerCACF::setNeedsDisplayInRect(const FloatRect& rect)
 {
-    if (drawsContent())
-        m_layer->setNeedsDisplay(rect);
+    if (drawsContent()) {
+        CGRect cgRect = rect;
+        m_layer->setNeedsDisplay(&cgRect);
+    }
 }
 
 void GraphicsLayerCACF::setContentsRect(const IntRect& rect)
@@ -537,7 +650,7 @@
 {
     if (m_preserves3D && !m_transformLayer) {
         // Create the transform layer.
-        m_transformLayer = WKCACFLayer::create(WKCACFLayer::TransformLayer, this);
+        m_transformLayer = WebLayer::create(WKCACFLayer::TransformLayer, this);
 
 #ifndef NDEBUG
         m_transformLayer->setName(String().format("Transform Layer CATransformLayer(%p) GraphicsLayer(%p)", m_transformLayer.get(), this));
@@ -553,7 +666,7 @@
         m_layer->setPosition(point);
 
         m_layer->setAnchorPoint(CGPointMake(0.5f, 0.5f));
-        m_layer->setTransform(wkqcCATransform3DIdentity());
+        m_layer->setTransform(CATransform3DIdentity);
         
         // Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer.
         m_layer->setOpacity(1);
@@ -610,7 +723,7 @@
 {
     if (m_pendingContentsImage) {
         if (!m_contentsLayer.get()) {
-            RefPtr<WKCACFLayer> imageLayer = WKCACFLayer::create(WKCACFLayer::Layer, this);
+            RefPtr<WKCACFLayer> imageLayer = WebLayer::create(WKCACFLayer::Layer, this);
 #ifndef NDEBUG
             imageLayer->setName("Image Layer");
 #endif
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.h b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
index 0a52764..8c3f848 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.h
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
@@ -91,8 +91,6 @@
 
     virtual void setGeometryOrientation(CompositingCoordinatesOrientation);
 
-    void notifySyncRequired() { if (m_client) m_client->notifySyncRequired(this); }
-
 private:
     void updateOpacityOnLayer();
 
diff --git a/WebCore/platform/graphics/win/ImageCGWin.cpp b/WebCore/platform/graphics/win/ImageCGWin.cpp
index 2c6d41d..a0fbba7 100644
--- a/WebCore/platform/graphics/win/ImageCGWin.cpp
+++ b/WebCore/platform/graphics/win/ImageCGWin.cpp
@@ -25,13 +25,14 @@
 
 #include "config.h"
 #include "Image.h"
+
 #include "BitmapImage.h"
 #include "BitmapInfo.h"
 #include "GraphicsContext.h"
-#include <ApplicationServices/ApplicationServices.h>
-
-#include <windows.h>
 #include "PlatformString.h"
+#include <ApplicationServices/ApplicationServices.h>
+#include <windows.h>
+#include <wtf/RetainPtr.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
index 1df73a7..c848eb3 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
@@ -28,13 +28,20 @@
 #if ENABLE(VIDEO)
 #include "MediaPlayerPrivateQuickTimeWin.h"
 
+#include "Cookie.h"
+#include "CookieJar.h"
+#include "Frame.h"
+#include "FrameView.h"
 #include "GraphicsContext.h"
 #include "KURL.h"
 #include "QTMovieWin.h"
 #include "ScrollView.h"
+#include "SoftLinking.h"
+#include "StringBuilder.h"
 #include "StringHash.h"
 #include "TimeRanges.h"
 #include "Timer.h"
+#include <Wininet.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
 #include <wtf/MathExtras.h>
@@ -59,6 +66,9 @@
 
 namespace WebCore {
 
+SOFT_LINK_LIBRARY(Wininet)
+SOFT_LINK(Wininet, InternetSetCookieExW, DWORD, WINAPI, (LPCWSTR lpszUrl, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, DWORD dwFlags, DWORD_PTR dwReserved), (lpszUrl, lpszCookieName, lpszCookieData, dwFlags, dwReserved))
+
 MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) 
 { 
     return new MediaPlayerPrivate(player);
@@ -111,7 +121,7 @@
 #if USE(ACCELERATED_COMPOSITING)
 PlatformLayer* MediaPlayerPrivate::platformLayer() const
 {
-    return m_qtVideoLayer->platformLayer();
+    return m_qtVideoLayer ? m_qtVideoLayer->platformLayer() : 0;
 }
 #endif
 
@@ -159,6 +169,97 @@
     QTMovieWin::taskTimerFired();
 }
 
+String MediaPlayerPrivate::rfc2616DateStringFromTime(CFAbsoluteTime time)
+{
+    static const char* const dayStrings[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
+    static const char* const monthStrings[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+    static const CFStringRef dateFormatString = CFSTR("%s, %02d %s %04d %02d:%02d:%02d GMT");
+    static CFTimeZoneRef gmtTimeZone;
+    if (!gmtTimeZone)
+        gmtTimeZone = CFTimeZoneCopyDefault();
+
+    CFGregorianDate dateValue = CFAbsoluteTimeGetGregorianDate(time, gmtTimeZone); 
+    if (!CFGregorianDateIsValid(dateValue, kCFGregorianAllUnits))
+        return String();
+
+    time = CFGregorianDateGetAbsoluteTime(dateValue, gmtTimeZone);
+    SInt32 day = CFAbsoluteTimeGetDayOfWeek(time, 0);
+
+    RetainPtr<CFStringRef> dateCFString(AdoptCF, CFStringCreateWithFormat(0, 0, dateFormatString, dayStrings[day - 1], dateValue.day, 
+        monthStrings[dateValue.month - 1], dateValue.year, dateValue.hour, dateValue.minute, (int)dateValue.second));
+    return dateCFString.get();
+}
+
+static void addCookieParam(StringBuilder& cookieBuilder, const String& name, const String& value)
+{
+    if (name.isEmpty())
+        return;
+
+    // If this isn't the first parameter added, terminate the previous one.
+    if (cookieBuilder.length())
+        cookieBuilder.append("; ");
+
+    // Add parameter name, and value if there is one.
+    cookieBuilder.append(name);
+    if (!value.isEmpty()) {
+        cookieBuilder.append("=");
+        cookieBuilder.append(value);
+    }
+}
+
+
+void MediaPlayerPrivate::setUpCookiesForQuickTime(const String& url)
+{
+    // WebCore loaded the page with the movie URL with CFNetwork but QuickTime will 
+    // use WinINet to download the movie, so we need to copy any cookies needed to
+    // download the movie into WinInet before asking QuickTime to open it.
+    Frame* frame = m_player->frameView() ? m_player->frameView()->frame() : 0;
+    if (!frame || !frame->page() || !frame->page()->cookieEnabled())
+        return;
+
+    KURL movieURL = KURL(KURL(), url);
+    Vector<Cookie> documentCookies;
+    if (!getRawCookies(frame->document(), movieURL, documentCookies))
+        return;
+
+    for (size_t ndx = 0; ndx < documentCookies.size(); ndx++) {
+        const Cookie& cookie = documentCookies[ndx];
+
+        if (cookie.name.isEmpty())
+            continue;
+
+        // Build up the cookie string with as much information as we can get so WinINet
+        // knows what to do with it.
+        StringBuilder cookieBuilder;
+        addCookieParam(cookieBuilder, cookie.name, cookie.value);
+        addCookieParam(cookieBuilder, "path", cookie.path);
+        if (cookie.expires) 
+            addCookieParam(cookieBuilder, "expires", rfc2616DateStringFromTime(cookie.expires));
+        if (cookie.httpOnly) 
+            addCookieParam(cookieBuilder, "httpOnly", String());
+        cookieBuilder.append(";");
+
+        String cookieURL;
+        if (!cookie.domain.isEmpty()) {
+            StringBuilder urlBuilder;
+
+            urlBuilder.append(movieURL.protocol());
+            urlBuilder.append("://");
+            if (cookie.domain[0] == '.')
+                urlBuilder.append(cookie.domain.substring(1));
+            else
+                urlBuilder.append(cookie.domain);
+            if (cookie.path.length() > 1)
+                urlBuilder.append(cookie.path);
+
+            cookieURL = urlBuilder.toString();
+        } else
+            cookieURL = movieURL;
+
+        InternetSetCookieExW(cookieURL.charactersWithNullTermination(), 0, cookieBuilder.toString().charactersWithNullTermination(), 0, 0);
+    }
+}
+
 void MediaPlayerPrivate::load(const String& url)
 {
     if (!QTMovieWin::initializeQuickTime()) {
@@ -181,6 +282,8 @@
     }
     cancelSeek();
 
+    setUpCookiesForQuickTime(url);
+
     m_qtMovie.set(new QTMovieWin(this));
     m_qtMovie->load(url.characters(), url.length(), m_player->preservesPitch());
     m_qtMovie->setVolume(m_player->volume());
@@ -861,14 +964,6 @@
     setUpVideoRendering();
 }
 
-void MediaPlayerPrivate::notifySyncRequired(const GraphicsLayer*)
-{
-    GraphicsLayerCACF* videoGraphicsLayer = static_cast<GraphicsLayerCACF*>(m_qtVideoLayer.get());
-    if (videoGraphicsLayer)
-        videoGraphicsLayer->notifySyncRequired();
- }
-
-
 #endif
 
 
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h
index 029a520..9de5894 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h
@@ -67,7 +67,7 @@
     // GraphicsLayerClient methods
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip);
     virtual void notifyAnimationStarted(const GraphicsLayer*, double time) { }
-    virtual void notifySyncRequired(const GraphicsLayer*);
+    virtual void notifySyncRequired(const GraphicsLayer*) { }
     virtual bool showDebugBorders() const { return false; }
     virtual bool showRepaintCounter() const { return false; }
 #endif 
@@ -158,6 +158,9 @@
     void createLayerForMovie();
     void destroyLayerForMovie();
 
+    void setUpCookiesForQuickTime(const String& url);
+    String rfc2616DateStringFromTime(CFAbsoluteTime);
+
     MediaPlayer* m_player;
     OwnPtr<QTMovieWin> m_qtMovie;
 #if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/win/RefCountedHFONT.h b/WebCore/platform/graphics/win/RefCountedHFONT.h
new file mode 100755
index 0000000..b1b691b
--- /dev/null
+++ b/WebCore/platform/graphics/win/RefCountedHFONT.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc.
+ *
+ * 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 RefCountedHFONT_h
+#define RefCountedHFONT_h
+
+#include "StringImpl.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class RefCountedHFONT : public RefCounted<RefCountedHFONT> {
+public:
+    static PassRefPtr<RefCountedHFONT> create(HFONT hfont) { return adoptRef(new RefCountedHFONT(hfont)); }
+    static PassRefPtr<RefCountedHFONT> createDeleted() { return adoptRef(new RefCountedHFONT(reinterpret_cast<HFONT>(-1))); }
+
+    ~RefCountedHFONT()
+    {
+        if (m_hfont != reinterpret_cast<HFONT>(-1))
+            DeleteObject(m_hfont);
+    }
+
+    HFONT hfont() const { return m_hfont; }
+    unsigned hash() const
+    {
+        return StringImpl::computeHash(reinterpret_cast<const UChar*>(&m_hfont), sizeof(HFONT) / sizeof(UChar));
+    }
+
+private:
+    RefCountedHFONT(HFONT hfont)
+        : m_hfont(hfont)
+    {
+    }
+
+    HFONT m_hfont;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp b/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
index 6b3a96e..ee3a980 100644
--- a/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
+++ b/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
@@ -126,10 +126,10 @@
     }
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode metricsMode) const
 {
     if (m_platformData.useGDI())
-       return widthForGDIGlyph(glyph);
+       return metricsForGDIGlyph(glyph);
 
     CGFontRef font = m_platformData.cgFont();
     float pointSize = m_platformData.size();
@@ -139,8 +139,18 @@
     // FIXME: Need to add real support for printer fonts.
     bool isPrinterFont = false;
     wkGetGlyphAdvances(font, m, m_isSystemFont, isPrinterFont, glyph, advance);
-
-    return advance.width + m_syntheticBoldOffset;
+    GlyphMetrics metrics;
+    metrics.horizontalAdvance = advance.width + m_syntheticBoldOffset;
+    
+    if (metricsMode == GlyphBoundingBox) {
+        CGRect boundingBox;
+        CGFontGetGlyphBBoxes(font, &glyph, 1, &boundingBox);
+        CGFloat scale = pointSize / unitsPerEm();
+        metrics.boundingBox = CGRectApplyAffineTransform(boundingBox, CGAffineTransformMakeScale(scale, -scale));
+        if (m_syntheticBoldOffset)
+            metrics.boundingBox.setWidth(metrics.boundingBox.width() + m_syntheticBoldOffset);
+    }
+    return metrics;
 }
 
 }
diff --git a/WebCore/platform/graphics/win/SimpleFontDataWin.cpp b/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
index 5a3244c..f85f9ba 100644
--- a/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
+++ b/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
@@ -179,16 +179,25 @@
     ReleaseDC(0, dc);
 }
 
-float SimpleFontData::widthForGDIGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::metricsForGDIGlyph(Glyph glyph) const
 {
     HDC hdc = GetDC(0);
     SetGraphicsMode(hdc, GM_ADVANCED);
     HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont());
-    int width;
-    GetCharWidthI(hdc, glyph, 1, 0, &width);
+
+    GLYPHMETRICS gdiMetrics;
+    static const MAT2 identity = { 0, 1,  0, 0,  0, 0,  0, 1 };
+    GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity);
+
     SelectObject(hdc, oldFont);
     ReleaseDC(0, hdc);
-    return width + m_syntheticBoldOffset;
+
+    GlyphMetrics glyphMetrics;
+    glyphMetrics.horizontalAdvance = gdiMetrics.gmCellIncX + m_syntheticBoldOffset;
+    glyphMetrics.boundingBox = FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y,
+        gdiMetrics.gmBlackBoxX + m_syntheticBoldOffset, gdiMetrics.gmBlackBoxY);
+
+    return glyphMetrics;
 }
 
 SCRIPT_FONTPROPERTIES* SimpleFontData::scriptFontProperties() const
diff --git a/WebCore/platform/graphics/win/UniscribeController.cpp b/WebCore/platform/graphics/win/UniscribeController.cpp
index f382857..cfa15a2 100644
--- a/WebCore/platform/graphics/win/UniscribeController.cpp
+++ b/WebCore/platform/graphics/win/UniscribeController.cpp
@@ -32,6 +32,8 @@
 #include "SimpleFontData.h"
 #include <wtf/MathExtras.h>
 
+using namespace std;
+
 namespace WebCore {
 
 // FIXME: Rearchitect this to be more like WidthIterator in Font.cpp.  Have an advance() method
@@ -39,16 +41,20 @@
 // take the GlyphBuffer as an arg so that we don't have to populate the glyph buffer when
 // measuring.
 UniscribeController::UniscribeController(const Font* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts)
-: m_font(*font)
-, m_run(run)
-, m_fallbackFonts(fallbackFonts)
-, m_end(run.length())
-, m_currentCharacter(0)
-, m_runWidthSoFar(0)
-, m_computingOffsetPosition(false)
-, m_includePartialGlyphs(false)
-, m_offsetX(0)
-, m_offsetPosition(0)
+    : m_font(*font)
+    , m_run(run)
+    , m_fallbackFonts(fallbackFonts)
+    , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
+    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
+    , m_end(run.length())
+    , m_currentCharacter(0)
+    , m_runWidthSoFar(0)
+    , m_computingOffsetPosition(false)
+    , m_includePartialGlyphs(false)
+    , m_offsetX(0)
+    , m_offsetPosition(0)
 {
     m_padding = m_run.padding();
     if (!m_padding)
@@ -374,6 +380,14 @@
             glyphBuffer->add(glyph, fontData, advance, &size);
         }
 
+        GlyphMetrics glyphMetrics = fontData->metricsForGlyph(glyph);
+        glyphMetrics.boundingBox.move(m_glyphOrigin.x(), m_glyphOrigin.y());
+        m_minGlyphBoundingBoxX = min(m_minGlyphBoundingBoxX, glyphMetrics.boundingBox.x());
+        m_maxGlyphBoundingBoxX = max(m_maxGlyphBoundingBoxX, glyphMetrics.boundingBox.right());
+        m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, glyphMetrics.boundingBox.y());
+        m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, glyphMetrics.boundingBox.bottom());
+        m_glyphOrigin.move(advance + offsetX, -offsetY);
+
         // Mutate the glyph array to contain our altered advances.
         if (m_computingOffsetPosition)
             advances[k] = advance;
diff --git a/WebCore/platform/graphics/win/UniscribeController.h b/WebCore/platform/graphics/win/UniscribeController.h
index 23b8108..09203b5 100644
--- a/WebCore/platform/graphics/win/UniscribeController.h
+++ b/WebCore/platform/graphics/win/UniscribeController.h
@@ -49,6 +49,11 @@
     // Returns the width of everything we've consumed so far.
     float runWidthSoFar() const { return m_runWidthSoFar; }
 
+    float minGlyphBoundingBoxX() const { return m_minGlyphBoundingBoxX; }
+    float maxGlyphBoundingBoxX() const { return m_maxGlyphBoundingBoxX; }
+    float minGlyphBoundingBoxY() const { return m_minGlyphBoundingBoxY; }
+    float maxGlyphBoundingBoxY() const { return m_maxGlyphBoundingBoxY; }
+
 private:    
     void resetControlAndState();
 
@@ -61,6 +66,11 @@
     const Font& m_font;
     const TextRun& m_run;
     HashSet<const SimpleFontData*>* m_fallbackFonts;
+    FloatPoint m_glyphOrigin;
+    float m_minGlyphBoundingBoxX;
+    float m_maxGlyphBoundingBoxX;
+    float m_minGlyphBoundingBoxY;
+    float m_maxGlyphBoundingBoxY;
 
     SCRIPT_CONTROL m_control;
     SCRIPT_STATE m_state;
diff --git a/WebCore/platform/graphics/win/WKCACFLayer.cpp b/WebCore/platform/graphics/win/WKCACFLayer.cpp
index e5b184d..4a0461d 100644
--- a/WebCore/platform/graphics/win/WKCACFLayer.cpp
+++ b/WebCore/platform/graphics/win/WKCACFLayer.cpp
@@ -29,68 +29,33 @@
 
 #include "WKCACFLayer.h"
 
-#include "CString.h"
 #include "WKCACFContextFlusher.h"
 #include "WKCACFLayerRenderer.h"
+#include <wtf/text/CString.h>
 
 #include <stdio.h>
 #include <QuartzCore/CACFContext.h>
 #include <QuartzCore/CARender.h>
-#include <QuartzCoreInterface/QuartzCoreInterface.h>
 
 #ifndef NDEBUG
 #include <wtf/CurrentTime.h>
 #endif
 
-#ifdef DEBUG_ALL
-#pragma comment(lib, "QuartzCore_debug")
-#pragma comment(lib, "QuartzCoreInterface_debug")
-#else
-#pragma comment(lib, "QuartzCore")
-#pragma comment(lib, "QuartzCoreInterface")
-#endif
-
 namespace WebCore {
 
 using namespace std;
 
-static void displayInContext(CACFLayerRef layer, CGContextRef context)
+static void displayCallback(CACFLayerRef layer, CGContextRef context)
 {
     ASSERT_ARG(layer, WKCACFLayer::layer(layer));
-    WKCACFLayer::layer(layer)->display(context);
+    WKCACFLayer::layer(layer)->drawInContext(context);
 }
 
-#define STATIC_CACF_STRING(name) \
-    static CFStringRef name() \
-    { \
-        static CFStringRef name = wkqcCFStringRef(wkqc##name); \
-        return name; \
-    }
-
-STATIC_CACF_STRING(kCACFLayer)
-STATIC_CACF_STRING(kCACFTransformLayer)
-STATIC_CACF_STRING(kCACFGravityCenter)
-STATIC_CACF_STRING(kCACFGravityTop)
-STATIC_CACF_STRING(kCACFGravityBottom)
-STATIC_CACF_STRING(kCACFGravityLeft)
-STATIC_CACF_STRING(kCACFGravityRight)
-STATIC_CACF_STRING(kCACFGravityTopLeft)
-STATIC_CACF_STRING(kCACFGravityTopRight)
-STATIC_CACF_STRING(kCACFGravityBottomLeft)
-STATIC_CACF_STRING(kCACFGravityBottomRight)
-STATIC_CACF_STRING(kCACFGravityResize)
-STATIC_CACF_STRING(kCACFGravityResizeAspect)
-STATIC_CACF_STRING(kCACFGravityResizeAspectFill)
-STATIC_CACF_STRING(kCACFFilterLinear)
-STATIC_CACF_STRING(kCACFFilterNearest)
-STATIC_CACF_STRING(kCACFFilterTrilinear)
-STATIC_CACF_STRING(kCACFFilterLanczos)
-
 static CFStringRef toCACFLayerType(WKCACFLayer::LayerType type)
 {
     switch (type) {
-    case WKCACFLayer::Layer: return kCACFLayer();
-    case WKCACFLayer::TransformLayer: return kCACFTransformLayer();
+    case WKCACFLayer::Layer: return kCACFLayer;
+    case WKCACFLayer::TransformLayer: return kCACFTransformLayer;
     default: return 0;
     }
 }
@@ -98,55 +63,55 @@
 static CFStringRef toCACFContentsGravityType(WKCACFLayer::ContentsGravityType type)
 {
     switch (type) {
-    case WKCACFLayer::Center: return kCACFGravityCenter();
-    case WKCACFLayer::Top: return kCACFGravityTop();
-    case WKCACFLayer::Bottom: return kCACFGravityBottom();
-    case WKCACFLayer::Left: return kCACFGravityLeft();
-    case WKCACFLayer::Right: return kCACFGravityRight();
-    case WKCACFLayer::TopLeft: return kCACFGravityTopLeft();
-    case WKCACFLayer::TopRight: return kCACFGravityTopRight();
-    case WKCACFLayer::BottomLeft: return kCACFGravityBottomLeft();
-    case WKCACFLayer::BottomRight: return kCACFGravityBottomRight();
-    case WKCACFLayer::Resize: return kCACFGravityResize();
-    case WKCACFLayer::ResizeAspect: return kCACFGravityResizeAspect();
-    case WKCACFLayer::ResizeAspectFill: return kCACFGravityResizeAspectFill();
+    case WKCACFLayer::Center: return kCACFGravityCenter;
+    case WKCACFLayer::Top: return kCACFGravityTop;
+    case WKCACFLayer::Bottom: return kCACFGravityBottom;
+    case WKCACFLayer::Left: return kCACFGravityLeft;
+    case WKCACFLayer::Right: return kCACFGravityRight;
+    case WKCACFLayer::TopLeft: return kCACFGravityTopLeft;
+    case WKCACFLayer::TopRight: return kCACFGravityTopRight;
+    case WKCACFLayer::BottomLeft: return kCACFGravityBottomLeft;
+    case WKCACFLayer::BottomRight: return kCACFGravityBottomRight;
+    case WKCACFLayer::Resize: return kCACFGravityResize;
+    case WKCACFLayer::ResizeAspect: return kCACFGravityResizeAspect;
+    case WKCACFLayer::ResizeAspectFill: return kCACFGravityResizeAspectFill;
     default: return 0;
     }
 }
 
 static WKCACFLayer::ContentsGravityType fromCACFContentsGravityType(CFStringRef string)
 {
-    if (CFEqual(string, kCACFGravityTop()))
+    if (CFEqual(string, kCACFGravityTop))
         return WKCACFLayer::Top;
 
-    if (CFEqual(string, kCACFGravityBottom()))
+    if (CFEqual(string, kCACFGravityBottom))
         return WKCACFLayer::Bottom;
 
-    if (CFEqual(string, kCACFGravityLeft()))
+    if (CFEqual(string, kCACFGravityLeft))
         return WKCACFLayer::Left;
 
-    if (CFEqual(string, kCACFGravityRight()))
+    if (CFEqual(string, kCACFGravityRight))
         return WKCACFLayer::Right;
 
-    if (CFEqual(string, kCACFGravityTopLeft()))
+    if (CFEqual(string, kCACFGravityTopLeft))
         return WKCACFLayer::TopLeft;
 
-    if (CFEqual(string, kCACFGravityTopRight()))
+    if (CFEqual(string, kCACFGravityTopRight))
         return WKCACFLayer::TopRight;
 
-    if (CFEqual(string, kCACFGravityBottomLeft()))
+    if (CFEqual(string, kCACFGravityBottomLeft))
         return WKCACFLayer::BottomLeft;
 
-    if (CFEqual(string, kCACFGravityBottomRight()))
+    if (CFEqual(string, kCACFGravityBottomRight))
         return WKCACFLayer::BottomRight;
 
-    if (CFEqual(string, kCACFGravityResize()))
+    if (CFEqual(string, kCACFGravityResize))
         return WKCACFLayer::Resize;
 
-    if (CFEqual(string, kCACFGravityResizeAspect()))
+    if (CFEqual(string, kCACFGravityResizeAspect))
         return WKCACFLayer::ResizeAspect;
 
-    if (CFEqual(string, kCACFGravityResizeAspectFill()))
+    if (CFEqual(string, kCACFGravityResizeAspectFill))
         return WKCACFLayer::ResizeAspectFill;
 
     return WKCACFLayer::Center;
@@ -155,45 +120,44 @@
 static CFStringRef toCACFFilterType(WKCACFLayer::FilterType type)
 {
     switch (type) {
-    case WKCACFLayer::Linear: return kCACFFilterLinear();
-    case WKCACFLayer::Nearest: return kCACFFilterNearest();
-    case WKCACFLayer::Trilinear: return kCACFFilterTrilinear();
-    case WKCACFLayer::Lanczos: return kCACFFilterLanczos();
+    case WKCACFLayer::Linear: return kCACFFilterLinear;
+    case WKCACFLayer::Nearest: return kCACFFilterNearest;
+    case WKCACFLayer::Trilinear: return kCACFFilterTrilinear;
+    case WKCACFLayer::Lanczos: return kCACFFilterLanczos;
     default: return 0;
     }
 }
 
 static WKCACFLayer::FilterType fromCACFFilterType(CFStringRef string)
 {
-    if (CFEqual(string, kCACFFilterNearest()))
+    if (CFEqual(string, kCACFFilterNearest))
         return WKCACFLayer::Nearest;
 
-    if (CFEqual(string, kCACFFilterTrilinear()))
+    if (CFEqual(string, kCACFFilterTrilinear))
         return WKCACFLayer::Trilinear;
 
-    if (CFEqual(string, kCACFFilterLanczos()))
+    if (CFEqual(string, kCACFFilterLanczos))
         return WKCACFLayer::Lanczos;
 
     return WKCACFLayer::Linear;
 }
 
-PassRefPtr<WKCACFLayer> WKCACFLayer::create(LayerType type, GraphicsLayerCACF* owner)
+PassRefPtr<WKCACFLayer> WKCACFLayer::create(LayerType type)
 {
     if (!WKCACFLayerRenderer::acceleratedCompositingAvailable())
         return 0;
-    return adoptRef(new WKCACFLayer(type, owner));
+    return adoptRef(new WKCACFLayer(type));
 }
 
 // FIXME: It might be good to have a way of ensuring that all WKCACFLayers eventually
 // get destroyed in debug builds. A static counter could accomplish this pretty easily.
 
-WKCACFLayer::WKCACFLayer(LayerType type, GraphicsLayerCACF* owner)
+WKCACFLayer::WKCACFLayer(LayerType type)
     : m_layer(AdoptCF, CACFLayerCreate(toCACFLayerType(type)))
     , m_needsDisplayOnBoundsChange(false)
-    , m_owner(owner)
 {
     CACFLayerSetUserData(layer(), this);
-    CACFLayerSetDisplayCallback(layer(), displayInContext);
+    CACFLayerSetDisplayCallback(layer(), displayCallback);
 }
 
 WKCACFLayer::~WKCACFLayer()
@@ -205,64 +169,6 @@
     CACFLayerSetDisplayCallback(layer(), 0);
 }
 
-void WKCACFLayer::display(PlatformGraphicsContext* context)
-{
-    if (!m_owner)
-        return;
-
-    CGContextSaveGState(context);
-
-    CGRect layerBounds = bounds();
-    if (m_owner->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) {
-        CGContextScaleCTM(context, 1, -1);
-        CGContextTranslateCTM(context, 0, -layerBounds.size.height);
-    }
-
-    if (m_owner->client()) {
-        GraphicsContext graphicsContext(context);
-
-        // It's important to get the clip from the context, because it may be significantly
-        // smaller than the layer bounds (e.g. tiled layers)
-        CGRect clipBounds = CGContextGetClipBoundingBox(context);
-        IntRect clip(enclosingIntRect(clipBounds));
-        m_owner->paintGraphicsLayerContents(graphicsContext, clip);
-    }
-#ifndef NDEBUG
-    else {
-        ASSERT_NOT_REACHED();
-
-        // FIXME: ideally we'd avoid calling -setNeedsDisplay on a layer that is a plain color,
-        // so CA never makes backing store for it (which is what -setNeedsDisplay will do above).
-        CGContextSetRGBFillColor(context, 0.0f, 1.0f, 0.0f, 1.0f);
-        CGContextFillRect(context, layerBounds);
-    }
-#endif
-
-    if (m_owner->showRepaintCounter()) {
-        char text[16]; // that's a lot of repaints
-        _snprintf(text, sizeof(text), "%d", m_owner->incrementRepaintCount());
-
-        CGContextSaveGState(context);
-        CGContextSetRGBFillColor(context, 1.0f, 0.0f, 0.0f, 0.8f);
-        
-        CGRect aBounds = layerBounds;
-
-        aBounds.size.width = 10 + 12 * strlen(text);
-        aBounds.size.height = 25;
-        CGContextFillRect(context, aBounds);
-        
-        CGContextSetRGBFillColor(context, 0.0f, 0.0f, 0.0f, 1.0f);
-
-        CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0f, -1.0f));
-        CGContextSelectFont(context, "Helvetica", 25, kCGEncodingMacRoman);
-        CGContextShowTextAtPoint(context, aBounds.origin.x + 3.0f, aBounds.origin.y + 20.0f, text, strlen(text));
-        
-        CGContextRestoreGState(context);        
-    }
-
-    CGContextRestoreGState(context);
-}
-
 void WKCACFLayer::becomeRootLayerForContext(CACFContextRef context)
 {
     CACFContextSetLayer(context, layer());
@@ -271,7 +177,9 @@
 
 void WKCACFLayer::setNeedsCommit()
 {
-    CACFContextRef context = CACFLayerGetContext(rootLayer()->layer());
+    WKCACFLayer* root = rootLayer();
+
+    CACFContextRef context = CACFLayerGetContext(root->layer());
 
     // The context might now be set yet. This happens if a property gets set
     // before placing the layer in the tree. In this case we don't need to 
@@ -280,16 +188,14 @@
     if (context)
         WKCACFContextFlusher::shared().addContext(context);
 
-    // Call notifySyncRequired(), which in this implementation plumbs through to
-    // call setRootLayerNeedsDisplay() on the WebView, which causes the CACFRenderer
-    // to render a frame.
-    if (m_owner)
-        m_owner->notifySyncRequired();
+    // Call setNeedsRender on the root layer, which will cause a render to 
+    // happen in WKCACFLayerRenderer
+    root->setNeedsRender();
 }
 
 bool WKCACFLayer::isTransformLayer() const
 {
-    return CACFLayerGetClass(layer()) == kCACFTransformLayer();
+    return CACFLayerGetClass(layer()) == kCACFTransformLayer;
 }
 
 void WKCACFLayer::addSublayer(PassRefPtr<WKCACFLayer> sublayer)
@@ -300,6 +206,7 @@
 void WKCACFLayer::insertSublayer(PassRefPtr<WKCACFLayer> sublayer, size_t index)
 {
     index = min(index, numSublayers());
+    sublayer->removeFromSuperlayer();
     CACFLayerInsertSublayer(layer(), sublayer->layer(), index);
     setNeedsCommit();
 }
@@ -344,21 +251,17 @@
     if (reference == newLayer)
         return;
 
-    if (!newLayer) {
-        removeSublayer(reference);
-        return;
-    }
-
-    newLayer->removeFromSuperlayer();
-
     int referenceIndex = indexOfSublayer(reference);
     ASSERT(referenceIndex != -1);
     if (referenceIndex == -1)
         return;
 
-    // FIXME: Can we make this more efficient? The current CACF API doesn't seem to give us a way to do so.
     reference->removeFromSuperlayer();
-    insertSublayer(newLayer, referenceIndex);
+
+    if (newLayer) {
+        newLayer->removeFromSuperlayer();
+        insertSublayer(newLayer, referenceIndex);
+    }
 }
 
 void WKCACFLayer::removeFromSuperlayer()
@@ -367,21 +270,10 @@
     if (!superlayer)
         return;
 
-    superlayer->removeSublayer(this);
     CACFLayerRemoveFromSuperlayer(layer());
     superlayer->setNeedsCommit();
 }
 
-void WKCACFLayer::removeSublayer(const WKCACFLayer* sublayer)
-{
-    int foundIndex = indexOfSublayer(sublayer);
-    if (foundIndex == -1)
-        return;
-
-    CACFLayerRemoveFromSuperlayer(sublayer->layer());
-    setNeedsCommit();
-}
-
 const WKCACFLayer* WKCACFLayer::sublayerAtIndex(int index) const
 {
     CFArrayRef sublayers = CACFLayerGetSublayers(layer());
@@ -490,31 +382,20 @@
 
 void WKCACFLayer::setSublayers(const Vector<RefPtr<WKCACFLayer> >& sublayers)
 {
-    if (sublayers.isEmpty())
-        CACFLayerSetSublayers(layer(), 0);
-    else {
-        // Create a vector of CACFLayers.
-        Vector<const void*> layers;
-        for (size_t i = 0; i < sublayers.size(); i++)
-            layers.append(sublayers[i]->layer());
-    
-        RetainPtr<CFArrayRef> layersArray(AdoptCF, CFArrayCreate(0, layers.data(), layers.size(), 0));
-        CACFLayerSetSublayers(layer(), layersArray.get());
-    }
-    
+    // Remove all the current sublayers and add the passed layers
+    CACFLayerSetSublayers(layer(), 0);
+
+    // Perform removeFromSuperLayer in a separate pass. CACF requires superlayer to
+    // be null or CACFLayerInsertSublayer silently fails.
+    for (size_t i = 0; i < sublayers.size(); i++)
+        CACFLayerRemoveFromSuperlayer(sublayers[i]->layer());
+
+    for (size_t i = 0; i < sublayers.size(); i++)
+        CACFLayerInsertSublayer(layer(), sublayers[i]->layer(), i);
+
     setNeedsCommit();
 }
 
-void WKCACFLayer::moveSublayers(WKCACFLayer* fromLayer, WKCACFLayer* toLayer)
-{
-    if (!fromLayer || !toLayer)
-        return;
-
-    CACFLayerSetSublayers(toLayer->layer(), CACFLayerGetSublayers(fromLayer->layer()));
-    fromLayer->setNeedsCommit();
-    toLayer->setNeedsCommit();
-}
-
 WKCACFLayer* WKCACFLayer::superlayer() const
 {
     CACFLayerRef super = CACFLayerGetSuperlayer(layer());
@@ -523,18 +404,15 @@
     return WKCACFLayer::layer(super);
 }
 
-void WKCACFLayer::setNeedsDisplay(const CGRect& dirtyRect)
+void WKCACFLayer::setNeedsDisplay(const CGRect* dirtyRect)
 {
-    if (m_owner)
-        CACFLayerSetNeedsDisplay(layer(), &dirtyRect);
+    CACFLayerSetNeedsDisplay(layer(), dirtyRect);
     setNeedsCommit();
 }
 
 void WKCACFLayer::setNeedsDisplay()
 {
-    if (m_owner)
-        CACFLayerSetNeedsDisplay(layer(), 0);
-    setNeedsCommit();
+    setNeedsDisplay(0);
 }
 
 #ifndef NDEBUG
@@ -570,11 +448,11 @@
     CGPoint layerAnchorPoint = anchorPoint();
     CGRect layerBounds = bounds();
     printIndent(indent);
-    fprintf(stderr, "(%s [%g %g %g] [%g %g %g %g] [%g %g %g]\n",
+    fprintf(stderr, "(%s [%g %g %g] [%g %g %g %g] [%g %g %g] superlayer=%p\n",
         isTransformLayer() ? "transform-layer" : "layer",
         layerPosition.x, layerPosition.y, zPosition(), 
         layerBounds.origin.x, layerBounds.origin.y, layerBounds.size.width, layerBounds.size.height,
-        layerAnchorPoint.x, layerAnchorPoint.y, anchorPointZ());
+        layerAnchorPoint.x, layerAnchorPoint.y, anchorPointZ(), superlayer());
 
     // Print name if needed
     String layerName = name();
diff --git a/WebCore/platform/graphics/win/WKCACFLayer.h b/WebCore/platform/graphics/win/WKCACFLayer.h
index e5568c9..f1b2613 100644
--- a/WebCore/platform/graphics/win/WKCACFLayer.h
+++ b/WebCore/platform/graphics/win/WKCACFLayer.h
@@ -39,7 +39,6 @@
 #include <wtf/Vector.h>
 
 #include "GraphicsContext.h"
-#include "GraphicsLayerCACF.h"
 #include "PlatformString.h"
 #include "TransformationMatrix.h"
 
@@ -55,10 +54,15 @@
     enum ContentsGravityType { Center, Top, Bottom, Left, Right, TopLeft, TopRight, 
                                BottomLeft, BottomRight, Resize, ResizeAspect, ResizeAspectFill };
 
-    static PassRefPtr<WKCACFLayer> create(LayerType, GraphicsLayerCACF* owner = 0);
+    static PassRefPtr<WKCACFLayer> create(LayerType);
     static WKCACFLayer* layer(CACFLayerRef layer) { return static_cast<WKCACFLayer*>(CACFLayerGetUserData(layer)); }
 
-    ~WKCACFLayer();
+    virtual ~WKCACFLayer();
+
+    virtual void setNeedsRender() { }
+    virtual void drawInContext(PlatformGraphicsContext*) { }
+    virtual void setNeedsDisplay(const CGRect* dirtyRect);
+    void setNeedsDisplay();
 
     // Makes this layer the root when the passed context is rendered
     void becomeRootLayerForContext(CACFContextRef);
@@ -106,8 +110,6 @@
         return RetainPtr<CFTypeRef>(AdoptCF, CGColorCreateGenericRGB(color.red(), color.green(), color.blue(), color.alpha()));
     }
 
-    void display(PlatformGraphicsContext*);
-
     bool isTransformLayer() const;
 
     void addSublayer(PassRefPtr<WKCACFLayer> sublayer);
@@ -116,7 +118,6 @@
     void insertSublayerBelowLayer(PassRefPtr<WKCACFLayer>, const WKCACFLayer* reference);
     void replaceSublayer(WKCACFLayer* reference, PassRefPtr<WKCACFLayer>);
     void removeFromSuperlayer();
-    static void moveSublayers(WKCACFLayer* fromLayer, WKCACFLayer* toLayer);
 
     WKCACFLayer* ancestorOrSelfWithSuperlayer(WKCACFLayer*) const;
     
@@ -180,9 +181,6 @@
     void setName(const String& name) { CACFLayerSetName(layer(), RetainPtr<CFStringRef>(AdoptCF, name.createCFString()).get()); }
     String name() const { return CACFLayerGetName(layer()); }
 
-    void setNeedsDisplay(const CGRect& dirtyRect);
-    void setNeedsDisplay();
-    
     void setNeedsDisplayOnBoundsChange(bool needsDisplay) { m_needsDisplayOnBoundsChange = needsDisplay; }
 
     void setOpacity(float opacity) { CACFLayerSetOpacity(layer(), opacity); setNeedsCommit(); }
@@ -228,10 +226,12 @@
     void printTree() const;
 #endif
 
-private:
-    WKCACFLayer(LayerType, GraphicsLayerCACF* owner);
+protected:
+    WKCACFLayer(LayerType);
 
     void setNeedsCommit();
+
+private:
     CACFLayerRef layer() const { return m_layer.get(); }
     size_t numSublayers() const
     {
@@ -255,7 +255,6 @@
 
     RetainPtr<CACFLayerRef> m_layer;
     bool m_needsDisplayOnBoundsChange;
-    GraphicsLayerCACF* m_owner;
 };
 
 }
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
index 78ebb9d..1b14846 100644
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
@@ -27,16 +27,22 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
+#ifndef NDEBUG
+#define D3D_DEBUG_INFO
+#endif
+
 #include "WKCACFLayerRenderer.h"
 
 #include "WKCACFContextFlusher.h"
 #include "WKCACFLayer.h"
+#include "WebCoreInstanceHandle.h"
 #include <CoreGraphics/CGSRegion.h>
 #include <QuartzCore/CACFContext.h>
 #include <QuartzCore/CARenderOGL.h>
-#include <QuartzCoreInterface/QuartzCoreInterface.h>
 #include <wtf/HashMap.h>
 #include <wtf/OwnArrayPtr.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/StdLibExtras.h>
 #include <d3d9.h>
 #include <d3dx9.h>
@@ -75,6 +81,33 @@
 
 namespace WebCore {
 
+// Subclass of WKCACFLayer to allow the root layer to have a back pointer to the layer renderer
+// to fire off a draw
+class WKCACFRootLayer : public WKCACFLayer {
+public:
+    WKCACFRootLayer(WKCACFLayerRenderer* renderer)
+        : WKCACFLayer(WKCACFLayer::Layer)
+    {
+        m_renderer = renderer;
+    }
+
+    static PassRefPtr<WKCACFRootLayer> create(WKCACFLayerRenderer* renderer)
+    {
+        if (!WKCACFLayerRenderer::acceleratedCompositingAvailable())
+            return 0;
+        return adoptRef(new WKCACFRootLayer(renderer));
+    }
+
+    virtual void setNeedsRender() { m_renderer->renderSoon(); }
+
+    // Overload this to avoid calling setNeedsDisplay on the layer, which would override the contents
+    // we have placed on the root layer.
+    virtual void setNeedsDisplay(const CGRect* dirtyRect) { setNeedsCommit(); }
+
+private:
+    WKCACFLayerRenderer* m_renderer;
+};
+
 typedef HashMap<CACFContextRef, WKCACFLayerRenderer*> ContextToWindowMap;
 
 static ContextToWindowMap& windowsForContexts()
@@ -95,6 +128,28 @@
     return parameters;
 }
 
+// FIXME: <rdar://6507851> Share this code with CoreAnimation.
+static bool hardwareCapabilitiesIndicateCoreAnimationSupport(const D3DCAPS9& caps)
+{
+    // CoreAnimation needs two or more texture units.
+    if (caps.MaxTextureBlendStages < 2)
+        return false;
+
+    // CoreAnimation needs non-power-of-two textures.
+    if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && !(caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL))
+        return false;
+
+    // CoreAnimation needs vertex shader 2.0 or greater.
+    if (D3DSHADER_VERSION_MAJOR(caps.VertexShaderVersion) < 2)
+        return false;
+
+    // CoreAnimation needs pixel shader 2.0 or greater.
+    if (D3DSHADER_VERSION_MAJOR(caps.PixelShaderVersion) < 2)
+        return false;
+
+    return true;
+}
+
 bool WKCACFLayerRenderer::acceleratedCompositingAvailable()
 {
     static bool available;
@@ -104,17 +159,50 @@
         return available;
 
     tested = true;
-    HMODULE library = LoadLibrary(TEXT("d3d9.dll"));
-    if (!library)
-        return false;
 
-    FreeLibrary(library);
-    library = LoadLibrary(TEXT("QuartzCore.dll"));
-    if (!library)
-        return false;
-
-    FreeLibrary(library);
+    // Initialize available to true since this function will be called from a 
+    // propagation within createRenderer(). We want to be able to return true 
+    // when that happens so that the test can continue.
     available = true;
+    
+    HMODULE library = LoadLibrary(TEXT("d3d9.dll"));
+    if (!library) {
+        available = false;
+        return available;
+    }
+
+    FreeLibrary(library);
+#ifdef DEBUG_ALL
+    library = LoadLibrary(TEXT("QuartzCore_debug.dll"));
+#else
+    library = LoadLibrary(TEXT("QuartzCore.dll"));
+#endif
+    if (!library) {
+        available = false;
+        return available;
+    }
+
+    FreeLibrary(library);
+
+    // Make a dummy HWND.
+    WNDCLASSEX wcex = { 0 };
+    wcex.cbSize = sizeof(WNDCLASSEX);
+    wcex.lpfnWndProc = DefWindowProc;
+    wcex.hInstance = WebCore::instanceHandle();
+    wcex.lpszClassName = L"CoreAnimationTesterWindowClass";
+    ::RegisterClassEx(&wcex);
+    HWND testWindow = ::CreateWindow(L"CoreAnimationTesterWindowClass", L"CoreAnimationTesterWindow", WS_POPUP, -500, -500, 0, 0, 0, 0, 0, 0);
+
+    if (!testWindow) {
+        available = false;
+        return available;
+    }
+
+    OwnPtr<WKCACFLayerRenderer> testLayerRenderer = WKCACFLayerRenderer::create();
+    testLayerRenderer->setHostWindow(testWindow);
+    available = testLayerRenderer->createRenderer();
+    ::DestroyWindow(testWindow);
+
     return available;
 }
 
@@ -140,7 +228,9 @@
     , m_renderer(0)
     , m_hostWindow(0)
     , m_renderTimer(this, &WKCACFLayerRenderer::renderTimerFired)
-    , m_scrollFrame(0, 0, 1, 1) // Default to 1 to avoid 0 size frames
+    , m_scrollPosition(0, 0)
+    , m_scrollSize(1, 1)
+    , m_backingStoreDirty(false)
 {
 #ifndef NDEBUG
     char* printTreeFlag = getenv("CA_PRINT_TREE");
@@ -153,15 +243,29 @@
     destroyRenderer();
 }
 
-void WKCACFLayerRenderer::setScrollFrame(const IntRect& scrollFrame)
+WKCACFLayer* WKCACFLayerRenderer::rootLayer() const
 {
-    m_scrollFrame = scrollFrame;
-    CGRect frameBounds = bounds();
-    m_scrollLayer->setBounds(CGRectMake(0, 0, m_scrollFrame.width(), m_scrollFrame.height()));
-    m_scrollLayer->setPosition(CGPointMake(0, frameBounds.size.height));
+    return m_rootLayer.get();
+}
 
-    if (m_rootChildLayer)
-        m_rootChildLayer->setPosition(CGPointMake(-m_scrollFrame.x(), m_scrollFrame.height() + m_scrollFrame.y()));
+void WKCACFLayerRenderer::setScrollFrame(const IntPoint& position, const IntSize& size)
+{
+    m_scrollSize = size;
+    m_scrollPosition = position;
+
+    updateScrollFrame();
+}
+
+void WKCACFLayerRenderer::updateScrollFrame()
+{
+    CGRect frameBounds = bounds();
+    m_clipLayer->setBounds(CGRectMake(0, 0, m_scrollSize.width(), m_scrollSize.height()));
+    m_clipLayer->setPosition(CGPointMake(0, frameBounds.size.height));
+    if (m_rootChildLayer) {
+        CGRect rootBounds = m_rootChildLayer->bounds();
+        m_scrollLayer->setBounds(rootBounds);
+    }
+    m_scrollLayer->setPosition(CGPointMake(-m_scrollPosition.x(), m_scrollPosition.y() + m_scrollSize.height()));
 }
 
 void WKCACFLayerRenderer::setRootContents(CGImageRef image)
@@ -171,7 +275,7 @@
     renderSoon();
 }
 
-void WKCACFLayerRenderer::setRootChildLayer(WebCore::PlatformLayer* layer)
+void WKCACFLayerRenderer::setRootChildLayer(WKCACFLayer* layer)
 {
     if (!m_scrollLayer)
         return;
@@ -180,30 +284,28 @@
     m_rootChildLayer = layer;
     if (layer) {
         m_scrollLayer->addSublayer(layer);
-
-        // Set the frame
-        layer->setAnchorPoint(CGPointMake(0, 1));
-        setScrollFrame(m_scrollFrame);
+        // Adjust the scroll frame accordingly
+        updateScrollFrame();
     }
 }
    
 void WKCACFLayerRenderer::setNeedsDisplay()
 {
     ASSERT(m_rootLayer);
-    m_rootLayer->setNeedsDisplay();
+    m_rootLayer->setNeedsDisplay(0);
     renderSoon();
 }
 
-void WKCACFLayerRenderer::createRenderer()
+bool WKCACFLayerRenderer::createRenderer()
 {
     if (m_triedToCreateD3DRenderer)
-        return;
+        return m_d3dDevice;
 
     m_triedToCreateD3DRenderer = true;
     D3DPRESENT_PARAMETERS parameters = initialPresentationParameters();
 
     if (!d3d() || !::IsWindow(m_hostWindow))
-        return;
+        return false;
 
     // D3D doesn't like to make back buffers for 0 size windows. We skirt this problem if we make the
     // passed backbuffer width and height non-zero. The window will necessarily get set to a non-zero
@@ -216,8 +318,23 @@
         parameters.BackBufferHeight = 1;
     }
 
-    if (FAILED(d3d()->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hostWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &parameters, &m_d3dDevice)))
-        return;
+    COMPtr<IDirect3DDevice9> device;
+    if (FAILED(d3d()->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hostWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &parameters, &device)))
+        return false;
+
+    // Now that we've created the IDirect3DDevice9 based on the capabilities we
+    // got from the IDirect3D9 global object, we requery the device for its
+    // actual capabilities. The capabilities returned by the device can
+    // sometimes be more complete, for example when using software vertex
+    // processing.
+    D3DCAPS9 deviceCaps;
+    if (FAILED(device->GetDeviceCaps(&deviceCaps)))
+        return false;
+
+    if (!hardwareCapabilitiesIndicateCoreAnimationSupport(deviceCaps))
+        return false;
+
+    m_d3dDevice = device;
 
     D3DXMATRIXA16 projection;
     D3DXMatrixOrthoOffCenterRH(&projection, rect.left, rect.right, rect.top, rect.bottom, -1.0f, 1.0f);
@@ -228,17 +345,32 @@
     windowsForContexts().set(m_context.get(), this);
 
     m_renderContext = static_cast<CARenderContext*>(CACFContextGetRenderContext(m_context.get()));
-    m_renderer = CARenderOGLNew(wkqcCARenderOGLCallbacks(wkqckCARenderDX9Callbacks), m_d3dDevice.get(), 0);
+    m_renderer = CARenderOGLNew(&kCARenderDX9Callbacks, m_d3dDevice.get(), 0);
 
-    // Create the root hierarchy
-    m_rootLayer = WKCACFLayer::create(WKCACFLayer::Layer);
+    // Create the root hierarchy.
+    // Under the root layer, we have a clipping layer to clip the content,
+    // that contains a scroll layer that we use for scrolling the content.
+    // The root layer is the size of the client area of the window.
+    // The clipping layer is the size of the WebView client area (window less the scrollbars).
+    // The scroll layer is the size of the root child layer.
+    // Resizing the window will change the bounds of the rootLayer and the clip layer and will not
+    // cause any repositioning.
+    // Scrolling will affect only the position of the scroll layer without affecting the bounds.
+
+    m_rootLayer = WKCACFRootLayer::create(this);
     m_rootLayer->setName("WKCACFLayerRenderer rootLayer");
+
+    m_clipLayer = WKCACFLayer::create(WKCACFLayer::Layer);
+    m_clipLayer->setName("WKCACFLayerRenderer clipLayer");
+    
     m_scrollLayer = WKCACFLayer::create(WKCACFLayer::Layer);
     m_scrollLayer->setName("WKCACFLayerRenderer scrollLayer");
 
-    m_rootLayer->addSublayer(m_scrollLayer);
-    m_scrollLayer->setMasksToBounds(true);
+    m_rootLayer->addSublayer(m_clipLayer);
+    m_clipLayer->addSublayer(m_scrollLayer);
+    m_clipLayer->setMasksToBounds(true);
     m_scrollLayer->setAnchorPoint(CGPointMake(0, 1));
+    m_clipLayer->setAnchorPoint(CGPointMake(0, 1));
 
 #ifndef NDEBUG
     CGColorRef debugColor = createCGColor(Color(255, 0, 0, 204));
@@ -251,6 +383,8 @@
 
     if (m_context)
         m_rootLayer->becomeRootLayerForContext(m_context.get());
+
+    return true;
 }
 
 void WKCACFLayerRenderer::destroyRenderer()
@@ -269,6 +403,7 @@
 
     s_d3d = 0;
     m_rootLayer = 0;
+    m_clipLayer = 0;
     m_scrollLayer = 0;
     m_rootChildLayer = 0;
 
@@ -285,7 +420,7 @@
     if (m_rootLayer) {
         m_rootLayer->setFrame(bounds());
         WKCACFContextFlusher::shared().flushAllContexts();
-        setScrollFrame(m_scrollFrame);
+        updateScrollFrame();
     }
 }
 
@@ -331,6 +466,15 @@
     if (!m_d3dDevice)
         return;
 
+    if (m_backingStoreDirty) {
+        // If the backing store is still dirty when we are about to draw the
+        // composited content, we need to force the window to paint into the
+        // backing store. The paint will only paint the dirty region that
+        // if being tracked in WebView.
+        UpdateWindow(m_hostWindow);
+        return;
+    }
+
     Vector<CGRect> dirtyRects;
     getDirtyRects(m_hostWindow, dirtyRects);
     render(dirtyRects);
diff --git a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
index 4e76f55..ea710b6 100644
--- a/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
+++ b/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
@@ -47,6 +47,8 @@
 
 namespace WebCore {
 
+class WKCACFRootLayer;
+
 // FIXME: Currently there is a WKCACFLayerRenderer for each WebView and each
 // has its own CARenderOGLContext and Direct3DDevice9, which is inefficient.
 // (https://bugs.webkit.org/show_bug.cgi?id=31855)
@@ -58,19 +60,20 @@
     static bool acceleratedCompositingAvailable();
     static void didFlushContext(CACFContextRef);
 
-    void setScrollFrame(const IntRect&);
+    void setScrollFrame(const IntPoint&, const IntSize&);
     void setRootContents(CGImageRef);
-    void setRootChildLayer(WebCore::PlatformLayer* layer);
+    void setRootChildLayer(WKCACFLayer* layer);
     void setNeedsDisplay();
-    void setHostWindow(HWND window) { m_hostWindow = window; createRenderer(); }
-
-    void createRenderer();
+    void setHostWindow(HWND window) { m_hostWindow = window; }
+    void setBackingStoreDirty(bool dirty) { m_backingStoreDirty = dirty; }
+    bool createRenderer();
     void destroyRenderer();
     void resize();
     void renderSoon();
+    void updateScrollFrame();
 
 protected:
-    WKCACFLayer* rootLayer() const { return m_rootLayer.get(); }
+    WKCACFLayer* rootLayer() const;
 
 private:
     WKCACFLayerRenderer();
@@ -87,17 +90,19 @@
 
     bool m_triedToCreateD3DRenderer;
     COMPtr<IDirect3DDevice9> m_d3dDevice;
-    RefPtr<WKCACFLayer> m_rootLayer;
+    RefPtr<WKCACFRootLayer> m_rootLayer;
     RefPtr<WKCACFLayer> m_viewLayer;
     RefPtr<WKCACFLayer> m_scrollLayer;
     RefPtr<WKCACFLayer> m_rootChildLayer;
+    RefPtr<WKCACFLayer> m_clipLayer;
     RetainPtr<CACFContextRef> m_context;
     CARenderContext* m_renderContext;
     CARenderOGLContext* m_renderer;
     HWND m_hostWindow;
     Timer<WKCACFLayerRenderer> m_renderTimer;
-    IntRect m_scrollFrame;
-
+    IntPoint m_scrollPosition;
+    IntSize m_scrollSize;
+    bool m_backingStoreDirty;
 #ifndef NDEBUG
     bool m_printTree;
 #endif
diff --git a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
index 699ff25..d5f8a5a 100644
--- a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
@@ -25,6 +25,7 @@
 #include "Base64.h"
 #include "CachedFont.h"
 #include "FontPlatformData.h"
+#include "SharedBuffer.h"
 #include <wtf/RandomNumber.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/graphics/wince/FontPlatformData.cpp b/WebCore/platform/graphics/wince/FontPlatformData.cpp
index f0db2ff..74cadc2 100644
--- a/WebCore/platform/graphics/wince/FontPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontPlatformData.cpp
@@ -26,8 +26,10 @@
 #include "FontData.h"
 #include "PlatformString.h"
 #include "SimpleFontData.h"
+#include "StringHash.h"
 #include "UnicodeRange.h"
 #include "wtf/OwnPtr.h"
+#include <wtf/StdLibExtras.h>
 
 #include <windows.h>
 #include <mlang.h>
diff --git a/WebCore/platform/graphics/wince/FontWince.cpp b/WebCore/platform/graphics/wince/FontWince.cpp
index 6c03712..f8b1886 100644
--- a/WebCore/platform/graphics/wince/FontWince.cpp
+++ b/WebCore/platform/graphics/wince/FontWince.cpp
@@ -235,7 +235,7 @@
     }
 }
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     TextRunComponents components;
     int w = generateComponents(&components, *this, run);
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index 42e94a4..a7bb695 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -23,6 +23,7 @@
 
 #include "AffineTransform.h"
 #include "CharacterNames.h"
+#include "Font.h"
 #include "GlyphBuffer.h"
 #include "Gradient.h"
 #include "GraphicsContextPrivate.h"
diff --git a/WebCore/platform/graphics/wince/ImageBufferWince.cpp b/WebCore/platform/graphics/wince/ImageBufferWince.cpp
index 9624e26..ac3a630 100644
--- a/WebCore/platform/graphics/wince/ImageBufferWince.cpp
+++ b/WebCore/platform/graphics/wince/ImageBufferWince.cpp
@@ -27,6 +27,7 @@
 #include "JPEGEncoder.h"
 #include "PNGEncoder.h"
 #include "SharedBitmap.h"
+#include <wtf/UnusedParam.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/graphics/wince/PlatformPathWince.h b/WebCore/platform/graphics/wince/PlatformPathWince.h
index e614cec..614e8c5 100644
--- a/WebCore/platform/graphics/wince/PlatformPathWince.h
+++ b/WebCore/platform/graphics/wince/PlatformPathWince.h
@@ -20,6 +20,11 @@
 #ifndef PlatformPathWince_h
 #define PlatformPathWince_h
 
+#include "FloatPoint.h"
+#include "FloatRect.h"
+#include "Path.h"
+#include <wtf/Vector.h>
+
 namespace WebCore {
 
     class GraphicsContext;
diff --git a/WebCore/platform/graphics/wx/FontPlatformData.h b/WebCore/platform/graphics/wx/FontPlatformData.h
index be00edc..ecb957e 100644
--- a/WebCore/platform/graphics/wx/FontPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontPlatformData.h
@@ -31,9 +31,9 @@
 
 #include "FontDescription.h"
 #include "AtomicString.h"
-#include "CString.h"
 #include "StringImpl.h"
 #include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
 
 #include <wx/defs.h>
 #include <wx/font.h>
@@ -65,21 +65,25 @@
 
     FontPlatformData(WTF::HashTableDeletedValueType)
     : m_fontState(DELETED),
-      m_font(0)
+      m_font(0),
+      m_size(0)
     { }
 
     ~FontPlatformData();
 
     FontPlatformData(const FontDescription&, const AtomicString&);
+    
     FontPlatformData(float size, bool bold, bool italic)
     : m_fontState(UNINITIALIZED)
     , m_font(0)
+    , m_size(size)
     {
     }
     
     FontPlatformData() 
     : m_fontState(UNINITIALIZED)
     , m_font(0)
+    , m_size(0)
     {
     }
     
@@ -99,6 +103,8 @@
     }
 
     unsigned computeHash() const;
+    
+    float size() const { return m_size; }
 
     bool operator==(const FontPlatformData& other) const
     { 
@@ -127,6 +133,7 @@
 private:
     WTF::RefPtr<FontHolder> m_font;
     FontState m_fontState;
+    float m_size;
 };
 
 }
diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
index c9646d7..a75d244 100644
--- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
+++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
@@ -100,6 +100,7 @@
                         ); 
 #endif
     m_fontState = VALID;
+    m_size = desc.computedPixelSize();
      
 }
 
diff --git a/WebCore/platform/graphics/wx/FontWx.cpp b/WebCore/platform/graphics/wx/FontWx.cpp
index 98b5a0a..dce3841 100644
--- a/WebCore/platform/graphics/wx/FontWx.cpp
+++ b/WebCore/platform/graphics/wx/FontWx.cpp
@@ -121,7 +121,7 @@
 }
 
 
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) const
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const
 {
 #if OS(WINDOWS)
     UniscribeController controller(this, run, fallbackFonts);
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 8e1a391..2298d6a 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -91,6 +91,7 @@
 
 #if USE(WXGC)
     wxGCDC* context;
+    wxGraphicsPath currentPath;
 #else
     wxWindowDC* context;
 #endif
@@ -124,6 +125,9 @@
     }
 #if USE(WXGC)
     m_data->context = (wxGCDC*)context;
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc)
+        m_data->currentPath = gc->CreatePath();
 #else
     m_data->context = (wxWindowDC*)context;
 #endif
@@ -323,6 +327,11 @@
     notImplemented();
 }
 
+void GraphicsContext::clipPath(WindRule)
+{
+    notImplemented();
+}
+
 void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing)
 {
     if (paintingDisabled())
@@ -361,7 +370,15 @@
 
 AffineTransform GraphicsContext::getCTM() const
 { 
-    notImplemented();
+#if USE(WXGC)
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc) {
+        wxGraphicsMatrix matrix = gc->GetTransform();
+        double a, b, c, d, e, f;
+        matrix.Get(&a, &b, &c, &d, &e, &f);
+        return AffineTransform(a, b, c, d, e, f);
+    }
+#endif
     return AffineTransform();
 }
 
@@ -435,12 +452,19 @@
 
 void GraphicsContext::beginPath()
 {
-    notImplemented();
+#if USE(WXGC)
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc)
+        m_data->currentPath = gc->CreatePath();
+#endif
 }
 
 void GraphicsContext::addPath(const Path& path)
 {
-    notImplemented();
+#if USE(WXGC)
+    if (path.platformPath())
+        m_data->currentPath.AddPath(*path.platformPath());
+#endif
 }
 
 void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace)
@@ -476,7 +500,11 @@
     if (paintingDisabled())
         return;
 
-    notImplemented();
+#if USE(WXGC)
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc)
+        gc->ConcatTransform(transform);
+#endif
     return;
 }
 
@@ -498,10 +526,20 @@
 
 void GraphicsContext::fillPath()
 {
+#if USE(WXGC)
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc)
+        gc->FillPath(m_data->currentPath);
+#endif
 }
 
 void GraphicsContext::strokePath()
 {
+#if USE(WXGC)
+    wxGraphicsContext* gc = m_data->context->GetGraphicsContext();
+    if (gc)
+        gc->StrokePath(m_data->currentPath);
+#endif
 }
 
 void GraphicsContext::drawPath()
@@ -551,6 +589,11 @@
     notImplemented(); 
 }
 
+void GraphicsContext::setLineDash(const DashArray&, float dashOffset)
+{
+    notImplemented();
+}
+
 void GraphicsContext::setLineJoin(LineJoin)
 {
     notImplemented();
diff --git a/WebCore/platform/graphics/wx/ImageBufferWx.cpp b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
index 49f3f3b..6cc611e 100644
--- a/WebCore/platform/graphics/wx/ImageBufferWx.cpp
+++ b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
@@ -87,4 +87,9 @@
     return 0;
 }
 
+void ImageBuffer::platformTransformColorSpace(const Vector<int>&)
+{
+    notImplemented();
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/wx/ImageWx.cpp b/WebCore/platform/graphics/wx/ImageWx.cpp
index c246ec1..b51bde8 100644
--- a/WebCore/platform/graphics/wx/ImageWx.cpp
+++ b/WebCore/platform/graphics/wx/ImageWx.cpp
@@ -33,6 +33,7 @@
 #include "GraphicsContext.h"
 #include "ImageObserver.h"
 #include "NotImplemented.h"
+#include "SharedBuffer.h"
 
 #include <math.h>
 #include <stdio.h>
diff --git a/WebCore/platform/graphics/wx/PathWx.cpp b/WebCore/platform/graphics/wx/PathWx.cpp
index 6c115ac..2305be0 100644
--- a/WebCore/platform/graphics/wx/PathWx.cpp
+++ b/WebCore/platform/graphics/wx/PathWx.cpp
@@ -30,6 +30,7 @@
 #include "FloatPoint.h"
 #include "FloatRect.h"
 #include "NotImplemented.h"
+#include "PlatformString.h"
 #include "StrokeStyleApplier.h" 
 
 #include <stdio.h>
@@ -110,10 +111,22 @@
     return FloatRect();
 }
 
-Path& Path::operator=(const Path&)
+bool Path::strokeContains(StrokeStyleApplier*, const FloatPoint&) const
+{
+    notImplemented();
+    return false;
+}
+
+String Path::debugString() const
+{
+    notImplemented();
+    return String();
+}
+
+Path& Path::operator=(const Path& path)
 { 
-    notImplemented(); 
-    return*this; 
+    *m_path = *path.platformPath();
+    return *this; 
 }
 
 void Path::clear() 
@@ -219,8 +232,8 @@
 {
 #if USE(WXGC)
     if (m_path) {
-        wxDouble width, height;
-        m_path->GetBox(NULL, NULL, &width, &height);
+        wxDouble x, y, width, height;
+        m_path->GetBox(&x, &y, &width, &height);
         return (width == 0 && height == 0);
     }
 #endif
diff --git a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
index d9fd2b3..3c8a1da 100644
--- a/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
+++ b/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
@@ -112,17 +112,19 @@
         m_treatAsFixedPitch = false;
 }
 
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+GlyphMetrics SimpleFontData::platformMetricsForGlyph(Glyph glyph, GlyphMetricsMode) const
 {
+    GlyphMetrics metrics;
 #if __WXMSW__
     // under Windows / wxMSW we currently always use GDI fonts.
-    return widthForGDIGlyph(glyph);
+    metrics.horizontalAdvance = widthForGDIGlyph(glyph);
 #else
     // TODO: fix this! Make GetTextExtents a method of wxFont in 2.9
     int width = 10;
     GetTextExtent(*m_platformData.font(), (wxChar)glyph, &width, NULL);
-    return width;
+    metrics.horizontalAdvance = width;
 #endif
+    return metrics;
 }
 
 #if OS(WINDOWS)
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 6122d8f..93a21e2 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -18,16 +18,16 @@
 #include "ClipboardGtk.h"
 
 #include "CachedImage.h"
-#include "CString.h"
 #include "Editor.h"
 #include "Element.h"
 #include "FileList.h"
 #include "Frame.h"
-#include "markup.h"
+#include "Image.h"
 #include "NotImplemented.h"
 #include "RenderImage.h"
 #include "StringHash.h"
-
+#include "markup.h"
+#include <wtf/text/CString.h>
 #include <gtk/gtk.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/gtk/ContextMenuItemGtk.cpp b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
index b2fa853..e2c5b84 100644
--- a/WebCore/platform/gtk/ContextMenuItemGtk.cpp
+++ b/WebCore/platform/gtk/ContextMenuItemGtk.cpp
@@ -19,8 +19,8 @@
 #include "config.h"
 #include "ContextMenu.h"
 #include "ContextMenuItem.h"
-#include "CString.h"
 #include "NotImplemented.h"
+#include <wtf/text/CString.h>
 
 #include <gtk/gtk.h>
 
diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h
index f1a2647..22158d4 100644
--- a/WebCore/platform/gtk/DataObjectGtk.h
+++ b/WebCore/platform/gtk/DataObjectGtk.h
@@ -19,13 +19,13 @@
 #ifndef DataObjectGtk_h
 #define DataObjectGtk_h
 
-#include "CString.h"
 #include "FileList.h"
+#include <GRefPtr.h>
 #include "KURL.h"
 #include "Range.h"
 #include "StringHash.h"
 #include <wtf/RefCounted.h>
-#include <wtf/gtk/GRefPtr.h>
+#include <wtf/text/CString.h>
 
 typedef struct _GdkPixbuf GdkPixbuf;
 typedef struct _GdkDragContext GdkDragContext;
diff --git a/WebCore/platform/gtk/FileChooserGtk.cpp b/WebCore/platform/gtk/FileChooserGtk.cpp
index a25d88b..3ff06f0 100644
--- a/WebCore/platform/gtk/FileChooserGtk.cpp
+++ b/WebCore/platform/gtk/FileChooserGtk.cpp
@@ -27,11 +27,11 @@
 #include "config.h"
 #include "FileChooser.h"
 
-#include "CString.h"
 #include "FileSystem.h"
 #include "Icon.h"
 #include "LocalizedStrings.h"
 #include "StringTruncator.h"
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 #include <gtk/gtk.h>
diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp
index b8bbd60..6cad4d9 100644
--- a/WebCore/platform/gtk/FileSystemGtk.cpp
+++ b/WebCore/platform/gtk/FileSystemGtk.cpp
@@ -24,7 +24,7 @@
 
 #include "GOwnPtr.h"
 #include "PlatformString.h"
-#include "CString.h"
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 #include <glib/gstdio.h>
diff --git a/WebCore/platform/gtk/GOwnPtrGtk.cpp b/WebCore/platform/gtk/GOwnPtrGtk.cpp
deleted file mode 100644
index 8538105..0000000
--- a/WebCore/platform/gtk/GOwnPtrGtk.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  Copyright (C) 2010 Igalia S.L
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-
-#include "config.h"
-#include "GOwnPtrGtk.h"
-
-#if ENABLE(VIDEO)
-#include <gst/gstelement.h>
-#endif
-#include <libsoup/soup-uri.h>
-
-namespace WTF {
-
-template <> void freeOwnedGPtr<SoupURI>(SoupURI* ptr)
-{
-    if (ptr)
-        soup_uri_free(ptr);
-}
-
-#if ENABLE(VIDEO)
-template <> void freeOwnedGPtr<GstElement>(GstElement* ptr)
-{
-    if (ptr)
-        gst_object_unref(ptr);
-}
-#endif
-
-}
diff --git a/WebCore/platform/gtk/GOwnPtrGtk.h b/WebCore/platform/gtk/GOwnPtrGtk.h
deleted file mode 100644
index c585002..0000000
--- a/WebCore/platform/gtk/GOwnPtrGtk.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *  Copyright (C) 2010 Igalia S.L
- *
- *  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 GOwnPtrGtk_h
-#define GOwnPtrGtk_h
-
-#include "GOwnPtr.h"
-
-typedef struct _SoupURI SoupURI;
-typedef struct _GstElement GstElement;
-
-namespace WTF {
-
-template<> void freeOwnedGPtr<SoupURI>(SoupURI* ptr);
-template<> void freeOwnedGPtr<GstElement>(GstElement* ptr);
-
-}
-
-#endif
diff --git a/WebCore/platform/gtk/GeolocationServiceGtk.cpp b/WebCore/platform/gtk/GeolocationServiceGtk.cpp
index edb8d10..69a0843 100644
--- a/WebCore/platform/gtk/GeolocationServiceGtk.cpp
+++ b/WebCore/platform/gtk/GeolocationServiceGtk.cpp
@@ -20,10 +20,10 @@
 #include "config.h"
 #include "GeolocationServiceGtk.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "NotImplemented.h"
 #include "PositionOptions.h"
+#include <wtf/text/CString.h>
 
 namespace WTF {
     template<> void freeOwnedGPtr<GeoclueAccuracy>(GeoclueAccuracy* accuracy)
@@ -94,11 +94,12 @@
     int timeout = 0;
     if (options) {
         accuracyLevel = options->enableHighAccuracy() ? GEOCLUE_ACCURACY_LEVEL_DETAILED : GEOCLUE_ACCURACY_LEVEL_LOCALITY;
-        timeout = options->timeout();
+        if (options->hasTimeout())
+            timeout = options->timeout();
     }
 
     gboolean result = geoclue_master_client_set_requirements(client, accuracyLevel, timeout,
-                                                             true, GEOCLUE_RESOURCE_ALL, &error.outPtr());
+                                                             false, GEOCLUE_RESOURCE_ALL, &error.outPtr());
 
     if (!result) {
         setError(PositionError::POSITION_UNAVAILABLE, error->message);
@@ -113,12 +114,13 @@
         return false;
     }
 
+    m_geoclueClient = client;
+
+    geoclue_position_get_position_async(m_geocluePosition, (GeocluePositionCallback)getPositionCallback, this);
+
     g_signal_connect(G_OBJECT(m_geocluePosition), "position-changed",
                      G_CALLBACK(position_changed), this);
 
-    m_geoclueClient = client;
-    updateLocationInformation();
-
     return true;
 }
 
@@ -156,28 +158,6 @@
     return m_lastError.get();
 }
 
-void GeolocationServiceGtk::updateLocationInformation()
-{
-    ASSERT(m_geocluePosition);
-
-    GOwnPtr<GError> error;
-    GOwnPtr<GeoclueAccuracy> accuracy;
-
-    GeocluePositionFields fields = geoclue_position_get_position(m_geocluePosition, &m_timestamp,
-                                                                 &m_latitude, &m_longitude,
-                                                                 &m_altitude, &accuracy.outPtr(),
-                                                                 &error.outPtr());
-    if (error) {
-        setError(PositionError::POSITION_UNAVAILABLE, error->message);
-        return;
-    } else if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
-        setError(PositionError::POSITION_UNAVAILABLE, "Position could not be determined.");
-        return;
-    }
-
-
-}
-
 void GeolocationServiceGtk::updatePosition()
 {
     m_lastError = 0;
@@ -189,6 +169,24 @@
     positionChanged();
 }
 
+void GeolocationServiceGtk::getPositionCallback(GeocluePosition *position,
+                                                GeocluePositionFields fields,
+                                                int timestamp,
+                                                double latitude,
+                                                double longitude,
+                                                double altitude,
+                                                GeoclueAccuracy* accuracy,
+                                                GError* error,
+                                                GeolocationServiceGtk* that)
+{
+    if (error) {
+        that->setError(PositionError::POSITION_UNAVAILABLE, error->message);
+        g_error_free(error);
+        return;
+    }
+    position_changed(position, fields, timestamp, latitude, longitude, altitude, accuracy, that);
+}
+
 void GeolocationServiceGtk::position_changed(GeocluePosition*, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationServiceGtk* that)
 {
     if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
diff --git a/WebCore/platform/gtk/GeolocationServiceGtk.h b/WebCore/platform/gtk/GeolocationServiceGtk.h
index a198dc0..c123017 100644
--- a/WebCore/platform/gtk/GeolocationServiceGtk.h
+++ b/WebCore/platform/gtk/GeolocationServiceGtk.h
@@ -46,11 +46,11 @@
     private:
         GeolocationServiceGtk(GeolocationServiceClient*);
 
-        void updateLocationInformation();
         void setError(PositionError::ErrorCode, const char* message);
         void updatePosition();
 
         static void position_changed(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GeolocationServiceGtk*);
+        static void getPositionCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GError*, GeolocationServiceGtk*);
 
     private:
         RefPtr<Geoposition> m_lastPosition;
diff --git a/WebCore/platform/gtk/GtkPluginWidget.cpp b/WebCore/platform/gtk/GtkPluginWidget.cpp
index bc2dd92..67bf4b1 100644
--- a/WebCore/platform/gtk/GtkPluginWidget.cpp
+++ b/WebCore/platform/gtk/GtkPluginWidget.cpp
@@ -28,6 +28,7 @@
 #include "GtkPluginWidget.h"
 
 #include "GraphicsContext.h"
+#include "GtkVersioning.h"
 #include "ScrollView.h"
 
 #include <gtk/gtk.h>
@@ -43,7 +44,7 @@
 void GtkPluginWidget::invalidateRect(const IntRect& _rect)
 {
     /* no need to */
-    if (GTK_WIDGET_NO_WINDOW(platformWidget()))
+    if (!gtk_widget_get_has_window(platformWidget()))
         return;
 
     GdkWindow* window = platformWidget()->window;
@@ -70,12 +71,12 @@
     if (!context->gdkExposeEvent())
         return;
 
-    /* only paint widgets with NO_WINDOW this way */
-    if (!GTK_WIDGET_NO_WINDOW(platformWidget()))
+    /* only paint widgets with no window this way */
+    if (gtk_widget_get_has_window(platformWidget()))
         return;
 
     GtkWidget* widget = platformWidget();
-    ASSERT(GTK_WIDGET_NO_WINDOW(widget));
+    ASSERT(!gtk_widget_get_has_window(widget));
 
     GdkEvent* event = gdk_event_new(GDK_EXPOSE);
     event->expose = *context->gdkExposeEvent();
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
new file mode 100644
index 0000000..fc92d8b
--- /dev/null
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ *  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 GtkVersioning_h
+#define GtkVersioning_h
+
+#include <gtk/gtk.h>
+
+// Macros to avoid deprecation checking churn
+#if !GTK_CHECK_VERSION(2, 19, 0)
+#define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget)
+#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
+#define gtk_widget_get_has_window(widget) !GTK_WIDGET_NO_WINDOW(widget)
+#define gtk_widget_get_can_focus(widget) GTK_WIDGET_CAN_FOCUS(widget)
+#define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget)
+#endif // GTK_CHECK_VERSION(2, 19, 0)
+
+#endif // GtkVersioning_h
diff --git a/WebCore/platform/gtk/KURLGtk.cpp b/WebCore/platform/gtk/KURLGtk.cpp
index 4858d3e..47bc48b 100644
--- a/WebCore/platform/gtk/KURLGtk.cpp
+++ b/WebCore/platform/gtk/KURLGtk.cpp
@@ -19,8 +19,8 @@
 #include "config.h"
 #include "KURL.h"
 
-#include "CString.h"
 #include "FileSystem.h"
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 
diff --git a/WebCore/platform/gtk/KeyEventGtk.cpp b/WebCore/platform/gtk/KeyEventGtk.cpp
index e00ea43..193b7e5 100644
--- a/WebCore/platform/gtk/KeyEventGtk.cpp
+++ b/WebCore/platform/gtk/KeyEventGtk.cpp
@@ -30,9 +30,9 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
 #include "TextEncoding.h"
+#include "WindowsKeyboardCodes.h"
 
 #include <gdk/gdk.h>
 #include <gdk/gdkkeysyms.h>
@@ -586,6 +586,15 @@
     return false;
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    notImplemented();
+    shiftKey = false;
+    ctrlKey = false;
+    altKey = false;
+    metaKey = false;
+}
+
 GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const
 {
     return m_gdkEventKey;
diff --git a/WebCore/platform/gtk/Language.cpp b/WebCore/platform/gtk/Language.cpp
index 577d7d8..f1d5750 100644
--- a/WebCore/platform/gtk/Language.cpp
+++ b/WebCore/platform/gtk/Language.cpp
@@ -20,9 +20,9 @@
 #include "config.h"
 #include "Language.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <gtk/gtk.h>
 #include <locale.h>
diff --git a/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index e0ec3ab..432c92f 100644
--- a/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -30,11 +30,11 @@
 #include "config.h"
 
 #include "LocalizedStrings.h"
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "IntSize.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
@@ -67,7 +67,7 @@
 
 String searchableIndexIntroduction()
 {
-    return String::fromUTF8(_("_Searchable Index"));
+    return String::fromUTF8(_("This is a searchable index. Enter search keywords: "));
 }
 
 String fileButtonChooseFileLabel()
@@ -335,6 +335,17 @@
 {
     return String();
 }
+    
+String missingPluginText()
+{
+    return String::fromUTF8(_("Missing Plug-in"));
+}
+
+String crashedPluginText()
+{
+    notImplemented();
+    return String::fromUTF8(_("Plug-in Failure"));
+}
 
 String multipleFileUploadText(unsigned numberOfFiles)
 {
diff --git a/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp b/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp
index 8afb60f..8fc3020 100644
--- a/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp
+++ b/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp
@@ -73,4 +73,9 @@
     return String();
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 }
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index 5c7d9a7..907a55e 100644
--- a/WebCore/platform/gtk/PasteboardGtk.cpp
+++ b/WebCore/platform/gtk/PasteboardGtk.cpp
@@ -20,7 +20,6 @@
 #include "config.h"
 #include "Pasteboard.h"
 
-#include "CString.h"
 #include "DocumentFragment.h"
 #include "Frame.h"
 #include "NotImplemented.h"
@@ -30,6 +29,7 @@
 #include "RenderImage.h"
 #include "KURL.h"
 #include "markup.h"
+#include <wtf/text/CString.h>
 
 #include <gtk/gtk.h>
 
@@ -58,7 +58,7 @@
                                       guint info, gpointer data) {
     PasteboardSelectionData* clipboardData = reinterpret_cast<PasteboardSelectionData*>(data);
     ASSERT(clipboardData);
-    if ((gint)info == Pasteboard::generalPasteboard()->m_helper->getWebViewTargetInfoHtml())
+    if (info == Pasteboard::generalPasteboard()->helper()->getIdForTargetType(PasteboardHelper::TargetTypeMarkup))
         gtk_selection_data_set(selection_data, selection_data->target, 8,
                                reinterpret_cast<const guchar*>(clipboardData->markup()),
                                g_utf8_strlen(clipboardData->markup(), -1));
@@ -89,6 +89,11 @@
     delete m_helper;
 }
 
+PasteboardHelper* Pasteboard::helper()
+{
+    return m_helper;
+}
+
 void Pasteboard::setHelper(PasteboardHelper* helper)
 {
     m_helper = helper;
@@ -121,7 +126,7 @@
         return;
 
     GtkClipboard* clipboard = m_helper->getClipboard(frame);
-    GtkClipboard* primary = m_helper->getPrimary(frame);
+    GtkClipboard* primary = m_helper->getPrimarySelectionClipboard(frame);
     CString utf8 = url.string().utf8();
     gtk_clipboard_set_text(clipboard, utf8.data(), utf8.length());
     gtk_clipboard_set_text(primary, utf8.data(), utf8.length());
@@ -161,7 +166,7 @@
                                                           bool allowPlainText, bool& chosePlainText)
 {
     GdkAtom textHtml = gdk_atom_intern_static_string("text/html");
-    GtkClipboard* clipboard = m_helper->getCurrentTarget(frame);
+    GtkClipboard* clipboard = m_helper->getCurrentClipboard(frame);
     chosePlainText = false;
 
     if (GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, textHtml)) {
@@ -196,7 +201,7 @@
 
 String Pasteboard::plainText(Frame* frame)
 {
-    GtkClipboard* clipboard = m_helper->getCurrentTarget(frame);
+    GtkClipboard* clipboard = m_helper->getCurrentClipboard(frame);
 
     gchar* utf8 = gtk_clipboard_wait_for_text(clipboard);
 
diff --git a/WebCore/platform/gtk/PasteboardHelper.cpp b/WebCore/platform/gtk/PasteboardHelper.cpp
new file mode 100644
index 0000000..be32ea5
--- /dev/null
+++ b/WebCore/platform/gtk/PasteboardHelper.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2010 Martin Robinson <mrobinson@webkit.org>
+ * All rights reserved.
+ *
+ * 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 "PasteboardHelper.h"
+
+#include "Chrome.h"
+#include "DataObjectGtk.h"
+#include "Frame.h"
+#include "Page.h"
+#include "Pasteboard.h"
+#include <gtk/gtk.h>
+#include <wtf/gobject/GOwnPtr.h>
+
+namespace WebCore {
+
+static GdkAtom gdkMarkupAtom = gdk_atom_intern("text/html", FALSE);
+
+PasteboardHelper::PasteboardHelper()
+    : m_targetList(gtk_target_list_new(0, 0))
+{
+}
+
+PasteboardHelper::~PasteboardHelper()
+{
+    gtk_target_list_unref(m_targetList);
+}
+
+
+void PasteboardHelper::initializeTargetList()
+{
+    gtk_target_list_add_text_targets(m_targetList, getIdForTargetType(TargetTypeText));
+    gtk_target_list_add(m_targetList, gdkMarkupAtom, 0, getIdForTargetType(TargetTypeMarkup));
+}
+
+static inline GtkWidget* widgetFromFrame(Frame* frame)
+{
+    ASSERT(frame);
+    Page* page = frame->page();
+    ASSERT(page);
+    Chrome* chrome = page->chrome();
+    ASSERT(chrome);
+    PlatformPageClient client = chrome->platformPageClient();
+    ASSERT(client);
+    return client;
+}
+
+GtkClipboard* PasteboardHelper::getCurrentClipboard(Frame* frame)
+{
+    if (usePrimarySelectionClipboard(widgetFromFrame(frame)))
+        return getPrimarySelectionClipboard(frame);
+    return getClipboard(frame);
+}
+
+GtkClipboard* PasteboardHelper::getClipboard(Frame* frame) const
+{
+    return gtk_widget_get_clipboard(widgetFromFrame(frame), GDK_SELECTION_CLIPBOARD);
+}
+
+GtkClipboard* PasteboardHelper::getPrimarySelectionClipboard(Frame* frame) const
+{
+    return gtk_widget_get_clipboard(widgetFromFrame(frame), GDK_SELECTION_PRIMARY);
+}
+
+GtkTargetList* PasteboardHelper::targetList() const
+{
+    return m_targetList;
+}
+
+void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint info, DataObjectGtk* dataObject)
+{
+    if (info == getIdForTargetType(TargetTypeText))
+        gtk_selection_data_set_text(selectionData, dataObject->text().utf8().data(), -1);
+    else if (info == getIdForTargetType(TargetTypeMarkup)) {
+        GOwnPtr<gchar> markup(g_strdup(dataObject->markup().utf8().data()));
+        gtk_selection_data_set(selectionData, selectionData->target, 8,
+                               reinterpret_cast<const guchar*>(markup.get()),
+                               strlen(markup.get()));
+    }
+}
+
+GtkTargetList* PasteboardHelper::targetListForDataObject(DataObjectGtk* dataObject)
+{
+    GtkTargetList* list = gtk_target_list_new(0, 0);
+
+    if (dataObject->hasText())
+        gtk_target_list_add_text_targets(list, getIdForTargetType(TargetTypeText));
+
+    if (dataObject->hasMarkup())
+        gtk_target_list_add(list, gdkMarkupAtom, 0, getIdForTargetType(TargetTypeMarkup));
+
+    return list;
+}
+
+static DataObjectGtk* settingClipboardDataObject = 0;
+
+static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionData *selectionData, guint info, gpointer data)
+{
+    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
+    ASSERT(dataObject);
+    Pasteboard::generalPasteboard()->helper()->fillSelectionData(selectionData, info, dataObject);
+}
+
+static void clearClipboardContentsCallback(GtkClipboard* clipboard, gpointer data)
+{
+    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
+    ASSERT(dataObject);
+
+    // Only clear the DataObject for this clipboard if we are not currently setting it.
+    if (dataObject != settingClipboardDataObject)
+        dataObject->clear();
+
+    if (!data)
+        return;
+
+    GClosure* callback = static_cast<GClosure*>(data);
+    GValue firstArgument = {0, {{0}}};
+    g_value_init(&firstArgument, G_TYPE_POINTER);
+    g_value_set_pointer(&firstArgument, clipboard);
+    g_closure_invoke(callback, 0, 1, &firstArgument, 0);
+    g_closure_unref(callback);
+}
+
+void PasteboardHelper::writeClipboardContents(GtkClipboard* clipboard, GClosure* callback)
+{
+    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
+    GtkTargetList* list = targetListForDataObject(dataObject);
+
+    int numberOfTargets;
+    GtkTargetEntry* table = gtk_target_table_new_from_list(list, &numberOfTargets);
+
+    if (numberOfTargets > 0 && table) {
+        settingClipboardDataObject = dataObject;
+
+        gtk_clipboard_set_with_data(clipboard, table, numberOfTargets,
+            getClipboardContentsCallback, clearClipboardContentsCallback, callback);
+
+        settingClipboardDataObject = 0;
+
+    } else
+        gtk_clipboard_clear(clipboard);
+
+    if (table)
+        gtk_target_table_free(table, numberOfTargets);
+    gtk_target_list_unref(list);
+}
+
+}
+
diff --git a/WebCore/platform/gtk/PasteboardHelper.h b/WebCore/platform/gtk/PasteboardHelper.h
index fff9a9b..6e5d366 100644
--- a/WebCore/platform/gtk/PasteboardHelper.h
+++ b/WebCore/platform/gtk/PasteboardHelper.h
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Luca Bruno <lethalman88@gmail.com>
  * Copyright (C) 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Martin Robinson <mrobinson@webkit.org>
  * All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -32,18 +33,35 @@
 
 typedef struct _GtkClipboard GtkClipboard;
 typedef struct _GtkTargetList GtkTargetList;
+typedef struct _GtkWidget GtkWidget;
+typedef struct _GtkSelectionData GtkSelectionData;
 
 namespace WebCore {
 
+class DataObjectGtk;
+
 class PasteboardHelper {
 public:
-    virtual ~PasteboardHelper() {};
+    PasteboardHelper();
+    virtual ~PasteboardHelper();
 
-    virtual GtkClipboard* getCurrentTarget(Frame*) const = 0;
-    virtual GtkClipboard* getClipboard(Frame*) const = 0;
-    virtual GtkClipboard* getPrimary(Frame*) const = 0;
-    virtual GtkTargetList* targetList() const = 0;
-    virtual gint getWebViewTargetInfoHtml() const = 0;
+    GtkClipboard* getCurrentClipboard(Frame*);
+    GtkClipboard* getClipboard(Frame*) const;
+    GtkClipboard* getPrimarySelectionClipboard(Frame*) const;
+    GtkTargetList* targetList() const;
+    void fillSelectionData(GtkSelectionData*, guint, DataObjectGtk*);
+    void writeClipboardContents(GtkClipboard*, GClosure*);
+
+    enum PasteboardTargetType { TargetTypeText, TargetTypeMarkup, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeImage, TargetTypeUnknown };
+    virtual guint getIdForTargetType(PasteboardTargetType) = 0;
+
+protected:
+    void initializeTargetList();
+    virtual bool usePrimarySelectionClipboard(GtkWidget*) = 0;
+
+private:
+    GtkTargetList* m_targetList;
+    GtkTargetList* targetListForDataObject(DataObjectGtk*);
 };
 
 }
diff --git a/WebCore/platform/gtk/PlatformScreenGtk.cpp b/WebCore/platform/gtk/PlatformScreenGtk.cpp
index 92ccff4..9341714 100644
--- a/WebCore/platform/gtk/PlatformScreenGtk.cpp
+++ b/WebCore/platform/gtk/PlatformScreenGtk.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
+#include "GtkVersioning.h"
 #include "HostWindow.h"
 #include "ScrollView.h"
 #include "Widget.h"
@@ -54,13 +55,9 @@
     if (!container)
         return 0;
 
-    if (!GTK_WIDGET_REALIZED(container)) {
+    if (!gtk_widget_get_realized(container)) {
         GtkWidget* toplevel = gtk_widget_get_toplevel(container);
-#if GTK_CHECK_VERSION(2, 18, 0)
         if (gtk_widget_is_toplevel(toplevel))
-#else
-        if (GTK_WIDGET_TOPLEVEL(toplevel))
-#endif
             container = toplevel;
         else
             return 0;
@@ -98,11 +95,7 @@
         return FloatRect();
 
     GtkWidget* container = gtk_widget_get_toplevel(GTK_WIDGET(widget->root()->hostWindow()->platformPageClient()));
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (!gtk_widget_is_toplevel(container))
-#else
-    if (!GTK_WIDGET_TOPLEVEL(container))
-#endif
         return FloatRect();
 
     GdkScreen* screen = gtk_widget_has_screen(container) ? gtk_widget_get_screen(container) : gdk_screen_get_default();
@@ -126,7 +119,7 @@
     if (!container)
         return FloatRect();
 
-    if (!GTK_WIDGET_REALIZED(container))
+    if (!gtk_widget_get_realized(container))
         return screenRect(widget);
 
     GdkDrawable* rootWindow = GDK_DRAWABLE(gtk_widget_get_root_window(container));
diff --git a/WebCore/platform/gtk/PopupMenuGtk.cpp b/WebCore/platform/gtk/PopupMenuGtk.cpp
index 0363ac4..1620b3b 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.cpp
+++ b/WebCore/platform/gtk/PopupMenuGtk.cpp
@@ -25,10 +25,10 @@
 #include "config.h"
 #include "PopupMenu.h"
 
-#include "CString.h"
 #include "FrameView.h"
 #include "HostWindow.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 #include <gtk/gtk.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index e19e2fa..93794ff 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -25,7 +25,6 @@
 #include "RenderThemeGtk.h"
 
 #include "AffineTransform.h"
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "Gradient.h"
 #include "GraphicsContext.h"
@@ -37,6 +36,7 @@
 #include "RenderObject.h"
 #include "UserAgentStyleSheets.h"
 #include "gtkdrawing.h"
+#include <wtf/text/CString.h>
 
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp
index e868250..3df3cb5 100644
--- a/WebCore/platform/gtk/ScrollViewGtk.cpp
+++ b/WebCore/platform/gtk/ScrollViewGtk.cpp
@@ -168,7 +168,7 @@
                            measuredWidget->allocation.height));
 }
 
-void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode)
+void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool, bool)
 {
     if (horizontalMode == m_horizontalScrollbarMode && verticalMode == m_verticalScrollbarMode)
         return;
diff --git a/WebCore/platform/gtk/ScrollbarGtk.cpp b/WebCore/platform/gtk/ScrollbarGtk.cpp
index 0c3037a..00cbcf0 100644
--- a/WebCore/platform/gtk/ScrollbarGtk.cpp
+++ b/WebCore/platform/gtk/ScrollbarGtk.cpp
@@ -196,7 +196,7 @@
 /*
  * Strategy to painting a Widget:
  *  1.) do not paint if there is no GtkWidget set
- *  2.) We assume that GTK_NO_WINDOW is set and that frameRectsChanged positioned
+ *  2.) We assume that the widget has no window and that frameRectsChanged positioned
  *      the widget correctly. ATM we do not honor the GraphicsContext translation.
  */
 void ScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
@@ -208,7 +208,7 @@
         return;
 
     GtkWidget* widget = platformWidget();
-    ASSERT(GTK_WIDGET_NO_WINDOW(widget));
+    ASSERT(!gtk_widget_get_has_window(widget));
 
     GdkEvent* event = gdk_event_new(GDK_EXPOSE);
     event->expose = *context->gdkExposeEvent();
diff --git a/WebCore/platform/gtk/SharedBufferGtk.cpp b/WebCore/platform/gtk/SharedBufferGtk.cpp
index 783fec6..db04d80 100644
--- a/WebCore/platform/gtk/SharedBufferGtk.cpp
+++ b/WebCore/platform/gtk/SharedBufferGtk.cpp
@@ -19,8 +19,8 @@
 #include "config.h"
 #include "SharedBuffer.h"
 
-#include "CString.h"
 #include "FileSystem.h"
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 
diff --git a/WebCore/platform/gtk/SharedTimerGtk.cpp b/WebCore/platform/gtk/SharedTimerGtk.cpp
index 0a760ed..092df95 100644
--- a/WebCore/platform/gtk/SharedTimerGtk.cpp
+++ b/WebCore/platform/gtk/SharedTimerGtk.cpp
@@ -63,10 +63,7 @@
     }
 
     stopSharedTimer();
-    if (intervalInMS == 0)
-        sharedTimer = g_idle_add(timeout_cb, NULL);
-    else
-        sharedTimer = g_timeout_add_full(G_PRIORITY_DEFAULT, intervalInMS, timeout_cb, NULL, NULL);
+    sharedTimer = g_timeout_add(intervalInMS, timeout_cb, NULL);
 }
 
 void stopSharedTimer()
diff --git a/WebCore/platform/haiku/CursorHaiku.cpp b/WebCore/platform/haiku/CursorHaiku.cpp
index 7f010d5..21d678a 100644
--- a/WebCore/platform/haiku/CursorHaiku.cpp
+++ b/WebCore/platform/haiku/CursorHaiku.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -30,9 +31,6 @@
 
 #include "NotImplemented.h"
 
-#include <app/AppDefs.h>
-
-
 namespace WebCore {
 
 Cursor::Cursor(PlatformCursor cursor)
@@ -41,196 +39,232 @@
 }
 
 Cursor::Cursor(const Cursor& other)
-    : m_impl(other.m_impl)
+    : m_impl(0)
 {
+    *this = other;
 }
 
 Cursor::~Cursor()
 {
+    delete m_impl;
 }
 
 Cursor::Cursor(Image*, const IntPoint&)
+    : m_impl(0)
 {
     notImplemented();
 }
 
 Cursor& Cursor::operator=(const Cursor& other)
 {
-    m_impl = other.m_impl;
+    delete m_impl;
+    m_impl = other.m_impl ? new BCursor(*other.m_impl) : 0;
     return *this;
 }
 
-static Cursor globalCursor = const_cast<BCursor*>(B_CURSOR_SYSTEM_DEFAULT);
-static Cursor ibeamCursor = const_cast<BCursor*>(B_CURSOR_I_BEAM);
+static Cursor createCursorByID(BCursorID id)
+{
+    return Cursor(new BCursor(id));
+}
 
 const Cursor& pointerCursor()
 {
-    return globalCursor;
+    static Cursor cursorSystemDefault(0);
+    return cursorSystemDefault;
 }
 
 const Cursor& moveCursor()
 {
-    return globalCursor;
+    static Cursor cursorMove = createCursorByID(B_CURSOR_ID_MOVE);
+    return cursorMove;
 }
 
 const Cursor& crossCursor()
 {
-    return globalCursor;
+    static Cursor cursorCrossHair = createCursorByID(B_CURSOR_ID_CROSS_HAIR);
+    return cursorCrossHair;
 }
 
 const Cursor& handCursor()
 {
-    return globalCursor;
+    static Cursor cursorFollowLink = createCursorByID(B_CURSOR_ID_FOLLOW_LINK);
+    return cursorFollowLink;
 }
 
 const Cursor& iBeamCursor()
 {
-    return ibeamCursor;
+    static Cursor cursorIBeam = createCursorByID(B_CURSOR_ID_I_BEAM);
+    return cursorIBeam;
 }
 
 const Cursor& waitCursor()
 {
-    return globalCursor;
+    static Cursor cursorProgress = createCursorByID(B_CURSOR_ID_PROGRESS);
+    return cursorProgress;
 }
 
 const Cursor& helpCursor()
 {
-    return globalCursor;
+    static Cursor cursorHelp = createCursorByID(B_CURSOR_ID_HELP);
+    return cursorHelp;
 }
 
 const Cursor& eastResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeEast = createCursorByID(B_CURSOR_ID_RESIZE_EAST);
+    return cursorResizeEast;
 }
 
 const Cursor& northResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorth = createCursorByID(B_CURSOR_ID_RESIZE_NORTH);
+    return cursorResizeNorth;
 }
 
 const Cursor& northEastResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorthEast = createCursorByID(B_CURSOR_ID_RESIZE_NORTH_EAST);
+    return cursorResizeNorthEast;
 }
 
 const Cursor& northWestResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorthWest = createCursorByID(B_CURSOR_ID_RESIZE_NORTH_WEST);
+    return cursorResizeNorthWest;
 }
 
 const Cursor& southResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeSouth = createCursorByID(B_CURSOR_ID_RESIZE_SOUTH);
+    return cursorResizeSouth;
 }
 
 const Cursor& southEastResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeSouthEast = createCursorByID(B_CURSOR_ID_RESIZE_SOUTH_EAST);
+    return cursorResizeSouthEast;
 }
 
 const Cursor& southWestResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeSouthWest = createCursorByID(B_CURSOR_ID_RESIZE_SOUTH_WEST);
+    return cursorResizeSouthWest;
 }
 
 const Cursor& westResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeWest = createCursorByID(B_CURSOR_ID_RESIZE_WEST);
+    return cursorResizeWest;
 }
 
 const Cursor& northSouthResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorthSouth = createCursorByID(B_CURSOR_ID_RESIZE_NORTH_SOUTH);
+    return cursorResizeNorthSouth;
 }
 
 const Cursor& eastWestResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeEastWest = createCursorByID(B_CURSOR_ID_RESIZE_EAST_WEST);
+    return cursorResizeEastWest;
 }
 
 const Cursor& northEastSouthWestResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorthEastSouthWest = createCursorByID(B_CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST);
+    return cursorResizeNorthEastSouthWest;
 }
 
 const Cursor& northWestSouthEastResizeCursor()
 {
-    return globalCursor;
+    static Cursor cursorResizeNorthWestSouthEast = createCursorByID(B_CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST);
+    return cursorResizeNorthWestSouthEast;
 }
 
 const Cursor& columnResizeCursor()
 {
-    return globalCursor;
+    return eastWestResizeCursor();
 }
 
 const Cursor& rowResizeCursor()
 {
-    return globalCursor;
+    return northSouthResizeCursor();
 }
 
 const Cursor& verticalTextCursor()
 {
-    return globalCursor;
+    static Cursor cursorIBeamHorizontal = createCursorByID(B_CURSOR_ID_I_BEAM_HORIZONTAL);
+    return cursorIBeamHorizontal;
 }
 
 const Cursor& cellCursor()
 {
-    return globalCursor;
+    return pointerCursor();
 }
 
 const Cursor& contextMenuCursor()
 {
-    return globalCursor;
+    static Cursor cursorContextMenu = createCursorByID(B_CURSOR_ID_CONTEXT_MENU);
+    return cursorContextMenu;
 }
 
 const Cursor& noDropCursor()
 {
-    return globalCursor;
+    static Cursor cursorNotAllowed = createCursorByID(B_CURSOR_ID_NOT_ALLOWED);
+    return cursorNotAllowed;
 }
 
 const Cursor& copyCursor()
 {
-    return globalCursor;
+    static Cursor cursorCopy = createCursorByID(B_CURSOR_ID_COPY);
+    return cursorCopy;
 }
 
 const Cursor& progressCursor()
 {
-    return globalCursor;
+    static Cursor cursorProgress = createCursorByID(B_CURSOR_ID_PROGRESS);
+    return cursorProgress;
 }
 
 const Cursor& aliasCursor()
 {
-    return globalCursor;
+    return handCursor();
 }
 
 const Cursor& noneCursor()
 {
-    return globalCursor;
+    static Cursor cursorNoCursor = createCursorByID(B_CURSOR_ID_NO_CURSOR);
+    return cursorNoCursor;
 }
 
 const Cursor& notAllowedCursor()
 {
-    return globalCursor;
+    static Cursor cursorNotAllowed = createCursorByID(B_CURSOR_ID_NOT_ALLOWED);
+    return cursorNotAllowed;
 }
 
 const Cursor& zoomInCursor()
 {
-    return globalCursor;
+    static Cursor cursorZoomIn = createCursorByID(B_CURSOR_ID_ZOOM_IN);
+    return cursorZoomIn;
 }
 
 const Cursor& zoomOutCursor()
 {
-    return globalCursor;
+    static Cursor cursorZoomOut = createCursorByID(B_CURSOR_ID_ZOOM_OUT);
+    return cursorZoomOut;
 }
 
 const Cursor& grabCursor()
 {
-    return globalCursor;
+    static Cursor cursorGrab = createCursorByID(B_CURSOR_ID_GRAB);
+    return cursorGrab;
 }
 
 const Cursor& grabbingCursor()
 {
-    return globalCursor;
+    static Cursor cursorGrabbing = createCursorByID(B_CURSOR_ID_GRABBING);
+    return cursorGrabbing;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/FileSystemHaiku.cpp b/WebCore/platform/haiku/FileSystemHaiku.cpp
index 3d9161a..b0d34f2 100644
--- a/WebCore/platform/haiku/FileSystemHaiku.cpp
+++ b/WebCore/platform/haiku/FileSystemHaiku.cpp
@@ -29,9 +29,9 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <Directory.h>
 #include <Entry.h>
diff --git a/WebCore/platform/haiku/KeyboardCodes.h b/WebCore/platform/haiku/KeyboardCodes.h
deleted file mode 100644
index 6f0d490..0000000
--- a/WebCore/platform/haiku/KeyboardCodes.h
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
- *
- * 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 COMPUTER, 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 KeyboardCodes_h
-#define KeyboardCodes_h
-
-
-namespace WebCore {
-    // VK_LBUTTON (01) Left mouse button
-    // VK_RBUTTON (02) Right mouse button
-    // VK_CANCEL (03) Control-break processing
-    // VK_MBUTTON (04) Middle mouse button (three-button mouse)
-    // VK_XBUTTON1 (05)
-    // VK_XBUTTON2 (06)
-
-    // VK_BACK (08) BACKSPACE key
-    const int VK_BACK = 0x08;
-
-    // VK_TAB (09) TAB key
-    const int VK_TAB = 0x09;
-
-    // VK_CLEAR (0C) CLEAR key
-    const int VK_CLEAR = 0x0C;
-
-    // VK_RETURN (0D)
-    const int VK_RETURN = 0x0D;
-
-    // VK_SHIFT (10) SHIFT key
-    const int VK_SHIFT = 0x10;
-
-    // VK_CONTROL (11) CTRL key
-    const int VK_CONTROL = 0x11;
-
-    // VK_MENU (12) ALT key
-    const int VK_MENU = 0x12;
-
-    // VK_PAUSE (13) PAUSE key
-    const int VK_PAUSE = 0x13;
-
-    // VK_CAPITAL (14) CAPS LOCK key
-    const int VK_CAPITAL = 0x14;
-
-    // VK_KANA (15) Input Method Editor (IME) Kana mode
-    const int VK_KANA = 0x15;
-
-    // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
-    // VK_HANGUL (15) IME Hangul mode
-    const int VK_HANGUL = 0x15;
-
-    // VK_JUNJA (17) IME Junja mode
-    const int VK_JUNJA = 0x17;
-
-    // VK_FINAL (18) IME final mode
-    const int VK_FINAL = 0x18;
-
-    // VK_HANJA (19) IME Hanja mode
-    const int VK_HANJA = 0x19;
-
-    // VK_KANJI (19) IME Kanji mode
-    const int VK_KANJI = 0x19;
-
-    // VK_ESCAPE (1B) ESC key
-    const int VK_ESCAPE = 0x1B;
-
-    // VK_CONVERT (1C) IME convert
-    const int VK_CONVERT = 0x1C;
-
-    // VK_NONCONVERT (1D) IME nonconvert
-    const int VK_NONCONVERT = 0x1D;
-
-    // VK_ACCEPT (1E) IME accept
-    const int VK_ACCEPT = 0x1E;
-
-    // VK_MODECHANGE (1F) IME mode change request
-    const int VK_MODECHANGE = 0x1F;
-
-    // VK_SPACE (20) SPACEBAR
-    const int VK_SPACE = 0x20;
-
-    // VK_PRIOR (21) PAGE UP key
-    const int VK_PRIOR = 0x21;
-
-    // VK_NEXT (22) PAGE DOWN key
-    const int VK_NEXT = 0x22;
-
-    // VK_END (23) END key
-    const int VK_END = 0x23;
-
-    // VK_HOME (24) HOME key
-    const int VK_HOME = 0x24;
-
-    // VK_LEFT (25) LEFT ARROW key
-    const int VK_LEFT = 0x25;
-
-    // VK_UP (26) UP ARROW key
-    const int VK_UP = 0x26;
-
-    // VK_RIGHT (27) RIGHT ARROW key
-    const int VK_RIGHT = 0x27;
-
-    // VK_DOWN (28) DOWN ARROW key
-    const int VK_DOWN = 0x28;
-
-    // VK_SELECT (29) SELECT key
-    const int VK_SELECT = 0x29;
-
-    // VK_PRINT (2A) PRINT key
-    const int VK_PRINT = 0x2A;
-
-    // VK_EXECUTE (2B) EXECUTE key
-    const int VK_EXECUTE = 0x2B;
-
-    // VK_SNAPSHOT (2C) PRINT SCREEN key
-    const int VK_SNAPSHOT = 0x2C;
-
-    // VK_INSERT (2D) INS key
-    const int VK_INSERT = 0x2D;
-
-    // VK_DELETE (2E) DEL key
-    const int VK_DELETE = 0x2E;
-
-    // VK_HELP (2F) HELP key
-    const int VK_HELP = 0x2F;
-
-    // (30) 0 key
-    const int VK_0 = 0x30;
-
-    // (31) 1 key
-    const int VK_1 = 0x31;
-
-    // (32) 2 key
-    const int VK_2 = 0x32;
-
-    // (33) 3 key
-    const int VK_3 = 0x33;
-
-    // (34) 4 key
-    const int VK_4 = 0x34;
-
-    // (35) 5 key;
-
-    const int VK_5 = 0x35;
-
-    // (36) 6 key
-    const int VK_6 = 0x36;
-
-    // (37) 7 key
-    const int VK_7 = 0x37;
-
-    // (38) 8 key
-    const int VK_8 = 0x38;
-
-    // (39) 9 key
-    const int VK_9 = 0x39;
-
-    // (41) A key
-    const int VK_A = 0x41;
-
-    // (42) B key
-    const int VK_B = 0x42;
-
-    // (43) C key
-    const int VK_C = 0x43;
-
-    // (44) D key
-    const int VK_D = 0x44;
-
-    // (45) E key
-    const int VK_E = 0x45;
-
-    // (46) F key
-    const int VK_F = 0x46;
-
-    // (47) G key
-    const int VK_G = 0x47;
-
-    // (48) H key
-    const int VK_H = 0x48;
-
-    // (49) I key
-    const int VK_I = 0x49;
-
-    // (4A) J key
-    const int VK_J = 0x4A;
-
-    // (4B) K key
-    const int VK_K = 0x4B;
-
-    // (4C) L key
-    const int VK_L = 0x4C;
-
-    // (4D) M key
-    const int VK_M = 0x4D;
-
-    // (4E) N key
-    const int VK_N = 0x4E;
-
-    // (4F) O key
-    const int VK_O = 0x4F;
-
-    // (50) P key
-    const int VK_P = 0x50;
-
-    // (51) Q key
-    const int VK_Q = 0x51;
-
-    // (52) R key
-    const int VK_R = 0x52;
-
-    // (53) S key
-    const int VK_S = 0x53;
-
-    // (54) T key
-    const int VK_T = 0x54;
-
-    // (55) U key
-    const int VK_U = 0x55;
-
-    // (56) V key
-    const int VK_V = 0x56;
-
-    // (57) W key
-    const int VK_W = 0x57;
-
-    // (58) X key
-    const int VK_X = 0x58;
-
-    // (59) Y key
-    const int VK_Y = 0x59;
-
-    // (5A) Z key
-    const int VK_Z = 0x5A;
-
-    // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-    const int VK_LWIN = 0x5B;
-
-    // VK_RWIN (5C) Right Windows key (Natural keyboard)
-    const int VK_RWIN = 0x5C;
-
-    // VK_APPS (5D) Applications key (Natural keyboard)
-    const int VK_APPS = 0x5D;
-
-    // VK_SLEEP (5F) Computer Sleep key
-    const int VK_SLEEP = 0x5F;
-
-    // VK_NUMPAD0 (60) Numeric keypad 0 key
-    const int VK_NUMPAD0 = 0x60;
-
-    // VK_NUMPAD1 (61) Numeric keypad 1 key
-    const int VK_NUMPAD1 = 0x61;
-
-    // VK_NUMPAD2 (62) Numeric keypad 2 key
-    const int VK_NUMPAD2 = 0x62;
-
-    // VK_NUMPAD3 (63) Numeric keypad 3 key
-    const int VK_NUMPAD3 = 0x63;
-
-    // VK_NUMPAD4 (64) Numeric keypad 4 key
-    const int VK_NUMPAD4 = 0x64;
-
-    // VK_NUMPAD5 (65) Numeric keypad 5 key
-    const int VK_NUMPAD5 = 0x65;
-
-    // VK_NUMPAD6 (66) Numeric keypad 6 key
-    const int VK_NUMPAD6 = 0x66;
-
-    // VK_NUMPAD7 (67) Numeric keypad 7 key
-    const int VK_NUMPAD7 = 0x67;
-
-    // VK_NUMPAD8 (68) Numeric keypad 8 key
-    const int VK_NUMPAD8 = 0x68;
-
-    // VK_NUMPAD9 (69) Numeric keypad 9 key
-    const int VK_NUMPAD9 = 0x69;
-
-    // VK_MULTIPLY (6A) Multiply key
-    const int VK_MULTIPLY = 0x6A;
-
-    // VK_ADD (6B) Add key
-    const int VK_ADD = 0x6B;
-
-    // VK_SEPARATOR (6C) Separator key
-    const int VK_SEPARATOR = 0x6C;
-
-    // VK_SUBTRACT (6D) Subtract key
-    const int VK_SUBTRACT = 0x6D;
-
-    // VK_DECIMAL (6E) Decimal key
-    const int VK_DECIMAL = 0x6E;
-
-    // VK_DIVIDE (6F) Divide key
-    const int VK_DIVIDE = 0x6F;
-
-    // VK_F1 (70) F1 key
-    const int VK_F1 = 0x70;
-
-    // VK_F2 (71) F2 key
-    const int VK_F2 = 0x71;
-
-    // VK_F3 (72) F3 key
-    const int VK_F3 = 0x72;
-
-    // VK_F4 (73) F4 key
-    const int VK_F4 = 0x73;
-
-    // VK_F5 (74) F5 key
-    const int VK_F5 = 0x74;
-
-    // VK_F6 (75) F6 key
-    const int VK_F6 = 0x75;
-
-    // VK_F7 (76) F7 key
-    const int VK_F7 = 0x76;
-
-    // VK_F8 (77) F8 key
-    const int VK_F8 = 0x77;
-
-    // VK_F9 (78) F9 key
-    const int VK_F9 = 0x78;
-
-    // VK_F10 (79) F10 key
-    const int VK_F10 = 0x79;
-
-    // VK_F11 (7A) F11 key
-    const int VK_F11 = 0x7A;
-
-    // VK_F12 (7B) F12 key
-    const int VK_F12 = 0x7B;
-
-    // VK_F13 (7C) F13 key
-    const int VK_F13 = 0x7C;
-
-    // VK_F14 (7D) F14 key
-    const int VK_F14 = 0x7D;
-
-    // VK_F15 (7E) F15 key
-    const int VK_F15 = 0x7E;
-
-    // VK_F16 (7F) F16 key
-    const int VK_F16 = 0x7F;
-
-    // VK_F17 (80H) F17 key
-    const int VK_F17 = 0x80;
-
-    // VK_F18 (81H) F18 key
-    const int VK_F18 = 0x81;
-
-    // VK_F19 (82H) F19 key
-    const int VK_F19 = 0x82;
-
-    // VK_F20 (83H) F20 key
-    const int VK_F20 = 0x83;
-
-    // VK_F21 (84H) F21 key
-    const int VK_F21 = 0x84;
-
-    // VK_F22 (85H) F22 key
-    const int VK_F22 = 0x85;
-
-    // VK_F23 (86H) F23 key
-    const int VK_F23 = 0x86;
-
-    // VK_F24 (87H) F24 key
-    const int VK_F24 = 0x87;
-
-    // VK_NUMLOCK (90) NUM LOCK key
-    const int VK_NUMLOCK = 0x90;
-
-    // VK_SCROLL (91) SCROLL LOCK key
-    const int VK_SCROLL = 0x91;
-
-    // VK_LSHIFT (A0) Left SHIFT key
-    const int VK_LSHIFT = 0xA0;
-
-    // VK_RSHIFT (A1) Right SHIFT key
-    const int VK_RSHIFT = 0xA1;
-
-    // VK_LCONTROL (A2) Left CONTROL key
-    const int VK_LCONTROL = 0xA2;
-
-    // VK_RCONTROL (A3) Right CONTROL key
-    const int VK_RCONTROL = 0xA3;
-
-    // VK_LMENU (A4) Left MENU key
-    const int VK_LMENU = 0xA4;
-
-    // VK_RMENU (A5) Right MENU key
-    const int VK_RMENU = 0xA5;
-
-    // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-    const int VK_BROWSER_BACK = 0xA6;
-
-    // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-    const int VK_BROWSER_FORWARD = 0xA7;
-
-    // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-    const int VK_BROWSER_REFRESH = 0xA8;
-
-    // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-    const int VK_BROWSER_STOP = 0xA9;
-
-    // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-    const int VK_BROWSER_SEARCH = 0xAA;
-
-    // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-    const int VK_BROWSER_FAVORITES = 0xAB;
-
-    // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-    const int VK_BROWSER_HOME = 0xAC;
-
-    // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-    const int VK_VOLUME_MUTE = 0xAD;
-
-    // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-    const int VK_VOLUME_DOWN = 0xAE;
-
-    // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-    const int VK_VOLUME_UP = 0xAF;
-
-    // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-    const int VK_MEDIA_NEXT_TRACK = 0xB0;
-
-    // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-    const int VK_MEDIA_PREV_TRACK = 0xB1;
-
-    // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-    const int VK_MEDIA_STOP = 0xB2;
-
-    // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-    const int VK_MEDIA_PLAY_PAUSE = 0xB3;
-
-    // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-    const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
-
-    // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-    const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
-
-    // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-    const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
-
-    // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-    const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
-
-    // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
-    const int VK_OEM_1 = 0xBA;
-
-    // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-    const int VK_OEM_PLUS = 0xBB;
-
-    // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-    const int VK_OEM_COMMA = 0xBC;
-
-    // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-    const int VK_OEM_MINUS = 0xBD;
-
-    // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-    const int VK_OEM_PERIOD = 0xBE;
-
-    // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-    const int VK_OEM_2 = 0xBF;
-
-    // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-    const int VK_OEM_3 = 0xC0;
-
-    // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-    const int VK_OEM_4 = 0xDB;
-
-    // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-    const int VK_OEM_5 = 0xDC;
-
-    // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-    const int VK_OEM_6 = 0xDD;
-
-    // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-    const int VK_OEM_7 = 0xDE;
-
-    // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
-    const int VK_OEM_8 = 0xDF;
-
-    // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-    const int VK_OEM_102 = 0xE2;
-
-    // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-    const int VK_PROCESSKEY = 0xE5;
-
-    // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-    const int VK_PACKET = 0xE7;
-
-    // VK_ATTN (F6) Attn key
-    const int VK_ATTN = 0xF6;
-
-    // VK_CRSEL (F7) CrSel key
-    const int VK_CRSEL = 0xF7;
-
-    // VK_EXSEL (F8) ExSel key
-    const int VK_EXSEL = 0xF8;
-
-    // VK_EREOF (F9) Erase EOF key
-    const int VK_EREOF = 0xF9;
-
-    // VK_PLAY (FA) Play key
-    const int VK_PLAY = 0xFA;
-
-    // VK_ZOOM (FB) Zoom key
-    const int VK_ZOOM = 0xFB;
-
-    // VK_NONAME (FC) Reserved for future use
-    const int VK_NONAME = 0xFC;
-
-    // VK_PA1 (FD) PA1 key
-    const int VK_PA1 = 0xFD;
-
-    // VK_OEM_CLEAR (FE) Clear key
-    const int VK_OEM_CLEAR = 0xFE;
-
-    const int VK_UNKNOWN = 0;
-} // namespace WebCore
-
-#endif // KeyboardCodes_h
diff --git a/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp b/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp
index 59ae19a..685827e 100644
--- a/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp
+++ b/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
  * Copyright (C) 2007 Trolltech ASA
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,7 +30,8 @@
 #include "MIMETypeRegistry.h"
 
 #include "PlatformString.h"
-
+#include <MimeType.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 struct ExtensionMap {
@@ -37,11 +39,11 @@
     const char* mimeType;
 };
 
-static const ExtensionMap extensionMap [] = {
+static const ExtensionMap extensionMap[] = {
     { "bmp", "image/bmp" },
     { "gif", "image/gif" },
     { "html", "text/html" },
-    { "ico", "image/x-icon" },   
+    { "ico", "image/x-icon" },
     { "jpeg", "image/jpeg" },
     { "jpg", "image/jpeg" },
     { "js", "application/x-javascript" },
@@ -58,18 +60,34 @@
     { 0, 0 }
 };
 
-// FIXME: Use the Haiku MIME registry
-String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
+String MIMETypeRegistry::getMIMETypeForExtension(const String& ext)
 {
     String str = ext.lower();
-    const ExtensionMap *extMap = extensionMap;
+
+    // Try WebCore built-in types.
+    const ExtensionMap* extMap = extensionMap;
     while (extMap->extension) {
         if (str == extMap->extension)
             return extMap->mimeType;
         ++extMap;
     }
-    // unknown, let's just assume plain text
-    return "text/plain";
+
+    // Try system mime database.
+    String fakeFileName("filename.");
+    fakeFileName.append(str);
+
+    BMimeType type;
+    if (BMimeType::GuessMimeType(fakeFileName.utf8().data(), &type) == B_OK)
+        return type.Type();
+
+    // unknown
+    return String();
 }
+
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 } // namespace WebCore
 
diff --git a/WebCore/platform/haiku/PasteboardHaiku.cpp b/WebCore/platform/haiku/PasteboardHaiku.cpp
index 8ad72ca..defec3f 100644
--- a/WebCore/platform/haiku/PasteboardHaiku.cpp
+++ b/WebCore/platform/haiku/PasteboardHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -21,7 +22,7 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -32,11 +33,13 @@
 #include "Frame.h"
 #include "KURL.h"
 #include "NotImplemented.h"
+#include "TextResourceDecoder.h"
 #include "markup.h"
 #include <support/Locker.h>
 #include <Clipboard.h>
 #include <Message.h>
 #include <String.h>
+#include <wtf/text/CString.h>
 
 
 namespace WebCore {
@@ -45,44 +48,80 @@
 {
 }
 
+Pasteboard::~Pasteboard()
+{
+}
+
 Pasteboard* Pasteboard::generalPasteboard()
 {
-    static Pasteboard* pasteboard = new Pasteboard();
-    return pasteboard;
+    static Pasteboard pasteboard;
+    return &pasteboard;
 }
 
+// BClipboard unfortunately does not derive from BLocker, so we cannot use BAutolock.
+class AutoClipboardLocker {
+public:
+    AutoClipboardLocker(BClipboard* clipboard)
+        : m_clipboard(clipboard)
+        , m_isLocked(clipboard && clipboard->Lock())
+    {
+    }
+
+    ~AutoClipboardLocker()
+    {
+        if (m_isLocked)
+            m_clipboard->Unlock();
+    }
+
+    bool isLocked() const
+    {
+        return m_isLocked;
+    }
+
+private:
+    BClipboard* m_clipboard;
+    bool m_isLocked;
+};
+
 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
 {
-    BClipboard clipboard("WebKit");
-    if (!clipboard.Lock())
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
         return;
 
-    clipboard.Clear();
-    BMessage* data = clipboard.Data();
+    be_clipboard->Clear();
+    BMessage* data = be_clipboard->Data();
     if (!data)
         return;
 
-    data->AddString("text/plain", BString(frame->selectedText()));
-    clipboard.Commit();
+    BString string(frame->selectedText());
 
-    clipboard.Unlock();
+    // Replace unwanted representation of blank lines
+    const char* utf8BlankLine = "\302\240\n";
+    string.ReplaceAll(utf8BlankLine, "\n");
+
+    data->AddData("text/plain", B_MIME_TYPE, string.String(), string.Length());
+
+    BString markupString(createMarkup(selectedRange, 0, AnnotateForInterchange));
+    data->AddData("text/html", B_MIME_TYPE, markupString.String(), markupString.Length());
+
+    be_clipboard->Commit();
 }
 
 void Pasteboard::writePlainText(const String& text)
 {
-    BClipboard clipboard("WebKit");
-    if (!clipboard.Lock())
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
         return;
 
-    clipboard.Clear();
-    BMessage* data = clipboard.Data();
+    be_clipboard->Clear();
+    BMessage* data = be_clipboard->Data();
     if (!data)
         return;
 
-    data->AddString("text/plain", BString(text));
-    clipboard.Commit();
-
-    clipboard.Unlock();
+    BString string(text);
+    data->AddData("text/plain", B_MIME_TYPE, string.String(), string.Length());
+    be_clipboard->Commit();
 }
 
 bool Pasteboard::canSmartReplace()
@@ -93,18 +132,19 @@
 
 String Pasteboard::plainText(Frame* frame)
 {
-    BClipboard clipboard("WebKit");
-    if (!clipboard.Lock())
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
         return String();
 
-    BMessage* data = clipboard.Data();
+    BMessage* data = be_clipboard->Data();
     if (!data)
         return String();
 
+    const char* buffer = 0;
+    ssize_t bufferLength;
     BString string;
-    data->FindString("text/plain", &string);
-
-    clipboard.Unlock();
+    if (data->FindData("text/plain", B_MIME_TYPE, reinterpret_cast<const void**>(&buffer), &bufferLength) == B_OK)
+        string.Append(buffer, bufferLength);
 
     return string;
 }
@@ -112,26 +152,60 @@
 PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context,
                                                           bool allowPlainText, bool& chosePlainText)
 {
-    notImplemented();
+    chosePlainText = false;
+
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
+        return 0;
+
+    BMessage* data = be_clipboard->Data();
+    if (!data)
+        return 0;
+
+    const char* buffer = 0;
+    ssize_t bufferLength;
+    if (data->FindData("text/html", B_MIME_TYPE, reinterpret_cast<const void**>(&buffer), &bufferLength) == B_OK) {
+        RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", "UTF-8", true);
+        String html = decoder->decode(buffer, bufferLength);
+        html += decoder->flush();
+
+        if (!html.isEmpty()) {
+            RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(frame->document(), html, "", FragmentScriptingNotAllowed);
+            if (fragment)
+                return fragment.release();
+        }
+    }
+
+    if (!allowPlainText)
+        return 0;
+
+    if (data->FindData("text/plain", B_MIME_TYPE, reinterpret_cast<const void**>(&buffer), &bufferLength) == B_OK) {
+        BString plainText(buffer, bufferLength);
+
+        chosePlainText = true;
+        RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), plainText);
+        if (fragment)
+            return fragment.release();
+    }
+
     return 0;
 }
 
 void Pasteboard::writeURL(const KURL& url, const String&, Frame*)
 {
-    BClipboard clipboard("WebKit");
-    if (!clipboard.Lock())
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
         return;
 
-    clipboard.Clear();
+    be_clipboard->Clear();
 
-    BMessage* data = clipboard.Data();
+    BMessage* data = be_clipboard->Data();
     if (!data)
         return;
 
-    data->AddString("text/plain", url.string());
-    clipboard.Commit();
-
-    clipboard.Unlock();
+    BString string(url.string());
+    data->AddData("text/plain", B_MIME_TYPE, string.String(), string.Length());
+    be_clipboard->Commit();
 }
 
 void Pasteboard::writeImage(Node*, const KURL&, const String&)
@@ -141,14 +215,12 @@
 
 void Pasteboard::clear()
 {
-    BClipboard clipboard("WebKit");
-    if (!clipboard.Lock())
+    AutoClipboardLocker locker(be_clipboard);
+    if (!locker.isLocked())
         return;
 
-    clipboard.Clear();
-    clipboard.Commit();
-
-    clipboard.Unlock();
+    be_clipboard->Clear();
+    be_clipboard->Commit();
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp b/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
index 1545dfb..ecf5921 100644
--- a/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
+++ b/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
  * Copyright (C) 2008 Andrea Anzani <andrea.anzani@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -29,11 +30,12 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
+#include "WindowsKeyboardCodes.h"
 #include <InterfaceDefs.h>
 #include <Message.h>
 #include <String.h>
+#include <wtf/text/CString.h>
 
 
 namespace WebCore {
@@ -78,7 +80,7 @@
         break;
 
     case B_BACKSPACE:
-        return "U+0009";
+        return "U+0008";
     case B_LEFT_ARROW:
         return "Left";
     case B_RIGHT_ARROW:
@@ -105,12 +107,47 @@
         return "U+0009";
     }
 
-    return String::format("U+%04X", toASCIIUpper(keyCode));
+    return String::format("U+%04X", toASCIIUpper(singleByte));
 }
 
-static int windowsKeyCodeForKeyEvent(char singleByte)
+static int windowsKeyCodeForKeyEvent(char singleByte, int keyCode)
 {
     switch (singleByte) {
+    case B_FUNCTION_KEY:
+        switch (keyCode) {
+        case B_F1_KEY:
+            return VK_F1;
+        case B_F2_KEY:
+            return VK_F2;
+        case B_F3_KEY:
+            return VK_F3;
+        case B_F4_KEY:
+            return VK_F4;
+        case B_F5_KEY:
+            return VK_F5;
+        case B_F6_KEY:
+            return VK_F6;
+        case B_F7_KEY:
+            return VK_F7;
+        case B_F8_KEY:
+            return VK_F8;
+        case B_F9_KEY:
+            return VK_F9;
+        case B_F10_KEY:
+            return VK_F10;
+        case B_F11_KEY:
+            return VK_F11;
+        case B_F12_KEY:
+            return VK_F12;
+        case B_PRINT_KEY:
+            return VK_PRINT;
+        case B_PAUSE_KEY:
+            return 0; // FIXME
+        case B_SCROLL_KEY:
+            return 0; // FIXME
+        }
+        break;
+
     case B_BACKSPACE:
         return VK_BACK; // (08) BACKSPACE key
     case B_TAB:
@@ -141,39 +178,191 @@
         return VK_INSERT; // (2D) INS key
     case B_DELETE:
         return VK_DELETE; // (2E) DEL key
-    case 0x2e:
-    default:
-        return 0;
+
+    case '0':
+    case ')':
+        return VK_0;
+    case '1':
+    case '!':
+        return VK_1;
+    case '2':
+    case '@':
+        return VK_2;
+    case '3':
+    case '#':
+        return VK_3;
+    case '4':
+    case '$':
+        return VK_4;
+    case '5':
+    case '%':
+        return VK_5;
+    case '6':
+    case '^':
+        return VK_6;
+    case '7':
+    case '&':
+        return VK_7;
+    case '8':
+    case '*':
+        return VK_8;
+    case '9':
+    case '(':
+        return VK_9;
+    case 'a':
+    case 'A':
+        return VK_A;
+    case 'b':
+    case 'B':
+        return VK_B;
+    case 'c':
+    case 'C':
+        return VK_C;
+    case 'd':
+    case 'D':
+        return VK_D;
+    case 'e':
+    case 'E':
+        return VK_E;
+    case 'f':
+    case 'F':
+        return VK_F;
+    case 'g':
+    case 'G':
+        return VK_G;
+    case 'h':
+    case 'H':
+        return VK_H;
+    case 'i':
+    case 'I':
+        return VK_I;
+    case 'j':
+    case 'J':
+        return VK_J;
+    case 'k':
+    case 'K':
+        return VK_K;
+    case 'l':
+    case 'L':
+        return VK_L;
+    case 'm':
+    case 'M':
+        return VK_M;
+    case 'n':
+    case 'N':
+        return VK_N;
+    case 'o':
+    case 'O':
+        return VK_O;
+    case 'p':
+    case 'P':
+        return VK_P;
+    case 'q':
+    case 'Q':
+        return VK_Q;
+    case 'r':
+    case 'R':
+        return VK_R;
+    case 's':
+    case 'S':
+        return VK_S;
+    case 't':
+    case 'T':
+        return VK_T;
+    case 'u':
+    case 'U':
+        return VK_U;
+    case 'v':
+    case 'V':
+        return VK_V;
+    case 'w':
+    case 'W':
+        return VK_W;
+    case 'x':
+    case 'X':
+        return VK_X;
+    case 'y':
+    case 'Y':
+        return VK_Y;
+    case 'z':
+    case 'Z':
+        return VK_Z;
+    case ';':
+    case ':':
+        return VK_OEM_1;
+    case '+':
+    case '=':
+        return VK_OEM_PLUS;
+    case ',':
+    case '<':
+        return VK_OEM_COMMA;
+    case '-':
+    case '_':
+        return VK_OEM_MINUS;
+    case '.':
+    case '>':
+        return VK_OEM_PERIOD;
+    case '/':
+    case '?':
+        return VK_OEM_2;
+    case '`':
+    case '~':
+        return VK_OEM_3;
+    case '[':
+    case '{':
+        return VK_OEM_4;
+    case '\\':
+    case '|':
+        return VK_OEM_5;
+    case ']':
+    case '}':
+        return VK_OEM_6;
+    case '\'':
+    case '"':
+        return VK_OEM_7;
     }
+    return singleByte;
 }
 
 PlatformKeyboardEvent::PlatformKeyboardEvent(BMessage* message)
     : m_autoRepeat(false)
+    , m_isKeypad(false)
+    , m_shiftKey(false)
     , m_ctrlKey(false)
     , m_altKey(false)
     , m_metaKey(false)
-    , m_isKeypad(false)
-    , m_shiftKey(false)
 {
     BString bytes = message->FindString("bytes");
 
+    m_nativeVirtualKeyCode = message->FindInt32("key");
+
     m_text = String::fromUTF8(bytes.String(), bytes.Length());
     m_unmodifiedText = String(bytes.String(), bytes.Length());
-    m_keyIdentifier = keyIdentifierForHaikuKeyCode(bytes.ByteAt(0), message->FindInt32("key"));
+    m_keyIdentifier = keyIdentifierForHaikuKeyCode(bytes.ByteAt(0), m_nativeVirtualKeyCode);
+
+    m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(bytes.ByteAt(0), m_nativeVirtualKeyCode);
 
     if (message->what == B_KEY_UP)
         m_type = KeyUp;
     else if (message->what == B_KEY_DOWN)
         m_type = KeyDown;
 
-    m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(bytes.ByteAt(0));
+    int32 modifiers = message->FindInt32("modifiers");
+    m_shiftKey = modifiers & B_SHIFT_KEY;
+    m_ctrlKey = modifiers & B_COMMAND_KEY;
+    m_altKey = modifiers & B_CONTROL_KEY;
+    m_metaKey = modifiers & B_OPTION_KEY;
 }
 
-void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
 {
     // Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
     ASSERT(m_type == KeyDown);
     m_type = type;
+
+    if (backwardCompatibilityMode)
+        return;
+
     if (type == RawKeyDown) {
         m_text = String();
         m_unmodifiedText = String();
@@ -185,8 +374,16 @@
 
 bool PlatformKeyboardEvent::currentCapsLockState()
 {
-    notImplemented();
-    return false;
+    return ::modifiers() & B_CAPS_LOCK;
+}
+
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    unit32 modifiers = ::modifiers();
+    shiftKey = modifiers & B_SHIFT_KEY;
+    ctrlKey = modifiers & B_COMMAND_KEY;
+    altKey = modifiers & B_CONTROL_KEY;
+    metaKey = modifiers & B_OPTION_KEY;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
index d212f8b..f1051a5 100644
--- a/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
+++ b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
  * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -30,36 +31,30 @@
 #include "PlatformMouseEvent.h"
 
 #include <Message.h>
-#include <SupportDefs.h>
-
+#include <View.h>
 
 namespace WebCore {
 
 PlatformMouseEvent::PlatformMouseEvent(const BMessage* message)
-    : m_timestamp(message->FindInt64("when"))
-    , m_position(IntPoint(message->FindPoint("where")))
-    , m_globalPosition(message->FindPoint("globalPosition"))
-    , m_shiftKey(false)
-    , m_ctrlKey(false)
-    , m_altKey(false)
-    , m_metaKey(false)
+    : m_position(message->FindPoint("be:view_where"))
+    , m_globalPosition(message->FindPoint("screen_where"))
     , m_clickCount(message->FindInt32("clicks"))
+    , m_timestamp(message->FindInt64("when") / 1000000.0)
 {
-    int32 buttons = message->FindInt32("buttons");
-    switch (buttons) {
-    case 1:
+    int32 buttons = 0;
+    if (message->what == B_MOUSE_UP)
+        message->FindInt32("previous buttons", &buttons);
+    else
+        message->FindInt32("buttons", &buttons);
+
+    if (buttons & B_PRIMARY_MOUSE_BUTTON)
         m_button = LeftButton;
-        break;
-    case 2:
+    else if (buttons & B_SECONDARY_MOUSE_BUTTON)
         m_button = RightButton;
-        break;
-    case 3:
+    else if (buttons & B_TERTIARY_MOUSE_BUTTON)
         m_button = MiddleButton;
-        break;
-    default:
+    else
         m_button = NoButton;
-        break;
-    };
 
     switch (message->what) {
     case B_MOUSE_DOWN:
@@ -67,15 +62,18 @@
         break;
     case B_MOUSE_UP:
         m_eventType = MouseEventReleased;
-        m_button = LeftButton; // FIXME: Webcore wants to know the button released but we don't know.
         break;
     case B_MOUSE_MOVED:
-        m_eventType = MouseEventMoved;
-        break;
     default:
         m_eventType = MouseEventMoved;
         break;
     };
+
+    int32 modifiers = message->FindInt32("modifiers");
+    m_shiftKey = modifiers & B_SHIFT_KEY;
+    m_ctrlKey = modifiers & B_CONTROL_KEY;
+    m_altKey = modifiers & B_COMMAND_KEY;
+    m_metaKey = modifiers & B_OPTION_KEY;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
index 21003b6..351b4ec 100644
--- a/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
+++ b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
  * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -31,6 +32,7 @@
 
 #include "Scrollbar.h"
 
+#include <InterfaceDefs.h>
 #include <Message.h>
 #include <Point.h>
 
@@ -38,24 +40,23 @@
 namespace WebCore {
 
 PlatformWheelEvent::PlatformWheelEvent(BMessage* message)
-    : m_granularity(ScrollByPixelWheelEvent)
-    , m_shiftKey(false)
-    , m_ctrlKey(false)
-    , m_altKey(false)
-    , m_metaKey(false)
+    : m_position(message->FindPoint("be:view_where"))
+    , m_globalPosition(message->FindPoint("screen_where"))
+    , m_deltaX(message->FindFloat("be:wheel_delta_x"))
+    , m_deltaY(message->FindFloat("be:wheel_delta_y"))
+    , m_wheelTicksX(m_deltaX)
+    , m_wheelTicksY(m_deltaY)
+    , m_granularity(ScrollByPixelWheelEvent)
     , m_isAccepted(false)
 {
-    m_position = IntPoint(message->FindPoint("position"));
-    m_globalPosition = IntPoint(message->FindPoint("global_position"));
-
-    m_deltaX = message->FindFloat("be:wheel_delta_x");
-    m_deltaY = message->FindFloat("be:wheel_delta_y");
-
-    m_wheelTicksX = m_deltaX;
-    m_wheelTicksY = m_deltaY;
-
     m_deltaX *= -Scrollbar::pixelsPerLineStep();
     m_deltaY *= -Scrollbar::pixelsPerLineStep();
+
+    int32 modifiers = message->FindInt32("modifiers");
+    m_shiftKey = modifiers & B_SHIFT_KEY;
+    m_ctrlKey = modifiers & B_CONTROL_KEY;
+    m_altKey = modifiers & B_COMMAND_KEY;
+    m_metaKey = modifiers & B_OPTION_KEY;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/PopupMenuHaiku.cpp b/WebCore/platform/haiku/PopupMenuHaiku.cpp
index 9d608c8..5adbc66 100644
--- a/WebCore/platform/haiku/PopupMenuHaiku.cpp
+++ b/WebCore/platform/haiku/PopupMenuHaiku.cpp
@@ -1,7 +1,7 @@
 /*
  * This file is part of the popup menu implementation for <select> elements in WebCore.
  *
- * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -26,42 +26,165 @@
 #include "FrameView.h"
 
 #include "NotImplemented.h"
-#include <Menu.h>
-
+#include <Application.h>
+#include <Handler.h>
+#include <MenuItem.h>
+#include <Message.h>
+#include <PopUpMenu.h>
+#include <String.h>
+#include <Window.h>
+#include <support/Autolock.h>
+#include <support/Locker.h>
 
 namespace WebCore {
 
+static const uint32 kPopupResult = 'pmrs';
+static const uint32 kPopupHidden = 'pmhd';
+
+// This BHandler is added to the application (main) thread, so that we
+// invoke methods on the PopupMenuClient within the main thread.
+class PopupMenuHandler : public BHandler {
+public:
+    PopupMenuHandler(PopupMenuClient* popupClient)
+        : m_popupClient(popupClient)
+    {
+    }
+
+    virtual void MessageReceived(BMessage* message)
+    {
+        switch (message->what) {
+        case kPopupResult: {
+            int32 index = 0;
+            message->FindInt32("index", &index);
+            m_popupClient->valueChanged(index);
+            break;
+        }
+        case kPopupHidden:
+            m_popupClient->popupDidHide();
+            break;
+
+        default:
+            BHandler::MessageReceived(message);
+        }
+    }
+
+private:
+    PopupMenuClient* m_popupClient;
+};
+
+class PopupMenuHaiku : public BPopUpMenu {
+public:
+    PopupMenuHaiku(PopupMenuClient* popupClient)
+        : BPopUpMenu("WebCore Popup", true, false)
+        , m_popupClient(popupClient)
+        , m_Handler(popupClient)
+    {
+        if (be_app->Lock()) {
+            be_app->AddHandler(&m_Handler);
+            be_app->Unlock();
+        }
+        SetAsyncAutoDestruct(false);
+    }
+
+    virtual ~PopupMenuHaiku()
+    {
+        if (be_app->Lock()) {
+            be_app->RemoveHandler(&m_Handler);
+            be_app->Unlock();
+        }
+    }
+
+    void show(const IntRect& rect, FrameView* view, int index)
+    {
+        // Clean out the menu first
+        for (int32 i = CountItems() - 1; i >= 0; i--)
+            delete RemoveItem(i);
+
+        // Popuplate the menu from the client
+        int itemCount = m_popupClient->listSize();
+        for (int i = 0; i < itemCount; i++) {
+            if (m_popupClient->itemIsSeparator(i))
+                AddSeparatorItem();
+            else {
+                // NOTE: WebCore distinguishes between "Group" and "Label"
+                // here, but both types of item (radio or check mark) currently
+                // look the same on Haiku.
+                BString label(m_popupClient->itemText(i));
+                BMessage* message = new BMessage(kPopupResult);
+                message->AddInt32("index", i);
+                BMenuItem* item = new BMenuItem(label.String(), message);
+                AddItem(item);
+                item->SetTarget(BMessenger(&m_Handler));
+                item->SetEnabled(m_popupClient->itemIsEnabled(i));
+                item->SetMarked(i == index);
+            }
+        }
+
+        // We need to force a layout now, or the item frames will not be
+        // computed yet, so we cannot move the current item under the mouse.
+        DoLayout();
+
+        // Account for frame of menu field
+        BRect screenRect(view->contentsToScreen(rect));
+        screenRect.OffsetBy(2, 2);
+        // Move currently selected item under the mouse.
+        if (BMenuItem* item = ItemAt(index))
+            screenRect.OffsetBy(0, -item->Frame().top);
+
+        BRect openRect = Bounds().OffsetToSelf(screenRect.LeftTop());
+
+        Go(screenRect.LeftTop(), true, true, openRect, true);
+    }
+
+    void hide()
+    {
+        if (!IsHidden())
+            Hide();
+    }
+
+private:
+    virtual void Hide()
+    {
+        BPopUpMenu::Hide();
+        be_app->PostMessage(kPopupHidden, &m_Handler);
+    }
+
+    PopupMenuClient* m_popupClient;
+    PopupMenuHandler m_Handler;
+};
+
 PopupMenu::PopupMenu(PopupMenuClient* client)
     : m_popupClient(client)
-    , m_menu(0)
+    , m_menu(new PopupMenuHaiku(client))
 {
+    // We don't need additional references to the client, since we completely
+    // control any sub-objects we create that need it as well.
 }
 
 PopupMenu::~PopupMenu()
 {
     delete m_menu;
-    m_menu = 0;
 }
 
 void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
 {
-    notImplemented();
+    // The menu will update itself from the PopupMenuClient before showing.
+    m_menu->show(rect, view, index);
 }
 
 void PopupMenu::hide()
 {
-    notImplemented();
+    m_menu->hide();
 }
 
 void PopupMenu::updateFromElement()
 {
-    notImplemented();
+    client()->setTextFromItem(m_popupClient->selectedIndex());
 }
 
 bool PopupMenu::itemWritingDirectionIsNatural()
 {
-    notImplemented();
-    return true;
+    return false;
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/haiku/WidgetHaiku.cpp b/WebCore/platform/haiku/WidgetHaiku.cpp
index 6031fca..5ff504f 100644
--- a/WebCore/platform/haiku/WidgetHaiku.cpp
+++ b/WebCore/platform/haiku/WidgetHaiku.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
  *
  * All rights reserved.
  *
@@ -29,16 +30,38 @@
 #include "Widget.h"
 
 #include "Cursor.h"
-#include "GraphicsContext.h"
 #include "IntRect.h"
 #include "NotImplemented.h"
-#include <Control.h>
 #include <View.h>
 
-
 namespace WebCore {
 
+class AutoPlatformWidgetLocker {
+public:
+    AutoPlatformWidgetLocker(PlatformWidget widget)
+        : m_widget(widget)
+    {
+        if (!m_widget || m_widget->LockLooperWithTimeout(5000) != B_OK)
+            m_widget = 0;
+    }
+
+    ~AutoPlatformWidgetLocker()
+    {
+        if (m_widget)
+            m_widget->UnlockLooper();
+    }
+
+    bool isLocked() const
+    {
+        return m_widget;
+    }
+
+private:
+    PlatformWidget m_widget;
+};
+
 Widget::Widget(PlatformWidget widget)
+    : m_topLevelPlatformWidget(0)
 {
     init(widget);
 }
@@ -59,29 +82,41 @@
 
 void Widget::setFocus()
 {
-    if (platformWidget())
-        platformWidget()->MakeFocus();
+    AutoPlatformWidgetLocker locker(topLevelPlatformWidget());
+    if (locker.isLocked())
+        topLevelPlatformWidget()->MakeFocus();
 }
 
 void Widget::setCursor(const Cursor& cursor)
 {
-    if (platformWidget())
-        platformWidget()->SetViewCursor(cursor.impl());
+    AutoPlatformWidgetLocker locker(topLevelPlatformWidget());
+    if (locker.isLocked())
+        topLevelPlatformWidget()->SetViewCursor(cursor.impl());
 }
 
 void Widget::show()
 {
-    if (platformWidget())
+    setSelfVisible(true);
+    if (!isParentVisible())
+        return;
+
+    AutoPlatformWidgetLocker locker(platformWidget());
+    if (locker.isLocked() && platformWidget()->IsHidden())
         platformWidget()->Show();
 }
 
 void Widget::hide()
 {
-    if (platformWidget())
+    setSelfVisible(false);
+    if (!isParentVisible())
+        return;
+
+    AutoPlatformWidgetLocker locker(platformWidget());
+    if (locker.isLocked() && !platformWidget()->IsHidden())
         platformWidget()->Hide();
 }
 
-void Widget::paint(GraphicsContext* p, IntRect const& r)
+void Widget::paint(GraphicsContext*, IntRect const&)
 {
     notImplemented();
 }
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 002395b..b063db2 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -214,10 +214,10 @@
     public:
         ImageDecoder()
             : m_scaled(false)
-            , m_failed(false)
             , m_sizeAvailable(false)
-            , m_isAllDataReceived(false)
             , m_maxNumPixels(-1)
+            , m_isAllDataReceived(false)
+            , m_failed(false)
         {
         }
 
@@ -236,6 +236,8 @@
 
         virtual void setData(SharedBuffer* data, bool allDataReceived)
         {
+            if (failed())
+                return;
             m_data = data;
             m_isAllDataReceived = allDataReceived;
         }
@@ -277,10 +279,8 @@
         // be set and the caller should immediately stop decoding.
         virtual bool setSize(unsigned width, unsigned height)
         {
-            if (isOverSize(width, height)) {
-                m_failed = true;
-                return false;
-            }
+            if (isOverSize(width, height))
+                return setFailed();
             m_size = IntSize(width, height);
             m_sizeAvailable = true;
             return true;
@@ -303,8 +303,16 @@
         // transparency.
         virtual bool supportsAlpha() const { return true; }
 
+        // Sets the "decode failure" flag.  For caller convenience (since so
+        // many callers want to return false after calling this), returns false
+        // to enable easy tailcalling.
+        virtual bool setFailed()
+        {
+            m_failed = true;
+            return false;
+        }
+
         bool failed() const { return m_failed; }
-        void setFailed() { m_failed = true; }
 
         // Wipe out frames in the frame buffer cache before |clearBeforeFrame|,
         // assuming this can be done without breaking decoding.  Different
@@ -327,11 +335,10 @@
         int scaledY(int origY, int searchStart = 0);
 
         RefPtr<SharedBuffer> m_data; // The encoded data.
+        Vector<RGBA32Buffer> m_frameBufferCache;
+        bool m_scaled;
         Vector<int> m_scaledColumns;
         Vector<int> m_scaledRows;
-        bool m_scaled;
-        Vector<RGBA32Buffer> m_frameBufferCache;
-        bool m_failed;
 
     private:
         // Some code paths compute the size of the image as "width * height * 4"
@@ -347,8 +354,9 @@
 
         IntSize m_size;
         bool m_sizeAvailable;
-        bool m_isAllDataReceived;
         int m_maxNumPixels;
+        bool m_isAllDataReceived;
+        bool m_failed;
     };
 
 } // namespace WebCore
diff --git a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
index fb9f9f2..a6d36ef 100644
--- a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -57,7 +57,7 @@
 
 bool BMPImageDecoder::isSizeAvailable()
 {
-    if (!ImageDecoder::isSizeAvailable() && !failed())
+    if (!ImageDecoder::isSizeAvailable())
         decode(true);
 
     return ImageDecoder::isSizeAvailable();
@@ -72,7 +72,7 @@
         m_frameBufferCache.resize(1);
 
     RGBA32Buffer* buffer = &m_frameBufferCache.first();
-    if (buffer->status() != RGBA32Buffer::FrameComplete && !failed())
+    if (buffer->status() != RGBA32Buffer::FrameComplete)
         decode(false);
     return buffer;
 }
@@ -131,12 +131,7 @@
         BITMAPARRAY = 0x4241,  // "BA"
         */
     };
-    if (fileType != BMAP) {
-        setFailed();
-        return false;
-    }
-
-    return true;
+    return (fileType == BMAP) || setFailed();
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index 807d57c..5965ae4 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -42,26 +42,32 @@
 
 void GIFImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
 {
-    if (m_failed)
+    if (failed())
         return;
 
     ImageDecoder::setData(data, allDataReceived);
 
     // We need to rescan the frame count, as the new data may have changed it.
     m_alreadyScannedThisDataForFrameCount = false;
-
-    if (!m_reader && !m_failed)
-        m_reader.set(new GIFImageReader(this));
 }
 
 bool GIFImageDecoder::isSizeAvailable()
 {
-    if (!ImageDecoder::isSizeAvailable() && !failed() && m_reader)
+    if (!ImageDecoder::isSizeAvailable())
          decode(0, GIFSizeQuery);
 
     return ImageDecoder::isSizeAvailable();
 }
 
+bool GIFImageDecoder::setSize(unsigned width, unsigned height)
+{
+    if (!ImageDecoder::setSize(width, height))
+        return false;
+
+    prepareScaleDataIfNecessary();
+    return true;
+}
+
 size_t GIFImageDecoder::frameCount()
 {
     if (!m_alreadyScannedThisDataForFrameCount) {
@@ -108,8 +114,8 @@
         return 0;
 
     RGBA32Buffer& frame = m_frameBufferCache[index];
-    if (frame.status() != RGBA32Buffer::FrameComplete && m_reader)
-        decode(index + 1, GIFFullQuery); // Decode this frame.
+    if (frame.status() != RGBA32Buffer::FrameComplete)
+        decode(index + 1, GIFFullQuery);
     return &frame;
 }
 
@@ -163,15 +169,6 @@
     }
 }
 
-bool GIFImageDecoder::sizeNowAvailable(unsigned width, unsigned height)
-{
-    if (!setSize(width, height))
-        return false;
-
-    prepareScaleDataIfNecessary();
-    return true;
-}
-
 void GIFImageDecoder::decodingHalted(unsigned bytesLeft)
 {
     m_readOffset = m_data->size() - bytesLeft;
@@ -291,12 +288,16 @@
 
 void GIFImageDecoder::decode(unsigned haltAtFrame, GIFQuery query)
 {
-    if (m_failed)
+    if (failed())
         return;
 
-    m_failed = !m_reader->read((const unsigned char*)m_data->data() + m_readOffset, m_data->size() - m_readOffset, query, haltAtFrame);
+    if (!m_reader)
+        m_reader.set(new GIFImageReader(this));
 
-    if (m_failed)
+    if (!m_reader->read((const unsigned char*)m_data->data() + m_readOffset, m_data->size() - m_readOffset, query, haltAtFrame))
+        setFailed();
+
+    if (failed())
         m_reader.clear();
 }
 
@@ -321,10 +322,8 @@
     
     if (!frameIndex) {
         // This is the first frame, so we're not relying on any previous data.
-        if (!buffer->setSize(scaledSize().width(), scaledSize().height())) {
-            m_failed = true;
-            return false;
-        }
+        if (!buffer->setSize(scaledSize().width(), scaledSize().height()))
+            return setFailed();
     } else {
         // The starting state for this frame depends on the previous frame's
         // disposal method.
@@ -353,10 +352,8 @@
             if (!frameIndex || prevRect.contains(IntRect(IntPoint(), scaledSize()))) {
                 // Clearing the first frame, or a frame the size of the whole
                 // image, results in a completely empty image.
-                if (!buffer->setSize(bufferSize.width(), bufferSize.height())) {
-                    m_failed = true;
-                    return false;
-                }
+                if (!buffer->setSize(bufferSize.width(), bufferSize.height()))
+                    return setFailed();
             } else {
               // Copy the whole previous buffer, then clear just its frame.
               buffer->copyBitmapData(*prevBuffer);
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 0aa5387..28a9a59 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -45,13 +45,13 @@
         virtual String filenameExtension() const { return "gif"; }
         virtual void setData(SharedBuffer* data, bool allDataReceived);
         virtual bool isSizeAvailable();
+        virtual bool setSize(unsigned width, unsigned height);
         virtual size_t frameCount();
         virtual int repetitionCount() const;
         virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
         virtual void clearFrameBufferCache(size_t clearBeforeFrame);
 
         // Callbacks from the GIF reader.
-        bool sizeNowAvailable(unsigned width, unsigned height);
         void decodingHalted(unsigned bytesLeft);
         bool haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsigned char* rowEnd, unsigned rowNumber, unsigned repeatCount, bool writeTransparentPixels);
         void frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod);
diff --git a/WebCore/platform/image-decoders/gif/GIFImageReader.cpp b/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
index 755a48d..677853e 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
@@ -519,7 +519,7 @@
       screen_height = GETINT16(q + 2);
 
       // CALLBACK: Inform the decoderplugin of our size.
-      if (clientptr && !clientptr->sizeNowAvailable(screen_width, screen_height))
+      if (clientptr && !clientptr->setSize(screen_width, screen_height))
         return false;
       
       screen_bgcolor = q[5];
@@ -746,7 +746,7 @@
         y_offset = 0;
 
         // CALLBACK: Inform the decoderplugin of our size.
-        if (clientptr && !clientptr->sizeNowAvailable(screen_width, screen_height))
+        if (clientptr && !clientptr->setSize(screen_width, screen_height))
           return false;
       }
 
diff --git a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
index 1a202bc..325c506 100644
--- a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -88,14 +88,9 @@
 
 bool ICOImageDecoder::setSize(unsigned width, unsigned height)
 {
-    if (m_frameSize.isEmpty())
-        return ImageDecoder::setSize(width, height);
-
     // The size calculated inside the BMPImageReader had better match the one in
     // the icon directory.
-    if (IntSize(width, height) != m_frameSize)
-        setFailed();
-    return !failed();
+    return m_frameSize.isEmpty() ? ImageDecoder::setSize(width, height) : ((IntSize(width, height) == m_frameSize) || setFailed());
 }
 
 size_t ICOImageDecoder::frameCount()
@@ -193,15 +188,10 @@
     }
     // Fail if the size the PNGImageDecoder calculated does not match the size
     // in the directory.
-    if (m_pngDecoders[index]->isSizeAvailable() && (m_pngDecoders[index]->size() != dirEntry.m_size)) {
-        setFailed();
-        return false;
-    }
+    if (m_pngDecoders[index]->isSizeAvailable() && (m_pngDecoders[index]->size() != dirEntry.m_size))
+        return setFailed();
     m_frameBufferCache[index] = *m_pngDecoders[index]->frameBufferAtIndex(0);
-    if (!m_pngDecoders[index]->failed())
-      return true;
-    setFailed();
-    return false;
+    return !m_pngDecoders[index]->failed() || setFailed();
 }
 
 bool ICOImageDecoder::processDirectory()
@@ -220,10 +210,8 @@
         ICON = 1,
         CURSOR = 2,
     };
-    if (((fileType != ICON) && (fileType != CURSOR)) || (!idCount)) {
-        setFailed();
-        return false;
-    }
+    if (((fileType != ICON) && (fileType != CURSOR)) || (!idCount))
+        return setFailed();
 
     // Enlarge member vectors to hold all the entries.
     m_dirEntries.resize(idCount);
@@ -244,10 +232,8 @@
     // Make sure the specified image offsets are past the end of the directory
     // entries.
     for (IconDirectoryEntries::iterator i(m_dirEntries.begin()); i != m_dirEntries.end(); ++i) {
-        if (i->m_imageOffset < m_decodedOffset) {
-            setFailed();
-            return false;
-        }
+        if (i->m_imageOffset < m_decodedOffset)
+            return setFailed();
     }
 
     // Arrange frames in decreasing quality order.
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 9ed20b6..3d9fb8e 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -131,7 +131,8 @@
         close();
     }
 
-    void close() {
+    void close()
+    {
         decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
         if (src)
             fastFree(src);
@@ -140,13 +141,14 @@
         jpeg_destroy_decompress(&m_info);
     }
 
-    void skipBytes(long num_bytes) {
+    void skipBytes(long numBytes)
+    {
         decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
-        long bytesToSkip = std::min(num_bytes, (long)src->pub.bytes_in_buffer);
+        long bytesToSkip = std::min(numBytes, (long)src->pub.bytes_in_buffer);
         src->pub.bytes_in_buffer -= (size_t)bytesToSkip;
         src->pub.next_input_byte += bytesToSkip;
 
-        m_bytesToSkip = std::max(num_bytes - bytesToSkip, static_cast<long>(0));
+        m_bytesToSkip = std::max(numBytes - bytesToSkip, static_cast<long>(0));
     }
 
     bool decode(const Vector<char>& data, bool onlySize)
@@ -192,7 +194,6 @@
                 m_info.out_color_space = JCS_CMYK;
                 break;
             default:
-                m_state = JPEG_ERROR;
                 return false;
             }
 
@@ -212,10 +213,8 @@
             m_state = JPEG_START_DECOMPRESS;
 
             // We can fill in the size now that the header is available.
-            if (!m_decoder->setSize(m_info.image_width, m_info.image_height)) {
-                m_state = JPEG_ERROR;
+            if (!m_decoder->setSize(m_info.image_width, m_info.image_height))
                 return false;
-            }
 
             if (m_decodingSizeOnly) {
                 // We can stop here.  Reduce our buffer length and available
@@ -316,7 +315,8 @@
             break;
 
         case JPEG_ERROR:
-            break;
+            // We can get here if the constructor failed.
+            return m_decoder->setFailed();
         }
 
         return true;
@@ -380,20 +380,9 @@
 {
 }
 
-void JPEGImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (m_failed)
-        return;
-
-    ImageDecoder::setData(data, allDataReceived);
-
-    if (!m_reader && !m_failed)
-        m_reader.set(new JPEGImageReader(this));
-}
-
 bool JPEGImageDecoder::isSizeAvailable()
 {
-    if (!ImageDecoder::isSizeAvailable() && !failed() && m_reader)
+    if (!ImageDecoder::isSizeAvailable())
          decode(true);
 
     return ImageDecoder::isSizeAvailable();
@@ -417,7 +406,7 @@
         m_frameBufferCache.resize(1);
 
     RGBA32Buffer& frame = m_frameBufferCache[0];
-    if (frame.status() != RGBA32Buffer::FrameComplete && m_reader)
+    if (frame.status() != RGBA32Buffer::FrameComplete)
         decode(false);
     return &frame;
 }
@@ -430,10 +419,8 @@
     // Initialize the framebuffer if needed.
     RGBA32Buffer& buffer = m_frameBufferCache[0];
     if (buffer.status() == RGBA32Buffer::FrameEmpty) {
-        if (!buffer.setSize(scaledSize().width(), scaledSize().height())) {
-            m_failed = true;
-            return false;
-        }
+        if (!buffer.setSize(scaledSize().width(), scaledSize().height()))
+            return setFailed();
         buffer.setStatus(RGBA32Buffer::FramePartial);
         buffer.setHasAlpha(false);
 
@@ -474,8 +461,7 @@
                 buffer.setRGBA(x, destY, jsample[0] * k / 255, jsample[1] * k / 255, jsample[2] * k / 255, 0xFF);
             } else {
                 ASSERT_NOT_REACHED();
-                m_failed = true;
-                return false;
+                return setFailed();
             }
         }
     }
@@ -495,12 +481,16 @@
 
 void JPEGImageDecoder::decode(bool onlySize)
 {
-    if (m_failed)
+    if (failed())
         return;
 
-    m_failed = !m_reader->decode(m_data->buffer(), onlySize);
+    if (!m_reader)
+        m_reader.set(new JPEGImageReader(this));
 
-    if (m_failed || (!m_frameBufferCache.isEmpty() && m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
+    if (!m_reader->decode(m_data->buffer(), onlySize))
+        setFailed();
+
+    if (failed() || (!m_frameBufferCache.isEmpty() && m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
         m_reader.clear();
 }
 
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
index 2a95dbe..45e14bc 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -42,7 +42,6 @@
 
         // ImageDecoder
         virtual String filenameExtension() const { return "jpg"; }
-        virtual void setData(SharedBuffer* data, bool allDataReceived);
         virtual bool isSizeAvailable();
         virtual bool setSize(unsigned width, unsigned height);
         virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 36f818f..de01d55 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -54,7 +54,6 @@
 // Called if the decoding of the image fails.
 static void PNGAPI decodingFailed(png_structp png, png_const_charp)
 {
-    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->decodingFailed();
     longjmp(png->jmpbuf, 1);
 }
 
@@ -96,7 +95,6 @@
         , m_decodingSizeOnly(false)
         , m_interlaceBuffer(0)
         , m_hasAlpha(false)
-        , m_hasFinishedDecoding(false)
         , m_currentBufferSize(0)
     {
         m_png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, decodingFailed, decodingWarning);
@@ -117,33 +115,34 @@
         delete[] m_interlaceBuffer;
         m_interlaceBuffer = 0;
         m_readOffset = 0;
-        m_hasFinishedDecoding = false;
     }
 
     unsigned currentBufferSize() const { return m_currentBufferSize; }
 
-    void setComplete() { m_hasFinishedDecoding = true; }
-
     void decode(const SharedBuffer& data, bool sizeOnly)
     {
         m_decodingSizeOnly = sizeOnly;
+        PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
 
         // We need to do the setjmp here. Otherwise bad things will happen.
         if (setjmp(m_png->jmpbuf)) {
             close();
+            decoder->setFailed();
             return;
         }
 
-        PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
         const char* segment;
         while (unsigned segmentLength = data.getSomeData(segment, m_readOffset)) {
             m_readOffset += segmentLength;
             m_currentBufferSize = m_readOffset;
             png_process_data(m_png, m_info, reinterpret_cast<png_bytep>(const_cast<char*>(segment)), segmentLength);
-            if ((sizeOnly && decoder->isSizeAvailable()) || m_hasFinishedDecoding)
+            // We explicitly specify the superclass isSizeAvailable() because we
+            // merely want to check if we've managed to set the size, not
+            // (recursively) trigger additional decoding if we haven't.
+            if (sizeOnly ? decoder->ImageDecoder::isSizeAvailable() : decoder->isComplete())
                 return;
         }
-        if (!m_hasFinishedDecoding && decoder->isAllDataReceived())
+        if (!decoder->isComplete() && decoder->isAllDataReceived())
             decoder->pngComplete();
     }
 
@@ -165,7 +164,6 @@
     png_infop m_info;
     png_bytep m_interlaceBuffer;
     bool m_hasAlpha;
-    bool m_hasFinishedDecoding;
     unsigned m_currentBufferSize;
 };
 
@@ -177,24 +175,23 @@
 {
 }
 
-void PNGImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (m_failed)
-        return;
-
-    ImageDecoder::setData(data, allDataReceived);
-
-    if (!m_reader && !m_failed)
-        m_reader.set(new PNGImageReader(this));
-}
 bool PNGImageDecoder::isSizeAvailable()
 {
-    if (!ImageDecoder::isSizeAvailable() && !failed() && m_reader)
+    if (!ImageDecoder::isSizeAvailable())
          decode(true);
 
     return ImageDecoder::isSizeAvailable();
 }
 
+bool PNGImageDecoder::setSize(unsigned width, unsigned height)
+{
+    if (!ImageDecoder::setSize(width, height))
+        return false;
+
+    prepareScaleDataIfNecessary();
+    return true;
+}
+
 RGBA32Buffer* PNGImageDecoder::frameBufferAtIndex(size_t index)
 {
     if (index)
@@ -204,17 +201,11 @@
         m_frameBufferCache.resize(1);
 
     RGBA32Buffer& frame = m_frameBufferCache[0];
-    if (frame.status() != RGBA32Buffer::FrameComplete && m_reader)
-        // Decode this frame.
+    if (frame.status() != RGBA32Buffer::FrameComplete)
         decode(false);
     return &frame;
 }
 
-void PNGImageDecoder::decodingFailed()
-{
-    m_failed = true;
-}
-
 void PNGImageDecoder::headerAvailable()
 {
     png_structp png = m_reader->pngPtr();
@@ -224,19 +215,14 @@
     
     // Protect against large images.
     if (png->width > cMaxPNGSize || png->height > cMaxPNGSize) {
-        m_failed = true;
         longjmp(png->jmpbuf, 1);
         return;
     }
     
     // We can fill in the size now that the header is available.
-    if (!ImageDecoder::isSizeAvailable()) {
-        if (!setSize(width, height)) {
-            // Size unreasonable, bail out.
-            longjmp(png->jmpbuf, 1);
-            return;
-        }
-        prepareScaleDataIfNecessary();
+    if (!setSize(width, height)) {
+        longjmp(png->jmpbuf, 1);
+        return;
     }
 
     int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
@@ -299,7 +285,6 @@
     RGBA32Buffer& buffer = m_frameBufferCache[0];
     if (buffer.status() == RGBA32Buffer::FrameEmpty) {
         if (!buffer.setSize(scaledSize().width(), scaledSize().height())) {
-            static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_reader->pngPtr()))->decodingFailed();
             longjmp(m_reader->pngPtr()->jmpbuf, 1);
             return;
         }
@@ -374,20 +359,21 @@
 
 void PNGImageDecoder::pngComplete()
 {
-    m_reader->setComplete();
-
     if (!m_frameBufferCache.isEmpty())
         m_frameBufferCache.first().setStatus(RGBA32Buffer::FrameComplete);
 }
 
 void PNGImageDecoder::decode(bool onlySize)
 {
-    if (m_failed)
+    if (failed())
         return;
 
+    if (!m_reader)
+        m_reader.set(new PNGImageReader(this));
+
     m_reader->decode(*m_data, onlySize);
     
-    if (m_failed || (!m_frameBufferCache.isEmpty() && m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
+    if (failed() || isComplete())
         m_reader.clear();
 }
 
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.h b/WebCore/platform/image-decoders/png/PNGImageDecoder.h
index ba0e19a..3f0602c 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.h
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.h
@@ -41,16 +41,20 @@
 
         // ImageDecoder
         virtual String filenameExtension() const { return "png"; }
-        virtual void setData(SharedBuffer* data, bool allDataReceived);
         virtual bool isSizeAvailable();
+        virtual bool setSize(unsigned width, unsigned height);
         virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
 
         // Callbacks from libpng
-        void decodingFailed();
         void headerAvailable();
         void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlacePass);
         void pngComplete();
 
+        bool isComplete() const
+        {
+            return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == RGBA32Buffer::FrameComplete);
+        }
+
     private:
         // Decodes the image.  If |onlySize| is true, stops decoding after
         // calculating the image size.
diff --git a/WebCore/platform/iphone/KeyEventCodesIPhone.h b/WebCore/platform/iphone/KeyEventCodesIPhone.h
new file mode 100644
index 0000000..180d708
--- /dev/null
+++ b/WebCore/platform/iphone/KeyEventCodesIPhone.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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 COMPUTER, 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 KeyEventCodesIPhone_h
+#define KeyEventCodesIPhone_h
+
+// Unicodes we reserve for function keys on the keyboard,
+// OpenStep reserves the range 0xF700-0xF8FF for this purpose.
+// The availability of various keys will be system dependent.
+
+enum {
+    NSUpArrowFunctionKey      = 0xF700,
+    NSDownArrowFunctionKey    = 0xF701,
+    NSLeftArrowFunctionKey    = 0xF702,
+    NSRightArrowFunctionKey   = 0xF703,
+    NSF1FunctionKey           = 0xF704,
+    NSF2FunctionKey           = 0xF705,
+    NSF3FunctionKey           = 0xF706,
+    NSF4FunctionKey           = 0xF707,
+    NSF5FunctionKey           = 0xF708,
+    NSF6FunctionKey           = 0xF709,
+    NSF7FunctionKey           = 0xF70A,
+    NSF8FunctionKey           = 0xF70B,
+    NSF9FunctionKey           = 0xF70C,
+    NSF10FunctionKey          = 0xF70D,
+    NSF11FunctionKey          = 0xF70E,
+    NSF12FunctionKey          = 0xF70F,
+    NSF13FunctionKey          = 0xF710,
+    NSF14FunctionKey          = 0xF711,
+    NSF15FunctionKey          = 0xF712,
+    NSF16FunctionKey          = 0xF713,
+    NSF17FunctionKey          = 0xF714,
+    NSF18FunctionKey          = 0xF715,
+    NSF19FunctionKey          = 0xF716,
+    NSF20FunctionKey          = 0xF717,
+    NSF21FunctionKey          = 0xF718,
+    NSF22FunctionKey          = 0xF719,
+    NSF23FunctionKey          = 0xF71A,
+    NSF24FunctionKey          = 0xF71B,
+    NSF25FunctionKey          = 0xF71C,
+    NSF26FunctionKey          = 0xF71D,
+    NSF27FunctionKey          = 0xF71E,
+    NSF28FunctionKey          = 0xF71F,
+    NSF29FunctionKey          = 0xF720,
+    NSF30FunctionKey          = 0xF721,
+    NSF31FunctionKey          = 0xF722,
+    NSF32FunctionKey          = 0xF723,
+    NSF33FunctionKey          = 0xF724,
+    NSF34FunctionKey          = 0xF725,
+    NSF35FunctionKey          = 0xF726,
+    NSInsertFunctionKey       = 0xF727,
+    NSDeleteFunctionKey       = 0xF728,
+    NSHomeFunctionKey         = 0xF729,
+    NSBeginFunctionKey        = 0xF72A,
+    NSEndFunctionKey          = 0xF72B,
+    NSPageUpFunctionKey       = 0xF72C,
+    NSPageDownFunctionKey     = 0xF72D,
+    NSPrintScreenFunctionKey  = 0xF72E,
+    NSScrollLockFunctionKey   = 0xF72F,
+    NSPauseFunctionKey        = 0xF730,
+    NSSysReqFunctionKey       = 0xF731,
+    NSBreakFunctionKey        = 0xF732,
+    NSResetFunctionKey        = 0xF733,
+    NSStopFunctionKey         = 0xF734,
+    NSMenuFunctionKey         = 0xF735,
+    NSUserFunctionKey         = 0xF736,
+    NSSystemFunctionKey       = 0xF737,
+    NSPrintFunctionKey        = 0xF738,
+    NSClearLineFunctionKey    = 0xF739,
+    NSClearDisplayFunctionKey = 0xF73A,
+    NSInsertLineFunctionKey   = 0xF73B,
+    NSDeleteLineFunctionKey   = 0xF73C,
+    NSInsertCharFunctionKey   = 0xF73D,
+    NSDeleteCharFunctionKey   = 0xF73E,
+    NSPrevFunctionKey         = 0xF73F,
+    NSNextFunctionKey         = 0xF740,
+    NSSelectFunctionKey       = 0xF741,
+    NSExecuteFunctionKey      = 0xF742,
+    NSUndoFunctionKey         = 0xF743,
+    NSRedoFunctionKey         = 0xF744,
+    NSFindFunctionKey         = 0xF745,
+    NSHelpFunctionKey         = 0xF746,
+    NSModeSwitchFunctionKey   = 0xF747
+};
+
+enum {
+    NSParagraphSeparatorCharacter = 0x2029,
+    NSLineSeparatorCharacter = 0x2028,
+    NSTabCharacter = 0x0009,
+    NSFormFeedCharacter = 0x000c,
+    NSNewlineCharacter = 0x000a,
+    NSCarriageReturnCharacter = 0x000d,
+    NSEnterCharacter = 0x0003,
+    NSBackspaceCharacter = 0x0008,
+    NSBackTabCharacter = 0x0019,
+    NSDeleteCharacter = 0x007f
+};
+
+#endif // KeyEventCodesIPhone_h
diff --git a/WebCore/platform/iphone/KeyEventIPhone.mm b/WebCore/platform/iphone/KeyEventIPhone.mm
new file mode 100644
index 0000000..f2999d9
--- /dev/null
+++ b/WebCore/platform/iphone/KeyEventIPhone.mm
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 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 COMPUTER, 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.
+ */
+
+#import "config.h"
+#import "PlatformKeyboardEvent.h"
+
+#if PLATFORM(IPHONE)
+
+#import "KeyEventCocoa.h"
+#import "Logging.h"
+#import "WebEvent.h"
+
+using namespace WTF;
+
+namespace WebCore {
+
+static String keyIdentifierForKeyEvent(WebEvent *event)
+{
+    NSString *s = event.charactersIgnoringModifiers;
+    if ([s length] != 1) {
+        LOG(Events, "received an unexpected number of characters in key event: %u", [s length]);
+        return "Unidentified";
+    }
+
+    unichar c = CFStringGetCharacterAtIndex((CFStringRef)s, 0);
+    return keyIdentifierForCharCode(c);
+}
+
+PlatformKeyboardEvent::PlatformKeyboardEvent(WebEvent *event)
+    : m_type(event.type == WebEventKeyUp ? PlatformKeyboardEvent::KeyUp : PlatformKeyboardEvent::KeyDown)
+    , m_text(event.characters)
+    , m_unmodifiedText(event.charactersIgnoringModifiers)
+    , m_keyIdentifier(keyIdentifierForKeyEvent(event))
+    , m_autoRepeat(event.isKeyRepeating)
+    , m_windowsVirtualKeyCode(event.keyCode)
+    , m_isKeypad(false) // iPhone does not distinguish the numpad <rdar://problem/7190835>
+    , m_shiftKey(event.modifierFlags & WebEventFlagMaskShift)
+    , m_ctrlKey(event.modifierFlags & WebEventFlagMaskControl)
+    , m_altKey(event.modifierFlags & WebEventFlagMaskAlternate)
+    , m_metaKey(event.modifierFlags & WebEventFlagMaskCommand)
+    , m_Event(event)
+{
+    ASSERT(event.type == WebEventKeyDown || event.type == WebEventKeyUp);
+
+    // Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter.
+    if (m_windowsVirtualKeyCode == '\r') {
+        m_text = "\r";
+        m_unmodifiedText = "\r";
+    }
+
+    // The adjustments below are only needed in backward compatibility mode, but we cannot tell what mode we are in from here.
+
+    // Turn 0x7F into 8, because backspace needs to always be 8.
+    if (m_text == "\x7F")
+        m_text = "\x8";
+    if (m_unmodifiedText == "\x7F")
+        m_unmodifiedText = "\x8";
+    // Always use 9 for tab -- we don't want to use AppKit's different character for shift-tab.
+    if (m_windowsVirtualKeyCode == 9) {
+        m_text = "\x9";
+        m_unmodifiedText = "\x9";
+    }
+}
+
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
+{
+    // Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
+    ASSERT(m_type == KeyDown);
+    ASSERT(type == RawKeyDown || type == Char);
+    m_type = type;
+    if (backwardCompatibilityMode)
+        return;
+
+    if (type == RawKeyDown) {
+        m_text = String();
+        m_unmodifiedText = String();
+    } else {
+        m_keyIdentifier = String();
+        m_windowsVirtualKeyCode = 0;
+        if (m_text.length() == 1 && (m_text[0U] >= 0xF700 && m_text[0U] <= 0xF7FF)) {
+            // According to NSEvents.h, OpenStep reserves the range 0xF700-0xF8FF for function keys. However, some actual private use characters
+            // happen to be in this range, e.g. the Apple logo (Option+Shift+K).
+            // 0xF7FF is an arbitrary cut-off.
+            m_text = String();
+            m_unmodifiedText = String();
+        }
+    }
+}
+
+bool PlatformKeyboardEvent::currentCapsLockState()
+{
+    return 0;
+}
+
+}
+
+#endif // PLATFORM(IPHONE)
diff --git a/WebCore/platform/mac/EmptyProtocolDefinitions.h b/WebCore/platform/mac/EmptyProtocolDefinitions.h
new file mode 100644
index 0000000..4d4d373
--- /dev/null
+++ b/WebCore/platform/mac/EmptyProtocolDefinitions.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008, 2010 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 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.
+ */
+
+#if defined(__OBJC__)
+
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#include <Foundation/NSPrivateDecls.h>
+#endif
+
+#define EMPTY_PROTOCOL(NAME) \
+@protocol NAME <NSObject> \
+@end
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+
+EMPTY_PROTOCOL(NSTableViewDataSource)
+EMPTY_PROTOCOL(NSTableViewDelegate)
+EMPTY_PROTOCOL(NSWindowDelegate)
+
+#endif
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) || !defined(__COCOA_FORMAL_PROTOCOLS_2__)
+
+EMPTY_PROTOCOL(NSURLConnectionDelegate)
+EMPTY_PROTOCOL(NSURLDownloadDelegate)
+
+#endif
+
+#undef EMPTY_PROTOCOL
+
+#endif /* defined(__OBJC__) */
diff --git a/WebCore/platform/mac/KeyEventMac.mm b/WebCore/platform/mac/KeyEventMac.mm
index 2e1579b..b8bf500 100644
--- a/WebCore/platform/mac/KeyEventMac.mm
+++ b/WebCore/platform/mac/KeyEventMac.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -20,342 +20,22 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #import "config.h"
 #import "PlatformKeyboardEvent.h"
 
+#if PLATFORM(MAC)
+
+#import "KeyEventCocoa.h"
 #import "Logging.h"
 #import <Carbon/Carbon.h>
-#import <wtf/ASCIICType.h>
 
 using namespace WTF;
 
 namespace WebCore {
 
-static String keyIdentifierForKeyEvent(NSEvent* event)
-{
-    if ([event type] == NSFlagsChanged) 
-        switch ([event keyCode]) {
-            case 54: // Right Command
-            case 55: // Left Command
-                return "Meta";
-                
-            case 57: // Capslock
-                return "CapsLock";
-                
-            case 56: // Left Shift
-            case 60: // Right Shift
-                return "Shift";
-                
-            case 58: // Left Alt
-            case 61: // Right Alt
-                return "Alt";
-                
-            case 59: // Left Ctrl
-            case 62: // Right Ctrl
-                return "Control";
-                
-            default:
-                ASSERT_NOT_REACHED();
-                return "";
-        }
-    
-    NSString *s = [event charactersIgnoringModifiers];
-    if ([s length] != 1) {
-        LOG(Events, "received an unexpected number of characters in key event: %u", [s length]);
-        return "Unidentified";
-    }
-    unichar c = [s characterAtIndex:0];
-    switch (c) {
-        // Each identifier listed in the DOM spec is listed here.
-        // Many are simply commented out since they do not appear on standard Macintosh keyboards
-        // or are on a key that doesn't have a corresponding character.
-
-        // "Accept"
-        // "AllCandidates"
-
-        // "Alt"
-        case NSMenuFunctionKey:
-            return "Alt";
-
-        // "Apps"
-        // "BrowserBack"
-        // "BrowserForward"
-        // "BrowserHome"
-        // "BrowserRefresh"
-        // "BrowserSearch"
-        // "BrowserStop"
-        // "CapsLock"
-
-        // "Clear"
-        case NSClearLineFunctionKey:
-            return "Clear";
-
-        // "CodeInput"
-        // "Compose"
-        // "Control"
-        // "Crsel"
-        // "Convert"
-        // "Copy"
-        // "Cut"
-
-        // "Down"
-        case NSDownArrowFunctionKey:
-            return "Down";
-        // "End"
-        case NSEndFunctionKey:
-            return "End";
-        // "Enter"
-        case 0x3: case 0xA: case 0xD: // Macintosh calls the one on the main keyboard Return, but Windows calls it Enter, so we'll do the same for the DOM
-            return "Enter";
-
-        // "EraseEof"
-
-        // "Execute"
-        case NSExecuteFunctionKey:
-            return "Execute";
-
-        // "Exsel"
-
-        // "F1"
-        case NSF1FunctionKey:
-            return "F1";
-        // "F2"
-        case NSF2FunctionKey:
-            return "F2";
-        // "F3"
-        case NSF3FunctionKey:
-            return "F3";
-        // "F4"
-        case NSF4FunctionKey:
-            return "F4";
-        // "F5"
-        case NSF5FunctionKey:
-            return "F5";
-        // "F6"
-        case NSF6FunctionKey:
-            return "F6";
-        // "F7"
-        case NSF7FunctionKey:
-            return "F7";
-        // "F8"
-        case NSF8FunctionKey:
-            return "F8";
-        // "F9"
-        case NSF9FunctionKey:
-            return "F9";
-        // "F10"
-        case NSF10FunctionKey:
-            return "F10";
-        // "F11"
-        case NSF11FunctionKey:
-            return "F11";
-        // "F12"
-        case NSF12FunctionKey:
-            return "F12";
-        // "F13"
-        case NSF13FunctionKey:
-            return "F13";
-        // "F14"
-        case NSF14FunctionKey:
-            return "F14";
-        // "F15"
-        case NSF15FunctionKey:
-            return "F15";
-        // "F16"
-        case NSF16FunctionKey:
-            return "F16";
-        // "F17"
-        case NSF17FunctionKey:
-            return "F17";
-        // "F18"
-        case NSF18FunctionKey:
-            return "F18";
-        // "F19"
-        case NSF19FunctionKey:
-            return "F19";
-        // "F20"
-        case NSF20FunctionKey:
-            return "F20";
-        // "F21"
-        case NSF21FunctionKey:
-            return "F21";
-        // "F22"
-        case NSF22FunctionKey:
-            return "F22";
-        // "F23"
-        case NSF23FunctionKey:
-            return "F23";
-        // "F24"
-        case NSF24FunctionKey:
-            return "F24";
-
-        // "FinalMode"
-
-        // "Find"
-        case NSFindFunctionKey:
-            return "Find";
-
-        // "FullWidth"
-        // "HalfWidth"
-        // "HangulMode"
-        // "HanjaMode"
-
-        // "Help"
-        case NSHelpFunctionKey:
-            return "Help";
-
-        // "Hiragana"
-
-        // "Home"
-        case NSHomeFunctionKey:
-            return "Home";
-        // "Insert"
-        case NSInsertFunctionKey:
-            return "Insert";
-
-        // "JapaneseHiragana"
-        // "JapaneseKatakana"
-        // "JapaneseRomaji"
-        // "JunjaMode"
-        // "KanaMode"
-        // "KanjiMode"
-        // "Katakana"
-        // "LaunchApplication1"
-        // "LaunchApplication2"
-        // "LaunchMail"
-
-        // "Left"
-        case NSLeftArrowFunctionKey:
-            return "Left";
-
-        // "Meta"
-        // "MediaNextTrack"
-        // "MediaPlayPause"
-        // "MediaPreviousTrack"
-        // "MediaStop"
-
-        // "ModeChange"
-        case NSModeSwitchFunctionKey:
-            return "ModeChange";
-
-        // "Nonconvert"
-        // "NumLock"
-
-        // "PageDown"
-        case NSPageDownFunctionKey:
-            return "PageDown";
-        // "PageUp"
-        case NSPageUpFunctionKey:
-            return "PageUp";
-
-        // "Paste"
-
-        // "Pause"
-        case NSPauseFunctionKey:
-            return "Pause";
-
-        // "Play"
-        // "PreviousCandidate"
-
-        // "PrintScreen"
-        case NSPrintScreenFunctionKey:
-            return "PrintScreen";
-
-        // "Process"
-        // "Props"
-
-        // "Right"
-        case NSRightArrowFunctionKey:
-            return "Right";
-
-        // "RomanCharacters"
-
-        // "Scroll"
-        case NSScrollLockFunctionKey:
-            return "Scroll";
-        // "Select"
-        case NSSelectFunctionKey:
-            return "Select";
-
-        // "SelectMedia"
-        // "Shift"
-
-        // "Stop"
-        case NSStopFunctionKey:
-            return "Stop";
-        // "Up"
-        case NSUpArrowFunctionKey:
-            return "Up";
-        // "Undo"
-        case NSUndoFunctionKey:
-            return "Undo";
-
-        // "VolumeDown"
-        // "VolumeMute"
-        // "VolumeUp"
-        // "Win"
-        // "Zoom"
-
-        // More function keys, not in the key identifier specification.
-        case NSF25FunctionKey:
-            return "F25";
-        case NSF26FunctionKey:
-            return "F26";
-        case NSF27FunctionKey:
-            return "F27";
-        case NSF28FunctionKey:
-            return "F28";
-        case NSF29FunctionKey:
-            return "F29";
-        case NSF30FunctionKey:
-            return "F30";
-        case NSF31FunctionKey:
-            return "F31";
-        case NSF32FunctionKey:
-            return "F32";
-        case NSF33FunctionKey:
-            return "F33";
-        case NSF34FunctionKey:
-            return "F34";
-        case NSF35FunctionKey:
-            return "F35";
-
-        // Turn 0x7F into 0x08, because backspace needs to always be 0x08.
-        case 0x7F:
-            return "U+0008";
-        // Standard says that DEL becomes U+007F.
-        case NSDeleteFunctionKey:
-            return "U+007F";
-            
-        // Always use 0x09 for tab instead of AppKit's backtab character.
-        case NSBackTabCharacter:
-            return "U+0009";
-
-        case NSBeginFunctionKey:
-        case NSBreakFunctionKey:
-        case NSClearDisplayFunctionKey:
-        case NSDeleteCharFunctionKey:
-        case NSDeleteLineFunctionKey:
-        case NSInsertCharFunctionKey:
-        case NSInsertLineFunctionKey:
-        case NSNextFunctionKey:
-        case NSPrevFunctionKey:
-        case NSPrintFunctionKey:
-        case NSRedoFunctionKey:
-        case NSResetFunctionKey:
-        case NSSysReqFunctionKey:
-        case NSSystemFunctionKey:
-        case NSUserFunctionKey:
-            // FIXME: We should use something other than the vendor-area Unicode values for the above keys.
-            // For now, just fall through to the default.
-        default:
-            return String::format("U+%04X", toASCIIUpper(c));
-    }
-}
-
 static bool isKeypadEvent(NSEvent* event)
 {
     // Check that this is the type of event that has a keyCode.
@@ -392,378 +72,10 @@
         case 92: // 9
             return true;
      }
-     
+
      return false;
 }
 
-static int windowsKeyCodeForKeyEvent(NSEvent* event)
-{
-    switch ([event keyCode]) {
-        // VK_TAB (09) TAB key
-        case 48: return 0x09;
-
-        // VK_APPS (5D) Right windows/meta key
-        case 54: // Right Command
-            return 0x5D;
-            
-        // VK_LWIN (5B) Left windows/meta key
-        case 55: // Left Command
-            return 0x5B;
-            
-        // VK_CAPITAL (14) caps locks key
-        case 57: // Capslock
-            return 0x14;
-            
-        // VK_SHIFT (10) either shift key
-        case 56: // Left Shift
-        case 60: // Right Shift
-            return 0x10;
-            
-        // VK_MENU (12) either alt key
-        case 58: // Left Alt
-        case 61: // Right Alt
-            return 0x12;
-            
-        // VK_CONTROL (11) either ctrl key
-        case 59: // Left Ctrl
-        case 62: // Right Ctrl
-            return 0x11;
-            
-        // VK_CLEAR (0C) CLEAR key
-        case 71: return 0x0C;
-
-        // VK_NUMPAD0 (60) Numeric keypad 0 key
-        case 82: return 0x60;
-        // VK_NUMPAD1 (61) Numeric keypad 1 key
-        case 83: return 0x61;
-        // VK_NUMPAD2 (62) Numeric keypad 2 key
-        case 84: return 0x62;
-        // VK_NUMPAD3 (63) Numeric keypad 3 key
-        case 85: return 0x63;
-        // VK_NUMPAD4 (64) Numeric keypad 4 key
-        case 86: return 0x64;
-        // VK_NUMPAD5 (65) Numeric keypad 5 key
-        case 87: return 0x65;
-        // VK_NUMPAD6 (66) Numeric keypad 6 key
-        case 88: return 0x66;
-        // VK_NUMPAD7 (67) Numeric keypad 7 key
-        case 89: return 0x67;
-        // VK_NUMPAD8 (68) Numeric keypad 8 key
-        case 91: return 0x68;
-        // VK_NUMPAD9 (69) Numeric keypad 9 key
-        case 92: return 0x69;
-        // VK_MULTIPLY (6A) Multiply key
-        case 67: return 0x6A;
-        // VK_ADD (6B) Add key
-        case 69: return 0x6B;
-
-        // VK_SUBTRACT (6D) Subtract key
-        case 78: return 0x6D;
-        // VK_DECIMAL (6E) Decimal key
-        case 65: return 0x6E;
-        // VK_DIVIDE (6F) Divide key
-        case 75: return 0x6F;
-     }
-
-    NSString* s = [event charactersIgnoringModifiers];
-    if ([s length] != 1)
-        return 0;
-
-    switch ([s characterAtIndex:0]) {
-        // VK_LBUTTON (01) Left mouse button
-        // VK_RBUTTON (02) Right mouse button
-        // VK_CANCEL (03) Control-break processing
-        // VK_MBUTTON (04) Middle mouse button (three-button mouse)
-        // VK_XBUTTON1 (05)
-        // VK_XBUTTON2 (06)
-
-        // VK_BACK (08) BACKSPACE key
-        case 8: case 0x7F: return 0x08;
-        // VK_TAB (09) TAB key
-        case 9: return 0x09;
-
-        // VK_CLEAR (0C) CLEAR key
-        // handled by key code above
-
-        // VK_RETURN (0D)
-        case 0xD: case 3: return 0x0D;
-
-        // VK_SHIFT (10) SHIFT key
-        // VK_CONTROL (11) CTRL key
-        // VK_MENU (12) ALT key
-
-        // VK_PAUSE (13) PAUSE key
-        case NSPauseFunctionKey: return 0x13;
-
-        // VK_CAPITAL (14) CAPS LOCK key
-        // VK_KANA (15) Input Method Editor (IME) Kana mode
-        // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
-        // VK_HANGUL (15) IME Hangul mode
-        // VK_JUNJA (17) IME Junja mode
-        // VK_FINAL (18) IME final mode
-        // VK_HANJA (19) IME Hanja mode
-        // VK_KANJI (19) IME Kanji mode
-
-        // VK_ESCAPE (1B) ESC key
-        case 0x1B: return 0x1B;
-
-        // VK_CONVERT (1C) IME convert
-        // VK_NONCONVERT (1D) IME nonconvert
-        // VK_ACCEPT (1E) IME accept
-        // VK_MODECHANGE (1F) IME mode change request
-
-        // VK_SPACE (20) SPACEBAR
-        case ' ': return 0x20;
-        // VK_PRIOR (21) PAGE UP key
-        case NSPageUpFunctionKey: return 0x21;
-        // VK_NEXT (22) PAGE DOWN key
-        case NSPageDownFunctionKey: return 0x22;
-        // VK_END (23) END key
-        case NSEndFunctionKey: return 0x23;
-        // VK_HOME (24) HOME key
-        case NSHomeFunctionKey: return 0x24;
-        // VK_LEFT (25) LEFT ARROW key
-        case NSLeftArrowFunctionKey: return 0x25;
-        // VK_UP (26) UP ARROW key
-        case NSUpArrowFunctionKey: return 0x26;
-        // VK_RIGHT (27) RIGHT ARROW key
-        case NSRightArrowFunctionKey: return 0x27;
-        // VK_DOWN (28) DOWN ARROW key
-        case NSDownArrowFunctionKey: return 0x28;
-        // VK_SELECT (29) SELECT key
-        case NSSelectFunctionKey: return 0x29;
-        // VK_PRINT (2A) PRINT key
-        case NSPrintFunctionKey: return 0x2A;
-        // VK_EXECUTE (2B) EXECUTE key
-        case NSExecuteFunctionKey: return 0x2B;
-        // VK_SNAPSHOT (2C) PRINT SCREEN key
-        case NSPrintScreenFunctionKey: return 0x2C;
-        // VK_INSERT (2D) INS key
-        case NSInsertFunctionKey: case NSHelpFunctionKey: return 0x2D;
-        // VK_DELETE (2E) DEL key
-        case NSDeleteFunctionKey: return 0x2E;
-
-        // VK_HELP (2F) HELP key
-
-        //  (30) 0 key
-        case '0': case ')': return 0x30;
-        //  (31) 1 key
-        case '1': case '!': return 0x31;
-        //  (32) 2 key
-        case '2': case '@': return 0x32;
-        //  (33) 3 key
-        case '3': case '#': return 0x33;
-        //  (34) 4 key
-        case '4': case '$': return 0x34;
-        //  (35) 5 key
-        case '5': case '%': return 0x35;
-        //  (36) 6 key
-        case '6': case '^': return 0x36;
-        //  (37) 7 key
-        case '7': case '&': return 0x37;
-        //  (38) 8 key
-        case '8': case '*': return 0x38;
-        //  (39) 9 key
-        case '9': case '(': return 0x39;
-        //  (41) A key
-        case 'a': case 'A': return 0x41;
-        //  (42) B key
-        case 'b': case 'B': return 0x42;
-        //  (43) C key
-        case 'c': case 'C': return 0x43;
-        //  (44) D key
-        case 'd': case 'D': return 0x44;
-        //  (45) E key
-        case 'e': case 'E': return 0x45;
-        //  (46) F key
-        case 'f': case 'F': return 0x46;
-        //  (47) G key
-        case 'g': case 'G': return 0x47;
-        //  (48) H key
-        case 'h': case 'H': return 0x48;
-        //  (49) I key
-        case 'i': case 'I': return 0x49;
-        //  (4A) J key
-        case 'j': case 'J': return 0x4A;
-        //  (4B) K key
-        case 'k': case 'K': return 0x4B;
-        //  (4C) L key
-        case 'l': case 'L': return 0x4C;
-        //  (4D) M key
-        case 'm': case 'M': return 0x4D;
-        //  (4E) N key
-        case 'n': case 'N': return 0x4E;
-        //  (4F) O key
-        case 'o': case 'O': return 0x4F;
-        //  (50) P key
-        case 'p': case 'P': return 0x50;
-        //  (51) Q key
-        case 'q': case 'Q': return 0x51;
-        //  (52) R key
-        case 'r': case 'R': return 0x52;
-        //  (53) S key
-        case 's': case 'S': return 0x53;
-        //  (54) T key
-        case 't': case 'T': return 0x54;
-        //  (55) U key
-        case 'u': case 'U': return 0x55;
-        //  (56) V key
-        case 'v': case 'V': return 0x56;
-        //  (57) W key
-        case 'w': case 'W': return 0x57;
-        //  (58) X key
-        case 'x': case 'X': return 0x58;
-        //  (59) Y key
-        case 'y': case 'Y': return 0x59;
-        //  (5A) Z key
-        case 'z': case 'Z': return 0x5A;
-
-        // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-        // VK_RWIN (5C) Right Windows key (Natural keyboard)
-        // VK_APPS (5D) Applications key (Natural keyboard)
-        // VK_SLEEP (5F) Computer Sleep key
-
-        // VK_NUMPAD0 (60) Numeric keypad 0 key
-        // VK_NUMPAD1 (61) Numeric keypad 1 key
-        // VK_NUMPAD2 (62) Numeric keypad 2 key
-        // VK_NUMPAD3 (63) Numeric keypad 3 key
-        // VK_NUMPAD4 (64) Numeric keypad 4 key
-        // VK_NUMPAD5 (65) Numeric keypad 5 key
-        // VK_NUMPAD6 (66) Numeric keypad 6 key
-        // VK_NUMPAD7 (67) Numeric keypad 7 key
-        // VK_NUMPAD8 (68) Numeric keypad 8 key
-        // VK_NUMPAD9 (69) Numeric keypad 9 key
-        // VK_MULTIPLY (6A) Multiply key
-        // VK_ADD (6B) Add key
-        // handled by key code above
-
-        // VK_SEPARATOR (6C) Separator key
-
-        // VK_SUBTRACT (6D) Subtract key
-        // VK_DECIMAL (6E) Decimal key
-        // VK_DIVIDE (6F) Divide key
-        // handled by key code above
-
-        // VK_F1 (70) F1 key
-        case NSF1FunctionKey: return 0x70;
-        // VK_F2 (71) F2 key
-        case NSF2FunctionKey: return 0x71;
-        // VK_F3 (72) F3 key
-        case NSF3FunctionKey: return 0x72;
-        // VK_F4 (73) F4 key
-        case NSF4FunctionKey: return 0x73;
-        // VK_F5 (74) F5 key
-        case NSF5FunctionKey: return 0x74;
-        // VK_F6 (75) F6 key
-        case NSF6FunctionKey: return 0x75;
-        // VK_F7 (76) F7 key
-        case NSF7FunctionKey: return 0x76;
-        // VK_F8 (77) F8 key
-        case NSF8FunctionKey: return 0x77;
-        // VK_F9 (78) F9 key
-        case NSF9FunctionKey: return 0x78;
-        // VK_F10 (79) F10 key
-        case NSF10FunctionKey: return 0x79;
-        // VK_F11 (7A) F11 key
-        case NSF11FunctionKey: return 0x7A;
-        // VK_F12 (7B) F12 key
-        case NSF12FunctionKey: return 0x7B;
-        // VK_F13 (7C) F13 key
-        case NSF13FunctionKey: return 0x7C;
-        // VK_F14 (7D) F14 key
-        case NSF14FunctionKey: return 0x7D;
-        // VK_F15 (7E) F15 key
-        case NSF15FunctionKey: return 0x7E;
-        // VK_F16 (7F) F16 key
-        case NSF16FunctionKey: return 0x7F;
-        // VK_F17 (80H) F17 key
-        case NSF17FunctionKey: return 0x80;
-        // VK_F18 (81H) F18 key
-        case NSF18FunctionKey: return 0x81;
-        // VK_F19 (82H) F19 key
-        case NSF19FunctionKey: return 0x82;
-        // VK_F20 (83H) F20 key
-        case NSF20FunctionKey: return 0x83;
-        // VK_F21 (84H) F21 key
-        case NSF21FunctionKey: return 0x84;
-        // VK_F22 (85H) F22 key
-        case NSF22FunctionKey: return 0x85;
-        // VK_F23 (86H) F23 key
-        case NSF23FunctionKey: return 0x86;
-        // VK_F24 (87H) F24 key
-        case NSF24FunctionKey: return 0x87;
-
-        // VK_NUMLOCK (90) NUM LOCK key
-
-        // VK_SCROLL (91) SCROLL LOCK key
-        case NSScrollLockFunctionKey: return 0x91;
-
-        // VK_LSHIFT (A0) Left SHIFT key
-        // VK_RSHIFT (A1) Right SHIFT key
-        // VK_LCONTROL (A2) Left CONTROL key
-        // VK_RCONTROL (A3) Right CONTROL key
-        // VK_LMENU (A4) Left MENU key
-        // VK_RMENU (A5) Right MENU key
-        // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-        // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-        // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-        // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-        // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-        // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-        // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-        // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-        // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-        // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-        // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-        // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-        // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-        // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-        // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-        // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-        // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-        // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-
-        // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
-        case ';': case ':': return 0xBA;
-        // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-        case '=': case '+': return 0xBB;
-        // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-        case ',': case '<': return 0xBC;
-        // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-        case '-': case '_': return 0xBD;
-        // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-        case '.': case '>': return 0xBE;
-        // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-        case '/': case '?': return 0xBF;
-        // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-        case '`': case '~': return 0xC0;
-        // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-        case '[': case '{': return 0xDB;
-        // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-        case '\\': case '|': return 0xDC;
-        // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-        case ']': case '}': return 0xDD;
-        // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-        case '\'': case '"': return 0xDE;
-
-        // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
-        // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-        // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-        // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-        // VK_ATTN (F6) Attn key
-        // VK_CRSEL (F7) CrSel key
-        // VK_EXSEL (F8) ExSel key
-        // VK_EREOF (F9) Erase EOF key
-        // VK_PLAY (FA) Play key
-        // VK_ZOOM (FB) Zoom key
-        // VK_NONAME (FC) Reserved for future use
-        // VK_PA1 (FD) PA1 key
-        // VK_OEM_CLEAR (FE) Clear key
-    }
-
-    return 0;
-}
-
 static inline bool isKeyUpEvent(NSEvent *event)
 {
     if ([event type] != NSFlagsChanged)
@@ -774,22 +86,22 @@
         case 54: // Right Command
         case 55: // Left Command
             return ([event modifierFlags] & NSCommandKeyMask) == 0;
-            
+
         case 57: // Capslock
             return ([event modifierFlags] & NSAlphaShiftKeyMask) == 0;
-            
+
         case 56: // Left Shift
         case 60: // Right Shift
             return ([event modifierFlags] & NSShiftKeyMask) == 0;
-            
+
         case 58: // Left Alt
         case 61: // Right Alt
             return ([event modifierFlags] & NSAlternateKeyMask) == 0;
-            
+
         case 59: // Left Ctrl
         case 62: // Right Ctrl
             return ([event modifierFlags] & NSControlKeyMask) == 0;
-            
+
         case 63: // Function
             return ([event modifierFlags] & NSFunctionKeyMask) == 0;
     }
@@ -802,8 +114,8 @@
         return "";
     return [event characters];
 }
-    
-    
+
+
 static inline String unmodifiedTextFromEvent(NSEvent* event)
 {
     if ([event type] == NSFlagsChanged)
@@ -811,17 +123,61 @@
     return [event charactersIgnoringModifiers];
 }
 
-PlatformKeyboardEvent::PlatformKeyboardEvent()
-    : m_type(KeyDown)
-    , m_autoRepeat(false)
-    , m_windowsVirtualKeyCode(0)
-    , m_nativeVirtualKeyCode(0)
-    , m_isKeypad(false)
-    , m_shiftKey(false)
-    , m_ctrlKey(false)
-    , m_altKey(false)
-    , m_metaKey(false)
+static String keyIdentifierForKeyEvent(NSEvent* event)
 {
+    if ([event type] == NSFlagsChanged)
+        switch ([event keyCode]) {
+            case 54: // Right Command
+            case 55: // Left Command
+                return "Meta";
+
+            case 57: // Capslock
+                return "CapsLock";
+
+            case 56: // Left Shift
+            case 60: // Right Shift
+                return "Shift";
+
+            case 58: // Left Alt
+            case 61: // Right Alt
+                return "Alt";
+
+            case 59: // Left Ctrl
+            case 62: // Right Ctrl
+                return "Control";
+
+            default:
+                ASSERT_NOT_REACHED();
+                return "";
+        }
+
+    NSString *s = [event charactersIgnoringModifiers];
+    if ([s length] != 1) {
+        LOG(Events, "received an unexpected number of characters in key event: %u", [s length]);
+        return "Unidentified";
+    }
+    return keyIdentifierForCharCode([s characterAtIndex:0]);
+}
+
+static int windowsKeyCodeForKeyEvent(NSEvent *event)
+{
+    int code = 0;
+    // There are several kinds of characters for which we produce key code from char code:
+    // 1. Roman letters. Windows keyboard layouts affect both virtual key codes and character codes for these,
+    //    so e.g. 'A' gets the same keyCode on QWERTY, AZERTY or Dvorak layouts.
+    // 2. Keys for which there is no known Mac virtual key codes, like PrintScreen.
+    // 3. Certain punctuation keys. On Windows, these are also remapped depending on current keyboard layout,
+    //    but see comment in windowsKeyCodeForCharCode().
+    if ([event type] == NSKeyDown || [event type] == NSKeyUp) {
+        NSString* s = [event characters]; // Cannot use charactersIgnoringModifiers, because Cmd switches Roman letters for Dvorak-QWERTY layout.
+        code = [s length] > 0 ? windowsKeyCodeForCharCode([s characterAtIndex:0]) : 0;
+        if (code)
+            return code;
+    }
+
+    // Map Mac virtual key code directly to Windows one for any keys not handled above.
+    // E.g. the key next to Caps Lock has the same Event.keyCode on U.S. keyboard ('A') and on Russian keyboard (CYRILLIC LETTER EF).
+    return windowsKeyCodeForKeyCode([event keyCode]);
 }
 
 PlatformKeyboardEvent::PlatformKeyboardEvent(NSEvent *event)
@@ -889,4 +245,15 @@
     return GetCurrentKeyModifiers() & alphaLock;
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    UInt32 currentModifiers = GetCurrentKeyModifiers();
+    shiftKey = currentModifiers & ::shiftKey;
+    ctrlKey = currentModifiers & ::controlKey;
+    altKey = currentModifiers & ::optionKey;
+    metaKey = currentModifiers & ::cmdKey;
 }
+
+}
+
+#endif // PLATFORM(MAC)
diff --git a/WebCore/platform/mac/LocalizedStringsMac.mm b/WebCore/platform/mac/LocalizedStringsMac.mm
index 55fdd21..510249a 100644
--- a/WebCore/platform/mac/LocalizedStringsMac.mm
+++ b/WebCore/platform/mac/LocalizedStringsMac.mm
@@ -699,6 +699,21 @@
     return String();
 }
 
+String missingPluginText()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    return [[WebCoreViewFactory sharedFactory] missingPluginText];
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return String();
+}
+
+String crashedPluginText()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    return [[WebCoreViewFactory sharedFactory] crashedPluginText];
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return String();
+}
 
 String multipleFileUploadText(unsigned numberOfFiles)
 {
diff --git a/WebCore/platform/mac/LoggingMac.mm b/WebCore/platform/mac/LoggingMac.mm
index d3ba4d7..3e83579 100644
--- a/WebCore/platform/mac/LoggingMac.mm
+++ b/WebCore/platform/mac/LoggingMac.mm
@@ -54,7 +54,7 @@
     initializeWithUserDefault(LogPopupBlocking);
     initializeWithUserDefault(LogEvents);
     initializeWithUserDefault(LogEditing);
-    initializeWithUserDefault(LogTextConversion);
+    initializeWithUserDefault(LogLiveConnect);
     initializeWithUserDefault(LogIconDatabase);
     initializeWithUserDefault(LogSQLDatabase);
     initializeWithUserDefault(LogSpellingAndGrammar);
diff --git a/WebCore/platform/mac/MIMETypeRegistryMac.mm b/WebCore/platform/mac/MIMETypeRegistryMac.mm
index 7d43505..82348e0 100644
--- a/WebCore/platform/mac/MIMETypeRegistryMac.mm
+++ b/WebCore/platform/mac/MIMETypeRegistryMac.mm
@@ -56,4 +56,9 @@
     return wkGetPreferredExtensionForMIMEType(type);
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 }
diff --git a/WebCore/platform/mac/PasteboardMac.mm b/WebCore/platform/mac/PasteboardMac.mm
index 086b272..03ede03 100644
--- a/WebCore/platform/mac/PasteboardMac.mm
+++ b/WebCore/platform/mac/PasteboardMac.mm
@@ -184,7 +184,7 @@
     if ([types containsObject:NSStringPboardType]) {
         // Map &nbsp; to a plain old space because this is better for source code, other browsers do it,
         // and because HTML forces you to do this any time you want two spaces in a row.
-        String text = frame->displayStringModifiedByEncoding(selectedRange->text());
+        String text = selectedRange->text();
         NSMutableString *s = [[[(NSString*)text copy] autorelease] mutableCopy];
         
         NSString *NonBreakingSpaceString = [NSString stringWithCharacters:&noBreakSpace length:1];
diff --git a/WebCore/platform/mac/PopupMenuMac.mm b/WebCore/platform/mac/PopupMenuMac.mm
index 22f1e5b..0ecaa13 100644
--- a/WebCore/platform/mac/PopupMenuMac.mm
+++ b/WebCore/platform/mac/PopupMenuMac.mm
@@ -20,6 +20,7 @@
 #import "config.h"
 #import "PopupMenu.h"
 
+#import "AXObjectCache.h"
 #import "Chrome.h"
 #import "ChromeClient.h"
 #import "EventHandler.h"
@@ -100,6 +101,13 @@
             [menuItem setEnabled:client()->itemIsEnabled(i)];
             [menuItem setToolTip:client()->itemToolTip(i)];
             [string release];
+            
+            // Allow the accessible text of the item to be overriden if necessary.
+            if (AXObjectCache::accessibilityEnabled()) {
+                NSString *accessibilityOverride = client()->itemAccessibilityText(i);
+                if ([accessibilityOverride length])
+                    [menuItem accessibilitySetOverrideValue:accessibilityOverride forAttribute:NSAccessibilityDescriptionAttribute];
+            }
         }
     }
 
diff --git a/WebCore/platform/mac/PurgeableBufferMac.cpp b/WebCore/platform/mac/PurgeableBufferMac.cpp
index 1b49de0..9902f77 100644
--- a/WebCore/platform/mac/PurgeableBufferMac.cpp
+++ b/WebCore/platform/mac/PurgeableBufferMac.cpp
@@ -31,11 +31,12 @@
 
 #include <mach/mach.h>
 #include <wtf/Assertions.h>
+#include <wtf/VMTags.h>
 
 namespace WebCore {
-    
+
 static const size_t minPurgeableBufferSize = 4096; // one page
-    
+
 PurgeableBuffer::PurgeableBuffer(char* data, size_t size)
     : m_data(data)
     , m_size(size)
@@ -43,7 +44,7 @@
     , m_state(NonVolatile)
 {
 }
-    
+
 PurgeableBuffer::~PurgeableBuffer()
 {
     vm_deallocate(mach_task_self(), reinterpret_cast<vm_address_t>(m_data), m_size);
@@ -53,9 +54,9 @@
 {
     if (size < minPurgeableBufferSize)
         return 0;
-    
+
     vm_address_t buffer = 0;
-    kern_return_t ret = vm_allocate(mach_task_self(), &buffer, size, VM_FLAGS_PURGABLE | VM_FLAGS_ANYWHERE);
+    kern_return_t ret = vm_allocate(mach_task_self(), &buffer, size, VM_FLAGS_PURGABLE | VM_FLAGS_ANYWHERE | VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY);
 
     ASSERT(ret == KERN_SUCCESS);
     if (ret != KERN_SUCCESS)
diff --git a/WebCore/platform/mac/ThemeMac.h b/WebCore/platform/mac/ThemeMac.h
index ce534b1..bf2d691 100644
--- a/WebCore/platform/mac/ThemeMac.h
+++ b/WebCore/platform/mac/ThemeMac.h
@@ -49,6 +49,9 @@
 
     virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect&, float zoomFactor, ScrollView*) const;
     virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect&, float zoomFactor) const;
+
+    // FIXME: Once RenderThemeMac is converted over to use Theme then this can be internal to ThemeMac.
+    static NSView* ensuredView(ScrollView*);
 };
 
 } // namespace WebCore
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index b71a651..bbc6d6b 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -35,6 +35,19 @@
 
 using namespace std;
 
+// This is a view whose sole purpose is to tell AppKit that it's flipped.
+@interface WebCoreFlippedView : NSView
+@end
+
+@implementation WebCoreFlippedView
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+@end
+
 // FIXME: Default buttons really should be more like push buttons and not like buttons.
 
 namespace WebCore {
@@ -200,6 +213,7 @@
 
     // Determine the width and height needed for the control and prepare the cell for painting.
     NSButtonCell *checkboxCell = checkbox(states, zoomedRect, zoomFactor);
+    LocalCurrentGraphicsContext localContext(context);
 
     context->save();
 
@@ -217,7 +231,7 @@
         context->translate(-inflatedRect.x(), -inflatedRect.y());
     }
     
-    [checkboxCell drawWithFrame:NSRect(inflatedRect) inView:scrollView->documentView()];
+    [checkboxCell drawWithFrame:NSRect(inflatedRect) inView:ThemeMac::ensuredView(scrollView)];
     [checkboxCell setControlView:nil];
 
     context->restore();
@@ -277,6 +291,7 @@
 {
     // Determine the width and height needed for the control and prepare the cell for painting.
     NSButtonCell *radioCell = radio(states, zoomedRect, zoomFactor);
+    LocalCurrentGraphicsContext localContext(context);
 
     context->save();
 
@@ -295,7 +310,7 @@
     }
     
     BEGIN_BLOCK_OBJC_EXCEPTIONS
-    [radioCell drawWithFrame:NSRect(inflatedRect) inView:scrollView->documentView()];
+    [radioCell drawWithFrame:NSRect(inflatedRect) inView:ThemeMac::ensuredView(scrollView)];
     [radioCell setControlView:nil];
     END_BLOCK_OBJC_EXCEPTIONS
 
@@ -405,7 +420,7 @@
         }
     } 
 
-    NSView *view = scrollView->documentView();
+    NSView *view = ThemeMac::ensuredView(scrollView);
     NSWindow *window = [view window];
     NSButtonCell *previousDefaultButtonCell = [window defaultButtonCell];
 
@@ -415,26 +430,28 @@
     } else if ([previousDefaultButtonCell isEqual:buttonCell])
         [window setDefaultButtonCell:nil];
 
-    if (!view) {
-        context->save();
-        context->translate(inflatedRect.x(), inflatedRect.y());
-        context->scale(FloatSize(1, -1));
-        context->translate(0, -inflatedRect.height());
-        inflatedRect.setLocation(IntPoint());
-    }
-
     [buttonCell drawWithFrame:NSRect(inflatedRect) inView:view];
     [buttonCell setControlView:nil];
 
-    if (!view)
-        context->restore();
-
     if (![previousDefaultButtonCell isEqual:buttonCell])
         [window setDefaultButtonCell:previousDefaultButtonCell];
 
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
+// This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView.
+// If the ScrollView doesn't have an NSView, we will return a fake NSView whose sole purpose is to tell AppKit that it's flipped.
+NSView *ThemeMac::ensuredView(ScrollView* scrollView)
+{
+    if (NSView *documentView = scrollView->documentView())
+        return documentView;
+    
+    // Use a fake flipped view.
+    static NSView *flippedView = [[WebCoreFlippedView alloc] init];
+    
+    return flippedView;
+}
+    
 // Theme overrides
 
 int ThemeMac::baselinePositionAdjustment(ControlPart part) const
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index e7521dc..ea30023 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -97,6 +97,7 @@
     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
     void *context);
+extern NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
 extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
 extern void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
@@ -116,7 +117,7 @@
 extern double (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
 extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
 extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
-extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
+extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, float* wheelTicksX, float* wheelTicksY, BOOL* continuous);
 extern BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
 extern void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
 extern BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
@@ -126,9 +127,10 @@
 extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
 extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
 extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
-extern int (*wkQTMovieGetType)(QTMovie* movie);
-extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
-extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
+extern int (*wkQTMovieGetType)(QTMovie*);
+extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
+extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
+extern void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
 extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
 extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
 extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index f3e0e77..b63c5c2 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008, 2010 Apple Computer, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,6 +29,7 @@
 
 void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
+NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
 NSString* (*wkCreateURLPasteboardFlavorTypeName)(void);
 NSString* (*wkCreateURLNPasteboardFlavorTypeName)(void);
 void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
@@ -51,16 +52,17 @@
 NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
 NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
 BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
-void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
+void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, float* wheelTicksX, float* wheelTicksY, BOOL* continuous);
 void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
 unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
 int (*wkQTMovieDataRate)(QTMovie*);
 float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
 NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
 float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
-int (*wkQTMovieGetType)(QTMovie* movie);
-BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
-void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
+int (*wkQTMovieGetType)(QTMovie*);
+BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
+void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
+void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
 void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
 void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
 void (*wkSetDragImage)(NSImage*, NSPoint offset);
diff --git a/WebCore/platform/mac/WheelEventMac.mm b/WebCore/platform/mac/WheelEventMac.mm
index c9a0efc..d7e2934 100644
--- a/WebCore/platform/mac/WheelEventMac.mm
+++ b/WebCore/platform/mac/WheelEventMac.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2010 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,13 +43,9 @@
     , m_metaKey([event modifierFlags] & NSCommandKeyMask)
 {
     BOOL continuous;
-    wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &continuous);
-    if (continuous) {
-        m_wheelTicksX = m_deltaX / static_cast<float>(Scrollbar::pixelsPerLineStep());
-        m_wheelTicksY = m_deltaY / static_cast<float>(Scrollbar::pixelsPerLineStep());
-    } else {
-        m_wheelTicksX = m_deltaX;
-        m_wheelTicksY = m_deltaY;
+    wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &m_wheelTicksX, &m_wheelTicksY, &continuous);
+
+    if (!continuous) {
         m_deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
         m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
     }
diff --git a/WebCore/platform/mac/WidgetMac.mm b/WebCore/platform/mac/WidgetMac.mm
index e473053..1aad76f 100644
--- a/WebCore/platform/mac/WidgetMac.mm
+++ b/WebCore/platform/mac/WidgetMac.mm
@@ -56,12 +56,22 @@
 - (void)webPlugInSetIsSelected:(BOOL)isSelected;
 @end
 
+@interface NSView (Widget)
+- (void)visibleRectDidChange;
+@end
+
 namespace WebCore {
 
 class WidgetPrivate {
 public:
+    WidgetPrivate()
+        : previousVisibleRect(NSZeroRect)
+    {
+    }
+
     bool mustStayInWindow;
     bool removeFromSuperviewSoon;
+    NSRect previousVisibleRect;
 };
 
 static void safeRemoveFromSuperview(NSView *view)
@@ -162,11 +172,15 @@
     if (!v)
         return;
 
+    NSRect visibleRect = [v visibleRect];
     NSRect f = rect;
     if (!NSEqualRects(f, [v frame])) {
         [v setFrame:f];
-        [v setNeedsDisplay: NO];
-    }
+        [v setNeedsDisplay:NO];
+    } else if (!NSEqualRects(visibleRect, m_data->previousVisibleRect) && [v respondsToSelector:@selector(visibleRectDidChange)])
+        [v visibleRectDidChange];
+
+    m_data->previousVisibleRect = visibleRect;
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
@@ -339,6 +353,7 @@
 void Widget::releasePlatformWidget()
 {
     HardRelease(m_widget);
+    m_data->previousVisibleRect = NSZeroRect;
 }
 
 void Widget::retainPlatformWidget()
diff --git a/WebCore/platform/mock/GeolocationServiceMock.cpp b/WebCore/platform/mock/GeolocationServiceMock.cpp
index 0104747..c3ba7b4 100644
--- a/WebCore/platform/mock/GeolocationServiceMock.cpp
+++ b/WebCore/platform/mock/GeolocationServiceMock.cpp
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "GeolocationServiceMock.h"
 
+#if ENABLE(GEOLOCATION)
+
 #include "Logging.h"
 #include "Geolocation.h"
 #include "Geoposition.h"
@@ -139,3 +141,5 @@
 }
 
 } // namespace WebCore
+
+#endif
diff --git a/WebCore/platform/network/CredentialStorage.cpp b/WebCore/platform/network/CredentialStorage.cpp
index 2c78e3c..1adda69 100644
--- a/WebCore/platform/network/CredentialStorage.cpp
+++ b/WebCore/platform/network/CredentialStorage.cpp
@@ -26,11 +26,11 @@
 #include "config.h"
 #include "CredentialStorage.h"
 
-#include "CString.h"
 #include "Credential.h"
 #include "KURL.h"
 #include "ProtectionSpaceHash.h"
 #include "StringHash.h"
+#include <wtf/text/CString.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/StdLibExtras.h>
diff --git a/WebCore/platform/network/DNS.h b/WebCore/platform/network/DNS.h
index c232272..1eeec3c 100644
--- a/WebCore/platform/network/DNS.h
+++ b/WebCore/platform/network/DNS.h
@@ -30,7 +30,9 @@
 
     class String;
 
+#if !USE(SOUP)
     void prefetchDNS(const String& hostname);
+#endif
 }
 
 #endif
diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp
index af3b7f0..4ad82fb 100644
--- a/WebCore/platform/network/FormData.cpp
+++ b/WebCore/platform/network/FormData.cpp
@@ -21,10 +21,18 @@
 #include "config.h"
 #include "FormData.h"
 
-#include "CString.h"
+#include "Blob.h"
+#include "Chrome.h"
 #include "ChromeClient.h"
+#include "DOMFormData.h"
+#include "Document.h"
+#include "File.h"
 #include "FileSystem.h"
+#include "FormDataBuilder.h"
+#include "MIMETypeRegistry.h"
+#include "Page.h"
 #include "TextEncoding.h"
+#include "UUID.h"
 
 namespace WebCore {
 
@@ -88,6 +96,20 @@
     return result.release();
 }
 
+PassRefPtr<FormData> FormData::create(const DOMFormData& domFormData)
+{
+    RefPtr<FormData> result = create();
+    result->appendDOMFormData(domFormData, false, 0);
+    return result.release();
+}
+
+PassRefPtr<FormData> FormData::createMultiPart(const DOMFormData& domFormData, Document* document)
+{
+    RefPtr<FormData> result = create();
+    result->appendDOMFormData(domFormData, true, document);
+    return result.release();
+}
+
 PassRefPtr<FormData> FormData::copy() const
 {
     return adoptRef(new FormData(*this));
@@ -108,7 +130,11 @@
             formData->m_elements.append(FormDataElement(e.m_data));
             break;
         case FormDataElement::encodedFile:
+#if ENABLE(BLOB_SLICE)
+            formData->m_elements.append(FormDataElement(e.m_filename, e.m_fileStart, e.m_fileLength, e.m_expectedFileModificationTime, e.m_shouldGenerateFile));
+#else
             formData->m_elements.append(FormDataElement(e.m_filename, e.m_shouldGenerateFile));
+#endif
             break;
         }
     }
@@ -127,7 +153,114 @@
 
 void FormData::appendFile(const String& filename, bool shouldGenerateFile)
 {
+#if ENABLE(BLOB_SLICE)
+    m_elements.append(FormDataElement(filename, 0, Blob::toEndOfFile, Blob::doNotCheckFileChange, shouldGenerateFile));
+#else
     m_elements.append(FormDataElement(filename, shouldGenerateFile));
+#endif
+}
+
+#if ENABLE(BLOB_SLICE)
+void FormData::appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile)
+{
+    m_elements.append(FormDataElement(filename, start, length, expectedModificationTime, shouldGenerateFile));
+}
+#endif
+
+void FormData::appendDOMFormData(const DOMFormData& domFormData, bool isMultiPartForm, Document* document)
+{
+    FormDataBuilder formDataBuilder;
+    if (isMultiPartForm)
+        m_boundary = formDataBuilder.generateUniqueBoundaryString();
+
+    Vector<char> encodedData;
+    TextEncoding encoding = domFormData.encoding();
+
+    const Vector<FormDataList::Item>& list = domFormData.list();
+    size_t formDataListSize = list.size();
+    ASSERT(!(formDataListSize % 2));
+    for (size_t i = 0; i < formDataListSize; i += 2) {
+        const FormDataList::Item& key = list[i];
+        const FormDataList::Item& value = list[i + 1];
+        if (isMultiPartForm) {
+            Vector<char> header;
+            formDataBuilder.beginMultiPartHeader(header, m_boundary.data(), key.data());
+
+            bool shouldGenerateFile = false;
+            // If the current type is FILE, then we also need to include the filename
+            if (value.blob()) {
+                const String& path = value.blob()->path();
+#if ENABLE(BLOB_SLICE)
+                String fileName;
+                if (value.blob()->isFile())
+                    fileName = static_cast<File*>(value.blob())->fileName();
+                else {
+                    // If a blob is sliced from a file, it does not have the filename. In this case, let's produce a unique filename.
+                    fileName = "Blob" + createCanonicalUUIDString();
+                    fileName.replace("-", ""); // For safty, remove '-' from the filename snce some servers may not like it.
+                }
+#else
+                ASSERT(value.blob()->isFile());
+                String fileName = static_cast<File*>(value.blob())->fileName();
+#endif
+
+                // Let the application specify a filename if it's going to generate a replacement file for the upload.
+                if (!path.isEmpty()) {
+                    if (Page* page = document->page()) {
+                        String generatedFileName;
+                        shouldGenerateFile = page->chrome()->client()->shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
+                        if (shouldGenerateFile)
+                            fileName = generatedFileName;
+                    }
+                }
+
+                // We have to include the filename=".." part in the header, even if the filename is empty
+                formDataBuilder.addFilenameToMultiPartHeader(header, encoding, fileName);
+
+                // If a blob is sliced from a file, do not add the content type. 
+#if ENABLE(BLOB_SLICE)
+                if (!fileName.isEmpty() && value.blob()->isFile()) {
+#else
+                if (!fileName.isEmpty()) {
+#endif
+                    // FIXME: The MIMETypeRegistry function's name makes it sound like it takes a path,
+                    // not just a basename. But filename is not the path. But note that it's not safe to
+                    // just use path instead since in the generated-file case it will not reflect the
+                    // MIME type of the generated file.
+                    String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName);
+                    if (!mimeType.isEmpty())
+                        formDataBuilder.addContentTypeToMultiPartHeader(header, mimeType.latin1());
+                }
+            }
+
+            formDataBuilder.finishMultiPartHeader(header);
+
+            // Append body
+            appendData(header.data(), header.size());
+            if (size_t dataSize = value.data().length())
+                appendData(value.data().data(), dataSize);
+            else if (value.blob() && !value.blob()->path().isEmpty())
+#if ENABLE(BLOB_SLICE)
+                appendFileRange(value.blob()->path(), value.blob()->start(), value.blob()->length(), value.blob()->modificationTime(), shouldGenerateFile);
+#else
+                appendFile(value.blob()->path(), shouldGenerateFile);
+#endif
+
+            appendData("\r\n", 2);
+        } else {
+            // Omit the name "isindex" if it's the first form data element.
+            // FIXME: Why is this a good rule? Is this obsolete now?
+            if (encodedData.isEmpty() && key.data() == "isindex")
+                FormDataBuilder::encodeStringAsFormData(encodedData, value.data());
+            else
+                formDataBuilder.addKeyValuePairAsFormData(encodedData, key.data(), value.data());
+        }
+    } 
+
+    if (isMultiPartForm)
+        formDataBuilder.addBoundaryToMultiPartHeader(encodedData, m_boundary.data(), true);
+
+    appendData(encodedData.data(), encodedData.size());
 }
 
 void FormData::flatten(Vector<char>& data) const
diff --git a/WebCore/platform/network/FormData.h b/WebCore/platform/network/FormData.h
index 7278f2e..f89dad7 100644
--- a/WebCore/platform/network/FormData.h
+++ b/WebCore/platform/network/FormData.h
@@ -27,16 +27,27 @@
 namespace WebCore {
 
 class ChromeClient;
+class DOMFormData;
+class Document;
 
 class FormDataElement {
 public:
     FormDataElement() : m_type(data) { }
     FormDataElement(const Vector<char>& array) : m_type(data), m_data(array) { }
+#if ENABLE(BLOB_SLICE)
+    FormDataElement(const String& filename, long long fileStart, long long fileLength, double expectedFileModificationTime, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLength), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenerateFile(shouldGenerateFile) { }
+#else
     FormDataElement(const String& filename, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_shouldGenerateFile(shouldGenerateFile) { }
+#endif
 
     enum { data, encodedFile } m_type;
     Vector<char> m_data;
     String m_filename;
+#if ENABLE(BLOB_SLICE)
+    long long m_fileStart;
+    long long m_fileLength;
+    double m_expectedFileModificationTime;
+#endif
     String m_generatedFilename;
     bool m_shouldGenerateFile;
 };
@@ -50,7 +61,11 @@
         return false;
     if (a.m_data != b.m_data)
         return false;
+#if ENABLE(BLOB_SLICE)
+    if (a.m_filename != b.m_filename || a.m_fileStart != b.m_fileStart || a.m_fileLength != b.m_fileLength || a.m_expectedFileModificationTime != b.m_expectedFileModificationTime)
+#else
     if (a.m_filename != b.m_filename)
+#endif
         return false;
 
     return true;
@@ -65,20 +80,26 @@
 public:
     static PassRefPtr<FormData> create();
     static PassRefPtr<FormData> create(const void*, size_t);
-    static PassRefPtr<FormData> create(const CString&);
+    static PassRefPtr<FormData> create(const WTF::CString&);
     static PassRefPtr<FormData> create(const Vector<char>&);
+    static PassRefPtr<FormData> create(const DOMFormData&);
+    static PassRefPtr<FormData> createMultiPart(const DOMFormData&, Document*);
     PassRefPtr<FormData> copy() const;
     PassRefPtr<FormData> deepCopy() const;
     ~FormData();
     
     void appendData(const void* data, size_t);
     void appendFile(const String& filename, bool shouldGenerateFile = false);
+#if ENABLE(BLOB_SLICE)
+    void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile = false);
+#endif
 
     void flatten(Vector<char>&) const; // omits files
     String flattenToString() const; // omits files
 
     bool isEmpty() const { return m_elements.isEmpty(); }
     const Vector<FormDataElement>& elements() const { return m_elements; }
+    const Vector<char>& boundary() const { return m_boundary; }
 
     void generateFiles(ChromeClient*);
     void removeGeneratedFilesIfNeeded();
@@ -95,10 +116,13 @@
     FormData();
     FormData(const FormData&);
 
+    void appendDOMFormData(const DOMFormData& domFormData, bool isMultiPartForm, Document* document);
+
     Vector<FormDataElement> m_elements;
     int64_t m_identifier;
     bool m_hasGeneratedFiles;
     bool m_alwaysStream;
+    Vector<char> m_boundary;
 };
 
 inline bool operator==(const FormData& a, const FormData& b)
diff --git a/WebCore/platform/network/FormDataBuilder.cpp b/WebCore/platform/network/FormDataBuilder.cpp
index 52f62f3..436dc8b 100644
--- a/WebCore/platform/network/FormDataBuilder.cpp
+++ b/WebCore/platform/network/FormDataBuilder.cpp
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "FormDataBuilder.h"
 
-#include "CString.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -33,6 +32,7 @@
 
 #include <limits>
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 #include <wtf/RandomNumber.h>
 
 namespace WebCore {
@@ -87,7 +87,7 @@
     }
 
     if (Frame* frame = document->frame())
-        return frame->loader()->encoding();
+        return frame->loader()->writer()->encoding();
 
     return Latin1Encoding();
 }
diff --git a/WebCore/platform/network/FormDataBuilder.h b/WebCore/platform/network/FormDataBuilder.h
index 286f59f..390a87b 100644
--- a/WebCore/platform/network/FormDataBuilder.h
+++ b/WebCore/platform/network/FormDataBuilder.h
@@ -24,9 +24,13 @@
 #include "PlatformString.h"
 #include <wtf/Noncopyable.h>
 
+namespace WTF {
+class CString;
+}
+using WTF::CString;
+
 namespace WebCore {
 
-class CString;
 class Document;
 class TextEncoding;
 
@@ -54,15 +58,15 @@
 
     // Helper functions used by HTMLFormElement/WMLGoElement for multi-part form data
     static Vector<char> generateUniqueBoundaryString();
-    static void beginMultiPartHeader(Vector<char>&, const CString& boundary, const CString& name);
-    static void addBoundaryToMultiPartHeader(Vector<char>&, const CString& boundary, bool isLastBoundary = false);
+    static void beginMultiPartHeader(Vector<char>&, const WTF::CString& boundary, const WTF::CString& name);
+    static void addBoundaryToMultiPartHeader(Vector<char>&, const WTF::CString& boundary, bool isLastBoundary = false);
     static void addFilenameToMultiPartHeader(Vector<char>&, const TextEncoding&, const String& filename);
-    static void addContentTypeToMultiPartHeader(Vector<char>&, const CString& mimeType);
+    static void addContentTypeToMultiPartHeader(Vector<char>&, const WTF::CString& mimeType);
     static void finishMultiPartHeader(Vector<char>&);
 
     // Helper functions used by HTMLFormElement/WMLGoElement for non multi-part form data
-    static void addKeyValuePairAsFormData(Vector<char>&, const CString& key, const CString& value);
-    static void encodeStringAsFormData(Vector<char>&, const CString&);
+    static void addKeyValuePairAsFormData(Vector<char>&, const WTF::CString& key, const WTF::CString& value);
+    static void encodeStringAsFormData(Vector<char>&, const WTF::CString&);
 
 private:
     bool m_isPostMethod;
diff --git a/WebCore/platform/network/HTTPHeaderMap.cpp b/WebCore/platform/network/HTTPHeaderMap.cpp
index 413fb7b..e304ffa 100644
--- a/WebCore/platform/network/HTTPHeaderMap.cpp
+++ b/WebCore/platform/network/HTTPHeaderMap.cpp
@@ -31,26 +31,25 @@
 #include "config.h"
 #include "HTTPHeaderMap.h"
 
-#include <memory>
 #include <utility>
 
 using namespace std;
 
 namespace WebCore {
 
-auto_ptr<CrossThreadHTTPHeaderMapData> HTTPHeaderMap::copyData() const
+PassOwnPtr<CrossThreadHTTPHeaderMapData> HTTPHeaderMap::copyData() const
 {
-    auto_ptr<CrossThreadHTTPHeaderMapData> data(new CrossThreadHTTPHeaderMapData());
+    OwnPtr<CrossThreadHTTPHeaderMapData> data(new CrossThreadHTTPHeaderMapData());
     data->reserveInitialCapacity(size());
 
     HTTPHeaderMap::const_iterator end_it = end();
     for (HTTPHeaderMap::const_iterator it = begin(); it != end_it; ++it) {
         data->append(make_pair(it->first.string().crossThreadString(), it->second.crossThreadString()));
     }
-    return data;
+    return data.release();
 }
 
-void HTTPHeaderMap::adopt(auto_ptr<CrossThreadHTTPHeaderMapData> data)
+void HTTPHeaderMap::adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData> data)
 {
     clear();
     size_t dataSize = data->size();
diff --git a/WebCore/platform/network/HTTPHeaderMap.h b/WebCore/platform/network/HTTPHeaderMap.h
index dfde974..557ddb3 100644
--- a/WebCore/platform/network/HTTPHeaderMap.h
+++ b/WebCore/platform/network/HTTPHeaderMap.h
@@ -30,9 +30,9 @@
 #include "AtomicString.h"
 #include "AtomicStringHash.h"
 #include "StringHash.h"
-#include <memory>
 #include <utility>
 #include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -42,9 +42,9 @@
     class HTTPHeaderMap : public HashMap<AtomicString, String, CaseFoldingHash> {
     public:
         // Gets a copy of the data suitable for passing to another thread.
-        std::auto_ptr<CrossThreadHTTPHeaderMapData> copyData() const;
+        PassOwnPtr<CrossThreadHTTPHeaderMapData> copyData() const;
 
-        void adopt(std::auto_ptr<CrossThreadHTTPHeaderMapData>);
+        void adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData>);
         
         String get(const AtomicString& name) const
         {
diff --git a/WebCore/platform/network/HTTPParsers.cpp b/WebCore/platform/network/HTTPParsers.cpp
index 9202660..6252bfc 100644
--- a/WebCore/platform/network/HTTPParsers.cpp
+++ b/WebCore/platform/network/HTTPParsers.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
+ * Copyright (C) 2009 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,9 +31,10 @@
 
 #include "config.h"
 #include "HTTPParsers.h"
+#include "ResourceResponseBase.h"
 
-#include "CString.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 #include <wtf/DateMath.h>
 
 using namespace WTF;
@@ -55,6 +57,51 @@
     return pos != len;
 }
 
+// Returns true if the function can match the whole token (case insensitive).
+// Note: Might return pos == str.length()
+static inline bool skipToken(const String& str, int& pos, const char* token)
+{
+    int len = str.length();
+
+    while (pos != len && *token) {
+        if (toASCIILower(str[pos]) != *token++)
+            return false;
+        ++pos;
+    }
+
+    return true;
+}
+
+ContentDispositionType contentDispositionType(const String& contentDisposition)
+{   
+    if (contentDisposition.isEmpty())
+        return ContentDispositionNone;
+
+    // Some broken sites just send
+    // Content-Disposition: ; filename="file"
+    // screen those out here.
+    if (contentDisposition.startsWith(";"))
+        return ContentDispositionNone;
+
+    if (contentDisposition.startsWith("inline", false))
+        return ContentDispositionInline;
+
+    // Some broken sites just send
+    // Content-Disposition: filename="file"
+    // without a disposition token... screen those out.
+    if (contentDisposition.startsWith("filename", false))
+        return ContentDispositionNone;
+
+    // Also in use is Content-Disposition: name="file"
+    if (contentDisposition.startsWith("name", false))
+        return ContentDispositionNone;
+
+    // We have a content-disposition of "attachment" or unknown.
+    // RFC 2183, section 2.8 says that an unknown disposition
+    // value should be treated as "attachment"
+    return ContentDispositionAttachment;  
+}
+
 bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url)
 {
     int len = refresh.length();
@@ -184,13 +231,25 @@
 
 String extractCharsetFromMediaType(const String& mediaType)
 {
-    int pos = 0;
+    unsigned int pos, len;
+    findCharsetInMediaType(mediaType, pos, len);
+    return mediaType.substring(pos, len);
+}
+
+void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, unsigned int& charsetLen, unsigned int start)
+{
+    charsetPos = start;
+    charsetLen = 0;
+
+    int pos = start;
     int length = (int)mediaType.length();
     
     while (pos < length) {
         pos = mediaType.find("charset", pos, false);
-        if (pos <= 0)
-            return String();
+        if (pos <= 0) {
+            charsetLen = 0;
+            return;
+        }
         
         // is what we found a beginning of a word?
         if (mediaType[pos-1] > ' ' && mediaType[pos-1] != ';') {
@@ -214,10 +273,46 @@
         int endpos = pos;
         while (pos != length && mediaType[endpos] > ' ' && mediaType[endpos] != '"' && mediaType[endpos] != '\'' && mediaType[endpos] != ';')
             ++endpos;
-    
-        return mediaType.substring(pos, endpos-pos);
+
+        charsetPos = pos;
+        charsetLen = endpos - pos;
+        return;
     }
-    
-    return String();
 }
+
+XSSProtectionDisposition parseXSSProtectionHeader(const String& header)
+{
+    String stippedHeader = header.stripWhiteSpace();
+
+    if (stippedHeader.isEmpty())
+        return XSSProtectionEnabled;
+
+    if (stippedHeader[0] == '0')
+        return XSSProtectionDisabled;
+
+    int length = (int)header.length();
+    int pos = 0;
+    if (stippedHeader[pos++] == '1'
+        && skipWhiteSpace(stippedHeader, pos, false)
+        && stippedHeader[pos++] == ';'
+        && skipWhiteSpace(stippedHeader, pos, false)
+        && skipToken(stippedHeader, pos, "mode")
+        && skipWhiteSpace(stippedHeader, pos, false)
+        && stippedHeader[pos++] == '='
+        && skipWhiteSpace(stippedHeader, pos, false)
+        && skipToken(stippedHeader, pos, "block")
+        && pos == length)
+        return XSSProtectionBlockEnabled;
+
+    return XSSProtectionEnabled;
+}
+
+String extractReasonPhraseFromHTTPStatusLine(const String& statusLine)
+{
+    int spacePos = statusLine.find(' ');
+    // Remove status code from the status line.
+    spacePos = statusLine.find(' ', spacePos + 1);
+    return statusLine.substring(spacePos + 1);
+}
+
 }
diff --git a/WebCore/platform/network/HTTPParsers.h b/WebCore/platform/network/HTTPParsers.h
index 0648aee..bb2a9e5 100644
--- a/WebCore/platform/network/HTTPParsers.h
+++ b/WebCore/platform/network/HTTPParsers.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2009 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,13 +32,32 @@
 
 namespace WebCore {
 
-    class String;
+class String;
+class ResourceResponseBase;
 
-    bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url);
-    double parseDate(const String&);
-    String filenameFromHTTPContentDisposition(const String&); 
-    String extractMIMETypeFromMediaType(const String&);
-    String extractCharsetFromMediaType(const String&); 
+enum XSSProtectionDisposition {
+    XSSProtectionDisabled,
+    XSSProtectionEnabled,
+    XSSProtectionBlockEnabled
+};
+
+typedef enum {
+    ContentDispositionNone,
+    ContentDispositionInline,
+    ContentDispositionAttachment,
+    ContentDispositionOther
+} ContentDispositionType;
+
+ContentDispositionType contentDispositionType(const String&);
+bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url);
+double parseDate(const String&);
+String filenameFromHTTPContentDisposition(const String&); 
+String extractMIMETypeFromMediaType(const String&);
+String extractCharsetFromMediaType(const String&); 
+void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, unsigned int& charsetLen, unsigned int start = 0);
+XSSProtectionDisposition parseXSSProtectionHeader(const String&);
+String extractReasonPhraseFromHTTPStatusLine(const String&);
+
 }
 
 #endif
diff --git a/WebCore/platform/network/ProtectionSpace.h b/WebCore/platform/network/ProtectionSpace.h
index 126b499..42cbc8a 100644
--- a/WebCore/platform/network/ProtectionSpace.h
+++ b/WebCore/platform/network/ProtectionSpace.h
@@ -47,6 +47,7 @@
   ProtectionSpaceAuthenticationSchemeHTMLForm = 4,
   ProtectionSpaceAuthenticationSchemeNTLM = 5,
   ProtectionSpaceAuthenticationSchemeNegotiate = 6,
+  ProtectionSpaceAuthenticationSchemeUnknown = 100,
 };
 
 class ProtectionSpace {
diff --git a/WebCore/platform/network/ResourceHandle.cpp b/WebCore/platform/network/ResourceHandle.cpp
index 7c20561..7f61d2d 100644
--- a/WebCore/platform/network/ResourceHandle.cpp
+++ b/WebCore/platform/network/ResourceHandle.cpp
@@ -27,6 +27,7 @@
 #include "ResourceHandle.h"
 #include "ResourceHandleInternal.h"
 
+#include "DNS.h"
 #include "Logging.h"
 #include "ResourceHandleClient.h"
 #include "Timer.h"
@@ -37,18 +38,18 @@
 static bool shouldForceContentSniffing;
 
 ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading,
-         bool shouldContentSniff, bool mightDownloadFromHandle)
-    : d(new ResourceHandleInternal(this, request, client, defersLoading, shouldContentSniff, mightDownloadFromHandle))
+         bool shouldContentSniff)
+    : d(new ResourceHandleInternal(this, request, client, defersLoading, shouldContentSniff))
 {
 }
 
 PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, ResourceHandleClient* client,
-    Frame* frame, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle)
+    Frame* frame, bool defersLoading, bool shouldContentSniff)
 {
     if (shouldContentSniff)
         shouldContentSniff = shouldContentSniffURL(request.url());
 
-    RefPtr<ResourceHandle> newHandle(adoptRef(new ResourceHandle(request, client, defersLoading, shouldContentSniff, mightDownloadFromHandle)));
+    RefPtr<ResourceHandle> newHandle(adoptRef(new ResourceHandle(request, client, defersLoading, shouldContentSniff)));
 
     if (!request.url().isValid()) {
         newHandle->scheduleFailure(InvalidURLFailure);
@@ -104,6 +105,11 @@
     return d->m_request;
 }
 
+const String& ResourceHandle::lastHTTPMethod() const
+{
+    return d->m_lastHTTPMethod;
+}
+
 void ResourceHandle::clearAuthentication()
 {
 #if PLATFORM(MAC)
@@ -132,4 +138,11 @@
     shouldForceContentSniffing = true;
 }
 
+#if !USE(SOUP)
+void ResourceHandle::prepareForURL(const KURL& url)
+{
+    return prefetchDNS(url.host());
+}
+#endif
+
 } // namespace WebCore
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index e340aca..24decd5 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -98,7 +98,7 @@
 #endif
     {
 private:
-    ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle);
+    ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff);
 
     enum FailureType {
         BlockedFailure,
@@ -107,9 +107,10 @@
 
 public:
     // FIXME: should not need the Frame
-    static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle = false);
+    static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool defersLoading, bool shouldContentSniff);
 
     static void loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data, Frame* frame);
+    static void prepareForURL(const KURL&);
     static bool willLoadFromCache(ResourceRequest&, Frame*);
 #if PLATFORM(MAC)
     static bool didSendBodyDataDelegateExists();
@@ -195,6 +196,7 @@
 #endif
 
     const ResourceRequest& request() const;
+    const String& lastHTTPMethod() const;
 
     void fireFailure(Timer<ResourceHandle>*);
 
diff --git a/WebCore/platform/network/ResourceHandleClient.h b/WebCore/platform/network/ResourceHandleClient.h
index b5efaed..0fe77a1 100644
--- a/WebCore/platform/network/ResourceHandleClient.h
+++ b/WebCore/platform/network/ResourceHandleClient.h
@@ -27,7 +27,6 @@
 #define ResourceHandleClient_h
 
 #include <wtf/RefCounted.h>
-#include <wtf/Platform.h>
 #include <wtf/RefPtr.h>
 
 #if USE(CFNETWORK)
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index 328fc89..f20f055 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -81,13 +81,13 @@
 
     class ResourceHandleInternal : public Noncopyable {
     public:
-        ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle)
+        ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool defersLoading, bool shouldContentSniff)
             : m_client(c)
             , m_request(request)
+            , m_lastHTTPMethod(request.httpMethod())
             , status(0)
             , m_defersLoading(defersLoading)
             , m_shouldContentSniff(shouldContentSniff)
-            , m_mightDownloadFromHandle(mightDownloadFromHandle)
 #if USE(CFNETWORK)
             , m_connection(0)
 #endif
@@ -147,6 +147,7 @@
         ResourceHandleClient* m_client;
         
         ResourceRequest m_request;
+        String m_lastHTTPMethod;
 
         // Suggested credentials for the current redirection step.
         String m_user;
@@ -158,7 +159,6 @@
 
         bool m_defersLoading;
         bool m_shouldContentSniff;
-        bool m_mightDownloadFromHandle;
 #if USE(CFNETWORK)
         RetainPtr<CFURLConnectionRef> m_connection;
 #elif PLATFORM(MAC)
diff --git a/WebCore/platform/network/ResourceRequestBase.cpp b/WebCore/platform/network/ResourceRequestBase.cpp
index 0a68972..42c1c6e 100644
--- a/WebCore/platform/network/ResourceRequestBase.cpp
+++ b/WebCore/platform/network/ResourceRequestBase.cpp
@@ -24,6 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 #include "config.h"
+
 #include "ResourceRequestBase.h"
 #include "ResourceRequest.h"
 
@@ -36,9 +37,9 @@
     return *static_cast<const ResourceRequest*>(this);
 }
 
-auto_ptr<ResourceRequest> ResourceRequestBase::adopt(auto_ptr<CrossThreadResourceRequestData> data)
+PassOwnPtr<ResourceRequest> ResourceRequestBase::adopt(PassOwnPtr<CrossThreadResourceRequestData> data)
 {
-    auto_ptr<ResourceRequest> request(new ResourceRequest());
+    OwnPtr<ResourceRequest> request(new ResourceRequest());
     request->setURL(data->m_url);
     request->setCachePolicy(data->m_cachePolicy);
     request->setTimeoutInterval(data->m_timeoutInterval);
@@ -46,7 +47,7 @@
     request->setHTTPMethod(data->m_httpMethod);
 
     request->updateResourceRequest();
-    request->m_httpHeaderFields.adopt(auto_ptr<CrossThreadHTTPHeaderMapData>(data->m_httpHeaders.release()));
+    request->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
 
     size_t encodingCount = data->m_responseContentDispositionEncodingFallbackArray.size();
     if (encodingCount > 0) {
@@ -63,18 +64,18 @@
     }
     request->setHTTPBody(data->m_httpBody);
     request->setAllowCookies(data->m_allowCookies);
-    return request;
+    return request.release();
 }
 
-auto_ptr<CrossThreadResourceRequestData> ResourceRequestBase::copyData() const
+PassOwnPtr<CrossThreadResourceRequestData> ResourceRequestBase::copyData() const
 {
-    auto_ptr<CrossThreadResourceRequestData> data(new CrossThreadResourceRequestData());
+    OwnPtr<CrossThreadResourceRequestData> data(new CrossThreadResourceRequestData());
     data->m_url = url().copy();
     data->m_cachePolicy = cachePolicy();
     data->m_timeoutInterval = timeoutInterval();
     data->m_firstPartyForCookies = firstPartyForCookies().copy();
     data->m_httpMethod = httpMethod().crossThreadString();
-    data->m_httpHeaders.adopt(httpHeaderFields().copyData());
+    data->m_httpHeaders = httpHeaderFields().copyData();
 
     data->m_responseContentDispositionEncodingFallbackArray.reserveInitialCapacity(m_responseContentDispositionEncodingFallbackArray.size());
     size_t encodingArraySize = m_responseContentDispositionEncodingFallbackArray.size();
@@ -84,7 +85,7 @@
     if (m_httpBody)
         data->m_httpBody = m_httpBody->deepCopy();
     data->m_allowCookies = m_allowCookies;
-    return data;
+    return data.release();
 }
 
 bool ResourceRequestBase::isEmpty() const
diff --git a/WebCore/platform/network/ResourceRequestBase.h b/WebCore/platform/network/ResourceRequestBase.h
index adf8327..2ca5d7d 100644
--- a/WebCore/platform/network/ResourceRequestBase.h
+++ b/WebCore/platform/network/ResourceRequestBase.h
@@ -32,7 +32,6 @@
 #include "KURL.h"
 #include "HTTPHeaderMap.h"
 
-#include <memory>
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
@@ -65,10 +64,10 @@
             TargetIsMedia
         };
 
-        static std::auto_ptr<ResourceRequest> adopt(std::auto_ptr<CrossThreadResourceRequestData>);
+        static PassOwnPtr<ResourceRequest> adopt(PassOwnPtr<CrossThreadResourceRequestData>);
 
         // Gets a copy of the data suitable for passing to another thread.
-        std::auto_ptr<CrossThreadResourceRequestData> copyData() const;
+        PassOwnPtr<CrossThreadResourceRequestData> copyData() const;
 
         bool isNull() const;
         bool isEmpty() const;
diff --git a/WebCore/platform/network/ResourceResponseBase.cpp b/WebCore/platform/network/ResourceResponseBase.cpp
index f9cd271..3192a18 100644
--- a/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/WebCore/platform/network/ResourceResponseBase.cpp
@@ -85,9 +85,9 @@
 {
 }
 
-auto_ptr<ResourceResponse> ResourceResponseBase::adopt(auto_ptr<CrossThreadResourceResponseData> data)
+PassOwnPtr<ResourceResponse> ResourceResponseBase::adopt(PassOwnPtr<CrossThreadResourceResponseData> data)
 {
-    auto_ptr<ResourceResponse> response(new ResourceResponse());
+    OwnPtr<ResourceResponse> response(new ResourceResponse());
     response->setURL(data->m_url);
     response->setMimeType(data->m_mimeType);
     response->setExpectedContentLength(data->m_expectedContentLength);
@@ -98,15 +98,15 @@
     response->setHTTPStatusText(data->m_httpStatusText);
 
     response->lazyInit();
-    response->m_httpHeaderFields.adopt(std::auto_ptr<CrossThreadHTTPHeaderMapData>(data->m_httpHeaders.release()));
+    response->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
     response->setLastModifiedDate(data->m_lastModifiedDate);
 
-    return response;
+    return response.release();
 }
 
-auto_ptr<CrossThreadResourceResponseData> ResourceResponseBase::copyData() const
+PassOwnPtr<CrossThreadResourceResponseData> ResourceResponseBase::copyData() const
 {
-    auto_ptr<CrossThreadResourceResponseData> data(new CrossThreadResourceResponseData());
+    OwnPtr<CrossThreadResourceResponseData> data(new CrossThreadResourceResponseData());
     data->m_url = url().copy();
     data->m_mimeType = mimeType().crossThreadString();
     data->m_expectedContentLength = expectedContentLength();
@@ -114,9 +114,9 @@
     data->m_suggestedFilename = suggestedFilename().crossThreadString();
     data->m_httpStatusCode = httpStatusCode();
     data->m_httpStatusText = httpStatusText().crossThreadString();
-    data->m_httpHeaders.adopt(httpHeaderFields().copyData());
+    data->m_httpHeaders = httpHeaderFields().copyData();
     data->m_lastModifiedDate = lastModifiedDate();
-    return data;
+    return data.release();
 }
 
 bool ResourceResponseBase::isHTTP() const
diff --git a/WebCore/platform/network/ResourceResponseBase.h b/WebCore/platform/network/ResourceResponseBase.h
index bf197a7..74e23a4 100644
--- a/WebCore/platform/network/ResourceResponseBase.h
+++ b/WebCore/platform/network/ResourceResponseBase.h
@@ -30,7 +30,7 @@
 #include "HTTPHeaderMap.h"
 #include "KURL.h"
 
-#include <memory>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -40,10 +40,10 @@
 // Do not use this class directly, use the class ResponseResponse instead
 class ResourceResponseBase : public FastAllocBase {
 public:
-    static std::auto_ptr<ResourceResponse> adopt(std::auto_ptr<CrossThreadResourceResponseData>);
+    static PassOwnPtr<ResourceResponse> adopt(PassOwnPtr<CrossThreadResourceResponseData>);
 
     // Gets a copy of the data suitable for passing to another thread.
-    std::auto_ptr<CrossThreadResourceResponseData> copyData() const;
+    PassOwnPtr<CrossThreadResourceResponseData> copyData() const;
 
     bool isNull() const { return m_isNull; }
     bool isHTTP() const;
diff --git a/WebCore/platform/network/android/ResourceHandleAndroid.cpp b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
index aadf43b..91e8f8e 100644
--- a/WebCore/platform/network/android/ResourceHandleAndroid.cpp
+++ b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
@@ -27,7 +27,6 @@
 
 #include "ResourceHandle.h"
 
-#include "CString.h"
 #include "DocLoader.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
@@ -37,6 +36,7 @@
 #include "ResourceHandleClient.h"
 #include "ResourceHandleInternal.h"
 #include "ResourceLoaderAndroid.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/network/cf/AuthenticationCF.cpp b/WebCore/platform/network/cf/AuthenticationCF.cpp
index 93b62a8..170d419 100644
--- a/WebCore/platform/network/cf/AuthenticationCF.cpp
+++ b/WebCore/platform/network/cf/AuthenticationCF.cpp
@@ -253,6 +253,7 @@
         scheme = ProtectionSpaceAuthenticationSchemeNegotiate;
         break;
     default:
+        scheme = ProtectionSpaceAuthenticationSchemeUnknown;
         ASSERT_NOT_REACHED();
     }
         
diff --git a/WebCore/platform/network/cf/FormDataStreamCFNet.cpp b/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
index 3414d90..bba717d 100644
--- a/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
+++ b/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "FormDataStreamCFNet.h"
 
-#include "CString.h"
 #include "FileSystem.h"
 #include "FormData.h"
 #include <CFNetwork/CFURLRequestPriv.h>
@@ -41,6 +40,7 @@
 #include <wtf/Assertions.h>
 #include <wtf/HashMap.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
 
 #define USE_V1_CFSTREAM_CALLBACKS
 #ifdef USE_V1_CFSTREAM_CALLBACKS
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 8cc5022..e5eeef0 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -32,7 +32,6 @@
 #include "AuthenticationCF.h"
 #include "AuthenticationChallenge.h"
 #include "Base64.h"
-#include "CString.h"
 #include "CookieStorageWin.h"
 #include "CredentialStorage.h"
 #include "DocLoader.h"
@@ -44,16 +43,24 @@
 #include "MIMETypeRegistry.h"
 #include "ResourceError.h"
 #include "ResourceResponse.h"
-
-#include <wtf/HashMap.h>
-#include <wtf/Threading.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <process.h> // for _beginthread()
-
+#include "SharedBuffer.h"
 #include <CFNetwork/CFNetwork.h>
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
+#include <process.h> // for _beginthread()
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <wtf/HashMap.h>
+#include <wtf/Threading.h>
+#include <wtf/text/CString.h>
+
+// FIXME: Remove this declaration once it's in WebKitSupportLibrary.
+extern "C" {
+__declspec(dllimport) CFURLConnectionRef CFURLConnectionCreateWithProperties(
+  CFAllocatorRef           alloc,
+  CFURLRequestRef          request,
+  CFURLConnectionClient *  client,
+  CFDictionaryRef properties);
+}
 
 namespace WebCore {
 
@@ -136,11 +143,11 @@
     if (cfRedirectResponse) {
         CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(cfRedirectResponse);
         if (httpMessage && CFHTTPMessageGetResponseStatusCode(httpMessage) == 307) {
-            RetainPtr<CFStringRef> originalMethod(AdoptCF, handle->request().httpMethod().createCFString());
+            RetainPtr<CFStringRef> lastHTTPMethod(AdoptCF, handle->lastHTTPMethod().createCFString());
             RetainPtr<CFStringRef> newMethod(AdoptCF, CFURLRequestCopyHTTPRequestMethod(cfRequest));
-            if (CFStringCompareWithOptions(originalMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(originalMethod.get())), kCFCompareCaseInsensitive)) {
+            if (CFStringCompareWithOptions(lastHTTPMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(lastHTTPMethod.get())), kCFCompareCaseInsensitive)) {
                 RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(0, cfRequest));
-                CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), originalMethod.get());
+                CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get());
 
                 FormData* body = handle->request().httpBody();
                 if (!equalIgnoringCase(handle->request().httpMethod(), "GET") && body && !body->isEmpty())
@@ -352,12 +359,37 @@
 
     if (CFHTTPCookieStorageRef cookieStorage = currentCookieStorage()) {
         CFURLRequestSetHTTPCookieStorage(newRequest, cookieStorage);
-        CFURLRequestSetHTTPCookieStorageAcceptPolicy(newRequest, CFHTTPCookieStorageGetCookieAcceptPolicy(cookieStorage));
+        CFHTTPCookieStorageAcceptPolicy policy = CFHTTPCookieStorageGetCookieAcceptPolicy(cookieStorage);
+        CFURLRequestSetHTTPCookieStorageAcceptPolicy(newRequest, policy);
+
+        // If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
+        if (policy == CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain) {
+            CFURLRef url = CFURLRequestGetURL(newRequest);
+            RetainPtr<CFArrayRef> cookies(AdoptCF, CFHTTPCookieStorageCopyCookiesForURL(cookieStorage, url, false));
+            if (CFArrayGetCount(cookies.get()))
+                CFURLRequestSetMainDocumentURL(newRequest, url);
+        }
     }
 
     return newRequest;
 }
 
+static CFDictionaryRef createConnectionProperties(bool shouldUseCredentialStorage)
+{
+    static const CFStringRef webKitPrivateSessionCF = CFSTR("WebKitPrivateSession");
+    static const CFStringRef _kCFURLConnectionSessionID = CFSTR("_kCFURLConnectionSessionID");
+    static const CFStringRef kCFURLConnectionSocketStreamProperties = CFSTR("kCFURLConnectionSocketStreamProperties");
+
+    CFDictionaryRef sessionID = shouldUseCredentialStorage ?
+        CFDictionaryCreate(0, 0, 0, 0, 0, 0) :
+        CFDictionaryCreate(0, (const void**)&_kCFURLConnectionSessionID, (const void**)&webKitPrivateSessionCF, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+
+    CFDictionaryRef propertiesDictionary = CFDictionaryCreate(0, (const void**)&kCFURLConnectionSocketStreamProperties, (const void**)&sessionID, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+
+    CFRelease(sessionID);
+    return propertiesDictionary;
+}
+
 bool ResourceHandle::start(Frame* frame)
 {
     // If we are no longer attached to a Page, this must be an attempted load from an
@@ -373,9 +405,11 @@
         d->m_request.setURL(urlWithCredentials);
     }
 
+    bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
+
     // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, 
     // try and reuse the credential preemptively, as allowed by RFC 2617.
-    if (!client() || client()->shouldUseCredentialStorage(this) && d->m_request.url().protocolInHTTPFamily()) {
+    if (shouldUseCredentialStorage && d->m_request.url().protocolInHTTPFamily()) {
         if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
             // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, 
             // try and reuse the credential preemptively, as allowed by RFC 2617.
@@ -397,7 +431,9 @@
 
     CFURLConnectionClient_V3 client = { 3, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, NULL, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0};
 
-    d->m_connection.adoptCF(CFURLConnectionCreate(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client)));
+    RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(shouldUseCredentialStorage));
+
+    d->m_connection.adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));
 
     CFURLConnectionScheduleWithCurrentMessageQueue(d->m_connection.get());
     CFURLConnectionScheduleDownloadWithRunLoop(d->m_connection.get(), loaderRunLoop(), kCFRunLoopDefaultMode);
@@ -432,6 +468,7 @@
     const KURL& url = request.url();
     d->m_user = url.user();
     d->m_pass = url.pass();
+    d->m_lastHTTPMethod = request.httpMethod();
     request.removeCredentials();
 
     client()->willSendRequest(this, request, redirectResponse);
@@ -763,7 +800,10 @@
     }
 
     CFURLConnectionClient_V3 client = { 3, &loader, 0, 0, 0, willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, 0, didReceiveChallenge, 0, shouldUseCredentialStorage, 0 };
-    RetainPtr<CFURLConnectionRef> connection(AdoptCF, CFURLConnectionCreate(kCFAllocatorDefault, cfRequest.get(), reinterpret_cast<CFURLConnectionClient*>(&client)));
+
+    RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(loader.m_allowStoredCredentials));
+
+    RetainPtr<CFURLConnectionRef> connection(AdoptCF, CFURLConnectionCreateWithProperties(kCFAllocatorDefault, cfRequest.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));
 
     CFURLConnectionScheduleWithRunLoop(connection.get(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
     CFURLConnectionScheduleDownloadWithRunLoop(connection.get(), CFRunLoopGetCurrent(), WebCoreSynchronousLoaderRunLoopMode);
diff --git a/WebCore/platform/network/cf/ResourceResponseCFNet.cpp b/WebCore/platform/network/cf/ResourceResponseCFNet.cpp
index 95e9aff..469e5ad 100644
--- a/WebCore/platform/network/cf/ResourceResponseCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceResponseCFNet.cpp
@@ -89,13 +89,7 @@
         m_httpStatusCode = CFHTTPMessageGetResponseStatusCode(httpResponse);
 
         RetainPtr<CFStringRef> statusLine(AdoptCF, CFHTTPMessageCopyResponseStatusLine(httpResponse));
-        String statusText(statusLine.get());
-        int spacePos = statusText.find(' ');
-        // Remove the status code from the status text.
-        spacePos = statusText.find(' ', spacePos + 1);
-        statusText = statusText.substring(spacePos + 1);      
-
-        m_httpStatusText = statusText;
+        m_httpStatusText = extractReasonPhraseFromHTTPStatusLine(statusLine.get());
 
         RetainPtr<CFDictionaryRef> headers(AdoptCF, CFHTTPMessageCopyAllHeaderFields(httpResponse));
         CFIndex headerCount = CFDictionaryGetCount(headers.get());
diff --git a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
index e7e64da..c66de33 100644
--- a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
@@ -377,7 +377,7 @@
         return ProtectionSpaceAuthenticationSchemeNegotiate;
 #endif
     ASSERT_NOT_REACHED();
-    return ProtectionSpaceAuthenticationSchemeDefault;
+    return ProtectionSpaceAuthenticationSchemeUnknown;
 }
 
 void SocketStreamHandle::addCONNECTCredentials(CFHTTPMessageRef proxyResponse)
diff --git a/WebCore/platform/network/chromium/DNSChromium.cpp b/WebCore/platform/network/chromium/DNSChromium.cpp
index 4da29e1..21fcd46 100644
--- a/WebCore/platform/network/chromium/DNSChromium.cpp
+++ b/WebCore/platform/network/chromium/DNSChromium.cpp
@@ -27,6 +27,7 @@
 #include "DNS.h"
 
 #include "ChromiumBridge.h"
+#include "ResourceHandle.h"
 
 namespace WebCore {
 
@@ -35,4 +36,9 @@
     ChromiumBridge::prefetchDNS(hostname);
 }
 
+void ResourceHandle::prepareForURL(const KURL& url)
+{
+    return prefetchDNS(url.host());
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/network/chromium/ResourceResponse.h b/WebCore/platform/network/chromium/ResourceResponse.h
index 1b9de04..b453896 100644
--- a/WebCore/platform/network/chromium/ResourceResponse.h
+++ b/WebCore/platform/network/chromium/ResourceResponse.h
@@ -27,9 +27,9 @@
 #ifndef ResourceResponse_h
 #define ResourceResponse_h
 
-#include "CString.h"
 #include "NotImplemented.h"
 #include "ResourceResponseBase.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -39,6 +39,7 @@
             : m_isContentFiltered(false)
             , m_appCacheID(0)
             , m_wasFetchedViaSPDY(false)
+            , m_isMultipartPayload(false)
         {
         }
 
@@ -47,6 +48,7 @@
             , m_isContentFiltered(false)
             , m_appCacheID(0)
             , m_wasFetchedViaSPDY(false)
+            , m_isMultipartPayload(false)
         {
         }
 
@@ -80,6 +82,12 @@
             m_wasFetchedViaSPDY = value;
         }
 
+        bool isMultipartPayload() const { return m_isMultipartPayload; }
+        void setIsMultipartPayload(bool value)
+        {
+            m_isMultipartPayload = value;
+        }
+
     private:
         friend class ResourceResponseBase;
 
@@ -106,6 +114,9 @@
         KURL m_appCacheManifestURL;
 
         bool m_wasFetchedViaSPDY;
+
+        // Set to true if this is part of a multipart response.
+        bool m_isMultipartPayload;
     };
 
 } // namespace WebCore
diff --git a/WebCore/platform/network/curl/FormDataStreamCurl.cpp b/WebCore/platform/network/curl/FormDataStreamCurl.cpp
index 639a741..0f94d63 100644
--- a/WebCore/platform/network/curl/FormDataStreamCurl.cpp
+++ b/WebCore/platform/network/curl/FormDataStreamCurl.cpp
@@ -31,9 +31,9 @@
 #include "config.h"
 #include "FormDataStreamCurl.h"
 
-#include "CString.h"
 #include "FormData.h"
 #include "ResourceRequest.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/network/curl/ResourceHandleCurl.cpp b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
index 4212562..05134a5 100644
--- a/WebCore/platform/network/curl/ResourceHandleCurl.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
@@ -32,8 +32,10 @@
 #include "NotImplemented.h"
 #include "ResourceHandleInternal.h"
 #include "ResourceHandleManager.h"
+#include "SharedBuffer.h"
 
 #if PLATFORM(WIN) && PLATFORM(CF)
+#include <wtf/PassRefPtr.h>
 #include <wtf/RetainPtr.h>
 #endif
 
@@ -198,7 +200,7 @@
 void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame*)
 {
     WebCoreSynchronousLoader syncLoader;
-    ResourceHandle handle(request, &syncLoader, true, false, true);
+    ResourceHandle handle(request, &syncLoader, true, false);
 
     ResourceHandleManager* manager = ResourceHandleManager::sharedInstance();
 
diff --git a/WebCore/platform/network/curl/ResourceHandleManager.cpp b/WebCore/platform/network/curl/ResourceHandleManager.cpp
index 962754c..92654f4 100644
--- a/WebCore/platform/network/curl/ResourceHandleManager.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleManager.cpp
@@ -35,7 +35,6 @@
 #include "ResourceHandleManager.h"
 
 #include "Base64.h"
-#include "CString.h"
 #include "HTTPParsers.h"
 #include "MIMETypeRegistry.h"
 #include "NotImplemented.h"
@@ -46,8 +45,10 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <wtf/RetainPtr.h>
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 #if !OS(WINDOWS)
 #include <sys/param.h>
diff --git a/WebCore/platform/network/curl/ResourceHandleManager.h b/WebCore/platform/network/curl/ResourceHandleManager.h
index 4d73d87..ff54e73 100644
--- a/WebCore/platform/network/curl/ResourceHandleManager.h
+++ b/WebCore/platform/network/curl/ResourceHandleManager.h
@@ -28,7 +28,6 @@
 #ifndef ResourceHandleManager_h
 #define ResourceHandleManager_h
 
-#include "CString.h"
 #include "Frame.h"
 #include "PlatformString.h"
 #include "Timer.h"
@@ -41,6 +40,7 @@
 
 #include <curl/curl.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/network/mac/AuthenticationMac.mm b/WebCore/platform/network/mac/AuthenticationMac.mm
index ea06ecd..077a53d 100644
--- a/WebCore/platform/network/mac/AuthenticationMac.mm
+++ b/WebCore/platform/network/mac/AuthenticationMac.mm
@@ -82,6 +82,12 @@
 
 namespace WebCore {
 
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+// There is no constant in headers, but NTLM is supported.
+NSString * const NSURLAuthenticationMethodNTLM = @"NSURLAuthenticationMethodNTLM";
+#endif
+
+
 AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace,
                                                  const Credential& proposedCredential,
                                                  unsigned previousFailureCount,
@@ -188,11 +194,9 @@
         case ProtectionSpaceAuthenticationSchemeHTMLForm:
             method = NSURLAuthenticationMethodHTMLForm;
             break;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
         case ProtectionSpaceAuthenticationSchemeNTLM:
             method = NSURLAuthenticationMethodNTLM;
             break;
-#endif
         default:
             ASSERT_NOT_REACHED();
     }
@@ -289,12 +293,12 @@
         scheme = ProtectionSpaceAuthenticationSchemeHTTPDigest;
     else if ([method isEqualToString:NSURLAuthenticationMethodHTMLForm])
         scheme = ProtectionSpaceAuthenticationSchemeHTMLForm;
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     else if ([method isEqualToString:NSURLAuthenticationMethodNTLM])
         scheme = ProtectionSpaceAuthenticationSchemeNTLM;
-#endif
-    else
+    else {
+        scheme = ProtectionSpaceAuthenticationSchemeUnknown;
         ASSERT_NOT_REACHED();
+    }
         
     return ProtectionSpace([macSpace host], [macSpace port], serverType, [macSpace realm], scheme);
 
diff --git a/WebCore/platform/network/mac/FormDataStreamMac.mm b/WebCore/platform/network/mac/FormDataStreamMac.mm
index 8aa9a6d..27ecfd0 100644
--- a/WebCore/platform/network/mac/FormDataStreamMac.mm
+++ b/WebCore/platform/network/mac/FormDataStreamMac.mm
@@ -31,7 +31,7 @@
 #import "config.h"
 #import "FormDataStreamMac.h"
 
-#import "CString.h"
+#import "Blob.h"
 #import "FileSystem.h"
 #import "FormData.h"
 #import "ResourceHandle.h"
@@ -125,6 +125,9 @@
     SchedulePairHashSet scheduledRunLoopPairs;
     Vector<FormDataElement> remainingElements; // in reverse order
     CFReadStreamRef currentStream;
+#if ENABLE(BLOB_SLICE)
+    long long currentStreamRangeLength;
+#endif
     char* currentData;
     CFReadStreamRef formStream;
     unsigned long long streamLength;
@@ -138,6 +141,9 @@
         CFReadStreamSetClient(form->currentStream, kCFStreamEventNone, NULL, NULL);
         CFRelease(form->currentStream);
         form->currentStream = NULL;
+#if ENABLE(BLOB_SLICE)
+        form->currentStreamRangeLength = Blob::toEndOfFile;
+#endif
     }
     if (form->currentData) {
         fastFree(form->currentData);
@@ -145,12 +151,13 @@
     }
 }
 
-static void advanceCurrentStream(FormStreamFields *form)
+// Return false if we cannot advance the stream. Currently the only possible failure is that the underlying file has been changed since File.slice. 
+static bool advanceCurrentStream(FormStreamFields* form)
 {
     closeCurrentStream(form);
 
     if (form->remainingElements.isEmpty())
-        return;
+        return true;
 
     // Create the new stream.
     FormDataElement& nextInput = form->remainingElements.last();
@@ -160,10 +167,26 @@
         form->currentStream = CFReadStreamCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data), size, kCFAllocatorNull);
         form->currentData = data;
     } else {
+#if ENABLE(BLOB_SLICE)
+        // Check if the file has been changed or not if required.
+        if (nextInput.m_expectedFileModificationTime != Blob::doNotCheckFileChange) {
+            time_t fileModificationTime;
+            if (!getFileModificationTime(nextInput.m_filename, fileModificationTime) || fileModificationTime != static_cast<time_t>(nextInput.m_expectedFileModificationTime))
+                return false;
+        }
+#endif
+
         const String& path = nextInput.m_shouldGenerateFile ? nextInput.m_generatedFilename : nextInput.m_filename;
         RetainPtr<CFStringRef> filename(AdoptCF, path.createCFString());
         RetainPtr<CFURLRef> fileURL(AdoptCF, CFURLCreateWithFileSystemPath(0, filename.get(), kCFURLPOSIXPathStyle, FALSE));
         form->currentStream = CFReadStreamCreateWithFile(0, fileURL.get());
+#if ENABLE(BLOB_SLICE)
+        if (nextInput.m_fileStart > 0) {
+            CFNumberRef position = CFNumberCreate(0, kCFNumberLongLongType, &nextInput.m_fileStart);
+            CFReadStreamSetProperty(form->currentStream, kCFStreamPropertyFileCurrentOffset, position);
+        }
+        form->currentStreamRangeLength = nextInput.m_fileLength;
+#endif
     }
     form->remainingElements.removeLast();
 
@@ -176,16 +199,20 @@
     SchedulePairHashSet::iterator end = form->scheduledRunLoopPairs.end();
     for (SchedulePairHashSet::iterator it = form->scheduledRunLoopPairs.begin(); it != end; ++it)
         CFReadStreamScheduleWithRunLoop(form->currentStream, (*it)->runLoop(), (*it)->mode());
+
+    return true;
 }
 
-static void openNextStream(FormStreamFields* form)
+static bool openNextStream(FormStreamFields* form)
 {
     // Skip over any streams we can't open.
-    // For some purposes we might want to return an error, but the current NSURLConnection
-    // can't really do anything useful with an error at this point, so this is better.
-    advanceCurrentStream(form);
-    while (form->currentStream && !CFReadStreamOpen(form->currentStream))
-        advanceCurrentStream(form);
+    if (!advanceCurrentStream(form))
+        return false;
+    while (form->currentStream && !CFReadStreamOpen(form->currentStream)) {
+        if (!advanceCurrentStream(form))
+            return false;
+    }
+    return true;
 }
 
 static void* formCreate(CFReadStreamRef stream, void* context)
@@ -194,6 +221,9 @@
 
     FormStreamFields* newInfo = new FormStreamFields;
     newInfo->currentStream = NULL;
+#if ENABLE(BLOB_SLICE)
+    newInfo->currentStreamRangeLength = Blob::toEndOfFile;
+#endif
     newInfo->currentData = 0;
     newInfo->formStream = stream; // Don't retain. That would create a reference cycle.
     newInfo->streamLength = formContext->streamLength;
@@ -226,11 +256,11 @@
 {
     FormStreamFields* form = static_cast<FormStreamFields*>(context);
 
-    openNextStream(form);
+    bool opened = openNextStream(form);
 
-    *openComplete = TRUE;
-    error->error = 0;
-    return TRUE;
+    *openComplete = opened;
+    error->error = opened ? 0 : fnfErr;
+    return opened;
 }
 
 static CFIndex formRead(CFReadStreamRef stream, UInt8* buffer, CFIndex bufferLength, CFStreamError* error, Boolean* atEOF, void* context)
@@ -238,7 +268,12 @@
     FormStreamFields* form = static_cast<FormStreamFields*>(context);
 
     while (form->currentStream) {
-        CFIndex bytesRead = CFReadStreamRead(form->currentStream, buffer, bufferLength);
+        CFIndex bytesToRead = bufferLength;
+#if ENABLE(BLOB_SLICE)
+        if (form->currentStreamRangeLength != Blob::toEndOfFile && form->currentStreamRangeLength < bytesToRead)
+            bytesToRead = static_cast<CFIndex>(form->currentStreamRangeLength);
+#endif
+        CFIndex bytesRead = CFReadStreamRead(form->currentStream, buffer, bytesToRead);
         if (bytesRead < 0) {
             *error = CFReadStreamGetError(form->currentStream);
             return -1;
@@ -247,6 +282,10 @@
             error->error = 0;
             *atEOF = FALSE;
             form->bytesSent += bytesRead;
+#if ENABLE(BLOB_SLICE)
+            if (form->currentStreamRangeLength != Blob::toEndOfFile)
+                form->currentStreamRangeLength -= bytesRead;
+#endif
 
             if (!ResourceHandle::didSendBodyDataDelegateExists()) {
                 // FIXME: Figure out how to only do this when a ResourceHandleClient is available.
@@ -359,6 +398,13 @@
         if (element.m_type == FormDataElement::data)
             length += element.m_data.size();
         else {
+#if ENABLE(BLOB_SLICE)
+            // If we're sending the file range, use the existing range length for now. We will detect if the file has been changed right before we read the file and abort the operation if necessary.
+            if (element.m_fileLength != Blob::toEndOfFile) {
+                length += element.m_fileLength;
+                continue;
+            }
+#endif
             long long fileSize;
             if (getFileSize(element.m_shouldGenerateFile ? element.m_generatedFilename : element.m_filename, fileSize))
                 length += fileSize;
diff --git a/WebCore/platform/network/mac/ResourceErrorMac.mm b/WebCore/platform/network/mac/ResourceErrorMac.mm
index efd738f..275ca41 100644
--- a/WebCore/platform/network/mac/ResourceErrorMac.mm
+++ b/WebCore/platform/network/mac/ResourceErrorMac.mm
@@ -47,9 +47,9 @@
     NSString* failingURLString = [[m_platformError.get() userInfo] valueForKey:@"NSErrorFailingURLStringKey"];
     if (!failingURLString)
         failingURLString = [[[m_platformError.get() userInfo] valueForKey:@"NSErrorFailingURLKey"] absoluteString];
-    
+    m_failingURL = failingURLString; 
     // Workaround for <rdar://problem/6554067>
-    m_localizedDescription = failingURLString;
+    m_localizedDescription = m_failingURL;
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     m_localizedDescription = [m_platformError.get() _web_localizedDescription];
     END_BLOCK_OBJC_EXCEPTIONS;
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index 923a631..3ea29c5 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -30,9 +30,9 @@
 #import "AuthenticationMac.h"
 #import "Base64.h"
 #import "BlockExceptions.h"
-#import "CString.h"
 #import "CredentialStorage.h"
 #import "DocLoader.h"
+#import "EmptyProtocolDefinitions.h"
 #import "FormDataStreamMac.h"
 #import "Frame.h"
 #import "FrameLoader.h"
@@ -47,6 +47,7 @@
 #import "SubresourceLoader.h"
 #import "WebCoreSystemInterface.h"
 #import "WebCoreURLResponse.h"
+#import <wtf/text/CString.h>
 #import <wtf/UnusedParam.h>
 
 #ifdef BUILDING_ON_TIGER
@@ -55,7 +56,7 @@
 
 using namespace WebCore;
 
-@interface WebCoreResourceHandleAsDelegate : NSObject
+@interface WebCoreResourceHandleAsDelegate : NSObject <NSURLConnectionDelegate>
 {
     ResourceHandle* m_handle;
 }
@@ -63,17 +64,28 @@
 - (void)detachHandle;
 @end
 
+// WebCoreNSURLConnectionDelegateProxy exists so that we can cast m_proxy to it in order
+// to disambiguate the argument type in the -setDelegate: call.  This avoids a spurious
+// warning that the compiler would otherwise emit.
+@interface WebCoreNSURLConnectionDelegateProxy : NSObject <NSURLConnectionDelegate>
+- (void)setDelegate:(id<NSURLConnectionDelegate>)delegate;
+@end
+
 @interface NSURLConnection (NSURLConnectionTigerPrivate)
 - (NSData *)_bufferedData;
 @end
 
+@interface NSURLConnection (Details)
+-(id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate usesCache:(BOOL)usesCacheFlag maxContentLength:(long long)maxContentLength startImmediately:(BOOL)startImmediately connectionProperties:(NSDictionary *)connectionProperties;
+@end
+
 @interface NSURLRequest (Details)
 - (id)_propertyForKey:(NSString *)key;
 @end
 
 #ifndef BUILDING_ON_TIGER
 
-@interface WebCoreSynchronousLoader : NSObject {
+@interface WebCoreSynchronousLoader : NSObject <NSURLConnectionDelegate> {
     NSURL *m_url;
     NSString *m_user;
     NSString *m_pass;
@@ -149,6 +161,30 @@
     return NSFoundationVersionNumber > MaxFoundationVersionWithoutdidSendBodyDataDelegate;
 }
 
+static NSURLConnection *createNSURLConnection(NSURLRequest *request, id delegate, bool shouldUseCredentialStorage)
+{
+#if defined(BUILDING_ON_TIGER)
+    UNUSED_PARAM(shouldUseCredentialStorage);
+    return [[NSURLConnection alloc] initWithRequest:request delegate:delegate];
+#else
+
+#if !defined(BUILDING_ON_LEOPARD)
+    ASSERT([NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)]);
+    static bool supportsSettingConnectionProperties = true;
+#else
+    static bool supportsSettingConnectionProperties = [NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)];
+#endif
+
+    if (supportsSettingConnectionProperties) {
+        NSDictionary *sessionID = shouldUseCredentialStorage ? [NSDictionary dictionary] : [NSDictionary dictionaryWithObject:@"WebKitPrivateSession" forKey:@"_kCFURLConnectionSessionID"];
+        NSDictionary *propertyDictionary = [NSDictionary dictionaryWithObject:sessionID forKey:@"kCFURLConnectionSocketStreamProperties"];
+        return [[NSURLConnection alloc] _initWithRequest:request delegate:delegate usesCache:YES maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary];
+    }
+
+    return [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
+#endif
+}
+
 bool ResourceHandle::start(Frame* frame)
 {
     if (!frame)
@@ -166,17 +202,9 @@
     isInitializingConnection = YES;
 #endif
 
-    id delegate;
-    
-    if (d->m_mightDownloadFromHandle) {
-        ASSERT(!d->m_proxy);
-        d->m_proxy = wkCreateNSURLConnectionDelegateProxy();
-        [d->m_proxy.get() setDelegate:ResourceHandle::delegate()];
-        [d->m_proxy.get() release];
-        
-        delegate = d->m_proxy.get();
-    } else 
-        delegate = ResourceHandle::delegate();
+    ASSERT(!d->m_proxy);
+    d->m_proxy.adoptNS(wkCreateNSURLConnectionDelegateProxy());
+    [static_cast<WebCoreNSURLConnectionDelegateProxy*>(d->m_proxy.get()) setDelegate:ResourceHandle::delegate()];
 
     if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty())
 #ifndef BUILDING_ON_TIGER
@@ -190,8 +218,10 @@
         d->m_request.setURL(urlWithCredentials);
     }
 
+    bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
+
 #ifndef BUILDING_ON_TIGER
-    if ((!client() || client()->shouldUseCredentialStorage(this)) && d->m_request.url().protocolInHTTPFamily()) {
+    if (shouldUseCredentialStorage && d->m_request.url().protocolInHTTPFamily()) {
         if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
             // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, 
             // try and reuse the credential preemptively, as allowed by RFC 2617.
@@ -223,22 +253,20 @@
 
     d->m_needsSiteSpecificQuirks = frame->settings() && frame->settings()->needsSiteSpecificQuirks();
 
+    // If a URL already has cookies, then we'll relax the 3rd party cookie policy and accept new cookies.
+    NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+    if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
+        && [[sharedStorage cookiesForURL:d->m_request.url()] count])
+        d->m_request.setFirstPartyForCookies(d->m_request.url());
+
     NSURLConnection *connection;
     
-    if (d->m_shouldContentSniff || frame->settings()->localFileContentSniffingEnabled()) 
-#ifdef BUILDING_ON_TIGER
-        connection = [[NSURLConnection alloc] initWithRequest:d->m_request.nsURLRequest() delegate:delegate];
-#else
-        connection = [[NSURLConnection alloc] initWithRequest:d->m_request.nsURLRequest() delegate:delegate startImmediately:NO];
-#endif
+    if (d->m_shouldContentSniff || frame->settings()->localFileContentSniffingEnabled())
+        connection = createNSURLConnection(d->m_request.nsURLRequest(), d->m_proxy.get(), shouldUseCredentialStorage);
     else {
         NSMutableURLRequest *request = [d->m_request.nsURLRequest() mutableCopy];
         wkSetNSURLRequestShouldContentSniff(request, NO);
-#ifdef BUILDING_ON_TIGER
-        connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate];
-#else
-        connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
-#endif
+        connection = createNSURLConnection(request, d->m_proxy.get(), shouldUseCredentialStorage);
         [request release];
     }
 
@@ -419,13 +447,22 @@
 
     ASSERT(!request.isEmpty());
     
-    NSURLRequest *nsRequest;
+    NSMutableURLRequest *mutableRequest = nil;
     if (!shouldContentSniffURL(request.url())) {
-        NSMutableURLRequest *mutableRequest = [[request.nsURLRequest() mutableCopy] autorelease];
+        mutableRequest = [[request.nsURLRequest() mutableCopy] autorelease];
         wkSetNSURLRequestShouldContentSniff(mutableRequest, NO);
-        nsRequest = mutableRequest;
-    } else
-        nsRequest = request.nsURLRequest();
+    } 
+
+    // If a URL already has cookies, then we'll ignore the 3rd party cookie policy and accept new cookies.
+    NSHTTPCookieStorage *sharedStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+    if ([sharedStorage cookieAcceptPolicy] == NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
+        && [[sharedStorage cookiesForURL:request.url()] count]) {
+        if (!mutableRequest)
+            mutableRequest = [[request.nsURLRequest() mutableCopy] autorelease];
+        [mutableRequest setMainDocumentURL:[mutableRequest URL]];
+    }
+    
+    NSURLRequest *nsRequest = mutableRequest ? mutableRequest : request.nsURLRequest();
             
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
@@ -465,6 +502,7 @@
     const KURL& url = request.url();
     d->m_user = url.user();
     d->m_pass = url.pass();
+    d->m_lastHTTPMethod = request.httpMethod();
     request.removeCredentials();
 
     client()->willSendRequest(this, request, redirectResponse);
@@ -619,13 +657,13 @@
 #endif
 
     if ([redirectResponse isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse *)redirectResponse statusCode] == 307) {
-        String originalMethod = m_handle->request().httpMethod();
-        if (!equalIgnoringCase(originalMethod, String([newRequest HTTPMethod]))) {
+        String lastHTTPMethod = m_handle->lastHTTPMethod();
+        if (!equalIgnoringCase(lastHTTPMethod, String([newRequest HTTPMethod]))) {
             NSMutableURLRequest *mutableRequest = [newRequest mutableCopy];
-            [mutableRequest setHTTPMethod:originalMethod];
+            [mutableRequest setHTTPMethod:lastHTTPMethod];
     
             FormData* body = m_handle->request().httpBody();
-            if (!equalIgnoringCase(originalMethod, "GET") && body && !body->isEmpty())
+            if (!equalIgnoringCase(lastHTTPMethod, "GET") && body && !body->isEmpty())
                 WebCore::setHTTPBody(mutableRequest, body);
 
             String originalContentType = m_handle->request().httpContentType();
@@ -1051,7 +1089,7 @@
     if ((delegate->m_user || delegate->m_pass) && url.protocolInHTTPFamily()) {
         ResourceRequest requestWithoutCredentials = request;
         requestWithoutCredentials.removeCredentials();
-        connection = [[NSURLConnection alloc] initWithRequest:requestWithoutCredentials.nsURLRequest() delegate:delegate startImmediately:NO];
+        connection = createNSURLConnection(requestWithoutCredentials.nsURLRequest(), delegate, allowStoredCredentials);
     } else {
         // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, 
         // try and reuse the credential preemptively, as allowed by RFC 2617.
@@ -1063,7 +1101,7 @@
             String authHeader = "Basic " + encodeBasicAuthorization(delegate->m_initialCredential.user(), delegate->m_initialCredential.password());
             requestWithInitialCredentials.addHTTPHeaderField("Authorization", authHeader);
         }
-        connection = [[NSURLConnection alloc] initWithRequest:requestWithInitialCredentials.nsURLRequest() delegate:delegate startImmediately:NO];
+        connection = createNSURLConnection(requestWithInitialCredentials.nsURLRequest(), delegate, allowStoredCredentials);
     }
 
     [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:WebCoreSynchronousLoaderRunLoopMode];
diff --git a/WebCore/platform/network/mac/ResourceResponseMac.mm b/WebCore/platform/network/mac/ResourceResponseMac.mm
index 9b507e6..e1f1790 100644
--- a/WebCore/platform/network/mac/ResourceResponseMac.mm
+++ b/WebCore/platform/network/mac/ResourceResponseMac.mm
@@ -26,7 +26,9 @@
 #import "config.h"
 #import "ResourceResponse.h"
 
+#import "HTTPParsers.h"
 #import "WebCoreURLResponse.h"
+#import "WebCoreSystemInterface.h"
 #import <Foundation/Foundation.h>
 #import <wtf/StdLibExtras.h>
 #import <limits>
@@ -78,9 +80,12 @@
         NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)m_nsResponse.get();
         
         m_httpStatusCode = [httpResponse statusCode];
-        
-        // FIXME: it would be nice to have a way to get the real status text eventually.
-        m_httpStatusText = "OK";
+
+        RetainPtr<NSString> httpStatusLine(AdoptNS, wkCopyNSURLResponseStatusLine(m_nsResponse.get()));
+        if (httpStatusLine)
+            m_httpStatusText = extractReasonPhraseFromHTTPStatusLine(httpStatusLine.get());
+        else
+            m_httpStatusText = "OK";
         
         NSDictionary *headers = [httpResponse allHeaderFields];
         NSEnumerator *e = [headers keyEnumerator];
diff --git a/WebCore/platform/network/qt/DnsPrefetchHelper.cpp b/WebCore/platform/network/qt/DnsPrefetchHelper.cpp
index e687976..d017b90 100644
--- a/WebCore/platform/network/qt/DnsPrefetchHelper.cpp
+++ b/WebCore/platform/network/qt/DnsPrefetchHelper.cpp
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "DnsPrefetchHelper.h"
 
-#include "CString.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 // this is called on mouse over a href and on page loading
diff --git a/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h b/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
index 536b06a..15a48cd 100644
--- a/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
+++ b/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
@@ -22,9 +22,15 @@
 
 #include <QObject>
 
+#if QT_VERSION < 0x040700
 namespace QtMobility {
 class QNetworkConfigurationManager;
 }
+#else
+QT_BEGIN_NAMESPACE
+class QNetworkConfigurationManager;
+QT_END_NAMESPACE
+#endif
 
 namespace WebCore {
 
@@ -40,7 +46,11 @@
     void networkAccessPermissionChanged(bool);
 
 public:
+#if QT_VERSION < 0x040700
     QtMobility::QNetworkConfigurationManager* m_configurationManager;
+#else
+    QNetworkConfigurationManager* m_configurationManager;
+#endif
     bool m_online;
     bool m_networkAccessAllowed;
     NetworkStateNotifier* m_notifier;
diff --git a/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp b/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
index e694264..52512aa 100644
--- a/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
+++ b/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
@@ -23,7 +23,9 @@
 #include "NetworkStateNotifierPrivate.h"
 #include "qnetworkconfigmanager.h"
 
+#if QT_VERSION < 0x040700
 using namespace QtMobility;
+#endif
 
 namespace WebCore {
 
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 559ef84..27b57b7 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -34,6 +34,7 @@
 #include <QNetworkCookie>
 #include <qwebframe.h>
 #include <qwebpage.h>
+#include <wtf/text/CString.h>
 
 #include <QDebug>
 #include <QCoreApplication>
@@ -47,6 +48,7 @@
 #define SIGNAL_CONN Qt::QueuedConnection
 #endif
 
+static const int gMaxRecursionLimit = 10;
 
 namespace WebCore {
 
@@ -137,6 +139,7 @@
     , m_shouldFinish(false)
     , m_shouldSendResponse(false)
     , m_shouldForwardData(false)
+    , m_redirectionTries(gMaxRecursionLimit)
 {
     const ResourceRequest &r = m_resourceHandle->request();
 
@@ -152,6 +155,10 @@
     else if (r.httpMethod() == "DELETE")
         m_method = QNetworkAccessManager::DeleteOperation;
 #endif
+#if QT_VERSION >= 0x040700
+    else if (r.httpMethod() == "OPTIONS")
+        m_method = QNetworkAccessManager::CustomOperation;
+#endif
     else
         m_method = QNetworkAccessManager::UnknownOperation;
 
@@ -330,9 +337,18 @@
 
     QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
     if (redirection.isValid()) {
+        QUrl newUrl = m_reply->url().resolved(redirection);
+
+        m_redirectionTries--;
+        if (m_redirectionTries == 0) { // 10 or more redirections to the same url is considered infinite recursion
+            ResourceError error(newUrl.host(), 400 /*bad request*/,
+                                newUrl.toString(),
+                                QCoreApplication::translate("QWebPage", "Redirection limit reached"));
+            client->didFail(m_resourceHandle, error);
+            return;
+        }
         m_redirected = true;
 
-        QUrl newUrl = m_reply->url().resolved(redirection);
         ResourceRequest newRequest = m_resourceHandle->request();
         newRequest.setURL(newUrl);
 
@@ -437,6 +453,11 @@
             break;
         }
 #endif
+#if QT_VERSION >= 0x040700
+        case QNetworkAccessManager::CustomOperation:
+            m_reply = manager->sendCustomRequest(m_request, m_resourceHandle->request().httpMethod().latin1().data());
+            break;
+#endif
         case QNetworkAccessManager::UnknownOperation: {
             m_reply = 0;
             ResourceHandleClient* client = m_resourceHandle->client();
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.h b/WebCore/platform/network/qt/QNetworkReplyHandler.h
index eb5ae3c..1abad4e 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.h
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.h
@@ -82,6 +82,7 @@
     bool m_shouldFinish;
     bool m_shouldSendResponse;
     bool m_shouldForwardData;
+    int m_redirectionTries;
 };
 
 // Self destructing QIODevice for FormData
diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp
index 09cdefd..aaa306a 100644
--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -28,24 +28,24 @@
  */
 
 #include "config.h"
-
-#include "Frame.h"
-#include "DocLoader.h"
 #include "ResourceHandle.h"
-#include "ResourceHandleClient.h"
-#include "ResourceHandleInternal.h"
-#include "qwebpage_p.h"
-#include "qwebframe_p.h"
+
 #include "ChromeClientQt.h"
+#include "DocLoader.h"
+#include "Frame.h"
 #include "FrameLoaderClientQt.h"
+#include "NotImplemented.h"
 #include "Page.h"
 #include "QNetworkReplyHandler.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
+#include "SharedBuffer.h"
 
-#include "NotImplemented.h"
+// FIXME: WebCore including these headers from WebKit is a massive layering violation.
+#include "qwebframe_p.h"
+#include "qwebpage_p.h"
 
-#if QT_VERSION >= 0x040500
 #include <QAbstractNetworkCache>
-#endif
 #include <QCoreApplication>
 #include <QUrl>
 #include <QNetworkAccessManager>
@@ -144,8 +144,10 @@
 
 void ResourceHandle::cancel()
 {
-    if (d->m_job)
+    if (d->m_job) {
         d->m_job->abort();
+        d->m_job = 0;
+    }
 }
 
 bool ResourceHandle::loadsBlocked()
@@ -158,7 +160,6 @@
     if (!frame)
         return false;
 
-#if QT_VERSION >= 0x040500
     QNetworkAccessManager* manager = QWebFramePrivate::kit(frame)->page()->networkAccessManager();
     QAbstractNetworkCache* cache = manager->cache();
 
@@ -172,9 +173,6 @@
     }
 
     return false;
-#else
-    return false;
-#endif
 }
 
 bool ResourceHandle::supportsBufferedData()
@@ -191,7 +189,7 @@
 void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
 {
     WebCoreSynchronousLoader syncLoader;
-    ResourceHandle handle(request, &syncLoader, true, false, true);
+    ResourceHandle handle(request, &syncLoader, true, false);
 
     ResourceHandleInternal *d = handle.getInternal();
     if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
diff --git a/WebCore/platform/network/soup/CookieJarSoup.cpp b/WebCore/platform/network/soup/CookieJarSoup.cpp
index d6479b2..ba29622 100644
--- a/WebCore/platform/network/soup/CookieJarSoup.cpp
+++ b/WebCore/platform/network/soup/CookieJarSoup.cpp
@@ -22,10 +22,10 @@
 #include "CookieJarSoup.h"
 
 #include "Cookie.h"
-#include "CString.h"
 #include "Document.h"
-#include "GOwnPtrGtk.h"
+#include "GOwnPtrSoup.h"
 #include "KURL.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -36,7 +36,11 @@
 {
     if (!cookiesInitialized) {
         cookiesInitialized = true;
-        setDefaultCookieJar(soup_cookie_jar_new());
+
+        cookieJar = soup_cookie_jar_new();
+#ifdef HAVE_LIBSOUP_2_29_90
+        soup_cookie_jar_set_accept_policy(cookieJar, SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY);
+#endif
     }
 
     return cookieJar;
diff --git a/WebCore/platform/network/soup/DNSSoup.cpp b/WebCore/platform/network/soup/DNSSoup.cpp
deleted file mode 100644
index 7f47efd..0000000
--- a/WebCore/platform/network/soup/DNSSoup.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2009 Igalia S.L.
- *
- * 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 AND ITS 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 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 "DNS.h"
-
-#include "CString.h"
-#include "GOwnPtrGtk.h"
-#include "ResourceHandle.h"
-
-namespace WebCore {
-
-void prefetchDNS(const String& hostname)
-{
-#ifdef HAVE_LIBSOUP_2_29_90
-    String uri = "http://"+hostname;
-    GOwnPtr<SoupURI> soupURI(soup_uri_new(uri.utf8().data()));
-    // We may get invalid hostnames, so NULL-check here.
-    if (!soupURI)
-        return;
-    soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get());
-#endif
-}
-
-}
diff --git a/WebCore/platform/network/soup/GOwnPtrSoup.cpp b/WebCore/platform/network/soup/GOwnPtrSoup.cpp
new file mode 100644
index 0000000..56fe692
--- /dev/null
+++ b/WebCore/platform/network/soup/GOwnPtrSoup.cpp
@@ -0,0 +1,33 @@
+/*
+ *  Copyright (C) 2010 Igalia S.L
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#include "config.h"
+#include "GOwnPtrSoup.h"
+
+#include <libsoup/soup-uri.h>
+
+namespace WTF {
+
+template <> void freeOwnedGPtr<SoupURI>(SoupURI* ptr)
+{
+    if (ptr)
+        soup_uri_free(ptr);
+}
+
+}
diff --git a/WebCore/platform/network/soup/GOwnPtrSoup.h b/WebCore/platform/network/soup/GOwnPtrSoup.h
new file mode 100644
index 0000000..c129f84
--- /dev/null
+++ b/WebCore/platform/network/soup/GOwnPtrSoup.h
@@ -0,0 +1,33 @@
+/*
+ *  Copyright (C) 2010 Igalia S.L
+ *
+ *  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 GOwnPtrSoup_h
+#define GOwnPtrSoup_h
+
+#include "GOwnPtr.h"
+
+typedef struct _SoupURI SoupURI;
+
+namespace WTF {
+
+template<> void freeOwnedGPtr<SoupURI>(SoupURI* ptr);
+
+}
+
+#endif
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 4c59d34..e70abfb 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2008 Alp Toker <alp@atoker.com>
  * Copyright (C) 2008 Xan Lopez <xan@gnome.org>
- * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2008, 2010 Collabora Ltd.
  * Copyright (C) 2009 Holger Hans Peter Freyther
  * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
  * Copyright (C) 2009 Christian Dywan <christian@imendio.com>
@@ -28,13 +28,12 @@
 #include "ResourceHandle.h"
 
 #include "Base64.h"
-#include "CookieJarSoup.h"
 #include "ChromeClient.h"
-#include "CString.h"
+#include "CookieJarSoup.h"
 #include "DocLoader.h"
 #include "FileSystem.h"
 #include "Frame.h"
-#include "GOwnPtrGtk.h"
+#include "GOwnPtrSoup.h"
 #include "HTTPParsers.h"
 #include "Logging.h"
 #include "MIMETypeRegistry.h"
@@ -44,7 +43,9 @@
 #include "ResourceHandleClient.h"
 #include "ResourceHandleInternal.h"
 #include "ResourceResponse.h"
+#include "SharedBuffer.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 
 #include <errno.h>
 #include <fcntl.h>
@@ -145,6 +146,16 @@
     cleanupGioOperation(this, true);
 }
 
+void ResourceHandle::prepareForURL(const KURL &url)
+{
+#ifdef HAVE_LIBSOUP_2_29_90
+    GOwnPtr<SoupURI> soupURI(soup_uri_new(url.prettyURL().utf8().data()));
+    if (!soupURI)
+        return;
+    soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get());
+#endif
+}
+
 // All other kinds of redirections, except for the *304* status code
 // (SOUP_STATUS_NOT_MODIFIED) which needs to be fed into WebCore, will be
 // handled by soup directly.
@@ -160,24 +171,7 @@
 
 static void fillResponseFromMessage(SoupMessage* msg, ResourceResponse* response)
 {
-    SoupMessageHeadersIter iter;
-    const char* name = 0;
-    const char* value = 0;
-    soup_message_headers_iter_init(&iter, msg->response_headers);
-    while (soup_message_headers_iter_next(&iter, &name, &value))
-        response->setHTTPHeaderField(name, value);
-
-    String contentType = soup_message_headers_get_one(msg->response_headers, "Content-Type");
-    response->setMimeType(extractMIMETypeFromMediaType(contentType));
-
-    char* uri = soup_uri_to_string(soup_message_get_uri(msg), false);
-    response->setURL(KURL(KURL(), uri));
-    g_free(uri);
-    response->setTextEncodingName(extractCharsetFromMediaType(contentType));
-    response->setExpectedContentLength(soup_message_headers_get_content_length(msg->response_headers));
-    response->setHTTPStatusCode(msg->status_code);
-    response->setHTTPStatusText(msg->reason_phrase);
-    response->setSuggestedFilename(filenameFromHTTPContentDisposition(response->httpHeaderField("Content-Disposition")));
+    response->updateFromSoupMessage(msg);
 }
 
 // Called each time the message is going to be sent again except the first time.
@@ -391,7 +385,7 @@
         // The load may be cancelled, and the client may be destroyed
         // by any of the client reporting calls, so we check, and bail
         // out in either of those cases.
-        if (!handle->client() || d->m_cancelled)
+        if (d->m_cancelled || !handle->client())
             return false;
 
         // Use the GLib Base64, since WebCore's decoder isn't
@@ -408,14 +402,14 @@
         response.setTextEncodingName("UTF-16");
         client->didReceiveResponse(handle, response);
 
-        if (!handle->client() || d->m_cancelled)
+        if (d->m_cancelled || !handle->client())
             return false;
 
         if (data.length() > 0)
             client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0);
     }
 
-    if (!handle->client() || d->m_cancelled)
+    if (d->m_cancelled || !handle->client())
         return false;
 
     client->didFinishLoading(handle);
@@ -431,7 +425,7 @@
 
     // If parseDataUrl is called synchronously the job is not yet effectively started
     // and webkit won't never know that the data has been parsed even didFinishLoading is called.
-    d->m_idleHandler = g_idle_add(parseDataUrl, handle);
+    d->m_idleHandler = g_timeout_add(0, parseDataUrl, handle);
     return true;
 }
 
@@ -664,7 +658,7 @@
 void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
 {
     WebCoreSynchronousLoader syncLoader(error, response, data);
-    ResourceHandle handle(request, &syncLoader, true, false, true);
+    ResourceHandle handle(request, &syncLoader, true, false);
 
     handle.start(frame);
     syncLoader.run();
diff --git a/WebCore/platform/network/soup/ResourceRequest.h b/WebCore/platform/network/soup/ResourceRequest.h
index 8270863..a1d916f 100644
--- a/WebCore/platform/network/soup/ResourceRequest.h
+++ b/WebCore/platform/network/soup/ResourceRequest.h
@@ -37,27 +37,32 @@
     public:
         ResourceRequest(const String& url)
             : ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
+            , m_soupFlags(static_cast<SoupMessageFlags>(0))
         {
         }
 
         ResourceRequest(const KURL& url)
             : ResourceRequestBase(url, UseProtocolCachePolicy)
+            , m_soupFlags(static_cast<SoupMessageFlags>(0))
         {
         }
 
         ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy)
             : ResourceRequestBase(url, policy)
+            , m_soupFlags(static_cast<SoupMessageFlags>(0))
         {
             setHTTPReferrer(referrer);
         }
 
         ResourceRequest()
             : ResourceRequestBase(KURL(), UseProtocolCachePolicy)
+            , m_soupFlags(static_cast<SoupMessageFlags>(0))
         {
         }
 
         ResourceRequest(SoupMessage* soupMessage)
             : ResourceRequestBase(KURL(), UseProtocolCachePolicy)
+            , m_soupFlags(static_cast<SoupMessageFlags>(0))
         {
             updateFromSoupMessage(soupMessage);
         }
@@ -65,9 +70,14 @@
         SoupMessage* toSoupMessage() const;
         void updateFromSoupMessage(SoupMessage* soupMessage);
 
+        SoupMessageFlags soupMessageFlags() const { return m_soupFlags; }
+        void setSoupMessageFlags(SoupMessageFlags soupFlags) { m_soupFlags = soupFlags; }
+
     private:
         friend class ResourceRequestBase;
 
+        SoupMessageFlags m_soupFlags;
+
         void doUpdatePlatformRequest() {};
         void doUpdateResourceRequest() {};
     };
diff --git a/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
index d2c46a6..62deb01 100644
--- a/WebCore/platform/network/soup/ResourceRequestSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
@@ -20,10 +20,12 @@
 #include "config.h"
 #include "ResourceRequest.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
-#include "GOwnPtrGtk.h"
+#include "GOwnPtrSoup.h"
+#include "HTTPParsers.h"
+#include "MIMETypeRegistry.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <libsoup/soup.h>
 
@@ -37,7 +39,7 @@
     if (!soupMessage)
         return 0;
 
-    HTTPHeaderMap headers = httpHeaderFields();
+    const HTTPHeaderMap& headers = httpHeaderFields();
     SoupMessageHeaders* soupHeaders = soupMessage->request_headers;
     if (!headers.isEmpty()) {
         HTTPHeaderMap::const_iterator end = headers.end();
@@ -53,6 +55,8 @@
     }
 #endif
 
+    soup_message_set_flags(soupMessage, m_soupFlags);
+
     // Body data is only handled at ResourceHandleSoup::startHttp for
     // now; this is because this may not be a good place to go
     // openning and mmapping files. We should maybe revisit this.
@@ -86,6 +90,8 @@
     }
 #endif
 
+    m_soupFlags = soup_message_get_flags(soupMessage);
+
     // FIXME: m_allowCookies should probably be handled here and on
     // doUpdatePlatformRequest somehow.
 }
diff --git a/WebCore/platform/network/soup/ResourceResponse.h b/WebCore/platform/network/soup/ResourceResponse.h
index ecd9f21..e6d872c 100644
--- a/WebCore/platform/network/soup/ResourceResponse.h
+++ b/WebCore/platform/network/soup/ResourceResponse.h
@@ -36,6 +36,7 @@
 public:
     ResourceResponse()
         : ResourceResponseBase()
+        , m_soupFlags(static_cast<SoupMessageFlags>(0))
     {
     }
 
@@ -46,6 +47,7 @@
 
     ResourceResponse(SoupMessage* soupMessage)
         : ResourceResponseBase()
+        , m_soupFlags(static_cast<SoupMessageFlags>(0))
     {
         updateFromSoupMessage(soupMessage);
     }
@@ -53,9 +55,14 @@
     SoupMessage* toSoupMessage() const;
     void updateFromSoupMessage(SoupMessage* soupMessage);
 
+    SoupMessageFlags soupMessageFlags() const { return m_soupFlags; }
+    void setSoupMessageFlags(SoupMessageFlags soupFlags) { m_soupFlags = soupFlags; }
+
 private:
     friend class ResourceResponseBase;
 
+    SoupMessageFlags m_soupFlags;
+
     void doUpdateResourceResponse()
     {
     }
diff --git a/WebCore/platform/network/soup/ResourceResponseSoup.cpp b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
index caf0b31..cdbdc67 100644
--- a/WebCore/platform/network/soup/ResourceResponseSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
@@ -21,9 +21,11 @@
 #include "config.h"
 #include "ResourceResponse.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
+#include "HTTPParsers.h"
+#include "MIMETypeRegistry.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 using namespace std;
 
@@ -38,7 +40,7 @@
 
     soupMessage->status_code = httpStatusCode();
 
-    HTTPHeaderMap headers = httpHeaderFields();
+    const HTTPHeaderMap& headers = httpHeaderFields();
     SoupMessageHeaders* soupHeaders = soupMessage->response_headers;
     if (!headers.isEmpty()) {
         HTTPHeaderMap::const_iterator end = headers.end();
@@ -46,6 +48,8 @@
             soup_message_headers_append(soupHeaders, it->first.string().utf8().data(), it->second.utf8().data());
     }
 
+    soup_message_set_flags(soupMessage, m_soupFlags);
+
     // Body data is not in the message.
     return soupMessage;
 }
@@ -65,6 +69,16 @@
     soup_message_headers_iter_init(&headersIter, soupMessage->response_headers);
     while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue))
         m_httpHeaderFields.set(String::fromUTF8(headerName), String::fromUTF8(headerValue));
+
+    m_soupFlags = soup_message_get_flags(soupMessage);
+
+    String contentType = soup_message_headers_get_one(soupMessage->response_headers, "Content-Type");
+    setMimeType(extractMIMETypeFromMediaType(contentType));
+
+    setTextEncodingName(extractCharsetFromMediaType(contentType));
+    setExpectedContentLength(soup_message_headers_get_content_length(soupMessage->response_headers));
+    setHTTPStatusText(soupMessage->reason_phrase);
+    setSuggestedFilename(filenameFromHTTPContentDisposition(httpHeaderField("Content-Disposition")));
 }
 
 }
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 337b752..aff316e 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -29,7 +29,6 @@
 #include "ResourceHandleInternal.h"
 #include "ResourceHandleWin.h"
 
-#include "CString.h"
 #include "DocLoader.h"
 #include "Document.h"
 #include "Frame.h"
@@ -37,6 +36,7 @@
 #include "Page.h"
 #include "ResourceError.h"
 #include "Timer.h"
+#include <wtf/text/CString.h>
 #include <windows.h>
 #include <wininet.h>
 
diff --git a/WebCore/platform/posix/FileSystemPOSIX.cpp b/WebCore/platform/posix/FileSystemPOSIX.cpp
index e55b8a4..db8dff8 100644
--- a/WebCore/platform/posix/FileSystemPOSIX.cpp
+++ b/WebCore/platform/posix/FileSystemPOSIX.cpp
@@ -29,8 +29,8 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "PlatformString.h"
+<<<<<<< HEAD
 
 #include <sys/stat.h>
 #ifdef ANDROID_PLUGINS
@@ -38,8 +38,15 @@
 #include <dirent.h>
 #include <fnmatch.h>
 #endif
+=======
+#include <errno.h>
+#include <fcntl.h>
+>>>>>>> webkit.org at r58033
 #include <libgen.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -70,6 +77,69 @@
     return !unlink(fsRep.data());
 }
 
+PlatformFileHandle openFile(const String& path, FileOpenMode mode)
+{
+    int platformFlag = 0;
+    if (mode == OpenForRead)
+        platformFlag |= O_RDONLY;
+    else if (mode == OpenForWrite)
+        platformFlag |= (O_WRONLY | O_CREAT | O_TRUNC);
+    return open(path.utf8().data(), platformFlag, 0666);
+}
+
+void closeFile(PlatformFileHandle& handle)
+{
+    if (isHandleValid(handle)) {
+        close(handle);
+        handle = invalidPlatformFileHandle;
+    }
+}
+
+long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
+{
+    int whence = SEEK_SET;
+    switch (origin) {
+    case SeekFromBeginning:
+        whence = SEEK_SET;
+        break;
+    case SeekFromCurrent:
+        whence = SEEK_CUR;
+        break;
+    case SeekFromEnd:
+        whence = SEEK_END;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return static_cast<long long>(lseek(handle, offset, whence));
+}
+
+bool truncateFile(PlatformFileHandle handle, long long offset)
+{
+    // ftruncate returns 0 to indicate the success.
+    return !ftruncate(handle, offset);
+}
+
+int writeToFile(PlatformFileHandle handle, const char* data, int length)
+{
+    do {
+        int bytesWritten = write(handle, data, static_cast<size_t>(length));
+        if (bytesWritten >= 0)
+            return bytesWritten;
+    } while (errno == EINTR);
+    return -1;
+}
+
+int readFromFile(PlatformFileHandle handle, char* data, int length)
+{
+    do {
+        int bytesRead = read(handle, data, static_cast<size_t>(length));
+        if (bytesRead >= 0)
+            return bytesRead;
+    } while (errno == EINTR);
+    return -1;
+}
+
 bool deleteEmptyDirectory(const String& path)
 {
     CString fsRep = fileSystemRepresentation(path);
diff --git a/WebCore/platform/qt/CookieJarQt.cpp b/WebCore/platform/qt/CookieJarQt.cpp
index 01d1756..15053eb 100644
--- a/WebCore/platform/qt/CookieJarQt.cpp
+++ b/WebCore/platform/qt/CookieJarQt.cpp
@@ -67,7 +67,6 @@
         return;
 
     QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toAscii());
-#if QT_VERSION >= 0x040500
     QList<QNetworkCookie>::Iterator it = cookies.begin();
     while (it != cookies.end()) {
         if (it->isHttpOnly())
@@ -75,7 +74,6 @@
         else
             ++it;
     }
-#endif
     jar->setCookiesFromUrl(cookies, u);
 }
 
@@ -92,10 +90,8 @@
 
     QStringList resultCookies;
     foreach (QNetworkCookie networkCookie, cookies) {
-#if QT_VERSION >= 0x040500
         if (networkCookie.isHttpOnly())
             continue;
-#endif
         resultCookies.append(QString::fromAscii(
                              networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));
     }
diff --git a/WebCore/platform/qt/FileSystemQt.cpp b/WebCore/platform/qt/FileSystemQt.cpp
index 4093fad..1da3c68 100644
--- a/WebCore/platform/qt/FileSystemQt.cpp
+++ b/WebCore/platform/qt/FileSystemQt.cpp
@@ -32,8 +32,8 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <QDateTime>
 #include <QFile>
@@ -154,11 +154,12 @@
     return ::FreeLibrary(module);
 
 #else
+#ifndef QT_NO_LIBRARY
     if (module->unload()) {
         delete module;
         return true;
     }
-
+#endif
     return false;
 #endif
 }
diff --git a/WebCore/platform/qt/KURLQt.cpp b/WebCore/platform/qt/KURLQt.cpp
index 3bb3db2..ea1a795 100644
--- a/WebCore/platform/qt/KURLQt.cpp
+++ b/WebCore/platform/qt/KURLQt.cpp
@@ -19,22 +19,14 @@
  */
 #include "config.h"
 #include "KURL.h"
-#include "CString.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 
 #include "NotImplemented.h"
 #include "qurl.h"
 
 namespace WebCore {
 
-#if QT_VERSION < 0x040500
-static const char hexnumbers[] = "0123456789ABCDEF";
-static inline char toHex(char c)
-{
-    return hexnumbers[c & 0xf];
-}
-#endif
-
 KURL::KURL(const QUrl& url)
 {
     *this = KURL(KURL(), url.toEncoded().constData(), UTF8Encoding());
@@ -42,53 +34,8 @@
 
 KURL::operator QUrl() const
 {
-#if QT_VERSION < 0x040500
-    unsigned length = m_string.length();
-
-    QByteArray ba;
-    ba.reserve(length);
-
-    int path = -1;
-    int host = m_string.find("://");
-    if (host != -1) {
-        host += 3;
-
-        path = m_string.find('/', host);
-    }
-
-    for (unsigned i = 0; i < length; ++i) {
-        const char chr = static_cast<char>(m_string[i]);
-
-        switch (chr) {
-            encode:
-            case '{':
-            case '}':
-            case '|':
-            case '\\':
-            case '^':
-            case '`':
-                ba.append('%');
-                ba.append(toHex((chr & 0xf0) >> 4));
-                ba.append(toHex(chr & 0xf));
-                break;
-            case '[':
-            case ']':
-                // special case: if this is the host part, don't encode
-                // otherwise, encode
-                if (host == -1 || (path != -1 && i >= path))
-                    goto encode;
-                // fall through
-            default:
-                ba.append(chr);
-                break;
-        }
-    }
-#else
-    // Qt 4.5 or later
-    // No need for special encoding
     QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
     QByteArray ba = str.toUtf8();
-#endif
 
     QUrl url = QUrl::fromEncoded(ba);
     return url;
diff --git a/WebCore/platform/qt/Localizations.cpp b/WebCore/platform/qt/Localizations.cpp
index c919193..8fdd666 100644
--- a/WebCore/platform/qt/Localizations.cpp
+++ b/WebCore/platform/qt/Localizations.cpp
@@ -350,6 +350,17 @@
 {
     return String();
 }
+    
+String missingPluginText()
+{
+    return QCoreApplication::translate("QWebPage", "Missing Plug-in", "Label text to be used when a plug-in is missing");
+}
+
+String crashedPluginText()
+{
+    notImplemented();
+    return String();
+}
 
 String multipleFileUploadText(unsigned)
 {
diff --git a/WebCore/platform/qt/MIMETypeRegistryQt.cpp b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
index 22cee6f..4161f81 100644
--- a/WebCore/platform/qt/MIMETypeRegistryQt.cpp
+++ b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
@@ -82,4 +82,10 @@
     return "application/octet-stream";
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String& mimeType)
+{
+    return mimeType.startsWith("application/x-qt-plugin", false)
+        || mimeType.startsWith("application/x-qt-styled-widget", false);
+}
+
 }
diff --git a/WebCore/platform/qt/Maemo5Webstyle.cpp b/WebCore/platform/qt/Maemo5Webstyle.cpp
new file mode 100644
index 0000000..42b0b71
--- /dev/null
+++ b/WebCore/platform/qt/Maemo5Webstyle.cpp
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 "Maemo5Webstyle.h"
+
+#include "QtStyleOptionWebComboBox.h"
+
+#include <QPainter>
+#include <QPixmapCache>
+#include <QStyleOption>
+
+Maemo5WebStyle::Maemo5WebStyle()
+{
+}
+
+static inline void drawRectangularControlBackground(QPainter* painter, const QPen& pen, const QRect& rect, const QBrush& brush)
+{
+    QPen oldPen = painter->pen();
+    QBrush oldBrush = painter->brush();
+    painter->setPen(pen);
+    painter->setBrush(brush);
+
+    int line = 1;
+    painter->drawRect(rect.adjusted(line, line, -line, -line));
+
+    painter->setPen(oldPen);
+    painter->setBrush(oldBrush);
+}
+
+void Maemo5WebStyle::drawChecker(QPainter* painter, int size, QColor color) const
+{
+    int border = qMin(qMax(1, int(0.2 * size)), 6);
+    int checkerSize = size - 2 * border;
+    int width = checkerSize / 3;
+    int middle = qMax(3 * checkerSize / 7, 3);
+    int x = ((size - checkerSize) >> 1);
+    int y = ((size - checkerSize) >> 1) + (checkerSize - width - middle);
+    QVector<QLineF> lines(checkerSize + 1);
+    painter->setPen(color);
+    for (int i = 0; i < middle; ++i) {
+        lines[i] = QLineF(x, y, x, y + width);
+        ++x;
+        ++y;
+    }
+    for (int i = middle; i <= checkerSize; ++i) {
+        lines[i] = QLineF(x, y, x, y + width);
+        ++x;
+        --y;
+    }
+    painter->drawLines(lines.constData(), lines.size());
+}
+
+QPixmap Maemo5WebStyle::findChecker(const QRect& rect, bool disabled) const
+{
+    int size = qMin(rect.width(), rect.height());
+    QPixmap result;
+    static const QString prefix = "$qt-maemo5-" + QLatin1String(metaObject()->className()) + "-checker-";
+    QString key = prefix + QString::number(size) + "-" + (disabled ? "disabled" : "enabled");
+    if (!QPixmapCache::find(key, result)) {
+        result = QPixmap(size, size);
+        result.fill(Qt::transparent);
+        QPainter painter(&result);
+        drawChecker(&painter, size, disabled ? Qt::gray : Qt::black);
+        QPixmapCache::insert(key, result);
+    }
+    return result;
+}
+
+void Maemo5WebStyle::drawRadio(QPainter* painter, const QSize& size, bool checked, QColor color) const
+{
+    painter->setRenderHint(QPainter::Antialiasing, true);
+
+    // deflate one pixel
+    QRect rect = QRect(QPoint(1, 1), QSize(size.width() - 2, size.height() - 2));
+
+    QPen pen(Qt::black);
+    pen.setWidth(1);
+    painter->setPen(color);
+    painter->setBrush(Qt::white);
+    painter->drawEllipse(rect);
+    int border = 0.1 * (rect.width() + rect.height());
+    border = qMin(qMax(2, border), 10);
+    rect.adjust(border, border, -border, -border);
+    if (checked) {
+        painter->setPen(Qt::NoPen);
+        painter->setBrush(color);
+        painter->drawEllipse(rect);
+    }
+}
+
+QPixmap Maemo5WebStyle::findRadio(const QSize& size, bool checked, bool disabled) const
+{
+    QPixmap result;
+    static const QString prefix = "$qt-maemo5-" + QLatin1String(metaObject()->className()) + "-radio-";
+    QString key = prefix + QString::number(size.width()) + "-" + QString::number(size.height()) +
+                   + "-" + (disabled ? "disabled" : "enabled") + (checked ? "-checked" : "");
+    if (!QPixmapCache::find(key, result)) {
+        result = QPixmap(size);
+        result.fill(Qt::transparent);
+        QPainter painter(&result);
+        drawRadio(&painter, size, checked, disabled ? Qt::gray : Qt::black);
+        QPixmapCache::insert(key, result);
+    }
+    return result;
+}
+
+void Maemo5WebStyle::drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const
+{
+    switch (element) {
+    case CE_CheckBox: {
+        QRect rect = option->rect;
+        const bool disabled = !(option->state & State_Enabled);
+        drawRectangularControlBackground(painter, QPen(disabled ? Qt::gray : Qt::black), rect, option->palette.base());
+        rect.adjust(1, 1, -1, -1);
+
+        if (option->state & State_Off)
+            break;
+
+        QPixmap checker = findChecker(rect, disabled);
+        if (checker.isNull())
+            break;
+
+        int x = (rect.width() - checker.width()) >> 1;
+        int y = (rect.height() - checker.height()) >> 1;
+        painter->drawPixmap(rect.x() + x, rect.y() + y, checker);
+        break;
+    }
+    case CE_RadioButton: {
+        const bool disabled = !(option->state & State_Enabled);
+        QPixmap radio = findRadio(option->rect.size(), option->state & State_On, disabled);
+        if (radio.isNull())
+            break;
+        painter->drawPixmap(option->rect.x(), option->rect.y(), radio);
+        break;
+    }
+    default:
+        QWindowsStyle::drawControl(element, option, painter, widget);
+    }
+}
+
+void Maemo5WebStyle::drawMultipleComboButton(QPainter* painter, const QSize& size, QColor color) const
+{
+    int rectWidth = size.width() - 1;
+    int width = qMax(2, rectWidth >> 3);
+    int distance = (rectWidth - 3 * width) >> 1;
+    int top = (size.height() - width) >> 1;
+
+    painter->setPen(color);
+    painter->setBrush(color);
+
+    painter->drawRect(0, top, width, width);
+    painter->drawRect(width + distance, top, width, width);
+    painter->drawRect(2 * (width + distance), top, width, width);
+}
+
+void Maemo5WebStyle::drawSimpleComboButton(QPainter* painter, const QSize& size, QColor color) const
+{
+    QPolygon polygon;
+    int width = size.width();
+    polygon.setPoints(3, 0, 0,  width - 1, 0,  width >> 1, size.height());
+    painter->setPen(color);
+    painter->setBrush(color);
+    painter->drawPolygon(polygon);
+}
+
+QSize Maemo5WebStyle::getButtonImageSize(const QSize& buttonSize) const
+{
+    const int border = qMax(3, buttonSize.width() >> 3) << 1;
+
+    int width = buttonSize.width() - border;
+    int height = buttonSize.height() - border;
+
+    if (width < 0 || height < 0)
+        return QSize();
+
+    if (height >= (width >> 1))
+        width = width >> 1 << 1;
+    else
+        width = height << 1;
+
+    return QSize(width + 1, width >> 1);
+}
+
+QPixmap Maemo5WebStyle::findComboButton(const QSize& size, bool multiple, bool disabled) const
+{
+    QPixmap result;
+    QSize imageSize = getButtonImageSize(size);
+
+    if (imageSize.isNull())
+        return QPixmap();
+    static const QString prefix = "$qt-maemo5-" + QLatin1String(metaObject()->className()) + "-combo-";
+    QString key = prefix + (multiple ? "multiple-" : "simple-") +
+                  QString::number(imageSize.width()) + "-" + QString::number(imageSize.height()) +
+                   + "-" + (disabled ? "disabled" : "enabled");
+    if (!QPixmapCache::find(key, result)) {
+        result = QPixmap(imageSize);
+        result.fill(Qt::transparent);
+        QPainter painter(&result);
+        if (multiple)
+            drawMultipleComboButton(&painter, imageSize, disabled ? Qt::gray : Qt::black);
+        else
+            drawSimpleComboButton(&painter, imageSize, disabled ? Qt::gray : Qt::black);
+        QPixmapCache::insert(key, result);
+    }
+    return result;
+}
+
+void Maemo5WebStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const
+{
+    switch (control) {
+    case CC_ComboBox: {
+
+        bool multiple = false;
+        const bool disabled = !(option->state & State_Enabled);
+
+        const QStyleOptionComboBox* cmb = 0;
+        const WebCore::QtStyleOptionWebComboBox* webCombo = static_cast<const WebCore::QtStyleOptionWebComboBox*>(option);
+
+        if (webCombo) {
+            multiple = webCombo->multiple();
+            cmb = webCombo;
+        } else
+            cmb = qstyleoption_cast<const QStyleOptionComboBox*>(option);
+
+        if (!cmb) {
+            QWindowsStyle::drawComplexControl(control, option, painter, widget);
+            break;
+        }
+
+        if (!(cmb->subControls & SC_ComboBoxArrow))
+            break;
+
+        QRect rect = subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget);
+        QPixmap pic = findComboButton(rect.size(), multiple, disabled);
+
+        if (pic.isNull())
+            break;
+
+        int x = (rect.width() - pic.width()) >> 1;
+        int y = (rect.height() - pic.height()) >> 1;
+        painter->drawPixmap(rect.x() + x, rect.y() + y, pic);
+
+        painter->setPen(disabled ? Qt::gray : Qt::darkGray);
+        painter->drawLine(rect.left() - 2, rect.top() + 2, rect.left() - 2, rect.bottom() - 2);
+
+        break;
+    }
+    default:
+        QWindowsStyle::drawComplexControl(control, option, painter, widget);
+    }
+}
diff --git a/WebCore/platform/qt/Maemo5Webstyle.h b/WebCore/platform/qt/Maemo5Webstyle.h
new file mode 100644
index 0000000..ce717b6
--- /dev/null
+++ b/WebCore/platform/qt/Maemo5Webstyle.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 Maemo5Webstyle_h
+#define Maemo5Webstyle_h
+
+#include <QWindowsStyle>
+
+class Maemo5WebStyle : public QWindowsStyle {
+public:
+    Maemo5WebStyle();
+
+    void drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget = 0) const;
+    void drawComplexControl(ComplexControl cc, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget = 0) const;
+
+private:
+    void drawChecker(QPainter* painter, int size, QColor color) const;
+    QPixmap findChecker(const QRect& rect, bool disabled) const;
+
+    void drawRadio(QPainter* painter, const QSize& size, bool checked, QColor color) const;
+    QPixmap findRadio(const QSize& size, bool checked, bool disabled) const;
+
+    QSize getButtonImageSize(const QSize& buttonSize) const;
+    void drawSimpleComboButton(QPainter* painter, const QSize& size, QColor color) const;
+    void drawMultipleComboButton(QPainter* painter, const QSize& size, QColor color) const;
+    QPixmap findComboButton(const QSize& size, bool multiple, bool disabled) const;
+
+};
+
+#endif // Maemo5WebStyle_h
diff --git a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
index 12200f4..56fec70 100644
--- a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
+++ b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
@@ -28,8 +28,8 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
+#include "WindowsKeyboardCodes.h"
 
 #include <ctype.h>
 
@@ -127,6 +127,8 @@
             // Standard says that DEL becomes U+007F.
         case Qt::Key_Delete:
             return "U+007F";
+        case Qt::Key_Backspace:
+            return "U+0008";
         case Qt::Key_Tab:
             return "U+0009";
         case Qt::Key_Backtab:
@@ -549,6 +551,15 @@
     return false;
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    notImplemented();
+    shiftKey = false;
+    ctrlKey = false;
+    altKey = false;
+    metaKey = false;
+}
+
 }
 
 // vim: ts=4 sw=4 et
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index 6d47c29..467941f 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -40,7 +40,9 @@
 class QWebPageClient {
 public:
     virtual ~QWebPageClient() { }
-        
+
+    virtual bool isQWidgetClient() const { return false; }
+
     virtual void scroll(int dx, int dy, const QRect&) = 0;
     virtual void update(const QRect&) = 0;
     virtual void setInputMethodEnabled(bool enable) = 0;
@@ -53,6 +55,7 @@
     // if scheduleSync is true, we schedule a sync ourselves. otherwise,
     // we wait for the next update and sync the layers then.
     virtual void markForSync(bool scheduleSync = false) {}
+    virtual bool allowsAcceleratedCompositing() const { return false; }
 #endif
 
 #if QT_VERSION >= 0x040600
@@ -80,6 +83,7 @@
     virtual QPalette palette() const = 0;
     virtual int screenNumber() const = 0;
     virtual QWidget* ownerWidget() const = 0;
+    virtual QRect geometryRelativeToOwnerWidget() const = 0;
 
     virtual QObject* pluginParent() const = 0;
 
diff --git a/WebCore/platform/qt/QtAbstractWebPopup.cpp b/WebCore/platform/qt/QtAbstractWebPopup.cpp
index f64287d..31ab28d 100644
--- a/WebCore/platform/qt/QtAbstractWebPopup.cpp
+++ b/WebCore/platform/qt/QtAbstractWebPopup.cpp
@@ -48,6 +48,28 @@
     m_popupClient->valueChanged(index);
 }
 
+void QtAbstractWebPopup::selectItem(int index, bool allowMultiplySelections, bool shift)
+{
+#if ENABLE(NO_LISTBOX_RENDERING)
+    ListPopupMenuClient* client = static_cast<ListPopupMenuClient*>(m_popupClient);
+    if (client) {
+        client->listBoxSelectItem(index, allowMultiplySelections, shift);
+        return;
+    }
+#endif
+    valueChanged(index);
+}
+
+bool QtAbstractWebPopup::multiple()
+{
+#if ENABLE(NO_LISTBOX_RENDERING)
+    ListPopupMenuClient* client = static_cast<ListPopupMenuClient*>(m_popupClient);
+    return client && client->multiple();
+#else
+    return false;
+#endif
+}
+
 QtAbstractWebPopup::ItemType QtAbstractWebPopup::itemType(int idx) const
 {
     if (m_popupClient->itemIsSeparator(idx))
diff --git a/WebCore/platform/qt/QtAbstractWebPopup.h b/WebCore/platform/qt/QtAbstractWebPopup.h
index 93b4122..dad4997 100644
--- a/WebCore/platform/qt/QtAbstractWebPopup.h
+++ b/WebCore/platform/qt/QtAbstractWebPopup.h
@@ -40,6 +40,8 @@
     QString itemToolTip(int idx) const { return m_popupClient->itemToolTip(idx); }
     bool itemIsEnabled(int idx) const { return m_popupClient->itemIsEnabled(idx); }
     int itemCount() const { return m_popupClient->listSize(); }
+    bool itemIsSelected(int idx) const { return m_popupClient->itemIsSelected(idx); }
+
 
     QWebPageClient* pageClient() const { return m_pageClient; }
     QRect geometry() const { return m_geometry; }
@@ -54,6 +56,10 @@
     void popupDidHide();
     void valueChanged(int index);
 
+    void selectItem(int index, bool allowMultiplySelections, bool shift);
+    bool multiple();
+
+
     QFont font() { return m_popupClient->menuStyle().font().font(); }
 
 private:
diff --git a/WebCore/platform/qt/QtStyleOptionWebComboBox.h b/WebCore/platform/qt/QtStyleOptionWebComboBox.h
new file mode 100644
index 0000000..29c8220
--- /dev/null
+++ b/WebCore/platform/qt/QtStyleOptionWebComboBox.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 QtStyleOptionWebComboBox_h
+#define QtStyleOptionWebComboBox_h
+
+#include "HTMLSelectElement.h"
+#include "RenderObject.h"
+
+#include <QStyleOption>
+
+namespace WebCore {
+
+class RenderObject;
+
+class QtStyleOptionWebComboBox : public QStyleOptionComboBox {
+public:
+    QtStyleOptionWebComboBox(RenderObject* o)
+        : QStyleOptionComboBox()
+    #if ENABLE(NO_LISTBOX_RENDERING)
+        , m_multiple(checkMultiple(o))
+    #else
+        , m_multiple(false)
+    #endif
+    {
+    }
+
+    bool multiple() const { return m_multiple; }
+
+private:
+    bool m_multiple;
+
+    bool checkMultiple(RenderObject* o)
+    {
+        HTMLSelectElement* select = o ? static_cast<HTMLSelectElement*>(o->node()) : 0;
+        return select ? select->multiple() : false;
+    }
+};
+
+}
+
+#endif // QtStyleOptionWebComboBox_h
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 271c11a..9cc32ad 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -39,18 +39,28 @@
 #include "Font.h"
 #include "FontSelector.h"
 #include "GraphicsContext.h"
+#include "HTMLInputElement.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
+#ifdef Q_WS_MAEMO_5
+#include "Maemo5Webstyle.h"
+#endif
 #include "NotImplemented.h"
 #include "Page.h"
+#include "QtStyleOptionWebComboBox.h"
 #include "QWebPageClient.h"
 #include "RenderBox.h"
+#if ENABLE(PROGRESS_TAG)
+#include "RenderProgress.h"
+#endif
 #include "RenderSlider.h"
 #include "RenderTheme.h"
+#include "TimeRanges.h"
 #include "ScrollbarThemeQt.h"
 #include "UserAgentStyleSheets.h"
 #include "qwebpage.h"
 
+
 #include <QApplication>
 #include <QColor>
 #include <QDebug>
@@ -61,6 +71,9 @@
 #include <QStyleFactory>
 #include <QStyleOptionButton>
 #include <QStyleOptionFrameV2>
+#if ENABLE(PROGRESS_TAG)
+#include <QStyleOptionProgressBarV2>
+#endif
 #include <QStyleOptionSlider>
 #include <QWidget>
 
@@ -129,6 +142,7 @@
 RenderThemeQt::RenderThemeQt(Page* page)
     : RenderTheme()
     , m_page(page)
+    , m_lineEdit(0)
 {
     QPushButton button;
     button.setAttribute(Qt::WA_MacSmallSize);
@@ -139,14 +153,43 @@
     m_buttonFontPixelSize = fontInfo.pixelSize();
 #endif
 
+#ifdef Q_WS_MAEMO_5
+    m_fallbackStyle = new Maemo5WebStyle;
+#else
     m_fallbackStyle = QStyleFactory::create(QLatin1String("windows"));
+#endif
 }
 
 RenderThemeQt::~RenderThemeQt()
 {
     delete m_fallbackStyle;
+    delete m_lineEdit;
 }
 
+#ifdef Q_WS_MAEMO_5
+bool RenderThemeQt::isControlStyled(const RenderStyle* style, const BorderData& border, const FillLayer& fill, const Color& backgroundColor) const
+{
+    switch (style->appearance()) {
+    case PushButtonPart:
+    case ButtonPart:
+    case MenulistPart:
+    case TextFieldPart:
+    case TextAreaPart:
+        return true;
+    case CheckboxPart:
+    case RadioPart:
+        return false;
+    default:
+        return RenderTheme::isControlStyled(style, border, fill, backgroundColor);
+    }
+}
+
+int RenderThemeQt::popupInternalPaddingBottom(RenderStyle* style) const
+{
+    return 1;
+}
+#endif
+
 // for some widget painting, we need to fallback to Windows style
 QStyle* RenderThemeQt::fallbackStyle() const
 {
@@ -169,6 +212,18 @@
     return QApplication::style();
 }
 
+String RenderThemeQt::extraDefaultStyleSheet()
+{
+    String result = RenderTheme::extraDefaultStyleSheet();
+#if ENABLE(NO_LISTBOX_RENDERING)
+    result += String(themeQtNoListboxesUserAgentStyleSheet, sizeof(themeQtNoListboxesUserAgentStyleSheet));
+#endif
+#ifdef Q_WS_MAEMO_5
+    result += String(themeQtMaemo5UserAgentStyleSheet, sizeof(themeQtMaemo5UserAgentStyleSheet));
+#endif
+    return result;
+}
+
 bool RenderThemeQt::supportsHover(const RenderStyle*) const
 {
     return true;
@@ -207,11 +262,13 @@
     return true;
 }
 
-static int findFrameLineWidth(QStyle* style)
+int RenderThemeQt::findFrameLineWidth(QStyle* style) const
 {
-    QLineEdit lineEdit;
+    if (!m_lineEdit)
+        m_lineEdit = new QLineEdit();
+
     QStyleOptionFrameV2 opt;
-    return style->pixelMetric(QStyle::PM_DefaultFrameWidth, &opt, &lineEdit);
+    return style->pixelMetric(QStyle::PM_DefaultFrameWidth, &opt, m_lineEdit);
 }
 
 static QRect inflateButtonRect(const QRect& originalRect, QStyle* style)
@@ -289,15 +346,30 @@
 
 void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const
 {
-    // If the width and height are both specified, then we have nothing to do.
-    if (!renderStyle->width().isIntrinsicOrAuto() && !renderStyle->height().isAuto())
-        return;
-
     QSize size(0, 0);
     const QFontMetrics fm(renderStyle->font().font());
     QStyle* style = qStyle();
 
     switch (renderStyle->appearance()) {
+    case TextAreaPart:
+    case TextFieldPart: {
+        int padding = findFrameLineWidth(style);
+
+        renderStyle->setPaddingLeft(Length(padding, Fixed));
+        renderStyle->setPaddingRight(Length(padding, Fixed));
+        renderStyle->setPaddingTop(Length(padding, Fixed));
+        renderStyle->setPaddingBottom(Length(padding, Fixed));
+        break;
+    }
+    default:
+        break;
+    }
+
+    // If the width and height are both specified, then we have nothing to do.
+    if (!renderStyle->width().isIntrinsicOrAuto() && !renderStyle->height().isAuto())
+        return;
+
+    switch (renderStyle->appearance()) {
     case CheckboxPart: {
         QStyleOption styleOption;
         styleOption.state |= QStyle::State_Small;
@@ -341,23 +413,6 @@
         size.setHeight(menuListSize.height());
         break;
     }
-    case TextFieldPart: {
-        const int verticalMargin = 1;
-        const int horizontalMargin = 2;
-        int h = qMax(fm.lineSpacing(), 14) + 2*verticalMargin;
-        int w = fm.width(QLatin1Char('x')) * 17 + 2*horizontalMargin;
-        QStyleOptionFrameV2 opt;
-        opt.lineWidth = findFrameLineWidth(style);
-        QSize sz = style->sizeFromContents(QStyle::CT_LineEdit,
-                                           &opt,
-                                           QSize(w, h).expandedTo(QApplication::globalStrut()),
-                                           0);
-        size.setHeight(sz.height());
-
-        renderStyle->setPaddingLeft(Length(opt.lineWidth, Fixed));
-        renderStyle->setPaddingRight(Length(opt.lineWidth, Fixed));
-        break;
-    }
     default:
         break;
     }
@@ -576,7 +631,7 @@
     if (!p.isValid())
         return true;
 
-    QStyleOptionComboBox opt;
+    QtStyleOptionWebComboBox opt(o);
     if (p.widget)
         opt.initFrom(p.widget);
     initializeCommonQStyleOptions(opt, o);
@@ -593,9 +648,11 @@
 
 void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
 {
+#ifndef Q_WS_MAEMO_5
     // WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here
     // see also http://bugs.webkit.org/show_bug.cgi?id=18399
     style->resetBorderRadius();
+#endif
 
     // Height is locked to auto.
     style->setHeight(Length(Auto));
@@ -616,7 +673,7 @@
     if (!p.isValid())
         return true;
 
-    QStyleOptionComboBox option;
+    QtStyleOptionWebComboBox option(o);
     if (p.widget)
         option.initFrom(p.widget);
     initializeCommonQStyleOptions(option, o);
@@ -630,6 +687,75 @@
     return false;
 }
 
+#if ENABLE(PROGRESS_TAG)
+double RenderThemeQt::animationRepeatIntervalForProgressBar(RenderProgress* renderProgress) const
+{
+    if (renderProgress->position() >= 0)
+        return 0;
+
+    // FIXME: Use hard-coded value until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed.
+    // Use the value from windows style which is 10 fps.
+    return 0.1;
+}
+
+double RenderThemeQt::animationDurationForProgressBar(RenderProgress* renderProgress) const
+{
+    if (renderProgress->position() >= 0)
+        return 0;
+
+    QStyleOptionProgressBarV2 option;
+    option.rect.setSize(renderProgress->size());
+    // FIXME: Until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed,
+    // we simulate one square animating across the progress bar.
+    return (option.rect.width() / qStyle()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &option)) * animationRepeatIntervalForProgressBar(renderProgress);
+}
+
+void RenderThemeQt::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+{
+    style->setBoxShadow(0);
+}
+
+bool RenderThemeQt::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& pi, const IntRect& r)
+{
+    StylePainter p(this, pi);
+    if (!p.isValid())
+       return true;
+
+    QStyleOptionProgressBarV2 option;
+    if (p.widget)
+       option.initFrom(p.widget);
+    initializeCommonQStyleOptions(option, o);
+
+    RenderProgress* renderProgress = toRenderProgress(o);
+    option.rect = r;
+    option.maximum = std::numeric_limits<int>::max();
+    option.minimum = 0;
+    option.progress = (renderProgress->position() * std::numeric_limits<int>::max());
+
+    const QPoint topLeft = r.topLeft();
+    p.painter->translate(topLeft);
+    option.rect.moveTo(QPoint(0, 0));
+    option.rect.setSize(r.size());
+
+    if (option.progress < 0) {
+        // FIXME: Until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed,
+        // we simulate one square animating across the progress bar.
+        p.drawControl(QStyle::CE_ProgressBarGroove, option);
+        int chunkWidth = qStyle()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &option);
+        QColor color = (option.palette.highlight() == option.palette.background()) ? option.palette.color(QPalette::Active, QPalette::Highlight) : option.palette.color(QPalette::Highlight);
+        if (renderProgress->style()->direction() == RTL)
+            p.painter->fillRect(option.rect.right() - chunkWidth  - renderProgress->animationProgress() * option.rect.width(), 0, chunkWidth, option.rect.height(), color);
+        else
+            p.painter->fillRect(renderProgress->animationProgress() * option.rect.width(), 0, chunkWidth, option.rect.height(), color);
+    } else
+        p.drawControl(QStyle::CE_ProgressBar, option);
+
+    p.painter->translate(-topLeft);
+
+    return false;
+}
+#endif
+
 bool RenderThemeQt::paintSliderTrack(RenderObject* o, const RenderObject::PaintInfo& pi,
                                      const IntRect& r)
 {
@@ -882,10 +1008,15 @@
     return static_cast<HTMLMediaElement*>(mediaNode);
 }
 
+double RenderThemeQt::mediaControlsBaselineOpacity() const
+{
+    return 0.4;
+}
+
 void RenderThemeQt::paintMediaBackground(QPainter* painter, const IntRect& r) const
 {
     painter->setPen(Qt::NoPen);
-    static QColor transparentBlack(0, 0, 0, 100);
+    static QColor transparentBlack(0, 0, 0, mediaControlsBaselineOpacity() * 255);
     painter->setBrush(transparentBlack);
     painter->drawRoundedRect(r.x(), r.y(), r.width(), r.height(), 5.0, 5.0);
 }
@@ -921,14 +1052,9 @@
     const QPointF speakerPolygon[6] = { QPointF(20, 30), QPointF(50, 30), QPointF(80, 0),
             QPointF(80, 100), QPointF(50, 70), QPointF(20, 70)};
 
-    p.painter->setBrush(getMediaControlForegroundColor(o));
+    p.painter->setBrush(mediaElement->muted() ? Qt::darkRed : getMediaControlForegroundColor(o));
     p.painter->drawPolygon(speakerPolygon, 6);
 
-    if (mediaElement->muted()) {
-        p.painter->setPen(Qt::red);
-        p.painter->drawLine(0, 100, 100, 0);
-    }
-
     return false;
 }
 
@@ -971,6 +1097,86 @@
     return false;
 }
 
+bool RenderThemeQt::paintMediaCurrentTime(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+    StylePainter p(this, paintInfo);
+    if (!p.isValid())
+        return true;
+
+    p.painter->setRenderHint(QPainter::Antialiasing, true);
+    paintMediaBackground(p.painter, r);
+
+    return false;
+}
+
+String RenderThemeQt::formatMediaControlsCurrentTime(float currentTime, float duration) const
+{
+    return formatMediaControlsTime(currentTime) + " / " + formatMediaControlsTime(duration);
+}
+
+String RenderThemeQt::formatMediaControlsRemainingTime(float currentTime, float duration) const
+{
+    return String();
+}
+
+bool RenderThemeQt::paintMediaVolumeSliderTrack(RenderObject *o, const RenderObject::PaintInfo &paintInfo, const IntRect &r)
+{
+    StylePainter p(this, paintInfo);
+    if (!p.isValid())
+        return true;
+
+    p.painter->setRenderHint(QPainter::Antialiasing, true);
+
+    paintMediaBackground(p.painter, r);
+
+    if (!o->isSlider())
+        return false;
+
+    IntRect b = toRenderBox(o)->contentBoxRect();
+
+    // Position the outer rectangle
+    int top = r.y() + b.y();
+    int left = r.x() + b.x();
+    int width = b.width();
+    int height = b.height();
+
+    // Get the scale color from the page client
+    QPalette pal = QApplication::palette();
+    setPaletteFromPageClientIfExists(pal);
+    const QColor highlightText = pal.brush(QPalette::Active, QPalette::HighlightedText).color();
+    const QColor scaleColor(highlightText.red(), highlightText.green(), highlightText.blue(), mediaControlsBaselineOpacity() * 255);
+
+    // Draw the outer rectangle
+    p.painter->setBrush(scaleColor);
+    p.painter->drawRect(left, top, width, height);
+
+    if (!o->node() || !o->node()->hasTagName(inputTag))
+        return false;
+
+    HTMLInputElement* slider = static_cast<HTMLInputElement*>(o->node());
+
+    // Position the inner rectangle
+    height = height * slider->valueAsNumber();
+    top += b.height() - height;
+
+    // Draw the inner rectangle
+    p.painter->setPen(Qt::NoPen);
+    p.painter->setBrush(getMediaControlForegroundColor(o));
+    p.painter->drawRect(left, top, width, height);
+
+    return false;
+}
+
+bool RenderThemeQt::paintMediaVolumeSliderThumb(RenderObject *o, const RenderObject::PaintInfo &paintInfo, const IntRect &r)
+{
+    StylePainter p(this, paintInfo);
+    if (!p.isValid())
+        return true;
+
+    // Nothing to draw here, this is all done in the track
+    return false;
+}
+
 bool RenderThemeQt::paintMediaSliderTrack(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
     HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(o);
@@ -985,15 +1191,31 @@
 
     paintMediaBackground(p.painter, r);
 
+#if QT_VERSION >= 0x040700
+    if (MediaPlayer* player = mediaElement->player()) {
+        // Get the buffered parts of the media
+        PassRefPtr<TimeRanges> buffered = player->buffered();
+        if (buffered->length() > 0 && player->duration() < std::numeric_limits<float>::infinity()) {
+            // Set the transform and brush
+            WorldMatrixTransformer transformer(p.painter, o, r);
+            p.painter->setBrush(getMediaControlForegroundColor());
+
+            // Paint each buffered section
+            ExceptionCode ex;
+            for (int i = 0; i < buffered->length(); i++) {
+                float startX = (buffered->start(i, ex) / player->duration()) * 100;
+                float width = ((buffered->end(i, ex) / player->duration()) * 100) - startX;
+                p.painter->drawRect(startX, 37, width, 26);
+            }
+        }
+    }
+#endif
+
     return false;
 }
 
 bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
-    HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(o->parent());
-    if (!mediaElement)
-        return false;
-
     StylePainter p(this, paintInfo);
     if (!p.isValid())
         return true;
@@ -1019,6 +1241,13 @@
         int parentHeight = parentStyle->height().value();
         o->style()->setWidth(Length(parentHeight / 3, Fixed));
         o->style()->setHeight(Length(parentHeight, Fixed));
+    } else if (part == MediaVolumeSliderThumbPart) {
+        RenderStyle* parentStyle = o->parent()->style();
+        Q_ASSERT(parentStyle);
+
+        int parentWidth = parentStyle->width().value();
+        o->style()->setHeight(Length(parentWidth / 3, Fixed));
+        o->style()->setWidth(Length(parentWidth, Fixed));
     } else if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
         QStyleOptionSlider option;
         if (part == SliderThumbVerticalPart)
diff --git a/WebCore/platform/qt/RenderThemeQt.h b/WebCore/platform/qt/RenderThemeQt.h
index 5385881..c10659a 100644
--- a/WebCore/platform/qt/RenderThemeQt.h
+++ b/WebCore/platform/qt/RenderThemeQt.h
@@ -27,12 +27,16 @@
 #include <QStyle>
 
 QT_BEGIN_NAMESPACE
+class QLineEdit;
 class QPainter;
 class QWidget;
 QT_END_NAMESPACE
 
 namespace WebCore {
 
+#if ENABLE(PROGRESS_TAG)
+class RenderProgress;
+#endif
 class RenderStyle;
 class HTMLMediaElement;
 class ScrollbarThemeQt;
@@ -45,6 +49,8 @@
 public:
     static PassRefPtr<RenderTheme> create(Page*);
 
+    String extraDefaultStyleSheet();
+
     virtual bool supportsHover(const RenderStyle*) const;
     virtual bool supportsFocusRing(const RenderStyle* style) const;
 
@@ -72,6 +78,11 @@
 
     virtual double caretBlinkInterval() const;
 
+#ifdef Q_WS_MAEMO_5
+    virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
+    virtual int popupInternalPaddingBottom(RenderStyle*) const;
+#endif
+
 #if ENABLE(VIDEO)
     virtual String extraMediaControlsStyleSheet();
 #endif
@@ -101,6 +112,11 @@
     virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
+#if ENABLE(PROGRESS_TAG)
+    virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintProgressBar(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+#endif
+
     virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
@@ -119,6 +135,13 @@
     virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
 
+#if ENABLE(PROGRESS_TAG)
+    // Returns the repeat interval of the animation for the progress bar.
+    virtual double animationRepeatIntervalForProgressBar(RenderProgress* renderProgress) const;
+    // Returns the duration of the animation for the progress bar.
+    virtual double animationDurationForProgressBar(RenderProgress* renderProgress) const;
+#endif
+
 #if ENABLE(VIDEO)
     virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
@@ -127,10 +150,15 @@
     virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
-
+    virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
+    virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
 private:
     HTMLMediaElement* getMediaElementFromRenderObject(RenderObject* o) const;
     void paintMediaBackground(QPainter* painter, const IntRect& r) const;
+    double mediaControlsBaselineOpacity() const;
     QColor getMediaControlForegroundColor(RenderObject* o = 0) const;
 #endif
     void computeSizeBasedOnStyle(RenderStyle* renderStyle) const;
@@ -145,6 +173,8 @@
 
     void setPaletteFromPageClientIfExists(QPalette&) const;
 
+    int findFrameLineWidth(QStyle* style) const;
+
     QStyle* fallbackStyle() const;
 
     Page* m_page;
@@ -155,6 +185,7 @@
     QString m_buttonFontFamily;
 
     QStyle* m_fallbackStyle;
+    mutable QLineEdit* m_lineEdit;
 };
 
 class StylePainter {
diff --git a/WebCore/platform/qt/ScrollbarThemeQt.cpp b/WebCore/platform/qt/ScrollbarThemeQt.cpp
index c0c80ba..04a2b1b 100644
--- a/WebCore/platform/qt/ScrollbarThemeQt.cpp
+++ b/WebCore/platform/qt/ScrollbarThemeQt.cpp
@@ -233,9 +233,6 @@
        return;
     }
 
-#if QT_VERSION < 0x040500
-    context->fillRect(rect, QApplication::palette().color(QPalette::Normal, QPalette::Window), DeviceColorSpace);
-#else
     StylePainter p(this, context);
     if (!p.isValid())
         return;
@@ -243,7 +240,6 @@
     QStyleOption option;
     option.rect = rect;
     p.drawPrimitive(QStyle::PE_PanelScrollAreaCorner, option);
-#endif
 }
 
 QStyle* ScrollbarThemeQt::style() const
diff --git a/WebCore/platform/qt/SharedTimerQt.cpp b/WebCore/platform/qt/SharedTimerQt.cpp
index e9bcaee..7c0fd05 100644
--- a/WebCore/platform/qt/SharedTimerQt.cpp
+++ b/WebCore/platform/qt/SharedTimerQt.cpp
@@ -40,6 +40,8 @@
 namespace WebCore {
 
 class SharedTimerQt : public QObject {
+    Q_OBJECT
+
     friend void setSharedTimerFiredFunction(void (*f)());
 public:
     static SharedTimerQt* inst();
@@ -50,15 +52,18 @@
 protected:
     void timerEvent(QTimerEvent* ev);
 
+private slots:
+    void destroy();
+
 private:
-    SharedTimerQt(QObject* parent);
+    SharedTimerQt();
     ~SharedTimerQt();
     QBasicTimer m_timer;
     void (*m_timerFunction)();
 };
 
-SharedTimerQt::SharedTimerQt(QObject* parent)
-    : QObject(parent)
+SharedTimerQt::SharedTimerQt()
+    : QObject()
     , m_timerFunction(0)
 {}
 
@@ -68,11 +73,18 @@
         (m_timerFunction)();
 }
 
+void SharedTimerQt::destroy()
+{
+    delete this;
+}
+
 SharedTimerQt* SharedTimerQt::inst()
 {
     static QPointer<SharedTimerQt> timer;
-    if (!timer)
-        timer = new SharedTimerQt(QCoreApplication::instance());
+    if (!timer) {
+        timer = new SharedTimerQt();
+        timer->connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(destroy()));
+    }
 
     return timer;
 }
@@ -129,6 +141,8 @@
     SharedTimerQt::inst()->stop();
 }
 
+#include "SharedTimerQt.moc"
+
 }
 
 // vim: ts=4 sw=4 et
diff --git a/WebCore/platform/qt/TemporaryLinkStubs.cpp b/WebCore/platform/qt/TemporaryLinkStubs.cpp
index 814f961..432bd2b 100644
--- a/WebCore/platform/qt/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/qt/TemporaryLinkStubs.cpp
@@ -34,7 +34,6 @@
 
 #include "AXObjectCache.h"
 #include "DNS.h"
-#include "CString.h"
 #include "CachedResource.h"
 #include "CookieJar.h"
 #include "Cursor.h"
@@ -71,6 +70,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <float.h>
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index faaf5de..58fdc7c 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -48,6 +48,7 @@
     : m_db(0)
     , m_pageSize(-1)
     , m_transactionInProgress(false)
+    , m_sharable(false)
     , m_openingThread(0)
 {
 }
@@ -57,11 +58,11 @@
     close();
 }
 
-bool SQLiteDatabase::open(const String& filename)
+bool SQLiteDatabase::open(const String& filename, bool forWebSQLDatabase)
 {
     close();
-    
-    m_lastError = SQLiteFileSystem::openDatabase(filename, &m_db);
+
+    m_lastError = SQLiteFileSystem::openDatabase(filename, &m_db, forWebSQLDatabase);
     if (m_lastError != SQLITE_OK) {
         LOG_ERROR("SQLite database failed to load from %s\nCause - %s", filename.ascii().data(),
             sqlite3_errmsg(m_db));
@@ -72,7 +73,7 @@
 
     if (isOpen())
         m_openingThread = currentThread();
-    
+
     if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;").executeCommand())
         LOG_ERROR("SQLite database could not set temp_store to memory");
 
@@ -252,6 +253,18 @@
     return sqlite3_errmsg(m_db);
 }
 
+#ifndef NDEBUG
+void SQLiteDatabase::disableThreadingChecks()
+{
+    // This doesn't guarantee that SQList was compiled with -DTHREADSAFE, or that you haven't turned off the mutexes.
+#if SQLITE_VERSION_NUMBER >= 3003001
+    m_sharable = true;
+#else
+    ASSERT(0); // Your SQLite doesn't support sharing handles across threads.
+#endif
+}
+#endif
+
 int SQLiteDatabase::authorizerFunction(void* userData, int actionCode, const char* parameter1, const char* parameter2, const char* /*databaseName*/, const char* /*trigger_or_view*/)
 {
     DatabaseAuthorizer* auth = static_cast<DatabaseAuthorizer*>(userData);
diff --git a/WebCore/platform/sql/SQLiteDatabase.h b/WebCore/platform/sql/SQLiteDatabase.h
index a3e9852..bc58a32 100644
--- a/WebCore/platform/sql/SQLiteDatabase.h
+++ b/WebCore/platform/sql/SQLiteDatabase.h
@@ -55,7 +55,7 @@
     SQLiteDatabase();
     ~SQLiteDatabase();
 
-    bool open(const String& filename);
+    bool open(const String& filename, bool forWebSQLDatabase = false);
     bool isOpen() const { return m_db; }
     void close();
 
@@ -97,7 +97,7 @@
     const char* lastErrorMsg();
     
     sqlite3* sqlite3Handle() const {
-        ASSERT(currentThread() == m_openingThread);
+        ASSERT(m_sharable || currentThread() == m_openingThread);
         return m_db;
     }
     
@@ -108,6 +108,14 @@
     void unlock();
     bool isAutoCommitOn() const;
 
+    // Set this flag to allow access from multiple threads.  Not all multi-threaded accesses are safe!
+    // See http://www.sqlite.org/cvstrac/wiki?p=MultiThreading for more info.
+#ifndef NDEBUG
+    void disableThreadingChecks();
+#else
+    void disableThreadingChecks() {}
+#endif
+
 private:
     static int authorizerFunction(void*, int, const char*, const char*, const char*, const char*);
 
@@ -120,6 +128,7 @@
     int m_pageSize;
     
     bool m_transactionInProgress;
+    bool m_sharable;
     
     Mutex m_authorizerLock;
     RefPtr<DatabaseAuthorizer> m_authorizer;
diff --git a/WebCore/platform/sql/SQLiteFileSystem.cpp b/WebCore/platform/sql/SQLiteFileSystem.cpp
index 8cd7e80..c9583eb 100644
--- a/WebCore/platform/sql/SQLiteFileSystem.cpp
+++ b/WebCore/platform/sql/SQLiteFileSystem.cpp
@@ -46,7 +46,7 @@
 {
 }
 
-int SQLiteFileSystem::openDatabase(const String& fileName, sqlite3** database)
+int SQLiteFileSystem::openDatabase(const String& fileName, sqlite3** database, bool)
 {
     // SQLite expects a null terminator on its UTF-16 strings.
     String path = fileName;
diff --git a/WebCore/platform/sql/SQLiteFileSystem.h b/WebCore/platform/sql/SQLiteFileSystem.h
index 0a26e9d..f25d01d 100644
--- a/WebCore/platform/sql/SQLiteFileSystem.h
+++ b/WebCore/platform/sql/SQLiteFileSystem.h
@@ -52,7 +52,10 @@
     // fileName - The name of the database file.
     // database - The SQLite structure that represents the database stored
     //            in the given file.
-    static int openDatabase(const String& fileName, sqlite3** database);
+    // forWebSQLDatabase - True, if and only if we're opening a Web SQL Database file.
+    //                     Used by Chromium to determine if the DB file needs to be opened
+    //                     using a custom VFS.
+    static int openDatabase(const String& fileName, sqlite3** database, bool forWebSQLDatabase);
 
     // Returns the file name for a database.
     //
diff --git a/WebCore/platform/sql/SQLiteStatement.cpp b/WebCore/platform/sql/SQLiteStatement.cpp
index ac96034..8963adb 100644
--- a/WebCore/platform/sql/SQLiteStatement.cpp
+++ b/WebCore/platform/sql/SQLiteStatement.cpp
@@ -63,9 +63,13 @@
     ASSERT(!m_isPrepared);
     const void* tail;
     LOG(SQLDatabase, "SQL - prepare - %s", m_query.ascii().data());
-    int error = sqlite3_prepare16_v2(m_database.sqlite3Handle(), m_query.charactersWithNullTermination(), -1, &m_statement, &tail);
+    String strippedQuery = m_query.stripWhiteSpace();
+    int error = sqlite3_prepare16_v2(m_database.sqlite3Handle(), strippedQuery.charactersWithNullTermination(), -1, &m_statement, &tail);
     if (error != SQLITE_OK)
         LOG(SQLDatabase, "sqlite3_prepare16 failed (%i)\n%s\n%s", error, m_query.ascii().data(), sqlite3_errmsg(m_database.sqlite3Handle()));
+    const UChar* ch = static_cast<const UChar*>(tail);
+    if (*ch)
+        error = SQLITE_ERROR;
 #ifndef NDEBUG
     m_isPrepared = error == SQLITE_OK;
 #endif
diff --git a/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp b/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp
index 752c613..0a09888 100644
--- a/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp
+++ b/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp
@@ -32,13 +32,9 @@
 #include "SQLiteFileSystem.h"
 
 #include "ChromiumBridge.h"
-#include "CString.h"
 #include "SQLiteDatabase.h"
 #include <sqlite3.h>
-
-#ifndef SQLITE_OPEN_FULLMUTEX
-#define SQLITE_OPEN_FULLMUTEX 0x00010000
-#endif
+#include <wtf/text/CString.h>
 
 // SQLiteFileSystem::registerSQLiteVFS() is implemented in the
 // platform-specific files SQLiteFileSystemChromium{Win|Posix}.cpp
@@ -48,54 +44,50 @@
 {
 }
 
-int SQLiteFileSystem::openDatabase(const String& fileName, sqlite3** database)
+int SQLiteFileSystem::openDatabase(const String& fileName, sqlite3** database, bool forWebSQLDatabase)
 {
-    if (!ChromiumBridge::sandboxEnabled()) {
+    if (!forWebSQLDatabase) {
         String path = fileName;
         return sqlite3_open16(path.charactersWithNullTermination(), database);
     }
 
-    // open databases using the default VFS
-    // in renderers, it should be Chromium's VFS; in the browser process it should be SQLite's default VFS
-    return sqlite3_open_v2(fileName.utf8().data(), database,
-                           SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX,
-                           "chromium_vfs");
+    return sqlite3_open_v2(fileName.utf8().data(), database, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, "chromium_vfs");
 }
 
 String SQLiteFileSystem::getFileNameForNewDatabase(
   const String&, const String& dbName, const String &originIdentifier, SQLiteDatabase*)
 {
-    // Chromium names DB files based on origin and DB name only
-    return originIdentifier + "_" + dbName + ".db";
+    // Not used by Chromium's DatabaseTracker implementation
+    ASSERT_NOT_REACHED();
+    return String();
 }
 
 String SQLiteFileSystem::appendDatabaseFileNameToPath(const String&, const String& fileName)
 {
-    // Chromium saves all DB files in the same directory (known by
-    // the browser process only); as far as the renderer processes
-    // are concerned, all DB files are saved in the "current" directory
-    return fileName;
+    // Not used by Chromium's DatabaseTracker implementation
+    ASSERT_NOT_REACHED();
+    return String();
 }
 
 bool SQLiteFileSystem::ensureDatabaseDirectoryExists(const String&)
 {
-    // if the directory where Chromium stores the databases does not exist,
-    // it will be automatically created by the browser process;
-    // so as far as the WebKit code is concerned, this directory always exists
-    return true;
+    // Not used by Chromium's DatabaseTracker implementation
+    ASSERT_NOT_REACHED();
+    return false;
 }
 
 bool SQLiteFileSystem::ensureDatabaseFileExists(const String&, bool)
 {
-    // all database directories will be created as needed by the browser process
-    return true;
+    // Not used by Chromium's DatabaseTracker implementation
+    ASSERT_NOT_REACHED();
+    return false;
 }
 
 bool SQLiteFileSystem::deleteEmptyDatabaseDirectory(const String&)
 {
-    // Chromium does not use a separate directory for each database,
-    // so there's nothing to do here
-    return true;
+    // Not used by Chromium's DatabaseTracker implementation
+    ASSERT_NOT_REACHED();
+    return false;
 }
 
 bool SQLiteFileSystem::deleteDatabaseFile(const String& fileName)
diff --git a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
index 0050a43..f8ede69 100644
--- a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
+++ b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp
@@ -173,12 +173,6 @@
 
 void SQLiteFileSystem::registerSQLiteVFS()
 {
-    // FIXME: Make sure there aren't any unintended consequences when VFS code is called in the browser process.
-    if (!ChromiumBridge::sandboxEnabled()) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
     sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix");
     static sqlite3_vfs chromium_vfs = {
         1,
diff --git a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp
index 7b57db1..d846af7 100644
--- a/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp
+++ b/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp
@@ -142,12 +142,6 @@
 
 void SQLiteFileSystem::registerSQLiteVFS()
 {
-    // FIXME: Make sure there aren't any unintended consequences when VFS code is called in the browser process.
-    if (!ChromiumBridge::sandboxEnabled()) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
     sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32");
     static sqlite3_vfs chromium_vfs = {
         1,
diff --git a/WebCore/platform/text/AtomicString.cpp b/WebCore/platform/text/AtomicString.cpp
deleted file mode 100644
index 19821c0..0000000
--- a/WebCore/platform/text/AtomicString.cpp
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * 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"
-
-#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
-#define ATOMICSTRING_HIDE_GLOBALS 1
-#endif
-
-#include "AtomicString.h"
-
-#include "StaticConstructors.h"
-#include "StringHash.h"
-#include "ThreadGlobalData.h"
-#include <wtf/Threading.h>
-#include <wtf/HashSet.h>
-
-#if USE(JSC)
-#include <runtime/Identifier.h>
-using JSC::Identifier;
-using JSC::UString;
-#endif
-
-namespace WebCore {
-
-static inline HashSet<StringImpl*>& stringTable()
-{
-    return threadGlobalData().atomicStringTable();
-}
-
-struct CStringTranslator {
-    static unsigned hash(const char* c)
-    {
-        return StringImpl::computeHash(c);
-    }
-
-    static bool equal(StringImpl* r, const char* s)
-    {
-        int length = r->length();
-        const UChar* d = r->characters();
-        for (int i = 0; i != length; ++i) {
-            unsigned char c = s[i];
-            if (d[i] != c)
-                return false;
-        }
-        return s[length] == 0;
-    }
-
-    static void translate(StringImpl*& location, const char* const& c, unsigned hash)
-    {
-        location = StringImpl::create(c).releaseRef(); 
-        location->setHash(hash);
-        location->setInTable();
-    }
-};
-
-bool operator==(const AtomicString& a, const char* b)
-{ 
-    StringImpl* impl = a.impl();
-    if ((!impl || !impl->characters()) && !b)
-        return true;
-    if ((!impl || !impl->characters()) || !b)
-        return false;
-    return CStringTranslator::equal(impl, b); 
-}
-
-PassRefPtr<StringImpl> AtomicString::add(const char* c)
-{
-    if (!c)
-        return 0;
-    if (!*c)
-        return StringImpl::empty();    
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<const char*, CStringTranslator>(c);
-    if (!addResult.second)
-        return *addResult.first;
-    return adoptRef(*addResult.first);
-}
-
-struct UCharBuffer {
-    const UChar* s;
-    unsigned length;
-};
-
-static inline bool equal(StringImpl* string, const UChar* characters, unsigned length)
-{
-    if (string->length() != length)
-        return false;
-
-    // FIXME: perhaps we should have a more abstract macro that indicates when
-    // going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4)
-    const UChar* stringCharacters = string->characters();
-    for (unsigned i = 0; i != length; ++i) {
-        if (*stringCharacters++ != *characters++)
-            return false;
-    }
-    return true;
-#else
-    /* Do it 4-bytes-at-a-time on architectures where it's safe */
-
-    const uint32_t* stringCharacters = reinterpret_cast<const uint32_t*>(string->characters());
-    const uint32_t* bufferCharacters = reinterpret_cast<const uint32_t*>(characters);
-
-    unsigned halfLength = length >> 1;
-    for (unsigned i = 0; i != halfLength; ++i) {
-        if (*stringCharacters++ != *bufferCharacters++)
-            return false;
-    }
-
-    if (length & 1 &&  *reinterpret_cast<const uint16_t*>(stringCharacters) != *reinterpret_cast<const uint16_t*>(bufferCharacters))
-        return false;
-
-    return true;
-#endif
-}
-
-struct UCharBufferTranslator {
-    static unsigned hash(const UCharBuffer& buf)
-    {
-        return StringImpl::computeHash(buf.s, buf.length);
-    }
-
-    static bool equal(StringImpl* const& str, const UCharBuffer& buf)
-    {
-        return WebCore::equal(str, buf.s, buf.length);
-    }
-
-    static void translate(StringImpl*& location, const UCharBuffer& buf, unsigned hash)
-    {
-        location = StringImpl::create(buf.s, buf.length).releaseRef(); 
-        location->setHash(hash);
-        location->setInTable();
-    }
-};
-
-struct HashAndCharacters {
-    unsigned hash;
-    const UChar* characters;
-    unsigned length;
-};
-
-struct HashAndCharactersTranslator {
-    static unsigned hash(const HashAndCharacters& buffer)
-    {
-        ASSERT(buffer.hash == StringImpl::computeHash(buffer.characters, buffer.length));
-        return buffer.hash;
-    }
-
-    static bool equal(StringImpl* const& string, const HashAndCharacters& buffer)
-    {
-        return WebCore::equal(string, buffer.characters, buffer.length);
-    }
-
-    static void translate(StringImpl*& location, const HashAndCharacters& buffer, unsigned hash)
-    {
-        location = StringImpl::create(buffer.characters, buffer.length).releaseRef();
-        location->setHash(hash);
-        location->setInTable();
-    }
-};
-
-PassRefPtr<StringImpl> AtomicString::add(const UChar* s, int length)
-{
-    if (!s)
-        return 0;
-
-    if (length == 0)
-        return StringImpl::empty();
-    
-    UCharBuffer buf = { s, length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<UCharBuffer, UCharBufferTranslator>(buf);
-
-    // If the string is newly-translated, then we need to adopt it.
-    // The boolean in the pair tells us if that is so.
-    return addResult.second ? adoptRef(*addResult.first) : *addResult.first;
-}
-
-PassRefPtr<StringImpl> AtomicString::add(const UChar* s)
-{
-    if (!s)
-        return 0;
-
-    int length = 0;
-    while (s[length] != UChar(0))
-        length++;
-
-    if (length == 0)
-        return StringImpl::empty();
-
-    UCharBuffer buf = {s, length}; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<UCharBuffer, UCharBufferTranslator>(buf);
-
-    // If the string is newly-translated, then we need to adopt it.
-    // The boolean in the pair tells us if that is so.
-    return addResult.second ? adoptRef(*addResult.first) : *addResult.first;
-}
-
-PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
-{
-    if (!r || r->inTable())
-        return r;
-
-    if (r->length() == 0)
-        return StringImpl::empty();
-    
-    StringImpl* result = *stringTable().add(r).first;
-    if (result == r)
-        r->setInTable();
-    return result;
-}
-
-void AtomicString::remove(StringImpl* r)
-{
-    stringTable().remove(r);
-}
-    
-AtomicString AtomicString::lower() const
-{
-    // Note: This is a hot function in the Dromaeo benchmark.
-    StringImpl* impl = this->impl();
-    RefPtr<StringImpl> newImpl = impl->lower();
-    if (LIKELY(newImpl == impl))
-        return *this;
-    return AtomicString(newImpl);
-}
-
-#if USE(JSC)
-PassRefPtr<StringImpl> AtomicString::add(const JSC::Identifier& identifier)
-{
-    if (identifier.isNull())
-        return 0;
-
-    UString::Rep* string = identifier.ustring().rep();
-    unsigned length = string->length();
-    if (!length)
-        return StringImpl::empty();
-
-    HashAndCharacters buffer = { string->existingHash(), string->data(), length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
-    if (!addResult.second)
-        return *addResult.first;
-    return adoptRef(*addResult.first);
-}
-
-PassRefPtr<StringImpl> AtomicString::add(const JSC::UString& ustring)
-{
-    if (ustring.isNull())
-        return 0;
-
-    UString::Rep* string = ustring.rep();
-    unsigned length = string->length();
-    if (!length)
-        return StringImpl::empty();
-
-    HashAndCharacters buffer = { string->hash(), string->data(), length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable().add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
-    if (!addResult.second)
-        return *addResult.first;
-    return adoptRef(*addResult.first);
-}
-
-AtomicStringImpl* AtomicString::find(const JSC::Identifier& identifier)
-{
-    if (identifier.isNull())
-        return 0;
-
-    UString::Rep* string = identifier.ustring().rep();
-    unsigned length = string->length();
-    if (!length)
-        return static_cast<AtomicStringImpl*>(StringImpl::empty());
-
-    HashAndCharacters buffer = { string->existingHash(), string->data(), length }; 
-    HashSet<StringImpl*>::iterator iterator = stringTable().find<HashAndCharacters, HashAndCharactersTranslator>(buffer);
-    if (iterator == stringTable().end())
-        return 0;
-    return static_cast<AtomicStringImpl*>(*iterator);
-}
-
-AtomicString::operator UString() const
-{
-    return m_string;
-}
-#endif
-
-DEFINE_GLOBAL(AtomicString, nullAtom)
-DEFINE_GLOBAL(AtomicString, emptyAtom, "")
-DEFINE_GLOBAL(AtomicString, textAtom, "#text")
-DEFINE_GLOBAL(AtomicString, commentAtom, "#comment")
-DEFINE_GLOBAL(AtomicString, starAtom, "*")
-DEFINE_GLOBAL(AtomicString, xmlAtom, "xml")
-DEFINE_GLOBAL(AtomicString, xmlnsAtom, "xmlns")
-
-void AtomicString::init()
-{
-    static bool initialized;
-    if (!initialized) {
-        // Initialization is not thread safe, so this function must be called from the main thread first.
-        ASSERT(isMainThread());
-
-        // Use placement new to initialize the globals.
-        new ((void*)&nullAtom) AtomicString;
-        new ((void*)&emptyAtom) AtomicString("");
-        new ((void*)&textAtom) AtomicString("#text");
-        new ((void*)&commentAtom) AtomicString("#comment");
-        new ((void*)&starAtom) AtomicString("*");
-        new ((void*)&xmlAtom) AtomicString("xml");
-        new ((void*)&xmlnsAtom) AtomicString("xmlns");
-
-        initialized = true;
-    }
-}
-
-}
diff --git a/WebCore/platform/text/AtomicString.h b/WebCore/platform/text/AtomicString.h
index 64a8bfe..6ce63b5 100644
--- a/WebCore/platform/text/AtomicString.h
+++ b/WebCore/platform/text/AtomicString.h
@@ -18,159 +18,10 @@
  *
  */
 
-#ifndef AtomicString_h
-#define AtomicString_h
+#ifndef WebCoreAtomicString_h
+#define WebCoreAtomicString_h
 
-#include "AtomicStringImpl.h"
-#include "PlatformString.h"
-
-// Define 'NO_IMPLICIT_ATOMICSTRING' before including this header,
-// to disallow (expensive) implicit String-->AtomicString conversions.
-#ifdef NO_IMPLICIT_ATOMICSTRING
-#define ATOMICSTRING_CONVERSION explicit
-#else
-#define ATOMICSTRING_CONVERSION
-#endif
-
-namespace WebCore {
-
-struct AtomicStringHash;
-
-class AtomicString {
-public:
-    static void init();
-
-    AtomicString() { }
-    AtomicString(const char* s) : m_string(add(s)) { }
-    AtomicString(const UChar* s, int length) : m_string(add(s, length)) { }
-    AtomicString(const UChar* s) : m_string(add(s)) { }
-#if USE(JSC)
-    AtomicString(const JSC::UString& s) : m_string(add(s)) { }
-    AtomicString(const JSC::Identifier& s) : m_string(add(s)) { }
-#endif
-    ATOMICSTRING_CONVERSION AtomicString(StringImpl* imp) : m_string(add(imp)) { }
-    AtomicString(AtomicStringImpl* imp) : m_string(imp) { }
-    ATOMICSTRING_CONVERSION AtomicString(const String& s) : m_string(add(s.impl())) { }
-
-    // Hash table deleted values, which are only constructed and never copied or destroyed.
-    AtomicString(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { }
-    bool isHashTableDeletedValue() const { return m_string.isHashTableDeletedValue(); }
-
-#if USE(JSC)
-    static AtomicStringImpl* find(const JSC::Identifier&);
-#endif
-
-    operator const String&() const { return m_string; }
-    const String& string() const { return m_string; };
-
-#if USE(JSC)
-    operator JSC::UString() const;
-#endif
-
-    AtomicStringImpl* impl() const { return static_cast<AtomicStringImpl *>(m_string.impl()); }
-    
-    const UChar* characters() const { return m_string.characters(); }
-    unsigned length() const { return m_string.length(); }
-    
-    UChar operator[](unsigned int i) const { return m_string[i]; }
-    
-    bool contains(UChar c) const { return m_string.contains(c); }
-    bool contains(const char* s, bool caseSensitive = true) const
-        { return m_string.contains(s, caseSensitive); }
-    bool contains(const String& s, bool caseSensitive = true) const
-        { return m_string.contains(s, caseSensitive); }
-
-    int find(UChar c, int start = 0) const { return m_string.find(c, start); }
-    int find(const char* s, int start = 0, bool caseSentitive = true) const
-        { return m_string.find(s, start, caseSentitive); }
-    int find(const String& s, int start = 0, bool caseSentitive = true) const
-        { return m_string.find(s, start, caseSentitive); }
-    
-    bool startsWith(const String& s, bool caseSensitive = true) const
-        { return m_string.startsWith(s, caseSensitive); }
-    bool endsWith(const String& s, bool caseSensitive = true) const
-        { return m_string.endsWith(s, caseSensitive); }
-    
-    AtomicString lower() const;
-    AtomicString upper() const { return AtomicString(impl()->upper()); }
-    
-    int toInt(bool* ok = 0) const { return m_string.toInt(ok); }
-    double toDouble(bool* ok = 0) const { return m_string.toDouble(ok); }
-    float toFloat(bool* ok = 0) const { return m_string.toFloat(ok); }
-    bool percentage(int& p) const { return m_string.percentage(p); }
-
-    bool isNull() const { return m_string.isNull(); }
-    bool isEmpty() const { return m_string.isEmpty(); }
-
-    static void remove(StringImpl*);
-    
-#if PLATFORM(CF)
-    AtomicString(CFStringRef s) :  m_string(add(String(s).impl())) { }
-    CFStringRef createCFString() const { return m_string.createCFString(); }
-#endif    
-#ifdef __OBJC__
-    AtomicString(NSString* s) : m_string(add(String(s).impl())) { }
-    operator NSString*() const { return m_string; }
-#endif
-#if PLATFORM(QT)
-    AtomicString(const QString& s) : m_string(add(String(s).impl())) { }
-    operator QString() const { return m_string; }
-#endif
-
-private:
-    String m_string;
-    
-    static PassRefPtr<StringImpl> add(const char*);
-    static PassRefPtr<StringImpl> add(const UChar*, int length);
-    static PassRefPtr<StringImpl> add(const UChar*);
-    static PassRefPtr<StringImpl> add(StringImpl*);
-#if USE(JSC)
-    static PassRefPtr<StringImpl> add(const JSC::UString&);
-    static PassRefPtr<StringImpl> add(const JSC::Identifier&);
-#endif
-};
-
-inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }
-bool operator==(const AtomicString& a, const char* b);
-inline bool operator==(const AtomicString& a, const String& b) { return equal(a.impl(), b.impl()); }
-inline bool operator==(const char* a, const AtomicString& b) { return b == a; }
-inline bool operator==(const String& a, const AtomicString& b) { return equal(a.impl(), b.impl()); }
-
-inline bool operator!=(const AtomicString& a, const AtomicString& b) { return a.impl() != b.impl(); }
-inline bool operator!=(const AtomicString& a, const char *b) { return !(a == b); }
-inline bool operator!=(const AtomicString& a, const String& b) { return !equal(a.impl(), b.impl()); }
-inline bool operator!=(const char* a, const AtomicString& b) { return !(b == a); }
-inline bool operator!=(const String& a, const AtomicString& b) { return !equal(a.impl(), b.impl()); }
-
-inline bool equalIgnoringCase(const AtomicString& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
-inline bool equalIgnoringCase(const AtomicString& a, const char* b) { return equalIgnoringCase(a.impl(), b); }
-inline bool equalIgnoringCase(const AtomicString& a, const String& b) { return equalIgnoringCase(a.impl(), b.impl()); }
-inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equalIgnoringCase(a, b.impl()); }
-inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
-
-// Define external global variables for the commonly used atomic strings.
-// These are only usable from the main thread.
-#ifndef ATOMICSTRING_HIDE_GLOBALS
-    extern const AtomicString nullAtom;
-    extern const AtomicString emptyAtom;
-    extern const AtomicString textAtom;
-    extern const AtomicString commentAtom;
-    extern const AtomicString starAtom;
-    extern const AtomicString xmlAtom;
-    extern const AtomicString xmlnsAtom;
-#endif
-
-} // namespace WebCore
-
-
-namespace WTF {
-
-    // AtomicStringHash is the default hash for AtomicString
-    template<typename T> struct DefaultHash;
-    template<> struct DefaultHash<WebCore::AtomicString> {
-        typedef WebCore::AtomicStringHash Hash;
-    };
-
-} // namespace WTF
+// FIXME: remove this header, use the forward from wtf directly.
+#include <wtf/text/AtomicString.h>
 
 #endif // AtomicString_h
diff --git a/WebCore/platform/text/AtomicStringImpl.h b/WebCore/platform/text/AtomicStringImpl.h
index ba1c72c..64bce77 100644
--- a/WebCore/platform/text/AtomicStringImpl.h
+++ b/WebCore/platform/text/AtomicStringImpl.h
@@ -18,17 +18,10 @@
  *
  */
 
-#ifndef AtomicStringImpl_h
-#define AtomicStringImpl_h
+#ifndef WebCoreAtomicStringImpl_h
+#define WebCoreAtomicStringImpl_h
 
-#include "StringImpl.h"
-
-namespace WebCore {
-
-class AtomicStringImpl : public StringImpl
-{
-};
-
-}
+// FIXME: remove this header, use the forward from wtf directly.
+#include <wtf/text/AtomicStringImpl.h>
 
 #endif
diff --git a/WebCore/platform/text/Base64.cpp b/WebCore/platform/text/Base64.cpp
index 82ec9fa..cc22cf8 100644
--- a/WebCore/platform/text/Base64.cpp
+++ b/WebCore/platform/text/Base64.cpp
@@ -24,8 +24,6 @@
 #include "Base64.h"
 
 #include <limits.h>
-
-#include <wtf/Platform.h>
 #include <wtf/StringExtras.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/text/CString.cpp b/WebCore/platform/text/CString.cpp
deleted file mode 100644
index 25f5fa1..0000000
--- a/WebCore/platform/text/CString.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008, 2009 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 COMPUTER, 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 "CString.h"
-
-using std::min;
-
-namespace WebCore {
-
-CString::CString(const char* str)
-{
-    init(str, strlen(str));
-}
-
-CString::CString(const char* str, unsigned length)
-{
-    init(str, length);
-}
-
-void CString::init(const char* str, unsigned length)
-{
-    if (!str)
-        return;
-    
-    m_buffer = CStringBuffer::create(length + 1);
-    memcpy(m_buffer->mutableData(), str, length); 
-    m_buffer->mutableData()[length] = '\0';
-}
-
-const char* CString::data() const
-{
-    return m_buffer ? m_buffer->data() : 0;
-}
-
-char* CString::mutableData()
-{
-    copyBufferIfNeeded();
-    if (!m_buffer)
-        return 0;
-    return m_buffer->mutableData();
-}
-    
-unsigned CString::length() const
-{
-    return m_buffer ? m_buffer->length() - 1 : 0;
-}
-    
-CString CString::newUninitialized(size_t length, char*& characterBuffer)
-{
-    CString result;
-    result.m_buffer = CStringBuffer::create(length + 1);
-    char* bytes = result.m_buffer->mutableData();
-    bytes[length] = '\0';
-    characterBuffer = bytes;
-    return result;
-}
-
-void CString::copyBufferIfNeeded()
-{
-    if (!m_buffer || m_buffer->hasOneRef())
-        return;
-        
-    int len = m_buffer->length();
-    RefPtr<CStringBuffer> m_temp = m_buffer;
-    m_buffer = CStringBuffer::create(len);
-    memcpy(m_buffer->mutableData(), m_temp->data(), len);
-}
-
-bool operator==(const CString& a, const CString& b)
-{
-    if (a.isNull() != b.isNull())
-        return false;
-    if (a.length() != b.length())
-        return false;
-    return !strncmp(a.data(), b.data(), min(a.length(), b.length()));
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/text/CString.h b/WebCore/platform/text/CString.h
deleted file mode 100644
index b9030d6..0000000
--- a/WebCore/platform/text/CString.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008, 2009 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 COMPUTER, 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 CString_h
-#define CString_h
-
-#include "SharedBuffer.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-    class CStringBuffer : public RefCounted<CStringBuffer> {
-    public:
-        const char* data() { return m_vector.data(); }
-        size_t length() { return m_vector.size(); }
-        
-    private:
-        friend class CString;
-
-        static PassRefPtr<CStringBuffer> create(unsigned length) { return adoptRef(new CStringBuffer(length)); }
-        CStringBuffer(unsigned length) : m_vector(length) { }
-        char* mutableData() { return m_vector.data(); }
-
-        Vector<char> m_vector;
-    };
-
-    // A container for a null-terminated char array supporting copy-on-write
-    // assignment.  The contained char array may be null.
-    class CString {
-    public:
-        CString() { }
-        CString(const char*);
-        CString(const char*, unsigned length);
-        CString(CStringBuffer* buffer) : m_buffer(buffer) { }
-        static CString newUninitialized(size_t length, char*& characterBuffer);
-
-        const char* data() const;
-        char* mutableData();
-        unsigned length() const;
-
-        bool isNull() const { return !m_buffer; }
-
-        CStringBuffer* buffer() const { return m_buffer.get(); }
-
-    private:
-        void copyBufferIfNeeded();
-        void init(const char*, unsigned length);
-        RefPtr<CStringBuffer> m_buffer;
-    };
-
-    bool operator==(const CString& a, const CString& b);
-    inline bool operator!=(const CString& a, const CString& b) { return !(a == b); }
-
-} // namespace WebCore
-
-#endif // CString_h
diff --git a/WebCore/platform/text/PlatformString.h b/WebCore/platform/text/PlatformString.h
index 8a379be..e525bd4 100644
--- a/WebCore/platform/text/PlatformString.h
+++ b/WebCore/platform/text/PlatformString.h
@@ -25,390 +25,21 @@
 // This file would be called String.h, but that conflicts with <string.h>
 // on systems without case-sensitive file systems.
 
-#include "StringImpl.h"
-
-#ifdef __OBJC__
-#include <objc/objc.h>
-#endif
-
-#if PLATFORM(CF)
-typedef const struct __CFString * CFStringRef;
-#endif
-
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QString;
-QT_END_NAMESPACE
-#include <QDataStream>
-#endif
-
-#if PLATFORM(WX)
-class wxString;
-#endif
-
-#if PLATFORM(HAIKU)
-class BString;
-#endif
-
-#if USE(JSC)
-namespace JSC {
-class Identifier;
-class UString;
-}
-#endif
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
-class CString;
 class SharedBuffer;
-struct StringHash;
-
-class String {
-public:
-    String() { } // gives null string, distinguishable from an empty string
-    String(const UChar*, unsigned length);
-    String(const UChar*); // Specifically for null terminated UTF-16
-#if USE(JSC)
-    String(const JSC::Identifier&);
-    String(const JSC::UString&);
-#endif
-    String(const char*);
-    String(const char*, unsigned length);
-    String(StringImpl* i) : m_impl(i) { }
-    String(PassRefPtr<StringImpl> i) : m_impl(i) { }
-    String(RefPtr<StringImpl> i) : m_impl(i) { }
-
-    void swap(String& o) { m_impl.swap(o.m_impl); }
-
-    // Hash table deleted values, which are only constructed and never copied or destroyed.
-    String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
-    bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
-
-    static String adopt(StringBuffer& buffer) { return StringImpl::adopt(buffer); }
-    static String adopt(Vector<UChar>& vector) { return StringImpl::adopt(vector); }
-
-#if USE(JSC)
-    operator JSC::UString() const;
-#endif
-
-    unsigned length() const;
-    const UChar* characters() const;
-    const UChar* charactersWithNullTermination();
-    
-    UChar operator[](unsigned i) const; // if i >= length(), returns 0    
-    UChar32 characterStartingAt(unsigned) const; // Ditto.
-    
-    bool contains(UChar c) const { return find(c) != -1; }
-    bool contains(const char* str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
-    bool contains(const String& str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
-
-    int find(UChar c, int start = 0) const
-        { return m_impl ? m_impl->find(c, start) : -1; }
-    int find(CharacterMatchFunctionPtr matchFunction, int start = 0) const
-        { return m_impl ? m_impl->find(matchFunction, start) : -1; }
-    int find(const char* str, int start = 0, bool caseSensitive = true) const
-        { return m_impl ? m_impl->find(str, start, caseSensitive) : -1; }
-    int find(const String& str, int start = 0, bool caseSensitive = true) const
-        { return m_impl ? m_impl->find(str.impl(), start, caseSensitive) : -1; }
-
-    int reverseFind(UChar c, int start = -1) const
-        { return m_impl ? m_impl->reverseFind(c, start) : -1; }
-    int reverseFind(const String& str, int start = -1, bool caseSensitive = true) const
-        { return m_impl ? m_impl->reverseFind(str.impl(), start, caseSensitive) : -1; }
-    
-    bool startsWith(const String& s, bool caseSensitive = true) const
-        { return m_impl ? m_impl->startsWith(s.impl(), caseSensitive) : s.isEmpty(); }
-    bool endsWith(const String& s, bool caseSensitive = true) const
-        { return m_impl ? m_impl->endsWith(s.impl(), caseSensitive) : s.isEmpty(); }
-
-    void append(const String&);
-    void append(char);
-    void append(UChar);
-    void append(const UChar*, unsigned length);
-    void insert(const String&, unsigned pos);
-    void insert(const UChar*, unsigned length, unsigned pos);
-
-    String& replace(UChar a, UChar b) { if (m_impl) m_impl = m_impl->replace(a, b); return *this; }
-    String& replace(UChar a, const String& b) { if (m_impl) m_impl = m_impl->replace(a, b.impl()); return *this; }
-    String& replace(const String& a, const String& b) { if (m_impl) m_impl = m_impl->replace(a.impl(), b.impl()); return *this; }
-    String& replace(unsigned index, unsigned len, const String& b) { if (m_impl) m_impl = m_impl->replace(index, len, b.impl()); return *this; }
-
-    void truncate(unsigned len);
-    void remove(unsigned pos, int len = 1);
-
-    String substring(unsigned pos, unsigned len = UINT_MAX) const;
-    String left(unsigned len) const { return substring(0, len); }
-    String right(unsigned len) const { return substring(length() - len, len); }
-
-    // Returns a lowercase/uppercase version of the string
-    String lower() const;
-    String upper() const;
-
-    String stripWhiteSpace() const;
-    String simplifyWhiteSpace() const;
-
-    String removeCharacters(CharacterMatchFunctionPtr) const;
-
-    // Return the string with case folded for case insensitive comparison.
-    String foldCase() const;
-
-    static String number(short);
-    static String number(unsigned short);
-    static String number(int);
-    static String number(unsigned);
-    static String number(long);
-    static String number(unsigned long);
-    static String number(long long);
-    static String number(unsigned long long);
-    static String number(double);
-    
-    static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
-
-    // Returns an uninitialized string. The characters needs to be written
-    // into the buffer returned in data before the returned string is used.
-    // Failure to do this will have unpredictable results.
-    static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
-
-    void split(const String& separator, Vector<String>& result) const;
-    void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
-    void split(UChar separator, Vector<String>& result) const;
-    void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
-
-    int toIntStrict(bool* ok = 0, int base = 10) const;
-    unsigned toUIntStrict(bool* ok = 0, int base = 10) const;
-    int64_t toInt64Strict(bool* ok = 0, int base = 10) const;
-    uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const;
-    intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const;
-
-    int toInt(bool* ok = 0) const;
-    unsigned toUInt(bool* ok = 0) const;
-    int64_t toInt64(bool* ok = 0) const;
-    uint64_t toUInt64(bool* ok = 0) const;
-    intptr_t toIntPtr(bool* ok = 0) const;
-    double toDouble(bool* ok = 0) const;
-    float toFloat(bool* ok = 0) const;
-
-    bool percentage(int& percentage) const;
-
-    // Returns a StringImpl suitable for use on another thread.
-    String crossThreadString() const;
-    // Makes a deep copy. Helpful only if you need to use a String on another thread
-    // (use crossThreadString if the method call doesn't need to be threadsafe).
-    // Since the underlying StringImpl objects are immutable, there's no other reason
-    // to ever prefer copy() over plain old assignment.
-    String threadsafeCopy() const;
-
-    bool isNull() const { return !m_impl; }
-    bool isEmpty() const;
-
-    StringImpl* impl() const { return m_impl.get(); }
-
-#if PLATFORM(CF)
-    String(CFStringRef);
-    CFStringRef createCFString() const;
-#endif
-
-#ifdef __OBJC__
-    String(NSString*);
-    
-    // This conversion maps NULL to "", which loses the meaning of NULL, but we 
-    // need this mapping because AppKit crashes when passed nil NSStrings.
-    operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
-#endif
-
-#if PLATFORM(QT)
-    String(const QString&);
-    String(const QStringRef&);
-    operator QString() const;
-#endif
-
-#if PLATFORM(WX)
-    String(const wxString&);
-    operator wxString() const;
-#endif
-
-#if PLATFORM(HAIKU)
-    String(const BString&);
-    operator BString() const;
-#endif
-
-#ifndef NDEBUG
-    Vector<char> ascii() const;
-#endif
-
-    CString latin1() const;
-    CString utf8() const;
-
-    static String fromUTF8(const char*, size_t);
-    static String fromUTF8(const char*);
-
-    // Tries to convert the passed in string to UTF-8, but will fall back to Latin-1 if the string is not valid UTF-8.
-    static String fromUTF8WithLatin1Fallback(const char*, size_t);
-    
-    // Determines the writing direction using the Unicode Bidi Algorithm rules P2 and P3.
-    WTF::Unicode::Direction defaultWritingDirection() const { return m_impl ? m_impl->defaultWritingDirection() : WTF::Unicode::LeftToRight; }
-
-    // Counts the number of grapheme clusters. A surrogate pair or a sequence
-    // of a non-combining character and following combining characters is
-    // counted as 1 grapheme cluster.
-    unsigned numGraphemeClusters() const;
-    // Returns the number of characters which will be less than or equal to
-    // the specified grapheme cluster length.
-    unsigned numCharactersInGraphemeClusters(unsigned) const;
-
-private:
-    RefPtr<StringImpl> m_impl;
-};
-
-#if PLATFORM(QT)
-QDataStream& operator<<(QDataStream& stream, const String& str);
-QDataStream& operator>>(QDataStream& stream, String& str);
-#endif
-
-String operator+(const String&, const String&);
-String operator+(const String&, const char*);
-String operator+(const char*, const String&);
-
-inline String& operator+=(String& a, const String& b) { a.append(b); return a; }
-
-inline bool operator==(const String& a, const String& b) { return equal(a.impl(), b.impl()); }
-inline bool operator==(const String& a, const char* b) { return equal(a.impl(), b); }
-inline bool operator==(const char* a, const String& b) { return equal(a, b.impl()); }
-
-inline bool operator!=(const String& a, const String& b) { return !equal(a.impl(), b.impl()); }
-inline bool operator!=(const String& a, const char* b) { return !equal(a.impl(), b); }
-inline bool operator!=(const char* a, const String& b) { return !equal(a, b.impl()); }
-
-inline bool equalIgnoringCase(const String& a, const String& b) { return equalIgnoringCase(a.impl(), b.impl()); }
-inline bool equalIgnoringCase(const String& a, const char* b) { return equalIgnoringCase(a.impl(), b); }
-inline bool equalIgnoringCase(const char* a, const String& b) { return equalIgnoringCase(a, b.impl()); }
-
-inline bool equalPossiblyIgnoringCase(const String& a, const String& b, bool ignoreCase) 
-{
-    return ignoreCase ? equalIgnoringCase(a, b) : (a == b);
-}
-
-inline bool equalIgnoringNullity(const String& a, const String& b) { return equalIgnoringNullity(a.impl(), b.impl()); }
-
-inline bool operator!(const String& str) { return str.isNull(); }
-
-inline void swap(String& a, String& b) { a.swap(b); }
-
-// String Operations
-
-bool charactersAreAllASCII(const UChar*, size_t);
-
-int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
-unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
-int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
-uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
-intptr_t charactersToIntPtrStrict(const UChar*, size_t, bool* ok = 0, int base = 10);
-
-int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-unsigned charactersToUInt(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-int64_t charactersToInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-uint64_t charactersToUInt64(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trailing garbage
-
-double charactersToDouble(const UChar*, size_t, bool* ok = 0);
-float charactersToFloat(const UChar*, size_t, bool* ok = 0);
-
-int find(const UChar*, size_t, UChar, int startPosition = 0);
-int reverseFind(const UChar*, size_t, UChar, int startPosition = -1);
-
-#ifdef __OBJC__
-// This is for situations in WebKit where the long standing behavior has been
-// "nil if empty", so we try to maintain longstanding behavior for the sake of
-// entrenched clients
-inline NSString* nsStringNilIfEmpty(const String& str) {  return str.isEmpty() ? nil : (NSString*)str; }
-#endif
-
-inline bool charactersAreAllASCII(const UChar* characters, size_t length)
-{
-    UChar ored = 0;
-    for (size_t i = 0; i < length; ++i)
-        ored |= characters[i];
-    return !(ored & 0xFF80);
-}
-
-inline int find(const UChar* characters, size_t length, UChar character, int startPosition)
-{
-    if (startPosition >= static_cast<int>(length))
-        return -1;
-    for (size_t i = startPosition; i < length; ++i) {
-        if (characters[i] == character)
-            return static_cast<int>(i);
-    }
-    return -1;
-}
-
-inline int find(const UChar* characters, size_t length, CharacterMatchFunctionPtr matchFunction, int startPosition)
-{
-    if (startPosition >= static_cast<int>(length))
-        return -1;
-    for (size_t i = startPosition; i < length; ++i) {
-        if (matchFunction(characters[i]))
-            return static_cast<int>(i);
-    }
-    return -1;
-}
-
-inline int reverseFind(const UChar* characters, size_t length, UChar character, int startPosition)
-{
-    if (startPosition >= static_cast<int>(length) || !length)
-        return -1;
-    if (startPosition < 0)
-        startPosition += static_cast<int>(length);
-    while (true) {
-        if (characters[startPosition] == character)
-            return startPosition;
-        if (!startPosition)
-            return -1;
-        startPosition--;
-    }
-    ASSERT_NOT_REACHED();
-    return -1;
-}
-
-inline void append(Vector<UChar>& vector, const String& string)
-{
-    vector.append(string.characters(), string.length());
-}
-
-inline void appendNumber(Vector<UChar>& vector, unsigned char number)
-{
-    int numberLength = number > 99 ? 3 : (number > 9 ? 2 : 1);
-    size_t vectorSize = vector.size();
-    vector.grow(vectorSize + numberLength);
-
-    switch (numberLength) {
-    case 3:
-        vector[vectorSize + 2] = number % 10 + '0';
-        number /= 10;
-
-    case 2:
-        vector[vectorSize + 1] = number % 10 + '0';
-        number /= 10;
-
-    case 1:
-        vector[vectorSize] = number % 10 + '0';
-    }
-}
-
-
 
 PassRefPtr<SharedBuffer> utf8Buffer(const String&);
+// Counts the number of grapheme clusters. A surrogate pair or a sequence
+// of a non-combining character and following combining characters is
+// counted as 1 grapheme cluster.
+unsigned numGraphemeClusters(const String& s);
+// Returns the number of characters which will be less than or equal to
+// the specified grapheme cluster length.
+unsigned numCharactersInGraphemeClusters(const String& s, unsigned);
 
 } // namespace WebCore
 
-namespace WTF {
-
-    // StringHash is the default hash for String
-    template<typename T> struct DefaultHash;
-    template<> struct DefaultHash<WebCore::String> {
-        typedef WebCore::StringHash Hash;
-    };
-
-}
-
 #endif
diff --git a/WebCore/platform/text/String.cpp b/WebCore/platform/text/String.cpp
index 04b04ab..f2f8d2e 100644
--- a/WebCore/platform/text/String.cpp
+++ b/WebCore/platform/text/String.cpp
@@ -22,894 +22,16 @@
 #include "config.h"
 #include "PlatformString.h"
 
-#include "CString.h"
-#include "FloatConversion.h"
-#include "StringBuffer.h"
+#include "SharedBuffer.h"
 #include "TextBreakIterator.h"
-#include "TextEncoding.h"
-#include <wtf/dtoa.h>
-#include <limits>
-#include <stdarg.h>
-#include <wtf/ASCIICType.h>
-#include <wtf/StringExtras.h>
-#include <wtf/Vector.h>
-#include <wtf/unicode/Unicode.h>
 #include <wtf/unicode/UTF8.h>
-
-#if USE(JSC)
-#include <runtime/Identifier.h>
-
-using JSC::Identifier;
-using JSC::UString;
-#endif
+#include <wtf/unicode/Unicode.h>
 
 using namespace WTF;
 using namespace WTF::Unicode;
 
 namespace WebCore {
 
-String::String(const UChar* str, unsigned len)
-{
-    if (!str)
-        return;
-    m_impl = StringImpl::create(str, len);
-}
-
-String::String(const UChar* str)
-{
-    if (!str)
-        return;
-        
-    int len = 0;
-    while (str[len] != UChar(0))
-        len++;
-    
-    m_impl = StringImpl::create(str, len);
-}
-
-String::String(const char* str)
-{
-    if (!str)
-        return;
-    m_impl = StringImpl::create(str);
-}
-
-String::String(const char* str, unsigned length)
-{
-    if (!str)
-        return;
-    m_impl = StringImpl::create(str, length);
-}
-
-void String::append(const String& str)
-{
-    if (str.isEmpty())
-       return;
-
-    // FIXME: This is extremely inefficient. So much so that we might want to take this
-    // out of String's API. We can make it better by optimizing the case where exactly
-    // one String is pointing at this StringImpl, but even then it's going to require a
-    // call to fastMalloc every single time.
-    if (str.m_impl) {
-        if (m_impl) {
-            UChar* data;
-            RefPtr<StringImpl> newImpl =
-                StringImpl::createUninitialized(m_impl->length() + str.length(), data);
-            memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
-            memcpy(data + m_impl->length(), str.characters(), str.length() * sizeof(UChar));
-            m_impl = newImpl.release();
-        } else
-            m_impl = str.m_impl;
-    }
-}
-
-void String::append(char c)
-{
-    // FIXME: This is extremely inefficient. So much so that we might want to take this
-    // out of String's API. We can make it better by optimizing the case where exactly
-    // one String is pointing at this StringImpl, but even then it's going to require a
-    // call to fastMalloc every single time.
-    if (m_impl) {
-        UChar* data;
-        RefPtr<StringImpl> newImpl =
-            StringImpl::createUninitialized(m_impl->length() + 1, data);
-        memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
-        data[m_impl->length()] = c;
-        m_impl = newImpl.release();
-    } else
-        m_impl = StringImpl::create(&c, 1);
-}
-
-void String::append(UChar c)
-{
-    // FIXME: This is extremely inefficient. So much so that we might want to take this
-    // out of String's API. We can make it better by optimizing the case where exactly
-    // one String is pointing at this StringImpl, but even then it's going to require a
-    // call to fastMalloc every single time.
-    if (m_impl) {
-        UChar* data;
-        RefPtr<StringImpl> newImpl =
-            StringImpl::createUninitialized(m_impl->length() + 1, data);
-        memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar));
-        data[m_impl->length()] = c;
-        m_impl = newImpl.release();
-    } else
-        m_impl = StringImpl::create(&c, 1);
-}
-
-String operator+(const String& a, const String& b)
-{
-    if (a.isEmpty())
-        return b;
-    if (b.isEmpty())
-        return a;
-    String c = a;
-    c += b;
-    return c;
-}
-
-String operator+(const String& s, const char* cs)
-{
-    return s + String(cs);
-}
-
-String operator+(const char* cs, const String& s)
-{
-    return String(cs) + s;
-}
-
-void String::insert(const String& str, unsigned pos)
-{
-    if (str.isEmpty()) {
-        if (str.isNull())
-            return;
-        if (isNull())
-            m_impl = str.impl();
-        return;
-    }
-    insert(str.characters(), str.length(), pos);
-}
-
-void String::append(const UChar* charactersToAppend, unsigned lengthToAppend)
-{
-    if (!m_impl) {
-        if (!charactersToAppend)
-            return;
-        m_impl = StringImpl::create(charactersToAppend, lengthToAppend);
-        return;
-    }
-
-    if (!lengthToAppend)
-        return;
-
-    ASSERT(charactersToAppend);
-    UChar* data;
-    RefPtr<StringImpl> newImpl =
-        StringImpl::createUninitialized(length() + lengthToAppend, data);
-    memcpy(data, characters(), length() * sizeof(UChar));
-    memcpy(data + length(), charactersToAppend, lengthToAppend * sizeof(UChar));
-    m_impl = newImpl.release();
-}
-
-void String::insert(const UChar* charactersToInsert, unsigned lengthToInsert, unsigned position)
-{
-    if (position >= length()) {
-        append(charactersToInsert, lengthToInsert);
-        return;
-    }
-
-    ASSERT(m_impl);
-
-    if (!lengthToInsert)
-        return;
-
-    ASSERT(charactersToInsert);
-    UChar* data;
-    RefPtr<StringImpl> newImpl =
-      StringImpl::createUninitialized(length() + lengthToInsert, data);
-    memcpy(data, characters(), position * sizeof(UChar));
-    memcpy(data + position, charactersToInsert, lengthToInsert * sizeof(UChar));
-    memcpy(data + position + lengthToInsert, characters() + position, (length() - position) * sizeof(UChar));
-    m_impl = newImpl.release();
-}
-
-UChar String::operator[](unsigned i) const
-{
-    if (!m_impl || i >= m_impl->length())
-        return 0;
-    return m_impl->characters()[i];
-}
-
-UChar32 String::characterStartingAt(unsigned i) const
-{
-    if (!m_impl || i >= m_impl->length())
-        return 0;
-    return m_impl->characterStartingAt(i);
-}
-
-unsigned String::length() const
-{
-    if (!m_impl)
-        return 0;
-    return m_impl->length();
-}
-
-void String::truncate(unsigned position)
-{
-    if (position >= length())
-        return;
-    UChar* data;
-    RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(position, data);
-    memcpy(data, characters(), position * sizeof(UChar));
-    m_impl = newImpl.release();
-}
-
-void String::remove(unsigned position, int lengthToRemove)
-{
-    if (lengthToRemove <= 0)
-        return;
-    if (position >= length())
-        return;
-    if (static_cast<unsigned>(lengthToRemove) > length() - position)
-        lengthToRemove = length() - position;
-    UChar* data;
-    RefPtr<StringImpl> newImpl =
-        StringImpl::createUninitialized(length() - lengthToRemove, data);
-    memcpy(data, characters(), position * sizeof(UChar));
-    memcpy(data + position, characters() + position + lengthToRemove,
-        (length() - lengthToRemove - position) * sizeof(UChar));
-    m_impl = newImpl.release();
-}
-
-String String::substring(unsigned pos, unsigned len) const
-{
-    if (!m_impl) 
-        return String();
-    return m_impl->substring(pos, len);
-}
-
-String String::lower() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->lower();
-}
-
-String String::upper() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->upper();
-}
-
-String String::stripWhiteSpace() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->stripWhiteSpace();
-}
-
-String String::simplifyWhiteSpace() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->simplifyWhiteSpace();
-}
-
-String String::removeCharacters(CharacterMatchFunctionPtr findMatch) const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->removeCharacters(findMatch);
-}
-
-String String::foldCase() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->foldCase();
-}
-
-bool String::percentage(int& result) const
-{
-    if (!m_impl || !m_impl->length())
-        return false;
-
-    if ((*m_impl)[m_impl->length() - 1] != '%')
-       return false;
-
-    result = charactersToIntStrict(m_impl->characters(), m_impl->length() - 1);
-    return true;
-}
-
-const UChar* String::characters() const
-{
-    if (!m_impl)
-        return 0;
-    return m_impl->characters();
-}
-
-const UChar* String::charactersWithNullTermination()
-{
-    if (!m_impl)
-        return 0;
-    if (m_impl->hasTerminatingNullCharacter())
-        return m_impl->characters();
-    m_impl = StringImpl::createWithTerminatingNullCharacter(*m_impl);
-    return m_impl->characters();
-}
-
-String String::format(const char *format, ...)
-{
-#if PLATFORM(QT)
-    // Use QString::vsprintf to avoid the locale dependent formatting of vsnprintf.
-    // https://bugs.webkit.org/show_bug.cgi?id=18994
-    va_list args;
-    va_start(args, format);
-
-    QString buffer;
-    buffer.vsprintf(format, args);
-
-    va_end(args);
-
-    return buffer;
-
-#elif OS(WINCE)
-    va_list args;
-    va_start(args, format);
-
-    Vector<char, 256> buffer;
-
-    int bufferSize = 256;
-    buffer.resize(bufferSize);
-    for (;;) {
-        int written = vsnprintf(buffer.data(), bufferSize, format, args);
-        va_end(args);
-
-        if (written == 0)
-            return String("");
-        if (written > 0)
-            return StringImpl::create(buffer.data(), written);
-        
-        bufferSize <<= 1;
-        buffer.resize(bufferSize);
-        va_start(args, format);
-    }
-
-#else
-    va_list args;
-    va_start(args, format);
-
-    Vector<char, 256> buffer;
-
-    // Do the format once to get the length.
-#if COMPILER(MSVC)
-    int result = _vscprintf(format, args);
-#else
-    char ch;
-    int result = vsnprintf(&ch, 1, format, args);
-    // We need to call va_end() and then va_start() again here, as the
-    // contents of args is undefined after the call to vsnprintf
-    // according to http://man.cx/snprintf(3)
-    //
-    // Not calling va_end/va_start here happens to work on lots of
-    // systems, but fails e.g. on 64bit Linux.
-    va_end(args);
-    va_start(args, format);
-#endif
-
-    if (result == 0)
-        return String("");
-    if (result < 0)
-        return String();
-    unsigned len = result;
-    buffer.grow(len + 1);
-    
-    // Now do the formatting again, guaranteed to fit.
-    vsnprintf(buffer.data(), buffer.size(), format, args);
-
-    va_end(args);
-    
-    return StringImpl::create(buffer.data(), len);
-#endif
-}
-
-String String::number(short n)
-{
-    return String::format("%hd", n);
-}
-
-String String::number(unsigned short n)
-{
-    return String::format("%hu", n);
-}
-
-String String::number(int n)
-{
-    return String::format("%d", n);
-}
-
-String String::number(unsigned n)
-{
-    return String::format("%u", n);
-}
-
-String String::number(long n)
-{
-    return String::format("%ld", n);
-}
-
-String String::number(unsigned long n)
-{
-    return String::format("%lu", n);
-}
-
-String String::number(long long n)
-{
-#if OS(WINDOWS) && !PLATFORM(QT)
-    return String::format("%I64i", n);
-#else
-    return String::format("%lli", n);
-#endif
-}
-
-String String::number(unsigned long long n)
-{
-#if OS(WINDOWS) && !PLATFORM(QT)
-    return String::format("%I64u", n);
-#else
-    return String::format("%llu", n);
-#endif
-}
-    
-String String::number(double n)
-{
-    return String::format("%.6lg", n);
-}
-
-int String::toIntStrict(bool* ok, int base) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toIntStrict(ok, base);
-}
-
-unsigned String::toUIntStrict(bool* ok, int base) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toUIntStrict(ok, base);
-}
-
-int64_t String::toInt64Strict(bool* ok, int base) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toInt64Strict(ok, base);
-}
-
-uint64_t String::toUInt64Strict(bool* ok, int base) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toUInt64Strict(ok, base);
-}
-
-intptr_t String::toIntPtrStrict(bool* ok, int base) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toIntPtrStrict(ok, base);
-}
-
-
-int String::toInt(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toInt(ok);
-}
-
-unsigned String::toUInt(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toUInt(ok);
-}
-
-int64_t String::toInt64(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toInt64(ok);
-}
-
-uint64_t String::toUInt64(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toUInt64(ok);
-}
-
-intptr_t String::toIntPtr(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0;
-    }
-    return m_impl->toIntPtr(ok);
-}
-
-double String::toDouble(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0.0;
-    }
-    return m_impl->toDouble(ok);
-}
-
-float String::toFloat(bool* ok) const
-{
-    if (!m_impl) {
-        if (ok)
-            *ok = false;
-        return 0.0f;
-    }
-    return m_impl->toFloat(ok);
-}
-
-String String::threadsafeCopy() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->threadsafeCopy();
-}
-
-String String::crossThreadString() const
-{
-    if (!m_impl)
-        return String();
-    return m_impl->crossThreadString();
-}
-
-bool String::isEmpty() const
-{
-    return !m_impl || !m_impl->length();
-}
-
-void String::split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const
-{
-    result.clear();
-
-    int startPos = 0;
-    int endPos;
-    while ((endPos = find(separator, startPos)) != -1) {
-        if (allowEmptyEntries || startPos != endPos)
-            result.append(substring(startPos, endPos - startPos));
-        startPos = endPos + separator.length();
-    }
-    if (allowEmptyEntries || startPos != static_cast<int>(length()))
-        result.append(substring(startPos));
-}
-
-void String::split(const String& separator, Vector<String>& result) const
-{
-    return split(separator, false, result);
-}
-
-void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const
-{
-    result.clear();
-
-    int startPos = 0;
-    int endPos;
-    while ((endPos = find(separator, startPos)) != -1) {
-        if (allowEmptyEntries || startPos != endPos)
-            result.append(substring(startPos, endPos - startPos));
-        startPos = endPos + 1;
-    }
-    if (allowEmptyEntries || startPos != static_cast<int>(length()))
-        result.append(substring(startPos));
-}
-
-void String::split(UChar separator, Vector<String>& result) const
-{
-    return split(String(&separator, 1), false, result);
-}
-
-#ifndef NDEBUG
-Vector<char> String::ascii() const
-{
-    if (m_impl) 
-        return m_impl->ascii();
-    
-    const char* nullMsg = "(null impl)";
-    Vector<char, 2048> buffer;
-    for (int i = 0; nullMsg[i]; ++i)
-        buffer.append(nullMsg[i]);
-    
-    buffer.append('\0');
-    return buffer;
-}
-#endif
-
-CString String::latin1() const
-{
-    return Latin1Encoding().encode(characters(), length(), QuestionMarksForUnencodables);
-}
-    
-CString String::utf8() const
-{
-    return UTF8Encoding().encode(characters(), length(), QuestionMarksForUnencodables);
-}
-
-String String::fromUTF8(const char* string, size_t size)
-{
-    if (!string)
-        return String();
-    return UTF8Encoding().decode(string, size);
-}
-
-String String::fromUTF8(const char* string)
-{
-    if (!string)
-        return String();
-    return UTF8Encoding().decode(string, strlen(string));
-}
-
-String String::fromUTF8WithLatin1Fallback(const char* string, size_t size)
-{
-    String result = fromUTF8(string, size);
-    if (!result)
-        result = String(string, size);
-    
-    return result;
-}
-
-#if USE(JSC)
-String::String(const Identifier& str)
-{
-    if (str.isNull())
-        return;
-    m_impl = StringImpl::create(str.ustring());
-}
-
-String::String(const UString& str)
-{
-    if (str.isNull())
-        return;
-    m_impl = StringImpl::create(str);
-}
-
-String::operator UString() const
-{
-    if (!m_impl)
-        return UString();
-    return m_impl->ustring();
-}
-#endif
-
-// String Operations
-
-static bool isCharacterAllowedInBase(UChar c, int base)
-{
-    if (c > 0x7F)
-        return false;
-    if (isASCIIDigit(c))
-        return c - '0' < base;
-    if (isASCIIAlpha(c)) {
-        if (base > 36)
-            base = 36;
-        return (c >= 'a' && c < 'a' + base - 10)
-            || (c >= 'A' && c < 'A' + base - 10);
-    }
-    return false;
-}
-
-template <typename IntegralType>
-static inline IntegralType toIntegralType(const UChar* data, size_t length, bool* ok, int base)
-{
-    static const IntegralType integralMax = std::numeric_limits<IntegralType>::max();
-    static const bool isSigned = std::numeric_limits<IntegralType>::is_signed;
-    const IntegralType maxMultiplier = integralMax / base;
-
-    IntegralType value = 0;
-    bool isOk = false;
-    bool isNegative = false;
-
-    if (!data)
-        goto bye;
-
-    // skip leading whitespace
-    while (length && isSpaceOrNewline(*data)) {
-        length--;
-        data++;
-    }
-
-    if (isSigned && length && *data == '-') {
-        length--;
-        data++;
-        isNegative = true;
-    } else if (length && *data == '+') {
-        length--;
-        data++;
-    }
-
-    if (!length || !isCharacterAllowedInBase(*data, base))
-        goto bye;
-
-    while (length && isCharacterAllowedInBase(*data, base)) {
-        length--;
-        IntegralType digitValue;
-        UChar c = *data;
-        if (isASCIIDigit(c))
-            digitValue = c - '0';
-        else if (c >= 'a')
-            digitValue = c - 'a' + 10;
-        else
-            digitValue = c - 'A' + 10;
-
-        if (value > maxMultiplier || (value == maxMultiplier && digitValue > (integralMax % base) + isNegative))
-            goto bye;
-
-        value = base * value + digitValue;
-        data++;
-    }
-
-#if COMPILER(MSVC)
-#pragma warning(push, 0)
-#pragma warning(disable:4146)
-#endif
-
-    if (isNegative)
-        value = -value;
-
-#if COMPILER(MSVC)
-#pragma warning(pop)
-#endif
-
-    // skip trailing space
-    while (length && isSpaceOrNewline(*data)) {
-        length--;
-        data++;
-    }
-
-    if (!length)
-        isOk = true;
-bye:
-    if (ok)
-        *ok = isOk;
-    return isOk ? value : 0;
-}
-
-static unsigned lengthOfCharactersAsInteger(const UChar* data, size_t length)
-{
-    size_t i = 0;
-
-    // Allow leading spaces.
-    for (; i != length; ++i) {
-        if (!isSpaceOrNewline(data[i]))
-            break;
-    }
-    
-    // Allow sign.
-    if (i != length && (data[i] == '+' || data[i] == '-'))
-        ++i;
-    
-    // Allow digits.
-    for (; i != length; ++i) {
-        if (!isASCIIDigit(data[i]))
-            break;
-    }
-
-    return i;
-}
-
-int charactersToIntStrict(const UChar* data, size_t length, bool* ok, int base)
-{
-    return toIntegralType<int>(data, length, ok, base);
-}
-
-unsigned charactersToUIntStrict(const UChar* data, size_t length, bool* ok, int base)
-{
-    return toIntegralType<unsigned>(data, length, ok, base);
-}
-
-int64_t charactersToInt64Strict(const UChar* data, size_t length, bool* ok, int base)
-{
-    return toIntegralType<int64_t>(data, length, ok, base);
-}
-
-uint64_t charactersToUInt64Strict(const UChar* data, size_t length, bool* ok, int base)
-{
-    return toIntegralType<uint64_t>(data, length, ok, base);
-}
-
-intptr_t charactersToIntPtrStrict(const UChar* data, size_t length, bool* ok, int base)
-{
-    return toIntegralType<intptr_t>(data, length, ok, base);
-}
-
-int charactersToInt(const UChar* data, size_t length, bool* ok)
-{
-    return toIntegralType<int>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
-}
-
-unsigned charactersToUInt(const UChar* data, size_t length, bool* ok)
-{
-    return toIntegralType<unsigned>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
-}
-
-int64_t charactersToInt64(const UChar* data, size_t length, bool* ok)
-{
-    return toIntegralType<int64_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
-}
-
-uint64_t charactersToUInt64(const UChar* data, size_t length, bool* ok)
-{
-    return toIntegralType<uint64_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
-}
-
-intptr_t charactersToIntPtr(const UChar* data, size_t length, bool* ok)
-{
-    return toIntegralType<intptr_t>(data, lengthOfCharactersAsInteger(data, length), ok, 10);
-}
-
-double charactersToDouble(const UChar* data, size_t length, bool* ok)
-{
-    if (!length) {
-        if (ok)
-            *ok = false;
-        return 0.0;
-    }
-
-    Vector<char, 256> bytes(length + 1);
-    for (unsigned i = 0; i < length; ++i)
-        bytes[i] = data[i] < 0x7F ? data[i] : '?';
-    bytes[length] = '\0';
-    char* end;
-    double val = WTF::strtod(bytes.data(), &end);
-    if (ok)
-        *ok = (end == 0 || *end == '\0');
-    return val;
-}
-
-float charactersToFloat(const UChar* data, size_t length, bool* ok)
-{
-    // FIXME: This will return ok even when the string fits into a double but not a float.
-    return narrowPrecisionToFloat(charactersToDouble(data, length, ok));
-}
-
 PassRefPtr<SharedBuffer> utf8Buffer(const String& string)
 {
     // Allocate a buffer big enough to hold all the characters.
@@ -927,11 +49,11 @@
     return SharedBuffer::adoptVector(buffer);
 }
 
-unsigned String::numGraphemeClusters() const
+unsigned numGraphemeClusters(const String& s)
 {
-    TextBreakIterator* it = characterBreakIterator(characters(), length());
+    TextBreakIterator* it = characterBreakIterator(s.characters(), s.length());
     if (!it)
-        return length();
+        return s.length();
 
     unsigned num = 0;
     while (textBreakNext(it) != TextBreakDone)
@@ -939,27 +61,17 @@
     return num;
 }
 
-unsigned String::numCharactersInGraphemeClusters(unsigned numGraphemeClusters) const
+unsigned numCharactersInGraphemeClusters(const String& s, unsigned numGraphemeClusters)
 {
-    TextBreakIterator* it = characterBreakIterator(characters(), length());
+    TextBreakIterator* it = characterBreakIterator(s.characters(), s.length());
     if (!it)
-        return min(length(), numGraphemeClusters);
+        return min(s.length(), numGraphemeClusters);
 
     for (unsigned i = 0; i < numGraphemeClusters; ++i) {
         if (textBreakNext(it) == TextBreakDone)
-            return length();
+            return s.length();
     }
     return textBreakCurrent(it);
 }
 
 } // namespace WebCore
-
-#ifndef NDEBUG
-// For use in the debugger - leaks memory
-WebCore::String* string(const char*);
-
-WebCore::String* string(const char* s)
-{
-    return new WebCore::String(s);
-}
-#endif
diff --git a/WebCore/platform/text/StringHash.h b/WebCore/platform/text/StringHash.h
index e6c548a..35de30d 100644
--- a/WebCore/platform/text/StringHash.h
+++ b/WebCore/platform/text/StringHash.h
@@ -19,248 +19,10 @@
  *
  */
 
-#ifndef StringHash_h
-#define StringHash_h
+#ifndef WebCoreStringHash_h
+#define WebCoreStringHash_h
 
-#include "AtomicString.h"
-#include "PlatformString.h"
-#include <wtf/HashTraits.h>
-#include <wtf/StringHashFunctions.h>
-#include <wtf/unicode/Unicode.h>
-
-namespace WebCore {
-
-    // The hash() functions on StringHash and CaseFoldingHash do not support
-    // null strings. get(), contains(), and add() on HashMap<String,..., StringHash>
-    // cause a null-pointer dereference when passed null strings.
-
-    // FIXME: We should really figure out a way to put the computeHash function that's
-    // currently a member function of StringImpl into this file so we can be a little
-    // closer to having all the nearly-identical hash functions in one place.
-
-    struct StringHash {
-        static unsigned hash(StringImpl* key) { return key->hash(); }
-        static bool equal(StringImpl* a, StringImpl* b)
-        {
-            if (a == b)
-                return true;
-            if (!a || !b)
-                return false;
-
-            unsigned aLength = a->length();
-            unsigned bLength = b->length();
-            if (aLength != bLength)
-                return false;
-
-            // FIXME: perhaps we should have a more abstract macro that indicates when
-            // going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4)
-            const UChar* aChars = a->characters();
-            const UChar* bChars = b->characters();
-            for (unsigned i = 0; i != aLength; ++i) {
-                if (*aChars++ != *bChars++)
-                    return false;
-            }
-            return true;
-#else
-            /* Do it 4-bytes-at-a-time on architectures where it's safe */
-            const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters());
-            const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters());
-
-            unsigned halfLength = aLength >> 1;
-            for (unsigned i = 0; i != halfLength; ++i)
-                if (*aChars++ != *bChars++)
-                    return false;
-
-            if (aLength & 1 && *reinterpret_cast<const uint16_t*>(aChars) != *reinterpret_cast<const uint16_t*>(bChars))
-                return false;
-
-            return true;
-#endif
-        }
-
-        static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); }
-        static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
-        {
-            return equal(a.get(), b.get());
-        }
-
-        static unsigned hash(const String& key) { return key.impl()->hash(); }
-        static bool equal(const String& a, const String& b)
-        {
-            return equal(a.impl(), b.impl());
-        }
-
-        static const bool safeToCompareToEmptyOrDeleted = false;
-    };
-
-    class CaseFoldingHash {
-    public:
-        // Paul Hsieh's SuperFastHash
-        // http://www.azillionmonkeys.com/qed/hash.html
-        static unsigned hash(const UChar* data, unsigned length)
-        {
-            unsigned l = length;
-            const UChar* s = data;
-            uint32_t hash = WTF::stringHashingStartValue;
-            uint32_t tmp;
-            
-            int rem = l & 1;
-            l >>= 1;
-            
-            // Main loop.
-            for (; l > 0; l--) {
-                hash += WTF::Unicode::foldCase(s[0]);
-                tmp = (WTF::Unicode::foldCase(s[1]) << 11) ^ hash;
-                hash = (hash << 16) ^ tmp;
-                s += 2;
-                hash += hash >> 11;
-            }
-            
-            // Handle end case.
-            if (rem) {
-                hash += WTF::Unicode::foldCase(s[0]);
-                hash ^= hash << 11;
-                hash += hash >> 17;
-            }
-            
-            // Force "avalanching" of final 127 bits.
-            hash ^= hash << 3;
-            hash += hash >> 5;
-            hash ^= hash << 2;
-            hash += hash >> 15;
-            hash ^= hash << 10;
-            
-            // This avoids ever returning a hash code of 0, since that is used to
-            // signal "hash not computed yet", using a value that is likely to be
-            // effectively the same as 0 when the low bits are masked.
-            hash |= !hash << 31;
-            
-            return hash;
-        }
-
-        static unsigned hash(StringImpl* str)
-        {
-            return hash(str->characters(), str->length());
-        }
-        
-        static unsigned hash(const char* str, unsigned length)
-        {
-            // This hash is designed to work on 16-bit chunks at a time. But since the normal case
-            // (above) is to hash UTF-16 characters, we just treat the 8-bit chars as if they
-            // were 16-bit chunks, which will give matching results.
-
-            unsigned l = length;
-            const char* s = str;
-            uint32_t hash = WTF::stringHashingStartValue;
-            uint32_t tmp;
-            
-            int rem = l & 1;
-            l >>= 1;
-            
-            // Main loop
-            for (; l > 0; l--) {
-                hash += WTF::Unicode::foldCase(s[0]);
-                tmp = (WTF::Unicode::foldCase(s[1]) << 11) ^ hash;
-                hash = (hash << 16) ^ tmp;
-                s += 2;
-                hash += hash >> 11;
-            }
-            
-            // Handle end case
-            if (rem) {
-                hash += WTF::Unicode::foldCase(s[0]);
-                hash ^= hash << 11;
-                hash += hash >> 17;
-            }
-            
-            // Force "avalanching" of final 127 bits
-            hash ^= hash << 3;
-            hash += hash >> 5;
-            hash ^= hash << 2;
-            hash += hash >> 15;
-            hash ^= hash << 10;
-            
-            // this avoids ever returning a hash code of 0, since that is used to
-            // signal "hash not computed yet", using a value that is likely to be
-            // effectively the same as 0 when the low bits are masked
-            hash |= !hash << 31;
-            
-            return hash;
-        }
-        
-        static bool equal(StringImpl* a, StringImpl* b)
-        {
-            if (a == b)
-                return true;
-            if (!a || !b)
-                return false;
-            unsigned length = a->length();
-            if (length != b->length())
-                return false;
-            return WTF::Unicode::umemcasecmp(a->characters(), b->characters(), length) == 0;
-        }
-
-        static unsigned hash(const RefPtr<StringImpl>& key) 
-        {
-            return hash(key.get());
-        }
-
-        static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
-        {
-            return equal(a.get(), b.get());
-        }
-
-        static unsigned hash(const String& key)
-        {
-            return hash(key.impl());
-        }
-        static unsigned hash(const AtomicString& key)
-        {
-            return hash(key.impl());
-        }
-        static bool equal(const String& a, const String& b)
-        {
-            return equal(a.impl(), b.impl());
-        }
-        static bool equal(const AtomicString& a, const AtomicString& b)
-        {
-            return (a == b) || equal(a.impl(), b.impl());
-        }
-
-        static const bool safeToCompareToEmptyOrDeleted = false;
-    };
-
-    // This hash can be used in cases where the key is a hash of a string, but we don't
-    // want to store the string. It's not really specific to string hashing, but all our
-    // current uses of it are for strings.
-    struct AlreadyHashed : IntHash<unsigned> {
-        static unsigned hash(unsigned key) { return key; }
-
-        // To use a hash value as a key for a hash table, we need to eliminate the
-        // "deleted" value, which is negative one. That could be done by changing
-        // the string hash function to never generate negative one, but this works
-        // and is still relatively efficient.
-        static unsigned avoidDeletedValue(unsigned hash)
-        {
-            ASSERT(hash);
-            unsigned newHash = hash | (!(hash + 1) << 31);
-            ASSERT(newHash);
-            ASSERT(newHash != 0xFFFFFFFF);
-            return newHash;
-        }
-    };
-
-}
-
-namespace WTF {
-
-    template<> struct HashTraits<WebCore::String> : GenericHashTraits<WebCore::String> {
-        static const bool emptyValueIsZero = true;
-        static void constructDeletedValue(WebCore::String& slot) { new (&slot) WebCore::String(HashTableDeletedValue); }
-        static bool isDeletedValue(const WebCore::String& slot) { return slot.isHashTableDeletedValue(); }
-    };
-
-}
+// FIXME: remove this header, use the forward from wtf directly.
+#include <wtf/text/StringHash.h>
 
 #endif
diff --git a/WebCore/platform/text/StringImpl.cpp b/WebCore/platform/text/StringImpl.cpp
deleted file mode 100644
index 3704c4e..0000000
--- a/WebCore/platform/text/StringImpl.cpp
+++ /dev/null
@@ -1,1043 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 1999 Antti Koivisto (koivisto@kde.org)
- *           (C) 2001 Dirk Mueller ( mueller@kde.org )
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
- *
- * 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 "StringImpl.h"
-
-#include "AtomicString.h"
-#include "CString.h"
-#include "CharacterNames.h"
-#include "FloatConversion.h"
-#include "StringBuffer.h"
-#include "StringHash.h"
-#include "TextBreakIterator.h"
-#include "TextEncoding.h"
-#include "ThreadGlobalData.h"
-#include <runtime/UString.h>
-#include <wtf/dtoa.h>
-#include <wtf/Assertions.h>
-#include <wtf/Threading.h>
-#include <wtf/unicode/Unicode.h>
-
-using namespace WTF;
-using namespace Unicode;
-
-namespace WebCore {
-
-static const unsigned minLengthToShare = 20;
-
-static inline UChar* newUCharVector(unsigned n)
-{
-    return static_cast<UChar*>(fastMalloc(sizeof(UChar) * n));
-}
-
-// This constructor is used only to create the empty string.
-StringImpl::StringImpl()
-    : m_data(0)
-    , m_sharedBuffer(0)
-    , m_length(0)
-    , m_refCountAndFlags(s_refCountIncrement | BufferInternal)
-    , m_hash(0)
-{
-    // Ensure that the hash is computed so that AtomicStringHash can call existingHash()
-    // with impunity. The empty string is special because it is never entered into
-    // AtomicString's HashKey, but still needs to compare correctly.
-    hash();
-}
-
-inline StringImpl::StringImpl(unsigned length)
-    : m_data(reinterpret_cast<const UChar*>(this + 1))
-    , m_sharedBuffer(0)
-    , m_length(length)
-    , m_refCountAndFlags(s_refCountIncrement | BufferInternal)
-    , m_hash(0)
-{
-    ASSERT(m_data);
-    ASSERT(m_length);
-}
-
-inline StringImpl::StringImpl(const UChar* characters, unsigned length)
-    : m_data(characters)
-    , m_sharedBuffer(0)
-    , m_length(length)
-    , m_refCountAndFlags(s_refCountIncrement | BufferOwned)
-    , m_hash(0)
-{
-    ASSERT(m_data);
-    ASSERT(m_length);
-}
-
-inline StringImpl::StringImpl(const UChar* characters, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
-    : m_data(characters)
-    , m_sharedBuffer(sharedBuffer.releaseRef())
-    , m_length(length)
-    , m_refCountAndFlags(s_refCountIncrement | BufferShared)
-    , m_hash(0)
-{
-    ASSERT(m_data);
-    ASSERT(m_length);
-}
-
-StringImpl::~StringImpl()
-{
-    if (inTable())
-        AtomicString::remove(this);
-
-    BufferOwnership ownership = bufferOwnership();
-    if (ownership != BufferInternal) {
-        if (ownership == BufferOwned) {
-            ASSERT(!m_sharedBuffer);
-            ASSERT(m_data);
-            fastFree(const_cast<UChar*>(m_data));
-        } else {
-            ASSERT(ownership == BufferShared);
-            ASSERT(m_sharedBuffer);
-            m_sharedBuffer->deref();
-        }
-    }
-}
-
-StringImpl* StringImpl::empty()
-{
-    return threadGlobalData().emptyString();
-}
-
-bool StringImpl::containsOnlyWhitespace()
-{
-    // FIXME: The definition of whitespace here includes a number of characters
-    // that are not whitespace from the point of view of RenderText; I wonder if
-    // that's a problem in practice.
-    for (unsigned i = 0; i < m_length; i++)
-        if (!isASCIISpace(m_data[i]))
-            return false;
-    return true;
-}
-
-PassRefPtr<StringImpl> StringImpl::substring(unsigned start, unsigned length)
-{
-    if (start >= m_length)
-        return empty();
-    unsigned maxLength = m_length - start;
-    if (length >= maxLength) {
-        if (!start)
-            return this;
-        length = maxLength;
-    }
-    return create(m_data + start, length);
-}
-
-UChar32 StringImpl::characterStartingAt(unsigned i)
-{
-    if (U16_IS_SINGLE(m_data[i]))
-        return m_data[i];
-    if (i + 1 < m_length && U16_IS_LEAD(m_data[i]) && U16_IS_TRAIL(m_data[i + 1]))
-        return U16_GET_SUPPLEMENTARY(m_data[i], m_data[i + 1]);
-    return 0;
-}
-
-PassRefPtr<StringImpl> StringImpl::lower()
-{
-    // Note: This is a hot function in the Dromaeo benchmark, specifically the
-    // no-op code path up through the first 'return' statement.
-    
-    // First scan the string for uppercase and non-ASCII characters:
-    UChar ored = 0;
-    bool noUpper = true;
-    const UChar *end = m_data + m_length;
-    for (const UChar* chp = m_data; chp != end; chp++) {
-        if (UNLIKELY(isASCIIUpper(*chp)))
-            noUpper = false;
-        ored |= *chp;
-    }
-    
-    // Nothing to do if the string is all ASCII with no uppercase.
-    if (noUpper && !(ored & ~0x7F))
-        return this;
-
-    int32_t length = m_length;
-    UChar* data;
-    RefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
-
-    if (!(ored & ~0x7F)) {
-        // Do a faster loop for the case where all the characters are ASCII.
-        for (int i = 0; i < length; i++) {
-            UChar c = m_data[i];
-            data[i] = toASCIILower(c);
-        }
-        return newImpl;
-    }
-    
-    // Do a slower implementation for cases that include non-ASCII characters.
-    bool error;
-    int32_t realLength = Unicode::toLower(data, length, m_data, m_length, &error);
-    if (!error && realLength == length)
-        return newImpl;
-    newImpl = createUninitialized(realLength, data);
-    Unicode::toLower(data, realLength, m_data, m_length, &error);
-    if (error)
-        return this;
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::upper()
-{
-    // This function could be optimized for no-op cases the way lower() is,
-    // but in empirical testing, few actual calls to upper() are no-ops, so
-    // it wouldn't be worth the extra time for pre-scanning.
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
-    int32_t length = m_length;
-
-    // Do a faster loop for the case where all the characters are ASCII.
-    UChar ored = 0;
-    for (int i = 0; i < length; i++) {
-        UChar c = m_data[i];
-        ored |= c;
-        data[i] = toASCIIUpper(c);
-    }
-    if (!(ored & ~0x7F))
-        return newImpl;
-
-    // Do a slower implementation for cases that include non-ASCII characters.
-    bool error;
-    int32_t realLength = Unicode::toUpper(data, length, m_data, m_length, &error);
-    if (!error && realLength == length)
-        return newImpl;
-    newImpl = createUninitialized(realLength, data);
-    Unicode::toUpper(data, realLength, m_data, m_length, &error);
-    if (error)
-        return this;
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::secure(UChar aChar)
-{
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
-    int32_t length = m_length;
-    for (int i = 0; i < length; ++i)
-        data[i] = aChar;
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::foldCase()
-{
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
-    int32_t length = m_length;
-
-    // Do a faster loop for the case where all the characters are ASCII.
-    UChar ored = 0;
-    for (int i = 0; i < length; i++) {
-        UChar c = m_data[i];
-        ored |= c;
-        data[i] = toASCIILower(c);
-    }
-    if (!(ored & ~0x7F))
-        return newImpl;
-
-    // Do a slower implementation for cases that include non-ASCII characters.
-    bool error;
-    int32_t realLength = Unicode::foldCase(data, length, m_data, m_length, &error);
-    if (!error && realLength == length)
-        return newImpl;
-    newImpl = createUninitialized(realLength, data);
-    Unicode::foldCase(data, realLength, m_data, m_length, &error);
-    if (error)
-        return this;
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::stripWhiteSpace()
-{
-    if (!m_length)
-        return empty();
-
-    unsigned start = 0;
-    unsigned end = m_length - 1;
-    
-    // skip white space from start
-    while (start <= end && isSpaceOrNewline(m_data[start]))
-        start++;
-    
-    // only white space
-    if (start > end) 
-        return empty();
-
-    // skip white space from end
-    while (end && isSpaceOrNewline(m_data[end]))
-        end--;
-
-    if (!start && end == m_length - 1)
-        return this;
-    return create(m_data + start, end + 1 - start);
-}
-
-PassRefPtr<StringImpl> StringImpl::removeCharacters(CharacterMatchFunctionPtr findMatch)
-{
-    const UChar* from = m_data;
-    const UChar* fromend = from + m_length;
-
-    // Assume the common case will not remove any characters
-    while (from != fromend && !findMatch(*from))
-        from++;
-    if (from == fromend)
-        return this;
-
-    StringBuffer data(m_length);
-    UChar* to = data.characters();
-    unsigned outc = from - m_data;
-
-    if (outc)
-        memcpy(to, m_data, outc * sizeof(UChar));
-
-    while (true) {
-        while (from != fromend && findMatch(*from))
-            from++;
-        while (from != fromend && !findMatch(*from))
-            to[outc++] = *from++;
-        if (from == fromend)
-            break;
-    }
-
-    data.shrink(outc);
-
-    return adopt(data);
-}
-
-PassRefPtr<StringImpl> StringImpl::simplifyWhiteSpace()
-{
-    StringBuffer data(m_length);
-
-    const UChar* from = m_data;
-    const UChar* fromend = from + m_length;
-    int outc = 0;
-    bool changedToSpace = false;
-    
-    UChar* to = data.characters();
-    
-    while (true) {
-        while (from != fromend && isSpaceOrNewline(*from)) {
-            if (*from != ' ')
-                changedToSpace = true;
-            from++;
-        }
-        while (from != fromend && !isSpaceOrNewline(*from))
-            to[outc++] = *from++;
-        if (from != fromend)
-            to[outc++] = ' ';
-        else
-            break;
-    }
-    
-    if (outc > 0 && to[outc - 1] == ' ')
-        outc--;
-    
-    if (static_cast<unsigned>(outc) == m_length && !changedToSpace)
-        return this;
-    
-    data.shrink(outc);
-    
-    return adopt(data);
-}
-
-PassRefPtr<StringImpl> StringImpl::capitalize(UChar previous)
-{
-    StringBuffer stringWithPrevious(m_length + 1);
-    stringWithPrevious[0] = previous == noBreakSpace ? ' ' : previous;
-    for (unsigned i = 1; i < m_length + 1; i++) {
-        // Replace &nbsp with a real space since ICU no longer treats &nbsp as a word separator.
-        if (m_data[i - 1] == noBreakSpace)
-            stringWithPrevious[i] = ' ';
-        else
-            stringWithPrevious[i] = m_data[i - 1];
-    }
-
-    TextBreakIterator* boundary = wordBreakIterator(stringWithPrevious.characters(), m_length + 1);
-    if (!boundary)
-        return this;
-
-    StringBuffer data(m_length);
-
-    int32_t endOfWord;
-    int32_t startOfWord = textBreakFirst(boundary);
-    for (endOfWord = textBreakNext(boundary); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = textBreakNext(boundary)) {
-        if (startOfWord != 0) // Ignore first char of previous string
-            data[startOfWord - 1] = m_data[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]);
-        for (int i = startOfWord + 1; i < endOfWord; i++)
-            data[i - 1] = m_data[i - 1];
-    }
-
-    return adopt(data);
-}
-
-int StringImpl::toIntStrict(bool* ok, int base)
-{
-    return charactersToIntStrict(m_data, m_length, ok, base);
-}
-
-unsigned StringImpl::toUIntStrict(bool* ok, int base)
-{
-    return charactersToUIntStrict(m_data, m_length, ok, base);
-}
-
-int64_t StringImpl::toInt64Strict(bool* ok, int base)
-{
-    return charactersToInt64Strict(m_data, m_length, ok, base);
-}
-
-uint64_t StringImpl::toUInt64Strict(bool* ok, int base)
-{
-    return charactersToUInt64Strict(m_data, m_length, ok, base);
-}
-
-intptr_t StringImpl::toIntPtrStrict(bool* ok, int base)
-{
-    return charactersToIntPtrStrict(m_data, m_length, ok, base);
-}
-
-int StringImpl::toInt(bool* ok)
-{
-    return charactersToInt(m_data, m_length, ok);
-}
-
-unsigned StringImpl::toUInt(bool* ok)
-{
-    return charactersToUInt(m_data, m_length, ok);
-}
-
-int64_t StringImpl::toInt64(bool* ok)
-{
-    return charactersToInt64(m_data, m_length, ok);
-}
-
-uint64_t StringImpl::toUInt64(bool* ok)
-{
-    return charactersToUInt64(m_data, m_length, ok);
-}
-
-intptr_t StringImpl::toIntPtr(bool* ok)
-{
-    return charactersToIntPtr(m_data, m_length, ok);
-}
-
-double StringImpl::toDouble(bool* ok)
-{
-    return charactersToDouble(m_data, m_length, ok);
-}
-
-float StringImpl::toFloat(bool* ok)
-{
-    return charactersToFloat(m_data, m_length, ok);
-}
-
-static bool equal(const UChar* a, const char* b, int length)
-{
-    ASSERT(length >= 0);
-    while (length--) {
-        unsigned char bc = *b++;
-        if (*a++ != bc)
-            return false;
-    }
-    return true;
-}
-
-bool equalIgnoringCase(const UChar* a, const char* b, unsigned length)
-{
-    while (length--) {
-        unsigned char bc = *b++;
-        if (foldCase(*a++) != foldCase(bc))
-            return false;
-    }
-    return true;
-}
-
-static inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length)
-{
-    ASSERT(length >= 0);
-    return umemcasecmp(a, b, length) == 0;
-}
-
-int StringImpl::find(const char* chs, int index, bool caseSensitive)
-{
-    if (!chs || index < 0)
-        return -1;
-
-    int chsLength = strlen(chs);
-    int n = m_length - index;
-    if (n < 0)
-        return -1;
-    n -= chsLength - 1;
-    if (n <= 0)
-        return -1;
-
-    const char* chsPlusOne = chs + 1;
-    int chsLengthMinusOne = chsLength - 1;
-    
-    const UChar* ptr = m_data + index - 1;
-    if (caseSensitive) {
-        UChar c = *chs;
-        do {
-            if (*++ptr == c && equal(ptr + 1, chsPlusOne, chsLengthMinusOne))
-                return m_length - chsLength - n + 1;
-        } while (--n);
-    } else {
-        UChar lc = Unicode::foldCase(*chs);
-        do {
-            if (Unicode::foldCase(*++ptr) == lc && equalIgnoringCase(ptr + 1, chsPlusOne, chsLengthMinusOne))
-                return m_length - chsLength - n + 1;
-        } while (--n);
-    }
-
-    return -1;
-}
-
-int StringImpl::find(UChar c, int start)
-{
-    return WebCore::find(m_data, m_length, c, start);
-}
-
-int StringImpl::find(CharacterMatchFunctionPtr matchFunction, int start)
-{
-    return WebCore::find(m_data, m_length, matchFunction, start);
-}
-
-int StringImpl::find(StringImpl* str, int index, bool caseSensitive)
-{
-    /*
-      We use a simple trick for efficiency's sake. Instead of
-      comparing strings, we compare the sum of str with that of
-      a part of this string. Only if that matches, we call memcmp
-      or ucstrnicmp.
-    */
-    ASSERT(str);
-    if (index < 0)
-        index += m_length;
-    int lstr = str->m_length;
-    int lthis = m_length - index;
-    if ((unsigned)lthis > m_length)
-        return -1;
-    int delta = lthis - lstr;
-    if (delta < 0)
-        return -1;
-
-    const UChar* uthis = m_data + index;
-    const UChar* ustr = str->m_data;
-    unsigned hthis = 0;
-    unsigned hstr = 0;
-    if (caseSensitive) {
-        for (int i = 0; i < lstr; i++) {
-            hthis += uthis[i];
-            hstr += ustr[i];
-        }
-        int i = 0;
-        while (1) {
-            if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
-                return index + i;
-            if (i == delta)
-                return -1;
-            hthis += uthis[i + lstr];
-            hthis -= uthis[i];
-            i++;
-        }
-    } else {
-        for (int i = 0; i < lstr; i++ ) {
-            hthis += toASCIILower(uthis[i]);
-            hstr += toASCIILower(ustr[i]);
-        }
-        int i = 0;
-        while (1) {
-            if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr))
-                return index + i;
-            if (i == delta)
-                return -1;
-            hthis += toASCIILower(uthis[i + lstr]);
-            hthis -= toASCIILower(uthis[i]);
-            i++;
-        }
-    }
-}
-
-int StringImpl::reverseFind(UChar c, int index)
-{
-    return WebCore::reverseFind(m_data, m_length, c, index);
-}
-
-int StringImpl::reverseFind(StringImpl* str, int index, bool caseSensitive)
-{
-    /*
-     See StringImpl::find() for explanations.
-     */
-    ASSERT(str);
-    int lthis = m_length;
-    if (index < 0)
-        index += lthis;
-    
-    int lstr = str->m_length;
-    int delta = lthis - lstr;
-    if ( index < 0 || index > lthis || delta < 0 )
-        return -1;
-    if ( index > delta )
-        index = delta;
-    
-    const UChar *uthis = m_data;
-    const UChar *ustr = str->m_data;
-    unsigned hthis = 0;
-    unsigned hstr = 0;
-    int i;
-    if (caseSensitive) {
-        for ( i = 0; i < lstr; i++ ) {
-            hthis += uthis[index + i];
-            hstr += ustr[i];
-        }
-        i = index;
-        while (1) {
-            if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
-                return i;
-            if (i == 0)
-                return -1;
-            i--;
-            hthis -= uthis[i + lstr];
-            hthis += uthis[i];
-        }
-    } else {
-        for (i = 0; i < lstr; i++) {
-            hthis += toASCIILower(uthis[index + i]);
-            hstr += toASCIILower(ustr[i]);
-        }
-        i = index;
-        while (1) {
-            if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr) )
-                return i;
-            if (i == 0)
-                return -1;
-            i--;
-            hthis -= toASCIILower(uthis[i + lstr]);
-            hthis += toASCIILower(uthis[i]);
-        }
-    }
-    
-    // Should never get here.
-    return -1;
-}
-
-bool StringImpl::endsWith(StringImpl* m_data, bool caseSensitive)
-{
-    ASSERT(m_data);
-    int start = m_length - m_data->m_length;
-    if (start >= 0)
-        return (find(m_data, start, caseSensitive) == start);
-    return false;
-}
-
-PassRefPtr<StringImpl> StringImpl::replace(UChar oldC, UChar newC)
-{
-    if (oldC == newC)
-        return this;
-    unsigned i;
-    for (i = 0; i != m_length; ++i)
-        if (m_data[i] == oldC)
-            break;
-    if (i == m_length)
-        return this;
-
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
-
-    for (i = 0; i != m_length; ++i) {
-        UChar ch = m_data[i];
-        if (ch == oldC)
-            ch = newC;
-        data[i] = ch;
-    }
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::replace(unsigned position, unsigned lengthToReplace, StringImpl* str)
-{
-    position = min(position, length());
-    lengthToReplace = min(lengthToReplace, length() - position);
-    unsigned lengthToInsert = str ? str->length() : 0;
-    if (!lengthToReplace && !lengthToInsert)
-        return this;
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl =
-        createUninitialized(length() - lengthToReplace + lengthToInsert, data);
-    memcpy(data, characters(), position * sizeof(UChar));
-    if (str)
-        memcpy(data + position, str->characters(), lengthToInsert * sizeof(UChar));
-    memcpy(data + position + lengthToInsert, characters() + position + lengthToReplace,
-        (length() - position - lengthToReplace) * sizeof(UChar));
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::replace(UChar pattern, StringImpl* replacement)
-{
-    if (!replacement)
-        return this;
-        
-    int repStrLength = replacement->length();
-    int srcSegmentStart = 0;
-    int matchCount = 0;
-    
-    // Count the matches
-    while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
-        ++matchCount;
-        ++srcSegmentStart;
-    }
-    
-    // If we have 0 matches, we don't have to do any more work
-    if (!matchCount)
-        return this;
-    
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl =
-        createUninitialized(m_length - matchCount + (matchCount * repStrLength), data);
-
-    // Construct the new data
-    int srcSegmentEnd;
-    int srcSegmentLength;
-    srcSegmentStart = 0;
-    int dstOffset = 0;
-    
-    while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
-        srcSegmentLength = srcSegmentEnd - srcSegmentStart;
-        memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
-        dstOffset += srcSegmentLength;
-        memcpy(data + dstOffset, replacement->m_data, repStrLength * sizeof(UChar));
-        dstOffset += repStrLength;
-        srcSegmentStart = srcSegmentEnd + 1;
-    }
-
-    srcSegmentLength = m_length - srcSegmentStart;
-    memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
-
-    ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
-
-    return newImpl;
-}
-
-PassRefPtr<StringImpl> StringImpl::replace(StringImpl* pattern, StringImpl* replacement)
-{
-    if (!pattern || !replacement)
-        return this;
-
-    int patternLength = pattern->length();
-    if (!patternLength)
-        return this;
-        
-    int repStrLength = replacement->length();
-    int srcSegmentStart = 0;
-    int matchCount = 0;
-    
-    // Count the matches
-    while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
-        ++matchCount;
-        srcSegmentStart += patternLength;
-    }
-    
-    // If we have 0 matches, we don't have to do any more work
-    if (!matchCount)
-        return this;
-    
-    UChar* data;
-    PassRefPtr<StringImpl> newImpl =
-        createUninitialized(m_length + matchCount * (repStrLength - patternLength), data);
-    
-    // Construct the new data
-    int srcSegmentEnd;
-    int srcSegmentLength;
-    srcSegmentStart = 0;
-    int dstOffset = 0;
-    
-    while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
-        srcSegmentLength = srcSegmentEnd - srcSegmentStart;
-        memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
-        dstOffset += srcSegmentLength;
-        memcpy(data + dstOffset, replacement->m_data, repStrLength * sizeof(UChar));
-        dstOffset += repStrLength;
-        srcSegmentStart = srcSegmentEnd + patternLength;
-    }
-
-    srcSegmentLength = m_length - srcSegmentStart;
-    memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
-
-    ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
-
-    return newImpl;
-}
-
-bool equal(StringImpl* a, StringImpl* b)
-{
-    return StringHash::equal(a, b);
-}
-
-bool equal(StringImpl* a, const char* b)
-{
-    if (!a)
-        return !b;
-    if (!b)
-        return !a;
-
-    unsigned length = a->length();
-    const UChar* as = a->characters();
-    for (unsigned i = 0; i != length; ++i) {
-        unsigned char bc = b[i];
-        if (!bc)
-            return false;
-        if (as[i] != bc)
-            return false;
-    }
-
-    return !b[length];
-}
-
-bool equalIgnoringCase(StringImpl* a, StringImpl* b)
-{
-    return CaseFoldingHash::equal(a, b);
-}
-
-bool equalIgnoringCase(StringImpl* a, const char* b)
-{
-    if (!a)
-        return !b;
-    if (!b)
-        return !a;
-
-    unsigned length = a->length();
-    const UChar* as = a->characters();
-
-    // Do a faster loop for the case where all the characters are ASCII.
-    UChar ored = 0;
-    bool equal = true;
-    for (unsigned i = 0; i != length; ++i) {
-        char bc = b[i];
-        if (!bc)
-            return false;
-        UChar ac = as[i];
-        ored |= ac;
-        equal = equal && (toASCIILower(ac) == toASCIILower(bc));
-    }
-
-    // Do a slower implementation for cases that include non-ASCII characters.
-    if (ored & ~0x7F) {
-        equal = true;
-        for (unsigned i = 0; i != length; ++i) {
-            unsigned char bc = b[i];
-            equal = equal && (foldCase(as[i]) == foldCase(bc));
-        }
-    }
-
-    return equal && !b[length];
-}
-
-bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
-{
-    if (StringHash::equal(a, b))
-        return true;
-    if (!a && b && !b->length())
-        return true;
-    if (!b && a && !a->length())
-        return true;
-
-    return false;
-}
-
-Vector<char> StringImpl::ascii()
-{
-    Vector<char> buffer(m_length + 1);
-    for (unsigned i = 0; i != m_length; ++i) {
-        UChar c = m_data[i];
-        if ((c >= 0x20 && c < 0x7F) || c == 0x00)
-            buffer[i] = c;
-        else
-            buffer[i] = '?';
-    }
-    buffer[m_length] = '\0';
-    return buffer;
-}
-
-WTF::Unicode::Direction StringImpl::defaultWritingDirection()
-{
-    for (unsigned i = 0; i < m_length; ++i) {
-        WTF::Unicode::Direction charDirection = WTF::Unicode::direction(m_data[i]);
-        if (charDirection == WTF::Unicode::LeftToRight)
-            return WTF::Unicode::LeftToRight;
-        if (charDirection == WTF::Unicode::RightToLeft || charDirection == WTF::Unicode::RightToLeftArabic)
-            return WTF::Unicode::RightToLeft;
-    }
-    return WTF::Unicode::LeftToRight;
-}
-
-// This is a hot function because it's used when parsing HTML.
-PassRefPtr<StringImpl> StringImpl::createStrippingNullCharactersSlowCase(const UChar* characters, unsigned length)
-{
-    StringBuffer strippedCopy(length);
-    unsigned strippedLength = 0;
-    for (unsigned i = 0; i < length; i++) {
-        if (int c = characters[i])
-            strippedCopy[strippedLength++] = c;
-    }
-    ASSERT(strippedLength < length);  // Only take the slow case when stripping.
-    strippedCopy.shrink(strippedLength);
-    return adopt(strippedCopy);
-}
-
-PassRefPtr<StringImpl> StringImpl::adopt(StringBuffer& buffer)
-{
-    unsigned length = buffer.length();
-    if (length == 0)
-        return empty();
-    return adoptRef(new StringImpl(buffer.release(), length));
-}
-
-PassRefPtr<StringImpl> StringImpl::adopt(Vector<UChar>& vector)
-{
-    size_t size = vector.size();
-    if (size == 0)
-        return empty();
-    return adoptRef(new StringImpl(vector.releaseBuffer(), size));
-}
-
-PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, UChar*& data)
-{
-    if (!length) {
-        data = 0;
-        return empty();
-    }
-
-    // Allocate a single buffer large enough to contain the StringImpl
-    // struct as well as the data which it contains. This removes one 
-    // heap allocation from this call.
-    size_t size = sizeof(StringImpl) + length * sizeof(UChar);
-    StringImpl* string = static_cast<StringImpl*>(fastMalloc(size));
-    data = reinterpret_cast<UChar*>(string + 1);
-    string = new (string) StringImpl(length);
-    return adoptRef(string);
-}
-
-PassRefPtr<StringImpl> StringImpl::create(const UChar* characters, unsigned length)
-{
-    if (!characters || !length)
-        return empty();
-
-    UChar* data;
-    PassRefPtr<StringImpl> string = createUninitialized(length, data);
-    memcpy(data, characters, length * sizeof(UChar));
-    return string;
-}
-
-PassRefPtr<StringImpl> StringImpl::create(const char* characters, unsigned length)
-{
-    if (!characters || !length)
-        return empty();
-
-    UChar* data;
-    PassRefPtr<StringImpl> string = createUninitialized(length, data);
-    for (unsigned i = 0; i != length; ++i) {
-        unsigned char c = characters[i];
-        data[i] = c;
-    }
-    return string;
-}
-
-PassRefPtr<StringImpl> StringImpl::create(const char* string)
-{
-    if (!string)
-        return empty();
-    return create(string, strlen(string));
-}
-
-#if USE(JSC)
-PassRefPtr<StringImpl> StringImpl::create(const JSC::UString& str)
-{
-    if (SharedUChar* sharedBuffer = const_cast<JSC::UString*>(&str)->rep()->sharedBuffer())
-        return adoptRef(new StringImpl(str.data(), str.size(), sharedBuffer));
-    return StringImpl::create(str.data(), str.size());
-}
-
-JSC::UString StringImpl::ustring()
-{
-    SharedUChar* sharedBuffer = this->sharedBuffer();
-    if (sharedBuffer)
-        return JSC::UString::Rep::create(sharedBuffer, const_cast<UChar*>(m_data), m_length);
-
-    return JSC::UString(m_data, m_length);
-}
-#endif
-
-PassRefPtr<StringImpl> StringImpl::createWithTerminatingNullCharacter(const StringImpl& string)
-{
-    // Use createUninitialized instead of 'new StringImpl' so that the string and its buffer
-    // get allocated in a single malloc block.
-    UChar* data;
-    int length = string.m_length;
-    RefPtr<StringImpl> terminatedString = createUninitialized(length + 1, data);
-    memcpy(data, string.m_data, length * sizeof(UChar));
-    data[length] = 0;
-    terminatedString->m_length--;
-    terminatedString->m_hash = string.m_hash;
-    terminatedString->m_refCountAndFlags |= s_refCountFlagHasTerminatingNullCharacter;
-    return terminatedString.release();
-}
-
-PassRefPtr<StringImpl> StringImpl::threadsafeCopy() const
-{
-    // Special-case empty strings to make sure that per-thread empty string instance isn't returned.
-    if (m_length == 0)
-        return adoptRef(new StringImpl);
-    return create(m_data, m_length);
-}
-
-PassRefPtr<StringImpl> StringImpl::crossThreadString()
-{
-    if (SharedUChar* sharedBuffer = this->sharedBuffer())
-        return adoptRef(new StringImpl(m_data, m_length, sharedBuffer->crossThreadCopy()));
-
-    // If no shared buffer is available, create a copy.
-    return threadsafeCopy();
-}
-
-StringImpl::SharedUChar* StringImpl::sharedBuffer()
-{
-    if (m_length < minLengthToShare)
-        return 0;
-
-    BufferOwnership ownership = bufferOwnership();
-
-    if (ownership == BufferInternal)
-        return 0;
-
-    if (ownership == BufferOwned) {
-        ASSERT(!m_sharedBuffer);
-        m_sharedBuffer = SharedUChar::create(new OwnFastMallocPtr<UChar>(const_cast<UChar*>(m_data))).releaseRef();
-        m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared;
-    }
-
-    ASSERT(bufferOwnership() == BufferShared);
-    ASSERT(m_sharedBuffer);
-    return m_sharedBuffer;
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/text/StringImpl.h b/WebCore/platform/text/StringImpl.h
index 65848bb..fa79b61 100644
--- a/WebCore/platform/text/StringImpl.h
+++ b/WebCore/platform/text/StringImpl.h
@@ -20,254 +20,10 @@
  *
  */
 
-#ifndef StringImpl_h
-#define StringImpl_h
+#ifndef WebCoreStringImpl_h
+#define WebCoreStringImpl_h
 
-#include <limits.h>
-#include <wtf/ASCIICType.h>
-#include <wtf/CrossThreadRefCounted.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnFastMallocPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/StringHashFunctions.h>
-#include <wtf/Vector.h>
-#include <wtf/unicode/Unicode.h>
-
-#if PLATFORM(CF)
-typedef const struct __CFString * CFStringRef;
-#endif
-
-#ifdef __OBJC__
-@class NSString;
-#endif
-
-namespace JSC {
-class UString;
-}
-
-namespace WebCore {
-
-class StringBuffer;
-
-struct CStringTranslator;
-struct HashAndCharactersTranslator;
-struct StringHash;
-struct UCharBufferTranslator;
-
-enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive };
-
-typedef bool (*CharacterMatchFunctionPtr)(UChar);
-
-class StringImpl : public Noncopyable {
-    friend struct CStringTranslator;
-    friend struct HashAndCharactersTranslator;
-    friend struct UCharBufferTranslator;
-private:
-    friend class ThreadGlobalData;
-
-    enum BufferOwnership {
-        BufferInternal,
-        BufferOwned,
-        BufferShared,
-    };
-
-    typedef CrossThreadRefCounted<OwnFastMallocPtr<UChar> > SharedUChar;
-
-    // Used to create the empty string (""), automatically hashes.
-    StringImpl();
-    // Create a StringImpl with internal storage (BufferInternal)
-    StringImpl(unsigned length);
-    // Create a StringImpl adopting ownership of the provided buffer (BufferOwned)
-    StringImpl(const UChar*, unsigned length);
-    // Create a StringImpl using a shared buffer (BufferShared)
-    StringImpl(const UChar*, unsigned length, PassRefPtr<SharedUChar>);
-
-    // For use only by AtomicString's XXXTranslator helpers.
-    void setHash(unsigned hash) { ASSERT(!m_hash); m_hash = hash; }
-    
-public:
-    ~StringImpl();
-
-    static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
-    static PassRefPtr<StringImpl> create(const char*, unsigned length);
-    static PassRefPtr<StringImpl> create(const char*);
-    static PassRefPtr<StringImpl> createUninitialized(unsigned length, UChar*& data);
-
-    static PassRefPtr<StringImpl> createWithTerminatingNullCharacter(const StringImpl&);
-
-    static PassRefPtr<StringImpl> createStrippingNullCharacters(const UChar*, unsigned length);
-    static PassRefPtr<StringImpl> adopt(StringBuffer&);
-    static PassRefPtr<StringImpl> adopt(Vector<UChar>&);
-#if USE(JSC)
-    static PassRefPtr<StringImpl> create(const JSC::UString&);
-    JSC::UString ustring();
-#endif
-
-    SharedUChar* sharedBuffer();
-    const UChar* characters() { return m_data; }
-    unsigned length() { return m_length; }
-
-    bool hasTerminatingNullCharacter() const { return m_refCountAndFlags & s_refCountFlagHasTerminatingNullCharacter; }
-
-    bool inTable() const { return m_refCountAndFlags & s_refCountFlagInTable; }
-    void setInTable() { m_refCountAndFlags |= s_refCountFlagInTable; }
-
-    unsigned hash() { if (m_hash == 0) m_hash = computeHash(m_data, m_length); return m_hash; }
-    unsigned existingHash() const { ASSERT(m_hash); return m_hash; }
-    inline static unsigned computeHash(const UChar* data, unsigned length) { return WTF::stringHash(data, length); }
-    inline static unsigned computeHash(const char* data) { return WTF::stringHash(data); }
-
-    StringImpl* ref() { m_refCountAndFlags += s_refCountIncrement; return this; }
-    ALWAYS_INLINE void deref() { m_refCountAndFlags -= s_refCountIncrement; if (!(m_refCountAndFlags & s_refCountMask)) delete this; }
-    ALWAYS_INLINE bool hasOneRef() const { return (m_refCountAndFlags & s_refCountMask) == s_refCountIncrement; }
-
-    // Returns a StringImpl suitable for use on another thread.
-    PassRefPtr<StringImpl> crossThreadString();
-    // Makes a deep copy. Helpful only if you need to use a String on another thread
-    // (use crossThreadString if the method call doesn't need to be threadsafe).
-    // Since StringImpl objects are immutable, there's no other reason to make a copy.
-    PassRefPtr<StringImpl> threadsafeCopy() const;
-
-    PassRefPtr<StringImpl> substring(unsigned pos, unsigned len = UINT_MAX);
-
-    UChar operator[](unsigned i) { ASSERT(i < m_length); return m_data[i]; }
-    UChar32 characterStartingAt(unsigned);
-
-    bool containsOnlyWhitespace();
-
-    int toIntStrict(bool* ok = 0, int base = 10);
-    unsigned toUIntStrict(bool* ok = 0, int base = 10);
-    int64_t toInt64Strict(bool* ok = 0, int base = 10);
-    uint64_t toUInt64Strict(bool* ok = 0, int base = 10);
-    intptr_t toIntPtrStrict(bool* ok = 0, int base = 10);
-
-    int toInt(bool* ok = 0); // ignores trailing garbage
-    unsigned toUInt(bool* ok = 0); // ignores trailing garbage
-    int64_t toInt64(bool* ok = 0); // ignores trailing garbage
-    uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage
-    intptr_t toIntPtr(bool* ok = 0); // ignores trailing garbage
-
-    double toDouble(bool* ok = 0);
-    float toFloat(bool* ok = 0);
-
-    PassRefPtr<StringImpl> lower();
-    PassRefPtr<StringImpl> upper();
-    PassRefPtr<StringImpl> secure(UChar aChar);
-    PassRefPtr<StringImpl> capitalize(UChar previousCharacter);
-    PassRefPtr<StringImpl> foldCase();
-
-    PassRefPtr<StringImpl> stripWhiteSpace();
-    PassRefPtr<StringImpl> simplifyWhiteSpace();
-
-    PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr);
-
-    int find(const char*, int index = 0, bool caseSensitive = true);
-    int find(UChar, int index = 0);
-    int find(CharacterMatchFunctionPtr, int index = 0);
-    int find(StringImpl*, int index, bool caseSensitive = true);
-
-    int reverseFind(UChar, int index);
-    int reverseFind(StringImpl*, int index, bool caseSensitive = true);
-    
-    bool startsWith(StringImpl* str, bool caseSensitive = true) { return reverseFind(str, 0, caseSensitive) == 0; }
-    bool endsWith(StringImpl*, bool caseSensitive = true);
-
-    PassRefPtr<StringImpl> replace(UChar, UChar);
-    PassRefPtr<StringImpl> replace(UChar, StringImpl*);
-    PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
-    PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
-
-    static StringImpl* empty();
-
-    Vector<char> ascii();
-
-    WTF::Unicode::Direction defaultWritingDirection();
-
-#if PLATFORM(CF)
-    CFStringRef createCFString();
-#endif
-#ifdef __OBJC__
-    operator NSString*();
-#endif
-
-private:
-    using Noncopyable::operator new;
-    void* operator new(size_t, void* inPlace) { ASSERT(inPlace); return inPlace; }
-
-    static PassRefPtr<StringImpl> createStrippingNullCharactersSlowCase(const UChar*, unsigned length);
-    
-    // The StringImpl struct and its data may be allocated within a single heap block.
-    // In this case, the m_data pointer is an "internal buffer", and does not need to be deallocated.
-    BufferOwnership bufferOwnership() const { return static_cast<BufferOwnership>(m_refCountAndFlags & s_refCountMaskBufferOwnership); }
-
-    static const unsigned s_refCountMask = 0xFFFFFFF0;
-    static const unsigned s_refCountIncrement = 0x10;
-    static const unsigned s_refCountFlagHasTerminatingNullCharacter = 0x8;
-    static const unsigned s_refCountFlagInTable = 0x4;
-    static const unsigned s_refCountMaskBufferOwnership = 0x3;
-
-    const UChar* m_data;
-    SharedUChar* m_sharedBuffer;
-    unsigned m_length;
-    unsigned m_refCountAndFlags;
-    mutable unsigned m_hash;
-};
-
-bool equal(StringImpl*, StringImpl*);
-bool equal(StringImpl*, const char*);
-inline bool equal(const char* a, StringImpl* b) { return equal(b, a); }
-
-bool equalIgnoringCase(StringImpl*, StringImpl*);
-bool equalIgnoringCase(StringImpl*, const char*);
-inline bool equalIgnoringCase(const char* a, StringImpl* b) { return equalIgnoringCase(b, a); }
-bool equalIgnoringCase(const UChar* a, const char* b, unsigned length);
-inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, a, length); }
-
-bool equalIgnoringNullity(StringImpl*, StringImpl*);
-
-static inline bool isSpaceOrNewline(UChar c)
-{
-    // Use isASCIISpace() for basic Latin-1.
-    // This will include newlines, which aren't included in Unicode DirWS.
-    return c <= 0x7F ? WTF::isASCIISpace(c) : WTF::Unicode::direction(c) == WTF::Unicode::WhiteSpaceNeutral;
-}
-
-// This is a hot function because it's used when parsing HTML.
-inline PassRefPtr<StringImpl> StringImpl::createStrippingNullCharacters(const UChar* characters, unsigned length)
-{
-    ASSERT(characters);
-    ASSERT(length);
-
-    // Optimize for the case where there are no Null characters by quickly
-    // searching for nulls, and then using StringImpl::create, which will
-    // memcpy the whole buffer.  This is faster than assigning character by
-    // character during the loop. 
-
-    // Fast case.
-    int foundNull = 0;
-    for (unsigned i = 0; !foundNull && i < length; i++) {
-        int c = characters[i]; // more efficient than using UChar here (at least on Intel Mac OS)
-        foundNull |= !c;
-    }
-    if (!foundNull)
-        return StringImpl::create(characters, length);
-
-    return StringImpl::createStrippingNullCharactersSlowCase(characters, length);
-}
-
-}
-
-namespace WTF {
-
-    // WebCore::StringHash is the default hash for StringImpl* and RefPtr<StringImpl>
-    template<typename T> struct DefaultHash;
-    template<> struct DefaultHash<WebCore::StringImpl*> {
-        typedef WebCore::StringHash Hash;
-    };
-    template<> struct DefaultHash<RefPtr<WebCore::StringImpl> > {
-        typedef WebCore::StringHash Hash;
-    };
-
-}
+// FIXME: remove this header, use the forward from wtf directly.
+#include <wtf/text/StringImpl.h>
 
 #endif
diff --git a/WebCore/platform/text/SuffixTree.h b/WebCore/platform/text/SuffixTree.h
new file mode 100644
index 0000000..f11fd23
--- /dev/null
+++ b/WebCore/platform/text/SuffixTree.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2010 Adam Barth. 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 SuffixTree_h
+#define SuffixTree_h
+
+#include "PlatformString.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class UnicodeCodebook {
+public:
+    static int codeWord(UChar c) { return c; }
+    enum { codeSize = 1 << 8 * sizeof(UChar) };
+};
+
+class ASCIICodebook {
+public:
+    static int codeWord(UChar c) { return c & (codeSize - 1); }
+    enum { codeSize = 1 << (8 * sizeof(char) - 1) };
+};
+
+template<typename Codebook>
+class SuffixTree {
+public:
+    SuffixTree(const String& text, unsigned depth)
+        : m_depth(depth)
+        , m_leaf(true)
+    {
+        build(text);
+    }
+
+    bool mightContain(const String& query)
+    {
+        Node* current = &m_root;
+        int limit = std::min(m_depth, query.length());
+        for (int i = 0; i < limit; ++i) {
+            current = current->at(Codebook::codeWord(query[i]));
+            if (!current)
+                return false;
+        }
+        return true;
+    }
+
+private:
+    class Node {
+    public:
+        Node(bool isLeaf = false)
+        {
+            m_children.resize(Codebook::codeSize);
+            m_children.fill(0);
+            m_isLeaf = isLeaf;
+        }
+
+        ~Node()
+        {
+            for (unsigned i = 0; i < m_children.size(); ++i) {
+                Node* child = m_children.at(i);
+                if (child && !child->m_isLeaf)
+                    delete child;
+            }
+        }
+
+        Node*& at(int codeWord) { return m_children.at(codeWord); }
+
+    private:
+        typedef Vector<Node*, Codebook::codeSize> ChildrenVector;
+
+        ChildrenVector m_children;
+        bool m_isLeaf;
+    };
+
+    void build(const String& text)
+    {
+        for (unsigned base = 0; base < text.length(); ++base) {
+            Node* current = &m_root;
+            unsigned limit = std::min(base + m_depth, text.length());
+            for (unsigned offset = 0; base + offset < limit; ++offset) {
+                ASSERT(current != &m_leaf);
+                Node*& child = current->at(Codebook::codeWord(text[base + offset]));
+                if (!child)
+                    child = base + offset + 1 == limit ? &m_leaf : new Node();
+                current = child;
+            }
+        }
+    }
+
+    Node m_root;
+    unsigned m_depth;
+
+    // Instead of allocating a fresh empty leaf node for ever leaf in the tree
+    // (there can be a lot of these), we alias all the leaves to this "static"
+    // leaf node.
+    Node m_leaf;
+};
+
+} // namespace WebCore
+
+#endif // SuffixTree_h
diff --git a/WebCore/platform/text/TextBreakIteratorICU.cpp b/WebCore/platform/text/TextBreakIteratorICU.cpp
index 44423c0..f5575ee 100644
--- a/WebCore/platform/text/TextBreakIteratorICU.cpp
+++ b/WebCore/platform/text/TextBreakIteratorICU.cpp
@@ -24,7 +24,6 @@
 
 #include "PlatformString.h"
 #include "TextBreakIteratorInternalICU.h"
-
 #include <unicode/ubrk.h>
 #include <wtf/Assertions.h>
 
@@ -38,7 +37,7 @@
 
     if (!createdIterator) {
         UErrorCode openStatus = U_ZERO_ERROR;
-        iterator = static_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
+        iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus));
         createdIterator = true;
         ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
     }
@@ -46,7 +45,7 @@
         return 0;
 
     UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setText(iterator, string, length, &setTextStatus);
+    ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
     if (U_FAILURE(setTextStatus))
         return 0;
 
@@ -85,44 +84,44 @@
         staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
 }
 
-int textBreakFirst(TextBreakIterator* bi)
+int textBreakFirst(TextBreakIterator* iterator)
 {
-    return ubrk_first(bi);
+    return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator));
 }
 
-int textBreakLast(TextBreakIterator* bi)
+int textBreakLast(TextBreakIterator* iterator)
 {
-    return ubrk_last(bi);
+    return ubrk_last(reinterpret_cast<UBreakIterator*>(iterator));
 }
 
-int textBreakNext(TextBreakIterator* bi)
+int textBreakNext(TextBreakIterator* iterator)
 {
-    return ubrk_next(bi);
+    return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator));
 }
 
-int textBreakPrevious(TextBreakIterator* bi)
+int textBreakPrevious(TextBreakIterator* iterator)
 {
-    return ubrk_previous(bi);
+    return ubrk_previous(reinterpret_cast<UBreakIterator*>(iterator));
 }
 
-int textBreakPreceding(TextBreakIterator* bi, int pos)
+int textBreakPreceding(TextBreakIterator* iterator, int pos)
 {
-    return ubrk_preceding(bi, pos);
+    return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos);
 }
 
-int textBreakFollowing(TextBreakIterator* bi, int pos)
+int textBreakFollowing(TextBreakIterator* iterator, int pos)
 {
-    return ubrk_following(bi, pos);
+    return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos);
 }
 
-int textBreakCurrent(TextBreakIterator* bi)
+int textBreakCurrent(TextBreakIterator* iterator)
 {
-    return ubrk_current(bi);
+    return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator));
 }
 
-bool isTextBreak(TextBreakIterator* bi, int pos)
+bool isTextBreak(TextBreakIterator* iterator, int position)
 {
-    return ubrk_isBoundary(bi, pos);
+    return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position);
 }
 
 #ifndef BUILDING_ON_TIGER
@@ -136,7 +135,7 @@
         UParseError parseStatus;
         UErrorCode openStatus = U_ZERO_ERROR;
         String rules(breakRules);
-        iterator = static_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
+        iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus));
         createdIterator = true;
         ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
     }
@@ -144,7 +143,7 @@
         return 0;
 
     UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setText(iterator, string, length, &setTextStatus);
+    ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus);
     if (U_FAILURE(setTextStatus))
         return 0;
 
diff --git a/WebCore/platform/text/TextCodec.h b/WebCore/platform/text/TextCodec.h
index 3c74165..591e3a6 100644
--- a/WebCore/platform/text/TextCodec.h
+++ b/WebCore/platform/text/TextCodec.h
@@ -67,7 +67,7 @@
         }
         
         virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError) = 0;
-        virtual CString encode(const UChar*, size_t length, UnencodableHandling) = 0;
+        virtual WTF::CString encode(const UChar*, size_t length, UnencodableHandling) = 0;
 
         // Fills a null-terminated string representation of the given
         // unencodable character into the given replacement buffer. 
diff --git a/WebCore/platform/text/TextCodecICU.cpp b/WebCore/platform/text/TextCodecICU.cpp
index a8a817f..56a4393 100644
--- a/WebCore/platform/text/TextCodecICU.cpp
+++ b/WebCore/platform/text/TextCodecICU.cpp
@@ -28,12 +28,12 @@
 #include "TextCodecICU.h"
 
 #include "CharacterNames.h"
-#include "CString.h"
 #include "PlatformString.h"
 #include "ThreadGlobalData.h"
 #include <unicode/ucnv.h>
 #include <unicode/ucnv_cb.h>
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Threading.h>
diff --git a/WebCore/platform/text/TextCodecLatin1.cpp b/WebCore/platform/text/TextCodecLatin1.cpp
index cfdc5b9..55b20e8 100644
--- a/WebCore/platform/text/TextCodecLatin1.cpp
+++ b/WebCore/platform/text/TextCodecLatin1.cpp
@@ -26,10 +26,10 @@
 #include "config.h"
 #include "TextCodecLatin1.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "StringBuffer.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
@@ -117,26 +117,76 @@
     registrar("US-ASCII", newStreamingTextDecoderWindowsLatin1, 0);
 }
 
+template<size_t size> struct NonASCIIMask;
+template<> struct NonASCIIMask<4> {
+    static unsigned value() { return 0x80808080U; }
+};
+template<> struct NonASCIIMask<8> {
+    static unsigned long long value() { return 0x8080808080808080ULL; }
+};
+
+template<size_t size> struct UCharByteFiller;
+template<> struct UCharByteFiller<4> {
+    static void copy(UChar* dest, const unsigned char* src)
+    {
+        dest[0] = src[0];
+        dest[1] = src[1];
+        dest[2] = src[2];
+        dest[3] = src[3];
+    }
+};
+template<> struct UCharByteFiller<8> {
+    static void copy(UChar* dest, const unsigned char* src)
+    {
+        dest[0] = src[0];
+        dest[1] = src[1];
+        dest[2] = src[2];
+        dest[3] = src[3];
+        dest[4] = src[4];
+        dest[5] = src[5];
+        dest[6] = src[6];
+        dest[7] = src[7];
+    }
+};
+
 String TextCodecLatin1::decode(const char* bytes, size_t length, bool, bool, bool&)
 {
     UChar* characters;
     String result = String::createUninitialized(length, characters);
 
-    // Convert the string a fast way and simultaneously do an efficient check to see if it's all ASCII.
-    unsigned char ored = 0;
-    for (size_t i = 0; i < length; ++i) {
-        unsigned char c = bytes[i];
-        characters[i] = c;
-        ored |= c;
-    }
+    const unsigned char* src = reinterpret_cast<const unsigned char*>(bytes);
+    const unsigned char* end = reinterpret_cast<const unsigned char*>(bytes + length);
+    const unsigned char* alignedEnd = reinterpret_cast<const unsigned char*>(reinterpret_cast<ptrdiff_t>(end) & ~(sizeof(uintptr_t) - 1));
+    UChar* dest = characters;
 
-    if (!(ored & 0x80))
-        return result;
+    while (src < end) {
+        if (*src < 0x80) {
+            // Fast path for values < 0x80 (most Latin-1 text will be ASCII)
+            // Wait until we're at a properly aligned address, then read full CPU words.
+            if (!(reinterpret_cast<ptrdiff_t>(src) & (sizeof(uintptr_t) - 1))) {
+                while (src < alignedEnd) {
+                    uintptr_t chunk = *reinterpret_cast<const uintptr_t*>(src);
 
-    // Convert the slightly slower way when there are non-ASCII characters.
-    for (size_t i = 0; i < length; ++i) {
-        unsigned char c = bytes[i];
-        characters[i] = table[c];
+                    if (chunk & NonASCIIMask<sizeof(uintptr_t)>::value())
+                        goto useLookupTable;
+
+                    UCharByteFiller<sizeof(uintptr_t)>::copy(dest, src);
+
+                    src += sizeof(uintptr_t);
+                    dest += sizeof(uintptr_t);
+                }
+
+                if (src == end)
+                    break;
+            }
+            *dest = *src;
+        } else {
+useLookupTable:
+            *dest = table[*src];
+        }
+
+        ++src;
+        ++dest;
     }
 
     return result;
diff --git a/WebCore/platform/text/TextCodecUTF16.cpp b/WebCore/platform/text/TextCodecUTF16.cpp
index db77000..16f8431 100644
--- a/WebCore/platform/text/TextCodecUTF16.cpp
+++ b/WebCore/platform/text/TextCodecUTF16.cpp
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "TextCodecUTF16.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "StringBuffer.h"
+#include <wtf/text/CString.h>
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/text/TextCodecUserDefined.cpp b/WebCore/platform/text/TextCodecUserDefined.cpp
index b7c8896..851d693 100644
--- a/WebCore/platform/text/TextCodecUserDefined.cpp
+++ b/WebCore/platform/text/TextCodecUserDefined.cpp
@@ -26,10 +26,10 @@
 #include "config.h"
 #include "TextCodecUserDefined.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "StringBuffer.h"
 #include <stdio.h>
+#include <wtf/text/CString.h>
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/text/TextEncoding.cpp b/WebCore/platform/text/TextEncoding.cpp
index 4a30d62..0a997a2 100644
--- a/WebCore/platform/text/TextEncoding.cpp
+++ b/WebCore/platform/text/TextEncoding.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "TextEncoding.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "TextCodec.h"
 #include "TextEncodingRegistry.h"
@@ -38,8 +37,9 @@
 #include <QString>
 #elif USE(GLIB_UNICODE)
 #include <glib.h>
-#include <wtf/gtk/GOwnPtr.h>
+#include "GOwnPtr.h"
 #endif
+#include <wtf/text/CString.h>
 #include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/StdLibExtras.h>
diff --git a/WebCore/platform/text/TextEncoding.h b/WebCore/platform/text/TextEncoding.h
index a99bfc8..3429bb5 100644
--- a/WebCore/platform/text/TextEncoding.h
+++ b/WebCore/platform/text/TextEncoding.h
@@ -29,9 +29,13 @@
 #include "TextCodec.h"
 #include <wtf/unicode/Unicode.h>
 
+namespace WTF {
+class CString;
+}
+using WTF::CString;
+
 namespace WebCore {
 
-    class CString;
     class String;
 
     class TextEncoding {
@@ -71,10 +75,11 @@
             return decode(str, length, false, ignored);
         }
         String decode(const char*, size_t length, bool stopOnError, bool& sawError) const;
-        CString encode(const UChar*, size_t length, UnencodableHandling) const;
+        WTF::CString encode(const UChar*, size_t length, UnencodableHandling) const;
+
+        UChar backslashAsCurrencySymbol() const;
 
     private:
-        UChar backslashAsCurrencySymbol() const;
         bool isNonByteBasedEncoding() const;
         bool isUTF7Encoding() const;
 
diff --git a/WebCore/platform/text/TextStream.cpp b/WebCore/platform/text/TextStream.cpp
index baaa8b9..4386059 100644
--- a/WebCore/platform/text/TextStream.cpp
+++ b/WebCore/platform/text/TextStream.cpp
@@ -90,7 +90,7 @@
     return *this;
 }
 
-TextStream& TextStream::operator<<(void* p)
+TextStream& TextStream::operator<<(const void* p)
 {
     char buffer[printBufferSize];
     snprintf(buffer, sizeof(buffer) - 1, "%p", p);
diff --git a/WebCore/platform/text/TextStream.h b/WebCore/platform/text/TextStream.h
index dfaa048..d69e34b 100644
--- a/WebCore/platform/text/TextStream.h
+++ b/WebCore/platform/text/TextStream.h
@@ -43,7 +43,7 @@
     TextStream& operator<<(float);
     TextStream& operator<<(double);
     TextStream& operator<<(const char*);
-    TextStream& operator<<(void*);
+    TextStream& operator<<(const void*);
     TextStream& operator<<(const String&);
 #if OS(WINDOWS) && PLATFORM(X86_64) && COMPILER(MSVC)
     TextStream& operator<<(unsigned __int64);
diff --git a/WebCore/platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp b/WebCore/platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp
index 9adb999..e390a65 100644
--- a/WebCore/platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp
+++ b/WebCore/platform/text/chromium/TextBreakIteratorInternalICUChromium.cpp
@@ -22,10 +22,10 @@
 #include "config.h"
 #include "TextBreakIteratorInternalICU.h"
 
-#include "CString.h"
 #include "Language.h"
 #include "PlatformString.h"
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp b/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
new file mode 100644
index 0000000..0056869
--- /dev/null
+++ b/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 "TextBreakIteratorInternalICU.h"
+
+namespace WebCore {
+
+const char* currentSearchLocaleID()
+{
+    // FIXME: Should use system locale.
+    return "";
+}
+
+const char* currentTextBreakLocaleID()
+{
+    return "en_us";
+}
+
+}
diff --git a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
index 7a10b41..3be0c70 100644
--- a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
+++ b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
@@ -22,10 +22,10 @@
  */
 
 #include "config.h"
+#include "GOwnPtr.h"
 #include "TextBreakIterator.h"
 
 #include <pango/pango.h>
-#include <wtf/gtk/GOwnPtr.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.cpp b/WebCore/platform/text/gtk/TextCodecGtk.cpp
index 31da3b7..4224c0c 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.cpp
+++ b/WebCore/platform/text/gtk/TextCodecGtk.cpp
@@ -29,12 +29,12 @@
 #include "config.h"
 #include "TextCodecGtk.h"
 
-#include "CString.h"
+#include "GOwnPtr.h"
+#include "Logging.h"
 #include "PlatformString.h"
 #include <wtf/Assertions.h>
 #include <wtf/HashMap.h>
-#include <wtf/gtk/GOwnPtr.h>
-#include "Logging.h"
+#include <wtf/text/CString.h>
 
 using std::min;
 
@@ -254,18 +254,14 @@
         const char *canonicalName;
         canonicalName = (*codecAliases)[codecCount];
 
-        if(!isEncodingAvailable(canonicalName)) {
-            LOG(TextConversion, "Canonical encoding %s not available, skipping.", canonicalName);
+        if (!isEncodingAvailable(canonicalName))
             continue;
-        }
         registrar(canonicalName, canonicalName);
 
         const char *currentAlias;
         while ((currentAlias = (*codecAliases)[++codecCount])) {
-            if (isEncodingAvailable(currentAlias)) {
-                LOG(TextConversion, "Registering encoding name alias %s to canonical %s", currentAlias, canonicalName);
+            if (isEncodingAvailable(currentAlias))
                 registrar(currentAlias, canonicalName);
-            }
         }
 
     }
diff --git a/WebCore/platform/text/haiku/StringHaiku.cpp b/WebCore/platform/text/haiku/StringHaiku.cpp
index fe32215..7436ce2 100644
--- a/WebCore/platform/text/haiku/StringHaiku.cpp
+++ b/WebCore/platform/text/haiku/StringHaiku.cpp
@@ -20,30 +20,24 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
-#include "CString.h"
 #include <String.h>
 
 namespace WebCore {
 
 // String conversions
-String::String(const BString& bstring)
+String::String(const BString& string)
 {
-    const UChar* str = reinterpret_cast<const UChar*>(bstring.String());
-    const size_t size = bstring.Length();
-
-    if (!str)
-        return;
-
-    if (!size)
-        m_impl = StringImpl::empty();
+    if (string.Length())
+        m_impl = String::fromUTF8(string.String(), string.Length()).impl();
     else
-        m_impl = StringImpl::create(str, size);
+        m_impl = StringImpl::empty();
 }
 
 String::operator BString() const
diff --git a/WebCore/platform/text/mac/TextCodecMac.cpp b/WebCore/platform/text/mac/TextCodecMac.cpp
index a1750c9..b743f3d 100644
--- a/WebCore/platform/text/mac/TextCodecMac.cpp
+++ b/WebCore/platform/text/mac/TextCodecMac.cpp
@@ -27,13 +27,14 @@
 #include "config.h"
 #include "TextCodecMac.h"
 
-#include "CString.h"
 #include "CharacterNames.h"
 #include "CharsetData.h"
 #include "PlatformString.h"
 #include "ThreadGlobalData.h"
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 #include <wtf/PassOwnPtr.h>
+#include <wtf/RetainPtr.h>
 #include <wtf/Threading.h>
 
 using namespace std;
diff --git a/WebCore/platform/text/qt/StringQt.cpp b/WebCore/platform/text/qt/StringQt.cpp
deleted file mode 100644
index 62aa979..0000000
--- a/WebCore/platform/text/qt/StringQt.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * 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 COMPUTER, 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 "PlatformString.h"
-
-#include <QString>
-
-namespace WebCore {
-
-// String conversions
-String::String(const QString& qstr)
-{
-    if (qstr.isNull())
-        return;
-    m_impl = StringImpl::create(reinterpret_cast<const UChar*>(qstr.constData()), qstr.length());
-}
-
-String::String(const QStringRef& ref)
-{
-    if (!ref.string())
-        return;
-    m_impl = StringImpl::create(reinterpret_cast<const UChar*>(ref.unicode()), ref.length());
-}
-
-String::operator QString() const
-{
-    return QString(reinterpret_cast<const QChar*>(characters()), length());
-}
-
-QDataStream& operator<<(QDataStream& stream, const String& str)
-{
-    // could be faster
-    stream << QString(str);
-    return stream;
-}
-
-QDataStream& operator>>(QDataStream& stream, String& str)
-{
-    // mabe not the fastest way, but really easy
-    QString tmp;
-    stream >> tmp;
-    str = tmp;
-    return stream;
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/text/qt/TextBreakIteratorQt.cpp b/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
index 101947c..5a8a812 100644
--- a/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
+++ b/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
@@ -40,7 +40,7 @@
 
     TextBreakIterator* wordBreakIterator(const UChar* string, int length)
     {
-        if (!string)
+        if (!string || !length)
             return 0;
         if (!iterator)
             iterator = new QTextBoundaryFinder;
@@ -51,7 +51,7 @@
 
     TextBreakIterator* characterBreakIterator(const UChar* string, int length)
     {
-        if (!string)
+        if (!string || !length)
             return 0;
         if (!iterator)
             iterator = new QTextBoundaryFinder;
@@ -68,7 +68,7 @@
     TextBreakIterator* lineBreakIterator(const UChar* string, int length)
     {
         static QTextBoundaryFinder *iterator = 0;
-        if (!string)
+        if (!string || !length)
             return 0;
         if (!iterator)
             iterator = new QTextBoundaryFinder;
@@ -79,7 +79,7 @@
 
     TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
     {
-        if (!string)
+        if (!string || !length)
             return 0;
         if (!iterator)
             iterator = new QTextBoundaryFinder;
diff --git a/WebCore/platform/text/qt/TextCodecQt.cpp b/WebCore/platform/text/qt/TextCodecQt.cpp
index 21e6e12..735d773 100644
--- a/WebCore/platform/text/qt/TextCodecQt.cpp
+++ b/WebCore/platform/text/qt/TextCodecQt.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "TextCodecQt.h"
 #include "PlatformString.h"
-#include "CString.h"
+#include <wtf/text/CString.h>
 #include <qset.h>
 // #include <QDebug>
 
diff --git a/WebCore/platform/text/wx/StringWx.cpp b/WebCore/platform/text/wx/StringWx.cpp
index 50919c4..5302a85 100644
--- a/WebCore/platform/text/wx/StringWx.cpp
+++ b/WebCore/platform/text/wx/StringWx.cpp
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "PlatformString.h"
 
-#include "CString.h"
 #include "unicode/ustring.h"
+#include <wtf/text/CString.h>
 
 #include <wx/defs.h>
 #include <wx/string.h>
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index f22fcdc..6f9476a 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "ClipboardUtilitiesWin.h"
 
-#include "CString.h"
 #include "DocumentFragment.h"
 #include "KURL.h"
 #include "PlatformString.h"
@@ -34,6 +33,7 @@
 #include "markup.h"
 #include <CoreFoundation/CoreFoundation.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
 #include <shlwapi.h>
 #include <wininet.h>    // for INTERNET_MAX_URL_LENGTH
 
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index d61e681..32b6561 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "ClipboardWin.h"
 
-#include "CString.h"
 #include "CachedImage.h"
 #include "ClipboardUtilitiesWin.h"
 #include "Document.h"
@@ -49,15 +48,15 @@
 #include "Range.h"
 #include "RenderImage.h"
 #include "ResourceResponse.h"
+#include "SharedBuffer.h"
 #include "StringHash.h"
 #include "WCDataObject.h"
 #include "csshelper.h"
 #include "markup.h"
-
 #include <shlwapi.h>
 #include <wininet.h>
-
 #include <wtf/RefPtr.h>
+#include <wtf/text/CString.h>
 
 using namespace std;
 
diff --git a/WebCore/platform/win/ContextMenuItemWin.cpp b/WebCore/platform/win/ContextMenuItemWin.cpp
index 648d593..e265c96 100644
--- a/WebCore/platform/win/ContextMenuItemWin.cpp
+++ b/WebCore/platform/win/ContextMenuItemWin.cpp
@@ -28,7 +28,7 @@
 
 #include "ContextMenu.h"
 
-#include "CString.h"
+#include <wtf/text/CString.h>
 #include <windows.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/win/ContextMenuWin.cpp b/WebCore/platform/win/ContextMenuWin.cpp
index 26b081a..5260866 100644
--- a/WebCore/platform/win/ContextMenuWin.cpp
+++ b/WebCore/platform/win/ContextMenuWin.cpp
@@ -26,11 +26,11 @@
 #include "config.h"
 #include "ContextMenu.h"
 
-#include "CString.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "Node.h"
+#include <wtf/text/CString.h>
 #include <tchar.h>
 #include <windows.h>
 
@@ -90,7 +90,8 @@
 
     info->cbSize = sizeof(MENUITEMINFO);
     
-    info->fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING;
+    // Setting MIIM_DATA which is useful for WebKit clients who store data in this member for their custom menu items.
+    info->fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_DATA;
 
     if (!::GetMenuItemInfo(menu, id, byPosition, info)) {
         free(info);
diff --git a/WebCore/platform/win/FileSystemWin.cpp b/WebCore/platform/win/FileSystemWin.cpp
index 0592298..4b7a692 100644
--- a/WebCore/platform/win/FileSystemWin.cpp
+++ b/WebCore/platform/win/FileSystemWin.cpp
@@ -30,10 +30,10 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 #include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
 
 #include <windows.h>
 #include <winbase.h>
diff --git a/WebCore/platform/win/GDIObjectCounter.cpp b/WebCore/platform/win/GDIObjectCounter.cpp
index 3cc5bcb..9a5adc7 100644
--- a/WebCore/platform/win/GDIObjectCounter.cpp
+++ b/WebCore/platform/win/GDIObjectCounter.cpp
@@ -32,8 +32,8 @@
 
 #include "GDIObjectCounter.h"
 
-#include "CString.h"
 #include "Logging.h"
+#include <wtf/text/CString.h>
 
 #include <windows.h>
 
diff --git a/WebCore/platform/win/KeyEventWin.cpp b/WebCore/platform/win/KeyEventWin.cpp
index 99dfe44..43fb0a4 100644
--- a/WebCore/platform/win/KeyEventWin.cpp
+++ b/WebCore/platform/win/KeyEventWin.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -214,4 +214,12 @@
      return GetKeyState(VK_CAPITAL) & 1;
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    shiftKey = GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT;
+    ctrlKey = GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT;
+    altKey = GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT;
+    metaKey = false;
+}
+
 }
diff --git a/WebCore/platform/win/Language.cpp b/WebCore/platform/win/Language.cpp
index 588c5df..676510b 100644
--- a/WebCore/platform/win/Language.cpp
+++ b/WebCore/platform/win/Language.cpp
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "Language.h"
 
-#include "CString.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/platform/win/LoggingWin.cpp b/WebCore/platform/win/LoggingWin.cpp
index bdf9e1f..fe237e5 100644
--- a/WebCore/platform/win/LoggingWin.cpp
+++ b/WebCore/platform/win/LoggingWin.cpp
@@ -80,7 +80,7 @@
     initializeWithUserDefault(LogPopupBlocking);
     initializeWithUserDefault(LogEvents);
     initializeWithUserDefault(LogEditing);
-    initializeWithUserDefault(LogTextConversion);
+    initializeWithUserDefault(LogLiveConnect);
     initializeWithUserDefault(LogIconDatabase);
     initializeWithUserDefault(LogSQLDatabase);
     initializeWithUserDefault(LogSpellingAndGrammar);
diff --git a/WebCore/platform/win/MIMETypeRegistryWin.cpp b/WebCore/platform/win/MIMETypeRegistryWin.cpp
index 6885402..980742a 100644
--- a/WebCore/platform/win/MIMETypeRegistryWin.cpp
+++ b/WebCore/platform/win/MIMETypeRegistryWin.cpp
@@ -103,4 +103,9 @@
     return result;
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 }
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index ffafd02..512f6cf 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -27,7 +27,6 @@
 #include "Pasteboard.h"
 
 #include "BitmapInfo.h"
-#include "CString.h"
 #include "ClipboardUtilitiesWin.h"
 #include "Document.h"
 #include "DocumentFragment.h"
@@ -40,7 +39,9 @@
 #include "Range.h"
 #include "RenderImage.h"
 #include "TextEncoding.h"
+#include "WebCoreInstanceHandle.h"
 #include "markup.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -88,7 +89,7 @@
     WNDCLASSEX wcex = {0};
     wcex.cbSize = sizeof(WNDCLASSEX);
     wcex.lpfnWndProc    = PasteboardOwnerWndProc;
-    wcex.hInstance      = Page::instanceHandle();
+    wcex.hInstance      = WebCore::instanceHandle();
     wcex.lpszClassName  = L"PasteboardOwnerWindowClass";
     ::RegisterClassEx(&wcex);
 
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index 4ba5e30..44141f2 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -39,6 +39,7 @@
 #include "Scrollbar.h"
 #include "ScrollbarTheme.h"
 #include "SimpleFontData.h"
+#include "WebCoreInstanceHandle.h"
 #include <tchar.h>
 #include <windows.h>
 #include <windowsx.h>
@@ -140,7 +141,7 @@
         m_popup = ::CreateWindowEx(exStyle, kPopupWindowClassName, _T("PopupMenu"),
             WS_POPUP | WS_BORDER,
             m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(),
-            hostWindow, 0, Page::instanceHandle(), this);
+            hostWindow, 0, WebCore::instanceHandle(), this);
 
         if (!m_popup)
             return;
@@ -723,7 +724,7 @@
     wcex.lpfnWndProc    = PopupMenuWndProc;
     wcex.cbClsExtra     = 0;
     wcex.cbWndExtra     = sizeof(PopupMenu*); // For the PopupMenu pointer
-    wcex.hInstance      = Page::instanceHandle();
+    wcex.hInstance      = WebCore::instanceHandle();
     wcex.hIcon          = 0;
     wcex.hCursor        = LoadCursor(0, IDC_ARROW);
     wcex.hbrBackground  = 0;
diff --git a/WebCore/platform/win/SharedTimerWin.cpp b/WebCore/platform/win/SharedTimerWin.cpp
index bc634f9..b7367aa 100644
--- a/WebCore/platform/win/SharedTimerWin.cpp
+++ b/WebCore/platform/win/SharedTimerWin.cpp
@@ -28,6 +28,7 @@
 
 #include "Page.h"
 #include "Settings.h"
+#include "WebCoreInstanceHandle.h"
 #include "Widget.h"
 #include <wtf/Assertions.h>
 #include <wtf/CurrentTime.h>
@@ -125,12 +126,12 @@
     memset(&wcex, 0, sizeof(WNDCLASSEX));
     wcex.cbSize = sizeof(WNDCLASSEX);
     wcex.lpfnWndProc    = TimerWindowWndProc;
-    wcex.hInstance      = Page::instanceHandle();
+    wcex.hInstance      = WebCore::instanceHandle();
     wcex.lpszClassName  = kTimerWindowClassName;
     RegisterClassEx(&wcex);
 
     timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, Page::instanceHandle(), 0);
+       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, WebCore::instanceHandle(), 0);
     timerFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.TimerFired");
 }
 
diff --git a/WebCore/platform/win/SoftLinking.h b/WebCore/platform/win/SoftLinking.h
index bb06672..a82fe35 100644
--- a/WebCore/platform/win/SoftLinking.h
+++ b/WebCore/platform/win/SoftLinking.h
@@ -36,7 +36,6 @@
     static HMODULE lib##Library() \
     { \
         static HMODULE library = LoadLibraryW(L###lib suffix); \
-        ASSERT(library); \
         return library; \
     }
 
diff --git a/WebCore/platform/win/TemporaryLinkStubs.cpp b/WebCore/platform/win/TemporaryLinkStubs.cpp
index 71eed00..d82f21c 100644
--- a/WebCore/platform/win/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/win/TemporaryLinkStubs.cpp
@@ -33,7 +33,4 @@
 // <keygen>
 String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); }
 void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
-#if PLATFORM(CAIRO)
-void populateFontDatabase() { /* Not needed for GDI fonts */ }
-#endif
 } // namespace WebCore
diff --git a/WebCore/platform/win/WebCoreInstanceHandle.cpp b/WebCore/platform/win/WebCoreInstanceHandle.cpp
new file mode 100644
index 0000000..dd21b2d
--- /dev/null
+++ b/WebCore/platform/win/WebCoreInstanceHandle.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "WebCoreInstanceHandle.h"
+
+namespace WebCore {
+
+HINSTANCE s_instanceHandle;
+
+} // namespace WebCore
diff --git a/WebCore/platform/win/WebCoreInstanceHandle.h b/WebCore/platform/win/WebCoreInstanceHandle.h
new file mode 100644
index 0000000..81f4571
--- /dev/null
+++ b/WebCore/platform/win/WebCoreInstanceHandle.h
@@ -0,0 +1,41 @@
+/*

+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 WebCoreInstanceHandle_h

+#define WebCoreInstanceHandle_h

+

+typedef struct HINSTANCE__* HINSTANCE;

+

+namespace WebCore {

+

+    // The global DLL or application instance used for all windows.

+    extern HINSTANCE s_instanceHandle;

+

+    static void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }

+    static HINSTANCE instanceHandle() { return s_instanceHandle; }

+    

+}

+

+#endif // WebCoreInstanceHandle_h

diff --git a/WebCore/platform/wince/FileSystemWince.cpp b/WebCore/platform/wince/FileSystemWince.cpp
index 2bb4dd5..cb165a6 100644
--- a/WebCore/platform/wince/FileSystemWince.cpp
+++ b/WebCore/platform/wince/FileSystemWince.cpp
@@ -31,8 +31,9 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
+#include "NotImplemented.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <windows.h>
 #include <wincrypt.h>
@@ -132,11 +133,11 @@
 
 bool makeAllDirectories(const String& path)
 {
-    int lastDivPos = max(path.reverseFind('/'), path.reverseFind('\\'));
+    int lastDivPos = std::max(path.reverseFind('/'), path.reverseFind('\\'));
     int endPos = path.length();
     if (lastDivPos == path.length() - 1) {
         endPos -= 1;
-        lastDivPos = max(path.reverseFind('/', lastDivPos), path.reverseFind('\\', lastDivPos));
+        lastDivPos = std::max(path.reverseFind('/', lastDivPos), path.reverseFind('\\', lastDivPos));
     }
 
     if (lastDivPos > 0) {
@@ -159,7 +160,7 @@
 
 String pathGetFileName(const String& path)
 {
-    return path.substring(max(path.reverseFind('/'), path.reverseFind('\\')) + 1);
+    return path.substring(std::max(path.reverseFind('/'), path.reverseFind('\\')) + 1);
 }
 
 String directoryName(const String& path)
diff --git a/WebCore/platform/wince/KeygenWince.cpp b/WebCore/platform/wince/KeygenWince.cpp
index b0f4d63..0c1b3c6 100644
--- a/WebCore/platform/wince/KeygenWince.cpp
+++ b/WebCore/platform/wince/KeygenWince.cpp
@@ -21,7 +21,7 @@
 #include "SSLKeyGenerator.h"
 
 #include "Base64.h"
-#include "CString.h"
+#include <wtf/text/CString.h>
 
 #include <windows.h>
 #include <wincrypt.h>
diff --git a/WebCore/platform/wince/MIMETypeRegistryWince.cpp b/WebCore/platform/wince/MIMETypeRegistryWince.cpp
index b6ead9b..9e1bece 100644
--- a/WebCore/platform/wince/MIMETypeRegistryWince.cpp
+++ b/WebCore/platform/wince/MIMETypeRegistryWince.cpp
@@ -133,4 +133,9 @@
     return result.isEmpty() ? "unknown/unknown" : result;
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 }
diff --git a/WebCore/platform/wince/PasteboardWince.cpp b/WebCore/platform/wince/PasteboardWince.cpp
index 16f4968..70b4083 100644
--- a/WebCore/platform/wince/PasteboardWince.cpp
+++ b/WebCore/platform/wince/PasteboardWince.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "Pasteboard.h"
 
-#include "CString.h"
 #include "ClipboardUtilitiesWin.h"
 #include "Document.h"
 #include "DocumentFragment.h"
@@ -41,7 +40,9 @@
 #include "Range.h"
 #include "RenderImage.h"
 #include "TextEncoding.h"
+#include "WebCoreInstanceHandle.h"
 #include "markup.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -87,7 +88,7 @@
     WNDCLASS wc = {0};
     memset(&wc, 0, sizeof(wc));
     wc.lpfnWndProc    = PasteboardOwnerWndProc;
-    wc.hInstance      = Page::instanceHandle();
+    wc.hInstance      = WebCore::instanceHandle();
     wc.lpszClassName  = L"PasteboardOwnerWindowClass";
     ::RegisterClass(&wc);
 
diff --git a/WebCore/platform/wince/SharedTimerWince.cpp b/WebCore/platform/wince/SharedTimerWince.cpp
index a620a10..5f6a386 100644
--- a/WebCore/platform/wince/SharedTimerWince.cpp
+++ b/WebCore/platform/wince/SharedTimerWince.cpp
@@ -29,6 +29,7 @@
 
 #include "Page.h"
 #include "SystemTime.h"
+#include "WebCoreInstanceHandle.h"
 #include "Widget.h"
 #include <wtf/Assertions.h>
 #include <wtf/CurrentTime.h>
@@ -80,12 +81,12 @@
 
     WNDCLASS wcex = {0};
     wcex.lpfnWndProc    = TimerWindowWndProc;
-    wcex.hInstance      = Page::instanceHandle();
+    wcex.hInstance      = WebCore::instanceHandle();
     wcex.lpszClassName  = kTimerWindowClassName;
     RegisterClass(&wcex);
 
     timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, Page::instanceHandle(), 0);
+       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, WebCore::instanceHandle(), 0);
 }
 
 void setSharedTimerFiredFunction(void (*f)())
diff --git a/WebCore/platform/wince/SystemTimeWince.cpp b/WebCore/platform/wince/SystemTimeWince.cpp
deleted file mode 100644
index 70b705b..0000000
--- a/WebCore/platform/wince/SystemTimeWince.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- *
- * 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 COMPUTER, 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 "SystemTime.h"
-
-#include <windows.h>
-
-namespace WebCore {
-
-float userIdleTime()
-{
-    return FLT_MAX;
-}
-
-}
diff --git a/WebCore/platform/wx/FileSystemWx.cpp b/WebCore/platform/wx/FileSystemWx.cpp
index 50ac2ec..bfcaf88 100644
--- a/WebCore/platform/wx/FileSystemWx.cpp
+++ b/WebCore/platform/wx/FileSystemWx.cpp
@@ -30,9 +30,9 @@
 #include "config.h"
 #include "FileSystem.h"
 
-#include "CString.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <wx/wx.h>
 #include <wx/datetime.h>
diff --git a/WebCore/platform/wx/KeyboardCodes.h b/WebCore/platform/wx/KeyboardCodes.h
deleted file mode 100644
index 86ee48c..0000000
--- a/WebCore/platform/wx/KeyboardCodes.h
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 
- *
- * 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 COMPUTER, 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 KeyboardCodes_h
-#define KeyboardCodes_h
-
-namespace WebCore {
-
-// VK_LBUTTON (01) Left mouse button
-// VK_RBUTTON (02) Right mouse button
-// VK_CANCEL (03) Control-break processing
-// VK_MBUTTON (04) Middle mouse button (three-button mouse)
-// VK_XBUTTON1 (05)
-// VK_XBUTTON2 (06)
-
-// VK_BACK (08) BACKSPACE key
-const int VK_BACK = 0x08;
-
-// VK_TAB (09) TAB key
-const int VK_TAB = 0x09;
-
-// VK_CLEAR (0C) CLEAR key
-const int VK_CLEAR = 0x0C;
-
-// VK_RETURN (0D)
-const int VK_RETURN = 0x0D;
-
-// VK_SHIFT (10) SHIFT key
-const int VK_SHIFT = 0x10;
-
-// VK_CONTROL (11) CTRL key
-const int VK_CONTROL = 0x11;
-
-// VK_MENU (12) ALT key
-const int VK_MENU = 0x12;
-
-// VK_PAUSE (13) PAUSE key
-const int VK_PAUSE = 0x13;
-
-// VK_CAPITAL (14) CAPS LOCK key
-const int VK_CAPITAL = 0x14;
-
-// VK_KANA (15) Input Method Editor (IME) Kana mode
-const int VK_KANA = 0x15;
-
-// VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
-// VK_HANGUL (15) IME Hangul mode
-const int VK_HANGUL = 0x15;
-
-// VK_JUNJA (17) IME Junja mode
-const int VK_JUNJA = 0x17;
-
-// VK_FINAL (18) IME final mode
-const int VK_FINAL = 0x18;
-
-// VK_HANJA (19) IME Hanja mode
-const int VK_HANJA = 0x19;
-
-// VK_KANJI (19) IME Kanji mode
-const int VK_KANJI = 0x19;
-
-// VK_ESCAPE (1B) ESC key
-const int VK_ESCAPE = 0x1B;
-
-// VK_CONVERT (1C) IME convert
-const int VK_CONVERT = 0x1C;
-
-// VK_NONCONVERT (1D) IME nonconvert
-const int VK_NONCONVERT = 0x1D;
-
-// VK_ACCEPT (1E) IME accept
-const int VK_ACCEPT = 0x1E;
-
-// VK_MODECHANGE (1F) IME mode change request
-const int VK_MODECHANGE = 0x1F;
-
-// VK_SPACE (20) SPACEBAR
-const int VK_SPACE = 0x20;
-
-// VK_PRIOR (21) PAGE UP key
-const int VK_PRIOR = 0x21;
-
-// VK_NEXT (22) PAGE DOWN key
-const int VK_NEXT = 0x22;
-
-// VK_END (23) END key
-const int VK_END = 0x23;
-
-// VK_HOME (24) HOME key
-const int VK_HOME = 0x24;
-
-// VK_LEFT (25) LEFT ARROW key
-const int VK_LEFT = 0x25;
-
-// VK_UP (26) UP ARROW key
-const int VK_UP = 0x26;
-
-// VK_RIGHT (27) RIGHT ARROW key
-const int VK_RIGHT = 0x27;
-
-// VK_DOWN (28) DOWN ARROW key
-const int VK_DOWN = 0x28;
-
-// VK_SELECT (29) SELECT key
-const int VK_SELECT = 0x29;
-
-// VK_PRINT (2A) PRINT key
-const int VK_PRINT = 0x2A;
-
-// VK_EXECUTE (2B) EXECUTE key
-const int VK_EXECUTE = 0x2B;
-
-// VK_SNAPSHOT (2C) PRINT SCREEN key
-const int VK_SNAPSHOT = 0x2C;
-
-// VK_INSERT (2D) INS key
-const int VK_INSERT = 0x2D;
-
-// VK_DELETE (2E) DEL key
-const int VK_DELETE = 0x2E;
-
-// VK_HELP (2F) HELP key
-const int VK_HELP = 0x2F;
-
-// (30) 0 key
-const int VK_0 = 0x30;
-
-// (31) 1 key
-const int VK_1 = 0x31;
-
-// (32) 2 key
-const int VK_2 = 0x32;
-
-// (33) 3 key
-const int VK_3 = 0x33;
-
-// (34) 4 key
-const int VK_4 = 0x34;
-
-// (35) 5 key;
-
-const int VK_5 = 0x35;
-
-// (36) 6 key
-const int VK_6 = 0x36;
-
-// (37) 7 key
-const int VK_7 = 0x37;
-
-// (38) 8 key
-const int VK_8 = 0x38;
-
-// (39) 9 key
-const int VK_9 = 0x39;
-
-// (41) A key
-const int VK_A = 0x41;
-
-// (42) B key
-const int VK_B = 0x42;
-
-// (43) C key
-const int VK_C = 0x43;
-
-// (44) D key
-const int VK_D = 0x44;
-
-// (45) E key
-const int VK_E = 0x45;
-
-// (46) F key
-const int VK_F = 0x46;
-
-// (47) G key
-const int VK_G = 0x47;
-
-// (48) H key
-const int VK_H = 0x48;
-
-// (49) I key
-const int VK_I = 0x49;
-
-// (4A) J key
-const int VK_J = 0x4A;
-
-// (4B) K key
-const int VK_K = 0x4B;
-
-// (4C) L key
-const int VK_L = 0x4C;
-
-// (4D) M key
-const int VK_M = 0x4D;
-
-// (4E) N key
-const int VK_N = 0x4E;
-
-// (4F) O key
-const int VK_O = 0x4F;
-
-// (50) P key
-const int VK_P = 0x50;
-
-// (51) Q key
-const int VK_Q = 0x51;
-
-// (52) R key
-const int VK_R = 0x52;
-
-// (53) S key
-const int VK_S = 0x53;
-
-// (54) T key
-const int VK_T = 0x54;
-
-// (55) U key
-const int VK_U = 0x55;
-
-// (56) V key
-const int VK_V = 0x56;
-
-// (57) W key
-const int VK_W = 0x57;
-
-// (58) X key
-const int VK_X = 0x58;
-
-// (59) Y key
-const int VK_Y = 0x59;
-
-// (5A) Z key
-const int VK_Z = 0x5A;
-
-// VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
-const int VK_LWIN = 0x5B;
-
-// VK_RWIN (5C) Right Windows key (Natural keyboard)
-const int VK_RWIN = 0x5C;
-
-// VK_APPS (5D) Applications key (Natural keyboard)
-const int VK_APPS = 0x5D;
-
-// VK_SLEEP (5F) Computer Sleep key
-const int VK_SLEEP = 0x5F;
-
-// VK_NUMPAD0 (60) Numeric keypad 0 key
-const int VK_NUMPAD0 = 0x60;
-
-// VK_NUMPAD1 (61) Numeric keypad 1 key
-const int VK_NUMPAD1 = 0x61;
-
-// VK_NUMPAD2 (62) Numeric keypad 2 key
-const int VK_NUMPAD2 = 0x62;
-
-// VK_NUMPAD3 (63) Numeric keypad 3 key
-const int VK_NUMPAD3 = 0x63;
-
-// VK_NUMPAD4 (64) Numeric keypad 4 key
-const int VK_NUMPAD4 = 0x64;
-
-// VK_NUMPAD5 (65) Numeric keypad 5 key
-const int VK_NUMPAD5 = 0x65;
-
-// VK_NUMPAD6 (66) Numeric keypad 6 key
-const int VK_NUMPAD6 = 0x66;
-
-// VK_NUMPAD7 (67) Numeric keypad 7 key
-const int VK_NUMPAD7 = 0x67;
-
-// VK_NUMPAD8 (68) Numeric keypad 8 key
-const int VK_NUMPAD8 = 0x68;
-
-// VK_NUMPAD9 (69) Numeric keypad 9 key
-const int VK_NUMPAD9 = 0x69;
-
-// VK_MULTIPLY (6A) Multiply key
-const int VK_MULTIPLY = 0x6A;
-
-// VK_ADD (6B) Add key
-const int VK_ADD = 0x6B;
-
-// VK_SEPARATOR (6C) Separator key
-const int VK_SEPARATOR = 0x6C;
-
-// VK_SUBTRACT (6D) Subtract key
-const int VK_SUBTRACT = 0x6D;
-
-// VK_DECIMAL (6E) Decimal key
-const int VK_DECIMAL = 0x6E;
-
-// VK_DIVIDE (6F) Divide key
-const int VK_DIVIDE = 0x6F;
-
-// VK_F1 (70) F1 key
-const int VK_F1 = 0x70;
-
-// VK_F2 (71) F2 key
-const int VK_F2 = 0x71;
-
-// VK_F3 (72) F3 key
-const int VK_F3 = 0x72;
-
-// VK_F4 (73) F4 key
-const int VK_F4 = 0x73;
-
-// VK_F5 (74) F5 key
-const int VK_F5 = 0x74;
-
-// VK_F6 (75) F6 key
-const int VK_F6 = 0x75;
-
-// VK_F7 (76) F7 key
-const int VK_F7 = 0x76;
-
-// VK_F8 (77) F8 key
-const int VK_F8 = 0x77;
-
-// VK_F9 (78) F9 key
-const int VK_F9 = 0x78;
-
-// VK_F10 (79) F10 key
-const int VK_F10 = 0x79;
-
-// VK_F11 (7A) F11 key
-const int VK_F11 = 0x7A;
-
-// VK_F12 (7B) F12 key
-const int VK_F12 = 0x7B;
-
-// VK_F13 (7C) F13 key
-const int VK_F13 = 0x7C;
-
-// VK_F14 (7D) F14 key
-const int VK_F14 = 0x7D;
-
-// VK_F15 (7E) F15 key
-const int VK_F15 = 0x7E;
-
-// VK_F16 (7F) F16 key
-const int VK_F16 = 0x7F;
-
-// VK_F17 (80H) F17 key
-const int VK_F17 = 0x80;
-
-// VK_F18 (81H) F18 key
-const int VK_F18 = 0x81;
-
-// VK_F19 (82H) F19 key
-const int VK_F19 = 0x82;
-
-// VK_F20 (83H) F20 key
-const int VK_F20 = 0x83;
-
-// VK_F21 (84H) F21 key
-const int VK_F21 = 0x84;
-
-// VK_F22 (85H) F22 key
-const int VK_F22 = 0x85;
-
-// VK_F23 (86H) F23 key
-const int VK_F23 = 0x86;
-
-// VK_F24 (87H) F24 key
-const int VK_F24 = 0x87;
-
-// VK_NUMLOCK (90) NUM LOCK key
-const int VK_NUMLOCK = 0x90;
-
-// VK_SCROLL (91) SCROLL LOCK key
-const int VK_SCROLL = 0x91;
-
-// VK_LSHIFT (A0) Left SHIFT key
-const int VK_LSHIFT = 0xA0;
-
-// VK_RSHIFT (A1) Right SHIFT key
-const int VK_RSHIFT = 0xA1;
-
-// VK_LCONTROL (A2) Left CONTROL key
-const int VK_LCONTROL = 0xA2;
-
-// VK_RCONTROL (A3) Right CONTROL key
-const int VK_RCONTROL = 0xA3;
-
-// VK_LMENU (A4) Left MENU key
-const int VK_LMENU = 0xA4;
-
-// VK_RMENU (A5) Right MENU key
-const int VK_RMENU = 0xA5;
-
-// VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
-const int VK_BROWSER_BACK = 0xA6;
-
-// VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
-const int VK_BROWSER_FORWARD = 0xA7;
-
-// VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
-const int VK_BROWSER_REFRESH = 0xA8;
-
-// VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
-const int VK_BROWSER_STOP = 0xA9;
-
-// VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
-const int VK_BROWSER_SEARCH = 0xAA;
-
-// VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
-const int VK_BROWSER_FAVORITES = 0xAB;
-
-// VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
-const int VK_BROWSER_HOME = 0xAC;
-
-// VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
-const int VK_VOLUME_MUTE = 0xAD;
-
-// VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
-const int VK_VOLUME_DOWN = 0xAE;
-
-// VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
-const int VK_VOLUME_UP = 0xAF;
-
-// VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
-const int VK_MEDIA_NEXT_TRACK = 0xB0;
-
-// VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
-const int VK_MEDIA_PREV_TRACK = 0xB1;
-
-// VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
-const int VK_MEDIA_STOP = 0xB2;
-
-// VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
-const int VK_MEDIA_PLAY_PAUSE = 0xB3;
-
-// VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
-const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
-
-// VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
-const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
-
-// VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
-const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
-
-// VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
-const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
-
-// VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
-const int VK_OEM_1 = 0xBA;
-
-// VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
-const int VK_OEM_PLUS = 0xBB;
-
-// VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
-const int VK_OEM_COMMA = 0xBC;
-
-// VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
-const int VK_OEM_MINUS = 0xBD;
-
-// VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
-const int VK_OEM_PERIOD = 0xBE;
-
-// VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
-const int VK_OEM_2 = 0xBF;
-
-// VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
-const int VK_OEM_3 = 0xC0;
-
-// VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
-const int VK_OEM_4 = 0xDB;
-
-// VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
-const int VK_OEM_5 = 0xDC;
-
-// VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
-const int VK_OEM_6 = 0xDD;
-
-// VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
-const int VK_OEM_7 = 0xDE;
-
-// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
-const int VK_OEM_8 = 0xDF;
-
-// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
-const int VK_OEM_102 = 0xE2;
-
-// VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
-const int VK_PROCESSKEY = 0xE5;
-
-// VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
-const int VK_PACKET = 0xE7;
-
-// VK_ATTN (F6) Attn key
-const int VK_ATTN = 0xF6;
-
-// VK_CRSEL (F7) CrSel key
-const int VK_CRSEL = 0xF7;
-
-// VK_EXSEL (F8) ExSel key
-const int VK_EXSEL = 0xF8;
-
-// VK_EREOF (F9) Erase EOF key
-const int VK_EREOF = 0xF9;
-
-// VK_PLAY (FA) Play key
-const int VK_PLAY = 0xFA;
-
-// VK_ZOOM (FB) Zoom key
-const int VK_ZOOM = 0xFB;
-
-// VK_NONAME (FC) Reserved for future use
-const int VK_NONAME = 0xFC;
-
-// VK_PA1 (FD) PA1 key
-const int VK_PA1 = 0xFD;
-
-// VK_OEM_CLEAR (FE) Clear key
-const int VK_OEM_CLEAR = 0xFE;
-
-const int VK_UNKNOWN = 0;
-
-}
-
-#endif
diff --git a/WebCore/platform/wx/KeyboardEventWx.cpp b/WebCore/platform/wx/KeyboardEventWx.cpp
index 7f57073..1e88572 100644
--- a/WebCore/platform/wx/KeyboardEventWx.cpp
+++ b/WebCore/platform/wx/KeyboardEventWx.cpp
@@ -26,8 +26,7 @@
 #include "config.h"
 #include "PlatformKeyboardEvent.h"
 
-#include "KeyboardCodes.h"
-
+#include "WindowsKeyboardCodes.h"
 #include <wx/defs.h>
 #include <wx/event.h>
 
@@ -388,5 +387,13 @@
     return wxGetKeyState(WXK_CAPITAL);
 }
 
+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
+{
+    shiftKey = wxGetKeyState(WXK_SHIFT);
+    ctrlKey = wxGetKeyState(WXK_CONTROL);
+    altKey = wxGetKeyState(WXK_ALT);
+    metaKey = false;
+}
+
 }
 
diff --git a/WebCore/platform/wx/LocalizedStringsWx.cpp b/WebCore/platform/wx/LocalizedStringsWx.cpp
index 8573482..4112f64 100644
--- a/WebCore/platform/wx/LocalizedStringsWx.cpp
+++ b/WebCore/platform/wx/LocalizedStringsWx.cpp
@@ -376,4 +376,16 @@
     return String();
 }
 
+String missingPluginText()
+{
+    notImplemented();
+    return String("Missing Plug-in");
+}
+
+String crashedPluginText()
+{
+    notImplemented();
+    return String("Plug-in Failure");
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/wx/LoggingWx.cpp b/WebCore/platform/wx/LoggingWx.cpp
index 4d8a437..e9d5999 100644
--- a/WebCore/platform/wx/LoggingWx.cpp
+++ b/WebCore/platform/wx/LoggingWx.cpp
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "Logging.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 #include <wx/defs.h>
 #include <wx/utils.h>
diff --git a/WebCore/platform/wx/MimeTypeRegistryWx.cpp b/WebCore/platform/wx/MimeTypeRegistryWx.cpp
index 601cd9f..e7cc0e2 100644
--- a/WebCore/platform/wx/MimeTypeRegistryWx.cpp
+++ b/WebCore/platform/wx/MimeTypeRegistryWx.cpp
@@ -70,4 +70,9 @@
     return "text/plain";
 }
 
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+    return false;
+}
+
 }
diff --git a/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm b/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm
index 2312dec..ff4c18a 100644
--- a/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm
+++ b/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm
@@ -96,7 +96,7 @@
 {
 #if wxOSX_USE_COCOA
     NSString* string = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(characters) length:length freeWhenDone:NO];
-    NSCharacterSet* set = [[font.GetNSFont() coveredCharacterSet] invertedSet];
+    NSCharacterSet* set = [[font.OSXGetNSFont() coveredCharacterSet] invertedSet];
     bool result = set && [string rangeOfCharacterFromSet:set].location == NSNotFound;
     [string release];
     return result;
diff --git a/WebCore/plugins/MimeType.cpp b/WebCore/plugins/MimeType.cpp
index c4b051c..954715a 100644
--- a/WebCore/plugins/MimeType.cpp
+++ b/WebCore/plugins/MimeType.cpp
@@ -20,6 +20,7 @@
 #include "MimeType.h"
 
 #include "Frame.h"
+#include "FrameLoaderClient.h"
 #include "Page.h"
 #include "Plugin.h"
 #include "PluginData.h"
@@ -55,7 +56,7 @@
 PassRefPtr<Plugin> MimeType::enabledPlugin() const
 {
     const Page* p = m_pluginData->page();
-    if (!p || !p->settings()->arePluginsEnabled())
+    if (!p || !p->mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
         return 0;
 
     const PluginInfo *info = m_pluginData->mimes()[m_index]->plugin;
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp
index 703ac87..a1200fc 100644
--- a/WebCore/plugins/PluginDatabase.cpp
+++ b/WebCore/plugins/PluginDatabase.cpp
@@ -263,7 +263,7 @@
                 String extension = filename.substring(extensionPos + 1);
 
                 String mimeTypeForExtension = MIMETypeForExtension(extension);
-                if (plugin = pluginForMIMEType(mimeTypeForExtension))
+                if ((plugin = pluginForMIMEType(mimeTypeForExtension)))
                     mimeType = mimeTypeForExtension;
             }
         }
diff --git a/WebCore/plugins/PluginDebug.h b/WebCore/plugins/PluginDebug.h
index 5b84393..254864f 100644
--- a/WebCore/plugins/PluginDebug.h
+++ b/WebCore/plugins/PluginDebug.h
@@ -28,7 +28,7 @@
 
 #include "Logging.h"
 #include "npruntime_internal.h"
-#include "CString.h"
+#include <wtf/text/CString.h>
 
 #define LOG_NPERROR(err) if (err != NPERR_NO_ERROR) LOG_VERBOSE(Plugins, "%s\n", prettyNameForNPError(err))
 #define LOG_PLUGIN_NET_ERROR() LOG_VERBOSE(Plugins, "Stream failed due to problems with network, disk I/O, lack of memory, or other problems.\n")
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index 5949546..278be30 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "PluginPackage.h"
 
-#include "CString.h"
 #include "MIMETypeRegistry.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
@@ -36,6 +35,7 @@
 #include "npruntime_impl.h"
 #include <string.h>
 #include <wtf/OwnArrayPtr.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/plugins/PluginPackageNone.cpp b/WebCore/plugins/PluginPackageNone.cpp
index b943d88..3610f4a 100644
--- a/WebCore/plugins/PluginPackageNone.cpp
+++ b/WebCore/plugins/PluginPackageNone.cpp
@@ -42,4 +42,11 @@
     return false;
 }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+uint16 PluginPackage::NPVersion() const
+{
+    return 0;
+}
+#endif
+
 }
diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp
index 9341c15..9bd497a 100644
--- a/WebCore/plugins/PluginStream.cpp
+++ b/WebCore/plugins/PluginStream.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "PluginStream.h"
 
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -35,6 +34,7 @@
 #include "SharedBuffer.h"
 #include "SubresourceLoader.h"
 #include <StringExtras.h>
+#include <wtf/text/CString.h>
 
 // We use -2 here because some plugins like to return -1 to indicate error
 // and this way we won't clash with them.
diff --git a/WebCore/plugins/PluginStream.h b/WebCore/plugins/PluginStream.h
index 29a2644..c0487e3 100644
--- a/WebCore/plugins/PluginStream.h
+++ b/WebCore/plugins/PluginStream.h
@@ -27,7 +27,6 @@
 #ifndef PluginStream_H
 #define PluginStream_H
 
-#include "CString.h"
 #include "FileSystem.h"
 #include "KURL.h"
 #include "NetscapePlugInStreamLoader.h"
@@ -42,6 +41,7 @@
 #include <wtf/OwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
     class Frame;
@@ -70,7 +70,7 @@
 
         void setLoadManually(bool loadManually) { m_loadManually = loadManually; }
 
-        void sendJavaScriptStream(const KURL& requestURL, const CString& resultString);
+        void sendJavaScriptStream(const KURL& requestURL, const WTF::CString& resultString);
         void cancelAndDestroyStream(NPReason);
 
         static NPP ownerForStream(NPStream*);
@@ -113,8 +113,8 @@
         NPP m_instance;
         uint16 m_transferMode;
         int32 m_offset;
-        CString m_headers;
-        CString m_path;
+        WTF::CString m_headers;
+        WTF::CString m_path;
         NPReason m_reason;
         NPStream m_stream;
         PluginQuirkSet m_quirks;
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index ba8d231..0bc4b0e 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -456,7 +456,7 @@
     UString ustring = result.toString(exec);
     exec->clearException();
 
-    string = ustring;
+    string = ustringToString(ustring);
     return true;
 }
 #endif
@@ -579,12 +579,10 @@
     String jsString = scriptStringIfJavaScriptURL(url);
 
     if (!jsString.isNull()) {
-        Settings* settings = m_parentFrame->settings();
-
         // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
-        if (!settings || !settings->isJavaScriptEnabled())
+        if (!m_parentFrame->script()->canExecuteScripts(NotAboutToExecuteScript))
             return NPERR_GENERIC_ERROR;
-        
+
         // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
         if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
             return NPERR_INVALID_PARAM;
@@ -1402,6 +1400,7 @@
     m_lifeSupportTimer.startOneShot(0);
 }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
 void PluginView::keepAlive(NPP instance)
 {
     PluginView* view = instanceMap().get(instance);
@@ -1410,5 +1409,94 @@
 
     view->keepAlive();
 }
+#endif
+
+NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+{
+    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
+
+    NPError result;
+    if (platformGetValueStatic(variable, value, &result))
+        return result;
+
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError PluginView::getValue(NPNVariable variable, void* value)
+{
+    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
+
+    NPError result;
+    if (platformGetValue(variable, value, &result))
+        return result;
+
+    if (platformGetValueStatic(variable, value, &result))
+        return result;
+
+    switch (variable) {
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    case NPNVWindowNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
+
+        NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
+
+        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
+        if (windowScriptObject)
+            _NPN_RetainObject(windowScriptObject);
+
+        void** v = (void**)value;
+        *v = windowScriptObject;
+
+        return NPERR_NO_ERROR;
+    }
+
+    case NPNVPluginElementNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
+
+        NPObject* pluginScriptObject = 0;
+
+        if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
+            pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
+
+        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
+        if (pluginScriptObject)
+            _NPN_RetainObject(pluginScriptObject);
+
+        void** v = (void**)value;
+        *v = pluginScriptObject;
+
+        return NPERR_NO_ERROR;
+    }
+#endif
+
+    case NPNVprivateModeBool: {
+        Page* page = m_parentFrame->page();
+        if (!page)
+            return NPERR_GENERIC_ERROR;
+        *((NPBool*)value) = !page->settings() || page->settings()->privateBrowsingEnabled();
+        return NPERR_NO_ERROR;
+    }
+
+    default:
+        return NPERR_GENERIC_ERROR;
+    }
+}
+
+void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
+{
+    NPP_SetValueProcPtr setValue = m_plugin->pluginFuncs()->setvalue;
+    if (!setValue)
+        return;
+
+    PluginView::setCurrentPluginView(this);
+    JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+    setCallingPlugin(true);
+    NPBool value = privateBrowsingEnabled;
+    setValue(m_instance, NPNVprivateModeBool, &value);
+    setCallingPlugin(false);
+    PluginView::setCurrentPluginView(0);
+}
 
 } // namespace WebCore
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index 3f0b49d..d769581 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -29,7 +29,6 @@
 #ifndef PluginView_h
 #define PluginView_h
 
-#include "CString.h"
 #include "FrameLoadRequest.h"
 #include "HaltablePlugin.h"
 #include "IntRect.h"
@@ -45,6 +44,7 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 // ANDROID
 // TODO: Upstream to webkit.org
@@ -181,6 +181,8 @@
 
         void setJavaScriptPaused(bool);
 
+        void privateBrowsingStateChanged(bool);
+
         void disconnectStream(PluginStream*);
         void streamDidFinishLoading(PluginStream* stream) { disconnectStream(stream); }
 
@@ -241,7 +243,9 @@
 
         bool start();
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
         static void keepAlive(NPP);
+#endif
         void keepAlive();
 
     private:
@@ -271,6 +275,9 @@
         static BOOL WINAPI hookedEndPaint(HWND, const PAINTSTRUCT*);
 #endif
 
+        static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result);
+        bool platformGetValue(NPNVariable variable, void* value, NPError* result);
+
         RefPtr<Frame> m_parentFrame;
         RefPtr<PluginPackage> m_plugin;
         Element* m_element;
@@ -329,7 +336,7 @@
         String m_pluginsPage;
 
         String m_mimeType;
-        CString m_userAgent;
+        WTF::CString m_userAgent;
 
         NPP m_instance;
         NPP_t m_instanceStruct;
@@ -387,6 +394,7 @@
         void setNPWindowIfNeeded();
 #elif defined(XP_MACOSX)
         NP_CGContext m_npCgContext;
+        OwnPtr<Timer<PluginView> > m_nullEventTimer;
         NPDrawingModel m_drawingModel;
         NPEventModel m_eventModel;
         CGContextRef m_contextRef;
@@ -395,8 +403,11 @@
         QPixmap m_pixmap;
 #endif
 
+        Point m_lastMousePos;
         void setNPWindowIfNeeded();
+        void nullEventTimerFired(Timer<PluginView>*);
         Point globalMousePosForPlugin() const;
+        Point mousePosForPlugin(MouseEvent* event = 0) const;
 #endif
 
 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/WebCore/plugins/PluginViewNone.cpp b/WebCore/plugins/PluginViewNone.cpp
index 2821afc..bb27357 100644
--- a/WebCore/plugins/PluginViewNone.cpp
+++ b/WebCore/plugins/PluginViewNone.cpp
@@ -67,15 +67,15 @@
     return 0;
 }
 
-NPError PluginView::getValue(NPNVariable, void*)
+bool PluginView::platformGetValue(NPNVariable, void*, NPError*)
 {
-    return 0;
+    return false;
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-NPError PluginView::getValueStatic(NPNVariable, void*)
+bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*)
 {
-    return 0;
+    return false;
 }
 #endif
 
@@ -120,8 +120,28 @@
 {
 }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
 void PluginView::keepAlive(NPP)
 {
 }
+#endif
+
+void PluginView::privateBrowsingStateChanged(bool)
+{
+}
+
+void PluginView::setJavaScriptPaused(bool)
+{
+}
+
+#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+void PluginView::handleFocusInEvent()
+{
+}
+
+void PluginView::handleFocusOutEvent()
+{
+}
+#endif
 
 } // namespace WebCore
diff --git a/WebCore/plugins/gtk/PluginPackageGtk.cpp b/WebCore/plugins/gtk/PluginPackageGtk.cpp
index 271a4a8..d975666 100644
--- a/WebCore/plugins/gtk/PluginPackageGtk.cpp
+++ b/WebCore/plugins/gtk/PluginPackageGtk.cpp
@@ -32,12 +32,12 @@
 #include <gio/gio.h>
 #include <stdio.h>
 
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "MIMETypeRegistry.h"
 #include "NotImplemented.h"
 #include "npruntime_impl.h"
 #include "PluginDebug.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -69,6 +69,9 @@
     }
 
     const gchar* types = NP_GetMIMEDescription();
+    if (!types)
+        return true;
+
     gchar** mimeDescs = g_strsplit(types, ";", -1);
     for (int i = 0; mimeDescs[i] && mimeDescs[i][0]; i++) {
         gchar** mimeData = g_strsplit(mimeDescs[i], ":", 3);
@@ -116,6 +119,14 @@
         finalPath.set(g_file_get_path(resolvedFile.get()));
     }
 
+    // No joke. If there is a netscape component in the path, go back
+    // to the symlink, as flash breaks otherwise.
+    // See http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/plugins/plugin_list_posix.cc
+    GOwnPtr<gchar> baseName(g_path_get_basename(finalPath.get()));
+    if (!g_strcmp0(baseName.get(), "libflashplayer.so")
+        && g_strstr_len(finalPath.get(), -1, "/netscape/"))
+        finalPath.set(g_strdup(m_path.utf8().data()));
+
     m_module = g_module_open(finalPath.get(), G_MODULE_BIND_LOCAL);
 
     if (!m_module) {
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 222584c..8de63e0 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
  * Copyright (C) 2008 Collabora Ltd. All rights reserved.
  * Copyright (C) 2009, 2010 Kakai, Inc. <brian@kakai.com>
+ * Copyright (C) 2010 Igalia S.L.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -129,31 +130,22 @@
     m_clipRect = windowClipRect();
     m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
 
-    if (platformPluginWidget() && (m_windowRect != oldWindowRect || m_clipRect != oldClipRect))
-        setNPWindowIfNeeded();
+    if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
+        return;
 
 #if defined(XP_UNIX)
-    if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
+    if (!m_isWindowed) {
         if (m_drawable)
             XFreePixmap(GDK_DISPLAY(), m_drawable);
-
+            
         m_drawable = XCreatePixmap(GDK_DISPLAY(), getRootWindow(m_parentFrame.get()),
                                    m_windowRect.width(), m_windowRect.height(),
                                    ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
         XSync(GDK_DISPLAY(), False); // make sure that the server knows about the Drawable
     }
-
-    // do not call setNPWindowIfNeeded() immediately, will be called on paint()
-    m_hasPendingGeometryChange = true;
 #endif
 
-    // In order to move/resize the plugin window at the same time as the
-    // rest of frame during e.g. scrolling, we set the window geometry
-    // in the paint() function, but as paint() isn't called when the
-    // plugin window is outside the frame which can be caused by a
-    // scroll, we need to move/resize immediately.
-    if (!m_windowRect.intersects(frameView->frameRect()))
-        setNPWindowIfNeeded();
+    setNPWindowIfNeeded();
 }
 
 void PluginView::setFocus()
@@ -507,12 +499,6 @@
     if (m_isWindowed && !platformPluginWidget())
         return;
 
-#if defined(XP_UNIX)
-    if (!m_hasPendingGeometryChange)
-        return;
-    m_hasPendingGeometryChange = false;
-#endif
-
     if (m_isWindowed) {
         m_npWindow.x = m_windowRect.x();
         m_npWindow.y = m_windowRect.y();
@@ -601,10 +587,8 @@
     return NPERR_NO_ERROR;
 }
 
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVToolkit:
 #if defined(XP_UNIX)
@@ -612,7 +596,8 @@
 #else
         *static_cast<uint32*>(value) = 0;
 #endif
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVSupportsXEmbedBool:
 #if defined(XP_UNIX)
@@ -620,11 +605,13 @@
 #else
         *static_cast<NPBool*>(value) = false;
 #endif
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVjavascriptEnabledBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVSupportsWindowless:
 #if defined(XP_UNIX)
@@ -632,17 +619,16 @@
 #else
         *static_cast<NPBool*>(value) = false;
 #endif
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     default:
-        return NPERR_GENERIC_ERROR;
+        return false;
     }
 }
 
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVxDisplay:
 #if defined(XP_UNIX)
@@ -650,56 +636,21 @@
             *(void **)value = (void *)GDK_DISPLAY();
         else
             *(void **)value = (void *)GTK_XTBIN(platformPluginWidget())->xtclient.xtdisplay;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
 #else
-        return NPERR_GENERIC_ERROR;
+        *result = NPERR_GENERIC_ERROR;
 #endif
+        return true;
 
 #if defined(XP_UNIX)
     case NPNVxtAppContext:
         if (!m_needsXEmbed) {
             *(void **)value = XtDisplayToApplicationContext (GTK_XTBIN(platformPluginWidget())->xtclient.xtdisplay);
 
-            return NPERR_NO_ERROR;
+            *result = NPERR_NO_ERROR;
         } else
-            return NPERR_GENERIC_ERROR;
-#endif
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        case NPNVWindowNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
-
-            NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
-
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (windowScriptObject)
-                _NPN_RetainObject(windowScriptObject);
-
-            void** v = (void**)value;
-            *v = windowScriptObject;
-            
-            return NPERR_NO_ERROR;
-        }
-
-        case NPNVPluginElementNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
-
-            NPObject* pluginScriptObject = 0;
-
-            if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-                pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
-
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (pluginScriptObject)
-                _NPN_RetainObject(pluginScriptObject);
-
-            void** v = (void**)value;
-            *v = pluginScriptObject;
-
-            return NPERR_NO_ERROR;
-        }
+            *result = NPERR_GENERIC_ERROR;
+        return true;
 #endif
 
         case NPNVnetscapeWindow: {
@@ -711,11 +662,12 @@
             HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value);
             *w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformPageClient()->window);
 #endif
-            return NPERR_NO_ERROR;
+            *result = NPERR_NO_ERROR;
+            return true;
         }
 
-        default:
-            return getValueStatic(variable, value);
+    default:
+        return false;
     }
 }
 
@@ -768,12 +720,6 @@
 #endif
 }
 
-static gboolean
-plug_removed_cb(GtkSocket* socket, gpointer)
-{
-    return TRUE;
-}
-
 #if defined(XP_UNIX)
 static void getVisualAndColormap(int depth, Visual** visual, Colormap* colormap)
 {
@@ -812,6 +758,27 @@
 }
 #endif
 
+static gboolean plugRemovedCallback(GtkSocket* socket, gpointer)
+{
+    return TRUE;
+}
+
+static void plugAddedCallback(GtkSocket* socket, PluginView* view)
+{
+    if (!socket || !view)
+        return;
+
+    // FIXME: Java Plugins do not seem to draw themselves properly the
+    // first time unless we do a size-allocate after they have done
+    // the plug operation on their side, which in general does not
+    // happen since we do size-allocates before setting the
+    // NPWindow. Apply this workaround until we figure out a better
+    // solution, if any.
+    IntRect rect = view->frameRect();
+    GtkAllocation allocation = { rect.x(), rect.y(), rect.width(), rect.height() };
+    gtk_widget_size_allocate(GTK_WIDGET(socket), &allocation);
+}
+
 bool PluginView::platformStart()
 {
     ASSERT(m_isStarted);
@@ -828,15 +795,25 @@
 
     if (m_isWindowed) {
 #if defined(XP_UNIX)
+        GtkWidget* pageClient = m_parentFrame->view()->hostWindow()->platformPageClient();
+
         if (m_needsXEmbed) {
+            // If our parent is not anchored the startup process will
+            // fail miserably for XEmbed plugins a bit later on when
+            // we try to get the ID of our window (since realize will
+            // fail), so let's just abort here.
+            if (!gtk_widget_get_parent(pageClient))
+                return false;
+
             setPlatformWidget(gtk_socket_new());
-            gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformPageClient()), platformPluginWidget());
-            g_signal_connect(platformPluginWidget(), "plug_removed", G_CALLBACK(plug_removed_cb), NULL);
+            gtk_container_add(GTK_CONTAINER(pageClient), platformPluginWidget());
+            g_signal_connect(platformPluginWidget(), "plug-added", G_CALLBACK(plugAddedCallback), this);
+            g_signal_connect(platformPluginWidget(), "plug-removed", G_CALLBACK(plugRemovedCallback), NULL);
         } else
-            setPlatformWidget(gtk_xtbin_new(m_parentFrame->view()->hostWindow()->platformPageClient()->window, 0));
+            setPlatformWidget(gtk_xtbin_new(pageClient->window, 0));
 #else
         setPlatformWidget(gtk_socket_new());
-        gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformPageClient()), platformPluginWidget());
+        gtk_container_add(GTK_CONTAINER(pageClient), platformPluginWidget());
 #endif
     } else {
         setPlatformWidget(0);
@@ -909,10 +886,8 @@
 #endif
 
     // TODO remove in favor of null events, like mac port?
-    if (!(m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall))) {
+    if (!(m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall)))
         updatePluginWidget(); // was: setNPWindowIfNeeded(), but this doesn't produce 0x0 rects at first go
-        setNPWindowIfNeeded();
-    }
 
     return true;
 }
diff --git a/WebCore/plugins/gtk/gtk2xtbin.c b/WebCore/plugins/gtk/gtk2xtbin.c
index 68c5373..fad66fe 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.c
+++ b/WebCore/plugins/gtk/gtk2xtbin.c
@@ -42,6 +42,7 @@
  * inside a GTK application.  
  */
 
+#include "GtkVersioning.h"
 #include "xembed.h"
 #include "gtk2xtbin.h"
 #include <gtk/gtk.h>
@@ -401,7 +402,7 @@
   xtbin->x = x;
   xtbin->y = y;
 
-  if (GTK_WIDGET_REALIZED (xtbin))
+  if (gtk_widget_get_realized (xtbin))
     gdk_window_move (GTK_WIDGET (xtbin)->window, x, y);
 }
 
@@ -456,7 +457,7 @@
   widget = GTK_WIDGET(object);
 
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
-  if (GTK_WIDGET_REALIZED (widget)) {
+  if (gtk_widget_get_realized (widget)) {
     xt_client_unrealize(&(xtbin->xtclient));
   }
 
diff --git a/WebCore/plugins/mac/PluginPackageMac.cpp b/WebCore/plugins/mac/PluginPackageMac.cpp
index be69242..9a297de 100644
--- a/WebCore/plugins/mac/PluginPackageMac.cpp
+++ b/WebCore/plugins/mac/PluginPackageMac.cpp
@@ -25,18 +25,16 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef __LP64__
-
 #include "config.h"
 #include "PluginPackage.h"
 
 #include <wtf/RetainPtr.h>
-#include "CString.h"
 #include "MIMETypeRegistry.h"
 #include "npruntime_impl.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
 #include "WebCoreNSStringExtras.h"
+#include <wtf/text/CString.h>
 
 #include <CoreFoundation/CoreFoundation.h>
 
@@ -307,9 +305,3 @@
     return NP_VERSION_MINOR;
 }
 } // namespace WebCore
-
-#else
-
-#include "../PluginPackageNone.cpp"
-
-#endif // !__LP64__
diff --git a/WebCore/plugins/mac/PluginViewMac.cpp b/WebCore/plugins/mac/PluginViewMac.cpp
index d415d8f..1fd4676 100644
--- a/WebCore/plugins/mac/PluginViewMac.cpp
+++ b/WebCore/plugins/mac/PluginViewMac.cpp
@@ -26,8 +26,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef __LP64__
-
 #include "config.h"
 #include "PluginView.h"
 
@@ -80,11 +78,7 @@
 #include <QPainter>
 #include "QWebPageClient.h"
 QT_BEGIN_NAMESPACE
-#if QT_VERSION < 0x040500
-extern Q_GUI_EXPORT WindowPtr qt_mac_window_for(const QWidget* w);
-#else
 extern Q_GUI_EXPORT OSWindowRef qt_mac_window_for(const QWidget* w);
-#endif
 QT_END_NAMESPACE
 #endif
 
@@ -101,7 +95,9 @@
 
 using namespace HTMLNames;
 
+#ifndef NP_NO_CARBON
 static int modifiersForEvent(UIEventWithKeyState *event);
+#endif
 
 static inline WindowRef nativeWindowFor(PlatformWidget widget)
 {
@@ -177,22 +173,31 @@
 
     // Gracefully handle unsupported drawing or event models. We can do this
     // now since the drawing and event model can only be set during NPP_New.
-    NPBool eventModelSupported, drawingModelSupported;
+#ifndef NP_NO_CARBON
+    NPBool eventModelSupported;
     if (getValueStatic(NPNVariable(NPNVsupportsCarbonBool + m_eventModel), &eventModelSupported) != NPERR_NO_ERROR
             || !eventModelSupported) {
+#endif
         m_status = PluginStatusCanNotLoadPlugin;
         LOG(Plugins, "Plug-in '%s' uses unsupported event model %s",
                 m_plugin->name().utf8().data(), prettyNameForEventModel(m_eventModel));
         return false;
+#ifndef NP_NO_CARBON
     }
+#endif
 
+#ifndef NP_NO_QUICKDRAW
+    NPBool drawingModelSupported;
     if (getValueStatic(NPNVariable(NPNVsupportsQuickDrawBool + m_drawingModel), &drawingModelSupported) != NPERR_NO_ERROR
             || !drawingModelSupported) {
+#endif
         m_status = PluginStatusCanNotLoadPlugin;
         LOG(Plugins, "Plug-in '%s' uses unsupported drawing model %s",
                 m_plugin->name().utf8().data(), prettyNameForDrawingModel(m_drawingModel));
         return false;
+#ifndef NP_NO_QUICKDRAW
     }
+#endif
 
 #if PLATFORM(QT)
     // Set the platformPluginWidget only in the case of QWebView so that the context menu appears in the right place.
@@ -209,16 +214,24 @@
 
     // Create a fake window relative to which all events will be sent when using offscreen rendering
     if (!platformPluginWidget()) {
+#ifndef NP_NO_CARBON
         // Make the default size really big. It is unclear why this is required but with a smaller size, mouse move
         // events don't get processed. Resizing the fake window to flash's size doesn't help.
         ::Rect windowBounds = { 0, 0, 1000, 1000 };
         CreateNewWindow(kDocumentWindowClass, kWindowStandardDocumentAttributes, &windowBounds, &m_fakeWindow);
         // Flash requires the window to be hilited to process mouse move events.
-        HiliteWindow(m_fakeWindow, true); 
+        HiliteWindow(m_fakeWindow, true);
+#endif
     }
 
     show();
 
+    // TODO: Implement null timer throttling depending on plugin activation
+    m_nullEventTimer.set(new Timer<PluginView>(this, &PluginView::nullEventTimerFired));
+    m_nullEventTimer->startRepeating(0.02);
+
+    m_lastMousePos.h = m_lastMousePos.v = 0;
+
     return true;
 }
 
@@ -228,40 +241,45 @@
         setPlatformPluginWidget(0);
     else {
         CGContextRelease(m_contextRef);
+#ifndef NP_NO_CARBON
         if (m_fakeWindow)
             DisposeWindow(m_fakeWindow);
+#endif
     }
 }
 
 // Used before the plugin view has been initialized properly, and as a
 // fallback for variables that do not require a view to resolve.
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVToolkit:
         *static_cast<uint32*>(value) = 0;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVjavascriptEnabledBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
 #ifndef NP_NO_CARBON
     case NPNVsupportsCarbonBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
 #endif
     case NPNVsupportsCocoaBool:
         *static_cast<NPBool*>(value) = false;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     // CoreGraphics is the only drawing model we support
     case NPNVsupportsCoreGraphicsBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
 #ifndef NP_NO_QUICKDRAW
     // QuickDraw is deprecated in 10.5 and not supported on 64-bit
@@ -270,61 +288,20 @@
     case NPNVsupportsOpenGLBool:
     case NPNVsupportsCoreAnimationBool:
         *static_cast<NPBool*>(value) = false;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     default:
-        return NPERR_GENERIC_ERROR;
+        return false;
     }
 }
 
 // Used only for variables that need a view to resolve
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* error)
 {
-    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
-
-    switch (variable) {
-    case NPNVWindowNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
-
-        // Return value is expected to be retained, as described in
-        // <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (windowScriptObject)
-            _NPN_RetainObject(windowScriptObject);
-
-        void** v = (void**)value;
-        *v = windowScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-
-    case NPNVPluginElementNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* pluginScriptObject = 0;
-
-        if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-            pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
-
-        // Return value is expected to be retained, as described in
-        // <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (pluginScriptObject)
-            _NPN_RetainObject(pluginScriptObject);
-
-        void** v = (void**)value;
-        *v = pluginScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-
-    default:
-        return getValueStatic(variable, value);
-    }
-
+    return false;
 }
+
 void PluginView::setParent(ScrollView* parent)
 {
     LOG(Plugins, "PluginView::setParent(%p)", parent);
@@ -370,6 +347,7 @@
 
     // TODO: Also handle and pass on blur events (focus lost)
 
+#ifndef NP_NO_CARBON
     EventRecord record;
     record.what = getFocusEvent;
     record.message = 0;
@@ -379,6 +357,7 @@
 
     if (!dispatchNPEvent(record))
         LOG(Events, "PluginView::setFocus(): Get-focus event not accepted");
+#endif
 }
 
 void PluginView::setParentVisible(bool visible)
@@ -415,7 +394,9 @@
         return;
 
     m_npWindow.window = (void*)&m_npCgContext;
+#ifndef NP_NO_CARBON
     m_npCgContext.window = newWindowRef;
+#endif
     m_npCgContext.context = newContextRef;
 
     m_npWindow.x = m_windowRect.x();
@@ -430,7 +411,7 @@
     m_npWindow.clipRect.bottom = m_windowRect.y() + m_windowRect.height();
 
     LOG(Plugins, "PluginView::setNPWindowIfNeeded(): window=%p, context=%p,"
-            " window.x:%ld window.y:%ld window.width:%d window.height:%d window.clipRect size:%dx%d",
+            " window.x:%d window.y:%d window.width:%d window.height:%d window.clipRect size:%dx%d",
             newWindowRef, newContextRef, m_npWindow.x, m_npWindow.y, m_npWindow.width, m_npWindow.height,
             m_npWindow.clipRect.right - m_npWindow.clipRect.left, m_npWindow.clipRect.bottom - m_npWindow.clipRect.top);
 
@@ -463,7 +444,7 @@
 #if PLATFORM(QT)
             m_pixmap = QPixmap(m_windowRect.size());
             m_pixmap.fill(Qt::transparent);
-            m_contextRef = qt_mac_cg_context(&m_pixmap);
+            m_contextRef = m_pixmap.isNull() ? 0 : qt_mac_cg_context(&m_pixmap);
 #endif
         }
     }
@@ -516,6 +497,7 @@
 #endif
     }
 
+#ifndef NP_NO_CARBON
     EventRecord event;
     event.what = updateEvt;
     event.message = (long unsigned int)m_npCgContext.window;
@@ -526,6 +508,7 @@
 
     if (!dispatchNPEvent(event))
         LOG(Events, "PluginView::paint(): Paint event not accepted");
+#endif
 
     CGContextRestoreGState(cgContext);
 
@@ -575,10 +558,13 @@
     if (!m_isStarted)
         return;
 
+#ifndef NP_NO_CARBON
     EventRecord record;
 
     if (event->type() == eventNames().mousemoveEvent) {
-        record.what = nullEvent;
+        // Mouse movement is handled by null timer events
+        m_lastMousePos = mousePosForPlugin(event);
+        return;
     } else if (event->type() == eventNames().mouseoverEvent) {
         record.what = adjustCursorEvent;
     } else if (event->type() == eventNames().mouseoutEvent) {
@@ -594,21 +580,7 @@
     } else {
         return;
     }
-
-    if (platformPluginWidget()) {
-        record.where = globalMousePosForPlugin();
-    } else {
-        if (event->button() == 2) {
-            // always pass the global position for right-click since Flash uses it to position the context menu
-            record.where = globalMousePosForPlugin();
-        } else {
-            IntPoint postZoomPos = roundedIntPoint(m_element->renderer()->absoluteToLocal(event->absoluteLocation()));
-            record.where.h = postZoomPos.x() + m_windowRect.x();
-            // The number 22 is the height of the title bar. As to why it figures in the calculation below 
-            // is left as an exercise to the reader :-)
-            record.where.v = postZoomPos.y() + m_windowRect.y() - 22;
-        }
-    }
+    record.where = mousePosForPlugin(event);
     record.modifiers = modifiersForEvent(event);
 
     if (!event->buttonDown())
@@ -626,6 +598,7 @@
     } else {
         event->setDefaultHandled();
     }
+#endif
 }
 
 void PluginView::handleKeyboardEvent(KeyboardEvent* event)
@@ -638,6 +611,7 @@
     LOG(Plugins, "PV::hKE(): KE.keyCode: 0x%02X, KE.charCode: %d",
             event->keyCode(), event->charCode());
 
+#ifndef NP_NO_CARBON
     EventRecord record;
 
     if (event->type() == eventNames().keydownEvent) {
@@ -698,8 +672,28 @@
         LOG(Events, "PluginView::handleKeyboardEvent(): Keyboard event type %d not accepted", record.what);
     else
         event->setDefaultHandled();
+#endif
 }
 
+#ifndef NP_NO_CARBON
+void PluginView::nullEventTimerFired(Timer<PluginView>*)
+{
+    EventRecord record;
+
+    record.what = nullEvent;
+    record.message = 0;
+    record.when = TickCount();
+    record.where = m_lastMousePos;
+    record.modifiers = GetCurrentKeyModifiers();
+    if (!Button())
+        record.modifiers |= btnState;
+
+    if (!dispatchNPEvent(record))
+        LOG(Events, "PluginView::nullEventTimerFired(): Null event not accepted");
+}
+#endif
+
+#ifndef NP_NO_CARBON
 static int modifiersForEvent(UIEventWithKeyState* event)
 {
     int modifiers = 0;
@@ -718,7 +712,9 @@
 
      return modifiers;
 }
+#endif
 
+#ifndef NP_NO_CARBON
 static bool tigerOrBetter()
 {
     static SInt32 systemVersion = 0;
@@ -730,7 +726,9 @@
 
     return systemVersion >= 0x1040;
 }
+#endif
 
+#ifndef NP_NO_CARBON
 Point PluginView::globalMousePosForPlugin() const
 {
     Point pos;
@@ -755,7 +753,31 @@
 
     return pos;
 }
+#endif
 
+#ifndef NP_NO_CARBON
+Point PluginView::mousePosForPlugin(MouseEvent* event) const
+{
+    ASSERT(event);
+    if (platformPluginWidget())
+        return globalMousePosForPlugin();
+
+    if (event->button() == 2) {
+        // always pass the global position for right-click since Flash uses it to position the context menu
+        return globalMousePosForPlugin();
+    }
+
+    Point pos;
+    IntPoint postZoomPos = roundedIntPoint(m_element->renderer()->absoluteToLocal(event->absoluteLocation()));
+    pos.h = postZoomPos.x() + m_windowRect.x();
+    // The number 22 is the height of the title bar. As to why it figures in the calculation below
+    // is left as an exercise to the reader :-)
+    pos.v = postZoomPos.y() + m_windowRect.y() - 22;
+    return pos;
+}
+#endif
+
+#ifndef NP_NO_CARBON
 bool PluginView::dispatchNPEvent(NPEvent& event)
 {
     PluginView::setCurrentPluginView(this);
@@ -768,6 +790,7 @@
     PluginView::setCurrentPluginView(0);
     return accepted;
 }
+#endif
 
 // ------------------- Miscellaneous  ------------------
 
@@ -805,9 +828,3 @@
 }
 
 } // namespace WebCore
-
-#else
-
-#include "../PluginViewNone.cpp"
-
-#endif // !__LP64__
diff --git a/WebCore/plugins/qt/PluginPackageQt.cpp b/WebCore/plugins/qt/PluginPackageQt.cpp
index 74deaf6..018c64f 100644
--- a/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -27,11 +27,11 @@
 #include "config.h"
 #include "PluginPackage.h"
 
-#include "CString.h"
 #include "MIMETypeRegistry.h"
 #include "npruntime_impl.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index 49c0000..fb88b87 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -553,96 +553,64 @@
     return NPERR_NO_ERROR;
 }
 
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVToolkit:
         *static_cast<uint32*>(value) = 0;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVSupportsXEmbedBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVjavascriptEnabledBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVSupportsWindowless:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     default:
-        return NPERR_GENERIC_ERROR;
+        return false;
     }
 }
 
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVxDisplay:
         *(void **)value = QX11Info::display();
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVxtAppContext:
-        return NPERR_GENERIC_ERROR;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    case NPNVWindowNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
-
-        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (windowScriptObject)
-            _NPN_RetainObject(windowScriptObject);
-
-        void** v = (void**)value;
-        *v = windowScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-
-    case NPNVPluginElementNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* pluginScriptObject = 0;
-
-        if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-            pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
-
-        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (pluginScriptObject)
-            _NPN_RetainObject(pluginScriptObject);
-
-        void** v = (void**)value;
-        *v = pluginScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-#endif
+        *result = NPERR_GENERIC_ERROR;
+        return true;
 
     case NPNVnetscapeWindow: {
         void* w = reinterpret_cast<void*>(value);
         QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
         *((XID *)w) = client ? client->ownerWidget()->window()->winId() : 0;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
     }
 
     case NPNVToolkit:
         if (m_plugin->quirks().contains(PluginQuirkRequiresGtkToolKit)) {
             *((uint32 *)value) = 2;
-            return NPERR_NO_ERROR;
+            *result = NPERR_NO_ERROR;
+            return true;
         }
-        // fall through
+        return false;
+
     default:
-        return getValueStatic(variable, value);
+        return false;
     }
 }
 
diff --git a/WebCore/plugins/symbian/PluginContainerSymbian.cpp b/WebCore/plugins/symbian/PluginContainerSymbian.cpp
index aece0e4..b839870 100644
--- a/WebCore/plugins/symbian/PluginContainerSymbian.cpp
+++ b/WebCore/plugins/symbian/PluginContainerSymbian.cpp
@@ -32,12 +32,12 @@
 
 using namespace WebCore;
 
-PluginContainerSymbian::PluginContainerSymbian(PluginView* view, QWidget* parent)
-    : m_parent(parent)
+PluginContainerSymbian::PluginContainerSymbian(PluginView* view, QWidget* parent, QGraphicsProxyWidget* proxy)
+    : QWidget(parent)
     , m_pluginView(view)
+    , m_proxy(proxy)
     , m_hasPendingGeometryChange(false)
 {
-    setParent(m_parent);
 }
 
 PluginContainerSymbian::~PluginContainerSymbian()
@@ -62,7 +62,7 @@
     }
 }
 
-void PluginContainerSymbian::focusInEvent(QFocusEvent* event)
+void PluginContainerSymbian::focusInEvent(QFocusEvent*)
 {
     if (Page* page = m_pluginView->parentFrame()->page())
         page->focusController()->setActive(true);
diff --git a/WebCore/plugins/symbian/PluginContainerSymbian.h b/WebCore/plugins/symbian/PluginContainerSymbian.h
index fce4a71..fead872 100644
--- a/WebCore/plugins/symbian/PluginContainerSymbian.h
+++ b/WebCore/plugins/symbian/PluginContainerSymbian.h
@@ -22,6 +22,8 @@
 
 #include <QWidget>
 
+class QGraphicsProxyWidget;
+
 namespace WebCore {
 
     class PluginView;
@@ -29,18 +31,19 @@
     class PluginContainerSymbian : public QWidget {
         Q_OBJECT
     public:
-        PluginContainerSymbian(PluginView*, QWidget* parent);
+        PluginContainerSymbian(PluginView*, QWidget* parent, QGraphicsProxyWidget* proxy = 0);
         ~PluginContainerSymbian();
 
         void requestGeometry(const QRect&, const QRegion& clip = QRegion());
         void adjustGeometry();
+        QGraphicsProxyWidget* proxy() { return m_proxy; }
 
     protected:
         virtual void focusInEvent(QFocusEvent*);
         virtual void focusOutEvent(QFocusEvent*);
     private:
         PluginView* m_pluginView;
-        QWidget* m_parent;
+        QGraphicsProxyWidget* m_proxy;
         QRect m_windowRect;
         QRegion m_clipRegion;
         bool m_hasPendingGeometryChange;
diff --git a/WebCore/plugins/symbian/PluginPackageSymbian.cpp b/WebCore/plugins/symbian/PluginPackageSymbian.cpp
index 44f8152..d30f80e 100644
--- a/WebCore/plugins/symbian/PluginPackageSymbian.cpp
+++ b/WebCore/plugins/symbian/PluginPackageSymbian.cpp
@@ -19,13 +19,13 @@
 #include "config.h"
 #include "PluginPackage.h"
 
-#include "CString.h"
 #include "MIMETypeRegistry.h"
 #include "npinterface.h"
 #include "npruntime_impl.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
 #include <QPluginLoader>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/plugins/symbian/PluginViewSymbian.cpp b/WebCore/plugins/symbian/PluginViewSymbian.cpp
index 3492868..bae3b7f 100644
--- a/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -52,7 +52,9 @@
 #include "npfunctions.h"
 #include "npinterface.h"
 #include "npruntime_impl.h"
+#include "qgraphicswebview.h"
 #include "runtime_root.h"
+#include <QGraphicsProxyWidget>
 #include <QKeyEvent>
 #include <QPixmap>
 #include <QRegion>
@@ -85,6 +87,7 @@
     IntRect oldClipRect = m_clipRect;
     
     m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());
+    
     m_clipRect = windowClipRect();
     m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
     if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
@@ -307,66 +310,27 @@
     return NPERR_NO_ERROR;
 }
 
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
     case NPNVjavascriptEnabledBool:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     case NPNVSupportsWindowless:
         *static_cast<NPBool*>(value) = true;
-        return NPERR_NO_ERROR;
+        *result = NPERR_NO_ERROR;
+        return true;
 
     default:
-        return NPERR_GENERIC_ERROR;
+        return false;
     }
 }
 
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable, void*, NPError*)
 {
-    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
-
-    switch (variable) {
-    case NPNVWindowNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
-
-        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (windowScriptObject)
-            _NPN_RetainObject(windowScriptObject);
-
-        void** v = (void**)value;
-        *v = windowScriptObject;
-            
-        return NPERR_NO_ERROR;
-    }
-
-    case NPNVPluginElementNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* pluginScriptObject = 0;
-
-        if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-            pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
-
-        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-        if (pluginScriptObject)
-            _NPN_RetainObject(pluginScriptObject);
-
-        void** v = (void**)value;
-        *v = pluginScriptObject;
-
-        return NPERR_NO_ERROR;
-    }        
-    default:
-        return getValueStatic(variable, value);
-    }
+    return false;
 }
 
 void PluginView::invalidateRect(const IntRect& rect)
@@ -426,12 +390,15 @@
 
     if (m_isWindowed) {
         QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
-        // FIXME this will not work for QGraphicsView.
-        // But we cannot use winId because it will create a window and on S60,
-        // QWidgets should not create a window. 
-        Q_ASSERT(qobject_cast<QWidget*>(client->pluginParent()));
-        setPlatformWidget(new PluginContainerSymbian(this, 
-            qobject_cast<QWidget*>(client->pluginParent())));
+        QGraphicsProxyWidget* proxy = 0;
+        if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(client->pluginParent()))
+            proxy = new QGraphicsProxyWidget(webView);
+
+        PluginContainerSymbian* container = new PluginContainerSymbian(this, proxy ? 0 : client->ownerWidget(), proxy);
+        setPlatformWidget(container);
+        if (proxy)
+            proxy->setWidget(container);
+        
         m_npWindow.type = NPWindowTypeWindow;
         m_npWindow.window = (void*)platformPluginWidget();
 
@@ -447,7 +414,11 @@
 
 void PluginView::platformDestroy()
 {
-    delete platformPluginWidget();
+    QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+    if (client && qobject_cast<QGraphicsWebView*>(client->pluginParent()))
+        delete static_cast<PluginContainerSymbian*>(platformPluginWidget())->proxy();
+    else
+        delete platformPluginWidget();
 }
 
 void PluginView::halt()
diff --git a/WebCore/plugins/win/PluginMessageThrottlerWin.cpp b/WebCore/plugins/win/PluginMessageThrottlerWin.cpp
index b79ca20..46fee62 100644
--- a/WebCore/plugins/win/PluginMessageThrottlerWin.cpp
+++ b/WebCore/plugins/win/PluginMessageThrottlerWin.cpp
@@ -29,16 +29,26 @@
 
 #include "PluginView.h"
 #include <wtf/ASCIICType.h>
+#include <wtf/CurrentTime.h>
 
 using namespace WTF;
 
 namespace WebCore {
 
-static const double MessageThrottleTimeInterval = 0.001;
+// Set a timer to make sure we process any queued messages at least every 16ms.
+// This value allows Flash 60 messages/second, which should be enough for video
+// playback, and also gets us over the limit for kicking into high-resolution
+// timer mode (see SharedTimerWin.cpp).
+static const double MessageThrottleTimeInterval = 0.016;
+
+// During a continuous stream of messages, process one every 5ms.
+static const double MessageDirectProcessingInterval = 0.005;
 
 PluginMessageThrottlerWin::PluginMessageThrottlerWin(PluginView* pluginView)
-    : m_back(0), m_front(0)
+    : m_back(0)
+    , m_front(0)
     , m_pluginView(pluginView)
+    , m_lastMessageTime(0)
     , m_messageThrottleTimer(this, &PluginMessageThrottlerWin::messageThrottleTimerFired)
 {
     // Initialize the free list with our inline messages
@@ -74,11 +84,21 @@
     if (!m_front)
         m_front = message;
 
+    // If it has been more than MessageDirectProcessingInterval between throttled messages,
+    // go ahead and process a message directly.
+    double currentTime = WTF::currentTime();
+    if (currentTime - m_lastMessageTime > MessageDirectProcessingInterval) {
+        processQueuedMessage();
+        m_lastMessageTime = currentTime;
+        if (!m_front)
+            return;
+    }
+
     if (!m_messageThrottleTimer.isActive())
         m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
 }
 
-void PluginMessageThrottlerWin::messageThrottleTimerFired(Timer<PluginMessageThrottlerWin>*)
+void PluginMessageThrottlerWin::processQueuedMessage()
 {
     PluginMessage* message = m_front;
     m_front = m_front->next;
@@ -91,6 +111,11 @@
     ::CallWindowProc(m_pluginView->pluginWndProc(), message->hWnd, message->msg, message->wParam, message->lParam);
 
     freeMessage(message);
+}
+
+void PluginMessageThrottlerWin::messageThrottleTimerFired(Timer<PluginMessageThrottlerWin>*)
+{
+    processQueuedMessage();
 
     if (m_front)
         m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
diff --git a/WebCore/plugins/win/PluginMessageThrottlerWin.h b/WebCore/plugins/win/PluginMessageThrottlerWin.h
index c74beab..0a7be70 100644
--- a/WebCore/plugins/win/PluginMessageThrottlerWin.h
+++ b/WebCore/plugins/win/PluginMessageThrottlerWin.h
@@ -51,6 +51,7 @@
         void appendMessage(HWND, UINT msg, WPARAM, LPARAM);
 
     private:
+        void processQueuedMessage();
         void messageThrottleTimerFired(Timer<PluginMessageThrottlerWin>*);
         PluginMessage* allocateMessage();
         bool isInlineMessage(PluginMessage* message);
@@ -65,6 +66,7 @@
         PluginMessage* m_freeInlineMessages;
 
         Timer<PluginMessageThrottlerWin> m_messageThrottleTimer;
+        double m_lastMessageTime;
     };
 
 } // namespace WebCore
diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp
index 203fb60..e70c2c2 100644
--- a/WebCore/plugins/win/PluginPackageWin.cpp
+++ b/WebCore/plugins/win/PluginPackageWin.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "PluginPackage.h"
 
-#include "CString.h"
 #include "MIMETypeRegistry.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
@@ -37,6 +36,7 @@
 #include "npruntime_impl.h"
 #include <string.h>
 #include <wtf/OwnArrayPtr.h>
+#include <wtf/text/CString.h>
 #include <shlwapi.h>
 
 namespace WebCore {
diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
index 04fda8e..01e425f 100644
--- a/WebCore/plugins/win/PluginViewWin.cpp
+++ b/WebCore/plugins/win/PluginViewWin.cpp
@@ -26,45 +26,41 @@
  */
 
 #include "config.h"
-
 #include "PluginView.h"
 
 #include "BitmapImage.h"
-#if !PLATFORM(WX)
-#include "BitmapInfo.h"
-#endif
 #include "Bridge.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
 #include "EventNames.h"
-#include "FrameLoader.h"
-#include "FrameLoadRequest.h"
-#include "FrameTree.h"
+#include "FocusController.h"
 #include "Frame.h"
+#include "FrameLoadRequest.h"
+#include "FrameLoader.h"
+#include "FrameTree.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
-#include "HostWindow.h"
-#include "Image.h"
 #include "HTMLNames.h"
 #include "HTMLPlugInElement.h"
+#include "HostWindow.h"
+#include "Image.h"
+#include "JSDOMBinding.h"
 #include "JSDOMWindow.h"
 #include "KeyboardEvent.h"
 #include "MIMETypeRegistry.h"
 #include "MouseEvent.h"
 #include "Page.h"
-#include "FocusController.h"
 #include "PlatformMouseEvent.h"
-#include "PluginMessageThrottlerWin.h"
-#include "PluginPackage.h"
-#include "PluginMainThreadScheduler.h"
-#include "RenderWidget.h"
-#include "JSDOMBinding.h"
-#include "ScriptController.h"
 #include "PluginDatabase.h"
 #include "PluginDebug.h"
+#include "PluginMainThreadScheduler.h"
+#include "PluginMessageThrottlerWin.h"
 #include "PluginPackage.h"
+#include "RenderWidget.h"
+#include "ScriptController.h"
 #include "Settings.h"
+#include "WebCoreInstanceHandle.h"
 #include "c_instance.h"
 #include "npruntime_impl.h"
 #include "runtime_root.h"
@@ -72,6 +68,10 @@
 #include <runtime/JSValue.h>
 #include <wtf/ASCIICType.h>
 
+#if !PLATFORM(WX)
+#include "BitmapInfo.h"
+#endif
+
 #if OS(WINCE)
 #undef LOG_NPERROR
 #define LOG_NPERROR(x)
@@ -289,10 +289,10 @@
     haveRegisteredWindowClass = true;
 
 #if PLATFORM(QT)
-    Page::setInstanceHandle((HINSTANCE)(qWinAppInst()));
+    WebCore::setInstanceHandle((HINSTANCE)(qWinAppInst()));
 #endif
 
-    ASSERT(Page::instanceHandle());
+    ASSERT(WebCore::instanceHandle());
 
 #if OS(WINCE)
     WNDCLASS wcex = { 0 };
@@ -309,7 +309,7 @@
     wcex.lpfnWndProc    = DefWindowProc;
     wcex.cbClsExtra     = 0;
     wcex.cbWndExtra     = 0;
-    wcex.hInstance      = Page::instanceHandle();
+    wcex.hInstance      = WebCore::instanceHandle();
     wcex.hIcon          = 0;
     wcex.hCursor        = LoadCursor(0, IDC_ARROW);
     wcex.hbrBackground  = (HBRUSH)COLOR_WINDOW;
@@ -867,73 +867,30 @@
     return NPERR_NO_ERROR;
 }
 
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*)
 {
-    LOG(Plugins, "PluginView::getValueStatic(%s)", prettyNameForNPNVariable(variable).data());
-
-    return NPERR_GENERIC_ERROR;
+    return false;
 }
 
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result)
 {
-    LOG(Plugins, "PluginView::getValue(%s)", prettyNameForNPNVariable(variable).data());
-
     switch (variable) {
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        case NPNVWindowNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
-
-            NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
-
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (windowScriptObject)
-                _NPN_RetainObject(windowScriptObject);
-
-            void** v = (void**)value;
-            *v = windowScriptObject;
-
-            return NPERR_NO_ERROR;
-        }
-
-        case NPNVPluginElementNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
-
-            NPObject* pluginScriptObject = 0;
-
-            if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-                pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
-
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (pluginScriptObject)
-                _NPN_RetainObject(pluginScriptObject);
-
-            void** v = (void**)value;
-            *v = pluginScriptObject;
-
-            return NPERR_NO_ERROR;
-        }
-#endif
-
         case NPNVnetscapeWindow: {
             HWND* w = reinterpret_cast<HWND*>(value);
-
             *w = windowHandleForPageClient(parent() ? parent()->hostWindow()->platformPageClient() : 0);
-
-            return NPERR_NO_ERROR;
+            *result = NPERR_NO_ERROR;
+            return true;
         }
 
         case NPNVSupportsWindowless: {
-            NPBool *result = reinterpret_cast<NPBool*>(value);
-
-            *result = TRUE;
-            
-            return NPERR_NO_ERROR;
+            NPBool* flag = reinterpret_cast<NPBool*>(value);
+            *flag = TRUE;
+            *result = NPERR_NO_ERROR;
+            return true;
         }
 
-        default:
-            return NPERR_GENERIC_ERROR;
+    default:
+        return false;
     }
 }
 
@@ -1011,7 +968,7 @@
 
         HWND parentWindowHandle = windowHandleForPageClient(m_parentFrame->view()->hostWindow()->platformPageClient());
         HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
-                                       0, 0, 0, 0, parentWindowHandle, 0, Page::instanceHandle(), 0);
+                                       0, 0, 0, 0, parentWindowHandle, 0, WebCore::instanceHandle(), 0);
 
 #if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
         m_window = window;
diff --git a/WebCore/rendering/EllipsisBox.cpp b/WebCore/rendering/EllipsisBox.cpp
index 6ec3195..6f25861 100644
--- a/WebCore/rendering/EllipsisBox.cpp
+++ b/WebCore/rendering/EllipsisBox.cpp
@@ -36,8 +36,8 @@
         context->setFillColor(textColor, style->colorSpace());
     bool setShadow = false;
     if (style->textShadow()) {
-        context->setShadow(IntSize(style->textShadow()->x, style->textShadow()->y),
-                           style->textShadow()->blur, style->textShadow()->color, style->colorSpace());
+        context->setShadow(IntSize(style->textShadow()->x(), style->textShadow()->y()),
+                           style->textShadow()->blur(), style->textShadow()->color(), style->colorSpace());
         setShadow = true;
     }
 
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 34eec30..6ee610d 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -21,6 +21,7 @@
 #include "InlineFlowBox.h"
 
 #include "CachedImage.h"
+#include "CSSPropertyNames.h"
 #include "Document.h"
 #include "EllipsisBox.h"
 #include "GraphicsContext.h"
@@ -165,7 +166,7 @@
 
 void InlineFlowBox::adjustPosition(int dx, int dy)
 {
-    InlineRunBox::adjustPosition(dx, dy);
+    InlineBox::adjustPosition(dx, dy);
     for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
         child->adjustPosition(dx, dy);
     if (m_overflow)
@@ -288,14 +289,16 @@
             int letterSpacing = min(0, (int)rt->style(m_firstLine)->font().letterSpacing());
             rightLayoutOverflow = max(xPos + text->width() - letterSpacing, rightLayoutOverflow);
 
-            int leftGlyphOverflow = -strokeOverflow;
-            int rightGlyphOverflow = strokeOverflow - letterSpacing;
+            GlyphOverflow* glyphOverflow = static_cast<InlineTextBox*>(curr)->glyphOverflow();
+
+            int leftGlyphOverflow = -strokeOverflow - (glyphOverflow ? glyphOverflow->left : 0);
+            int rightGlyphOverflow = strokeOverflow - letterSpacing + (glyphOverflow ? glyphOverflow->right : 0);
             
             int childOverflowLeft = leftGlyphOverflow;
             int childOverflowRight = rightGlyphOverflow;
-            for (ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next) {
-                childOverflowLeft = min(childOverflowLeft, shadow->x - shadow->blur + leftGlyphOverflow);
-                childOverflowRight = max(childOverflowRight, shadow->x + shadow->blur + rightGlyphOverflow);
+            for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) {
+                childOverflowLeft = min(childOverflowLeft, shadow->x() - shadow->blur() + leftGlyphOverflow);
+                childOverflowRight = max(childOverflowRight, shadow->x() + shadow->blur() + rightGlyphOverflow);
             }
             
             leftVisualOverflow = min(xPos + childOverflowLeft, leftVisualOverflow);
@@ -412,35 +415,35 @@
 
         int lineHeight;
         int baseline;
-        Vector<const SimpleFontData*> usedFonts;
+        Vector<const SimpleFontData*>* usedFonts = 0;
         if (curr->isInlineTextBox())
-            static_cast<InlineTextBox*>(curr)->takeFallbackFonts(usedFonts);
+            usedFonts = static_cast<InlineTextBox*>(curr)->fallbackFonts();
 
-        if (!usedFonts.isEmpty()) {
-            usedFonts.append(curr->renderer()->style(m_firstLine)->font().primaryFont());
+        if (usedFonts) {
+            usedFonts->append(curr->renderer()->style(m_firstLine)->font().primaryFont());
             Length parentLineHeight = curr->renderer()->parent()->style()->lineHeight();
             if (parentLineHeight.isNegative()) {
                 int baselineToBottom = 0;
                 baseline = 0;
-                for (size_t i = 0; i < usedFonts.size(); ++i) {
-                    int halfLeading = (usedFonts[i]->lineSpacing() - usedFonts[i]->ascent() - usedFonts[i]->descent()) / 2;
-                    baseline = max(baseline, halfLeading + usedFonts[i]->ascent());
-                    baselineToBottom = max(baselineToBottom, usedFonts[i]->lineSpacing() - usedFonts[i]->ascent() - usedFonts[i]->descent() - halfLeading);
+                for (size_t i = 0; i < usedFonts->size(); ++i) {
+                    int halfLeading = (usedFonts->at(i)->lineSpacing() - usedFonts->at(i)->ascent() - usedFonts->at(i)->descent()) / 2;
+                    baseline = max(baseline, halfLeading + usedFonts->at(i)->ascent());
+                    baselineToBottom = max(baselineToBottom, usedFonts->at(i)->lineSpacing() - usedFonts->at(i)->ascent() - usedFonts->at(i)->descent() - halfLeading);
                 }
                 lineHeight = baseline + baselineToBottom;
             } else if (parentLineHeight.isPercent()) {
                 lineHeight = parentLineHeight.calcMinValue(curr->renderer()->style()->fontSize());
                 baseline = 0;
-                for (size_t i = 0; i < usedFonts.size(); ++i) {
-                    int halfLeading = (lineHeight - usedFonts[i]->ascent() - usedFonts[i]->descent()) / 2;
-                    baseline = max(baseline, halfLeading + usedFonts[i]->ascent());
+                for (size_t i = 0; i < usedFonts->size(); ++i) {
+                    int halfLeading = (lineHeight - usedFonts->at(i)->ascent() - usedFonts->at(i)->descent()) / 2;
+                    baseline = max(baseline, halfLeading + usedFonts->at(i)->ascent());
                 }
             } else {
                 lineHeight = parentLineHeight.value();
                 baseline = 0;
-                for (size_t i = 0; i < usedFonts.size(); ++i) {
-                    int halfLeading = (lineHeight - usedFonts[i]->ascent() - usedFonts[i]->descent()) / 2;
-                    baseline = max(baseline, halfLeading + usedFonts[i]->ascent());
+                for (size_t i = 0; i < usedFonts->size(); ++i) {
+                    int halfLeading = (lineHeight - usedFonts->at(i)->ascent() - usedFonts->at(i)->descent()) / 2;
+                    baseline = max(baseline, halfLeading + usedFonts->at(i)->ascent());
                 }
             }
         } else {
@@ -562,15 +565,17 @@
                 continue;
 
             int strokeOverflow = static_cast<int>(ceilf(rt->style()->textStrokeWidth() / 2.0f));
-            
-            int topGlyphOverflow = -strokeOverflow;
-            int bottomGlyphOverflow = strokeOverflow;
-            
+
+            GlyphOverflow* glyphOverflow = static_cast<InlineTextBox*>(curr)->glyphOverflow();
+
+            int topGlyphOverflow = -strokeOverflow - (glyphOverflow ? glyphOverflow->top : 0);
+            int bottomGlyphOverflow = strokeOverflow + (glyphOverflow ? glyphOverflow->bottom : 0);
+
             int childOverflowTop = topGlyphOverflow;
             int childOverflowBottom = bottomGlyphOverflow;
-            for (ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next) {
-                childOverflowTop = min(childOverflowTop, shadow->y - shadow->blur + topGlyphOverflow);
-                childOverflowBottom = max(childOverflowBottom, shadow->y + shadow->blur + bottomGlyphOverflow);
+            for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) {
+                childOverflowTop = min(childOverflowTop, shadow->y() - shadow->blur() + topGlyphOverflow);
+                childOverflowBottom = max(childOverflowBottom, shadow->y() + shadow->blur() + bottomGlyphOverflow);
             }
             
             topVisualOverflow = min(curr->y() + childOverflowTop, topVisualOverflow);
@@ -703,11 +708,11 @@
         // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
         // but it isn't even clear how this should work at all.
         int xOffsetOnLine = 0;
-        for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
+        for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
             xOffsetOnLine += curr->width();
         int startX = tx - xOffsetOnLine;
         int totalWidth = xOffsetOnLine;
-        for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
+        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
             totalWidth += curr->width();
         paintInfo.context->save();
         paintInfo.context->clip(IntRect(tx, ty, width(), height()));
@@ -760,7 +765,7 @@
         if (styleToUse->boxShadow())
             paintBoxShadow(context, styleToUse, Normal, tx, ty, w, h);
 
-        Color c = styleToUse->backgroundColor();
+        Color c = styleToUse->visitedDependentColor(CSSPropertyBackgroundColor);
         paintFillLayers(paintInfo, c, styleToUse->backgroundLayers(), tx, ty, w, h);
 
         if (styleToUse->boxShadow())
@@ -788,11 +793,11 @@
                 // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
                 // but it isn't even clear how this should work at all.
                 int xOffsetOnLine = 0;
-                for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
+                for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
                     xOffsetOnLine += curr->width();
                 int startX = tx - xOffsetOnLine;
                 int totalWidth = xOffsetOnLine;
-                for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
+                for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
                     totalWidth += curr->width();
                 context->save();
                 context->clip(IntRect(tx, ty, w, h));
@@ -859,11 +864,11 @@
         // We have a mask image that spans multiple lines.
         // We need to adjust _tx and _ty by the width of all previous lines.
         int xOffsetOnLine = 0;
-        for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
+        for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
             xOffsetOnLine += curr->width();
         int startX = tx - xOffsetOnLine;
         int totalWidth = xOffsetOnLine;
-        for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
+        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
             totalWidth += curr->width();
         paintInfo.context->save();
         paintInfo.context->clip(IntRect(tx, ty, w, h));
@@ -957,7 +962,7 @@
         tx += borderLeft() + paddingLeft();
 
         Color underline, overline, linethrough;
-        underline = overline = linethrough = styleToUse->color();
+        underline = overline = linethrough = styleToUse->visitedDependentColor(CSSPropertyColor);
         if (!parent())
             renderer()->getTextDecorationColors(deco, underline, overline, linethrough);
 
@@ -976,15 +981,15 @@
 
         bool setClip = false;
         int extraOffset = 0;
-        ShadowData* shadow = styleToUse->textShadow();
-        if (!linesAreOpaque && shadow && shadow->next) {
+        const ShadowData* shadow = styleToUse->textShadow();
+        if (!linesAreOpaque && shadow && shadow->next()) {
             IntRect clipRect(tx, ty, w, baselinePos + 2);
-            for (ShadowData* s = shadow; s; s = s->next) {
+            for (const ShadowData* s = shadow; s; s = s->next()) {
                 IntRect shadowRect(tx, ty, w, baselinePos + 2);
-                shadowRect.inflate(s->blur);
-                shadowRect.move(s->x, s->y);
+                shadowRect.inflate(s->blur());
+                shadowRect.move(s->x(), s->y());
                 clipRect.unite(shadowRect);
-                extraOffset = max(extraOffset, max(0, s->y) + s->blur);
+                extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
             }
             context->save();
             context->clip(clipRect);
@@ -997,14 +1002,14 @@
         bool setShadow = false;
         do {
             if (shadow) {
-                if (!shadow->next) {
+                if (!shadow->next()) {
                     // The last set of lines paints normally inside the clip.
                     ty -= extraOffset;
                     extraOffset = 0;
                 }
-                context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);
+                context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
                 setShadow = true;
-                shadow = shadow->next;
+                shadow = shadow->next();
             }
 
             if (paintUnderline) {
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index 23b5cc9..ecb4724 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -21,7 +21,7 @@
 #ifndef InlineFlowBox_h
 #define InlineFlowBox_h
 
-#include "InlineRunBox.h"
+#include "InlineBox.h"
 #include "RenderOverflow.h"
 
 namespace WebCore {
@@ -30,12 +30,14 @@
 class HitTestResult;
 class RenderLineBoxList;
 
-class InlineFlowBox : public InlineRunBox {
+class InlineFlowBox : public InlineBox {
 public:
     InlineFlowBox(RenderObject* obj)
-        : InlineRunBox(obj)
+        : InlineBox(obj)
         , m_firstChild(0)
         , m_lastChild(0)
+        , m_prevLineBox(0)
+        , m_nextLineBox(0)
         , m_includeLeftEdge(false)
         , m_includeRightEdge(false)
 #ifndef NDEBUG
@@ -54,8 +56,10 @@
     virtual ~InlineFlowBox();
 #endif
 
-    InlineFlowBox* prevFlowBox() const { return static_cast<InlineFlowBox*>(m_prevLine); }
-    InlineFlowBox* nextFlowBox() const { return static_cast<InlineFlowBox*>(m_nextLine); }
+    InlineFlowBox* prevLineBox() const { return m_prevLineBox; }
+    InlineFlowBox* nextLineBox() const { return m_nextLineBox; }
+    void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; }
+    void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; }
 
     InlineBox* firstChild() const { checkConsistency(); return m_firstChild; }
     InlineBox* lastChild() const { checkConsistency(); return m_lastChild; }
@@ -164,12 +168,14 @@
 protected:
     OwnPtr<RenderOverflow> m_overflow;
 
-private:
     virtual bool isInlineFlowBox() const { return true; }
 
     InlineBox* m_firstChild;
     InlineBox* m_lastChild;
     
+    InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
+    InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
+
     bool m_includeLeftEdge : 1;
     bool m_includeRightEdge : 1;
     bool m_hasTextChildren : 1;
diff --git a/WebCore/rendering/InlineRunBox.h b/WebCore/rendering/InlineRunBox.h
deleted file mode 100644
index cbc82d5..0000000
--- a/WebCore/rendering/InlineRunBox.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc.
- *
- * 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 InlineRunBox_h
-#define InlineRunBox_h
-
-#include "InlineBox.h"
-
-namespace WebCore {
-
-class InlineRunBox : public InlineBox {
-public:
-    InlineRunBox(RenderObject* obj)
-        : InlineBox(obj)
-        , m_prevLine(0)
-        , m_nextLine(0)
-    {
-    }
-
-    InlineRunBox* prevLineBox() const { return m_prevLine; }
-    InlineRunBox* nextLineBox() const { return m_nextLine; }
-    void setNextLineBox(InlineRunBox* n) { m_nextLine = n; }
-    void setPreviousLineBox(InlineRunBox* p) { m_prevLine = p; }
-
-    virtual void paintBoxDecorations(RenderObject::PaintInfo&, int /*tx*/, int /*ty*/) { }
-    virtual void paintTextDecorations(RenderObject::PaintInfo&, int /*tx*/, int /*ty*/, bool /*paintedChildren*/ = false) { }
-    
-protected:
-    InlineRunBox* m_prevLine;  // The previous box that also uses our RenderObject
-    InlineRunBox* m_nextLine;  // The next box that also uses our RenderObject
-};
-
-} // namespace WebCore
-
-#endif // InlineRunBox_h
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index 9f17b0c..9c28b42 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -273,7 +273,7 @@
     return false;
 }
 
-static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, ShadowData* shadow, bool stroked)
+static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, const ShadowData* shadow, bool stroked)
 {
     Color fillColor = context->fillColor();
     ColorSpace fillColorSpace = context->fillColorSpace();
@@ -285,11 +285,11 @@
         IntSize extraOffset;
 
         if (shadow) {
-            IntSize shadowOffset(shadow->x, shadow->y);
-            int shadowBlur = shadow->blur;
-            const Color& shadowColor = shadow->color;
+            IntSize shadowOffset(shadow->x(), shadow->y());
+            int shadowBlur = shadow->blur();
+            const Color& shadowColor = shadow->color();
 
-            if (shadow->next || stroked || !opaque) {
+            if (shadow->next() || stroked || !opaque) {
                 IntRect shadowRect(x, y, w, h);
                 shadowRect.inflate(shadowBlur);
                 shadowRect.move(shadowOffset);
@@ -315,12 +315,12 @@
         if (!shadow)
             break;
 
-        if (shadow->next || stroked || !opaque)
+        if (shadow->next() || stroked || !opaque)
             context->restore();
         else
             context->clearShadow();
 
-        shadow = shadow->next;
+        shadow = shadow->next();
     } while (shadow || stroked || !opaque);
 }
 
@@ -405,24 +405,20 @@
     Color textFillColor;
     Color textStrokeColor;
     float textStrokeWidth = styleToUse->textStrokeWidth();
-    ShadowData* textShadow = paintInfo.forceBlackText ? 0 : styleToUse->textShadow();
+    const ShadowData* textShadow = paintInfo.forceBlackText ? 0 : styleToUse->textShadow();
 
     if (paintInfo.forceBlackText) {
         textFillColor = Color::black;
         textStrokeColor = Color::black;
     } else {
-        textFillColor = styleToUse->textFillColor();
-        if (!textFillColor.isValid())
-            textFillColor = styleToUse->color();
-
+        textFillColor = styleToUse->visitedDependentColor(CSSPropertyWebkitTextFillColor);
+        
         // Make the text fill color legible against a white background
         if (styleToUse->forceBackgroundsToWhite())
             textFillColor = correctedTextColor(textFillColor, Color::white);
 
-        textStrokeColor = styleToUse->textStrokeColor();
-        if (!textStrokeColor.isValid())
-            textStrokeColor = styleToUse->color();
-
+        textStrokeColor = styleToUse->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
+        
         // Make the text stroke color legible against a white background
         if (styleToUse->forceBackgroundsToWhite())
             textStrokeColor = correctedTextColor(textStrokeColor, Color::white);
@@ -434,7 +430,7 @@
     Color selectionFillColor = textFillColor;
     Color selectionStrokeColor = textStrokeColor;
     float selectionStrokeWidth = textStrokeWidth;
-    ShadowData* selectionShadow = textShadow;
+    const ShadowData* selectionShadow = textShadow;
     if (haveSelection) {
         // Check foreground color first.
         Color foreground = paintInfo.forceBlackText ? Color::black : renderer()->selectionForegroundColor();
@@ -445,7 +441,7 @@
         }
 
         if (RenderStyle* pseudoStyle = renderer()->getCachedPseudoStyle(SELECTION)) {
-            ShadowData* shadow = paintInfo.forceBlackText ? 0 : pseudoStyle->textShadow();
+            const ShadowData* shadow = paintInfo.forceBlackText ? 0 : pseudoStyle->textShadow();
             if (shadow != selectionShadow) {
                 if (!paintSelectedTextOnly)
                     paintSelectedTextSeparately = true;
@@ -517,7 +513,7 @@
 
     // Paint decorations
     if (d != TDNONE && paintInfo.phase != PaintPhaseSelection && styleToUse->htmlHacks()) {
-        context->setStrokeColor(styleToUse->color(), styleToUse->colorSpace());
+        context->setStrokeColor(styleToUse->visitedDependentColor(CSSPropertyColor), styleToUse->colorSpace());
         paintDecoration(context, tx, ty, d, textShadow);
     }
 
@@ -577,7 +573,7 @@
     if (sPos >= ePos)
         return;
 
-    Color textColor = style->color();
+    Color textColor = style->visitedDependentColor(CSSPropertyColor);
     Color c = renderer()->selectionBackgroundColor();
     if (!c.isValid() || c.alpha() == 0)
         return;
@@ -644,7 +640,7 @@
 
 #endif
 
-void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, ShadowData* shadow)
+void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, const ShadowData* shadow)
 {
     tx += m_x;
     ty += m_y;
@@ -673,15 +669,15 @@
 
     bool setClip = false;
     int extraOffset = 0;
-    if (!linesAreOpaque && shadow && shadow->next) {
+    if (!linesAreOpaque && shadow && shadow->next()) {
         context->save();
         IntRect clipRect(tx, ty, width, baseline + 2);
-        for (ShadowData* s = shadow; s; s = s->next) {
+        for (const ShadowData* s = shadow; s; s = s->next()) {
             IntRect shadowRect(tx, ty, width, baseline + 2);
-            shadowRect.inflate(s->blur);
-            shadowRect.move(s->x, s->y);
+            shadowRect.inflate(s->blur());
+            shadowRect.move(s->x(), s->y());
             clipRect.unite(shadowRect);
-            extraOffset = max(extraOffset, max(0, s->y) + s->blur);
+            extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
         }
         context->save();
         context->clip(clipRect);
@@ -695,14 +691,14 @@
     
     do {
         if (shadow) {
-            if (!shadow->next) {
+            if (!shadow->next()) {
                 // The last set of lines paints normally inside the clip.
                 ty -= extraOffset;
                 extraOffset = 0;
             }
-            context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);
+            context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
             setShadow = true;
-            shadow = shadow->next;
+            shadow = shadow->next();
         }
 
         if (deco & UNDERLINE) {
@@ -1029,30 +1025,48 @@
     return true;
 }
 
-typedef HashMap<InlineTextBox*, Vector<const SimpleFontData*> > FallbackFontsMap;
-static FallbackFontsMap* gFallbackFontsMap;
-
 void InlineTextBox::setFallbackFonts(const HashSet<const SimpleFontData*>& fallbackFonts)
 {
-    if (!gFallbackFontsMap)
-        gFallbackFontsMap = new FallbackFontsMap;
+    if (!s_glyphOverflowAndFallbackFontsMap)
+        s_glyphOverflowAndFallbackFontsMap = new GlyphOverflowAndFallbackFontsMap;
 
-    FallbackFontsMap::iterator it = gFallbackFontsMap->set(this, Vector<const SimpleFontData*>()).first;
-    ASSERT(it->second.isEmpty());
-    copyToVector(fallbackFonts, it->second);
+    GlyphOverflowAndFallbackFontsMap::iterator it = s_glyphOverflowAndFallbackFontsMap->add(this, make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).first;
+    ASSERT(it->second.first.isEmpty());
+    copyToVector(fallbackFonts, it->second.first);
 }
 
-void InlineTextBox::takeFallbackFonts(Vector<const SimpleFontData*>& fallbackFonts)
+Vector<const SimpleFontData*>* InlineTextBox::fallbackFonts() const
 {
-    if (!gFallbackFontsMap)
-        return;
+    if (!s_glyphOverflowAndFallbackFontsMap)
+        return 0;
 
-    FallbackFontsMap::iterator it = gFallbackFontsMap->find(this);
-    if (it == gFallbackFontsMap->end())
-        return;
+    GlyphOverflowAndFallbackFontsMap::iterator it = s_glyphOverflowAndFallbackFontsMap->find(this);
+    if (it == s_glyphOverflowAndFallbackFontsMap->end())
+        return 0;
 
-    fallbackFonts.swap(it->second);
-    gFallbackFontsMap->remove(it);
+    return &it->second.first;
+}
+
+InlineTextBox::GlyphOverflowAndFallbackFontsMap* InlineTextBox::s_glyphOverflowAndFallbackFontsMap = 0;
+
+void InlineTextBox::setGlyphOverflow(const GlyphOverflow& glyphOverflow)
+{
+    if (!s_glyphOverflowAndFallbackFontsMap)
+        s_glyphOverflowAndFallbackFontsMap = new GlyphOverflowAndFallbackFontsMap;
+
+    GlyphOverflowAndFallbackFontsMap::iterator it = s_glyphOverflowAndFallbackFontsMap->add(this, make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).first;
+    it->second.second = glyphOverflow;
+}
+
+GlyphOverflow* InlineTextBox::glyphOverflow() const
+{
+    if (!s_glyphOverflowAndFallbackFontsMap)
+        return 0;
+    GlyphOverflowAndFallbackFontsMap::iterator it = s_glyphOverflowAndFallbackFontsMap->find(this);
+    if (it == s_glyphOverflowAndFallbackFontsMap->end())
+        return 0;
+
+    return &it->second.second;
 }
 
 } // namespace WebCore
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index 0a83ddd..2eb0c42 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -23,7 +23,7 @@
 #ifndef InlineTextBox_h
 #define InlineTextBox_h
 
-#include "InlineRunBox.h"
+#include "InlineBox.h"
 #include "RenderText.h" // so textRenderer() can be inline
 
 namespace WebCore {
@@ -37,18 +37,22 @@
 void updateGraphicsContext(GraphicsContext*, const Color& fillColor, const Color& strokeColor, float strokeThickness, ColorSpace);
 Color correctedTextColor(Color textColor, Color backgroundColor);
 
-class InlineTextBox : public InlineRunBox {
+class InlineTextBox : public InlineBox {
 public:
     InlineTextBox(RenderObject* obj)
-        : InlineRunBox(obj)
+        : InlineBox(obj)
+        , m_prevTextBox(0)
+        , m_nextTextBox(0)
         , m_start(0)
         , m_len(0)
         , m_truncation(cNoTruncation)
     {
     }
 
-    InlineTextBox* nextTextBox() const { return static_cast<InlineTextBox*>(nextLineBox()); }
-    InlineTextBox* prevTextBox() const { return static_cast<InlineTextBox*>(prevLineBox()); }
+    InlineTextBox* prevTextBox() const { return m_prevTextBox; }
+    InlineTextBox* nextTextBox() const { return m_nextTextBox; }
+    void setNextTextBox(InlineTextBox* n) { m_nextTextBox = n; }
+    void setPreviousTextBox(InlineTextBox* p) { m_prevTextBox = p; }
 
     unsigned start() const { return m_start; }
     unsigned end() const { return m_len ? m_start + m_len - 1 : m_start; }
@@ -60,7 +64,16 @@
     void offsetRun(int d) { m_start += d; }
 
     void setFallbackFonts(const HashSet<const SimpleFontData*>&);
-    void takeFallbackFonts(Vector<const SimpleFontData*>&);
+    Vector<const SimpleFontData*>* fallbackFonts() const;
+
+    void setGlyphOverflow(const GlyphOverflow&);
+    GlyphOverflow* glyphOverflow() const;
+
+    static void clearGlyphOverflowAndFallbackFontMap()
+    {
+        if (s_glyphOverflowAndFallbackFontsMap)
+            s_glyphOverflowAndFallbackFontsMap->clear();
+    }
 
     unsigned short truncation() { return m_truncation; }
 
@@ -116,12 +129,18 @@
     bool containsCaretOffset(int offset) const; // false for offset after line break
 
 private:
+    InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
+    InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject
+
     int m_start;
     unsigned short m_len;
 
     unsigned short m_truncation; // Where to truncate when text overflow is applied.  We use special constants to
                       // denote no truncation (the whole run paints) and full truncation (nothing paints at all).
 
+    typedef HashMap<const InlineTextBox*, pair<Vector<const SimpleFontData*>, GlyphOverflow> > GlyphOverflowAndFallbackFontsMap;
+    static GlyphOverflowAndFallbackFontsMap* s_glyphOverflowAndFallbackFontsMap;
+
 protected:
     void paintCompositionBackground(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, int startPos, int endPos);
     void paintDocumentMarkers(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, bool background);
@@ -131,7 +150,7 @@
 #endif
 
 private:
-    void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, ShadowData*);
+    void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, const ShadowData*);
     void paintSelection(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&);
     void paintSpellingOrGrammarMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&, bool grammar);
     void paintTextMatchMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&);
diff --git a/WebCore/rendering/LayoutState.cpp b/WebCore/rendering/LayoutState.cpp
index 883f74d..c94e77b 100644
--- a/WebCore/rendering/LayoutState.cpp
+++ b/WebCore/rendering/LayoutState.cpp
@@ -62,20 +62,17 @@
     m_clipped = !fixed && prev->m_clipped;
     if (m_clipped)
         m_clipRect = prev->m_clipRect;
+
     if (renderer->hasOverflowClip()) {
-        int x = m_offset.width();
-        int y = m_offset.height();
         RenderLayer* layer = renderer->layer();
-        IntRect clipRect(x, y, layer->width(), layer->height());
-        clipRect.move(renderer->view()->layoutDelta());
+        IntRect clipRect(toPoint(m_offset) + renderer->view()->layoutDelta(), layer->size());
         if (m_clipped)
             m_clipRect.intersect(clipRect);
         else {
             m_clipRect = clipRect;
             m_clipped = true;
         }
-        layer->subtractScrolledContentOffset(x, y);
-        m_offset = IntSize(x, y);
+        m_offset -= layer->scrolledContentOffset();
     }
 
     m_layoutDelta = m_next->m_layoutDelta;
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp
index 2b7a8c8..569f214 100644
--- a/WebCore/rendering/MediaControlElements.cpp
+++ b/WebCore/rendering/MediaControlElements.cpp
@@ -615,6 +615,9 @@
     if (event->isMouseEvent() && static_cast<MouseEvent*>(event)->button())
         return;
 
+    if (!attached())
+        return;
+
     if (event->type() == eventNames().mousedownEvent)
         m_mediaElement->beginScrubbing();
 
@@ -660,6 +663,9 @@
     if (event->isMouseEvent() && static_cast<MouseEvent*>(event)->button())
         return;
 
+    if (!attached())
+        return;
+
     MediaControlInputElement::defaultEventHandler(event);
 
     if (event->type() == eventNames().mouseoverEvent || event->type() == eventNames().mouseoutEvent || event->type() == eventNames().mousemoveEvent)
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 62e177d..3f53456 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -187,7 +187,7 @@
             // that will outlast this block. In the non-anonymous block case those
             // children will be destroyed by the time we return from this function.
             if (isAnonymousBlock()) {
-                for (InlineFlowBox* box = firstLineBox(); box; box = box->nextFlowBox()) {
+                for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) {
                     while (InlineBox* childBox = box->firstChild())
                         childBox->remove();
                 }
@@ -265,8 +265,14 @@
 void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
 {
     // Make sure we don't append things after :after-generated content if we have it.
-    if (!beforeChild && isAfterContent(lastChild()))
-        beforeChild = lastChild();
+    if (!beforeChild) {
+        RenderObject* lastRenderer = lastChild();
+
+        if (isAfterContent(lastRenderer))
+            beforeChild = lastRenderer;
+        else if (lastRenderer && lastRenderer->isAnonymousBlock() && isAfterContent(lastRenderer->lastChild()))
+            beforeChild = lastRenderer->lastChild();
+    }
 
     bool madeBoxesNonInline = false;
 
@@ -786,8 +792,7 @@
     if (previousHeight != height())
         relayoutChildren = true;
 
-    // It's weird that we're treating float information as normal flow overflow, but we do this because floatRect() isn't
-    // able to be propagated up the render tree yet.  Overflow information is however.  This check is designed to catch anyone
+    // This check is designed to catch anyone
     // who wasn't going to propagate float information up to the parent and yet could potentially be painted by its ancestor.
     if (isRoot() || expandsToEncloseOverhangingFloats())
         addOverflowFromFloats();
@@ -827,11 +832,7 @@
         
         if (hasOverflowClip()) {
             // Adjust repaint rect for scroll offset
-            int x = repaintRect.x();
-            int y = repaintRect.y();
-            layer()->subtractScrolledContentOffset(x, y);
-            repaintRect.setX(x);
-            repaintRect.setY(y);
+            repaintRect.move(-layer()->scrolledContentOffset());
 
             // Don't allow this rect to spill out of our overflow box.
             repaintRect.intersect(IntRect(0, 0, width(), height()));
@@ -1568,7 +1569,7 @@
 
 void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)
 {
-    const Color& ruleColor = style()->columnRuleColor();
+    const Color& ruleColor = style()->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
     bool ruleTransparent = style()->columnRuleIsTransparent();
     EBorderStyle ruleStyle = style()->columnRuleStyle();
     int ruleWidth = style()->columnRuleWidth();
@@ -1603,7 +1604,7 @@
             int ruleTop = ty + borderTop() + paddingTop();
             int ruleBottom = ruleTop + contentHeight();
             drawLineForBoxSide(paintInfo.context, ruleStart, ruleTop, ruleEnd, ruleBottom,
-                               style()->direction() == LTR ? BSLeft : BSRight, ruleColor, style()->color(), ruleStyle, 0, 0);
+                               style()->direction() == LTR ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0);
         }
         
         ruleX = currXOffset;
@@ -1680,16 +1681,15 @@
 
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {        
         // Check for page-break-before: always, and if it's set, break and bail.
-        if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS &&
-            inRootBlockContext() && (ty + child->y()) > paintInfo.rect.y() && 
-            (ty + child->y()) < paintInfo.rect.bottom()) {
+        if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS
+            && (ty + child->y()) > paintInfo.rect.y()
+            && (ty + child->y()) < paintInfo.rect.bottom()) {
             view()->setBestTruncatedAt(ty + child->y(), this, true);
             return;
         }
 
         // Check for page-break-inside: avoid, and it it's set, break and bail.
         if (isPrinting && !childrenInline() && child->style()->pageBreakInside() == PBAVOID
-            && inRootBlockContext()
             && ty + child->y() > paintInfo.rect.y()
             && ty + child->y() < paintInfo.rect.bottom()
             && ty + child->y() + child->height() > paintInfo.rect.bottom()) {
@@ -1701,9 +1701,9 @@
             child->paint(info, tx, ty);
 
         // Check for page-break-after: always, and if it's set, break and bail.
-        if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS && 
-            inRootBlockContext() && (ty + child->y() + child->height()) > paintInfo.rect.y() && 
-            (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
+        if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS
+            && (ty + child->y() + child->height()) > paintInfo.rect.y()
+            && (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
             view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginBottom()), this, true);
             return;
         }
@@ -1750,11 +1750,14 @@
     if (paintPhase == PaintPhaseBlockBackground)
         return;
 
-    // Adjust our painting position if we're inside a scrolled layer (e.g., an overflow:auto div).s
+    // Adjust our painting position if we're inside a scrolled layer (e.g., an overflow:auto div).
     int scrolledX = tx;
     int scrolledY = ty;
-    if (hasOverflowClip())
-        layer()->subtractScrolledContentOffset(scrolledX, scrolledY);
+    if (hasOverflowClip()) {
+        IntSize offset = layer()->scrolledContentOffset();
+        scrolledX -= offset.width();
+        scrolledY -= offset.height();
+    }
 
     // 2. paint contents
     if (paintPhase != PaintPhaseSelfOutline) {
@@ -1780,7 +1783,7 @@
 
     // 5. paint outline.
     if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.context, tx, ty, width(), height(), style());
+        paintOutline(paintInfo.context, tx, ty, width(), height());
 
     // 6. paint continuation outlines.
     if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines)) {
@@ -1966,18 +1969,16 @@
     // FIXME: this is broken with transforms
     TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint());
     mapLocalToContainer(repaintContainer, false, false, transformState);
-    FloatPoint offsetFromRepaintContainer = transformState.mappedPoint();
-    int x = offsetFromRepaintContainer.x();
-    int y = offsetFromRepaintContainer.y();
+    IntPoint offsetFromRepaintContainer = roundedIntPoint(transformState.mappedPoint());
 
     if (hasOverflowClip())
-        layer()->subtractScrolledContentOffset(x, y);
+        offsetFromRepaintContainer -= layer()->scrolledContentOffset();
 
     int lastTop = 0;
     int lastLeft = leftSelectionOffset(this, lastTop);
     int lastRight = rightSelectionOffset(this, lastTop);
     
-    return fillSelectionGaps(this, x, y, x, y, lastTop, lastLeft, lastRight);
+    return fillSelectionGaps(this, offsetFromRepaintContainer.x(), offsetFromRepaintContainer.y(), offsetFromRepaintContainer.x(), offsetFromRepaintContainer.y(), lastTop, lastLeft, lastRight);
 }
 
 void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)
@@ -2380,8 +2381,14 @@
         DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
         while (it.current()) {
             if (it.current()->m_renderer == o) {
-                if (childrenInline())
-                    markLinesDirtyInVerticalRange(0, it.current()->m_bottom);
+                if (childrenInline()) {
+                    int bottom = it.current()->m_bottom;
+                    // Special-case zero- and less-than-zero-height floats: those don't touch
+                    // the line that they're on, but it still needs to be dirtied. This is
+                    // accomplished by pretending they have a height of 1.
+                    bottom = max(bottom, it.current()->m_top + 1);
+                    markLinesDirtyInVerticalRange(0, bottom);
+                }
                 m_floatingObjects->removeRef(it.current());
             }
             ++it;
@@ -2660,24 +2667,6 @@
     return bottom;
 }
 
-IntRect RenderBlock::floatRect() const
-{
-    IntRect result;
-    if (!m_floatingObjects || hasOverflowClip() || hasColumns())
-        return result;
-    FloatingObject* r;
-    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
-    for (; (r = it.current()); ++it) {
-        if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) {
-            IntRect childRect = r->m_renderer->visibleOverflowRect();
-            childRect.move(r->m_left + r->m_renderer->marginLeft(), r->m_top + r->m_renderer->marginTop());
-            result.unite(childRect);
-        }
-    }
-
-    return result;
-}
-
 int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
 {
     int bottom = includeSelf && width() > 0 ? height() : 0;
@@ -2846,7 +2835,7 @@
     if (!includeSelf) {
         right = max(right, borderLeft() + paddingLeft() + paddingRight() + relativeOffset);
         if (childrenInline()) {
-            for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
+            for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
                 int childRightEdge = currBox->x() + currBox->width();
                 
                 // If this node is a root editable element, then the rightmostPosition should account for a caret at the end.
@@ -2941,7 +2930,7 @@
     }
 
     if (!includeSelf && firstLineBox()) {
-        for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
+        for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
             left = min(left, (int)currBox->x() + relativeOffset);
     }
     
@@ -3050,8 +3039,8 @@
         addIntrudingFloats(block, xoffset, offset);
 
     if (childrenInline()) {
-        int changeTop = INT_MAX;
-        int changeBottom = INT_MIN;
+        int changeTop = numeric_limits<int>::max();
+        int changeBottom = numeric_limits<int>::min();
         if (m_floatingObjects) {
             for (FloatingObject* f = m_floatingObjects->first(); f; f = m_floatingObjects->next()) {
                 FloatingObject* oldFloatingObject = floatMap.get(f->m_renderer);
@@ -3228,6 +3217,32 @@
     }
 }
 
+int RenderBlock::visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const
+{
+    int top = bottom;
+    if (m_floatingObjects) {
+        FloatingObject* floatingObject;
+        for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); (floatingObject = it.current()); ++it) {
+            RenderBox* floatingBox = floatingObject->m_renderer;
+            IntRect visibleOverflow = floatingBox->visibleOverflowRect();
+            visibleOverflow.move(floatingBox->x(), floatingBox->y());
+            if (visibleOverflow.y() < top && visibleOverflow.bottom() > bottom && visibleOverflow.height() <= maxHeight && floatingBox->containingBlock() == this)
+                top = visibleOverflow.y();
+        }
+    }
+
+    if (!childrenInline()) {
+        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+            if (child->isFloatingOrPositioned() || !child->isRenderBlock())
+                continue;
+            RenderBlock* childBlock = toRenderBlock(child);
+            top = min(top, childBlock->y() + childBlock->visibleTopOfHighestFloatExtendingBelow(bottom - childBlock->y(), maxHeight));
+        }
+    }
+
+    return top;
+}
+
 int RenderBlock::getClearDelta(RenderBox* child, int yPos)
 {
     // There is no need to compute clearance if we have no floats.
@@ -3319,8 +3334,11 @@
         // Hit test descendants first.
         int scrolledX = tx;
         int scrolledY = ty;
-        if (hasOverflowClip())
-            layer()->subtractScrolledContentOffset(scrolledX, scrolledY);
+        if (hasOverflowClip()) {
+            IntSize offset = layer()->scrolledContentOffset();
+            scrolledX -= offset.width();
+            scrolledY -= offset.height();
+        }
 
         // Hit test contents if we don't have columns.
         if (!hasColumns() && hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction))
@@ -3595,15 +3613,16 @@
 
 void RenderBlock::offsetForContents(int& tx, int& ty) const
 {
-    if (hasOverflowClip())
-        layer()->addScrolledContentOffset(tx, ty);
+    IntPoint contentsPoint(tx, ty);
 
-    if (hasColumns()) {
-        IntPoint contentsPoint(tx, ty);
+    if (hasOverflowClip())
+        contentsPoint += layer()->scrolledContentOffset();
+
+    if (hasColumns())
         adjustPointToColumnContents(contentsPoint);
-        tx = contentsPoint.x();
-        ty = contentsPoint.y();
-    }
+
+    tx = contentsPoint.x();
+    ty = contentsPoint.y();
 }
 
 int RenderBlock::availableWidth() const
@@ -3765,11 +3784,13 @@
 
         // This represents the real column position.
         IntRect colRect(currX, top, desiredColumnWidth, colHeight);
-        
+
+        int truncationPoint = visibleTopOfHighestFloatExtendingBelow(currY + colHeight, colHeight);
+
         // For the simulated paint, we pretend like everything is in one long strip.
-        IntRect pageRect(left, currY, desiredColumnWidth, colHeight);
+        IntRect pageRect(left, currY, desiredColumnWidth, truncationPoint - currY);
         v->setPrintRect(pageRect);
-        v->setTruncatedAt(currY + colHeight);
+        v->setTruncatedAt(truncationPoint);
         GraphicsContext context((PlatformGraphicsContext*)0);
         RenderObject::PaintInfo paintInfo(&context, pageRect, PaintPhaseForeground, false, 0, 0);
         
@@ -3784,7 +3805,7 @@
 
         int adjustedBottom = v->bestTruncatedAt();
         if (adjustedBottom <= currY)
-            adjustedBottom = currY + colHeight;
+            adjustedBottom = truncationPoint;
         
         colRect.setHeight(adjustedBottom - currY);
         
@@ -3859,8 +3880,20 @@
         // Add in half the column gap to the left and right of the rect.
         IntRect colRect = colRects->at(i);
         IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height());
-        
-        if (gapAndColumnRect.contains(point)) {
+
+        if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
+            // FIXME: The clamping that follows is not completely right for right-to-left
+            // content.
+            // Clamp everything above the column to its top left.
+            if (point.y() < gapAndColumnRect.y())
+                point = gapAndColumnRect.location();
+            // Clamp everything below the column to the next column's top left. If there is
+            // no next column, this still maps to just after this column.
+            else if (point.y() >= gapAndColumnRect.bottom()) {
+                point = gapAndColumnRect.location();
+                point.move(0, gapAndColumnRect.height());
+            }
+
             // We're inside the column.  Translate the x and y into our column coordinate space.
             point.move(columnPoint.x() - colRect.x(), yOffset);
             return;
@@ -4635,7 +4668,7 @@
 
     // Drill into inlines looking for our first text child.
     RenderObject* currChild = firstLetterBlock->firstChild();
-    while (currChild && currChild->needsLayout() && (!currChild->isReplaced() || currChild->isFloatingOrPositioned()) && !currChild->isText()) {
+    while (currChild && currChild->needsLayout() && ((!currChild->isReplaced() && !currChild->isRenderButton() && !currChild->isMenuList()) || currChild->isFloatingOrPositioned()) && !currChild->isText()) {
         if (currChild->isFloatingOrPositioned()) {
             if (currChild->style()->styleType() == FIRST_LETTER)
                 break;
@@ -4722,9 +4755,7 @@
             // construct text fragment for the first letter
             RenderTextFragment* letter = 
                 new (renderArena()) RenderTextFragment(remainingText->node() ? remainingText->node() : remainingText->document(), oldText.get(), 0, length);
-            RefPtr<RenderStyle> newStyle = RenderStyle::create();
-            newStyle->inheritFrom(pseudoStyle);
-            letter->setStyle(newStyle.release());
+            letter->setStyle(pseudoStyle);
             firstLetter->addChild(letter);
 
             textObj->destroy();
@@ -4733,17 +4764,6 @@
     }
 }
 
-bool RenderBlock::inRootBlockContext() const
-{
-    if (isTableCell() || isFloatingOrPositioned() || hasOverflowClip())
-        return false;
-    
-    if (isRoot() || isRenderView())
-        return true;
-    
-    return containingBlock()->inRootBlockContext();
-}
-
 // Helper methods for obtaining the last line, computing line counts and heights for line counts
 // (crawling into blocks).
 static bool shouldCheckLines(RenderObject* obj)
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index c1f8dde..751a1df 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -74,6 +74,7 @@
     void insertPositionedObject(RenderBox*);
     void removePositionedObject(RenderBox*);
     void removePositionedObjects(RenderBlock*);
+    ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; }
 
     void addPercentHeightDescendant(RenderBox*);
     static void removePercentHeightDescendant(RenderBox*);
@@ -89,8 +90,6 @@
     bool containsFloats() { return m_floatingObjects && !m_floatingObjects->isEmpty(); }
     bool containsFloat(RenderObject*);
 
-    IntRect floatRect() const;
-
     int lineWidth(int y, bool firstLine) const;
     
     virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
@@ -317,7 +316,6 @@
     // Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
     // children.
     virtual RenderBlock* firstLineBlock() const;
-    bool inRootBlockContext() const;
 
     virtual IntRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth);
     virtual RenderStyle* outlineStyleForRepaint() const;
@@ -386,6 +384,7 @@
 
     void calcColumnWidth();
     int layoutColumns(int endOfContent = -1, int requestedColumnHeight = -1);
+    int visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const;
 
     bool expandsToEncloseOverhangingFloats() const;
 
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index a7f3553..895db66 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -349,7 +349,8 @@
                 needsWordSpacing = !isSpaceOrNewline(rt->characters()[r->m_stop - 1]) && r->m_stop == length;          
             }
             HashSet<const SimpleFontData*> fallbackFonts;
-            r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts));
+            GlyphOverflow glyphOverflow;
+            r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow));
             if (!fallbackFonts.isEmpty()
 #if ENABLE(SVG)
                     && !isSVGText()
@@ -358,6 +359,14 @@
                 ASSERT(r->m_box->isText());
                 static_cast<InlineTextBox*>(r->m_box)->setFallbackFonts(fallbackFonts);
             }
+            if ((glyphOverflow.top || glyphOverflow.bottom || glyphOverflow.left || glyphOverflow.right)
+#if ENABLE(SVG)
+                && !isSVGText()
+#endif
+            ) {
+                ASSERT(r->m_box->isText());
+                static_cast<InlineTextBox*>(r->m_box)->setGlyphOverflow(glyphOverflow);
+            }
         } else if (!r->m_object->isRenderInline()) {
             RenderBox* renderBox = toRenderBox(r->m_object);
             renderBox->calcWidth();
@@ -753,7 +762,6 @@
         bool endLineMatched = false;
         bool checkForEndLineMatch = endLine;
         bool checkForFloatsFromLastLine = false;
-        int lastHeight = height();
 
         bool isLineEmpty = true;
 
@@ -842,6 +850,7 @@
 
                         // Now position our text runs vertically.
                         computeVerticalPositionsForLine(lineBox, resolver.firstRun());
+                        InlineTextBox::clearGlyphOverflowAndFallbackFontMap();
 
 #if ENABLE(SVG)
                         // Special SVG text layout code
@@ -878,8 +887,7 @@
                 } else
                     m_floatingObjects->first();
                 for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next()) {
-                    if (f->m_bottom > lastHeight)
-                        lastRootBox()->floats().append(f->m_renderer);
+                    lastRootBox()->floats().append(f->m_renderer);
                     ASSERT(f->m_renderer == floats[floatIndex].object);
                     // If a float's geometry has changed, give up on syncing with clean lines.
                     if (floats[floatIndex].rect != IntRect(f->m_left, f->m_top, f->m_width, f->m_bottom - f->m_top))
@@ -889,7 +897,6 @@
                 lastFloat = m_floatingObjects->last();
             }
 
-            lastHeight = height();
             lineMidpointState.reset();
             resolver.setPosition(end);
         }
@@ -949,10 +956,8 @@
                 m_floatingObjects->next();
             } else
                 m_floatingObjects->first();
-            for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next()) {
-                if (f->m_bottom > lastHeight)
-                    lastRootBox()->floats().append(f->m_renderer);
-            }
+            for (FloatingObject* f = m_floatingObjects->current(); f; f = m_floatingObjects->next())
+                lastRootBox()->floats().append(f->m_renderer);
             lastFloat = m_floatingObjects->last();
         }
         size_t floatCount = floats.size();
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 66a88e2..bd82683 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -152,6 +152,16 @@
                 removeFloatingOrPositionedChildFromBlockLists();
         }
     }
+    if (FrameView *frameView = view()->frameView()) {
+        bool newStyleIsFixed = newStyle && newStyle->position() == FixedPosition;
+        bool oldStyleIsFixed = style() && style()->position() == FixedPosition;
+        if (newStyleIsFixed != oldStyleIsFixed) {
+            if (newStyleIsFixed)
+                frameView->addFixedObject();
+            else
+                frameView->removeFixedObject();
+        }
+    }
 
     RenderBoxModelObject::styleWillChange(diff, newStyle);
 }
@@ -321,12 +331,17 @@
     return localToAbsoluteQuad(FloatRect(rect));
 }
 
-IntRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer) const
+IntRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint* cachedOffsetToRepaintContainer) const
 {
     IntRect box = borderBoundingBox();
     adjustRectForOutlineAndShadow(box);
 
-    FloatQuad containerRelativeQuad = localToContainerQuad(FloatRect(box), repaintContainer);
+    FloatQuad containerRelativeQuad = FloatRect(box);
+    if (cachedOffsetToRepaintContainer)
+        containerRelativeQuad.move(cachedOffsetToRepaintContainer->x(), cachedOffsetToRepaintContainer->y());
+    else
+        containerRelativeQuad = localToContainerQuad(containerRelativeQuad, repaintContainer);
+
     box = containerRelativeQuad.enclosingBoundingBox();
 
     // FIXME: layoutDelta needs to be applied in parts before/after transforms and
@@ -429,7 +444,7 @@
 
 bool RenderBox::canBeScrolledAndHasScrollableArea() const
 {
-   return canBeProgramaticallyScrolled(false) && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
+    return canBeProgramaticallyScrolled(false) && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
 }
     
 bool RenderBox::canBeProgramaticallyScrolled(bool) const
@@ -1175,10 +1190,9 @@
     IntPoint topLeft = rect.location();
     topLeft.move(x(), y());
 
-    if (style()->position() == FixedPosition)
-        fixed = true;
+    EPosition position = style()->position();
 
-    if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
+    if (o->isBlockFlow() && position != AbsolutePosition && position != FixedPosition) {
         RenderBlock* cb = toRenderBlock(o);
         if (cb->hasColumns()) {
             IntRect repaintRect(topLeft, rect.size());
@@ -1191,16 +1205,17 @@
     // We are now in our parent container's coordinate space.  Apply our transform to obtain a bounding box
     // in the parent's coordinate space that encloses us.
     if (layer() && layer()->transform()) {
-        fixed = false;
+        fixed = position == FixedPosition;
         rect = layer()->transform()->mapRect(rect);
         // FIXME: this clobbers topLeft adjustment done for multicol above
         topLeft = rect.location();
         topLeft.move(x(), y());
-    }
+    } else if (position == FixedPosition)
+        fixed = true;
 
-    if (style()->position() == AbsolutePosition && o->isRelPositioned() && o->isRenderInline())
+    if (position == AbsolutePosition && o->isRelPositioned() && o->isRenderInline())
         topLeft += toRenderInline(o)->relativePositionedInlineOffset(this);
-    else if (style()->position() == RelativePosition && layer()) {
+    else if (position == RelativePosition && layer()) {
         // Apply the relative position offset when invalidating a rectangle.  The layer
         // is translated, but the render box isn't, so we need to do this to get the
         // right dirty rect.  Since this is called from RenderObject::setStyle, the relative position
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 2ee368d..68bbd51 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -73,7 +73,7 @@
     FloatQuad absoluteContentQuad() const;
 
     // Bounds of the outline box in absolute coords. Respects transforms
-    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/) const;
+    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* cachedOffsetToRepaintContainer) const;
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
     // Use this with caution! No type checking is done!
@@ -271,9 +271,9 @@
     virtual void paintMask(PaintInfo&, int tx, int ty);
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 
-    // Called when a positioned object moves but doesn't change size.  A simplified layout is done
-    // that just updates the object's position.
-    virtual void tryLayoutDoingPositionedMovementOnly()
+    // Called when a positioned object moves but doesn't necessarily change size.  A simplified layout is attempted
+    // that just updates the object's position. If the size does change, the object remains dirty.
+    void tryLayoutDoingPositionedMovementOnly()
     {
         int oldWidth = width();
         calcWidth();
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index f8bf05e..9caf46f 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -131,7 +131,7 @@
         data = gBoxModelObjects->get(object);
 
     const AffineTransform& currentTransform = context->getCTM();
-    bool contextIsScaled = !currentTransform.isIdentityOrTranslation();
+    bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped();
     if (!contextIsScaled && imageSize == size) {
         // There is no scale in effect.  If we had a scale in effect before, we can just delete this data.
         if (data) {
@@ -158,8 +158,10 @@
         return false;
     }
 
+    const AffineTransform& tr = data->transform();
+    bool scaleUnchanged = tr.a() == currentTransform.a() && tr.b() == currentTransform.b() && tr.c() == currentTransform.c() && tr.d() == currentTransform.d();
     // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with.
-    if ((!contextIsScaled || data->transform() == currentTransform) && data->size() == size)
+    if ((!contextIsScaled || scaleUnchanged) && data->size() == size)
         return data->useLowQualityScale();
 
     // We have data and our size just changed.  If this change happened quickly, go into low quality mode and then set a repaint
@@ -479,7 +481,9 @@
         context->clip(toRenderBox(this)->overflowClipRect(tx, ty));
         
         // Now adjust our tx, ty, w, h to reflect a scrolled content box with borders at the ends.
-        layer()->subtractScrolledContentOffset(tx, ty);
+        IntSize offset = layer()->scrolledContentOffset();
+        tx -= offset.width();
+        ty -= offset.height();
         w = bLeft + layer()->scrollWidth() + bRight;
         h = borderTop() + layer()->scrollHeight() + borderBottom();
     }
@@ -604,7 +608,7 @@
             CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
             RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
             Image* image = bg->image(clientForBackgroundImage, tileSize);
-            bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, destRect.size());
+            bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, tileSize);
             context->drawTiledImage(image, style()->colorSpace(), destRect, phase, tileSize, compositeOp, useLowQualityScaling);
         }
     }
@@ -632,6 +636,7 @@
         case SizeLength: {
             int w = positioningAreaSize.width();
             int h = positioningAreaSize.height();
+
             Length layerWidth = fillLayer->size().size.width();
             Length layerHeight = fillLayer->size().size.height();
 
@@ -647,15 +652,19 @@
             
             // If one of the values is auto we have to use the appropriate
             // scale to maintain our aspect ratio.
-            if (layerWidth.isAuto() && !layerHeight.isAuto())
-                w = image->imageSize(this, style()->effectiveZoom()).width() * h / image->imageSize(this, style()->effectiveZoom()).height();        
-            else if (!layerWidth.isAuto() && layerHeight.isAuto())
-                h = image->imageSize(this, style()->effectiveZoom()).height() * w / image->imageSize(this, style()->effectiveZoom()).width();
-            else if (layerWidth.isAuto() && layerHeight.isAuto()) {
-                // If both width and height are auto, we just want to use the image's
-                // intrinsic size.
-                w = image->imageSize(this, style()->effectiveZoom()).width();
-                h = image->imageSize(this, style()->effectiveZoom()).height();
+            if (layerWidth.isAuto() && !layerHeight.isAuto()) {
+                IntSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
+                if (imageIntrinsicSize.height())
+                    w = imageIntrinsicSize.width() * h / imageIntrinsicSize.height();        
+            } else if (!layerWidth.isAuto() && layerHeight.isAuto()) {
+                IntSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
+                if (imageIntrinsicSize.width())
+                    h = imageIntrinsicSize.height() * w / imageIntrinsicSize.width();
+            } else if (layerWidth.isAuto() && layerHeight.isAuto()) {
+                // If both width and height are auto, use the image's intrinsic size.
+                IntSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
+                w = imageIntrinsicSize.width();
+                h = imageIntrinsicSize.height();
             }
             
             return IntSize(max(1, w), max(1, h));
@@ -663,15 +672,17 @@
         case Contain:
         case Cover: {
             IntSize imageIntrinsicSize = image->imageSize(this, 1);
-            float horizontalScaleFactor = static_cast<float>(positioningAreaSize.width()) / imageIntrinsicSize.width();
-            float verticalScaleFactor = static_cast<float>(positioningAreaSize.height()) / imageIntrinsicSize.height();
+            float horizontalScaleFactor = imageIntrinsicSize.width()
+                ? static_cast<float>(positioningAreaSize.width()) / imageIntrinsicSize.width() : 1;
+            float verticalScaleFactor = imageIntrinsicSize.height()
+                ? static_cast<float>(positioningAreaSize.height()) / imageIntrinsicSize.height() : 1;
             float scaleFactor = type == Contain ? min(horizontalScaleFactor, verticalScaleFactor) : max(horizontalScaleFactor, verticalScaleFactor);
-
             return IntSize(max<int>(1, imageIntrinsicSize.width() * scaleFactor), max<int>(1, imageIntrinsicSize.height() * scaleFactor));
         }
         case SizeNone:
             break;
     }
+
     return image->imageSize(this, style()->effectiveZoom());
 }
 
@@ -791,7 +802,8 @@
             vpos += -static_cast<int>(f.xHeight() / 2) - lineHeight(firstLine) / 2 + baselinePosition(firstLine);
         else if (va == TEXT_BOTTOM) {
             vpos += f.descent();
-            if (!isReplaced()) // lineHeight - baselinePosition is always 0 for replaced elements, so don't bother wasting time in that case.
+            // lineHeight - baselinePosition is always 0 for replaced elements (except inline blocks), so don't bother wasting time in that case.
+            if (!isReplaced() || style()->display() == INLINE_BLOCK)
                 vpos -= (lineHeight(firstLine) - baselinePosition(firstLine));
         } else if (va == BASELINE_MIDDLE)
             vpos += -lineHeight(firstLine) / 2 + baselinePosition(firstLine);
@@ -822,10 +834,10 @@
     int imageWidth = imageSize.width();
     int imageHeight = imageSize.height();
 
-    int topSlice = min(imageHeight, ninePieceImage.m_slices.top().calcValue(imageHeight));
-    int bottomSlice = min(imageHeight, ninePieceImage.m_slices.bottom().calcValue(imageHeight));
-    int leftSlice = min(imageWidth, ninePieceImage.m_slices.left().calcValue(imageWidth));
-    int rightSlice = min(imageWidth, ninePieceImage.m_slices.right().calcValue(imageWidth));
+    int topSlice = min(imageHeight, ninePieceImage.slices().top().calcValue(imageHeight));
+    int bottomSlice = min(imageHeight, ninePieceImage.slices().bottom().calcValue(imageHeight));
+    int leftSlice = min(imageWidth, ninePieceImage.slices().left().calcValue(imageWidth));
+    int rightSlice = min(imageWidth, ninePieceImage.slices().right().calcValue(imageWidth));
 
     ENinePieceImageRule hRule = ninePieceImage.horizontalRule();
     ENinePieceImageRule vRule = ninePieceImage.verticalRule();
@@ -915,15 +927,15 @@
 }
 
 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
-                               const RenderStyle* style, bool begin, bool end)
+                                       const RenderStyle* style, bool begin, bool end)
 {
     if (paintNinePieceImage(graphicsContext, tx, ty, w, h, style, style->borderImage()))
         return;
 
-    const Color& topColor = style->borderTopColor();
-    const Color& bottomColor = style->borderBottomColor();
-    const Color& leftColor = style->borderLeftColor();
-    const Color& rightColor = style->borderRightColor();
+    const Color& topColor = style->visitedDependentColor(CSSPropertyBorderTopColor);
+    const Color& bottomColor = style->visitedDependentColor(CSSPropertyBorderBottomColor);
+    const Color& leftColor = style->visitedDependentColor(CSSPropertyBorderLeftColor);
+    const Color& rightColor = style->visitedDependentColor(CSSPropertyBorderRightColor);
 
     bool topTransparent = style->borderTopIsTransparent();
     bool bottomTransparent = style->borderBottomIsTransparent();
@@ -988,7 +1000,7 @@
             x2 -= topRight.width();
         }
 
-        drawLineForBoxSide(graphicsContext, x, ty, x2, ty + style->borderTopWidth(), BSTop, topColor, style->color(), topStyle,
+        drawLineForBoxSide(graphicsContext, x, ty, x2, ty + style->borderTopWidth(), BSTop, topColor, topStyle,
                    ignore_left ? 0 : style->borderLeftWidth(), ignore_right ? 0 : style->borderRightWidth());
 
         if (renderRadii) {
@@ -1016,7 +1028,7 @@
 
                 // Draw upper left arc
                 drawArcForBoxSide(graphicsContext, leftX, leftY, thickness, topLeft, firstAngleStart, firstAngleSpan,
-                              BSTop, topColor, style->color(), topStyle, true);
+                              BSTop, topColor, topStyle, true);
                 if (applyLeftInnerClip)
                     graphicsContext->restore();
             }
@@ -1042,7 +1054,7 @@
 
                 // Draw upper right arc
                 drawArcForBoxSide(graphicsContext, rightX, leftY, thickness, topRight, secondAngleStart, secondAngleSpan,
-                              BSTop, topColor, style->color(), topStyle, false);
+                              BSTop, topColor, topStyle, false);
                 if (applyRightInnerClip)
                     graphicsContext->restore();
             }
@@ -1065,7 +1077,7 @@
             x2 -= bottomRight.width();
         }
 
-        drawLineForBoxSide(graphicsContext, x, ty + h - style->borderBottomWidth(), x2, ty + h, BSBottom, bottomColor, style->color(), bottomStyle,
+        drawLineForBoxSide(graphicsContext, x, ty + h - style->borderBottomWidth(), x2, ty + h, BSBottom, bottomColor, bottomStyle,
                    ignore_left ? 0 : style->borderLeftWidth(), ignore_right ? 0 : style->borderRightWidth());
 
         if (renderRadii) {
@@ -1093,7 +1105,7 @@
 
                 // Draw lower left arc
                 drawArcForBoxSide(graphicsContext, leftX, leftY, thickness, bottomLeft, firstAngleStart, firstAngleSpan,
-                              BSBottom, bottomColor, style->color(), bottomStyle, true);
+                              BSBottom, bottomColor, bottomStyle, true);
                 if (applyLeftInnerClip)
                     graphicsContext->restore();
             }
@@ -1115,7 +1127,7 @@
 
                 // Draw lower right arc
                 drawArcForBoxSide(graphicsContext, rightX, rightY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
-                              BSBottom, bottomColor, style->color(), bottomStyle, false);
+                              BSBottom, bottomColor, bottomStyle, false);
                 if (applyRightInnerClip)
                     graphicsContext->restore();
             }
@@ -1138,7 +1150,7 @@
             y2 -= bottomLeft.height();
         }
 
-        drawLineForBoxSide(graphicsContext, tx, y, tx + style->borderLeftWidth(), y2, BSLeft, leftColor, style->color(), leftStyle,
+        drawLineForBoxSide(graphicsContext, tx, y, tx + style->borderLeftWidth(), y2, BSLeft, leftColor, leftStyle,
                    ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
 
         if (renderRadii && (!upperLeftBorderStylesMatch || !lowerLeftBorderStylesMatch)) {
@@ -1161,7 +1173,7 @@
 
                 // Draw top left arc
                 drawArcForBoxSide(graphicsContext, topX, topY, thickness, topLeft, firstAngleStart, firstAngleSpan,
-                              BSLeft, leftColor, style->color(), leftStyle, true);
+                              BSLeft, leftColor, leftStyle, true);
                 if (applyTopInnerClip)
                     graphicsContext->restore();
             }
@@ -1182,7 +1194,7 @@
 
                 // Draw bottom left arc
                 drawArcForBoxSide(graphicsContext, topX, bottomY, thickness, bottomLeft, secondAngleStart, secondAngleSpan,
-                              BSLeft, leftColor, style->color(), leftStyle, false);
+                              BSLeft, leftColor, leftStyle, false);
                 if (applyBottomInnerClip)
                     graphicsContext->restore();
             }
@@ -1207,7 +1219,7 @@
             y2 -= bottomRight.height();
         }
 
-        drawLineForBoxSide(graphicsContext, tx + w - style->borderRightWidth(), y, tx + w, y2, BSRight, rightColor, style->color(), rightStyle,
+        drawLineForBoxSide(graphicsContext, tx + w - style->borderRightWidth(), y, tx + w, y2, BSRight, rightColor, rightStyle,
                    ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
 
         if (renderRadii && (!upperRightBorderStylesMatch || !lowerRightBorderStylesMatch)) {
@@ -1230,7 +1242,7 @@
 
                 // Draw top right arc
                 drawArcForBoxSide(graphicsContext, topX, topY, thickness, topRight, firstAngleStart, firstAngleSpan,
-                              BSRight, rightColor, style->color(), rightStyle, true);
+                              BSRight, rightColor, rightStyle, true);
                 if (applyTopInnerClip)
                     graphicsContext->restore();
             }
@@ -1252,7 +1264,7 @@
 
                 // Draw bottom right arc
                 drawArcForBoxSide(graphicsContext, bottomX, bottomY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
-                              BSRight, rightColor, style->color(), rightStyle, false);
+                              BSRight, rightColor, rightStyle, false);
                 if (applyBottomInnerClip)
                     graphicsContext->restore();
             }
@@ -1310,16 +1322,16 @@
     }
 
     bool hasOpaqueBackground = s->backgroundColor().isValid() && s->backgroundColor().alpha() == 255;
-    for (ShadowData* shadow = s->boxShadow(); shadow; shadow = shadow->next) {
-        if (shadow->style != shadowStyle)
+    for (const ShadowData* shadow = s->boxShadow(); shadow; shadow = shadow->next()) {
+        if (shadow->style() != shadowStyle)
             continue;
 
-        IntSize shadowOffset(shadow->x, shadow->y);
-        int shadowBlur = shadow->blur;
-        int shadowSpread = shadow->spread;
-        Color& shadowColor = shadow->color;
+        IntSize shadowOffset(shadow->x(), shadow->y());
+        int shadowBlur = shadow->blur();
+        int shadowSpread = shadow->spread();
+        const Color& shadowColor = shadow->color();
 
-        if (shadow->style == Normal) {
+        if (shadow->style() == Normal) {
             IntRect fillRect(rect);
             fillRect.inflate(shadowSpread);
             if (fillRect.isEmpty())
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index db32808..8619fc0 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -24,18 +24,26 @@
 #include "config.h"
 #include "RenderEmbeddedObject.h"
 
+#include "CSSValueKeywords.h"
+#include "Font.h"
+#include "FontSelector.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
+#include "GraphicsContext.h"
 #include "HTMLEmbedElement.h"
 #include "HTMLIFrameElement.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLParamElement.h"
+#include "LocalizedStrings.h"
 #include "MIMETypeRegistry.h"
 #include "Page.h"
+#include "Path.h"
 #include "PluginWidget.h"
+#include "RenderTheme.h"
 #include "RenderView.h"
 #include "RenderWidgetProtector.h"
+#include "Settings.h"
 #include "Text.h"
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
@@ -49,9 +57,16 @@
 namespace WebCore {
 
 using namespace HTMLNames;
+    
+static const float replacementTextRoundedRectHeight = 18;
+static const float replacementTextRoundedRectLeftRightTextMargin = 6;
+static const float replacementTextRoundedRectOpacity = 0.20f;
+static const float replacementTextRoundedRectRadius = 5;
+static const float replacementTextTextOpacity = 0.55f;
 
 RenderEmbeddedObject::RenderEmbeddedObject(Element* element)
-    : RenderPartObject(element)
+    : RenderPart(element)
+    , m_hasFallbackContent(false)
 {
     view()->frameView()->setIsVisuallyNonEmpty();
 }
@@ -65,7 +80,7 @@
 #if USE(ACCELERATED_COMPOSITING)
 bool RenderEmbeddedObject::requiresLayer() const
 {
-    if (RenderPartObject::requiresLayer())
+    if (RenderPart::requiresLayer())
         return true;
     
     return allowsAcceleratedCompositing();
@@ -141,6 +156,9 @@
 
 void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
 {
+    if (!m_replacementText.isNull() || !node()) // Check the node in case destroy() has been called.
+        return;
+
     String url;
     String serviceType;
     Vector<String> paramNames;
@@ -306,31 +324,88 @@
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)        
     else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) {
         HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node());
+        KURL kurl;
 
+        mediaElement->getPluginProxyParams(kurl, paramNames, paramValues);
         mediaElement->setNeedWidgetUpdate(false);
-        if (node()->hasTagName(videoTag)) {
-            HTMLVideoElement* vid = static_cast<HTMLVideoElement*>(node());
-            String poster = vid->poster();
-            if (!poster.isEmpty()) {
-                paramNames.append("_media_element_poster_");
-                paramValues.append(poster);
-            }
-        }
-
-        url = mediaElement->initialURL();
-        if (!url.isEmpty()) {
-            paramNames.append("_media_element_src_");
-            paramValues.append(url);
-        }
-
-        serviceType = "application/x-media-element-proxy-plugin";
-        
-        if (mediaElement->dispatchBeforeLoadEvent(url))
-            frame->loader()->requestObject(this, url, nullAtom, serviceType, paramNames, paramValues);
+        frame->loader()->loadMediaPlayerProxyPlugin(node(), kurl, paramNames, paramValues);
     }
 #endif
 }
 
+void RenderEmbeddedObject::setShowsMissingPluginIndicator()
+{
+    m_replacementText = missingPluginText();
+}
+
+void RenderEmbeddedObject::setShowsCrashedPluginIndicator()
+{
+    m_replacementText = crashedPluginText();
+}
+
+void RenderEmbeddedObject::paint(PaintInfo& paintInfo, int tx, int ty)
+{
+    if (!m_replacementText.isNull()) {
+        RenderReplaced::paint(paintInfo, tx, ty);
+        return;
+    }
+    
+    RenderPart::paint(paintInfo, tx, ty);
+}
+
+void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, int tx, int ty)
+{
+    if (!m_replacementText)
+        return;
+
+    if (paintInfo.phase == PaintPhaseSelection)
+        return;
+    
+    GraphicsContext* context = paintInfo.context;
+    if (context->paintingDisabled())
+        return;
+    
+    FloatRect pluginRect = contentBoxRect();
+    pluginRect.move(tx, ty);
+    
+    FontDescription fontDescription;
+    RenderTheme::defaultTheme()->systemFont(CSSValueWebkitSmallControl, fontDescription);
+    fontDescription.setWeight(FontWeightBold);
+    Settings* settings = document()->settings();
+    ASSERT(settings);
+    if (!settings)
+        return;
+    fontDescription.setRenderingMode(settings->fontRenderingMode());
+    fontDescription.setComputedSize(fontDescription.specifiedSize());
+    Font font(fontDescription, 0, 0);
+    font.update(0);
+    
+    TextRun run(m_replacementText.characters(), m_replacementText.length());
+    run.disableRoundingHacks();
+    float textWidth = font.floatWidth(run);
+    
+    FloatRect replacementTextRect;
+    replacementTextRect.setSize(FloatSize(textWidth + replacementTextRoundedRectLeftRightTextMargin * 2, replacementTextRoundedRectHeight));
+    replacementTextRect.setLocation(FloatPoint((pluginRect.size().width() / 2 - replacementTextRect.size().width() / 2) + pluginRect.location().x(),
+                                             (pluginRect.size().height() / 2 - replacementTextRect.size().height() / 2) + pluginRect.location().y()));
+   
+    Path path = Path::createRoundedRectangle(replacementTextRect, FloatSize(replacementTextRoundedRectRadius, replacementTextRoundedRectRadius));
+    context->save();
+    context->clip(pluginRect);
+    context->beginPath();
+    context->addPath(path);  
+    context->setAlpha(replacementTextRoundedRectOpacity);
+    context->setFillColor(Color::white, style()->colorSpace());
+    context->fillPath();
+
+    FloatPoint labelPoint(roundf(replacementTextRect.location().x() + (replacementTextRect.size().width() - textWidth) / 2),
+                          roundf(replacementTextRect.location().y()+ (replacementTextRect.size().height() - font.height()) / 2 + font.ascent()));
+    context->setAlpha(replacementTextTextOpacity);
+    context->setFillColor(Color::black, style()->colorSpace());
+    context->drawBidiText(font, run, labelPoint);
+    context->restore();
+}
+
 void RenderEmbeddedObject::layout()
 {
     ASSERT(needsLayout());
@@ -349,4 +424,23 @@
     setNeedsLayout(false);
 }
 
+void RenderEmbeddedObject::viewCleared()
+{
+    // This is required for <object> elements whose contents are rendered by WebCore (e.g. src="foo.html").
+    if (node() && widget() && widget()->isFrameView()) {
+        FrameView* view = static_cast<FrameView*>(widget());
+        int marginw = -1;
+        int marginh = -1;
+        if (node()->hasTagName(iframeTag)) {
+            HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
+            marginw = frame->getMarginWidth();
+            marginh = frame->getMarginHeight();
+        }
+        if (marginw != -1)
+            view->setMarginWidth(marginw);
+        if (marginh != -1)
+            view->setMarginHeight(marginh);
+    }
+}
+
 }
diff --git a/WebCore/rendering/RenderEmbeddedObject.h b/WebCore/rendering/RenderEmbeddedObject.h
index bdaea92..b68108d 100644
--- a/WebCore/rendering/RenderEmbeddedObject.h
+++ b/WebCore/rendering/RenderEmbeddedObject.h
@@ -23,17 +23,22 @@
 #ifndef RenderEmbeddedObject_h
 #define RenderEmbeddedObject_h
 
-#include "RenderPartObject.h"
+#include "RenderPart.h"
 
 namespace WebCore {
 
-// Renderer for embeds and objects.
-class RenderEmbeddedObject : public RenderPartObject {
+// Renderer for embeds and objects, often, but not always, rendered via plug-ins.
+// For example, <embed src="foo.html"> does not invoke a plug-in.
+class RenderEmbeddedObject : public RenderPart {
 public:
     RenderEmbeddedObject(Element*);
     virtual ~RenderEmbeddedObject();
 
     void updateWidget(bool onlyCreateNonNetscapePlugins);
+    void setShowsMissingPluginIndicator();
+    void setShowsCrashedPluginIndicator();
+
+    bool hasFallbackContent() const { return m_hasFallbackContent; }
 
 #if USE(ACCELERATED_COMPOSITING)
     virtual bool allowsAcceleratedCompositing() const;
@@ -43,11 +48,18 @@
     virtual const char* renderName() const { return "RenderEmbeddedObject"; }
     virtual bool isEmbeddedObject() const { return true; }
 
+    virtual void paintReplaced(PaintInfo&, int, int);
+    virtual void paint(PaintInfo& paintInfo, int, int);
+
 #if USE(ACCELERATED_COMPOSITING)
     virtual bool requiresLayer() const;
 #endif
 
     virtual void layout();
+    virtual void viewCleared();
+
+    String m_replacementText;
+    bool m_hasFallbackContent;
 };
 
 inline RenderEmbeddedObject* toRenderEmbeddedObject(RenderObject* object)
diff --git a/WebCore/rendering/RenderFieldset.cpp b/WebCore/rendering/RenderFieldset.cpp
index 889b0bc..d8cbd00 100644
--- a/WebCore/rendering/RenderFieldset.cpp
+++ b/WebCore/rendering/RenderFieldset.cpp
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "RenderFieldset.h"
 
+#include "CSSPropertyNames.h"
 #include "HTMLNames.h"
 #include "GraphicsContext.h"
 
@@ -181,8 +182,8 @@
 void RenderFieldset::paintBorderMinusLegend(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
                                             const RenderStyle* style, int lx, int lw, int lb)
 {
-    const Color& tc = style->borderTopColor();
-    const Color& bc = style->borderBottomColor();
+    const Color& tc = style->visitedDependentColor(CSSPropertyBorderTopColor);
+    const Color& bc = style->visitedDependentColor(CSSPropertyBorderBottomColor);
 
     EBorderStyle ts = style->borderTopStyle();
     EBorderStyle bs = style->borderBottomStyle();
@@ -199,22 +200,22 @@
 
     if (render_t) {
         if (lx >= borderLeftWidth)
-            drawLineForBoxSide(graphicsContext, tx, ty, tx + min(lx, w), ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
+            drawLineForBoxSide(graphicsContext, tx, ty, tx + min(lx, w), ty + style->borderTopWidth(), BSTop, tc, ts,
                        (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? borderLeftWidth : 0),
                        (lx >= w && render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? borderRightWidth : 0));
         if (lx + lw <=  w - borderRightWidth)
-            drawLineForBoxSide(graphicsContext, tx + max(0, lx + lw), ty, tx + w, ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
+            drawLineForBoxSide(graphicsContext, tx + max(0, lx + lw), ty, tx + w, ty + style->borderTopWidth(), BSTop, tc, ts,
                        (lx + lw <= 0 && render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? borderLeftWidth : 0),
                        (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? borderRightWidth : 0));
     }
 
     if (render_b)
-        drawLineForBoxSide(graphicsContext, tx, ty + h - style->borderBottomWidth(), tx + w, ty + h, BSBottom, bc, style->color(), bs,
+        drawLineForBoxSide(graphicsContext, tx, ty + h - style->borderBottomWidth(), tx + w, ty + h, BSBottom, bc, bs,
                    (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? style->borderLeftWidth() : 0),
                    (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? style->borderRightWidth() : 0));
 
     if (render_l) {
-        const Color& lc = style->borderLeftColor();
+        const Color& lc = style->visitedDependentColor(CSSPropertyBorderLeftColor);
         int startY = ty;
 
         bool ignore_top =
@@ -233,12 +234,12 @@
             startY = lb;
         }
 
-        drawLineForBoxSide(graphicsContext, tx, startY, tx + borderLeftWidth, ty + h, BSLeft, lc, style->color(), ls,
-                   ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
+        drawLineForBoxSide(graphicsContext, tx, startY, tx + borderLeftWidth, ty + h, BSLeft, lc, ls,
+                           ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
     }
 
     if (render_r) {
-        const Color& rc = style->borderRightColor();
+        const Color& rc = style->visitedDependentColor(CSSPropertyBorderRightColor);
         int startY = ty;
 
         bool ignore_top =
@@ -257,7 +258,7 @@
             startY = lb;
         }
 
-        drawLineForBoxSide(graphicsContext, tx + w - borderRightWidth, startY, tx + w, ty + h, BSRight, rc, style->color(), rs,
+        drawLineForBoxSide(graphicsContext, tx + w - borderRightWidth, startY, tx + w, ty + h, BSRight, rc, rs,
                    ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
     }
 }
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index a31442a..6a5c1e0 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -114,10 +114,10 @@
     return static_cast<HTMLInputElement*>(node())->accept();
 }
 
-void RenderFileUploadControl::iconForFiles(const Vector<String>& filenames)
+void RenderFileUploadControl::chooseIconForFiles(FileChooser* chooser, const Vector<String>& filenames)
 {
     if (Chrome* chromePointer = chrome())
-        chromePointer->iconForFiles(filenames, m_fileChooser);
+        chromePointer->chooseIconForFiles(filenames, chooser);
 }
 
 void RenderFileUploadControl::click()
@@ -195,6 +195,7 @@
 {
     if (style()->visibility() != VISIBLE)
         return;
+    ASSERT(m_fileChooser);
     
     // Push a clip.
     if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
diff --git a/WebCore/rendering/RenderFileUploadControl.h b/WebCore/rendering/RenderFileUploadControl.h
index 454041a..1427dbf 100644
--- a/WebCore/rendering/RenderFileUploadControl.h
+++ b/WebCore/rendering/RenderFileUploadControl.h
@@ -61,7 +61,7 @@
     void repaint() { RenderBlock::repaint(); }
     bool allowsMultipleFiles();
     String acceptTypes();
-    void iconForFiles(const Vector<String>&);
+    void chooseIconForFiles(FileChooser*, const Vector<String>&);
 
     Chrome* chrome() const;
     int maxFilenameWidth() const;
diff --git a/WebCore/rendering/RenderForeignObject.cpp b/WebCore/rendering/RenderForeignObject.cpp
index aa28ff0..9f0889b 100644
--- a/WebCore/rendering/RenderForeignObject.cpp
+++ b/WebCore/rendering/RenderForeignObject.cpp
@@ -36,6 +36,7 @@
 
 RenderForeignObject::RenderForeignObject(SVGForeignObjectElement* node) 
     : RenderSVGBlock(node)
+    , m_needsTransformUpdate(true)
 {
 }
 
@@ -99,9 +100,12 @@
     ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
 
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
-
     SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
-    m_localTransform = foreign->animatedLocalTransform();
+
+    if (m_needsTransformUpdate) {
+        m_localTransform = foreign->animatedLocalTransform();
+        m_needsTransformUpdate = false;
+    }
 
     // Cache viewport boundaries
     FloatPoint viewportLocation(foreign->x().value(foreign), foreign->y().value(foreign));
diff --git a/WebCore/rendering/RenderForeignObject.h b/WebCore/rendering/RenderForeignObject.h
index bb6b555..d8c1f68 100644
--- a/WebCore/rendering/RenderForeignObject.h
+++ b/WebCore/rendering/RenderForeignObject.h
@@ -54,6 +54,7 @@
     virtual bool isSVGForeignObject() const { return true; }
 
     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const;
+    virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
  private:
     virtual void calcWidth();
@@ -62,6 +63,7 @@
     virtual const AffineTransform& localToParentTransform() const;
     virtual AffineTransform localTransform() const { return m_localTransform; }
 
+    bool m_needsTransformUpdate : 1;
     FloatRect m_viewport;
     AffineTransform m_localTransform;
     mutable AffineTransform m_localToParentTransform;
diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp
index ffe87c2..3932c9a 100644
--- a/WebCore/rendering/RenderFrame.cpp
+++ b/WebCore/rendering/RenderFrame.cpp
@@ -37,7 +37,7 @@
 namespace WebCore {
 
 RenderFrame::RenderFrame(HTMLFrameElement* frame)
-    : RenderPart(frame)
+    : RenderFrameBase(frame)
 {
     setInline(false);
 }
@@ -65,6 +65,7 @@
         view->setMarginHeight(marginh);
 }
 
+<<<<<<< HEAD
 #ifdef FLATTEN_FRAMESET
 void RenderFrame::layout()
 {
@@ -145,4 +146,6 @@
     setNeedsLayout(false);
 }
 
+=======
+>>>>>>> webkit.org at r58033
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderFrame.h b/WebCore/rendering/RenderFrame.h
index a66aa14..8f87b79 100644
--- a/WebCore/rendering/RenderFrame.h
+++ b/WebCore/rendering/RenderFrame.h
@@ -23,19 +23,18 @@
 #ifndef RenderFrame_h
 #define RenderFrame_h
 
-#include "RenderPart.h"
+#include "RenderFrameBase.h"
 #include "RenderFrameSet.h"
 
 namespace WebCore {
 
 class HTMLFrameElement;
 
-class RenderFrame : public RenderPart {
+class RenderFrame : public RenderFrameBase {
 public:
     RenderFrame(HTMLFrameElement*);
 
     FrameEdgeInfo edgeInfo() const;
-    void layoutWithFlattening(bool fixedWidth, bool fixedHeight);
 
 private:
     virtual const char* renderName() const { return "RenderFrame"; }
diff --git a/WebCore/rendering/RenderFrameBase.cpp b/WebCore/rendering/RenderFrameBase.cpp
new file mode 100644
index 0000000..4a62f8a
--- /dev/null
+++ b/WebCore/rendering/RenderFrameBase.cpp
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2010 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 COMPUTER, 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 "RenderFrameBase.h"
+
+#include "FrameView.h"
+#include "HTMLFrameElementBase.h"
+#include "RenderView.h"
+
+namespace WebCore {
+    
+RenderFrameBase::RenderFrameBase(Element* element)
+    : RenderPart(element)
+{
+}
+
+void RenderFrameBase::layoutWithFlattening(bool fixedWidth, bool fixedHeight)
+{
+    FrameView* childFrameView = static_cast<FrameView*>(widget());
+    RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0;
+
+    // Do not expand frames which has zero width or height
+    if (!width() || !height() || !childRoot) {
+        updateWidgetPosition();
+        if (childFrameView)
+            childFrameView->layout();
+        setNeedsLayout(false);
+        return;
+    }
+
+    // need to update to calculate min/max correctly
+    updateWidgetPosition();
+    if (childRoot->prefWidthsDirty())
+        childRoot->calcPrefWidths();
+
+    // if scrollbars are off, and the width or height are fixed
+    // we obey them and do not expand. With frame flattening
+    // no subframe much ever become scrollable.
+
+    HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
+    bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff;
+
+    // consider iframe inset border
+    int hBorder = borderLeft() + borderRight();
+    int vBorder = borderTop() + borderBottom();
+
+    // make sure minimum preferred width is enforced
+    if (isScrollable || !fixedWidth) {
+        setWidth(max(width(), childRoot->minPrefWidth() + hBorder));
+        // update again to pass the new width to the child frame
+        updateWidgetPosition();
+        childFrameView->layout();
+    }
+
+    // expand the frame by setting frame height = content height
+    if (isScrollable || !fixedHeight || childRoot->isFrameSet())
+        setHeight(max(height(), childFrameView->contentsHeight() + vBorder));
+    if (isScrollable || !fixedWidth || childRoot->isFrameSet())
+        setWidth(max(width(), childFrameView->contentsWidth() + hBorder));
+
+    updateWidgetPosition();
+
+    ASSERT(!childFrameView->layoutPending());
+    ASSERT(!childRoot->needsLayout());
+    ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild() || !childRoot->firstChild()->firstChild()->needsLayout());
+
+    setNeedsLayout(false);
+}
+
+}
diff --git a/WebCore/rendering/RenderFrameBase.h b/WebCore/rendering/RenderFrameBase.h
new file mode 100644
index 0000000..cd3cf0c
--- /dev/null
+++ b/WebCore/rendering/RenderFrameBase.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 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 COMPUTER, 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 RenderFrameBase_h
+#define RenderFrameBase_h
+
+#include "RenderPart.h"
+
+namespace WebCore {
+
+// Base class for RenderFrame and RenderIFrame
+class RenderFrameBase : public RenderPart {
+protected:
+    RenderFrameBase(Element*);
+
+public:
+    void layoutWithFlattening(bool fixedWidth, bool fixedHeight);
+};
+
+} // namespace WebCore
+
+#endif // RenderFrameBase_h
diff --git a/WebCore/rendering/RenderFrameSet.cpp b/WebCore/rendering/RenderFrameSet.cpp
index cf78b2b..fca304c 100644
--- a/WebCore/rendering/RenderFrameSet.cpp
+++ b/WebCore/rendering/RenderFrameSet.cpp
@@ -749,7 +749,7 @@
 
 bool RenderFrameSet::flattenFrameSet() const
 {
-    return document()->frame() && document()->frame()->settings()->frameSetFlatteningEnabled();
+    return document()->frame() && document()->frame()->settings()->frameFlatteningEnabled();
 }
 
 void RenderFrameSet::startResizing(GridAxis& axis, int position)
diff --git a/WebCore/rendering/RenderFrameSet.h b/WebCore/rendering/RenderFrameSet.h
index a4c8963..1e192fb 100644
--- a/WebCore/rendering/RenderFrameSet.h
+++ b/WebCore/rendering/RenderFrameSet.h
@@ -70,11 +70,14 @@
     bool canResizeRow(const IntPoint&) const;
     bool canResizeColumn(const IntPoint&) const;
 
+<<<<<<< HEAD
 #ifdef FLATTEN_FRAMESET
     void setGridNeedsLayout() { m_gridCalculated = false; }
 #endif
     bool flattenFrameSet() const;
 
+=======
+>>>>>>> webkit.org at r58033
 private:
     static const int noSplit = -1;
 
@@ -100,9 +103,11 @@
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     virtual void paint(PaintInfo&, int tx, int ty);
     virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
-    
+
     inline HTMLFrameSetElement* frameSet() const;
 
+    bool flattenFrameSet() const;
+
     void setIsResizing(bool);
 
     void layOutAxis(GridAxis&, const Length*, int availableSpace);
diff --git a/WebCore/rendering/RenderIFrame.cpp b/WebCore/rendering/RenderIFrame.cpp
new file mode 100644
index 0000000..bfea7bd
--- /dev/null
+++ b/WebCore/rendering/RenderIFrame.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2010 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 COMPUTER, 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 "RenderIFrame.h"
+
+#include "FrameView.h"
+#include "HTMLIFrameElement.h"
+#include "RenderView.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+    
+RenderIFrame::RenderIFrame(Element* element)
+    : RenderFrameBase(element)
+{
+}
+
+void RenderIFrame::calcHeight()
+{
+    RenderPart::calcHeight();
+    if (!flattenFrame())
+         return;
+
+    HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
+    bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;
+
+    if (isScrollable || !style()->height().isFixed()) {
+        FrameView* view = static_cast<FrameView*>(widget());
+        int border = borderTop() + borderBottom();
+        setHeight(max(height(), view->contentsHeight() + border));
+    }
+}
+
+void RenderIFrame::calcWidth()
+{
+    RenderPart::calcWidth();
+    if (!flattenFrame())
+        return;
+
+    HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
+    bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;
+
+    if (isScrollable || !style()->width().isFixed()) {
+        FrameView* view = static_cast<FrameView*>(widget());
+        int border = borderLeft() + borderRight();
+        setWidth(max(width(), view->contentsWidth() + border));
+    }
+}
+
+bool RenderIFrame::flattenFrame()
+{
+    if (!node() || !node()->hasTagName(iframeTag))
+        return false;
+
+    HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node());
+    bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff;
+
+    if (!isScrollable && style()->width().isFixed()
+        && style()->height().isFixed())
+        return false;
+
+    Frame* frame = element->document()->frame();
+    bool enabled = frame && frame->settings()->frameFlatteningEnabled();
+
+    if (!enabled || !frame->page())
+        return false;
+
+    FrameView* view = frame->page()->mainFrame()->view();
+    if (!view)
+        return false;
+
+    // Do not flatten offscreen inner frames during frame flattening.
+    return absoluteBoundingBoxRect().intersects(IntRect(IntPoint(0, 0), view->contentsSize()));
+}
+
+void RenderIFrame::layout()
+{
+    ASSERT(needsLayout());
+
+    RenderPart::calcWidth();
+    RenderPart::calcHeight();
+
+    if (flattenFrame()) {
+        layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed());
+        return;
+    }
+
+    RenderPart::layout();
+
+    m_overflow.clear();
+    addShadowOverflow();
+
+    setNeedsLayout(false);
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+bool RenderIFrame::requiresLayer() const
+{
+    if (RenderPart::requiresLayer())
+        return true;
+    
+    return requiresAcceleratedCompositing();
+}
+
+bool RenderIFrame::requiresAcceleratedCompositing() const
+{
+    if (!node() || !node()->hasTagName(iframeTag))
+        return false;
+
+    // If the contents of the iframe are composited, then we have to be as well.
+    HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node());
+    if (Document* contentDocument = element->contentDocument()) {
+        if (RenderView* view = contentDocument->renderView())
+            return view->usesCompositing();
+    }
+
+    return false;
+}
+#endif
+
+}
diff --git a/WebCore/rendering/RenderIFrame.h b/WebCore/rendering/RenderIFrame.h
new file mode 100644
index 0000000..ab659a4
--- /dev/null
+++ b/WebCore/rendering/RenderIFrame.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 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 COMPUTER, 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 RenderIFrame_h
+#define RenderIFrame_h
+
+#include "RenderFrameBase.h"
+
+namespace WebCore {
+
+class RenderIFrame : public RenderFrameBase {
+public:
+    RenderIFrame(Element*);
+
+#if USE(ACCELERATED_COMPOSITING)
+    bool requiresAcceleratedCompositing() const;
+#endif
+
+private:
+    virtual void calcHeight();
+    virtual void calcWidth();
+
+    virtual void layout();
+
+#if USE(ACCELERATED_COMPOSITING)
+    virtual bool requiresLayer() const;
+#endif
+    virtual bool isRenderIFrame() const { return true; }
+
+    virtual const char* renderName() const { return "RenderPartObject"; } // Lying for now to avoid breaking tests
+
+    bool flattenFrame();
+
+};
+
+inline RenderIFrame* toRenderIFrame(RenderObject* object)
+{
+    ASSERT(!object || object->isRenderIFrame());
+    return static_cast<RenderIFrame*>(object);
+}
+
+inline const RenderIFrame* toRenderIFrame(const RenderObject* object)
+{
+    ASSERT(!object || object->isRenderIFrame());
+    return static_cast<const RenderIFrame*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderIFrame(const RenderIFrame*);
+
+
+} // namespace WebCore
+
+#endif // RenderIFrame_h
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index 881d0b4..a2052fe 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -480,7 +480,7 @@
         
         Vector<Path> focusRingPaths;
         focusRingPaths.append(areaElement->getPath(this));
-        paintInfo.context->drawFocusRing(focusRingPaths, style->outlineWidth(), style->outlineOffset(), style->outlineColor());
+        paintInfo.context->drawFocusRing(focusRingPaths, style->outlineWidth(), style->outlineOffset(), style->visitedDependentColor(CSSPropertyOutlineColor));
         break;
     }
 }
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index d254835..6d3f462 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -80,7 +80,7 @@
             // not have a parent that means they are either already disconnected or
             // root lines that can just be destroyed without disconnecting.
             if (firstLineBox()->parent()) {
-                for (InlineRunBox* box = firstLineBox(); box; box = box->nextLineBox())
+                for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
                     box->remove();
             }
         } else if (isInline() && parent())
@@ -410,7 +410,7 @@
 
 void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
-    if (InlineRunBox* curr = firstLineBox()) {
+    if (InlineFlowBox* curr = firstLineBox()) {
         for (; curr; curr = curr->nextLineBox())
             rects.append(IntRect(tx + curr->x(), ty + curr->y(), curr->width(), curr->height()));
     } else
@@ -429,7 +429,7 @@
 
 void RenderInline::absoluteQuads(Vector<FloatQuad>& quads)
 {
-    if (InlineRunBox* curr = firstLineBox()) {
+    if (InlineFlowBox* curr = firstLineBox()) {
         for (; curr; curr = curr->nextLineBox()) {
             FloatRect localRect(curr->x(), curr->y(), curr->width(), curr->height());
             quads.append(localToAbsoluteQuad(localRect));
@@ -534,7 +534,7 @@
         // Return the width of the minimal left side and the maximal right side.
         int leftSide = 0;
         int rightSide = 0;
-        for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
+        for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
             if (curr == firstLineBox() || curr->x() < leftSide)
                 leftSide = curr->x();
             if (curr == firstLineBox() || curr->x() + curr->width() > rightSide)
@@ -557,7 +557,7 @@
     // Return the width of the minimal left side and the maximal right side.
     int leftSide = numeric_limits<int>::max();
     int rightSide = numeric_limits<int>::min();
-    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextFlowBox()) {
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         leftSide = min(leftSide, curr->leftVisibleOverflow());
         rightSide = max(rightSide, curr->rightVisibleOverflow());
     }
@@ -599,11 +599,10 @@
         // cb->height() is inaccurate if we're in the middle of a layout of |cb|, so use the
         // layer's size instead.  Even if the layer's size is wrong, the layer itself will repaint
         // anyway if its size does change.
-        int x = r.x();
-        int y = r.y();
+        IntRect repaintRect(r);
+        repaintRect.move(-cb->layer()->scrolledContentOffset()); // For overflow:auto/scroll/hidden.
+
         IntRect boxRect(0, 0, cb->layer()->width(), cb->layer()->height());
-        cb->layer()->subtractScrolledContentOffset(x, y); // For overflow:auto/scroll/hidden.
-        IntRect repaintRect(x, y, r.width(), r.height());
         r = intersection(repaintRect, boxRect);
     }
     
@@ -928,7 +927,7 @@
 
 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
 {
-    for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         RootInlineBox* root = curr->root();
         int top = max(root->lineTop(), curr->y());
         int bottom = min(root->lineBottom(), curr->y() + curr->height());
@@ -966,27 +965,26 @@
     if (!hasOutline())
         return;
     
-    if (style()->outlineStyleIsAuto() || hasOutlineAnnotation()) {
-        int ow = style()->outlineWidth();
-        Color oc = style()->outlineColor();
-        if (!oc.isValid())
-            oc = style()->color();
+    RenderStyle* styleToUse = style();
+    if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) {
+        int ow = styleToUse->outlineWidth();
+        Color oc = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
 
         Vector<IntRect> focusRingRects;
         addFocusRingRects(focusRingRects, tx, ty);
-        if (style()->outlineStyleIsAuto())
-            graphicsContext->drawFocusRing(focusRingRects, ow, style()->outlineOffset(), oc);
+        if (styleToUse->outlineStyleIsAuto())
+            graphicsContext->drawFocusRing(focusRingRects, ow, styleToUse->outlineOffset(), oc);
         else
             addPDFURLRect(graphicsContext, unionRect(focusRingRects));
     }
 
-    if (style()->outlineStyleIsAuto() || style()->outlineStyle() == BNONE)
+    if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE)
         return;
 
     Vector<IntRect> rects;
 
     rects.append(IntRect());
-    for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         RootInlineBox* root = curr->root();
         int top = max(root->lineTop(), curr->y());
         int bottom = min(root->lineBottom(), curr->y() + curr->height());
@@ -1001,11 +999,10 @@
 void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, int tx, int ty,
                                        const IntRect& lastline, const IntRect& thisline, const IntRect& nextline)
 {
-    int ow = style()->outlineWidth();
-    EBorderStyle os = style()->outlineStyle();
-    Color oc = style()->outlineColor();
-    if (!oc.isValid())
-        oc = style()->color();
+    RenderStyle* styleToUse = style();
+    int ow = styleToUse->outlineWidth();
+    EBorderStyle os = styleToUse->outlineStyle();
+    Color oc = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
 
     int offset = style()->outlineOffset();
 
@@ -1021,7 +1018,7 @@
                l,
                b + (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.right() - 1) <= thisline.x() ? ow : 0),
                BSLeft,
-               oc, style()->color(), os,
+               oc, os,
                (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.right() - 1) <= thisline.x() ? ow : -ow),
                (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.right() - 1) <= thisline.x() ? ow : -ow));
     
@@ -1032,7 +1029,7 @@
                r + ow,
                b + (nextline.isEmpty() || nextline.right() <= thisline.right() || (thisline.right() - 1) <= nextline.x() ? ow : 0),
                BSRight,
-               oc, style()->color(), os,
+               oc, os,
                (lastline.isEmpty() || lastline.right() < thisline.right() || (thisline.right() - 1) <= lastline.x() ? ow : -ow),
                (nextline.isEmpty() || nextline.right() <= thisline.right() || (thisline.right() - 1) <= nextline.x() ? ow : -ow));
     // upper edge
@@ -1042,7 +1039,7 @@
                    t - ow,
                    min(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())),
                    t ,
-                   BSTop, oc, style()->color(), os,
+                   BSTop, oc, os,
                    ow,
                    (!lastline.isEmpty() && tx + lastline.x() + 1 < r + ow) ? -ow : ow);
     
@@ -1052,7 +1049,7 @@
                    t - ow,
                    r + ow,
                    t ,
-                   BSTop, oc, style()->color(), os,
+                   BSTop, oc, os,
                    (!lastline.isEmpty() && l - ow < tx + lastline.right()) ? -ow : ow,
                    ow);
     
@@ -1063,7 +1060,7 @@
                    b,
                    min(r + ow, !nextline.isEmpty() ? tx + nextline.x() + 1 : 1000000),
                    b + ow,
-                   BSBottom, oc, style()->color(), os,
+                   BSBottom, oc, os,
                    ow,
                    (!nextline.isEmpty() && tx + nextline.x() + 1 < r + ow) ? -ow : ow);
     
@@ -1073,7 +1070,7 @@
                    b,
                    r + ow,
                    b + ow,
-                   BSBottom, oc, style()->color(), os,
+                   BSBottom, oc, os,
                    (!nextline.isEmpty() && l - ow < tx + nextline.right()) ? -ow : ow,
                    ow);
 }
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 03a1e75..7994325 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Portions are Copyright (C) 1998 Netscape Communications Corporation.
  *
@@ -44,7 +44,6 @@
 #include "config.h"
 #include "RenderLayer.h"
 
-#include "CString.h"
 #include "CSSPropertyNames.h"
 #include "CSSStyleDeclaration.h"
 #include "CSSStyleSelector.h"
@@ -83,6 +82,7 @@
 #include "TransformationMatrix.h"
 #include "TransformState.h"
 #include "TranslateTransformOperation.h"
+#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/UnusedParam.h>
 
@@ -245,7 +245,7 @@
 #endif
 }
 
-void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
+void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags, IntPoint* cachedOffset)
 {
     if (flags & DoFullRepaint) {
         renderer()->repaint();
@@ -259,13 +259,49 @@
 #endif
     }
     
+
     updateLayerPosition(); // For relpositioned layers or non-positioned layers,
                            // we need to keep in sync, since we may have shifted relative
                            // to our parent layer.
+    IntPoint oldCachedOffset;
+    if (cachedOffset) {
+        // We can't cache our offset to the repaint container if the mapping is anything more complex than a simple translation
+        bool disableOffsetCache = renderer()->hasColumns() || renderer()->hasTransform() || isComposited();
+#if ENABLE(SVG)
+        disableOffsetCache = disableOffsetCache || renderer()->isSVGRoot();
+#endif
+        if (disableOffsetCache)
+            cachedOffset = 0; // If our cached offset is invalid make sure it's not passed to any of our children
+        else {
+            oldCachedOffset = *cachedOffset;
+            // Frequently our parent layer's renderer will be the same as our renderer's containing block.  In that case,
+            // we just update the cache using our offset to our parent (which is m_x / m_y).  Otherwise, regenerated cached
+            // offsets to the root from the render tree.
+            if (!m_parent || m_parent->renderer() == renderer()->containingBlock())
+                cachedOffset->move(m_x, m_y); // Fast case
+            else {
+                int x = 0;
+                int y = 0;
+                convertToLayerCoords(root(), x, y);
+                *cachedOffset = IntPoint(x, y);
+            }
+        }
+    }
 
     int x = 0;
     int y = 0;
-    convertToLayerCoords(root(), x, y);
+    if (cachedOffset) {
+        x += cachedOffset->x();
+        y += cachedOffset->y();
+#ifndef NDEBUG
+        int nonCachedX = 0;
+        int nonCachedY = 0;
+        convertToLayerCoords(root(), nonCachedX, nonCachedY);
+        ASSERT(x == nonCachedX);
+        ASSERT(y == nonCachedY);
+#endif
+    } else
+        convertToLayerCoords(root(), x, y);
     positionOverflowControls(x, y);
 
     updateVisibilityStatus();
@@ -281,7 +317,9 @@
 
         RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
         IntRect newRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
-        IntRect newOutlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
+        IntRect newOutlineBox = renderer()->outlineBoundsForRepaint(repaintContainer, cachedOffset);
+        // FIXME: Should ASSERT that value calculated for newOutlineBox using the cached offset is the same
+        // as the value not using the cached offset, but we can't due to https://bugs.webkit.org/show_bug.cgi?id=37048
         if (flags & CheckForRepaint) {
             if (view && !view->printing()) {
                 if (m_needsFullRepaint) {
@@ -289,7 +327,7 @@
                     if (newRect != m_repaintRect)
                         renderer()->repaintUsingContainer(repaintContainer, newRect);
                 } else
-                    renderer()->repaintAfterLayoutIfNeeded(repaintContainer, m_repaintRect, m_outlineBox);
+                    renderer()->repaintAfterLayoutIfNeeded(repaintContainer, m_repaintRect, m_outlineBox, &newRect, &newOutlineBox);
             }
         }
         m_repaintRect = newRect;
@@ -313,7 +351,7 @@
 #endif
 
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
-        child->updateLayerPositions(flags);
+        child->updateLayerPositions(flags, cachedOffset);
 
 #if USE(ACCELERATED_COMPOSITING)
     if ((flags & UpdateCompositingLayers) && isComposited())
@@ -323,6 +361,9 @@
     // With all our children positioned, now update our marquee if we need to.
     if (m_marquee)
         m_marquee->updateMarqueePosition();
+
+    if (cachedOffset)
+        *cachedOffset = oldCachedOffset;
 }
 
 void RenderLayer::computeRepaintRects()
@@ -332,6 +373,22 @@
     m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
 }
 
+void RenderLayer::updateRepaintRectsAfterScroll(bool fixed)
+{
+    if (fixed || renderer()->style()->position() == FixedPosition) {
+        computeRepaintRects();
+        fixed = true;
+    } else if (renderer()->hasTransform()) {
+        // Transforms act as fixed position containers, so nothing inside a
+        // transformed element can be fixed relative to the viewport if the
+        // transformed element is not fixed itself or child of a fixed element.
+        return;
+    }
+
+    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+        child->updateRepaintRectsAfterScroll(fixed);
+}
+
 void RenderLayer::updateTransform()
 {
     // hasTransform() on the renderer is also true when there is transform-style: preserve-3d or perspective set,
@@ -571,15 +628,20 @@
         RenderLayer* positionedParent = enclosingPositionedAncestor();
 
         // For positioned layers, we subtract out the enclosing positioned layer's scroll offset.
-        positionedParent->subtractScrolledContentOffset(x, y);
+        IntSize offset = positionedParent->scrolledContentOffset();
+        x -= offset.width();
+        y -= offset.height();
         
         if (renderer()->isPositioned() && positionedParent->renderer()->isRelPositioned() && positionedParent->renderer()->isRenderInline()) {
             IntSize offset = toRenderInline(positionedParent->renderer())->relativePositionedInlineOffset(toRenderBox(renderer()));
             x += offset.width();
             y += offset.height();
         }
-    } else if (parent())
-        parent()->subtractScrolledContentOffset(x, y);
+    } else if (parent()) {
+        IntSize offset = parent()->scrolledContentOffset();
+        x -= offset.width();
+        y -= offset.height();
+    }
     
     // FIXME: We'd really like to just get rid of the concept of a layer rectangle and rely on the renderers.
 
@@ -714,6 +776,11 @@
 
 RenderLayer* RenderLayer::clippingRoot() const
 {
+#if USE(ACCELERATED_COMPOSITING)
+    if (isComposited())
+        return const_cast<RenderLayer*>(this);
+#endif
+
     const RenderLayer* current = this;
     while (current) {
         if (current->renderer()->isRenderView())
@@ -1175,21 +1242,6 @@
     }
 }
 
-
-void
-RenderLayer::addScrolledContentOffset(int& x, int& y) const
-{
-    x += scrollXOffset() + m_scrollLeftOverflow;
-    y += scrollYOffset();
-}
-
-void
-RenderLayer::subtractScrolledContentOffset(int& x, int& y) const
-{
-    x -= scrollXOffset() + m_scrollLeftOverflow;
-    y -= scrollYOffset();
-}
-
 void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repaint)
 {
     RenderBox* box = renderBox();
@@ -1250,15 +1302,24 @@
         view->updateWidgetPositions();
     }
 
-    // The caret rect needs to be invalidated after scrolling
+    RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
+    IntRect rectForRepaint = renderer()->clippedOverflowRectForRepaint(repaintContainer);
+
     Frame* frame = renderer()->document()->frame();
-    if (frame)
+    if (frame) {
+        // The caret rect needs to be invalidated after scrolling
         frame->selection()->setNeedsLayout();
 
+        FloatQuad quadForFakeMouseMoveEvent = FloatQuad(rectForRepaint);
+        if (repaintContainer)
+            quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent);
+        frame->eventHandler()->dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseMoveEvent);
+    }
+
     // Just schedule a full repaint of our object.
-    if (repaint)
-        renderer()->repaint();
-    
+    if (view && repaint)
+        renderer()->repaintUsingContainer(repaintContainer, rectForRepaint);
+
     if (updateScrollbars) {
         if (m_hBar)
             m_hBar->setValue(scrollXOffset());
@@ -2876,17 +2937,19 @@
 
         // If we establish a clip at all, then go ahead and make sure our background
         // rect is intersected with our layer's bounds.
-        if (ShadowData* boxShadow = renderer()->style()->boxShadow()) {
+        // FIXME: This could be changed to just use generic visual overflow.
+        // See https://bugs.webkit.org/show_bug.cgi?id=37467 for more information.
+        if (const ShadowData* boxShadow = renderer()->style()->boxShadow()) {
             IntRect overflow = layerBounds;
             do {
-                if (boxShadow->style == Normal) {
+                if (boxShadow->style() == Normal) {
                     IntRect shadowRect = layerBounds;
-                    shadowRect.move(boxShadow->x, boxShadow->y);
-                    shadowRect.inflate(boxShadow->blur + boxShadow->spread);
+                    shadowRect.move(boxShadow->x(), boxShadow->y());
+                    shadowRect.inflate(boxShadow->blur() + boxShadow->spread());
                     overflow.unite(shadowRect);
                 }
 
-                boxShadow = boxShadow->next;
+                boxShadow = boxShadow->next();
             } while (boxShadow);
             backgroundRect.intersect(overflow);
         } else
@@ -2987,7 +3050,7 @@
         int top = firstBox->topVisibleOverflow();
         int bottom = inlineFlow->lastLineBox()->bottomVisibleOverflow();
         int left = firstBox->x();
-        for (InlineRunBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
+        for (InlineFlowBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
             left = min(left, curr->x());
         result = IntRect(left, top, width(), bottom - top);
     } else if (renderer()->isTableRow()) {
@@ -3160,22 +3223,33 @@
     // Locate the common ancestor render object for the two renderers.
     RenderObject* ancestor = commonAncestor(oldHoverObj, newHoverObj);
 
+    Vector<RefPtr<Node>, 32> nodesToRemoveFromChain;
+    Vector<RefPtr<Node>, 32> nodesToAddToChain;
+
     if (oldHoverObj != newHoverObj) {
         // The old hover path only needs to be cleared up to (and not including) the common ancestor;
         for (RenderObject* curr = oldHoverObj; curr && curr != ancestor; curr = curr->hoverAncestor()) {
-            if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain())) {
-                curr->node()->setActive(false);
-                curr->node()->setHovered(false);
-            }
+            if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain()))
+                nodesToRemoveFromChain.append(curr->node());
         }
     }
 
     // Now set the hover state for our new object up to the root.
     for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) {
-        if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain())) {
-            curr->node()->setActive(request.active());
-            curr->node()->setHovered(true);
-        }
+        if (curr->node() && !curr->isText() && (!mustBeInActiveChain || curr->node()->inActiveChain()))
+            nodesToAddToChain.append(curr->node());
+    }
+
+    size_t removeCount = nodesToRemoveFromChain.size();
+    for (size_t i = 0; i < removeCount; ++i) {
+        nodesToRemoveFromChain[i]->setActive(false);
+        nodesToRemoveFromChain[i]->setHovered(false);
+    }
+
+    size_t addCount = nodesToAddToChain.size();
+    for (size_t i = 0; i < addCount; ++i) {
+        nodesToAddToChain[i]->setActive(request.active());
+        nodesToAddToChain[i]->setHovered(true);
     }
 }
 
@@ -3519,7 +3593,7 @@
         return;
 
     if (WebCore::Frame* frame = layer->renderer()->document()->frame()) {
-        WebCore::String output = externalRepresentation(frame, WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers);
+        WebCore::String output = externalRepresentation(frame, WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses);
         fprintf(stderr, "%s\n", output.utf8().data());
     }
 }
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 2c8d184..746c6fa 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -227,6 +227,8 @@
 
     int width() const { return m_width; }
     int height() const { return m_height; }
+    IntSize size() const { return IntSize(m_width, m_height); }
+    
     void setWidth(int w) { m_width = w; }
     void setHeight(int h) { m_height = h; }
 
@@ -237,8 +239,7 @@
 
     // Scrolling methods for layers that can scroll their overflow.
     void scrollByRecursively(int xDelta, int yDelta);
-    void addScrolledContentOffset(int& x, int& y) const;
-    void subtractScrolledContentOffset(int& x, int& y) const;
+
     IntSize scrolledContentOffset() const { return IntSize(scrollXOffset() + m_scrollLeftOverflow, scrollYOffset()); }
 
     int scrollXOffset() const { return m_scrollX + m_scrollOriginX; }
@@ -304,7 +305,7 @@
         UpdateCompositingLayers = 1 << 3,
     };
     typedef unsigned UpdateLayerPositionsFlags;
-    void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers);
+    void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers, IntPoint* cachedOffset = 0);
 
     void updateTransform();
 
@@ -402,6 +403,7 @@
     // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
     IntRect repaintRect() const { return m_repaintRect; }
     void computeRepaintRects();
+    void updateRepaintRectsAfterScroll(bool fixed = false);
     void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
     
     int staticX() const { return m_staticX; }
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index f637e3c..b5f74c6 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -424,7 +424,7 @@
     
     if (needsDescendantClip) {
         if (!m_clippingLayer) {
-            m_clippingLayer = GraphicsLayer::create(0);
+            m_clippingLayer = GraphicsLayer::create(this);
 #ifndef NDEBUG
             m_clippingLayer->setName("Child clipping Layer");
 #endif
diff --git a/WebCore/rendering/RenderLayerBacking.h b/WebCore/rendering/RenderLayerBacking.h
index 7aea926..a6907e7 100644
--- a/WebCore/rendering/RenderLayerBacking.h
+++ b/WebCore/rendering/RenderLayerBacking.h
@@ -46,7 +46,7 @@
 // 
 // There is one RenderLayerBacking for each RenderLayer that is composited.
 
-class RenderLayerBacking : public GraphicsLayerClient {
+class RenderLayerBacking : public GraphicsLayerClient, public Noncopyable {
 public:
     RenderLayerBacking(RenderLayer*);
     ~RenderLayerBacking();
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index 22118fe..480abb7 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,8 +37,13 @@
 #include "GraphicsLayer.h"
 #include "HitTestResult.h"
 #include "HTMLCanvasElement.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#include "HTMLNames.h"
+#endif
 #include "Page.h"
 #include "RenderEmbeddedObject.h"
+#include "RenderIFrame.h"
 #include "RenderLayerBacking.h"
 #include "RenderReplica.h"
 #include "RenderVideo.h"
@@ -50,7 +55,6 @@
 #endif
 
 #ifndef NDEBUG
-#include "CString.h"
 #include "RenderTreeAsText.h"
 #endif
 
@@ -119,6 +123,8 @@
             ensureRootPlatformLayer();
         else
             destroyRootPlatformLayer();
+
+        m_renderView->compositingStateChanged(m_compositing);
     }
 }
 
@@ -134,6 +140,15 @@
         showRepaintCounter = settings->showRepaintCounter();
     }
 
+    // We allow the chrome to override the settings, in case the page is rendered
+    // on a chrome that doesn't allow accelerated compositing.
+    if (hasAcceleratedCompositing) {
+        Frame* frame = m_renderView->frameView()->frame();
+        Page* page = frame ? frame->page() : 0;
+        if (page)
+            hasAcceleratedCompositing = page->chrome()->client()->allowsAcceleratedCompositing();
+    }
+
     if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showDebugBorders != m_showDebugBorders || showRepaintCounter != m_showRepaintCounter)
         setCompositingLayersNeedRebuild();
         
@@ -215,8 +230,13 @@
         rebuildCompositingLayerTree(updateRoot, compState, childList);
 
         // Host the document layer in the RenderView's root layer.
-        if (updateRoot == rootRenderLayer() && !childList.isEmpty())
-            m_rootPlatformLayer->setChildren(childList);
+        if (updateRoot == rootRenderLayer()) {
+            if (childList.isEmpty()) {
+                willMoveOffscreen();
+                m_rootPlatformLayer = 0;
+            } else
+                m_rootPlatformLayer->setChildren(childList);
+        }
     } else if (needGeometryUpdate) {
         // We just need to do a geometry update. This is only used for position:fixed scrolling;
         // most of the time, geometry is updated via RenderLayer::styleChanged().
@@ -326,7 +346,7 @@
 // RenderLayers that are rendered by the composited RenderLayer.
 IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer)
 {
-    if (!layer->isSelfPaintingLayer())
+    if (!canBeComposited(layer))
         return IntRect();
 
     IntRect boundingBoxRect, unionBounds;
@@ -444,6 +464,9 @@
 
     if (!boundsComputed) {
         layerBounds = layer->renderer()->localToAbsoluteQuad(FloatRect(layer->localBoundingBox())).enclosingBoundingBox();
+        // Empty rects never intersect, but we need them to for the purposes of overlap testing.
+        if (layerBounds.isEmpty())
+            layerBounds.setSize(IntSize(1, 1));
         boundsComputed = true;
     }
 
@@ -487,6 +510,9 @@
     if (overlapMap && !overlapMap->isEmpty()) {
         // If we're testing for overlap, we only need to composite if we overlap something that is already composited.
         absBounds = layer->renderer()->localToAbsoluteQuad(FloatRect(layer->localBoundingBox())).enclosingBoundingBox();
+        // Empty rects never intersect, but we need them to for the purposes of overlap testing.
+        if (absBounds.isEmpty())
+            absBounds.setSize(IntSize(1, 1));
         haveComputedBounds = true;
         mustOverlapCompositedLayers = overlapsCompositedLayers(*overlapMap, absBounds);
     }
@@ -501,6 +527,7 @@
     ++childState.m_depth;
 #endif
 
+<<<<<<< HEAD
     const bool willBeComposited = needsToBeComposited(layer);
 
 #if ENABLE(COMPOSITED_FIXED_ELEMENTS)
@@ -513,6 +540,9 @@
 
     if (willBeComposited || compositingState.m_fixedSibling) {
 #else
+=======
+    bool willBeComposited = needsToBeComposited(layer);
+>>>>>>> webkit.org at r58033
     if (willBeComposited) {
 #endif
         // Tell the parent it has compositing descendants.
@@ -599,28 +629,44 @@
     // If we have a software transform, and we have layers under us, we need to also
     // be composited. Also, if we have opacity < 1, then we need to be a layer so that
     // the child layers are opaque, then rendered with opacity on this layer.
-    if (!willBeComposited && childState.m_subtreeIsCompositing && requiresCompositingWhenDescendantsAreCompositing(layer->renderer())) {
+    if (!willBeComposited && canBeComposited(layer) && childState.m_subtreeIsCompositing && requiresCompositingWhenDescendantsAreCompositing(layer->renderer())) {
         layer->setMustOverlapCompositedLayers(true);
         if (overlapMap)
             addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
+        willBeComposited = true;
     }
 
+    ASSERT(willBeComposited == needsToBeComposited(layer));
     if (layer->reflectionLayer())
-        layer->reflectionLayer()->setMustOverlapCompositedLayers(needsToBeComposited(layer));
+        layer->reflectionLayer()->setMustOverlapCompositedLayers(willBeComposited);
 
     // Subsequent layers in the parent stacking context also need to composite.
     if (childState.m_subtreeIsCompositing)
         compositingState.m_subtreeIsCompositing = true;
 
-    // If the layer is going into compositing mode, repaint its old location.
-    if (!layer->isComposited() && needsToBeComposited(layer))
-        repaintOnCompositingChange(layer);
-
     // Set the flag to say that this SC has compositing children.
-    // this can affect the answer to needsToBeComposited() when clipping,
-    // but that's ok here.
     layer->setHasCompositingDescendant(childState.m_subtreeIsCompositing);
 
+    // setHasCompositingDescendant() may have changed the answer to needsToBeComposited() when clipping,
+    // so test that again.
+    if (!willBeComposited && canBeComposited(layer) && clipsCompositingDescendants(layer)) {
+        if (overlapMap)
+            addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
+        willBeComposited = true;
+    }
+
+    // If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
+    // to be composited, then we can drop out of compositing mode altogether.
+    if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer)) {
+        m_compositing = false;
+        willBeComposited = false;
+    }
+    
+    // If the layer is going into compositing mode, repaint its old location.
+    ASSERT(willBeComposited == needsToBeComposited(layer));
+    if (!layer->isComposited() && willBeComposited)
+        repaintOnCompositingChange(layer);
+
     // Update backing now, so that we can use isComposited() reliably during tree traversal in rebuildCompositingLayerTree().
     if (updateBacking(layer, CompositingChangeRepaintNow))
         layersChanged = true;
@@ -967,9 +1013,10 @@
 
 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
 {
-    if (!m_hasAcceleratedCompositing || !layer->isSelfPaintingLayer())
+    if (!canBeComposited(layer))
         return false;
 
+<<<<<<< HEAD
 #if ENABLE(COMPOSITED_FIXED_ELEMENTS)
     // if an ancestor is fixed positioned, we need to be composited...
     const RenderLayer* currLayer = layer;
@@ -980,6 +1027,9 @@
 #endif
 
     return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers();
+=======
+    return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers() || (inCompositingMode() && layer->isRootLayer());
+>>>>>>> webkit.org at r58033
 }
 
 #if PLATFORM(ANDROID)
@@ -1032,6 +1082,7 @@
         layer = toRenderBoxModelObject(renderer)->layer();
     }
     // The root layer always has a compositing layer, but it may not have backing.
+<<<<<<< HEAD
     return (inCompositingMode() && layer->isRootLayer()) ||
 #if PLATFORM(ANDROID)
              requiresCompositingForMobileSites(layer) ||
@@ -1044,6 +1095,21 @@
 #endif
              renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden ||
              clipsCompositingDescendants(layer);
+=======
+    return requiresCompositingForTransform(renderer)
+             || requiresCompositingForVideo(renderer)
+             || requiresCompositingForCanvas(renderer)
+             || requiresCompositingForPlugin(renderer)
+             || requiresCompositingForIFrame(renderer)
+             || renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden
+             || clipsCompositingDescendants(layer)
+             || requiresCompositingForAnimation(renderer);
+}
+
+bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
+{
+    return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer();
+>>>>>>> webkit.org at r58033
 }
 
 // Return true if the given layer has some ancestor in the RenderLayer hierarchy that clips,
@@ -1106,6 +1172,19 @@
         RenderVideo* video = toRenderVideo(renderer);
         return canAccelerateVideoRendering(video);
     }
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    else if (renderer->isRenderPart()) {
+        if (!m_hasAcceleratedCompositing)
+            return false;
+
+        Node* node = renderer->node();
+        if (!node || (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag)))
+            return false;
+
+        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node);
+        return mediaElement->player() ? mediaElement->player()->supportsAcceleratedRendering() : false;
+    }
+#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
 #else
     UNUSED_PARAM(renderer);
 #endif
@@ -1130,6 +1209,11 @@
     return renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->allowsAcceleratedCompositing();
 }
 
+bool RenderLayerCompositor::requiresCompositingForIFrame(RenderObject* renderer) const
+{
+    return renderer->isRenderIFrame() && toRenderIFrame(renderer)->requiresAcceleratedCompositing();
+}
+
 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* renderer) const
 {
     if (AnimationController* animController = renderer->animation()) {
diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h
index eeacdf7..43b8a17 100644
--- a/WebCore/rendering/RenderLayerCompositor.h
+++ b/WebCore/rendering/RenderLayerCompositor.h
@@ -142,6 +142,8 @@
     bool needsToBeComposited(const RenderLayer*) const;
     // Whether the layer has an intrinsic need for compositing layer.
     bool requiresCompositingLayer(const RenderLayer*) const;
+    // Whether the layer could ever be composited.
+    bool canBeComposited(const RenderLayer*) const;
 
     // Make or destroy the backing for this layer; returns true if backing changed.
     bool updateBacking(RenderLayer*, CompositingChangeRepaint shouldRepaint);
@@ -179,6 +181,7 @@
     bool requiresCompositingForVideo(RenderObject*) const;
     bool requiresCompositingForCanvas(RenderObject*) const;
     bool requiresCompositingForPlugin(RenderObject*) const;
+    bool requiresCompositingForIFrame(RenderObject*) const;
     bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const;
 
 #if PLATFORM(ANDROID)
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index 57bc26c..9736874 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -67,7 +67,7 @@
     InlineFlowBox* line = m_firstLineBox;
     InlineFlowBox* nextLine;
     while (line) {
-        nextLine = line->nextFlowBox();
+        nextLine = line->nextLineBox();
         line->deleteLine(arena);
         line = nextLine;
     }
@@ -78,13 +78,13 @@
 {
     checkConsistency();
     
-    m_lastLineBox = box->prevFlowBox();
+    m_lastLineBox = box->prevLineBox();
     if (box == m_firstLineBox)
         m_firstLineBox = 0;
     if (box->prevLineBox())
         box->prevLineBox()->setNextLineBox(0);
     box->setPreviousLineBox(0);
-    for (InlineRunBox* curr = box; curr; curr = curr->nextLineBox())
+    for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox())
         curr->setExtracted();
 
     checkConsistency();
@@ -100,7 +100,7 @@
     } else
         m_firstLineBox = box;
     InlineFlowBox* last = box;
-    for (InlineFlowBox* curr = box; curr; curr = curr->nextFlowBox()) {
+    for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox()) {
         curr->setExtracted(false);
         last = curr;
     }
@@ -114,9 +114,9 @@
     checkConsistency();
 
     if (box == m_firstLineBox)
-        m_firstLineBox = box->nextFlowBox();
+        m_firstLineBox = box->nextLineBox();
     if (box == m_lastLineBox)
-        m_lastLineBox = box->prevFlowBox();
+        m_lastLineBox = box->prevLineBox();
     if (box->nextLineBox())
         box->nextLineBox()->setPreviousLineBox(box->prevLineBox());
     if (box->prevLineBox())
@@ -128,8 +128,8 @@
 void RenderLineBoxList::deleteLineBoxes(RenderArena* arena)
 {
     if (m_firstLineBox) {
-        InlineRunBox* next;
-        for (InlineRunBox* curr = m_firstLineBox; curr; curr = next) {
+        InlineFlowBox* next;
+        for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
             next = curr->nextLineBox();
             curr->destroy(arena);
         }
@@ -140,7 +140,7 @@
 
 void RenderLineBoxList::dirtyLineBoxes()
 {
-    for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
         curr->dirtyLineBoxes();
 }
 
@@ -177,7 +177,7 @@
     // based off positions of our first line box or our last line box.
     RenderView* v = renderer->view();
     bool usePrintRect = !v->printRect().isEmpty();
-    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextFlowBox()) {
+    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         if (usePrintRect) {
             // FIXME: This is a feeble effort to avoid splitting a line across two pages.
             // It is utterly inadequate, and this should not be done at paint time at all.
@@ -236,7 +236,7 @@
     // See if our root lines contain the point.  If so, then we hit test
     // them further.  Note that boxes can easily overlap, so we can't make any assumptions
     // based off positions of our first line box or our last line box.
-    for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevFlowBox()) {
+    for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
         if (y >= ty + curr->root()->topVisibleOverflow() && y < ty + curr->root()->bottomVisibleOverflow()) {
             bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty);
             if (inside) {
@@ -281,9 +281,9 @@
             if (textBox)
                 box = textBox->root();
         } else if (curr->isRenderInline()) {
-            InlineRunBox* runBox = toRenderInline(curr)->lastLineBox();
-            if (runBox)
-                box = runBox->root();
+            InlineFlowBox* flowBox = toRenderInline(curr)->lastLineBox();
+            if (flowBox)
+                box = flowBox->root();
         }
 
         if (box)
@@ -321,8 +321,8 @@
 {
 #ifdef CHECK_CONSISTENCY
     const InlineFlowBox* prev = 0;
-    for (const InlineFlowBox* child = m_firstLineBox; child != 0; child = child->nextFlowBox()) {
-        ASSERT(child->prevFlowBox() == prev);
+    for (const InlineFlowBox* child = m_firstLineBox; child != 0; child = child->nextLineBox()) {
+        ASSERT(child->prevLineBox() == prev);
         prev = child;
     }
     ASSERT(prev == m_lastLineBox);
diff --git a/WebCore/rendering/RenderListItem.cpp b/WebCore/rendering/RenderListItem.cpp
index 54a7dd2..f861467 100644
--- a/WebCore/rendering/RenderListItem.cpp
+++ b/WebCore/rendering/RenderListItem.cpp
@@ -80,33 +80,24 @@
     return (node->hasTagName(ulTag) || node->hasTagName(olTag));
 }
 
-static Node* enclosingList(Node* node)
+static Node* enclosingList(const RenderListItem* listItem)
 {
-    Node* parent = node->parentNode();
-    for (Node* n = parent; n; n = n->parentNode())
-        if (isList(n))
-            return n;
-    // If there's no actual <ul> or <ol> list element, then our parent acts as
-    // our list for purposes of determining what other list items should be
-    // numbered as part of the same list.
-    return parent;
-}
+    Node* firstNode = 0;
 
-static Node* enclosingList(const RenderObject* renderer)
-{
-    Node* node = renderer->node();
-    if (node)
-        return enclosingList(node);
+    for (const RenderObject* renderer = listItem->parent(); renderer; renderer = renderer->parent()) {
+        Node* node = renderer->node();
+        if (node) {
+            if (isList(node))
+                return node;
+            if (!firstNode)
+                firstNode = node;
+        }
+    }
 
-    renderer = renderer->parent();
-    while (renderer && !renderer->node())
-        renderer = renderer->parent();
-
-    node = renderer->node();
-    if (isList(node))
-        return node;
-
-    return enclosingList(node);
+    // If there's no actual <ul> or <ol> list element, then the first found
+    // node acts as our list for purposes of determining what other list items
+    // should be numbered as part of the same list.
+    return firstNode;
 }
 
 static RenderListItem* previousListItem(Node* list, const RenderListItem* item)
@@ -114,7 +105,7 @@
     for (RenderObject* renderer = item->previousInPreOrder(); renderer != list->renderer(); renderer = renderer->previousInPreOrder()) {
         if (!renderer->isListItem())
             continue;
-        Node* otherList = enclosingList(renderer);
+        Node* otherList = enclosingList(toRenderListItem(renderer));
         // This item is part of our current list, so it's what we're looking for.
         if (list == otherList)
             return toRenderListItem(renderer);
@@ -326,7 +317,7 @@
 {
     if (m_marker)
         m_marker->setNeedsLayoutAndPrefWidthsRecalc();
-    Node* listNode = enclosingList(node());
+    Node* listNode = enclosingList(this);
     RenderObject* listRenderer = 0;
     if (listNode)
         listRenderer = listNode->renderer();
@@ -364,4 +355,38 @@
     explicitValueChanged();
 }
 
+void RenderListItem::updateListMarkerNumbers()
+{
+    Node* listNode = enclosingList(this);
+    ASSERT(listNode && listNode->renderer());
+    if (!listNode || !listNode->renderer())
+        return;
+
+    RenderObject* list = listNode->renderer();
+    RenderObject* child = nextInPreOrder(list);
+    while (child) {
+        if (child->node() && isList(child->node())) {
+            // We've found a nested, independent list: nothing to do here.
+            child = child->nextInPreOrderAfterChildren(list);
+            continue;
+        }
+
+        if (child->isListItem()) {
+            RenderListItem* item = toRenderListItem(child);
+
+            if (!item->m_isValueUpToDate) {
+                // If an item has been marked for update before, we can safely
+                // assume that all the following ones have too.
+                // This gives us the opportunity to stop here and avoid
+                // marking the same nodes again.
+                break;
+            }
+
+            item->updateValue();
+        }
+
+        child = child->nextInPreOrder(list);
+    }
+}
+
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderListItem.h b/WebCore/rendering/RenderListItem.h
index c4c41dc..2ad9a41 100644
--- a/WebCore/rendering/RenderListItem.h
+++ b/WebCore/rendering/RenderListItem.h
@@ -46,6 +46,8 @@
 
     const String& markerText() const;
 
+    void updateListMarkerNumbers();
+
 private:
     virtual const char* renderName() const { return "RenderListItem"; }
 
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index 05a9873..518925a 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -1,6 +1,7 @@
 /*
  * This file is part of the select element renderer in WebCore.
  *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *               2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
  *
@@ -25,6 +26,7 @@
 #include "RenderMenuList.h"
 
 #include "AXObjectCache.h"
+#include "AccessibilityObject.h"
 #include "CSSStyleSelector.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -308,6 +310,20 @@
     select->setSelectedIndexByUser(select->listToOptionIndex(listIndex), true, fireOnChange);
 }
 
+#if ENABLE(NO_LISTBOX_RENDERING)
+void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
+{
+    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
+    select->listBoxSelectItem(select->listToOptionIndex(listIndex), allowMultiplySelections, shift, fireOnChangeNow);
+}
+
+bool RenderMenuList::multiple()
+{
+    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
+    return select->multiple();
+}
+#endif
+
 void RenderMenuList::didSetSelectedIndex()
 {
     int index = selectedIndex();
@@ -334,6 +350,17 @@
     return String();
 }
 
+String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
+{
+    // Allow the accessible name be changed if necessary.
+    SelectElement* select = toSelectElement(static_cast<Element*>(node()));
+    const Vector<Element*>& listItems = select->listItems();
+    if (listIndex >= listItems.size())
+        return String();
+
+    return AccessibilityObject::getAttribute(listItems[listIndex], aria_labelAttr); 
+}
+    
 String RenderMenuList::itemToolTip(unsigned listIndex) const
 {
     SelectElement* select = toSelectElement(static_cast<Element*>(node()));
diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h
index a5aa041..aeb6205 100644
--- a/WebCore/rendering/RenderMenuList.h
+++ b/WebCore/rendering/RenderMenuList.h
@@ -1,6 +1,7 @@
 /*
  * This file is part of the select element renderer in WebCore.
  *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -37,7 +38,12 @@
 class PopupMenu;
 class RenderText;
 
+#if ENABLE(NO_LISTBOX_RENDERING)
+class RenderMenuList : public RenderFlexibleBox, private ListPopupMenuClient {
+#else
 class RenderMenuList : public RenderFlexibleBox, private PopupMenuClient {
+#endif
+
 public:
     RenderMenuList(Element*);
     virtual ~RenderMenuList();
@@ -75,6 +81,7 @@
     // PopupMenuClient methods
     virtual String itemText(unsigned listIndex) const;
     virtual String itemToolTip(unsigned listIndex) const;
+    virtual String itemAccessibilityText(unsigned listIndex) const;
     virtual bool itemIsEnabled(unsigned listIndex) const;
     virtual PopupMenuStyle itemStyle(unsigned listIndex) const;
     virtual PopupMenuStyle menuStyle() const;
@@ -96,6 +103,11 @@
     virtual HostWindow* hostWindow() const;
     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
 
+#if ENABLE(NO_LISTBOX_RENDERING)
+    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
+    virtual bool multiple();
+#endif
+
     virtual bool hasLineIfEmpty() const { return true; }
 
     Color itemBackgroundColor(unsigned listIndex) const;
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index e70de96..d63997a 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -119,12 +119,12 @@
     if (node->hasTagName(rubyTag)) {
         if (style->display() == INLINE)
             return new (arena) RenderRubyAsInline(node);
-        else
+        else if (style->display() == BLOCK)
             return new (arena) RenderRubyAsBlock(node);
     }
     // treat <rt> as ruby text ONLY if it still has its default treatment of block
     if (node->hasTagName(rtTag) && style->display() == BLOCK)
-        return new (arena) RenderRubyText(node); 
+        return new (arena) RenderRubyText(node);
 #endif
 
     switch (style->display()) {
@@ -260,14 +260,6 @@
     return node() && node()->renderer() == this && node()->hasTagName(marqueeTag);
 }
 
-static void updateListMarkerNumbers(RenderObject* child)
-{
-    for (RenderObject* sibling = child; sibling; sibling = sibling->nextSibling()) {
-        if (sibling->isListItem())
-            toRenderListItem(sibling)->updateValue();
-    }
-}
-
 void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild)
 {
     RenderObjectChildList* children = virtualChildren();
@@ -277,9 +269,7 @@
 
     bool needsTable = false;
 
-    if (newChild->isListItem())
-        updateListMarkerNumbers(beforeChild ? beforeChild : children->lastChild());
-    else if (newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP)
+    if (newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP)
         needsTable = !isTable();
     else if (newChild->isRenderBlock() && newChild->style()->display() == TABLE_CAPTION)
         needsTable = !isTable();
@@ -701,7 +691,7 @@
 }
 
 void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, int x1, int y1, int x2, int y2,
-                                      BoxSide s, Color c, const Color& textcolor, EBorderStyle style,
+                                      BoxSide s, Color c, EBorderStyle style,
                                       int adjbw1, int adjbw2)
 {
     int width = (s == BSTop || s == BSBottom ? y2 - y1 : x2 - x1);
@@ -709,13 +699,6 @@
     if (style == DOUBLE && width < 3)
         style = SOLID;
 
-    if (!c.isValid()) {
-        if (style == INSET || style == OUTSET || style == RIDGE || style == GROOVE)
-            c.setRGB(238, 238, 238);
-        else
-            c = textcolor;
-    }
-
     switch (style) {
         case BNONE:
         case BHIDDEN:
@@ -767,34 +750,34 @@
                     case BSTop:
                         drawLineForBoxSide(graphicsContext, x1 + max((-adjbw1 * 2 + 1) / 3, 0),
                                    y1, x2 - max((-adjbw2 * 2 + 1) / 3, 0), y1 + third,
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         drawLineForBoxSide(graphicsContext, x1 + max((adjbw1 * 2 + 1) / 3, 0),
                                    y2 - third, x2 - max((adjbw2 * 2 + 1) / 3, 0), y2,
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         break;
                     case BSLeft:
                         drawLineForBoxSide(graphicsContext, x1, y1 + max((-adjbw1 * 2 + 1) / 3, 0),
                                    x1 + third, y2 - max((-adjbw2 * 2 + 1) / 3, 0),
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         drawLineForBoxSide(graphicsContext, x2 - third, y1 + max((adjbw1 * 2 + 1) / 3, 0),
                                    x2, y2 - max((adjbw2 * 2 + 1) / 3, 0),
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         break;
                     case BSBottom:
                         drawLineForBoxSide(graphicsContext, x1 + max((adjbw1 * 2 + 1) / 3, 0),
                                    y1, x2 - max((adjbw2 * 2 + 1) / 3, 0), y1 + third,
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         drawLineForBoxSide(graphicsContext, x1 + max((-adjbw1 * 2 + 1) / 3, 0),
                                    y2 - third, x2 - max((-adjbw2 * 2 + 1) / 3, 0), y2,
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         break;
                     case BSRight:
                         drawLineForBoxSide(graphicsContext, x1, y1 + max((adjbw1 * 2 + 1) / 3, 0),
                                    x1 + third, y2 - max((adjbw2 * 2 + 1) / 3, 0),
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         drawLineForBoxSide(graphicsContext, x2 - third, y1 + max((-adjbw1 * 2 + 1) / 3, 0),
                                    x2, y2 - max((-adjbw2 * 2 + 1) / 3, 0),
-                                   s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+                                   s, c, SOLID, adjbw1bigthird, adjbw2bigthird);
                         break;
                     default:
                         break;
@@ -821,27 +804,27 @@
             switch (s) {
                 case BSTop:
                     drawLineForBoxSide(graphicsContext, x1 + max(-adjbw1, 0) / 2, y1, x2 - max(-adjbw2, 0) / 2, (y1 + y2 + 1) / 2,
-                               s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+                               s, c, s1, adjbw1bighalf, adjbw2bighalf);
                     drawLineForBoxSide(graphicsContext, x1 + max(adjbw1 + 1, 0) / 2, (y1 + y2 + 1) / 2, x2 - max(adjbw2 + 1, 0) / 2, y2,
-                               s, c, textcolor, s2, adjbw1 / 2, adjbw2 / 2);
+                               s, c, s2, adjbw1 / 2, adjbw2 / 2);
                     break;
                 case BSLeft:
                     drawLineForBoxSide(graphicsContext, x1, y1 + max(-adjbw1, 0) / 2, (x1 + x2 + 1) / 2, y2 - max(-adjbw2, 0) / 2,
-                               s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+                               s, c, s1, adjbw1bighalf, adjbw2bighalf);
                     drawLineForBoxSide(graphicsContext, (x1 + x2 + 1) / 2, y1 + max(adjbw1 + 1, 0) / 2, x2, y2 - max(adjbw2 + 1, 0) / 2,
-                               s, c, textcolor, s2, adjbw1 / 2, adjbw2 / 2);
+                               s, c, s2, adjbw1 / 2, adjbw2 / 2);
                     break;
                 case BSBottom:
                     drawLineForBoxSide(graphicsContext, x1 + max(adjbw1, 0) / 2, y1, x2 - max(adjbw2, 0) / 2, (y1 + y2 + 1) / 2,
-                               s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
+                               s, c, s2, adjbw1bighalf, adjbw2bighalf);
                     drawLineForBoxSide(graphicsContext, x1 + max(-adjbw1 + 1, 0) / 2, (y1 + y2 + 1) / 2, x2 - max(-adjbw2 + 1, 0) / 2, y2,
-                               s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+                               s, c, s1, adjbw1 / 2, adjbw2 / 2);
                     break;
                 case BSRight:
                     drawLineForBoxSide(graphicsContext, x1, y1 + max(adjbw1, 0) / 2, (x1 + x2 + 1) / 2, y2 - max(adjbw2, 0) / 2,
-                               s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
+                               s, c, s2, adjbw1bighalf, adjbw2bighalf);
                     drawLineForBoxSide(graphicsContext, (x1 + x2 + 1) / 2, y1 + max(-adjbw1 + 1, 0) / 2, x2, y2 - max(-adjbw2 + 1, 0) / 2,
-                               s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+                               s, c, s1, adjbw1 / 2, adjbw2 / 2);
                     break;
             }
             break;
@@ -897,19 +880,12 @@
 }
 
 void RenderObject::drawArcForBoxSide(GraphicsContext* graphicsContext, int x, int y, float thickness, IntSize radius,
-                                     int angleStart, int angleSpan, BoxSide s, Color c, const Color& textColor,
+                                     int angleStart, int angleSpan, BoxSide s, Color c,
                                      EBorderStyle style, bool firstCorner)
 {
     if ((style == DOUBLE && thickness / 2 < 3) || ((style == RIDGE || style == GROOVE) && thickness / 2 < 2))
         style = SOLID;
 
-    if (!c.isValid()) {
-        if (style == INSET || style == OUTSET || style == RIDGE || style == GROOVE)
-            c.setRGB(238, 238, 238);
-        else
-            c = textColor;
-    }
-
     switch (style) {
         case BNONE:
         case BHIDDEN:
@@ -997,33 +973,32 @@
     context->setURLForRect(n->document()->completeURL(href), rect);
 }
 
-void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty, int w, int h, const RenderStyle* style)
+void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty, int w, int h)
 {
     if (!hasOutline())
         return;
 
-    int ow = style->outlineWidth();
-    EBorderStyle os = style->outlineStyle();
+    RenderStyle* styleToUse = style();
+    int ow = styleToUse->outlineWidth();
+    EBorderStyle os = styleToUse->outlineStyle();
 
-    Color oc = style->outlineColor();
-    if (!oc.isValid())
-        oc = style->color();
+    Color oc = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
 
-    int offset = style->outlineOffset();
+    int offset = styleToUse->outlineOffset();
 
-    if (style->outlineStyleIsAuto() || hasOutlineAnnotation()) {
-        if (!theme()->supportsFocusRing(style)) {
+    if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) {
+        if (!theme()->supportsFocusRing(styleToUse)) {
             // Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
             Vector<IntRect> focusRingRects;
             addFocusRingRects(focusRingRects, tx, ty);
-            if (style->outlineStyleIsAuto())
+            if (styleToUse->outlineStyleIsAuto())
                 graphicsContext->drawFocusRing(focusRingRects, ow, offset, oc);
             else
                 addPDFURLRect(graphicsContext, unionRect(focusRingRects));
         }
     }
 
-    if (style->outlineStyleIsAuto() || style->outlineStyle() == BNONE)
+    if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE)
         return;
 
     tx -= offset;
@@ -1034,17 +1009,10 @@
     if (h < 0 || w < 0)
         return;
 
-    drawLineForBoxSide(graphicsContext, tx - ow, ty - ow, tx, ty + h + ow,
-               BSLeft, Color(oc), style->color(), os, ow, ow);
-
-    drawLineForBoxSide(graphicsContext, tx - ow, ty - ow, tx + w + ow, ty,
-               BSTop, Color(oc), style->color(), os, ow, ow);
-
-    drawLineForBoxSide(graphicsContext, tx + w, ty - ow, tx + w + ow, ty + h + ow,
-               BSRight, Color(oc), style->color(), os, ow, ow);
-
-    drawLineForBoxSide(graphicsContext, tx - ow, ty + h, tx + w + ow, ty + h + ow,
-               BSBottom, Color(oc), style->color(), os, ow, ow);
+    drawLineForBoxSide(graphicsContext, tx - ow, ty - ow, tx, ty + h + ow, BSLeft, oc, os, ow, ow);
+    drawLineForBoxSide(graphicsContext, tx - ow, ty - ow, tx + w + ow, ty, BSTop, oc, os, ow, ow);
+    drawLineForBoxSide(graphicsContext, tx + w, ty - ow, tx + w + ow, ty + h + ow, BSRight, oc, os, ow, ow);
+    drawLineForBoxSide(graphicsContext, tx - ow, ty + h, tx + w + ow, ty + h + ow, BSBottom, oc, os, ow, ow);
 }
 
 IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms)
@@ -1182,13 +1150,14 @@
     repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);
 }
 
-bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox)
+bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox, const IntRect* newBoundsPtr, const IntRect* newOutlineBoxRectPtr)
 {
     RenderView* v = view();
     if (v->printing())
         return false; // Don't repaint if we're printing.
 
-    IntRect newBounds = clippedOverflowRectForRepaint(repaintContainer);
+    ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer));
+    IntRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
     IntRect newOutlineBox;
 
     bool fullRepaint = selfNeedsLayout();
@@ -1196,7 +1165,8 @@
     if (!fullRepaint && style()->borderFit() == BorderFitLines)
         fullRepaint = true;
     if (!fullRepaint) {
-        newOutlineBox = outlineBoundsForRepaint(repaintContainer);
+        ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBoundsForRepaint(repaintContainer));
+        newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBoundsForRepaint(repaintContainer);
         if (newOutlineBox.location() != oldOutlineBox.location() || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || newOutlineBox != oldOutlineBox)))
             fullRepaint = true;
     }
@@ -1331,11 +1301,10 @@
             // anyway if its size does change.
             RenderBox* boxParent = toRenderBox(o);
 
+            IntRect repaintRect(rect);
+            repaintRect.move(-boxParent->layer()->scrolledContentOffset()); // For overflow:auto/scroll/hidden.
+
             IntRect boxRect(0, 0, boxParent->layer()->width(), boxParent->layer()->height());
-            int x = rect.x();
-            int y = rect.y();
-            boxParent->layer()->subtractScrolledContentOffset(x, y); // For overflow:auto/scroll/hidden.
-            IntRect repaintRect(x, y, rect.width(), rect.height());
             rect = intersection(repaintRect, boxRect);
             if (rect.isEmpty())
                 return;
@@ -1667,9 +1636,10 @@
 #endif
 
         bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition
-                                               || (!shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage()));
+                                                || (!shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage()));
         bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition
-                                               || (!shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage()));
+                                                || (!shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage()));
+
         if (oldStyleSlowScroll != newStyleSlowScroll) {
             if (oldStyleSlowScroll)
                 view()->frameView()->removeSlowRepaintObject();
@@ -2210,21 +2180,17 @@
     return result.release();
 }
 
-static Color decorationColor(RenderStyle* style)
+static Color decorationColor(RenderObject* renderer)
 {
     Color result;
-    if (style->textStrokeWidth() > 0) {
+    if (renderer->style()->textStrokeWidth() > 0) {
         // Prefer stroke color if possible but not if it's fully transparent.
-        result = style->textStrokeColor();
-        if (!result.isValid())
-            result = style->color();
+        result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
         if (result.alpha())
             return result;
     }
     
-    result = style->textFillColor();
-    if (!result.isValid())
-        result = style->color();
+    result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextFillColor);
     return result;
 }
 
@@ -2237,15 +2203,15 @@
         if (currDecs) {
             if (currDecs & UNDERLINE) {
                 decorations &= ~UNDERLINE;
-                underline = decorationColor(curr->style());
+                underline = decorationColor(curr);
             }
             if (currDecs & OVERLINE) {
                 decorations &= ~OVERLINE;
-                overline = decorationColor(curr->style());
+                overline = decorationColor(curr);
             }
             if (currDecs & LINE_THROUGH) {
                 decorations &= ~LINE_THROUGH;
-                linethrough = decorationColor(curr->style());
+                linethrough = decorationColor(curr);
             }
         }
         curr = curr->parent();
@@ -2257,11 +2223,11 @@
     // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
     if (decorations && curr) {
         if (decorations & UNDERLINE)
-            underline = decorationColor(curr->style());
+            underline = decorationColor(curr);
         if (decorations & OVERLINE)
-            overline = decorationColor(curr->style());
+            overline = decorationColor(curr);
         if (decorations & LINE_THROUGH)
-            linethrough = decorationColor(curr->style());
+            linethrough = decorationColor(curr);
     }
 }
 
@@ -2381,21 +2347,21 @@
 void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const
 {
     int outlineSize = outlineStyleForRepaint()->outlineSize();
-    if (ShadowData* boxShadow = style()->boxShadow()) {
+    if (const ShadowData* boxShadow = style()->boxShadow()) {
         int shadowLeft = 0;
         int shadowRight = 0;
         int shadowTop = 0;
         int shadowBottom = 0;
 
         do {
-            if (boxShadow->style == Normal) {
-                shadowLeft = min(boxShadow->x - boxShadow->blur - boxShadow->spread - outlineSize, shadowLeft);
-                shadowRight = max(boxShadow->x + boxShadow->blur + boxShadow->spread + outlineSize, shadowRight);
-                shadowTop = min(boxShadow->y - boxShadow->blur - boxShadow->spread - outlineSize, shadowTop);
-                shadowBottom = max(boxShadow->y + boxShadow->blur + boxShadow->spread + outlineSize, shadowBottom);
+            if (boxShadow->style() == Normal) {
+                shadowLeft = min(boxShadow->x() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowLeft);
+                shadowRight = max(boxShadow->x() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowRight);
+                shadowTop = min(boxShadow->y() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowTop);
+                shadowBottom = max(boxShadow->y() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowBottom);
             }
 
-            boxShadow = boxShadow->next;
+            boxShadow = boxShadow->next();
         } while (boxShadow);
 
         rect.move(shadowLeft, shadowTop);
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 791d4d0..ae12758 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -277,8 +277,12 @@
     virtual bool isListMarker() const { return false; }
     virtual bool isMedia() const { return false; }
     virtual bool isMenuList() const { return false; }
+#if ENABLE(PROGRESS_TAG)
+    virtual bool isProgress() const { return false; }
+#endif
     virtual bool isRenderBlock() const { return false; }
     virtual bool isRenderButton() const { return false; }
+    virtual bool isRenderIFrame() const { return false; }
     virtual bool isRenderImage() const { return false; }
     virtual bool isRenderInline() const { return false; }
     virtual bool isRenderPart() const { return false; }
@@ -334,10 +338,17 @@
     virtual bool isSVGImage() const { return false; }
     virtual bool isSVGForeignObject() const { return false; }
     virtual bool isSVGResource() const { return false; }
+    virtual bool isSVGShadowTreeRootContainer() const { return false; }
 
     virtual const SVGRenderBase* toSVGRenderBase() const;
     virtual RenderSVGResource* toRenderSVGResource();
 
+    // FIXME: Those belong into a SVG specific base-class for all renderers (see above)
+    // Unfortunately we don't have such a class yet, because it's not possible for all renderers
+    // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock inheritance for instance)
+    virtual void setNeedsTransformUpdate() { }
+    virtual void setNeedsBoundariesUpdate() { }
+
     // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width.
     // This is used for all computation of objectBoundingBox relative units and by SVGLocateable::getBBox().
     // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we ignore them
@@ -350,7 +361,6 @@
     // respecting clipping, masking, filters, opacity, stroke-width and markers
     virtual FloatRect repaintRectInLocalCoordinates() const;
 
-    // FIXME: This accessor is deprecated and mostly around for SVGRenderTreeAsText.
     // This only returns the transform="" value from the element
     // most callsites want localToParentTransform() instead.
     virtual AffineTransform localTransform() const;
@@ -405,9 +415,9 @@
     bool hasMask() const { return style() && style()->hasMask(); }
 
     void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
-                            Color, const Color& textcolor, EBorderStyle, int adjbw1, int adjbw2);
+                            Color, EBorderStyle, int adjbw1, int adjbw2);
     void drawArcForBoxSide(GraphicsContext*, int x, int y, float thickness, IntSize radius, int angleStart,
-                           int angleSpan, BoxSide, Color, const Color& textcolor, EBorderStyle, bool firstCorner);
+                           int angleSpan, BoxSide, Color, EBorderStyle, bool firstCorner);
 
 public:
     // The pseudo element style can be cached or uncached.  Use the cached method if the pseudo element doesn't respect
@@ -512,10 +522,6 @@
 
     /* This function performs a layout only if one is needed. */
     void layoutIfNeeded() { if (needsLayout()) layout(); }
-
-    // Called when a positioned object moves but doesn't necessarily change size.  A simplified layout is attempted
-    // that just updates the object's position. If the size does change, the object remains dirty.
-    virtual void tryLayoutDoingPositionedMovementOnly() { }
     
     // used for element state updates that cannot be fixed with a
     // repaint and do not need a relayout
@@ -616,8 +622,8 @@
     // Repaint a specific subrectangle within a given object.  The rect |r| is in the object's coordinate space.
     void repaintRectangle(const IntRect&, bool immediate = false);
 
-    // Repaint only if our old bounds and new bounds are different.
-    bool repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox);
+    // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
+    bool repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintContainer, const IntRect& oldBounds, const IntRect& oldOutlineBox, const IntRect* newBoundsPtr = 0, const IntRect* newOutlineBoxPtr = 0);
 
     // Repaint only if the object moved.
     virtual void repaintDuringLayoutIfMoved(const IntRect& rect);
@@ -782,7 +788,7 @@
     // Overrides should call the superclass at the start
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
-    void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);
+    void paintOutline(GraphicsContext*, int tx, int ty, int w, int h);
     void addPDFURLRect(GraphicsContext*, const IntRect&);
 
     virtual IntRect viewRect() const;
@@ -791,7 +797,7 @@
 
     void arenaDelete(RenderArena*, void* objectBase);
 
-    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/) const { return IntRect(); }
+    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* /*cachedOffsetToRepaintContainer*/ = 0) const { return IntRect(); }
 
     class LayoutRepainter {
     public:
diff --git a/WebCore/rendering/RenderObjectChildList.cpp b/WebCore/rendering/RenderObjectChildList.cpp
index d56a015..6d76f34 100644
--- a/WebCore/rendering/RenderObjectChildList.cpp
+++ b/WebCore/rendering/RenderObjectChildList.cpp
@@ -39,14 +39,6 @@
 
 namespace WebCore {
 
-static void updateListMarkerNumbers(RenderObject* child)
-{
-    for (RenderObject* sibling = child; sibling; sibling = sibling->nextSibling()) {
-        if (sibling->isListItem())
-            toRenderListItem(sibling)->updateValue();
-    }
-}
-
 void RenderObjectChildList::destroyLeftoverChildren()
 {
     while (firstChild()) {
@@ -91,11 +83,10 @@
                 layer = owner->enclosingLayer();
             oldChild->removeLayers(layer);
         }
-        
-        // renumber ordered lists
+
         if (oldChild->isListItem())
-            updateListMarkerNumbers(oldChild->nextSibling());
-        
+            toRenderListItem(oldChild)->updateListMarkerNumbers();
+
         if (oldChild->isPositioned() && owner->childrenInline())
             owner->dirtyLinesFromChangedChild(oldChild);
     }
@@ -161,7 +152,10 @@
             if (layer)
                 layer->setHasVisibleContent(true);
         }
-        
+
+        if (newChild->isListItem())
+            toRenderListItem(newChild)->updateListMarkerNumbers();
+
         if (!newChild->isFloatingOrPositioned() && owner->childrenInline())
             owner->dirtyLinesFromChangedChild(newChild);
     }
@@ -218,7 +212,9 @@
                 layer->setHasVisibleContent(true);
         }
 
-        
+        if (child->isListItem())
+            toRenderListItem(child)->updateListMarkerNumbers();
+
         if (!child->isFloating() && owner->childrenInline())
             owner->dirtyLinesFromChangedChild(child);
     }
@@ -234,17 +230,42 @@
 static RenderObject* beforeAfterContainer(RenderObject* container, PseudoId type)
 {
     if (type == BEFORE) {
+        // An anonymous (generated) inline run-in that has PseudoId BEFORE must come from a grandparent.
+        // Therefore we should skip these generated run-ins when checking our immediate children.
+        // If we don't find our :before child immediately, then we should check if we own a
+        // generated inline run-in in the next level of children.
         RenderObject* first = container;
         do {
-            // Skip list markers.
+            // Skip list markers and generated run-ins
             first = first->firstChild();
-            while (first && first->isListMarker())
+            while (first && (first->isListMarker() || (first->isRenderInline() && first->isRunIn() && first->isAnonymous())))
                 first = first->nextSibling();
         } while (first && first->isAnonymous() && first->style()->styleType() == NOPSEUDO);
-        if (first && first->style()->styleType() != type)
+
+        if (!first)
             return 0;
-        return first;
+
+        if (first->style()->styleType() == type)
+            return first;
+
+        // Check for a possible generated run-in, using run-in positioning rules.
+        // Skip inlines and floating / positioned blocks, and place as the first child.
+        first = container->firstChild();
+        if (!first->isRenderBlock())
+            return 0;
+        while (first && first->isFloatingOrPositioned())
+            first = first->nextSibling();
+        if (first) {
+            first = first->firstChild();
+            // We still need to skip any list markers that could exist before the run-in.
+            while (first && first->isListMarker())
+                first = first->nextSibling();
+            if (first && first->style()->styleType() == type && first->isRenderInline() && first->isRunIn() && first->isAnonymous())
+                return first;
+        }
+        return 0;
     }
+
     if (type == AFTER) {
         RenderObject* last = container;
         do {
@@ -314,7 +335,7 @@
     // Whether or not we currently have generated content attached.
     bool oldContentPresent = child;
 
-    // Whether or not we now want generated content.  
+    // Whether or not we now want generated content.
     bool newContentWanted = pseudoElementStyle && pseudoElementStyle->display() != NONE;
 
     // For <q><p/></q>, if this object is the inline continuation of the <q>, we only want to generate
@@ -330,9 +351,9 @@
     // If we don't want generated content any longer, or if we have generated content, but it's no longer
     // identical to the new content data we want to build render objects for, then we nuke all
     // of the old generated content.
-    if (!newContentWanted || (oldContentPresent && Node::diff(child->style(), pseudoElementStyle) == Node::Detach)) {
+    if (oldContentPresent && (!newContentWanted || Node::diff(child->style(), pseudoElementStyle) == Node::Detach)) {
         // Nuke the child. 
-        if (child && child->style()->styleType() == type) {
+        if (child->style()->styleType() == type) {
             oldContentPresent = false;
             child->destroy();
             child = (type == BEFORE) ? owner->virtualChildren()->firstChild() : owner->virtualChildren()->lastChild();
diff --git a/WebCore/rendering/RenderPart.cpp b/WebCore/rendering/RenderPart.cpp
index 5c4a6ec..3262961 100644
--- a/WebCore/rendering/RenderPart.cpp
+++ b/WebCore/rendering/RenderPart.cpp
@@ -24,16 +24,16 @@
 #include "config.h"
 #include "RenderPart.h"
 
+#include "RenderView.h"
 #include "Frame.h"
 #include "FrameView.h"
+#include "HTMLFrameElementBase.h"
 
 namespace WebCore {
 
 RenderPart::RenderPart(Element* node)
     : RenderWidget(node)
-    , m_hasFallbackContent(false)
 {
-    // init RenderObject attributes
     setInline(false);
 }
 
diff --git a/WebCore/rendering/RenderPart.h b/WebCore/rendering/RenderPart.h
index 8303543..18f2346 100644
--- a/WebCore/rendering/RenderPart.h
+++ b/WebCore/rendering/RenderPart.h
@@ -27,23 +27,15 @@
 
 namespace WebCore {
 
-// Renderer for frames via RenderPartObject, and plug-ins via RenderEmbeddedObject.
-
-// FIXME: This class is subclassed in RenderPartObject for iframes, which is in turn
-// subclassed in RenderEmbeddedObject for object and embed. This class itself could be removed.
+// Renderer for frames via RenderFrameBase, and plug-ins via RenderEmbeddedObject.
 class RenderPart : public RenderWidget {
 public:
     RenderPart(Element*);
     virtual ~RenderPart();
-    
-    bool hasFallbackContent() const { return m_hasFallbackContent; }
 
     virtual void setWidget(PassRefPtr<Widget>);
     virtual void viewCleared();
 
-protected:
-    bool m_hasFallbackContent;
-
 private:
     virtual bool isRenderPart() const { return true; }
     virtual const char* renderName() const { return "RenderPart"; }
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index bcedd38..b1e2a8f 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -31,10 +31,11 @@
 #include "GraphicsContext.h"
 #include "PointerEventsHitRules.h"
 #include "RenderSVGContainer.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderSVGResourceMarker.h"
 #include "StrokeStyleApplier.h"
 #include "SVGPaintServer.h"
 #include "SVGRenderSupport.h"
-#include "SVGResourceMarker.h"
 #include "SVGStyledTransformableElement.h"
 #include "SVGTransformList.h"
 #include "SVGURIReference.h"
@@ -64,19 +65,12 @@
 
 RenderPath::RenderPath(SVGStyledTransformableElement* node)
     : RenderSVGModelObject(node)
+    , m_needsBoundariesUpdate(false) // default is false, as this is only used when a RenderSVGResource tells us that the boundaries need to be recached
+    , m_needsPathUpdate(true) // default is true, so we grab a Path object once from SVGStyledTransformableElement
+    , m_needsTransformUpdate(true) // default is true, so we grab a AffineTransform object once from SVGStyledTransformableElement
 {
 }
 
-const AffineTransform& RenderPath::localToParentTransform() const
-{
-    return m_localTransform;
-}
-
-AffineTransform RenderPath::localTransform() const
-{
-    return m_localTransform;
-}
-
 bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill) const
 {
     if (m_path.isEmpty())
@@ -171,22 +165,34 @@
     return m_cachedLocalRepaintRect;
 }
 
-void RenderPath::setPath(const Path& newPath)
-{
-    m_path = newPath;
-    m_cachedLocalRepaintRect = FloatRect();
-    m_cachedLocalStrokeBBox = FloatRect();
-    m_cachedLocalFillBBox = FloatRect();
-    m_cachedLocalMarkerBBox = FloatRect();
-}
-
 void RenderPath::layout()
 {
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
-
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
-    m_localTransform = element->animatedLocalTransform();
-    setPath(element->toPathData());
+
+    // We need to update the Path object whenever the underlying SVGStyledTransformableElement uses relative values
+    // as the viewport size may have changed. It would be nice to optimize this to detect these changes, and only
+    // update when needed, even when using relative values.
+    if (!m_needsPathUpdate && element->hasRelativeValues())
+        m_needsPathUpdate = true;
+
+    bool needsUpdate = m_needsPathUpdate || m_needsTransformUpdate || m_needsBoundariesUpdate;
+
+    if (m_needsBoundariesUpdate)
+        m_needsBoundariesUpdate = false;
+
+    if (m_needsPathUpdate) {
+        m_path = element->toPathData();
+        m_needsPathUpdate = false;
+    }
+
+    if (m_needsTransformUpdate) {
+        m_localTransform = element->animatedLocalTransform();
+        m_needsTransformUpdate = false;
+    }
+
+    if (needsUpdate)
+        invalidateCachedBoundaries();
 
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
@@ -223,29 +229,32 @@
         return;
 
     PaintInfo childPaintInfo(paintInfo);
-    childPaintInfo.context->save();
-    applyTransformToPaintInfo(childPaintInfo, m_localTransform);
-    SVGResourceFilter* filter = 0;
+    bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
+    if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
+        childPaintInfo.context->save();
+        applyTransformToPaintInfo(childPaintInfo, m_localTransform);
+        RenderSVGResourceFilter* filter = 0;
 
-    if (childPaintInfo.phase == PaintPhaseForeground) {
-        PaintInfo savedInfo(childPaintInfo);
+        if (childPaintInfo.phase == PaintPhaseForeground) {
+            PaintInfo savedInfo(childPaintInfo);
 
-        if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) {
-            if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
-                childPaintInfo.context->setShouldAntialias(false);
-            fillAndStrokePath(m_path, childPaintInfo.context, style(), this);
+            if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) {
+                if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
+                    childPaintInfo.context->setShouldAntialias(false);
+                fillAndStrokePath(m_path, childPaintInfo.context, style(), this);
 
-            if (static_cast<SVGStyledElement*>(node())->supportsMarkers())
-                m_markerLayoutInfo.drawMarkers(childPaintInfo);
+                if (static_cast<SVGStyledElement*>(node())->supportsMarkers())
+                    m_markerLayoutInfo.drawMarkers(childPaintInfo);
+            }
+            finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context);
         }
-        finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context);
-    }
 
-    if ((childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
-        paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
-            static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style());
-    
-    childPaintInfo.context->restore();
+        if (drawsOutline)
+            paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
+                static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()));
+        
+        childPaintInfo.context->restore();
+    }
 }
 
 // This method is called from inside paintOutline() since we call paintOutline()
@@ -293,28 +302,28 @@
         return;
 
     const SVGRenderStyle* svgStyle = style()->svgStyle();
-    AtomicString startMarkerId(svgStyle->startMarker());
-    AtomicString midMarkerId(svgStyle->midMarker());
-    AtomicString endMarkerId(svgStyle->endMarker());
+    AtomicString startMarkerId(svgStyle->markerStartResource());
+    AtomicString midMarkerId(svgStyle->markerMidResource());
+    AtomicString endMarkerId(svgStyle->markerEndResource());
 
-    SVGResourceMarker* startMarker = getMarkerById(doc, startMarkerId, this);
-    SVGResourceMarker* midMarker = getMarkerById(doc, midMarkerId, this);
-    SVGResourceMarker* endMarker = getMarkerById(doc, endMarkerId, this);
+    RenderSVGResourceMarker* startMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, startMarkerId);
+    RenderSVGResourceMarker* midMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, midMarkerId);
+    RenderSVGResourceMarker* endMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(doc, endMarkerId);
 
     if (!startMarker && !startMarkerId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(startMarkerId, styledElement);
     else if (startMarker)
-        startMarker->addClient(styledElement);
+        startMarker->addClient(this);
 
     if (!midMarker && !midMarkerId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(midMarkerId, styledElement);
     else if (midMarker)
-        midMarker->addClient(styledElement);
+        midMarker->addClient(this);
 
     if (!endMarker && !endMarkerId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(endMarkerId, styledElement);
     else if (endMarker)
-        endMarker->addClient(styledElement);
+        endMarker->addClient(this);
 
     if (!startMarker && !midMarker && !endMarker)
         return;
@@ -323,6 +332,20 @@
     m_cachedLocalMarkerBBox = m_markerLayoutInfo.calculateBoundaries(startMarker, midMarker, endMarker, strokeWidth, m_path);
 }
 
+void RenderPath::invalidateCachedBoundaries()
+{
+    m_cachedLocalRepaintRect = FloatRect();
+    m_cachedLocalStrokeBBox = FloatRect();
+    m_cachedLocalFillBBox = FloatRect();
+    m_cachedLocalMarkerBBox = FloatRect();
+}
+
+void RenderPath::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+{
+    invalidateCachedBoundaries();
+    RenderSVGModelObject::styleWillChange(diff, newStyle);
+}
+
 }
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderPath.h b/WebCore/rendering/RenderPath.h
index d530f3c..ea4de40 100644
--- a/WebCore/rendering/RenderPath.h
+++ b/WebCore/rendering/RenderPath.h
@@ -41,6 +41,9 @@
     RenderPath(SVGStyledTransformableElement*);
 
     const Path& path() const { return m_path; }
+    void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
+    void setNeedsPathUpdate() { m_needsPathUpdate = true; }
+    virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
 private:
     // Hit-detection seperated for the fill and the stroke
@@ -52,9 +55,7 @@
     virtual FloatRect markerBoundingBox() const;
     virtual FloatRect repaintRectInLocalCoordinates() const;
 
-    virtual const AffineTransform& localToParentTransform() const;
-
-    void setPath(const Path&);
+    virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
 
     virtual bool isRenderPath() const { return true; }
     virtual const char* renderName() const { return "RenderPath"; }
@@ -64,11 +65,17 @@
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
+    virtual void styleWillChange(StyleDifference, const RenderStyle*);
 
     void calculateMarkerBoundsIfNeeded() const;
+    void invalidateCachedBoundaries();
 
 private:
-    virtual AffineTransform localTransform() const;
+    virtual AffineTransform localTransform() const { return m_localTransform; }
+
+    bool m_needsBoundariesUpdate : 1;
+    bool m_needsPathUpdate : 1;
+    bool m_needsTransformUpdate : 1;
 
     mutable Path m_path;
     mutable FloatRect m_cachedLocalFillBBox;
diff --git a/WebCore/rendering/RenderProgress.cpp b/WebCore/rendering/RenderProgress.cpp
new file mode 100644
index 0000000..a9dbfe8
--- /dev/null
+++ b/WebCore/rendering/RenderProgress.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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"
+#if ENABLE(PROGRESS_TAG)
+
+#include "RenderProgress.h"
+
+#include "HTMLProgressElement.h"
+#include "RenderTheme.h"
+#include <wtf/CurrentTime.h>
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+RenderProgress::RenderProgress(HTMLProgressElement* element)
+    : RenderBlock(element)
+    , m_position(-1)
+    , m_animationStartTime(0)
+    , m_animationRepeatInterval(0)
+    , m_animationDuration(0)
+    , m_animating(false)
+    , m_animationTimer(this, &RenderProgress::animationTimerFired)
+{
+}
+
+void RenderProgress::layout()
+{
+    ASSERT(needsLayout());
+
+    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+
+    calcWidth();
+    calcHeight();
+
+    m_overflow.clear();
+
+    updateAnimationState();
+
+    repainter.repaintAfterLayout();
+
+    setNeedsLayout(false);
+}
+
+void RenderProgress::updateFromElement()
+{
+    HTMLProgressElement* element = progressElement();
+    if (m_position == element->position())
+        return;
+    m_position = element->position();
+
+    updateAnimationState();
+
+    repaint();
+}
+
+double RenderProgress::animationProgress()
+{
+    return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animationDuration) / m_animationDuration) : 0;
+}
+
+void RenderProgress::animationTimerFired(Timer<RenderProgress>*)
+{
+    repaint();
+}
+
+void RenderProgress::paint(PaintInfo& paintInfo, int tx, int ty)
+{
+    if (paintInfo.phase == PaintPhaseBlockBackground) {
+        if (!m_animationTimer.isActive() && m_animating)
+            m_animationTimer.startOneShot(m_animationRepeatInterval);
+    }
+
+    RenderBlock::paint(paintInfo, tx, ty);
+}
+
+void RenderProgress::updateAnimationState()
+{
+    m_animationDuration = theme()->animationDurationForProgressBar(this);
+    m_animationRepeatInterval = theme()->animationRepeatIntervalForProgressBar(this);
+
+    bool animating = m_animationDuration > 0;
+    if (animating == m_animating)
+        return;
+
+    m_animating = animating;
+    if (m_animating) {
+        m_animationStartTime = currentTime();
+        m_animationTimer.startOneShot(m_animationRepeatInterval);
+    } else
+        m_animationTimer.stop();
+}
+
+HTMLProgressElement* RenderProgress::progressElement() const
+{
+    return static_cast<HTMLProgressElement*>(node());
+}    
+
+} // namespace WebCore
+#endif
diff --git a/WebCore/rendering/RenderProgress.h b/WebCore/rendering/RenderProgress.h
new file mode 100644
index 0000000..d6f5078
--- /dev/null
+++ b/WebCore/rendering/RenderProgress.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 RenderProgress_h
+#define RenderProgress_h
+
+#if ENABLE(PROGRESS_TAG)
+#include "RenderBlock.h"
+
+namespace WebCore {
+
+class HTMLProgressElement;
+
+class RenderProgress : public RenderBlock {
+public:
+    RenderProgress(HTMLProgressElement*);
+    double position() { return m_position; }
+    double animationProgress();
+    
+    HTMLProgressElement* progressElement() const;
+
+private:
+    virtual const char* renderName() const { return "RenderProgress"; }
+    virtual bool isProgress() const { return true; }
+    virtual void layout();
+    virtual void updateFromElement();
+    virtual void paint(PaintInfo&, int tx, int ty);
+
+    void animationTimerFired(Timer<RenderProgress>*);
+    void updateAnimationState();
+
+    double m_position;
+    double m_animationStartTime;
+    double m_animationRepeatInterval;
+    double m_animationDuration;
+    bool m_animating;
+    Timer<RenderProgress> m_animationTimer;
+};
+
+inline RenderProgress* toRenderProgress(RenderObject* object)
+{
+    ASSERT(!object || object->isProgress());
+    return static_cast<RenderProgress*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderProgress(const RenderProgress*);
+
+} // namespace WebCore
+
+#endif
+
+#endif // RenderProgress_h
+
diff --git a/WebCore/rendering/RenderReplaced.cpp b/WebCore/rendering/RenderReplaced.cpp
index ba579df..0ba99f5 100644
--- a/WebCore/rendering/RenderReplaced.cpp
+++ b/WebCore/rendering/RenderReplaced.cpp
@@ -109,7 +109,7 @@
     }
 
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
-        paintOutline(paintInfo.context, tx, ty, width(), height(), style());
+        paintOutline(paintInfo.context, tx, ty, width(), height());
     
     if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
         return;
diff --git a/WebCore/rendering/RenderReplaced.h b/WebCore/rendering/RenderReplaced.h
index bcf565d..b5c6179 100644
--- a/WebCore/rendering/RenderReplaced.h
+++ b/WebCore/rendering/RenderReplaced.h
@@ -48,7 +48,6 @@
 
     virtual void paint(PaintInfo&, int tx, int ty);
     bool shouldPaint(PaintInfo&, int& tx, int& ty);
-    void adjustOverflowForBoxShadowAndReflect();
     IntRect localSelectionRect(bool checkWhetherSelected = true) const;
 
 private:
diff --git a/WebCore/rendering/RenderSVGContainer.cpp b/WebCore/rendering/RenderSVGContainer.cpp
index 6d1b965..56846a9 100644
--- a/WebCore/rendering/RenderSVGContainer.cpp
+++ b/WebCore/rendering/RenderSVGContainer.cpp
@@ -27,9 +27,9 @@
 #include "RenderSVGContainer.h"
 
 #include "GraphicsContext.h"
+#include "RenderSVGResourceFilter.h"
 #include "RenderView.h"
 #include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
 #include "SVGStyledElement.h"
 
 namespace WebCore {
@@ -70,7 +70,7 @@
 {
 #if ENABLE(FILTERS)
     const SVGRenderStyle* svgStyle = style()->svgStyle();
-    SVGResourceFilter* filter = getFilterById(document(), svgStyle->filter(), this);
+    RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document(), svgStyle->filterResource());
     if (filter)
         return true;
 #endif
@@ -95,7 +95,7 @@
 
     applyTransformToPaintInfo(childPaintInfo, localToParentTransform());
 
-    SVGResourceFilter* filter = 0;
+    RenderSVGResourceFilter* filter = 0;
     FloatRect boundingBox = repaintRectInLocalCoordinates();
 
     bool continueRendering = true;
@@ -120,7 +120,7 @@
     // We should instead disable our clip during PaintPhaseOutline
     IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.context, paintRectInParent.x(), paintRectInParent.y(), paintRectInParent.width(), paintRectInParent.height(), style());
+        paintOutline(paintInfo.context, paintRectInParent.x(), paintRectInParent.y(), paintRectInParent.width(), paintRectInParent.height());
 }
 
 // addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index 6fb9501..1fb7c0f 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -42,6 +42,7 @@
 
 RenderSVGImage::RenderSVGImage(SVGImageElement* impl)
     : RenderImage(impl)
+    , m_needsTransformUpdate(true)
 {
 }
 
@@ -50,10 +51,13 @@
     ASSERT(needsLayout());
 
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
-
     SVGImageElement* image = static_cast<SVGImageElement*>(node());
-    m_localTransform = image->animatedLocalTransform();
-    
+
+    if (m_needsTransformUpdate) {
+        m_localTransform = image->animatedLocalTransform();
+        m_needsTransformUpdate = false;
+    }
+
     // minimum height
     setHeight(errorOccurred() ? intrinsicSize().height() : 0);
 
@@ -77,7 +81,7 @@
     paintInfo.context->concatCTM(localToParentTransform());
 
     if (paintInfo.phase == PaintPhaseForeground) {
-        SVGResourceFilter* filter = 0;
+        RenderSVGResourceFilter* filter = 0;
 
         PaintInfo savedInfo(paintInfo);
 
@@ -95,14 +99,14 @@
     }
 
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
-        paintOutline(paintInfo.context, 0, 0, width(), height(), style());
+        paintOutline(paintInfo.context, 0, 0, width(), height());
 
     paintInfo.context->restore();
 }
 
 void RenderSVGImage::destroy()
 {
-    SVGRenderBase::deregisterFromResources(this);
+    deregisterFromResources(this);
     RenderImage::destroy();
 }
 
diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h
index f48b9dd..120ac72 100644
--- a/WebCore/rendering/RenderSVGImage.h
+++ b/WebCore/rendering/RenderSVGImage.h
@@ -38,6 +38,8 @@
 public:
     RenderSVGImage(SVGImageElement*);
 
+    virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
+
 private:
     virtual const SVGRenderBase* toSVGRenderBase() const { return this; }
     virtual const char* renderName() const { return "RenderSVGImage"; }
@@ -72,6 +74,7 @@
 
     virtual AffineTransform localTransform() const { return m_localTransform; }
 
+    bool m_needsTransformUpdate : 1;
     AffineTransform m_localTransform;
     FloatRect m_localBounds;
     mutable FloatRect m_cachedLocalRepaintRect;
diff --git a/WebCore/rendering/RenderSVGInline.cpp b/WebCore/rendering/RenderSVGInline.cpp
index cf97b52..33459ce 100644
--- a/WebCore/rendering/RenderSVGInline.cpp
+++ b/WebCore/rendering/RenderSVGInline.cpp
@@ -48,9 +48,9 @@
 
 void RenderSVGInline::absoluteRects(Vector<IntRect>& rects, int, int)
 {
-    InlineRunBox* firstBox = firstLineBox();
+    InlineFlowBox* firstBox = firstLineBox();
 
-    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
+    RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
     RenderBox* object = rootBox ? rootBox->block() : 0;
 
     if (!object)
@@ -59,17 +59,45 @@
     int xRef = object->x();
     int yRef = object->y();
 
-    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
+    for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
         FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
         rects.append(enclosingIntRect(localToAbsoluteQuad(rect).boundingBox()));
     }
 }
 
+FloatRect RenderSVGInline::objectBoundingBox() const
+{
+    if (const RenderObject* object = findTextRootObject(this))
+        return object->objectBoundingBox();
+
+    return FloatRect();
+}
+
+FloatRect RenderSVGInline::strokeBoundingBox() const
+{
+    const RenderObject* object = findTextRootObject(this);
+    ASSERT(object);
+
+    const SVGRenderBase* renderer = object->toSVGRenderBase();
+    if (!renderer)
+        return FloatRect();
+
+    return renderer->strokeBoundingBox();
+}
+
+FloatRect RenderSVGInline::repaintRectInLocalCoordinates() const
+{
+    if (const RenderObject* object = findTextRootObject(this))
+        return object->repaintRectInLocalCoordinates();
+
+    return FloatRect();
+}
+
 void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
 {
-    InlineRunBox* firstBox = firstLineBox();
+    InlineFlowBox* firstBox = firstLineBox();
 
-    SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
+    RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
     RenderBox* object = rootBox ? rootBox->block() : 0;
 
     if (!object)
@@ -78,7 +106,7 @@
     int xRef = object->x();
     int yRef = object->y();
 
-    for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
+    for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
         FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
         quads.append(localToAbsoluteQuad(rect));
     }
diff --git a/WebCore/rendering/RenderSVGInline.h b/WebCore/rendering/RenderSVGInline.h
index 53fd4b7..e57b936 100644
--- a/WebCore/rendering/RenderSVGInline.h
+++ b/WebCore/rendering/RenderSVGInline.h
@@ -31,9 +31,12 @@
 
 namespace WebCore {
 
-class RenderSVGInline : public RenderInline {
+class RenderSVGInline : public RenderInline, protected SVGRenderBase {
 public:
     RenderSVGInline(Node*);
+
+    virtual const SVGRenderBase* toSVGRenderBase() const { return this; }
+
     virtual const char* renderName() const { return "RenderSVGInline"; }
     virtual bool requiresLayer() const { return false; }
 
@@ -41,8 +44,14 @@
     virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
     virtual void absoluteQuads(Vector<FloatQuad>&);
 
-    virtual FloatRect objectBoundingBox() const { return FloatRect(); }
-    virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); }
+    // Chapter 10.4 of the SVG Specification say that we should use the
+    // object bounding box of the parent text element.
+    // We search for the root text element and take it's bounding box.
+    // It is also necessary to take the stroke and repaint rect of
+    // this element, since we need it for filters.
+    virtual FloatRect objectBoundingBox() const;
+    virtual FloatRect strokeBoundingBox() const;
+    virtual FloatRect repaintRectInLocalCoordinates() const;
     
 private:
     virtual InlineFlowBox* createInlineFlowBox();
diff --git a/WebCore/rendering/RenderSVGModelObject.cpp b/WebCore/rendering/RenderSVGModelObject.cpp
index c163dc6..837b36a 100644
--- a/WebCore/rendering/RenderSVGModelObject.cpp
+++ b/WebCore/rendering/RenderSVGModelObject.cpp
@@ -63,7 +63,7 @@
 // Copied from RenderBox, this method likely requires further refactoring to work easily for both SVG and CSS Box Model content.
 // FIXME: This may also need to move into SVGRenderBase as the RenderBox version depends
 // on borderBoundingBox() which SVG RenderBox subclases (like SVGRenderBlock) do not implement.
-IntRect RenderSVGModelObject::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer) const
+IntRect RenderSVGModelObject::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const
 {
     IntRect box = enclosingIntRect(repaintRectInLocalCoordinates());
     adjustRectForOutlineAndShadow(box);
diff --git a/WebCore/rendering/RenderSVGModelObject.h b/WebCore/rendering/RenderSVGModelObject.h
index c04c590..760e79a 100644
--- a/WebCore/rendering/RenderSVGModelObject.h
+++ b/WebCore/rendering/RenderSVGModelObject.h
@@ -55,7 +55,7 @@
 
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
-    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer) const;
+    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const;
 
     virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
     virtual void absoluteQuads(Vector<FloatQuad>&);
diff --git a/WebCore/rendering/RenderSVGResource.h b/WebCore/rendering/RenderSVGResource.h
index 38c6c09..1665404 100644
--- a/WebCore/rendering/RenderSVGResource.h
+++ b/WebCore/rendering/RenderSVGResource.h
@@ -28,12 +28,58 @@
 namespace WebCore {
 
 enum RenderSVGResourceType {
-    MaskerResourceType
+    MaskerResourceType,
+    MarkerResourceType,
+    FilterResourceType,
+    ClipperResourceType
 };
 
 class RenderSVGResource : public RenderSVGHiddenContainer {
 public:
-    RenderSVGResource(SVGStyledElement* node) : RenderSVGHiddenContainer(node) { }
+    RenderSVGResource(SVGStyledElement* node)
+        : RenderSVGHiddenContainer(node)
+        , m_id(node->getIDAttribute())
+    {
+        ASSERT(node->document());
+        node->document()->accessSVGExtensions()->addResource(m_id, this);
+    }
+
+    virtual ~RenderSVGResource()
+    {
+        ASSERT(node());
+        ASSERT(node()->document());
+        node()->document()->accessSVGExtensions()->removeResource(m_id);
+    }
+
+    void idChanged()
+    {
+        ASSERT(node());
+        ASSERT(node()->document());
+        SVGDocumentExtensions* extensions = node()->document()->accessSVGExtensions();
+
+        // Remove old id, that is guaranteed to be present in cache
+        extensions->removeResource(m_id);
+
+        m_id = static_cast<Element*>(node())->getIDAttribute();
+
+        // It's possible that an element is referencing us with the new id, and has to be notified that we're existing now
+        if (extensions->isPendingResource(m_id)) {
+            OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(m_id));
+            if (clients->isEmpty())
+                return;
+
+            HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
+            const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
+
+            for (; it != end; ++it) {
+                if (RenderObject* renderer = (*it)->renderer())
+                    renderer->setNeedsLayout(true);
+            }
+        }
+
+        // Recache us with the new id
+        extensions->addResource(m_id, this);
+    }
 
     template<class Renderer>
     Renderer* cast()
@@ -51,10 +97,14 @@
     virtual void invalidateClients() = 0;
     virtual void invalidateClient(RenderObject*) = 0;
 
-    virtual bool applyResource(RenderObject*, GraphicsContext*) = 0;
+    virtual bool applyResource(RenderObject*, GraphicsContext*&) = 0;
+    virtual void postApplyResource(RenderObject*, GraphicsContext*&) { }
     virtual FloatRect resourceBoundingBox(const FloatRect&) const = 0;
 
     virtual RenderSVGResourceType resourceType() const = 0;
+
+private:
+    AtomicString m_id;
 };
 
 template<typename Renderer>
@@ -63,19 +113,10 @@
     if (id.isEmpty())
         return 0;
 
-    Element* element = document->getElementById(id);
-    if (!element || !element->isSVGElement())
-        return 0;
+    if (RenderSVGResource* renderResource = document->accessSVGExtensions()->resourceById(id))
+        return renderResource->cast<Renderer>();
 
-    RenderObject* renderer = element->renderer();
-    if (!renderer)
-        return 0;
-
-    RenderSVGResource* renderResource = renderer->toRenderSVGResource();
-    if (!renderResource)
-        return 0;
-
-    return renderResource->cast<Renderer>();
+    return 0;
 }
 
 }
diff --git a/WebCore/rendering/RenderSVGResourceClipper.cpp b/WebCore/rendering/RenderSVGResourceClipper.cpp
new file mode 100644
index 0000000..ccb7397
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceClipper.cpp
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ *               2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 "RenderSVGResourceClipper.h"
+
+#include "AffineTransform.h"
+#include "FloatRect.h"
+#include "GraphicsContext.h"
+#include "ImageBuffer.h"
+#include "IntRect.h"
+#include "RenderObject.h"
+#include "RenderStyle.h"
+#include "RenderSVGResource.h"
+#include "SVGClipPathElement.h"
+#include "SVGElement.h"
+#include "SVGRenderSupport.h"
+#include "SVGStyledElement.h"
+#include "SVGStyledTransformableElement.h"
+#include "SVGUnitTypes.h"
+#include "SVGUseElement.h"
+
+namespace WebCore {
+
+RenderSVGResourceType RenderSVGResourceClipper::s_resourceType = ClipperResourceType;
+
+RenderSVGResourceClipper::RenderSVGResourceClipper(SVGStyledElement* node)
+    : RenderSVGResource(node)
+{
+}
+
+RenderSVGResourceClipper::~RenderSVGResourceClipper()
+{
+    deleteAllValues(m_clipper);
+    m_clipper.clear();
+}
+
+void RenderSVGResourceClipper::invalidateClients()
+{
+    HashMap<RenderObject*, ClipperData*>::const_iterator end = m_clipper.end();
+    for (HashMap<RenderObject*, ClipperData*>::const_iterator it = m_clipper.begin(); it != end; ++it) {
+        RenderObject* renderer = it->first;
+        renderer->setNeedsBoundariesUpdate();
+        renderer->setNeedsLayout(true);
+    }
+    deleteAllValues(m_clipper);
+    m_clipper.clear();
+}
+
+void RenderSVGResourceClipper::invalidateClient(RenderObject* object)
+{
+    ASSERT(object);
+
+    // FIXME: The HashSet should always contain the object on calling invalidateClient. A race condition
+    // during the parsing can causes a call of invalidateClient right before the call of applyResource.
+    // We return earlier for the moment. This bug should be fixed in:
+    // https://bugs.webkit.org/show_bug.cgi?id=35181
+    if (!m_clipper.contains(object))
+        return;
+
+    delete m_clipper.take(object);
+}
+
+bool RenderSVGResourceClipper::applyResource(RenderObject* object, GraphicsContext*& context)
+{
+    applyClippingToContext(object, object->objectBoundingBox(), object->repaintRectInLocalCoordinates(), context);
+    return true;
+}
+
+bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext* context, const FloatRect& objectBoundingBox)
+{
+    // If the current clip-path gets clipped itself, we have to fallback to masking.
+    if (!style()->svgStyle()->clipperResource().isEmpty())
+        return false;
+    WindRule clipRule = RULE_NONZERO;
+    Path clipPath = Path();
+
+    // If clip-path only contains one visible shape or path, we can use path-based clipping. Invisible
+    // shapes don't affect the clipping and can be ignored. If clip-path contains more than one
+    // visible shape, the additive clipping may not work, caused by the clipRule. EvenOdd
+    // as well as NonZero can cause self-clipping of the elements.
+    // See also http://www.w3.org/TR/SVG/painting.html#FillRuleProperty
+    for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) {
+        RenderObject* renderer = childNode->renderer();
+        if (!renderer)
+            continue;
+        // Only shapes or paths are supported for direct clipping. We need to fallback to masking for texts.
+        if (renderer->isSVGText())
+            return false;
+        if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyledTransformable())
+            continue;
+        SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(childNode);
+        RenderStyle* style = renderer->style();
+        if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+             continue;
+        const SVGRenderStyle* svgStyle = style->svgStyle();
+        // Current shape in clip-path gets clipped too. Fallback to masking.
+        if (!svgStyle->clipperResource().isEmpty())
+            return false;
+        // Fallback to masking, if there is more than one clipping path.
+        if (clipPath.isEmpty()) {
+            clipPath = styled->toClipPath();
+            clipRule = svgStyle->clipRule();
+        } else
+            return false;
+    }
+    // Only one visible shape/path was found. Directly continue clipping and transform the content to userspace if necessary.
+    if (static_cast<SVGClipPathElement*>(node())->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
+        AffineTransform transform;
+        transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
+        transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
+        clipPath.transform(transform);
+    }
+    // The SVG specification wants us to clip everything, if clip-path doesn't have a child.
+    if (clipPath.isEmpty())
+        clipPath.addRect(FloatRect());
+    context->beginPath();
+    context->addPath(clipPath);
+    context->clipPath(clipRule);
+    return true;
+}
+
+bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* object, const FloatRect& objectBoundingBox,
+                                                      const FloatRect& repaintRect, GraphicsContext* context)
+{
+    ASSERT(object);
+    ASSERT(context);
+
+    if (!m_clipper.contains(object))
+        m_clipper.set(object, new ClipperData);
+
+    ClipperData* clipperData = m_clipper.get(object);
+    if (!clipperData->clipMaskImage) {
+        if (pathOnlyClipping(context, objectBoundingBox))
+            return true;
+        createClipData(clipperData, objectBoundingBox, repaintRect);
+    }
+
+    if (!clipperData->clipMaskImage)
+        return false;
+
+    context->clipToImageBuffer(repaintRect, clipperData->clipMaskImage.get());
+    return true;
+}
+
+bool RenderSVGResourceClipper::createClipData(ClipperData* clipperData, const FloatRect& objectBoundingBox, const FloatRect& repaintRect)
+{
+    IntRect clipMaskRect = enclosingIntRect(repaintRect);
+    clipperData->clipMaskImage = ImageBuffer::create(clipMaskRect.size());
+    if (!clipperData->clipMaskImage)
+        return false;
+
+    GraphicsContext* maskContext = clipperData->clipMaskImage->context();
+    ASSERT(maskContext);
+
+    maskContext->save();
+    maskContext->translate(-repaintRect.x(), -repaintRect.y());
+
+    // clipPath can also be clipped by another clipPath.
+    bool clipperGetsClipped = false;
+    if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(this->document(), style()->svgStyle()->clipperResource())) {
+        clipperGetsClipped = true;
+        if (!clipper->applyClippingToContext(this, objectBoundingBox, repaintRect, maskContext)) {
+            maskContext->restore();
+            return false;
+        }            
+    }
+
+    SVGClipPathElement* clipPath = static_cast<SVGClipPathElement*>(node());
+    if (clipPath->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
+        maskContext->translate(objectBoundingBox.x(), objectBoundingBox.y());
+        maskContext->scale(objectBoundingBox.size());
+    }
+
+    // Draw all clipPath children into a global mask.
+    for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) {
+        RenderObject* renderer = childNode->renderer();
+        if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer)
+            continue;
+        RenderStyle* style = renderer->style();
+        if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+            continue;
+
+        WindRule newClipRule = style->svgStyle()->clipRule();
+        bool isUseElement = renderer->isSVGShadowTreeRootContainer();
+        if (isUseElement) {
+            SVGUseElement* useElement = static_cast<SVGUseElement*>(childNode);
+            renderer = useElement->rendererClipChild();
+            if (!renderer)
+                continue;
+            if (!useElement->hasAttribute(SVGNames::clip_ruleAttr))
+                newClipRule = renderer->style()->svgStyle()->clipRule();
+        }
+
+        // Only shapes, paths and texts are allowed for clipping.
+        if (!renderer->isRenderPath() && !renderer->isSVGText())
+            continue;
+
+        // Save the old RenderStyle of the current object for restoring after drawing
+        // it to the MaskImage. The new intermediate RenderStyle needs to inherit from
+        // the old one.
+        RefPtr<RenderStyle> oldRenderStyle = renderer->style();
+        RefPtr<RenderStyle> newRenderStyle = RenderStyle::clone(oldRenderStyle.get());
+        SVGRenderStyle* svgStyle = newRenderStyle.get()->accessSVGStyle();
+        svgStyle->setFillPaint(SVGPaint::defaultFill());
+        svgStyle->setStrokePaint(SVGPaint::defaultStroke());
+        svgStyle->setFillRule(newClipRule);
+        newRenderStyle.get()->setOpacity(1.0f);
+        svgStyle->setFillOpacity(1.0f);
+        svgStyle->setStrokeOpacity(1.0f);
+        svgStyle->setFilterResource(String());
+        svgStyle->setMaskerResource(String());
+        renderer->setStyle(newRenderStyle.release());
+
+        // Get the renderer of the element, that is referenced by the <use>-element.
+        if (isUseElement)
+            renderer = childNode->renderer();
+
+        renderSubtreeToImage(clipperData->clipMaskImage.get(), renderer);
+
+        renderer->setStyle(oldRenderStyle.release());
+    }
+
+    maskContext->restore();
+
+    return true;
+}
+
+FloatRect RenderSVGResourceClipper::resourceBoundingBox(const FloatRect& objectBoundingBox) const
+{
+    // This is a rough heuristic to appraise the clip size and doesn't consider clip on clip.
+    FloatRect clipRect;
+    for (Node* childNode = node()->firstChild(); childNode; childNode = childNode->nextSibling()) {
+        RenderObject* renderer = childNode->renderer();
+        if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer)
+            continue;
+        if (!renderer->isRenderPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer())
+            continue;
+        clipRect.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates()));
+    }
+
+    if (static_cast<SVGClipPathElement*>(node())->clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
+        AffineTransform transform;
+        transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
+        transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
+        return transform.mapRect(clipRect);
+    }
+
+    return clipRect;
+}
+
+}
diff --git a/WebCore/rendering/RenderSVGResourceClipper.h b/WebCore/rendering/RenderSVGResourceClipper.h
new file mode 100644
index 0000000..8de17d4
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceClipper.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 RenderSVGResourceClipper_h
+#define RenderSVGResourceClipper_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "GraphicsContext.h"
+#include "ImageBuffer.h"
+#include "IntSize.h"
+#include "Path.h"
+#include "RenderSVGResource.h"
+#include "SVGClipPathElement.h"
+#include "SVGUnitTypes.h"
+
+#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+struct ClipperData {
+    OwnPtr<ImageBuffer> clipMaskImage;
+};
+
+class RenderSVGResourceClipper : public RenderSVGResource {
+
+public:
+    RenderSVGResourceClipper(SVGStyledElement*);
+    virtual ~RenderSVGResourceClipper();
+
+    virtual const char* renderName() const { return "RenderSVGResourceClipper"; }
+
+    virtual void invalidateClients();
+    virtual void invalidateClient(RenderObject*);
+
+    virtual bool applyResource(RenderObject*, GraphicsContext*&);
+    virtual FloatRect resourceBoundingBox(const FloatRect&) const;
+
+    virtual RenderSVGResourceType resourceType() const { return ClipperResourceType; }
+
+    SVGUnitTypes::SVGUnitType clipPathUnits() const { return toUnitType(static_cast<SVGClipPathElement*>(node())->clipPathUnits()); }
+
+    static RenderSVGResourceType s_resourceType;
+private:
+    // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call
+    // applyResource directly and use the rects from the object, since they are empty for RenderSVGResources
+    bool applyClippingToContext(RenderObject*, const FloatRect&, const FloatRect&, GraphicsContext*);
+    bool pathOnlyClipping(GraphicsContext*, const FloatRect&);
+    bool createClipData(ClipperData*, const FloatRect&, const FloatRect&);
+
+    HashMap<RenderObject*, ClipperData*> m_clipper;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
new file mode 100644
index 0000000..cbedfe3
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ *               2004, 2005 Rob Buis <buis@kde.org>
+ *               2005 Eric Seidel <eric@webkit.org>
+ *               2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * 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"
+
+#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "RenderSVGResourceFilter.h"
+
+#include "AffineTransform.h"
+#include "FloatPoint.h"
+#include "FloatRect.h"
+#include "GraphicsContext.h"
+#include "Image.h"
+#include "ImageBuffer.h"
+#include "ImageData.h"
+#include "IntRect.h"
+#include "RenderSVGResource.h"
+#include "SVGElement.h"
+#include "SVGFilter.h"
+#include "SVGFilterElement.h"
+#include "SVGFilterPrimitiveStandardAttributes.h"
+#include "SVGStyledElement.h"
+#include "SVGUnitTypes.h"
+#include <wtf/Vector.h>
+
+static const float kMaxFilterSize = 5000.0f;
+
+using namespace std;
+
+namespace WebCore {
+
+RenderSVGResourceType RenderSVGResourceFilter::s_resourceType = FilterResourceType;
+
+RenderSVGResourceFilter::RenderSVGResourceFilter(SVGStyledElement* node)
+    : RenderSVGResource(node)
+    , m_savedContext(0)
+    , m_sourceGraphicBuffer(0)
+{
+}
+
+RenderSVGResourceFilter::~RenderSVGResourceFilter()
+{
+    deleteAllValues(m_filter);
+    m_filter.clear();
+}
+
+void RenderSVGResourceFilter::invalidateClients()
+{
+    HashMap<RenderObject*, FilterData*>::const_iterator end = m_filter.end();
+    for (HashMap<RenderObject*, FilterData*>::const_iterator it = m_filter.begin(); it != end; ++it) {
+        RenderObject* renderer = it->first;
+        renderer->setNeedsBoundariesUpdate();
+        renderer->setNeedsLayout(true);
+    }
+    deleteAllValues(m_filter);
+    m_filter.clear();
+}
+
+void RenderSVGResourceFilter::invalidateClient(RenderObject* object)
+{
+    ASSERT(object);
+
+    // FIXME: The HashMap should always contain the object on calling invalidateClient. A race condition
+    // during the parsing can causes a call of invalidateClient right before the call of applyResource.
+    // We return earlier for the moment. This bug should be fixed in:
+    // https://bugs.webkit.org/show_bug.cgi?id=35181
+    if (!m_filter.contains(object))
+        return;
+
+    delete m_filter.take(object); 
+}
+
+PassOwnPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
+{
+    SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node());
+    bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+
+    // Add effects to the builder
+    OwnPtr<SVGFilterBuilder> builder(new SVGFilterBuilder);
+    builder->clearEffects();
+    for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) {
+        if (!node->isSVGElement())
+            continue;
+
+        SVGElement* element = static_cast<SVGElement*>(node);
+        if (!element->isFilterEffect())
+            continue;
+
+        SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFilterPrimitiveStandardAttributes*>(element);
+        RefPtr<FilterEffect> effect = effectElement->build(builder.get());
+        if (!effect) {
+            builder->clearEffects();
+            return 0;
+        }
+        effectElement->setStandardAttributes(primitiveBoundingBoxMode, effect.get());
+        builder->add(effectElement->result(), effect);
+    }
+    return builder.release();
+}
+
+bool RenderSVGResourceFilter::fitsInMaximumImageSize(const FloatSize& size, FloatSize& scale)
+{
+    bool matchesFilterSize = true;
+    if (size.width() > kMaxFilterSize) {
+        scale.setWidth(scale.width() * kMaxFilterSize / size.width());
+        matchesFilterSize = false;
+    }
+    if (size.height() > kMaxFilterSize) {
+        scale.setHeight(scale.height() * kMaxFilterSize / size.height());
+        matchesFilterSize = false;
+    }
+
+    return matchesFilterSize;
+}
+
+bool RenderSVGResourceFilter::applyResource(RenderObject* object, GraphicsContext*& context)
+{
+    ASSERT(object);
+    ASSERT(context);
+
+    // Returning false here, to avoid drawings onto the context. We just want to
+    // draw the stored filter output, not the unfiltered object as well.
+    if (m_filter.contains(object)) {
+        FilterData* filterData = m_filter.get(object);
+        if (filterData->builded)
+            return false;
+
+        delete m_filter.take(object); // Oops, have to rebuild, go through normal code path
+    }
+
+    OwnPtr<FilterData> filterData(new FilterData);
+    filterData->builder = buildPrimitives();
+    if (!filterData->builder)
+        return false;
+
+    const SVGRenderBase* renderer = object->toSVGRenderBase();
+    if (!renderer)
+        return false;
+
+    FloatRect paintRect = renderer->strokeBoundingBox();
+    paintRect.unite(renderer->markerBoundingBox());
+
+    // Calculate the scale factor for the use of filterRes.
+    // Also see http://www.w3.org/TR/SVG/filters.html#FilterEffectsRegion
+    SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node());
+    filterData->boundaries = filterElement->filterBoundingBox(object->objectBoundingBox());
+    if (filterData->boundaries.isEmpty())
+        return false;
+
+    FloatSize scale(1.0f, 1.0f);
+    if (filterElement->hasAttribute(SVGNames::filterResAttr)) {
+        scale.setWidth(filterElement->filterResX() / filterData->boundaries.width());
+        scale.setHeight(filterElement->filterResY() / filterData->boundaries.height());
+    }
+
+    if (scale.isEmpty())
+        return false;
+
+    // clip sourceImage to filterRegion
+    FloatRect clippedSourceRect = paintRect;
+    clippedSourceRect.intersect(filterData->boundaries);
+
+    // scale filter size to filterRes
+    FloatRect tempSourceRect = clippedSourceRect;
+
+    // scale to big sourceImage size to kMaxFilterSize
+    tempSourceRect.scale(scale.width(), scale.height());
+    fitsInMaximumImageSize(tempSourceRect.size(), scale);
+
+    // prepare Filters
+    bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+    filterData->filter = SVGFilter::create(paintRect, filterData->boundaries, primitiveBoundingBoxMode);
+    filterData->filter->setFilterResolution(scale);
+
+    FilterEffect* lastEffect = filterData->builder->lastEffect();
+    if (!lastEffect)
+        return false;
+    
+    lastEffect->calculateEffectRect(filterData->filter.get());
+    // At least one FilterEffect has a too big image size,
+    // recalculate the effect sizes with new scale factors.
+    if (!fitsInMaximumImageSize(filterData->filter->maxImageSize(), scale)) {
+        filterData->filter->setFilterResolution(scale);
+        lastEffect->calculateEffectRect(filterData->filter.get());
+    }
+
+    clippedSourceRect.scale(scale.width(), scale.height());
+
+    // Draw the content of the current element and it's childs to a imageBuffer to get the SourceGraphic.
+    // The size of the SourceGraphic is clipped to the size of the filterRegion.
+    IntRect bufferRect = enclosingIntRect(clippedSourceRect);
+    OwnPtr<ImageBuffer> sourceGraphic(ImageBuffer::create(bufferRect.size(), LinearRGB));
+    
+    if (!sourceGraphic.get())
+        return false;
+
+    GraphicsContext* sourceGraphicContext = sourceGraphic->context();
+    sourceGraphicContext->translate(-clippedSourceRect.x(), -clippedSourceRect.y());
+    sourceGraphicContext->scale(scale);
+    sourceGraphicContext->clearRect(FloatRect(FloatPoint(), paintRect.size()));
+    m_sourceGraphicBuffer.set(sourceGraphic.release());
+    m_savedContext = context;
+
+    context = sourceGraphicContext;
+    m_filter.set(object, filterData.release());
+
+    return true;
+}
+
+void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsContext*& context)
+{
+    ASSERT(object);
+    ASSERT(context);
+
+    if (!m_filter.contains(object))
+        return;
+
+    FilterData* filterData = m_filter.get(object);
+    if (!filterData->builded) {
+        if (!m_savedContext) {
+            invalidateClient(object);
+            return;
+        }
+
+        context = m_savedContext;
+        m_savedContext = 0;
+#if !PLATFORM(CG)
+        m_sourceGraphicBuffer->transformColorSpace(DeviceRGB, LinearRGB);
+#endif
+    }
+
+    FilterEffect* lastEffect = filterData->builder->lastEffect();
+    
+    if (lastEffect && !filterData->boundaries.isEmpty() && !lastEffect->subRegion().isEmpty()) {
+        // This is the real filtering of the object. It just needs to be called on the
+        // initial filtering process. We just take the stored filter result on a
+        // second drawing.
+        if (!filterData->builded) {
+            filterData->filter->setSourceImage(m_sourceGraphicBuffer.release());
+            lastEffect->apply(filterData->filter.get());
+            filterData->builded = true;
+        }
+
+        ImageBuffer* resultImage = lastEffect->resultImage();
+        if (resultImage) {
+#if !PLATFORM(CG)
+            resultImage->transformColorSpace(LinearRGB, DeviceRGB);
+#endif
+            context->drawImage(resultImage->image(), object->style()->colorSpace(), lastEffect->subRegion());
+        }
+    }
+
+    m_sourceGraphicBuffer.clear();
+}
+
+FloatRect RenderSVGResourceFilter::resourceBoundingBox(const FloatRect& objectBoundingBox) const
+{
+    if (SVGFilterElement* element = static_cast<SVGFilterElement*>(node()))
+        return element->filterBoundingBox(objectBoundingBox);
+
+    return FloatRect();
+}
+
+}
+#endif
diff --git a/WebCore/rendering/RenderSVGResourceFilter.h b/WebCore/rendering/RenderSVGResourceFilter.h
new file mode 100644
index 0000000..2cd4b6c
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceFilter.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ *               2004, 2005 Rob Buis <buis@kde.org>
+ *               2005 Eric Seidel <eric@webkit.org>
+ *               2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * 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 RenderSVGResourceFilter_h
+#define RenderSVGResourceFilter_h
+
+#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FloatRect.h"
+#include "ImageBuffer.h"
+#include "RenderSVGResource.h"
+#include "SVGFilter.h"
+#include "SVGFilterBuilder.h"
+#include "SVGFilterElement.h"
+#include "SVGUnitTypes.h"
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+struct FilterData {
+    FilterData()
+        : builded(false)
+    {
+    }
+
+    RefPtr<SVGFilter> filter;
+    OwnPtr<SVGFilterBuilder> builder;
+    FloatRect boundaries;
+    FloatSize scale;
+    bool builded;
+};
+
+class GraphicsContext;
+
+class RenderSVGResourceFilter : public RenderSVGResource {
+public:
+    RenderSVGResourceFilter(SVGStyledElement*);
+    virtual ~RenderSVGResourceFilter();
+
+    virtual const char* renderName() const { return "RenderSVGResourceFilter"; }
+
+    virtual void invalidateClients();
+    virtual void invalidateClient(RenderObject*);
+
+    virtual bool applyResource(RenderObject*, GraphicsContext*&);
+    virtual void postApplyResource(RenderObject*, GraphicsContext*&);
+
+    virtual FloatRect resourceBoundingBox(const FloatRect&) const;
+
+    PassOwnPtr<SVGFilterBuilder> buildPrimitives();
+
+    SVGUnitTypes::SVGUnitType filterUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->filterUnits()); }
+    SVGUnitTypes::SVGUnitType primitiveUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->primitiveUnits()); }
+
+    virtual RenderSVGResourceType resourceType() const { return s_resourceType; }
+    static RenderSVGResourceType s_resourceType;
+
+private:
+    bool fitsInMaximumImageSize(const FloatSize&, FloatSize&);
+
+    // Intermediate storage during 
+    GraphicsContext* m_savedContext;
+    OwnPtr<ImageBuffer> m_sourceGraphicBuffer;
+
+    HashMap<RenderObject*, FilterData*> m_filter;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/RenderSVGResourceMarker.cpp b/WebCore/rendering/RenderSVGResourceMarker.cpp
new file mode 100644
index 0000000..c526962
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceMarker.cpp
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ *               2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 "RenderSVGResourceMarker.h"
+
+#include "GraphicsContext.h"
+#include "RenderSVGContainer.h"
+#include "SVGElement.h"
+#include "SVGMarkerElement.h"
+#include "SVGRenderSupport.h"
+#include "SVGStyledElement.h"
+#include "SVGStyledTransformableElement.h"
+
+namespace WebCore {
+
+RenderSVGResourceType RenderSVGResourceMarker::s_resourceType = MarkerResourceType;
+
+RenderSVGResourceMarker::RenderSVGResourceMarker(SVGStyledElement* node)
+    : RenderSVGResource(node)
+{
+}
+
+RenderSVGResourceMarker::~RenderSVGResourceMarker()
+{
+    m_marker.clear();
+}
+
+void RenderSVGResourceMarker::layout()
+{
+    // RenderSVGHiddenContainer overwrites layout(). We need the
+    // layouting of RenderSVGContainer for calculating  local
+    // transformations and repaint.
+    RenderSVGContainer::layout();
+}
+
+void RenderSVGResourceMarker::addClient(const RenderObject* object)
+{
+    m_marker.add(object);
+}
+
+void RenderSVGResourceMarker::invalidateClients()
+{
+    const HashSet<const RenderObject*>::const_iterator end = m_marker.end();
+    for (HashSet<const RenderObject*>::const_iterator it = m_marker.begin(); it != end; ++it) {
+        RenderObject* renderer = const_cast<RenderObject*>(*it);
+        renderer->setNeedsBoundariesUpdate();
+        renderer->setNeedsLayout(true);
+    }
+
+    m_marker.clear();
+}
+
+void RenderSVGResourceMarker::invalidateClient(RenderObject* object)
+{
+    ASSERT(object);
+
+    // FIXME: The HashSet should always contain the object on calling invalidateClient. A race condition
+    // during the parsing can causes a call of invalidateClient right before the call of applyResource.
+    // We return earlier for the moment. This bug should be fixed in:
+    // https://bugs.webkit.org/show_bug.cgi?id=35181
+    if (!m_marker.contains(object))
+        return;
+
+    m_marker.remove(object);
+}
+
+void RenderSVGResourceMarker::applyViewportClip(PaintInfo& paintInfo)
+{
+    if (SVGRenderBase::isOverflowHidden(this))
+        paintInfo.context->clip(m_viewport);
+}
+
+FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& markerTransformation) const
+{
+    FloatRect coordinates = RenderSVGContainer::repaintRectInLocalCoordinates();
+
+    // Map repaint rect into parent coordinate space, in which the marker boundaries have to be evaluated
+    coordinates = localToParentTransform().mapRect(coordinates);
+
+    return markerTransformation.mapRect(coordinates);
+}
+
+const AffineTransform& RenderSVGResourceMarker::localToParentTransform() const
+{
+    AffineTransform viewportTranslation(viewportTransform());
+    m_localToParentTransform = viewportTranslation.translateRight(m_viewport.x(), m_viewport.y());
+    return m_localToParentTransform;
+    // If this class were ever given a localTransform(), then the above would read:
+    // return viewportTransform() * localTransform() * viewportTranslation;
+}
+
+FloatPoint RenderSVGResourceMarker::referencePoint() const
+{
+    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
+    ASSERT(marker);
+
+    return FloatPoint(marker->refX().value(marker), marker->refY().value(marker));
+}
+
+float RenderSVGResourceMarker::angle() const
+{
+    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
+    ASSERT(marker);
+
+    float angle = -1;
+    if (marker->orientType() == SVGMarkerElement::SVG_MARKER_ORIENT_ANGLE)
+        angle = marker->orientAngle().value();
+
+    return angle;
+}
+
+AffineTransform RenderSVGResourceMarker::markerTransformation(const FloatPoint& origin, float autoAngle, float strokeWidth) const
+{
+    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
+    ASSERT(marker);
+
+    float markerAngle = angle();
+    bool useStrokeWidth = (marker->markerUnits() == SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH);
+
+    AffineTransform transform;
+    transform.translate(origin.x(), origin.y());
+    transform.rotate(markerAngle == -1 ? autoAngle : markerAngle);
+    transform = markerContentTransformation(transform, referencePoint(), useStrokeWidth ? strokeWidth : -1);
+    return transform;
+}
+
+void RenderSVGResourceMarker::draw(RenderObject::PaintInfo& paintInfo, const AffineTransform& transform)
+{
+    DEFINE_STATIC_LOCAL(HashSet<RenderSVGResourceMarker*>, currentlyDrawingMarkers, ());
+
+    // avoid drawing circular marker references
+    if (currentlyDrawingMarkers.contains(this))
+        return;
+
+    currentlyDrawingMarkers.add(this);
+    RenderObject::PaintInfo info(paintInfo);
+    info.context->save();
+    applyTransformToPaintInfo(info, transform);
+    RenderSVGContainer::paint(info, 0, 0);
+    info.context->restore();
+
+    currentlyDrawingMarkers.remove(this);
+}
+
+AffineTransform RenderSVGResourceMarker::markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth) const
+{
+    // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates relative to the viewport established by the marker
+    FloatPoint mappedOrigin = viewportTransform().mapPoint(origin);
+
+    AffineTransform transformation = contentTransformation;
+    if (strokeWidth != -1)
+        transformation.scaleNonUniform(strokeWidth, strokeWidth);
+
+    transformation.translate(-mappedOrigin.x(), -mappedOrigin.y());
+    return transformation;
+}
+
+AffineTransform RenderSVGResourceMarker::viewportTransform() const
+{
+    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
+    ASSERT(marker);
+
+    return marker->viewBoxToViewTransform(m_viewport.width(), m_viewport.height());
+}
+
+void RenderSVGResourceMarker::calcViewport()
+{
+    if (!selfNeedsLayout())
+        return;
+
+    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
+    ASSERT(marker);
+
+    float w = marker->markerWidth().value(marker);
+    float h = marker->markerHeight().value(marker);
+    m_viewport = FloatRect(0, 0, w, h);
+}
+
+}
diff --git a/WebCore/rendering/RenderSVGResourceMarker.h b/WebCore/rendering/RenderSVGResourceMarker.h
new file mode 100644
index 0000000..9e39b99
--- /dev/null
+++ b/WebCore/rendering/RenderSVGResourceMarker.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * 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 RenderSVGResourceMarker_h
+#define RenderSVGResourceMarker_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "RenderObject.h"
+#include "RenderSVGResource.h"
+#include "SVGMarkerElement.h"
+#include "SVGStyledElement.h"
+
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+class AffineTransform;
+
+class RenderSVGResourceMarker : public RenderSVGResource {
+
+public:
+    RenderSVGResourceMarker(SVGStyledElement*);
+    virtual ~RenderSVGResourceMarker();
+
+    virtual const char* renderName() const { return "RenderSVGResourceMarker"; }
+
+    void addClient(const RenderObject*);
+    virtual void invalidateClients();
+    virtual void invalidateClient(RenderObject*);
+
+    void draw(RenderObject::PaintInfo&, const AffineTransform&);
+
+    // Calculates marker boundaries, mapped to the target element's coordinate space
+    FloatRect markerBoundaries(const AffineTransform& markerTransformation) const;
+
+    virtual void applyViewportClip(PaintInfo&);
+    virtual void layout();
+    virtual void calcViewport();
+
+    virtual const AffineTransform& localToParentTransform() const;
+    AffineTransform markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const;
+
+    virtual bool applyResource(RenderObject*, GraphicsContext*&) { return false; }
+    virtual FloatRect resourceBoundingBox(const FloatRect&) const { return FloatRect(); }
+
+    FloatPoint referencePoint() const;
+    float angle() const;
+    SVGMarkerElement::SVGMarkerUnitsType markerUnits() const { return static_cast<SVGMarkerElement::SVGMarkerUnitsType>(static_cast<SVGMarkerElement*>(node())->markerUnits()); }
+
+    virtual RenderSVGResourceType resourceType() const { return s_resourceType; }
+    static RenderSVGResourceType s_resourceType;
+
+private:
+    // Generates a transformation matrix usable to render marker content. Handles scaling the marker content
+    // acording to SVGs markerUnits="strokeWidth" concept, when a strokeWidth value != -1 is passed in.
+    AffineTransform markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth = -1) const;
+
+    AffineTransform viewportTransform() const;
+
+    // Save objects using this marker for invalidation.
+    HashSet<const RenderObject*> m_marker;
+
+    mutable AffineTransform m_localToParentTransform;
+    FloatRect m_viewport;
+};
+
+}
+#endif
+
+#endif
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 2923c6e..8bb16de 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -31,6 +31,7 @@
 #include "ImageBuffer.h"
 #include "ImageData.h"
 #include "IntRect.h"
+#include "RenderSVGResource.h"
 #include "SVGElement.h"
 #include "SVGMaskElement.h"
 #include "SVGStyledElement.h"
@@ -55,8 +56,12 @@
 void RenderSVGResourceMasker::invalidateClients()
 {
     HashMap<RenderObject*, MaskerData*>::const_iterator end = m_masker.end();
-    for (HashMap<RenderObject*, MaskerData*>::const_iterator it = m_masker.begin(); it != end; ++it)
-        it->first->setNeedsLayout(true);
+    for (HashMap<RenderObject*, MaskerData*>::const_iterator it = m_masker.begin(); it != end; ++it) {
+        RenderObject* renderer = it->first;
+        renderer->setNeedsBoundariesUpdate();
+        renderer->setNeedsLayout(true);
+    }
+
     deleteAllValues(m_masker);
     m_masker.clear();
 }
@@ -75,7 +80,7 @@
     delete m_masker.take(object); 
 }
 
-bool RenderSVGResourceMasker::applyResource(RenderObject* object, GraphicsContext* context)
+bool RenderSVGResourceMasker::applyResource(RenderObject* object, GraphicsContext*& context)
 {
     ASSERT(object);
     ASSERT(context);
diff --git a/WebCore/rendering/RenderSVGResourceMasker.h b/WebCore/rendering/RenderSVGResourceMasker.h
index 6c73c84..3127e3c 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.h
+++ b/WebCore/rendering/RenderSVGResourceMasker.h
@@ -58,7 +58,7 @@
     virtual void invalidateClients();
     virtual void invalidateClient(RenderObject*);
 
-    virtual bool applyResource(RenderObject*, GraphicsContext*);
+    virtual bool applyResource(RenderObject*, GraphicsContext*&);
     virtual FloatRect resourceBoundingBox(const FloatRect&) const;
 
     SVGUnitTypes::SVGUnitType maskUnits() const { return toUnitType(static_cast<SVGMaskElement*>(node())->maskUnits()); }
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 51bf3e7..5ed0871 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -35,7 +35,7 @@
 #include "TransformState.h"
 
 #if ENABLE(FILTERS)
-#include "SVGResourceFilter.h"
+#include "RenderSVGResourceFilter.h"
 #endif
 
 using namespace std;
@@ -129,7 +129,7 @@
 {
 #if ENABLE(FILTERS)
     const SVGRenderStyle* svgStyle = style()->svgStyle();
-    SVGResourceFilter* filter = getFilterById(document(), svgStyle->filter(), this);
+    RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(document(), svgStyle->filterResource());
     if (filter)
         return true;
 #endif
@@ -166,7 +166,7 @@
     // Transform from our paint container's coordinate system to our local coords.
     applyTransformToPaintInfo(childPaintInfo, localToRepaintContainerTransform(parentOriginInContainer));
 
-    SVGResourceFilter* filter = 0;
+    RenderSVGResourceFilter* filter = 0;
     FloatRect boundingBox = repaintRectInLocalCoordinates();
 
     bool continueRendering = true;
@@ -182,7 +182,7 @@
     childPaintInfo.context->restore();
 
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.context, borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y(), width(), height(), style());
+        paintOutline(paintInfo.context, borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y(), width(), height());
 }
 
 void RenderSVGRoot::destroy()
diff --git a/WebCore/rendering/RenderSVGShadowTreeRootContainer.h b/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
index 01cd427..81ae44b 100644
--- a/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
+++ b/WebCore/rendering/RenderSVGShadowTreeRootContainer.h
@@ -33,6 +33,8 @@
     RenderSVGShadowTreeRootContainer(SVGUseElement*);
     virtual ~RenderSVGShadowTreeRootContainer();
 
+    virtual bool isSVGShadowTreeRootContainer() const { return true; }
+
     void markShadowTreeForRecreation() { m_recreateTree = true; }
     void updateStyle(Node::StyleChange);
     virtual void updateFromElement();
diff --git a/WebCore/rendering/RenderSVGTSpan.h b/WebCore/rendering/RenderSVGTSpan.h
index 652c5e3..931bd8c 100644
--- a/WebCore/rendering/RenderSVGTSpan.h
+++ b/WebCore/rendering/RenderSVGTSpan.h
@@ -31,12 +31,6 @@
 public:
     RenderSVGTSpan(Node*);
     virtual const char* renderName() const { return "RenderSVGTSpan"; }
-
-    // FIXME: These are incorrect, but have always behaved this way.
-    // These empty implementations prevent us from hitting RenderObject ASSERTS.
-    // tspan.getBBox() will be wrong, and repainting for tspans may not work correctly!
-    virtual FloatRect objectBoundingBox() const { return FloatRect(); }
-    virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); }
 };
 }
 
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index b8b9553..c0c4650 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -38,7 +38,6 @@
 #include "RenderSVGRoot.h"
 #include "SVGLengthList.h"
 #include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
 #include "SVGRootInlineBox.h"
 #include "SVGTextElement.h"
 #include "SVGTransformList.h"
@@ -49,6 +48,7 @@
 
 RenderSVGText::RenderSVGText(SVGTextElement* node) 
     : RenderSVGBlock(node)
+    , m_needsTransformUpdate(true)
 {
 }
 
@@ -78,7 +78,10 @@
     int yOffset = (int)(text->y()->getFirst().value(text));
     setLocation(xOffset, yOffset);
 
-    m_localTransform = text->animatedLocalTransform();
+    if (m_needsTransformUpdate) {
+        m_localTransform = text->animatedLocalTransform();
+        m_needsTransformUpdate = false;
+    }
 
     RenderBlock::layout();
 
@@ -128,11 +131,8 @@
  
     // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
     // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
-    for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) {
-        ASSERT(runBox->isInlineFlowBox());
-
-        InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
-        for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) {
+    for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
+        for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) {
             FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
             // FIXME: crawling up the parent chain to map each rect is very inefficient
             // we should compute the absoluteTransform outside this loop first.
@@ -149,11 +149,8 @@
  
     // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
     // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
-    for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) {
-        ASSERT(runBox->isInlineFlowBox());
-
-        InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
-        for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) {
+    for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
+        for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) {
             FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
             // FIXME: crawling up the parent chain to map each quad is very inefficient
             // we should compute the absoluteTransform outside this loop first.
@@ -175,11 +172,8 @@
 {
     FloatRect boundingBox;
 
-    for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) {
-        ASSERT(runBox->isInlineFlowBox());
-
-        InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
-        for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine())
+    for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
+        for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine())
             boundingBox.unite(FloatRect(box->x(), box->y(), box->width(), box->height()));
     }
 
diff --git a/WebCore/rendering/RenderSVGText.h b/WebCore/rendering/RenderSVGText.h
index ab4b09b..fe53086 100644
--- a/WebCore/rendering/RenderSVGText.h
+++ b/WebCore/rendering/RenderSVGText.h
@@ -37,6 +37,8 @@
 public:
     RenderSVGText(SVGTextElement* node);
 
+    virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
+
 private:
     virtual const char* renderName() const { return "RenderSVGText"; }
 
@@ -67,11 +69,11 @@
     virtual FloatRect strokeBoundingBox() const;
     virtual FloatRect repaintRectInLocalCoordinates() const;
 
-    // FIXME: This can be removed when localTransform() is removed from RenderObject
     virtual AffineTransform localTransform() const { return m_localTransform; }
 
     virtual RootInlineBox* createRootInlineBox();
 
+    bool m_needsTransformUpdate : 1;
     AffineTransform m_localTransform;
 };
 
diff --git a/WebCore/rendering/RenderSVGTransformableContainer.cpp b/WebCore/rendering/RenderSVGTransformableContainer.cpp
index 4bec7a7..94b9eea 100644
--- a/WebCore/rendering/RenderSVGTransformableContainer.cpp
+++ b/WebCore/rendering/RenderSVGTransformableContainer.cpp
@@ -31,29 +31,31 @@
     
 RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGStyledTransformableElement* node)
     : RenderSVGContainer(node)
+    , m_needsTransformUpdate(true)
 {
 }
 
-const AffineTransform& RenderSVGTransformableContainer::localToParentTransform() const
-{
-    return m_localTransform;
-}
-
-AffineTransform RenderSVGTransformableContainer::localTransform() const
-{
-    return m_localTransform;
-}
-
 void RenderSVGTransformableContainer::calculateLocalTransform()
 {
-    m_localTransform = static_cast<SVGStyledTransformableElement*>(node())->animatedLocalTransform();
-    if (!node()->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(node())->isShadowTreeContainerElement())
+    SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
+
+    bool needsUpdate = m_needsTransformUpdate;
+    if (needsUpdate) {
+        m_localTransform = element->animatedLocalTransform();
+        m_needsTransformUpdate = false;
+    }
+
+    if (!element->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(element)->isShadowTreeContainerElement())
         return;
 
-    FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(node())->containerTranslation();
+    FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(element)->containerTranslation();
     if (translation.width() == 0 && translation.height() == 0)
         return;
 
+    // FIXME: Could optimize this case for use to avoid refetching the animatedLocalTransform() here, if only the containerTranslation() changed.
+    if (!needsUpdate)
+        m_localTransform = element->animatedLocalTransform();
+
     m_localTransform.translate(translation.width(), translation.height());
 }
 
diff --git a/WebCore/rendering/RenderSVGTransformableContainer.h b/WebCore/rendering/RenderSVGTransformableContainer.h
index 1de0b19..e6de054 100644
--- a/WebCore/rendering/RenderSVGTransformableContainer.h
+++ b/WebCore/rendering/RenderSVGTransformableContainer.h
@@ -31,13 +31,14 @@
     public:
         RenderSVGTransformableContainer(SVGStyledTransformableElement*);
 
-        virtual const AffineTransform& localToParentTransform() const;
+        virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
+        virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
     private:
         virtual void calculateLocalTransform();
-        // FIXME: This can be made non-virtual once SVGRenderTreeAsText stops using localTransform()
-        virtual AffineTransform localTransform() const;
+        virtual AffineTransform localTransform() const { return m_localTransform; }
 
+        bool m_needsTransformUpdate : 1;
         AffineTransform m_localTransform;
     };
 }
diff --git a/WebCore/rendering/RenderSVGViewportContainer.cpp b/WebCore/rendering/RenderSVGViewportContainer.cpp
index 103d9d2..1587e7f 100644
--- a/WebCore/rendering/RenderSVGViewportContainer.cpp
+++ b/WebCore/rendering/RenderSVGViewportContainer.cpp
@@ -3,6 +3,7 @@
                   2004, 2005, 2007 Rob Buis <buis@kde.org>
                   2007 Eric Seidel <eric@webkit.org>
                   2009 Google, Inc.
+    Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -26,9 +27,7 @@
 #include "RenderSVGViewportContainer.h"
 
 #include "GraphicsContext.h"
-
 #include "RenderView.h"
-#include "SVGMarkerElement.h"
 #include "SVGSVGElement.h"
 
 namespace WebCore {
@@ -38,29 +37,6 @@
 {
 }
 
-FloatRect RenderSVGViewportContainer::markerBoundaries(const AffineTransform& markerTransformation) const
-{
-    FloatRect coordinates = repaintRectInLocalCoordinates();
-
-    // Map repaint rect into parent coordinate space, in which the marker boundaries have to be evaluated
-    coordinates = localToParentTransform().mapRect(coordinates);
-
-    return markerTransformation.mapRect(coordinates);
-}
-
-AffineTransform RenderSVGViewportContainer::markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth) const
-{
-    // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates relative to the viewport established by the marker
-    FloatPoint mappedOrigin = viewportTransform().mapPoint(origin);
-
-    AffineTransform transformation = contentTransformation;
-    if (strokeWidth != -1)
-        transformation.scaleNonUniform(strokeWidth, strokeWidth);
-
-    transformation.translate(-mappedOrigin.x(), -mappedOrigin.y());
-    return transformation;
-}
-
 void RenderSVGViewportContainer::applyViewportClip(PaintInfo& paintInfo)
 {
     if (SVGRenderBase::isOverflowHidden(this))
@@ -81,14 +57,6 @@
         float w = svg->width().value(svg);
         float h = svg->height().value(svg);
         m_viewport = FloatRect(x, y, w, h);
-    } else if (svgelem->hasTagName(SVGNames::markerTag)) {
-        if (!selfNeedsLayout())
-            return;
-
-        SVGMarkerElement* svg = static_cast<SVGMarkerElement*>(node());
-        float w = svg->markerWidth().value(svg);
-        float h = svg->markerHeight().value(svg);
-        m_viewport = FloatRect(0, 0, w, h);
     }
 }
 
@@ -97,9 +65,6 @@
     if (node()->hasTagName(SVGNames::svgTag)) {
         SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
         return svg->viewBoxToViewTransform(m_viewport.width(), m_viewport.height());
-    } else if (node()->hasTagName(SVGNames::markerTag)) {
-        SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
-        return marker->viewBoxToViewTransform(m_viewport.width(), m_viewport.height());
     }
 
     return AffineTransform();
diff --git a/WebCore/rendering/RenderSVGViewportContainer.h b/WebCore/rendering/RenderSVGViewportContainer.h
index c4043ec..7b5702b 100644
--- a/WebCore/rendering/RenderSVGViewportContainer.h
+++ b/WebCore/rendering/RenderSVGViewportContainer.h
@@ -34,13 +34,6 @@
 public:
     RenderSVGViewportContainer(SVGStyledElement*);
 
-    // Calculates marker boundaries, mapped to the target element's coordinate space
-    FloatRect markerBoundaries(const AffineTransform& markerTransformation) const;
-
-    // Generates a transformation matrix usable to render marker content. Handles scaling the marker content
-    // acording to SVGs markerUnits="strokeWidth" concept, when a strokeWidth value != -1 is passed in.
-    AffineTransform markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth = -1) const;
-
 private:
     virtual bool isSVGContainer() const { return true; }
     virtual const char* renderName() const { return "RenderSVGViewportContainer"; }
diff --git a/WebCore/rendering/RenderSlider.cpp b/WebCore/rendering/RenderSlider.cpp
index 344f4ab..37b5e19 100644
--- a/WebCore/rendering/RenderSlider.cpp
+++ b/WebCore/rendering/RenderSlider.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -35,6 +35,7 @@
 #include "RenderLayer.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
+#include "StepRange.h"
 #include <wtf/MathExtras.h>
 
 #ifdef ANDROID_LAYOUT
@@ -49,80 +50,10 @@
 
 static const int defaultTrackLength = 129;
 
-// FIXME: The SliderRange class and functions are entirely based on the DOM,
-// and could be put with HTMLInputElement (possibly with a new name) instead of here.
-struct SliderRange {
-    bool hasStep;
-    double step;
-    double minimum;
-    double maximum;  // maximum must be >= minimum.
-
-    explicit SliderRange(HTMLInputElement*);
-    double clampValue(double value);
-
-    // Map value into 0-1 range
-    double proportionFromValue(double value)
-    {
-        if (minimum == maximum)
-            return 0;
-
-        return (value - minimum) / (maximum - minimum);
-    }
-    
-    // Map from 0-1 range to value
-    double valueFromProportion(double proportion)
-    {
-        return minimum + proportion * (maximum - minimum);
-    }
-    
-    double valueFromElement(HTMLInputElement*, bool* wasClamped = 0);
-};
-
-SliderRange::SliderRange(HTMLInputElement* element)
-{
-    if (element->hasAttribute(precisionAttr)) {
-        step = 1.0;
-        hasStep = !equalIgnoringCase(element->getAttribute(precisionAttr), "float");
-    } else
-        hasStep = element->getAllowedValueStep(&step);
-
-    maximum = element->maximum();
-    minimum = element->minimum();
-}
-
-double SliderRange::clampValue(double value)
-{
-    double clampedValue = max(minimum, min(value, maximum));
-    if (!hasStep)
-        return clampedValue;
-    // Rounds clampedValue to minimum + N * step.
-    clampedValue = minimum + round((clampedValue - minimum) / step) * step;
-    if (clampedValue > maximum)
-       clampedValue -= step;
-    ASSERT(clampedValue >= minimum);
-    ASSERT(clampedValue <= maximum);
-    return clampedValue;
-}
-
-double SliderRange::valueFromElement(HTMLInputElement* element, bool* wasClamped)
-{
-    double oldValue;
-    bool parseSuccess = HTMLInputElement::parseToDoubleForNumberType(element->value(), &oldValue);
-    if (!parseSuccess)
-        oldValue = (minimum + maximum) / 2;
-    double newValue = clampValue(oldValue);
-
-    if (wasClamped)
-        *wasClamped = !parseSuccess || newValue != oldValue;
-
-    return newValue;
-}
-
 // Returns a value between 0 and 1.
-// As with SliderRange, this could be on HTMLInputElement instead of here.
 static double sliderPosition(HTMLInputElement* element)
 {
-    SliderRange range(element);
+    StepRange range(element);
     return range.proportionFromValue(range.valueFromElement(element));
 }
 
@@ -376,15 +307,6 @@
 
 void RenderSlider::updateFromElement()
 {
-    HTMLInputElement* element = static_cast<HTMLInputElement*>(node());
-
-    // Send the value back to the element if the range changes it.
-    SliderRange range(element);
-    bool clamped;
-    double value = range.valueFromElement(element, &clamped);
-    if (clamped)
-        element->setValueFromRenderer(HTMLInputElement::serializeForNumberType(value));
-
     // Layout will take care of the thumb's size and position.
     if (!m_thumb) {
         m_thumb = new SliderThumbElement(document(), node());
@@ -434,7 +356,7 @@
     HTMLInputElement* element = static_cast<HTMLInputElement*>(node());
 
     // Calculate the new value based on the position, and send it to the element.
-    SliderRange range(element);
+    StepRange range(element);
     double fraction = static_cast<double>(position) / trackSize();
     if (style()->appearance() == SliderVerticalPart || style()->appearance() == MediaVolumeSliderPart)
         fraction = 1 - fraction;
diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp
index 61e05ad..0a61a93 100644
--- a/WebCore/rendering/RenderTable.cpp
+++ b/WebCore/rendering/RenderTable.cpp
@@ -648,6 +648,25 @@
     setNeedsLayoutAndPrefWidthsRecalc();
 }
 
+RenderTableCol* RenderTable::nextColElement(RenderTableCol* current) const
+{
+    RenderObject* next = current->firstChild();
+    if (!next)
+        next = current->nextSibling();
+    if (!next && current->parent()->isTableCol())
+        next = current->parent()->nextSibling();
+
+    while (next) {
+        if (next->isTableCol())
+            return toRenderTableCol(next);
+        if (next != m_caption)
+            return 0;
+        next = next->nextSibling();
+    }
+    
+    return 0;
+}
+
 RenderTableCol* RenderTable::colElement(int col, bool* startEdge, bool* endEdge) const
 {
     if (!m_hasColElements)
@@ -656,32 +675,31 @@
     int cCol = 0;
 
     while (child) {
-        if (child->isTableCol()) {
-            RenderTableCol* colElem = toRenderTableCol(child);
-            int span = colElem->span();
-            if (!colElem->firstChild()) {
-                int startCol = cCol;
-                int endCol = cCol + span - 1;
-                cCol += span;
-                if (cCol > col) {
-                    if (startEdge)
-                        *startEdge = startCol == col;
-                    if (endEdge)
-                        *endEdge = endCol == col;
-                    return colElem;
-                }
-            }
-
-            RenderObject* next = child->firstChild();
-            if (!next)
-                next = child->nextSibling();
-            if (!next && child->parent()->isTableCol())
-                next = child->parent()->nextSibling();
-            child = next;
-        } else if (child == m_caption)
-            child = child->nextSibling();
-        else
+        if (child->isTableCol())
             break;
+        if (child != m_caption)
+            return 0;
+        child = child->nextSibling();
+    }
+    if (!child)
+        return 0;
+
+    RenderTableCol* colElem = toRenderTableCol(child);
+    while (colElem) {
+        int span = colElem->span();
+        if (!colElem->firstChild()) {
+            int startCol = cCol;
+            int endCol = cCol + span - 1;
+            cCol += span;
+            if (cCol > col) {
+                if (startEdge)
+                    *startEdge = startCol == col;
+                if (endEdge)
+                    *endEdge = endCol == col;
+                return colElem;
+            }
+        }
+        colElem = nextColElement(colElem);
     }
 
     return 0;
@@ -773,7 +791,7 @@
         if (tb.style() == BHIDDEN)
             return 0;
         if (tb.style() > BHIDDEN)
-            borderWidth = tb.width;
+            borderWidth = tb.width();
 
         int leftmostColumn = style()->direction() == RTL ? numEffCols() - 1 : 0;
         RenderTableCol* colGroup = colElement(leftmostColumn);
@@ -782,7 +800,7 @@
             if (gb.style() == BHIDDEN)
                 return 0;
             if (gb.style() > BHIDDEN)
-                borderWidth = max(borderWidth, static_cast<unsigned>(gb.width));
+                borderWidth = max(borderWidth, static_cast<unsigned>(gb.width()));
         }
         
         RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
@@ -795,7 +813,7 @@
                 return 0;
 
             if (sb.style() > BHIDDEN)
-                borderWidth = max(borderWidth, static_cast<unsigned>(sb.width));
+                borderWidth = max(borderWidth, static_cast<unsigned>(sb.width()));
 
             const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn);
             
@@ -809,9 +827,9 @@
                     return 0;
 
                 if (cb.style() > BHIDDEN)
-                    borderWidth = max(borderWidth, static_cast<unsigned>(cb.width));
+                    borderWidth = max(borderWidth, static_cast<unsigned>(cb.width()));
                 if (rb.style() > BHIDDEN)
-                    borderWidth = max(borderWidth, static_cast<unsigned>(rb.width));
+                    borderWidth = max(borderWidth, static_cast<unsigned>(rb.width()));
             }
         }
         return borderWidth / 2;
@@ -832,7 +850,7 @@
         if (tb.style() == BHIDDEN)
             return 0;
         if (tb.style() > BHIDDEN)
-            borderWidth = tb.width;
+            borderWidth = tb.width();
 
         int rightmostColumn = style()->direction() == RTL ? 0 : numEffCols() - 1;
         RenderTableCol* colGroup = colElement(rightmostColumn);
@@ -841,7 +859,7 @@
             if (gb.style() == BHIDDEN)
                 return 0;
             if (gb.style() > BHIDDEN)
-                borderWidth = max(borderWidth, static_cast<unsigned>(gb.width));
+                borderWidth = max(borderWidth, static_cast<unsigned>(gb.width()));
         }
         
         RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
@@ -854,7 +872,7 @@
                 return 0;
 
             if (sb.style() > BHIDDEN)
-                borderWidth = max(borderWidth, static_cast<unsigned>(sb.width));
+                borderWidth = max(borderWidth, static_cast<unsigned>(sb.width()));
 
             const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn);
             
@@ -868,9 +886,9 @@
                     return 0;
 
                 if (cb.style() > BHIDDEN)
-                    borderWidth = max(borderWidth, static_cast<unsigned>(cb.width));
+                    borderWidth = max(borderWidth, static_cast<unsigned>(cb.width()));
                 if (rb.style() > BHIDDEN)
-                    borderWidth = max(borderWidth, static_cast<unsigned>(rb.width));
+                    borderWidth = max(borderWidth, static_cast<unsigned>(rb.width()));
             }
         }
         return (borderWidth + 1) / 2;
@@ -921,7 +939,7 @@
     if (tb.style() == BHIDDEN)
         return 0;
     if (tb.style() > BHIDDEN)
-        borderWidth = max(borderWidth, static_cast<int>(tb.width / 2));
+        borderWidth = max(borderWidth, static_cast<int>(tb.width() / 2));
     return borderWidth;
 }
 
@@ -947,7 +965,7 @@
     if (tb.style() == BHIDDEN)
         return 0;
     if (tb.style() > BHIDDEN)
-        borderWidth = max(borderWidth, static_cast<int>((tb.width + 1) / 2));
+        borderWidth = max(borderWidth, static_cast<int>((tb.width() + 1) / 2));
     return borderWidth;
 }
 
@@ -962,7 +980,7 @@
     if (tb.style() == BHIDDEN)
         return 0;
     if (tb.style() > BHIDDEN)
-        borderWidth = tb.width / 2;
+        borderWidth = tb.width() / 2;
 
     bool allHidden = true;
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
@@ -992,7 +1010,7 @@
     if (tb.style() == BHIDDEN)
         return 0;
     if (tb.style() > BHIDDEN)
-        borderWidth = (tb.width + 1) / 2;
+        borderWidth = (tb.width() + 1) / 2;
 
     bool allHidden = true;
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
diff --git a/WebCore/rendering/RenderTable.h b/WebCore/rendering/RenderTable.h
index d07a727..ea81d64 100644
--- a/WebCore/rendering/RenderTable.h
+++ b/WebCore/rendering/RenderTable.h
@@ -113,6 +113,7 @@
     }
 
     RenderTableCol* colElement(int col, bool* startEdge = 0, bool* endEdge = 0) const;
+    RenderTableCol* nextColElement(RenderTableCol* current) const;
 
     bool needsSectionRecalc() const { return m_needsSectionRecalc; }
     void setNeedsSectionRecalc()
diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp
index de71796..4506e77 100644
--- a/WebCore/rendering/RenderTableCell.cpp
+++ b/WebCore/rendering/RenderTableCell.cpp
@@ -88,18 +88,42 @@
 Length RenderTableCell::styleOrColWidth() const
 {
     Length w = style()->width();
-    if (colSpan() > 1 || !w.isAuto())
+    if (!w.isAuto())
         return w;
+
     RenderTableCol* tableCol = table()->colElement(col());
+
     if (tableCol) {
-        w = tableCol->style()->width();
-        
+        int colSpanCount = colSpan();
+
+        Length colWidthSum = Length(0, Fixed);
+        for (int i = 1; i <= colSpanCount; i++) {
+            Length colWidth = tableCol->style()->width();
+
+            // Percentage value should be returned only for colSpan == 1.
+            // Otherwise we return original width for the cell.
+            if (!colWidth.isFixed()) {
+                if (colSpanCount > 1)
+                    return w;
+                return colWidth;
+            }
+
+            colWidthSum = Length(colWidthSum.value() + colWidth.value(), Fixed);
+
+            tableCol = table()->nextColElement(tableCol);
+            // If no next <col> tag found for the span we just return what we have for now.
+            if (!tableCol)
+                break;
+        }
+
         // Column widths specified on <col> apply to the border box of the cell.
         // Percentages don't need to be handled since they're always treated this way (even when specified on the cells).
         // See Bugzilla bug 8126 for details.
-        if (w.isFixed() && w.value() > 0)
-            w = Length(max(0, w.value() - borderLeft() - borderRight() - paddingLeft() - paddingRight()), Fixed);
+        if (colWidthSum.isFixed() && colWidthSum.value() > 0)
+            colWidthSum = Length(max(0, colWidthSum.value() - borderLeft() - borderRight() - paddingLeft() - paddingRight()), Fixed);
+        return colWidthSum;
     }
+
     return w;
 }
 
@@ -312,7 +336,7 @@
         return border1.style() > border2.style() ? border1 : border2;
     
     // The border have the same width and style.  Rely on precedence (cell over row over row group, etc.)
-    return border1.precedence >= border2.precedence ? border1 : border2;
+    return border1.precedence() >= border2.precedence() ? border1 : border2;
 }
 
 CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
@@ -328,22 +352,25 @@
     
     // For border left, we need to check, in order of precedence:
     // (1) Our left border.
-    CollapsedBorderValue result(&style()->borderLeft(), BCELL);
+    int left = CSSPropertyBorderLeftColor;
+    int right = CSSPropertyBorderRightColor;
+    CollapsedBorderValue result(&style()->borderLeft(), style()->visitedDependentColor(left), BCELL);
     
     // (2) The right border of the cell to the left.
     RenderTableCell* prevCell = rtl ? tableElt->cellAfter(this) : tableElt->cellBefore(this);
     if (prevCell) {
-        result = rtl ? compareBorders(result, CollapsedBorderValue(&prevCell->style()->borderRight(), BCELL)) : compareBorders(CollapsedBorderValue(&prevCell->style()->borderRight(), BCELL), result);
+        CollapsedBorderValue prevCellBorder = CollapsedBorderValue(&prevCell->style()->borderRight(), prevCell->style()->visitedDependentColor(right), BCELL);
+        result = rtl ? compareBorders(result, prevCellBorder) : compareBorders(prevCellBorder, result);
         if (!result.exists())
             return result;
     } else if (leftmostColumn) {
         // (3) Our row's left border.
-        result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderLeft(), BROW));
+        result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderLeft(), parent()->style()->visitedDependentColor(left), BROW));
         if (!result.exists())
             return result;
         
         // (4) Our row group's left border.
-        result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderLeft(), BROWGROUP));
+        result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderLeft(), section()->style()->visitedDependentColor(left), BROWGROUP));
         if (!result.exists())
             return result;
     }
@@ -353,11 +380,11 @@
     bool endColEdge;
     RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? colSpan() - 1 : 0), &startColEdge, &endColEdge);
     if (colElt && (!rtl ? startColEdge : endColEdge)) {
-        result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL));
+        result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), colElt->style()->visitedDependentColor(left), BCOL));
         if (!result.exists())
             return result;
         if (colElt->parent()->isTableCol() && (!rtl ? !colElt->previousSibling() : !colElt->nextSibling())) {
-            result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderLeft(), BCOLGROUP));
+            result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderLeft(), colElt->parent()->style()->visitedDependentColor(left), BCOLGROUP));
             if (!result.exists())
                 return result;
         }
@@ -367,13 +394,14 @@
     if (!leftmostColumn) {
         colElt = tableElt->colElement(col() + (rtl ? colSpan() : -1), &startColEdge, &endColEdge);
         if (colElt && (!rtl ? endColEdge : startColEdge)) {
-            result = rtl ? compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), BCOL)) : compareBorders(CollapsedBorderValue(&colElt->style()->borderRight(), BCOL), result);
+            CollapsedBorderValue rightBorder = CollapsedBorderValue(&colElt->style()->borderRight(), colElt->style()->visitedDependentColor(right), BCOL);
+            result = rtl ? compareBorders(result, rightBorder) : compareBorders(rightBorder, result);
             if (!result.exists())
                 return result;
         }
     } else {
         // (7) The table's left border.
-        result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderLeft(), BTABLE));
+        result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderLeft(), tableElt->style()->visitedDependentColor(left), BTABLE));
         if (!result.exists())
             return result;
     }
@@ -394,24 +422,27 @@
     
     // For border right, we need to check, in order of precedence:
     // (1) Our right border.
-    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderRight(), BCELL);
+    int left = CSSPropertyBorderLeftColor;
+    int right = CSSPropertyBorderRightColor;
+    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderRight(), style()->visitedDependentColor(right), BCELL);
     
     // (2) The left border of the cell to the right.
     if (!rightmostColumn) {
         RenderTableCell* nextCell = rtl ? tableElt->cellBefore(this) : tableElt->cellAfter(this);
         if (nextCell && nextCell->style()) {
-            result = rtl ? compareBorders(CollapsedBorderValue(&nextCell->style()->borderLeft(), BCELL), result) : compareBorders(result, CollapsedBorderValue(&nextCell->style()->borderLeft(), BCELL));
+            CollapsedBorderValue leftBorder = CollapsedBorderValue(&nextCell->style()->borderLeft(), nextCell->style()->visitedDependentColor(left), BCELL);
+            result = rtl ? compareBorders(leftBorder, result) : compareBorders(result, leftBorder);
             if (!result.exists())
                 return result;
         }
     } else {
         // (3) Our row's right border.
-        result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderRight(), BROW));
+        result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderRight(), parent()->style()->visitedDependentColor(right), BROW));
         if (!result.exists())
             return result;
         
         // (4) Our row group's right border.
-        result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderRight(), BROWGROUP));
+        result = compareBorders(result, CollapsedBorderValue(&section()->style()->borderRight(), section()->style()->visitedDependentColor(right), BROWGROUP));
         if (!result.exists())
             return result;
     }
@@ -421,11 +452,11 @@
     bool endColEdge;
     RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? 0 : colSpan() - 1), &startColEdge, &endColEdge);
     if (colElt && (!rtl ? endColEdge : startColEdge)) {
-        result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), BCOL));
+        result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), colElt->style()->visitedDependentColor(right), BCOL));
         if (!result.exists())
             return result;
         if (colElt->parent()->isTableCol() && (!rtl ? !colElt->nextSibling() : !colElt->previousSibling())) {
-            result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderRight(), BCOLGROUP));
+            result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderRight(), colElt->parent()->style()->visitedDependentColor(right), BCOLGROUP));
             if (!result.exists())
                 return result;
         }
@@ -435,13 +466,14 @@
     if (!rightmostColumn) {
         colElt = tableElt->colElement(col() + (rtl ? -1 : colSpan()), &startColEdge, &endColEdge);
         if (colElt && (!rtl ? startColEdge : endColEdge)) {
-            result = rtl ? compareBorders(CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL), result) : compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL));
+            CollapsedBorderValue leftBorder = CollapsedBorderValue(&colElt->style()->borderLeft(), colElt->style()->visitedDependentColor(left), BCOL);
+            result = rtl ? compareBorders(leftBorder, result) : compareBorders(result, leftBorder);
             if (!result.exists())
                 return result;
         }
     } else {
         // (7) The table's right border.
-        result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderRight(), BTABLE));
+        result = compareBorders(result, CollapsedBorderValue(&tableElt->style()->borderRight(), tableElt->style()->visitedDependentColor(right), BTABLE));
         if (!result.exists())
             return result;
     }
@@ -453,18 +485,20 @@
 {
     // For border top, we need to check, in order of precedence:
     // (1) Our top border.
-    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderTop(), BCELL);
+    int top = CSSPropertyBorderTopColor;
+    int bottom = CSSPropertyBorderBottomColor;
+    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderTop(), style()->visitedDependentColor(top), BCELL);
     
     RenderTableCell* prevCell = table()->cellAbove(this);
     if (prevCell) {
         // (2) A previous cell's bottom border.
-        result = compareBorders(CollapsedBorderValue(&prevCell->style()->borderBottom(), BCELL), result);
+        result = compareBorders(CollapsedBorderValue(&prevCell->style()->borderBottom(), prevCell->style()->visitedDependentColor(bottom), BCELL), result);
         if (!result.exists()) 
             return result;
     }
     
     // (3) Our row's top border.
-    result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderTop(), BROW));
+    result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderTop(), parent()->style()->visitedDependentColor(top), BROW));
     if (!result.exists())
         return result;
     
@@ -477,7 +511,7 @@
             prevRow = prevCell->section()->lastChild();
     
         if (prevRow) {
-            result = compareBorders(CollapsedBorderValue(&prevRow->style()->borderBottom(), BROW), result);
+            result = compareBorders(CollapsedBorderValue(&prevRow->style()->borderBottom(), prevRow->style()->visitedDependentColor(bottom), BROW), result);
             if (!result.exists())
                 return result;
         }
@@ -487,14 +521,14 @@
     RenderTableSection* currSection = section();
     if (!row()) {
         // (5) Our row group's top border.
-        result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), BROWGROUP));
+        result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
         if (!result.exists())
             return result;
         
         // (6) Previous row group's bottom border.
         currSection = table()->sectionAbove(currSection);
         if (currSection) {
-            result = compareBorders(CollapsedBorderValue(&currSection->style()->borderBottom(), BROWGROUP), result);
+            result = compareBorders(CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP), result);
             if (!result.exists())
                 return result;
         }
@@ -504,18 +538,19 @@
         // (8) Our column and column group's top borders.
         RenderTableCol* colElt = table()->colElement(col());
         if (colElt) {
-            result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderTop(), BCOL));
+            result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderTop(), colElt->style()->visitedDependentColor(top), BCOL));
             if (!result.exists())
                 return result;
             if (colElt->parent()->isTableCol()) {
-                result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderTop(), BCOLGROUP));
+                result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderTop(), colElt->parent()->style()->visitedDependentColor(top), BCOLGROUP));
                 if (!result.exists())
                     return result;
             }
         }
         
         // (9) The table's top border.
-        result = compareBorders(result, CollapsedBorderValue(&table()->style()->borderTop(), BTABLE));
+        RenderTable* enclosingTable = table();
+        result = compareBorders(result, CollapsedBorderValue(&enclosingTable->style()->borderTop(), enclosingTable->style()->visitedDependentColor(top), BTABLE));
         if (!result.exists())
             return result;
     }
@@ -527,24 +562,26 @@
 {
     // For border top, we need to check, in order of precedence:
     // (1) Our bottom border.
-    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderBottom(), BCELL);
+    int top = CSSPropertyBorderTopColor;
+    int bottom = CSSPropertyBorderBottomColor;
+    CollapsedBorderValue result = CollapsedBorderValue(&style()->borderBottom(), style()->visitedDependentColor(bottom), BCELL);
     
     RenderTableCell* nextCell = table()->cellBelow(this);
     if (nextCell) {
         // (2) A following cell's top border.
-        result = compareBorders(result, CollapsedBorderValue(&nextCell->style()->borderTop(), BCELL));
+        result = compareBorders(result, CollapsedBorderValue(&nextCell->style()->borderTop(), nextCell->style()->visitedDependentColor(top), BCELL));
         if (!result.exists())
             return result;
     }
     
     // (3) Our row's bottom border. (FIXME: Deal with rowspan!)
-    result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderBottom(), BROW));
+    result = compareBorders(result, CollapsedBorderValue(&parent()->style()->borderBottom(), parent()->style()->visitedDependentColor(bottom), BROW));
     if (!result.exists())
         return result;
     
     // (4) The next row's top border.
     if (nextCell) {
-        result = compareBorders(result, CollapsedBorderValue(&nextCell->parent()->style()->borderTop(), BROW));
+        result = compareBorders(result, CollapsedBorderValue(&nextCell->parent()->style()->borderTop(), nextCell->parent()->style()->visitedDependentColor(top), BROW));
         if (!result.exists())
             return result;
     }
@@ -553,14 +590,14 @@
     RenderTableSection* currSection = section();
     if (row() + rowSpan() >= currSection->numRows()) {
         // (5) Our row group's bottom border.
-        result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderBottom(), BROWGROUP));
+        result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderBottom(), currSection->style()->visitedDependentColor(bottom), BROWGROUP));
         if (!result.exists())
             return result;
         
         // (6) Following row group's top border.
         currSection = table()->sectionBelow(currSection);
         if (currSection) {
-            result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), BROWGROUP));
+            result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), currSection->style()->visitedDependentColor(top), BROWGROUP));
             if (!result.exists())
                 return result;
         }
@@ -570,17 +607,18 @@
         // (8) Our column and column group's bottom borders.
         RenderTableCol* colElt = table()->colElement(col());
         if (colElt) {
-            result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderBottom(), BCOL));
+            result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderBottom(), colElt->style()->visitedDependentColor(bottom), BCOL));
             if (!result.exists()) return result;
             if (colElt->parent()->isTableCol()) {
-                result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderBottom(), BCOLGROUP));
+                result = compareBorders(result, CollapsedBorderValue(&colElt->parent()->style()->borderBottom(), colElt->parent()->style()->visitedDependentColor(bottom), BCOLGROUP));
                 if (!result.exists())
                     return result;
             }
         }
         
         // (9) The table's bottom border.
-        result = compareBorders(result, CollapsedBorderValue(&table()->style()->borderBottom(), BTABLE));
+        RenderTable* enclosingTable = table();
+        result = compareBorders(result, CollapsedBorderValue(&enclosingTable->style()->borderBottom(), enclosingTable->style()->visitedDependentColor(bottom), BTABLE));
         if (!result.exists())
             return result;
     }
@@ -811,7 +849,7 @@
     for (CollapsedBorder* border = borders.nextBorder(); border; border = borders.nextBorder()) {
         if (border->borderValue == *table()->currentBorderStyle())
             drawLineForBoxSide(graphicsContext, border->x1, border->y1, border->x2, border->y2, border->side, 
-                               border->borderValue.color(), style()->color(), border->style, 0, 0);
+                               border->borderValue.color(), border->style, 0, 0);
     }
 }
 
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index a2457e1..e8ab4a4 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -807,13 +807,13 @@
     if (sb.style() == BHIDDEN)
         return -1;
     if (sb.style() > BHIDDEN)
-        borderWidth = sb.width;
+        borderWidth = sb.width();
 
     const BorderValue& rb = firstChild()->style()->borderTop();
     if (rb.style() == BHIDDEN)
         return -1;
-    if (rb.style() > BHIDDEN && rb.width > borderWidth)
-        borderWidth = rb.width;
+    if (rb.style() > BHIDDEN && rb.width() > borderWidth)
+        borderWidth = rb.width();
 
     bool allHidden = true;
     for (int c = 0; c < totalCols; c++) {
@@ -829,17 +829,17 @@
                 continue;
             else
                 allHidden = false;
-            if (gb.style() > BHIDDEN && gb.width > borderWidth)
-                borderWidth = gb.width;
-            if (cb.style() > BHIDDEN && cb.width > borderWidth)
-                borderWidth = cb.width;
+            if (gb.style() > BHIDDEN && gb.width() > borderWidth)
+                borderWidth = gb.width();
+            if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+                borderWidth = cb.width();
         } else {
             if (cb.style() == BHIDDEN)
                 continue;
             else
                 allHidden = false;
-            if (cb.style() > BHIDDEN && cb.width > borderWidth)
-                borderWidth = cb.width;
+            if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+                borderWidth = cb.width();
         }
     }
     if (allHidden)
@@ -860,13 +860,13 @@
     if (sb.style() == BHIDDEN)
         return -1;
     if (sb.style() > BHIDDEN)
-        borderWidth = sb.width;
+        borderWidth = sb.width();
 
     const BorderValue& rb = lastChild()->style()->borderBottom();
     if (rb.style() == BHIDDEN)
         return -1;
-    if (rb.style() > BHIDDEN && rb.width > borderWidth)
-        borderWidth = rb.width;
+    if (rb.style() > BHIDDEN && rb.width() > borderWidth)
+        borderWidth = rb.width();
 
     bool allHidden = true;
     for (int c = 0; c < totalCols; c++) {
@@ -882,17 +882,17 @@
                 continue;
             else
                 allHidden = false;
-            if (gb.style() > BHIDDEN && gb.width > borderWidth)
-                borderWidth = gb.width;
-            if (cb.style() > BHIDDEN && cb.width > borderWidth)
-                borderWidth = cb.width;
+            if (gb.style() > BHIDDEN && gb.width() > borderWidth)
+                borderWidth = gb.width();
+            if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+                borderWidth = cb.width();
         } else {
             if (cb.style() == BHIDDEN)
                 continue;
             else
                 allHidden = false;
-            if (cb.style() > BHIDDEN && cb.width > borderWidth)
-                borderWidth = cb.width;
+            if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+                borderWidth = cb.width();
         }
     }
     if (allHidden)
@@ -913,7 +913,7 @@
     if (sb.style() == BHIDDEN)
         return -1;
     if (sb.style() > BHIDDEN)
-        borderWidth = sb.width;
+        borderWidth = sb.width();
 
     int leftmostColumn = rtl ? totalCols - 1 : 0;
     RenderTableCol* colGroup = table()->colElement(leftmostColumn);
@@ -921,8 +921,8 @@
         const BorderValue& gb = colGroup->style()->borderLeft();
         if (gb.style() == BHIDDEN)
             return -1;
-        if (gb.style() > BHIDDEN && gb.width > borderWidth)
-            borderWidth = gb.width;
+        if (gb.style() > BHIDDEN && gb.width() > borderWidth)
+            borderWidth = gb.width();
     }
 
     bool allHidden = true;
@@ -937,10 +937,10 @@
             continue;
         else
             allHidden = false;
-        if (cb.style() > BHIDDEN && cb.width > borderWidth)
-            borderWidth = cb.width;
-        if (rb.style() > BHIDDEN && rb.width > borderWidth)
-            borderWidth = rb.width;
+        if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+            borderWidth = cb.width();
+        if (rb.style() > BHIDDEN && rb.width() > borderWidth)
+            borderWidth = rb.width();
     }
     if (allHidden)
         return -1;
@@ -960,7 +960,7 @@
     if (sb.style() == BHIDDEN)
         return -1;
     if (sb.style() > BHIDDEN)
-        borderWidth = sb.width;
+        borderWidth = sb.width();
 
     int rightmostColumn = rtl ? 0 : totalCols - 1;
     RenderTableCol* colGroup = table()->colElement(rightmostColumn);
@@ -968,8 +968,8 @@
         const BorderValue& gb = colGroup->style()->borderRight();
         if (gb.style() == BHIDDEN)
             return -1;
-        if (gb.style() > BHIDDEN && gb.width > borderWidth)
-            borderWidth = gb.width;
+        if (gb.style() > BHIDDEN && gb.width() > borderWidth)
+            borderWidth = gb.width();
     }
 
     bool allHidden = true;
@@ -984,10 +984,10 @@
             continue;
         else
             allHidden = false;
-        if (cb.style() > BHIDDEN && cb.width > borderWidth)
-            borderWidth = cb.width;
-        if (rb.style() > BHIDDEN && rb.width > borderWidth)
-            borderWidth = rb.width;
+        if (cb.style() > BHIDDEN && cb.width() > borderWidth)
+            borderWidth = cb.width();
+        if (rb.style() > BHIDDEN && rb.width() > borderWidth)
+            borderWidth = rb.width();
     }
     if (allHidden)
         return -1;
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index 4653273..90ad6d8 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -36,8 +36,10 @@
 #include "RenderBlock.h"
 #include "RenderLayer.h"
 #include "RenderView.h"
+#include "StringBuffer.h"
 #include "Text.h"
 #include "TextBreakIterator.h"
+#include "TextResourceDecoder.h"
 #include "VisiblePosition.h"
 #include "break_lines.h"
 #include <wtf/AlwaysInline.h>
@@ -48,16 +50,46 @@
 
 namespace WebCore {
 
-// FIXME: Move to StringImpl.h eventually.
-static inline bool charactersAreAllASCII(StringImpl* text)
+static void makeCapitalized(String* string, UChar previous)
 {
-    return charactersAreAllASCII(text->characters(), text->length());
+    if (string->isNull())
+        return;
+
+    unsigned length = string->length();
+    const UChar* characters = string->characters();
+
+    StringBuffer stringWithPrevious(length + 1);
+    stringWithPrevious[0] = previous == noBreakSpace ? ' ' : previous;
+    for (unsigned i = 1; i < length + 1; i++) {
+        // Replace &nbsp with a real space since ICU no longer treats &nbsp as a word separator.
+        if (characters[i - 1] == noBreakSpace)
+            stringWithPrevious[i] = ' ';
+        else
+            stringWithPrevious[i] = characters[i - 1];
+    }
+
+    TextBreakIterator* boundary = wordBreakIterator(stringWithPrevious.characters(), length + 1);
+    if (!boundary)
+        return;
+
+    StringBuffer data(length);
+
+    int32_t endOfWord;
+    int32_t startOfWord = textBreakFirst(boundary);
+    for (endOfWord = textBreakNext(boundary); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = textBreakNext(boundary)) {
+        if (startOfWord != 0) // Ignore first char of previous string
+            data[startOfWord - 1] = characters[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]);
+        for (int i = startOfWord + 1; i < endOfWord; i++)
+            data[i - 1] = characters[i - 1];
+    }
+
+    *string = String::adopt(data);
 }
 
 RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
      : RenderObject(node)
      , m_minWidth(-1)
-     , m_text(document()->displayStringModifiedByEncoding(str))
+     , m_text(str)
      , m_firstTextBox(0)
      , m_lastTextBox(0)
      , m_maxWidth(-1)
@@ -66,8 +98,9 @@
      , m_hasTab(false)
      , m_linesDirty(false)
      , m_containsReversedText(false)
-     , m_isAllASCII(charactersAreAllASCII(m_text.get()))
-     , m_knownNotToUseFallbackFonts(false)
+     , m_isAllASCII(m_text.containsOnlyASCII())
+     , m_knownToHaveNoOverflowAndNoFallbackFonts(false)
+     , m_needsTranscoding(false)
 {
     ASSERT(m_text);
 
@@ -104,6 +137,11 @@
     return false;
 }
 
+void RenderText::updateNeedsTranscoding()
+{
+    m_needsTranscoding = document()->decoder() && document()->decoder()->encoding().backslashAsCurrencySymbol() != '\\';
+}
+
 void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     // There is no need to ever schedule repaints from a style change of a text run, since
@@ -112,13 +150,18 @@
     // need to relayout.
     if (diff == StyleDifferenceLayout) {
         setNeedsLayoutAndPrefWidthsRecalc();
-        m_knownNotToUseFallbackFonts = false;
+        m_knownToHaveNoOverflowAndNoFallbackFonts = false;
+    }
+
+    bool needsResetText = false;
+    if (!oldStyle) {
+        updateNeedsTranscoding();
+        needsResetText = m_needsTranscoding;
     }
 
     ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
     ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
-
-    if (oldTransform != style()->textTransform() || oldSecurity != style()->textSecurity()) {
+    if (needsResetText || oldTransform != style()->textTransform() || oldSecurity != style()->textSecurity()) {
         if (RefPtr<StringImpl> textToTransform = originalText())
             setText(textToTransform.release(), true);
     }
@@ -150,9 +193,9 @@
     if (box == m_firstTextBox)
         m_firstTextBox = 0;
     if (box->prevTextBox())
-        box->prevTextBox()->setNextLineBox(0);
-    box->setPreviousLineBox(0);
-    for (InlineRunBox* curr = box; curr; curr = curr->nextLineBox())
+        box->prevTextBox()->setNextTextBox(0);
+    box->setPreviousTextBox(0);
+    for (InlineTextBox* curr = box; curr; curr = curr->nextTextBox())
         curr->setExtracted();
 
     checkConsistency();
@@ -163,8 +206,8 @@
     checkConsistency();
 
     if (m_lastTextBox) {
-        m_lastTextBox->setNextLineBox(box);
-        box->setPreviousLineBox(m_lastTextBox);
+        m_lastTextBox->setNextTextBox(box);
+        box->setPreviousTextBox(m_lastTextBox);
     } else
         m_firstTextBox = box;
     InlineTextBox* last = box;
@@ -186,9 +229,9 @@
     if (box == m_lastTextBox)
         m_lastTextBox = box->prevTextBox();
     if (box->nextTextBox())
-        box->nextTextBox()->setPreviousLineBox(box->prevTextBox());
+        box->nextTextBox()->setPreviousTextBox(box->prevTextBox());
     if (box->prevTextBox())
-        box->prevTextBox()->setNextLineBox(box->nextTextBox());
+        box->prevTextBox()->setNextTextBox(box->nextTextBox());
 
     checkConsistency();
 }
@@ -434,7 +477,7 @@
     return IntRect(left, top, caretWidth, height);
 }
 
-ALWAYS_INLINE int RenderText::widthFromCache(const Font& f, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts) const
+ALWAYS_INLINE int RenderText::widthFromCache(const Font& f, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     if (f.isFixedPitch() && !f.isSmallCaps() && m_isAllASCII) {
         int monospaceCharacterWidth = f.spaceWidth();
@@ -442,8 +485,10 @@
         int w = 0;
         bool isSpace;
         bool previousCharWasSpace = true; // FIXME: Preserves historical behavior, but seems wrong for start > 0.
+        ASSERT(m_text);
+        StringImpl& text = *m_text.impl();
         for (int i = start; i < start + len; i++) {
-            char c = (*m_text)[i];
+            char c = text[i];
             if (c <= ' ') {
                 if (c == ' ' || c == '\n') {
                     w += monospaceCharacterWidth;
@@ -464,7 +509,7 @@
         return w;
     }
 
-    return f.width(TextRun(text()->characters() + start, len, allowTabs(), xPos), fallbackFonts);
+    return f.width(TextRun(text()->characters() + start, len, allowTabs(), xPos), fallbackFonts, glyphOverflow);
 }
 
 void RenderText::trimmedPrefWidths(int leadWidth,
@@ -486,7 +531,7 @@
 
     int len = textLength();
 
-    if (!len || (stripFrontSpaces && m_text->containsOnlyWhitespace())) {
+    if (!len || (stripFrontSpaces && text()->containsOnlyWhitespace())) {
         beginMinW = 0;
         endMinW = 0;
         beginMaxW = 0;
@@ -506,7 +551,9 @@
     hasBreakableChar = m_hasBreakableChar;
     hasBreak = m_hasBreak;
 
-    if ((*m_text)[0] == ' ' || ((*m_text)[0] == '\n' && !style()->preserveNewline()) || (*m_text)[0] == '\t') {
+    ASSERT(m_text);
+    StringImpl& text = *m_text.impl();
+    if (text[0] == ' ' || (text[0] == '\n' && !style()->preserveNewline()) || text[0] == '\t') {
         const Font& f = style()->font(); // FIXME: This ignores first-line.
         if (stripFrontSpaces) {
             const UChar space = ' ';
@@ -529,11 +576,11 @@
         endMaxW = maxW;
         for (int i = 0; i < len; i++) {
             int linelen = 0;
-            while (i + linelen < len && (*m_text)[i + linelen] != '\n')
+            while (i + linelen < len && text[i + linelen] != '\n')
                 linelen++;
 
             if (linelen) {
-                endMaxW = widthFromCache(f, i, linelen, leadWidth + endMaxW, 0);
+                endMaxW = widthFromCache(f, i, linelen, leadWidth + endMaxW, 0, 0);
                 if (firstLine) {
                     firstLine = false;
                     leadWidth = 0;
@@ -578,14 +625,15 @@
 void RenderText::calcPrefWidths(int leadWidth)
 {
     HashSet<const SimpleFontData*> fallbackFonts;
-    calcPrefWidths(leadWidth, fallbackFonts);
-    if (fallbackFonts.isEmpty())
-        m_knownNotToUseFallbackFonts = true;
+    GlyphOverflow glyphOverflow;
+    calcPrefWidths(leadWidth, fallbackFonts, glyphOverflow);
+    if (fallbackFonts.isEmpty() && !glyphOverflow.left && !glyphOverflow.right && !glyphOverflow.top && !glyphOverflow.bottom)
+        m_knownToHaveNoOverflowAndNoFallbackFonts = true;
 }
 
-void RenderText::calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts)
+void RenderText::calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
 {
-    ASSERT(m_hasTab || prefWidthsDirty() || !m_knownNotToUseFallbackFonts);
+    ASSERT(m_hasTab || prefWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts);
 
     m_minWidth = 0;
     m_beginMinWidth = 0;
@@ -615,6 +663,8 @@
     int nextBreakable = -1;
     int lastWordBoundary = 0;
 
+    int firstGlyphLeftOverflow = -1;
+
     bool breakNBSP = style()->autoWrap() && style()->nbspMode() == SPACE;
     bool breakAll = (style()->wordBreak() == BreakAllWordBreak || style()->wordBreak() == BreakWordBreak) && style()->autoWrap();
 
@@ -657,7 +707,9 @@
             lastWordBoundary++;
             continue;
         } else if (c == softHyphen) {
-            currMaxWidth += widthFromCache(f, lastWordBoundary, i - lastWordBoundary, leadWidth + currMaxWidth, &fallbackFonts);
+            currMaxWidth += widthFromCache(f, lastWordBoundary, i - lastWordBoundary, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow);
+            if (firstGlyphLeftOverflow < 0)
+                firstGlyphLeftOverflow = glyphOverflow.left;
             lastWordBoundary = i + 1;
             continue;
         }
@@ -680,13 +732,15 @@
 
         int wordLen = j - i;
         if (wordLen) {
-            int w = widthFromCache(f, i, wordLen, leadWidth + currMaxWidth, &fallbackFonts);
+            int w = widthFromCache(f, i, wordLen, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow);
+            if (firstGlyphLeftOverflow < 0)
+                firstGlyphLeftOverflow = glyphOverflow.left;
             currMinWidth += w;
             if (betweenWords) {
                 if (lastWordBoundary == i)
                     currMaxWidth += w;
                 else
-                    currMaxWidth += widthFromCache(f, lastWordBoundary, j - lastWordBoundary, leadWidth + currMaxWidth, &fallbackFonts);
+                    currMaxWidth += widthFromCache(f, lastWordBoundary, j - lastWordBoundary, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow);
                 lastWordBoundary = j;
             }
 
@@ -739,6 +793,7 @@
                 currMaxWidth = 0;
             } else {
                 currMaxWidth += f.width(TextRun(txt + i, 1, allowTabs(), leadWidth + currMaxWidth));
+                glyphOverflow.right = 0;
                 needsWordSpacing = isSpace && !previousCharacterIsSpace && i == len - 1;
             }
             ASSERT(lastWordBoundary == i);
@@ -746,6 +801,9 @@
         }
     }
 
+    if (firstGlyphLeftOverflow > 0)
+        glyphOverflow.left = firstGlyphLeftOverflow;
+
     if ((needsWordSpacing && len > 1) || (ignoringSpaces && !firstWord))
         currMaxWidth += wordSpacing;
 
@@ -777,9 +835,11 @@
     
 bool RenderText::containsOnlyWhitespace(unsigned from, unsigned len) const
 {
+    ASSERT(m_text);
+    StringImpl& text = *m_text.impl();
     unsigned currPos;
     for (currPos = from;
-         currPos < from + len && ((*m_text)[currPos] == '\n' || (*m_text)[currPos] == ' ' || (*m_text)[currPos] == '\t');
+         currPos < from + len && (text[currPos] == '\n' || text[currPos] == ' ' || text[currPos] == '\t');
          currPos++) { }
     return currPos >= (from + len);
 }
@@ -912,7 +972,7 @@
     setText(text, force);
 }
 
-static inline bool isInlineFlowOrEmptyText(RenderObject* o)
+static inline bool isInlineFlowOrEmptyText(const RenderObject* o)
 {
     if (o->isRenderInline())
         return true;
@@ -924,10 +984,10 @@
     return !text->length();
 }
 
-UChar RenderText::previousCharacter()
+UChar RenderText::previousCharacter() const
 {
     // find previous text renderer if one exists
-    RenderObject* previousText = this;
+    const RenderObject* previousText = this;
     while ((previousText = previousText->previousInPreOrder()))
         if (!isInlineFlowOrEmptyText(previousText))
             break;
@@ -938,10 +998,31 @@
     return prev;
 }
 
+void RenderText::transformText(String& text) const
+{
+    ASSERT(style());
+    switch (style()->textTransform()) {
+    case TTNONE:
+        break;
+    case CAPITALIZE:
+        makeCapitalized(&text, previousCharacter());
+        break;
+    case UPPERCASE:
+        text.makeUpper();
+        break;
+    case LOWERCASE:
+        text.makeLower();
+        break;
+    }
+}
+
 void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
 {
     ASSERT(text);
-    m_text = document()->displayStringModifiedByEncoding(text);
+    if (m_needsTranscoding)
+        m_text = document()->displayStringModifiedByEncoding(text);
+    else
+        m_text = text;
     ASSERT(m_text);
 
 #if ENABLE(SVG)
@@ -952,7 +1033,7 @@
             // characters into space characters. Then, it will draw all space characters, including
             // leading, trailing and multiple contiguous space characters.
 
-            m_text = m_text->replace('\n', ' ');
+            m_text.replace('\n', ' ');
 
             // If xml:space="preserve" is set, white-space is set to "pre", which
             // preserves leading, trailing & contiguous space character for us.
@@ -963,70 +1044,71 @@
             // Then, it will strip off all leading and trailing space characters.
             // Then, all contiguous space characters will be consolidated.    
 
-           m_text = m_text->replace('\n', StringImpl::empty());
+           m_text.replace('\n', StringImpl::empty());
 
            // If xml:space="default" is set, white-space is set to "nowrap", which handles
            // leading, trailing & contiguous space character removal for us.
         }
 
-        m_text = m_text->replace('\t', ' ');
+        m_text.replace('\t', ' ');
     }
 #endif
 
     if (style()) {
-        switch (style()->textTransform()) {
-            case TTNONE:
-                break;
-            case CAPITALIZE: {
-                m_text = m_text->capitalize(previousCharacter());
-                break;
-            }
-            case UPPERCASE:
-                m_text = m_text->upper();
-                break;
-            case LOWERCASE:
-                m_text = m_text->lower();
-                break;
-        }
+        transformText(m_text);
 
         // We use the same characters here as for list markers.
         // See the listMarkerText function in RenderListMarker.cpp.
         switch (style()->textSecurity()) {
-            case TSNONE:
-                break;
-            case TSCIRCLE:
-                m_text = m_text->secure(whiteBullet);
-                break;
-            case TSDISC:
-                m_text = m_text->secure(bullet);
-                break;
-            case TSSQUARE:
-                m_text = m_text->secure(blackSquare);
+        case TSNONE:
+            break;
+        case TSCIRCLE:
+            m_text.makeSecure(whiteBullet);
+            break;
+        case TSDISC:
+            m_text.makeSecure(bullet);
+            break;
+        case TSSQUARE:
+            m_text.makeSecure(blackSquare);
         }
     }
 
     ASSERT(m_text);
-    ASSERT(!isBR() || (textLength() == 1 && (*m_text)[0] == '\n'));
+    ASSERT(!isBR() || (textLength() == 1 && m_text[0] == '\n'));
 
-    m_isAllASCII = charactersAreAllASCII(m_text.get());
+    m_isAllASCII = m_text.containsOnlyASCII();
 }
 
 void RenderText::setText(PassRefPtr<StringImpl> text, bool force)
 {
     ASSERT(text);
 
-    if (!force && equal(m_text.get(), text.get()))
+    if (!force && equal(m_text.impl(), text.get()))
         return;
 
     setTextInternal(text);
     setNeedsLayoutAndPrefWidthsRecalc();
-    m_knownNotToUseFallbackFonts = false;
+    m_knownToHaveNoOverflowAndNoFallbackFonts = false;
     
     AXObjectCache* axObjectCache = document()->axObjectCache();
     if (axObjectCache->accessibilityEnabled())
         axObjectCache->contentChanged(this);
 }
 
+String RenderText::textWithoutTranscoding() const
+{
+    // If m_text isn't transcoded or is secure, we can just return the modified text.
+    if (!m_needsTranscoding || style()->textSecurity() != TSNONE)
+        return text();
+
+    // Otherwise, we should use original text. If text-transform is
+    // specified, we should transform the text on the fly.
+    String text = originalText();
+    if (style())
+        transformText(text);
+    return text;
+}
+
 int RenderText::lineHeight(bool firstLine, bool) const
 {
     // Always use the interior line height of the parent (e.g., if our parent is an inline block).
@@ -1055,8 +1137,8 @@
     if (!m_firstTextBox)
         m_firstTextBox = m_lastTextBox = textBox;
     else {
-        m_lastTextBox->setNextLineBox(textBox);
-        textBox->setPreviousLineBox(m_lastTextBox);
+        m_lastTextBox->setNextTextBox(textBox);
+        textBox->setPreviousTextBox(m_lastTextBox);
         m_lastTextBox = textBox;
     }
     textBox->setIsText(true);
@@ -1074,11 +1156,11 @@
         if (m_firstTextBox == s)
             m_firstTextBox = s->nextTextBox();
         else
-            s->prevTextBox()->setNextLineBox(s->nextTextBox());
+            s->prevTextBox()->setNextTextBox(s->nextTextBox());
         if (m_lastTextBox == s)
             m_lastTextBox = s->prevTextBox();
         else
-            s->nextTextBox()->setPreviousLineBox(s->prevTextBox());
+            s->nextTextBox()->setPreviousTextBox(s->prevTextBox());
         s->destroy(renderArena());
         return;
     }
@@ -1086,7 +1168,7 @@
     m_containsReversedText |= s->direction() == RTL;
 }
 
-unsigned RenderText::width(unsigned from, unsigned len, int xPos, bool firstLine, HashSet<const SimpleFontData*>* fallbackFonts) const
+unsigned RenderText::width(unsigned from, unsigned len, int xPos, bool firstLine, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     if (from >= textLength())
         return 0;
@@ -1094,10 +1176,10 @@
     if (from + len > textLength())
         len = textLength() - from;
 
-    return width(from, len, style(firstLine)->font(), xPos, fallbackFonts);
+    return width(from, len, style(firstLine)->font(), xPos, fallbackFonts, glyphOverflow);
 }
 
-unsigned RenderText::width(unsigned from, unsigned len, const Font& f, int xPos, HashSet<const SimpleFontData*>* fallbackFonts) const
+unsigned RenderText::width(unsigned from, unsigned len, const Font& f, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
 {
     ASSERT(from + len <= textLength());
     if (!characters())
@@ -1107,18 +1189,19 @@
     if (&f == &style()->font()) {
         if (!style()->preserveNewline() && !from && len == textLength()) {
             if (fallbackFonts) {
-                if (prefWidthsDirty() || !m_knownNotToUseFallbackFonts) {
-                    const_cast<RenderText*>(this)->calcPrefWidths(0, *fallbackFonts);
-                    if (fallbackFonts->isEmpty())
-                        m_knownNotToUseFallbackFonts = true;
+                ASSERT(glyphOverflow);
+                if (prefWidthsDirty() || !m_knownToHaveNoOverflowAndNoFallbackFonts) {
+                    const_cast<RenderText*>(this)->calcPrefWidths(0, *fallbackFonts, *glyphOverflow);
+                    if (fallbackFonts->isEmpty() && !glyphOverflow->left && !glyphOverflow->right && !glyphOverflow->top && !glyphOverflow->bottom)
+                        m_knownToHaveNoOverflowAndNoFallbackFonts = true;
                 }
                 w = m_maxWidth;
             } else
                 w = maxPrefWidth();
         } else
-            w = widthFromCache(f, from, len, xPos, fallbackFonts);
+            w = widthFromCache(f, from, len, xPos, fallbackFonts, glyphOverflow);
     } else
-        w = f.width(TextRun(text()->characters() + from, len, allowTabs(), xPos), fallbackFonts);
+        w = f.width(TextRun(text()->characters() + from, len, allowTabs(), xPos), fallbackFonts, glyphOverflow);
 
     return w;
 }
@@ -1150,6 +1233,11 @@
 IntRect RenderText::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
 {
     RenderObject* cb = containingBlock();
+    // The containing block may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint.
+    if (repaintContainer && repaintContainer != cb) {
+        if (!cb->isDescendantOf(repaintContainer))
+            return repaintContainer->clippedOverflowRectForRepaint(repaintContainer);
+    }
     return cb->clippedOverflowRectForRepaint(repaintContainer);
 }
 
@@ -1245,7 +1333,7 @@
 
 int RenderText::previousOffset(int current) const
 {
-    StringImpl* si = m_text.get();
+    StringImpl* si = m_text.impl();
     TextBreakIterator* iterator = cursorMovementIterator(si->characters(), si->length());
     if (!iterator)
         return current - 1;
@@ -1293,14 +1381,16 @@
 int RenderText::previousOffsetForBackwardDeletion(int current) const
 {
 #if PLATFORM(MAC)
+    ASSERT(m_text);
+    StringImpl& text = *m_text.impl();
     UChar32 character;
     while (current > 0) {
-        if (U16_IS_TRAIL((*m_text)[--current]))
+        if (U16_IS_TRAIL(text[--current]))
             --current;
         if (current < 0)
             break;
 
-        UChar32 character = m_text->characterStartingAt(current);
+        UChar32 character = text.characterStartingAt(current);
 
         // We don't combine characters in Armenian ... Limbu range for backward deletion.
         if ((character >= 0x0530) && (character < 0x1950))
@@ -1314,7 +1404,7 @@
         return current;
 
     // Hangul
-    character = m_text->characterStartingAt(current);
+    character = text.characterStartingAt(current);
     if (((character >= HANGUL_CHOSEONG_START) && (character <= HANGUL_JONGSEONG_END)) || ((character >= HANGUL_SYLLABLE_START) && (character <= HANGUL_SYLLABLE_END))) {
         HangulState state;
         HangulState initialState;
@@ -1330,7 +1420,7 @@
 
         initialState = state;
 
-        while (current > 0 && ((character = m_text->characterStartingAt(current - 1)) >= HANGUL_CHOSEONG_START) && (character <= HANGUL_SYLLABLE_END) && ((character <= HANGUL_JONGSEONG_END) || (character >= HANGUL_SYLLABLE_START))) {
+        while (current > 0 && ((character = text.characterStartingAt(current - 1)) >= HANGUL_CHOSEONG_START) && (character <= HANGUL_SYLLABLE_END) && ((character <= HANGUL_JONGSEONG_END) || (character >= HANGUL_SYLLABLE_START))) {
             switch (state) {
             case HangulStateV:
                 if (character <= HANGUL_CHOSEONG_END)
@@ -1368,7 +1458,7 @@
 
 int RenderText::nextOffset(int current) const
 {
-    StringImpl* si = m_text.get();
+    StringImpl* si = m_text.impl();
     TextBreakIterator* iterator = cursorMovementIterator(si->characters(), si->length());
     if (!iterator)
         return current + 1;
diff --git a/WebCore/rendering/RenderText.h b/WebCore/rendering/RenderText.h
index d46bce9..92c82e1 100644
--- a/WebCore/rendering/RenderText.h
+++ b/WebCore/rendering/RenderText.h
@@ -50,7 +50,8 @@
 
     virtual void destroy();
 
-    StringImpl* text() const { return m_text.get(); }
+    StringImpl* text() const { return m_text.impl(); }
+    String textWithoutTranscoding() const;
 
     InlineTextBox* createInlineTextBox();
     void dirtyLineBoxes(bool fullLayout);
@@ -63,12 +64,12 @@
 
     virtual VisiblePosition positionForPoint(const IntPoint&);
 
-    const UChar* characters() const { return m_text->characters(); }
-    unsigned textLength() const { return m_text->length(); } // non virtual implementation of length()
+    const UChar* characters() const { return m_text.characters(); }
+    unsigned textLength() const { return m_text.length(); } // non virtual implementation of length()
     void positionLineBox(InlineBox*);
 
-    virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos, HashSet<const SimpleFontData*>* fallbackFonts = 0) const;
-    virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0) const;
+    virtual unsigned width(unsigned from, unsigned len, const Font&, int xPos, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
+    virtual unsigned width(unsigned from, unsigned len, int xPos, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
 
     virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const;
 
@@ -128,12 +129,12 @@
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
     virtual void setTextInternal(PassRefPtr<StringImpl>);
-    virtual UChar previousCharacter();
+    virtual UChar previousCharacter() const;
     
     virtual InlineTextBox* createTextBox(); // Subclassed by SVG.
 
 private:
-    void calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts);
+    void calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&);
 
     // Make length() private so that callers that have a RenderText*
     // will use the more efficient textLength() instead, while
@@ -146,12 +147,15 @@
 
     void deleteTextBoxes();
     bool containsOnlyWhitespace(unsigned from, unsigned len) const;
-    int widthFromCache(const Font&, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts) const;
+    int widthFromCache(const Font&, int start, int len, int xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
     bool isAllASCII() const { return m_isAllASCII; }
+    void updateNeedsTranscoding();
+
+    inline void transformText(String&) const;
 
     int m_minWidth; // here to minimize padding in 64-bit.
 
-    RefPtr<StringImpl> m_text;
+    String m_text;
 
     InlineTextBox* m_firstTextBox;
     InlineTextBox* m_lastTextBox;
@@ -171,7 +175,8 @@
                            // or removed).
     bool m_containsReversedText : 1;
     bool m_isAllASCII : 1;
-    mutable bool m_knownNotToUseFallbackFonts : 1;
+    mutable bool m_knownToHaveNoOverflowAndNoFallbackFonts : 1;
+    bool m_needsTranscoding : 1;
 };
 
 inline RenderText* toRenderText(RenderObject* object)
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index d18940b..5e19362 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -167,15 +167,7 @@
 
 void RenderTextControl::setInnerTextValue(const String& innerTextValue)
 {
-    String value;
-
-    if (innerTextValue.isNull())
-        value = "";
-    else {
-        value = innerTextValue; 
-        value = document()->displayStringModifiedByEncoding(value);
-    }
-
+    String value = innerTextValue;
     if (value != text() || !m_innerText->hasChildNodes()) {
         if (value != text()) {
             if (Frame* frame = document()->frame()) {
@@ -266,11 +258,6 @@
 
     if (Frame* frame = document()->frame())
         frame->selection()->setSelection(newSelection);
-
-    // FIXME: Granularity is stored separately on the frame, but also in the selection controller.
-    // The granularity in the selection controller should be used, and then this line of code would not be needed.
-    if (Frame* frame = document()->frame())
-        frame->setSelectionGranularity(CharacterGranularity);
 }
 
 VisibleSelection RenderTextControl::selection(int start, int end) const
@@ -323,9 +310,6 @@
     if (size && result[size - 1] == '\n')
         result.shrink(--size);
 
-    // Convert backslash to currency symbol.
-    document()->displayBufferModifiedByEncoding(result.data(), result.size());
-    
     return String::adopt(result);
 }
 
@@ -373,8 +357,6 @@
     if (!firstChild)
         return "";
 
-    document()->updateLayout();
-
     RenderObject* renderer = firstChild->renderer();
     if (!renderer)
         return "";
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index aa1f1e3..e1bcc84 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -101,6 +101,7 @@
     virtual void valueChanged(unsigned listIndex, bool fireEvents = true);
     virtual String itemText(unsigned listIndex) const;
     virtual String itemToolTip(unsigned) const { return String(); }
+    virtual String itemAccessibilityText(unsigned) const { return String(); }
     virtual bool itemIsEnabled(unsigned listIndex) const;
     virtual PopupMenuStyle itemStyle(unsigned listIndex) const;
     virtual PopupMenuStyle menuStyle() const;
diff --git a/WebCore/rendering/RenderTextFragment.cpp b/WebCore/rendering/RenderTextFragment.cpp
index 9ff1106..2164ae1 100644
--- a/WebCore/rendering/RenderTextFragment.cpp
+++ b/WebCore/rendering/RenderTextFragment.cpp
@@ -69,10 +69,14 @@
         m_firstLetter = 0;
         m_start = 0;
         m_end = textLength();
+        if (Node* t = node()) {
+            ASSERT(!t->renderer());
+            t->setRenderer(this);
+        }
     }
 }
 
-UChar RenderTextFragment::previousCharacter()
+UChar RenderTextFragment::previousCharacter() const
 {
     if (start()) {
         Node* e = node();
diff --git a/WebCore/rendering/RenderTextFragment.h b/WebCore/rendering/RenderTextFragment.h
index 1fa509a..e351436 100644
--- a/WebCore/rendering/RenderTextFragment.h
+++ b/WebCore/rendering/RenderTextFragment.h
@@ -51,7 +51,7 @@
 
 private:
     virtual void setTextInternal(PassRefPtr<StringImpl>);
-    virtual UChar previousCharacter();
+    virtual UChar previousCharacter() const;
 
     unsigned m_start;
     unsigned m_end;
diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp
index f1e564b..b3b7a1e 100644
--- a/WebCore/rendering/RenderTheme.cpp
+++ b/WebCore/rendering/RenderTheme.cpp
@@ -213,6 +213,10 @@
             return adjustSearchFieldResultsDecorationStyle(selector, style, e);
         case SearchFieldResultsButtonPart:
             return adjustSearchFieldResultsButtonStyle(selector, style, e);
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+            return adjustProgressBarStyle(selector, style, e);
+#endif
         default:
             break;
     }
@@ -271,6 +275,10 @@
 #endif
         case MenulistPart:
             return paintMenuList(o, paintInfo, r);
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+            return paintProgressBar(o, paintInfo, r);
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
             return paintSliderTrack(o, paintInfo, r);
@@ -361,6 +369,9 @@
         case DefaultButtonPart:
         case ButtonPart:
         case MenulistPart:
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
         case SliderThumbHorizontalPart:
@@ -396,6 +407,9 @@
         case DefaultButtonPart:
         case ButtonPart:
         case MenulistPart:
+#if ENABLE(PROGRESS_TAG)
+        case ProgressBarPart:
+#endif
         case SliderHorizontalPart:
         case SliderVerticalPart:
         case SliderThumbHorizontalPart:
@@ -829,6 +843,22 @@
 {
 }
 
+#if ENABLE(PROGRESS_TAG)
+double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress*) const
+{
+    return 0;
+}
+
+double RenderTheme::animationDurationForProgressBar(RenderProgress*) const
+{
+    return 0;
+}
+
+void RenderTheme::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const
+{
+}
+#endif
+
 void RenderTheme::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const
 {
 }
diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h
index 32ae5e5..1526138 100644
--- a/WebCore/rendering/RenderTheme.h
+++ b/WebCore/rendering/RenderTheme.h
@@ -39,6 +39,9 @@
 class Element;
 class PopupMenu;
 class RenderMenuList;
+#if ENABLE(PROGRESS_TAG)
+class RenderProgress;
+#endif
 class CSSStyleSheet;
 
 class RenderTheme : public RefCounted<RenderTheme> {
@@ -169,6 +172,13 @@
     // Method for painting the caps lock indicator
     virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return 0; };
 
+#if ENABLE(PROGRESS_TAG)
+    // Returns the repeat interval of the animation for the progress bar.
+    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
+    // Returns the duration of the animation for the progress bar.
+    virtual double animationDurationForProgressBar(RenderProgress*) const;
+#endif
+
 #if ENABLE(VIDEO)
     // Media controls
     virtual bool hitTestMediaControlPart(RenderObject*, const IntPoint& absPoint);
@@ -230,6 +240,11 @@
     virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
 
+#if ENABLE(PROGRESS_TAG)
+    virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintProgressBar(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
+#endif
+
     virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
 
diff --git a/WebCore/rendering/RenderThemeChromiumSkia.cpp b/WebCore/rendering/RenderThemeChromiumSkia.cpp
index 7d3bcec..8b3b388 100644
--- a/WebCore/rendering/RenderThemeChromiumSkia.cpp
+++ b/WebCore/rendering/RenderThemeChromiumSkia.cpp
@@ -403,28 +403,41 @@
     style->setHeight(Length(cancelButtonSize, Fixed));
 }
 
-bool RenderThemeChromiumSkia::paintSearchFieldCancelButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+IntRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const
 {
-    IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent() || !o->parent()->isBox())
+    // Compute an offset between the part renderer and the input renderer.
+    IntSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));
+    // Move the rect into partRenderer's coords.
+    partRect.move(offsetFromInputRenderer);
+    // Account for the local drawing offset.
+    partRect.move(localOffset.x(), localOffset.y());
+
+    return partRect;
+}
+
+bool RenderThemeChromiumSkia::paintSearchFieldCancelButton(RenderObject* cancelButtonObject, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+    // Get the renderer of <input> element.
+    Node* input = cancelButtonObject->node()->shadowAncestorNode();
+    if (!input->renderer()->isBox())
         return false;
+    RenderBox* inputRenderBox = toRenderBox(input->renderer());
+    IntRect inputContentBox = inputRenderBox->contentBoxRect();
 
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
-
-    IntRect parentBox = parentRenderBox->absoluteContentBox();
-
-    // Make sure the scaled button stays square and will fit in its parent's box
-    bounds.setHeight(std::min(parentBox.width(), std::min(parentBox.height(), bounds.height())));
-    bounds.setWidth(bounds.height());
-
+    // Make sure the scaled button stays square and will fit in its parent's box.
+    int cancelButtonSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
+    // Calculate cancel 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.
-    bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
+    IntRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
+                             inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
+                             cancelButtonSize, cancelButtonSize);
+    IntRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
 
     static Image* cancelImage = Image::loadPlatformResource("searchCancel").releaseRef();
     static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").releaseRef();
-    i.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style()->colorSpace(), bounds);
+    paintInfo.context->drawImage(isPressed(cancelButtonObject) ? cancelPressedImage : cancelImage,
+                                 cancelButtonObject->style()->colorSpace(), paintingRect);
     return false;
 }
 
@@ -445,26 +458,27 @@
     style->setHeight(Length(magnifierSize, Fixed));
 }
 
-bool RenderThemeChromiumSkia::paintSearchFieldResultsDecoration(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+bool RenderThemeChromiumSkia::paintSearchFieldResultsDecoration(RenderObject* magnifierObject, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
-    IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent() || !o->parent()->isBox())
+    // Get the renderer of <input> element.
+    Node* input = magnifierObject->node()->shadowAncestorNode();
+    if (!input->renderer()->isBox())
         return false;
+    RenderBox* inputRenderBox = toRenderBox(input->renderer());
+    IntRect inputContentBox = inputRenderBox->contentBoxRect();
 
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
-    IntRect parentBox = parentRenderBox->absoluteContentBox();
-
-    // Make sure the scaled decoration stays square and will fit in its parent's box
-    bounds.setHeight(std::min(parentBox.width(), std::min(parentBox.height(), bounds.height())));
-    bounds.setWidth(bounds.height());
-
+    // Make sure the scaled decoration stays square and will fit in its parent's box.
+    int magnifierSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
+    // Calculate decoration's coordinates relative to the input element.
     // Center the decoration 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.
-    bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
+    IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
+                          inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2,
+                          magnifierSize, magnifierSize);
+    IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
 
     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").releaseRef();
-    i.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
+    paintInfo.context->drawImage(magnifierImage, magnifierObject->style()->colorSpace(), paintingRect);
     return false;
 }
 
@@ -479,28 +493,25 @@
     style->setHeight(Length(magnifierHeight, Fixed));
 }
 
-bool RenderThemeChromiumSkia::paintSearchFieldResultsButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+bool RenderThemeChromiumSkia::paintSearchFieldResultsButton(RenderObject* magnifierObject, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
-    IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent())
+    // Get the renderer of <input> element.
+    Node* input = magnifierObject->node()->shadowAncestorNode();
+    if (!input->renderer()->isBox())
         return false;
-    if (!o->parent() || !o->parent()->isBox())
-        return false;
+    RenderBox* inputRenderBox = toRenderBox(input->renderer());
+    IntRect inputContentBox = inputRenderBox->contentBoxRect();
 
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
-    IntRect parentBox = parentRenderBox->absoluteContentBox();
-
-    // Make sure the scaled decoration will fit in its parent's box
-    bounds.setHeight(std::min(parentBox.height(), bounds.height()));
-    bounds.setWidth(std::min(parentBox.width(), static_cast<int>(bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize)));
-
-    // 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.
-    bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
+    // Make sure the scaled decoration will fit in its parent's box.
+    int magnifierHeight = std::min(inputContentBox.height(), r.height());
+    int magnifierWidth = std::min(inputContentBox.width(), static_cast<int>(magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
+    IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
+                          inputContentBox.y() + (inputContentBox.height() - magnifierHeight + 1) / 2,
+                          magnifierWidth, magnifierHeight);
+    IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
 
     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").releaseRef();
-    i.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
+    paintInfo.context->drawImage(magnifierImage, magnifierObject->style()->colorSpace(), paintingRect);
     return false;
 }
 
@@ -721,26 +732,6 @@
     return menuListInternalPadding(style, BottomPadding);
 }
 
-int RenderThemeChromiumSkia::buttonInternalPaddingLeft() const
-{
-    return 3;
-}
-
-int RenderThemeChromiumSkia::buttonInternalPaddingRight() const
-{
-    return 3;
-}
-
-int RenderThemeChromiumSkia::buttonInternalPaddingTop() const
-{
-    return 1;
-}
-
-int RenderThemeChromiumSkia::buttonInternalPaddingBottom() const
-{
-    return 1;
-}
-
 #if ENABLE(VIDEO)
 bool RenderThemeChromiumSkia::shouldRenderMediaControlPart(ControlPart part, Element* e)
 {
diff --git a/WebCore/rendering/RenderThemeChromiumSkia.h b/WebCore/rendering/RenderThemeChromiumSkia.h
index 18fa859..dc920b1cf 100644
--- a/WebCore/rendering/RenderThemeChromiumSkia.h
+++ b/WebCore/rendering/RenderThemeChromiumSkia.h
@@ -123,11 +123,6 @@
         virtual int popupInternalPaddingTop(RenderStyle*) const;
         virtual int popupInternalPaddingBottom(RenderStyle*) const;
 
-        virtual int buttonInternalPaddingLeft() const;
-        virtual int buttonInternalPaddingRight() const;
-        virtual int buttonInternalPaddingTop() const;
-        virtual int buttonInternalPaddingBottom() const;
-
 #if ENABLE(VIDEO)
         // Media controls
         virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
@@ -153,6 +148,7 @@
     private:
         int menuListInternalPadding(RenderStyle*, int paddingType) const;
         bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
+        IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const;
     };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderThemeChromiumWin.h b/WebCore/rendering/RenderThemeChromiumWin.h
index 3b86980..bbc54a7 100644
--- a/WebCore/rendering/RenderThemeChromiumWin.h
+++ b/WebCore/rendering/RenderThemeChromiumWin.h
@@ -59,7 +59,7 @@
 
         // System fonts.
         virtual void systemFont(int propId, FontDescription&) const;
-        virtual Color systemColor(int cssValueId) const;

+        virtual Color systemColor(int cssValueId) const;
 
         virtual void adjustSliderThumbSize(RenderObject*) const;
 
diff --git a/WebCore/rendering/RenderThemeMac.h b/WebCore/rendering/RenderThemeMac.h
index 48c6c42..cba927f 100644
--- a/WebCore/rendering/RenderThemeMac.h
+++ b/WebCore/rendering/RenderThemeMac.h
@@ -27,6 +27,8 @@
 #import <wtf/HashMap.h>
 #import <wtf/RetainPtr.h>
 
+class RenderProgress;
+
 #ifdef __OBJC__
 @class WebCoreRenderThemeNotificationObserver;
 #else
@@ -78,6 +80,13 @@
     
     virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
 
+#if ENABLE(PROGRESS_TAG)
+    // Returns the repeat interval of the animation for the progress bar.
+    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
+    // Returns the duration of the animation for the progress bar.
+    virtual double animationDurationForProgressBar(RenderProgress*) const;
+#endif
+
     virtual Color systemColor(int cssValueId) const;
 
 protected:
@@ -95,6 +104,11 @@
     virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
+#if ENABLE(PROGRESS_TAG)
+    virtual void adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+    virtual bool paintProgressBar(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+#endif
+
     virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
diff --git a/WebCore/rendering/RenderThemeMac.mm b/WebCore/rendering/RenderThemeMac.mm
index b6ce93d..c0d8020 100644
--- a/WebCore/rendering/RenderThemeMac.mm
+++ b/WebCore/rendering/RenderThemeMac.mm
@@ -32,6 +32,7 @@
 #import "HTMLMediaElement.h"
 #import "HTMLNames.h"
 #import "Image.h"
+#import "ImageBuffer.h"
 #import "LocalCurrentGraphicsContext.h"
 #import "MediaControlElements.h"
 #import "RenderMedia.h"
@@ -39,6 +40,7 @@
 #import "RenderView.h"
 #import "SharedBuffer.h"
 #import "TimeRanges.h"
+#import "ThemeMac.h"
 #import "WebCoreSystemInterface.h"
 #import "UserAgentStyleSheets.h"
 #import <Carbon/Carbon.h>
@@ -47,17 +49,26 @@
 #import <wtf/StdLibExtras.h>
 #import <math.h>
 
+#import "RenderProgress.h"
+
 #ifdef BUILDING_ON_TIGER
 typedef int NSInteger;
 typedef unsigned NSUInteger;
 #endif
 
-using std::min;
+using namespace std;
 
 // The methods in this file are specific to the Mac OS X platform.
 
 // FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeSafari. 
 
+// We estimate the animation rate of a Mac OS X progress bar is 33 fps.
+// Hard code the value here because we haven't found API for it.
+const double progressAnimationFrameRate = 0.033;
+
+// Mac OS X progress bar animation seems to have 256 frames.
+const double progressAnimationNumFrames = 256;
+
 @interface WebCoreRenderThemeNotificationObserver : NSObject
 {
     WebCore::RenderTheme *_theme;
@@ -735,6 +746,7 @@
 
 bool RenderThemeMac::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
 {
+    LocalCurrentGraphicsContext localContext(paintInfo.context);
     setPopupButtonCellState(o, r);
 
     NSPopUpButtonCell* popupButton = this->popupButton();
@@ -764,13 +776,64 @@
         paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y());
     }
 
-    [popupButton drawWithFrame:inflatedRect inView:o->view()->frameView()->documentView()];
+    [popupButton drawWithFrame:inflatedRect inView:ThemeMac::ensuredView(o->view()->frameView())];
     [popupButton setControlView:nil];
 
     paintInfo.context->restore();
 
     return false;
 }
+   
+#if ENABLE(PROGRESS_TAG)
+
+double RenderThemeMac::animationRepeatIntervalForProgressBar(RenderProgress*) const
+{
+    return progressAnimationFrameRate;
+}
+
+double RenderThemeMac::animationDurationForProgressBar(RenderProgress*) const
+{
+    return progressAnimationNumFrames * progressAnimationFrameRate;
+}
+
+void RenderThemeMac::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle*, Element*) const
+{
+}
+
+bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+    RenderProgress* renderProgress = toRenderProgress(renderObject);
+    HIThemeTrackDrawInfo trackInfo;
+    trackInfo.version = 0;
+    trackInfo.kind = renderProgress->position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
+    trackInfo.bounds = IntRect(IntPoint(), rect.size());
+    trackInfo.min = 0;
+    trackInfo.max = numeric_limits<SInt32>::max();
+    trackInfo.value = lround(renderProgress->position() * nextafter(trackInfo.max, 0));
+    trackInfo.trackInfo.progress.phase = lround(renderProgress->animationProgress() * nextafter(progressAnimationNumFrames, 0));
+    trackInfo.attributes = kThemeTrackHorizontal;
+    trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive;
+    trackInfo.reserved = 0;
+    trackInfo.filler1 = 0;
+
+    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(rect.size());
+    if (!imageBuffer)
+        return true;
+
+    HIThemeDrawTrack(&trackInfo, 0, imageBuffer->context()->platformContext(), kHIThemeOrientationNormal);
+
+    paintInfo.context->save();
+
+    if (renderProgress->style()->direction() == RTL) {
+        paintInfo.context->translate(2 * rect.x() + rect.width(), 0);
+        paintInfo.context->scale(FloatSize(-1, 1));
+    }
+    paintInfo.context->drawImage(imageBuffer->image(), DeviceColorSpace, rect.location());
+
+    paintInfo.context->restore();
+    return false;
+}    
+#endif
 
 const float baseFontSize = 11.0f;
 const float baseArrowHeight = 4.0f;
@@ -1171,7 +1234,7 @@
         paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
     }
 
-    [sliderThumbCell drawWithFrame:unzoomedRect inView:o->view()->frameView()->documentView()];
+    [sliderThumbCell drawWithFrame:unzoomedRect inView:ThemeMac::ensuredView(o->view()->frameView())];
     [sliderThumbCell setControlView:nil];
 
     paintInfo.context->restore();
@@ -1203,7 +1266,7 @@
     // Set the search button to nil before drawing.  Then reset it so we can draw it later.
     [search setSearchButtonCell:nil];
 
-    [search drawWithFrame:NSRect(unzoomedRect) inView:o->view()->frameView()->documentView()];
+    [search drawWithFrame:NSRect(unzoomedRect) inView:ThemeMac::ensuredView(o->view()->frameView())];
 #ifdef BUILDING_ON_TIGER
     if ([search showsFirstResponder])
         wkDrawTextFieldCellFocusRing(search, NSRect(unzoomedRect));
@@ -1303,7 +1366,7 @@
         paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
     }
 
-    [[search cancelButtonCell] drawWithFrame:unzoomedRect inView:o->view()->frameView()->documentView()];
+    [[search cancelButtonCell] drawWithFrame:unzoomedRect inView:ThemeMac::ensuredView(o->view()->frameView())];
     [[search cancelButtonCell] setControlView:nil];
 
     paintInfo.context->restore();
@@ -1368,7 +1431,7 @@
     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->borderBoxRect())];
     localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
 
-    [[search searchButtonCell] drawWithFrame:localBounds inView:o->view()->frameView()->documentView()];
+    [[search searchButtonCell] drawWithFrame:localBounds inView:ThemeMac::ensuredView(o->view()->frameView())];
     [[search searchButtonCell] setControlView:nil];
     return false;
 }
@@ -1411,7 +1474,7 @@
         paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
     }
 
-    [[search searchButtonCell] drawWithFrame:unzoomedRect inView:o->view()->frameView()->documentView()];
+    [[search searchButtonCell] drawWithFrame:unzoomedRect inView:ThemeMac::ensuredView(o->view()->frameView())];
     [[search searchButtonCell] setControlView:nil];
     
     paintInfo.context->restore();
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index 164a656..75c35ba 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -28,7 +28,6 @@
 
 #include "CSSMutableStyleDeclaration.h"
 #include "CharacterNames.h"
-#include "CString.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -38,6 +37,7 @@
 #include "RenderBR.h"
 #include "RenderFileUploadControl.h"
 #include "RenderInline.h"
+#include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderPart.h"
 #include "RenderTableCell.h"
@@ -178,10 +178,13 @@
     return String::adopt(result);
 }
 
-static TextStream &operator<<(TextStream& ts, const RenderObject& o)
+static void writeRenderObject(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior)
 {
     ts << o.renderName();
 
+    if (behavior & RenderAsTextShowAddresses)
+        ts << " " << &o;
+
     if (o.style() && o.style()->zIndex())
         ts << " zI: " << o.style()->zIndex();
 
@@ -254,7 +257,7 @@
             ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]";
 
         if (!o.isBoxModelObject())
-            return ts;
+            return;
 
         const RenderBoxModelObject& box = *toRenderBoxModelObject(&o);
         if (box.borderTop() || box.borderRight() || box.borderBottom() || box.borderLeft()) {
@@ -367,8 +370,6 @@
         }
     }
 #endif
-
-    return ts;
 }
 
 static void writeTextRun(TextStream& ts, const RenderText& o, const InlineTextBox& run)
@@ -388,7 +389,7 @@
         << "\n";
 }
 
-void write(TextStream& ts, const RenderObject& o, int indent)
+void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior)
 {
 #if ENABLE(SVG)
     if (o.isRenderPath()) {
@@ -422,7 +423,8 @@
 
     writeIndent(ts, indent);
 
-    ts << o << "\n";
+    writeRenderObject(ts, o, behavior);
+    ts << "\n";
 
     if (o.isText() && !o.isBR()) {
         const RenderText& text = *toRenderText(&o);
@@ -435,7 +437,7 @@
     for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) {
         if (child->hasLayer())
             continue;
-        write(ts, *child, indent + 1);
+        write(ts, *child, indent + 1, behavior);
     }
 
     if (o.isWidget()) {
@@ -447,7 +449,7 @@
                 view->layout();
                 RenderLayer* l = root->layer();
                 if (l)
-                    writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1);
+                    writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1, behavior);
             }
         }
     }
@@ -465,7 +467,12 @@
 {
     writeIndent(ts, indent);
 
-    ts << "layer " << layerBounds;
+    ts << "layer ";
+    
+    if (behavior & RenderAsTextShowAddresses)
+        ts << &l << " ";
+      
+    ts << layerBounds;
 
     if (!layerBounds.isEmpty()) {
         if (!backgroundClipRect.contains(layerBounds))
@@ -504,7 +511,7 @@
     ts << "\n";
 
     if (paintPhase != LayerPaintPhaseBackground)
-        write(ts, *l.renderer(), indent + 1);
+        write(ts, *l.renderer(), indent + 1, behavior);
 }
 
 static void writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLayer* l,
@@ -654,4 +661,17 @@
     return stream.release();
 }
 
+String markerTextForListItem(Element* element)
+{
+    // Make sure the element is not freed during the layout.
+    RefPtr<Element> elementRef(element);
+    element->document()->updateLayout();
+
+    RenderObject* renderer = element->renderer();
+    if (!renderer || !renderer->isListItem())
+        return String();
+
+    return toRenderListItem(renderer)->markerText();
+}
+
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderTreeAsText.h b/WebCore/rendering/RenderTreeAsText.h
index 13525e7..4da0bab 100644
--- a/WebCore/rendering/RenderTreeAsText.h
+++ b/WebCore/rendering/RenderTreeAsText.h
@@ -38,18 +38,21 @@
     RenderAsTextBehaviorNormal = 0,
     RenderAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that would paint.
     RenderAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists.
-    RenderAsTextShowCompositedLayers = 1 << 2 // Show which layers are composited.
+    RenderAsTextShowCompositedLayers = 1 << 2, // Show which layers are composited.
+    RenderAsTextShowAddresses = 1 << 3 // Show layer and renderer addresses.
 };
 typedef unsigned RenderAsTextBehavior;
 
 String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
-void write(TextStream&, const RenderObject&, int indent = 0);
+void write(TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
 
 // Helper function shared with SVGRenderTreeAsText
 String quoteAndEscapeNonPrintables(const String&);
 
 String counterValueForElement(Element*);
 
+String markerTextForListItem(Element*);
+
 } // namespace WebCore
 
 #endif // RenderTreeAsText_h
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index 13d6f60..ad25c22 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -47,9 +47,6 @@
 
 using namespace HTMLNames;
 
-static const int cDefaultWidth = 300;
-static const int cDefaultHeight = 150;
-
 RenderVideo::RenderVideo(HTMLVideoElement* video)
     : RenderMedia(video)
 {
@@ -67,10 +64,10 @@
             // size since they also have audio thrown at them. By setting the intrinsic
             // size to 300x1 the video will resize itself in these cases, and audio will
             // have the correct height (it needs to be > 0 for controls to render properly).
-            setIntrinsicSize(IntSize(cDefaultWidth, 1));
+            setIntrinsicSize(IntSize(defaultSize().width(), 1));
         }
         else
-            setIntrinsicSize(IntSize(cDefaultWidth, cDefaultHeight));
+            setIntrinsicSize(defaultSize());
     }
 }
 
@@ -82,6 +79,15 @@
     }
 }
 
+IntSize RenderVideo::defaultSize()
+{
+    // These values are specified in the spec.
+    static const int cDefaultWidth = 300;
+    static const int cDefaultHeight = 150;
+
+    return IntSize(cDefaultWidth, cDefaultHeight);
+}
+
 void RenderVideo::intrinsicSizeChanged()
 {
     if (videoElement()->shouldDisplayPosterImage())
diff --git a/WebCore/rendering/RenderVideo.h b/WebCore/rendering/RenderVideo.h
index 16c846d..bb2b05c 100644
--- a/WebCore/rendering/RenderVideo.h
+++ b/WebCore/rendering/RenderVideo.h
@@ -42,7 +42,9 @@
 
     void videoSizeChanged();
     IntRect videoBox() const;
-    
+
+    static IntSize defaultSize();
+
 #if USE(ACCELERATED_COMPOSITING)
     bool supportsAcceleratedRendering() const;
     void acceleratedRenderingStateChanged();
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 094abfd..a95ffdd 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -31,6 +31,7 @@
 #include "RenderLayer.h"
 #include "RenderSelectionInfo.h"
 #include "RenderWidget.h"
+#include "RenderWidgetProtector.h"
 #include "TransformState.h"
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -52,6 +53,10 @@
     , m_selectionEndPos(-1)
     , m_printImages(true)
     , m_maximalOutlineSize(0)
+    , m_bestTruncatedAt(0)
+    , m_truncatorWidth(0)
+    , m_minimumColumnHeight(0)
+    , m_forcedPageBreak(false)
     , m_layoutState(0)
     , m_layoutStateDisableCount(0)
 {
@@ -577,9 +582,29 @@
 
 void RenderView::updateWidgetPositions()
 {
-    RenderWidgetSet::iterator end = m_widgets.end();
-    for (RenderWidgetSet::iterator it = m_widgets.begin(); it != end; ++it)
-        (*it)->updateWidgetPosition();
+    // updateWidgetPosition() can possibly cause layout to be re-entered (via plug-ins running
+    // scripts in response to NPP_SetWindow, for example), so we need to keep the Widgets
+    // alive during enumeration.    
+
+    size_t size = m_widgets.size();
+
+    Vector<RenderWidget*> renderWidgets;
+    renderWidgets.reserveCapacity(size);
+
+    RenderWidgetSet::const_iterator end = m_widgets.end();
+    for (RenderWidgetSet::const_iterator it = m_widgets.begin(); it != end; ++it) {
+        renderWidgets.uncheckedAppend(*it);
+        (*it)->ref();
+    }
+    
+    for (size_t i = 0; i < size; ++i)
+        renderWidgets[i]->updateWidgetPosition();
+
+    for (size_t i = 0; i < size; ++i)
+        renderWidgets[i]->widgetPositionsUpdated();
+
+    for (size_t i = 0; i < size; ++i)
+        renderWidgets[i]->deref(renderArena());
 }
 
 void RenderView::addWidget(RenderWidget* o)
@@ -722,6 +747,16 @@
     return m_compositor && m_compositor->inCompositingMode();
 }
 
+void RenderView::compositingStateChanged(bool)
+{
+    Element* elt = document()->ownerElement();
+    if (!elt)
+        return;
+
+    // Trigger a recalcStyle in the parent document, to update compositing in that document.
+    elt->setNeedsStyleRecalc(SyntheticStyleChange);
+}
+
 RenderLayerCompositor* RenderView::compositor()
 {
     if (!m_compositor)
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index faa2465..fb68da3 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -166,6 +166,7 @@
 #if USE(ACCELERATED_COMPOSITING)
     RenderLayerCompositor* compositor();
     bool usesCompositing() const;
+    void compositingStateChanged(bool nowComposited);
 #endif
 
 protected:
diff --git a/WebCore/rendering/RenderWidget.cpp b/WebCore/rendering/RenderWidget.cpp
index f6f6da8..b03dcd6 100644
--- a/WebCore/rendering/RenderWidget.cpp
+++ b/WebCore/rendering/RenderWidget.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -151,13 +151,22 @@
 bool RenderWidget::setWidgetGeometry(const IntRect& frame)
 {
     ASSERT(!widgetHierarchyUpdateSuspendCount);
-    if (!node() || m_widget->frameRect() == frame)
+    if (!node())
         return false;
 
+    IntRect clipRect = enclosingLayer()->childrenClipRect();
+    bool clipChanged = m_clipRect != clipRect;
+    bool boundsChanged = m_widget->frameRect() != frame;
+
+    if (!boundsChanged && !clipChanged)
+        return false;
+
+    m_clipRect = clipRect;
+
     RenderWidgetProtector protector(this);
     RefPtr<Node> protectedNode(node());
     m_widget->setFrameRect(frame);
-    return true;
+    return boundsChanged;
 }
 
 void RenderWidget::setWidget(PassRefPtr<Widget> widget)
@@ -304,7 +313,7 @@
 
 void RenderWidget::updateWidgetPosition()
 {
-    if (!m_widget)
+    if (!m_widget || !node()) // Check the node in case destroy() has been called.
         return;
 
     // FIXME: This doesn't work correctly with transforms.
@@ -327,6 +336,21 @@
 #endif
 }
 
+void RenderWidget::widgetPositionsUpdated()
+{
+    if (!m_widget)
+        return;
+    m_widget->widgetPositionsUpdated();
+}
+
+IntRect RenderWidget::windowClipRect() const
+{
+    if (!m_frameView)
+        return IntRect();
+
+    return intersection(m_frameView->contentsToWindow(m_clipRect), m_frameView->windowClipRect());
+}
+
 void RenderWidget::setSelectionState(SelectionState state)
 {
     if (selectionState() != state) {
diff --git a/WebCore/rendering/RenderWidget.h b/WebCore/rendering/RenderWidget.h
index 6cad04a..b85b951 100644
--- a/WebCore/rendering/RenderWidget.h
+++ b/WebCore/rendering/RenderWidget.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -39,12 +39,17 @@
     static RenderWidget* find(const Widget*);
 
     void updateWidgetPosition();
+    void widgetPositionsUpdated();
+    IntRect windowClipRect() const;
 
     void showSubstituteImage(PassRefPtr<Image>);
 
     static void suspendWidgetHierarchyUpdates();
     static void resumeWidgetHierarchyUpdates();
 
+    RenderArena* ref() { ++m_refCount; return renderArena(); }
+    void deref(RenderArena*);
+
 protected:
     RenderWidget(Node*);
 
@@ -54,11 +59,11 @@
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void layout();
+    virtual void paint(PaintInfo&, int x, int y);
 
 private:
     virtual bool isWidget() const { return true; }
 
-    virtual void paint(PaintInfo&, int x, int y);
     virtual void destroy();
     virtual void setSelectionState(SelectionState);
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
@@ -66,13 +71,10 @@
 
     bool setWidgetGeometry(const IntRect&);
 
-    friend class RenderWidgetProtector;
-    RenderArena* ref() { ++m_refCount; return renderArena(); }
-    void deref(RenderArena*);
-
     RefPtr<Widget> m_widget;
     RefPtr<Image> m_substituteImage;
     FrameView* m_frameView;
+    IntRect m_clipRect; // The rectangle needs to remain correct after scrolling, so it is stored in content view coordinates, and not clipped to window.
     int m_refCount;
 };
 
diff --git a/WebCore/rendering/RootInlineBox.h b/WebCore/rendering/RootInlineBox.h
index 7fce1d3..fae0cba 100644
--- a/WebCore/rendering/RootInlineBox.h
+++ b/WebCore/rendering/RootInlineBox.h
@@ -49,8 +49,8 @@
 
     void detachEllipsisBox(RenderArena*);
 
-    RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_nextLine); }
-    RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_prevLine); }
+    RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_nextLineBox); }
+    RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_prevLineBox); }
 
     virtual void adjustPosition(int dx, int dy);
 
diff --git a/WebCore/rendering/SVGInlineTextBox.cpp b/WebCore/rendering/SVGInlineTextBox.cpp
index 65aa5a1..bda512f 100644
--- a/WebCore/rendering/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/SVGInlineTextBox.cpp
@@ -405,12 +405,11 @@
 
     if  (isGlyphPhase || isSelectionGlyphPhase) {
         // Set a text shadow if we have one.
-        // FIXME: Support multiple shadow effects.  Need more from the CG API before
-        // we can do this.
+        // FIXME: Support multiple shadow effects.  See how it's done in InlineTextBox.cpp.
         bool setShadow = false;
         if (styleToUse->textShadow()) {
-            paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x, styleToUse->textShadow()->y),
-                                         styleToUse->textShadow()->blur, styleToUse->textShadow()->color,
+            paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x(), styleToUse->textShadow()->y()),
+                                         styleToUse->textShadow()->blur(), styleToUse->textShadow()->color(),
                                          styleToUse->colorSpace());
             setShadow = true;
         }
diff --git a/WebCore/rendering/SVGMarkerData.h b/WebCore/rendering/SVGMarkerData.h
index 5ff2993..ba11e7e 100644
--- a/WebCore/rendering/SVGMarkerData.h
+++ b/WebCore/rendering/SVGMarkerData.h
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-class SVGResourceMarker;
+class RenderSVGResourceMarker;
 
 class SVGMarkerData {
 public:
@@ -38,14 +38,14 @@
         End
     };
 
-    SVGMarkerData(const Type& type = Unknown, SVGResourceMarker* marker = 0)
+    SVGMarkerData(const Type& type = Unknown, RenderSVGResourceMarker* marker = 0)
         : m_type(type)
         , m_marker(marker)
     {
     }
 
     FloatPoint origin() const { return m_origin; }
-    SVGResourceMarker* marker() const { return m_marker; }
+    RenderSVGResourceMarker* marker() const { return m_marker; }
 
     float currentAngle() const
     {
@@ -74,7 +74,7 @@
         return narrowPrecisionToFloat(angle);
     }
 
-    void updateTypeAndMarker(const Type& type, SVGResourceMarker* marker)
+    void updateTypeAndMarker(const Type& type, RenderSVGResourceMarker* marker)
     {
         m_type = type;
         m_marker = marker;
@@ -121,7 +121,7 @@
     }
 
     Type m_type;
-    SVGResourceMarker* m_marker;
+    RenderSVGResourceMarker* m_marker;
     FloatPoint m_origin;
     FloatPoint m_subpathStart;
     FloatPoint m_inslopePoints[2];
diff --git a/WebCore/rendering/SVGMarkerLayoutInfo.cpp b/WebCore/rendering/SVGMarkerLayoutInfo.cpp
index 3fe513f..b771cf8 100644
--- a/WebCore/rendering/SVGMarkerLayoutInfo.cpp
+++ b/WebCore/rendering/SVGMarkerLayoutInfo.cpp
@@ -26,8 +26,7 @@
 #if ENABLE(SVG)
 #include "SVGMarkerLayoutInfo.h"
 
-#include "RenderSVGViewportContainer.h"
-#include "SVGResourceMarker.h"
+#include "RenderSVGResourceMarker.h"
 
 namespace WebCore {
 
@@ -52,7 +51,7 @@
     markerData.updateOutslope(element->points[0]);
 
     // Draw the marker for the previous element
-    SVGResourceMarker* marker = markerData.marker();
+    RenderSVGResourceMarker* marker = markerData.marker();
     if (elementIndex > 0 && marker)
         info.addLayoutedMarker(marker, markerData.origin(), markerData.currentAngle());
 
@@ -66,7 +65,7 @@
     ++elementIndex;
 }
 
-FloatRect SVGMarkerLayoutInfo::calculateBoundaries(SVGResourceMarker* startMarker, SVGResourceMarker* midMarker, SVGResourceMarker* endMarker, float strokeWidth, const Path& path)
+FloatRect SVGMarkerLayoutInfo::calculateBoundaries(RenderSVGResourceMarker* startMarker, RenderSVGResourceMarker* midMarker, RenderSVGResourceMarker* endMarker, float strokeWidth, const Path& path)
 {
     m_layout.clear();
     m_midMarker = midMarker;
@@ -90,7 +89,7 @@
     for (; it != end; ++it) {
         MarkerLayout& layout = *it;
 
-        RenderSVGViewportContainer* markerContent = layout.marker->renderer();
+        RenderSVGResourceMarker* markerContent = layout.marker;
         ASSERT(markerContent);
 
         bounds.unite(markerContent->markerBoundaries(layout.matrix));
@@ -113,7 +112,7 @@
     }
 }
 
-void SVGMarkerLayoutInfo::addLayoutedMarker(SVGResourceMarker* marker, const FloatPoint& origin, float angle)
+void SVGMarkerLayoutInfo::addLayoutedMarker(RenderSVGResourceMarker* marker, const FloatPoint& origin, float angle)
 {
     ASSERT(marker);
     m_layout.append(MarkerLayout(marker, marker->markerTransformation(origin, angle, m_strokeWidth)));
diff --git a/WebCore/rendering/SVGMarkerLayoutInfo.h b/WebCore/rendering/SVGMarkerLayoutInfo.h
index 517c993..6011a2d 100644
--- a/WebCore/rendering/SVGMarkerLayoutInfo.h
+++ b/WebCore/rendering/SVGMarkerLayoutInfo.h
@@ -28,17 +28,17 @@
 namespace WebCore {
 
 class Path;
-class SVGResourceMarker;
+class RenderSVGResourceMarker;
 
 struct MarkerLayout {
-    MarkerLayout(SVGResourceMarker* markerObj = 0, AffineTransform matrixObj = AffineTransform())
+    MarkerLayout(RenderSVGResourceMarker* markerObj = 0, AffineTransform matrixObj = AffineTransform())
         : marker(markerObj)
         , matrix(matrixObj)
     {
         ASSERT(marker);
     }
 
-    SVGResourceMarker* marker;
+    RenderSVGResourceMarker* marker;
     AffineTransform matrix;
 };
 
@@ -47,17 +47,17 @@
     SVGMarkerLayoutInfo();
     ~SVGMarkerLayoutInfo();
 
-    FloatRect calculateBoundaries(SVGResourceMarker* startMarker, SVGResourceMarker* midMarker, SVGResourceMarker* endMarker, float strokeWidth, const Path&);
+    FloatRect calculateBoundaries(RenderSVGResourceMarker* startMarker, RenderSVGResourceMarker* midMarker, RenderSVGResourceMarker* endMarker, float strokeWidth, const Path&);
     void drawMarkers(RenderObject::PaintInfo&);
 
     // Used by static inline helper functions in SVGMarkerLayoutInfo.cpp
     SVGMarkerData& markerData() { return m_markerData; }
-    SVGResourceMarker* midMarker() const { return m_midMarker; }
+    RenderSVGResourceMarker* midMarker() const { return m_midMarker; }
     int& elementIndex() { return m_elementIndex; }
-    void addLayoutedMarker(SVGResourceMarker*, const FloatPoint& origin, float angle);
+    void addLayoutedMarker(RenderSVGResourceMarker*, const FloatPoint& origin, float angle);
 
 private:
-    SVGResourceMarker* m_midMarker;
+    RenderSVGResourceMarker* m_midMarker;
 
     // Used while layouting markers
     int m_elementIndex;
@@ -70,5 +70,5 @@
 
 }
 
-#endif // ENABLE(SVG)
-#endif // SVGMarkerLayoutInfo_h
+#endif
+#endif
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index dc1b3c1..dd67746 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -4,6 +4,7 @@
  *           (C) 2007 Eric Seidel <eric@webkit.org>
  *           (C) 2009 Google, Inc.  All rights reserved.
  *           (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -33,10 +34,11 @@
 #include "RenderObject.h"
 #include "RenderSVGContainer.h"
 #include "RenderSVGResource.h"
+#include "RenderSVGResourceClipper.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderSVGResourceMarker.h"
 #include "RenderSVGResourceMasker.h"
 #include "RenderView.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceFilter.h"
 #include "SVGStyledElement.h"
 #include "SVGURIReference.h"
 #include "TransformState.h"
@@ -78,7 +80,7 @@
     object->parent()->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
 }
 
-bool SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& repaintRect, SVGResourceFilter*& filter, SVGResourceFilter* rootFilter)
+bool SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, const FloatRect& repaintRect, RenderSVGResourceFilter*& filter, RenderSVGResourceFilter* rootFilter)
 {
 #if !ENABLE(FILTERS)
     UNUSED_PARAM(filter);
@@ -103,23 +105,23 @@
         paintInfo.context->beginTransparencyLayer(opacity);
     }
 
-    if (ShadowData* shadow = svgStyle->shadow()) {
+    if (const ShadowData* shadow = svgStyle->shadow()) {
         paintInfo.context->clip(repaintRect);
-        paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color, style->colorSpace());
+        paintInfo.context->setShadow(IntSize(shadow->x(), shadow->y()), shadow->blur(), shadow->color(), style->colorSpace());
         paintInfo.context->beginTransparencyLayer(1.0f);
     }
 
 #if ENABLE(FILTERS)
-    AtomicString filterId(svgStyle->filter());
+    AtomicString filterId(svgStyle->filterResource());
 #endif
 
-    AtomicString clipperId(svgStyle->clipPath());
-    AtomicString maskerId(svgStyle->maskElement());
+    AtomicString clipperId(svgStyle->clipperResource());
+    AtomicString maskerId(svgStyle->maskerResource());
 
     Document* document = object->document();
 
 #if ENABLE(FILTERS)
-    SVGResourceFilter* newFilter = getFilterById(document, filterId, object);
+    RenderSVGResourceFilter* newFilter = getRenderSVGResourceById<RenderSVGResourceFilter>(document, filterId);
     if (newFilter == rootFilter) {
         // Catch <text filter="url(#foo)">Test<tspan filter="url(#foo)">123</tspan></text>.
         // The filter is NOT meant to be applied twice in that case!
@@ -129,23 +131,20 @@
         filter = newFilter;
 #endif
 
-    // apply Masker
     if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, maskerId)) {
         if (!masker->applyResource(object, paintInfo.context))
             return false;
     } else if (!maskerId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(maskerId, styledElement);
 
-    if (SVGResourceClipper* clipper = getClipperById(document, clipperId, object)) {
-        clipper->addClient(styledElement);
-        clipper->applyClip(paintInfo.context, object->objectBoundingBox());
-    } else if (!clipperId.isEmpty())
+    if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(document, clipperId))
+        clipper->applyResource(object, paintInfo.context);
+    else if (!clipperId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(clipperId, styledElement);
 
 #if ENABLE(FILTERS)
     if (filter) {
-        filter->addClient(styledElement);
-        if (!filter->prepareFilter(paintInfo.context, object))
+        if (!filter->applyResource(object, paintInfo.context))
             return false;
     } else if (!filterId.isEmpty())
         svgElement->document()->accessSVGExtensions()->addPendingResource(filterId, styledElement);
@@ -154,7 +153,7 @@
     return true;
 }
 
-void SVGRenderBase::finishRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, SVGResourceFilter*& filter, GraphicsContext* savedContext)
+void SVGRenderBase::finishRenderSVGContent(RenderObject* object, RenderObject::PaintInfo& paintInfo, RenderSVGResourceFilter*& filter, GraphicsContext* savedContext)
 {
 #if !ENABLE(FILTERS)
     UNUSED_PARAM(filter);
@@ -168,7 +167,7 @@
 
 #if ENABLE(FILTERS)
     if (filter) {
-        filter->applyFilter(paintInfo.context, object);
+        filter->postApplyResource(object, paintInfo.context);
         paintInfo.context = savedContext;
     }
 #endif
@@ -188,7 +187,14 @@
     ASSERT(item);
     ASSERT(image);
     ASSERT(image->context());
-    RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0);
+
+    // FIXME: This sets the rect to the viewable area of the current frame. This
+    // is used to support text drawings to the ImageBuffer. See bug 30399.
+    IntRect rect;
+    FrameView* frameView = item->document()->view();
+    if (frameView)
+        rect = IntRect(0, 0, frameView->visibleWidth(), frameView->visibleHeight());
+    RenderObject::PaintInfo info(image->context(), rect, PaintPhaseForeground, 0, 0, 0);
 
     // FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever
     // called with one of those, we will read from the wrong offset in an object due to a bad cast.
@@ -276,9 +282,8 @@
 FloatRect SVGRenderBase::filterBoundingBoxForRenderer(const RenderObject* object) const
 {
 #if ENABLE(FILTERS)
-    SVGResourceFilter* filter = getFilterById(object->document(), object->style()->svgStyle()->filter(), object);
-    if (filter)
-        return filter->filterBoundingBox(object->objectBoundingBox());
+    if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object->document(), object->style()->svgStyle()->filterResource()))
+        return filter->resourceBoundingBox(object->objectBoundingBox());
 #else
     UNUSED_PARAM(object);
 #endif
@@ -287,26 +292,37 @@
 
 FloatRect SVGRenderBase::clipperBoundingBoxForRenderer(const RenderObject* object) const
 {
-    SVGResourceClipper* clipper = getClipperById(object->document(), object->style()->svgStyle()->clipPath(), object);
-    if (clipper)
-        return clipper->clipperBoundingBox(object->objectBoundingBox());
+    if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object->document(), object->style()->svgStyle()->clipperResource()))
+        return clipper->resourceBoundingBox(object->objectBoundingBox());
 
     return FloatRect();
 }
 
 FloatRect SVGRenderBase::maskerBoundingBoxForRenderer(const RenderObject* object) const
 {
-    if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object->document(), object->style()->svgStyle()->maskElement()))
+    if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object->document(), object->style()->svgStyle()->maskerResource()))
         return masker->resourceBoundingBox(object->objectBoundingBox());
 
     return FloatRect();
 }
 
-void SVGRenderBase::deregisterFromResources(RenderObject* object)
+void deregisterFromResources(RenderObject* object)
 {
-    // We only have a renderer for masker at the moment.
-    if (RenderSVGResourceMasker* resource = getRenderSVGResourceById<RenderSVGResourceMasker>(object->document(), object->style()->svgStyle()->maskElement()))
-        resource->invalidateClient(object);
+    // We only have the renderer for masker and clipper at the moment.
+    if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object->document(), object->style()->svgStyle()->maskerResource()))
+        masker->invalidateClient(object);
+    if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object->document(), object->style()->svgStyle()->clipperResource()))
+        clipper->invalidateClient(object);
+#if ENABLE(FILTERS)
+    if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object->document(), object->style()->svgStyle()->filterResource()))
+        filter->invalidateClient(object);
+#endif
+    if (RenderSVGResourceMarker* startMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(object->document(), object->style()->svgStyle()->markerStartResource()))
+        startMarker->invalidateClient(object);
+    if (RenderSVGResourceMarker* midMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(object->document(), object->style()->svgStyle()->markerMidResource()))
+        midMarker->invalidateClient(object);
+    if (RenderSVGResourceMarker* endMarker = getRenderSVGResourceById<RenderSVGResourceMarker>(object->document(), object->style()->svgStyle()->markerEndResource()))
+        endMarker->invalidateClient(object);
 }
 
 void applyTransformToPaintInfo(RenderObject::PaintInfo& paintInfo, const AffineTransform& localToAncestorTransform)
@@ -318,6 +334,16 @@
     paintInfo.rect = localToAncestorTransform.inverse().mapRect(paintInfo.rect);
 }
 
-} // namespace WebCore
+const RenderObject* findTextRootObject(const RenderObject* start)
+{
+    while (start && !start->isSVGText())
+        start = start->parent();
+    ASSERT(start);
+    ASSERT(start->isSVGText());
 
-#endif // ENABLE(SVG)
+    return start;
+}
+
+}
+
+#endif
diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h
index 427ff1f..4b59b71 100644
--- a/WebCore/rendering/SVGRenderSupport.h
+++ b/WebCore/rendering/SVGRenderSupport.h
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-class SVGResourceFilter;
+class RenderSVGResourceFilter;
 class ImageBuffer;
 
 // SVGRendererBase is an abstract base class which all SVG renderers inherit
@@ -47,8 +47,8 @@
     // FIXME: These are only public for SVGRootInlineBox.
     // It's unclear if these should be exposed or not.  SVGRootInlineBox may
     // pass the wrong RenderObject* and boundingBox to these functions.
-    static bool prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, SVGResourceFilter*&, SVGResourceFilter* rootFilter = 0);
-    static void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, SVGResourceFilter*&, GraphicsContext* savedContext);
+    static bool prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, RenderSVGResourceFilter*&, RenderSVGResourceFilter* rootFilter = 0);
+    static void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, RenderSVGResourceFilter*&, GraphicsContext* savedContext);
 
     // Layout all children of the passed render object
     static void layoutChildren(RenderObject*, bool selfNeedsLayout);
@@ -73,8 +73,6 @@
     // Used to share the "walk all the children" logic between objectBoundingBox
     // and repaintRectInLocalCoordinates in RenderSVGRoot and RenderSVGContainer
     static FloatRect computeContainerBoundingBox(const RenderObject* container, bool includeAllPaintedContent);
-
-    static void deregisterFromResources(RenderObject*);
 };
 
 // FIXME: This should move to RenderObject or PaintInfo
@@ -84,7 +82,10 @@
 // This offers a way to render parts of a WebKit rendering tree into a ImageBuffer.
 void renderSubtreeToImage(ImageBuffer*, RenderObject*);
 
+void deregisterFromResources(RenderObject*);
 void clampImageBufferSizeToViewport(FrameView*, IntSize& imageBufferSize);
+
+const RenderObject* findTextRootObject(const RenderObject* start);
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index f892144..0f1f15d 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -2,6 +2,7 @@
  * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
  *           (C) 2005 Rob Buis <buis@kde.org>
  *           (C) 2006 Alexander Kellett <lypanov@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,10 +35,14 @@
 #include "HTMLNames.h"
 #include "InlineTextBox.h"
 #include "NodeRenderStyle.h"
+#include "Path.h"
 #include "RenderImage.h"
 #include "RenderPath.h"
 #include "RenderSVGContainer.h"
 #include "RenderSVGInlineText.h"
+#include "RenderSVGResourceClipper.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderSVGResourceMarker.h"
 #include "RenderSVGResourceMasker.h"
 #include "RenderSVGRoot.h"
 #include "RenderSVGText.h"
@@ -47,7 +52,6 @@
 #include "SVGPaintServerGradient.h"
 #include "SVGPaintServerPattern.h"
 #include "SVGPaintServerSolid.h"
-#include "SVGResourceClipper.h"
 #include "SVGRootInlineBox.h"
 #include "SVGStyledElement.h"
 #include <math.h>
@@ -196,6 +200,20 @@
     return ts;
 }
 
+static TextStream& operator<<(TextStream& ts, const WindRule rule)
+{
+    switch (rule) {
+    case RULE_NONZERO:
+        ts << "NON-ZERO";
+        break;
+    case RULE_EVENODD:
+        ts << "EVEN-ODD";
+        break;
+    }
+
+    return ts;
+}
+
 static TextStream& operator<<(TextStream& ts, const SVGUnitTypes::SVGUnitType& unitType)
 {
     switch (unitType) {
@@ -213,6 +231,23 @@
     return ts;
 }
 
+static TextStream& operator<<(TextStream& ts, const SVGMarkerElement::SVGMarkerUnitsType& markerUnit)
+{
+    switch (markerUnit) {
+    case SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN:
+        ts << "unknown";
+        break;
+    case SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE:
+        ts << "userSpaceOnUse";
+        break;
+    case SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH:
+        ts << "strokeWidth";
+        break;
+    }
+
+    return ts;
+}
+
 TextStream& operator<<(TextStream& ts, const Color& c)
 {
     return ts << c.name();
@@ -316,14 +351,12 @@
             writeIfNotDefault(ts, "fill rule", svgStyle->fillRule(), RULE_NONZERO);
             ts << "}]";
         }
+        writeIfNotDefault(ts, "clip rule", svgStyle->clipRule(), RULE_NONZERO);
     }
 
-    if (!svgStyle->clipPath().isEmpty())
-        writeNameAndQuotedValue(ts, "clip path", svgStyle->clipPath());
-    writeIfNotEmpty(ts, "start marker", svgStyle->startMarker());
-    writeIfNotEmpty(ts, "middle marker", svgStyle->midMarker());
-    writeIfNotEmpty(ts, "end marker", svgStyle->endMarker());
-    writeIfNotEmpty(ts, "filter", svgStyle->filter());
+    writeIfNotEmpty(ts, "start marker", svgStyle->markerStartResource());
+    writeIfNotEmpty(ts, "middle marker", svgStyle->markerMidResource());
+    writeIfNotEmpty(ts, "end marker", svgStyle->markerEndResource());
 }
 
 static TextStream& writePositionAndStyle(TextStream& ts, const RenderObject& object)
@@ -496,9 +529,49 @@
         ASSERT(masker);
         writeNameValuePair(ts, "maskUnits", masker->maskUnits());
         writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits());
+#if ENABLE(FILTERS)
+    } else if (resource->resourceType() == FilterResourceType) {
+        RenderSVGResourceFilter* filter = static_cast<RenderSVGResourceFilter*>(resource);
+        ASSERT(filter);
+        writeNameValuePair(ts, "filterUnits", filter->filterUnits());
+        writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits());
+        if (OwnPtr<SVGFilterBuilder> builder = filter->buildPrimitives()) {
+            ts << "\n";
+            const HashMap<AtomicString, RefPtr<FilterEffect> >& effects = builder->namedEffects();
+            HashMap<AtomicString, RefPtr<FilterEffect> >::const_iterator end = effects.end();
+            for (HashMap<AtomicString, RefPtr<FilterEffect> >::const_iterator it = effects.begin(); it != end; ++it) {
+                writeIndent(ts, indent);
+                ts << "  [primitve=\"" << it->first << "\" ";
+                it->second->externalRepresentation(ts);
+                ts << "]\n";
+            }
+            writeIndent(ts, indent);
+            // FIXME: Some effects don't give a representation back. So we miss some more informations
+            // after '[last primitive' .
+            // We also just dump named effects and the last effect at the moment, more effects
+            // without a name might be in the pipe.
+            ts << "  [last primitive ";
+            if (FilterEffect* lastEffect = builder->lastEffect())
+                lastEffect->externalRepresentation(ts);
+            ts << "]";
+        }
+#endif
+    } else if (resource->resourceType() == ClipperResourceType) {
+        RenderSVGResourceClipper* clipper = static_cast<RenderSVGResourceClipper*>(resource);
+        ASSERT(clipper);
+        writeNameValuePair(ts, "clipPathUnits", clipper->clipPathUnits());
+    } else if (resource->resourceType() == MarkerResourceType) {
+        RenderSVGResourceMarker* marker = static_cast<RenderSVGResourceMarker*>(resource);
+        ASSERT(marker);
+        writeNameValuePair(ts, "markerUnits", marker->markerUnits());
+        ts << " [ref at " << marker->referencePoint() << "]";
+        ts << " [angle=";
+        if (marker->angle() == -1)
+            ts << "auto" << "]";
+        else
+            ts << marker->angle() << "]";
     }
 
-    // FIXME: Handle other RenderSVGResource* classes here, after converting them from SVGResource*.
     ts << "\n";
     writeChildren(ts, object, indent);
 }
@@ -558,17 +631,38 @@
     const RenderStyle* style = object.style();
     const SVGRenderStyle* svgStyle = style->svgStyle();
 
-    if (!svgStyle->maskElement().isEmpty()) {
-        if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object.document(), svgStyle->maskElement())) {
+    if (!svgStyle->maskerResource().isEmpty()) {
+        if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object.document(), svgStyle->maskerResource())) {
             writeIndent(ts, indent);
             ts << " ";
-            writeNameAndQuotedValue(ts, "masker", svgStyle->maskElement());
+            writeNameAndQuotedValue(ts, "masker", svgStyle->maskerResource());
             ts << " ";
             writeStandardPrefix(ts, *masker, 0);
             ts << " " << masker->resourceBoundingBox(object.objectBoundingBox()) << "\n";
         }
     }
-    // FIXME: Handle other RenderSVGResource* classes here, after converting them from SVGResource*.
+    if (!svgStyle->clipperResource().isEmpty()) {
+        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object.document(), svgStyle->clipperResource())) {
+            writeIndent(ts, indent);
+            ts << " ";
+            writeNameAndQuotedValue(ts, "clipPath", svgStyle->clipperResource());
+            ts << " ";
+            writeStandardPrefix(ts, *clipper, 0);
+            ts << " " << clipper->resourceBoundingBox(object.objectBoundingBox()) << "\n";
+        }
+    }
+#if ENABLE(FILTERS)
+    if (!svgStyle->filterResource().isEmpty()) {
+        if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object.document(), svgStyle->filterResource())) {
+            writeIndent(ts, indent);
+            ts << " ";
+            writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
+            ts << " ";
+            writeStandardPrefix(ts, *filter, 0);
+            ts << " " << filter->resourceBoundingBox(object.objectBoundingBox()) << "\n";
+        }
+    }
+#endif
 }
 
 void writeRenderResources(TextStream& ts, Node* parent)
@@ -592,8 +686,7 @@
         if (resource->isPaintServer()) {
             RefPtr<SVGPaintServer> paintServer = WTF::static_pointer_cast<SVGPaintServer>(resource);
             ts << "KRenderingPaintServer {id=\"" << elementId << "\" " << *paintServer << "}" << "\n";
-        } else
-            ts << "KCanvasResource {id=\"" << elementId << "\" " << *resource << "}" << "\n";
+        }
     } while ((node = node->traverseNextNode(parent)));
 }
 
diff --git a/WebCore/rendering/SVGRootInlineBox.cpp b/WebCore/rendering/SVGRootInlineBox.cpp
index 03b9db4..89b4375 100644
--- a/WebCore/rendering/SVGRootInlineBox.cpp
+++ b/WebCore/rendering/SVGRootInlineBox.cpp
@@ -28,9 +28,11 @@
 #include "SVGRootInlineBox.h"
 
 #include "Editor.h"
+#include "FloatConversion.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "RenderBlock.h"
+#include "RenderSVGResourceFilter.h"
 #include "RenderSVGRoot.h"
 #include "SVGInlineFlowBox.h"
 #include "SVGInlineTextBox.h"
@@ -38,7 +40,6 @@
 #include "SVGPaintServer.h"
 #include "SVGRenderStyleDefs.h"
 #include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
 #include "SVGTextPositioningElement.h"
 #include "SVGURIReference.h"
 #include "Text.h"
@@ -336,7 +337,7 @@
 
 // Helper class for paint()
 struct SVGRootInlineBoxPaintWalker {
-    SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, SVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
+    SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, RenderSVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
         : m_rootBox(rootBox)
         , m_chunkStarted(false)
         , m_paintInfo(paintInfo)
@@ -668,8 +669,8 @@
     RenderObject::PaintInfo m_savedInfo;
 
     FloatRect m_boundingBox;
-    SVGResourceFilter* m_filter;
-    SVGResourceFilter* m_rootFilter;
+    RenderSVGResourceFilter* m_filter;
+    RenderSVGResourceFilter* m_rootFilter;
 
     SVGPaintServer* m_fillPaintServer;
     SVGPaintServer* m_strokePaintServer;
@@ -691,7 +692,7 @@
     RenderObject::PaintInfo savedInfo(paintInfo);
     paintInfo.context->save();
 
-    SVGResourceFilter* filter = 0;
+    RenderSVGResourceFilter* filter = 0;
     FloatRect boundingBox(tx + x(), ty + y(), width(), height());
 
     // Initialize text rendering
@@ -1413,7 +1414,7 @@
             }
         }
 
-        double kerning = 0.0;
+        float kerning = 0.0f;
 #if ENABLE(SVG_FONTS)
         SVGFontElement* svgFont = 0;
         if (style->font().isSVGFont())
@@ -1422,25 +1423,26 @@
         if (lastGlyph.isValid && style->font().isSVGFont()) {
             SVGHorizontalKerningPair kerningPair;
             if (svgFont->getHorizontalKerningPairForStringsAndGlyphs(lastGlyph.unicode, lastGlyph.glyphName, unicodeStr, glyphName, kerningPair))
-                kerning = kerningPair.kerning;
+                kerning = narrowPrecisionToFloat(kerningPair.kerning);
         }
 
         if (style->font().isSVGFont()) {
             lastGlyph.unicode = unicodeStr;
             lastGlyph.glyphName = glyphName;
             lastGlyph.isValid = true;
+            kerning *= style->font().size() / style->font().primaryFont()->unitsPerEm();
         } else
             lastGlyph.isValid = false;
 #endif
 
-        svgChar.x -= (float)kerning;
+        svgChar.x -= kerning;
 
         // Advance to new position
         if (isVerticalText) {
             svgChar.drawnSeperated = true;
             info.cury += glyphAdvance + spacing;
         } else
-            info.curx += glyphAdvance + spacing - (float)kerning;
+            info.curx += glyphAdvance + spacing - kerning;
 
         // Advance to next character group
         for (int k = 0; k < charsConsumed; ++k) {
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index fc7f7f0..4cd55c5 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -63,18 +63,17 @@
 
 VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& point)
 {
-    int contentsX = point.x();
-    int contentsY = point.y();
+    IntPoint contentsPoint(point);
 
     // Multiline text controls have the scroll on shadowAncestorNode, so we need to take that
     // into account here.
     if (m_multiLine) {
         RenderTextControl* renderer = toRenderTextControl(node()->shadowAncestorNode()->renderer());
         if (renderer->hasOverflowClip())
-            renderer->layer()->addScrolledContentOffset(contentsX, contentsY);
+            contentsPoint += renderer->layer()->scrolledContentOffset();
     }
 
-    return RenderBlock::positionForPoint(IntPoint(contentsX, contentsY));
+    return RenderBlock::positionForPoint(contentsPoint);
 }
 
 TextControlInnerElement::TextControlInnerElement(Document* doc, Node* shadowParent)
diff --git a/WebCore/rendering/style/BorderData.h b/WebCore/rendering/style/BorderData.h
index 8ca0d65..96caf97 100644
--- a/WebCore/rendering/style/BorderData.h
+++ b/WebCore/rendering/style/BorderData.h
@@ -32,76 +32,90 @@
 namespace WebCore {
 
 class BorderData {
+friend class RenderStyle;
 public:
-    BorderValue left;
-    BorderValue right;
-    BorderValue top;
-    BorderValue bottom;
-
-    NinePieceImage image;
-
-    IntSize topLeft;
-    IntSize topRight;
-    IntSize bottomLeft;
-    IntSize bottomRight;
-
     bool hasBorder() const
     {
-        bool haveImage = image.hasImage();
-        return left.nonZero(!haveImage) || right.nonZero(!haveImage) || top.nonZero(!haveImage) || bottom.nonZero(!haveImage);
+        bool haveImage = m_image.hasImage();
+        return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
     }
 
     bool hasBorderRadius() const
     {
-        if (topLeft.width() > 0)
+        if (m_topLeft.width() > 0)
             return true;
-        if (topRight.width() > 0)
+        if (m_topRight.width() > 0)
             return true;
-        if (bottomLeft.width() > 0)
+        if (m_bottomLeft.width() > 0)
             return true;
-        if (bottomRight.width() > 0)
+        if (m_bottomRight.width() > 0)
             return true;
         return false;
     }
     
     unsigned short borderLeftWidth() const
     {
-        if (!image.hasImage() && (left.style() == BNONE || left.style() == BHIDDEN))
+        if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN))
             return 0; 
-        return left.width;
+        return m_left.width();
     }
     
     unsigned short borderRightWidth() const
     {
-        if (!image.hasImage() && (right.style() == BNONE || right.style() == BHIDDEN))
+        if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN))
             return 0;
-        return right.width;
+        return m_right.width();
     }
     
     unsigned short borderTopWidth() const
     {
-        if (!image.hasImage() && (top.style() == BNONE || top.style() == BHIDDEN))
+        if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN))
             return 0;
-        return top.width;
+        return m_top.width();
     }
     
     unsigned short borderBottomWidth() const
     {
-        if (!image.hasImage() && (bottom.style() == BNONE || bottom.style() == BHIDDEN))
+        if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN))
             return 0;
-        return bottom.width;
+        return m_bottom.width();
     }
     
     bool operator==(const BorderData& o) const
     {
-        return left == o.left && right == o.right && top == o.top && bottom == o.bottom && image == o.image &&
-               topLeft == o.topLeft && topRight == o.topRight && bottomLeft == o.bottomLeft && bottomRight == o.bottomRight;
+        return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && m_bottom == o.m_bottom && m_image == o.m_image
+               && m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && m_bottomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight;
     }
     
     bool operator!=(const BorderData& o) const
     {
         return !(*this == o);
     }
+    
+    const BorderValue& left() const { return m_left; }
+    const BorderValue& right() const { return m_right; }
+    const BorderValue& top() const { return m_top; }
+    const BorderValue& bottom() const { return m_bottom; }
+    
+    const NinePieceImage& image() const { return m_image; }
+    
+    const IntSize& topLeft() const { return m_topLeft; }
+    const IntSize& topRight() const { return m_topRight; }
+    const IntSize& bottomLeft() const { return m_bottomLeft; }
+    const IntSize& bottomRight() const { return m_bottomRight; }
+    
+private:
+    BorderValue m_left;
+    BorderValue m_right;
+    BorderValue m_top;
+    BorderValue m_bottom;
+
+    NinePieceImage m_image;
+
+    IntSize m_topLeft;
+    IntSize m_topRight;
+    IntSize m_bottomLeft;
+    IntSize m_bottomRight;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/BorderValue.h b/WebCore/rendering/style/BorderValue.h
index e61e708..3e6fd5d 100644
--- a/WebCore/rendering/style/BorderValue.h
+++ b/WebCore/rendering/style/BorderValue.h
@@ -31,27 +31,22 @@
 namespace WebCore {
 
 class BorderValue {
+friend class RenderStyle;
 public:
     BorderValue()
-        : width(3)
+        : m_width(3)
         , m_style(BNONE)
     {
     }
 
-    Color color;
-    unsigned width : 12;
-    unsigned m_style : 4; // EBorderStyle 
-
-    EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
-    
     bool nonZero(bool checkStyle = true) const
     {
-        return width != 0 && (!checkStyle || m_style != BNONE);
+        return width() && (!checkStyle || m_style != BNONE);
     }
 
     bool isTransparent() const
     {
-        return color.isValid() && color.alpha() == 0;
+        return m_color.isValid() && !m_color.alpha();
     }
 
     bool isVisible(bool checkStyle = true) const
@@ -61,13 +56,22 @@
 
     bool operator==(const BorderValue& o) const
     {
-        return width == o.width && m_style == o.m_style && color == o.color;
+        return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color;
     }
 
     bool operator!=(const BorderValue& o) const
     {
         return !(*this == o);
     }
+    
+    const Color& color() const { return m_color; }
+    unsigned short width() const { return m_width; }
+    EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
+
+protected:
+    Color m_color;
+    unsigned m_width : 12;
+    unsigned m_style : 4; // EBorderStyle 
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/CollapsedBorderValue.h b/WebCore/rendering/style/CollapsedBorderValue.h
index 805f474..6207231 100644
--- a/WebCore/rendering/style/CollapsedBorderValue.h
+++ b/WebCore/rendering/style/CollapsedBorderValue.h
@@ -29,36 +29,42 @@
 
 namespace WebCore {
 
-struct CollapsedBorderValue {
+class CollapsedBorderValue {
+friend class RenderStyle;
+public:
     CollapsedBorderValue()
-        : border(0)
-        , precedence(BOFF)
+        : m_border(0)
+        , m_precedence(BOFF)
     {
     }
 
-    CollapsedBorderValue(const BorderValue* b, EBorderPrecedence p)
-        : border(b)
-        , precedence(p)
+    CollapsedBorderValue(const BorderValue* b, Color c, EBorderPrecedence p)
+        : m_border(b)
+        , m_borderColor(c)
+        , m_precedence(p)
     {
     }
 
-    int width() const { return border && border->nonZero() ? border->width : 0; }
-    EBorderStyle style() const { return border ? border->style() : BHIDDEN; }
-    bool exists() const { return border; }
-    Color color() const { return border ? border->color : Color(); }
-    bool isTransparent() const { return border ? border->isTransparent() : true; }
-    
+    int width() const { return m_border && m_border->nonZero() ? m_border->width() : 0; }
+    EBorderStyle style() const { return m_border ? m_border->style() : BHIDDEN; }
+    bool exists() const { return m_border; }
+    const Color& color() const { return m_borderColor; }
+    bool isTransparent() const { return m_border ? m_border->isTransparent() : true; }
+    EBorderPrecedence precedence() const { return m_precedence; }
+
     bool operator==(const CollapsedBorderValue& o) const
     {
-        if (!border)
-            return !o.border;
-        if (!o.border)
+        if (!m_border)
+            return !o.m_border;
+        if (!o.m_border)
             return false;
-        return *border == *o.border && precedence == o.precedence;
+        return *m_border == *o.m_border && m_borderColor == o.m_borderColor && m_precedence == o.m_precedence;
     }
-    
-    const BorderValue* border;
-    EBorderPrecedence precedence;    
+
+private:
+    const BorderValue* m_border;
+    Color m_borderColor;
+    EBorderPrecedence m_precedence;    
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/CursorData.h b/WebCore/rendering/style/CursorData.h
index 7c6b31d..2341e71 100644
--- a/WebCore/rendering/style/CursorData.h
+++ b/WebCore/rendering/style/CursorData.h
@@ -31,15 +31,17 @@
 
 namespace WebCore {
 
-struct CursorData {
-    CursorData()
-        : cursorImage(0)
+class CursorData {
+public:
+    CursorData(CachedImage* image, const IntPoint& hotSpot)
+        : m_image(image)
+        , m_hotSpot(hotSpot)
     {
     }
 
     bool operator==(const CursorData& o) const
     {
-        return hotSpot == o.hotSpot && cursorImage == o.cursorImage;
+        return m_hotSpot == o.m_hotSpot && m_image == o.m_image;
     }
 
     bool operator!=(const CursorData& o) const
@@ -47,8 +49,12 @@
         return !(*this == o);
     }
 
-    IntPoint hotSpot; // for CSS3 support
-    CachedResourceHandle<CachedImage> cursorImage;
+    const CachedImage* image() const { return m_image.get(); }    
+    const IntPoint& hotSpot() const { return m_hotSpot; }
+    
+private:
+    CachedResourceHandle<CachedImage> m_image;
+    IntPoint m_hotSpot; // for CSS3 support
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/FillLayer.h b/WebCore/rendering/style/FillLayer.h
index cef6b19..eb21ec3 100644
--- a/WebCore/rendering/style/FillLayer.h
+++ b/WebCore/rendering/style/FillLayer.h
@@ -59,7 +59,7 @@
     LengthSize size;
 };
 
-struct FillLayer : FastAllocBase {
+class FillLayer : public FastAllocBase {
 public:
     FillLayer(EFillLayerType);
     ~FillLayer();
@@ -74,6 +74,7 @@
     EFillRepeat repeatY() const { return static_cast<EFillRepeat>(m_repeatY); }
     CompositeOperator composite() const { return static_cast<CompositeOperator>(m_composite); }
     LengthSize sizeLength() const { return m_sizeLength; }
+    EFillSizeType sizeType() const { return static_cast<EFillSizeType>(m_sizeType); }
     FillSize size() const { return FillSize(static_cast<EFillSizeType>(m_sizeType), m_sizeLength); }
 
     const FillLayer* next() const { return m_next; }
@@ -161,9 +162,10 @@
     static StyleImage* initialFillImage(EFillLayerType) { return 0; }
 
 private:
+    friend class RenderStyle;
+
     FillLayer() { }
 
-public:
     RefPtr<StyleImage> m_image;
 
     Length m_xPosition;
diff --git a/WebCore/rendering/style/NinePieceImage.h b/WebCore/rendering/style/NinePieceImage.h
index bf47ce6..c400551 100644
--- a/WebCore/rendering/style/NinePieceImage.h
+++ b/WebCore/rendering/style/NinePieceImage.h
@@ -55,10 +55,18 @@
 
     bool hasImage() const { return m_image != 0; }
     StyleImage* image() const { return m_image.get(); }
+    void setImage(StyleImage* image) { m_image = image; }
     
+    const LengthBox& slices() const { return m_slices; }
+    void setSlices(const LengthBox& l) { m_slices = l; }
+
     ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(m_horizontalRule); }
-    ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_verticalRule); }
+    void setHorizontalRule(ENinePieceImageRule rule) { m_horizontalRule = rule; }
     
+    ENinePieceImageRule verticalRule() const { return static_cast<ENinePieceImageRule>(m_verticalRule); }
+    void setVerticalRule(ENinePieceImageRule rule) { m_verticalRule = rule; }
+
+private:
     RefPtr<StyleImage> m_image;
     LengthBox m_slices;
     unsigned m_horizontalRule : 2; // ENinePieceImageRule
diff --git a/WebCore/rendering/style/OutlineValue.h b/WebCore/rendering/style/OutlineValue.h
index 2628b7f..19c17a7 100644
--- a/WebCore/rendering/style/OutlineValue.h
+++ b/WebCore/rendering/style/OutlineValue.h
@@ -30,16 +30,17 @@
 namespace WebCore {
 
 class OutlineValue : public BorderValue {
+friend class RenderStyle;
 public:
     OutlineValue()
-        : _offset(0)
-        , _auto(false)
+        : m_offset(0)
+        , m_isAuto(false)
     {
     }
     
     bool operator==(const OutlineValue& o) const
     {
-        return width == o.width && m_style == o.m_style && color == o.color && _offset == o._offset && _auto == o._auto;
+        return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_offset == o.m_offset && m_isAuto == o.m_isAuto;
     }
     
     bool operator!=(const OutlineValue& o) const
@@ -47,8 +48,12 @@
         return !(*this == o);
     }
     
-    int _offset;
-    bool _auto;
+    int offset() const { return m_offset; }
+    bool isAuto() const { return m_isAuto; }
+
+private:
+    int m_offset;
+    bool m_isAuto;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index 712344f..f1cf0bc 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "RenderStyle.h"
 
+#include "CSSPropertyNames.h"
 #include "CSSStyleSelector.h"
 #include "CachedImage.h"
 #include "CounterContent.h"
@@ -58,8 +59,7 @@
 }
 
 RenderStyle::RenderStyle()
-    : m_pseudoState(PseudoUnknown)
-    , m_affectedByAttributeSelectors(false)
+    : m_affectedByAttributeSelectors(false)
     , m_unique(false)
     , m_affectedByEmpty(false)
     , m_emptyState(false)
@@ -71,9 +71,9 @@
     , m_firstChildState(false)
     , m_lastChildState(false)
     , m_childIndex(0)
-    , box(defaultStyle()->box)
+    , m_box(defaultStyle()->m_box)
     , visual(defaultStyle()->visual)
-    , background(defaultStyle()->background)
+    , m_background(defaultStyle()->m_background)
     , surround(defaultStyle()->surround)
     , rareNonInheritedData(defaultStyle()->rareNonInheritedData)
     , rareInheritedData(defaultStyle()->rareInheritedData)
@@ -86,8 +86,7 @@
 }
 
 RenderStyle::RenderStyle(bool)
-    : m_pseudoState(PseudoUnknown)
-    , m_affectedByAttributeSelectors(false)
+    : m_affectedByAttributeSelectors(false)
     , m_unique(false)
     , m_affectedByEmpty(false)
     , m_emptyState(false)
@@ -102,9 +101,9 @@
 {
     setBitDefaults();
 
-    box.init();
+    m_box.init();
     visual.init();
-    background.init();
+    m_background.init();
     surround.init();
     rareNonInheritedData.init();
     rareNonInheritedData.access()->flexibleBox.init();
@@ -121,7 +120,6 @@
 
 RenderStyle::RenderStyle(const RenderStyle& o)
     : RefCounted<RenderStyle>()
-    , m_pseudoState(o.m_pseudoState)
     , m_affectedByAttributeSelectors(false)
     , m_unique(false)
     , m_affectedByEmpty(false)
@@ -134,9 +132,9 @@
     , m_firstChildState(false)
     , m_lastChildState(false)
     , m_childIndex(0)
-    , box(o.box)
+    , m_box(o.m_box)
     , visual(o.visual)
-    , background(o.background)
+    , m_background(o.m_background)
     , surround(o.surround)
     , rareNonInheritedData(o.rareNonInheritedData)
     , rareInheritedData(o.rareInheritedData)
@@ -169,9 +167,9 @@
     // compare everything except the pseudoStyle pointer
     return inherited_flags == o.inherited_flags &&
             noninherited_flags == o.noninherited_flags &&
-            box == o.box &&
+            m_box == o.m_box &&
             visual == o.visual &&
-            background == o.background &&
+            m_background == o.m_background &&
             surround == o.surround &&
             rareNonInheritedData == o.rareNonInheritedData &&
             rareInheritedData == o.rareInheritedData &&
@@ -213,28 +211,39 @@
 
 RenderStyle* RenderStyle::getCachedPseudoStyle(PseudoId pid) const
 {
-    if (!m_cachedPseudoStyle || styleType() != NOPSEUDO)
+    ASSERT(styleType() != VISITED_LINK);
+
+    if (!m_cachedPseudoStyles || !m_cachedPseudoStyles->size())
         return 0;
-    RenderStyle* ps = m_cachedPseudoStyle.get();
-    while (ps && ps->styleType() != pid)
-        ps = ps->m_cachedPseudoStyle.get();
-    return ps;
+
+    if (styleType() != NOPSEUDO) {
+        if (pid == VISITED_LINK)
+            return m_cachedPseudoStyles->at(0)->styleType() == VISITED_LINK ? m_cachedPseudoStyles->at(0).get() : 0;
+        return 0;
+    }
+
+    for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
+        RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
+        if (pseudoStyle->styleType() == pid)
+            return pseudoStyle;
+    }
+
+    return 0;
 }
 
 RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr<RenderStyle> pseudo)
 {
     if (!pseudo)
         return 0;
-    pseudo->m_cachedPseudoStyle = m_cachedPseudoStyle;
-    m_cachedPseudoStyle = pseudo;
-    return m_cachedPseudoStyle.get();
-}
+    
+    RenderStyle* result = pseudo.get();
 
-void RenderStyle::getPseudoStyleCache(PseudoStyleCache& cache) const
-{
-    ASSERT(cache.isEmpty());
-    for (RenderStyle* pseudoStyle = m_cachedPseudoStyle.get(); pseudoStyle; pseudoStyle = pseudoStyle->m_cachedPseudoStyle.get())
-        cache.append(pseudoStyle);
+    if (!m_cachedPseudoStyles)
+        m_cachedPseudoStyles.set(new PseudoStyleCache);
+
+    m_cachedPseudoStyles->append(pseudo);
+
+    return result;
 }
 
 bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const
@@ -297,18 +306,18 @@
         return StyleDifferenceLayout;
 #endif
 
-    if (box->width != other->box->width ||
-        box->min_width != other->box->min_width ||
-        box->max_width != other->box->max_width ||
-        box->height != other->box->height ||
-        box->min_height != other->box->min_height ||
-        box->max_height != other->box->max_height)
+    if (m_box->width() != other->m_box->width() ||
+        m_box->minWidth() != other->m_box->minWidth() ||
+        m_box->maxWidth() != other->m_box->maxWidth() ||
+        m_box->height() != other->m_box->height() ||
+        m_box->minHeight() != other->m_box->minHeight() ||
+        m_box->maxHeight() != other->m_box->maxHeight())
         return StyleDifferenceLayout;
 
-    if (box->vertical_align != other->box->vertical_align || noninherited_flags._vertical_align != other->noninherited_flags._vertical_align)
+    if (m_box->verticalAlign() != other->m_box->verticalAlign() || noninherited_flags._vertical_align != other->noninherited_flags._vertical_align)
         return StyleDifferenceLayout;
 
-    if (box->boxSizing != other->box->boxSizing)
+    if (m_box->boxSizing() != other->m_box->boxSizing())
         return StyleDifferenceLayout;
 
     if (surround->margin != other->surround->margin)
@@ -480,7 +489,7 @@
             //    return RepaintLayer;
             //else
                 return StyleDifferenceLayout;
-        } else if (box->z_index != other->box->z_index || box->z_auto != other->box->z_auto ||
+        } else if (m_box->zIndex() != other->m_box->zIndex() || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex() ||
                  visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
             return StyleDifferenceRepaintLayer;
     }
@@ -502,8 +511,9 @@
         inherited_flags._visibility != other->inherited_flags._visibility ||
         inherited_flags._text_decorations != other->inherited_flags._text_decorations ||
         inherited_flags._force_backgrounds_to_white != other->inherited_flags._force_backgrounds_to_white ||
+        inherited_flags._insideLink != other->inherited_flags._insideLink ||
         surround->border != other->surround->border ||
-        *background.get() != *other->background.get() ||
+        *m_background.get() != *other->m_background.get() ||
         visual->textDecoration != other->visual->textDecoration ||
         rareInheritedData->userModify != other->rareInheritedData->userModify ||
         rareInheritedData->userSelect != other->rareInheritedData->userSelect ||
@@ -543,12 +553,9 @@
 
 void RenderStyle::addCursor(CachedImage* image, const IntPoint& hotSpot)
 {
-    CursorData data;
-    data.cursorImage = image;
-    data.hotSpot = hotSpot;
     if (!inherited.access()->cursorData)
         inherited.access()->cursorData = CursorList::create();
-    inherited.access()->cursorData->append(data);
+    inherited.access()->cursorData->append(CursorData(image, hotSpot));
 }
 
 void RenderStyle::setCursorList(PassRefPtr<CursorList> other)
@@ -707,7 +714,7 @@
 
 void RenderStyle::setTextShadow(ShadowData* val, bool add)
 {
-    ASSERT(!val || (!val->spread && val->style == Normal));
+    ASSERT(!val || (!val->spread() && val->style() == Normal));
 
     StyleRareInheritedData* rareData = rareInheritedData.access();
     if (!add) {
@@ -716,7 +723,7 @@
         return;
     }
 
-    val->next = rareData->textShadow;
+    val->setNext(rareData->textShadow);
     rareData->textShadow = val;
 }
 
@@ -728,17 +735,17 @@
         return;
     }
 
-    shadowData->next = rareData->m_boxShadow.release();
+    shadowData->setNext(rareData->m_boxShadow.release());
     rareData->m_boxShadow.set(shadowData);
 }
 
 void RenderStyle::getBorderRadiiForRect(const IntRect& r, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const
 {
-    topLeft = surround->border.topLeft;
-    topRight = surround->border.topRight;
+    topLeft = surround->border.topLeft();
+    topRight = surround->border.topRight();
     
-    bottomLeft = surround->border.bottomLeft;
-    bottomRight = surround->border.bottomRight;
+    bottomLeft = surround->border.bottomLeft();
+    bottomRight = surround->border.bottomRight();
 
     // Constrain corner radii using CSS3 rules:
     // http://www.w3.org/TR/css3-background/#the-border-radius
@@ -925,15 +932,15 @@
     bottom = 0;
     left = 0;
 
-    for (ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
-        if (boxShadow->style == Inset)
+    for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) {
+        if (boxShadow->style() == Inset)
             continue;
-        int blurAndSpread = boxShadow->blur + boxShadow->spread;
+        int blurAndSpread = boxShadow->blur() + boxShadow->spread();
 
-        top = min(top, boxShadow->y - blurAndSpread);
-        right = max(right, boxShadow->x + blurAndSpread);
-        bottom = max(bottom, boxShadow->y + blurAndSpread);
-        left = min(left, boxShadow->x - blurAndSpread);
+        top = min(top, boxShadow->y() - blurAndSpread);
+        right = max(right, boxShadow->x() + blurAndSpread);
+        bottom = max(bottom, boxShadow->y() + blurAndSpread);
+        left = min(left, boxShadow->x() - blurAndSpread);
     }
 }
 
@@ -942,13 +949,13 @@
     left = 0;
     right = 0;
 
-    for (ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
-        if (boxShadow->style == Inset)
+    for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) {
+        if (boxShadow->style() == Inset)
             continue;
-        int blurAndSpread = boxShadow->blur + boxShadow->spread;
+        int blurAndSpread = boxShadow->blur() + boxShadow->spread();
 
-        left = min(left, boxShadow->x - blurAndSpread);
-        right = max(right, boxShadow->x + blurAndSpread);
+        left = min(left, boxShadow->x() - blurAndSpread);
+        right = max(right, boxShadow->x() + blurAndSpread);
     }
 }
 
@@ -957,14 +964,108 @@
     top = 0;
     bottom = 0;
 
-    for (ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {
-        if (boxShadow->style == Inset)
+    for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) {
+        if (boxShadow->style() == Inset)
             continue;
-        int blurAndSpread = boxShadow->blur + boxShadow->spread;
+        int blurAndSpread = boxShadow->blur() + boxShadow->spread();
 
-        top = min(top, boxShadow->y - blurAndSpread);
-        bottom = max(bottom, boxShadow->y + blurAndSpread);
+        top = min(top, boxShadow->y() - blurAndSpread);
+        bottom = max(bottom, boxShadow->y() + blurAndSpread);
     }
 }
 
+static EBorderStyle borderStyleForColorProperty(const RenderStyle* style, int colorProperty)
+{
+    EBorderStyle borderStyle;
+    switch (colorProperty) {
+    case CSSPropertyBorderLeftColor:
+        borderStyle = style->borderLeftStyle();
+        break;
+    case CSSPropertyBorderRightColor:
+        borderStyle = style->borderRightStyle();
+        break;
+    case CSSPropertyBorderTopColor:
+        borderStyle = style->borderTopStyle();
+        break;
+    case CSSPropertyBorderBottomColor:
+        borderStyle = style->borderBottomStyle();
+        break;
+    default:
+        borderStyle = BNONE;
+        break;
+    }
+    return borderStyle;
+}
+
+static Color colorIncludingFallback(const RenderStyle* style, int colorProperty, EBorderStyle borderStyle)
+{
+    Color result;
+    switch (colorProperty) {
+    case CSSPropertyBackgroundColor:
+        return style->backgroundColor(); // Background color doesn't fall back.
+    case CSSPropertyBorderLeftColor:
+        result = style->borderLeftColor();
+        borderStyle = style->borderLeftStyle();
+        break;
+    case CSSPropertyBorderRightColor:
+        result = style->borderRightColor();
+        borderStyle = style->borderRightStyle();
+        break;
+    case CSSPropertyBorderTopColor:
+        result = style->borderTopColor();
+        borderStyle = style->borderTopStyle();
+        break;
+    case CSSPropertyBorderBottomColor:
+        result = style->borderBottomColor();
+        borderStyle = style->borderBottomStyle();
+        break;
+    case CSSPropertyColor:
+        result = style->color();
+        break;
+    case CSSPropertyOutlineColor:
+        result = style->outlineColor();
+        break;
+    case CSSPropertyWebkitColumnRuleColor:
+        result = style->columnRuleColor();
+        break;
+    case CSSPropertyWebkitTextFillColor:
+        result = style->textFillColor();
+        break;
+    case CSSPropertyWebkitTextStrokeColor:
+        result = style->textStrokeColor();
+        break;
+    default:
+        // FIXME: Add SVG fill and stroke.
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    if (!result.isValid()) {
+        if ((colorProperty == CSSPropertyBorderLeftColor || colorProperty == CSSPropertyBorderRightColor
+            || colorProperty == CSSPropertyBorderTopColor || colorProperty == CSSPropertyBorderBottomColor)
+            && (borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE))
+            result.setRGB(238, 238, 238);
+        else
+            result = style->color();
+    }
+
+    return result;
+}
+
+Color RenderStyle::visitedDependentColor(int colorProperty) const
+{
+    EBorderStyle borderStyle = borderStyleForColorProperty(this, colorProperty);
+    Color unvisitedColor = colorIncludingFallback(this, colorProperty, borderStyle);
+    if (insideLink() != InsideVisitedLink)
+        return unvisitedColor;
+
+    RenderStyle* visitedStyle = getCachedPseudoStyle(VISITED_LINK);
+    if (!visitedStyle)
+        return unvisitedColor;
+    Color visitedColor = colorIncludingFallback(visitedStyle, colorProperty, borderStyle);
+
+    // Take the alpha from the unvisited color, but get the RGB values from the visited color.
+    return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
+}
+
 } // namespace WebCore
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index c7db254..fe42339 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -110,13 +110,14 @@
 class StringImpl;
 class StyleImage;
 
+typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
+
 class RenderStyle: public RefCounted<RenderStyle> {
     friend class CSSStyleSelector;
 protected:
 
     // The following bitfield is 32-bits long, which optimizes padding with the
     // int refCount in the base class. Beware when adding more bits.
-    unsigned m_pseudoState : 3; // PseudoState
     bool m_affectedByAttributeSelectors : 1;
     bool m_unique : 1;
 
@@ -133,12 +134,12 @@
     bool m_childrenAffectedByBackwardPositionalRules : 1;
     bool m_firstChildState : 1;
     bool m_lastChildState : 1;
-    unsigned m_childIndex : 18; // Plenty of bits to cache an index.
+    unsigned m_childIndex : 21; // Plenty of bits to cache an index.
 
     // non-inherited attributes
-    DataRef<StyleBoxData> box;
+    DataRef<StyleBoxData> m_box;
     DataRef<StyleVisualData> visual;
-    DataRef<StyleBackgroundData> background;
+    DataRef<StyleBackgroundData> m_background;
     DataRef<StyleSurroundData> surround;
     DataRef<StyleRareNonInheritedData> rareNonInheritedData;
 
@@ -147,7 +148,7 @@
     DataRef<StyleInheritedData> inherited;
 
     // list of associated pseudo styles
-    RefPtr<RenderStyle> m_cachedPseudoStyle;
+    OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
 
 #if ENABLE(SVG)
     DataRef<SVGRenderStyle> m_svgStyle;
@@ -176,7 +177,8 @@
                    (_visuallyOrdered == other._visuallyOrdered) &&
                    (_htmlHacks == other._htmlHacks) &&
                    (_force_backgrounds_to_white == other._force_backgrounds_to_white) &&
-                   (_pointerEvents == other._pointerEvents);
+                   (_pointerEvents == other._pointerEvents) &&
+                   (_insideLink == other._insideLink);
         }
 
         bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
@@ -201,7 +203,8 @@
         bool _htmlHacks : 1;
         bool _force_backgrounds_to_white : 1;
         unsigned _pointerEvents : 4; // EPointerEvents
-        // 41 bits
+        unsigned _insideLink : 2; // EInsideLink
+        // 43 bits
     } inherited_flags;
 
 // don't inherit
@@ -225,7 +228,8 @@
                 && _affectedByActive == other._affectedByActive
                 && _affectedByDrag == other._affectedByDrag
                 && _pseudoBits == other._pseudoBits
-                && _unicodeBidi == other._unicodeBidi;
+                && _unicodeBidi == other._unicodeBidi
+                && _isLink == other._isLink;
         }
 
         bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
@@ -244,12 +248,13 @@
         unsigned _page_break_after : 2; // EPageBreak
         unsigned _page_break_inside : 2; // EPageBreak
 
-        unsigned _styleType : 5; // PseudoId
+        unsigned _styleType : 6; // PseudoId
         bool _affectedByHover : 1;
         bool _affectedByActive : 1;
         bool _affectedByDrag : 1;
         unsigned _pseudoBits : 7;
         unsigned _unicodeBidi : 2; // EUnicodeBidi
+        bool _isLink : 1;
         // 50 bits
     } noninherited_flags;
 
@@ -275,6 +280,7 @@
         inherited_flags._box_direction = initialBoxDirection();
         inherited_flags._force_backgrounds_to_white = false;
         inherited_flags._pointerEvents = initialPointerEvents();
+        inherited_flags._insideLink = NotInsideLink;
 
         noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
         noninherited_flags._overflowX = initialOverflowX();
@@ -293,6 +299,7 @@
         noninherited_flags._affectedByDrag = false;
         noninherited_flags._pseudoBits = 0;
         noninherited_flags._unicodeBidi = initialUnicodeBidi();
+        noninherited_flags._isLink = false;
     }
 
 protected:
@@ -316,8 +323,7 @@
     RenderStyle* getCachedPseudoStyle(PseudoId) const;
     RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
 
-    typedef Vector<RenderStyle*, 10> PseudoStyleCache;
-    void getPseudoStyleCache(PseudoStyleCache&) const;
+    const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
 
     bool affectedByHoverRules() const { return noninherited_flags._affectedByHover; }
     bool affectedByActiveRules() const { return noninherited_flags._affectedByActive; }
@@ -339,10 +345,10 @@
     {
         if (backgroundColor().isValid() && backgroundColor().alpha() > 0)
             return true;
-        return background->m_background.hasImage();
+        return m_background->background().hasImage();
     }
-    bool hasBackgroundImage() const { return background->m_background.hasImage(); }
-    bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }
+    bool hasBackgroundImage() const { return m_background->background().hasImage(); }
+    bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
     bool hasAppearance() const { return appearance() != NoControlPart; }
 
     bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
@@ -372,62 +378,62 @@
     EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
     EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
 
-    Length width() const { return box->width; }
-    Length height() const { return box->height; }
-    Length minWidth() const { return box->min_width; }
-    Length maxWidth() const { return box->max_width; }
-    Length minHeight() const { return box->min_height; }
-    Length maxHeight() const { return box->max_height; }
+    Length width() const { return m_box->width(); }
+    Length height() const { return m_box->height(); }
+    Length minWidth() const { return m_box->minWidth(); }
+    Length maxWidth() const { return m_box->maxWidth(); }
+    Length minHeight() const { return m_box->minHeight(); }
+    Length maxHeight() const { return m_box->maxHeight(); }
 
     const BorderData& border() const { return surround->border; }
-    const BorderValue& borderLeft() const { return surround->border.left; }
-    const BorderValue& borderRight() const { return surround->border.right; }
-    const BorderValue& borderTop() const { return surround->border.top; }
-    const BorderValue& borderBottom() const { return surround->border.bottom; }
+    const BorderValue& borderLeft() const { return surround->border.left(); }
+    const BorderValue& borderRight() const { return surround->border.right(); }
+    const BorderValue& borderTop() const { return surround->border.top(); }
+    const BorderValue& borderBottom() const { return surround->border.bottom(); }
 
-    const NinePieceImage& borderImage() const { return surround->border.image; }
+    const NinePieceImage& borderImage() const { return surround->border.image(); }
 
-    const IntSize& borderTopLeftRadius() const { return surround->border.topLeft; }
-    const IntSize& borderTopRightRadius() const { return surround->border.topRight; }
-    const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft; }
-    const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight; }
+    const IntSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
+    const IntSize& borderTopRightRadius() const { return surround->border.topRight(); }
+    const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
+    const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
     bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
 
     unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }
-    EBorderStyle borderLeftStyle() const { return surround->border.left.style(); }
-    const Color& borderLeftColor() const { return surround->border.left.color; }
-    bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); }
+    EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
+    const Color& borderLeftColor() const { return surround->border.left().color(); }
+    bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
     unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); }
-    EBorderStyle borderRightStyle() const { return surround->border.right.style(); }
-    const Color& borderRightColor() const { return surround->border.right.color; }
-    bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); }
+    EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
+    const Color& borderRightColor() const { return surround->border.right().color(); }
+    bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
     unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); }
-    EBorderStyle borderTopStyle() const { return surround->border.top.style(); }
-    const Color& borderTopColor() const { return surround->border.top.color; }
-    bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); }
+    EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
+    const Color& borderTopColor() const { return surround->border.top().color(); }
+    bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
     unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
-    EBorderStyle borderBottomStyle() const { return surround->border.bottom.style(); }
-    const Color& borderBottomColor() const { return surround->border.bottom.color; }
-    bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); }
+    EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
+    const Color& borderBottomColor() const { return surround->border.bottom().color(); }
+    bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
 
     unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
     unsigned short outlineWidth() const
     {
-        if (background->m_outline.style() == BNONE)
+        if (m_background->outline().style() == BNONE)
             return 0;
-        return background->m_outline.width;
+        return m_background->outline().width();
     }
     bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
-    EBorderStyle outlineStyle() const { return background->m_outline.style(); }
-    bool outlineStyleIsAuto() const { return background->m_outline._auto; }
-    const Color& outlineColor() const { return background->m_outline.color; }
+    EBorderStyle outlineStyle() const { return m_background->outline().style(); }
+    bool outlineStyleIsAuto() const { return m_background->outline().isAuto(); }
+    const Color& outlineColor() const { return m_background->outline().color(); }
 
     EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
     EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
 
     EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
     EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
-    Length verticalAlignLength() const { return box->vertical_align; }
+    Length verticalAlignLength() const { return m_box->verticalAlign(); }
 
     Length clipLeft() const { return visual->clip.left(); }
     Length clipRight() const { return visual->clip.right(); }
@@ -529,31 +535,32 @@
         return wordBreak() == BreakWordBreak || wordWrap() == BreakWordWrap;
     }
 
-    const Color& backgroundColor() const { return background->m_color; }
-    StyleImage* backgroundImage() const { return background->m_background.m_image.get(); }
-    EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(background->m_background.m_repeatX); }
-    EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(background->m_background.m_repeatY); }
-    CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(background->m_background.m_composite); }
-    EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(background->m_background.m_attachment); }
-    EFillBox backgroundClip() const { return static_cast<EFillBox>(background->m_background.m_clip); }
-    EFillBox backgroundOrigin() const { return static_cast<EFillBox>(background->m_background.m_origin); }
-    Length backgroundXPosition() const { return background->m_background.m_xPosition; }
-    Length backgroundYPosition() const { return background->m_background.m_yPosition; }
-    EFillSizeType backgroundSizeType() const { return static_cast<EFillSizeType>(background->m_background.m_sizeType); }
-    LengthSize backgroundSizeLength() const { return background->m_background.m_sizeLength; }
-    FillLayer* accessBackgroundLayers() { return &(background.access()->m_background); }
-    const FillLayer* backgroundLayers() const { return &(background->m_background); }
+    const Color& backgroundColor() const { return m_background->color(); }
+    StyleImage* backgroundImage() const { return m_background->background().image(); }
+    EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
+    EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
+    CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
+    EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
+    EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
+    EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
+    Length backgroundXPosition() const { return m_background->background().xPosition(); }
+    Length backgroundYPosition() const { return m_background->background().yPosition(); }
+    EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
+    LengthSize backgroundSizeLength() const { return m_background->background().sizeLength(); }
+    FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
+    const FillLayer* backgroundLayers() const { return &(m_background->background()); }
 
-    StyleImage* maskImage() const { return rareNonInheritedData->m_mask.m_image.get(); }
-    EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatX); }
-    EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatY); }
-    CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.m_composite); }
-    EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.m_attachment); }
-    EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_clip); }
-    EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_origin); }
-    Length maskXPosition() const { return rareNonInheritedData->m_mask.m_xPosition; }
-    Length maskYPosition() const { return rareNonInheritedData->m_mask.m_yPosition; }
-    LengthSize maskSize() const { return rareNonInheritedData->m_mask.m_sizeLength; }
+    StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
+    EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
+    EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
+    CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
+    EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.attachment()); }
+    EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
+    EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
+    Length maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
+    Length maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
+    EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
+    LengthSize maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
     FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
     const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
     const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
@@ -587,6 +594,9 @@
 
     CursorList* cursors() const { return inherited->cursorData.get(); }
 
+    EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
+    bool isLink() const { return noninherited_flags._isLink; }
+
     short widows() const { return inherited->widows; }
     short orphans() const { return inherited->orphans; }
     EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
@@ -600,12 +610,12 @@
 
     int outlineOffset() const
     {
-        if (background->m_outline.style() == BNONE)
+        if (m_background->outline().style() == BNONE)
             return 0;
-        return background->m_outline._offset;
+        return m_background->outline().offset();
     }
 
-    ShadowData* textShadow() const { return rareInheritedData->textShadow; }
+    const ShadowData* textShadow() const { return rareInheritedData->textShadow; }
     const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
     float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
     const Color& textFillColor() const { return rareInheritedData->textFillColor; }
@@ -621,13 +631,13 @@
     EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->flexibleBox->orient); }
     EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); }
 
-    ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
+    const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
     void getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const;
     void getBoxShadowHorizontalExtent(int &left, int &right) const;
     void getBoxShadowVerticalExtent(int &top, int &bottom) const;
 
     StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
-    EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(box->boxSizing); }
+    EBoxSizing boxSizing() const { return m_box->boxSizing(); }
     Length marqueeIncrement() const { return rareNonInheritedData->marquee->increment; }
     int marqueeSpeed() const { return rareNonInheritedData->marquee->speed; }
     int marqueeLoopCount() const { return rareNonInheritedData->marquee->loops; }
@@ -653,7 +663,7 @@
     bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
     float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
     bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
-    const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color; }
+    const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
     EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
     unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
     bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
@@ -724,13 +734,13 @@
     void setTop(Length v) { SET_VAR(surround, offset.m_top, v) }
     void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v) }
 
-    void setWidth(Length v) { SET_VAR(box, width, v) }
-    void setHeight(Length v) { SET_VAR(box, height, v) }
+    void setWidth(Length v) { SET_VAR(m_box, m_width, v) }
+    void setHeight(Length v) { SET_VAR(m_box, m_height, v) }
 
-    void setMinWidth(Length v) { SET_VAR(box, min_width, v) }
-    void setMaxWidth(Length v) { SET_VAR(box, max_width, v) }
-    void setMinHeight(Length v) { SET_VAR(box, min_height, v) }
-    void setMaxHeight(Length v) { SET_VAR(box, max_height, v) }
+    void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, v) }
+    void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, v) }
+    void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v) }
+    void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v) }
 
 #if ENABLE(DASHBOARD_SUPPORT)
     Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
@@ -752,32 +762,32 @@
 #endif
 
     void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
-    void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) }
-    void resetBorderRight() { SET_VAR(surround, border.right, BorderValue()) }
-    void resetBorderBottom() { SET_VAR(surround, border.bottom, BorderValue()) }
-    void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) }
-    void resetBorderImage() { SET_VAR(surround, border.image, NinePieceImage()) }
+    void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) }
+    void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) }
+    void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()) }
+    void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()) }
+    void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()) }
     void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
-    void resetBorderTopLeftRadius() { SET_VAR(surround, border.topLeft, initialBorderRadius()) }
-    void resetBorderTopRightRadius() { SET_VAR(surround, border.topRight, initialBorderRadius()) }
-    void resetBorderBottomLeftRadius() { SET_VAR(surround, border.bottomLeft, initialBorderRadius()) }
-    void resetBorderBottomRightRadius() { SET_VAR(surround, border.bottomRight, initialBorderRadius()) }
+    void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()) }
+    void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()) }
+    void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()) }
+    void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) }
 
-    void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) }
+    void resetOutline() { SET_VAR(m_background, m_outline, OutlineValue()) }
 
-    void setBackgroundColor(const Color& v) { SET_VAR(background, m_color, v) }
+    void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v) }
 
-    void setBackgroundXPosition(Length l) { SET_VAR(background, m_background.m_xPosition, l) }
-    void setBackgroundYPosition(Length l) { SET_VAR(background, m_background.m_yPosition, l) }
-    void setBackgroundSize(EFillSizeType b) { SET_VAR(background, m_background.m_sizeType, b) }
-    void setBackgroundSizeLength(LengthSize l) { SET_VAR(background, m_background.m_sizeLength, l) }
+    void setBackgroundXPosition(Length l) { SET_VAR(m_background, m_background.m_xPosition, l) }
+    void setBackgroundYPosition(Length l) { SET_VAR(m_background, m_background.m_yPosition, l) }
+    void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b) }
+    void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) }
     
-    void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.image, b) }
+    void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) }
 
-    void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.topLeft, s) }
-    void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.topRight, s) }
-    void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.bottomLeft, s) }
-    void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.bottomRight, s) }
+    void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_topLeft, s) }
+    void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.m_topRight, s) }
+    void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomLeft, s) }
+    void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomRight, s) }
 
     void setBorderRadius(const IntSize& s)
     {
@@ -789,33 +799,33 @@
     
     void getBorderRadiiForRect(const IntRect&, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const;
 
-    void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.left.width, v) }
-    void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.left.m_style, v) }
-    void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.left.color, v) }
-    void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.right.width, v) }
-    void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.right.m_style, v) }
-    void setBorderRightColor(const Color& v) { SET_VAR(surround, border.right.color, v) }
-    void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.top.width, v) }
-    void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.top.m_style, v) }
-    void setBorderTopColor(const Color& v) { SET_VAR(surround, border.top.color, v) }
-    void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.bottom.width, v) }
-    void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.bottom.m_style, v) }
-    void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.bottom.color, v) }
-    void setOutlineWidth(unsigned short v) { SET_VAR(background, m_outline.width, v) }
+    void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) }
+    void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) }
+    void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.m_left.m_color, v) }
+    void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.m_right.m_width, v) }
+    void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v) }
+    void setBorderRightColor(const Color& v) { SET_VAR(surround, border.m_right.m_color, v) }
+    void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.m_top.m_width, v) }
+    void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v) }
+    void setBorderTopColor(const Color& v) { SET_VAR(surround, border.m_top.m_color, v) }
+    void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.m_bottom.m_width, v) }
+    void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) }
+    void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.m_bottom.m_color, v) }
+    void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) }
 
     void setOutlineStyle(EBorderStyle v, bool isAuto = false)
     {
-        SET_VAR(background, m_outline.m_style, v)
-        SET_VAR(background, m_outline._auto, isAuto)
+        SET_VAR(m_background, m_outline.m_style, v)
+        SET_VAR(m_background, m_outline.m_isAuto, isAuto)
     }
 
-    void setOutlineColor(const Color& v) { SET_VAR(background, m_outline.color, v) }
+    void setOutlineColor(const Color& v) { SET_VAR(m_background, m_outline.m_color, v) }
 
     void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
     void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
     void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
     void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
-    void setVerticalAlignLength(Length l) { SET_VAR(box, vertical_align, l) }
+    void setVerticalAlignLength(Length l) { SET_VAR(m_box, m_verticalAlign, l) }
 
     void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b) }
     void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v) }
@@ -858,8 +868,8 @@
     void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
     void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
 
-    void clearBackgroundLayers() { background.access()->m_background = FillLayer(BackgroundFillLayer); }
-    void inheritBackgroundLayers(const FillLayer& parent) { background.access()->m_background = parent; }
+    void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
+    void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
 
     void adjustBackgroundLayers()
     {
@@ -916,16 +926,19 @@
     void setCursorList(PassRefPtr<CursorList>);
     void clearCursorList();
 
+    void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
+    void setIsLink(bool b) { noninherited_flags._isLink = b; }
+
     bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
     void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
 
     bool htmlHacks() const { return inherited_flags._htmlHacks; }
     void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; }
 
-    bool hasAutoZIndex() const { return box->z_auto; }
-    void setHasAutoZIndex() { SET_VAR(box, z_auto, true); SET_VAR(box, z_index, 0) }
-    int zIndex() const { return box->z_index; }
-    void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box, z_index, v) }
+    bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
+    void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) }
+    int zIndex() const { return m_box->zIndex(); }
+    void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v) }
 
     void setWidows(short w) { SET_VAR(inherited, widows, w); }
     void setOrphans(short o) { SET_VAR(inherited, orphans, o); }
@@ -940,7 +953,7 @@
     void addBindingURI(StringImpl* uri);
 #endif
 
-    void setOutlineOffset(int v) { SET_VAR(background, m_outline._offset, v) }
+    void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) }
     void setTextShadow(ShadowData* val, bool add=false);
     void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) }
     void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
@@ -958,7 +971,7 @@
     void setBoxPack(EBoxAlignment p) { SET_VAR(rareNonInheritedData.access()->flexibleBox, pack, p); }
     void setBoxShadow(ShadowData* val, bool add=false);
     void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
-    void setBoxSizing(EBoxSizing s) { SET_VAR(box, boxSizing, s); }
+    void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
     void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->marquee, increment, f); }
     void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->marquee, speed, f); }
     void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->marquee, direction, d); }
@@ -984,9 +997,9 @@
     void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
     void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
     void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
-    void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.color, c); }
+    void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_color, c); }
     void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
-    void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.width, w); }
+    void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); }
     void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) }
     void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
     void setColumnBreakInside(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
@@ -1077,10 +1090,6 @@
                originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
     }
 
-    // To obtain at any time the pseudo state for a given link.
-    PseudoState pseudoState() const { return static_cast<PseudoState>(m_pseudoState); }
-    void setPseudoState(PseudoState s) { m_pseudoState = s; }
-
     // To tell if this style matched attribute selectors. This makes it impossible to share.
     bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
     void setAffectedByAttributeSelectors() { m_affectedByAttributeSelectors = true; }
@@ -1110,6 +1119,8 @@
     unsigned childIndex() const { return m_childIndex; }
     void setChildIndex(unsigned index) { m_childIndex = index; }
 
+    Color visitedDependentColor(int colorProperty) const;
+
     // Initial values for all the properties
     static bool initialBorderCollapse() { return false; }
     static EBorderStyle initialBorderStyle() { return BNONE; }
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index 4abbc1c..b899d57 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -74,8 +74,9 @@
     MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, 
     MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON,
     MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
-    INPUT_LIST_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON,
+    INPUT_LIST_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
 
+    AFTER_LAST_INTERNAL_PSEUDOID,
     FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
     FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON,
     PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1)
@@ -87,8 +88,6 @@
 
 enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
 
-enum PseudoState { PseudoUnknown, PseudoNone, PseudoAnyLink, PseudoLink, PseudoVisited};
-
 enum EPosition {
     StaticPosition, RelativePosition, AbsolutePosition, FixedPosition
 };
@@ -97,7 +96,6 @@
     FNONE = 0, FLEFT, FRIGHT
 };
 
-
 enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
 
 // Box attributes. Not inherited.
@@ -293,6 +291,8 @@
 
 enum EBorderFit { BorderFitBorder, BorderFitLines };
 
+enum EAnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth };
+
 enum EAnimPlayState {
     AnimPlayStatePlaying = 0x0,
     AnimPlayStatePaused = 0x1
@@ -386,6 +386,10 @@
     NONE
 };
 
+enum EInsideLink {
+    NotInsideLink, InsideUnvisitedLink, InsideVisitedLink
+};
+    
 enum EPointerEvents {
     PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
     PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL
diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp
index 7958088..042b8f7 100644
--- a/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     Based on khtml code by:
     Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
@@ -25,6 +26,7 @@
 */
 
 #include "config.h"
+
 #if ENABLE(SVG)
 #include "SVGRenderStyle.h"
 
@@ -32,8 +34,6 @@
 #include "CSSValueList.h"
 #include "IntRect.h"
 #include "NodeRenderStyle.h"
-#include "RenderObject.h"
-#include "RenderStyle.h"
 #include "SVGStyledElement.h"
 
 using namespace std;
@@ -48,11 +48,10 @@
     stroke = defaultStyle->stroke;
     text = defaultStyle->text;
     stops = defaultStyle->stops;
-    clip = defaultStyle->clip;
-    mask = defaultStyle->mask;
     misc = defaultStyle->misc;
-    markers = defaultStyle->markers;
     shadowSVG = defaultStyle->shadowSVG;
+    inheritedResources = defaultStyle->inheritedResources;
+    resources = defaultStyle->resources;
 
     setBitDefaults();
 }
@@ -65,11 +64,10 @@
     stroke.init();
     text.init();
     stops.init();
-    clip.init();
-    mask.init();
     misc.init();
-    markers.init();
     shadowSVG.init();
+    inheritedResources.init();
+    resources.init();
 }
 
 SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
@@ -79,11 +77,10 @@
     stroke = other.stroke;
     text = other.text;
     stops = other.stops;
-    clip = other.clip;
-    mask = other.mask;
     misc = other.misc;
-    markers = other.markers;
     shadowSVG = other.shadowSVG;
+    inheritedResources = other.inheritedResources;
+    resources = other.resources;
 
     svg_inherited_flags = other.svg_inherited_flags;
     svg_noninherited_flags = other.svg_noninherited_flags;
@@ -93,22 +90,27 @@
 {
 }
 
-bool SVGRenderStyle::operator==(const SVGRenderStyle& o) const
+bool SVGRenderStyle::operator==(const SVGRenderStyle& other) const
 {
-    return (fill == o.fill && stroke == o.stroke && text == o.text &&
-        stops == o.stops && clip == o.clip && mask == o.mask &&
-        misc == o.misc && markers == o.markers && shadowSVG == o.shadowSVG &&
-        svg_inherited_flags == o.svg_inherited_flags &&
-        svg_noninherited_flags == o.svg_noninherited_flags);
+    return fill == other.fill
+        && stroke == other.stroke
+        && text == other.text
+        && stops == other.stops
+        && misc == other.misc
+        && shadowSVG == other.shadowSVG
+        && inheritedResources == other.inheritedResources
+        && resources == other.resources
+        && svg_inherited_flags == other.svg_inherited_flags
+        && svg_noninherited_flags == other.svg_noninherited_flags;
 }
 
 bool SVGRenderStyle::inheritedNotEqual(const SVGRenderStyle* other) const
 {
-    return (fill != other->fill
-            || stroke != other->stroke
-            || markers != other->markers
-            || text != other->text
-            || svg_inherited_flags != other->svg_inherited_flags);
+    return fill != other->fill
+        || stroke != other->stroke
+        || text != other->text
+        || inheritedResources != other->inheritedResources
+        || svg_inherited_flags != other->svg_inherited_flags;
 }
 
 void SVGRenderStyle::inheritFrom(const SVGRenderStyle* svgInheritParent)
@@ -118,8 +120,8 @@
 
     fill = svgInheritParent->fill;
     stroke = svgInheritParent->stroke;
-    markers = svgInheritParent->markers;
     text = svgInheritParent->text;
+    inheritedResources = svgInheritParent->inheritedResources;
 
     svg_inherited_flags = svgInheritParent->svg_inherited_flags;
 }
@@ -144,7 +146,6 @@
     return primitive->computeLengthFloat(const_cast<RenderStyle*>(item->style()), item->document()->documentElement()->renderStyle());
 }
 
-
 static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left)
 {
     top = 0;
@@ -152,12 +153,12 @@
     bottom = 0;
     left = 0;
 
-    int blurAndSpread = shadow->blur + shadow->spread;
+    int blurAndSpread = shadow->blur() + shadow->spread();
 
-    top = min(top, shadow->y - blurAndSpread);
-    right = max(right, shadow->x + blurAndSpread);
-    bottom = max(bottom, shadow->y + blurAndSpread);
-    left = min(left, shadow->x - blurAndSpread);
+    top = min(top, shadow->y() - blurAndSpread);
+    right = max(right, shadow->x() + blurAndSpread);
+    bottom = max(bottom, shadow->y() + blurAndSpread);
+    left = min(left, shadow->x() - blurAndSpread);
 }
 
 void SVGRenderStyle::inflateForShadow(IntRect& repaintRect) const
@@ -197,5 +198,3 @@
 }
 
 #endif // ENABLE(SVG)
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h
index c7f85db..c6d5022 100644
--- a/WebCore/rendering/style/SVGRenderStyle.h
+++ b/WebCore/rendering/style/SVGRenderStyle.h
@@ -2,6 +2,7 @@
     Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005 Rob Buis <buis@kde.org>
     Copyright (C) 2005, 2006 Apple Computer, Inc.
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -26,11 +27,9 @@
 #include "CSSValueList.h"
 #include "DataRef.h"
 #include "GraphicsTypes.h"
+#include "Path.h"
 #include "SVGPaint.h"
 #include "SVGRenderStyleDefs.h"
-#include "ShadowData.h"
-
-#include <wtf/Platform.h>
 
 namespace WebCore {
 
@@ -91,13 +90,6 @@
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, stops, opacity, StopOpacity, stopOpacity, 1.0f)
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, stops, color, StopColor, stopColor, Color(0, 0, 0))    
 
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, clip, clipPath, ClipPath, clipPath, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, mask, maskElement, MaskElement, maskElement, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, markers, startMarker, StartMarker, startMarker, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, markers, midMarker, MidMarker, midMarker, String())
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, markers, endMarker, EndMarker, endMarker, String())
-
-    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, misc, filter, Filter, filter, String())
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(float, misc, floodOpacity, FloodOpacity, floodOpacity, 1.0f)
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, floodColor, FloodColor, floodColor, Color(0, 0, 0))
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, lightingColor, LightingColor, lightingColor, Color(255, 255, 255))
@@ -105,6 +97,16 @@
 
     SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(ShadowData, shadowSVG, shadow, Shadow, shadow, 0)
 
+    // Non-inherited resources
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, clipper, ClipperResource, clipperResource, String())
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, filter, FilterResource, filterResource, String())
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, resources, masker, MaskerResource, maskerResource, String())
+
+    // Inherited resources
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerStart, MarkerStartResource, markerStartResource, String())
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerMid, MarkerMidResource, markerMidResource, String())
+    SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(String, inheritedResources, markerEnd, MarkerEndResource, markerEndResource, String())
+
     // convenience
     bool hasStroke() const { return (strokePaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
     bool hasFill() const { return (fillPaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
@@ -171,15 +173,14 @@
     // inherited attributes
     DataRef<StyleFillData> fill;
     DataRef<StyleStrokeData> stroke;
-    DataRef<StyleMarkerData> markers;
     DataRef<StyleTextData> text;
+    DataRef<StyleInheritedResourceData> inheritedResources;
 
     // non-inherited attributes
     DataRef<StyleStopData> stops;
-    DataRef<StyleClipData> clip;
-    DataRef<StyleMaskData> mask;
     DataRef<StyleMiscData> misc;
     DataRef<StyleShadowSVGData> shadowSVG;
+    DataRef<StyleResourceData> resources;
 
 private:
     enum CreateDefaultType { CreateDefault };
@@ -215,5 +216,3 @@
 
 #endif // ENABLE(SVG)
 #endif // SVGRenderStyle_h
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/WebCore/rendering/style/SVGRenderStyleDefs.cpp
index 093f1f1..bf7624f 100644
--- a/WebCore/rendering/style/SVGRenderStyleDefs.cpp
+++ b/WebCore/rendering/style/SVGRenderStyleDefs.cpp
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2007 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     Based on khtml code by:
     Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
@@ -25,28 +26,29 @@
 */
 
 #include "config.h"
+
 #if ENABLE(SVG)
 #include "SVGRenderStyleDefs.h"
 
 #include "RenderStyle.h"
 #include "SVGRenderStyle.h"
 
-using namespace WebCore;
+namespace WebCore {
 
 StyleFillData::StyleFillData()
+    : opacity(SVGRenderStyle::initialFillOpacity())
+    , paint(SVGRenderStyle::initialFillPaint())
 {
-    paint = SVGRenderStyle::initialFillPaint();
-    opacity = SVGRenderStyle::initialFillOpacity();
 }
 
 StyleFillData::StyleFillData(const StyleFillData& other)
     : RefCounted<StyleFillData>()
+    , opacity(other.opacity)
+    , paint(other.paint)
 {
-    paint = other.paint;
-    opacity = other.opacity;
 }
 
-bool StyleFillData::operator==(const StyleFillData &other) const
+bool StyleFillData::operator==(const StyleFillData& other) const
 {
     if (opacity != other.opacity)
         return false;
@@ -67,64 +69,64 @@
 }
 
 StyleStrokeData::StyleStrokeData()
+    : opacity(SVGRenderStyle::initialStrokeOpacity())
+    , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
+    , width(SVGRenderStyle::initialStrokeWidth())
+    , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
+    , paint(SVGRenderStyle::initialStrokePaint())
+    , dashArray(SVGRenderStyle::initialStrokeDashArray())
 {
-    width = SVGRenderStyle::initialStrokeWidth();
-    paint = SVGRenderStyle::initialStrokePaint();
-    opacity = SVGRenderStyle::initialStrokeOpacity();
-    miterLimit = SVGRenderStyle::initialStrokeMiterLimit();
-    dashOffset = SVGRenderStyle::initialStrokeDashOffset();
-    dashArray = SVGRenderStyle::initialStrokeDashArray();
 }
 
 StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
     : RefCounted<StyleStrokeData>()
+    , opacity(other.opacity)
+    , miterLimit(other.miterLimit)
+    , width(other.width)
+    , dashOffset(other.dashOffset)
+    , paint(other.paint)
+    , dashArray(other.dashArray)
 {
-    width = other.width;
-    paint = other.paint;
-    opacity = other.opacity;
-    miterLimit = other.miterLimit;
-    dashOffset = other.dashOffset;
-    dashArray = other.dashArray;
 }
 
-bool StyleStrokeData::operator==(const StyleStrokeData &other) const
+bool StyleStrokeData::operator==(const StyleStrokeData& other) const
 {
-    return (paint == other.paint) &&
-           (width == other.width) &&
-           (opacity == other.opacity) &&
-           (miterLimit == other.miterLimit) &&
-           (dashOffset == other.dashOffset) &&
-           (dashArray == other.dashArray);
+    return paint == other.paint
+        && width == other.width
+        && opacity == other.opacity
+        && miterLimit == other.miterLimit
+        && dashOffset == other.dashOffset
+        && dashArray == other.dashArray;
 }
 
 StyleStopData::StyleStopData()
+    : opacity(SVGRenderStyle::initialStopOpacity())
+    , color(SVGRenderStyle::initialStopColor())
 {
-    color = SVGRenderStyle::initialStopColor();
-    opacity = SVGRenderStyle::initialStopOpacity();
 }
 
 StyleStopData::StyleStopData(const StyleStopData& other)
     : RefCounted<StyleStopData>()
+    , opacity(other.opacity)
+    , color(other.color)
 {
-    color = other.color;
-    opacity = other.opacity;
 }
 
-bool StyleStopData::operator==(const StyleStopData &other) const
+bool StyleStopData::operator==(const StyleStopData& other) const
 {
-    return (color == other.color) &&
-           (opacity == other.opacity);
+    return color == other.color
+        && opacity == other.opacity;
 }
 
 StyleTextData::StyleTextData()
+    : kerning(SVGRenderStyle::initialKerning())
 {
-    kerning = SVGRenderStyle::initialKerning();
 }
 
 StyleTextData::StyleTextData(const StyleTextData& other)
     : RefCounted<StyleTextData>()
+    , kerning(other.kerning)
 {
-    kerning = other.kerning;
 }
 
 bool StyleTextData::operator==(const StyleTextData& other) const
@@ -132,83 +134,29 @@
     return kerning == other.kerning;
 }
 
-StyleClipData::StyleClipData()
-{
-    clipPath = SVGRenderStyle::initialClipPath();
-}
-
-StyleClipData::StyleClipData(const StyleClipData& other)
-    : RefCounted<StyleClipData>()
-{
-    clipPath = other.clipPath;
-}
-
-bool StyleClipData::operator==(const StyleClipData &other) const
-{
-    return (clipPath == other.clipPath);
-}
-
-StyleMaskData::StyleMaskData()
-{
-    maskElement = SVGRenderStyle::initialMaskElement();
-}
-
-StyleMaskData::StyleMaskData(const StyleMaskData& other)
-    : RefCounted<StyleMaskData>()
-{
-    maskElement = other.maskElement;
-}
-
-bool StyleMaskData::operator==(const StyleMaskData &other) const
-{
-    return (maskElement == other.maskElement);
-}
-
-StyleMarkerData::StyleMarkerData()
-{
-    startMarker = SVGRenderStyle::initialStartMarker();
-    midMarker = SVGRenderStyle::initialMidMarker();
-    endMarker = SVGRenderStyle::initialEndMarker();
-}
-
-StyleMarkerData::StyleMarkerData(const StyleMarkerData& other)
-    : RefCounted<StyleMarkerData>()
-{
-    startMarker = other.startMarker;
-    midMarker = other.midMarker;
-    endMarker = other.endMarker;
-}
-
-bool StyleMarkerData::operator==(const StyleMarkerData &other) const
-{
-    return (startMarker == other.startMarker && midMarker == other.midMarker && endMarker == other.endMarker);
-}
-
 StyleMiscData::StyleMiscData()
+    : floodColor(SVGRenderStyle::initialFloodColor())
+    , floodOpacity(SVGRenderStyle::initialFloodOpacity())
+    , lightingColor(SVGRenderStyle::initialLightingColor())
+    , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
 {
-    floodColor = SVGRenderStyle::initialFloodColor();
-    floodOpacity = SVGRenderStyle::initialFloodOpacity();
-    lightingColor = SVGRenderStyle::initialLightingColor();
-    baselineShiftValue = SVGRenderStyle::initialBaselineShiftValue();
 }
 
 StyleMiscData::StyleMiscData(const StyleMiscData& other)
     : RefCounted<StyleMiscData>()
+    , floodColor(other.floodColor)
+    , floodOpacity(other.floodOpacity)
+    , lightingColor(other.lightingColor)
+    , baselineShiftValue(other.baselineShiftValue)
 {
-    filter = other.filter;
-    floodColor = other.floodColor;
-    floodOpacity = other.floodOpacity;
-    lightingColor = other.lightingColor;
-    baselineShiftValue = other.baselineShiftValue;
 }
 
-bool StyleMiscData::operator==(const StyleMiscData &other) const
+bool StyleMiscData::operator==(const StyleMiscData& other) const
 {
-    return filter == other.filter
-           && floodOpacity == other.floodOpacity
-           && floodColor == other.floodColor
-           && lightingColor == other.lightingColor
-           && baselineShiftValue == other.baselineShiftValue;
+    return floodOpacity == other.floodOpacity
+        && floodColor == other.floodColor
+        && lightingColor == other.lightingColor
+        && baselineShiftValue == other.baselineShiftValue;
 }
 
 StyleShadowSVGData::StyleShadowSVGData()
@@ -230,6 +178,50 @@
     return true;
 }
 
-#endif // ENABLE(SVG)
+StyleResourceData::StyleResourceData()
+    : clipper(SVGRenderStyle::initialClipperResource())
+    , filter(SVGRenderStyle::initialFilterResource())
+    , masker(SVGRenderStyle::initialMaskerResource())
+{
+}
 
-// vim:ts=4:noet
+StyleResourceData::StyleResourceData(const StyleResourceData& other)
+    : RefCounted<StyleResourceData>()
+    , clipper(other.clipper)
+    , filter(other.filter)
+    , masker(other.masker)
+{
+}
+
+bool StyleResourceData::operator==(const StyleResourceData& other) const
+{
+    return clipper == other.clipper
+        && filter == other.filter
+        && masker == other.masker;
+}
+
+StyleInheritedResourceData::StyleInheritedResourceData()
+    : markerStart(SVGRenderStyle::initialMarkerStartResource())
+    , markerMid(SVGRenderStyle::initialMarkerMidResource())
+    , markerEnd(SVGRenderStyle::initialMarkerEndResource())
+{
+}
+
+StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
+    : RefCounted<StyleInheritedResourceData>()
+    , markerStart(other.markerStart)
+    , markerMid(other.markerMid)
+    , markerEnd(other.markerEnd)
+{
+}
+
+bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
+{
+    return markerStart == other.markerStart
+        && markerMid == other.markerMid
+        && markerEnd == other.markerEnd;
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h
index 8f01d9f..e0354e6 100644
--- a/WebCore/rendering/style/SVGRenderStyleDefs.h
+++ b/WebCore/rendering/style/SVGRenderStyleDefs.h
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     Based on khtml code by:
     Copyright (C) 2000-2003 Lars Knoll (knoll@kde.org)
@@ -29,11 +30,9 @@
 
 #if ENABLE(SVG)
 #include "Color.h"
-#include "Path.h"
 #include "PlatformString.h"
 #include "ShadowData.h"
 #include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
@@ -133,8 +132,8 @@
         static PassRefPtr<StyleFillData> create() { return adoptRef(new StyleFillData); }
         PassRefPtr<StyleFillData> copy() const { return adoptRef(new StyleFillData(*this)); }
         
-        bool operator==(const StyleFillData &other) const;
-        bool operator!=(const StyleFillData &other) const
+        bool operator==(const StyleFillData&) const;
+        bool operator!=(const StyleFillData& other) const
         {
             return !(*this == other);
         }
@@ -177,8 +176,8 @@
         static PassRefPtr<StyleStopData> create() { return adoptRef(new StyleStopData); }
         PassRefPtr<StyleStopData> copy() const { return adoptRef(new StyleStopData(*this)); }
 
-        bool operator==(const StyleStopData &other) const;
-        bool operator!=(const StyleStopData &other) const
+        bool operator==(const StyleStopData&) const;
+        bool operator!=(const StyleStopData& other) const
         {
             return !(*this == other);
         }
@@ -206,78 +205,23 @@
 
     private:
         StyleTextData();
-        StyleTextData(const StyleTextData& other);
+        StyleTextData(const StyleTextData&);
     };
 
-    class StyleClipData : public RefCounted<StyleClipData> {
-    public:
-        static PassRefPtr<StyleClipData> create() { return adoptRef(new StyleClipData); }
-        PassRefPtr<StyleClipData> copy() const { return adoptRef(new StyleClipData(*this)); }
-
-        bool operator==(const StyleClipData &other) const;
-        bool operator!=(const StyleClipData &other) const
-        {
-            return !(*this == other);
-        }
-
-        String clipPath;
-
-    private:
-        StyleClipData();
-        StyleClipData(const StyleClipData&);
-    };
-
-    class StyleMaskData : public RefCounted<StyleMaskData> {
-    public:
-        static PassRefPtr<StyleMaskData> create() { return adoptRef(new StyleMaskData); }
-        PassRefPtr<StyleMaskData> copy() const { return adoptRef(new StyleMaskData(*this)); }
-
-        bool operator==(const StyleMaskData &other) const;
-        bool operator!=(const StyleMaskData &other) const { return !(*this == other); }
-
-        String maskElement;
-
-    private:        
-        StyleMaskData();
-        StyleMaskData(const StyleMaskData&);
-    };
-
-    class StyleMarkerData : public RefCounted<StyleMarkerData> {
-    public:
-        static PassRefPtr<StyleMarkerData> create() { return adoptRef(new StyleMarkerData); }
-        PassRefPtr<StyleMarkerData> copy() const { return adoptRef(new StyleMarkerData(*this)); }
-
-        bool operator==(const StyleMarkerData &other) const;
-        bool operator!=(const StyleMarkerData &other) const
-        {
-            return !(*this == other);
-        }
-
-        String startMarker;
-        String midMarker;
-        String endMarker;
-
-    private:
-        StyleMarkerData();
-        StyleMarkerData(const StyleMarkerData&);
-    };
-
-    // Note : the rule for this class is, *no inheritance* of these props
+    // Note: the rule for this class is, *no inheritance* of these props
     class StyleMiscData : public RefCounted<StyleMiscData> {
     public:
         static PassRefPtr<StyleMiscData> create() { return adoptRef(new StyleMiscData); }
         PassRefPtr<StyleMiscData> copy() const { return adoptRef(new StyleMiscData(*this)); }
 
-        bool operator==(const StyleMiscData &other) const;
-        bool operator!=(const StyleMiscData &other) const
+        bool operator==(const StyleMiscData&) const;
+        bool operator!=(const StyleMiscData& other) const
         {
             return !(*this == other);
         }
 
-        String filter;
         Color floodColor;
         float floodOpacity;
-
         Color lightingColor;
 
         // non-inherited text stuff lives here not in StyleTextData.
@@ -287,13 +231,13 @@
         StyleMiscData();
         StyleMiscData(const StyleMiscData&);
     };
-    
+
     class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
     public:
         static PassRefPtr<StyleShadowSVGData> create() { return adoptRef(new StyleShadowSVGData); }
         PassRefPtr<StyleShadowSVGData> copy() const { return adoptRef(new StyleShadowSVGData(*this)); }
-        
-        bool operator==(const StyleShadowSVGData& other) const;
+
+        bool operator==(const StyleShadowSVGData&) const;
         bool operator!=(const StyleShadowSVGData& other) const
         {
             return !(*this == other);
@@ -303,12 +247,52 @@
 
     private:
         StyleShadowSVGData();
-        StyleShadowSVGData(const StyleShadowSVGData& other);
+        StyleShadowSVGData(const StyleShadowSVGData&);
+    };
+
+    // Non-inherited resources
+    class StyleResourceData : public RefCounted<StyleResourceData> {
+    public:
+        static PassRefPtr<StyleResourceData> create() { return adoptRef(new StyleResourceData); }
+        PassRefPtr<StyleResourceData> copy() const { return adoptRef(new StyleResourceData(*this)); }
+
+        bool operator==(const StyleResourceData&) const;
+        bool operator!=(const StyleResourceData& other) const
+        {
+            return !(*this == other);
+        }
+
+        String clipper;
+        String filter;
+        String masker;
+
+    private:
+        StyleResourceData();
+        StyleResourceData(const StyleResourceData&);
+    };
+
+    // Inherited resources
+    class StyleInheritedResourceData : public RefCounted<StyleInheritedResourceData> {
+    public:
+        static PassRefPtr<StyleInheritedResourceData> create() { return adoptRef(new StyleInheritedResourceData); }
+        PassRefPtr<StyleInheritedResourceData> copy() const { return adoptRef(new StyleInheritedResourceData(*this)); }
+
+        bool operator==(const StyleInheritedResourceData&) const;
+        bool operator!=(const StyleInheritedResourceData& other) const
+        {
+            return !(*this == other);
+        }
+
+        String markerStart;
+        String markerMid;
+        String markerEnd;
+
+    private:
+        StyleInheritedResourceData();
+        StyleInheritedResourceData(const StyleInheritedResourceData&);
     };
 
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
 #endif // SVGRenderStyleDefs_h
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/style/ShadowData.cpp b/WebCore/rendering/style/ShadowData.cpp
index 1954224..d4569d0 100644
--- a/WebCore/rendering/style/ShadowData.cpp
+++ b/WebCore/rendering/style/ShadowData.cpp
@@ -25,23 +25,23 @@
 namespace WebCore {
 
 ShadowData::ShadowData(const ShadowData& o)
-    : x(o.x)
-    , y(o.y)
-    , blur(o.blur)
-    , spread(o.spread)
-    , style(o.style)
-    , color(o.color)
+    : m_x(o.m_x)
+    , m_y(o.m_y)
+    , m_blur(o.m_blur)
+    , m_spread(o.m_spread)
+    , m_style(o.m_style)
+    , m_color(o.m_color)
 {
-    next = o.next ? new ShadowData(*o.next) : 0;
+    m_next = o.m_next ? new ShadowData(*o.m_next) : 0;
 }
 
 bool ShadowData::operator==(const ShadowData& o) const
 {
-    if ((next && !o.next) || (!next && o.next) ||
-        (next && o.next && *next != *o.next))
+    if ((m_next && !o.m_next) || (!m_next && o.m_next) ||
+        (m_next && o.m_next && *m_next != *o.m_next))
         return false;
     
-    return x == o.x && y == o.y && blur == o.blur && spread == o.spread && style == o.style && color == o.color;
+    return m_x == o.m_x && m_y == o.m_y && m_blur == o.m_blur && m_spread == o.m_spread && m_style == o.m_style && m_color == o.m_color;
 }
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/ShadowData.h b/WebCore/rendering/style/ShadowData.h
index 089cf77..9252e13 100644
--- a/WebCore/rendering/style/ShadowData.h
+++ b/WebCore/rendering/style/ShadowData.h
@@ -34,31 +34,31 @@
 
 // This struct holds information about shadows for the text-shadow and box-shadow properties.
 
-struct ShadowData : FastAllocBase {
+class ShadowData : public FastAllocBase {
+public:
     ShadowData()
-        : x(0)
-        , y(0)
-        , blur(0)
-        , spread(0)
-        , style(Normal)
-        , next(0)
+        : m_x(0)
+        , m_y(0)
+        , m_blur(0)
+        , m_spread(0)
+        , m_style(Normal)
+        , m_next(0)
     {
     }
 
     ShadowData(int x, int y, int blur, int spread, ShadowStyle style, const Color& color)
-        : x(x)
-        , y(y)
-        , blur(blur)
-        , spread(spread)
-        , style(style)
-        , color(color)
-        , next(0)
+        : m_x(x)
+        , m_y(y)
+        , m_blur(blur)
+        , m_spread(spread)
+        , m_style(style)
+        , m_color(color)
+        , m_next(0)
     {
     }
 
     ShadowData(const ShadowData& o);
-
-    ~ShadowData() { delete next; }
+    ~ShadowData() { delete m_next; }
 
     bool operator==(const ShadowData& o) const;
     bool operator!=(const ShadowData& o) const
@@ -66,13 +66,24 @@
         return !(*this == o);
     }
     
-    int x;
-    int y;
-    int blur;
-    int spread;
-    ShadowStyle style;
-    Color color;
-    ShadowData* next;
+    int x() const { return m_x; }
+    int y() const { return m_y; }
+    int blur() const { return m_blur; }
+    int spread() const { return m_spread; }
+    ShadowStyle style() const { return m_style; }
+    const Color& color() const { return m_color; }
+    
+    const ShadowData* next() const { return m_next; }
+    void setNext(ShadowData* shadow) { m_next = shadow; }
+
+private:
+    int m_x;
+    int m_y;
+    int m_blur;
+    int m_spread;
+    ShadowStyle m_style;
+    Color m_color;
+    ShadowData* m_next;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/StyleBackgroundData.h b/WebCore/rendering/style/StyleBackgroundData.h
index 8f2da36..48a700e 100644
--- a/WebCore/rendering/style/StyleBackgroundData.h
+++ b/WebCore/rendering/style/StyleBackgroundData.h
@@ -45,13 +45,19 @@
         return !(*this == o);
     }
 
+    const FillLayer& background() const { return m_background; }
+    const Color& color() const { return m_color; }
+    const OutlineValue& outline() const { return m_outline; }
+
+private:
+    friend class RenderStyle;
+
+    StyleBackgroundData();
+    StyleBackgroundData(const StyleBackgroundData&); 
+
     FillLayer m_background;
     Color m_color;
     OutlineValue m_outline;
-
-private:
-    StyleBackgroundData();
-    StyleBackgroundData(const StyleBackgroundData&);    
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/StyleBoxData.cpp b/WebCore/rendering/style/StyleBoxData.cpp
index d9734d1..2c523da 100644
--- a/WebCore/rendering/style/StyleBoxData.cpp
+++ b/WebCore/rendering/style/StyleBoxData.cpp
@@ -28,40 +28,41 @@
 namespace WebCore {
 
 StyleBoxData::StyleBoxData()
-    : z_index(0)
-    , z_auto(true)
-    , boxSizing(CONTENT_BOX)
+    : m_minWidth(RenderStyle::initialMinSize())
+    , m_maxWidth(RenderStyle::initialMaxSize())
+    , m_minHeight(RenderStyle::initialMinSize())
+    , m_maxHeight(RenderStyle::initialMaxSize())
+    , m_zIndex(0)
+    , m_hasAutoZIndex(true)
+    , m_boxSizing(CONTENT_BOX)
 {
-    // Initialize our min/max widths/heights.
-    min_width = min_height = RenderStyle::initialMinSize();
-    max_width = max_height = RenderStyle::initialMaxSize();
 }
 
 StyleBoxData::StyleBoxData(const StyleBoxData& o)
     : RefCounted<StyleBoxData>()
-    , width(o.width)
-    , height(o.height)
-    , min_width(o.min_width)
-    , max_width(o.max_width)
-    , min_height(o.min_height)
-    , max_height(o.max_height)
-    , z_index(o.z_index)
-    , z_auto(o.z_auto)
-    , boxSizing(o.boxSizing)
+    , m_width(o.m_width)
+    , m_height(o.m_height)
+    , m_minWidth(o.m_minWidth)
+    , m_maxWidth(o.m_maxWidth)
+    , m_minHeight(o.m_minHeight)
+    , m_maxHeight(o.m_maxHeight)
+    , m_zIndex(o.m_zIndex)
+    , m_hasAutoZIndex(o.m_hasAutoZIndex)
+    , m_boxSizing(o.m_boxSizing)
 {
 }
 
 bool StyleBoxData::operator==(const StyleBoxData& o) const
 {
-    return width == o.width &&
-           height == o.height &&
-           min_width == o.min_width &&
-           max_width == o.max_width &&
-           min_height == o.min_height &&
-           max_height == o.max_height &&
-           z_index == o.z_index &&
-           z_auto == o.z_auto &&
-           boxSizing == o.boxSizing;
+    return m_width == o.m_width
+           && m_height == o.m_height
+           && m_minWidth == o.m_minWidth
+           && m_maxWidth == o.m_maxWidth
+           && m_minHeight == o.m_minHeight
+           && m_maxHeight == o.m_maxHeight
+           && m_zIndex == o.m_zIndex
+           && m_hasAutoZIndex == o.m_hasAutoZIndex
+           && m_boxSizing == o.m_boxSizing;
 }
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/StyleBoxData.h b/WebCore/rendering/style/StyleBoxData.h
index a5bd2ff..00bce4e 100644
--- a/WebCore/rendering/style/StyleBoxData.h
+++ b/WebCore/rendering/style/StyleBoxData.h
@@ -26,6 +26,7 @@
 #define StyleBoxData_h
 
 #include "Length.h"
+#include "RenderStyleConstants.h"
 #include <wtf/RefCounted.h>
 #include <wtf/PassRefPtr.h>
 
@@ -42,24 +43,42 @@
         return !(*this == o);
     }
 
-    Length width;
-    Length height;
-
-    Length min_width;
-    Length max_width;
-
-    Length min_height;
-    Length max_height;
-
-    Length vertical_align;
-
-    int z_index;
-    bool z_auto : 1;
-    unsigned boxSizing : 1; // EBoxSizing
+    Length width() const { return m_width; }
+    Length height() const { return m_height; }
     
+    Length minWidth() const { return m_minWidth; }
+    Length minHeight() const { return m_minHeight; }
+    
+    Length maxWidth() const { return m_maxWidth; }
+    Length maxHeight() const { return m_maxHeight; }
+    
+    Length verticalAlign() const { return m_verticalAlign; }
+    
+    int zIndex() const { return m_zIndex; }
+    bool hasAutoZIndex() const { return m_hasAutoZIndex; }
+    
+    EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(m_boxSizing); }
+
 private:
+    friend class RenderStyle;
+
     StyleBoxData();
     StyleBoxData(const StyleBoxData&);
+
+    Length m_width;
+    Length m_height;
+
+    Length m_minWidth;
+    Length m_maxWidth;
+
+    Length m_minHeight;
+    Length m_maxHeight;
+
+    Length m_verticalAlign;
+
+    int m_zIndex;
+    bool m_hasAutoZIndex : 1;
+    unsigned m_boxSizing : 1; // EBoxSizing
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/StyleMultiColData.h b/WebCore/rendering/style/StyleMultiColData.h
index dec0a55..d3fe720 100644
--- a/WebCore/rendering/style/StyleMultiColData.h
+++ b/WebCore/rendering/style/StyleMultiColData.h
@@ -50,7 +50,7 @@
     {
         if (m_rule.style() == BNONE || m_rule.style() == BHIDDEN)
             return 0; 
-        return m_rule.width;
+        return m_rule.width();
     }
 
     float m_width;
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 2130631..cb61d48 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -33,8 +33,8 @@
 
 #if ENABLE(DATABASE)
 #include "ChangeVersionWrapper.h"
-#include "CString.h"
 #include "DatabaseAuthorizer.h"
+#include "DatabaseCallback.h"
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
 #include "DatabaseTracker.h"
@@ -132,7 +132,31 @@
 
 static int guidForOriginAndName(const String& origin, const String& name);
 
-PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, ExceptionCode& e)
+class DatabaseCreationCallbackTask : public ScriptExecutionContext::Task {
+public:
+    static PassOwnPtr<DatabaseCreationCallbackTask> create(PassRefPtr<Database> database)
+    {
+        return new DatabaseCreationCallbackTask(database);
+    }
+
+    virtual void performTask(ScriptExecutionContext*)
+    {
+        m_database->performCreationCallback();
+    }
+
+private:
+    DatabaseCreationCallbackTask(PassRefPtr<Database> database)
+        : m_database(database)
+    {
+    }
+
+    RefPtr<Database> m_database;
+};
+
+PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name,
+                                            const String& expectedVersion, const String& displayName,
+                                            unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
+                                            ExceptionCode& e)
 {
     if (!DatabaseTracker::tracker().canEstablishDatabase(context, name, displayName, estimatedSize)) {
         // FIXME: There should be an exception raised here in addition to returning a null Database object.  The question has been raised with the WHATWG.
@@ -140,7 +164,7 @@
         return 0;
     }
 
-    RefPtr<Database> database = adoptRef(new Database(context, name, expectedVersion, displayName, estimatedSize));
+    RefPtr<Database> database = adoptRef(new Database(context, name, expectedVersion, displayName, estimatedSize, creationCallback));
 
     if (!database->openAndVerifyVersion(e)) {
         LOG(StorageAPI, "Failed to open and verify version (expected %s) of database %s", expectedVersion.ascii().data(), database->databaseDebugName().ascii().data());
@@ -160,10 +184,20 @@
     }
 #endif
 
+    // If it's a new database and a creation callback was provided, reset the expected
+    // version to "" and schedule the creation callback. Because of some subtle String
+    // implementation issues, we have to reset m_expectedVersion here instead of doing
+    // it inside performOpenAndVerify() which is run on the DB thread.
+    if (database->isNew() && database->m_creationCallback.get()) {
+        database->m_expectedVersion = "";
+        LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
+        database->m_scriptExecutionContext->postTask(DatabaseCreationCallbackTask::create(database));
+    }
+
     return database;
 }
 
-Database::Database(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize)
+Database::Database(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback)
     : m_transactionInProgress(false)
     , m_isTransactionQueueEnabled(true)
     , m_scriptExecutionContext(context)
@@ -175,6 +209,8 @@
     , m_deleted(false)
     , m_stopped(false)
     , m_opened(false)
+    , m_new(false)
+    , m_creationCallback(creationCallback)
 {
     ASSERT(m_scriptExecutionContext.get());
     m_mainThreadSecurityOrigin = m_scriptExecutionContext->securityOrigin();
@@ -348,10 +384,14 @@
     m_scriptExecutionContext->databaseThread()->unscheduleDatabaseTasks(this);
 
     DatabaseTaskSynchronizer synchronizer;
-    OwnPtr<DatabaseCloseTask> task = DatabaseCloseTask::create(this, &synchronizer);
+    OwnPtr<DatabaseCloseTask> task = DatabaseCloseTask::create(this, DoNotRemoveDatabaseFromContext, &synchronizer);
 
     m_scriptExecutionContext->databaseThread()->scheduleImmediateTask(task.release());
     synchronizer.waitForTaskCompletion();
+
+    // DatabaseCloseTask tells Database::close not to do these two removals so that we can do them here synchronously.
+    m_scriptExecutionContext->removeOpenDatabase(this);
+    DatabaseTracker::tracker().removeOpenDatabase(this);
 }
 
 class ContextRemoveOpenDatabaseTask : public ScriptExecutionContext::Task {
@@ -378,7 +418,7 @@
     RefPtr<Database> m_database;
 };
 
-void Database::close()
+void Database::close(ClosePolicy policy)
 {
     RefPtr<Database> protect = this;
 
@@ -407,7 +447,8 @@
     }
 
     m_scriptExecutionContext->databaseThread()->unscheduleDatabaseTasks(this);
-    m_scriptExecutionContext->postTask(ContextRemoveOpenDatabaseTask::create(this));
+    if (policy == RemoveDatabaseFromContext)
+        m_scriptExecutionContext->postTask(ContextRemoveOpenDatabaseTask::create(this));
 }
 
 void Database::stop()
@@ -497,7 +538,7 @@
 
 bool Database::performOpenAndVerify(ExceptionCode& e)
 {
-    if (!m_sqliteDatabase.open(m_filename)) {
+    if (!m_sqliteDatabase.open(m_filename, true)) {
         LOG_ERROR("Unable to open database at path %s", m_filename.ascii().data());
         e = INVALID_STATE_ERR;
         return false;
@@ -520,6 +561,8 @@
             LOG(StorageAPI, "No cached version for guid %i", m_guid);
 
             if (!m_sqliteDatabase.tableExists(databaseInfoTableName())) {
+                m_new = true;
+
                 if (!m_sqliteDatabase.executeCommand("CREATE TABLE " + databaseInfoTableName() + " (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,value TEXT NOT NULL ON CONFLICT FAIL);")) {
                     LOG_ERROR("Unable to create table %s in database %s", databaseInfoTableName().ascii().data(), databaseDebugName().ascii().data());
                     e = INVALID_STATE_ERR;
@@ -538,7 +581,7 @@
             }
             if (currentVersion.length()) {
                 LOG(StorageAPI, "Retrieved current version %s from database %s", currentVersion.ascii().data(), databaseDebugName().ascii().data());
-            } else {
+            } else if (!m_new || !m_creationCallback) {
                 LOG(StorageAPI, "Setting version %s in database %s that was just created", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
                 if (!setVersionInDatabase(m_expectedVersion)) {
                     LOG_ERROR("Failed to set version %s in database %s", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
@@ -561,7 +604,7 @@
 
     // If the expected version isn't the empty string, ensure that the current database version we have matches that version. Otherwise, set an exception.
     // If the expected version is the empty string, then we always return with whatever version of the database we have.
-    if (m_expectedVersion.length() && m_expectedVersion != currentVersion) {
+    if ((!m_new || !m_creationCallback) && m_expectedVersion.length() && m_expectedVersion != currentVersion) {
         LOG(StorageAPI, "page expects version %s from database %s, which actually has version name %s - openDatabase() call will fail", m_expectedVersion.ascii().data(),
             databaseDebugName().ascii().data(), currentVersion.ascii().data());
         e = INVALID_STATE_ERR;
@@ -685,6 +728,11 @@
     return tableNames;
 }
 
+void Database::performCreationCallback()
+{
+    m_creationCallback->handleEvent(m_scriptExecutionContext.get(), this);
+}
+
 SQLTransactionClient* Database::transactionClient() const
 {
     return m_scriptExecutionContext->databaseThread()->transactionClient();
diff --git a/WebCore/storage/Database.h b/WebCore/storage/Database.h
index 0d7f33c..f7b88a2 100644
--- a/WebCore/storage/Database.h
+++ b/WebCore/storage/Database.h
@@ -51,6 +51,7 @@
 namespace WebCore {
 
 class DatabaseAuthorizer;
+class DatabaseCallback;
 class DatabaseThread;
 class ScriptExecutionContext;
 class SQLResultSet;
@@ -73,7 +74,10 @@
     ~Database();
 
 // Direct support for the DOM API
-    static PassRefPtr<Database> openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, ExceptionCode&);
+    static PassRefPtr<Database> openDatabase(ScriptExecutionContext* context, const String& name,
+                                             const String& expectedVersion, const String& displayName,
+                                             unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
+                                             ExceptionCode&);
     String version() const;
     void changeVersion(const String& oldVersion, const String& newVersion,
                        PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
@@ -105,12 +109,15 @@
     void markAsDeletedAndClose();
     bool deleted() const { return m_deleted; }
 
-    void close();
+    enum ClosePolicy { DoNotRemoveDatabaseFromContext, RemoveDatabaseFromContext };
+    void close(ClosePolicy);
     bool opened() const { return m_opened; }
 
     void stop();
     bool stopped() const { return m_stopped; }
 
+    bool isNew() const { return m_new; }
+
     unsigned long long databaseSize() const;
     unsigned long long maximumSize() const;
 
@@ -121,6 +128,7 @@
     bool performOpenAndVerify(ExceptionCode&);
 
     Vector<String> performGetTableNames();
+    void performCreationCallback();
 
     SQLTransactionClient* transactionClient() const;
     SQLTransactionCoordinator* transactionCoordinator() const;
@@ -128,7 +136,7 @@
 private:
     Database(ScriptExecutionContext* context, const String& name,
              const String& expectedVersion, const String& displayName,
-             unsigned long estimatedSize);
+             unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback);
 
     bool openAndVerifyVersion(ExceptionCode&);
 
@@ -159,9 +167,13 @@
 
     bool m_opened;
 
+    bool m_new;
+
     SQLiteDatabase m_sqliteDatabase;
     RefPtr<DatabaseAuthorizer> m_databaseAuthorizer;
 
+    RefPtr<DatabaseCallback> m_creationCallback;
+
 #ifndef NDEBUG
     String databaseDebugName() const { return m_mainThreadSecurityOrigin->toString() + "::" + m_name; }
 #endif
diff --git a/WebCore/storage/DatabaseCallback.h b/WebCore/storage/DatabaseCallback.h
new file mode 100644
index 0000000..2115a21
--- /dev/null
+++ b/WebCore/storage/DatabaseCallback.h
@@ -0,0 +1,53 @@
+/*
+ * 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 DatabaseCallback_h
+#define DatabaseCallback_h
+
+#if ENABLE(DATABASE)
+
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+class Database;
+class ScriptExecutionContext;
+
+class DatabaseCallback : public ThreadSafeShared<DatabaseCallback> {
+public:
+    virtual ~DatabaseCallback() { }
+    virtual void handleEvent(ScriptExecutionContext*, Database*) = 0;
+};
+
+}
+
+#endif
+
+#endif // DatabaseCallback_h
diff --git a/WebCore/storage/DatabaseDetails.h b/WebCore/storage/DatabaseDetails.h
index 9b0f506..ceebd35 100644
--- a/WebCore/storage/DatabaseDetails.h
+++ b/WebCore/storage/DatabaseDetails.h
@@ -41,6 +41,9 @@
         : m_expectedUsage(0)
         , m_currentUsage(0)
     {
+#ifndef NDEBUG
+        m_thread = currentThread();
+#endif
     }
 
     DatabaseDetails(const String& databaseName, const String& displayName, unsigned long long expectedUsage, unsigned long long currentUsage)
@@ -49,19 +52,27 @@
         , m_expectedUsage(expectedUsage)
         , m_currentUsage(currentUsage)
     {
+#ifndef NDEBUG
+        m_thread = currentThread();
+#endif
     }
 
     const String& name() const { return m_name; }
     const String& displayName() const { return m_displayName; }
     unsigned long long expectedUsage() const { return m_expectedUsage; }
     unsigned long long currentUsage() const { return m_currentUsage; }
+#ifndef NDEBUG
+    ThreadIdentifier thread() const { return m_thread; }
+#endif
 
 private:
     String m_name;
     String m_displayName;
     unsigned long long m_expectedUsage;
     unsigned long long m_currentUsage;
-
+#ifndef NDEBUG
+    ThreadIdentifier m_thread;
+#endif
 };
 
 } // namespace WebCore
diff --git a/WebCore/storage/DatabaseTask.cpp b/WebCore/storage/DatabaseTask.cpp
index 702c96b..a8038c3 100644
--- a/WebCore/storage/DatabaseTask.cpp
+++ b/WebCore/storage/DatabaseTask.cpp
@@ -110,14 +110,15 @@
 // *** DatabaseCloseTask ***
 // Closes the database.
 
-DatabaseCloseTask::DatabaseCloseTask(Database* database, DatabaseTaskSynchronizer* synchronizer)
+DatabaseCloseTask::DatabaseCloseTask(Database* database, Database::ClosePolicy closePolicy, DatabaseTaskSynchronizer* synchronizer)
     : DatabaseTask(database, synchronizer)
+    , m_closePolicy(closePolicy)
 {
 }
 
 void DatabaseCloseTask::doPerformTask()
 {
-    database()->close();
+    database()->close(m_closePolicy);
 }
 
 #ifndef NDEBUG
diff --git a/WebCore/storage/DatabaseTask.h b/WebCore/storage/DatabaseTask.h
index 998e373..b473f8f 100644
--- a/WebCore/storage/DatabaseTask.h
+++ b/WebCore/storage/DatabaseTask.h
@@ -29,6 +29,7 @@
 #define DatabaseTask_h
 
 #if ENABLE(DATABASE)
+#include "Database.h"
 #include "ExceptionCode.h"
 #include "PlatformString.h"
 #include <wtf/OwnPtr.h>
@@ -39,7 +40,6 @@
 
 namespace WebCore {
 
-class Database;
 class DatabaseTask;
 class DatabaseThread;
 class SQLValue;
@@ -110,18 +110,20 @@
 
 class DatabaseCloseTask : public DatabaseTask {
 public:
-    static PassOwnPtr<DatabaseCloseTask> create(Database* db, DatabaseTaskSynchronizer* synchronizer)
+    static PassOwnPtr<DatabaseCloseTask> create(Database* db, Database::ClosePolicy closePolicy, DatabaseTaskSynchronizer* synchronizer)
     { 
-        return new DatabaseCloseTask(db, synchronizer);
+        return new DatabaseCloseTask(db, closePolicy, synchronizer);
     }
 
 private:
-    DatabaseCloseTask(Database*, DatabaseTaskSynchronizer*);
+    DatabaseCloseTask(Database*, Database::ClosePolicy, DatabaseTaskSynchronizer*);
 
     virtual void doPerformTask();
 #ifndef NDEBUG
     virtual const char* debugTaskName() const;
 #endif
+
+    Database::ClosePolicy m_closePolicy;
 };
 
 class DatabaseTransactionTask : public DatabaseTask {
diff --git a/WebCore/storage/DatabaseThread.cpp b/WebCore/storage/DatabaseThread.cpp
index ec4c6d1..ec6241c 100644
--- a/WebCore/storage/DatabaseThread.cpp
+++ b/WebCore/storage/DatabaseThread.cpp
@@ -113,7 +113,7 @@
         openSetCopy.swap(m_openDatabaseSet);
         DatabaseSet::iterator end = openSetCopy.end();
         for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it)
-           (*it)->close();
+           (*it)->close(Database::RemoveDatabaseFromContext);
     }
 
     // Detach the thread so its resources are no longer of any concern to anyone else
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 76492c9..8e2e3f3 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -49,15 +49,14 @@
 
 using namespace std;
 
-namespace WebCore {
-
-OriginQuotaManager& DatabaseTracker::originQuotaManager()
+static WebCore::OriginQuotaManager& originQuotaManager()
 {
-    populateOrigins();
-    ASSERT(m_quotaManager);
-    return *m_quotaManager;
+    DEFINE_STATIC_LOCAL(WebCore::OriginQuotaManager, quotaManager, ());
+    return quotaManager;
 }
 
+namespace WebCore {
+
 DatabaseTracker& DatabaseTracker::tracker()
 {
     DEFINE_STATIC_LOCAL(DatabaseTracker, tracker, ());
@@ -66,36 +65,33 @@
 
 DatabaseTracker::DatabaseTracker()
     : m_client(0)
-    , m_proposedDatabase(0)
-#ifndef NDEBUG
-    , m_thread(currentThread())
-#endif
 {
     SQLiteFileSystem::registerSQLiteVFS();
+
+    MutexLocker lockDatabase(m_databaseGuard);
+    populateOrigins();
 }
 
 void DatabaseTracker::setDatabaseDirectoryPath(const String& path)
 {
-    ASSERT(currentThread() == m_thread);
+    MutexLocker lockDatabase(m_databaseGuard);
     ASSERT(!m_database.isOpen());
-    m_databaseDirectoryPath = path;
+    m_databaseDirectoryPath = path.threadsafeCopy();
 }
 
-const String& DatabaseTracker::databaseDirectoryPath() const
+String DatabaseTracker::databaseDirectoryPath() const
 {
-    ASSERT(currentThread() == m_thread);
-    return m_databaseDirectoryPath;
+    return m_databaseDirectoryPath.threadsafeCopy();
 }
 
 String DatabaseTracker::trackerDatabasePath() const
 {
-    ASSERT(currentThread() == m_thread);
     return SQLiteFileSystem::appendDatabaseFileNameToPath(m_databaseDirectoryPath, "Databases.db");
 }
 
 void DatabaseTracker::openTrackerDatabase(bool createIfDoesNotExist)
 {
-    ASSERT(currentThread() == m_thread);
+    ASSERT(!m_databaseGuard.tryLock());
 
     if (m_database.isOpen())
         return;
@@ -106,67 +102,96 @@
 
     if (!m_database.open(databasePath)) {
         // FIXME: What do do here?
+        LOG_ERROR("Failed to open databasePath %s.", databasePath.ascii().data());
         return;
     }
+    m_database.disableThreadingChecks();
     if (!m_database.tableExists("Origins")) {
         if (!m_database.executeCommand("CREATE TABLE Origins (origin TEXT UNIQUE ON CONFLICT REPLACE, quota INTEGER NOT NULL ON CONFLICT FAIL);")) {
             // FIXME: and here
+            LOG_ERROR("Failed to create Origins table");
         }
     }
     if (!m_database.tableExists("Databases")) {
         if (!m_database.executeCommand("CREATE TABLE Databases (guid INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT, name TEXT, displayName TEXT, estimatedSize INTEGER, path TEXT);")) {
             // FIXME: and here
+            LOG_ERROR("Failed to create Databases table");
         }
     }
 }
 
 bool DatabaseTracker::canEstablishDatabase(ScriptExecutionContext* context, const String& name, const String& displayName, unsigned long estimatedSize)
 {
-    ASSERT(currentThread() == m_thread);
-
-    // Populate the origins before we establish a database; this guarantees that quotaForOrigin
-    // can run on the database thread later.
-    populateOrigins();
-
     SecurityOrigin* origin = context->securityOrigin();
+    ProposedDatabase details;
 
-    // Since we're imminently opening a database within this context's origin, make sure this origin is being tracked by the QuotaTracker
-    // by fetching it's current usage now
-    unsigned long long usage = usageForOrigin(origin);
+    unsigned long long requirement;
+    unsigned long long tempUsage;
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+        Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
 
-    // If a database already exists, ignore the passed-in estimated size and say it's OK.
-    if (hasEntryForDatabase(origin, name))
-        return true;
+        if (!canCreateDatabase(origin, name))
+            return false;
 
-    // If the database will fit, allow its creation.
-    unsigned long long requirement = usage + max(1UL, estimatedSize);
-    if (requirement < usage)
-        return false; // If the estimated size is so big it causes an overflow, don't allow creation.
-    if (requirement <= quotaForOrigin(origin))
-        return true;
+        recordCreatingDatabase(origin, name);
 
-    // Give the chrome client a chance to increase the quota.
-    // Temporarily make the details of the proposed database available, so the client can get at them.
-    pair<SecurityOrigin*, DatabaseDetails> details(origin, DatabaseDetails(name, displayName, estimatedSize, 0));
-    m_proposedDatabase = &details;
+        // Since we're imminently opening a database within this context's origin, make sure this origin is being tracked by the QuotaTracker
+        // by fetching its current usage now.
+        unsigned long long usage = usageForOriginNoLock(origin);
+
+        // If a database already exists, ignore the passed-in estimated size and say it's OK.
+        if (hasEntryForDatabase(origin, name))
+            return true;
+
+        // If the database will fit, allow its creation.
+        requirement = usage + max(1UL, estimatedSize);
+        tempUsage = usage;
+        if (requirement < usage) {
+            doneCreatingDatabase(origin, name);
+            return false; // If the estimated size is so big it causes an overflow, don't allow creation.
+        }
+        if (requirement <= quotaForOriginNoLock(origin))
+            return true;
+
+        // Give the chrome client a chance to increase the quota.
+        // Temporarily make the details of the proposed database available, so the client can get at them.
+        // FIXME: We should really just pass the details into this call, rather than using m_proposedDatabases.
+        details = ProposedDatabase(origin->threadsafeCopy(), DatabaseDetails(name.threadsafeCopy(), displayName.threadsafeCopy(), estimatedSize, 0));
+        m_proposedDatabases.add(&details);
+    }
+    // Drop all locks before calling out; we don't know what they'll do.
     context->databaseExceededQuota(name);
-    m_proposedDatabase = 0;
+
+    MutexLocker lockDatabase(m_databaseGuard);
+
+    m_proposedDatabases.remove(&details);
 
     // If the database will fit now, allow its creation.
-    return requirement <= quotaForOrigin(origin);
+    if (requirement <= quotaForOriginNoLock(origin))
+        return true;
+
+    doneCreatingDatabase(origin, name);
+
+    return false;
+}
+
+bool DatabaseTracker::hasEntryForOriginNoLock(SecurityOrigin* origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(m_quotaMap);
+    return m_quotaMap->contains(origin);
 }
 
 bool DatabaseTracker::hasEntryForOrigin(SecurityOrigin* origin)
 {
-    ASSERT(currentThread() == m_thread);
-    populateOrigins();
-    MutexLocker lockQuotaMap(m_quotaMapGuard);
-    return m_quotaMap->contains(origin);
+    MutexLocker lockDatabase(m_databaseGuard);
+    return hasEntryForOriginNoLock(origin);
 }
 
 bool DatabaseTracker::hasEntryForDatabase(SecurityOrigin* origin, const String& databaseIdentifier)
 {
-    ASSERT(currentThread() == m_thread);
+    ASSERT(!m_databaseGuard.tryLock());
     openTrackerDatabase(false);
     if (!m_database.isOpen())
         return false;
@@ -186,23 +211,31 @@
     ASSERT(currentThread() == database->scriptExecutionContext()->databaseThread()->getThreadID());
     // The maximum size for a database is the full quota for its origin, minus the current usage within the origin,
     // plus the current usage of the given database
-    Locker<OriginQuotaManager> locker(originQuotaManager());
+    MutexLocker lockDatabase(m_databaseGuard);
+    Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
     SecurityOrigin* origin = database->securityOrigin();
-    return quotaForOrigin(origin) - originQuotaManager().diskUsage(origin) + SQLiteFileSystem::getDatabaseFileSize(database->fileName());
+    return quotaForOriginNoLock(origin) - originQuotaManager().diskUsage(origin) + SQLiteFileSystem::getDatabaseFileSize(database->fileName());
+}
+
+void DatabaseTracker::databaseChanged(Database* database)
+{
+    Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
+    originQuotaManager().markDatabase(database);
 }
 
 String DatabaseTracker::originPath(SecurityOrigin* origin) const
 {
-    ASSERT(currentThread() == m_thread);
-    return SQLiteFileSystem::appendDatabaseFileNameToPath(m_databaseDirectoryPath, origin->databaseIdentifier());
+    return SQLiteFileSystem::appendDatabaseFileNameToPath(m_databaseDirectoryPath.threadsafeCopy(), origin->databaseIdentifier());
 }
 
-String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfNotExists)
+String DatabaseTracker::fullPathForDatabaseNoLock(SecurityOrigin* origin, const String& name, bool createIfNotExists)
 {
-    ASSERT(currentThread() == m_thread);
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(!originQuotaManager().tryLock());
 
-    if (m_proposedDatabase && m_proposedDatabase->first == origin && m_proposedDatabase->second.name() == name)
-        return String();
+    for (HashSet<ProposedDatabase*>::iterator iter = m_proposedDatabases.begin(); iter != m_proposedDatabases.end(); ++iter)
+        if ((*iter)->second.name() == name && (*iter)->first->equal(origin))
+            return String();
 
     String originIdentifier = origin->databaseIdentifier();
     String originPath = this->originPath(origin);
@@ -212,7 +245,6 @@
         return String();
 
     // See if we have a path for this database yet
-    openTrackerDatabase(false);
     if (!m_database.isOpen())
         return String();
     SQLiteStatement statement(m_database, "SELECT path FROM Databases WHERE origin=? AND name=?;");
@@ -231,36 +263,39 @@
         return String();
 
     if (result != SQLResultDone) {
-        LOG_ERROR("Failed to retrieve filename from Database Tracker for origin %s, name %s", origin->databaseIdentifier().ascii().data(), name.ascii().data());
+        LOG_ERROR("Failed to retrieve filename from Database Tracker for origin %s, name %s", originIdentifier.ascii().data(), name.ascii().data());
         return String();
     }
     statement.finalize();
 
-    String fileName = SQLiteFileSystem::getFileNameForNewDatabase(originPath, name, origin->databaseIdentifier(), &m_database);
+    String fileName = SQLiteFileSystem::getFileNameForNewDatabase(originPath, name, originIdentifier, &m_database);
     if (!addDatabase(origin, name, fileName))
         return String();
 
     // If this origin's quota is being tracked (open handle to a database in this origin), add this new database
     // to the quota manager now
     String fullFilePath = SQLiteFileSystem::appendDatabaseFileNameToPath(originPath, fileName);
-    {
-        Locker<OriginQuotaManager> locker(originQuotaManager());
-        if (originQuotaManager().tracksOrigin(origin))
-            originQuotaManager().addDatabase(origin, name, fullFilePath);
-    }
+    if (originQuotaManager().tracksOrigin(origin))
+        originQuotaManager().addDatabase(origin, name, fullFilePath);
 
     return fullFilePath;
 }
 
+String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfNotExists)
+{
+    MutexLocker lockDatabase(m_databaseGuard);
+    Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
+
+    return fullPathForDatabaseNoLock(origin, name, createIfNotExists).threadsafeCopy();
+}
+
 void DatabaseTracker::populateOrigins()
 {
+    ASSERT(!m_databaseGuard.tryLock());
     if (m_quotaMap)
         return;
 
-    ASSERT(currentThread() == m_thread);
-
     m_quotaMap.set(new QuotaMap);
-    m_quotaManager.set(new OriginQuotaManager);
 
     openTrackerDatabase(false);
     if (!m_database.isOpen())
@@ -268,30 +303,31 @@
 
     SQLiteStatement statement(m_database, "SELECT origin, quota FROM Origins");
 
-    if (statement.prepare() != SQLResultOk)
+    if (statement.prepare() != SQLResultOk) {
+        LOG_ERROR("Failed to prepare statement.");
         return;
+    }
 
     int result;
     while ((result = statement.step()) == SQLResultRow) {
         RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(statement.getColumnText(0));
-        m_quotaMap->set(origin.get(), statement.getColumnInt64(1));
+        m_quotaMap->set(origin.get()->threadsafeCopy(), statement.getColumnInt64(1));
     }
 
     if (result != SQLResultDone)
-        LOG_ERROR("Failed to read in all origins from the database");
+        LOG_ERROR("Failed to read in all origins from the database.");
 }
 
 void DatabaseTracker::origins(Vector<RefPtr<SecurityOrigin> >& result)
 {
-    ASSERT(currentThread() == m_thread);
-    populateOrigins();
-    MutexLocker lockQuotaMap(m_quotaMapGuard);
+    MutexLocker lockDatabase(m_databaseGuard);
+    ASSERT(m_quotaMap);
     copyKeysToVector(*m_quotaMap, result);
 }
 
-bool DatabaseTracker::databaseNamesForOrigin(SecurityOrigin* origin, Vector<String>& resultVector)
+bool DatabaseTracker::databaseNamesForOriginNoLock(SecurityOrigin* origin, Vector<String>& resultVector)
 {
-    ASSERT(currentThread() == m_thread);
+    ASSERT(!m_databaseGuard.tryLock());
     openTrackerDatabase(false);
     if (!m_database.isOpen())
         return false;
@@ -315,44 +351,67 @@
     return true;
 }
 
-DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, SecurityOrigin* origin)
+bool DatabaseTracker::databaseNamesForOrigin(SecurityOrigin* origin, Vector<String>& resultVector)
 {
-    ASSERT(currentThread() == m_thread);
-
-    if (m_proposedDatabase && m_proposedDatabase->first == origin && m_proposedDatabase->second.name() == name)
-        return m_proposedDatabase->second;
-
-    String originIdentifier = origin->databaseIdentifier();
-
-    openTrackerDatabase(false);
-    if (!m_database.isOpen())
-        return DatabaseDetails();
-    SQLiteStatement statement(m_database, "SELECT displayName, estimatedSize FROM Databases WHERE origin=? AND name=?");
-    if (statement.prepare() != SQLResultOk)
-        return DatabaseDetails();
-
-    statement.bindText(1, originIdentifier);
-    statement.bindText(2, name);
-
-    int result = statement.step();
-    if (result == SQLResultDone)
-        return DatabaseDetails();
-
-    if (result != SQLResultRow) {
-        LOG_ERROR("Error retrieving details for database %s in origin %s from tracker database", name.ascii().data(), originIdentifier.ascii().data());
-        return DatabaseDetails();
+    Vector<String> temp;
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+        if (!databaseNamesForOriginNoLock(origin, temp))
+          return false;
     }
 
-    return DatabaseDetails(name, statement.getColumnText(0), statement.getColumnInt64(1), usageForDatabase(name, origin));
+    for (Vector<String>::iterator iter = temp.begin(); iter != temp.end(); ++iter)
+        resultVector.append(iter->threadsafeCopy());
+    return true;
+}
+
+DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, SecurityOrigin* origin)
+{
+    String originIdentifier = origin->databaseIdentifier();
+    String displayName;
+    int64_t expectedUsage;
+
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+
+        for (HashSet<ProposedDatabase*>::iterator iter = m_proposedDatabases.begin(); iter != m_proposedDatabases.end(); ++iter)
+            if ((*iter)->second.name() == name && (*iter)->first->equal(origin)) {
+                ASSERT((*iter)->second.thread() == currentThread());
+                return (*iter)->second;
+            }
+
+        openTrackerDatabase(false);
+        if (!m_database.isOpen())
+            return DatabaseDetails();
+        SQLiteStatement statement(m_database, "SELECT displayName, estimatedSize FROM Databases WHERE origin=? AND name=?");
+        if (statement.prepare() != SQLResultOk)
+            return DatabaseDetails();
+
+        statement.bindText(1, originIdentifier);
+        statement.bindText(2, name);
+
+        int result = statement.step();
+        if (result == SQLResultDone)
+            return DatabaseDetails();
+
+        if (result != SQLResultRow) {
+            LOG_ERROR("Error retrieving details for database %s in origin %s from tracker database", name.ascii().data(), originIdentifier.ascii().data());
+            return DatabaseDetails();
+        }
+        displayName = statement.getColumnText(0);
+        expectedUsage = statement.getColumnInt64(1);
+    }
+
+    return DatabaseDetails(name, displayName, expectedUsage, usageForDatabase(name, origin));
 }
 
 void DatabaseTracker::setDatabaseDetails(SecurityOrigin* origin, const String& name, const String& displayName, unsigned long estimatedSize)
 {
-    ASSERT(currentThread() == m_thread);
-
     String originIdentifier = origin->databaseIdentifier();
     int64_t guid = 0;
 
+    MutexLocker lockDatabase(m_databaseGuard);
+
     openTrackerDatabase(true);
     if (!m_database.isOpen())
         return;
@@ -400,7 +459,6 @@
 
 unsigned long long DatabaseTracker::usageForDatabase(const String& name, SecurityOrigin* origin)
 {
-    ASSERT(currentThread() == m_thread);
     String path = fullPathForDatabase(origin, name, false);
     if (path.isEmpty())
         return 0;
@@ -413,27 +471,32 @@
     if (!database)
         return;
 
-    MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+    {
+        MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
 
-    if (!m_openDatabaseMap)
-        m_openDatabaseMap.set(new DatabaseOriginMap);
+        if (!m_openDatabaseMap)
+            m_openDatabaseMap.set(new DatabaseOriginMap);
 
-    String name(database->stringIdentifier());
-    DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
-    if (!nameMap) {
-        nameMap = new DatabaseNameMap;
-        m_openDatabaseMap->set(database->securityOrigin(), nameMap);
+        String name(database->stringIdentifier());
+        DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
+        if (!nameMap) {
+            nameMap = new DatabaseNameMap;
+            m_openDatabaseMap->set(database->securityOrigin()->threadsafeCopy(), nameMap);
+        }
+
+        DatabaseSet* databaseSet = nameMap->get(name);
+        if (!databaseSet) {
+            databaseSet = new DatabaseSet;
+            nameMap->set(name.threadsafeCopy(), databaseSet);
+        }
+
+        databaseSet->add(database);
+
+        LOG(StorageAPI, "Added open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database);
     }
 
-    DatabaseSet* databaseSet = nameMap->get(name);
-    if (!databaseSet) {
-        databaseSet = new DatabaseSet;
-        nameMap->set(name, databaseSet);
-    }
-
-    databaseSet->add(database);
-
-    LOG(StorageAPI, "Added open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database);
+    MutexLocker lockDatabase(m_databaseGuard);
+    doneCreatingDatabase(database->securityOrigin(), database->stringIdentifier());
 }
 
 void DatabaseTracker::removeOpenDatabase(Database* database)
@@ -441,41 +504,46 @@
     if (!database)
         return;
 
-    MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+    {
+        MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
 
-    if (!m_openDatabaseMap) {
-        ASSERT_NOT_REACHED();
-        return;
+        if (!m_openDatabaseMap) {
+            ASSERT_NOT_REACHED();
+            return;
+        }
+
+        String name(database->stringIdentifier());
+        DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
+        if (!nameMap) {
+            ASSERT_NOT_REACHED();
+            return;
+        }
+
+        DatabaseSet* databaseSet = nameMap->get(name);
+        if (!databaseSet) {
+            ASSERT_NOT_REACHED();
+            return;
+        }
+
+        databaseSet->remove(database);
+
+        LOG(StorageAPI, "Removed open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database);
+
+        if (!databaseSet->isEmpty())
+            return;
+
+        nameMap->remove(name);
+        delete databaseSet;
+
+        if (!nameMap->isEmpty())
+            return;
+
+        m_openDatabaseMap->remove(database->securityOrigin());
+        delete nameMap;
     }
 
-    String name(database->stringIdentifier());
-    DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
-    if (!nameMap) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    DatabaseSet* databaseSet = nameMap->get(name);
-    if (!databaseSet) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    databaseSet->remove(database);
-
-    LOG(StorageAPI, "Removed open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database);
-
-    if (!databaseSet->isEmpty())
-        return;
-
-    nameMap->remove(name);
-    delete databaseSet;
-
-    if (!nameMap->isEmpty())
-        return;
-
-    m_openDatabaseMap->remove(database->securityOrigin());
-    delete nameMap;
+    Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
+    originQuotaManager().removeOrigin(database->securityOrigin());
 }
 
 void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database> >* databases)
@@ -496,10 +564,9 @@
         databases->add(*it);
 }
 
-unsigned long long DatabaseTracker::usageForOrigin(SecurityOrigin* origin)
+unsigned long long DatabaseTracker::usageForOriginNoLock(SecurityOrigin* origin)
 {
-    ASSERT(currentThread() == m_thread);
-    Locker<OriginQuotaManager> locker(originQuotaManager());
+    ASSERT(!originQuotaManager().tryLock());
 
     // Use the OriginQuotaManager mechanism to calculate the usage
     if (originQuotaManager().tracksOrigin(origin))
@@ -509,79 +576,89 @@
     originQuotaManager().trackOrigin(origin);
 
     Vector<String> names;
-    databaseNamesForOrigin(origin, names);
+    databaseNamesForOriginNoLock(origin, names);
 
     for (unsigned i = 0; i < names.size(); ++i)
-        originQuotaManager().addDatabase(origin, names[i], fullPathForDatabase(origin, names[i], false));
+        originQuotaManager().addDatabase(origin, names[i], fullPathForDatabaseNoLock(origin, names[i], false));
 
     if (!originQuotaManager().tracksOrigin(origin))
         return 0;
     return originQuotaManager().diskUsage(origin);
 }
 
+unsigned long long DatabaseTracker::usageForOrigin(SecurityOrigin* origin)
+{
+    MutexLocker lockDatabase(m_databaseGuard);
+    Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
+    return usageForOriginNoLock(origin);
+}
+
+unsigned long long DatabaseTracker::quotaForOriginNoLock(SecurityOrigin* origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(m_quotaMap);
+    return m_quotaMap->get(origin);
+}
+
 unsigned long long DatabaseTracker::quotaForOrigin(SecurityOrigin* origin)
 {
-    ASSERT(currentThread() == m_thread || m_quotaMap);
-    populateOrigins();
-    MutexLocker lockQuotaMap(m_quotaMapGuard);
-    return m_quotaMap->get(origin);
+    MutexLocker lockDatabase(m_databaseGuard);
+    return quotaForOriginNoLock(origin);
 }
 
 void DatabaseTracker::setQuota(SecurityOrigin* origin, unsigned long long quota)
 {
-    ASSERT(currentThread() == m_thread);
-    if (quotaForOrigin(origin) == quota)
+    MutexLocker lockDatabase(m_databaseGuard);
+
+    if (quotaForOriginNoLock(origin) == quota)
         return;
 
     openTrackerDatabase(true);
     if (!m_database.isOpen())
         return;
 
-    {
-        MutexLocker lockQuotaMap(m_quotaMapGuard);
-
-        if (!m_quotaMap->contains(origin)) {
-            SQLiteStatement statement(m_database, "INSERT INTO Origins VALUES (?, ?)");
-            if (statement.prepare() != SQLResultOk) {
-                LOG_ERROR("Unable to establish origin %s in the tracker", origin->databaseIdentifier().ascii().data());
-            } else {
-                statement.bindText(1, origin->databaseIdentifier());
-                statement.bindInt64(2, quota);
-
-                if (statement.step() != SQLResultDone)
-                    LOG_ERROR("Unable to establish origin %s in the tracker", origin->databaseIdentifier().ascii().data());
-            }
+    if (!m_quotaMap->contains(origin)) {
+        SQLiteStatement statement(m_database, "INSERT INTO Origins VALUES (?, ?)");
+        if (statement.prepare() != SQLResultOk) {
+            LOG_ERROR("Unable to establish origin %s in the tracker", origin->databaseIdentifier().ascii().data());
         } else {
-            SQLiteStatement statement(m_database, "UPDATE Origins SET quota=? WHERE origin=?");
-            bool error = statement.prepare() != SQLResultOk;
-            if (!error) {
-                statement.bindInt64(1, quota);
-                statement.bindText(2, origin->databaseIdentifier());
+            statement.bindText(1, origin->databaseIdentifier());
+            statement.bindInt64(2, quota);
 
-                error = !statement.executeCommand();
-            }
+            if (statement.step() != SQLResultDone)
+                LOG_ERROR("Unable to establish origin %s in the tracker", origin->databaseIdentifier().ascii().data());
+        }
+    } else {
+        SQLiteStatement statement(m_database, "UPDATE Origins SET quota=? WHERE origin=?");
+        bool error = statement.prepare() != SQLResultOk;
+        if (!error) {
+            statement.bindInt64(1, quota);
+            statement.bindText(2, origin->databaseIdentifier());
 
-            if (error)
-                LOG_ERROR("Failed to set quota %llu in tracker database for origin %s", quota, origin->databaseIdentifier().ascii().data());
+            error = !statement.executeCommand();
         }
 
-        // FIXME: Is it really OK to update the quota in memory if we failed to update it on disk?
-        m_quotaMap->set(origin, quota);
+        if (error)
+            LOG_ERROR("Failed to set quota %llu in tracker database for origin %s", quota, origin->databaseIdentifier().ascii().data());
     }
 
+    // FIXME: Is it really OK to update the quota in memory if we failed to update it on disk?
+    m_quotaMap->set(origin->threadsafeCopy(), quota);
+
     if (m_client)
         m_client->dispatchDidModifyOrigin(origin);
 }
 
 bool DatabaseTracker::addDatabase(SecurityOrigin* origin, const String& name, const String& path)
 {
-    ASSERT(currentThread() == m_thread);
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(m_quotaMap);
     openTrackerDatabase(true);
     if (!m_database.isOpen())
         return false;
 
     // New database should never be added until the origin has been established
-    ASSERT(hasEntryForOrigin(origin));
+    ASSERT(hasEntryForOriginNoLock(origin));
 
     SQLiteStatement statement(m_database, "INSERT INTO Databases (origin, name, path) VALUES (?, ?, ?);");
 
@@ -605,8 +682,6 @@
 
 void DatabaseTracker::deleteAllDatabases()
 {
-    ASSERT(currentThread() == m_thread);
-
     Vector<RefPtr<SecurityOrigin> > originsCopy;
     origins(originsCopy);
 
@@ -614,19 +689,30 @@
         deleteOrigin(originsCopy[i].get());
 }
 
-void DatabaseTracker::deleteOrigin(SecurityOrigin* origin)
+// It is the caller's responsibility to make sure that nobody is trying to create, delete, open, or close databases in this origin while the deletion is
+// taking place.
+bool DatabaseTracker::deleteOrigin(SecurityOrigin* origin)
 {
-    ASSERT(currentThread() == m_thread);
-    openTrackerDatabase(false);
-    if (!m_database.isOpen())
-        return;
-
     Vector<String> databaseNames;
-    if (!databaseNamesForOrigin(origin, databaseNames)) {
-        LOG_ERROR("Unable to retrieve list of database names for origin %s", origin->databaseIdentifier().ascii().data());
-        return;
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+        openTrackerDatabase(false);
+        if (!m_database.isOpen())
+            return false;
+
+        if (!databaseNamesForOriginNoLock(origin, databaseNames)) {
+            LOG_ERROR("Unable to retrieve list of database names for origin %s", origin->databaseIdentifier().ascii().data());
+            return false;
+        }
+        if (!canDeleteOrigin(origin)) {
+            LOG_ERROR("Tried to delete an origin (%s) while either creating database in it or already deleting it", origin->databaseIdentifier().ascii().data());
+            ASSERT(false);
+            return false;
+        }
+        recordDeletingOrigin(origin);
     }
 
+    // We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
     for (unsigned i = 0; i < databaseNames.size(); ++i) {
         if (!deleteDatabaseFile(origin, databaseNames[i])) {
             // Even if the file can't be deleted, we want to try and delete the rest, don't return early here.
@@ -634,41 +720,45 @@
         }
     }
 
-    SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=?");
-    if (statement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
-        return;
-    }
-
-    statement.bindText(1, origin->databaseIdentifier());
-
-    if (!statement.executeCommand()) {
-        LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
-        return;
-    }
-
-    SQLiteStatement originStatement(m_database, "DELETE FROM Origins WHERE origin=?");
-    if (originStatement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to prepare deletion of origin %s from tracker", origin->databaseIdentifier().ascii().data());
-        return;
-    }
-
-    originStatement.bindText(1, origin->databaseIdentifier());
-
-    if (!originStatement.executeCommand()) {
-        LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
-        return;
-    }
-
-    SQLiteFileSystem::deleteEmptyDatabaseDirectory(originPath(origin));
-
-    RefPtr<SecurityOrigin> originPossiblyLastReference = origin;
     {
-        MutexLocker lockQuotaMap(m_quotaMapGuard);
+        MutexLocker lockDatabase(m_databaseGuard);
+        doneDeletingOrigin(origin);
+
+        SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=?");
+        if (statement.prepare() != SQLResultOk) {
+            LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
+            return false;
+        }
+
+        statement.bindText(1, origin->databaseIdentifier());
+
+        if (!statement.executeCommand()) {
+            LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
+            return false;
+        }
+
+        SQLiteStatement originStatement(m_database, "DELETE FROM Origins WHERE origin=?");
+        if (originStatement.prepare() != SQLResultOk) {
+            LOG_ERROR("Unable to prepare deletion of origin %s from tracker", origin->databaseIdentifier().ascii().data());
+            return false;
+        }
+
+        originStatement.bindText(1, origin->databaseIdentifier());
+
+        if (!originStatement.executeCommand()) {
+            LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
+            return false;
+        }
+
+        SQLiteFileSystem::deleteEmptyDatabaseDirectory(originPath(origin));
+
+        RefPtr<SecurityOrigin> originPossiblyLastReference = origin;
         m_quotaMap->remove(origin);
 
-        Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
-        originQuotaManager().removeOrigin(origin);
+        {
+            Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
+            originQuotaManager().removeOrigin(origin);
+        }
 
         // If we removed the last origin, do some additional deletion.
         if (m_quotaMap->isEmpty()) {
@@ -677,31 +767,159 @@
            SQLiteFileSystem::deleteDatabaseFile(trackerDatabasePath());
            SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectoryPath);
         }
-    }
 
-    if (m_client) {
-        m_client->dispatchDidModifyOrigin(origin);
-        for (unsigned i = 0; i < databaseNames.size(); ++i)
-            m_client->dispatchDidModifyDatabase(origin, databaseNames[i]);
+        if (m_client) {
+            m_client->dispatchDidModifyOrigin(origin);
+            for (unsigned i = 0; i < databaseNames.size(); ++i)
+                m_client->dispatchDidModifyDatabase(origin, databaseNames[i]);
+        }
+    }
+    return true;
+}
+
+bool DatabaseTracker::canCreateDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    // Can't create a database while someone else is deleting it; there's a risk of leaving untracked database debris on the disk.
+    return !deletingDatabase(origin, name) && !deletingOrigin(origin);
+}
+
+void DatabaseTracker::recordCreatingDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    NameCountMap* nameMap = m_beingCreated.get(origin);
+    if (!nameMap) {
+        nameMap = new NameCountMap();
+        m_beingCreated.set(origin->threadsafeCopy(), nameMap);
+    }
+    long count = nameMap->get(name);
+    nameMap->set(name.threadsafeCopy(), count + 1);
+}
+
+void DatabaseTracker::doneCreatingDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    NameCountMap* nameMap = m_beingCreated.get(origin);
+    if (nameMap) {
+        long count = nameMap->get(name);
+        ASSERT(count > 0);
+        if (count <= 1) {
+            nameMap->remove(name);
+            if (nameMap->isEmpty()) {
+                m_beingCreated.remove(origin);
+                delete nameMap;
+            }
+        } else
+            nameMap->set(name, count - 1);
+    } else
+        ASSERT(false);
+}
+
+bool DatabaseTracker::creatingDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    NameCountMap* nameMap = m_beingCreated.get(origin);
+    return nameMap && nameMap->get(name);
+}
+
+bool DatabaseTracker::canDeleteDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    return !creatingDatabase(origin, name) && !deletingDatabase(origin, name);
+}
+
+void DatabaseTracker::recordDeletingDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(canDeleteDatabase(origin, name));
+    NameSet* nameSet = m_beingDeleted.get(origin);
+    if (!nameSet) {
+        nameSet = new NameSet();
+        m_beingDeleted.set(origin->threadsafeCopy(), nameSet);
+    }
+    ASSERT(!nameSet->contains(name));
+    nameSet->add(name.threadsafeCopy());
+}
+
+void DatabaseTracker::doneDeletingDatabase(SecurityOrigin *origin, const String& name)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    NameSet* nameSet = m_beingDeleted.get(origin);
+    if (nameSet) {
+        ASSERT(nameSet->contains(name));
+        nameSet->remove(name);
+        if (nameSet->isEmpty()) {
+            m_beingDeleted.remove(origin);
+            delete nameSet;
+        }
+    } else {
+        ASSERT(false);
     }
 }
 
-void DatabaseTracker::deleteDatabase(SecurityOrigin* origin, const String& name)
+bool DatabaseTracker::deletingDatabase(SecurityOrigin *origin, const String& name)
 {
-    ASSERT(currentThread() == m_thread);
-    openTrackerDatabase(false);
-    if (!m_database.isOpen())
-        return;
+    ASSERT(!m_databaseGuard.tryLock());
+    NameSet* nameSet = m_beingDeleted.get(origin);
+    return nameSet && nameSet->contains(name);
+}
 
+bool DatabaseTracker::canDeleteOrigin(SecurityOrigin *origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    return !(deletingOrigin(origin) || m_beingCreated.get(origin));
+}
+
+bool DatabaseTracker::deletingOrigin(SecurityOrigin *origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    return m_originsBeingDeleted.contains(origin);
+}
+
+void DatabaseTracker::recordDeletingOrigin(SecurityOrigin *origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(!deletingOrigin(origin));
+    m_originsBeingDeleted.add(origin->threadsafeCopy());
+}
+
+void DatabaseTracker::doneDeletingOrigin(SecurityOrigin *origin)
+{
+    ASSERT(!m_databaseGuard.tryLock());
+    ASSERT(deletingOrigin(origin));
+    m_originsBeingDeleted.remove(origin);
+}
+
+bool DatabaseTracker::deleteDatabase(SecurityOrigin* origin, const String& name)
+{
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+        openTrackerDatabase(false);
+        if (!m_database.isOpen())
+            return false;
+
+        if (!canDeleteDatabase(origin, name)) {
+            ASSERT(FALSE);
+            return false;
+        }
+        recordDeletingDatabase(origin, name);
+    }
+
+    // We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
     if (!deleteDatabaseFile(origin, name)) {
         LOG_ERROR("Unable to delete file for database %s in origin %s", name.ascii().data(), origin->databaseIdentifier().ascii().data());
-        return;
+        MutexLocker lockDatabase(m_databaseGuard);
+        doneDeletingDatabase(origin, name);
+        return false;
     }
 
+    MutexLocker lockDatabase(m_databaseGuard);
+
     SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=? AND name=?");
     if (statement.prepare() != SQLResultOk) {
         LOG_ERROR("Unable to prepare deletion of database %s from origin %s from tracker", name.ascii().data(), origin->databaseIdentifier().ascii().data());
-        return;
+        doneDeletingDatabase(origin, name);
+        return false;
     }
 
     statement.bindText(1, origin->databaseIdentifier());
@@ -709,7 +927,8 @@
 
     if (!statement.executeCommand()) {
         LOG_ERROR("Unable to execute deletion of database %s from origin %s from tracker", name.ascii().data(), origin->databaseIdentifier().ascii().data());
-        return;
+        doneDeletingDatabase(origin, name);
+        return false;
     }
 
     {
@@ -721,28 +940,38 @@
         m_client->dispatchDidModifyOrigin(origin);
         m_client->dispatchDidModifyDatabase(origin, name);
     }
+    doneDeletingDatabase(origin, name);
+    
+    return true;
 }
 
+// deleteDatabaseFile has to release locks between looking up the list of databases to close and closing them.  While this is in progress, the caller
+// is responsible for making sure no new databases are opened in the file to be deleted.
 bool DatabaseTracker::deleteDatabaseFile(SecurityOrigin* origin, const String& name)
 {
-    ASSERT(currentThread() == m_thread);
     String fullPath = fullPathForDatabase(origin, name, false);
     if (fullPath.isEmpty())
         return true;
 
+#ifndef NDEBUG
+    {
+        MutexLocker lockDatabase(m_databaseGuard);
+        ASSERT(deletingDatabase(origin, name) || deletingOrigin(origin));
+    }
+#endif
+
     Vector<RefPtr<Database> > deletedDatabases;
 
-    // Make sure not to hold the m_openDatabaseMapGuard mutex when calling
+    // Make sure not to hold the any locks when calling
     // Database::markAsDeletedAndClose(), since that can cause a deadlock
     // during the synchronous DatabaseThread call it triggers.
-
     {
         MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
         if (m_openDatabaseMap) {
             // There are some open databases, lets check if they are for this origin.
             DatabaseNameMap* nameMap = m_openDatabaseMap->get(origin);
             if (nameMap && nameMap->size()) {
-                // There are some open databases for this origin, lets check
+                // There are some open databases for this origin, let's check
                 // if they are this database by name.
                 DatabaseSet* databaseSet = nameMap->get(name);
                 if (databaseSet && databaseSet->size()) {
@@ -763,7 +992,6 @@
 
 void DatabaseTracker::setClient(DatabaseTrackerClient* client)
 {
-    ASSERT(currentThread() == m_thread);
     m_client = client;
 }
 
@@ -773,7 +1001,7 @@
     return mutex;
 }
 
-typedef Vector<pair<SecurityOrigin*, String> > NotificationQueue;
+typedef Vector<pair<RefPtr<SecurityOrigin>, String> > NotificationQueue;
 
 static NotificationQueue& notificationQueue()
 {
@@ -785,7 +1013,7 @@
 {
     MutexLocker locker(notificationMutex());
 
-    notificationQueue().append(pair<SecurityOrigin*, String>(origin, name.crossThreadString()));
+    notificationQueue().append(pair<RefPtr<SecurityOrigin>, String>(origin->threadsafeCopy(), name.crossThreadString()));
     scheduleForNotification();
 }
 
@@ -820,7 +1048,7 @@
         return;
 
     for (unsigned i = 0; i < notifications.size(); ++i)
-        theTracker.m_client->dispatchDidModifyDatabase(notifications[i].first, notifications[i].second);
+        theTracker.m_client->dispatchDidModifyDatabase(notifications[i].first.get(), notifications[i].second);
 }
 
 
diff --git a/WebCore/storage/DatabaseTracker.h b/WebCore/storage/DatabaseTracker.h
index 4640b18..fdfbb65 100644
--- a/WebCore/storage/DatabaseTracker.h
+++ b/WebCore/storage/DatabaseTracker.h
@@ -52,7 +52,6 @@
 
 #if !PLATFORM(CHROMIUM)
 class DatabaseTrackerClient;
-class OriginQuotaManager;
 
 struct SecurityOriginTraits;
 #endif // !PLATFORM(CHROMIUM)
@@ -60,9 +59,11 @@
 class DatabaseTracker : public Noncopyable {
 public:
     static DatabaseTracker& tracker();
-    // FIXME: Due to workers having multiple threads in a single process sharing
-    // a DatabaseTracker, this singleton will have to be synchronized or moved
-    // to TLS.
+    // This singleton will potentially be used from multiple worker threads and the page's context thread simultaneously.  To keep this safe, it's
+    // currently using 4 locks.  In order to avoid deadlock when taking multiple locks, you must take them in the correct order:
+    // m_databaseGuard before quotaManager if both locks are needed.
+    // no other lock is taken in the code locked on m_openDatabaseMapGuard.
+    // notificationMutex() is currently independent of the other locks.
 
     bool canEstablishDatabase(ScriptExecutionContext*, const String& name, const String& displayName, unsigned long estimatedSize);
     void setDatabaseDetails(SecurityOrigin*, const String& name, const String& displayName, unsigned long estimatedSize);
@@ -73,6 +74,7 @@
     void getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database> >* databases);
 
     unsigned long long getMaxSizeForDatabase(const Database*);
+    void databaseChanged(Database*);
 
 private:
     DatabaseTracker();
@@ -87,7 +89,7 @@
 #if !PLATFORM(CHROMIUM)
 public:
     void setDatabaseDirectoryPath(const String&);
-    const String& databaseDirectoryPath() const;
+    String databaseDirectoryPath() const;
 
     void origins(Vector<RefPtr<SecurityOrigin> >& result);
     bool databaseNamesForOrigin(SecurityOrigin*, Vector<String>& result);
@@ -100,20 +102,23 @@
     void setQuota(SecurityOrigin*, unsigned long long);
 
     void deleteAllDatabases();
-    void deleteOrigin(SecurityOrigin*);
-    void deleteDatabase(SecurityOrigin*, const String& name);
+    bool deleteOrigin(SecurityOrigin*);
+    bool deleteDatabase(SecurityOrigin*, const String& name);
 
     void setClient(DatabaseTrackerClient*);
 
     // From a secondary thread, must be thread safe with its data
     void scheduleNotifyDatabaseChanged(SecurityOrigin*, const String& name);
 
-    OriginQuotaManager& originQuotaManager();
-
-
     bool hasEntryForOrigin(SecurityOrigin*);
 
 private:
+    bool hasEntryForOriginNoLock(SecurityOrigin* origin);
+    String fullPathForDatabaseNoLock(SecurityOrigin*, const String& name, bool createIfDoesNotExist);
+    bool databaseNamesForOriginNoLock(SecurityOrigin* origin, Vector<String>& resultVector);
+    unsigned long long usageForOriginNoLock(SecurityOrigin* origin);
+    unsigned long long quotaForOriginNoLock(SecurityOrigin* origin);
+
     String trackerDatabasePath() const;
     void openTrackerDatabase(bool createIfDoesNotExist);
 
@@ -126,23 +131,38 @@
 
     bool deleteDatabaseFile(SecurityOrigin*, const String& name);
 
+    // This lock protects m_database, m_quotaMap, m_proposedDatabases, m_databaseDirectoryPath, m_originsBeingDeleted, m_beingCreated, and m_beingDeleted.
+    Mutex m_databaseGuard;
     SQLiteDatabase m_database;
 
     typedef HashMap<RefPtr<SecurityOrigin>, unsigned long long, SecurityOriginHash> QuotaMap;
-    Mutex m_quotaMapGuard;
     mutable OwnPtr<QuotaMap> m_quotaMap;
 
-    OwnPtr<OriginQuotaManager> m_quotaManager;
-
     String m_databaseDirectoryPath;
 
     DatabaseTrackerClient* m_client;
 
-    std::pair<SecurityOrigin*, DatabaseDetails>* m_proposedDatabase;
+    typedef std::pair<RefPtr<SecurityOrigin>, DatabaseDetails> ProposedDatabase;
+    HashSet<ProposedDatabase*> m_proposedDatabases;
 
-#ifndef NDEBUG
-    ThreadIdentifier m_thread;
-#endif
+    typedef HashMap<String, long> NameCountMap;
+    typedef HashMap<RefPtr<SecurityOrigin>, NameCountMap*, SecurityOriginHash> CreateSet;
+    CreateSet m_beingCreated;
+    typedef HashSet<String> NameSet;
+    HashMap<RefPtr<SecurityOrigin>, NameSet*, SecurityOriginHash> m_beingDeleted;
+    HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash> m_originsBeingDeleted;
+    bool canCreateDatabase(SecurityOrigin *origin, const String& name);
+    void recordCreatingDatabase(SecurityOrigin *origin, const String& name);
+    void doneCreatingDatabase(SecurityOrigin *origin, const String& name);
+    bool creatingDatabase(SecurityOrigin *origin, const String& name);
+    bool canDeleteDatabase(SecurityOrigin *origin, const String& name);
+    void recordDeletingDatabase(SecurityOrigin *origin, const String& name);
+    void doneDeletingDatabase(SecurityOrigin *origin, const String& name);
+    bool deletingDatabase(SecurityOrigin *origin, const String& name);
+    bool canDeleteOrigin(SecurityOrigin *origin);
+    bool deletingOrigin(SecurityOrigin *origin);
+    void recordDeletingOrigin(SecurityOrigin *origin);
+    void doneDeletingOrigin(SecurityOrigin *origin);
 
     static void scheduleForNotification();
     static void notifyDatabasesChanged(void*);
diff --git a/WebCore/storage/IDBCallbacks.h b/WebCore/storage/IDBCallbacks.h
new file mode 100644
index 0000000..ce0d20d
--- /dev/null
+++ b/WebCore/storage/IDBCallbacks.h
@@ -0,0 +1,106 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBCallbacks_h
+#define IDBCallbacks_h
+
+#include "ActiveDOMObject.h"
+#include "IDBDatabaseError.h"
+#include "Timer.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// All IndexedDB callbacks must implement this class.  It handles the asynchronous firing of
+// the callbacks.
+template <typename ResultType>
+class IDBCallbacks : public RefCounted<IDBCallbacks<ResultType> >, public ActiveDOMObject {
+public:
+    IDBCallbacks(ScriptExecutionContext* scriptExecutionContext, void* upcastPointer)
+        : ActiveDOMObject(scriptExecutionContext, upcastPointer)
+        , m_timer(this, &IDBCallbacks::timerFired)
+    {
+    }
+
+    virtual ~IDBCallbacks() { }
+
+    void onSuccess(PassRefPtr<ResultType> result)
+    {
+        ASSERT(!m_result);
+        ASSERT(!m_error);
+        m_result = result;
+        ASSERT(m_result);
+
+        ASSERT(!m_timer.isActive());
+        m_selfRef = this;
+        m_timer.startOneShot(0);
+    }
+
+    void onError(PassRefPtr<IDBDatabaseError> error)
+    {
+        ASSERT(!m_result);
+        ASSERT(!m_error);
+        m_error = error;
+        ASSERT(m_error);
+
+        ASSERT(!m_timer.isActive());
+        m_selfRef = this;
+        m_timer.startOneShot(0);
+    }
+
+protected:
+    virtual void onSuccessAsync(PassRefPtr<ResultType>) = 0;
+    virtual void onErrorAsync(PassRefPtr<IDBDatabaseError>) = 0;
+
+    void timerFired(Timer<IDBCallbacks>*)
+    {
+        if (m_result) {
+            onSuccessAsync(m_result);
+            m_result = 0;
+        } else {
+            onErrorAsync(m_error);
+            m_error = 0;
+        }
+        m_selfRef = 0; // May trigger a delete immediately.
+    }
+
+private:
+    Timer<IDBCallbacks> m_timer;
+    RefPtr<IDBCallbacks> m_selfRef;
+    RefPtr<ResultType> m_result;
+    RefPtr<IDBDatabaseError> m_error;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBCallbacks_h
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
new file mode 100644
index 0000000..f3f354f
--- /dev/null
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -0,0 +1,40 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IDBDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// FIXME: Write.
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IDBDatabase.h b/WebCore/storage/IDBDatabase.h
new file mode 100644
index 0000000..03262f4
--- /dev/null
+++ b/WebCore/storage/IDBDatabase.h
@@ -0,0 +1,53 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBDatabase_h
+#define IDBDatabase_h
+
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// This class is shared by IDBDatabaseRequest (async) and IDBDatabaseSync (sync).
+// This is implemented by IDBDatabaseImpl and optionally others (in order to proxy
+// calls across process barriers). All calls to these classes should be non-blocking and
+// trigger work on a background thread if necessary.
+class IDBDatabase : public ThreadSafeShared<IDBDatabase> {
+public:
+    virtual ~IDBDatabase() { }
+    // FIXME: Write.
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabase_h
+
diff --git a/WebCore/storage/IDBDatabaseError.h b/WebCore/storage/IDBDatabaseError.h
index e8fd2dd..cb479c1 100644
--- a/WebCore/storage/IDBDatabaseError.h
+++ b/WebCore/storage/IDBDatabaseError.h
@@ -38,19 +38,20 @@
 
 class IDBDatabaseError : public RefCounted<IDBDatabaseError> {
 public:
-    static PassRefPtr<IDBDatabaseError> create()
+    static PassRefPtr<IDBDatabaseError> create(unsigned short code, const String& message)
     {
-        return adoptRef(new IDBDatabaseError());
+        return adoptRef(new IDBDatabaseError(code, message));
     }
     ~IDBDatabaseError() { }
 
     unsigned short code() const { return m_code; }
     void setCode(unsigned short value) { m_code = value; }
-    String message() const { return m_message; }
+    const String& message() const { return m_message; }
     void setMessage(const String& value) { m_message = value; }
 
 private:
-    IDBDatabaseError() { }
+    IDBDatabaseError(unsigned short code, const String& message)
+        : m_code(code), m_message(message) { }
 
     unsigned short m_code;
     String m_message;
diff --git a/WebCore/storage/IDBDatabaseRequest.cpp b/WebCore/storage/IDBDatabaseRequest.cpp
new file mode 100644
index 0000000..31e0554
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseRequest.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IDBDatabaseRequest.h"
+
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IDBDatabaseRequest::IDBDatabaseRequest(PassRefPtr<IDBDatabase> idbDatabase)
+    : m_idbDatabase(idbDatabase)
+{
+}
+
+IDBDatabaseRequest::~IDBDatabaseRequest()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IDBDatabaseRequest.h b/WebCore/storage/IDBDatabaseRequest.h
new file mode 100644
index 0000000..c027b6a
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseRequest.h
@@ -0,0 +1,63 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBDatabaseRequest_h
+#define IDBDatabaseRequest_h
+
+#include "IDBDatabase.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBDatabaseRequest : public RefCounted<IDBDatabaseRequest> {
+public:
+    static PassRefPtr<IDBDatabaseRequest> create(PassRefPtr<IDBDatabase> idbDatabase)
+    {
+        return adoptRef(new IDBDatabaseRequest(idbDatabase));
+    }
+    ~IDBDatabaseRequest();
+
+    // FIXME: Write.
+    void createObjectStore(const String& name, const String& keyPath, bool autoIncrement) { }
+
+private:
+    IDBDatabaseRequest(PassRefPtr<IDBDatabase>);
+
+    RefPtr<IDBDatabase> m_idbDatabase;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabaseRequest_h
+
diff --git a/WebCore/storage/IDBDatabaseRequest.idl b/WebCore/storage/IDBDatabaseRequest.idl
new file mode 100644
index 0000000..be031d3
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseRequest.idl
@@ -0,0 +1,39 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+module storage {
+
+    interface [
+        Conditional=INDEXED_DATABASE
+    ] IDBDatabaseRequest {
+        // FIXME: Boolean should be optional and keyPath should take nulls.
+        void createObjectStore(in DOMString name, in DOMString keyPath, in boolean autoIncrement);
+
+        // FIXME: Finish.
+    };
+
+}
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
deleted file mode 100644
index 1a20499..0000000
--- a/WebCore/storage/IDBRequest.cpp
+++ /dev/null
@@ -1,64 +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:
- *
- * 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IDBRequest.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseError.h"
-#include "SerializedScriptValue.h"
-
-namespace WebCore {
-
-IDBRequest::IDBRequest(ScriptExecutionContext* context)
-    : ActiveDOMObject(context, this)
-{
-}
-
-IDBRequest::~IDBRequest()
-{
-}
-
-void IDBRequest::abort()
-{
-}
-
-EventTargetData* IDBRequest::eventTargetData()
-{
-    return 0;
-}
-
-EventTargetData* IDBRequest::ensureEventTargetData()
-{
-    return 0;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
diff --git a/WebCore/storage/IDBRequest.h b/WebCore/storage/IDBRequest.h
deleted file mode 100644
index 5f00aa8..0000000
--- a/WebCore/storage/IDBRequest.h
+++ /dev/null
@@ -1,88 +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:
- *
- * 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBRequest_h
-#define IDBRequest_h
-
-#include "ActiveDOMObject.h"
-#include "EventTarget.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBDatabaseError;
-class SerializedScriptValue;
-
-class IDBRequest : public RefCounted<IDBRequest>, public ActiveDOMObject, public EventTarget {
-public:
-    static PassRefPtr<IDBRequest> create(ScriptExecutionContext* context)
-    {
-        return adoptRef(new IDBRequest(context));
-    }
-    ~IDBRequest();
-
-    void abort();
-    unsigned short readyState() const { return m_readyState; }
-    IDBDatabaseError* error() const { return m_error.get(); }
-    SerializedScriptValue* result() const { return m_result.get(); }
-
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
-
-    using RefCounted<IDBRequest>::ref;
-    using RefCounted<IDBRequest>::deref;
-
-    // EventTarget interface
-    virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
-    virtual IDBRequest* toIDBRequest() { return this; }
-
-private:
-    explicit IDBRequest(ScriptExecutionContext* context);
-
-    // EventTarget interface
-    virtual void refEventTarget() { ref(); }
-    virtual void derefEventTarget() { deref(); }
-    virtual EventTargetData* eventTargetData();
-    virtual EventTargetData* ensureEventTargetData();
-
-    unsigned short m_readyState;
-    RefPtr<IDBDatabaseError> m_error;
-    RefPtr<SerializedScriptValue> m_result;
-
-    EventTargetData m_eventTargetData;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // IDBRequest_h
-
diff --git a/WebCore/storage/IDBRequest.idl b/WebCore/storage/IDBRequest.idl
deleted file mode 100644
index b34184c..0000000
--- a/WebCore/storage/IDBRequest.idl
+++ /dev/null
@@ -1,45 +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:
- *
- * 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
- */
-module storage {
-
-    interface [
-        Conditional=INDEXED_DATABASE,
-        EventTarget
-    ] IDBRequest {
-        void abort();
-        const unsigned short INITIAL = 0;
-        const unsigned short LOADING = 1;
-        const unsigned short DONE = 2;
-        readonly attribute unsigned short readyState;
-        readonly attribute IDBDatabaseError error;
-        readonly attribute [CustomGetter] any result;
-        attribute EventListener onsuccess;
-        attribute EventListener onerror;
-    };
-
-}
diff --git a/WebCore/storage/IndexedDatabase.cpp b/WebCore/storage/IndexedDatabase.cpp
new file mode 100644
index 0000000..a20974b
--- /dev/null
+++ b/WebCore/storage/IndexedDatabase.cpp
@@ -0,0 +1,49 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabase.h"
+
+#include "IndexedDatabaseImpl.h"
+
+#if PLATFORM(CHROMIUM)
+#error "Chromium should not compile this file and instead define its own version of this factory that navigates the multi-process boundry."
+#endif
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabase::create()
+{
+    return IndexedDatabaseImpl::create();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IndexedDatabase.h b/WebCore/storage/IndexedDatabase.h
new file mode 100644
index 0000000..1027fb7
--- /dev/null
+++ b/WebCore/storage/IndexedDatabase.h
@@ -0,0 +1,62 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabase_h
+#define IndexedDatabase_h
+
+#include "ExceptionCode.h"
+#include "IDBCallbacks.h"
+#include "PlatformString.h"
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class Frame;
+class IDBDatabase;
+
+typedef IDBCallbacks<IDBDatabase> IDBDatabaseCallbacks;
+
+// This class is shared by IndexedDatabaseRequest (async) and IndexedDatabaseSync (sync).
+// This is implemented by IndexedDatabaseImpl and optionally others (in order to proxy
+// calls across process barriers). All calls to these classes should be non-blocking and
+// trigger work on a background thread if necessary.
+class IndexedDatabase : public ThreadSafeShared<IndexedDatabase> {
+public:
+    static PassRefPtr<IndexedDatabase> create();
+    virtual ~IndexedDatabase() { }
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks>, Frame*, ExceptionCode&) = 0;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabase_h
+
diff --git a/WebCore/storage/IndexedDatabaseImpl.cpp b/WebCore/storage/IndexedDatabaseImpl.cpp
new file mode 100644
index 0000000..b82dee8
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseImpl.cpp
@@ -0,0 +1,61 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabaseImpl.h"
+
+#include "IDBDatabase.h"
+#include "IDBDatabaseError.h"
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabaseImpl> IndexedDatabaseImpl::create()
+{
+    return new IndexedDatabaseImpl();
+}
+
+IndexedDatabaseImpl::IndexedDatabaseImpl()
+{
+}
+
+IndexedDatabaseImpl::~IndexedDatabaseImpl()
+{
+}
+
+void IndexedDatabaseImpl::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks>, Frame*, ExceptionCode&)
+{
+    // FIXME: Write.
+    ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IndexedDatabaseImpl.h b/WebCore/storage/IndexedDatabaseImpl.h
new file mode 100644
index 0000000..5413b9b
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseImpl.h
@@ -0,0 +1,56 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabaseImpl_h
+#define IndexedDatabaseImpl_h
+
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IndexedDatabaseImpl : public IndexedDatabase {
+public:
+    static PassRefPtr<IndexedDatabaseImpl> create();
+    virtual ~IndexedDatabaseImpl();
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks<IDBDatabase> >, Frame*, ExceptionCode&);
+
+private:
+    IndexedDatabaseImpl();
+
+    // We only create one instance of this class at a time.
+    static IndexedDatabaseImpl* indexedDatabaseImpl;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabaseImpl_h
+
diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp
index 827493b..4430115 100644
--- a/WebCore/storage/IndexedDatabaseRequest.cpp
+++ b/WebCore/storage/IndexedDatabaseRequest.cpp
@@ -25,17 +25,21 @@
  * (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 "IndexedDatabaseRequest.h"
 
-#if ENABLE(INDEXED_DATABASE)
-
 #include "ExceptionCode.h"
-#include "IDBRequest.h"
+#include "IDBDatabase.h"
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
 
 namespace WebCore {
 
-IndexedDatabaseRequest::IndexedDatabaseRequest()
+IndexedDatabaseRequest::IndexedDatabaseRequest(IndexedDatabase* indexedDatabase, Frame* frame)
+    : m_indexedDatabase(indexedDatabase)
+    , m_frame(frame)
 {
 }
 
@@ -43,8 +47,9 @@
 {
 }
 
-void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception)
+void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks> callbacks, ExceptionCode& exception)
 {
+    m_indexedDatabase->open(name, description, modifyDatabase, callbacks, m_frame, exception);
 }
 
 } // namespace WebCore
diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
index 74aada3..83235b6 100644
--- a/WebCore/storage/IndexedDatabaseRequest.h
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -29,6 +29,7 @@
 #define IndexedDatabaseRequest_h
 
 #include "ExceptionCode.h"
+#include "IndexedDatabase.h"
 #include "PlatformString.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -38,23 +39,26 @@
 
 namespace WebCore {
 
-class IDBRequest;
+class IndexedDatabase;
+class Frame;
 
 class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
 public:
-    static PassRefPtr<IndexedDatabaseRequest> create()
+    static PassRefPtr<IndexedDatabaseRequest> create(IndexedDatabase* indexedDatabase, Frame* frame)
     {
-        return adoptRef(new IndexedDatabaseRequest());
+        return adoptRef(new IndexedDatabaseRequest(indexedDatabase, frame));
     }
     ~IndexedDatabaseRequest();
 
-    IDBRequest* request() const { return m_request.get(); }
-    void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&);
+    void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&);
+
+    void disconnectFrame() { m_frame = 0; }
 
 private:
-    IndexedDatabaseRequest();
+    IndexedDatabaseRequest(IndexedDatabase*, Frame*);
 
-    PassRefPtr<IDBRequest> m_request;
+    PassRefPtr<IndexedDatabase> m_indexedDatabase;
+    Frame* m_frame;
 };
 
 } // namespace WebCore
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
index b1fc7da..2c2a90e 100644
--- a/WebCore/storage/IndexedDatabaseRequest.idl
+++ b/WebCore/storage/IndexedDatabaseRequest.idl
@@ -30,8 +30,7 @@
     interface [
         Conditional=INDEXED_DATABASE
     ] IndexedDatabaseRequest {
-        readonly attribute IDBRequest request;
-        [Custom] void open(in DOMString name, in DOMString description, in optional boolean modifyDatabase)
+        [Custom] void open(in DOMString name, in DOMString description, in optional boolean modifyDatabase, IDBDatabaseErrorCallback onerror, IDBDatabaseRequestCallback onsuccess)
             raises(IDBDatabaseException);
     };
 
diff --git a/WebCore/storage/OriginQuotaManager.cpp b/WebCore/storage/OriginQuotaManager.cpp
index 30b3271..88f75b8 100644
--- a/WebCore/storage/OriginQuotaManager.cpp
+++ b/WebCore/storage/OriginQuotaManager.cpp
@@ -42,6 +42,18 @@
 {
 }
 
+bool OriginQuotaManager::tryLock()
+{
+    bool locked = m_usageRecordGuard.tryLock();
+#ifndef NDEBUG
+    if (locked)
+        m_usageRecordGuardLocked = true;
+    else
+        ASSERT(m_usageRecordGuardLocked);
+#endif
+    return locked;
+}
+
 void OriginQuotaManager::lock()
 {
     m_usageRecordGuard.lock();
@@ -63,7 +75,7 @@
     ASSERT(m_usageRecordGuardLocked);
     ASSERT(!m_usageMap.contains(origin.get()));
 
-    m_usageMap.set(origin, new OriginUsageRecord);
+    m_usageMap.set(origin->threadsafeCopy(), new OriginUsageRecord);
 }
 
 bool OriginQuotaManager::tracksOrigin(SecurityOrigin* origin) const
diff --git a/WebCore/storage/OriginQuotaManager.h b/WebCore/storage/OriginQuotaManager.h
index 2e3615d..33c201a 100644
--- a/WebCore/storage/OriginQuotaManager.h
+++ b/WebCore/storage/OriginQuotaManager.h
@@ -45,6 +45,7 @@
 public:
     OriginQuotaManager();
 
+    bool tryLock();
     void lock();
     void unlock();
 
diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp
index b4eb9ef..64f2634 100644
--- a/WebCore/storage/SQLStatement.cpp
+++ b/WebCore/storage/SQLStatement.cpp
@@ -172,9 +172,9 @@
     // because then we need to jump to the transaction error callback.
     if (m_error) {
         ASSERT(m_statementErrorCallback);
-        callbackError = m_statementErrorCallback->handleEvent(transaction, m_error.get());
+        callbackError = m_statementErrorCallback->handleEvent(transaction->database()->scriptExecutionContext(), transaction, m_error.get());
     } else if (m_statementCallback)
-        m_statementCallback->handleEvent(transaction, m_resultSet.get(), callbackError);
+        m_statementCallback->handleEvent(transaction->database()->scriptExecutionContext(), transaction, m_resultSet.get(), callbackError);
 
     // Now release our callbacks, to break reference cycles.
     m_statementCallback = 0;
diff --git a/WebCore/storage/SQLStatementCallback.h b/WebCore/storage/SQLStatementCallback.h
index 31f5c0c..ccb8fa7 100644
--- a/WebCore/storage/SQLStatementCallback.h
+++ b/WebCore/storage/SQLStatementCallback.h
@@ -34,13 +34,14 @@
 
 namespace WebCore {
 
+class ScriptExecutionContext;
 class SQLTransaction;
 class SQLResultSet;
 
 class SQLStatementCallback : public ThreadSafeShared<SQLStatementCallback> {
 public:
     virtual ~SQLStatementCallback() { }
-    virtual void handleEvent(SQLTransaction*, SQLResultSet*, bool& raisedException) = 0;
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLResultSet*, bool& raisedException) = 0;
 };
 
 }
diff --git a/WebCore/storage/SQLStatementErrorCallback.h b/WebCore/storage/SQLStatementErrorCallback.h
index 29127ce..8db98be 100644
--- a/WebCore/storage/SQLStatementErrorCallback.h
+++ b/WebCore/storage/SQLStatementErrorCallback.h
@@ -35,13 +35,14 @@
 
 namespace WebCore {
 
+class ScriptExecutionContext;
 class SQLTransaction;
 class SQLError;
 
 class SQLStatementErrorCallback : public ThreadSafeShared<SQLStatementErrorCallback> {
 public:
     virtual ~SQLStatementErrorCallback() { }
-    virtual bool handleEvent(SQLTransaction*, SQLError*) = 0;
+    virtual bool handleEvent(ScriptExecutionContext*, SQLTransaction*, SQLError*) = 0;
 };
 
 }
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index 754cebc..ea7deee 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -158,6 +158,10 @@
     m_statementQueue.clear();
     m_nextStep = 0;
 
+    // The next steps should be executed only if we're on the DB thread.
+    if (currentThread() != database()->scriptExecutionContext()->databaseThread()->getThreadID())
+        return;
+
     // The current SQLite transaction should be stopped, as well
     if (m_sqliteTransaction) {
         m_sqliteTransaction->stop();
@@ -286,7 +290,7 @@
 
     if (m_callback) {
         m_executeSqlAllowed = true;
-        m_callback->handleEvent(this, shouldDeliverErrorCallback);
+        m_callback->handleEvent(m_database->scriptExecutionContext(), this, shouldDeliverErrorCallback);
         m_executeSqlAllowed = false;
     } else
         shouldDeliverErrorCallback = true;
@@ -541,7 +545,7 @@
     // Transaction Step 12 - If exists, invoke error callback with the last
     // error to have occurred in this transaction.
     if (m_errorCallback)
-        m_errorCallback->handleEvent(m_transactionError.get());
+        m_errorCallback->handleEvent(m_database->scriptExecutionContext(), m_transactionError.get());
 
     m_nextStep = &SQLTransaction::cleanupAfterTransactionErrorCallback;
     LOG(StorageAPI, "Scheduling cleanupAfterTransactionErrorCallback for transaction %p\n", this);
diff --git a/WebCore/storage/SQLTransactionCallback.h b/WebCore/storage/SQLTransactionCallback.h
index de3e85dc..34b7613 100644
--- a/WebCore/storage/SQLTransactionCallback.h
+++ b/WebCore/storage/SQLTransactionCallback.h
@@ -35,13 +35,14 @@
 
 namespace WebCore {
 
+class ScriptExecutionContext;
 class SQLTransaction;
 class SQLError;
 
 class SQLTransactionCallback : public ThreadSafeShared<SQLTransactionCallback> {
 public:
     virtual ~SQLTransactionCallback() { }
-    virtual void handleEvent(SQLTransaction*, bool& raisedException) = 0;
+    virtual void handleEvent(ScriptExecutionContext*, SQLTransaction*, bool& raisedException) = 0;
 };
 
 }
diff --git a/WebCore/storage/SQLTransactionClient.cpp b/WebCore/storage/SQLTransactionClient.cpp
index 6064c99..32c8e07 100644
--- a/WebCore/storage/SQLTransactionClient.cpp
+++ b/WebCore/storage/SQLTransactionClient.cpp
@@ -39,7 +39,6 @@
 #include "DatabaseThread.h"
 #include "DatabaseTracker.h"
 #include "Document.h"
-#include "OriginQuotaManager.h"
 #include "Page.h"
 #include "SQLTransaction.h"
 
@@ -56,9 +55,7 @@
 void SQLTransactionClient::didExecuteStatement(SQLTransaction* transaction)
 {
     ASSERT(currentThread() == transaction->database()->scriptExecutionContext()->databaseThread()->getThreadID());
-    OriginQuotaManager& manager(DatabaseTracker::tracker().originQuotaManager());
-    Locker<OriginQuotaManager> locker(manager);
-    manager.markDatabase(transaction->database());
+    DatabaseTracker::tracker().databaseChanged(transaction->database());
 }
 
 bool SQLTransactionClient::didExceedQuota(SQLTransaction* transaction)
diff --git a/WebCore/storage/SQLTransactionCoordinator.cpp b/WebCore/storage/SQLTransactionCoordinator.cpp
index 0fe5bda..dbd2739 100644
--- a/WebCore/storage/SQLTransactionCoordinator.cpp
+++ b/WebCore/storage/SQLTransactionCoordinator.cpp
@@ -33,7 +33,6 @@
 
 #if ENABLE(DATABASE)
 
-#include "CString.h"
 #include "Database.h"
 #include "SQLTransaction.h"
 #include <wtf/Deque.h>
diff --git a/WebCore/storage/SQLTransactionCoordinator.h b/WebCore/storage/SQLTransactionCoordinator.h
index a51084f..247ad13 100644
--- a/WebCore/storage/SQLTransactionCoordinator.h
+++ b/WebCore/storage/SQLTransactionCoordinator.h
@@ -33,7 +33,6 @@
 
 #if ENABLE(DATABASE)
 
-#include "CString.h"
 #include "StringHash.h"
 #include <wtf/Deque.h>
 #include <wtf/HashMap.h>
diff --git a/WebCore/storage/SQLTransactionErrorCallback.h b/WebCore/storage/SQLTransactionErrorCallback.h
index de99212..6c0d13a 100644
--- a/WebCore/storage/SQLTransactionErrorCallback.h
+++ b/WebCore/storage/SQLTransactionErrorCallback.h
@@ -35,13 +35,14 @@
 
 namespace WebCore {
 
-    class SQLError;
+class ScriptExecutionContext;
+class SQLError;
 
-    class SQLTransactionErrorCallback : public ThreadSafeShared<SQLTransactionErrorCallback> {
-    public:
-        virtual ~SQLTransactionErrorCallback() { }
-        virtual void handleEvent(SQLError*) = 0;
-    };
+class SQLTransactionErrorCallback : public ThreadSafeShared<SQLTransactionErrorCallback> {
+public:
+    virtual ~SQLTransactionErrorCallback() { }
+    virtual void handleEvent(ScriptExecutionContext*, SQLError*) = 0;
+};
 
 }
 
diff --git a/WebCore/storage/StorageAreaSync.cpp b/WebCore/storage/StorageAreaSync.cpp
index d4eba76..4c385b7 100644
--- a/WebCore/storage/StorageAreaSync.cpp
+++ b/WebCore/storage/StorageAreaSync.cpp
@@ -28,7 +28,6 @@
 
 #if ENABLE(DOM_STORAGE)
 
-#include "CString.h"
 #include "EventNames.h"
 #include "HTMLElement.h"
 #include "SecurityOrigin.h"
@@ -36,6 +35,7 @@
 #include "StorageAreaImpl.h"
 #include "StorageSyncManager.h"
 #include "SuddenTermination.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -43,6 +43,10 @@
 // Instead, queue up a batch of items to sync and actually do the sync at the following interval.
 static const double StorageSyncInterval = 1.0;
 
+// A sane limit on how many items we'll schedule to sync all at once.  This makes it
+// much harder to starve the rest of LocalStorage and the OS's IO subsystem in general.
+static const int MaxiumItemsToSync = 100;
+
 PassRefPtr<StorageAreaSync> StorageAreaSync::create(PassRefPtr<StorageSyncManager> storageSyncManager, PassRefPtr<StorageAreaImpl> storageArea, String databaseIdentifier)
 {
     return adoptRef(new StorageAreaSync(storageSyncManager, storageArea, databaseIdentifier));
@@ -57,6 +61,7 @@
     , m_databaseIdentifier(databaseIdentifier.crossThreadString())
     , m_clearItemsWhileSyncing(false)
     , m_syncScheduled(false)
+    , m_syncInProgress(false)
     , m_importComplete(false)
 {
     ASSERT(isMainThread());
@@ -92,8 +97,8 @@
     }
     // FIXME: This is synchronous.  We should do it on the background process, but
     // we should do it safely.
-    syncTimerFired(&m_syncTimer);
     m_finalSyncScheduled = true;
+    syncTimerFired(&m_syncTimer);
 }
 
 void StorageAreaSync::scheduleItemForSync(const String& key, const String& value)
@@ -131,20 +136,43 @@
 {
     ASSERT(isMainThread());
 
-    HashMap<String, String>::iterator it = m_changedItems.begin();
-    HashMap<String, String>::iterator end = m_changedItems.end();
-
+    bool partialSync = false;
     {
         MutexLocker locker(m_syncLock);
 
+        // Do not schedule another sync if we're still trying to complete the
+        // previous one.  But, if we're shutting down, schedule it anyway.
+        if (m_syncInProgress && !m_finalSyncScheduled) {
+            ASSERT(!m_syncTimer.isActive());
+            m_syncTimer.startOneShot(StorageSyncInterval);
+            return;
+        }
+
         if (m_itemsCleared) {
             m_itemsPendingSync.clear();
             m_clearItemsWhileSyncing = true;
             m_itemsCleared = false;
         }
 
-        for (; it != end; ++it)
-            m_itemsPendingSync.set(it->first.crossThreadString(), it->second.crossThreadString());
+        HashMap<String, String>::iterator changed_it = m_changedItems.begin();
+        HashMap<String, String>::iterator changed_end = m_changedItems.end();
+        for (int count = 0; changed_it != changed_end; ++count, ++changed_it) {
+            if (count >= MaxiumItemsToSync && !m_finalSyncScheduled) {
+                partialSync = true;
+                break;
+            }
+            m_itemsPendingSync.set(changed_it->first.crossThreadString(), changed_it->second.crossThreadString());
+        }
+
+        if (partialSync) {
+            // We can't do the fast path of simply clearing all items, so we'll need to manually
+            // remove them one by one.  Done under lock since m_itemsPendingSync is modified by
+            // the background thread.
+            HashMap<String, String>::iterator pending_it = m_itemsPendingSync.begin();
+            HashMap<String, String>::iterator pending_end = m_itemsPendingSync.end();
+            for (; pending_it != pending_end; ++pending_it)
+                m_changedItems.remove(pending_it->first);
+        }
 
         if (!m_syncScheduled) {
             m_syncScheduled = true;
@@ -157,11 +185,17 @@
         }
     }
 
-    // The following is balanced by the calls to disableSuddenTermination in the
-    // scheduleItemForSync, scheduleClear, and scheduleFinalSync functions.
-    enableSuddenTermination();
+    if (partialSync) {
+        // If we didn't finish syncing, then we need to finish the job later.
+        ASSERT(!m_syncTimer.isActive());
+        m_syncTimer.startOneShot(StorageSyncInterval);
+    } else {
+        // The following is balanced by the calls to disableSuddenTermination in the
+        // scheduleItemForSync, scheduleClear, and scheduleFinalSync functions.
+        enableSuddenTermination();
 
-    m_changedItems.clear();
+        m_changedItems.clear();
+    }
 }
 
 void StorageAreaSync::performImport()
@@ -319,10 +353,16 @@
 
         m_clearItemsWhileSyncing = false;
         m_syncScheduled = false;
+        m_syncInProgress = true;
     }
 
     sync(clearItems, items);
 
+    {
+        MutexLocker locker(m_syncLock);
+        m_syncInProgress = false;
+    }
+
     // The following is balanced by the call to disableSuddenTermination in the
     // syncTimerFired function.
     enableSuddenTermination();
diff --git a/WebCore/storage/StorageAreaSync.h b/WebCore/storage/StorageAreaSync.h
index 9afdfde..0e46763 100644
--- a/WebCore/storage/StorageAreaSync.h
+++ b/WebCore/storage/StorageAreaSync.h
@@ -84,6 +84,7 @@
         HashMap<String, String> m_itemsPendingSync;
         bool m_clearItemsWhileSyncing;
         bool m_syncScheduled;
+        bool m_syncInProgress;
 
         mutable Mutex m_importLock;
         mutable ThreadCondition m_importCondition;
diff --git a/WebCore/storage/StorageEvent.cpp b/WebCore/storage/StorageEvent.cpp
index 126aca0..f2b1339 100644
--- a/WebCore/storage/StorageEvent.cpp
+++ b/WebCore/storage/StorageEvent.cpp
@@ -41,6 +41,10 @@
 {
 }
 
+StorageEvent::~StorageEvent()
+{
+}
+
 PassRefPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& uri, Storage* storageArea)
 {
     return adoptRef(new StorageEvent(type, key, oldValue, newValue, uri, storageArea));
diff --git a/WebCore/storage/StorageEvent.h b/WebCore/storage/StorageEvent.h
index fa7535b..918515a 100644
--- a/WebCore/storage/StorageEvent.h
+++ b/WebCore/storage/StorageEvent.h
@@ -39,6 +39,7 @@
     public:
         static PassRefPtr<StorageEvent> create();
         static PassRefPtr<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& uri, Storage* storageArea);
+        virtual ~StorageEvent();
 
         const String& key() const { return m_key; }
         const String& oldValue() const { return m_oldValue; }
diff --git a/WebCore/storage/StorageEventDispatcher.cpp b/WebCore/storage/StorageEventDispatcher.cpp
index dc0295b..2118a83 100644
--- a/WebCore/storage/StorageEventDispatcher.cpp
+++ b/WebCore/storage/StorageEventDispatcher.cpp
@@ -55,7 +55,7 @@
         }
 
         for (unsigned i = 0; i < frames.size(); ++i)
-            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
+            frames[i]->document()->enqueueEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
     } else {
         // Send events to every page.
         const HashSet<Page*>& pages = page->group().pages();
@@ -67,8 +67,12 @@
             }
         }
 
-        for (unsigned i = 0; i < frames.size(); ++i)
-            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
+        for (unsigned i = 0; i < frames.size(); ++i) {
+            ExceptionCode ec = 0;
+            Storage* storage = frames[i]->domWindow()->localStorage(ec);
+            if (!ec)
+                frames[i]->document()->enqueueEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
+        }
     }
 }
 
diff --git a/WebCore/storage/StorageNamespace.cpp b/WebCore/storage/StorageNamespace.cpp
index b54ba16..ce36608 100644
--- a/WebCore/storage/StorageNamespace.cpp
+++ b/WebCore/storage/StorageNamespace.cpp
@@ -42,9 +42,9 @@
 }
 
 // The page argument is only used by the Chromium port.
-PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page*)
+PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page*, unsigned quota)
 {
-    return StorageNamespaceImpl::sessionStorageNamespace();
+    return StorageNamespaceImpl::sessionStorageNamespace(quota);
 }
 
 } // namespace WebCore
diff --git a/WebCore/storage/StorageNamespace.h b/WebCore/storage/StorageNamespace.h
index e84e5a6..8f09b1a 100644
--- a/WebCore/storage/StorageNamespace.h
+++ b/WebCore/storage/StorageNamespace.h
@@ -43,7 +43,7 @@
 class StorageNamespace : public RefCounted<StorageNamespace> {
 public:
     static PassRefPtr<StorageNamespace> localStorageNamespace(const String& path, unsigned quota);
-    static PassRefPtr<StorageNamespace> sessionStorageNamespace(Page*);
+    static PassRefPtr<StorageNamespace> sessionStorageNamespace(Page*, unsigned quota);
 
     virtual ~StorageNamespace() { }
     virtual PassRefPtr<StorageArea> storageArea(PassRefPtr<SecurityOrigin>) = 0;
diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp
index 19ff6b4..b505d1d 100644
--- a/WebCore/storage/StorageNamespaceImpl.cpp
+++ b/WebCore/storage/StorageNamespaceImpl.cpp
@@ -58,9 +58,9 @@
     return it->second;
 }
 
-PassRefPtr<StorageNamespace> StorageNamespaceImpl::sessionStorageNamespace()
+PassRefPtr<StorageNamespace> StorageNamespaceImpl::sessionStorageNamespace(unsigned quota)
 {
-    return adoptRef(new StorageNamespaceImpl(SessionStorage, String(), StorageMap::noQuota));
+    return adoptRef(new StorageNamespaceImpl(SessionStorage, String(), quota));
 }
 
 StorageNamespaceImpl::StorageNamespaceImpl(StorageType storageType, const String& path, unsigned quota)
@@ -119,7 +119,9 @@
 void StorageNamespaceImpl::close()
 {
     ASSERT(isMainThread());
-    ASSERT(!m_isShutdown);
+
+    if (m_isShutdown)
+        return;
 
     // If we're session storage, we shouldn't need to do any work here.
     if (m_storageType == SessionStorage) {
diff --git a/WebCore/storage/StorageNamespaceImpl.h b/WebCore/storage/StorageNamespaceImpl.h
index b81b55a..5221add 100644
--- a/WebCore/storage/StorageNamespaceImpl.h
+++ b/WebCore/storage/StorageNamespaceImpl.h
@@ -43,7 +43,7 @@
     class StorageNamespaceImpl : public StorageNamespace {
     public:
         static PassRefPtr<StorageNamespace> localStorageNamespace(const String& path, unsigned quota);
-        static PassRefPtr<StorageNamespace> sessionStorageNamespace();
+        static PassRefPtr<StorageNamespace> sessionStorageNamespace(unsigned quota);
 
         virtual ~StorageNamespaceImpl();
         virtual PassRefPtr<StorageArea> storageArea(PassRefPtr<SecurityOrigin>);
diff --git a/WebCore/storage/StorageSyncManager.cpp b/WebCore/storage/StorageSyncManager.cpp
index d9641b7..ebf35bd 100644
--- a/WebCore/storage/StorageSyncManager.cpp
+++ b/WebCore/storage/StorageSyncManager.cpp
@@ -28,7 +28,6 @@
 
 #if ENABLE(DOM_STORAGE)
 
-#include "CString.h"
 #include "EventNames.h"
 #include "FileSystem.h"
 #include "Frame.h"
@@ -38,6 +37,7 @@
 #include "Page.h"
 #include "PageGroup.h"
 #include "StorageAreaSync.h"
+#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
diff --git a/WebCore/storage/chromium/DatabaseObserver.h b/WebCore/storage/chromium/DatabaseObserver.h
index 535c0d2..4e266c1 100644
--- a/WebCore/storage/chromium/DatabaseObserver.h
+++ b/WebCore/storage/chromium/DatabaseObserver.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -34,11 +34,14 @@
 namespace WebCore {
 
 class Database;
+class ScriptExecutionContext;
+class String;
 
 // The implementation of this class is in the WebKit API (Chromium source tree)
-// in webkit/api/src/DatabaseObserver.cpp.
+// in WebKit/chromium/src/DatabaseObserver.cpp.
 class DatabaseObserver {
 public:
+    static bool canEstablishDatabase(ScriptExecutionContext*, const String&, const String&, unsigned long);
     static void databaseOpened(Database*);
     static void databaseModified(Database*);
     static void databaseClosed(Database*);
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index ac58e07..7db981d 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "DatabaseTracker.h"
 
-#include "CString.h"
 #include "Database.h"
 #include "DatabaseObserver.h"
 #include "DatabaseThread.h"
@@ -43,6 +42,7 @@
 #include <wtf/HashSet.h>
 #include <wtf/MainThread.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -57,11 +57,9 @@
     SQLiteFileSystem::registerSQLiteVFS();
 }
 
-bool DatabaseTracker::canEstablishDatabase(ScriptExecutionContext*, const String&, const String&, unsigned long)
+bool DatabaseTracker::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize)
 {
-    // In Chromium, a database can always be established (even though we might not
-    // be able to write anything to it if the quota for this origin was exceeded)
-    return true;
+    return DatabaseObserver::canEstablishDatabase(scriptExecutionContext, name, displayName, estimatedSize);
 }
 
 void DatabaseTracker::setDatabaseDetails(SecurityOrigin*, const String&, const String&, unsigned long)
diff --git a/WebCore/storage/chromium/IndexedDatabase.cpp b/WebCore/storage/chromium/IndexedDatabase.cpp
new file mode 100644
index 0000000..6f53f92
--- /dev/null
+++ b/WebCore/storage/chromium/IndexedDatabase.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabase.h"
+
+#include "ChromiumBridge.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabase::create()
+{
+    return ChromiumBridge::indexedDatabase();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/chromium/QuotaTracker.cpp b/WebCore/storage/chromium/QuotaTracker.cpp
index b49639d..9e64942 100644
--- a/WebCore/storage/chromium/QuotaTracker.cpp
+++ b/WebCore/storage/chromium/QuotaTracker.cpp
@@ -31,8 +31,8 @@
 #include "config.h"
 #include "QuotaTracker.h"
 
-#include "CString.h"
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/storage/chromium/QuotaTracker.h b/WebCore/storage/chromium/QuotaTracker.h
index 9146910..41c27fe 100644
--- a/WebCore/storage/chromium/QuotaTracker.h
+++ b/WebCore/storage/chromium/QuotaTracker.h
@@ -31,10 +31,10 @@
 #ifndef QuotaTracker_h
 #define QuotaTracker_h
 
-#include "CString.h"
 #include "SecurityOrigin.h"
 #include "StringHash.h"
 #include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp
index 31d681b..d431583 100644
--- a/WebCore/svg/SVGAnimateElement.cpp
+++ b/WebCore/svg/SVGAnimateElement.cpp
@@ -28,6 +28,7 @@
 #include "SVGColor.h"
 #include "SVGParserUtilities.h"
 #include "SVGPathSegList.h"
+#include "SVGPointList.h"
 #include <math.h>
 
 using namespace std;
@@ -80,6 +81,8 @@
         return ColorProperty;
     if (attribute == "d")
         return PathProperty;
+    if (attribute == "points")
+        return PointsProperty;
     if (attribute == "color" || attribute == "fill" || attribute == "stroke")
         return ColorProperty;
     return NumberProperty;
@@ -142,6 +145,22 @@
                     ? m_toPath : m_fromPath;
         }
         return;
+    } else if (m_propertyType == PointsProperty) {
+        if (percentage == 0)
+            results->m_animatedPoints = m_fromPoints;
+        else if (percentage == 1.f)
+            results->m_animatedPoints = m_toPoints;
+        else {
+            if (m_fromPoints && m_toPoints)
+                results->m_animatedPoints = SVGPointList::createAnimated(m_fromPoints.get(), m_toPoints.get(), percentage);
+            else
+                results->m_animatedPoints.clear();
+            // Fall back to discrete animation if the points are not compatible
+            if (!results->m_animatedPoints)
+                results->m_animatedPoints = ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f) 
+                    ? m_toPoints : m_fromPoints;
+        }
+        return;
     }
     ASSERT(animationMode == FromToAnimation || animationMode == ToAnimation || animationMode == ValuesAnimation);
     if ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f)
@@ -159,7 +178,7 @@
     if (m_propertyType == ColorProperty) {
         m_fromColor = SVGColor::colorFromRGBColorString(fromString);
         m_toColor = SVGColor::colorFromRGBColorString(toString);
-        if (m_fromColor.isValid() && m_toColor.isValid())
+        if (m_fromColor.isValid() && m_toColor.isValid() || m_toColor.isValid() && animationMode() == ToAnimation)
             return true;
     } else if (m_propertyType == NumberProperty) {
         m_numberUnit = String();
@@ -177,6 +196,15 @@
         }
         m_fromPath.clear();
         m_toPath.clear();
+    } else if (m_propertyType == PointsProperty) {
+        m_fromPoints = SVGPointList::create(SVGNames::pointsAttr);
+        if (pointsListFromSVGData(m_fromPoints.get(), fromString)) {
+            m_toPoints = SVGPointList::create(SVGNames::pointsAttr);
+            if (pointsListFromSVGData(m_toPoints.get(), toString))
+                return true;
+        }
+        m_fromPoints.clear();
+        m_toPoints.clear();
     }
     m_fromString = fromString;
     m_toString = toString;
@@ -208,11 +236,14 @@
 void SVGAnimateElement::resetToBaseValue(const String& baseString)
 {
     m_animatedString = baseString;
+    PropertyType lastType = m_propertyType;
     m_propertyType = determinePropertyType(attributeName());
     if (m_propertyType == ColorProperty) {
         m_animatedColor = baseString.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(baseString);
-        if (m_animatedColor.isValid())
+        if (isContributing(elapsed())) {
+            m_propertyType = lastType;
             return;
+        }
     } else if (m_propertyType == NumberProperty) {
         if (baseString.isEmpty()) {
             m_animatedNumber = 0;
@@ -224,6 +255,9 @@
     } else if (m_propertyType == PathProperty) {
         m_animatedPath.clear();
         return;
+    } else if (m_propertyType == PointsProperty) {
+        m_animatedPoints.clear();
+        return;
     }
     m_propertyType = StringProperty;
 }
@@ -250,6 +284,11 @@
                 valueToApply.append(segment->toString() + " ");
             }
         }
+    } else if (m_propertyType == PointsProperty) {
+        if (!m_animatedPoints || !m_animatedPoints->numberOfItems())
+            valueToApply = m_animatedString;
+        else
+            valueToApply = m_animatedPoints->valueAsString();
     } else
         valueToApply = m_animatedString;
     
diff --git a/WebCore/svg/SVGAnimateElement.h b/WebCore/svg/SVGAnimateElement.h
index ac5883c..f6e0b1d 100644
--- a/WebCore/svg/SVGAnimateElement.h
+++ b/WebCore/svg/SVGAnimateElement.h
@@ -29,6 +29,7 @@
 
 namespace WebCore {
     class SVGPathSegList;
+    class SVGPointList;
 
     class SVGAnimateElement : public SVGAnimationElement {
     public:
@@ -44,7 +45,7 @@
         virtual float calculateDistance(const String& fromString, const String& toString);
 
     private:
-        enum PropertyType { NumberProperty, ColorProperty, StringProperty, PathProperty };
+        enum PropertyType { NumberProperty, ColorProperty, StringProperty, PathProperty, PointsProperty };
         PropertyType determinePropertyType(const String& attribute) const;
         PropertyType m_propertyType;
         
@@ -61,6 +62,9 @@
         RefPtr<SVGPathSegList> m_fromPath;
         RefPtr<SVGPathSegList> m_toPath;
         RefPtr<SVGPathSegList> m_animatedPath;
+        RefPtr<SVGPointList> m_fromPoints;
+        RefPtr<SVGPointList> m_toPoints;
+        RefPtr<SVGPointList> m_animatedPoints;
     };
 
 } // namespace WebCore
diff --git a/WebCore/svg/SVGAnimateMotionElement.cpp b/WebCore/svg/SVGAnimateMotionElement.cpp
index 9355436..868a48d 100644
--- a/WebCore/svg/SVGAnimateMotionElement.cpp
+++ b/WebCore/svg/SVGAnimateMotionElement.cpp
@@ -179,7 +179,10 @@
     AffineTransform* transform = target->supplementalTransform();
     if (!transform)
         return;
-    
+
+    if (target->renderer())
+        target->renderer()->setNeedsTransformUpdate();
+
     if (!isAdditive())
         transform->makeIdentity();
     
@@ -223,8 +226,10 @@
         AffineTransform* transform = shadowTreeElement->supplementalTransform();
         AffineTransform* t = targetElement->supplementalTransform();
         transform->setMatrix(t->a(), t->b(), t->c(), t->d(), t->e(), t->f());
-        if (shadowTreeElement->renderer())
-            shadowTreeElement->renderer()->setNeedsLayout(true);
+        if (RenderObject* renderer = shadowTreeElement->renderer()) {
+            renderer->setNeedsTransformUpdate();
+            renderer->setNeedsLayout(true);
+        }
     }
 }
 
diff --git a/WebCore/svg/SVGAnimateTransformElement.cpp b/WebCore/svg/SVGAnimateTransformElement.cpp
index 8e077a4..96485a6 100644
--- a/WebCore/svg/SVGAnimateTransformElement.cpp
+++ b/WebCore/svg/SVGAnimateTransformElement.cpp
@@ -159,9 +159,11 @@
         return;
     // We accumulate to the target element transform list so there is not much to do here.
     SVGElement* targetElement = this->targetElement();
-    if (targetElement->renderer())
-        targetElement->renderer()->setNeedsLayout(true);
-    
+    if (RenderObject* renderer = targetElement->renderer()) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+    }
+
     // ...except in case where we have additional instances in <use> trees.
     const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
     RefPtr<SVGTransformList> transformList = transformListFor(targetElement);
@@ -173,8 +175,10 @@
             static_cast<SVGStyledTransformableElement*>(shadowTreeElement)->setTransformBaseValue(transformList.get());
         else if (shadowTreeElement->hasTagName(SVGNames::textTag))
             static_cast<SVGTextElement*>(shadowTreeElement)->setTransformBaseValue(transformList.get());
-        if (shadowTreeElement->renderer())
-            shadowTreeElement->renderer()->setNeedsLayout(true);
+        if (RenderObject* renderer = shadowTreeElement->renderer()) {
+            renderer->setNeedsTransformUpdate();
+            renderer->setNeedsLayout(true);
+        }
     }
 }
     
diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp
index 39abbfc..4b4d5bb 100644
--- a/WebCore/svg/SVGAnimationElement.cpp
+++ b/WebCore/svg/SVGAnimationElement.cpp
@@ -4,6 +4,7 @@
     Copyright (C) 2007 Eric Seidel <eric@webkit.org>
     Copyright (C) 2008 Apple Inc. All rights reserved.
     Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -26,6 +27,7 @@
 #if ENABLE(SVG_ANIMATION)
 #include "SVGAnimationElement.h"
 
+#include "Color.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSParser.h"
 #include "CSSPropertyNames.h"
@@ -35,8 +37,11 @@
 #include "FloatConversion.h"
 #include "HTMLNames.h"
 #include "MappedAttribute.h"
+#include "PlatformString.h"
+#include "RenderObject.h"
 #include "SVGElementInstance.h"
 #include "SVGNames.h"
+#include "SVGParserUtilities.h"
 #include "SVGURIReference.h"
 #include "SVGUseElement.h"
 #include "XLinkNames.h"
@@ -87,29 +92,52 @@
 static void parseKeySplines(const String& parse, Vector<UnitBezier>& result)
 {
     result.clear();
-    Vector<String> parseList;
-    parse.split(';', parseList);
-    for (unsigned n = 0; n < parseList.size(); ++n) {
-        Vector<String> parseSpline;
-        parseList[n].split(',', parseSpline);
-        // The spec says the sepator is a space, all tests use commas. Weird.
-        if (parseSpline.size() == 1) 
-            parseList[n].split(' ', parseSpline);
-        if (parseSpline.size() != 4)
-            goto fail;
-        double curveValues[4];
-        for (unsigned i = 0; i < 4; ++i) {
-            String parseNumber = parseSpline[i]; 
-            bool ok;
-            curveValues[i] = parseNumber.toDouble(&ok);
-            if (!ok || curveValues[i] < 0.0 || curveValues[i] > 1.0)
-                goto fail;
+    if (parse.isEmpty())
+        return;
+    const UChar* cur = parse.characters();
+    const UChar* end = cur + parse.length();
+
+    skipOptionalSpaces(cur, end);
+
+    bool delimParsed = false;
+    while (cur < end) {
+        delimParsed = false;
+        float posA = 0.0f;
+        if (!parseNumber(cur, end, posA)) {
+            result.clear();
+            return;
         }
-        result.append(UnitBezier(curveValues[0], curveValues[1], curveValues[2], curveValues[3]));
+
+        float posB = 0.0f;
+        if (!parseNumber(cur, end, posB)) {
+            result.clear();
+            return;
+        }
+
+        float posC = 0.0f;
+        if (!parseNumber(cur, end, posC)) {
+            result.clear();
+            return;
+        }
+
+        float posD = 0.0f;
+        if (!parseNumber(cur, end, posD, false)) {
+            result.clear();
+            return;
+        }
+
+        skipOptionalSpaces(cur, end);
+
+        if (cur < end && *cur == ';') {
+            delimParsed = true;
+            cur++;
+        }
+        skipOptionalSpaces(cur, end);
+
+        result.append(UnitBezier(posA, posB, posC, posD));
     }
-    return;
-fail:
-    result.clear();
+    if (!(cur == end && !delimParsed))
+        result.clear();
 }
 
 void SVGAnimationElement::parseMappedAttribute(MappedAttribute* attr)
@@ -468,6 +496,14 @@
         effectivePercent = calculatePercentForSpline(effectivePercent, index);
     }
 }
+static inline void adjustForCurrentColor(String& value, SVGElement* target)
+{
+    if (!target || !target->isStyled() || value != "currentColor")
+        return;
+
+    if (RenderObject* targetRenderer = target->renderer())
+        value = targetRenderer->style()->color().name();
+}
     
 void SVGAnimationElement::startedActiveInterval()
 {
@@ -476,21 +512,41 @@
     if (!hasValidTarget())
         return;
 
+    // These validations are appropriate for all animation modes.
+    if (hasAttribute(SVGNames::keyPointsAttr) && m_keyPoints.size() != m_keyTimes.size())
+        return;
+
+    CalcMode calcMode = this->calcMode();
+    if (calcMode == CalcModeSpline) {
+        unsigned num = m_keySplines.size() + 1;
+        if ((hasAttribute(SVGNames::keyPointsAttr) && m_keyPoints.size() != num) || m_values.size() != num)
+            return;
+    }
+
+    String from = fromValue();
+    String to = toValue();
+    String by = byValue();
+    SVGElement* target = targetElement();
     AnimationMode animationMode = this->animationMode();
     if (animationMode == NoAnimation)
         return;
-    if (animationMode == FromToAnimation)
-        m_animationValid = calculateFromAndToValues(fromValue(), toValue());
-    else if (animationMode == ToAnimation) {
+    if (animationMode == FromToAnimation) {
+        adjustForCurrentColor(from, target);
+        adjustForCurrentColor(to, target);
+        m_animationValid = calculateFromAndToValues(from, to);
+    } else if (animationMode == ToAnimation) {
         // For to-animations the from value is the current accumulated value from lower priority animations.
         // The value is not static and is determined during the animation.
-        m_animationValid = calculateFromAndToValues(String(), toValue());
-    } else if (animationMode == FromByAnimation)
-        m_animationValid = calculateFromAndByValues(fromValue(), byValue());
-    else if (animationMode == ByAnimation)
-        m_animationValid = calculateFromAndByValues(String(), byValue());
-    else if (animationMode == ValuesAnimation) {
-        CalcMode calcMode = this->calcMode();
+        adjustForCurrentColor(to, target);
+        m_animationValid = calculateFromAndToValues(String(), to);
+    } else if (animationMode == FromByAnimation) {
+        adjustForCurrentColor(from, target);
+        adjustForCurrentColor(by, target);
+        m_animationValid = calculateFromAndByValues(from, by);
+    } else if (animationMode == ByAnimation) {
+        adjustForCurrentColor(by, target);
+        m_animationValid = calculateFromAndByValues(String(), by);
+    } else if (animationMode == ValuesAnimation) {
         m_animationValid = m_values.size() > 1
             && (calcMode == CalcModePaced || !hasAttribute(SVGNames::keyTimesAttr) || hasAttribute(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size()))
             && (calcMode == CalcModeDiscrete || !m_keyTimes.size() || m_keyTimes.last() == 1.0)
@@ -499,7 +555,7 @@
         if (calcMode == CalcModePaced && m_animationValid)
             calculateKeyTimesForCalcModePaced();
     } else if (animationMode == PathAnimation)
-        m_animationValid = calcMode() == CalcModePaced || !hasAttribute(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
+        m_animationValid = calcMode == CalcModePaced || !hasAttribute(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
 }
     
 void SVGAnimationElement::updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement)
diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp
index 10da742..12ccf69 100644
--- a/WebCore/svg/SVGCircleElement.cpp
+++ b/WebCore/svg/SVGCircleElement.cpp
@@ -71,16 +71,28 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr ||
-        attrName == SVGNames::rAttr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::cxAttr
+        || attrName == SVGNames::cyAttr
+        || attrName == SVGNames::rAttr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGClipPathElement.cpp b/WebCore/svg/SVGClipPathElement.cpp
index 0fa12ff..694e0bc 100644
--- a/WebCore/svg/SVGClipPathElement.cpp
+++ b/WebCore/svg/SVGClipPathElement.cpp
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -26,7 +27,7 @@
 #include "CSSStyleSelector.h"
 #include "Document.h"
 #include "MappedAttribute.h"
-#include "RenderSVGHiddenContainer.h"
+#include "RenderSVGResourceClipper.h"
 #include "SVGNames.h"
 #include "SVGTransformList.h"
 #include "SVGUnitTypes.h"
@@ -68,15 +69,12 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!m_clipper)
-        return;
-
     if (attrName == SVGNames::clipPathUnitsAttr ||
         SVGTests::isKnownAttribute(attrName) || 
         SVGLangSpace::isKnownAttribute(attrName) ||
         SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
         SVGStyledTransformableElement::isKnownAttribute(attrName))
-        m_clipper->invalidate();
+        invalidateCanvasResources();
 }
 
 void SVGClipPathElement::synchronizeProperty(const QualifiedName& attrName)
@@ -98,45 +96,12 @@
 void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
-
-    if (!m_clipper)
-        return;
-
-    m_clipper->invalidate();
+    invalidateCanvasResources();
 }
 
 RenderObject* SVGClipPathElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    return new (arena) RenderSVGHiddenContainer(this);
-}
-
-SVGResource* SVGClipPathElement::canvasResource(const RenderObject*)
-{
-    if (!m_clipper)
-        m_clipper = SVGResourceClipper::create();
-    else
-        m_clipper->resetClipData();
-
-    bool bbox = clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
-
-    for (Node* node = firstChild(); node; node = node->nextSibling()) {
-        if (!node->isSVGElement() || !static_cast<SVGElement*>(node)->isStyledTransformable())
-            continue;
-        SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(node);
-        RenderStyle* style = styled->renderer() ? styled->renderer()->style() : 0;
-        if (!style || style->display() == NONE)
-            continue;
-        Path pathData = styled->toClipPath();
-        if (pathData.isEmpty())
-            continue;
-        m_clipper->addClipData(pathData, style->svgStyle()->clipRule(), bbox);
-    }
-    if (m_clipper->clipData().isEmpty()) {
-        Path pathData;
-        pathData.addRect(FloatRect());
-        m_clipper->addClipData(pathData, RULE_EVENODD, bbox);
-    }
-    return m_clipper.get();
+    return new (arena) RenderSVGResourceClipper(this);
 }
 
 }
diff --git a/WebCore/svg/SVGClipPathElement.h b/WebCore/svg/SVGClipPathElement.h
index cf7ff2b..dbf5380 100644
--- a/WebCore/svg/SVGClipPathElement.h
+++ b/WebCore/svg/SVGClipPathElement.h
@@ -25,40 +25,35 @@
 #include "RenderObject.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGLangSpace.h"
-#include "SVGResourceClipper.h"
 #include "SVGStyledTransformableElement.h"
 #include "SVGTests.h"
 
 namespace WebCore {
+class SVGClipPathElement : public SVGStyledTransformableElement,
+                           public SVGTests,
+                           public SVGLangSpace,
+                           public SVGExternalResourcesRequired {
+public:
+    SVGClipPathElement(const QualifiedName&, Document*);
+    virtual ~SVGClipPathElement();
 
-    class SVGClipPathElement : public SVGStyledTransformableElement,
-                               public SVGTests,
-                               public SVGLangSpace,
-                               public SVGExternalResourcesRequired {
-    public:
-        SVGClipPathElement(const QualifiedName&, Document*);
-        virtual ~SVGClipPathElement();
+    virtual bool isValid() const { return SVGTests::isValid(); }
 
-        virtual bool isValid() const { return SVGTests::isValid(); }
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void svgAttributeChanged(const QualifiedName&);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void svgAttributeChanged(const QualifiedName&);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
-        virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource(const RenderObject*);
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
+    // SVGExternalResourcesRequired
+    DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+};
 
-        // SVGExternalResourcesRequired
-        DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+}
 
-        RefPtr<SVGResourceClipper> m_clipper;
-    };
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG)
+#endif
 #endif
diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp
index b2492b4..ef2e40c 100644
--- a/WebCore/svg/SVGDocumentExtensions.cpp
+++ b/WebCore/svg/SVGDocumentExtensions.cpp
@@ -62,6 +62,34 @@
     m_timeContainers.remove(element);
 }
 
+void SVGDocumentExtensions::addResource(const String& id, RenderSVGResource* resource)
+{
+    ASSERT(resource);
+
+    if (id.isEmpty())
+        return;
+
+    // Replaces resource if already present, to handle potential id changes
+    m_resources.set(id, resource);
+}
+
+void SVGDocumentExtensions::removeResource(const String& id)
+{
+    if (id.isEmpty())
+        return;
+
+    ASSERT(m_resources.contains(id));
+    m_resources.remove(id);
+}
+
+RenderSVGResource* SVGDocumentExtensions::resourceById(const String& id) const
+{
+    if (id.isEmpty())
+        return 0;
+
+    return m_resources.get(id);
+}
+
 void SVGDocumentExtensions::startAnimations()
 {
     // FIXME: Eventually every "Time Container" will need a way to latch on to some global timer
@@ -135,13 +163,13 @@
     return m_pendingResources.contains(id);
 }
 
-std::auto_ptr<HashSet<SVGStyledElement*> > SVGDocumentExtensions::removePendingResource(const AtomicString& id)
+PassOwnPtr<HashSet<SVGStyledElement*> > SVGDocumentExtensions::removePendingResource(const AtomicString& id)
 {
     ASSERT(m_pendingResources.contains(id));
 
-    std::auto_ptr<HashSet<SVGStyledElement*> > set(m_pendingResources.get(id));
+    OwnPtr<HashSet<SVGStyledElement*> > set(m_pendingResources.get(id));
     m_pendingResources.remove(id);
-    return set;
+    return set.release();
 }
 
 }
diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h
index 050e6f6..f5de647 100644
--- a/WebCore/svg/SVGDocumentExtensions.h
+++ b/WebCore/svg/SVGDocumentExtensions.h
@@ -24,8 +24,8 @@
 #define SVGDocumentExtensions_h
 
 #if ENABLE(SVG)
-#include <memory>
 
+#include <wtf/PassOwnPtr.h>
 #include <wtf/HashSet.h>
 #include <wtf/HashMap.h>
 
@@ -35,6 +35,7 @@
 namespace WebCore {
 
 class Document;
+class RenderSVGResource;
 class String;
 class SVGStyledElement;
 class SVGSMILElement;
@@ -47,7 +48,11 @@
     
     void addTimeContainer(SVGSVGElement*);
     void removeTimeContainer(SVGSVGElement*);
-    
+
+    void addResource(const String& id, RenderSVGResource*);
+    void removeResource(const String& id);
+    RenderSVGResource* resourceById(const String& id) const;
+
     void startAnimations();
     void pauseAnimations();
     void unpauseAnimations();
@@ -59,6 +64,7 @@
 private:
     Document* m_doc; // weak reference
     HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general.
+    HashMap<String, RenderSVGResource*> m_resources;
     HashMap<String, HashSet<SVGStyledElement*>*> m_pendingResources;
 
     SVGDocumentExtensions(const SVGDocumentExtensions&);
@@ -70,7 +76,7 @@
     // For instance, dynamically build gradients / patterns / clippers...
     void addPendingResource(const AtomicString& id, SVGStyledElement*);
     bool isPendingResource(const AtomicString& id) const;
-    std::auto_ptr<HashSet<SVGStyledElement*> > removePendingResource(const AtomicString& id);
+    PassOwnPtr<HashSet<SVGStyledElement*> > removePendingResource(const AtomicString& id);
 };
 
 }
diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp
index 19c5f3b..41bbba4 100644
--- a/WebCore/svg/SVGElement.cpp
+++ b/WebCore/svg/SVGElement.cpp
@@ -208,9 +208,9 @@
     else if (attr->name() == onmouseupAttr)
         setAttributeEventListener(eventNames().mouseupEvent, createAttributeEventListener(this, attr));
     else if (attr->name() == SVGNames::onfocusinAttr)
-        setAttributeEventListener(eventNames().DOMFocusInEvent, createAttributeEventListener(this, attr));
+        setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, attr));
     else if (attr->name() == SVGNames::onfocusoutAttr)
-        setAttributeEventListener(eventNames().DOMFocusOutEvent, createAttributeEventListener(this, attr));
+        setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, attr));
     else if (attr->name() == SVGNames::onactivateAttr)
         setAttributeEventListener(eventNames().DOMActivateEvent, createAttributeEventListener(this, attr));
     else
@@ -283,7 +283,7 @@
 
     String resourceId = SVGURIReference::getTarget(getAttribute(idAttributeName()));
     if (extensions->isPendingResource(resourceId)) {
-        std::auto_ptr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(resourceId));
+        OwnPtr<HashSet<SVGStyledElement*> > clients(extensions->removePendingResource(resourceId));
         if (clients->isEmpty())
             return;
 
diff --git a/WebCore/svg/SVGElementInstance.idl b/WebCore/svg/SVGElementInstance.idl
index cd4213c..d23fea2 100644
--- a/WebCore/svg/SVGElementInstance.idl
+++ b/WebCore/svg/SVGElementInstance.idl
@@ -90,12 +90,12 @@
         attribute [DontEnum] EventListener onsubmit;
         attribute [DontEnum] EventListener onunload;
 
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event event)
             raises(EventException);
 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp
index a7400fa..76f374f 100644
--- a/WebCore/svg/SVGEllipseElement.cpp
+++ b/WebCore/svg/SVGEllipseElement.cpp
@@ -76,16 +76,29 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr ||
-        attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::cxAttr
+        || attrName == SVGNames::cyAttr
+        || attrName == SVGNames::rxAttr
+        || attrName == SVGNames::ryAttr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGFEBlendElement.cpp b/WebCore/svg/SVGFEBlendElement.cpp
index 46c412c..561eb30 100644
--- a/WebCore/svg/SVGFEBlendElement.cpp
+++ b/WebCore/svg/SVGFEBlendElement.cpp
@@ -24,7 +24,6 @@
 #include "SVGFEBlendElement.h"
 
 #include "MappedAttribute.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -79,18 +78,15 @@
         synchronizeIn2();
 }
 
-bool SVGFEBlendElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
-    FilterEffect* input2 = filterResource->builder()->getEffectById(in2());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
+    FilterEffect* input2 = filterBuilder->getEffectById(in2());
 
     if (!input1 || !input2)
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FEBlend::create(input1, input2, static_cast<BlendModeType>(mode()));
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FEBlend::create(input1, input2, static_cast<BlendModeType>(mode()));
 }
 
 }
diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h
index 7e32244..be97755 100644
--- a/WebCore/svg/SVGFEBlendElement.h
+++ b/WebCore/svg/SVGFEBlendElement.h
@@ -26,20 +26,20 @@
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
-    class SVGFEBlendElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEBlendElement(const QualifiedName&, Document*);
-        virtual ~SVGFEBlendElement();
+class SVGFEBlendElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEBlendElement(const QualifiedName&, Document*);
+    virtual ~SVGFEBlendElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)
-        DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)
+    DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEColorMatrixElement.cpp b/WebCore/svg/SVGFEColorMatrixElement.cpp
index e27ad86..4911f4c 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.cpp
+++ b/WebCore/svg/SVGFEColorMatrixElement.cpp
@@ -26,7 +26,6 @@
 #include "MappedAttribute.h"
 #include "SVGNames.h"
 #include "SVGNumberList.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -81,25 +80,49 @@
         synchronizeValues();
 }
 
-bool SVGFEColorMatrixElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
-        return false;
+        return 0;
 
-    Vector<float> _values;
+    Vector<float> filterValues;
     SVGNumberList* numbers = values();
+    const ColorMatrixType filterType(static_cast<const ColorMatrixType>(type()));
 
-    ExceptionCode ec = 0;
-    unsigned int nr = numbers->numberOfItems();
-    for (unsigned int i = 0;i < nr;i++)
-        _values.append(numbers->getItem(i, ec));
+    // Use defaults if values is empty (SVG 1.1 15.10).
+    if (!hasAttribute(SVGNames::valuesAttr)) {
+        switch (filterType) {
+        case FECOLORMATRIX_TYPE_MATRIX:
+            for (size_t i = 0; i < 20; i++)
+                filterValues.append((i % 6) ? 0.0f : 1.0f);
+            break;
+        case FECOLORMATRIX_TYPE_HUEROTATE:
+            filterValues.append(0.0f);
+            break;
+        case FECOLORMATRIX_TYPE_SATURATE:
+            filterValues.append(1.0f);
+            break;
+        default:
+            break;
+        }
+    } else {
+        size_t size = numbers->numberOfItems();
+        for (size_t i = 0; i < size; i++) {
+            ExceptionCode ec = 0;
+            filterValues.append(numbers->getItem(i, ec));
+        }
+        size = filterValues.size();
 
-    RefPtr<FilterEffect> effect = FEColorMatrix::create(input1, static_cast<ColorMatrixType>(type()), _values);
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+        if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20)
+            || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1)
+            || (filterType == FECOLORMATRIX_TYPE_SATURATE && (size != 1
+                || filterValues[0] < 0.0f || filterValues[0] > 1.0f)))
+            return 0;
+    }
+
+    return FEColorMatrix::create(input1, filterType, filterValues);
 }
 
 } //namespace WebCore
diff --git a/WebCore/svg/SVGFEColorMatrixElement.h b/WebCore/svg/SVGFEColorMatrixElement.h
index 811494d..29cd81f 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.h
+++ b/WebCore/svg/SVGFEColorMatrixElement.h
@@ -28,20 +28,20 @@
 
 namespace WebCore {
 
-    class SVGFEColorMatrixElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEColorMatrixElement(const QualifiedName&, Document*);
-        virtual ~SVGFEColorMatrixElement();
+class SVGFEColorMatrixElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEColorMatrixElement(const QualifiedName&, Document*);
+    virtual ~SVGFEColorMatrixElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
-        DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
+    DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEComponentTransferElement.cpp b/WebCore/svg/SVGFEComponentTransferElement.cpp
index 4cda9c9..5076d3c 100644
--- a/WebCore/svg/SVGFEComponentTransferElement.cpp
+++ b/WebCore/svg/SVGFEComponentTransferElement.cpp
@@ -31,7 +31,6 @@
 #include "SVGFEFuncRElement.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -61,12 +60,12 @@
         synchronizeIn1();
 }
 
-bool SVGFEComponentTransferElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
     if (!input1)
-        return false;
+        return 0;
 
     ComponentTransferFunction red;
     ComponentTransferFunction green;
@@ -84,14 +83,9 @@
             alpha = static_cast<SVGFEFuncAElement*>(n)->transferFunction();
     }
     
-    RefPtr<FilterEffect> effect = FEComponentTransfer::create(input1, red, green, blue, alpha);
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+    return FEComponentTransfer::create(input1, red, green, blue, alpha);
 }
 
 }
 
-#endif // ENABLE(SVG)
-
-// vim:ts=4:noet
+#endif
diff --git a/WebCore/svg/SVGFEComponentTransferElement.h b/WebCore/svg/SVGFEComponentTransferElement.h
index b1d9373..cab195b 100644
--- a/WebCore/svg/SVGFEComponentTransferElement.h
+++ b/WebCore/svg/SVGFEComponentTransferElement.h
@@ -27,18 +27,18 @@
 
 namespace WebCore {
 
-    class SVGFEComponentTransferElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEComponentTransferElement(const QualifiedName&, Document*);
-        virtual ~SVGFEComponentTransferElement();
+class SVGFEComponentTransferElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEComponentTransferElement(const QualifiedName&, Document*);
+    virtual ~SVGFEComponentTransferElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFECompositeElement.cpp b/WebCore/svg/SVGFECompositeElement.cpp
index 734c2fe..d213bd5 100644
--- a/WebCore/svg/SVGFECompositeElement.cpp
+++ b/WebCore/svg/SVGFECompositeElement.cpp
@@ -25,7 +25,6 @@
 
 #include "MappedAttribute.h"
 #include "SVGNames.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -102,19 +101,16 @@
         synchronizeK4();
 }
 
-bool SVGFECompositeElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
-    FilterEffect* input2 = filterResource->builder()->getEffectById(in2());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
+    FilterEffect* input2 = filterBuilder->getEffectById(in2());
     
     if (!input1 || !input2)
-        return false;
+        return 0;
     
-    RefPtr<FilterEffect> effect = FEComposite::create(input1, input2, static_cast<CompositeOperationType>(_operator()),
+    return FEComposite::create(input1, input2, static_cast<CompositeOperationType>(_operator()),
                                         k1(), k2(), k3(), k4());
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
 }
 
 }
diff --git a/WebCore/svg/SVGFECompositeElement.h b/WebCore/svg/SVGFECompositeElement.h
index c9fecc8..b275d25 100644
--- a/WebCore/svg/SVGFECompositeElement.h
+++ b/WebCore/svg/SVGFECompositeElement.h
@@ -27,24 +27,24 @@
 
 namespace WebCore {
 
-    class SVGFECompositeElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFECompositeElement(const QualifiedName&, Document*);
-        virtual ~SVGFECompositeElement();
+class SVGFECompositeElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFECompositeElement(const QualifiedName&, Document*);
+    virtual ~SVGFECompositeElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
-        DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k4Attr, float, K4, k4)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
+    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k4Attr, float, K4, k4)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index a3db66d..5415bea 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -31,7 +31,6 @@
 #include "SVGNames.h"
 #include "SVGParserUtilities.h"
 #include "SVGRenderStyle.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -93,21 +92,18 @@
     }
 }
 
-bool SVGFEDiffuseLightingElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
     if (!input1)
-        return false;
+        return 0;
     
     RefPtr<RenderStyle> filterStyle = styleForRenderer();
     Color color = filterStyle->svgStyle()->lightingColor();
     
-    RefPtr<FilterEffect> effect = FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), 
+    return FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), 
                                             kernelUnitLengthX(), kernelUnitLengthY(), findLights());
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
 }
 
 PassRefPtr<LightSource> SVGFEDiffuseLightingElement::findLights() const
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h
index 2e1b8cf..f12dfad 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.h
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.h
@@ -28,30 +28,30 @@
 
 namespace WebCore {
 
-    extern char SVGKernelUnitLengthXIdentifier[];
-    extern char SVGKernelUnitLengthYIdentifier[];
+extern char SVGKernelUnitLengthXIdentifier[];
+extern char SVGKernelUnitLengthYIdentifier[];
 
-    class FEDiffuseLighting;
-    class SVGColor;
+class FEDiffuseLighting;
+class SVGColor;
 
-    class SVGFEDiffuseLightingElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEDiffuseLightingElement(const QualifiedName&, Document*);
-        virtual ~SVGFEDiffuseLightingElement();
+class SVGFEDiffuseLightingElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEDiffuseLightingElement(const QualifiedName&, Document*);
+    virtual ~SVGFEDiffuseLightingElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
 
-        PassRefPtr<LightSource> findLights() const;
-    };
+    PassRefPtr<LightSource> findLights() const;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.cpp b/WebCore/svg/SVGFEDisplacementMapElement.cpp
index b4fcb92..dfaf2dc 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.cpp
+++ b/WebCore/svg/SVGFEDisplacementMapElement.cpp
@@ -23,7 +23,6 @@
 #include "SVGFEDisplacementMapElement.h"
 
 #include "MappedAttribute.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -94,20 +93,17 @@
         synchronizeScale();
 }
 
-bool SVGFEDisplacementMapElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
-    FilterEffect* input2 = filterResource->builder()->getEffectById(in2());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
+    FilterEffect* input2 = filterBuilder->getEffectById(in2());
     
     if (!input1 || !input2)
-        return false;
+        return 0;
         
     
-    RefPtr<FilterEffect> effect = FEDisplacementMap::create(input1, input2, static_cast<ChannelSelectorType>(xChannelSelector()), 
-                                        static_cast<ChannelSelectorType>(yChannelSelector()), scale());
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+    return FEDisplacementMap::create(input1, input2, static_cast<ChannelSelectorType>(xChannelSelector()), 
+                                     static_cast<ChannelSelectorType>(yChannelSelector()), scale());
 }
 
 }
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h
index 95c6672..ae3a525 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.h
+++ b/WebCore/svg/SVGFEDisplacementMapElement.h
@@ -26,24 +26,24 @@
 
 namespace WebCore {
     
-    class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*);
-        virtual ~SVGFEDisplacementMapElement();
-        
-        static ChannelSelectorType stringToChannel(const String&);
-        
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
-        
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
-        DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
-    };
+class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*);
+    virtual ~SVGFEDisplacementMapElement();
+    
+    static ChannelSelectorType stringToChannel(const String&);
+    
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
+    DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEFloodElement.cpp b/WebCore/svg/SVGFEFloodElement.cpp
index d69c240..a443071 100644
--- a/WebCore/svg/SVGFEFloodElement.cpp
+++ b/WebCore/svg/SVGFEFloodElement.cpp
@@ -26,7 +26,6 @@
 #include "MappedAttribute.h"
 #include "RenderStyle.h"
 #include "SVGRenderStyle.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -39,17 +38,14 @@
 {
 }
 
-bool SVGFEFloodElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*)
 {
     RefPtr<RenderStyle> filterStyle = styleForRenderer();
 
     Color color = filterStyle->svgStyle()->floodColor();
     float opacity = filterStyle->svgStyle()->floodOpacity();
 
-    RefPtr<FilterEffect> effect = FEFlood::create(color, opacity);
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+    return FEFlood::create(color, opacity);
 }
 
 }
diff --git a/WebCore/svg/SVGFEFloodElement.h b/WebCore/svg/SVGFEFloodElement.h
index b8b49e7..e7b70bc 100644
--- a/WebCore/svg/SVGFEFloodElement.h
+++ b/WebCore/svg/SVGFEFloodElement.h
@@ -26,13 +26,13 @@
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
-    class SVGFEFloodElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEFloodElement(const QualifiedName&, Document*);
-        virtual ~SVGFEFloodElement();
+class SVGFEFloodElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEFloodElement(const QualifiedName&, Document*);
+    virtual ~SVGFEFloodElement();
 
-        virtual bool build(SVGResourceFilter*);
-    };
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp
index fd49fe7..78fc505 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.cpp
+++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp
@@ -26,7 +26,6 @@
 #include "MappedAttribute.h"
 #include "SVGNames.h"
 #include "SVGParserUtilities.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -80,17 +79,14 @@
         synchronizeIn1();
 }
 
-bool SVGFEGaussianBlurElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FEGaussianBlur::create(input1, stdDeviationX(), stdDeviationY());
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FEGaussianBlur::create(input1, stdDeviationX(), stdDeviationY());
 }
 
 }
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.h b/WebCore/svg/SVGFEGaussianBlurElement.h
index a03b9df..ddddb8a 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.h
+++ b/WebCore/svg/SVGFEGaussianBlurElement.h
@@ -27,25 +27,25 @@
 
 namespace WebCore {
 
-    extern char SVGStdDeviationXAttrIdentifier[];
-    extern char SVGStdDeviationYAttrIdentifier[];
+extern char SVGStdDeviationXAttrIdentifier[];
+extern char SVGStdDeviationYAttrIdentifier[];
 
-    class SVGFEGaussianBlurElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEGaussianBlurElement(const QualifiedName&, Document*);
-        virtual ~SVGFEGaussianBlurElement();
+class SVGFEGaussianBlurElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEGaussianBlurElement(const QualifiedName&, Document*);
+    virtual ~SVGFEGaussianBlurElement();
 
-        void setStdDeviation(float stdDeviationX, float stdDeviationY);
+    void setStdDeviation(float stdDeviationX, float stdDeviationY);
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationXAttrIdentifier, float, StdDeviationX, stdDeviationX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationYAttrIdentifier, float, StdDeviationY, stdDeviationY)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationXAttrIdentifier, float, StdDeviationX, stdDeviationX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationYAttrIdentifier, float, StdDeviationY, stdDeviationY)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp
index 7be972c..bdc1911 100644
--- a/WebCore/svg/SVGFEImageElement.cpp
+++ b/WebCore/svg/SVGFEImageElement.cpp
@@ -33,7 +33,6 @@
 #include "SVGNames.h"
 #include "SVGPreserveAspectRatio.h"
 #include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -111,16 +110,16 @@
     SVGStyledElement::invalidateResourcesInAncestorChain();
 }
 
-bool SVGFEImageElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
 {
     if (!m_cachedImage && !m_targetImage) {
         Element* hrefElement = document()->getElementById(SVGURIReference::getTarget(href()));
         if (!hrefElement || !hrefElement->isSVGElement())
-            return false;
+            return 0;
 
         RenderObject* renderer = hrefElement->renderer();
         if (!renderer)
-            return false;
+            return 0;
 
         IntRect targetRect = enclosingIntRect(renderer->objectBoundingBox());
         m_targetImage = ImageBuffer::create(targetRect.size(), LinearRGB);
@@ -128,10 +127,7 @@
         renderSubtreeToImage(m_targetImage.get(), renderer);
     }
 
-    RefPtr<FilterEffect> effect = FEImage::create(m_targetImage ? m_targetImage->image() : m_cachedImage->image(), preserveAspectRatio());
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FEImage::create(m_targetImage ? m_targetImage->image() : m_cachedImage->image(), preserveAspectRatio());
 }
 
 void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
diff --git a/WebCore/svg/SVGFEImageElement.h b/WebCore/svg/SVGFEImageElement.h
index 72cd949..515dcf5 100644
--- a/WebCore/svg/SVGFEImageElement.h
+++ b/WebCore/svg/SVGFEImageElement.h
@@ -22,6 +22,7 @@
 #define SVGFEImageElement_h
 
 #if ENABLE(SVG) && ENABLE(FILTERS)
+#include "CachedResourceClient.h"
 #include "CachedResourceHandle.h"
 #include "ImageBuffer.h"
 #include "SVGExternalResourcesRequired.h"
@@ -33,36 +34,36 @@
 
 namespace WebCore {
 
-    class SVGFEImageElement : public SVGFilterPrimitiveStandardAttributes,
-                              public SVGURIReference,
-                              public SVGLangSpace,
-                              public SVGExternalResourcesRequired,
-                              public CachedResourceClient {
-    public:
-        SVGFEImageElement(const QualifiedName&, Document*);
-        virtual ~SVGFEImageElement();
+class SVGFEImageElement : public SVGFilterPrimitiveStandardAttributes,
+                          public SVGURIReference,
+                          public SVGLangSpace,
+                          public SVGExternalResourcesRequired,
+                          public CachedResourceClient {
+public:
+    SVGFEImageElement(const QualifiedName&, Document*);
+    virtual ~SVGFEImageElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual void notifyFinished(CachedResource*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual void notifyFinished(CachedResource*);
 
-        virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
-        virtual bool build(SVGResourceFilter*);
+    virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        void requestImageResource();
+private:
+    void requestImageResource();
 
-        DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+    DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
 
-        // SVGURIReference
-        DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href)
+    // SVGURIReference
+    DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href)
 
-        // SVGExternalResourcesRequired
-        DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+    // SVGExternalResourcesRequired
+    DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
 
-        CachedResourceHandle<CachedImage> m_cachedImage;
-        OwnPtr<ImageBuffer> m_targetImage;
-    };
+    CachedResourceHandle<CachedImage> m_cachedImage;
+    OwnPtr<ImageBuffer> m_targetImage;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEMergeElement.cpp b/WebCore/svg/SVGFEMergeElement.cpp
index 078de22..1fe070a 100644
--- a/WebCore/svg/SVGFEMergeElement.cpp
+++ b/WebCore/svg/SVGFEMergeElement.cpp
@@ -24,7 +24,6 @@
 #include "SVGFEMergeElement.h"
 
 #include "SVGFEMergeNodeElement.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -37,25 +36,22 @@
 {
 }
 
-bool SVGFEMergeElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder)
 {
     Vector<RefPtr<FilterEffect> > mergeInputs;
     for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
         if (n->hasTagName(SVGNames::feMergeNodeTag)) {
-            FilterEffect* mergeEffect = filterResource->builder()->getEffectById(static_cast<SVGFEMergeNodeElement*>(n)->in1());
+            FilterEffect* mergeEffect = filterBuilder->getEffectById(static_cast<SVGFEMergeNodeElement*>(n)->in1());
             if (!mergeEffect)
-                return false;
+                return 0;
             mergeInputs.append(mergeEffect);
         }
     }
 
     if (mergeInputs.isEmpty())
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FEMerge::create(mergeInputs);
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FEMerge::create(mergeInputs);
 }
 
 }
diff --git a/WebCore/svg/SVGFEMergeElement.h b/WebCore/svg/SVGFEMergeElement.h
index f84ddce..2feaa25 100644
--- a/WebCore/svg/SVGFEMergeElement.h
+++ b/WebCore/svg/SVGFEMergeElement.h
@@ -27,13 +27,13 @@
 
 namespace WebCore {
 
-    class SVGFEMergeElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEMergeElement(const QualifiedName&, Document*);
-        virtual ~SVGFEMergeElement();
+class SVGFEMergeElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEMergeElement(const QualifiedName&, Document*);
+    virtual ~SVGFEMergeElement();
 
-        virtual bool build(SVGResourceFilter*);
-    };
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEMorphologyElement.cpp b/WebCore/svg/SVGFEMorphologyElement.cpp
index 1f37c08..5457b29 100644
--- a/WebCore/svg/SVGFEMorphologyElement.cpp
+++ b/WebCore/svg/SVGFEMorphologyElement.cpp
@@ -25,7 +25,6 @@
 #include "MappedAttribute.h"
 #include "SVGNames.h"
 #include "SVGParserUtilities.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -89,17 +88,19 @@
     }
 }
 
-bool SVGFEMorphologyElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
+    SVGAnimatedPropertyTraits<float>::ReturnType radX = radiusX(),
+        radY = radiusY();
 
     if (!input1)
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FEMorphology::create(input1, static_cast<MorphologyOperatorType>(_operator()), radiusX(), radiusY());
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+    if (radX < 0 || radY < 0)
+        return 0;
+
+    return FEMorphology::create(input1, static_cast<MorphologyOperatorType>(_operator()), radX, radY);
 }
 
 } //namespace WebCore
diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h
index c7e3f6f..7013444 100644
--- a/WebCore/svg/SVGFEMorphologyElement.h
+++ b/WebCore/svg/SVGFEMorphologyElement.h
@@ -26,26 +26,26 @@
 
 namespace WebCore {
 
-    extern char SVGRadiusXAttrIdentifier[];
-    extern char SVGRadiusYAttrIdentifier[];
+extern char SVGRadiusXAttrIdentifier[];
+extern char SVGRadiusYAttrIdentifier[];
 
-    class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEMorphologyElement(const QualifiedName&, Document*);
-        virtual ~SVGFEMorphologyElement();
+class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEMorphologyElement(const QualifiedName&, Document*);
+    virtual ~SVGFEMorphologyElement();
 
-        void setRadius(float radiusX, float radiusY);
+    void setRadius(float radiusX, float radiusY);
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusYAttrIdentifier, float, RadiusY, radiusY)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusYAttrIdentifier, float, RadiusY, radiusY)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp
index 28955c0..35025ab 100644
--- a/WebCore/svg/SVGFEOffsetElement.cpp
+++ b/WebCore/svg/SVGFEOffsetElement.cpp
@@ -25,7 +25,6 @@
 
 #include "Attr.h"
 #include "MappedAttribute.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -70,17 +69,14 @@
         synchronizeIn1();
 }
 
-bool SVGFEOffsetElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FEOffset::create(input1, dx(), dy());
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FEOffset::create(input1, dx(), dy());
 }
 
 }
diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h
index df61a9c..06b76fa 100644
--- a/WebCore/svg/SVGFEOffsetElement.h
+++ b/WebCore/svg/SVGFEOffsetElement.h
@@ -27,20 +27,20 @@
 
 namespace WebCore {
 
-    class SVGFEOffsetElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFEOffsetElement(const QualifiedName&, Document*);
-        virtual ~SVGFEOffsetElement();
+class SVGFEOffsetElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFEOffsetElement(const QualifiedName&, Document*);
+    virtual ~SVGFEOffsetElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx)
-        DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx)
+    DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp
index 0602103..767460e 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.cpp
+++ b/WebCore/svg/SVGFESpecularLightingElement.cpp
@@ -30,7 +30,6 @@
 #include "SVGFELightElement.h"
 #include "SVGNames.h"
 #include "SVGParserUtilities.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -109,22 +108,19 @@
     return 0;
 }
 
-bool SVGFESpecularLightingElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
     if (!input1)
-        return false;
+        return 0;
     
     RefPtr<RenderStyle> filterStyle = styleForRenderer();    
     
     Color color = filterStyle->svgStyle()->lightingColor();
     
-    RefPtr<FilterEffect> effect = FESpecularLighting::create(input1, color, surfaceScale(), specularConstant(), 
-                                        specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FESpecularLighting::create(input1, color, surfaceScale(), specularConstant(), 
+                                      specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
 }
 
 }
diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h
index fe56980..0b4c8fd 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.h
+++ b/WebCore/svg/SVGFESpecularLightingElement.h
@@ -28,28 +28,28 @@
 
 namespace WebCore {
 
-    extern char SVGKernelUnitLengthXIdentifier[];
-    extern char SVGKernelUnitLengthYIdentifier[];
+extern char SVGKernelUnitLengthXIdentifier[];
+extern char SVGKernelUnitLengthYIdentifier[];
 
-    class SVGFESpecularLightingElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFESpecularLightingElement(const QualifiedName&, Document*);
-        virtual ~SVGFESpecularLightingElement();
-        
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+class SVGFESpecularLightingElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFESpecularLightingElement(const QualifiedName&, Document*);
+    virtual ~SVGFESpecularLightingElement();
+    
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)
-        DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
-        DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
-        DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)
+    DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
+    DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
+    DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
 
-        PassRefPtr<LightSource> findLights() const;
-    };
+    PassRefPtr<LightSource> findLights() const;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFETileElement.cpp b/WebCore/svg/SVGFETileElement.cpp
index 94c8e74..133cddc 100644
--- a/WebCore/svg/SVGFETileElement.cpp
+++ b/WebCore/svg/SVGFETileElement.cpp
@@ -26,7 +26,6 @@
 #include "Attr.h"
 #include "MappedAttribute.h"
 #include "SVGRenderStyle.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -56,17 +55,14 @@
         synchronizeIn1();
 }
 
-bool SVGFETileElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder)
 {
-    FilterEffect* input1 = filterResource->builder()->getEffectById(in1());
+    FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
-        return false;
+        return 0;
 
-    RefPtr<FilterEffect> effect = FETile::create(input1);
-    filterResource->addFilterEffect(this, effect.release());
-    
-    return true;
+    return FETile::create(input1);
 }
 
 }
diff --git a/WebCore/svg/SVGFETileElement.h b/WebCore/svg/SVGFETileElement.h
index 2c86abd..0568d28 100644
--- a/WebCore/svg/SVGFETileElement.h
+++ b/WebCore/svg/SVGFETileElement.h
@@ -27,18 +27,18 @@
 
 namespace WebCore {
 
-    class SVGFETileElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFETileElement(const QualifiedName&, Document*);
-        virtual ~SVGFETileElement();
+class SVGFETileElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFETileElement(const QualifiedName&, Document*);
+    virtual ~SVGFETileElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFETileElement, SVGNames::inAttr, String, In1, in1)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFETileElement, SVGNames::inAttr, String, In1, in1)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp
index 622971c..f1baeef 100644
--- a/WebCore/svg/SVGFETurbulenceElement.cpp
+++ b/WebCore/svg/SVGFETurbulenceElement.cpp
@@ -25,7 +25,6 @@
 
 #include "MappedAttribute.h"
 #include "SVGParserUtilities.h"
-#include "SVGResourceFilter.h"
 
 namespace WebCore {
 
@@ -98,13 +97,10 @@
         synchronizeNumOctaves();
 }
 
-bool SVGFETurbulenceElement::build(SVGResourceFilter* filterResource)
+PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*)
 {
-    RefPtr<FilterEffect> effect = FETurbulence::create(static_cast<TurbulanceType>(type()), baseFrequencyX(), 
-                                        baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
-    filterResource->addFilterEffect(this, effect.release());
-
-    return true;
+    return FETurbulence::create(static_cast<TurbulanceType>(type()), baseFrequencyX(), 
+                baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
 }
 
 }
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 464ce25..72003a3 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -27,32 +27,32 @@
 
 namespace WebCore {
 
-    extern char SVGBaseFrequencyXIdentifier[];
-    extern char SVGBaseFrequencyYIdentifier[];
+extern char SVGBaseFrequencyXIdentifier[];
+extern char SVGBaseFrequencyYIdentifier[];
 
-    enum SVGStitchOptions {
-        SVG_STITCHTYPE_UNKNOWN  = 0,
-        SVG_STITCHTYPE_STITCH   = 1,
-        SVG_STITCHTYPE_NOSTITCH = 2
-    };
+enum SVGStitchOptions {
+    SVG_STITCHTYPE_UNKNOWN  = 0,
+    SVG_STITCHTYPE_STITCH   = 1,
+    SVG_STITCHTYPE_NOSTITCH = 2
+};
 
-    class SVGFETurbulenceElement : public SVGFilterPrimitiveStandardAttributes {
-    public:
-        SVGFETurbulenceElement(const QualifiedName&, Document*);
-        virtual ~SVGFETurbulenceElement();
+class SVGFETurbulenceElement : public SVGFilterPrimitiveStandardAttributes {
+public:
+    SVGFETurbulenceElement(const QualifiedName&, Document*);
+    virtual ~SVGFETurbulenceElement();
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
 
-    private:
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyXIdentifier, float, BaseFrequencyX, baseFrequencyX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyYIdentifier, float, BaseFrequencyY, baseFrequencyY)
-        DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
-        DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
-        DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
-        DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyXIdentifier, float, BaseFrequencyX, baseFrequencyX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyYIdentifier, float, BaseFrequencyY, baseFrequencyY)
+    DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
+    DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
+    DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
+    DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp
index 60375fb..7abe756 100644
--- a/WebCore/svg/SVGFilterElement.cpp
+++ b/WebCore/svg/SVGFilterElement.cpp
@@ -3,6 +3,7 @@
     Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
     Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
     Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -29,12 +30,12 @@
 #include "FloatSize.h"
 #include "MappedAttribute.h"
 #include "PlatformString.h"
+#include "RenderSVGResourceFilter.h"
 #include "SVGFilterBuilder.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 #include "SVGLength.h"
 #include "SVGNames.h"
 #include "SVGParserUtilities.h"
-#include "SVGResourceFilter.h"
 #include "SVGUnitTypes.h"
 
 namespace WebCore {
@@ -161,67 +162,10 @@
     return filterBBox;
 }
 
-void SVGFilterElement::buildFilter(const FloatRect& targetRect) const
+RenderObject* SVGFilterElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    bool filterBBoxMode = filterUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
-    bool primitiveBBoxMode = primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
-
-    FloatRect filterBBox;
-    if (filterBBoxMode)
-        filterBBox = FloatRect(x().valueAsPercentage(),
-                               y().valueAsPercentage(),
-                               width().valueAsPercentage(),
-                               height().valueAsPercentage());
-    else
-        filterBBox = FloatRect(x().value(this),
-                               y().value(this),
-                               width().value(this),
-                               height().value(this));
-
-    FloatRect filterRect = filterBBox;
-    if (filterBBoxMode)
-        filterRect = FloatRect(targetRect.x() + filterRect.x() * targetRect.width(),
-                               targetRect.y() + filterRect.y() * targetRect.height(),
-                               filterRect.width() * targetRect.width(),
-                               filterRect.height() * targetRect.height());
-
-    m_filter->setFilterBoundingBox(filterRect);
-    m_filter->setFilterRect(filterBBox);
-    m_filter->setEffectBoundingBoxMode(primitiveBBoxMode);
-    m_filter->setFilterBoundingBoxMode(filterBBoxMode);
-
-    if (hasAttribute(SVGNames::filterResAttr)) {
-        m_filter->setHasFilterResolution(true);
-        m_filter->setFilterResolution(FloatSize(filterResX(), filterResY()));
-    }
-
-    // Add effects to the filter
-    m_filter->builder()->clearEffects();
-    for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
-        SVGElement* element = 0;
-        if (n->isSVGElement()) {
-            element = static_cast<SVGElement*>(n);
-            if (element->isFilterEffect()) {
-                SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFilterPrimitiveStandardAttributes*>(element);
-                if (!effectElement->build(m_filter.get())) {
-                    m_filter->builder()->clearEffects();
-                    break;
-                }
-            }
-        }
-    }
+    return new (arena) RenderSVGResourceFilter(this);
+}
 }
 
-SVGResource* SVGFilterElement::canvasResource(const RenderObject*)
-{
-    if (!attached())
-        return 0;
-
-    if (!m_filter)
-        m_filter = SVGResourceFilter::create(this);
-    return m_filter.get();
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
+#endif
diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h
index c89352b..d8b6653 100644
--- a/WebCore/svg/SVGFilterElement.h
+++ b/WebCore/svg/SVGFilterElement.h
@@ -2,6 +2,7 @@
     Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
     Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
     Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -24,7 +25,6 @@
 
 #if ENABLE(SVG) && ENABLE(FILTERS)
 #include "RenderObject.h"
-#include "SVGResourceFilter.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGLangSpace.h"
 #include "SVGStyledElement.h"
@@ -32,52 +32,43 @@
 
 namespace WebCore {
 
-    extern char SVGFilterResXIdentifier[];
-    extern char SVGFilterResYIdentifier[];
+extern char SVGFilterResXIdentifier[];
+extern char SVGFilterResYIdentifier[];
 
-    class SVGResourceFilter;
+class SVGFilterElement : public SVGStyledElement,
+                         public SVGURIReference,
+                         public SVGLangSpace,
+                         public SVGExternalResourcesRequired {
+public:
+    SVGFilterElement(const QualifiedName&, Document*);
+    virtual ~SVGFilterElement();
 
-    class SVGFilterElement : public SVGStyledElement,
-                             public SVGURIReference,
-                             public SVGLangSpace,
-                             public SVGExternalResourcesRequired {
-    public:
-        SVGFilterElement(const QualifiedName&, Document*);
-        virtual ~SVGFilterElement();
+    void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
+    FloatRect filterBoundingBox(const FloatRect&) const;
 
-        virtual SVGResource* canvasResource(const RenderObject*);
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
 
-        void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool rendererIsNeeded(RenderStyle*) { return false; }
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResXIdentifier, long, FilterResX, filterResX)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResYIdentifier, long, FilterResY, filterResY)
 
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResXIdentifier, long, FilterResX, filterResX)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResYIdentifier, long, FilterResY, filterResY)
+    // SVGURIReference
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)
 
-        // SVGURIReference
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)
+    // SVGExternalResourcesRequired
+    DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+};
 
-        // SVGExternalResourcesRequired
-        DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+}
 
-        mutable RefPtr<SVGResourceFilter> m_filter;
-
-    private:
-        friend class SVGResourceFilter;
-        FloatRect filterBoundingBox(const FloatRect&) const;
-        void buildFilter(const FloatRect& targetRect) const;
-    };
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG)
+#endif
 #endif
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
index 0a95522..4f13e5e 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -90,14 +90,12 @@
         synchronizeResult();
 }
 
-void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(SVGResourceFilter* resourceFilter, FilterEffect* filterEffect) const
+void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(bool primitiveBoundingBoxMode, FilterEffect* filterEffect) const
 {
     ASSERT(filterEffect);
     if (!filterEffect)
         return;
 
-    ASSERT(resourceFilter);
-
     if (this->hasAttribute(SVGNames::xAttr))
         filterEffect->setHasX(true);
     if (this->hasAttribute(SVGNames::yAttr))
@@ -108,7 +106,7 @@
         filterEffect->setHasHeight(true);
 
     FloatRect effectBBox;
-    if (resourceFilter->effectBoundingBoxMode())
+    if (primitiveBoundingBoxMode)
         effectBBox = FloatRect(x().valueAsPercentage(),
                                y().valueAsPercentage(),
                                width().valueAsPercentage(),
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
index fb8e5f2..a2e7af6 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
@@ -22,39 +22,38 @@
 #define SVGFilterPrimitiveStandardAttributes_h
 
 #if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FilterEffect.h"
 #include "SVGFilterBuilder.h"
 #include "SVGNames.h"
-#include "SVGResourceFilter.h"
 #include "SVGStyledElement.h"
 
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
 namespace WebCore {
 
-    class SVGResourceFilter;
+class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
+public:
+    SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
+    virtual ~SVGFilterPrimitiveStandardAttributes();
+    
+    virtual bool isFilterEffect() const { return true; }
 
-    class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
-    public:
-        SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
-        virtual ~SVGFilterPrimitiveStandardAttributes();
-        
-        virtual bool isFilterEffect() const { return true; }
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0;
 
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual bool build(SVGResourceFilter*) = 0;
+    virtual bool rendererIsNeeded(RenderStyle*) { return false; }
 
-        virtual bool rendererIsNeeded(RenderStyle*) { return false; }
+    void setStandardAttributes(bool, FilterEffect*) const;
 
-    protected:
-        friend class SVGResourceFilter;
-        void setStandardAttributes(SVGResourceFilter*, FilterEffect*) const;
-
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
-        DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)
-    };
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
+    DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp
index b7ca5f2..dacbac2 100644
--- a/WebCore/svg/SVGFont.cpp
+++ b/WebCore/svg/SVGFont.cpp
@@ -1,5 +1,6 @@
 /**
  * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -528,22 +529,16 @@
                         glyphOrigin.setY(identifier.verticalOriginY * scale);
                     }
 
-                    context->translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
-                    context->scale(FloatSize(scale, -scale));
+                    AffineTransform glyphPathTransform;
+                    glyphPathTransform.translate(xStartOffset + currentPoint.x() + glyphOrigin.x(), currentPoint.y() + glyphOrigin.y());
+                    glyphPathTransform.scale(scale, -scale);
+
+                    Path glyphPath = identifier.pathData;
+                    glyphPath.transform(glyphPathTransform);
 
                     context->beginPath();
-                    context->addPath(identifier.pathData);
-
-                    // FIXME: setup() tries to get objectBoundingBox() from run.referencingRenderObject()
-                    // which is wrong.  We need to change setup() to take a bounding box instead, or pass
-                    // a RenderObject which would return the bounding box for identifier.pathData
+                    context->addPath(glyphPath);
                     if (activePaintServer->setup(context, run.referencingRenderObject(), targetType)) {
-                        // Spec: Any properties specified on a text elements which represents a length, such as the
-                        // 'stroke-width' property, might produce surprising results since the length value will be
-                        // processed in the coordinate system of the glyph. (TODO: What other lengths? miter-limit? dash-offset?)
-                        if (targetType == ApplyToStrokeTargetType && scale != 0.0f)
-                            context->setStrokeThickness(context->strokeThickness() / scale);
-
                         activePaintServer->renderPath(context, run.referencingRenderObject(), targetType);
                         activePaintServer->teardown(context, run.referencingRenderObject(), targetType);
                     }
diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp
index 25b3aea..d1e1661 100644
--- a/WebCore/svg/SVGFontFaceElement.cpp
+++ b/WebCore/svg/SVGFontFaceElement.cpp
@@ -24,7 +24,6 @@
 #if ENABLE(SVG_FONTS)
 #include "SVGFontFaceElement.h"
 
-#include "CString.h"
 #include "CSSFontFaceRule.h"
 #include "CSSFontFaceSrcValue.h"
 #include "CSSParser.h"
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index d28e2a4..f9ab057 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -76,18 +76,24 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
         return;
 
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
     if (attrName == SVGNames::xAttr
         || attrName == SVGNames::yAttr
         || attrName == SVGNames::widthAttr
         || attrName == SVGNames::heightAttr
         || SVGTests::isKnownAttribute(attrName)
         || SVGLangSpace::isKnownAttribute(attrName)
-        || SVGExternalResourcesRequired::isKnownAttribute(attrName)
-        || SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp
index 0fd329f..6e39bf5 100644
--- a/WebCore/svg/SVGGElement.cpp
+++ b/WebCore/svg/SVGGElement.cpp
@@ -55,14 +55,20 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
         return;
 
-    if (SVGTests::isKnownAttribute(attrName) || 
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGGElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index 4055533..82bf3bd 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -91,18 +91,25 @@
     if (SVGURIReference::isKnownAttribute(attrName))
         m_imageLoader.updateFromElementIgnoringPreviousError();
 
-    if (!renderer())
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
-        attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr ||
-        attrName == SVGNames::preserveAspectRatioAttr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName)) {
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
     }
+
+    if (attrName == SVGNames::xAttr
+        || attrName == SVGNames::yAttr
+        || attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr
+        || attrName == SVGNames::preserveAspectRatioAttr
+        || SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
@@ -185,6 +192,12 @@
     addSubresourceURL(urls, document()->completeURL(href()));
 }
 
+void SVGImageElement::willMoveToNewOwnerDocument()
+{
+    m_imageLoader.elementWillMoveToNewOwnerDocument();
+    SVGStyledTransformableElement::willMoveToNewOwnerDocument();
+}
+
 }
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGImageElement.h b/WebCore/svg/SVGImageElement.h
index 3fa0e3f..e5b603c 100644
--- a/WebCore/svg/SVGImageElement.h
+++ b/WebCore/svg/SVGImageElement.h
@@ -62,6 +62,8 @@
         virtual bool hasRelativeValues() const;
 
     private:
+        virtual void willMoveToNewOwnerDocument();
+
         DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::xAttr, SVGLength, X, x)
         DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)
         DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)
diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp
index 6c8a16b..68b8259 100644
--- a/WebCore/svg/SVGLineElement.cpp
+++ b/WebCore/svg/SVGLineElement.cpp
@@ -72,16 +72,29 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::x1Attr || attrName == SVGNames::y1Attr ||
-        attrName == SVGNames::x2Attr || attrName == SVGNames::y2Attr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::x1Attr
+        || attrName == SVGNames::y1Attr
+        || attrName == SVGNames::x2Attr
+        || attrName == SVGNames::y2Attr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGLocatable.cpp b/WebCore/svg/SVGLocatable.cpp
index 39cf589..49600d1 100644
--- a/WebCore/svg/SVGLocatable.cpp
+++ b/WebCore/svg/SVGLocatable.cpp
@@ -1,7 +1,8 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006 Rob Buis <buis@kde.org>
     Copyright (C) 2009 Google, Inc.  All rights reserved.
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -20,14 +21,13 @@
 */
 
 #include "config.h"
-#if ENABLE(SVG)
 
+#if ENABLE(SVG)
 #include "SVGLocatable.h"
 
-#include "AffineTransform.h"
-#include "RenderPath.h"
+#include "RenderObject.h"
+#include "SVGStyledLocatableElement.h"
 #include "SVGException.h"
-#include "SVGSVGElement.h"
 
 namespace WebCore {
 
@@ -73,6 +73,7 @@
 
 FloatRect SVGLocatable::getBBox(const SVGElement* element)
 {
+    ASSERT(element);
     element->document()->updateLayoutIgnorePendingStylesheets();
 
     // FIXME: Eventually we should support getBBox for detached elements.
@@ -82,35 +83,22 @@
     return element->renderer()->objectBoundingBox();
 }
 
-AffineTransform SVGLocatable::getCTM(const SVGElement* element)
+AffineTransform SVGLocatable::computeCTM(const SVGElement* element, CTMScope mode)
 {
     ASSERT(element);
+    element->document()->updateLayoutIgnorePendingStylesheets();
+
     AffineTransform ctm;
 
-    Node* parent = element->parentNode();
-    if (parent && parent->isSVGElement()) {
-        SVGElement* parentElement = static_cast<SVGElement*>(parent);
-        if (parentElement && parentElement->isStyledLocatable()) {
-            AffineTransform parentCTM = static_cast<SVGStyledLocatableElement*>(parentElement)->getCTM();
-            ctm = parentCTM * ctm;
-        }
-    }
+    SVGElement* stopAtElement = mode == NearestViewportScope ? nearestViewportElement(element) : 0;
+    for (const Node* current = element; current && current->isSVGElement(); current = current->parentNode()) {
+        const SVGElement* currentElement = static_cast<const SVGElement*>(current);
+        if (currentElement->isStyled())
+            ctm = static_cast<const SVGStyledElement*>(currentElement)->localCoordinateSpaceTransform(mode).multLeft(ctm);
 
-    return ctm;
-}
-
-AffineTransform SVGLocatable::getScreenCTM(const SVGElement* element)
-{
-    ASSERT(element);
-    AffineTransform ctm;
-
-    Node* parent = element->parentNode();
-    if (parent && parent->isSVGElement()) {
-        SVGElement* parentElement = static_cast<SVGElement*>(parent);
-        if (parentElement && parentElement->isStyledLocatable()) {
-            AffineTransform parentCTM = static_cast<SVGStyledLocatableElement*>(parentElement)->getScreenCTM();
-            ctm = parentCTM * ctm;
-        }
+        // For getCTM() computation, stop at the nearest viewport element
+        if (currentElement == stopAtElement)
+            break;
     }
 
     return ctm;
@@ -135,5 +123,3 @@
 }
 
 #endif // ENABLE(SVG)
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/SVGLocatable.h b/WebCore/svg/SVGLocatable.h
index b7d8d30..1800fc8 100644
--- a/WebCore/svg/SVGLocatable.h
+++ b/WebCore/svg/SVGLocatable.h
@@ -1,6 +1,7 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2007 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -22,12 +23,11 @@
 #define SVGLocatable_h
 
 #if ENABLE(SVG)
-
+#include "AffineTransform.h"
 #include "ExceptionCode.h"
 
 namespace WebCore {
 
-class AffineTransform;
 class FloatRect;
 class SVGElement;
 
@@ -48,15 +48,19 @@
     static SVGElement* nearestViewportElement(const SVGElement*);
     static SVGElement* farthestViewportElement(const SVGElement*);
 
+    enum CTMScope {
+        NearestViewportScope, // Used for getCTM()
+        ScreenScope // Used for getScreenCTM()
+    };
+
 protected:
+    virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const { return AffineTransform(); }
+
     static FloatRect getBBox(const SVGElement*);
-    static AffineTransform getCTM(const SVGElement*);
-    static AffineTransform getScreenCTM(const SVGElement*);
+    static AffineTransform computeCTM(const SVGElement*, CTMScope);
 };
 
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
 #endif // SVGLocatable_h
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp
index 7716af7..ba9728f 100644
--- a/WebCore/svg/SVGMarkerElement.cpp
+++ b/WebCore/svg/SVGMarkerElement.cpp
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
+    Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -25,7 +26,7 @@
 
 #include "MappedAttribute.h"
 #include "PlatformString.h"
-#include "RenderSVGViewportContainer.h"
+#include "RenderSVGResourceMarker.h"
 #include "SVGFitToViewBox.h"
 #include "SVGLength.h"
 #include "SVGNames.h"
@@ -103,21 +104,14 @@
 {
     SVGStyledElement::svgAttributeChanged(attrName);
 
-    if (!m_marker)
-        return;
-
     if (attrName == SVGNames::markerUnitsAttr || attrName == SVGNames::refXAttr ||
         attrName == SVGNames::refYAttr || attrName == SVGNames::markerWidthAttr ||
         attrName == SVGNames::markerHeightAttr || attrName == SVGNames::orientAttr ||
         SVGLangSpace::isKnownAttribute(attrName) ||
         SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
         SVGFitToViewBox::isKnownAttribute(attrName) ||
-        SVGStyledElement::isKnownAttribute(attrName)) {
-        if (renderer())
-            renderer()->setNeedsLayout(true);
-
-        m_marker->invalidate();
-    }
+        SVGStyledElement::isKnownAttribute(attrName))
+        invalidateCanvasResources();
 }
 
 void SVGMarkerElement::synchronizeProperty(const QualifiedName& attrName)
@@ -163,13 +157,7 @@
 {
     SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
 
-    if (!m_marker)
-        return;
-
-    if (renderer())
-        renderer()->setNeedsLayout(true);
-
-    m_marker->invalidate();
+    invalidateCanvasResources();
 }
 
 void SVGMarkerElement::setOrientToAuto()
@@ -177,13 +165,7 @@
     setOrientTypeBaseValue(SVG_MARKER_ORIENT_AUTO);
     setOrientAngleBaseValue(SVGAngle());
 
-    if (!m_marker)
-        return;
-
-    if (renderer())
-        renderer()->setNeedsLayout(true);
-
-    m_marker->invalidate();
+    invalidateCanvasResources();
 }
 
 void SVGMarkerElement::setOrientToAngle(const SVGAngle& angle)
@@ -191,41 +173,14 @@
     setOrientTypeBaseValue(SVG_MARKER_ORIENT_ANGLE);
     setOrientAngleBaseValue(angle);
 
-    if (!m_marker)
-        return;
-
-    if (renderer())
-        renderer()->setNeedsLayout(true);
-
-    m_marker->invalidate();
-}
-
-SVGResource* SVGMarkerElement::canvasResource(const RenderObject*)
-{
-    if (!m_marker)
-        m_marker = SVGResourceMarker::create();
-
-    ASSERT(renderer());
-    m_marker->setRenderer(toRenderSVGViewportContainer(renderer()));
-
-    if (orientType() == SVG_MARKER_ORIENT_ANGLE)
-        m_marker->setAngle(orientAngle().value());
-    else
-        m_marker->setAutoAngle();
-
-    m_marker->setReferencePoint(FloatPoint(refX().value(this), refY().value(this)));
-    m_marker->setUseStrokeWidth(markerUnits() == SVG_MARKERUNITS_STROKEWIDTH);
-
-    return m_marker.get();
+    invalidateCanvasResources();
 }
 
 RenderObject* SVGMarkerElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    RenderSVGViewportContainer* markerContainer = new (arena) RenderSVGViewportContainer(this);
-    markerContainer->setDrawsContents(false); // Marker contents will be explicitly drawn.
-    return markerContainer;
+    return new (arena) RenderSVGResourceMarker(this);
 }
 
 }
 
-#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h
index fd5a13b..491cac5 100644
--- a/WebCore/svg/SVGMarkerElement.h
+++ b/WebCore/svg/SVGMarkerElement.h
@@ -27,69 +27,65 @@
 #include "SVGExternalResourcesRequired.h"
 #include "SVGFitToViewBox.h"
 #include "SVGLangSpace.h"
-#include "SVGResourceMarker.h"
 #include "SVGStyledElement.h"
 
 namespace WebCore {
 
-    class Document;
+class Document;
 
-    extern char SVGOrientTypeAttrIdentifier[];
-    extern char SVGOrientAngleAttrIdentifier[];
+extern char SVGOrientTypeAttrIdentifier[];
+extern char SVGOrientAngleAttrIdentifier[];
 
-    class SVGMarkerElement : public SVGStyledElement,
-                             public SVGLangSpace,
-                             public SVGExternalResourcesRequired,
-                             public SVGFitToViewBox {
-    public:
-        enum SVGMarkerUnitsType {
-            SVG_MARKERUNITS_UNKNOWN           = 0,
-            SVG_MARKERUNITS_USERSPACEONUSE    = 1,
-            SVG_MARKERUNITS_STROKEWIDTH       = 2
-        };
-
-        enum SVGMarkerOrientType {
-            SVG_MARKER_ORIENT_UNKNOWN    = 0,
-            SVG_MARKER_ORIENT_AUTO       = 1,
-            SVG_MARKER_ORIENT_ANGLE      = 2
-        };
-
-        SVGMarkerElement(const QualifiedName&, Document*);
-        virtual ~SVGMarkerElement();
-
-        AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const;
-
-        void setOrientToAuto();
-        void setOrientToAngle(const SVGAngle&);
-
-        virtual void parseMappedAttribute(MappedAttribute*);
-        virtual void svgAttributeChanged(const QualifiedName&);
-        virtual void synchronizeProperty(const QualifiedName&);
-        virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
-
-        virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-        virtual SVGResource* canvasResource(const RenderObject*);
-
-    private:
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientTypeAttrIdentifier, int, OrientType, orientType)
-        DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientAngleAttrIdentifier, SVGAngle, OrientAngle, orientAngle)
-
-        // SVGExternalResourcesRequired
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
-
-        // SVGFitToViewBox
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
-        DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
- 
-        RefPtr<SVGResourceMarker> m_marker;
+class SVGMarkerElement : public SVGStyledElement,
+                         public SVGLangSpace,
+                         public SVGExternalResourcesRequired,
+                         public SVGFitToViewBox {
+public:
+    enum SVGMarkerUnitsType {
+        SVG_MARKERUNITS_UNKNOWN           = 0,
+        SVG_MARKERUNITS_USERSPACEONUSE    = 1,
+        SVG_MARKERUNITS_STROKEWIDTH       = 2
     };
 
-} // namespace WebCore
+    enum SVGMarkerOrientType {
+        SVG_MARKER_ORIENT_UNKNOWN    = 0,
+        SVG_MARKER_ORIENT_AUTO       = 1,
+        SVG_MARKER_ORIENT_ANGLE      = 2
+    };
 
-#endif // ENABLE(SVG)
+    SVGMarkerElement(const QualifiedName&, Document*);
+    virtual ~SVGMarkerElement();
+
+    AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const;
+
+    void setOrientToAuto();
+    void setOrientToAngle(const SVGAngle&);
+
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual void svgAttributeChanged(const QualifiedName&);
+    virtual void synchronizeProperty(const QualifiedName&);
+    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
+
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+
+private:
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientTypeAttrIdentifier, int, OrientType, orientType)
+    DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientAngleAttrIdentifier, SVGAngle, OrientAngle, orientAngle)
+
+    // SVGExternalResourcesRequired
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+
+    // SVGFitToViewBox
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+    DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+};
+
+}
+
+#endif
 #endif
diff --git a/WebCore/svg/SVGParserUtilities.cpp b/WebCore/svg/SVGParserUtilities.cpp
index c05e0f8..fc9ca5d 100644
--- a/WebCore/svg/SVGParserUtilities.cpp
+++ b/WebCore/svg/SVGParserUtilities.cpp
@@ -140,6 +140,23 @@
     return _parseNumber(ptr, end, number, skip);
 }
 
+// only used to parse largeArcFlag and sweepFlag which must be a "0" or "1"
+// and might not have any whitespace/comma after it
+static bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag)
+{
+    const UChar flagChar = *ptr++;
+    if (flagChar == '0')
+        flag = false;
+    else if (flagChar == '1')
+        flag = true;
+    else
+        return false;
+    
+    skipOptionalSpacesOrDelimiter(ptr, end);
+    
+    return true;
+}
+
 bool parseNumberOptionalNumber(const String& s, float& x, float& y)
 {
     if (s.isEmpty())
@@ -478,14 +495,10 @@
             {
                 bool largeArc, sweep;
                 double angle, rx, ry;
-                if (!parseNumber(ptr, end, rx)    || !parseNumber(ptr, end, ry) ||
-                    !parseNumber(ptr, end, angle) || !parseNumber(ptr, end, tox))
-                    return false;
-                largeArc = tox == 1;
-                if (!parseNumber(ptr, end, tox))
-                    return false;
-                sweep = tox == 1;
-                if (!parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
+                if (!parseNumber(ptr, end, rx)    || !parseNumber(ptr, end, ry)
+                    || !parseNumber(ptr, end, angle)
+                    || !parseArcFlag(ptr, end, largeArc) || !parseArcFlag(ptr, end, sweep)
+                    || !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy))
                     return false;
 
                 // Spec: radii are nonnegative numbers
@@ -727,15 +740,14 @@
 public:
     bool build(SVGPathSegList* segList, const String& d, bool process)
     {
-        if (!parseSVG(d, process))
-            return false;
+        bool result = parseSVG(d, process);
         size_t size = m_vector.size();
         for (size_t i = 0; i < size; ++i) {
             ExceptionCode ec;
             segList->appendItem(m_vector[i].release(), ec);
         }
         m_vector.clear();
-        return true;
+        return result;
     }
 
 private:
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index f6e7867..d28f2e5 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -193,15 +193,27 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::dAttr || attrName == SVGNames::pathLengthAttr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (attrName == SVGNames::dAttr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::pathLengthAttr
+        || SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGPathSegList.cpp b/WebCore/svg/SVGPathSegList.cpp
index 11cad14..24bf455 100644
--- a/WebCore/svg/SVGPathSegList.cpp
+++ b/WebCore/svg/SVGPathSegList.cpp
@@ -144,40 +144,40 @@
     return pathData;
 }
     
-static inline float blendFunc(float from, float to, float progress)
+float adjustAnimatedValue(float from, float to, float progress)
 {
     return (to - from) * progress + from;
 }
     
 #define BLENDPATHSEG1(class, attr1) \
-    class::create(blendFunc(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress))
+    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress))
     
 #define BLENDPATHSEG2(class, attr1, attr2) \
-    class::create(blendFunc(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                    blendFunc(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress))
+    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
+                    adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress))
     
 #define BLENDPATHSEG4(class, attr1, attr2, attr3, attr4) \
-    class::create(blendFunc(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                blendFunc(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                blendFunc(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                blendFunc(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress))
+    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress))
     
 #define BLENDPATHSEG6(class, attr1, attr2, attr3, attr4, attr5, attr6) \
-    class::create(blendFunc(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                blendFunc(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                blendFunc(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                blendFunc(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
-                blendFunc(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
-                blendFunc(static_cast<class*>(from)->attr6(), static_cast<class*>(to)->attr6(), progress))
+    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr6(), static_cast<class*>(to)->attr6(), progress))
 
 #define BLENDPATHSEG7(class, attr1, attr2, attr3, attr4, attr5, bool1, bool2) \
-    class::create(blendFunc(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                blendFunc(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                blendFunc(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                blendFunc(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
-                blendFunc(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
-                static_cast<bool>(blendFunc(static_cast<class*>(from)->bool1(), static_cast<class*>(to)->bool1(), progress)), \
-                static_cast<bool>(blendFunc(static_cast<class*>(from)->bool2(), static_cast<class*>(to)->bool2(), progress)))
+    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
+                adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
+                static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool1(), static_cast<class*>(to)->bool1(), progress)), \
+                static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool2(), static_cast<class*>(to)->bool2(), progress)))
 
 PassRefPtr<SVGPathSegList> SVGPathSegList::createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress)
 {
diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h
index d2999f0..153e16a 100644
--- a/WebCore/svg/SVGPathSegList.h
+++ b/WebCore/svg/SVGPathSegList.h
@@ -45,6 +45,8 @@
         SVGPathSegList(const QualifiedName&);
     };
 
+    float adjustAnimatedValue(float from, float to, float progress);
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPointList.cpp b/WebCore/svg/SVGPointList.cpp
index 02a67ed..ba4c4ee 100644
--- a/WebCore/svg/SVGPointList.cpp
+++ b/WebCore/svg/SVGPointList.cpp
@@ -22,6 +22,7 @@
 
 #if ENABLE(SVG)
 #include "SVGPointList.h"
+#include "SVGPathSegList.h"
 #include "PlatformString.h"
 
 namespace WebCore {
@@ -53,6 +54,29 @@
     return result;
 }
 
+PassRefPtr<SVGPointList> SVGPointList::createAnimated(const SVGPointList* fromList, const SVGPointList* toList, float progress)
+{
+    unsigned itemCount = fromList->numberOfItems();
+    if (!itemCount || itemCount != toList->numberOfItems())
+        return 0;
+    RefPtr<SVGPointList> result = create(fromList->associatedAttributeName());
+    ExceptionCode ec = 0;
+    for (unsigned n = 0; n < itemCount; ++n) {
+        FloatPoint from = fromList->getItem(n, ec);
+        if (ec)
+            return 0;
+        FloatPoint to = toList->getItem(n, ec);
+        if (ec)
+            return 0;
+        FloatPoint segment = FloatPoint(adjustAnimatedValue(from.x(), to.x(), progress),
+                                        adjustAnimatedValue(from.y(), to.y(), progress));
+        result->appendItem(segment, ec);
+        if (ec)
+            return 0;
+    }
+    return result.release();
+}
+
 }
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPointList.h b/WebCore/svg/SVGPointList.h
index cc12366..ceb2f38 100644
--- a/WebCore/svg/SVGPointList.h
+++ b/WebCore/svg/SVGPointList.h
@@ -37,6 +37,8 @@
 
         String valueAsString() const;
 
+        static PassRefPtr<SVGPointList> createAnimated(const SVGPointList* fromList, const SVGPointList* toList, float progress);
+
     private:
         SVGPointList(const QualifiedName&);
     };
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp
index 800bdfa..371c679 100644
--- a/WebCore/svg/SVGPolyElement.cpp
+++ b/WebCore/svg/SVGPolyElement.cpp
@@ -90,15 +90,26 @@
     if (attrName == SVGNames::pointsAttr)
         setSynchronizedSVGAttributes(false);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::pointsAttr
-        || SVGTests::isKnownAttribute(attrName)
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::pointsAttr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
         || SVGLangSpace::isKnownAttribute(attrName)
-        || SVGExternalResourcesRequired::isKnownAttribute(attrName)
-        || SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp
index 014c42f..30d278a 100644
--- a/WebCore/svg/SVGRectElement.cpp
+++ b/WebCore/svg/SVGRectElement.cpp
@@ -85,17 +85,31 @@
 {
     SVGStyledTransformableElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+    if (!renderer)
         return;
 
-    if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
-        attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr ||
-        attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr ||
-        SVGTests::isKnownAttribute(attrName) ||
-        SVGLangSpace::isKnownAttribute(attrName) ||
-        SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
-        SVGStyledTransformableElement::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (attrName == SVGNames::xAttr
+        || attrName == SVGNames::yAttr
+        || attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr
+        || attrName == SVGNames::rxAttr
+        || attrName == SVGNames::ryAttr) {
+        renderer->setNeedsPathUpdate();
+        renderer->setNeedsLayout(true);
+        return;
+    }
+
+    if (SVGTests::isKnownAttribute(attrName)
+        || SVGLangSpace::isKnownAttribute(attrName)
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+        renderer->setNeedsLayout(true);
 }
 
 void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index ff24c4f..f30067c 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -199,7 +199,7 @@
         // Calling setCurrentScale() on the outermost <svg> element in a standalone SVG document
         // is allowed to change the page zoom factor, influencing the document size, scrollbars etc.
         if (parentNode() == document())
-            frame->setZoomFactor(scale, false);
+            frame->setZoomFactor(scale, ZoomPage);
         return;
     }
 
@@ -394,7 +394,8 @@
 
 void SVGSVGElement::deselectAll()
 {
-    document()->frame()->selection()->clear();
+    if (Frame* frame = document()->frame())
+        frame->selection()->clear();
 }
 
 float SVGSVGElement::createSVGNumber()
@@ -437,53 +438,37 @@
     return SVGTransform(matrix);
 }
 
-AffineTransform SVGSVGElement::getCTM() const
+AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const
 {
-    AffineTransform mat;
+    AffineTransform viewBoxTransform;
+    if (attributes()->getAttributeItem(SVGNames::viewBoxAttr))
+        viewBoxTransform = viewBoxToViewTransform(width().value(this), height().value(this));
+
+    AffineTransform transform;
     if (!isOutermostSVG())
-        mat.translate(x().value(this), y().value(this));
-
-    if (attributes()->getAttributeItem(SVGNames::viewBoxAttr)) {
-        AffineTransform viewBox = viewBoxToViewTransform(width().value(this), height().value(this));
-        mat = viewBox * mat;
-    }
-
-    return mat;
-}
-
-AffineTransform SVGSVGElement::getScreenCTM() const
-{
-    document()->updateLayoutIgnorePendingStylesheets();
-    FloatPoint rootLocation;
-
-    if (RenderObject* renderer = this->renderer()) {
-        if (isOutermostSVG()) {
+        transform.translate(x().value(this), y().value(this));
+    else if (mode == SVGLocatable::ScreenScope) {
+        if (RenderObject* renderer = this->renderer()) {
+            // Translate in our CSS parent coordinate space
             // FIXME: This doesn't work correctly with CSS transforms.
-            FloatPoint point;
-            if (renderer->parent())
-                point = renderer->localToAbsolute(point, false, true);
-            rootLocation.move(point.x(), point.y());
-        } else
-            rootLocation.move(x().value(this), y().value(this));
-    }
-    
-    AffineTransform mat = SVGStyledLocatableElement::getScreenCTM();
-    mat.translate(rootLocation.x(), rootLocation.y());
+            FloatPoint location = renderer->localToAbsolute(FloatPoint(), false, true);
 
-    if (attributes()->getAttributeItem(SVGNames::viewBoxAttr)) {
-        AffineTransform viewBox = viewBoxToViewTransform(width().value(this), height().value(this));
-        mat = viewBox * mat;
+            // Be careful here! localToAbsolute() includes the x/y offset coming from the viewBoxToViewTransform(), because
+            // RenderSVGRoot::localToBorderBoxTransform() (called through mapLocalToContainer(), called from localToAbsolute())
+            // also takes the viewBoxToViewTransform() into account, so we have to subtract it here (original cause of bug #27183)
+            transform.translate(location.x() - viewBoxTransform.e(), location.y() - viewBoxTransform.f());
+        }
     }
 
-    return mat;
+    return transform.multLeft(viewBoxTransform);
 }
 
 RenderObject* SVGSVGElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
     if (isOutermostSVG())
         return new (arena) RenderSVGRoot(this);
-    else
-        return new (arena) RenderSVGViewportContainer(this);
+
+    return new (arena) RenderSVGViewportContainer(this);
 }
 
 void SVGSVGElement::insertedIntoDocument()
diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h
index dde6534..94300bc 100644
--- a/WebCore/svg/SVGSVGElement.h
+++ b/WebCore/svg/SVGSVGElement.h
@@ -114,10 +114,6 @@
 
         virtual void parseMappedAttribute(MappedAttribute*);
 
-        // 'virtual SVGLocatable' functions
-        virtual AffineTransform getCTM() const;
-        virtual AffineTransform getScreenCTM() const;
-
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
@@ -150,6 +146,8 @@
         virtual void documentWillBecomeInactive();
         virtual void documentDidBecomeActive();
 
+        virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;
+
         bool m_useCurrentView;
         RefPtr<SMILTimeContainer> m_timeContainer;
         FloatPoint m_translation;
diff --git a/WebCore/svg/SVGScriptElement.cpp b/WebCore/svg/SVGScriptElement.cpp
index 299ab8d..a6d0f47 100644
--- a/WebCore/svg/SVGScriptElement.cpp
+++ b/WebCore/svg/SVGScriptElement.cpp
@@ -194,6 +194,11 @@
     return String();
 }
 
+String SVGScriptElement::eventAttributeValue() const
+{
+    return String();
+}
+
 void SVGScriptElement::dispatchLoadEvent()
 {
     bool externalResourcesRequired = externalResourcesRequiredBaseValue();
diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h
index 396907c..623228c 100644
--- a/WebCore/svg/SVGScriptElement.h
+++ b/WebCore/svg/SVGScriptElement.h
@@ -66,6 +66,7 @@
         virtual String typeAttributeValue() const;
         virtual String languageAttributeValue() const;
         virtual String forAttributeValue() const;
+        virtual String eventAttributeValue() const;
 
         virtual void dispatchLoadEvent();
         virtual void dispatchErrorEvent();
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index ff94c7d..22c2008 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -26,21 +26,22 @@
 #include "Attr.h"
 #include "CSSParser.h"
 #include "CSSStyleSelector.h"
-#include "CString.h"
 #include "Document.h"
 #include "HTMLNames.h"
 #include "MappedAttribute.h"
 #include "PlatformString.h"
 #include "RenderObject.h"
 #include "RenderSVGResource.h"
+#include "RenderSVGResourceClipper.h"
+#include "RenderSVGResourceFilter.h"
 #include "RenderSVGResourceMasker.h"
 #include "SVGElement.h"
 #include "SVGElementInstance.h"
 #include "SVGElementRareData.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
-#include "SVGResourceClipper.h"
-#include "SVGResourceFilter.h"
+#include "SVGRenderSupport.h"
+#include "SVGResource.h"
 #include "SVGSVGElement.h"
 #include <wtf/Assertions.h>
 
@@ -199,6 +200,14 @@
     if (attrName.matches(HTMLNames::classAttr))
         classAttributeChanged(className());
 
+    if (attrName == idAttributeName()) {
+        // Notify resources about id changes, this is important as we cache resources by id in SVGDocumentExtensions
+        if (renderer() && renderer()->isSVGResource()) {
+            RenderSVGResource* resource = renderer()->toRenderSVGResource();
+            resource->idChanged();
+        }
+    }
+
     // If we're the child of a resource element, be sure to invalidate it.
     invalidateResourcesInAncestorChain();
 
@@ -223,24 +232,12 @@
     if (!object)
         return;
 
-    const SVGRenderStyle* svgStyle = object->style()->svgStyle();
     Document* document = this->document();
 
     if (document->parsing())
         return;
 
-#if ENABLE(FILTERS)
-    SVGResourceFilter* filter = getFilterById(document, svgStyle->filter(), object);
-    if (filter)
-        filter->invalidate();
-#endif
-
-    if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(document, svgStyle->maskElement()))
-        masker->invalidateClient(object);
-
-    SVGResourceClipper* clipper = getClipperById(document, svgStyle->clipPath(), object);
-    if (clipper)
-        clipper->invalidate();
+    deregisterFromResources(object);
 }
 
 void SVGStyledElement::invalidateResourcesInAncestorChain() const
@@ -329,6 +326,13 @@
         rareSVGData()->setInstanceUpdatesBlocked(value);
 }
 
+AffineTransform SVGStyledElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope) const
+{
+    // To be overriden by SVGStyledLocatableElement/SVGStyledTransformableElement (or as special case SVGTextElement)
+    ASSERT_NOT_REACHED();
+    return AffineTransform();
+}
+
 }
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h
index 9645db4..ea19aa5 100644
--- a/WebCore/svg/SVGStyledElement.h
+++ b/WebCore/svg/SVGStyledElement.h
@@ -24,6 +24,7 @@
 #if ENABLE(SVG)
 #include "HTMLNames.h"
 #include "SVGElement.h"
+#include "SVGLocatable.h"
 #include "SVGStylable.h"
 
 namespace WebCore {
@@ -68,6 +69,8 @@
         bool instanceUpdatesBlocked() const;
         void setInstanceUpdatesBlocked(bool);
 
+        virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;
+
     protected: 
         static int cssPropertyIdForSVGAttributeName(const QualifiedName&);
 
diff --git a/WebCore/svg/SVGStyledLocatableElement.cpp b/WebCore/svg/SVGStyledLocatableElement.cpp
index 79b1fe3..7a8a2f3 100644
--- a/WebCore/svg/SVGStyledLocatableElement.cpp
+++ b/WebCore/svg/SVGStyledLocatableElement.cpp
@@ -57,12 +57,12 @@
 
 AffineTransform SVGStyledLocatableElement::getCTM() const
 {
-    return SVGLocatable::getCTM(this);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
 }
 
 AffineTransform SVGStyledLocatableElement::getScreenCTM() const
 {
-    return SVGLocatable::getScreenCTM(this);
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
 }
 
 }
diff --git a/WebCore/svg/SVGStyledLocatableElement.h b/WebCore/svg/SVGStyledLocatableElement.h
index 5e835bd..3922b15 100644
--- a/WebCore/svg/SVGStyledLocatableElement.h
+++ b/WebCore/svg/SVGStyledLocatableElement.h
@@ -43,6 +43,8 @@
         virtual FloatRect getBBox() const;
         virtual AffineTransform getCTM() const;
         virtual AffineTransform getScreenCTM() const;
+
+        virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGLocatable::localCoordinateSpaceTransform(mode); }
     };
 
 } // namespace WebCore
diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp
index a71cd16..cc92cc4 100644
--- a/WebCore/svg/SVGStyledTransformableElement.cpp
+++ b/WebCore/svg/SVGStyledTransformableElement.cpp
@@ -46,12 +46,12 @@
 
 AffineTransform SVGStyledTransformableElement::getCTM() const
 {
-    return SVGTransformable::getCTM(this);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
 }
 
 AffineTransform SVGStyledTransformableElement::getScreenCTM() const
 {
-    return SVGTransformable::getScreenCTM(this);
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
 }
 
 AffineTransform SVGStyledTransformableElement::animatedLocalTransform() const
diff --git a/WebCore/svg/SVGStyledTransformableElement.h b/WebCore/svg/SVGStyledTransformableElement.h
index ee204ad..d83c0c5 100644
--- a/WebCore/svg/SVGStyledTransformableElement.h
+++ b/WebCore/svg/SVGStyledTransformableElement.h
@@ -42,7 +42,8 @@
     virtual AffineTransform getScreenCTM() const;
     virtual SVGElement* nearestViewportElement() const;
     virtual SVGElement* farthestViewportElement() const;
-    
+
+    virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); }
     virtual AffineTransform animatedLocalTransform() const;
     virtual AffineTransform* supplementalTransform();
 
diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp
index 96fd11a..25729cf 100644
--- a/WebCore/svg/SVGTextElement.cpp
+++ b/WebCore/svg/SVGTextElement.cpp
@@ -72,14 +72,14 @@
     return SVGTransformable::getBBox(this);
 }
 
-AffineTransform SVGTextElement::getScreenCTM() const
-{
-    return SVGTransformable::getScreenCTM(this);
-}
-
 AffineTransform SVGTextElement::getCTM() const
 {
-    return SVGTransformable::getCTM(this);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
+}
+
+AffineTransform SVGTextElement::getScreenCTM() const
+{
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
 }
 
 AffineTransform SVGTextElement::animatedLocalTransform() const
@@ -114,11 +114,14 @@
 {
     SVGTextPositioningElement::svgAttributeChanged(attrName);
 
-    if (!renderer())
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
         return;
 
-    if (SVGTransformable::isKnownAttribute(attrName))
-        renderer()->setNeedsLayout(true);
+    if (SVGTransformable::isKnownAttribute(attrName)) {
+        renderer->setNeedsTransformUpdate();
+        renderer->setNeedsLayout(true);
+    }
 }
 
 void SVGTextElement::synchronizeProperty(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGTextElement.h b/WebCore/svg/SVGTextElement.h
index 4fca6bf..5e3f5d9 100644
--- a/WebCore/svg/SVGTextElement.h
+++ b/WebCore/svg/SVGTextElement.h
@@ -43,6 +43,7 @@
         virtual AffineTransform getScreenCTM() const;
         virtual AffineTransform animatedLocalTransform() const;
         virtual AffineTransform* supplementalTransform();
+        virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); }
 
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
         virtual bool childShouldCreateRenderer(Node*) const;
diff --git a/WebCore/svg/SVGTransformable.cpp b/WebCore/svg/SVGTransformable.cpp
index d710a34..51e10aa 100644
--- a/WebCore/svg/SVGTransformable.cpp
+++ b/WebCore/svg/SVGTransformable.cpp
@@ -35,7 +35,8 @@
 
 namespace WebCore {
 
-SVGTransformable::SVGTransformable() : SVGLocatable()
+SVGTransformable::SVGTransformable()
+    : SVGLocatable()
 {
 }
 
@@ -43,18 +44,6 @@
 {
 }
 
-AffineTransform SVGTransformable::getCTM(const SVGElement* element) const
-{
-    AffineTransform ctm = SVGLocatable::getCTM(element);
-    return animatedLocalTransform() * ctm;
-}
-
-AffineTransform SVGTransformable::getScreenCTM(const SVGElement* element) const
-{
-    AffineTransform ctm = SVGLocatable::getScreenCTM(element);
-    return animatedLocalTransform() * ctm;
-}
-
 static int parseTransformParamList(const UChar*& ptr, const UChar* end, float* values, int required, int optional)
 {
     int optionalParams = 0, requiredParams = 0;
diff --git a/WebCore/svg/SVGTransformable.h b/WebCore/svg/SVGTransformable.h
index 7579fa9..9906d89 100644
--- a/WebCore/svg/SVGTransformable.h
+++ b/WebCore/svg/SVGTransformable.h
@@ -46,10 +46,8 @@
     static bool parseTransformAttribute(SVGTransformList*, const AtomicString& transform);
     static bool parseTransformAttribute(SVGTransformList*, const UChar*& ptr, const UChar* end, TransformParsingMode mode = ClearList);
     static bool parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform&);
-    
-    AffineTransform getCTM(const SVGElement*) const;
-    AffineTransform getScreenCTM(const SVGElement*) const;
-    
+
+    virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const { return animatedLocalTransform(); }
     virtual AffineTransform animatedLocalTransform() const = 0;
 
     bool isKnownAttribute(const QualifiedName&);
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 2ce1bd1..324d849 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -25,7 +25,6 @@
 #include "SVGUseElement.h"
 
 #include "CSSStyleSelector.h"
-#include "CString.h"
 #include "Document.h"
 #include "Event.h"
 #include "EventListener.h"
@@ -166,12 +165,16 @@
         return;
     }
 
+    if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        renderer()->setNeedsTransformUpdate();
+        renderer()->setNeedsLayout(true);
+        return;
+    }
+
     if (SVGTests::isKnownAttribute(attrName)
         || SVGLangSpace::isKnownAttribute(attrName)
-        || SVGExternalResourcesRequired::isKnownAttribute(attrName)
-        || SVGStyledTransformableElement::isKnownAttribute(attrName)) {
+        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
         invalidateShadowTree();
-    }
 }
 
 void SVGUseElement::synchronizeProperty(const QualifiedName& attrName)
@@ -414,7 +417,7 @@
     ASSERT(!m_targetElementInstance);
 
     if (!targetElement) {
-        if (m_isPendingResource)
+        if (m_isPendingResource || id.isEmpty())
             return;
 
         m_isPendingResource = true;
@@ -434,7 +437,12 @@
 {
     String id = SVGURIReference::getTarget(href());
     Element* targetElement = document()->getElementById(id);
-    ASSERT(targetElement);
+    if (!targetElement) {
+        // The only time we should get here is when the use element has not been
+        // given a resource to target.
+        ASSERT(m_resourceId.isEmpty());
+        return;
+    }
 
     // Do not build the shadow/instance tree for <use> elements living in a shadow tree.
     // The will be expanded soon anyway - see expandUseElementsInShadowTree().
@@ -592,13 +600,29 @@
         if (!isDirectReference(n))
             // Spec: Indirect references are an error (14.3.5)
             document()->accessSVGExtensions()->reportError("Not allowed to use indirect reference in <clip-path>");
-        else
-            return static_cast<SVGStyledTransformableElement*>(n)->toClipPath();
+        else {
+            Path clipPath = static_cast<SVGStyledTransformableElement*>(n)->toClipPath();
+            clipPath.translate(FloatSize(x().value(this), y().value(this)));
+            clipPath.transform(animatedLocalTransform());
+            return clipPath;
+        }
     }
 
     return Path();
 }
 
+RenderObject* SVGUseElement::rendererClipChild() const
+{
+    Node* n = m_targetElementInstance ? m_targetElementInstance->shadowTreeElement() : 0;
+    if (!n)
+        return 0;
+
+    if (n->isSVGElement() && isDirectReference(n))
+        return static_cast<SVGElement*>(n)->renderer();
+
+    return 0;
+}
+
 void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundProblem)
 {
     ASSERT(target);
@@ -736,27 +760,15 @@
             target = static_cast<SVGElement*>(targetElement);
 
         // Don't ASSERT(target) here, it may be "pending", too.
-        if (target) {
-            // Setup sub-shadow tree root node
-            RefPtr<SVGShadowTreeContainerElement> cloneParent = new SVGShadowTreeContainerElement(document());
+        // Setup sub-shadow tree root node
+        RefPtr<SVGShadowTreeContainerElement> cloneParent = new SVGShadowTreeContainerElement(document());
 
-            // Spec: In the generated content, the 'use' will be replaced by 'g', where all attributes from the
-            // 'use' element except for x, y, width, height and xlink:href are transferred to the generated 'g' element.
-            transferUseAttributesToReplacedElement(use, cloneParent.get());
+        // Spec: In the generated content, the 'use' will be replaced by 'g', where all attributes from the
+        // 'use' element except for x, y, width, height and xlink:href are transferred to the generated 'g' element.
+        transferUseAttributesToReplacedElement(use, cloneParent.get());
 
-            ExceptionCode ec = 0;
-
-            // For instance <use> on <foreignObject> (direct case).
-            if (isDisallowedElement(target)) {
-                // We still have to setup the <use> replacment (<g>). Otherwhise
-                // associateInstancesWithShadowTreeElements() makes wrong assumptions.
-                // Replace <use> with referenced content.
-                ASSERT(use->parentNode()); 
-                use->parentNode()->replaceChild(cloneParent.release(), use, ec);
-                ASSERT(!ec);
-                return;
-            }
-
+        ExceptionCode ec = 0;
+        if (target && !isDisallowedElement(target)) {
             RefPtr<Element> newChild = target->cloneElementWithChildren();
 
             // We don't walk the target tree element-by-element, and clone each element,
@@ -774,16 +786,16 @@
 
             cloneParent->appendChild(newChild.release(), ec);
             ASSERT(!ec);
-
-            // Replace <use> with referenced content.
-            ASSERT(use->parentNode()); 
-            use->parentNode()->replaceChild(cloneParent.release(), use, ec);
-            ASSERT(!ec);
-
-            // Immediately stop here, and restart expanding.
-            expandUseElementsInShadowTree(shadowRoot, shadowRoot);
-            return;
         }
+
+        // Replace <use> with referenced content.
+        ASSERT(use->parentNode()); 
+        use->parentNode()->replaceChild(cloneParent.release(), use, ec);
+        ASSERT(!ec);
+
+        // Immediately stop here, and restart expanding.
+        expandUseElementsInShadowTree(shadowRoot, shadowRoot);
+        return;
     }
 
     for (RefPtr<Node> child = element->firstChild(); child; child = child->nextSibling())
diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h
index 6fb3925..5519274 100644
--- a/WebCore/svg/SVGUseElement.h
+++ b/WebCore/svg/SVGUseElement.h
@@ -62,6 +62,7 @@
         virtual void detach();
 
         virtual Path toClipPath() const;
+        RenderObject* rendererClipChild() const;
 
         static void removeDisallowedElementsFromSubtree(Node* element);
         SVGElementInstance* instanceForShadowTreeElement(Node* element) const;
diff --git a/WebCore/svg/animation/SVGSMILElement.cpp b/WebCore/svg/animation/SVGSMILElement.cpp
index 3957b81..2bd33dd 100644
--- a/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/WebCore/svg/animation/SVGSMILElement.cpp
@@ -56,9 +56,9 @@
     
 class ConditionEventListener : public EventListener {
 public:
-    static PassRefPtr<ConditionEventListener> create(SVGSMILElement* animation, Element* eventBase, SVGSMILElement::Condition* condition)
+    static PassRefPtr<ConditionEventListener> create(SVGSMILElement* animation, SVGSMILElement::Condition* condition)
     {
-        return adoptRef(new ConditionEventListener(animation, eventBase, condition));
+        return adoptRef(new ConditionEventListener(animation, condition));
     }
 
     static const ConditionEventListener* cast(const EventListener* listener)
@@ -69,42 +69,38 @@
     }
 
     virtual bool operator==(const EventListener& other);
-
-    void unregister()
+    
+    void disconnectAnimation()
     {
-        // If this has only one ref then the event base is dead already and we don't need to remove ourself.
-        if (!hasOneRef())
-            m_eventBase->removeEventListener(m_condition->m_name, this, false);
+        m_animation = 0;
     }
 
 private:
-    ConditionEventListener(SVGSMILElement* animation, Element* eventBase, SVGSMILElement::Condition* condition) 
+    ConditionEventListener(SVGSMILElement* animation, SVGSMILElement::Condition* condition) 
         : EventListener(ConditionEventListenerType)
         , m_animation(animation)
         , m_condition(condition) 
-        , m_eventBase(eventBase)
     {
-        m_eventBase->addEventListener(m_condition->m_name, this, false);
     }
 
     virtual void handleEvent(ScriptExecutionContext*, Event*);
 
     SVGSMILElement* m_animation;
     SVGSMILElement::Condition* m_condition;
-    Element* m_eventBase;
 };
 
 bool ConditionEventListener::operator==(const EventListener& listener)
 {
     if (const ConditionEventListener* conditionEventListener = ConditionEventListener::cast(&listener))
-        return m_animation == conditionEventListener->m_animation
-               && m_condition == conditionEventListener->m_condition
-               && m_eventBase == conditionEventListener->m_eventBase;
+        return m_animation == conditionEventListener->m_animation &&
+               m_condition == conditionEventListener->m_condition;
     return false;
 }
 
 void ConditionEventListener::handleEvent(ScriptExecutionContext*, Event* event) 
 {
+    if (!m_animation)
+        return;
     m_animation->handleConditionEvent(event, m_condition);
 }
 
@@ -394,6 +390,11 @@
     }
 }
 
+inline Element* SVGSMILElement::eventBaseFor(const Condition& condition) const
+{
+    return condition.m_baseID.isEmpty() ? targetElement() : document()->getElementById(condition.m_baseID);
+}
+
 void SVGSMILElement::connectConditions()
 {
     if (m_conditionsConnected)
@@ -403,11 +404,12 @@
         Condition& condition = m_conditions[n];
         if (condition.m_type == Condition::EventBase) {
             ASSERT(!condition.m_syncbase);
-            Element* eventBase = condition.m_baseID.isEmpty() ? targetElement() : document()->getElementById(condition.m_baseID);
+            Element* eventBase = eventBaseFor(condition);
             if (!eventBase)
                 continue;
             ASSERT(!condition.m_eventListener);
-            condition.m_eventListener = ConditionEventListener::create(this, eventBase, &condition);
+            condition.m_eventListener = ConditionEventListener::create(this, &condition);
+            eventBase->addEventListener(condition.m_name, condition.m_eventListener, false);
         } else if (condition.m_type == Condition::Syncbase) {
             ASSERT(!condition.m_baseID.isEmpty());
             condition.m_syncbase = document()->getElementById(condition.m_baseID);
@@ -430,10 +432,18 @@
         Condition& condition = m_conditions[n];
         if (condition.m_type == Condition::EventBase) {
             ASSERT(!condition.m_syncbase);
-            if (condition.m_eventListener) {
-                condition.m_eventListener->unregister();
-                condition.m_eventListener = 0;
-            }
+            if (!condition.m_eventListener)
+                continue;
+            // Note: It's a memory optimization to try to remove our condition
+            // event listener, but it's not guaranteed to work, since we have
+            // no guarantee that eventBaseFor() will be able to find our condition's
+            // original eventBase. So, we also have to disconnect ourselves from
+            // our condition event listener, in case it later fires.
+            Element* eventBase = eventBaseFor(condition);
+            if (eventBase)
+                eventBase->removeEventListener(condition.m_name, condition.m_eventListener.get(), false);
+            condition.m_eventListener->disconnectAnimation();
+            condition.m_eventListener = 0;
         } else if (condition.m_type == Condition::Syncbase) {
             if (condition.m_syncbase) {
                 ASSERT(isSMILElement(condition.m_syncbase.get()));
diff --git a/WebCore/svg/animation/SVGSMILElement.h b/WebCore/svg/animation/SVGSMILElement.h
index b61f20d..8fcc2fc 100644
--- a/WebCore/svg/animation/SVGSMILElement.h
+++ b/WebCore/svg/animation/SVGSMILElement.h
@@ -133,7 +133,8 @@
         };
         bool parseCondition(const String&, BeginOrEnd beginOrEnd);
         void parseBeginOrEnd(const String&, BeginOrEnd beginOrEnd);
-        
+        Element* eventBaseFor(const Condition&) const;
+
         void connectConditions();
         void disconnectConditions();
         
diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index febfce8..11d3f60 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -70,7 +70,7 @@
         m_image = 0;
     }
 
-    virtual void repaint(const IntRect& r, bool, bool, bool)
+    virtual void invalidateContentsAndWindow(const IntRect& r, bool)
     {
         if (m_image && m_image->imageObserver())
             m_image->imageObserver()->changedInRect(m_image, r);
@@ -247,6 +247,7 @@
         // The comment said that the Cache code does not know about CachedImages
         // holding Frames and won't know to break the cycle. But 
         m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient, 0, 0));
+        m_page->settings()->setMediaEnabled(false);
         m_page->settings()->setJavaScriptEnabled(false);
         m_page->settings()->setPluginsEnabled(false);
 
@@ -255,13 +256,14 @@
         frame->init();
         ResourceRequest fakeRequest(KURL(ParsedURLString, ""));
         FrameLoader* loader = frame->loader();
+        loader->setForcedSandboxFlags(SandboxAll);
         loader->load(fakeRequest, false); // Make sure the DocumentLoader is created
         loader->policyChecker()->cancelCheck(); // cancel any policy checks
         loader->commitProvisionalLoad(0);
-        loader->setResponseMIMEType("image/svg+xml");
-        loader->begin(KURL()); // create the empty document
-        loader->write(data()->data(), data()->size());
-        loader->end();
+        loader->writer()->setMIMEType("image/svg+xml");
+        loader->writer()->begin(KURL()); // create the empty document
+        loader->writer()->addData(data()->data(), data()->size());
+        loader->writer()->end();
         frame->view()->setTransparent(true); // SVG Images are transparent.
     }
 
diff --git a/WebCore/svg/graphics/SVGPaintServer.cpp b/WebCore/svg/graphics/SVGPaintServer.cpp
index fdb6581..5d1ebf9 100644
--- a/WebCore/svg/graphics/SVGPaintServer.cpp
+++ b/WebCore/svg/graphics/SVGPaintServer.cpp
@@ -79,7 +79,7 @@
         return 0;
 
     SVGPaint* fill = style->svgStyle()->fillPaint();
-
+        
     SVGPaintServer* fillPaintServer = 0;
     SVGPaint::SVGPaintType paintType = fill->paintType();
     if (paintType == SVGPaint::SVG_PAINTTYPE_URI ||
@@ -98,10 +98,29 @@
     if (paintType != SVGPaint::SVG_PAINTTYPE_URI && !fillPaintServer) {
         fillPaintServer = sharedSolidPaintServer();
         SVGPaintServerSolid* fillPaintServerSolid = static_cast<SVGPaintServerSolid*>(fillPaintServer);
+        
+        Color fillColor;
         if (paintType == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
-            fillPaintServerSolid->setColor(style->color());
+            fillColor = style->color();
         else
-            fillPaintServerSolid->setColor(fill->color());
+            fillColor = fill->color();
+
+        if (style->insideLink() == InsideVisitedLink) {
+            RenderStyle* visitedStyle = style->getCachedPseudoStyle(VISITED_LINK);
+            SVGPaint* visitedFill = visitedStyle->svgStyle()->fillPaint();
+            Color visitedFillColor;
+            if (visitedFill->paintType() != SVGPaint::SVG_PAINTTYPE_URI) {
+                if (visitedFill->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
+                    visitedFillColor = visitedStyle->color();
+                else
+                    visitedFillColor = visitedFill->color();
+                if (visitedFillColor.isValid())
+                    fillColor = Color(visitedFillColor.red(), visitedFillColor.green(), visitedFillColor.blue(), fillColor.alpha());
+            }
+        }
+
+        fillPaintServerSolid->setColor(fillColor);
+        
         // FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
         if (!fillPaintServerSolid->color().isValid())
             fillPaintServer = 0;
@@ -123,8 +142,10 @@
 
     SVGPaintServer* strokePaintServer = 0;
     SVGPaint::SVGPaintType paintType = stroke->paintType();
-    if (paintType == SVGPaint::SVG_PAINTTYPE_URI ||
-        paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) {
+    if ((paintType == SVGPaint::SVG_PAINTTYPE_URI
+        || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)
+        && item->objectBoundingBox().width() != 0
+        && item->objectBoundingBox().height() != 0) {
         AtomicString id(SVGURIReference::getTarget(stroke->uri()));
         strokePaintServer = getPaintServerById(item->document(), id, item);
 
@@ -139,14 +160,38 @@
     if (paintType != SVGPaint::SVG_PAINTTYPE_URI && !strokePaintServer) {
         strokePaintServer = sharedSolidPaintServer();
         SVGPaintServerSolid* strokePaintServerSolid = static_cast<SVGPaintServerSolid*>(strokePaintServer);
+        
+        Color strokeColor;
         if (paintType == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
-            strokePaintServerSolid->setColor(style->color());
+            strokeColor = style->color();
         else
-            strokePaintServerSolid->setColor(stroke->color());
+            strokeColor = stroke->color();
+
+        if (style->insideLink() == InsideVisitedLink) {
+            RenderStyle* visitedStyle = style->getCachedPseudoStyle(VISITED_LINK);
+            SVGPaint* visitedStroke = visitedStyle->svgStyle()->strokePaint();
+            Color visitedStrokeColor;
+            if (visitedStroke->paintType() != SVGPaint::SVG_PAINTTYPE_URI) {
+                if (visitedStroke->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
+                    visitedStrokeColor = visitedStyle->color();
+                else
+                    visitedStrokeColor = visitedStroke->color();
+                if (visitedStrokeColor.isValid())
+                    strokeColor = Color(visitedStrokeColor.red(), visitedStrokeColor.green(), visitedStrokeColor.blue(), strokeColor.alpha());
+            }
+        }
+
+        strokePaintServerSolid->setColor(strokeColor);
+
         // FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
         if (!strokePaintServerSolid->color().isValid())
             strokePaintServer = 0;
     }
+    if (!strokePaintServer) {
+        // default value (black), see bug 11017
+        strokePaintServer = sharedSolidPaintServer();
+        static_cast<SVGPaintServerSolid*>(strokePaintServer)->setColor(Color::black);
+    }
 
     return strokePaintServer;
 }
diff --git a/WebCore/svg/graphics/SVGPaintServerGradient.cpp b/WebCore/svg/graphics/SVGPaintServerGradient.cpp
index c4ed95b..6e6ebfc 100644
--- a/WebCore/svg/graphics/SVGPaintServerGradient.cpp
+++ b/WebCore/svg/graphics/SVGPaintServerGradient.cpp
@@ -117,16 +117,6 @@
 }
 
 #if PLATFORM(CG)
-static inline const RenderObject* findTextRootObject(const RenderObject* start)
-{
-    while (start && !start->isSVGText())
-        start = start->parent();
-    ASSERT(start);
-    ASSERT(start->isSVGText());
-
-    return start;
-}
-
 static inline AffineTransform absoluteTransformForRenderer(const RenderObject* object)
 {
     AffineTransform absoluteTransform;
@@ -233,13 +223,6 @@
     if (boundingBoxMode()) {
 #endif
         FloatRect bbox = object->objectBoundingBox();
-        // Don't use gradients for 1d objects like horizontal/vertical 
-        // lines or rectangles without width or height.
-        if (bbox.width() == 0 || bbox.height() == 0) {
-            Color color(0, 0, 0);
-            context->setStrokeColor(color, style->colorSpace());
-            return true;
-        }
         matrix.translate(bbox.x(), bbox.y());
         matrix.scaleNonUniform(bbox.width(), bbox.height());
     }
diff --git a/WebCore/svg/graphics/SVGResource.cpp b/WebCore/svg/graphics/SVGResource.cpp
index a071996..d1dd0e7 100644
--- a/WebCore/svg/graphics/SVGResource.cpp
+++ b/WebCore/svg/graphics/SVGResource.cpp
@@ -50,7 +50,6 @@
     resourceSet().add(this);
 }
 
-
 SVGResource::~SVGResource()
 {
     ASSERT(resourceSet().contains(this));
diff --git a/WebCore/svg/graphics/SVGResource.h b/WebCore/svg/graphics/SVGResource.h
index b231b89..319add7 100644
--- a/WebCore/svg/graphics/SVGResource.h
+++ b/WebCore/svg/graphics/SVGResource.h
@@ -37,64 +37,54 @@
 
 namespace WebCore {
 
-    class AtomicString; 
-    class Document;
-    class SVGStyledElement;
-    class TextStream;
+class AtomicString; 
+class Document;
+class SVGStyledElement;
+class TextStream;
 
-    enum SVGResourceType {
-        // Painting mode
-        ClipperResourceType = 0,
-        ImageResourceType,
-        FilterResourceType,
-        MarkerResourceType,
-        PaintServerResourceType,
-        
-        // For resource tracking we need to know how many types of resource there are
-        _ResourceTypeCount
-    };
-
-    // The SVGResource file represent various graphics resources:
-    // - Filter resource
-    // - Clipper resource
-    // - Masker resource
-    // - Marker resource
-    // - Pattern resource
-    // - Linear/Radial gradient resource
-    //
-    // SVG creates/uses these resources.
-
-    class SVGResource : public RefCounted<SVGResource> {
-    public:
-        virtual ~SVGResource();
-      
-        virtual void invalidate();
-
-        void addClient(SVGStyledElement*);
-        virtual SVGResourceType resourceType() const = 0;
-        
-        bool isPaintServer() const { return resourceType() == PaintServerResourceType; }
-        bool isFilter() const { return resourceType() == FilterResourceType; }
-        bool isClipper() const { return resourceType() == ClipperResourceType; }
-        bool isMarker() const { return resourceType() == MarkerResourceType; }
-
-        virtual TextStream& externalRepresentation(TextStream&) const;
-
-        static void invalidateClients(HashSet<SVGStyledElement*>);
-        static void removeClient(SVGStyledElement*);
-
-    protected:
-        SVGResource();
-
-    private:
-        HashSet<SVGStyledElement*> m_clients;
-    };
-
-    SVGResource* getResourceById(Document*, const AtomicString&, const RenderObject*);
+enum SVGResourceType {
+    // Painting mode
+    ImageResourceType,
+    PaintServerResourceType,
     
-    TextStream& operator<<(TextStream&, const SVGResource&);
+    // For resource tracking we need to know how many types of resource there are
+    _ResourceTypeCount
+};
 
-} // namespace WebCore
+// The SVGResource file represent various graphics resources:
+// - Pattern resource
+// - Linear/Radial gradient resource
+//
+// SVG creates/uses these resources.
+
+class SVGResource : public RefCounted<SVGResource> {
+public:
+    virtual ~SVGResource();
+  
+    virtual void invalidate();
+
+    void addClient(SVGStyledElement*);
+    virtual SVGResourceType resourceType() const = 0;
+    
+    bool isPaintServer() const { return resourceType() == PaintServerResourceType; }
+
+    virtual TextStream& externalRepresentation(TextStream&) const;
+
+    static void invalidateClients(HashSet<SVGStyledElement*>);
+    static void removeClient(SVGStyledElement*);
+
+protected:
+    SVGResource();
+
+private:
+    HashSet<SVGStyledElement*> m_clients;
+};
+
+SVGResource* getResourceById(Document*, const AtomicString&, const RenderObject*);
+
+TextStream& operator<<(TextStream&, const SVGResource&);
+
+}
 
 #endif
-#endif // SVGResource_h
+#endif
diff --git a/WebCore/svg/graphics/SVGResourceClipper.cpp b/WebCore/svg/graphics/SVGResourceClipper.cpp
deleted file mode 100644
index 5316c95..0000000
--- a/WebCore/svg/graphics/SVGResourceClipper.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *           (C) 2009 Dirk Schulze <krit@webkit.org>
- *
- * 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 COMPUTER, 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"
-
-#if ENABLE(SVG)
-#include "SVGResourceClipper.h"
-
-#include "AffineTransform.h"
-#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
-
-#if PLATFORM(CG)
-#include <ApplicationServices/ApplicationServices.h>
-#endif
-
-namespace WebCore {
-
-SVGResourceClipper::SVGResourceClipper()
-    : SVGResource()
-{
-}
-
-SVGResourceClipper::~SVGResourceClipper()
-{
-}
-
-void SVGResourceClipper::resetClipData()
-{
-    m_clipData.clear();
-    m_clipperBoundingBox = FloatRect();
-}
-
-void SVGResourceClipper::invalidate()
-{
-    SVGResource::invalidate();
-    resetClipData();
-}
-
-FloatRect SVGResourceClipper::clipperBoundingBox(const FloatRect& objectBoundingBox)
-{
-    // FIXME: We need a different calculation for other clip content than paths.
-    if (!m_clipperBoundingBox.isEmpty())
-        return m_clipperBoundingBox;
-
-    if (m_clipData.clipData().isEmpty())
-        return FloatRect();
-
-    for (unsigned x = 0; x < m_clipData.clipData().size(); x++) {
-        ClipData clipData = m_clipData.clipData()[x];
-
-        FloatRect clipPathRect = clipData.path.boundingRect();
-        if (clipData.bboxUnits) {
-            clipPathRect.scale(objectBoundingBox.width(), objectBoundingBox.height());
-            clipPathRect.move(objectBoundingBox.x(), objectBoundingBox.y());
-        }
-        m_clipperBoundingBox.unite(clipPathRect);
-    }
-
-    return m_clipperBoundingBox;
-}
-
-void SVGResourceClipper::applyClip(GraphicsContext* context, const FloatRect& boundingBox) const
-{
-    if (m_clipData.clipData().isEmpty())
-        return;
-
-    bool heterogenousClipRules = false;
-    WindRule clipRule = m_clipData.clipData()[0].windRule;
-
-    context->beginPath();
-
-    for (unsigned x = 0; x < m_clipData.clipData().size(); x++) {
-        ClipData clipData = m_clipData.clipData()[x];
-        if (clipData.windRule != clipRule)
-            heterogenousClipRules = true;
-        
-        Path clipPath = clipData.path;
-
-        if (clipData.bboxUnits) {
-            AffineTransform transform;
-            transform.translate(boundingBox.x(), boundingBox.y());
-            transform.scaleNonUniform(boundingBox.width(), boundingBox.height());
-            clipPath.transform(transform);
-        }
-        context->addPath(clipPath);
-    }
-
-    // FIXME!
-    // We don't currently allow for heterogenous clip rules.
-    // we would have to detect such, draw to a mask, and then clip
-    // to that mask
-    context->clipPath(clipRule);
-}
-
-void SVGResourceClipper::addClipData(const Path& path, WindRule rule, bool bboxUnits)
-{
-    m_clipData.addPath(path, rule, bboxUnits);
-}
-
-const ClipDataList& SVGResourceClipper::clipData() const
-{
-    return m_clipData;
-}
-
-TextStream& SVGResourceClipper::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=CLIPPER]";
-    ts << " [clip data=" << clipData().clipData() << "]";
-    return ts;
-}
-
-TextStream& operator<<(TextStream& ts, WindRule rule)
-{
-    switch (rule) {
-        case RULE_NONZERO:
-            ts << "NON-ZERO"; break;
-        case RULE_EVENODD:
-            ts << "EVEN-ODD"; break;
-    }
-
-    return ts;
-}
-
-TextStream& operator<<(TextStream& ts, const ClipData& d)
-{
-    ts << "[winding=" << d.windRule << "]";
-
-    if (d.bboxUnits)
-        ts << " [bounding box mode=" << d.bboxUnits << "]";
-
-    ts << " [path=" << d.path.debugString() << "]";
-    return ts;
-}
-
-SVGResourceClipper* getClipperById(Document* document, const AtomicString& id, const RenderObject* object)
-{
-    SVGResource* resource = getResourceById(document, id, object);
-    if (resource && resource->isClipper())
-        return static_cast<SVGResourceClipper*>(resource);
-
-    return 0;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/svg/graphics/SVGResourceClipper.h b/WebCore/svg/graphics/SVGResourceClipper.h
deleted file mode 100644
index df5562d..0000000
--- a/WebCore/svg/graphics/SVGResourceClipper.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * 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 COMPUTER, 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 SVGResourceClipper_h
-#define SVGResourceClipper_h
-
-#if ENABLE(SVG)
-#include "FloatRect.h"
-#include "Path.h"
-#include "RenderObject.h"
-#include "SVGResource.h"
-
-namespace WebCore {
-
-    struct ClipData {
-        Path path;
-        WindRule windRule;
-        bool bboxUnits : 1;
-    };
-
-    class ClipDataList { 
-    public:
-        void addPath(const Path& pathData, WindRule windRule, bool bboxUnits)
-        {
-            ClipData clipData;
-            
-            clipData.path = pathData;
-            clipData.windRule = windRule;
-            clipData.bboxUnits = bboxUnits;
-            
-            m_clipData.append(clipData);
-        }
-        
-        void clear() { m_clipData.clear(); }
-        const Vector<ClipData>& clipData() const { return m_clipData; }
-        bool isEmpty() const { return m_clipData.isEmpty(); }
-    private:
-        Vector<ClipData> m_clipData;
-    };  
-
-    class GraphicsContext;
-
-    class SVGResourceClipper : public SVGResource {
-    public:
-        static PassRefPtr<SVGResourceClipper> create() { return adoptRef(new SVGResourceClipper); }
-        virtual ~SVGResourceClipper();
-
-        virtual void invalidate();
-
-        void resetClipData();
-        void addClipData(const Path&, WindRule, bool bboxUnits);
-
-        const ClipDataList& clipData() const;
-        
-        virtual SVGResourceType resourceType() const { return ClipperResourceType; }
-        virtual TextStream& externalRepresentation(TextStream&) const;
-
-        // To be implemented by the specific rendering devices
-        void applyClip(GraphicsContext*, const FloatRect& boundingBox) const;
-        FloatRect clipperBoundingBox(const FloatRect& oob);
-    private:
-        SVGResourceClipper();
-        ClipDataList m_clipData;
-        FloatRect m_clipperBoundingBox;
-    };
-
-    TextStream& operator<<(TextStream&, WindRule);
-    TextStream& operator<<(TextStream&, const ClipData&);
-
-    SVGResourceClipper* getClipperById(Document*, const AtomicString&, const RenderObject*);
-
-} // namespace WebCore
-
-#endif
-
-#endif // SVGResourceClipper_h
diff --git a/WebCore/svg/graphics/SVGResourceFilter.cpp b/WebCore/svg/graphics/SVGResourceFilter.cpp
deleted file mode 100644
index 72ae203..0000000
--- a/WebCore/svg/graphics/SVGResourceFilter.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-    Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-                  2005 Eric Seidel <eric@webkit.org>
-                  2009 Dirk Schulze <krit@webkit.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
-    aint 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGResourceFilter.h"
-
-#include "FilterEffect.h"
-#include "GraphicsContext.h"
-#include "ImageBuffer.h"
-#include "PlatformString.h"
-#include "SVGFilter.h"
-#include "SVGFilterBuilder.h"
-#include "SVGFilterElement.h"
-#include "SVGRenderSupport.h"
-#include "SVGRenderTreeAsText.h"
-#include "SVGFilterPrimitiveStandardAttributes.h"
-
-static const float kMaxFilterSize = 5000.0f;
-
-using std::min;
-
-namespace WebCore {
-
-SVGResourceFilter::SVGResourceFilter(const SVGFilterElement* ownerElement)
-    : SVGResource()
-    , m_ownerElement(ownerElement)
-    , m_filterBBoxMode(false)
-    , m_effectBBoxMode(false)
-    , m_filterRes(false)
-    , m_scaleX(1.f)
-    , m_scaleY(1.f)
-    , m_savedContext(0)
-    , m_sourceGraphicBuffer(0)
-{
-    m_filterBuilder.set(new SVGFilterBuilder());    
-}
-
-SVGResourceFilter::~SVGResourceFilter()
-{
-}
-
-FloatRect SVGResourceFilter::filterBoundingBox(const FloatRect& obb) const
-{
-    return m_ownerElement->filterBoundingBox(obb);
-}
-
-static inline bool shouldProcessFilter(SVGResourceFilter* filter, const FloatRect& filterRect)
-{
-    return (!filter->scaleX() || !filter->scaleY() || !filterRect.width() || !filterRect.height());
-}
-
-void SVGResourceFilter::addFilterEffect(SVGFilterPrimitiveStandardAttributes* effectAttributes, PassRefPtr<FilterEffect> effect)
-{
-    effectAttributes->setStandardAttributes(this, effect.get());
-    builder()->add(effectAttributes->result(), effect);
-}
-
-bool SVGResourceFilter::fitsInMaximumImageSize(const FloatSize& size)
-{
-    bool matchesFilterSize = true;
-    if (size.width() > kMaxFilterSize) {
-        m_scaleX *= kMaxFilterSize / size.width();
-        matchesFilterSize = false;
-    }
-    if (size.height() > kMaxFilterSize) {
-        m_scaleY *= kMaxFilterSize / size.height();
-        matchesFilterSize = false;
-    }
-
-    return matchesFilterSize;
-}
-
-bool SVGResourceFilter::prepareFilter(GraphicsContext*& context, const RenderObject* object)
-{
-    m_ownerElement->buildFilter(object->objectBoundingBox());
-    const SVGRenderBase* renderer = object->toSVGRenderBase();
-    if (!renderer)
-        return false;
-
-    FloatRect paintRect = renderer->strokeBoundingBox();
-    paintRect.unite(renderer->markerBoundingBox());
-
-    if (shouldProcessFilter(this, m_filterBBox))
-        return false;
-
-    // clip sourceImage to filterRegion
-    FloatRect clippedSourceRect = paintRect;
-    clippedSourceRect.intersect(m_filterBBox);
-
-    // scale filter size to filterRes
-    FloatRect tempSourceRect = clippedSourceRect;
-    if (m_filterRes) {
-        m_scaleX = m_filterResSize.width() / m_filterBBox.width();
-        m_scaleY = m_filterResSize.height() / m_filterBBox.height();
-    }
-
-    // scale to big sourceImage size to kMaxFilterSize
-    tempSourceRect.scale(m_scaleX, m_scaleY);
-    fitsInMaximumImageSize(tempSourceRect.size());
-
-    // prepare Filters
-    m_filter = SVGFilter::create(paintRect, m_filterBBox, m_effectBBoxMode);
-    m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY));
-
-    FilterEffect* lastEffect = m_filterBuilder->lastEffect();
-    if (lastEffect) {
-        lastEffect->calculateEffectRect(m_filter.get());
-        // at least one FilterEffect has a too big image size,
-        // recalculate the effect sizes with new scale factors
-        if (!fitsInMaximumImageSize(m_filter->maxImageSize())) {
-            m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY));
-            lastEffect->calculateEffectRect(m_filter.get());
-        }
-    } else
-        return false;
-
-    clippedSourceRect.scale(m_scaleX, m_scaleY);
-
-    // Draw the content of the current element and it's childs to a imageBuffer to get the SourceGraphic.
-    // The size of the SourceGraphic is clipped to the size of the filterRegion.
-    IntRect bufferRect = enclosingIntRect(clippedSourceRect);
-    OwnPtr<ImageBuffer> sourceGraphic(ImageBuffer::create(bufferRect.size(), LinearRGB));
-    
-    if (!sourceGraphic.get())
-        return false;
-
-    GraphicsContext* sourceGraphicContext = sourceGraphic->context();
-    sourceGraphicContext->translate(-clippedSourceRect.x(), -clippedSourceRect.y());
-    sourceGraphicContext->scale(FloatSize(m_scaleX, m_scaleY));
-    sourceGraphicContext->clearRect(FloatRect(FloatPoint(), paintRect.size()));
-    m_sourceGraphicBuffer.set(sourceGraphic.release());
-    m_savedContext = context;
-
-    context = sourceGraphicContext;
-    return true;
-}
-
-void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObject* object)
-{
-    if (!m_savedContext)
-        return;
-
-    context = m_savedContext;
-    m_savedContext = 0;
-#if !PLATFORM(CG)
-    m_sourceGraphicBuffer->transformColorSpace(DeviceRGB, LinearRGB);
-#endif
-
-    FilterEffect* lastEffect = m_filterBuilder->lastEffect();
-
-    if (lastEffect && !m_filterBBox.isEmpty() && !lastEffect->subRegion().isEmpty()) {
-        m_filter->setSourceImage(m_sourceGraphicBuffer.release());
-        lastEffect->apply(m_filter.get());
-
-        ImageBuffer* resultImage = lastEffect->resultImage();
-        if (resultImage) {
-#if !PLATFORM(CG)
-            resultImage->transformColorSpace(LinearRGB, DeviceRGB);
-#endif
-            ColorSpace colorSpace = DeviceColorSpace;
-            if (object)
-                colorSpace = object->style()->colorSpace();
-            context->drawImage(resultImage->image(), colorSpace, lastEffect->subRegion());
-        }
-    }
-
-    m_sourceGraphicBuffer.clear();
-}
-
-TextStream& SVGResourceFilter::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=FILTER] ";
-
-    FloatRect bbox = filterRect();
-    static FloatRect defaultFilterRect(0, 0, 1, 1);
-
-    if (!filterBoundingBoxMode() || bbox != defaultFilterRect) {
-        ts << " [bounding box=";
-        if (filterBoundingBoxMode()) {
-            bbox.scale(100.f);
-            ts << "at (" << bbox.x() << "%," <<  bbox.y() << "%) size " << bbox.width() << "%x" << bbox.height() << "%";
-        } else
-            ts << filterRect();
-        ts << "]";
-    }
-
-    if (!filterBoundingBoxMode()) // default is true
-        ts << " [bounding box mode=" << filterBoundingBoxMode() << "]";
-    if (effectBoundingBoxMode()) // default is false
-        ts << " [effect bounding box mode=" << effectBoundingBoxMode() << "]";
-
-    return ts;
-}
-
-SVGResourceFilter* getFilterById(Document* document, const AtomicString& id, const RenderObject* object)
-{
-    SVGResource* resource = getResourceById(document, id, object);
-    if (resource && resource->isFilter())
-        return static_cast<SVGResourceFilter*>(resource);
-
-    return 0;
-}
-
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG)
diff --git a/WebCore/svg/graphics/SVGResourceFilter.h b/WebCore/svg/graphics/SVGResourceFilter.h
deleted file mode 100644
index ee8627c..0000000
--- a/WebCore/svg/graphics/SVGResourceFilter.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-    Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-                  2005 Eric Seidel <eric@webkit.org>
-                  2009 Dirk Schulze <krit@webkit.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
-    aint 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 SVGResourceFilter_h
-#define SVGResourceFilter_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGResource.h"
-
-#include "Image.h"
-#include "ImageBuffer.h"
-#include "FloatRect.h"
-#include "RenderObject.h"
-#include "SVGFilterPrimitiveStandardAttributes.h"
-
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class Filter;
-class FilterEffect;
-class GraphicsContext;
-class SVGFilterBuilder;
-class SVGFilterElement;
-class SVGFilterPrimitiveStandardAttributes;
-
-class SVGResourceFilter : public SVGResource {
-public:
-    static PassRefPtr<SVGResourceFilter> create(const SVGFilterElement* ownerElement) { return adoptRef(new SVGResourceFilter(ownerElement)); }
-    virtual ~SVGResourceFilter();
-    
-    virtual SVGResourceType resourceType() const { return FilterResourceType; }
-
-    void setFilterResolution(const FloatSize& filterResSize) { m_filterResSize = filterResSize; }
-    void setHasFilterResolution(bool filterRes) { m_filterRes = filterRes; }
-
-    bool filterBoundingBoxMode() const { return m_filterBBoxMode; }
-    void setFilterBoundingBoxMode(bool bboxMode) { m_filterBBoxMode = bboxMode; }
-
-    bool effectBoundingBoxMode() const { return m_effectBBoxMode; }
-    void setEffectBoundingBoxMode(bool bboxMode) { m_effectBBoxMode = bboxMode; }
-
-    FloatRect filterRect() const { return m_filterRect; }
-    void setFilterRect(const FloatRect& rect) { m_filterRect = rect; }
-
-    float scaleX() const { return m_scaleX; }
-    float scaleY() const { return m_scaleY; }
-
-    FloatRect filterBoundingBox(const FloatRect& obb) const;
-    void setFilterBoundingBox(const FloatRect& rect) { m_filterBBox = rect; }
-
-    bool prepareFilter(GraphicsContext*&, const RenderObject*);
-    void applyFilter(GraphicsContext*&, const RenderObject*);
-
-    bool fitsInMaximumImageSize(const FloatSize&);
-
-    void addFilterEffect(SVGFilterPrimitiveStandardAttributes*, PassRefPtr<FilterEffect>);
-
-    SVGFilterBuilder* builder() { return m_filterBuilder.get(); }
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-    
-private:
-    SVGResourceFilter(const SVGFilterElement*);
-
-    const SVGFilterElement* m_ownerElement;
-
-    bool m_filterBBoxMode : 1;
-    bool m_effectBBoxMode : 1;
-    bool m_filterRes : 1;
-    float m_scaleX;
-    float m_scaleY;
-
-    FloatRect m_filterRect;
-    FloatRect m_filterBBox;
-    FloatSize m_filterResSize;
-
-    OwnPtr<SVGFilterBuilder> m_filterBuilder;
-    GraphicsContext* m_savedContext;
-    OwnPtr<ImageBuffer> m_sourceGraphicBuffer;
-    RefPtr<Filter> m_filter;
-};
-
-SVGResourceFilter* getFilterById(Document*, const AtomicString&, const RenderObject*);
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG)
-
-#endif // SVGResourceFilter_h
diff --git a/WebCore/svg/graphics/SVGResourceMarker.cpp b/WebCore/svg/graphics/SVGResourceMarker.cpp
deleted file mode 100644
index 2c036a4..0000000
--- a/WebCore/svg/graphics/SVGResourceMarker.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * 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 COMPUTER, 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"
-
-#if ENABLE(SVG)
-#include "SVGResourceMarker.h"
-
-#include "AffineTransform.h"
-#include "GraphicsContext.h"
-#include "RenderSVGViewportContainer.h"
-#include "TextStream.h"
-#include <wtf/StdLibExtras.h>
-
-namespace WebCore {
-
-SVGResourceMarker::SVGResourceMarker()
-    : SVGResource()
-    , m_angle(-1) // just like using setAutoAngle()
-    , m_renderer(0)
-    , m_useStrokeWidth(true)
-{
-}
-
-SVGResourceMarker::~SVGResourceMarker()
-{
-}
-
-AffineTransform SVGResourceMarker::markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const
-{
-    ASSERT(m_renderer);
-
-    AffineTransform transform;
-    transform.translate(origin.x(), origin.y());
-    transform.rotate(m_angle == -1 ? angle : m_angle);
-    transform = m_renderer->markerContentTransformation(transform, m_referencePoint, m_useStrokeWidth ? strokeWidth : -1);
-    return transform;
-}
-
-void SVGResourceMarker::draw(RenderObject::PaintInfo& paintInfo, const AffineTransform& transform)
-{
-    if (!m_renderer)
-        return;
-
-    DEFINE_STATIC_LOCAL(HashSet<SVGResourceMarker*>, currentlyDrawingMarkers, ());
-
-    // avoid drawing circular marker references
-    if (currentlyDrawingMarkers.contains(this))
-        return;
-
-    currentlyDrawingMarkers.add(this);
-    ASSERT(!m_renderer->drawsContents());
-    RenderObject::PaintInfo info(paintInfo);
-    info.context->save();
-    applyTransformToPaintInfo(info, transform);
-    m_renderer->setDrawsContents(true);
-    m_renderer->paint(info, 0, 0);
-    m_renderer->setDrawsContents(false);
-    info.context->restore();
-
-    currentlyDrawingMarkers.remove(this);
-}
-
-TextStream& SVGResourceMarker::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=MARKER]"
-        << " [angle=";
-
-    if (angle() == -1)
-        ts << "auto" << "]";
-    else
-        ts << angle() << "]";
-
-    ts << " [ref x=" << m_referencePoint.x() << " y=" << m_referencePoint.y() << "]";
-    return ts;
-}
-
-SVGResourceMarker* getMarkerById(Document* document, const AtomicString& id, const RenderObject* object)
-{
-    SVGResource* resource = getResourceById(document, id, object);
-    if (resource && resource->isMarker())
-        return static_cast<SVGResourceMarker*>(resource);
-
-    return 0;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/svg/graphics/SVGResourceMarker.h b/WebCore/svg/graphics/SVGResourceMarker.h
deleted file mode 100644
index f2ce33d..0000000
--- a/WebCore/svg/graphics/SVGResourceMarker.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * 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 COMPUTER, 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 SVGResourceMarker_h
-#define SVGResourceMarker_h
-
-#if ENABLE(SVG)
-#include "FloatPoint.h"
-#include "FloatRect.h"
-#include "RenderObject.h"
-#include "SVGResource.h"
-
-namespace WebCore {
-
-    class RenderSVGViewportContainer;
-    class AffineTransform;
-
-    class SVGResourceMarker : public SVGResource {
-    public:
-        static PassRefPtr<SVGResourceMarker> create() { return adoptRef(new SVGResourceMarker); }
-        virtual ~SVGResourceMarker();
-
-        RenderSVGViewportContainer* renderer() const { return m_renderer; }
-        void setRenderer(RenderSVGViewportContainer* marker) { m_renderer = marker; }
-
-        void setReferencePoint(const FloatPoint& point) { m_referencePoint = point; }
-        FloatPoint referencePoint() const { return m_referencePoint; }
-
-        void setAngle(float angle) { m_angle = angle; }
-        void setAutoAngle() { m_angle = -1; }
-        float angle() const { return m_angle; }
-
-        void setUseStrokeWidth(bool useStrokeWidth = true) { m_useStrokeWidth = useStrokeWidth; }
-        bool useStrokeWidth() const { return m_useStrokeWidth; }
-
-        AffineTransform markerTransformation(const FloatPoint& origin, float angle, float strokeWidth) const;
-        void draw(RenderObject::PaintInfo&, const AffineTransform&);
-
-        virtual SVGResourceType resourceType() const { return MarkerResourceType; }
-        virtual TextStream& externalRepresentation(TextStream&) const;
-
-    private:
-        SVGResourceMarker();
-
-        FloatPoint m_referencePoint;
-        float m_angle;
-        RenderSVGViewportContainer* m_renderer;
-        bool m_useStrokeWidth;
-    };
-
-    SVGResourceMarker* getMarkerById(Document*, const AtomicString&, const RenderObject*);
-
-} // namespace WebCore
-
-#endif
-
-#endif // SVGResourceMarker_h
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
index a22bc94..4610b7d 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
@@ -155,8 +155,7 @@
 {
     ts << "[type=DISPLACEMENT-MAP] ";
     FilterEffect::externalRepresentation(ts);
-    ts << " [in2=" << m_in2.get() << "]"
-        << " [scale=" << m_scale << "]"
+    ts << "[scale=" << m_scale << "]"
         << " [x channel selector=" << m_xChannelSelector << "]"
         << " [y channel selector=" << m_yChannelSelector << "]";
     return ts;
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.h b/WebCore/svg/graphics/filters/SVGFEImage.h
index 0883aad..01e9522 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.h
+++ b/WebCore/svg/graphics/filters/SVGFEImage.h
@@ -24,9 +24,7 @@
 #define SVGFEImage_h
 
 #if ENABLE(SVG) && ENABLE(FILTERS)
-#include "Image.h"
 #include "FilterEffect.h"
-#include "Filter.h"
 #include "SVGPreserveAspectRatio.h"
 
 namespace WebCore {
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
index 987350d..5204a46 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
@@ -92,7 +92,9 @@
 
     setIsAlphaImage(m_in->isAlphaImage());
 
-    if (!m_radiusX || !m_radiusY)
+    int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width());
+    int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height());
+    if (radiusX <= 0 || radiusY <= 0)
         return;
 
     IntRect imageRect(IntPoint(), resultImage()->size());
@@ -100,12 +102,11 @@
     RefPtr<CanvasPixelArray> srcPixelArray(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
     RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
 
-    int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width());
-    int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height());
     int effectWidth = effectDrawingRect.width() * 4;
     
-    // Limit the radius size to effect width
+    // Limit the radius size to effect dimensions
     radiusX = min(effectDrawingRect.width() - 1, radiusX);
+    radiusY = min(effectDrawingRect.height() - 1, radiusY);
     
     Vector<unsigned char> extrema;
     for (int y = 0; y < effectDrawingRect.height(); ++y) {
diff --git a/WebCore/svg/graphics/filters/SVGFilterBuilder.h b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
index 55844c9..89d55e1 100644
--- a/WebCore/svg/graphics/filters/SVGFilterBuilder.h
+++ b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
@@ -41,6 +41,8 @@
         FilterEffect* getEffectById(const AtomicString& id) const;
         FilterEffect* lastEffect() const { return m_lastEffect.get(); }
 
+        const HashMap<AtomicString, RefPtr<FilterEffect> >& namedEffects() { return m_namedEffects; }
+
         void clearEffects();
 
     private:
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index cd5528b..a820c2a 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -34,7 +34,6 @@
 
 #include "WebSocket.h"
 
-#include "CString.h"
 #include "DOMWindow.h"
 #include "Event.h"
 #include "EventException.h"
@@ -46,6 +45,7 @@
 #include "StringBuilder.h"
 #include "ThreadableWebSocketChannel.h"
 #include "WebSocketChannel.h"
+#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
@@ -119,32 +119,32 @@
     m_protocol = protocol;
 
     if (!m_url.isValid()) {
-        scriptExecutionContext()->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid url for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
 
     if (!m_url.protocolIs("ws") && !m_url.protocolIs("wss")) {
-        scriptExecutionContext()->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong url scheme for WebSocket " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (m_url.hasFragmentIdentifier()) {
-        scriptExecutionContext()->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "URL has fragment component " + url.string(), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!isValidProtocolString(m_protocol)) {
-        scriptExecutionContext()->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString());
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Wrong protocol for WebSocket '" + encodeProtocolString(m_protocol) + "'", 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SYNTAX_ERR;
         return;
     }
     if (!portAllowed(url)) {
-        scriptExecutionContext()->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket port %d blocked", url.port()), 0, scriptExecutionContext()->securityOrigin()->toString());
+        scriptExecutionContext()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket port %d blocked", url.port()), 0, scriptExecutionContext()->securityOrigin()->toString());
         m_state = CLOSED;
         ec = SECURITY_ERR;
         return;
@@ -227,10 +227,11 @@
 void WebSocket::didConnect()
 {
     LOG(Network, "WebSocket %p didConnect", this);
-    if (m_state != CONNECTING || !scriptExecutionContext()) {
+    if (m_state != CONNECTING) {
         didClose(0);
         return;
     }
+    ASSERT(scriptExecutionContext());
     m_state = OPEN;
     dispatchEvent(Event::create(eventNames().openEvent, false, false));
 }
@@ -238,18 +239,29 @@
 void WebSocket::didReceiveMessage(const String& msg)
 {
     LOG(Network, "WebSocket %p didReceiveMessage %s", this, msg.utf8().data());
-    if (m_state != OPEN || !scriptExecutionContext())
+    if (m_state != OPEN)
         return;
+    ASSERT(scriptExecutionContext());
     RefPtr<MessageEvent> evt = MessageEvent::create();
     evt->initMessageEvent(eventNames().messageEvent, false, false, SerializedScriptValue::create(msg), "", "", 0, 0);
     dispatchEvent(evt);
 }
 
+void WebSocket::didReceiveMessageError()
+{
+    LOG(Network, "WebSocket %p didReceiveErrorMessage", this);
+    if (m_state != OPEN)
+        return;
+    ASSERT(scriptExecutionContext());
+    dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+}
+
 void WebSocket::didClose(unsigned long unhandledBufferedAmount)
 {
     LOG(Network, "WebSocket %p didClose", this);
     m_state = CLOSED;
     m_bufferedAmountAfterClose += unhandledBufferedAmount;
+    ASSERT(scriptExecutionContext());
     dispatchEvent(Event::create(eventNames().closeEvent, false, false));
     m_channel = 0;
     if (hasPendingActivity())
diff --git a/WebCore/websockets/WebSocket.h b/WebCore/websockets/WebSocket.h
index 8bda882..e91796f 100644
--- a/WebCore/websockets/WebSocket.h
+++ b/WebCore/websockets/WebSocket.h
@@ -76,6 +76,7 @@
 
         DEFINE_ATTRIBUTE_EVENT_LISTENER(open);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
 
         // EventTarget
@@ -91,6 +92,7 @@
         // WebSocketChannelClient
         virtual void didConnect();
         virtual void didReceiveMessage(const String& message);
+        virtual void didReceiveMessageError();
         virtual void didClose(unsigned long unhandledBufferedAmount);
 
     private:
@@ -101,10 +103,6 @@
         virtual EventTargetData* eventTargetData();
         virtual EventTargetData* ensureEventTargetData();
 
-        void dispatchOpenEvent(Event*);
-        void dispatchMessageEvent(Event*);
-        void dispatchCloseEvent(Event*);
-
         RefPtr<ThreadableWebSocketChannel> m_channel;
 
         State m_state;
diff --git a/WebCore/websockets/WebSocket.idl b/WebCore/websockets/WebSocket.idl
index c9552d9..1707478 100644
--- a/WebCore/websockets/WebSocket.idl
+++ b/WebCore/websockets/WebSocket.idl
@@ -49,6 +49,7 @@
         // networking
         attribute EventListener onopen;
         attribute EventListener onmessage;
+        attribute EventListener onerror;
         attribute EventListener onclose;
 
         [Custom] boolean send(in DOMString data)
@@ -56,12 +57,12 @@
         void close();
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type,
-                                       in EventListener listener,
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type,
+        [JSCCustom] void addEventListener(in DOMString type,
                                           in EventListener listener,
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type,
+                                             in EventListener listener,
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 7b87bf3..0880e45 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -34,7 +34,6 @@
 
 #include "WebSocketChannel.h"
 
-#include "CString.h"
 #include "CookieJar.h"
 #include "Document.h"
 #include "Logging.h"
@@ -44,7 +43,9 @@
 #include "SocketStreamHandle.h"
 #include "StringHash.h"
 #include "WebSocketChannelClient.h"
+#include "WebSocketHandshake.h"
 
+#include <wtf/text/CString.h>
 #include <wtf/Deque.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/HashMap.h>
@@ -102,7 +103,9 @@
 void WebSocketChannel::disconnect()
 {
     LOG(Network, "WebSocketChannel %p disconnect", this);
+    m_handshake.clearScriptExecutionContext();
     m_client = 0;
+    m_context = 0;
     if (m_handle)
         m_handle->close();
 }
@@ -111,9 +114,11 @@
 {
     LOG(Network, "WebSocketChannel %p didOpen", this);
     ASSERT(handle == m_handle);
+    if (!m_context)
+        return;
     const CString& handshakeMessage = m_handshake.clientHandshakeMessage();
     if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
         handle->close();
     }
 }
@@ -126,6 +131,7 @@
         unsigned long unhandledBufferedAmount = m_handle->bufferedAmount();
         WebSocketChannelClient* client = m_client;
         m_client = 0;
+        m_context = 0;
         m_handle = 0;
         if (client)
             client->didClose(unhandledBufferedAmount);
@@ -138,14 +144,17 @@
     LOG(Network, "WebSocketChannel %p didReceiveData %d", this, len);
     RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
     ASSERT(handle == m_handle);
-    if (!appendToBuffer(data, len)) {
-        handle->close();
+    if (!m_context) {
         return;
     }
     if (!m_client) {
         handle->close();
         return;
     }
+    if (!appendToBuffer(data, len)) {
+        handle->close();
+        return;
+    }
     if (m_handshake.mode() == WebSocketHandshake::Incomplete) {
         int headerLength = m_handshake.readServerHandshake(m_buffer, m_bufferSize);
         if (headerLength <= 0)
@@ -190,6 +199,9 @@
             while (p < end) {
                 if (length > std::numeric_limits<int>::max() / 128) {
                     LOG(Network, "frame length overflow %d", length);
+                    m_client->didReceiveMessageError();
+                    if (!m_client)
+                        return;
                     handle->close();
                     return;
                 }
@@ -202,6 +214,9 @@
             if (p + length < end) {
                 p += length;
                 nextFrame = p;
+                m_client->didReceiveMessageError();
+                if (!m_client)
+                    return;
             } else
                 break;
         } else {
@@ -211,6 +226,8 @@
             if (p < end && *p == '\xff') {
                 if (frameByte == 0x00)
                     m_client->didReceiveMessage(String::fromUTF8(msgStart, p - msgStart));
+                else
+                    m_client->didReceiveMessageError();
                 if (!m_client)
                     return;
                 ++p;
@@ -248,7 +265,7 @@
         m_bufferSize += len;
         return true;
     }
-    m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket frame (at %d bytes) is too long.", m_bufferSize + len), 0, m_handshake.clientOrigin());
+    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket frame (at %d bytes) is too long.", m_bufferSize + len), 0, m_handshake.clientOrigin());
     return false;
 }
 
diff --git a/WebCore/websockets/WebSocketChannelClient.h b/WebCore/websockets/WebSocketChannelClient.h
index 5328eb7..1551073 100644
--- a/WebCore/websockets/WebSocketChannelClient.h
+++ b/WebCore/websockets/WebSocketChannelClient.h
@@ -40,6 +40,7 @@
         virtual ~WebSocketChannelClient() { }
         virtual void didConnect() { }
         virtual void didReceiveMessage(const String&) { }
+        virtual void didReceiveMessageError() { }
         virtual void didClose(unsigned long /* unhandledBufferedAmount */) { }
 
     protected:
diff --git a/WebCore/websockets/WebSocketHandshake.cpp b/WebCore/websockets/WebSocketHandshake.cpp
index 4471096..1449c89 100644
--- a/WebCore/websockets/WebSocketHandshake.cpp
+++ b/WebCore/websockets/WebSocketHandshake.cpp
@@ -35,7 +35,6 @@
 #include "WebSocketHandshake.h"
 
 #include "AtomicString.h"
-#include "CString.h"
 #include "Cookie.h"
 #include "CookieJar.h"
 #include "Document.h"
@@ -45,6 +44,7 @@
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 #include "StringBuilder.h"
+#include <wtf/text/CString.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Vector.h>
 
@@ -87,6 +87,14 @@
     return name;
 }
 
+static String trimConsoleMessage(const char* p, size_t len)
+{
+    String s = String(p, std::min<size_t>(len, 128));
+    if (len > 128)
+        s += "...";
+    return s;
+}
+
 WebSocketHandshake::WebSocketHandshake(const KURL& url, const String& protocol, ScriptExecutionContext* context)
     : m_url(url)
     , m_clientProtocol(protocol)
@@ -130,11 +138,6 @@
     return m_secure;
 }
 
-void WebSocketHandshake::setSecure(bool secure)
-{
-    m_secure = secure;
-}
-
 String WebSocketHandshake::clientOrigin() const
 {
     return m_context->securityOrigin()->toString();
@@ -158,6 +161,7 @@
 
 CString WebSocketHandshake::clientHandshakeMessage() const
 {
+    // Keep the following consistent with clientHandshakeRequest().
     StringBuilder builder;
 
     builder.append("GET ");
@@ -167,11 +171,9 @@
     builder.append("Connection: Upgrade\r\n");
     builder.append("Host: ");
     builder.append(m_url.host().lower());
-    if (m_url.port()) {
-        if ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443)) {
-            builder.append(":");
-            builder.append(String::number(m_url.port()));
-        }
+    if (m_url.port() && ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443))) {
+        builder.append(":");
+        builder.append(String::number(m_url.port()));
     }
     builder.append("\r\n");
     builder.append("Origin: ");
@@ -182,9 +184,8 @@
         builder.append(m_clientProtocol);
         builder.append("\r\n");
     }
+
     KURL url = httpURLForAuthenticationAndCookies();
-    // FIXME: set authentication information or cookies for url.
-    // Set "Authorization: <credentials>" if authentication information exists for url.
     if (m_context->isDocument()) {
         Document* document = static_cast<Document*>(m_context);
         String cookie = cookieRequestHeaderFieldValue(document, url);
@@ -195,10 +196,28 @@
         }
         // Set "Cookie2: <cookie>" if cookies 2 exists for url?
     }
+
     builder.append("\r\n");
     return builder.toString().utf8();
 }
 
+WebSocketHandshakeRequest WebSocketHandshake::clientHandshakeRequest() const
+{
+    // Keep the following consistent with clientHandshakeMessage().
+    WebSocketHandshakeRequest request(m_url, clientOrigin(), m_clientProtocol);
+
+    KURL url = httpURLForAuthenticationAndCookies();
+    if (m_context->isDocument()) {
+        Document* document = static_cast<Document*>(m_context);
+        String cookie = cookieRequestHeaderFieldValue(document, url);
+        if (!cookie.isEmpty())
+            request.addExtraHeaderField("Cookie", cookie);
+        // Set "Cookie2: <cookie>" if cookies 2 exists for url?
+    }
+
+    return request;
+}
+
 void WebSocketHandshake::reset()
 {
     m_mode = Incomplete;
@@ -210,6 +229,11 @@
     m_setCookie2 = String();
 }
 
+void WebSocketHandshake::clearScriptExecutionContext()
+{
+    m_context = 0;
+}
+
 int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
 {
     m_mode = Incomplete;
@@ -222,27 +246,27 @@
     else {
         const String& code = extractResponseCode(header, len);
         if (code.isNull()) {
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Short server handshake: " + String(header, len), 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Short server handshake: " + trimConsoleMessage(header, len), 0, clientOrigin());
             return -1;
         }
         if (code.isEmpty()) {
             m_mode = Failed;
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + String(header, len), 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, len), 0, clientOrigin());
             return len;
         }
         LOG(Network, "response code: %s", code.utf8().data());
         if (code == "401") {
             m_mode = Failed;
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Authentication required, but not implemented yet.", 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Authentication required, but not implemented yet.", 0, clientOrigin());
             return len;
         } else {
             m_mode = Failed;
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected response code:" + code, 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected response code:" + code, 0, clientOrigin());
             return len;
         }
     }
     const char* p = header + sizeof(webSocketServerHandshakeHeader) - 1;
-    const char* end = header + len + 1;
+    const char* end = header + len;
 
     if (m_mode == Normal) {
         size_t headerSize = end - p;
@@ -252,7 +276,7 @@
         }
         if (memcmp(p, webSocketUpgradeHeader, sizeof(webSocketUpgradeHeader) - 1)) {
             m_mode = Failed;
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Bad Upgrade header: " + String(p, end - p), 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Bad Upgrade header: " + trimConsoleMessage(p, end - p), 0, clientOrigin());
             return p - header + sizeof(webSocketUpgradeHeader) - 1;
         }
         p += sizeof(webSocketUpgradeHeader) - 1;
@@ -264,7 +288,7 @@
         }
         if (memcmp(p, webSocketConnectionHeader, sizeof(webSocketConnectionHeader) - 1)) {
             m_mode = Failed;
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Bad Connection header: " + String(p, end - p), 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Bad Connection header: " + trimConsoleMessage(p, end - p), 0, clientOrigin());
             return p - header + sizeof(webSocketConnectionHeader) - 1;
         }
         p += sizeof(webSocketConnectionHeader) - 1;
@@ -375,13 +399,13 @@
                 if (name.isEmpty()) {
                     if (p + 1 < end && *(p + 1) == '\n')
                         return p + 2;
-                    m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + String(p, end - p), 0, clientOrigin());
+                    m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                     return 0;
                 }
-                m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + String(p, end - p), 0, clientOrigin());
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected CR in name at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                 return 0;
             case '\n':
-                m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + String(p, end - p), 0, clientOrigin());
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in name at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                 return 0;
             case ':':
                 break;
@@ -405,7 +429,7 @@
             case '\r':
                 break;
             case '\n':
-                m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + String(p, end - p), 0, clientOrigin());
+                m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected LF in value at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
                 return 0;
             default:
                 value.append(*p);
@@ -416,11 +440,19 @@
             }
         }
         if (p >= end || *p != '\n') {
-            m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + String(p, end - p), 0, clientOrigin());
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "CR doesn't follow LF after value at " + trimConsoleMessage(p, end - p), 0, clientOrigin());
             return 0;
         }
         AtomicString nameStr(String::fromUTF8(name.data(), name.size()));
         String valueStr = String::fromUTF8(value.data(), value.size());
+        if (nameStr.isNull()) {
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header name", 0, clientOrigin());
+            return 0;
+        }
+        if (valueStr.isNull()) {
+            m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "invalid UTF-8 sequence in header value", 0, clientOrigin());
+            return 0;
+        }
         LOG(Network, "name=%s value=%s", nameStr.string().utf8().data(), valueStr.utf8().data());
         headers->add(nameStr, valueStr);
     }
@@ -459,24 +491,24 @@
     ASSERT(m_mode == Normal);
     m_mode = Failed;
     if (m_wsOrigin.isNull()) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'websocket-origin' header is missing", 0, clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'websocket-origin' header is missing", 0, clientOrigin());
         return;
     }
     if (m_wsLocation.isNull()) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'websocket-location' header is missing", 0, clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: 'websocket-location' header is missing", 0, clientOrigin());
         return;
     }
 
     if (clientOrigin() != m_wsOrigin) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: origin mismatch: " + clientOrigin() + " != " + m_wsOrigin, 0, clientOrigin());
         return;
     }
     if (clientLocation() != m_wsLocation) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: location mismatch: " + clientLocation() + " != " + m_wsLocation, 0, clientOrigin());
         return;
     }
     if (!m_clientProtocol.isEmpty() && m_clientProtocol != m_wsProtocol) {
-        m_context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin());
+        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error during WebSocket handshake: protocol mismatch: " + m_clientProtocol + " != " + m_wsProtocol, 0, clientOrigin());
         return;
     }
     m_mode = Connected;
diff --git a/WebCore/websockets/WebSocketHandshake.h b/WebCore/websockets/WebSocketHandshake.h
index bda320a..df199ff 100644
--- a/WebCore/websockets/WebSocketHandshake.h
+++ b/WebCore/websockets/WebSocketHandshake.h
@@ -35,6 +35,7 @@
 
 #include "KURL.h"
 #include "PlatformString.h"
+#include "WebSocketHandshakeRequest.h"
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
@@ -58,14 +59,15 @@
         void setClientProtocol(const String& protocol);
 
         bool secure() const;
-        void setSecure(bool secure);
 
         String clientOrigin() const;
         String clientLocation() const;
 
         CString clientHandshakeMessage() const;
+        WebSocketHandshakeRequest clientHandshakeRequest() const;
 
         void reset();
+        void clearScriptExecutionContext();
 
         int readServerHandshake(const char* header, size_t len);
         Mode mode() const;
diff --git a/WebCore/websockets/WebSocketHandshakeRequest.cpp b/WebCore/websockets/WebSocketHandshakeRequest.cpp
new file mode 100644
index 0000000..9a41167
--- /dev/null
+++ b/WebCore/websockets/WebSocketHandshakeRequest.cpp
@@ -0,0 +1,95 @@
+/*
+ * 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(WEB_SOCKETS)
+
+#include "WebSocketHandshakeRequest.h"
+
+#include "AtomicString.h"
+#include "StringBuilder.h"
+#include <utility>
+#include <wtf/Assertions.h>
+
+using namespace std;
+
+namespace WebCore {
+
+WebSocketHandshakeRequest::WebSocketHandshakeRequest(const KURL& url, const String& origin, const String& webSocketProtocol)
+    : m_url(url)
+    , m_secure(m_url.protocolIs("wss"))
+    , m_origin(origin)
+    , m_webSocketProtocol(webSocketProtocol)
+{
+    ASSERT(!origin.isNull());
+}
+
+WebSocketHandshakeRequest::~WebSocketHandshakeRequest()
+{
+}
+
+void WebSocketHandshakeRequest::addExtraHeaderField(const AtomicString& name, const String& value)
+{
+    m_extraHeaderFields.append(HeaderField(name, value));
+}
+
+void WebSocketHandshakeRequest::addExtraHeaderField(const char* name, const String& value)
+{
+    m_extraHeaderFields.append(HeaderField(name, value));
+}
+
+Vector<WebSocketHandshakeRequest::HeaderField> WebSocketHandshakeRequest::headerFields() const
+{
+    Vector<HeaderField> fields;
+    fields.append(HeaderField("Upgrade", "WebSocket"));
+    fields.append(HeaderField("Connection", "Upgrade"));
+    fields.append(HeaderField("Host", host()));
+    fields.append(HeaderField("Origin", m_origin));
+    if (!m_webSocketProtocol.isEmpty())
+        fields.append(HeaderField("WebSocket-Protocol", m_webSocketProtocol));
+    fields.append(m_extraHeaderFields);
+    return fields;
+}
+
+String WebSocketHandshakeRequest::host() const
+{
+    StringBuilder builder;
+    builder.append(m_url.host().lower());
+    if ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443)) {
+        builder.append(":");
+        builder.append(String::number(m_url.port()));
+    }
+    return builder.toString();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketHandshakeRequest.h b/WebCore/websockets/WebSocketHandshakeRequest.h
new file mode 100644
index 0000000..d488135
--- /dev/null
+++ b/WebCore/websockets/WebSocketHandshakeRequest.h
@@ -0,0 +1,73 @@
+/*
+ * 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 WebSocketHandshakeRequest_h
+#define WebSocketHandshakeRequest_h
+
+#if ENABLE(WEB_SOCKETS)
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AtomicString;
+
+class WebSocketHandshakeRequest {
+public:
+    WebSocketHandshakeRequest(const KURL&, const String& origin, const String& webSocketProtocol);
+    ~WebSocketHandshakeRequest();
+
+    // According to current Web Socket protocol specification, four mandatory headers (Upgrade, Connection, Host, and Origin) and
+    // one optional header (WebSocket-Protocol) should be sent in this order, at the beginning of the handshake request.
+    // The remaining headers can be set by using the following function.
+    void addExtraHeaderField(const AtomicString& name, const String& value);
+    void addExtraHeaderField(const char* name, const String& value);
+
+    // Returns the list of header fields including five special ones.
+    typedef std::pair<AtomicString, String> HeaderField;
+    Vector<HeaderField> headerFields() const;
+
+private:
+    String host() const;
+
+    KURL m_url;
+    bool m_secure;
+    String m_origin;
+    String m_webSocketProtocol;
+    Vector<HeaderField> m_extraHeaderFields;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_SOCKETS)
+
+#endif // WebSocketHandshakeRequest_h
diff --git a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
index 3dda104..1ee5f18 100644
--- a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
+++ b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
@@ -52,7 +52,7 @@
 WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel(WorkerContext* context, WebSocketChannelClient* client, const String& taskMode, const KURL& url, const String& protocol)
     : m_workerContext(context)
     , m_workerClientWrapper(ThreadableWebSocketChannelClientWrapper::create(client))
-    , m_bridge(new Bridge(m_workerClientWrapper, m_workerContext, taskMode, url, protocol))
+    , m_bridge(Bridge::create(m_workerClientWrapper, m_workerContext, taskMode, url, protocol))
 {
 }
 
diff --git a/WebCore/websockets/WorkerThreadableWebSocketChannel.h b/WebCore/websockets/WorkerThreadableWebSocketChannel.h
index a6a1680..76d0b8c 100644
--- a/WebCore/websockets/WorkerThreadableWebSocketChannel.h
+++ b/WebCore/websockets/WorkerThreadableWebSocketChannel.h
@@ -105,7 +105,10 @@
     // Bridge for Peer.  Running on the worker thread.
     class Bridge : public RefCounted<Bridge> {
     public:
-        Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, PassRefPtr<WorkerContext>, const String& taskMode, const KURL&, const String& protocol);
+        static PassRefPtr<Bridge> create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, PassRefPtr<WorkerContext> workerContext, const String& taskMode, const KURL& url, const String& protocol)
+        {
+            return adoptRef(new Bridge(workerClientWrapper, workerContext, taskMode, url, protocol));
+        }
         ~Bridge();
         void connect();
         bool send(const String& message);
@@ -117,6 +120,8 @@
         using RefCounted<Bridge>::deref;
 
     private:
+        Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, PassRefPtr<WorkerContext>, const String& taskMode, const KURL&, const String& protocol);
+
         static void setWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, Peer*, RefPtr<ThreadableWebSocketChannelClientWrapper>);
 
         // Executed on the main thread to create a Peer for this bridge.
diff --git a/WebCore/wml/WMLAElement.cpp b/WebCore/wml/WMLAElement.cpp
index 8bd6fad..55b2698 100644
--- a/WebCore/wml/WMLAElement.cpp
+++ b/WebCore/wml/WMLAElement.cpp
@@ -29,7 +29,6 @@
 #if ENABLE(WML)
 #include "WMLAElement.h"
 
-#include "DNS.h"
 #include "Event.h"
 #include "EventHandler.h"
 #include "EventNames.h"
@@ -40,6 +39,7 @@
 #include "MappedAttribute.h"
 #include "MouseEvent.h"
 #include "RenderBox.h"
+#include "ResourceHandle.h"
 #include "WMLNames.h"
 
 namespace WebCore {
@@ -61,7 +61,7 @@
         if (isLink() && document()->isDNSPrefetchEnabled()) {
             String value = attr->value();
             if (protocolIs(value, "http") || protocolIs(value, "https") || value.startsWith("//"))
-                prefetchDNS(document()->completeURL(value).host());
+                ResourceHandle::prepareForURL(document()->completeURL(value));
         }
     } else if (attr->name() == HTMLNames::nameAttr
                || attr->name() == HTMLNames::titleAttr
diff --git a/WebCore/wml/WMLErrorHandling.cpp b/WebCore/wml/WMLErrorHandling.cpp
index d62ccb7..6184772 100644
--- a/WebCore/wml/WMLErrorHandling.cpp
+++ b/WebCore/wml/WMLErrorHandling.cpp
@@ -24,11 +24,11 @@
 #include "WMLErrorHandling.h"
 
 #include "Console.h"
-#include "CString.h"
 #include "Frame.h"
 #include "Document.h"
 #include "DOMWindow.h"
 #include "XMLTokenizer.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp
index 8076207..4378f34 100644
--- a/WebCore/wml/WMLGoElement.cpp
+++ b/WebCore/wml/WMLGoElement.cpp
@@ -23,7 +23,6 @@
 #if ENABLE(WML)
 #include "WMLGoElement.h"
 
-#include "CString.h"
 #include "FormData.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -38,6 +37,7 @@
 #include "WMLPostfieldElement.h"
 #include "WMLTimerElement.h"
 #include "WMLVariables.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/wml/WMLOptionElement.cpp b/WebCore/wml/WMLOptionElement.cpp
index 61fa762..ac41a06 100644
--- a/WebCore/wml/WMLOptionElement.cpp
+++ b/WebCore/wml/WMLOptionElement.cpp
@@ -170,6 +170,12 @@
         eventHandler->triggerIntrinsicEvent(WMLIntrinsicEventOnPick);
 }
 
+bool WMLOptionElement::disabled() const
+{
+    /* Dummy implementation, as disabled() is pure virtual in OptionElement class */
+    return false;
+}
+
 }
 
 #endif
diff --git a/WebCore/wml/WMLOptionElement.h b/WebCore/wml/WMLOptionElement.h
index c34f319..6283070 100644
--- a/WebCore/wml/WMLOptionElement.h
+++ b/WebCore/wml/WMLOptionElement.h
@@ -54,6 +54,8 @@
     virtual String textIndentedToRespectGroupLabel() const;
     virtual String value() const;
 
+    virtual bool disabled() const;
+
 private:
     virtual RenderStyle* nonRendererRenderStyle() const;
     void handleIntrinsicEventIfNeeded();
diff --git a/WebCore/wml/WMLPageState.cpp b/WebCore/wml/WMLPageState.cpp
index 4cf3e34..d03cf44 100644
--- a/WebCore/wml/WMLPageState.cpp
+++ b/WebCore/wml/WMLPageState.cpp
@@ -25,12 +25,12 @@
 #include "WMLPageState.h"
 
 #include "BackForwardList.h"
-#include "CString.h"
 #include "Document.h"
 #include "Frame.h"
 #include "HistoryItem.h"
 #include "KURL.h"
 #include "Page.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/wml/WMLPostfieldElement.cpp b/WebCore/wml/WMLPostfieldElement.cpp
index 21f4c5b..5cf26c7 100644
--- a/WebCore/wml/WMLPostfieldElement.cpp
+++ b/WebCore/wml/WMLPostfieldElement.cpp
@@ -23,12 +23,12 @@
 #if ENABLE(WML)
 #include "WMLPostfieldElement.h"
 
-#include "CString.h"
 #include "TextEncoding.h"
 #include "HTMLNames.h"
 #include "WMLDocument.h"
 #include "WMLGoElement.h"
 #include "WMLNames.h"
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
diff --git a/WebCore/wml/WMLSelectElement.cpp b/WebCore/wml/WMLSelectElement.cpp
index e6041f4..bc86d12 100644
--- a/WebCore/wml/WMLSelectElement.cpp
+++ b/WebCore/wml/WMLSelectElement.cpp
@@ -22,7 +22,6 @@
 
 #if ENABLE(WML)
 #include "WMLSelectElement.h"
-#include "CString.h"
 #include "HTMLNames.h"
 #include "MappedAttribute.h"
 #include "OptionElement.h"
@@ -32,6 +31,7 @@
 #include "WMLNames.h"
 #include "WMLVariables.h"
 #include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
@@ -545,6 +545,11 @@
     return parseValueSubstitutingVariableReferences(getAttribute(ivalueAttr));
 }
 
+void WMLSelectElement::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
+{
+    /* Dummy implementation as listBoxSelectItem is pure virtual in SelectElement class */
+}
+
 }
 
 #endif
diff --git a/WebCore/wml/WMLSelectElement.h b/WebCore/wml/WMLSelectElement.h
index 5ab7da6..3ec7fd2 100644
--- a/WebCore/wml/WMLSelectElement.h
+++ b/WebCore/wml/WMLSelectElement.h
@@ -86,7 +86,8 @@
     void selectInitialOptions();
 
     bool initialized() const { return m_initialized; }
-
+    
+    virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
 private:
     virtual void insertedIntoTree(bool);
 
diff --git a/WebCore/wml/WMLVariables.cpp b/WebCore/wml/WMLVariables.cpp
index f48aa1c..f7be400 100644
--- a/WebCore/wml/WMLVariables.cpp
+++ b/WebCore/wml/WMLVariables.cpp
@@ -251,7 +251,7 @@
         if (!conversionMode.isEmpty()) {
             // Override default escape mode, if desired
             WMLVariableEscapingMode specifiedEscapeMode = WMLVariableEscapingNone; 
-            if (isValid = isValidVariableEscapingModeString(conversionMode, specifiedEscapeMode))
+            if ((isValid = isValidVariableEscapingModeString(conversionMode, specifiedEscapeMode)))
                 escapeMode = specifiedEscapeMode;
 
             if (!isValid)
diff --git a/WebCore/workers/AbstractWorker.cpp b/WebCore/workers/AbstractWorker.cpp
index 6ba8922..10bc95f 100644
--- a/WebCore/workers/AbstractWorker.cpp
+++ b/WebCore/workers/AbstractWorker.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -38,6 +38,7 @@
 #include "Event.h"
 #include "EventException.h"
 #include "EventNames.h"
+#include "InspectorController.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 
@@ -50,6 +51,21 @@
 
 AbstractWorker::~AbstractWorker()
 {
+    onDestroyWorker();
+}
+
+void AbstractWorker::onDestroyWorker()
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext() ? scriptExecutionContext()->inspectorController() : 0)
+        inspector->didDestroyWorker(asID());
+#endif
+}
+
+void AbstractWorker::contextDestroyed()
+{
+    onDestroyWorker();
+    ActiveDOMObject::contextDestroyed(); 
 }
 
 KURL AbstractWorker::resolveURL(const String& url, ExceptionCode& ec)
diff --git a/WebCore/workers/AbstractWorker.h b/WebCore/workers/AbstractWorker.h
index 2209856..789dba2 100644
--- a/WebCore/workers/AbstractWorker.h
+++ b/WebCore/workers/AbstractWorker.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -57,18 +57,21 @@
         using RefCounted<AbstractWorker>::ref;
         using RefCounted<AbstractWorker>::deref;
 
+        virtual void contextDestroyed();
         AbstractWorker(ScriptExecutionContext*);
         virtual ~AbstractWorker();
 
     protected:
         // Helper function that converts a URL to an absolute URL and checks the result for validity.
         KURL resolveURL(const String& url, ExceptionCode& ec);
+        intptr_t asID() const { return reinterpret_cast<intptr_t>(this); }
 
     private:
         virtual void refEventTarget() { ref(); }
         virtual void derefEventTarget() { deref(); }
         virtual EventTargetData* eventTargetData();
         virtual EventTargetData* ensureEventTargetData();
+        void onDestroyWorker();
         
         EventTargetData m_eventTargetData;
     };
diff --git a/WebCore/workers/AbstractWorker.idl b/WebCore/workers/AbstractWorker.idl
index e5a51d6..4361dfc 100644
--- a/WebCore/workers/AbstractWorker.idl
+++ b/WebCore/workers/AbstractWorker.idl
@@ -38,12 +38,12 @@
 
         attribute EventListener onerror;
 
-        [Custom] void addEventListener(in DOMString type,
-                                       in EventListener listener,
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type,
+        [JSCCustom] void addEventListener(in DOMString type,
                                           in EventListener listener,
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type,
+                                             in EventListener listener,
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/workers/DedicatedWorkerContext.cpp b/WebCore/workers/DedicatedWorkerContext.cpp
index 82dc4b3..54b5ba8 100644
--- a/WebCore/workers/DedicatedWorkerContext.cpp
+++ b/WebCore/workers/DedicatedWorkerContext.cpp
@@ -62,8 +62,6 @@
 
 void DedicatedWorkerContext::postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionCode& ec)
 {
-    if (isClosing())
-        return;
     // Disentangle the port in preparation for sending it to the remote context.
     OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(ports, ec);
     if (ec)
@@ -71,9 +69,9 @@
     thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.release());
 }
 
-void DedicatedWorkerContext::importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode& ec)
+void DedicatedWorkerContext::importScripts(const Vector<String>& urls, ExceptionCode& ec)
 {
-    Base::importScripts(urls, callerURL, callerLine, ec);
+    Base::importScripts(urls, ec);
     thread()->workerObjectProxy().reportPendingActivity(hasPendingActivity());
 }
 
diff --git a/WebCore/workers/DedicatedWorkerContext.h b/WebCore/workers/DedicatedWorkerContext.h
index 74a39d9..dba52ae 100644
--- a/WebCore/workers/DedicatedWorkerContext.h
+++ b/WebCore/workers/DedicatedWorkerContext.h
@@ -51,7 +51,7 @@
         virtual bool isDedicatedWorkerContext() const { return true; }
 
         // Overridden to allow us to check our pending activity after executing imported script.
-        virtual void importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode&);
+        virtual void importScripts(const Vector<String>& urls, ExceptionCode&);
 
         // EventTarget
         virtual DedicatedWorkerContext* toDedicatedWorkerContext() { return this; }
diff --git a/WebCore/workers/DefaultSharedWorkerRepository.cpp b/WebCore/workers/DefaultSharedWorkerRepository.cpp
index e4fa5d3..85ff768 100644
--- a/WebCore/workers/DefaultSharedWorkerRepository.cpp
+++ b/WebCore/workers/DefaultSharedWorkerRepository.cpp
@@ -37,6 +37,7 @@
 #include "ActiveDOMObject.h"
 #include "Document.h"
 #include "GenericWorkerTask.h"
+#include "InspectorController.h"
 #include "MessageEvent.h"
 #include "MessagePort.h"
 #include "NotImplemented.h"
@@ -78,7 +79,7 @@
 
     // WorkerReportingProxy
     virtual void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL);
-    virtual void postConsoleMessageToWorkerObject(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL);
+    virtual void postConsoleMessageToWorkerObject(MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL);
     virtual void workerContextClosed();
     virtual void workerContextDestroyed();
 
@@ -164,16 +165,16 @@
         (*iter)->postTask(createCallbackTask(&postExceptionTask, errorMessage, lineNumber, sourceURL));
 }
 
-static void postConsoleMessageTask(ScriptExecutionContext* document, MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+static void postConsoleMessageTask(ScriptExecutionContext* document, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
-    document->addMessage(destination, source, type, level, message, lineNumber, sourceURL);
+    document->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
-void SharedWorkerProxy::postConsoleMessageToWorkerObject(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
+void SharedWorkerProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
 {
     MutexLocker lock(m_workerDocumentsLock);
     for (HashSet<Document*>::iterator iter = m_workerDocuments.begin(); iter != m_workerDocuments.end(); ++iter)
-        (*iter)->postTask(createCallbackTask(&postConsoleMessageTask, destination, source, type, level, message, lineNumber, sourceURL));
+        (*iter)->postTask(createCallbackTask(&postConsoleMessageTask, source, type, level, message, lineNumber, sourceURL));
 }
 
 void SharedWorkerProxy::workerContextClosed()
@@ -289,9 +290,13 @@
     // Hand off the just-loaded code to the repository to start up the worker thread.
     if (m_scriptLoader->failed())
         m_worker->dispatchEvent(Event::create(eventNames().errorEvent, false, true));
-    else
+    else {
+#if ENABLE(INSPECTOR)
+        if (InspectorController* inspector = m_worker->scriptExecutionContext()->inspectorController())
+            inspector->scriptImported(m_scriptLoader->identifier(), m_scriptLoader->script());
+#endif
         DefaultSharedWorkerRepository::instance().workerScriptLoaded(*m_proxy, m_worker->scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), m_port.release());
-
+    }
     m_worker->unsetPendingActivity(m_worker.get());
     this->deref(); // This frees this object - must be the last action in this function.
 }
diff --git a/WebCore/workers/GenericWorkerTask.h b/WebCore/workers/GenericWorkerTask.h
index 27694c4..a9839c6 100644
--- a/WebCore/workers/GenericWorkerTask.h
+++ b/WebCore/workers/GenericWorkerTask.h
@@ -51,10 +51,6 @@
         typedef T* ParamType;
     };
 
-    template<typename T> struct GenericWorkerTaskTraits<std::auto_ptr<T> > {
-        typedef std::auto_ptr<T> ParamType;
-    };
-
     template<typename T> struct GenericWorkerTaskTraits<PassRefPtr<T> > {
         typedef PassRefPtr<T> ParamType;
     };
diff --git a/WebCore/workers/SharedWorker.cpp b/WebCore/workers/SharedWorker.cpp
index 71fcc68..cd856ff 100644
--- a/WebCore/workers/SharedWorker.cpp
+++ b/WebCore/workers/SharedWorker.cpp
@@ -34,6 +34,7 @@
 
 #include "SharedWorker.h"
 
+#include "InspectorController.h"
 #include "KURL.h"
 #include "MessageChannel.h"
 #include "MessagePort.h"
@@ -53,6 +54,10 @@
     if (ec)
         return;
     SharedWorkerRepository::connect(this, remotePort.release(), scriptUrl, name, ec);
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
+        inspector->didCreateWorker(asID(), scriptUrl.string(), true);
+#endif
 }
 
 SharedWorker::~SharedWorker()
diff --git a/WebCore/workers/Worker.cpp b/WebCore/workers/Worker.cpp
index 864b7c6..642502a 100644
--- a/WebCore/workers/Worker.cpp
+++ b/WebCore/workers/Worker.cpp
@@ -40,6 +40,7 @@
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
+#include "InspectorController.h"
 #include "MessageEvent.h"
 #include "TextEncoding.h"
 #include "WorkerContextProxy.h"
@@ -60,6 +61,10 @@
     m_scriptLoader = new WorkerScriptLoader();
     m_scriptLoader->loadAsynchronously(scriptExecutionContext(), scriptURL, DenyCrossOriginRequests, this);
     setPendingActivity(this);  // The worker context does not exist while loading, so we must ensure that the worker object is not collected, as well as its event listeners.
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
+        inspector->didCreateWorker(asID(), scriptURL.string(), false);
+#endif
 }
 
 Worker::~Worker()
@@ -117,9 +122,13 @@
 {
     if (m_scriptLoader->failed())
         dispatchEvent(Event::create(eventNames().errorEvent, false, true));
-    else
+    else {
         m_contextProxy->startWorkerContext(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script());
-
+#if ENABLE(INSPECTOR)
+        if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
+            inspector->scriptImported(m_scriptLoader->identifier(), m_scriptLoader->script());
+#endif
+    }
     m_scriptLoader = 0;
 
     unsetPendingActivity(this);
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index 0ec24e6..c6ee606 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -32,11 +32,13 @@
 #include "WorkerContext.h"
 
 #include "ActiveDOMObject.h"
-#include "Database.h"
 #include "DOMTimer.h"
 #include "DOMWindow.h"
+#include "Database.h"
+#include "ErrorEvent.h"
 #include "Event.h"
 #include "EventException.h"
+#include "InspectorController.h"
 #include "MessagePort.h"
 #include "NotImplemented.h"
 #include "ScriptSourceCode.h"
@@ -58,12 +60,31 @@
 
 namespace WebCore {
 
+class CloseWorkerContextTask : public ScriptExecutionContext::Task {
+public:
+    static PassOwnPtr<CloseWorkerContextTask> create()
+    {
+        return new CloseWorkerContextTask;
+    }
+
+    virtual void performTask(ScriptExecutionContext *context)
+    {
+        ASSERT(context->isWorkerContext());
+        WorkerContext* workerContext = static_cast<WorkerContext*>(context);
+        // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop().
+        workerContext->thread()->workerReportingProxy().workerContextClosed();
+    }
+
+    virtual bool isCleanupTask() const { return true; }
+};
+
 WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread)
     : m_url(url)
     , m_userAgent(userAgent)
     , m_script(new WorkerScriptController(this))
     , m_thread(thread)
     , m_closing(false)
+    , m_reportingException(false)
 {
     setSecurityOrigin(SecurityOrigin::create(url));
 }
@@ -121,8 +142,9 @@
         return;
 
     m_closing = true;
-    // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop().
-    thread()->workerReportingProxy().workerContextClosed();
+    // Let current script run to completion but prevent future script evaluations.
+    m_script->forbidExecution(WorkerScriptController::LetRunningScriptFinish);
+    postTask(CloseWorkerContextTask::create());
 }
 
 WorkerNavigator* WorkerContext::navigator() const
@@ -151,18 +173,6 @@
     return false;
 }
 
-void WorkerContext::resourceRetrievedByXMLHttpRequest(unsigned long, const ScriptString&)
-{
-    // FIXME: The implementation is pending the fixes in https://bugs.webkit.org/show_bug.cgi?id=23175
-    notImplemented();
-}
-
-void WorkerContext::scriptImported(unsigned long, const String&)
-{
-    // FIXME: The implementation is pending the fixes in https://bugs.webkit.org/show_bug.cgi?id=23175
-    notImplemented();
-}
-
 void WorkerContext::postTask(PassOwnPtr<Task> task)
 {
     thread()->runLoop().postTask(task);
@@ -188,12 +198,8 @@
     DOMTimer::removeById(scriptExecutionContext(), timeoutId);
 }
 
-void WorkerContext::importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode& ec)
+void WorkerContext::importScripts(const Vector<String>& urls, ExceptionCode& ec)
 {
-#if !ENABLE(INSPECTOR)
-    UNUSED_PARAM(callerURL);
-    UNUSED_PARAM(callerLine);
-#endif
     ec = 0;
     Vector<String>::const_iterator urlsEnd = urls.end();
     Vector<KURL> completedURLs;
@@ -217,9 +223,9 @@
             return;
         }
 
-        scriptExecutionContext()->scriptImported(scriptLoader.identifier(), scriptLoader.script());
 #if ENABLE(INSPECTOR)
-        scriptExecutionContext()->addMessage(InspectorControllerDestination, JSMessageSource, LogMessageType, LogMessageLevel, "Worker script imported: \"" + *it + "\".", callerLine, callerURL);
+        if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
+            inspector->scriptImported(scriptLoader.identifier(), scriptLoader.script());
 #endif
 
         ScriptValue exception;
@@ -234,16 +240,22 @@
 void WorkerContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
 {
     bool errorHandled = false;
-    if (onerror())
-        errorHandled = onerror()->reportError(this, errorMessage, sourceURL, lineNumber);
-
+    if (!m_reportingException) {
+        if (onerror()) {
+            m_reportingException = true;
+            RefPtr<ErrorEvent> errorEvent(ErrorEvent::create(errorMessage, sourceURL, lineNumber));
+            onerror()->handleEvent(this, errorEvent.get());
+            errorHandled = errorEvent->defaultPrevented();
+            m_reportingException = false;
+        }
+    }
     if (!errorHandled)
         thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
 }
 
-void WorkerContext::addMessage(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+void WorkerContext::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
-    thread()->workerReportingProxy().postConsoleMessageToWorkerObject(destination, source, type, level, message, lineNumber, sourceURL);
+    thread()->workerReportingProxy().postConsoleMessageToWorkerObject(source, type, level, message, lineNumber, sourceURL);
 }
 
 #if ENABLE(NOTIFICATIONS)
@@ -256,7 +268,7 @@
 #endif
 
 #if ENABLE(DATABASE)
-PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode& ec)
+PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
 {
     if (!securityOrigin()->canAccessDatabase()) {
         ec = SECURITY_ERR;
@@ -267,7 +279,7 @@
     if (!Database::isAvailable())
         return 0;
 
-    return Database::openDatabase(this, name, version, displayName, estimatedSize, ec);
+    return Database::openDatabase(this, name, version, displayName, estimatedSize, creationCallback, ec);
 }
 #endif
 
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index a795947..7026e35 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -31,6 +31,7 @@
 
 #include "AtomicStringHash.h"
 #include "Database.h"
+#include "DatabaseCallback.h"
 #include "EventListener.h"
 #include "EventNames.h"
 #include "EventTarget.h"
@@ -74,9 +75,6 @@
 
         bool hasPendingActivity() const;
 
-        virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
-        virtual void scriptImported(unsigned long identifier, const String& sourceString);
-
         virtual void postTask(PassOwnPtr<Task>); // Executes the task on context's thread asynchronously.
 
         // WorkerGlobalScope
@@ -87,7 +85,7 @@
         DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
 
         // WorkerUtils
-        virtual void importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode&);
+        virtual void importScripts(const Vector<String>& urls, ExceptionCode&);
         WorkerNavigator* navigator() const;
 
         // Timers
@@ -98,7 +96,7 @@
 
         // ScriptExecutionContext
         virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
-        virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
+        virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
 
 #if ENABLE(NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
@@ -106,7 +104,7 @@
 
 #if ENABLE(DATABASE)
         // HTML 5 client-side database
-        PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, ExceptionCode&);
+        PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
         // Not implemented yet.
         virtual bool isDatabaseReadOnly() const { return false; }
         // Not implemented yet.
@@ -153,6 +151,7 @@
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
         bool m_closing;
+        bool m_reportingException;
         EventTargetData m_eventTargetData;
     };
 
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index bce4f53..abb8ea8 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -62,12 +62,12 @@
 
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                       in EventListener listener, 
-                                       in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 
diff --git a/WebCore/workers/WorkerLocation.cpp b/WebCore/workers/WorkerLocation.cpp
index e1fe9d7..b934abd 100644
--- a/WebCore/workers/WorkerLocation.cpp
+++ b/WebCore/workers/WorkerLocation.cpp
@@ -46,7 +46,7 @@
 
 String WorkerLocation::host() const
 {
-    return m_url.port() ? m_url.host() + ":" + String::number((static_cast<int>(m_url.port()))) : m_url.host();
+    return m_url.port() ? m_url.host() + ":" + String::number(m_url.port()) : m_url.host();
 }
 
 String WorkerLocation::hostname() const
@@ -56,7 +56,7 @@
 
 String WorkerLocation::port() const
 {
-    return m_url.port() ? String::number(static_cast<int>(m_url.port())) : "";
+    return m_url.port() ? String::number(m_url.port()) : "";
 }
 
 String WorkerLocation::pathname() const
diff --git a/WebCore/workers/WorkerMessagingProxy.cpp b/WebCore/workers/WorkerMessagingProxy.cpp
index 2e1dfe0..1b19775 100644
--- a/WebCore/workers/WorkerMessagingProxy.cpp
+++ b/WebCore/workers/WorkerMessagingProxy.cpp
@@ -38,6 +38,7 @@
 #include "ErrorEvent.h"
 #include "ExceptionCode.h"
 #include "GenericWorkerTask.h"
+#include "InspectorController.h"
 #include "MessageEvent.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"
@@ -278,16 +279,16 @@
     m_scriptExecutionContext->postTask(WorkerExceptionTask::create(errorMessage, lineNumber, sourceURL, this));
 }
     
-static void postConsoleMessageTask(ScriptExecutionContext* context, WorkerMessagingProxy* messagingProxy, MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+static void postConsoleMessageTask(ScriptExecutionContext* context, WorkerMessagingProxy* messagingProxy, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
 {
     if (messagingProxy->askedToTerminate())
         return;
-    context->addMessage(destination, source, type, level, message, lineNumber, sourceURL);
+    context->addMessage(source, type, level, message, lineNumber, sourceURL);
 }
 
-void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageDestination destination, MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
+void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
 {
-    m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageTask, this, destination, source, type, level, message, lineNumber, sourceURL));
+    m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageTask, this, source, type, level, message, lineNumber, sourceURL));
 }
 
 void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread> workerThread)
diff --git a/WebCore/workers/WorkerMessagingProxy.h b/WebCore/workers/WorkerMessagingProxy.h
index 90b87f4..296fa42 100644
--- a/WebCore/workers/WorkerMessagingProxy.h
+++ b/WebCore/workers/WorkerMessagingProxy.h
@@ -62,7 +62,7 @@
         // (Only use these methods in the worker context thread.)
         virtual void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>);
         virtual void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL);
-        virtual void postConsoleMessageToWorkerObject(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL);
+        virtual void postConsoleMessageToWorkerObject(MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL);
         virtual void confirmMessageFromWorkerObject(bool hasPendingActivity);
         virtual void reportPendingActivity(bool hasPendingActivity);
         virtual void workerContextClosed();
diff --git a/WebCore/workers/WorkerReportingProxy.h b/WebCore/workers/WorkerReportingProxy.h
index f0447c8..063dc81 100644
--- a/WebCore/workers/WorkerReportingProxy.h
+++ b/WebCore/workers/WorkerReportingProxy.h
@@ -46,7 +46,7 @@
 
         virtual void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
 
-        virtual void postConsoleMessageToWorkerObject(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL) = 0;
+        virtual void postConsoleMessageToWorkerObject(MessageSource, MessageType, MessageLevel, const String& message, int lineNumber, const String& sourceURL) = 0;
 
         // Invoked when close() is invoked on the worker context.
         virtual void workerContextClosed() = 0;
diff --git a/WebCore/workers/WorkerScriptLoader.cpp b/WebCore/workers/WorkerScriptLoader.cpp
index 52baf2d..fa7d3c4 100644
--- a/WebCore/workers/WorkerScriptLoader.cpp
+++ b/WebCore/workers/WorkerScriptLoader.cpp
@@ -63,6 +63,7 @@
     ThreadableLoaderOptions options;
     options.allowCredentials = true;
     options.crossOriginRequestPolicy = crossOriginRequestPolicy;
+    options.sendLoadCallbacks = true;
 
     WorkerThreadableLoader::loadResourceSynchronously(static_cast<WorkerContext*>(scriptExecutionContext), *request, *this, options);
 }
@@ -80,6 +81,7 @@
     ThreadableLoaderOptions options;
     options.allowCredentials = true;
     options.crossOriginRequestPolicy = crossOriginRequestPolicy;
+    options.sendLoadCallbacks = true;
 
     m_threadableLoader = ThreadableLoader::create(scriptExecutionContext, this, *request, options);
 }
diff --git a/WebCore/workers/WorkerThread.cpp b/WebCore/workers/WorkerThread.cpp
index 4e3ffa1..16c5b70 100644
--- a/WebCore/workers/WorkerThread.cpp
+++ b/WebCore/workers/WorkerThread.cpp
@@ -58,9 +58,9 @@
 
 struct WorkerThreadStartupData : Noncopyable {
 public:
-    static std::auto_ptr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode)
+    static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode)
     {
-        return std::auto_ptr<WorkerThreadStartupData>(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode));
+        return new WorkerThreadStartupData(scriptURL, userAgent, sourceCode);
     }
 
     KURL m_scriptURL;
@@ -121,7 +121,7 @@
         if (m_runLoop.terminated()) {
             // The worker was terminated before the thread had a chance to run. Since the context didn't exist yet,
             // forbidExecution() couldn't be called from stop().
-           m_workerContext->script()->forbidExecution();
+           m_workerContext->script()->forbidExecution(WorkerScriptController::TerminateRunningScript);
         }
     }
 
@@ -183,10 +183,12 @@
         ASSERT(context->isWorkerContext());
         WorkerContext* workerContext = static_cast<WorkerContext*>(context);
 
+#if ENABLE(DATABASE)
         // We currently ignore any DatabasePolicy used for the document's
         // databases; if it's actually used anywhere, this should be revisited.
         DatabaseTaskSynchronizer cleanupSync;
         workerContext->stopDatabases(&cleanupSync);
+#endif
 
         workerContext->stopActiveDOMObjects();
 
@@ -195,9 +197,11 @@
         workerContext->removeAllEventListeners();
         workerContext->clearScript();
 
+#if ENABLE(DATABASE)
         // We wait for the database thread to clean up all its stuff so that we
         // can do more stringent leak checks as we exit.
         cleanupSync.waitForTaskCompletion();
+#endif
 
         // Stick a shutdown command at the end of the queue, so that we deal
         // with all the cleanup tasks the databases post first.
@@ -214,7 +218,7 @@
 
     // Ensure that tasks are being handled by thread event loop. If script execution weren't forbidden, a while(1) loop in JS could keep the thread alive forever.
     if (m_workerContext) {
-        m_workerContext->script()->forbidExecution();
+        m_workerContext->script()->forbidExecution(WorkerScriptController::TerminateRunningScript);
 
     // FIXME: Rudely killing the thread won't work when we allow nested workers, because they will try to post notifications of their destruction.
     // This can likely use the same mechanism as used for databases above.
diff --git a/WebCore/wscript b/WebCore/wscript
index 8aa279c..752486c 100644
--- a/WebCore/wscript
+++ b/WebCore/wscript
@@ -114,7 +114,9 @@
         ]
 
     features = [build_port]
-    exclude_patterns = ['*None.cpp', '*CFNet.cpp', '*Qt.cpp', '*Wince.cpp', '*Gtk.cpp', '*Mac.cpp', '*Safari.cpp', '*Chromium*.cpp','*SVG*.cpp', '*AllInOne.cpp', 'test*bindings.*']
+    exclude_patterns = ['*AllInOne.cpp', '*Brew.cpp', '*CFNet.cpp', '*Chromium*.cpp', 
+            '*Gtk.cpp', '*Mac.cpp', '*None.cpp', '*Qt.cpp', '*Safari.cpp',
+            'test*bindings.*', '*Wince.cpp']
     if build_port == 'wx':
         features.append('curl')
         if not building_on_win32:
@@ -178,6 +180,25 @@
         excludes.append('JSPositionCallback.cpp')
         excludes.append('JSDOMStringList.cpp')
         excludes.append('JSInspectorController.cpp')
+        
+        # The bindings generator seems to think these are ref-counted, while they aren't in trunk.
+        excludes.append('JSElementTimeControl.cpp')
+        excludes.append('JSSVGAnimatedPathData.cpp')
+        excludes.append('JSSVGAnimatedPoints.cpp')
+        excludes.append('JSSVGExternalResourcesRequired.cpp')
+        excludes.append('JSSVGFilterPrimitiveStandardAttributes.cpp')
+        excludes.append('JSSVGLocatable.cpp')
+        excludes.append('JSSVGStyleTable.cpp')
+        excludes.append('JSSVGTests.cpp')
+        excludes.append('JSSVGStylable.cpp')
+        excludes.append('JSSVGZoomAndPan.cpp')
+        
+        # These are files that expect methods not in the base C++ class, usually XYZAnimated methods.
+        excludes.append('JSSVGFitToViewBox.cpp')
+        excludes.append('JSSVGLangSpace.cpp')
+        excludes.append('JSSVGTransformable.cpp')
+        excludes.append('JSSVGURIReference.cpp')
+        
         if building_on_win32:
             excludes.append('SharedTimerWx.cpp')
             excludes.append('GlyphMapWx.cpp')
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 32818df..c95351f 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -24,8 +24,8 @@
 
 #include "Blob.h"
 #include "Cache.h"
-#include "CString.h"
 #include "CrossOriginAccessControl.h"
+#include "DOMFormData.h"
 #include "DOMImplementation.h"
 #include "Document.h"
 #include "Event.h"
@@ -33,6 +33,7 @@
 #include "EventListener.h"
 #include "EventNames.h"
 #include "HTTPParsers.h"
+#include "InspectorController.h"
 #include "InspectorTimelineAgent.h"
 #include "ResourceError.h"
 #include "ResourceRequest.h"
@@ -44,6 +45,7 @@
 #include "XMLHttpRequestProgressEvent.h"
 #include "XMLHttpRequestUpload.h"
 #include "markup.h"
+#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/RefCountedLeakCounter.h>
 
@@ -127,6 +129,29 @@
     return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set-cookie2");
 }
 
+static void setCharsetInMediaType(String& mediaType, const String& charsetValue)
+{
+    unsigned int pos = 0, len = 0;
+
+    findCharsetInMediaType(mediaType, pos, len);
+
+    if (!len) {
+        // When no charset found, append new charset.
+        mediaType.stripWhiteSpace();
+        if (mediaType[mediaType.length() - 1] != ';')
+            mediaType.append(";");
+        mediaType.append(" charset=");
+        mediaType.append(charsetValue);
+    } else {
+        // Found at least one existing charset, replace all occurrences with new charset.
+        while (len) {
+            mediaType.replace(pos, len, charsetValue);
+            unsigned int start = pos + charsetValue.length();
+            findCharsetInMediaType(mediaType, pos, len, start);
+        }
+    }
+}
+
 static const XMLHttpRequestStaticData* staticData = 0;
 
 static const XMLHttpRequestStaticData* createXMLHttpRequestStaticData()
@@ -157,6 +182,7 @@
     , m_receivedLength(0)
     , m_lastSendLineNumber(0)
     , m_exceptionCode(0)
+    , m_progressEventThrottle(this)
 {
     initializeXMLHttpRequestStaticData();
 #ifndef NDEBUG
@@ -214,7 +240,7 @@
             // The W3C spec requires this.
             m_responseXML = 0;
         } else {
-            m_responseXML = document()->implementation()->createDocument(0);
+            m_responseXML = Document::create(0);
             m_responseXML->open();
             m_responseXML->setURL(m_url);
             // FIXME: Set Last-Modified.
@@ -258,7 +284,7 @@
         timelineAgent->willChangeXHRReadyState(m_url.string(), m_state);
 #endif
 
-    dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent));
+    m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
 
 #if ENABLE(INSPECTOR)
     if (callTimelineAgentOnReadyStateChange && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext())))
@@ -273,7 +299,7 @@
             timelineAgent->willLoadXHR(m_url.string());
 #endif
 
-        dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
+        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
 
 #if ENABLE(INSPECTOR)
         if (callTimelineAgentOnLoad && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext())))
@@ -292,6 +318,11 @@
     m_includeCredentials = value;
 }
 
+void XMLHttpRequest::open(const String& method, const KURL& url, ExceptionCode& ec)
+{
+    open(method, url, true, ec);
+}
+
 void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionCode& ec)
 {
     internalAbort();
@@ -425,6 +456,9 @@
             else
 #endif
                 setRequestHeaderInternal("Content-Type", "application/xml");
+        } else {
+            setCharsetInMediaType(contentType, "UTF-8");
+            m_requestHeaders.set("Content-Type", contentType);
         }
 
         m_requestEntityBody = FormData::create(UTF8Encoding().encode(body.characters(), body.length(), EntitiesForUnencodables));
@@ -444,7 +478,30 @@
         // FIXME: Should we set a Content-Type if one is not set.
         // FIXME: add support for uploading bundles.
         m_requestEntityBody = FormData::create();
+#if ENABLE(BLOB_SLICE)
+        m_requestEntityBody->appendFileRange(body->path(), body->start(), body->length(), body->modificationTime());
+#else
         m_requestEntityBody->appendFile(body->path(), false);
+#endif
+    }
+
+    createRequest(ec);
+}
+
+void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec)
+{
+    if (!initSend(ec))
+        return;
+
+    if (m_method != "GET" && m_method != "HEAD" && m_url.protocolInHTTPFamily()) {
+        m_requestEntityBody = FormData::createMultiPart(*body, document());
+
+        String contentType = getRequestHeader("Content-Type");
+        if (contentType.isEmpty()) {
+            contentType = "multipart/form-data; boundary=";
+            contentType += m_requestEntityBody->boundary().data();
+            setRequestHeaderInternal("Content-Type", contentType);
+        }
     }
 
     createRequest(ec);
@@ -457,7 +514,7 @@
     // Also, only async requests support upload progress events.
     bool forcePreflight = false;
     if (m_async) {
-        dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
+        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
         if (m_requestEntityBody && m_upload) {
             forcePreflight = m_upload->hasEventListeners();
             m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
@@ -549,7 +606,7 @@
         m_state = UNSENT;
     }
 
-    dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+    m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
     if (!m_uploadComplete) {
         m_uploadComplete = true;
         if (m_upload && m_uploadEventsAllowed)
@@ -603,7 +660,7 @@
 void XMLHttpRequest::networkError()
 {
     genericError();
-    dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
+    m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
     if (!m_uploadComplete) {
         m_uploadComplete = true;
         if (m_upload && m_uploadEventsAllowed)
@@ -615,7 +672,7 @@
 void XMLHttpRequest::abortError()
 {
     genericError();
-    dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+    m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
     if (!m_uploadComplete) {
         m_uploadComplete = true;
         if (m_upload && m_uploadEventsAllowed)
@@ -651,7 +708,7 @@
         return;
     // FIXME: It's not good to report the bad usage without indicating what source line it came from.
     // We should pass additional parameters so we can tell the console where the mistake occurred.
-    context->addMessage(ConsoleDestination, JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
+    context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, 1, String());
 }
 
 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& value, ExceptionCode& ec)
@@ -841,9 +898,9 @@
     if (m_decoder)
         m_responseText += m_decoder->flush();
 
-    scriptExecutionContext()->resourceRetrievedByXMLHttpRequest(identifier, m_responseText);
 #if ENABLE(INSPECTOR)
-    scriptExecutionContext()->addMessage(InspectorControllerDestination, JSMessageSource, LogMessageType, LogMessageLevel, "XHR finished loading: \"" + m_url + "\".", m_lastSendLineNumber, m_lastSendURL);
+    if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
+        inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText);
 #endif
 
     bool hadLoader = m_loader;
@@ -918,9 +975,8 @@
         long long expectedLength = m_response.expectedContentLength();
         m_receivedLength += len;
 
-        // FIXME: the spec requires that we dispatch the event according to the least
-        // frequent method between every 350ms (+/-200ms) and for every byte received.
-        dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, expectedLength && m_receivedLength <= expectedLength, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength)));
+        bool lengthComputable = expectedLength && m_receivedLength <= expectedLength;
+        m_progressEventThrottle.dispatchProgressEvent(lengthComputable, static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength));
 
         if (m_state != LOADING)
             changeState(LOADING);
@@ -935,6 +991,16 @@
     return !m_loader;
 }
 
+void XMLHttpRequest::suspend()
+{
+    m_progressEventThrottle.suspend();
+}
+
+void XMLHttpRequest::resume()
+{
+    m_progressEventThrottle.resume();
+}
+
 void XMLHttpRequest::stop()
 {
     internalAbort();
diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h
index 2cea5c6..ca308cc 100644
--- a/WebCore/xml/XMLHttpRequest.h
+++ b/WebCore/xml/XMLHttpRequest.h
@@ -29,12 +29,14 @@
 #include "ResourceResponse.h"
 #include "ScriptString.h"
 #include "ThreadableLoaderClient.h"
+#include "XMLHttpRequestProgressEventThrottle.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
 class Blob;
 class Document;
+class DOMFormData;
 class ResourceRequest;
 class TextResourceDecoder;
 class ThreadableLoader;
@@ -57,6 +59,8 @@
 
     virtual void contextDestroyed();
     virtual bool canSuspend() const;
+    virtual void suspend();
+    virtual void resume();
     virtual void stop();
 
     virtual ScriptExecutionContext* scriptExecutionContext() const;
@@ -66,6 +70,7 @@
     State readyState() const;
     bool withCredentials() const { return m_includeCredentials; }
     void setWithCredentials(bool, ExceptionCode&);
+    void open(const String& method, const KURL&, ExceptionCode&);
     void open(const String& method, const KURL&, bool async, ExceptionCode&);
     void open(const String& method, const KURL&, bool async, const String& user, ExceptionCode&);
     void open(const String& method, const KURL&, bool async, const String& user, const String& password, ExceptionCode&);
@@ -73,6 +78,7 @@
     void send(Document*, ExceptionCode&);
     void send(const String&, ExceptionCode&);
     void send(Blob*, ExceptionCode&);
+    void send(DOMFormData*, ExceptionCode&);
     void abort();
     void setRequestHeader(const AtomicString& name, const String& value, ExceptionCode&);
     void overrideMimeType(const String& override);
@@ -184,6 +190,8 @@
     ExceptionCode m_exceptionCode;
 
     EventTargetData m_eventTargetData;
+
+    XMLHttpRequestProgressEventThrottle m_progressEventThrottle;
 };
 
 } // namespace WebCore
diff --git a/WebCore/xml/XMLHttpRequest.idl b/WebCore/xml/XMLHttpRequest.idl
index 70cd58a..5a86fe5 100644
--- a/WebCore/xml/XMLHttpRequest.idl
+++ b/WebCore/xml/XMLHttpRequest.idl
@@ -91,12 +91,12 @@
         [Custom] void overrideMimeType(in DOMString override);
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                      in EventListener listener, 
-                                      in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp b/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
new file mode 100644
index 0000000..0eb6398
--- /dev/null
+++ b/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org>
+ * All right 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 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 "XMLHttpRequestProgressEventThrottle.h"
+
+#include "EventTarget.h"
+#include "XMLHttpRequestProgressEvent.h"
+
+namespace WebCore {
+
+const double XMLHttpRequestProgressEventThrottle::minimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification.
+
+XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(EventTarget* target)
+    : m_target(target)
+    , m_loaded(0)
+    , m_total(0)
+    , m_suspended(false)
+{
+    ASSERT(target);
+}
+
+XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle()
+{
+}
+
+void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(bool lengthComputable, unsigned loaded, unsigned total)
+{
+    ASSERT(!suspended());
+    if (!isActive()) {
+        // The timer is not active so the least frequent event for now is every byte.
+        // Just go ahead and dispatch the event.
+
+        // We should not have any pending loaded & total information from a previous run.
+        ASSERT(!m_loaded);
+        ASSERT(!m_total);
+
+        dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, lengthComputable, loaded, total));
+        startRepeating(minimumProgressEventDispatchingIntervalInSeconds);
+        return;
+    }
+
+    // The timer is already active so minimumProgressEventDispatchingIntervalInSeconds is the least frequent event.
+    m_lengthComputable = lengthComputable;
+    m_loaded = loaded;
+    m_total = total;
+}
+
+void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction)
+{
+    ASSERT(!suspended());
+    // We should not have any pending events from a previous resume.
+    ASSERT(!m_pausedEvent);
+
+    if (progressEventAction == FlushProgressEvent)
+        flushProgressEvent();
+
+    m_target->dispatchEvent(event);
+}
+
+void XMLHttpRequestProgressEventThrottle::flushProgressEvent()
+{
+    if (!hasEventToDispatch())
+        return;
+
+    PassRefPtr<Event> event = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total);
+    m_loaded = 0;
+    m_total = 0;
+
+    // We stop the timer as this is called when no more events are supposed to occur.
+    stop();
+
+    m_target->dispatchEvent(event);
+}
+
+void XMLHttpRequestProgressEventThrottle::dispatchPausedEvent()
+{
+    ASSERT(!suspended());
+    if (!m_pausedEvent)
+        return;
+
+    m_target->dispatchEvent(m_pausedEvent);
+    m_pausedEvent = 0;
+}
+
+void XMLHttpRequestProgressEventThrottle::fired()
+{
+    ASSERT(isActive());
+    ASSERT(!suspended());
+    ASSERT(!m_pausedEvent);
+    if (!hasEventToDispatch()) {
+        // No progress event was queued since the previous dispatch, we can safely stop the timer.
+        stop();
+        return;
+    }
+
+    m_target->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total));
+    m_total = 0;
+    m_loaded = 0;
+}
+
+bool XMLHttpRequestProgressEventThrottle::hasEventToDispatch() const
+{
+    return (m_total || m_loaded) && isActive();
+}
+
+void XMLHttpRequestProgressEventThrottle::suspend()
+{
+    ASSERT(!m_pausedEvent);
+
+    m_suspended = true;
+    // If we have a progress event waiting to be dispatched,
+    // just queue it.
+    if (hasEventToDispatch()) {
+        m_pausedEvent = XMLHttpRequestProgressEvent::create(eventNames().progressEvent, m_lengthComputable, m_loaded, m_total);
+        m_total = 0;
+        m_loaded = 0;
+    }
+    stop();
+}
+
+void XMLHttpRequestProgressEventThrottle::resume()
+{
+    ASSERT(!m_loaded);
+    ASSERT(!m_total);
+
+    m_suspended = false;
+    dispatchPausedEvent();
+}
+
+} // namespace WebCore
diff --git a/WebCore/xml/XMLHttpRequestProgressEventThrottle.h b/WebCore/xml/XMLHttpRequestProgressEventThrottle.h
new file mode 100644
index 0000000..f51aea1
--- /dev/null
+++ b/WebCore/xml/XMLHttpRequestProgressEventThrottle.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org>
+ * All right 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 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 XMLHttpRequestProgressEventThrottle_h
+#define XMLHttpRequestProgressEventThrottle_h
+
+#include "Timer.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class Event;
+class EventTarget;
+
+enum ProgressEventAction {
+    DoNotFlushProgressEvent,
+    FlushProgressEvent
+};
+
+// This implements the XHR2 progress event dispatching: "dispatch a progress event called progress
+// about every 50ms or for every byte received, whichever is least frequent".
+class XMLHttpRequestProgressEventThrottle : public TimerBase {
+public:
+    XMLHttpRequestProgressEventThrottle(EventTarget*);
+    virtual ~XMLHttpRequestProgressEventThrottle();
+
+    void dispatchProgressEvent(bool lengthComputable, unsigned loaded, unsigned total);
+    void dispatchEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent);
+
+    void suspend();
+    void resume();
+
+    bool suspended() const { return m_suspended; }
+
+private:
+    static const double minimumProgressEventDispatchingIntervalInSeconds;
+
+    virtual void fired();
+    void dispatchPausedEvent();
+    void flushProgressEvent();
+
+    bool hasEventToDispatch() const;
+
+    // Weak pointer to our XMLHttpRequest object as it is the one holding us.
+    EventTarget* m_target;
+
+    bool m_lengthComputable;
+    unsigned m_loaded;
+    unsigned m_total;
+
+    bool m_suspended;
+    RefPtr<Event> m_pausedEvent;
+};
+
+} // namespace WebCore
+
+#endif // XMLHttpRequestProgressEventThrottle_h
diff --git a/WebCore/xml/XMLHttpRequestUpload.idl b/WebCore/xml/XMLHttpRequestUpload.idl
index ce392f3..a712a37 100644
--- a/WebCore/xml/XMLHttpRequestUpload.idl
+++ b/WebCore/xml/XMLHttpRequestUpload.idl
@@ -42,12 +42,12 @@
         attribute EventListener onprogress;
 
         // EventTarget interface
-        [Custom] void addEventListener(in DOMString type, 
-                                      in EventListener listener, 
-                                      in boolean useCapture);
-        [Custom] void removeEventListener(in DOMString type, 
+        [JSCCustom] void addEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
+        [JSCCustom] void removeEventListener(in DOMString type, 
+                                             in EventListener listener, 
+                                             in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
diff --git a/WebCore/xml/XSLStyleSheetLibxslt.cpp b/WebCore/xml/XSLStyleSheetLibxslt.cpp
index dbd806a..c3feca9 100644
--- a/WebCore/xml/XSLStyleSheetLibxslt.cpp
+++ b/WebCore/xml/XSLStyleSheetLibxslt.cpp
@@ -24,7 +24,6 @@
 
 #if ENABLE(XSLT)
 
-#include "CString.h"
 #include "Console.h"
 #include "DOMWindow.h"
 #include "DocLoader.h"
@@ -37,6 +36,7 @@
 #include "XSLImportRule.h"
 #include "XSLTProcessor.h"
 #include "loader.h"
+#include <wtf/text/CString.h>
 
 #include <libxml/uri.h>
 #include <libxslt/xsltutils.h>
@@ -154,6 +154,8 @@
     int size = string.length() * sizeof(UChar);
 
     xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size);
+    if (!ctxt)
+        return 0;
 
     if (m_parentStyleSheet) {
         // The XSL transform may leave the newly-transformed document
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index b182243..b530d52 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -41,7 +41,6 @@
 #include "loader.h"
 #include "markup.h"
 #include <wtf/Assertions.h>
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -70,10 +69,10 @@
 
     RefPtr<Document> result;
     if (sourceMIMEType == "text/plain") {
-        result = ownerDocument->implementation()->createDocument(frame);
+        result = Document::create(frame);
         transformTextStringToXHTMLDocumentString(documentSource);
     } else
-        result = ownerDocument->implementation()->createDocument(sourceMIMEType, frame, false);
+        result = DOMImplementation::createDocument(sourceMIMEType, frame, false);
 
     // Before parsing, we need to save & detach the old document and get the new document
     // in place. We have to do this only if we're rendering the result document.
diff --git a/WebCore/xml/XSLTProcessorLibxslt.cpp b/WebCore/xml/XSLTProcessorLibxslt.cpp
index e2da3ed..a0ed450 100644
--- a/WebCore/xml/XSLTProcessorLibxslt.cpp
+++ b/WebCore/xml/XSLTProcessorLibxslt.cpp
@@ -27,7 +27,6 @@
 #include "XSLTProcessor.h"
 
 #include "Console.h"
-#include "CString.h"
 #include "DOMWindow.h"
 #include "DocLoader.h"
 #include "Frame.h"
@@ -46,7 +45,7 @@
 #include <libxslt/variables.h>
 #include <libxslt/xsltutils.h>
 #include <wtf/Assertions.h>
-#include <wtf/Platform.h>
+#include <wtf/text/CString.h>
 #include <wtf/Vector.h>
 
 #if PLATFORM(MAC)
diff --git a/WebCore/xml/XSLTProcessorQt.cpp b/WebCore/xml/XSLTProcessorQt.cpp
index 9ac3f5d..29dbacf 100644
--- a/WebCore/xml/XSLTProcessorQt.cpp
+++ b/WebCore/xml/XSLTProcessorQt.cpp
@@ -32,7 +32,6 @@
 #include "loader.h"
 #include "markup.h"
 #include <wtf/Assertions.h>
-#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 #include <qabstractmessagehandler.h>
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 134a252..3ba6146 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,357 @@
+2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
+
+        Reviewed by Adam Roben.
+
+        Update EFL port to match recent API changes.
+        http://webkit.org/b/37853
+
+        * efl/WebCoreSupport/EditorClientEfl.cpp:
+        * efl/WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::didTransferChildFrameToNewDocument):
+        (WebCore::FrameLoaderClientEfl::objectContentType):
+        (WebCore::FrameLoaderClientEfl::dispatchDidChangeIcons):
+        (WebCore::FrameLoaderClientEfl::canShowMIMEType):
+        * efl/WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-04-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35915
+
+        * efl/WebCoreSupport/FrameLoaderClientEfl.cpp: Added.
+        * efl/WebCoreSupport/FrameLoaderClientEfl.h: Added.
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Expose UserContentURLPattern as WebKit SPI
+
+        Fixes <http://webkit.org/b/37354>.
+
+        Reviewed by Tim Hatcher.
+
+        * WebKit.xcodeproj/project.pbxproj: Add WebUserContentURLPattern.
+
+2010-04-15  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35918
+
+        * efl/WebCoreSupport/EditorClientEfl.cpp: Added.
+        * efl/WebCoreSupport/EditorClientEfl.h: Added.
+
+2010-04-10  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/7845305> Further adoption of formal protocols for delegates.
+
+        Move EmptyProtocolDefinitions.h down in to WebCore, and add the new protocols. Adopt the protocols in the appropriate places.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2010-04-07  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add ewk_view (the high level object to acces the WebKit-EFL browser
+        component) to efl/ewk.
+        http://webkit.org/b/35932
+
+        * efl/ewk/ewk_view.cpp: Added.
+        * efl/ewk/ewk_view.h: Added.
+
+2010-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        * English.lproj/Localizable.strings: Added a string for plug-in failure.
+
+2010-04-01  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add EFL's pkg-config metadata file file to efl/.
+        http://webkit.org/b/36766
+
+        * efl/ewebkit.pc.in: Added.
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * efl/WebCoreSupport/ChromeClientEfl.cpp:
+        * efl/ewk/ewk_frame.cpp:
+        (ewk_frame_name_get):
+        (ewk_frame_selection_get):
+        (ewk_frame_uri_changed):
+        * efl/ewk/ewk_history.cpp:
+        * efl/ewk/ewk_settings.cpp:
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h.
+
+        * efl/ewk/ewk_frame.cpp:
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * WebKit.xcodeproj/project.pbxproj: Remove WebNullPluginView and nullplugin.tiff from the project.
+
+2010-03-22  Darin Adler  <darin@apple.com>
+
+        * StringsNotToBeLocalized.txt: Updated for recent changes.
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * English.lproj/Localizable.strings: Added "Missing Plug-in" string.
+
+2010-03-18  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35931
+
+        * efl/ewk/ewk_settings.cpp: Added.
+        * efl/ewk/ewk_settings.h: Added.
+
+2010-03-17  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add default theme files to efl/DefaultTheme.
+        http://webkit.org/b/36240
+
+        * efl/DefaultTheme/widget/radio/img_radio_on.png: Added.
+        * efl/DefaultTheme/radio/img_radio_off_hover.png: Added.
+        * efl/DefaultTheme/radio/img_radio_on_hover.png: Added.
+        * efl/DefaultTheme/radio/img_radio_off.png: Added.
+        * efl/DefaultTheme/radio/img_radio_off_focus.png: Added.
+        * efl/DefaultTheme/radio/img_radio_on_focus.png: Added.
+        * efl/DefaultTheme/combo/combo_normal.png: Added.
+        * efl/DefaultTheme/combo/combo_focus_button.png: Added.
+        * efl/DefaultTheme/combo/combo_hover_button.png: Added.
+        * efl/DefaultTheme/combo/combo_hover.png: Added.
+        * efl/DefaultTheme/combo/combo_focus.png: Added.
+        * efl/DefaultTheme/combo/combo_press_button.png: Added.
+        * efl/DefaultTheme/combo/combo_normal_button.png: Added.
+        * efl/DefaultTheme/combo/combo_press.png: Added.
+        * efl/DefaultTheme/combo/icon.png: Added.
+        * efl/DefaultTheme/file/file_normal.png: Added.
+        * efl/DefaultTheme/file/file_press.png: Added.
+        * efl/DefaultTheme/file/file_hover.png: Added.
+        * efl/DefaultTheme/file/file_focus.png: Added.
+        * efl/DefaultTheme/search/cancel/cancel_normal_button.png: Added.
+        * efl/DefaultTheme/search/cancel/cancel_normal_button2.png: Added.
+        * efl/DefaultTheme/search/decoration/decoration_normal_button.png: Added.
+        * efl/DefaultTheme/search/field/field_focused.png: Added.
+        * efl/DefaultTheme/search/field/field_normal.png: Added.
+        * efl/DefaultTheme/search/field/field_hovered.png: Added.
+        * efl/DefaultTheme/entry/img_normal.png: Added.
+        * efl/DefaultTheme/entry/img_hovered.png: Added.
+        * efl/DefaultTheme/entry/img_focused.png: Added.
+        * efl/DefaultTheme/check/img_check_off_hover.png: Added.
+        * efl/DefaultTheme/check/img_check_on.png: Added.
+        * efl/DefaultTheme/check/img_check_off_focus.png: Added.
+        * efl/DefaultTheme/check/img_check_on_focus.png: Added.
+        * efl/DefaultTheme/check/img_check_off.png: Added.
+        * efl/DefaultTheme/check/img_check_on_hover.png: Added.
+        * efl/DefaultTheme/scrollbar/scrollbar_knob_h.png: Added.
+        * efl/DefaultTheme/scrollbar/scrollbar_knob_v.png: Added.
+        * efl/DefaultTheme/scrollbar/scrollbar_hilight.png: Added.
+        * efl/DefaultTheme/scrollbar/scrollbar_v.png: Added.
+        * efl/DefaultTheme/scrollbar/scrollbar_h.png: Added.
+        * efl/DefaultTheme/button/img_button_normal.png: Added.
+        * efl/DefaultTheme/button/img_button_focus.png: Added.
+        * efl/DefaultTheme/button/img_button_hover.png: Added.
+        * efl/DefaultTheme/button/img_button_press.png: Added.
+
+2010-03-17  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL example browser to efl/EWebLauncher.
+        http://webkit.org/b/36176
+
+        * efl/EWebLauncher/main.c: Added.
+
+2010-03-16  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35916
+
+        * efl/WebCoreSupport/ContextMenuClientEfl.cpp: Added.
+        * efl/WebCoreSupport/ContextMenuClientEfl.h: Added.
+
+2010-03-16  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * efl/WebCoreSupport/InspectorClientEfl.cpp:
+        (WebCore::InspectorClientEfl::openInspectorFrontend):
+        * efl/WebCoreSupport/InspectorClientEfl.h:
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35925
+
+        * efl/ewk/ewk_history.cpp: Added.
+        * efl/ewk/ewk_history.h: Added.
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35928
+
+        * efl/ewk/ewk_main.cpp: Added.
+        * efl/ewk/ewk_main.h: Added.
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35924
+
+        * efl/ewk/ewk_frame.cpp: Added.
+        * efl/ewk/ewk_frame.h: Added.
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35936
+
+        * efl/ewk/ewk_view_single.c: Added.
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35929
+
+        * efl/ewk/ewk_util.cpp: Added.
+        * efl/ewk/ewk_util.h: Added.
+
+2010-03-13  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
+        http://webkit.org/b/35934
+
+        * efl/ewk/EWebKit.h: Added.
+        * efl/ewk/ewk_eapi.h: Added.
+        * efl/ewk/ewk_logging.h: Added.
+        * efl/ewk/ewk_private.h: Added.
+
+2010-03-11  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35917
+
+        * efl/WebCoreSupport/InspectorClientEfl.h: Added.
+        * efl/WebCoreSupport/InspectorClientEfl.cpp: Added.
+
+2010-03-11  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35914
+
+        * efl/WebCoreSupport/DragClientEfl.h: Added.
+        * efl/WebCoreSupport/DragClientEfl.cpp: Added.
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Sort the project file.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2010-03-10  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Holger Freyther.
+
+        Add EFL port files to efl/WebCoreSupport.
+        http://webkit.org/b/35913
+
+        * efl/WebCoreSupport/ChromeClientEfl.cpp: Added.
+        * efl/WebCoreSupport/ChromeClientEfl.h: Added.
+
+2010-03-09  John Sullivan  <sullivan@apple.com>
+
+        Fixed localized string key collision. update-webkit-localized-strings now
+        runs without errors.
+
+        Reviewed by Adam Roben.
+
+        * English.lproj/Localizable.strings:
+        Regenerated.
+
+2010-03-09  John Sullivan  <sullivan@apple.com>
+
+        * StringsNotToBeLocalized.txt:
+        Brought this file up to date. update-webkit-localizable-strings still lists
+        one key collision, but that's a separate issue.
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add a script to verify that WebKit framework headers are internally consistent.
+
+        * WebKit.xcodeproj/project.pbxproj: Run the script during the build and fail with
+        an error should the consistency check fail.
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35394
+        <rdar://problem/7685262> Make passing objects between Java and plug-ins work
+
+        * WebKit.xcodeproj/project.pbxproj: Added new files.
+
 2010-02-04  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings
index 42c1386..8301e28 100644
--- a/WebKit/English.lproj/Localizable.strings
+++ b/WebKit/English.lproj/Localizable.strings
Binary files differ
diff --git a/WebKit/StringsNotToBeLocalized.txt b/WebKit/StringsNotToBeLocalized.txt
index b39a1b0..74c90ca 100644
--- a/WebKit/StringsNotToBeLocalized.txt
+++ b/WebKit/StringsNotToBeLocalized.txt
@@ -38,10 +38,14 @@
 "%d_%d_%d"
 "%dpx"
 "%ld"
+"%s%01d:%02d:%02d"
+"%s%02d:%02d"
+"%s%02d:%02d:%02d"
 "%u"
 "&ie=UTF-8&oe=UTF-8"
 "(%.0f, %.0f)"
 "+"
+", "
 ","
 "-"
 "-1px"
@@ -59,11 +63,13 @@
 "/Library/Internet Plug-Ins"
 "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LangAnalysis.framework/LangAnalysis"
 "/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"
+"/System/Library/Frameworks/CoreVideo.framework"
 "/Volumes"
 "/tmp/XXXXXX.tiff"
 "0"
 "062AEEE3-9E42-44DC-A8A9-236B216FE011"
 "1"
+"10.1.51.95"
 "1000"
 "12px"
 "13"
@@ -72,6 +78,7 @@
 "1px"
 "2"
 "3.1"
+"3dbd565b-db22-4d88-8e0e-778bde54524a"
 "420+"
 "5CACD637-F82F-491F-947A-5DCA38AA0FEA"
 "6EB8D98F-2723-4472-88D3-5936F9D6E631"
@@ -132,6 +139,7 @@
 "BEGIN:VCALENDAR"
 "BEGIN:VCARD"
 "BP_CreatePluginMIMETypesPreferences"
+"CFBundleShortVersionString"
 "CFDictionaryPropertyBag"
 "CSS"
 "Change Back to \\U201C%@\\U201D"
@@ -154,13 +162,15 @@
 "DeleteWordBackward"
 "DeleteWordForward"
 "DisableWebKitDeveloperExtras"
+"FAKETRACKPOINTHSCROLLBAR"
+"FAKETRACKPOINTVSCROLLBAR"
 "FD3B2381-0BB6-4B59-AF09-0E599C8901CF"
-"FastMallocFreeSizeInCaches"
-"FastMallocFreeSizeInHeap"
-"FastMallocHeapSize"
-"FastMallocReturnedSize"
+"FastMallocCommittedVMBytes"
+"FastMallocFreeListBytes"
+"FastMallocReservedVMBytes"
 "FrameName"
 "FullscreenButton"
+"GCS_COMPATTR"
 "GEN_DOMObject"
 "GET"
 "GroupName"
@@ -172,6 +182,26 @@
 "IDNScriptWhiteList"
 "IDNScriptWhiteList.txt"
 "IMM32.DLL"
+"IMN_CHANGECANDIDATE"
+"IMN_CLOSECANDIDATE"
+"IMN_CLOSESTATUSWINDOW"
+"IMN_GUIDELINE"
+"IMN_OPENCANDIDATE"
+"IMN_OPENSTATUSWINDOW"
+"IMN_SETCANDIDATEPOS"
+"IMN_SETCOMPOSITIONFONT"
+"IMN_SETCOMPOSITIONWINDOW"
+"IMN_SETCONVERSIONMODE"
+"IMN_SETOPENSTATUS"
+"IMN_SETSENTENCEMODE"
+"IMN_SETSTATUSWINDOWPOS"
+"IMR_CANDIDATEWINDOW"
+"IMR_COMPOSITIONFONT"
+"IMR_COMPOSITIONWINDOW"
+"IMR_CONFIRMRECONVERTSTRING"
+"IMR_DOCUMENTFEED"
+"IMR_QUERYCHARPOSITION"
+"IMR_RECONVERTSTRING"
 "If-Match"
 "If-Modified-Since"
 "If-None-Match"
@@ -249,11 +279,11 @@
 "PDFViewChangedPage"
 "PDFViewDisplayModeChanged"
 "PDFViewScaleChanged"
-"PNG"
 "POST"
 "PPC"
 "PauseButton"
 "PlayButton"
+"ProxyRuntimeObject"
 "Quartz.framework"
 "RTL"
 "Referer"
@@ -261,6 +291,7 @@
 "RewindButton"
 "SAMILang"
 "SAMIStyle"
+"SCROLLBAR"
 "Safari.exe"
 "SeekBackButton"
 "SeekForwardButton"
@@ -268,6 +299,11 @@
 "ShowClosedCaptionsButton"
 "Slider"
 "SliderThumb"
+"Software\\Alps\\Apoint\\TrackPoint"
+"Software\\Lenovo\\TrackPoint"
+"Software\\Lenovo\\UltraNav"
+"Software\\Synaptics\\SynTPEnh\\UltraNavPS2"
+"Software\\Synaptics\\SynTPEnh\\UltraNavUSB"
 "StatusDisplay"
 "TimeRemainingDisplay"
 "Times"
@@ -317,6 +353,7 @@
 "WebElementImageRect"
 "WebElementImageURL"
 "WebElementIsContentEditableKey"
+"WebElementIsInScrollBar"
 "WebElementIsSelected"
 "WebElementLinkIsLive"
 "WebElementLinkLabel"
@@ -336,6 +373,8 @@
 "WebFrameUsesApplicationCacheKey"
 "WebFrameUsesDatabasesKey"
 "WebFrameUsesGeolocationKey"
+"WebGeolocationPolicyListener"
+"WebGeolocationPosition"
 "WebHTMLRepresentation"
 "WebHistory"
 "WebHistoryAllItemsRemovedNotification"
@@ -481,11 +520,13 @@
 "a"
 "ab"
 "about:"
+"acceleratedCompositingEnabled"
 "actions"
 "allowedFileTypes"
 "allowsMultipleSelection"
 "allowsOtherFileTypes"
 "anchorPoint"
+"apple-dashboard://stylesheet"
 "applewebdata"
 "applewebdata://%@"
 "application.pdf"
@@ -590,9 +631,16 @@
 "estimatedProgress"
 "fi.karppinen.Pyro"
 "file:"
+"file:///System/Library/PrivateFrameworks/DashboardClient.framework/Resources/widget.css"
 "frameName"
+"fsVideoAudioVolumeHigh"
+"fsVideoAudioVolumeLow"
+"fsVideoExitFullscreen"
+"fsVideoPause"
+"fsVideoPlay"
 "ftp:"
 "fullFrame"
+"fullscreenVideeoHUDWindowClass"
 "groupName"
 "htm"
 "html"
@@ -615,7 +663,6 @@
 "img"
 "info.colloquy"
 "insertText:"
-"inspectorStartsAttached"
 "isExtensionHidden"
 "isLoading"
 "isindex"
@@ -639,24 +686,13 @@
 "mainFrameTitle"
 "mainFrameURL"
 "mimeType"
-"missingImage"
 "name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
 "nameFieldLabel"
 "net.hmdt-web.Shiira"
-"nullPlugin"
 "nullplugin"
 "oleacc.dll"
 "opacity"
 "org.xlife.NewsFire"
-"panEastCursor"
-"panIcon"
-"panNorthCursor"
-"panNorthEastCursor"
-"panNorthWestCursor"
-"panSouthCursor"
-"panSouthEastCursor"
-"panSouthWestCursor"
-"panWestCursor"
 "pluginHostPath"
 "pluginspage"
 "position"
@@ -671,10 +707,6 @@
 "rgb(%.0f,%.0f,%.0f)"
 "rgba(%.0f,%.0f,%.0f,%f)"
 "s"
-"searchCancel"
-"searchCancelPressed"
-"searchMagnifier"
-"searchMagnifierResults"
 "showsHiddenFiles"
 "sourceURL"
 "src"
@@ -697,7 +729,6 @@
 "text/x-vcalendar"
 "text/x-vcard"
 "text/x-vcf"
-"textAreaResizeCorner"
 "tiff"
 "transform"
 "treatsFilePackagesAsDirectories"
@@ -708,7 +739,6 @@
 "userAgent"
 "userInfo"
 "utf-16"
-"verticalTextCursor"
 "visibleName"
 "visitCount"
 "webkit-fake-url"
@@ -717,8 +747,6 @@
 "x-apple-web-kit/"
 "xml"
 "xsl"
-"zoomInCursor"
-"zoomOutCursor"
 "{A3676398-4485-4a9d-87DC-CB5A40E6351D}"
 "~/Library/Icons"
 "~/Library/WebKit/Databases"
@@ -740,6 +768,7 @@
 WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm:"message"
 WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm:"prompt"
 WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm:"title"
+WebKit/mac/Plugins/Hosted/ProxyInstance.mm
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:" OK\n"
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:": "
 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"identity"
@@ -836,12 +865,14 @@
 WebKit/win/WebCoreSupport/WebInspectorClient.cpp:"true"
 WebKit/win/WebDatabaseManager.cpp:"Databases"
 WebKit/win/WebHistoryItem.cpp:"title"
+WebKit/win/WebKitDLL.cpp
 WebKit/win/WebPreferenceKeysPrivate.h
 WebKit/win/WebPreferences.cpp:"Arial"
 WebKit/win/WebPreferences.cpp:"Comic Sans MS"
 WebKit/win/WebPreferences.cpp:"Courier New"
 WebKit/win/WebPreferences.cpp:"Times New Roman"
 WebKit/win/WebURLResponse.cpp:"Extension"
+WebKit/win/WebView.cpp:")"
 WebKit/win/WebView.cpp:"Cancel"
 WebKit/win/WebView.cpp:"Copy"
 WebKit/win/WebView.cpp:"Cut"
@@ -849,4 +880,5 @@
 WebKit/win/WebView.cpp:"Paste"
 WebKit/win/WebView.cpp:"Redo"
 WebKit/win/WebView.cpp:"Undo"
+WebKit/win/WebView.cpp:"Unknown ("
 WebKit/win/WebView.cpp:"about"
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index dda5966..e6bbab5 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -112,7 +112,6 @@
 		5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; };
 		59C77F3510545F7E00506104 /* WebGeolocationMock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59C77F3310545F7E00506104 /* WebGeolocationMock.mm */; };
 		59C77F4B105471E700506104 /* WebGeolocationMockPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C77F4A105471E700506104 /* WebGeolocationMockPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */; };
 		5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
 		5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; };
@@ -166,7 +165,6 @@
 		9398102B0824BF01008DF038 /* WebBaseNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */; };
 		9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF46036652150000E506 /* WebBasePluginPackage.h */; };
 		939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */; };
-		939810340824BF01008DF038 /* WebNullPluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5883BE0025E5E9D01000102 /* WebNullPluginView.h */; };
 		939810350824BF01008DF038 /* WebPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF840365FE6A00CA2ACA /* WebPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		939810360824BF01008DF038 /* WebPluginContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		939810370824BF01008DF038 /* WebPluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8467275C0367158500CA2ACA /* WebPluginController.h */; };
@@ -243,7 +241,6 @@
 		939810B00824BF01008DF038 /* WebPluginContainerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		939810B10824BF01008DF038 /* WebPluginContainerCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */; };
 		939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */; };
-		939810B60824BF01008DF038 /* nullplugin.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5883BDE025E5C6A01000102 /* nullplugin.tiff */; };
 		939810B70824BF01008DF038 /* url_icon.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5B67130023EDF8901C1A525 /* url_icon.tiff */; };
 		939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */; };
 		939810BC0824BF01008DF038 /* WebBackForwardList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */; };
@@ -265,7 +262,6 @@
 		939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */; };
 		939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */; };
 		939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */; };
-		939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */; };
 		939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; };
 		939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717210288493C018635CA /* WebPluginDatabase.mm */; };
 		939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.m */; };
@@ -344,10 +340,14 @@
 		C0B1F7E910AC8E3100C925D9 /* WebScriptWorld.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */; };
 		C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */; };
 		C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */; };
 		DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
 		DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
 		DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
 		E15663190FB61C1F00C199CA /* WebDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = E15663180FB61C1F00C199CA /* WebDownload.mm */; };
+		E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169836111346D1B00894115 /* ProxyRuntimeObject.h */; };
+		E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = E169836B11346D5600894115 /* ProxyRuntimeObject.mm */; };
 		ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED5B9523111B725A00472298 /* WebLocalizableStrings.mm */; };
 		ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */; };
 		ED6BE2E8088C32B50044DEDC /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */; };
@@ -512,7 +512,6 @@
 		5241ADF40B1BC48A004012BD /* WebCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCache.mm; sourceTree = "<group>"; };
 		59C77F3310545F7E00506104 /* WebGeolocationMock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGeolocationMock.mm; sourceTree = "<group>"; };
 		59C77F4A105471E700506104 /* WebGeolocationMockPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationMockPrivate.h; sourceTree = "<group>"; };
-		5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; };
 		5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
 		5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
 		5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; };
@@ -641,10 +640,14 @@
 		C0B1F7E610AC8E3100C925D9 /* WebScriptWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptWorld.mm; sourceTree = "<group>"; };
 		C0B1F7E710AC8E3100C925D9 /* WebScriptWorldInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptWorldInternal.h; sourceTree = "<group>"; };
 		C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegatePrivate.h; sourceTree = "<group>"; };
+		C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentURLPattern.h; sourceTree = "<group>"; };
+		C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebUserContentURLPattern.mm; sourceTree = "<group>"; };
 		DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; };
 		DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		E15663180FB61C1F00C199CA /* WebDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDownload.mm; sourceTree = "<group>"; };
+		E169836111346D1B00894115 /* ProxyRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyRuntimeObject.h; sourceTree = "<group>"; };
+		E169836B11346D5600894115 /* ProxyRuntimeObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyRuntimeObject.mm; sourceTree = "<group>"; };
 		ED21B9810528F7AA003299AC /* WebDocumentInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSPasteboardExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -668,9 +671,6 @@
 		F53444CE02E87CBA018635CA /* WebKitStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F53444CF02E87CBA018635CA /* WebKitStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatisticsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		F5883BDE025E5C6A01000102 /* nullplugin.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = nullplugin.tiff; sourceTree = "<group>"; };
-		F5883BE0025E5E9D01000102 /* WebNullPluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNullPluginView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-		F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNullPluginView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F5927D4E02D26C5E01CA2DBB /* WebKitErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrors.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F59668C802AD2923018635CA /* WebStringTruncator.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		F59668C902AD2923018635CA /* WebStringTruncator.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -795,7 +795,6 @@
 				9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */,
 				939811320824BF01008DF038 /* Info.plist */,
 				5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */,
-				F5883BDE025E5C6A01000102 /* nullplugin.tiff */,
 				ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */,
 				F5B67130023EDF8901C1A525 /* url_icon.tiff */,
 				5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */,
@@ -819,6 +818,8 @@
 				1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */,
 				1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */,
 				1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */,
+				E169836111346D1B00894115 /* ProxyRuntimeObject.h */,
+				E169836B11346D5600894115 /* ProxyRuntimeObject.mm */,
 				1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */,
 				1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */,
 				1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */,
@@ -881,7 +882,6 @@
 		254DC334016E1D3F0ECA149E /* Misc */ = {
 			isa = PBXGroup;
 			children = (
-				5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */,
 				1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */,
 				5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */,
 				5241ADF30B1BC48A004012BD /* WebCache.h */,
@@ -956,6 +956,8 @@
 				F59668C802AD2923018635CA /* WebStringTruncator.h */,
 				F59668C902AD2923018635CA /* WebStringTruncator.mm */,
 				DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */,
+				C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */,
+				C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */,
 			);
 			name = Misc;
 			path = mac/Misc;
@@ -1266,8 +1268,6 @@
 				848DFF430365F71500CA2ACA /* WebKit Plug-ins */,
 				83E4AF46036652150000E506 /* WebBasePluginPackage.h */,
 				83E4AF47036652150000E506 /* WebBasePluginPackage.mm */,
-				F5883BE0025E5E9D01000102 /* WebNullPluginView.h */,
-				F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */,
 				F5F717200288493C018635CA /* WebPluginDatabase.h */,
 				F5F717210288493C018635CA /* WebPluginDatabase.mm */,
 				224100F2091818D900D2D266 /* WebPluginsPrivate.h */,
@@ -1351,7 +1351,6 @@
 				939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */,
 				939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */,
 				939810670824BF01008DF038 /* CarbonWindowFrame.h in Headers */,
-				5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */,
 				939810680824BF01008DF038 /* HIViewAdapter.h in Headers */,
 				939810690824BF01008DF038 /* HIWebView.h in Headers */,
 				1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */,
@@ -1359,6 +1358,7 @@
 				1AAF5CEC0EDDE1FE008D883D /* NetscapePluginHostProxy.h in Headers */,
 				1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */,
 				1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
+				E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */,
 				B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */,
 				9398109A0824BF01008DF038 /* WebArchive.h in Headers */,
 				5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */,
@@ -1491,7 +1491,6 @@
 				65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */,
 				939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */,
 				939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
-				939810340824BF01008DF038 /* WebNullPluginView.h in Headers */,
 				9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */,
 				A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */,
 				37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */,
@@ -1546,6 +1545,7 @@
 				939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
 				0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */,
 				41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
+				C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1567,6 +1567,7 @@
 				939D054F09DA02D500984996 /* Check For Global Initializers */,
 				9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */,
 				5D0D54210E98631D0029E223 /* Check For Weak VTables and Externals */,
+				5D88EE6C11407DE800BC3ABC /* Check For Framework Include Consistency */,
 				5DE6D18C0FCF231B002DE28C /* Symlink WebKitPluginHost in to place */,
 			);
 			buildRules = (
@@ -1613,7 +1614,6 @@
 			files = (
 				939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */,
 				5DE83A7F0D0F7FAD00CAD12A /* Localizable.strings in Resources */,
-				939810B60824BF01008DF038 /* nullplugin.tiff in Resources */,
 				939810B70824BF01008DF038 /* url_icon.tiff in Resources */,
 				939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */,
 				5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */,
@@ -1685,6 +1685,20 @@
 			shellPath = /bin/sh;
 			shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n    touch \"${PROJECT_DIR}/mac/Info.plist\";\nfi;\n";
 		};
+		5D88EE6C11407DE800BC3ABC /* Check For Framework Include Consistency */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			name = "Check For Framework Include Consistency";
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-webkit-framework-include-consistency ]; then\n    ../WebKitTools/Scripts/check-for-webkit-framework-include-consistency || exit $?\nfi\n";
+		};
 		5DE6D18C0FCF231B002DE28C /* Symlink WebKitPluginHost in to place */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -1766,6 +1780,7 @@
 				939810DD0824BF01008DF038 /* npapi.mm in Sources */,
 				1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */,
 				1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
+				E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */,
 				B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */,
 				9398111D0824BF01008DF038 /* WebArchive.mm in Sources */,
 				939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */,
@@ -1824,6 +1839,7 @@
 				939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */,
 				9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
 				1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
+				ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */,
 				5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */,
 				0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */,
 				0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */,
@@ -1852,7 +1868,6 @@
 				65E0F9E708500F23007E5CB9 /* WebNSUserDefaultsExtras.m in Sources */,
 				939810C90824BF01008DF038 /* WebNSViewExtras.m in Sources */,
 				939810CA0824BF01008DF038 /* WebNSWindowExtras.m in Sources */,
-				939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */,
 				939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */,
 				A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */,
 				37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */,
@@ -1888,7 +1903,7 @@
 				939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */,
 				0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */,
 				41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
-				ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */,
+				C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 245cd9e..ed43fff 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,3764 @@
+2010-04-21  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r58028.
+        http://trac.webkit.org/changeset/58028
+        https://bugs.webkit.org/show_bug.cgi?id=37962
+
+        broke the chromium build (Requested by tony^work on #webkit).
+
+        * DEPS:
+
+2010-04-21  Evan Martin  <evan@chromium.org>
+
+        Unreviewed, just a dependency change.
+
+        [chromium] roll skia forward to r538
+        https://bugs.webkit.org/show_bug.cgi?id=37960
+
+        This will cause a bunch of pixel tests to fail due to bulleted
+        lists rendering slightly differently.  I will grab new baselines
+        from the bots and check them in in a followup.
+
+        * DEPS:
+
+2010-04-21  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Web page serializer saves tag names in upper case
+        https://bugs.webkit.org/show_bug.cgi?id=37940
+
+        Simply convert all tags to lower case.
+
+        This is tested by chrome tests:
+         - save page browser tests
+         - encoding ui tests
+         - web page serializer test shell tests
+
+        * src/WebPageSerializer.cpp:
+        (WebKit::WebPageSerializer::generateMetaCharsetDeclaration):
+        (WebKit::WebPageSerializer::generateBaseTagDeclaration):
+        * src/WebPageSerializerImpl.cpp:
+        (WebKit::WebPageSerializerImpl::openTagToString):
+        (WebKit::WebPageSerializerImpl::endTagToString):
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::finishedLoading):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::encoding):
+        (WebKit::WebFrameImpl::commitDocumentData):
+        * src/WebPageSerializerImpl.cpp:
+        (WebKit::WebPageSerializerImpl::preActionBeforeSerializeOpenTag):
+        (WebKit::WebPageSerializerImpl::serialize):
+        * src/WebSearchableFormData.cpp:
+        (WebCore::GetFormEncoding):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::pageEncoding):
+
+2010-04-20  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: add basic script editing capabilities to the front-end.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37875
+
+        * src/js/DebuggerAgent.js:
+        (devtools.DebuggerAgent.prototype.resolveScriptSource.this.requestSeqToCallback_.cmd.getSequenceNumber):
+        (devtools.DebuggerAgent.prototype.resolveScriptSource):
+        (devtools.DebuggerAgent.prototype.editScriptLine.this.requestSeqToCallback_.cmd.getSequenceNumber):
+        (devtools.DebuggerAgent.prototype.editScriptLine):
+        (devtools.DebuggerAgent.prototype.handleDebuggerOutput_):
+        * src/js/DevTools.js:
+        * src/js/InspectorControllerImpl.js:
+        (.devtools.InspectorBackendImpl.prototype.editScriptLine):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::chooseIconForFiles):
+        * src/ChromeClientImpl.h:
+
+2010-04-20  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Tests that pressing tab now closes the select popup.
+        https://bugs.webkit.org/show_bug.cgi?id=37721
+
+        * tests/PopupMenuTest.cpp:
+        (WebKit::TEST_F):
+
+2010-04-20  Evan Stade  <estade@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] crash when dragging images
+        https://bugs.webkit.org/show_bug.cgi?id=37715
+
+        Added unit tests for DragImageChromiumSkia.
+
+        * WebKit.gyp:
+        * tests/DragImageTest.cpp: Added.
+        (WebCore::TestImage::TestImage):
+        (WebCore::TestImage::~TestImage):
+        (WebCore::TestImage::size):
+        (WebCore::TestImage::nativeImageForCurrentFrame):
+        (WebCore::TestImage::destroyDecodedData):
+        (WebCore::TestImage::decodedSize):
+        (WebCore::TestImage::draw):
+        (WebCore::TEST):
+
+2010-04-20  Stuart Morgan  <stuartmorgan@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove a workaround in plugin cursor setting that was obsoleted by
+        the change in https://bugs.webkit.org/show_bug.cgi?id=35132
+        https://bugs.webkit.org/show_bug.cgi?id=37811
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::ChromeClientImpl):
+        (WebKit::ChromeClientImpl::setCursor):
+        (WebKit::ChromeClientImpl::setCursorForPlugin):
+        * src/ChromeClientImpl.h:
+
+2010-04-19  Ada Chan  <adachan@apple.com>
+
+        Reviewed by Jeremy Orlow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37717
+        Changes needed now that StorageNamespaceImpl::sessionStorageNamespace() and
+        StorageNamespace::sessionStorageNamespace() take in a quota parameter.
+
+        * src/StorageNamespaceProxy.cpp:
+        (WebCore::StorageNamespace::sessionStorageNamespace):
+        * src/WebStorageNamespaceImpl.cpp:
+        (WebKit::WebStorageNamespace::createSessionStorageNamespace):
+
+2010-04-17  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Adding the implementation of GLES2Context class which provides WebCore access to a GL ES context.
+        https://bugs.webkit.org/show_bug.cgi?id=37541
+
+        * WebKit.gyp:
+        * public/WebGLES2Context.h: Added.
+        (WebKit::WebGLES2Context::~WebGLES2Context):
+        * src/GLES2Context.cpp: Added.
+        (WebCore::GLES2ContextInternal::GLES2ContextInternal):
+        (WebCore::GLES2ContextInternal::~GLES2ContextInternal):
+        (WebCore::GLES2ContextInternal::getWebGLES2Context):
+        (WebCore::GLES2ContextInternal::initialize):
+        (WebCore::GLES2Context::create):
+        (WebCore::GLES2Context::~GLES2Context):
+        (WebCore::GLES2Context::initialize):
+        (WebCore::GLES2Context::makeCurrent):
+        (WebCore::GLES2Context::destroy):
+        (WebCore::GLES2Context::swapBuffers):
+
+2010-04-16  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Get rid of the UNUSED_PARAM macro in GraphicsContext3D.cpp.
+        https://bugs.webkit.org/show_bug.cgi?id=37733
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-04-16  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Changing the return type of WebSecurityOrigin::createFromDatabaseIdentifier().
+        https://bugs.webkit.org/show_bug.cgi?id=34466
+
+        Changing the return type of
+        WebSecurityOrigin::createFromDatabaseIdentifier() from
+        WebSecurityOrigin* to WebSecurityOrigin, to make it more
+        consistent with the other WebSecurityOrigin methods.
+
+        * public/WebSecurityOrigin.h:
+        * src/WebDatabase.cpp:
+        (WebKit::WebDatabase::closeDatabaseImmediately):
+        * src/WebSecurityOrigin.cpp:
+        (WebKit::WebSecurityOrigin::createFromDatabaseIdentifier):
+
+2010-04-16  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        [v8] In Workers, script errors right after close() are not delivered to the Worker.onerror
+        https://bugs.webkit.org/show_bug.cgi?id=37691
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::createWorkerContextProxy): Don't need to pull V8 proxy to retrieve current WorkerContext.
+
+2010-04-16  Albert J. Wong  <ajwong@chromium.org>
+
+        Not reviewed. Build fix.
+
+        [chromium] Compile fix. Missing include header, and missing type conversion.
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::beginPaint):
+
+2010-04-16  Jarkko Sakkinen  <jarkko.j.sakkinen@gmail.com>
+ 
+        Reviewed by Simon Hausmann.
+ 
+        [Qt] WebGL is not visible when QGLWidget viewport is used
+        https://bugs.webkit.org/show_bug.cgi?id=37070
+ 
+        Added HostWindow parameter to the constructor of GraphicsContext3D.
+        Shared OpenGL context is initialized with parent QGLWidget.
+ 
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-04-16  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Jian Li.
+
+        [chromium] WebKit::WebURLResponse::addHTTPHeaderField will crash if response is invalid UTF-8
+        https://bugs.webkit.org/show_bug.cgi?id=37687
+
+        * src/WebURLResponse.cpp:
+        (WebKit::WebURLResponse::addHTTPHeaderField): ignore if name or value is null string.
+
+2010-04-16  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Select popups would assert when destroyed.
+        Also adding unit-tests for the select popup code.
+        https://bugs.webkit.org/show_bug.cgi?id=37436
+
+        * WebKit.gyp:
+        * src/WebViewImpl.h:
+        (WebKit::WebViewImpl::selectPopup):
+        * tests/PopupMenuTest.cpp: Added.
+
+2010-04-16  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] build DRT on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=37690
+
+        * DEPS: Need to roll deps to remove a dependency on src/chrome
+        * gyp_webkit: generate makefiles for DRT.gyp on Linux
+
+2010-04-15  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        build DRT on chromium mac
+        https://bugs.webkit.org/show_bug.cgi?id=37639
+
+        * gyp_webkit: generate build files for DRT on mac
+
+2010-04-15  Yury Semikhatsky  <yurys@google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Support basic debugging capabilities including step in/over/out in v8
+        implementation of ScriptDebugServer.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        * WebKit.gypi:
+        * src/DebuggerAgent.h:
+        * src/DebuggerAgentImpl.cpp:
+        (WebKit::DebuggerAgentImpl::setDebuggerScriptSource):
+        * src/DebuggerAgentImpl.h:
+        * src/DebuggerAgentManager.cpp:
+        (WebKit::DebuggerAgentManager::hostDispatchHandler):
+        (WebKit::DebuggerAgentManager::debugAttach):
+        (WebKit::DebuggerAgentManager::debugDetach):
+        (WebKit::DebuggerAgentManager::setMessageLoopDispatchHandler):
+        * src/DebuggerAgentManager.h:
+        * src/InspectorFrontendClientImpl.cpp:
+        (WebKit::InspectorFrontendClientImpl::windowObjectCleared):
+        * src/js/DebuggerScript.js: Added.
+        (debuggerScriptConstructor.DebuggerScript.getAfterCompileScript):
+        (debuggerScriptConstructor.DebuggerScript.getScripts):
+        (debuggerScriptConstructor.DebuggerScript._formatScript):
+        (debuggerScriptConstructor.DebuggerScript.setBreakpoint):
+        (debuggerScriptConstructor.DebuggerScript.removeBreakpoint):
+        (debuggerScriptConstructor.DebuggerScript.currentCallFrame):
+        (debuggerScriptConstructor.DebuggerScript.stepIntoStatement):
+        (debuggerScriptConstructor.DebuggerScript.stepOverStatement):
+        (debuggerScriptConstructor.DebuggerScript.stepOutOfFunction):
+        (debuggerScriptConstructor.DebuggerScript.clearBreakpoints):
+        (debuggerScriptConstructor.DebuggerScript.setBreakpointsActivated):
+        (debuggerScriptConstructor.DebuggerScript._frameMirrorToJSCallFrame):
+        (debuggerScriptConstructor.DebuggerScript._webkitToV8LineNumber):
+        (debuggerScriptConstructor.DebuggerScript._v8ToWwebkitLineNumber):
+        (debuggerScriptConstructor):
+        * src/js/DevTools.js:
+        (WebInspector.loaded):
+        (.):
+        ():
+        * src/js/DevToolsHostStub.js:
+        (.RemoteDebuggerAgentStub.prototype.setDebuggerScriptSource):
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-04-15  Matt Perry  <mpcomplete@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Implement layoutTestController's addUserStyleSheet and
+        setAuthorAndUserStylesEnabled on Chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=37595
+
+        * public/WebSettings.h:
+        * public/WebView.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setAuthorAndUserStylesEnabled):
+        * src/WebSettingsImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::addUserStyleSheet):
+        * src/WebViewImpl.h:
+
+2010-04-15  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Must enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization
+        https://bugs.webkit.org/show_bug.cgi?id=37178
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization.
+        (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+
+2010-04-15  Albert J. Wong  <ajwong@chromium.org>
+
+        Unreviewed, rolling out r57660.
+        http://trac.webkit.org/changeset/57660
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        Broke a large number of inspector layout tests in chromium.
+
+        * WebKit.gypi:
+        * src/DebuggerAgent.h:
+        * src/DebuggerAgentImpl.cpp:
+        * src/DebuggerAgentImpl.h:
+        * src/DebuggerAgentManager.cpp:
+        (WebKit::DebuggerAgentManager::debugAttach):
+        (WebKit::DebuggerAgentManager::debugDetach):
+        (WebKit::DebuggerAgentManager::setMessageLoopDispatchHandler):
+        * src/DebuggerAgentManager.h:
+        * src/InspectorFrontendClientImpl.cpp:
+        (WebKit::InspectorFrontendClientImpl::windowObjectCleared):
+        * src/js/DebuggerScript.js: Removed.
+        * src/js/DevTools.js:
+        (WebInspector.loaded):
+        (WebInspector.UnresolvedPropertyValue):
+        ():
+        * src/js/DevToolsHostStub.js:
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-04-15  Yury Semikhatsky  <yurys@google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Support basic debugging capabilities including step in/over/out in v8
+        implementation of ScriptDebugServer.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37604
+
+        * WebKit.gypi:
+        * src/DebuggerAgent.h:
+        * src/DebuggerAgentImpl.cpp:
+        (WebKit::DebuggerAgentImpl::setDebuggerScriptSource):
+        * src/DebuggerAgentImpl.h:
+        * src/DebuggerAgentManager.cpp:
+        (WebKit::DebuggerAgentManager::hostDispatchHandler):
+        (WebKit::DebuggerAgentManager::debugAttach):
+        (WebKit::DebuggerAgentManager::debugDetach):
+        (WebKit::DebuggerAgentManager::setMessageLoopDispatchHandler):
+        * src/DebuggerAgentManager.h:
+        * src/InspectorFrontendClientImpl.cpp:
+        (WebKit::InspectorFrontendClientImpl::windowObjectCleared):
+        * src/js/DebuggerScript.js: Added.
+        (debuggerScriptConstructor.DebuggerScript.getAfterCompileScript):
+        (debuggerScriptConstructor.DebuggerScript.getScripts):
+        (debuggerScriptConstructor.DebuggerScript._formatScript):
+        (debuggerScriptConstructor.DebuggerScript.setBreakpoint):
+        (debuggerScriptConstructor.DebuggerScript.removeBreakpoint):
+        (debuggerScriptConstructor.DebuggerScript.currentCallFrame):
+        (debuggerScriptConstructor.DebuggerScript.stepIntoStatement):
+        (debuggerScriptConstructor.DebuggerScript.stepOverStatement):
+        (debuggerScriptConstructor.DebuggerScript.stepOutOfFunction):
+        (debuggerScriptConstructor.DebuggerScript.clearBreakpoints):
+        (debuggerScriptConstructor.DebuggerScript.setBreakpointsActivated):
+        (debuggerScriptConstructor.DebuggerScript._frameMirrorToJSCallFrame):
+        (debuggerScriptConstructor.DebuggerScript._webkitToV8LineNumber):
+        (debuggerScriptConstructor.DebuggerScript._v8ToWwebkitLineNumber):
+        (debuggerScriptConstructor):
+        * src/js/DevTools.js:
+        (WebInspector.loaded):
+        (.):
+        ():
+        * src/js/DevToolsHostStub.js:
+        (.RemoteDebuggerAgentStub.prototype.setDebuggerScriptSource):
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-04-15  Ben Murdoch  <benm@google.com>
+
+        Unreviewed, rolling out r57652.
+        http://trac.webkit.org/changeset/57652
+        https://bugs.webkit.org/show_bug.cgi?id=37609
+
+        Caused a build break on Chromium Mac and Layout Test fail on
+        Qt
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchPointState):
+
+2010-04-14  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The TouchStationary state of WebCore::PlatformTouchPoint is not
+        handled inside the touch event handler.
+        https://bugs.webkit.org/show_bug.cgi?id=37609
+
+        After discussions at the WebKit contributors meeting, we decided that
+        this is a currently unused state without a good future use case in the
+        Touch API and thus decided to remove it. This patch actions that decision.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchPointState): Remove TouchStationary.
+
+2010-04-12  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] update chromium DEPS for upstream compile
+        https://bugs.webkit.org/show_bug.cgi?id=36578
+
+        * DEPS: Pull sub deps from chromium's DEPS file
+
+2010-04-14  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57599.
+        http://trac.webkit.org/changeset/57599
+        https://bugs.webkit.org/show_bug.cgi?id=37605
+
+        "Broke Chromium build" (Requested by dglazkov on #webkit).
+
+        * WebKit.gyp:
+        * src/WebViewImpl.h:
+        * tests/PopupMenuTest.cpp: Removed.
+
+2010-04-14  Aaron Boodman  <aa@chromium.org>
+
+        Reviewed by David Levin.
+
+        Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting
+        the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are
+        unsupported. Fixed by resolving the relative URL first.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36623
+
+        Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows.
+
+        * public/WebNotification.h: Remove deprecated icon() method.
+        * src/WebNotification.cpp: Ditto.
+
+2010-04-14  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Select popups would assert when destroyed.
+        Also adding unit-tests for the select popup code.
+        https://bugs.webkit.org/show_bug.cgi?id=37436
+
+        * WebKit.gyp:
+        * src/WebViewImpl.h:
+        (WebKit::WebViewImpl::selectPopup):
+        * tests/PopupMenuTest.cpp: Added.
+
+2010-04-14  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        readPixels must take PACK_ALIGNMENT into account
+        https://bugs.webkit.org/show_bug.cgi?id=34718
+
+        * src/GraphicsContext3D.cpp: Refactor readPixels.
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+        (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer): Temporarily disable pack alignment for glReadPixels.
+        (WebKit::WebGraphicsContext3DDefaultImpl::readPixels): Move array allocation and alpha fix to WebGLRenderingContext; flush before read pixels.
+
+2010-04-14  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Re-write testProfilerTab to match the new implementation.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37516
+
+        * src/js/Tests.js:
+        (.TestSuite.prototype.testProfilerTab.findDisplayedNode):
+        (.TestSuite.prototype.testProfilerTab.findVisibleView):
+        (.TestSuite.prototype.testProfilerTab):
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * src/WebSecurityPolicy.cpp:
+        (WebKit::WebSecurityPolicy::whiteListAccessFromOrigin):
+        (WebKit::WebSecurityPolicy::resetOriginAccessWhiteLists):
+
+2010-04-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Fix search behavior in Heap profiles.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37498
+
+        * src/js/HeapProfilerPanel.js:
+
+2010-04-13  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
+
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        * src/ResourceHandle.cpp: Track state across ResourceHandle invocations.
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        (WebCore::ResourceHandleInternal::):
+        (WebCore::ResourceHandleInternal::start):
+        (WebCore::ResourceHandleInternal::cancel):
+        (WebCore::ResourceHandleInternal::didReceiveResponse):
+        (WebCore::ResourceHandleInternal::didReceiveData):
+        (WebCore::ResourceHandleInternal::didFinishLoading):
+        (WebCore::ResourceHandleInternal::didFail):
+
+2010-04-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Unreviewed Chromium build fix: pin to a newer V8 revision (4386).
+
+        * DEPS:
+
+2010-04-12  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Replace hand-written JavaScriptProfile* bindings with idl-based, and
+        in Chromium port, bind them to the new V8's profiler API that is
+        aligned with JSC.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37448
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+        * src/js/ProfilerAgent.js:
+        (devtools.ProfilerAgent):
+        (devtools.ProfilerAgent.prototype.initializeProfiling):
+        (devtools.ProfilerAgent.prototype._didGetActiveProfilerModules):
+        (devtools.ProfilerAgent.prototype._didGetLogLines):
+        * src/js/Tests.js:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::finishedLoading):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::encoding):
+        (WebKit::WebFrameImpl::commitDocumentData):
+        * src/WebPageSerializerImpl.cpp:
+        (WebKit::WebPageSerializerImpl::preActionBeforeSerializeOpenTag):
+        (WebKit::WebPageSerializerImpl::serialize):
+        * src/WebSearchableFormData.cpp:
+        (WebCore::GetFormEncoding):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::pageEncoding):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::finishedLoading):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::encoding):
+        (WebKit::WebFrameImpl::commitDocumentData):
+        * src/WebPageSerializerImpl.cpp:
+        (WebKit::WebPageSerializerImpl::preActionBeforeSerializeOpenTag):
+        (WebKit::WebPageSerializerImpl::serialize):
+        * src/WebSearchableFormData.cpp:
+        (WebCore::GetFormEncoding):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::pageEncoding):
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57460.
+        http://trac.webkit.org/changeset/57460
+        https://bugs.webkit.org/show_bug.cgi?id=37424
+
+        broke chromium builders (Requested by tony^work on #webkit).
+
+        * DEPS:
+        * gyp_webkit:
+
+2010-04-11  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] update chromium DEPS for upstream compile
+        https://bugs.webkit.org/show_bug.cgi?id=36578
+
+        * DEPS:
+        * gyp_webkit: Add DumpRenderTree.gyp so we generate xcode projects for DRT.
+
+2010-04-10  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Include file change as a result of renaming LayerRenderSkia.h to LayerRenderChromium.h
+        https://bugs.webkit.org/show_bug.cgi?id=37231
+
+        * src/WebViewImpl.h:
+
+2010-04-10  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Cleanup after chromium breakage. All interface methods are
+        returned to being abstract.
+
+        * public/WebNotificationPresenter.h:
+
+2010-04-09  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] Linux: respect the scale factor during printing
+        https://bugs.webkit.org/show_bug.cgi?id=37168
+
+        Chromium doesn't support testing .pdfs from printing at the moment, so
+        this change is not covered by any tests.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::ChromePrintContext::spoolPage):
+
+2010-04-09  Aaron Boodman  <aa@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove applicationID() from WebDocument as it is Chromium-specific.
+        https://bugs.webkit.org/show_bug.cgi?id=37350
+
+        * public/WebDocument.h:
+        * src/WebDocument.cpp:
+
+2010-04-09  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Move the IDB::open ExceptionCode paramter to be last
+        https://bugs.webkit.org/show_bug.cgi?id=37277
+
+        Move the ExceptionCode paramter to the last position in 
+        IndexedDatabaseRequest::open and friends.  It should definitely
+        go after the callbacks to keep the parameters that come directly
+        from javascript together.  And having output parameters appear
+        last is done often in the code base, so it makes sense to push
+        it past the Frame* param as well.
+
+        * public/WebIndexedDatabase.h:
+        * src/IndexedDatabaseProxy.cpp:
+        (WebCore::IndexedDatabaseProxy::open):
+        * src/IndexedDatabaseProxy.h:
+        * src/WebIndexedDatabaseImpl.cpp:
+        (WebKit::WebIndexedDatabaseImpl::open):
+        * src/WebIndexedDatabaseImpl.h:
+
+2010-04-09  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Complete move of createApplicationCacheHost from WebKitClient to WebFrameClient.
+        https://bugs.webkit.org/show_bug.cgi?id=37330
+
+        * public/WebApplicationCacheHost.h:
+        * public/WebKitClient.h:
+        * src/ApplicationCacheHostInternal.h:
+        (WebCore::ApplicationCacheHostInternal::ApplicationCacheHostInternal):
+
+2010-04-09  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Crash on WebKit::WebGeolocationServiceBridgeImpl::stopUpdating() during frame disconnection
+        Should not try to access WebViewClient if the frame has already been disconnected.
+        https://bugs.webkit.org/show_bug.cgi?id=37318
+
+        * src/WebGeolocationServiceBridgeImpl.cpp:
+        (WebKit::WebGeolocationServiceBridgeImpl::stopUpdating):
+
+2010-04-09  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Expose SecurityOrigin::canRequest in WebSecurityOrigin.
+        https://bugs.webkit.org/show_bug.cgi?id=37271
+
+        * public/WebSecurityOrigin.h:
+        * src/WebSecurityOrigin.cpp:
+        (WebKit::WebSecurityOrigin::canRequest):
+
+2010-04-09  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        Must resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D
+        https://bugs.webkit.org/show_bug.cgi?id=37174
+
+        Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Resolve multisampled back buffer during copyTexImage2D and copyTexSubImage2D.
+        (WebKit::WebGraphicsContext3DDefaultImpl::copyTexImage2D):
+        (WebKit::WebGraphicsContext3DDefaultImpl::copyTexSubImage2D):
+
+2010-04-07  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Chromium: support themes in devtools window.
+
+        https://bugs.webkit.org/attachment.cgi?bugid=37216
+
+        * WebKit.gypi:
+        * src/js/DevTools.js:
+        (WebInspector.setToolbarColors):
+        (WebInspector.resetToolbarColors):
+        * src/js/Images/segmentChromium2.png: Added.
+        * src/js/Images/segmentHoverChromium2.png: Added.
+        * src/js/Images/segmentSelectedChromium2.png: Added.
+        * src/js/Images/statusbarBackgroundChromium2.png: Added.
+        * src/js/Images/statusbarMenuButtonChromium2.png: Added.
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed inspector methods from ScriptExecutionContext and derived classes.
+        Removed MessageDestination parameter from console-related calls (we now always
+        log to the same destination(s)).
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * public/WebCommonWorkerClient.h:
+        (WebKit::WebCommonWorkerClient::postConsoleMessageToWorkerObject):
+        * src/FrameLoaderClientImpl.cpp:
+        * src/FrameLoaderClientImpl.h:
+        * src/WebWorkerBase.cpp:
+        (WebKit::WebWorkerBase::postConsoleMessageToWorkerObject):
+        (WebKit::WebWorkerBase::postConsoleMessageTask):
+        * src/WebWorkerBase.h:
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
+        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask):
+        * src/WebWorkerClientImpl.h:
+
+2010-04-07  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] WebIDBDatabaseError::assign doesn't work correctly
+        https://bugs.webkit.org/show_bug.cgi?id=37209
+
+        * src/WebIDBDatabaseError.cpp:
+        (WebKit::WebIDBDatabaseError::assign):
+
+2010-04-07  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36827
+
+        Updated the WebCore::shouldTreatAsAttachement function call with the
+        new more generic replacement WebCore::contentDispositionType.
+
+        See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForMIMEType):
+
+2010-04-07  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add createApplicationCacheHost to WebFrameClient so
+        the ApplicationCacheHost has access to its frame.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36882
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::createApplicationCacheHost):
+        * src/ApplicationCacheHostInternal.h:
+        (WebCore::ApplicationCacheHostInternal::ApplicationCacheHostInternal):
+
+2010-04-06  Nicolas Weber  <thakis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Use drag images on OS X as well.
+        https://bugs.webkit.org/show_bug.cgi?id=37069
+
+        * src/DragClientImpl.cpp:
+        (WebKit::DragClientImpl::startDrag):
+
+2010-04-06  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Changing references to Graphics Layer related classes from *Skia to *Chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=37116
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::paint):
+        (WebKit::WebViewImpl::setAcceleratedCompositing):
+        (WebKit::WebViewImpl::updateRootLayerContents):
+        * src/WebViewImpl.h:
+
+2010-04-06  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [Chromium] Implement WebInputElement::maxLength.
+        https://bugs.webkit.org/show_bug.cgi?id=37172
+
+        * public/WebInputElement.h:
+        * src/WebInputElement.cpp:
+        (WebKit::WebInputElement::maxLength):
+
+2010-04-06  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] need DragImage implementation
+        https://bugs.webkit.org/show_bug.cgi?id=35811
+
+        Basic implementation using SkBitmap. Transformations are not supported
+        yet. No implementation for mac.
+
+        This was previously committed but rolled back for breaking layout
+        tests.
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::startDragging):
+        * src/DragClientImpl.cpp:
+        (WebKit::DragClientImpl::startDrag): new: check for null dragImage.
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::startDragging):
+        * src/WebViewImpl.h:
+
+2010-04-06  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [Chromium] Move the getElementsByTagName from WebDocument to WebNode.
+        https://bugs.webkit.org/show_bug.cgi?id=37161
+
+        * public/WebDocument.h:
+        * public/WebNode.h:
+        * src/WebDocument.cpp:
+        * src/WebNode.cpp:
+        (WebKit::WebNode::getElementsByTagName):
+
+2010-04-06  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed build fix for Chromium DEPS.
+
+        * DEPS:
+
+2010-04-06  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed: build fix.
+
+        * DEPS:
+
+2010-04-06  Mattias Nissler  <mnissler@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Handle docking requests from the developer tools and forward them to
+        WebDevToolsFrontendClient.
+        https://bugs.webkit.org/show_bug.cgi?id=36944
+
+        * public/WebDevToolsFrontendClient.h:
+        (WebKit::WebDevToolsFrontendClient::requestDockWindow):
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::jsRequestAttachWindow):
+        * src/WebDevToolsFrontendImpl.h:
+
+2010-04-06  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Fixed logging of unhndled worker exceptions.
+        https://bugs.webkit.org/show_bug.cgi?id=37143
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
+
+2010-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        * src/LocalizedStrings.cpp: (WebCore::crashedPluginText): Added a stub string for plug-in
+        failure.
+
+2010-04-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Rolling out chromium changes r57028 and r57032 
+        for breaking chromium layout tests.
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::startDragging):
+        * src/DragClientImpl.cpp:
+        (WebKit::DragClientImpl::startDrag):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::startDragging):
+        * src/WebViewImpl.h:
+
+2010-04-03  Darin Fisher  <darin@chromium.org>
+
+        Add default implementations of WebNotificationPresenter methods to
+        repair the downstream Chromium build.
+
+        * public/WebNotificationPresenter.h:
+        (WebKit::WebNotificationPresenter::show):
+        (WebKit::WebNotificationPresenter::cancel):
+        (WebKit::WebNotificationPresenter::objectDestroyed):
+        (WebKit::WebNotificationPresenter::checkPermission):
+        (WebKit::WebNotificationPresenter::requestPermission):
+
+2010-04-02  Michael Nordman  <michaeln@google.com>
+
+        Reviewed by Nate Chapin.
+
+        Set the close policy used by the DatabaseCloseTask at this callsite to
+        RemoveDatabaseFromContext. This restores its behavior to what it was prior to
+        r56293.
+        https://bugs.webkit.org/show_bug.cgi?id=37037
+
+        * src/WebDatabase.cpp:
+        (WebKit::WebDatabase::closeDatabaseImmediately):
+
+2010-04-02  Evan Stade  <estade@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] need DragImage implementation
+        https://bugs.webkit.org/show_bug.cgi?id=35811
+
+        Use the DragImageRef that the DragController passes to us.
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::startDragging):
+        * src/DragClientImpl.cpp:
+        (WebKit::DragClientImpl::startDrag):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::startDragging):
+        * src/WebViewImpl.h:
+
+2010-04-02  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Clean up unused calls after changes to checkPermission and requestPermission argument lists.
+
+        * public/WebNotificationPresenter.h:
+        * src/NotificationPresenterImpl.cpp:
+        (WebKit::NotificationPresenterImpl::checkPermission):
+        (WebKit::NotificationPresenterImpl::requestPermission):
+
+2010-04-02  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Eric Seidel.
+
+        Implement and test new framebuffer object attachment behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=35611
+
+        Test: fast/canvas/webgl/framebuffer-object-attachment.html
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Map to correct DEPTH_STENCIL format.
+        (WebKit::WebGraphicsContext3DDefaultImpl::framebufferRenderbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getFramebufferAttachmentParameteriv):
+        (WebKit::WebGraphicsContext3DDefaultImpl::renderbufferStorage):
+
+2010-04-02  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        The popup type (select or suggestion) is now passed to the
+        WebClient::createPopupMenu() method. This is required for
+        Chromium on Linux to make the select popups work correctly.
+        https://bugs.webkit.org/show_bug.cgi?id=37013
+
+        * WebKit.gyp:
+        * public/WebPopupType.h: Added.
+        (WebKit::):
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::createPopupMenu):
+        * src/ChromeClientImpl.cpp:
+        (WebCore::convertPopupType):
+        (WebKit::ChromeClientImpl::popupOpened):
+
+2010-04-02  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Implement InspectorFrontendClient in Chromium and remove all custom bindings for the host methods from WebDevToolsFrontendImpl. 
+
+        https://bugs.webkit.org/show_bug.cgi?id=36817
+
+        * WebKit.gyp:
+        * src/InspectorFrontendClientImpl.cpp: Added.
+        (WebKit::InspectorFrontendClientImpl::InspectorFrontendClientImpl):
+        (WebKit::InspectorFrontendClientImpl::~InspectorFrontendClientImpl):
+        (WebKit::InspectorFrontendClientImpl::windowObjectCleared):
+        (WebKit::InspectorFrontendClientImpl::frontendLoaded):
+        (WebKit::InspectorFrontendClientImpl::moveWindowBy):
+        (WebKit::InspectorFrontendClientImpl::localizedStringsURL):
+        (WebKit::InspectorFrontendClientImpl::hiddenPanels):
+        (WebKit::InspectorFrontendClientImpl::bringToFront):
+        (WebKit::InspectorFrontendClientImpl::closeWindow):
+        (WebKit::InspectorFrontendClientImpl::canAttachWindow):
+        (WebKit::InspectorFrontendClientImpl::attachWindow):
+        (WebKit::InspectorFrontendClientImpl::detachWindow):
+        (WebKit::InspectorFrontendClientImpl::changeAttachedWindowHeight):
+        (WebKit::InspectorFrontendClientImpl::inspectedURLChanged):
+        * src/InspectorFrontendClientImpl.h: Added.
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::frontendLoaded):
+        * src/WebDevToolsFrontendImpl.h:
+        * src/js/DebuggerAgent.js:
+        (devtools.DebuggerAgent.prototype.doHandleBacktraceResponse_):
+        * src/js/DevTools.js:
+        ():
+
+2010-04-01  Jay Civelli  <jcivelli@google.com>
+
+        Reviewed by David Levin.
+
+        Adds a method to WebFrame to execute JavaScript and get the value
+        it evaluates to.
+        https://bugs.webkit.org/show_bug.cgi?id=36907
+
+        * public/WebFrame.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::executeScriptAndReturnValue):
+        * src/WebFrameImpl.h:
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
+
+        * features.gypi:
+
+2010-04-01  Finnur Thorarinsson  <finnur.webkit@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] FindInPage on multi-frame pages wasn't always updating
+        tickmarks on scrollbars for the subframes. It was calling invalidateRect
+        on the View and specifying a rect that's in window coordinates, whereas
+        the invalidateRect expects frame coordinates.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36982
+        
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::invalidateArea):
+
+2010-04-01  Finnur Thorarinsson  <finnur.webkit@gmail.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] FindInPage should clear the focused node when a match has
+        been found. This is because WebFrameImpl::setFocus will try to refocus
+        editable elements if it thinks they have focus, causing the page to
+        scroll.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36923
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::find):
+
+2010-04-01  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        As a follow up on https://bugs.webkit.org/show_bug.cgi?id=36535, remove:
+        GeolocationServiceBridgeChromium.h
+        dettachBridge()
+        getGeolocationService()
+        https://bugs.webkit.org/show_bug.cgi?id=36895
+
+        * WebKit.gyp:
+        * public/GeolocationServiceBridgeChromium.h: Removed.
+        * public/WebGeolocationService.h:
+        (WebKit::WebGeolocationService::detachBridge):
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::geolocationService):
+
+2010-03-31  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Misc IndexedDatabase cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=36889
+
+        Plumb the Frame* so Chromium knows where the request originated from.
+
+        * public/WebIndexedDatabase.h:
+        * src/IndexedDatabaseProxy.cpp:
+        (WebCore::IndexedDatabaseProxy::open):
+        * src/IndexedDatabaseProxy.h:
+        * src/WebIndexedDatabaseImpl.cpp:
+        (WebKit::WebIndexedDatabaseImpl::open):
+        * src/WebIndexedDatabaseImpl.h:
+
+2010-03-31  Alpha Lam  <hclam@chromium.org>
+
+        Not reviewed. Build fix.
+
+        Fixing a build break caused by 56872. One of the Chromium bots doesn't
+        like std::strstr(). Includes string.h and use strstr() instead.
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+        (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes):
+        Includes string.h and use strstr().
+
+2010-03-31  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Hook up WebGLContextAttributes to OpenGL context creation code
+        https://bugs.webkit.org/show_bug.cgi?id=33416
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Hook up WebGLContextAttributes to OpenGL context creation code for Chrome.
+        (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+        (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes):
+        (WebKit::WebGraphicsContext3DDefaultImpl::reshape):
+        (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::readPixels): Deal with wrong returned alpha values in Mac.
+        * src/WebGraphicsContext3DDefaultImpl.h: Add a function.
+
+2010-03-31  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] including WebKit.gyp:webkit should automatically add Skia
+        and NPAPI include paths
+
+        https://bugs.webkit.org/show_bug.cgi?id=36887
+
+        * WebKit.gyp:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Implements cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * public/WebGeolocationService.h:
+        (WebKit::WebGeolocationService::cancelPermissionRequestForFrame):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::cancelGeolocationPermissionRequestForFrame):
+        * src/ChromeClientImpl.h:
+
+2010-03-31  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed. Rolling out r56829 since it broke chromium layout tests.
+
+        [REGRESSION] Inspector tests started crashing since r56829
+        https://bugs.webkit.org/show_bug.cgi?id=36888
+
+        * public/WebFrameClient.h:
+        * src/FrameLoaderClientImpl.cpp:
+        * src/FrameLoaderClientImpl.h:
+
+2010-03-31  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Add stubs for moveWindowBy and setAttachedWindowHeight.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36842
+
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::jsSetAttachedWindowHeight):
+        (WebKit::WebDevToolsFrontendImpl::jsMoveWindowBy):
+        * src/WebDevToolsFrontendImpl.h:
+
+2010-03-31  John Gregg  <johnnyg@google.com>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] add logging of cross-frame property accesses for site isolation
+        https://bugs.webkit.org/show_bug.cgi?id=35773
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::logCrossFramePropertyAccess):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::logCrossFramePropertyAccess):
+        * src/FrameLoaderClientImpl.h:
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * public/WebCString.h:
+        * src/FrameLoaderClientImpl.cpp:
+        * src/GraphicsContext3D.cpp:
+        * src/WebCString.cpp:
+        (WebKit::WebCString::assign):
+        (WebKit::WebCString::WebCString):
+        (WebKit::WebCString::operator=):
+        (WebKit::WebCString::operator WTF::CString):
+        * src/WebMediaPlayerClientImpl.cpp:
+        * src/WebString.cpp:
+        * src/WebURLError.cpp:
+
+2010-03-30  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Rename / tidy up Geolocation bridge:
+        Rename GeolocationServiceBridgeChromium.cpp to WebGeolocationServiceBridgeImpl.cpp            
+        Uses a temporary compatibility layer in GeolocationServiceBridgeChromium.h.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36535
+
+        * WebKit.gyp:
+        * public/GeolocationServiceBridgeChromium.h:
+        * public/WebGeolocationService.h: Copied from WebKit/chromium/public/GeolocationServiceBridgeChromium.h.
+        (WebKit::WebGeolocationService::detachBridge):
+        * public/WebGeolocationServiceBridge.h: Copied from WebKit/chromium/public/GeolocationServiceBridgeChromium.h.
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::geolocationService):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::requestGeolocationPermissionForFrame):
+        * src/ChromiumBridge.cpp:
+        * src/GeolocationServiceBridgeChromium.cpp: Removed.
+        * src/WebGeolocationServiceBridgeImpl.cpp: Copied from WebKit/chromium/src/GeolocationServiceBridgeChromium.cpp.
+        (WebKit::createGeolocationServiceBridgeImpl):
+        (WebKit::WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl):
+        (WebKit::WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl):
+        (WebKit::WebGeolocationServiceBridgeImpl::startUpdating):
+        (WebKit::WebGeolocationServiceBridgeImpl::stopUpdating):
+        (WebKit::WebGeolocationServiceBridgeImpl::suspend):
+        (WebKit::WebGeolocationServiceBridgeImpl::resume):
+        (WebKit::WebGeolocationServiceBridgeImpl::getBridgeId):
+        (WebKit::WebGeolocationServiceBridgeImpl::setIsAllowed):
+        (WebKit::WebGeolocationServiceBridgeImpl::setLastPosition):
+        (WebKit::WebGeolocationServiceBridgeImpl::setLastError):
+        (WebKit::WebGeolocationServiceBridgeImpl::getWebViewClient):
+        * src/WebGeolocationServiceBridgeImpl.h: Copied from WebKit/chromium/public/GeolocationServiceBridgeChromium.h.
+
+2010-03-30  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Remove dysfunctional implementation of canEstablishDatabase for
+        Workers. I postpone this implementation until Workers can actually
+        access Web Databases.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36795
+
+        * src/DatabaseObserver.cpp:
+        (WebCore::DatabaseObserver::canEstablishDatabase):
+        * src/WebWorkerBase.h:
+
+2010-03-29  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        More IndexedDB work
+        https://bugs.webkit.org/show_bug.cgi?id=36770
+
+        Start the implementation of WebIndexedDatabase (for entrance back into WebKit).
+
+        * WebKit.gyp:
+        * public/WebIndexedDatabase.h:
+        * src/WebIndexedDatabaseImpl.cpp: Added.
+        (WebKit::WebIndexedDatabase::create):
+        (WebKit::WebIndexedDatabaseImpl::~WebIndexedDatabaseImpl):
+        (WebKit::WebIndexedDatabaseImpl::open):
+        * src/WebIndexedDatabaseImpl.h: Added.
+
+2010-03-29  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Change NotificationPresenter::checkPermission() to take the source frames full KURL,
+        rather than its SecurityOrigin. This will aid chromium in having more fine grained
+        permissions to control notification spam.
+
+        * public/WebNotificationPresenter.h:
+        (WebKit::WebNotificationPresenter::checkPermission):
+        * src/NotificationPresenterImpl.cpp:
+        (WebKit::NotificationPresenterImpl::checkPermission):
+        * src/NotificationPresenterImpl.h:
+
+2010-03-29  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        Factored out the 'ShouldTreatAsAttachment' function to HTTPParsers.*
+        and replacted local version with the factored out version.
+
+        The code was factored out to make possible its use in other implementations
+        such as QtWebKit.
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForMIMEType):
+
+2010-03-29  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Pass a WebFrame to WebFrameClient::allowDatabase instead of a WebSecurityOrigin
+        https://bugs.webkit.org/show_bug.cgi?id=36743
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::allowDatabase):
+        * src/DatabaseObserver.cpp:
+        (WebCore::DatabaseObserver::canEstablishDatabase):
+
+2010-03-24  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        More IndexedDB plumbing
+        https://bugs.webkit.org/show_bug.cgi?id=36546
+
+        Plumbing work towards the goal of making IndexedDatabase::open work.
+
+        * WebKit.gyp:
+        * public/WebIDBCallbacks.h: Added.
+        (WebKit::WebIDBCallbacks::~WebIDBCallbacks):
+        * public/WebIDBDatabase.h: Added.
+        (WebKit::WebIDBDatabase::~WebIDBDatabase):
+        * public/WebIDBDatabaseError.h: Added.
+        (WebKit::WebIDBDatabaseError::WebIDBDatabaseError):
+        (WebKit::WebIDBDatabaseError::operator=):
+        * public/WebIndexedDatabase.h:
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::indexedDatabase):
+        * public/WebSerializedScriptValue.h:
+        * src/IDBCallbacksProxy.h: Added.
+        (WebCore::IDBCallbacksProxy::IDBCallbacksProxy):
+        (WebCore::IDBCallbacksProxy::~IDBCallbacksProxy):
+        (WebCore::IDBCallbacksProxy::onSuccess):
+        (WebCore::IDBCallbacksProxy::onError):
+        * src/IDBDatabaseProxy.cpp: Added.
+        (WebCore::IDBDatabaseProxy::create):
+        (WebCore::IDBDatabaseProxy::IDBDatabaseProxy):
+        (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy):
+        * src/IDBDatabaseProxy.h: Added.
+        * src/IndexedDatabaseProxy.cpp:
+        (WebCore::IndexedDatabaseProxy::IndexedDatabaseProxy):
+        (WebCore::IndexedDatabaseProxy::open):
+        * src/IndexedDatabaseProxy.h:
+        * src/WebIDBDatabaseError.cpp: Added.
+        (WebKit::WebIDBDatabaseError::~WebIDBDatabaseError):
+        (WebKit::WebIDBDatabaseError::WebIDBDatabaseError):
+        (WebKit::WebIDBDatabaseError::assign):
+        (WebKit::WebIDBDatabaseError::code):
+        (WebKit::WebIDBDatabaseError::message):
+        (WebKit::WebIDBDatabaseError::operator=):
+        (WebKit::WebIDBDatabaseError::operator PassRefPtr<IDBDatabaseError>):
+
+2010-03-29  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Remove a possibility of confusion from Profiles panel Welcome screen
+        by turning buttons into non-clickable glyphs. Also, span instructions
+        alongside panel width.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34319
+
+        * src/js/HeapProfilerPanel.js:
+        (WebInspector.HeapSnapshotProfileType.prototype.get welcomeMessage):
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Removed extraneous includes of KeyboardCodesWin.h and KeyboardCodesPosix.h -
+        these no longer exist, but they weren't needed even before reshuffling KeyboardCodes headers.
+
+        * src/WebViewImpl.cpp:
+
+2010-03-27  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Use WebKitClient to instantiate WebGraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=36669
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::initialize):
+
+2010-03-24  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Implement WebFormControlElement and WebSelectElement.  Add
+        a getFormControlElements method to WebFormElement.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36562
+
+        * WebKit.gyp:
+        * public/WebElement.h:
+        * public/WebFormControlElement.h: Added.
+        * public/WebFormElement.h:
+        * public/WebInputElement.h:
+        (WebKit::WebInputElement::WebInputElement):
+        (WebKit::WebInputElement::operator=):
+        (WebKit::WebInputElement::assign):
+        * public/WebSelectElement.h: Added.
+        * src/WebElement.cpp:
+        (WebKit::WebElement::isFormControlElement):
+        * src/WebFormControlElement.cpp: Added.
+        * src/WebFormElement.cpp:
+        (WebKit::WebFormElement::getFormControlElements):
+        * src/WebInputElement.cpp:
+        (WebKit::WebInputElement::WebInputElement):
+        * src/WebSelectElement.cpp: Added.
+
+2010-03-26  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Send worker resource content to inspector to enable display of web
+        workers in inspector's resource tab.
+        https://bugs.webkit.org/show_bug.cgi?id=36658
+
+        * src/SharedWorkerRepository.cpp:
+        (WebCore::SharedWorkerScriptLoader::notifyFinished):
+
+2010-03-25  Tony Chang  <tony@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] correctly handle move drag operations
+        https://bugs.webkit.org/show_bug.cgi?id=36484
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::dragTargetDragEnter):
+        (WebKit::WebViewImpl::dragTargetDragOver):
+        (WebKit::WebViewImpl::dragTargetDragEnterOrOver): Combine common code into a helper method
+            and properly mask against the drag effect.
+        (WebKit::WebViewImpl::createUniqueIdentifierForRequest):
+        * src/WebViewImpl.h:
+
+2010-03-25  Drew Wilson  <atwilson@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [v8] Error in getScriptExecutionContext() when worker context is terminating
+        https://bugs.webkit.org/show_bug.cgi?id=36565
+
+        Test: Existing worker tests suffice.
+
+        * src/WebWorkerClientImpl.cpp:
+        (WebKit::WebWorkerClientImpl::createWorkerContextProxy):
+        Changed to use WorkerScriptController::controllerForContext() instead of WorkerScriptExecutionProxy::retrieve().
+
+2010-03-25  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Add an ASSERT macro to the Chromium WebKit API
+        https://bugs.webkit.org/show_bug.cgi?id=36545
+
+        * WebKit.gyp:  Add WebCommon.cpp
+        * public/WebCommon.h:  Add the Macro.
+        * public/WebPrivatePtr.h:
+        (WebKit::WebPrivatePtr::~WebPrivatePtr):  Verify the pointer is now 0.
+        * src/WebCommon.cpp: Added.
+        (WebKit::failedAssertion): Calls the WTF assert function and then crashes.
+
+2010-03-25  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Remove ASSERT(isMainThread()) which is violated for workers and not necessary at this point.
+        https://bugs.webkit.org/show_bug.cgi?id=36614
+
+        * src/DatabaseObserver.cpp:
+        (WebCore::DatabaseObserver::canEstablishDatabase):
+
+2010-03-25  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Forward DatabaseTracker::canEstablishDatabase to chromium layer.
+        https://bugs.webkit.org/show_bug.cgi?id=36595
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::allowDatabase):
+        * src/DatabaseObserver.cpp:
+        (WebCore::DatabaseObserver::canEstablishDatabase):
+        * src/WebWorkerBase.h:
+        (WebKit::WebWorkerBase::allowDatabase):
+
+2010-03-10  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Fix up WebMouseWheelEventBuilder to properly calculate the units
+        https://bugs.webkit.org/show_bug.cgi?id=35989
+
+        * src/WebInputEventConversion.cpp:
+
+2010-03-24  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Eliminate unecessary redraws of GraphicsLayer contents when doing accelerated compositing:
+        https://bugs.webkit.org/show_bug.cgi?id=36470
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::paint):
+        Remove call that forced redrawing the contents of the entire layer hierarchy.
+
+2010-03-24  Dmitry Titov  <dimich@chromium.org>
+
+        No review, rolling out r56453.
+        http://trac.webkit.org/changeset/56453
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        In Chromium port, it broke invalid-image-data-standalone.html
+        invalid-image-data.html multipart-wait-before-boundary.html
+        stop-crash.html win-boundary-crash.html
+
+        * src/ResourceHandle.cpp:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        (WebCore::ResourceHandleInternal::start):
+        (WebCore::ResourceHandleInternal::cancel):
+        (WebCore::ResourceHandleInternal::didReceiveResponse):
+        (WebCore::ResourceHandleInternal::didReceiveData):
+        (WebCore::ResourceHandleInternal::didFinishLoading):
+        (WebCore::ResourceHandleInternal::didFail):
+
+2010-03-24  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium]WebKit side of adding search support to Pepper.
+        https://bugs.webkit.org/show_bug.cgi?id=36434
+
+        * WebKit.gyp:
+        * public/WebDocument.h:
+        * public/WebNode.h:
+        (WebKit::WebNode::to):
+        (WebKit::WebNode::toConst):
+        * public/WebPluginDocument.h: Added.
+        (WebKit::WebPluginDocument::WebPluginDocument):
+        (WebKit::WebPluginDocument::operator=):
+        (WebKit::WebPluginDocument::assign):
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::isPluginDocument):
+        * src/WebPluginDocument.cpp: Added.
+        (WebKit::WebPluginDocument::plugin):
+        (WebKit::WebPluginDocument::WebPluginDocument):
+        (WebKit::WebPluginDocument::operator=):
+        (WebKit::WebPluginDocument::operator PassRefPtr<PluginDocument>):
+
+2010-03-24  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add some diagnostics to try to track down cause of crash in ArchiveFactory::isArchiveMimeType().
+
+        https://bugs.webkit.org/show_bug.cgi?id=36426
+
+        * src/ResourceHandle.cpp: Track state across ResourceHandle invocations.
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        (WebCore::ResourceHandleInternal::):
+        (WebCore::ResourceHandleInternal::start):
+        (WebCore::ResourceHandleInternal::cancel):
+        (WebCore::ResourceHandleInternal::didReceiveResponse):
+        (WebCore::ResourceHandleInternal::didReceiveData):
+        (WebCore::ResourceHandleInternal::didFinishLoading):
+        (WebCore::ResourceHandleInternal::didFail):
+
+2010-03-24  Jay Campan  <jcampan@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Making Chromium select popups not steal activation from the browser.
+        Select popups are now like autocomplete popups, shown in non-activated
+        windows.
+        https://bugs.webkit.org/show_bug.cgi?id=36062
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::createPopupMenu):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::popupOpened):
+        (WebKit::ChromeClientImpl::popupClosed):
+        * src/ChromeClientImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::):
+        (WebKit::WebViewImpl::mouseDown):
+        (WebKit::WebViewImpl::keyEvent):
+        (WebKit::WebViewImpl::selectPopupHandleKeyEvent):
+        (WebKit::WebViewImpl::hideSelectPopup):
+        (WebKit::WebViewImpl::popupOpened):
+        (WebKit::WebViewImpl::popupClosed):
+        (WebKit::WebViewImpl::setFocus):
+        (WebKit::WebViewImpl::applyAutoFillSuggestions):
+        (WebKit::WebViewImpl::applyAutocompleteSuggestions):
+        * src/WebViewImpl.h:
+
+2010-03-24  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: [Chromium] Audits never complete
+        https://bugs.webkit.org/show_bug.cgi?id=36544
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-03-24  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        [Chromium] Fix VKEY_F10, VKEY_F11 translation in WebInputEvent.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=36524
+
+        * src/WebInputEvent.cpp:
+        (WebKit::staticKeyIdentifiers):
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::chooseIconForFiles):
+        * src/ChromeClientImpl.h:
+
+2010-03-23  Kenneth Russell  <kbr@google.com>
+
+        Unreviewed build fix.
+
+        Add #include <stdio.h> to fix Chromium Linux build.
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+
+2010-03-23  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, revert r56376.
+
+        This revision introduced a crash in a couple of layout tests
+        on Chromium Linux.
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::createPopupMenu):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::popupOpened):
+        * src/ChromeClientImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::):
+        (WebKit::WebViewImpl::mouseDown):
+        (WebKit::WebViewImpl::keyEvent):
+        (WebKit::WebViewImpl::setFocus):
+        (WebKit::WebViewImpl::applyAutoFillSuggestions):
+        (WebKit::WebViewImpl::applyAutocompleteSuggestions):
+        * src/WebViewImpl.h:
+
+2010-03-23  Sergey Ulanov  <sergeyu@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Changes needed to implement Show/Hide Controls command for <video> in
+        chrome: (1) added Controls action in WebMediaPlayerAction that toggles
+        controls for media player, (2) added MediaHasVideo in
+        WebContextMenuData so that controls can be made toggleable only for
+        video player but not for audio.
+        https://bugs.webkit.org/show_bug.cgi?id=36460
+
+        * public/WebContextMenuData.h:
+        (WebKit::WebContextMenuData::):
+        * public/WebMediaPlayerAction.h:
+        (WebKit::WebMediaPlayerAction::):
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::performMediaPlayerAction):
+
+2010-03-23  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        When uncaught exception happens reveal Scripts panel only if reporting uncaught exceptions is on.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36498
+
+        * src/js/DebuggerAgent.js:
+        (devtools.DebuggerAgent.prototype.handleExceptionEvent_):
+
+2010-03-23  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: TimelinePanel stays in the recording state after reopening WebInspector.
+        https://bugs.webkit.org/show_bug.cgi?id=36503
+
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::detach):
+
+2010-03-22  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Add GraphicsContext3D abstraction to WebKit API
+        https://bugs.webkit.org/show_bug.cgi?id=36262
+
+        Added WebGraphicsContext3D to the WebKit API and refactored Chromium's
+        GraphicsContext3D implementation to use it. All of the OpenGL calls have
+        been moved out of WebKit/chromium/src/GraphicsContext3D.cpp and into the
+        WebGraphicsContext3D implementation. GraphicsContext3D is still
+        responsible for the transfer of rendered output from the
+        WebGraphicsContext3D to the HTMLCanvasElement.
+
+        The GraphicsContext3DInternal class, which is a data member of
+        GraphicsContext3D for the Chromium port, remains. It is possible to
+        eliminate this class and thereby one level of delegation, but this is
+        being deferred.
+
+        The needed entry point for a Chrome implementation of
+        WebGraphicsContext3D has been added to WebKitClient, but it is not being
+        called yet by GraphicsContext3D. It will be once this patch lands and
+        Chromium is rolled forward to support this entry point.
+
+        This is a large patch, but the transformation is almost entirely
+        mechanical and there is no change in functionality. Nearly all of
+        GraphicsContext3D and GraphicsContext3DInternal has been moved to
+        WebGraphicsContext3DDefaultImpl. The only area where the splitting of
+        logic is less than mechanical is GraphicsContext3D::beginPaint() and its
+        callees.
+
+        Ran all WebGL layout tests and demos from Khronos site in Chromium
+        on Mac and Windows.
+
+        * WebKit.gyp:
+        * public/WebGraphicsContext3D.h: Added.
+        (WebKit::WebGraphicsContext3D::Attributes::Attributes):
+        (WebKit::WebGraphicsContext3D::~WebGraphicsContext3D):
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::createGraphicsContext3D):
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::initialize):
+        (WebCore::GraphicsContext3DInternal::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3DInternal::platformTexture):
+        (WebCore::GraphicsContext3DInternal::beginPaint):
+        (WebCore::GraphicsContext3DInternal::endPaint):
+        (WebCore::GraphicsContext3DInternal::reshape):
+        (WebCore::GraphicsContext3DInternal::bindAttribLocation):
+        (WebCore::GraphicsContext3DInternal::bindTexture):
+        (WebCore::GraphicsContext3DInternal::bufferData):
+        (WebCore::GraphicsContext3DInternal::bufferSubData):
+        (WebCore::GraphicsContext3DInternal::getActiveAttrib):
+        (WebCore::GraphicsContext3DInternal::getActiveUniform):
+        (WebCore::GraphicsContext3DInternal::getAttribLocation):
+        (WebCore::GraphicsContext3DInternal::getContextAttributes):
+        (WebCore::GraphicsContext3DInternal::getProgramInfoLog):
+        (WebCore::GraphicsContext3DInternal::getShaderInfoLog):
+        (WebCore::GraphicsContext3DInternal::getShaderSource):
+        (WebCore::GraphicsContext3DInternal::getString):
+        (WebCore::GraphicsContext3DInternal::getUniformLocation):
+        (WebCore::GraphicsContext3DInternal::readPixels):
+        (WebCore::GraphicsContext3DInternal::shaderSource):
+        (WebCore::GraphicsContext3DInternal::texImage2D):
+        (WebCore::GraphicsContext3DInternal::texSubImage2D):
+        (WebCore::GraphicsContext3DInternal::uniform1fv):
+        (WebCore::GraphicsContext3DInternal::uniform1iv):
+        (WebCore::GraphicsContext3DInternal::uniform2fv):
+        (WebCore::GraphicsContext3DInternal::uniform2iv):
+        (WebCore::GraphicsContext3DInternal::uniform3fv):
+        (WebCore::GraphicsContext3DInternal::uniform3iv):
+        (WebCore::GraphicsContext3DInternal::uniform4fv):
+        (WebCore::GraphicsContext3DInternal::uniform4iv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix2fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix3fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformTexture):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        * src/WebGraphicsContext3D.cpp: Added.
+        (WebKit::WebGraphicsContext3D::createDefault):
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Added.
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::create):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::~GLConnection):
+        (WebKit::WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState):
+        (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+        (WebKit::WebGraphicsContext3DDefaultImpl::makeContextCurrent):
+        (WebKit::WebGraphicsContext3DDefaultImpl::width):
+        (WebKit::WebGraphicsContext3DDefaultImpl::height):
+        (WebKit::WebGraphicsContext3DDefaultImpl::sizeInBytes):
+        (WebKit::createTextureObject):
+        (WebKit::WebGraphicsContext3DDefaultImpl::reshape):
+        (WebKit::WebGraphicsContext3DDefaultImpl::flipVertically):
+        (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::activeTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::disableVertexAttribArray):
+        (WebKit::WebGraphicsContext3DDefaultImpl::drawElements):
+        (WebKit::WebGraphicsContext3DDefaultImpl::enableVertexAttribArray):
+        (WebKit::WebGraphicsContext3DDefaultImpl::generateMipmap):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getActiveAttrib):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getActiveUniform):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getContextAttributes):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getError):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getProgramInfoLog):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getShaderInfoLog):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getShaderSource):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getString):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getVertexAttribOffset):
+        (WebKit::WebGraphicsContext3DDefaultImpl::releaseShaderCompiler):
+        (WebKit::WebGraphicsContext3DDefaultImpl::shaderSource):
+        (WebKit::WebGraphicsContext3DDefaultImpl::vertexAttribPointer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createProgram):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createRenderbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteProgram):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteRenderbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteShader):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::synthesizeGLError):
+        * src/WebGraphicsContext3DDefaultImpl.h: Added.
+        (WebKit::WebGraphicsContext3DDefaultImpl::):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::chooseFBConfig):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::createNewContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::createPbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::destroyPbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::makeCurrent):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::destroyContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::getCurrentContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::GLConnection):
+
+2010-03-22  Jay Campan  <jcampan@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Making Chromium select popups not steal activation from the browser.
+        Select popups are now like autocomplete popups, shown in non-activated
+        windows.
+        https://bugs.webkit.org/show_bug.cgi?id=36062
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::createPopupMenu):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::popupOpened):
+        (WebKit::ChromeClientImpl::popupClosed):
+        * src/ChromeClientImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::):
+        (WebKit::WebViewImpl::mouseDown):
+        (WebKit::WebViewImpl::keyEvent):
+        (WebKit::WebViewImpl::selectPopupHandleKeyEvent):
+        (WebKit::WebViewImpl::hideSelectPopup):
+        (WebKit::WebViewImpl::popupOpened):
+        (WebKit::WebViewImpl::popupClosed):
+        (WebKit::WebViewImpl::setFocus):
+        (WebKit::WebViewImpl::applyAutoFillSuggestions):
+        (WebKit::WebViewImpl::applyAutocompleteSuggestions):
+        * src/WebViewImpl.h:
+
+2010-03-22  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [chromium] Renderer crashes when navigating to a reference fragment in
+        a frame that has no current HistoryItem.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36443
+
+        Test: fast/loader/crash-replacing-location-before-load.html
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDidNavigateWithinPage):
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * src/LocalizedStrings.cpp:
+        (WebCore::missingPluginText): Added
+
+2010-03-22  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Fix inspected Page crash in destructor when Web Inspector is open.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36441
+
+        * src/js/InjectDispatch.js:
+        (inspectedPageDestroyed): Added stub for missing method.
+
+2010-03-22  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Added methods to WebSecurityOrigin for invoking
+        SecurityOrigin::canAccess and SecurityOrigin::Create
+        https://bugs.webkit.org/show_bug.cgi?id=36356
+
+        * public/WebSecurityOrigin.h:
+        * src/WebSecurityOrigin.cpp:
+        (WebKit::WebSecurityOrigin::create):
+        (WebKit::WebSecurityOrigin::canAccess):
+
+2010-03-20  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        No review, rolling out r56294.
+        http://trac.webkit.org/changeset/56294
+        https://bugs.webkit.org/show_bug.cgi?id=36262
+
+        Broke compile on Chromium canaries.
+
+        * WebKit.gyp:
+        * public/WebGraphicsContext3D.h: Removed.
+        * public/WebKitClient.h:
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::):
+        (WebCore::GraphicsContext3DInternal::GLConnection::chooseFBConfig):
+        (WebCore::GraphicsContext3DInternal::GLConnection::createNewContext):
+        (WebCore::GraphicsContext3DInternal::GLConnection::createPbuffer):
+        (WebCore::GraphicsContext3DInternal::GLConnection::destroyPbuffer):
+        (WebCore::GraphicsContext3DInternal::GLConnection::makeCurrent):
+        (WebCore::GraphicsContext3DInternal::GLConnection::destroyContext):
+        (WebCore::GraphicsContext3DInternal::GLConnection::getCurrentContext):
+        (WebCore::GraphicsContext3DInternal::GLConnection::GLConnection):
+        (WebCore::GraphicsContext3DInternal::GLConnection::create):
+        (WebCore::GraphicsContext3DInternal::GLConnection::~GLConnection):
+        (WebCore::GraphicsContext3DInternal::VertexAttribPointerState::VertexAttribPointerState):
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::makeContextCurrent):
+        (WebCore::GraphicsContext3DInternal::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3DInternal::platformTexture):
+        (WebCore::createTextureObject):
+        (WebCore::GraphicsContext3DInternal::reshape):
+        (WebCore::GraphicsContext3DInternal::flipVertically):
+        (WebCore::GraphicsContext3DInternal::beginPaint):
+        (WebCore::GraphicsContext3DInternal::activeTexture):
+        (WebCore::GraphicsContext3DInternal::bindBuffer):
+        (WebCore::GraphicsContext3DInternal::bindFramebuffer):
+        (WebCore::GraphicsContext3DInternal::bindTexture):
+        (WebCore::GraphicsContext3DInternal::bufferDataImpl):
+        (WebCore::GraphicsContext3DInternal::disableVertexAttribArray):
+        (WebCore::GraphicsContext3DInternal::enableVertexAttribArray):
+        (WebCore::GraphicsContext3DInternal::getError):
+        (WebCore::GraphicsContext3DInternal::getContextAttributes):
+        (WebCore::GraphicsContext3DInternal::vertexAttribPointer):
+        (WebCore::GraphicsContext3DInternal::viewportImpl):
+        (WebCore::GraphicsContext3DInternal::synthesizeGLError):
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformTexture):
+        (WebCore::GraphicsContext3D::makeContextCurrent):
+        (WebCore::GraphicsContext3D::reshape):
+        (WebCore::GraphicsContext3D::beginPaint):
+        (WebCore::GraphicsContext3D::endPaint):
+        (WebCore::GraphicsContext3D::sizeInBytes):
+        (WebCore::GraphicsContext3D::createBuffer):
+        (WebCore::GraphicsContext3D::createFramebuffer):
+        (WebCore::GraphicsContext3D::createProgram):
+        (WebCore::GraphicsContext3D::createRenderbuffer):
+        (WebCore::GraphicsContext3D::createShader):
+        (WebCore::GraphicsContext3D::createTexture):
+        (WebCore::GraphicsContext3D::deleteBuffer):
+        (WebCore::GraphicsContext3D::deleteFramebuffer):
+        (WebCore::GraphicsContext3D::deleteProgram):
+        (WebCore::GraphicsContext3D::deleteRenderbuffer):
+        (WebCore::GraphicsContext3D::deleteShader):
+        (WebCore::GraphicsContext3D::deleteTexture):
+        (WebCore::GraphicsContext3D::activeTexture):
+        (WebCore::GraphicsContext3D::bindAttribLocation):
+        (WebCore::GraphicsContext3D::bindBuffer):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::bindTexture):
+        (WebCore::GraphicsContext3D::bufferData):
+        (WebCore::GraphicsContext3D::bufferSubData):
+        (WebCore::GraphicsContext3D::checkFramebufferStatus):
+        (WebCore::GraphicsContext3D::detachShader):
+        (WebCore::GraphicsContext3D::disableVertexAttribArray):
+        (WebCore::GraphicsContext3D::drawArrays):
+        (WebCore::GraphicsContext3D::drawElements):
+        (WebCore::GraphicsContext3D::enableVertexAttribArray):
+        (WebCore::GraphicsContext3D::generateMipmap):
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+        (WebCore::GraphicsContext3D::getAttribLocation):
+        (WebCore::GraphicsContext3D::getBooleanv):
+        (WebCore::GraphicsContext3D::getBufferParameteriv):
+        (WebCore::GraphicsContext3D::getContextAttributes):
+        (WebCore::GraphicsContext3D::getError):
+        (WebCore::GraphicsContext3D::getFloatv):
+        (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+        (WebCore::GraphicsContext3D::getIntegerv):
+        (WebCore::GraphicsContext3D::getProgramiv):
+        (WebCore::GraphicsContext3D::getProgramInfoLog):
+        (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
+        (WebCore::GraphicsContext3D::getShaderiv):
+        (WebCore::GraphicsContext3D::getShaderInfoLog):
+        (WebCore::GraphicsContext3D::getShaderSource):
+        (WebCore::GraphicsContext3D::getString):
+        (WebCore::GraphicsContext3D::getTexParameterfv):
+        (WebCore::GraphicsContext3D::getTexParameteriv):
+        (WebCore::GraphicsContext3D::getUniformfv):
+        (WebCore::GraphicsContext3D::getUniformiv):
+        (WebCore::GraphicsContext3D::getUniformLocation):
+        (WebCore::GraphicsContext3D::getVertexAttribfv):
+        (WebCore::GraphicsContext3D::getVertexAttribiv):
+        (WebCore::GraphicsContext3D::getVertexAttribOffset):
+        (WebCore::GraphicsContext3D::isBuffer):
+        (WebCore::GraphicsContext3D::isEnabled):
+        (WebCore::GraphicsContext3D::isFramebuffer):
+        (WebCore::GraphicsContext3D::isProgram):
+        (WebCore::GraphicsContext3D::isRenderbuffer):
+        (WebCore::GraphicsContext3D::isShader):
+        (WebCore::GraphicsContext3D::isTexture):
+        (WebCore::GraphicsContext3D::pixelStorei):
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::releaseShaderCompiler):
+        (WebCore::GraphicsContext3D::shaderSource):
+        (WebCore::GraphicsContext3D::synthesizeGLError):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        (WebCore::GraphicsContext3D::uniform1fv):
+        (WebCore::GraphicsContext3D::uniform1iv):
+        (WebCore::GraphicsContext3D::uniform2fv):
+        (WebCore::GraphicsContext3D::uniform2iv):
+        (WebCore::GraphicsContext3D::uniform3fv):
+        (WebCore::GraphicsContext3D::uniform3iv):
+        (WebCore::GraphicsContext3D::uniform4fv):
+        (WebCore::GraphicsContext3D::uniform4iv):
+        (WebCore::GraphicsContext3D::uniformMatrix2fv):
+        (WebCore::GraphicsContext3D::uniformMatrix3fv):
+        (WebCore::GraphicsContext3D::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::vertexAttrib1fv):
+        (WebCore::GraphicsContext3D::vertexAttrib2fv):
+        (WebCore::GraphicsContext3D::vertexAttrib3fv):
+        (WebCore::GraphicsContext3D::vertexAttrib4fv):
+        (WebCore::GraphicsContext3D::vertexAttribPointer):
+        (WebCore::GraphicsContext3D::viewport):
+        * src/WebGraphicsContext3D.cpp: Removed.
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Removed.
+        * src/WebGraphicsContext3DDefaultImpl.h: Removed.
+
+2010-03-19  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Add GraphicsContext3D abstraction to WebKit API
+        https://bugs.webkit.org/show_bug.cgi?id=36262
+
+        Added WebGraphicsContext3D to the WebKit API and refactored Chromium's
+        GraphicsContext3D implementation to use it. All of the OpenGL calls have
+        been moved out of WebKit/chromium/src/GraphicsContext3D.cpp and into the
+        WebGraphicsContext3D implementation. GraphicsContext3D is still
+        responsible for the transfer of rendered output from the
+        WebGraphicsContext3D to the HTMLCanvasElement.
+
+        The GraphicsContext3DInternal class, which is a data member of
+        GraphicsContext3D for the Chromium port, remains. It is possible to
+        eliminate this class and thereby one level of delegation, but this is
+        being deferred.
+
+        The needed entry point for a Chrome implementation of
+        WebGraphicsContext3D has been added to WebKitClient, but it is not being
+        called yet by GraphicsContext3D. It will be once this patch lands and
+        Chromium is rolled forward to support this entry point.
+
+        This is a large patch, but the transformation is almost entirely
+        mechanical and there is no change in functionality. Nearly all of
+        GraphicsContext3D and GraphicsContext3DInternal has been moved to
+        WebGraphicsContext3DDefaultImpl. The only area where the splitting of
+        logic is less than mechanical is GraphicsContext3D::beginPaint() and its
+        callees.
+
+        Ran all WebGL layout tests and demos from Khronos site in Chromium.
+
+        * WebKit.gyp:
+        * public/WebGraphicsContext3D.h: Added.
+        (WebKit::WebGraphicsContext3D::Attributes::Attributes):
+        (WebKit::WebGraphicsContext3D::~WebGraphicsContext3D):
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::createGraphicsContext3D):
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::initialize):
+        (WebCore::GraphicsContext3DInternal::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3DInternal::platformTexture):
+        (WebCore::GraphicsContext3DInternal::beginPaint):
+        (WebCore::GraphicsContext3DInternal::endPaint):
+        (WebCore::GraphicsContext3DInternal::reshape):
+        (WebCore::GraphicsContext3DInternal::bindAttribLocation):
+        (WebCore::GraphicsContext3DInternal::bindTexture):
+        (WebCore::GraphicsContext3DInternal::bufferData):
+        (WebCore::GraphicsContext3DInternal::bufferSubData):
+        (WebCore::GraphicsContext3DInternal::getActiveAttrib):
+        (WebCore::GraphicsContext3DInternal::getActiveUniform):
+        (WebCore::GraphicsContext3DInternal::getAttribLocation):
+        (WebCore::GraphicsContext3DInternal::getContextAttributes):
+        (WebCore::GraphicsContext3DInternal::getProgramInfoLog):
+        (WebCore::GraphicsContext3DInternal::getShaderInfoLog):
+        (WebCore::GraphicsContext3DInternal::getShaderSource):
+        (WebCore::GraphicsContext3DInternal::getString):
+        (WebCore::GraphicsContext3DInternal::getUniformLocation):
+        (WebCore::GraphicsContext3DInternal::readPixels):
+        (WebCore::GraphicsContext3DInternal::shaderSource):
+        (WebCore::GraphicsContext3DInternal::texImage2D):
+        (WebCore::GraphicsContext3DInternal::texSubImage2D):
+        (WebCore::GraphicsContext3DInternal::uniform1fv):
+        (WebCore::GraphicsContext3DInternal::uniform1iv):
+        (WebCore::GraphicsContext3DInternal::uniform2fv):
+        (WebCore::GraphicsContext3DInternal::uniform2iv):
+        (WebCore::GraphicsContext3DInternal::uniform3fv):
+        (WebCore::GraphicsContext3DInternal::uniform3iv):
+        (WebCore::GraphicsContext3DInternal::uniform4fv):
+        (WebCore::GraphicsContext3DInternal::uniform4iv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix2fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix3fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
+        (WebCore::GraphicsContext3D::platformTexture):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        * src/WebGraphicsContext3D.cpp: Added.
+        (WebKit::WebGraphicsContext3D::createDefault):
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Added.
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::create):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::~GLConnection):
+        (WebKit::WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState):
+        (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+        (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+        (WebKit::WebGraphicsContext3DDefaultImpl::makeContextCurrent):
+        (WebKit::WebGraphicsContext3DDefaultImpl::width):
+        (WebKit::WebGraphicsContext3DDefaultImpl::height):
+        (WebKit::WebGraphicsContext3DDefaultImpl::sizeInBytes):
+        (WebKit::createTextureObject):
+        (WebKit::WebGraphicsContext3DDefaultImpl::reshape):
+        (WebKit::WebGraphicsContext3DDefaultImpl::flipVertically):
+        (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::activeTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::disableVertexAttribArray):
+        (WebKit::WebGraphicsContext3DDefaultImpl::drawElements):
+        (WebKit::WebGraphicsContext3DDefaultImpl::enableVertexAttribArray):
+        (WebKit::WebGraphicsContext3DDefaultImpl::generateMipmap):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getActiveAttrib):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getActiveUniform):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getContextAttributes):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getError):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getProgramInfoLog):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getShaderInfoLog):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getShaderSource):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getString):
+        (WebKit::WebGraphicsContext3DDefaultImpl::getVertexAttribOffset):
+        (WebKit::WebGraphicsContext3DDefaultImpl::releaseShaderCompiler):
+        (WebKit::WebGraphicsContext3DDefaultImpl::shaderSource):
+        (WebKit::WebGraphicsContext3DDefaultImpl::vertexAttribPointer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createProgram):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createRenderbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::createTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteBuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteFramebuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteProgram):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteRenderbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteShader):
+        (WebKit::WebGraphicsContext3DDefaultImpl::deleteTexture):
+        (WebKit::WebGraphicsContext3DDefaultImpl::synthesizeGLError):
+        * src/WebGraphicsContext3DDefaultImpl.h: Added.
+        (WebKit::WebGraphicsContext3DDefaultImpl::):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::chooseFBConfig):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::createNewContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::createPbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::destroyPbuffer):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::makeCurrent):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::destroyContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::getCurrentContext):
+        (WebKit::WebGraphicsContext3DDefaultImpl::GLConnection::GLConnection):
+
+2010-03-19  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Unreviewed, build fix.
+
+        Rename enqueueStorageEvent to enqueueEvent to match changes in
+        http://trac.webkit.org/changeset/56249.
+
+        * src/StorageAreaProxy.cpp:
+        (WebCore::StorageAreaProxy::storageEvent): Renamed.
+
+2010-03-19  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] querying the current history item during a back/forward
+        navigation should not clobber the scroll offset, etc.
+        https://bugs.webkit.org/show_bug.cgi?id=36347
+
+        We should only allow the current history item to be modified if we are
+        no longer loading or if the load is a new navigation (i.e., not a
+        back/forward/reload variant).
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::currentHistoryItem):
+
+2010-03-18  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Adding support for the ACCELERATED_COMPOSITING render path to Chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=35557
+        Currently compositing of layers is performed via s/w compositor which relies on Skia. This is an initial check-in
+        and it's only been tested on Windows. Compiling the code requires seting "use_accelerated_compositing=1"
+        to GYP_DEFINES. The update of layer contents and compositing is fairly inefficient but this will be fixed in
+        subsequent check-ins.
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::attachRootGraphicsLayer):
+        (WebKit::ChromeClientImpl::scheduleCompositingLayerSync):
+        * src/ChromeClientImpl.h:
+        (WebKit::ChromeClientImpl::setNeedsOneShotDrawingSynchronization):
+         Added methods required by the RenderLayerCompositor
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::paintWithContext):
+        (WebKit::WebFrameImpl::paint):
+        * src/WebFrameImpl.h:
+        Split WebFrameImpl::paint() into two methods to make it possible to call the paint
+        routine with an existing GraphicsContext, which is necessary for painting the root layer into
+        its own backing surface.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::paint):
+        Modified method to handle the accelerated compositing path. Now, when doing accelerated compositing,
+        paint() results in repainting the contents of the root layer and then doing a composite operation.
+        (WebKit::WebViewImpl::setRootGraphicsLayer):
+        (WebKit::WebViewImpl::setAcceleratedCompositing):
+        (WebKit::WebViewImpl::updateRootLayerContents):
+        (WebKit::WebViewImpl::setRootLayerNeedsDisplay):
+        * src/WebViewImpl.h:
+        (WebKit::WebViewImpl::isAcceleratedCompositing):
+
+2010-03-18  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Chromium interface change to support Blob.slice.
+        https://bugs.webkit.org/show_bug.cgi?id=35318
+
+        * features.gypi:
+        * public/WebHTTPBody.h:
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::getFileModificationTime):
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::getFileModificationTime):
+        * src/WebHTTPBody.cpp:
+        (WebKit::WebHTTPBody::elementAt):
+        (WebKit::WebHTTPBody::appendFile):
+        (WebKit::WebHTTPBody::appendFileRange):
+
+2010-03-12  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by David Levin.
+
+        smartdelete should only occur after double-click
+        https://bugs.webkit.org/show_bug.cgi?id=35314
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::selectWordAroundPosition):
+
+2010-03-18  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed, build fix.
+
+        Left a parentheses unclosed somehow.
+
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::jsShowContextMenu):
+
+2010-03-18  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+        
+        Remove all references to V8Index.h and V8ClassIndex.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=33477
+
+        * src/WebBindings.cpp:
+        (WebKit::getRangeImpl):
+        * src/WebDevToolsAgentImpl.cpp:
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::jsShowContextMenu):
+
+2010-03-17  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        PlatformTouchEventBuilder should not be resizing the touch point
+        array before appending touch points to it.
+        https://bugs.webkit.org/show_bug.cgi?id=36231
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
+
+2010-03-17  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Roll Chromium builder's DEPS to current revs.
+        https://bugs.webkit.org/show_bug.cgi?id=36241
+
+        * DEPS:
+
+2010-03-17  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Revert WebGL context attributes changes 33416 / r56074 and 36200 / r56093
+        https://bugs.webkit.org/show_bug.cgi?id=36233
+
+        The patch for bug 33416, which added multisampling support to the
+        WebGL back buffer, uncovered some OpenGL driver bugs on the build
+        bots which need further investigation to determine the appropriate
+        workaround. Reverting this change, the minor build fix in 36189,
+        and the skipping of the affected tests in bug 36200.
+
+        Built and tested WebKit and Chromium and ran all WebGL layout
+        tests in both.
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal):
+        (WebCore::GraphicsContext3DInternal::reshape):
+        (WebCore::GraphicsContext3DInternal::beginPaint):
+        (WebCore::GraphicsContext3DInternal::bindFramebuffer):
+        (WebCore::GraphicsContext3D::readPixels):
+
+2010-03-16  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] Size the WebVector of forms after determining how many
+        forms are valid and will be returned.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36204
+
+        No new tests, as this is only triggered by Chromium's use of the
+        WebFormElement API.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::forms):
+
+2010-03-16  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Build breakage from 33416
+        https://bugs.webkit.org/show_bug.cgi?id=36189
+
+        No new tests. Built release Chromium.
+
+        * src/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3DInternal::reshape):
+
+2010-03-16  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Hook up WebGLContextAttributes to OpenGL context creation code
+        https://bugs.webkit.org/show_bug.cgi?id=33416
+
+        Test: fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
+
+        * src/GraphicsContext3D.cpp: Hook up WebGLContextAttributes to OpenGL context creation code for Windows.
+
+2010-03-16  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed.
+
+        Fix Chromium Mac build: remove unused code.
+
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::createInspectorFrontendProxy):
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * src/InspectorClientImpl.cpp:
+        (WebKit::InspectorClientImpl::openInspectorFrontend):
+        * src/InspectorClientImpl.h:
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::attach):
+        (WebKit::WebDevToolsAgentImpl::didCommitProvisionalLoad):
+        (WebKit::WebDevToolsAgentImpl::createInspectorFrontendProxy):
+        (WebKit::WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController):
+        * src/WebDevToolsAgentImpl.h:
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::jsBringToFront):
+        (WebKit::WebDevToolsFrontendImpl::jsInspectedURLChanged):
+        * src/WebDevToolsFrontendImpl.h:
+        * src/js/InjectDispatch.js:
+        (close):
+
+2010-03-16  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: chromium tests fix.
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-03-16  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: migrate to native styles inspector in order to inspect styles from foreighn domains.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36117
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-03-15  John Gregg  <johnnyg@google.com>
+
+        Reviewed by David Levin.
+
+        Notification object should expose absolute URL of icon
+        https://bugs.webkit.org/show_bug.cgi?id=35800
+
+        * public/WebNotification.h:
+        * src/WebNotification.cpp:
+        (WebKit::WebNotification::iconURL):
+
+2010-03-15  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36152
+        [chromium] Add support for history.pushState and history.replaceState
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::didNavigateWithinPage): Move implementation of
+        didChangeLocationWithinPage to here.  Only add to the redirect chain if
+        we are performing a simple hash change (i.e., no state object on the
+        history item).  Call the old didChangeLocationWithinPage for backwards
+        compat with Chromium.  This will be removed in a subsequent patch.
+
+        (WebKit::WebFrameClient::didChangeLocationWithinPage):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDidNavigateWithinPage):
+        (WebKit::FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage):
+        Call the new version of didChangeLocationWithinPage without the
+        parameter to indicate whether this is a new navigation or not.  We only
+        need this method on WebFrameClient to support TestShell / DRT.
+
+        (WebKit::FrameLoaderClientImpl::dispatchDidPushStateWithinPage):
+        Call dispatchDidNavigateWithinPage since pushState is just a type of
+        in-page navigation.  This is an in-page navigation that adds another
+        entry to session history.
+
+        (WebKit::FrameLoaderClientImpl::dispatchDidReplaceStateWithinPage):
+        Call dispatchDidNavigateWithinPage since replaceState is just a type of
+        in-page navigation.   This is an in-page navigation that replaces the
+        current session history entry.
+
+        (WebKit::FrameLoaderClientImpl::dispatchDidPopStateWithinPage): Do
+        nothing since dispatchDidNavigateWithinPage is called in this case by
+        the FrameLoader.
+
+        (WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForNavigationAction):
+        (WebKit::FrameLoaderClientImpl::shouldGoToHistoryItem): Move the code
+        for handling the dummy chrome-back-forward://go/ URLs from
+        dispatchDecidePolicyForNavigationAction to shouldGoToHistoryItem, which
+        prevents the URLs from leaking into session history.
+        shouldGoToHistoryItem is called before any work is done by history
+        traversal, so this is a better place for this hack.  Ultimately, this
+        code should be eliminatd in favor of better integration with
+        FrameLoader or HistoryController.
+
+        * src/FrameLoaderClientImpl.h:
+
+2010-03-15  Darin Fisher  <darin@chromium.org>
+
+        Fix build bustage.  We also need to pull down "third_party/tcmalloc"
+
+        * DEPS:
+
+2010-03-15  Darin Fisher  <darin@chromium.org>
+
+        Fix build bustage.  We also need to pull down "gfx"
+
+        * DEPS:
+
+2010-03-15  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36131
+        Update include paths for chromium Rect, Point, and Size types.
+
+        Update DEPS to pull latest chromium code that reflects the
+        new location of these headers.
+
+        * DEPS:
+        * public/WebPoint.h:
+        * public/WebRect.h:
+        * public/WebSize.h:
+
+2010-03-15  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Send the frame URL on GeolocationServiceBridgeImpl::startUpdating.
+        https://bugs.webkit.org/show_bug.cgi?id=36012
+
+        * public/GeolocationServiceBridgeChromium.h:
+        * src/GeolocationServiceBridgeChromium.cpp:
+        (WebKit::GeolocationServiceBridgeImpl::startUpdating):
+
+2010-03-15  Patrik Persson  <patrik.j.persson@ericsson.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32369
+
+        Revise iframe sandbox behavior to match the updated HTML5 spec.
+
+        - Enables window.sessionStorage in sandboxed iframes.
+
+        - Raises SECURITY_ERR exceptions when window.localStorage or
+          window.openDatabase() is blocked by iframe sandboxing.
+
+          Note: window.sessionStorage does not raise exceptions.
+
+        WebKit would previously return null references in these cases.  The
+        new behavior is in accordance with HTML5:
+
+          http://dev.w3.org/html5/webstorage/   (sections 4.2 and 4.3)
+          http://dev.w3.org/html5/webdatabase/  (section 4.1)
+          http://www.mail-archive.com/whatwg@lists.whatwg.org/msg19786.html
+
+        * src/StorageAreaProxy.cpp:
+        (WebCore::StorageAreaProxy::storageEvent): exception handling
+        * src/StorageEventDispatcherImpl.cpp:
+        (WebCore::StorageEventDispatcherImpl::dispatchStorageEvent): exception handling
+
+2010-03-15  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        option-pageup/down should move cursor on chromium mac
+        https://bugs.webkit.org/show_bug.cgi?id=36108
+
+        * src/EditorClientImpl.cpp:
+        (WebKit::):
+
+2010-03-13  Eric Roman  <eroman@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add a firstPartyForCookies() property to WebDocument.
+        https://bugs.webkit.org/show_bug.cgi?id=35592
+
+        * public/WebDocument.h:
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::firstPartyForCookies):
+
+2010-03-12  Garret Kelly  <gdk@chromium.org>
+
+        Unreiviewed.
+
+        Fix Chromium Mac build. Last patch did not apply properly.
+        (Garret assures me this patch will actually work.)
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchEventType):
+        (WebKit::toPlatformTouchPointState):
+
+2010-03-12  Garret Kelly  <gdk@chromium.org>
+
+        Unreviewed.
+
+        Fix Chromium Mac build. This time, with actual fixing goodness.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchEventType):
+        (WebKit::toPlatformTouchPointState):
+
+2010-03-12  Garret Kelly  <gdk@chromium.org>
+
+        Unreviewed.
+
+        Fix Chromium Mac build.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchEventType):
+        (WebKit::toPlatformTouchPointState):
+
+2010-03-12  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Enable touch events in Chromium features gypi file.
+        https://bugs.webkit.org/show_bug.cgi?id=35994
+
+        * features.gypi:
+
+2010-03-12  Darin Fisher  <darin@chromium.org>
+
+        Fix Chromium build bustage.
+
+        Wrap usage of WebPrivatePtr from WebNode.h in a #if
+        WEBKIT_IMPLEMENTATION guard.
+
+        * public/WebNode.h:
+
+2010-03-12  Nicolas Weber  <thakis@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] Cmd-clicking submit buttons should submit in new tab 
+        https://bugs.webkit.org/show_bug.cgi?id=36023
+
+        Take modifiers into account when clicking form buttons. E.g.
+        cmd-clicking a submit button will submit in a new background tab,
+        cmd-shift-clicking in a new foreground tab, shift-clicking in a new
+        window. (On windows/linux, it's ctrl instead of cmd.)
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::actionSpecifiesNavigationPolicy):
+
+2010-03-12  Kavita Kanetkar  <kkanetkar@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Fix memory leak in WebImageDecoder API
+        https://bugs.webkit.org/show_bug.cgi?id=35946
+
+        * src/WebImageDecoder.cpp:
+        (WebKit::WebImageDecoder::setData):
+        (WebKit::WebImageDecoder::getFrameAtIndex):
+
+2010-03-11  Aaron Boodman  <aa@chromium.org>
+
+        Kill WebDocument::applicationID() (part 1).
+
+        Modify interface to WebCore::NotificationPresenter::checkPermission()
+        and remove implementation of WebDocument::applicationID(). Breaking
+        API changes will be in a subsequent change.
+        https://bugs.webkit.org/show_bug.cgi?id=35846
+
+        * public/WebNotificationPresenter.h:
+        * src/NotificationPresenterImpl.cpp:
+        (WebKit::NotificationPresenterImpl::checkPermission):
+        * src/NotificationPresenterImpl.h:
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::applicationID):
+
+2010-03-11  Stuart Morgan  <stuartmorgan@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Fix the screen coordinate conversion of Chromium Mac mouse events for
+        multiple-moniter setups. Also changes the global coordinate values
+        to be computed from the event, rather than the instantaneous mouse
+        location, and reduces code duplication for location conversion.
+
+        Dual-sided patch with http://codereview.chromium.org/751002
+
+        https://bugs.webkit.org/show_bug.cgi?id=35950
+
+        * src/mac/WebInputEventFactory.mm:
+        (WebKit::setWebEventLocationFromEventInView):
+        (WebKit::WebInputEventFactory::mouseEvent):
+        (WebKit::WebInputEventFactory::mouseWheelEvent):
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * src/ChromeClientImpl.cpp:
+        * src/ChromeClientImpl.h:
+
+2010-03-10  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Use WebPrivatePtr for WebNode
+        https://bugs.webkit.org/show_bug.cgi?id=36005
+
+        * public/WebElement.h:
+        * public/WebFormElement.h:
+        * public/WebInputElement.h:
+        * public/WebLabelElement.h:
+        * public/WebNode.h:
+        (WebKit::WebNode::WebNode):
+        (WebKit::WebNode::isNull):
+        (WebKit::WebNode::unwrap):
+        (WebKit::WebNode::constUnwrap):
+        * public/WebPrivatePtr.h:
+        (WebKit::WebPrivatePtr::assign):
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::WebDocument):
+        (WebKit::WebDocument::operator=):
+        (WebKit::WebDocument::operator PassRefPtr<Document>):
+        * src/WebElement.cpp:
+        (WebKit::WebElement::hasTagName):
+        (WebKit::WebElement::WebElement):
+        (WebKit::WebElement::operator=):
+        (WebKit::WebElement::operator PassRefPtr<Element>):
+        * src/WebFormElement.cpp:
+        (WebKit::WebFormElement::WebFormElement):
+        (WebKit::WebFormElement::operator=):
+        (WebKit::WebFormElement::operator PassRefPtr<HTMLFormElement>):
+        * src/WebInputElement.cpp:
+        (WebKit::WebInputElement::WebInputElement):
+        (WebKit::WebInputElement::operator=):
+        (WebKit::WebInputElement::operator PassRefPtr<HTMLInputElement>):
+        * src/WebLabelElement.cpp:
+        (WebKit::WebLabelElement::correspondingControl):
+        (WebKit::WebLabelElement::operator=):
+        (WebKit::WebLabelElement::operator PassRefPtr<HTMLLabelElement>):
+        * src/WebNode.cpp:
+        (WebKit::WebNode::reset):
+        (WebKit::WebNode::assign):
+        (WebKit::WebNode::equals):
+        (WebKit::WebNode::parentNode):
+        (WebKit::WebNode::createMarkup):
+        (WebKit::WebNode::addEventListener):
+        (WebKit::WebNode::removeEventListener):
+        (WebKit::WebNode::simulateClick):
+        (WebKit::WebNode::WebNode):
+        (WebKit::WebNode::operator=):
+        (WebKit::WebNode::operator PassRefPtr<Node>):
+
+2010-03-10  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Add API wrapper for WebCore::SerializedScriptValue
+        https://bugs.webkit.org/show_bug.cgi?id=35988
+
+        WebSerializedScriptValue is a wrapper around SerializedScriptValue.
+
+        WebPrivatePtr is used to simplify wrapping reference counted WebCore
+        types.  This class is used to cleanup WebHistoryItem, and will be used
+        to clean up other classes in the WebKit API in a follow-up patch.
+
+        * WebKit.gyp:
+        * public/WebHistoryItem.h:
+        * public/WebPrivatePtr.h: Added.
+        * public/WebSerializedScriptValue.h: Added.
+        * src/WebHistoryItem.cpp:
+        * src/WebSerializedScriptValue.cpp: Added.
+
+2010-03-10  Sanjeev Radhakrishnan  <sanjeevr@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Allow a plugin to participate in the browser's print workflow.
+        https://bugs.webkit.org/show_bug.cgi?id=35550
+
+        * public/WebFrame.h:
+        * public/WebPlugin.h:
+        * src/WebFrameImpl.cpp:
+        * src/WebFrameImpl.h:
+        * src/WebPluginContainerImpl.cpp:
+        * src/WebPluginContainerImpl.h:
+
+2010-03-10  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        [chromium]: Fix regression in mouse capture on Mac/Linux
+        https://bugs.webkit.org/show_bug.cgi?id=35987
+
+        * src/WebViewImpl.cpp:
+
+2010-03-10  Evan Stade  <estade@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] add functionality to activate the focused node in a WebView
+        https://bugs.webkit.org/show_bug.cgi?id=35407
+
+        * public/WebDocument.h:
+        * public/WebNode.h:
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::focusedNode): Added
+        * src/WebNode.cpp:
+        (WebKit::WebNode::simulateClick): Added
+
+2010-03-10  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35952
+        Propagate mouse wheel events to Pepper plugins.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
+        * src/WebInputEventConversion.h:
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::handleEvent):
+        (WebKit::WebPluginContainerImpl::handleMouseEvent):
+        (WebKit::WebPluginContainerImpl::handleWheelEvent):
+        (WebKit::WebPluginContainerImpl::handleKeyboardEvent):
+        * src/WebPluginContainerImpl.h:
+
+2010-03-10  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add support for converting WebTouchEvents to PlatformTouchEvents and
+        routing them into the EventHandler for the frame in which they
+        originate.
+        https://bugs.webkit.org/show_bug.cgi?id=35874
+
+        * src/ChromeClientImpl.h:
+        (WebKit::ChromeClientImpl::needTouchEvents):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::touchEvent): Handle incoming WebTouchEvents,
+        converting them to PlatformTouchEvents and sending them to the
+        EventHandler.
+        (WebKit::WebViewImpl::handleInputEvent): Now routes WebTouchEvents to
+        the touchEvent handler.
+        * src/WebViewImpl.h:
+
+2010-03-10  Nate Chapin  <japhet@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Wrap and unwrap v8 objects with WrapperTypeInfo instead of V8ClassIndex::V8WrapperType.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35941
+
+        * src/WebBindings.cpp:
+        (WebKit::getRangeImpl):
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::createInspectorBackendV8Wrapper):
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::jsShowContextMenu):
+
+2010-03-10  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Fixing build warning caused by using 0 instead of NULL as the sentiel
+        in a varargs call.
+        https://bugs.webkit.org/show_bug.cgi?id=35898
+
+        * src/gtk/WebInputEventFactory.cpp:
+
+2010-03-10  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add IndexedDatabase class and hook it up.
+        https://bugs.webkit.org/show_bug.cgi?id=35927
+
+        This change is mostly just adding the plumbing necessary for
+        the IndexedDatabaseRequest and IndexedDatabaseSync (not written
+        yet).
+
+        * WebKit.gyp:
+        * public/WebIndexedDatabase.h: Added.
+        (WebKit::WebIndexedDatabase::~WebIndexedDatabase):
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::getIndexedDatabase):
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::getIndexedDatabase):
+        * src/IndexedDatabaseProxy.cpp: Added.
+        (WebCore::IndexedDatabaseProxy::create):
+        (WebCore::IndexedDatabaseProxy::IndexedDatabaseProxy):
+        (WebCore::IndexedDatabaseProxy::~IndexedDatabaseProxy):
+        (WebCore::IndexedDatabaseProxy::open):
+        * src/IndexedDatabaseProxy.h: Added.
+
+2010-03-10  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: display list of active workers & support debugging
+        with fake workers
+        https://bugs.webkit.org/show_bug.cgi?id=35568
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+
+2010-03-10  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35956
+        Create a grd file upstream for resources that chromium uses
+        that are pulled directly from the upstream repository.
+
+        * WebKit.grd: Added.
+
+2010-03-10  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Reviewed by David Levin.
+
+        Bug 28293 -  [Chromium] event.datatransfer.getdata("text/uri-list") is treated the same as getdata("URL")
+        https://bugs.webkit.org/show_bug.cgi?id=28293
+        
+        Change ChromiumDataObject such that it treats types "URL" and "text/uri-list"
+        correctly for event.dataTransfer.getData/setData. Currently both are treated
+        as synonyms, but for "URL", getData is supposed to only return the first valid URL
+        contained within the data for "text/uri-list" (see HTML5 spec).
+
+        Tests: editing/pasteboard/dataTransfer-setData-getData.html
+
+        * src/WebDragData.cpp:
+        (WebKit::WebDragData::url):
+        (WebKit::WebDragData::setURL):
+
+2010-03-08  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Need to send mouse events to plugin when it has mouse capture
+        https://bugs.webkit.org/show_bug.cgi?id=35900
+
+        * public/WebInputEvent.h:
+        (WebKit::WebInputEvent::isMouseEventType):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::mouseDown):
+        (WebKit::WebViewImpl::mouseUp):
+        (WebKit::WebViewImpl::handleInputEvent):
+        * src/WebViewImpl.h:
+
+2010-03-09  Anton Muhin  <antonm@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Accept and bailout NULL widgets in ChromiumBridge
+        https://bugs.webkit.org/show_bug.cgi?id=35796
+
+        * src/ChromiumBridge.cpp:
+        (WebCore::toChromeClientImpl):
+
+2010-03-09  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Use clean global object for devtools utility context instead of
+        trying to simulate inspected context. 
+    
+        https://bugs.webkit.org/show_bug.cgi?id=35923
+
+        * src/DebuggerAgentImpl.cpp:
+        * src/DebuggerAgentImpl.h:
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::resetInspectorFrontendProxy):
+
+2010-03-08  Alexey Proskuryakov  <ap@apple.com>
+
+        Chromium build fix.
+
+        Updated for the removal of "mightDownloadFromHandle".
+
+        * src/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::ResourceHandle):
+        (WebCore::ResourceHandle::create):
+
+2010-03-08  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Reset multiple form submission protection on mouse events.
+        https://bugs.webkit.org/show_bug.cgi?id=35128
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::mouseDown):
+
+2010-03-08  Michael Nordman  <michaeln@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Quick fix for a chromium unit test failures around r55675 (repaint refactoring).
+        This change restores the tests for empty rects that were deleted.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35878
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::invalidateContentsAndWindow):
+        * src/WebPopupMenuImpl.cpp:
+        (WebKit::WebPopupMenuImpl::invalidateContentsAndWindow):
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the chromium port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::invalidateContents):
+        (WebKit::ChromeClientImpl::invalidateWindow):
+        (WebKit::ChromeClientImpl::invalidateContentsAndWindow):
+        (WebKit::ChromeClient::invalidateContentsForSlowScroll):
+        * src/ChromeClientImpl.h:
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+
+        Add ENABLE_BLOB_SLICE feature define.
+
+        * features.gypi:
+
+2010-03-08  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove the now-redundant Settings fields for the Database
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        No new tests; this code isn't called.
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        * src/WebSettingsImpl.h:
+
+2010-03-08  Jeremy Orlow  <jorlow@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Pass the WebFrame into WebStorageArea::setItem so we can figure out the routing ID
+        https://bugs.webkit.org/show_bug.cgi?id=35758
+
+        This is necessary since setItem is sometimes blocked and the embedder might need
+        to display some piece of UI associated with such an event.
+
+        * public/WebStorageArea.h:
+        (WebKit::WebStorageArea::setItem):
+        * src/StorageAreaProxy.cpp:
+        (WebCore::StorageAreaProxy::setItem):
+        * src/WebStorageAreaImpl.cpp:
+        (WebKit::WebStorageAreaImpl::setItem):
+        * src/WebStorageAreaImpl.h:
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Chromium build fix.
+
+        * src/ChromiumBridge.cpp: Include SharedBuffer.h since WebCore::SharedBuffer is being used.
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Chromium build fix.
+
+        * src/ResourceHandle.cpp: Include SharedBuffer.h since WebCore::SharedBuffer is being used.
+
+2010-03-06  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Chromium: Restore devtools window activate upon node search complete.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35832
+
+        * src/js/DevTools.js:
+
+2010-03-06  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] Embedder initiated loads should not always stop existing loads
+        https://bugs.webkit.org/show_bug.cgi?id=33862
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::reload):
+        (WebKit::WebFrameImpl::loadRequest):
+        (WebKit::WebFrameImpl::loadHistoryItem):
+        (WebKit::WebFrameImpl::loadData):
+
+2010-03-06  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] spurious WebViewClient::didStopLoading if changing
+        location.hash while a subframe is still loading
+
+        https://bugs.webkit.org/show_bug.cgi?id=33884
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage):
+        Call isLoadingInAPISense, which checks subframes.
+
+2010-03-06  Hironori Bono  <hbono@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Typing into Flash with wmode = opaque|transparent and
+        non-latin language active outputs as if US keyboard layout active
+
+        https://bugs.webkit.org/show_bug.cgi?id=34936
+
+        This change is a WebKit-side change for this issue. It dispatches
+        Char events to plug-ins so plug-ins can receive non-ASCII characters
+        as well as ASCII characters.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::keyEvent):
+
+2010-03-06  Kavita Kanetkar  <kkanetkar@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Create WebKit API for  WebCore::ImageDecoder
+        https://bugs.webkit.org/show_bug.cgi?id=35415
+
+        * WebKit.gyp:
+        * public/WebImageDecoder.h: Added.
+        * src/WebImageDecoder.cpp: Added.
+
+2010-03-05  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Take out code hack that flips the result of NPP_HandleEvent.  This needs to move to
+        the NPAPI code so that Pepper plugins don't hit it.
+        https://bugs.webkit.org/show_bug.cgi?id=35779
+
+        * public/WebPluginContainer.h:
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::handleMouseEvent):
+        (WebKit::WebPluginContainerImpl::handleKeyboardEvent):
+
+2010-03-05  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Do not show link helper in popovers and/or for external resources.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35785
+
+        * src/js/DebuggerAgent.js:
+        (devtools.DebuggerAgent.prototype.initUI):
+        (devtools.DebuggerAgent.prototype.addScriptInfo_):
+
+2010-03-04  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Adding PlatformTouchEventBuilder and PlatformTouchPointBuilder for
+        converting Chromium WebTouchEvent and WebTouchPoint types to
+        corresponding WebCore types.
+        https://bugs.webkit.org/show_bug.cgi?id=35760
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::toPlatformTouchEventType):
+        (WebKit::toPlatformTouchPointState):
+        (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
+        (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
+        * src/WebInputEventConversion.h:
+
+2010-03-04  John Gregg  <johnnyg@google.com>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] WebDocument:applicationID() crashes on <meta> tag with no http-equiv attribute
+        https://bugs.webkit.org/show_bug.cgi?id=35771
+
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::applicationID):
+        check for presence of http-equiv attribute before lower()ing it.
+
+2010-03-04  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        [chromium] make history.{push,replace}State enabled at runtime
+        https://bugs.webkit.org/show_bug.cgi?id=35753
+
+        * public/WebRuntimeFeatures.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enablePushState):
+        (WebKit::WebRuntimeFeatures::isPushStateEnabled):
+
+2010-03-04  Pavel Feldman  <pfeldman@chromium.org>
+
+        Not reviewed: chromium tests fix.
+
+        * src/js/Tests.js:
+
+2010-03-03  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Remove two last synchronous calls from front-end to InspectorBackend.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35720
+
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+        (devtools.InspectorBackendImpl.prototype.setPauseOnExceptionsState):
+
+2010-03-03  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Remove sync access to resourceTrackingEnabled.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35693
+
+        * src/js/DevTools.js:
+
+2010-03-04  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Fix failing DevToolsSanityTest.TestResourceContentLength
+        https://bugs.webkit.org/show_bug.cgi?id=35725
+
+        http://trac.webkit.org/changeset/55466 missed one more spot
+        where contentLength needed to be renamed resourceSize.
+
+        * src/js/Tests.js:
+
+2010-03-03  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Adding touch event type and point type. Tested against the try bots.
+        https://bugs.webkit.org/show_bug.cgi?id=35691
+
+        * public/WebInputEvent.h:
+        (WebKit::WebInputEvent::):
+        (WebKit::WebInputEvent::isTouchEventType):
+        (WebKit::WebTouchEvent::WebTouchEvent):
+        * public/WebTouchPoint.h: Added.
+        (WebKit::WebTouchPoint::WebTouchPoint):
+        (WebKit::WebTouchPoint::):
+
+2010-03-02  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        add a flag to WebURLResponse so we can identify multipart content
+        https://bugs.webkit.org/show_bug.cgi?id=35628
+
+        * public/WebURLResponse.h:
+        * src/WebURLResponse.cpp:
+        (WebKit::WebURLResponse::isMultipartPayload):
+        (WebKit::WebURLResponse::setIsMultipartPayload):
+
+2010-03-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Google Analytics triggers "blocked plugin" UI
+        https://bugs.webkit.org/show_bug.cgi?id=35565
+
+        Plumb didNotAllowPlugins to the client.
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::didNotAllowPlugins):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::didNotAllowPlugins):
+        * src/FrameLoaderClientImpl.h:
+
+2010-03-02  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        aria-label isn't respected on option elements
+        https://bugs.webkit.org/show_bug.cgi?id=35400
+
+        * src/SuggestionsPopupMenuClient.h:
+        (WebKit::SuggestionsPopupMenuClient::itemAccessibilityText):
+
+2010-03-02  Mads Ager  <ager@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [V8] V8 should be notified of context disposals
+        https://bugs.webkit.org/show_bug.cgi?id=35526
+
+        Update V8 DEPS in order to get V8 API changes needed for context
+        disposal notifications.
+
+        * DEPS:
+
+2010-03-02  Kenneth Russell  <kbr@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Add EnabledAtRuntime attribute to WebGLArray constructors
+        https://bugs.webkit.org/show_bug.cgi?id=35558
+
+        * public/WebRuntimeFeatures.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableWebGL):
+        (WebKit::WebRuntimeFeatures::isWebGLEnabled):
+
+2010-03-02  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Implement WebNode::equals and add inline operators for ==
+        and !=.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35543
+
+        * public/WebNode.h:
+        (WebKit::operator==):
+        (WebKit::operator!=):
+        * src/WebNode.cpp:
+        (WebKit::WebNode::equals):
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setZoomLevel):
+
+2010-03-01  Thatcher Ulrich  <tulrich@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Fix chromium iframe shims.  Add another test case to the
+        iframes-shims test.  After r53637, the plugin widget doesn't get
+        moved every paint.  This used to hide the bug that if an iframe
+        gets added, the plugin's cutout rectangles don't get updated until
+        a layout happens.
+        https://bugs.webkit.org/show_bug.cgi?id=35184
+
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::widgetPositionsUpdated): do reportGeometry() to ensure that
+            the plugin is aware of the positions of cutouts on the page (for iframe shim behavior).
+        * src/WebPluginContainerImpl.h:
+
+2010-02-27  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Chromium: remove DevTools part that has been upstreamed.
+
+        * src/js/DevTools.js:
+
+2010-02-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: reload inspected page on Cmd+R / Ctrl+R / F5 key event in inspector.
+
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+        (WebKit::WebDevToolsFrontendImpl::jsCanAttachWindow):
+        * src/WebDevToolsFrontendImpl.h:
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl):
+        (devtools.InspectorBackendImpl.prototype.toggleNodeSearch):
+
+2010-02-26  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Verify that the Nodes being enumerated are HTML elements.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35463
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::forms):
+
+2010-02-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        Expose an API for ports to add schemes to the mixed content whitelist
+        https://bugs.webkit.org/show_bug.cgi?id=35438
+
+        Expose registerURLSchemeAsSecure via the WebKit API.
+
+        * public/WebSecurityPolicy.h:
+        * src/WebSecurityPolicy.cpp:
+        (WebKit::WebSecurityPolicy::registerURLSchemeAsSecure):
+
+2010-02-26  Brett Wilson  <brettw@chromium.org>
+
+        Fix chromium build. This test's expectation became obsolete with
+        recent changes to KURL which my previous change brings Chromium's
+        port in compliance with.
+
+        * tests/KURLTest.cpp:
+        (ComponentCase::TEST):
+
+2010-02-26  Yaar Schnitman  <yaar@chromium.org>
+
+        Chromium build fix.
+
+        * features.gypi: Added missing new variable enable_svg.
+
+2010-02-26  Yaar Schnitman  <yaar@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Auto-generate and split DerivedSourcesAllInOne.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=33048
+
+        * DEPS: Incremented gyp revision.
+
+2010-02-26  Darin Fisher  <darin@chromium.org>
+
+        Fix mac warning (that gets treated as an error in the chromium build).
+
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::cookiesEnabled):
+
+2010-02-25  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove deprecated cookie methods.
+        https://bugs.webkit.org/show_bug.cgi?id=35420
+
+        * public/WebFrameClient.h:
+        * public/WebKitClient.h:
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::setCookies):
+        (WebCore::ChromiumBridge::cookies):
+        (WebCore::ChromiumBridge::cookieRequestHeaderFieldValue):
+        (WebCore::ChromiumBridge::rawCookies):
+        (WebCore::ChromiumBridge::deleteCookie):
+        (WebCore::ChromiumBridge::cookiesEnabled):
+
+2010-02-25  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Implement WebLabelElement.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35317
+
+        * WebKit.gyp:
+        * public/WebLabelElement.h: Added.
+        * src/WebLabelElement.cpp: Added.
+
+2010-02-25  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Web Inspector: make script lines count calculation lazy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35392
+
+        * src/js/Tests.js:
+        (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.waitUntilScriptIsParsed):
+        (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.checkScriptsPanel):
+        (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh):
+        (.TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch.checkScriptsPanel):
+        (.TestSuite.prototype.testAutoContinueOnSyntaxError.checkScriptsList):
+        (.TestSuite.prototype._executeFunctionForStepTest):
+
+2010-02-24  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add a missing WebString.h include.
+        https://bugs.webkit.org/show_bug.cgi?id=35360
+
+        This is required since some of the methods have implementations that
+        return a WebString.
+
+        * public/WebCookieJar.h:
+
+2010-02-24  Jay Campan  <jcampan@google.com>
+
+        Reviewed by David Levin.
+
+        Don't show the autofill popup when the input text is disabled or read only.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35129
+
+        * src/EditorClientImpl.cpp:
+        (WebKit::EditorClientImpl::autofill):
+
+2010-02-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium API] Disambiguate allowJavaScript from didNotAllowScript
+        https://bugs.webkit.org/show_bug.cgi?id=35205
+
+        Plumb didNotAllowScript through Chromium's WebKit API.
+
+        * public/WebFrameClient.h:
+        (WebKit::WebFrameClient::didNotAllowScript):
+        * src/DebuggerAgentImpl.cpp:
+        (WebKit::DebuggerAgentImpl::createUtilityContext):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::didNotAllowScript):
+        * src/FrameLoaderClientImpl.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::bindToWindowObject):
+
+2010-02-23  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Implement WebDocument::getElementsByTagName.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35272
+
+        * public/WebDocument.h:
+        * src/WebDocument.cpp:
+        (WebKit::WebDocument::getElementsByTagName):
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Removes redundant Settings::setGeolocationEnabled and Settings::geolocationEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=35242
+
+        This removes Chromium's WebSettings::setGeolocationEnabled
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        * src/WebSettingsImpl.h:
+
+2010-02-23  Dmitriy Belenko  <dbelenko@google.com>
+
+        Reviewed by Darin Fisher.
+
+        Chromium: Need to be able to get the bounds of selection
+        rectangle(s)
+        https://bugs.webkit.org/show_bug.cgi?id=34915
+
+        This change will enable about 30 test cases to pass in Chromium.
+        All of these test cases are related to selection rect boundaries.
+        This change will enable the test cases to retrieve the selection
+        rect boundary rectangle for the current selection.
+
+        * public/WebFrame.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::selectionBoundsRect):
+        * src/WebFrameImpl.h:
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * src/ChromeClientImpl.h:
+        (WebKit::ChromeClientImpl::cancelGeolocationPermissionRequestForFrame):
+
+2009-02-22  Adam Langley  <agl@google.com>
+
+        Reviewed by Darin Fisher.
+
+        fontconfig on Linux can change the render preferences on a per strike
+        basis (a strike a combination of face and size). Because of this, we
+        need to query fontconfig each time a new FontPlatformData is created
+        for a new size.
+
+        This patch adds support for querying this via ChromiumBridge.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33065
+
+        * WebKit.gyp:
+        * public/gtk/WebFontInfo.h:
+        * public/linux/WebSandboxSupport.h:
+        * src/ChromiumBridge.cpp:
+        (WebCore::ChromiumBridge::getRenderStyleForStrike):
+        * src/gtk/WebFontInfo.cpp:
+        (WebKit::WebFontInfo::renderStyleForStrike):
+
+2010-02-22  Alexander Pavlov  <apavlov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: there should be a way to "deactivate" or "skip" all breakpoints while debugging.
+        https://bugs.webkit.org/show_bug.cgi?id=33217
+
+        * src/js/DebuggerAgent.js:
+        (devtools.DebuggerAgent):
+        (devtools.DebuggerAgent.prototype.setBreakpointsActivated):
+        (devtools.DebuggerAgent.prototype.handleBreakEvent_):
+        (devtools.DebuggerAgent.prototype.handleExceptionEvent_):
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl.prototype.activateBreakpoints):
+        (devtools.InspectorBackendImpl.prototype.deactivateBreakpoints):
+
+2010-02-21  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Chromium DevTools: kepp debugger API in sync with inspector.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28799
+
+        * src/js/DebuggerAgent.js:
+        * src/js/InspectorControllerImpl.js:
+        (devtools.InspectorBackendImpl.prototype.setBreakpoint):
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        * features.gypi:
+
+2010-02-19  James Hawkins  <jhawkins@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Call WebViewClient::didAcceptAutoFillSuggestion when the
+        user selects a suggestion from the AutoFill suggestions popup.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35174
+
+        * public/WebViewClient.h:
+        (WebKit::WebViewClient::didAcceptAutoFillSuggestion):
+        * src/AutoFillPopupMenuClient.cpp:
+        (WebKit::AutoFillPopupMenuClient::valueChanged):
+        * src/AutoFillPopupMenuClient.h:
+
 2010-02-19  James Hawkins  <jhawkins@chromium.org>
 
         Reviewed by Eric Seidel.
@@ -2873,7 +6634,6 @@
         (WebKit::AutocompletePopupMenuClient::resetLastFieldValue):
         * src/AutocompletePopupMenuClient.h:
 
-
 2009-12-28  Kinuko Yasuda  <kinuko@chromium.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 9c45b83..c6d71ab 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,55 +32,43 @@
 
 vars = {
   'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
-  'chromium_deps_svn': 'http://src.chromium.org/svn/trunk/deps/third_party',
+  'chromium_rev': '44453',
 
-  # Dependencies' revisions to use:
-  'chromium_rev': '38580',
-  'google-url_rev': '121',
-  'gtest_rev': '359',
-  'gyp_rev': '781',
-  'icu_rev': '37341',
-  'openvcdiff_rev': '28',
-  'ots_rev': '26',
-  'skia_rev': '490',
-  'v8_rev': '3781',
-
-  # Windows:
-  'cygwin_rev': '11984',
-  'ffmpeg_ia32_rev': '34297',
   'pthreads-win32_rev': '26716',
-  'python_24_rev': '22967',
-  'nss_rev': '36871',
 }
 
 deps = {
+  'chromium_deps':
+    File(Var('chromium_svn')+'/DEPS@'+Var('chromium_rev')),
+
   # build tools
   'build':
     Var('chromium_svn')+'/build@'+Var('chromium_rev'),
   'tools/gyp':
-    'http://gyp.googlecode.com/svn/trunk@'+Var('gyp_rev'),
+    From('chromium_deps', 'src/tools/gyp'),
 
   # Basic tools
   'base':
     Var('chromium_svn')+'/base@'+Var('chromium_rev'),
+  'gfx':
+    Var('chromium_svn')+'/gfx@'+Var('chromium_rev'),
 
   # skia dependencies
   'skia':
     Var('chromium_svn')+'/skia@'+Var('chromium_rev'),
-  'third_party/skia':
-    'http://skia.googlecode.com/svn/trunk@'+Var('skia_rev'),
+  'third_party/skia/src':
+    From('chromium_deps', 'src/third_party/skia/src'),
+  'third_party/skia/include':
+    From('chromium_deps', 'src/third_party/skia/include'),
 
   # testing
   'testing':
     Var('chromium_svn')+'/testing@'+Var('chromium_rev'),
   'testing/gtest':
-    'http://googletest.googlecode.com/svn/trunk@'+Var('gtest_rev'),
+    From('chromium_deps', 'src/testing/gtest'),
 
   # v8 javascript engine
-  'v8':
-    'http://v8.googlecode.com/svn/trunk@'+Var('v8_rev'),
-  'testing/gtest':
-    'http://googletest.googlecode.com/svn/trunk@'+Var('gtest_rev'),
+  'v8': From('chromium_deps', 'src/v8'),
 
   # net dependencies
   'net':
@@ -88,13 +76,35 @@
   'sdch':
     Var('chromium_svn')+'/sdch@'+Var('chromium_rev'),
   'sdch/open-vcdiff':
-    'http://open-vcdiff.googlecode.com/svn/trunk@'+Var('openvcdiff_rev'),
+    From('chromium_deps', 'src/sdch/open-vcdiff'),
   'googleurl':
-    'http://google-url.googlecode.com/svn/trunk@'+Var('google-url_rev'),
+    From('chromium_deps', 'src/googleurl'),
+
+  # webkit dependencis
+  'webkit': Var('chromium_svn')+'/webkit@'+Var('chromium_rev'),
+
+  'app':
+    Var('chromium_svn')+'/app@'+Var('chromium_rev'), # needed by appcache
+  'gpu':
+    Var('chromium_svn')+'/gpu@'+Var('chromium_rev'),
+  'media':
+    Var('chromium_svn')+'/media@'+Var('chromium_rev'),
+  'third_party/glew':  # webgl related
+    Var('chromium_svn')+'/third_party/glew@'+Var('chromium_rev'),
+  'third_party/ffmpeg': # needed by webkit/media
+    Var('chromium_svn')+'/third_party/ffmpeg@'+Var('chromium_rev'),
+  'third_party/yasm': # needed by ffmpeg
+    Var('chromium_svn')+'/third_party/yasm@'+Var('chromium_rev'),
+  'third_party/openmax': # needed by webkit/media
+    Var('chromium_svn')+'/third_party/openmax@'+Var('chromium_rev'),
+  'tools/grit':
+    Var('chromium_svn')+'/tools/grit@'+Var('chromium_rev'),
+  'tools/generate_stubs':
+    Var('chromium_svn')+'/tools/generate_stubs@'+Var('chromium_rev'),
 
   # other third party
   'third_party/icu':
-    Var('chromium_deps_svn')+'/icu42@'+Var('icu_rev'),
+    From('chromium_deps', 'src/third_party/icu'),
 
   'third_party/bzip2':
     Var('chromium_svn')+'/third_party/bzip2@'+Var('chromium_rev'),
@@ -121,40 +131,50 @@
     Var('chromium_svn')+'/third_party/npapi@'+Var('chromium_rev'),
 
   'third_party/ots':
-    'http://ots.googlecode.com/svn/trunk@'+Var('ots_rev'),
+    From('chromium_deps', 'src/third_party/ots'),
 
   'third_party/sqlite':
     Var('chromium_svn')+'/third_party/sqlite@'+Var('chromium_rev'),
 
+  'third_party/tcmalloc':
+    Var('chromium_svn')+'/third_party/tcmalloc@'+Var('chromium_rev'),
+
   'third_party/zlib':
     Var('chromium_svn')+'/third_party/zlib@'+Var('chromium_rev'),
+
+  'third_party/ffmpeg/source/patched-ffmpeg-mt':
+    From('chromium_deps', 'src/third_party/ffmpeg/source/patched-ffmpeg-mt'),
 }
 
 deps_os = {
   'win': {
     'third_party/cygwin':
-      Var('chromium_deps_svn')+'/cygwin@'+Var('cygwin_rev'),
-
+      From('chromium_deps', 'src/third_party/cygwin'),
     'third_party/python_24':
-      Var('chromium_deps_svn')+'/python_24@'+Var('python_24_rev'),
-
+      From('chromium_deps', 'src/third_party/python_24'),
     'third_party/ffmpeg/binaries/chromium/win/ia32':
-      Var('chromium_deps_svn')+'/ffmpeg/binaries/win@'+Var('ffmpeg_ia32_rev'),
-
+      From('chromium_deps', 'src/third_party/ffmpeg/binaries/chromium/win/ia32'),
     'third_party/pthreads-win32':
-      Var('chromium_deps_svn')+'/pthreads-win32@'+Var('pthreads-win32_rev'),
-
-   # base.gypi depends on nss on Windows
-   'third_party/nss':
-      Var('chromium_deps_svn')+'/nss@'+Var('nss_rev'),
+      'http://src.chromium.org/svn/trunk/deps/third_party/pthreads-win32@'+Var('pthreads-win32_rev'),
+    # base.gypi depends on nss on Windows
+    'third_party/nss':
+      From('chromium_deps', 'src/third_party/nss'),
+    'third_party/wtl':
+      Var('chromium_svn')+'/third_party/wtl@'+Var('chromium_rev'),
+  },
+  'mac': {
+    # needed by ffmpeg
+    'third_party/yasm/source/patched-yasm':
+      From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'),
   },
   'unix': {
     # Linux, actually.
     'third_party/harfbuzz':
       Var('chromium_svn')+'/third_party/harfbuzz@'+Var('chromium_rev'),
-
     'tools/xdisplaycheck':
       Var('chromium_svn')+'/tools/xdisplaycheck@'+Var('chromium_rev'),
+    'third_party/yasm/source/patched-yasm':
+      From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'),
   },
 }
 
diff --git a/WebKit/chromium/WebKit.grd b/WebKit/chromium/WebKit.grd
new file mode 100644
index 0000000..a0783d7
--- /dev/null
+++ b/WebKit/chromium/WebKit.grd
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grit latest_public_release="0" current_release="1">
+  <outputs>
+    <output filename="grit/webkit_chromium_resources.h" type="rc_header">
+      <emit emit_type='prepend'></emit>
+    </output>
+    <output filename="webkit_chromium_resources.rc" type="rc_all" />
+    <output filename="webkit_chromium_resources.pak" type="data_package" />
+  </outputs>
+  <release seq="1">
+    <includes>
+      <include name="IDR_DEVTOOLS_INJECT_DISPATCH_JS" file="src\js\InjectDispatch.js"  type="BINDATA"/>
+      <include name="IDR_DEVTOOLS_INJECT_WEBKIT_JS" file="..\..\WebCore\inspector\front-end\InjectedScript.js" type="BINDATA"/>
+    </includes>
+  </release>
+</grit>
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 0c76dd3..53581bc 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -59,6 +59,12 @@
             'msvs_guid': '5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65',
             'dependencies': [
                 '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
+                '<(chromium_src_dir)/skia/skia.gyp:skia',
+                '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+            ],
+            'export_dependent_settings': [
+                '<(chromium_src_dir)/skia/skia.gyp:skia',
+                '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
             ],
             'include_dirs': [
                 'public',
@@ -68,9 +74,9 @@
                 'WEBKIT_IMPLEMENTATION',
             ],
             'sources': [
-                'public/GeolocationServiceBridgeChromium.h',
                 'public/gtk/WebInputEventFactory.h',
                 'public/linux/WebFontRendering.h',
+                'public/linux/WebFontRenderStyle.h',
                 'public/linux/WebRenderTheme.h',
                 'public/x11/WebScreenInfoFactory.h',
                 'public/mac/WebInputEventFactory.h',
@@ -119,15 +125,26 @@
                 'public/WebFrame.h',
                 'public/WebFrameClient.h',
                 'public/WebFontCache.h',
+                'public/WebFormControlElement.h',
                 'public/WebFormElement.h',
+                'public/WebGeolocationService.h',
+                'public/WebGeolocationServiceBridge.h',
                 'public/WebGlyphCache.h',
+                'public/WebGLES2Context.h',
+                'public/WebGraphicsContext3D.h',
                 'public/WebHistoryItem.h',
                 'public/WebHTTPBody.h',
                 'public/WebImage.h',
+                'public/WebImageDecoder.h',
+                'public/WebIDBCallbacks.h',
+                'public/WebIDBDatabase.h',
+                'public/WebIDBDatabaseError.h',
+                'public/WebIndexedDatabase.h',
                 'public/WebInputElement.h',
                 'public/WebInputEvent.h',
                 'public/WebKit.h',
                 'public/WebKitClient.h',
+                'public/WebLabelElement.h',
                 'public/WebLocalizedString.h',
                 'public/WebMediaPlayer.h',
                 'public/WebMediaPlayerAction.h',
@@ -151,10 +168,13 @@
                 'public/WebPasswordFormData.h',
                 'public/WebPlugin.h',
                 'public/WebPluginContainer.h',
+                'public/WebPluginDocument.h',
                 'public/WebPluginListBuilder.h',
                 'public/WebPoint.h',
                 'public/WebPopupMenu.h',
                 'public/WebPopupMenuInfo.h',
+                'public/WebPopupType.h',
+                'public/WebPrivatePtr.h',
                 'public/WebRange.h',
                 'public/WebRect.h',
                 'public/WebRegularExpression.h',
@@ -165,6 +185,8 @@
                 'public/WebSearchableFormData.h',
                 'public/WebSecurityOrigin.h',
                 'public/WebSecurityPolicy.h',
+                'public/WebSelectElement.h',
+                'public/WebSerializedScriptValue.h',
                 'public/WebSettings.h',
                 'public/WebSharedWorker.h',
                 'public/WebSharedWorkerRepository.h',
@@ -233,13 +255,21 @@
                 'src/EventListenerWrapper.h',
                 'src/FrameLoaderClientImpl.cpp',
                 'src/FrameLoaderClientImpl.h',
-                'src/GeolocationServiceBridgeChromium.cpp',		
+                'src/GLES2Context.cpp',
                 'src/gtk/WebFontInfo.cpp',
                 'src/gtk/WebFontInfo.h',
                 'src/gtk/WebInputEventFactory.cpp',
+                'src/IDBCallbacksProxy.h',
+                'src/IDBDatabaseProxy.cpp',
+                'src/IDBDatabaseProxy.h',
+                'src/IndexedDatabaseProxy.cpp',
+                'src/IndexedDatabaseProxy.h',
                 'src/InspectorClientImpl.cpp',
                 'src/InspectorClientImpl.h',
+                'src/InspectorFrontendClientImpl.cpp',
+                'src/InspectorFrontendClientImpl.h',
                 'src/linux/WebFontRendering.cpp',
+                'src/linux/WebFontRenderStyle.cpp',
                 'src/linux/WebRenderTheme.cpp',
                 'src/x11/WebScreenInfoFactory.cpp',
                 'src/mac/WebInputEventFactory.mm',
@@ -276,6 +306,7 @@
                 'src/WebBindings.cpp',
                 'src/WebCache.cpp',
                 'src/WebColor.cpp',
+                'src/WebCommon.cpp',
                 'src/WebCrossOriginPreflightResultCache.cpp',
                 'src/WebCString.cpp',
                 'src/WebCursorInfo.cpp',
@@ -299,19 +330,30 @@
                 'src/WebFileChooserCompletionImpl.cpp',
                 'src/WebFileChooserCompletionImpl.h',
                 'src/WebFontCache.cpp',
+                'src/WebFormControlElement.cpp',
                 'src/WebFormElement.cpp',
                 'src/WebFrameImpl.cpp',
                 'src/WebFrameImpl.h',
+                'src/WebGeolocationServiceBridgeImpl.cpp',
+                'src/WebGeolocationServiceBridgeImpl.h',
                 'src/WebGlyphCache.cpp',
+                'src/WebGraphicsContext3D.cpp',
+                'src/WebGraphicsContext3DDefaultImpl.cpp',
+                'src/WebGraphicsContext3DDefaultImpl.h',
                 'src/WebHistoryItem.cpp',
                 'src/WebHTTPBody.cpp',
+                'src/WebIDBDatabaseError.cpp',
                 'src/WebImageCG.cpp',
+                'src/WebImageDecoder.cpp',
                 'src/WebImageSkia.cpp',
+                'src/WebIndexedDatabaseImpl.cpp',
+                'src/WebIndexedDatabaseImpl.h',
                 'src/WebInputElement.cpp',
                 'src/WebInputEvent.cpp',
                 'src/WebInputEventConversion.cpp',
                 'src/WebInputEventConversion.h',
                 'src/WebKit.cpp',
+                'src/WebLabelElement.cpp',
                 'src/WebMediaPlayerClientImpl.cpp',
                 'src/WebMediaPlayerClientImpl.h',
                 'src/WebMutationEvent.cpp',
@@ -327,6 +369,7 @@
                 'src/WebPasswordFormUtils.h',
                 'src/WebPluginContainerImpl.h',
                 'src/WebPluginContainerImpl.cpp',
+                'src/WebPluginDocument.cpp',
                 'src/WebPluginListBuilderImpl.cpp',
                 'src/WebPluginListBuilderImpl.h',
                 'src/WebPluginLoadObserver.cpp',
@@ -340,6 +383,8 @@
                 'src/WebSearchableFormData.cpp',
                 'src/WebSecurityOrigin.cpp',
                 'src/WebSecurityPolicy.cpp',
+                'src/WebSelectElement.cpp',
+                'src/WebSerializedScriptValue.cpp',
                 'src/WebSettingsImpl.cpp',
                 'src/WebSettingsImpl.h',
                 'src/WebSharedWorkerImpl.cpp',
@@ -457,6 +502,7 @@
                 'src',
             ],
             'sources': [
+                'tests/DragImageTest.cpp',
                 'tests/KeyboardTest.cpp',
                 'tests/KURLTest.cpp',
                 'tests/RunAllTests.cpp',
@@ -464,10 +510,18 @@
             'conditions': [
                 ['OS=="win"', {
                     'sources': [
+                        # FIXME: Port PopupMenuTest to Linux and Mac.
+                        'tests/PopupMenuTest.cpp',
                         'tests/TransparencyWinTest.cpp',
                         'tests/UniscribeHelperTest.cpp',
                     ],
                 }],
+                ['OS=="mac"', {
+                    'sources!': [
+                        # FIXME: Port DragImageTest to Mac.
+                        'tests/DragImageTest.cpp',
+                    ],
+                }],
             ],
         },
     ], # targets
diff --git a/WebKit/chromium/WebKit.gypi b/WebKit/chromium/WebKit.gypi
index 69b1479..37faa99 100644
--- a/WebKit/chromium/WebKit.gypi
+++ b/WebKit/chromium/WebKit.gypi
@@ -35,6 +35,7 @@
         'devtools_js_files': [
             'src/js/InspectorControllerImpl.js',
             'src/js/DebuggerAgent.js',
+            'src/js/DebuggerScript.js',
             'src/js/ProfilerAgent.js',
             'src/js/ProfilerProcessor.js',
             'src/js/HeapProfilerPanel.js',
@@ -47,14 +48,19 @@
         ],
         'devtools_image_files': [
             'src/js/Images/segmentChromium.png',
+            'src/js/Images/segmentChromium2.png',
             'src/js/Images/segmentHoverChromium.png',
+            'src/js/Images/segmentHoverChromium2.png',
             'src/js/Images/segmentHoverEndChromium.png',
             'src/js/Images/segmentSelectedChromium.png',
+            'src/js/Images/segmentSelectedChromium2.png',
             'src/js/Images/segmentSelectedEndChromium.png',
             'src/js/Images/statusbarBackgroundChromium.png',
+            'src/js/Images/statusbarBackgroundChromium2.png',
             'src/js/Images/statusbarBottomBackgroundChromium.png',
             'src/js/Images/statusbarButtonsChromium.png',
             'src/js/Images/statusbarMenuButtonChromium.png',
+            'src/js/Images/statusbarMenuButtonChromium2.png',
             'src/js/Images/statusbarMenuButtonSelectedChromium.png',
         ],
     },
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index 0fc6516..7146685 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -40,12 +40,15 @@
       # features_override.gypi inline documentation for more details.
       'feature_defines%': [
         'ENABLE_3D_CANVAS=0',
+        'ENABLE_BLOB_SLICE=1',
         'ENABLE_CHANNEL_MESSAGING=1',
         'ENABLE_DATABASE=1',
         'ENABLE_DATAGRID=0',
         'ENABLE_OFFLINE_WEB_APPLICATIONS=1',
         'ENABLE_DASHBOARD_SUPPORT=0',
         'ENABLE_DOM_STORAGE=1',
+        'ENABLE_FILE_READER=0',
+        'ENABLE_FILE_WRITER=0',
         'ENABLE_GEOLOCATION=1',
         'ENABLE_JAVASCRIPT_DEBUGGER=1',
         'ENABLE_JSC_MULTIPLE_THREADS=0',
@@ -55,6 +58,7 @@
         'ENABLE_OPENTYPE_SANITIZER=1',
         'ENABLE_ORIENTATION_EVENTS=0',
         'ENABLE_RUBY=1',
+        'ENABLE_SANDBOX=1',
         'ENABLE_XHTMLMP=0',
         'ENABLE_XSLT=1',
         'ENABLE_XPATH=1',
@@ -65,12 +69,17 @@
         'ENABLE_SVG_USE=1',
         'ENABLE_SVG_FOREIGN_OBJECT=1',
         'ENABLE_SVG_FONTS=1',
+        'ENABLE_TOUCH_EVENTS=1',
         'ENABLE_VIDEO=1',
         'ENABLE_WEB_SOCKETS=1',
         'ENABLE_WORKERS=1',
         'WTF_USE_ACCELERATED_COMPOSITING=0',
       ],
+      
+      'enable_svg%': 1,
     },
+
     'feature_defines%': '<(feature_defines)',
+    'enable_svg%': '<(enable_svg)',
   },
 }
diff --git a/WebKit/chromium/gyp_webkit b/WebKit/chromium/gyp_webkit
index ef18239..db1aa7a 100644
--- a/WebKit/chromium/gyp_webkit
+++ b/WebKit/chromium/gyp_webkit
@@ -78,7 +78,7 @@
   args.extend(['-I' + i for i in additional_include_files(args)])
 
   # On linux, we want gyp to output a makefile (default is scons).
-  if (platform.system() == 'Linux'):
+  if platform.system() == 'Linux':
     args.extend(['-fmake'])
 
   # Other command args:
@@ -94,6 +94,10 @@
                # gyp file to execute.
                'WebKit.gyp'])
 
+  # Generate DRT build files on the platforms that support it.
+  if platform.system() in ('Darwin', 'Linux'):
+    args.append('../../WebKitTools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp')
+
   print 'Updating webkit projects from gyp files...'
   sys.stdout.flush()
 
diff --git a/WebKit/chromium/public/GeolocationServiceBridgeChromium.h b/WebKit/chromium/public/GeolocationServiceBridgeChromium.h
deleted file mode 100644
index adca956..0000000
--- a/WebKit/chromium/public/GeolocationServiceBridgeChromium.h
+++ /dev/null
@@ -1,73 +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 GeolocationServiceBridgeChromium_h
-#define GeolocationServiceBridgeChromium_h
-
-namespace WebCore {
-class GeolocationServiceBridge;
-class GeolocationServiceChromium;
-}
-
-namespace WebKit {
-
-class WebString;
-class WebURL;
-
-// Provides a WebKit API called by the embedder.
-class WebGeolocationServiceBridge {
-public:
-    virtual void setIsAllowed(bool allowed) = 0;
-    virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) = 0;
-    virtual void setLastError(int errorCode, const WebString& message) = 0;
-};
-
-// Provides an embedder API called by WebKit.
-class WebGeolocationServiceInterface {
-public:
-    virtual void requestPermissionForFrame(int bridgeId, const WebURL& url) = 0;
-    virtual void startUpdating(int bridgeId, bool hasHighAccuracy) = 0;
-    virtual void stopUpdating(int bridgeId) = 0;
-    virtual void suspend(int bridgeId) = 0;
-    virtual void resume(int bridgeId) = 0;
-
-    // Attaches the GeolocationBridge to the embedder and returns its id, which
-    // should be used on subsequent calls for the methods above.
-    virtual int attachBridge(WebKit::WebGeolocationServiceBridge* geolocationServiceBridge) = 0;
-
-    // Dettaches the GeolocationService from the embedder.
-    virtual void dettachBridge(int bridgeId) = 0;
-};
-
-WebCore::GeolocationServiceBridge* createGeolocationServiceBridgeImpl(WebCore::GeolocationServiceChromium*);
-
-} // namespace WebKit
-
-#endif // GeolocationServiceBridgeChromium_h
diff --git a/WebKit/chromium/public/WebApplicationCacheHost.h b/WebKit/chromium/public/WebApplicationCacheHost.h
index 7c5dafe..23be4dd 100644
--- a/WebKit/chromium/public/WebApplicationCacheHost.h
+++ b/WebKit/chromium/public/WebApplicationCacheHost.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -42,7 +42,7 @@
 struct WebURLError;
 
 // This interface is used by webkit to call out to the embedder. Webkit uses
-// the WebKitClient::createApplicationCacheHost method to create instances,
+// the WebFrameClient::createApplicationCacheHost method to create instances,
 // and calls delete when the instance is no longer needed.
 class WebApplicationCacheHost {
 public:
diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h
index 434cb06..d24916b 100644
--- a/WebKit/chromium/public/WebCString.h
+++ b/WebKit/chromium/public/WebCString.h
@@ -34,7 +34,7 @@
 #include "WebCommon.h"
 
 #if WEBKIT_IMPLEMENTATION
-namespace WebCore { class CString; }
+namespace WTF { class CString; }
 #else
 #include <string>
 #endif
@@ -84,9 +84,9 @@
     WEBKIT_API static WebCString fromUTF16(const WebUChar* data);
 
 #if WEBKIT_IMPLEMENTATION
-    WebCString(const WebCore::CString&);
-    WebCString& operator=(const WebCore::CString&);
-    operator WebCore::CString() const;
+    WebCString(const WTF::CString&);
+    WebCString& operator=(const WTF::CString&);
+    operator WTF::CString() const;
 #else
     WebCString(const std::string& s) : m_private(0)
     {
diff --git a/WebKit/chromium/public/WebCommon.h b/WebKit/chromium/public/WebCommon.h
index d347ea6..e7e38d3 100644
--- a/WebKit/chromium/public/WebCommon.h
+++ b/WebKit/chromium/public/WebCommon.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -89,6 +89,21 @@
 typedef unsigned short WebUChar;
 #endif
 
+// -----------------------------------------------------------------------------
+// Assertions
+
+WEBKIT_API void failedAssertion(const char* file, int line, const char* function, const char* assertion);
+
 } // namespace WebKit
 
+// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks.  (Otherwise use WTF's ASSERT.)
+#if defined(NDEBUG)
+#define WEBKIT_ASSERT(assertion) ((void)0)
+#else
+#define WEBKIT_ASSERT(assertion) do { \
+    if (!(assertion)) \
+        failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
+} while (0)
+#endif
+
 #endif
diff --git a/WebKit/chromium/public/WebCommonWorkerClient.h b/WebKit/chromium/public/WebCommonWorkerClient.h
index 771ffff..f4df16d 100644
--- a/WebKit/chromium/public/WebCommonWorkerClient.h
+++ b/WebKit/chromium/public/WebCommonWorkerClient.h
@@ -49,14 +49,18 @@
         const WebString& errorString, int lineNumber,
         const WebString& sourceURL) = 0;
 
-    virtual void postConsoleMessageToWorkerObject(
-        int destinationIdentifier,
-        int sourceIdentifier,
-        int messageType,
-        int messageLevel,
-        const WebString& message,
-        int lineNumber,
-        const WebString& sourceURL) = 0;
+    // FIXME: the below is for compatibility only and should be   
+    // removed once Chromium is updated to remove message
+    // destination parameter <http://webkit.org/b/37155>.
+    virtual void postConsoleMessageToWorkerObject(int, int sourceIdentifier, int messageType, int messageLevel,
+                                                  const WebString& message, int lineNumber, const WebString& sourceURL) = 0;
+
+    virtual void postConsoleMessageToWorkerObject(int sourceIdentifier, int messageType, int messageLevel,
+                                                  const WebString& message, int lineNumber, const WebString& sourceURL)
+    {
+        postConsoleMessageToWorkerObject(0, sourceIdentifier, messageType, messageLevel,
+                                         message, lineNumber, sourceURL);
+    }
 
     virtual void workerContextClosed() = 0;
     virtual void workerContextDestroyed() = 0;
diff --git a/WebKit/chromium/public/WebContextMenuData.h b/WebKit/chromium/public/WebContextMenuData.h
index 384240d..25036d4 100644
--- a/WebKit/chromium/public/WebContextMenuData.h
+++ b/WebKit/chromium/public/WebContextMenuData.h
@@ -83,6 +83,8 @@
         MediaLoop = 0x8,
         MediaCanSave = 0x10,
         MediaHasAudio = 0x20,
+        MediaHasVideo = 0x40,
+        MediaControls = 0x80,
     };
 
     // Extra attributes describing media elements.
diff --git a/WebKit/chromium/public/WebCookieJar.h b/WebKit/chromium/public/WebCookieJar.h
index df70341..6daba6b 100644
--- a/WebKit/chromium/public/WebCookieJar.h
+++ b/WebKit/chromium/public/WebCookieJar.h
@@ -31,8 +31,9 @@
 #ifndef WebCookieJar_h
 #define WebCookieJar_h
 
+#include "WebString.h"
+
 namespace WebKit {
-class WebString;
 class WebURL;
 struct WebCookie;
 template <typename T> class WebVector;
diff --git a/WebKit/chromium/public/WebDevToolsFrontendClient.h b/WebKit/chromium/public/WebDevToolsFrontendClient.h
index 6200709..754ecf9 100644
--- a/WebKit/chromium/public/WebDevToolsFrontendClient.h
+++ b/WebKit/chromium/public/WebDevToolsFrontendClient.h
@@ -46,8 +46,8 @@
 
     virtual void activateWindow() {};
     virtual void closeWindow() {};
-    virtual void dockWindow() {};
-    virtual void undockWindow() {};
+    virtual void requestDockWindow() {};
+    virtual void requestUndockWindow() {};
 
 protected:
     virtual ~WebDevToolsFrontendClient() {}
diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h
index 8964d3a..1f09653 100644
--- a/WebKit/chromium/public/WebDocument.h
+++ b/WebKit/chromium/public/WebDocument.h
@@ -42,6 +42,7 @@
 class WebElement;
 class WebFrame;
 class WebNodeCollection;
+class WebNodeList;
 class WebString;
 class WebURL;
 
@@ -61,15 +62,17 @@
     // Returns the frame the document belongs to or 0 if the document is frameless.
     WEBKIT_API WebFrame* frame() const;
     WEBKIT_API bool isHTMLDocument() const;
+    WEBKIT_API bool isPluginDocument() const;
     WEBKIT_API WebURL baseURL() const;
+    WEBKIT_API WebURL firstPartyForCookies() const;
     WEBKIT_API WebElement documentElement() const;
     WEBKIT_API WebElement body() const;
     WEBKIT_API WebElement head();
     WEBKIT_API WebString title() const;
     WEBKIT_API WebNodeCollection all();
     WEBKIT_API WebURL completeURL(const WebString&) const;
-    WEBKIT_API WebElement getElementById(const WebString& id) const;
-    WEBKIT_API WebString applicationID() const;
+    WEBKIT_API WebElement getElementById(const WebString&) const;
+    WEBKIT_API WebNode focusedNode() const;
 
 #if WEBKIT_IMPLEMENTATION
     WebDocument(const WTF::PassRefPtr<WebCore::Document>&);
diff --git a/WebKit/chromium/public/WebElement.h b/WebKit/chromium/public/WebElement.h
index 20f6c9a..1be40bc 100644
--- a/WebKit/chromium/public/WebElement.h
+++ b/WebKit/chromium/public/WebElement.h
@@ -35,7 +35,6 @@
 
 #if WEBKIT_IMPLEMENTATION
 namespace WebCore { class Element; }
-namespace WTF { template <typename T> class PassRefPtr; }
 #endif
 
 namespace WebKit {
@@ -48,6 +47,7 @@
         WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *this; }
         void assign(const WebElement& e) { WebNode::assign(e); }
 
+        WEBKIT_API bool isFormControlElement() const;
         WEBKIT_API WebString tagName() const;
         WEBKIT_API bool hasTagName(const WebString&) const;
         WEBKIT_API bool hasAttribute(const WebString&) const;
diff --git a/WebKit/chromium/public/WebFormControlElement.h b/WebKit/chromium/public/WebFormControlElement.h
new file mode 100644
index 0000000..ee0783d
--- /dev/null
+++ b/WebKit/chromium/public/WebFormControlElement.h
@@ -0,0 +1,74 @@
+/*
+ * 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 WebFormControlElement_h
+#define WebFormControlElement_h
+
+#include "WebElement.h"
+#include "WebString.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class HTMLFormControlElement; }
+#endif
+
+namespace WebKit {
+
+// Provides readonly access to some properties of a DOM form control element node.
+class WebFormControlElement : public WebElement {
+public:
+    WebFormControlElement() : WebElement() { }
+    WebFormControlElement(const WebFormControlElement& e) : WebElement(e) { }
+
+    WebFormControlElement& operator=(const WebFormControlElement& e)
+    {
+        WebElement::assign(e);
+        return *this;
+    }
+    WEBKIT_API void assign(const WebFormControlElement& e) { WebElement::assign(e); }
+
+    WEBKIT_API bool isEnabled() const;
+    WEBKIT_API WebString formControlName() const;
+    WEBKIT_API WebString formControlType() const;
+
+    // Returns the name that should be used for the specified |element| when
+    // storing autofill data.  This is either the field name or its id, an empty
+    // string if it has no name and no id.
+    WEBKIT_API WebString nameForAutofill() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebFormControlElement(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&);
+    WebFormControlElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormControlElement>&);
+    operator WTF::PassRefPtr<WebCore::HTMLFormControlElement>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFormElement.h b/WebKit/chromium/public/WebFormElement.h
index b07bff9..8cb4e47 100644
--- a/WebKit/chromium/public/WebFormElement.h
+++ b/WebKit/chromium/public/WebFormElement.h
@@ -32,15 +32,17 @@
 #define WebFormElement_h
 
 #include "WebElement.h"
-#include "WebInputElement.h"
 #include "WebVector.h"
 
 #if WEBKIT_IMPLEMENTATION
 namespace WebCore { class HTMLFormElement; }
-namespace WTF { template <typename T> class PassRefPtr; }
 #endif
 
 namespace WebKit {
+
+    class WebInputElement;
+    class WebFormControlElement;
+
     // A container for passing around a reference to a form element.  Provides
     // some information about the form.
     class WebFormElement : public WebElement {
@@ -57,12 +59,6 @@
         }
         WEBKIT_API void assign(const WebFormElement& e) { WebElement::assign(e); }
 
-#if WEBKIT_IMPLEMENTATION
-        WebFormElement(const WTF::PassRefPtr<WebCore::HTMLFormElement>&);
-        WebFormElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&);
-        operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const;
-#endif
-
         WEBKIT_API bool autoComplete() const;
         WEBKIT_API WebString action() const;
         WEBKIT_API WebString name() const;
@@ -70,7 +66,15 @@
         WEBKIT_API void submit();
         // FIXME: Deprecate and replace with WebVector<WebElement>.
         WEBKIT_API void getNamedElements(const WebString&, WebVector<WebNode>&);
+        // DEPRECATED: Replaced by getFormControlElements.
         WEBKIT_API void getInputElements(WebVector<WebInputElement>&) const;
+        WEBKIT_API void getFormControlElements(WebVector<WebFormControlElement>&) const;
+
+#if WEBKIT_IMPLEMENTATION
+        WebFormElement(const WTF::PassRefPtr<WebCore::HTMLFormElement>&);
+        WebFormElement& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&);
+        operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const;
+#endif
     };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index f193b9e..f112446 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -39,6 +39,8 @@
 #if WEBKIT_USING_V8
 namespace v8 {
 class Context;
+class Value;
+template <class T> class Handle;
 template <class T> class Local;
 }
 #endif
@@ -123,6 +125,9 @@
     // NOTE: These routines do not force page layout so their results may
     // not be accurate if the page layout is out-of-date.
 
+    // If set to false, do not draw scrollbars on this frame's view.
+    virtual void setCanHaveScrollbars(bool) = 0;
+
     // The scroll offset from the top-left corner of the frame in pixels.
     virtual WebSize scrollOffset() const = 0;
 
@@ -222,6 +227,11 @@
     virtual void collectGarbage() = 0;
 
 #if WEBKIT_USING_V8
+    // Executes script in the context of the current page and returns the value
+    // that the script evaluated to.
+    virtual v8::Handle<v8::Value> executeScriptAndReturnValue(
+        const WebScriptSource&) = 0;
+
     // Returns the V8 context for this frame, or an empty handle if there
     // is none.
     virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0;
@@ -367,10 +377,14 @@
 
     // Printing ------------------------------------------------------------
 
-    // Reformats the WebFrame for printing.  pageSize is the page size in
-    // pixels.  Returns the number of pages that can be printed at the
-    // given page size.
-    virtual int printBegin(const WebSize& pageSize) = 0;
+    // Reformats the WebFrame for printing. pageSize is the page size in
+    // points (a point in 1/72 of an inch). printerDPI is the user selected,
+    // DPI for the printer. Returns the number of pages that
+    // can be printed at the given page size. The out param useBrowserOverlays
+    // specifies whether the browser process should use its overlays (header,
+    // footer, margins etc) or whether the renderer controls this.
+    virtual int printBegin(const WebSize& pageSize, int printerDPI = 72,
+                           bool* useBrowserOverlays = 0) = 0;
 
     // Returns the page shrinking factor calculated by webkit (usually
     // between 1/1.25 and 1/2). Returns 0 if the page number is invalid or
@@ -492,6 +506,12 @@
                                          float pageWidthInPixels,
                                          float pageHeightInPixels) const = 0;
 
+    // Returns the bounds rect for current selection. If selection is performed
+    // on transformed text, the rect will still bound the selection but will
+    // not be transformed itself. If no selection is present, the rect will be
+    // empty ((0,0), (0,0)).
+    virtual WebRect selectionBoundsRect() const = 0;
+
 protected:
     ~WebFrame() { }
 };
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index ae2541a..315cf87 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -38,6 +38,8 @@
 
 namespace WebKit {
 
+class WebApplicationCacheHost;
+class WebApplicationCacheHostClient;
 class WebCookieJar;
 class WebDataSource;
 class WebFormElement;
@@ -75,10 +77,14 @@
     // May return null.
     virtual WebMediaPlayer* createMediaPlayer(WebFrame*, WebMediaPlayerClient*) { return 0; }
 
+    // May return null.
+    virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*) { return 0; }
+
     
     // Services ------------------------------------------------------------
 
-    // A frame specific cookie jar.  May return null.
+    // A frame specific cookie jar.  May return null, in which case
+    // WebKitClient::cookieJar() will be called to access cookies.
     virtual WebCookieJar* cookieJar() { return 0; }
 
 
@@ -90,6 +96,9 @@
     // Controls whether plugins are allowed for this frame.
     virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
 
+    // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled.
+    virtual void didNotAllowPlugins(WebFrame*) { }
+
     // Controls whether images are allowed for this frame.
     virtual bool allowImages(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
 
@@ -195,9 +204,16 @@
     // The frame's document and all of its subresources succeeded to load.
     virtual void didFinishLoad(WebFrame*) { }
 
+    // The navigation resulted in no change to the documents within the page.
+    // For example, the navigation may have just resulted in scrolling to a
+    // named anchor or a PopState event may have been dispatched.
+    virtual void didNavigateWithinPage(WebFrame*, bool isNewNavigation) { }
+
     // The navigation resulted in scrolling the page to a named anchor instead
     // of downloading a new document.
+    // FIXME: The isNewNavigation parameter is DEPRECATED.
     virtual void didChangeLocationWithinPage(WebFrame*, bool isNewNavigation) { }
+    virtual void didChangeLocationWithinPage(WebFrame*) { }
 
     // Called upon update to scroll position, document state, and other
     // non-navigational events related to the data held by WebHistoryItem.
@@ -252,6 +268,12 @@
     // Controls whether scripts are allowed to execute for this frame.
     virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
 
+    // Controls whether access to Web Databases is allowed for this frame.
+    virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; }
+
+    // Notifies the client that the frame would have executed script if script were enabled.
+    virtual void didNotAllowScript(WebFrame*) { }
+
     // Script in the page tried to allocate too much memory.
     virtual void didExhaustMemoryAvailableForScript(WebFrame*) { }
 
diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h
new file mode 100644
index 0000000..bd63060
--- /dev/null
+++ b/WebKit/chromium/public/WebGLES2Context.h
@@ -0,0 +1,56 @@
+/*
+ * 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 WebGLES2Context_h
+#define WebGLES2Context_h
+
+#include "WebCommon.h"
+#include "WebNonCopyable.h"
+
+namespace WebKit {
+
+class WebView;
+
+// This interface abstracts the creation and management of an
+// OpenGL ES 2.0 context.
+
+class WebGLES2Context : public WebNonCopyable {
+public:
+    virtual ~WebGLES2Context() {}
+
+    virtual bool initialize(WebView*) = 0;
+    virtual bool makeCurrent() = 0;
+    virtual bool destroy() = 0;
+    virtual bool swapBuffers() = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebGeolocationService.h b/WebKit/chromium/public/WebGeolocationService.h
new file mode 100644
index 0000000..ed8c4e8
--- /dev/null
+++ b/WebKit/chromium/public/WebGeolocationService.h
@@ -0,0 +1,61 @@
+/*
+ * 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 WebGeolocationService_h
+#define WebGeolocationService_h
+
+#include "WebGeolocationServiceBridge.h"
+
+namespace WebKit {
+
+class WebString;
+class WebURL;
+
+// Provides an embedder API called by WebKit.
+class WebGeolocationService {
+public:
+    virtual void requestPermissionForFrame(int bridgeId, const WebURL& url) { }
+    virtual void cancelPermissionRequestForFrame(int bridgeId, const WebURL&) { }
+    virtual void startUpdating(int bridgeId, const WebURL& url, bool enableHighAccuracy) { }
+    virtual void stopUpdating(int bridgeId) { }
+    virtual void suspend(int bridgeId) { }
+    virtual void resume(int bridgeId) { }
+
+    // Attaches the WebGeolocationServiceBridge to the embedder and returns its
+    // id, which should be used on subsequent calls for the methods above.
+    virtual int attachBridge(WebGeolocationServiceBridge*) { return 0; }
+
+    // Detaches the WebGeolocationServiceBridge from the embedder.
+    virtual void detachBridge(int bridgeId) { }
+};
+
+} // namespace WebKit
+
+#endif // WebGeolocationService_h
diff --git a/WebKit/chromium/public/WebGeolocationServiceBridge.h b/WebKit/chromium/public/WebGeolocationServiceBridge.h
new file mode 100644
index 0000000..9f0ffd4
--- /dev/null
+++ b/WebKit/chromium/public/WebGeolocationServiceBridge.h
@@ -0,0 +1,54 @@
+/*
+ * 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 WebGeolocationServiceBridge_h
+#define WebGeolocationServiceBridge_h
+
+namespace WebCore {
+class GeolocationServiceBridge;
+class GeolocationServiceChromium;
+}
+
+namespace WebKit {
+
+class WebString;
+class WebURL;
+
+// Provides a WebKit API called by the embedder.
+class WebGeolocationServiceBridge {
+public:
+    virtual void setIsAllowed(bool allowed) = 0;
+    virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) = 0;
+    virtual void setLastError(int errorCode, const WebString& message) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebGeolocationServiceBridge_h
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
new file mode 100644
index 0000000..3418ef9
--- /dev/null
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -0,0 +1,302 @@
+/*
+ * 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 WebGraphicsContext3D_h
+#define WebGraphicsContext3D_h
+
+#include "WebCommon.h"
+#include "WebNonCopyable.h"
+#include "WebString.h"
+
+namespace WebKit {
+
+// Typedef for server-side objects like OpenGL textures and program objects.
+typedef unsigned int WebGLId;
+
+// This interface abstracts the operations performed by the
+// GraphicsContext3D in order to implement WebGL. Nearly all of the
+// methods exposed on this interface map directly to entry points in
+// the OpenGL ES 2.0 API.
+
+class WebGraphicsContext3D : public WebNonCopyable {
+public:
+    // Return value from getActiveUniform and getActiveAttrib.
+    struct ActiveInfo {
+        WebString name;
+        unsigned type;
+        int size;
+    };
+
+    // Context creation attributes.
+    struct Attributes {
+        Attributes()
+            : alpha(true)
+            , depth(true)
+            , stencil(true)
+            , antialias(true)
+            , premultipliedAlpha(true)
+        {
+        }
+
+        bool alpha;
+        bool depth;
+        bool stencil;
+        bool antialias;
+        bool premultipliedAlpha;
+    };
+
+    // This destructor needs to be public so that using classes can destroy instances if initialization fails.
+    virtual ~WebGraphicsContext3D() {}
+
+    // Creates a "default" implementation of WebGraphicsContext3D which calls
+    // OpenGL directly.
+    static WebGraphicsContext3D* createDefault();
+
+    // Initializes the graphics context; should be the first operation performed
+    // on newly-constructed instances. Returns true on success.
+    virtual bool initialize(Attributes) = 0;
+
+    // Makes the OpenGL context current on the current thread. Returns true on
+    // success.
+    virtual bool makeContextCurrent() = 0;
+
+    // The size of the region into which this WebGraphicsContext3D is rendering.
+    // Returns the last values passed to reshape().
+    virtual int width() = 0;
+    virtual int height() = 0;
+
+    // Helper to return the size in bytes of OpenGL data types
+    // like GL_FLOAT, GL_INT, etc.
+    virtual int sizeInBytes(int type) = 0;
+
+    // Resizes the region into which this WebGraphicsContext3D is drawing.
+    virtual void reshape(int width, int height) = 0;
+
+    // Helper for software compositing path. Reads back the frame buffer into
+    // the memory region pointed to by "pixels" with size "bufferSize". It is
+    // expected that the storage for "pixels" covers (4 * width * height) bytes.
+    // Returns true on success.
+    virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize) = 0;
+
+    // Synthesizes an OpenGL error which will be returned from a
+    // later call to getError. This is used to emulate OpenGL ES
+    // 2.0 behavior on the desktop and to enforce additional error
+    // checking mandated by WebGL.
+    //
+    // Per the behavior of glGetError, this stores at most one
+    // instance of any given error, and returns them from calls to
+    // getError in the order they were added.
+    virtual void synthesizeGLError(unsigned long error) = 0;
+
+    // The entry points below map directly to the OpenGL ES 2.0 API.
+    // See: http://www.khronos.org/registry/gles/
+    // and: http://www.khronos.org/opengles/sdk/docs/man/
+    virtual void activeTexture(unsigned long texture) = 0;
+    virtual void attachShader(WebGLId program, WebGLId shader) = 0;
+    virtual void bindAttribLocation(WebGLId program, unsigned long index, const char* name) = 0;
+    virtual void bindBuffer(unsigned long target, WebGLId buffer) = 0;
+    virtual void bindFramebuffer(unsigned long target, WebGLId framebuffer) = 0;
+    virtual void bindRenderbuffer(unsigned long target, WebGLId renderbuffer) = 0;
+    virtual void bindTexture(unsigned long target, WebGLId texture) = 0;
+    virtual void blendColor(double red, double green, double blue, double alpha) = 0;
+    virtual void blendEquation(unsigned long mode) = 0;
+    virtual void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha) = 0;
+    virtual void blendFunc(unsigned long sfactor, unsigned long dfactor) = 0;
+    virtual void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha) = 0;
+
+    virtual void bufferData(unsigned long target, int size, const void* data, unsigned long usage) = 0;
+    virtual void bufferSubData(unsigned long target, long offset, int size, const void* data) = 0;
+
+    virtual unsigned long checkFramebufferStatus(unsigned long target) = 0;
+    virtual void clear(unsigned long mask) = 0;
+    virtual void clearColor(double red, double green, double blue, double alpha) = 0;
+    virtual void clearDepth(double depth) = 0;
+    virtual void clearStencil(long s) = 0;
+    virtual void colorMask(bool red, bool green, bool blue, bool alpha) = 0;
+    virtual void compileShader(WebGLId shader) = 0;
+
+    virtual void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border) = 0;
+    virtual void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height) = 0;
+    virtual void cullFace(unsigned long mode) = 0;
+    virtual void depthFunc(unsigned long func) = 0;
+    virtual void depthMask(bool flag) = 0;
+    virtual void depthRange(double zNear, double zFar) = 0;
+    virtual void detachShader(WebGLId program, WebGLId shader) = 0;
+    virtual void disable(unsigned long cap) = 0;
+    virtual void disableVertexAttribArray(unsigned long index) = 0;
+    virtual void drawArrays(unsigned long mode, long first, long count) = 0;
+    virtual void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset) = 0;
+
+    virtual void enable(unsigned long cap) = 0;
+    virtual void enableVertexAttribArray(unsigned long index) = 0;
+    virtual void finish() = 0;
+    virtual void flush() = 0;
+    virtual void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLId renderbuffer) = 0;
+    virtual void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLId texture, long level) = 0;
+    virtual void frontFace(unsigned long mode) = 0;
+    virtual void generateMipmap(unsigned long target) = 0;
+
+    virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&) = 0;
+    virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&) = 0;
+
+    virtual int  getAttribLocation(WebGLId program, const char* name) = 0;
+
+    virtual void getBooleanv(unsigned long pname, unsigned char* value) = 0;
+
+    virtual void getBufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
+
+    virtual Attributes getContextAttributes() = 0;
+
+    virtual unsigned long getError() = 0;
+
+    virtual void getFloatv(unsigned long pname, float* value) = 0;
+
+    virtual void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value) = 0;
+
+    virtual void getIntegerv(unsigned long pname, int* value) = 0;
+
+    virtual void getProgramiv(WebGLId program, unsigned long pname, int* value) = 0;
+
+    virtual WebString getProgramInfoLog(WebGLId program) = 0;
+
+    virtual void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
+
+    virtual void getShaderiv(WebGLId shader, unsigned long pname, int* value) = 0;
+
+    virtual WebString getShaderInfoLog(WebGLId shader) = 0;
+
+    // TBD
+    // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+
+    virtual WebString getShaderSource(WebGLId shader) = 0;
+    virtual WebString getString(unsigned long name) = 0;
+
+    virtual void getTexParameterfv(unsigned long target, unsigned long pname, float* value) = 0;
+    virtual void getTexParameteriv(unsigned long target, unsigned long pname, int* value) = 0;
+
+    virtual void getUniformfv(WebGLId program, long location, float* value) = 0;
+    virtual void getUniformiv(WebGLId program, long location, int* value) = 0;
+
+    virtual long getUniformLocation(WebGLId program, const char* name) = 0;
+
+    virtual void getVertexAttribfv(unsigned long index, unsigned long pname, float* value) = 0;
+    virtual void getVertexAttribiv(unsigned long index, unsigned long pname, int* value) = 0;
+
+    virtual long getVertexAttribOffset(unsigned long index, unsigned long pname) = 0;
+
+    virtual void hint(unsigned long target, unsigned long mode) = 0;
+    virtual bool isBuffer(WebGLId buffer) = 0;
+    virtual bool isEnabled(unsigned long cap) = 0;
+    virtual bool isFramebuffer(WebGLId framebuffer) = 0;
+    virtual bool isProgram(WebGLId program) = 0;
+    virtual bool isRenderbuffer(WebGLId renderbuffer) = 0;
+    virtual bool isShader(WebGLId shader) = 0;
+    virtual bool isTexture(WebGLId texture) = 0;
+    virtual void lineWidth(double) = 0;
+    virtual void linkProgram(WebGLId program) = 0;
+    virtual void pixelStorei(unsigned long pname, long param) = 0;
+    virtual void polygonOffset(double factor, double units) = 0;
+
+    virtual void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels) = 0;
+
+    virtual void releaseShaderCompiler() = 0;
+    virtual void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height) = 0;
+    virtual void sampleCoverage(double value, bool invert) = 0;
+    virtual void scissor(long x, long y, unsigned long width, unsigned long height) = 0;
+    virtual void shaderSource(WebGLId shader, const char* string) = 0;
+    virtual void stencilFunc(unsigned long func, long ref, unsigned long mask) = 0;
+    virtual void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask) = 0;
+    virtual void stencilMask(unsigned long mask) = 0;
+    virtual void stencilMaskSeparate(unsigned long face, unsigned long mask) = 0;
+    virtual void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass) = 0;
+    virtual void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass) = 0;
+
+    virtual void texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, const void* pixels) = 0;
+
+    virtual void texParameterf(unsigned target, unsigned pname, float param) = 0;
+    virtual void texParameteri(unsigned target, unsigned pname, int param) = 0;
+
+    virtual void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, const void* pixels) = 0;
+
+    virtual void uniform1f(long location, float x) = 0;
+    virtual void uniform1fv(long location, int count, float* v) = 0;
+    virtual void uniform1i(long location, int x) = 0;
+    virtual void uniform1iv(long location, int count, int* v) = 0;
+    virtual void uniform2f(long location, float x, float y) = 0;
+    virtual void uniform2fv(long location, int count, float* v) = 0;
+    virtual void uniform2i(long location, int x, int y) = 0;
+    virtual void uniform2iv(long location, int count, int* v) = 0;
+    virtual void uniform3f(long location, float x, float y, float z) = 0;
+    virtual void uniform3fv(long location, int count, float* v) = 0;
+    virtual void uniform3i(long location, int x, int y, int z) = 0;
+    virtual void uniform3iv(long location, int count, int* v) = 0;
+    virtual void uniform4f(long location, float x, float y, float z, float w) = 0;
+    virtual void uniform4fv(long location, int count, float* v) = 0;
+    virtual void uniform4i(long location, int x, int y, int z, int w) = 0;
+    virtual void uniform4iv(long location, int count, int* v) = 0;
+    virtual void uniformMatrix2fv(long location, int count, bool transpose, const float* value) = 0;
+    virtual void uniformMatrix3fv(long location, int count, bool transpose, const float* value) = 0;
+    virtual void uniformMatrix4fv(long location, int count, bool transpose, const float* value) = 0;
+
+    virtual void useProgram(WebGLId program) = 0;
+    virtual void validateProgram(WebGLId program) = 0;
+
+    virtual void vertexAttrib1f(unsigned long indx, float x) = 0;
+    virtual void vertexAttrib1fv(unsigned long indx, const float* values) = 0;
+    virtual void vertexAttrib2f(unsigned long indx, float x, float y) = 0;
+    virtual void vertexAttrib2fv(unsigned long indx, const float* values) = 0;
+    virtual void vertexAttrib3f(unsigned long indx, float x, float y, float z) = 0;
+    virtual void vertexAttrib3fv(unsigned long indx, const float* values) = 0;
+    virtual void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w) = 0;
+    virtual void vertexAttrib4fv(unsigned long indx, const float* values) = 0;
+    virtual void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
+                                     unsigned long stride, unsigned long offset) = 0;
+
+    virtual void viewport(long x, long y, unsigned long width, unsigned long height) = 0;
+
+    // Support for buffer creation and deletion.
+    virtual unsigned createBuffer() = 0;
+    virtual unsigned createFramebuffer() = 0;
+    virtual unsigned createProgram() = 0;
+    virtual unsigned createRenderbuffer() = 0;
+    virtual unsigned createShader(unsigned long) = 0;
+    virtual unsigned createTexture() = 0;
+
+    virtual void deleteBuffer(unsigned) = 0;
+    virtual void deleteFramebuffer(unsigned) = 0;
+    virtual void deleteProgram(unsigned) = 0;
+    virtual void deleteRenderbuffer(unsigned) = 0;
+    virtual void deleteShader(unsigned) = 0;
+    virtual void deleteTexture(unsigned) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h
index fcc44ff..a7dc7c9 100644
--- a/WebKit/chromium/public/WebHTTPBody.h
+++ b/WebKit/chromium/public/WebHTTPBody.h
@@ -81,9 +81,9 @@
 
     // Append to the list of elements.
     WEBKIT_API void appendData(const WebData&);
-    WEBKIT_API void appendFile(const WebString&); // FIXME: to be removed.
+    WEBKIT_API void appendFile(const WebString&);
     // Passing -1 to fileLength means to the end of the file.
-    WEBKIT_API void appendFile(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&);
+    WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&);
 
     // Identifies a particular form submission instance.  A value of 0 is
     // used to indicate an unspecified identifier.
diff --git a/WebKit/chromium/public/WebHistoryItem.h b/WebKit/chromium/public/WebHistoryItem.h
index e248a61..015f5d7 100644
--- a/WebKit/chromium/public/WebHistoryItem.h
+++ b/WebKit/chromium/public/WebHistoryItem.h
@@ -32,17 +32,14 @@
 #define WebHistoryItem_h
 
 #include "WebCommon.h"
+#include "WebPrivatePtr.h"
 
-#if WEBKIT_IMPLEMENTATION
 namespace WebCore { class HistoryItem; }
-namespace WTF { template <typename T> class PassRefPtr; }
-#endif
 
 namespace WebKit {
-
-class WebHistoryItemPrivate;
 class WebHTTPBody;
 class WebString;
+class WebSerializedScriptValue;
 struct WebPoint;
 template <typename T> class WebVector;
 
@@ -55,8 +52,8 @@
 public:
     ~WebHistoryItem() { reset(); }
 
-    WebHistoryItem() : m_private(0) { }
-    WebHistoryItem(const WebHistoryItem& h) : m_private(0) { assign(h); }
+    WebHistoryItem() { }
+    WebHistoryItem(const WebHistoryItem& h) { assign(h); }
     WebHistoryItem& operator=(const WebHistoryItem& h)
     {
         assign(h);
@@ -67,7 +64,7 @@
     WEBKIT_API void reset();
     WEBKIT_API void assign(const WebHistoryItem&);
 
-    bool isNull() const { return !m_private; }
+    bool isNull() const { return m_private.isNull(); }
 
     WEBKIT_API WebString urlString() const;
     WEBKIT_API void setURLString(const WebString&);
@@ -108,6 +105,9 @@
     WEBKIT_API long long documentSequenceNumber() const;
     WEBKIT_API void setDocumentSequenceNumber(long long);
 
+    WEBKIT_API WebSerializedScriptValue stateObject() const;
+    WEBKIT_API void setStateObject(const WebSerializedScriptValue&);
+
     WEBKIT_API WebString httpContentType() const;
     WEBKIT_API void setHTTPContentType(const WebString&);
 
@@ -125,9 +125,8 @@
 #endif
 
 private:
-    void assign(WebHistoryItemPrivate*);
     void ensureMutable();
-    WebHistoryItemPrivate* m_private;
+    WebPrivatePtr<WebCore::HistoryItem> m_private;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/public/WebIDBCallbacks.h b/WebKit/chromium/public/WebIDBCallbacks.h
new file mode 100644
index 0000000..9e85aa8
--- /dev/null
+++ b/WebKit/chromium/public/WebIDBCallbacks.h
@@ -0,0 +1,56 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBCallbacks_h
+#define WebIDBCallbacks_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebIDBDatabaseError;
+
+// Every IndexedDB method takes in a pair of callbacks for error/success which
+// implement this class.  Either 0 or 1 of these methods will be called and the
+// callback class may be deleted any time after the callback is called.
+template <typename ResultType>
+class WebIDBCallbacks {
+public:
+    virtual ~WebIDBCallbacks() { }
+
+    // If the method was a success, this method is called with the result.  The
+    // result is a pointer that the callback takes ownership of.
+    virtual void onSuccess(ResultType*) = 0;
+
+    // Called in the event of an error.
+    virtual void onError(const WebIDBDatabaseError&) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebIDBCallbacks_h
diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h
new file mode 100644
index 0000000..403b4e8
--- /dev/null
+++ b/WebKit/chromium/public/WebIDBDatabase.h
@@ -0,0 +1,46 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBDatabase_h
+#define WebIDBDatabase_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+// See comment in WebIndexedDatabase for a high level overview these classes.
+class WebIDBDatabase {
+public:
+    virtual ~WebIDBDatabase() { }
+
+    // FIXME: Implement.
+};
+
+} // namespace WebKit
+
+#endif // WebIDBDatabase_h
diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h
new file mode 100644
index 0000000..f56a0d0
--- /dev/null
+++ b/WebKit/chromium/public/WebIDBDatabaseError.h
@@ -0,0 +1,72 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIDBDatabaseError_h
+#define WebIDBDatabaseError_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+#include "WebString.h"
+
+namespace WebCore { class IDBDatabaseError; }
+
+namespace WebKit {
+
+// See comment in WebIndexedDatabase for a high level overview these classes.
+class WebIDBDatabaseError {
+public:
+    ~WebIDBDatabaseError();
+
+    WebIDBDatabaseError(unsigned short code, const WebString& message) { assign(code, message); }
+    WebIDBDatabaseError(const WebIDBDatabaseError& e) { assign(e); }
+    WebIDBDatabaseError& operator=(const WebIDBDatabaseError& e)
+    {
+        assign(e);
+        return *this;
+    }
+
+    WEBKIT_API void assign(const WebIDBDatabaseError&);
+
+    WEBKIT_API unsigned short code() const;
+    WEBKIT_API WebString message() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebIDBDatabaseError(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&);
+    WebIDBDatabaseError& operator=(const WTF::PassRefPtr<WebCore::IDBDatabaseError>&);
+    operator WTF::PassRefPtr<WebCore::IDBDatabaseError>() const;
+#endif
+
+private:
+    WEBKIT_API void assign(unsigned short code, const WebString& message);
+
+    WebPrivatePtr<WebCore::IDBDatabaseError> m_private;
+};
+
+} // namespace WebKit
+
+#endif // WebIDBDatabaseError_h
diff --git a/WebKit/chromium/public/WebImageDecoder.h b/WebKit/chromium/public/WebImageDecoder.h
new file mode 100644
index 0000000..22db709
--- /dev/null
+++ b/WebKit/chromium/public/WebImageDecoder.h
@@ -0,0 +1,90 @@
+/*
+ * 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 WebImageDecoder_h
+#define WebImageDecoder_h
+
+#include "WebCommon.h"
+#include "WebImage.h"
+#include "WebNonCopyable.h"
+
+namespace WebCore { class ImageDecoder; }
+
+namespace WebKit {
+
+typedef WebCore::ImageDecoder WebImageDecoderPrivate;
+class WebData;
+
+class WebImageDecoder : public WebNonCopyable {
+public:
+    enum Type {
+        TypeBMP,
+        TypeICO
+    };
+
+    ~WebImageDecoder() { reset(); }
+
+    explicit WebImageDecoder(Type type) { init(type); }
+
+    // Sets data contents for underlying decoder. All the API methods
+    // require that setData() is called prior to their use.
+    WEBKIT_API void setData(const WebData& data, bool allDataReceived);
+
+    // Deletes owned decoder.
+    WEBKIT_API void reset();
+
+    // Returns true if image decoding failed.
+    WEBKIT_API bool isFailed() const;
+    
+    // Returns true if size information is available for the decoder.
+    WEBKIT_API bool isSizeAvailable() const;
+
+    // Returns the size of the image.
+    WEBKIT_API WebSize size() const;
+
+    // Gives frame count for the image. For multiple frames, decoder scans the image data for the count.
+    WEBKIT_API size_t frameCount() const;
+
+    // Returns if the frame at given index is completely decoded.
+    WEBKIT_API bool isFrameCompleteAtIndex(int index) const;
+
+    // Creates and returns WebImage from buffer at the index.
+    WEBKIT_API WebImage getFrameAtIndex(int index) const;
+
+private:
+    // Creates type-specific decoder.
+    WEBKIT_API void init(Type type);
+
+    WebImageDecoderPrivate* m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h
new file mode 100644
index 0000000..bb75170
--- /dev/null
+++ b/WebKit/chromium/public/WebIndexedDatabase.h
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIndexedDatabase_h
+#define WebIndexedDatabase_h
+
+#include "WebCommon.h"
+#include "WebIDBCallbacks.h"
+
+namespace WebKit {
+
+class WebFrame;
+class WebIDBDatabase;
+class WebString;
+
+// The entry point into the IndexedDatabase API.  These classes match their _____Request and
+// _____Sync counterparts in the spec, but operate only in an async manner.
+// http://dev.w3.org/2006/webapi/WebSimpleDB/
+class WebIndexedDatabase {
+public:
+    WEBKIT_API static WebIndexedDatabase* create();
+
+    virtual ~WebIndexedDatabase() { }
+
+    virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*, int& exceptionCode) = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebIndexedDatabase_h
diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h
index 59643d1..0fec63f 100644
--- a/WebKit/chromium/public/WebInputElement.h
+++ b/WebKit/chromium/public/WebInputElement.h
@@ -31,29 +31,26 @@
 #ifndef WebInputElement_h
 #define WebInputElement_h
 
-#include "WebElement.h"
+#include "WebFormControlElement.h"
 
 #if WEBKIT_IMPLEMENTATION
 namespace WebCore { class HTMLInputElement; }
-namespace WTF { template <typename T> class PassRefPtr; }
 #endif
 
 namespace WebKit {
 
     // Provides readonly access to some properties of a DOM input element node.
-    class WebInputElement : public WebElement {
+    class WebInputElement : public WebFormControlElement {
     public:
-        WebInputElement() : WebElement() { }
-        WebInputElement(const WebInputElement& n) : WebElement(n) { }
+        WebInputElement() : WebFormControlElement() { }
+        WebInputElement(const WebInputElement& e) : WebFormControlElement(e) { }
 
-        WebInputElement& operator=(const WebInputElement& n) { WebElement::assign(n); return *this; }
-        WEBKIT_API void assign(const WebInputElement& n) { WebElement::assign(n); }
-
-#if WEBKIT_IMPLEMENTATION
-        WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
-        WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
-        operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const;
-#endif
+        WebInputElement& operator=(const WebInputElement& e)
+        {
+            WebFormControlElement::assign(e);
+            return *this;
+        }
+        WEBKIT_API void assign(const WebInputElement& e) { WebFormControlElement::assign(e); }
 
         enum InputType {
             Text = 0,
@@ -85,7 +82,7 @@
         WEBKIT_API bool autoComplete() const;
         WEBKIT_API bool isEnabledFormControl() const;
         WEBKIT_API InputType inputType() const;
-        WEBKIT_API WebString formControlType() const;
+        WEBKIT_API int maxLength() const;
         WEBKIT_API bool isActivatedSubmit() const;
         WEBKIT_API void setActivatedSubmit(bool);
         WEBKIT_API void setValue(const WebString& value);
@@ -93,11 +90,18 @@
         WEBKIT_API void setAutofilled(bool);
         WEBKIT_API void dispatchFormControlChangeEvent();
         WEBKIT_API void setSelectionRange(int, int);
+        // DEPRECATED: The following two methods have been moved to WebFormControlElement.
         WEBKIT_API WebString name() const;
         // Returns the name that should be used for the specified |element| when
-        // storing autofill data.  This is either the field name or its id, an empty
-        // string if it has no name and no id.
+        // storing AutoFill data.  This is either the field name or its id, an
+        // empty string if it has no name and no id.
         WEBKIT_API WebString nameForAutofill() const;
+
+#if WEBKIT_IMPLEMENTATION
+        WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
+        WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
+        operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const;
+#endif
     };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h
index 983aa2a..2ac7475 100644
--- a/WebKit/chromium/public/WebInputEvent.h
+++ b/WebKit/chromium/public/WebInputEvent.h
@@ -32,6 +32,7 @@
 #define WebInputEvent_h
 
 #include "WebCommon.h"
+#include "WebTouchPoint.h"
 
 #include <string.h>
 
@@ -96,7 +97,13 @@
         RawKeyDown,
         KeyDown,
         KeyUp,
-        Char
+        Char,
+
+        // WebTouchEvent
+        TouchStart,
+        TouchMove,
+        TouchEnd,
+        TouchCancel,
     };
 
     enum Modifiers {
@@ -121,6 +128,16 @@
     int modifiers;
     double timeStampSeconds;   // Seconds since epoch.
 
+    // Returns true if the WebInputEvent |type| is a mouse event.
+    static bool isMouseEventType(int type)
+    {
+        return type == MouseDown
+            || type == MouseUp
+            || type == MouseMove
+            || type == MouseEnter
+            || type == MouseLeave;
+    }
+
     // Returns true if the WebInputEvent |type| is a keyboard event.
     static bool isKeyboardEventType(int type)
     {
@@ -129,6 +146,15 @@
             || type == KeyUp
             || type == Char;
     }
+
+    // Returns true if the WebInputEvent |type| is a touch event.
+    static bool isTouchEventType(int type)
+    {
+        return type == TouchStart
+            || type == TouchMove
+            || type == TouchEnd
+            || type == TouchCancel;
+    }
 };
 
 // WebKeyboardEvent -----------------------------------------------------------
@@ -255,6 +281,22 @@
     }
 };
 
+// WebTouchEvent --------------------------------------------------------------
+
+class WebTouchEvent : public WebInputEvent {
+public:
+    static const int touchPointsLengthCap = 4;
+
+    int touchPointsLength;
+    WebTouchPoint touchPoints[touchPointsLengthCap];
+
+    WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent))
+        : WebInputEvent(sizeParam)
+        , touchPointsLength(0)
+    {
+    }
+};
+
 } // namespace WebKit
 
 #endif
diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h
index c5a04b2..38b131d 100644
--- a/WebKit/chromium/public/WebKitClient.h
+++ b/WebKit/chromium/public/WebKitClient.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -36,7 +36,6 @@
 #include "WebLocalizedString.h"
 #include "WebString.h"
 #include "WebURL.h"
-#include "WebVector.h"
 
 #include <time.h>
 
@@ -50,6 +49,9 @@
 class WebApplicationCacheHostClient;
 class WebClipboard;
 class WebCookieJar;
+class WebGLES2Context;
+class WebGraphicsContext3D;
+class WebIndexedDatabase;
 class WebMessagePortChannel;
 class WebMimeRegistry;
 class WebPluginListBuilder;
@@ -59,8 +61,6 @@
 class WebStorageNamespace;
 class WebThemeEngine;
 class WebURLLoader;
-struct WebCookie;
-template <typename T> class WebVector;
 
 class WebKitClient {
 public:
@@ -80,12 +80,6 @@
     virtual WebCookieJar* cookieJar() { return 0; }
 
 
-    // Application Cache --------------------------------------------
-
-    // May return null if the process type doesn't involve appcaching.
-    virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) { return 0; }
-
-
     // DOM Storage --------------------------------------------------
 
     // Return a LocalStorage namespace that corresponds to the following path.
@@ -109,7 +103,7 @@
     virtual bool deleteFile(const WebString& path) { return false; }
     virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
     virtual bool getFileSize(const WebString& path, long long& result) { return false; }
-    virtual bool getFileModificationTime(const WebString& path, time_t& result) { return false; }
+    virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
     virtual WebString directoryName(const WebString& path) { return WebString(); }
     virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); }
     virtual bool makeAllDirectories(const WebString& path) { return false; }
@@ -130,7 +124,7 @@
     virtual bool isLinkVisited(unsigned long long linkHash) { return false; }
 
 
-    // Database ------------------------------------------------------------
+    // HTML5 Database ------------------------------------------------------
 
 #ifdef WIN32
     typedef HANDLE FileHandle;
@@ -153,6 +147,11 @@
     virtual long long databaseGetFileSize(const WebString& vfsFileName) { return 0; }
 
 
+    // Indexed Database ----------------------------------------------------
+
+    virtual WebIndexedDatabase* indexedDatabase() { return 0; }
+
+
     // Keygen --------------------------------------------------------------
 
     // Handle the <keygen> tag for generating client certificates
@@ -181,13 +180,6 @@
 
     // Network -------------------------------------------------------------
 
-    // These cookie methods are DEPRECATED in favor of cookieJar accessor.
-    virtual void setCookies(const WebURL&, const WebURL& firstPartyForCookies, const WebString& cookies) { }
-    virtual WebString cookies(const WebURL&, const WebURL& firstPartyForCookies) { return WebString(); }
-    virtual bool rawCookies(const WebURL&, const WebURL& firstPartyForCookies, WebVector<WebCookie>*) { return false; }
-    virtual void deleteCookie(const WebURL&, const WebString& cookieName) { }
-    virtual bool cookiesEnabled(const WebURL&, const WebURL& firstPartyForCookies) { return true; }
-
     // A suggestion to prefetch IP information for the given hostname.
     virtual void prefetchHostName(const WebString&) { }
 
@@ -273,6 +265,18 @@
     // Callable from a background WebKit thread.
     virtual void callOnMainThread(void (*func)()) { }
 
+    // WebGL --------------------------------------------------------------
+
+    // May return null if WebGL is not supported.
+    // Returns newly allocated WebGraphicsContext3D instance.
+    virtual WebGraphicsContext3D* createGraphicsContext3D() { return 0; }
+
+    // GLES2  --------------------------------------------------------------
+
+    // Returns newly allocated WebGLES2Context instance.
+    // May return null if it fails to create the context.
+    virtual WebGLES2Context* createGLES2Context() { return 0; }
+
 protected:
     ~WebKitClient() { }
 };
diff --git a/WebKit/chromium/public/WebLabelElement.h b/WebKit/chromium/public/WebLabelElement.h
new file mode 100644
index 0000000..3e97c39
--- /dev/null
+++ b/WebKit/chromium/public/WebLabelElement.h
@@ -0,0 +1,68 @@
+/*
+ * 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 WebLabelElement_h
+#define WebLabelElement_h
+
+#include "WebElement.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class HTMLLabelElement; }
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+
+// Provides readonly access to some properties of a DOM label element node.
+class WebLabelElement : public WebElement {
+public:
+    WebLabelElement() : WebElement() { }
+    WebLabelElement(const WebLabelElement& e) : WebElement(e) { }
+
+    WebLabelElement& operator=(const WebLabelElement& e)
+    {
+        WebElement::assign(e);
+        return *this;
+    }
+
+    WEBKIT_API void assign(const WebLabelElement& e) { WebElement::assign(e); }
+
+    WEBKIT_API WebElement correspondingControl();
+
+#if WEBKIT_IMPLEMENTATION
+    WebLabelElement(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&);
+    WebLabelElement& operator=(const WTF::PassRefPtr<WebCore::HTMLLabelElement>&);
+    operator WTF::PassRefPtr<WebCore::HTMLLabelElement>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebMediaPlayerAction.h b/WebKit/chromium/public/WebMediaPlayerAction.h
index 3aede25..192704f 100644
--- a/WebKit/chromium/public/WebMediaPlayerAction.h
+++ b/WebKit/chromium/public/WebMediaPlayerAction.h
@@ -38,7 +38,8 @@
         Unknown,
         Play,
         Mute,
-        Loop
+        Loop,
+        Controls
     };
 
     Type type;
diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h
index 4d2a0e9..5a87da0 100644
--- a/WebKit/chromium/public/WebNode.h
+++ b/WebKit/chromium/public/WebNode.h
@@ -32,12 +32,10 @@
 #define WebNode_h
 
 #include "WebCommon.h"
+#include "WebPrivatePtr.h"
 #include "WebString.h"
 
 namespace WebCore { class Node; }
-#if WEBKIT_IMPLEMENTATION
-namespace WTF { template <typename T> class PassRefPtr; }
-#endif
 
 namespace WebKit {
 class WebDocument;
@@ -51,8 +49,8 @@
 public:
     virtual ~WebNode() { reset(); }
 
-    WebNode() : m_private(0) { }
-    WebNode(const WebNode& n) : m_private(0) { assign(n); }
+    WebNode() { }
+    WebNode(const WebNode& n) { assign(n); }
     WebNode& operator=(const WebNode& n)
     {
         assign(n);
@@ -62,13 +60,9 @@
     WEBKIT_API void reset();
     WEBKIT_API void assign(const WebNode&);
 
-    bool isNull() const { return !m_private; }
+    WEBKIT_API bool equals(const WebNode&) const;
 
-#if WEBKIT_IMPLEMENTATION
-    WebNode(const WTF::PassRefPtr<WebCore::Node>&);
-    WebNode& operator=(const WTF::PassRefPtr<WebCore::Node>&);
-    operator WTF::PassRefPtr<WebCore::Node>() const;
-#endif
+    bool isNull() const { return m_private.isNull(); }
 
     enum NodeType {
         ElementNode = 1,
@@ -104,7 +98,10 @@
     WEBKIT_API bool isElementNode() const;
     WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture);
     WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture);
+    WEBKIT_API void simulateClick();
+    WEBKIT_API WebNodeList getElementsByTagName(const WebString&) const;
 
+    // Deprecated. Use to() instead.
     template<typename T> T toElement()
     {
         T res;
@@ -112,6 +109,7 @@
         return res;
     }
 
+    // Deprecated. Use toConst() instead.
     template<typename T> const T toConstElement() const
     {
         T res;
@@ -119,22 +117,52 @@
         return res;
     }
 
+    template<typename T> T to()
+    {
+        T res;
+        res.WebNode::assign(*this);
+        return res;
+    }
+
+    template<typename T> const T toConst() const
+    {
+        T res;
+        res.WebNode::assign(*this);
+        return res;
+    }
+
+#if WEBKIT_IMPLEMENTATION
+    WebNode(const WTF::PassRefPtr<WebCore::Node>&);
+    WebNode& operator=(const WTF::PassRefPtr<WebCore::Node>&);
+    operator WTF::PassRefPtr<WebCore::Node>() const;
+#endif
+
 protected:
-    typedef WebCore::Node WebNodePrivate;
-    void assign(WebNodePrivate*);
-    WebNodePrivate* m_private;
-    
+#if WEBKIT_IMPLEMENTATION
     template<typename T> T* unwrap()
     {
-        return static_cast<T*>(m_private);
+        return static_cast<T*>(m_private.get());
     }
 
     template<typename T> const T* constUnwrap() const
     {
-        return static_cast<const T*>(m_private);
+        return static_cast<const T*>(m_private.get());
     }
+#endif
+
+    WebPrivatePtr<WebCore::Node> m_private;
 };
 
+inline bool operator==(const WebNode& a, const WebNode& b)
+{
+    return a.equals(b);
+}
+
+inline bool operator!=(const WebNode& a, const WebNode& b)
+{
+    return !(a == b);
+}
+
 } // namespace WebKit
 
 #endif
diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h
index 1a41252..9d64e2a 100644
--- a/WebKit/chromium/public/WebNotification.h
+++ b/WebKit/chromium/public/WebNotification.h
@@ -71,8 +71,7 @@
     // If HTML, the URL which contains the contents of the notification.
     WEBKIT_API WebURL url() const;
 
-    // If not HTML, the parameters for the icon-title-text notification.
-    WEBKIT_API WebString icon() const;
+    WEBKIT_API WebURL iconURL() const;
     WEBKIT_API WebString title() const;
     WEBKIT_API WebString body() const;
 
diff --git a/WebKit/chromium/public/WebNotificationPresenter.h b/WebKit/chromium/public/WebNotificationPresenter.h
index a3764aa..9fb7e6e 100644
--- a/WebKit/chromium/public/WebNotificationPresenter.h
+++ b/WebKit/chromium/public/WebNotificationPresenter.h
@@ -31,13 +31,14 @@
 #ifndef WebNotificationPresenter_h
 #define WebNotificationPresenter_h
 
+#include "WebNotificationPermissionCallback.h"
+#include "WebSecurityOrigin.h"
 #include "WebString.h"
 
 namespace WebKit {
 
 class WebDocument;
 class WebNotification;
-class WebNotificationPermissionCallback;
 class WebURL;
 
 // Provides the services to show desktop notifications to the user.
@@ -59,14 +60,13 @@
     // being destroyed.  Does _not_ remove the notification if being shown, but detaches it from receiving events.
     virtual void objectDestroyed(const WebNotification&) = 0;
 
-    // Checks the permission level for the given URL. If the URL is being displayed in a document
-    // (as opposed to a worker or other ScriptExecutionContext), |document| will also be provided.
-    virtual Permission checkPermission(const WebURL& url, WebDocument* document) = 0;
+    // Checks the permission level for the given origin.
+    virtual Permission checkPermission(const WebURL&) = 0;
 
     // Requests permission for a given origin.  This operation is asynchronous and the callback provided
     // will be invoked when the permission decision is made.  Callback pointer must remain
     // valid until called.
-    virtual void requestPermission(const WebString& origin, WebNotificationPermissionCallback* callback) = 0;
+    virtual void requestPermission(const WebSecurityOrigin&, WebNotificationPermissionCallback*) = 0;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/public/WebPlugin.h b/WebKit/chromium/public/WebPlugin.h
index 5097265..f57c621 100644
--- a/WebKit/chromium/public/WebPlugin.h
+++ b/WebKit/chromium/public/WebPlugin.h
@@ -80,6 +80,19 @@
     virtual void didFailLoadingFrameRequest(
         const WebURL&, void* notifyData, const WebURLError&) = 0;
 
+    // Printing interface.
+    // Whether the plugin supports its own paginated print. The other print
+    // interface methods are called only if this method returns true.
+    virtual bool supportsPaginatedPrint() { return false; }
+    // Sets up printing at the given print rect and printer DPI. printableArea
+    // is in points (a point is 1/72 of an inch).Returns the number of pages to
+    // be printed at these settings.
+    virtual int printBegin(const WebRect& printableArea, int printerDPI) { return 0; }
+    // Prints the page specified by pageNumber (0-based index) into the supplied canvas.
+    virtual bool printPage(int pageNumber, WebCanvas* canvas) { return false; }
+    // Ends the print operation.
+    virtual void printEnd() { }
+
 protected:
     ~WebPlugin() { }
 };
diff --git a/WebKit/chromium/public/WebPluginDocument.h b/WebKit/chromium/public/WebPluginDocument.h
new file mode 100644
index 0000000..b772cf7
--- /dev/null
+++ b/WebKit/chromium/public/WebPluginDocument.h
@@ -0,0 +1,67 @@
+/*
+ * 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 WebPluginDocument_h
+#define WebPluginDocument_h
+
+#include "WebDocument.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class PluginDocument; }
+#endif
+
+namespace WebKit {
+class WebPlugin;
+
+// Wraps a WebDocument for full page plugins.
+class WebPluginDocument : public WebDocument {
+public:
+    WebPluginDocument() { }
+    WebPluginDocument(const WebPluginDocument& e) : WebDocument(e) { }
+
+    WebPluginDocument& operator=(const WebPluginDocument& e)
+    {
+        WebNode::assign(e);
+        return *this;
+    }
+    void assign(const WebPluginDocument& d) { WebNode::assign(d); }
+
+    WEBKIT_API WebPlugin* plugin();
+
+#if WEBKIT_IMPLEMENTATION
+    WebPluginDocument(const WTF::PassRefPtr<WebCore::PluginDocument>&);
+    WebPluginDocument& operator=(const WTF::PassRefPtr<WebCore::PluginDocument>&);
+    operator WTF::PassRefPtr<WebCore::PluginDocument>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebPoint.h b/WebKit/chromium/public/WebPoint.h
index d1abe02..20c52c2 100644
--- a/WebKit/chromium/public/WebPoint.h
+++ b/WebKit/chromium/public/WebPoint.h
@@ -36,7 +36,7 @@
 #if WEBKIT_IMPLEMENTATION
 #include "IntPoint.h"
 #else
-#include <base/gfx/rect.h>
+#include <gfx/point.h>
 #endif
 
 namespace WebKit {
diff --git a/WebKit/chromium/public/WebPopupMenuInfo.h b/WebKit/chromium/public/WebPopupMenuInfo.h
index 876842d..7eb132e 100644
--- a/WebKit/chromium/public/WebPopupMenuInfo.h
+++ b/WebKit/chromium/public/WebPopupMenuInfo.h
@@ -41,6 +41,7 @@
     // FIXME: migrate clients to WebMenuItemInfo and remove this temporary Item typedef.
     typedef WebMenuItemInfo Item;
     int itemHeight;
+    int itemFontSize;
     int selectedIndex;
     WebVector<WebMenuItemInfo> items;
 };
diff --git a/WebKit/chromium/public/WebPopupType.h b/WebKit/chromium/public/WebPopupType.h
new file mode 100644
index 0000000..8a546ba
--- /dev/null
+++ b/WebKit/chromium/public/WebPopupType.h
@@ -0,0 +1,44 @@
+/*
+ * 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 WebPopupType_h
+#define WebPopupType_h
+
+namespace WebKit {
+
+enum WebPopupType {
+    WebPopupTypeNone, // Not a popup.
+    WebPopupTypeSelect, // A HTML select (combo-box) popup.
+    WebPopupTypeSuggestion, // An autofill/autocomplete popup.
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebPrivatePtr.h b/WebKit/chromium/public/WebPrivatePtr.h
new file mode 100644
index 0000000..48ad7f2
--- /dev/null
+++ b/WebKit/chromium/public/WebPrivatePtr.h
@@ -0,0 +1,105 @@
+/*
+ * 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 WebPrivatePtr_h
+#define WebPrivatePtr_h
+
+#if WEBKIT_IMPLEMENTATION
+#include <wtf/PassRefPtr.h>
+#endif
+
+namespace WebKit {
+
+// This class is an implementation detail of the WebKit API.  It exists
+// to help simplify the implementation of WebKit interfaces that merely
+// wrap a reference counted WebCore class.
+template <typename T>
+class WebPrivatePtr {
+public:
+    WebPrivatePtr() : m_ptr(0) { }
+    ~WebPrivatePtr() { WEBKIT_ASSERT(!m_ptr); }
+
+    bool isNull() const { return !m_ptr; }
+
+#if WEBKIT_IMPLEMENTATION
+    WebPrivatePtr(const PassRefPtr<T>& prp)
+        : m_ptr(prp.releaseRef())
+    {
+    }
+
+    void reset()
+    {
+        assign(0);
+    }
+
+    WebPrivatePtr<T>& operator=(const WebPrivatePtr<T>& other)
+    {
+        T* p = other.m_ptr;
+        if (p)
+            p->ref();
+        assign(p);
+        return *this;
+    }
+
+    WebPrivatePtr<T>& operator=(const PassRefPtr<T>& prp)
+    {
+        assign(prp.releaseRef());
+        return *this;
+    }
+
+    T* get() const
+    {
+        return m_ptr;
+    }
+
+    T* operator->() const
+    {
+        ASSERT(m_ptr);
+        return m_ptr;
+    }
+#endif
+
+private:
+#if WEBKIT_IMPLEMENTATION
+    void assign(T* p)
+    {
+        // p is already ref'd for us by the caller
+        if (m_ptr)
+            m_ptr->deref();
+        m_ptr = p;
+    }
+#endif
+
+    T* m_ptr;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebRect.h b/WebKit/chromium/public/WebRect.h
index ed5a7d1..30381d7 100644
--- a/WebKit/chromium/public/WebRect.h
+++ b/WebKit/chromium/public/WebRect.h
@@ -36,7 +36,7 @@
 #if WEBKIT_IMPLEMENTATION
 #include "IntRect.h"
 #else
-#include <base/gfx/rect.h>
+#include <gfx/rect.h>
 #endif
 
 namespace WebKit {
diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h
index 04f88c9..40a5952 100644
--- a/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -68,6 +68,12 @@
     WEBKIT_API static void enableIndexedDatabase(bool);
     WEBKIT_API static bool isIndexedDatabaseEnabled();
 
+    WEBKIT_API static void enableWebGL(bool);
+    WEBKIT_API static bool isWebGLEnabled();
+
+    WEBKIT_API static void enablePushState(bool);
+    WEBKIT_API static bool isPushStateEnabled(bool);
+
 private:
     WebRuntimeFeatures();
 };
diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h
index 1285b10..76012a1 100644
--- a/WebKit/chromium/public/WebSecurityOrigin.h
+++ b/WebKit/chromium/public/WebSecurityOrigin.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -42,6 +42,7 @@
 
 class WebSecurityOriginPrivate;
 class WebString;
+class WebURL;
 
 class WebSecurityOrigin {
 public:
@@ -55,9 +56,9 @@
         return *this;
     }
 
-    // FIXME: This should return a WebSecurityOrigin, not a pointer to one.
-    WEBKIT_API static WebSecurityOrigin* createFromDatabaseIdentifier(const WebString& databaseIdentifier);
+    WEBKIT_API static WebSecurityOrigin createFromDatabaseIdentifier(const WebString& databaseIdentifier);
     WEBKIT_API static WebSecurityOrigin createFromString(const WebString&);
+    WEBKIT_API static WebSecurityOrigin create(const WebURL&);
 
     WEBKIT_API void reset();
     WEBKIT_API void assign(const WebSecurityOrigin&);
@@ -71,6 +72,17 @@
     // The empty WebSecurityOrigin is the least privileged WebSecurityOrigin.
     WEBKIT_API bool isEmpty() const;
 
+    // Returns true if this WebSecurityOrigin can script objects in the given
+    // SecurityOrigin. For example, call this function before allowing
+    // script from one security origin to read or write objects from
+    // another SecurityOrigin.
+    WEBKIT_API bool canAccess(const WebSecurityOrigin&) const;
+
+    // Returns true if this WebSecurityOrigin can read content retrieved from
+    // the given URL. For example, call this function before allowing script
+    // from a given security origin to receive contents from a given URL.
+    WEBKIT_API bool canRequest(const WebURL&) const;
+
     // Returns a string representation of the WebSecurityOrigin.  The empty
     // WebSecurityOrigin is represented by "null".  The representation of a
     // non-empty WebSecurityOrigin resembles a standard URL.
diff --git a/WebKit/chromium/public/WebSecurityPolicy.h b/WebKit/chromium/public/WebSecurityPolicy.h
index 8e1ee52..815f471 100644
--- a/WebKit/chromium/public/WebSecurityPolicy.h
+++ b/WebKit/chromium/public/WebSecurityPolicy.h
@@ -50,6 +50,10 @@
     // any other URL scheme.
     WEBKIT_API static void registerURLSchemeAsNoAccess(const WebString&);
 
+    // Registers a URL scheme to not generate mixed content warnings when
+    // included by an HTTPS page.
+    WEBKIT_API static void registerURLSchemeAsSecure(const WebString&);
+
     // Support for whitelisting access to origins beyond the same-origin policy.
     WEBKIT_API static void whiteListAccessFromOrigin(
         const WebURL& sourceOrigin, const WebString& destinationProtocol,
diff --git a/WebKit/chromium/public/WebSelectElement.h b/WebKit/chromium/public/WebSelectElement.h
new file mode 100644
index 0000000..7bd755b
--- /dev/null
+++ b/WebKit/chromium/public/WebSelectElement.h
@@ -0,0 +1,63 @@
+/*
+ * 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 WebSelectElement_h
+#define WebSelectElement_h
+
+#include "WebFormControlElement.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class HTMLSelectElement; }
+#endif
+
+namespace WebKit {
+
+// Provides readonly access to some properties of a DOM select element node.
+class WebSelectElement : public WebFormControlElement {
+public:
+    WebSelectElement() : WebFormControlElement() { }
+    WebSelectElement(const WebSelectElement& e) : WebFormControlElement(e) { }
+
+    WebSelectElement& operator=(const WebSelectElement& e) { WebFormControlElement::assign(e); return *this; }
+    WEBKIT_API void assign(const WebSelectElement& e) { WebFormControlElement::assign(e); }
+
+    WEBKIT_API void setValue(const WebString&);
+    WEBKIT_API WebString value();
+
+#if WEBKIT_IMPLEMENTATION
+    WebSelectElement(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&);
+    WebSelectElement& operator=(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&);
+    operator WTF::PassRefPtr<WebCore::HTMLSelectElement>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSerializedScriptValue.h b/WebKit/chromium/public/WebSerializedScriptValue.h
new file mode 100644
index 0000000..dbcb92a
--- /dev/null
+++ b/WebKit/chromium/public/WebSerializedScriptValue.h
@@ -0,0 +1,76 @@
+/*
+ * 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 WebSerializedScriptValue_h
+#define WebSerializedScriptValue_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore { class SerializedScriptValue; }
+
+namespace WebKit {
+class WebString;
+
+class WebSerializedScriptValue {
+public:
+    ~WebSerializedScriptValue() { reset(); }
+
+    WebSerializedScriptValue() { }
+    WebSerializedScriptValue(const WebSerializedScriptValue& d) { assign(d); }
+    WebSerializedScriptValue& operator=(const WebSerializedScriptValue& d)
+    {
+        assign(d);
+        return *this;
+    }
+
+    WEBKIT_API static WebSerializedScriptValue fromString(const WebString&);
+
+    WEBKIT_API void reset();
+    WEBKIT_API void assign(const WebSerializedScriptValue&);
+
+    bool isNull() const { return m_private.isNull(); }
+
+    // Returns a string representation of the WebSerializedScriptValue.
+    WEBKIT_API WebString toString() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebSerializedScriptValue(const WTF::PassRefPtr<WebCore::SerializedScriptValue>&);
+    WebSerializedScriptValue& operator=(const WTF::PassRefPtr<WebCore::SerializedScriptValue>&);
+    operator WTF::PassRefPtr<WebCore::SerializedScriptValue>() const;
+#endif
+
+private:
+    WebPrivatePtr<WebCore::SerializedScriptValue> m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h
index d3a91d3..6339ded 100644
--- a/WebKit/chromium/public/WebSettings.h
+++ b/WebKit/chromium/public/WebSettings.h
@@ -69,6 +69,7 @@
     virtual void setJavaEnabled(bool) = 0;
     virtual void setAllowScriptsToCloseWindows(bool) = 0;
     virtual void setUserStyleSheetLocation(const WebURL&) = 0;
+    virtual void setAuthorAndUserStylesEnabled(bool) = 0;
     virtual void setUsesPageCache(bool) = 0;
     virtual void setDownloadableBinaryFontsEnabled(bool) = 0;
     virtual void setXSSAuditorEnabled(bool) = 0;
@@ -76,13 +77,11 @@
     virtual void setEditableLinkBehaviorNeverLive() = 0;
     virtual void setFontRenderingModeNormal() = 0;
     virtual void setShouldPaintCustomScrollbars(bool) = 0;
-    virtual void setDatabasesEnabled(bool) = 0;
     virtual void setAllowUniversalAccessFromFileURLs(bool) = 0;
     virtual void setAllowFileAccessFromFileURLs(bool) = 0;
     virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() = 0;
     virtual void setOfflineWebApplicationCacheEnabled(bool) = 0;
     virtual void setExperimentalWebGLEnabled(bool) = 0;
-    virtual void setGeolocationEnabled(bool) = 0;
     virtual void setShowDebugBorders(bool) = 0;
 
 protected:
diff --git a/WebKit/chromium/public/WebSize.h b/WebKit/chromium/public/WebSize.h
index bb88633..a7159b2 100644
--- a/WebKit/chromium/public/WebSize.h
+++ b/WebKit/chromium/public/WebSize.h
@@ -36,7 +36,7 @@
 #if WEBKIT_IMPLEMENTATION
 #include "IntSize.h"
 #else
-#include <base/gfx/rect.h>
+#include <gfx/size.h>
 #endif
 
 namespace WebKit {
diff --git a/WebKit/chromium/public/WebStorageArea.h b/WebKit/chromium/public/WebStorageArea.h
index 5e2c11c..86f708c 100644
--- a/WebKit/chromium/public/WebStorageArea.h
+++ b/WebKit/chromium/public/WebStorageArea.h
@@ -36,6 +36,7 @@
 
 namespace WebKit {
 
+class WebFrame;
 class WebURL;
 
 // In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This
@@ -66,18 +67,14 @@
     // Set the value that corresponds to a specific key. Result will either be ResultOK
     // or some particular error. The value is NOT set when there's an error.  url is the
     // url that should be used if a storage event fires.
-    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue)
+    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue, WebFrame*)
     {
-        bool quotaException = false;
-        setItem(key, newValue, url, quotaException, oldValue);
-        result = quotaException ? ResultBlockedByQuota : ResultOK;
+        setItem(key, newValue, url, result, oldValue);
     }
     // FIXME: Remove soon (once Chrome has rolled past this revision).
-    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException, WebString& oldValue)
+    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue)
     {
-        Result result;
-        setItem(key, newValue, url, result, oldValue);
-        quotaException = result != ResultOK;
+        setItem(key, newValue, url, result, oldValue, 0);
     }
 
     // Remove the value associated with a particular key.  url is the url that should be used
diff --git a/WebKit/chromium/public/WebTouchPoint.h b/WebKit/chromium/public/WebTouchPoint.h
new file mode 100644
index 0000000..ddfa26f
--- /dev/null
+++ b/WebKit/chromium/public/WebTouchPoint.h
@@ -0,0 +1,62 @@
+/*
+ * 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 WebTouchPoint_h
+#define WebTouchPoint_h
+
+#include "WebCommon.h"
+#include "WebPoint.h"
+
+namespace WebKit {
+
+class WebTouchPoint {
+public:
+    WebTouchPoint()
+        : id(0)
+        , state(StateUndefined) { }
+
+    enum State {
+        StateUndefined,
+        StateReleased,
+        StatePressed,
+        StateMoved,
+        StateStationary,
+        StateCancelled,
+    };
+
+    int id;
+    State state;
+    WebPoint screenPosition;
+    WebPoint position;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h
index 1dac069..3acacf8 100644
--- a/WebKit/chromium/public/WebURLResponse.h
+++ b/WebKit/chromium/public/WebURLResponse.h
@@ -123,6 +123,10 @@
     WEBKIT_API bool wasFetchedViaSPDY() const;
     WEBKIT_API void setWasFetchedViaSPDY(bool);
 
+    // Flag whether this request is part of a multipart response.
+    WEBKIT_API bool isMultipartPayload() const;
+    WEBKIT_API void setIsMultipartPayload(bool);
+
 protected:
     void assign(WebURLResponsePrivate*);
 
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index 99125d4..5a043f2 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -283,6 +283,7 @@
     // User scripts --------------------------------------------------------
     virtual void addUserScript(const WebString& sourceCode,
                                bool runAtStart) = 0;
+    virtual void addUserStyleSheet(const WebString& sourceCode) = 0;
     virtual void removeAllUserContent() = 0;
 
     // Modal dialog support ------------------------------------------------
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index a2de115..c2a96dc 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -35,6 +35,7 @@
 #include "WebEditingAction.h"
 #include "WebFileChooserCompletion.h"
 #include "WebFileChooserParams.h"
+#include "WebPopupType.h"
 #include "WebString.h"
 #include "WebTextAffinity.h"
 #include "WebTextDirection.h"
@@ -46,7 +47,8 @@
 class WebDragData;
 class WebFileChooserCompletion;
 class WebFrame;
-class WebGeolocationServiceInterface;
+class WebGeolocationService;
+class WebImage;
 class WebNode;
 class WebNotificationPresenter;
 class WebRange;
@@ -73,8 +75,12 @@
 
     // Create a new WebPopupMenu.  In the second form, the client is
     // responsible for rendering the contents of the popup menu.
-    virtual WebWidget* createPopupMenu(bool activatable) { return 0; }
+    virtual WebWidget* createPopupMenu(WebPopupType) { return 0; }
     virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; }
+    // Deprecated methods.
+    virtual WebWidget* createPopupMenu() { return 0; }
+    virtual WebWidget* createPopupMenu(bool activatable) { return 0; }
+
 
     // Create a session storage namespace object associated with this WebView.
     virtual WebStorageNamespace* createSessionStorageNamespace() { return 0; }
@@ -219,7 +225,7 @@
 
     // Called when a drag-n-drop operation should begin.
     virtual void startDragging(
-        const WebPoint& from, const WebDragData&, WebDragOperationsMask) { }
+        const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint&) { }
 
     // Called to determine if drag-n-drop operations may initiate a page
     // navigation.
@@ -278,10 +284,17 @@
     virtual void removeAutofillSuggestions(const WebString& name,
                                            const WebString& value) { }
 
+    // Informs the browser that the user has selected an AutoFill suggestion
+    // for a WebNode.  |name| and |label| form a key into the set of AutoFill
+    // profiles.
+    virtual void didAcceptAutoFillSuggestion(const WebNode&,
+                                             const WebString& name,
+                                             const WebString& label) { }
+
     // Geolocation ---------------------------------------------------------
 
     // Access the embedder API for geolocation services.
-    virtual WebKit::WebGeolocationServiceInterface* getGeolocationService() { return 0; }
+    virtual WebKit::WebGeolocationService* geolocationService() { return 0; }
 
 protected:
     ~WebViewClient() { }
diff --git a/WebKit/chromium/public/gtk/WebFontInfo.h b/WebKit/chromium/public/gtk/WebFontInfo.h
index ad37680..fae792d 100644
--- a/WebKit/chromium/public/gtk/WebFontInfo.h
+++ b/WebKit/chromium/public/gtk/WebFontInfo.h
@@ -32,6 +32,7 @@
 #define WebFontInfo_h
 
 #include "../WebCString.h"
+#include "../linux/WebFontRenderStyle.h"
 
 #include <string.h>
 #include <unistd.h>
@@ -48,6 +49,19 @@
     // Returns: the font family or an empty string if the request could not be
     // satisfied.
     WEBKIT_API static WebCString familyForChars(const WebUChar* characters, size_t numCharacters);
+
+    // Fill out the given WebFontRenderStyle with the user's preferences for
+    // rendering the given font at the given size.
+    //   family: i.e. "Times New Roman"
+    //   sizeAndStyle:
+    //      3322222222221111111111
+    //      10987654321098765432109876543210
+    //     +--------------------------------+
+    //     |..............Size............IB|
+    //     +--------------------------------+
+    //     I: italic flag
+    //     B: bold flag
+    WEBKIT_API static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result);
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/public/linux/WebFontRenderStyle.h b/WebKit/chromium/public/linux/WebFontRenderStyle.h
new file mode 100644
index 0000000..a3b180f
--- /dev/null
+++ b/WebKit/chromium/public/linux/WebFontRenderStyle.h
@@ -0,0 +1,62 @@
+/*
+ * 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 WebFontRenderStyle_h
+#define WebFontRenderStyle_h
+
+#include "../WebCommon.h"
+
+namespace WebCore { struct FontRenderStyle; }
+
+namespace WebKit {
+
+struct WebFontRenderStyle {
+    // Each of the use* members below can take one of three values:
+    //   0: off
+    //   1: on
+    //   2: no preference expressed
+    char useBitmaps; // use embedded bitmap strike if possible
+    char useAutoHint; // use 'auto' hinting (FreeType specific)
+    char useHinting; // hint glyphs to the pixel grid
+    char hintStyle; // level of hinting, 0..3
+    char useAntiAlias; // antialias glyph shapes
+    char useSubpixel; // use subpixel antialias
+
+#ifdef WEBKIT_IMPLEMENTATION
+    // Translates the members of this struct to a FontRenderStyle
+    void toFontRenderStyle(WebCore::FontRenderStyle*);
+#endif
+
+    void setDefaults();
+};
+
+} // namespace WebKit
+
+#endif // WebFontRenderStyle_h
diff --git a/WebKit/chromium/public/linux/WebSandboxSupport.h b/WebKit/chromium/public/linux/WebSandboxSupport.h
index 5edceb2..6990abe 100644
--- a/WebKit/chromium/public/linux/WebSandboxSupport.h
+++ b/WebKit/chromium/public/linux/WebSandboxSupport.h
@@ -36,6 +36,8 @@
 
 namespace WebKit {
 
+struct WebFontRenderStyle;
+
 // Put methods here that are required due to sandbox restrictions.
 class WebSandboxSupport {
 public:
@@ -49,6 +51,7 @@
     // Returns a string with the font family on an empty string if the
     // request cannot be satisfied.
     virtual WebString getFontFamilyForCharacters(const WebUChar* characters, size_t numCharacters) = 0;
+    virtual void getRenderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* style) = 0;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/ApplicationCacheHostInternal.h b/WebKit/chromium/src/ApplicationCacheHostInternal.h
index 3e52c1b..bf6c4ae 100644
--- a/WebKit/chromium/src/ApplicationCacheHostInternal.h
+++ b/WebKit/chromium/src/ApplicationCacheHostInternal.h
@@ -33,7 +33,10 @@
 
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
 
+#include "DocumentLoader.h"
 #include "WebApplicationCacheHostClient.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
 #include "WebKit.h"
 #include "WebKitClient.h"
 
@@ -44,7 +47,9 @@
     ApplicationCacheHostInternal(ApplicationCacheHost* host)
         : m_innerHost(host)
     {
-        m_outerHost.set(WebKit::webKitClient()->createApplicationCacheHost(this));
+        WebKit::WebFrameImpl* webFrame = WebKit::WebFrameImpl::fromFrame(host->m_documentLoader->frame());
+        ASSERT(webFrame);
+        m_outerHost.set(webFrame->client()->createApplicationCacheHost(webFrame, this));
     }
 
     virtual void notifyEventListener(WebKit::WebApplicationCacheHost::EventID eventID)
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 8e6cab4..4f8793a 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -32,8 +32,11 @@
 #include "AutoFillPopupMenuClient.h"
 
 #include "HTMLInputElement.h"
+#include "WebNode.h"
 #include "WebString.h"
 #include "WebVector.h"
+#include "WebViewClient.h"
+#include "WebViewImpl.h"
 
 using namespace WebCore;
 
@@ -59,6 +62,19 @@
     m_labels.remove(listIndex);
 }
 
+void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
+{
+    ASSERT(listIndex >= 0 && listIndex < m_names.size());
+
+    WebViewImpl* webView = getWebView();
+    if (!webView)
+        return;
+
+    webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
+                                                   m_names[listIndex],
+                                                   m_labels[listIndex]);
+}
+
 void AutoFillPopupMenuClient::initialize(
     HTMLInputElement* textField,
     const WebVector<WebString>& names,
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h
index 1912fa3..568ce4d 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.h
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h
@@ -50,6 +50,9 @@
     virtual WebString getSuggestion(unsigned listIndex) const;
     virtual void removeSuggestionAtIndex(unsigned listIndex);
 
+    // WebCore::PopupMenuClient implementation:
+    virtual void valueChanged(unsigned listIndex, bool fireEvents = true);
+
     void initialize(WebCore::HTMLInputElement*,
                     const WebVector<WebString>& names,
                     const WebVector<WebString>& labels,
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 6e5bfc2..c7acab5 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -45,8 +45,9 @@
 #include "FrameView.h"
 #include "Geolocation.h"
 #include "GeolocationService.h"
-#include "GeolocationServiceBridgeChromium.h"
+#include "WebGeolocationService.h"
 #include "GeolocationServiceChromium.h"
+#include "GraphicsLayer.h"
 #include "HitTestResult.h"
 #include "IntRect.h"
 #include "Node.h"
@@ -67,6 +68,7 @@
 #include "WebKit.h"
 #include "WebPopupMenuImpl.h"
 #include "WebPopupMenuInfo.h"
+#include "WebPopupType.h"
 #include "WebRect.h"
 #include "WebTextDirection.h"
 #include "WebURLRequest.h"
@@ -79,6 +81,20 @@
 
 namespace WebKit {
 
+// Converts a WebCore::PopupContainerType to a WebKit::WebPopupType.
+static WebPopupType convertPopupType(PopupContainer::PopupType type)
+{
+    switch (type) {
+    case PopupContainer::Select:
+        return WebPopupTypeSelect;
+    case PopupContainer::Suggestion:
+        return WebPopupTypeSuggestion;
+    default:
+        ASSERT_NOT_REACHED();
+        return WebPopupTypeNone;
+    }
+}
+
 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
     : m_webView(webView)
     , m_toolbarsVisible(true)
@@ -86,7 +102,6 @@
     , m_scrollbarsVisible(true)
     , m_menubarVisible(true)
     , m_resizable(true)
-    , m_ignoreNextSetCursor(false)
 {
 }
 
@@ -327,7 +342,7 @@
     m_scrollbarsVisible = value;
     WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
     if (web_frame)
-        web_frame->setAllowsScrolling(value);
+        web_frame->setCanHaveScrollbars(value);
 }
 
 bool ChromeClientImpl::scrollbarsVisible()
@@ -466,15 +481,22 @@
     return result;
 }
 
-void ChromeClientImpl::repaint(
-    const IntRect& paintRect, bool contentChanged, bool immediate,
-    bool repaintContentOnly)
+void ChromeClientImpl::invalidateWindow(const IntRect&, bool)
 {
-    // Ignore spurious calls.
-    if (!contentChanged || paintRect.isEmpty())
+    notImplemented();
+}
+
+void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bool /*immediate*/)
+{
+    if (updateRect.isEmpty())
         return;
     if (m_webView->client())
-        m_webView->client()->didInvalidateRect(paintRect);
+        m_webView->client()->didInvalidateRect(updateRect);
+}
+
+void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
+{
+    invalidateContentsAndWindow(updateRect, immediate);
 }
 
 void ChromeClientImpl::scroll(
@@ -580,14 +602,13 @@
     chooserCompletion->didChooseFile(WebVector<WebString>());
 }
 
-void ChromeClientImpl::iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>)
+void ChromeClientImpl::chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*)
 {
     notImplemented();
 }
 
 void ChromeClientImpl::popupOpened(PopupContainer* popupContainer,
                                    const IntRect& bounds,
-                                   bool activatable,
                                    bool handleExternally)
 {
     if (!m_webView->client())
@@ -598,19 +619,28 @@
         WebPopupMenuInfo popupInfo;
         getPopupMenuInfo(popupContainer, &popupInfo);
         webwidget = m_webView->client()->createPopupMenu(popupInfo);
-    } else
-        webwidget = m_webView->client()->createPopupMenu(activatable);
-
+    } else {
+        webwidget = m_webView->client()->createPopupMenu(
+            convertPopupType(popupContainer->popupType()));
+        // Try the deprecated methods.
+        // FIXME: Remove the deprecated methods once the Chromium side use the
+        //        new method.
+        if (!webwidget)
+            webwidget = m_webView->client()->createPopupMenu();
+        if (!webwidget)
+            webwidget = m_webView->client()->createPopupMenu(false);
+    }
+    m_webView->popupOpened(popupContainer);
     static_cast<WebPopupMenuImpl*>(webwidget)->Init(popupContainer, bounds);
 }
 
+void ChromeClientImpl::popupClosed(WebCore::PopupContainer* popupContainer)
+{
+    m_webView->popupClosed(popupContainer);
+}
+
 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
 {
-    if (m_ignoreNextSetCursor) {
-        m_ignoreNextSetCursor = false;
-        return;
-    }
-
     if (m_webView->client())
         m_webView->client()->didChangeCursor(cursor);
 }
@@ -618,11 +648,6 @@
 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor)
 {
     setCursor(cursor);
-
-    // Currently, Widget::setCursor is always called after this function in
-    // EventHandler.cpp and since we don't want that we set a flag indicating
-    // that the next SetCursor call is to be ignored.
-    m_ignoreNextSetCursor = true;
 }
 
 void ChromeClientImpl::formStateDidChange(const Node* node)
@@ -664,6 +689,7 @@
     }
 
     info->itemHeight = popupContainer->menuItemHeight();
+    info->itemFontSize = popupContainer->menuItemFontSize();
     info->selectedIndex = popupContainer->selectedIndex();
     info->items.swap(outputItems);
 }
@@ -675,7 +701,6 @@
         m_webView->client()->didChangeAccessibilityObjectState(WebAccessibilityObject(obj));
 }
 
-
 #if ENABLE(NOTIFICATIONS)
 NotificationPresenter* ChromeClientImpl::notificationPresenter() const
 {
@@ -685,8 +710,26 @@
 
 void ChromeClientImpl::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
 {
-    GeolocationServiceChromium* geolocationService = reinterpret_cast<GeolocationServiceChromium*>(geolocation->getGeolocationService());
-    m_webView->client()->getGeolocationService()->requestPermissionForFrame(geolocationService->geolocationServiceBridge()->getBridgeId(), frame->document()->url());
+    GeolocationServiceChromium* geolocationService = static_cast<GeolocationServiceChromium*>(geolocation->getGeolocationService());
+    m_webView->client()->geolocationService()->requestPermissionForFrame(geolocationService->geolocationServiceBridge()->getBridgeId(), frame->document()->url());
 }
 
+void ChromeClientImpl::cancelGeolocationPermissionRequestForFrame(Frame* frame, Geolocation* geolocation)
+{
+    GeolocationServiceChromium* geolocationService = static_cast<GeolocationServiceChromium*>(geolocation->getGeolocationService());
+    m_webView->client()->geolocationService()->cancelPermissionRequestForFrame(geolocationService->geolocationServiceBridge()->getBridgeId(), frame->document()->url());
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
+{
+    m_webView->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->platformLayer() : 0);
+}
+
+void ChromeClientImpl::scheduleCompositingLayerSync()
+{
+    m_webView->setRootLayerNeedsDisplay();
+}
+#endif
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index 3a4035b..3b5ebd5 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -35,6 +35,7 @@
 
 namespace WebCore {
 class AccessibilityObject;
+class FileChooser;
 class HTMLParserQuirks;
 class PopupContainer;
 class SecurityOrigin;
@@ -96,9 +97,9 @@
     virtual bool shouldInterruptJavaScript();
     virtual bool tabsToLinks() const;
     virtual WebCore::IntRect windowResizerRect() const;
-    virtual void repaint(
-        const WebCore::IntRect&, bool contentChanged, bool immediate = false,
-        bool repaintContentOnly = false);
+    virtual void invalidateWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(
         const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll,
         const WebCore::IntRect& clipRect);
@@ -122,17 +123,34 @@
     virtual WebCore::NotificationPresenter* notificationPresenter() const;
 #endif
     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+    virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
-    virtual void iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>);
+    virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*);
     virtual bool setCursor(WebCore::PlatformCursorHandle) { return false; }
     virtual void formStateDidChange(const WebCore::Node*);
     virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
+#if ENABLE(TOUCH_EVENTS)
+    // FIXME: All touch events are forwarded regardless of whether or not they are needed.
+    virtual void needTouchEvents(bool needTouchEvents) { }
+#endif
 
+#if USE(ACCELERATED_COMPOSITING)
+    // Pass 0 as the GraphicsLayer to detatch the root layer.
+    virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
+
+    // Sets a flag to specify that the next time content is drawn to the window,
+    // the changes appear on the screen in synchrony with updates to GraphicsLayers.
+    virtual void setNeedsOneShotDrawingSynchronization() { }
+
+    // Sets a flag to specify that the view needs to be updated, so we need
+    // to do an eager layout before the drawing.
+    virtual void scheduleCompositingLayerSync();
+#endif
     // ChromeClientChromium methods:
     virtual void popupOpened(WebCore::PopupContainer* popupContainer,
                              const WebCore::IntRect& bounds,
-                             bool activatable,
                              bool handleExternally);
+    virtual void popupClosed(WebCore::PopupContainer* popupContainer);
     virtual void didChangeAccessibilityObjectState(WebCore::AccessibilityObject*);
 
     // ChromeClientImpl:
@@ -148,8 +166,6 @@
     bool m_scrollbarsVisible;
     bool m_menubarVisible;
     bool m_resizable;
-    // Set to true if the next SetCursor is to be ignored.
-    bool m_ignoreNextSetCursor;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index e04226e..cffd166 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -65,6 +65,7 @@
 #if OS(LINUX)
 #include "WebSandboxSupport.h"
 #include "WebFontInfo.h"
+#include "WebFontRenderStyle.h"
 #endif
 
 #if WEBKIT_USING_SKIA
@@ -74,12 +75,14 @@
 #include "BitmapImage.h"
 #include "Cookie.h"
 #include "FrameView.h"
-#include "GeolocationServiceBridgeChromium.h"
 #include "GraphicsContext.h"
+#include "IndexedDatabaseProxy.h"
 #include "KURL.h"
 #include "NotImplemented.h"
 #include "PlatformContextSkia.h"
 #include "PluginData.h"
+#include "SharedBuffer.h"
+#include "WebGeolocationServiceBridgeImpl.h"
 #include "Worker.h"
 #include "WorkerContextProxy.h"
 #include <wtf/Assertions.h>
@@ -91,6 +94,9 @@
 
 static ChromeClientImpl* toChromeClientImpl(Widget* widget)
 {
+    if (!widget)
+        return 0;
+
     FrameView* view;
     if (widget->isFrameView())
         view = static_cast<FrameView*>(widget);
@@ -192,8 +198,6 @@
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         cookieJar->setCookie(url, document->firstPartyForCookies(), value);
-    else
-        webKitClient()->setCookies(url, document->firstPartyForCookies(), value); // DEPRECATED
 }
 
 String ChromiumBridge::cookies(const Document* document, const KURL& url)
@@ -202,8 +206,6 @@
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         result = cookieJar->cookies(url, document->firstPartyForCookies());
-    else
-        result = webKitClient()->cookies(url, document->firstPartyForCookies()); // DEPRECATED
     return result;
 }
 
@@ -214,10 +216,6 @@
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         result = cookieJar->cookieRequestHeaderFieldValue(url, document->firstPartyForCookies());
-    else {
-        // FIXME: This does not return http-only cookies
-        result = webKitClient()->cookies(url, document->firstPartyForCookies()); // DEPRECATED
-    }
     return result;
 }
 
@@ -229,8 +227,6 @@
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         cookieJar->rawCookies(url, document->firstPartyForCookies(), webCookies);
-    else
-        webKitClient()->rawCookies(url, document->firstPartyForCookies(), &webCookies); // DEPRECATED
 
     for (unsigned i = 0; i < webCookies.size(); ++i) {
         const WebCookie& webCookie = webCookies[i];
@@ -252,18 +248,14 @@
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         cookieJar->deleteCookie(url, cookieName);
-    else
-        webKitClient()->deleteCookie(url, cookieName); // DEPRECATED
 }
 
 bool ChromiumBridge::cookiesEnabled(const Document* document)
 {
-    bool result;
+    bool result = false;
     WebCookieJar* cookieJar = getCookieJar(document);
     if (cookieJar)
         result = cookieJar->cookiesEnabled(document->cookieURL(), document->firstPartyForCookies());
-    else
-        result = webKitClient()->cookiesEnabled(document->cookieURL(), document->firstPartyForCookies()); // DEPRECATED
     return result;
 }
 
@@ -298,7 +290,11 @@
 
 bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result)
 {
-    return webKitClient()->getFileModificationTime(path, result);
+    double modificationTime;
+    if (!webKitClient()->getFileModificationTime(path, modificationTime))
+        return false;
+    result = static_cast<time_t>(modificationTime);
+    return true;
 }
 
 String ChromiumBridge::directoryName(const String& path)
@@ -356,6 +352,18 @@
 
     return WebString();
 }
+
+void ChromiumBridge::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result)
+{
+    WebFontRenderStyle style;
+
+    if (webKitClient()->sandboxSupport())
+        webKitClient()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
+    else
+        WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
+
+    style.toFontRenderStyle(result);
+}
 #endif
 
 // Geolocation ----------------------------------------------------------------
@@ -389,6 +397,15 @@
 }
 #endif
 
+// Indexed Database -----------------------------------------------------------
+
+PassRefPtr<IndexedDatabase> ChromiumBridge::indexedDatabase()
+{
+    // There's no reason why we need to allocate a new proxy each time, but
+    // there's also no strong reason not to.
+    return IndexedDatabaseProxy::create();
+}
+
 // Keygen ---------------------------------------------------------------------
 
 String ChromiumBridge::signedPublicKeyAndChallengeString(
diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp
index 06a29ff..bee4310 100644
--- a/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -181,6 +181,10 @@
             data.mediaFlags |= WebContextMenuData::MediaCanSave;
         if (mediaElement->hasAudio())
             data.mediaFlags |= WebContextMenuData::MediaHasAudio;
+        if (mediaElement->hasVideo())
+            data.mediaFlags |= WebContextMenuData::MediaHasVideo;
+        if (mediaElement->controls())
+            data.mediaFlags |= WebContextMenuData::MediaControls;
     }
 
     data.isImageBlocked =
@@ -188,7 +192,7 @@
 
     // If it's not a link, an image, a media element, or an image/media link,
     // show a selection menu or a more generic page menu.
-    data.frameEncoding = selectedFrame->loader()->encoding();
+    data.frameEncoding = selectedFrame->loader()->writer()->encoding();
 
     // Send the frame and page URLs in any case.
     data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame());
diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp
index 54e93e1..6a2e2a7 100644
--- a/WebKit/chromium/src/DatabaseObserver.cpp
+++ b/WebKit/chromium/src/DatabaseObserver.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -32,13 +32,35 @@
 #include "DatabaseObserver.h"
 
 #include "Database.h"
+#include "Document.h"
+#include "ScriptExecutionContext.h"
 #include "WebDatabase.h"
 #include "WebDatabaseObserver.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
+#include "WebSecurityOrigin.h"
+#include "WebWorkerImpl.h"
+#include "WorkerContext.h"
+#include "WorkerThread.h"
 
 using namespace WebKit;
 
 namespace WebCore {
 
+bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize)
+{
+    ASSERT(scriptExecutionContext->isContextThread());
+    // FIXME: add support for the case scriptExecutionContext()->isWorker() once workers implement web databases.
+    ASSERT(scriptExecutionContext->isDocument());
+    if (scriptExecutionContext->isDocument()) {
+        Document* document = static_cast<Document*>(scriptExecutionContext);
+        WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
+        return webFrame->client()->allowDatabase(webFrame, name, displayName, estimatedSize);
+    }
+
+    return true;
+}
+
 void DatabaseObserver::databaseOpened(Database* database)
 {
     ASSERT(isMainThread());
diff --git a/WebKit/chromium/src/DebuggerAgent.h b/WebKit/chromium/src/DebuggerAgent.h
index 17cde11..7f3dbbb 100644
--- a/WebKit/chromium/src/DebuggerAgent.h
+++ b/WebKit/chromium/src/DebuggerAgent.h
@@ -40,7 +40,10 @@
     METHOD0(getContextId) \
     \
     /* Request v8 to process all debug commands in the queue. */ \
-    METHOD0(processDebugCommands)
+    METHOD0(processDebugCommands) \
+    \
+    /* Push DebuggerScript.js content to the agent. */ \
+    METHOD1(setDebuggerScriptSource, String)
 
 DEFINE_RPC_CLASS(DebuggerAgent, DEBUGGER_AGENT_STRUCT)
 
diff --git a/WebKit/chromium/src/DebuggerAgentImpl.cpp b/WebKit/chromium/src/DebuggerAgentImpl.cpp
index d592710..673482a 100644
--- a/WebKit/chromium/src/DebuggerAgentImpl.cpp
+++ b/WebKit/chromium/src/DebuggerAgentImpl.cpp
@@ -35,10 +35,8 @@
 #include "Document.h"
 #include "Frame.h"
 #include "Page.h"
+#include "ScriptDebugServer.h"
 #include "V8Binding.h"
-#include "V8DOMWindow.h"
-#include "V8Index.h"
-#include "V8Proxy.h"
 #include "WebDevToolsAgentImpl.h"
 #include "WebViewImpl.h"
 #include <wtf/HashSet.h>
@@ -50,10 +48,6 @@
 using WebCore::Frame;
 using WebCore::Page;
 using WebCore::String;
-using WebCore::V8ClassIndex;
-using WebCore::V8DOMWindow;
-using WebCore::V8DOMWrapper;
-using WebCore::V8Proxy;
 
 namespace WebKit {
 
@@ -85,64 +79,17 @@
     v8::Debug::ProcessDebugMessages();
 }
 
+void DebuggerAgentImpl::setDebuggerScriptSource(const String& source)
+{
+    WebCore::ScriptDebugServer::shared().setDebuggerScriptSource(source);
+}
+
 void DebuggerAgentImpl::debuggerOutput(const String& command)
 {
     m_delegate->debuggerOutput(command);
     m_webdevtoolsAgent->forceRepaint();
 }
 
-// static
-void DebuggerAgentImpl::createUtilityContext(Frame* frame, v8::Persistent<v8::Context>* context)
-{
-    v8::HandleScope scope;
-    bool canExecuteScripts = frame->script()->canExecuteScripts();
-
-    // Set up the DOM window as the prototype of the new global object.
-    v8::Handle<v8::Context> windowContext = V8Proxy::context(frame);
-    v8::Handle<v8::Object> windowGlobal;
-    v8::Handle<v8::Object> windowWrapper;
-    if (canExecuteScripts) {
-        // FIXME: This check prevents renderer from crashing, while providing limited capabilities for
-        // DOM inspection, Resources tracking, no scripts support, some timeline profiling. Console will
-        // result in exceptions for each evaluation. There is still some work that needs to be done in
-        // order to polish the script-less experience.
-        windowGlobal = windowContext->Global();
-        windowWrapper = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), windowGlobal);
-        ASSERT(V8DOMWindow::toNative(windowWrapper) == frame->domWindow());
-    }
-
-    v8::Handle<v8::ObjectTemplate> globalTemplate = v8::ObjectTemplate::New();
-
-    // TODO(yurys): provide a function in v8 bindings that would make the
-    // utility context more like main world context of the inspected frame,
-    // otherwise we need to manually make it satisfy various invariants
-    // that V8Proxy::getEntered and some other V8Proxy methods expect to find
-    // on v8 contexts on the contexts stack.
-    // See V8Proxy::createNewContext.
-    //
-    // Install a security handler with V8.
-    globalTemplate->SetAccessCheckCallbacks(
-        V8DOMWindow::namedSecurityCheck,
-        V8DOMWindow::indexedSecurityCheck,
-        v8::Integer::New(V8ClassIndex::DOMWINDOW));
-    // We set number of internal fields to match that in V8DOMWindow wrapper.
-    // See http://crbug.com/28961
-    globalTemplate->SetInternalFieldCount(V8DOMWindow::internalFieldCount);
-
-    *context = v8::Context::New(0 /* no extensions */, globalTemplate, v8::Handle<v8::Object>());
-    v8::Context::Scope contextScope(*context);
-    v8::Handle<v8::Object> global = (*context)->Global();
-
-    v8::Handle<v8::String> implicitProtoString = v8::String::New("__proto__");
-    if (canExecuteScripts)
-        global->Set(implicitProtoString, windowWrapper);
-
-    // Give the code running in the new context a way to get access to the
-    // original context.
-    if (canExecuteScripts)
-        global->Set(v8::String::New("contentWindow"), windowGlobal);
-}
-
 String DebuggerAgentImpl::executeUtilityFunction(
     v8::Handle<v8::Context> context,
     int callId,
diff --git a/WebKit/chromium/src/DebuggerAgentImpl.h b/WebKit/chromium/src/DebuggerAgentImpl.h
index 6eaf576..bd9ddf6 100644
--- a/WebKit/chromium/src/DebuggerAgentImpl.h
+++ b/WebKit/chromium/src/DebuggerAgentImpl.h
@@ -52,9 +52,6 @@
 
 class DebuggerAgentImpl : public DebuggerAgent {
 public:
-    // Creates utility context with injected js agent.
-    static void createUtilityContext(WebCore::Frame* frame, v8::Persistent<v8::Context>* context);
-
     DebuggerAgentImpl(WebKit::WebViewImpl* webViewImpl,
                       DebuggerAgentDelegate* delegate,
                       WebDevToolsAgentImpl* webdevtoolsAgent);
@@ -63,6 +60,7 @@
     // DebuggerAgent implementation.
     virtual void getContextId();
     virtual void processDebugCommands();
+    virtual void setDebuggerScriptSource(const String&);
 
     void debuggerOutput(const WebCore::String& out);
 
diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp
index faafaff..d3f7fea 100644
--- a/WebKit/chromium/src/DebuggerAgentManager.cpp
+++ b/WebKit/chromium/src/DebuggerAgentManager.cpp
@@ -34,6 +34,7 @@
 #include "DebuggerAgentImpl.h"
 #include "Frame.h"
 #include "PageGroupLoadDeferrer.h"
+#include "ScriptDebugServer.h"
 #include "V8Proxy.h"
 #include "WebDevToolsAgentImpl.h"
 #include "WebFrameImpl.h"
@@ -72,6 +73,42 @@
 } // namespace
 
 
+void DebuggerAgentManager::hostDispatchHandler(const Vector<WebCore::Page*>& pages)
+{
+    if (!s_messageLoopDispatchHandler)
+        return;
+
+    if (s_inHostDispatchHandler)
+        return;
+
+    s_inHostDispatchHandler = true;
+
+    Vector<WebViewImpl*> views;
+    // 1. Disable active objects and input events.
+    for (size_t i = 0; i < pages.size(); i++) {
+        WebCore::Page* page = pages[i];
+        WebViewImpl* view = WebViewImpl::fromPage(page);
+        s_pageDeferrers.set(view , new WebCore::PageGroupLoadDeferrer(page, true));
+        views.append(view);
+        view->setIgnoreInputEvents(true);
+    }
+
+    // 2. Process messages.
+    s_messageLoopDispatchHandler();
+
+    // 3. Bring things back.
+    for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end(); ++it) {
+        if (s_pageDeferrers.contains(*it)) {
+            // The view was not closed during the dispatch.
+            (*it)->setIgnoreInputEvents(false);
+        }
+    }
+    deleteAllValues(s_pageDeferrers);
+    s_pageDeferrers.clear();
+
+    s_inHostDispatchHandler = false;
+}
+
 void DebuggerAgentManager::debugHostDispatchHandler()
 {
     if (!s_messageLoopDispatchHandler || !s_attachedAgentsMap)
@@ -116,6 +153,9 @@
 
 void DebuggerAgentManager::debugAttach(DebuggerAgentImpl* debuggerAgent)
 {
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    return;
+#endif
     if (!s_attachedAgentsMap) {
         s_attachedAgentsMap = new AttachedAgentsMap();
         v8::Debug::SetMessageHandler2(&DebuggerAgentManager::onV8DebugMessage);
@@ -128,6 +168,9 @@
 
 void DebuggerAgentManager::debugDetach(DebuggerAgentImpl* debuggerAgent)
 {
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    return;
+#endif
     if (!s_attachedAgentsMap) {
         ASSERT_NOT_REACHED();
         return;
@@ -249,6 +292,7 @@
 void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler)
 {
     s_messageLoopDispatchHandler = handler;
+    WebCore::ScriptDebugServer::setMessageLoopDispatchHandler(DebuggerAgentManager::hostDispatchHandler);
 }
 
 void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId)
diff --git a/WebKit/chromium/src/DebuggerAgentManager.h b/WebKit/chromium/src/DebuggerAgentManager.h
index a2e9030..a8bc7a3 100644
--- a/WebKit/chromium/src/DebuggerAgentManager.h
+++ b/WebKit/chromium/src/DebuggerAgentManager.h
@@ -31,12 +31,15 @@
 #ifndef DebuggerAgentManager_h
 #define DebuggerAgentManager_h
 
+#include "WebCString.h"
 #include "WebDevToolsAgent.h"
 #include <v8-debug.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
+class Page;
 class PageGroupLoadDeferrer;
 class String;
 }
@@ -97,6 +100,7 @@
     DebuggerAgentManager();
     ~DebuggerAgentManager();
 
+    static void hostDispatchHandler(const Vector<WebCore::Page*>&);
     static void debugHostDispatchHandler();
     static void onV8DebugMessage(const v8::Debug::Message& message);
     static void sendCommandToV8(const WebCore::String& cmd,
diff --git a/WebKit/chromium/src/DragClientImpl.cpp b/WebKit/chromium/src/DragClientImpl.cpp
index 671e7ca..9874401 100644
--- a/WebKit/chromium/src/DragClientImpl.cpp
+++ b/WebKit/chromium/src/DragClientImpl.cpp
@@ -30,11 +30,14 @@
 
 #include "config.h"
 #include "DragClientImpl.h"
-
+#include "DragImageRef.h"
 #include "ChromiumDataObject.h"
 #include "ClipboardChromium.h"
 #include "Frame.h"
+#include "NativeImageSkia.h"
+#include "WebCommon.h"
 #include "WebDragData.h"
+#include "WebImage.h"
 #include "WebViewClient.h"
 #include "WebViewImpl.h"
 
@@ -81,8 +84,16 @@
 
     DragOperation dragOperationMask = clipboard->sourceOperation();
 
+    IntSize offsetSize(eventPos - dragImageOrigin);
+    WebPoint offsetPoint(offsetSize.width(), offsetSize.height());
     m_webView->startDragging(
-        eventPos, dragData, static_cast<WebDragOperationsMask>(dragOperationMask));
+        dragData, static_cast<WebDragOperationsMask>(dragOperationMask),
+#if WEBKIT_USING_SKIA
+        dragImage ? WebImage(*dragImage) : WebImage(),
+#else
+        dragImage ? WebImage(dragImage) : WebImage(),
+#endif
+        offsetPoint);
 }
 
 DragImageRef DragClientImpl::createDragImageForLink(KURL&, const String& label, Frame*)
diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp
index cfd8ec4..4ecdcf7 100644
--- a/WebKit/chromium/src/EditorClientImpl.cpp
+++ b/WebKit/chromium/src/EditorClientImpl.cpp
@@ -413,8 +413,10 @@
     { VKEY_DOWN,   0,                  "MoveDown"                             },
     { VKEY_DOWN,   ShiftKey,           "MoveDownAndModifySelection"           },
     { VKEY_NEXT,   ShiftKey,           "MovePageDownAndModifySelection"       },
+#if !OS(DARWIN)
     { VKEY_PRIOR,  0,                  "MovePageUp"                           },
     { VKEY_NEXT,   0,                  "MovePageDown"                         },
+#endif
     { VKEY_HOME,   0,                  "MoveToBeginningOfLine"                },
     { VKEY_HOME,   ShiftKey,
         "MoveToBeginningOfLineAndModifySelection"                             },
@@ -422,6 +424,8 @@
     { VKEY_LEFT,   CommandKey,         "MoveToBeginningOfLine"                },
     { VKEY_LEFT,   CommandKey | ShiftKey,
       "MoveToBeginningOfLineAndModifySelection"                               },
+    { VKEY_PRIOR,  OptionKey,          "MovePageUp"                           },
+    { VKEY_NEXT,   OptionKey,          "MovePageDown"                         },
 #endif
 #if OS(DARWIN)
     { VKEY_UP,     CommandKey,         "MoveToBeginningOfDocument"            },
@@ -703,8 +707,9 @@
 
     // Let's try to trigger autofill for that field, if applicable.
     if (!inputElement->isEnabledFormControl() || !inputElement->isTextField()
-        || inputElement->isPasswordField()
-        || !inputElement->autoComplete())
+        || inputElement->isPasswordField() || !inputElement->autoComplete()
+        || !inputElement->isEnabledFormControl()
+        || inputElement->isReadOnlyFormControl())
         return false;
 
     WebString name = WebInputElement(inputElement).nameForAutofill();
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 8fb267d..135392b 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -32,12 +32,13 @@
 #include "FrameLoaderClientImpl.h"
 
 #include "Chrome.h"
-#include "CString.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "FormState.h"
 #include "FrameLoader.h"
 #include "FrameLoadRequest.h"
+#include "HTTPParsers.h"
+#include "HistoryItem.h"
 #include "HitTestResult.h"
 #include "HTMLAppletElement.h"
 #include "HTMLFormElement.h"  // needed by FormState.h
@@ -71,6 +72,7 @@
 #include "WindowFeatures.h"
 #include "WrappedResourceRequest.h"
 #include "WrappedResourceResponse.h"
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
@@ -180,6 +182,18 @@
     return enabledPerSettings;
 }
 
+void FrameLoaderClientImpl::didNotAllowScript()
+{
+    if (m_webFrame->client())
+        m_webFrame->client()->didNotAllowScript(m_webFrame);
+}
+
+void FrameLoaderClientImpl::didNotAllowPlugins()
+{
+    if (m_webFrame->client())
+        m_webFrame->client()->didNotAllowPlugins(m_webFrame);
+}
+
 bool FrameLoaderClientImpl::hasWebView() const
 {
     return m_webFrame->viewImpl();
@@ -392,12 +406,6 @@
     return false;  // Do not suppress remaining notifications
 }
 
-void FrameLoaderClientImpl::dispatchDidLoadResourceByXMLHttpRequest(
-    unsigned long identifier,
-    const ScriptString& source)
-{
-}
-
 void FrameLoaderClientImpl::dispatchDidHandleOnloadEvents()
 {
     if (m_webFrame->client())
@@ -556,7 +564,7 @@
     }
 }
 
-void FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage()
+void FrameLoaderClientImpl::dispatchDidNavigateWithinPage()
 {
     // Anchor fragment navigations are not normal loads, so we need to synthesize
     // some events for our delegate.
@@ -567,12 +575,17 @@
     // them for fragment redirection that happens in window.onload handler.
     // See https://bugs.webkit.org/show_bug.cgi?id=31838
     bool loaderCompleted =
-        !m_webFrame->frame()->page()->mainFrame()->loader()->isLoading();
+        !webView->page()->mainFrame()->loader()->activeDocumentLoader()->isLoadingInAPISense();
 
     // Generate didStartLoading if loader is completed.
     if (webView->client() && loaderCompleted)
         webView->client()->didStartLoading();
 
+    // We need to classify some hash changes as client redirects.
+    // FIXME: It seems wrong that the currentItem can sometimes be null.
+    HistoryItem* currentItem = m_webFrame->frame()->loader()->history()->currentItem();
+    bool isHashChange = !currentItem || !currentItem->stateObject();
+
     WebDataSourceImpl* ds = m_webFrame->dataSourceImpl();
     ASSERT(ds);  // Should not be null when navigating to a reference fragment!
     if (ds) {
@@ -583,27 +596,29 @@
             ds->clearRedirectChain();
         }
 
-        // Figure out if this location change is because of a JS-initiated
-        // client redirect (e.g onload/setTimeout document.location.href=).
-        // FIXME: (bugs 1085325, 1046841) We don't get proper redirect
-        // performed/cancelled notifications across anchor navigations, so the
-        // other redirect-tracking code in this class (see
-        // dispatch*ClientRedirect() and dispatchDidStartProvisionalLoad) is
-        // insufficient to catch and properly flag these transitions. Once a
-        // proper fix for this bug is identified and applied the following
-        // block may no longer be required.
-        bool wasClientRedirect =
-            (url == m_expectedClientRedirectDest && chainEnd == m_expectedClientRedirectSrc)
-            || !m_webFrame->isProcessingUserGesture();
+        if (isHashChange) {
+            // Figure out if this location change is because of a JS-initiated
+            // client redirect (e.g onload/setTimeout document.location.href=).
+            // FIXME: (b/1085325, b/1046841) We don't get proper redirect
+            // performed/cancelled notifications across anchor navigations, so the
+            // other redirect-tracking code in this class (see
+            // dispatch*ClientRedirect() and dispatchDidStartProvisionalLoad) is
+            // insufficient to catch and properly flag these transitions. Once a
+            // proper fix for this bug is identified and applied the following
+            // block may no longer be required.
+            bool wasClientRedirect =
+                (url == m_expectedClientRedirectDest && chainEnd == m_expectedClientRedirectSrc)
+                || !m_webFrame->isProcessingUserGesture();
 
-        if (wasClientRedirect) {
-            if (m_webFrame->client())
-                m_webFrame->client()->didCompleteClientRedirect(m_webFrame, chainEnd);
-            ds->appendRedirect(chainEnd);
-            // Make sure we clear the expected redirect since we just effectively
-            // completed it.
-            m_expectedClientRedirectSrc = KURL();
-            m_expectedClientRedirectDest = KURL();
+            if (wasClientRedirect) {
+                if (m_webFrame->client())
+                    m_webFrame->client()->didCompleteClientRedirect(m_webFrame, chainEnd);
+                ds->appendRedirect(chainEnd);
+                // Make sure we clear the expected redirect since we just effectively
+                // completed it.
+                m_expectedClientRedirectSrc = KURL();
+                m_expectedClientRedirectDest = KURL();
+            }
         }
 
         // Regardless of how we got here, we are navigating to a URL so we need to
@@ -613,27 +628,38 @@
 
     bool isNewNavigation;
     webView->didCommitLoad(&isNewNavigation);
-    if (m_webFrame->client())
-        m_webFrame->client()->didChangeLocationWithinPage(m_webFrame, isNewNavigation);
+    if (m_webFrame->client()) {
+        m_webFrame->client()->didNavigateWithinPage(m_webFrame, isNewNavigation);
+
+        // FIXME: Remove this notification once it is no longer consumed downstream.
+        if (isHashChange)
+            m_webFrame->client()->didChangeLocationWithinPage(m_webFrame, isNewNavigation);
+    }
 
     // Generate didStopLoading if loader is completed.
     if (webView->client() && loaderCompleted)
         webView->client()->didStopLoading();
 }
 
+void FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage()
+{
+    if (m_webFrame)
+        m_webFrame->client()->didChangeLocationWithinPage(m_webFrame);
+}
+
 void FrameLoaderClientImpl::dispatchDidPushStateWithinPage()
 {
-    // FIXME
+    dispatchDidNavigateWithinPage();
 }
 
 void FrameLoaderClientImpl::dispatchDidReplaceStateWithinPage()
 {
-    // FIXME
+    dispatchDidNavigateWithinPage();
 }
 
 void FrameLoaderClientImpl::dispatchDidPopStateWithinPage()
 {
-    // FIXME
+    // Ignored since dispatchDidNavigateWithinPage was already called.
 }
 
 void FrameLoaderClientImpl::dispatchWillClose()
@@ -797,38 +823,6 @@
         webView->client()->show(webView->initialNavigationPolicy());
 }
 
-static bool shouldTreatAsAttachment(const ResourceResponse& response)
-{
-    const String& contentDisposition =
-        response.httpHeaderField("Content-Disposition");
-    if (contentDisposition.isEmpty())
-        return false;
-
-    // Some broken sites just send
-    // Content-Disposition: ; filename="file"
-    // screen those out here.
-    if (contentDisposition.startsWith(";"))
-        return false;
-
-    if (contentDisposition.startsWith("inline", false))
-        return false;
-
-    // Some broken sites just send
-    // Content-Disposition: filename="file"
-    // without a disposition token... screen those out.
-    if (contentDisposition.startsWith("filename", false))
-        return false;
-
-    // Also in use is Content-Disposition: name="file"
-    if (contentDisposition.startsWith("name", false))
-        return false;
-
-    // We have a content-disposition of "attachment" or unknown.
-    // RFC 2183, section 2.8 says that an unknown disposition
-    // value should be treated as "attachment"
-    return true;
-}
-
 void FrameLoaderClientImpl::dispatchDecidePolicyForMIMEType(
      FramePolicyFunction function,
      const String& mimeType,
@@ -843,7 +837,7 @@
     if (statusCode == 204 || statusCode == 205) {
         // The server does not want us to replace the page contents.
         action = PolicyIgnore;
-    } else if (shouldTreatAsAttachment(response)) {
+    } else if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) {
         // The server wants us to download instead of replacing the page contents.
         // Downloading is handled by the embedder, but we still get the initial
         // response so that we can ignore it and clean up properly.
@@ -898,51 +892,48 @@
     // The null check here is to fix a crash that seems strange
     // (see - https://bugs.webkit.org/show_bug.cgi?id=23554).
     if (m_webFrame->client() && !request.url().isNull()) {
-      WebNavigationPolicy navigationPolicy = WebNavigationPolicyCurrentTab;
-      actionSpecifiesNavigationPolicy(action, &navigationPolicy);
+        WebNavigationPolicy navigationPolicy = WebNavigationPolicyCurrentTab;
+        actionSpecifiesNavigationPolicy(action, &navigationPolicy);
 
-      // Give the delegate a chance to change the navigation policy.
-      const WebDataSourceImpl* ds = m_webFrame->provisionalDataSourceImpl();
-      if (ds) {
-          KURL url = ds->request().url();
-          if (url.protocolIs(backForwardNavigationScheme)) {
-              handleBackForwardNavigation(url);
-              navigationPolicy = WebNavigationPolicyIgnore;
-          } else {
-              bool isRedirect = ds->hasRedirectChain();
+        // Give the delegate a chance to change the navigation policy.
+        const WebDataSourceImpl* ds = m_webFrame->provisionalDataSourceImpl();
+        if (ds) {
+            KURL url = ds->request().url();
+            ASSERT(!url.protocolIs(backForwardNavigationScheme));
 
-              WebNavigationType webnavType =
-                  WebDataSourceImpl::toWebNavigationType(action.type());
+            bool isRedirect = ds->hasRedirectChain();
 
-              RefPtr<Node> node;
-              for (const Event* event = action.event(); event; event = event->underlyingEvent()) {
-                  if (event->isMouseEvent()) {
-                      const MouseEvent* mouseEvent =
-                          static_cast<const MouseEvent*>(event);
-                      node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(
-                          mouseEvent->absoluteLocation(), false).innerNonSharedNode();
-                      break;
-                  }
-              }
-              WebNode originatingNode(node);
+            WebNavigationType webnavType =
+                WebDataSourceImpl::toWebNavigationType(action.type());
 
-              navigationPolicy = m_webFrame->client()->decidePolicyForNavigation(
-                  m_webFrame, ds->request(), webnavType, originatingNode,
-                  navigationPolicy, isRedirect);
-          }
-      }
+            RefPtr<Node> node;
+            for (const Event* event = action.event(); event; event = event->underlyingEvent()) {
+                if (event->isMouseEvent()) {
+                    const MouseEvent* mouseEvent =
+                        static_cast<const MouseEvent*>(event);
+                    node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(
+                        mouseEvent->absoluteLocation(), false).innerNonSharedNode();
+                    break;
+                }
+            }
+            WebNode originatingNode(node);
 
-      if (navigationPolicy == WebNavigationPolicyCurrentTab)
-          policyAction = PolicyUse;
-      else if (navigationPolicy == WebNavigationPolicyDownload)
-          policyAction = PolicyDownload;
-      else {
-          if (navigationPolicy != WebNavigationPolicyIgnore) {
-              WrappedResourceRequest webreq(request);
-              m_webFrame->client()->loadURLExternally(m_webFrame, webreq, navigationPolicy);
-          }
-          policyAction = PolicyIgnore;
-      }
+            navigationPolicy = m_webFrame->client()->decidePolicyForNavigation(
+                m_webFrame, ds->request(), webnavType, originatingNode,
+                navigationPolicy, isRedirect);
+        }
+
+        if (navigationPolicy == WebNavigationPolicyCurrentTab)
+            policyAction = PolicyUse;
+        else if (navigationPolicy == WebNavigationPolicyDownload)
+            policyAction = PolicyDownload;
+        else {
+            if (navigationPolicy != WebNavigationPolicyIgnore) {
+                WrappedResourceRequest webreq(request);
+                m_webFrame->client()->loadURLExternally(m_webFrame, webreq, navigationPolicy);
+            }
+            policyAction = PolicyIgnore;
+        }
     }
 
     (m_webFrame->frame()->loader()->policyChecker()->*function)(policyAction);
@@ -1075,7 +1066,7 @@
         // However, we only want to do this if makeRepresentation has been called, to
         // match the behavior on the Mac.
         if (m_hasRepresentation)
-            dl->frameLoader()->setEncoding("", false);
+            dl->frameLoader()->writer()->setEncoding("", false);
     }
 }
 
@@ -1087,10 +1078,28 @@
 {
 }
 
-bool FrameLoaderClientImpl::shouldGoToHistoryItem(HistoryItem*) const
+bool FrameLoaderClientImpl::shouldGoToHistoryItem(HistoryItem* item) const
 {
-    // FIXME
-    return true;
+    const KURL& url = item->url();
+    if (!url.protocolIs(backForwardNavigationScheme))
+        return true;
+
+    // Else, we'll punt this history navigation to the embedder.  It is
+    // necessary that we intercept this here, well before the FrameLoader
+    // has made any state changes for this history traversal.
+
+    bool ok;
+    int offset = url.lastPathComponent().toIntStrict(&ok);
+    if (!ok) {
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+
+    WebViewImpl* webview = m_webFrame->viewImpl();
+    if (webview->client())
+        webview->client()->navigateBackForwardSoon(offset);
+
+    return false;
 }
 
 void FrameLoaderClientImpl::dispatchDidAddBackForwardItem(HistoryItem*) const
@@ -1465,29 +1474,24 @@
     const NavigationAction& action,
     WebNavigationPolicy* policy)
 {
-    if ((action.type() != NavigationTypeLinkClicked) || !action.event()->isMouseEvent())
+    const MouseEvent* event = 0;
+    if (action.type() == NavigationTypeLinkClicked
+        && action.event()->isMouseEvent())
+        event = static_cast<const MouseEvent*>(action.event());
+    else if (action.type() == NavigationTypeFormSubmitted
+             && action.event()
+             && action.event()->underlyingEvent()
+             && action.event()->underlyingEvent()->isMouseEvent())
+        event = static_cast<const MouseEvent*>(action.event()->underlyingEvent());
+
+    if (!event)
         return false;
 
-    const MouseEvent* event = static_cast<const MouseEvent*>(action.event());
     return WebViewImpl::navigationPolicyFromMouseEvent(
         event->button(), event->ctrlKey(), event->shiftKey(), event->altKey(),
         event->metaKey(), policy);
 }
 
-void FrameLoaderClientImpl::handleBackForwardNavigation(const KURL& url)
-{
-    ASSERT(url.protocolIs(backForwardNavigationScheme));
-
-    bool ok;
-    int offset = url.lastPathComponent().toIntStrict(&ok);
-    if (!ok)
-        return;
-
-    WebViewImpl* webview = m_webFrame->viewImpl();
-    if (webview->client())
-        webview->client()->navigateBackForwardSoon(offset);
-}
-
 PassOwnPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadObserver()
 {
     WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 8a39393..1cbc1de 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -89,11 +89,11 @@
     virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier);
     virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&);
     virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
-    virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&);
     virtual void dispatchDidHandleOnloadEvents();
     virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
     virtual void dispatchDidCancelClientRedirect();
     virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double interval, double fireDate);
+    virtual void dispatchDidNavigateWithinPage();
     virtual void dispatchDidChangeLocationWithinPage();
     virtual void dispatchDidPushStateWithinPage();
     virtual void dispatchDidReplaceStateWithinPage();
@@ -195,6 +195,8 @@
     virtual bool allowJavaScript(bool enabledPerSettings);
     virtual bool allowPlugins(bool enabledPerSettings);
     virtual bool allowImages(bool enabledPerSettings);
+    virtual void didNotAllowScript();
+    virtual void didNotAllowPlugins();
 
 private:
     void makeDocumentView();
@@ -204,9 +206,6 @@
     static bool actionSpecifiesNavigationPolicy(
         const WebCore::NavigationAction& action, WebNavigationPolicy* policy);
 
-    // Called when a dummy back-forward navigation is intercepted.
-    void handleBackForwardNavigation(const WebCore::KURL&);
-
     PassOwnPtr<WebPluginLoadObserver> pluginLoadObserver();
 
     // The WebFrame that owns this object and manages its lifetime. Therefore,
diff --git a/WebKit/chromium/src/GLES2Context.cpp b/WebKit/chromium/src/GLES2Context.cpp
new file mode 100644
index 0000000..9dd4eff
--- /dev/null
+++ b/WebKit/chromium/src/GLES2Context.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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 "GLES2Context.h"
+#include "WebGLES2Context.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+#include "WebViewImpl.h"
+#include <wtf/OwnPtr.h>
+
+// There are two levels of delegation in this file:
+//
+//   1. GLES2Context delegates to GLES2ContextInternal. This is done
+//      so that we have some place to store data members common among
+//      implementations.
+//
+//   2. GLES2ContextInternal delegates to an implementation of
+//      WebGLES2Context. This is done so we have a place to inject an
+//      implementation which creates the GL ES context.
+
+namespace WebCore {
+
+class GLES2ContextInternal {
+public:
+    GLES2ContextInternal() {}
+    ~GLES2ContextInternal() {}
+
+    bool initialize(Page*);
+
+    WebKit::WebGLES2Context* getWebGLES2Context() { return m_impl.get(); }
+
+private:
+    OwnPtr<WebKit::WebGLES2Context> m_impl;
+};
+
+bool GLES2ContextInternal::initialize(Page* page)
+{
+    m_impl = WebKit::webKitClient()->createGLES2Context();
+    if (!m_impl)
+        return false;
+
+    WebKit::WebViewImpl* webView = WebKit::WebViewImpl::fromPage(page);
+    if (!m_impl->initialize(webView)) {
+        m_impl.clear();
+        return false;
+    }
+    return true;
+}
+
+PassOwnPtr<GLES2Context> GLES2Context::create(Page* page)
+{
+    GLES2ContextInternal* internal = new GLES2ContextInternal();
+    if (!internal->initialize(page)) {
+        delete internal;
+        return 0;
+    }
+    PassOwnPtr<GLES2Context> result = new GLES2Context();
+    result->m_internal.set(internal);
+    return result;
+}
+
+GLES2Context::~GLES2Context()
+{
+}
+
+bool GLES2Context::makeCurrent()
+{
+    WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+    if (!webContext)
+        return false;
+    return webContext->makeCurrent();
+}
+
+bool GLES2Context::destroy()
+{
+    WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+    if (!webContext)
+        return false;
+    return webContext->destroy();
+}
+
+bool GLES2Context::swapBuffers()
+{
+    WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+    if (!webContext)
+        return false;
+    return webContext->swapBuffers();
+}
+
+}  // namespace WebCore
diff --git a/WebKit/chromium/src/GeolocationServiceBridgeChromium.cpp b/WebKit/chromium/src/GeolocationServiceBridgeChromium.cpp
deleted file mode 100644
index abbb9c6..0000000
--- a/WebKit/chromium/src/GeolocationServiceBridgeChromium.cpp
+++ /dev/null
@@ -1,179 +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 "GeolocationServiceBridgeChromium.h"
-
-#include "Chrome.h"
-#include "ChromeClientImpl.h"
-#include "Frame.h"
-#include "Geolocation.h"
-#include "GeolocationServiceChromium.h"
-#include "Geoposition.h"
-#include "Page.h"
-#include "PositionError.h"
-#include "PositionOptions.h"
-#include "WebFrame.h"
-#include "WebFrameImpl.h"
-#include "WebViewClient.h"
-#include "WebViewImpl.h"
-
-#if ENABLE(GEOLOCATION)
-
-using WebCore::Coordinates;
-using WebCore::Frame;
-using WebCore::Geolocation;
-using WebCore::GeolocationServiceBridge;
-using WebCore::GeolocationServiceChromium;
-using WebCore::GeolocationServiceClient;
-using WebCore::Geoposition;
-using WebCore::PositionError;
-using WebCore::PositionOptions;
-using WebCore::String;
-
-namespace WebKit {
-
-class GeolocationServiceBridgeImpl : public GeolocationServiceBridge, public WebGeolocationServiceBridge {
-public:
-    explicit GeolocationServiceBridgeImpl(GeolocationServiceChromium*);
-    virtual ~GeolocationServiceBridgeImpl();
-
-    // GeolocationServiceBridge
-    virtual bool startUpdating(PositionOptions*);
-    virtual void stopUpdating();
-    virtual void suspend();
-    virtual void resume();
-    virtual int getBridgeId() const;
-
-    // WebGeolocationServiceBridge
-    virtual void setIsAllowed(bool allowed);
-    virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp);
-    virtual void setLastError(int errorCode, const WebString& message);
-
-private:
-    WebViewClient* getWebViewClient();
-
-    // GeolocationServiceChromium owns us, we only have a pointer back to it.
-    GeolocationServiceChromium* m_GeolocationServiceChromium;
-    int m_bridgeId;
-};
-
-GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
-{
-    return new GeolocationServiceBridgeImpl(geolocationServiceChromium);
-}
-
-GeolocationServiceBridgeImpl::GeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
-    : m_GeolocationServiceChromium(geolocationServiceChromium)
-{
-    // We need to attach ourselves here: Geolocation calls requestPermissionForFrame()
-    // directly, and we need to be attached so that the embedder can call
-    // our setIsAllowed().
-    m_bridgeId = getWebViewClient()->getGeolocationService()->attachBridge(this);
-    ASSERT(m_bridgeId);
-}
-
-GeolocationServiceBridgeImpl::~GeolocationServiceBridgeImpl()
-{
-    WebKit::WebViewClient* webViewClient = getWebViewClient();
-    // Geolocation has an OwnPtr to us, and it's destroyed after the frame has
-    // been potentially disconnected. In this case, it calls stopUpdating()
-    // has been called and we have already dettached ourselves.
-    if (!webViewClient) {
-        ASSERT(!m_bridgeId);
-    } else if (m_bridgeId)
-        webViewClient->getGeolocationService()->dettachBridge(m_bridgeId);
-}
-
-bool GeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions)
-{
-    if (!m_bridgeId)
-        m_bridgeId = getWebViewClient()->getGeolocationService()->attachBridge(this);
-    getWebViewClient()->getGeolocationService()->startUpdating(m_bridgeId, positionOptions->enableHighAccuracy());
-    //// FIXME: this will trigger a permission request regardless.
-    //// Is it correct? confirm with andreip.
-    // positionChanged();
-    return true;
-}
-
-void GeolocationServiceBridgeImpl::stopUpdating()
-{
-    if (m_bridgeId) {
-        WebGeolocationServiceInterface* geolocationService = getWebViewClient()->getGeolocationService();
-        geolocationService->stopUpdating(m_bridgeId);
-        geolocationService->dettachBridge(m_bridgeId);
-        m_bridgeId = 0;
-    }
-}
-
-void GeolocationServiceBridgeImpl::suspend()
-{
-    getWebViewClient()->getGeolocationService()->suspend(m_bridgeId);
-}
-
-void GeolocationServiceBridgeImpl::resume()
-{
-    getWebViewClient()->getGeolocationService()->resume(m_bridgeId);
-}
-
-int GeolocationServiceBridgeImpl::getBridgeId() const
-{
-    return m_bridgeId;
-}
-
-void GeolocationServiceBridgeImpl::setIsAllowed(bool allowed)
-{
-    m_GeolocationServiceChromium->setIsAllowed(allowed);
-}
-
-void GeolocationServiceBridgeImpl::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp)
-{
-    m_GeolocationServiceChromium->setLastPosition(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed, timestamp);
-}
-
-void GeolocationServiceBridgeImpl::setLastError(int errorCode, const WebString& message)
-{
-    m_GeolocationServiceChromium->setLastError(errorCode, message);
-}
-
-WebViewClient* GeolocationServiceBridgeImpl::getWebViewClient()
-{
-    Frame* frame = m_GeolocationServiceChromium->frame();
-    if (!frame || !frame->page())
-        return 0;
-    WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client());
-    WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
-    return webViewClient;
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(GEOLOCATION)
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index 807a794..0f9c959 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -35,12 +35,10 @@
 #include "GraphicsContext3D.h"
 
 #include "CachedImage.h"
-#include "CString.h"
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
 #include "ImageBuffer.h"
 #include "ImageData.h"
-#include "NotImplemented.h"
 #include "WebGLBuffer.h"
 #include "WebGLByteArray.h"
 #include "WebGLFloatArray.h"
@@ -52,39 +50,42 @@
 #include "WebGLShader.h"
 #include "WebGLTexture.h"
 #include "WebGLUnsignedByteArray.h"
+#include "WebGraphicsContext3D.h"
+#include "WebGraphicsContext3DDefaultImpl.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
 
 #include <stdio.h>
 #include <wtf/FastMalloc.h>
-
-#if OS(WINDOWS)
-#include <windows.h>
-#endif
-
-#include "GL/glew.h"
+#include <wtf/text/CString.h>
 
 #if PLATFORM(CG)
 #include "GraphicsContext.h"
 #include <CoreGraphics/CGContext.h>
 #include <CoreGraphics/CGImage.h>
-#include <OpenGL/OpenGL.h>
-#else
-#define FLIP_FRAMEBUFFER_VERTICALLY
 #endif
 
-#if OS(DARWIN)
-#define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
-#endif
+// using namespace std;
 
-#if OS(LINUX)
-#include <dlfcn.h>
-#include "GL/glxew.h"
-#endif
-
-using namespace std;
+// There are two levels of delegation in this file:
+//
+//   1. GraphicsContext3D delegates to GraphicsContext3DInternal. This is done
+//      so that we have some place to store data members common among
+//      implementations; GraphicsContext3D only provides us the m_internal
+//      pointer. We always delegate to the GraphicsContext3DInternal. While we
+//      could sidestep it and go directly to the WebGraphicsContext3D in some
+//      cases, it is better for consistency to always delegate through it.
+//
+//   2. GraphicsContext3DInternal delegates to an implementation of
+//      WebGraphicsContext3D. This is done so we have a place to inject an
+//      implementation which remotes the OpenGL calls across processes.
+//
+// The legacy, in-process, implementation uses WebGraphicsContext3DDefaultImpl.
 
 namespace WebCore {
 
-// GraphicsContext3DInternal -----------------------------------------------------
+//----------------------------------------------------------------------
+// GraphicsContext3DInternal
 
 // Uncomment this to render to a separate window for debugging
 // #define RENDER_TO_DEBUGGING_WINDOW
@@ -93,744 +94,324 @@
 
 class GraphicsContext3DInternal {
 public:
-    GraphicsContext3DInternal(GraphicsContext3D::Attributes attrs);
+    GraphicsContext3DInternal();
     ~GraphicsContext3DInternal();
 
-    bool makeContextCurrent();
+    bool initialize(GraphicsContext3D::Attributes attrs);
 
     PlatformGraphicsContext3D platformGraphicsContext3D() const;
     Platform3DObject platformTexture() const;
 
+    bool makeContextCurrent();
+
+    int sizeInBytes(int type);
+
     void reshape(int width, int height);
 
     void beginPaint(WebGLRenderingContext* context);
+    void endPaint();
 
-    bool validateTextureTarget(int target);
-    bool validateTextureParameter(int param);
-
+    //----------------------------------------------------------------------
+    // Entry points for WebGL.
+    //
     void activeTexture(unsigned long texture);
-    void bindBuffer(unsigned long target,
-                    WebGLBuffer* buffer);
-    void bindFramebuffer(unsigned long target,
-                         WebGLFramebuffer* framebuffer);
-    void bindTexture(unsigned long target,
-                     WebGLTexture* texture);
-    void bufferDataImpl(unsigned long target, int size, const void* data, unsigned long usage);
+    void attachShader(WebGLProgram* program, WebGLShader* shader);
+    void bindAttribLocation(WebGLProgram*, unsigned long index, const String& name);
+    void bindBuffer(unsigned long target, WebGLBuffer*);
+    void bindFramebuffer(unsigned long target, WebGLFramebuffer*);
+    void bindRenderbuffer(unsigned long target, WebGLRenderbuffer*);
+    void bindTexture(unsigned long target, WebGLTexture* texture);
+    void blendColor(double red, double green, double blue, double alpha);
+    void blendEquation(unsigned long mode);
+    void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
+    void blendFunc(unsigned long sfactor, unsigned long dfactor);
+    void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
+
+    void bufferData(unsigned long target, int size, unsigned long usage);
+    void bufferData(unsigned long target, WebGLArray* data, unsigned long usage);
+    void bufferSubData(unsigned long target, long offset, WebGLArray* data);
+
+    unsigned long checkFramebufferStatus(unsigned long target);
+    void clear(unsigned long mask);
+    void clearColor(double red, double green, double blue, double alpha);
+    void clearDepth(double depth);
+    void clearStencil(long s);
+    void colorMask(bool red, bool green, bool blue, bool alpha);
+    void compileShader(WebGLShader*);
+
+    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
+    void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
+    void cullFace(unsigned long mode);
+    void depthFunc(unsigned long func);
+    void depthMask(bool flag);
+    void depthRange(double zNear, double zFar);
+    void detachShader(WebGLProgram*, WebGLShader*);
+    void disable(unsigned long cap);
     void disableVertexAttribArray(unsigned long index);
+    void drawArrays(unsigned long mode, long first, long count);
+    void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
+
+    void enable(unsigned long cap);
     void enableVertexAttribArray(unsigned long index);
-    unsigned long getError();
+    void finish();
+    void flush();
+    void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer*);
+    void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture*, long level);
+    void frontFace(unsigned long mode);
+    void generateMipmap(unsigned long target);
+
+    bool getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo&);
+    bool getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo&);
+
+    int  getAttribLocation(WebGLProgram*, const String& name);
+
+    void getBooleanv(unsigned long pname, unsigned char* value);
+
+    void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
     GraphicsContext3D::Attributes getContextAttributes();
+
+    unsigned long getError();
+
+    void getFloatv(unsigned long pname, float* value);
+
+    void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
+
+    void getIntegerv(unsigned long pname, int* value);
+
+    void getProgramiv(WebGLProgram* program, unsigned long pname, int* value);
+
+    String getProgramInfoLog(WebGLProgram*);
+
+    void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
+    void getShaderiv(WebGLShader*, unsigned long pname, int* value);
+
+    String getShaderInfoLog(WebGLShader*);
+
+    String getShaderSource(WebGLShader*);
+    String getString(unsigned long name);
+
+    void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
+    void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
+
+    void getUniformfv(WebGLProgram* program, long location, float* value);
+    void getUniformiv(WebGLProgram* program, long location, int* value);
+
+    long getUniformLocation(WebGLProgram*, const String& name);
+
+    void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
+    void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
+
+    long getVertexAttribOffset(unsigned long index, unsigned long pname);
+
+    void hint(unsigned long target, unsigned long mode);
+    bool isBuffer(WebGLBuffer*);
+    bool isEnabled(unsigned long cap);
+    bool isFramebuffer(WebGLFramebuffer*);
+    bool isProgram(WebGLProgram*);
+    bool isRenderbuffer(WebGLRenderbuffer*);
+    bool isShader(WebGLShader*);
+    bool isTexture(WebGLTexture*);
+    void lineWidth(double);
+    void linkProgram(WebGLProgram*);
+    void pixelStorei(unsigned long pname, long param);
+    void polygonOffset(double factor, double units);
+
+    void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
+
+    void releaseShaderCompiler();
+    void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
+    void sampleCoverage(double value, bool invert);
+    void scissor(long x, long y, unsigned long width, unsigned long height);
+    void shaderSource(WebGLShader*, const String& string);
+    void stencilFunc(unsigned long func, long ref, unsigned long mask);
+    void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
+    void stencilMask(unsigned long mask);
+    void stencilMaskSeparate(unsigned long face, unsigned long mask);
+    void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
+    void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
+
+    // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode.
+    // Currently they return -1 on any error.
+    int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
+
+    void texParameterf(unsigned target, unsigned pname, float param);
+    void texParameteri(unsigned target, unsigned pname, int param);
+
+    int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
+
+    void uniform1f(long location, float x);
+    void uniform1fv(long location, float* v, int size);
+    void uniform1i(long location, int x);
+    void uniform1iv(long location, int* v, int size);
+    void uniform2f(long location, float x, float y);
+    void uniform2fv(long location, float* v, int size);
+    void uniform2i(long location, int x, int y);
+    void uniform2iv(long location, int* v, int size);
+    void uniform3f(long location, float x, float y, float z);
+    void uniform3fv(long location, float* v, int size);
+    void uniform3i(long location, int x, int y, int z);
+    void uniform3iv(long location, int* v, int size);
+    void uniform4f(long location, float x, float y, float z, float w);
+    void uniform4fv(long location, float* v, int size);
+    void uniform4i(long location, int x, int y, int z, int w);
+    void uniform4iv(long location, int* v, int size);
+    void uniformMatrix2fv(long location, bool transpose, float* value, int size);
+    void uniformMatrix3fv(long location, bool transpose, float* value, int size);
+    void uniformMatrix4fv(long location, bool transpose, float* value, int size);
+
+    void useProgram(WebGLProgram*);
+    void validateProgram(WebGLProgram*);
+
+    void vertexAttrib1f(unsigned long indx, float x);
+    void vertexAttrib1fv(unsigned long indx, float* values);
+    void vertexAttrib2f(unsigned long indx, float x, float y);
+    void vertexAttrib2fv(unsigned long indx, float* values);
+    void vertexAttrib3f(unsigned long indx, float x, float y, float z);
+    void vertexAttrib3fv(unsigned long indx, float* values);
+    void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
+    void vertexAttrib4fv(unsigned long indx, float* values);
     void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
                              unsigned long stride, unsigned long offset);
-    void viewportImpl(long x, long y, unsigned long width, unsigned long height);
+
+    void viewport(long x, long y, unsigned long width, unsigned long height);
+
+    unsigned createBuffer();
+    unsigned createFramebuffer();
+    unsigned createProgram();
+    unsigned createRenderbuffer();
+    unsigned createShader(unsigned long);
+    unsigned createTexture();
+
+    void deleteBuffer(unsigned);
+    void deleteFramebuffer(unsigned);
+    void deleteProgram(unsigned);
+    void deleteRenderbuffer(unsigned);
+    void deleteShader(unsigned);
+    void deleteTexture(unsigned);
 
     void synthesizeGLError(unsigned long error);
 
 private:
-    GraphicsContext3D::Attributes m_attrs;
-
-    unsigned int m_texture;
-    unsigned int m_fbo;
-    unsigned int m_depthBuffer;
-    unsigned int m_cachedWidth, m_cachedHeight;
-
-    // For tracking which FBO is bound
-    unsigned int m_boundFBO;
-
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-    unsigned char* m_scanline;
-    void flipVertically(unsigned char* framebuffer,
-                        unsigned int width,
-                        unsigned int height);
-#endif
-
-    // Note: we aren't currently using this information, but we will
-    // need to in order to verify that all enabled vertex arrays have
-    // a valid buffer bound -- to avoid crashes on certain cards.
-    unsigned int m_boundArrayBuffer;
-    class VertexAttribPointerState {
-    public:
-        VertexAttribPointerState();
-
-        bool enabled;
-        unsigned long buffer;
-        unsigned long indx;
-        int size;
-        int type;
-        bool normalized;
-        unsigned long stride;
-        unsigned long offset;
-    };
-
-    enum {
-        NumTrackedPointerStates = 2
-    };
-    VertexAttribPointerState m_vertexAttribPointerState[NumTrackedPointerStates];
-
-    // Errors raised by synthesizeGLError().
-    ListHashSet<unsigned long> m_syntheticErrors;
-
+    OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
 #if PLATFORM(SKIA)
     // If the width and height of the Canvas's backing store don't
     // match those that we were given in the most recent call to
     // reshape(), then we need an intermediate bitmap to read back the
     // frame buffer into. This seems to happen when CSS styles are
     // used to resize the Canvas.
-    SkBitmap* m_resizingBitmap;
+    SkBitmap m_resizingBitmap;
 #endif
 
-    static bool s_initializedGLEW;
-#if OS(WINDOWS)
-    HWND  m_canvasWindow;
-    HDC   m_canvasDC;
-    HGLRC m_contextObj;
-#elif PLATFORM(CG)
-    CGLPBufferObj m_pbuffer;
-    CGLContextObj m_contextObj;
+#if PLATFORM(CG)
     unsigned char* m_renderOutput;
-#elif OS(LINUX)
-    GLXContext m_contextObj;
-    GLXPbuffer m_pbuffer;
-
-    // In order to avoid problems caused by linking against libGL, we
-    // dynamically look up all the symbols we need.
-    // http://code.google.com/p/chromium/issues/detail?id=16800
-    class GLConnection {
-      public:
-        ~GLConnection();
-
-        static GLConnection* create();
-
-        GLXFBConfig* chooseFBConfig(int screen, const int *attrib_list, int *nelements)
-        {
-            return m_glXChooseFBConfig(m_display, screen, attrib_list, nelements);
-        }
-
-        GLXContext createNewContext(GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
-        {
-            return m_glXCreateNewContext(m_display, config, renderType, shareList, direct);
-        }
-
-        GLXPbuffer createPbuffer(GLXFBConfig config, const int *attribList)
-        {
-            return m_glXCreatePbuffer(m_display, config, attribList);
-        }
-
-        void destroyPbuffer(GLXPbuffer pbuf)
-        {
-            m_glXDestroyPbuffer(m_display, pbuf);
-        }
-
-        Bool makeCurrent(GLXDrawable drawable, GLXContext ctx)
-        {
-            return m_glXMakeCurrent(m_display, drawable, ctx);
-        }
-
-        void destroyContext(GLXContext ctx)
-        {
-            m_glXDestroyContext(m_display, ctx);
-        }
-
-        GLXContext getCurrentContext()
-        {
-            return m_glXGetCurrentContext();
-        }
-
-      private:
-        Display* m_display;
-        void* m_libGL;
-        PFNGLXCHOOSEFBCONFIGPROC m_glXChooseFBConfig;
-        PFNGLXCREATENEWCONTEXTPROC m_glXCreateNewContext;
-        PFNGLXCREATEPBUFFERPROC m_glXCreatePbuffer;
-        PFNGLXDESTROYPBUFFERPROC m_glXDestroyPbuffer;
-        typedef Bool (* PFNGLXMAKECURRENTPROC)(Display* dpy, GLXDrawable drawable, GLXContext ctx);
-        PFNGLXMAKECURRENTPROC m_glXMakeCurrent;
-        typedef void (* PFNGLXDESTROYCONTEXTPROC)(Display* dpy, GLXContext ctx);
-        PFNGLXDESTROYCONTEXTPROC m_glXDestroyContext;
-        typedef GLXContext (* PFNGLXGETCURRENTCONTEXTPROC)(void);
-        PFNGLXGETCURRENTCONTEXTPROC m_glXGetCurrentContext;
-
-        GLConnection(Display* display,
-                     void* libGL,
-                     PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig,
-                     PFNGLXCREATENEWCONTEXTPROC createNewContext,
-                     PFNGLXCREATEPBUFFERPROC createPbuffer,
-                     PFNGLXDESTROYPBUFFERPROC destroyPbuffer,
-                     PFNGLXMAKECURRENTPROC makeCurrent,
-                     PFNGLXDESTROYCONTEXTPROC destroyContext,
-                     PFNGLXGETCURRENTCONTEXTPROC getCurrentContext)
-            : m_libGL(libGL)
-            , m_display(display)
-            , m_glXChooseFBConfig(chooseFBConfig)
-            , m_glXCreateNewContext(createNewContext)
-            , m_glXCreatePbuffer(createPbuffer)
-            , m_glXDestroyPbuffer(destroyPbuffer)
-            , m_glXMakeCurrent(makeCurrent)
-            , m_glXDestroyContext(destroyContext)
-            , m_glXGetCurrentContext(getCurrentContext)
-        {
-        }
-    };
-
-    static GLConnection* s_gl;
-#else
-    #error Must port GraphicsContext3D to your platform
 #endif
 };
 
-bool GraphicsContext3DInternal::s_initializedGLEW = false;
-
-#if OS(LINUX)
-GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::s_gl = 0;
-
-GraphicsContext3DInternal::GLConnection* GraphicsContext3DInternal::GLConnection::create()
-{
-    Display* dpy = XOpenDisplay(0);
-    if (!dpy) {
-        printf("GraphicsContext3D: error opening X display\n");
-        return 0;
-    }
-
-    // We use RTLD_GLOBAL semantics so that GLEW initialization works;
-    // GLEW expects to be able to open the current process's handle
-    // and do dlsym's of GL entry points from there.
-    void* libGL = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
-    if (!libGL) {
-        XCloseDisplay(dpy);
-        printf("GraphicsContext3D: error opening libGL.so.1: %s\n", dlerror());
-        return 0;
-    }
-
-    PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) dlsym(libGL, "glXChooseFBConfig");
-    PFNGLXCREATENEWCONTEXTPROC createNewContext = (PFNGLXCREATENEWCONTEXTPROC) dlsym(libGL, "glXCreateNewContext");
-    PFNGLXCREATEPBUFFERPROC createPbuffer = (PFNGLXCREATEPBUFFERPROC) dlsym(libGL, "glXCreatePbuffer");
-    PFNGLXDESTROYPBUFFERPROC destroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) dlsym(libGL, "glXDestroyPbuffer");
-    PFNGLXMAKECURRENTPROC makeCurrent = (PFNGLXMAKECURRENTPROC) dlsym(libGL, "glXMakeCurrent");
-    PFNGLXDESTROYCONTEXTPROC destroyContext = (PFNGLXDESTROYCONTEXTPROC) dlsym(libGL, "glXDestroyContext");
-    PFNGLXGETCURRENTCONTEXTPROC getCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC) dlsym(libGL, "glXGetCurrentContext");
-    if (!chooseFBConfig || !createNewContext || !createPbuffer
-        || !destroyPbuffer || !makeCurrent || !destroyContext
-        || !getCurrentContext) {
-        XCloseDisplay(dpy);
-        dlclose(libGL);
-        printf("GraphicsContext3D: error looking up bootstrapping entry points\n");
-        return 0;
-    }
-    return new GLConnection(dpy,
-                            libGL,
-                            chooseFBConfig,
-                            createNewContext,
-                            createPbuffer,
-                            destroyPbuffer,
-                            makeCurrent,
-                            destroyContext,
-                            getCurrentContext);
-}
-
-GraphicsContext3DInternal::GLConnection::~GLConnection()
-{
-    XCloseDisplay(m_display);
-    dlclose(m_libGL);
-}
-
-#endif // OS(LINUX)
-
-GraphicsContext3DInternal::VertexAttribPointerState::VertexAttribPointerState()
-    : enabled(false)
-    , buffer(0)
-    , indx(0)
-    , size(0)
-    , type(0)
-    , normalized(false)
-    , stride(0)
-    , offset(0)
-{
-}
-
-GraphicsContext3DInternal::GraphicsContext3DInternal(GraphicsContext3D::Attributes attrs)
-    : m_attrs(attrs)
-    , m_texture(0)
-    , m_fbo(0)
-    , m_depthBuffer(0)
-    , m_boundFBO(0)
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-    , m_scanline(0)
-#endif
-    , m_boundArrayBuffer(0)
+GraphicsContext3DInternal::GraphicsContext3DInternal()
 #if PLATFORM(SKIA)
-    , m_resizingBitmap(0)
-#endif
-#if OS(WINDOWS)
-    , m_canvasWindow(0)
-    , m_canvasDC(0)
-    , m_contextObj(0)
 #elif PLATFORM(CG)
-    , m_pbuffer(0)
-    , m_contextObj(0)
-    , m_renderOutput(0)
-#elif OS(LINUX)
-    , m_contextObj(0)
-    , m_pbuffer(0)
+    : m_renderOutput(0)
 #else
 #error Must port to your platform
 #endif
 {
-    // FIXME: we need to take into account the user's requested
-    // context creation attributes, in particular stencil and
-    // antialias, and determine which could and could not be honored
-    // based on the capabilities of the OpenGL implementation.
-    m_attrs.alpha = true;
-    m_attrs.depth = true;
-    m_attrs.stencil = false;
-    m_attrs.antialias = false;
-    m_attrs.premultipliedAlpha = true;
-
-#if OS(WINDOWS)
-    WNDCLASS wc;
-    if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) {
-        ZeroMemory(&wc, sizeof(WNDCLASS));
-        wc.style = CS_OWNDC;
-        wc.hInstance = GetModuleHandle(0);
-        wc.lpfnWndProc = DefWindowProc;
-        wc.lpszClassName = L"CANVASGL";
-
-        if (!RegisterClass(&wc)) {
-            printf("GraphicsContext3D: RegisterClass failed\n");
-            return;
-        }
-    }
-
-    m_canvasWindow = CreateWindow(L"CANVASGL", L"CANVASGL",
-                                  WS_CAPTION,
-                                  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
-                                  CW_USEDEFAULT, 0, 0, GetModuleHandle(0), 0);
-    if (!m_canvasWindow) {
-        printf("GraphicsContext3DInternal: CreateWindow failed\n");
-        return;
-    }
-
-    // get the device context
-    m_canvasDC = GetDC(m_canvasWindow);
-    if (!m_canvasDC) {
-        printf("GraphicsContext3DInternal: GetDC failed\n");
-        return;
-    }
-
-    // find default pixel format
-    PIXELFORMATDESCRIPTOR pfd;
-    ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
-    pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
-    pfd.nVersion = 1;
-    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL
-#ifdef RENDER_TO_DEBUGGING_WINDOW
-        | PFD_DOUBLEBUFFER
-#endif // RENDER_TO_DEBUGGING_WINDOW
-        ;
-    int pixelformat = ChoosePixelFormat(m_canvasDC, &pfd);
-
-    // set the pixel format for the dc
-    if (!SetPixelFormat(m_canvasDC, pixelformat, &pfd)) {
-        printf("GraphicsContext3D: SetPixelFormat failed\n");
-        return;
-    }
-
-    // create rendering context
-    m_contextObj = wglCreateContext(m_canvasDC);
-    if (!m_contextObj) {
-        printf("GraphicsContext3D: wglCreateContext failed\n");
-        return;
-    }
-
-    if (!wglMakeCurrent(m_canvasDC, m_contextObj)) {
-        printf("GraphicsContext3D: wglMakeCurrent failed\n");
-        return;
-    }
-
-#ifdef RENDER_TO_DEBUGGING_WINDOW
-    typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-    PFNWGLSWAPINTERVALEXTPROC setSwapInterval = 0;
-    setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT");
-    if (setSwapInterval)
-        setSwapInterval(1);
-#endif // RENDER_TO_DEBUGGING_WINDOW
-
-#elif PLATFORM(CG)
-    // Create a 1x1 pbuffer and associated context to bootstrap things
-    CGLPixelFormatAttribute attribs[] = {
-        (CGLPixelFormatAttribute) kCGLPFAPBuffer,
-        (CGLPixelFormatAttribute) 0
-    };
-    CGLPixelFormatObj pixelFormat;
-    GLint numPixelFormats;
-    if (CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats) != kCGLNoError) {
-        printf("GraphicsContext3D: error choosing pixel format\n");
-        return;
-    }
-    if (!pixelFormat) {
-        printf("GraphicsContext3D: no pixel format selected\n");
-        return;
-    }
-    CGLContextObj context;
-    CGLError res = CGLCreateContext(pixelFormat, 0, &context);
-    CGLDestroyPixelFormat(pixelFormat);
-    if (res != kCGLNoError) {
-        printf("GraphicsContext3D: error creating context\n");
-        return;
-    }
-    CGLPBufferObj pbuffer;
-    if (CGLCreatePBuffer(1, 1, GL_TEXTURE_2D, GL_RGBA, 0, &pbuffer) != kCGLNoError) {
-        CGLDestroyContext(context);
-        printf("GraphicsContext3D: error creating pbuffer\n");
-        return;
-    }
-    if (CGLSetPBuffer(context, pbuffer, 0, 0, 0) != kCGLNoError) {
-        CGLDestroyContext(context);
-        CGLDestroyPBuffer(pbuffer);
-        printf("GraphicsContext3D: error attaching pbuffer to context\n");
-        return;
-    }
-    if (CGLSetCurrentContext(context) != kCGLNoError) {
-        CGLDestroyContext(context);
-        CGLDestroyPBuffer(pbuffer);
-        printf("GraphicsContext3D: error making context current\n");
-        return;
-    }
-    m_pbuffer = pbuffer;
-    m_contextObj = context;
-#elif OS(LINUX)
-    if (!s_gl) {
-        s_gl = GLConnection::create();
-        if (!s_gl)
-            return;
-    }
-
-    int configAttrs[] = {
-        GLX_DRAWABLE_TYPE,
-        GLX_PBUFFER_BIT,
-        GLX_RENDER_TYPE,
-        GLX_RGBA_BIT,
-        GLX_DOUBLEBUFFER,
-        0,
-        0
-    };
-    int nelements = 0;
-    GLXFBConfig* config = s_gl->chooseFBConfig(0, configAttrs, &nelements);
-    if (!config) {
-        printf("GraphicsContext3D: glXChooseFBConfig failed\n");
-        return;
-    }
-    if (!nelements) {
-        printf("GraphicsContext3D: glXChooseFBConfig returned 0 elements\n");
-        XFree(config);
-        return;
-    }
-    GLXContext context = s_gl->createNewContext(config[0], GLX_RGBA_TYPE, 0, True);
-    if (!context) {
-        printf("GraphicsContext3D: glXCreateNewContext failed\n");
-        XFree(config);
-        return;
-    }
-    int pbufferAttrs[] = {
-        GLX_PBUFFER_WIDTH,
-        1,
-        GLX_PBUFFER_HEIGHT,
-        1,
-        0
-    };
-    GLXPbuffer pbuffer = s_gl->createPbuffer(config[0], pbufferAttrs);
-    XFree(config);
-    if (!pbuffer) {
-        printf("GraphicsContext3D: glxCreatePbuffer failed\n");
-        return;
-    }
-    if (!s_gl->makeCurrent(pbuffer, context)) {
-        printf("GraphicsContext3D: glXMakeCurrent failed\n");
-        return;
-    }
-    m_contextObj = context;
-    m_pbuffer = pbuffer;
-#else
-#error Must port to your platform
-#endif
-
-    if (!s_initializedGLEW) {
-        // Initialize GLEW and check for GL 2.0 support by the drivers.
-        GLenum glewInitResult = glewInit();
-        if (glewInitResult != GLEW_OK) {
-            printf("GraphicsContext3D: GLEW initialization failed\n");
-            return;
-        }
-        if (!glewIsSupported("GL_VERSION_2_0")) {
-            printf("GraphicsContext3D: OpenGL 2.0 not supported\n");
-            return;
-        }
-        s_initializedGLEW = true;
-    }
 }
 
 GraphicsContext3DInternal::~GraphicsContext3DInternal()
 {
-    makeContextCurrent();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
-    glDeleteRenderbuffersEXT(1, &m_depthBuffer);
-    glDeleteTextures(1, &m_texture);
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-    if (m_scanline)
-        delete[] m_scanline;
-#endif
-    glDeleteFramebuffersEXT(1, &m_fbo);
-#endif // !RENDER_TO_DEBUGGING_WINDOW
-#if PLATFORM(SKIA)
-    if (m_resizingBitmap)
-        delete m_resizingBitmap;
-#endif
-#if OS(WINDOWS)
-    wglMakeCurrent(0, 0);
-    wglDeleteContext(m_contextObj);
-    ReleaseDC(m_canvasWindow, m_canvasDC);
-    DestroyWindow(m_canvasWindow);
-#elif PLATFORM(CG)
-    CGLSetCurrentContext(0);
-    CGLDestroyContext(m_contextObj);
-    CGLDestroyPBuffer(m_pbuffer);
+#if PLATFORM(CG)
     if (m_renderOutput)
         delete[] m_renderOutput;
-#elif OS(LINUX)
-    s_gl->makeCurrent(0, 0);
-    s_gl->destroyContext(m_contextObj);
-    s_gl->destroyPbuffer(m_pbuffer);
-#else
-#error Must port to your platform
 #endif
-    m_contextObj = 0;
 }
 
-bool GraphicsContext3DInternal::makeContextCurrent()
+bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs)
 {
-#if OS(WINDOWS)
-    if (wglGetCurrentContext() != m_contextObj)
-        if (wglMakeCurrent(m_canvasDC, m_contextObj))
-            return true;
-#elif PLATFORM(CG)
-    if (CGLGetCurrentContext() != m_contextObj)
-        if (CGLSetCurrentContext(m_contextObj) == kCGLNoError)
-            return true;
-#elif OS(LINUX)
-    if (s_gl->getCurrentContext() != m_contextObj)
-        if (s_gl->makeCurrent(m_pbuffer, m_contextObj))
-            return true;
-#else
-#error Must port to your platform
-#endif
-    return false;
+    WebKit::WebGraphicsContext3D::Attributes webAttributes;
+    webAttributes.alpha = attrs.alpha;
+    webAttributes.depth = attrs.depth;
+    webAttributes.stencil = attrs.stencil;
+    webAttributes.antialias = attrs.antialias;
+    webAttributes.premultipliedAlpha = attrs.premultipliedAlpha;
+    WebKit::WebGraphicsContext3D* webContext = WebKit::webKitClient()->createGraphicsContext3D();
+    if (!webContext)
+        return false;
+    if (!webContext->initialize(webAttributes)) {
+        delete webContext;
+        return false;
+    }
+    m_impl.set(webContext);
+    return true;
 }
 
 PlatformGraphicsContext3D GraphicsContext3DInternal::platformGraphicsContext3D() const
 {
-    return m_contextObj;
+    return 0;
 }
 
 Platform3DObject GraphicsContext3DInternal::platformTexture() const
 {
-    return m_texture;
+    return 0;
 }
 
-static int createTextureObject(GLenum target)
-{
-    GLuint texture = 0;
-    glGenTextures(1, &texture);
-    glBindTexture(target, texture);
-    glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-    glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-    return texture;
-}
-
-void GraphicsContext3DInternal::reshape(int width, int height)
-{
-#ifdef RENDER_TO_DEBUGGING_WINDOW
-    SetWindowPos(m_canvasWindow, HWND_TOP, 0, 0, width, height,
-                 SWP_NOMOVE);
-    ShowWindow(m_canvasWindow, SW_SHOW);
-#endif
-
-    m_cachedWidth = width;
-    m_cachedHeight = height;
-    makeContextCurrent();
-
-#ifndef RENDER_TO_DEBUGGING_WINDOW
-#ifdef USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
-    // GL_TEXTURE_RECTANGLE_ARB is the best supported render target on Mac OS X
-    GLenum target = GL_TEXTURE_RECTANGLE_ARB;
-#else
-    GLenum target = GL_TEXTURE_2D;
-#endif
-    if (!m_texture) {
-        // Generate the texture object
-        m_texture = createTextureObject(target);
-        // Generate the framebuffer object
-        glGenFramebuffersEXT(1, &m_fbo);
-        // Generate the depth buffer
-        glGenRenderbuffersEXT(1, &m_depthBuffer);
-    }
-
-    // Reallocate the color and depth buffers
-    glBindTexture(target, m_texture);
-    glTexImage2D(target, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-    glBindTexture(target, 0);
-
-    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
-    m_boundFBO = m_fbo;
-    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthBuffer);
-    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
-    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
-
-    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, m_texture, 0);
-    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthBuffer);
-    GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
-    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
-        printf("GraphicsContext3D: framebuffer was incomplete\n");
-
-        // FIXME: cleanup.
-        notImplemented();
-    }
-#endif  // RENDER_TO_DEBUGGING_WINDOW
-
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-    if (m_scanline) {
-        delete[] m_scanline;
-        m_scanline = 0;
-    }
-    m_scanline = new unsigned char[width * 4];
-#endif  // FLIP_FRAMEBUFFER_VERTICALLY
-
-    glClear(GL_COLOR_BUFFER_BIT);
-
-#if PLATFORM(CG)
-    // Need to reallocate the client-side backing store.
-    // FIXME: make this more efficient.
-    if (m_renderOutput) {
-        delete[] m_renderOutput;
-        m_renderOutput = 0;
-    }
-    int rowBytes = width * 4;
-    m_renderOutput = new unsigned char[height * rowBytes];
-#endif  // PLATFORM(CG)
-}
-
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-void GraphicsContext3DInternal::flipVertically(unsigned char* framebuffer,
-                                               unsigned int width,
-                                               unsigned int height)
-{
-    unsigned char* scanline = m_scanline;
-    if (!scanline)
-        return;
-    unsigned int rowBytes = width * 4;
-    unsigned int count = height / 2;
-    for (unsigned int i = 0; i < count; i++) {
-        unsigned char* rowA = framebuffer + i * rowBytes;
-        unsigned char* rowB = framebuffer + (height - i - 1) * rowBytes;
-        // FIXME: this is where the multiplication of the alpha
-        // channel into the color buffer will need to occur if the
-        // user specifies the "premultiplyAlpha" flag in the context
-        // creation attributes.
-        memcpy(scanline, rowB, rowBytes);
-        memcpy(rowB, rowA, rowBytes);
-        memcpy(rowA, scanline, rowBytes);
-    }
-}
-#endif
-
 void GraphicsContext3DInternal::beginPaint(WebGLRenderingContext* context)
 {
-    makeContextCurrent();
-
-#ifdef RENDER_TO_DEBUGGING_WINDOW
-    SwapBuffers(m_canvasDC);
-#else
-    // Earlier versions of this code used the GPU to flip the
-    // framebuffer vertically before reading it back for compositing
-    // via software. This code was quite complicated, used a lot of
-    // GPU memory, and didn't provide an obvious speedup. Since this
-    // vertical flip is only a temporary solution anyway until Chrome
-    // is fully GPU composited, it wasn't worth the complexity.
-
     HTMLCanvasElement* canvas = context->canvas();
     ImageBuffer* imageBuffer = canvas->buffer();
     unsigned char* pixels = 0;
-    bool mustRestoreFBO = (m_boundFBO != m_fbo);
-    if (mustRestoreFBO)
-        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
 #if PLATFORM(SKIA)
     const SkBitmap* canvasBitmap = imageBuffer->context()->platformContext()->bitmap();
     const SkBitmap* readbackBitmap = 0;
     ASSERT(canvasBitmap->config() == SkBitmap::kARGB_8888_Config);
-    if (canvasBitmap->width() == m_cachedWidth && canvasBitmap->height() == m_cachedHeight) {
+    if (canvasBitmap->width() == m_impl->width() && canvasBitmap->height() == m_impl->height()) {
         // This is the fastest and most common case. We read back
         // directly into the canvas's backing store.
         readbackBitmap = canvasBitmap;
-        if (m_resizingBitmap) {
-            delete m_resizingBitmap;
-            m_resizingBitmap = 0;
-        }
+        m_resizingBitmap.reset();
     } else {
         // We need to allocate a temporary bitmap for reading back the
         // pixel data. We will then use Skia to rescale this bitmap to
         // the size of the canvas's backing store.
-        if (m_resizingBitmap && (m_resizingBitmap->width() != m_cachedWidth || m_resizingBitmap->height() != m_cachedHeight)) {
-            delete m_resizingBitmap;
-            m_resizingBitmap = 0;
-        }
-        if (!m_resizingBitmap) {
-            m_resizingBitmap = new SkBitmap();
-            m_resizingBitmap->setConfig(SkBitmap::kARGB_8888_Config,
-                                        m_cachedWidth,
-                                        m_cachedHeight);
-            if (!m_resizingBitmap->allocPixels()) {
-                delete m_resizingBitmap;
-                m_resizingBitmap = 0;
+        if (m_resizingBitmap.width() != m_impl->width() || m_resizingBitmap.height() != m_impl->height()) {
+            m_resizingBitmap.setConfig(SkBitmap::kARGB_8888_Config,
+                                       m_impl->width(),
+                                       m_impl->height());
+            if (!m_resizingBitmap.allocPixels()) {
                 return;
             }
         }
-        readbackBitmap = m_resizingBitmap;
+        readbackBitmap = &m_resizingBitmap;
     }
 
     // Read back the frame buffer.
     SkAutoLockPixels bitmapLock(*readbackBitmap);
     pixels = static_cast<unsigned char*>(readbackBitmap->getPixels());
-    glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
 #elif PLATFORM(CG)
-    if (m_renderOutput) {
+    if (m_renderOutput)
         pixels = m_renderOutput;
-        glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
-    }
 #else
 #error Must port to your platform
 #endif
 
-    if (mustRestoreFBO)
-        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
-    if (pixels)
-        flipVertically(pixels, m_cachedWidth, m_cachedHeight);
-#endif
+    m_impl->readBackFramebuffer(pixels, 4 * m_impl->width() * m_impl->height());
 
 #if PLATFORM(SKIA)
-    if (m_resizingBitmap) {
+    if (m_resizingBitmap.readyToDraw()) {
         // We need to draw the resizing bitmap into the canvas's backing store.
         SkCanvas canvas(*canvasBitmap);
         SkRect dst;
-        dst.set(0, 0, canvasBitmap->width(), canvasBitmap->height());
-        canvas.drawBitmapRect(*m_resizingBitmap, 0, dst);
+        dst.set(SkIntToScalar(0), SkIntToScalar(0), canvasBitmap->width(), canvasBitmap->height());
+        canvas.drawBitmapRect(m_resizingBitmap, 0, dst);
     }
 #elif PLATFORM(CG)
     if (m_renderOutput) {
-        int rowBytes = m_cachedWidth * 4;
-        CGDataProviderRef dataProvider = CGDataProviderCreateWithData(0, m_renderOutput, rowBytes * m_cachedHeight, 0);
+        int rowBytes = m_impl->width() * 4;
+        CGDataProviderRef dataProvider = CGDataProviderCreateWithData(0, m_renderOutput, rowBytes * m_impl->height(), 0);
         CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
-        CGImageRef cgImage = CGImageCreate(m_cachedWidth,
-                                           m_cachedHeight,
+        CGImageRef cgImage = CGImageCreate(m_impl->width(),
+                                           m_impl->height(),
                                            8,
                                            32,
                                            rowBytes,
@@ -861,282 +442,613 @@
 #else
 #error Must port to your platform
 #endif
-
-#endif  // RENDER_TO_DEBUGGING_WINDOW
 }
 
-void GraphicsContext3DInternal::activeTexture(unsigned long texture)
+void GraphicsContext3DInternal::endPaint()
 {
-    // FIXME: query number of textures available.
-    if (texture < GL_TEXTURE0 || texture > GL_TEXTURE0+32)
-        // FIXME: raise exception.
+}
+
+void GraphicsContext3DInternal::reshape(int width, int height)
+{
+    if (width == m_impl->width() && height == m_impl->height())
         return;
 
-    makeContextCurrent();
-    glActiveTexture(texture);
+    m_impl->reshape(width, height);
+
+#if PLATFORM(CG)
+    // Need to reallocate the client-side backing store.
+    // FIXME: make this more efficient.
+    if (m_renderOutput) {
+        delete[] m_renderOutput;
+        m_renderOutput = 0;
+    }
+    int rowBytes = width * 4;
+    m_renderOutput = new unsigned char[height * rowBytes];
+#endif // PLATFORM(CG)
 }
 
-void GraphicsContext3DInternal::bindBuffer(unsigned long target,
-                                           WebGLBuffer* buffer)
-{
-    makeContextCurrent();
-    GLuint bufID = EXTRACT(buffer);
-    if (target == GL_ARRAY_BUFFER)
-        m_boundArrayBuffer = bufID;
-    glBindBuffer(target, bufID);
+// Macros to assist in delegating from GraphicsContext3DInternal to
+// WebGraphicsContext3D.
+
+#define DELEGATE_TO_IMPL(name) \
+void GraphicsContext3DInternal::name() \
+{ \
+    m_impl->name(); \
 }
 
-void GraphicsContext3DInternal::bindFramebuffer(unsigned long target,
-                                                WebGLFramebuffer* framebuffer)
-{
-    makeContextCurrent();
-    GLuint id = EXTRACT(framebuffer);
-    if (!id)
-        id = m_fbo;
-    glBindFramebufferEXT(target, id);
-    m_boundFBO = id;
+#define DELEGATE_TO_IMPL_R(name, rt)           \
+rt GraphicsContext3DInternal::name() \
+{ \
+    return m_impl->name(); \
 }
 
+#define DELEGATE_TO_IMPL_1(name, t1) \
+void GraphicsContext3DInternal::name(t1 a1) \
+{ \
+    m_impl->name(a1); \
+}
+
+#define DELEGATE_TO_IMPL_1_X(name, t1) \
+void GraphicsContext3DInternal::name(t1 a1) \
+{ \
+    m_impl->name(EXTRACT(a1));                  \
+}
+
+#define DELEGATE_TO_IMPL_1R(name, t1, rt)    \
+rt GraphicsContext3DInternal::name(t1 a1) \
+{ \
+    return m_impl->name(a1); \
+}
+
+#define DELEGATE_TO_IMPL_1R_X(name, t1, rt)    \
+rt GraphicsContext3DInternal::name(t1 a1) \
+{ \
+    return m_impl->name(EXTRACT(a1));           \
+}
+
+#define DELEGATE_TO_IMPL_2(name, t1, t2) \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
+{ \
+    m_impl->name(a1, a2); \
+}
+
+#define DELEGATE_TO_IMPL_2_X12(name, t1, t2) \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
+{ \
+    m_impl->name(EXTRACT(a1), EXTRACT(a2));     \
+}
+
+#define DELEGATE_TO_IMPL_2_X2(name, t1, t2) \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
+{ \
+    m_impl->name(a1, EXTRACT(a2));     \
+}
+
+#define DELEGATE_TO_IMPL_2R(name, t1, t2, rt)  \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2) \
+{ \
+    return m_impl->name(a1, a2); \
+}
+
+#define DELEGATE_TO_IMPL_3(name, t1, t2, t3)   \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3)    \
+{ \
+    m_impl->name(a1, a2, a3);                  \
+}
+
+#define DELEGATE_TO_IMPL_3_X1(name, t1, t2, t3)   \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3)    \
+{ \
+    m_impl->name(EXTRACT(a1), a2, a3);          \
+}
+
+#define DELEGATE_TO_IMPL_3R(name, t1, t2, t3, rt)   \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3)    \
+{ \
+    return m_impl->name(a1, a2, a3);                  \
+}
+
+#define DELEGATE_TO_IMPL_4(name, t1, t2, t3, t4)    \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4)  \
+{ \
+    m_impl->name(a1, a2, a3, a4);              \
+}
+
+#define DELEGATE_TO_IMPL_4_X4(name, t1, t2, t3, t4)    \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4)  \
+{ \
+    m_impl->name(a1, a2, a3, EXTRACT(a4));      \
+}
+
+#define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5)      \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5);   \
+}
+
+#define DELEGATE_TO_IMPL_5_X4(name, t1, t2, t3, t4, t5)                \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
+{ \
+    m_impl->name(a1, a2, a3, EXTRACT(a4), a5);  \
+}
+
+#define DELEGATE_TO_IMPL_5R(name, t1, t2, t3, t4, t5, rt)      \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5);   \
+}
+
+#define DELEGATE_TO_IMPL_6(name, t1, t2, t3, t4, t5, t6)  \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6);       \
+}
+
+#define DELEGATE_TO_IMPL_6R(name, t1, t2, t3, t4, t5, t6, rt)  \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6);       \
+}
+
+#define DELEGATE_TO_IMPL_7(name, t1, t2, t3, t4, t5, t6, t7) \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6, a7);   \
+}
+
+#define DELEGATE_TO_IMPL_7R(name, t1, t2, t3, t4, t5, t6, t7, rt) \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6, a7);   \
+}
+
+#define DELEGATE_TO_IMPL_8(name, t1, t2, t3, t4, t5, t6, t7, t8)       \
+void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8);      \
+}
+
+#define DELEGATE_TO_IMPL_9R(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, rt) \
+rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9);   \
+}
+
+DELEGATE_TO_IMPL_R(makeContextCurrent, bool)
+DELEGATE_TO_IMPL_1R(sizeInBytes, int, int)
+
+DELEGATE_TO_IMPL_1(activeTexture, unsigned long)
+DELEGATE_TO_IMPL_2_X12(attachShader, WebGLProgram*, WebGLShader*)
+
+void GraphicsContext3DInternal::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name)
+{
+    m_impl->bindAttribLocation(EXTRACT(program), index, name.utf8().data());
+}
+
+DELEGATE_TO_IMPL_2_X2(bindBuffer, unsigned long, WebGLBuffer*)
+DELEGATE_TO_IMPL_2_X2(bindFramebuffer, unsigned long, WebGLFramebuffer*)
+DELEGATE_TO_IMPL_2_X2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*)
+
+static const int kTextureWrapR = 0x8072;
+
 // If we didn't have to hack GL_TEXTURE_WRAP_R for cube maps,
 // we could just use:
-// GL_SAME_METHOD_2_X2(BindTexture, bindTexture, unsigned long, WebGLTexture*)
+// DELEGATE_TO_IMPL_2_X2(bindTexture, unsigned long, WebGLTexture*)
 void GraphicsContext3DInternal::bindTexture(unsigned long target,
                                             WebGLTexture* texture)
 {
-    makeContextCurrent();
     unsigned int textureObject = EXTRACT(texture);
 
-    glBindTexture(target, textureObject);
+    m_impl->bindTexture(target, textureObject);
 
     // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0
     // API. On desktop OpenGL implementations it seems necessary to
     // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior
     // of cube maps.
-    if (texture) {
-        if (target == GL_TEXTURE_CUBE_MAP) {
+    if (texture)
+        if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
             if (!texture->isCubeMapRWrapModeInitialized()) {
-                glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+                m_impl->texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, kTextureWrapR, GraphicsContext3D::CLAMP_TO_EDGE);
                 texture->setCubeMapRWrapModeInitialized(true);
             }
         } else
             texture->setCubeMapRWrapModeInitialized(false);
-    }
 }
 
-void GraphicsContext3DInternal::bufferDataImpl(unsigned long target, int size, const void* data, unsigned long usage)
+DELEGATE_TO_IMPL_4(blendColor, double, double, double, double)
+DELEGATE_TO_IMPL_1(blendEquation, unsigned long)
+DELEGATE_TO_IMPL_2(blendEquationSeparate, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_2(blendFunc, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+
+void GraphicsContext3DInternal::bufferData(unsigned long target, int size, unsigned long usage)
 {
-    makeContextCurrent();
-    // FIXME: make this verification more efficient.
-    GLint binding = 0;
-    GLenum binding_target = GL_ARRAY_BUFFER_BINDING;
-    if (target == GL_ELEMENT_ARRAY_BUFFER)
-        binding_target = GL_ELEMENT_ARRAY_BUFFER_BINDING;
-    glGetIntegerv(binding_target, &binding);
-    if (binding <= 0) {
-        // FIXME: raise exception.
-        // LogMessagef(("bufferData: no buffer bound"));
-        return;
-    }
-
-    glBufferData(target,
-                   size,
-                   data,
-                   usage);
+    m_impl->bufferData(target, size, 0, usage);
 }
 
-void GraphicsContext3DInternal::disableVertexAttribArray(unsigned long index)
+void GraphicsContext3DInternal::bufferData(unsigned long target, WebGLArray* array, unsigned long usage)
 {
-    makeContextCurrent();
-    if (index < NumTrackedPointerStates)
-        m_vertexAttribPointerState[index].enabled = false;
-    glDisableVertexAttribArray(index);
+    m_impl->bufferData(target, array->byteLength(), array->baseAddress(), usage);
 }
 
-void GraphicsContext3DInternal::enableVertexAttribArray(unsigned long index)
+void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, WebGLArray* array)
 {
-    makeContextCurrent();
-    if (index < NumTrackedPointerStates)
-        m_vertexAttribPointerState[index].enabled = true;
-    glEnableVertexAttribArray(index);
+    m_impl->bufferSubData(target, offset, array->byteLength(), array->baseAddress());
 }
 
-unsigned long GraphicsContext3DInternal::getError()
+DELEGATE_TO_IMPL_1R(checkFramebufferStatus, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_1(clear, unsigned long)
+DELEGATE_TO_IMPL_4(clearColor, double, double, double, double)
+DELEGATE_TO_IMPL_1(clearDepth, double)
+DELEGATE_TO_IMPL_1(clearStencil, long)
+DELEGATE_TO_IMPL_4(colorMask, bool, bool, bool, bool)
+DELEGATE_TO_IMPL_1_X(compileShader, WebGLShader*)
+
+DELEGATE_TO_IMPL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
+DELEGATE_TO_IMPL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_1(cullFace, unsigned long)
+DELEGATE_TO_IMPL_1(depthFunc, unsigned long)
+DELEGATE_TO_IMPL_1(depthMask, bool)
+DELEGATE_TO_IMPL_2(depthRange, double, double)
+DELEGATE_TO_IMPL_2_X12(detachShader, WebGLProgram*, WebGLShader*)
+DELEGATE_TO_IMPL_1(disable, unsigned long)
+DELEGATE_TO_IMPL_1(disableVertexAttribArray, unsigned long)
+DELEGATE_TO_IMPL_3(drawArrays, unsigned long, long, long)
+DELEGATE_TO_IMPL_4(drawElements, unsigned long, unsigned long, unsigned long, long)
+
+DELEGATE_TO_IMPL_1(enable, unsigned long)
+DELEGATE_TO_IMPL_1(enableVertexAttribArray, unsigned long)
+DELEGATE_TO_IMPL(finish)
+DELEGATE_TO_IMPL(flush)
+DELEGATE_TO_IMPL_4_X4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*)
+DELEGATE_TO_IMPL_5_X4(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long)
+DELEGATE_TO_IMPL_1(frontFace, unsigned long)
+DELEGATE_TO_IMPL_1(generateMipmap, unsigned long)
+
+bool GraphicsContext3DInternal::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
 {
-    if (m_syntheticErrors.size() > 0) {
-        ListHashSet<unsigned long>::iterator iter = m_syntheticErrors.begin();
-        unsigned long err = *iter;
-        m_syntheticErrors.remove(iter);
-        return err;
-    }
-
-    makeContextCurrent();
-    return glGetError();
+    WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
+    if (!m_impl->getActiveAttrib(EXTRACT(program), index, webInfo))
+        return false;
+    info.name = webInfo.name;
+    info.type = webInfo.type;
+    info.size = webInfo.size;
+    return true;
 }
 
+bool GraphicsContext3DInternal::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
+{
+    WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
+    if (!m_impl->getActiveUniform(EXTRACT(program), index, webInfo))
+        return false;
+    info.name = webInfo.name;
+    info.type = webInfo.type;
+    info.size = webInfo.size;
+    return true;
+}
+
+int GraphicsContext3DInternal::getAttribLocation(WebGLProgram* program, const String& name)
+{
+    return m_impl->getAttribLocation(EXTRACT(program), name.utf8().data());
+}
+
+DELEGATE_TO_IMPL_2(getBooleanv, unsigned long, unsigned char*)
+
+DELEGATE_TO_IMPL_3(getBufferParameteriv, unsigned long, unsigned long, int*)
+
 GraphicsContext3D::Attributes GraphicsContext3DInternal::getContextAttributes()
 {
-    return m_attrs;
+    WebKit::WebGraphicsContext3D::Attributes webAttributes = m_impl->getContextAttributes();
+    GraphicsContext3D::Attributes attributes;
+    attributes.alpha = webAttributes.alpha;
+    attributes.depth = webAttributes.depth;
+    attributes.stencil = webAttributes.stencil;
+    attributes.antialias = webAttributes.antialias;
+    attributes.premultipliedAlpha = webAttributes.premultipliedAlpha;
+    return attributes;
 }
 
-void GraphicsContext3DInternal::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
-                                                    unsigned long stride, unsigned long offset)
+DELEGATE_TO_IMPL_R(getError, unsigned long)
+
+DELEGATE_TO_IMPL_2(getFloatv, unsigned long, float*)
+
+DELEGATE_TO_IMPL_4(getFramebufferAttachmentParameteriv, unsigned long, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_IMPL_2(getIntegerv, unsigned long, int*)
+
+DELEGATE_TO_IMPL_3_X1(getProgramiv, WebGLProgram*, unsigned long, int*)
+
+String GraphicsContext3DInternal::getProgramInfoLog(WebGLProgram* program)
 {
-    makeContextCurrent();
-
-    if (m_boundArrayBuffer <= 0) {
-        // FIXME: raise exception.
-        // LogMessagef(("bufferData: no buffer bound"));
-        return;
-    }
-
-    if (indx < NumTrackedPointerStates) {
-        VertexAttribPointerState& state = m_vertexAttribPointerState[indx];
-        state.buffer = m_boundArrayBuffer;
-        state.indx = indx;
-        state.size = size;
-        state.type = type;
-        state.normalized = normalized;
-        state.stride = stride;
-        state.offset = offset;
-    }
-
-    glVertexAttribPointer(indx, size, type, normalized, stride,
-                          reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+    return m_impl->getProgramInfoLog(EXTRACT(program));
 }
 
-void GraphicsContext3DInternal::viewportImpl(long x, long y, unsigned long width, unsigned long height)
+DELEGATE_TO_IMPL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_IMPL_3_X1(getShaderiv, WebGLShader*, unsigned long, int*)
+
+String GraphicsContext3DInternal::getShaderInfoLog(WebGLShader* shader)
 {
-    glViewport(x, y, width, height);
+    return m_impl->getShaderInfoLog(EXTRACT(shader));
 }
 
-void GraphicsContext3DInternal::synthesizeGLError(unsigned long error)
+String GraphicsContext3DInternal::getShaderSource(WebGLShader* shader)
 {
-    m_syntheticErrors.add(error);
+    return m_impl->getShaderSource(EXTRACT(shader));
 }
 
-// GraphicsContext3D -----------------------------------------------------
-
-/* Helper macros for when we're just wrapping a gl method, so that
- * we can avoid having to type this 500 times.  Note that these MUST
- * NOT BE USED if we need to check any of the parameters.
- */
-
-#define GL_SAME_METHOD_0(glname, name)                                         \
-void GraphicsContext3D::name()                                                 \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname();                                                              \
-}
-
-#define GL_SAME_METHOD_1(glname, name, t1)                                     \
-void GraphicsContext3D::name(t1 a1)                                            \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1);                                                            \
-}
-
-#define GL_SAME_METHOD_1_X(glname, name, t1)                                   \
-void GraphicsContext3D::name(t1 a1)                                            \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(EXTRACT(a1));                                                   \
-}
-
-#define GL_SAME_METHOD_2(glname, name, t1, t2)                                 \
-void GraphicsContext3D::name(t1 a1, t2 a2)                                     \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2);                                                        \
-}
-
-#define GL_SAME_METHOD_2_X12(glname, name, t1, t2)                             \
-void GraphicsContext3D::name(t1 a1, t2 a2)                                     \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(EXTRACT(a1), EXTRACT(a2));                                      \
-}
-
-#define GL_SAME_METHOD_2_X2(glname, name, t1, t2)                              \
-void GraphicsContext3D::name(t1 a1, t2 a2)                                     \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, EXTRACT(a2));                                               \
-}
-
-#define GL_SAME_METHOD_3(glname, name, t1, t2, t3)                             \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3)                              \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3);                                                    \
-}
-
-#define GL_SAME_METHOD_3_X12(glname, name, t1, t2, t3)                         \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3)                              \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(EXTRACT(a1), EXTRACT(a2), a3);                                  \
-}
-
-#define GL_SAME_METHOD_3_X2(glname, name, t1, t2, t3)                          \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3)                              \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, EXTRACT(a2), a3);                                           \
-}
-
-#define GL_SAME_METHOD_4(glname, name, t1, t2, t3, t4)                         \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4)                       \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, a4);                                                \
-}
-
-#define GL_SAME_METHOD_4_X4(glname, name, t1, t2, t3, t4)                      \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4)                       \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, EXTRACT(a4));                                       \
-}
-
-#define GL_SAME_METHOD_5(glname, name, t1, t2, t3, t4, t5)                     \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)                \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, a4, a5);                                            \
-}
-
-#define GL_SAME_METHOD_5_X4(glname, name, t1, t2, t3, t4, t5)                  \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)                \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, EXTRACT(a4), a5);                                   \
-}
-
-#define GL_SAME_METHOD_6(glname, name, t1, t2, t3, t4, t5, t6)                 \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6)         \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, a4, a5, a6);                                        \
-}
-
-#define GL_SAME_METHOD_8(glname, name, t1, t2, t3, t4, t5, t6, t7, t8)         \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8)   \
-{                                                                              \
-    makeContextCurrent();                                                      \
-    gl##glname(a1, a2, a3, a4, a5, a6, a7, a8);                                \
-}
-
-PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs)
+String GraphicsContext3DInternal::getString(unsigned long name)
 {
-    PassOwnPtr<GraphicsContext3D> context = new GraphicsContext3D(attrs);
-    // FIXME: add error checking
-    return context;
+    return m_impl->getString(name);
 }
 
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs)
-    : m_currentWidth(0)
-    , m_currentHeight(0)
-    , m_internal(new GraphicsContext3DInternal(attrs))
+DELEGATE_TO_IMPL_3(getTexParameterfv, unsigned long, unsigned long, float*)
+DELEGATE_TO_IMPL_3(getTexParameteriv, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_IMPL_3_X1(getUniformfv, WebGLProgram*, long, float*)
+DELEGATE_TO_IMPL_3_X1(getUniformiv, WebGLProgram*, long, int*)
+
+long GraphicsContext3DInternal::getUniformLocation(WebGLProgram* program, const String& name)
+{
+    return m_impl->getUniformLocation(EXTRACT(program), name.utf8().data());
+}
+
+DELEGATE_TO_IMPL_3(getVertexAttribfv, unsigned long, unsigned long, float*)
+DELEGATE_TO_IMPL_3(getVertexAttribiv, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_IMPL_2R(getVertexAttribOffset, unsigned long, unsigned long, long)
+
+DELEGATE_TO_IMPL_2(hint, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_1R_X(isBuffer, WebGLBuffer*, bool)
+DELEGATE_TO_IMPL_1R(isEnabled, unsigned long, bool)
+DELEGATE_TO_IMPL_1R_X(isFramebuffer, WebGLFramebuffer*, bool)
+DELEGATE_TO_IMPL_1R_X(isProgram, WebGLProgram*, bool)
+DELEGATE_TO_IMPL_1R_X(isRenderbuffer, WebGLRenderbuffer*, bool)
+DELEGATE_TO_IMPL_1R_X(isShader, WebGLShader*, bool)
+DELEGATE_TO_IMPL_1R_X(isTexture, WebGLTexture*, bool)
+DELEGATE_TO_IMPL_1(lineWidth, double)
+DELEGATE_TO_IMPL_1_X(linkProgram, WebGLProgram*)
+DELEGATE_TO_IMPL_2(pixelStorei, unsigned long, long)
+DELEGATE_TO_IMPL_2(polygonOffset, double, double)
+DELEGATE_TO_IMPL_7(readPixels, long, long, unsigned long, unsigned long, unsigned long, unsigned long, void*)
+DELEGATE_TO_IMPL(releaseShaderCompiler)
+DELEGATE_TO_IMPL_4(renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_2(sampleCoverage, double, bool)
+DELEGATE_TO_IMPL_4(scissor, long, long, unsigned long, unsigned long)
+
+void GraphicsContext3DInternal::shaderSource(WebGLShader* shader, const String& string)
+{
+    m_impl->shaderSource(EXTRACT(shader), string.utf8().data());
+}
+
+DELEGATE_TO_IMPL_3(stencilFunc, unsigned long, long, unsigned long)
+DELEGATE_TO_IMPL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
+DELEGATE_TO_IMPL_1(stencilMask, unsigned long)
+DELEGATE_TO_IMPL_2(stencilMaskSeparate, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_3(stencilOp, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_4(stencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+
+int GraphicsContext3DInternal::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+{
+    m_impl->texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    return 0;
+}
+
+DELEGATE_TO_IMPL_3(texParameterf, unsigned, unsigned, float)
+DELEGATE_TO_IMPL_3(texParameteri, unsigned, unsigned, int)
+
+int GraphicsContext3DInternal::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+{
+    m_impl->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    return 0;
+}
+
+DELEGATE_TO_IMPL_2(uniform1f, long, float)
+
+void GraphicsContext3DInternal::uniform1fv(long location, float* v, int size)
+{
+    m_impl->uniform1fv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_2(uniform1i, long, int)
+
+void GraphicsContext3DInternal::uniform1iv(long location, int* v, int size)
+{
+    m_impl->uniform1iv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_3(uniform2f, long, float, float)
+
+void GraphicsContext3DInternal::uniform2fv(long location, float* v, int size)
+{
+    m_impl->uniform2fv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_3(uniform2i, long, int, int)
+
+void GraphicsContext3DInternal::uniform2iv(long location, int* v, int size)
+{
+    m_impl->uniform2iv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_4(uniform3f, long, float, float, float)
+
+void GraphicsContext3DInternal::uniform3fv(long location, float* v, int size)
+{
+    m_impl->uniform3fv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_4(uniform3i, long, int, int, int)
+
+void GraphicsContext3DInternal::uniform3iv(long location, int* v, int size)
+{
+    m_impl->uniform3iv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_5(uniform4f, long, float, float, float, float)
+
+void GraphicsContext3DInternal::uniform4fv(long location, float* v, int size)
+{
+    m_impl->uniform4fv(location, size, v);
+}
+
+DELEGATE_TO_IMPL_5(uniform4i, long, int, int, int, int)
+
+void GraphicsContext3DInternal::uniform4iv(long location, int* v, int size)
+{
+    m_impl->uniform4iv(location, size, v);
+}
+
+void GraphicsContext3DInternal::uniformMatrix2fv(long location, bool transpose, float* value, int size)
+{
+    m_impl->uniformMatrix2fv(location, size, transpose, value);
+}
+
+void GraphicsContext3DInternal::uniformMatrix3fv(long location, bool transpose, float* value, int size)
+{
+    m_impl->uniformMatrix3fv(location, size, transpose, value);
+}
+
+void GraphicsContext3DInternal::uniformMatrix4fv(long location, bool transpose, float* value, int size)
+{
+    m_impl->uniformMatrix4fv(location, size, transpose, value);
+}
+
+DELEGATE_TO_IMPL_1_X(useProgram, WebGLProgram*)
+DELEGATE_TO_IMPL_1_X(validateProgram, WebGLProgram*)
+
+DELEGATE_TO_IMPL_2(vertexAttrib1f, unsigned long, float)
+DELEGATE_TO_IMPL_2(vertexAttrib1fv, unsigned long, float*)
+DELEGATE_TO_IMPL_3(vertexAttrib2f, unsigned long, float, float)
+DELEGATE_TO_IMPL_2(vertexAttrib2fv, unsigned long, float*)
+DELEGATE_TO_IMPL_4(vertexAttrib3f, unsigned long, float, float, float)
+DELEGATE_TO_IMPL_2(vertexAttrib3fv, unsigned long, float*)
+DELEGATE_TO_IMPL_5(vertexAttrib4f, unsigned long, float, float, float, float)
+DELEGATE_TO_IMPL_2(vertexAttrib4fv, unsigned long, float*)
+DELEGATE_TO_IMPL_6(vertexAttribPointer, unsigned long, int, int, bool, unsigned long, unsigned long)
+
+DELEGATE_TO_IMPL_4(viewport, long, long, unsigned long, unsigned long)
+
+DELEGATE_TO_IMPL_R(createBuffer, unsigned)
+DELEGATE_TO_IMPL_R(createFramebuffer, unsigned)
+DELEGATE_TO_IMPL_R(createProgram, unsigned)
+DELEGATE_TO_IMPL_R(createRenderbuffer, unsigned)
+DELEGATE_TO_IMPL_1R(createShader, unsigned long, unsigned)
+DELEGATE_TO_IMPL_R(createTexture, unsigned)
+
+DELEGATE_TO_IMPL_1(deleteBuffer, unsigned)
+DELEGATE_TO_IMPL_1(deleteFramebuffer, unsigned)
+DELEGATE_TO_IMPL_1(deleteProgram, unsigned)
+DELEGATE_TO_IMPL_1(deleteRenderbuffer, unsigned)
+DELEGATE_TO_IMPL_1(deleteShader, unsigned)
+DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
+
+DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
+
+//----------------------------------------------------------------------
+// GraphicsContext3D
+//
+
+// Macros to assist in delegating from GraphicsContext3D to
+// GraphicsContext3DInternal.
+
+#define DELEGATE_TO_INTERNAL(name) \
+void GraphicsContext3D::name() \
+{ \
+    m_internal->name(); \
+}
+
+#define DELEGATE_TO_INTERNAL_R(name, rt)           \
+rt GraphicsContext3D::name() \
+{ \
+    return m_internal->name(); \
+}
+
+#define DELEGATE_TO_INTERNAL_1(name, t1) \
+void GraphicsContext3D::name(t1 a1) \
+{ \
+    m_internal->name(a1); \
+}
+
+#define DELEGATE_TO_INTERNAL_1R(name, t1, rt)    \
+rt GraphicsContext3D::name(t1 a1) \
+{ \
+    return m_internal->name(a1); \
+}
+
+#define DELEGATE_TO_INTERNAL_2(name, t1, t2) \
+void GraphicsContext3D::name(t1 a1, t2 a2) \
+{ \
+    m_internal->name(a1, a2); \
+}
+
+#define DELEGATE_TO_INTERNAL_2R(name, t1, t2, rt)  \
+rt GraphicsContext3D::name(t1 a1, t2 a2) \
+{ \
+    return m_internal->name(a1, a2); \
+}
+
+#define DELEGATE_TO_INTERNAL_3(name, t1, t2, t3)   \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3)    \
+{ \
+    m_internal->name(a1, a2, a3);                  \
+}
+
+#define DELEGATE_TO_INTERNAL_3R(name, t1, t2, t3, rt)   \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3)    \
+{ \
+    return m_internal->name(a1, a2, a3);                  \
+}
+
+#define DELEGATE_TO_INTERNAL_4(name, t1, t2, t3, t4)    \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4)  \
+{ \
+    m_internal->name(a1, a2, a3, a4);              \
+}
+
+#define DELEGATE_TO_INTERNAL_5(name, t1, t2, t3, t4, t5)      \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
+{ \
+    m_internal->name(a1, a2, a3, a4, a5);   \
+}
+
+#define DELEGATE_TO_INTERNAL_6(name, t1, t2, t3, t4, t5, t6)  \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    m_internal->name(a1, a2, a3, a4, a5, a6);   \
+}
+
+#define DELEGATE_TO_INTERNAL_6R(name, t1, t2, t3, t4, t5, t6, rt)  \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    return m_internal->name(a1, a2, a3, a4, a5, a6);       \
+}
+
+#define DELEGATE_TO_INTERNAL_7(name, t1, t2, t3, t4, t5, t6, t7) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    m_internal->name(a1, a2, a3, a4, a5, a6, a7);   \
+}
+
+#define DELEGATE_TO_INTERNAL_7R(name, t1, t2, t3, t4, t5, t6, t7, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    return m_internal->name(a1, a2, a3, a4, a5, a6, a7);   \
+}
+
+#define DELEGATE_TO_INTERNAL_8(name, t1, t2, t3, t4, t5, t6, t7, t8)       \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) \
+{ \
+    m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8);      \
+}
+
+#define DELEGATE_TO_INTERNAL_9R(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{ \
+    return m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8, a9);   \
+}
+
+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*)
 {
 }
 
@@ -1144,6 +1056,18 @@
 {
 }
 
+PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
+{
+    GraphicsContext3DInternal* internal = new GraphicsContext3DInternal();
+    if (!internal->initialize(attrs)) {
+        delete internal;
+        return 0;
+    }
+    PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow);
+    result->m_internal.set(internal);
+    return result;
+}
+
 PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
 {
     return m_internal->platformGraphicsContext3D();
@@ -1154,724 +1078,130 @@
     return m_internal->platformTexture();
 }
 
-void GraphicsContext3D::makeContextCurrent()
-{
-    m_internal->makeContextCurrent();
-}
+DELEGATE_TO_INTERNAL(makeContextCurrent)
+DELEGATE_TO_INTERNAL_1R(sizeInBytes, int, int)
+DELEGATE_TO_INTERNAL_2(reshape, int, int)
 
-void GraphicsContext3D::reshape(int width, int height)
-{
-    if (width == m_currentWidth && height == m_currentHeight)
-        return;
+DELEGATE_TO_INTERNAL_1(activeTexture, unsigned long)
+DELEGATE_TO_INTERNAL_2(attachShader, WebGLProgram*, WebGLShader*)
+DELEGATE_TO_INTERNAL_3(bindAttribLocation, WebGLProgram*, unsigned long, const String&)
 
-    m_currentWidth = width;
-    m_currentHeight = height;
+DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, WebGLBuffer*)
+DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, WebGLFramebuffer*)
+DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*)
+DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, WebGLTexture*)
+DELEGATE_TO_INTERNAL_4(blendColor, double, double, double, double)
+DELEGATE_TO_INTERNAL_1(blendEquation, unsigned long)
+DELEGATE_TO_INTERNAL_2(blendEquationSeparate, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_2(blendFunc, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
 
-    m_internal->reshape(width, height);
-}
+DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, int, unsigned long)
+DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, WebGLArray*, unsigned long)
+DELEGATE_TO_INTERNAL_3(bufferSubData, unsigned long, long, WebGLArray*)
 
-void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
-{
-    m_internal->beginPaint(context);
-}
+DELEGATE_TO_INTERNAL_1R(checkFramebufferStatus, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_1(clear, unsigned long)
+DELEGATE_TO_INTERNAL_4(clearColor, double, double, double, double)
+DELEGATE_TO_INTERNAL_1(clearDepth, double)
+DELEGATE_TO_INTERNAL_1(clearStencil, long)
+DELEGATE_TO_INTERNAL_4(colorMask, bool, bool, bool, bool)
+DELEGATE_TO_INTERNAL_1(compileShader, WebGLShader*)
 
-void GraphicsContext3D::endPaint()
-{
-}
+DELEGATE_TO_INTERNAL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
+DELEGATE_TO_INTERNAL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_1(cullFace, unsigned long)
+DELEGATE_TO_INTERNAL_1(depthFunc, unsigned long)
+DELEGATE_TO_INTERNAL_1(depthMask, bool)
+DELEGATE_TO_INTERNAL_2(depthRange, double, double)
+DELEGATE_TO_INTERNAL_2(detachShader, WebGLProgram*, WebGLShader*)
+DELEGATE_TO_INTERNAL_1(disable, unsigned long)
+DELEGATE_TO_INTERNAL_1(disableVertexAttribArray, unsigned long)
+DELEGATE_TO_INTERNAL_3(drawArrays, unsigned long, long, long)
+DELEGATE_TO_INTERNAL_4(drawElements, unsigned long, unsigned long, unsigned long, long)
 
-int GraphicsContext3D::sizeInBytes(int type)
-{
-    switch (type) {
-    case GL_BYTE:
-        return sizeof(GLbyte);
-    case GL_UNSIGNED_BYTE:
-        return sizeof(GLubyte);
-    case GL_SHORT:
-        return sizeof(GLshort);
-    case GL_UNSIGNED_SHORT:
-        return sizeof(GLushort);
-    case GL_INT:
-        return sizeof(GLint);
-    case GL_UNSIGNED_INT:
-        return sizeof(GLuint);
-    case GL_FLOAT:
-        return sizeof(GLfloat);
-    default: // FIXME: default cases are discouraged in WebKit.
-        return 0;
-    }
-}
+DELEGATE_TO_INTERNAL_1(enable, unsigned long)
+DELEGATE_TO_INTERNAL_1(enableVertexAttribArray, unsigned long)
+DELEGATE_TO_INTERNAL(finish)
+DELEGATE_TO_INTERNAL(flush)
+DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*)
+DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long)
+DELEGATE_TO_INTERNAL_1(frontFace, unsigned long)
+DELEGATE_TO_INTERNAL_1(generateMipmap, unsigned long)
 
-unsigned GraphicsContext3D::createBuffer()
-{
-    makeContextCurrent();
-    GLuint o;
-    glGenBuffers(1, &o);
-    return o;
-}
+DELEGATE_TO_INTERNAL_3R(getActiveAttrib, WebGLProgram*, unsigned long, ActiveInfo&, bool)
+DELEGATE_TO_INTERNAL_3R(getActiveUniform, WebGLProgram*, unsigned long, ActiveInfo&, bool)
 
-unsigned GraphicsContext3D::createFramebuffer()
-{
-    makeContextCurrent();
-    GLuint o = 0;
-    glGenFramebuffersEXT(1, &o);
-    return o;
-}
+DELEGATE_TO_INTERNAL_2R(getAttribLocation, WebGLProgram*, const String&, int)
 
-unsigned GraphicsContext3D::createProgram()
-{
-    makeContextCurrent();
-    return glCreateProgram();
-}
+DELEGATE_TO_INTERNAL_2(getBooleanv, unsigned long, unsigned char*)
 
-unsigned GraphicsContext3D::createRenderbuffer()
-{
-    makeContextCurrent();
-    GLuint o;
-    glGenRenderbuffersEXT(1, &o);
-    return o;
-}
+DELEGATE_TO_INTERNAL_3(getBufferParameteriv, unsigned long, unsigned long, int*)
 
-unsigned GraphicsContext3D::createShader(unsigned long type)
-{
-    makeContextCurrent();
-    return glCreateShader((type == FRAGMENT_SHADER) ? GL_FRAGMENT_SHADER : GL_VERTEX_SHADER);
-}
+DELEGATE_TO_INTERNAL_R(getContextAttributes, GraphicsContext3D::Attributes)
 
-unsigned GraphicsContext3D::createTexture()
-{
-    makeContextCurrent();
-    GLuint o;
-    glGenTextures(1, &o);
-    return o;
-}
+DELEGATE_TO_INTERNAL_R(getError, unsigned long)
 
-void GraphicsContext3D::deleteBuffer(unsigned buffer)
-{
-    makeContextCurrent();
-    glDeleteBuffers(1, &buffer);
-}
+DELEGATE_TO_INTERNAL_2(getFloatv, unsigned long, float*)
 
-void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
-{
-    makeContextCurrent();
-    glDeleteFramebuffersEXT(1, &framebuffer);
-}
+DELEGATE_TO_INTERNAL_4(getFramebufferAttachmentParameteriv, unsigned long, unsigned long, unsigned long, int*)
 
-void GraphicsContext3D::deleteProgram(unsigned program)
-{
-    makeContextCurrent();
-    glDeleteProgram(program);
-}
+DELEGATE_TO_INTERNAL_2(getIntegerv, unsigned long, int*)
 
-void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
-{
-    makeContextCurrent();
-    glDeleteRenderbuffersEXT(1, &renderbuffer);
-}
+DELEGATE_TO_INTERNAL_3(getProgramiv, WebGLProgram*, unsigned long, int*)
 
-void GraphicsContext3D::deleteShader(unsigned shader)
-{
-    makeContextCurrent();
-    glDeleteShader(shader);
-}
+DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, WebGLProgram*, String)
 
-void GraphicsContext3D::deleteTexture(unsigned texture)
-{
-    makeContextCurrent();
-    glDeleteTextures(1, &texture);
-}
+DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
 
-void GraphicsContext3D::activeTexture(unsigned long texture)
-{
-    m_internal->activeTexture(texture);
-}
+DELEGATE_TO_INTERNAL_3(getShaderiv, WebGLShader*, unsigned long, int*)
 
-GL_SAME_METHOD_2_X12(AttachShader, attachShader, WebGLProgram*, WebGLShader*)
+DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, WebGLShader*, String)
 
-void GraphicsContext3D::bindAttribLocation(WebGLProgram* program,
-                                           unsigned long index,
-                                           const String& name)
-{
-    if (!program)
-        return;
-    makeContextCurrent();
-    glBindAttribLocation(EXTRACT(program), index, name.utf8().data());
-}
+DELEGATE_TO_INTERNAL_1R(getShaderSource, WebGLShader*, String)
+DELEGATE_TO_INTERNAL_1R(getString, unsigned long, String)
 
-void GraphicsContext3D::bindBuffer(unsigned long target,
-                                   WebGLBuffer* buffer)
-{
-    m_internal->bindBuffer(target, buffer);
-}
+DELEGATE_TO_INTERNAL_3(getTexParameterfv, unsigned long, unsigned long, float*)
+DELEGATE_TO_INTERNAL_3(getTexParameteriv, unsigned long, unsigned long, int*)
 
-void GraphicsContext3D::bindFramebuffer(unsigned long target, WebGLFramebuffer* framebuffer)
-{
-    m_internal->bindFramebuffer(target, framebuffer);
-}
+DELEGATE_TO_INTERNAL_3(getUniformfv, WebGLProgram*, long, float*)
+DELEGATE_TO_INTERNAL_3(getUniformiv, WebGLProgram*, long, int*)
 
-GL_SAME_METHOD_2_X2(BindRenderbufferEXT, bindRenderbuffer, unsigned long, WebGLRenderbuffer*)
+DELEGATE_TO_INTERNAL_2R(getUniformLocation, WebGLProgram*, const String&, long)
 
-// If we didn't have to hack GL_TEXTURE_WRAP_R for cube maps,
-// we could just use:
-// GL_SAME_METHOD_2_X2(BindTexture, bindTexture, unsigned long, WebGLTexture*)
-void GraphicsContext3D::bindTexture(unsigned long target,
-                                    WebGLTexture* texture)
-{
-    m_internal->bindTexture(target, texture);
-}
+DELEGATE_TO_INTERNAL_3(getVertexAttribfv, unsigned long, unsigned long, float*)
+DELEGATE_TO_INTERNAL_3(getVertexAttribiv, unsigned long, unsigned long, int*)
 
-GL_SAME_METHOD_4(BlendColor, blendColor, double, double, double, double)
+DELEGATE_TO_INTERNAL_2R(getVertexAttribOffset, unsigned long, unsigned long, long)
 
-GL_SAME_METHOD_1(BlendEquation, blendEquation, unsigned long)
+DELEGATE_TO_INTERNAL_2(hint, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_1R(isBuffer, WebGLBuffer*, bool)
+DELEGATE_TO_INTERNAL_1R(isEnabled, unsigned long, bool)
+DELEGATE_TO_INTERNAL_1R(isFramebuffer, WebGLFramebuffer*, bool)
+DELEGATE_TO_INTERNAL_1R(isProgram, WebGLProgram*, bool)
+DELEGATE_TO_INTERNAL_1R(isRenderbuffer, WebGLRenderbuffer*, bool)
+DELEGATE_TO_INTERNAL_1R(isShader, WebGLShader*, bool)
+DELEGATE_TO_INTERNAL_1R(isTexture, WebGLTexture*, bool)
+DELEGATE_TO_INTERNAL_1(lineWidth, double)
+DELEGATE_TO_INTERNAL_1(linkProgram, WebGLProgram*)
+DELEGATE_TO_INTERNAL_2(pixelStorei, unsigned long, long)
+DELEGATE_TO_INTERNAL_2(polygonOffset, double, double)
 
-GL_SAME_METHOD_2(BlendEquationSeparate, blendEquationSeparate, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_7(readPixels, long, long, unsigned long, unsigned long, unsigned long, unsigned long, void*)
 
-GL_SAME_METHOD_2(BlendFunc, blendFunc, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL(releaseShaderCompiler)
+DELEGATE_TO_INTERNAL_4(renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_2(sampleCoverage, double, bool)
+DELEGATE_TO_INTERNAL_4(scissor, long, long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_2(shaderSource, WebGLShader*, const String&)
+DELEGATE_TO_INTERNAL_3(stencilFunc, unsigned long, long, unsigned long)
+DELEGATE_TO_INTERNAL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
+DELEGATE_TO_INTERNAL_1(stencilMask, unsigned long)
+DELEGATE_TO_INTERNAL_2(stencilMaskSeparate, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_3(stencilOp, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_4(stencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
 
-GL_SAME_METHOD_4(BlendFuncSeparate, blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
-
-void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
-{
-    m_internal->bufferDataImpl(target, size, 0, usage);
-}
-
-void GraphicsContext3D::bufferData(unsigned long target, WebGLArray* array, unsigned long usage)
-{
-    m_internal->bufferDataImpl(target, array->byteLength(), array->baseAddress(), usage);
-}
-
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, WebGLArray* array)
-{
-    if (!array || !array->length())
-        return;
-
-    makeContextCurrent();
-    // FIXME: make this verification more efficient.
-    GLint binding = 0;
-    GLenum binding_target = GL_ARRAY_BUFFER_BINDING;
-    if (target == GL_ELEMENT_ARRAY_BUFFER)
-        binding_target = GL_ELEMENT_ARRAY_BUFFER_BINDING;
-    glGetIntegerv(binding_target, &binding);
-    if (binding <= 0) {
-        // FIXME: raise exception.
-        // LogMessagef(("bufferSubData: no buffer bound"));
-        return;
-    }
-    glBufferSubData(target, offset, array->byteLength(), array->baseAddress());
-}
-
-unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
-{
-    makeContextCurrent();
-    return glCheckFramebufferStatusEXT(target);
-}
-
-GL_SAME_METHOD_1(Clear, clear, unsigned long)
-
-GL_SAME_METHOD_4(ClearColor, clearColor, double, double, double, double)
-
-GL_SAME_METHOD_1(ClearDepth, clearDepth, double)
-
-GL_SAME_METHOD_1(ClearStencil, clearStencil, long)
-
-GL_SAME_METHOD_4(ColorMask, colorMask, bool, bool, bool, bool)
-
-GL_SAME_METHOD_1_X(CompileShader, compileShader, WebGLShader*)
-
-GL_SAME_METHOD_8(CopyTexImage2D, copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
-
-GL_SAME_METHOD_8(CopyTexSubImage2D, copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
-
-GL_SAME_METHOD_1(CullFace, cullFace, unsigned long)
-
-GL_SAME_METHOD_1(DepthFunc, depthFunc, unsigned long)
-
-GL_SAME_METHOD_1(DepthMask, depthMask, bool)
-
-GL_SAME_METHOD_2(DepthRange, depthRange, double, double)
-
-void GraphicsContext3D::detachShader(WebGLProgram* program, WebGLShader* shader)
-{
-    if (!program || !shader)
-        return;
-
-    makeContextCurrent();
-    glDetachShader(EXTRACT(program), EXTRACT(shader));
-}
-
-GL_SAME_METHOD_1(Disable, disable, unsigned long)
-
-void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
-{
-    m_internal->disableVertexAttribArray(index);
-}
-
-void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
-{
-    switch (mode) {
-    case GL_TRIANGLES:
-    case GL_TRIANGLE_STRIP:
-    case GL_TRIANGLE_FAN:
-    case GL_POINTS:
-    case GL_LINE_STRIP:
-    case GL_LINE_LOOP:
-    case GL_LINES:
-        break;
-    default: // FIXME: default cases are discouraged in WebKit.
-        // FIXME: output log message, raise exception.
-        // LogMessage(NS_LITERAL_CSTRING("drawArrays: invalid mode"));
-        // return NS_ERROR_DOM_SYNTAX_ERR;
-        return;
-    }
-
-    if (first+count < first || first+count < count) {
-        // FIXME: output log message, raise exception.
-        // LogMessage(NS_LITERAL_CSTRING("drawArrays: overflow in first+count"));
-        // return NS_ERROR_INVALID_ARG;
-        return;
-    }
-
-    // FIXME: validate against currently bound buffer.
-    // if (!ValidateBuffers(first+count))
-    //     return NS_ERROR_INVALID_ARG;
-
-    makeContextCurrent();
-    glDrawArrays(mode, first, count);
-}
-
-void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
-{
-    makeContextCurrent();
-    // FIXME: make this verification more efficient.
-    GLint binding = 0;
-    GLenum binding_target = GL_ELEMENT_ARRAY_BUFFER_BINDING;
-    glGetIntegerv(binding_target, &binding);
-    if (binding <= 0) {
-        // FIXME: raise exception.
-        // LogMessagef(("bufferData: no buffer bound"));
-        return;
-    }
-    glDrawElements(mode, count, type,
-                   reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
-}
-
-GL_SAME_METHOD_1(Enable, enable, unsigned long)
-
-void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
-{
-    m_internal->enableVertexAttribArray(index);
-}
-
-GL_SAME_METHOD_0(Finish, finish)
-
-GL_SAME_METHOD_0(Flush, flush)
-
-GL_SAME_METHOD_4_X4(FramebufferRenderbufferEXT, framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*)
-
-GL_SAME_METHOD_5_X4(FramebufferTexture2DEXT, framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long)
-
-GL_SAME_METHOD_1(FrontFace, frontFace, unsigned long)
-
-void GraphicsContext3D::generateMipmap(unsigned long target)
-{
-    makeContextCurrent();
-    if (glGenerateMipmapEXT)
-        glGenerateMipmapEXT(target);
-    // FIXME: provide alternative code path? This will be unpleasant
-    // to implement if glGenerateMipmapEXT is not available -- it will
-    // require a texture readback and re-upload.
-}
-
-bool GraphicsContext3D::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
-{
-    if (!program) {
-        synthesizeGLError(INVALID_VALUE);
-        return false;
-    }
-    GLint maxNameLength = -1;
-    glGetProgramiv(EXTRACT(program), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLength);
-    if (maxNameLength < 0)
-        return false;
-    GLchar* name = 0;
-    if (!tryFastMalloc(maxNameLength * sizeof(GLchar)).getValue(name)) {
-        synthesizeGLError(OUT_OF_MEMORY);
-        return false;
-    }
-    GLsizei length = 0;
-    GLint size = -1;
-    GLenum type = 0;
-    glGetActiveAttrib(EXTRACT(program), index, maxNameLength,
-                      &length, &size, &type, name);
-    if (size < 0) {
-        fastFree(name);
-        return false;
-    }
-    info.name = String(name, length);
-    info.type = type;
-    info.size = size;
-    fastFree(name);
-    return true;
-}
-
-bool GraphicsContext3D::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
-{
-    if (!program) {
-        synthesizeGLError(INVALID_VALUE);
-        return false;
-    }
-    GLint maxNameLength = -1;
-    glGetProgramiv(EXTRACT(program), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength);
-    if (maxNameLength < 0)
-        return false;
-    GLchar* name = 0;
-    if (!tryFastMalloc(maxNameLength * sizeof(GLchar)).getValue(name)) {
-        synthesizeGLError(OUT_OF_MEMORY);
-        return false;
-    }
-    GLsizei length = 0;
-    GLint size = -1;
-    GLenum type = 0;
-    glGetActiveUniform(EXTRACT(program), index, maxNameLength,
-                       &length, &size, &type, name);
-    if (size < 0) {
-        fastFree(name);
-        return false;
-    }
-    info.name = String(name, length);
-    info.type = type;
-    info.size = size;
-    fastFree(name);
-    return true;
-}
-
-int GraphicsContext3D::getAttribLocation(WebGLProgram* program, const String& name)
-{
-    if (!program)
-        return -1;
-
-    makeContextCurrent();
-    return glGetAttribLocation(EXTRACT(program), name.utf8().data());
-}
-
-void GraphicsContext3D::getBooleanv(unsigned long pname, unsigned char* value)
-{
-    makeContextCurrent();
-    glGetBooleanv(pname, value);
-}
-
-void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long pname, int* value)
-{
-    makeContextCurrent();
-    glGetBufferParameteriv(target, pname, value);
-}
-
-GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
-{
-    return m_internal->getContextAttributes();
-}
-
-unsigned long GraphicsContext3D::getError()
-{
-    return m_internal->getError();
-}
-
-void GraphicsContext3D::getFloatv(unsigned long pname, float* value)
-{
-    makeContextCurrent();
-    glGetFloatv(pname, value);
-}
-
-void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target,
-                                                            unsigned long attachment,
-                                                            unsigned long pname,
-                                                            int* value)
-{
-    makeContextCurrent();
-    glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
-}
-
-void GraphicsContext3D::getIntegerv(unsigned long pname, int* value)
-{
-    makeContextCurrent();
-    glGetIntegerv(pname, value);
-}
-
-void GraphicsContext3D::getProgramiv(WebGLProgram* program,
-                                     unsigned long pname,
-                                     int* value)
-{
-    makeContextCurrent();
-    glGetProgramiv(EXTRACT(program), pname, value);
-}
-
-String GraphicsContext3D::getProgramInfoLog(WebGLProgram* program)
-{
-    makeContextCurrent();
-    GLuint programID = EXTRACT(program);
-    GLint logLength;
-    glGetProgramiv(programID, GL_INFO_LOG_LENGTH, &logLength);
-    if (!logLength)
-        return String();
-    GLchar* log = 0;
-    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
-        return String();
-    GLsizei returnedLogLength;
-    glGetProgramInfoLog(programID, logLength, &returnedLogLength, log);
-    ASSERT(logLength == returnedLogLength + 1);
-    String res = String(log, returnedLogLength);
-    fastFree(log);
-    return res;
-}
-
-void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target,
-                                                   unsigned long pname,
-                                                   int* value)
-{
-    makeContextCurrent();
-    glGetRenderbufferParameterivEXT(target, pname, value);
-}
-
-void GraphicsContext3D::getShaderiv(WebGLShader* shader,
-                                    unsigned long pname,
-                                    int* value)
-{
-    makeContextCurrent();
-    glGetShaderiv(EXTRACT(shader), pname, value);
-}
-
-String GraphicsContext3D::getShaderInfoLog(WebGLShader* shader)
-{
-    makeContextCurrent();
-    GLuint shaderID = EXTRACT(shader);
-    GLint logLength;
-    glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &logLength);
-    if (!logLength)
-        return String();
-    GLchar* log = 0;
-    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
-        return String();
-    GLsizei returnedLogLength;
-    glGetShaderInfoLog(shaderID, logLength, &returnedLogLength, log);
-    ASSERT(logLength == returnedLogLength + 1);
-    String res = String(log, returnedLogLength);
-    fastFree(log);
-    return res;
-}
-
-String GraphicsContext3D::getShaderSource(WebGLShader* shader)
-{
-    makeContextCurrent();
-    GLuint shaderID = EXTRACT(shader);
-    GLint logLength;
-    glGetShaderiv(shaderID, GL_SHADER_SOURCE_LENGTH, &logLength);
-    if (!logLength)
-        return String();
-    GLchar* log = 0;
-    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
-        return String();
-    GLsizei returnedLogLength;
-    glGetShaderSource(shaderID, logLength, &returnedLogLength, log);
-    ASSERT(logLength == returnedLogLength + 1);
-    String res = String(log, returnedLogLength);
-    fastFree(log);
-    return res;
-}
-
-String GraphicsContext3D::getString(unsigned long name)
-{
-    makeContextCurrent();
-    return String(reinterpret_cast<const char*>(glGetString(name)));
-}
-
-void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long pname, float* value)
-{
-    makeContextCurrent();
-    glGetTexParameterfv(target, pname, value);
-}
-
-void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long pname, int* value)
-{
-    makeContextCurrent();
-    glGetTexParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getUniformfv(WebGLProgram* program, long location, float* value)
-{
-    makeContextCurrent();
-    glGetUniformfv(EXTRACT(program), location, value);
-}
-
-void GraphicsContext3D::getUniformiv(WebGLProgram* program, long location, int* value)
-{
-    makeContextCurrent();
-    glGetUniformiv(EXTRACT(program), location, value);
-}
-
-long GraphicsContext3D::getUniformLocation(WebGLProgram* program, const String& name)
-{
-    if (!program)
-        return -1;
-
-    makeContextCurrent();
-    return glGetUniformLocation(EXTRACT(program), name.utf8().data());
-}
-
-void GraphicsContext3D::getVertexAttribfv(unsigned long index,
-                                          unsigned long pname,
-                                          float* value)
-{
-    makeContextCurrent();
-    glGetVertexAttribfv(index, pname, value);
-}
-
-void GraphicsContext3D::getVertexAttribiv(unsigned long index,
-                                          unsigned long pname,
-                                          int* value)
-{
-    makeContextCurrent();
-    glGetVertexAttribiv(index, pname, value);
-}
-
-long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long pname)
-{
-    // FIXME: implement.
-    notImplemented();
-    return 0;
-}
-
-GL_SAME_METHOD_2(Hint, hint, unsigned long, unsigned long);
-
-bool GraphicsContext3D::isBuffer(WebGLBuffer* buffer)
-{
-    makeContextCurrent();
-    return glIsBuffer(EXTRACT(buffer));
-}
-
-bool GraphicsContext3D::isEnabled(unsigned long cap)
-{
-    makeContextCurrent();
-    return glIsEnabled(cap);
-}
-
-bool GraphicsContext3D::isFramebuffer(WebGLFramebuffer* framebuffer)
-{
-    makeContextCurrent();
-    return glIsFramebufferEXT(EXTRACT(framebuffer));
-}
-
-bool GraphicsContext3D::isProgram(WebGLProgram* program)
-{
-    makeContextCurrent();
-    return glIsProgram(EXTRACT(program));
-}
-
-bool GraphicsContext3D::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
-{
-    makeContextCurrent();
-    return glIsRenderbufferEXT(EXTRACT(renderbuffer));
-}
-
-bool GraphicsContext3D::isShader(WebGLShader* shader)
-{
-    makeContextCurrent();
-    return glIsShader(EXTRACT(shader));
-}
-
-bool GraphicsContext3D::isTexture(WebGLTexture* texture)
-{
-    makeContextCurrent();
-    return glIsTexture(EXTRACT(texture));
-}
-
-GL_SAME_METHOD_1(LineWidth, lineWidth, double)
-
-GL_SAME_METHOD_1_X(LinkProgram, linkProgram, WebGLProgram*)
-
-void GraphicsContext3D::pixelStorei(unsigned long pname, long param)
-{
-    if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) {
-        // FIXME: Create a fake GL error and throw an exception.
-        return;
-    }
-
-    makeContextCurrent();
-    glPixelStorei(pname, param);
-}
-
-GL_SAME_METHOD_2(PolygonOffset, polygonOffset, double, double)
-
-PassRefPtr<WebGLArray> GraphicsContext3D::readPixels(long x, long y,
-                                                      unsigned long width, unsigned long height,
-                                                      unsigned long format, unsigned long type) {
-    // FIXME: support more pixel formats and types.
-    if (!((format == GL_RGBA) && (type == GL_UNSIGNED_BYTE)))
-        return 0;
-
-    // FIXME: take into account pack alignment.
-    RefPtr<WebGLUnsignedByteArray> array = WebGLUnsignedByteArray::create(width * height * 4);
-    glReadPixels(x, y, width, height, format, type, array->baseAddress());
-    return array;
-}
-
-void GraphicsContext3D::releaseShaderCompiler()
-{
-}
-
-GL_SAME_METHOD_4(RenderbufferStorageEXT, renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long)
-
-GL_SAME_METHOD_2(SampleCoverage, sampleCoverage, double, bool)
-
-GL_SAME_METHOD_4(Scissor, scissor, long, long, unsigned long, unsigned long)
-
-void GraphicsContext3D::shaderSource(WebGLShader* shader, const String& source)
-{
-    makeContextCurrent();
-    CString str = source.utf8();
-    const char* data = str.data();
-    GLint length = str.length();
-    glShaderSource(EXTRACT(shader), 1, &data, &length);
-}
-
-GL_SAME_METHOD_3(StencilFunc, stencilFunc, unsigned long, long, unsigned long)
-
-GL_SAME_METHOD_4(StencilFuncSeparate, stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
-
-GL_SAME_METHOD_1(StencilMask, stencilMask, unsigned long)
-
-GL_SAME_METHOD_2(StencilMaskSeparate, stencilMaskSeparate, unsigned long, unsigned long)
-
-GL_SAME_METHOD_3(StencilOp, stencilOp, unsigned long, unsigned long, unsigned long)
-
-GL_SAME_METHOD_4(StencilOpSeparate, stencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
-
-void GraphicsContext3D::synthesizeGLError(unsigned long error)
-{
-    m_internal->synthesizeGLError(error);
-}
-
-int GraphicsContext3D::texImage2D(unsigned target,
-                                  unsigned level,
-                                  unsigned internalformat,
-                                  unsigned width,
-                                  unsigned height,
-                                  unsigned border,
-                                  unsigned format,
-                                  unsigned type,
-                                  void* pixels)
-{
-    // FIXME: must do validation similar to JOGL's to ensure that
-    // the incoming array is of the appropriate length.
-    glTexImage2D(target,
-                 level,
-                 internalformat,
-                 width,
-                 height,
-                 border,
-                 format,
-                 type,
-                 pixels);
-    return 0;
-}
+DELEGATE_TO_INTERNAL_9R(texImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, void*, int)
 
 int GraphicsContext3D::texImage2D(unsigned target, unsigned level, Image* image,
                                   bool flipY, bool premultiplyAlpha)
@@ -1880,29 +1210,15 @@
     unsigned int format, internalFormat;
     if (!extractImageData(image, flipY, premultiplyAlpha, imageData, &format, &internalFormat))
         return -1;
-    glTexImage2D(target, level, internalFormat,
-                 image->width(), image->height(), 0,
-                 format, GL_UNSIGNED_BYTE, imageData.data());
-    return 0;
+    return m_internal->texImage2D(target, level, internalFormat,
+                                  image->width(), image->height(), 0,
+                                  format, UNSIGNED_BYTE, imageData.data());
 }
 
-GL_SAME_METHOD_3(TexParameterf, texParameterf, unsigned, unsigned, float);
+DELEGATE_TO_INTERNAL_3(texParameterf, unsigned, unsigned, float)
+DELEGATE_TO_INTERNAL_3(texParameteri, unsigned, unsigned, int)
 
-GL_SAME_METHOD_3(TexParameteri, texParameteri, unsigned, unsigned, int);
-
-int GraphicsContext3D::texSubImage2D(unsigned target,
-                                     unsigned level,
-                                     unsigned xoffset,
-                                     unsigned yoffset,
-                                     unsigned width,
-                                     unsigned height,
-                                     unsigned format,
-                                     unsigned type,
-                                     void* pixels)
-{
-    glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-    return 0;
-}
+DELEGATE_TO_INTERNAL_9R(texSubImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, void*, int)
 
 int GraphicsContext3D::texSubImage2D(unsigned target,
                                      unsigned level,
@@ -1916,142 +1232,65 @@
     unsigned int format, internalFormat;
     if (!extractImageData(image, flipY, premultiplyAlpha, imageData, &format, &internalFormat))
         return -1;
-    glTexSubImage2D(target, level, xoffset, yoffset,
-                    image->width(), image->height(),
-                    format, GL_UNSIGNED_BYTE, imageData.data());
-    return 0;
+    return m_internal->texSubImage2D(target, level, xoffset, yoffset,
+                                     image->width(), image->height(),
+                                     format, UNSIGNED_BYTE, imageData.data());
 }
 
-GL_SAME_METHOD_2(Uniform1f, uniform1f, long, float)
+DELEGATE_TO_INTERNAL_2(uniform1f, long, float)
+DELEGATE_TO_INTERNAL_3(uniform1fv, long, float*, int)
+DELEGATE_TO_INTERNAL_2(uniform1i, long, int)
+DELEGATE_TO_INTERNAL_3(uniform1iv, long, int*, int)
+DELEGATE_TO_INTERNAL_3(uniform2f, long, float, float)
+DELEGATE_TO_INTERNAL_3(uniform2fv, long, float*, int)
+DELEGATE_TO_INTERNAL_3(uniform2i, long, int, int)
+DELEGATE_TO_INTERNAL_3(uniform2iv, long, int*, int)
+DELEGATE_TO_INTERNAL_4(uniform3f, long, float, float, float)
+DELEGATE_TO_INTERNAL_3(uniform3fv, long, float*, int)
+DELEGATE_TO_INTERNAL_4(uniform3i, long, int, int, int)
+DELEGATE_TO_INTERNAL_3(uniform3iv, long, int*, int)
+DELEGATE_TO_INTERNAL_5(uniform4f, long, float, float, float, float)
+DELEGATE_TO_INTERNAL_3(uniform4fv, long, float*, int)
+DELEGATE_TO_INTERNAL_5(uniform4i, long, int, int, int, int)
+DELEGATE_TO_INTERNAL_3(uniform4iv, long, int*, int)
+DELEGATE_TO_INTERNAL_4(uniformMatrix2fv, long, bool, float*, int)
+DELEGATE_TO_INTERNAL_4(uniformMatrix3fv, long, bool, float*, int)
+DELEGATE_TO_INTERNAL_4(uniformMatrix4fv, long, bool, float*, int)
 
-void GraphicsContext3D::uniform1fv(long location, float* v, int size)
-{
-    makeContextCurrent();
-    glUniform1fv(location, size, v);
-}
+DELEGATE_TO_INTERNAL_1(useProgram, WebGLProgram*)
+DELEGATE_TO_INTERNAL_1(validateProgram, WebGLProgram*)
 
-GL_SAME_METHOD_2(Uniform1i, uniform1i, long, int)
+DELEGATE_TO_INTERNAL_2(vertexAttrib1f, unsigned long, float)
+DELEGATE_TO_INTERNAL_2(vertexAttrib1fv, unsigned long, float*)
+DELEGATE_TO_INTERNAL_3(vertexAttrib2f, unsigned long, float, float)
+DELEGATE_TO_INTERNAL_2(vertexAttrib2fv, unsigned long, float*)
+DELEGATE_TO_INTERNAL_4(vertexAttrib3f, unsigned long, float, float, float)
+DELEGATE_TO_INTERNAL_2(vertexAttrib3fv, unsigned long, float*)
+DELEGATE_TO_INTERNAL_5(vertexAttrib4f, unsigned long, float, float, float, float)
+DELEGATE_TO_INTERNAL_2(vertexAttrib4fv, unsigned long, float*)
+DELEGATE_TO_INTERNAL_6(vertexAttribPointer, unsigned long, int, int, bool, unsigned long, unsigned long)
 
-void GraphicsContext3D::uniform1iv(long location, int* v, int size)
-{
-    makeContextCurrent();
-    glUniform1iv(location, size, v);
-}
+DELEGATE_TO_INTERNAL_4(viewport, long, long, unsigned long, unsigned long)
 
-GL_SAME_METHOD_3(Uniform2f, uniform2f, long, float, float)
+DELEGATE_TO_INTERNAL_1(beginPaint, WebGLRenderingContext*)
+DELEGATE_TO_INTERNAL(endPaint)
 
-void GraphicsContext3D::uniform2fv(long location, float* v, int size)
-{
-    makeContextCurrent();
-    glUniform2fv(location, size, v);
-}
+DELEGATE_TO_INTERNAL_R(createBuffer, unsigned)
+DELEGATE_TO_INTERNAL_R(createFramebuffer, unsigned)
+DELEGATE_TO_INTERNAL_R(createProgram, unsigned)
+DELEGATE_TO_INTERNAL_R(createRenderbuffer, unsigned)
+DELEGATE_TO_INTERNAL_1R(createShader, unsigned long, unsigned)
+DELEGATE_TO_INTERNAL_R(createTexture, unsigned)
 
-GL_SAME_METHOD_3(Uniform2i, uniform2i, long, int, int)
+DELEGATE_TO_INTERNAL_1(deleteBuffer, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteFramebuffer, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteProgram, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteRenderbuffer, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteShader, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
 
-void GraphicsContext3D::uniform2iv(long location, int* v, int size)
-{
-    makeContextCurrent();
-    glUniform2iv(location, size, v);
-}
+DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
 
-GL_SAME_METHOD_4(Uniform3f, uniform3f, long, float, float, float)
-
-void GraphicsContext3D::uniform3fv(long location, float* v, int size)
-{
-    makeContextCurrent();
-    glUniform3fv(location, size, v);
-}
-
-GL_SAME_METHOD_4(Uniform3i, uniform3i, long, int, int, int)
-
-void GraphicsContext3D::uniform3iv(long location, int* v, int size)
-{
-    makeContextCurrent();
-    glUniform3iv(location, size, v);
-}
-
-GL_SAME_METHOD_5(Uniform4f, uniform4f, long, float, float, float, float)
-
-void GraphicsContext3D::uniform4fv(long location, float* v, int size)
-{
-    makeContextCurrent();
-    glUniform4fv(location, size, v);
-}
-
-GL_SAME_METHOD_5(Uniform4i, uniform4i, long, int, int, int, int)
-
-void GraphicsContext3D::uniform4iv(long location, int* v, int size)
-{
-    makeContextCurrent();
-    glUniform4iv(location, size, v);
-}
-
-void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* value, int size)
-{
-    makeContextCurrent();
-    glUniformMatrix2fv(location, size, transpose, value);
-}
-
-void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* value, int size)
-{
-    makeContextCurrent();
-    glUniformMatrix3fv(location, size, transpose, value);
-}
-
-void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* value, int size)
-{
-    makeContextCurrent();
-    glUniformMatrix4fv(location, size, transpose, value);
-}
-
-GL_SAME_METHOD_1_X(UseProgram, useProgram, WebGLProgram*)
-
-GL_SAME_METHOD_1_X(ValidateProgram, validateProgram, WebGLProgram*)
-
-GL_SAME_METHOD_2(VertexAttrib1f, vertexAttrib1f, unsigned long, float)
-
-void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* values)
-{
-    makeContextCurrent();
-    glVertexAttrib1fv(indx, values);
-}
-
-GL_SAME_METHOD_3(VertexAttrib2f, vertexAttrib2f, unsigned long, float, float)
-
-void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* values)
-{
-    makeContextCurrent();
-    glVertexAttrib2fv(indx, values);
-}
-
-GL_SAME_METHOD_4(VertexAttrib3f, vertexAttrib3f, unsigned long, float, float, float)
-
-void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* values)
-{
-    makeContextCurrent();
-    glVertexAttrib3fv(indx, values);
-}
-
-GL_SAME_METHOD_5(VertexAttrib4f, vertexAttrib4f, unsigned long, float, float, float, float)
-
-void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* values)
-{
-    makeContextCurrent();
-    glVertexAttrib4fv(indx, values);
-}
-
-void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
-                                            unsigned long stride, unsigned long offset)
-{
-    m_internal->vertexAttribPointer(indx, size, type, normalized, stride, offset);
-}
-
-void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
-{
-    makeContextCurrent();
-    m_internal->viewportImpl(x, y, width, height);
-}
-
-}
+} // namespace WebCore
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h
new file mode 100644
index 0000000..e803c96
--- /dev/null
+++ b/WebKit/chromium/src/IDBCallbacksProxy.h
@@ -0,0 +1,73 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBCallbacksProxy_h
+#define IDBCallbacksProxy_h
+
+#include "IDBCallbacks.h"
+#include "IDBDatabaseError.h"
+#include "WebIDBCallbacks.h"
+#include "WebIDBDatabaseError.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+template <typename WebKitClass, typename WebCoreClass, typename WebCoreProxy>
+class IDBCallbacksProxy : public WebKit::WebIDBCallbacks<WebKitClass> {
+public:
+    IDBCallbacksProxy(PassRefPtr<IDBCallbacks<WebCoreClass> > callbacks)
+        : m_callbacks(callbacks) { }
+
+    virtual ~IDBCallbacksProxy() { }
+
+    virtual void onSuccess(WebKitClass* webKitInstance)
+    {
+        RefPtr<WebCoreClass> proxy = WebCoreProxy::create(webKitInstance);
+        m_callbacks->onSuccess(proxy);
+        m_callbacks.clear();
+    }
+
+    virtual void onError(const WebKit::WebIDBDatabaseError& error)
+    {
+        m_callbacks->onError(error);
+        m_callbacks.clear();
+    }
+
+private:
+    PassRefPtr<IDBCallbacks<WebCoreClass> > m_callbacks;
+};
+
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBCallbacksProxy_h
diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp
new file mode 100644
index 0000000..d12ec70
--- /dev/null
+++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp
@@ -0,0 +1,57 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IDBDatabaseProxy.h"
+
+#include "IDBDatabaseError.h"
+#include "WebIDBDatabase.h"
+#include "WebIDBDatabaseError.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IDBDatabase> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database)
+{
+    return adoptRef(new IDBDatabaseProxy(database));
+}
+
+IDBDatabaseProxy::IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase> database)
+    : m_webIDBDatabase(database)
+{
+}
+
+IDBDatabaseProxy::~IDBDatabaseProxy()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h
new file mode 100644
index 0000000..ac96a15
--- /dev/null
+++ b/WebKit/chromium/src/IDBDatabaseProxy.h
@@ -0,0 +1,61 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IDBDatabaseProxy_h
+#define IDBDatabaseProxy_h
+
+#include "IDBDatabase.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebKit { class WebIDBDatabase; }
+
+namespace WebCore {
+
+class IDBDatabaseProxy : public IDBDatabase {
+public:
+    static PassRefPtr<IDBDatabase> create(PassOwnPtr<WebKit::WebIDBDatabase>);
+    virtual ~IDBDatabaseProxy();
+
+    // FIXME: Add other methods.
+
+private:
+    IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>);
+
+    OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabaseProxy_h
+
diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.cpp b/WebKit/chromium/src/IndexedDatabaseProxy.cpp
new file mode 100644
index 0000000..9069b46
--- /dev/null
+++ b/WebKit/chromium/src/IndexedDatabaseProxy.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "IndexedDatabaseProxy.h"
+
+#include "IDBCallbacksProxy.h"
+#include "IDBDatabaseError.h"
+#include "IDBDatabaseProxy.h"
+#include "WebFrameImpl.h"
+#include "WebIDBDatabase.h"
+#include "WebIDBDatabaseError.h"
+#include "WebIndexedDatabase.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<IndexedDatabase> IndexedDatabaseProxy::create()
+{
+    return adoptRef(new IndexedDatabaseProxy());
+}
+
+IndexedDatabaseProxy::IndexedDatabaseProxy()
+    : m_webIndexedDatabase(WebKit::webKitClient()->indexedDatabase())
+{
+}
+
+IndexedDatabaseProxy::~IndexedDatabaseProxy()
+{
+}
+
+void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks> callbacks, Frame* frame, ExceptionCode& ec)
+{
+    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
+    typedef IDBCallbacksProxy<WebKit::WebIDBDatabase, IDBDatabase, IDBDatabaseProxy> CallbacksProxy;
+    m_webIndexedDatabase->open(name, description, modifyDatabase, new CallbacksProxy(callbacks), webFrame, ec);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.h b/WebKit/chromium/src/IndexedDatabaseProxy.h
new file mode 100644
index 0000000..d0f55b6
--- /dev/null
+++ b/WebKit/chromium/src/IndexedDatabaseProxy.h
@@ -0,0 +1,59 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 IndexedDatabaseProxy_h
+#define IndexedDatabaseProxy_h
+
+#include "IndexedDatabase.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebKit { class WebIndexedDatabase; }
+
+namespace WebCore {
+
+class IndexedDatabaseProxy : public IndexedDatabase {
+public:
+    static PassRefPtr<IndexedDatabase> create();
+    virtual ~IndexedDatabaseProxy();
+
+    virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBDatabaseCallbacks>, Frame*, ExceptionCode&);
+
+private:
+    IndexedDatabaseProxy();
+
+    // We don't own this pointer (unlike all the other proxy classes which do).
+    WebKit::WebIndexedDatabase* m_webIndexedDatabase;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabaseProxy_h
+
diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp
index 54550d1..f69ef72 100644
--- a/WebKit/chromium/src/InspectorClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorClientImpl.cpp
@@ -63,46 +63,8 @@
     // Our lifetime is bound to the WebViewImpl.
 }
 
-Page* InspectorClientImpl::createPage()
+void InspectorClientImpl::openInspectorFrontend(InspectorController*)
 {
-    // This method should never be called in Chrome as inspector front-end lives
-    // in a separate process.
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-void InspectorClientImpl::showWindow()
-{
-    ASSERT(m_inspectedWebView->devToolsAgentPrivate());
-    m_inspectedWebView->page()->inspectorController()->setWindowVisible(true);
-}
-
-void InspectorClientImpl::closeWindow()
-{
-    if (m_inspectedWebView->page())
-        m_inspectedWebView->page()->inspectorController()->setWindowVisible(false);
-}
-
-bool InspectorClientImpl::windowVisible()
-{
-    ASSERT(m_inspectedWebView->devToolsAgentPrivate());
-    return false;
-}
-
-void InspectorClientImpl::attachWindow()
-{
-    // FIXME: Implement this
-}
-
-void InspectorClientImpl::detachWindow()
-{
-    // FIXME: Implement this
-}
-
-void InspectorClientImpl::setAttachedWindowHeight(unsigned int height)
-{
-    // FIXME: Implement this
-    notImplemented();
 }
 
 static void invalidateNodeBoundingRect(WebViewImpl* webView)
@@ -130,23 +92,6 @@
     invalidateNodeBoundingRect(m_inspectedWebView);
 }
 
-void InspectorClientImpl::inspectedURLChanged(const String& newURL)
-{
-    // FIXME: Implement this
-}
-
-String InspectorClientImpl::localizedStringsURL()
-{
-    notImplemented();
-    return String();
-}
-
-String InspectorClientImpl::hiddenPanels()
-{
-    notImplemented();
-    return "";
-}
-
 void InspectorClientImpl::populateSetting(const String& key, String* value)
 {
     loadSettings();
@@ -161,11 +106,6 @@
     saveSettings();
 }
 
-void InspectorClientImpl::inspectorWindowObjectCleared()
-{
-    notImplemented();
-}
-
 void InspectorClientImpl::loadSettings()
 {
     if (m_settings)
diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h
index 6f7f8b1..ccbcef7 100644
--- a/WebKit/chromium/src/InspectorClientImpl.h
+++ b/WebKit/chromium/src/InspectorClientImpl.h
@@ -45,25 +45,15 @@
 
     // InspectorClient methods:
     virtual void inspectorDestroyed();
-    virtual WebCore::Page* createPage();
-    virtual WebCore::String localizedStringsURL();
-    virtual WebCore::String hiddenPanels();
-    virtual void showWindow();
-    virtual void closeWindow();
-    virtual bool windowVisible();
-    virtual void attachWindow();
-    virtual void detachWindow();
-    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void openInspectorFrontend(WebCore::InspectorController*);
     virtual void highlight(WebCore::Node*);
     virtual void hideHighlight();
-    virtual void inspectedURLChanged(const WebCore::String& newURL);
     virtual void populateSetting(
         const WebCore::String& key,
         WebCore::String* value);
     virtual void storeSetting(
         const WebCore::String& key,
         const WebCore::String& value);
-    virtual void inspectorWindowObjectCleared();
 
 private:
     void loadSettings();
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
new file mode 100644
index 0000000..9ff3938
--- /dev/null
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -0,0 +1,126 @@
+/*
+ * 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 "InspectorFrontendClientImpl.h"
+
+#include "InspectorFrontendHost.h"
+#include "Page.h"
+#include "PlatformString.h"
+#include "V8InspectorFrontendHost.h"
+#include "V8Proxy.h"
+#include "WebDevToolsFrontendClient.h"
+#include "WebDevToolsFrontendImpl.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+InspectorFrontendClientImpl::InspectorFrontendClientImpl(Page* frontendPage, WebDevToolsFrontendClient* client, WebDevToolsFrontendImpl* frontend)
+    : m_frontendPage(frontendPage)
+    , m_client(client)
+    , m_frontend(frontend)
+{
+}
+
+InspectorFrontendClientImpl::~InspectorFrontendClientImpl()
+{
+    if (m_frontendHost)
+        m_frontendHost->disconnectClient();
+    m_client = 0;
+}
+
+void InspectorFrontendClientImpl::windowObjectCleared()
+{
+    v8::HandleScope handleScope;
+    v8::Handle<v8::Context> frameContext = V8Proxy::context(m_frontendPage->mainFrame());
+    v8::Context::Scope contextScope(frameContext);
+
+    ASSERT(!m_frontendHost);
+    m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
+    v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get());
+    v8::Handle<v8::Object> global = frameContext->Global();
+
+    global->Set(v8::String::New("InspectorFrontendHost"), frontendHostObj);
+#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+    global->Set(v8::String::New("v8ScriptDebugServerEnabled"), v8::True());
+#endif
+}
+
+void InspectorFrontendClientImpl::frontendLoaded()
+{
+    m_frontend->frontendLoaded();
+}
+
+void InspectorFrontendClientImpl::moveWindowBy(float x, float y)
+{
+}
+
+String InspectorFrontendClientImpl::localizedStringsURL()
+{
+    return "";
+}
+
+String InspectorFrontendClientImpl::hiddenPanels()
+{
+    return "";
+}
+
+void InspectorFrontendClientImpl::bringToFront()
+{
+    m_client->activateWindow();
+}
+
+void InspectorFrontendClientImpl::closeWindow()
+{
+    m_client->closeWindow();
+}
+
+void InspectorFrontendClientImpl::requestAttachWindow()
+{
+    m_client->requestDockWindow();
+}
+
+void InspectorFrontendClientImpl::requestDetachWindow()
+{
+    m_client->requestUndockWindow();
+}
+
+void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned)
+{
+    // Do nothing;
+}
+    
+void InspectorFrontendClientImpl::inspectedURLChanged(const String&)
+{
+    // Do nothing;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.h b/WebKit/chromium/src/InspectorFrontendClientImpl.h
new file mode 100644
index 0000000..f869ac3
--- /dev/null
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.h
@@ -0,0 +1,80 @@
+/*
+ * 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 InspectorFrontendClientImpl_h
+#define InspectorFrontendClientImpl_h
+
+#include "InspectorFrontendClient.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+class InspectorFrontendHost;
+class Page;
+}
+
+namespace WebKit {
+
+class WebDevToolsFrontendClient;
+class WebDevToolsFrontendImpl;
+
+class InspectorFrontendClientImpl : public WebCore::InspectorFrontendClient
+                                  , public Noncopyable  {
+public:
+    InspectorFrontendClientImpl(WebCore::Page*, WebDevToolsFrontendClient*, WebDevToolsFrontendImpl*);
+    virtual ~InspectorFrontendClientImpl();
+
+    // InspectorFrontendClient methods:
+    virtual void windowObjectCleared();
+    virtual void frontendLoaded();
+
+    virtual void moveWindowBy(float x, float y);
+
+    virtual WebCore::String localizedStringsURL();
+    virtual WebCore::String hiddenPanels();
+
+    virtual void bringToFront();
+    virtual void closeWindow();
+
+    virtual void requestAttachWindow();
+    virtual void requestDetachWindow();
+    virtual void changeAttachedWindowHeight(unsigned);
+
+    virtual void inspectedURLChanged(const WebCore::String&);
+
+private:
+    WebCore::Page* m_frontendPage;
+    WebDevToolsFrontendClient* m_client;
+    WebDevToolsFrontendImpl* m_frontend;
+    RefPtr<WebCore::InspectorFrontendHost> m_frontendHost;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/LocalizedStrings.cpp b/WebKit/chromium/src/LocalizedStrings.cpp
index 4e01848..74ff699 100644
--- a/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/WebKit/chromium/src/LocalizedStrings.cpp
@@ -174,6 +174,18 @@
 {
     return String();
 }
+    
+String missingPluginText()
+{
+    notImplemented();
+    return String("Missing Plug-in");
+}
+
+String crashedPluginText()
+{
+    notImplemented();
+    return String("Plug-in Failure");
+}
 
 String multipleFileUploadText(unsigned numberOfFiles)
 {
diff --git a/WebKit/chromium/src/NotificationPresenterImpl.cpp b/WebKit/chromium/src/NotificationPresenterImpl.cpp
index a38b8b5..dca1856 100644
--- a/WebKit/chromium/src/NotificationPresenterImpl.cpp
+++ b/WebKit/chromium/src/NotificationPresenterImpl.cpp
@@ -33,11 +33,10 @@
 
 #if ENABLE(NOTIFICATIONS)
 
-#include "Document.h"
+#include "KURL.h"
 #include "Notification.h"
 #include "SecurityOrigin.h"
 
-#include "WebDocument.h"
 #include "WebNotification.h"
 #include "WebNotificationPermissionCallback.h"
 #include "WebNotificationPresenter.h"
@@ -92,19 +91,15 @@
     m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
 }
 
-NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& url, Document* document)
+NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& sourceURL)
 {
-    WebDocument webDocument;
-    if (document)
-        webDocument = document;
-
-    int result = m_presenter->checkPermission(url, document ? &webDocument : 0);
+    int result = m_presenter->checkPermission(sourceURL);
     return static_cast<NotificationPresenter::Permission>(result);
 }
 
 void NotificationPresenterImpl::requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
 {
-    m_presenter->requestPermission(origin->toString(), new VoidCallbackClient(callback));
+    m_presenter->requestPermission(WebSecurityOrigin(origin), new VoidCallbackClient(callback));
 }
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/NotificationPresenterImpl.h b/WebKit/chromium/src/NotificationPresenterImpl.h
index 8e3799c..479538f 100644
--- a/WebKit/chromium/src/NotificationPresenterImpl.h
+++ b/WebKit/chromium/src/NotificationPresenterImpl.h
@@ -54,7 +54,7 @@
     virtual bool show(WebCore::Notification* object);
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
-    virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::KURL& url, WebCore::Document* document);
+    virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::KURL& sourceURL);
     virtual void requestPermission(WebCore::SecurityOrigin* origin, WTF::PassRefPtr<WebCore::VoidCallback> callback);
 
 private:
diff --git a/WebKit/chromium/src/ResourceHandle.cpp b/WebKit/chromium/src/ResourceHandle.cpp
index bf6910f..39270e7 100644
--- a/WebKit/chromium/src/ResourceHandle.cpp
+++ b/WebKit/chromium/src/ResourceHandle.cpp
@@ -33,6 +33,7 @@
 
 #include "ResourceHandleClient.h"
 #include "ResourceRequest.h"
+#include "SharedBuffer.h"
 
 #include "WebKit.h"
 #include "WebKitClient.h"
@@ -56,6 +57,7 @@
         : m_request(request)
         , m_owner(0)
         , m_client(client)
+        , m_state(ConnectionStateNew)
     {
     }
 
@@ -73,14 +75,32 @@
     virtual void didFinishLoading(WebURLLoader*);
     virtual void didFail(WebURLLoader*, const WebURLError&);
 
+    enum ConnectionState {
+        ConnectionStateNew,
+        ConnectionStateStarted,
+        ConnectionStateReceivedResponse,
+        ConnectionStateReceivingData,
+        ConnectionStateFinishedLoading,
+        ConnectionStateCanceled,
+        ConnectionStateFailed,
+    };
+
     ResourceRequest m_request;
     ResourceHandle* m_owner;
     ResourceHandleClient* m_client;
     OwnPtr<WebURLLoader> m_loader;
+
+    // Used for sanity checking to make sure we don't experience illegal state
+    // transitions.
+    ConnectionState m_state;
 };
 
 void ResourceHandleInternal::start()
 {
+    if (m_state != ConnectionStateNew)
+        CRASH();
+    m_state = ConnectionStateStarted;
+
     m_loader.set(webKitClient()->createURLLoader());
     ASSERT(m_loader.get());
 
@@ -91,6 +111,7 @@
 
 void ResourceHandleInternal::cancel()
 {
+    m_state = ConnectionStateCanceled;
     m_loader->cancel();
 
     // Do not make any further calls to the client.
@@ -127,6 +148,12 @@
 {
     ASSERT(m_client);
     ASSERT(!response.isNull());
+    bool isMultipart = response.isMultipartPayload();
+    bool isValidStateTransition = (m_state == ConnectionStateStarted || m_state == ConnectionStateReceivedResponse);
+    // In the case of multipart loads, calls to didReceiveData & didReceiveResponse can be interleaved.
+    if (!isMultipart && !isValidStateTransition)
+        CRASH();
+    m_state = ConnectionStateReceivedResponse;
     m_client->didReceiveResponse(m_owner, response.toResourceResponse());
 }
 
@@ -134,6 +161,9 @@
     WebURLLoader*, const char* data, int dataLength)
 {
     ASSERT(m_client);
+    if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData)
+        CRASH();
+    m_state = ConnectionStateReceivingData;
 
     // FIXME(yurys): it looks like lengthReceived is always the same as
     // dataLength and that the latter parameter can be eliminated.
@@ -144,12 +174,16 @@
 void ResourceHandleInternal::didFinishLoading(WebURLLoader*)
 {
     ASSERT(m_client);
+    if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData)
+        CRASH();
+    m_state = ConnectionStateFinishedLoading;
     m_client->didFinishLoading(m_owner);
 }
 
 void ResourceHandleInternal::didFail(WebURLLoader*, const WebURLError& error)
 {
     ASSERT(m_client);
+    m_state = ConnectionStateFailed;
     m_client->didFail(m_owner, error);
 }
 
@@ -158,8 +192,7 @@
 ResourceHandle::ResourceHandle(const ResourceRequest& request,
                                ResourceHandleClient* client,
                                bool defersLoading,
-                               bool shouldContentSniff,
-                               bool mightDownloadFromHandle)
+                               bool shouldContentSniff)
     : d(new ResourceHandleInternal(request, client))
 {
     d->m_owner = this;
@@ -171,11 +204,10 @@
                                                   ResourceHandleClient* client,
                                                   Frame* deprecated,
                                                   bool defersLoading,
-                                                  bool shouldContentSniff,
-                                                  bool mightDownloadFromHandle)
+                                                  bool shouldContentSniff)
 {
     RefPtr<ResourceHandle> newHandle = adoptRef(new ResourceHandle(
-        request, client, defersLoading, shouldContentSniff, mightDownloadFromHandle));
+        request, client, defersLoading, shouldContentSniff));
 
     if (newHandle->start(deprecated))
         return newHandle.release();
diff --git a/WebKit/chromium/src/SharedWorkerRepository.cpp b/WebKit/chromium/src/SharedWorkerRepository.cpp
index c803aac..f0a8ec8 100644
--- a/WebKit/chromium/src/SharedWorkerRepository.cpp
+++ b/WebKit/chromium/src/SharedWorkerRepository.cpp
@@ -36,6 +36,7 @@
 
 #include "Event.h"
 #include "EventNames.h"
+#include "InspectorController.h"
 #include "MessagePortChannel.h"
 #include "PlatformMessagePortChannel.h"
 #include "ScriptExecutionContext.h"
@@ -152,6 +153,10 @@
         m_worker->dispatchEvent(Event::create(eventNames().errorEvent, false, true));
         delete this;
     } else {
+#if ENABLE(INSPECTOR)
+        if (InspectorController* inspector = m_worker->scriptExecutionContext()->inspectorController())
+            inspector->scriptImported(m_scriptLoader.identifier(), m_scriptLoader.script());
+#endif
         // Pass the script off to the worker, then send a connect event.
         m_webWorker->startWorkerContext(m_url, m_name, m_worker->scriptExecutionContext()->userAgent(m_url), m_scriptLoader.script());
         sendConnect();
diff --git a/WebKit/chromium/src/StorageAreaProxy.cpp b/WebKit/chromium/src/StorageAreaProxy.cpp
index c9185fe..0e44250 100644
--- a/WebKit/chromium/src/StorageAreaProxy.cpp
+++ b/WebKit/chromium/src/StorageAreaProxy.cpp
@@ -40,6 +40,7 @@
 #include "StorageAreaImpl.h"
 #include "StorageEvent.h"
 
+#include "WebFrameImpl.h"
 #include "WebStorageArea.h"
 #include "WebString.h"
 #include "WebURL.h"
@@ -73,12 +74,13 @@
 
 String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
 {
-    bool quotaException = false;
+    WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK;
     WebKit::WebString oldValue;
-    m_storageArea->setItem(key, value, frame->document()->url(), quotaException, oldValue);
-    ec = quotaException ? QUOTA_EXCEEDED_ERR : 0;
+    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
+    m_storageArea->setItem(key, value, frame->document()->url(), result, oldValue, webFrame);
+    ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR;
     String oldValueString = oldValue;
-    if (oldValueString != value)
+    if (oldValueString != value && result == WebKit::WebStorageArea::ResultOK)
         storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame);
     return oldValue;
 }
@@ -124,7 +126,7 @@
         }
 
         for (unsigned i = 0; i < frames.size(); ++i)
-            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
+            frames[i]->document()->enqueueEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
     } else {
         // Send events to every page.
         const HashSet<Page*>& pages = page->group().pages();
@@ -136,8 +138,12 @@
             }
         }
 
-        for (unsigned i = 0; i < frames.size(); ++i)
-            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
+        for (unsigned i = 0; i < frames.size(); ++i) {
+            ExceptionCode ec = 0;
+            Storage* storage = frames[i]->domWindow()->localStorage(ec);
+            if (!ec)
+                frames[i]->document()->enqueueEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
+        }
     }
 }
 
diff --git a/WebKit/chromium/src/StorageEventDispatcherImpl.cpp b/WebKit/chromium/src/StorageEventDispatcherImpl.cpp
index 3518796..ae25d44 100644
--- a/WebKit/chromium/src/StorageEventDispatcherImpl.cpp
+++ b/WebKit/chromium/src/StorageEventDispatcherImpl.cpp
@@ -73,8 +73,11 @@
 
     // FIXME: Figure out how to pass in the document URI.
     for (unsigned i = 0; i < frames.size(); ++i) {
-        frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue,
-                                                                        url, frames[i]->domWindow()->localStorage()));
+        ExceptionCode ec = 0;
+        Storage* storage = frames[i]->domWindow()->localStorage(ec);
+        if (!ec)
+            frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue,
+                                                                            url, storage));
     }
 }
 
diff --git a/WebKit/chromium/src/StorageNamespaceProxy.cpp b/WebKit/chromium/src/StorageNamespaceProxy.cpp
index 3c87554..252bc14 100644
--- a/WebKit/chromium/src/StorageNamespaceProxy.cpp
+++ b/WebKit/chromium/src/StorageNamespaceProxy.cpp
@@ -47,7 +47,7 @@
     return adoptRef(new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path, quota), LocalStorage));
 }
 
-PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page)
+PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page, unsigned quota)
 {
     WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(page->chrome()->client());
     WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
diff --git a/WebKit/chromium/src/SuggestionsPopupMenuClient.h b/WebKit/chromium/src/SuggestionsPopupMenuClient.h
index edc4c09..77b3890 100644
--- a/WebKit/chromium/src/SuggestionsPopupMenuClient.h
+++ b/WebKit/chromium/src/SuggestionsPopupMenuClient.h
@@ -63,6 +63,7 @@
     virtual void valueChanged(unsigned listIndex, bool fireEvents = true);
     virtual WebCore::String itemText(unsigned listIndex) const;
     virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); }
+    virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); }
     virtual bool itemIsEnabled(unsigned listIndex) const { return true; }
     virtual WebCore::PopupMenuStyle itemStyle(unsigned listIndex) const;
     virtual WebCore::PopupMenuStyle menuStyle() const;
diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp
index 04f2f85..41619d6 100644
--- a/WebKit/chromium/src/WebBindings.cpp
+++ b/WebKit/chromium/src/WebBindings.cpp
@@ -284,7 +284,7 @@
 {
     V8NPObject* v8npobject = reinterpret_cast<V8NPObject*>(npobj);
     v8::Handle<v8::Object> v8object(v8npobject->v8Object);
-    if (V8ClassIndex::RANGE != V8DOMWrapper::domWrapperType(v8object))
+    if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8object)))
         return false;
 
     Range* native = V8Range::toNative(v8object);
diff --git a/WebKit/chromium/src/WebCString.cpp b/WebKit/chromium/src/WebCString.cpp
index 82fbac0..b484b19 100644
--- a/WebKit/chromium/src/WebCString.cpp
+++ b/WebKit/chromium/src/WebCString.cpp
@@ -31,14 +31,14 @@
 #include "config.h"
 #include "WebCString.h"
 
-#include "CString.h"
 #include "TextEncoding.h"
+#include <wtf/text/CString.h>
 
 #include "WebString.h"
 
 namespace WebKit {
 
-class WebCStringPrivate : public WebCore::CStringBuffer {
+class WebCStringPrivate : public WTF::CStringBuffer {
 };
 
 void WebCString::reset()
@@ -57,8 +57,8 @@
 void WebCString::assign(const char* data, size_t length)
 {
     char* newData;
-    RefPtr<WebCore::CStringBuffer> buffer =
-        WebCore::CString::newUninitialized(length, newData).buffer();
+    RefPtr<WTF::CStringBuffer> buffer =
+        WTF::CString::newUninitialized(length, newData).buffer();
     memcpy(newData, data, length);
     assign(static_cast<WebCStringPrivate*>(buffer.get()));
 }
@@ -97,20 +97,20 @@
     return fromUTF16(data, len);
 }
 
-WebCString::WebCString(const WebCore::CString& s)
+WebCString::WebCString(const WTF::CString& s)
     : m_private(static_cast<WebCStringPrivate*>(s.buffer()))
 {
     if (m_private)
         m_private->ref();
 }
 
-WebCString& WebCString::operator=(const WebCore::CString& s)
+WebCString& WebCString::operator=(const WTF::CString& s)
 {
     assign(static_cast<WebCStringPrivate*>(s.buffer()));
     return *this;
 }
 
-WebCString::operator WebCore::CString() const
+WebCString::operator WTF::CString() const
 {
     return m_private;
 }
diff --git a/WebKit/chromium/src/WebCommon.cpp b/WebKit/chromium/src/WebCommon.cpp
new file mode 100644
index 0000000..f9457fb
--- /dev/null
+++ b/WebKit/chromium/src/WebCommon.cpp
@@ -0,0 +1,44 @@
+/*
+ * 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 "WebCommon.h"
+
+#include <wtf/Assertions.h>
+
+namespace WebKit {
+
+void failedAssertion(const char* file, int line, const char* function, const char* assertion)
+{
+    WTFReportAssertionFailure(file, line, function, assertion);
+    CRASH();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp
index 50b9220..1479eb0 100644
--- a/WebKit/chromium/src/WebDatabase.cpp
+++ b/WebKit/chromium/src/WebDatabase.cpp
@@ -111,7 +111,7 @@
 void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName)
 {
     HashSet<RefPtr<Database> > databaseHandles;
-    PassRefPtr<SecurityOrigin> originPrp(*WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier));
+    PassRefPtr<SecurityOrigin> originPrp(WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier));
     RefPtr<SecurityOrigin> origin = originPrp;
     DatabaseTracker::tracker().getOpenDatabases(origin.get(), databaseName, &databaseHandles);
     for (HashSet<RefPtr<Database> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it) {
@@ -119,7 +119,7 @@
         DatabaseThread* databaseThread = database->scriptExecutionContext()->databaseThread();
         if (databaseThread && !databaseThread->terminationRequested()) {
             database->stop();
-            databaseThread->scheduleTask(DatabaseCloseTask::create(database, 0));
+            databaseThread->scheduleTask(DatabaseCloseTask::create(database, Database::RemoveDatabaseFromContext, 0));
         }
     }
 }
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 9ce35b4..0969d37 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -86,7 +86,6 @@
 using WebCore::ScriptState;
 using WebCore::ScriptValue;
 using WebCore::String;
-using WebCore::V8ClassIndex;
 using WebCore::V8DOMWrapper;
 using WebCore::V8InspectorBackend;
 using WebCore::V8Proxy;
@@ -161,15 +160,6 @@
     }
 }
 
-void WebDevToolsAgentImpl::unhideResourcesPanelIfNecessary()
-{
-    InspectorController* ic = m_webViewImpl->page()->inspectorController();
-    ic->ensureResourceTrackingSettingsLoaded();
-    String command = String::format("[\"setResourcesPanelEnabled\", %s]",
-        ic->resourceTrackingEnabled() ? "true" : "false");
-    m_toolsAgentDelegateStub->dispatchOnClient(command);
-}
-
 void WebDevToolsAgentImpl::attach()
 {
     if (m_attached)
@@ -178,8 +168,8 @@
         new DebuggerAgentImpl(m_webViewImpl,
                               m_debuggerAgentDelegateStub.get(),
                               this));
-    resetInspectorFrontendProxy();
-    unhideResourcesPanelIfNecessary();
+    createInspectorFrontendProxy();
+
     // Allow controller to send messages to the frontend.
     InspectorController* ic = inspectorController();
 
@@ -194,7 +184,7 @@
         }
     }
 
-    ic->setWindowVisible(true, false);
+    setInspectorFrontendProxyToInspectorController();
     m_attached = true;
 }
 
@@ -202,6 +192,7 @@
 {
     // Prevent controller from sending messages to the frontend.
     InspectorController* ic = m_webViewImpl->page()->inspectorController();
+    ic->disconnectFrontend();
     ic->hideHighlight();
     ic->close();
     disposeUtilityContext();
@@ -225,10 +216,8 @@
         ds->unreachableURL() :
         request.url();
     if (!webframe->parent()) {
-        resetInspectorFrontendProxy();
         m_toolsAgentDelegateStub->frameNavigate(WebCore::KURL(url).string());
         SetApuAgentEnabledInUtilityContext(m_utilityContext, m_apuAgentEnabled);
-        unhideResourcesPanelIfNecessary();
     }
 }
 
@@ -347,7 +336,6 @@
 
 v8::Local<v8::Object> WebDevToolsAgentImpl::createInspectorBackendV8Wrapper()
 {
-    V8ClassIndex::V8WrapperType descriptorType = V8ClassIndex::INSPECTORBACKEND;
     v8::Handle<v8::Function> function = V8InspectorBackend::GetTemplate()->GetFunction();
     if (function.IsEmpty()) {
         // Return if allocation failed.
@@ -359,7 +347,7 @@
         return v8::Local<v8::Object>();
     }
     InspectorBackend* backend = m_webViewImpl->page()->inspectorController()->inspectorBackend();
-    V8DOMWrapper::setDOMWrapper(instance, V8ClassIndex::ToInt(descriptorType), backend);
+    V8DOMWrapper::setDOMWrapper(instance, &V8InspectorBackend::info, backend);
     // Create a weak reference to the v8 wrapper of InspectorBackend to deref
     // InspectorBackend when the wrapper is garbage collected.
     backend->ref();
@@ -368,19 +356,22 @@
     return instance;
 }
 
-void WebDevToolsAgentImpl::resetInspectorFrontendProxy()
+void WebDevToolsAgentImpl::createInspectorFrontendProxy()
 {
     disposeUtilityContext();
-    m_debuggerAgentImpl->createUtilityContext(m_webViewImpl->page()->mainFrame(), &m_utilityContext);
+    m_utilityContext = v8::Context::New();
     compileUtilityScripts();
     initDevToolsAgentHost();
+}
 
+void WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController()
+{
     v8::HandleScope scope;
-    v8::Context::Scope contextScope(m_utilityContext);
     ScriptState* state = ScriptState::forContext(
         v8::Local<v8::Context>::New(m_utilityContext));
     InspectorController* ic = inspectorController();
-    ic->setFrontendProxyObject(state, ScriptObject(state, m_utilityContext->Global()));
+    ic->setFrontend(new InspectorFrontend(
+        ScriptObject(state, m_utilityContext->Global())));
 }
 
 void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 1f81c6d..455dcef 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -106,11 +106,11 @@
     static v8::Handle<v8::Value> jsOnRuntimeFeatureStateChanged(const v8::Arguments& args);
 
     void disposeUtilityContext();
-    void unhideResourcesPanelIfNecessary();
 
     void compileUtilityScripts();
     void initDevToolsAgentHost();
-    void resetInspectorFrontendProxy();
+    void createInspectorFrontendProxy();
+    void setInspectorFrontendProxyToInspectorController();
     void setApuAgentEnabled(bool enabled);
 
     WebCore::InspectorController* inspectorController();
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index 89fa6e7..0a6c8de 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -42,6 +42,7 @@
 #include "Frame.h"
 #include "InspectorBackend.h"
 #include "InspectorController.h"
+#include "InspectorFrontendClientImpl.h"
 #include "InspectorFrontendHost.h"
 #include "Node.h"
 #include "Page.h"
@@ -54,6 +55,7 @@
 #include "V8Binding.h"
 #include "V8DOMWrapper.h"
 #include "V8InspectorFrontendHost.h"
+#include "V8MouseEvent.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
 #include "V8Utilities.h"
@@ -100,6 +102,9 @@
     , m_applicationLocale(applicationLocale)
     , m_loaded(false)
 {
+    InspectorController* ic = m_webViewImpl->page()->inspectorController();
+    ic->setInspectorFrontendClient(new InspectorFrontendClientImpl(m_webViewImpl->page(), m_client, this));
+
     WebFrameImpl* frame = m_webViewImpl->mainFrameImpl();
     v8::HandleScope scope;
     v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
@@ -117,57 +122,10 @@
         "DebuggerPauseScript",
         WebDevToolsFrontendImpl::jsDebuggerPauseScript);
     debuggerCommandExecutorObj.build();
-
-    BoundObject devToolsHost(frameContext, this, "InspectorFrontendHost");
-    devToolsHost.addProtoFunction(
-        "loaded",
-        WebDevToolsFrontendImpl::jsLoaded);
-    devToolsHost.addProtoFunction(
-        "platform",
-        WebDevToolsFrontendImpl::jsPlatform);
-    devToolsHost.addProtoFunction(
-        "port",
-        WebDevToolsFrontendImpl::jsPort);
-    devToolsHost.addProtoFunction(
-        "copyText",
-        WebDevToolsFrontendImpl::jsCopyText);
-    devToolsHost.addProtoFunction(
-        "activateWindow",
-        WebDevToolsFrontendImpl::jsActivateWindow);
-    devToolsHost.addProtoFunction(
-        "closeWindow",
-        WebDevToolsFrontendImpl::jsCloseWindow);
-    devToolsHost.addProtoFunction(
-        "attach",
-        WebDevToolsFrontendImpl::jsDockWindow);
-    devToolsHost.addProtoFunction(
-        "detach",
-        WebDevToolsFrontendImpl::jsUndockWindow);
-    devToolsHost.addProtoFunction(
-        "localizedStringsURL",
-        WebDevToolsFrontendImpl::jsLocalizedStringsURL);
-    devToolsHost.addProtoFunction(
-        "hiddenPanels",
-        WebDevToolsFrontendImpl::jsHiddenPanels);
-    devToolsHost.addProtoFunction(
-        "setting",
-        WebDevToolsFrontendImpl::jsSetting);
-    devToolsHost.addProtoFunction(
-        "setSetting",
-        WebDevToolsFrontendImpl::jsSetSetting);
-    devToolsHost.addProtoFunction(
-        "windowUnloading",
-        WebDevToolsFrontendImpl::jsWindowUnloading);
-    devToolsHost.addProtoFunction(
-        "showContextMenu",
-        WebDevToolsFrontendImpl::jsShowContextMenu);
-    devToolsHost.build();
 }
 
 WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl()
 {
-    if (m_menuProvider)
-        m_menuProvider->disconnect();
 }
 
 void WebDevToolsFrontendImpl::dispatchMessageFromAgent(const WebDevToolsMessageData& data)
@@ -184,6 +142,22 @@
     executeScript(v);
 }
 
+void WebDevToolsFrontendImpl::frontendLoaded()
+{
+    m_loaded = true;
+
+    // Grant the devtools page the ability to have source view iframes.
+    SecurityOrigin* origin = m_webViewImpl->page()->mainFrame()->domWindow()->securityOrigin();
+    origin->grantUniversalAccess();
+
+    for (Vector<Vector<String> >::iterator it = m_pendingIncomingMessages.begin();
+         it != m_pendingIncomingMessages.end();
+         ++it) {
+        executeScript(*it);
+    }
+    m_pendingIncomingMessages.clear();
+}
+
 void WebDevToolsFrontendImpl::executeScript(const Vector<String>& v)
 {
     WebFrameImpl* frame = m_webViewImpl->mainFrameImpl();
@@ -199,125 +173,11 @@
     function->Call(frameContext->Global(), args.size(), args.data());
 }
 
-void WebDevToolsFrontendImpl::dispatchOnWebInspector(const String& methodName, const String& param)
-{
-    WebFrameImpl* frame = m_webViewImpl->mainFrameImpl();
-    v8::HandleScope scope;
-    v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
-    v8::Context::Scope contextScope(frameContext);
-
-    v8::Handle<v8::Value> webInspector = frameContext->Global()->Get(v8::String::New("WebInspector"));
-    ASSERT(webInspector->IsObject());
-    v8::Handle<v8::Object> webInspectorObj = v8::Handle<v8::Object>::Cast(webInspector);
-
-    v8::Handle<v8::Value> method = webInspectorObj->Get(ToV8String(methodName));
-    ASSERT(method->IsFunction());
-    v8::Handle<v8::Function> methodFunc = v8::Handle<v8::Function>::Cast(method);
-    v8::Handle<v8::Value> args[] = {
-      ToV8String(param)
-    };
-    methodFunc->Call(frameContext->Global(), 1, args);
-}
-
 void WebDevToolsFrontendImpl::sendRpcMessage(const WebDevToolsMessageData& data)
 {
     m_client->sendMessageToAgent(data);
 }
 
-void WebDevToolsFrontendImpl::contextMenuItemSelected(ContextMenuItem* item)
-{
-    int itemNumber = item->action() - ContextMenuItemBaseCustomTag;
-    dispatchOnWebInspector("contextMenuItemSelected", String::number(itemNumber));
-}
-
-void WebDevToolsFrontendImpl::contextMenuCleared()
-{
-    dispatchOnWebInspector("contextMenuCleared", "");
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsLoaded(const v8::Arguments& args)
-{
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-    frontend->m_loaded = true;
-
-    // Grant the devtools page the ability to have source view iframes.
-    Page* page = V8Proxy::retrieveFrameForEnteredContext()->page();
-    SecurityOrigin* origin = page->mainFrame()->domWindow()->securityOrigin();
-    origin->grantUniversalAccess();
-
-    for (Vector<Vector<String> >::iterator it = frontend->m_pendingIncomingMessages.begin();
-         it != frontend->m_pendingIncomingMessages.end();
-         ++it) {
-        frontend->executeScript(*it);
-    }
-    frontend->m_pendingIncomingMessages.clear();
-    return v8::Undefined();
-}
-
-// static
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsPlatform(const v8::Arguments& args)
-{
-#if defined(OS_MACOSX)
-    return v8String("mac");
-#elif defined(OS_LINUX)
-    return v8String("linux");
-#elif defined(OS_WIN)
-    return v8String("windows");
-#else
-    return v8String("unknown");
-#endif
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsPort(const v8::Arguments& args)
-{
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsCopyText(const v8::Arguments& args)
-{
-    String text = WebCore::toWebCoreStringWithNullCheck(args[0]);
-    Pasteboard::generalPasteboard()->writePlainText(text);
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsActivateWindow(const v8::Arguments& args)
-{
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-    frontend->m_client->activateWindow();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsCloseWindow(const v8::Arguments& args)
-{
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-    frontend->m_client->closeWindow();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDockWindow(const v8::Arguments& args)
-{
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-    frontend->m_client->dockWindow();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsUndockWindow(const v8::Arguments& args)
-{
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-    frontend->m_client->undockWindow();
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsLocalizedStringsURL(const v8::Arguments& args)
-{
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsHiddenPanels(const v8::Arguments& args)
-{
-    return v8String("");
-}
-
 v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerCommand(const v8::Arguments& args)
 {
     WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
@@ -326,16 +186,6 @@
     return v8::Undefined();
 }
 
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsSetting(const v8::Arguments& args)
-{
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsSetSetting(const v8::Arguments& args)
-{
-    return v8::Undefined();
-}
-
 v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerPauseScript(const v8::Arguments& args)
 {
     WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
@@ -343,53 +193,4 @@
     return v8::Undefined();
 }
 
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsWindowUnloading(const v8::Arguments& args)
-{
-    // TODO(pfeldman): Implement this.
-    return v8::Undefined();
-}
-
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsShowContextMenu(const v8::Arguments& args)
-{
-    if (args.Length() < 2)
-        return v8::Undefined();
-
-    v8::Local<v8::Object> eventWrapper = v8::Local<v8::Object>::Cast(args[0]);
-    if (V8DOMWrapper::domWrapperType(eventWrapper) != V8ClassIndex::MOUSEEVENT)
-        return v8::Undefined();
-
-    Event* event = V8Event::toNative(eventWrapper);
-    if (!args[1]->IsArray())
-        return v8::Undefined();
-
-    v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(args[1]);
-    Vector<ContextMenuItem*> items;
-
-    for (size_t i = 0; i < array->Length(); ++i) {
-        v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(array->Get(v8::Integer::New(i)));
-        v8::Local<v8::Value> label = item->Get(v8::String::New("label"));
-        v8::Local<v8::Value> id = item->Get(v8::String::New("id"));
-        if (label->IsUndefined() || id->IsUndefined()) {
-          items.append(new ContextMenuItem(SeparatorType,
-                                           ContextMenuItemTagNoAction,
-                                           String()));
-        } else {
-          ContextMenuAction typedId = static_cast<ContextMenuAction>(
-              ContextMenuItemBaseCustomTag + id->ToInt32()->Value());
-          items.append(new ContextMenuItem(ActionType,
-                                           typedId,
-                                           toWebCoreStringWithNullCheck(label)));
-        }
-    }
-
-    WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
-
-    frontend->m_menuProvider = MenuProvider::create(frontend, items);
-
-    ContextMenuController* menuController = frontend->m_webViewImpl->page()->contextMenuController();
-    menuController->showContextMenu(event, frontend->m_menuProvider);
-
-    return v8::Undefined();
-}
-
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.h b/WebKit/chromium/src/WebDevToolsFrontendImpl.h
index 62b34da..fa4707d 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.h
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.h
@@ -31,8 +31,6 @@
 #ifndef WebDevToolsFrontendImpl_h
 #define WebDevToolsFrontendImpl_h
 
-#include "ContextMenu.h"
-#include "ContextMenuProvider.h"
 #include "DevToolsRPC.h"
 #include "WebDevToolsFrontend.h"
 #include <v8.h>
@@ -74,76 +72,13 @@
     // WebDevToolsFrontend implementation.
     virtual void dispatchMessageFromAgent(const WebKit::WebDevToolsMessageData& data);
 
+    void frontendLoaded();
+
 private:
-    class MenuProvider : public WebCore::ContextMenuProvider {
-    public:
-        static PassRefPtr<MenuProvider> create(WebDevToolsFrontendImpl* frontendHost, const Vector<WebCore::ContextMenuItem*>& items)
-        {
-            return adoptRef(new MenuProvider(frontendHost, items));
-        }
-
-        virtual ~MenuProvider()
-        {
-            contextMenuCleared();
-        }
-
-        void disconnect()
-        {
-            m_frontendHost = 0;
-        }
-
-        virtual void populateContextMenu(WebCore::ContextMenu* menu)
-        {
-            for (size_t i = 0; i < m_items.size(); ++i)
-                menu->appendItem(*m_items[i]);
-        }
-
-        virtual void contextMenuItemSelected(WebCore::ContextMenuItem* item)
-        {
-            if (m_frontendHost)
-                m_frontendHost->contextMenuItemSelected(item);
-        }
-
-        virtual void contextMenuCleared()
-        {
-            if (m_frontendHost)
-                m_frontendHost->contextMenuCleared();
-            deleteAllValues(m_items);
-            m_items.clear();
-        }
-
-    private:
-        MenuProvider(WebDevToolsFrontendImpl* frontendHost, const Vector<WebCore::ContextMenuItem*>& items)
-            : m_frontendHost(frontendHost)
-            , m_items(items) { }
-        WebDevToolsFrontendImpl* m_frontendHost;
-        Vector<WebCore::ContextMenuItem*> m_items;
-    };
-
     void executeScript(const Vector<String>& v);
-    void dispatchOnWebInspector(const String& method, const String& param);
 
-    // friend class MenuSelectionHandler;
-    void contextMenuItemSelected(WebCore::ContextMenuItem* menuItem);
-    void contextMenuCleared();
-
-    static v8::Handle<v8::Value> jsLoaded(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsPlatform(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsPort(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsCopyText(const v8::Arguments& args);
-
-    static v8::Handle<v8::Value> jsActivateWindow(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsCloseWindow(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsDockWindow(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsUndockWindow(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsLocalizedStringsURL(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsHiddenPanels(const v8::Arguments& args);
     static v8::Handle<v8::Value> jsDebuggerCommand(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsSetting(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsSetSetting(const v8::Arguments& args);
     static v8::Handle<v8::Value> jsDebuggerPauseScript(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsWindowUnloading(const v8::Arguments& args);
-    static v8::Handle<v8::Value> jsShowContextMenu(const v8::Arguments& args);
 
     WebKit::WebViewImpl* m_webViewImpl;
     WebKit::WebDevToolsFrontendClient* m_client;
@@ -153,7 +88,6 @@
     OwnPtr<JSToolsAgentBoundObj> m_toolsAgentObj;
     bool m_loaded;
     Vector<Vector<String> > m_pendingIncomingMessages;
-    RefPtr<MenuProvider> m_menuProvider;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebDocument.cpp b/WebKit/chromium/src/WebDocument.cpp
index 2a91e22..21e2bb8 100644
--- a/WebKit/chromium/src/WebDocument.cpp
+++ b/WebKit/chromium/src/WebDocument.cpp
@@ -32,7 +32,6 @@
 #include "WebDocument.h"
 
 #include "Document.h"
-#include "DocumentLoader.h"
 #include "Element.h"
 #include "HTMLAllCollection.h"
 #include "HTMLBodyElement.h"
@@ -44,6 +43,7 @@
 #include "WebElement.h"
 #include "WebFrameImpl.h"
 #include "WebNodeCollection.h"
+#include "WebNodeList.h"
 #include "WebURL.h"
 
 #include <wtf/PassRefPtr.h>
@@ -52,22 +52,6 @@
 
 namespace WebKit {
 
-WebDocument::WebDocument(const PassRefPtr<Document>& elem)
-    : WebNode(elem)
-{
-}
-
-WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem)
-{
-    WebNode::assign(elem.releaseRef());
-    return *this;
-}
-
-WebDocument::operator PassRefPtr<Document>() const
-{
-    return PassRefPtr<Document>(static_cast<Document*>(m_private));
-}
-
 WebFrame* WebDocument::frame() const
 {
     return WebFrameImpl::fromFrame(constUnwrap<Document>()->frame());
@@ -78,11 +62,21 @@
     return constUnwrap<Document>()->isHTMLDocument();
 }
 
+bool WebDocument::isPluginDocument() const
+{  
+    return constUnwrap<Document>()->isPluginDocument();
+}
+
 WebURL WebDocument::baseURL() const
 {
     return constUnwrap<Document>()->baseURL();
 }
 
+WebURL WebDocument::firstPartyForCookies() const
+{
+    return constUnwrap<Document>()->firstPartyForCookies();
+}
+
 WebElement WebDocument::documentElement() const
 {
     return WebElement(constUnwrap<Document>()->documentElement());
@@ -118,38 +112,25 @@
     return WebElement(constUnwrap<Document>()->getElementById(id));
 }
 
-WebString WebDocument::applicationID() const
+WebNode WebDocument::focusedNode() const
 {
-    const char* kChromeApplicationHeader = "x-chrome-application";
+    return WebNode(constUnwrap<Document>()->focusedNode());
+}
 
-    // First check if the document's response included a header indicating the
-    // application it should go with.
-    const Document* document = constUnwrap<Document>();
-    Frame* frame = document->frame();
-    if (!frame)
-        return WebString();
+WebDocument::WebDocument(const PassRefPtr<Document>& elem)
+    : WebNode(elem)
+{
+}
 
-    DocumentLoader* loader = frame->loader()->documentLoader();
-    if (!loader)
-        return WebString();
+WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem)
+{
+    m_private = elem;
+    return *this;
+}
 
-    WebString headerValue =
-        loader->response().httpHeaderField(kChromeApplicationHeader);
-    if (!headerValue.isEmpty())
-        return headerValue;
-
-    // Otherwise, fall back to looking for the meta tag.
-    RefPtr<NodeList> metaTags =
-        const_cast<Document*>(document)->getElementsByTagName("meta");
-    for (unsigned i = 0; i < metaTags->length(); ++i) {
-        Element* element = static_cast<Element*>(metaTags->item(i));
-        if (element->getAttribute("http-equiv").lower() ==
-                kChromeApplicationHeader) {
-            return element->getAttribute("value");
-        }
-    }
-
-    return WebString();
+WebDocument::operator PassRefPtr<Document>() const
+{
+    return static_cast<Document*>(m_private.get());
 }
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebDragData.cpp b/WebKit/chromium/src/WebDragData.cpp
index 2f476a7..643c35d 100644
--- a/WebKit/chromium/src/WebDragData.cpp
+++ b/WebKit/chromium/src/WebDragData.cpp
@@ -67,13 +67,13 @@
 WebURL WebDragData::url() const
 {
     ASSERT(!isNull());
-    return m_private->url;
+    return m_private->getURL();
 }
 
 void WebDragData::setURL(const WebURL& url)
 {
     ensureMutable();
-    m_private->url = url;
+    m_private->setURL(url);
 }
 
 WebString WebDragData::urlTitle() const
diff --git a/WebKit/chromium/src/WebElement.cpp b/WebKit/chromium/src/WebElement.cpp
index 6501771..3ed16e6 100644
--- a/WebKit/chromium/src/WebElement.cpp
+++ b/WebKit/chromium/src/WebElement.cpp
@@ -38,20 +38,9 @@
 
 namespace WebKit {
 
-WebElement::WebElement(const WTF::PassRefPtr<WebCore::Element>& elem)
-    : WebNode(elem)
+bool WebElement::isFormControlElement() const
 {
-}
-
-WebElement& WebElement::operator=(const WTF::PassRefPtr<WebCore::Element>& elem)
-{
-    WebNode::assign(elem.releaseRef());
-    return *this;
-}
-
-WebElement::operator WTF::PassRefPtr<Element>() const
-{
-    return PassRefPtr<Element>(static_cast<Element*>(m_private));
+    return constUnwrap<Element>()->isFormControlElement();
 }
 
 WebString WebElement::tagName() const
@@ -62,7 +51,7 @@
 bool WebElement::hasTagName(const WebString& tagName) const
 {
     return equalIgnoringCase(constUnwrap<Element>()->tagName(),
-                             tagName.operator WebCore::String());
+                             tagName.operator String());
 }
 
 bool WebElement::hasAttribute(const WebString& attrName) const
@@ -87,5 +76,20 @@
     return constUnwrap<Element>()->innerText();
 }
 
-} // namespace WebKit
+WebElement::WebElement(const PassRefPtr<Element>& elem)
+    : WebNode(elem)
+{
+}
 
+WebElement& WebElement::operator=(const PassRefPtr<Element>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebElement::operator PassRefPtr<Element>() const
+{
+    return static_cast<Element*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebFormControlElement.cpp b/WebKit/chromium/src/WebFormControlElement.cpp
new file mode 100644
index 0000000..0530776
--- /dev/null
+++ b/WebKit/chromium/src/WebFormControlElement.cpp
@@ -0,0 +1,85 @@
+/*
+ * 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 "WebFormControlElement.h"
+
+#include "HTMLFormControlElement.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+bool WebFormControlElement::isEnabled() const
+{
+    return constUnwrap<HTMLFormControlElement>()->isEnabledFormControl();
+}
+
+WebString WebFormControlElement::formControlName() const
+{
+    return constUnwrap<HTMLFormControlElement>()->formControlName();
+}
+
+WebString WebFormControlElement::formControlType() const
+{
+    return constUnwrap<HTMLFormControlElement>()->formControlType();
+}
+
+WebString WebFormControlElement::nameForAutofill() const
+{
+    String name = constUnwrap<HTMLFormControlElement>()->name();
+    String trimmedName = name.stripWhiteSpace();
+    if (!trimmedName.isEmpty())
+        return trimmedName;
+    name = constUnwrap<HTMLFormControlElement>()->getAttribute(HTMLNames::idAttr);
+    trimmedName = name.stripWhiteSpace();
+    if (!trimmedName.isEmpty())
+        return trimmedName;
+    return String();
+}
+
+WebFormControlElement::WebFormControlElement(const PassRefPtr<HTMLFormControlElement>& elem)
+    : WebElement(elem)
+{
+}
+
+WebFormControlElement& WebFormControlElement::operator=(const PassRefPtr<HTMLFormControlElement>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebFormControlElement::operator PassRefPtr<HTMLFormControlElement>() const
+{
+    return static_cast<HTMLFormControlElement*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebFormElement.cpp b/WebKit/chromium/src/WebFormElement.cpp
index 0024892..610c36d 100644
--- a/WebKit/chromium/src/WebFormElement.cpp
+++ b/WebKit/chromium/src/WebFormElement.cpp
@@ -35,6 +35,8 @@
 #include "HTMLFormElement.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
+#include "WebFormControlElement.h"
+#include "WebInputElement.h"
 #include "WebString.h"
 #include "WebURL.h"
 #include <wtf/PassRefPtr.h>
@@ -43,25 +45,6 @@
 
 namespace WebKit {
 
-class WebFormPrivate : public HTMLFormElement {
-};
-
-WebFormElement::WebFormElement(const WTF::PassRefPtr<HTMLFormElement>& e)
-    : WebElement(e)
-{
-}
-
-WebFormElement& WebFormElement::operator=(const WTF::PassRefPtr<HTMLFormElement>& e)
-{
-    WebNode::assign(e.releaseRef());
-    return *this;
-}
-
-WebFormElement::operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const
-{
-    return PassRefPtr<HTMLFormElement>(static_cast<HTMLFormElement*>(m_private));
-}
-
 bool WebFormElement::autoComplete() const
 {
     return constUnwrap<HTMLFormElement>()->autoComplete();
@@ -107,4 +90,32 @@
     result.assign(tempVector);
 }
 
+void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
+{
+    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
+    Vector<RefPtr<HTMLFormControlElement> > tempVector;
+    for (size_t i = 0; i < form->formElements.size(); i++) {
+        if (form->formElements[i]->hasLocalName(HTMLNames::inputTag)
+            || form->formElements[i]->hasLocalName(HTMLNames::selectTag))
+            tempVector.append(form->formElements[i]);
+    }
+    result.assign(tempVector);
+}
+
+WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e)
+    : WebElement(e)
+{
+}
+
+WebFormElement& WebFormElement::operator=(const PassRefPtr<HTMLFormElement>& e)
+{
+    m_private = e;
+    return *this;
+}
+
+WebFormElement::operator PassRefPtr<HTMLFormElement>() const
+{
+    return static_cast<HTMLFormElement*>(m_private.get());
+}
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 665f6a3..7b6c8ce 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -101,6 +101,7 @@
 #include "markup.h"
 #include "Page.h"
 #include "PlatformContextSkia.h"
+#include "PluginDocument.h"
 #include "PrintContext.h"
 #include "RenderFrame.h"
 #include "RenderTreeAsText.h"
@@ -130,6 +131,7 @@
 #include "WebHistoryItem.h"
 #include "WebInputElement.h"
 #include "WebPasswordAutocompleteListener.h"
+#include "WebPluginContainerImpl.h"
 #include "WebRange.h"
 #include "WebRect.h"
 #include "WebScriptSource.h"
@@ -246,7 +248,20 @@
     }
 }
 
-// Simple class to override some of PrintContext behavior.
+// If the frame hosts a PluginDocument, this method returns the WebPluginContainerImpl
+// that hosts the plugin.
+static WebPluginContainerImpl* pluginContainerFromFrame(Frame* frame)
+{
+    if (!frame)
+        return 0;
+    if (!frame->document() || !frame->document()->isPluginDocument())
+        return 0;
+    PluginDocument* pluginDocument = static_cast<PluginDocument*>(frame->document());
+    return static_cast<WebPluginContainerImpl *>(pluginDocument->pluginWidget());
+}
+
+// Simple class to override some of PrintContext behavior. Some of the methods
+// made virtual so that they can be overriden by ChromePluginPrintContext.
 class ChromePrintContext : public PrintContext, public Noncopyable {
 public:
     ChromePrintContext(Frame* frame)
@@ -255,28 +270,38 @@
     {
     }
 
-    void begin(float width)
+    virtual void begin(float width)
     {
         ASSERT(!m_printedPageWidth);
         m_printedPageWidth = width;
         PrintContext::begin(m_printedPageWidth);
     }
 
-    float getPageShrink(int pageNumber) const
+    virtual void end()
+    {
+        PrintContext::end();
+    }
+
+    virtual float getPageShrink(int pageNumber) const
     {
         IntRect pageRect = m_pageRects[pageNumber];
         return m_printedPageWidth / pageRect.width();
     }
 
-    // Spools the printed page, a subrect of m_frame.  Skip the scale step.
+    // Spools the printed page, a subrect of m_frame. Skip the scale step.
     // NativeTheme doesn't play well with scaling. Scaling is done browser side
-    // instead.  Returns the scale to be applied.
-    float spoolPage(GraphicsContext& ctx, int pageNumber)
+    // instead. Returns the scale to be applied.
+    // On Linux, we don't have the problem with NativeTheme, hence we let WebKit
+    // do the scaling and ignore the return value.
+    virtual float spoolPage(GraphicsContext& ctx, int pageNumber)
     {
         IntRect pageRect = m_pageRects[pageNumber];
         float scale = m_printedPageWidth / pageRect.width();
 
         ctx.save();
+#if OS(LINUX)
+        ctx.scale(WebCore::FloatSize(scale, scale));
+#endif
         ctx.translate(static_cast<float>(-pageRect.x()),
                       static_cast<float>(-pageRect.y()));
         ctx.clip(pageRect);
@@ -285,11 +310,95 @@
         return scale;
     }
 
+    virtual void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight)
+    {
+        return PrintContext::computePageRects(printRect, headerHeight, footerHeight, userScaleFactor, outPageHeight);
+    }
+
+    virtual int pageCount() const
+    {
+        return PrintContext::pageCount();
+    }
+
+    virtual bool shouldUseBrowserOverlays() const
+    {
+        return true;
+    }
+
 private:
     // Set when printing.
     float m_printedPageWidth;
 };
 
+// Simple class to override some of PrintContext behavior. This is used when
+// the frame hosts a plugin that supports custom printing. In this case, we
+// want to delegate all printing related calls to the plugin.
+class ChromePluginPrintContext : public ChromePrintContext {
+public:
+    ChromePluginPrintContext(Frame* frame, int printerDPI)
+        : ChromePrintContext(frame), m_pageCount(0), m_printerDPI(printerDPI)
+    {
+        // This HAS to be a frame hosting a full-mode plugin
+        ASSERT(frame->document()->isPluginDocument());
+    }
+
+    virtual void begin(float width)
+    {
+    }
+
+    virtual void end()
+    {
+        WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(m_frame);
+        if (pluginContainer && pluginContainer->supportsPaginatedPrint())
+            pluginContainer->printEnd();
+        else
+            ASSERT_NOT_REACHED();
+    }
+
+    virtual float getPageShrink(int pageNumber) const
+    {
+        // We don't shrink the page (maybe we should ask the widget ??)
+        return 1.0;
+    }
+
+    virtual void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight)
+    {
+        WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(m_frame);
+        if (pluginContainer && pluginContainer->supportsPaginatedPrint())
+            m_pageCount = pluginContainer->printBegin(IntRect(printRect), m_printerDPI);
+        else
+            ASSERT_NOT_REACHED();
+    }
+
+    virtual int pageCount() const
+    {
+        return m_pageCount;
+    }
+
+    // Spools the printed page, a subrect of m_frame.  Skip the scale step.
+    // NativeTheme doesn't play well with scaling. Scaling is done browser side
+    // instead.  Returns the scale to be applied.
+    virtual float spoolPage(GraphicsContext& ctx, int pageNumber)
+    {
+        WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(m_frame);
+        if (pluginContainer && pluginContainer->supportsPaginatedPrint())
+            pluginContainer->printPage(pageNumber, &ctx);
+        else
+            ASSERT_NOT_REACHED();
+        return 1.0;
+    }
+
+    virtual bool shouldUseBrowserOverlays() const
+    {
+        return false;
+    }
+
+private:
+    // Set when printing.
+    int m_pageCount;
+    int m_printerDPI;
+};
+
 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader)
 {
     return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0;
@@ -413,7 +522,7 @@
 
 WebString WebFrameImpl::encoding() const
 {
-    return frame()->loader()->encoding();
+    return frame()->loader()->writer()->encoding();
 }
 
 WebSize WebFrameImpl::scrollOffset() const
@@ -553,13 +662,18 @@
         return;
 
     RefPtr<HTMLCollection> forms = m_frame->document()->forms();
-    size_t formCount = forms->length();
+    size_t formCount = 0;
+    for (size_t i = 0; i < forms->length(); ++i) {
+        Node* node = forms->item(i);
+        if (node && node->isHTMLElement())
+            ++formCount;
+    }
 
     WebVector<WebFormElement> temp(formCount);
     for (size_t i = 0; i < formCount; ++i) {
         Node* node = forms->item(i);
         // Strange but true, sometimes item can be 0.
-        if (node)
+        if (node && node->isHTMLElement())
             temp[i] = static_cast<HTMLFormElement*>(node);
     }
     results.swap(temp);
@@ -596,7 +710,7 @@
 void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
 {
     ASSERT(m_frame);
-    if (!m_frame || !m_frame->script()->canExecuteScripts())
+    if (!m_frame || !m_frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         return;
 
     String key = name;
@@ -670,6 +784,13 @@
 }
 
 #if USE(V8)
+v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(
+    const WebScriptSource& source)
+{
+    return m_frame->script()->executeScript(
+        ScriptSourceCode(source.code, source.url, source.startLine)).v8Value();
+}
+
 // Returns the V8 context for this frame, or an empty handle if there is none.
 v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const
 {
@@ -716,9 +837,6 @@
 void WebFrameImpl::reload(bool ignoreCache)
 {
     m_frame->loader()->history()->saveDocumentAndScrollState();
-
-    stopLoading();  // Make sure existing activity stops.
-
     m_frame->loader()->reload(ignoreCache);
 }
 
@@ -732,7 +850,6 @@
         return;
     }
 
-    stopLoading();  // Make sure existing activity stops.
     m_frame->loader()->load(resourceRequest, false);
 }
 
@@ -741,8 +858,6 @@
     RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
     ASSERT(historyItem.get());
 
-    stopLoading();  // Make sure existing activity stops.
-
     // If there is no currentItem, which happens when we are navigating in
     // session history after a crash, we need to manufacture one otherwise WebKit
     // hoarks. This is probably the wrong thing to do, but it seems to work.
@@ -779,8 +894,6 @@
         request = m_frame->loader()->originalRequest();
     request.setURL(baseURL);
 
-    stopLoading();  // Make sure existing activity stops.
-
     m_frame->loader()->load(request, substData, false);
     if (replace) {
         // Do this to force WebKit to treat the load as replacing the currently
@@ -848,7 +961,12 @@
 
 WebHistoryItem WebFrameImpl::currentHistoryItem() const
 {
-    m_frame->loader()->history()->saveDocumentAndScrollState();
+    // If we are still loading, then we don't want to clobber the current
+    // history item as this could cause us to lose the scroll position and 
+    // document state.  However, it is OK for new navigations.
+    if (m_frame->loader()->loadType() == FrameLoadTypeStandard
+        || !m_frame->loader()->activeDocumentLoader()->isLoadingInAPISense())
+        m_frame->loader()->history()->saveDocumentAndScrollState();
 
     return WebHistoryItem(m_frame->page()->backForwardList()->currentItem());
 }
@@ -898,7 +1016,7 @@
         userChosen = false;
         encoding = documentLoader->response().textEncodingName();
     }
-    m_frame->loader()->setEncoding(encoding, userChosen);
+    m_frame->loader()->writer()->setEncoding(encoding, userChosen);
 
     // NOTE: mac only does this if there is a document
     m_frame->loader()->addData(data, dataLen);
@@ -1083,11 +1201,10 @@
     VisibleSelection selection(pos);
     selection.expandUsingGranularity(WordGranularity);
 
-    if (selection.isRange())
-        frame->setSelectionGranularity(WordGranularity);
-
-    if (frame->shouldChangeSelection(selection))
-        frame->selection()->setSelection(selection);
+    if (frame->shouldChangeSelection(selection)) {
+        TextGranularity granularity = selection.isRange() ? WordGranularity : CharacterGranularity;
+        frame->selection()->setSelection(selection, granularity);
+    }
 }
 
 bool WebFrameImpl::selectWordAroundCaret()
@@ -1100,11 +1217,17 @@
     return true;
 }
 
-int WebFrameImpl::printBegin(const WebSize& pageSize)
+int WebFrameImpl::printBegin(const WebSize& pageSize, int printerDPI, bool *useBrowserOverlays)
 {
     ASSERT(!frame()->document()->isFrameSet());
+    // If this is a plugin document, check if the plugin supports its own
+    // printing. If it does, we will delegate all printing to that.
+    WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
+    if (pluginContainer && pluginContainer->supportsPaginatedPrint())
+        m_printContext.set(new ChromePluginPrintContext(frame(), printerDPI));
+    else
+        m_printContext.set(new ChromePrintContext(frame()));
 
-    m_printContext.set(new ChromePrintContext(frame()));
     FloatRect rect(0, 0, static_cast<float>(pageSize.width),
                          static_cast<float>(pageSize.height));
     m_printContext->begin(rect.width());
@@ -1112,6 +1235,9 @@
     // We ignore the overlays calculation for now since they are generated in the
     // browser. pageHeight is actually an output parameter.
     m_printContext->computePageRects(rect, 0, 0, 1.0, pageHeight);
+    if (useBrowserOverlays)
+        *useBrowserOverlays = m_printContext->shouldUseBrowserOverlays();
+
     return m_printContext->pageCount();
 }
 
@@ -1134,7 +1260,7 @@
         return 0;
     }
 
-#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD)
+#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)
     PlatformContextSkia context(canvas);
     GraphicsContext spool(&context);
 #elif OS(DARWIN)
@@ -1209,6 +1335,9 @@
             executeCommand(WebString::fromUTF8("Unselect"));
         }
 
+        // Make sure no node is focused. See http://crbug.com/38700.
+        frame()->document()->setFocusedNode(0);
+
         if (!options.findNext || activeSelection) {
             // This is either a Find operation or a Find-next from a new start point
             // due to a selection, so we set the flag to ask the scoping effort
@@ -1534,6 +1663,14 @@
     return PrintContext::pageNumberForElement(element, pageSize);
 }
 
+WebRect WebFrameImpl::selectionBoundsRect() const
+{
+    if (hasSelection())
+        return IntRect(frame()->selectionBounds(false));
+
+    return WebRect();
+}
+
 // WebFrameImpl public ---------------------------------------------------------
 
 PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
@@ -1635,11 +1772,23 @@
         view->layoutIfNeededRecursive();
 }
 
+void WebFrameImpl::paintWithContext(GraphicsContext& gc, const WebRect& rect)
+{
+    IntRect dirtyRect(rect);
+    gc.save();
+    if (m_frame->document() && frameView()) {
+        gc.clip(dirtyRect);
+        frameView()->paint(&gc, dirtyRect);
+        m_frame->page()->inspectorController()->drawNodeHighlight(gc);
+    } else
+        gc.fillRect(dirtyRect, Color::white, DeviceColorSpace);
+    gc.restore();
+}
+
 void WebFrameImpl::paint(WebCanvas* canvas, const WebRect& rect)
 {
     if (rect.isEmpty())
         return;
-    IntRect dirtyRect(rect);
 #if WEBKIT_USING_CG
     GraphicsContext gc(canvas);
     LocalCurrentGraphicsContext localContext(&gc);
@@ -1651,14 +1800,7 @@
 #else
     notImplemented();
 #endif
-    gc.save();
-    if (m_frame->document() && frameView()) {
-        gc.clip(dirtyRect);
-        frameView()->paint(&gc, dirtyRect);
-        m_frame->page()->inspectorController()->drawNodeHighlight(gc);
-    } else
-        gc.fillRect(dirtyRect, Color::white, DeviceColorSpace);
-    gc.restore();
+    paintWithContext(gc, rect);
 }
 
 void WebFrameImpl::createFrameView()
@@ -1720,7 +1862,7 @@
         static_cast<HTMLFrameOwnerElement*>(element);
     return fromFrame(frameElement->contentFrame());
 }
-    
+
 WebViewImpl* WebFrameImpl::viewImpl() const
 {
     if (!m_frame)
@@ -1795,9 +1937,9 @@
         client()->didFailLoad(this, webError);
 }
 
-void WebFrameImpl::setAllowsScrolling(bool flag)
+void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars)
 {
-    m_frame->view()->setCanHaveScrollbars(flag);
+    m_frame->view()->setCanHaveScrollbars(canHaveScrollbars);
 }
 
 void WebFrameImpl::registerPasswordListener(
@@ -1833,6 +1975,8 @@
         if ((area & InvalidateContentArea) == InvalidateContentArea) {
             IntRect contentArea(
                 view->x(), view->y(), view->visibleWidth(), view->visibleHeight());
+            IntRect frameRect = view->frameRect();
+            contentArea.move(-frameRect.topLeft().x(), -frameRect.topLeft().y());
             view->invalidateRect(contentArea);
         }
 
@@ -1842,6 +1986,8 @@
                 view->x() + view->visibleWidth(), view->y(),
                 ScrollbarTheme::nativeTheme()->scrollbarThickness(),
                 view->visibleHeight());
+            IntRect frameRect = view->frameRect();
+            scrollBarVert.move(-frameRect.topLeft().x(), -frameRect.topLeft().y());
             view->invalidateRect(scrollBarVert);
         }
     }
@@ -1975,12 +2121,13 @@
 
 void WebFrameImpl::loadJavaScriptURL(const KURL& url)
 {
-    // This is copied from FrameLoader::executeIfJavaScriptURL.  Unfortunately,
-    // we cannot just use that method since it is private, and it also doesn't
-    // quite behave as we require it to for bookmarklets.  The key difference is
-    // that we need to suppress loading the string result from evaluating the JS
-    // URL if executing the JS URL resulted in a location change.  We also allow
-    // a JS URL to be loaded even if scripts on the page are otherwise disabled.
+    // This is copied from ScriptController::executeIfJavaScriptURL.
+    // Unfortunately, we cannot just use that method since it is private, and
+    // it also doesn't quite behave as we require it to for bookmarklets.  The
+    // key difference is that we need to suppress loading the string result
+    // from evaluating the JS URL if executing the JS URL resulted in a
+    // location change.  We also allow a JS URL to be loaded even if scripts on
+    // the page are otherwise disabled.
 
     if (!m_frame->document() || !m_frame->page())
         return;
@@ -1996,9 +2143,9 @@
 
     if (!m_frame->redirectScheduler()->locationChangePending()) {
         m_frame->loader()->stopAllLoaders();
-        m_frame->loader()->begin(m_frame->loader()->url(), true, securityOrigin);
-        m_frame->loader()->write(scriptResult);
-        m_frame->loader()->end();
+        m_frame->loader()->writer()->begin(m_frame->loader()->url(), true, securityOrigin);
+        m_frame->loader()->writer()->addData(scriptResult);
+        m_frame->loader()->writer()->end();
     }
 }
 
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index f23106c..08d3cc2 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -42,6 +42,7 @@
 #include "WebAnimationControllerImpl.h"
 
 namespace WebCore {
+class GraphicsContext;
 class HistoryItem;
 class KURL;
 class Node;
@@ -88,7 +89,7 @@
     virtual WebFrame* findChildByExpression(const WebString&) const;
     virtual WebDocument document() const;
     virtual void forms(WebVector<WebFormElement>&) const;
-    virtual WebAnimationController* animationController(); 
+    virtual WebAnimationController* animationController();
     virtual WebSecurityOrigin securityOrigin() const;
     virtual void grantUniversalAccess();
     virtual NPObject* windowObject() const;
@@ -100,6 +101,8 @@
     virtual void addMessageToConsole(const WebConsoleMessage&);
     virtual void collectGarbage();
 #if WEBKIT_USING_V8
+    virtual v8::Handle<v8::Value> executeScriptAndReturnValue(
+        const WebScriptSource&);
     virtual v8::Local<v8::Context> mainWorldScriptContext() const;
 #endif
     virtual bool insertStyleText(const WebString& css, const WebString& id);
@@ -142,7 +145,8 @@
     virtual WebString selectionAsText() const;
     virtual WebString selectionAsMarkup() const;
     virtual bool selectWordAroundCaret();
-    virtual int printBegin(const WebSize& pageSize);
+    virtual int printBegin(const WebSize& pageSize, int printerDPI,
+                           bool* useBrowserOverlays);
     virtual float printPage(int pageToPrint, WebCanvas*);
     virtual float getPrintPageShrink(int page);
     virtual void printEnd();
@@ -167,6 +171,7 @@
     virtual int pageNumberForElementById(const WebString& id,
                                          float pageWidthInPixels,
                                          float pageHeightInPixels) const;
+    virtual WebRect selectionBoundsRect() const;
 
     static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
     ~WebFrameImpl();
@@ -179,6 +184,7 @@
 
     void layout();
     void paint(WebCanvas*, const WebRect&);
+    void paintWithContext(WebCore::GraphicsContext&, const WebRect&);
     void createFrameView();
 
     static WebFrameImpl* fromFrame(WebCore::Frame* frame);
@@ -212,7 +218,7 @@
     // Sets whether the WebFrameImpl allows its document to be scrolled.
     // If the parameter is true, allow the document to be scrolled.
     // Otherwise, disallow scrolling.
-    void setAllowsScrolling(bool);
+    void setCanHaveScrollbars(bool);
 
     // Returns the password autocomplete listener associated with the passed
     // user name input element, or 0 if none available.
diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
new file mode 100644
index 0000000..07f09da
--- /dev/null
+++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
@@ -0,0 +1,179 @@
+/*
+ * 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 "WebGeolocationServiceBridgeImpl.h"
+
+#include "Chrome.h"
+#include "ChromeClientImpl.h"
+#include "Frame.h"
+#include "Geolocation.h"
+#include "GeolocationServiceChromium.h"
+#include "Geoposition.h"
+#include "Page.h"
+#include "PositionError.h"
+#include "PositionOptions.h"
+#include "WebFrame.h"
+#include "WebFrameImpl.h"
+#include "WebGeolocationService.h"
+#include "WebGeolocationServiceBridge.h"
+#include "WebViewClient.h"
+#include "WebViewImpl.h"
+
+#if ENABLE(GEOLOCATION)
+
+using WebCore::Coordinates;
+using WebCore::Frame;
+using WebCore::Geolocation;
+using WebCore::GeolocationServiceBridge;
+using WebCore::GeolocationServiceChromium;
+using WebCore::GeolocationServiceClient;
+using WebCore::Geoposition;
+using WebCore::PositionError;
+using WebCore::PositionOptions;
+using WebCore::String;
+
+namespace WebKit {
+
+class WebGeolocationServiceBridgeImpl : public GeolocationServiceBridge, public WebGeolocationServiceBridge {
+public:
+    explicit WebGeolocationServiceBridgeImpl(GeolocationServiceChromium*);
+    virtual ~WebGeolocationServiceBridgeImpl();
+
+    // GeolocationServiceBridge
+    virtual bool startUpdating(PositionOptions*);
+    virtual void stopUpdating();
+    virtual void suspend();
+    virtual void resume();
+    virtual int getBridgeId() const;
+
+    // WebGeolocationServiceBridge
+    virtual void setIsAllowed(bool allowed);
+    virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp);
+    virtual void setLastError(int errorCode, const WebString& message);
+
+private:
+    WebViewClient* getWebViewClient();
+
+    // GeolocationServiceChromium owns us, we only have a pointer back to it.
+    GeolocationServiceChromium* m_GeolocationServiceChromium;
+    int m_bridgeId;
+};
+
+GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
+{
+    return new WebGeolocationServiceBridgeImpl(geolocationServiceChromium);
+}
+
+WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
+    : m_GeolocationServiceChromium(geolocationServiceChromium)
+{
+    // We need to attach ourselves here: Geolocation calls requestPermissionForFrame()
+    // directly, and we need to be attached so that the embedder can call
+    // our setIsAllowed().
+    m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
+    ASSERT(m_bridgeId);
+}
+
+WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl()
+{
+    WebKit::WebViewClient* webViewClient = getWebViewClient();
+    // Geolocation has an OwnPtr to us, and it's destroyed after the frame has
+    // been potentially disconnected. In this case, it calls stopUpdating()
+    // has been called and we have already detached ourselves.
+    if (!webViewClient)
+        ASSERT(!m_bridgeId);
+    else if (m_bridgeId)
+        webViewClient->geolocationService()->detachBridge(m_bridgeId);
+}
+
+bool WebGeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions)
+{
+    if (!m_bridgeId)
+        m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
+    getWebViewClient()->geolocationService()->startUpdating(m_bridgeId, m_GeolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy());
+    return true;
+}
+
+void WebGeolocationServiceBridgeImpl::stopUpdating()
+{
+    WebViewClient* webViewClient = getWebViewClient();
+    if (m_bridgeId && webViewClient) {
+        WebGeolocationService* geolocationService = webViewClient->geolocationService();
+        geolocationService->stopUpdating(m_bridgeId);
+        geolocationService->detachBridge(m_bridgeId);
+    }
+    m_bridgeId = 0;
+}
+
+void WebGeolocationServiceBridgeImpl::suspend()
+{
+    getWebViewClient()->geolocationService()->suspend(m_bridgeId);
+}
+
+void WebGeolocationServiceBridgeImpl::resume()
+{
+    getWebViewClient()->geolocationService()->resume(m_bridgeId);
+}
+
+int WebGeolocationServiceBridgeImpl::getBridgeId() const
+{
+    return m_bridgeId;
+}
+
+void WebGeolocationServiceBridgeImpl::setIsAllowed(bool allowed)
+{
+    m_GeolocationServiceChromium->setIsAllowed(allowed);
+}
+
+void WebGeolocationServiceBridgeImpl::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp)
+{
+    RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed), timestamp);
+    m_GeolocationServiceChromium->setLastPosition(geoposition);
+}
+
+void WebGeolocationServiceBridgeImpl::setLastError(int errorCode, const WebString& message)
+{
+    m_GeolocationServiceChromium->setLastError(errorCode, message);
+}
+
+WebViewClient* WebGeolocationServiceBridgeImpl::getWebViewClient()
+{
+    Frame* frame = m_GeolocationServiceChromium->frame();
+    if (!frame || !frame->page())
+        return 0;
+    WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client());
+    WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
+    return webViewClient;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.h b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.h
new file mode 100644
index 0000000..2c37bcb
--- /dev/null
+++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.h
@@ -0,0 +1,43 @@
+/*
+ * 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 WebGeolocationServiceBridgeImpl_h
+#define WebGeolocationServiceBridgeImpl_h
+
+namespace WebCore {
+class GeolocationServiceBridge;
+class GeolocationServiceChromium;
+}
+
+namespace WebKit {
+WebCore::GeolocationServiceBridge* createGeolocationServiceBridgeImpl(WebCore::GeolocationServiceChromium*);
+} // namespace WebKit
+
+#endif // WebGeolocationServiceBridgeImpl_h
diff --git a/WebKit/chromium/src/WebGraphicsContext3D.cpp b/WebKit/chromium/src/WebGraphicsContext3D.cpp
new file mode 100644
index 0000000..bc23703
--- /dev/null
+++ b/WebKit/chromium/src/WebGraphicsContext3D.cpp
@@ -0,0 +1,51 @@
+/*
+ * 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 "WebGraphicsContext3D.h"
+
+#if ENABLE(3D_CANVAS)
+
+#include "WebGraphicsContext3DDefaultImpl.h"
+
+namespace WebKit {
+
+WebGraphicsContext3D* WebGraphicsContext3D::createDefault()
+{
+#if ENABLE(3D_CANVAS)
+    return new WebGraphicsContext3DDefaultImpl();
+#else
+    return 0;
+#endif
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
new file mode 100644
index 0000000..2ff1c11
--- /dev/null
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -0,0 +1,1399 @@
+/*
+ * 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(3D_CANVAS)
+
+#include <stdio.h>
+#include <string.h>
+
+#include "WebGraphicsContext3DDefaultImpl.h"
+
+#include "NotImplemented.h"
+
+#if OS(LINUX)
+#include <dlfcn.h>
+#endif
+
+namespace WebKit {
+
+// Uncomment this to render to a separate window for debugging
+// #define RENDER_TO_DEBUGGING_WINDOW
+
+#if OS(DARWIN)
+#define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
+#endif
+
+bool WebGraphicsContext3DDefaultImpl::s_initializedGLEW = false;
+
+#if OS(LINUX)
+WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::s_gl = 0;
+
+WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::GLConnection::create()
+{
+    Display* dpy = XOpenDisplay(0);
+    if (!dpy) {
+        printf("GraphicsContext3D: error opening X display\n");
+        return 0;
+    }
+
+    // We use RTLD_GLOBAL semantics so that GLEW initialization works;
+    // GLEW expects to be able to open the current process's handle
+    // and do dlsym's of GL entry points from there.
+    void* libGL = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
+    if (!libGL) {
+        XCloseDisplay(dpy);
+        printf("GraphicsContext3D: error opening libGL.so.1: %s\n", dlerror());
+        return 0;
+    }
+
+    PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) dlsym(libGL, "glXChooseFBConfig");
+    PFNGLXCREATENEWCONTEXTPROC createNewContext = (PFNGLXCREATENEWCONTEXTPROC) dlsym(libGL, "glXCreateNewContext");
+    PFNGLXCREATEPBUFFERPROC createPbuffer = (PFNGLXCREATEPBUFFERPROC) dlsym(libGL, "glXCreatePbuffer");
+    PFNGLXDESTROYPBUFFERPROC destroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) dlsym(libGL, "glXDestroyPbuffer");
+    PFNGLXMAKECURRENTPROC makeCurrent = (PFNGLXMAKECURRENTPROC) dlsym(libGL, "glXMakeCurrent");
+    PFNGLXDESTROYCONTEXTPROC destroyContext = (PFNGLXDESTROYCONTEXTPROC) dlsym(libGL, "glXDestroyContext");
+    PFNGLXGETCURRENTCONTEXTPROC getCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC) dlsym(libGL, "glXGetCurrentContext");
+    if (!chooseFBConfig || !createNewContext || !createPbuffer
+        || !destroyPbuffer || !makeCurrent || !destroyContext
+        || !getCurrentContext) {
+        XCloseDisplay(dpy);
+        dlclose(libGL);
+        printf("GraphicsContext3D: error looking up bootstrapping entry points\n");
+        return 0;
+    }
+    return new GLConnection(dpy,
+                            libGL,
+                            chooseFBConfig,
+                            createNewContext,
+                            createPbuffer,
+                            destroyPbuffer,
+                            makeCurrent,
+                            destroyContext,
+                            getCurrentContext);
+}
+
+WebGraphicsContext3DDefaultImpl::GLConnection::~GLConnection()
+{
+    XCloseDisplay(m_display);
+    dlclose(m_libGL);
+}
+
+#endif // OS(LINUX)
+
+WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState()
+    : enabled(false)
+    , buffer(0)
+    , indx(0)
+    , size(0)
+    , type(0)
+    , normalized(false)
+    , stride(0)
+    , offset(0)
+{
+}
+
+WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl()
+    : m_initialized(false)
+    , m_texture(0)
+    , m_fbo(0)
+    , m_depthStencilBuffer(0)
+    , m_multisampleFBO(0)
+    , m_multisampleDepthStencilBuffer(0)
+    , m_multisampleColorBuffer(0)
+    , m_boundFBO(0)
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+    , m_scanline(0)
+#endif
+    , m_boundArrayBuffer(0)
+#if OS(WINDOWS)
+    , m_canvasWindow(0)
+    , m_canvasDC(0)
+    , m_contextObj(0)
+#elif PLATFORM(CG)
+    , m_pbuffer(0)
+    , m_contextObj(0)
+    , m_renderOutput(0)
+#elif OS(LINUX)
+    , m_contextObj(0)
+    , m_pbuffer(0)
+#else
+#error Must port to your platform
+#endif
+{
+}
+
+WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
+{
+    if (m_initialized) {
+        makeContextCurrent();
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+        if (m_attributes.antialias) {
+            glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
+            if (m_attributes.depth || m_attributes.stencil)
+                glDeleteRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
+            glDeleteFramebuffersEXT(1, &m_multisampleFBO);
+        } else {
+            if (m_attributes.depth || m_attributes.stencil)
+                glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
+        }
+        glDeleteTextures(1, &m_texture);
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+        if (m_scanline)
+            delete[] m_scanline;
+#endif
+        glDeleteFramebuffersEXT(1, &m_fbo);
+#endif // !RENDER_TO_DEBUGGING_WINDOW
+#if OS(WINDOWS)
+        wglMakeCurrent(0, 0);
+        wglDeleteContext(m_contextObj);
+        ReleaseDC(m_canvasWindow, m_canvasDC);
+        DestroyWindow(m_canvasWindow);
+#elif PLATFORM(CG)
+        CGLSetCurrentContext(0);
+        CGLDestroyContext(m_contextObj);
+        CGLDestroyPBuffer(m_pbuffer);
+        if (m_renderOutput)
+            delete[] m_renderOutput;
+#elif OS(LINUX)
+        s_gl->makeCurrent(0, 0);
+        s_gl->destroyContext(m_contextObj);
+        s_gl->destroyPbuffer(m_pbuffer);
+#else
+#error Must port to your platform
+#endif
+        m_contextObj = 0;
+    }
+}
+
+bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes)
+{
+#if OS(WINDOWS)
+    WNDCLASS wc;
+    if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) {
+        ZeroMemory(&wc, sizeof(WNDCLASS));
+        wc.style = CS_OWNDC;
+        wc.hInstance = GetModuleHandle(0);
+        wc.lpfnWndProc = DefWindowProc;
+        wc.lpszClassName = L"CANVASGL";
+
+        if (!RegisterClass(&wc)) {
+            printf("WebGraphicsContext3DDefaultImpl: RegisterClass failed\n");
+            return false;
+        }
+    }
+
+    m_canvasWindow = CreateWindow(L"CANVASGL", L"CANVASGL",
+                                  WS_CAPTION,
+                                  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+                                  CW_USEDEFAULT, 0, 0, GetModuleHandle(0), 0);
+    if (!m_canvasWindow) {
+        printf("WebGraphicsContext3DDefaultImpl: CreateWindow failed\n");
+        return false;
+    }
+
+    // get the device context
+    m_canvasDC = GetDC(m_canvasWindow);
+    if (!m_canvasDC) {
+        printf("WebGraphicsContext3DDefaultImpl: GetDC failed\n");
+        return false;
+    }
+
+    // find default pixel format
+    PIXELFORMATDESCRIPTOR pfd;
+    ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
+    pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
+    pfd.nVersion = 1;
+#ifdef RENDER_TO_DEBUGGING_WINDOW
+    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
+#else
+    pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
+#endif
+    int pixelformat = ChoosePixelFormat(m_canvasDC, &pfd);
+
+    // set the pixel format for the dc
+    if (!SetPixelFormat(m_canvasDC, pixelformat, &pfd)) {
+        printf("WebGraphicsContext3DDefaultImpl: SetPixelFormat failed\n");
+        return false;
+    }
+
+    // create rendering context
+    m_contextObj = wglCreateContext(m_canvasDC);
+    if (!m_contextObj) {
+        printf("WebGraphicsContext3DDefaultImpl: wglCreateContext failed\n");
+        return false;
+    }
+
+    if (!wglMakeCurrent(m_canvasDC, m_contextObj)) {
+        printf("WebGraphicsContext3DDefaultImpl: wglMakeCurrent failed\n");
+        return false;
+    }
+
+#ifdef RENDER_TO_DEBUGGING_WINDOW
+    typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+    PFNWGLSWAPINTERVALEXTPROC setSwapInterval = 0;
+    setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT");
+    if (setSwapInterval)
+        setSwapInterval(1);
+#endif // RENDER_TO_DEBUGGING_WINDOW
+
+#elif PLATFORM(CG)
+    // Create a 1x1 pbuffer and associated context to bootstrap things
+    CGLPixelFormatAttribute attribs[] = {
+        (CGLPixelFormatAttribute) kCGLPFAPBuffer,
+        (CGLPixelFormatAttribute) 0
+    };
+    CGLPixelFormatObj pixelFormat;
+    GLint numPixelFormats;
+    if (CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats) != kCGLNoError) {
+        printf("WebGraphicsContext3DDefaultImpl: error choosing pixel format\n");
+        return false;
+    }
+    if (!pixelFormat) {
+        printf("WebGraphicsContext3DDefaultImpl: no pixel format selected\n");
+        return false;
+    }
+    CGLContextObj context;
+    CGLError res = CGLCreateContext(pixelFormat, 0, &context);
+    CGLDestroyPixelFormat(pixelFormat);
+    if (res != kCGLNoError) {
+        printf("WebGraphicsContext3DDefaultImpl: error creating context\n");
+        return false;
+    }
+    CGLPBufferObj pbuffer;
+    if (CGLCreatePBuffer(1, 1, GL_TEXTURE_2D, GL_RGBA, 0, &pbuffer) != kCGLNoError) {
+        CGLDestroyContext(context);
+        printf("WebGraphicsContext3DDefaultImpl: error creating pbuffer\n");
+        return false;
+    }
+    if (CGLSetPBuffer(context, pbuffer, 0, 0, 0) != kCGLNoError) {
+        CGLDestroyContext(context);
+        CGLDestroyPBuffer(pbuffer);
+        printf("WebGraphicsContext3DDefaultImpl: error attaching pbuffer to context\n");
+        return false;
+    }
+    if (CGLSetCurrentContext(context) != kCGLNoError) {
+        CGLDestroyContext(context);
+        CGLDestroyPBuffer(pbuffer);
+        printf("WebGraphicsContext3DDefaultImpl: error making context current\n");
+        return false;
+    }
+    m_pbuffer = pbuffer;
+    m_contextObj = context;
+#elif OS(LINUX)
+    if (!s_gl) {
+        s_gl = GLConnection::create();
+        if (!s_gl)
+            return false;
+    }
+
+    int configAttrs[] = {
+        GLX_DRAWABLE_TYPE,
+        GLX_PBUFFER_BIT,
+        GLX_RENDER_TYPE,
+        GLX_RGBA_BIT,
+        GLX_DOUBLEBUFFER,
+        0,
+        0
+    };
+    int nelements = 0;
+    GLXFBConfig* config = s_gl->chooseFBConfig(0, configAttrs, &nelements);
+    if (!config) {
+        printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig failed\n");
+        return false;
+    }
+    if (!nelements) {
+        printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig returned 0 elements\n");
+        XFree(config);
+        return false;
+    }
+    GLXContext context = s_gl->createNewContext(config[0], GLX_RGBA_TYPE, 0, True);
+    if (!context) {
+        printf("WebGraphicsContext3DDefaultImpl: glXCreateNewContext failed\n");
+        XFree(config);
+        return false;
+    }
+    int pbufferAttrs[] = {
+        GLX_PBUFFER_WIDTH,
+        1,
+        GLX_PBUFFER_HEIGHT,
+        1,
+        0
+    };
+    GLXPbuffer pbuffer = s_gl->createPbuffer(config[0], pbufferAttrs);
+    XFree(config);
+    if (!pbuffer) {
+        printf("WebGraphicsContext3DDefaultImpl: glxCreatePbuffer failed\n");
+        return false;
+    }
+    if (!s_gl->makeCurrent(pbuffer, context)) {
+        printf("WebGraphicsContext3DDefaultImpl: glXMakeCurrent failed\n");
+        return false;
+    }
+    m_contextObj = context;
+    m_pbuffer = pbuffer;
+#else
+#error Must port to your platform
+#endif
+
+    if (!s_initializedGLEW) {
+        // Initialize GLEW and check for GL 2.0 support by the drivers.
+        GLenum glewInitResult = glewInit();
+        if (glewInitResult != GLEW_OK) {
+            printf("WebGraphicsContext3DDefaultImpl: GLEW initialization failed\n");
+            return false;
+        }
+        if (!glewIsSupported("GL_VERSION_2_0")) {
+            printf("WebGraphicsContext3DDefaultImpl: OpenGL 2.0 not supported\n");
+            return false;
+        }
+        s_initializedGLEW = true;
+    }
+
+    m_attributes = attributes;
+    validateAttributes();
+
+    glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+    m_initialized = true;
+    return true;
+}
+
+void WebGraphicsContext3DDefaultImpl::validateAttributes()
+{
+    const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
+
+    if (m_attributes.stencil) {
+        if (strstr(extensions, "GL_EXT_packed_depth_stencil")) {
+            if (!m_attributes.depth)
+                m_attributes.depth = true;
+        } else
+            m_attributes.stencil = false;
+    }
+    if (m_attributes.antialias) {
+        bool isValidVendor = true;
+#if PLATFORM(CG)
+        // Currently in Mac we only turn on antialias if vendor is NVIDIA.
+        const char* vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
+        if (!strstr(vendor, "NVIDIA"))
+            isValidVendor = false;
+#endif
+        if (!isValidVendor || !strstr(extensions, "GL_EXT_framebuffer_multisample"))
+            m_attributes.antialias = false;
+    }
+    // FIXME: instead of enforcing premultipliedAlpha = true, implement the
+    // correct behavior when premultipliedAlpha = false is requested.
+    m_attributes.premultipliedAlpha = true;
+}
+
+bool WebGraphicsContext3DDefaultImpl::makeContextCurrent()
+{
+#if OS(WINDOWS)
+    if (wglGetCurrentContext() != m_contextObj)
+        if (wglMakeCurrent(m_canvasDC, m_contextObj))
+            return true;
+#elif PLATFORM(CG)
+    if (CGLGetCurrentContext() != m_contextObj)
+        if (CGLSetCurrentContext(m_contextObj) == kCGLNoError)
+            return true;
+#elif OS(LINUX)
+    if (s_gl->getCurrentContext() != m_contextObj)
+        if (s_gl->makeCurrent(m_pbuffer, m_contextObj))
+            return true;
+#else
+#error Must port to your platform
+#endif
+    return false;
+}
+
+int WebGraphicsContext3DDefaultImpl::width()
+{
+    return m_cachedWidth;
+}
+
+int WebGraphicsContext3DDefaultImpl::height()
+{
+    return m_cachedHeight;
+}
+
+int WebGraphicsContext3DDefaultImpl::sizeInBytes(int type)
+{
+    switch (type) {
+    case GL_BYTE:
+        return sizeof(GLbyte);
+    case GL_UNSIGNED_BYTE:
+        return sizeof(GLubyte);
+    case GL_SHORT:
+        return sizeof(GLshort);
+    case GL_UNSIGNED_SHORT:
+        return sizeof(GLushort);
+    case GL_INT:
+        return sizeof(GLint);
+    case GL_UNSIGNED_INT:
+        return sizeof(GLuint);
+    case GL_FLOAT:
+        return sizeof(GLfloat);
+    }
+    return 0;
+}
+
+static int createTextureObject(GLenum target)
+{
+    GLuint texture = 0;
+    glGenTextures(1, &texture);
+    glBindTexture(target, texture);
+    glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+    glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    return texture;
+}
+
+void WebGraphicsContext3DDefaultImpl::reshape(int width, int height)
+{
+#ifdef RENDER_TO_DEBUGGING_WINDOW
+    SetWindowPos(m_canvasWindow, HWND_TOP, 0, 0, width, height,
+                 SWP_NOMOVE);
+    ShowWindow(m_canvasWindow, SW_SHOW);
+#endif
+
+    m_cachedWidth = width;
+    m_cachedHeight = height;
+    makeContextCurrent();
+
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+#ifdef USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
+    // GL_TEXTURE_RECTANGLE_ARB is the best supported render target on Mac OS X
+    GLenum target = GL_TEXTURE_RECTANGLE_ARB;
+#else
+    GLenum target = GL_TEXTURE_2D;
+#endif
+    if (!m_texture) {
+        // Generate the texture object
+        m_texture = createTextureObject(target);
+        // Generate the framebuffer object
+        glGenFramebuffersEXT(1, &m_fbo);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        m_boundFBO = m_fbo;
+        if (m_attributes.depth || m_attributes.stencil)
+            glGenRenderbuffersEXT(1, &m_depthStencilBuffer);
+        // Generate the multisample framebuffer object
+        if (m_attributes.antialias) {
+            glGenFramebuffersEXT(1, &m_multisampleFBO);
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+            m_boundFBO = m_multisampleFBO;
+            glGenRenderbuffersEXT(1, &m_multisampleColorBuffer);
+            if (m_attributes.depth || m_attributes.stencil)
+                glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
+        }
+    }
+
+    GLint internalColorFormat, colorFormat, internalDepthStencilFormat = 0;
+    if (m_attributes.alpha) {
+        internalColorFormat = GL_RGBA8;
+        colorFormat = GL_RGBA;
+    } else {
+        internalColorFormat = GL_RGB8;
+        colorFormat = GL_RGB;
+    }
+    if (m_attributes.stencil || m_attributes.depth) {
+        // We don't allow the logic where stencil is required and depth is not.
+        // See GraphicsContext3DInternal constructor.
+        if (m_attributes.stencil && m_attributes.depth)
+            internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
+        else
+            internalDepthStencilFormat = GL_DEPTH_COMPONENT;
+    }
+
+    bool mustRestoreFBO = false;
+
+    // Resize multisampling FBO
+    if (m_attributes.antialias) {
+        GLint maxSampleCount;
+        glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
+        GLint sampleCount = std::min(8, maxSampleCount);
+        if (m_boundFBO != m_multisampleFBO) {
+            mustRestoreFBO = true;
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
+        }
+        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+        glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalColorFormat, width, height);
+        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer);
+        if (m_attributes.stencil || m_attributes.depth) {
+            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+            glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height);
+            if (m_attributes.stencil)
+                glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+            if (m_attributes.depth)
+                glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer);
+        }
+        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+        GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+        if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+            printf("GraphicsContext3D: multisampling framebuffer was incomplete\n");
+
+            // FIXME: cleanup.
+            notImplemented();
+        }
+    }
+
+    // Resize regular FBO
+    if (m_boundFBO != m_fbo) {
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        mustRestoreFBO = true;
+    }
+    glBindTexture(target, m_texture);
+    glTexImage2D(target, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
+    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, m_texture, 0);
+    glBindTexture(target, 0);
+    if (!m_attributes.antialias && (m_attributes.stencil || m_attributes.depth)) {
+        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalDepthStencilFormat, width, height);
+        if (m_attributes.stencil)
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        if (m_attributes.depth)
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
+        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
+    }
+    GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+    if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+        printf("WebGraphicsContext3DDefaultImpl: framebuffer was incomplete\n");
+
+        // FIXME: cleanup.
+        notImplemented();
+    }
+
+    if (mustRestoreFBO)
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+#endif // RENDER_TO_DEBUGGING_WINDOW
+
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+    if (m_scanline) {
+        delete[] m_scanline;
+        m_scanline = 0;
+    }
+    m_scanline = new unsigned char[width * 4];
+#endif // FLIP_FRAMEBUFFER_VERTICALLY
+
+    GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
+    if (m_attributes.stencil)
+        clearMask |= GL_STENCIL_BUFFER_BIT;
+    if (m_attributes.depth)
+        clearMask |= GL_DEPTH_BUFFER_BIT;
+    glClear(clearMask);
+}
+
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+void WebGraphicsContext3DDefaultImpl::flipVertically(unsigned char* framebuffer,
+                                                     unsigned int width,
+                                                     unsigned int height)
+{
+    unsigned char* scanline = m_scanline;
+    if (!scanline)
+        return;
+    unsigned int rowBytes = width * 4;
+    unsigned int count = height / 2;
+    for (unsigned int i = 0; i < count; i++) {
+        unsigned char* rowA = framebuffer + i * rowBytes;
+        unsigned char* rowB = framebuffer + (height - i - 1) * rowBytes;
+        // FIXME: this is where the multiplication of the alpha
+        // channel into the color buffer will need to occur if the
+        // user specifies the "premultiplyAlpha" flag in the context
+        // creation attributes.
+        memcpy(scanline, rowB, rowBytes);
+        memcpy(rowB, rowA, rowBytes);
+        memcpy(rowA, scanline, rowBytes);
+    }
+}
+#endif
+
+bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels, size_t bufferSize)
+{
+    if (bufferSize != static_cast<size_t>(4 * width() * height()))
+        return false;
+
+    makeContextCurrent();
+
+#ifdef RENDER_TO_DEBUGGING_WINDOW
+    SwapBuffers(m_canvasDC);
+#else
+    // Earlier versions of this code used the GPU to flip the
+    // framebuffer vertically before reading it back for compositing
+    // via software. This code was quite complicated, used a lot of
+    // GPU memory, and didn't provide an obvious speedup. Since this
+    // vertical flip is only a temporary solution anyway until Chrome
+    // is fully GPU composited, it wasn't worth the complexity.
+
+    bool mustRestoreFBO;
+    if (m_attributes.antialias) {
+        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        glBlitFramebufferEXT(0, 0, m_cachedWidth, m_cachedHeight, 0, 0, m_cachedWidth, m_cachedHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        mustRestoreFBO = true;
+    } else {
+        if (m_boundFBO != m_fbo) {
+            mustRestoreFBO = true;
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        }
+    }
+
+    GLint packAlignment = 4;
+    bool mustRestorePackAlignment = false;
+    glGetIntegerv(GL_PACK_ALIGNMENT, &packAlignment);
+    if (packAlignment > 4) {
+        glPixelStorei(GL_PACK_ALIGNMENT, 4);
+        mustRestorePackAlignment = true;
+    }
+
+#if PLATFORM(SKIA)
+    glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
+#elif PLATFORM(CG)
+    glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
+#else
+#error Must port to your platform
+#endif
+
+    if (mustRestorePackAlignment)
+        glPixelStorei(GL_PACK_ALIGNMENT, packAlignment);
+
+    if (mustRestoreFBO)
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+    if (pixels)
+        flipVertically(pixels, m_cachedWidth, m_cachedHeight);
+#endif
+
+#endif // RENDER_TO_DEBUGGING_WINDOW
+    return true;
+}
+
+void WebGraphicsContext3DDefaultImpl::synthesizeGLError(unsigned long error)
+{
+    m_syntheticErrors.add(error);
+}
+
+// Helper macros to reduce the amount of code.
+
+#define DELEGATE_TO_GL(name, glname)                                           \
+void WebGraphicsContext3DDefaultImpl::name()                                   \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname();                                                              \
+}
+
+#define DELEGATE_TO_GL_1(name, glname, t1)                                     \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1)                              \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1);                                                            \
+}
+
+#define DELEGATE_TO_GL_1R(name, glname, t1, rt)                                \
+rt WebGraphicsContext3DDefaultImpl::name(t1 a1)                                \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    return gl##glname(a1);                                                     \
+}
+
+#define DELEGATE_TO_GL_2(name, glname, t1, t2)                                 \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2)                       \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2);                                                        \
+}
+
+#define DELEGATE_TO_GL_2R(name, glname, t1, t2, rt)                            \
+rt WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2)                         \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    return gl##glname(a1, a2);                                                 \
+}
+
+#define DELEGATE_TO_GL_3(name, glname, t1, t2, t3)                             \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3)                \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3);                                                    \
+}
+
+#define DELEGATE_TO_GL_4(name, glname, t1, t2, t3, t4)                         \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4)         \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4);                                                \
+}
+
+#define DELEGATE_TO_GL_5(name, glname, t1, t2, t3, t4, t5)                     \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)  \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4, a5);                                            \
+}
+
+#define DELEGATE_TO_GL_6(name, glname, t1, t2, t3, t4, t5, t6)                 \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4, a5, a6);                                        \
+}
+
+#define DELEGATE_TO_GL_7(name, glname, t1, t2, t3, t4, t5, t6, t7)             \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4, a5, a6, a7);                                    \
+}
+
+#define DELEGATE_TO_GL_8(name, glname, t1, t2, t3, t4, t5, t6, t7, t8)         \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4, a5, a6, a7, a8);                                \
+}
+
+#define DELEGATE_TO_GL_9(name, glname, t1, t2, t3, t4, t5, t6, t7, t8, t9)     \
+void WebGraphicsContext3DDefaultImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{                                                                              \
+    makeContextCurrent();                                                      \
+    gl##glname(a1, a2, a3, a4, a5, a6, a7, a8, a9);                            \
+}
+
+void WebGraphicsContext3DDefaultImpl::activeTexture(unsigned long texture)
+{
+    // FIXME: query number of textures available.
+    if (texture < GL_TEXTURE0 || texture > GL_TEXTURE0+32)
+        // FIXME: raise exception.
+        return;
+
+    makeContextCurrent();
+    glActiveTexture(texture);
+}
+
+DELEGATE_TO_GL_2(attachShader, AttachShader, WebGLId, WebGLId)
+
+DELEGATE_TO_GL_3(bindAttribLocation, BindAttribLocation, WebGLId, unsigned long, const char*)
+
+void WebGraphicsContext3DDefaultImpl::bindBuffer(unsigned long target, WebGLId buffer)
+{
+    makeContextCurrent();
+    if (target == GL_ARRAY_BUFFER)
+        m_boundArrayBuffer = buffer;
+    glBindBuffer(target, buffer);
+}
+
+void WebGraphicsContext3DDefaultImpl::bindFramebuffer(unsigned long target, WebGLId framebuffer)
+{
+    makeContextCurrent();
+    if (!framebuffer)
+        framebuffer = (m_attributes.antialias ? m_multisampleFBO : m_fbo);
+    if (framebuffer != m_boundFBO) {
+        glBindFramebufferEXT(target, framebuffer);
+        m_boundFBO = framebuffer;
+    }
+}
+
+DELEGATE_TO_GL_2(bindRenderbuffer, BindRenderbufferEXT, unsigned long, WebGLId)
+
+DELEGATE_TO_GL_2(bindTexture, BindTexture, unsigned long, WebGLId)
+
+DELEGATE_TO_GL_4(blendColor, BlendColor, double, double, double, double)
+
+DELEGATE_TO_GL_1(blendEquation, BlendEquation, unsigned long)
+
+DELEGATE_TO_GL_2(blendEquationSeparate, BlendEquationSeparate, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_2(blendFunc, BlendFunc, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_4(blendFuncSeparate, BlendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_4(bufferData, BufferData, unsigned long, int, const void*, unsigned long)
+
+DELEGATE_TO_GL_4(bufferSubData, BufferSubData, unsigned long, long, int, const void*)
+
+DELEGATE_TO_GL_1R(checkFramebufferStatus, CheckFramebufferStatusEXT, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_1(clear, Clear, unsigned long)
+
+DELEGATE_TO_GL_4(clearColor, ClearColor, double, double, double, double)
+
+DELEGATE_TO_GL_1(clearDepth, ClearDepth, double)
+
+DELEGATE_TO_GL_1(clearStencil, ClearStencil, long)
+
+DELEGATE_TO_GL_4(colorMask, ColorMask, bool, bool, bool, bool)
+
+DELEGATE_TO_GL_1(compileShader, CompileShader, WebGLId)
+
+void WebGraphicsContext3DDefaultImpl::copyTexImage2D(unsigned long target, long level, unsigned long internalformat,
+                                                     long x, long y, unsigned long width, unsigned long height, long border)
+{
+    makeContextCurrent();
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
+        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+    }
+#endif
+    glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+#endif
+}
+
+void WebGraphicsContext3DDefaultImpl::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset,
+                                                        long x, long y, unsigned long width, unsigned long height)
+{
+    makeContextCurrent();
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
+        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+    }
+#endif
+    glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+#endif
+}
+
+DELEGATE_TO_GL_1(cullFace, CullFace, unsigned long)
+
+DELEGATE_TO_GL_1(depthFunc, DepthFunc, unsigned long)
+
+DELEGATE_TO_GL_1(depthMask, DepthMask, bool)
+
+DELEGATE_TO_GL_2(depthRange, DepthRange, double, double)
+
+DELEGATE_TO_GL_2(detachShader, DetachShader, WebGLId, WebGLId)
+
+DELEGATE_TO_GL_1(disable, Disable, unsigned long)
+
+void WebGraphicsContext3DDefaultImpl::disableVertexAttribArray(unsigned long index)
+{
+    makeContextCurrent();
+    if (index < NumTrackedPointerStates)
+        m_vertexAttribPointerState[index].enabled = false;
+    glDisableVertexAttribArray(index);
+}
+
+DELEGATE_TO_GL_3(drawArrays, DrawArrays, unsigned long, long, long)
+
+void WebGraphicsContext3DDefaultImpl::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
+{
+    makeContextCurrent();
+    glDrawElements(mode, count, type,
+                   reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+DELEGATE_TO_GL_1(enable, Enable, unsigned long)
+
+void WebGraphicsContext3DDefaultImpl::enableVertexAttribArray(unsigned long index)
+{
+    makeContextCurrent();
+    if (index < NumTrackedPointerStates)
+        m_vertexAttribPointerState[index].enabled = true;
+    glEnableVertexAttribArray(index);
+}
+
+DELEGATE_TO_GL(finish, Finish)
+
+DELEGATE_TO_GL(flush, Flush)
+
+void WebGraphicsContext3DDefaultImpl::framebufferRenderbuffer(unsigned long target, unsigned long attachment,
+                                                              unsigned long renderbuffertarget, WebGLId buffer)
+{
+    makeContextCurrent();
+    if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+        glFramebufferRenderbufferEXT(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, buffer);
+        glFramebufferRenderbufferEXT(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, buffer);
+    } else
+        glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer);
+}
+
+DELEGATE_TO_GL_5(framebufferTexture2D, FramebufferTexture2DEXT, unsigned long, unsigned long, unsigned long, WebGLId, long)
+
+DELEGATE_TO_GL_1(frontFace, FrontFace, unsigned long)
+
+void WebGraphicsContext3DDefaultImpl::generateMipmap(unsigned long target)
+{
+    makeContextCurrent();
+    if (glGenerateMipmapEXT)
+        glGenerateMipmapEXT(target);
+    // FIXME: provide alternative code path? This will be unpleasant
+    // to implement if glGenerateMipmapEXT is not available -- it will
+    // require a texture readback and re-upload.
+}
+
+bool WebGraphicsContext3DDefaultImpl::getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo& info)
+{
+    if (!program) {
+        synthesizeGLError(GL_INVALID_VALUE);
+        return false;
+    }
+    GLint maxNameLength = -1;
+    glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLength);
+    if (maxNameLength < 0)
+        return false;
+    GLchar* name = 0;
+    if (!tryFastMalloc(maxNameLength * sizeof(GLchar)).getValue(name)) {
+        synthesizeGLError(GL_OUT_OF_MEMORY);
+        return false;
+    }
+    GLsizei length = 0;
+    GLint size = -1;
+    GLenum type = 0;
+    glGetActiveAttrib(program, index, maxNameLength,
+                      &length, &size, &type, name);
+    if (size < 0) {
+        fastFree(name);
+        return false;
+    }
+    info.name = WebString::fromUTF8(name, length);
+    info.type = type;
+    info.size = size;
+    fastFree(name);
+    return true;
+}
+
+bool WebGraphicsContext3DDefaultImpl::getActiveUniform(WebGLId program, unsigned long index, ActiveInfo& info)
+{
+    GLint maxNameLength = -1;
+    glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength);
+    if (maxNameLength < 0)
+        return false;
+    GLchar* name = 0;
+    if (!tryFastMalloc(maxNameLength * sizeof(GLchar)).getValue(name)) {
+        synthesizeGLError(GL_OUT_OF_MEMORY);
+        return false;
+    }
+    GLsizei length = 0;
+    GLint size = -1;
+    GLenum type = 0;
+    glGetActiveUniform(program, index, maxNameLength,
+                       &length, &size, &type, name);
+    if (size < 0) {
+        fastFree(name);
+        return false;
+    }
+    info.name = WebString::fromUTF8(name, length);
+    info.type = type;
+    info.size = size;
+    fastFree(name);
+    return true;
+}
+
+DELEGATE_TO_GL_2R(getAttribLocation, GetAttribLocation, WebGLId, const char*, int)
+
+DELEGATE_TO_GL_2(getBooleanv, GetBooleanv, unsigned long, unsigned char*)
+
+DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv, unsigned long, unsigned long, int*)
+
+WebGraphicsContext3D::Attributes WebGraphicsContext3DDefaultImpl::getContextAttributes()
+{
+    return m_attributes;
+}
+
+unsigned long WebGraphicsContext3DDefaultImpl::getError()
+{
+    if (m_syntheticErrors.size() > 0) {
+        ListHashSet<unsigned long>::iterator iter = m_syntheticErrors.begin();
+        unsigned long err = *iter;
+        m_syntheticErrors.remove(iter);
+        return err;
+    }
+
+    makeContextCurrent();
+    return glGetError();
+}
+
+DELEGATE_TO_GL_2(getFloatv, GetFloatv, unsigned long, float*)
+
+void WebGraphicsContext3DDefaultImpl::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment,
+                                                                          unsigned long pname, int* value)
+{
+    makeContextCurrent();
+    if (attachment == GL_DEPTH_STENCIL_ATTACHMENT)
+        attachment = GL_DEPTH_ATTACHMENT; // Or GL_STENCIL_ATTACHMENT, either works.
+    glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
+}
+
+DELEGATE_TO_GL_2(getIntegerv, GetIntegerv, unsigned long, int*)
+
+DELEGATE_TO_GL_3(getProgramiv, GetProgramiv, WebGLId, unsigned long, int*)
+
+WebString WebGraphicsContext3DDefaultImpl::getProgramInfoLog(WebGLId program)
+{
+    makeContextCurrent();
+    GLint logLength;
+    glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
+    if (!logLength)
+        return WebString();
+    GLchar* log = 0;
+    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
+        return WebString();
+    GLsizei returnedLogLength;
+    glGetProgramInfoLog(program, logLength, &returnedLogLength, log);
+    ASSERT(logLength == returnedLogLength + 1);
+    WebString res = WebString::fromUTF8(log, returnedLogLength);
+    fastFree(log);
+    return res;
+}
+
+DELEGATE_TO_GL_3(getRenderbufferParameteriv, GetRenderbufferParameterivEXT, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_GL_3(getShaderiv, GetShaderiv, WebGLId, unsigned long, int*)
+
+WebString WebGraphicsContext3DDefaultImpl::getShaderInfoLog(WebGLId shader)
+{
+    makeContextCurrent();
+    GLint logLength;
+    glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
+    if (!logLength)
+        return WebString();
+    GLchar* log = 0;
+    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
+        return WebString();
+    GLsizei returnedLogLength;
+    glGetShaderInfoLog(shader, logLength, &returnedLogLength, log);
+    ASSERT(logLength == returnedLogLength + 1);
+    WebString res = WebString::fromUTF8(log, returnedLogLength);
+    fastFree(log);
+    return res;
+}
+
+WebString WebGraphicsContext3DDefaultImpl::getShaderSource(WebGLId shader)
+{
+    makeContextCurrent();
+    GLint logLength;
+    glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &logLength);
+    if (!logLength)
+        return WebString();
+    GLchar* log = 0;
+    if (!tryFastMalloc(logLength * sizeof(GLchar)).getValue(log))
+        return WebString();
+    GLsizei returnedLogLength;
+    glGetShaderSource(shader, logLength, &returnedLogLength, log);
+    ASSERT(logLength == returnedLogLength + 1);
+    WebString res = WebString::fromUTF8(log, returnedLogLength);
+    fastFree(log);
+    return res;
+}
+
+WebString WebGraphicsContext3DDefaultImpl::getString(unsigned long name)
+{
+    makeContextCurrent();
+    return WebString::fromUTF8(reinterpret_cast<const char*>(glGetString(name)));
+}
+
+DELEGATE_TO_GL_3(getTexParameterfv, GetTexParameterfv, unsigned long, unsigned long, float*)
+
+DELEGATE_TO_GL_3(getTexParameteriv, GetTexParameteriv, unsigned long, unsigned long, int*)
+
+DELEGATE_TO_GL_3(getUniformfv, GetUniformfv, WebGLId, long, float*)
+
+DELEGATE_TO_GL_3(getUniformiv, GetUniformiv, WebGLId, long, int*)
+
+DELEGATE_TO_GL_2R(getUniformLocation, GetUniformLocation, WebGLId, const char*, long)
+
+DELEGATE_TO_GL_3(getVertexAttribfv, GetVertexAttribfv, unsigned long, unsigned long, float*)
+
+DELEGATE_TO_GL_3(getVertexAttribiv, GetVertexAttribiv, unsigned long, unsigned long, int*)
+
+long WebGraphicsContext3DDefaultImpl::getVertexAttribOffset(unsigned long index, unsigned long pname)
+{
+    // FIXME: implement.
+    notImplemented();
+    return 0;
+}
+
+DELEGATE_TO_GL_2(hint, Hint, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_1R(isBuffer, IsBuffer, WebGLId, bool)
+
+DELEGATE_TO_GL_1R(isEnabled, IsEnabled, unsigned long, bool)
+
+DELEGATE_TO_GL_1R(isFramebuffer, IsFramebuffer, WebGLId, bool)
+
+DELEGATE_TO_GL_1R(isProgram, IsProgram, WebGLId, bool)
+
+DELEGATE_TO_GL_1R(isRenderbuffer, IsRenderbuffer, WebGLId, bool)
+
+DELEGATE_TO_GL_1R(isShader, IsShader, WebGLId, bool)
+
+DELEGATE_TO_GL_1R(isTexture, IsTexture, WebGLId, bool)
+
+DELEGATE_TO_GL_1(lineWidth, LineWidth, double)
+
+DELEGATE_TO_GL_1(linkProgram, LinkProgram, WebGLId)
+
+DELEGATE_TO_GL_2(pixelStorei, PixelStorei, unsigned long, long)
+
+DELEGATE_TO_GL_2(polygonOffset, PolygonOffset, double, double)
+
+void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels)
+{
+    // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
+    // all previous rendering calls should be done before reading pixels.
+    glFlush();
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
+        glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
+        glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
+        glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+        glFlush();
+    }
+#endif
+    glReadPixels(x, y, width, height, format, type, pixels);
+#ifndef RENDER_TO_DEBUGGING_WINDOW
+    if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+#endif
+}
+
+void WebGraphicsContext3DDefaultImpl::releaseShaderCompiler()
+{
+}
+
+void WebGraphicsContext3DDefaultImpl::renderbufferStorage(unsigned long target,
+                                                          unsigned long internalformat,
+                                                          unsigned long width,
+                                                          unsigned long height)
+{
+    makeContextCurrent();
+    if (internalformat == GL_DEPTH_STENCIL)
+        internalformat = GL_DEPTH24_STENCIL8_EXT;
+    else if (internalformat == GL_DEPTH_COMPONENT16)
+        internalformat = GL_DEPTH_COMPONENT;
+    glRenderbufferStorageEXT(target, internalformat, width, height);
+}
+
+DELEGATE_TO_GL_2(sampleCoverage, SampleCoverage, double, bool)
+
+DELEGATE_TO_GL_4(scissor, Scissor, long, long, unsigned long, unsigned long)
+
+void WebGraphicsContext3DDefaultImpl::shaderSource(WebGLId shader, const char* string)
+{
+    makeContextCurrent();
+    GLint length = strlen(string);
+    glShaderSource(shader, 1, &string, &length);
+}
+
+DELEGATE_TO_GL_3(stencilFunc, StencilFunc, unsigned long, long, unsigned long)
+
+DELEGATE_TO_GL_4(stencilFuncSeparate, StencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
+
+DELEGATE_TO_GL_1(stencilMask, StencilMask, unsigned long)
+
+DELEGATE_TO_GL_2(stencilMaskSeparate, StencilMaskSeparate, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_3(stencilOp, StencilOp, unsigned long, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_4(stencilOpSeparate, StencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+
+DELEGATE_TO_GL_9(texImage2D, TexImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, const void*)
+
+DELEGATE_TO_GL_3(texParameterf, TexParameterf, unsigned, unsigned, float);
+
+DELEGATE_TO_GL_3(texParameteri, TexParameteri, unsigned, unsigned, int);
+
+DELEGATE_TO_GL_9(texSubImage2D, TexSubImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, const void*)
+
+DELEGATE_TO_GL_2(uniform1f, Uniform1f, long, float)
+
+DELEGATE_TO_GL_3(uniform1fv, Uniform1fv, long, int, float*)
+
+DELEGATE_TO_GL_2(uniform1i, Uniform1i, long, int)
+
+DELEGATE_TO_GL_3(uniform1iv, Uniform1iv, long, int, int*)
+
+DELEGATE_TO_GL_3(uniform2f, Uniform2f, long, float, float)
+
+DELEGATE_TO_GL_3(uniform2fv, Uniform2fv, long, int, float*)
+
+DELEGATE_TO_GL_3(uniform2i, Uniform2i, long, int, int)
+
+DELEGATE_TO_GL_3(uniform2iv, Uniform2iv, long, int, int*)
+
+DELEGATE_TO_GL_4(uniform3f, Uniform3f, long, float, float, float)
+
+DELEGATE_TO_GL_3(uniform3fv, Uniform3fv, long, int, float*)
+
+DELEGATE_TO_GL_4(uniform3i, Uniform3i, long, int, int, int)
+
+DELEGATE_TO_GL_3(uniform3iv, Uniform3iv, long, int, int*)
+
+DELEGATE_TO_GL_5(uniform4f, Uniform4f, long, float, float, float, float)
+
+DELEGATE_TO_GL_3(uniform4fv, Uniform4fv, long, int, float*)
+
+DELEGATE_TO_GL_5(uniform4i, Uniform4i, long, int, int, int, int)
+
+DELEGATE_TO_GL_3(uniform4iv, Uniform4iv, long, int, int*)
+
+DELEGATE_TO_GL_4(uniformMatrix2fv, UniformMatrix2fv, long, int, bool, const float*)
+
+DELEGATE_TO_GL_4(uniformMatrix3fv, UniformMatrix3fv, long, int, bool, const float*)
+
+DELEGATE_TO_GL_4(uniformMatrix4fv, UniformMatrix4fv, long, int, bool, const float*)
+
+DELEGATE_TO_GL_1(useProgram, UseProgram, WebGLId)
+
+DELEGATE_TO_GL_1(validateProgram, ValidateProgram, WebGLId)
+
+DELEGATE_TO_GL_2(vertexAttrib1f, VertexAttrib1f, unsigned long, float)
+
+DELEGATE_TO_GL_2(vertexAttrib1fv, VertexAttrib1fv, unsigned long, const float*)
+
+DELEGATE_TO_GL_3(vertexAttrib2f, VertexAttrib2f, unsigned long, float, float)
+
+DELEGATE_TO_GL_2(vertexAttrib2fv, VertexAttrib2fv, unsigned long, const float*)
+
+DELEGATE_TO_GL_4(vertexAttrib3f, VertexAttrib3f, unsigned long, float, float, float)
+
+DELEGATE_TO_GL_2(vertexAttrib3fv, VertexAttrib3fv, unsigned long, const float*)
+
+DELEGATE_TO_GL_5(vertexAttrib4f, VertexAttrib4f, unsigned long, float, float, float, float)
+
+DELEGATE_TO_GL_2(vertexAttrib4fv, VertexAttrib4fv, unsigned long, const float*)
+
+void WebGraphicsContext3DDefaultImpl::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
+                                                          unsigned long stride, unsigned long offset)
+{
+    makeContextCurrent();
+
+    if (m_boundArrayBuffer <= 0) {
+        // FIXME: raise exception.
+        // LogMessagef(("bufferData: no buffer bound"));
+        return;
+    }
+
+    if (indx < NumTrackedPointerStates) {
+        VertexAttribPointerState& state = m_vertexAttribPointerState[indx];
+        state.buffer = m_boundArrayBuffer;
+        state.indx = indx;
+        state.size = size;
+        state.type = type;
+        state.normalized = normalized;
+        state.stride = stride;
+        state.offset = offset;
+    }
+
+    glVertexAttribPointer(indx, size, type, normalized, stride,
+                          reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+}
+
+DELEGATE_TO_GL_4(viewport, Viewport, long, long, unsigned long, unsigned long)
+
+unsigned WebGraphicsContext3DDefaultImpl::createBuffer()
+{
+    makeContextCurrent();
+    GLuint o;
+    glGenBuffers(1, &o);
+    return o;
+}
+
+unsigned WebGraphicsContext3DDefaultImpl::createFramebuffer()
+{
+    makeContextCurrent();
+    GLuint o = 0;
+    glGenFramebuffersEXT(1, &o);
+    return o;
+}
+
+unsigned WebGraphicsContext3DDefaultImpl::createProgram()
+{
+    makeContextCurrent();
+    return glCreateProgram();
+}
+
+unsigned WebGraphicsContext3DDefaultImpl::createRenderbuffer()
+{
+    makeContextCurrent();
+    GLuint o;
+    glGenRenderbuffersEXT(1, &o);
+    return o;
+}
+
+DELEGATE_TO_GL_1R(createShader, CreateShader, unsigned long, unsigned);
+
+unsigned WebGraphicsContext3DDefaultImpl::createTexture()
+{
+    makeContextCurrent();
+    GLuint o;
+    glGenTextures(1, &o);
+    return o;
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteBuffer(unsigned buffer)
+{
+    makeContextCurrent();
+    glDeleteBuffers(1, &buffer);
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteFramebuffer(unsigned framebuffer)
+{
+    makeContextCurrent();
+    glDeleteFramebuffersEXT(1, &framebuffer);
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteProgram(unsigned program)
+{
+    makeContextCurrent();
+    glDeleteProgram(program);
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteRenderbuffer(unsigned renderbuffer)
+{
+    makeContextCurrent();
+    glDeleteRenderbuffersEXT(1, &renderbuffer);
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteShader(unsigned shader)
+{
+    makeContextCurrent();
+    glDeleteShader(shader);
+}
+
+void WebGraphicsContext3DDefaultImpl::deleteTexture(unsigned texture)
+{
+    makeContextCurrent();
+    glDeleteTextures(1, &texture);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
new file mode 100644
index 0000000..cc283e3
--- /dev/null
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -0,0 +1,419 @@
+/*
+ * 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 WebGraphicsContext3DDefaultImpl_h
+#define WebGraphicsContext3DDefaultImpl_h
+
+#if ENABLE(3D_CANVAS)
+
+#include "WebGraphicsContext3D.h"
+
+#include <wtf/ListHashSet.h>
+
+#if OS(WINDOWS)
+#include <windows.h>
+#endif
+
+#include "GL/glew.h"
+
+#if PLATFORM(CG)
+#include <OpenGL/OpenGL.h>
+#else
+#define FLIP_FRAMEBUFFER_VERTICALLY
+#endif
+
+#if OS(LINUX)
+#include "GL/glxew.h"
+#endif
+
+namespace WebKit {
+
+// The default implementation of WebGL. In Chromium, using this class
+// requires the sandbox to be disabled, which is strongly discouraged.
+// It is provided for support of test_shell and any Chromium ports
+// where an in-renderer WebGL implementation would be helpful.
+
+class WebGraphicsContext3DDefaultImpl : public WebGraphicsContext3D {
+public:
+    WebGraphicsContext3DDefaultImpl();
+    virtual ~WebGraphicsContext3DDefaultImpl();
+
+    //----------------------------------------------------------------------
+    // WebGraphicsContext3D methods
+    virtual bool initialize(WebGraphicsContext3D::Attributes attributes);
+    virtual bool makeContextCurrent();
+
+    virtual int width();
+    virtual int height();
+
+    virtual int sizeInBytes(int type);
+
+    virtual void reshape(int width, int height);
+
+    virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize);
+
+    virtual void synthesizeGLError(unsigned long error);
+
+    virtual void activeTexture(unsigned long texture);
+    virtual void attachShader(WebGLId program, WebGLId shader);
+    virtual void bindAttribLocation(WebGLId program, unsigned long index, const char* name);
+    virtual void bindBuffer(unsigned long target, WebGLId buffer);
+    virtual void bindFramebuffer(unsigned long target, WebGLId framebuffer);
+    virtual void bindRenderbuffer(unsigned long target, WebGLId renderbuffer);
+    virtual void bindTexture(unsigned long target, WebGLId texture);
+    virtual void blendColor(double red, double green, double blue, double alpha);
+    virtual void blendEquation(unsigned long mode);
+    virtual void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
+    virtual void blendFunc(unsigned long sfactor, unsigned long dfactor);
+    virtual void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
+
+    virtual void bufferData(unsigned long target, int size, const void* data, unsigned long usage);
+    virtual void bufferSubData(unsigned long target, long offset, int size, const void* data);
+
+    virtual unsigned long checkFramebufferStatus(unsigned long target);
+    virtual void clear(unsigned long mask);
+    virtual void clearColor(double red, double green, double blue, double alpha);
+    virtual void clearDepth(double depth);
+    virtual void clearStencil(long s);
+    virtual void colorMask(bool red, bool green, bool blue, bool alpha);
+    virtual void compileShader(WebGLId shader);
+
+    virtual void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
+    virtual void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
+    virtual void cullFace(unsigned long mode);
+    virtual void depthFunc(unsigned long func);
+    virtual void depthMask(bool flag);
+    virtual void depthRange(double zNear, double zFar);
+    virtual void detachShader(WebGLId program, WebGLId shader);
+    virtual void disable(unsigned long cap);
+    virtual void disableVertexAttribArray(unsigned long index);
+    virtual void drawArrays(unsigned long mode, long first, long count);
+    virtual void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
+
+    virtual void enable(unsigned long cap);
+    virtual void enableVertexAttribArray(unsigned long index);
+    virtual void finish();
+    virtual void flush();
+    virtual void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLId renderbuffer);
+    virtual void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLId texture, long level);
+    virtual void frontFace(unsigned long mode);
+    virtual void generateMipmap(unsigned long target);
+
+    virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&);
+    virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&);
+
+    virtual int  getAttribLocation(WebGLId program, const char* name);
+
+    virtual void getBooleanv(unsigned long pname, unsigned char* value);
+
+    virtual void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
+    virtual Attributes getContextAttributes();
+
+    virtual unsigned long getError();
+
+    virtual void getFloatv(unsigned long pname, float* value);
+
+    virtual void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
+
+    virtual void getIntegerv(unsigned long pname, int* value);
+
+    virtual void getProgramiv(WebGLId program, unsigned long pname, int* value);
+
+    virtual WebString getProgramInfoLog(WebGLId program);
+
+    virtual void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
+
+    virtual void getShaderiv(WebGLId shader, unsigned long pname, int* value);
+
+    virtual WebString getShaderInfoLog(WebGLId shader);
+
+    // TBD
+    // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+
+    virtual WebString getShaderSource(WebGLId shader);
+    virtual WebString getString(unsigned long name);
+
+    virtual void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
+    virtual void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
+
+    virtual void getUniformfv(WebGLId program, long location, float* value);
+    virtual void getUniformiv(WebGLId program, long location, int* value);
+
+    virtual long getUniformLocation(WebGLId program, const char* name);
+
+    virtual void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
+    virtual void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
+
+    virtual long getVertexAttribOffset(unsigned long index, unsigned long pname);
+
+    virtual void hint(unsigned long target, unsigned long mode);
+    virtual bool isBuffer(WebGLId buffer);
+    virtual bool isEnabled(unsigned long cap);
+    virtual bool isFramebuffer(WebGLId framebuffer);
+    virtual bool isProgram(WebGLId program);
+    virtual bool isRenderbuffer(WebGLId renderbuffer);
+    virtual bool isShader(WebGLId shader);
+    virtual bool isTexture(WebGLId texture);
+    virtual void lineWidth(double);
+    virtual void linkProgram(WebGLId program);
+    virtual void pixelStorei(unsigned long pname, long param);
+    virtual void polygonOffset(double factor, double units);
+
+    virtual void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels);
+
+    virtual void releaseShaderCompiler();
+    virtual void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
+    virtual void sampleCoverage(double value, bool invert);
+    virtual void scissor(long x, long y, unsigned long width, unsigned long height);
+    virtual void shaderSource(WebGLId shader, const char* string);
+    virtual void stencilFunc(unsigned long func, long ref, unsigned long mask);
+    virtual void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
+    virtual void stencilMask(unsigned long mask);
+    virtual void stencilMaskSeparate(unsigned long face, unsigned long mask);
+    virtual void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
+    virtual void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
+
+    virtual void texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, const void* pixels);
+
+    virtual void texParameterf(unsigned target, unsigned pname, float param);
+    virtual void texParameteri(unsigned target, unsigned pname, int param);
+
+    virtual void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, const void* pixels);
+
+    virtual void uniform1f(long location, float x);
+    virtual void uniform1fv(long location, int count, float* v);
+    virtual void uniform1i(long location, int x);
+    virtual void uniform1iv(long location, int count, int* v);
+    virtual void uniform2f(long location, float x, float y);
+    virtual void uniform2fv(long location, int count, float* v);
+    virtual void uniform2i(long location, int x, int y);
+    virtual void uniform2iv(long location, int count, int* v);
+    virtual void uniform3f(long location, float x, float y, float z);
+    virtual void uniform3fv(long location, int count, float* v);
+    virtual void uniform3i(long location, int x, int y, int z);
+    virtual void uniform3iv(long location, int count, int* v);
+    virtual void uniform4f(long location, float x, float y, float z, float w);
+    virtual void uniform4fv(long location, int count, float* v);
+    virtual void uniform4i(long location, int x, int y, int z, int w);
+    virtual void uniform4iv(long location, int count, int* v);
+    virtual void uniformMatrix2fv(long location, int count, bool transpose, const float* value);
+    virtual void uniformMatrix3fv(long location, int count, bool transpose, const float* value);
+    virtual void uniformMatrix4fv(long location, int count, bool transpose, const float* value);
+
+    virtual void useProgram(WebGLId program);
+    virtual void validateProgram(WebGLId program);
+
+    virtual void vertexAttrib1f(unsigned long indx, float x);
+    virtual void vertexAttrib1fv(unsigned long indx, const float* values);
+    virtual void vertexAttrib2f(unsigned long indx, float x, float y);
+    virtual void vertexAttrib2fv(unsigned long indx, const float* values);
+    virtual void vertexAttrib3f(unsigned long indx, float x, float y, float z);
+    virtual void vertexAttrib3fv(unsigned long indx, const float* values);
+    virtual void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
+    virtual void vertexAttrib4fv(unsigned long indx, const float* values);
+    virtual void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
+                                     unsigned long stride, unsigned long offset);
+
+    virtual void viewport(long x, long y, unsigned long width, unsigned long height);
+
+    // Support for buffer creation and deletion
+    virtual unsigned createBuffer();
+    virtual unsigned createFramebuffer();
+    virtual unsigned createProgram();
+    virtual unsigned createRenderbuffer();
+    virtual unsigned createShader(unsigned long);
+    virtual unsigned createTexture();
+
+    virtual void deleteBuffer(unsigned);
+    virtual void deleteFramebuffer(unsigned);
+    virtual void deleteProgram(unsigned);
+    virtual void deleteRenderbuffer(unsigned);
+    virtual void deleteShader(unsigned);
+    virtual void deleteTexture(unsigned);
+
+private:
+    WebGraphicsContext3D::Attributes m_attributes;
+    bool m_initialized;
+    unsigned int m_texture;
+    unsigned int m_fbo;
+    unsigned int m_depthStencilBuffer;
+    unsigned int m_cachedWidth, m_cachedHeight;
+
+    // For multisampling
+    unsigned int m_multisampleFBO;
+    unsigned int m_multisampleDepthStencilBuffer;
+    unsigned int m_multisampleColorBuffer;
+
+    // For tracking which FBO is bound
+    unsigned int m_boundFBO;
+
+#ifdef FLIP_FRAMEBUFFER_VERTICALLY
+    unsigned char* m_scanline;
+    void flipVertically(unsigned char* framebuffer,
+                        unsigned int width,
+                        unsigned int height);
+#endif
+
+    // Take into account the user's requested context creation attributes, in
+    // particular stencil and antialias, and determine which could or could
+    // not be honored based on the capabilities of the OpenGL implementation.
+    void validateAttributes();
+
+    // Note: we aren't currently using this information, but we will
+    // need to in order to verify that all enabled vertex arrays have
+    // a valid buffer bound -- to avoid crashes on certain cards.
+    unsigned int m_boundArrayBuffer;
+    class VertexAttribPointerState {
+    public:
+        VertexAttribPointerState();
+
+        bool enabled;
+        unsigned long buffer;
+        unsigned long indx;
+        int size;
+        int type;
+        bool normalized;
+        unsigned long stride;
+        unsigned long offset;
+    };
+
+    enum {
+        NumTrackedPointerStates = 2
+    };
+    VertexAttribPointerState m_vertexAttribPointerState[NumTrackedPointerStates];
+
+    // Errors raised by synthesizeGLError().
+    ListHashSet<unsigned long> m_syntheticErrors;
+
+    static bool s_initializedGLEW;
+#if OS(WINDOWS)
+    HWND  m_canvasWindow;
+    HDC   m_canvasDC;
+    HGLRC m_contextObj;
+#elif PLATFORM(CG)
+    CGLPBufferObj m_pbuffer;
+    CGLContextObj m_contextObj;
+    unsigned char* m_renderOutput;
+#elif OS(LINUX)
+    GLXContext m_contextObj;
+    GLXPbuffer m_pbuffer;
+
+    // In order to avoid problems caused by linking against libGL, we
+    // dynamically look up all the symbols we need.
+    // http://code.google.com/p/chromium/issues/detail?id=16800
+    class GLConnection {
+      public:
+        ~GLConnection();
+
+        static GLConnection* create();
+
+        GLXFBConfig* chooseFBConfig(int screen, const int *attrib_list, int *nelements)
+        {
+            return m_glXChooseFBConfig(m_display, screen, attrib_list, nelements);
+        }
+
+        GLXContext createNewContext(GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
+        {
+            return m_glXCreateNewContext(m_display, config, renderType, shareList, direct);
+        }
+
+        GLXPbuffer createPbuffer(GLXFBConfig config, const int *attribList)
+        {
+            return m_glXCreatePbuffer(m_display, config, attribList);
+        }
+
+        void destroyPbuffer(GLXPbuffer pbuf)
+        {
+            m_glXDestroyPbuffer(m_display, pbuf);
+        }
+
+        Bool makeCurrent(GLXDrawable drawable, GLXContext ctx)
+        {
+            return m_glXMakeCurrent(m_display, drawable, ctx);
+        }
+
+        void destroyContext(GLXContext ctx)
+        {
+            m_glXDestroyContext(m_display, ctx);
+        }
+
+        GLXContext getCurrentContext()
+        {
+            return m_glXGetCurrentContext();
+        }
+
+      private:
+        Display* m_display;
+        void* m_libGL;
+        PFNGLXCHOOSEFBCONFIGPROC m_glXChooseFBConfig;
+        PFNGLXCREATENEWCONTEXTPROC m_glXCreateNewContext;
+        PFNGLXCREATEPBUFFERPROC m_glXCreatePbuffer;
+        PFNGLXDESTROYPBUFFERPROC m_glXDestroyPbuffer;
+        typedef Bool (* PFNGLXMAKECURRENTPROC)(Display* dpy, GLXDrawable drawable, GLXContext ctx);
+        PFNGLXMAKECURRENTPROC m_glXMakeCurrent;
+        typedef void (* PFNGLXDESTROYCONTEXTPROC)(Display* dpy, GLXContext ctx);
+        PFNGLXDESTROYCONTEXTPROC m_glXDestroyContext;
+        typedef GLXContext (* PFNGLXGETCURRENTCONTEXTPROC)(void);
+        PFNGLXGETCURRENTCONTEXTPROC m_glXGetCurrentContext;
+
+        GLConnection(Display* display,
+                     void* libGL,
+                     PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig,
+                     PFNGLXCREATENEWCONTEXTPROC createNewContext,
+                     PFNGLXCREATEPBUFFERPROC createPbuffer,
+                     PFNGLXDESTROYPBUFFERPROC destroyPbuffer,
+                     PFNGLXMAKECURRENTPROC makeCurrent,
+                     PFNGLXDESTROYCONTEXTPROC destroyContext,
+                     PFNGLXGETCURRENTCONTEXTPROC getCurrentContext)
+            : m_libGL(libGL)
+            , m_display(display)
+            , m_glXChooseFBConfig(chooseFBConfig)
+            , m_glXCreateNewContext(createNewContext)
+            , m_glXCreatePbuffer(createPbuffer)
+            , m_glXDestroyPbuffer(destroyPbuffer)
+            , m_glXMakeCurrent(makeCurrent)
+            , m_glXDestroyContext(destroyContext)
+            , m_glXGetCurrentContext(getCurrentContext)
+        {
+        }
+    };
+
+    static GLConnection* s_gl;
+#else
+    #error Must port WebGraphicsContext3DDefaultImpl to your platform
+#endif
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(3D_CANVAS)
+
+#endif
diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp
index 3d40869..d062576 100644
--- a/WebKit/chromium/src/WebHTTPBody.cpp
+++ b/WebKit/chromium/src/WebHTTPBody.cpp
@@ -79,17 +79,25 @@
         result.type = Element::TypeData;
         result.data.assign(element.m_data.data(), element.m_data.size());
         result.filePath.reset();
+#if ENABLE(BLOB_SLICE)
         result.fileStart = 0;
         result.fileLength = 0;
         result.fileInfo.modificationTime = 0.0;
+#endif
         break;
     case FormDataElement::encodedFile:
         result.type = Element::TypeFile;
         result.data.reset();
         result.filePath = element.m_filename;
-        result.fileStart = 0; // FIXME: to be set from FormData.
-        result.fileLength = -1; // FIXME: to be set from FormData.
-        result.fileInfo.modificationTime = 0.0; // FIXME: to be set from FormData.
+#if ENABLE(BLOB_SLICE)
+        result.fileStart = element.m_fileStart;
+        result.fileLength = element.m_fileLength;
+        result.fileInfo.modificationTime = element.m_expectedFileModificationTime;
+#else
+        result.fileStart = 0;
+        result.fileLength = -1;
+        result.fileInfo.modificationTime = 0.0;
+#endif
         break;
     default:
         ASSERT_NOT_REACHED();
@@ -113,9 +121,12 @@
     m_private->appendFile(filePath);
 }
 
-void WebHTTPBody::appendFile(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
+void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
 {
-    // FIXME: to be implemented.
+#if ENABLE(BLOB_SLICE)
+    ensureMutable();
+    m_private->appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime);
+#endif
 }
 
 long long WebHTTPBody::identifier() const
diff --git a/WebKit/chromium/src/WebHistoryItem.cpp b/WebKit/chromium/src/WebHistoryItem.cpp
index 4ca8cc7..45e4472 100644
--- a/WebKit/chromium/src/WebHistoryItem.cpp
+++ b/WebKit/chromium/src/WebHistoryItem.cpp
@@ -37,6 +37,7 @@
 
 #include "WebHTTPBody.h"
 #include "WebPoint.h"
+#include "WebSerializedScriptValue.h"
 #include "WebString.h"
 #include "WebVector.h"
 
@@ -44,30 +45,23 @@
 
 namespace WebKit {
 
-class WebHistoryItemPrivate : public HistoryItem {
-};
-
 void WebHistoryItem::initialize()
 {
-    assign(static_cast<WebHistoryItemPrivate*>(HistoryItem::create().releaseRef()));
+    m_private = HistoryItem::create();
 }
 
 void WebHistoryItem::reset()
 {
-    assign(0);
+    m_private.reset();
 }
 
 void WebHistoryItem::assign(const WebHistoryItem& other)
 {
-    WebHistoryItemPrivate* p = const_cast<WebHistoryItemPrivate*>(other.m_private);
-    if (p)
-        p->ref();
-    assign(p);
+    m_private = other.m_private;
 }
 
 WebString WebHistoryItem::urlString() const
 {
-    ASSERT(!isNull());
     return m_private->urlString();
 }
 
@@ -79,7 +73,6 @@
 
 WebString WebHistoryItem::originalURLString() const
 {
-    ASSERT(!isNull());
     return m_private->originalURLString();
 }
 
@@ -91,7 +84,6 @@
 
 WebString WebHistoryItem::referrer() const
 {
-    ASSERT(!isNull());
     return m_private->referrer();
 }
 
@@ -103,7 +95,6 @@
 
 WebString WebHistoryItem::target() const
 {
-    ASSERT(!isNull());
     return m_private->target();
 }
 
@@ -115,7 +106,6 @@
 
 WebString WebHistoryItem::parent() const
 {
-    ASSERT(!isNull());
     return m_private->parent();
 }
 
@@ -127,7 +117,6 @@
 
 WebString WebHistoryItem::title() const
 {
-    ASSERT(!isNull());
     return m_private->title();
 }
 
@@ -139,7 +128,6 @@
 
 WebString WebHistoryItem::alternateTitle() const
 {
-    ASSERT(!isNull());
     return m_private->alternateTitle();
 }
 
@@ -151,7 +139,6 @@
 
 double WebHistoryItem::lastVisitedTime() const
 {
-    ASSERT(!isNull());
     return m_private->lastVisitedTime();
 }
 
@@ -168,7 +155,6 @@
 
 WebPoint WebHistoryItem::scrollOffset() const
 {
-    ASSERT(!isNull());
     return m_private->scrollPoint();
 }
 
@@ -180,7 +166,6 @@
 
 bool WebHistoryItem::isTargetItem() const
 {
-    ASSERT(!isNull());
     return m_private->isTargetItem();
 }
 
@@ -192,7 +177,6 @@
 
 int WebHistoryItem::visitCount() const
 {
-    ASSERT(!isNull());
     return m_private->visitCount();
 }
 
@@ -204,7 +188,6 @@
 
 WebVector<WebString> WebHistoryItem::documentState() const
 {
-    ASSERT(!isNull());
     return m_private->documentState();
 }
 
@@ -220,7 +203,6 @@
 
 long long WebHistoryItem::documentSequenceNumber() const
 {
-    ASSERT(!isNull());
     return m_private->documentSequenceNumber();
 }
 
@@ -230,9 +212,19 @@
     m_private->setDocumentSequenceNumber(documentSequenceNumber);
 }
 
+WebSerializedScriptValue WebHistoryItem::stateObject() const
+{
+    return WebSerializedScriptValue(m_private->stateObject());
+}
+
+void WebHistoryItem::setStateObject(const WebSerializedScriptValue& object)
+{
+    ensureMutable();
+    m_private->setStateObject(object);
+}
+
 WebString WebHistoryItem::httpContentType() const
 {
-    ASSERT(!isNull());
     return m_private->formContentType();
 }
 
@@ -244,7 +236,6 @@
 
 WebHTTPBody WebHistoryItem::httpBody() const
 {
-    ASSERT(!isNull());
     return WebHTTPBody(m_private->formData());
 }
 
@@ -256,7 +247,6 @@
 
 WebVector<WebHistoryItem> WebHistoryItem::children() const
 {
-    ASSERT(!isNull());
     return m_private->children();
 }
 
@@ -275,34 +265,25 @@
 }
 
 WebHistoryItem::WebHistoryItem(const PassRefPtr<HistoryItem>& item)
-    : m_private(static_cast<WebHistoryItemPrivate*>(item.releaseRef()))
+    : m_private(item)
 {
 }
 
 WebHistoryItem& WebHistoryItem::operator=(const PassRefPtr<HistoryItem>& item)
 {
-    assign(static_cast<WebHistoryItemPrivate*>(item.releaseRef()));
+    m_private = item;
     return *this;
 }
 
 WebHistoryItem::operator PassRefPtr<HistoryItem>() const
 {
-    return m_private;
-}
-
-void WebHistoryItem::assign(WebHistoryItemPrivate* p)
-{
-    // p is already ref'd for us by the caller
-    if (m_private)
-        m_private->deref();
-    m_private = p;
+    return m_private.get();
 }
 
 void WebHistoryItem::ensureMutable()
 {
-    ASSERT(!isNull());
     if (!m_private->hasOneRef())
-        assign(static_cast<WebHistoryItemPrivate*>(m_private->copy().releaseRef()));
+        m_private = m_private->copy();
 }
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebIDBDatabaseError.cpp b/WebKit/chromium/src/WebIDBDatabaseError.cpp
new file mode 100644
index 0000000..17fdd38
--- /dev/null
+++ b/WebKit/chromium/src/WebIDBDatabaseError.cpp
@@ -0,0 +1,86 @@
+/*
+ * 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 "WebIDBDatabaseError.h"
+
+#include "IDBDatabaseError.h"
+#include "WebString.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebIDBDatabaseError::~WebIDBDatabaseError()
+{
+    m_private.reset();
+}
+
+void WebIDBDatabaseError::assign(const WebIDBDatabaseError& value)
+{
+    m_private = value.m_private;
+}
+
+void WebIDBDatabaseError::assign(unsigned short code, const WebString& message)
+{
+    m_private = IDBDatabaseError::create(code, message);
+}
+
+unsigned short WebIDBDatabaseError::code() const
+{
+    return m_private->code();
+}
+
+WebString WebIDBDatabaseError::message() const
+{
+    return m_private->message();
+}
+
+WebIDBDatabaseError::WebIDBDatabaseError(const PassRefPtr<IDBDatabaseError>& value)
+    : m_private(value)
+{
+}
+
+WebIDBDatabaseError& WebIDBDatabaseError::operator=(const PassRefPtr<IDBDatabaseError>& value)
+{
+    m_private = value;
+    return *this;
+}
+
+WebIDBDatabaseError::operator PassRefPtr<IDBDatabaseError>() const
+{
+    return m_private.get();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebImageDecoder.cpp b/WebKit/chromium/src/WebImageDecoder.cpp
new file mode 100644
index 0000000..9e1d1f4
--- /dev/null
+++ b/WebKit/chromium/src/WebImageDecoder.cpp
@@ -0,0 +1,121 @@
+/*
+ * 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 "WebImageDecoder.h"
+
+#include "BMPImageDecoder.h"
+#include "ICOImageDecoder.h"
+#include "SharedBuffer.h"
+#include "WebData.h"
+#include "WebImage.h"
+#include "WebSize.h"
+
+#if WEBKIT_USING_SKIA
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#endif
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebImageDecoder::reset()
+{
+    delete m_private;
+}
+
+void WebImageDecoder::init(Type type)
+{
+    switch (type) {
+    case TypeBMP:
+        m_private = new BMPImageDecoder();
+        break;
+    case TypeICO:
+        m_private = new ICOImageDecoder();
+        break;
+    }
+}
+
+void WebImageDecoder::setData(const WebData& data, bool allDataReceived)
+{
+    ASSERT(m_private);
+    m_private->setData(PassRefPtr<SharedBuffer>(data).get(), allDataReceived);
+}
+
+bool WebImageDecoder::isFailed() const
+{
+    ASSERT(m_private);
+    return m_private->failed();
+}
+
+bool WebImageDecoder::isSizeAvailable() const
+{
+    ASSERT(m_private);
+    return m_private->isSizeAvailable();
+}
+
+WebSize WebImageDecoder::size() const
+{
+    ASSERT(m_private);
+    return m_private->size();
+}
+
+size_t WebImageDecoder::frameCount() const
+{
+    ASSERT(m_private);
+    return m_private->frameCount();
+}
+
+bool WebImageDecoder::isFrameCompleteAtIndex(int index) const
+{
+    ASSERT(m_private);
+    RGBA32Buffer* const frameBuffer = m_private->frameBufferAtIndex(index);
+    if (!frameBuffer)
+        return false;
+    return (frameBuffer->status() == RGBA32Buffer::FrameComplete);
+}
+
+WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const
+{
+    ASSERT(m_private);
+    RGBA32Buffer* const frameBuffer = m_private->frameBufferAtIndex(index);
+    if (!frameBuffer)
+        return WebImage();
+#if WEBKIT_USING_SKIA
+    OwnPtr<NativeImageSkia>image(frameBuffer->asNewNativeImage());
+    return WebImage(*image);
+#elif WEBKIT_USING_CG
+    // FIXME: Implement CG side of this.
+    return WebImage(frameBuffer->asNewNativeImage());
+#endif
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp
new file mode 100644
index 0000000..6a6327b
--- /dev/null
+++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp
@@ -0,0 +1,59 @@
+/*
+ * 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 "WebIndexedDatabaseImpl.h"
+
+#include "WebIDBDatabaseError.h"
+#include <wtf/OwnPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebKit {
+
+WebIndexedDatabase* WebIndexedDatabase::create()
+{
+    return new WebIndexedDatabaseImpl();
+}
+
+WebIndexedDatabaseImpl::~WebIndexedDatabaseImpl()
+{
+}
+
+void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>* callbacksPtr, WebFrame*, int& exceptionCode)
+{
+    OwnPtr<WebIDBCallbacks<WebIDBDatabase>*> callbacks(callbacksPtr);
+    callbacks->onError(WebIDBDatabaseError(0, "Not implemented"));
+    // FIXME: Implement for realz.
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.h b/WebKit/chromium/src/WebIndexedDatabaseImpl.h
new file mode 100644
index 0000000..b4b8c99
--- /dev/null
+++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.h
@@ -0,0 +1,45 @@
+/*
+ * 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:
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 WebIndexedDatabaseImpl_h
+#define WebIndexedDatabaseImpl_h
+
+#include "WebIndexedDatabase.h"
+
+namespace WebKit {
+
+class WebIndexedDatabaseImpl : public WebIndexedDatabase {
+public:
+    virtual ~WebIndexedDatabaseImpl();
+
+    virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks<WebIDBDatabase>*, WebFrame*, int& exceptionCode);
+};
+
+} // namespace WebKit
+
+#endif // WebIndexedDatabaseImpl_h
diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp
index 4ee1b93..1eab91f 100644
--- a/WebKit/chromium/src/WebInputElement.cpp
+++ b/WebKit/chromium/src/WebInputElement.cpp
@@ -40,22 +40,6 @@
 
 namespace WebKit {
 
-WebInputElement::WebInputElement(const WTF::PassRefPtr<HTMLInputElement>& elem)
-    : WebElement(elem)
-{
-}
-
-WebInputElement& WebInputElement::operator=(const WTF::PassRefPtr<HTMLInputElement>& elem)
-{
-    WebNode::assign(elem.releaseRef());
-    return *this;
-}
-
-WebInputElement::operator WTF::PassRefPtr<HTMLInputElement>() const
-{
-    return PassRefPtr<HTMLInputElement>(static_cast<HTMLInputElement*>(m_private));
-}
-
 bool WebInputElement::autoComplete() const
 {
     return constUnwrap<HTMLInputElement>()->autoComplete();
@@ -71,9 +55,9 @@
     return static_cast<InputType>(constUnwrap<HTMLInputElement>()->inputType());
 }
 
-WebString WebInputElement::formControlType() const
+int WebInputElement::maxLength() const
 {
-    return constUnwrap<HTMLInputElement>()->formControlType();
+    return constUnwrap<HTMLInputElement>()->maxLength();
 }
 
 bool WebInputElement::isActivatedSubmit() const
@@ -129,4 +113,20 @@
     return String();
 }
 
+WebInputElement::WebInputElement(const PassRefPtr<HTMLInputElement>& elem)
+    : WebFormControlElement(elem)
+{
+}
+
+WebInputElement& WebInputElement::operator=(const PassRefPtr<HTMLInputElement>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebInputElement::operator PassRefPtr<HTMLInputElement>() const
+{
+    return static_cast<HTMLInputElement*>(m_private.get());
+}
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebInputEvent.cpp b/WebKit/chromium/src/WebInputEvent.cpp
index b5c56fa..c00200e 100644
--- a/WebKit/chromium/src/WebInputEvent.cpp
+++ b/WebKit/chromium/src/WebInputEvent.cpp
@@ -86,6 +86,8 @@
     case VKEY_F9:
         return "F9";
     case VKEY_F10:
+        return "F10";
+    case VKEY_F11:
         return "F11";
     case VKEY_F12:
         return "F12";
diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp
index 147f88b..f68e3ab 100644
--- a/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -40,6 +40,7 @@
 #include "PlatformWheelEvent.h"
 #include "ScrollView.h"
 #include "WebInputEvent.h"
+#include "WheelEvent.h"
 #include "Widget.h"
 
 using namespace WebCore;
@@ -168,6 +169,64 @@
     return true;
 }
 
+#if ENABLE(TOUCH_EVENTS)
+static inline TouchEventType toPlatformTouchEventType(const WebInputEvent::Type type)
+{
+    switch (type) {
+    case WebInputEvent::TouchStart:
+        return TouchStart;
+    case WebInputEvent::TouchMove:
+        return TouchMove;
+    case WebInputEvent::TouchEnd:
+        return TouchEnd;
+    case WebInputEvent::TouchCancel:
+        return TouchCancel;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return TouchStart;
+}
+
+static inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::State state)
+{
+    switch (state) {
+    case WebTouchPoint::StateReleased:
+        return PlatformTouchPoint::TouchReleased;
+    case WebTouchPoint::StatePressed:
+        return PlatformTouchPoint::TouchPressed;
+    case WebTouchPoint::StateMoved:
+        return PlatformTouchPoint::TouchMoved;
+    case WebTouchPoint::StateStationary:
+        return PlatformTouchPoint::TouchStationary;
+    case WebTouchPoint::StateCancelled:
+        return PlatformTouchPoint::TouchCancelled;
+    case WebTouchPoint::StateUndefined:
+        ASSERT_NOT_REACHED();
+    }
+    return PlatformTouchPoint::TouchReleased;
+}
+
+PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTouchPoint& point)
+{
+    m_id = point.id;
+    m_state = toPlatformTouchPointState(point.state);
+    m_pos = widget->convertFromContainingWindow(point.position);
+    m_screenPos = point.screenPosition;
+}
+
+PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTouchEvent& event)
+{
+    m_type = toPlatformTouchEventType(event.type);
+    m_ctrlKey = event.modifiers & WebInputEvent::ControlKey;
+    m_altKey = event.modifiers & WebInputEvent::AltKey;
+    m_shiftKey = event.modifiers & WebInputEvent::ShiftKey;
+    m_metaKey = event.modifiers & WebInputEvent::MetaKey;
+
+    for (int i = 0; i < event.touchPointsLength; ++i)
+        m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touchPoints[i]));
+}
+#endif
+
 static int getWebInputModifiers(const UIEventWithKeyState& event)
 {
     int modifiers = 0;
@@ -232,6 +291,28 @@
     clickCount = event.detail();
 }
 
+WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const ScrollView* view, const WheelEvent& event)
+{
+    if (event.type() != eventNames().mousewheelEvent)
+        return;
+    type = WebInputEvent::MouseWheel;
+    timeStampSeconds = event.timeStamp() * 1.0e-3;
+    modifiers = getWebInputModifiers(event);
+    IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY()));
+    globalX = event.screenX();
+    globalY = event.screenY();
+    windowX = p.x();
+    windowY = p.y();
+    x = event.offsetX();
+    y = event.offsetY();
+    deltaX = static_cast<float>(event.rawDeltaX());
+    deltaY = static_cast<float>(event.rawDeltaY());
+    // The 120 is from WheelEvent::initWheelEvent().
+    wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120;
+    wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
+    scrollByPage = event.granularity() == WheelEvent::Page;
+}
+
 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
 {
     if (event.type() == eventNames().keydownEvent)
diff --git a/WebKit/chromium/src/WebInputEventConversion.h b/WebKit/chromium/src/WebInputEventConversion.h
index 4c9cf82..3018973 100644
--- a/WebKit/chromium/src/WebInputEventConversion.h
+++ b/WebKit/chromium/src/WebInputEventConversion.h
@@ -37,12 +37,14 @@
 
 #include "PlatformKeyboardEvent.h"
 #include "PlatformMouseEvent.h"
+#include "PlatformTouchEvent.h"
 #include "PlatformWheelEvent.h"
 
 namespace WebCore {
 class KeyboardEvent;
 class MouseEvent;
 class ScrollView;
+class WheelEvent;
 class Widget;
 }
 
@@ -72,8 +74,20 @@
     bool isCharacterKey() const;
 };
 
+#if ENABLE(TOUCH_EVENTS)
+class PlatformTouchPointBuilder : public WebCore::PlatformTouchPoint {
+public:
+    PlatformTouchPointBuilder(WebCore::Widget*, const WebTouchPoint&);
+};
+
+class PlatformTouchEventBuilder : public WebCore::PlatformTouchEvent {
+public:
+    PlatformTouchEventBuilder(WebCore::Widget*, const WebTouchEvent&);
+};
+#endif
+
 // Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. view is
-// the ScrollView corresponding to the event.  Returns true if successful.
+// the ScrollView corresponding to the event.
 // NOTE: This is only implemented for mousemove, mouseover, mouseout,
 // mousedown and mouseup.  If the event mapping fails, the event type will
 // be set to Undefined.
@@ -82,10 +96,16 @@
     WebMouseEventBuilder(const WebCore::ScrollView*, const WebCore::MouseEvent&);
 };
 
+// Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent.
+// If the event mapping fails, the event type will be set to Undefined.
+class WebMouseWheelEventBuilder : public WebMouseWheelEvent {
+public:
+    WebMouseWheelEventBuilder(const WebCore::ScrollView*, const WebCore::WheelEvent&);
+};
+
 // Converts a WebCore::KeyboardEvent to a corresponding WebKeyboardEvent.
-// Returns true if successful.  NOTE: This is only implemented for keydown
-// and keyup.  If the event mapping fails, the event type will be set to
-// Undefined.
+// NOTE: This is only implemented for keydown and keyup.  If the event mapping
+// fails, the event type will be set to Undefined.
 class WebKeyboardEventBuilder : public WebKeyboardEvent {
 public:
     WebKeyboardEventBuilder(const WebCore::KeyboardEvent&);
diff --git a/WebKit/chromium/src/WebLabelElement.cpp b/WebKit/chromium/src/WebLabelElement.cpp
new file mode 100644
index 0000000..9546986
--- /dev/null
+++ b/WebKit/chromium/src/WebLabelElement.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 "WebLabelElement.h"
+
+#include "HTMLLabelElement.h"
+#include "HTMLNames.h"
+#include "WebString.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebElement WebLabelElement::correspondingControl()
+{
+    return WebElement(unwrap<HTMLLabelElement>()->correspondingControl());
+}
+
+WebLabelElement::WebLabelElement(const PassRefPtr<HTMLLabelElement>& elem)
+    : WebElement(elem)
+{
+}
+
+WebLabelElement& WebLabelElement::operator=(const PassRefPtr<HTMLLabelElement>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebLabelElement::operator PassRefPtr<HTMLLabelElement>() const
+{
+    return static_cast<HTMLLabelElement*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index b1f1f03..d7dbade 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -7,7 +7,6 @@
 
 #if ENABLE(VIDEO)
 
-#include "CString.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "HTMLMediaElement.h"
@@ -36,6 +35,7 @@
 #endif
 
 #include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
diff --git a/WebKit/chromium/src/WebNode.cpp b/WebKit/chromium/src/WebNode.cpp
index 9fbf573..e050c79 100644
--- a/WebKit/chromium/src/WebNode.cpp
+++ b/WebKit/chromium/src/WebNode.cpp
@@ -48,26 +48,23 @@
 
 #include "markup.h"
 
-#include <wtf/PassRefPtr.h>
-
 using namespace WebCore;
 
 namespace WebKit {
 
-class WebNodePrivate : public Node {
-};
-
 void WebNode::reset()
 {
-    assign(0);
+    m_private.reset();
 }
 
 void WebNode::assign(const WebNode& other)
 {
-    WebNodePrivate* p = const_cast<WebNodePrivate*>(other.m_private);
-    if (p)
-        p->ref();
-    assign(p);
+    m_private = other.m_private;
+}
+
+bool WebNode::equals(const WebNode& n) const
+{
+    return (m_private.get() == n.m_private.get());
 }
 
 WebNode::NodeType WebNode::nodeType() const
@@ -77,7 +74,7 @@
 
 WebNode WebNode::parentNode() const
 {
-    return PassRefPtr<Node>(const_cast<Node*>(m_private->parentNode()));
+    return WebNode(const_cast<Node*>(m_private->parentNode()));
 }
 
 WebString WebNode::nodeName() const
@@ -97,30 +94,6 @@
     return !exceptionCode;
 }
 
-WebNode::WebNode(const PassRefPtr<Node>& node)
-    : m_private(static_cast<WebNodePrivate*>(node.releaseRef()))
-{
-}
-
-WebNode& WebNode::operator=(const PassRefPtr<Node>& node)
-{
-    assign(static_cast<WebNodePrivate*>(node.releaseRef()));
-    return *this;
-}
-
-WebNode::operator PassRefPtr<Node>() const
-{
-    return PassRefPtr<Node>(const_cast<WebNodePrivate*>(m_private));
-}
-
-void WebNode::assign(WebNodePrivate* p)
-{
-    // p is already ref'd for us by the caller
-    if (m_private)
-        m_private->deref();
-    m_private = p;
-}
-
 WebFrame* WebNode::frame() const
 {
     return WebFrameImpl::fromFrame(m_private->document()->frame());
@@ -163,7 +136,7 @@
 
 WebString WebNode::createMarkup() const
 {
-    return WebCore::createMarkup(m_private);
+    return WebCore::createMarkup(m_private.get());
 }
 
 bool WebNode::isTextNode() const
@@ -179,7 +152,7 @@
 void WebNode::addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
 {
     EventListenerWrapper* listenerWrapper =
-        listener->createEventListenerWrapper(eventType, useCapture, m_private);
+        listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
     // The listenerWrapper is only referenced by the actual Node.  Once it goes
     // away, the wrapper notifies the WebEventListener so it can clear its
     // pointer to it.
@@ -189,9 +162,36 @@
 void WebNode::removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
 {
     EventListenerWrapper* listenerWrapper =
-        listener->getEventListenerWrapper(eventType, useCapture, m_private);
+        listener->getEventListenerWrapper(eventType, useCapture, m_private.get());
     m_private->removeEventListener(eventType, listenerWrapper, useCapture);
     // listenerWrapper is now deleted.
 }
 
+void WebNode::simulateClick()
+{
+    RefPtr<Event> noEvent;
+    m_private->dispatchSimulatedClick(noEvent);
+}
+
+WebNodeList WebNode::getElementsByTagName(const WebString& tag) const
+{
+    return WebNodeList(m_private->getElementsByTagName(tag));
+}
+
+WebNode::WebNode(const PassRefPtr<Node>& node)
+    : m_private(node)
+{
+}
+
+WebNode& WebNode::operator=(const PassRefPtr<Node>& node)
+{
+    m_private = node;
+    return *this;
+}
+
+WebNode::operator PassRefPtr<Node>() const
+{
+    return m_private.get();
+}
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp
index 1f6916e..5200d17 100644
--- a/WebKit/chromium/src/WebNotification.cpp
+++ b/WebKit/chromium/src/WebNotification.cpp
@@ -76,10 +76,10 @@
     return m_private->url();
 }
 
-WebString WebNotification::icon() const
+WebURL WebNotification::iconURL() const
 {
     ASSERT(!isHTML());
-    return m_private->contents().icon();
+    return m_private->iconURL();
 }
 
 WebString WebNotification::title() const
diff --git a/WebKit/chromium/src/WebPageSerializer.cpp b/WebKit/chromium/src/WebPageSerializer.cpp
index 1010285..4f93702 100644
--- a/WebKit/chromium/src/WebPageSerializer.cpp
+++ b/WebKit/chromium/src/WebPageSerializer.cpp
@@ -59,7 +59,7 @@
 
 WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& charset)
 {
-    return String::format("<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">",
+    return String::format("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">",
                           charset.utf8().data());
 }
 
@@ -75,7 +75,7 @@
     String targetDeclaration;
     if (!baseTarget.isEmpty())
         targetDeclaration = String::format(" target=\"%s\"", baseTarget.utf8().data());
-    return String::format("<BASE href=\".\"%s>", targetDeclaration.utf8().data());
+    return String::format("<base href=\".\"%s>", targetDeclaration.utf8().data());
 }
 
 }  // namespace WebKit
diff --git a/WebKit/chromium/src/WebPageSerializerImpl.cpp b/WebKit/chromium/src/WebPageSerializerImpl.cpp
index d5b2b7f..008e0c7 100644
--- a/WebKit/chromium/src/WebPageSerializerImpl.cpp
+++ b/WebKit/chromium/src/WebPageSerializerImpl.cpp
@@ -170,7 +170,7 @@
             // Get encoding info.
             String xmlEncoding = param->doc->xmlEncoding();
             if (xmlEncoding.isEmpty())
-                xmlEncoding = param->doc->frame()->loader()->encoding();
+                xmlEncoding = param->doc->frame()->loader()->writer()->encoding();
             if (xmlEncoding.isEmpty())
                 xmlEncoding = UTF8Encoding().name();
             result.append("<?xml version=\"");
@@ -306,7 +306,7 @@
     if (needSkip)
         return;
     // Add open tag
-    result += "<" + element->nodeName();
+    result += "<" + element->nodeName().lower();
     // Go through all attributes and serialize them.
     const NamedNodeMap *attrMap = element->attributes(true);
     if (attrMap) {
@@ -374,7 +374,7 @@
     // Write end tag when element has child/children.
     if (element->hasChildNodes() || param->hasAddedContentsBeforeEnd) {
         result += "</";
-        result += element->nodeName();
+        result += element->nodeName().lower();
         result += ">";
     } else {
         // Check whether we have to write end tag for empty element.
@@ -385,7 +385,7 @@
             if (htmlElement->endTagRequirement() == TagStatusRequired) {
                 // We need to write end tag when it is required.
                 result += "</";
-                result += element->nodeName();
+                result += element->nodeName().lower();
                 result += ">";
             }
         } else {
@@ -514,7 +514,7 @@
             // A new document, we will serialize it.
             didSerialization = true;
             // Get target encoding for current document.
-            String encoding = currentFrame->frame()->loader()->encoding();
+            String encoding = currentFrame->frame()->loader()->writer()->encoding();
             // Create the text encoding object with target encoding.
             TextEncoding textEncoding(encoding);
             // Construct serialize parameter for late processing document.
diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp
index 86cac26..2cdf255 100644
--- a/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -60,6 +60,7 @@
 #include "MouseEvent.h"
 #include "Page.h"
 #include "ScrollView.h"
+#include "WheelEvent.h"
 
 #if WEBKIT_USING_SKIA
 #include "PlatformContextSkia.h"
@@ -124,7 +125,7 @@
     IntRect clipRect = parent()->windowClipRect();
     damageRect.intersect(clipRect);
 
-    parent()->hostWindow()->repaint(damageRect, true);
+    parent()->hostWindow()->invalidateContentsAndWindow(damageRect, false /*immediate*/);
 }
 
 void WebPluginContainerImpl::setFocus()
@@ -160,6 +161,8 @@
     // where mozilla behaves differently than the spec.
     if (event->isMouseEvent())
         handleMouseEvent(static_cast<MouseEvent*>(event));
+    else if (event->isWheelEvent())
+        handleWheelEvent(static_cast<WheelEvent*>(event));
     else if (event->isKeyboardEvent())
         handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
 }
@@ -170,6 +173,12 @@
     reportGeometry();
 }
 
+void WebPluginContainerImpl::widgetPositionsUpdated()
+{
+    Widget::widgetPositionsUpdated();
+    reportGeometry();
+}
+
 void WebPluginContainerImpl::setParentVisible(bool parentVisible)
 {
     // We override this function to make sure that geometry updates are sent
@@ -200,6 +209,36 @@
         reportGeometry();
 }
 
+bool WebPluginContainerImpl::supportsPaginatedPrint() const
+{
+    return m_webPlugin->supportsPaginatedPrint();
+}
+
+int WebPluginContainerImpl::printBegin(const IntRect& printableArea,
+                                       int printerDPI) const
+{
+    return m_webPlugin->printBegin(printableArea, printerDPI);
+}
+
+bool WebPluginContainerImpl::printPage(int pageNumber,
+                                       WebCore::GraphicsContext* gc)
+{
+    gc->save();
+#if WEBKIT_USING_SKIA
+    WebCanvas* canvas = gc->platformContext()->canvas();
+#elif WEBKIT_USING_CG
+    WebCanvas* canvas = gc->platformContext();
+#endif
+    bool ret = m_webPlugin->printPage(pageNumber, canvas);
+    gc->restore();
+    return ret;
+}
+
+void WebPluginContainerImpl::printEnd()
+{
+    return m_webPlugin->printEnd();
+}
+
 void WebPluginContainerImpl::invalidate()
 {
     Widget::invalidate();
@@ -353,22 +392,7 @@
     }
 
     WebCursorInfo cursorInfo;
-    bool handled = m_webPlugin->handleInputEvent(webEvent, cursorInfo);
-#if !OS(DARWIN)
-    // TODO(pkasting): http://b/1119691 This conditional seems exactly
-    // backwards, but if I reverse it, giving focus to a transparent
-    // (windowless) plugin fails.
-    handled = !handled;
-    // TODO(awalker): oddly, the above is not true in Mac builds.  Looking
-    // at Apple's corresponding code for Mac and Windows (PluginViewMac and
-    // PluginViewWin), setDefaultHandled() gets called when handleInputEvent()
-    // returns true, which then indicates to WebCore that the plugin wants to
-    // swallow the event--which is what we want.  Calling setDefaultHandled()
-    // fixes several Mac Chromium bugs, but does indeed prevent windowless plugins
-    // from getting focus in Windows builds, as pkasting notes above.  So for
-    // now, we only do so in Mac builds.
-#endif
-    if (handled)
+    if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
         event->setDefaultHandled();
 
     // A windowless plugin can change the cursor in response to a mouse move
@@ -382,19 +406,26 @@
     chromeClient->setCursorForPlugin(cursorInfo);
 }
 
+void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event)
+{
+    FrameView* parentView = static_cast<FrameView*>(parent());
+    WebMouseWheelEventBuilder webEvent(parentView, *event);
+    if (webEvent.type == WebInputEvent::Undefined)
+        return;
+
+    WebCursorInfo cursorInfo;
+    if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+        event->setDefaultHandled();
+}
+
 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event)
 {
     WebKeyboardEventBuilder webEvent(*event);
     if (webEvent.type == WebInputEvent::Undefined)
         return;
 
-    WebCursorInfo cursor_info;
-    bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info);
-#if !OS(DARWIN)
-    // TODO(pkasting): http://b/1119691 See above.
-    handled = !handled;
-#endif
-    if (handled)
+    WebCursorInfo cursorInfo;
+    if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
         event->setDefaultHandled();
 }
 
diff --git a/WebKit/chromium/src/WebPluginContainerImpl.h b/WebKit/chromium/src/WebPluginContainerImpl.h
index 00450bb..3160394 100644
--- a/WebKit/chromium/src/WebPluginContainerImpl.h
+++ b/WebKit/chromium/src/WebPluginContainerImpl.h
@@ -48,6 +48,7 @@
 class MouseEvent;
 class ResourceError;
 class ResourceResponse;
+class WheelEvent;
 }
 
 namespace WebKit {
@@ -73,6 +74,7 @@
     virtual void frameRectsChanged();
     virtual void setParentVisible(bool);
     virtual void setParent(WebCore::ScrollView*);
+    virtual void widgetPositionsUpdated();
 
     // WebPluginContainer methods
     virtual void invalidate();
@@ -83,6 +85,20 @@
     virtual WebString executeScriptURL(const WebURL&, bool popupsAllowed);
     virtual void loadFrameRequest(const WebURLRequest&, const WebString& target, bool notifyNeeded, void* notifyData);
 
+    // Printing interface. The plugin can support custom printing
+    // (which means it controls the layout, number of pages etc).
+    // Whether the plugin supports its own paginated print. The other print
+    // interface methods are called only if this method returns true.
+    bool supportsPaginatedPrint() const;
+    // Sets up printing at the given print rect and printer DPI. printableArea
+    // is in points (a point is 1/72 of an inch).Returns the number of pages to
+    // be printed at these settings.
+    int printBegin(const WebCore::IntRect& printableArea, int printerDPI) const;
+    // Prints the page specified by pageNumber (0-based index) into the supplied canvas.
+    bool printPage(int pageNumber, WebCore::GraphicsContext* gc);
+    // Ends the print operation.
+    void printEnd();
+
     // Resource load events for the plugin's source data:
     void didReceiveResponse(const WebCore::ResourceResponse&);
     void didReceiveData(const char *data, int dataLength);
@@ -103,6 +119,7 @@
     ~WebPluginContainerImpl();
 
     void handleMouseEvent(WebCore::MouseEvent*);
+    void handleWheelEvent(WebCore::WheelEvent*);
     void handleKeyboardEvent(WebCore::KeyboardEvent*);
 
     void calculateGeometry(const WebCore::IntRect& frameRect,
diff --git a/WebKit/chromium/src/WebPluginDocument.cpp b/WebKit/chromium/src/WebPluginDocument.cpp
new file mode 100644
index 0000000..8f794ad
--- /dev/null
+++ b/WebKit/chromium/src/WebPluginDocument.cpp
@@ -0,0 +1,72 @@
+/*
+ * 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 "WebPluginDocument.h"
+
+#include "Document.h"
+#include "PluginDocument.h"
+
+#include "WebPluginContainerImpl.h"
+
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+
+WebPlugin* WebPluginDocument::plugin()
+{
+    if (!isPluginDocument())
+        return 0;
+    PluginDocument* doc = unwrap<PluginDocument>();
+    WebPluginContainerImpl* container = static_cast<WebPluginContainerImpl*>(static_cast<PluginDocument*>(doc)->pluginWidget());
+    return container->plugin();
+}
+
+
+WebPluginDocument::WebPluginDocument(const PassRefPtr<PluginDocument>& elem)
+    : WebDocument(elem)
+{
+}
+
+WebPluginDocument& WebPluginDocument::operator=(const PassRefPtr<PluginDocument>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebPluginDocument::operator PassRefPtr<PluginDocument>() const
+{
+    return static_cast<PluginDocument*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp
index f6d360e..f9da394 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -250,18 +250,29 @@
 //-----------------------------------------------------------------------------
 // WebCore::HostWindow
 
-void WebPopupMenuImpl::repaint(const IntRect& paintRect,
-                               bool contentChanged,
-                               bool immediate,
-                               bool repaintContentOnly)
+void WebPopupMenuImpl::invalidateContents(const IntRect&, bool)
 {
-    // Ignore spurious calls.
-    if (!contentChanged || paintRect.isEmpty())
+    notImplemented();
+}
+
+void WebPopupMenuImpl::invalidateWindow(const IntRect&, bool)
+{
+    notImplemented();
+}
+
+void WebPopupMenuImpl::invalidateContentsAndWindow(const IntRect& paintRect, bool /*immediate*/)
+{
+    if (paintRect.isEmpty())
         return;
     if (m_client)
         m_client->didInvalidateRect(paintRect);
 }
 
+void WebPopupMenuImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
+{
+    invalidateContentsAndWindow(updateRect, immediate);
+}
+
 void WebPopupMenuImpl::scroll(const IntSize& scrollDelta,
                               const IntRect& scrollRect,
                               const IntRect& clipRect)
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h
index 13eb674..7390394 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -98,9 +98,10 @@
     ~WebPopupMenuImpl();
 
     // WebCore::HostWindow methods:
-    virtual void repaint(
-        const WebCore::IntRect&, bool contentChanged, bool immediate = false,
-        bool repaintContentOnly = false);
+    virtual void invalidateContents(const WebCore::IntRect&, bool);
+    virtual void invalidateWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(
         const WebCore::IntSize& scrollDelta, const WebCore::IntRect& scrollRect,
         const WebCore::IntRect& clipRect);
diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp
index ad84764..464834d 100644
--- a/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -184,4 +184,30 @@
 #endif
 }
 
+void WebRuntimeFeatures::enableWebGL(bool enable)
+{
+#if ENABLE(3D_CANVAS)
+    RuntimeEnabledFeatures::setWebGLEnabled(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isWebGLEnabled()
+{
+#if ENABLE(3D_CANVAS)
+    return RuntimeEnabledFeatures::webGLRenderingContextEnabled();
+#else
+    return false;
+#endif
+}
+
+void WebRuntimeFeatures::enablePushState(bool enable)
+{
+    RuntimeEnabledFeatures::setPushStateEnabled(enable);
+}
+
+bool WebRuntimeFeatures::isPushStateEnabled(bool enable)
+{
+    return RuntimeEnabledFeatures::pushStateEnabled();
+}
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index eddaffe..8eef6cc 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -62,7 +62,7 @@
             return;
     }
     const Frame* frame = form->document()->frame();
-    *encoding = frame ? TextEncoding(frame->loader()->encoding()) : Latin1Encoding();
+    *encoding = frame ? TextEncoding(frame->loader()->writer()->encoding()) : Latin1Encoding();
 }
 
 // Returns true if the submit request results in an HTTP URL.
diff --git a/WebKit/chromium/src/WebSecurityOrigin.cpp b/WebKit/chromium/src/WebSecurityOrigin.cpp
index 81546da..bc36be7 100644
--- a/WebKit/chromium/src/WebSecurityOrigin.cpp
+++ b/WebKit/chromium/src/WebSecurityOrigin.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -31,8 +31,10 @@
 #include "config.h"
 #include "WebSecurityOrigin.h"
 
+#include "KURL.h"
 #include "SecurityOrigin.h"
 #include "WebString.h"
+#include "WebURL.h"
 #include <wtf/PassRefPtr.h>
 
 using namespace WebCore;
@@ -42,9 +44,9 @@
 class WebSecurityOriginPrivate : public SecurityOrigin {
 };
 
-WebSecurityOrigin* WebSecurityOrigin::createFromDatabaseIdentifier(const WebString& databaseIdentifier)
+WebSecurityOrigin WebSecurityOrigin::createFromDatabaseIdentifier(const WebString& databaseIdentifier)
 {
-    return new WebSecurityOrigin(SecurityOrigin::createFromDatabaseIdentifier(databaseIdentifier));
+    return WebSecurityOrigin(SecurityOrigin::createFromDatabaseIdentifier(databaseIdentifier));
 }
 
 WebSecurityOrigin WebSecurityOrigin::createFromString(const WebString& origin)
@@ -52,6 +54,11 @@
     return WebSecurityOrigin(SecurityOrigin::createFromString(origin));
 }
 
+WebSecurityOrigin WebSecurityOrigin::create(const WebURL& url)
+{
+    return WebSecurityOrigin(SecurityOrigin::create(url));
+}
+
 void WebSecurityOrigin::reset()
 {
     assign(0);
@@ -89,6 +96,19 @@
     return m_private->isEmpty();
 }
 
+bool WebSecurityOrigin::canAccess(const WebSecurityOrigin& other) const
+{
+    ASSERT(m_private);
+    ASSERT(other.m_private);
+    return m_private->canAccess(other.m_private);
+}
+
+bool WebSecurityOrigin::canRequest(const WebURL& url) const
+{
+    ASSERT(m_private);
+    return m_private->canRequest(url);
+}
+
 WebString WebSecurityOrigin::toString() const
 {
     ASSERT(m_private);
diff --git a/WebKit/chromium/src/WebSecurityPolicy.cpp b/WebKit/chromium/src/WebSecurityPolicy.cpp
index 48b445c..24ef7d1 100644
--- a/WebKit/chromium/src/WebSecurityPolicy.cpp
+++ b/WebKit/chromium/src/WebSecurityPolicy.cpp
@@ -51,19 +51,24 @@
     SecurityOrigin::registerURLSchemeAsNoAccess(scheme);
 }
 
+void WebSecurityPolicy::registerURLSchemeAsSecure(const WebString& scheme)
+{
+    SecurityOrigin::registerURLSchemeAsSecure(scheme);
+}
+
 void WebSecurityPolicy::whiteListAccessFromOrigin(const WebURL& sourceOrigin,
     const WebString& destinationProtocol,
     const WebString& destinationHost,
     bool allowDestinationSubdomains)
 {
-    SecurityOrigin::whiteListAccessFromOrigin(
+    SecurityOrigin::addOriginAccessWhitelistEntry(
         *SecurityOrigin::create(sourceOrigin), destinationProtocol,
         destinationHost, allowDestinationSubdomains);
 }
 
 void WebSecurityPolicy::resetOriginAccessWhiteLists()
 {
-    SecurityOrigin::resetOriginAccessWhiteLists();
+    SecurityOrigin::resetOriginAccessWhitelists();
 }
 
 bool WebSecurityPolicy::shouldHideReferrer(const WebURL& url, const WebString& referrer)
diff --git a/WebKit/chromium/src/WebSelectElement.cpp b/WebKit/chromium/src/WebSelectElement.cpp
new file mode 100644
index 0000000..6516cc3
--- /dev/null
+++ b/WebKit/chromium/src/WebSelectElement.cpp
@@ -0,0 +1,68 @@
+/*
+ * 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 "WebSelectElement.h"
+
+#include "HTMLSelectElement.h"
+#include "WebString.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebSelectElement::setValue(const WebString& value)
+{
+    unwrap<HTMLSelectElement>()->setValue(value);
+}
+
+WebString WebSelectElement::value()
+{
+    return unwrap<HTMLSelectElement>()->value();
+}
+
+WebSelectElement::WebSelectElement(const PassRefPtr<HTMLSelectElement>& elem)
+    : WebFormControlElement(elem)
+{
+}
+
+WebSelectElement& WebSelectElement::operator=(const PassRefPtr<HTMLSelectElement>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebSelectElement::operator PassRefPtr<HTMLSelectElement>() const
+{
+    return static_cast<HTMLSelectElement*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSerializedScriptValue.cpp b/WebKit/chromium/src/WebSerializedScriptValue.cpp
new file mode 100644
index 0000000..ce8517a
--- /dev/null
+++ b/WebKit/chromium/src/WebSerializedScriptValue.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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 "WebSerializedScriptValue.h"
+
+#include "SerializedScriptValue.h"
+#include "WebString.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebSerializedScriptValue WebSerializedScriptValue::fromString(const WebString& s)
+{
+    return SerializedScriptValue::createFromWire(s);
+}
+
+void WebSerializedScriptValue::reset()
+{
+    m_private.reset();
+}
+
+void WebSerializedScriptValue::assign(const WebSerializedScriptValue& other)
+{
+    m_private = other.m_private;
+}
+
+WebString WebSerializedScriptValue::toString() const
+{
+    return m_private->toWireString();
+}
+
+WebSerializedScriptValue::WebSerializedScriptValue(const PassRefPtr<SerializedScriptValue>& value)
+    : m_private(value)
+{
+}
+
+WebSerializedScriptValue& WebSerializedScriptValue::operator=(const PassRefPtr<SerializedScriptValue>& value)
+{
+    m_private = value;
+    return *this;
+}
+
+WebSerializedScriptValue::operator PassRefPtr<SerializedScriptValue>() const
+{
+    return m_private.get();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp
index a680321..9e0fa91 100644
--- a/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -185,6 +185,11 @@
     m_settings->setUserStyleSheetLocation(location);
 }
 
+void WebSettingsImpl::setAuthorAndUserStylesEnabled(bool enabled)
+{
+    m_settings->setAuthorAndUserStylesEnabled(enabled);
+}
+
 void WebSettingsImpl::setUsesPageCache(bool usesPageCache)
 {
     m_settings->setUsesPageCache(usesPageCache);
@@ -226,11 +231,6 @@
     m_settings->setShouldPaintCustomScrollbars(enabled);
 }
 
-void WebSettingsImpl::setDatabasesEnabled(bool enabled)
-{
-    m_settings->setDatabasesEnabled(enabled);
-}
-
 void WebSettingsImpl::setAllowUniversalAccessFromFileURLs(bool allow)
 {
     m_settings->setAllowUniversalAccessFromFileURLs(allow);
@@ -264,9 +264,4 @@
     m_settings->setShowDebugBorders(show);
 }
 
-void WebSettingsImpl::setGeolocationEnabled(bool enabled)
-{
-    m_settings->setGeolocationEnabled(enabled);
-}
-
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h
index 64ccab5..7a809c7 100644
--- a/WebKit/chromium/src/WebSettingsImpl.h
+++ b/WebKit/chromium/src/WebSettingsImpl.h
@@ -71,6 +71,7 @@
     virtual void setJavaEnabled(bool);
     virtual void setAllowScriptsToCloseWindows(bool);
     virtual void setUserStyleSheetLocation(const WebURL&);
+    virtual void setAuthorAndUserStylesEnabled(bool);
     virtual void setUsesPageCache(bool);
     virtual void setDownloadableBinaryFontsEnabled(bool);
     virtual void setXSSAuditorEnabled(bool);
@@ -78,13 +79,11 @@
     virtual void setEditableLinkBehaviorNeverLive();
     virtual void setFontRenderingModeNormal();
     virtual void setShouldPaintCustomScrollbars(bool);
-    virtual void setDatabasesEnabled(bool);
     virtual void setAllowUniversalAccessFromFileURLs(bool);
     virtual void setAllowFileAccessFromFileURLs(bool);
     virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
     virtual void setOfflineWebApplicationCacheEnabled(bool);
     virtual void setExperimentalWebGLEnabled(bool);
-    virtual void setGeolocationEnabled(bool);
     virtual void setShowDebugBorders(bool);
 
 private:
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.cpp b/WebKit/chromium/src/WebStorageAreaImpl.cpp
index 9a7fd5c..2cecfe9 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.cpp
+++ b/WebKit/chromium/src/WebStorageAreaImpl.cpp
@@ -66,7 +66,7 @@
     return m_storageArea->getItem(key);
 }
 
-void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue)
+void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue, WebFrame*)
 {
     int exceptionCode = 0;
 
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.h b/WebKit/chromium/src/WebStorageAreaImpl.h
index e9a11c2..2869fc9 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.h
+++ b/WebKit/chromium/src/WebStorageAreaImpl.h
@@ -45,7 +45,7 @@
     virtual unsigned length();
     virtual WebString key(unsigned index);
     virtual WebString getItem(const WebString& key);
-    virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue);
+    virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue, WebFrame*);
     virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue);
     virtual void clear(const WebURL& url, bool& somethingCleared);
 
diff --git a/WebKit/chromium/src/WebStorageNamespaceImpl.cpp b/WebKit/chromium/src/WebStorageNamespaceImpl.cpp
index e6f6548..66be027 100644
--- a/WebKit/chromium/src/WebStorageNamespaceImpl.cpp
+++ b/WebKit/chromium/src/WebStorageNamespaceImpl.cpp
@@ -47,7 +47,7 @@
 
 WebStorageNamespace* WebStorageNamespace::createSessionStorageNamespace()
 {
-    return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::sessionStorageNamespace());
+    return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::sessionStorageNamespace(noQuota));
 }
 
 WebStorageNamespaceImpl::WebStorageNamespaceImpl(PassRefPtr<WebCore::StorageNamespace> storageNamespace)
diff --git a/WebKit/chromium/src/WebString.cpp b/WebKit/chromium/src/WebString.cpp
index 36d5f86..a61a059 100644
--- a/WebKit/chromium/src/WebString.cpp
+++ b/WebKit/chromium/src/WebString.cpp
@@ -32,8 +32,8 @@
 #include "WebString.h"
 
 #include "AtomicString.h"
-#include "CString.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include "WebCString.h"
 
diff --git a/WebKit/chromium/src/WebURLError.cpp b/WebKit/chromium/src/WebURLError.cpp
index a038aee..ef32b5c 100644
--- a/WebKit/chromium/src/WebURLError.cpp
+++ b/WebKit/chromium/src/WebURLError.cpp
@@ -31,9 +31,9 @@
 #include "config.h"
 #include "WebURLError.h"
 
-#include "CString.h"
 #include "KURL.h"
 #include "ResourceError.h"
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp
index 95e0be2..3b0600c 100644
--- a/WebKit/chromium/src/WebURLResponse.cpp
+++ b/WebKit/chromium/src/WebURLResponse.cpp
@@ -165,6 +165,8 @@
 
 void WebURLResponse::addHTTPHeaderField(const WebString& name, const WebString& value)
 {
+    if (name.isNull() || value.isNull())
+        return;
     // FIXME: Add an addHTTPHeaderField method to ResourceResponse.
     const HTTPHeaderMap& map = m_private->m_resourceResponse->httpHeaderFields();
     String valueStr(value);
@@ -265,6 +267,16 @@
     m_private->m_resourceResponse->setWasFetchedViaSPDY(value);
 }
 
+bool WebURLResponse::isMultipartPayload() const
+{
+    return m_private->m_resourceResponse->isMultipartPayload();
+}
+
+void WebURLResponse::setIsMultipartPayload(bool value)
+{
+    m_private->m_resourceResponse->setIsMultipartPayload(value);
+}
+
 void WebURLResponse::assign(WebURLResponsePrivate* p)
 {
     // Subclasses may call this directly so a self-assignment check is needed
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 97665d4..671a8c9 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -87,6 +87,7 @@
 #include "WebDevToolsAgentPrivate.h"
 #include "WebDragData.h"
 #include "WebFrameImpl.h"
+#include "WebImage.h"
 #include "WebInputEvent.h"
 #include "WebInputEventConversion.h"
 #include "WebMediaPlayerAction.h"
@@ -100,13 +101,11 @@
 #include "WebViewClient.h"
 
 #if OS(WINDOWS)
-#include "KeyboardCodesWin.h"
 #include "RenderThemeChromiumWin.h"
 #else
 #if OS(LINUX)
 #include "RenderThemeChromiumLinux.h"
 #endif
-#include "KeyboardCodesPosix.h"
 #include "RenderTheme.h"
 #endif
 
@@ -149,11 +148,7 @@
 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete);
 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery);
 
-// Note that focusOnShow is false so that the suggestions popup is shown not
-// activated.  We need the page to still have focus so the user can keep typing
-// while the popup is showing.
 static const PopupContainerSettings suggestionsPopupSettings = {
-    false,  // focusOnShow
     false,  // setTextOnIndexChange
     false,  // acceptOnAbandon
     true,   // loopSelectionNavigation
@@ -245,6 +240,11 @@
     , m_suggestionsPopup(0)
     , m_isTransparent(false)
     , m_tabsToLinks(false)
+    , m_haveMouseCapture(false)
+#if USE(ACCELERATED_COMPOSITING)
+    , m_layerRenderer(0)
+    , m_isAcceleratedCompositing(false)
+#endif
 {
     // WebKit/win/WebView.cpp does the same thing, except they call the
     // KJS specific wrapper around this method. We need to have threading
@@ -326,7 +326,12 @@
     if (!mainFrameImpl() || !mainFrameImpl()->frameView())
         return;
 
+    // If there is a select popup opened, close it as the user is clicking on
+    // the page (outside of the popup).
+    hideSelectPopup();
+
     m_lastMouseDownPoint = WebPoint(event.x, event.y);
+    m_haveMouseCapture = true;
 
     // If a text field that has focus is clicked again, we should display the
     // suggestions popup.
@@ -347,6 +352,8 @@
         }
     }
 
+    mainFrameImpl()->frame()->loader()->resetMultipleFormSubmissionProtection();
+
     mainFrameImpl()->frame()->eventHandler()->handleMousePressEvent(
         PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event));
 
@@ -439,7 +446,6 @@
     }
 #endif
 
-    mouseCaptureLost();
     mainFrameImpl()->frame()->eventHandler()->handleMouseReleaseEvent(
         PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event));
 
@@ -471,6 +477,10 @@
     // event.
     m_suppressNextKeypressEvent = false;
 
+    // Give any select popup a chance at consuming the key event.
+    if (selectPopupHandleKeyEvent(event))
+        return true;
+
     // Give Autocomplete a chance to consume the key events it is interested in.
     if (autocompleteHandleKeyEvent(event))
         return true;
@@ -507,14 +517,27 @@
     PlatformKeyboardEventBuilder evt(event);
 
     if (handler->keyEvent(evt)) {
-        if (WebInputEvent::RawKeyDown == event.type)
-            m_suppressNextKeypressEvent = true;
+        if (WebInputEvent::RawKeyDown == event.type) {
+            // Suppress the next keypress event unless the focused node is a plug-in node.
+            // (Flash needs these keypress events to handle non-US keyboards.)
+            Node* node = frame->document()->focusedNode();
+            if (!node || !node->renderer() || !node->renderer()->isEmbeddedObject())
+                m_suppressNextKeypressEvent = true;
+        }
         return true;
     }
 
     return keyEventDefault(event);
 }
 
+bool WebViewImpl::selectPopupHandleKeyEvent(const WebKeyboardEvent& event)
+{
+    if (!m_selectPopup)
+        return false;
+    
+    return m_selectPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event));
+}
+
 bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event)
 {
     if (!m_suggestionsPopupShowing
@@ -604,6 +627,17 @@
     return true;
 }
 
+#if ENABLE(TOUCH_EVENTS)
+bool WebViewImpl::touchEvent(const WebTouchEvent& event)
+{
+    if (!mainFrameImpl() || !mainFrameImpl()->frameView())
+        return false;
+
+    PlatformTouchEventBuilder touchEventBuilder(mainFrameImpl()->frameView(), event);
+    return mainFrameImpl()->frame()->eventHandler()->handleTouchEvent(touchEventBuilder);
+}
+#endif
+
 // The WebViewImpl::SendContextMenuEvent function is based on the Webkit
 // function
 // bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) in
@@ -774,6 +808,12 @@
     return propagateScroll(scrollDirection, scrollGranularity);
 }
 
+void WebViewImpl::hideSelectPopup()
+{
+    if (m_selectPopup.get())
+        m_selectPopup->hidePopup();
+}
+
 bool WebViewImpl::propagateScroll(ScrollDirection scrollDirection,
                                   ScrollGranularity scrollGranularity)
 {
@@ -793,6 +833,22 @@
     return scrollHandled;
 }
 
+void  WebViewImpl::popupOpened(WebCore::PopupContainer* popupContainer)
+{
+    if (popupContainer->popupType() == WebCore::PopupContainer::Select) {
+        ASSERT(!m_selectPopup);
+        m_selectPopup = popupContainer;
+    }
+}
+
+void  WebViewImpl::popupClosed(WebCore::PopupContainer* popupContainer)
+{
+    if (popupContainer->popupType() == WebCore::PopupContainer::Select) {
+        ASSERT(m_selectPopup.get());
+        m_selectPopup = 0;
+    }
+}
+
 Frame* WebViewImpl::focusedWebCoreFrame()
 {
     return m_page.get() ? m_page->focusController()->focusedOrMainFrame() : 0;
@@ -873,9 +929,26 @@
 
 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
 {
-    WebFrameImpl* webframe = mainFrameImpl();
-    if (webframe)
-        webframe->paint(canvas, rect);
+
+#if USE(ACCELERATED_COMPOSITING)
+    if (!isAcceleratedCompositing()) {
+#endif
+        WebFrameImpl* webframe = mainFrameImpl();
+        if (webframe)
+            webframe->paint(canvas, rect);
+#if USE(ACCELERATED_COMPOSITING)
+    } else {
+        // Draw the contents of the root layer.
+        updateRootLayerContents(rect);
+
+        // Composite everything into the canvas that's passed to us.
+#if PLATFORM(SKIA)
+        m_layerRenderer->drawLayersInCanvas(static_cast<skia::PlatformCanvas*>(canvas), IntRect(rect));
+#elif PLATFORM(CG)
+#error "Need to implement CG version"
+#endif
+    }
+#endif
 }
 
 // FIXME: m_currentInputEvent should be removed once ChromeClient::show() can
@@ -892,6 +965,38 @@
     if (m_ignoreInputEvents)
         return true;
 
+    if (m_haveMouseCapture && WebInputEvent::isMouseEventType(inputEvent.type)) {
+        // Not all platforms call mouseCaptureLost() directly.
+        if (inputEvent.type == WebInputEvent::MouseUp)
+            mouseCaptureLost();
+
+        Node* node = focusedWebCoreNode();
+        if (node && node->renderer() && node->renderer()->isEmbeddedObject()) {
+            AtomicString eventType;
+            switch (inputEvent.type) {
+            case WebInputEvent::MouseMove:
+                eventType = eventNames().mousemoveEvent;
+                break;
+            case WebInputEvent::MouseLeave:
+                eventType = eventNames().mouseoutEvent;
+                break;
+            case WebInputEvent::MouseDown:
+                eventType = eventNames().mousedownEvent;
+                break;
+            case WebInputEvent::MouseUp:
+                eventType = eventNames().mouseupEvent;
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+
+            node->dispatchMouseEvent(
+                  PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)),
+                  eventType);
+            return true;
+        }
+    }
+
     // FIXME: Remove m_currentInputEvent.
     // This only exists to allow ChromeClient::show() to know which mouse button
     // triggered a window.open event.
@@ -936,6 +1041,15 @@
         handled = charEvent(*static_cast<const WebKeyboardEvent*>(&inputEvent));
         break;
 
+#if ENABLE(TOUCH_EVENTS)
+    case WebInputEvent::TouchStart:
+    case WebInputEvent::TouchMove:
+    case WebInputEvent::TouchEnd:
+    case WebInputEvent::TouchCancel:
+        handled = touchEvent(*static_cast<const WebTouchEvent*>(&inputEvent));
+        break;
+#endif
+
     default:
         handled = false;
     }
@@ -947,6 +1061,7 @@
 
 void WebViewImpl::mouseCaptureLost()
 {
+    m_haveMouseCapture = false;
 }
 
 void WebViewImpl::setFocus(bool enable)
@@ -982,6 +1097,7 @@
         m_imeAcceptEvents = true;
     } else {
         hideSuggestionsPopup();
+        hideSelectPopup();
 
         // Clear focus on the currently focused frame if any.
         if (!m_page.get())
@@ -1166,7 +1282,7 @@
     if (!m_page.get())
         return WebString();
 
-    return m_page->mainFrame()->loader()->encoding();
+    return m_page->mainFrame()->loader()->writer()->encoding();
 }
 
 void WebViewImpl::setPageEncoding(const WebString& encodingName)
@@ -1302,7 +1418,7 @@
     Frame* frame = mainFrameImpl()->frame();
     if (zoomFactor != frame->zoomFactor()) {
         m_zoomLevel = zoomLevel;
-        frame->setZoomFactor(zoomFactor, textOnly);
+        frame->setZoomFactor(zoomFactor, textOnly ? ZoomTextOnly : ZoomPage);
     }
     return m_zoomLevel;
 }
@@ -1331,6 +1447,9 @@
     case WebMediaPlayerAction::Loop:
         mediaElement->setLoop(action.enable);
         break;
+    case WebMediaPlayerAction::Controls:
+        mediaElement->setControls(action.enable);
+        break;
     default:
         ASSERT_NOT_REACHED();
     }
@@ -1392,26 +1511,7 @@
     m_dragIdentity = identity;
     m_operationsAllowed = operationsAllowed;
 
-    DragData dragData(
-        m_currentDragData.get(),
-        clientPoint,
-        screenPoint,
-        static_cast<DragOperation>(operationsAllowed));
-
-    m_dropEffect = DropEffectDefault;
-    m_dragTargetDispatch = true;
-    DragOperation effect = m_page->dragController()->dragEntered(&dragData);
-    // Mask the operation against the drag source's allowed operations.
-    if ((effect & dragData.draggingSourceOperationMask()) != effect)
-        effect = DragOperationNone;
-    m_dragTargetDispatch = false;
-
-    if (m_dropEffect != DropEffectDefault) {
-        m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy
-                                                           : WebDragOperationNone;
-    } else
-        m_dragOperation = static_cast<WebDragOperation>(effect);
-    return m_dragOperation;
+    return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter);
 }
 
 WebDragOperation WebViewImpl::dragTargetDragOver(
@@ -1419,29 +1519,9 @@
     const WebPoint& screenPoint,
     WebDragOperationsMask operationsAllowed)
 {
-    ASSERT(m_currentDragData.get());
-
     m_operationsAllowed = operationsAllowed;
-    DragData dragData(
-        m_currentDragData.get(),
-        clientPoint,
-        screenPoint,
-        static_cast<DragOperation>(operationsAllowed));
 
-    m_dropEffect = DropEffectDefault;
-    m_dragTargetDispatch = true;
-    DragOperation effect = m_page->dragController()->dragUpdated(&dragData);
-    // Mask the operation against the drag source's allowed operations.
-    if ((effect & dragData.draggingSourceOperationMask()) != effect)
-        effect = DragOperationNone;
-    m_dragTargetDispatch = false;
-
-    if (m_dropEffect != DropEffectDefault) {
-        m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy
-                                                           : WebDragOperationNone;
-    } else
-        m_dragOperation = static_cast<WebDragOperation>(effect);
-    return m_dragOperation;
+    return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver);
 }
 
 void WebViewImpl::dragTargetDragLeave()
@@ -1504,7 +1584,36 @@
     return 0;
 }
 
-unsigned long WebViewImpl::createUniqueIdentifierForRequest() {
+WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction)
+{
+    ASSERT(m_currentDragData.get());
+
+    DragData dragData(
+        m_currentDragData.get(),
+        clientPoint,
+        screenPoint,
+        static_cast<DragOperation>(m_operationsAllowed));
+
+    m_dropEffect = DropEffectDefault;
+    m_dragTargetDispatch = true;
+    DragOperation effect = dragAction == DragEnter ? m_page->dragController()->dragEntered(&dragData)
+                                                   : m_page->dragController()->dragUpdated(&dragData);
+    // Mask the operation against the drag source's allowed operations.
+    if (!(effect & dragData.draggingSourceOperationMask()))
+        effect = DragOperationNone;
+    m_dragTargetDispatch = false;
+
+    if (m_dropEffect != DropEffectDefault) {
+        m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy
+                                                           : WebDragOperationNone;
+    } else
+        m_dragOperation = static_cast<WebDragOperation>(effect);
+
+    return m_dragOperation;
+}
+
+unsigned long WebViewImpl::createUniqueIdentifierForRequest()
+{
     if (m_page)
         return m_page->progress()->createUniqueIdentifier();
     return 0;
@@ -1607,6 +1716,7 @@
 
     if (!m_autoFillPopup.get()) {
         m_autoFillPopup = PopupContainer::create(m_suggestionsPopupClient,
+                                                 PopupContainer::Suggestion,
                                                  suggestionsPopupSettings);
     }
 
@@ -1662,6 +1772,7 @@
 
     if (!m_autocompletePopup.get()) {
         m_autocompletePopup = PopupContainer::create(m_suggestionsPopupClient,
+                                                     PopupContainer::Suggestion,
                                                      suggestionsPopupSettings);
     }
 
@@ -1775,6 +1886,13 @@
                                     runAtStart ? InjectAtDocumentStart : InjectAtDocumentEnd);
 }
 
+void WebViewImpl::addUserStyleSheet(const WebString& sourceCode)
+{
+    PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
+    RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create());
+    pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), 0, 0);
+}
+
 void WebViewImpl::removeAllUserContent()
 {
     PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
@@ -1799,7 +1917,7 @@
                                                  bool alt, bool meta,
                                                  WebNavigationPolicy* policy)
 {
-#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD)
+#if OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)
     const bool newTabModifier = (button == 1) || ctrl;
 #elif OS(DARWIN)
     const bool newTabModifier = (button == 1) || meta;
@@ -1822,15 +1940,16 @@
     return true;
 }
 
-void WebViewImpl::startDragging(const WebPoint& eventPos,
-                                const WebDragData& dragData,
-                                WebDragOperationsMask mask)
+void WebViewImpl::startDragging(const WebDragData& dragData,
+                                WebDragOperationsMask mask,
+                                const WebImage& dragImage,
+                                const WebPoint& dragImageOffset)
 {
     if (!m_client)
         return;
     ASSERT(!m_doingDragAndDrop);
     m_doingDragAndDrop = true;
-    m_client->startDragging(eventPos, dragData, mask);
+    m_client->startDragging(dragData, mask, dragImage, dragImageOffset);
 }
 
 void WebViewImpl::setCurrentHistoryItem(HistoryItem* item)
@@ -1916,4 +2035,76 @@
     return m_tabsToLinks;
 }
 
+#if USE(ACCELERATED_COMPOSITING)
+void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer)
+{
+    setAcceleratedCompositing(layer ? true : false);
+    if (m_layerRenderer)
+        m_layerRenderer->setRootLayer(layer);
+}
+
+void WebViewImpl::setAcceleratedCompositing(bool accelerated)
+{
+    if (m_isAcceleratedCompositing == accelerated)
+        return;
+
+    if (accelerated) {
+        m_layerRenderer = LayerRendererChromium::create();
+        if (m_layerRenderer)
+            m_isAcceleratedCompositing = true;
+    } else {
+        m_layerRenderer = 0;
+        m_isAcceleratedCompositing = false;
+    }
+}
+
+void WebViewImpl::updateRootLayerContents(const WebRect& rect)
+{
+    if (!isAcceleratedCompositing())
+        return;
+
+    WebFrameImpl* webframe = mainFrameImpl();
+    if (!webframe)
+        return;
+    FrameView* view = webframe->frameView();
+    if (!view)
+        return;
+
+    WebRect viewRect = view->frameRect();
+    SkIRect scrollFrame;
+    scrollFrame.set(view->scrollX(), view->scrollY(), view->layoutWidth() + view->scrollX(), view->layoutHeight() + view->scrollY());
+    m_layerRenderer->setScrollFrame(scrollFrame);
+    LayerChromium* rootLayer = m_layerRenderer->rootLayer();
+    if (rootLayer) {
+        IntRect visibleRect = view->visibleContentRect(true);
+
+        // Set the backing store size used by the root layer to be the size of the visible
+        // area. Note that the root layer bounds could be larger than the backing store size,
+        // but there's no reason to waste memory by allocating backing store larger than the
+        // visible portion.
+        rootLayer->setBackingStoreRect(IntSize(visibleRect.width(), visibleRect.height()));
+        GraphicsContext* rootLayerContext = rootLayer->graphicsContext();
+        rootLayerContext->save();
+
+        webframe->paintWithContext(*(rootLayer->graphicsContext()), rect);
+        rootLayerContext->restore();
+    }
+}
+
+void WebViewImpl::setRootLayerNeedsDisplay()
+{
+    // FIXME: For now we're posting a repaint event for the entire page which is an overkill.
+    if (WebFrameImpl* webframe = mainFrameImpl()) {
+        if (FrameView* view = webframe->frameView()) {
+            IntRect visibleRect = view->visibleContentRect(true);
+            m_client->didInvalidateRect(visibleRect);
+        }
+    }
+
+    if (m_layerRenderer)
+        m_layerRenderer->setNeedsDisplay();
+}
+
+#endif
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 286ac43..ba2dc25 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -43,7 +43,9 @@
 #include "ContextMenuClientImpl.h"
 #include "DragClientImpl.h"
 #include "EditorClientImpl.h"
+#include "GraphicsLayer.h"
 #include "InspectorClientImpl.h"
+#include "LayerRendererChromium.h"
 #include "NotificationPresenterImpl.h"
 
 #include <wtf/OwnPtr.h>
@@ -72,10 +74,12 @@
 class WebAccessibilityObject;
 class WebDevToolsAgentPrivate;
 class WebFrameImpl;
+class WebImage;
 class WebKeyboardEvent;
 class WebMouseEvent;
 class WebMouseWheelEvent;
 class WebSettingsImpl;
+class WebTouchEvent;
 
 class WebViewImpl : public WebView, public RefCounted<WebViewImpl> {
 public:
@@ -177,6 +181,7 @@
     virtual void performCustomContextMenuAction(unsigned action);
     virtual void addUserScript(const WebString& sourceCode,
                                bool runAtStart);
+    virtual void addUserStyleSheet(const WebString& sourceCode);
     virtual void removeAllUserContent();
 
     // WebViewImpl
@@ -201,7 +206,7 @@
         return m_client;
     }
 
-    // Returns the page object associated with this view.  This may be null when
+    // Returns the page object associated with this view. This may be null when
     // the page is shutting down, but will be valid at all other times.
     WebCore::Page* page() const
     {
@@ -210,7 +215,7 @@
 
     WebCore::RenderTheme* theme() const;
 
-    // Returns the main frame associated with this view.  This may be null when
+    // Returns the main frame associated with this view. This may be null when
     // the page is shutting down, but will be valid at all other times.
     WebFrameImpl* mainFrameImpl();
 
@@ -229,16 +234,17 @@
     void mouseWheel(const WebMouseWheelEvent&);
     bool keyEvent(const WebKeyboardEvent&);
     bool charEvent(const WebKeyboardEvent&);
+    bool touchEvent(const WebTouchEvent&);
 
     // Handles context menu events orignated via the the keyboard. These
-    // include the VK_APPS virtual key and the Shift+F10 combine.  Code is
+    // include the VK_APPS virtual key and the Shift+F10 combine. Code is
     // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM
     // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only
     // significant change in this function is the code to convert from a
     // Keyboard event to the Right Mouse button down event.
     bool sendContextMenuEvent(const WebKeyboardEvent&);
 
-    // Notifies the WebView that a load has been committed.  isNewNavigation
+    // Notifies the WebView that a load has been committed. isNewNavigation
     // will be true if a new session history item should be created for that
     // load.
     void didCommitLoad(bool* isNewNavigation);
@@ -270,9 +276,10 @@
 
     // Start a system drag and drop operation.
     void startDragging(
-        const WebPoint& eventPos,
         const WebDragData& dragData,
-        WebDragOperationsMask dragSourceOperationMask);
+        WebDragOperationsMask mask,
+        const WebImage& dragImage,
+        const WebPoint& dragImageOffset);
 
     void suggestionsPopupDidHide()
     {
@@ -288,6 +295,10 @@
     // was scrolled.
     bool propagateScroll(WebCore::ScrollDirection, WebCore::ScrollGranularity);
 
+    // Notification that a popup was opened/closed.
+    void popupOpened(WebCore::PopupContainer* popupContainer);
+    void popupClosed(WebCore::PopupContainer* popupContainer);
+
     // HACK: currentInputEvent() is for ChromeClientImpl::show(), until we can
     // fix WebKit to pass enough information up into ChromeClient::show() so we
     // can decide if the window.open event was caused by a middle-mouse click
@@ -296,31 +307,62 @@
         return m_currentInputEvent;
     }
 
+#if USE(ACCELERATED_COMPOSITING)
+    void setRootLayerNeedsDisplay();
+    void setRootGraphicsLayer(WebCore::PlatformLayer*);
+#endif
+
+    WebCore::PopupContainer* selectPopup() const { return m_selectPopup.get(); }
+
 private:
     friend class WebView;  // So WebView::Create can call our constructor
     friend class WTF::RefCounted<WebViewImpl>;
 
+    enum DragAction {
+      DragEnter,
+      DragOver
+    };
+
     WebViewImpl(WebViewClient* client);
     ~WebViewImpl();
 
     // Returns true if the event was actually processed.
     bool keyEventDefault(const WebKeyboardEvent&);
 
+    // Returns true if the select popup has consumed the event.
+    bool selectPopupHandleKeyEvent(const WebKeyboardEvent&);
+
     // Returns true if the autocomple has consumed the event.
     bool autocompleteHandleKeyEvent(const WebKeyboardEvent&);
 
-    // Repaints the suggestions popup.  Should be called when the suggestions
-    // have changed.  Note that this should only be called when the suggestions
+    // Repaints the suggestions popup. Should be called when the suggestions
+    // have changed. Note that this should only be called when the suggestions
     // popup is showing.
     void refreshSuggestionsPopup();
 
     // Returns true if the view was scrolled.
     bool scrollViewWithKeyboard(int keyCode, int modifiers);
 
+    // Hides the select popup if one is opened.
+    void hideSelectPopup();
+
     // Converts |pos| from window coordinates to contents coordinates and gets
     // the HitTestResult for it.
     WebCore::HitTestResult hitTestResultForWindowPos(const WebCore::IntPoint&);
 
+    // Consolidate some common code between starting a drag over a target and
+    // updating a drag over a target. If we're starting a drag, |isEntering|
+    // should be true.
+    WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint,
+                                               const WebPoint& screenPoint,
+                                               DragAction);
+
+#if USE(ACCELERATED_COMPOSITING)
+    void setAcceleratedCompositing(bool);
+    bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; }
+    void updateRootLayerContents(const WebRect&);
+#endif
+
     WebViewClient* m_client;
 
     BackForwardListClientImpl m_backForwardListClientImpl;
@@ -335,7 +377,7 @@
     WebPoint m_lastMousePosition;
     OwnPtr<WebCore::Page> m_page;
 
-    // This flag is set when a new navigation is detected.  It is used to satisfy
+    // This flag is set when a new navigation is detected. It is used to satisfy
     // the corresponding argument to WebFrameClient::didCommitProvisionalLoad.
     bool m_observedNewNavigation;
 #ifndef NDEBUG
@@ -345,7 +387,7 @@
 #endif
 
     // An object that can be used to manipulate m_page->settings() without linking
-    // against WebCore.  This is lazily allocated the first time GetWebSettings()
+    // against WebCore. This is lazily allocated the first time GetWebSettings()
     // is called.
     OwnPtr<WebSettingsImpl> m_webSettings;
 
@@ -361,7 +403,7 @@
     // dragged by the time a drag is initiated.
     WebPoint m_lastMouseDownPoint;
 
-    // Keeps track of the current zoom level.  0 means no zoom, positive numbers
+    // Keeps track of the current zoom level. 0 means no zoom, positive numbers
     // mean zoom in, negative numbers mean zoom out.
     int m_zoomLevel;
 
@@ -391,7 +433,7 @@
     // copied from the WebDropData object sent from the browser process.
     int m_dragIdentity;
 
-    // Valid when m_dragTargetDispatch is true.  Used to override the default
+    // Valid when m_dragTargetDispatch is true. Used to override the default
     // browser drop effect with the effects "none" or "copy".
     enum DragTargetDropEffect {
         DropEffectDefault = -1,
@@ -410,8 +452,8 @@
     // Whether a suggestions popup is currently showing.
     bool m_suggestionsPopupShowing;
 
-    // A pointer to the current suggestions popup menu client.  This can be
-    // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient.  We
+    // A pointer to the current suggestions popup menu client. This can be
+    // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient. We
     // do not own this pointer.
     SuggestionsPopupMenuClient* m_suggestionsPopupClient;
 
@@ -421,9 +463,12 @@
     // The Autocomplete popup client.
     OwnPtr<AutocompletePopupMenuClient> m_autocompletePopupClient;
 
-    // A pointer to the current suggestions popup.  We do not own this pointer.
+    // A pointer to the current suggestions popup. We do not own this pointer.
     WebCore::PopupContainer* m_suggestionsPopup;
 
+    // The popup associated with a select element.
+    RefPtr<WebCore::PopupContainer> m_selectPopup;
+
     // The AutoFill suggestions popup.
     RefPtr<WebCore::PopupContainer> m_autoFillPopup;
 
@@ -446,6 +491,12 @@
     NotificationPresenterImpl m_notificationPresenter;
 #endif
 
+    bool m_haveMouseCapture;
+
+#if USE(ACCELERATED_COMPOSITING)
+    OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer;
+    bool m_isAcceleratedCompositing;
+#endif
     static const WebInputEvent* m_currentInputEvent;
 };
 
diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp
index 40019e8..da51414 100644
--- a/WebKit/chromium/src/WebWorkerBase.cpp
+++ b/WebKit/chromium/src/WebWorkerBase.cpp
@@ -199,8 +199,7 @@
                                                          sourceURL);
 }
 
-void WebWorkerBase::postConsoleMessageToWorkerObject(MessageDestination destination,
-                                                     MessageSource source,
+void WebWorkerBase::postConsoleMessageToWorkerObject(MessageSource source,
                                                      MessageType type,
                                                      MessageLevel level,
                                                      const String& message,
@@ -208,16 +207,13 @@
                                                      const String& sourceURL)
 {
     dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, this,
-                                                static_cast<int>(destination),
-                                                static_cast<int>(source),
-                                                static_cast<int>(type),
-                                                static_cast<int>(level),
+                                                source, type, level,
                                                 message, lineNumber, sourceURL));
 }
 
 void WebWorkerBase::postConsoleMessageTask(ScriptExecutionContext* context,
                                            WebWorkerBase* thisPtr,
-                                           int destination, int source,
+                                           int source,
                                            int type, int level,
                                            const String& message,
                                            int lineNumber,
@@ -225,7 +221,7 @@
 {
     if (!thisPtr->commonClient())
         return;
-    thisPtr->commonClient()->postConsoleMessageToWorkerObject(destination, source,
+    thisPtr->commonClient()->postConsoleMessageToWorkerObject(source,
                                                               type, level, message,
                                                               lineNumber, sourceURL);
 }
diff --git a/WebKit/chromium/src/WebWorkerBase.h b/WebKit/chromium/src/WebWorkerBase.h
index 0217401..1252770 100644
--- a/WebKit/chromium/src/WebWorkerBase.h
+++ b/WebKit/chromium/src/WebWorkerBase.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * 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
@@ -45,8 +45,11 @@
 
 namespace WebKit {
 class WebCommonWorkerClient;
+class WebSecurityOrigin;
+class WebString;
 class WebURL;
 class WebView;
+class WebWorker;
 class WebWorkerClient;
 
 // Base class for WebSharedWorkerImpl and WebWorkerImpl. It contains common
@@ -65,7 +68,7 @@
     virtual void postExceptionToWorkerObject(
         const WebCore::String&, int, const WebCore::String&);
     virtual void postConsoleMessageToWorkerObject(
-        WebCore::MessageDestination, WebCore::MessageSource, WebCore::MessageType,
+        WebCore::MessageSource, WebCore::MessageType,
         WebCore::MessageLevel, const WebCore::String&, int, const WebCore::String&);
     virtual void confirmMessageFromWorkerObject(bool);
     virtual void reportPendingActivity(bool);
@@ -112,7 +115,6 @@
     static void postConsoleMessageTask(
         WebCore::ScriptExecutionContext* context,
         WebWorkerBase* thisPtr,
-        int destination,
         int source,
         int type,
         int level,
diff --git a/WebKit/chromium/src/WebWorkerClientImpl.cpp b/WebKit/chromium/src/WebWorkerClientImpl.cpp
index 598a078..d0dda8e 100644
--- a/WebKit/chromium/src/WebWorkerClientImpl.cpp
+++ b/WebKit/chromium/src/WebWorkerClientImpl.cpp
@@ -45,6 +45,7 @@
 #include "Worker.h"
 #include "WorkerContext.h"
 #include "WorkerContextExecutionProxy.h"
+#include "WorkerScriptController.h"
 #include "WorkerMessagingProxy.h"
 #include <wtf/Threading.h>
 
@@ -94,15 +95,13 @@
         WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
         webWorker = webFrame->client()->createWorker(webFrame, proxy);
     } else {
-        WorkerContextExecutionProxy* currentContext =
-        WorkerContextExecutionProxy::retrieve();
-        if (!currentContext) {
+        WorkerScriptController* controller = WorkerScriptController::controllerForContext();
+        if (!controller) {
             ASSERT_NOT_REACHED();
             return 0;
         }
 
-        DedicatedWorkerThread* thread =
-        static_cast<DedicatedWorkerThread*>(currentContext->workerContext()->thread());
+        DedicatedWorkerThread* thread = static_cast<DedicatedWorkerThread*>(controller->workerContext()->thread());
         WorkerObjectProxy* workerObjectProxy = &thread->workerObjectProxy();
         WebWorkerImpl* impl = reinterpret_cast<WebWorkerImpl*>(workerObjectProxy);
         webWorker = impl->client()->createWorker(proxy);
@@ -244,15 +243,14 @@
         return;
     }
 
-    bool handled = false;
-    handled = m_worker->dispatchEvent(ErrorEvent::create(errorMessage,
-                                                         sourceURL,
-                                                         lineNumber));
-    if (!handled)
+    bool unhandled = m_worker->dispatchEvent(ErrorEvent::create(errorMessage,
+                                                                sourceURL,
+                                                                lineNumber));
+    if (unhandled)
         m_scriptExecutionContext->reportException(errorMessage, lineNumber, sourceURL);
 }
 
-void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destinationId,
+void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int destination,
                                                            int sourceId,
                                                            int messageType,
                                                            int messageLevel,
@@ -263,7 +261,6 @@
     if (currentThread() != m_workerThreadId) {
         m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageToWorkerObjectTask,
                                                               this,
-                                                              destinationId,
                                                               sourceId,
                                                               messageType,
                                                               messageLevel,
@@ -273,14 +270,23 @@
         return;
     }
 
-    m_scriptExecutionContext->addMessage(static_cast<MessageDestination>(destinationId),
-                                         static_cast<MessageSource>(sourceId),
+    m_scriptExecutionContext->addMessage(static_cast<MessageSource>(sourceId),
                                          static_cast<MessageType>(messageType),
                                          static_cast<MessageLevel>(messageLevel),
                                          String(message), lineNumber,
                                          String(sourceURL));
 }
 
+void WebWorkerClientImpl::postConsoleMessageToWorkerObject(int sourceId,
+                                                           int messageType,
+                                                           int messageLevel,
+                                                           const WebString& message,
+                                                           int lineNumber,
+                                                           const WebString& sourceURL)
+{
+    postConsoleMessageToWorkerObject(0, sourceId, messageType, messageLevel, message, lineNumber, sourceURL);
+}
+
 void WebWorkerClientImpl::confirmMessageFromWorkerObject(bool hasPendingActivity)
 {
     // unconfirmed_message_count_ can only be updated on the thread where it's
@@ -382,7 +388,6 @@
 
 void WebWorkerClientImpl::postConsoleMessageToWorkerObjectTask(ScriptExecutionContext* context,
                                                                WebWorkerClientImpl* thisPtr,
-                                                               int destinationId,
                                                                int sourceId,
                                                                int messageType,
                                                                int messageLevel,
@@ -390,8 +395,7 @@
                                                                int lineNumber,
                                                                const String& sourceURL)
 {
-    thisPtr->m_scriptExecutionContext->addMessage(static_cast<MessageDestination>(destinationId),
-                                                  static_cast<MessageSource>(sourceId),
+    thisPtr->m_scriptExecutionContext->addMessage(static_cast<MessageSource>(sourceId),
                                                   static_cast<MessageType>(messageType),
                                                   static_cast<MessageLevel>(messageLevel),
                                                   message, lineNumber,
diff --git a/WebKit/chromium/src/WebWorkerClientImpl.h b/WebKit/chromium/src/WebWorkerClientImpl.h
index 63acebc..4bdc332 100644
--- a/WebKit/chromium/src/WebWorkerClientImpl.h
+++ b/WebKit/chromium/src/WebWorkerClientImpl.h
@@ -78,8 +78,12 @@
     // These are called on the main WebKit thread.
     virtual void postMessageToWorkerObject(const WebString&, const WebMessagePortChannelArray&);
     virtual void postExceptionToWorkerObject(const WebString&, int, const WebString&);
-    virtual void postConsoleMessageToWorkerObject(int, int, int, int, const WebString&,
-                                                  int, const WebString&);
+
+    // FIXME: the below is for compatibility only and should be     
+    // removed once Chromium is updated to remove message 
+    // destination parameter <http://webkit.org/b/37155>.
+    virtual void postConsoleMessageToWorkerObject(int, int, int, int, const WebString&, int, const WebString&);
+    virtual void postConsoleMessageToWorkerObject(int, int, int, const WebString&, int, const WebString&);
     virtual void confirmMessageFromWorkerObject(bool);
     virtual void reportPendingActivity(bool);
     virtual void workerContextClosed();
@@ -125,7 +129,6 @@
                                                 const WebCore::String& sourceURL);
     static void postConsoleMessageToWorkerObjectTask(WebCore::ScriptExecutionContext* context,
                                                      WebWorkerClientImpl* thisPtr,
-                                                     int destinationId,
                                                      int sourceId,
                                                      int messageType,
                                                      int messageLevel,
diff --git a/WebKit/chromium/src/gtk/WebFontInfo.cpp b/WebKit/chromium/src/gtk/WebFontInfo.cpp
index 76ed618..3ac0b00 100644
--- a/WebKit/chromium/src/gtk/WebFontInfo.cpp
+++ b/WebKit/chromium/src/gtk/WebFontInfo.cpp
@@ -30,6 +30,7 @@
 
 #include "config.h"
 #include "WebFontInfo.h"
+#include "WebFontRenderStyle.h"
 
 #include <fontconfig/fontconfig.h>
 #include <string.h>
@@ -55,11 +56,11 @@
     FcValue fcvalue;
     fcvalue.type = FcTypeCharSet;
     fcvalue.u.c = cset;
-    FcPatternAdd(pattern, FC_CHARSET, fcvalue, 0);
+    FcPatternAdd(pattern, FC_CHARSET, fcvalue, FcFalse);
 
     fcvalue.type = FcTypeBool;
     fcvalue.u.b = FcTrue;
-    FcPatternAdd(pattern, FC_SCALABLE, fcvalue, 0);
+    FcPatternAdd(pattern, FC_SCALABLE, fcvalue, FcFalse);
 
     FcConfigSubstitute(0, pattern, FcMatchPattern);
     FcDefaultSubstitute(pattern);
@@ -104,4 +105,68 @@
     return WebCString();
 }
 
+void WebFontInfo::renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* out)
+{
+    bool isBold = sizeAndStyle & 1;
+    bool isItalic = sizeAndStyle & 2;
+    int pixelSize = sizeAndStyle >> 2;
+
+    FcPattern* pattern = FcPatternCreate();
+    FcValue fcvalue;
+
+    fcvalue.type = FcTypeString;
+    fcvalue.u.s = reinterpret_cast<const FcChar8 *>(family);
+    FcPatternAdd(pattern, FC_FAMILY, fcvalue, FcFalse);
+
+    fcvalue.type = FcTypeInteger;
+    fcvalue.u.i = isBold ? FC_WEIGHT_BOLD : FC_WEIGHT_NORMAL;
+    FcPatternAdd(pattern, FC_WEIGHT, fcvalue, FcFalse);
+
+    fcvalue.type = FcTypeInteger;
+    fcvalue.u.i = isItalic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN;
+    FcPatternAdd(pattern, FC_SLANT, fcvalue, FcFalse);
+
+    fcvalue.type = FcTypeBool;
+    fcvalue.u.b = FcTrue;
+    FcPatternAdd(pattern, FC_SCALABLE, fcvalue, FcFalse);
+
+    fcvalue.type = FcTypeDouble;
+    fcvalue.u.d = pixelSize;
+    FcPatternAdd(pattern, FC_SIZE, fcvalue, FcFalse);
+
+    FcConfigSubstitute(0, pattern, FcMatchPattern);
+    FcDefaultSubstitute(pattern);
+
+    FcResult result;
+    // Some versions of fontconfig don't actually write a value into result.
+    // However, it's not clear from the documentation if result should be a
+    // non-0 pointer: future versions might expect to be able to write to
+    // it. So we pass in a valid pointer and ignore it.
+    FcPattern* match = FcFontMatch(0, pattern, &result);
+    FcPatternDestroy(pattern);
+
+    out->setDefaults();
+
+    if (!match) {
+        FcPatternDestroy(match);
+        return;
+    }
+
+    FcBool b;
+    int i;
+
+    if (FcPatternGetBool(match, FC_ANTIALIAS, 0, &b) == FcResultMatch)
+        out->useAntiAlias = b;
+    if (FcPatternGetBool(match, FC_EMBEDDED_BITMAP, 0, &b) == FcResultMatch)
+        out->useBitmaps = b;
+    if (FcPatternGetBool(match, FC_AUTOHINT, 0, &b) == FcResultMatch)
+        out->useAutoHint = b;
+    if (FcPatternGetBool(match, FC_HINTING, 0, &b) == FcResultMatch)
+        out->useHinting = b;
+    if (FcPatternGetInteger(match, FC_HINT_STYLE, 0, &i) == FcResultMatch)
+        out->hintStyle = i;
+
+    FcPatternDestroy(match);
+}
+
 } // namespace WebKit
diff --git a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
index 7125a16..f4db5ee 100644
--- a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
+++ b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
@@ -49,7 +49,7 @@
 {
     static GtkSettings* settings = gtk_settings_get_default();
     gint doubleClickTime = 250;
-    g_object_get(G_OBJECT(settings), "gtk-double-click-time", &doubleClickTime, 0);
+    g_object_get(G_OBJECT(settings), "gtk-double-click-time", &doubleClickTime, NULL);
     return doubleClickTime;
 }
 
diff --git a/WebKit/chromium/src/js/DebuggerAgent.js b/WebKit/chromium/src/js/DebuggerAgent.js
index bb655c7..8230616 100644
--- a/WebKit/chromium/src/js/DebuggerAgent.js
+++ b/WebKit/chromium/src/js/DebuggerAgent.js
@@ -117,12 +117,17 @@
      */
     this.urlToBreakpoints_ = {};
 
-
     /**
      * Exception message that is shown to user while on exception break.
      * @type {WebInspector.ConsoleMessage}
      */
     this.currentExceptionMessage_ = null;
+
+    /**
+     * Whether breakpoints should suspend execution.
+     * @type {boolean}
+     */
+    this.breakpointsActivated_ = true;
 };
 
 
@@ -176,7 +181,7 @@
         // pending addition into the UI.
         for (var scriptId in this.parsedScripts_) {
           var script = this.parsedScripts_[scriptId];
-          WebInspector.parsedScriptSource(scriptId, script.getUrl(), undefined /* script source */, script.getLineOffset());
+          WebInspector.parsedScriptSource(scriptId, script.getUrl(), undefined /* script source */, script.getLineOffset() + 1);
         }
         return;
     }
@@ -210,11 +215,14 @@
     // Force v8 execution so that it gets to processing the requested command.
     RemoteDebuggerAgent.processDebugCommands();
 
+    var self = this;
     this.requestSeqToCallback_[cmd.getSequenceNumber()] = function(msg) {
         if (msg.isSuccess()) {
             var scriptJson = msg.getBody()[0];
-            if (scriptJson)
+            if (scriptJson) {
+                script.source = scriptJson.source;
                 callback(scriptJson.source);
+            }
             else
                 callback(null);
         } else
@@ -295,6 +303,36 @@
 
 
 /**
+ * Changes given line of the script. 
+ */
+devtools.DebuggerAgent.prototype.editScriptLine = function(sourceId, line, newContent, callback)
+{
+    var script = this.parsedScripts_[sourceId];
+    if (!script || !script.source)
+        return;
+
+    var lines = script.source.split("\n");
+    lines[line] = newContent;
+
+    var commandArguments = {
+        "script_id": sourceId,
+        "new_source": lines.join("\n")
+    };
+
+    var cmd = new devtools.DebugCommand("changelive", commandArguments);
+    devtools.DebuggerAgent.sendCommand_(cmd);
+    this.requestSeqToCallback_[cmd.getSequenceNumber()] = function(msg) {
+        if (!msg.isSuccess())
+            WebInspector.log("Unable to modify source code within given scope. Only function bodies are editable at the moment.", WebInspector.ConsoleMessage.MessageLevel.Warning);
+        this.resolveScriptSource(sourceId, callback);
+        if (WebInspector.panels.scripts.paused)
+            this.requestBacktrace_();
+    }.bind(this);
+    RemoteDebuggerAgent.processDebugCommands();
+};
+
+
+/**
  * @param {number} sourceId Id of the script for the breakpoint.
  * @param {number} line Number of the line for the breakpoint.
  */
@@ -309,6 +347,8 @@
     var breakpointInfo;
     if (script.getUrl()) {
         var breakpoints = this.urlToBreakpoints_[script.getUrl()];
+        if (!breakpoints)
+            return;
         breakpointInfo = breakpoints[line];
         delete breakpoints[line];
     } else {
@@ -334,34 +374,11 @@
 
 
 /**
- * @param {number} sourceId Id of the script for the breakpoint.
- * @param {number} line Number of the line for the breakpoint.
- * @param {?string} condition New breakpoint condition.
+ * @param {boolean} activated Whether breakpoints should be activated.
  */
-devtools.DebuggerAgent.prototype.updateBreakpoint = function(sourceId, line, condition)
+devtools.DebuggerAgent.prototype.setBreakpointsActivated = function(activated)
 {
-    var script = this.parsedScripts_[sourceId];
-    if (!script)
-        return;
-
-    line = devtools.DebuggerAgent.webkitToV8LineNumber_(line);
-
-    var breakpointInfo;
-    if (script.getUrl()) {
-        var breakpoints = this.urlToBreakpoints_[script.getUrl()];
-        breakpointInfo = breakpoints[line];
-    } else
-        breakpointInfo = script.getBreakpointInfo(line);
-
-    var id = breakpointInfo.getV8Id();
-
-    // If we don't know id of this breakpoint in the v8 debugger we cannot send
-    // the "changebreakpoint" request.
-    if (id !== -1) {
-        // TODO(apavlov): make use of the real values for "enabled" and
-        // "ignoreCount" when appropriate.
-        this.requestChangeBreakpoint_(id, true, condition, null);
-    }
+    this.breakpointsActivated_ = activated;
 };
 
 
@@ -663,25 +680,6 @@
 
 
 /**
- * Changes breakpoint parameters in the v8 debugger.
- * @param {number} breakpointId Id of the breakpoint in the v8 debugger.
- * @param {boolean} enabled Whether to enable the breakpoint.
- * @param {?string} condition New breakpoint condition.
- * @param {number} ignoreCount New ignore count for the breakpoint.
- */
-devtools.DebuggerAgent.prototype.requestChangeBreakpoint_ = function(breakpointId, enabled, condition, ignoreCount)
-{
-    var cmd = new devtools.DebugCommand("changebreakpoint", {
-        "breakpoint": breakpointId,
-        "enabled": enabled,
-        "condition": condition,
-        "ignoreCount": ignoreCount
-    });
-    devtools.DebuggerAgent.sendCommand_(cmd);
-};
-
-
-/**
  * Sends "backtrace" request to v8.
  */
 devtools.DebuggerAgent.prototype.requestBacktrace_ = function()
@@ -800,6 +798,8 @@
             this.invokeCallbackForResponse_(msg);
         else if (msg.getCommand() === "setbreakpoint")
             this.handleSetBreakpointResponse_(msg);
+        else if (msg.getCommand() === "changelive")
+            this.invokeCallbackForResponse_(msg);
         else if (msg.getCommand() === "clearbreakpoint")
             this.handleClearBreakpointResponse_(msg);
         else if (msg.getCommand() === "backtrace")
@@ -819,7 +819,12 @@
  */
 devtools.DebuggerAgent.prototype.handleBreakEvent_ = function(msg)
 {
-    // Force scrips panel to be shown first.
+    if (!this.breakpointsActivated_) {
+        this.resumeExecution();
+        return;
+    }
+
+    // Force scripts panel to be shown first.
     WebInspector.currentPanel = WebInspector.panels.scripts;
 
     var body = msg.getBody();
@@ -834,9 +839,6 @@
  */
 devtools.DebuggerAgent.prototype.handleExceptionEvent_ = function(msg)
 {
-    // Force scrips panel to be shown first.
-    WebInspector.currentPanel = WebInspector.panels.scripts;
-
     var body = msg.getBody();
     // No script field in the body means that v8 failed to parse the script. We
     // resume execution on parser errors automatically.
@@ -844,6 +846,9 @@
         var line = devtools.DebuggerAgent.v8ToWwebkitLineNumber_(body.sourceLine);
         this.createExceptionMessage_(body.script.name, line, body.exception.text);
         this.requestBacktrace_();
+
+        // Force scripts panel to be shown.
+        WebInspector.currentPanel = WebInspector.panels.scripts;
     } else
         this.resumeExecution();
 };
@@ -956,7 +961,7 @@
     this.parsedScripts_[script.id] = new devtools.ScriptInfo(script.id, script.name, script.lineOffset, contextType);
     if (this.scriptsPanelInitialized_) {
         // Only report script as parsed after scripts panel has been shown.
-        WebInspector.parsedScriptSource(script.id, script.name, script.source, script.lineOffset);
+        WebInspector.parsedScriptSource(script.id, script.name, script.source, script.lineOffset + 1);
     }
 };
 
@@ -994,7 +999,7 @@
         this.callFrames_.push(this.formatCallFrame_(frames[i]));
     WebInspector.pausedScript(this.callFrames_);
     this.showPendingExceptionMessage_();
-    InspectorFrontendHost.activateWindow();
+    InspectorFrontendHost.bringToFront();
 };
 
 
diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js
new file mode 100644
index 0000000..75c5467
--- /dev/null
+++ b/WebKit/chromium/src/js/DebuggerScript.js
@@ -0,0 +1,211 @@
+/*
+ * 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.
+ */
+
+function debuggerScriptConstructor() {
+
+var DebuggerScript = {};
+DebuggerScript._breakpoints = {};
+
+
+DebuggerScript.getAfterCompileScript = function(execState, args)
+{
+    return DebuggerScript._formatScript(args.eventData.script_.script_);
+}
+
+DebuggerScript.getScripts = function(execState, args)
+{
+    var scripts = Debug.scripts();
+    var result = [];
+    for (var i = 0; i < scripts.length; ++i) {
+        result.push(DebuggerScript._formatScript(scripts[i]));
+    }
+    return result;
+}
+
+DebuggerScript._formatScript = function(script)
+{
+    return {
+        id: script.id,
+        name: script.name,
+        source: script.source,
+        lineOffset: script.line_offset,
+        lineCount: script.lineCount(),
+        contextData: script.context_data
+    };
+}
+
+DebuggerScript.setBreakpoint = function(execState, args)
+{
+    args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber);
+    var key = args.scriptId + ":" + args.lineNumber;
+    var breakId = DebuggerScript._breakpoints[key];
+    if (breakId) {
+        if (args.enabled)
+            Debug.enableScriptBreakPoint(breakId);
+        else
+            Debug.disableScriptBreakPoint(breakId);
+        Debug.changeScriptBreakPointCondition(breakId, args.condition);
+        return breakId;
+    }
+
+    breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition);
+    DebuggerScript._breakpoints[key] = breakId;
+    if (!args.enabled)
+        Debug.disableScriptBreakPoint(breakId);
+    return breakId;
+}
+
+DebuggerScript.removeBreakpoint = function(execState, args)
+{
+    args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber);
+    var key = args.scriptId + ":" + args.lineNumber;
+    var breakId = DebuggerScript._breakpoints[key];
+    if (breakId)
+        Debug.findBreakPoint(breakId, true);
+    delete DebuggerScript._breakpoints[key];
+}
+
+DebuggerScript.currentCallFrame = function(execState, args)
+{
+    var frameCount = execState.frameCount();
+    if (frameCount === 0)
+        return undefined;
+    
+    var topFrame;
+    for (var i = frameCount - 1; i >= 0; i--) {
+        var frameMirror = execState.frame(i);
+        topFrame = DebuggerScript._frameMirrorToJSCallFrame(frameMirror, topFrame);
+    }
+    return topFrame;
+}
+
+DebuggerScript.stepIntoStatement = function(execState, args)
+{
+    execState.prepareStep(Debug.StepAction.StepIn, 1);
+}
+
+DebuggerScript.stepOverStatement = function(execState, args)
+{
+    execState.prepareStep(Debug.StepAction.StepNext, 1);
+}
+
+DebuggerScript.stepOutOfFunction = function(execState, args)
+{
+    execState.prepareStep(Debug.StepAction.StepOut, 1);
+}
+
+DebuggerScript.clearBreakpoints = function(execState, args)
+{
+    for (var key in DebuggerScript._breakpoints) {
+        var breakId = DebuggerScript._breakpoints[key];
+        Debug.findBreakPoint(breakId, true);
+    }
+    DebuggerScript._breakpoints = {};
+}
+
+DebuggerScript.setBreakpointsActivated = function(execState, args)
+{
+    for (var key in DebuggerScript._breakpoints) {
+        var breakId = DebuggerScript._breakpoints[key];
+        if (args.enabled)
+            Debug.enableScriptBreakPoint(breakId);
+        else
+            Debug.disableScriptBreakPoint(breakId);
+    }
+}
+
+DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
+{
+    // Get function name.
+    var func;
+    try {
+        func = frameMirror.func();
+    } catch(e) {
+    }
+    var functionName;
+    if (func)
+        functionName = func.name() || func.inferredName();
+    if (!functionName)
+        functionName = "[anonymous]";
+        
+    // Get script ID.
+    var script = func.script();
+    var sourceID = script && script.id();
+    
+    // Get line number.
+    var line = DebuggerScript._v8ToWwebkitLineNumber(frameMirror.sourceLine());
+    
+    // Get this object.
+    var thisObject = frameMirror.details_.receiver();
+
+    // Get scope chain array in format: [<scope type>, <scope object>, <scope type>, <scope object>,...]
+    var scopeChain = [];
+    var scopeType = [];
+    for (var i = 0; i < frameMirror.scopeCount(); i++) {
+        var scopeMirror = frameMirror.scope(i);
+        var scopeObjectMirror = scopeMirror.scopeObject();
+        var properties = scopeObjectMirror.properties();
+        var scopeObject = {};
+        for (var j = 0; j < properties.length; j++)
+            scopeObject[properties[j].name()] = properties[j].value_;
+        scopeType.push(scopeMirror.scopeType());
+        scopeChain.push(scopeObject);
+    }
+    
+    function evaluate(expression) {
+        return frameMirror.evaluate(expression, false).value();
+    }
+    
+    return {
+        "sourceID": sourceID,
+        "line": line,
+        "functionName": functionName,
+        "type": "function",
+        "thisObject": thisObject,
+        "scopeChain": scopeChain,
+        "scopeType": scopeType,
+        "evaluate": evaluate,
+        "caller": callerFrame
+    };
+}
+
+DebuggerScript._webkitToV8LineNumber = function(line)
+{
+    return line - 1;
+};
+
+DebuggerScript._v8ToWwebkitLineNumber = function(line)
+{
+    return line + 1;
+};
+
+return DebuggerScript;
+
+}
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index dcb181b..a530fe5 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -151,31 +151,12 @@
 
 
 /**
- * Enables / disables resources panel in the ui.
- * @param {boolean} enabled New panel status.
- */
-WebInspector.setResourcesPanelEnabled = function(enabled)
-{
-    InspectorBackend._resourceTrackingEnabled = enabled;
-    WebInspector.panels.resources.reset();
-};
-
-
-/**
  * Prints string  to the inspector console or shows alert if the console doesn't
  * exist.
  * @param {string} text
  */
 function debugPrint(text) {
-    var console = WebInspector.console;
-    if (console) {
-        console.addMessage(new WebInspector.ConsoleMessage(
-            WebInspector.ConsoleMessage.MessageSource.JS,
-            WebInspector.ConsoleMessage.MessageType.Log,
-            WebInspector.ConsoleMessage.MessageLevel.Log,
-            1, "chrome://devtools/<internal>", undefined, -1, text));
-    } else
-        alert(text);
+    WebInspector.log(text);
 }
 
 
@@ -200,54 +181,17 @@
     Preferences.ignoreWhitespace = false;
     Preferences.samplingCPUProfiler = true;
     Preferences.heapProfilerPresent = true;
+    Preferences.debuggerAlwaysEnabled = true;
+    Preferences.profilerAlwaysEnabled = true;
+    RemoteDebuggerAgent.setDebuggerScriptSource("(" + debuggerScriptConstructor + ")();");
+ 
     oldLoaded.call(this);
 
     InspectorFrontendHost.loaded();
 };
 
 
-(function()
-{
-
-    /**
-     * Handles an F3 keydown event to focus the Inspector search box.
-     * @param {KeyboardEvent} event Event to optionally handle
-     * @return {boolean} whether the event has been handled
-     */
-    function handleF3Keydown(event) {
-        if (event.keyIdentifier === "F3" && !event.altKey && !event.ctrlKey && !event.shiftKey && !event.metaKey) {
-            var searchField = document.getElementById("search");
-            searchField.focus();
-            searchField.select();
-            event.preventDefault();
-            return true;
-        }
-        return false;
-    }
-
-
-    var oldKeyDown = WebInspector.documentKeyDown;
-    /**
-     * This override allows to intercept keydown events we want to handle in a
-     * custom way. Some nested documents (iframes) delegate keydown handling to
-     * WebInspector.documentKeyDown (e.g. SourceFrame).
-     * @param {KeyboardEvent} event
-     * @override
-     */
-    WebInspector.documentKeyDown = function(event) {
-        var isHandled = handleF3Keydown(event);
-        if (!isHandled) {
-            // Mute refresh action.
-            if (event.keyIdentifier === "F5")
-                event.preventDefault();
-            else if (event.keyIdentifier === "U+0052" /* "R" */ && (event.ctrlKey || event.metaKey))
-                event.preventDefault();
-            else
-                oldKeyDown.call(this, event);
-        }
-    };
-})();
-
+if (!window.v8ScriptDebugServerEnabled) {
 
 /**
  * This override is necessary for adding script source asynchronously.
@@ -279,24 +223,12 @@
  */
 WebInspector.ScriptView.prototype.didResolveScriptSource_ = function()
 {
-    this.sourceFrame.setContent("text/javascript", this.script.source);
+    this.sourceFrame.setContent("text/javascript", this._prependWhitespace(this.script.source));
     this._sourceFrameSetup = true;
     delete this._frameNeedsSetup;
 };
 
 
-/**
- * @param {string} type Type of the the property value("object" or "function").
- * @param {string} className Class name of the property value.
- * @constructor
- */
-WebInspector.UnresolvedPropertyValue = function(type, className)
-{
-    this.type = type;
-    this.className = className;
-};
-
-
 (function()
 {
     var oldShow = WebInspector.ScriptsPanel.prototype.show;
@@ -309,6 +241,47 @@
 })();
 
 
+(function () {
+var orig = InjectedScriptAccess.prototype.getProperties;
+InjectedScriptAccess.prototype.getProperties = function(objectProxy, ignoreHasOwnProperty, abbreviate, callback)
+{
+    if (objectProxy.isScope)
+        devtools.tools.getDebuggerAgent().resolveScope(objectProxy.objectId, callback);
+    else if (objectProxy.isV8Ref)
+        devtools.tools.getDebuggerAgent().resolveChildren(objectProxy.objectId, callback, false);
+    else
+        orig.apply(this, arguments);
+};
+})();
+
+
+(function()
+{
+InjectedScriptAccess.prototype.evaluateInCallFrame = function(callFrameId, code, objectGroup, callback)
+{
+    //TODO(pfeldman): remove once 49084 is rolled.
+    if (!callback)
+        callback = objectGroup;
+    devtools.tools.getDebuggerAgent().evaluateInCallFrame(callFrameId, code, callback);
+};
+})();
+
+
+(function()
+{
+var orig = InjectedScriptAccess.prototype.getCompletions;
+InjectedScriptAccess.prototype.getCompletions = function(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions)
+{
+    if (typeof callFrameId === "number")
+        devtools.tools.getDebuggerAgent().resolveCompletionsOnFrame(expressionString, callFrameId, reportCompletions);
+    else
+        return orig.apply(this, arguments);
+};
+})();
+
+}
+
+
 (function InterceptProfilesPanelEvents()
 {
     var oldShow = WebInspector.ProfilesPanel.prototype.show;
@@ -333,6 +306,17 @@
     return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
 };
 
+// Activate window upon node search complete. This will go away once InspectorFrontendClient is landed.
+(function() {
+    var original = WebInspector.searchingForNodeWasDisabled;
+    WebInspector.searchingForNodeWasDisabled = function()
+    {
+        if (this.panels.elements._nodeSearchButton.toggled)
+            InspectorFrontendHost.bringToFront();
+        original.apply(this, arguments);
+    }
+})();
+
 
 // There is no clear way of setting frame title yet. So sniffing main resource
 // load.
@@ -392,81 +376,6 @@
 })();
 
 
-(function () {
-var orig = InjectedScriptAccess.prototype.getProperties;
-InjectedScriptAccess.prototype.getProperties = function(objectProxy, ignoreHasOwnProperty, abbreviate, callback)
-{
-    if (objectProxy.isScope)
-        devtools.tools.getDebuggerAgent().resolveScope(objectProxy.objectId, callback);
-    else if (objectProxy.isV8Ref)
-        devtools.tools.getDebuggerAgent().resolveChildren(objectProxy.objectId, callback, false);
-    else
-        orig.apply(this, arguments);
-};
-})();
-
-
-(function()
-{
-InjectedScriptAccess.prototype.evaluateInCallFrame = function(callFrameId, code, objectGroup, callback)
-{
-    //TODO(pfeldman): remove once 49084 is rolled.
-    if (!callback)
-        callback = objectGroup;
-    devtools.tools.getDebuggerAgent().evaluateInCallFrame(callFrameId, code, callback);
-};
-})();
-
-
-WebInspector.resourceTrackingWasEnabled = function()
-{
-      InspectorBackend._resourceTrackingEnabled = true;
-      this.panels.resources.resourceTrackingWasEnabled();
-};
-
-WebInspector.resourceTrackingWasDisabled = function()
-{
-      InspectorBackend._resourceTrackingEnabled = false;
-      this.panels.resources.resourceTrackingWasDisabled();
-};
-
-(function()
-{
-var orig = WebInspector.ConsoleMessage.prototype.setMessageBody;
-WebInspector.ConsoleMessage.prototype.setMessageBody = function(args)
-{
-    for (var i = 0; i < args.length; ++i) {
-        if (typeof args[i] === "string")
-            args[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(args[i]);
-    }
-    orig.call(this, args);
-};
-})();
-
-
-(function()
-{
-var orig = InjectedScriptAccess.prototype.getCompletions;
-InjectedScriptAccess.prototype.getCompletions = function(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions)
-{
-    if (typeof callFrameId === "number")
-        devtools.tools.getDebuggerAgent().resolveCompletionsOnFrame(expressionString, callFrameId, reportCompletions);
-    else
-        return orig.apply(this, arguments);
-};
-})();
-
-
-(function()
-{
-WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked = function( event)
-{
-    InspectorBackend.toggleNodeSearch();
-    this.nodeSearchButton.toggled = !this.nodeSearchButton.toggled;
-};
-})();
-
-
 // We need to have a place for postponed tasks
 // which should be executed when all the messages between agent and frontend
 // are processed.
@@ -498,7 +407,92 @@
 };
 })();
 
-WebInspector.pausedScript = function(callFrames)
+// Chromium theme support.
+WebInspector.setToolbarColors = function(backgroundColor, color)
 {
-    this.panels.scripts.debuggerPaused(callFrames);
-};
+    if (!WebInspector._themeStyleElement) {
+        WebInspector._themeStyleElement = document.createElement("style");
+        document.head.appendChild(WebInspector._themeStyleElement);
+    }
+    WebInspector._themeStyleElement.textContent =
+        "body #toolbar, body.inactive #toolbar {\
+             background-image: none !important;\
+             background-color: " + backgroundColor + " !important;\
+         }\
+         \
+         body .status-bar {\
+             background-image: url(Images/statusbarBackgroundChromium2.png) !important;\
+             background-color: " + backgroundColor + " !important;\
+         }\
+         \
+         body button.status-bar-item {\
+             background-image: none !important;\
+         }\
+         \
+         button.status-bar-item {\
+             background-image: none;\
+             border-right: 1px solid " + backgroundColor + ";\
+         }\
+         \
+         .status-bar {\
+             background-image: none;\
+             color: " + color + ";\
+         }\
+         \
+         body #drawer {\
+             background-image: none !important;\
+         }\
+         \
+         #drawer-status-bar {\
+             background-image: url(Images/statusbarBackgroundChromium2.png);\
+             background-color: " + backgroundColor + ";\
+         }\
+         \
+         \
+         body.drawer-visible #main-status-bar {\
+             background-image: url(Images/statusbarBackgroundChromium2.png) !important;\
+         }\
+         \
+         body .crumbs .crumb, body .crumbs .crumb.end {\
+             -webkit-border-image: url(Images/segmentChromium2.png) 0 12 0 2 !important;\
+             background-color: " + backgroundColor + " !important;\
+         }\
+         \
+         body .crumbs .crumb:hover, body .crumbs .crumb.dimmed:hover {\
+             -webkit-border-image: url(Images/segmentHoverChromium2.png) 0 12 0 2 !important;\
+         }\
+         \
+         body .crumbs .crumb.end {\
+             -webkit-border-image: url(Images/segmentChromium2.png) 0 12 0 2 !important;\
+         }\
+         \
+         body .crumbs .crumb.selected:hover, body .crumbs .crumb.selected.end, .crumbs .crumb.selected.end:hover {\
+             -webkit-border-image: url(Images/segmentSelectedChromium2.png) 0 12 0 2 !important;\
+         }\
+         \
+         body select.status-bar-item {\
+             -webkit-border-image: url(Images/statusbarMenuButtonChromium2.png) 0 17 0 2 !important;\
+             background-color: " + backgroundColor + " !important;\
+             text-shadow: none !important;\
+         }\
+         \
+         .glyph {\
+             background-color: " + color + ";\
+         }\
+         \
+         button.status-bar-item .glyph.shadow {\
+             display: none;\
+         }\
+         \
+         .crumbs, .crumbs .crumb:hover, #drawer .scope-bar:not(.console-filter-top) li, .toolbar-label, select.status-bar-item {\
+             text-shadow: none;\
+             color: " + color + ";\
+         }";
+}
+
+WebInspector.resetToolbarColors = function()
+{
+    if (WebInspector._themeStyleElement)
+        WebInspector._themeStyleElement.textContent = "";
+
+}
diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js
index 8b2f46b..cae4a1e 100644
--- a/WebKit/chromium/src/js/DevToolsHostStub.js
+++ b/WebKit/chromium/src/js/DevToolsHostStub.js
@@ -55,6 +55,11 @@
 };
 
 
+RemoteDebuggerAgentStub.prototype.setDebuggerScriptSource = function(source)
+{
+};
+
+
 /**
  * @constructor
  */
diff --git a/WebKit/chromium/src/js/HeapProfilerPanel.js b/WebKit/chromium/src/js/HeapProfilerPanel.js
index abbf580..0fc4418 100644
--- a/WebKit/chromium/src/js/HeapProfilerPanel.js
+++ b/WebKit/chromium/src/js/HeapProfilerPanel.js
@@ -205,7 +205,7 @@
         // Call searchCanceled since it will reset everything we need before doing a new search.
         this.searchCanceled();
 
-        query = query.trimWhitespace();
+        query = query.trim();
 
         if (!query.length)
             return;
@@ -937,7 +937,7 @@
 
     get welcomeMessage()
     {
-        return WebInspector.UIString("Get a heap snapshot by pressing<br>the %s button on the status bar.");
+        return WebInspector.UIString("Get a heap snapshot by pressing the %s button on the status bar.");
     },
 
     createSidebarTreeElementForProfile: function(profile)
diff --git a/WebKit/chromium/src/js/Images/segmentChromium2.png b/WebKit/chromium/src/js/Images/segmentChromium2.png
new file mode 100755
index 0000000..e94f570
--- /dev/null
+++ b/WebKit/chromium/src/js/Images/segmentChromium2.png
Binary files differ
diff --git a/WebKit/chromium/src/js/Images/segmentHoverChromium2.png b/WebKit/chromium/src/js/Images/segmentHoverChromium2.png
new file mode 100755
index 0000000..4d4a211
--- /dev/null
+++ b/WebKit/chromium/src/js/Images/segmentHoverChromium2.png
Binary files differ
diff --git a/WebKit/chromium/src/js/Images/segmentSelectedChromium2.png b/WebKit/chromium/src/js/Images/segmentSelectedChromium2.png
new file mode 100755
index 0000000..f2b695b
--- /dev/null
+++ b/WebKit/chromium/src/js/Images/segmentSelectedChromium2.png
Binary files differ
diff --git a/WebKit/chromium/src/js/Images/statusbarBackgroundChromium2.png b/WebKit/chromium/src/js/Images/statusbarBackgroundChromium2.png
new file mode 100755
index 0000000..12d62b1
--- /dev/null
+++ b/WebKit/chromium/src/js/Images/statusbarBackgroundChromium2.png
Binary files differ
diff --git a/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium2.png b/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium2.png
new file mode 100755
index 0000000..9527ac8
--- /dev/null
+++ b/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium2.png
Binary files differ
diff --git a/WebKit/chromium/src/js/InjectDispatch.js b/WebKit/chromium/src/js/InjectDispatch.js
index e070c42..30caaf2 100644
--- a/WebKit/chromium/src/js/InjectDispatch.js
+++ b/WebKit/chromium/src/js/InjectDispatch.js
@@ -104,3 +104,10 @@
     var call = JSON.stringify(args);
     DevToolsAgentHost.dispatch(call);
 };
+
+function close() {
+    // This method is called when InspectorFrontend closes in layout tests.
+}
+
+function inspectedPageDestroyed() {
+}
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index c92a94c..becc076 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -38,23 +38,30 @@
 devtools.InspectorBackendImpl = function()
 {
     WebInspector.InspectorBackendStub.call(this);
+    this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad");
     this.installInspectorControllerDelegate_("clearMessages");
     this.installInspectorControllerDelegate_("copyNode");
     this.installInspectorControllerDelegate_("deleteCookie");
     this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend");
     this.installInspectorControllerDelegate_("disableResourceTracking");
+    this.installInspectorControllerDelegate_("disableSearchingForNode");
     this.installInspectorControllerDelegate_("disableTimeline");
     this.installInspectorControllerDelegate_("enableResourceTracking");
+    this.installInspectorControllerDelegate_("enableSearchingForNode");
     this.installInspectorControllerDelegate_("enableTimeline");
     this.installInspectorControllerDelegate_("getChildNodes");
     this.installInspectorControllerDelegate_("getCookies");
     this.installInspectorControllerDelegate_("getDatabaseTableNames");
     this.installInspectorControllerDelegate_("getDOMStorageEntries");
     this.installInspectorControllerDelegate_("getEventListenersForNode");
+    this.installInspectorControllerDelegate_("getProfile");
+    this.installInspectorControllerDelegate_("getProfileHeaders");
     this.installInspectorControllerDelegate_("getResourceContent");
     this.installInspectorControllerDelegate_("highlightDOMNode");
     this.installInspectorControllerDelegate_("hideDOMNodeHighlight");
     this.installInspectorControllerDelegate_("releaseWrapperObjectGroup");
+    this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad");
+    this.installInspectorControllerDelegate_("reloadPage");
     this.installInspectorControllerDelegate_("removeAttribute");
     this.installInspectorControllerDelegate_("removeDOMStorageItem");
     this.installInspectorControllerDelegate_("removeNode");
@@ -63,25 +70,39 @@
     this.installInspectorControllerDelegate_("setDOMStorageItem");
     this.installInspectorControllerDelegate_("setInjectedScriptSource");
     this.installInspectorControllerDelegate_("setTextNodeValue");
+    this.installInspectorControllerDelegate_("startProfiling");
     this.installInspectorControllerDelegate_("startTimelineProfiler");
+    this.installInspectorControllerDelegate_("stopProfiling");
     this.installInspectorControllerDelegate_("stopTimelineProfiler");
     this.installInspectorControllerDelegate_("storeLastActivePanel");
-};
-devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype;
 
+    this.installInspectorControllerDelegate_("getAllStyles");
+    this.installInspectorControllerDelegate_("getStyles");
+    this.installInspectorControllerDelegate_("getComputedStyle");
+    this.installInspectorControllerDelegate_("getInlineStyle");
+    this.installInspectorControllerDelegate_("applyStyleText");
+    this.installInspectorControllerDelegate_("setStyleText");
+    this.installInspectorControllerDelegate_("setStyleProperty");
+    this.installInspectorControllerDelegate_("toggleStyleEnabled");
+    this.installInspectorControllerDelegate_("setRuleSelector");
+    this.installInspectorControllerDelegate_("addRule");
 
-/**
- * {@inheritDoc}.
- */
-devtools.InspectorBackendImpl.prototype.toggleNodeSearch = function()
-{
-    WebInspector.InspectorBackendStub.prototype.toggleNodeSearch.call(this);
-    this.callInspectorController_.call(this, "toggleNodeSearch");
-    if (!this.searchingForNode()) {
-        // This is called from ElementsPanel treeOutline's focusNodeChanged().
-        DevToolsHost.activateWindow();
+    if (window.v8ScriptDebugServerEnabled) {
+    this.installInspectorControllerDelegate_("disableDebugger");
+    this.installInspectorControllerDelegate_("enableDebugger");
+    this.installInspectorControllerDelegate_("setBreakpoint");
+    this.installInspectorControllerDelegate_("removeBreakpoint");
+    this.installInspectorControllerDelegate_("activateBreakpoints");
+    this.installInspectorControllerDelegate_("deactivateBreakpoints");
+    this.installInspectorControllerDelegate_("pauseInDebugger");
+    this.installInspectorControllerDelegate_("resumeDebugger");
+    this.installInspectorControllerDelegate_("stepIntoStatementInDebugger");
+    this.installInspectorControllerDelegate_("stepOutOfFunctionInDebugger");
+    this.installInspectorControllerDelegate_("stepOverStatementInDebugger");
+    this.installInspectorControllerDelegate_("setPauseOnExceptionsState");
     }
 };
+devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype;
 
 
 /**
@@ -102,9 +123,13 @@
 };
 
 
-devtools.InspectorBackendImpl.prototype.addBreakpoint = function(sourceID, line, condition)
+if (!window.v8ScriptDebugServerEnabled) {
+
+devtools.InspectorBackendImpl.prototype.setBreakpoint = function(sourceID, line, enabled, condition)
 {
-    devtools.tools.getDebuggerAgent().addBreakpoint(sourceID, line, condition);
+    this.removeBreakpoint(sourceID, line);
+    if (enabled)
+        devtools.tools.getDebuggerAgent().addBreakpoint(sourceID, line, condition);
 };
 
 
@@ -113,11 +138,27 @@
     devtools.tools.getDebuggerAgent().removeBreakpoint(sourceID, line);
 };
 
-devtools.InspectorBackendImpl.prototype.updateBreakpoint = function(sourceID, line, condition)
+
+devtools.InspectorBackendImpl.prototype.editScriptLine = function(callID, sourceID, line, newContent)
 {
-    devtools.tools.getDebuggerAgent().updateBreakpoint(sourceID, line, condition);
+    devtools.tools.getDebuggerAgent().editScriptLine(sourceID, line, newContent, function(newFullBody) {
+        WebInspector.didEditScriptLine(callID, newFullBody);
+    });
 };
 
+
+devtools.InspectorBackendImpl.prototype.activateBreakpoints = function()
+{
+    devtools.tools.getDebuggerAgent().setBreakpointsActivated(true);
+};
+
+
+devtools.InspectorBackendImpl.prototype.deactivateBreakpoints = function()
+{
+    devtools.tools.getDebuggerAgent().setBreakpointsActivated(false);
+};
+
+
 devtools.InspectorBackendImpl.prototype.pauseInDebugger = function()
 {
     devtools.tools.getDebuggerAgent().pauseExecution();
@@ -155,16 +196,10 @@
     this._setPauseOnExceptionsState = state;
     // TODO(yurys): support all three states. See http://crbug.com/32877
     var enabled = (state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
-    return devtools.tools.getDebuggerAgent().setPauseOnExceptions(enabled);
+    WebInspector.updatePauseOnExceptionsState(enabled ? WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions : WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
+    devtools.tools.getDebuggerAgent().setPauseOnExceptions(enabled);
 };
 
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.pauseOnExceptionsState = function()
-{
-    return (this._setPauseOnExceptionsState || WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
-};
 
 /**
  * @override
@@ -183,53 +218,7 @@
     return devtools.tools.getDebuggerAgent().setPauseOnExceptions(value);
 };
 
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.startProfiling = function()
-{
-    devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_CPU);
-};
-
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.stopProfiling = function()
-{
-    devtools.tools.getProfilerAgent().stopProfiling( devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_CPU);
-};
-
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.getProfileHeaders = function(callId)
-{
-    WebInspector.didGetProfileHeaders(callId, []);
-};
-
-
-/**
- * Emulate WebKit InspectorController behavior. It stores profiles on renderer side,
- * and is able to retrieve them by uid using "getProfile".
- */
-devtools.InspectorBackendImpl.prototype.addFullProfile = function(profile)
-{
-    WebInspector.__fullProfiles = WebInspector.__fullProfiles || {};
-    WebInspector.__fullProfiles[profile.uid] = profile;
-};
-
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.getProfile = function(callId, uid)
-{
-    if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))
-        WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);
-};
+}
 
 
 /**
diff --git a/WebKit/chromium/src/js/ProfilerAgent.js b/WebKit/chromium/src/js/ProfilerAgent.js
index e08c5d2..29de4a3 100644
--- a/WebKit/chromium/src/js/ProfilerAgent.js
+++ b/WebKit/chromium/src/js/ProfilerAgent.js
@@ -41,18 +41,6 @@
     RemoteProfilerAgent.didGetLogLines = this._didGetLogLines.bind(this);
 
     /**
-     * Active profiler modules flags.
-     * @type {number}
-     */
-    this._activeProfilerModules = devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE;
-
-    /**
-     * Interval for polling profiler state.
-     * @type {number}
-     */
-    this._getActiveProfilerModulesInterval = null;
-
-    /**
      * Profiler log position.
      * @type {number}
      */
@@ -65,12 +53,6 @@
     this._lastRequestedLogPosition = -1;
 
     /**
-     * Whether log contents retrieval must be forced next time.
-     * @type {boolean}
-     */
-    this._forceGetLogLines = false;
-
-    /**
      * Profiler processor instance.
      * @type {devtools.profiler.Processor}
      */
@@ -92,50 +74,11 @@
 
 
 /**
- * Sets up callbacks that deal with profiles processing.
- */
-devtools.ProfilerAgent.prototype.setupProfilerProcessorCallbacks = function()
-{
-    // A temporary icon indicating that the profile is being processed.
-    var processingIcon = new WebInspector.SidebarTreeElement(
-        "profile-sidebar-tree-item",
-        WebInspector.UIString("Processing..."),
-        '', null, false);
-    var profilesSidebar = WebInspector.panels.profiles.getProfileType(WebInspector.CPUProfileType.TypeId).treeElement;
-
-    this._profilerProcessor.setCallbacks(
-        function onProfileProcessingStarted() {
-            // Set visually empty string. Subtitle hiding is done via styles
-            // manipulation which doesn't play well with dynamic append / removal.
-            processingIcon.subtitle = " ";
-            profilesSidebar.appendChild(processingIcon);
-        },
-        function onProfileProcessingStatus(ticksCount) {
-            processingIcon.subtitle = WebInspector.UIString("%d ticks processed", ticksCount);
-        },
-        function onProfileProcessingFinished(profile) {
-            profilesSidebar.removeChild(processingIcon);
-            profile.typeId = WebInspector.CPUProfileType.TypeId;
-            InspectorBackend.addFullProfile(profile);
-            WebInspector.addProfileHeader(profile);
-            // If no profile is currently shown, show the new one.
-            var profilesPanel = WebInspector.panels.profiles;
-            if (!profilesPanel.visibleView) {
-                profilesPanel.showProfile(profile);
-            }
-        }
-    );
-};
-
-
-/**
  * Initializes profiling state.
  */
 devtools.ProfilerAgent.prototype.initializeProfiling = function()
 {
-    this.setupProfilerProcessorCallbacks();
-    this._forceGetLogLines = true;
-    this._getActiveProfilerModulesInterval = setInterval(function() { RemoteProfilerAgent.getActiveProfilerModules(); }, 1000);
+    this._getNextLogLines(false);
 };
 
 
@@ -193,16 +136,6 @@
  */
 devtools.ProfilerAgent.prototype._didGetActiveProfilerModules = function(modules)
 {
-    var profModules = devtools.ProfilerAgent.ProfilerModules;
-    var profModuleNone = profModules.PROFILER_MODULE_NONE;
-    if (this._forceGetLogLines || (modules !== profModuleNone && this._activeProfilerModules === profModuleNone)) {
-        this._forceGetLogLines = false;
-        // Start to query log data.
-        this._getNextLogLines(true);
-    }
-    this._activeProfilerModules = modules;
-    // Update buttons.
-    WebInspector.setRecordingProfile(modules & profModules.PROFILER_MODULE_CPU);
 };
 
 
@@ -214,14 +147,11 @@
 devtools.ProfilerAgent.prototype._didGetLogLines = function(pos, log)
 {
     this._logPosition = pos;
-    if (log.length > 0)
+    if (log.length > 0) {
         this._profilerProcessor.processLogChunk(log);
-    else {
+        this._getNextLogLines();
+    } else {
         // Allow re-reading from the last position.
         this._lastRequestedLogPosition = this._logPosition - 1;
-        if (this._activeProfilerModules === devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE)
-            // No new data and profiling is stopped---suspend log reading.
-            return;
     }
-    this._getNextLogLines();
 };
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index fa0c99f..758b8c0 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -295,19 +295,19 @@
             var resource = WebInspector.resources[identifier];
             if (!resource || !resource.url)
                 return;
-            if (resource.url.search("image.html$") !== -1) {
+            if (resource.url.search("image.html") !== -1) {
               var expectedLength = 87;
               test.assertTrue(
-                  resource.contentLength <= expectedLength,
+                  resource.resourceSize <= expectedLength,
                   "image.html content length is greater thatn expected.");
-              if (expectedLength === resource.contentLength)
+              if (expectedLength === resource.resourceSize)
                   html = true;
             } else if (resource.url.search("image.png") !== -1) {
               var expectedLength = 257796;
               test.assertTrue(
-                  resource.contentLength <= expectedLength,
+                  resource.resourceSize <= expectedLength,
                   "image.png content length is greater than expected.");
-              if (expectedLength === resource.contentLength)
+              if (expectedLength === resource.resourceSize)
                   png = true;
             }
             if (html && png) {
@@ -425,39 +425,38 @@
 {
     this.showPanel("profiles");
 
+    var panel = WebInspector.panels.profiles;
     var test = this;
-    this.addSniffer(WebInspector.panels.profiles, "addProfileHeader",
-        function(typeOrProfile, profile) {
-            if (!profile)
-                profile = typeOrProfile;
-            var panel = WebInspector.panels.profiles;
-            panel.showProfile(profile);
-            var node = panel.visibleView.profileDataGridTree.children[0];
-            // Iterate over displayed functions and search for a function
-            // that is called "fib" or "eternal_fib". If found, it will mean
-            // that we actually have profiled page's code.
-            while (node) {
-                if (node.functionName.indexOf("fib") !== -1)
-                    test.releaseControl();
-                node = node.traverseNextNode(true, null, true);
-            }
 
-            test.fail();
-        });
-    var ticksCount = 0;
-    var tickRecord = "\nt,";
-    this.addSniffer(RemoteProfilerAgent, "didGetLogLines",
-        function(posIgnored, log) {
-            var pos = 0;
-            while ((pos = log.indexOf(tickRecord, pos)) !== -1) {
-                pos += tickRecord.length;
-                ticksCount++;
-            }
-            if (ticksCount > 100)
-                InspectorBackend.stopProfiling();
-        }, true);
+    function findDisplayedNode() {
+        var node = panel.visibleView.profileDataGridTree.children[0];
+        if (!node) {
+            // Profile hadn't been queried yet, re-schedule.
+            window.setTimeout(findDisplayedNode, 100);
+            return;
+        }
 
-    InspectorBackend.startProfiling();
+        // Iterate over displayed functions and search for a function
+        // that is called "fib" or "eternal_fib". If found, this will mean
+        // that we actually have profiled page's code.
+        while (node) {
+            if (node.functionName.indexOf("fib") !== -1)
+                test.releaseControl();
+            node = node.traverseNextNode(true, null, true);
+        }
+
+        test.fail();
+    }
+
+    function findVisibleView() {
+        if (!panel.visibleView) {
+            setTimeout(findVisibleView, 0);
+            return;
+        }
+        setTimeout(findDisplayedNode, 0);            
+    }
+
+    findVisibleView();
     this.takeControl();
 };
 
@@ -470,7 +469,7 @@
     this.showPanel("scripts");
     var test = this;
     // There should be at least main page script.
-    this._waitUntilScriptsAreParsed(["debugger_test_page.html$"],
+    this._waitUntilScriptsAreParsed(["debugger_test_page.html"],
         function() {
             test.releaseControl();
         });
@@ -502,7 +501,7 @@
         var parsed = devtools.tools.getDebuggerAgent().parsedScripts_;
         for (var id in parsed) {
             var url = parsed[id].getUrl();
-            if (url && url.search("debugger_test_page.html$") !== -1) {
+            if (url && url.search("debugger_test_page.html") !== -1) {
                 checkScriptsPanel();
                 return;
             }
@@ -512,7 +511,7 @@
 
     function checkScriptsPanel() {
         test.showPanel("scripts");
-        test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html$"]), "Inspected script not found in the scripts list");
+        test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Inspected script not found in the scripts list");
         test.releaseControl();
     }
 
@@ -530,7 +529,7 @@
     var test = this;
 
     test._waitUntilScriptsAreParsed(
-        ["page_with_content_script.html$", "simple_content_script.js$"],
+        ["page_with_content_script.html", "simple_content_script.js"],
         function() {
           test.releaseControl();
         });
@@ -568,7 +567,7 @@
 
     function checkScriptsPanel() {
         test.assertTrue(!!WebInspector.panels.scripts.visibleView, "No visible script view.");
-        test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html$"]), "Some scripts are missing.");
+        test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Some scripts are missing.");
         checkNoDuplicates();
         test.releaseControl();
     }
@@ -584,7 +583,7 @@
     }
 
     test._waitUntilScriptsAreParsed(
-        ["debugger_test_page.html$"],
+        ["debugger_test_page.html"],
         function() {
             checkNoDuplicates();
             setTimeout(switchToElementsTab, 0);
@@ -635,15 +634,15 @@
 
     // TODO(yurys): remove else branch once the states are supported.
     if (WebInspector.ScriptsPanel.PauseOnExceptionsState) {
-        while (WebInspector.currentPanel.pauseOnExceptionButton.state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
-            WebInspector.currentPanel.pauseOnExceptionButton.element.click();
+        while (WebInspector.currentPanel._pauseOnExceptionButton.state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
+            WebInspector.currentPanel._pauseOnExceptionButton.element.click();
     } else {
         // Make sure pause on exceptions is on.
-        if (!WebInspector.currentPanel.pauseOnExceptionButton.toggled)
-            WebInspector.currentPanel.pauseOnExceptionButton.element.click();
+        if (!WebInspector.currentPanel._pauseOnExceptionButton.toggled)
+            WebInspector.currentPanel._pauseOnExceptionButton.element.click();
     }
 
-    this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html$"]);
+    this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html"]);
 
     this._waitForScriptPause(
         {
@@ -913,7 +912,7 @@
 {
     this.showPanel("scripts");
     var test = this;
-    this._executeCodeWhenScriptsAreParsed("handleClick()", ["completion_on_pause.html$"]);
+    this._executeCodeWhenScriptsAreParsed("handleClick()", ["completion_on_pause.html"]);
 
     this._waitForScriptPause(
         {
@@ -974,7 +973,7 @@
         // InjectedScript._ensureCommandLineAPIInstalled) since the page script
         // contains a syntax error.
         for (var i = 0 ; i < options.length; i++) {
-            if (options[i].text.search("script_syntax_error.html$") !== -1)
+            if (options[i].text.search("script_syntax_error.html") !== -1)
                 test.fail("Script with syntax error should not be in the list of parsed scripts.");
         }
     }
@@ -1173,7 +1172,7 @@
  */
 TestSuite.prototype._executeFunctionForStepTest = function()
 {
-    this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html$", "debugger_step.js$"]);
+    this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html", "debugger_step.js"]);
 };
 
 
@@ -1437,7 +1436,7 @@
     this.showPanel("scripts");
     var test = this;
 
-    this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html$"]);
+    this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html"]);
 
     this._waitForScriptPause(
         {
@@ -1551,7 +1550,7 @@
     this.showPanel("scripts");
     var test = this;
 
-    this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html$"]);
+    this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html"]);
 
     this._waitForScriptPause(
         {
diff --git a/WebKit/chromium/src/linux/WebFontRenderStyle.cpp b/WebKit/chromium/src/linux/WebFontRenderStyle.cpp
new file mode 100644
index 0000000..0b864d1
--- /dev/null
+++ b/WebKit/chromium/src/linux/WebFontRenderStyle.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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 "WebFontRenderStyle.h"
+
+#include "FontRenderStyle.h"
+
+using WebCore::FontRenderStyle;
+
+namespace WebKit {
+
+void WebFontRenderStyle::toFontRenderStyle(FontRenderStyle* out)
+{
+    out->useBitmaps = useBitmaps;
+    out->useAutoHint = useAutoHint;
+    out->useHinting = useHinting;
+    out->hintStyle = hintStyle;
+    out->useAntiAlias = useAntiAlias;
+    out->useSubpixel = useSubpixel;
+}
+
+void WebFontRenderStyle::setDefaults()
+{
+    useBitmaps = 2;
+    useAutoHint = 2;
+    useHinting = 2;
+    hintStyle = 0;
+    useAntiAlias = 2;
+    useSubpixel = 2;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/mac/WebInputEventFactory.mm b/WebKit/chromium/src/mac/WebInputEventFactory.mm
index 46b0afe..694155f 100644
--- a/WebKit/chromium/src/mac/WebInputEventFactory.mm
+++ b/WebKit/chromium/src/mac/WebInputEventFactory.mm
@@ -861,6 +861,29 @@
     return modifiers;
 }
 
+static inline void setWebEventLocationFromEventInView(WebMouseEvent* result,
+                                                      NSEvent* event,
+                                                      NSView* view) {
+    NSPoint windowLocal = [event locationInWindow];
+
+    NSPoint screenLocal = [[view window] convertBaseToScreen:windowLocal];
+    result->globalX = screenLocal.x;
+    // Flip y.
+    NSScreen* primaryScreen = ([[NSScreen screens] count] > 0) ?
+        [[NSScreen screens] objectAtIndex:0] : nil;
+    if (primaryScreen)
+        result->globalY = [primaryScreen frame].size.height - screenLocal.y;
+    else
+        result->globalY = screenLocal.y;
+
+    NSPoint contentLocal = [view convertPoint:windowLocal fromView:nil];
+    result->x = contentLocal.x;
+    result->y = [view frame].size.height - contentLocal.y;  // Flip y.
+
+    result->windowX = result->x;
+    result->windowY = result->y;
+}
+
 WebKeyboardEvent WebInputEventFactory::keyboardEvent(NSEvent* event)
 {
     WebKeyboardEvent result;
@@ -1021,16 +1044,7 @@
         ASSERT_NOT_REACHED();
     }
 
-    NSPoint location = [NSEvent mouseLocation];  // global coordinates
-    result.globalX = location.x;
-    result.globalY = [[[view window] screen] frame].size.height - location.y;
-
-    NSPoint windowLocal = [event locationInWindow];
-    location = [view convertPoint:windowLocal fromView:nil];
-    result.y = [view frame].size.height - location.y;  // flip y
-    result.x = location.x;
-    result.windowX = result.x;
-    result.windowY = result.y;
+    setWebEventLocationFromEventInView(&result, event, view);
 
     result.modifiers = modifiersFromEvent(event);
 
@@ -1050,16 +1064,7 @@
 
     result.modifiers = modifiersFromEvent(event);
 
-    // Set coordinates by translating event coordinates from screen to client.
-    NSPoint location = [NSEvent mouseLocation];  // global coordinates
-    result.globalX = location.x;
-    result.globalY = location.y;
-    NSPoint windowLocal = [event locationInWindow];
-    location = [view convertPoint:windowLocal fromView:nil];
-    result.x = location.x;
-    result.y = [view frame].size.height - location.y;  // flip y
-    result.windowX = result.x;
-    result.windowY = result.y;
+    setWebEventLocationFromEventInView(&result, event, view);
 
     // Of Mice and Men
     // ---------------
diff --git a/WebKit/chromium/tests/DragImageTest.cpp b/WebKit/chromium/tests/DragImageTest.cpp
new file mode 100644
index 0000000..6c9718e
--- /dev/null
+++ b/WebKit/chromium/tests/DragImageTest.cpp
@@ -0,0 +1,136 @@
+/*
+ * 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 <gtest/gtest.h>
+
+#include "DragImage.h"
+#include "Image.h"
+#include "NativeImageSkia.h"
+
+using namespace WebCore;
+
+namespace {
+
+class TestImage : public Image {
+public:
+
+    explicit TestImage(const IntSize& size)
+        : Image(0)
+        , m_size(size)
+    {
+        m_nativeImage = new NativeImageSkia();
+        m_nativeImage->setConfig(SkBitmap::kARGB_8888_Config,
+                                 size.width(), size.height(), 0);
+        m_nativeImage->allocPixels();
+    }
+
+    virtual ~TestImage()
+    {
+        delete m_nativeImage;
+    }
+
+    virtual IntSize size() const
+    {
+        return m_size;
+    }
+
+    virtual NativeImagePtr nativeImageForCurrentFrame()
+    {
+        if (m_size.isZero())
+            return 0;
+
+        return m_nativeImage;
+    }
+
+    // Stub implementations of pure virtual Image functions.
+    virtual void destroyDecodedData(bool)
+    {
+    }
+
+    virtual unsigned int decodedSize() const
+    {
+        return 0u;
+    }
+
+    virtual void draw(WebCore::GraphicsContext*, const WebCore::FloatRect&,
+                      const WebCore::FloatRect&, WebCore::ColorSpace,
+                      WebCore::CompositeOperator)
+    {
+    }
+
+private:
+
+    IntSize m_size;
+
+    NativeImagePtr m_nativeImage;
+};
+
+TEST(DragImageTest, NullHandling)
+{
+    EXPECT_FALSE(createDragImageFromImage(0));
+
+    deleteDragImage(0);
+    EXPECT_TRUE(dragImageSize(0).isZero());
+    EXPECT_FALSE(scaleDragImage(0, FloatSize(0.5, 0.5)));
+    EXPECT_FALSE(dissolveDragImageToFraction(0, 0.5));
+    EXPECT_FALSE(createDragImageFromImage(0));
+    EXPECT_FALSE(createDragImageIconForCachedImage(0));
+}
+
+TEST(DragImageTest, NonNullHandling)
+{
+    TestImage testImage(IntSize(2, 2));
+    DragImageRef dragImage = createDragImageFromImage(&testImage);
+    ASSERT_TRUE(dragImage);
+
+    dragImage = scaleDragImage(dragImage, FloatSize(0.5, 0.5));
+    ASSERT_TRUE(dragImage);
+    IntSize size = dragImageSize(dragImage);
+    EXPECT_EQ(1, size.width());
+    EXPECT_EQ(1, size.height());
+
+    // This is not implemented, so we don't do any output validation.
+    dragImage = dissolveDragImageToFraction(dragImage, 0.5);
+    ASSERT_TRUE(dragImage);
+
+    deleteDragImage(dragImage);
+}
+
+TEST(DragImageTest, CreateDragImageReturningNull)
+{
+    // Tests that the DrageImage implementation doesn't choke on null values
+    // of nativeImageForCurrentFrame().
+    TestImage testImage((IntSize()));
+    EXPECT_FALSE(createDragImageFromImage(&testImage));
+}
+
+} // anonymous namespace
diff --git a/WebKit/chromium/tests/KURLTest.cpp b/WebKit/chromium/tests/KURLTest.cpp
index b316683..6be4966 100644
--- a/WebKit/chromium/tests/KURLTest.cpp
+++ b/WebKit/chromium/tests/KURLTest.cpp
@@ -381,10 +381,11 @@
     EXPECT_FALSE(kurl.isEmpty());
     EXPECT_STREQ("http://www.google.com:8000/favicon.ico", kurl.string().utf8().data());
 
-    // Now let's test that giving an invalid replacement still fails.
+    // Now let's test that giving an invalid replacement fails. Invalid
+    // protocols fail without modifying the URL, which should remain valid.
 #if USE(GOOGLEURL)
-    kurl.setProtocol("f/sj#@");
-    EXPECT_FALSE(kurl.isValid());
+    EXPECT_FALSE(kurl.setProtocol("f/sj#@"));
+    EXPECT_TRUE(kurl.isValid());
 #endif
 }
 
diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp
new file mode 100644
index 0000000..c98ea74
--- /dev/null
+++ b/WebKit/chromium/tests/PopupMenuTest.cpp
@@ -0,0 +1,362 @@
+/*
+ * 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 <gtest/gtest.h>
+
+#include "Color.h"
+#include "KeyboardCodes.h"
+#include "PopupMenu.h"
+#include "PopupMenuClient.h"
+#include "PopupMenuChromium.h"
+#include "WebFrameClient.h"
+#include "WebFrameImpl.h"
+#include "WebInputEvent.h"
+#include "WebPopupMenuImpl.h"
+#include "WebScreenInfo.h"
+#include "WebViewClient.h"
+#include "WebViewImpl.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+namespace {
+
+class TestPopupMenuClient : public PopupMenuClient {
+public:
+    // Item at index 0 is selected by default.
+    TestPopupMenuClient() : m_selectIndex(0) { }
+    virtual ~TestPopupMenuClient() {}
+    virtual void valueChanged(unsigned listIndex, bool fireEvents = true)
+    {
+        m_selectIndex = listIndex;
+    }
+
+    virtual String itemText(unsigned listIndex) const
+    {
+        String str("Item ");
+        str.append(String::number(listIndex));
+        return str;
+    }
+    virtual String itemToolTip(unsigned listIndex) const { return itemText(listIndex); }
+    virtual String itemAccessibilityText(unsigned listIndex) const { return itemText(listIndex); }
+    virtual bool itemIsEnabled(unsigned listIndex) const { return true; }
+    virtual PopupMenuStyle itemStyle(unsigned listIndex) const
+    {
+        Font font(FontPlatformData(12.0, false, false), false);
+        return PopupMenuStyle(Color::black, Color::white, font, true, Length(), TextDirection());
+    }
+    virtual PopupMenuStyle menuStyle() const { return itemStyle(0); }
+    virtual int clientInsetLeft() const { return 0; }
+    virtual int clientInsetRight() const { return 0; }
+    virtual int clientPaddingLeft() const { return 0; }
+    virtual int clientPaddingRight() const { return 0; }
+    virtual int listSize() const { return 10; }
+    virtual int selectedIndex() const { return m_selectIndex; }
+    virtual void popupDidHide() { }
+    virtual bool itemIsSeparator(unsigned listIndex) const { return false; }
+    virtual bool itemIsLabel(unsigned listIndex) const { return false; }
+    virtual bool itemIsSelected(unsigned listIndex) const { return listIndex == m_selectIndex; }
+    virtual bool shouldPopOver() const { return false; }
+    virtual bool valueShouldChangeOnHotTrack() const { return false; }
+    virtual void setTextFromItem(unsigned listIndex) { }
+    
+    virtual FontSelector* fontSelector() const { return 0; }
+    virtual HostWindow* hostWindow() const { return 0; }
+    
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) { return 0; }
+
+private:
+    unsigned m_selectIndex;
+};
+
+class TestWebWidgetClient : public WebWidgetClient {
+public:
+    ~TestWebWidgetClient() { }
+};
+
+class TestWebPopupMenuImpl : public WebPopupMenuImpl {
+public:
+    TestWebPopupMenuImpl(WebWidgetClient* client) : WebPopupMenuImpl(client) { }
+    ~TestWebPopupMenuImpl() { }
+};
+
+class TestWebWidget : public WebWidget {
+public:
+    virtual ~TestWebWidget() { }
+    virtual void close() { }
+    virtual WebSize size() { return WebSize(100, 100); }
+    virtual void resize(const WebSize&) { }
+    virtual void layout() { }
+    virtual void paint(WebCanvas*, const WebRect&) { }
+    virtual bool handleInputEvent(const WebInputEvent&) { return true; }
+    virtual void mouseCaptureLost() { }
+    virtual void setFocus(bool) { }
+    virtual bool handleCompositionEvent(WebCompositionCommand command,
+                                        int cursorPosition,
+                                        int targetStart,
+                                        int targetEnd,
+                                        const WebString& text) { return true; }
+    virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) { return true; }
+    virtual void setTextDirection(WebTextDirection) { }
+};
+
+class TestWebViewClient : public WebViewClient {
+public:
+    TestWebViewClient() : m_webPopupMenu(&m_webWidgetClient) { }
+    ~TestWebViewClient() { }
+
+    virtual WebWidget* createPopupMenu(WebPopupType) { return &m_webPopupMenu; }
+
+    // We need to override this so that the popup menu size is not 0
+    // (the layout code checks to see if the popup fits on the screen).
+    virtual WebScreenInfo screenInfo()
+    { 
+        WebScreenInfo screenInfo;
+        screenInfo.availableRect.height = 2000;
+        screenInfo.availableRect.width = 2000;
+        return screenInfo;
+    }
+
+private:
+    TestWebWidgetClient m_webWidgetClient;
+    TestWebPopupMenuImpl m_webPopupMenu;
+};
+
+class TestWebFrameClient : public WebFrameClient {
+public:
+    ~TestWebFrameClient() { }
+};
+
+class SelectPopupMenuTest : public testing::Test {
+public:
+    SelectPopupMenuTest()
+    {
+    }
+
+protected:
+    virtual void SetUp()
+    {
+        m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient));
+        m_webView->initializeMainFrame(&m_webFrameClient);
+        m_popupMenu = PopupMenu::create(&m_popupMenuClient);
+    }
+
+    virtual void TearDown()
+    {
+        m_popupMenu = 0;
+        m_webView->close();
+    }
+
+    // Returns true if there currently is a select popup in the WebView.
+    bool popupOpen() const { return m_webView->selectPopup(); }
+
+    int selectedIndex() const { return m_popupMenuClient.selectedIndex(); }
+
+    void showPopup()
+    {
+        m_popupMenu->show(IntRect(0, 0, 100, 100),
+            static_cast<WebFrameImpl*>(m_webView->mainFrame())->frameView(), 0);
+        ASSERT_TRUE(popupOpen());
+        EXPECT_TRUE(m_webView->selectPopup()->popupType() == PopupContainer::Select);
+    }
+
+    void hidePopup()
+    {
+        m_popupMenu->hide();
+        EXPECT_FALSE(popupOpen());
+    }
+
+    void simulateKeyDownEvent(int keyCode)
+    {
+        simulateKeyEvent(WebInputEvent::RawKeyDown, keyCode);
+    }
+
+    void simulateKeyUpEvent(int keyCode)
+    {
+        simulateKeyEvent(WebInputEvent::KeyUp, keyCode);
+    }
+
+    // Simulates a key event on the WebView.
+    // The WebView forwards the event to the select popup if one is open.
+    void simulateKeyEvent(WebInputEvent::Type eventType, int keyCode)
+    {
+        WebKeyboardEvent keyEvent;
+        keyEvent.windowsKeyCode = keyCode;
+        keyEvent.type = eventType;
+        m_webView->handleInputEvent(keyEvent);
+    }
+
+    // Simulates a mouse event on the select popup.
+    void simulateLeftMouseDownEvent(const IntPoint& point)
+    {
+        PlatformMouseEvent mouseEvent(point, point, LeftButton, MouseEventPressed,
+                                      1, false, false, false, false, 0);
+        m_webView->selectPopup()->handleMouseDownEvent(mouseEvent);
+    }
+    void simulateLeftMouseUpEvent(const IntPoint& point)
+    {
+        PlatformMouseEvent mouseEvent(point, point, LeftButton, MouseEventReleased,
+                                      1, false, false, false, false, 0);
+        m_webView->selectPopup()->handleMouseReleaseEvent(mouseEvent);
+    }
+
+protected:
+    TestWebViewClient m_webviewClient;
+    WebViewImpl* m_webView;
+    TestWebFrameClient m_webFrameClient;
+    TestPopupMenuClient m_popupMenuClient;
+    RefPtr<PopupMenu> m_popupMenu;
+};
+
+// Tests that show/hide and repeats.  Select popups are reused in web pages when
+// they are reopened, that what this is testing.
+TEST_F(SelectPopupMenuTest, ShowThenHide)
+{
+    for (int i = 0; i < 3; i++) {
+        showPopup();
+        hidePopup();
+    }
+}
+
+// Tests that showing a select popup and deleting it does not cause problem.
+// This happens in real-life if a page navigates while a select popup is showing.
+TEST_F(SelectPopupMenuTest, ShowThenDelete)
+{
+    showPopup();
+    // Nothing else to do, TearDown() deletes the popup.
+}
+
+// Tests that losing focus closes the select popup.
+TEST_F(SelectPopupMenuTest, ShowThenLoseFocus)
+{
+    showPopup();
+    // Simulate losing focus.
+    m_webView->setFocus(false);
+
+    // Popup should have closed.
+    EXPECT_FALSE(popupOpen());
+}
+
+// Tests that pressing ESC closes the popup.
+TEST_F(SelectPopupMenuTest, ShowThenPressESC)
+{
+    showPopup();
+    simulateKeyDownEvent(VKEY_ESCAPE);
+    // Popup should have closed.
+    EXPECT_FALSE(popupOpen());
+}
+
+// Tests selecting an item with the arrows and enter/esc/tab.
+TEST_F(SelectPopupMenuTest, SelectWithKeys)
+{
+    showPopup();
+    // Simulate selecting the 2nd item by pressing Down, Down, enter.
+    simulateKeyDownEvent(VKEY_DOWN);
+    simulateKeyDownEvent(VKEY_DOWN);
+    simulateKeyDownEvent(VKEY_RETURN);
+
+    // Popup should have closed.
+    EXPECT_TRUE(!popupOpen());
+    EXPECT_EQ(2, selectedIndex());
+
+    // It should work as well with ESC.
+    showPopup();
+    simulateKeyDownEvent(VKEY_DOWN);
+    simulateKeyDownEvent(VKEY_ESCAPE);
+    EXPECT_FALSE(popupOpen());
+    EXPECT_EQ(3, selectedIndex());
+
+    // It should work as well with TAB.
+    showPopup();
+    simulateKeyDownEvent(VKEY_DOWN);
+    simulateKeyDownEvent(VKEY_TAB);
+    EXPECT_FALSE(popupOpen());
+    EXPECT_EQ(4, selectedIndex());
+}
+
+// Tests that selecting an item with the mouse does select the item and close
+// the popup.
+TEST_F(SelectPopupMenuTest, ClickItem)
+{
+    showPopup();
+
+    // Y of 18 to be on the item at index 1 (12 font plus border and more to be safe).
+    IntPoint row1Point(2, 18);
+    // Simulate a click down/up on the first item.
+    simulateLeftMouseDownEvent(row1Point);
+    simulateLeftMouseUpEvent(row1Point);
+
+    // Popup should have closed and the item at index 1 selected.
+    EXPECT_FALSE(popupOpen());
+    EXPECT_EQ(1, selectedIndex());
+}
+
+// Tests that moving the mouse over an item and then clicking outside the select popup
+// leaves the seleted item unchanged.
+TEST_F(SelectPopupMenuTest, MouseOverItemClickOutside)
+{
+    showPopup();
+
+    // Y of 18 to be on the item at index 1 (12 font plus border and more to be safe).
+    IntPoint row1Point(2, 18);
+    // Simulate the mouse moving over the first item.
+    PlatformMouseEvent mouseEvent(row1Point, row1Point, NoButton, MouseEventMoved,
+                                  1, false, false, false, false, 0);
+    m_webView->selectPopup()->handleMouseMoveEvent(mouseEvent);
+
+    // Click outside the popup.
+    simulateLeftMouseDownEvent(IntPoint(1000, 1000));
+
+    // Popup should have closed and item 0 should still be selected.
+    EXPECT_FALSE(popupOpen());
+    EXPECT_EQ(0, selectedIndex());
+}
+
+// Tests that selecting an item with the keyboard and then clicking outside the select
+// popup does select that item.
+TEST_F(SelectPopupMenuTest, SelectItemWithKeyboardItemClickOutside)
+{
+    showPopup();
+
+    // Simulate selecting the 2nd item by pressing Down, Down.
+    simulateKeyDownEvent(VKEY_DOWN);
+    simulateKeyDownEvent(VKEY_DOWN);
+
+    // Click outside the popup.
+    simulateLeftMouseDownEvent(IntPoint(1000, 1000));
+
+    // Popup should have closed and the item should have been selected.
+    EXPECT_FALSE(popupOpen());
+    EXPECT_EQ(2, selectedIndex());
+}
+
+} // namespace
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png
new file mode 100644
index 0000000..b9395d3
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png
new file mode 100644
index 0000000..224f966
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png
new file mode 100644
index 0000000..b546075
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_press.png b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png
new file mode 100644
index 0000000..7434179
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png
new file mode 100644
index 0000000..4353276
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png
new file mode 100644
index 0000000..3d30818
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png
new file mode 100644
index 0000000..6f397db
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png
new file mode 100644
index 0000000..65750a7
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png
new file mode 100644
index 0000000..0abf6ee
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png
new file mode 100644
index 0000000..522c238
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png
new file mode 100644
index 0000000..cfdc309
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png
new file mode 100644
index 0000000..9fc2d10
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png
new file mode 100644
index 0000000..9aaa4ee
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png
new file mode 100644
index 0000000..1f5c6b8
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png
new file mode 100644
index 0000000..9afe713
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png
new file mode 100644
index 0000000..d920d90
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png
new file mode 100644
index 0000000..4b39c70
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png
new file mode 100644
index 0000000..da54328
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/icon.png b/WebKit/efl/DefaultTheme/widget/combo/icon.png
new file mode 100644
index 0000000..5d9fb96
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/combo/icon.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_focused.png b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png
new file mode 100644
index 0000000..0069d1e
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png
new file mode 100644
index 0000000..fbd07af
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_normal.png b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png
new file mode 100644
index 0000000..7c5f1cf
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_focus.png b/WebKit/efl/DefaultTheme/widget/file/file_focus.png
new file mode 100644
index 0000000..55f5bb8
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/file/file_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_hover.png b/WebKit/efl/DefaultTheme/widget/file/file_hover.png
new file mode 100644
index 0000000..be32454
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/file/file_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_normal.png b/WebKit/efl/DefaultTheme/widget/file/file_normal.png
new file mode 100644
index 0000000..794eba6
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/file/file_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_press.png b/WebKit/efl/DefaultTheme/widget/file/file_press.png
new file mode 100644
index 0000000..4471dc5
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/file/file_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png
new file mode 100644
index 0000000..e249d8f
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
new file mode 100644
index 0000000..b25751c
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
new file mode 100644
index 0000000..9096ef8
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png
new file mode 100644
index 0000000..b1f4085
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
new file mode 100644
index 0000000..a28d3dd
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
new file mode 100644
index 0000000..3a3a35e
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
new file mode 100644
index 0000000..6e55557
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png
new file mode 100644
index 0000000..1116f4e
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
new file mode 100644
index 0000000..bc65102
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
new file mode 100644
index 0000000..db3c685
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
new file mode 100644
index 0000000..9ebdac2
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png
new file mode 100644
index 0000000..d496599
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
new file mode 100644
index 0000000..5ab4f5b
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
new file mode 100644
index 0000000..3ed2219
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png
new file mode 100644
index 0000000..0069d1e
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png
new file mode 100644
index 0000000..fbd07af
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png
new file mode 100644
index 0000000..7c5f1cf
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png
Binary files differ
diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c
new file mode 100644
index 0000000..6a9e4fb
--- /dev/null
+++ b/WebKit/efl/EWebLauncher/main.c
@@ -0,0 +1,771 @@
+/*
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009, 2010 ProFUSION embedded systems
+ * Copyright (C) 2009, 2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "EWebKit.h"
+
+#include <ctype.h>
+#include <Ecore.h>
+#include <Ecore_Data.h>
+#include <Ecore_Evas.h>
+#include <Ecore_File.h>
+#include <Ecore_Getopt.h>
+#include <Ecore_X.h>
+#include <Edje.h>
+#include <Evas.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define DEFAULT_WIDTH      800
+#define DEFAULT_HEIGHT     600
+
+#define info(format, args...)       \
+    do {                            \
+        if (verbose)                \
+            printf(format, ##args); \
+    } while (0)
+
+#define REL_THEME_PATH "../../../WebKit/efl/DefaultTheme/default.edj"
+
+#define MIN_ZOOM_LEVEL 0
+#define DEFAULT_ZOOM_LEVEL 5
+#define MAX_ZOOM_LEVEL 13
+
+static int currentZoomLevel = DEFAULT_ZOOM_LEVEL;
+
+// the zoom values are chosen to be like in Mozilla Firefox 3
+static int zoomLevels[] = {30, 50, 67, 80, 90,
+                            100,
+                            110, 120, 133, 150, 170, 200, 240, 300};
+
+static int verbose = 0;
+
+static Eina_List *windows = NULL;
+
+static char *themePath = NULL;
+
+typedef struct _Window_Properties {
+    Eina_Bool toolbarsVisible:1;
+    Eina_Bool statusbarVisible:1;
+    Eina_Bool scrollbarsVisible:1;
+    Eina_Bool menubarVisible:1;
+} Window_Properties;
+
+Window_Properties windowProperties = { /* Pretend we have them and they are initially visible */
+    EINA_TRUE,
+    EINA_TRUE,
+    EINA_TRUE,
+    EINA_TRUE
+};
+
+static const Ecore_Getopt options = {
+    "EWebLauncher",
+    "%prog [options] [url]",
+    "0.0.1",
+    "(C)2008 INdT (The Nokia Technology Institute)\n"
+    "(C)2009, 2010 ProFUSION embedded systems\n"
+    "(C)2009, 2010 Samsung Electronics",
+    "GPL",
+    "Test Web Browser using the Enlightenment Foundation Libraries of WebKit",
+    EINA_TRUE, {
+        ECORE_GETOPT_STORE_STR
+            ('e', "engine", "ecore-evas engine to use."),
+        ECORE_GETOPT_CALLBACK_NOARGS
+            ('E', "list-engines", "list ecore-evas engines.",
+             ecore_getopt_callback_ecore_evas_list_engines, NULL),
+        ECORE_GETOPT_STORE_DEF_BOOL
+            ('F', "fullscreen", "fullscreen mode.", 0),
+        ECORE_GETOPT_CALLBACK_ARGS
+            ('g', "geometry", "geometry to use in x:y:w:h form.", "X:Y:W:H",
+             ecore_getopt_callback_geometry_parse, NULL),
+        ECORE_GETOPT_STORE_STR
+            ('t', "theme", "path to read the theme file from."),
+        ECORE_GETOPT_STORE_STR
+            ('U', "user-agent", "custom user agent string to use."),
+        ECORE_GETOPT_STORE_DEF_BOOL
+            ('S', "sudo-workaround", "Workaround mode for making Flash work with sudo.", 0),
+        ECORE_GETOPT_COUNT
+            ('v', "verbose", "be more verbose."),
+        ECORE_GETOPT_VERSION
+            ('V', "version"),
+        ECORE_GETOPT_COPYRIGHT
+            ('R', "copyright"),
+        ECORE_GETOPT_LICENSE
+            ('L', "license"),
+        ECORE_GETOPT_HELP
+            ('h', "help"),
+        ECORE_GETOPT_SENTINEL
+    }
+};
+
+typedef struct _ELauncher {
+    Ecore_Evas *ee;
+    Evas *evas;
+    Evas_Object *bg;
+    Evas_Object *browser;
+    const char *theme;
+    const char *userAgent;
+} ELauncher;
+
+void browserDestroy(Ecore_Evas *ee);
+void closeWindow(Ecore_Evas *ee);
+int browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen);
+
+void
+print_history(Eina_List *list)
+{
+    Eina_List *l;
+    void *d;
+
+    if (!verbose)
+       return;
+
+    printf("Session history contains:\n");
+
+    EINA_LIST_FOREACH(list, l, d) {
+       Ewk_History_Item *item = (Ewk_History_Item*)d;
+       cairo_surface_t *cs = ewk_history_item_icon_surface_get(item);
+       char buf[PATH_MAX];
+       ssize_t s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item));
+       for (s--; s >= sizeof("/tmp/favicon-"); s--) {
+           if (!isalnum(buf[s]) && buf[s] != '.')
+               buf[s] = '_';
+       }
+       cs = ewk_history_item_icon_surface_get(item);
+
+       if (cs && cairo_surface_status(cs) == CAIRO_STATUS_SUCCESS)
+           cairo_surface_write_to_png(cs, buf);
+       else
+           buf[0] = '\0';
+
+       printf("* '%s' title='%s' icon='%s'\n",
+              ewk_history_item_uri_original_get(item),
+              ewk_history_item_title_get(item), buf);
+    }
+}
+
+void
+zoom_level_set(Evas_Object *webview, int level)
+{
+    float factor = ((float) zoomLevels[level]) / 100.0;
+    Evas_Coord ox, oy, mx, my, cx, cy;
+    evas_pointer_canvas_xy_get(evas_object_evas_get(webview), &mx, &my);
+    evas_object_geometry_get(webview, &ox, &oy, NULL, NULL);
+    cx = mx - ox;
+    cy = my - oy;
+    ewk_view_zoom_animated_set(webview, factor, 0.5, cx, cy);
+}
+
+char*
+join_path(const char *base, const char *path)
+{
+    char separator[] = "/";
+
+    char tmp[PATH_MAX + 1];
+    char result[PATH_MAX + 1];
+    result[0] = tmp[0] = '\0';
+
+    char *str = strdup(path);
+
+    char *token = NULL;
+    token = strtok(str, separator);
+    int count = 0;
+    do {
+        if (!strcmp(token, ".."))
+            count++;
+        else
+            strcat(tmp, token);
+        token = strtok(NULL, separator);
+        if (!token)
+            break;
+        if (tmp[0])
+            strcat(tmp, separator);
+    } while (EINA_TRUE);
+
+    free(str);
+    str = strdup(base);
+
+    char *base_ptr;
+    while (count--) {
+        base_ptr = strrchr(str, separator[0]);
+        if (!base_ptr) {
+            free(str);
+            return NULL; // couldn't resolve path
+        }
+        *base_ptr = '\0';
+    }
+
+    strcat(result, str);
+    strcat(result, separator);
+    strcat(result, tmp);
+    free(str);
+
+    return strdup(result);
+}
+
+static void
+on_ecore_evas_resize(Ecore_Evas *ee)
+{
+    Evas_Object *webview;
+    Evas_Object *bg;
+    int w, h;
+
+    ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+
+    bg = evas_object_name_find(ecore_evas_get(ee), "bg");
+    evas_object_move(bg, 0, 0);
+    evas_object_resize(bg, w, h);
+
+    webview = evas_object_name_find(ecore_evas_get(ee), "browser");
+    evas_object_move(webview, 10, 10);
+    evas_object_resize(webview, w - 20, h - 20);
+}
+
+static void
+title_set(Ecore_Evas *ee, const char *title, int progress)
+{
+    const char *appname = "EFL Test Launcher";
+    const char *separator = " - ";
+    char label[4096];
+    int size;
+
+    if (!title || !strcmp(title, "")) {
+        ecore_evas_title_set(ee, appname);
+        return;
+    }
+
+    if (progress < 100)
+        size = snprintf(label, sizeof(label), "%s (%d%%)%s%s", title, progress, separator, appname);
+    else
+        size = snprintf(label, sizeof(label), "%s %s%s", title, separator, appname);
+
+    if (size >= (int)sizeof(label))
+        return;
+
+    ecore_evas_title_set(ee, label);
+}
+
+static void
+on_title_changed(void *user_data, Evas_Object *webview, void *event_info)
+{
+    ELauncher *app = (ELauncher *)user_data;
+    const char *title = (const char *)event_info;
+
+    title_set(app->ee, title, 100);
+}
+
+static void
+on_progress(void *user_data, Evas_Object *webview, void *event_info)
+{
+    ELauncher *app = (ELauncher *)user_data;
+    double *progress = (double *)event_info;
+
+    title_set(app->ee, ewk_view_title_get(app->browser), *progress * 100);
+}
+
+static void
+on_load_finished(void *user_data, Evas_Object *webview, void *event_info)
+{
+    const Ewk_Frame_Load_Error *err = (const Ewk_Frame_Load_Error *)event_info;
+
+    if (!err)
+        info("Succeeded loading page.\n");
+    else if (err->is_cancellation)
+        info("Load was cancelled.\n");
+    else
+        info("Failed loading page: %d %s \"%s\", url=%s\n",
+             err->code, err->domain, err->description, err->failing_url);
+}
+
+static void
+on_toolbars_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    if (*visible) {
+        info("Toolbars visible changed: show");
+        windowProperties.toolbarsVisible = EINA_TRUE;
+    } else {
+        info("Toolbars visible changed: hide");
+        windowProperties.toolbarsVisible = EINA_FALSE;
+    }
+}
+
+static void
+on_toolbars_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    *visible = windowProperties.toolbarsVisible;
+}
+
+static void
+on_statusbar_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    if (*visible) {
+        info("Statusbar visible changed: show");
+        windowProperties.statusbarVisible = EINA_TRUE;
+    } else {
+        info("Statusbar visible changed: hide");
+        windowProperties.statusbarVisible = EINA_FALSE;
+    }
+}
+
+static void
+on_statusbar_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    *visible = windowProperties.statusbarVisible;
+}
+
+static void
+on_scrollbars_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    if (*visible) {
+        info("Scrollbars visible changed: show");
+        windowProperties.scrollbarsVisible = EINA_TRUE;
+    } else {
+        info("Scrollbars visible changed: hide");
+        windowProperties.scrollbarsVisible = EINA_FALSE;
+    }
+}
+
+static void
+on_scrollbars_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    *visible = windowProperties.scrollbarsVisible;
+}
+
+static void
+on_menubar_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    if (*visible) {
+        info("Menubar visible changed: show");
+        windowProperties.menubarVisible = EINA_TRUE;
+    } else {
+        info("Menubar visible changed: hide");
+        windowProperties.menubarVisible = EINA_FALSE;
+    }
+}
+
+static void
+on_menubar_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+    Eina_Bool *visible = (Eina_Bool *)event_info;
+    *visible = windowProperties.menubarVisible;
+}
+
+static void
+on_tooltip_text_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+    const char *text = (const char *)event_info;
+    if (text && *text != '\0')
+        info("%s\n", text);
+}
+
+void
+on_mouse_down(void* data, Evas* e, Evas_Object* webview, void* event_info)
+{
+    Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*) event_info;
+    if (ev->button == 2)
+        evas_object_focus_set(webview, !evas_object_focus_get(webview));
+}
+
+void
+on_focus_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+    info("the webview lost keyboard focus\n");
+}
+
+void
+on_focus_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+    info("the webview gained keyboard focus\n");
+}
+
+void
+on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+    Evas_Coord w, h;
+    evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+    ewk_view_fixed_layout_size_set(obj, w, h);
+}
+
+void
+on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+    Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
+    ELauncher *app = data;
+
+    if (!strcmp(ev->key, "Escape")) {
+        closeWindow(app->ee);
+    } else if (!strcmp(ev->key, "F1")) {
+        info("Back (F1) was pressed\n");
+        if (ewk_view_back_possible(obj)) {
+            Ewk_History *history = ewk_view_history_get(obj);
+            Eina_List *list = ewk_history_back_list_get(history);
+            print_history(list);
+            ewk_history_item_list_free(list);
+            ewk_view_back(obj);
+        } else
+            info("Back ignored: No back history\n");
+    } else if (!strcmp(ev->key, "F2")) {
+        info("Forward (F2) was pressed\n");
+        if (ewk_view_forward_possible(obj)) {
+            Ewk_History *history = ewk_view_history_get(obj);
+            Eina_List *list = ewk_history_forward_list_get(history);
+            print_history(list);
+            ewk_history_item_list_free(list);
+            ewk_view_forward(obj);
+        } else
+            info("Forward ignored: No forward history\n");
+    } else if (!strcmp(ev->key, "F4")) {
+        Evas_Object *frame = ewk_view_frame_main_get(obj);
+        Evas_Coord x, y;
+        Ewk_Hit_Test *ht;
+
+        evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
+        ht = ewk_frame_hit_test_new(frame, x, y);
+        if (!ht)
+            printf("No hit test returned for point %d,%d\n", x, y);
+        else {
+            printf("Hit test for point %d,%d\n"
+                   "  pos=%3d,%3d\n"
+                   "  bounding_box=%d,%d + %dx%d\n"
+                   "  title='%s'\n"
+                   "  alternate_text='%s'\n"
+                   "  frame=%p (%s)\n"
+                   "  link {\n"
+                   "    text='%s'\n"
+                   "    url='%s'\n"
+                   "    title='%s'\n"
+                   "    target frame=%p (%s)\n"
+                   "  }\n"
+                   "  flags {\n"
+                   "    editable=%hhu\n"
+                   "    selected=%hhu\n"
+                   "  }\n",
+                   x, y,
+                   ht->x, ht->y,
+                   ht->bounding_box.x, ht->bounding_box.y, ht->bounding_box.w, ht->bounding_box.h,
+                   ht->title,
+                   ht->alternate_text,
+                   ht->frame, evas_object_name_get(ht->frame),
+                   ht->link.text,
+                   ht->link.url,
+                   ht->link.title,
+                   ht->link.target_frame, evas_object_name_get(ht->link.target_frame),
+                   ht->flags.editable,
+                   ht->flags.selected);
+            ewk_frame_hit_test_free(ht);
+        }
+
+    } else if (!strcmp(ev->key, "F5")) {
+        info("Reload (F5) was pressed, reloading.\n");
+        ewk_view_reload(obj);
+    } else if (!strcmp(ev->key, "F6")) {
+        info("Stop (F6) was pressed, stop loading.\n");
+        ewk_view_stop(obj);
+    /* } FIXME: uncomment code below after Bug 18662 lands upstream.
+    else if (!strcmp(ev->key, "F12")) {
+        bool status = ewk_webframe_object_keyboard_navigation_get(page);
+        ewk_webframe_object_keyboard_navigation_set(page, !status);
+        info("Command::keyboard navigation toggle\n");*/
+    } else if (!strcmp(ev->key, "F7")) {
+        info("Zoom out (F7) was pressed.\n");
+        if (currentZoomLevel > MIN_ZOOM_LEVEL)
+            zoom_level_set(obj, --currentZoomLevel);
+    } else if (!strcmp(ev->key, "F8")) {
+        info("Zoom in (F8) was pressed.\n");
+        if (currentZoomLevel < MAX_ZOOM_LEVEL)
+            zoom_level_set(obj, ++currentZoomLevel);
+    } else if (!strcmp(ev->key, "F9")) {
+        info("Create new window (F9) was pressed.\n");
+        Eina_Rectangle geometry = {0, 0, 0, 0};
+        browserCreate("http://www.google.com",
+                       app->theme, app->userAgent, geometry, NULL, 0);
+    } else if (!strcmp(ev->key, "F10")) {
+        Evas_Coord x, y, w, h;
+        Evas_Object *frame = ewk_view_frame_main_get(obj);
+        float zoom = zoomLevels[currentZoomLevel] / 100.0;
+
+        ewk_frame_visible_content_geometry_get(frame, EINA_FALSE, &x, &y, &w, &h);
+        x -= w;
+        y -= h;
+        w *= 4;
+        h *= 4;
+        info("Pre-render %d,%d + %dx%d\n", x, y, w, h);
+        ewk_view_pre_render_region(obj, x, y, w, h, zoom);
+    }
+}
+
+void
+on_browser_del(void *data, Evas *evas, Evas_Object *browser, void *event)
+{
+    ELauncher *app = (ELauncher*) data;
+
+    evas_object_event_callback_del(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down);
+    evas_object_event_callback_del(app->browser, EVAS_CALLBACK_MOUSE_DOWN, on_mouse_down);
+    evas_object_event_callback_del(app->browser, EVAS_CALLBACK_FOCUS_IN, on_focus_in);
+    evas_object_event_callback_del(app->browser, EVAS_CALLBACK_FOCUS_OUT, on_focus_out);
+    evas_object_event_callback_del(app->browser, EVAS_CALLBACK_DEL, on_browser_del);
+}
+
+void
+on_closeWindow(Ecore_Evas *ee)
+{
+    browserDestroy(ee);
+}
+
+int
+quit(Eina_Bool success, const char *msg)
+{
+    edje_shutdown();
+    ecore_evas_shutdown();
+
+    if (msg)
+        fputs(msg, (success) ? stdout : stderr);
+
+    free(themePath);
+
+    if (!success)
+        return EXIT_FAILURE;
+
+    return EXIT_SUCCESS;
+}
+
+int
+browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen)
+{
+    if ((geometry.w <= 0) && (geometry.h <= 0)) {
+        geometry.w = DEFAULT_WIDTH;
+        geometry.h = DEFAULT_HEIGHT;
+    }
+
+    ELauncher *app = (ELauncher*) malloc(sizeof(ELauncher));
+    if (!app)
+        return quit(EINA_FALSE, "ERROR: could not create EWebLauncher window\n");
+
+    app->ee = ecore_evas_new(engine, 0, 0, geometry.w, geometry.h, NULL);
+
+    if (!app->ee)
+        return quit(EINA_FALSE, "ERROR: could not construct evas-ecore\n");
+
+    if (isFullscreen)
+        ecore_evas_fullscreen_set(app->ee, EINA_TRUE);
+
+    ecore_evas_title_set(app->ee, "EFL Test Launcher");
+    ecore_evas_callback_resize_set(app->ee, on_ecore_evas_resize);
+    ecore_evas_callback_delete_request_set(app->ee, closeWindow);
+
+    app->evas = ecore_evas_get(app->ee);
+
+    if (!app->evas)
+        return quit(EINA_FALSE, "ERROR: could not get evas from evas-ecore\n");
+
+    if (!theme)
+        theme = themePath;
+
+    app->theme = theme;
+    app->userAgent = userAgent;
+
+    app->bg = evas_object_rectangle_add(app->evas);
+    evas_object_name_set(app->bg, "bg");
+    evas_object_color_set(app->bg, 255, 0, 255, 255);
+    evas_object_move(app->bg, 0, 0);
+    evas_object_resize(app->bg, geometry.w, geometry.h);
+    evas_object_layer_set(app->bg, EVAS_LAYER_MIN);
+    evas_object_show(app->bg);
+    app->browser = ewk_view_single_add(app->evas);
+
+    ewk_view_theme_set(app->browser, theme);
+    if (userAgent)
+        ewk_view_setting_user_agent_set(app->browser, userAgent);
+    evas_object_name_set(app->browser, "browser");
+
+    evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app);
+    evas_object_smart_callback_add(app->browser, "load,progress", on_progress, app);
+    evas_object_smart_callback_add(app->browser, "load,finished", on_load_finished, app);
+
+    evas_object_smart_callback_add(app->browser, "toolbars,visible,set", on_toolbars_visible_set, app);
+    evas_object_smart_callback_add(app->browser, "toolbars,visible,get", on_toolbars_visible_get, app);
+    evas_object_smart_callback_add(app->browser, "statusbar,visible,set", on_statusbar_visible_set, app);
+    evas_object_smart_callback_add(app->browser, "statusbar,visible,get", on_statusbar_visible_get, app);
+    evas_object_smart_callback_add(app->browser, "scrollbars,visible,set", on_scrollbars_visible_set, app);
+    evas_object_smart_callback_add(app->browser, "scrollbars,visible,get", on_scrollbars_visible_get, app);
+    evas_object_smart_callback_add(app->browser, "menubar,visible,set", on_menubar_visible_set, app);
+    evas_object_smart_callback_add(app->browser, "menubar,visible,get", on_menubar_visible_get, app);
+    evas_object_smart_callback_add(app->browser, "tooltip,text,set", on_tooltip_text_set, app);
+
+/*     ewk_callback_resize_requested_add(app->browser, on_resize_requested, app->ee); */
+
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_RESIZE, on_resized, app);
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_MOUSE_DOWN, on_mouse_down, app);
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_FOCUS_IN, on_focus_in, app);
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_FOCUS_OUT, on_focus_out, app);
+    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_DEL, on_browser_del, app);
+
+    evas_object_move(app->browser, 10, 10);
+    evas_object_resize(app->browser, geometry.w - 20, geometry.h - 20);
+
+    if (url && (url[0] != '\0'))
+        ewk_view_uri_set(app->browser, url);
+
+    evas_object_show(app->browser);
+    ecore_evas_show(app->ee);
+
+    evas_object_focus_set(app->browser, EINA_TRUE);
+
+    windows = eina_list_append(windows, app);
+
+    return 1;
+}
+
+void
+browserDestroy(Ecore_Evas *ee)
+{
+    ecore_evas_free(ee);
+    if (!eina_list_count(windows))
+        ecore_main_loop_quit();
+}
+
+void
+closeWindow(Ecore_Evas *ee)
+{
+    Eina_List *l;
+    void *app;
+    EINA_LIST_FOREACH(windows, l, app)
+    {
+        if (((ELauncher*) app)->ee == ee)
+            break;
+    }
+    windows = eina_list_remove(windows, app);
+    browserDestroy(ee);
+    free(app);
+}
+
+static int
+main_signal_exit(void *data, int ev_type, void *ev)
+{
+    ELauncher *app;
+    while (windows) {
+        app = (ELauncher*) eina_list_data_get(windows);
+        ecore_evas_free(app->ee);
+        windows = eina_list_remove(windows, app);
+    }
+    if (!eina_list_count(windows))
+        ecore_main_loop_quit();
+    return 1;
+}
+
+int
+main(int argc, char *argv[])
+{
+    const char *default_url = "http://www.google.com/";
+
+    Eina_Rectangle geometry = {0, 0, 0, 0};
+    char *url = NULL;
+    char *userAgent = NULL;
+    char *tmp;
+    char path[PATH_MAX];
+
+    char *engine = NULL;
+    char *theme = NULL;
+
+    unsigned char quitOption = 0;
+    unsigned char isFullscreen = 0;
+    unsigned char sudoWorkaround = 0;
+    int args;
+
+    Ecore_Getopt_Value values[] = {
+        ECORE_GETOPT_VALUE_STR(engine),
+        ECORE_GETOPT_VALUE_BOOL(quitOption),
+        ECORE_GETOPT_VALUE_BOOL(isFullscreen),
+        ECORE_GETOPT_VALUE_PTR_CAST(geometry),
+        ECORE_GETOPT_VALUE_STR(theme),
+        ECORE_GETOPT_VALUE_STR(userAgent),
+        ECORE_GETOPT_VALUE_BOOL(sudoWorkaround),
+        ECORE_GETOPT_VALUE_INT(verbose),
+        ECORE_GETOPT_VALUE_BOOL(quitOption),
+        ECORE_GETOPT_VALUE_BOOL(quitOption),
+        ECORE_GETOPT_VALUE_BOOL(quitOption),
+        ECORE_GETOPT_VALUE_BOOL(quitOption),
+        ECORE_GETOPT_VALUE_NONE
+    };
+
+    if (!ecore_evas_init())
+        return EXIT_FAILURE;
+
+    if (!edje_init()) {
+        ecore_evas_shutdown();
+        return EXIT_FAILURE;
+    }
+
+    ecore_app_args_set(argc, (const char**) argv);
+    args = ecore_getopt_parse(&options, values, argc, argv);
+
+    if (args < 0)
+       return quit(EINA_FALSE, "ERROR: could not parse options.\n");
+
+    if (quitOption)
+        return quit(EINA_TRUE, NULL);
+
+    if (args < argc)
+        url = argv[args];
+    else
+        url = (char*) default_url;
+
+    if (sudoWorkaround)
+        strcat(getenv("HOME"), "blah");
+
+    themePath = join_path(argv[0], REL_THEME_PATH);
+
+    ewk_init();
+    tmp = getenv("TMPDIR");
+    if (!tmp)
+        tmp = "/tmp";
+    snprintf(path, sizeof(path), "%s/.ewebkit-%u", tmp, getuid());
+    ecore_file_mkpath(path);
+    ewk_settings_icon_database_path_set(path);
+
+    browserCreate(url, theme, userAgent, geometry, engine, isFullscreen);
+    ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
+
+    ecore_main_loop_begin();
+
+    ewk_shutdown();
+
+    return quit(EINA_TRUE, NULL);
+}
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
new file mode 100644
index 0000000..1174f83
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -0,0 +1,395 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2008 Diego Gonzalez
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "ChromeClientEfl.h"
+
+#include "DatabaseTracker.h"
+#include "EWebKit.h"
+#include "FloatRect.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClientEfl.h"
+#include "HitTestResult.h"
+#include "IntRect.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "WindowFeatures.h"
+#include "ewk_private.h"
+#include <wtf/text/CString.h>
+
+using namespace WebCore;
+
+static inline Evas_Object* kit(WebCore::Frame* frame)
+{
+    if (!frame)
+        return 0;
+
+    FrameLoaderClientEfl* client = static_cast<FrameLoaderClientEfl*>(frame->loader()->client());
+    return client ? client->webFrame() : 0;
+}
+
+namespace WebCore {
+
+ChromeClientEfl::ChromeClientEfl(Evas_Object *view)
+    : m_view(view)
+{
+}
+
+ChromeClientEfl::~ChromeClientEfl()
+{
+}
+
+void ChromeClientEfl::chromeDestroyed()
+{
+    delete this;
+}
+
+void ChromeClientEfl::focusedNodeChanged(Node*)
+{
+    notImplemented();
+}
+
+FloatRect ChromeClientEfl::windowRect()
+{
+    notImplemented();
+    return FloatRect();
+}
+
+void ChromeClientEfl::setWindowRect(const FloatRect& rect)
+{
+    notImplemented();
+}
+
+FloatRect ChromeClientEfl::pageRect()
+{
+    notImplemented();
+    return FloatRect();
+}
+
+float ChromeClientEfl::scaleFactor()
+{
+    notImplemented();
+    return 1.0;
+}
+
+void ChromeClientEfl::focus()
+{
+    evas_object_focus_set(m_view, EINA_TRUE);
+}
+
+void ChromeClientEfl::unfocus()
+{
+    evas_object_focus_set(m_view, EINA_FALSE);
+}
+
+Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+{
+    notImplemented();
+    return 0;
+}
+
+void ChromeClientEfl::show()
+{
+    ewk_view_ready(m_view);
+}
+
+bool ChromeClientEfl::canRunModal()
+{
+    notImplemented();
+    return false;
+}
+
+void ChromeClientEfl::runModal()
+{
+    notImplemented();
+}
+
+void ChromeClientEfl::setToolbarsVisible(bool visible)
+{
+    ewk_view_toolbars_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::toolbarsVisible()
+{
+    Eina_Bool visible;
+
+    ewk_view_toolbars_visible_get(m_view, &visible);
+    return visible;
+}
+
+void ChromeClientEfl::setStatusbarVisible(bool visible)
+{
+    ewk_view_statusbar_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::statusbarVisible()
+{
+    Eina_Bool visible;
+
+    ewk_view_statusbar_visible_get(m_view, &visible);
+    return visible;
+}
+
+void ChromeClientEfl::setScrollbarsVisible(bool visible)
+{
+    ewk_view_scrollbars_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::scrollbarsVisible()
+{
+    Eina_Bool visible;
+
+    ewk_view_scrollbars_visible_get(m_view, &visible);
+    return visible;
+}
+
+void ChromeClientEfl::setMenubarVisible(bool visible)
+{
+    ewk_view_menubar_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::menubarVisible()
+{
+    Eina_Bool visible;
+
+    ewk_view_menubar_visible_get(m_view, &visible);
+    return visible;
+}
+
+void ChromeClientEfl::setResizable(bool)
+{
+    notImplemented();
+}
+
+void ChromeClientEfl::closeWindowSoon()
+{
+    ewk_view_stop(m_view);
+}
+
+bool ChromeClientEfl::canTakeFocus(FocusDirection)
+{
+    // This is called when cycling through links/focusable objects and we
+    // reach the last focusable object.
+    return false;
+}
+
+void ChromeClientEfl::takeFocus(FocusDirection)
+{
+    unfocus();
+}
+
+bool ChromeClientEfl::canRunBeforeUnloadConfirmPanel()
+{
+    return true;
+}
+
+bool ChromeClientEfl::runBeforeUnloadConfirmPanel(const String& message, WebCore::Frame* frame)
+{
+    return runJavaScriptConfirm(frame, message);
+}
+
+void ChromeClientEfl::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
+                                          unsigned int lineNumber, const String& sourceID)
+{
+    ewk_view_add_console_message(m_view, message.utf8().data(), lineNumber, sourceID.utf8().data());
+}
+
+void ChromeClientEfl::runJavaScriptAlert(Frame* frame, const String& message)
+{
+    ewk_view_run_javascript_alert(m_view, kit(frame), message.utf8().data());
+}
+
+bool ChromeClientEfl::runJavaScriptConfirm(Frame* frame, const String& message)
+{
+    return ewk_view_run_javascript_confirm(m_view, kit(frame), message.utf8().data());
+}
+
+bool ChromeClientEfl::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
+{
+    char* value = 0;
+    ewk_view_run_javascript_prompt(m_view, kit(frame), message.utf8().data(), defaultValue.utf8().data(), &value);
+    if (value) {
+        result = String::fromUTF8(value);
+        free(value);
+        return true;
+    }
+    return false;
+}
+
+void ChromeClientEfl::setStatusbarText(const String& string)
+{
+    ewk_view_statusbar_text_set(m_view, string.utf8().data());
+}
+
+bool ChromeClientEfl::shouldInterruptJavaScript()
+{
+    return ewk_view_should_interrupt_javascript(m_view);
+}
+
+bool ChromeClientEfl::tabsToLinks() const
+{
+    return true;
+}
+
+IntRect ChromeClientEfl::windowResizerRect() const
+{
+    notImplemented();
+    // Implementing this function will make repaint being
+    // called during resize, but as this will be done with
+    // a minor delay it adds a weird "filling" effect due
+    // to us using an evas image for showing the cairo
+    // context. So instead of implementing this function
+    // we call paint directly during resize with
+    // the new object size as its argument.
+    return IntRect();
+}
+
+void ChromeClientEfl::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+{
+    Evas_Coord x, y, w, h;
+
+    if (!contentChanged)
+        return;
+
+    x = windowRect.x();
+    y = windowRect.y();
+    w = windowRect.width();
+    h = windowRect.height();
+    ewk_view_repaint(m_view, x, y, w, h);
+}
+
+void ChromeClientEfl::contentsSizeChanged(Frame* frame, const IntSize& size) const
+{
+    ewk_frame_contents_size_changed(kit(frame), size.width(), size.height());
+}
+
+bool ChromeClientEfl::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect, bool canBlit, bool isMainFrame)
+{
+    ewk_view_scroll(m_view, delta.width(), delta.height(), scrollViewRect.x(), scrollViewRect.y(), scrollViewRect.width(), scrollViewRect.height(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height(), isMainFrame);
+    return canBlit;
+}
+
+IntRect ChromeClientEfl::windowToScreen(const IntRect& rect) const
+{
+    notImplemented();
+    return rect;
+}
+
+IntPoint ChromeClientEfl::screenToWindow(const IntPoint& point) const
+{
+    notImplemented();
+    return point;
+}
+
+PlatformPageClient ChromeClientEfl::platformPageClient() const
+{
+    return m_view;
+}
+
+void ChromeClientEfl::scrollbarsModeDidChange() const
+{
+}
+
+void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
+{
+    // FIXME, compare with old link, look at Qt impl.
+    bool isLink = hit.isLiveLink();
+    if (isLink) {
+        KURL url = hit.absoluteLinkURL();
+        if (!url.isEmpty() && url != m_hoveredLinkURL) {
+            const char *link[2];
+            TextDirection dir;
+            CString urlStr = url.prettyURL().utf8();
+            CString titleStr = hit.title(dir).utf8();
+            link[0] = urlStr.data();
+            link[1] = titleStr.data();
+            ewk_view_mouse_link_hover_in(m_view, link);
+            m_hoveredLinkURL = url;
+        }
+    } else if (!isLink && !m_hoveredLinkURL.isEmpty()) {
+        ewk_view_mouse_link_hover_out(m_view);
+        m_hoveredLinkURL = KURL();
+    }
+}
+
+void ChromeClientEfl::setToolTip(const String& toolTip, TextDirection)
+{
+    ewk_view_tooltip_text_set(m_view, toolTip.utf8().data());
+}
+
+void ChromeClientEfl::print(Frame* frame)
+{
+    notImplemented();
+}
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded)
+{
+    // FIXME: Free some space.
+    notImplemented();
+}
+#endif
+
+void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName)
+{
+    uint64_t quota = ewk_settings_web_database_default_quota_get();
+
+    if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin()))
+        DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota);
+
+    ewk_view_exceeded_database_quota(m_view, kit(frame), databaseName.utf8().data());
+}
+
+void ChromeClientEfl::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
+{
+    notImplemented();
+}
+
+void ChromeClientEfl::formStateDidChange(const Node*)
+{
+    notImplemented();
+}
+
+bool ChromeClientEfl::setCursor(PlatformCursorHandle)
+{
+    notImplemented();
+    return false;
+}
+
+void ChromeClientEfl::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+{
+    // See the comment in WebCore/page/ChromeClient.h
+    notImplemented();
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
new file mode 100644
index 0000000..0e17806
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 ChromeClientEfl_h
+#define ChromeClientEfl_h
+
+#include "ChromeClient.h"
+#include "KURL.h"
+#include <Evas.h>
+
+namespace WebCore {
+
+class ChromeClientEfl : public ChromeClient {
+public:
+    explicit ChromeClientEfl(Evas_Object *view);
+    virtual ~ChromeClientEfl();
+
+    virtual void chromeDestroyed();
+
+    virtual void setWindowRect(const FloatRect&);
+    virtual FloatRect windowRect();
+
+    virtual FloatRect pageRect();
+
+    virtual float scaleFactor();
+
+    virtual void focus();
+    virtual void unfocus();
+
+    virtual bool canTakeFocus(FocusDirection);
+    virtual void takeFocus(FocusDirection);
+
+    virtual void focusedNodeChanged(WebCore::Node*);
+
+    virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+    virtual void show();
+
+    virtual bool canRunModal();
+    virtual void runModal();
+
+    virtual void setToolbarsVisible(bool);
+    virtual bool toolbarsVisible();
+
+    virtual void setStatusbarVisible(bool);
+    virtual bool statusbarVisible();
+
+    virtual void setScrollbarsVisible(bool);
+    virtual bool scrollbarsVisible();
+
+    virtual void setMenubarVisible(bool);
+    virtual bool menubarVisible();
+
+    virtual void setResizable(bool);
+
+    virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
+                                     unsigned int lineNumber, const String& sourceID);
+
+    virtual bool canRunBeforeUnloadConfirmPanel();
+    virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
+
+    virtual void closeWindowSoon();
+
+    virtual void runJavaScriptAlert(Frame*, const String&);
+    virtual bool runJavaScriptConfirm(Frame*, const String&);
+    virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
+    virtual void setStatusbarText(const String&);
+    virtual bool shouldInterruptJavaScript();
+    virtual bool tabsToLinks() const;
+
+    virtual IntRect windowResizerRect() const;
+
+    virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+    virtual void contentsSizeChanged(Frame*, const IntSize&) const;
+    virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit, bool isMainFrame);
+    virtual IntPoint screenToWindow(const IntPoint&) const;
+    virtual IntRect windowToScreen(const IntRect&) const;
+    virtual PlatformPageClient platformPageClient() const;
+
+    virtual void scrollbarsModeDidChange() const;
+    virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
+
+    virtual void setToolTip(const String&, TextDirection);
+
+    virtual void print(Frame*);
+
+#if ENABLE(DATABASE)
+    virtual void exceededDatabaseQuota(Frame*, const String&);
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
+#endif
+
+    virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+    virtual void formStateDidChange(const Node*);
+
+    virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
+
+    virtual bool setCursor(PlatformCursorHandle);
+
+    virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
+
+    virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+
+    Evas_Object *m_view;
+    KURL m_hoveredLinkURL;
+};
+}
+
+#endif // ChromeClientEfl_h
diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
new file mode 100644
index 0000000..aaa64d7
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2010 ProFUSION embedded systems
+ * Copyright (C) 2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "ContextMenuClientEfl.h"
+
+#include "ContextMenu.h"
+#include "HitTestResult.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+ContextMenuClientEfl::ContextMenuClientEfl(Evas_Object* view)
+    : m_view(view)
+{
+}
+
+void ContextMenuClientEfl::contextMenuDestroyed()
+{
+    delete this;
+}
+
+PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu*)
+{
+    notImplemented();
+    return 0;
+}
+
+void ContextMenuClientEfl::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::downloadURL(const KURL&)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::searchWithGoogle(const Frame*)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::lookUpInDictionary(Frame*)
+{
+    notImplemented();
+}
+
+bool ContextMenuClientEfl::isSpeaking()
+{
+    notImplemented();
+    return false;
+}
+
+void ContextMenuClientEfl::speak(const String&)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::stopSpeaking()
+{
+    notImplemented();
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
new file mode 100644
index 0000000..2c3818c
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 ProFUSION embedded systems
+ * Copyright (C) 2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 ContextMenuClientEfl_h
+#define ContextMenuClientEfl_h
+
+#include "ContextMenuClient.h"
+#include "EWebKit.h"
+
+namespace WebCore {
+
+class ContextMenu;
+
+class ContextMenuClientEfl : public ContextMenuClient {
+ public:
+    explicit ContextMenuClientEfl(Evas_Object*);
+
+    virtual void contextMenuDestroyed();
+
+    virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*);
+    virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*);
+
+    virtual void downloadURL(const KURL&);
+    virtual void searchWithGoogle(const Frame*);
+    virtual void lookUpInDictionary(Frame*);
+    virtual void speak(const String&);
+    virtual bool isSpeaking();
+    virtual void stopSpeaking();
+
+ private:
+    Evas_Object* m_view;
+};
+}
+
+#endif // ContextMenuClientEfl_h
diff --git a/WebKit/efl/WebCoreSupport/DragClientEfl.cpp b/WebKit/efl/WebCoreSupport/DragClientEfl.cpp
new file mode 100644
index 0000000..d6610e1
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/DragClientEfl.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "DragClientEfl.h"
+
+#include "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void DragClientEfl::willPerformDragDestinationAction(DragDestinationAction, DragData*)
+{
+    notImplemented();
+}
+
+void DragClientEfl::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*)
+{
+    notImplemented();
+}
+
+DragDestinationAction DragClientEfl::actionMaskForDrag(DragData*)
+{
+    return DragDestinationActionAny;
+}
+
+DragSourceAction DragClientEfl::dragSourceActionMaskForPoint(const IntPoint&)
+{
+    return DragSourceActionAny;
+}
+
+void DragClientEfl::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool)
+{
+    notImplemented();
+}
+
+DragImageRef DragClientEfl::createDragImageForLink(KURL&, const String& label, Frame*)
+{
+    return 0;
+}
+
+void DragClientEfl::dragControllerDestroyed()
+{
+    delete this;
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/DragClientEfl.h b/WebKit/efl/WebCoreSupport/DragClientEfl.h
new file mode 100644
index 0000000..40bb6ad
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/DragClientEfl.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 DragClientEfl_h
+#define DragClientEfl_h
+
+#include "DragClient.h"
+
+namespace WebCore {
+class DragClientEfl : public WebCore::DragClient {
+public:
+    virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*);
+    virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
+    virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*);
+
+    virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint);
+
+    virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false);
+    virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*);
+
+    virtual void dragControllerDestroyed();
+};
+}
+
+#endif // DragClientEfl_h
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
new file mode 100644
index 0000000..b87a91a
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -0,0 +1,493 @@
+/*
+ *  Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ *  Copyright (C) 2008 Nuanti Ltd.
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "EditorClientEfl.h"
+
+#include "EWebKit.h"
+#include "EditCommand.h"
+#include "Editor.h"
+#include "EventNames.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "KeyboardEvent.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "WindowsKeyboardCodes.h"
+#include "ewk_private.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void EditorClientEfl::setInputMethodState(bool active)
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::shouldDeleteRange(Range*)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldShowDeleteInterface(HTMLElement*)
+{
+    return false;
+}
+
+bool EditorClientEfl::isContinuousSpellCheckingEnabled()
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientEfl::isGrammarCheckingEnabled()
+{
+    notImplemented();
+    return false;
+}
+
+int EditorClientEfl::spellCheckerDocumentTag()
+{
+    notImplemented();
+    return 0;
+}
+
+bool EditorClientEfl::shouldBeginEditing(Range*)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldEndEditing(Range*)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldInsertText(const String&, Range*, EditorInsertAction)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldApplyStyle(CSSStyleDeclaration*, Range*)
+{
+    notImplemented();
+    return true;
+}
+
+bool EditorClientEfl::shouldMoveRangeAfterDelete(Range*, Range*)
+{
+    notImplemented();
+    return true;
+}
+
+void EditorClientEfl::didBeginEditing()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::respondToChangedContents()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::respondToChangedSelection()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::didEndEditing()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::didWriteSelectionToPasteboard()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::didSetSelectionTypesForPasteboard()
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::isEditable()
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientEfl::registerCommandForUndo(WTF::PassRefPtr<EditCommand>)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::registerCommandForRedo(WTF::PassRefPtr<EditCommand>)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::clearUndoRedoOperations()
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::canUndo() const
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientEfl::canRedo() const
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientEfl::undo()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::redo()
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::shouldInsertNode(Node*, Range*, EditorInsertAction)
+{
+    notImplemented();
+    return true;
+}
+
+void EditorClientEfl::pageDestroyed()
+{
+    delete this;
+}
+
+bool EditorClientEfl::smartInsertDeleteEnabled()
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientEfl::isSelectTrailingWhitespaceEnabled()
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientEfl::toggleContinuousSpellChecking()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::toggleGrammarChecking()
+{
+    notImplemented();
+}
+
+static const unsigned CtrlKey = 1 << 0;
+static const unsigned AltKey = 1 << 1;
+static const unsigned ShiftKey = 1 << 2;
+
+struct KeyDownEntry {
+    unsigned virtualKey;
+    unsigned modifiers;
+    const char* name;
+};
+
+struct KeyPressEntry {
+    unsigned charCode;
+    unsigned modifiers;
+    const char* name;
+};
+
+static const KeyDownEntry keyDownEntries[] = {
+    { VK_LEFT,   0,                  "MoveLeft"                                    },
+    { VK_LEFT,   ShiftKey,           "MoveLeftAndModifySelection"                  },
+    { VK_LEFT,   CtrlKey,            "MoveWordLeft"                                },
+    { VK_LEFT,   CtrlKey | ShiftKey, "MoveWordLeftAndModifySelection"              },
+    { VK_RIGHT,  0,                  "MoveRight"                                   },
+    { VK_RIGHT,  ShiftKey,           "MoveRightAndModifySelection"                 },
+    { VK_RIGHT,  CtrlKey,            "MoveWordRight"                               },
+    { VK_RIGHT,  CtrlKey | ShiftKey, "MoveWordRightAndModifySelection"             },
+    { VK_UP,     0,                  "MoveUp"                                      },
+    { VK_UP,     ShiftKey,           "MoveUpAndModifySelection"                    },
+    { VK_PRIOR,  ShiftKey,           "MovePageUpAndModifySelection"                },
+    { VK_DOWN,   0,                  "MoveDown"                                    },
+    { VK_DOWN,   ShiftKey,           "MoveDownAndModifySelection"                  },
+    { VK_NEXT,   ShiftKey,           "MovePageDownAndModifySelection"              },
+    { VK_PRIOR,  0,                  "MovePageUp"                                  },
+    { VK_NEXT,   0,                  "MovePageDown"                                },
+    { VK_HOME,   0,                  "MoveToBeginningOfLine"                       },
+    { VK_HOME,   ShiftKey,           "MoveToBeginningOfLineAndModifySelection"     },
+    { VK_HOME,   CtrlKey,            "MoveToBeginningOfDocument"                   },
+    { VK_HOME,   CtrlKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" },
+
+    { VK_END,    0,                  "MoveToEndOfLine"                             },
+    { VK_END,    ShiftKey,           "MoveToEndOfLineAndModifySelection"           },
+    { VK_END,    CtrlKey,            "MoveToEndOfDocument"                         },
+    { VK_END,    CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection"       },
+
+    { VK_BACK,   0,                  "DeleteBackward"                              },
+    { VK_BACK,   ShiftKey,           "DeleteBackward"                              },
+    { VK_DELETE, 0,                  "DeleteForward"                               },
+    { VK_BACK,   CtrlKey,            "DeleteWordBackward"                          },
+    { VK_DELETE, CtrlKey,            "DeleteWordForward"                           },
+
+    { 'B',       CtrlKey,            "ToggleBold"                                  },
+    { 'I',       CtrlKey,            "ToggleItalic"                                },
+
+    { VK_ESCAPE, 0,                  "Cancel"                                      },
+    { VK_OEM_PERIOD, CtrlKey,        "Cancel"                                      },
+    { VK_TAB,    0,                  "InsertTab"                                   },
+    { VK_TAB,    ShiftKey,           "InsertBacktab"                               },
+    { VK_RETURN, 0,                  "InsertNewline"                               },
+    { VK_RETURN, CtrlKey,            "InsertNewline"                               },
+    { VK_RETURN, AltKey,             "InsertNewline"                               },
+    { VK_RETURN, AltKey | ShiftKey,  "InsertNewline"                               },
+};
+
+static const KeyPressEntry keyPressEntries[] = {
+    { '\t',   0,                  "InsertTab"                                   },
+    { '\t',   ShiftKey,           "InsertBacktab"                               },
+    { '\r',   0,                  "InsertNewline"                               },
+    { '\r',   CtrlKey,            "InsertNewline"                               },
+    { '\r',   AltKey,             "InsertNewline"                               },
+    { '\r',   AltKey | ShiftKey,  "InsertNewline"                               },
+};
+
+#define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0]))
+
+const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event)
+{
+    ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent);
+
+    static HashMap<int, const char*>* keyDownCommandsMap = 0;
+    static HashMap<int, const char*>* keyPressCommandsMap = 0;
+
+    if (!keyDownCommandsMap) {
+        keyDownCommandsMap = new HashMap<int, const char*>;
+        keyPressCommandsMap = new HashMap<int, const char*>;
+
+        for (unsigned i = 0; i < ARRAYSIZE(keyDownEntries); i++)
+            keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
+
+        for (unsigned i = 0; i < ARRAYSIZE(keyPressEntries); i++)
+            keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
+    }
+
+    unsigned modifiers = 0;
+    if (event->shiftKey())
+        modifiers |= ShiftKey;
+    if (event->altKey())
+        modifiers |= AltKey;
+    if (event->ctrlKey())
+        modifiers |= CtrlKey;
+
+    if (event->type() == eventNames().keydownEvent) {
+        int mapKey = modifiers << 16 | event->keyCode();
+        return mapKey ? keyDownCommandsMap->get(mapKey) : 0;
+    }
+
+    int mapKey = modifiers << 16 | event->charCode();
+    return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
+}
+
+bool EditorClientEfl::handleEditingKeyboardEvent(KeyboardEvent* event)
+{
+    Node* node = event->target()->toNode();
+    ASSERT(node);
+    Frame* frame = node->document()->frame();
+    ASSERT(frame);
+
+    const PlatformKeyboardEvent* keyEvent = event->keyEvent();
+    if (!keyEvent)
+        return false;
+
+    bool caretBrowsing = frame->settings()->caretBrowsingEnabled();
+    if (caretBrowsing) {
+        switch (keyEvent->windowsVirtualKeyCode()) {
+        case VK_LEFT:
+            frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
+                    SelectionController::LEFT,
+                    keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
+                    true);
+            return true;
+        case VK_RIGHT:
+            frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
+                    SelectionController::RIGHT,
+                    keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
+                    true);
+            return true;
+        case VK_UP:
+            frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
+                    SelectionController::BACKWARD,
+                    keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
+                    true);
+            return true;
+        case VK_DOWN:
+            frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE,
+                    SelectionController::FORWARD,
+                    keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
+                    true);
+            return true;
+        }
+    }
+
+    Editor::Command command = frame->editor()->command(interpretKeyEvent(event));
+
+    if (keyEvent->type() == PlatformKeyboardEvent::RawKeyDown) {
+        // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated,
+        // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated
+        // (e.g. Tab that inserts a Tab character, or Enter).
+        return !command.isTextInsertion() && command.execute(event);
+    }
+
+    if (command.execute(event))
+        return true;
+
+    // Don't insert null or control characters as they can result in unexpected behaviour
+    if (event->charCode() < ' ')
+        return false;
+
+    // Don't insert anything if a modifier is pressed
+    if (keyEvent->ctrlKey() || keyEvent->altKey())
+        return false;
+
+    return frame->editor()->insertText(event->keyEvent()->text(), event);
+}
+
+void EditorClientEfl::handleKeyboardEvent(KeyboardEvent* event)
+{
+    if (handleEditingKeyboardEvent(event))
+        event->setDefaultHandled();
+}
+
+void EditorClientEfl::handleInputMethodKeydown(KeyboardEvent* event)
+{
+}
+
+EditorClientEfl::EditorClientEfl(Evas_Object *view)
+    : m_view(view)
+{
+    notImplemented();
+}
+
+EditorClientEfl::~EditorClientEfl()
+{
+    notImplemented();
+}
+
+void EditorClientEfl::textFieldDidBeginEditing(Element*)
+{
+}
+
+void EditorClientEfl::textFieldDidEndEditing(Element*)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::textDidChangeInTextField(Element*)
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
+{
+    return false;
+}
+
+void EditorClientEfl::textWillBeDeletedInTextField(Element*)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::textDidChangeInTextArea(Element*)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::ignoreWordInSpellDocument(const String&)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::learnWord(const String&)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::checkSpellingOfString(const UChar*, int, int*, int*)
+{
+    notImplemented();
+}
+
+String EditorClientEfl::getAutoCorrectSuggestionForMisspelledWord(const String&)
+{
+    notImplemented();
+    return String();
+}
+
+void EditorClientEfl::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::updateSpellingUIWithMisspelledWord(const String&)
+{
+    notImplemented();
+}
+
+void EditorClientEfl::showSpellingUI(bool)
+{
+    notImplemented();
+}
+
+bool EditorClientEfl::spellingUIIsShowing()
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientEfl::getGuessesForWord(const String&, Vector<String>&)
+{
+    notImplemented();
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.h b/WebKit/efl/WebCoreSupport/EditorClientEfl.h
new file mode 100644
index 0000000..ead1169
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 EditorClientEfl_h
+#define EditorClientEfl_h
+
+#include "EditorClient.h"
+#include <Evas.h>
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+class Page;
+
+class EditorClientEfl : public EditorClient {
+public:
+    EditorClientEfl(Evas_Object *view);
+    ~EditorClientEfl();
+
+    // from EditorClient
+    virtual void pageDestroyed();
+
+    virtual bool shouldDeleteRange(Range*);
+    virtual bool shouldShowDeleteInterface(HTMLElement*);
+    virtual bool smartInsertDeleteEnabled();
+    virtual bool isSelectTrailingWhitespaceEnabled();
+    virtual bool isContinuousSpellCheckingEnabled();
+    virtual void toggleContinuousSpellChecking();
+    virtual bool isGrammarCheckingEnabled();
+    virtual void toggleGrammarChecking();
+    virtual int spellCheckerDocumentTag();
+
+    virtual bool isEditable();
+
+    virtual bool shouldBeginEditing(Range*);
+    virtual bool shouldEndEditing(Range*);
+    virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
+    virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
+    virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
+
+    virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
+
+    virtual bool shouldMoveRangeAfterDelete(Range*, Range*);
+
+    virtual void didBeginEditing();
+    virtual void respondToChangedContents();
+    virtual void respondToChangedSelection();
+    virtual void didEndEditing();
+    virtual void didWriteSelectionToPasteboard();
+    virtual void didSetSelectionTypesForPasteboard();
+
+    virtual void registerCommandForUndo(WTF::PassRefPtr<EditCommand>);
+    virtual void registerCommandForRedo(WTF::PassRefPtr<EditCommand>);
+    virtual void clearUndoRedoOperations();
+
+    virtual bool canUndo() const;
+    virtual bool canRedo() const;
+
+    virtual void undo();
+    virtual void redo();
+
+    virtual const char* interpretKeyEvent(const KeyboardEvent* event);
+    virtual bool handleEditingKeyboardEvent(KeyboardEvent*);
+    virtual void handleKeyboardEvent(KeyboardEvent*);
+    virtual void handleInputMethodKeydown(KeyboardEvent*);
+
+    virtual void textFieldDidBeginEditing(Element*);
+    virtual void textFieldDidEndEditing(Element*);
+    virtual void textDidChangeInTextField(Element*);
+    virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
+    virtual void textWillBeDeletedInTextField(Element*);
+    virtual void textDidChangeInTextArea(Element*);
+
+    virtual void ignoreWordInSpellDocument(const String&);
+    virtual void learnWord(const String&);
+    virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
+    virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord);
+    virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
+    virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&);
+    virtual void updateSpellingUIWithMisspelledWord(const String&);
+    virtual void showSpellingUI(bool show);
+    virtual bool spellingUIIsShowing();
+    virtual void getGuessesForWord(const String&, WTF::Vector<String>& guesses);
+    virtual void setInputMethodState(bool enabled);
+
+private:
+    Evas_Object *m_view;
+};
+}
+
+#endif // EditorClientEfl_h
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
new file mode 100644
index 0000000..8a7fd2d
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -0,0 +1,868 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 "FrameLoaderClientEfl.h"
+
+#include "DocumentLoader.h"
+#include "EWebKit.h"
+#include "FormState.h"
+#include "FrameLoader.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "HTMLFormElement.h"
+#include "Language.h"
+#include "MIMETypeRegistry.h"
+#include "NotImplemented.h"
+#include "PluginDatabase.h"
+#include "ProgressTracker.h"
+#include "RenderPart.h"
+#include "ResourceRequest.h"
+#include "ewk_private.h"
+#include <wtf/text/CString.h>
+
+#if PLATFORM(UNIX)
+#include <sys/utsname.h>
+#endif
+
+#include <Ecore_Evas.h>
+
+using namespace WebCore;
+
+namespace WebCore {
+
+FrameLoaderClientEfl::FrameLoaderClientEfl(Evas_Object *view)
+    : m_view(view)
+    , m_frame(0)
+    , m_firstData(false)
+    , m_userAgent("")
+    , m_customUserAgent("")
+    , m_pluginView(0)
+    , m_hasSentResponseToPlugin(false)
+{
+}
+
+static String agentPlatform()
+{
+    notImplemented();
+    return "Unknown";
+}
+
+static String agentOS()
+{
+#if PLATFORM(DARWIN)
+#if PLATFORM(X86)
+    return "Intel Mac OS X";
+#else
+    return "PPC Mac OS X";
+#endif
+#elif PLATFORM(UNIX)
+    struct utsname name;
+    if (uname(&name) != -1)
+        return String::format("%s %s", name.sysname, name.machine);
+
+    return "Unknown";
+#elif PLATFORM(WIN_OS)
+    // FIXME: Compute the Windows version
+    return "Windows";
+#else
+    notImplemented();
+    return "Unknown";
+#endif
+}
+
+static String composeUserAgent()
+{
+    // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html
+    // See also http://developer.apple.com/internet/safari/faq.html#anchor2
+
+    String ua;
+
+    // Product
+    ua += "Mozilla/5.0";
+
+    // Comment
+    ua += " (";
+    ua += agentPlatform(); // Platform
+    ua += "; U; "; // Security
+    ua += agentOS(); // OS-or-CPU
+    ua += "; ";
+    ua += defaultLanguage(); // Localization information
+    ua += ") ";
+
+    // WebKit Product
+    // FIXME: The WebKit version is hardcoded
+    static const String webKitVersion = "525.1+";
+    ua += "AppleWebKit/" + webKitVersion;
+    ua += " (KHTML, like Gecko, ";
+    // We mention Safari since many broken sites check for it (OmniWeb does this too)
+    // We re-use the WebKit version, though it doesn't seem to matter much in practice
+    ua += "Safari/" + webKitVersion;
+    ua += ") ";
+
+    // Vendor Product
+    // ua += g_get_prgname();
+
+    return ua;
+}
+
+void FrameLoaderClientEfl::setCustomUserAgent(const String &agent)
+{
+    m_customUserAgent = agent;
+}
+
+const String& FrameLoaderClientEfl::customUserAgent() const
+{
+    return m_customUserAgent;
+}
+
+String FrameLoaderClientEfl::userAgent(const KURL&)
+{
+    if (!m_customUserAgent.isEmpty())
+        return m_customUserAgent;
+
+    if (m_userAgent.isEmpty())
+        m_userAgent = composeUserAgent();
+    return m_userAgent;
+}
+
+void FrameLoaderClientEfl::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
+{
+    Frame* f = ewk_frame_core_get(m_frame);
+    ASSERT(f);
+    (f->loader()->policyChecker()->*function)(action);
+}
+
+WTF::PassRefPtr<DocumentLoader> FrameLoaderClientEfl::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
+{
+    RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
+    if (substituteData.isValid())
+        loader->setDeferMainResourceDataLoad(false);
+    return loader.release();
+}
+
+void FrameLoaderClientEfl::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState>)
+{
+    // FIXME: This is surely too simple
+    ASSERT(function);
+    callPolicyFunction(function, PolicyUse);
+}
+
+
+void FrameLoaderClientEfl::committedLoad(DocumentLoader* loader, const char* data, int length)
+{
+    if (!m_pluginView) {
+        if (!m_frame)
+            return;
+
+        FrameLoader* fl = loader->frameLoader();
+        if (m_firstData) {
+            fl->setEncoding(m_response.textEncodingName(), false);
+            m_firstData = false;
+        }
+        fl->addData(data, length);
+    }
+
+    // We re-check here as the plugin can have been created
+    if (m_pluginView) {
+        if (!m_hasSentResponseToPlugin) {
+            m_pluginView->didReceiveResponse(loader->response());
+            m_hasSentResponseToPlugin = true;
+        }
+        m_pluginView->didReceiveData(data, length);
+    }
+}
+
+void FrameLoaderClientEfl::dispatchDidReplaceStateWithinPage()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidPushStateWithinPage()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidPopStateWithinPage()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidChangeBackForwardIndex() const
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long  identifier, const AuthenticationChallenge&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long  identifier, const AuthenticationChallenge&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&)
+{
+    notImplemented();
+}
+
+bool FrameLoaderClientEfl::shouldUseCredentialStorage(DocumentLoader*, unsigned long)
+{
+    notImplemented();
+    return false;
+}
+
+void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::postProgressStartedNotification()
+{
+    ewk_frame_load_started(m_frame);
+    postProgressEstimateChangedNotification();
+}
+
+void FrameLoaderClientEfl::postProgressEstimateChangedNotification()
+{
+    ewk_frame_load_progress_changed(m_frame);
+}
+
+void FrameLoaderClientEfl::postProgressFinishedNotification()
+{
+    if (m_loadError.isNull())
+        ewk_frame_load_finished(m_frame, 0, 0, 0, 0, 0);
+    else {
+        ewk_frame_load_finished(m_frame,
+                                m_loadError.domain().utf8().data(),
+                                m_loadError.errorCode(),
+                                m_loadError.isCancellation(),
+                                m_loadError.localizedDescription().utf8().data(),
+                                m_loadError.failingURL().utf8().data());
+    }
+}
+
+void FrameLoaderClientEfl::frameLoaderDestroyed()
+{
+    if (m_frame)
+        ewk_frame_core_gone(m_frame);
+    m_frame = 0;
+
+    delete this;
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse& response)
+{
+    m_response = response;
+    m_firstData = true;
+}
+
+void FrameLoaderClientEfl::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& MIMEType, const ResourceRequest&)
+{
+    // we need to call directly here (currently callPolicyFunction does that!)
+    ASSERT(function);
+    if (canShowMIMEType(MIMEType))
+        callPolicyFunction(function, PolicyUse);
+    else
+        callPolicyFunction(function, PolicyDownload);
+}
+
+void FrameLoaderClientEfl::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest&, PassRefPtr<FormState>, const String&)
+{
+    ASSERT(function);
+    ASSERT(m_frame);
+    // if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
+    // FIXME: do proper check and only reset forms when on PolicyIgnore
+    Frame* f = ewk_frame_core_get(m_frame);
+    f->loader()->resetMultipleFormSubmissionProtection();
+    callPolicyFunction(function, PolicyUse);
+}
+
+void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>)
+{
+    ASSERT(function);
+    ASSERT(m_frame);
+    // if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
+    // FIXME: do proper check and only reset forms when on PolicyIgnore
+    Frame* f = ewk_frame_core_get(m_frame);
+    f->loader()->resetMultipleFormSubmissionProtection();
+    callPolicyFunction(function, PolicyUse);
+}
+
+PassRefPtr<Widget> FrameLoaderClientEfl::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
+{
+    ASSERT(m_frame);
+    ASSERT(m_view);
+
+    return ewk_view_plugin_create(m_view, m_frame, pluginSize,
+                                  element, url, paramNames, paramValues,
+                                  mimeType, loadManually);
+}
+
+PassRefPtr<Frame> FrameLoaderClientEfl::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
+{
+    ASSERT(m_frame);
+    ASSERT(m_view);
+
+    return ewk_view_frame_create(m_view, m_frame, name, ownerElement, url, referrer);
+}
+
+void FrameLoaderClientEfl::didTransferChildFrameToNewDocument()
+{
+}
+
+void FrameLoaderClientEfl::redirectDataToPlugin(Widget* pluginWidget)
+{
+    ASSERT(!m_pluginView);
+    m_pluginView = static_cast<PluginView*>(pluginWidget);
+    m_hasSentResponseToPlugin = false;
+}
+
+PassRefPtr<Widget> FrameLoaderClientEfl::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
+                                                  const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+    notImplemented();
+    return 0;
+}
+
+ObjectContentType FrameLoaderClientEfl::objectContentType(const KURL& url, const String& mimeType)
+{
+    if (url.isEmpty() && mimeType.isEmpty())
+        return ObjectContentNone;
+
+    // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure
+    String type = mimeType;
+    if (type.isEmpty())
+        type = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1));
+
+    if (type.isEmpty())
+        return ObjectContentFrame;
+
+    if (MIMETypeRegistry::isSupportedImageMIMEType(type))
+        return ObjectContentImage;
+
+#if 0 // PluginDatabase is disabled until we have Plugin system done.
+    if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType))
+        return ObjectContentNetscapePlugin;
+#endif
+
+    if (MIMETypeRegistry::isSupportedNonImageMIMEType(type))
+        return ObjectContentFrame;
+
+    if (url.protocol() == "about")
+        return ObjectContentFrame;
+
+    return ObjectContentNone;
+}
+
+String FrameLoaderClientEfl::overrideMediaType() const
+{
+    notImplemented();
+    return String();
+}
+
+void FrameLoaderClientEfl::windowObjectCleared()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::documentElementAvailable()
+{
+    return;
+}
+
+void FrameLoaderClientEfl::didPerformFirstNavigation() const
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::registerForIconNotification(bool)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::setMainFrameDocumentReady(bool)
+{
+    // this is only interesting once we provide an external API for the DOM
+}
+
+bool FrameLoaderClientEfl::hasWebView() const
+{
+    // notImplemented();
+    return true;
+}
+
+bool FrameLoaderClientEfl::hasFrameView() const
+{
+    notImplemented();
+    return true;
+}
+
+void FrameLoaderClientEfl::dispatchDidFinishLoad()
+{
+    m_loadError = ResourceError(); /* clears previous error */
+}
+
+void FrameLoaderClientEfl::frameLoadCompleted()
+{
+    // Note: Can be called multiple times.
+}
+
+void FrameLoaderClientEfl::saveViewStateToItem(HistoryItem*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::restoreViewState()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::updateGlobalHistoryRedirectLinks()
+{
+}
+
+bool FrameLoaderClientEfl::shouldGoToHistoryItem(HistoryItem* item) const
+{
+    // FIXME: This is a very simple implementation. More sophisticated
+    // implementation would delegate the decision to a PolicyDelegate.
+    // See mac implementation for example.
+    return item;
+}
+
+void FrameLoaderClientEfl::didDisplayInsecureContent()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::didRunInsecureContent(SecurityOrigin*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::makeRepresentation(DocumentLoader*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::forceLayout()
+{
+    ewk_frame_force_layout(m_frame);
+}
+
+void FrameLoaderClientEfl::forceLayoutForNonHTML()
+{
+}
+
+void FrameLoaderClientEfl::setCopiesOnScroll()
+{
+    // apparently mac specific (Qt comment)
+}
+
+void FrameLoaderClientEfl::detachedFromParent2()
+{
+}
+
+void FrameLoaderClientEfl::detachedFromParent3()
+{
+}
+
+void FrameLoaderClientEfl::loadedFromCachedPage()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidHandleOnloadEvents()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidCancelClientRedirect()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchWillPerformClientRedirect(const KURL&, double, double)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidChangeLocationWithinPage()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchWillClose()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveIcon()
+{
+}
+
+void FrameLoaderClientEfl::dispatchDidStartProvisionalLoad()
+{
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveTitle(const String& title)
+{
+    CString cs = title.utf8();
+    ewk_frame_title_set(m_frame, cs.data());
+
+    if (ewk_view_frame_main_get(m_view) != m_frame)
+        return;
+    ewk_view_title_set(m_view, cs.data());
+}
+
+void FrameLoaderClientEfl::dispatchDidChangeIcons()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidCommitLoad()
+{
+    ewk_frame_uri_changed(m_frame);
+    if (ewk_view_frame_main_get(m_view) != m_frame)
+        return;
+    ewk_view_title_set(m_view, 0);
+    ewk_view_uri_changed(m_view);
+}
+
+void FrameLoaderClientEfl::dispatchDidFinishDocumentLoad()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidFirstLayout()
+{
+    // emit m_frame->initialLayoutCompleted();
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidFirstVisuallyNonEmptyLayout()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchShow()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::cancelPolicyCheck()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidLoadMainResource(DocumentLoader*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::revertToProvisionalState(DocumentLoader*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::willChangeTitle(DocumentLoader*)
+{
+    // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+void FrameLoaderClientEfl::didChangeTitle(DocumentLoader *l)
+{
+    // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+bool FrameLoaderClientEfl::canHandleRequest(const ResourceRequest&) const
+{
+    notImplemented();
+    return true;
+}
+
+bool FrameLoaderClientEfl::canShowMIMEType(const String& MIMEType) const
+{
+    if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType))
+        return true;
+
+    if (MIMETypeRegistry::isSupportedNonImageMIMEType(MIMEType))
+        return true;
+
+#if 0 // PluginDatabase is disabled until we have Plugin system done.
+    if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(MIMEType))
+        return true;
+#endif
+
+    return false;
+}
+
+bool FrameLoaderClientEfl::representationExistsForURLScheme(const String&) const
+{
+    return false;
+}
+
+String FrameLoaderClientEfl::generatedMIMETypeForURLScheme(const String&) const
+{
+    notImplemented();
+    return String();
+}
+
+void FrameLoaderClientEfl::finishedLoading(DocumentLoader* loader)
+{
+    if (!m_pluginView) {
+        if (m_firstData) {
+            FrameLoader* fl = loader->frameLoader();
+            fl->setEncoding(m_response.textEncodingName(), false);
+            m_firstData = false;
+        }
+    } else {
+        m_pluginView->didFinishLoading();
+        m_pluginView = 0;
+        m_hasSentResponseToPlugin = false;
+    }
+}
+
+
+void FrameLoaderClientEfl::provisionalLoadStarted()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::didFinishLoad()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::prepareForDataSourceReplacement()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::setTitle(const String& title, const KURL& url)
+{
+    // no need for, dispatchDidReceiveTitle is the right callback
+}
+
+void FrameLoaderClientEfl::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError&)
+{
+    if (m_firstData) {
+        FrameLoader* fl = loader->frameLoader();
+        fl->setEncoding(m_response.textEncodingName(), false);
+        m_firstData = false;
+    }
+
+}
+
+bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
+{
+    notImplemented();
+    return false;
+}
+
+void FrameLoaderClientEfl::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::dispatchDidFailProvisionalLoad(const ResourceError& err)
+{
+    dispatchDidFailLoad(err);
+}
+
+void FrameLoaderClientEfl::dispatchDidFailLoad(const ResourceError& err)
+{
+    m_loadError = err;
+    ewk_frame_load_error(m_frame,
+                         m_loadError.domain().utf8().data(),
+                         m_loadError.errorCode(), m_loadError.isCancellation(),
+                         m_loadError.localizedDescription().utf8().data(),
+                         m_loadError.failingURL().utf8().data());
+}
+
+void FrameLoaderClientEfl::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&)
+{
+    notImplemented();
+}
+
+// copied from WebKit/Misc/WebKitErrors[Private].h
+enum {
+    WebKitErrorCannotShowMIMEType = 100,
+    WebKitErrorCannotShowURL = 101,
+    WebKitErrorFrameLoadInterruptedByPolicyChange = 102,
+    WebKitErrorCannotUseRestrictedPort = 103,
+    WebKitErrorCannotFindPlugIn = 200,
+    WebKitErrorCannotLoadPlugIn = 201,
+    WebKitErrorJavaUnavailable = 202,
+};
+
+ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& request)
+{
+    ResourceError error("Error", -999, request.url().prettyURL(),
+                        "Request cancelled");
+    error.setIsCancellation(true);
+    return error;
+}
+
+ResourceError FrameLoaderClientEfl::blockedError(const ResourceRequest& request)
+{
+    return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+                         "Request blocked");
+}
+
+ResourceError FrameLoaderClientEfl::cannotShowURLError(const ResourceRequest& request)
+{
+    return ResourceError("Error", WebKitErrorCannotShowURL, request.url().string(),
+                         "Cannot show URL");
+}
+
+ResourceError FrameLoaderClientEfl::interruptForPolicyChangeError(const ResourceRequest& request)
+{
+    return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange,
+                         request.url().string(), "Frame load interruped by policy change");
+}
+
+ResourceError FrameLoaderClientEfl::cannotShowMIMETypeError(const ResourceResponse& response)
+{
+    return ResourceError("Error", WebKitErrorCannotShowMIMEType, response.url().string(),
+                         "Cannot show mimetype");
+}
+
+ResourceError FrameLoaderClientEfl::fileDoesNotExistError(const ResourceResponse& response)
+{
+    return ResourceError("Error", -998 /* ### */, response.url().string(),
+                         "File does not exist");
+}
+
+ResourceError FrameLoaderClientEfl::pluginWillHandleLoadError(const ResourceResponse&)
+{
+    notImplemented();
+    return ResourceError("Error", 0, "", "");
+}
+
+bool FrameLoaderClientEfl::shouldFallBack(const ResourceError&)
+{
+    notImplemented();
+    return false;
+}
+
+bool FrameLoaderClientEfl::canCachePage() const
+{
+    return false;
+}
+
+Frame* FrameLoaderClientEfl::dispatchCreatePage()
+{
+    notImplemented();
+    return 0;
+}
+
+void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader* loader, const ResourceError& error)
+{
+    if (!m_pluginView) {
+        if (m_firstData) {
+            loader->frameLoader()->setEncoding(m_response.textEncodingName(), false);
+            m_firstData = false;
+        }
+    } else {
+        m_pluginView->didFail(error);
+        m_pluginView = 0;
+        m_hasSentResponseToPlugin = false;
+    }
+}
+
+void FrameLoaderClientEfl::startDownload(const ResourceRequest&)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::updateGlobalHistory()
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::savePlatformDataToCachedFrame(CachedFrame*)
+{
+    notImplemented();
+}
+
+void FrameLoaderClientEfl::transitionToCommittedFromCachedFrame(CachedFrame*)
+{
+}
+
+void FrameLoaderClientEfl::transitionToCommittedForNewPage()
+{
+    ASSERT(m_frame);
+    ASSERT(m_view);
+    ewk_frame_view_create_for_view(m_frame, m_view);
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
new file mode 100644
index 0000000..47b5621
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 FrameLoaderClientEfl_h
+#define FrameLoaderClientEfl_h
+
+#include "EWebKit.h"
+#include "FrameLoaderClient.h"
+#include "PluginView.h"
+#include "ResourceResponse.h"
+
+namespace WebCore {
+
+class FormState;
+
+class FrameLoaderClientEfl : public FrameLoaderClient {
+ public:
+    explicit FrameLoaderClientEfl(Evas_Object *view);
+    virtual ~FrameLoaderClientEfl() { }
+    virtual void frameLoaderDestroyed();
+
+    void         setWebFrame(Evas_Object *frame) { m_frame = frame; }
+    Evas_Object* webFrame() const { return m_frame; }
+    Evas_Object* webView() const { return m_view; }
+
+    void setCustomUserAgent(const String &agent);
+    const String& customUserAgent() const;
+
+    virtual bool hasWebView() const;
+    virtual bool hasFrameView() const;
+
+    void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
+
+    virtual void makeRepresentation(DocumentLoader*);
+    virtual void forceLayout();
+    virtual void forceLayoutForNonHTML();
+
+    virtual void setCopiesOnScroll();
+
+    virtual void detachedFromParent2();
+    virtual void detachedFromParent3();
+
+    virtual void loadedFromCachedPage();
+
+    virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
+
+    virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long  identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
+    virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier);
+    virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&);
+
+    virtual void dispatchDidPushStateWithinPage();
+    virtual void dispatchDidPopStateWithinPage();
+    virtual void dispatchDidReplaceStateWithinPage();
+    virtual void dispatchDidAddBackForwardItem(WebCore::HistoryItem*) const;
+    virtual void dispatchDidRemoveBackForwardItem(WebCore::HistoryItem*) const;
+    virtual void dispatchDidChangeBackForwardIndex() const;
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
+
+    virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long  identifier, const AuthenticationChallenge&);
+    virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long  identifier, const ResourceResponse&);
+    virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived);
+    virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long  identifier);
+    virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long  identifier, const ResourceError&);
+    virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length);
+    virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString& sourceString);
+
+    virtual void dispatchDidHandleOnloadEvents();
+    virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+    virtual void dispatchDidCancelClientRedirect();
+    virtual void dispatchWillPerformClientRedirect(const KURL&, double, double);
+    virtual void dispatchDidChangeLocationWithinPage();
+    virtual void dispatchWillClose();
+    virtual void dispatchDidReceiveIcon();
+    virtual void dispatchDidStartProvisionalLoad();
+    virtual void dispatchDidReceiveTitle(const String&);
+    virtual void dispatchDidChangeIcons();
+    virtual void dispatchDidCommitLoad();
+    virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
+    virtual void dispatchDidFailLoad(const ResourceError&);
+    virtual void dispatchDidFinishDocumentLoad();
+    virtual void dispatchDidFinishLoad();
+    virtual void dispatchDidFirstLayout();
+    virtual void dispatchDidFirstVisuallyNonEmptyLayout();
+
+    virtual Frame* dispatchCreatePage();
+    virtual void dispatchShow();
+
+    virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&);
+    virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, WTF::PassRefPtr<FormState>, const String& frameName);
+    virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, WTF::PassRefPtr<FormState>);
+    virtual void cancelPolicyCheck();
+
+    virtual void dispatchUnableToImplementPolicy(const ResourceError&);
+
+    virtual void dispatchWillSubmitForm(FramePolicyFunction, WTF::PassRefPtr<FormState>);
+
+    virtual void dispatchDidLoadMainResource(DocumentLoader*);
+    virtual void revertToProvisionalState(DocumentLoader*);
+    virtual void setMainDocumentError(DocumentLoader*, const ResourceError&);
+
+    virtual void postProgressStartedNotification();
+    virtual void postProgressEstimateChangedNotification();
+    virtual void postProgressFinishedNotification();
+
+    virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+                               const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
+    virtual void didTransferChildFrameToNewDocument();
+
+    virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool);
+    virtual void redirectDataToPlugin(Widget* pluginWidget);
+    virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const WTF::Vector<String>& paramNames, const WTF::Vector<String>& paramValues);
+    virtual String overrideMediaType() const;
+    virtual void windowObjectCleared();
+    virtual void documentElementAvailable();
+
+    virtual void didPerformFirstNavigation() const;
+
+    virtual void registerForIconNotification(bool);
+
+    virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
+
+    virtual void setMainFrameDocumentReady(bool);
+
+    virtual void startDownload(const ResourceRequest&);
+
+    virtual void willChangeTitle(DocumentLoader*);
+    virtual void didChangeTitle(DocumentLoader*);
+
+    virtual void committedLoad(DocumentLoader*, const char*, int);
+    virtual void finishedLoading(DocumentLoader*);
+
+    virtual void updateGlobalHistory();
+    virtual void updateGlobalHistoryRedirectLinks();
+    virtual bool shouldGoToHistoryItem(HistoryItem*) const;
+    virtual void didDisplayInsecureContent();
+    virtual void didRunInsecureContent(SecurityOrigin*);
+
+    virtual ResourceError cancelledError(const ResourceRequest&);
+    virtual ResourceError blockedError(const ResourceRequest&);
+    virtual ResourceError cannotShowURLError(const ResourceRequest&);
+    virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&);
+
+    virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&);
+    virtual ResourceError fileDoesNotExistError(const ResourceResponse&);
+    virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&);
+
+    virtual bool shouldFallBack(const ResourceError&);
+
+    virtual bool canHandleRequest(const ResourceRequest&) const;
+    virtual bool canShowMIMEType(const String&) const;
+    virtual bool representationExistsForURLScheme(const String&) const;
+    virtual String generatedMIMETypeForURLScheme(const String&) const;
+
+    virtual void frameLoadCompleted();
+    virtual void saveViewStateToItem(HistoryItem*);
+    virtual void restoreViewState();
+    virtual void provisionalLoadStarted();
+    virtual void didFinishLoad();
+    virtual void prepareForDataSourceReplacement();
+
+    virtual WTF::PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&);
+    virtual void setTitle(const String& title, const KURL&);
+
+    virtual String userAgent(const KURL&);
+
+    virtual void savePlatformDataToCachedFrame(CachedFrame*);
+    virtual void transitionToCommittedFromCachedFrame(CachedFrame*);
+    virtual void transitionToCommittedForNewPage();
+
+    virtual bool canCachePage() const;
+    virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
+ private:
+    Evas_Object *m_view;
+    Evas_Object *m_frame;
+
+    ResourceResponse m_response;
+    bool m_firstData;
+    String m_userAgent;
+    String m_customUserAgent;
+
+    ResourceError m_loadError;
+
+    // Plugin view to redirect data to
+    PluginView* m_pluginView;
+    bool m_hasSentResponseToPlugin;
+};
+
+}
+
+#endif // FrameLoaderClientEfl_h
diff --git a/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
new file mode 100644
index 0000000..8892d7f
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
@@ -0,0 +1,61 @@
+/*
+ *  Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ *  Copyright (C) 2009-2010 ProFUSION embedded systems
+ *  Copyright (C) 2009-2010 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "InspectorClientEfl.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void InspectorClientEfl::inspectorDestroyed()
+{
+    delete this;
+}
+
+void InspectorClientEfl::openInspectorFrontend(InspectorController*)
+{
+    notImplemented();
+}
+
+void InspectorClientEfl::highlight(Node* node)
+{
+    notImplemented();
+}
+
+void InspectorClientEfl::hideHighlight()
+{
+    notImplemented();
+}
+
+void InspectorClientEfl::populateSetting(const String&, String*)
+{
+    notImplemented();
+}
+
+void InspectorClientEfl::storeSetting(const String&, const String&)
+{
+    notImplemented();
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/InspectorClientEfl.h b/WebKit/efl/WebCoreSupport/InspectorClientEfl.h
new file mode 100644
index 0000000..30c9caf
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/InspectorClientEfl.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 InspectorClientEfl_h
+#define InspectorClientEfl_h
+
+#include "InspectorClient.h"
+
+namespace WebCore {
+class Node;
+class Page;
+class String;
+
+class InspectorClientEfl : public WebCore::InspectorClient {
+public:
+    virtual void inspectorDestroyed();
+
+    virtual void openInspectorFrontend(InspectorController*);
+
+    virtual void highlight(Node*);
+    virtual void hideHighlight();
+
+    virtual void populateSetting(const String& key, String* value);
+    virtual void storeSetting(const String& key, const String& value);
+};
+}
+
+#endif // InspectorClientEfl_h
diff --git a/WebKit/efl/ewebkit.pc.in b/WebKit/efl/ewebkit.pc.in
new file mode 100644
index 0000000..24f66e8
--- /dev/null
+++ b/WebKit/efl/ewebkit.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: WebKit-EFL
+Description: Web content engine for EFL applications
+Version: @VERSION@
+Requires: cairo evas ecore
+Libs: -L${libdir} -lewebkit
+Cflags: -I${includedir}/EWebKit
diff --git a/WebKit/efl/ewk/EWebKit.h b/WebKit/efl/ewk/EWebKit.h
new file mode 100644
index 0000000..d87d204
--- /dev/null
+++ b/WebKit/efl/ewk/EWebKit.h
@@ -0,0 +1,34 @@
+/*
+    Copyright (C) 2008-2009 INdT - Instituto Nokia de Tecnologia
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 EWebKit_h
+#define EWebKit_h
+
+#include "ewk_eapi.h"
+#include "ewk_frame.h"
+#include "ewk_history.h"
+#include "ewk_main.h"
+#include "ewk_settings.h"
+#include "ewk_view.h"
+
+#include <Evas.h>
+
+#endif // EWebKit_h
diff --git a/WebKit/efl/ewk/ewk_eapi.h b/WebKit/efl/ewk/ewk_eapi.h
new file mode 100644
index 0000000..adb8d7b
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_eapi.h
@@ -0,0 +1,50 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_eapi_h
+#define ewk_eapi_h
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef BUILDING_WEBKIT
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EINA_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif
+
+#endif // ewk_eapi_h
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
new file mode 100644
index 0000000..73d1d29
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -0,0 +1,1844 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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.
+*/
+
+// Uncomment to view frame regions and debug messages
+// #define EWK_FRAME_DEBUG
+
+#include "config.h"
+#include "ewk_frame.h"
+
+#include "EWebKit.h"
+#include "EventHandler.h"
+#include "FocusController.h"
+#include "FrameLoaderClientEfl.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "HTMLPlugInElement.h"
+#include "HitTestResult.h"
+#include "KURL.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformMouseEvent.h"
+#include "PlatformWheelEvent.h"
+#include "ProgressTracker.h"
+#include "RefPtr.h"
+#include "RenderTheme.h"
+#include "ResourceRequest.h"
+#include "ScriptValue.h"
+#include "SharedBuffer.h"
+#include "SubstituteData.h"
+#include "WindowsKeyboardCodes.h"
+#include "ewk_private.h"
+#include <wtf/text/CString.h>
+
+#include <Eina.h>
+#include <Evas.h>
+#include <eina_safety_checks.h>
+
+static const char EWK_FRAME_TYPE_STR[] = "EWK_Frame";
+
+struct Ewk_Frame_Smart_Data {
+    Evas_Object_Smart_Clipped_Data base;
+    Evas_Object* self;
+    Evas_Object* view;
+#ifdef EWK_FRAME_DEBUG
+    Evas_Object* region;
+#endif
+    WebCore::Frame* frame;
+    const char* theme;
+    const char* title;
+    const char* uri;
+    const char* name;
+    struct {
+        Evas_Coord w, h;
+    } contents_size;
+    Eina_Bool zoom_text_only:1;
+    Eina_Bool editable:1;
+};
+
+struct Eina_Iterator_Ewk_Frame {
+    Eina_Iterator base;
+    Evas_Object* obj;
+    WebCore::Frame* last;
+};
+
+#ifndef EWK_TYPE_CHECK
+#define EWK_FRAME_TYPE_CHECK(o, ...) do { } while (0)
+#else
+#define EWK_FRAME_TYPE_CHECK(o, ...)                                    \
+    do {                                                                \
+        const char* _tmp_otype = evas_object_type_get(o);               \
+        if (EINA_UNLIKELY(_tmp_otype != EWK_FRAME_TYPE_STR)) {          \
+            EINA_LOG_CRIT                                               \
+                ("%p (%s) is not of an ewk_frame!", o,                  \
+                 _tmp_otype ? _tmp_otype : "(null)");                   \
+            return __VA_ARGS__;                                         \
+        }                                                               \
+    } while (0)
+#endif
+
+#define EWK_FRAME_SD_GET(o, ptr)                                \
+    Ewk_Frame_Smart_Data* ptr = (Ewk_Frame_Smart_Data*)evas_object_smart_data_get(o)
+
+#define EWK_FRAME_SD_GET_OR_RETURN(o, ptr, ...)         \
+    EWK_FRAME_TYPE_CHECK(o, __VA_ARGS__);               \
+    EWK_FRAME_SD_GET(o, ptr);                           \
+    if (!ptr) {                                         \
+        CRITICAL("no smart data for object %p (%s)",    \
+                 o, evas_object_type_get(o));           \
+        return __VA_ARGS__;                             \
+    }
+
+static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL;
+
+#ifdef EWK_FRAME_DEBUG
+static inline void _ewk_frame_debug(Evas_Object* o)
+{
+    Evas_Object* clip, *parent;
+    Evas_Coord x, y, w, h, cx, cy, cw, ch;
+    int r, g, b, a, cr, cg, cb, ca;
+
+    evas_object_color_get(o, &r, &g, &b, &a);
+    evas_object_geometry_get(o, &x, &y, &w, &h);
+
+    clip = evas_object_clip_get(o);
+    evas_object_color_get(clip, &cr, &cg, &cb, &ca);
+    evas_object_geometry_get(clip, &cx, &cy, &cw, &ch);
+
+    fprintf(stderr, "%p: type=%s name=%s, visible=%d, color=%02x%02x%02x%02x, %d,%d+%dx%d, clipper=%p (%d, %02x%02x%02x%02x, %d,%d+%dx%d)\n",
+            o, evas_object_type_get(o), evas_object_name_get(o), evas_object_visible_get(o),
+            r, g, b, a, x, y, w, h,
+            clip, evas_object_visible_get(clip), cr, cg, cb, ca, cx, cy, cw, ch);
+    parent = evas_object_smart_parent_get(o);
+    if (!parent)
+        fprintf(stderr, "\n");
+    else
+        _ewk_frame_debug(parent);
+}
+#endif
+
+static WebCore::FrameLoaderClientEfl* _ewk_frame_loader_efl_get(WebCore::Frame* frame)
+{
+    return static_cast<WebCore::FrameLoaderClientEfl*>(frame->loader()->client());
+}
+
+static inline Evas_Object* kit(WebCore::Frame* frame)
+{
+    if (!frame)
+        return 0;
+    WebCore::FrameLoaderClientEfl* fl = _ewk_frame_loader_efl_get(frame);
+    if (!fl)
+        return 0;
+    return fl->webFrame();
+}
+
+static Eina_Bool _ewk_frame_children_iterator_next(Eina_Iterator_Ewk_Frame* it, Evas_Object** data)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(it->obj, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+
+    WebCore::FrameTree* tree = sd->frame->tree(); // check if it's still valid
+    EINA_SAFETY_ON_NULL_RETURN_VAL(tree, EINA_FALSE);
+
+    WebCore::Frame* frame;
+    if (it->last)
+        frame = it->last->tree()->nextSibling();
+    else
+        frame = tree->firstChild();
+
+    if (!frame)
+        return EINA_FALSE;
+
+    *data = kit(frame);
+    return EINA_TRUE;
+}
+
+static Evas_Object* _ewk_frame_children_iterator_get_container(Eina_Iterator_Ewk_Frame* it)
+{
+    return it->obj;
+}
+
+static void _ewk_frame_smart_add(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET(o, sd);
+
+    if (!sd) {
+        sd = (Ewk_Frame_Smart_Data*)calloc(1, sizeof(Ewk_Frame_Smart_Data));
+        if (!sd)
+            CRITICAL("could not allocate Ewk_Frame_Smart_Data");
+        else
+            evas_object_smart_data_set(o, sd);
+    }
+
+    sd->self = o;
+
+    _parent_sc.add(o);
+    evas_object_move(sd->base.clipper, 0, 0);
+    evas_object_resize(sd->base.clipper, 0, 0);
+
+#ifdef EWK_FRAME_DEBUG
+    sd->region = evas_object_rectangle_add(sd->base.evas);
+    static int i = 0;
+    switch (i) {
+    case 0:
+        evas_object_color_set(sd->region, 128, 0, 0, 128);
+        break;
+    case 1:
+        evas_object_color_set(sd->region, 0, 128, 0, 128);
+        break;
+    case 2:
+        evas_object_color_set(sd->region, 0, 0, 128, 128);
+        break;
+    case 3:
+        evas_object_color_set(sd->region, 128, 0, 0, 128);
+        break;
+    case 4:
+        evas_object_color_set(sd->region, 128, 128, 0, 128);
+        break;
+    case 5:
+        evas_object_color_set(sd->region, 128, 0, 128, 128);
+        break;
+    case 6:
+        evas_object_color_set(sd->region, 0, 128, 128, 128);
+        break;
+    default:
+        break;
+    }
+    i++;
+    if (i > 6)
+        i = 0;
+
+    evas_object_smart_member_add(sd->region, o);
+    evas_object_hide(sd->region);
+#endif
+}
+
+static void _ewk_frame_smart_del(Evas_Object* o)
+{
+    WRN("o=%p", o); // XXX REMOVE ME LATER
+    EWK_FRAME_SD_GET(o, sd);
+
+    if (sd) {
+        if (sd->frame) {
+            WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(sd->frame);
+            flc->setWebFrame(0);
+            sd->frame->loader()->cancelAndClear();
+            sd->frame = 0;
+        }
+
+        eina_stringshare_del(sd->title);
+        eina_stringshare_del(sd->uri);
+        eina_stringshare_del(sd->name);
+    }
+
+    _parent_sc.del(o);
+}
+
+static void _ewk_frame_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h)
+{
+    EWK_FRAME_SD_GET(o, sd);
+    evas_object_resize(sd->base.clipper, w, h);
+
+#ifdef EWK_FRAME_DEBUG
+    evas_object_resize(sd->region, w, h);
+    Evas_Coord x, y;
+    evas_object_geometry_get(sd->region, &x, &y, &w, &h);
+    INF("region=%p, visible=%d, geo=%d,%d + %dx%d",
+        sd->region, evas_object_visible_get(sd->region), x, y, w, h);
+    _ewk_frame_debug(o);
+#endif
+}
+
+static void _ewk_frame_smart_set(Evas_Smart_Class* api)
+{
+    evas_object_smart_clipped_smart_set(api);
+    api->add = _ewk_frame_smart_add;
+    api->del = _ewk_frame_smart_del;
+    api->resize = _ewk_frame_smart_resize;
+}
+
+static inline Evas_Smart* _ewk_frame_smart_class_new(void)
+{
+    static Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION(EWK_FRAME_TYPE_STR);
+    static Evas_Smart* smart = 0;
+
+    if (EINA_UNLIKELY(!smart)) {
+        evas_object_smart_clipped_smart_set(&_parent_sc);
+        _ewk_frame_smart_set(&sc);
+        smart = evas_smart_class_new(&sc);
+    }
+
+    return smart;
+}
+
+/**
+ * @internal
+ *
+ * Creates a new EFL WebKit Frame object.
+ *
+ * Frames are low level entries contained in a page that is contained
+ * by a view. Usually one operates on the view and not directly on the
+ * frame.
+ *
+ * @param e canvas where to create the frame object.
+ *
+ * @return frame object or @c NULL if errors.
+ */
+Evas_Object* ewk_frame_add(Evas* e)
+{
+    return evas_object_smart_add(e, _ewk_frame_smart_class_new());
+}
+
+/**
+ * Retrieves the ewk_view object that owns this frame.
+ *
+ * @param o frame object to get view from.
+ *
+ * @return view object or @c NULL if errors.
+ */
+Evas_Object* ewk_frame_view_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->view;
+}
+
+/**
+ * Set the theme path to be used by this frame.
+ *
+ * Frames inherit theme from their parent, this will have all frames
+ * with unset theme to use this one.
+ *
+ * @param o frame object to change theme.
+ * @param path theme path, may be @c NULL to reset to default or inherit parent.
+ */
+void ewk_frame_theme_set(Evas_Object* o, const char* path)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    if (!eina_stringshare_replace(&sd->theme, path))
+        return;
+    if (sd->frame && sd->frame->view()) {
+        sd->frame->view()->setEdjeTheme(WebCore::String(path));
+        sd->frame->page()->theme()->themeChanged();
+    }
+}
+
+/**
+ * Gets the immediate theme set on this frame.
+ *
+ * This returns the value set by ewk_frame_theme_set(). Note that if
+ * it is @c NULL, the frame will inherit parent's theme.
+ *
+ * @param o frame object to get theme path.
+ *
+ * @return theme path, may be @c NULL if not set.
+ */
+const char* ewk_frame_theme_get(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->theme;
+}
+
+/**
+ * Returns a new iterator over all direct children frames.
+ *
+ * Keep frame object intact while iteration happens otherwise frame
+ * may be destroyed while iterated.
+ *
+ * Iteration results are Evas_Object*, so give eina_iterator_next() a
+ * pointer to it.
+ *
+ * @return a newly allocated iterator, free using
+ *         eina_iterator_free(). If not possible to create the
+ *         iterator, @c NULL is returned.
+ */
+Eina_Iterator* ewk_frame_children_iterator_new(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    Eina_Iterator_Ewk_Frame* it = (Eina_Iterator_Ewk_Frame*)
+        calloc(1, sizeof(Eina_Iterator_Ewk_Frame));
+    if (!it)
+        return 0;
+
+    EINA_MAGIC_SET(&it->base, EINA_MAGIC_ITERATOR);
+    it->base.next = FUNC_ITERATOR_NEXT(_ewk_frame_children_iterator_next);
+    it->base.get_container = FUNC_ITERATOR_GET_CONTAINER(_ewk_frame_children_iterator_get_container);
+    it->base.free = FUNC_ITERATOR_FREE(free);
+    it->obj = o;
+    return &it->base;
+}
+
+/**
+ * Finds a child frame by its name, recursively.
+ *
+ * For pre-defined names, returns @a o if @a name is "_self" or
+ * "_current", returns @a o's parent frame if @a name is "_parent",
+ * and returns the main frame if @a name is "_top". Also returns @a o
+ * if it is the main frame and @a name is either "_parent" or
+ * "_top". For other names, this function returns the first frame that
+ * matches @a name. This function searches @a o and its descendents
+ * first, then @a o's parent and its children moving up the hierarchy
+ * until a match is found. If no match is found in @a o's hierarchy,
+ * this function will search for a matching frame in other main frame
+ * hierarchies.
+ *
+ * @return object if found, @c NULL if nothing with that name.
+ */
+Evas_Object* ewk_frame_child_find(Evas_Object* o, const char* name)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0);
+    WebCore::String s = WebCore::String::fromUTF8(name);
+    return kit(sd->frame->tree()->find(WebCore::AtomicString(s)));
+}
+
+/**
+ * Ask main frame to load the given URI.
+ *
+ * @param o frame object to load uri.
+ * @param uri uniform resource identifier to load.
+ */
+Eina_Bool ewk_frame_uri_set(Evas_Object* o, const char* uri)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(uri));
+    WebCore::ResourceRequest req(kurl);
+    WebCore::FrameLoader* loader = sd->frame->loader();
+    loader->load(req, false);
+    return EINA_TRUE;
+}
+
+/**
+ * Gets the uri of this frame.
+ *
+ * @param o frame object to get uri.
+ *
+ * @return frame uri or @c NULL. It's a internal string and should
+ *         not be modified. The string is guaranteed to be stringshared.
+ */
+const char* ewk_frame_uri_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->uri;
+}
+
+/**
+ * Gets the title of this frame.
+ *
+ * @param o frame object to get title.
+ *
+ * @return frame title or @c NULL. It's a internal string and should
+ *         not be modified. The string is guaranteed to be stringshared.
+ */
+const char* ewk_frame_title_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->title;
+}
+
+/**
+ * Gets the name of this frame.
+ *
+ * @param o frame object to get name.
+ *
+ * @return frame name or @c NULL. It's a internal string and should
+ *         not be modified. The string is guaranteed to be stringshared.
+ */
+const char* ewk_frame_name_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+
+    if (sd->name)
+        return sd->name;
+
+    if (!sd->frame) {
+        ERR("could not get name of uninitialized frame.");
+        return 0;
+    }
+
+    WebCore::String s = sd->frame->tree()->name();
+    WTF::CString cs = s.utf8();
+    sd->name = eina_stringshare_add_length(cs.data(), cs.length());
+    return sd->name;
+}
+
+/**
+ * Get last known contents size.
+ *
+ * @param o frame object to get contents size.
+ * @param w where to store contents size width. May be @c NULL.
+ * @param h where to store contents size height. May be @c NULL.
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure and
+ *         @a w and @a h will be zeroed.
+ */
+Eina_Bool ewk_frame_contents_size_get(const Evas_Object* o, Evas_Coord* w, Evas_Coord* h)
+{
+    if (w)
+        *w = 0;
+    if (h)
+        *h = 0;
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    if (w)
+        *w = sd->contents_size.w;
+    if (h)
+        *h = sd->contents_size.h;
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data *sd, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri)
+{
+    if (contents_size < 1)
+        contents_size = strlen(contents);
+    if (!mime_type)
+        mime_type = "text/html";
+    if (!encoding)
+        encoding = "UTF-8";
+    if (!base_uri)
+        base_uri = "about:blank";
+
+    WebCore::KURL baseKURL(WebCore::KURL(), WebCore::String::fromUTF8(base_uri));
+    WebCore::KURL unreachableKURL;
+    if (unreachable_uri)
+        unreachableKURL = WebCore::KURL(WebCore::KURL(), WebCore::String::fromUTF8(unreachable_uri));
+    else
+        unreachableKURL = WebCore::KURL();
+
+    WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(contents, contents_size);
+    WebCore::SubstituteData substituteData
+        (buffer.release(),
+         WebCore::String::fromUTF8(mime_type),
+         WebCore::String::fromUTF8(encoding),
+         baseKURL, unreachableKURL);
+    WebCore::ResourceRequest request(baseKURL);
+
+    sd->frame->loader()->load(request, substituteData, false);
+    return EINA_TRUE;
+}
+
+/**
+ * Requests loading the given contents in this frame.
+ *
+ * @param o frame object to load document.
+ * @param contents what to load into frame. Must not be @c NULL.
+ * @param contents_size byte size of data in @a contents.
+ *        If zero, strlen() is used.
+ * @param mime_type type of @a contents data. If @c NULL "text/html" is assumed.
+ * @param encoding used for @a contents data. If @c NULL "UTF-8" is assumed.
+ * @param base_uri base uri to use for relative resources. May be @c NULL.
+ *        If provided must be an absolute uri.
+ *
+ * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors.
+ */
+Eina_Bool ewk_frame_contents_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE);
+    return _ewk_frame_contents_set_internal
+        (sd, contents, contents_size, mime_type, encoding, base_uri, 0);
+}
+
+/**
+ * Requests loading alternative contents for unreachable URI in this frame.
+ *
+ * This is similar to ewk_frame_contents_set(), but is used when some
+ * URI failed to load, using the provided content instead. The main
+ * difference is that back-forward navigation list is not changed.
+ *
+ * @param o frame object to load document.
+ * @param contents what to load into frame. Must not be @c NULL.
+ * @param contents_size byte size of data in @a contents.
+ *        If zero, strlen() is used.
+ * @param mime_type type of @a contents data. If @c NULL "text/html" is assumed.
+ * @param encoding used for @a contents data. If @c NULL "UTF-8" is assumed.
+ * @param base_uri base uri to use for relative resources. May be @c NULL.
+ *        If provided must be an absolute uri.
+ * @param unreachable_uri the URI that failed to load and is getting the
+ *        alternative representation.
+ *
+ * @return @c EINA_TRUE on successful request, @c EINA_FALSE on errors.
+ */
+Eina_Bool ewk_frame_contents_alternate_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(unreachable_uri, EINA_FALSE);
+    return _ewk_frame_contents_set_internal
+        (sd, contents, contents_size, mime_type, encoding, base_uri,
+         unreachable_uri);
+}
+
+/**
+ * Requests execution of given script.
+ *
+ * @param o frame object to execute script.
+ * @param script java script to execute.
+ *
+ * @return @c EINA_TRUE if request was done, @c EINA_FALSE on errors.
+ */
+Eina_Bool ewk_frame_script_execute(Evas_Object* o, const char* script)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(script, EINA_FALSE);
+    sd->frame->script()->executeScript(WebCore::String::fromUTF8(script), true);
+    return EINA_TRUE;
+}
+
+/**
+ * Gets if frame is editable.
+ *
+ * @param o frame object to get editable state.
+ *
+ * @return @c EINA_TRUE if editable, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_editable_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return sd->editable;
+}
+
+/**
+ * Sets if frame is editable.
+ *
+ * @param o frame object to set editable state.
+ * @param editable new state.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_editable_set(Evas_Object* o, Eina_Bool editable)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    editable = !!editable;
+    if (sd->editable == editable)
+        return EINA_TRUE;
+    if (editable)
+        sd->frame->applyEditingStyleToBodyElement();
+    else
+        sd->frame->removeEditingStyleFromBodyElement();
+    return EINA_TRUE;
+}
+
+/**
+ * Get the copy of the selection text.
+ *
+ * @param o frame object to get selection text.
+ *
+ * @return newly allocated string or @c NULL if nothing is selected or failure.
+ */
+char* ewk_frame_selection_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0);
+    WTF::CString s = sd->frame->selectedText().utf8();
+    if (s.isNull())
+        return 0;
+    return strdup(s.data());
+}
+
+static inline Eina_Bool _ewk_frame_editor_command(Ewk_Frame_Smart_Data* sd, const char* command)
+{
+    return sd->frame->editor()->command(WebCore::String::fromUTF8(command)).execute();
+}
+
+/**
+ * Unselects whatever was selected.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_none(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "Unselect");
+}
+
+/**
+ * Selects everything.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_all(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "SelectAll");
+}
+
+/**
+ * Selects the current paragrah.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_paragraph(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "SelectParagraph");
+}
+
+/**
+ * Selects the current sentence.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_sentence(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "SelectSentence");
+}
+
+/**
+ * Selects the current line.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_line(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "SelectLine");
+}
+
+/**
+ * Selects the current word.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_select_word(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return _ewk_frame_editor_command(sd, "SelectWord");
+}
+
+/**
+ * Search the given text string in document.
+ *
+ * @param o frame object where to search text.
+ * @param string reference string to search.
+ * @param case_sensitive if search should be case sensitive or not.
+ * @param forward if search is from cursor and on or backwards.
+ * @param wrap if search should wrap at end.
+ *
+ * @return @c EINA_TRUE if found, @c EINA_FALSE if not or failure.
+ */
+Eina_Bool ewk_frame_text_search(const Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE);
+
+    return sd->frame->findString(WebCore::String::fromUTF8(string), forward, case_sensitive, wrap, true);
+}
+
+/**
+ * Mark matches the given text string in document.
+ *
+ * @param o frame object where to search text.
+ * @param string reference string to match.
+ * @param case_sensitive if match should be case sensitive or not.
+ * @param highlight if matches should be highlighted.
+ * @param limit maximum amount of matches, or zero to unlimited.
+ *
+ * @return number of matches.
+ */
+unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0);
+
+    sd->frame->setMarkedTextMatchesAreHighlighted(highlight);
+    return sd->frame->markAllMatchesForText(WebCore::String::fromUTF8(string), case_sensitive, limit);
+}
+
+/**
+ * Reverses the effect of ewk_frame_text_matches_mark()
+ *
+ * @param o frame object where to search text.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE for failure.
+ */
+Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+
+    sd->frame->document()->removeMarkers(WebCore::DocumentMarker::TextMatch);
+    return EINA_TRUE;
+}
+
+/**
+ * Set if should highlight matches marked with ewk_frame_text_matches_mark().
+ *
+ * @param o frame object where to set if matches are highlighted or not.
+ * @param highlight if @c EINA_TRUE, matches will be highlighted.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE for failure.
+ */
+Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object* o, Eina_Bool highlight)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    sd->frame->setMarkedTextMatchesAreHighlighted(highlight);
+    return EINA_TRUE;
+}
+
+/**
+ * Get if should highlight matches marked with ewk_frame_text_matches_mark().
+ *
+ * @param o frame object to query if matches are highlighted or not.
+ *
+ * @return @c EINA_TRUE if they are highlighted, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    return sd->frame->markedTextMatchesAreHighlighted();
+}
+
+/**
+ * Ask frame to stop loading.
+ *
+ * @param o frame object to stop loading.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_stop(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    sd->frame->loader()->stopAllLoaders();
+    return EINA_TRUE;
+}
+
+/**
+ * Ask frame to reload current document.
+ *
+ * @param o frame object to reload.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_reload_full()
+ */
+Eina_Bool ewk_frame_reload(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    sd->frame->loader()->reload();
+    return EINA_TRUE;
+}
+
+/**
+ * Ask frame to fully reload current document, using no previous caches.
+ *
+ * @param o frame object to reload.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_reload_full(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    sd->frame->loader()->reload(true);
+    return EINA_TRUE;
+}
+
+/**
+ * Ask frame to navigate back in history.
+ *
+ * @param o frame object to navigate back.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_navigate()
+ */
+Eina_Bool ewk_frame_back(Evas_Object* o)
+{
+    return ewk_frame_navigate(o, -1);
+}
+
+/**
+ * Ask frame to navigate forward in history.
+ *
+ * @param o frame object to navigate forward.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_navigate()
+ */
+Eina_Bool ewk_frame_forward(Evas_Object* o)
+{
+    return ewk_frame_navigate(o, 1);
+}
+
+/**
+ * Navigate back or forward in history.
+ *
+ * @param o frame object to navigate.
+ * @param steps if positive navigates that amount forwards, if negative
+ *        does backwards.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_navigate(Evas_Object* o, int steps)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    WebCore::Page* page = sd->frame->page();
+    if (!page->canGoBackOrForward(steps))
+        return EINA_FALSE;
+    page->goBackOrForward(steps);
+    return EINA_TRUE;
+}
+
+/**
+ * Check if it is possible to navigate backwards one item in history.
+ *
+ * @param o frame object to check if backward navigation is possible.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_navigate_possible()
+ */
+Eina_Bool ewk_frame_back_possible(Evas_Object* o)
+{
+    return ewk_frame_navigate_possible(o, -1);
+}
+
+/**
+ * Check if it is possible to navigate forwards one item in history.
+ *
+ * @param o frame object to check if forward navigation is possible.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_navigate_possible()
+ */
+Eina_Bool ewk_frame_forward_possible(Evas_Object* o)
+{
+    return ewk_frame_navigate_possible(o, 1);
+}
+
+/**
+ * Check if it is possible to navigate given @a steps in history.
+ *
+ * @param o frame object to navigate.
+ * @param steps if positive navigates that amount forwards, if negative
+ *        does backwards.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_navigate_possible(Evas_Object* o, int steps)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    WebCore::Page* page = sd->frame->page();
+    return page->canGoBackOrForward(steps);
+}
+
+/**
+ * Get current zoom level used by this frame.
+ *
+ * @param o frame object to query zoom level.
+ *
+ * @return zoom level or -1.0 on failure.
+ */
+float ewk_frame_zoom_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, -1.0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1.0);
+    return sd->frame->zoomFactor();
+}
+
+/**
+ * Set current zoom level used by this frame.
+ *
+ * @param o frame object to change zoom level.
+ * @param zoom new level.
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
+ *
+ * @see ewk_frame_zoom_text_only_set()
+ */
+Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    sd->frame->setZoomFactor(zoom, sd->zoom_text_only);
+    return EINA_TRUE;
+}
+
+/**
+ * Query if zoom level just applies to text and not other elements.
+ *
+ * @param o frame to query setting.
+ *
+ * @return @c EINA_TRUE if just text are scaled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_zoom_text_only_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return sd->zoom_text_only;
+}
+
+/**
+ * Set if zoom level just applies to text and not other elements.
+ *
+ * @param o frame to change setting.
+ * @param setting @c EINA_TRUE if zoom should just be applied to text.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    setting = !!setting;
+    if (sd->zoom_text_only == setting)
+        return EINA_TRUE;
+
+    sd->zoom_text_only = setting;
+    sd->frame->setZoomFactor(sd->frame->zoomFactor(), setting);
+    return EINA_TRUE;
+}
+
+/**
+ * Free hit test created with ewk_frame_hit_test_new().
+ *
+ * @param hit_test instance. Must @b not be @c NULL.
+ */
+void ewk_frame_hit_test_free(Ewk_Hit_Test* hit_test)
+{
+    EINA_SAFETY_ON_NULL_RETURN(hit_test);
+    eina_stringshare_del(hit_test->title);
+    eina_stringshare_del(hit_test->alternate_text);
+    eina_stringshare_del(hit_test->link.text);
+    eina_stringshare_del(hit_test->link.url);
+    eina_stringshare_del(hit_test->link.title);
+    free(hit_test);
+}
+
+/**
+ * Creates a new hit test for given frame and point.
+ *
+ * @param o frame to do hit test on.
+ * @param x horizontal position to query.
+ * @param y vertical position to query.
+ *
+ * @return a newly allocated hit test on success, @c NULL otherwise.
+ *         Free memory with ewk_frame_hit_test_free()
+ */
+Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* o, int x, int y)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0);
+
+    WebCore::FrameView* view = sd->frame->view();
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->contentRenderer(), 0);
+
+    WebCore::HitTestResult result = sd->frame->eventHandler()->hitTestResultAtPoint
+        (view->windowToContents(WebCore::IntPoint(x, y)),
+         /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+
+    if (result.scrollbar())
+        return 0;
+    if (!result.innerNode())
+        return 0;
+
+    Ewk_Hit_Test* hit_test = (Ewk_Hit_Test*)calloc(1, sizeof(Ewk_Hit_Test));
+    if (!hit_test) {
+        CRITICAL("Could not allocate memory for hit test.");
+        return 0;
+    }
+
+    hit_test->x = result.point().x();
+    hit_test->y = result.point().y();
+#if 0
+    // FIXME
+    hit_test->bounding_box.x = result.boundingBox().x();
+    hit_test->bounding_box.y = result.boundingBox().y();
+    hit_test->bounding_box.w = result.boundingBox().width();
+    hit_test->bounding_box.h = result.boundingBox().height();
+#else
+    hit_test->bounding_box.x = 0;
+    hit_test->bounding_box.y = 0;
+    hit_test->bounding_box.w = 0;
+    hit_test->bounding_box.h = 0;
+#endif
+
+    WebCore::TextDirection dir;
+    hit_test->title = eina_stringshare_add(result.title(dir).utf8().data());
+    hit_test->alternate_text = eina_stringshare_add(result.altDisplayString().utf8().data());
+    if (result.innerNonSharedNode() && result.innerNonSharedNode()->document()
+        && result.innerNonSharedNode()->document()->frame())
+        hit_test->frame = kit(result.innerNonSharedNode()->document()->frame());
+
+    hit_test->link.text = eina_stringshare_add(result.textContent().utf8().data());
+    hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().prettyURL().utf8().data());
+    hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data());
+    hit_test->link.target_frame = kit(result.targetFrame());
+
+    hit_test->flags.editable = result.isContentEditable();
+    hit_test->flags.selected = result.isSelected();
+
+    return hit_test;
+}
+
+/**
+ * Relative scroll of given frame.
+ *
+ * @param o frame object to scroll.
+ * @param dx horizontal offset to scroll.
+ * @param dy vertical offset to scroll.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ */
+Eina_Bool
+ewk_frame_scroll_add(Evas_Object* o, int dx, int dy)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    sd->frame->view()->scrollBy(IntSize(dx, dy));
+    return EINA_TRUE;
+}
+
+/**
+ * Set absolute scroll of given frame.
+ *
+ * Both values are from zero to the contents size minus the viewport
+ * size. See ewk_frame_scroll_size_get().
+ *
+ * @param o frame object to scroll.
+ * @param x horizontal position to scroll.
+ * @param y vertical position to scroll.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ */
+Eina_Bool
+ewk_frame_scroll_set(Evas_Object* o, int x, int y)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    sd->frame->view()->setScrollPosition(WebCore::IntPoint(x, y));
+    return EINA_TRUE;
+}
+
+/**
+ * Get the possible scroll size of given frame.
+ *
+ * Possible scroll size is contents size minus the viewport
+ * size. It's the last allowed value for ewk_frame_scroll_set()
+ *
+ * @param o frame object to scroll.
+ * @param w where to return horizontal size that is possible to
+ *        scroll. May be @c NULL.
+ * @param h where to return vertical size that is possible to scroll.
+ *        May be @c NULL.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and
+ *         values are zeroed.
+ */
+Eina_Bool
+ewk_frame_scroll_size_get(const Evas_Object* o, int* w, int* h)
+{
+    if (w)
+        *w = 0;
+    if (h)
+        *h = 0;
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    WebCore::IntPoint point = sd->frame->view()->maximumScrollPosition();
+    if (w)
+        *w = point.x();
+    if (h)
+        *h = point.y();
+    return EINA_TRUE;
+}
+
+/**
+ * Get the current scroll position of given frame.
+ *
+ * @param o frame object to scroll.
+ * @param x where to return horizontal position. May be @c NULL.
+ * @param y where to return vertical position. May be @c NULL.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and
+ *         values are zeroed.
+ */
+Eina_Bool
+ewk_frame_scroll_pos_get(const Evas_Object* o, int* x, int* y)
+{
+    if (x)
+        *x = 0;
+    if (y)
+        *y = 0;
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    WebCore::IntPoint pos = sd->frame->view()->scrollPosition();
+    if (x)
+        *x = pos.x();
+    if (y)
+        *y = pos.y();
+    return EINA_TRUE;
+}
+
+/**
+ * Get the current frame visible content geometry.
+ *
+ * @param o frame object to query visible content geometry.
+ * @param include_scrollbars whenever to include scrollbars size.
+ * @param x horizontal position. May be @c NULL.
+ * @param y vertical position. May be @c NULL.
+ * @param w width. May be @c NULL.
+ * @param h height. May be @c NULL.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise and
+ *         values are zeroed.
+ */
+Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object* o, Eina_Bool include_scrollbars, int* x, int* y, int* w, int* h)
+{
+    if (x)
+        *x = 0;
+    if (y)
+        *y = 0;
+    if (w)
+        *w = 0;
+    if (h)
+        *h = 0;
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    WebCore::IntRect rect = sd->frame->view()->visibleContentRect(include_scrollbars);
+    if (x)
+        *x = rect.x();
+    if (y)
+        *y = rect.y();
+    if (w)
+        *w = rect.width();
+    if (h)
+        *h = rect.height();
+    return EINA_TRUE;
+}
+
+/**
+ * Get the current paintsEntireContents flag.
+ *
+ * This flag tells if dirty areas should be repainted even if they are
+ * out of the screen.
+ *
+ * @param o frame object to query paintsEntireContents flag.
+ *
+ * @return @c EINA_TRUE if repainting any dirty area, @c EINA_FALSE
+ *         otherwise.
+ */
+Eina_Bool ewk_frame_paint_full_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE);
+    return sd->frame->view()->paintsEntireContents();
+}
+
+/**
+ * Set the current paintsEntireContents flag.
+ *
+ * This flag tells if dirty areas should be repainted even if they are
+ * out of the screen.
+ *
+ * @param o frame object to set paintsEntireContents flag.
+ * @param flag @c EINA_TRUE if want to always repaint any dirty area,
+ *             @c EINA_FALSE otherwise.
+ */
+void ewk_frame_paint_full_set(Evas_Object* o, Eina_Bool flag)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->frame);
+    EINA_SAFETY_ON_NULL_RETURN(sd->frame->view());
+    sd->frame->view()->setPaintsEntireContents(flag);
+}
+
+/**
+ * Feed the focus in signal to this frame.
+ *
+ * @param o frame object to focus.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_focus_in(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    WebCore::FocusController* c = sd->frame->page()->focusController();
+    c->setFocusedFrame(sd->frame);
+    return EINA_TRUE;
+}
+
+/**
+ * Feed the focus out signal to this frame.
+ *
+ * @param o frame object to remove focus.
+ */
+Eina_Bool ewk_frame_feed_focus_out(Evas_Object* o)
+{
+    // TODO: what to do on focus out?
+    ERR("what to do?");
+    return EINA_FALSE;
+}
+
+/**
+ * Feed the mouse wheel event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev mouse wheel event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* o, const Evas_Event_Mouse_Wheel* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    WebCore::FrameView* view = sd->frame->view();
+    DBG("o=%p, view=%p, direction=%d, z=%d, pos=%d,%d",
+        o, view, ev->direction, ev->z, ev->canvas.x, ev->canvas.y);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    WebCore::PlatformWheelEvent event(ev);
+    return sd->frame->eventHandler()->handleWheelEvent(event);
+}
+
+/**
+ * Feed the mouse down event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev mouse down event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_mouse_down(Evas_Object* o, const Evas_Event_Mouse_Down* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    WebCore::FrameView* view = sd->frame->view();
+    DBG("o=%p, view=%p, button=%d, pos=%d,%d",
+        o, view, ev->button, ev->canvas.x, ev->canvas.y);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    Evas_Coord x, y;
+    evas_object_geometry_get(sd->view, &x, &y, 0, 0);
+
+    WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y));
+    return sd->frame->eventHandler()->handleMousePressEvent(event);
+}
+
+/**
+ * Feed the mouse up event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev mouse up event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_mouse_up(Evas_Object* o, const Evas_Event_Mouse_Up* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    WebCore::FrameView* view = sd->frame->view();
+    DBG("o=%p, view=%p, button=%d, pos=%d,%d",
+        o, view, ev->button, ev->canvas.x, ev->canvas.y);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    Evas_Coord x, y;
+    evas_object_geometry_get(sd->view, &x, &y, 0, 0);
+
+    WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y));
+    return sd->frame->eventHandler()->handleMouseReleaseEvent(event);
+}
+
+/**
+ * Feed the mouse move event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev mouse move event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* o, const Evas_Event_Mouse_Move* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    WebCore::FrameView* view = sd->frame->view();
+    DBG("o=%p, view=%p, pos: old=%d,%d, new=%d,%d, buttons=%d",
+        o, view, ev->cur.canvas.x, ev->cur.canvas.y,
+        ev->prev.canvas.x, ev->prev.canvas.y, ev->buttons);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    Evas_Coord x, y;
+    evas_object_geometry_get(sd->view, &x, &y, 0, 0);
+
+    WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y));
+    return sd->frame->eventHandler()->mouseMoved(event);
+}
+
+static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent &event)
+{
+    WebCore::ScrollDirection direction;
+    WebCore::ScrollGranularity granularity;
+
+    int keyCode = event.windowsVirtualKeyCode();
+
+    switch (keyCode) {
+    case WebCore::VK_SPACE:
+        granularity = WebCore::ScrollByPage;
+        if (event.shiftKey())
+            direction = WebCore::ScrollUp;
+        else
+            direction = WebCore::ScrollDown;
+        break;
+    case WebCore::VK_NEXT:
+        granularity = WebCore::ScrollByPage;
+        direction = WebCore::ScrollDown;
+        break;
+    case WebCore::VK_PRIOR:
+        granularity = WebCore::ScrollByPage;
+        direction = WebCore::ScrollUp;
+        break;
+    case WebCore::VK_HOME:
+        granularity = WebCore::ScrollByDocument;
+        direction = WebCore::ScrollUp;
+        break;
+    case WebCore::VK_END:
+        granularity = WebCore::ScrollByDocument;
+        direction = WebCore::ScrollDown;
+        break;
+    case WebCore::VK_LEFT:
+        granularity = WebCore::ScrollByLine;
+        direction = WebCore::ScrollLeft;
+        break;
+    case WebCore::VK_RIGHT:
+        granularity = WebCore::ScrollByLine;
+        direction = WebCore::ScrollRight;
+        break;
+    case WebCore::VK_UP:
+        direction = WebCore::ScrollUp;
+        if (event.ctrlKey())
+            granularity = WebCore::ScrollByDocument;
+        else
+            granularity = WebCore::ScrollByLine;
+        break;
+    case WebCore::VK_DOWN:
+        direction = WebCore::ScrollDown;
+         if (event.ctrlKey())
+            granularity = WebCore::ScrollByDocument;
+        else
+            granularity = WebCore::ScrollByLine;
+        break;
+    default:
+        return EINA_FALSE;
+    }
+
+    if (frame->eventHandler()->scrollOverflow(direction, granularity))
+        return EINA_FALSE;
+
+    frame->view()->scroll(direction, granularity);
+    return EINA_TRUE;
+}
+
+/**
+ * Feed the keyboard key down event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev keyboard key down event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_key_down(Evas_Object* o, const Evas_Event_Key_Down* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    DBG("o=%p keyname=%s (key=%s, string=%s)",
+        o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : "");
+
+    WebCore::PlatformKeyboardEvent event(ev);
+    if (sd->frame->eventHandler()->keyEvent(event))
+        return EINA_TRUE;
+
+    return _ewk_frame_handle_key_scrolling(sd->frame, event);
+}
+
+/**
+ * Feed the keyboard key up event to the frame.
+ *
+ * @param o frame object to feed event.
+ * @param ev keyboard key up event.
+ *
+ * @return @c EINA_TRUE if it was handled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_frame_feed_key_up(Evas_Object* o, const Evas_Event_Key_Up* ev)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, EINA_FALSE);
+
+    DBG("o=%p keyname=%s (key=%s, string=%s)",
+        o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : "");
+
+    WebCore::PlatformKeyboardEvent event(ev);
+    return sd->frame->eventHandler()->keyEvent(event);
+}
+
+/* internal methods ****************************************************/
+
+/**
+ * @internal
+ *
+ * Initialize frame based on actual WebKit frame.
+ *
+ * This is internal and should never be called by external users.
+ */
+Eina_Bool ewk_frame_init(Evas_Object* o, Evas_Object* view, WebCore::Frame* frame)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    if (!sd->frame) {
+        WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(frame);
+        flc->setWebFrame(o);
+        sd->frame = frame;
+        sd->view = view;
+        frame->init();
+        return EINA_TRUE;
+    }
+
+    ERR("frame %p already set for %p, ignored new %p",
+        sd->frame, o, frame);
+    return EINA_FALSE;
+}
+
+Evas_Object* ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    char buf[256];
+    Evas_Object* frame;
+    WebCore::Frame* cf;
+
+    frame = ewk_frame_add(sd->base.evas);
+    if (!frame) {
+        ERR("Could not create ewk_frame object.");
+        return 0;
+    }
+
+    cf = child.get();
+    sd->frame->tree()->appendChild(child);
+    if (cf->tree())
+        cf->tree()->setName(name);
+    else
+        ERR("no tree for child object");
+
+    if (!ewk_frame_init(frame, sd->view, cf)) {
+        evas_object_del(frame);
+        return 0;
+    }
+    snprintf(buf, sizeof(buf), "EWK_Frame:child/%s", name.utf8().data());
+    evas_object_name_set(frame, buf);
+    evas_object_smart_member_add(frame, o);
+    evas_object_show(frame);
+
+    if (!cf->page())
+        goto died;
+
+    cf->loader()->loadURLIntoChildFrame(url, referrer, cf);
+    if (!cf->tree()->parent())
+        goto died;
+
+    // TODO: announce frame was created?
+    return frame;
+
+died:
+    CRITICAL("does this work: BEGIN");
+    ewk_frame_core_gone(frame); // CONFIRM
+    evas_object_del(frame); // CONFIRM
+    CRITICAL("does this work: END");
+    return 0;
+}
+
+/**
+ * @internal
+ * Frame was destroyed by loader, remove internal reference.
+ */
+void ewk_frame_core_gone(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    sd->frame = 0;
+}
+
+/**
+ * @internal
+ * Retrieve WebCore::Frame associated with this object.
+ *
+ * Avoid using this call from outside, add specific ewk_frame_*
+ * actions instead.
+ */
+WebCore::Frame* ewk_frame_core_get(const Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->frame;
+}
+
+
+/**
+ * @internal
+ * Reports the frame started loading something.
+ *
+ * Emits signal: "load,started" with no parameters.
+ */
+void ewk_frame_load_started(Evas_Object* o)
+{
+    Evas_Object* main_frame;
+    DBG("o=%p", o);
+    evas_object_smart_callback_call(o, "load,started", 0);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    ewk_view_load_started(sd->view);
+
+    main_frame = ewk_view_frame_main_get(sd->view);
+    if (main_frame == o)
+        ewk_view_frame_main_load_started(sd->view);
+}
+
+/**
+ * @internal
+ * Reports load finished, optionally with error information.
+ *
+ * Emits signal: "load,finished" with pointer to Ewk_Frame_Load_Error
+ * if any error, or @c NULL if successful load.
+ *
+ * @note there should notbe any error stuff here, but trying to be
+ *       compatible with previous WebKit.
+ */
+void ewk_frame_load_finished(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url)
+{
+    Ewk_Frame_Load_Error buf, *error;
+    if (!error_domain) {
+        DBG("o=%p, success.", o);
+        error = 0;
+    } else {
+        DBG("o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s",
+            o, error_domain, error_code, is_cancellation,
+            error_description, failing_url);
+
+        buf.domain = error_domain;
+        buf.code = error_code;
+        buf.is_cancellation = is_cancellation;
+        buf.description = error_description;
+        buf.failing_url = failing_url;
+        buf.frame = o;
+        error = &buf;
+    }
+    evas_object_smart_callback_call(o, "load,finished", error);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    ewk_view_load_finished(sd->view, error);
+}
+
+/**
+ * @internal
+ * Reports load failed with error information.
+ *
+ * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error.
+ */
+void ewk_frame_load_error(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url)
+{
+    Ewk_Frame_Load_Error error;
+
+    DBG("o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s",
+        o, error_domain, error_code, is_cancellation,
+        error_description, failing_url);
+
+    EINA_SAFETY_ON_NULL_RETURN(error_domain);
+
+    error.code = error_code;
+    error.is_cancellation = is_cancellation;
+    error.domain = error_domain;
+    error.description = error_description;
+    error.failing_url = failing_url;
+    error.frame = o;
+    evas_object_smart_callback_call(o, "load,error", &error);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    ewk_view_load_error(sd->view, &error);
+}
+
+/**
+ * @internal
+ * Reports load progress changed.
+ *
+ * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0.
+ */
+void ewk_frame_load_progress_changed(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->frame);
+
+    // TODO: this is per page, there should be a way to have per-frame.
+    double progress = sd->frame->page()->progress()->estimatedProgress();
+
+    DBG("o=%p (p=%0.3f)", o, progress);
+
+    evas_object_smart_callback_call(o, "load,progress", &progress);
+    ewk_view_load_progress_changed(sd->view);
+}
+
+
+/**
+ * @internal
+ *
+ * Reports contents size changed.
+ */
+void ewk_frame_contents_size_changed(Evas_Object* o, Evas_Coord w, Evas_Coord h)
+{
+    DBG("o=%p: %dx%d", o, w, h);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    if (sd->contents_size.w == w && sd->contents_size.h == h)
+        return;
+    sd->contents_size.w = w;
+    sd->contents_size.h = h;
+    // TODO: update something else internally?
+
+    Evas_Coord size[2] = {w, h};
+    evas_object_smart_callback_call(o, "contents,size,changed", size);
+}
+
+/**
+ * @internal
+ *
+ * Reports title changed.
+ */
+void ewk_frame_title_set(Evas_Object* o, const char* title)
+{
+    DBG("o=%p, title=%s", o, title ? title : "(null)");
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    if (!eina_stringshare_replace(&sd->title, title))
+        return;
+    evas_object_smart_callback_call(o, "title,changed", (void*)sd->title);
+}
+
+void ewk_frame_view_create_for_view(Evas_Object* o, Evas_Object* view)
+{
+    DBG("o=%p, view=%p", o, view);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->frame);
+    Evas_Coord w, h;
+
+    if (sd->frame->view())
+        return;
+
+    evas_object_geometry_get(view, 0, 0, &w, &h);
+
+    WebCore::IntSize size(w, h);
+    int r, g, b, a;
+    WebCore::Color bg;
+
+    ewk_view_bg_color_get(view, &r, &g, &b, &a);
+    if (!a)
+        bg = WebCore::Color(0, 0, 0, 0);
+    else if (a == 255)
+        bg = WebCore::Color(r, g, b, a);
+    else
+        bg = WebCore::Color(r * 255 / a, g * 255 / a, b * 255 / a, a);
+
+    sd->frame->createView(size, bg, !a, WebCore::IntSize(), false);
+    if (!sd->frame->view())
+        return;
+    sd->frame->view()->setEdjeTheme(sd->theme);
+    sd->frame->view()->setEvasObject(o);
+}
+
+/**
+ * @internal
+ * Reports uri changed and swap internal string reference.
+ *
+ * Emits signal: "uri,changed" with new uri as parameter.
+ */
+Eina_Bool ewk_frame_uri_changed(Evas_Object* o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
+    WTF::CString uri(sd->frame->loader()->url().prettyURL().utf8());
+
+    INF("uri=%s", uri.data());
+    if (!uri.data()) {
+        ERR("no uri");
+        return EINA_FALSE;
+    }
+
+    eina_stringshare_replace(&sd->uri, uri.data());
+    evas_object_smart_callback_call(o, "uri,changed", (void*)sd->uri);
+    return EINA_TRUE;
+}
+
+void ewk_frame_force_layout(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->frame);
+    WebCore::FrameView* view = sd->frame->view();
+    if (view)
+        view->forceLayout(true);
+}
+
+WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually)
+{
+    DBG("o=%p, size=%dx%d, element=%p, url=%s, mimeType=%s",
+        o, pluginSize.width(), pluginSize.height(), element,
+        url.prettyURL().utf8().data(), mimeType.utf8().data());
+
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0);
+
+    // TODO: emit signal and ask webkit users if something else should be done.
+    // like creating another x window (see gtk, it allows users to create
+    // GtkPluginWidget.
+
+    WTF::RefPtr<WebCore::PluginView> pluginView = WebCore::PluginView::create
+        (sd->frame, pluginSize, element, url, paramNames, paramValues,
+         mimeType, loadManually);
+
+    if (pluginView->status() == WebCore::PluginStatusLoadedSuccessfully)
+        return pluginView;
+
+    return 0;
+}
diff --git a/WebKit/efl/ewk/ewk_frame.h b/WebKit/efl/ewk/ewk_frame.h
new file mode 100644
index 0000000..c71269b
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_frame.h
@@ -0,0 +1,184 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_frame_h
+#define ewk_frame_h
+
+#include "ewk_eapi.h"
+#include <Evas.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file
+ *
+ * WebKit frame smart object.
+ *
+ * This object is the low level access to WebKit-EFL browser
+ * component. It represents both the main and internal frames that
+ * HTML pages contain.
+ *
+ * Every ewk_view has at least one frame, called "main frame" and
+ * retrieved with ewk_view_frame_main_get(). One can retrieve frame's
+ * owner view with ewk_frame_view_get(). Parent frame can be retrieved
+ * with standard smart object's evas_object_smart_parent_get().
+ * Children can be accessed with ewk_frame_children_iterator_new() or
+ * ewk_frame_child_find().
+ *
+ * The following signals (see evas_object_smart_callback_add()) are emitted:
+ *
+ *  - "title,changed", const char*: title of the main frame changed.
+ *  - "uri,changed", const char*: uri of the main frame changed.
+ *  - "load,started", void: frame started loading.
+ *  - "load,progress", double*: load progress changed (overall value
+ *    from 0.0 to 1.0, connect to individual frames for fine grained).
+ *  - "load,finished", const Ewk_Frame_Load_Error*: reports load
+ *    finished and as argument @c NULL if successfully or pointer to
+ *    structure defining the error.
+ *  - "load,error", const Ewk_Frame_Load_Error*: reports load failed
+ *    and as argument a pointer to structure defining the error.
+ *  - "contents,size,changed", Evas_Coord[2]: reports contents size
+ *    changed due new layout, script actions or any other events.
+ */
+
+
+/**
+ * Structure used to report load errors.
+ *
+ * Load errors are reported as signal by ewk_view. All the strings are
+ * temporary references and should @b not be used after the signal
+ * callback returns. If required, make copies with strdup() or
+ * eina_stringshare_add() (they are not even guaranteed to be
+ * stringshared, so must use eina_stringshare_add() and not
+ * eina_stringshare_ref()).
+ */
+typedef struct _Ewk_Frame_Load_Error Ewk_Frame_Load_Error;
+struct _Ewk_Frame_Load_Error {
+    int code; /**< numeric error code */
+    Eina_Bool is_cancellation; /**< if load failed because it was canceled */
+    const char *domain; /**< error domain name */
+    const char *description; /**< error description already localized */
+    const char *failing_url; /**< the url that failed to load */
+    Evas_Object *frame; /**< frame where the failure happened */
+};
+
+/**
+ * Structure used to report hit test results.
+ */
+typedef struct _Ewk_Hit_Test Ewk_Hit_Test;
+struct _Ewk_Hit_Test {
+    int x, y;
+    struct {
+        int x, y, w, h;
+    } bounding_box;
+    const char *title;
+    const char *alternate_text; /**< for image, area, input and applet */
+    Evas_Object *frame;
+    struct {
+        const char *text;
+        const char *url;
+        const char *title;
+        Evas_Object *target_frame;
+    } link;
+    struct {
+        Eina_Bool editable:1;
+        Eina_Bool selected:1;
+    } flags;
+};
+
+
+EAPI Evas_Object *ewk_frame_view_get(const Evas_Object *o);
+EAPI void         ewk_frame_theme_set(Evas_Object *o, const char *path);
+EAPI const char  *ewk_frame_theme_get(Evas_Object *o);
+
+EAPI Eina_Iterator *ewk_frame_children_iterator_new(Evas_Object *o);
+EAPI Evas_Object   *ewk_frame_child_find(Evas_Object *o, const char *name);
+
+EAPI Eina_Bool    ewk_frame_uri_set(Evas_Object *o, const char *uri);
+EAPI const char  *ewk_frame_uri_get(const Evas_Object *o);
+EAPI const char  *ewk_frame_title_get(const Evas_Object *o);
+EAPI const char  *ewk_frame_name_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_contents_size_get(const Evas_Object *o, Evas_Coord *w, Evas_Coord *h);
+
+EAPI Eina_Bool    ewk_frame_contents_set(Evas_Object *o, const char *contents, size_t contents_size, const char *mime_type, const char *encoding, const char *base_uri);
+EAPI Eina_Bool    ewk_frame_contents_alternate_set(Evas_Object *o, const char *contents, size_t contents_size, const char *mime_type, const char *encoding, const char *base_uri, const char *unreachable_uri);
+
+EAPI Eina_Bool    ewk_frame_script_execute(Evas_Object *o, const char *script);
+
+EAPI Eina_Bool    ewk_frame_editable_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_editable_set(Evas_Object *o, Eina_Bool editable);
+
+EAPI char        *ewk_frame_selection_get(const Evas_Object *o);
+
+EAPI Eina_Bool    ewk_frame_text_search(const Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
+
+EAPI unsigned int ewk_frame_text_matches_mark(Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
+EAPI Eina_Bool    ewk_frame_text_matches_unmark_all(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
+EAPI Eina_Bool    ewk_frame_text_matches_highlight_get(const Evas_Object *o);
+
+EAPI Eina_Bool    ewk_frame_stop(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_reload(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_reload_full(Evas_Object *o);
+
+EAPI Eina_Bool    ewk_frame_back(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_forward(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_navigate(Evas_Object *o, int steps);
+
+EAPI Eina_Bool    ewk_frame_back_possible(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_forward_possible(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_navigate_possible(Evas_Object *o, int steps);
+
+EAPI float        ewk_frame_zoom_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_zoom_set(Evas_Object *o, float zoom);
+EAPI Eina_Bool    ewk_frame_zoom_text_only_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_zoom_text_only_set(Evas_Object *o, Eina_Bool setting);
+
+EAPI void          ewk_frame_hit_test_free(Ewk_Hit_Test *hit_test);
+EAPI Ewk_Hit_Test *ewk_frame_hit_test_new(const Evas_Object *o, int x, int y);
+
+EAPI Eina_Bool    ewk_frame_scroll_add(Evas_Object *o, int dx, int dy);
+EAPI Eina_Bool    ewk_frame_scroll_set(Evas_Object *o, int x, int y);
+
+EAPI Eina_Bool    ewk_frame_scroll_size_get(const Evas_Object *o, int *w, int *h);
+EAPI Eina_Bool    ewk_frame_scroll_pos_get(const Evas_Object *o, int *x, int *y);
+
+EAPI Eina_Bool    ewk_frame_visible_content_geometry_get(const Evas_Object *o, Eina_Bool include_scrollbars, int *x, int *y, int *w, int *h);
+
+EAPI Eina_Bool    ewk_frame_paint_full_get(const Evas_Object *o);
+EAPI void         ewk_frame_paint_full_set(Evas_Object *o, Eina_Bool flag);
+
+EAPI Eina_Bool    ewk_frame_feed_focus_in(Evas_Object *o);
+EAPI Eina_Bool    ewk_frame_feed_focus_out(Evas_Object *o);
+
+EAPI Eina_Bool    ewk_frame_feed_mouse_wheel(Evas_Object *o, const Evas_Event_Mouse_Wheel *ev);
+EAPI Eina_Bool    ewk_frame_feed_mouse_down(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
+EAPI Eina_Bool    ewk_frame_feed_mouse_up(Evas_Object *o, const Evas_Event_Mouse_Up *ev);
+EAPI Eina_Bool    ewk_frame_feed_mouse_move(Evas_Object *o, const Evas_Event_Mouse_Move *ev);
+EAPI Eina_Bool    ewk_frame_feed_key_down(Evas_Object *o, const Evas_Event_Key_Down *ev);
+EAPI Eina_Bool    ewk_frame_feed_key_up(Evas_Object *o, const Evas_Event_Key_Up *ev);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_frame_h
diff --git a/WebKit/efl/ewk/ewk_history.cpp b/WebKit/efl/ewk/ewk_history.cpp
new file mode 100644
index 0000000..da48c33
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_history.cpp
@@ -0,0 +1,704 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_history.h"
+
+#include "BackForwardList.h"
+#include "EWebKit.h"
+#include "HistoryItem.h"
+#include "Image.h"
+#include "ewk_private.h"
+#include <wtf/text/CString.h>
+
+#include <Eina.h>
+#include <eina_safety_checks.h>
+
+struct _Ewk_History {
+    WebCore::BackForwardList *core;
+};
+
+#define EWK_HISTORY_CORE_GET_OR_RETURN(history, core_, ...)      \
+    if (!(history)) {                                            \
+        CRITICAL("history is NULL.");                            \
+        return __VA_ARGS__;                                      \
+    }                                                            \
+    if (!(history)->core) {                                      \
+        CRITICAL("history->core is NULL.");                      \
+        return __VA_ARGS__;                                      \
+    }                                                            \
+    if (!(history)->core->enabled()) {                           \
+        ERR("history->core is disabled!.");                      \
+        return __VA_ARGS__;                                      \
+    }                                                            \
+    WebCore::BackForwardList *core_ = (history)->core
+
+
+struct _Ewk_History_Item {
+    WebCore::HistoryItem *core;
+
+    const char *title;
+    const char *alternate_title;
+    const char *uri;
+    const char *original_uri;
+};
+
+#define EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core_, ...) \
+    if (!(item)) {                                            \
+        CRITICAL("item is NULL.");                            \
+        return __VA_ARGS__;                                   \
+    }                                                         \
+    if (!(item)->core) {                                      \
+        CRITICAL("item->core is NULL.");                      \
+        return __VA_ARGS__;                                   \
+    }                                                         \
+    WebCore::HistoryItem *core_ = (item)->core
+
+
+static inline Ewk_History_Item *_ewk_history_item_new(WebCore::HistoryItem *core)
+{
+    Ewk_History_Item* item;
+
+    if (!core) {
+        ERR("WebCore::HistoryItem is NULL.");
+        return 0;
+    }
+
+    item = (Ewk_History_Item *)calloc(1, sizeof(Ewk_History_Item));
+    if (!item) {
+        CRITICAL("Could not allocate item memory.");
+        return 0;
+    }
+
+    core->ref();
+    item->core = core;
+
+    return item;
+}
+
+static inline Eina_List *_ewk_history_item_list_get(const WebCore::HistoryItemVector &core_items)
+{
+    Eina_List* ret = 0;
+    unsigned int i, size;
+
+    size = core_items.size();
+    for (i = 0; i < size; i++) {
+        Ewk_History_Item* item = _ewk_history_item_new(core_items[i].get());
+        if (item)
+            ret = eina_list_append(ret, item);
+    }
+
+    return ret;
+}
+
+/**
+ * Go forward in history one item, if possible.
+ *
+ * @param history which history instance to modify.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
+ */
+Eina_Bool ewk_history_forward(Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE);
+    if (core->forwardListCount() < 1)
+        return EINA_FALSE;
+    core->goForward();
+    return EINA_TRUE;
+}
+
+/**
+ * Go back in history one item, if possible.
+ *
+ * @param history which history instance to modify.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
+ */
+Eina_Bool ewk_history_back(Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE);
+    if (core->backListCount() < 1)
+        return EINA_FALSE;
+    core->goBack();
+    return EINA_TRUE;
+}
+
+/**
+ * Adds the given item to history.
+ *
+ * Memory handling: This will not modify or even take references to
+ * given item (Ewk_History_Item), so you should still handle it with
+ * ewk_history_item_free().
+ *
+ * @param history which history instance to modify.
+ * @param item reference to add to history. Unmodified. Must @b not be @c NULL.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
+ */
+Eina_Bool ewk_history_history_item_add(Ewk_History* history, const Ewk_History_Item* item)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE);
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE);
+    history_core->addItem(item_core);
+    return EINA_TRUE;
+}
+
+/**
+ * Sets the given item as current in history (go to item).
+ *
+ * Memory handling: This will not modify or even take references to
+ * given item (Ewk_History_Item), so you should still handle it with
+ * ewk_history_item_free().
+ *
+ * @param history which history instance to modify.
+ * @param item reference to go to history. Unmodified. Must @b not be @c NULL.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
+ */
+Eina_Bool ewk_history_history_item_set(Ewk_History* history, const Ewk_History_Item* item)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE);
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE);
+    history_core->goToItem(item_core);
+    return EINA_TRUE;
+}
+
+/**
+ * Get the first item from back list, if any.
+ *
+ * @param history which history instance to query.
+ *
+ * @return the @b newly allocated item instance. This memory must be
+ *         released with ewk_history_item_free() after use.
+ */
+Ewk_History_Item* ewk_history_history_item_back_get(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return _ewk_history_item_new(core->backItem());
+}
+
+/**
+ * Get the current item in history, if any.
+ *
+ * @param history which history instance to query.
+ *
+ * @return the @b newly allocated item instance. This memory must be
+ *         released with ewk_history_item_free() after use.
+ */
+Ewk_History_Item* ewk_history_history_item_current_get(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return _ewk_history_item_new(core->currentItem());
+}
+
+/**
+ * Get the first item from forward list, if any.
+ *
+ * @param history which history instance to query.
+ *
+ * @return the @b newly allocated item instance. This memory must be
+ *         released with ewk_history_item_free() after use.
+ */
+Ewk_History_Item* ewk_history_history_item_forward_get(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return _ewk_history_item_new(core->forwardItem());
+}
+
+/**
+ * Get item at given position, if any at that index.
+ *
+ * @param history which history instance to query.
+ * @param index position of item to get.
+ *
+ * @return the @b newly allocated item instance. This memory must be
+ *         released with ewk_history_item_free() after use.
+ */
+Ewk_History_Item* ewk_history_history_item_nth_get(const Ewk_History* history, int index)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return _ewk_history_item_new(core->itemAtIndex(index));
+}
+
+/**
+ * Queries if given item is in history.
+ *
+ * Memory handling: This will not modify or even take references to
+ * given item (Ewk_History_Item), so you should still handle it with
+ * ewk_history_item_free().
+ *
+ * @param history which history instance to modify.
+ * @param item reference to check in history. Must @b not be @c NULL.
+ *
+ * @return @c EINA_TRUE if in history, @c EINA_FALSE if not or failure.
+ */
+Eina_Bool ewk_history_history_item_contains(const Ewk_History* history, const Ewk_History_Item* item)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, history_core, EINA_FALSE);
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, item_core, EINA_FALSE);
+    return history_core->containsItem(item_core);
+}
+
+/**
+ * Get the whole forward list.
+ *
+ * @param history which history instance to query.
+ *
+ * @return a newly allocated list of @b newly allocated item
+ *         instance. This memory of each item must be released with
+ *         ewk_history_item_free() after use. use
+ *         ewk_history_item_list_free() for convenience.
+ *
+ * @see ewk_history_item_list_free()
+ * @see ewk_history_forward_list_get_with_limit()
+ */
+Eina_List* ewk_history_forward_list_get(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    WebCore::HistoryItemVector items;
+    int limit = core->forwardListCount();
+    core->forwardListWithLimit(limit, items);
+    return _ewk_history_item_list_get(items);
+}
+
+/**
+ * Get the forward list within the given limit.
+ *
+ * @param history which history instance to query.
+ * @param limit the maximum number of items to return.
+ *
+ * @return a newly allocated list of @b newly allocated item
+ *         instance. This memory of each item must be released with
+ *         ewk_history_item_free() after use. use
+ *         ewk_history_item_list_free() for convenience.
+ *
+ * @see ewk_history_item_list_free()
+ * @see ewk_history_forward_list_length()
+ * @see ewk_history_forward_list_get()
+ */
+Eina_List* ewk_history_forward_list_get_with_limit(const Ewk_History* history, int limit)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    WebCore::HistoryItemVector items;
+    core->forwardListWithLimit(limit, items);
+    return _ewk_history_item_list_get(items);
+}
+
+/**
+ * Get the whole size of forward list.
+ *
+ * @param history which history instance to query.
+ *
+ * @return number of elements in whole list.
+ *
+ * @see ewk_history_forward_list_get_with_limit()
+ */
+int ewk_history_forward_list_length(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return core->forwardListCount();
+}
+
+/**
+ * Get the whole back list.
+ *
+ * @param history which history instance to query.
+ *
+ * @return a newly allocated list of @b newly allocated item
+ *         instance. This memory of each item must be released with
+ *         ewk_history_item_free() after use. use
+ *         ewk_history_item_list_free() for convenience.
+ *
+ * @see ewk_history_item_list_free()
+ * @see ewk_history_back_list_get_with_limit()
+ */
+Eina_List* ewk_history_back_list_get(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    WebCore::HistoryItemVector items;
+    int limit = core->backListCount();
+    core->backListWithLimit(limit, items);
+    return _ewk_history_item_list_get(items);
+}
+
+/**
+ * Get the back list within the given limit.
+ *
+ * @param history which history instance to query.
+ * @param limit the maximum number of items to return.
+ *
+ * @return a newly allocated list of @b newly allocated item
+ *         instance. This memory of each item must be released with
+ *         ewk_history_item_free() after use. use
+ *         ewk_history_item_list_free() for convenience.
+ *
+ * @see ewk_history_item_list_free()
+ * @see ewk_history_back_list_length()
+ * @see ewk_history_back_list_get()
+ */
+Eina_List* ewk_history_back_list_get_with_limit(const Ewk_History* history, int limit)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    WebCore::HistoryItemVector items;
+    core->backListWithLimit(limit, items);
+    return _ewk_history_item_list_get(items);
+}
+
+/**
+ * Get the whole size of back list.
+ *
+ * @param history which history instance to query.
+ *
+ * @return number of elements in whole list.
+ *
+ * @see ewk_history_back_list_get_with_limit()
+ */
+int ewk_history_back_list_length(const Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return core->backListCount();
+}
+
+/**
+ * Get maximum capacity of given history.
+ *
+ * @param history which history instance to query.
+ *
+ * @return maximum number of entries this history will hold.
+ */
+int ewk_history_limit_get(Ewk_History* history)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, 0);
+    return core->capacity();
+}
+
+/**
+ * Set maximum capacity of given history.
+ *
+ * @param history which history instance to modify.
+ * @param limit maximum size to allow.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_history_limit_set(const Ewk_History* history, int limit)
+{
+    EWK_HISTORY_CORE_GET_OR_RETURN(history, core, EINA_FALSE);
+    core->setCapacity(limit);
+    return EINA_TRUE;
+}
+
+/**
+ * Create a new history item with given URI and title.
+ *
+ * @param uri where this resource is located.
+ * @param title resource title.
+ *
+ * @return newly allocated history item or @c NULL on errors. You must
+ *         free this item with ewk_history_item_free().
+ */
+Ewk_History_Item* ewk_history_item_new(const char* uri, const char* title)
+{
+    WebCore::String u = WebCore::String::fromUTF8(uri);
+    WebCore::String t = WebCore::String::fromUTF8(title);
+    WTF::RefPtr<WebCore::HistoryItem> core = WebCore::HistoryItem::create(u, t, 0);
+    Ewk_History_Item* item = _ewk_history_item_new(core.release().releaseRef());
+    return item;
+}
+
+static inline void _ewk_history_item_free(Ewk_History_Item* item, WebCore::HistoryItem* core)
+{
+    core->deref();
+    free(item);
+}
+
+/**
+ * Free given history item instance.
+ *
+ * @param item what to free.
+ */
+void ewk_history_item_free(Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core);
+    _ewk_history_item_free(item, core);
+}
+
+/**
+ * Free given list and associated history items instances.
+ *
+ * @param history_items list of items to free (both list nodes and
+ *        item instances).
+ */
+void ewk_history_item_list_free(Eina_List* history_items)
+{
+    void* d;
+    EINA_LIST_FREE(history_items, d) {
+        Ewk_History_Item* item = (Ewk_History_Item*)d;
+        _ewk_history_item_free(item, item->core);
+    }
+}
+
+/**
+ * Query title for given history item.
+ *
+ * @param item history item to query.
+ *
+ * @return the title pointer, that may be @c NULL. This pointer is
+ *         guaranteed to be eina_stringshare, so whenever possible
+ *         save yourself some cpu cycles and use
+ *         eina_stringshare_ref() instead of eina_stringshare_add() or
+ *         strdup().
+ */
+const char* ewk_history_item_title_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    // hide the following optimzation from outside
+    Ewk_History_Item* i = (Ewk_History_Item*)item;
+    eina_stringshare_replace(&i->title, core->title().utf8().data());
+    return i->title;
+}
+
+/**
+ * Query alternate title for given history item.
+ *
+ * @param item history item to query.
+ *
+ * @return the alternate title pointer, that may be @c NULL. This
+ *         pointer is guaranteed to be eina_stringshare, so whenever
+ *         possible save yourself some cpu cycles and use
+ *         eina_stringshare_ref() instead of eina_stringshare_add() or
+ *         strdup().
+ */
+const char* ewk_history_item_title_alternate_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    // hide the following optimzation from outside
+    Ewk_History_Item* i = (Ewk_History_Item*)item;
+    eina_stringshare_replace(&i->alternate_title,
+                             core->alternateTitle().utf8().data());
+    return i->alternate_title;
+}
+
+/**
+ * Set alternate title for given history item.
+ *
+ * @param item history item to query.
+ * @param title new alternate title to use for given item. No
+ *        references are kept after this function returns.
+ */
+void ewk_history_item_title_alternate_set(Ewk_History_Item* item, const char* title)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core);
+    if (!eina_stringshare_replace(&item->alternate_title, title))
+        return;
+    core->setAlternateTitle(WebCore::String::fromUTF8(title));
+}
+
+/**
+ * Query URI for given history item.
+ *
+ * @param item history item to query.
+ *
+ * @return the URI pointer, that may be @c NULL. This pointer is
+ *         guaranteed to be eina_stringshare, so whenever possible
+ *         save yourself some cpu cycles and use
+ *         eina_stringshare_ref() instead of eina_stringshare_add() or
+ *         strdup().
+ */
+const char* ewk_history_item_uri_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    // hide the following optimzation from outside
+    Ewk_History_Item* i = (Ewk_History_Item*)item;
+    eina_stringshare_replace(&i->uri, core->urlString().utf8().data());
+    return i->uri;
+}
+
+/**
+ * Query original URI for given history item.
+ *
+ * @param item history item to query.
+ *
+ * @return the original URI pointer, that may be @c NULL. This pointer
+ *         is guaranteed to be eina_stringshare, so whenever possible
+ *         save yourself some cpu cycles and use
+ *         eina_stringshare_ref() instead of eina_stringshare_add() or
+ *         strdup().
+ */
+const char* ewk_history_item_uri_original_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    // hide the following optimzation from outside
+    Ewk_History_Item* i = (Ewk_History_Item*)item;
+    eina_stringshare_replace(&i->original_uri,
+                             core->originalURLString().utf8().data());
+    return i->original_uri;
+}
+
+/**
+ * Query last visited time for given history item.
+ *
+ * @param item history item to query.
+ *
+ * @return the time in seconds this item was visited.
+ */
+double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0.0);
+    return core->lastVisitedTime();
+}
+
+/**
+ * Get the icon (aka favicon) associated with this history item.
+ *
+ * @note in order to have this working, one must open icon database
+ *       with ewk_settings_icon_database_path_set().
+ *
+ * @param item history item to query.
+ *
+ * @return the surface reference or @c NULL on errors. Note that the
+ *         reference may be to a standard fallback icon.
+ */
+cairo_surface_t* ewk_history_item_icon_surface_get(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    WebCore::Image* icon = core->icon();
+    if (!icon) {
+        ERR("icon is NULL.");
+        return 0;
+    }
+    return icon->nativeImageForCurrentFrame();
+}
+
+/**
+ * Add an Evas_Object of type 'image' to given canvas with history item icon.
+ *
+ * This is an utility function that creates an Evas_Object of type
+ * image set to have fill always match object size
+ * (evas_object_image_filled_add()), saving some code to use it from Evas.
+ *
+ * @note in order to have this working, one must open icon database
+ *       with ewk_settings_icon_database_path_set().
+ *
+ * @param item history item to query.
+ * @param canvas evas instance where to add resulting object.
+ *
+ * @return newly allocated Evas_Object instance or @c NULL on
+ *         errors. Delete the object with evas_object_del().
+ */
+Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas* canvas)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
+    WebCore::Image* icon = core->icon();
+    cairo_surface_t* surface;
+
+    if (!icon) {
+        ERR("icon is NULL.");
+        return 0;
+    }
+
+    surface = icon->nativeImageForCurrentFrame();
+    return ewk_util_image_from_cairo_surface_add(canvas, surface);
+}
+
+/**
+ * Query if given item is still in page cache.
+ *
+ * @param item history item to query.
+ *
+ * @return @c EINA_TRUE if in cache, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_history_item_page_cache_exists(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, EINA_FALSE);
+    return core->isInPageCache();
+}
+
+/**
+ * Query number of times item was visited.
+ *
+ * @param item history item to query.
+ *
+ * @return number of visits.
+ */
+int ewk_history_item_visit_count(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0);
+    return core->visitCount();
+}
+
+/**
+ * Query if last visit to item was failure or not.
+ *
+ * @param item history item to query.
+ *
+ * @return @c EINA_TRUE if last visit was failure, @c EINA_FALSE if it
+ *         was fine.
+ */
+Eina_Bool ewk_history_item_visit_last_failed(const Ewk_History_Item* item)
+{
+    EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, EINA_TRUE);
+    return core->lastVisitWasFailure();
+}
+
+
+/* internal methods ****************************************************/
+/**
+ * @internal
+ *
+ * Creates history for given view. Called internally by ewk_view and
+ * should never be called from outside.
+ *
+ * @param core WebCore::BackForwardList instance to use internally.
+ *
+ * @return newly allocated history instance or @c NULL on errors.
+ */
+Ewk_History* ewk_history_new(WebCore::BackForwardList* core)
+{
+    Ewk_History* history;
+    EINA_SAFETY_ON_NULL_RETURN_VAL(core, 0);
+    DBG("core=%p", core);
+
+    history = (Ewk_History*)malloc(sizeof(Ewk_History));
+    if (!history) {
+        CRITICAL("Could not allocate history memory.");
+        return 0;
+    }
+
+    core->ref();
+    history->core = core;
+
+    return history;
+}
+
+/**
+ * @internal
+ *
+ * Destroys previously allocated history instance. This is called
+ * automatically by ewk_view and should never be called from outside.
+ *
+ * @param history instance to free
+ */
+void ewk_history_free(Ewk_History* history)
+{
+    DBG("history=%p", history);
+    history->core->deref();
+    free(history);
+}
diff --git a/WebKit/efl/ewk/ewk_history.h b/WebKit/efl/ewk/ewk_history.h
new file mode 100644
index 0000000..3943d7e
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_history.h
@@ -0,0 +1,96 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_history_h
+#define ewk_history_h
+
+#include "ewk_eapi.h"
+
+#include <Eina.h>
+#include <Evas.h>
+#include <cairo.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The history (back-forward list) associated with a given ewk_view.
+ *
+ * Changing the history affects immediately the view, changing the
+ * current uri, for example.
+ *
+ * When ewk_view is navigated or uris are set, history automatically
+ * updates. That's why no direct access to history structure is
+ * allowed.
+ */
+typedef struct _Ewk_History         Ewk_History;
+
+/**
+ * Represents one item from Ewk_History.
+ */
+typedef struct _Ewk_History_Item    Ewk_History_Item;
+
+
+
+EAPI Eina_Bool         ewk_history_forward(Ewk_History *history);
+EAPI Eina_Bool         ewk_history_back(Ewk_History *history);
+
+EAPI Eina_Bool         ewk_history_history_item_add(Ewk_History *history, const Ewk_History_Item *item);
+EAPI Eina_Bool         ewk_history_history_item_set(Ewk_History *history,  const Ewk_History_Item *item);
+EAPI Ewk_History_Item *ewk_history_history_item_back_get(const Ewk_History *history);
+EAPI Ewk_History_Item *ewk_history_history_item_current_get(const Ewk_History *history);
+EAPI Ewk_History_Item *ewk_history_history_item_forward_get(const Ewk_History *history);
+EAPI Ewk_History_Item *ewk_history_history_item_nth_get(const Ewk_History *history, int index);
+EAPI Eina_Bool         ewk_history_history_item_contains(const Ewk_History *history, const Ewk_History_Item *item);
+
+EAPI Eina_List        *ewk_history_forward_list_get(const Ewk_History *history);
+EAPI Eina_List        *ewk_history_forward_list_get_with_limit(const Ewk_History *history, int limit);
+EAPI int               ewk_history_forward_list_length(const Ewk_History *history);
+
+EAPI Eina_List        *ewk_history_back_list_get(const Ewk_History *history);
+EAPI Eina_List        *ewk_history_back_list_get_with_limit(const Ewk_History *history, int limit);
+EAPI int               ewk_history_back_list_length(const Ewk_History *history);
+
+EAPI int               ewk_history_limit_get(Ewk_History *history);
+EAPI Eina_Bool         ewk_history_limit_set(const Ewk_History *history, int limit);
+
+EAPI Ewk_History_Item *ewk_history_item_new(const char *uri, const char *title);
+EAPI void              ewk_history_item_free(Ewk_History_Item *item);
+EAPI void              ewk_history_item_list_free(Eina_List *history_items);
+
+EAPI const char       *ewk_history_item_title_get(const Ewk_History_Item *item);
+EAPI const char       *ewk_history_item_title_alternate_get(const Ewk_History_Item *item);
+EAPI void              ewk_history_item_title_alternate_set(Ewk_History_Item *item, const char *title);
+EAPI const char       *ewk_history_item_uri_get(const Ewk_History_Item *item);
+EAPI const char       *ewk_history_item_uri_original_get(const Ewk_History_Item *item);
+EAPI double            ewk_history_item_time_last_visited_get(const Ewk_History_Item *item);
+
+EAPI cairo_surface_t  *ewk_history_item_icon_surface_get(const Ewk_History_Item *item);
+EAPI Evas_Object      *ewk_history_item_icon_object_add(const Ewk_History_Item *item, Evas *canvas);
+
+EAPI Eina_Bool         ewk_history_item_page_cache_exists(const Ewk_History_Item *item);
+EAPI int               ewk_history_item_visit_count(const Ewk_History_Item *item);
+EAPI Eina_Bool         ewk_history_item_visit_last_failed(const Ewk_History_Item *item);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_history_h
diff --git a/WebKit/efl/ewk/ewk_logging.h b/WebKit/efl/ewk/ewk_logging.h
new file mode 100644
index 0000000..045bd9c
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_logging.h
@@ -0,0 +1,31 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_logging_h
+#define ewk_logging_h
+
+extern int _ewk_log_dom;
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ewk_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_ewk_log_dom, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_ewk_log_dom, __VA_ARGS__)
+#define INF(...) EINA_LOG_DOM_INFO(_ewk_log_dom, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_ewk_log_dom, __VA_ARGS__)
+
+#endif // ewk_logging_h
diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp
new file mode 100644
index 0000000..2c69b36
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_main.cpp
@@ -0,0 +1,152 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_main.h"
+
+#include "EWebKit.h"
+#include "Logging.h"
+#include "PageCache.h"
+#include "PageGroup.h"
+#include "ewk_private.h"
+#include "runtime/InitializeThreading.h"
+
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Edje.h>
+#include <Eina.h>
+#include <Evas.h>
+
+#ifdef ENABLE_GLIB_SUPPORT
+#include <glib-object.h>
+#include <glib.h>
+
+#ifdef ENABLE_GTK_PLUGINS_SUPPORT
+#include <gtk/gtk.h>
+#endif
+
+#endif
+
+// REMOVE-ME: see todo below
+#include "ResourceHandle.h"
+#include <libsoup/soup.h>
+
+static int _ewk_init_count = 0;
+int _ewk_log_dom = -1;
+
+int ewk_init(void)
+{
+    if (_ewk_init_count)
+        return ++_ewk_init_count;
+
+    if (!eina_init())
+        goto error_eina;
+
+    _ewk_log_dom = eina_log_domain_register("ewebkit", EINA_COLOR_ORANGE);
+    if (_ewk_log_dom < 0) {
+        EINA_LOG_CRIT("could not register log domain 'ewebkit'");
+        goto error_log_domain;
+    }
+
+    if (!evas_init()) {
+        CRITICAL("could not init evas.");
+        goto error_evas;
+    }
+
+    if (!ecore_init()) {
+        CRITICAL("could not init ecore.");
+        goto error_ecore;
+    }
+
+    if (!ecore_evas_init()) {
+        CRITICAL("could not init ecore_evas.");
+        goto error_ecore_evas;
+    }
+
+    if (!edje_init()) {
+        CRITICAL("could not init edje.");
+        goto error_edje;
+    }
+
+#ifdef ENABLE_GLIB_SUPPORT
+    g_type_init();
+
+    if (!g_thread_supported())
+        g_thread_init(0);
+
+#ifdef ENABLE_GTK_PLUGINS_SUPPORT
+    gdk_threads_init();
+    if (!gtk_init_check(0, 0))
+        WRN("Could not initialize GTK support.");
+#endif
+
+    if (!ecore_main_loop_glib_integrate())
+        WRN("Ecore was not compiled with GLib support, some plugins will not "
+            "work (ie: Adobe Flash)");
+#endif
+
+    JSC::initializeThreading();
+    WebCore::InitializeLoggingChannelsIfNecessary();
+
+    // Page cache capacity (in pages). Comment from Mac port:
+    // (Research indicates that value / page drops substantially after 3 pages.)
+    // FIXME: Expose this with an API and/or calculate based on available resources
+    WebCore::pageCache()->setCapacity(3);
+    WebCore::PageGroup::setShouldTrackVisitedLinks(true);
+
+    // TODO: this should move to WebCore, already reported to webkit-gtk folks:
+    if (1) {
+        SoupSession* session = WebCore::ResourceHandle::defaultSession();
+        soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
+    }
+
+    return ++_ewk_init_count;
+
+error_edje:
+    ecore_evas_shutdown();
+error_ecore_evas:
+    ecore_shutdown();
+error_ecore:
+    evas_shutdown();
+error_evas:
+    eina_log_domain_unregister(_ewk_log_dom);
+    _ewk_log_dom = -1;
+error_log_domain:
+    eina_shutdown();
+error_eina:
+    return 0;
+}
+
+int ewk_shutdown(void)
+{
+    _ewk_init_count--;
+    if (_ewk_init_count)
+        return _ewk_init_count;
+
+    ecore_evas_shutdown();
+    ecore_shutdown();
+    evas_shutdown();
+    eina_log_domain_unregister(_ewk_log_dom);
+    _ewk_log_dom = -1;
+    eina_shutdown();
+
+    return 0;
+}
+
diff --git a/WebKit/efl/ewk/ewk_main.h b/WebKit/efl/ewk/ewk_main.h
new file mode 100644
index 0000000..3730e88
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_main.h
@@ -0,0 +1,36 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_main_h
+#define ewk_main_h
+
+#include "ewk_eapi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EAPI int ewk_init(void);
+EAPI int ewk_shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_main_h
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
new file mode 100644
index 0000000..947bd79
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -0,0 +1,115 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_private_h
+#define ewk_private_h
+
+#include "BackForwardList.h"
+#include "EWebKit.h"
+#include "Frame.h"
+#include "Page.h"
+#include "Settings.h"
+#include "Widget.h"
+#include "ewk_logging.h"
+#include "ewk_util.h"
+
+#include <cairo.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// If defined, ewk will do type checking to ensure objects are of correct type
+#define EWK_TYPE_CHECK 1
+
+void             ewk_view_ready(Evas_Object *o);
+void             ewk_view_title_set(Evas_Object *o, const char *title);
+void             ewk_view_uri_changed(Evas_Object *o);
+void             ewk_view_load_started(Evas_Object *o);
+void             ewk_view_frame_main_load_started(Evas_Object *o);
+void             ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error);
+void             ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error);
+void             ewk_view_load_progress_changed(Evas_Object *o);
+
+void             ewk_view_mouse_link_hover_in(Evas_Object *o, void *data);
+void             ewk_view_mouse_link_hover_out(Evas_Object *o);
+
+void             ewk_view_toolbars_visible_set(Evas_Object *o, Eina_Bool visible);
+void             ewk_view_toolbars_visible_get(Evas_Object *o, Eina_Bool *visible);
+
+void             ewk_view_statusbar_visible_set(Evas_Object *o, Eina_Bool visible);
+void             ewk_view_statusbar_visible_get(Evas_Object *o, Eina_Bool *visible);
+void             ewk_view_statusbar_text_set(Evas_Object *o, const char *text);
+
+void             ewk_view_scrollbars_visible_set(Evas_Object *o, Eina_Bool visible);
+void             ewk_view_scrollbars_visible_get(Evas_Object *o, Eina_Bool *visible);
+
+void             ewk_view_menubar_visible_set(Evas_Object *o, Eina_Bool visible);
+void             ewk_view_menubar_visible_get(Evas_Object *o, Eina_Bool *visible);
+
+void             ewk_view_tooltip_text_set(Evas_Object *o, const char *text);
+
+void             ewk_view_add_console_message(Evas_Object *o, const char *message, unsigned int lineNumber, const char *sourceID);
+
+void             ewk_view_run_javascript_alert(Evas_Object *o, Evas_Object *frame, const char *message);
+Eina_Bool        ewk_view_run_javascript_confirm(Evas_Object *o, Evas_Object *frame, const char *message);
+Eina_Bool        ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, const char *message, const char *defaultValue, char **value);
+Eina_Bool        ewk_view_should_interrupt_javascript(Evas_Object *o);
+void             ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName);
+
+void             ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
+void             ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame);
+WebCore::Page   *ewk_view_core_page_get(const Evas_Object *o);
+
+WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer);
+
+WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually);
+
+Ewk_History      *ewk_history_new(WebCore::BackForwardList *history);
+void              ewk_history_free(Ewk_History *history);
+
+Evas_Object      *ewk_frame_add(Evas *e);
+Eina_Bool         ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
+Evas_Object      *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer);
+
+WebCore::Frame   *ewk_frame_core_get(const Evas_Object *o);
+void              ewk_frame_core_gone(Evas_Object *o);
+
+void              ewk_frame_load_started(Evas_Object *o);
+void              ewk_frame_load_finished(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url);
+void              ewk_frame_load_error(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url);
+void              ewk_frame_load_progress_changed(Evas_Object *o);
+
+void              ewk_frame_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h);
+void              ewk_frame_title_set(Evas_Object *o, const char *title);
+
+void              ewk_frame_view_create_for_view(Evas_Object *o, Evas_Object *view);
+Eina_Bool         ewk_frame_uri_changed(Evas_Object *o);
+void              ewk_frame_force_layout(Evas_Object *o);
+
+WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually);
+
+#ifdef __cplusplus
+
+}
+#endif
+#endif // ewk_private_h
diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp
new file mode 100644
index 0000000..0822dc2
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_settings.cpp
@@ -0,0 +1,190 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_settings.h"
+
+#include "EWebKit.h"
+#include "IconDatabase.h"
+#include "Image.h"
+#include "IntSize.h"
+#include "KURL.h"
+#include "ewk_private.h"
+#include <wtf/text/CString.h>
+
+#include <eina_safety_checks.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+static uint64_t _ewk_default_web_database_quota = 1 * 1024;
+
+/**
+ * Returns the default quota for Web Database databases. By default
+ * this value is 1MB.
+ *
+ * @return the current default database quota in bytes
+ **/
+uint64_t ewk_settings_web_database_default_quota_get()
+{
+    return _ewk_default_web_database_quota;
+}
+
+/**
+ * Sets directory where to store icon database, opening database.
+ *
+ * @param directory where to store icon database, must be
+ *        write-able. If @c NULL is given, then database is closed.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on errors.
+ */
+Eina_Bool ewk_settings_icon_database_path_set(const char *directory)
+{
+    WebCore::iconDatabase()->delayDatabaseCleanup();
+
+    if (directory) {
+        struct stat st;
+
+        if (stat(directory, &st)) {
+            ERR("could not stat(%s): %s", directory, strerror(errno));
+            return EINA_FALSE;
+        }
+
+        if (!S_ISDIR(st.st_mode)) {
+            ERR("not a directory: %s", directory);
+            return EINA_FALSE;
+        }
+
+        if (access(directory, R_OK | W_OK)) {
+            ERR("could not access directory '%s' for read and write: %s",
+                directory, strerror(errno));
+            return EINA_FALSE;
+        }
+
+        WebCore::iconDatabase()->setEnabled(true);
+        WebCore::iconDatabase()->open(WebCore::String::fromUTF8(directory));
+    } else {
+        WebCore::iconDatabase()->setEnabled(false);
+        WebCore::iconDatabase()->close();
+    }
+    return EINA_TRUE;
+}
+
+/**
+ * Return directory path where icon database is stored.
+ *
+ * @return newly allocated string with database path or @c NULL if
+ *         none is set or database is closed. Note that return must be
+ *         freed with free() as it's a strdup()ed copy of the string
+ *         due reference counting.
+ */
+char* ewk_settings_icon_database_path_get(void)
+{
+    if (!WebCore::iconDatabase()->isEnabled())
+        return 0;
+    if (!WebCore::iconDatabase()->isOpen())
+        return 0;
+
+    WebCore::String path = WebCore::iconDatabase()->databasePath();
+    if (path.isEmpty())
+        return 0;
+    return strdup(path.utf8().data());
+}
+
+/**
+ * Remove all known icons from database.
+ *
+ * Database must be opened with ewk_settings_icon_database_path_set()
+ * in order to work.
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise, like
+ *         closed database.
+ */
+Eina_Bool ewk_settings_icon_database_clear(void)
+{
+    if (!WebCore::iconDatabase()->isEnabled())
+        return EINA_FALSE;
+    if (!WebCore::iconDatabase()->isOpen())
+        return EINA_FALSE;
+
+    WebCore::iconDatabase()->removeAllIcons();
+    return EINA_TRUE;
+}
+
+/**
+ * Query icon for given URL, returning associated cairo surface.
+ *
+ * @note in order to have this working, one must open icon database
+ *       with ewk_settings_icon_database_path_set().
+ *
+ * @param url which url to query icon.
+ *
+ * @return cairo surface if any, or NULL on failure.
+ */
+cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
+
+    WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url));
+    WebCore::Image *icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
+
+    if (!icon) {
+        ERR("no icon for url %s", url);
+        return 0;
+    }
+
+    return icon->nativeImageForCurrentFrame();
+}
+
+/**
+ * Create Evas_Object of type image representing the given URL.
+ *
+ * This is an utility function that creates an Evas_Object of type
+ * image set to have fill always match object size
+ * (evas_object_image_filled_add()), saving some code to use it from Evas.
+ *
+ * @note in order to have this working, one must open icon database
+ *       with ewk_settings_icon_database_path_set().
+ *
+ * @param url which url to query icon.
+ * @param canvas evas instance where to add resulting object.
+ *
+ * @return newly allocated Evas_Object instance or @c NULL on
+ *         errors. Delete the object with evas_object_del().
+ */
+Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* canvas)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
+
+    WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url));
+    WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16));
+    cairo_surface_t* surface;
+
+    if (!icon) {
+        ERR("no icon for url %s", url);
+        return 0;
+    }
+
+    surface = icon->nativeImageForCurrentFrame();
+    return ewk_util_image_from_cairo_surface_add(canvas, surface);
+}
diff --git a/WebKit/efl/ewk/ewk_settings.h b/WebKit/efl/ewk/ewk_settings.h
new file mode 100644
index 0000000..e843fd1
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_settings.h
@@ -0,0 +1,53 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_settings_h
+#define ewk_settings_h
+
+#include "ewk_eapi.h"
+
+#include <Eina.h>
+#include <Evas.h>
+#include <cairo.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file
+ *
+ * General purpose settings, not tied to any view object.
+ */
+
+EAPI uint64_t         ewk_settings_web_database_default_quota_get();
+
+EAPI Eina_Bool        ewk_settings_icon_database_path_set(const char *path);
+EAPI char            *ewk_settings_icon_database_path_get(void);
+EAPI Eina_Bool        ewk_settings_icon_database_clear(void);
+
+EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url);
+EAPI Evas_Object     *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_settings_h
diff --git a/WebKit/efl/ewk/ewk_util.cpp b/WebKit/efl/ewk/ewk_util.cpp
new file mode 100644
index 0000000..bf82695
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_util.cpp
@@ -0,0 +1,98 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_util.h"
+
+#include "ewk_private.h"
+#include <eina_safety_checks.h>
+
+Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface)
+{
+    cairo_status_t status;
+    cairo_surface_type_t type;
+    cairo_format_t format;
+    int w, h, stride;
+    Evas_Object* image;
+    const void* src;
+    void* dst;
+
+    EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(surface, 0);
+
+    status = cairo_surface_status(surface);
+    if (status != CAIRO_STATUS_SUCCESS) {
+        ERR("cairo surface is invalid: %s", cairo_status_to_string(status));
+        return 0;
+    }
+
+    type = cairo_surface_get_type(surface);
+    if (type != CAIRO_SURFACE_TYPE_IMAGE) {
+        ERR("unknown surface type %d, required %d (CAIRO_SURFACE_TYPE_IMAGE).",
+            type, CAIRO_SURFACE_TYPE_IMAGE);
+        return 0;
+    }
+
+    format = cairo_image_surface_get_format(surface);
+    if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24) {
+        ERR("unknown surface format %d, expected %d or %d.",
+            format, CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24);
+        return 0;
+    }
+
+    w = cairo_image_surface_get_width(surface);
+    h = cairo_image_surface_get_height(surface);
+    stride = cairo_image_surface_get_stride(surface);
+    if (w <= 0 || h <= 0 || stride <= 0) {
+        ERR("invalid image size %dx%d, stride=%d", w, h, stride);
+        return 0;
+    }
+
+    src = cairo_image_surface_get_data(surface);
+    if (!src) {
+        ERR("could not get source data.");
+        return 0;
+    }
+
+    image = evas_object_image_filled_add(canvas);
+    if (!image) {
+        ERR("could not add image to canvas.");
+        return 0;
+    }
+
+    evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
+    evas_object_image_size_set(image, w, h);
+    evas_object_image_alpha_set(image, format == CAIRO_FORMAT_ARGB32);
+
+    if (evas_object_image_stride_get(image) * 4 != stride) {
+        ERR("evas' stride %d diverges from cairo's %d.",
+            evas_object_image_stride_get(image) * 4, stride);
+        evas_object_del(image);
+        return 0;
+    }
+
+    dst = evas_object_image_data_get(image, EINA_TRUE);
+    memcpy(dst, src, h * stride);
+    evas_object_image_data_set(image, dst);
+
+    evas_object_resize(image, w, h); // helpful but not really required
+
+    return image;
+}
diff --git a/WebKit/efl/ewk/ewk_util.h b/WebKit/efl/ewk/ewk_util.h
new file mode 100644
index 0000000..d9c8f9c
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_util.h
@@ -0,0 +1,29 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_util_h
+#define ewk_util_h
+
+#include <Evas.h>
+#include <cairo.h>
+
+Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface);
+
+#endif // ewk_util_h
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
new file mode 100644
index 0000000..eeb6535
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -0,0 +1,3644 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_view.h"
+
+#include "ChromeClientEfl.h"
+#include "ContextMenuClientEfl.h"
+#include "DocumentLoader.h"
+#include "DragClientEfl.h"
+#include "EWebKit.h"
+#include "EditorClientEfl.h"
+#include "FocusController.h"
+#include "FrameLoaderClientEfl.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "InspectorClientEfl.h"
+#include "PopupMenuClient.h"
+#include "ProgressTracker.h"
+#include "ewk_private.h"
+
+#include <Ecore.h>
+#include <Eina.h>
+#include <Evas.h>
+#include <eina_safety_checks.h>
+#include <sys/time.h>
+
+#define ZOOM_MIN (0.05)
+#define ZOOM_MAX (4.0)
+
+static const char EWK_VIEW_TYPE_STR[] = "EWK_View";
+
+static const size_t EWK_VIEW_REPAINTS_SIZE_INITIAL = 32;
+static const size_t EWK_VIEW_REPAINTS_SIZE_STEP = 8;
+static const size_t EWK_VIEW_REPAINTS_SIZE_MAX_FREE = 64;
+
+static const size_t EWK_VIEW_SCROLLS_SIZE_INITIAL = 8;
+static const size_t EWK_VIEW_SCROLLS_SIZE_STEP = 2;
+static const size_t EWK_VIEW_SCROLLS_SIZE_MAX_FREE = 32;
+
+struct _Ewk_View_Private_Data {
+    WebCore::Page* page;
+    WebCore::Settings* page_settings;
+    WebCore::Frame* main_frame;
+    Ewk_History* history;
+    struct {
+        Ewk_Menu menu;
+        WebCore::PopupMenuClient* menu_client;
+    } popup;
+    struct {
+        Eina_Rectangle* array;
+        size_t count;
+        size_t allocated;
+    } repaints;
+    struct {
+        Ewk_Scroll_Request* array;
+        size_t count;
+        size_t allocated;
+    } scrolls;
+    struct {
+        const char* user_agent;
+        const char* user_stylesheet;
+        const char* encoding_default;
+        const char* encoding_custom;
+        int font_minimum_size;
+        int font_minimum_logical_size;
+        int font_default_size;
+        int font_monospace_size;
+        const char* font_standard;
+        const char* font_cursive;
+        const char* font_monospace;
+        const char* font_fantasy;
+        const char* font_serif;
+        const char* font_sans_serif;
+        Eina_Bool auto_load_images:1;
+        Eina_Bool auto_shrink_images:1;
+        Eina_Bool enable_scripts:1;
+        Eina_Bool enable_plugins:1;
+        Eina_Bool scripts_window_open:1;
+        Eina_Bool resizable_textareas:1;
+        Eina_Bool private_browsing:1;
+        Eina_Bool caret_browsing:1;
+    } settings;
+    struct {
+        struct {
+            double start;
+            double end;
+            double duration;
+        } time;
+        struct {
+            float start;
+            float end;
+            float range;
+        } zoom;
+        struct {
+            Evas_Coord x, y;
+        } center;
+        Ecore_Animator* animator;
+    } animated_zoom;
+    struct {
+        Evas_Coord w, h;
+        Eina_Bool use:1;
+    } fixed_layout;
+};
+
+#ifndef EWK_TYPE_CHECK
+#define EWK_VIEW_TYPE_CHECK(o, ...) do { } while (0)
+#else
+#define EWK_VIEW_TYPE_CHECK(o, ...)                                     \
+    do {                                                                \
+        const char* _tmp_otype = evas_object_type_get(o);               \
+        const Evas_Smart* _tmp_s = evas_object_smart_smart_get(o);      \
+        if (EINA_UNLIKELY(!_tmp_s)) {                                   \
+            EINA_LOG_CRIT                                               \
+                ("%p (%s) is not a smart object!", o,                   \
+                 _tmp_otype ? _tmp_otype : "(null)");                   \
+            return __VA_ARGS__;                                         \
+        }                                                               \
+        const Evas_Smart_Class* _tmp_sc = evas_smart_class_get(_tmp_s); \
+        if (EINA_UNLIKELY(!_tmp_sc)) {                                  \
+            EINA_LOG_CRIT                                               \
+                ("%p (%s) is not a smart object!", o,                   \
+                 _tmp_otype ? _tmp_otype : "(null)");                   \
+            return __VA_ARGS__;                                         \
+        }                                                               \
+        if (EINA_UNLIKELY(_tmp_sc->data != EWK_VIEW_TYPE_STR)) {        \
+            EINA_LOG_CRIT                                               \
+                ("%p (%s) is not of an ewk_view (need %p, got %p)!",    \
+                 o, _tmp_otype ? _tmp_otype : "(null)",                 \
+                 EWK_VIEW_TYPE_STR, _tmp_sc->data);                     \
+            return __VA_ARGS__;                                         \
+        }                                                               \
+    } while (0)
+#endif
+
+#define EWK_VIEW_SD_GET(o, ptr)                                 \
+    Ewk_View_Smart_Data* ptr = (Ewk_View_Smart_Data*)evas_object_smart_data_get(o)
+
+#define EWK_VIEW_SD_GET_OR_RETURN(o, ptr, ...)          \
+    EWK_VIEW_TYPE_CHECK(o, __VA_ARGS__);                \
+    EWK_VIEW_SD_GET(o, ptr);                            \
+    if (!ptr) {                                         \
+        CRITICAL("no smart data for object %p (%s)",    \
+                 o, evas_object_type_get(o));           \
+        return __VA_ARGS__;                             \
+    }
+
+#define EWK_VIEW_PRIV_GET(sd, ptr)              \
+    Ewk_View_Private_Data* ptr = sd->_priv
+
+#define EWK_VIEW_PRIV_GET_OR_RETURN(sd, ptr, ...)               \
+    EWK_VIEW_PRIV_GET(sd, ptr);                                 \
+    if (!ptr) {                                                 \
+        CRITICAL("no private data for object %p (%s)",          \
+                 sd->self, evas_object_type_get(sd->self));     \
+        return __VA_ARGS__;                                     \
+    }
+
+static void _ewk_view_smart_changed(Ewk_View_Smart_Data* sd)
+{
+    if (sd->changed.any)
+        return;
+    sd->changed.any = EINA_TRUE;
+    evas_object_smart_changed(sd->self);
+}
+
+static Eina_Bool _ewk_view_repaints_resize(Ewk_View_Private_Data* priv, size_t size)
+{
+    void* tmp = realloc(priv->repaints.array, size * sizeof(Eina_Rectangle));
+    if (!tmp) {
+        CRITICAL("could not realloc repaints array to %zu elements.", size);
+        return EINA_FALSE;
+    }
+    priv->repaints.allocated = size;
+    priv->repaints.array = (Eina_Rectangle*)tmp;
+    return EINA_TRUE;
+}
+
+static void _ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+    Eina_Rectangle* r;
+
+    // fprintf(stderr, ">>> repaint requested: %d,%d+%dx%d\n", x, y, w, h);
+    if (priv->repaints.allocated == priv->repaints.count) {
+        size_t size;
+        if (!priv->repaints.allocated)
+            size = EWK_VIEW_REPAINTS_SIZE_INITIAL;
+        else
+            size = priv->repaints.allocated + EWK_VIEW_REPAINTS_SIZE_STEP;
+        if (!_ewk_view_repaints_resize(priv, size))
+            return;
+    }
+
+    r = priv->repaints.array + priv->repaints.count;
+    priv->repaints.count++;
+
+    r->x = x;
+    r->y = y;
+    r->w = w;
+    r->h = h;
+
+    DBG("add repaint %d,%d+%dx%d", x, y, w, h);
+}
+
+static void _ewk_view_repaints_flush(Ewk_View_Private_Data* priv)
+{
+    priv->repaints.count = 0;
+    if (priv->repaints.allocated <= EWK_VIEW_REPAINTS_SIZE_MAX_FREE)
+        return;
+    _ewk_view_repaints_resize(priv, EWK_VIEW_REPAINTS_SIZE_MAX_FREE);
+}
+
+static Eina_Bool _ewk_view_scrolls_resize(Ewk_View_Private_Data* priv, size_t size)
+{
+    void* tmp = realloc(priv->scrolls.array, size * sizeof(Ewk_Scroll_Request));
+    if (!tmp) {
+        CRITICAL("could not realloc scrolls array to %zu elements.", size);
+        return EINA_FALSE;
+    }
+    priv->scrolls.allocated = size;
+    priv->scrolls.array = (Ewk_Scroll_Request*)tmp;
+    return EINA_TRUE;
+}
+
+static void _ewk_view_scroll_add(Ewk_View_Private_Data* priv, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool main_scroll)
+{
+    Ewk_Scroll_Request* r;
+    Ewk_Scroll_Request* r_end;
+    Evas_Coord x2 = x + w, y2 = y + h;
+
+    r = priv->scrolls.array;
+    r_end = r + priv->scrolls.count;
+    for (; r < r_end; r++) {
+        if (r->x == x && r->y == y && r->w == w && r->h == h) {
+            DBG("region already scrolled %d,%d+%dx%d %+03d,%+03d add "
+                "%+03d,%+03d",
+                r->x, r->y, r->w, r->h, r->dx, r->dy, dx, dy);
+            r->dx += dx;
+            r->dy += dy;
+            return;
+        }
+        if ((x <= r->x && x2 >= r->x2) && (y <= r->y && y2 >= r->y2)) {
+            DBG("old viewport (%d,%d+%dx%d %+03d,%+03d) was scrolled itself, "
+                "add %+03d,%+03d",
+                r->x, r->y, r->w, r->h, r->dx, r->dy, dx, dy);
+            r->x += dx;
+            r->y += dy;
+        }
+    }
+
+    if (priv->scrolls.allocated == priv->scrolls.count) {
+        size_t size;
+        if (!priv->scrolls.allocated)
+            size = EWK_VIEW_SCROLLS_SIZE_INITIAL;
+        else
+            size = priv->scrolls.allocated + EWK_VIEW_SCROLLS_SIZE_STEP;
+        if (!_ewk_view_scrolls_resize(priv, size))
+            return;
+    }
+
+    r = priv->scrolls.array + priv->scrolls.count;
+    priv->scrolls.count++;
+
+    r->x = x;
+    r->y = y;
+    r->w = w;
+    r->h = h;
+    r->x2 = x2;
+    r->y2 = y2;
+    r->dx = dx;
+    r->dy = dy;
+    r->main_scroll = main_scroll;
+    DBG("add scroll in region: %d,%d+%dx%d %+03d,%+03d", x, y, w, h, dx, dy);
+
+    Eina_Rectangle* pr;
+    Eina_Rectangle* pr_end;
+    size_t count;
+    pr = priv->repaints.array;
+    count = priv->repaints.count;
+    pr_end = pr + count;
+    for (; pr < pr_end; pr++) {
+        pr->x += dx;
+        pr->y += dy;
+    }
+}
+
+static void _ewk_view_scrolls_flush(Ewk_View_Private_Data* priv)
+{
+    priv->scrolls.count = 0;
+    if (priv->scrolls.allocated <= EWK_VIEW_SCROLLS_SIZE_MAX_FREE)
+        return;
+    _ewk_view_scrolls_resize(priv, EWK_VIEW_SCROLLS_SIZE_MAX_FREE);
+}
+
+// Default Event Handling //////////////////////////////////////////////
+static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* sd)
+{
+    EWK_VIEW_PRIV_GET(sd, priv);
+    WebCore::FocusController* fc = priv->page->focusController();
+    DBG("o=%p, fc=%p", sd->self, fc);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(fc, EINA_FALSE);
+
+    fc->setActive(true);
+    fc->setFocused(true);
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* sd)
+{
+    EWK_VIEW_PRIV_GET(sd, priv);
+    WebCore::FocusController* fc = priv->page->focusController();
+    DBG("o=%p, fc=%p", sd->self, fc);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(fc, EINA_FALSE);
+
+    fc->setActive(false);
+    fc->setFocused(false);
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_view_smart_mouse_wheel(Ewk_View_Smart_Data* sd, const Evas_Event_Mouse_Wheel* ev)
+{
+    return ewk_frame_feed_mouse_wheel(sd->main_frame, ev);
+}
+
+static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* sd, const Evas_Event_Mouse_Down* ev)
+{
+    return ewk_frame_feed_mouse_down(sd->main_frame, ev);
+}
+
+static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* sd, const Evas_Event_Mouse_Up* ev)
+{
+    return ewk_frame_feed_mouse_up(sd->main_frame, ev);
+}
+
+static Eina_Bool _ewk_view_smart_mouse_move(Ewk_View_Smart_Data* sd, const Evas_Event_Mouse_Move* ev)
+{
+    return ewk_frame_feed_mouse_move(sd->main_frame, ev);
+}
+
+static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* sd, const Evas_Event_Key_Down* ev)
+{
+    Evas_Object* frame = ewk_view_frame_focused_get(sd->self);
+
+    if (!frame)
+        frame = sd->main_frame;
+
+    return ewk_frame_feed_key_down(frame, ev);
+}
+
+static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* sd, const Evas_Event_Key_Up* ev)
+{
+    Evas_Object* frame = ewk_view_frame_focused_get(sd->self);
+
+    if (!frame)
+        frame = sd->main_frame;
+
+    return ewk_frame_feed_key_up(frame, ev);
+}
+
+static void _ewk_view_smart_add_console_message(Ewk_View_Smart_Data* sd, const char* message, unsigned int lineNumber, const char* sourceID)
+{
+    INF("console message: %s @%d: %s\n", sourceID, lineNumber, message);
+}
+
+static void _ewk_view_smart_run_javascript_alert(Ewk_View_Smart_Data* sd, Evas_Object* frame, const char* message)
+{
+    INF("javascript alert: %s\n", message);
+}
+
+static Eina_Bool _ewk_view_smart_run_javascript_confirm(Ewk_View_Smart_Data* sd, Evas_Object* frame, const char* message)
+{
+    INF("javascript confirm: %s", message);
+    INF("javascript confirm (HARD CODED)? YES");
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_view_smart_should_interrupt_javascript(Ewk_View_Smart_Data* sd)
+{
+    INF("should interrupt javascript?\n"
+            "\t(HARD CODED) NO");
+    return EINA_FALSE;
+}
+
+static Eina_Bool _ewk_view_smart_run_javascript_prompt(Ewk_View_Smart_Data* sd, Evas_Object* frame, const char* message, const char* defaultValue, char** value)
+{
+    *value = strdup("test");
+    Eina_Bool ret = EINA_TRUE;
+    INF("javascript prompt:\n"
+            "\t      message: %s\n"
+            "\tdefault value: %s\n"
+            "\tgiving answer: %s\n"
+            "\t       button: %s", message, defaultValue, *value, ret?"ok":"cancel");
+
+    return ret;
+}
+
+// Event Handling //////////////////////////////////////////////////////
+static void _ewk_view_on_focus_in(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->focus_in);
+    sd->api->focus_in(sd);
+}
+
+static void _ewk_view_on_focus_out(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->focus_out);
+    sd->api->focus_out(sd);
+}
+
+static void _ewk_view_on_mouse_wheel(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Mouse_Wheel* ev = (Evas_Event_Mouse_Wheel*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->mouse_wheel);
+    sd->api->mouse_wheel(sd, ev);
+}
+
+static void _ewk_view_on_mouse_down(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Mouse_Down* ev = (Evas_Event_Mouse_Down*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->mouse_down);
+    sd->api->mouse_down(sd, ev);
+}
+
+static void _ewk_view_on_mouse_up(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Mouse_Up* ev = (Evas_Event_Mouse_Up*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->mouse_up);
+    sd->api->mouse_up(sd, ev);
+}
+
+static void _ewk_view_on_mouse_move(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Mouse_Move* ev = (Evas_Event_Mouse_Move*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->mouse_move);
+    sd->api->mouse_move(sd, ev);
+}
+
+static void _ewk_view_on_key_down(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Key_Down* ev = (Evas_Event_Key_Down*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->key_down);
+    sd->api->key_down(sd, ev);
+}
+
+static void _ewk_view_on_key_up(void* data, Evas* e, Evas_Object* o, void* event_info)
+{
+    Evas_Event_Key_Up* ev = (Evas_Event_Key_Up*)event_info;
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->key_up);
+    sd->api->key_up(sd, ev);
+}
+
+static WTF::PassRefPtr<WebCore::Frame> _ewk_view_core_frame_new(Ewk_View_Smart_Data* sd, Ewk_View_Private_Data* priv, WebCore::HTMLFrameOwnerElement* owner)
+{
+    WebCore::FrameLoaderClientEfl* flc = new WebCore::FrameLoaderClientEfl(sd->self);
+    if (!flc) {
+        CRITICAL("Could not create frame loader client.");
+        return 0;
+    }
+    flc->setCustomUserAgent(WebCore::String::fromUTF8(priv->settings.user_agent));
+
+    return WebCore::Frame::create(priv->page, owner, flc);
+}
+
+static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_0;
+
+static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
+{
+    Ewk_View_Private_Data* priv =
+        (Ewk_View_Private_Data*)calloc(1, sizeof(Ewk_View_Private_Data));
+    WebCore::AtomicString s;
+    WebCore::KURL url;
+
+    if (!priv) {
+        CRITICAL("could not allocate Ewk_View_Private_Data");
+        return 0;
+    }
+    priv->page = new WebCore::Page(
+        static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(sd->self)),
+        static_cast<WebCore::ContextMenuClient*>(new WebCore::ContextMenuClientEfl(sd->self)),
+        static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(sd->self)),
+        static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl),
+        static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl),
+        0,
+        0);
+    if (!priv->page) {
+        CRITICAL("Could not create WebKit Page");
+        goto error_page;
+    }
+
+    priv->page_settings = priv->page->settings();
+    if (!priv->page_settings) {
+        CRITICAL("Could not get page settings.");
+        goto error_settings;
+    }
+
+    priv->page_settings->setLoadsImagesAutomatically(true);
+    priv->page_settings->setDefaultFixedFontSize(12);
+    priv->page_settings->setDefaultFontSize(16);
+    priv->page_settings->setSerifFontFamily("serif");
+    priv->page_settings->setFixedFontFamily("monotype");
+    priv->page_settings->setSansSerifFontFamily("sans");
+    priv->page_settings->setStandardFontFamily("sans");
+    priv->page_settings->setJavaScriptEnabled(true);
+    priv->page_settings->setPluginsEnabled(true);
+
+    url = priv->page_settings->userStyleSheetLocation();
+    priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data());
+
+    priv->settings.encoding_default = eina_stringshare_add
+        (priv->page_settings->defaultTextEncodingName().utf8().data());
+    priv->settings.encoding_custom = 0;
+
+    priv->settings.font_minimum_size = priv->page_settings->minimumFontSize();
+    priv->settings.font_minimum_logical_size = priv->page_settings->minimumLogicalFontSize();
+    priv->settings.font_default_size = priv->page_settings->defaultFontSize();
+    priv->settings.font_monospace_size = priv->page_settings->defaultFixedFontSize();
+
+    s = priv->page_settings->standardFontFamily();
+    priv->settings.font_standard = eina_stringshare_add(s.string().utf8().data());
+    s = priv->page_settings->cursiveFontFamily();
+    priv->settings.font_cursive = eina_stringshare_add(s.string().utf8().data());
+    s = priv->page_settings->fixedFontFamily();
+    priv->settings.font_monospace = eina_stringshare_add(s.string().utf8().data());
+    s = priv->page_settings->fantasyFontFamily();
+    priv->settings.font_fantasy = eina_stringshare_add(s.string().utf8().data());
+    s = priv->page_settings->serifFontFamily();
+    priv->settings.font_serif = eina_stringshare_add(s.string().utf8().data());
+    s = priv->page_settings->sansSerifFontFamily();
+    priv->settings.font_sans_serif = eina_stringshare_add(s.string().utf8().data());
+
+    priv->settings.auto_load_images = priv->page_settings->loadsImagesAutomatically();
+    priv->settings.auto_shrink_images = priv->page_settings->shrinksStandaloneImagesToFit();
+    priv->settings.enable_scripts = priv->page_settings->isJavaScriptEnabled();
+    priv->settings.enable_plugins = priv->page_settings->arePluginsEnabled();
+    priv->settings.scripts_window_open = priv->page_settings->allowScriptsToCloseWindows();
+    priv->settings.resizable_textareas = priv->page_settings->textAreasAreResizable();
+    priv->settings.private_browsing = priv->page_settings->privateBrowsingEnabled();
+    priv->settings.caret_browsing = priv->page_settings->caretBrowsingEnabled();
+
+    priv->main_frame = _ewk_view_core_frame_new(sd, priv, 0).get();
+    if (!priv->main_frame) {
+        CRITICAL("Could not create main frame.");
+        goto error_main_frame;
+    }
+
+    priv->history = ewk_history_new(priv->page->backForwardList());
+    if (!priv->history) {
+        CRITICAL("Could not create history instance for view.");
+        goto error_history;
+    }
+
+    return priv;
+
+error_history:
+    // delete priv->main_frame; /* do not delete priv->main_frame */
+error_main_frame:
+error_settings:
+    delete priv->page;
+error_page:
+    free(priv);
+    return 0;
+}
+
+static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
+{
+    if (!priv)
+        return;
+
+    /* do not delete priv->main_frame */
+
+    free(priv->repaints.array);
+    free(priv->scrolls.array);
+
+    eina_stringshare_del(priv->settings.user_agent);
+    eina_stringshare_del(priv->settings.user_stylesheet);
+    eina_stringshare_del(priv->settings.encoding_default);
+    eina_stringshare_del(priv->settings.encoding_custom);
+    eina_stringshare_del(priv->settings.font_standard);
+    eina_stringshare_del(priv->settings.font_cursive);
+    eina_stringshare_del(priv->settings.font_monospace);
+    eina_stringshare_del(priv->settings.font_fantasy);
+    eina_stringshare_del(priv->settings.font_serif);
+    eina_stringshare_del(priv->settings.font_sans_serif);
+
+    if (priv->animated_zoom.animator)
+        ecore_animator_del(priv->animated_zoom.animator);
+
+    ewk_history_free(priv->history);
+
+    delete priv->page;
+    free(priv);
+}
+
+static void _ewk_view_smart_add(Evas_Object* o)
+{
+    const Evas_Smart* smart = evas_object_smart_smart_get(o);
+    const Evas_Smart_Class* sc = evas_smart_class_get(smart);
+    const Ewk_View_Smart_Class* api = (const Ewk_View_Smart_Class*)sc;
+    EINA_SAFETY_ON_NULL_RETURN(api->backing_store_add);
+    EWK_VIEW_SD_GET(o, sd);
+
+    if (!sd) {
+        sd = (Ewk_View_Smart_Data*)calloc(1, sizeof(Ewk_View_Smart_Data));
+        if (!sd)
+            CRITICAL("could not allocate Ewk_View_Smart_Data");
+        else
+            evas_object_smart_data_set(o, sd);
+    }
+
+    sd->bg_color.r = 255;
+    sd->bg_color.g = 255;
+    sd->bg_color.b = 255;
+    sd->bg_color.a = 255;
+
+    sd->self = o;
+    sd->_priv = _ewk_view_priv_new(sd);
+    sd->api = api;
+
+    _parent_sc.add(o);
+
+    if (!sd->_priv)
+        return;
+
+    EWK_VIEW_PRIV_GET(sd, priv);
+
+    sd->backing_store = api->backing_store_add(sd);
+    if (!sd->backing_store) {
+        ERR("Could not create backing store object.");
+        return;
+    }
+
+    evas_object_smart_member_add(sd->backing_store, o);
+    evas_object_show(sd->backing_store);
+
+    sd->main_frame = ewk_frame_add(sd->base.evas);
+    if (!sd->main_frame) {
+        ERR("Could not create main frame object.");
+        return;
+    }
+
+    if (!ewk_frame_init(sd->main_frame, o, priv->main_frame)) {
+        ERR("Could not initialize main frme object.");
+        evas_object_del(sd->main_frame);
+        sd->main_frame = 0;
+
+        delete priv->main_frame;
+        priv->main_frame = 0;
+        return;
+    }
+
+    evas_object_name_set(sd->main_frame, "EWK_Frame:main");
+    evas_object_smart_member_add(sd->main_frame, o);
+    evas_object_show(sd->main_frame);
+
+#define CONNECT(s, c) evas_object_event_callback_add(o, s, c, sd)
+    CONNECT(EVAS_CALLBACK_FOCUS_IN, _ewk_view_on_focus_in);
+    CONNECT(EVAS_CALLBACK_FOCUS_OUT, _ewk_view_on_focus_out);
+    CONNECT(EVAS_CALLBACK_MOUSE_WHEEL, _ewk_view_on_mouse_wheel);
+    CONNECT(EVAS_CALLBACK_MOUSE_DOWN, _ewk_view_on_mouse_down);
+    CONNECT(EVAS_CALLBACK_MOUSE_UP, _ewk_view_on_mouse_up);
+    CONNECT(EVAS_CALLBACK_MOUSE_MOVE, _ewk_view_on_mouse_move);
+    CONNECT(EVAS_CALLBACK_KEY_DOWN, _ewk_view_on_key_down);
+    CONNECT(EVAS_CALLBACK_KEY_UP, _ewk_view_on_key_up);
+#undef CONNECT
+}
+
+static void _ewk_view_smart_del(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET(o, sd);
+    Ewk_View_Private_Data* priv = sd ? sd->_priv : 0;
+
+    _parent_sc.del(o);
+    _ewk_view_priv_del(priv);
+}
+
+static void _ewk_view_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h)
+{
+    EWK_VIEW_SD_GET(o, sd);
+
+    // these should be queued and processed in calculate as well!
+    evas_object_resize(sd->backing_store, w, h);
+
+    sd->changed.size = EINA_TRUE;
+    _ewk_view_smart_changed(sd);
+}
+
+static void _ewk_view_smart_move(Evas_Object* o, Evas_Coord x, Evas_Coord y)
+{
+    EWK_VIEW_SD_GET(o, sd);
+    sd->changed.position = EINA_TRUE;
+    _ewk_view_smart_changed(sd);
+}
+
+static void _ewk_view_smart_calculate(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET(o, sd);
+    EWK_VIEW_PRIV_GET(sd, priv);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->contents_resize);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->scrolls_process);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->repaints_process);
+    Evas_Coord x, y, w, h;
+
+    sd->changed.any = EINA_FALSE;
+
+    if (!sd->main_frame || !priv->main_frame)
+        return;
+
+    evas_object_geometry_get(o, &x, &y, &w, &h);
+
+    DBG("o=%p geo=[%d, %d + %dx%d], changed: size=%hhu, "
+        "scrolls=%zu, repaints=%zu",
+        o, x, y, w, h, sd->changed.size,
+        priv->scrolls.count, priv->repaints.count);
+
+    if (sd->changed.size && ((w != sd->view.w) || (h != sd->view.h))) {
+        WebCore::FrameView* view = priv->main_frame->view();
+        if (view) {
+            view->resize(w, h);
+            view->forceLayout();
+            view->adjustViewSize();
+            IntSize size = view->contentsSize();
+            if (!sd->api->contents_resize(sd, size.width(), size.height()))
+                ERR("failed to resize contents to %dx%d",
+                    size.width(), size.height());
+        }
+        evas_object_resize(sd->main_frame, w, h);
+        sd->changed.frame_rect = EINA_TRUE;
+        sd->view.w = w;
+        sd->view.h = h;
+    }
+    sd->changed.size = EINA_FALSE;
+
+    if (sd->changed.position && ((x != sd->view.x) || (y != sd->view.y))) {
+        evas_object_move(sd->main_frame, x, y);
+        evas_object_move(sd->backing_store, x, y);
+        sd->changed.frame_rect = EINA_TRUE;
+        sd->view.x = x;
+        sd->view.y = y;
+    }
+    sd->changed.position = EINA_FALSE;
+
+    ewk_view_layout_if_needed_recursive(sd->_priv);
+
+    if (!sd->api->scrolls_process(sd))
+        ERR("failed to process scrolls.");
+    _ewk_view_scrolls_flush(priv);
+
+    if (!sd->api->repaints_process(sd))
+        ERR("failed to process repaints.");
+    _ewk_view_repaints_flush(priv);
+
+    if (sd->changed.frame_rect) {
+        WebCore::FrameView* view = priv->main_frame->view();
+        view->frameRectsChanged(); /* force tree to get position from root */
+        sd->changed.frame_rect = EINA_FALSE;
+    }
+}
+
+static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data* sd, int w, int h)
+{
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_view_smart_zoom_set(Ewk_View_Smart_Data* sd, float zoom, Evas_Coord cx, Evas_Coord cy)
+{
+    double px, py;
+    Evas_Coord x, y, w, h;
+    Eina_Bool ret;
+
+    ewk_frame_scroll_size_get(sd->main_frame, &w, &h);
+    ewk_frame_scroll_pos_get(sd->main_frame, &x, &y);
+
+    if (w + sd->view.w > 0)
+        px = (double)(x + cx) / (w + sd->view.w);
+    else
+        px = 0.0;
+
+    if (h + sd->view.h > 0)
+        py = (double)(y + cy) / (h + sd->view.h);
+    else
+        py = 0.0;
+
+    ret = ewk_frame_zoom_set(sd->main_frame, zoom);
+
+    ewk_frame_scroll_size_get(sd->main_frame, &w, &h);
+    x = (w + sd->view.w) * px - cx;
+    y = (h + sd->view.h) * py - cy;
+    ewk_frame_scroll_set(sd->main_frame, x, y);
+    return ret;
+}
+
+static void _ewk_view_smart_flush(Ewk_View_Smart_Data* sd)
+{
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    _ewk_view_repaints_flush(priv);
+    _ewk_view_scrolls_flush(priv);
+}
+
+static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)
+{
+    WRN("not supported by engine. sd=%p area=%d,%d+%dx%d, zoom=%f",
+        sd, x, y, w, h, zoom);
+    return EINA_FALSE;
+}
+
+static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* sd)
+{
+    WRN("not supported by engine. sd=%p", sd);
+}
+
+static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* sd)
+{
+    sd->animated_zoom.zoom.start = 0.0;
+    sd->animated_zoom.zoom.end = 0.0;
+    sd->animated_zoom.zoom.current = 0.0;
+}
+
+static void _ewk_view_zoom_animated_finish(Ewk_View_Smart_Data* sd)
+{
+    EWK_VIEW_PRIV_GET(sd, priv);
+    ecore_animator_del(priv->animated_zoom.animator);
+    priv->animated_zoom.animator = 0;
+    _ewk_view_zoom_animated_mark_stop(sd);
+    evas_object_smart_callback_call(sd->self, "zoom,animated,end", 0);
+}
+
+static float _ewk_view_zoom_animated_current(Ewk_View_Private_Data* priv)
+{
+    double now = ecore_loop_time_get();
+    double delta = now - priv->animated_zoom.time.start;
+
+    if (delta > priv->animated_zoom.time.duration)
+        delta = priv->animated_zoom.time.duration;
+    if (delta < 0.0) // time went back, clock adjusted?
+        delta = 0.0;
+
+    delta /= priv->animated_zoom.time.duration;
+
+    return ((priv->animated_zoom.zoom.range * delta)
+            + priv->animated_zoom.zoom.start);
+}
+
+static int _ewk_view_zoom_animator_cb(void* data)
+{
+    Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data;
+    Evas_Coord cx, cy;
+    EWK_VIEW_PRIV_GET(sd, priv);
+    double now = ecore_loop_time_get();
+
+    cx = priv->animated_zoom.center.x;
+    cy = priv->animated_zoom.center.y;
+
+    // TODO: progressively center (cx, cy) -> (view.x + view.h/2, view.y + view.h/2)
+    if (cx >= sd->view.w)
+        cx = sd->view.w - 1;
+    if (cy >= sd->view.h)
+        cy = sd->view.h - 1;
+
+    if ((now >= priv->animated_zoom.time.end)
+        || (now < priv->animated_zoom.time.start)) {
+        _ewk_view_zoom_animated_finish(sd);
+        ewk_view_zoom_set(sd->self, priv->animated_zoom.zoom.end, cx, cy);
+        return 0;
+    }
+
+    sd->animated_zoom.zoom.current = _ewk_view_zoom_animated_current(priv);
+    sd->api->zoom_weak_set(sd, sd->animated_zoom.zoom.current, cx, cy);
+    return 1;
+}
+
+static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* sd)
+{
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    if (priv->animated_zoom.animator)
+        return;
+    priv->animated_zoom.animator = ecore_animator_add
+        (_ewk_view_zoom_animator_cb, sd);
+}
+
+/**
+ * Sets the smart class api without any backing store, enabling view
+ * to be inherited.
+ *
+ * @param api class definition to be set, all members with the
+ *        exception of Evas_Smart_Class->data may be overridden. Must
+ *        @b not be @c 0.
+ *
+ * @note Evas_Smart_Class->data is used to implement type checking and
+ *       is not supposed to be changed/overridden. If you need extra
+ *       data for your smart class to work, just extend
+ *       Ewk_View_Smart_Class instead.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
+ *         version mismatch).
+ *
+ * @see ewk_view_single_smart_set()
+ * @see ewk_view_tiled_smart_set()
+ */
+Eina_Bool ewk_view_base_smart_set(Ewk_View_Smart_Class* api)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(api, EINA_FALSE);
+
+    if (api->version != EWK_VIEW_SMART_CLASS_VERSION) {
+        EINA_LOG_CRIT
+            ("Ewk_View_Smart_Class %p is version %lu while %lu was expected.",
+             api, api->version, EWK_VIEW_SMART_CLASS_VERSION);
+        return EINA_FALSE;
+    }
+
+    if (EINA_UNLIKELY(!_parent_sc.add))
+        evas_object_smart_clipped_smart_set(&_parent_sc);
+
+    evas_object_smart_clipped_smart_set(&api->sc);
+    api->sc.add = _ewk_view_smart_add;
+    api->sc.del = _ewk_view_smart_del;
+    api->sc.resize = _ewk_view_smart_resize;
+    api->sc.move = _ewk_view_smart_move;
+    api->sc.calculate = _ewk_view_smart_calculate;
+    api->sc.data = EWK_VIEW_TYPE_STR; /* used by type checking */
+
+    api->contents_resize = _ewk_view_smart_contents_resize;
+    api->zoom_set = _ewk_view_smart_zoom_set;
+    api->flush = _ewk_view_smart_flush;
+    api->pre_render_region = _ewk_view_smart_pre_render_region;
+    api->pre_render_cancel = _ewk_view_smart_pre_render_cancel;
+
+    api->focus_in = _ewk_view_smart_focus_in;
+    api->focus_out = _ewk_view_smart_focus_out;
+    api->mouse_wheel = _ewk_view_smart_mouse_wheel;
+    api->mouse_down = _ewk_view_smart_mouse_down;
+    api->mouse_up = _ewk_view_smart_mouse_up;
+    api->mouse_move = _ewk_view_smart_mouse_move;
+    api->key_down = _ewk_view_smart_key_down;
+    api->key_up = _ewk_view_smart_key_up;
+
+    api->add_console_message = _ewk_view_smart_add_console_message;
+    api->run_javascript_alert = _ewk_view_smart_run_javascript_alert;
+    api->run_javascript_confirm = _ewk_view_smart_run_javascript_confirm;
+    api->run_javascript_prompt = _ewk_view_smart_run_javascript_prompt;
+    api->should_interrupt_javascript = _ewk_view_smart_should_interrupt_javascript;
+
+    return EINA_TRUE;
+}
+
+/**
+ * Set a fixed layout size to be used, dissociating it from viewport size.
+ *
+ * Setting a width different than zero enables fixed layout on that
+ * size. It's automatically scaled based on zoom, but will not change
+ * if viewport changes.
+ *
+ * Setting both @a w and @a h to zero will disable fixed layout.
+ *
+ * @param o view object to change fixed layout.
+ * @param w fixed width to use. This size will be automatically scaled
+ *        based on zoom level.
+ * @param h fixed height to use. This size will be automatically scaled
+ *        based on zoom level.
+ */
+void ewk_view_fixed_layout_size_set(Evas_Object* o, Evas_Coord w, Evas_Coord h)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    WebCore::FrameView* view = sd->_priv->main_frame->view();
+    if (w <= 0 && h <= 0) {
+        if (!priv->fixed_layout.use)
+            return;
+        priv->fixed_layout.w = 0;
+        priv->fixed_layout.h = 0;
+        priv->fixed_layout.use = EINA_FALSE;
+    } else {
+        if (priv->fixed_layout.use
+            && priv->fixed_layout.w == w && priv->fixed_layout.h == h)
+            return;
+        priv->fixed_layout.w = w;
+        priv->fixed_layout.h = h;
+        priv->fixed_layout.use = EINA_TRUE;
+
+        if (view)
+            view->setFixedLayoutSize(WebCore::IntSize(w, h));
+    }
+
+    if (!view)
+        return;
+    view->setUseFixedLayout(priv->fixed_layout.use);
+    view->forceLayout();
+}
+
+/**
+ * Get fixed layout size in use.
+ *
+ * @param o view object to query fixed layout size.
+ * @param w where to return width. Returns 0 on error or if no fixed
+ *        layout in use.
+ * @param h where to return height. Returns 0 on error or if no fixed
+ *        layout in use.
+ */
+void ewk_view_fixed_layout_size_get(Evas_Object* o, Evas_Coord* w, Evas_Coord* h)
+{
+    if (w)
+        *w = 0;
+    if (h)
+        *h = 0;
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    if (priv->fixed_layout.use) {
+        if (w)
+            *w = priv->fixed_layout.w;
+        if (h)
+            *h = priv->fixed_layout.h;
+    }
+}
+
+/**
+ * Set the theme path to be used by this view.
+ *
+ * This also sets the theme on the main frame. As frames inherit theme
+ * from their parent, this will have all frames with unset theme to
+ * use this one.
+ *
+ * @param o view object to change theme.
+ * @param path theme path, may be @c 0 to reset to default.
+ */
+void ewk_view_theme_set(Evas_Object* o, const char* path)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    ewk_frame_theme_set(sd->main_frame, path);
+}
+
+/**
+ * Gets the theme set on this frame.
+ *
+ * This returns the value set by ewk_view_theme_set().
+ *
+ * @param o view object to get theme path.
+ *
+ * @return theme path, may be @c 0 if not set.
+ */
+const char* ewk_view_theme_get(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    return ewk_frame_theme_get(sd->main_frame);
+}
+
+/**
+ * Get the object that represents the main frame.
+ *
+ * @param o view object to get main frame.
+ *
+ * @return ewk_frame object or @c 0 if none yet.
+ */
+Evas_Object* ewk_view_frame_main_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    return sd->main_frame;
+}
+
+/**
+ * Get the currently focused frame object.
+ *
+ * @param o view object to get focused frame.
+ *
+ * @return ewk_frame object or @c 0 if none yet.
+ */
+Evas_Object* ewk_view_frame_focused_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+
+    WebCore::Frame* core = priv->page->focusController()->focusedFrame();
+    if (!core)
+        return 0;
+
+    WebCore::FrameLoaderClientEfl* client = static_cast<WebCore::FrameLoaderClientEfl*>(core->loader()->client());
+    if (!client)
+        return 0;
+    return client->webFrame();
+}
+
+/**
+ * Ask main frame to load the given URI.
+ *
+ * @param o view object to load uri.
+ * @param uri uniform resource identifier to load.
+ *
+ * @return @c EINA_TRUE on successful request, @c EINA_FALSE on failure.
+ *         Note that it means the request was done, not that it was
+ *         satisfied.
+ */
+Eina_Bool ewk_view_uri_set(Evas_Object* o, const char* uri)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_uri_set(sd->main_frame, uri);
+}
+
+/**
+ * Get the current uri loaded by main frame.
+ *
+ * @param o view object to get current uri.
+ *
+ * @return current uri reference or @c 0. It's internal, don't change.
+ */
+const char* ewk_view_uri_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    return ewk_frame_uri_get(sd->main_frame);
+}
+
+/**
+ * Get the current title of main frame.
+ *
+ * @param o view object to get current title.
+ *
+ * @return current title reference or @c 0. It's internal, don't change.
+ */
+const char* ewk_view_title_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    return ewk_frame_title_get(sd->main_frame);
+}
+
+/**
+ * Gets if main frame is editable.
+ *
+ * @param o view object to get editable state.
+ *
+ * @return @c EINA_TRUE if editable, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_editable_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_editable_get(sd->main_frame);
+}
+
+/**
+ * Set background color and transparency
+ *
+ * Just as in Evas, colors are pre-multiplied, so 50% red is
+ * (128, 0, 0, 128) and not (255, 0, 0, 128)!
+ *
+ * @warning Watch out performance issues with transparency! Object
+ *          will be handled as transparent image by evas even if the
+ *          webpage specifies a background color. That mean you'll pay
+ *          a price even if it's not really transparent, thus
+ *          scrolling/panning and zooming will be likely slower than
+ *          if transparency is off.
+ *
+ * @param o view object to change.
+ * @param r red component.
+ * @param g green component.
+ * @param b blue component.
+ * @param a transparency.
+ */
+void ewk_view_bg_color_set(Evas_Object* o, int r, int g, int b, int a)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->bg_color_set);
+
+    if (a < 0) {
+        WRN("Alpha less than zero (%d).", a);
+        a = 0;
+    } else if (a > 255) {
+        WRN("Alpha is larger than 255 (%d).", a);
+        a = 255;
+    }
+
+#define CHECK_PREMUL_COLOR(c, a)                                        \
+    if (c < 0) {                                                        \
+        WRN("Color component "#c" is less than zero (%d).", c);         \
+        c = 0;                                                          \
+    } else if (c > a) {                                                 \
+        WRN("Color component "#c" is greater than alpha (%d, alpha=%d).", \
+            c, a);                                                      \
+        c = a;                                                          \
+    }
+    CHECK_PREMUL_COLOR(r, a);
+    CHECK_PREMUL_COLOR(g, a);
+    CHECK_PREMUL_COLOR(b, a);
+#undef CHECK_PREMUL_COLOR
+
+    sd->bg_color.r = r;
+    sd->bg_color.g = g;
+    sd->bg_color.b = b;
+    sd->bg_color.a = a;
+
+    sd->api->bg_color_set(sd, r, g, b, a);
+
+    WebCore::FrameView* view = sd->_priv->main_frame->view();
+    if (view) {
+        WebCore::Color color;
+
+        if (!a)
+            color = WebCore::Color(0, 0, 0, 0);
+        else if (a == 255)
+            color = WebCore::Color(r, g, b, a);
+        else
+            color = WebCore::Color(r * 255 / a, g * 255 / a, b * 255 / a, a);
+
+        view->updateBackgroundRecursively(color, !a);
+    }
+}
+
+/**
+ * Query if view object background color.
+ *
+ * Just as in Evas, colors are pre-multiplied, so 50% red is
+ * (128, 0, 0, 128) and not (255, 0, 0, 128)!
+ *
+ * @param o view object to query.
+ * @param r where to return red color component.
+ * @param g where to return green color component.
+ * @param b where to return blue color component.
+ * @param a where to return alpha value.
+ */
+void ewk_view_bg_color_get(const Evas_Object* o, int* r, int* g, int* b, int* a)
+{
+    if (r)
+        *r = 0;
+    if (g)
+        *g = 0;
+    if (b)
+        *b = 0;
+    if (a)
+        *a = 0;
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    if (r)
+        *r = sd->bg_color.r;
+    if (g)
+        *g = sd->bg_color.g;
+    if (b)
+        *b = sd->bg_color.b;
+    if (a)
+        *a = sd->bg_color.a;
+}
+
+/**
+ * Search the given text string in document.
+ *
+ * @param o view object where to search text.
+ * @param string reference string to search.
+ * @param case_sensitive if search should be case sensitive or not.
+ * @param forward if search is from cursor and on or backwards.
+ * @param wrap if search should wrap at end.
+ *
+ * @return @c EINA_TRUE if found, @c EINA_FALSE if not or failure.
+ */
+Eina_Bool ewk_view_text_search(const Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE);
+    WebCore::TextCaseSensitivity sensitive;
+    WebCore::FindDirection direction;
+
+    if (case_sensitive)
+        sensitive = WebCore::TextCaseSensitive;
+    else
+        sensitive = WebCore::TextCaseInsensitive;
+
+    if (forward)
+        direction = WebCore::FindDirectionForward;
+    else
+        direction = WebCore::FindDirectionBackward;
+
+    return priv->page->findString(WebCore::String::fromUTF8(string), sensitive, direction, wrap);
+}
+
+/**
+ * Mark matches the given text string in document.
+ *
+ * @param o view object where to search text.
+ * @param string reference string to match.
+ * @param case_sensitive if match should be case sensitive or not.
+ * @param highlight if matches should be highlighted.
+ * @param limit maximum amount of matches, or zero to unlimited.
+ *
+ * @return number of matches.
+ */
+unsigned int ewk_view_text_matches_mark(Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0);
+    WebCore::TextCaseSensitivity sensitive;
+
+    if (case_sensitive)
+        sensitive = WebCore::TextCaseSensitive;
+    else
+        sensitive = WebCore::TextCaseInsensitive;
+
+    return priv->page->markAllMatchesForText(WebCore::String::fromUTF8(string), sensitive, highlight, limit);
+}
+
+/**
+ * Reverses the effect of ewk_view_text_matches_mark()
+ *
+ * @param o view object where to search text.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE for failure.
+ */
+Eina_Bool ewk_view_text_matches_unmark_all(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    priv->page->unmarkAllTextMatches();
+    return EINA_TRUE;
+}
+
+/**
+ * Set if should highlight matches marked with ewk_view_text_matches_mark().
+ *
+ * @param o view object where to set if matches are highlighted or not.
+ * @param highlight if @c EINA_TRUE, matches will be highlighted.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE for failure.
+ */
+Eina_Bool ewk_view_text_matches_highlight_set(Evas_Object* o, Eina_Bool highlight)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_text_matches_highlight_set(sd->main_frame, highlight);
+}
+
+/**
+ * Get if should highlight matches marked with ewk_view_text_matches_mark().
+ *
+ * @param o view object to query if matches are highlighted or not.
+ *
+ * @return @c EINA_TRUE if they are highlighted, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_text_matches_highlight_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_text_matches_highlight_get(sd->main_frame);
+}
+
+/**
+ * Sets if main frame is editable.
+ *
+ * @param o view object to set editable state.
+ * @param editable new state.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_editable_set(Evas_Object* o, Eina_Bool editable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_editable_set(sd->main_frame, editable);
+}
+
+/**
+ * Get the copy of the selection text.
+ *
+ * @param o view object to get selection text.
+ *
+ * @return newly allocated string or @c 0 if nothing is selected or failure.
+ */
+char* ewk_view_selection_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    WebCore::CString s = priv->page->focusController()->focusedOrMainFrame()->selectedText().utf8();
+    if (s.isNull())
+        return 0;
+    return strdup(s.data());
+}
+
+static Eina_Bool _ewk_view_editor_command(Ewk_View_Private_Data* priv, const char* command)
+{
+    return priv->page->focusController()->focusedOrMainFrame()->editor()->command(WebCore::String::fromUTF8(command)).execute();
+}
+
+/**
+ * Unselects whatever was selected.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_none(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "Unselect");
+}
+
+/**
+ * Selects everything.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_all(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "SelectAll");
+}
+
+/**
+ * Selects the current paragrah.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_paragraph(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "SelectParagraph");
+}
+
+/**
+ * Selects the current sentence.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_sentence(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "SelectSentence");
+}
+
+/**
+ * Selects the current line.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_line(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "SelectLine");
+}
+
+/**
+ * Selects the current word.
+ *
+ * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_select_word(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return _ewk_view_editor_command(priv, "SelectWord");
+}
+
+/**
+ * Get current load progress estimate from 0.0 to 1.0.
+ *
+ * @param o view object to get current progress.
+ *
+ * @return progres value from 0.0 to 1.0 or -1.0 on error.
+ */
+double ewk_view_load_progress_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, -1.0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, -1.0);
+    return priv->page->progress()->estimatedProgress();
+}
+
+/**
+ * Ask main frame to stop loading.
+ *
+ * @param o view object to stop loading.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_stop()
+ */
+Eina_Bool ewk_view_stop(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_stop(sd->main_frame);
+}
+
+/**
+ * Ask main frame to reload current document.
+ *
+ * @param o view object to reload.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_reload()
+ */
+Eina_Bool ewk_view_reload(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_reload(sd->main_frame);
+}
+
+/**
+ * Ask main frame to fully reload current document, using no caches.
+ *
+ * @param o view object to reload.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_reload_full()
+ */
+Eina_Bool ewk_view_reload_full(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_reload_full(sd->main_frame);
+}
+
+/**
+ * Ask main frame to navigate back in history.
+ *
+ * @param o view object to navigate back.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_back()
+ */
+Eina_Bool ewk_view_back(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_back(sd->main_frame);
+}
+
+/**
+ * Ask main frame to navigate forward in history.
+ *
+ * @param o view object to navigate forward.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_forward()
+ */
+Eina_Bool ewk_view_forward(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_forward(sd->main_frame);
+}
+
+/**
+ * Navigate back or forward in history.
+ *
+ * @param o view object to navigate.
+ * @param steps if positive navigates that amount forwards, if negative
+ *        does backwards.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_frame_navigate()
+ */
+Eina_Bool ewk_view_navigate(Evas_Object* o, int steps)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_navigate(sd->main_frame, steps);
+}
+
+/**
+ * Check if it is possible to navigate backwards one item in history.
+ *
+ * @param o view object to check if backward navigation is possible.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_view_navigate_possible()
+ */
+Eina_Bool ewk_view_back_possible(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_back_possible(sd->main_frame);
+}
+
+/**
+ * Check if it is possible to navigate forwards one item in history.
+ *
+ * @param o view object to check if forward navigation is possible.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_view_navigate_possible()
+ */
+Eina_Bool ewk_view_forward_possible(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_forward_possible(sd->main_frame);
+}
+
+/**
+ * Check if it is possible to navigate given @a steps in history.
+ *
+ * @param o view object to navigate.
+ * @param steps if positive navigates that amount forwards, if negative
+ *        does backwards.
+ *
+ * @return @c EINA_TRUE if possible, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_navigate_possible(Evas_Object* o, int steps)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_navigate_possible(sd->main_frame, steps);
+}
+
+/**
+ * Check if navigation history (back-forward lists) is enabled.
+ *
+ * @param o view object to check if navigation history is enabled.
+ *
+ * @return @c EINA_TRUE if view keeps history, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_history_enable_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->page->backForwardList()->enabled();
+}
+
+/**
+ * Sets if navigation history (back-forward lists) is enabled.
+ *
+ * @param o view object to set if navigation history is enabled.
+ * @param enable @c EINA_TRUE if we want to enable navigation history;
+ * @c EINA_FALSE otherwise.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_history_enable_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    priv->page->backForwardList()->setEnabled(enable);
+    return EINA_TRUE;
+}
+
+/**
+ * Gets the history (back-forward list) associated with this view.
+ *
+ * @param o view object to get navigation history from.
+ *
+ * @return returns the history instance handle associated with this
+ *         view or @c 0 on errors (including when history is not
+ *         enabled with ewk_view_history_enable_set()). This instance
+ *         is unique for this view and thus multiple calls to this
+ *         function with the same view as parameter returns the same
+ *         handle. This handle is alive while view is alive, thus one
+ *         might want to listen for EVAS_CALLBACK_DEL on given view
+ *         (@a o) to know when to stop using returned handle.
+ *
+ * @see ewk_view_history_enable_set()
+ */
+Ewk_History* ewk_view_history_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    if (!priv->page->backForwardList()->enabled()) {
+        ERR("asked history, but it's disabled! Returning 0!");
+        return 0;
+    }
+    return priv->history;
+}
+
+/**
+ * Get the current zoom level of main frame.
+ *
+ * @param o view object to query zoom level.
+ *
+ * @return current zoom level in use or -1.0 on error.
+ */
+float ewk_view_zoom_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, -1.0);
+    return ewk_frame_zoom_get(sd->main_frame);
+}
+
+/**
+ * Set the current zoom level of main frame.
+ *
+ * @param o view object to set zoom level.
+ * @param zoom new level to use.
+ * @param cx x of center coordinate
+ * @param cy y of center coordinate
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_zoom_set(Evas_Object* o, float zoom, Evas_Coord cx, Evas_Coord cy)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->zoom_set, EINA_FALSE);
+    if (zoom < ZOOM_MIN) {
+        WRN("zoom level is < %f : %f", (double)ZOOM_MIN, (double)zoom);
+        return EINA_FALSE;
+    }
+    if (zoom > ZOOM_MAX) {
+        WRN("zoom level is > %f : %f", (double)ZOOM_MAX, (double)zoom);
+        return EINA_FALSE;
+    }
+
+    if (cx >= sd->view.w)
+        cx = sd->view.w - 1;
+    if (cy >= sd->view.h)
+        cy = sd->view.h - 1;
+    if (cx < 0)
+        cx = 0;
+    if (cy < 0)
+        cy = 0;
+    _ewk_view_zoom_animated_mark_stop(sd);
+    return sd->api->zoom_set(sd, zoom, cx, cy);
+}
+
+Eina_Bool ewk_view_zoom_weak_smooth_scale_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return sd->zoom_weak_smooth_scale;
+}
+
+void ewk_view_zoom_weak_smooth_scale_set(Evas_Object* o, Eina_Bool smooth_scale)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    smooth_scale = !!smooth_scale;
+    if (sd->zoom_weak_smooth_scale == smooth_scale)
+        return;
+    sd->zoom_weak_smooth_scale = smooth_scale;
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->zoom_weak_smooth_scale_set);
+    sd->api->zoom_weak_smooth_scale_set(sd, smooth_scale);
+}
+
+/**
+ * Set the current zoom level of backing store, centered at given point.
+ *
+ * Unlike ewk_view_zoom_set(), this call do not ask WebKit to render
+ * at new size, but scale what is already rendered, being much faster
+ * but worse quality.
+ *
+ * Often one should use ewk_view_zoom_animated_set(), it will call the
+ * same machinery internally.
+ *
+ * @note this will set variables used by ewk_view_zoom_animated_set()
+ *       so sub-classes will not reset internal state on their
+ *       "calculate" phase. To unset those and enable sub-classes to
+ *       reset their internal state, call
+ *       ewk_view_zoom_animated_mark_stop(). Namely, this call will
+ *       set ewk_view_zoom_animated_mark_start() to actual webkit zoom
+ *       level, ewk_view_zoom_animated_mark_end() and
+ *       ewk_view_zoom_animated_mark_current() to given zoom level.
+ *
+ * @param o view object to set weak zoom level.
+ * @param zoom level to scale backing store.
+ * @param cx horizontal center offset, relative to object (w/2 is middle).
+ * @param cy vertical center offset, relative to object (h/2 is middle).
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_zoom_weak_set(Evas_Object* o, float zoom, Evas_Coord cx, Evas_Coord cy)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->zoom_weak_set, EINA_FALSE);
+    if (zoom < ZOOM_MIN) {
+        WRN("zoom level is < %f : %f", (double)ZOOM_MIN, (double)zoom);
+        return EINA_FALSE;
+    }
+    if (zoom > ZOOM_MAX) {
+        WRN("zoom level is > %f : %f", (double)ZOOM_MAX, (double)zoom);
+        return EINA_FALSE;
+    }
+
+    if (cx >= sd->view.w)
+        cx = sd->view.w - 1;
+    if (cy >= sd->view.h)
+        cy = sd->view.h - 1;
+    if (cx < 0)
+        cx = 0;
+    if (cy < 0)
+        cy = 0;
+
+    sd->animated_zoom.zoom.start = ewk_frame_zoom_get(sd->main_frame);
+    sd->animated_zoom.zoom.end = zoom;
+    sd->animated_zoom.zoom.current = zoom;
+    return sd->api->zoom_weak_set(sd, zoom, cx, cy);
+}
+
+/**
+ * Mark internal zoom animation state to given zoom.
+ *
+ * This does not modify any actual zoom in WebKit or backing store,
+ * just set the Ewk_View_Smart_Data->animated_zoom.zoom.start so
+ * sub-classes will know they should not reset their internal state.
+ *
+ * @param o view object to change value.
+ * @param zoom new start value.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_view_zoom_animated_set()
+ * @see ewk_view_zoom_weak_set()
+ * @see ewk_view_zoom_animated_mark_stop()
+ * @see ewk_view_zoom_animated_mark_end()
+ * @see ewk_view_zoom_animated_mark_current()
+ */
+Eina_Bool ewk_view_zoom_animated_mark_start(Evas_Object* o, float zoom)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    sd->animated_zoom.zoom.start = zoom;
+    return EINA_TRUE;
+}
+
+/**
+ * Mark internal zoom animation state to given zoom.
+ *
+ * This does not modify any actual zoom in WebKit or backing store,
+ * just set the Ewk_View_Smart_Data->animated_zoom.zoom.end so
+ * sub-classes will know they should not reset their internal state.
+ *
+ * @param o view object to change value.
+ * @param zoom new end value.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_view_zoom_animated_set()
+ * @see ewk_view_zoom_weak_set()
+ * @see ewk_view_zoom_animated_mark_stop()
+ * @see ewk_view_zoom_animated_mark_start()
+ * @see ewk_view_zoom_animated_mark_current()
+ */
+Eina_Bool ewk_view_zoom_animated_mark_end(Evas_Object* o, float zoom)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    sd->animated_zoom.zoom.end = zoom;
+    return EINA_TRUE;
+}
+
+/**
+ * Mark internal zoom animation state to given zoom.
+ *
+ * This does not modify any actual zoom in WebKit or backing store,
+ * just set the Ewk_View_Smart_Data->animated_zoom.zoom.current so
+ * sub-classes will know they should not reset their internal state.
+ *
+ * @param o view object to change value.
+ * @param zoom new current value.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @see ewk_view_zoom_animated_set()
+ * @see ewk_view_zoom_weak_set()
+ * @see ewk_view_zoom_animated_mark_stop()
+ * @see ewk_view_zoom_animated_mark_start()
+ * @see ewk_view_zoom_animated_mark_end()
+ */
+Eina_Bool ewk_view_zoom_animated_mark_current(Evas_Object* o, float zoom)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    sd->animated_zoom.zoom.current = zoom;
+    return EINA_TRUE;
+}
+
+/**
+ * Unmark internal zoom animation state.
+ *
+ * This zero all start, end and current values.
+ *
+ * @param o view object to mark as animated is stopped.
+ *
+ * @see ewk_view_zoom_animated_mark_start()
+ * @see ewk_view_zoom_animated_mark_end()
+ * @see ewk_view_zoom_animated_mark_current()
+ * @see ewk_view_zoom_weak_set()
+ */
+Eina_Bool ewk_view_zoom_animated_mark_stop(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    _ewk_view_zoom_animated_mark_stop(sd);
+    return EINA_TRUE;
+}
+
+/**
+ * Set the current zoom level while animating.
+ *
+ * If the view was already animating to another zoom, it will start
+ * from current point to the next provided zoom (@a zoom parameter)
+ * and duration (@a duration parameter).
+ *
+ * This is the recommended way to do transitions from one level to
+ * another. However, one may wish to do those from outside, in that
+ * case use ewk_view_zoom_weak_set() and later control intermediate
+ * states with ewk_view_zoom_animated_mark_current(),
+ * ewk_view_zoom_animated_mark_end() and
+ * ewk_view_zoom_animated_mark_stop().
+ *
+ * @param o view object to animate.
+ * @param zoom final zoom level to use.
+ * @param duration time in seconds the animation should take.
+ * @param cx offset inside object that defines zoom center. 0 is left side.
+ * @param cy offset inside object that defines zoom center. 0 is top side.
+ * @return @c EINA_TRUE if animation will be started, @c EINA_FALSE if not
+ *            because zoom is too small/big.
+ */
+Eina_Bool ewk_view_zoom_animated_set(Evas_Object* o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy)
+{
+    double now;
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->zoom_weak_set, EINA_FALSE);
+
+    if (zoom < ZOOM_MIN) {
+        WRN("zoom level is < %f : %f", (double)ZOOM_MIN, (double)zoom);
+        return EINA_FALSE;
+    }
+    if (zoom > ZOOM_MAX) {
+        WRN("zoom level is > %f : %f", (double)ZOOM_MAX, (double)zoom);
+        return EINA_FALSE;
+    }
+
+    if (priv->animated_zoom.animator)
+        priv->animated_zoom.zoom.start = _ewk_view_zoom_animated_current(priv);
+    else {
+        priv->animated_zoom.zoom.start = ewk_frame_zoom_get(sd->main_frame);
+        _ewk_view_zoom_animation_start(sd);
+    }
+
+    if (cx < 0)
+        cx = 0;
+    if (cy < 0)
+        cy = 0;
+
+    now = ecore_loop_time_get();
+    priv->animated_zoom.time.start = now;
+    priv->animated_zoom.time.end = now + duration;
+    priv->animated_zoom.time.duration = duration;
+    priv->animated_zoom.zoom.end = zoom;
+    priv->animated_zoom.zoom.range = (priv->animated_zoom.zoom.end - priv->animated_zoom.zoom.start);
+    priv->animated_zoom.center.x = cx;
+    priv->animated_zoom.center.y = cy;
+    sd->animated_zoom.zoom.current = priv->animated_zoom.zoom.start;
+    sd->animated_zoom.zoom.start = priv->animated_zoom.zoom.start;
+    sd->animated_zoom.zoom.end = priv->animated_zoom.zoom.end;
+
+    return EINA_TRUE;
+}
+
+/**
+ * Query if zoom level just applies to text and not other elements.
+ *
+ * @param o view to query setting.
+ *
+ * @return @c EINA_TRUE if just text are scaled, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_zoom_text_only_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_zoom_text_only_get(sd->main_frame);
+}
+
+/**
+ * Set if zoom level just applies to text and not other elements.
+ *
+ * @param o view to change setting.
+ * @param setting @c EINA_TRUE if zoom should just be applied to text.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_zoom_text_only_set(Evas_Object* o, Eina_Bool setting)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    return ewk_frame_zoom_text_only_set(sd->main_frame, setting);
+}
+
+/**
+ * Hint engine to pre-render region.
+ *
+ * Engines and backing store might be able to pre-render regions in
+ * order to speed up zooming or scrolling to that region. Not all
+ * engines might implement that and they will return @c EINA_FALSE
+ * in that case.
+ *
+ * The given region is a hint. Engines might do bigger or smaller area
+ * that covers that region. Pre-render might not be immediate, it may
+ * be postponed to a thread, operated cooperatively in the main loop
+ * and may be even ignored or cancelled afterwards.
+ *
+ * Multiple requests might be queued by engines. One can clear/forget
+ * about them with ewk_view_pre_render_cancel().
+ *
+ * @param o view to ask pre-render of given region.
+ * @param x absolute coordinate (0=left) to pre-render at zoom.
+ * @param y absolute coordinate (0=top) to pre-render at zoom.
+ * @param w width to pre-render starting from @a x at zoom.
+ * @param h height to pre-render starting from @a y at zoom.
+ * @param zoom desired zoom.
+ *
+ * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
+ *         otherwise (errors, pre-render not supported, etc).
+ *
+ * @see ewk_view_pre_render_cancel()
+ */
+Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->pre_render_region, EINA_FALSE);
+    float cur_zoom = ewk_frame_zoom_get(sd->main_frame);
+    Evas_Coord cw, ch;
+
+    if (cur_zoom < 0.00001)
+        return EINA_FALSE;
+    if (!ewk_frame_contents_size_get(sd->main_frame, &cw, &ch))
+        return EINA_FALSE;
+
+    cw *= zoom / cur_zoom;
+    ch *= zoom / cur_zoom;
+    DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, w, h, zoom, cw, ch);
+
+    if (x + w > cw)
+        w = cw - x;
+
+    if (y + h > ch)
+        h = ch - y;
+
+    if (x < 0) {
+        w += x;
+        x = 0;
+    }
+    if (y < 0) {
+        h += y;
+        y = 0;
+    }
+
+    return sd->api->pre_render_region(sd, x, y, w, h, zoom);
+}
+
+/**
+ * Cancel (clear) previous pre-render requests.
+ *
+ * @param o view to clear pre-render requests.
+ */
+void ewk_view_pre_render_cancel(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->pre_render_cancel);
+    sd->api->pre_render_cancel(sd);
+}
+
+const char* ewk_view_setting_user_agent_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.user_agent;
+}
+
+Eina_Bool ewk_view_setting_user_agent_set(Evas_Object* o, const char* user_agent)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.user_agent, user_agent)) {
+        WebCore::FrameLoaderClientEfl* client = static_cast<WebCore::FrameLoaderClientEfl*>(priv->main_frame->loader()->client());
+        client->setCustomUserAgent(WebCore::String::fromUTF8(user_agent));
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_user_stylesheet_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.user_stylesheet;
+}
+
+Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object* o, const char* uri)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.user_stylesheet, uri)) {
+        WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(uri));
+        priv->page_settings->setUserStyleSheetLocation(kurl);
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_auto_load_images_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.auto_load_images;
+}
+
+Eina_Bool ewk_view_setting_auto_load_images_set(Evas_Object* o, Eina_Bool automatic)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    automatic = !!automatic;
+    if (priv->settings.auto_load_images != automatic) {
+        priv->page_settings->setLoadsImagesAutomatically(automatic);
+        priv->settings.auto_load_images = automatic;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_auto_shrink_images_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.auto_shrink_images;
+}
+
+Eina_Bool ewk_view_setting_auto_shrink_images_set(Evas_Object* o, Eina_Bool automatic)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    automatic = !!automatic;
+    if (priv->settings.auto_shrink_images != automatic) {
+        priv->page_settings->setShrinksStandaloneImagesToFit(automatic);
+        priv->settings.auto_shrink_images = automatic;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_enable_scripts_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.enable_scripts;
+}
+
+Eina_Bool ewk_view_setting_enable_scripts_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    enable = !!enable;
+    if (priv->settings.enable_scripts != enable) {
+        priv->page_settings->setJavaScriptEnabled(enable);
+        priv->settings.enable_scripts = enable;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_enable_plugins_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.enable_plugins;
+}
+
+Eina_Bool ewk_view_setting_enable_plugins_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    enable = !!enable;
+    if (priv->settings.enable_plugins != enable) {
+        priv->page_settings->setPluginsEnabled(enable);
+        priv->settings.enable_plugins = enable;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_scripts_window_open_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.scripts_window_open;
+}
+
+Eina_Bool ewk_view_setting_scripts_window_open_set(Evas_Object* o, Eina_Bool allow)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    allow = !!allow;
+    if (priv->settings.scripts_window_open != allow) {
+        priv->page_settings->setJavaScriptCanOpenWindowsAutomatically(allow);
+        priv->settings.scripts_window_open = allow;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_resizable_textareas_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.resizable_textareas;
+}
+
+Eina_Bool ewk_view_setting_resizable_textareas_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    enable = !!enable;
+    if (priv->settings.resizable_textareas != enable) {
+        priv->page_settings->setTextAreasAreResizable(enable);
+        priv->settings.resizable_textareas = enable;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_private_browsing_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.private_browsing;
+}
+
+Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    enable = !!enable;
+    if (priv->settings.private_browsing != enable) {
+        priv->page_settings->setPrivateBrowsingEnabled(enable);
+        priv->settings.private_browsing = enable;
+    }
+    return EINA_TRUE;
+}
+
+Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    return priv->settings.caret_browsing;
+}
+
+Eina_Bool ewk_view_setting_caret_browsing_set(Evas_Object* o, Eina_Bool enable)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    enable = !!enable;
+    if (priv->settings.caret_browsing != enable) {
+        priv->page_settings->setCaretBrowsingEnabled(enable);
+        priv->settings.caret_browsing = enable;
+    }
+    return EINA_TRUE;
+}
+
+/**
+ * Get current encoding of this View.
+ *
+ * @param o View.
+ *
+ * @return A pointer to an eina_strinshare containing the current custom
+ * encoding for View object @param o, or @c 0 if it's not set.
+ */
+const char* ewk_view_setting_encoding_custom_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    Evas_Object* main_frame = ewk_view_frame_main_get(o);
+    WebCore::Frame* core_frame = ewk_frame_core_get(main_frame);
+
+    WebCore::String overrideEncoding = core_frame->loader()->documentLoader()->overrideEncoding();
+
+    if (overrideEncoding.isEmpty())
+        return 0;
+
+    eina_stringshare_replace(&priv->settings.encoding_custom, overrideEncoding.utf8().data());
+    return priv->settings.encoding_custom;
+}
+
+/**
+ * Set encoding of this View and reload page.
+ *
+ * @param o View.
+ * @param encoding The new encoding or @c 0 to restore the default encoding.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object* o, const char *encoding)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    Evas_Object* main_frame = ewk_view_frame_main_get(o);
+    WebCore::Frame* core_frame = ewk_frame_core_get(main_frame);
+DBG("%s", encoding);
+    eina_stringshare_replace(&priv->settings.encoding_custom, encoding);
+    core_frame->loader()->reloadWithOverrideEncoding(WebCore::String::fromUTF8(encoding));
+
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_encoding_default_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.encoding_default;
+}
+
+Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object* o, const char* encoding)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.encoding_default, encoding))
+        priv->page_settings->setDefaultTextEncodingName(WebCore::String::fromUTF8(encoding));
+    return EINA_TRUE;
+}
+
+int ewk_view_setting_font_minimum_size_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_minimum_size;
+}
+
+Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object* o, int size)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (priv->settings.font_minimum_size != size) {
+        priv->page_settings->setMinimumFontSize(size);
+        priv->settings.font_minimum_size = size;
+    }
+    return EINA_TRUE;
+}
+
+int ewk_view_setting_font_minimum_logical_size_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_minimum_logical_size;
+}
+
+Eina_Bool ewk_view_setting_font_minimum_logical_size_set(Evas_Object* o, int size)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (priv->settings.font_minimum_logical_size != size) {
+        priv->page_settings->setMinimumLogicalFontSize(size);
+        priv->settings.font_minimum_logical_size = size;
+    }
+    return EINA_TRUE;
+}
+
+int ewk_view_setting_font_default_size_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_default_size;
+}
+
+Eina_Bool ewk_view_setting_font_default_size_set(Evas_Object* o, int size)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (priv->settings.font_default_size != size) {
+        priv->page_settings->setDefaultFontSize(size);
+        priv->settings.font_default_size = size;
+    }
+    return EINA_TRUE;
+}
+
+int ewk_view_setting_font_monospace_size_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_monospace_size;
+}
+
+Eina_Bool ewk_view_setting_font_monospace_size_set(Evas_Object* o, int size)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (priv->settings.font_monospace_size != size) {
+        priv->page_settings->setDefaultFixedFontSize(size);
+        priv->settings.font_monospace_size = size;
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_standard_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_standard;
+}
+
+Eina_Bool ewk_view_setting_font_standard_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_standard, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setStandardFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_cursive_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_cursive;
+}
+
+Eina_Bool ewk_view_setting_font_cursive_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_cursive, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setCursiveFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_fantasy_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_fantasy;
+}
+
+Eina_Bool ewk_view_setting_font_fantasy_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_fantasy, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setFantasyFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_monospace_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_monospace;
+}
+
+Eina_Bool ewk_view_setting_font_monospace_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_monospace, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setFixedFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_serif_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_serif;
+}
+
+Eina_Bool ewk_view_setting_font_serif_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_serif, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setSerifFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+const char* ewk_view_setting_font_sans_serif_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->settings.font_sans_serif;
+}
+  
+Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object* o, const char* family)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+    if (eina_stringshare_replace(&priv->settings.font_sans_serif, family)) {
+        WebCore::AtomicString s = WebCore::String::fromUTF8(family);
+        priv->page_settings->setSansSerifFontFamily(s);
+    }
+    return EINA_TRUE;
+}
+
+/**
+ * Similar to evas_object_smart_data_get(), but does type checking.
+ *
+ * @param o view object to query internal data.
+ * @return internal data or @c 0 on errors (ie: incorrect type of @a o).
+ */
+Ewk_View_Smart_Data* ewk_view_smart_data_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    return sd;
+}
+
+/**
+ * Gets the internal array of repaint requests.
+ *
+ * This array should not be modified anyhow. It should be processed
+ * immediately as any further ewk_view call might change it, like
+ * those that add repaints or flush them, so be sure that your code
+ * does not call any of those while you process the repaints,
+ * otherwise copy the array.
+ *
+ * @param priv private handle pointer of the view to get repaints.
+ * @param count where to return the number of elements of returned array.
+ *
+ * @return reference to array of requested repaints.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+const Eina_Rectangle* ewk_view_repaints_get(const Ewk_View_Private_Data* priv, size_t* count)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(count, 0);
+    if (count)
+        *count = 0;
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0);
+    if (count)
+        *count = priv->repaints.count;
+    return priv->repaints.array;
+}
+
+/**
+ * Gets the internal array of scroll requests.
+ *
+ * This array should not be modified anyhow. It should be processed
+ * immediately as any further ewk_view call might change it, like
+ * those that add scrolls or flush them, so be sure that your code
+ * does not call any of those while you process the scrolls,
+ * otherwise copy the array.
+ *
+ * @param priv private handle pointer of the view to get scrolls.
+ * @param count where to return the number of elements of returned array.
+ *
+ * @return reference to array of requested scrolls.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+const Ewk_Scroll_Request* ewk_view_scroll_requests_get(const Ewk_View_Private_Data* priv, size_t* count)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(count, 0);
+    if (count)
+        *count = 0;
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0);
+    if (count)
+        *count = priv->scrolls.count;
+    return priv->scrolls.array;
+}
+
+/**
+ * Add a new repaint request to queue.
+ *
+ * The repaints are assumed to be relative to current viewport.
+ *
+ * @param priv private handle pointer of the view to add repaint request.
+ * @param x horizontal position relative to current view port (scrolled).
+ * @param y vertical position relative to current view port (scrolled).
+ * @param w width of area to be repainted
+ * @param h height of area to be repainted
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+    EINA_SAFETY_ON_NULL_RETURN(priv);
+    _ewk_view_repaint_add(priv, x, y, w, h);
+}
+
+/**
+ * Do layout if required, applied recursively.
+ *
+ * @param priv private handle pointer of the view to layout.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_layout_if_needed_recursive(Ewk_View_Private_Data* priv)
+{
+    EINA_SAFETY_ON_NULL_RETURN(priv);
+
+    WebCore::FrameView* v = priv->main_frame->view();
+    if (!v) {
+        ERR("no main frame view");
+        return;
+    }
+    v->layoutIfNeededRecursive();
+}
+
+void ewk_view_scrolls_process(Ewk_View_Smart_Data* sd)
+{
+    EINA_SAFETY_ON_NULL_RETURN(sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    if (!sd->api->scrolls_process(sd))
+        ERR("failed to process scrolls.");
+    _ewk_view_scrolls_flush(priv);
+}
+
+struct _Ewk_View_Paint_Context {
+    WebCore::GraphicsContext* gc;
+    WebCore::FrameView* view;
+    cairo_t* cr;
+};
+
+/**
+ * Create a new paint context using the view as source and cairo as output.
+ *
+ * @param priv private handle pointer of the view to use as paint source.
+ * @param cr cairo context to use as paint destination. A new
+ *        reference is taken, so it's safe to call cairo_destroy()
+ *        after this function returns.
+ *
+ * @return newly allocated instance or @c 0 on errors.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+Ewk_View_Paint_Context* ewk_view_paint_context_new(Ewk_View_Private_Data* priv, cairo_t* cr)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(cr, 0);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv->main_frame, 0);
+    WebCore::FrameView* view = priv->main_frame->view();
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0);
+    Ewk_View_Paint_Context* ctxt = (Ewk_View_Paint_Context*)malloc(sizeof(*ctxt));
+    EINA_SAFETY_ON_NULL_RETURN_VAL(ctxt, 0);
+
+    ctxt->gc = new WebCore::GraphicsContext(cr);
+    if (!ctxt->gc) {
+        free(ctxt);
+        return 0;
+    }
+    ctxt->view = view;
+    ctxt->cr = cairo_reference(cr);
+    return ctxt;
+}
+
+/**
+ * Destroy previously created paint context.
+ *
+ * @param ctxt paint context to destroy. Must @b not be @c 0.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_free(Ewk_View_Paint_Context* ctxt)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    delete ctxt->gc;
+    cairo_destroy(ctxt->cr);
+    free(ctxt);
+}
+
+/**
+ * Save (push to stack) paint context status.
+ *
+ * @param ctxt paint context to save. Must @b not be @c 0.
+ *
+ * @see ewk_view_paint_context_restore()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_save(Ewk_View_Paint_Context* ctxt)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    cairo_save(ctxt->cr);
+    ctxt->gc->save();
+}
+
+/**
+ * Restore (pop from stack) paint context status.
+ *
+ * @param ctxt paint context to restore. Must @b not be @c 0.
+ *
+ * @see ewk_view_paint_context_save()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_restore(Ewk_View_Paint_Context* ctxt)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    ctxt->gc->restore();
+    cairo_restore(ctxt->cr);
+}
+
+/**
+ * Clip paint context drawings to given area.
+ *
+ * @param ctxt paint context to clip. Must @b not be @c 0.
+ * @param area clip area to use.
+ *
+ * @see ewk_view_paint_context_save()
+ * @see ewk_view_paint_context_restore()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_clip(Ewk_View_Paint_Context* ctxt, const Eina_Rectangle* area)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    EINA_SAFETY_ON_NULL_RETURN(area);
+    ctxt->gc->clip(WebCore::IntRect(area->x, area->y, area->w, area->h));
+}
+
+/**
+ * Paint using context using given area.
+ *
+ * @param ctxt paint context to paint. Must @b not be @c 0.
+ * @param area paint area to use. Coordinates are relative to current viewport,
+ *        thus "scrolled".
+ *
+ * @note one may use cairo functions on the cairo context to
+ *       translate, scale or any modification that may fit his desires.
+ *
+ * @see ewk_view_paint_context_clip()
+ * @see ewk_view_paint_context_paint_contents()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_paint(Ewk_View_Paint_Context* ctxt, const Eina_Rectangle* area)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    EINA_SAFETY_ON_NULL_RETURN(area);
+
+    WebCore::IntRect rect(area->x, area->y, area->w, area->h);
+
+    if (ctxt->view->isTransparent())
+        ctxt->gc->clearRect(rect);
+    ctxt->view->paint(ctxt->gc, rect);
+}
+
+/**
+ * Paint just contents using context using given area.
+ *
+ * Unlike ewk_view_paint_context_paint(), this function paint just
+ * bare contents and ignores any scrolling, scrollbars and extras. It
+ * will walk the rendering tree and paint contents inside the given
+ * area to the cairo context specified in @a ctxt.
+ *
+ * @param ctxt paint context to paint. Must @b not be @c 0.
+ * @param area paint area to use. Coordinates are absolute to page.
+ *
+ * @note one may use cairo functions on the cairo context to
+ *       translate, scale or any modification that may fit his desires.
+ *
+ * @see ewk_view_paint_context_clip()
+ * @see ewk_view_paint_context_paint()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context* ctxt, const Eina_Rectangle* area)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+    EINA_SAFETY_ON_NULL_RETURN(area);
+
+    WebCore::IntRect rect(area->x, area->y, area->w, area->h);
+
+    if (ctxt->view->isTransparent())
+        ctxt->gc->clearRect(rect);
+
+    ctxt->view->paintContents(ctxt->gc, rect);
+}
+
+/**
+ * Scale the contents by the given factors.
+ *
+ * This function applies a scaling transformation using Cairo.
+ *
+ * @param ctxt    paint context to paint. Must @b not be @c 0.
+ * @param scale_x scale factor for the X dimension.
+ * @param scale_y scale factor for the Y dimension.
+ */
+void ewk_view_paint_context_scale(Ewk_View_Paint_Context* ctxt, float scale_x, float scale_y)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+
+    ctxt->gc->scale(WebCore::FloatSize(scale_x, scale_y));
+}
+
+/**
+ * Performs a translation of the origin coordinates.
+ *
+ * This function moves the origin coordinates by @p x and @p y pixels.
+ *
+ * @param ctxt paint context to paint. Must @b not be @c 0.
+ * @param x    amount of pixels to translate in the X dimension.
+ * @param y    amount of pixels to translate in the Y dimension.
+ */
+void ewk_view_paint_context_translate(Ewk_View_Paint_Context* ctxt, float x, float y)
+{
+    EINA_SAFETY_ON_NULL_RETURN(ctxt);
+
+    ctxt->gc->translate(x, y);
+}
+
+/**
+ * Paint using given graphics context the given area.
+ *
+ * This uses viewport relative area and will also handle scrollbars
+ * and other extra elements. See ewk_view_paint_contents() for the
+ * alternative function.
+ *
+ * @param priv private handle pointer of view to use as paint source.
+ * @param cr cairo context to use as paint destination. Its state will
+ *        be saved before operation and restored afterwards.
+ * @param area viewport relative geometry to paint.
+ *
+ * @return @c EINA_TRUE on success and @c EINA_FALSE on failure, like
+ *         incorrect parameters.
+ *
+ * @note this is an easy to use version, but internal structures are
+ *       always created, then graphics context is clipped, then
+ *       painted, restored and destroyed. This might not be optimum,
+ *       so using #Ewk_View_Paint_Context may be a better solutions
+ *       for large number of operations.
+ *
+ * @see ewk_view_paint_contents()
+ * @see ewk_view_paint_context_paint()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+Eina_Bool ewk_view_paint(Ewk_View_Private_Data* priv, cairo_t* cr, const Eina_Rectangle* area)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(cr, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(area, EINA_FALSE);
+    WebCore::FrameView* view = priv->main_frame->view();
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    if (view->needsLayout())
+        view->forceLayout();
+    WebCore::GraphicsContext gc(cr);
+    WebCore::IntRect rect(area->x, area->y, area->w, area->h);
+
+    cairo_save(cr);
+    gc.save();
+    gc.clip(rect);
+    if (view->isTransparent())
+        gc.clearRect(rect);
+    view->paint(&gc,  rect);
+    gc.restore();
+    cairo_restore(cr);
+
+    return EINA_TRUE;
+}
+
+/**
+ * Paint just contents using given graphics context the given area.
+ *
+ * This uses absolute coordinates for area and will just handle
+ * contents, no scrollbars or extras. See ewk_view_paint() for the
+ * alternative solution.
+ *
+ * @param priv private handle pointer of view to use as paint source.
+ * @param cr cairo context to use as paint destination. Its state will
+ *        be saved before operation and restored afterwards.
+ * @param area absolute geometry to paint.
+ *
+ * @return @c EINA_TRUE on success and @c EINA_FALSE on failure, like
+ *         incorrect parameters.
+ *
+ * @note this is an easy to use version, but internal structures are
+ *       always created, then graphics context is clipped, then
+ *       painted, restored and destroyed. This might not be optimum,
+ *       so using #Ewk_View_Paint_Context may be a better solutions
+ *       for large number of operations.
+ *
+ * @see ewk_view_paint()
+ * @see ewk_view_paint_context_paint_contents()
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data* priv, cairo_t* cr, const Eina_Rectangle* area)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(priv, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(cr, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(area, EINA_FALSE);
+    WebCore::FrameView* view = priv->main_frame->view();
+    EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE);
+
+    WebCore::GraphicsContext gc(cr);
+    WebCore::IntRect rect(area->x, area->y, area->w, area->h);
+
+    cairo_save(cr);
+    gc.save();
+    gc.clip(rect);
+    if (view->isTransparent())
+        gc.clearRect(rect);
+    view->paintContents(&gc,  rect);
+    gc.restore();
+    cairo_restore(cr);
+
+    return EINA_TRUE;
+}
+
+
+/* internal methods ****************************************************/
+/**
+ * @internal
+ * Reports the view is ready to be displayed as all elements are aready.
+ *
+ * Emits signal: "ready" with no parameters.
+ */
+void ewk_view_ready(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    evas_object_smart_callback_call(o, "ready", 0);
+}
+
+/**
+ * @internal
+ * The view title was changed by the frame loader.
+ *
+ * Emits signal: "title,changed" with pointer to new title string.
+ */
+void ewk_view_title_set(Evas_Object* o, const char* title)
+{
+    DBG("o=%p, title=%s", o, title ? title : "(null)");
+    evas_object_smart_callback_call(o, "title,changed", (void*)title);
+}
+
+/**
+ * @internal
+ * Reports that main frame's uri changed.
+ *
+ * Emits signal: "uri,changed" with pointer to the new uri string.
+ */
+void ewk_view_uri_changed(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    const char* uri = ewk_frame_uri_get(sd->main_frame);
+    DBG("o=%p, uri=%s", o, uri ? uri : "(null)");
+    evas_object_smart_callback_call(o, "uri,changed", (void*)uri);
+}
+
+/**
+ * @internal
+ * Reports the view started loading something.
+ *
+ * @param o View.
+ *
+ * Emits signal: "load,started" with no parameters.
+ */
+void ewk_view_load_started(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    evas_object_smart_callback_call(o, "load,started", 0);
+}
+
+/**
+ * Reports the frame started loading something.
+ *
+ * @param o View.
+ *
+ * Emits signal: "load,started" on main frame with no parameters.
+ */
+void ewk_view_frame_main_load_started(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    Evas_Object* frame = ewk_view_frame_main_get(o);
+    evas_object_smart_callback_call(frame, "load,started", 0);
+}
+
+/**
+ * @internal
+ * Reports the main frame started provisional load.
+ *
+ * @param o View.
+ *
+ * Emits signal: "load,provisional" on View with no parameters.
+ */
+void ewk_view_load_provisional(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    evas_object_smart_callback_call(o, "load,provisional", 0);
+}
+
+/**
+ * @internal
+ * Reports view can be shown after a new window is created.
+ *
+ * @param o Frame.
+ *
+ * Emits signal: "load,newwindow,show" on view with no parameters.
+ */
+void ewk_view_load_show(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    evas_object_smart_callback_call(o, "load,newwindow,show", 0);
+}
+
+
+/**
+ * @internal
+ * Reports the main frame was cleared.
+ *
+ * @param o View.
+ */
+void ewk_view_frame_main_cleared(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->flush);
+    sd->api->flush(sd);
+}
+
+/**
+ * @internal
+ * Reports the main frame received an icon.
+ *
+ * @param o View.
+ *
+ * Emits signal: "icon,received" with no parameters.
+ */
+void ewk_view_frame_main_icon_received(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    Evas_Object* frame = ewk_view_frame_main_get(o);
+    evas_object_smart_callback_call(frame, "icon,received", 0);
+}
+
+/**
+ * @internal
+ * Reports load finished, optionally with error information.
+ *
+ * Emits signal: "load,finished" with pointer to #Ewk_Frame_Load_Error
+ * if any error, or @c 0 if successful load.
+ *
+ * @note there should not be any error stuff here, but trying to be
+ *       compatible with previous WebKit.
+ */
+void ewk_view_load_finished(Evas_Object* o, const Ewk_Frame_Load_Error* error)
+{
+    DBG("o=%p, error=%p", o, error);
+    evas_object_smart_callback_call(o, "load,finished", (void*)error);
+}
+
+/**
+ * @internal
+ * Reports load failed with error information.
+ *
+ * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error.
+ */
+void ewk_view_load_error(Evas_Object* o, const Ewk_Frame_Load_Error* error)
+{
+    DBG("o=%p, error=%p", o, error);
+    evas_object_smart_callback_call(o, "load,error", (void*)error);
+}
+
+/**
+ * @internal
+ * Reports load progress changed.
+ *
+ * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0.
+ */
+void ewk_view_load_progress_changed(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+
+    // Evas_Coord w, h;
+    double progress = priv->page->progress()->estimatedProgress();
+
+    DBG("o=%p (p=%0.3f)", o, progress);
+
+    evas_object_smart_callback_call(o, "load,progress", &progress);
+}
+
+/**
+ * @internal
+ * Reports view @param o should be restored to default conditions
+ *
+ * @param o View.
+ * @param frame Frame that originated restore.
+ *
+ * Emits signal: "restore" with frame.
+ */
+void ewk_view_restore_state(Evas_Object* o, Evas_Object* frame)
+{
+    evas_object_smart_callback_call(o, "restore", frame);
+}
+
+/**
+ * @internal
+ * Delegates to browser the creation of a new window. If it is not implemented,
+ * current view is returned, so navigation might continue in same window.
+ *
+ * @param o Current view.
+ *
+ * @return New view, in case smart class implements the creation of new windows;
+ * else, current view @param o.
+ */
+Evas_Object* ewk_view_window_create(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+
+    if (!sd->api->window_create)
+        return o;
+
+    return sd->api->window_create(sd);
+}
+
+/**
+ * @internal
+ * Reports mouse has moved over a link.
+ *
+ * Emits signal: "link,hover,in"
+ */
+void ewk_view_mouse_link_hover_in(Evas_Object* o, void* data)
+{
+    evas_object_smart_callback_call(o, "link,hover,in", data);
+}
+
+/**
+ * @internal
+ * Reports mouse is not over a link anymore.
+ *
+ * Emits signal: "link,hover,out"
+ */
+void ewk_view_mouse_link_hover_out(Evas_Object* o)
+{
+    evas_object_smart_callback_call(o, "link,hover,out", 0);
+}
+
+/**
+ * @internal
+ * Set toolbar visible.
+ *
+ * Emits signal: "toolbars,visible,set" with a pointer to a boolean.
+ */
+void ewk_view_toolbars_visible_set(Evas_Object* o, Eina_Bool visible)
+{
+    DBG("o=%p (visible=%d)", o, !!visible);
+    evas_object_smart_callback_call(o, "toolbars,visible,set", &visible);
+}
+
+/**
+ * @internal
+ * Get toolbar visibility.
+ *
+ * @param o View.
+ * @param visible boolean pointer in which to save the result. It defaults
+ * to @c FALSE, i.e. if browser does no listen to emitted signal, it means
+ * there are no toolbars and therefore they are not visible.
+ *
+ * Emits signal: "toolbars,visible,get" with a pointer to a boolean.
+ */
+void ewk_view_toolbars_visible_get(Evas_Object* o, Eina_Bool* visible)
+{
+    DBG("%s, o=%p", __func__, o);
+    *visible = EINA_FALSE;
+    evas_object_smart_callback_call(o, "toolbars,visible,get", visible);
+}
+
+/**
+ * @internal
+ * Set statusbar visible.
+ *
+ * @param o View.
+ * @param visible @c TRUE if statusbar are visible, @c FALSE otherwise.
+ *
+ * Emits signal: "statusbar,visible,set" with a pointer to a boolean.
+ */
+void ewk_view_statusbar_visible_set(Evas_Object* o, Eina_Bool visible)
+{
+    DBG("o=%p (visible=%d)", o, !!visible);
+    evas_object_smart_callback_call(o, "statusbar,visible,set", &visible);
+}
+
+/**
+ * @internal
+ * Get statusbar visibility.
+ *
+ * @param o View.
+ * @param visible boolean pointer in which to save the result. It defaults
+ * to @c FALSE, i.e. if browser does no listen to emitted signal, it means
+ * there is no statusbar and therefore it is not visible.
+ *
+ * Emits signal: "statusbar,visible,get" with a pointer to a boolean.
+ */
+void ewk_view_statusbar_visible_get(Evas_Object* o, Eina_Bool* visible)
+{
+    DBG("%s, o=%p", __func__, o);
+    *visible = EINA_FALSE;
+    evas_object_smart_callback_call(o, "statusbar,visible,get", visible);
+}
+
+/**
+ * @internal
+ * Set text of statusbar
+ *
+ * @param o View.
+ * @param text New text to put on statusbar.
+ *
+ * Emits signal: "statusbar,text,set" with a string.
+ */
+void ewk_view_statusbar_text_set(Evas_Object* o, const char* text)
+{
+    DBG("o=%p (text=%s)", o, text);
+    INF("status bar text set: %s", text);
+    evas_object_smart_callback_call(o, "statusbar,text,set", (void *)text);
+}
+
+/**
+ * @internal
+ * Set scrollbars visible.
+ *
+ * @param o View.
+ * @param visible @c TRUE if scrollbars are visible, @c FALSE otherwise.
+ *
+ * Emits signal: "scrollbars,visible,set" with a pointer to a boolean.
+ */
+void ewk_view_scrollbars_visible_set(Evas_Object* o, Eina_Bool visible)
+{
+    DBG("o=%p (visible=%d)", o, !!visible);
+    evas_object_smart_callback_call(o, "scrollbars,visible,set", &visible);
+}
+
+/**
+ * @internal
+ * Get scrollbars visibility.
+ *
+ * @param o View.
+ * @param visible boolean pointer in which to save the result. It defaults
+ * to @c FALSE, i.e. if browser does no listen to emitted signal, it means
+ * there are no scrollbars and therefore they are not visible.
+ *
+ * Emits signal: "scrollbars,visible,get" with a pointer to a boolean.
+ */
+void ewk_view_scrollbars_visible_get(Evas_Object* o, Eina_Bool* visible)
+{
+    DBG("%s, o=%p", __func__, o);
+    *visible = EINA_FALSE;
+    evas_object_smart_callback_call(o, "scrollbars,visible,get", visible);
+}
+
+/**
+ * @internal
+ * Set menubar visible.
+ *
+ * @param o View.
+ * @param visible @c TRUE if menubar is visible, @c FALSE otherwise.
+ *
+ * Emits signal: "menubar,visible,set" with a pointer to a boolean.
+ */
+void ewk_view_menubar_visible_set(Evas_Object* o, Eina_Bool visible)
+{
+    DBG("o=%p (visible=%d)", o, !!visible);
+    evas_object_smart_callback_call(o, "menubar,visible,set", &visible);
+}
+
+/**
+ * @internal
+ * Get menubar visibility.
+ *
+ * @param o View.
+ * @param visible boolean pointer in which to save the result. It defaults
+ * to @c FALSE, i.e. if browser does no listen to emitted signal, it means
+ * there is no menubar and therefore it is not visible.
+ *
+ * Emits signal: "menubar,visible,get" with a pointer to a boolean.
+ */
+void ewk_view_menubar_visible_get(Evas_Object* o, Eina_Bool* visible)
+{
+    DBG("%s, o=%p", __func__, o);
+    *visible = EINA_FALSE;
+    evas_object_smart_callback_call(o, "menubar,visible,get", visible);
+}
+
+/**
+ * @internal
+ * Set tooltip text and display if it is currently hidden.
+ *
+ * @param o View.
+ * @param text Text to set tooltip to.
+ *
+ * Emits signal: "tooltip,text,set" with a string. If tooltip must be actually
+ * removed, text will be 0 or '\0'
+ */
+void ewk_view_tooltip_text_set(Evas_Object* o, const char* text)
+{
+    DBG("o=%p text=%s", o, text);
+    evas_object_smart_callback_call(o, "tooltip,text,set", (void *)text);
+}
+
+/**
+ * @internal
+ *
+ * @param o View.
+ * @param message String to show on console.
+ * @param lineNumber Line number.
+ * @sourceID Source id.
+ *
+ */
+void ewk_view_add_console_message(Evas_Object* o, const char* message, unsigned int lineNumber, const char* sourceID)
+{
+    DBG("o=%p message=%s lineNumber=%u sourceID=%s", o, message, lineNumber, sourceID);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->add_console_message);
+    sd->api->add_console_message(sd, message, lineNumber, sourceID);
+}
+
+void ewk_view_run_javascript_alert(Evas_Object* o, Evas_Object* frame, const char* message)
+{
+    DBG("o=%p frame=%p message=%s", o, frame, message);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+
+    if (!sd->api->run_javascript_alert)
+        return;
+
+    sd->api->run_javascript_alert(sd, frame, message);
+}
+
+Eina_Bool ewk_view_run_javascript_confirm(Evas_Object* o, Evas_Object* frame, const char* message)
+{
+    DBG("o=%p frame=%p message=%s", o, frame, message);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+
+    if (!sd->api->run_javascript_confirm)
+        return EINA_FALSE;
+
+    return sd->api->run_javascript_confirm(sd, frame, message);
+}
+
+Eina_Bool ewk_view_run_javascript_prompt(Evas_Object* o, Evas_Object* frame, const char* message, const char* defaultValue, char** value)
+{
+    DBG("o=%p frame=%p message=%s", o, frame, message);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+
+    if (!sd->api->run_javascript_prompt)
+        return EINA_FALSE;
+
+    return sd->api->run_javascript_prompt(sd, frame, message, defaultValue, value);
+}
+
+/**
+ * @internal
+ * Delegates to client to decide whether a script must be stopped because it's
+ * running for too long. If client does not implement it, it goes to default
+ * implementation, which logs and returns EINA_FALSE. Client may remove log by
+ * setting this function 0, which will just return EINA_FALSE.
+ *
+ * @param o View.
+ *
+ * @return @c EINA_TRUE if script should be stopped; @c EINA_FALSE otherwise
+ */
+Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object* o)
+{
+    DBG("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+
+    if (!sd->api->should_interrupt_javascript)
+        return EINA_FALSE;
+
+    return sd->api->should_interrupt_javascript(sd);
+}
+
+/**
+ * @internal
+ * This is called whenever the web site shown in @param frame is asking to store data
+ * to the database @param databaseName and the quota allocated to that web site
+ * is exceeded. Browser may use this to increase the size of quota before the
+ * originating operationa fails.
+ *
+ * @param o View.
+ * @param frame The frame whose web page exceeded its database quota.
+ * @param databaseName Database name.
+ */
+void ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName)
+{
+    DBG("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api);
+    EINA_SAFETY_ON_NULL_RETURN(sd->api->exceeded_database_quota);
+    sd->api->exceeded_database_quota(sd, frame, databaseName);
+}
+
+/**
+ * @internal
+ * Open panel to choose a file.
+ *
+ * @param o View.
+ * @param frame Frame in which operation is required.
+ * @param allows_multiple_files @c EINA_TRUE when more than one file may be
+ * selected, @c EINA_FALSE otherwise
+ * @suggested_filenames List of suggested files to select. It's advisable to
+ * just ignore this value, since it's a source of security flaw.
+ * @selected_filenames List of files selected.
+ *
+ * @return @EINA_FALSE if user canceled file selection; @EINA_TRUE if confirmed.
+ */
+Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool allows_multiple_files, const Eina_List* suggested_filenames, Eina_List** selected_filenames)
+{
+    DBG("o=%p frame=%p allows_multiple_files=%d", o, frame, allows_multiple_files);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE);
+    Eina_Bool confirm;
+
+    if (!sd->api->run_open_panel)
+        return EINA_FALSE;
+
+    *selected_filenames = 0;
+
+    confirm = sd->api->run_open_panel(sd, frame, allows_multiple_files, suggested_filenames, selected_filenames);
+    if (!confirm && *selected_filenames)
+        ERR("Canceled file selection, but selected filenames != 0. Free names before return.");
+    return confirm;
+}
+
+void ewk_view_repaint(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
+{
+    DBG("o=%p, region=%d,%d + %dx%d", o, x, y, w, h);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+
+    if (!priv->main_frame->contentRenderer()) {
+        ERR("no main frame content renderer.");
+        return;
+    }
+
+    _ewk_view_repaint_add(priv, x, y, w, h);
+    _ewk_view_smart_changed(sd);
+}
+
+void ewk_view_scroll(Evas_Object* o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame)
+{
+    DBG("o=%p, delta: %d,%d, scroll: %d,%d+%dx%d, clip: %d,%d+%dx%d",
+        o, dx, dy, sx, sy, sw, sh, cx, cy, cw, ch);
+
+    if ((sx != cx) || (sy != cy) || (sw != cw) || (sh != ch))
+        WRN("scroll region and clip are different! %d,%d+%dx%d and %d,%d+%dx%d",
+            sx, sy, sw, sh, cx, cy, cw, ch);
+
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+    EINA_SAFETY_ON_TRUE_RETURN(!dx && !dy);
+
+    _ewk_view_scroll_add(priv, dx, dy, sx, sy, sw, sh, main_frame);
+    _ewk_view_smart_changed(sd);
+}
+
+WebCore::Page* ewk_view_core_page_get(const Evas_Object* o)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+    return priv->page;
+}
+
+/**
+ * Creates a new frame for given url and owner element.
+ *
+ * Emits "frame,created" with the new frame object on success.
+ */
+WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Object* frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer)
+{
+    DBG("o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s",
+        o, frame, name.utf8().data(), ownerElement,
+        url.prettyURL().utf8().data(), referrer.utf8().data());
+
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
+
+    WTF::RefPtr<WebCore::Frame> cf = _ewk_view_core_frame_new
+        (sd, priv, ownerElement);
+    if (!cf) {
+        ERR("Could not create child core frame '%s'", name.utf8().data());
+        return 0;
+    }
+
+    if (!ewk_frame_child_add(frame, cf, name, url, referrer)) {
+        ERR("Could not create child frame object '%s'", name.utf8().data());
+        return 0;
+    }
+
+    // The creation of the frame may have removed itself already.
+    if (!cf->page() || !cf->tree() || !cf->tree()->parent())
+        return 0;
+
+    sd->changed.frame_rect = EINA_TRUE;
+    _ewk_view_smart_changed(sd);
+
+    evas_object_smart_callback_call(o, "frame,created", frame);
+    return cf.release();
+}
+
+WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually)
+{
+    DBG("o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s",
+        o, frame, pluginSize.width(), pluginSize.height(), element,
+        url.prettyURL().utf8().data(), mimeType.utf8().data());
+
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
+    sd->changed.frame_rect = EINA_TRUE;
+    _ewk_view_smart_changed(sd);
+
+    return ewk_frame_plugin_create
+        (frame, pluginSize, element, url, paramNames, paramValues,
+         mimeType, loadManually);
+}
+
+
+/**
+ * @internal
+ *
+ * Creates a new popup with options when a select widget was clicked.
+ *
+ * @param client PopupMenuClient instance that allows communication with webkit.
+ * @param selected Selected item.
+ * @param rect Menu's position.
+ *
+ * Emits: "popup,create" with a list of Ewk_Menu containing each item's data
+ */
+void ewk_view_popup_new(Evas_Object* o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect)
+{
+    INF("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+
+    if (priv->popup.menu_client)
+        ewk_view_popup_destroy(o);
+
+    priv->popup.menu_client = client;
+
+    // populate items
+    const int size = client->listSize();
+    for (int i = 0; i < size; ++i) {
+        Ewk_Menu_Item* item = (Ewk_Menu_Item*) malloc(sizeof(*item));
+        if (client->itemIsSeparator(i))
+            item->type = EWK_MENU_SEPARATOR;
+        else if (client->itemIsLabel(i))
+            item->type = EWK_MENU_GROUP;
+        else
+            item->type = EWK_MENU_OPTION;
+        item->text = eina_stringshare_add(client->itemText(i).utf8().data());
+
+        priv->popup.menu.items = eina_list_append(priv->popup.menu.items, item);
+    }
+
+    priv->popup.menu.x = rect.x();
+    priv->popup.menu.y = rect.y();
+    priv->popup.menu.width = rect.width();
+    priv->popup.menu.height = rect.height();
+    evas_object_smart_callback_call(o, "popup,create", &priv->popup.menu);
+}
+
+/**
+ * Destroy a previously created menu.
+ *
+ * Before destroying, it informs client that menu's data is ready to be
+ * destroyed by sending a "popup,willdelete" with a list of menu items. Then it
+ * removes any reference to menu inside webkit. It's safe to call this
+ * function either from inside webkit or from browser.
+ *
+ * @param o View.
+ *
+ * @returns EINA_TRUE in case menu was successfully destroyed or EINA_TRUE in
+ * case there wasn't any menu to be destroyed.
+ */
+Eina_Bool ewk_view_popup_destroy(Evas_Object* o)
+{
+    INF("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
+
+    if (!priv->popup.menu_client)
+        return EINA_FALSE;
+
+    evas_object_smart_callback_call(o, "popup,willdelete", &priv->popup.menu);
+
+    void* itemv;
+    EINA_LIST_FREE(priv->popup.menu.items, itemv) {
+        Ewk_Menu_Item* item = (Ewk_Menu_Item*)itemv;
+        eina_stringshare_del(item->text);
+        free(item);
+    }
+    priv->popup.menu_client->popupDidHide();
+    priv->popup.menu_client = 0;
+
+    return EINA_TRUE;
+}
+
+/**
+ * Changes currently selected item.
+ *
+ * Changes the option selected in select widget. This is called by browser
+ * whenever user has chosen a different item. Most likely after calling this, a
+ * call to ewk_view_popup_destroy might be made in order to close the popup.
+ *
+ * @param o View.
+ * @index Index of selected item.
+ *
+ */
+void ewk_view_popup_selected_set(Evas_Object* o, int index)
+{
+    INF("o=%p", o);
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd);
+    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);
+
+    priv->popup.menu_client->valueChanged(index);
+}
+
+/**
+ * @internal
+ * Request a download to user.
+ *
+ * @param o View.
+ * @oaram download Ewk_Download struct to be sent.
+ *
+ * Emits: "download,request" with an Ewk_Download containing the details of the
+ * requested download. The download per se must be handled outside of webkit.
+ */
+void ewk_view_download_request(Evas_Object* o, Ewk_Download* download)
+{
+    DBG("view=%p", o);
+    evas_object_smart_callback_call(o, "download,request", download);
+}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
new file mode 100644
index 0000000..20df601
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -0,0 +1,455 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 ewk_view_h
+#define ewk_view_h
+
+#include <Evas.h>
+#include <cairo.h>
+#include <ewk_history.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief WebKit main smart object.
+ *
+ * This object is the high level access to WebKit-EFL browser
+ * component. It is responsible for managing the main frame and other
+ * critical resources.
+ *
+ * Every ewk_view has at least one frame, called "main frame" and
+ * retrieved with ewk_view_frame_main_get(). Direct frame access is
+ * often discouraged, it is recommended to use ewk_view functions
+ * instead.
+ *
+ * The following signals (see evas_object_smart_callback_add()) are emitted:
+ *
+ *  - "ready", void: page is fully loaded.
+ *  - "title,changed", const char*: title of the main frame changed.
+ *  - "uri,changed", const char*: uri of the main frame changed.
+ *  - "load,started", void: frame started loading.
+ *  - "load,progress", double*: load progress changed (overall value
+ *    from 0.0 to 1.0, connect to individual frames for fine grained).
+ *  - "load,finished", const Ewk_Frame_Load_Error*: reports load
+ *    finished and as argument @c NULL if successfully or pointer to
+ *    structure defining the error.
+ *  - "load,provisional", void: view started provisional load.
+ *  - "load,error", const Ewk_Frame_Load_Error*: reports load failed
+ *    and as argument a pointer to structure defining the error.
+ *  - "frame,created", Evas_Object*: when frames are created, they are
+ *    emitted in this signal.
+ *  - "zoom,animated,end", void: requested animated zoom is finished.
+ *  - "menubar,visible,set", Eina_Bool: set menubar visibility.
+ *  - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
+ *    visible; otherwise, @c EINA_FALSE.
+ *  - "menubar,visible,set", Eina_Bool: set menubar visibility.
+ *  - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
+ *    visible; @c EINA_FALSE, otherwise.
+ *  - "scrollbars,visible,set", Eina_Bool: set scrollbars visibility.
+ *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
+ *    are visible; @c EINA_FALSE, otherwise.
+ *  - "statusbar,visible,set", Eina_Bool: set statusbar visibility.
+ *  - "statusbar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if statusbar is
+ *    visible; @c EINA_FALSE, otherwise.
+ *  - "toolbar,visible,set", Eina_Bool: set toolbar visibility.
+ *  - "toolbar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if toolbar
+ *    is visible; @c EINA_FALSE, otherwise.
+ *  - "link,hover,in", const char *link[2]: reports mouse is over a link and as
+ *    argument gives the url in link[0] and link's title in link[1].
+ *  - "link,hover,out", const char *link[2]: reports mouse moved out from a link
+ *    and as argument gives the url in link[0] and link's title in link[1].
+ *  - "popup,create", Ewk_Menu: reports that a new menu was created.
+ *  - "popup,willdeleted", Ewk_Menu: reports that a previously created menu is
+ *    about to be deleted.
+ *  - "download,request", Ewk_Download: reports a download is being requested
+ *    and as arguments gives its details.
+ *  - "icon,received", void: main frame received an icon.
+ */
+
+typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data;
+
+/**
+ * Ewk view's class, to be overridden by sub-classes.
+ */
+typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
+struct _Ewk_View_Smart_Class {
+    Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
+    unsigned long version;
+
+    Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */
+    // hooks to allow different backing stores
+    Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
+    Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
+    Eina_Bool (*repaints_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
+    Eina_Bool (*contents_resize)(Ewk_View_Smart_Data *sd, int w, int h);
+    Eina_Bool (*zoom_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
+    Eina_Bool (*zoom_weak_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
+    void (*zoom_weak_smooth_scale_set)(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale);
+    void (*bg_color_set)(Ewk_View_Smart_Data *sd, unsigned char r, unsigned char g, unsigned char b, unsigned char a);
+    void (*flush)(Ewk_View_Smart_Data *sd);
+    Eina_Bool (*pre_render_region)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
+    void (*pre_render_cancel)(Ewk_View_Smart_Data *sd);
+    // event handling:
+    //  - returns true if handled
+    //  - if overridden, have to call parent method if desired
+    Eina_Bool (*focus_in)(Ewk_View_Smart_Data *sd);
+    Eina_Bool (*focus_out)(Ewk_View_Smart_Data *sd);
+    Eina_Bool (*mouse_wheel)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Wheel *ev);
+    Eina_Bool (*mouse_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Down *ev);
+    Eina_Bool (*mouse_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Up *ev);
+    Eina_Bool (*mouse_move)(Ewk_View_Smart_Data *sd, const Evas_Event_Mouse_Move *ev);
+    Eina_Bool (*key_down)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Down *ev);
+    Eina_Bool (*key_up)(Ewk_View_Smart_Data *sd, const Evas_Event_Key_Up *ev);
+
+    void (*add_console_message)(Ewk_View_Smart_Data *sd, const char *message, unsigned int lineNumber, const char *sourceID);
+    void (*run_javascript_alert)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
+    Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message);
+    Eina_Bool (*run_javascript_prompt)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message, const char *defaultValue, char **value);
+    Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd);
+    void (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName);
+
+    Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
+};
+
+#define EWK_VIEW_SMART_CLASS_VERSION 1UL /** the version you have to put into the version field in the Ewk_View_Smart_Class structure */
+
+/**
+ * Initializer for whole Ewk_View_Smart_Class structure.
+ *
+ * @param smart_class_init initializer to use for the "base" field
+ * (Evas_Smart_Class).
+ *
+ * @see EWK_VIEW_SMART_CLASS_INIT_NULL
+ * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
+ * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
+ */
+#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+
+/**
+ * Initializer to zero a whole Ewk_View_Smart_Class structure.
+ *
+ * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
+ * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
+ * @see EWK_VIEW_SMART_CLASS_INIT
+ */
+#define EWK_VIEW_SMART_CLASS_INIT_NULL EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
+
+/**
+ * Initializer to zero a whole Ewk_View_Smart_Class structure and set version.
+ *
+ * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
+ * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION
+ *
+ * @see EWK_VIEW_SMART_CLASS_INIT_NULL
+ * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
+ * @see EWK_VIEW_SMART_CLASS_INIT
+ */
+#define EWK_VIEW_SMART_CLASS_INIT_VERSION EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_VERSION)
+
+/**
+ * Initializer to zero a whole Ewk_View_Smart_Class structure and set
+ * name and version.
+ *
+ * Similar to EWK_VIEW_SMART_CLASS_INIT_NULL, but will set version field of
+ * Evas_Smart_Class (base field) to latest EVAS_SMART_CLASS_VERSION and name
+ * to the specific value.
+ *
+ * It will keep a reference to name field as a "const char *", that is,
+ * name must be available while the structure is used (hint: static or global!)
+ * and will not be modified.
+ *
+ * @see EWK_VIEW_SMART_CLASS_INIT_NULL
+ * @see EWK_VIEW_SMART_CLASS_INIT_VERSION
+ * @see EWK_VIEW_SMART_CLASS_INIT
+ */
+#define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
+
+/**
+ * @internal
+ *
+ * private data that is used internally by EFL WebKit and should never
+ * be modified from outside.
+ */
+typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data;
+
+enum _Ewk_Menu_Item_Type {
+    EWK_MENU_SEPARATOR,
+    EWK_MENU_GROUP,
+    EWK_MENU_OPTION
+};
+typedef enum _Ewk_Menu_Item_Type Ewk_Menu_Item_Type;
+
+
+/**
+ * Structure do contain data of each menu item
+ */
+typedef struct _Ewk_Menu_Item Ewk_Menu_Item;
+struct _Ewk_Menu_Item {
+    const char *text; /**< Item's text */
+    Ewk_Menu_Item_Type type; /** Item's type */
+};
+
+/**
+ * Structure to contain Popup menu data.
+ */
+typedef struct _Ewk_Menu Ewk_Menu;
+struct _Ewk_Menu {
+        Eina_List* items;
+        int x;
+        int y;
+        int width;
+        int height;
+};
+
+/**
+ * Structure to contain Download data
+ */
+typedef struct _Ewk_Download Ewk_Download;
+struct _Ewk_Download {
+    const char* url;
+    /* to be extended */
+};
+
+/**
+ * Scroll request that should be processed by subclass implementations.
+ */
+typedef struct _Ewk_Scroll_Request Ewk_Scroll_Request;
+struct _Ewk_Scroll_Request {
+    Evas_Coord dx, dy;
+    Evas_Coord x, y, w, h, x2, y2;
+    Eina_Bool main_scroll;
+};
+
+/**
+ * Structure to contain internal View data, it is to be considered
+ * private by users, but may be extended or changed by sub-classes
+ * (that's why it's in public header file).
+ */
+struct _Ewk_View_Smart_Data {
+    Evas_Object_Smart_Clipped_Data base;
+    const Ewk_View_Smart_Class *api; /**< reference to casted class instance */
+    Evas_Object *self; /**< reference to owner object */
+    Evas_Object *main_frame; /**< reference to main frame object */
+    Evas_Object *backing_store; /**< reference to backing store */
+    Ewk_View_Private_Data *_priv; /**< should never be accessed, c++ stuff */
+    struct {
+        Evas_Coord x, y, w, h; /**< last used viewport */
+    } view;
+    struct {
+        struct {
+            float start;
+            float end;
+            float current; /**< if > 0.0, then doing animated zoom. */
+        } zoom;
+    } animated_zoom;
+    struct {
+        unsigned char r, g, b, a;
+    } bg_color;
+    Eina_Bool zoom_weak_smooth_scale:1;
+    struct { /**< what changed since last smart_calculate */
+        Eina_Bool any:1;
+        Eina_Bool size:1;
+        Eina_Bool position:1;
+        Eina_Bool frame_rect:1;
+    } changed;
+};
+
+EAPI Eina_Bool    ewk_view_base_smart_set(Ewk_View_Smart_Class *api);
+EAPI Eina_Bool    ewk_view_single_smart_set(Ewk_View_Smart_Class *api);
+
+EAPI Evas_Object *ewk_view_single_add(Evas *e);
+
+EAPI void         ewk_view_fixed_layout_size_set(Evas_Object *o, Evas_Coord w, Evas_Coord h);
+EAPI void         ewk_view_fixed_layout_size_get(Evas_Object *o, Evas_Coord *w, Evas_Coord *h);
+
+EAPI void         ewk_view_theme_set(Evas_Object *o, const char *path);
+EAPI const char  *ewk_view_theme_get(Evas_Object *o);
+
+EAPI Evas_Object *ewk_view_frame_main_get(const Evas_Object *o);
+EAPI Evas_Object *ewk_view_frame_focused_get(const Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_uri_set(Evas_Object *o, const char *uri);
+EAPI const char  *ewk_view_uri_get(const Evas_Object *o);
+EAPI const char  *ewk_view_title_get(const Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_editable_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_editable_set(Evas_Object *o, Eina_Bool editable);
+
+EAPI void         ewk_view_bg_color_set(Evas_Object *o, int r, int g, int b, int a);
+EAPI void         ewk_view_bg_color_get(const Evas_Object *o, int *r, int *g, int *b, int *a);
+
+EAPI char        *ewk_view_selection_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_none(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_all(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_paragraph(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_sentence(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_line(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_select_word(Evas_Object *o);
+
+EAPI void         ewk_view_popup_selected_set(Evas_Object *o, int index);
+EAPI Eina_Bool    ewk_view_popup_destroy(Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_text_search(const Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
+
+EAPI unsigned int ewk_view_text_matches_mark(Evas_Object *o, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
+EAPI Eina_Bool    ewk_view_text_matches_unmark_all(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
+EAPI Eina_Bool    ewk_view_text_matches_highlight_get(const Evas_Object *o);
+
+EAPI double       ewk_view_load_progress_get(const Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_stop(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_reload(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_reload_full(Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_back(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_forward(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_navigate(Evas_Object *o, int steps);
+
+EAPI Eina_Bool    ewk_view_back_possible(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_forward_possible(Evas_Object *o);
+EAPI Eina_Bool    ewk_view_navigate_possible(Evas_Object *o, int steps);
+
+EAPI Eina_Bool    ewk_view_history_enable_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_history_enable_set(Evas_Object *o, Eina_Bool enable);
+EAPI Ewk_History *ewk_view_history_get(const Evas_Object *o);
+
+EAPI float        ewk_view_zoom_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_zoom_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
+
+EAPI Eina_Bool    ewk_view_zoom_weak_smooth_scale_get(const Evas_Object *o);
+EAPI void         ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
+
+EAPI Eina_Bool    ewk_view_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
+EAPI Eina_Bool    ewk_view_zoom_animated_mark_start(Evas_Object *o, float zoom);
+EAPI Eina_Bool    ewk_view_zoom_animated_mark_end(Evas_Object *o, float zoom);
+EAPI Eina_Bool    ewk_view_zoom_animated_mark_current(Evas_Object *o, float zoom);
+EAPI Eina_Bool    ewk_view_zoom_animated_mark_stop(Evas_Object *o);
+
+EAPI Eina_Bool    ewk_view_zoom_animated_set(Evas_Object *o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy);
+EAPI Eina_Bool    ewk_view_zoom_text_only_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_zoom_text_only_set(Evas_Object *o, Eina_Bool setting);
+
+EAPI Eina_Bool    ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
+EAPI void         ewk_view_pre_render_cancel(Evas_Object *o);
+
+/* settings */
+EAPI const char  *ewk_view_setting_user_agent_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_user_agent_set(Evas_Object *o, const char *user_agent);
+
+EAPI Eina_Bool    ewk_view_setting_auto_load_images_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
+
+EAPI Eina_Bool    ewk_view_setting_auto_shrink_images_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_auto_shrink_images_set(Evas_Object *o, Eina_Bool automatic);
+
+EAPI Eina_Bool    ewk_view_setting_enable_scripts_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_enable_scripts_set(Evas_Object *o, Eina_Bool enable);
+
+EAPI Eina_Bool    ewk_view_setting_enable_plugins_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_enable_plugins_set(Evas_Object *o, Eina_Bool enable);
+
+EAPI Eina_Bool    ewk_view_setting_scripts_window_open_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_scripts_window_open_set(Evas_Object *o, Eina_Bool allow);
+
+EAPI Eina_Bool    ewk_view_setting_resizable_textareas_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_resizable_textareas_set(Evas_Object *o, Eina_Bool enable);
+
+EAPI const char  *ewk_view_setting_user_stylesheet_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_user_stylesheet_set(Evas_Object *o, const char *uri);
+
+EAPI Eina_Bool    ewk_view_setting_private_browsing_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_private_browsing_set(Evas_Object *o, Eina_Bool enable);
+
+EAPI Eina_Bool    ewk_view_setting_caret_browsing_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_caret_browsing_set(Evas_Object *o, Eina_Bool enable);
+
+EAPI const char  *ewk_view_setting_encoding_custom_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_encoding_custom_set(Evas_Object *o, const char *encoding);
+EAPI const char  *ewk_view_setting_encoding_default_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_encoding_default_set(Evas_Object *o, const char *encoding);
+
+EAPI int          ewk_view_setting_font_minimum_size_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_minimum_size_set(Evas_Object *o, int size);
+EAPI int          ewk_view_setting_font_minimum_logical_size_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_minimum_logical_size_set(Evas_Object *o, int size);
+EAPI int          ewk_view_setting_font_default_size_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_default_size_set(Evas_Object *o, int size);
+EAPI int          ewk_view_setting_font_monospace_size_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_monospace_size_set(Evas_Object *o, int size);
+
+EAPI const char  *ewk_view_setting_font_standard_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_standard_set(Evas_Object *o, const char *family);
+
+EAPI const char  *ewk_view_setting_font_cursive_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_cursive_set(Evas_Object *o, const char *family);
+
+EAPI const char  *ewk_view_setting_font_monospace_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_monospace_set(Evas_Object *o, const char *family);
+
+EAPI const char  *ewk_view_setting_font_fantasy_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_fantasy_set(Evas_Object *o, const char *family);
+
+EAPI const char  *ewk_view_setting_font_serif_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_serif_set(Evas_Object *o, const char *family);
+
+EAPI const char  *ewk_view_setting_font_sans_serif_get(const Evas_Object *o);
+EAPI Eina_Bool    ewk_view_setting_font_sans_serif_set(Evas_Object *o, const char *family);
+
+/* to be used by subclass implementations */
+EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o);
+
+EAPI const Eina_Rectangle *ewk_view_repaints_get(const Ewk_View_Private_Data *priv, size_t *count);
+EAPI const Ewk_Scroll_Request *ewk_view_scroll_requests_get(const Ewk_View_Private_Data *priv, size_t *count);
+
+EAPI void ewk_view_repaint_add(Ewk_View_Private_Data *priv, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
+
+EAPI void ewk_view_layout_if_needed_recursive(Ewk_View_Private_Data *priv);
+
+EAPI void ewk_view_scrolls_process(Ewk_View_Smart_Data *sd);
+
+/**
+ * Structure that keeps paint context.
+ *
+ * @note this is not for general use but just for subclasses that want
+ *       to define their own backing store.
+ */
+typedef struct _Ewk_View_Paint_Context Ewk_View_Paint_Context;
+
+EAPI Ewk_View_Paint_Context *ewk_view_paint_context_new(Ewk_View_Private_Data *priv, cairo_t *cr);
+EAPI void ewk_view_paint_context_free(Ewk_View_Paint_Context *ctxt);
+
+EAPI void ewk_view_paint_context_save(Ewk_View_Paint_Context *ctxt);
+EAPI void ewk_view_paint_context_restore(Ewk_View_Paint_Context *ctxt);
+EAPI void ewk_view_paint_context_clip(Ewk_View_Paint_Context *ctxt, const Eina_Rectangle *area);
+EAPI void ewk_view_paint_context_paint(Ewk_View_Paint_Context *ctxt, const Eina_Rectangle *area);
+EAPI void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context *ctxt, const Eina_Rectangle *area);
+EAPI void ewk_view_paint_context_scale(Ewk_View_Paint_Context *ctxt, float scale_x, float scale_y);
+EAPI void ewk_view_paint_context_translate(Ewk_View_Paint_Context *ctxt, float x, float y);
+
+EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
+EAPI Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_view_h
diff --git a/WebKit/efl/ewk/ewk_view_single.c b/WebKit/efl/ewk/ewk_view_single.c
new file mode 100644
index 0000000..4111370
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_view_single.c
@@ -0,0 +1,585 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    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 "ewk_view.h"
+
+#include "ewk_frame.h"
+#include "ewk_logging.h"
+
+#include <Evas.h>
+#include <eina_safety_checks.h>
+#include <string.h>
+
+static Ewk_View_Smart_Class _parent_sc = EWK_VIEW_SMART_CLASS_INIT_NULL;
+
+static void _ewk_view_single_on_del(void *data, Evas *e, Evas_Object *o, void *event_info)
+{
+    Evas_Object *clip = (Evas_Object*)data;
+    evas_object_del(clip);
+}
+
+static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd)
+{
+    Evas_Object *bs = evas_object_image_add(sd->base.evas);
+    Evas_Object *clip = evas_object_rectangle_add(sd->base.evas);
+    evas_object_image_alpha_set(bs, EINA_FALSE);
+    evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale);
+    evas_object_clip_set(bs, clip);
+    evas_object_show(clip);
+
+    evas_object_event_callback_add
+        (bs, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip);
+
+    return bs;
+}
+
+static void _ewk_view_single_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
+{
+    Ewk_View_Smart_Data *sd = (Ewk_View_Smart_Data*)evas_object_smart_data_get(o);
+    _parent_sc.sc.resize(o, w, h);
+
+    // these should be queued and processed in calculate as well!
+    evas_object_image_size_set(sd->backing_store, w, h);
+    if (sd->animated_zoom.zoom.current < 0.00001) {
+        Evas_Object *clip = evas_object_clip_get(sd->backing_store);
+        Evas_Coord x, y, cw, ch;
+        evas_object_image_fill_set(sd->backing_store, 0, 0, w, h);
+        evas_object_geometry_get(sd->backing_store, &x, &y, 0, 0);
+        evas_object_move(clip, x, y);
+        ewk_frame_contents_size_get(sd->main_frame, &cw, &ch);
+        if (w > cw)
+            w = cw;
+        if (h > ch)
+            h = ch;
+        evas_object_resize(clip, w, h);
+    }
+}
+
+static inline void _ewk_view_4b_move_region_up(uint32_t *image, size_t rows, size_t x, size_t y, size_t w, size_t h, size_t rowsize)
+{
+    uint32_t *src;
+    uint32_t *dst;
+
+    dst = image + x + y * rowsize;
+    src = dst + rows * rowsize;
+    h -= rows;
+
+    for (; h > 0; h--, dst += rowsize, src += rowsize)
+        memcpy(dst, src, w * 4);
+}
+
+static inline void _ewk_view_4b_move_region_down(uint32_t *image, size_t rows, size_t x, size_t y, size_t w, size_t h, size_t rowsize)
+{
+    uint32_t *src;
+    uint32_t *dst;
+
+    h -= rows;
+    src = image + x + (y + h - 1) * rowsize;
+    dst = src + rows * rowsize;
+
+    for (; h > 0; h--, dst -= rowsize, src -= rowsize)
+        memcpy(dst, src, w * 4);
+}
+
+static inline void _ewk_view_4b_move_line_left(uint32_t *dst, const uint32_t *src, size_t count)
+{
+    uint32_t *dst_end = dst + count;
+    /* no memcpy() as it does not allow overlapping regions */
+    /* no memmove() as it will copy to a temporary buffer */
+    /* TODO: loop unrolling, copying up to quad-words would help */
+    for (; dst < dst_end; dst++, src++)
+        *dst = *src;
+}
+
+static inline void _ewk_view_4b_move_line_right(uint32_t *dst, uint32_t *src, size_t count)
+{
+    uint32_t *dst_end = dst - count;
+    /* no memcpy() as it does not allow overlapping regions */
+    /* no memmove() as it will copy to a temporary buffer */
+    /* TODO: loop unrolling, copying up to quad-words would help */
+    for (; dst > dst_end; dst--, src--)
+        *dst = *src;
+}
+
+static inline void _ewk_view_4b_move_region_left(uint32_t *image, size_t cols, size_t x, size_t y, size_t w, size_t h, size_t rowsize)
+{
+    uint32_t *src;
+    uint32_t *dst;
+
+    dst = image + x + y * rowsize;
+    src = dst + cols;
+    w -= cols;
+
+    for (; h > 0; h--, dst += rowsize, src += rowsize)
+        _ewk_view_4b_move_line_left(dst, src, w);
+}
+
+static inline void _ewk_view_4b_move_region_right(uint32_t *image, size_t cols, size_t x, size_t y, size_t w, size_t h, size_t rowsize)
+{
+    uint32_t *src;
+    uint32_t *dst;
+
+    w -= cols;
+    src = image + (x + w - 1) + y * rowsize;
+    dst = src + cols;
+
+    for (; h > 0; h--, dst += rowsize, src += rowsize)
+        _ewk_view_4b_move_line_right(dst, src, w);
+}
+
+/* catch-all function, not as optimized as the others, but does the work. */
+static inline void _ewk_view_4b_move_region(uint32_t *image, int dx, int dy, size_t x, size_t y, size_t w, size_t h, size_t rowsize)
+{
+    uint32_t *src;
+    uint32_t *dst;
+
+    if (dy < 0) {
+        h += dy;
+        dst = image + x + y * rowsize;
+        src = dst - dy * rowsize;
+        if (dx <= 0) {
+            w += dx;
+            src -= dx;
+            for (; h > 0; h--, dst += rowsize, src += rowsize)
+                _ewk_view_4b_move_line_left(dst, src, w);
+        } else {
+            w -= dx;
+            src += w - 1;
+            dst += w + dx -1;
+            for (; h > 0; h--, dst += rowsize, src += rowsize)
+                _ewk_view_4b_move_line_right(dst, src, w);
+        }
+    } else {
+        h -= dy;
+        src = image + x + (y + h - 1) * rowsize;
+        dst = src + dy * rowsize;
+        if (dx <= 0) {
+            w += dx;
+            src -= dx;
+            for (; h > 0; h--, dst -= rowsize, src -= rowsize)
+                _ewk_view_4b_move_line_left(dst, src, w);
+        } else {
+            w -= dx;
+            src += w - 1;
+            dst += w + dx - 1;
+            for (; h > 0; h--, dst -= rowsize, src -= rowsize)
+                _ewk_view_4b_move_line_right(dst, src, w);
+        }
+    }
+}
+
+static inline void _ewk_view_single_scroll_process_single(Ewk_View_Smart_Data *sd, void *pixels, Evas_Coord ow, Evas_Coord oh, const Ewk_Scroll_Request *sr)
+{
+    Evas_Coord sx, sy, sw, sh;
+
+    DBG("%d,%d + %d,%d %+03d,%+03d, store: %p %dx%d",
+        sr->x, sr->y, sr->w, sr->h, sr->dx, sr->dy, pixels, ow, oh);
+
+    sx = sr->x;
+    sy = sr->y;
+    sw = sr->w;
+    sh = sr->h;
+
+    if (abs(sr->dx) >= sw || abs(sr->dy) >= sh) {
+        /* doubt webkit would be so stupid... */
+        DBG("full page scroll %+03d,%+03d. convert to repaint %d,%d + %dx%d",
+            sr->dx, sr->dy, sx, sy, sw, sh);
+        ewk_view_repaint_add(sd->_priv, sx, sy, sw, sh);
+        return;
+    }
+
+    if (sx < 0) {
+        sw += sx;
+        sx = 0;
+    }
+    if (sy < 0) {
+        sh += sy;
+        sy = 0;
+    }
+
+    if (sx + sw > ow)
+        sw = ow - sx;
+    if (sy + sh > oh)
+        sh = oh - sy;
+
+    if (sw < 0)
+        sw = 0;
+    if (sh < 0)
+        sh = 0;
+
+    EINA_SAFETY_ON_TRUE_RETURN(!sw || !sh);
+    if (!sr->dx) {
+        if (sr->dy < 0) {
+            DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, "
+                "repaint=%d,%d+%dx%d",
+                sr->dx, sr->dy, sx, sy, sw, sh + sr->dy,
+                sx, sy + sh + sr->dy, sw, -sr->dy);
+
+            _ewk_view_4b_move_region_up
+                ((uint32_t*)pixels, -sr->dy, sx, sy, sw, sh, ow);
+            evas_object_image_data_update_add
+                (sd->backing_store, sx, sy, sw, sh + sr->dy);
+
+            ewk_view_repaint_add(sd->_priv, sx, sy + sh + sr->dy, sw, -sr->dy);
+        } else if (sr->dy > 0) {
+            DBG("scroll down: %+03d,%+03d update=%d,%d+%dx%d, "
+                "repaint=%d,%d+%dx%d",
+                sr->dx, sr->dy, sx, sy + sr->dy, sw, sh - sr->dy,
+                sx, sy, sw, sr->dy);
+
+            _ewk_view_4b_move_region_down
+                ((uint32_t*)pixels, sr->dy, sx, sy, sw, sh, ow);
+            evas_object_image_data_update_add
+                (sd->backing_store, sx, sy + sr->dy, sw, sh - sr->dy);
+
+            ewk_view_repaint_add(sd->_priv, sx, sy, sw, sr->dy);
+        }
+    } else if (!sr->dy) {
+        if (sr->dx < 0) {
+            DBG("scroll left: %+03d,%+03d update=%d,%d+%dx%d, "
+                "repaint=%d,%d+%dx%d",
+                sr->dx, sr->dy, sx, sy, sw + sr->dx, sh,
+                sx + sw + sr->dx, sy, -sr->dx, sh);
+
+            _ewk_view_4b_move_region_left
+                ((uint32_t*)pixels, -sr->dx, sx, sy, sw, sh, ow);
+            evas_object_image_data_update_add
+                (sd->backing_store, sx, sy, sw + sr->dx, sh);
+
+            ewk_view_repaint_add(sd->_priv, sx + sw + sr->dx, sy, -sr->dx, sh);
+        } else if (sr->dx > 0) {
+            DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, "
+                "repaint=%d,%d+%dx%d",
+                sr->dx, sr->dy, sx + sr->dx, sy, sw - sr->dx, sh,
+                sx, sy, sr->dx, sh);
+
+            _ewk_view_4b_move_region_right
+                ((uint32_t*)pixels, sr->dx, sx, sy, sw, sh, ow);
+            evas_object_image_data_update_add
+                (sd->backing_store, sx + sr->dx, sy, sw - sr->dx, sh);
+
+            ewk_view_repaint_add(sd->_priv, sx, sy, sr->dx, sh);
+        }
+    } else {
+        Evas_Coord mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh;
+
+        if (sr->dx < 0) {
+            mx = sx;
+            mw = sw + sr->dx;
+            ax = mx + mw;
+            aw = -sr->dx;
+        } else {
+            ax = sx;
+            aw = sr->dx;
+            mx = ax + aw;
+            mw = sw - sr->dx;
+        }
+
+        if (sr->dy < 0) {
+            my = sy;
+            mh = sh + sr->dy;
+            by = my + mh;
+            bh = -sr->dy;
+        } else {
+            by = sy;
+            bh = sr->dy;
+            my = by + bh;
+            mh = sh - sr->dy;
+        }
+
+        ay = my;
+        ah = mh;
+        bx = sx;
+        bw = sw;
+
+        DBG("scroll diagonal: %+03d,%+03d update=%d,%d+%dx%d, "
+            "repaints: h=%d,%d+%dx%d v=%d,%d+%dx%d",
+            sr->dx, sr->dy, mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh);
+
+        _ewk_view_4b_move_region
+            ((uint32_t*)pixels, sr->dx, sr->dy, sx, sy, sw, sh, ow);
+
+        evas_object_image_data_update_add(sd->backing_store, mx, my, mw, mh);
+        ewk_view_repaint_add(sd->_priv, ax, ay, aw, ah);
+        ewk_view_repaint_add(sd->_priv, bx, by, bw, bh);
+    }
+}
+
+static Eina_Bool _ewk_view_single_smart_scrolls_process(Ewk_View_Smart_Data *sd)
+{
+    const Ewk_Scroll_Request *sr;
+    const Ewk_Scroll_Request *sr_end;
+    Evas_Coord ow, oh;
+    size_t count;
+    void *pixels = evas_object_image_data_get(sd->backing_store, 1);
+    evas_object_image_size_get(sd->backing_store, &ow, &oh);
+
+    sr = ewk_view_scroll_requests_get(sd->_priv, &count);
+    sr_end = sr + count;
+    for (; sr < sr_end; sr++)
+        _ewk_view_single_scroll_process_single(sd, pixels, ow, oh, sr);
+
+    return EINA_TRUE;
+}
+
+static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data *sd)
+{
+    Ewk_View_Paint_Context *ctxt;
+    Evas_Coord ow, oh;
+    void *pixels;
+    Eina_Rectangle r = {0, 0, 0, 0};
+    const Eina_Rectangle *pr;
+    const Eina_Rectangle *pr_end;
+    Eina_Tiler *tiler;
+    Eina_Iterator *itr;
+    cairo_status_t status;
+    cairo_surface_t *surface;
+    cairo_format_t format;
+    cairo_t *cairo;
+    size_t count;
+    Eina_Bool ret = EINA_TRUE;
+
+    if (sd->animated_zoom.zoom.current < 0.00001) {
+        Evas_Object *clip = evas_object_clip_get(sd->backing_store);
+        Evas_Coord w, h, cw, ch;
+        // reset effects of zoom_weak_set()
+        evas_object_image_fill_set
+            (sd->backing_store, 0, 0, sd->view.w, sd->view.h);
+        evas_object_move(clip, sd->view.x, sd->view.y);
+
+        w = sd->view.w;
+        h = sd->view.h;
+
+        ewk_frame_contents_size_get(sd->main_frame, &cw, &ch);
+        if (w > cw)
+            w = cw;
+        if (h > ch)
+            h = ch;
+        evas_object_resize(clip, w, h);
+    }
+
+    pixels = evas_object_image_data_get(sd->backing_store, 1);
+    evas_object_image_size_get(sd->backing_store, &ow, &oh);
+
+    if (sd->bg_color.a < 255)
+        format = CAIRO_FORMAT_ARGB32;
+    else
+        format = CAIRO_FORMAT_RGB24;
+
+    surface = cairo_image_surface_create_for_data
+        ((unsigned char*)pixels, format, ow, oh, ow * 4);
+    status = cairo_surface_status(surface);
+    if (status != CAIRO_STATUS_SUCCESS) {
+        ERR("could not create surface from data %dx%d: %s",
+            ow, oh, cairo_status_to_string(status));
+        ret = EINA_FALSE;
+        goto error_cairo_surface;
+    }
+    cairo = cairo_create(surface);
+    status = cairo_status(cairo);
+    if (status != CAIRO_STATUS_SUCCESS) {
+        ERR("could not create cairo from surface %dx%d: %s",
+            ow, oh, cairo_status_to_string(status));
+        ret = EINA_FALSE;
+        goto error_cairo;
+    }
+
+    ctxt = ewk_view_paint_context_new(sd->_priv, cairo);
+    if (!ctxt) {
+        ERR("could not create paint context");
+        ret = EINA_FALSE;
+        goto error_paint_context;
+    }
+
+    tiler = eina_tiler_new(ow, oh);
+    if (!tiler) {
+        ERR("could not create tiler %dx%d", ow, oh);
+        ret = EINA_FALSE;
+        goto error_tiler;
+    }
+
+    pr = ewk_view_repaints_get(sd->_priv, &count);
+    pr_end = pr + count;
+    for (; pr < pr_end; pr++)
+        eina_tiler_rect_add(tiler, pr);
+
+    itr = eina_tiler_iterator_new(tiler);
+    if (!itr) {
+        ERR("could not get iterator for tiler");
+        ret = EINA_FALSE;
+        goto error_iterator;
+    }
+
+    int sx, sy;
+    ewk_frame_scroll_pos_get(sd->main_frame, &sx, &sy);
+
+    EINA_ITERATOR_FOREACH(itr, r) {
+        Eina_Rectangle scrolled_rect = {
+            r.x + sx, r.y + sy,
+            r.w, r.h
+        };
+
+        ewk_view_paint_context_save(ctxt);
+
+        if ((sx) || (sy))
+            ewk_view_paint_context_translate(ctxt, -sx, -sy);
+
+        ewk_view_paint_context_clip(ctxt, &scrolled_rect);
+        ewk_view_paint_context_paint_contents(ctxt, &scrolled_rect);
+
+        ewk_view_paint_context_restore(ctxt);
+        evas_object_image_data_update_add
+            (sd->backing_store, r.x, r.y, r.w, r.h);
+    }
+    eina_iterator_free(itr);
+
+error_iterator:
+    eina_tiler_free(tiler);
+error_tiler:
+    ewk_view_paint_context_free(ctxt);
+error_paint_context:
+    cairo_destroy(cairo);
+error_cairo:
+    cairo_surface_destroy(surface);
+error_cairo_surface:
+    evas_object_image_data_set(sd->backing_store, pixels); /* dec refcount */
+
+    return ret;
+}
+
+static Eina_Bool _ewk_view_single_smart_zoom_weak_set(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy)
+{
+    // TODO: review
+    float scale = zoom / sd->animated_zoom.zoom.start;
+    Evas_Coord w = sd->view.w * scale;
+    Evas_Coord h = sd->view.h * scale;
+    Evas_Coord dx, dy, cw, ch;
+    Evas_Object *clip = evas_object_clip_get(sd->backing_store);
+
+    ewk_frame_contents_size_get(sd->main_frame, &cw, &ch);
+    if (sd->view.w > 0 && sd->view.h > 0) {
+        dx = (w * (sd->view.w - cx)) / sd->view.w;
+        dy = (h * (sd->view.h - cy)) / sd->view.h;
+    } else {
+        dx = 0;
+        dy = 0;
+    }
+
+    evas_object_image_fill_set(sd->backing_store, cx + dx, cy + dy, w, h);
+
+    if (sd->view.w > 0 && sd->view.h > 0) {
+        dx = ((sd->view.w - w) * cx) / sd->view.w;
+        dy = ((sd->view.h - h) * cy) / sd->view.h;
+    } else {
+        dx = 0;
+        dy = 0;
+    }
+    evas_object_move(clip, sd->view.x + dx, sd->view.y + dy);
+
+    if (cw < sd->view.w)
+        w = cw * scale;
+    if (ch < sd->view.h)
+        h = ch * scale;
+    evas_object_resize(clip, w, h);
+    return EINA_TRUE;
+}
+
+static void _ewk_view_single_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale)
+{
+    evas_object_image_smooth_scale_set(sd->backing_store, smooth_scale);
+}
+
+static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data *sd, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
+{
+    evas_object_image_alpha_set(sd->backing_store, a < 255);
+}
+
+/**
+ * Sets the smart class api using single backing store, enabling view
+ * to be inherited.
+ *
+ * @param api class definition to be set, all members with the
+ *        exception of Evas_Smart_Class->data may be overridden. Must
+ *        @b not be @c NULL.
+ *
+ * @note Evas_Smart_Class->data is used to implement type checking and
+ *       is not supposed to be changed/overridden. If you need extra
+ *       data for your smart class to work, just extend
+ *       Ewk_View_Smart_Class instead.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure (probably
+ *         version mismatch).
+ *
+ * @see ewk_view_base_smart_set()
+ */
+Eina_Bool ewk_view_single_smart_set(Ewk_View_Smart_Class *api)
+{
+    if (!ewk_view_base_smart_set(api))
+        return EINA_FALSE;
+
+    if (EINA_UNLIKELY(!_parent_sc.sc.add))
+        ewk_view_base_smart_set(&_parent_sc);
+
+    api->sc.resize = _ewk_view_single_smart_resize;
+
+    api->backing_store_add = _ewk_view_single_smart_backing_store_add;
+    api->scrolls_process = _ewk_view_single_smart_scrolls_process;
+    api->repaints_process = _ewk_view_single_smart_repaints_process;
+    api->zoom_weak_set = _ewk_view_single_smart_zoom_weak_set;
+    api->zoom_weak_smooth_scale_set = _ewk_view_single_smart_zoom_weak_smooth_scale_set;
+    api->bg_color_set = _ewk_view_single_smart_bg_color_set;
+
+    return EINA_TRUE;
+}
+
+static inline Evas_Smart *_ewk_view_single_smart_class_new(void)
+{
+    static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("Ewk_View_Single");
+    static Evas_Smart *smart = 0;
+
+    if (EINA_UNLIKELY(!smart)) {
+        ewk_view_single_smart_set(&api);
+        smart = evas_smart_class_new(&api.sc);
+    }
+
+    return smart;
+}
+
+/**
+ * Creates a new EFL WebKit View object.
+ *
+ * View objects are the recommended way to deal with EFL WebKit as it
+ * abstracts the complex pieces of the process.
+ *
+ * Each view is composed by a set of frames. The set has at least one
+ * frame, called 'main_frame'. See ewk_view_frame_main_get() and
+ * ewk_view_frame_focused_get().
+ *
+ * @param e canvas where to create the view object.
+ *
+ * @return view object or @c NULL if errors.
+ *
+ * @see ewk_view_uri_set()
+ */
+Evas_Object *ewk_view_single_add(Evas *e)
+{
+    return evas_object_smart_add(e, _ewk_view_single_smart_class_new());
+}
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 43d2d20..0affc25 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,867 @@
+2010-04-21  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        List item markers are not always updated after changes in the DOM.
+        https://bugs.webkit.org/show_bug.cgi?id=37060
+
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_marker_text_for_list_item): Add a private API to get the marker text for a list item.
+
+2010-04-21  Diego Escalante Urrelo  <descalante@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Evaluate and create tests for all the AtkRole's implemented by
+        WebKitGtk
+        https://bugs.webkit.org/show_bug.cgi?id=34449
+
+        Expand testatkroles to test ATK_ROLE_FORM.
+
+        * tests/testatkroles.c:
+        (test_webkit_atk_get_role_form):
+        (main):
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::committedLoad):
+        (WebKit::FrameLoaderClient::finishedLoading):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_encoding):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::chooseIconForFiles):
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2010-04-20  Martin Robinson  <mrobinson@webkit.org>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] Enable DOM clipboard and drag-and-drop access
+        https://bugs.webkit.org/show_bug.cgi?id=30623
+
+        Move most of the PasteboardHelper logic into WebCore. This helps
+        prepare for WebKit2 and leads to a clearer separation of concerns
+        between the WebKit and WebCore layers.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::collapseSelection): Converted this logic to a GClosure callback.
+        (WebKit::EditorClient::respondToChangedSelection): Collapse selection via GClosure now.
+        * WebCoreSupport/PasteboardHelperGtk.cpp: Moved most of the code to WebCore.
+        (WebKit::PasteboardHelperGtk::PasteboardHelperGtk): This constructor just initializes the target list.
+        (WebKit::PasteboardHelperGtk::~PasteboardHelperGtk): The destructor no longer needs to free the target list.
+        (WebKit::PasteboardHelperGtk::getIdForTargetType): Added, virtual method for getting target ids.
+        (WebKit::PasteboardHelperGtk::usePrimarySelectionClipboard): Added, virtual method for querying current clipboard.
+        * WebCoreSupport/PasteboardHelperGtk.h: Update method list to reflect reduced functionality.
+
+2010-04-19  Diego Escalante Urrelo  <descalante@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Evaluate and create tests for all the AtkRole's implemented by
+        WebKitGtk
+        https://bugs.webkit.org/show_bug.cgi?id=34449
+
+        Expand testatkroles to test ATK form roles.
+
+        * tests/testatkroles.c:
+        (test_webkit_atk_get_role_check_box):
+        (test_webkit_atk_get_role_entry):
+        (test_webkit_atk_get_role_label):
+        (test_webkit_atk_get_role_listbox):
+        (test_webkit_atk_get_role_password_text):
+        (test_webkit_atk_get_role_push_button):
+        (test_webkit_atk_get_role_radio_button):
+        (main):
+
+2010-04-19  Diego Escalante Urrelo  <descalante@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Evaluate and create tests for all the AtkRole's implemented by
+        WebKitGtk
+        https://bugs.webkit.org/show_bug.cgi?id=34449
+
+        Add testatkroles to test ATK non form roles.
+
+        * tests/testatkroles.c: Added.
+        (finish_loading):
+        (atk_roles_fixture_setup):
+        (atk_roles_fixture_teardown):
+        (get_child_and_test_role):
+        (test_webkit_atk_get_role_document_frame):
+        (test_webkit_atk_get_role_heading):
+        (test_webkit_atk_get_role_image):
+        (test_webkit_atk_get_role_link):
+        (test_webkit_atk_get_role_list_and_item):
+        (test_webkit_atk_get_role_paragraph):
+        (test_webkit_atk_get_role_section):
+        (test_webkit_atk_get_role_table):
+        (main):
+
+2010-04-17  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        We have to initialize the timer attribute after destroying it, not
+        doing it was causing crashes in some situations.
+
+        * webkit/webkitdownload.cpp:
+        (webkit_download_finalize):
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * webkit/webkitprivate.cpp:
+        (webkit_white_list_access_from_origin):
+        (webkit_reset_origin_access_white_lists):
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::committedLoad):
+        (WebKit::FrameLoaderClient::finishedLoading):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_encoding):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::committedLoad):
+        (WebKit::FrameLoaderClient::finishedLoading):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_encoding):
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2010-04-01  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] webkit_get_default_session() should make sure webkit_init() is called
+        https://bugs.webkit.org/show_bug.cgi?id=36754
+
+        Make sure global functions that do not require a WebKitWebView to
+        be created call webkit_init() before doing their job. Also add an
+        API test to check for that.
+
+        * tests/testglobals.c: Added.
+        (test_globals_default_session):
+        (main):
+        * webkit/webkitwebview.cpp:
+        (webkit_get_default_session):
+        (webkit_set_cache_model):
+        (webkit_get_cache_model):
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::cancelGeolocationPermissionRequestForFrame):
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ContextMenuClientGtk.cpp:
+        * WebCoreSupport/EditorClientGtk.cpp:
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        * gdom/ConvertToGCharPrivate.h:
+        * webkit/webkitdownload.cpp:
+        * webkit/webkithittestresult.cpp:
+        * webkit/webkitnetworkrequest.cpp:
+        * webkit/webkitprivate.h:
+        * webkit/webkitsecurityorigin.cpp:
+        * webkit/webkitwebdatabase.cpp:
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebhistoryitem.cpp:
+        (webkit_web_history_item_finalize):
+        (webkit_web_history_item_get_target):
+        * webkit/webkitwebresource.cpp:
+        * webkit/webkitwebsettings.cpp:
+        * webkit/webkitwebview.cpp:
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+
+2010-03-27  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        FrameLoader emits onload-event when handling
+        dispatchDidHandleOnloadEvents
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidHandleOnloadEvents):
+        implemented, now it emits onload-event signal
+        * webkit/webkitwebview.cpp: added onload-event signal
+
+2010-03-25  Sergio Villar Senín  <svillar@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        Added new API webkit_web_back_forward_list_clear. This function
+        clears the back forward list
+
+        [GTK] http/history tests are failing
+        https://bugs.webkit.org/show_bug.cgi?id=36173
+
+        * tests/testwebbackforwardlist.c:
+        (test_webkit_web_back_forward_list_clear):
+        (main): added new unit test for the new API
+        * webkit/webkitwebbackforwardlist.cpp:
+        (webkit_web_back_forward_list_clear):
+        * webkit/webkitwebbackforwardlist.h: new function that clears the
+        back forward list
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2010-03-23  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] Does not build with latest GTK+ development release
+        https://bugs.webkit.org/show_bug.cgi?id=36398
+
+        Fix building with newest GTK+ versions.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::windowRect):
+        (WebKit::ChromeClient::setWindowRect):
+        (WebKit::ChromeClient::unfocus):
+        (WebKit::ChromeClient::canTakeFocus):
+        (WebKit::ChromeClient::contentsSizeChanged):
+        * webkit/webkitprivate.cpp:
+        (currentToplevelCallback):
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_print_full):
+        (webkit_web_frame_print):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_grab_focus):
+        (webkit_web_view_focus_in_event):
+        (webkit_web_view_script_dialog):
+
+2010-03-18  Philip Chimento  <philip.chimento@gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        Setting the GObject WebKitWebView property 'window-features' to NULL
+        causes a crash. 
+        https://bugs.webkit.org/show_bug.cgi?id=36144
+
+        * tests/testwebview.c: Add unit test for this bug.
+        * webkit/webkitwebview.cpp: Don't allow the 'window-features' property
+        to be set to NULL.
+        * webkit/webkitwebwindowfeatures.cpp: 
+        (webkit_web_window_features_equal): Don't examine the members of either
+        web_window_features argument if either is NULL, just return that they
+        are not equal. Additionally, if they are the same object, return that 
+        they are equal.
+
+2010-03-16  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Update for 1.1.90 release.
+
+        * NEWS:
+
+2010-03-16  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Fix one too many empty lines in documentation of
+        window-obejct-cleared signal, which caused the documentation to be
+        rendered funny. Thanks to Martin Robinson for noticing.
+
+        * webkit/webkitwebview.cpp:
+
+2010-03-16  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Unreviewed. Add missing symbol to GeoLocation documentation
+        section.
+
+        * docs/webkitgtk-sections.txt:
+
+2010-03-16  Martin Robinson  <mrobinson@webkit.org>
+
+        Reviewed by Xan Lopez.
+
+        can't input korean into lower all input box except adress input box in webkit gtk launcher
+        https://bugs.webkit.org/show_bug.cgi?id=32290
+
+        Make the GTK+ EditorClient properly handle different types of input module
+        behavior such as commit and preedit signals that happen outside of key event
+        filtering and multiple times in a row. Filter keyup events as well as keydown
+        events and call gtk_im_context_focus_{in/out} when the WebView focus changes.
+
+        Added tests for this behavior to the GTK+ unit tests.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::imContextCommitted): Handle this signal properly when it happens outside of
+        key event filtering.
+        (WebKit::imContextPreeditChanged): Immediately update the preedit state and do not reject
+        empty preedits, so that cancellation works properly.
+        (WebKit::EditorClient::updatePendingComposition): Add this method, which handles the
+        situation where a commit signal happens when there is still a pending commit.
+        (WebKit::EditorClient::shouldBeginEditing): Clear pending composition state before editing
+        starts.
+        (WebKit::EditorClient::shouldEndEditing): Clear pending composition state before editing ends.
+        (WebKit::EditorClient::handleKeyboardEvent): No longer special case preedits which happen during
+        key event filtering. When confirming a pending composition use insertText instead of confirmComposition.
+        (WebKit::EditorClient::handleInputMethodKeydown):
+        * WebCoreSupport/EditorClientGtk.h: Make pendingComposition a member, so that multiple WebViews
+        do not share state.
+        (WebKit::EditorClient::webView): Added.
+        (WebKit::EditorClient::treatContextCommitAsKeyEvent): Added.
+        (WebKit::EditorClient::clearPendingComposition): Added.
+        * tests/testkeyevents.c:
+        (test_keypress_events_load_status_cb):
+        (map_event_cb):
+        (setup_keyevent_test):
+        (test_keypress_events):
+        (element_text_equal_to):
+        (test_ime_load_status_cb):
+        (test_ime):
+        (main):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_key_release_event):
+        (webkit_web_view_focus_in_event):
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        (WebKit::notifyWebViewDestroyed):
+        (WebKit::InspectorClient::InspectorClient):
+        (WebKit::InspectorClient::inspectorDestroyed):
+        (WebKit::InspectorClient::openInspectorFrontend):
+        (WebKit::InspectorClient::highlight):
+        (WebKit::InspectorClient::hideHighlight):
+        (WebKit::InspectorClient::populateSetting):
+        (WebKit::InspectorClient::storeSetting):
+        (WebKit::InspectorFrontendClient::InspectorFrontendClient):
+        (WebKit::InspectorFrontendClient::~InspectorFrontendClient):
+        (WebKit::InspectorFrontendClient::destroyInspectorWindow):
+        (WebKit::InspectorFrontendClient::localizedStringsURL):
+        (WebKit::InspectorFrontendClient::hiddenPanels):
+        (WebKit::InspectorFrontendClient::bringToFront):
+        (WebKit::InspectorFrontendClient::closeWindow):
+        (WebKit::InspectorFrontendClient::attachWindow):
+        (WebKit::InspectorFrontendClient::detachWindow):
+        (WebKit::InspectorFrontendClient::setAttachedWindowHeight):
+        (WebKit::InspectorFrontendClient::inspectedURLChanged):
+        * WebCoreSupport/InspectorClientGtk.h:
+
+2010-03-15  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35502
+        [Gtk] Objects of ATK_ROLE_TABLE should not implement AtkText
+
+        New test to be sure we do not accidentally implement AtkText for tables
+
+        * tests/testatk.c
+        (testWebkitAtkGetTextInTable):
+        (main):
+
+2010-03-09  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] GTK_WIDGET_IS_SENSITIVE is deprecated in GTK+ 2.20
+        https://bugs.webkit.org/show_bug.cgi?id=35909
+
+        * webkit/webkitwebview.cpp: GTK_WIDGET_IS_SENSITIVE has been
+        deprecated in gtk 2.20. Use gtk_widget_is_sensitive when available.
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Rubber-stamped by Kenneth Rohde Christiansen.
+
+        Misc documentation fixes. Fixes (almost) all warnings emitted by
+        the documentation build process. Only the broken references to JSC
+        objects remain.
+
+        * webkit/webkitsecurityorigin.cpp:
+        * webkit/webkitwebbackforwardlist.cpp:
+        * webkit/webkitwebdatasource.cpp:
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebhistoryitem.cpp:
+        * webkit/webkitwebinspector.cpp:
+        (webkit_web_inspector_class_init):
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_class_init):
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2010-03-09  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] testkeyevents doesn't stop if input event injection fails
+        https://bugs.webkit.org/show_bug.cgi?id=35922
+
+        * tests/testkeyevents.c:
+        (load_status_cb): Added a safeguard to exit from the test if the
+        input event injection failed.
+
+2010-03-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Unreviewed. Documentation control files update for 1.1.23.
+
+        * docs/webkitgtk-docs.sgml:
+
+2010-03-08  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [GTK] Unreviewed buildfix after r55688.
+
+        * webkit/webkitdownload.cpp:
+        (webkit_download_start):
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the gtk port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+
+2010-03-08  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove the now-redundant Settings fields for the Database
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        No new tests; this code isn't called.
+
+        * webkit/webkitwebview.cpp: Remove the calls into Settings.
+        (DNDContentsRequest::webkit_web_view_update_settings):
+        (DNDContentsRequest::webkit_web_view_settings_notify):
+
+2010-03-06  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Eric Seidel.
+
+        [Gtk] GEOLOCATION_POLICY_DECISION_CANCELLED unused
+        https://bugs.webkit.org/show_bug.cgi?id=35803
+
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_class_init):
+
+2010-03-03  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Gustavo Noronha.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [Gtk] Add 'enable-spatial-navigation' setting for toggle Spatial Navigation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=35701
+
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_set_property):
+        (webkit_web_settings_get_property):
+        (webkit_web_settings_copy):
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_update_settings):
+        (DNDContentsRequest::webkit_web_view_settings_notify):
+
+2010-03-03  Fridrich Strba  <fridrich.strba@bluewin.ch>
+
+        Reviewed by Xan Lopez.
+
+        Miscellaneous little fixes for the windows build of webkit-gtk
+        https://bugs.webkit.org/show_bug.cgi?id=35640
+
+        * webkit/webkitdownload.cpp: Windows headers define ERROR
+        which breaks the build. Undef ERROR if it is defined.
+
+2010-03-03  Philippe Normand  <pnormand@igalia.com>
+
+        Unreviewed, build fix after r55452.
+
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_settings_notify): added missing braces.
+
+2010-03-02  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Move database enable bit fully out of settings
+        This is stage one of a three-stage commit [webkit, then chromium, then
+        webkit again].  In this change I'm adding calls to
+        Database::setIsAvailable inside Settings::setDatabaseEnabled and
+        anywhere else that called it, and switching webkit fully over to using
+        that flag [added in a previous checkin].  Phase two will remove
+        Chromium's use of Settings for the Database, and phase three will remove
+        the Setting for the Database enable entirely, leaving only
+        Database::isAvailable/setIsAvailable.
+
+        No new tests; tested by existing storage tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35310
+
+        * webkit/webkitwebview.cpp:  Add calls to Database::setIsAvailable
+        (DNDContentsRequest::webkit_web_view_update_settings):
+        (DNDContentsRequest::webkit_web_view_settings_notify):
+
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        * WebCoreSupport/ChromeClientGtk.h:
+        * docs/webkitgtk-sections.txt:
+        * webkit/webkit.h:
+        * webkit/webkitdefines.h:
+        * webkit/webkitgeolocationpolicydecision.cpp: Added.
+        (webkit_geolocation_policy_decision_class_init):
+        (webkit_geolocation_policy_decision_init):
+        (webkit_geolocation_policy_decision_new):
+        (webkit_geolocation_policy_allow):
+        (webkit_geolocation_policy_deny):
+        * webkit/webkitgeolocationpolicydecision.h: Added.
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_class_init):
+        * webkitmarshal.list:
+
+2010-03-01  José Millán Soto  <jmillan@igalia.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [GTK] Right click does not activate text entry
+        https://bugs.webkit.org/show_bug.cgi?id=29177
+
+        Makes the frame handle the mouse click event before sending the
+        context menu event.
+
+        * webkit/webkitwebview.cpp:
+        (PopupMenuPositionFunc):
+        Function created to make the popup menu appear in the correct position, especially
+        when invoked from the keyboard.
+        (webkit_web_view_forward_context_menu_event):
+        Mouse click event is sent to frame before creating context menu,
+        PopupMenuPositionFunc used to determine the position where the menu should appear.
+        (webkit_web_view_popup_menu_handler):
+        Improved focused node position detection. Event button set to right button.
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * webkit/webkitwebview.cpp:
+        (DNDContentsRequest::webkit_web_view_apply_zoom_level):
+
+2010-03-01  Kalle Vahlman  <zuh@iki.fi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Queue a resize when either of the content dimensions change
+        https://bugs.webkit.org/show_bug.cgi?id=35489
+
+        The check for size changes only queued a resize if both of the content
+        dimensions change, leaving the widget size out-of-sync if eg. only the
+        width changes.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+
+2009-12-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Needs proper reporting of frame loader callbacks, in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=32170
+
+        Add new signal to report when the document load is finished for a
+        frame.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidFinishDocumentLoad):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_class_init):
+
+2010-02-26  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Complementary commit of r55300. Missing "notify::" to signal name.
+
+        * tests/testwebview.c:
+        (test_webkit_web_view_grab_focus):
+
+2010-02-26  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Xan Lopez.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [GTK] Make webkit_web_view_grab_focus to active focus controller.
+        https://bugs.webkit.org/show_bug.cgi?id=35402
+
+        When programatically setting focus to an element in an inner document,
+        calling "hasFocus()" from this document returns FALSE, because
+        document's FocusController is not activated. It does not happen
+        if |document| is the main document.
+
+        Making webkit_web_view_grab_focus to actually activate the FocusController,
+        fixes the issue.
+
+        * tests/testwebview.c:
+        (server_callback):
+        (test_webkit_web_view_grab_focus):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_grab_focus):
+
+2010-02-26  Alejandro G. Castro  <alex@igalia.com>
+
+        Unreviewed.
+
+        Reverted last patch (r55295), it causes problems with the frames.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+
+2010-02-19  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Some region checks in scroll are not required
+        https://bugs.webkit.org/show_bug.cgi?id=35142
+
+        Removes some of the operations checking the moved and invalidated
+        regions when scrolling, it is done already in
+        gdk_window_move_region.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+
+2010-02-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] crashed when destroying
+        https://bugs.webkit.org/show_bug.cgi?id=31271
+
+        NULL-check the page before relaying the focus out event, since
+        this might happen when destroying the widget without destroying
+        its parent, and we currently crash.
+
+        * tests/testwebview.c:
+        (delayed_destroy):
+        (test_webkit_web_view_destroy):
+        (main):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_focus_in_event):
+
+2010-02-24  Krzysztof Kotlenga <pocek@users.sf.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] Creation of a WebkitWebView widget is very slow
+        https://bugs.webkit.org/show_bug.cgi?id=30032
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::ignoreWordInSpellDocument): Change 'langs' to 'dicts'
+        to reflect the fact that the list just holds Enchant dictionaries now.
+        (WebKit::EditorClient::learnWord): Ditto.
+        (WebKit::EditorClient::checkSpellingOfString): Ditto.
+        (WebKit::EditorClient::getGuessesForWord): Ditto.
+        * webkit/webkitprivate.h: Remove the now unused SpellLanguage struct.
+        * webkit/webkitwebsettings.cpp: Change function call to reflect new
+        webkit_web_settings_get_enchant_dicts name.
+        (get_enchant_broker): Add this method which returns the enchant broker singleton.
+        (free_spell_checking_language): The list contents have changed, so change
+        the way each element is freed.
+        (webkit_web_settings_finalize): Change to reflect 'spell_checking_languages_list'
+        to 'enchant_dicts' member name change.
+        (webkit_web_settings_set_property): Use the broker singleton here instead of making
+        a new one for each language. The Enchant dictionary is now the list payload.
+        (webkit_web_settings_copy): More name-change updates.
+        (webkit_web_settings_get_enchant_dicts): Ditto.
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Fixes references to GOwnPtr and GRefPtr so the GTK+ port builds
+        again.
+        http://webkit.org/b/35084
+
+        * WebKit/gtk/webkit/webkitwebview.cpp:
+
+2010-02-23  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Gtk] Implement layoutTestController.numberOfPages
+        https://bugs.webkit.org/show_bug.cgi?id=35228
+
+        * webkit/webkitprivate.h:
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_number_of_pages):
+
+2010-02-23  José Millán Soto  <jmillan@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [Gtk] Server message not shown on http authentication
+        https://bugs.webkit.org/show_bug.cgi?id=34219
+
+        * webkit/webkitsoupauthdialog.c:
+        (show_auth_dialog):
+        Server message is displayed, messageLabel and message variables were
+        renamed to avoid confusion.
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebCoreSupport/ChromeClientGtk.h:
+        (WebKit::ChromeClient::cancelGeolocationPermissionRequestForFrame):
+
+2010-02-23  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Do not do unnecessary work during size_allocate.
+
+        FrameView::resize will already queue a layout, so there's no need
+        to force one ourselves. On top of that, the layout function
+        already adjusts the view size when needed, so there's no need to
+        do that manually either. No change in the layout tests or unit
+        tests after this.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_size_allocate):
+
+2010-02-22  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Update for release.
+
+        * NEWS:
+
+2010-02-22  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [Soup] loses information related to message flags when converting from/to Resource{Request,Response}
+        https://bugs.webkit.org/show_bug.cgi?id=35093
+
+        Update the flags that are stored in the request, when the response
+        is received.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidReceiveResponse):
+
+2010-02-20  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Unreviewed. Trivial fix - unnecessary variable got added by
+        mistake.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidReceiveResponse):
+
 2010-02-18  Diego Escalante Urrelo  <descalante@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS
index 4e5bc2c..45e3121 100644
--- a/WebKit/gtk/NEWS
+++ b/WebKit/gtk/NEWS
@@ -1,4 +1,61 @@
 =================
+WebKitGTK+ 1.1.90
+=================
+
+What's new in WebKitGTK+ 1.1.90?
+
+  - Display server side messages during HTTP auth, since they
+    sometimes contain important information for the authentication
+    process.
+  - Reduce creation time for WebKitWebView widgets by reusing
+    dictionary structs used for spell-checking instead of creating a
+    new one for each instance.
+  - Implement WebKitWebView::geolocation-policy-decision-requested,
+    emitted when a frame inside the WebView wants to get its position
+    through geolocation.
+  - Add WebKitWebSettings::enable-spatial-navigation to control
+    whether Spatial Navigation is enabled or not. Spatial Navigation
+    allows the user to move through the elements in a page using only
+    the keyboard; this is similar to caret browsing, but with less
+    focus on accessibility since instead of presenting the exact
+    layout of the page to the user a more "logical" way of browsing
+    through its contents is allowed. A specification of this feature
+    can be seen at
+    http://www.w3.org/TR/WICD/#current-focus-point-algorithm
+  - Add a new build option, --enable-fast-mobile-scrolling. At the
+    moment this only disables fixed backgrounds when there are no
+    other fixed elements in a page, since they generally make
+    scrolling very slow and thus are a big burden in some mobile
+    environments.
+  - GTK+ Input Method support has received a big overhaul, and most of
+    them should work pretty well now.
+  - All known redraw issues in the plugin support (especially with the
+    Java plugin) have been fixed.
+  - Various fixes to the MediaPlayer code to improve responsiveness
+    and avoid lagging on position reporting.
+  - Lots of bugfixes and other improvements.
+
+=================
+WebKitGTK+ 1.1.22
+=================
+
+What's new in WebKitGTK+ 1.1.22?
+
+  - Preliminary support for Java plugins. Basic functionality is
+    there, but there are still a few rough edges. Also newly
+    introduced is a new WebKitWebSetting, 'enable-java-applet', which
+    controls whether WebKit will recognize the non-standard <applet>
+    tag.
+  - Add WebKitWebSettings::auto-resize-window; when enabled, WebKit
+    will act upon the DOM methods that change the size and/or position
+    of the window containing a WebView (window.{moveTo, resizeTo,
+    moveBy, resizeBy}).
+  - Add WebKitWebSettings::enable-file-access-from-file-uris; when
+    enabled, each file:// URI will be assigned its own security
+    domain.
+  - Lots of bugfixes, especially in the PageCache support.
+
+=================
 WebKitGTK+ 1.1.21
 =================
 
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 74f5e07..8a1d48b 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -28,11 +28,13 @@
 #include "FileChooser.h"
 #include "FloatRect.h"
 #include "FrameLoadRequest.h"
+#include "GtkVersioning.h"
 #include "IntRect.h"
 #include "PlatformString.h"
-#include "CString.h"
 #include "HitTestResult.h"
+#include "Icon.h"
 #include "KURL.h"
+#include "webkitgeolocationpolicydecision.h"
 #include "webkitwebview.h"
 #include "webkitnetworkrequest.h"
 #include "webkitprivate.h"
@@ -41,6 +43,7 @@
 #if ENABLE(DATABASE)
 #include "DatabaseTracker.h"
 #endif
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
@@ -64,11 +67,7 @@
 FloatRect ChromeClient::windowRect()
 {
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_toplevel(window)) {
-#else
-    if (GTK_WIDGET_TOPLEVEL(window)) {
-#endif
         gint left, top, width, height;
         gtk_window_get_position(GTK_WINDOW(window), &left, &top);
         gtk_window_get_size(GTK_WINDOW(window), &width, &height);
@@ -97,11 +96,7 @@
         return;
 
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_toplevel(window)) {
-#else
-    if (GTK_WIDGET_TOPLEVEL(window)) {
-#endif
         gtk_window_move(GTK_WINDOW(window), intrect.x(), intrect.y());
         gtk_window_resize(GTK_WINDOW(window), intrect.width(), intrect.height());
     }
@@ -127,11 +122,7 @@
 void ChromeClient::unfocus()
 {
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_toplevel(window))
-#else
-    if (GTK_WIDGET_TOPLEVEL(window))
-#endif
         gtk_window_set_focus(GTK_WINDOW(window), NULL);
 }
 
@@ -259,11 +250,7 @@
 
 bool ChromeClient::canTakeFocus(FocusDirection)
 {
-#if GTK_CHECK_VERSION(2, 18, 0)
     return gtk_widget_get_can_focus(GTK_WIDGET(m_webView));
-#else
-    return GTK_WIDGET_CAN_FOCUS(m_webView);
-#endif
 }
 
 void ChromeClient::takeFocus(FocusDirection)
@@ -341,20 +328,29 @@
     return IntRect();
 }
 
-void ChromeClient::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void ChromeClient::invalidateWindow(const IntRect&, bool)
 {
-    GdkRectangle rect = windowRect;
+    notImplemented();
+}
+
+void ChromeClient::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+{
+    GdkRectangle rect = updateRect;
     GdkWindow* window = GTK_WIDGET(m_webView)->window;
 
     if (window) {
-        if (contentChanged)
-            gdk_window_invalidate_rect(window, &rect, FALSE);
+        gdk_window_invalidate_rect(window, &rect, FALSE);
         // We don't currently do immediate updates since they delay other UI elements.
         //if (immediate)
         //    gdk_window_process_updates(window, FALSE);
     }
 }
 
+void ChromeClient::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
+{
+    invalidateContentsAndWindow(updateRect, immediate);
+}
+
 void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
     GdkWindow* window = GTK_WIDGET(m_webView)->window;
@@ -429,9 +425,9 @@
     // We need to queue a resize request only if the size changed,
     // otherwise we get into an infinite loop!
     GtkWidget* widget = GTK_WIDGET(m_webView);
-    if (GTK_WIDGET_REALIZED(widget) &&
-        (widget->requisition.height != size.height()) &&
-        (widget->requisition.width != size.width()))
+    if (gtk_widget_get_realized(widget)
+        && (widget->requisition.height != size.height())
+        || (widget->requisition.width != size.width()))
         gtk_widget_queue_resize_no_redraw(widget);
 }
 
@@ -563,10 +559,9 @@
     gtk_widget_destroy(dialog);
 }
 
-void ChromeClient::iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>)
+void ChromeClient::chooseIconForFiles(const Vector<WebCore::String>& filenames, WebCore::FileChooser* chooser)
 {
-    // FIXME: Move the code in Icon::createIconForFiles() here.
-    notImplemented();
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 bool ChromeClient::setCursor(PlatformCursorHandle)
@@ -575,10 +570,24 @@
     return false;
 }
 
-void ChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
 {
-    // See the comment in WebCore/page/ChromeClient.h
-    notImplemented();
+    WebKitWebFrame* webFrame = kit(frame);
+    WebKitWebView* webView = getViewFromFrame(webFrame);
+
+    WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation);
+
+    gboolean isHandled = FALSE;
+    g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled);
+    if (!isHandled)
+        webkit_geolocation_policy_deny(policyDecision);
+}
+
+void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame, WebCore::Geolocation*)
+{
+    WebKitWebFrame* webFrame = kit(frame);
+    WebKitWebView* webView = getViewFromFrame(webFrame);
+    g_signal_emit_by_name(webView, "geolocation-policy-decision-cancelled", webFrame);
 }
 
 }
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index 7e407d3..46d015e 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -87,8 +87,11 @@
 
         virtual WebCore::IntRect windowResizerRect() const;
 
-        virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+        virtual void invalidateWindow(const WebCore::IntRect&, bool);
+        virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+        virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
         virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
+
         virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
         virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
         virtual PlatformPageClient platformPageClient() const;
@@ -107,7 +110,7 @@
         virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
 #endif
         virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
-        virtual void iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>);
+        virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*);
 
         virtual void formStateDidChange(const WebCore::Node*) { }
 
@@ -117,6 +120,7 @@
 
         virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
         virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+        virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
 
     private:
         WebKitWebView* m_webView;
diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
index bf47ca8..5c1bc0b 100644
--- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
@@ -21,10 +21,10 @@
 #include "ContextMenu.h"
 #include "ContextMenuClientGtk.h"
 
-#include "CString.h"
 #include "HitTestResult.h"
 #include "KURL.h"
 #include "NotImplemented.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 #include <glib-object.h>
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 02d1a53..51172b4 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -4,6 +4,7 @@
  *  Copyright (C) 2009 Diego Escalante Urrelo <diegoe@gnome.org>
  *  Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
  *  Copyright (C) 2009, Igalia S.L.
+ *  Copyright (C) 2010, Martin Robinson <mrobinson@webkit.org>
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -23,7 +24,6 @@
 #include "config.h"
 #include "EditorClientGtk.h"
 
-#include "CString.h"
 #include "DataObjectGtk.h"
 #include "EditCommand.h"
 #include "Editor.h"
@@ -32,14 +32,16 @@
 #include "FocusController.h"
 #include "Frame.h"
 #include <glib.h>
-#include "KeyboardCodes.h"
 #include "KeyboardEvent.h"
+#include "markup.h"
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PasteboardHelperGtk.h"
 #include "PlatformKeyboardEvent.h"
-#include "markup.h"
+#include "WindowsKeyboardCodes.h"
+#include "webkitmarshal.h"
 #include "webkitprivate.h"
+#include <wtf/text/CString.h>
 
 // Arbitrary depth limit for the undo stack, to keep it from using
 // unbounded memory.  This is the maximum number of distinct undoable
@@ -51,40 +53,48 @@
 
 namespace WebKit {
 
-static gchar* pendingComposition = 0;
-static gchar* pendingPreedit = 0;
+static void imContextCommitted(GtkIMContext* context, const gchar* compositionString, EditorClient* client)
+{
+    Frame* frame = core(client->webView())->focusController()->focusedOrMainFrame();
+    if (!frame || !frame->editor()->canEdit())
+        return;
 
-static void setPendingComposition(gchar* newComposition)
-{
-    g_free(pendingComposition);
-    pendingComposition = newComposition;
-}
+    // If this signal fires during a keydown event when we are not in the middle
+    // of a composition, then treat this 'commit' as a normal key event and just
+    // change the editable area right before the keypress event.
+    if (client->treatContextCommitAsKeyEvent()) {
+        client->updatePendingComposition(compositionString);
+        return;
+    }
 
-static void setPendingPreedit(gchar* newPreedit)
-{
-    g_free(pendingPreedit);
-    pendingPreedit = newPreedit;
-}
-
-static void clearPendingIMData()
-{
-    setPendingComposition(0);
-    setPendingPreedit(0);
-}
-static void imContextCommitted(GtkIMContext* context, const gchar* str, EditorClient* client)
-{
-    // This signal will fire during a keydown event. We want the contents of the
-    // field to change right before the keyup event, so we wait until then to actually
-    // commit this composition.
-    setPendingComposition(g_strdup(str));
+    frame->editor()->confirmComposition(String::fromUTF8(compositionString));
+    client->clearPendingComposition();
 }
 
 static void imContextPreeditChanged(GtkIMContext* context, EditorClient* client)
 {
+    Frame* frame = core(client->webView())->focusController()->focusedOrMainFrame();
+    if (!frame || !frame->editor()->canEdit())
+        return;
+
     // We ignore the provided PangoAttrList for now.
-    gchar* newPreedit = 0;
-    gtk_im_context_get_preedit_string(context, &newPreedit, NULL, NULL);
-    setPendingPreedit(newPreedit);
+    GOwnPtr<gchar> newPreedit(0);
+    gtk_im_context_get_preedit_string(context, &newPreedit.outPtr(), 0, 0);
+
+    String preeditString = String::fromUTF8(newPreedit.get());
+    Vector<CompositionUnderline> underlines;
+    underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
+    frame->editor()->setComposition(preeditString, underlines, 0, 0);
+}
+
+void EditorClient::updatePendingComposition(const gchar* newComposition)
+{
+    // The IMContext may signal more than one completed composition in a row,
+    // in which case we want to append them, rather than overwrite the old one.
+    if (!m_pendingComposition)
+        m_pendingComposition.set(g_strdup(newComposition));
+    else
+        m_pendingComposition.set(g_strconcat(m_pendingComposition.get(), newComposition, NULL));
 }
 
 void EditorClient::setInputMethodState(bool active)
@@ -139,7 +149,7 @@
 
 bool EditorClient::shouldBeginEditing(WebCore::Range*)
 {
-    clearPendingIMData();
+    clearPendingComposition();
 
     notImplemented();
     return true;
@@ -147,7 +157,7 @@
 
 bool EditorClient::shouldEndEditing(WebCore::Range*)
 {
-    clearPendingIMData();
+    clearPendingComposition();
 
     notImplemented();
     return true;
@@ -187,6 +197,23 @@
     notImplemented();
 }
 
+static WebKitWebView* viewSettingClipboard = 0;
+static void collapseSelection(GtkClipboard* clipboard, WebKitWebView* webView)
+{
+    if (viewSettingClipboard && viewSettingClipboard == webView)
+        return;
+
+    WebCore::Page* corePage = core(webView);
+    if (!corePage || !corePage->focusController())
+        return;
+
+    Frame* frame = corePage->focusController()->focusedOrMainFrame();
+
+    // Collapse the selection without clearing it
+    ASSERT(frame);
+    frame->selection()->setBase(frame->selection()->extent(), frame->selection()->affinity());
+}
+
 void EditorClient::respondToChangedSelection()
 {
     WebKitWebViewPrivate* priv = m_webView->priv;
@@ -206,7 +233,12 @@
     if (targetFrame->selection()->isRange()) {
         dataObject->clear();
         dataObject->setRange(targetFrame->selection()->toNormalizedRange());
-        pasteboardHelperInstance()->writeClipboardContents(clipboard, m_webView);
+
+        viewSettingClipboard = m_webView;
+        GClosure* callback = g_cclosure_new_object(G_CALLBACK(collapseSelection), G_OBJECT(m_webView));
+        g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID);
+        pasteboardHelperInstance()->writeClipboardContents(clipboard, callback);
+        viewSettingClipboard = 0;
     }
 #endif
 
@@ -466,8 +498,12 @@
             if (!command.isTextInsertion() && command.execute(event))
                 event->setDefaultHandled();
 
+            clearPendingComposition();
             return;
-        } else if (command.execute(event)) {
+        }
+
+        if (command.execute(event)) {
+            clearPendingComposition();
             event->setDefaultHandled();
             return;
         }
@@ -478,25 +514,14 @@
     // be reflected in the contents of the field until the keyup DOM event.
     if (event->type() == eventNames().keypressEvent) {
 
-        if (pendingComposition) {
-            String compositionString = String::fromUTF8(pendingComposition);
-            frame->editor()->confirmComposition(compositionString);
-
-            clearPendingIMData();
-            event->setDefaultHandled();
-
-        } else if (pendingPreedit) {
-            String preeditString = String::fromUTF8(pendingPreedit);
-
-            // Don't use an empty preedit as it will destroy the current
-            // selection, even if the composition is cancelled or fails later on.
-            if (!preeditString.isEmpty()) {
-                Vector<CompositionUnderline> underlines;
-                underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
-                frame->editor()->setComposition(preeditString, underlines, 0, 0);
-            }
-
-            clearPendingIMData();
+        // If we have a pending composition at this point, it happened while
+        // filtering a keypress, so we treat it as a normal text insertion.
+        // This will also ensure that if the keypress event handler changed the
+        // currently focused node, the text is still inserted into the original
+        // node (insertText() has this logic, but confirmComposition() does not).
+        if (m_pendingComposition) {
+            frame->editor()->insertText(String::fromUTF8(m_pendingComposition.get()), event);
+            clearPendingComposition();
             event->setDefaultHandled();
 
         } else {
@@ -520,15 +545,53 @@
     if (!targetFrame || !targetFrame->editor()->canEdit())
         return;
 
-    // TODO: We need to decide which filtered keystrokes should be treated as IM
-    // events and which should not.
     WebKitWebViewPrivate* priv = m_webView->priv;
-    gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey());
+
+
+    // Some IM contexts (e.g. 'simple') will act as if they filter every
+    // keystroke and just issue a 'commit' signal during handling. In situations
+    // where the 'commit' signal happens during filtering and there is no active
+    // composition, act as if the keystroke was not filtered. The one exception to
+    // this is when the keyval parameter of the GdkKeyEvent is 0, which is often
+    // a key event sent by the IM context for committing the current composition.
+
+    // Here is a typical sequence of events for the 'simple' context:
+    // 1. GDK key press event -> webkit_web_view_key_press_event
+    // 2. Keydown event -> EditorClient::handleInputMethodKeydown
+    //     gtk_im_context_filter_keypress returns true, but there is a pending
+    //     composition so event->preventDefault is not called (below).
+    // 3. Keydown event bubbles through the DOM
+    // 4. Keydown event -> EditorClient::handleKeyboardEvent
+    //     No action taken.
+    // 4. GDK key release event -> webkit_web_view_key_release_event
+    // 5. gtk_im_context_filter_keypress is called on the release event.
+    //     Simple does not filter most key releases, so the event continues.
+    // 6. Keypress event bubbles through the DOM.
+    // 7. Keypress event -> EditorClient::handleKeyboardEvent
+    //     pending composition is inserted.
+    // 8. Keyup event bubbles through the DOM.
+    // 9. Keyup event -> EditorClient::handleKeyboardEvent
+    //     No action taken.
+
+    // There are two situations where we do filter the keystroke:
+    // 1. The IMContext instructed us to filter and we have no pending composition.
+    // 2. The IMContext did not instruct us to filter, but the keystroke caused a
+    //    composition in progress to finish. It seems that sometimes SCIM will finish
+    //    a composition and not mark the keystroke as filtered.
+    m_treatContextCommitAsKeyEvent = (!targetFrame->editor()->hasComposition())
+         && event->keyEvent()->gdkEventKey()->keyval;
+    clearPendingComposition();
+    if ((gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey()) && !m_pendingComposition)
+        || (!m_treatContextCommitAsKeyEvent && !targetFrame->editor()->hasComposition()))
+        event->preventDefault();
+
+    m_treatContextCommitAsKeyEvent = false;
 }
 
 EditorClient::EditorClient(WebKitWebView* webView)
     : m_isInRedo(false)
     , m_webView(webView)
+    , m_treatContextCommitAsKeyEvent(false)
 {
     WebKitWebViewPrivate* priv = m_webView->priv;
     g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this);
@@ -571,30 +634,30 @@
 
 void EditorClient::ignoreWordInSpellDocument(const String& text)
 {
-    GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
+    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
 
-    for (; langs; langs = langs->next) {
-        SpellLanguage* lang = static_cast<SpellLanguage*>(langs->data);
+    for (; dicts; dicts = dicts->next) {
+        EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
 
-        enchant_dict_add_to_session(lang->speller, text.utf8().data(), -1);
+        enchant_dict_add_to_session(dict, text.utf8().data(), -1);
     }
 }
 
 void EditorClient::learnWord(const String& text)
 {
-    GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
+    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
 
-    for (; langs; langs = langs->next) {
-        SpellLanguage* lang = static_cast<SpellLanguage*>(langs->data);
+    for (; dicts; dicts = dicts->next) {
+        EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
 
-        enchant_dict_add_to_personal(lang->speller, text.utf8().data(), -1);
+        enchant_dict_add_to_personal(dict, text.utf8().data(), -1);
     }
 }
 
 void EditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
 {
-    GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
-    if (!langs)
+    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
+    if (!dicts)
         return;
 
     gchar* ctext = g_utf16_to_utf8(const_cast<gunichar2*>(text), length, 0, 0, 0);
@@ -623,8 +686,8 @@
             // check characters twice.
             i = end;
 
-            for (; langs; langs = langs->next) {
-                SpellLanguage* lang = static_cast<SpellLanguage*>(langs->data);
+            for (; dicts; dicts = dicts->next) {
+                EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
                 gchar* cstart = g_utf8_offset_to_pointer(ctext, start);
                 gint bytes = static_cast<gint>(g_utf8_offset_to_pointer(ctext, end) - cstart);
                 gchar* word = g_new0(gchar, bytes+1);
@@ -632,7 +695,7 @@
 
                 g_utf8_strncpy(word, cstart, end - start);
 
-                result = enchant_dict_check(lang->speller, word, -1);
+                result = enchant_dict_check(dict, word, -1);
                 g_free(word);
                 if (result) {
                     *misspellingLocation = start;
@@ -686,21 +749,21 @@
 
 void EditorClient::getGuessesForWord(const String& word, WTF::Vector<String>& guesses)
 {
-    GSList* langs = webkit_web_settings_get_spell_languages(m_webView);
+    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
     guesses.clear();
 
-    for (; langs; langs = langs->next) {
+    for (; dicts; dicts = dicts->next) {
         size_t numberOfSuggestions;
         size_t i;
 
-        SpellLanguage* lang = static_cast<SpellLanguage*>(langs->data);
-        gchar** suggestions = enchant_dict_suggest(lang->speller, word.utf8().data(), -1, &numberOfSuggestions);
+        EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
+        gchar** suggestions = enchant_dict_suggest(dict, word.utf8().data(), -1, &numberOfSuggestions);
 
         for (i = 0; i < numberOfSuggestions && i < 10; i++)
             guesses.append(String::fromUTF8(suggestions[i]));
 
         if (numberOfSuggestions > 0)
-            enchant_dict_free_suggestions(lang->speller, suggestions);
+            enchant_dict_free_suggestions(dict, suggestions);
     }
 }
 
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
index 9292651..825c146 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
@@ -2,6 +2,7 @@
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2010 Martin Robinson <mrobinson@webkit.org>
  *
  * All rights reserved.
  *
@@ -34,8 +35,10 @@
 
 #include <wtf/Deque.h>
 #include <wtf/Forward.h>
+#include <wtf/gobject/GOwnPtr.h>
 
 typedef struct _WebKitWebView WebKitWebView;
+typedef char gchar;
 
 namespace WebCore {
     class Page;
@@ -53,6 +56,11 @@
     public:
         EditorClient(WebKitWebView*);
         ~EditorClient();
+        WebKitWebView* webView() { return m_webView; }
+        bool treatContextCommitAsKeyEvent() { return m_treatContextCommitAsKeyEvent; }
+        void clearPendingComposition() { m_pendingComposition.set(0); }
+        bool hasPendingComposition() { return m_pendingComposition; }
+        void updatePendingComposition(const char*);
 
         // from EditorClient
         virtual void pageDestroyed();
@@ -120,6 +128,8 @@
 
     private:
         WebKitWebView* m_webView;
+        bool m_treatContextCommitAsKeyEvent;
+        GOwnPtr<gchar> m_pendingComposition;
     };
 }
 
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index f900f05..27ff3c8 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -52,7 +52,6 @@
 #include "RenderPart.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
-#include "CString.h"
 #include "ProgressTracker.h"
 #include "JSDOMBinding.h"
 #include "ScriptController.h"
@@ -64,6 +63,7 @@
 #include "webkitwebnavigationaction.h"
 #include "webkitwebpolicydecision.h"
 #include "webkitwebview.h"
+#include <wtf/text/CString.h>
 
 #include <JavaScriptCore/APICast.h>
 #include <gio/gio.h>
@@ -149,7 +149,7 @@
             encoding = loader->response().textEncodingName();
 
         FrameLoader* frameLoader = loader->frameLoader();
-        frameLoader->setEncoding(encoding, userChosen);
+        frameLoader->writer()->setEncoding(encoding, userChosen);
         if (data)
             frameLoader->addData(data, length);
 
@@ -276,8 +276,12 @@
     delete this;
 }
 
-void FrameLoaderClient::dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long, const ResourceResponse& response)
+void FrameLoaderClient::dispatchDidReceiveResponse(WebCore::DocumentLoader* loader, unsigned long, const ResourceResponse& response)
 {
+    // Update our knowledge of request soup flags - some are only set
+    // after the request is done.
+    loader->request().setSoupMessageFlags(response.soupMessageFlags());
+
     m_response = response;
 }
 
@@ -658,7 +662,7 @@
 
 void FrameLoaderClient::dispatchDidHandleOnloadEvents()
 {
-    notImplemented();
+    g_signal_emit_by_name(getViewFromFrame(m_frame), "onload-event", m_frame);
 }
 
 void FrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
@@ -784,7 +788,8 @@
 
 void FrameLoaderClient::dispatchDidFinishDocumentLoad()
 {
-    notImplemented();
+    WebKitWebView* webView = getViewFromFrame(m_frame);
+    g_signal_emit_by_name(webView, "document-load-finished", m_frame);
 }
 
 void FrameLoaderClient::dispatchDidFirstLayout()
@@ -863,7 +868,7 @@
 {
     if (!m_pluginView) {
         FrameLoader* loader = documentLoader->frameLoader();
-        loader->setEncoding(m_response.textEncodingName(), false);
+        loader->writer()->setEncoding(m_response.textEncodingName(), false);
     } else {
         m_pluginView->didFinishLoading();
         m_pluginView = 0;
@@ -940,11 +945,6 @@
     notImplemented();
 }
 
-void FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
-{
-    notImplemented();
-}
-
 bool FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
 {
     notImplemented();
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index d5db6d0..3819b9f 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -69,7 +69,6 @@
         virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long  identifier);
         virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long  identifier, const WebCore::ResourceError&);
         virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
-        virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const WebCore::ScriptString&);
 
         virtual void dispatchDidHandleOnloadEvents();
         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index 99bc627..317a058 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -22,76 +22,49 @@
 #include "webkitwebview.h"
 #include "webkitwebinspector.h"
 #include "webkitprivate.h"
-#include "CString.h"
 #include "InspectorController.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
 namespace WebKit {
 
-static void notifyWebViewDestroyed(WebKitWebView* webView, InspectorClient* inspectorClient)
+static void notifyWebViewDestroyed(WebKitWebView* webView, InspectorFrontendClient* inspectorFrontendClient)
 {
-    inspectorClient->webViewDestroyed();
+    inspectorFrontendClient->destroyInspectorWindow();
 }
 
 InspectorClient::InspectorClient(WebKitWebView* webView)
-    : m_webView(0)
-    , m_inspectedWebView(webView)
-    , m_webInspector(0)
+    : m_inspectedWebView(webView)
 {}
 
 void InspectorClient::inspectorDestroyed()
 {
-    if (m_webInspector)
-        g_object_unref(m_webInspector);
-
     delete this;
 }
 
-void InspectorClient::webViewDestroyed()
+void InspectorClient::openInspectorFrontend(InspectorController* controller)
 {
-    m_webView = 0;
-    core(m_inspectedWebView)->inspectorController()->pageDestroyed();
-
-    // createPage will be called again, if the user chooses to inspect
-    // something else, and the inspector will be referenced again,
-    // there.
-    g_object_unref(m_webInspector);
-    m_webInspector = 0;
-}
-
-Page* InspectorClient::createPage()
-{
-    if (m_webView) {
-        gboolean handled = FALSE;
-        g_signal_emit_by_name(m_webInspector, "destroy", &handled);
-
-        /* we can now dispose our own reference */
-        g_object_unref(m_webInspector);
-    }
-
     // This g_object_get will ref the inspector. We're not doing an
     // unref if this method succeeds because the inspector object must
     // be alive even after the inspected WebView is destroyed - the
     // close-window and destroy signals still need to be
     // emitted.
-    WebKitWebInspector* webInspector;
+    WebKitWebInspector* webInspector = 0;
     g_object_get(m_inspectedWebView, "web-inspector", &webInspector, NULL);
-    m_webInspector = webInspector;
+    ASSERT(webInspector);
 
-    g_signal_emit_by_name(m_webInspector, "inspect-web-view", m_inspectedWebView, &m_webView);
+    WebKitWebView* inspectorWebView = 0;
+    g_signal_emit_by_name(webInspector, "inspect-web-view", m_inspectedWebView, &inspectorWebView);
 
-    if (!m_webView) {
-        g_object_unref(m_webInspector);
-        return 0;
+    if (!inspectorWebView) {
+        g_object_unref(webInspector);
+        return;
     }
 
-    webkit_web_inspector_set_web_view(m_webInspector, m_webView);
-
-    g_signal_connect(m_webView, "destroy",
-                     G_CALLBACK(notifyWebViewDestroyed), (gpointer)this);
+    webkit_web_inspector_set_web_view(webInspector, inspectorWebView);
 
     GOwnPtr<gchar> inspectorURI;
 
@@ -103,14 +76,73 @@
     } else
         inspectorURI.set(g_filename_to_uri(DATA_DIR"/webkit-1.0/webinspector/inspector.html", NULL, NULL));
 
-    webkit_web_view_load_uri(m_webView, inspectorURI.get());
+    webkit_web_view_load_uri(inspectorWebView, inspectorURI.get());
 
-    gtk_widget_show(GTK_WIDGET(m_webView));
+    gtk_widget_show(GTK_WIDGET(inspectorWebView));
 
-    return core(m_webView);
+    Page* inspectorPage = core(inspectorWebView);
+    inspectorPage->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClient(m_inspectedWebView, inspectorWebView, webInspector, inspectorPage));
 }
 
-String InspectorClient::localizedStringsURL()
+void InspectorClient::highlight(Node* node)
+{
+    notImplemented();
+}
+
+void InspectorClient::hideHighlight()
+{
+    notImplemented();
+}
+
+void InspectorClient::populateSetting(const String& key, String* value)
+{
+    notImplemented();
+}
+
+void InspectorClient::storeSetting(const String& key, const String& value)
+{
+    notImplemented();
+}
+
+
+bool destroyed = TRUE;
+
+InspectorFrontendClient::InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, Page* inspectorPage)
+    : InspectorFrontendClientLocal(core(inspectedWebView)->inspectorController(), inspectorPage)
+    , m_inspectorWebView(inspectorWebView)
+    , m_inspectedWebView(inspectedWebView)
+    , m_webInspector(webInspector)
+{
+    g_signal_connect(m_inspectorWebView, "destroy",
+                     G_CALLBACK(notifyWebViewDestroyed), (gpointer)this);
+}
+
+InspectorFrontendClient::~InspectorFrontendClient()
+{
+    ASSERT(!m_webInspector);
+}
+
+void InspectorFrontendClient::destroyInspectorWindow()
+{
+    if (!m_webInspector)
+        return;
+    WebKitWebInspector* webInspector = m_webInspector;
+    m_webInspector = 0;
+
+    g_signal_handlers_disconnect_by_func(m_inspectorWebView, (gpointer)notifyWebViewDestroyed, (gpointer)this);
+    m_inspectorWebView = 0;
+
+    core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
+
+    gboolean handled = FALSE;
+    g_signal_emit_by_name(webInspector, "close-window", &handled);
+    ASSERT(handled);
+
+    /* we should now dispose our own reference */
+    g_object_unref(webInspector);
+}
+
+String InspectorFrontendClient::localizedStringsURL()
 {
     GOwnPtr<gchar> URL;
 
@@ -126,89 +158,56 @@
     return String::fromUTF8(URL.get());
 }
 
-String InspectorClient::hiddenPanels()
+String InspectorFrontendClient::hiddenPanels()
 {
     notImplemented();
     return String();
 }
 
-void InspectorClient::showWindow()
+void InspectorFrontendClient::bringToFront()
 {
-    if (!m_webView)
+    if (!m_inspectorWebView)
         return;
 
     gboolean handled = FALSE;
     g_signal_emit_by_name(m_webInspector, "show-window", &handled);
-
-    core(m_inspectedWebView)->inspectorController()->setWindowVisible(true);
 }
 
-void InspectorClient::closeWindow()
+void InspectorFrontendClient::closeWindow()
 {
-    if (!m_webView)
-        return;
-
-    gboolean handled = FALSE;
-    g_signal_emit_by_name(m_webInspector, "close-window", &handled);
-
-    core(m_inspectedWebView)->inspectorController()->setWindowVisible(false);
+    destroyInspectorWindow();
 }
 
-void InspectorClient::attachWindow()
+void InspectorFrontendClient::attachWindow()
 {
-    if (!m_webView)
+    if (!m_inspectorWebView)
         return;
 
     gboolean handled = FALSE;
     g_signal_emit_by_name(m_webInspector, "attach-window", &handled);
 }
 
-void InspectorClient::detachWindow()
+void InspectorFrontendClient::detachWindow()
 {
-    if (!m_webView)
+    if (!m_inspectorWebView)
         return;
 
     gboolean handled = FALSE;
     g_signal_emit_by_name(m_webInspector, "detach-window", &handled);
 }
 
-void InspectorClient::setAttachedWindowHeight(unsigned height)
+void InspectorFrontendClient::setAttachedWindowHeight(unsigned height)
 {
     notImplemented();
 }
 
-void InspectorClient::highlight(Node* node)
+void InspectorFrontendClient::inspectedURLChanged(const String& newURL)
 {
-    notImplemented();
-}
-
-void InspectorClient::hideHighlight()
-{
-    notImplemented();
-}
-
-void InspectorClient::inspectedURLChanged(const String& newURL)
-{
-    if (!m_webView)
+    if (!m_inspectorWebView)
         return;
 
     webkit_web_inspector_set_inspected_uri(m_webInspector, newURL.utf8().data());
 }
 
-void InspectorClient::inspectorWindowObjectCleared()
-{
-    notImplemented();
-}
-
-void InspectorClient::populateSetting(const String& key, String* value)
-{
-    notImplemented();
-}
-
-void InspectorClient::storeSetting(const String& key, const String& value)
-{
-    notImplemented();
-}
-
 }
 
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
index 297fd8f..cdb5375 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
@@ -30,6 +30,7 @@
 #define InspectorClientGtk_h
 
 #include "InspectorClient.h"
+#include "InspectorFrontendClientLocal.h"
 #include "webkitwebview.h"
 #include "webkitwebinspector.h"
 
@@ -46,15 +47,30 @@
         InspectorClient(WebKitWebView* webView);
 
         virtual void inspectorDestroyed();
-        void webViewDestroyed();
 
-        virtual WebCore::Page* createPage();
+        virtual void openInspectorFrontend(WebCore::InspectorController*);
+
+        virtual void highlight(WebCore::Node*);
+        virtual void hideHighlight();
+
+        virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
+        virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
+
+    private:
+        WebKitWebView* m_inspectedWebView;
+    };
+
+    class InspectorFrontendClient : public WebCore::InspectorFrontendClientLocal {
+    public:
+        InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, WebCore::Page* inspectorPage);
+
+        void destroyInspectorWindow();
 
         virtual WebCore::String localizedStringsURL();
 
         virtual WebCore::String hiddenPanels();
 
-        virtual void showWindow();
+        virtual void bringToFront();
         virtual void closeWindow();
 
         virtual void attachWindow();
@@ -62,17 +78,12 @@
 
         virtual void setAttachedWindowHeight(unsigned height);
 
-        virtual void highlight(WebCore::Node*);
-        virtual void hideHighlight();
         virtual void inspectedURLChanged(const WebCore::String& newURL);
 
-        virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
-        virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
-
-        virtual void inspectorWindowObjectCleared();
-
     private:
-        WebKitWebView* m_webView;
+        virtual ~InspectorFrontendClient();
+
+        WebKitWebView* m_inspectorWebView;
         WebKitWebView* m_inspectedWebView;
         WebKitWebInspector* m_webInspector;
     };
diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
index b8eb92d..02da1d4 100644
--- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
@@ -1,6 +1,7 @@
 /*
  *  Copyright (C) 2007 Luca Bruno <lethalman88@gmail.com>
  *  Copyright (C) 2009 Holger Hans Peter Freyther
+ *  Copyright (C) 2010 Martin Robinson <mrobinson@webkit.org>
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -32,152 +33,32 @@
 
 namespace WebKit {
 
-static GdkAtom gdkMarkupAtom = gdk_atom_intern("text/html", FALSE);
-
 PasteboardHelperGtk::PasteboardHelperGtk()
-    : m_targetList(gtk_target_list_new(0, 0))
 {
-    gtk_target_list_add_text_targets(m_targetList, WEBKIT_WEB_VIEW_TARGET_INFO_TEXT);
-    gtk_target_list_add(m_targetList, gdkMarkupAtom, 0, WEBKIT_WEB_VIEW_TARGET_INFO_HTML);
+    initializeTargetList();
 }
 
 PasteboardHelperGtk::~PasteboardHelperGtk()
 {
-    gtk_target_list_unref(m_targetList);
 }
 
-GtkClipboard* PasteboardHelperGtk::getCurrentTarget(Frame* frame) const
+guint PasteboardHelperGtk::getIdForTargetType(PasteboardTargetType type)
 {
-    WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
+    if (type == TargetTypeMarkup)
+        return WEBKIT_WEB_VIEW_TARGET_INFO_HTML;
+    if (type == TargetTypeImage)
+        return WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE;
+    if (type == TargetTypeURIList)
+        return WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST;
+    if (type == TargetTypeNetscapeURL)
+        return WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL;
 
-    if (webkit_web_view_use_primary_for_paste(webView))
-        return getPrimary(frame);
-    else
-        return getClipboard(frame);
+    return WEBKIT_WEB_VIEW_TARGET_INFO_TEXT;
 }
 
-GtkClipboard* PasteboardHelperGtk::getClipboard(Frame* frame) const
+bool PasteboardHelperGtk::usePrimarySelectionClipboard(GtkWidget* widget)
 {
-    WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
-    return gtk_widget_get_clipboard(GTK_WIDGET (webView),
-                                    GDK_SELECTION_CLIPBOARD);
-}
-
-GtkClipboard* PasteboardHelperGtk::getPrimary(Frame* frame) const
-{
-    WebKitWebView* webView = webkit_web_frame_get_web_view(kit(frame));
-    return gtk_widget_get_clipboard(GTK_WIDGET (webView),
-                                    GDK_SELECTION_PRIMARY);
-}
-
-GtkTargetList* PasteboardHelperGtk::targetList() const
-{
-    return m_targetList;
-}
-
-gint PasteboardHelperGtk::getWebViewTargetInfoHtml() const
-{
-    return WEBKIT_WEB_VIEW_TARGET_INFO_HTML;
-}
-
-static void fillSelectionData(GtkSelectionData* selectionData, guint info, DataObjectGtk* dataObject)
-{
-    if (info == WEBKIT_WEB_VIEW_TARGET_INFO_TEXT)
-        gtk_selection_data_set_text(selectionData, dataObject->text().utf8().data(), -1);
-    else if (info == WEBKIT_WEB_VIEW_TARGET_INFO_HTML) {
-        GOwnPtr<gchar> markup(g_strdup(dataObject->markup().utf8().data()));
-        gtk_selection_data_set(selectionData, selectionData->target, 8,
-                               reinterpret_cast<const guchar*>(markup.get()),
-                               strlen(markup.get()));
-    }
-}
-
-static GtkTargetList* targetListForDataObject(DataObjectGtk* dataObject)
-{
-    GtkTargetList* list = gtk_target_list_new(0, 0);
-
-    if (dataObject->hasText())
-        gtk_target_list_add_text_targets(list, WEBKIT_WEB_VIEW_TARGET_INFO_TEXT);
-
-    if (dataObject->hasMarkup())
-        gtk_target_list_add(list, gdkMarkupAtom, 0, WEBKIT_WEB_VIEW_TARGET_INFO_HTML);
-
-    return list;
-}
-
-static DataObjectGtk* settingClipboardDataObject = 0;
-static gpointer settingClipboardData = 0;
-static void getClipboardContentsCallback(GtkClipboard* clipboard, GtkSelectionData *selectionData, guint info, gpointer data)
-{
-    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
-    ASSERT(dataObject);
-    fillSelectionData(selectionData, info, dataObject);
-}
-
-static void clearClipboardContentsCallback(GtkClipboard* clipboard, gpointer data)
-{
-    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
-    ASSERT(dataObject);
-
-    // Only clear the DataObject for this clipboard if we are not currently setting it.
-    if (dataObject != settingClipboardDataObject)
-        dataObject->clear();
-
-    // Only collapse the selection if this is an X11 primary clipboard
-    // and we aren't currently setting the clipboard for this WebView.
-    if (!data || data == settingClipboardData)
-        return;
-
-    WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data);
-    WebCore::Page* corePage = core(webView);
-
-    if (!corePage || !corePage->focusController()) {
-        g_object_unref(webView);
-        return;
-    }
-
-    Frame* frame = corePage->focusController()->focusedOrMainFrame();
-
-    // Collapse the selection without clearing it
-    ASSERT(frame);
-    frame->selection()->setBase(frame->selection()->extent(), frame->selection()->affinity());
-
-    g_object_unref(webView);
-}
-
-void PasteboardHelperGtk::writeClipboardContents(GtkClipboard* clipboard, gpointer data)
-{
-    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
-    GtkTargetList* list = targetListForDataObject(dataObject);
-
-    int numberOfTargets;
-    GtkTargetEntry* table = gtk_target_table_new_from_list(list, &numberOfTargets);
-
-    if (numberOfTargets > 0 && table) {
-        settingClipboardDataObject = dataObject;
-        settingClipboardData = data;
-
-        // Protect the web view from being destroyed before one of the clipboard callbacks
-        // is called. Balanced in both getClipboardContentsCallback and
-        // clearClipboardContentsCallback.
-        WebKitWebView* webView = static_cast<WebKitWebView*>(data);
-        g_object_ref(webView);
-
-        gboolean succeeded = gtk_clipboard_set_with_data(clipboard, table, numberOfTargets,
-                                                         getClipboardContentsCallback,
-                                                         clearClipboardContentsCallback, data);
-        if (!succeeded)
-            g_object_unref(webView);
-
-        settingClipboardDataObject = 0;
-        settingClipboardData = 0;
-    } else
-        gtk_clipboard_clear(clipboard);
-
-    if (table)
-        gtk_target_table_free(table, numberOfTargets);
-
-    gtk_target_list_unref(list);
+    return webkit_web_view_use_primary_for_paste(WEBKIT_WEB_VIEW((widget)));
 }
 
 }
diff --git a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
index 97eff90..64fcdba 100644
--- a/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
+++ b/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Luca Bruno <lethalman88@gmail.com>
  * Copyright (C) 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Martin Robinson <mrobinson@webkit.org>
  * All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -41,16 +42,10 @@
 public:
     PasteboardHelperGtk();
     ~PasteboardHelperGtk();
-    virtual GtkClipboard* getCurrentTarget(Frame*) const;
-    virtual GtkClipboard* getClipboard(Frame*) const;
-    virtual GtkClipboard* getPrimary(Frame*) const;
-    virtual GtkTargetList* targetList() const;
-    virtual gint getWebViewTargetInfoHtml() const;
+    virtual guint getIdForTargetType(PasteboardTargetType);
 
-    void writeClipboardContents(GtkClipboard* clipboard, gpointer data = 0);
-
-private:
-    GtkTargetList* m_targetList;
+protected:
+    virtual bool usePrimarySelectionClipboard(GtkWidget*);
 };
 
 }
diff --git a/WebKit/gtk/docs/webkitgtk-docs.sgml b/WebKit/gtk/docs/webkitgtk-docs.sgml
index 77f3482..fb9ae09 100644
--- a/WebKit/gtk/docs/webkitgtk-docs.sgml
+++ b/WebKit/gtk/docs/webkitgtk-docs.sgml
@@ -18,6 +18,7 @@
     <xi:include href="xml/webkitwebhistoryitem.xml"/>
     <xi:include href="xml/webkitwebnavigationaction.xml"/>
     <xi:include href="xml/webkitwebpolicydecision.xml"/>
+    <xi:include href="xml/webkitgeolocationpolicydecision.xml"/>
     <xi:include href="xml/webkitnetworkrequest.xml"/>
     <xi:include href="xml/webkitnetworkresponse.xml"/>
     <xi:include href="xml/webkitwebinspector.xml"/>
@@ -103,4 +104,7 @@
   <index id="index-1.1.20" role="1.1.20">
     <title>Index of new symbols in 1.1.20</title>
   </index>
+  <index id="index-1.1.23" role="1.1.23">
+    <title>Index of new symbols in 1.1.23</title>
+  </index>
 </book>
diff --git a/WebKit/gtk/docs/webkitgtk-sections.txt b/WebKit/gtk/docs/webkitgtk-sections.txt
index 2379c8b..7f37484 100644
--- a/WebKit/gtk/docs/webkitgtk-sections.txt
+++ b/WebKit/gtk/docs/webkitgtk-sections.txt
@@ -351,6 +351,26 @@
 </SECTION>
 
 <SECTION>
+<FILE>webkitgeolocationpolicydecision</FILE>
+<TITLE>WebKitGeolocationPolicyDecision</TITLE>
+WebKitGeolocationPolicyDecision
+webkit_geolocation_policy_allow
+webkit_geolocation_policy_deny
+webkit_geolocation_policy_decision_get_type
+<SUBSECTION Standard>
+WEBKIT_IS_GEOLOCATION_POLICY_DECISION
+WEBKIT_IS_GEOLOCATION_POLICY_DECISION_CLASS
+WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION
+WEBKIT_GEOLOCATION_POLICY_DECISION
+WEBKIT_GEOLOCATION_POLICY_DECISION_CLASS
+WEBKIT_GEOLOCATION_POLICY_DECISION_GET_CLASS
+<SUBSECTION Private>
+WebKitGeolocationPolicyDecision
+WebKitGeolocationPolicyDecisionClass
+WebKitGeolocationPolicyDecisionPrivate
+</SECTION>
+
+<SECTION>
 <FILE>webkitnetworkrequest</FILE>
 <TITLE>WebKitNetworkRequest</TITLE>
 WebKitNetworkRequest
diff --git a/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/WebKit/gtk/gdom/ConvertToGCharPrivate.h
index 621fb99..dd8c65e 100644
--- a/WebKit/gtk/gdom/ConvertToGCharPrivate.h
+++ b/WebKit/gtk/gdom/ConvertToGCharPrivate.h
@@ -21,9 +21,9 @@
 #define ConvertToGCharPrivate_h
 
 #include "AtomicString.h"
-#include "CString.h"
 #include "KURL.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 inline gchar* copyAsGchar(WebCore::String const& s)
 {
diff --git a/WebKit/gtk/po/ChangeLog b/WebKit/gtk/po/ChangeLog
index aabad74..b9f97fe 100644
--- a/WebKit/gtk/po/ChangeLog
+++ b/WebKit/gtk/po/ChangeLog
@@ -1,3 +1,142 @@
+2010-04-05  Lucas Lommer  <llommer@svn.gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Czech translation for WebKitGtk
+        https://bugs.webkit.org/show_bug.cgi?id=36879
+
+        * cs.po: Added.
+
+2010-04-05  Christian Kirbach  <Christian.Kirbach@googlemail.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Updated German translation
+        https://bugs.webkit.org/show_bug.cgi?id=36453
+
+        * de.po:
+
+2010-04-05  Luca Ferretti  <elle.uca@libero.it>
+
+        Reviewed by Gustavo Noronha.
+
+        Italian translation for 1.1.90
+        https://bugs.webkit.org/show_bug.cgi?id=36323
+
+        * it.po:
+
+2010-03-25  Reinout van Schouwen  <reinouts@gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Updated Dutch translation
+        https://bugs.webkit.org/show_bug.cgi?id=36432
+
+        * nl.po:
+
+2010-03-24  Yuri Chornoivan  <yurchor@ukr.net>
+
+        Reviewed by Gustavo Noronha.
+
+        Ukrainian translation.
+
+        * uk.po: Added.
+
+2010-03-16  Matej Urbančič  <mateju@svn.gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Slovenian translation.
+
+        * sl.po: Added.
+
+2010-03-16  António Lima  <amrlima@gmail.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Translation for pt (Portuguese)
+        https://bugs.webkit.org/show_bug.cgi?id=36148
+
+        * pt.po: Added.
+
+2010-03-10  Priit Laes  <plaes@plaes.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Estonian translation.
+
+        * et.po: Added.
+
+2010-03-09  Peteris Krisjanis  <pecisk@gmail.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Latvian translation.
+
+        * lv.po: Added.
+
+2010-03-09  Duy Nguyen  <pclouds@gmail.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Vietnamese translation update.
+
+        * vi.po:
+
+2010-03-09  Rimas Kudelis  <rq@akl.lt>
+
+        Reviewed by Gustavo Noronha.
+
+        Lithuanian translation update.
+
+        * lt.po:
+
+2010-02-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Updated to accomodate the change done to the localized string.
+
+        * de.po:
+        * en_GB.po:
+        * es.po:
+        * gu.po:
+        * he.po:
+        * it.po:
+        * lt.po:
+        * nl.po:
+        * pa.po:
+        * pt_BR.po:
+        * ru.po:
+        * sr.po:
+        * sr@latin.po:
+        * sv.po:
+        * vi.po:
+        * webkit.pot:
+        * zh_CN.po:
+
+2010-02-23  Mario Blättermann  <mariobl@freenet.de>
+
+        Reviewed by Gustavo Noronha.
+
+        German translation update.
+
+        * de.po:
+
+2010-02-23  Daniel Nylander  <po@danielnylander.se>
+
+        Reviewed by Gustavo Noronha.
+
+        Swedish translation update.
+
+        * sv.po:
+
+2010-02-23  Ankit Patel  <ankit@redhat.com>
+
+        Reviewed by Gustavo Noronha.
+
+        Gujarati translation.
+
+        * gu.po: Added.
+
 2010-02-18  A S Alam  <amanpreet.alam@gmail.com>
 
         Punjabi translation.
diff --git a/WebKit/gtk/po/cs.po b/WebKit/gtk/po/cs.po
new file mode 100644
index 0000000..228ba22
--- /dev/null
+++ b/WebKit/gtk/po/cs.po
@@ -0,0 +1,1089 @@
+# Czech translation for webkit.
+# Copyright (C) 2010 webkit's COPYRIGHT HOLDER
+# This file is distributed under the same license as the webkit package.
+# Lucas Lommer <llommer@svn.gnome.org>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit HEAD\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-31 13:07+0100\n"
+"Last-Translator: Lucas Lommer <llommer@svn.gnome.org>\n"
+"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+msgid "Upload File"
+msgstr "Nahrát soubor"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "Vstupní _metody"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LRM - značka z_leva doprava"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM - značka zp_rava doleva"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE - _zapouzdření zleva doprava"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE - z_apouzdření zprava doleva"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO - _přepisování zleva doprava"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO - př_episování zprava doleva"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF - zrušení směrovaného _formátování"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS - mezera _nulové šířky"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ - _spojovač nulové šířky"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ - nespojovač n_ulové šířky"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "Vloži_t řídící znak Unicode"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "Network Request"
+msgstr "Síťový požadavek"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
+msgid "The network request for the URI that should be downloaded"
+msgstr "Síťový požadavek na adresu URI, která má být stažena"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+msgid "Network Response"
+msgstr "Síťová odpověď"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+msgid "The network response for the URI that should be downloaded"
+msgstr "Síťová odpověď na adresu URI, která má být stažena"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
+msgid "Destination URI"
+msgstr "Cílová adresa URI"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
+msgid "The destination URI where to save the file"
+msgstr "Cílová adresa URI, kam soubor uložit"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
+msgid "Suggested Filename"
+msgstr "Navrhovaný název souboru"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
+msgid "The filename suggested as default when saving"
+msgstr "Výchozí název souboru při uložení"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
+msgid "Progress"
+msgstr "Průběh"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
+msgid "Determines the current progress of the download"
+msgstr "Údaj o aktuálním průběhu stahování"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
+msgid "Status"
+msgstr "Stav"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
+msgid "Determines the current status of the download"
+msgstr "Údaj o aktuálním stavu stahování"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
+msgid "Current Size"
+msgstr "Aktuální velikost"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
+msgid "The length of the data already downloaded"
+msgstr "Objem již stažených dat"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
+msgid "Total Size"
+msgstr "Celková velikost"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
+msgid "The total size of the file"
+msgstr "Celková velikost souboru"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
+msgid "User cancelled the download"
+msgstr "Stahování zrušeno uživatelem"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Požadované uživatelské jméno a heslo, které je vyžadováno stránkou %s"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Zpráva serveru:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "Uživatelské jméno:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "Heslo:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+msgid "_Remember password"
+msgstr "Za_pamatovat si heslo"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+msgid "Name"
+msgstr "Název"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "The name of the frame"
+msgstr "Název rámu"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
+msgid "Title"
+msgstr "Nadpis"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+msgid "The document title of the frame"
+msgstr "Nadpis dokumentu rámu"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
+msgid "URI"
+msgstr "Adresa URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+msgid "The current URI of the contents displayed by the frame"
+msgstr "Aktuální adresa URI obsahu zobrazeného v rámci"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr "Strategie pro vodorovný posuvník"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr "Údaj o aktuální strategii horizontálního posuvníku rámce."
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr "Strategie pro svislý posuvník"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr "Údaj o aktuální strategii vertikálního posuvníku rámce."
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "Nadpis položky historie"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "Alternativní nadpis"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "Alternativní nadpis položky historie"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "Adresa URI položky historie"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "Původní adresa URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "Původní adresa URI položky historie"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "Čas poslední návštěvy"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "Čas, kdy byla položka historie naposledy navštívena"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "Zobrazení WWW"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "Zobrazení WWW, které vykresluje samotné Zkoumání WWW"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+msgid "Inspected URI"
+msgstr "Zkoumaná adresa URI"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr "Adresa URI, která je právě zkoumána"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "Povolit profilování jazyka JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "Profilovat spuštěné skripty jazyka JavaScript."
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+msgid "Enable Timeline profiling"
+msgstr "Povolit profilování časové osy"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "Důvod"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "Důvod, proč se objevila tato navigace"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+msgid "The URI that was requested as the target for the navigation"
+msgstr "Adresa URI, která byla požadována jako cíl navigace"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "Tlačítko"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "Tlačítko používané ke klepnutí"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "Stav modifikátoru"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "Bitová maska reprezentující stav modifikátorových kláves"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+msgid "Target frame"
+msgstr "Cílový rám"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+msgid "The target frame for the navigation"
+msgstr "Cílový rám navigace"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
+msgid "Default Encoding"
+msgstr "Výchozí kódování"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
+msgid "The default encoding used to display text."
+msgstr "Výchozí kódování textu použité k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
+msgid "Cursive Font Family"
+msgstr "Rodina písma kurzíva"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
+msgid "The default Cursive font family used to display text."
+msgstr "Výchozí písmo z rodiny kurzíva použité k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
+msgid "Default Font Family"
+msgstr "Výchozí rodina písma"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
+msgid "The default font family used to display text."
+msgstr "Výchozí rodina písma použitého k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
+msgid "Fantasy Font Family"
+msgstr "Rodina písma Fantasy"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
+msgid "The default Fantasy font family used to display text."
+msgstr "Výchozí rodina písma Fantasy použitého k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
+msgid "Monospace Font Family"
+msgstr "Rodina písma s pevnou šířkou"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
+msgid "The default font family used to display monospace text."
+msgstr "Výchozí rodina písma použitého k zobrazení textu s pevnou šířkou."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
+msgid "Sans Serif Font Family"
+msgstr "Rodina písem Sans Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
+msgid "The default Sans Serif font family used to display text."
+msgstr "Výchozí písmo z rodiny Sans Serif použité k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
+msgid "Serif Font Family"
+msgstr "Rodina písma Sans Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
+msgid "The default Serif font family used to display text."
+msgstr "Výchozí písmo z rodiny Serif použité k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
+msgid "Default Font Size"
+msgstr "Výchozí velikost písma"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "The default font size used to display text."
+msgstr "Výchozí velikost písma použitá k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
+msgid "Default Monospace Font Size"
+msgstr "Výchozí velikost písma s pevnou šířkou"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
+msgid "The default font size used to display monospace text."
+msgstr "Výchozí velikost písma použitá k zobrazení textu s pevnou šířkou."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "Minimum Font Size"
+msgstr "Minimální velikost písma"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
+msgid "The minimum font size used to display text."
+msgstr "Minimální velikost písma použitá k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
+msgid "Minimum Logical Font Size"
+msgstr "Minimální logická velikost písma"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
+msgid "The minimum logical font size used to display text."
+msgstr "Minimální logická velikost písma použítá k zobrazení textu."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
+msgid "Enforce 96 DPI"
+msgstr "Vynutit 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Vynutit rozlišení 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
+msgid "Auto Load Images"
+msgstr "Obrázky automaticky"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Load images automatically."
+msgstr "Automatický načíst obrázky."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
+msgid "Auto Shrink Images"
+msgstr "Zmenšovat obrázky"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
+msgid "Automatically shrink standalone images to fit."
+msgstr ""
+"Automaticky zmenšovat samostatně zobrazené obrázky tak, aby se vešly na "
+"obrazovku."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
+msgid "Print Backgrounds"
+msgstr "Tisknout pozadí"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
+msgid "Whether background images should be printed."
+msgstr "Zda mají být tisknuty obrázky na pozadí."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
+msgid "Enable Scripts"
+msgstr "Povolit skripty"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
+msgid "Enable embedded scripting languages."
+msgstr "Povolit vložené skriptovací jazyky."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
+msgid "Enable Plugins"
+msgstr "Povolit zásuvné moduly"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
+msgid "Enable embedded plugin objects."
+msgstr "Povolit vložené objekty zásuvných modulů."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
+msgid "Resizable Text Areas"
+msgstr "Měnitelná velikost textového pole"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
+msgid "Whether text areas are resizable."
+msgstr "Jestli je možno měnit velikost textového pole."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
+msgid "User Stylesheet URI"
+msgstr "Cesta k předpisu vzhledu uživatele"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr ""
+"Adresa URI, kde se nachází předpis vzhledu, který bude aplikován na každou "
+"stránku."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
+msgid "Zoom Stepping Value"
+msgstr "Hodnota kroků změn velikosti"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr "Hodnota změn velikosti jednotlivých kroků při zmenšování a zvětšování."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
+msgid "Enable Developer Extras"
+msgstr "Povolit rozšíření pro vývojáře"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
+msgid "Enables special extensions that help developers"
+msgstr "Povolit zvláštní rozšíření pomáhající vývojářům"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
+msgid "Enable Private Browsing"
+msgstr "Povolit soukromé prohlížení"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
+msgid "Enables private browsing mode"
+msgstr "Povolit režim soukromého prohlížení stránek"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr "Povolit kontrolu pravopisu"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+msgid "Enables spell checking while typing"
+msgstr "Povolit kontrolu pravopisu při psaní"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr "Jazyk, který použít ke kontrole pravopisu"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr "Seznam jazyků použitých ke kontrole pravopisu, oddělený čárkami"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+msgid "Enable Caret Browsing"
+msgstr "Povolit prohlížení s kurzorem"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr "Jestli povolit zpřístupnění pomocí navigace klávesnicí"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr "Povolit databázi HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr "Jeslti povolit podporu pro databázi HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr "Povolit místní úložiště HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Jestli má být povolena podpora místního úložiště HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+msgid "Enable XSS Auditor"
+msgstr "Povolit revizi XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr "Jestli povolit revizi XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr "Identifikace prohlížeče"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "Řetězec identifikace prohlížeče (User agent), který WebKitGtk použije"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript smí automaticky otevírat okna"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Jestli smí JavaScript automaticky otevírat okna"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr "Povolit ukládání stránek do vyrovnávací paměti"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr "Povolit ukládání stránek do vyrovnávací paměti k použití při odpojení"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr "Chování při úpravách"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr "Režim chování v režimu úprav"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr "Povolit univerzální přístup ze souboru s URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr "Povolit univerzální přístup ze souboru s adresami URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+msgid "Enable DOM paste"
+msgstr "Povolit vkládání DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr "Jestli povolit vkládání DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr "Tabulátor cyklicky prochází prvky"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr "Jestli klávesa tabulátoru prochází cyklicky prvky stránky."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr "Povolit výchozí kontextovou nabídku"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr ""
+"Poboluje správu tvorby výchozí kontextové nabídky při klepnutí pravým "
+"tlačítkem"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+#, fuzzy
+msgid "Enable Site Specific Quirks"
+msgstr "Povolit řešení kompatibility"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "Povolit řešení komapatibility specifických stránek"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr "Povolit vyrovnávací paměť stránky"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+msgid "Whether the page cache should be used"
+msgstr "Jestli použít vyrovnávací paměť pro stránky"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr "Automatická změna velikosti okna"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr "Automaticky změnit velikost okna, pokud o to stránka požádá"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Povolit applet jazyka Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Jestli má být povolena podpora jazyka JavaScript skrze značku <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
+msgid "Returns the @web_view's document title"
+msgstr "Vrací název dokumentu @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Vrací aktuální adresu URI obsahu zobrazeného pomocí @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
+msgid "Copy target list"
+msgstr "Seznam cílů kopírování"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+"Seznam cílů, které zobrazení stránky podporuje pro operace kopírování pomocí "
+"schránky"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
+msgid "Paste target list"
+msgstr "Seznam cílů vkládání"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+"Seznam cílů, které zobrazení stránky podporuje pro operace vkládání pomocí "
+"schránky"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
+msgid "Settings"
+msgstr "Nastavení"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
+msgid "An associated WebKitWebSettings instance"
+msgstr "Asociovaná instance WebKitWebSettings"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
+msgid "Web Inspector"
+msgstr "Zkoumání WWW"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
+msgid "The associated WebKitWebInspector instance"
+msgstr "Asociovaná instance WebKitWebInspector"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
+msgid "Editable"
+msgstr "Upravitelné"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
+msgid "Whether content can be modified by the user"
+msgstr "Jestli uživatel může upravovat obsah"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
+msgid "Transparent"
+msgstr "Průhledné"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
+msgid "Whether content has a transparent background"
+msgstr "Jestli má obsah průhledné pozadí"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
+msgid "Zoom level"
+msgstr "Úroveň zvětšení"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
+msgid "The level of zoom of the content"
+msgstr "Úroveň zvětšení obsahu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
+msgid "Full content zoom"
+msgstr "Změna velikosti celého obsahu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
+msgid "Whether the full content is scaled when zooming"
+msgstr "Jestli má být prováděna změna velikosti celého obsahu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
+msgid "Encoding"
+msgstr "Kódování"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
+msgid "The default encoding of the web view"
+msgstr "Výchozí kódování zobrazení WWW"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
+msgid "Custom Encoding"
+msgstr "Vlastní kódování"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
+msgid "The custom encoding of the web view"
+msgstr "Vlastní kódování zobrazení WWW"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr "Adresa URI ikony"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "Adresa URI ikony stránky pro #WebKitWebView."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "Potvrdit"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "Reset"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Tento seznam lze prohledávat. Zadejte klíčová slova hledání:"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "Vybrat soubor"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(Nic)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "Otevřít odkaz v novém _okně"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "_Uložit odkazovaný soubor"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "_Kopírovat adresu odkazu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "Otevřít o_brázek v novém okně"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "_Uložit obrázek jako"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "Ko_pírovat obrázek"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "Otevřít _rám v novém okně"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "_Obnovit"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+msgid "No Guesses Found"
+msgstr "Nebyly nalezeny žádné návrhy"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "_Ignorovat kontrolu pravopisu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "_Učit se kontrolu pravopisu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "_Vyhledat na WWW"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "Vyh_ledat ve slovníku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "_Otevřít odkaz"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "Ignorovat _gramatiku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "Kontrola pravopisu a _gramatiky"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "_Zobrazit kontrolu pravopisu a gramatiky"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "_Skrýt kontrolu pravopisu a gramatiky"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "_Zkontrolovat dokument"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "_Kontrola pravopisu během psaní"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "Kontrolovat _gramatiku pomocí pravopisu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "_Písmo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "K_ontury"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+msgid "Inspect _Element"
+msgstr "Zkoumat _prvek"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "Žádná nedávná hledání"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "Nedávná hledání"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "_Vymazat nedávná hledání"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "výraz"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "definice"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "stisknutí"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "výběr"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "aktivovat"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "zrušení výběru"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "kontrola"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "přeskočit"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+msgid " files"
+msgstr " soubory"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Unknown"
+msgstr "Neznámé"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr "Načítá se…"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr "Živý přenos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr "ovladač prvku zvuku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr "ovladač prvku videa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr "ztlumení"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr "zrušit ztlumení"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr "přehrát"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr "pozastavit"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr "čas videa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr "zpět 30 sekund"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr "vrátit se do reálného času"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr "uplynulý čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr "zbývající čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+msgid "status"
+msgstr "stav"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr "celá obrazovka"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr "rychle vpřed"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr "rychle zpět"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr "zobrazení ovládacích prvků a stavu prvku zvuku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr "zobrazení ovládacích prvků a stavu prvku videa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr "ztlumit hudební stopy"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr "zrušit ztlumení hudebních stop"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr "začít přehrávání"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr "pozastavit přehrávání"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr "přeskočit ve videu 30 sekund zpět"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr "vrátit se v promítání videa do reálného šasu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr "čas aktuálního videa v sekundách"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr "počet zbývajících vteřin videa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr "aktuální stav videa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr "rychlý přechod zpět"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr "rychlý přechod vpřed"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr "Přehrát video na celou obrazovku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+msgid "indefinite time"
+msgstr "Nejasný čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr "chybějící hodnota"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr "typ nesouhlasí"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr "vzor nesouhlasí"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr "příliš dlouhé"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr "nedostatečně velký rozsah"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr "příliš velký rozsah"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+#, fuzzy
+msgid "step mismatch"
+msgstr "krok nesouhlasí"
diff --git a/WebKit/gtk/po/de.po b/WebKit/gtk/po/de.po
index 1106587..b9fb99b 100644
--- a/WebKit/gtk/po/de.po
+++ b/WebKit/gtk/po/de.po
@@ -1,18 +1,22 @@
 # German translations for WebKit package.
-# Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
-#
+# This file is put in the public domain.
+# Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>, 2009.
+# Mario Blättermann <mariobl@gnome.org>, 2010.
+# Christian Kirbach <Christian.Kirbach@googlemail.com>, 2010.
 msgid ""
 msgstr ""
-"Project-Id-Version: webkit 1.1.4\n"
+"Project-Id-Version: webkit 1.1.21\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-04-07 00:27+0100\n"
-"Last-Translator: Christian Dywan <christian@twotoasts.de>\n"
-"Language-Team: German\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-21 21:14+0100\n"
+"Last-Translator: Christian Kirbach <Christian.Kirbach@googlemail.com>\n"
+"Language-Team: Deutsch <gnome-de@gnome.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"X-Poedit-Language: German\n"
+"X-Poedit-Country: GERMANY\n"
 
 #: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
 msgid "Upload File"
@@ -68,92 +72,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Unicode-Steuerzeichen einfügen"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Netzwerkanfrage"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
-msgstr "Die Netzwerkanfrage der URI welche heruntergeladen werden soll"
+msgstr "Die Netzwerkanfrage der Adresse, welche heruntergeladen werden soll"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 msgid "Network Response"
-msgstr "Netzwerkanfrage"
+msgstr "Netzwerkantwort"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 msgid "The network response for the URI that should be downloaded"
-msgstr "Die Netzwerkanfrage der URI welche heruntergeladen werden soll"
+msgstr "Die Netzwerkantwort der Adresse, welche heruntergeladen werden soll"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
-msgstr "Ziel-URI"
+msgstr "Zieladresse"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
-msgstr "Die Ziel-URI an welcher die Datei gespeichert werden soll"
+msgstr "Die Zieladresse, an welcher die Datei gespeichert werden soll"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Vorgeschlagener Dateiname"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
-msgstr "Der beim Speichern als Standard vorgeschlagene Dateiname"
+msgstr "Der beim Speichern als Vorgabe vorgeschlagene Dateiname"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Fortschritt"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Bestimmt den aktuellen Fortschritt des Herunterladens"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Status"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Bestimmt den aktuellen Status des Herunterladens"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Aktuelle Größe"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "Die Länge der bereits heruntergeladenen Daten"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Gesamtgröße"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Die Gesamtgröße der Datei"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
-msgstr ""
+msgstr "Download wurde vom Benutzer abgebrochen"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
-msgstr ""
+msgstr "Ein Benutzername und ein Passwort sind für die Seite %s erforderlich"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Server-Nachricht:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
-msgstr ""
+msgstr "Benutzername:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
-msgstr ""
+msgstr "Passwort:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 msgid "_Remember password"
-msgstr ""
+msgstr "An Passwort _erinnern"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
@@ -165,7 +171,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Titel"
 
@@ -175,549 +181,566 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
-msgstr "URI"
+msgstr "Adresse"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:313
 msgid "The current URI of the contents displayed by the frame"
-msgstr "Die aktuelle URI der im Rahmen dargestellten Inhalte"
+msgstr "Die aktuelle Adresse der im Rahmen dargestellten Inhalte"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
-msgstr ""
+msgstr "Richtlinie für horizontal Rollbalken"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:345
-#, fuzzy
 msgid ""
 "Determines the current policy for the horizontal scrollbar of the frame."
-msgstr "Bestimmt den aktuellen Fortschritt des Herunterladens"
+msgstr ""
+"Bestimmt die aktuelle Richtlinie für den horizontalen Rollbalken des Rahmens."
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:362
 msgid "Vertical Scrollbar Policy"
-msgstr ""
+msgstr "Richtlinie für vertikale Rollbalken"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:363
-#, fuzzy
 msgid "Determines the current policy for the vertical scrollbar of the frame."
-msgstr "Bestimmt den aktuellen Fortschritt des Herunterladens"
+msgstr ""
+"Bestimmt die aktuelle Richtlinie für den vertikalen Rollbalken des Rahmens."
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
-#, fuzzy
 msgid "The title of the history item"
-msgstr "Die Gesamtgröße der Datei"
+msgstr "Der Titel des Chronikeintrags"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
 msgid "Alternate Title"
-msgstr ""
+msgstr "Alternativer Titel"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
-#, fuzzy
 msgid "The alternate title of the history item"
-msgstr "Der Titel des Dokuments in dem Rahmen"
+msgstr "Der alternative Titel des Chronikeintrags"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
 msgid "The URI of the history item"
-msgstr ""
+msgstr "Die Adresse des Chronikobjekts"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
 msgid "Original URI"
-msgstr ""
+msgstr "Originaladresse"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
 msgid "The original URI of the history item"
-msgstr ""
+msgstr "Die Originaladresse des Chronikeintrags"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
 msgid "Last visited Time"
-msgstr ""
+msgstr "Zeit des letzten Besuchs"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
 msgid "The time at which the history item was last visited"
-msgstr ""
+msgstr "Der Zeitpunkt, an dem der Chronikeintrag zuletzt besucht wurde"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:268
 msgid "Web View"
-msgstr ""
+msgstr "Webansicht"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:269
 msgid "The Web View that renders the Web Inspector itself"
-msgstr ""
+msgstr "Die Webansicht, die den Web-Inspektor selbst darstellt"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:282
 msgid "Inspected URI"
-msgstr ""
+msgstr "Untersuchte Adresse"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:283
 msgid "The URI that is currently being inspected"
-msgstr ""
+msgstr "Die Adresse, die derzeit untersucht wird"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:299
 msgid "Enable JavaScript profiling"
-msgstr ""
+msgstr "JavaScript-Profiling aktivieren"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:300
 msgid "Profile the executed JavaScript."
-msgstr ""
+msgstr "Das ausgeführte JavaScript profilieren."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
 msgid "Enable Timeline profiling"
-msgstr ""
+msgstr "Timeline-Profiling aktivieren"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
-msgstr ""
+msgstr "Die WebCore-Instrumentation profilieren."
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
 msgid "Reason"
-msgstr ""
+msgstr "Grund"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
 msgid "The reason why this navigation is occurring"
-msgstr ""
+msgstr "Der Grund, warum diese Navigation geschieht"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
 msgid "The URI that was requested as the target for the navigation"
-msgstr ""
+msgstr "Die Adresse, die als Navigationsziel angefordert wurde"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
 msgid "Button"
-msgstr ""
+msgstr "Knopf"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
 msgid "The button used to click"
-msgstr ""
+msgstr "Der angeklickte Knopf"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
 msgid "Modifier state"
-msgstr ""
+msgstr "Modifikatorstatus"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
 msgid "A bitmask representing the state of the modifier keys"
-msgstr ""
+msgstr "Eine Bitmaske, die den Status der Zusatztasten darstellt."
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
-#, fuzzy
 msgid "Target frame"
-msgstr "Der Name des Rahmens"
+msgstr "Zielrahmen"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
 msgid "The target frame for the navigation"
-msgstr ""
+msgstr "Der Zielrahmen der Navigation"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
-msgstr ""
+msgstr "Voreingestellte Zeichenkodierung"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
-msgstr ""
+msgstr "Die voreingestellte Zeichenkodierung zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
-msgstr ""
+msgstr "Kursiv-Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
-msgstr ""
+msgstr "Die vorgegebene Kursiv-Schriftfamilie zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
-msgstr ""
+msgstr "Voreingestellte Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
-msgstr ""
+msgstr "Die voreingestellte Schriftfamilie zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
-msgstr ""
+msgstr "Fantasy-Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
-msgstr ""
+msgstr "Die voreingestellte Fantasy-Schriftfamilie zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
-msgstr ""
+msgstr "Monospace-Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr ""
+"Die voreingestellte Schriftfamilie zur Darstellung von dicktengleichem Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
-msgstr ""
+msgstr "Sans-Serif-Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr ""
+"Die voreingestellte Sans-Serif-Schriftfamilie zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
-msgstr ""
+msgstr "Serif-Schriftfamilie"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
-msgstr ""
+msgstr "Die voreingestellte Serif-Schriftfamilie zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
-msgstr ""
+msgstr "Voreingestellte Schriftgröße"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
-msgstr ""
+msgstr "Die voreingestellte Schriftgröße zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
-msgstr ""
+msgstr "Voreingestellte Monospace-Schriftgröße"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr ""
+"Die voreingestellte Schriftgröße zur Darstellung von dicktengleichem Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
-msgstr ""
+msgstr "Mindestschriftgröße"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
-msgstr ""
+msgstr "Die Mindestgröße der Schrift zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
-msgstr ""
+msgstr "Kleinste logische Schriftgröße"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
-msgstr ""
+msgstr "Die kleinste logische Schriftgröße zur Darstellung von Text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
-msgstr ""
+msgstr "96 dpi erzwingen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
-msgstr ""
+msgstr "Eine Auflösung von 96 dpi erzwingen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
-msgstr ""
+msgstr "Bilder automatisch laden"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
-msgstr ""
+msgstr "Bilder automatisch laden."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
-msgstr ""
+msgstr "Bilder automatisch verkleinern"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
-msgstr ""
+msgstr "Größe alleinstehender Bilder automatisch anpassen."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
-msgstr ""
+msgstr "Hintergründe drucken"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
-msgstr ""
+msgstr "Gibt an, ob Hintergrundbilder gedruckt werden sollen."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
-msgstr ""
+msgstr "Skripte aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
-msgstr ""
+msgstr "Eingebettete Skriptsprachen aktivieren."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
-msgstr ""
+msgstr "Plugins aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
-msgstr ""
+msgstr "Eingebettete Plugin-Objekte aktivieren."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
-msgstr ""
+msgstr "Größenänderung für Textfelder"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
-msgstr ""
+msgstr "Gibt an, ob die Größe von Textfeldern geändert werden kann."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
-msgstr ""
+msgstr "Adresse der Benutzer-Stilvorlage"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr ""
+"Die Adresse einer benutzerdefinierten Stilvorlage, die auf alle Seiten "
+"angewendet werden soll."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
-msgstr ""
+msgstr "Schrittweite für Größenänderungen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
-msgstr ""
+msgstr "Der Wert für Größenänderungensstufen beim Vergrößern oder Verkleinern."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
-msgstr ""
+msgstr "Erweiterungen für Entwickler aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
-msgstr ""
+msgstr "Aktiviert spezielle Erweiterungen, die Entwickler unterstützen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+# Steht so im KDE-Browser rekonq.
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
-msgstr ""
+msgstr "Privaten Modus aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
-msgstr ""
+msgstr "Aktiviert den privaten Modus für den Browser."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
-msgstr ""
+msgstr "Rechtschreibprüfung aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
-msgstr "Rechtschreibung beim _Eintippen überprüfen"
+msgstr "Rechtschreibung beim Tippen überprüfen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
-msgstr ""
+msgstr "Sprachen für die Rechtschreibprüfung"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
-msgstr ""
+msgstr "Durch Kommata getrennte Liste von Sprachen für die Rechtschreibprüfung"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
-msgstr ""
+msgstr "Caret-Modus aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
+"Legt fest, ob die barrierefreie Tastaturnavigation aktiviert werden soll"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
-msgstr ""
+msgstr "HTML5-Datenbank aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
-msgstr ""
+msgstr "Legt fest, ob HTML5-Datenbanken unterstützt werden"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
-msgstr ""
+msgstr "Lokale Speicherung nach HTML5 aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
-msgstr ""
+msgstr "Legt fest, ob lokale Speicherung nach HTML5 unterstützt wird"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 msgid "Enable XSS Auditor"
-msgstr ""
+msgstr "XSS-Auditor aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
-msgstr ""
+msgstr "Legt fest, ob der XSS-Auditor aktiviert ist"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
-msgstr ""
+msgstr "Benutzerprogramm"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
-msgstr ""
+msgstr "Von WebKitGtk verwendete Zeichenkette für das Benutzerprogramm"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
-msgstr ""
+msgstr "JavaScript darf Fenster automatisch öffnen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
-msgstr ""
+msgstr "Legt fest, ob JavaScript Fenster automatisch öffnen darf"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
-msgstr ""
+msgstr "Offline-Webanwendungscache aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
-msgstr ""
+msgstr "Legt fest, ob der Offline-Webanwendungscache aktiviert wird"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
-msgstr ""
+msgstr "Bearbeitungsverhalten"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
-msgstr ""
+msgstr "Das Verhalten im Bearbeitungsmodus"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
-msgstr ""
+msgstr "Unbeschränkten Zugriff von Datei-Adressen aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
-msgstr ""
+msgstr "Legt fest, ob unbeschränkter Zugriff von Datei-Adressen aktiviert wird"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 msgid "Enable DOM paste"
-msgstr ""
+msgstr "Einfügen ins DOM aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
-msgstr ""
+msgstr "Legt fest, ob Einfügen ins DOM aktiviert ist"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
-msgstr ""
+msgstr "Tabulatortaste wechselt zwischen Elementen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
+"Legt fest, ob die Tabulatortaste zwischen Elementen auf der Seite wechselt."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
-msgstr ""
+msgstr "Voreingestelltes Kontext-Menü aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
+"Drücken der rechten Maustaste blendet das voreingestellte Kontext-Menü ein"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
-msgstr ""
+msgstr "Seitenspezifische Fehlerumgehungen aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
-msgstr ""
+msgstr "Seitenspezifische Kompatibilitätsprobleme umgehen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
-msgstr ""
+msgstr "Seiten-Cache aktivieren"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 msgid "Whether the page cache should be used"
-msgstr ""
+msgstr "Legt fest, ob Seiten-Cache verwendet werden soll"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
-msgstr ""
+msgstr "Fenstergröße automatisch anpassen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
+"Die Größe des obersten Fensters auf Aufforderung einer Seite automatisch "
+"anpassen"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Java-Applet aktivieren"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Legt fest, ob Java-Applets mittels <applet> unterstützt werden sollen"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
-msgstr ""
+msgstr "Gibt den Dokumenttitel von @web_view zurück"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
-msgstr "Die aktuelle URI der im Rahmen dargestellten Inhalte"
+msgstr "Gibt die aktuelle Adresse des von @web_view angezeigten Inhalts zurück"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
-msgstr ""
+msgstr "Liste der Kopierziele"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
+"Die Liste der Ziele, die diese Webansicht für Kopieren in die Zwischenablage "
+"unterstützt"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
-msgstr ""
+msgstr "Liste der Einfügeziele"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
+"Die Liste der Ziele, die diese Webansicht für Einfügen der Zwischenablage "
+"unterstützt"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
-msgstr ""
+msgstr "Einstellungen"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
-msgstr ""
+msgstr "Eine zugeordnete WebKitWebSettings-Instanz"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
-msgstr ""
+msgstr "Web-Inspektor"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
-msgstr ""
+msgstr "Die zugeordnete WebKitWebInspector-Instanz"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
-msgstr "Titel"
+msgstr "Bearbeitbar"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
-msgstr ""
+msgstr "Gibt an, ob der Inhalt vom Benutzer bearbeitet werden kann"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
-msgstr ""
+msgstr "Transparent"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
-msgstr ""
+msgstr "Gibt an, ob der Inhalt einen transparenten Hintergrund hat"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
-msgstr ""
+msgstr "Vergrößerungsstufe"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
-msgstr ""
+msgstr "Die Vergrößerungsstufe des Inhalts"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
-msgstr ""
+msgstr "Vollständige Größenänderung"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
-msgstr ""
+msgstr "Gibt an, ob Größenänderungen den gesamten Inhalt beeinflussen"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
-msgstr ""
+msgstr "Zeichenkodierung"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
-msgstr ""
+msgstr "Die vorgegebene Zeichenkodierung der Webansicht"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
-msgstr ""
+msgstr "Benutzerdefinierte Zeichenkodierung"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
-msgstr ""
+msgstr "Die benutzerdefinierte Zeichenkodierung der Webansicht"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
-msgstr ""
+msgstr "Symboladresse"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
-msgstr ""
+msgstr "Die Adresse des favicon-Symbols für #WebKitWebView."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
@@ -729,8 +752,8 @@
 msgstr "Zurücksetzen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Durchsuchbarer _Index"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Dieser Index ist durchsuchbar. Geben Sie Suchbegriffe ein: "
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -838,27 +861,27 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
 msgid "No recent searches"
-msgstr "Keine vergangen Suchen"
+msgstr "Keine vergangenen Suchen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
 msgid "Recent searches"
-msgstr "Vergangene Suchen"
+msgstr "Letzte Suchen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
 msgid "_Clear recent searches"
-msgstr "_Limpar buscas recentes"
+msgstr "Letzte Su_chen löschen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
 msgid "term"
-msgstr "begriff"
+msgstr "Begriff"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
 msgid "definition"
-msgstr "bedeutung"
+msgstr "Festlegung"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
 msgid "press"
-msgstr "drucken"
+msgstr "drücken"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
 msgid "select"
@@ -870,11 +893,11 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
 msgid "uncheck"
-msgstr "auswählen"
+msgstr "abwählen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
 msgid "check"
-msgstr "abwählen"
+msgstr "wählen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
 msgid "jump"
@@ -882,7 +905,7 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
 msgid " files"
-msgstr " dateien"
+msgstr " Dateien"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
 msgid "Unknown"
@@ -890,186 +913,187 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
 msgid "Loading..."
-msgstr ""
+msgstr "Ladevorgang …"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
 msgid "Live Broadcast"
-msgstr ""
+msgstr "Live-Ausstrahlung"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
 msgid "audio element controller"
-msgstr ""
+msgstr "Steuerung für Audio-Elemente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
 msgid "video element controller"
-msgstr ""
+msgstr "Steuerung für Video-Elemente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
 msgid "mute"
-msgstr ""
+msgstr "Stumm schalten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
 msgid "unmute"
-msgstr ""
+msgstr "Laut schalten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
 msgid "play"
-msgstr ""
+msgstr "Abspielen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
 msgid "pause"
-msgstr ""
+msgstr "Pausieren"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
 msgid "movie time"
-msgstr ""
+msgstr "Filmdauer"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
 msgid "timeline slider thumb"
-msgstr ""
+msgstr "Rollbalken-Schieber der Zeitleiste"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
 msgid "back 30 seconds"
-msgstr ""
+msgstr "30 Sekunden zurück"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
 msgid "return to realtime"
-msgstr ""
+msgstr "Auf Echtzeit zurückstellen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
 msgid "elapsed time"
-msgstr ""
+msgstr "Vergangene Zeit"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
 msgid "remaining time"
-msgstr ""
+msgstr "Verbleibende Zeit"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
-#, fuzzy
 msgid "status"
 msgstr "Status"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
 msgid "fullscreen"
-msgstr ""
+msgstr "Vollbild"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
 msgid "fast forward"
-msgstr ""
+msgstr "Vorspulen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
 msgid "fast reverse"
-msgstr ""
+msgstr "Zurückspulen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
 msgid "show closed captions"
-msgstr ""
+msgstr "geschlossene Beschriftung zeigen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
 msgid "hide closed captions"
-msgstr ""
+msgstr "geschlossene Beschriftung verbergen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
 msgid "audio element playback controls and status display"
-msgstr ""
+msgstr "Wiedergabesteuerung und Statusanzeige für Audio-Elemente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
 msgid "video element playback controls and status display"
-msgstr ""
+msgstr "Wiedergabesteuerung und Statusanzeige für Video-Elemente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
 msgid "mute audio tracks"
-msgstr ""
+msgstr "Tonspuren stumm schalten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
 msgid "unmute audio tracks"
-msgstr ""
+msgstr "Tonspuren laut schalten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
 msgid "begin playback"
-msgstr ""
+msgstr "Wiedergabe starten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
 msgid "pause playback"
-msgstr ""
+msgstr "Wiedergabe pausieren"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
 msgid "movie time scrubber"
-msgstr ""
+msgstr "Zeitschieber für Filme"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
 msgid "movie time scrubber thumb"
-msgstr ""
+msgstr "Zeitschiebergriff für Filme"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
 msgid "seek movie back 30 seconds"
-msgstr ""
+msgstr "Film 30 Sekunden zurückspulen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
 msgid "return streaming movie to real time"
-msgstr ""
+msgstr "Streaming-Video auf Echtzeit zurückstellen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
 msgid "current movie time in seconds"
-msgstr ""
+msgstr "Aktuelle Filmwiedergabezeit in Sekunden"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
 msgid "number of seconds of movie remaining"
-msgstr ""
+msgstr "Anzahl verbleibender Sekunden des Films"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
 msgid "current movie status"
-msgstr ""
+msgstr "Status des aktuellen Films"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
 msgid "seek quickly back"
-msgstr ""
+msgstr "Schnell zurückspulen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
 msgid "seek quickly forward"
-msgstr ""
+msgstr "Schnell vorspulen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
 msgid "Play movie in fullscreen mode"
-msgstr ""
+msgstr "Den momentanen Film im Vollbildmodus wiedergeben"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
 msgid "start displaying closed captions"
-msgstr ""
+msgstr "beginnen, geschlossene Beschriftung zu zeigen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
 msgid "stop displaying closed captions"
-msgstr ""
+msgstr "beenden, geschlossene Beschriftung zu zeigen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
-#, fuzzy
 msgid "indefinite time"
-msgstr "bedeutung"
+msgstr "Unbegrenzte Zeit"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
 msgid "value missing"
-msgstr ""
+msgstr "Wert fehlt"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
 msgid "type mismatch"
-msgstr ""
+msgstr "Typ passt nicht"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
 msgid "pattern mismatch"
-msgstr ""
+msgstr "Muster passt nicht"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
 msgid "too long"
-msgstr ""
+msgstr "Zu lang"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
 msgid "range underflow"
-msgstr ""
+msgstr "Bereich unterschritten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
 msgid "range overflow"
-msgstr ""
+msgstr "Bereich überschritten"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
-msgstr ""
+msgstr "Schritt passt nicht"
+
+#~ msgid "_Searchable Index"
+#~ msgstr "Durchsuchbarer _Index"
diff --git a/WebKit/gtk/po/en_GB.po b/WebKit/gtk/po/en_GB.po
index 77bf543..7174fc7 100644
--- a/WebKit/gtk/po/en_GB.po
+++ b/WebKit/gtk/po/en_GB.po
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: webkit HEAD\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-07-14 02:01+0100\n"
 "Last-Translator: Bruce Cowan <bcowan@fastmail.co.uk>\n"
 "Language-Team: British English <en@li.org>\n"
@@ -69,90 +69,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Insert Unicode Control Character"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Network Request"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "The network request for the URI that should be downloaded"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Network Request"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "The network request for the URI that should be downloaded"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "Destination URI"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "The destination URI where to save the file"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Suggested Filename"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "The filename suggested as default when saving"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Progress"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Determines the current progress of the download"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Status"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Determines the current status of the download"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Current Size"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "The length of the data already downloaded"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Total Size"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "The total size of the file"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "User cancelled the download"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "A username and password are being requested by the site %s"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Username:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Password:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Remember password"
@@ -167,7 +171,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Title"
 
@@ -177,7 +181,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -308,418 +312,427 @@
 msgid "The target frame for the navigation"
 msgstr "The URI that was requested as the target for the navigation"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Default Encoding"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "The default encoding used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Cursive Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "The default Cursive font family used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Default Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "The default font family used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Fantasy Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "The default Fantasy font family used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Monospace Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "The default font family used to display monospace text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Sans Serif Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "The default Sans Serif font family used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Serif Font Family"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "The default Serif font family used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Default Font Size"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "The default font size used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Default Monospace Font Size"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "The default font size used to display monospace text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Minimum Font Size"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "The minimum font size used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Minimum Logical Font Size"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "The minimum logical font size used to display text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Enforce 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Enforce a resolution of 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Auto Load Images"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Load images automatically."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Auto Shrink Images"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Automatically shrink standalone images to fit."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Print Backgrounds"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Whether background images should be printed."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Enable Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Enable embedded scripting languages."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Enable Plugins"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Enable embedded plugin objects."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Resizable Text Areas"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Whether text areas are resizable."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "User Stylesheet URI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "The URI of a stylesheet that is applied to every page."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Zoom Stepping Value"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "The value by which the zoom level is changed when zooming in or out."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Enable Developer Extras"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Enables special extensions that help developers"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Enable Private Browsing"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Enables private browsing mode"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "Check Spelling While _Typing"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "Enable Private Browsing"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Enable Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Enable Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Whether background images should be printed."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Enable JavaScript profiling"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Returns the @web_view's document title"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Returns the current URI of the contents displayed by the @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Copy target list"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "The list of targets this web view supports for clipboard copying"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Paste target list"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "The list of targets this web view supports for clipboard pasting"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Settings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "An associated WebKitWebSettings instance"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Web Inspector"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "The associated WebKitWebInspector instance"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Editable"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Whether content can be modified by the user"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Transparent"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Whether content has a transparent background"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Zoom level"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "The level of zoom of the content"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Full content zoom"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Whether the full content is scaled when zooming"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Encoding"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "The default encoding of the web view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Custom Encoding"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "The custom encoding of the web view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -733,8 +746,8 @@
 msgstr "Reset"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "_Searchable Index"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1077,3 +1090,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "_Searchable Index"
diff --git a/WebKit/gtk/po/es.po b/WebKit/gtk/po/es.po
index 758dd58..b06ba1b 100644
--- a/WebKit/gtk/po/es.po
+++ b/WebKit/gtk/po/es.po
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: webkit.webkit.HEAD.es.po\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-06-11 15:36+0200\n"
 "Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
 "Language-Team: Español <gnome-es-list@gnome.org>\n"
@@ -71,88 +71,92 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Insertar un carácter de control Unicode"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 msgid "Network Response"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 msgid "The network response for the URI that should be downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Progreso"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Estado"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Determina el estado actual de la descarga"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Tamaño actual"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Tamaño total"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Nombre de usuario:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Contraseña:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Recordar contraseña"
@@ -167,7 +171,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Título"
 
@@ -177,7 +181,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -304,413 +308,421 @@
 msgid "The target frame for the navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Codificación predeterminada"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Tamaño de predeterminado de tipografía"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Tamaño mínimo de tipografía"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Activar complementos"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "URI de la hoja de estilo del usuario"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 msgid "Enable XSS Auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 msgid "Enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 msgid "Whether the page cache should be used"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Copiar la lista de destinos"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Pegar la lista de destinos"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Ajustes"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Inspector web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Editable"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Transparente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Nivel de ampliación"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "El nivel de ampliación del contenido"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Codificación"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "La codificación predeterminada de la vista web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -724,8 +736,8 @@
 msgstr "Restablecer"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Índice buscable"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1068,3 +1080,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "Índice buscable"
diff --git a/WebKit/gtk/po/et.po b/WebKit/gtk/po/et.po
new file mode 100644
index 0000000..6bb9033
--- /dev/null
+++ b/WebKit/gtk/po/et.po
@@ -0,0 +1,803 @@
+# Webkit'i tõlge eesti keelde.
+# Estonian translation for webkit.
+#
+# Copyright (C) 2010 The WebKitGTK+ Team
+# This file is distributed under the same license as the webkit package.
+#
+# Rene Pärts <rene87 hot ee>, 2010.
+# Priit Laes <plaes plaes org>, 2010
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit 1.1.22\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-16 15:01-0200\n"
+"PO-Revision-Date: 2010-02-23 14:25+0300\n"
+"Last-Translator: Priit Laes <rene87@hot.ee>\n"
+"Language-Team: Estonian <gnome-et@linux.ee>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "Upload File"
+msgstr "Faili valimine"
+
+msgid "Input _Methods"
+msgstr "Sisestus_meetodid"
+
+msgid "LRM _Left-to-right mark"
+msgstr "LRM _Vasakult paremale märk"
+
+msgid "RLM _Right-to-left mark"
+msgstr "RLM _Paremalt vasakule märk"
+
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE Va_sakult paremale põimimine"
+
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE Pa_remalt vasakule põimimine"
+
+msgid "LRO Left-to-right _override"
+msgstr "LRO Vasakult paremale ü_lekirjutamine"
+
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO Paremalt vasakule üle_kirjutamine"
+
+msgid "PDF _Pop directional formatting"
+msgstr "PDF _Suundvormindus"
+
+msgid "ZWS _Zero width space"
+msgstr "ZWS _Null-laiusega tühik"
+
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ Null-laiusega ü_hendaja"
+
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWJ Null-laiusega _mitteühendaja"
+
+msgid "_Insert Unicode Control Character"
+msgstr "L_isa Unicode'i juhtmärk"
+
+msgid "Network Request"
+msgstr "Võrgupäring"
+
+msgid "The network request for the URI that should be downloaded"
+msgstr "Võrgupäring allalaaditavale URI-le"
+
+msgid "Network Response"
+msgstr "Võrgu vastus"
+
+msgid "The network response for the URI that should be downloaded"
+msgstr "Võrgu vastus allalaaditavale URI-le"
+
+msgid "Destination URI"
+msgstr "Sihtkoha URI"
+
+msgid "The destination URI where to save the file"
+msgstr "Salvestatava faili sihtkoha URI"
+
+msgid "Suggested Filename"
+msgstr "Soovitatav failinimi"
+
+msgid "The filename suggested as default when saving"
+msgstr "Salvestamisel pakutav vaikimisi failinimi"
+
+msgid "Progress"
+msgstr "Edenemine"
+
+msgid "Determines the current progress of the download"
+msgstr "Tagastab allalaadimise edenemise"
+
+msgid "Status"
+msgstr "Olek"
+
+msgid "Determines the current status of the download"
+msgstr "Tagastab allalaadimise oleku"
+
+msgid "Current Size"
+msgstr "Hetkesuurus"
+
+msgid "The length of the data already downloaded"
+msgstr "Allalaetud andmete maht"
+
+msgid "Total Size"
+msgstr "Kogusuurus"
+
+msgid "The total size of the file"
+msgstr "Faili kogusuurus"
+
+msgid "User cancelled the download"
+msgstr "Allalaadimine katkestatud kasutaja poolt"
+
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Saidi %s poolt küsitakse kasutajanime ja parooli"
+
+msgid "Username:"
+msgstr "Kasutajanimi:"
+
+msgid "Password:"
+msgstr "Parool:"
+
+msgid "_Remember password"
+msgstr "_Parooli meeldejätmine"
+
+msgid "Name"
+msgstr "Nimi"
+
+msgid "The name of the frame"
+msgstr "Raami nimi"
+
+msgid "Title"
+msgstr "Pealkiri"
+
+msgid "The document title of the frame"
+msgstr "Raami dokumendi pealkiri"
+
+msgid "URI"
+msgstr "URI"
+
+msgid "The current URI of the contents displayed by the frame"
+msgstr "Raami sisu aktiivne URI"
+
+msgid "Horizontal Scrollbar Policy"
+msgstr "Horisontaalse kerimisriba kasutusreegel"
+
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr "Määrab raami horisontaalse kerimisriba kasutusreeglid."
+
+msgid "Vertical Scrollbar Policy"
+msgstr "Vertikaalse kerimisriba reegel"
+
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr "Määrab raami vertikaalse kerimisriba kasutusreeglid."
+
+msgid "The title of the history item"
+msgstr "Ajalookirje pealkiri"
+
+msgid "Alternate Title"
+msgstr "Alternatiivne pealkiri"
+
+msgid "The alternate title of the history item"
+msgstr "Ajalookirje alternatiivne pealkiri"
+
+msgid "The URI of the history item"
+msgstr "Ajalookirje URI"
+
+msgid "Original URI"
+msgstr "Algne URI"
+
+msgid "The original URI of the history item"
+msgstr "Ajalookirje algne URI"
+
+msgid "Last visited Time"
+msgstr "Viimase külastuse aeg"
+
+msgid "The time at which the history item was last visited"
+msgstr "Ajalookirje viimase külastuse aeg"
+
+msgid "Web View"
+msgstr "Veebivaade"
+
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "Veebiinspektorit esitav veebivaade"
+
+msgid "Inspected URI"
+msgstr "Inspekteeritav URI"
+
+msgid "The URI that is currently being inspected"
+msgstr "Hetkel inspekteeritav URI"
+
+msgid "Enable JavaScript profiling"
+msgstr "Luba JavaScript'i profileerimine"
+
+msgid "Profile the executed JavaScript."
+msgstr "Käivitatava JavaScript'i profileerimine."
+
+msgid "Enable Timeline profiling"
+msgstr "Luba ajatelje profileerimine"
+
+msgid "Profile the WebCore instrumentation."
+msgstr "WebCore'i jälgimisvihjete profileerimine"
+
+msgid "Reason"
+msgstr "Põhjus"
+
+msgid "The reason why this navigation is occurring"
+msgstr "Navigeerimistegevuse esilekutsumise põhjus"
+
+msgid "The URI that was requested as the target for the navigation"
+msgstr ""
+
+msgid "Button"
+msgstr "Nupp"
+
+msgid "The button used to click"
+msgstr "Klõpsamiseks kasutatud nupp"
+
+msgid "Modifier state"
+msgstr "Muuteklahvi olek"
+
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "Muuteklahvide olekut esindav bitimask"
+
+msgid "Target frame"
+msgstr "Sihtraam"
+
+msgid "The target frame for the navigation"
+msgstr "Navigeerimise sihtraam"
+
+msgid "Default Encoding"
+msgstr "Vaikimisi kodeering"
+
+msgid "The default encoding used to display text."
+msgstr "Vaikimisi kasutatav kodeering teksti kuvamiseks."
+
+msgid "Cursive Font Family"
+msgstr "Kursiivne kirjaperekond"
+
+msgid "The default Cursive font family used to display text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi kursiivne kirjaperekond."
+
+msgid "Default Font Family"
+msgstr "Vaikimisi kirjaperekond"
+
+msgid "The default font family used to display text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi kirjaperekond."
+
+msgid "Fantasy Font Family"
+msgstr "Erikujuline kirjaperekond"
+
+msgid "The default Fantasy font family used to display text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi erikujuline kirjaperekond."
+
+msgid "Monospace Font Family"
+msgstr "Püsisammuga kirjaperekond"
+
+msgid "The default font family used to display monospace text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi püsisammuga kirjaperekond."
+
+msgid "Sans Serif Font Family"
+msgstr "Seriifideta kirjaperekond"
+
+msgid "The default Sans Serif font family used to display text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi seriifideta kirjaperekond."
+
+msgid "Serif Font Family"
+msgstr "Seriifidega kirjaperekond"
+
+msgid "The default Serif font family used to display text."
+msgstr "Teksti kuvamiseks kasutatav vaikimisi seriifidega kirjaperekond."
+
+msgid "Default Font Size"
+msgstr "Vaikimisi kirjasuurus"
+
+msgid "The default font size used to display text."
+msgstr "Vaikimisi kirjasuurus teksti kuvamiseks."
+
+msgid "Default Monospace Font Size"
+msgstr "Vaikimisi püsisammuga kirja suurus"
+
+msgid "The default font size used to display monospace text."
+msgstr "Vaikimisi kirjasuurus püsisammuga teksti kuvamiseks."
+
+msgid "Minimum Font Size"
+msgstr "Väikseim kirjasuurus"
+
+msgid "The minimum font size used to display text."
+msgstr "Väikseim kirjasuurus teksti kuvamiseks."
+
+msgid "Minimum Logical Font Size"
+msgstr "Väikseim loogilise kirjatüübi kirjasuurus"
+
+msgid "The minimum logical font size used to display text."
+msgstr "Väikseim loogilise kirjatüübi kirjasuurus teksti kuvamiseks."
+
+msgid "Enforce 96 DPI"
+msgstr "Lahutusvõime jõuga 96 DPI"
+
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Pealesunnitud ekraanilahutus on 96 DPI"
+
+msgid "Auto Load Images"
+msgstr "Automaatne piltide laadimine"
+
+msgid "Load images automatically."
+msgstr "Pildid laaditakse automaatselt."
+
+msgid "Auto Shrink Images"
+msgstr "Piltide automaatne vähendamine"
+
+msgid "Automatically shrink standalone images to fit."
+msgstr "Pildid vähendatakse automaatselt sobivaks."
+
+msgid "Print Backgrounds"
+msgstr "Tausta printimine"
+
+msgid "Whether background images should be printed."
+msgstr "Kas printimisel kaasatakse taustapildid või mitte."
+
+msgid "Enable Scripts"
+msgstr "Skriptide lubamine"
+
+msgid "Enable embedded scripting languages."
+msgstr "Manus-skriptikeelte lubamine."
+
+msgid "Enable Plugins"
+msgstr "Pluginate lubamine"
+
+msgid "Enable embedded plugin objects."
+msgstr "Põimitud plugina objektide lubamine."
+
+msgid "Resizable Text Areas"
+msgstr "Muudetav tekstiväljade suurus"
+
+msgid "Whether text areas are resizable."
+msgstr "Kas teksiväljade suurus on muudetav."
+
+msgid "User Stylesheet URI"
+msgstr "Kasutaja laaditabeli URI"
+
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "Igale lehele rakendatava laaditabeli URI."
+
+msgid "Zoom Stepping Value"
+msgstr "Suurenduse samm"
+
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr "Suurenduse muutumise samm suurendamisel ja vähendamisel."
+
+msgid "Enable Developer Extras"
+msgstr "Arendaja lisade lubamine"
+
+msgid "Enables special extensions that help developers"
+msgstr "Arendajaile mõeldud erilaienduste lubamine"
+
+msgid "Enable Private Browsing"
+msgstr "Privaatns sirvimise lubamine"
+
+msgid "Enables private browsing mode"
+msgstr "Privaatse sirvimisrežiimi lubamine"
+
+msgid "Enable Spell Checking"
+msgstr "Õigekirjakontrolli lubamine"
+
+msgid "Enables spell checking while typing"
+msgstr "Lubab trükkimisel kontrollida õigekirja"
+
+msgid "Languages to use for spell checking"
+msgstr "Õigekirjakontrollis kasutatavad keeled"
+
+msgid "Comma separated list of languages to use for spell checking"
+msgstr ""
+"Komadega eraldatud loend õigekirja kontrollimisel kasutatavatest keeltest"
+
+msgid "Enable Caret Browsing"
+msgstr "Kursoriga sirvimine lubatud"
+
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr "Kas lubada klaviatuurihõlbustused navigeerimiseks"
+
+msgid "Enable HTML5 Database"
+msgstr "HTML5 andmebaasitoe lubamine"
+
+msgid "Whether to enable HTML5 database support"
+msgstr "Kas lubada HTML5 andmebaasi tugi"
+
+msgid "Enable HTML5 Local Storage"
+msgstr "HTML5 kohaliku salvesti lubamine"
+
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Kas lubada HTML5 kohaliku salvesti tugi"
+
+msgid "Enable XSS Auditor"
+msgstr "XSS audiitori lubamine"
+
+msgid "Whether to enable teh XSS auditor"
+msgstr "Kas lubada XSS audiitor"
+
+msgid "User Agent"
+msgstr "Sirvija identiteet"
+
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "WebKitGtk poolt kasutatav identiteet"
+
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript tohib aknaid automaatselt avada"
+
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Kas JavaScript tohib aknaid automaatselt avada või mitte"
+
+msgid "Enable offline web application cache"
+msgstr "Ühenduseta veebirakenduste vahemälu lubamine"
+
+msgid "Whether to enable offline web application cache"
+msgstr "Kas lubada ühenduseta veebirakenduste vahemälu"
+
+msgid "Editing behavior"
+msgstr "Redigeerimisrežiimis käitumine"
+
+msgid "The behavior mode to use in editing mode"
+msgstr "Redigeerimisrežiimis kasutatava käitumisrežiim"
+
+msgid "Enable universal access from file URIs"
+msgstr "Faili URI-dele üleüldise ligipääsu lubamine"
+
+msgid "Whether to allow universal access from file URIs"
+msgstr "Kas lubada faili URI-dele üleüldine ligipääs"
+
+msgid "Enable DOM paste"
+msgstr "DOM-põhise asetamise lubamine"
+
+msgid "Whether to enable DOM paste"
+msgstr "Kas lubada DOM-põhine asetamine"
+
+msgid "Tab key cycles through elements"
+msgstr "Tabulaator liigub elementide vahel"
+
+msgid "Whether the tab key cycles through elements on the page."
+msgstr "Kas tabulaatoriga liigutakse lehe elementide vahel või mitte."
+
+msgid "Enable Default Context Menu"
+msgstr "Vaikimisi kontekstimenüü lubamine"
+
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr "Lubab parem-klõpsudel vaikimisi kontekstimenüüd luua"
+
+msgid "Enable Site Specific Quirks"
+msgstr "Lehepõhiste ümbernurgalahenduste lubamine"
+
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "Lubab kasutada lehepõhiseid ümbernurgalahendusi"
+
+msgid "Enable page cache"
+msgstr "Lehtede vahemälu lubamine"
+
+msgid "Whether the page cache should be used"
+msgstr "Kas kasutada lehtede vahemälu"
+
+msgid "Auto Resize Window"
+msgstr "Akna suuruse automaatne muutmine"
+
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr "Automaatne ülemtaseme akna suuruse muutmine lehepoolsel päringul"
+
+msgid "Returns the @web_view's document title"
+msgstr "Tagastab @web_view dokumendi pealkirja"
+
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Tagastab @web_view-s kuvatava sisu aktiivse URI"
+
+msgid "Copy target list"
+msgstr "Kopeerimisoperatsiooni sihtkohtade loend"
+
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+
+msgid "Paste target list"
+msgstr "Asetusoperatsiooni sihtkohtade loend"
+
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+
+msgid "Settings"
+msgstr "Seaded"
+
+msgid "An associated WebKitWebSettings instance"
+msgstr ""
+
+msgid "Web Inspector"
+msgstr "Veebiinspektor"
+
+msgid "The associated WebKitWebInspector instance"
+msgstr ""
+
+msgid "Editable"
+msgstr "Redigeeritav"
+
+msgid "Whether content can be modified by the user"
+msgstr "Kas sisu on kasutaja poolt muudetav või mitte"
+
+msgid "Transparent"
+msgstr "Läbipaistvus"
+
+msgid "Whether content has a transparent background"
+msgstr "Kas sisul on läbipaistev taust või mitte"
+
+msgid "Zoom level"
+msgstr "Suurendusaste"
+
+msgid "The level of zoom of the content"
+msgstr "Sisu suurendusaste"
+
+msgid "Full content zoom"
+msgstr ""
+
+msgid "Whether the full content is scaled when zooming"
+msgstr ""
+
+msgid "Encoding"
+msgstr "Kodeering"
+
+msgid "The default encoding of the web view"
+msgstr "Vaikimisi kodeering veebivaate jaoks"
+
+msgid "Custom Encoding"
+msgstr "Kohandatud kodeering"
+
+msgid "The custom encoding of the web view"
+msgstr "Kohandatud kodeering veebivaate jaoks"
+
+msgid "Icon URI"
+msgstr "Ikooni URI"
+
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "Veebilehe tunnusikooni URI #WebKitWebView jaoks."
+
+msgid "Submit"
+msgstr "Saada"
+
+msgid "Reset"
+msgstr "Taasta"
+
+msgid "_Searchable Index"
+msgstr "_Otsitav indeks"
+
+msgid "Choose File"
+msgstr "Vali fail"
+
+msgid "(None)"
+msgstr "(Puudub)"
+
+msgid "Open Link in New _Window"
+msgstr "Ava link _uues aknas"
+
+msgid "_Download Linked File"
+msgstr "Salvesta _link"
+
+msgid "Copy Link Loc_ation"
+msgstr "K_opeeri lingi asukoht"
+
+msgid "Open _Image in New Window"
+msgstr "Ava _pilt uues aknas"
+
+msgid "Sa_ve Image As"
+msgstr "_Salvesta pilt"
+
+msgid "Cop_y Image"
+msgstr "_Kopeeri pilt"
+
+msgid "Open _Frame in New Window"
+msgstr "Ava _raam uues aknas"
+
+msgid "_Reload"
+msgstr "_Laadi uuesti"
+
+msgid "No Guesses Found"
+msgstr "Vastavusi ei leitud"
+
+msgid "_Ignore Spelling"
+msgstr "_Eira õigekirja"
+
+msgid "_Learn Spelling"
+msgstr "Õ_pi õigekirja"
+
+msgid "_Search the Web"
+msgstr "_Otsi veebist"
+
+msgid "_Look Up in Dictionary"
+msgstr "_Otsi sõnaraamatust"
+
+msgid "_Open Link"
+msgstr "_Ava link"
+
+msgid "Ignore _Grammar"
+msgstr "Eira _grammatikat"
+
+msgid "Spelling and _Grammar"
+msgstr "Õigekiri ja _grammatika"
+
+msgid "_Show Spelling and Grammar"
+msgstr "_Näita õigakirja ja grammatikat"
+
+msgid "_Hide Spelling and Grammar"
+msgstr "_Peida õigakiri ja grammatika"
+
+msgid "_Check Document Now"
+msgstr "_Kontrolli dokumenti"
+
+msgid "Check Spelling While _Typing"
+msgstr "Õigekirjakontroll _sisestamise ajal"
+
+msgid "Check _Grammar With Spelling"
+msgstr "Õigekirja ja _grammatika kontrollimine"
+
+msgid "_Font"
+msgstr "_Kirjatüüp"
+
+msgid "_Outline"
+msgstr "_Kontuur"
+
+msgid "Inspect _Element"
+msgstr "Uuri _elementi"
+
+msgid "No recent searches"
+msgstr "Hiljutised otsingud puuduvad"
+
+msgid "Recent searches"
+msgstr "Hiljutised otsingud"
+
+msgid "_Clear recent searches"
+msgstr "_Kustuta hiljutised otsingud"
+
+msgid "term"
+msgstr "termin"
+
+msgid "definition"
+msgstr "definitsoon"
+
+msgid "press"
+msgstr "vajuta"
+
+msgid "select"
+msgstr "vali"
+
+msgid "activate"
+msgstr "aktiveeri"
+
+msgid "uncheck"
+msgstr ""
+
+msgid "check"
+msgstr "kontrolli"
+
+msgid "jump"
+msgstr "hüppa"
+
+msgid " files"
+msgstr " faili"
+
+msgid "Unknown"
+msgstr "Tundmatu"
+
+msgid "Loading..."
+msgstr "Laadimine..."
+
+msgid "Live Broadcast"
+msgstr "Otseülekanne"
+
+msgid "audio element controller"
+msgstr "helielemendi juhtija"
+
+msgid "video element controller"
+msgstr "videoelemendi juhtija"
+
+msgid "mute"
+msgstr "vaigista"
+
+msgid "unmute"
+msgstr "taasta heli"
+
+msgid "play"
+msgstr "esita"
+
+msgid "pause"
+msgstr "paus"
+
+msgid "movie time"
+msgstr "filmi aeg"
+
+msgid "timeline slider thumb"
+msgstr ""
+
+msgid "back 30 seconds"
+msgstr "30 sekundit tagasi"
+
+msgid "return to realtime"
+msgstr "tagasta reaalajas"
+
+msgid "elapsed time"
+msgstr "aega kulunud"
+
+msgid "remaining time"
+msgstr "aega jäänud"
+
+msgid "status"
+msgstr "olek"
+
+msgid "fullscreen"
+msgstr "täisekraan"
+
+msgid "fast forward"
+msgstr "edasikerimine"
+
+msgid "fast reverse"
+msgstr "tagasikerimine"
+
+msgid "show closed captions"
+msgstr ""
+
+msgid "hide closed captions"
+msgstr ""
+
+msgid "audio element playback controls and status display"
+msgstr ""
+
+msgid "video element playback controls and status display"
+msgstr ""
+
+msgid "mute audio tracks"
+msgstr "helide vaigistamine"
+
+msgid "unmute audio tracks"
+msgstr "helide taastamine"
+
+msgid "begin playback"
+msgstr "esitamise alustamine"
+
+msgid "pause playback"
+msgstr "esitamise paus"
+
+msgid "movie time scrubber"
+msgstr ""
+
+msgid "movie time scrubber thumb"
+msgstr ""
+
+msgid "seek movie back 30 seconds"
+msgstr "filmi kerimine 30 sekundit tagasi"
+
+msgid "return streaming movie to real time"
+msgstr "filmi voogedastamine reaalajas"
+
+msgid "current movie time in seconds"
+msgstr "filmi kestus sekundites"
+
+msgid "number of seconds of movie remaining"
+msgstr "filmi lõpuni jäänud sekundite arv"
+
+msgid "current movie status"
+msgstr "filmi olek"
+
+msgid "seek quickly back"
+msgstr "kiire tagasikerimine"
+
+msgid "seek quickly forward"
+msgstr "kiire edasikerimine"
+
+msgid "Play movie in fullscreen mode"
+msgstr "Filmi esitamine täisekraanvaates"
+
+msgid "start displaying closed captions"
+msgstr "alusta suletud alapealkirjade näitamist"
+
+msgid "stop displaying closed captions"
+msgstr "lõpeta suletud alapealkirjade näitamine"
+
+msgid "indefinite time"
+msgstr "umbmäärane aeg"
+
+msgid "value missing"
+msgstr "puuduv väärtus"
+
+msgid "type mismatch"
+msgstr "tüübi sobimatus"
+
+msgid "pattern mismatch"
+msgstr "mustri sobimatus"
+
+msgid "too long"
+msgstr "liiga pikk"
+
+msgid "range underflow"
+msgstr "vahemiku alatäitumus"
+
+msgid "range overflow"
+msgstr "vahemiku ületäitumus"
+
+msgid "step mismatch"
+msgstr "astme sobimatus"
diff --git a/WebKit/gtk/po/gu.po b/WebKit/gtk/po/gu.po
new file mode 100644
index 0000000..b0556e7
--- /dev/null
+++ b/WebKit/gtk/po/gu.po
@@ -0,0 +1,1084 @@
+# translation of webkit.gu.po to Gujarati
+# Gujarati translations for PACKAGE package.
+# This file is put in the public domain.
+#
+# Ankitkumar Patel <ankit@redhat.com>, 2010.
+# Ankit Patel <ankit@redhat.com>, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit.gu\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-02-23 13:54+0530\n"
+"Last-Translator: Ankit Patel <ankit@redhat.com>\n"
+"Language-Team: Gujarati <fedora-trans-gu@redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms:  nplurals=2; plural=(n!=1);\n"
+"\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+msgid "Upload File"
+msgstr "ફાઈલ અપલોડ કરો"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "ઈનપુટ પદ્ધતિઓ (_M)"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LRM _Left-to-right mark"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM _Right-to-left mark"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE Left-to-right _embedding"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE Right-to-left e_mbedding"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO Left-to-right _override"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO Right-to-left o_verride"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF _Pop directional formatting"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS _Zero width space"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ Zero width _joiner"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ Zero width _non-joiner"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "યુનિકોડ નિયંત્રક અક્ષર દાખલ કરો (_I)"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "Network Request"
+msgstr "નેટવર્ક અરજી"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
+msgid "The network request for the URI that should be downloaded"
+msgstr "જે URI ડાઉનલોડ થવી જોઈએ તે માટેની નેટવર્ક અરજી"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+msgid "Network Response"
+msgstr "નેટવર્ક પ્રત્યુત્તર"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+msgid "The network response for the URI that should be downloaded"
+msgstr "જે URI ડાઉનલોડ થવી જોઈએ તે માટેનો નેટવર્ક પ્રત્યુત્તર"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
+msgid "Destination URI"
+msgstr "અંતિમ મુકામ URI"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
+msgid "The destination URI where to save the file"
+msgstr "અંતિમ મુકામ URI કે જ્યાં ફાઈલ સંગ્રહવી જોઈએ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
+msgid "Suggested Filename"
+msgstr "સૂચનીય ફાઈલનામ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
+msgid "The filename suggested as default when saving"
+msgstr "સંગ્રહતી વખતે મૂળભૂત રીતે સૂચવાયેલ ફાઈલનામ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
+msgid "Progress"
+msgstr "પ્રગતિ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
+msgid "Determines the current progress of the download"
+msgstr "ડાઉનલોડની વર્તમાન પ્રગતિ નક્કી કરે છે"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
+msgid "Status"
+msgstr "પરિસ્થિતિ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
+msgid "Determines the current status of the download"
+msgstr "ડાઉનલોડની વર્તમાન પરિસ્થિતિ નક્કી કરે છે"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
+msgid "Current Size"
+msgstr "વર્તમાન માપ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
+msgid "The length of the data already downloaded"
+msgstr "ડાઉનલોડ થયેલ માહિતીની લંબાઈ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
+msgid "Total Size"
+msgstr "કુલ માપ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
+msgid "The total size of the file"
+msgstr "ફાઈલનું કુલ માપ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
+msgid "User cancelled the download"
+msgstr "વપરાશકર્તાએ ડાઉનલોડ રદ કર્યું"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "સાઈટ %s દ્વારા વપરાશકર્તાનામ અને પાસવર્ડની અરજી કરવામાં આવી છે"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "વપરાશકર્તાનામ:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "પાસવર્ડ:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+msgid "_Remember password"
+msgstr "પાસવર્ડ યાદ રાખો (_R)"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+msgid "Name"
+msgstr "નામ"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "The name of the frame"
+msgstr "ચોકઠાંનું નામ"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
+msgid "Title"
+msgstr "શીર્ષક"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+msgid "The document title of the frame"
+msgstr "ચોકઠાંનું દસ્તાવેજ શીર્ષક"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+msgid "The current URI of the contents displayed by the frame"
+msgstr "ચોકઠાં દ્વારા દર્શાવવામાં આવેલ સમાવિષ્ટોની વર્તમાન URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr "આડી સરકપટ્ટી પોલીસિ"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr "ચોકઠાંની આડી સરકપટ્ટી માટે વર્તમાન પોલીસિ નક્કી કરે છે."
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr "ઊભી સરકપટ્ટી પોલીસિ"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr "ચોકઠાંની ઊભી સરકપટ્ટી માટે વર્તમાન પોલીસિ નક્કી કરે છે."
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "ઈતિહાસ વસ્તુનું શીર્ષક"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "વૈકલ્પિક શીર્ષક"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "ઈતિહાસ વસ્તુનું વૈકલ્પિક શીર્ષક"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "ઈતિહાસ વસ્તુની URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "મૂળ URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "ઈતિહાસ વસ્તુનું મૂળ URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "છેલ્લો મુલાકાત લેવાયેલ સમય"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "સમય કે જ્યારે ઈતિહાસ વસ્તુની છેલ્લે મુલાકાત લેવામાં આવી હતી"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "વેબ દેખાવ"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "વેબ દેખાવ કે જે વેબ પરીક્ષકને પોતાને ઢાળ આપે છે"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+msgid "Inspected URI"
+msgstr "પરીક્ષિત URI"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr "URI કે જેની વર્તમાનમાં પરીક્ષા કરવામાં આવી છે"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "JavaScript રૂપરેખાકરણ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "ચલાવવામાં આવેલ JavaScript ની રૂપરેખા કરો."
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+msgid "Enable Timeline profiling"
+msgstr "સમયરેખા રૂપરેખા સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr "વેબકોર ઈન્સ્ટ્રુમેન્ટેશનની રૂપરેખા કરો."
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "કારણ"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "કારણ કે આ શોધખોળ થઈ રહી છે"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+msgid "The URI that was requested as the target for the navigation"
+msgstr "URI કે જેની શોધખોળના લક્ષ્ય તરીકે અરજી કરવામાં આવી હતી"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "બટન"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "ક્લિક કરવા માટેનું બટન"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "સુધારક સ્થિતિ"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "સુધારક કીની સ્થિતિ રજૂ કરતું બીટમાસ્ક"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+msgid "Target frame"
+msgstr "લક્ષ્ય ચોકઠું"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+msgid "The target frame for the navigation"
+msgstr "શોધખોળ માટે લક્ષ્ય ચોકઠું"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
+msgid "Default Encoding"
+msgstr "મૂળભૂત એનકોડીંગ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
+msgid "The default encoding used to display text."
+msgstr "લખાણ દર્શાવવા માટેનું મૂળભૂત એનકોડીંગ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
+msgid "Cursive Font Family"
+msgstr "કર્સીવ ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
+msgid "The default Cursive font family used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતું મૂળભૂત કર્સીવ ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
+msgid "Default Font Family"
+msgstr "મૂળભૂત ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
+msgid "The default font family used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતો મૂળભૂત ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
+msgid "Fantasy Font Family"
+msgstr "ફેન્ટસી ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
+msgid "The default Fantasy font family used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતો મૂળભૂત ફોન્ટસી ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
+msgid "Monospace Font Family"
+msgstr "મોનોસ્પેસ ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
+msgid "The default font family used to display monospace text."
+msgstr "મોનોસ્પેસ લખાણ દર્શાવવા માટે વપરાતો મૂળભૂત ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
+msgid "Sans Serif Font Family"
+msgstr "સાન્સ સેરીફ ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
+msgid "The default Sans Serif font family used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતો મૂળભૂત સાન્સ સેરીફ ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
+msgid "Serif Font Family"
+msgstr "સેરીફ ફોન્ટ પરિવાર"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
+msgid "The default Serif font family used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતો મૂળભૂત સેરીફ ફોન્ટ પરિવાર."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
+msgid "Default Font Size"
+msgstr "મૂળભૂત ફોન્ટ માપ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "The default font size used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતું મૂળભૂત માપ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
+msgid "Default Monospace Font Size"
+msgstr "મૂળભૂત મોનોસ્પેસ ફોન્ટ માપ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
+msgid "The default font size used to display monospace text."
+msgstr "મોનોસ્પેસ લખાણ દર્શાવવા માટે વપરાતું મૂળભૂત ફોન્ટ માપ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "Minimum Font Size"
+msgstr "ન્યૂનતમ ફોન્ટ માપ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
+msgid "The minimum font size used to display text."
+msgstr "લખાણ દર્શાવવા માટે વપરાતું મૂળભૂત ફોન્ટ માપ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
+msgid "Minimum Logical Font Size"
+msgstr "ન્યૂનતમ તાર્કિક ફોન્ટ માપ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
+msgid "The minimum logical font size used to display text."
+msgstr "લખાણ દર્શાવવા માટેનું ન્યૂનતમ તાર્કીક ફોન્ટ માપ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
+msgid "Enforce 96 DPI"
+msgstr "96 DPI નું દબાણ કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
+msgid "Enforce a resolution of 96 DPI"
+msgstr "96 DPI ના રીઝોલ્યુશનનું દબાણ કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
+msgid "Auto Load Images"
+msgstr "ચિત્રો આપોઆપ લાવો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Load images automatically."
+msgstr "ચિત્રો આપોઆપ લાવો."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
+msgid "Auto Shrink Images"
+msgstr "ચિત્રો આપોઆપ સંકોચો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
+msgid "Automatically shrink standalone images to fit."
+msgstr "બંધબેસાડવા માટે ચિત્રો આપોઆપ સંકોચો."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
+msgid "Print Backgrounds"
+msgstr "પાશ્વભાગો છાપો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
+msgid "Whether background images should be printed."
+msgstr "શું પાશ્વભાગ ચિત્રો છપાવા જોઈએ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
+msgid "Enable Scripts"
+msgstr "સ્ક્રિપ્ટો સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
+msgid "Enable embedded scripting languages."
+msgstr "જડિત સ્ક્રિપ્ટીંગ ભાષાઓ સક્રિય કરો."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
+msgid "Enable Plugins"
+msgstr "પ્લગઈનો સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
+msgid "Enable embedded plugin objects."
+msgstr "જડિત પ્લગઈન ઓબ્જેક્ટો સક્રિય કરો."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
+msgid "Resizable Text Areas"
+msgstr "માપ બદલી શકાય તેવા લખાણ વિસ્તારો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
+msgid "Whether text areas are resizable."
+msgstr "શું લખાણ વિસ્તારોનું માપ બદલાવી શકાય."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
+msgid "User Stylesheet URI"
+msgstr "વપરાશકર્તા સ્ટાઈલશીટ URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "સ્ટાઈલશીટની URI કે જે દરેક પાનાંને લાગુ પાડવામાં આવેલ છે."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
+msgid "Zoom Stepping Value"
+msgstr "નાનામોટાપણાની પગલાંકીય કિંમત"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr "જ્યારે નાનું કે મોટું કરી રહ્યા હોય ત્યારે કિંમત કે જેના પ્રમાણે નાનું કે મોટું થવું જોઈએ."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
+msgid "Enable Developer Extras"
+msgstr "વિકાસકર્તા ઉમેરાઓ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
+msgid "Enables special extensions that help developers"
+msgstr "વિશિષ્ટ વિસ્તરણો સક્રિય કરો કે જે વિકાસકર્તાઓને મદદરૂપ થાય"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
+msgid "Enable Private Browsing"
+msgstr "ખાનગી બ્રાઉઝીંગ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
+msgid "Enables private browsing mode"
+msgstr "ખાનગી બ્રાઉઝીંગ સ્થિતિ સક્રિય કરે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr "જોડણી ચકાસણી સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+msgid "Enables spell checking while typing"
+msgstr "લખતી વખતે જોડણી ચકાસણી સક્રિય કરે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr "જોડણી ચકાસણી માટે વાપરવાની ભાષાઓ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr "જોડણી ચકાસણી માટે વાપરવાની ભાષાઓની અલ્પવિરામથી અલગ પડેલ યાદી"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+msgid "Enable Caret Browsing"
+msgstr "કેરેટ બ્રાઉઝીંગ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr "શું સુલભતા ઉન્નત કીબોર્ડ શોધખોળ સક્રિય કરવી છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr "HTML5 ડેટાબેઝ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr "શું HTML5 ડેટાબેઝ આધાર સક્રિય કરવો છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr "HTML5 સ્થાનિય સંગ્રહ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "શું HTML5 સ્થાનિય સંગ્રહ આધાર સક્રિય કરવો છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+msgid "Enable XSS Auditor"
+msgstr "XSS સંપાદક સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr "શું XSS સંપાદક સક્રિય કરવું છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr "વપરાશકર્તા એજન્ટ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "WebKitGtk દ્વારા વાપરવામાં આવતી વપરાશકર્તા-એજન્ટ શબ્દમાળા"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript વિન્ડો આપોઆપ ખોલી શકે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr "શું JavaScript વિન્ડો આપોઆપ ખોલી શકે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr "ઓફલાઈન વેબ કાર્યક્રમ કેશ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr "શું ઓફલાઈન વેબ કાર્યક્રમ કેશ સક્રિય કરવી છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr "સંપાદન વર્તણૂક"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr "સંપાદન સ્થિતિમાં વાપરવાની વર્તણૂક સ્થિતિ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr "ફાઈલ URIs માંથી સાર્વત્રિક વપરાશ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr "શું ફાઈલ URIs માંથી સાર્વત્રિક વપરાશને પરવાનગી આપવી છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+msgid "Enable DOM paste"
+msgstr "DOM ચોંટાડવાનું સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr "શું DOM ચોંટાડવાનું સક્રિય કરવું છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr "ટેબ કી ઘટકોમાં ફરે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr "શું ટેબ કી પાનાં પરના ઘટકોમાં ફરે છે."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr "મૂળભૂત સંદર્ભ મેનુ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr "મૂળભૂત સંદર્ભ મેનુની બનાવટ માટે જમણું-ક્લિકનું નિયંત્રણ સક્રિય કરે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+msgid "Enable Site Specific Quirks"
+msgstr "સાઈટ લગતી તરકીબો સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "સાઈટ-લગતા સુગતમા ઉકેલો સક્રિય કરે છે"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr "પાનાં કેશ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+msgid "Whether the page cache should be used"
+msgstr "શું પાનાં કેશ વપરાવું જોઈએ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr "વિન્ડોનું માપ આપોઆપ બદલો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr "જ્યારે પાનું તેની અરજી કરે ત્યારે ટોચસ્તરની વિન્ડોનું માપ આપોઆપ બદલો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "JavaScript રૂપરેખાકરણ સક્રિય કરો"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
+msgid "Returns the @web_view's document title"
+msgstr "@web_view's દસ્તાવેજ શીર્ષક આપે છે"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "@web_view પ્રમાણે દર્શાવવામાં આવેલ સમાવિષ્ટોની વર્તમાન URI આપે છે"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
+msgid "Copy target list"
+msgstr "લક્ષ્ય યાદીની નકલ કરો"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr "ક્લિપબોર્ડ નકલ માટે આ વેબ દેખાવ જે લક્ષ્યોને આધાર આપે છે તેની યાદી"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
+msgid "Paste target list"
+msgstr "લક્ષ્ય યાદી ચોંટાડો"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr "ક્લિપબોર્ડ ચોંટાડવા માટે વેબ દેખાવ આધારના લક્ષ્યની યાદી"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
+msgid "Settings"
+msgstr "સુયોજનો"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
+msgid "An associated WebKitWebSettings instance"
+msgstr "સંકળાયેલ WebKitWebSettings વસ્તુ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
+msgid "Web Inspector"
+msgstr "વેબ પરીક્ષક"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
+msgid "The associated WebKitWebInspector instance"
+msgstr "સંકળાયેલ WebKitWebInspector વસ્તુ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
+msgid "Editable"
+msgstr "સંપાદકીય"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
+msgid "Whether content can be modified by the user"
+msgstr "શું વપરાશકર્તા દ્વારા સમાવિષ્ટો બદલી શકાશે"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
+msgid "Transparent"
+msgstr "પારદર્શક"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
+msgid "Whether content has a transparent background"
+msgstr "શું સમાવિષ્ટને પારદર્શક પાશ્વભાગ છે"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
+msgid "Zoom level"
+msgstr "નાનામોટાપણાનું સ્તર"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
+msgid "The level of zoom of the content"
+msgstr "સમાવિષ્ટનું નાનામોટાપણાનું સ્તર"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
+msgid "Full content zoom"
+msgstr "સંપૂર્ણ સમાવિષ્ટ નાનામોટાપણું"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
+msgid "Whether the full content is scaled when zooming"
+msgstr "શું નાનુંમોટું કરતી વખતે સંપૂર્ણ સમાવિષ્ટ ખેંચાય છે"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
+msgid "Encoding"
+msgstr "સંગ્રહપદ્ધતિ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
+msgid "The default encoding of the web view"
+msgstr "વેબ દેખાવનું મૂળભૂત એનકોડીંગ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
+msgid "Custom Encoding"
+msgstr "વૈવિધ્યપૂર્ણ એનકોડીંગ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
+msgid "The custom encoding of the web view"
+msgstr "વેબ દેખાવનું વૈવિધ્યપૂર્ણ એનકોડીંગ"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr "ચિહ્ન URI"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "#WebKitWebView માટે favicon માટે URI."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "જમા કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "પુનઃસુયોજીત કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "ફાઈલ પસંદ કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(કંઈ નહિં)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "નવી વિન્ડોમાં કડી ખોલો (_W)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "કડી થયેલ ફાઈલ ડાઉનલોડ કરો (_D)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "કડી સ્થાનની નકલ કરો (_a)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "નવી વિન્ડોમાં ચિત્ર ખોલો (_I)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "ચિત્ર આ પ્રમાણે સંગ્રહો (_v)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "ચિત્રની નકલ કરો (_y)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "ચોકઠાંને નવી વિન્ડોમાં ખોલો (_F)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "પુનઃલાવો (_R)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+msgid "No Guesses Found"
+msgstr "કોઈ ધારણાઓ મળી નહિં"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "જોડણી અવગણો (_I)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "જોડણી શીખો (_L)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "વેબ શોધો (_S)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "શબ્દકોષમાં જુઓ (_L)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "કડી ખોલો (_O)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "વ્યાકરણ અવગણો (_G)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "જોડણી અને વ્યાકરણ (_G)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "જોડણી અને વ્યાકરણ બતાવો (_S)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "જોડણી અને વ્યાકરણ છુપાવો (_H)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "દસ્તાવેજ હમણાં ચકાસો (_C)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "લખતી વખતે જોડણી ચકાસો (_T)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "જોડણી સાથે વ્યાકરણ ચકાસો (_G)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "ફોન્ટ (_F)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "બાહ્ય રેખા (_O)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+msgid "Inspect _Element"
+msgstr "ઘટકનું પરીક્ષણ કરો (_E)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "કોઈ છેલ્લી શોધો નથી"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "છેલ્લી શોધો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "છેલ્લી શોધો સાફ કરો (_C)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "પદ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "વ્યાખ્યા"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "દબાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "પસંદ કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "સક્રિયકૃત કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "ચકાસણી દૂર કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "ચકાસો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "કૂદો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+msgid " files"
+msgstr " ફાઈલો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Unknown"
+msgstr "અજ્ઞાત"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr "લાવી રહ્યા છીએ..."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr "જીવંત પ્રસારણ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr "અવાજ ઘટક નિયંત્રક"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr "વીડિયો ઘટક નિયંત્રક"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr "મૂંગુ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr "મૂંગુ દૂર કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr "વગાડો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr "અટકાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr "ચિત્રપટ સમય"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr "સમયરેખા સરકપટ્ટી થમ્બ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr "૩૦ સેકન્ડો પાછળ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr "વાસ્તવિક સમયે જાવ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr "પસાર થયેલ સમય"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr "બાકી રહેલ સમય"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+msgid "status"
+msgstr "પરિસ્થિતિ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr "સંપૂર્ણ સ્ક્રીન"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr "ઝડપી આગળ ધપાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr "ઝડપી પાછા આવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr "બંધ થયેલ કેપ્શનો બતાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr "બંધ થયેલ કેપ્શનો છુપાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr "અવાજ ઘટક વગાડવાના નિયંત્રણો અને પરિસ્થિતિ દર્શાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr "વીડિયો ઘટક વગાડવાના નિયંત્રણો અને પરિસ્થિતિ દર્શાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr "ઓડિયો ટ્રેક મૂંગા કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr "ઓડિયો ટ્રેકનું મૂંગાપણું દૂર કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr "વગાડવાનું શરૂ કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr "વગાડવાનું અટકાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr "ચિત્રપટ સમય સ્ક્રબર"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr "ચિત્રપટ સમય સ્ક્રબર થમ્બ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr "ચિત્રપટ સમય ૩૦ સેકન્ડો પાછળ લઈ જાવ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr "સ્ટ્રીમીંગ ચિત્રપટને વાસ્તવિક સમયે લાવે"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr "વર્તમાન ચિત્રપટ સમય સેકન્ડોમાં"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr "બાકી રહેલ ચિત્રપટનો સમય સેકન્ડોમાં"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr "વર્તમાન ચિત્રપટ પરિસ્થિતિ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr "ઝડપથી પાછા પહોંચો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr "ઝડપથી આગળ પહોંચો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr "ચિત્રપટને સંપૂર્ણસ્ક્રીન પરિસ્થિતિમાં વગાડો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr "બંધ કેપ્શનો દર્શાવવાનું શરૂ કરો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr "બંધ કેપ્શનો દર્શાવવાનું અટકાવો"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+msgid "indefinite time"
+msgstr "અવ્યાખ્યાયિત સમય"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr "કિંમત ગુમ થયેલ છે"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr "પ્રકાર બંધબેસતો નથી"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr "ભાત બંધબેસતી નથી"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr "ખૂબ લાંબુ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr "range underflow"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr "range overflow"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "step mismatch"
+msgstr "પગલું બંધબેસતું નથી"
+
+#~ msgid "_Searchable Index"
+#~ msgstr "શોધી શકાય તેવો અનુક્રમ (_S)"
diff --git a/WebKit/gtk/po/he.po b/WebKit/gtk/po/he.po
index 90b5d88..5359feb 100644
--- a/WebKit/gtk/po/he.po
+++ b/WebKit/gtk/po/he.po
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: webkit HEAD\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2010-02-16 18:03+0200\n"
 "Last-Translator: Gil Osher <gilosher@gmail.com>\n"
 "Language-Team: Hebrew <he@li.org>\n"
@@ -70,90 +70,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "ה_כנס תו בקרה של יוניקוד"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "בקשת רשת"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "בקשת הרשת עבור הכתובת שיש להוריד"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "בקשת רשת"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "בקשת הרשת עבור הכתובת שיש להוריד"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "כתובת יעד"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "כתובת היעד אליה שומרים את הקובץ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "שם קובץ מומלץ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "שם הקובץ המומלץ כברירת מחדל כאשר שומרים"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "התקדמות"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "מציין את ההתקדמות הנוכחית של ההורדה"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "מצב"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "מציין את המצב הנוכחי של ההורדה"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "גודל נוכחי"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "אורך המידע שכבר הורד"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "גודל כללי"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "הגודל הכללי של הקובץ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "משתמש ביטל את ההורדה"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "שם משתמש וסיסמה נדרשים על-ידי האתר %s"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "שם משתמש:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "סיסמה:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "זכור את הסיסמה"
@@ -168,7 +172,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "כותרת"
 
@@ -178,7 +182,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "כתובת"
 
@@ -309,418 +313,427 @@
 msgid "The target frame for the navigation"
 msgstr "הכתובת שנדרשה כמטרת הניווט"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "קידוד ברירת מחדל"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "קידוד ברירת המחדל להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "משפחת הגופנים מסוג Cursive"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "משפחת הגופנים מסוג Cursive ברירת מחדל המשמשים להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "משפחת גופנים ברירת מחדל"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "משפחת הגופנים לשימוש בהצגת טקסט כברירת מחדל."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "משפחת הגופנים מסוג Fantasy"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "משפחת הגופנים מסוג Fantasy ברירת מחדל המשמשים להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "משפחת הגופנים מסוג Monospace"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "משפחת הגופנים מסוג Monospace ברירת מחדל המשמשים להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "משפחת הגופנים מסוג Sans Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "משפחת הגופנים מסוג Sans Serif ברירת מחדל המשמשים להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "משפחת הגופנים מסוג Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "משפחת הגופנים מסוג Serif ברירת מחדל המשמשים להצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "גודל גופן ברירת מחדל"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "גודל הגופן לשימוש בהצגת טקסט כברירת מחדל."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "גודל גופן Monospace ברירת מחדל"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "גודל גופן ברירת מחדל לשימוש בהצגת טקסט בגופן Monospace."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "גודל גופן מינימאלי"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "גודל הגופן המינימאלי לשימוש בהצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "גודל גופן לוגי מינימאלי"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "גודל הגופן הלוגי המינימאלי לשימוש בהצגת טקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "הכרח 96 נקודות לאינץ'"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "הכרח רזולוציה של 96 נקודות לאינץ'"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "טען תמונות אוטומטית"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "טוען תמונות אוטומטית."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "כווץ תמונות אוטומטית"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "אוטומטית מכווץ תמונות בודדות על-מנת שיתאימו."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "הדפס רקעים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "האם תמונות הרקע צריכות להיות מודפסות."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "אפשר תסריטים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "אפשר שפות תסריטים מוטבעות"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "אפשר תוספים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "אפשר אובייקטי תוסף מוטבעים."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "אזורי טקסט שניתן לשנות את גודלם"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "האם לאפשר את שינוי הגודל של אזורי הטקסט."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "כתבות גיליון הסגנון של המשתמש"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "כתובת גיליון הסגנון שמוחל על כל עמוד."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "ערך צעדי הקירוב"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "הערך בו רמת הקירוב משתנה כאשר מתקרבים או מתרחקים."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "אפשר תוספות למפתחים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "מאפשר תוספות מיוחדות שיעזרו למפתחים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "אפשר גלישה פרטית"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "מאפשר את מצב הגלישה הפרטית"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "בדוק איות בזמן ה_קלדב"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "אפשר גלישה פרטית"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "אפשר תסריטים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "אפשר תסריטים"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "האם תמונות הרקע צריכות להיות מודפסות."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "אפשר אפיון JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "מחזיר את כותרת המסמך של @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "מחזיר את הכתובת הנוכחית של התוכן המוצג על-ידי @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "העתק רשימת יעדים"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "רשימת היעדים בהם תצוגת ה-Web תומכת להעתקה ללוח"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "הדבק רשימת יעדים"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "רשימת היעדים בהם תצוגת ה-Web תומכת להדבקה מהלוח"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "הגדרות"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "מופע WebKitWebSettings משויך"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "בוחן Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "מופע ה-WebKitWebInspector המשויך"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "ניתן לעריכה"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "האם התוכן יכול להשתנות על-ידי המשתמש"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "שקוף"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "האם לתוכן יש רקע שקוף"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "רמת קירוב"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "רמת הקירוב של התוכן"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "קירוב תוכן מלא"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "האם התוכן המלא מתרחב כאשר מתקרבים"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "קידוד"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "הקידוד ברירת המחדל של תצוגת ה-Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "קידוד מותאם אישית"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "הקידוד המותאם אישית של תצוגת ה-Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -734,8 +747,8 @@
 msgstr "נקה"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "אינקדס ניתן ל_חיפוש"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1078,3 +1091,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "אינקדס ניתן ל_חיפוש"
diff --git a/WebKit/gtk/po/it.po b/WebKit/gtk/po/it.po
index 3329537..6d6f0ac 100644
--- a/WebKit/gtk/po/it.po
+++ b/WebKit/gtk/po/it.po
@@ -1,19 +1,18 @@
 # This is the Italian locale translation for WebKitGtk
 # Copyright (C) 2009 Free Software Foundation, Inc.
-#
-# Luca Ferretti <elle.uca@libero.it>, 2009.
+# Luca Ferretti <lferrett@gnome.org>, 2009, 2010.
 msgid ""
 msgstr ""
 "Project-Id-Version: WebKitGtk\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-05-11 14:10+0200\n"
-"Last-Translator: Luca Ferretti <elle.uca@libero.it>\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-18 22:13+0100\n"
+"Last-Translator: Luca Ferretti <lferrett@gnome.org>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
 
 #: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
 msgid "Upload File"
@@ -22,152 +21,153 @@
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
 msgid "Input _Methods"
-msgstr "_Metodi di input"
+msgstr "Met_odi di input"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
 msgid "LRM _Left-to-right mark"
-msgstr "LRM marcatura _sinistra-destra"
+msgstr "LRM - Contrassegno _sinistra-destra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
 msgid "RLM _Right-to-left mark"
-msgstr "RLM marcatura _destra-sinistra"
+msgstr "RLM - Contrassegno _destra-sinistra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
 msgid "LRE Left-to-right _embedding"
-msgstr "LRE _inserimento sinistra-destra"
+msgstr "LRE - _Inserimento sinistra-destra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
 msgid "RLE Right-to-left e_mbedding"
-msgstr "RLE i_nserimento destra-sinistra"
+msgstr "RLE - I_nserimento destra-sinistra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
 msgid "LRO Left-to-right _override"
-msgstr "LRO _forza sinistra-destra"
+msgstr "LRO - _Forza sinistra-destra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
 msgid "RLO Right-to-left o_verride"
-msgstr "RLO f_orza destra-sinistra"
+msgstr "RLO - F_orza destra-sinistra"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
 msgid "PDF _Pop directional formatting"
-msgstr "PDF cancella formattazione direzionale"
+msgstr "PDF - Ca_ttura formattazione direzionale"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
 msgid "ZWS _Zero width space"
-msgstr "ZWS spa_zio a larghezza nulla"
+msgstr "ZWS - Spa_zio a larghezza nulla"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
 msgid "ZWJ Zero width _joiner"
-msgstr "ZWJ spazio di _unione a larghezza nulla"
+msgstr "ZWJ - Spazio di _unione a larghezza nulla"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
 msgid "ZWNJ Zero width _non-joiner"
-msgstr "ZWNJ spazio _non di unione a larghezza nulla"
+msgstr "ZWNJ - Spazio non di unione a _larghezza nulla"
 
 # merge da gtk
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
 msgid "_Insert Unicode Control Character"
-msgstr "_Inserisci carattere di controllo unicode"
+msgstr "Inserisci carattere di controllo _Unicode"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Richiesta di rete"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "La richiesta di rete per l'URI che dovrebbe essere scaricato"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 msgid "Network Response"
-msgstr "Richiesta di rete"
+msgstr "Risposta di rete"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 msgid "The network response for the URI that should be downloaded"
-msgstr "La richiesta di rete per l'URI che dovrebbe essere scaricato"
+msgstr "La risposta di rete per l'URI che dovrebbe essere scaricato"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "URI di destinazione"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "L'URI di destinazione in cui salvare il file"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Nome file suggerito"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "Il nome di file suggerito come predefinito quando si salva"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Avanzamento"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Determina l'avanzamento corrente dello scaricamento"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Stato"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Determina lo stato corrente dello scaricamento"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Dimensione corrente"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "La lunghezza dei dati già scaricati"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Dimensione totale"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "La dimensione totale del file"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "L'utente ha annullato lo scaricamento"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Il sito %s richiede un nome utente e una password"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Messaggio del server:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Nome utente:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Password:"
 
 # checkbox
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
-#, fuzzy
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 msgid "_Remember password"
-msgstr "Ricordare la password"
+msgstr "_Ricordare la password"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
@@ -179,7 +179,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Titolo"
 
@@ -189,7 +189,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -199,22 +199,24 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
-msgstr ""
+msgstr "Politica barra scorrimento orizzontale"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:345
-#, fuzzy
 msgid ""
 "Determines the current policy for the horizontal scrollbar of the frame."
-msgstr "Determina l'avanzamento corrente dello scaricamento"
+msgstr ""
+"Determina la politica attuale per la barra di scorrimento orizzontale della "
+"cornice."
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:362
 msgid "Vertical Scrollbar Policy"
-msgstr ""
+msgstr "Politica barra scorrimento verticale"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:363
-#, fuzzy
 msgid "Determines the current policy for the vertical scrollbar of the frame."
-msgstr "Determina l'avanzamento corrente dello scaricamento"
+msgstr ""
+"Determina la politica attuale per la barra di scorrimento verticale del "
+"cornice."
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
@@ -270,7 +272,7 @@
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:299
 msgid "Enable JavaScript profiling"
-msgstr "Abilitare profiling JavaScript"
+msgstr "Abilita profiling JavaScript"
 
 # FIXME
 # oppure Esegue il profiling?
@@ -279,13 +281,12 @@
 msgstr "Traccia un profilo del codice JavaScript eseguito."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
-#, fuzzy
 msgid "Enable Timeline profiling"
-msgstr "Abilitare profiling JavaScript"
+msgstr "Abilita profiling Timeline"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
-msgstr ""
+msgstr "Traccia un profilo della strumentazione WebCore."
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
 msgid "Reason"
@@ -316,20 +317,18 @@
 msgstr "Una maschera di bit che rappresenta lo stato dei tasti modificatori"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
-#, fuzzy
 msgid "Target frame"
-msgstr "Il nome della cornice"
+msgstr "Cornice destinazione"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
-#, fuzzy
 msgid "The target frame for the navigation"
-msgstr "L'URI che è stata richiesta come destinazione della navigazione"
+msgstr "La cornice di destinazione per la navigazione"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Codifica predefinita"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "La codifica predefinita usata per mostrare il testo."
 
@@ -338,90 +337,90 @@
 #  * nella "breve" si lascia la forma inglese (es. sans serif) nella lunga 
 #    si mette la forma italiana (es. senza grazie)
 # Ciò per mantenere corte le "brevi" e per permettere che entrambe le diciture siano presenti
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Famiglia carattere corsivo"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr ""
 "La famiglia del tipo di carattere \"corsivo\" predefinito usata per mostrare "
 "il testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Famiglia carattere predefinita"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr ""
 "La famiglia del tipo di carattere predefinito usata per mostrare il testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Famiglia carattere fantasia"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr ""
 "La famiglia del tipo di carattere \"fantasia\" predefinito usata per "
 "mostrare il testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Famiglia carattere monospace"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr ""
 "La famiglia del tipo di carattere predefinito usata per mostrare il testo a "
 "spaziatura fissa."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Famiglia carattere sans serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr ""
 "La famiglia del tipo di carattere \"senza grazie\" predefinito usata per "
 "mostrare il testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Famiglia carattere serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr ""
 "La famiglia del tipo di carattere \"con grazie\" predefinito usata per "
 "mostrare il testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Dimensione predefinita carattere"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr ""
 "La dimensione predefinita per il tipo di carattere usato per mostrare il "
 "testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Dimensione predefinita carattere monospace"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr ""
 "La dimensione predefinita per il tipo di carattere usato per mostrare il "
 "testo a larghezza fissa."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Dimensione minima carattere"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr ""
 "La dimensione minima per il tipo di carattere usato per mostrare il testo."
@@ -438,351 +437,364 @@
 # size alone. This will assure that your content will never display at sizes less than 12 points,
 # but the functional font size boundary of the web view will remain at 9 points to prevent any
 #  chance of displaying unnecessarily small text.
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Dimensione minima naturale carattere"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr ""
 "La dimensione minima naturale per il tipo di carattere usato per mostrare il "
 "testo."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Forza 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Forza la risoluzione a 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Caricamento automatico immagini"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Carica le immagini in modo automatico."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Restringimento automatico immagini"
 
 # assolutamente libertario
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Restringe automaticamente le immagini singole alla dimensione adatta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Stampa sfondi"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Indica se le immagini di sfondo devono essere stampate."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Abilita script"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Abilita i linguaggi di scripting incorporati."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Abilita plugin"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Abilita gli oggetti plugin incorporati."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Aree testo ridimensionabili"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Indica se le aree di testo sono ridimensionabili."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "URI foglio stile utente"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "L'URI di un foglio di stile che è applicato a ogni pagina."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Valore passo ingrandimento"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr ""
 "Il valore di variazione del livello di ingrandimento quando si aumenta o "
 "riduce l'ingrandimento."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Abilita extra per sviluppatori"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Abilita estensioni speciali che sono d'aiuto per gli sviluppatori"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Abilita navigazione privata"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Abilita la modalità di navigazione privata"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
-msgstr ""
+msgstr "Abilita controllo ortografico"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
-msgstr "Controlla ortografia durante _digitazione"
+msgstr "Abilita il controllo ortografico durante la digitazione"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
-msgstr ""
+msgstr "Lingue da usare per controllo ortografico"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
+"Elenco separato da virgole delle lingue da usare per il controllo ortografico"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
-msgstr "Abilita navigazione privata"
+msgstr "Abilita navigazione con cursore"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
+"Indica se abilitare la navigazione da tastiera ottimizzata per "
+"l'accessibilità"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
-msgstr ""
+msgstr "Abilita Database HTML5"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
-msgstr ""
+msgstr "Indica se abilitare il supporto ai database di HTML5"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
-msgstr ""
+msgstr "Abilita Local Storage HTML5"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
-msgstr ""
+msgstr "Indica se abilitare il supporto a local storage di HTML5"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 msgid "Enable XSS Auditor"
-msgstr "Abilita script"
+msgstr "Abilita auditor XSS"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
-msgstr ""
+msgstr "Indica se abilitare l'auditor XSS"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
-msgstr ""
+msgstr "User Agent"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
-msgstr ""
+msgstr "La stringa User-Agent usata da WebKitGtk"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
-msgstr ""
+msgstr "JavaScript può aprire automatamente le fineste"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
-msgstr ""
+msgstr "Indica se JavaScript può aprire automatamente le fineste"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
-msgstr ""
+msgstr "Abilita cache per applicazioni web fuori rete"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
-msgstr ""
+msgstr "Indica se abilitare la cache per le applicazioni web fuori rete"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
-msgstr ""
+msgstr "Comportamento editing"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
-msgstr ""
+msgstr "La modalità di comportamento da usare in modalità editing"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
-msgstr ""
+msgstr "Abilita accesso univesale dagli URI di file"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
-msgstr ""
+msgstr "Indica se abilitare l'accesso univesale dagli URI di file"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 msgid "Enable DOM paste"
-msgstr "Abilita script"
+msgstr "Abilita DOM pasting"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
-msgstr ""
+msgstr "Indica se abilitare il DOM pasting"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
-msgstr ""
+msgstr "Tasto TAB per passare tra gli elementi"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
+"Indica se il tasto TAB permette di passare ciclicamente tra gli elementi "
+"della pagina."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
-msgstr ""
+msgstr "Abilita menù contestuale predefinito"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
+"Abilita la gestione dei clic destri per la creazione del menù contestuale "
+"predefinito"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
-msgstr ""
+msgstr "Abilita scappatoie specifiche per siti"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
+"Abilita delle correzioni di compatibilità specifiche per determinati siti"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
-msgstr ""
+msgstr "Abilita la cache di pagina"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 msgid "Whether the page cache should be used"
-msgstr "Indica se le immagini di sfondo devono essere stampate."
+msgstr "Indica se usare la cache delle pagine"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
-msgstr ""
+msgstr "Ridimensionamento automatico finestra"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
+"Ridimensiona automaticamente la finestra di livello principale quando "
+"richiesto da una pagina"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Abilita applet Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Indica se abilitare il supporto alle applet Java attraverso <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Restituisce il titolo del documento di @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Restituisce l'URI attuale del contenuto mostrato dalla @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Copia elenco destinazioni"
 
 # ma ha senso??
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
 "L'elenco di destinazioni che questa vista web supporta per copiare negli "
 "appunti"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Incolla elenco destinazioni"
 
 # ma ha senso??
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
 "L'elenco di destinazioni che questa vista web supporta per incollare dagli "
 "appunti"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Impostazioni"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Un'istanza WebKitWebSettings associata"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Ispettore web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "L'istanza WebKitWebInspector associata"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Modificabile"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Indica se il contenuto può essere modificato dall'utente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Trasparente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Indica se il contenuto ha uno sfondo trasparente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Livello ingrandimento"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Il livello di ingrandimento del contenuto"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Ingrandimento intero contenuto"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Indica se all'ingrandimento viene scalato l'intero contenuto"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Codifica"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "La codifica predefinita della vista web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Codifica personalizzata"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "La codifica personalizzata della vista web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
-msgstr ""
+msgstr "URI di icona"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
-msgstr ""
+msgstr "L'URI per la favicon della #WebKitWebView."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
@@ -793,12 +805,10 @@
 msgid "Reset"
 msgstr "Azzera"
 
-# FIXME
-# https://bugs.webkit.org/show_bug.cgi?id=25375
-# Aperto bug chiedeno lumi...
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Indice _cercabile"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
+"Questo indice consente ricerche. Inserire la parole chiave da cercare: "
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -974,187 +984,188 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
 msgid "Loading..."
-msgstr ""
+msgstr "Caricamento..."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
 msgid "Live Broadcast"
-msgstr ""
+msgstr "Diffusione live"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
 msgid "audio element controller"
-msgstr ""
+msgstr "controllore elemento audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
 msgid "video element controller"
-msgstr ""
+msgstr "controllore elemento video"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
 msgid "mute"
-msgstr ""
+msgstr "escludi audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
 msgid "unmute"
-msgstr ""
+msgstr "abilita audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
 msgid "play"
-msgstr ""
+msgstr "riproduci"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
 msgid "pause"
-msgstr ""
+msgstr "pausa"
 
+# name == "Slider"
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
 msgid "movie time"
-msgstr ""
+msgstr "tempo filmato"
 
+# name == "SliderThumb"
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
 msgid "timeline slider thumb"
-msgstr ""
+msgstr "cursore dello scorrevole per linea temporale"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
 msgid "back 30 seconds"
-msgstr ""
+msgstr "indietro 30 secondi"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
 msgid "return to realtime"
-msgstr ""
+msgstr "ritorna a tempo effettivo"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
 msgid "elapsed time"
-msgstr ""
+msgstr "tempo trascorso"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
 msgid "remaining time"
-msgstr ""
+msgstr "tempo rimanente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
-#, fuzzy
 msgid "status"
-msgstr "Stato"
+msgstr "stato"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
 msgid "fullscreen"
-msgstr ""
+msgstr "schermo intero"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
 msgid "fast forward"
-msgstr ""
+msgstr "avanti veloce"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
 msgid "fast reverse"
-msgstr ""
+msgstr "indietro veloce"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
 msgid "show closed captions"
-msgstr ""
+msgstr "mostra sottotitoli"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
 msgid "hide closed captions"
-msgstr ""
+msgstr "nascondi sottotitoli"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
 msgid "audio element playback controls and status display"
-msgstr ""
+msgstr "controlli di riproduzione e visualizzazione stato di elementi audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
 msgid "video element playback controls and status display"
-msgstr ""
+msgstr "controlli di riproduzione e visualizzazione stato di elementi video"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
 msgid "mute audio tracks"
-msgstr ""
+msgstr "escludi tracce audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
 msgid "unmute audio tracks"
-msgstr ""
+msgstr "abilita tracce audio"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
 msgid "begin playback"
-msgstr ""
+msgstr "inizia la riproduzione"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
 msgid "pause playback"
-msgstr ""
+msgstr "mette in pausa la riproduzione"
 
+# non so se è corretto... per induzione dovrebbe
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
 msgid "movie time scrubber"
-msgstr ""
+msgstr "cambia con trascinamento il tempo del filmato"
 
+# non so se è corretto... per induzione dovrebbe
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
 msgid "movie time scrubber thumb"
-msgstr ""
+msgstr "cursore per cambiare con trascinamento il tempo del filmato"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
 msgid "seek movie back 30 seconds"
-msgstr ""
+msgstr "posiziona il filmato indietro di 30 secondi"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
 msgid "return streaming movie to real time"
-msgstr ""
+msgstr "riporta il filmato in streaming al tempo reale"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
 msgid "current movie time in seconds"
-msgstr ""
+msgstr "tempo corrente del filmato in secondi"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
 msgid "number of seconds of movie remaining"
-msgstr ""
+msgstr "numero di secondi rimanenti del filmato"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
 msgid "current movie status"
-msgstr ""
+msgstr "stato attuale del filmato"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
 msgid "seek quickly back"
-msgstr ""
+msgstr "posiziona indietro rapidamente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
 msgid "seek quickly forward"
-msgstr ""
+msgstr "posiziona avanti rapidamente"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
 msgid "Play movie in fullscreen mode"
-msgstr ""
+msgstr "Riproduce il filmato in modalità schermo intero"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
 msgid "start displaying closed captions"
-msgstr ""
+msgstr "avvia la visualizzazione dei sottotitoli"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
 msgid "stop displaying closed captions"
-msgstr ""
+msgstr "interrompe la visualizzazione dei sottotitoli"
 
-# String AXDefinitionListDefinitionText()
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
-#, fuzzy
 msgid "indefinite time"
-msgstr "definizione"
+msgstr "tempo indefinito"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
 msgid "value missing"
-msgstr ""
+msgstr "valore mancante"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
 msgid "type mismatch"
-msgstr ""
+msgstr "discrepanza di tipo"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
 msgid "pattern mismatch"
-msgstr ""
+msgstr "discrepanza di modello"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
 msgid "too long"
-msgstr ""
+msgstr "troppo lungo"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
 msgid "range underflow"
-msgstr ""
+msgstr "superamento limite inferiore dell'intervallo"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
 msgid "range overflow"
-msgstr ""
+msgstr "superamento limite superiore dell'intervallo"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
-msgstr ""
+msgstr "discrepanza di passo"
diff --git a/WebKit/gtk/po/lt.po b/WebKit/gtk/po/lt.po
index 4c30200..fd449a2 100644
--- a/WebKit/gtk/po/lt.po
+++ b/WebKit/gtk/po/lt.po
@@ -1,21 +1,21 @@
 # Lithuanian translation for WebKit GTK.
 # This file is put in the public domain.
-# Rimas Kudelis <rq@akl.lt>, 2009.
+# Rimas Kudelis <rq@akl.lt>, 2009, 2010.
 msgid ""
 msgstr ""
 "Project-Id-Version: webkit 1.1.4\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-10-09 18:42+0200\n"
+"POT-Creation-Date: 2010-02-16 15:01-0200\n"
+"PO-Revision-Date: 2010-02-26 20:07+0300\n"
 "Last-Translator: Rimas Kudelis <rq@akl.lt>\n"
 "Language-Team: Lithuanian <komp_lt@konferencijos.lt>\n"
+"Language: lt\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: lt\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%"
 "100<10 || n%100>=20) ? 1 : 2);\n"
-"X-Generator: Virtaal 0.4.0\n"
+"X-Generator: Virtaal 0.5.2\n"
 
 #: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
 msgid "Upload File"
@@ -72,28 +72,24 @@
 msgstr "Įterpti unikodo valdymo ženklą"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:262
-#, fuzzy
 msgid "Network Request"
 msgstr "Tinklo užklausa"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:263
-#, fuzzy
 msgid "The network request for the URI that should be downloaded"
 msgstr ""
 "Tinklo užklausa parsiųstino failo universaliajam ištekliaus identifikatoriui "
 "(URI)"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:277
-#, fuzzy
 msgid "Network Response"
-msgstr "Tinklo užklausa"
+msgstr "Tinklo atsakas"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:278
-#, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr ""
-"Tinklo užklausa parsiųstino failo universaliajam ištekliaus identifikatoriui "
-"(URI)"
+"Tinklo atsakas į užklausą parsiųstino failo universaliajam ištekliaus "
+"identifikatoriui (URI)"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:292
 msgid "Destination URI"
@@ -116,18 +112,16 @@
 msgstr "Progresas"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:326
-#, fuzzy
 msgid "Determines the current progress of the download"
-msgstr "Nurodo atsiuntimo progresą"
+msgstr "Nurodo esamą atsiuntimo progresą"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:339
 msgid "Status"
 msgstr "Būsena"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:340
-#, fuzzy
 msgid "Determines the current status of the download"
-msgstr "Nurodo atsiuntimo būseną"
+msgstr "Nurodo esamą atsiuntimo būseną"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:355
 msgid "Current Size"
@@ -163,9 +157,8 @@
 msgstr "Slaptažodis:"
 
 #: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
-#, fuzzy
 msgid "_Remember password"
-msgstr "Įsiminti slaptažodį"
+msgstr "Įsi_minti slaptažodį"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
@@ -198,22 +191,20 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
-msgstr ""
+msgstr "Horizontalios slinkties juostos taisyklės"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:345
-#, fuzzy
 msgid ""
 "Determines the current policy for the horizontal scrollbar of the frame."
-msgstr "Nurodo atsiuntimo progresą"
+msgstr "Taisyklės, taikomos kadro horizontaliai slinkties juostai."
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:362
 msgid "Vertical Scrollbar Policy"
-msgstr ""
+msgstr "Vertikalios slinkties juostos taisyklės"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:363
-#, fuzzy
 msgid "Determines the current policy for the vertical scrollbar of the frame."
-msgstr "Nurodo atsiuntimo progresą"
+msgstr "Taisyklės, taikomos kadro vertikaliai slinkties juostai."
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
@@ -274,20 +265,18 @@
 msgstr "Profiliuoti vykdomą „JavaScript“ kodą."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
-#, fuzzy
 msgid "Enable Timeline profiling"
-msgstr "Įjungti „JavaScript“ profiliavimą"
+msgstr "Įjungti chronologinį profiliavimą"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
-msgstr ""
+msgstr "Profiliuoti „WebCore“ instrumentuotę."
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
 msgid "Reason"
 msgstr "Priežastis"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
-#, fuzzy
 msgid "The reason why this navigation is occurring"
 msgstr "Tinklalapio atvėrimo priežastis"
 
@@ -313,15 +302,12 @@
 msgstr "Bitų kaukė, atspindinti modifikavimo klavišų būseną"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
-#, fuzzy
 msgid "Target frame"
-msgstr "Kadro pavadinimas"
+msgstr "Paskirties kadras"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
-#, fuzzy
 msgid "The target frame for the navigation"
-msgstr ""
-"Mėginamo atverti tinklalapio universalusis ištekliaus identifikatorius (URI)"
+msgstr "Kadras, kuriame tinklalapis turi būti atvertas."
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:233
 msgid "Default Encoding"
@@ -404,15 +390,13 @@
 msgstr "Mažiausias leistinas tekstui atvaizduoti naudojamo šrifto dydis."
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:323
-#, fuzzy
 msgid "Minimum Logical Font Size"
 msgstr "Minimalus loginis šrifto dydis"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:324
-#, fuzzy
 msgid "The minimum logical font size used to display text."
 msgstr ""
-"Mažiausias leistinas loginis tekstui atvaizduoti naudojamo šrifto dydis."
+"Mažiausias leistinas tekstui atvaizduoti naudojamo šrifto loginis dydis."
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:343
 msgid "Enforce 96 DPI"
@@ -506,146 +490,143 @@
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:477
 msgid "Enable Spell Checking"
-msgstr ""
+msgstr "Tikrinti rašybą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:478
-#, fuzzy
 msgid "Enables spell checking while typing"
-msgstr "Tikrinti _rašybą rašant tekstą"
+msgstr "Įjungti rašybos tikrinimą renkant tekstą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:501
 msgid "Languages to use for spell checking"
-msgstr ""
+msgstr "Rašybos tikrinimo kalbos"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:502
 msgid "Comma separated list of languages to use for spell checking"
-msgstr ""
+msgstr "Kableliais atskirtas kalbų, kurių rašybą reikia tikrinti, sąrašas"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:516
-#, fuzzy
 msgid "Enable Caret Browsing"
-msgstr "Įjungti privatųjį naršymą"
+msgstr "Visuomet įjungti teksto žymeklį"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:517
 msgid "Whether to enable accesibility enhanced keyboard navigation"
-msgstr ""
+msgstr "Ar įjungti teksto fragmentų žymėjimą klaviatūra"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:532
 msgid "Enable HTML5 Database"
-msgstr ""
+msgstr "Įjungti HTML5 duomenų bazę"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:533
 msgid "Whether to enable HTML5 database support"
-msgstr ""
+msgstr "Ar įjungti HTML5 duomenų bazės palaikymą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:548
 msgid "Enable HTML5 Local Storage"
-msgstr ""
+msgstr "Įjungti HTML5 vietinę saugyklą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:549
 msgid "Whether to enable HTML5 Local Storage support"
-msgstr ""
+msgstr "Ar įjungti HTML5 vietinės saugyklos palaikymą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:563
-#, fuzzy
 msgid "Enable XSS Auditor"
-msgstr "Įjungti scenarijus"
+msgstr "Įjungti XSS auditavimą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:564
 msgid "Whether to enable teh XSS auditor"
-msgstr ""
+msgstr "Ar įjungti XSS auditavimą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:582
 msgid "User Agent"
-msgstr ""
+msgstr "Naudotojo agentas"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:583
 msgid "The User-Agent string used by WebKitGtk"
-msgstr ""
+msgstr "„User-Agent“ eilutė, kurią „WebKitGtk“ turėtų naudoti"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:598
 msgid "JavaScript can open windows automatically"
-msgstr ""
+msgstr "Leisti „JavaScript“ atverti langus automatiškai"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:599
 msgid "Whether JavaScript can open windows automatically"
-msgstr ""
+msgstr "Ar „JavaScript“ leidžiama atverti langus automatiškai"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:614
 msgid "Enable offline web application cache"
-msgstr ""
+msgstr "Įjungti žiniatinklio programų podėlį darbui neprisijungus"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:615
 msgid "Whether to enable offline web application cache"
-msgstr ""
+msgstr "Ar įjungti žiniatinklio programų podėlį darbui neprisijungus"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:642
 msgid "Editing behavior"
-msgstr ""
+msgstr "Redagavimo elgsena"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:643
 msgid "The behavior mode to use in editing mode"
-msgstr ""
+msgstr "Elgsena naudotina redagavimo veiksenoje"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:659
 msgid "Enable universal access from file URIs"
-msgstr ""
+msgstr "Įjungti universalią prieigą iš „file“ URI"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:660
 msgid "Whether to allow universal access from file URIs"
-msgstr ""
+msgstr "Ar leisti universalią prieigą iš „file“ URI"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:675
-#, fuzzy
 msgid "Enable DOM paste"
-msgstr "Įjungti scenarijus"
+msgstr "Įjungti DOM įdėjimą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:676
 msgid "Whether to enable DOM paste"
-msgstr ""
+msgstr "Ar įjungti DOM įdėjimą"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:694
 msgid "Tab key cycles through elements"
-msgstr ""
+msgstr "Tab klavišu šokti tarp elementų"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:695
 msgid "Whether the tab key cycles through elements on the page."
-msgstr ""
+msgstr "Ar Tab klavišu galima šokti iš vieno elemento tinklalapyje į kitą."
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:715
 msgid "Enable Default Context Menu"
-msgstr ""
+msgstr "Įjungti numatytąjį kontekstinį meniu"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:716
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
+"Ar apdoroti dešiniojo pelės mygtuko spustelėjimus, suformuojant numatytąjį "
+"kontekstinį meniu"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:736
 msgid "Enable Site Specific Quirks"
-msgstr ""
+msgstr "Įjungti specifines svetainių pataisas"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:737
 msgid "Enables the site-specific compatibility workarounds"
-msgstr ""
+msgstr "Įjungti kai kuriose svetainėse reikalingas specifines pataisas"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:759
 msgid "Enable page cache"
-msgstr ""
+msgstr "Įjungti tinklalapių podėlį"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:760
-#, fuzzy
 msgid "Whether the page cache should be used"
-msgstr "Ar spausdinti fono piešinius."
+msgstr "Ar naudoti tinklalapių podėlį"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:780
 msgid "Auto Resize Window"
-msgstr ""
+msgstr "Automatiškai keisti lango dydį"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:781
 msgid "Automatically resize the toplevel window when a page requests it"
-msgstr ""
+msgstr "Tinklalapiui pareikalavus, automatiškai keisti pagrindinio lango dydį"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2316
 msgid "Returns the @web_view's document title"
@@ -659,19 +640,21 @@
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2343
 msgid "Copy target list"
-msgstr ""
+msgstr "Kopijuotinų taikinių sąrašas"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2344
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
+"Šio žiniatinklio rodinio palaikomų taikinių kopijavimui į iškarpinę sąrašas"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2357
 msgid "Paste target list"
-msgstr ""
+msgstr "Įdėtinų taikinių sąrašas"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2358
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
+"Šio žiniatinklio rodinio palaikomų taikinių įdėjimui iš iškarpinės sąrašas"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2364
 msgid "Settings"
@@ -739,11 +722,11 @@
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2517
 msgid "Icon URI"
-msgstr ""
+msgstr "Piktogramos URI"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2518
 msgid "The URI for the favicon for the #WebKitWebView."
-msgstr ""
+msgstr "#WebKitWebView naudotinos „favicon“ piktogramos URI"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
@@ -756,7 +739,7 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
 msgid "_Searchable Index"
-msgstr ""
+msgstr "_Rodyklė paieškai"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -916,186 +899,184 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
 msgid "Loading..."
-msgstr ""
+msgstr "Įkeliama…"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
 msgid "Live Broadcast"
-msgstr ""
+msgstr "Tiesioginė transliacija"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
 msgid "audio element controller"
-msgstr ""
+msgstr "audio elemento skydelis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
 msgid "video element controller"
-msgstr ""
+msgstr "video elemento skydelis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
 msgid "mute"
-msgstr ""
+msgstr "išjungti garsą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
 msgid "unmute"
-msgstr ""
+msgstr "įjungti garsą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
 msgid "play"
-msgstr ""
+msgstr "groti"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
 msgid "pause"
-msgstr ""
+msgstr "pristabdyti"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
 msgid "movie time"
-msgstr ""
+msgstr "laiko juosta"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
 msgid "timeline slider thumb"
-msgstr ""
+msgstr "laiko juostos slankiklis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
 msgid "back 30 seconds"
-msgstr ""
+msgstr "30 sek. atgal"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
 msgid "return to realtime"
-msgstr ""
+msgstr "grįžti į realų laiką"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
 msgid "elapsed time"
-msgstr ""
+msgstr "praėjęs laikas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
 msgid "remaining time"
-msgstr ""
+msgstr "likęs laikas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
-#, fuzzy
 msgid "status"
-msgstr "Būsena"
+msgstr "būsena"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
 msgid "fullscreen"
-msgstr ""
+msgstr "visame ekrane"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
 msgid "fast forward"
-msgstr ""
+msgstr "prasukti pirmyn"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
 msgid "fast reverse"
-msgstr ""
+msgstr "prasukti atgal"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
 msgid "show closed captions"
-msgstr ""
+msgstr "rodyti titrus"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
 msgid "hide closed captions"
-msgstr ""
+msgstr "nerodyti titrų"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
 msgid "audio element playback controls and status display"
-msgstr ""
+msgstr "audio elemento valdikliai ir būsenos indikatorius"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
 msgid "video element playback controls and status display"
-msgstr ""
+msgstr "video elemento valdikliai ir būsenos indikatorius"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
 msgid "mute audio tracks"
-msgstr ""
+msgstr "išjungti garso takelio garsą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
 msgid "unmute audio tracks"
-msgstr ""
+msgstr "įjungti garso takelio garsą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
 msgid "begin playback"
-msgstr ""
+msgstr "pradėti grojimą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
 msgid "pause playback"
-msgstr ""
+msgstr "pristabdyti grojimą"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
 msgid "movie time scrubber"
-msgstr ""
+msgstr "įrašo laiko juosta"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
 msgid "movie time scrubber thumb"
-msgstr ""
+msgstr "įrašo laiko juostos slankiklis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
 msgid "seek movie back 30 seconds"
-msgstr ""
+msgstr "uždelsti įrašo atkūrimą 30 sek."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
 msgid "return streaming movie to real time"
-msgstr ""
+msgstr "grąžinti įrašo atkūrimą į realų laiką"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
 msgid "current movie time in seconds"
-msgstr ""
+msgstr "praėjęs atkuriamo įrašo laikas sekundėmis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
 msgid "number of seconds of movie remaining"
-msgstr ""
+msgstr "likęs atkuriamo įrašo laikas sekundėmis"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
 msgid "current movie status"
-msgstr ""
+msgstr "atkuriamo įrašo būsena"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
 msgid "seek quickly back"
-msgstr ""
+msgstr "prasukti įrašą į priekį"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
 msgid "seek quickly forward"
-msgstr ""
+msgstr "prasukti įrašą atgal"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
 msgid "Play movie in fullscreen mode"
-msgstr ""
+msgstr "Rodyti įrašą visame ekrane"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
 msgid "start displaying closed captions"
-msgstr ""
+msgstr "pradėti ekrane rodyti titrus"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
 msgid "stop displaying closed captions"
-msgstr ""
+msgstr "nutraukti titrų rodymą ekrane"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
-#, fuzzy
 msgid "indefinite time"
-msgstr "apibrėžtis"
+msgstr "laikas neapibrėžtas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
 msgid "value missing"
-msgstr ""
+msgstr "trūksta reikšmės"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
 msgid "type mismatch"
-msgstr ""
+msgstr "tipo nesutampimas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
 msgid "pattern mismatch"
-msgstr ""
+msgstr "šablono nesutampimas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
 msgid "too long"
-msgstr ""
+msgstr "per ilgas"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
 msgid "range underflow"
-msgstr ""
+msgstr "reikšmė per maža"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
 msgid "range overflow"
-msgstr ""
+msgstr "reikšmė per didelė"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
-msgstr ""
+msgstr "žingsnio nesutapimas"
diff --git a/WebKit/gtk/po/lv.po b/WebKit/gtk/po/lv.po
new file mode 100644
index 0000000..3181ed3
--- /dev/null
+++ b/WebKit/gtk/po/lv.po
@@ -0,0 +1,704 @@
+# This file is put in the public domain.
+#
+# Peteris Krisjanis <pecisk@gmail.com>, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit 1.1.4\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2009-04-09 19:09-0300\n"
+"PO-Revision-Date: 2010-03-07 19:37+0200\n"
+"Last-Translator: Peteris Krisjanis <pecisk@gmail.com>\n"
+"Language-Team: Latviešu <lata-l10n@googlegroups.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.0\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
+"2);\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:425
+msgid "Upload File"
+msgstr "Augšupielādēt failu"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:139
+msgid "Input _Methods"
+msgstr "Ievades _metodes"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LRM _No kreisās uz labo atzīme"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM No _labās uz kreiso atzīme"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE No kreisās uz labo _iegultīšana"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE No labās uz kreiso ie_gultīšana"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO No kreisās uz labo _pārrakstīšana"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO No labās uz kreiso pār_rakstīšana"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF _izlēcošā virziena formatēšana"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS _Nulle ar tukšumu"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ Nulle ar _savienojumu"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ Nulle ar _nesavienojumu"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:134
+msgid "_Insert Unicode Control Character"
+msgstr "_Ievietot Unicode kontroles rakstzīmi"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:250
+msgid "Network Request"
+msgstr "Tīkla pieprasījums"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:251
+msgid "The network request for the URI that should be downloaded"
+msgstr "URI, kuru vajadzētu lejupielādēt, tīkla pieprasījums"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:265
+msgid "Destination URI"
+msgstr "Mērķa URI"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "The destination URI where to save the file"
+msgstr "Mērķa URI, kur saglabāt failu"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:280
+msgid "Suggested Filename"
+msgstr "Ieteiktais faila nosaukums"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+msgid "The filename suggested as default when saving"
+msgstr "Noklusēti ieteiktais faila nosaukums saglabājot"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:294
+msgid "Progress"
+msgstr "Progress"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:295
+msgid "Determines the current progress of the download"
+msgstr "Nosaka lejupielādes pašreizējo progresu"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:308
+msgid "Status"
+msgstr "Statuss"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:309
+msgid "Determines the current status of the download"
+msgstr "Nosaka lejupielādes pašreizējo statusu"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:324
+msgid "Current Size"
+msgstr "Pašreizējais izmērs"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:325
+msgid "The length of the data already downloaded"
+msgstr "Jau lejupielādēto datu apjoms"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:339
+msgid "Total Size"
+msgstr "Galīgais izmērs"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:340
+msgid "The total size of the file"
+msgstr "Galīgais faila izmērs"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:469
+msgid "User cancelled the download"
+msgstr "Lietotājs atcēla lejupielādi"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Lietotājvārds un parole, ko pieprasa vietne %s"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+msgid "Username:"
+msgstr "Lietotājvārds:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+msgid "Password:"
+msgstr "Parole:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:281
+msgid "Remember password"
+msgstr "Atcerēties paroli"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:211
+msgid "Name"
+msgstr "Nosaukums"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:212
+msgid "The name of the frame"
+msgstr "Rāmja nosaukums"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:218
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:154
+#: WebKit/gtk/webkit/webkitwebview.cpp:1715
+msgid "Title"
+msgstr "Virsraksts"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:219
+msgid "The document title of the frame"
+msgstr "Rāmja dokumenta virsraksts"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:225
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:186
+#: WebKit/gtk/webkit/webkitwebview.cpp:1729
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:226
+msgid "The current URI of the contents displayed by the frame"
+msgstr "Pašreizējais rāmī attēlotā satura URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:155
+msgid "The title of the history item"
+msgstr "Vēstures ieraksta virsraksts"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:170
+msgid "Alternate Title"
+msgstr "Alternatīvais virsraksts"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:171
+msgid "The alternate title of the history item"
+msgstr "Vēstures ieraksta alternatīvais virsraksts"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:187
+msgid "The URI of the history item"
+msgstr "Vēstures ieraksta URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:202
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:167
+msgid "Original URI"
+msgstr "Oriģinālais URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:203
+msgid "The original URI of the history item"
+msgstr "Vēstures ieraksta oriģinālais URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:218
+msgid "Last visited Time"
+msgstr "Pēdējā apmeklējuma laiks"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:219
+msgid "The time at which the history item was last visited"
+msgstr "Laiks, kad pēdējo reizi vēstures ieraksts tika apmeklēts"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:260
+msgid "Web View"
+msgstr "Tīmekļa skats"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:261
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "Tīmekļa skats, kas renderē pašu tīmekļa inspektoru"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:274
+msgid "Inspected URI"
+msgstr "Inspektētais URI"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:275
+msgid "The URI that is currently being inspected"
+msgstr "URI, kuru pašreiz inspektē"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:291
+msgid "Enable JavaScript profiling"
+msgstr "Ieslēgt JavaScript profilēšanu"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:292
+msgid "Profile the executed JavaScript."
+msgstr "Profilēt izpildīto JavaScript kodu."
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:152
+msgid "Reason"
+msgstr "Iemesls"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:153
+msgid "The reason why this navigation is occurring"
+msgstr "Iemesls, kāpēc šī navigācija notiek"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:168
+msgid "The URI that was requested as the target for the navigation"
+msgstr "URI, kas tika pieprasīta kā navigācijas mērķis"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:180
+msgid "Button"
+msgstr "Poga"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:181
+msgid "The button used to click"
+msgstr "Poga, ko noklikšķināt"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:196
+msgid "Modifier state"
+msgstr "Modifīcētāja stāvoklis"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:197
+msgid "A bitmask representing the state of the modifier keys"
+msgstr ""
+"Lubiņš stāsta, ka nodokļu slogs Latvijā ir pārāk liels, turklāt valsts no "
+"uzņēmuma prasa, lai tas būtu konkurētspējīgs. Viņš uzskata, ka, samazinot "
+"nodokļus, uzņēmēju aktivitāte palielinātos un augtu arī konkurētspēja."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:129
+msgid "Default Encoding"
+msgstr "Noklusētais kodējums"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:130
+msgid "The default encoding used to display text."
+msgstr "Noklusētais kodējums, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:138
+msgid "Cursive Font Family"
+msgstr "Cursive fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:139
+msgid "The default Cursive font family used to display text."
+msgstr "Noklusētā Cursive fontu ģimene, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:147
+msgid "Default Font Family"
+msgstr "Noklusētā fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:148
+msgid "The default font family used to display text."
+msgstr "Noklusētā fontu ģimene, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:156
+msgid "Fantasy Font Family"
+msgstr "Fantasy fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:157
+msgid "The default Fantasy font family used to display text."
+msgstr "Noklusētā Fantasy fontu ģimene, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:165
+msgid "Monospace Font Family"
+msgstr "Monospace fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:166
+msgid "The default font family used to display monospace text."
+msgstr "Noklusētā fontu ģimene, ko izmanto monospace teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:174
+msgid "Sans Serif Font Family"
+msgstr "Sans Serif fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:175
+msgid "The default Sans Serif font family used to display text."
+msgstr "Noklusētā Sans Serif fontu ģimene, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:183
+msgid "Serif Font Family"
+msgstr "Serif fontu ģimene"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:184
+msgid "The default Serif font family used to display text."
+msgstr "Noklusētā Serif fontu ģimene, ko izmanto teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:192
+msgid "Default Font Size"
+msgstr "Noklusētais fontu izmērs"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:193
+msgid "The default font size used to display text."
+msgstr "Noklusētais fontu izmērs, kuru izmantot teksta attēlošanā."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:201
+msgid "Default Monospace Font Size"
+msgstr "Noklusētais Monospace fontu izmērs"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:202
+msgid "The default font size used to display monospace text."
+msgstr "Noklusētais fonta izmērs monospace teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:210
+msgid "Minimum Font Size"
+msgstr "Minimālais fontu izmērs"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:211
+msgid "The minimum font size used to display text."
+msgstr "Minimālais fonta izmērs teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:219
+msgid "Minimum Logical Font Size"
+msgstr "Minimālais loģiskais fontu izmērs"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:220
+msgid "The minimum logical font size used to display text."
+msgstr "Minimālais loģiskais fontu izmērs teksta attēlošanai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:239
+msgid "Enforce 96 DPI"
+msgstr "Forsēt 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:240
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Forsēt 96 DPI izšķirtspēju"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:248
+msgid "Auto Load Images"
+msgstr "Automātiska attēlu ielāde"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:249
+msgid "Load images automatically."
+msgstr "Ielādēt attēlus automātiski."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:257
+msgid "Auto Shrink Images"
+msgstr "Automātiski samazināt attēlus"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:258
+msgid "Automatically shrink standalone images to fit."
+msgstr ""
+"Automātiski samazināt atsevišķi parādītus attēlus, lai tie ietilptu logā."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:266
+msgid "Print Backgrounds"
+msgstr "Drukāt fonus"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:267
+msgid "Whether background images should be printed."
+msgstr "Vai fona attēlus vajadzētu drukāt."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:275
+msgid "Enable Scripts"
+msgstr "Aktivizēt skriptus"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:276
+msgid "Enable embedded scripting languages."
+msgstr "Aktivizēt iegultās skriptēšanas valodas."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:284
+msgid "Enable Plugins"
+msgstr "Aktivizēt spraudņus"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:285
+msgid "Enable embedded plugin objects."
+msgstr "Aktivizēt iegultos spraudņu objektus."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:293
+msgid "Resizable Text Areas"
+msgstr "Teksta lauki ar maināmu izmēru"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:294
+msgid "Whether text areas are resizable."
+msgstr "Vai teksta lauki ir ar maināmu izmēru"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "User Stylesheet URI"
+msgstr "Lietotāja stila lapas URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:302
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "Stila lapas URI, kuru pielietot katrai lapai."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:317
+msgid "Zoom Stepping Value"
+msgstr "Mērogošanas pakāpes vērtība"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr ""
+"Vērtība, par kuru mēroga līmenis tiek izmainīts palielinot vai samazinot "
+"to."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:336
+msgid "Enable Developer Extras"
+msgstr "Aktivizēt izstrādātāja ekstras"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:337
+msgid "Enables special extensions that help developers"
+msgstr "Aktivizē speciālus paplašinājumus, kas palīdz izstrādātājiem"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Enable Private Browsing"
+msgstr "Aktivizēt privāto pārlūkošanu"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:358
+msgid "Enables private browsing mode"
+msgstr "Aktivizē privātās pārlūkošanas režīmu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1716
+msgid "Returns the @web_view's document title"
+msgstr "Atgriež @web_view dokumenta virsrakstu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1730
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Atgriež pašreizējo satura, kas attēlos @web_view, URI"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1743
+msgid "Copy target list"
+msgstr "Kopēt mērķu sarakstu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1744
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+"Mērķu saraksts, ko šis tīmekļa skats atbalsta starpliktuves kopēšanai"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1757
+msgid "Paste target list"
+msgstr "Ielikt mērķu sarakstu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1758
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+"Mērķu saraksts, ko šis tīmekļa skats atbalsta starpliktuves kopēšanai"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1764
+msgid "Settings"
+msgstr "Iestatījumi"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1765
+msgid "An associated WebKitWebSettings instance"
+msgstr "Saistītā WebKitWebSettings instance"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1778
+msgid "Web Inspector"
+msgstr "Tīmekļa inspektors"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1779
+msgid "The associated WebKitWebInspector instance"
+msgstr "Saistītā WebKitInspector instance"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1799
+msgid "Editable"
+msgstr "Rediģējams"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1800
+msgid "Whether content can be modified by the user"
+msgstr "Vai lietotājs var mainīt saturu"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1806
+msgid "Transparent"
+msgstr "Caurspīdīgs"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1807
+msgid "Whether content has a transparent background"
+msgstr "Vai saturam ir caurspīdīgs fons"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1820
+msgid "Zoom level"
+msgstr "Mērogojuma līmenis"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1821
+msgid "The level of zoom of the content"
+msgstr "Satura mērogojuma līmenis"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1836
+msgid "Full content zoom"
+msgstr "Visa satura mērogojums"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1837
+msgid "Whether the full content is scaled when zooming"
+msgstr "Vai viss saturs tiek mērogots"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1850
+msgid "Encoding"
+msgstr "Kodējums"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1851
+msgid "The default encoding of the web view"
+msgstr "Tīmekļa skata noklusētais kodējums"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1864
+msgid "Custom Encoding"
+msgstr "Izvēlēts kodējums"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:1865
+msgid "The custom encoding of the web view"
+msgstr "Tīmekļa skata izvēlētais kodējums"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:51
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:56
+msgid "Submit"
+msgstr "Pieteikt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:61
+msgid "Reset"
+msgstr "Pārstatīt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:66
+msgid "_Searchable Index"
+msgstr "_Meklējumu indekss"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:71
+msgid "Choose File"
+msgstr "Izvēlieties failu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:76
+msgid "(None)"
+msgstr "(Nekas)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:81
+msgid "Open Link in New _Window"
+msgstr "Atvērt saiti jau_nā logā"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:86
+msgid "_Download Linked File"
+msgstr "_Lejupielādēt saitēto failu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:91
+msgid "Copy Link Loc_ation"
+msgstr "Kopēt saites lokā_ciju"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:96
+msgid "Open _Image in New Window"
+msgstr "Atvērt _attēlu jaunā logā"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:101
+msgid "Sa_ve Image As"
+msgstr "Sa_glabāt attēlu kā"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:106
+msgid "Cop_y Image"
+msgstr "Kopē_t attēlu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:111
+msgid "Open _Frame in New Window"
+msgstr "Atvērt _rāmi jaunā logā"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:162
+msgid "_Reload"
+msgstr "_Pārlādēt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:179
+msgid "No Guesses Found"
+msgstr "Nav neviena minējuma"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:184
+msgid "_Ignore Spelling"
+msgstr "_Ignorēt pareizrakstību"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:189
+msgid "_Learn Spelling"
+msgstr "_Iemācīties pareizrakstību"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:194
+msgid "_Search the Web"
+msgstr "_Meklēt tīmeklī"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:199
+msgid "_Look Up in Dictionary"
+msgstr "_Uzmeklēt vārdnīcā"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:204
+msgid "_Open Link"
+msgstr "_Atvērt saiti"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:209
+msgid "Ignore _Grammar"
+msgstr "Ignorēt _gramatiku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:214
+msgid "Spelling and _Grammar"
+msgstr "Pareizrakstība un _gramatika"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:219
+msgid "_Show Spelling and Grammar"
+msgstr "_Rādīt pareizrakstību un gramatiku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:219
+msgid "_Hide Spelling and Grammar"
+msgstr "_Slēpt pareizrakstību un gramatiku"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:224
+msgid "_Check Document Now"
+msgstr "_Pārbaudīt dokumentu tagad"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:229
+msgid "Check Spelling While _Typing"
+msgstr "Pārbaudīt pareizrakstību _rakstot"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:234
+msgid "Check _Grammar With Spelling"
+msgstr "Pārbaudīt _gramatiku kopā ar pareizrakstību"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:239
+msgid "_Font"
+msgstr "_Fonts"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:262
+msgid "_Outline"
+msgstr "_Kopskats"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:267
+msgid "Inspect _Element"
+msgstr "Inspektēt _elementu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:272
+msgid "No recent searches"
+msgstr "Nav nesen veiktu meklēšanu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:277
+msgid "Recent searches"
+msgstr "Nesen veiktās meklēšanas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:282
+msgid "_Clear recent searches"
+msgstr "_Attīrīt nesen veiktās meklēšanas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:287
+msgid "term"
+msgstr "termins"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:292
+msgid "definition"
+msgstr "definīcija"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:297
+msgid "press"
+msgstr "spiest"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:302
+msgid "select"
+msgstr "izvēlēties"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:307
+msgid "activate"
+msgstr "aktivizēt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:312
+msgid "uncheck"
+msgstr "neatzīmēt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:317
+msgid "check"
+msgstr "atzīmēt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:322
+msgid "jump"
+msgstr "lekt"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:328
+msgid " files"
+msgstr " faili"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:333
+msgid "Unknown"
+msgstr "Nezināms"
+
+
diff --git a/WebKit/gtk/po/nl.po b/WebKit/gtk/po/nl.po
index a465b23..aa2da82 100644
--- a/WebKit/gtk/po/nl.po
+++ b/WebKit/gtk/po/nl.po
@@ -6,8 +6,8 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.10\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-07-05 18:58+0100\n"
+"POT-Creation-Date: 2010-02-16 15:01-0200\n"
+"PO-Revision-Date: 2010-03-22 00:27+0100\n"
 "Last-Translator: Reinout van Schouwen <reinouts@gnome.org>\n"
 "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
 "MIME-Version: 1.0\n"
@@ -77,14 +77,12 @@
 msgstr "De netwerkaanvraag voor de te downloaden URI"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:277
-#, fuzzy
 msgid "Network Response"
-msgstr "Netwerkaanvraag"
+msgstr "Netwerkantwoord"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:278
-#, fuzzy
 msgid "The network response for the URI that should be downloaded"
-msgstr "De netwerkaanvraag voor de te downloaden URI"
+msgstr "Het netwerkantwoord voor de te downloaden URI"
 
 #: WebKit/gtk/webkit/webkitdownload.cpp:292
 msgid "Destination URI"
@@ -152,9 +150,8 @@
 msgstr "Wachtwoord:"
 
 #: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
-#, fuzzy
 msgid "_Remember password"
-msgstr "Wachtwoord onthouden"
+msgstr "_Wachtwoord onthouden"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
@@ -186,22 +183,21 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
-msgstr ""
+msgstr "Beleid voor horizontale schuifbalk"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:345
-#, fuzzy
 msgid ""
 "Determines the current policy for the horizontal scrollbar of the frame."
-msgstr "Bepaalt de huidige voortgang van de download"
+msgstr ""
+"Bepaalt het beleid voor de horizontale schuifbalk van het frame"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:362
 msgid "Vertical Scrollbar Policy"
-msgstr ""
+msgstr "Beleid voor verticale schuifbalk"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:363
-#, fuzzy
 msgid "Determines the current policy for the vertical scrollbar of the frame."
-msgstr "Bepaalt de huidige voortgang van de download"
+msgstr "Bepaalt het huidige beleid voor de verticale schuifbalk van het frame."
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
@@ -230,7 +226,7 @@
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
 msgid "Last visited Time"
-msgstr "Laatst bezocht op:"
+msgstr "Laatst bezocht op"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
 msgid "The time at which the history item was last visited"
@@ -261,13 +257,12 @@
 msgstr "De uitgevoerde JavaScript profileren."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
-#, fuzzy
 msgid "Enable Timeline profiling"
-msgstr "JavaScript-profilering inschakelen"
+msgstr "Tijdslijn-profilering inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
-msgstr ""
+msgstr "De instrumentering van WebCore profileren."
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
 msgid "Reason"
@@ -298,14 +293,12 @@
 msgstr "Een bitmask dat de staat van de optietoets representeert"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
-#, fuzzy
 msgid "Target frame"
-msgstr "Naam van het frame"
+msgstr "Doelframe"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
-#, fuzzy
 msgid "The target frame for the navigation"
-msgstr "De URI die werd aangevraagd als bestemming voor de navigatie"
+msgstr "Het doelframe voor de navigatie"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:233
 msgid "Default Encoding"
@@ -487,146 +480,143 @@
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:477
 msgid "Enable Spell Checking"
-msgstr ""
+msgstr "Spellingcontrole inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:478
-#, fuzzy
 msgid "Enables spell checking while typing"
-msgstr "_Spelling controleren tijdens het typen"
+msgstr "Schakelt spellingcontrole tijdens het typen in"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:501
 msgid "Languages to use for spell checking"
-msgstr ""
+msgstr "Te gebruiken talen bij spellingcontrole"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:502
 msgid "Comma separated list of languages to use for spell checking"
-msgstr ""
+msgstr "Kommagescheiden lijst van talen voor spellingcontrole"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:516
-#, fuzzy
 msgid "Enable Caret Browsing"
-msgstr "Privé-browsen inschakelen"
+msgstr "Cursor-browsen inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:517
 msgid "Whether to enable accesibility enhanced keyboard navigation"
-msgstr ""
+msgstr "Of toegankelijkheidsgeoptimaliseerde toetsenbordnavigatie is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:532
 msgid "Enable HTML5 Database"
-msgstr ""
+msgstr "HTML5-database inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:533
 msgid "Whether to enable HTML5 database support"
-msgstr ""
+msgstr "Of HTML5-databaseondersteuning is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:548
 msgid "Enable HTML5 Local Storage"
-msgstr ""
+msgstr "HTML5-lokale opslag inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:549
 msgid "Whether to enable HTML5 Local Storage support"
-msgstr ""
+msgstr "Of HTML5-lokale opslag ingeschakeld moet zijn"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:563
-#, fuzzy
 msgid "Enable XSS Auditor"
-msgstr "Scripts inschakelen"
+msgstr "XSS-auditor inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:564
 msgid "Whether to enable teh XSS auditor"
-msgstr ""
+msgstr "Of de XSS-auditor is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:582
 msgid "User Agent"
-msgstr ""
+msgstr "User-agent"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:583
 msgid "The User-Agent string used by WebKitGtk"
-msgstr ""
+msgstr "De User-Agent-tekenreeks die WebKitGtk gebruikt"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:598
 msgid "JavaScript can open windows automatically"
-msgstr ""
+msgstr "JavaScript kan automatisch vensters openen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:599
 msgid "Whether JavaScript can open windows automatically"
-msgstr ""
+msgstr "Of JavaScript automatisch vensters kan openen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:614
 msgid "Enable offline web application cache"
-msgstr ""
+msgstr "Offline webapplicatiebuffer inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:615
 msgid "Whether to enable offline web application cache"
-msgstr ""
+msgstr "Of de offline webapplicatiebuffer is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:642
 msgid "Editing behavior"
-msgstr ""
+msgstr "Gedrag bij bewerken"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:643
 msgid "The behavior mode to use in editing mode"
-msgstr ""
+msgstr "De gedragsmodus in de bewerkingsstand"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:659
 msgid "Enable universal access from file URIs"
-msgstr ""
+msgstr "Universele toegang vanaf bestands-URI's inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:660
 msgid "Whether to allow universal access from file URIs"
-msgstr ""
+msgstr "Of universele toegang vanaf bestands-URI's is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:675
-#, fuzzy
 msgid "Enable DOM paste"
-msgstr "Scripts inschakelen"
+msgstr "DOM-plakken inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:676
 msgid "Whether to enable DOM paste"
-msgstr ""
+msgstr "Of plakken vanuit het DOM is ingeschakeld"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:694
 msgid "Tab key cycles through elements"
-msgstr ""
+msgstr "Tab-toets wandelt door elementen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:695
 msgid "Whether the tab key cycles through elements on the page."
-msgstr ""
+msgstr "Of de tab-toets door de elementen op de pagina wandelt."
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:715
 msgid "Enable Default Context Menu"
-msgstr ""
+msgstr "Standaard-contextmenu inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:716
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
+"Schakelt het afhandelen van klikken met de tweede muisknop in voor het creëren "
+"van het standaard contextmenu"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:736
 msgid "Enable Site Specific Quirks"
-msgstr ""
+msgstr "Site-specifieke eigenaardigheden inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:737
 msgid "Enables the site-specific compatibility workarounds"
-msgstr ""
+msgstr "Schakelt omzeilingen in voor compatibiliteit met specifieke websites"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:759
 msgid "Enable page cache"
-msgstr ""
+msgstr "Paginabuffer inschakelen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:760
-#, fuzzy
 msgid "Whether the page cache should be used"
-msgstr "Of achtergrondafbeeldingen afgedrukt moeten worden."
+msgstr "Of de paginabuffer gebruikt moet worden"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:780
 msgid "Auto Resize Window"
-msgstr ""
+msgstr "Venstergrootte automatisch aanpassen"
 
 #: WebKit/gtk/webkit/webkitwebsettings.cpp:781
 msgid "Automatically resize the toplevel window when a page requests it"
-msgstr ""
+msgstr "Grootte van topniveauvenster automatisch aanpassen wanneer pagina hierom vraagt"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2316
 msgid "Returns the @web_view's document title"
@@ -722,11 +712,11 @@
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2517
 msgid "Icon URI"
-msgstr ""
+msgstr "Pictogram-URI"
 
 #: WebKit/gtk/webkit/webkitwebview.cpp:2518
 msgid "The URI for the favicon for the #WebKitWebView."
-msgstr ""
+msgstr "De URI voor het favicon van de #WebKitWebView."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
@@ -901,39 +891,39 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
 msgid "Loading..."
-msgstr ""
+msgstr "Laden…"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
 msgid "Live Broadcast"
-msgstr ""
+msgstr "Live-uitzending"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
 msgid "audio element controller"
-msgstr ""
+msgstr "besturing audio-element"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
 msgid "video element controller"
-msgstr ""
+msgstr "besturing video-element"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
 msgid "mute"
-msgstr ""
+msgstr "dempen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
 msgid "unmute"
-msgstr ""
+msgstr "geluid aan"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
 msgid "play"
-msgstr ""
+msgstr "afspelen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
 msgid "pause"
-msgstr ""
+msgstr "pauze"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
 msgid "movie time"
-msgstr ""
+msgstr "afspeelduur"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
 msgid "timeline slider thumb"
@@ -941,68 +931,67 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
 msgid "back 30 seconds"
-msgstr ""
+msgstr "30 seconden terug"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
 msgid "return to realtime"
-msgstr ""
+msgstr "terug naar realtime"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
 msgid "elapsed time"
-msgstr ""
+msgstr "verstreken tijd"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
 msgid "remaining time"
-msgstr ""
+msgstr "tijd te gaan"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
-#, fuzzy
 msgid "status"
-msgstr "Status"
+msgstr "status"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
 msgid "fullscreen"
-msgstr ""
+msgstr "volledig scherm"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
 msgid "fast forward"
-msgstr ""
+msgstr "snel vooruit"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
 msgid "fast reverse"
-msgstr ""
+msgstr "snel achteruit"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
 msgid "show closed captions"
-msgstr ""
+msgstr "ondertiteling tonen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
 msgid "hide closed captions"
-msgstr ""
+msgstr "ondertiteling verbergen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
 msgid "audio element playback controls and status display"
-msgstr ""
+msgstr "afspeelbesturing en statusweergave audio-element"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
 msgid "video element playback controls and status display"
-msgstr ""
+msgstr "afspeelbesturing en statusweergave video-element"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
 msgid "mute audio tracks"
-msgstr ""
+msgstr "audiosporen dempen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
 msgid "unmute audio tracks"
-msgstr ""
+msgstr "audiosporen laten horen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
 msgid "begin playback"
-msgstr ""
+msgstr "afspelen beginnen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
 msgid "pause playback"
-msgstr ""
+msgstr "afspelen pauzeren"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
 msgid "movie time scrubber"
@@ -1014,73 +1003,72 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
 msgid "seek movie back 30 seconds"
-msgstr ""
+msgstr "30 seconden terugzoeken in film"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
 msgid "return streaming movie to real time"
-msgstr ""
+msgstr "terugkeren naar realtime in streamende film"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
 msgid "current movie time in seconds"
-msgstr ""
+msgstr "huidige filmtijd in seconden"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
 msgid "number of seconds of movie remaining"
-msgstr ""
+msgstr "aantal seconden film te gaan"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
 msgid "current movie status"
-msgstr ""
+msgstr "huidige filmstatus"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
 msgid "seek quickly back"
-msgstr ""
+msgstr "snel achteruit zoeken"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
 msgid "seek quickly forward"
-msgstr ""
+msgstr "snel vooruit zoeken"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
 msgid "Play movie in fullscreen mode"
-msgstr ""
+msgstr "Film afspelen in volledig scherm"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
 msgid "start displaying closed captions"
-msgstr ""
+msgstr "beginnen met tonen van ondertiteling"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
 msgid "stop displaying closed captions"
-msgstr ""
+msgstr "stoppen met tonen van ondertiteling"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
-#, fuzzy
 msgid "indefinite time"
-msgstr "definitie"
+msgstr "onbepaalde tijd"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
 msgid "value missing"
-msgstr ""
+msgstr "waarde ontbreekt"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
 msgid "type mismatch"
-msgstr ""
+msgstr "type komt niet overeen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
 msgid "pattern mismatch"
-msgstr ""
+msgstr "patroon komt niet overeen"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
 msgid "too long"
-msgstr ""
+msgstr "te lang"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
 msgid "range underflow"
-msgstr ""
+msgstr "onder bereik"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
 msgid "range overflow"
-msgstr ""
+msgstr "over bereik"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
-msgstr ""
+msgstr "stap komt niet overeen"
diff --git a/WebKit/gtk/po/pa.po b/WebKit/gtk/po/pa.po
index 19ac98d..418192e 100644
--- a/WebKit/gtk/po/pa.po
+++ b/WebKit/gtk/po/pa.po
@@ -5,7 +5,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.4\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2009-04-09 19:09-0300\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2010-02-18 18:25+0530\n"
 "Last-Translator: A S Alam <aalam@users.sf.net>\n"
 "Language-Team: Punjabi/Panjabi <kde-i18n-doc@kde.org>\n"
@@ -15,12 +15,12 @@
 "X-Generator: Lokalize 1.0\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
-#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:425
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
 msgid "Upload File"
 msgstr "ਫਾਇਲ ਅੱਪਲੋਡ"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:139
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
 msgid "Input _Methods"
 msgstr "ਇੰਪੁੱਟ ਢੰਗ(_M)"
 
@@ -65,631 +65,1031 @@
 msgstr "ZWNJ ਸਿਫ਼ਰ ਚੌੜਾਈ ਨਾ-ਜੁਆਇੰਨਰ(_n)"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:134
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
 msgid "_Insert Unicode Control Character"
 msgstr "ਯੂਨੀਕੋਡ ਕੰਟਰੋਲ ਕਰੈਕਟਰ ਪਾਉ(_I)"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:250
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "ਨੈੱਟਵਰਕ ਮੰਗ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:251
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "URL ਲਈ ਨੈੱਟਵਰਕ ਮੰਗ, ਜਿਸ ਨੂੰ ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾਣਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:265
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+#, fuzzy
+msgid "Network Response"
+msgstr "ਨੈੱਟਵਰਕ ਮੰਗ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+#, fuzzy
+msgid "The network response for the URI that should be downloaded"
+msgstr "URL ਲਈ ਨੈੱਟਵਰਕ ਮੰਗ, ਜਿਸ ਨੂੰ ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾਣਾ ਹੈ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "ਟਿਕਾਣਾ URI"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:266
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "ਟਿਕਾਣਾ URI, ਜਿੱਥੇ ਫਾਇਲ ਸੰਭਾਲਣੀ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:280
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "ਸੁਝਾਇਆ ਫਾਇਲ-ਨਾਂ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:281
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "ਜਦੋਂ ਸੰਭਾਲਿਆ ਜਾਂਦਾ ਹੋਵੇ ਤਾਂ ਡਿਫਾਲਟ ਸੁਝਾਇਆ ਫਾਇਲ-ਨਾਂ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:294
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "ਤਰੱਕੀ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:295
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "ਡਾਊਨਲੋਡ ਦੀ ਮੌਜੂਦ ਤਰੱਕੀ ਜਾਣੋ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "ਹਾਲਤ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:309
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "ਮੌਜੂਦਾ ਡਾਊਨਲੋਡ ਦੀ ਹਾਲਤ ਜਾਣੋ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:324
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "ਮੌਜੂਦਾ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "ਪਹਿਲਾਂ ਹੀ ਡਾਊਨਲੋਡ ਕੀਤੇ ਗਏ ਡਾਟੇ ਦੀ ਲੰਬਾਈ"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "ਕੁੱਲ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "ਫਾਇਲ ਦਾ ਕੁੱਲ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:469
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "ਯੂਜ਼ਰ ਨੇ ਡਾਊਨਲੋਡ ਰੱਦ ਕੀਤਾ"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "ਸਾਈਟ %s ਨੇ ਯੂਜ਼ਰ ਨਾਂ ਅਤੇ ਪਾਸਵਰਡ ਦੀ ਮੰਗ ਕੀਤੀ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "ਯੂਜ਼ਰ ਨਾਂ:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "ਪਾਸਵਰਡ:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:281
-msgid "Remember password"
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+#, fuzzy
+msgid "_Remember password"
 msgstr "ਪਾਸਵਰਡ ਯਾਦ ਰੱਖੋ"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:211
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
 msgstr "ਨਾਂ"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:212
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
 msgid "The name of the frame"
 msgstr "ਫਰੇਮ ਦਾ ਨਾਂ"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:218
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:154
-#: WebKit/gtk/webkit/webkitwebview.cpp:1715
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "ਟਾਈਟਲ"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:219
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
 msgid "The document title of the frame"
 msgstr "ਫਰੇਮ ਦਾ ਡੌਕੂਮੈਂਟ ਟਾਈਟਲ"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:225
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:186
-#: WebKit/gtk/webkit/webkitwebview.cpp:1729
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
-#: WebKit/gtk/webkit/webkitwebframe.cpp:226
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
 msgid "The current URI of the contents displayed by the frame"
 msgstr "ਫਰੇਮ ਵਲੋਂ ਵੇਖਾਈ ਜਾ ਰਹੀ ਸਮੱਗਰੀ ਦਾ ਮੌਜੂਦਾ URI"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:155
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+#, fuzzy
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr "ਡਾਊਨਲੋਡ ਦੀ ਮੌਜੂਦ ਤਰੱਕੀ ਜਾਣੋ"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+#, fuzzy
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr "ਡਾਊਨਲੋਡ ਦੀ ਮੌਜੂਦ ਤਰੱਕੀ ਜਾਣੋ"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
 msgstr "ਅਤੀਤ ਆਈਟਮ ਦਾ ਟਾਈਟਲ"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:170
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
 msgid "Alternate Title"
 msgstr "ਬਦਲਵਾਂ ਟਾਈਟਲ"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:171
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
 msgid "The alternate title of the history item"
 msgstr "ਅਤੀਤ ਆਈਟਮ ਦਾ ਬਦਲਵਾਂ ਟਾਈਟਲ"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:187
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
 msgid "The URI of the history item"
 msgstr "ਅਤੀਤ ਆਈਟਮ ਦਾ URI"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:202
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:167
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
 msgid "Original URI"
 msgstr "ਅਸਲ URI"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:203
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
 msgid "The original URI of the history item"
 msgstr "ਅਤੀਤ ਆਈਟਮ ਦਾ ਅਸਲੀ URI"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:218
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
 msgid "Last visited Time"
 msgstr "ਆਖਰੀ ਵਾਰ ਖੋਲ੍ਹਣ ਸਮਾਂ"
 
-#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:219
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
 msgid "The time at which the history item was last visited"
 msgstr "ਸਮਾਂ, ਜਿਸ ਦੌਰਾਨ ਅਤੀਤ ਆਈਟਮ ਨੂੰ ਖੋਲ੍ਹਿਆ ਗਿਆ ਸੀ"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:260
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
 msgid "Web View"
 msgstr "ਵੈੱਬ ਝਲਕ"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:261
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
 msgid "The Web View that renders the Web Inspector itself"
 msgstr "ਵੈੱਬ ਝਲਕ, ਜੋ ਕਿ ਵੈੱਬ  ਇੰਸਪੈਕਟਰ ਖੁਦ ਰੈਂਡਰ ਕਰਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:274
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
 msgid "Inspected URI"
 msgstr "ਜਾਂਚਿਆ URI"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:275
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
 msgid "The URI that is currently being inspected"
 msgstr "URI ਜੋ ਇਸ ਸਮੇਂ ਜਾਂਚਿਆ ਜਾ ਰਿਹਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:291
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
 msgid "Enable JavaScript profiling"
 msgstr "ਜਾਵਾਸਕ੍ਰਿਪਟ ਪਰੋਫਾਇਲਿੰਗ ਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebinspector.cpp:292
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
 msgid "Profile the executed JavaScript."
 msgstr "ਜਾਵਾਸਕ੍ਰਿਪਟ ਚਲਾਉਣ ਲਈ ਪਰੋਫਾਇਲ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:152
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+#, fuzzy
+msgid "Enable Timeline profiling"
+msgstr "ਜਾਵਾਸਕ੍ਰਿਪਟ ਪਰੋਫਾਇਲਿੰਗ ਯੋਗ"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
 msgid "Reason"
 msgstr "ਕਾਰਨ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:153
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
 msgid "The reason why this navigation is occurring"
 msgstr "ਕਾਰਨ ਕਿ ਕਿਉਂ ਇਹ ਨੇਵੀਗੇਸ਼ਨ ਹੋਈ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:168
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
 msgid "The URI that was requested as the target for the navigation"
 msgstr "URI, ਜੋ ਕਿ ਨੇਵੀਗੇਸ਼ਨ ਲਈ ਟਾਰਗੇਟ ਵਜੋਂ ਚਾਹੀਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:180
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
 msgid "Button"
 msgstr "ਬਟਨ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:181
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
 msgid "The button used to click"
 msgstr "ਕਲਿੱਕ ਕਰਨ ਵਰਤਣ ਵਾਸਤੇ ਬਟਨ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:196
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
 msgid "Modifier state"
 msgstr "ਮਾਡੀਫਾਇਰ ਹਾਲਤ"
 
-#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:197
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
 msgid "A bitmask representing the state of the modifier keys"
 msgstr "ਬਿਟਮਾਸਕ ਮਾਡੀਫਾਈਰ ਸਵਿੱਚਾਂ ਦੀ ਹਾਲਤ ਵੇਖਾਉਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:129
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+#, fuzzy
+msgid "Target frame"
+msgstr "ਫਰੇਮ ਦਾ ਨਾਂ"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+#, fuzzy
+msgid "The target frame for the navigation"
+msgstr "URI, ਜੋ ਕਿ ਨੇਵੀਗੇਸ਼ਨ ਲਈ ਟਾਰਗੇਟ ਵਜੋਂ ਚਾਹੀਦਾ ਹੈ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "ਡਿਫਾਲਟ ਇੰਕੋਡਿੰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:130
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "ਵੇਖਾਏ ਜਾ ਰਹੇ ਟੈਕਸਟ ਲਈ ਡਿਫਾਲਟ ਇੰਕੋਡਿੰਗ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:138
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "ਕਰਸਵ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:139
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਡਿਫਾਲਟ ਕਰਸਵ ਫੋਂਟ ਵਰਗ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:147
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "ਡਿਫਾਲਟ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:148
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਡਿਫਾਲਟ ਫੋਂਟ ਵਰਗ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:156
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "ਫੈਂਸੀ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:157
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਡਿਫਾਲਟ ਫੈਂਸੀ ਫੋਂਟ ਵਰਗ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:165
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "ਮੋਨੋਸਪੇਸ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:166
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "ਡਿਫਾਲਟ ਫੋਂਟ ਵਰਗ, ਜੋ ਮੋਨੋਸਪੇਸ ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣਾ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:174
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "ਸੈਨਜ਼ ਸੈਰੀਫ਼ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:175
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਡਿਫਾਲਟ ਸੈਨਜ਼ ਸੈਰੀਫ਼ ਫੋਂਟ ਵਰਗ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:183
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "ਸੈਰੀਫ਼ ਫੋਂਟ ਵਰਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:184
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣ ਵਾਸਤੇ ਡਿਫਾਲਟ ਸੈਰੀਫ਼ ਫੋਂਟ ਵਰਗ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:192
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "ਡਿਫਾਲਟ ਫੋਂਟ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:193
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਿਆ ਜਾਂਦਾ ਫੋਂਟ ਸਾਈਜ਼।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:201
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "ਡਿਫਾਲਟ ਮੋਨੋਸਮਪੇਸ ਫੋਂਟ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:202
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "ਡਿਫਾਲਟ ਫੋਂਟ ਸਾਈਜ਼, ਜੋ ਮੋਨੋਸਪੇਸ ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤਣਾ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:210
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "ਘੱਟੋ-ਘੱਟ ਫੋਂਟ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:211
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਵਰਤੇ ਜਾਣ ਵਾਸਤੇ ਘੱਟੋ-ਘੱਟ ਫੋਟ ਸਾਈਜ਼।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:219
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "ਘੱਟੋ-ਘੱਟ ਲਾਜ਼ੀਕਲ ਫੋਂਟ ਸਾਈਜ਼"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:220
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "ਡਿਸਪਲੇਅ ਟੈਕਸਟ ਵੇਖਾਉਣ ਲਈ ਘੱਟੋ-ਘੱਟ ਲਾਜ਼ੀਕਲ ਫੋਂਟ ਸਾਈਜ਼ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:239
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "96 DPI ਲਈ ਮਜ਼ਬੂਰ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:240
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "੯੬ DPI ਦੇ ਰੈਜ਼ੋਲੂਸ਼ਨ ਲਈ ਮਜ਼ਬੂਰ ਕਰੋ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:248
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "ਚਿੱਤਰ ਆਟੋ ਲੋਡ ਕਰੋ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:249
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "ਚਿੱਤਰ ਆਟੋਮੈਟਿਕ ਲੋਡ ਕਰੋ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:257
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "ਚਿੱਤਰ ਆਟੋ ਸੁੰਘੜੋ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:258
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "ਇੱਕਲੇ ਚਿੱਤਰਾਂ ਨੂੰ ਫਿੱਟ ਕਰਨ ਲਈ ਆਟੋਮੈਟਿਕ ਸੁੰਘੜੋ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:266
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "ਬੈਕਗਰਾਊਂਡ ਪਰਿੰਟ ਕਰੋ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:267
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "ਕੀ ਬੈਕਗਰਾਊਂਡ ਚਿੱਤਰਾਂ ਨੂੰ ਛਾਪਣਾ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:275
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "ਸਕ੍ਰਿਪਟਾਂ ਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:276
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "ਇੰਬੈੱਡ ਸਕ੍ਰਿਪਟ ਭਾਸ਼ਾਵਾਂ ਚਾਲੂ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:284
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "ਪਲੱਗਇਨ ਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:285
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "ਇੰਬੈੱਡ ਪਲੱਗਇਨ ਆਬਜੈਕਟ ਚਾਲੂ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:293
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "ਮੁੜ-ਆਕਾਰ ਯੋਗ ਟੈਕਸਟ ਖੇਤਰ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:294
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "ਕੀ ਟੈਕਸਟ ਖੇਤਰ ਮੁੜ-ਆਕਾਰ ਯੋਗ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "ਯੂਜ਼ਰ ਸਟਾਇਲਸ਼ੀਟ URI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:302
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "ਸਟਾਈਲਸ਼ੀਟ ਦਾ URI, ਜੋ ਕਿ ਹਰੇਕ ਪੇਜ਼ ਉੱਤੇ ਲਾਗੂ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:317
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "ਜ਼ੂਮ ਸਟਿੱਪਿੰਗ ਮੁੱਲ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "ਜਦੋਂ ਜ਼ੂਮ ਇਨ ਜਾਂ ਆਉਟ ਕੀਤਾ ਜਾਵੇ ਤਾਂ ਜ਼ੂਮ ਲੈਵਲ ਬਦਲਣ ਦਾ ਮੁੱਲ ਹੈ।"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:336
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "ਡਿਵੈਲਪਰ ਐਕਸਟਰਾ ਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:337
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "ਖਾਸ ਇਕਸਟੈਨਸ਼ਨ ਚਾਲੂ ਕਰਦਾ ਹੈ, ਜੋ ਡਿਵੈਲਪਰਾਂ ਲਈ ਸਹਾਇਕ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "ਪ੍ਰਾਈਵੇਟ ਬਰਾਊਜ਼ਿੰਗ ਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:358
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "ਪ੍ਰਾਈਵੇਟ ਬਰਾਊਜ਼ਡ ਮੋਡ ਚਾਲੂ ਕਰੋ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+#, fuzzy
+msgid "Enables spell checking while typing"
+msgstr "ਲਿਖਣ ਦੇ ਦੌਰਾਨ ਹੀ ਸਪੈਲਿੰਗ ਚੈੱਕ ਕਰੋ(_T)"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+#, fuzzy
+msgid "Enable Caret Browsing"
+msgstr "ਪ੍ਰਾਈਵੇਟ ਬਰਾਊਜ਼ਿੰਗ ਯੋਗ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+#, fuzzy
+msgid "Enable XSS Auditor"
+msgstr "ਸਕ੍ਰਿਪਟਾਂ ਯੋਗ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+#, fuzzy
+msgid "Enable DOM paste"
+msgstr "ਸਕ੍ਰਿਪਟਾਂ ਯੋਗ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+msgid "Enable Site Specific Quirks"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+#, fuzzy
+msgid "Whether the page cache should be used"
+msgstr "ਕੀ ਬੈਕਗਰਾਊਂਡ ਚਿੱਤਰਾਂ ਨੂੰ ਛਾਪਣਾ ਹੈ।"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "ਜਾਵਾਸਕ੍ਰਿਪਟ ਪਰੋਫਾਇਲਿੰਗ ਯੋਗ"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "@web_view ਦਾ ਡੌਕੂਮੈਂਟ ਟਾਈਟਲ ਦਿੰਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1730
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "@web_view ਵਲੋਂ ਵੇਖਾਈ ਜਾ ਰਹੀ ਸਮੱਗਰੀ ਦਾ ਮੌਜੂਦਾ URI ਦਿੰਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1743
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "ਟਾਰਗੇਟ ਲਿਸਟ ਕਾਪੀ ਕਰੋ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1744
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "ਕਲਿੱਪਬੋਰਡ ਕਾਪੀ ਕਰਨ ਲਈ ਇਸ ਵੈੱਬ ਝਲਕ ਸਹਿਯੋਗ ਵਾਸਤੇ ਟਾਰਗੇਟ ਦੀ ਲਿਸਟ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1757
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "ਟਾਰਗੇਟ ਲਿਸਟ ਚੇਪੋ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1758
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "ਕਲਿੱਪਬੋਰਡ ਪੇਸਟਿੰਗ ਲਈ ਇਸ ਵੈੱਬ ਝਲਕ ਸਹਿਯੋਗ ਵਾਸਤੇ ਟਾਰਗੇਟ ਦੀ ਲਿਸਟ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1764
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "ਸੈਟਿੰਗ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1765
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "ਸਬੰਧਤ WebKitWebSettings ਮੌਕਾ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1778
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "ਵੈੱਬ ਇੰਸਪੈਕਟਰ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1779
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "ਸਬੰਧਤ WebKitWebInspector ਮੌਕਾ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1799
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "ਸੋਧਯੋਗ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1800
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "ਕੀ ਸਮੱਗਰੀ ਨੂੰ ਯੂਜ਼ਰ ਵਲੋਂ ਸੋਧਿਆ ਜਾ ਸਕਦਾ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1806
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "ਟਰਾਂਸਪਰੇਟ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1807
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "ਕੀ ਸਮੱਗਰੀ ਦੀ ਪਾਰਦਰਸ਼ੀ ਬੈਕਗਰਾਊਂਡ ਹੋਵੇ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1820
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "ਜ਼ੂਮ ਲੈਵਲ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1821
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "ਸਮੱਗਰੀ ਦਾ ਜ਼ੂਮ ਲੈਵਲ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1836
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "ਪੂਰੀ ਸਮੱਗਰੀ ਜ਼ੂਮ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1837
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "ਜਦੋਂ ਜ਼ੂਮ ਕਰਨਾ ਹੋਵੇ ਤਾਂ ਕੀ ਪੂਰੀ ਸਮਗੱਰੀ ਕਰਨੀ ਹੈ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1850
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "ਇੰਕੋਡਿੰਗ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1851
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "ਵੈਬ ਝਲਕ ਲਈ ਡਿਫਾਲਟ ਇੰਕੋਡਿੰਗ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1864
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "ਪਸੰਦੀਦਾ ਇੰਕੋਡਿੰਗ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:1865
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "ਵੈੱਬ ਝਲਕ ਲਈ ਕਸਟਮ ਇੰਕੋਡਿੰਗ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:51
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:56
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
 msgid "Submit"
 msgstr "ਭੇਜੋ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
 msgid "Reset"
 msgstr "ਮੁੜ-ਸੈੱਟ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:66
-msgid "_Searchable Index"
-msgstr "ਖੋਜਯੋਗ ਇੰਡੈਕਸ(_S)"
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:71
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
 msgstr "ਫਾਇਲ ਚੁਣੋ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:76
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
 msgid "(None)"
 msgstr "(ਕੋਈ ਨਹੀਂ)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:81
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
 msgid "Open Link in New _Window"
 msgstr "ਲਿੰਕ ਨਵੀਂ ਵਿੰਡੋ ਵਿੱਚ ਖੋਲ੍ਹੋ(_W)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:86
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
 msgid "_Download Linked File"
 msgstr "ਲਿੰਕ ਕੀਤੀ ਫਾਇਲ ਡਾਊਨਲੋਡ ਕਰੋ(_D)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:91
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
 msgid "Copy Link Loc_ation"
 msgstr "ਲਿੰਕ ਟਿਕਾਣਾ ਕਾਪੀ ਕਰੋ(_a)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:96
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
 msgid "Open _Image in New Window"
 msgstr "ਚਿੱਤਰ ਨਵੀਂ ਵਿੰਡੋ ਵਿੱਚ ਖੋਲ੍ਹੋ(_I)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:101
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
 msgid "Sa_ve Image As"
 msgstr "ਚਿੱਤਰ ਇੰਝ ਸੰਭਾਲੋ(_v)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:106
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
 msgid "Cop_y Image"
 msgstr "ਚਿੱਤਰ ਕਾਪੀ ਕਰੋ(_y)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:111
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
 msgid "Open _Frame in New Window"
 msgstr "ਫਰੇਮ ਨਵੀਂ ਵਿੰਡੋ ਵਿੱਚ ਖੋਲ੍ਹੋ(_F)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:162
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
 msgid "_Reload"
 msgstr "ਮੁੜ-ਲੋਡ ਕਰੋ(_R)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:179
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
 msgid "No Guesses Found"
 msgstr "ਕੋਈ ਸੁਝਾਅ ਨਹੀਂ ਲੱਭਿਆ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:184
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
 msgid "_Ignore Spelling"
 msgstr "ਸਪੈਲਿੰਗ ਅਣਡਿੱਠੇ(_I)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:189
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
 msgid "_Learn Spelling"
 msgstr "ਸਪੈਲਿੰਗ ਸਿੱਖੋ(_L)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:194
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
 msgid "_Search the Web"
 msgstr "ਵੈੱਬ ਉੱਤੇ ਖੋਜ(_S)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:199
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
 msgid "_Look Up in Dictionary"
 msgstr "ਡਿਕਸ਼ਨਰੀ ਵਿੱਚ ਖੋਜੋ(_L)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:204
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
 msgid "_Open Link"
 msgstr "ਲਿੰਕ ਖੋਲ੍ਹੋ(_O)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:209
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
 msgid "Ignore _Grammar"
 msgstr "ਗਰਾਮਰਡ ਅਣਡਿੱਠੀ(_G)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:214
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
 msgid "Spelling and _Grammar"
 msgstr "ਸਪੈਲਿੰਗ ਅਤੇ ਗਰਾਮਰ(_G)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:219
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
 msgid "_Show Spelling and Grammar"
 msgstr "ਸਪੈਲਿੰਗ ਅਤੇ ਗਰਾਮਰ ਵੇਖੋ(_S)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:219
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
 msgid "_Hide Spelling and Grammar"
 msgstr "ਸਪੈਲਿੰਗ ਅਤੇ ਗਰਾਮਰ ਓਹਲੇ(_H)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:224
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
 msgid "_Check Document Now"
 msgstr "ਡੌਕੂਮੈਂਟ ਹੁਣੇ ਚੈੱਕ ਕਰੋ(_C)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:229
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
 msgid "Check Spelling While _Typing"
 msgstr "ਲਿਖਣ ਦੇ ਦੌਰਾਨ ਹੀ ਸਪੈਲਿੰਗ ਚੈੱਕ ਕਰੋ(_T)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:234
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
 msgid "Check _Grammar With Spelling"
 msgstr "ਗਰਾਮਰ ਨਾਲ ਸਪੈਲਿੰਗ ਚੈੱਕ ਕਰੋ(_G)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:239
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
 msgid "_Font"
 msgstr "ਫੋਂਟ(_F)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:262
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
 msgid "_Outline"
 msgstr "ਆਉਟਲਾਈਨ(_O)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:267
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
 msgid "Inspect _Element"
 msgstr "ਐਲੀਮੈਂਟ ਜਾਂਚੋ(_E)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:272
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
 msgid "No recent searches"
 msgstr "ਕੋਈ ਤਾਜ਼ਾ ਖੋਜ ਨਹੀਂ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:277
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
 msgid "Recent searches"
 msgstr "ਤਾਜ਼ਾ ਖੋਜ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:282
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
 msgid "_Clear recent searches"
 msgstr "ਤਾਜ਼ਾ ਖੋਜਾਂ ਸਾਫ਼ ਕਰੋ(_C)"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:287
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
 msgid "term"
 msgstr "ਸ਼ਬਦ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:292
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
 msgid "definition"
 msgstr "ਪ੍ਰੀਭਾਸ਼ਾ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:297
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
 msgid "press"
 msgstr "ਦੱਬੋ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:302
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
 msgid "select"
 msgstr "ਚੁਣੋ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:307
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
 msgid "activate"
 msgstr "ਐਕਟੀਵੇਟ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:312
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
 msgid "uncheck"
 msgstr "ਅਣ-ਚੋਣ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:317
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
 msgid "check"
 msgstr "ਚੋਣ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:322
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
 msgid "jump"
 msgstr "ਜੰਪ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:328
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
 msgid " files"
 msgstr " ਫਾਇਲਾਂ"
 
-#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:333
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
 msgid "Unknown"
 msgstr "ਅਣਜਾਣ"
 
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr ""
 
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+#, fuzzy
+msgid "status"
+msgstr "ਹਾਲਤ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+#, fuzzy
+msgid "indefinite time"
+msgstr "ਪ੍ਰੀਭਾਸ਼ਾ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "step mismatch"
+msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "ਖੋਜਯੋਗ ਇੰਡੈਕਸ(_S)"
diff --git a/WebKit/gtk/po/pt.po b/WebKit/gtk/po/pt.po
new file mode 100644
index 0000000..b99048d
--- /dev/null
+++ b/WebKit/gtk/po/pt.po
@@ -0,0 +1,1096 @@
+# webkit's Portuguese translation.
+# This file is put in the public domain.
+# António Lima <amrlima@gmail.com>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit 1.1.22\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-08 01:09+0000\n"
+"Last-Translator: António Lima <amrlima@gmail.com>\n"
+"Language-Team: gnome_pt@yahoogroups.com\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Virtaal 0.5.1\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+msgid "Upload File"
+msgstr "Enviar Ficheiro"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "_Métodos de Introdução"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LMR marca e_squerda-para-direita"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM marca _direita-para-esquerda"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE _embutidura esquerda-para-direita"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE e_mbutidura direita-para-esquerda"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO s_obrepor esquerda-para-direita"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO so_brepor direita-para-esquerda"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF formatação direccional _Pop"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS espaço de largura _zero"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ _união de largura zero"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ _não união de largura zero"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "_Inserir Carácter de Controlo Unicode"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "Network Request"
+msgstr "Pedido de Rede"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
+msgid "The network request for the URI that should be downloaded"
+msgstr "O pedido de rede para o URI que deve ser transferido"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+msgid "Network Response"
+msgstr "Resposta de Rede"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+msgid "The network response for the URI that should be downloaded"
+msgstr "A resposta de rede para o URI que deve ser transferido"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
+msgid "Destination URI"
+msgstr "URI de Destino"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
+msgid "The destination URI where to save the file"
+msgstr "O URI de destino onde gravar o ficheiro"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
+msgid "Suggested Filename"
+msgstr "Nome de Ficheiro Sugerido"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
+msgid "The filename suggested as default when saving"
+msgstr "O nome de ficheiro sugerido por omissão ao gravar"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
+msgid "Progress"
+msgstr "Progresso"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
+msgid "Determines the current progress of the download"
+msgstr "Determina o processo actual da transferência"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
+msgid "Status"
+msgstr "Estado"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
+msgid "Determines the current status of the download"
+msgstr "Determina o estado actual da transferência"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
+msgid "Current Size"
+msgstr "Tamanho Actual"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
+msgid "The length of the data already downloaded"
+msgstr "O tamanho dos dados já transferidos"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
+msgid "Total Size"
+msgstr "Tamanho Total"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
+msgid "The total size of the file"
+msgstr "O tamanho total do ficheiro"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
+msgid "User cancelled the download"
+msgstr "O utilizador cancelou a transferência"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Um nome de utilizador e senha estão a ser pedidos pelo site %s"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Mensagem do servidor:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "Nome de Utilizador:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "Senha:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+msgid "_Remember password"
+msgstr "_Recordar senha"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+msgid "Name"
+msgstr "Nome"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "The name of the frame"
+msgstr "O nome da moldura"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
+msgid "Title"
+msgstr "Título"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+msgid "The document title of the frame"
+msgstr "O título de documento da moldura"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+msgid "The current URI of the contents displayed by the frame"
+msgstr "O URI actual dos conteúdos apresentados pela moldura"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr "Política da Barra de Deslocamento Horizontal"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr ""
+"Determina a política actual para a barra de deslocamento horizontal da "
+"moldura."
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr "Política da Barra de Deslocamento Vertical"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr ""
+"Determina a política actual para a barra de deslocamento vertical da "
+"moldura."
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "O titulo do item do histórico"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "Título Alternativo"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "O titulo alternativo do item do histórico"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "O URI do item do histórico"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "URI Original"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "O URI original do item do histórico"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "Hora da última visita"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "A hora à qual o item do histórico foi visitado pela última vez"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "Vista Web"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "A vista Web que renderiza o próprio Web Inspector"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+msgid "Inspected URI"
+msgstr "URI Inspeccionado"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr "O URI que se encontra actualmente a ser inspeccionado"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "Activar Perfilar JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "Perfilar o JavaScript executado."
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+msgid "Enable Timeline profiling"
+msgstr "Activar perfilar linha temporal"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr "Perfilar a instrumentação WebCore."
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "Razão"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "A razão pela qual esta navegação está a ocorrer"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+msgid "The URI that was requested as the target for the navigation"
+msgstr "O URI que foi pedido como alvo para a navegação"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "Botão"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "O botão utilizado para clicar"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "Estado do modificador"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "Uma bitmask representando o estado das chaves do modificador"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+msgid "Target frame"
+msgstr "Moldura alvo"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+msgid "The target frame for the navigation"
+msgstr "A moldura alvo para a navegação"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
+msgid "Default Encoding"
+msgstr "Codificação Por Omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
+msgid "The default encoding used to display text."
+msgstr "A codificação por omissão utilizada para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
+msgid "Cursive Font Family"
+msgstr "Família de Fonte Cursive"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
+msgid "The default Cursive font family used to display text."
+msgstr "A família de fonte Cursive utilizada por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
+msgid "Default Font Family"
+msgstr "Família de Fonte Por Omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
+msgid "The default font family used to display text."
+msgstr "A família de fonte utilizada por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
+msgid "Fantasy Font Family"
+msgstr "Família de Fonte Fantasy"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
+msgid "The default Fantasy font family used to display text."
+msgstr "A família de fonte Fantasy utilizada por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
+msgid "Monospace Font Family"
+msgstr "Família de Fonte Mono-espaçada"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
+msgid "The default font family used to display monospace text."
+msgstr ""
+"A família de fonte mono-espaçada utilizada por omissão para apresentar "
+"texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
+msgid "Sans Serif Font Family"
+msgstr "Família de Fonte Sem Serifa"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
+msgid "The default Sans Serif font family used to display text."
+msgstr ""
+"A família de fonte Sem Serifa utilizada por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
+msgid "Serif Font Family"
+msgstr "Família de Fonte Serifa"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
+msgid "The default Serif font family used to display text."
+msgstr "A família de fonte Serifa utilizada por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
+msgid "Default Font Size"
+msgstr "Tamanho de Fonte Por Omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "The default font size used to display text."
+msgstr "O tamanho de fonte utilizado por omissão para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
+msgid "Default Monospace Font Size"
+msgstr "Tamanho de Fonte Mono-espaçada Por Omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
+msgid "The default font size used to display monospace text."
+msgstr "O tamanho de fonte mono-espaçada utilizado para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "Minimum Font Size"
+msgstr "Tamanho Mínimo de Fonte"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
+msgid "The minimum font size used to display text."
+msgstr "O tamanho mínimo de fonte utilizado para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
+msgid "Minimum Logical Font Size"
+msgstr "Tamanho Mínimo de Fonte Lógica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
+msgid "The minimum logical font size used to display text."
+msgstr "O tamanho mínimo de fonte lógica utilizado para apresentar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
+msgid "Enforce 96 DPI"
+msgstr "Forçar 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Forçar uma resolução de 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
+msgid "Auto Load Images"
+msgstr "Carregar Imagens Automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Load images automatically."
+msgstr "Carregar imagens automaticamente."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
+msgid "Auto Shrink Images"
+msgstr "Diminuir Imagens Automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
+msgid "Automatically shrink standalone images to fit."
+msgstr "Diminuir automaticamente imagens individuais para caber."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
+msgid "Print Backgrounds"
+msgstr "Imprimir Fundos"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
+msgid "Whether background images should be printed."
+msgstr "Se as imagens de fundo devem ser impressas."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
+msgid "Enable Scripts"
+msgstr "Activar Scripts"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
+msgid "Enable embedded scripting languages."
+msgstr "Activar linguagens procedimentais embutidas."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
+msgid "Enable Plugins"
+msgstr "Activar Plugins"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
+msgid "Enable embedded plugin objects."
+msgstr "Activar objectos plugin embutidos."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
+msgid "Resizable Text Areas"
+msgstr "Áreas de Texto Redimensionáveis"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
+msgid "Whether text areas are resizable."
+msgstr "Se as áreas de texto são redimensionáveis."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
+msgid "User Stylesheet URI"
+msgstr "URI de Folha de Estilos do Utilizador"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "O URI de uma folha de estilos que é aplicada a todas as páginas."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
+msgid "Zoom Stepping Value"
+msgstr "Valor de Alteração de Zoom"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr ""
+"O valor pelo qual o nível de zoom é alterado ao ser aumentado ou diminuído."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
+msgid "Enable Developer Extras"
+msgstr "Activar Extras de Programador"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
+msgid "Enables special extensions that help developers"
+msgstr "Activar extensões especiais que ajudam os programadores"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
+msgid "Enable Private Browsing"
+msgstr "Activar Navegação Privada"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
+msgid "Enables private browsing mode"
+msgstr "Activa o modo de navegação privada"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr "Activar Verificação Ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+msgid "Enables spell checking while typing"
+msgstr "Activa a verificação ortográfica ao escrever"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr "Idiomas a utilizar para verificação ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr ""
+"Lista separada por vírgulas de idiomas a utilizar na verificação ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+msgid "Enable Caret Browsing"
+msgstr "Activar Navegação com Cursor"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr ""
+"Se deve ser activada a navegação com teclado melhorada para acessibilidade"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr "Activar Base de Dados HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr "Se deve ser activado o suporte a base de dados HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr "Activar Armazenamento Local HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Se deve ser activado o suporte a armazenamento local HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+msgid "Enable XSS Auditor"
+msgstr "Activar Auditor XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr "Se deve ser activado o auditor XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr "Agente de Utilizador"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "A cadeia de caracteres de Agente de Utilizador utilizada pelo WebKitGtk"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript pode abrir janelas automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Se o JavaScript pode abrir janelas automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr "Activar cache de aplicações web em modo desligado"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr "Se deve ser activada a cache de aplicações web em modo desligado"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr "Comportamento de edição"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr "O modo de comportamento utilizar no modo de edição"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr "Activar acesso universal a partir de URIs de ficheiro"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr "Se deve ser activado o acesso universal a partir de URIs de ficheiro"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+msgid "Enable DOM paste"
+msgstr "Activar colar DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr "Se deve ser activado o colar DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr "Tecla Tab circula pelos elementos"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr "Se a tecla tab circula pelos elementos da página."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr "Activar Menu de Contexto por Omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr ""
+"Activa a gestão de cliques com o botão direito para a criação do menu de "
+"contexto por omissão"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+msgid "Enable Site Specific Quirks"
+msgstr "Activar Truques Específicos da Página"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "Activar as formas de contornar problemas específicas da página"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr "Activar cache de página"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+msgid "Whether the page cache should be used"
+msgstr "Se a cache da página deve ser utilizada"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr "Redimensionar Janela Automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr ""
+"Redimensionar automaticamente janela do nível superior quando é pedido pela "
+"página"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Activar Applet Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Se o suporte a Java Applet por <applet> deve estar activo"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
+msgid "Returns the @web_view's document title"
+msgstr "Devolve o título de documento @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Devolve o URI actual dos conteúdos apresentados pelo @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
+msgid "Copy target list"
+msgstr "Copiar lista de destinos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+"A lista de destinos que esta vista web suporta para cópia da área de "
+"transferência"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
+msgid "Paste target list"
+msgstr "Colar lista de destinos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+"A lista de destinos que esta vista web suporta para colagem da área de "
+"transferência"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
+msgid "Settings"
+msgstr "Definições"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
+msgid "An associated WebKitWebSettings instance"
+msgstr "Uma instância associada WebKitWebSettings"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
+msgid "Web Inspector"
+msgstr "Inspector Web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
+msgid "The associated WebKitWebInspector instance"
+msgstr "A instância associada WebKitWebInspector"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
+msgid "Editable"
+msgstr "Possível Editar"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
+msgid "Whether content can be modified by the user"
+msgstr "Se o conteúdo pode ser modificado pelo utilizador"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
+msgid "Transparent"
+msgstr "Transparente"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
+msgid "Whether content has a transparent background"
+msgstr "Se o conteúdo possui um fundo transparente"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
+msgid "Zoom level"
+msgstr "Nível de zoom"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
+msgid "The level of zoom of the content"
+msgstr "O nível de zoom do conteúdo"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
+msgid "Full content zoom"
+msgstr "Zoom total de conteúdo"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
+msgid "Whether the full content is scaled when zooming"
+msgstr "Se todo o conteúdo é escalado ao alterar o zoom"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
+msgid "Encoding"
+msgstr "Codificação"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
+msgid "The default encoding of the web view"
+msgstr "A codificação por omissão da vista web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
+msgid "Custom Encoding"
+msgstr "Codificação Personalizada"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
+msgid "The custom encoding of the web view"
+msgstr "A codificação personalizada da vista web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr "URI do Ícone"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "O URI do favicon para a #WebKitWebView."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "Submeter"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "Reiniciar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Este é um índice que permite procura. Digite palavras de procura:"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "Escolher Ficheiro"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(Nenhum)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "Abrir Link numa Nova _Janela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "_Transferir Ficheiro Ligado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "Copiar Loc_alização do Link"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "Abrir _Imagem em Nova Janela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "Gra_var Imagem Como"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "Cop_iar Imagem"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "Abrir _Moldura em Nova Janela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "_Reler"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+msgid "No Guesses Found"
+msgstr "Nenhum Palpite Encontrado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "_Ignorar Ortografia"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "_Aprender Ortografia"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "_Procurar na Web"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "_Verificar no Dicionário"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "_Abrir Link"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "Ignorar _Gramática"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "Ortografia e _Gramática"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "_Mostrar Ortografia e Gramática"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "_Ocultar Ortografia e Gramática"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "_Verificar Documento Agora"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "Verificar Ortografia ao _Digitar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "Verificar _Gramática com Ortografia"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "_Fonte"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "C_ontorno"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+msgid "Inspect _Element"
+msgstr "Inspeccionar _Elemento"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "Nenhuma pesquisa recente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "Pesquisas recentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "_Limpar pesquisas recentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "termo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "definição"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "pressionar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "seleccionar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "activar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "desmarcar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "marcar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "saltar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+msgid " files"
+msgstr " ficheiros"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Unknown"
+msgstr "Desconhecido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr "A Carregar..."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr "Transmissão ao Vivo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr "controlador de elemento de áudio"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr "controlador de elemento de vídeo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr "silenciar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr "ligar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr "reproduzir"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr "pausa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr "tempo de filme"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr "deslocador de linha temporal thumb"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr "para trás 30 segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr "voltar ao tempo real"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr "tempo decorrido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr "tempo restante"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+msgid "status"
+msgstr "estado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr "ecrã completo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr "avançar rápido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr "retroceder rápido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr "mostrar legendas fechadas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr "ocultar legendas fechadas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr "controlos de reprodução de elemento áudio e apresentação de estado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr "controlos de reprodução de elemento vídeo e apresentação de estado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr "silenciar faixas áudio"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr "ligar faixas áudio"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr "iniciar reprodução"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr "pausar reprodução"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr "scrubber de tempo de filme "
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr "scrubber thumb de tempo de filme "
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr "retroceder filme 30 segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr "colocar filme em fluxo para tempo real"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr "tempo actual do filme em segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr "número de segundos de filme remanescentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr "estado actual do filme"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr "retroceder rapidamente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr "avançar rapidamente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr "Reproduzir filme em modo de ecrã completo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr "começar a apresentar legendas fechadas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr "parar de apresentar legendas fechadas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+msgid "indefinite time"
+msgstr "tempo indefinido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr "valor em falta"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr "tipo não coincidente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr "padrão não coincidente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr "demasiado longo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr "underflow de intervalo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr "overflow de intervalo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "step mismatch"
+msgstr "passo não coincidente"
diff --git a/WebKit/gtk/po/pt_BR.po b/WebKit/gtk/po/pt_BR.po
index 403a53b..026bb2c 100644
--- a/WebKit/gtk/po/pt_BR.po
+++ b/WebKit/gtk/po/pt_BR.po
@@ -5,7 +5,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.4\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-04-15 21:39-0300\n"
 "Last-Translator: Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>\n"
 "Language-Team: Brazilian Portuguese\n"
@@ -68,90 +68,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Inserir caractere de controle Unicode"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Requisição de Rede"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "A requisição de rede para a URI que deve ser baixada"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Requisição de Rede"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "A requisição de rede para a URI que deve ser baixada"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "URI de Destino"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "A URI de destino, onde deve ser salvo o arquivo"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Nome de Arquivo Sugerido"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "O nome de arquivo que deve ser usado como padrão ao salvar"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Progresso"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Determina o progresso atual do download"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Estado"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Determina o estado atual do download"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Tamanho Atual"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "A quantidade de dados já baixados"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Tamanho total"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "O tamanho total do arquivo"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Usuário cancelou o download"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Usuário e senha estão sendo pedidos pelo sítio %s"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Usuário:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Senha:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Lembrar senha"
@@ -166,7 +170,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Título"
 
@@ -176,7 +180,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -307,422 +311,431 @@
 msgid "The target frame for the navigation"
 msgstr "A URI que foi requisitada como alvo para a navegação"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Codificação Padrão"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "A codificação padrão usada para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Família de Fontes Cursivas"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "A família de fontes cursivas padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Família de Fontes Padrão"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "A família de fontes padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Família de Fontes Fantasia"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "A família de fontes fantasia padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Família de Fontes Mono-espaçadas"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "A família de fontes mono-espaçadas padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Família de Fontes Sem Serifa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "A família de fontes sem serifa padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Família de Fontes Com Serifa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "A família de fontes com serifa padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Tamanho de Fonte Padrão"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "O tamanho de fonte padrão para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Tamanho de fonte mono-espaçada padrão"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "O tamanho de fonte padrão para exibir texto com fonte mono-espaçada."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Tamanho Mínimo de Fonte"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "O tamanho mínimo de fontes usadas para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Tamanho de Fonte Mínimo Lógico"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "O tamanho lógico mínimo de fontes usadas para exibir texto."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Forçar 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Força uma resolução de 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Auto-carregamento de Imagens"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Carregar imagens automaticamente."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Auto-Diminuição de Imagens"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Automaticamente diminuir imagens sozinhas para caber na tela."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Imprimir Fundos"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Se as imagens de fundo devem ser impressas."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Habilitar Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Habilitar linguagens de script embutidas."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Habilitar Plugins"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Habilitar objetos de plugins embutidos."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Áreas de Texto Redimensionáveis"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Se as áreas de texto devem ser redimensionáveis."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "URI da Folha de Estilo do Usuário"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "A URI de uma folha de estilo que é aplicada a todas as páginas."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Valor de Passo do Zoom"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "O valor da variação do zoom ao aproximar ou distanciar."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Habilitar Extas de Desenvolvimento"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Habilita extensões especiais que auxiliam desenvolvedores"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Habilitar Navegação Privativa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Habilita o modo de navegação privativa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "Verifiação _Ortográfica ao Digitar"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "Habilitar Navegação Privativa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Habilitar Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Habilitar Scripts"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Se as imagens de fundo devem ser impressas."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Habilitar análise de desempenho de JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Retorna o título da visão web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Retorna a URI do conteúdo atualmente exibido pela visão web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Lista de alvos de cópia"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
 "A lista de alvos que essa visão web suporta para cópia para área de "
 "transferência"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Lista de alvos de cola"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
 "A lista de alvos que essa visão web suporta para cola da área de "
 "transferência"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Configurações"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Uma instância de WebKitWebSettings associada"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Inspetor Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "A instância de WebKitWebInspector que está associada a essa visão"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Editável"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Se o conteúdo pode ser modificado pelo usuário"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Transparente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Se o conteúdo tem um fundo transparente"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Nível de Zoom"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "O nível de zoom do conteúdo"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Zoom Completo do Conteúdo"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Se todo o conteúdo é redimensionado no zoom"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Codificação"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "A codificação padrão da visão web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Codificação Customizada"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "A codificação customizada da visão web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -736,8 +749,8 @@
 msgstr "Limpar"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Índice de bu_sca"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1081,5 +1094,8 @@
 msgid "step mismatch"
 msgstr ""
 
+#~ msgid "_Searchable Index"
+#~ msgstr "Índice de bu_sca"
+
 #~ msgid "Select _All"
 #~ msgstr "Selecionar _Tudo"
diff --git a/WebKit/gtk/po/ru.po b/WebKit/gtk/po/ru.po
index b8038cc..248a921 100644
--- a/WebKit/gtk/po/ru.po
+++ b/WebKit/gtk/po/ru.po
@@ -2,7 +2,7 @@
 msgstr ""
 "Project-Id-Version: webkit git\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: \n"
 "Last-Translator: Anton Shestakov <engored@ya.ru>\n"
 "Language-Team: Russian\n"
@@ -69,90 +69,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "Вст_авить управляющий символ Юникод"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Сетевой запрос"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "Сетевой запрос для заданного URI, который должен быть выполнен"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Сетевой запрос"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "Сетевой запрос для заданного URI, который должен быть выполнен"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "URI назначения"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "Конечный URI для сохранения файла"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Предлагаемое имя файла"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "Имя файла, которое предлагается при загрузке по умолчанию"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Прогресс"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Текущий прогресс загрузки"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Состояние"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Текущее состояния загрузки"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Текущий размер"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "Объём уже загруженных данных"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Общий размер"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Общий размер файла"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Передача прервана пользователем"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Для сайта %s требуется ввод имени пользователя и пароля"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Имя пользователя:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Пароль:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Запомнить пароль"
@@ -167,7 +171,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Заголовок"
 
@@ -177,7 +181,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -308,419 +312,428 @@
 msgid "The target frame for the navigation"
 msgstr "URI, который был указан в запросе на переход"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Кодировка по умолчанию"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "Кодировка текста по умолчанию."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Семейство курсивного шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "Семейство курсивного шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Семейство шрифта по умолчанию"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "Семейство шрифта по умолчанию для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Семейство декоративного шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "Семейство декоративного шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Семейство моноширинного шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "Семейство моноширинного шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Семейство шрифта без засечек"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "Семейство шрифта без засечек для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Семейство шрифта с засечками"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "Семейство шрифта с засечками для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Размер шрифта по умолчанию"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "Размер шрифта по умолчанию для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Размер моноширинного шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "Размер моноширинного шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Минимальный размер шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "Минимальный размер шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Минимальный логический размер шрифта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "Минимальный логический размер шрифта для отображения текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Всегда использовать 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Принудительно использовать разрешение 96 точек на дюйм"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Загружать изображения автоматически"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Загружать изображения автоматически."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Масштабировать изображения автоматически"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Автоматически уменьшать отдельные изображения по размеру экрана."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Печатать фоновые изображения"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Должны ли быть выведены на печать фоновые изображения."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Выполнять сценарии"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Выполнять встроенные сценарии на страницах."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Использовать модули"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Разрешить встроенные объекты модулей на страницах."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Изменяемый размер текстовых полей"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Текстовые поля могут изменять размер."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "URI пользовательской таблицы стилей"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "URI таблицы стилей, которая будет применена для всех страниц."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Приращение масштаба"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "Значение, на которое будет изменяться значение масштаба."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Включить средства разработчика"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Включить особые расширения, которые могут быть полезны разработчикам"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Включить конфиденциальный режим"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Включает конфиденциальный режим просмотра"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr "Проверять орфографию"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
 msgstr "Выполнять проверку орфографии при вводе текста"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr "Языки для проверки орфографии"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 "Список языков через запятую, которые будут использоваться для проверки "
 "орфографии"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Выполнять сценарии"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Выполнять сценарии"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 #, fuzzy
 msgid "Enable page cache"
 msgstr "Проверять орфографию"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Должны ли быть выведены на печать фоновые изображения."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Включить профилирование JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Настройки"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Связанный экземпляр WebKitWebSettings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Веб-инспектор"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "Связанный экземпляр WebKitWebInspector"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Изменяемое"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Может ли содержимое быть изменено пользователем"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Прозрачное"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Имеется ли у содержимого прозрачный фон"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Масштаб"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Масштаб содержимого страницы"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Кодировка"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Особая кодировка"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -734,7 +747,7 @@
 msgstr "Сброс"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
+msgid "This is a searchable index. Enter search keywords: "
 msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
diff --git a/WebKit/gtk/po/sl.po b/WebKit/gtk/po/sl.po
new file mode 100644
index 0000000..22dcd8f
--- /dev/null
+++ b/WebKit/gtk/po/sl.po
@@ -0,0 +1,1093 @@
+# Slovenian translation of webkit.
+# Copyright (C) 2002-2007 Free Software Foundation, Inc.
+# This file is distributed under the same license as the webkit package.
+#
+# Matej Urbančič <mateju@svn.gnome.org>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit HEAD\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-14 21:30+0100\n"
+"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
+"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n"
+"X-Poedit-Country: SLOVENIA\n"
+"X-Poedit-Language: Slovenian\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+msgid "Upload File"
+msgstr "Naloži datoteko"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "_Načini vnosa"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LRM oznaka _Leva-proti-desni"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM oznaka _Desna-proti-levi"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE _Leva-proti-desni _vgradnja"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE Desna-proti-levi v_gradnja"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO Leva-proti-desni _prepis"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO Desna-proti-levi p_repis"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF _Odprto usmerjeno oblikovanje"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS Presledek _nične dolžine"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ _združevalnik nične širine"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ _razdruževalnik nične širine"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "_Vstavi nadzorni znak Unicode"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "Network Request"
+msgstr "Omrežna zahteva"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
+msgid "The network request for the URI that should be downloaded"
+msgstr "Zahteva omrežja za naslov URI, ki naj bo prejet"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+msgid "Network Response"
+msgstr "Omrežni odziv"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+msgid "The network response for the URI that should be downloaded"
+msgstr "Odgovor omrežja za naslov URI, ki naj bo prejet"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
+msgid "Destination URI"
+msgstr "Ciljni URI"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
+msgid "The destination URI where to save the file"
+msgstr "Ciljni naslov URI kamor bo shranjena datoteka"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
+msgid "Suggested Filename"
+msgstr "Predlog imena datoteke"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
+msgid "The filename suggested as default when saving"
+msgstr "Privzeto uporabljeno ime datoteke med shranjevanjem"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
+msgid "Progress"
+msgstr "Napredek"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
+msgid "Determines the current progress of the download"
+msgstr "Zazna trenutni napredek prejemanja"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
+msgid "Status"
+msgstr "Stanje"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
+msgid "Determines the current status of the download"
+msgstr "Zazna trenutno stanje prejemanja"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
+msgid "Current Size"
+msgstr "Trenutna velikost"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
+msgid "The length of the data already downloaded"
+msgstr "Količina že prejetih podatkov"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
+msgid "Total Size"
+msgstr "Skupna velikost"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
+msgid "The total size of the file"
+msgstr "Velikost datoteke"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
+msgid "User cancelled the download"
+msgstr "Uporabnik je preklical prejemanje"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Za obisk strani %s sta zahtevana uporabniško ime in geslo."
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Sporočilo strežnika:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "Uporabniško ime:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "Geslo:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+msgid "_Remember password"
+msgstr "Za_pomni si geslo"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+msgid "Name"
+msgstr "Ime"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "The name of the frame"
+msgstr "Ime okvirja"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
+msgid "Title"
+msgstr "Naslov"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+msgid "The document title of the frame"
+msgstr "Naslov dokumenta okvirja"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+msgid "The current URI of the contents displayed by the frame"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr "Obnašanje vodoravnega drsnika"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+msgid "Determines the current policy for the horizontal scrollbar of the frame."
+msgstr "Določa trenutno obnašanje vodoravnega drsnika okvirja"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr "Obnašanje navpičnega drsnika"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr "Določa trenutno obnašanje navpičnega drsnika okvirja"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "Naslov predmeta zgodovine"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "Drugotni naslov"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "Drugotni naslov predmeta zgodovine"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "Naslov URI predmeta zgodovine"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "Osnovni URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "Osnovni naslov URI predmeta zgodovine"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "Čas zadnjega obiska"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "Čas ob katerem je bil predmet zgodovine zadnjič obiskan"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "Spletni pogled"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+#, fuzzy
+msgid "Inspected URI"
+msgstr "Osnovni URI"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "Omogoči profiliranje JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "Profiliraj izveden JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+msgid "Enable Timeline profiling"
+msgstr "Omogoči profiliranje časovnice"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+#, fuzzy
+msgid "Profile the WebCore instrumentation."
+msgstr "Ime profila vstavkov"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "Vzrok"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "Vzrok, zakaj se krmarjenje pojavlja"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+#, fuzzy
+msgid "The URI that was requested as the target for the navigation"
+msgstr "Naslov URI zahtevan za ciljno mesto"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "Gumb"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "Gumb uporabljen za klik"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "Stanje spremenilnika"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+msgid "Target frame"
+msgstr "Ciljni okvir"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+#, fuzzy
+msgid "The target frame for the navigation"
+msgstr "Osnovni URL ciljnega okvirja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
+msgid "Default Encoding"
+msgstr "Privzet nabor znakov"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
+msgid "The default encoding used to display text."
+msgstr "Pisava nabor znakov za prikazovanje besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
+msgid "Cursive Font Family"
+msgstr "Družina pisave Cursive"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
+msgid "The default Cursive font family used to display text."
+msgstr "Privzeta družina pisave Cursive za prikaz besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
+msgid "Default Font Family"
+msgstr "Privzeta družina pisave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
+msgid "The default font family used to display text."
+msgstr "Privzeta družina pisave za prikaz besedila"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
+msgid "Fantasy Font Family"
+msgstr "Družina pisave Fantasy"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
+msgid "The default Fantasy font family used to display text."
+msgstr "Privzeta družina pisave Fantasy za prikaz besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
+msgid "Monospace Font Family"
+msgstr "Družina pisave Monospace"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
+msgid "The default font family used to display monospace text."
+msgstr "Privzeta družina pisave za prikaz monospace besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
+msgid "Sans Serif Font Family"
+msgstr "Družina pisave Sans Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
+msgid "The default Sans Serif font family used to display text."
+msgstr "Privzeta družina pisave San Serif za prikaz besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
+msgid "Serif Font Family"
+msgstr "Družina pisave Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
+msgid "The default Serif font family used to display text."
+msgstr "Privzeta družina pisave Serif za prikaz besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
+msgid "Default Font Size"
+msgstr "Privzeta velikost pisave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "The default font size used to display text."
+msgstr "Privzeta velikost pisave za prikaz besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
+msgid "Default Monospace Font Size"
+msgstr "Privzeta velikost pisave Monospace"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
+msgid "The default font size used to display monospace text."
+msgstr "Privzeta velikost pisave za prikaz monospace besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "Minimum Font Size"
+msgstr "Najmanjša velikost pisave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
+msgid "The minimum font size used to display text."
+msgstr "Najmanjša velikost pisave uporabljena za prikazovanje besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
+msgid "Minimum Logical Font Size"
+msgstr "Najmanjša logična velikost pisave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
+msgid "The minimum logical font size used to display text."
+msgstr "Najmanjša logična velikost pisave za prikazovanje besedila."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
+msgid "Enforce 96 DPI"
+msgstr "Vsili 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Vsili ločljivost 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
+msgid "Auto Load Images"
+msgstr "Samodejno naloži slike"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Load images automatically."
+msgstr "Samodejno nalaganje slik."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
+msgid "Auto Shrink Images"
+msgstr "Samodejno skrči velikost okna"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
+msgid "Automatically shrink standalone images to fit."
+msgstr "Samodejno skrči samostojne slike na širino okna."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
+msgid "Print Backgrounds"
+msgstr "Natisni _ozadja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
+msgid "Whether background images should be printed."
+msgstr "Ali naj bo mogoče slike ozadja natisniti"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
+msgid "Enable Scripts"
+msgstr "Omogoči skripte"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
+msgid "Enable embedded scripting languages."
+msgstr "Omogoči izvajanje skript skriptnih jezikov"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
+msgid "Enable Plugins"
+msgstr "Omogoči vstavke"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
+msgid "Enable embedded plugin objects."
+msgstr "Omogoči predmete vstavkov"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
+msgid "Resizable Text Areas"
+msgstr "Prilagodljiva besedilna območja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
+msgid "Whether text areas are resizable."
+msgstr "Ali je mogoče besedilna polja prilagajati po velikosti."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
+msgid "User Stylesheet URI"
+msgstr "Naslov URI uporabniške slogovne predloge"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
+msgid "Zoom Stepping Value"
+msgstr "Vrednost koraka približevanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr "Vrednost, ki določa raven približevanja med približevanjem ali oddaljevanjem slike."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
+msgid "Enable Developer Extras"
+msgstr "Omogoči dodatna razvojna orodja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
+msgid "Enables special extensions that help developers"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
+msgid "Enable Private Browsing"
+msgstr "Omogoči zasebno brskanje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
+msgid "Enables private browsing mode"
+msgstr "Omogoči način varnega zasebnega brskanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr "Omogoči črkovanje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+msgid "Enables spell checking while typing"
+msgstr "Omogoči preverjanje črkovanja med tipkanjem"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr "Izbor jezika za preverjanje črkovanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr "Z vejico ločen seznam jezikov za črkovanje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+msgid "Enable Caret Browsing"
+msgstr "Omogoči brskanje s kazalko"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr "Omogoči HTML5 podatkovno zbirko"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr "Ali naj se omogoči podpora HTML podatkovne zbirke"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr "Omogoči hTML5 krajevno shranjevanje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Ali naj se omogoči podpora HTML krajevnega shranjevanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+msgid "Enable XSS Auditor"
+msgstr "Omogoči XSS Auditor"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr "Ali naj se omogoči XSS auditor"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr "Uporabniški agent"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "Niz uporabniškega agenta, ki ga uporablja WebKitGtk"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript program lahko samodejno odpre okno"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Ali je mogoče z JavaScript programom samodejno odpreti okno"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr "Omogoči predpomnilnik za brskanje vsebine brez povezave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr "Ali naj bo omogočen predpomnilnik programa za brskanje brez povezave"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr "Obnašanje urejanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr "Način obnašanja uporabljen v načinu urejanja"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr "Ali je dovoljen splošen dostop preko naslova URI datoteke"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+msgid "Enable DOM paste"
+msgstr "Omogoči DOM prilepljenje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr "Ali naj bo omogočeno DOM prilepljenje"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr "Tipka tab kroži med predmeti"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr "Ali tipka tab kroži med predmeti na strani."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr "Omogoči privzeti vsebinski meni"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid "Enables the handling of right-clicks for the creation of the default context menu"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+#, fuzzy
+msgid "Enable Site Specific Quirks"
+msgstr "Poganjanje posebnega ukaza za spletišče"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr "Omogoči predpomnilnik strani"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+msgid "Whether the page cache should be used"
+msgstr "Ali naj bo uporabljen predpomnilnik strani"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr "Samodejno prilagodi velikost okna"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr "Samodejno prilagodi velikost vrhnjega okna, kadar to zahteva stran"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Omogoči Java aplet"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Ali je omogočena podpora za Java aplete preko oznake <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
+msgid "Returns the @web_view's document title"
+msgstr "Vrne @web_pogled naslov dokumenta"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Vrne trenutni naslov URI vsebine prikazane preko @web_pogleda"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
+msgid "Copy target list"
+msgstr "Kopiraj seznam ciljev"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
+#, fuzzy
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr "Seznam ciljev katerih medpomnilnik podpira možnost kopiraj v odložišče in DND vire."
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
+msgid "Paste target list"
+msgstr "Prilepi seznam ciljev"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
+#, fuzzy
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr "Seznam ciljev katerih medpomnilnik podpira možnost prilepi v odložišče in DND cilje."
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
+msgid "Settings"
+msgstr "Nastavitve"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
+msgid "An associated WebKitWebSettings instance"
+msgstr "Povezan primerek WebKitWebSettings"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
+msgid "Web Inspector"
+msgstr "Spletni nadzornik"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
+msgid "The associated WebKitWebInspector instance"
+msgstr "Povezan primerek WebKitWebInspector"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
+msgid "Editable"
+msgstr "Uredljivo"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
+msgid "Whether content can be modified by the user"
+msgstr "Ali lahko uporabnik spremeni vsebino"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
+msgid "Transparent"
+msgstr "Prozorno"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
+msgid "Whether content has a transparent background"
+msgstr "Ali ima vsebina prozorno ozadje"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
+msgid "Zoom level"
+msgstr "Raven približanja"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
+msgid "The level of zoom of the content"
+msgstr "Raven približanja vsebine"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
+msgid "Full content zoom"
+msgstr "Polno približanje vsebine"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
+msgid "Whether the full content is scaled when zooming"
+msgstr "Ali naj bo celotna vsebina prilagojena velikosti ob približevanju"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
+msgid "Encoding"
+msgstr "Nabor znakov"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
+msgid "The default encoding of the web view"
+msgstr "Privzeti nabor znakov spletnega pogleda"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
+msgid "Custom Encoding"
+msgstr "Nabor znakov po meri"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
+msgid "The custom encoding of the web view"
+msgstr "Nabor znakov spletnega pogleda po meri"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr "Ikona URI"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+#, fuzzy
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "Zaznamek za URI '%s' že obstaja"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "Pošlji"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "Ponovno nastavi"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Po kazalu je mogoče iskati. Vnesite ključne besede:"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "Izbor datoteke"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(Brez)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "Odpri povezavo v _novem oknu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "_Prejmi povezano datoteko"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "Kopiraj mesto _povezave"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "Odpri _sliko v novem oknu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "S_hrani sliko kot"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "_Kopiraj sliko"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "Odpri okvir v _novem oknu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "_Ponovno naloži"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+#, fuzzy
+msgid "No Guesses Found"
+msgstr "Ni najdenih predmetov"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "_Prezri črkovanje"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "_Zapomni si črkovanje"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "_Preišči splet"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "_Poišči besede v slovarju"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "_Odpri povezavo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "Prezri _slovnico"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "Črkovanje in _slovnica"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "_Pokaži črkovanje in slovnico"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "_Skrij črkovanje in slovnico"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "_Takoj preveri dokument"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "Preveri _črkovanja med tipkanjem"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "Preveri _slovnico med tipkanjem"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "_Pisava"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "_Oris"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+#, fuzzy
+msgid "Inspect _Element"
+msgstr "Preuči _predmet"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "Ni nedavnih nizov iskanja"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "_Nedavno iskanje"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "_Počisti nedavno iskanje"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "pojem"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "določilo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "pritisni"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "izberi"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "omogoči"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "odstrani izbor"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "preveri"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "skoči"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+msgid " files"
+msgstr "datoteke"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Unknown"
+msgstr "Neznano"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr "Nalaganje ..."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr "Oddajanje v živo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr "nadzornik zvočnega predmeta"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr "nadzornik slikovnega predmeta"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr "nemo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr "povrni glasnost"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr "predvajaj"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr "premor"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr "čas filma"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr "sličica časovnega drsnika"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr "nazaj 30 sekund"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr "vrni se na pravi čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr "pretečeni čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr "preostali čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+msgid "status"
+msgstr "stanje"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr "celozaslonski način"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr "hitro naprej"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr "hitro nazaj"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr "pokaži zaprte naslove"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr "skrij zaprte naslove"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr "prikaz stanja in nadzora predvajanja zvočnih predmetov"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr "prikaz stanja in nadzora predvajanja slikovnih predmetov"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr "neme zvočne sledi"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr "povrnjena glasnost zvočnih sledi"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr "začetek predvajanja"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr "premor predvajanja"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr "časovni drsnik posnetka"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr "sličica časovnega drsnika posnetka"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr "preskoči posnetek 30 sekund nazaj"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr "vrni pretok predvajanja na pravi čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr "trenuten čas predvajanja v sekundah"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr "preostali čas filmaštevilo sekund preden se časomer ustavi"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr "trenutno stanje filma"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr "hitro išči nazaj"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr "hitro išči naprej"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr "Predvajanje filma v celozaslonskem načinu"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr "začni prikazovanje zaprtih naslovov"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr "zaustavi prikazovanje zaprtih naslovov"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+msgid "indefinite time"
+msgstr "nedoločen čas"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr "manjka vrednost"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr "vrsta ne ustreza"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr "vzorec ne ustreza"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr "predolgo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr "pod območjem omejitve"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr "prekoračitev območja"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "step mismatch"
+msgstr "korak ne ustreza"
+
+#, fuzzy
+#~ msgid "_Searchable Index"
+#~ msgstr "Povrni določila"
+
diff --git a/WebKit/gtk/po/sr.po b/WebKit/gtk/po/sr.po
index 9cd8267..b4d3d55 100644
--- a/WebKit/gtk/po/sr.po
+++ b/WebKit/gtk/po/sr.po
@@ -9,7 +9,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.10\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-06-19 02:35+100\n"
 "Last-Translator: Милош Поповић <gpopac@gmail.com>\n"
 "Language-Team: Serbian <gnom@prevod.org>\n"
@@ -75,90 +75,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Уметни уникод контролни знак"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Захтев на мрежи"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "Захтевана адресе датотеке коју желите да преузмете"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Захтев на мрежи"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "Захтевана адресе датотеке коју желите да преузмете"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "Циљна адреса"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "Циљна адреса где желите да сачувате датотеку"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Предложено име датотеке"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "Подразумевано име датотеке приликом чувања"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Преузето"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Показује тренутни напредак преузимања"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Стање"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Показује тренутно стање преузимања"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Величина"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "Приказује величину преузете датотеке"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Укупна величина"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Приказује укупну величину преузете датотеке"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Прекинута преузимања"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Страница %s захтева корисничко име и лозинку"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Корисничко име:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Лозинка:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Упамти лозинку"
@@ -173,7 +177,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Наслов"
 
@@ -183,7 +187,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "Адреса"
 
@@ -318,419 +322,428 @@
 msgid "The target frame for the navigation"
 msgstr "Циљна адреса коју захтева навигација"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Подразумевано кодирање"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "Подразумевано кодирање за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Скуп искошених фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "Подразумевани скуп искошених фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Подразумевани скуп фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "Подразумевани скуп фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Скуп фантази фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "Подразумевани скуп фантази фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Скуп равномерних фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "Подразумевани скуп равномерно широких фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Скуп безсерифних фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "Подразумевани скуп безсерифних фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Скуп серифних фонтова"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "Подразумевани скуп серифних фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Подразумевана величина фонта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "Подразумевана величина фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Подразумевана величина разномерног фонта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "Подразумевана величина равномерно широких фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Најмања величина фонта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "Најмања величина фонта за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Најмања логичка величина фонта"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "Најмања логичка величина фонтова за приказ текста."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Приморај 96 ТПИ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Приморава резолуцију од 96 ТПИ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Сам учитај слике"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Аутоматски учитава слике."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Сам смањи слике"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Аутоматску умањује слике тако да се уклопиле у страну."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Исцртај позадину"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Одређује да ли да се приказују позадинске слике."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Омогући скрипте"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Укључује језике за скрипте уметнуте унутар страница."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Омогући додатке"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Укључује објекте уметнуте унутар страница."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Текст променљиве величине"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Одређује да ли да област са текстом буде променљиве величине."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "Адреса датотеке са стилом"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr ""
 "Путања до датотеке са сопственим стилом који се примењује на сваку страницу."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Корак увећања"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "Вредност за коју се мења приказ приликом повећања или смањења."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Укључи додатке за развој"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Укључује додатке који помажу приликом развоја овог програма"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Приватни режим"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Укључује режим разгледања уз чување ваше приватности"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "Провери писање _док куцам"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "Приватни режим"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Омогући скрипте"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Омогући скрипте"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Одређује да ли да се приказују позадинске слике."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Омогући учење Јава скрипте"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Исписује наслов документа из @веб_прегледа"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Исписује тренутну адресу садржаја приказаног у @веб_прегледу"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Умножи списак циљева"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "Циљева за копирање међу списак исечака које подржава веб преглед"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Убаци списак циљева"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "Списак циљева за убацивање из оставе које подржава веб преглед"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Подешавања"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Повезано са WebKitWebSettings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Веб инспектор"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "Повезано са WebKitWebSettings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Измењиво"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Омогућава кориснику да уређује приказани садржај"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Провидност"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Омогућава провидну позадину за садржај"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Увећање"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Ниво увећања приказаног садржаја"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Увећавај све"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Одређује да ли да се увећава целокупан садржај"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Кодирање"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "Подразумевано кодирање веб странице"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Произвољно кодирање"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "Произвољно кодирање веб странице"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -744,8 +757,8 @@
 msgstr "Поништи"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "_Претражив индекс"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1089,3 +1102,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "_Претражив индекс"
diff --git a/WebKit/gtk/po/sr@latin.po b/WebKit/gtk/po/sr@latin.po
index c52ab3f..d6a795a 100644
--- a/WebKit/gtk/po/sr@latin.po
+++ b/WebKit/gtk/po/sr@latin.po
@@ -9,7 +9,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.10\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-06-19 02:35+100\n"
 "Last-Translator: Miloš Popović <gpopac@gmail.com>\n"
 "Language-Team: Serbian <gnom@prevod.org>\n"
@@ -75,90 +75,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Umetni unikod kontrolni znak"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Zahtev na mreži"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "Zahtevana adrese datoteke koju želite da preuzmete"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Zahtev na mreži"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "Zahtevana adrese datoteke koju želite da preuzmete"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "Ciljna adresa"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "Ciljna adresa gde želite da sačuvate datoteku"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Predloženo ime datoteke"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "Podrazumevano ime datoteke prilikom čuvanja"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Preuzeto"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Pokazuje trenutni napredak preuzimanja"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Stanje"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Pokazuje trenutno stanje preuzimanja"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Veličina"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "Prikazuje veličinu preuzete datoteke"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Ukupna veličina"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Prikazuje ukupnu veličinu preuzete datoteke"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Prekinuta preuzimanja"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Stranica %s zahteva korisničko ime i lozinku"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Korisničko ime:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Lozinka:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Upamti lozinku"
@@ -173,7 +177,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Naslov"
 
@@ -183,7 +187,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "Adresa"
 
@@ -318,420 +322,429 @@
 msgid "The target frame for the navigation"
 msgstr "Ciljna adresa koju zahteva navigacija"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Podrazumevano kodiranje"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "Podrazumevano kodiranje za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Skup iskošenih fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "Podrazumevani skup iskošenih fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Podrazumevani skup fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "Podrazumevani skup fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Skup fantazi fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "Podrazumevani skup fantazi fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Skup ravnomernih fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "Podrazumevani skup ravnomerno širokih fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Skup bezserifnih fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "Podrazumevani skup bezserifnih fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Skup serifnih fontova"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "Podrazumevani skup serifnih fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Podrazumevana veličina fonta"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "Podrazumevana veličina fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Podrazumevana veličina raznomernog fonta"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "Podrazumevana veličina ravnomerno širokih fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Najmanja veličina fonta"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "Najmanja veličina fonta za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Najmanja logička veličina fonta"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "Najmanja logička veličina fontova za prikaz teksta."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Primoraj 96 TPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Primorava rezoluciju od 96 TPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Sam učitaj slike"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Automatski učitava slike."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Sam smanji slike"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Automatsku umanjuje slike tako da se uklopile u stranu."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Iscrtaj pozadinu"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Određuje da li da se prikazuju pozadinske slike."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Omogući skripte"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Uključuje jezike za skripte umetnute unutar stranica."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Omogući dodatke"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Uključuje objekte umetnute unutar stranica."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Tekst promenljive veličine"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Određuje da li da oblast sa tekstom bude promenljive veličine."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "Adresa datoteke sa stilom"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr ""
 "Putanja do datoteke sa sopstvenim stilom koji se primenjuje na svaku "
 "stranicu."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Korak uvećanja"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "Vrednost za koju se menja prikaz prilikom povećanja ili smanjenja."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Uključi dodatke za razvoj"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Uključuje dodatke koji pomažu prilikom razvoja ovog programa"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Privatni režim"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Uključuje režim razgledanja uz čuvanje vaše privatnosti"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "Proveri pisanje _dok kucam"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "Privatni režim"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Omogući skripte"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Omogući skripte"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Određuje da li da se prikazuju pozadinske slike."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Omogući učenje Java skripte"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Ispisuje naslov dokumenta iz @veb_pregleda"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Ispisuje trenutnu adresu sadržaja prikazanog u @veb_pregledu"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Umnoži spisak ciljeva"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "Ciljeva za kopiranje među spisak isečaka koje podržava veb pregled"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Ubaci spisak ciljeva"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "Spisak ciljeva za ubacivanje iz ostave koje podržava veb pregled"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Podešavanja"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Povezano sa WebKitWebSettings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Veb inspektor"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "Povezano sa WebKitWebSettings"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Izmenjivo"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Omogućava korisniku da uređuje prikazani sadržaj"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Providnost"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Omogućava providnu pozadinu za sadržaj"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Uvećanje"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Nivo uvećanja prikazanog sadržaja"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Uvećavaj sve"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Određuje da li da se uvećava celokupan sadržaj"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Kodiranje"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "Podrazumevano kodiranje veb stranice"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Proizvoljno kodiranje"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "Proizvoljno kodiranje veb stranice"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -745,8 +758,8 @@
 msgstr "Poništi"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "_Pretraživ indeks"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1090,3 +1103,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "_Pretraživ indeks"
diff --git a/WebKit/gtk/po/sv.po b/WebKit/gtk/po/sv.po
index c9e202b..d8f7e34 100644
--- a/WebKit/gtk/po/sv.po
+++ b/WebKit/gtk/po/sv.po
@@ -1,13 +1,13 @@
 # Swedish translation for webkitgtk+.
 # This file is put in the public domain.
-# Daniel Nylander <po@danielnylander.se>, 2009.
+# Daniel Nylander <po@danielnylander.se>, 2009, 2010.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: webkitgtk+\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-04-30 12:26+0100\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-02-21 10:35+0100\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "MIME-Version: 1.0\n"
@@ -25,132 +25,137 @@
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
 msgid "LRM _Left-to-right mark"
-msgstr ""
+msgstr "LRM _Left-to-right mark"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
 msgid "RLM _Right-to-left mark"
-msgstr ""
+msgstr "RLM _Right-to-left mark"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
 msgid "LRE Left-to-right _embedding"
-msgstr ""
+msgstr "LRE Left-to-right _embedding"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
 msgid "RLE Right-to-left e_mbedding"
-msgstr ""
+msgstr "RLE Right-to-left e_mbedding"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
 msgid "LRO Left-to-right _override"
-msgstr ""
+msgstr "LRO Left-to-right _override"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
 msgid "RLO Right-to-left o_verride"
-msgstr ""
+msgstr "RLO Right-to-left o_verride"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
 msgid "PDF _Pop directional formatting"
-msgstr ""
+msgstr "PDF _Pop directional formatting"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
 msgid "ZWS _Zero width space"
-msgstr ""
+msgstr "ZWS _Zero width space"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
 msgid "ZWJ Zero width _joiner"
-msgstr ""
+msgstr "ZWJ Zero width _joiner"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
 msgid "ZWNJ Zero width _non-joiner"
-msgstr ""
+msgstr "ZWNJ Zero width _non-joiner"
 
 #: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
 msgid "_Insert Unicode Control Character"
-msgstr ""
+msgstr "_Infoga Unicode-styrtecken"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Nätverksbegäran"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
-msgstr ""
+msgstr "Nätverksbegäran för URI:n som ska hämtas"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "Nätverksbegäran"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+#, fuzzy
 msgid "The network response for the URI that should be downloaded"
-msgstr ""
+msgstr "Nätverksbegäran för URI:n som ska hämtas"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
-msgstr ""
+msgstr "Destinations-URI"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
-msgstr ""
+msgstr "Destinations-URI där sparning ska ske av filen"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Föreslaget filnamn"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
-msgstr ""
+msgstr "Föreslaget filnamn som standard vid sparning"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Förlopp"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Fastställer aktuellt förlopp för hämtningen"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Status"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Fastställer aktuell status för hämtningen"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Aktuell storlek"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
-msgstr ""
+msgstr "Längden för det data som redan hämtats"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Total storlek"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Totala storleken för filen"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Användaren avbröt hämtningen"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Ett användarnamn och lösenord begärs av platsen %s"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Användarnamn:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Lösenord:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "Kom ihåg lösenordet"
@@ -165,7 +170,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Titel"
 
@@ -175,13 +180,13 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:313
 msgid "The current URI of the contents displayed by the frame"
-msgstr ""
+msgstr "Aktuella URI:n för innehållet som visas av ramen"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
@@ -204,7 +209,7 @@
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
-msgstr ""
+msgstr "Titeln för historikobjektet"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
 msgid "Alternate Title"
@@ -212,20 +217,20 @@
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
 msgid "The alternate title of the history item"
-msgstr ""
+msgstr "Alternativ titel för historikobjektet"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
 msgid "The URI of the history item"
-msgstr ""
+msgstr "URI:n för historikobjektet"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
 msgid "Original URI"
-msgstr ""
+msgstr "Ursprunglig URI"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
 msgid "The original URI of the history item"
-msgstr ""
+msgstr "Ursprungliga URI:n för historikobjektet"
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
 msgid "Last visited Time"
@@ -233,36 +238,36 @@
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
 msgid "The time at which the history item was last visited"
-msgstr ""
+msgstr "Tiden för vilket historikobjektet senast besöktes"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:268
 msgid "Web View"
-msgstr ""
+msgstr "Webbvy"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:269
 msgid "The Web View that renders the Web Inspector itself"
-msgstr ""
+msgstr "Webbvyn som renderar själva Webbinspektören"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:282
 msgid "Inspected URI"
-msgstr ""
+msgstr "Inspekterad URI"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:283
 msgid "The URI that is currently being inspected"
-msgstr ""
+msgstr "URI:n som för närvarande inspekteras"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:299
 msgid "Enable JavaScript profiling"
-msgstr ""
+msgstr "Aktivera JavaScript-profilering"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:300
 msgid "Profile the executed JavaScript."
-msgstr ""
+msgstr "Profilera det körda JavaScript."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
 #, fuzzy
 msgid "Enable Timeline profiling"
-msgstr "Aktivera privat surfning"
+msgstr "Aktivera JavaScript-profilering"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
@@ -274,11 +279,11 @@
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
 msgid "The reason why this navigation is occurring"
-msgstr ""
+msgstr "Anledningen varför denna navigering sker"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
 msgid "The URI that was requested as the target for the navigation"
-msgstr ""
+msgstr "URI:n som begärdes som mål för navigeringen"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
 msgid "Button"
@@ -286,15 +291,15 @@
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
 msgid "The button used to click"
-msgstr ""
+msgstr "Knappen som användes för att klicka"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
 msgid "Modifier state"
-msgstr ""
+msgstr "Modifierartillstånd"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
 msgid "A bitmask representing the state of the modifier keys"
-msgstr ""
+msgstr "En bitmask som representerar tillståndet för modifierartangenterna"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
 #, fuzzy
@@ -302,426 +307,438 @@
 msgstr "Namnet på ramen"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+#, fuzzy
 msgid "The target frame for the navigation"
-msgstr ""
+msgstr "URI:n som begärdes som mål för navigeringen"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Standardteckenkodning"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "Standardkodningen som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Typsnittsfamiljen Cursive"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "Standardfamiljen för Cursive-typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Standardfamilj för typsnitt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "Standardfamiljen för typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Typsnittsfamiljen Fantasy"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "Standardfamiljen för Fantasy-typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Typsnittsfamiljen Monospace"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr ""
 "Standardfamiljen för typsnitt som används för att visa text med fast "
 "breddsteg."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Typsnittsfamiljen Sans Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr ""
 "Standardfamiljen för Sans Serif-typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Typsnittsfamiljen Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "Standardfamiljen för Serif-typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Standardstorlek för typsnitt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "Standardstorleken för typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Standardstorlek för Monospace-typsnitt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr ""
 "Standardstorleken för typsnitt som används för att visa text med fast "
 "breddsteg."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Minimumstorlek för typsnitt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "Minimumstorlek för typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Logisk minimumstorlek för typsnitt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "Logisk minimumstorlek för typsnitt som används för att visa text."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Tvinga 96 punkter/tum"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Tvinga en upplösning på 96 punkter/tum"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Läs automatiskt in bilder"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Läs in bilder automatiskt."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
-msgstr ""
+msgstr "Minska bilder automatiskt"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
-msgstr ""
+msgstr "Minska automatiskt fristående bilder till att passa."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "Skriv ut bakgrunder"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Huruvida bakgrundsbilder ska skrivas ut."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "Aktivera skript"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "Aktivera inbäddade skriptspråk."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Aktivera insticksmoduler"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Aktivera inbäddade insticksobjekt."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
-msgstr ""
+msgstr "Storleksändringsbara textområden "
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
-msgstr ""
+msgstr "Huruvida textområden kan storleksändras."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
-msgstr ""
+msgstr "URI för användarstilmall"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
-msgstr ""
+msgstr "URI:n för en stilmall som tillämpas på varje sida."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
-msgstr ""
+msgstr "Stegvärde för zoom"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
-msgstr ""
+msgstr "Värdet med vilket zoomnivå ändras vid in- eller utzoomning."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
-msgstr ""
+msgstr "Aktivera extrafunktioner för utvecklare"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
-msgstr ""
+msgstr "Aktiverar speciella tillägg som hjälper utvecklarna"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Aktivera privat surfning"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Aktiverar läget för privat surfning"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "Kontrollera stavning vid _inmatning"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "Aktivera privat surfning"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "Aktivera skript"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "Aktivera skript"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "Huruvida bakgrundsbilder ska skrivas ut."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "Aktivera JavaScript-profilering"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
-msgstr ""
+msgstr "Returnerar dokumenttiteln för @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
-msgstr ""
+msgstr "Returnerar den aktuella URI:a för innehållet som visas av @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Kopiera mållista"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
+"Listan över mål som denna webbvy har stöd för vid kopiering till urklipp"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
-msgstr ""
+msgstr "Klistra in mållista"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
+"Listan över mål som denna webbvy har stöd för vid inklistring från urklipp"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Inställningar"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
-msgstr ""
+msgstr "En associerad WebKitWebSettings-instans"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
-msgstr ""
+msgstr "Webbinspektör"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
-msgstr ""
+msgstr "Den associerade WebKitWebInspector-instansen"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Redigeringsbar"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
-msgstr ""
+msgstr "Huruvida innehållet kan ändras av användaren"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Genomskinlig"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Huruvida innehållet har en genomskinlig bakgrund"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Zoomnivå"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Zoomnivån för innehållet"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
-msgstr ""
+msgstr "Fullständig innehållszoom"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
-msgstr ""
+msgstr "Huruvida hela innehållet skalas vid zoomning"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Teckenkodning"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
-msgstr ""
+msgstr "Standardkodning för webbvyn"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Anpassad teckenkodning"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
-msgstr ""
+msgstr "Anpassad kodning för webbvyn"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -735,8 +752,8 @@
 msgstr "Återställ"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "_Sökbart index"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -840,7 +857,7 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
 msgid "Inspect _Element"
-msgstr ""
+msgstr "Inspektera _element"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
 msgid "No recent searches"
@@ -1079,3 +1096,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "_Sökbart index"
diff --git a/WebKit/gtk/po/uk.po b/WebKit/gtk/po/uk.po
new file mode 100644
index 0000000..46f12be
--- /dev/null
+++ b/WebKit/gtk/po/uk.po
@@ -0,0 +1,1108 @@
+# This file is put in the public domain.
+#
+# Yuri Chornoivan <yurchor@ukr.net>, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit 1.1.22\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-03-24 20:05-0300\n"
+"PO-Revision-Date: 2010-03-19 19:27+0200\n"
+"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
+"Language-Team: Ukrainian <translation@linux.org.ua>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.0\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
+"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:531
+msgid "Upload File"
+msgstr "Вивантажити файл"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "_Способи введення"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "LRM позначка з_ліва направо"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "RLM позначка с_права наліво"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "LRE вс_тавка зліва направо"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "RLE вст_авка справа ліворуч"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "LRO п_ерезапис зліва праворуч"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "RLO пе_резапис справа ліворуч"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "PDF _Вертикальне розташування"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "ZWS Про_біл нульової ширини"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "ZWJ _Об’єднувач нульової ширини"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "ZWNJ _Роз’єднувач нульової ширини"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "В_ставити керівний символ Unicode"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:270
+msgid "Network Request"
+msgstr "Запит до мережі"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:271
+msgid "The network request for the URI that should be downloaded"
+msgstr "Запит до мережі щодо адреси URI, вміст за якою слід звантажити"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:285
+msgid "Network Response"
+msgstr "Відповідь мережі"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:286
+msgid "The network response for the URI that should be downloaded"
+msgstr "Відповідь мережі щодо адреси URI, вміст за якою слід звантажити"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:300
+msgid "Destination URI"
+msgstr "Адреса URI призначення"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:301
+msgid "The destination URI where to save the file"
+msgstr "Адреса URI призначення, за якою слід зберегти файл"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:315
+msgid "Suggested Filename"
+msgstr "Пропозиція щодо назви"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:316
+msgid "The filename suggested as default when saving"
+msgstr "Типова назва, яку програма пропонуватиме під час збереження"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:333
+msgid "Progress"
+msgstr "Поступ"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:334
+msgid "Determines the current progress of the download"
+msgstr "Визначає поточний поступ звантаження"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:347
+msgid "Status"
+msgstr "Стан"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:348
+msgid "Determines the current status of the download"
+msgstr "Визначає поточний стан звантаження"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:363
+msgid "Current Size"
+msgstr "Поточний розмір"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:364
+msgid "The length of the data already downloaded"
+msgstr "Об’єм вже звантажених даних"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:378
+msgid "Total Size"
+msgstr "Загальний розмір"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:379
+msgid "The total size of the file"
+msgstr "Загальний об’єм даних файла"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:530
+msgid "User cancelled the download"
+msgstr "Звантаження скасовано користувачем"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "Надійшов запит від сайта %s щодо імені користувача і пароля"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Повідомлення сервера:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "Користувач:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "Пароль:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+msgid "_Remember password"
+msgstr "_Запам’ятати пароль"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "Name"
+msgstr "Назва"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:300
+msgid "The name of the frame"
+msgstr "Назва фрейма"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2443
+msgid "Title"
+msgstr "Заголовок"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:307
+msgid "The document title of the frame"
+msgstr "Заголовок документа фрейма"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2457
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:314
+msgid "The current URI of the contents displayed by the frame"
+msgstr "Поточна адреса URI даних, показаних у фреймі"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+msgid "Horizontal Scrollbar Policy"
+msgstr "Правила горизонтальної смужки гортання"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:346
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr ""
+"Визначає поточні правила створення горизонтальної смужки гортання у фреймі."
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+msgid "Vertical Scrollbar Policy"
+msgstr "Правила вертикальної смужки гортання"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:364
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr ""
+"Визначає поточні правила створення вертикальної смужки гортання у фреймі."
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "Заголовок запису журналу"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "Альтернативний заголовок"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "Альтернативний заголовок запису журналу"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "Адреса URI запису журналу"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "Початкова адреса URI"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "Початкова адреса URI запису журналу"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "Час останнього відвідування"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "Час, коли ви востаннє відвідували запис журналу"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "Веб-панель"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "Веб-панель, на якій показано дані веб-інспектора"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+msgid "Inspected URI"
+msgstr "Адреса URI, що перевіряється"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr "Адреса URI, яку перевіряють"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "Увімкнути профілювання JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "Створити профіль виконаного JavaScript."
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+msgid "Enable Timeline profiling"
+msgstr "Увімкнути профілювання Timeline"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr "Профілювати інструментарій WebCore."
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "Підстава"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "Підстава цього переходу"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+msgid "The URI that was requested as the target for the navigation"
+msgstr "Адреса URI, на яку надійшов запит, як на адресу переходу"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "Кнопка"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "Кнопка для натискання"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "Стан модифікаторів"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "Бітова маска, що відповідає стану натискання клавіш-модифікаторів"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+msgid "Target frame"
+msgstr "Фрейм призначення"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+msgid "The target frame for the navigation"
+msgstr "Фрейм призначення під час переходу"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:239
+msgid "Default Encoding"
+msgstr "Типове кодування"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:240
+msgid "The default encoding used to display text."
+msgstr "Типове кодування для показу тексту."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:248
+msgid "Cursive Font Family"
+msgstr "Гарнітура курсивного шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:249
+msgid "The default Cursive font family used to display text."
+msgstr "Типова гарнітура курсивного шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:257
+msgid "Default Font Family"
+msgstr "Типова гарнітура шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:258
+msgid "The default font family used to display text."
+msgstr "Типова гарнітура шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:266
+msgid "Fantasy Font Family"
+msgstr "Гарнітура декоративного шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:267
+msgid "The default Fantasy font family used to display text."
+msgstr "Типова гарнітура декоративного шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:275
+msgid "Monospace Font Family"
+msgstr "Гарнітура моноширинного шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:276
+msgid "The default font family used to display monospace text."
+msgstr "Типова гарнітура шрифту для показу моноширинних текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:284
+msgid "Sans Serif Font Family"
+msgstr "Гарнітура шрифту без засічок"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:285
+msgid "The default Sans Serif font family used to display text."
+msgstr "Типова гарнітура без засічок шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:293
+msgid "Serif Font Family"
+msgstr "Гарнітура шрифту з засічками"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:294
+msgid "The default Serif font family used to display text."
+msgstr "Типова гарнітура шрифту з засічками для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:302
+msgid "Default Font Size"
+msgstr "Типовий розмір шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:303
+msgid "The default font size used to display text."
+msgstr "Типовий розмір символів шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:311
+msgid "Default Monospace Font Size"
+msgstr "Типовий розмір моноширинного шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:312
+msgid "The default font size used to display monospace text."
+msgstr ""
+"Типовий розмір символів шрифту для показу моноширинних текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:320
+msgid "Minimum Font Size"
+msgstr "Мінімальний розмір шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:321
+msgid "The minimum font size used to display text."
+msgstr "Мінімальний розмір символів шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:329
+msgid "Minimum Logical Font Size"
+msgstr "Мінімальний розмір логічного шрифту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:330
+msgid "The minimum logical font size used to display text."
+msgstr ""
+"Мінімальний розмір символів логічного шрифту для показу текстових даних."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:349
+msgid "Enforce 96 DPI"
+msgstr "Використовувати 96 т/д"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:350
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Використовувати роздільну здатність 96 т/д"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:358
+msgid "Auto Load Images"
+msgstr "Автоматично завантажувати зображення"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:359
+msgid "Load images automatically."
+msgstr "Завантажувати зображення у автоматичному режимі"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:367
+msgid "Auto Shrink Images"
+msgstr "Автоматично стискати зображення"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:368
+msgid "Automatically shrink standalone images to fit."
+msgstr "Автоматично стискати окремі зображення відповідно до розмірів вікна."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:376
+msgid "Print Backgrounds"
+msgstr "Друкувати тло"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:377
+msgid "Whether background images should be printed."
+msgstr "Чи слід друкувати зображення тла сторінки."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:385
+msgid "Enable Scripts"
+msgstr "Увімкнути скрипти"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:386
+msgid "Enable embedded scripting languages."
+msgstr "Увімкнути вбудовані до сторінок скрипти."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:394
+msgid "Enable Plugins"
+msgstr "Увімкнути додатки"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:395
+msgid "Enable embedded plugin objects."
+msgstr "Увімкнути вбудовані об’єкти додатків."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:403
+msgid "Resizable Text Areas"
+msgstr "Змінний розмір текстових полів"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:404
+msgid "Whether text areas are resizable."
+msgstr "Чи можлива зміна розмірів текстових полів."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:411
+msgid "User Stylesheet URI"
+msgstr "Адреса URI таблиці стилів користувача"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:412
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "Адреса URI таблиці стилів, яку буде застосовано до всіх сторінок."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:427
+msgid "Zoom Stepping Value"
+msgstr "Приріст масштабу"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:428
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr ""
+"Значення приросту, на який змінюватиметься масштаб під час збільшення або "
+"зменшення."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:446
+msgid "Enable Developer Extras"
+msgstr "Увімкнути засоби розробки"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:447
+msgid "Enables special extensions that help developers"
+msgstr "Увімкнути особливі додатки, які допоможуть у розробці"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:467
+msgid "Enable Private Browsing"
+msgstr "Увімкнути конфіденційний перегляд"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:468
+msgid "Enables private browsing mode"
+msgstr "Увімкнути режим конфіденційного перегляду"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:483
+msgid "Enable Spell Checking"
+msgstr "Увімкнути перевірку орфографії"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:484
+msgid "Enables spell checking while typing"
+msgstr "Увімкнути перевірку правопису під час введення тексту"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:507
+msgid "Languages to use for spell checking"
+msgstr "Мови для перевірки правопису"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:508
+msgid "Comma separated list of languages to use for spell checking"
+msgstr "Список записів мов для перевірки правопису, відокремлених комами"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:522
+msgid "Enable Caret Browsing"
+msgstr "Увімкнути режим активного вказівника"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:523
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr ""
+"Вмикає або вимикає додаткові можливості керування вказівником за допомогою "
+"клавіатури"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:538
+msgid "Enable HTML5 Database"
+msgstr "Увімкнути базу даних HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:539
+msgid "Whether to enable HTML5 database support"
+msgstr "Чи слід вмикати підтримку бази даних HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:554
+msgid "Enable HTML5 Local Storage"
+msgstr "Увімкнути локальне сховище HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:555
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Чи слід вмикати підтримку локального сховища HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:569
+msgid "Enable XSS Auditor"
+msgstr "Увімкнути інструмент перевірки XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:570
+msgid "Whether to enable teh XSS auditor"
+msgstr "Чи слід вмикати інструмент перевірки XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:588
+msgid "Enable Spatial Navigation"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:589
+#, fuzzy
+msgid "Whether to enable Spatial Navigation"
+msgstr "Чи слід вмикати інструмент перевірки XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:606
+msgid "User Agent"
+msgstr "Агент користувача"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:607
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "Рядок User-Agent, який буде використано WebKitGtk"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:622
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript може відкривати вікна у автоматичному режимі"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:623
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Чи можуть скрипти JavaScript відкривати вікна у автоматичному режимі"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:638
+msgid "Enable offline web application cache"
+msgstr "Увімкнути автономний кеш веб-програм"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:639
+msgid "Whether to enable offline web application cache"
+msgstr ""
+"Чи слід вмикати кеш веб-програм, призначений для автономної роботи без мережі"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:666
+msgid "Editing behavior"
+msgstr "Поведінка під час редагування"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:667
+msgid "The behavior mode to use in editing mode"
+msgstr "Режим поведінки під час редагування"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:683
+msgid "Enable universal access from file URIs"
+msgstr "Увімкнути універсальний доступ з файлових адрес URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:684
+msgid "Whether to allow universal access from file URIs"
+msgstr "Чи слід дозволяти універсальний доступ з файлових адрес URI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Enable DOM paste"
+msgstr "Увімкнути вставку DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:700
+msgid "Whether to enable DOM paste"
+msgstr "Чи слід вмикати вставку DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:718
+msgid "Tab key cycles through elements"
+msgstr "Циклічний перехід елементами за клавішею Tab"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Whether the tab key cycles through elements on the page."
+msgstr ""
+"Чи виконуватиметься циклічний перехід елементами сторінки у відповідь на "
+"натискання клавіші Tab."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:739
+msgid "Enable Default Context Menu"
+msgstr "Увімкнути типове контекстне меню"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr ""
+"Вмикає обробку клацання правою кнопкою миші для створення типового "
+"контекстного меню"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+msgid "Enable Site Specific Quirks"
+msgstr "Увімкнути підтримку особливостей сайта"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:761
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "Увімкнути специфічну для сайта зміну параметрів перегляду"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:783
+msgid "Enable page cache"
+msgstr "Увімкнути кеш сторінок"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Whether the page cache should be used"
+msgstr "Чи слід використовувати кешування сторінок"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:804
+msgid "Auto Resize Window"
+msgstr "Автоматична зміна розмірів вікна"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:805
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr ""
+"Автоматично змінювати розміри вікна верхнього рівня у відповідь на запит з "
+"боку сторінки"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:837
+msgid "Enable Java Applet"
+msgstr "Увімкнути аплет Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:838
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Чи слід вмикати підтримку аплетів Java за допомогою теґу <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2444
+msgid "Returns the @web_view's document title"
+msgstr "Повертає заголовок документа @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2458
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Повертає поточну адресу URI даних, показаних у @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2471
+msgid "Copy target list"
+msgstr "Список цілей копіювання"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2472
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+"Список адрес-цілей, які можна скопіювати з цієї веб-панелі до буфера обміну "
+"даними"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2485
+msgid "Paste target list"
+msgstr "Список вставки цілей"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2486
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+"Список цілей, які можна вставити до цієї веб-панелі з буфера обміну даними"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2492
+msgid "Settings"
+msgstr "Параметри"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2493
+msgid "An associated WebKitWebSettings instance"
+msgstr "Пов’язаний екземпляр WebKitWebSettings"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2506
+msgid "Web Inspector"
+msgstr "Веб-ревізор"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2507
+msgid "The associated WebKitWebInspector instance"
+msgstr "Пов’язаний екземпляр WebKitWebInspector"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2527
+msgid "Editable"
+msgstr "Можна редагувати"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2528
+msgid "Whether content can be modified by the user"
+msgstr "Чи може користувач змінювати вміст"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2534
+msgid "Transparent"
+msgstr "Прозорий"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2535
+msgid "Whether content has a transparent background"
+msgstr "Чи має вміст прозоре тло"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2548
+msgid "Zoom level"
+msgstr "Масштабування"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2549
+msgid "The level of zoom of the content"
+msgstr "Масштабування вмісту"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2564
+msgid "Full content zoom"
+msgstr "Масштабування всього вмісту"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2565
+msgid "Whether the full content is scaled when zooming"
+msgstr "Чи слід вмикати масштабування всього вмісту"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2578
+msgid "Encoding"
+msgstr "Кодування"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2579
+msgid "The default encoding of the web view"
+msgstr "Типове кодування веб-панелі"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2592
+msgid "Custom Encoding"
+msgstr "Нетипове кодування"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2593
+msgid "The custom encoding of the web view"
+msgstr "Нетипове кодування веб-панелі"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2645
+msgid "Icon URI"
+msgstr "URI піктограми"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2646
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "URI піктограми для #WebKitWebView."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "Надіслати"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "Скинути"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Це покажчик з можливістю пошуку. Введіть ключові слова для пошуку: "
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "Виберіть файл"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(Немає)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "Відкрити посилання у новому _вікні"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "_Звантажити пов’язаний файл"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "К_опіювати адресу посилання"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "Відкрити зо_браження у новому вікні"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "З_берегти зображення як"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "Коп_іювати зображення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "Відкрити _фрейм у новому вікні"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "П_ерезавантажити"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+msgid "No Guesses Found"
+msgstr "Не знайдено відповідників"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "П_ропустити слово"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "_Додати слово"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "_Шукати у інтернеті"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "Ш_укати у словнику"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "_Відкрити посилання"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "І_гнорувати граматику"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "_Правопис і граматика"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "По_казати перевірку правопису і граматики"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "С_ховати перевірку правопису і граматики"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "Пе_ревірити документ"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "Перевір_яти правопис під час введення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "Перевірити _граматику з правописом"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "_Шрифт"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "_Обрис"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+msgid "Inspect _Element"
+msgstr "Перевірити е_лемент"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "Немає нещодавніх пошуків"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "Нещодавні пошуки"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "Сп_орожнити список пошуків"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "термін"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "визначення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "натиснути"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "вибрати"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "задіяти"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "зняти позначку"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "позначити"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "перейти"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:341
+msgid "Missing Plug-in"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid " files"
+msgstr " файлів"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:352
+msgid "Unknown"
+msgstr "Невідомо"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Loading..."
+msgstr "Завантаження..."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:374
+msgid "Live Broadcast"
+msgstr "Трансляція"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:380
+msgid "audio element controller"
+msgstr "керування звуковим елементом"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:382
+msgid "video element controller"
+msgstr "керування відеоелементом"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:384
+msgid "mute"
+msgstr "вимкнути звук"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:386
+msgid "unmute"
+msgstr "увімкнути звук"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:388
+msgid "play"
+msgstr "відтворити"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:390
+msgid "pause"
+msgstr "призупинити"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:392
+msgid "movie time"
+msgstr "час відтворення відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:394
+msgid "timeline slider thumb"
+msgstr "повзунок лінійки запису"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:396
+msgid "back 30 seconds"
+msgstr "назад на 30 секунд"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:398
+msgid "return to realtime"
+msgstr "повернутися до режиму реального часу"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:400
+msgid "elapsed time"
+msgstr "час, що минув"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:402
+msgid "remaining time"
+msgstr "час, що залишився:"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:404
+msgid "status"
+msgstr "стан"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:406
+msgid "fullscreen"
+msgstr "повноекранний режим"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:408
+msgid "fast forward"
+msgstr "повний вперед"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:410
+msgid "fast reverse"
+msgstr "повний назад"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:412
+msgid "show closed captions"
+msgstr "показати вбудовані субтитри"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:414
+msgid "hide closed captions"
+msgstr "приховати вбудовані субтитри"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:423
+msgid "audio element playback controls and status display"
+msgstr "елементи керування відтворенням та показом стану аудіо"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:425
+msgid "video element playback controls and status display"
+msgstr "елементи керування відтворенням та показом стану відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:427
+msgid "mute audio tracks"
+msgstr "вимкнути звукові доріжки"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:429
+msgid "unmute audio tracks"
+msgstr "увімкнути звукові доріжки"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:431
+msgid "begin playback"
+msgstr "почати відтворення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:433
+msgid "pause playback"
+msgstr "призупинити відтворення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:435
+msgid "movie time scrubber"
+msgstr "зміна часу відтворення відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:437
+msgid "movie time scrubber thumb"
+msgstr "позначка пересування часом відтворення відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:439
+msgid "seek movie back 30 seconds"
+msgstr "перехід на 30 секунд назад"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:441
+msgid "return streaming movie to real time"
+msgstr "повернути відтворення потокового відео у режим реального часу"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:443
+msgid "current movie time in seconds"
+msgstr "поточний час відтворення відео у секундах"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:445
+msgid "number of seconds of movie remaining"
+msgstr "кількість секунд до завершення відтворення відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:447
+msgid "current movie status"
+msgstr "поточний стан відео"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:449
+msgid "seek quickly back"
+msgstr "швидке перемотування назад"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:451
+msgid "seek quickly forward"
+msgstr "швидке перемотування вперед"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:453
+msgid "Play movie in fullscreen mode"
+msgstr "Відтворити відео у повноекранному режимі"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:455
+msgid "start displaying closed captions"
+msgstr "почати показ вбудованих субтитрів"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:457
+msgid "stop displaying closed captions"
+msgstr "припинити показ вбудованих субтитрів"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:466
+msgid "indefinite time"
+msgstr "невизначений час"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:496
+msgid "value missing"
+msgstr "не вистачає значення"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "type mismatch"
+msgstr "невідповідність типів"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "pattern mismatch"
+msgstr "невідповідність шаблонів"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "too long"
+msgstr "занадто довгий"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range underflow"
+msgstr "від’ємне переповнення діапазону"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "range overflow"
+msgstr "переповнення діапазону"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:527
+msgid "step mismatch"
+msgstr "невідповідність кроків"
diff --git a/WebKit/gtk/po/vi.po b/WebKit/gtk/po/vi.po
index 3a684ae..838860c 100644
--- a/WebKit/gtk/po/vi.po
+++ b/WebKit/gtk/po/vi.po
@@ -6,8 +6,8 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.4\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
-"PO-Revision-Date: 2009-06-26 08:31+1000\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-03-01 20:49+0700\n"
 "Last-Translator: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n"
 "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
 "MIME-Version: 1.0\n"
@@ -68,93 +68,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "_Chèn kí tự Unicode"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "Yêu cầu mạng"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "Yêu cầu mạng cho URI cần tải về"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 msgid "Network Response"
-msgstr "Yêu cầu mạng"
+msgstr "Hồi đáp mạng"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
-#, fuzzy
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 msgid "The network response for the URI that should be downloaded"
-msgstr "Yêu cầu mạng cho URI cần tải về"
+msgstr "Hồi đáp mạng cho URI cần tải về"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "URI đích"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "URI đích nơi lưu tập tin"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "Tên tập tin đề nghị"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "Tên tập tin đề nghị mặc định khi lưu"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "Tiến trình"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "Xác định tiến độ tải về hiện thời"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "Tình trạng"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "Xác định tình trạng tải về hiện thời"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "Kích thước hiện thời"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "Lượng dữ liệu đã tải về"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "Kích thước tổng cộng"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "Kích thước của toàn bộ tập tin"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "Người dùng đã huỷ tải về"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "Trang %s đang yêu cầu tên người dùng và mật khẩu"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Thông điệp máy chủ:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "Tên người dùng:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "Mật khẩu:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
-#, fuzzy
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 msgid "_Remember password"
-msgstr "Nhớ mật khẩu"
+msgstr "_Nhớ mật khẩu"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:298
 msgid "Name"
@@ -166,7 +167,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "Tựa đề"
 
@@ -176,7 +177,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -186,22 +187,20 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:344
 msgid "Horizontal Scrollbar Policy"
-msgstr ""
+msgstr "Quy tắc thanh cuộn ngang"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:345
-#, fuzzy
 msgid ""
 "Determines the current policy for the horizontal scrollbar of the frame."
-msgstr "Xác định tiến độ tải về hiện thời"
+msgstr "Xác định quy tắc hiện thời cho thanh cuộn ngang của khung."
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:362
 msgid "Vertical Scrollbar Policy"
-msgstr ""
+msgstr "Quy tắc thanh cuộn dọc"
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:363
-#, fuzzy
 msgid "Determines the current policy for the vertical scrollbar of the frame."
-msgstr "Xác định tiến độ tải về hiện thời"
+msgstr "Xác định quy tắc hiện thời cho thanh cuộn dọc của khung."
 
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
 msgid "The title of the history item"
@@ -261,9 +260,8 @@
 msgstr "Kiểm định JavaScript được thực thi."
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:315
-#, fuzzy
 msgid "Enable Timeline profiling"
-msgstr "Bật kiểm định JavaScript"
+msgstr "Bật kiểm định trục thời gian"
 
 #: WebKit/gtk/webkit/webkitwebinspector.cpp:316
 msgid "Profile the WebCore instrumentation."
@@ -275,11 +273,11 @@
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
 msgid "The reason why this navigation is occurring"
-msgstr ""
+msgstr "Lý do duyệt gặp lỗi"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
 msgid "The URI that was requested as the target for the navigation"
-msgstr ""
+msgstr "URI được yêu cầu làm đích duyệt"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
 msgid "Button"
@@ -298,426 +296,430 @@
 msgstr "Bitmask đại diện trạng thái phím bổ trợ"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
-#, fuzzy
 msgid "Target frame"
-msgstr "Tên khung"
+msgstr "Khung đích"
 
 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
 msgid "The target frame for the navigation"
-msgstr ""
+msgstr "Khung đích để xem"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "Bảng mã mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "Bảng mã mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "Họ phông Cursive"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "Họ phông Cursive mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "Họ phông mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "Họ phông mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "Họ phông Fantasy"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "Họ phông Fantasy mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "Họ phông Monospace"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "Họ phông Monospace mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Họ phông Sans Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "Họ phông Sans Serif mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Họ phông Serif"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "Họ phông Serif mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "Cỡ phông mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "Cỡ phông mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "Cỡ phông Monospace mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "Cỡ phông Monospace mặc định để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "Cỡ phông tối thiểu"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "Cỡ phông tối thiểu để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "Cỡ phông logic tối thiểu"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "Cỡ phông logic tối thiểu dùng để hiển thị văn bản."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "Ép 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "Ép độ phân giảii 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "Tự động nạp ảnh"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "Nạp ảnh tự động."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "Tự động co ảnh."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "Tự động co ảnh độc lập cho khít."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "In ảnh nền"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "Có in ảnh nền hay không."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
-msgstr ""
+msgstr "Bật script"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
-msgstr ""
+msgstr "Bật ngôn ngữ nhúng dạng script."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "Bật phần mở rộng"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "Bật phần mở rộng,"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "Ô văn bản có thể thay đổi kích thước."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "Ô văn bản có thể thay đổi kích thước hay không."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "URI stylesheet người dùng"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "URI của stylesheet áp dụng cho mọi trang."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "Giá trị bước thu/phóng"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "Giá trị thay đổi mức thu phóng mỗi lần."
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "Bật Developer Extras"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "Bật các phần mở rộng đặc biệt, hữu dụng cho người phát triển"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "Bật duyệt riêng tư"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "Bật chế độ duyệt riêng tư"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
-msgstr ""
+msgstr "Bật kiểm lỗi chính tả"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
-msgstr "Kiểm tra khi đang _gõ"
+msgstr "Kiểm lỗi chính tả khi đang gõ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
-msgstr ""
+msgstr "Ngôn ngữ kiểm lỗi chính tả"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
-msgstr ""
+msgstr "Danh sách ngôn ngữ kiểm lỗi chính tả, cách nhau bằng dấu phẩy"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
-msgstr "Bật duyệt riêng tư"
+msgstr "Bật con nháy"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
-msgstr ""
+msgstr "Có bật khả năng duyệt tăng cường bằng bàn phím không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
-msgstr ""
+msgstr "Bật Cơ sở dữ liệu HTML5"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
-msgstr ""
+msgstr "Có bật hỗ trợ Cơ sở dữ liệu HTML5 không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
-msgstr ""
+msgstr "Bật Kho chứa HTML5 cục bộ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
-msgstr ""
+msgstr "Có bật hỗ trợ Kho chứa HTML5 cục bộ không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 msgid "Enable XSS Auditor"
-msgstr ""
+msgstr "Bật kiểm tra XSS"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
-msgstr ""
+msgstr "Có bật kiểm tra XSS không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
-msgstr ""
+msgstr "Đại diện người dùng"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
-msgstr ""
+msgstr "Chuỗi User-Agent WebKitGtk sẽ dùng"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
-msgstr ""
+msgstr "JavaScript được phép mở cửa sổ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
-msgstr ""
+msgstr "JavaScript có được phép tự động mở cửa sổ không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
-msgstr ""
+msgstr "Bật lưu tạm ứng dụng web ngoại tuyến"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
-msgstr ""
+msgstr "Có bật lưu tạm ứng dụng web ngoại tuyến không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
-msgstr ""
+msgstr "Cách sửa đổi"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
-msgstr ""
+msgstr "Cách sửa đổi được sử dụng trong chế độ sửa đổi"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
-msgstr ""
+msgstr "Bật truy cập thống nhất từ URI của tập tin"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
-msgstr ""
+msgstr "Có cho phép truy cập thống nhất từ URI của tập tin không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 msgid "Enable DOM paste"
-msgstr ""
+msgstr "Cho dán DOM"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
-msgstr ""
+msgstr "Có cho dán DOM không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
-msgstr ""
+msgstr "Xoay vòng phím Tab qua các thành phần"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
-msgstr ""
+msgstr "Có xoay vòng phím Tab trên các thành phần của trang không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
-msgstr ""
+msgstr "Bật menu ngữ cảnh mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
-msgstr ""
+msgstr "Cho phép phím chuột phải tạo menu ngữ cảnh mặc định"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
-msgstr ""
+msgstr "Bật khắc phục đặc thù cho các trang"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
-msgstr ""
+msgstr "Khắc phục những nhược điểm đặc thù của một số trang web"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
-msgstr ""
+msgstr "Bật page cache"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
-#, fuzzy
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 msgid "Whether the page cache should be used"
-msgstr "Có in ảnh nền hay không."
+msgstr "Có bật tính năng page cache không"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
-msgstr ""
+msgstr "Tự động đổi kích thước cửa sổ"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
-msgstr ""
+msgstr "Tự động thay đổi kích thước cửa sổ trên cùng khi trang yêu cầu"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr "Bật tiểu dụng Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr "Cho phép hỗ trợ tiểu dụng Java bằng <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "Trả về tiêu đề tài liệu của @web_view"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "Trả về URI hiện thời của tài liệu được @web_view hiển thị"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "Danh sách đích chép"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "Danh sách đích mà khung xem web này hỗ trợ khi chép vào clipboard."
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "Danh sách đích dán"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "Danh sách đích mà khung xem web này hỗ trợ khi dán clipboard."
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "Thiết lập"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "Một thể hiện WebKitWebSettings liên kết"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Thanh tra Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "Một thể hiện WebKitWebInspector liên kết"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "Có thể thay đổi"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "Nội dung có thể bị người dùng thay đổi hay không"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "Trong suốt"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "Nội dung có ảnh nền trong suốt không."
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "Mức phóng"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "Mức phóng to/thu nhỏ nội dung"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "Phóng nội dung đầy đủ"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "Toàn bộ nội dung có bị co lại không."
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "Bảng mã"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "Bảng mã mặc định cho khung xem Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "Bảng mã tự chọn"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "Bảng mã tự chọn cho khung xem Web"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
-msgstr ""
+msgstr "URI biểu tượng"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
-msgstr ""
+msgstr "URI của biểu tượng trang (favicon) cho #WebKitWebView."
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
@@ -729,8 +731,8 @@
 msgstr "Phục hồi"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "Chỉ mục _tìm được"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Đây là chỉ mục tìm kiếm được. Hãy nhập từ khoá cần tìm: "
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -890,108 +892,107 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
 msgid "Loading..."
-msgstr ""
+msgstr "Đang nạp"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
 msgid "Live Broadcast"
-msgstr ""
+msgstr "Phát trực tiếp"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
 msgid "audio element controller"
-msgstr ""
+msgstr "bộ điều khiển phần tử âm thanh"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
 msgid "video element controller"
-msgstr ""
+msgstr "bộ điều khiển phần tử hình ảnh"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
 msgid "mute"
-msgstr ""
+msgstr "tắt tiếng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
 msgid "unmute"
-msgstr ""
+msgstr "không tắt tiếng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
 msgid "play"
-msgstr ""
+msgstr "phát"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
 msgid "pause"
-msgstr ""
+msgstr "tạm dừng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
 msgid "movie time"
-msgstr ""
+msgstr "thời lượng phim"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
 msgid "timeline slider thumb"
-msgstr ""
+msgstr "con chạy thời gian"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
 msgid "back 30 seconds"
-msgstr ""
+msgstr "lùi 30 giây"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
 msgid "return to realtime"
-msgstr ""
+msgstr "trở về thời gian thực"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
 msgid "elapsed time"
-msgstr ""
+msgstr "thời gian đã qua"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
 msgid "remaining time"
-msgstr ""
+msgstr "thời gian còn lại"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
-#, fuzzy
 msgid "status"
-msgstr "Tình trạng"
+msgstr "tình trạng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
 msgid "fullscreen"
-msgstr ""
+msgstr "toàn màn hình"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
 msgid "fast forward"
-msgstr ""
+msgstr "tới nhanh"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
 msgid "fast reverse"
-msgstr ""
+msgstr "lùi lại"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
 msgid "show closed captions"
-msgstr ""
+msgstr "xay đầu đề"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
 msgid "hide closed captions"
-msgstr ""
+msgstr "ẩn đầu đề"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
 msgid "audio element playback controls and status display"
-msgstr ""
+msgstr "bộ điều khiển phần tử phát tiếng và hiển thị tình trạng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
 msgid "video element playback controls and status display"
-msgstr ""
+msgstr "bộ điều khiển phần tử phát hình và hiển thị tình trạng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
 msgid "mute audio tracks"
-msgstr ""
+msgstr "tắt tiếng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
 msgid "unmute audio tracks"
-msgstr ""
+msgstr "không tắt tiếng"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
 msgid "begin playback"
-msgstr ""
+msgstr "bắt đầu phát"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
 msgid "pause playback"
-msgstr ""
+msgstr "tạm dừng phát"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
 msgid "movie time scrubber"
@@ -1003,73 +1004,75 @@
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
 msgid "seek movie back 30 seconds"
-msgstr ""
+msgstr "quay lùi phim 30 giây"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
 msgid "return streaming movie to real time"
-msgstr ""
+msgstr "trở về luồng thời gian thực"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
 msgid "current movie time in seconds"
-msgstr ""
+msgstr "thời gian của phim theo giây"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
 msgid "number of seconds of movie remaining"
-msgstr ""
+msgstr "số giây còn lại"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
 msgid "current movie status"
-msgstr ""
+msgstr "tình trạng phim hiện thời"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
 msgid "seek quickly back"
-msgstr ""
+msgstr "lùi ngược nhanh"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
 msgid "seek quickly forward"
-msgstr ""
+msgstr "chạy tới nhanh"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
 msgid "Play movie in fullscreen mode"
-msgstr ""
+msgstr "Xem phim toàn màn hình"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
 msgid "start displaying closed captions"
-msgstr ""
+msgstr "bắt đầu hiển thị đầu đề"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
 msgid "stop displaying closed captions"
-msgstr ""
+msgstr "ngưng hiển thị đầu đề"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
-#, fuzzy
 msgid "indefinite time"
-msgstr "định nghĩa"
+msgstr "vô hạn"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
 msgid "value missing"
-msgstr ""
+msgstr "thiếu giá trị"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
 msgid "type mismatch"
-msgstr ""
+msgstr "kiểu không khớp"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
 msgid "pattern mismatch"
-msgstr ""
+msgstr "mẫu không khớp"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
 msgid "too long"
-msgstr ""
+msgstr "quá dài"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
 msgid "range underflow"
-msgstr ""
+msgstr "phạm vi quá ngắn"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
 msgid "range overflow"
-msgstr ""
+msgstr "phạm vi quá dài"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
-msgstr ""
+msgstr "nhảy bước không khớp"
+
+#~ msgid "_Searchable Index"
+#~ msgstr "Chỉ mục _tìm được"
diff --git a/WebKit/gtk/po/webkit.pot b/WebKit/gtk/po/webkit.pot
index 5adf34f..ebe1df7 100644
--- a/WebKit/gtk/po/webkit.pot
+++ b/WebKit/gtk/po/webkit.pot
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.22\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:01-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -69,88 +69,92 @@
 msgid "_Insert Unicode Control Character"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 msgid "Network Response"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 msgid "The network response for the URI that should be downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 msgid "_Remember password"
 msgstr ""
 
@@ -164,7 +168,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr ""
 
@@ -174,7 +178,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr ""
 
@@ -300,413 +304,421 @@
 msgid "The target frame for the navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 msgid "Enables spell checking while typing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 msgid "Enable Caret Browsing"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 msgid "Enable XSS Auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 msgid "Enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 msgid "Whether the page cache should be used"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+msgid "Enable Java Applet"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -720,7 +732,7 @@
 msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
+msgid "This is a searchable index. Enter search keywords: "
 msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
diff --git a/WebKit/gtk/po/zh_CN.po b/WebKit/gtk/po/zh_CN.po
index 19e4f44..8561fd8 100644
--- a/WebKit/gtk/po/zh_CN.po
+++ b/WebKit/gtk/po/zh_CN.po
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: webkit 1.1.4\n"
 "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
-"POT-Creation-Date: 2010-02-16 15:00-0200\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
 "PO-Revision-Date: 2009-07-14 18:11+0800\n"
 "Last-Translator: Aron Xu <aronmalache@163.com>\n"
 "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@@ -70,90 +70,94 @@
 msgid "_Insert Unicode Control Character"
 msgstr "插入 Unicode 控制字符(_I)"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:262
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
 msgid "Network Request"
 msgstr "网络请求"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:263
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
 msgid "The network request for the URI that should be downloaded"
 msgstr "网络请求该 URI 应当被下载"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:277
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
 #, fuzzy
 msgid "Network Response"
 msgstr "网络请求"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:278
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
 #, fuzzy
 msgid "The network response for the URI that should be downloaded"
 msgstr "网络请求该 URI 应当被下载"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:292
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
 msgid "Destination URI"
 msgstr "目的 URI"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:293
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
 msgid "The destination URI where to save the file"
 msgstr "保存文件的目的 URI"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:307
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
 msgid "Suggested Filename"
 msgstr "建议文件名"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:308
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
 msgid "The filename suggested as default when saving"
 msgstr "保存时默认建议使用的文件名"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:325
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
 msgid "Progress"
 msgstr "进度"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:326
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
 msgid "Determines the current progress of the download"
 msgstr "显示当前下载进度"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:339
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
 msgid "Status"
 msgstr "状态"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:340
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
 msgid "Determines the current status of the download"
 msgstr "显示当前下载状态"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:355
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
 msgid "Current Size"
 msgstr "当前尺寸"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:356
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
 msgid "The length of the data already downloaded"
 msgstr "当前已下载的数据大小"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:370
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
 msgid "Total Size"
 msgstr "总尺寸"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:371
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
 msgid "The total size of the file"
 msgstr "文件总尺寸"
 
-#: WebKit/gtk/webkit/webkitdownload.cpp:522
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
 msgid "User cancelled the download"
 msgstr "用户取消了下载"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:244
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
 #, c-format
 msgid "A username and password are being requested by the site %s"
 msgstr "站点 %s 请求用户名和密码"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:269
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
 msgid "Username:"
 msgstr "用户名:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:271
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
 msgid "Password:"
 msgstr "密码:"
 
-#: WebKit/gtk/webkit/webkitsoupauthdialog.c:280
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
 #, fuzzy
 msgid "_Remember password"
 msgstr "记住密码"
@@ -168,7 +172,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:305
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
-#: WebKit/gtk/webkit/webkitwebview.cpp:2315
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
 msgid "Title"
 msgstr "标题"
 
@@ -178,7 +182,7 @@
 
 #: WebKit/gtk/webkit/webkitwebframe.cpp:312
 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
-#: WebKit/gtk/webkit/webkitwebview.cpp:2329
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
 msgid "URI"
 msgstr "URI"
 
@@ -309,418 +313,427 @@
 msgid "The target frame for the navigation"
 msgstr "此 URI 是被作为导航目标而请求的"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:233
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
 msgid "Default Encoding"
 msgstr "默认编码"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:234
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
 msgid "The default encoding used to display text."
 msgstr "用以显示文本的默认编码。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:242
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
 msgid "Cursive Font Family"
 msgstr "草书字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:243
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
 msgid "The default Cursive font family used to display text."
 msgstr "用以显示文本的默认草书字体。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:251
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
 msgid "Default Font Family"
 msgstr "默认字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:252
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
 msgid "The default font family used to display text."
 msgstr "用以显示文本的默认字体。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:260
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
 msgid "Fantasy Font Family"
 msgstr "幻想字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:261
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
 msgid "The default Fantasy font family used to display text."
 msgstr "用以显示文本的默认幻想字体。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:269
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
 msgid "Monospace Font Family"
 msgstr "等宽字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:270
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
 msgid "The default font family used to display monospace text."
 msgstr "用以显示文本的默认等宽字体。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:278
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
 msgid "Sans Serif Font Family"
 msgstr "Sans Serif 字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:279
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
 msgid "The default Sans Serif font family used to display text."
 msgstr "用以显示文本的默认 Sans Serif 字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:287
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
 msgid "Serif Font Family"
 msgstr "Serif 字体"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:288
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
 msgid "The default Serif font family used to display text."
 msgstr "用以显示文本的默认 Serif 字体。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:296
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
 msgid "Default Font Size"
 msgstr "默认字号"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:297
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
 msgid "The default font size used to display text."
 msgstr "用以显示文本的默认字号。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:305
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
 msgid "Default Monospace Font Size"
 msgstr "默认等宽字号"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:306
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
 msgid "The default font size used to display monospace text."
 msgstr "用以显示等宽文本的默认字号。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:314
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
 msgid "Minimum Font Size"
 msgstr "最小字号"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:315
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
 msgid "The minimum font size used to display text."
 msgstr "用以显示文本的最小字号。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:323
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
 msgid "Minimum Logical Font Size"
 msgstr "最小逻辑字号"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:324
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
 msgid "The minimum logical font size used to display text."
 msgstr "用以显示文本的最小逻辑字号。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:343
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
 msgid "Enforce 96 DPI"
 msgstr "强制为 96 DPI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:344
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
 msgid "Enforce a resolution of 96 DPI"
 msgstr "强制 96 DPI 分辨率"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:352
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
 msgid "Auto Load Images"
 msgstr "自动载入图像"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:353
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
 msgid "Load images automatically."
 msgstr "自动载入图像。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:361
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
 msgid "Auto Shrink Images"
 msgstr "自动缩小图像"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:362
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
 msgid "Automatically shrink standalone images to fit."
 msgstr "自动缩小单个图像以适应需求。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:370
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
 msgid "Print Backgrounds"
 msgstr "打印背景"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:371
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
 msgid "Whether background images should be printed."
 msgstr "是否打印背景。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:379
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
 msgid "Enable Scripts"
 msgstr "启用脚本"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:380
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
 msgid "Enable embedded scripting languages."
 msgstr "启用嵌入式脚步语言"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:388
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
 msgid "Enable Plugins"
 msgstr "启用插件"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:389
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
 msgid "Enable embedded plugin objects."
 msgstr "启用嵌入式插件对象。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:397
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
 msgid "Resizable Text Areas"
 msgstr "大小可变文本域"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:398
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
 msgid "Whether text areas are resizable."
 msgstr "文本域大小是否是否可变。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:405
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
 msgid "User Stylesheet URI"
 msgstr "用户样式表 URI"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:406
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
 msgid "The URI of a stylesheet that is applied to every page."
 msgstr "应用于每个页面的样式表的 URI。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:421
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
 msgid "Zoom Stepping Value"
 msgstr "缩放步值"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:422
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
 msgid "The value by which the zoom level is changed when zooming in or out."
 msgstr "在放大或缩小中每次缩放的步值。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:440
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
 msgid "Enable Developer Extras"
 msgstr "启用开发者附加"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:441
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
 msgid "Enables special extensions that help developers"
 msgstr "启用帮助开发者的特殊扩展"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:461
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
 msgid "Enable Private Browsing"
 msgstr "启用隐私浏览"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:462
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
 msgid "Enables private browsing mode"
 msgstr "启用隐私浏览模式"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:477
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
 msgid "Enable Spell Checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:478
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
 #, fuzzy
 msgid "Enables spell checking while typing"
 msgstr "输入时检查拼写(_T)"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:501
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
 msgid "Languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:502
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
 msgid "Comma separated list of languages to use for spell checking"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:516
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
 #, fuzzy
 msgid "Enable Caret Browsing"
 msgstr "启用隐私浏览"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:517
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
 msgid "Whether to enable accesibility enhanced keyboard navigation"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:532
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
 msgid "Enable HTML5 Database"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:533
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
 msgid "Whether to enable HTML5 database support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:548
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
 msgid "Enable HTML5 Local Storage"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:549
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
 msgid "Whether to enable HTML5 Local Storage support"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:563
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
 #, fuzzy
 msgid "Enable XSS Auditor"
 msgstr "启用脚本"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:564
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
 msgid "Whether to enable teh XSS auditor"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:582
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
 msgid "User Agent"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:583
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
 msgid "The User-Agent string used by WebKitGtk"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:598
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
 msgid "JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:599
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
 msgid "Whether JavaScript can open windows automatically"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:614
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
 msgid "Enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:615
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
 msgid "Whether to enable offline web application cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:642
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
 msgid "Editing behavior"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:643
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
 msgid "The behavior mode to use in editing mode"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:659
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
 msgid "Enable universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:660
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
 msgid "Whether to allow universal access from file URIs"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:675
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
 #, fuzzy
 msgid "Enable DOM paste"
 msgstr "启用脚本"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:676
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
 msgid "Whether to enable DOM paste"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:694
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
 msgid "Tab key cycles through elements"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:695
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
 msgid "Whether the tab key cycles through elements on the page."
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:715
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
 msgid "Enable Default Context Menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:716
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
 msgid ""
 "Enables the handling of right-clicks for the creation of the default context "
 "menu"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:736
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
 msgid "Enable Site Specific Quirks"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:737
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
 msgid "Enables the site-specific compatibility workarounds"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:759
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
 msgid "Enable page cache"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:760
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
 #, fuzzy
 msgid "Whether the page cache should be used"
 msgstr "是否打印背景。"
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:780
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
 msgid "Auto Resize Window"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebsettings.cpp:781
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
 msgid "Automatically resize the toplevel window when a page requests it"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2316
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#, fuzzy
+msgid "Enable Java Applet"
+msgstr "启用 JavaScript 摘要"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
 msgid "Returns the @web_view's document title"
 msgstr "返回 @web_view 的文档标题"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2330
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
 msgid "Returns the current URI of the contents displayed by the @web_view"
 msgstr "返回当前由 @web_view 显示的内容的 URI"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2343
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
 msgid "Copy target list"
 msgstr "复制目标列表"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2344
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
 msgid "The list of targets this web view supports for clipboard copying"
 msgstr "目标 Web View 列表支持剪贴簿复制"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2357
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
 msgid "Paste target list"
 msgstr "粘贴目标列表"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2358
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
 msgid "The list of targets this web view supports for clipboard pasting"
 msgstr "目标 Web View 列表支持剪贴簿粘贴"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2364
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
 msgid "Settings"
 msgstr "设置"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2365
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
 msgid "An associated WebKitWebSettings instance"
 msgstr "一个关联的 WebKitWebSettings 样例"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2378
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
 msgid "Web Inspector"
 msgstr "Web Inspector"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2379
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
 msgid "The associated WebKitWebInspector instance"
 msgstr "一个关联的 WebKitWebInspector 样例"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2399
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
 msgid "Editable"
 msgstr "可编辑"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2400
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
 msgid "Whether content can be modified by the user"
 msgstr "用户是否可编辑内容"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2406
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
 msgid "Transparent"
 msgstr "透明"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2407
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
 msgid "Whether content has a transparent background"
 msgstr "内容是否包含透明背景"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2420
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
 msgid "Zoom level"
 msgstr "缩放级别"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2421
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
 msgid "The level of zoom of the content"
 msgstr "内容缩放级别"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2436
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
 msgid "Full content zoom"
 msgstr "完整内容缩放"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2437
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
 msgid "Whether the full content is scaled when zooming"
 msgstr "是否将所有内容完整缩放"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2450
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
 msgid "Encoding"
 msgstr "编码"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2451
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
 msgid "The default encoding of the web view"
 msgstr "Web View 的默认编码"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2464
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
 msgid "Custom Encoding"
 msgstr "自定义编码"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2465
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
 msgid "The custom encoding of the web view"
 msgstr "Web View的自定义编码"
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2517
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
 msgid "Icon URI"
 msgstr ""
 
-#: WebKit/gtk/webkit/webkitwebview.cpp:2518
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
 msgid "The URI for the favicon for the #WebKitWebView."
 msgstr ""
 
@@ -734,8 +747,8 @@
 msgstr "重置"
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
-msgid "_Searchable Index"
-msgstr "可搜索索引(_S)"
+msgid "This is a searchable index. Enter search keywords: "
+msgstr ""
 
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
 msgid "Choose File"
@@ -1078,3 +1091,6 @@
 #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
 msgid "step mismatch"
 msgstr ""
+
+#~ msgid "_Searchable Index"
+#~ msgstr "可搜索索引(_S)"
diff --git a/WebKit/gtk/tests/test_utils.c b/WebKit/gtk/tests/test_utils.c
new file mode 100644
index 0000000..646fd25
--- /dev/null
+++ b/WebKit/gtk/tests/test_utils.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Arno Renevier
+ *
+ * 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 "test_utils.h"
+
+#include <glib.h>
+#include <glib/gstdio.h>
+
+int testutils_relative_chdir(const gchar* target_filename, const gchar* executable_path)
+{
+    if (g_path_is_absolute(executable_path)) {
+        if (g_chdir(g_path_get_dirname(executable_path))) {
+            return -1;
+        }
+    }
+
+    while (!g_file_test(target_filename, G_FILE_TEST_EXISTS)) {
+        gchar *path_name;
+        if (g_chdir("..")) {
+            return -1;
+        }
+        g_assert(!g_str_equal((path_name = g_get_current_dir()), "/"));
+        g_free(path_name);
+    }
+
+    gchar* dirname = g_path_get_dirname(target_filename);
+    if (g_chdir(dirname)) {
+        g_free(dirname);
+        return -1;
+    }
+
+    g_free(dirname);
+    return 0;
+}
diff --git a/WebKit/gtk/tests/test_utils.h b/WebKit/gtk/tests/test_utils.h
new file mode 100644
index 0000000..e761f74
--- /dev/null
+++ b/WebKit/gtk/tests/test_utils.h
@@ -0,0 +1,3 @@
+#include <glib.h>
+
+int testutils_relative_chdir(const gchar*, const gchar*);
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index 7db274a..1f1ab0c 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -38,6 +38,8 @@
 
 static const char* contentsInParagraphAndBodyModerate = "<html><body><p>This is a test.</p>Hello world.<br /><font color='#00cc00'>This sentence is green.</font><br />This one is not.</body></html>";
 
+static const char* contentsInTable = "<html><body><table><tr><td>foo</td><td>bar</td></tr></table></body></html>";
+
 static gboolean bail_out(GMainLoop* loop)
 {
     if (g_main_loop_is_running(loop))
@@ -450,6 +452,34 @@
     g_object_unref(webView);
 }
 
+static void testWebkitAtkGetTextInTable(void)
+{
+    WebKitWebView* webView;
+    AtkObject* obj;
+    GMainLoop* loop;
+
+    webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    g_object_ref_sink(webView);
+    GtkAllocation alloc = { 0, 0, 800, 600 };
+    gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
+    webkit_web_view_load_string(webView, contentsInTable, NULL, NULL, NULL);
+    loop = g_main_loop_new(NULL, TRUE);
+
+    g_timeout_add(100, (GSourceFunc)bail_out, loop);
+    g_main_loop_run(loop);
+
+    obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+    g_assert(obj);
+    obj = atk_object_ref_accessible_child(obj, 0);
+    g_assert(obj);
+
+    /* Tables should not implement AtkText */
+    g_assert(G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_TEXT, AtkTextIface) == NULL);
+
+    g_object_unref(obj);
+    g_object_unref(webView);
+}
+
 int main(int argc, char** argv)
 {
     g_thread_init(NULL);
@@ -463,6 +493,7 @@
     g_test_add_func("/webkit/atk/get_text_at_offset_text_input", test_webkit_atk_get_text_at_offset_text_input);
     g_test_add_func("/webkit/atk/getTextInParagraphAndBodySimple", testWebkitAtkGetTextInParagraphAndBodySimple);
     g_test_add_func("/webkit/atk/getTextInParagraphAndBodyModerate", testWebkitAtkGetTextInParagraphAndBodyModerate);
+    g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable);
     return g_test_run ();
 }
 
diff --git a/WebKit/gtk/tests/testatkroles.c b/WebKit/gtk/tests/testatkroles.c
new file mode 100644
index 0000000..d3ade6e
--- /dev/null
+++ b/WebKit/gtk/tests/testatkroles.c
@@ -0,0 +1,383 @@
+/*
+ * Copyright © 2010 Joanmarie Diggs
+ * Copyright © 2010 Igalia S.L.
+ *
+ * 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 <glib.h>
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+
+/* Non form roles */
+#define HTML_DOCUMENT_FRAME "<html><body>This is a test.</body></html>"
+#define HTML_HEADING "<html><body><h1>1</h1><h2>2</h2><h3>3</h3><h4>4</h4><h5>5</h5><h6>6</h6></body></html>"
+#define HTML_IMAGE "<html><body><img src='foobar.png' alt='This is a test.'/></body></html>"
+#define HTML_LINK_TEXT "<html><body><a href='foobar.html'>This is a test.</a></body></html>"
+#define HTML_LIST "<html><body><ul><li>1</li><li>2</li></ul><ol><li>1</li><li>2</li></ol></body></html>"
+#define HTML_PARAGRAPH "<html><body><p>This is a test.</p></body></html>"
+#define HTML_SECTION "<html><body><div>This is a test.</div></body></html>"
+#define HTML_TABLE "<html><body><table border='1'><tr><td>This is</td><td>a test.</td></tr></table></body></html>"
+/* Form roles */
+#define HTML_FORM "<html><body><form>This is a test.</form></body></html>"
+#define HTML_CHECK_BOX "<html><body><input type='checkbox' />This is a test.</body></html>"
+#define HTML_LABELED_ENTRY "<html><body><label for='foo'>Name:</label><input type='text' id='foo' /></body></html>"
+#define HTML_LISTBOX "<html><body><select size='3'><option>one</option><option>two</option><option>three</option></select></body></html>"
+#define HTML_PASSWORD_TEXT "<html><body><input type='password' /></body></html>"
+#define HTML_PUSH_BUTTON "<html><body><input type='submit' value='ok' />This is a test.</body></html>"
+#define HTML_RADIO_BUTTON "<html><body><input type='radio' />This is a test.</body></html>"
+
+typedef struct {
+    AtkObject* documentFrame;
+    AtkObject* obj;
+    AtkRole role;
+    GtkWidget* webView;
+    GtkAllocation alloc;
+    GMainLoop* loop;
+} AtkRolesFixture;
+
+static gboolean finish_loading(AtkRolesFixture* fixture)
+{
+    if (g_main_loop_is_running(fixture->loop))
+        g_main_loop_quit(fixture->loop);
+
+    fixture->documentFrame = gtk_widget_get_accessible(fixture->webView);
+    g_assert(fixture->documentFrame);
+
+    return FALSE;
+}
+
+static void atk_roles_fixture_setup(AtkRolesFixture* fixture, gconstpointer data)
+{
+    fixture->loop = g_main_loop_new(NULL, TRUE);
+    fixture->alloc = (GtkAllocation) { 0, 0, 800, 600 };
+    fixture->webView = webkit_web_view_new();
+    g_object_ref_sink(fixture->webView);
+
+    gtk_widget_size_allocate(fixture->webView, &fixture->alloc);
+
+    if (data != NULL)
+        webkit_web_view_load_string(WEBKIT_WEB_VIEW (fixture->webView), (const char*) data, NULL, NULL, NULL);
+
+    g_idle_add((GSourceFunc) finish_loading, fixture);
+    g_main_loop_run(fixture->loop);
+}
+
+static void atk_roles_fixture_teardown(AtkRolesFixture* fixture, gconstpointer data)
+{
+    g_object_unref(fixture->webView);
+    g_main_loop_unref(fixture->loop);
+}
+
+static void get_child_and_test_role(AtkObject* obj, gint pos, AtkRole role)
+{
+    AtkObject* child;
+    AtkRole child_role;
+
+    child = atk_object_ref_accessible_child(obj, pos);
+    g_assert(child);
+    child_role = atk_object_get_role(child);
+    g_assert(child_role == role);
+
+    g_object_unref(child);
+}
+
+static void test_webkit_atk_get_role_document_frame(AtkRolesFixture* fixture, gconstpointer data)
+{
+    fixture->role = atk_object_get_role(fixture->documentFrame);
+    g_assert(fixture->role == ATK_ROLE_DOCUMENT_FRAME);
+}
+
+static void test_webkit_atk_get_role_heading(AtkRolesFixture* fixture, gconstpointer data)
+{
+    get_child_and_test_role(fixture->documentFrame, 0, ATK_ROLE_HEADING);
+    get_child_and_test_role(fixture->documentFrame, 1, ATK_ROLE_HEADING);
+    get_child_and_test_role(fixture->documentFrame, 2, ATK_ROLE_HEADING);
+    get_child_and_test_role(fixture->documentFrame, 3, ATK_ROLE_HEADING);
+    get_child_and_test_role(fixture->documentFrame, 4, ATK_ROLE_HEADING);
+    get_child_and_test_role(fixture->documentFrame, 5, ATK_ROLE_HEADING);
+}
+
+static void test_webkit_atk_get_role_image(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_IMAGE);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_link(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_LINK);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_list_and_item(AtkRolesFixture* fixture, gconstpointer data)
+{
+    AtkObject* listObj;
+
+    listObj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(listObj);
+    fixture->role = atk_object_get_role(listObj);
+    g_assert(fixture->role == ATK_ROLE_LIST);
+
+    get_child_and_test_role(listObj, 0, ATK_ROLE_LIST_ITEM);
+    get_child_and_test_role(listObj, 1, ATK_ROLE_LIST_ITEM);
+    g_object_unref(listObj);
+
+    listObj = atk_object_ref_accessible_child(fixture->documentFrame, 1);
+    g_assert(listObj);
+    fixture->role = atk_object_get_role(listObj);
+    g_assert(fixture->role == ATK_ROLE_LIST);
+
+    get_child_and_test_role(listObj, 0, ATK_ROLE_LIST_ITEM);
+    get_child_and_test_role(listObj, 1, ATK_ROLE_LIST_ITEM);
+    g_object_unref(listObj);
+}
+
+static void test_webkit_atk_get_role_paragraph(AtkRolesFixture* fixture, gconstpointer data)
+{
+    get_child_and_test_role(fixture->documentFrame, 0, ATK_ROLE_PARAGRAPH);
+}
+
+static void test_webkit_atk_get_role_section(AtkRolesFixture* fixture, gconstpointer data)
+{
+    get_child_and_test_role(fixture->documentFrame, 0, ATK_ROLE_SECTION);
+}
+
+// Does not yet test table cells because of bug 30895.
+static void test_webkit_atk_get_role_table(AtkRolesFixture* fixture, gconstpointer data)
+{
+    get_child_and_test_role(fixture->documentFrame, 0, ATK_ROLE_TABLE);
+}
+
+/* Form roles */
+static void test_webkit_atk_get_role_form(AtkRolesFixture *fixture, gconstpointer data)
+{
+    get_child_and_test_role(fixture->documentFrame, 0, ATK_ROLE_FORM);
+}
+
+static void test_webkit_atk_get_role_check_box(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_CHECK_BOX);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_entry(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 1, ATK_ROLE_ENTRY);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_label(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_LABEL);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_listbox(AtkRolesFixture* fixture, gconstpointer data)
+{
+    AtkObject* listboxObj;
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    listboxObj = atk_object_ref_accessible_child(fixture->obj, 0);
+    g_assert(listboxObj);
+    fixture->role = atk_object_get_role(listboxObj);
+    g_assert(fixture->role == ATK_ROLE_LIST);
+
+    get_child_and_test_role(listboxObj, 0, ATK_ROLE_LIST_ITEM);
+    get_child_and_test_role(listboxObj, 1, ATK_ROLE_LIST_ITEM);
+    get_child_and_test_role(listboxObj, 2, ATK_ROLE_LIST_ITEM);
+
+    g_object_unref(fixture->obj);
+    g_object_unref(listboxObj);
+}
+
+static void test_webkit_atk_get_role_password_text(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_PASSWORD_TEXT);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_push_button(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_PUSH_BUTTON);
+
+    g_object_unref(fixture->obj);
+}
+
+static void test_webkit_atk_get_role_radio_button(AtkRolesFixture* fixture, gconstpointer data)
+{
+    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
+    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
+    g_assert(fixture->obj);
+
+    get_child_and_test_role(fixture->obj, 0, ATK_ROLE_RADIO_BUTTON);
+
+    g_object_unref(fixture->obj);
+}
+
+int main(int argc, char** argv)
+{
+    g_thread_init(NULL);
+    gtk_test_init(&argc, &argv, NULL);
+
+    g_test_bug_base("https://bugs.webkit.org/");
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_document_frame",
+               AtkRolesFixture, HTML_DOCUMENT_FRAME,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_document_frame,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_heading",
+               AtkRolesFixture, HTML_HEADING,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_heading,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_image",
+               AtkRolesFixture, HTML_IMAGE,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_image,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_link",
+               AtkRolesFixture, HTML_LINK_TEXT,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_link,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_list_and_item",
+               AtkRolesFixture, HTML_LIST,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_list_and_item,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_paragraph",
+               AtkRolesFixture, HTML_PARAGRAPH,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_paragraph,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_section",
+               AtkRolesFixture, HTML_SECTION,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_section,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_table",
+               AtkRolesFixture, HTML_TABLE,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_table,
+               atk_roles_fixture_teardown);
+
+    /* Form roles */
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_form",
+               AtkRolesFixture, HTML_FORM,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_form,
+               atk_roles_fixture_teardown);
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_check_box",
+               AtkRolesFixture, HTML_CHECK_BOX,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_check_box,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_entry",
+               AtkRolesFixture, HTML_LABELED_ENTRY,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_entry,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_label",
+               AtkRolesFixture, HTML_LABELED_ENTRY,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_label,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_listbox",
+               AtkRolesFixture, HTML_LISTBOX,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_listbox,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_password_text",
+               AtkRolesFixture, HTML_PASSWORD_TEXT,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_password_text,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_push_button",
+               AtkRolesFixture, HTML_PUSH_BUTTON,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_push_button,
+               atk_roles_fixture_teardown);
+
+    g_test_add("/webkit/atk/test_webkit_atk_get_role_radio_button",
+               AtkRolesFixture, HTML_RADIO_BUTTON,
+               atk_roles_fixture_setup,
+               test_webkit_atk_get_role_radio_button,
+               atk_roles_fixture_teardown);
+
+    return g_test_run();
+}
+
+#else
+int main(int argc, char** argv)
+{
+    g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
+    return 0;
+}
+
+#endif
diff --git a/WebKit/gtk/tests/testglobals.c b/WebKit/gtk/tests/testglobals.c
new file mode 100644
index 0000000..e53edf4
--- /dev/null
+++ b/WebKit/gtk/tests/testglobals.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * 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 <gtk/gtk.h>
+#include <libsoup/soup.h>
+#include <webkit/webkit.h>
+
+#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+
+// Make sure the session is initialized properly when webkit_get_default_session() is called.
+static void test_globals_default_session()
+{
+    g_test_bug("36754");
+
+    SoupSession* session = webkit_get_default_session();
+    soup_session_remove_feature_by_type(session, WEBKIT_TYPE_SOUP_AUTH_DIALOG);
+
+    // This makes sure our initialization ran.
+    g_assert(soup_session_get_feature(session, SOUP_TYPE_CONTENT_DECODER) != NULL);
+
+    // Creating a WebView should make sure the session is
+    // initialized, and not mess with our changes.
+    WebKitWebView* web_view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    g_object_ref_sink(web_view);
+    g_object_unref(web_view);
+
+    // These makes sure our modification was kept.
+    g_assert(soup_session_get_feature(session, SOUP_TYPE_CONTENT_DECODER) != NULL);
+    g_assert(soup_session_get_feature(session, WEBKIT_TYPE_SOUP_AUTH_DIALOG) == NULL);
+}
+
+int main(int argc, char** argv)
+{
+    g_thread_init(NULL);
+    gtk_test_init(&argc, &argv, NULL);
+
+    g_test_bug_base("https://bugs.webkit.org/");
+    g_test_add_func("/webkit/globals/default_session",
+                    test_globals_default_session);
+    return g_test_run();
+}
+
+#else
+int main(int argc, char** argv)
+{
+    g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
+    return 0;
+}
+
+#endif
diff --git a/WebKit/gtk/tests/testkeyevents.c b/WebKit/gtk/tests/testkeyevents.c
index ee7728c..b41a032 100644
--- a/WebKit/gtk/tests/testkeyevents.c
+++ b/WebKit/gtk/tests/testkeyevents.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Martin Robinson
+ * Copyright (C) 2009, 2010 Martin Robinson <mrobinson@webkit.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -22,12 +22,16 @@
 #include <string.h>
 #include <glib/gstdio.h>
 #include <webkit/webkit.h>
+#include <JavaScriptCore/JSStringRef.h>
+#include <JavaScriptCore/JSContextRef.h>
+
 
 #if GTK_CHECK_VERSION(2, 14, 0)
 
 typedef struct {
-  char* page;
-  gboolean shouldBeHandled;
+    char* page;
+    char* text;
+    gboolean shouldBeHandled;
 } TestInfo;
 
 typedef struct {
@@ -45,6 +49,7 @@
     info = g_slice_new(TestInfo);
     info->page = g_strdup(page);
     info->shouldBeHandled = shouldBeHandled;
+    info->text = 0;
 
     return info;
 }
@@ -53,6 +58,7 @@
 test_info_destroy(TestInfo* info)
 {
     g_free(info->page);
+    g_free(info->text);
     g_slice_free(TestInfo, info);
 }
 
@@ -82,7 +88,6 @@
     return FALSE;
 }
 
-
 static gboolean key_release_event_cb(WebKitWebView* webView, GdkEvent* event, gpointer data)
 {
     // WebCore never seems to mark keyup events as handled.
@@ -95,13 +100,18 @@
     return FALSE;
 }
 
-static void load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
+static void test_keypress_events_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
 {
     KeyEventFixture* fixture = (KeyEventFixture*)data;
     WebKitLoadStatus status = webkit_web_view_get_load_status(webView);
     if (status == WEBKIT_LOAD_FINISHED) {
-        gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
-                                 gdk_unicode_to_keyval('a'), 0);
+        g_signal_connect(fixture->webView, "key-press-event",
+                         G_CALLBACK(key_press_event_cb), fixture);
+        g_signal_connect(fixture->webView, "key-release-event",
+                         G_CALLBACK(key_release_event_cb), fixture);
+        if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                                      gdk_unicode_to_keyval('a'), 0))
+            g_assert_not_reached();
     }
 
 }
@@ -110,25 +120,14 @@
 {
     gtk_widget_grab_focus(widget);
     KeyEventFixture* fixture = (KeyEventFixture*)data;
-
-    g_signal_connect(fixture->webView, "key-press-event",
-                     G_CALLBACK(key_press_event_cb), fixture);
-    g_signal_connect(fixture->webView, "key-release-event",
-                     G_CALLBACK(key_release_event_cb), fixture);
-
-    g_signal_connect(fixture->webView, "notify::load-status",
-                     G_CALLBACK(load_status_cb), fixture);
-
     webkit_web_view_load_string(fixture->webView, fixture->info->page,
                                 "text/html", "utf-8", "file://");
-
     return FALSE;
 }
 
-static void test_keypress(KeyEventFixture* fixture, gconstpointer data)
+static void setup_keyevent_test(KeyEventFixture* fixture, gconstpointer data, GCallback load_event_callback)
 {
     fixture->info = (TestInfo*)data;
-
     g_signal_connect(fixture->window, "map-event",
                      G_CALLBACK(map_event_cb), fixture);
 
@@ -136,10 +135,172 @@
     gtk_widget_show(GTK_WIDGET(fixture->webView));
     gtk_window_present(GTK_WINDOW(fixture->window));
 
-    g_main_loop_run(fixture->loop);
+    g_signal_connect(fixture->webView, "notify::load-status",
+                     load_event_callback, fixture);
 
+    g_main_loop_run(fixture->loop);
 }
 
+static void test_keypress_events(KeyEventFixture* fixture, gconstpointer data)
+{
+    setup_keyevent_test(fixture, data, G_CALLBACK(test_keypress_events_load_status_cb));
+}
+
+static gboolean element_text_equal_to(JSContextRef context, const gchar* text)
+{
+    JSStringRef scriptString = JSStringCreateWithUTF8CString(
+      "window.document.getElementById(\"in\").value;");
+    JSValueRef value = JSEvaluateScript(context, scriptString, 0, 0, 0, 0);
+    JSStringRelease(scriptString);
+
+    // If the value isn't a string, the element is probably a div
+    // so grab the innerText instead.
+    if (!JSValueIsString(context, value)) {
+        JSStringRef scriptString = JSStringCreateWithUTF8CString(
+          "window.document.getElementById(\"in\").innerText;");
+        value = JSEvaluateScript(context, scriptString, 0, 0, 0, 0);
+        JSStringRelease(scriptString);
+    }
+
+    g_assert(JSValueIsString(context, value));
+    JSStringRef inputString = JSValueToStringCopy(context, value, 0);
+    g_assert(inputString);
+
+    gint size = JSStringGetMaximumUTF8CStringSize(inputString);
+    gchar* cString = g_malloc(size);
+    JSStringGetUTF8CString(inputString, cString, size);
+    JSStringRelease(inputString);
+
+    gboolean result = g_utf8_collate(cString, text) == 0;
+    g_free(cString);
+    return result;
+}
+
+static void test_ime_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
+{
+    KeyEventFixture* fixture = (KeyEventFixture*)data;
+    WebKitLoadStatus status = webkit_web_view_get_load_status(webView);
+    if (status != WEBKIT_LOAD_FINISHED)
+        return;
+
+    JSGlobalContextRef context = webkit_web_frame_get_global_context(
+        webkit_web_view_get_main_frame(webView));
+    g_assert(context);
+
+    GtkIMContext* imContext = 0;
+    g_object_get(webView, "im-context", &imContext, NULL);
+    g_assert(imContext);
+
+    // Test that commits that happen outside of key events
+    // change the text field immediately. This closely replicates
+    // the behavior of SCIM.
+    g_assert(element_text_equal_to(context, ""));
+    g_signal_emit_by_name(imContext, "commit", "a");
+    g_assert(element_text_equal_to(context, "a"));
+    g_signal_emit_by_name(imContext, "commit", "b");
+    g_assert(element_text_equal_to(context, "ab"));
+    g_signal_emit_by_name(imContext, "commit", "c");
+    g_assert(element_text_equal_to(context, "abc"));
+
+    g_object_unref(imContext);
+    g_main_loop_quit(fixture->loop);
+}
+
+static void test_ime(KeyEventFixture* fixture, gconstpointer data)
+{
+    setup_keyevent_test(fixture, data, G_CALLBACK(test_ime_load_status_cb));
+}
+
+static gboolean verify_contents(gpointer data)
+{
+    KeyEventFixture* fixture = (KeyEventFixture*)data;
+    JSGlobalContextRef context = webkit_web_frame_get_global_context(
+        webkit_web_view_get_main_frame(fixture->webView));
+    g_assert(context);
+
+    g_assert(element_text_equal_to(context, fixture->info->text));
+    g_main_loop_quit(fixture->loop);
+    return FALSE;
+}
+
+static void test_blocking_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
+{
+    KeyEventFixture* fixture = (KeyEventFixture*)data;
+    WebKitLoadStatus status = webkit_web_view_get_load_status(webView);
+    if (status != WEBKIT_LOAD_FINISHED)
+        return;
+
+    // The first keypress event should not modify the field.
+    fixture->info->text = g_strdup("bc");
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                                 gdk_unicode_to_keyval('a'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                                  gdk_unicode_to_keyval('b'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                                  gdk_unicode_to_keyval('c'), 0))
+        g_assert_not_reached();
+
+    g_idle_add(verify_contents, fixture);
+}
+
+static void test_blocking(KeyEventFixture* fixture, gconstpointer data)
+{
+    setup_keyevent_test(fixture, data, G_CALLBACK(test_blocking_load_status_cb));
+}
+
+#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)
+static void test_xim_load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data)
+{
+    KeyEventFixture* fixture = (KeyEventFixture*)data;
+    WebKitLoadStatus status = webkit_web_view_get_load_status(webView);
+    if (status != WEBKIT_LOAD_FINISHED)
+        return;
+
+    GtkIMContext* imContext = 0;
+    g_object_get(webView, "im-context", &imContext, NULL);
+    g_assert(imContext);
+
+    gchar* originalId = g_strdup(gtk_im_multicontext_get_context_id(GTK_IM_MULTICONTEXT(imContext)));
+    gtk_im_multicontext_set_context_id(GTK_IM_MULTICONTEXT(imContext), "xim");
+
+    // Test that commits that happen outside of key events
+    // change the text field immediately. This closely replicates
+    // the behavior of SCIM.
+    fixture->info->text = g_strdup("debian");
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                                 gdk_unicode_to_keyval('d'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                             gdk_unicode_to_keyval('e'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                             gdk_unicode_to_keyval('b'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                             gdk_unicode_to_keyval('i'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                             gdk_unicode_to_keyval('a'), 0))
+        g_assert_not_reached();
+    if (!gtk_test_widget_send_key(GTK_WIDGET(fixture->webView),
+                             gdk_unicode_to_keyval('n'), 0))
+        g_assert_not_reached();
+
+    gtk_im_multicontext_set_context_id(GTK_IM_MULTICONTEXT(imContext), originalId);
+    g_free(originalId);
+    g_object_unref(imContext);
+
+    g_idle_add(verify_contents, fixture);
+}
+
+static void test_xim(KeyEventFixture* fixture, gconstpointer data)
+{
+    setup_keyevent_test(fixture, data, G_CALLBACK(test_xim_load_status_cb));
+}
+#endif
+
 int main(int argc, char** argv)
 {
     g_thread_init(NULL);
@@ -147,30 +308,85 @@
 
     g_test_bug_base("https://bugs.webkit.org/");
 
-    g_test_add("/webkit/keyevent/textfield", KeyEventFixture,
-               test_info_new("<html><body><input id=\"in\" type=\"text\">"
-                             "<script>document.getElementById('in').focus();"
-                             "</script></body></html>", TRUE),
-               key_event_fixture_setup,
-               test_keypress,
-               key_event_fixture_teardown);
 
-    g_test_add("/webkit/keyevent/buttons", KeyEventFixture,
-               test_info_new("<html><body><input id=\"in\" type=\"button\">"
-                             "<script>document.getElementById('in').focus();"
-                             "</script></body></html>", FALSE),
-               key_event_fixture_setup,
-               test_keypress,
-               key_event_fixture_teardown);
+    // We'll test input on a slew of different node types. Key events to
+    // text inputs and editable divs should be marked as handled. Key events
+    // to buttons and links should not.
+    const char* textinput_html = "<html><body><input id=\"in\" type=\"text\">"
+        "<script>document.getElementById('in').focus();</script></body></html>";
+    const char* button_html = "<html><body><input id=\"in\" type=\"button\">"
+        "<script>document.getElementById('in').focus();</script></body></html>";
+    const char* link_html = "<html><body><a href=\"http://www.gnome.org\" id=\"in\">"
+        "LINKY MCLINKERSON</a><script>document.getElementById('in').focus();</script>"
+        "</body></html>";
+    const char* div_html = "<html><body><div id=\"in\" contenteditable=\"true\">"
+        "<script>document.getElementById('in').focus();</script></body></html>";
 
-    g_test_add("/webkit/keyevent/link", KeyEventFixture,
-               test_info_new("<html><body><a href=\"http://www.gnome.org\" id=\"in\">"
-                             "LINKY MCLINKERSON</a><script>"
-                             "document.getElementById('in').focus();</script>"
-                             "</body></html>", FALSE),
+    // These are similar to the blocks above, but they should block the first
+    // keypress modifying the editable node.
+    const char* textinput_html_blocking = "<html><body>"
+        "<input id=\"in\" type=\"text\" "
+        "onkeypress=\"if (first) {event.preventDefault();first=false;}\">"
+        "<script>first = true;\ndocument.getElementById('in').focus();</script>\n"
+        "</script></body></html>";
+    const char* div_html_blocking = "<html><body>"
+        "<div id=\"in\" contenteditable=\"true\" "
+        "onkeypress=\"if (first) {event.preventDefault();first=false;}\">"
+        "<script>first = true; document.getElementById('in').focus();</script>\n"
+        "</script></body></html>";
+
+    g_test_add("/webkit/keyevents/event-textinput", KeyEventFixture,
+               test_info_new(textinput_html, TRUE),
                key_event_fixture_setup,
-               test_keypress,
+               test_keypress_events,
                key_event_fixture_teardown);
+    g_test_add("/webkit/keyevents/event-buttons", KeyEventFixture,
+               test_info_new(button_html, FALSE),
+               key_event_fixture_setup,
+               test_keypress_events,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevents/event-link", KeyEventFixture,
+               test_info_new(link_html, FALSE),
+               key_event_fixture_setup,
+               test_keypress_events,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/event-div", KeyEventFixture,
+               test_info_new(div_html, TRUE),
+               key_event_fixture_setup,
+               test_keypress_events,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/ime-textinput", KeyEventFixture,
+               test_info_new(textinput_html, TRUE),
+               key_event_fixture_setup,
+               test_ime,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/ime-div", KeyEventFixture,
+               test_info_new(div_html, TRUE),
+               key_event_fixture_setup,
+               test_ime,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/block-textinput", KeyEventFixture,
+               test_info_new(textinput_html_blocking, TRUE),
+               key_event_fixture_setup,
+               test_blocking,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/block-div", KeyEventFixture,
+               test_info_new(div_html_blocking, TRUE),
+               key_event_fixture_setup,
+               test_blocking,
+               key_event_fixture_teardown);
+#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 16, 0)
+    g_test_add("/webkit/keyevent/xim-textinput", KeyEventFixture,
+               test_info_new(textinput_html, TRUE),
+               key_event_fixture_setup,
+               test_xim,
+               key_event_fixture_teardown);
+    g_test_add("/webkit/keyevent/xim-div", KeyEventFixture,
+               test_info_new(div_html, TRUE),
+               key_event_fixture_setup,
+               test_xim,
+               key_event_fixture_teardown);
+#endif
 
     return g_test_run();
 }
diff --git a/WebKit/gtk/tests/testmimehandling.c b/WebKit/gtk/tests/testmimehandling.c
index e6e8d45..2ab0257 100644
--- a/WebKit/gtk/tests/testmimehandling.c
+++ b/WebKit/gtk/tests/testmimehandling.c
@@ -18,6 +18,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
+#include "test_utils.h"
+
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <libsoup/soup.h>
@@ -182,16 +184,7 @@
     gtk_test_init(&argc, &argv, NULL);
 
     /* Hopefully make test independent of the path it's called from. */
-    while (!g_file_test ("WebKit/gtk/tests/resources/test.html", G_FILE_TEST_EXISTS)) {
-        gchar *path_name;
-
-        g_chdir("..");
-
-        g_assert(!g_str_equal((path_name = g_get_current_dir()), "/"));
-        g_free(path_name);
-    }
-
-    g_chdir("WebKit/gtk/tests/resources/");
+    testutils_relative_chdir("WebKit/gtk/tests/resources/test.html", argv[0]);
 
     server = soup_server_new(SOUP_SERVER_PORT, 0, NULL);
     soup_server_run_async(server);
diff --git a/WebKit/gtk/tests/testwebbackforwardlist.c b/WebKit/gtk/tests/testwebbackforwardlist.c
index 115c079..2109840 100644
--- a/WebKit/gtk/tests/testwebbackforwardlist.c
+++ b/WebKit/gtk/tests/testwebbackforwardlist.c
@@ -266,6 +266,54 @@
     g_object_unref(webView);
 }
 
+static void test_webkit_web_back_forward_list_clear(void)
+{
+    WebKitWebView* webView;
+    WebKitWebBackForwardList* webBackForwardList;
+    WebKitWebHistoryItem* addItem;
+    g_test_bug("36173");
+
+    webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    g_object_ref_sink(webView);
+
+    webBackForwardList = webkit_web_view_get_back_forward_list(webView);
+    g_assert(webBackForwardList);
+
+    // Check that there is no item.
+    g_assert_cmpint(webkit_web_back_forward_list_get_forward_length(webBackForwardList), ==, 0);
+    g_assert_cmpint(webkit_web_back_forward_list_get_back_length(webBackForwardList), ==, 0);
+    g_assert(!webkit_web_back_forward_list_get_current_item(webBackForwardList));
+    g_assert(!webkit_web_view_can_go_forward(webView));
+    g_assert(!webkit_web_view_can_go_back(webView));
+
+    // Check that clearing the empty list does not modify counters
+    webkit_web_back_forward_list_clear(webBackForwardList);
+    g_assert_cmpint(webkit_web_back_forward_list_get_forward_length(webBackForwardList), ==, 0);
+    g_assert_cmpint(webkit_web_back_forward_list_get_back_length(webBackForwardList), ==, 0);
+    g_assert(!webkit_web_back_forward_list_get_current_item(webBackForwardList));
+    g_assert(!webkit_web_view_can_go_forward(webView));
+    g_assert(!webkit_web_view_can_go_back(webView));
+
+    // Add a new item
+    addItem = webkit_web_history_item_new_with_data("http://example.com/", "Added site");
+    webkit_web_back_forward_list_add_item(webBackForwardList, addItem);
+    g_object_unref(addItem);
+    g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, addItem));
+
+    // Check that after clearing the list the added item is no longer in the list
+    webkit_web_back_forward_list_clear(webBackForwardList);
+    g_assert(!webkit_web_back_forward_list_contains_item(webBackForwardList, addItem));
+
+    // Check that after clearing it, the list is empty
+    g_assert_cmpint(webkit_web_back_forward_list_get_forward_length(webBackForwardList), ==, 0);
+    g_assert_cmpint(webkit_web_back_forward_list_get_back_length(webBackForwardList), ==, 0);
+    g_assert(!webkit_web_back_forward_list_get_current_item(webBackForwardList));
+    g_assert(!webkit_web_view_can_go_forward(webView));
+    g_assert(!webkit_web_view_can_go_back(webView));
+
+    g_object_unref(webView);
+}
+
 int main(int argc, char** argv)
 {
     g_thread_init(NULL);
@@ -275,6 +323,7 @@
     g_test_add_func("/webkit/webbackforwardlist/add_item", test_webkit_web_back_forward_list_add_item);
     g_test_add_func("/webkit/webbackforwardlist/list_order", test_webkit_web_back_forward_list_order);
     g_test_add_func("/webkit/webhistoryitem/lifetime", test_webkit_web_history_item_lifetime);
+    g_test_add_func("/webkit/webbackforwardlist/clear", test_webkit_web_back_forward_list_clear);
     return g_test_run ();
 }
 
diff --git a/WebKit/gtk/tests/testwebview.c b/WebKit/gtk/tests/testwebview.c
index 34b6867..36511d7 100644
--- a/WebKit/gtk/tests/testwebview.c
+++ b/WebKit/gtk/tests/testwebview.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2008 Holger Hans Peter Freyther
- * Copyright (C) 2009 Collabora Ltd.
+ * Copyright (C) 2009, 2010 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -18,6 +18,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
+#include "test_utils.h"
+
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
@@ -56,10 +58,10 @@
 
         soup_message_body_append(msg->response_body, SOUP_MEMORY_TAKE, contents, length);
     } else if (g_str_equal(path, "/bigdiv.html")) {
-        char* contents = g_strdup("<html><body><div style=\"background-color: green; height: 1200px;\"></div></body></html>");
+        char* contents = g_strdup("<html><body><a id=\"link\" href=\"http://abc.def\">test</a><div style=\"background-color: green; height: 1200px;\"></div></body></html>");
         soup_message_body_append(msg->response_body, SOUP_MEMORY_TAKE, contents, strlen(contents));
     } else if (g_str_equal(path, "/iframe.html")) {
-        char* contents = g_strdup("<html><body><div style=\"background-color: green; height: 50px;\"></div><iframe src=\"bigdiv.html\"></iframe></body></html>");
+        char* contents = g_strdup("<html><body id=\"some-content\"><div style=\"background-color: green; height: 50px;\"></div><iframe src=\"bigdiv.html\"></iframe></body></html>");
         soup_message_body_append(msg->response_body, SOUP_MEMORY_TAKE, contents, strlen(contents));
     } else {
         char* contents = g_strdup("<html><body>test</body></html>");
@@ -135,6 +137,61 @@
     return FALSE;
 }
 
+static void test_webkit_web_view_grab_focus()
+{
+    char* uri = g_strconcat(base_uri, "iframe.html", NULL);
+    GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP);
+    GtkWidget* scrolled_window = gtk_scrolled_window_new(NULL, NULL);
+    WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+    GtkAdjustment* adjustment;
+
+    gtk_window_set_default_size(GTK_WINDOW(window), 400, 200);
+
+    gtk_container_add(GTK_CONTAINER(window), scrolled_window);
+    gtk_container_add(GTK_CONTAINER(scrolled_window), GTK_WIDGET(view));
+
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+    loop = g_main_loop_new(NULL, TRUE);
+
+    g_signal_connect(view, "notify::progress", G_CALLBACK (idle_quit_loop_cb), NULL);
+
+    /* Wait for window to show up */
+    gtk_widget_show_all(window);
+    g_signal_connect(window, "map-event",
+                     G_CALLBACK(map_event_cb), loop);
+    g_main_loop_run(loop);
+
+    /* Load a page with a big div that will cause scrollbars to appear */
+    webkit_web_view_load_uri(view, uri);
+    g_main_loop_run(loop);
+
+    adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolled_window));
+    g_assert_cmpfloat(gtk_adjustment_get_value(adjustment), ==, 0.0);
+
+    /* Since webkit_web_view_execute_script does not return a value,
+       it is impossible to know if an inner document has focus after
+       a node of it was focused via .focus() method.
+       The code below is an workaround: if the node has focus, a scroll
+       action is performed and afterward it is checked if the adjustment
+       has to be different from 0.
+    */
+    char script[] = "var innerDoc = document.defaultView.frames[0].document; \
+                     innerDoc.getElementById(\"link\").focus();              \
+                     if (innerDoc.hasFocus())                                \
+                        window.scrollBy(0, 100);";
+
+    /* Focus an element using JavaScript */
+    webkit_web_view_execute_script(view, script);
+
+    /* Make sure the ScrolledWindow noticed the scroll */
+    g_assert_cmpfloat(gtk_adjustment_get_value(adjustment), !=, 0.0);
+
+    g_free(uri);
+    gtk_widget_destroy(window);
+}
+
 static void do_test_webkit_web_view_adjustments(gboolean with_page_cache)
 {
     char* effective_uri = g_strconcat(base_uri, "bigdiv.html", NULL);
@@ -224,6 +281,61 @@
     do_test_webkit_web_view_adjustments(TRUE);
 }
 
+gboolean delayed_destroy(gpointer data)
+{
+    gtk_widget_destroy(GTK_WIDGET(data));
+    g_main_loop_quit(loop);
+    return FALSE;
+}
+
+static void test_webkit_web_view_destroy()
+{
+    GtkWidget* window;
+    GtkWidget* web_view;
+
+    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    web_view = webkit_web_view_new();
+
+    gtk_container_add(GTK_CONTAINER(window), web_view);
+
+    gtk_widget_show_all(window);
+
+    loop = g_main_loop_new(NULL, TRUE);
+
+    g_signal_connect(window, "map-event",
+                     G_CALLBACK(map_event_cb), loop);
+    g_main_loop_run(loop);
+
+    g_idle_add(delayed_destroy, web_view);
+    g_main_loop_run(loop);
+
+    gtk_widget_destroy(window);
+}
+
+static void test_webkit_web_view_window_features()
+{
+    GtkWidget* window;
+    GtkWidget* web_view;
+    
+    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    web_view = webkit_web_view_new();
+    
+    gtk_container_add(GTK_CONTAINER(window), web_view);
+    
+    gtk_widget_show_all(window);
+    
+    loop = g_main_loop_new(NULL, TRUE);
+
+    g_signal_connect(window, "map-event",
+                     G_CALLBACK(map_event_cb), loop);
+    g_main_loop_run(loop);
+    
+    /* Bug #36144 */
+    g_object_set(G_OBJECT(web_view), "window-features", NULL, NULL);
+    
+    gtk_widget_destroy(window);
+}    
+
 int main(int argc, char** argv)
 {
     SoupServer* server;
@@ -233,16 +345,7 @@
     gtk_test_init(&argc, &argv, NULL);
 
     /* Hopefully make test independent of the path it's called from. */
-    while (!g_file_test ("WebKit/gtk/tests/resources/test.html", G_FILE_TEST_EXISTS)) {
-        gchar *path_name;
-
-        g_chdir("..");
-
-        g_assert(!g_str_equal((path_name = g_get_current_dir()), "/"));
-        g_free(path_name);
-    }
-
-    g_chdir("WebKit/gtk/tests/resources/");
+    testutils_relative_chdir("WebKit/gtk/tests/resources/test.html", argv[0]);
 
     server = soup_server_new(SOUP_SERVER_PORT, 0, NULL);
     soup_server_run_async(server);
@@ -258,6 +361,9 @@
     g_test_bug_base("https://bugs.webkit.org/");
     g_test_add_func("/webkit/webview/icon-uri", test_webkit_web_view_icon_uri);
     g_test_add_func("/webkit/webview/adjustments", test_webkit_web_view_adjustments);
+    g_test_add_func("/webkit/webview/destroy", test_webkit_web_view_destroy);
+    g_test_add_func("/webkit/webview/grab_focus", test_webkit_web_view_grab_focus);
+    g_test_add_func("/webkit/webview/window-features", test_webkit_web_view_window_features);
 
     return g_test_run ();
 }
diff --git a/WebKit/gtk/webkit/webkit.h b/WebKit/gtk/webkit/webkit.h
index 4cd0709..17b197b 100644
--- a/WebKit/gtk/webkit/webkit.h
+++ b/WebKit/gtk/webkit/webkit.h
@@ -24,6 +24,7 @@
 #include <webkit/webkitversion.h>
 #include <webkit/webkitdefines.h>
 #include <webkit/webkitdownload.h>
+#include <webkit/webkitgeolocationpolicydecision.h>
 #include <webkit/webkithittestresult.h>
 #include <webkit/webkitnetworkrequest.h>
 #include <webkit/webkitnetworkresponse.h>
diff --git a/WebKit/gtk/webkit/webkitdefines.h b/WebKit/gtk/webkit/webkitdefines.h
index a5884f3..b06a3bf 100644
--- a/WebKit/gtk/webkit/webkitdefines.h
+++ b/WebKit/gtk/webkit/webkitdefines.h
@@ -89,6 +89,9 @@
 typedef struct _WebKitHitTestResult WebKitHitTestResult;
 typedef struct _WebKitHitTestResultClass WebKitHitTestResultClass;
 
+typedef struct _WebKitGeolocationPolicyDecision WebKitGeolocationPolicyDecision;
+typedef struct _WebKitGeolocationPolicyDecisionClass WebKitGeolocationPolicyDecisionClass;
+
 G_END_DECLS
 
 #endif
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index 8f3214e..0717e7c 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "CString.h"
 #include <glib/gi18n-lib.h>
 #include "GRefPtr.h"
 #include "Noncopyable.h"
@@ -34,9 +33,14 @@
 #include "webkitmarshal.h"
 #include "webkitnetworkresponse.h"
 #include "webkitprivate.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gstdio.h>
 
+#ifdef ERROR
+#undef ERROR
+#endif
+
 using namespace WebKit;
 using namespace WebCore;
 
@@ -149,8 +153,10 @@
 
     // The download object may never have _start called on it, so we
     // need to make sure timer is non-NULL.
-    if (priv->timer)
+    if (priv->timer) {
         g_timer_destroy(priv->timer);
+        priv->timer = NULL;
+    }
 
     g_free(priv->destinationURI);
     g_free(priv->suggestedFilename);
@@ -480,7 +486,7 @@
     g_return_if_fail(priv->timer == NULL);
 
     if (!priv->resourceHandle)
-        priv->resourceHandle = ResourceHandle::create(core(priv->networkRequest), priv->downloadClient, 0, false, false, false);
+        priv->resourceHandle = ResourceHandle::create(core(priv->networkRequest), priv->downloadClient, 0, false, false);
     else {
         priv->resourceHandle->setClient(priv->downloadClient);
 
diff --git a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
new file mode 100644
index 0000000..7afd8fa
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2010 Arno Renevier
+ *
+ * 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 "webkitgeolocationpolicydecision.h"
+
+#include "webkitprivate.h"
+#include "Geolocation.h"
+
+using namespace WebKit;
+using namespace WebCore;
+
+/**
+ * SECTION:webkitgeolocationpolicydecision
+ * @short_description: Liaison between WebKit and the application regarding asynchronous geolocation policy decisions
+ *
+ * #WebKitGeolocationPolicyDecision objects are given to the application when
+ * geolocation-policy-decision-requested signal is emitted. The application
+ * uses it to tell the engine whether it wants to allow or deny geolocation for
+ * a given frame.
+ */
+
+G_DEFINE_TYPE(WebKitGeolocationPolicyDecision, webkit_geolocation_policy_decision, G_TYPE_OBJECT);
+
+struct _WebKitGeolocationPolicyDecisionPrivate {
+    WebKitWebFrame* frame;
+    Geolocation* geolocation;
+};
+
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate))
+
+static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass)
+{
+    g_type_class_add_private(decisionClass, sizeof(WebKitGeolocationPolicyDecisionPrivate));
+}
+
+static void webkit_geolocation_policy_decision_init(WebKitGeolocationPolicyDecision* decision)
+{
+    decision->priv = WEBKIT_GEOLOCATION_POLICY_DECISION_GET_PRIVATE(decision);
+}
+
+WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, Geolocation* geolocation)
+{
+    g_return_val_if_fail(frame, NULL);
+    WebKitGeolocationPolicyDecision* decision = WEBKIT_GEOLOCATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, NULL));
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+
+    priv->frame = frame;
+    priv->geolocation = geolocation;
+    return decision;
+}
+
+/**
+ * webkit_geolocation_policy_allow
+ * @decision: a #WebKitGeolocationPolicyDecision
+ *
+ * Will send the allow decision to the policy implementer.
+ *
+ * Since: 1.1.23
+ */
+void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
+
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+    priv->geolocation->setIsAllowed(TRUE);
+}
+
+/**
+ * webkit_geolocation_policy_deny
+ * @decision: a #WebKitGeolocationPolicyDecision
+ *
+ * Will send the deny decision to the policy implementer.
+ *
+ * Since: 1.1.23
+ */
+void webkit_geolocation_policy_deny(WebKitGeolocationPolicyDecision* decision)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
+
+    WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
+    priv->geolocation->setIsAllowed(FALSE);
+}
+
diff --git a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h
new file mode 100644
index 0000000..27e0ef2
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Arno Renevier
+ *
+ * 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 webkitgeolocationpolicydecision_h
+#define webkitgeolocationpolicydecision_h
+
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION            (webkit_geolocation_policy_decision_get_type())
+#define WEBKIT_GEOLOCATION_POLICY_DECISION(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecision))
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionClass))
+#define WEBKIT_IS_GEOLOCATION_POLICY_DECISION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION))
+#define WEBKIT_IS_GEOLOCATION_POLICY_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION))
+#define WEBKIT_GEOLOCATION_POLICY_DECISION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionClass))
+
+typedef struct _WebKitGeolocationPolicyDecisionPrivate WebKitGeolocationPolicyDecisionPrivate;
+struct _WebKitGeolocationPolicyDecision {
+    GObject parent_instance;
+
+    /*< private >*/
+    WebKitGeolocationPolicyDecisionPrivate* priv;
+};
+
+struct _WebKitGeolocationPolicyDecisionClass {
+    GObjectClass parent_class;
+
+    /* Padding for future expansion */
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_geolocation_policy_decision_get_type (void);
+
+WEBKIT_API void
+webkit_geolocation_policy_allow (WebKitGeolocationPolicyDecision* decision);
+
+WEBKIT_API void
+webkit_geolocation_policy_deny (WebKitGeolocationPolicyDecision* decision);
+
+G_END_DECLS
+
+#endif
diff --git a/WebKit/gtk/webkit/webkithittestresult.cpp b/WebKit/gtk/webkit/webkithittestresult.cpp
index be97933..1f8dce6 100644
--- a/WebKit/gtk/webkit/webkithittestresult.cpp
+++ b/WebKit/gtk/webkit/webkithittestresult.cpp
@@ -21,10 +21,10 @@
 #include "config.h"
 #include "webkithittestresult.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "webkitenumtypes.h"
 #include "webkitprivate.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.cpp b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
index be6d5ff..78044aa 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -21,10 +21,10 @@
 #include "config.h"
 #include "webkitnetworkrequest.h"
 
-#include "CString.h"
 #include "GOwnPtr.h"
 #include "ResourceRequest.h"
 #include "webkitprivate.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index be88bb5..971922f 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -28,6 +28,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClientGtk.h"
+#include "GtkVersioning.h"
 #include "HitTestResult.h"
 #include "IconDatabase.h"
 #include <libintl.h>
@@ -223,11 +224,7 @@
         return NULL;
 
     GtkWidget* toplevel =  gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformPageClient()));
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_toplevel(toplevel))
-#else
-    if (GTK_WIDGET_TOPLEVEL(toplevel))
-#endif
         return toplevel;
     else
         return NULL;
@@ -296,10 +293,10 @@
 
 void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)
 {
-    SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+    SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
 }
 
 void webkit_reset_origin_access_white_lists()
 {
-    SecurityOrigin::resetOriginAccessWhiteLists();
+    SecurityOrigin::resetOriginAccessWhitelists();
 }
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index 44b4d0c..2642d50 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -46,9 +46,9 @@
 
 #include "ArchiveResource.h"
 #include "BackForwardList.h"
-#include "CString.h"
 #include <enchant.h>
 #include "GOwnPtr.h"
+#include "Geolocation.h"
 #include "HistoryItem.h"
 #include "Settings.h"
 #include "Page.h"
@@ -60,6 +60,7 @@
 #include "ResourceResponse.h"
 #include "WindowFeatures.h"
 #include "SecurityOrigin.h"
+#include <wtf/text/CString.h>
 
 #include <atk/atk.h>
 #include <glib.h>
@@ -102,11 +103,6 @@
     WebKit::PasteboardHelperGtk* pasteboardHelperInstance();
 }
 
-typedef struct {
-    EnchantBroker* config;
-    EnchantDict* speller;
-} SpellLanguage;
-
 extern "C" {
     void webkit_init();
 
@@ -276,6 +272,9 @@
     WebKitNetworkResponse*
     webkit_network_response_new_with_core_response(const WebCore::ResourceResponse& resourceResponse);
 
+    WebKitGeolocationPolicyDecision*
+    webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
+
     // FIXME: move this to webkitnetworkrequest.h once the API is agreed upon.
     WEBKIT_API SoupMessage*
     webkit_network_request_get_message(WebKitNetworkRequest* request);
@@ -301,6 +300,9 @@
     WEBKIT_API int
     webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight);
 
+    WEBKIT_API int
+    webkit_web_frame_number_of_pages(WebKitWebFrame* frame, float pageWidth, float pageHeight);
+
     WEBKIT_API guint
     webkit_web_frame_get_pending_unload_event_count(WebKitWebFrame* frame);
 
@@ -313,6 +315,9 @@
     WEBKIT_API bool
     webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* animationId, double time, const gchar* elementId);
 
+    WEBKIT_API gchar*
+    webkit_web_frame_marker_text_for_list_item(WebKitWebFrame* frame, JSContextRef context, JSValueRef nodeObject);
+
     WEBKIT_API unsigned int
     webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
 
@@ -332,7 +337,7 @@
     webkit_web_settings_add_extra_plugin_directory (WebKitWebView *web_view, const gchar* directory);
 
     GSList*
-    webkit_web_settings_get_spell_languages(WebKitWebView* web_view);
+    webkit_web_settings_get_enchant_dicts(WebKitWebView* web_view);
 
     bool
     webkit_web_view_use_primary_for_paste(WebKitWebView* web_view);
diff --git a/WebKit/gtk/webkit/webkitsecurityorigin.cpp b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
index cd80236..0ab0a9c 100644
--- a/WebKit/gtk/webkit/webkitsecurityorigin.cpp
+++ b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
@@ -22,9 +22,9 @@
 
 #include "webkitprivate.h"
 
-#include "CString.h"
 #include "PlatformString.h"
 #include "DatabaseTracker.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 
@@ -353,7 +353,7 @@
  *
  * Returns a list of all Web Databases in the security origin.
  *
- * Returns: a #Glist of databases in the security origin.
+ * Returns: a #GList of databases in the security origin.
  *
  * Since: 1.1.14
  **/
diff --git a/WebKit/gtk/webkit/webkitsoupauthdialog.c b/WebKit/gtk/webkit/webkitsoupauthdialog.c
index 538dbfa..15863b3 100644
--- a/WebKit/gtk/webkit/webkitsoupauthdialog.c
+++ b/WebKit/gtk/webkit/webkitsoupauthdialog.c
@@ -190,8 +190,12 @@
     GtkWidget* vbox;
     GtkWidget* icon;
     GtkWidget* table;
-    GtkWidget* messageLabel;
-    char* message;
+    GtkWidget* serverMessageDescriptionLabel;
+    GtkWidget* serverMessageLabel;
+    GtkWidget* descriptionLabel;
+    char* description;
+    const char* realm;
+    gboolean hasRealm;
     SoupURI* uri;
     GtkWidget* rememberBox;
     GtkWidget* checkButton;
@@ -241,12 +245,12 @@
     gtk_box_pack_start(GTK_BOX(hbox), mainVBox, TRUE, TRUE, 0);
 
     uri = soup_message_get_uri(authData->msg);
-    message = g_strdup_printf(_("A username and password are being requested by the site %s"), uri->host);
-    messageLabel = gtk_label_new(message);
-    g_free(message);
-    gtk_misc_set_alignment(GTK_MISC(messageLabel), 0.0, 0.5);
-    gtk_label_set_line_wrap(GTK_LABEL(messageLabel), TRUE);
-    gtk_box_pack_start(GTK_BOX(mainVBox), GTK_WIDGET(messageLabel),
+    description = g_strdup_printf(_("A username and password are being requested by the site %s"), uri->host);
+    descriptionLabel = gtk_label_new(description);
+    g_free(description);
+    gtk_misc_set_alignment(GTK_MISC(descriptionLabel), 0.0, 0.5);
+    gtk_label_set_line_wrap(GTK_LABEL(descriptionLabel), TRUE);
+    gtk_box_pack_start(GTK_BOX(mainVBox), GTK_WIDGET(descriptionLabel),
                        FALSE, FALSE, 0);
 
     vbox = gtk_vbox_new(FALSE, 6);
@@ -261,14 +265,32 @@
     gtk_box_pack_start(GTK_BOX(vbox), entryContainer,
                        FALSE, FALSE, 0);
 
-    table = gtk_table_new(2, 2, FALSE);
+    realm = soup_auth_get_realm(authData->auth);
+    // Checking that realm is not an empty string
+    hasRealm = (realm && (strlen(realm) > 0));
+
+    table = gtk_table_new(hasRealm ? 3 : 2, 2, FALSE);
     gtk_table_set_col_spacings(GTK_TABLE(table), 12);
     gtk_table_set_row_spacings(GTK_TABLE(table), 6);
     gtk_container_add(GTK_CONTAINER(entryContainer), table);
 
-    authData->loginEntry = table_add_entry(table, 0, _("Username:"),
+    if (hasRealm) {
+        serverMessageDescriptionLabel = gtk_label_new(_("Server message:"));
+        serverMessageLabel = gtk_label_new(realm);
+        gtk_misc_set_alignment(GTK_MISC(serverMessageDescriptionLabel), 0.0, 0.5);
+        gtk_label_set_line_wrap(GTK_LABEL(serverMessageDescriptionLabel), TRUE);
+        gtk_misc_set_alignment(GTK_MISC(serverMessageLabel), 0.0, 0.5);
+        gtk_label_set_line_wrap(GTK_LABEL(serverMessageLabel), TRUE);
+
+        gtk_table_attach_defaults(GTK_TABLE(table), serverMessageDescriptionLabel,
+                                  0, 1, 0, 1);
+        gtk_table_attach_defaults(GTK_TABLE(table), serverMessageLabel,
+                                  1, 2, 0, 1);
+    }
+
+    authData->loginEntry = table_add_entry(table, hasRealm ? 1 : 0, _("Username:"),
                                            login, NULL);
-    authData->passwordEntry = table_add_entry(table, 1, _("Password:"),
+    authData->passwordEntry = table_add_entry(table, hasRealm ? 2 : 1, _("Password:"),
                                               password, NULL);
 
     gtk_entry_set_visibility(GTK_ENTRY(authData->passwordEntry), FALSE);
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index 31631a5..b23aeb9 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -252,7 +252,7 @@
 
 /**
  * webkit_web_back_forward_list_get_back_item:
- * @web_back_forward_list: a #WebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
  *
  * Returns the item that precedes the current item
  *
@@ -383,7 +383,7 @@
  *
  * Returns the maximum limit of the back forward list.
  *
- * Return value: a #gint indicating the number of #WebHistoryItem the back forward list can hold
+ * Return value: a #gint indicating the number of #WebKitWebHistoryItem the back forward list can hold
  */
 gint webkit_web_back_forward_list_get_limit(WebKitWebBackForwardList* webBackForwardList)
 {
@@ -438,6 +438,29 @@
     backForwardList->addItem(historyItem);
 }
 
+/**
+ * webkit_web_back_forward_list_clear:
+ * @webBackForwardList:  a #WebKitWebBackForwardList
+ *
+ * Clears the @webBackForwardList by removing all its elements. Note that not even
+ * the current page is kept in list when cleared so you would have to add it later.
+ *
+ * Since: 1.1.30
+ **/
+void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForwardList)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
+
+    WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+    if (!backForwardList || !backForwardList->enabled() || !backForwardList->entries().size())
+        return;
+
+    // Clear the current list by setting capacity to 0
+    int capacity = backForwardList->capacity();
+    backForwardList->setCapacity(0);
+    backForwardList->setCapacity(capacity);
+}
+
 WebCore::BackForwardList* WebKit::core(WebKitWebBackForwardList* webBackForwardList)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
index d08566e..2cffc68 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
@@ -110,6 +110,8 @@
 WEBKIT_API void
 webkit_web_back_forward_list_add_item                    (WebKitWebBackForwardList *web_back_forward_list,
                                                           WebKitWebHistoryItem     *history_item);
+WEBKIT_API void
+webkit_web_back_forward_list_clear                       (WebKitWebBackForwardList *web_back_forward_list);
 
 G_END_DECLS
 
diff --git a/WebKit/gtk/webkit/webkitwebdatabase.cpp b/WebKit/gtk/webkit/webkitwebdatabase.cpp
index 100176e..e92c400 100644
--- a/WebKit/gtk/webkit/webkitwebdatabase.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatabase.cpp
@@ -22,9 +22,9 @@
 
 #include "webkitprivate.h"
 
-#include "CString.h"
 #include "DatabaseDetails.h"
 #include "DatabaseTracker.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/WebKit/gtk/webkit/webkitwebdatasource.cpp b/WebKit/gtk/webkit/webkitwebdatasource.cpp
index 059688e..9b755ad 100644
--- a/WebKit/gtk/webkit/webkitwebdatasource.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatasource.cpp
@@ -418,9 +418,9 @@
  * @data_source: a #WebKitWebDataSource
  *
  * Gives you a #GList of #WebKitWebResource objects that compose the
- * #WebView to which this #WebKitWebDataSource is attached.
+ * #WebKitWebView to which this #WebKitWebDataSource is attached.
  *
- * Return value: a #GList of #WebKitResource objects; the objects are
+ * Return value: a #GList of #WebKitWebResource objects; the objects are
  * owned by WebKit, but the GList must be freed.
  *
  * Since: 1.1.15
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index fbd246d..344f94e 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -35,7 +35,6 @@
 #include "AccessibilityObjectWrapperAtk.h"
 #include "AnimationController.h"
 #include "AXObjectCache.h"
-#include "CString.h"
 #include "DocumentLoader.h"
 #include "DocumentLoaderGtk.h"
 #include "FrameLoader.h"
@@ -45,10 +44,13 @@
 #include <glib/gi18n-lib.h>
 #include "GCController.h"
 #include "GraphicsContext.h"
+#include "GtkVersioning.h"
 #include "HTMLFrameOwnerElement.h"
 #include "JSDOMWindow.h"
+#include "JSElement.h"
 #include "JSLock.h"
 #include "PrintContext.h"
+#include "RenderListItem.h"
 #include "RenderView.h"
 #include "RenderTreeAsText.h"
 #include "JSDOMBinding.h"
@@ -60,6 +62,7 @@
 
 #include <atk/atk.h>
 #include <JavaScriptCore/APICast.h>
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkitwebframe
@@ -867,6 +870,25 @@
 }
 
 /**
+ * webkit_web_frame_number_of_pages
+ * @frame: a #WebKitWebFrame
+ * @pageWidth: width of a page
+ * @pageHeight: height of a page
+ *
+ * Return value: The number of pages to be printed.
+ */
+int webkit_web_frame_number_of_pages(WebKitWebFrame* frame, float pageWidth, float pageHeight)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+    Frame* coreFrame = core(frame);
+    if (!coreFrame)
+        return -1;
+
+    return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidth, pageHeight));
+}
+
+/**
  * webkit_web_frame_get_pending_unload_event_count:
  * @frame: a #WebKitWebFrame
  *
@@ -923,7 +945,7 @@
  * @action: the #GtkPrintOperationAction to be performed
  * @error: #GError for error return
  *
- * Prints the given #WebKitFrame, using the given #GtkPrintOperation
+ * Prints the given #WebKitWebFrame, using the given #GtkPrintOperation
  * and #GtkPrintOperationAction. This function wraps a call to
  * gtk_print_operation_run() for printing the contents of the
  * #WebKitWebFrame.
@@ -937,11 +959,7 @@
 
     GtkWidget* topLevel = gtk_widget_get_toplevel(GTK_WIDGET(webkit_web_frame_get_web_view(frame)));
 
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (!gtk_widget_is_toplevel(topLevel))
-#else
-    if (!GTK_WIDGET_TOPLEVEL(topLevel))
-#endif
         topLevel = NULL;
 
     Frame* coreFrame = core(frame);
@@ -961,7 +979,7 @@
  * webkit_web_frame_print:
  * @frame: a #WebKitWebFrame
  *
- * Prints the given #WebKitFrame, by presenting a print dialog to the
+ * Prints the given #WebKitWebFrame, by presenting a print dialog to the
  * user. If you need more control over the printing process, see
  * webkit_web_frame_print_full().
  *
@@ -980,19 +998,11 @@
 
     if (error) {
         GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(priv->webView));
-#if GTK_CHECK_VERSION(2, 18, 0)
         GtkWidget* dialog = gtk_message_dialog_new(gtk_widget_is_toplevel(window) ? GTK_WINDOW(window) : 0,
                                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                                    GTK_MESSAGE_ERROR,
                                                    GTK_BUTTONS_CLOSE,
                                                    "%s", error->message);
-#else
-        GtkWidget* dialog = gtk_message_dialog_new(GTK_WIDGET_TOPLEVEL(window) ? GTK_WINDOW(window) : 0,
-                                                   GTK_DIALOG_DESTROY_WITH_PARENT,
-                                                   GTK_MESSAGE_ERROR,
-                                                   GTK_BUTTONS_CLOSE,
-                                                   "%s", error->message);
-#endif
 
         g_error_free(error);
 
@@ -1035,6 +1045,16 @@
 #endif
 }
 
+gchar* webkit_web_frame_marker_text_for_list_item(WebKitWebFrame* frame, JSContextRef context, JSValueRef nodeObject)
+{
+    JSC::ExecState* exec = toJS(context);
+    Element* element = toElement(toJS(exec, nodeObject));
+    if (!element)
+        return 0;
+
+    return g_strdup(markerTextForListItem(element).utf8().data());
+}
+
 unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame)
 {
     Frame* coreFrame = core(frame);
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
index f2811ea..5177c4c 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
@@ -26,9 +26,9 @@
 #include <glib.h>
 #include <glib/gi18n-lib.h>
 
-#include "CString.h"
 #include "HistoryItem.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkitwebhistoryitem
@@ -37,7 +37,7 @@
  *
  * A history item consists out of a title and a uri. It can be part of the
  * #WebKitWebBackForwardList and the global history. The global history is used
- * for coloring the links of visited sites.  #WebKitHistoryItem's constructed with
+ * for coloring the links of visited sites.  #WebKitWebHistoryItem's constructed with
  * #webkit_web_history_item_new and #webkit_web_history_item_new_with_data are
  * automatically added to the global history.
  *
@@ -54,10 +54,10 @@
 struct _WebKitWebHistoryItemPrivate {
     WebCore::HistoryItem* historyItem;
 
-    WebCore::CString title;
-    WebCore::CString alternateTitle;
-    WebCore::CString uri;
-    WebCore::CString originalUri;
+    WTF::CString title;
+    WTF::CString alternateTitle;
+    WTF::CString uri;
+    WTF::CString originalUri;
 
     gboolean disposed;
 };
@@ -113,10 +113,10 @@
     WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(object);
     WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
 
-    priv->title = WebCore::CString();
-    priv->alternateTitle = WebCore::CString();
-    priv->uri = WebCore::CString();
-    priv->originalUri = WebCore::CString();
+    priv->title = WTF::CString();
+    priv->alternateTitle = WTF::CString();
+    priv->uri = WTF::CString();
+    priv->originalUri = WTF::CString();
 
     G_OBJECT_CLASS(webkit_web_history_item_parent_class)->finalize(object);
 }
@@ -469,7 +469,7 @@
 
     g_return_val_if_fail(item, NULL);
 
-    WebCore::CString t = item->target().utf8();
+    WTF::CString t = item->target().utf8();
     return g_strdup(t.data());
 }
 
diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp
index 2feb064..820b20f 100644
--- a/WebKit/gtk/webkit/webkitwebinspector.cpp
+++ b/WebKit/gtk/webkit/webkitwebinspector.cpp
@@ -125,7 +125,7 @@
     /**
      * WebKitWebInspector::inspect-web-view:
      * @web_inspector: the object on which the signal is emitted
-     * @web_view: the #WebKitWeb which will be inspected
+     * @web_view: the #WebKitWebView which will be inspected
      * @return: a newly allocated #WebKitWebView or %NULL
      *
      * Emitted when the user activates the 'inspect' context menu item
diff --git a/WebKit/gtk/webkit/webkitwebresource.cpp b/WebKit/gtk/webkit/webkitwebresource.cpp
index bd3cd69..ba9c3af 100644
--- a/WebKit/gtk/webkit/webkitwebresource.cpp
+++ b/WebKit/gtk/webkit/webkitwebresource.cpp
@@ -23,13 +23,13 @@
 #include "webkitprivate.h"
 
 #include "ArchiveResource.h"
-#include "CString.h"
 #include "KURL.h"
 #include "PlatformString.h"
 #include "SharedBuffer.h"
 #include "webkitenumtypes.h"
 #include "webkitmarshal.h"
 #include "wtf/Assertions.h"
+#include <wtf/text/CString.h>
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 4ff4a8e..5d2d658 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -30,11 +30,11 @@
 #include "webkitprivate.h"
 #include "webkitversion.h"
 
-#include "CString.h"
 #include "FileSystem.h"
 #include "PluginDatabase.h"
 #include "Language.h"
 #include "PlatformString.h"
+#include <wtf/text/CString.h>
 
 #include <glib/gi18n-lib.h>
 #if OS(UNIX)
@@ -88,11 +88,12 @@
     gboolean enable_private_browsing;
     gboolean enable_spell_checking;
     gchar* spell_checking_languages;
-    GSList* spell_checking_languages_list;
+    GSList* enchant_dicts;
     gboolean enable_caret_browsing;
     gboolean enable_html5_database;
     gboolean enable_html5_local_storage;
     gboolean enable_xss_auditor;
+    gboolean enable_spatial_navigation;
     gchar* user_agent;
     gboolean javascript_can_open_windows_automatically;
     gboolean enable_offline_web_application_cache;
@@ -141,6 +142,7 @@
     PROP_ENABLE_HTML5_DATABASE,
     PROP_ENABLE_HTML5_LOCAL_STORAGE,
     PROP_ENABLE_XSS_AUDITOR,
+    PROP_ENABLE_SPATIAL_NAVIGATION,
     PROP_USER_AGENT,
     PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
     PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
@@ -568,7 +570,25 @@
                                                          _("Whether to enable teh XSS auditor"),
                                                          TRUE,
                                                          flags));
-
+    /**
+    * WebKitWebSettings:enable-spatial-navigation
+    *
+    * Whether to enable the Spatial Navigation. This feature consists in the ability
+    * to navigate between focusable elements in a Web page, such as hyperlinks and
+    * form controls, by using Left, Right, Up and Down arrow keys. For example, if
+    * an user presses the Right key, heuristics determine whether there is an element
+    * he might be trying to reach towards the right, and if there are multiple elements,
+    * which element he probably wants.
+    *
+    * Since: 1.1.23
+    */
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENABLE_SPATIAL_NAVIGATION,
+                                    g_param_spec_boolean("enable-spatial-navigation",
+                                                         _("Enable Spatial Navigation"),
+                                                         _("Whether to enable Spatial Navigation"),
+                                                         FALSE,
+                                                         flags));
     /**
      * WebKitWebSettings:user-agent:
      *
@@ -805,9 +825,9 @@
    /**
     * WebKitWebSettings:enable-java-applet:
     *
-    * Enable or disable support for the Java <applet> tag. Keep in
+    * Enable or disable support for the Java &lt;applet&gt; tag. Keep in
     * mind that Java content can be still shown in the page through
-    * <object> or <embed>, which are the preferred tags for this task.
+    * &lt;object&gt; or &lt;embed&gt;, which are the preferred tags for this task.
     *
     * Since: 1.1.22
     */
@@ -827,16 +847,21 @@
     web_settings->priv = WEBKIT_WEB_SETTINGS_GET_PRIVATE(web_settings);
 }
 
+static EnchantBroker* get_enchant_broker()
+{
+    static EnchantBroker* broker = 0;
+    if (!broker)
+        broker = enchant_broker_init();
+
+    return broker;
+}
+
 static void free_spell_checking_language(gpointer data, gpointer user_data)
 {
-    SpellLanguage* language = static_cast<SpellLanguage*>(data);
-    if (language->config) {
-        if (language->speller)
-            enchant_broker_free_dict(language->config, language->speller);
+    EnchantDict* dict = static_cast<EnchantDict*>(data);
+    EnchantBroker* broker = get_enchant_broker();
 
-        enchant_broker_free(language->config);
-    }
-    g_slice_free(SpellLanguage, language);
+    enchant_broker_free_dict(broker, dict);
 }
 
 static void webkit_web_settings_finalize(GObject* object)
@@ -854,8 +879,8 @@
     g_free(priv->user_stylesheet_uri);
     g_free(priv->spell_checking_languages);
 
-    g_slist_foreach(priv->spell_checking_languages_list, free_spell_checking_language, NULL);
-    g_slist_free(priv->spell_checking_languages_list);
+    g_slist_foreach(priv->enchant_dicts, free_spell_checking_language, 0);
+    g_slist_free(priv->enchant_dicts);
 
     g_free(priv->user_agent);
 
@@ -867,8 +892,8 @@
     WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
     WebKitWebSettingsPrivate* priv = web_settings->priv;
     EnchantBroker* broker;
-    SpellLanguage* lang;
-    GSList* spellLanguages = NULL;
+    EnchantDict* dict;
+    GSList* spellDictionaries = 0;
 
     switch(prop_id) {
     case PROP_DEFAULT_ENCODING:
@@ -958,41 +983,36 @@
         priv->enable_spell_checking = g_value_get_boolean(value);
         break;
     case PROP_SPELL_CHECKING_LANGUAGES:
+        g_free(priv->spell_checking_languages);
         priv->spell_checking_languages = g_strdup(g_value_get_string(value));
 
-        broker = enchant_broker_init();
+        broker = get_enchant_broker();
         if (priv->spell_checking_languages) {
             char** langs = g_strsplit(priv->spell_checking_languages, ",", -1);
             for (int i = 0; langs[i]; i++) {
                 if (enchant_broker_dict_exists(broker, langs[i])) {
-                    lang = g_slice_new0(SpellLanguage);
-                    lang->config = enchant_broker_init();
-                    lang->speller = enchant_broker_request_dict(lang->config, langs[i]);
-
-                    spellLanguages = g_slist_append(spellLanguages, lang);
+                    dict = enchant_broker_request_dict(broker, langs[i]);
+                    spellDictionaries = g_slist_append(spellDictionaries, dict);
                 }
             }
-
             g_strfreev(langs);
         } else {
             const char* language = pango_language_to_string(gtk_get_default_language());
-
             if (enchant_broker_dict_exists(broker, language)) {
-                lang = g_slice_new0(SpellLanguage);
-                lang->config = enchant_broker_init();
-                lang->speller = enchant_broker_request_dict(lang->config, language);
-
-                spellLanguages = g_slist_append(spellLanguages, lang);
+                dict = enchant_broker_request_dict(broker, language);
+                spellDictionaries = g_slist_append(spellDictionaries, dict);
             }
         }
-        enchant_broker_free(broker);
-        g_slist_foreach(priv->spell_checking_languages_list, free_spell_checking_language, NULL);
-        g_slist_free(priv->spell_checking_languages_list);
-        priv->spell_checking_languages_list = spellLanguages;
+        g_slist_foreach(priv->enchant_dicts, free_spell_checking_language, 0);
+        g_slist_free(priv->enchant_dicts);
+        priv->enchant_dicts = spellDictionaries;
         break;
     case PROP_ENABLE_XSS_AUDITOR:
         priv->enable_xss_auditor = g_value_get_boolean(value);
         break;
+    case PROP_ENABLE_SPATIAL_NAVIGATION:
+        priv->enable_spatial_navigation = g_value_get_boolean(value);
+        break;
     case PROP_USER_AGENT:
         g_free(priv->user_agent);
         if (!g_value_get_string(value) || !strlen(g_value_get_string(value)))
@@ -1132,6 +1152,9 @@
     case PROP_ENABLE_XSS_AUDITOR:
         g_value_set_boolean(value, priv->enable_xss_auditor);
         break;
+    case PROP_ENABLE_SPATIAL_NAVIGATION:
+        g_value_set_boolean(value, priv->enable_spatial_navigation);
+        break;
     case PROP_USER_AGENT:
         g_value_set_string(value, priv->user_agent);
         break;
@@ -1225,11 +1248,11 @@
                  "enable-private-browsing", priv->enable_private_browsing,
                  "enable-spell-checking", priv->enable_spell_checking,
                  "spell-checking-languages", priv->spell_checking_languages,
-                 "spell-checking-languages-list", priv->spell_checking_languages_list,
                  "enable-caret-browsing", priv->enable_caret_browsing,
                  "enable-html5-database", priv->enable_html5_database,
                  "enable-html5-local-storage", priv->enable_html5_local_storage,
                  "enable-xss-auditor", priv->enable_xss_auditor,
+                 "enable-spatial-navigation", priv->enable_spatial_navigation,
                  "user-agent", webkit_web_settings_get_user_agent(web_settings),
                  "javascript-can-open-windows-automatically", priv->javascript_can_open_windows_automatically,
                  "enable-offline-web-application-cache", priv->enable_offline_web_application_cache,
@@ -1265,23 +1288,21 @@
 }
 
 /**
- * webkit_web_settings_get_spell_languages:
+ * webkit_web_settings_get_enchant_dicts:
  * @web_view: a #WebKitWebView
  *
- * Internal use only. Retrieves a GSList of SpellLanguages from the
+ * Internal use only. Retrieves a GSList of EnchantDicts from the
  * #WebKitWebSettings of @web_view.
  *
- * Since: 1.1.6
+ * Since: 1.1.22
  */
-GSList* webkit_web_settings_get_spell_languages(WebKitWebView *web_view)
+GSList* webkit_web_settings_get_enchant_dicts(WebKitWebView* webView)
 {
-    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(web_view), 0);
+    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
 
-    WebKitWebSettings* settings = webkit_web_view_get_settings(web_view);
-    WebKitWebSettingsPrivate* priv = settings->priv;
-    GSList* list = priv->spell_checking_languages_list;
+    WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
 
-    return list;
+    return settings->priv->enchant_dicts;
 }
 
 /**
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index d6a8b83..22f6d04 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -6,7 +6,7 @@
  *  Copyright (C) 2008 Jan Alonzo <jmalonzo@unpluggable.com>
  *  Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
  *  Copyright (C) 2008 Nuanti Ltd.
- *  Copyright (C) 2008, 2009 Collabora Ltd.
+ *  Copyright (C) 2008, 2009, 2010 Collabora Ltd.
  *  Copyright (C) 2009 Igalia S.L.
  *  Copyright (C) 2009 Movial Creative Technologies Inc.
  *  Copyright (C) 2009 Bobby Powers
@@ -31,6 +31,7 @@
 
 #include "webkitdownload.h"
 #include "webkitenumtypes.h"
+#include "webkitgeolocationpolicydecision.h"
 #include "webkitmarshal.h"
 #include "webkitnetworkrequest.h"
 #include "webkitnetworkresponse.h"
@@ -40,45 +41,47 @@
 #include "webkitwebhistoryitem.h"
 
 #include "AXObjectCache.h"
-#include "NotImplemented.h"
 #include "BackForwardList.h"
 #include "Cache.h"
-#include "CString.h"
 #include "ChromeClientGtk.h"
-#include "ContextMenu.h"
 #include "ContextMenuClientGtk.h"
 #include "ContextMenuController.h"
+#include "ContextMenu.h"
 #include "Cursor.h"
+#include "Database.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "DragClientGtk.h"
-#include "Editor.h"
 #include "EditorClientGtk.h"
+#include "Editor.h"
 #include "EventHandler.h"
 #include "FloatQuad.h"
 #include "FocusController.h"
+#include "FrameLoader.h"
 #include "FrameLoaderTypes.h"
+#include "FrameView.h"
+#include <glib/gi18n-lib.h>
+#include <GOwnPtr.h>
+#include "GraphicsContext.h"
+#include "GtkVersioning.h"
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
-#include <glib/gi18n-lib.h>
-#include "GraphicsContext.h"
 #include "IconDatabase.h"
 #include "InspectorClientGtk.h"
-#include "FrameLoader.h"
-#include "FrameView.h"
 #include "MouseEventWithHitTestResults.h"
+#include "NotImplemented.h"
 #include "PageCache.h"
 #include "Pasteboard.h"
-#include "PasteboardHelper.h"
 #include "PasteboardHelperGtk.h"
+#include "PasteboardHelper.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformWheelEvent.h"
 #include "ProgressTracker.h"
-#include "ResourceHandle.h"
 #include "RenderView.h"
+#include "ResourceHandle.h"
 #include "ScriptValue.h"
 #include "Scrollbar.h"
-#include <wtf/gtk/GOwnPtr.h>
+#include <wtf/text/CString.h>
 
 #include <gdk/gdkkeysyms.h>
 
@@ -158,6 +161,10 @@
     REDO,
     DATABASE_QUOTA_EXCEEDED,
     RESOURCE_REQUEST_STARTING,
+    DOCUMENT_LOAD_FINISHED,
+    GEOLOCATION_POLICY_DECISION_REQUESTED,
+    GEOLOCATION_POLICY_DECISION_CANCELLED,
+    ONLOAD_EVENT,
     LAST_SIGNAL
 };
 
@@ -201,33 +208,69 @@
     priv->currentMenu = NULL;
 }
 
+static void PopupMenuPositionFunc(GtkMenu* menu, gint *x, gint *y, gboolean *pushIn, gpointer userData)
+{
+    WebKitWebView* view = WEBKIT_WEB_VIEW(userData);
+    WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(view);
+    GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(view));
+    GtkRequisition menuSize;
+
+    gtk_widget_size_request(GTK_WIDGET(menu), &menuSize);
+
+    *x = priv->lastPopupXPosition;
+    if ((*x + menuSize.width) >= gdk_screen_get_width(screen))
+      *x -= menuSize.width;
+
+    *y = priv->lastPopupYPosition;
+    if ((*y + menuSize.height) >= gdk_screen_get_height(screen))
+      *y -= menuSize.height;
+
+    *pushIn = FALSE;
+}
+
 static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webView, const PlatformMouseEvent& event)
 {
     Page* page = core(webView);
     page->contextMenuController()->clearContextMenu();
-    Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
+    Frame* focusedFrame;
+    Frame* mainFrame = page->mainFrame();
+    gboolean mousePressEventResult = FALSE;
 
-    if (!focusedFrame->view())
+    if (!mainFrame->view())
         return FALSE;
 
-    focusedFrame->view()->setCursor(pointerCursor());
+    mainFrame->view()->setCursor(pointerCursor());
+    if (page->frameCount()) {
+        HitTestRequest request(HitTestRequest::Active);
+        IntPoint point = mainFrame->view()->windowToContents(event.pos());
+        MouseEventWithHitTestResults mev = mainFrame->document()->prepareMouseEvent(request, point, event);
+
+        Frame* targetFrame = EventHandler::subframeForTargetNode(mev.targetNode());
+        if (!targetFrame)
+            targetFrame = mainFrame;
+
+        focusedFrame = page->focusController()->focusedOrMainFrame();
+        if (targetFrame != focusedFrame) {
+            page->focusController()->setFocusedFrame(targetFrame);
+            focusedFrame = targetFrame;
+        }
+    } else
+        focusedFrame = mainFrame;
+
+    if (focusedFrame->view() && focusedFrame->eventHandler()->handleMousePressEvent(event))
+        mousePressEventResult = TRUE;
+
+
     bool handledEvent = focusedFrame->eventHandler()->sendContextMenuEvent(event);
     if (!handledEvent)
         return FALSE;
 
     // If coreMenu is NULL, this means WebCore decided to not create
-    // the default context menu; this may still mean that the frame
-    // wants to consume the event - this happens when the page is
-    // handling the right-click for reasons other than a context menu,
-    // so we give it to it.
+    // the default context menu; this may happen when the page is
+    // handling the right-click for reasons other than the context menu.
     ContextMenu* coreMenu = page->contextMenuController()->contextMenu();
-    if (!coreMenu) {
-        Frame* frame = core(webView)->mainFrame();
-        if (frame->view() && frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(event)))
-            return TRUE;
-
-        return FALSE;
-    }
+    if (!coreMenu)
+        return mousePressEventResult;
 
     // If we reach here, it's because WebCore is going to show the
     // default context menu. We check our setting to figure out
@@ -261,8 +304,8 @@
                      NULL);
 
     gtk_menu_popup(menu, NULL, NULL,
-                   NULL,
-                   priv, event.button() + 1, gtk_get_current_event_time());
+                   &PopupMenuPositionFunc,
+                   webView, event.button() + 1, gtk_get_current_event_time());
     return TRUE;
 }
 
@@ -272,17 +315,19 @@
 
     // The context menu event was generated from the keyboard, so show the context menu by the current selection.
     Page* page = core(WEBKIT_WEB_VIEW(widget));
-    FrameView* view = page->mainFrame()->view();
+    Frame* frame = page->focusController()->focusedOrMainFrame();
+    FrameView* view = frame->view();
     if (!view)
         return FALSE;    
 
-    Position start = page->mainFrame()->selection()->selection().start();
-    Position end = page->mainFrame()->selection()->selection().end();
+    Position start = frame->selection()->selection().start();
+    Position end = frame->selection()->selection().end();
 
     int rightAligned = FALSE;
     IntPoint location;
 
-    if (!start.node() || !end.node())
+    if (!start.node() || !end.node()
+        || (frame->selection()->selection().isCaret() && !frame->selection()->selection().isContentEditable()))
         location = IntPoint(rightAligned ? view->contentsWidth() - contextMenuMargin : contextMenuMargin, contextMenuMargin);
     else {
         RenderObject* renderer = start.node()->renderer();
@@ -328,8 +373,17 @@
     // FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in the selected element.
     // Ideally we'd have the position of a context menu event be separate from its target node.
     location = view->contentsToWindow(location) + IntSize(0, -1);
+    if (location.y() < 0)
+        location.setY(contextMenuMargin);
+    else if (location.y() > view->height())
+        location.setY(view->height() - contextMenuMargin);
+    if (location.x() < 0)
+        location.setX(contextMenuMargin);
+    else if (location.x() > view->width())
+        location.setX(view->width() - contextMenuMargin);
     IntPoint global = location + IntSize(x, y);
-    PlatformMouseEvent event(location, global, NoButton, MouseEventPressed, 0, false, false, false, false, gtk_get_current_event_time());
+
+    PlatformMouseEvent event(location, global, RightButton, MouseEventPressed, 0, false, false, false, false, gtk_get_current_event_time());
 
     return webkit_web_view_forward_context_menu_event(WEBKIT_WEB_VIEW(widget), event);
 }
@@ -510,12 +564,19 @@
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
 
+    // GTK+ IM contexts often require us to filter key release events, which
+    // WebCore does not do by default, so we filter the event here. We only block
+    // the event if we don't have a pending composition, because that means we
+    // are using a context like 'simple' which marks every keystroke as filtered.
+    WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient());
+    if (gtk_im_context_filter_keypress(webView->priv->imContext, event) && !client->hasPendingComposition())
+        return TRUE;
+
     Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
     if (!frame->view())
         return FALSE;
 
     PlatformKeyboardEvent keyboardEvent(event);
-
     if (frame->eventHandler()->keyEvent(keyboardEvent))
         return TRUE;
 
@@ -632,16 +693,17 @@
         return;
 
     frame->view()->resize(allocation->width, allocation->height);
-    frame->view()->forceLayout();
-    frame->view()->adjustViewSize();
 }
 
 static void webkit_web_view_grab_focus(GtkWidget* widget)
 {
-    if (GTK_WIDGET_IS_SENSITIVE(widget)) {
+
+    if (gtk_widget_is_sensitive(widget)) {
         WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
         FocusController* focusController = core(webView)->focusController();
 
+        focusController->setActive(true);
+
         if (focusController->focusedFrame())
             focusController->setFocused(true);
         else
@@ -656,11 +718,7 @@
     // TODO: Improve focus handling as suggested in
     // http://bugs.webkit.org/show_bug.cgi?id=16910
     GtkWidget* toplevel = gtk_widget_get_toplevel(widget);
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_toplevel(toplevel) && gtk_window_has_toplevel_focus(GTK_WINDOW(toplevel))) {
-#else
-    if (GTK_WIDGET_TOPLEVEL(toplevel) && gtk_window_has_toplevel_focus(GTK_WINDOW(toplevel))) {
-#endif
         WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
         FocusController* focusController = core(webView)->focusController();
 
@@ -670,6 +728,8 @@
             focusController->setFocused(true);
         else
             focusController->setFocusedFrame(core(webView)->mainFrame());
+
+        gtk_im_context_focus_in(webView->priv->imContext);
     }
     return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event);
 }
@@ -678,8 +738,16 @@
 {
     WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
 
-    core(webView)->focusController()->setActive(false);
-    core(webView)->focusController()->setFocused(false);
+    // We may hit this code while destroying the widget, and we might
+    // no longer have a page, then.
+    Page* page = core(webView);
+    if (page) {
+        page->focusController()->setActive(false);
+        page->focusController()->setFocused(false);
+    }
+
+    if (webView->priv->imContext)
+        gtk_im_context_focus_out(webView->priv->imContext);
 
     return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_out_event(widget, event);
 }
@@ -849,11 +917,7 @@
     }
 
     window = gtk_widget_get_toplevel(GTK_WIDGET(webView));
-#if GTK_CHECK_VERSION(2, 18, 0)
     dialog = gtk_message_dialog_new(gtk_widget_is_toplevel(window) ? GTK_WINDOW(window) : 0, GTK_DIALOG_DESTROY_WITH_PARENT, messageType, buttons, "%s", message);
-#else
-    dialog = gtk_message_dialog_new(GTK_WIDGET_TOPLEVEL(window) ? GTK_WINDOW(window) : 0, GTK_DIALOG_DESTROY_WITH_PARENT, messageType, buttons, "%s", message);
-#endif
     gchar* title = g_strconcat("JavaScript - ", webkit_web_frame_get_uri(frame), NULL);
     gtk_window_set_title(GTK_WINDOW(dialog), title);
     g_free(title);
@@ -1432,7 +1496,7 @@
      * @web_view: the object on which the signal is emitted
      * @frame: the #WebKitWebFrame that required the navigation
      * @request: a #WebKitNetworkRequest
-     * @navigation_action: a #WebKitWebNavigation
+     * @navigation_action: a #WebKitWebNavigationAction
      * @policy_decision: a #WebKitWebPolicyDecision
      *
      * Emitted when @frame requests opening a new window. With this
@@ -1479,7 +1543,7 @@
      * @web_view: the object on which the signal is emitted
      * @frame: the #WebKitWebFrame that required the navigation
      * @request: a #WebKitNetworkRequest
-     * @navigation_action: a #WebKitWebNavigation
+     * @navigation_action: a #WebKitWebNavigationAction
      * @policy_decision: a #WebKitWebPolicyDecision
      *
      * Emitted when @frame requests a navigation to another page.
@@ -1560,7 +1624,6 @@
      * @context: the #JSGlobalContextRef holding the global object and other
      * execution state; equivalent to the return value of
      * webkit_web_frame_get_global_context(@frame)
-     *
      * @window_object: the #JSObjectRef representing the frame's JavaScript
      * window object
      *
@@ -1724,6 +1787,23 @@
             WEBKIT_TYPE_WEB_FRAME);
 
     /**
+     * WebKitWebView::onload-event:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the frame
+     *
+     * When a #WebKitWebFrame receives an onload event this signal is emitted.
+     */
+    webkit_web_view_signals[LOAD_STARTED] = g_signal_new("onload-event",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)G_SIGNAL_RUN_LAST,
+            0,
+            NULL,
+            NULL,
+            g_cclosure_marshal_VOID__OBJECT,
+            G_TYPE_NONE, 1,
+            WEBKIT_TYPE_WEB_FRAME);
+
+    /**
      * WebKitWebView::title-changed:
      * @web_view: the object on which the signal is emitted
      * @frame: the main frame
@@ -2075,7 +2155,7 @@
      * @uri: the URI to load
      * @param: a #GHashTable with additional attributes (strings)
      *
-     * The #WebKitWebView::create-plugin signal will be emitted to
+     * The #WebKitWebView::create-plugin-widget signal will be emitted to
      * create a plugin widget for embed or object HTML tags. This
      * allows to embed a GtkWidget as a plugin into HTML content. In
      * case of a textual selection of the GtkWidget WebCore will attempt
@@ -2102,7 +2182,7 @@
      * @frame: the relevant frame
      * @database: the #WebKitWebDatabase which exceeded the quota of its #WebKitSecurityOrigin
      *
-     * The #WebKitWebView::database-exceeded-quota signal will be emitted when
+     * The #WebKitWebView::database-quota-exceeded signal will be emitted when
      * a Web Database exceeds the quota of its security origin. This signal
      * may be used to increase the size of the quota before the originating
      * operation fails.
@@ -2159,6 +2239,72 @@
             WEBKIT_TYPE_NETWORK_REQUEST,
             WEBKIT_TYPE_NETWORK_RESPONSE);
 
+    /**
+     * WebKitWebView::geolocation-policy-decision-requested:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the frame that requests permission
+     * @policy_decision: a WebKitGeolocationPolicyDecision
+     *
+     * When a @frame wants to get its geolocation permission.
+     * The receiver must reply with a boolean wether it handled or not the
+     * request. If the request is not handled, default behaviour is to deny
+     * geolocation.
+     *
+     * Since: 1.1.23
+     */
+    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_REQUESTED] = g_signal_new("geolocation-policy-decision-requested",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST),
+            0,
+            NULL, NULL,
+            webkit_marshal_BOOLEAN__OBJECT_OBJECT,
+            G_TYPE_BOOLEAN, 2,
+            WEBKIT_TYPE_WEB_FRAME,
+            WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION);
+
+    /**
+     * WebKitWebView::geolocation-policy-decision-cancelled:
+     * @web_view: the object on which the signal is emitted
+     * @frame: the frame that cancels geolocation request.
+     *
+     * When a @frame wants to cancel geolocation permission it had requested
+     * before.
+     *
+     * Since: 1.1.23
+     */
+    webkit_web_view_signals[GEOLOCATION_POLICY_DECISION_CANCELLED] = g_signal_new("geolocation-policy-decision-cancelled",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST),
+            0,
+            NULL, NULL,
+            g_cclosure_marshal_VOID__OBJECT,
+            G_TYPE_NONE, 1,
+            WEBKIT_TYPE_WEB_FRAME);
+
+    /*
+     * DOM-related signals. These signals are experimental, for now,
+     * and may change API and ABI. Their comments lack one * on
+     * purpose, to make them not be catched by gtk-doc.
+     */
+
+    /*
+     * WebKitWebView::document-load-finished
+     * @web_view: the object which received the signal
+     * @web_frame: the #WebKitWebFrame whose load dispatched this request
+     *
+     * Emitted when the DOM document object load is finished for the
+     * given frame.
+     */
+    webkit_web_view_signals[DOCUMENT_LOAD_FINISHED] = g_signal_new("document-load-finished",
+            G_TYPE_FROM_CLASS(webViewClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            0,
+            NULL, NULL,
+            g_cclosure_marshal_VOID__OBJECT,
+            G_TYPE_NONE, 1,
+            WEBKIT_TYPE_WEB_FRAME);
+
+
     /*
      * implementations of virtual methods
      */
@@ -2549,7 +2695,7 @@
     gboolean autoLoadImages, autoShrinkImages, printBackgrounds,
         enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas,
         enablePrivateBrowsing, enableCaretBrowsing, enableHTML5Database, enableHTML5LocalStorage,
-        enableXSSAuditor, javascriptCanOpenWindows, enableOfflineWebAppCache,
+        enableXSSAuditor, enableSpatialNavigation, javascriptCanOpenWindows, enableOfflineWebAppCache,
         enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
         enableDOMPaste, tabKeyCyclesThroughElements,
         enableSiteSpecificQuirks, usePageCache, enableJavaApplet;
@@ -2577,6 +2723,7 @@
                  "enable-html5-database", &enableHTML5Database,
                  "enable-html5-local-storage", &enableHTML5LocalStorage,
                  "enable-xss-auditor", &enableXSSAuditor,
+                 "enable-spatial-navigation", &enableSpatialNavigation,
                  "javascript-can-open-windows-automatically", &javascriptCanOpenWindows,
                  "enable-offline-web-application-cache", &enableOfflineWebAppCache,
                  "editing-behavior", &editingBehavior,
@@ -2606,9 +2753,12 @@
     settings->setDeveloperExtrasEnabled(enableDeveloperExtras);
     settings->setPrivateBrowsingEnabled(enablePrivateBrowsing);
     settings->setCaretBrowsingEnabled(enableCaretBrowsing);
-    settings->setDatabasesEnabled(enableHTML5Database);
+#if ENABLE(DATABASE)
+    Database::setIsAvailable(enableHTML5Database);
+#endif
     settings->setLocalStorageEnabled(enableHTML5LocalStorage);
     settings->setXSSAuditorEnabled(enableXSSAuditor);
+    settings->setSpatialNavigationEnabled(enableSpatialNavigation);
     settings->setJavaScriptCanOpenWindowsAutomatically(javascriptCanOpenWindows);
     settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
     settings->setEditingBehavior(core(editingBehavior));
@@ -2694,12 +2844,17 @@
         settings->setPrivateBrowsingEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-caret-browsing"))
         settings->setCaretBrowsingEnabled(g_value_get_boolean(&value));
-    else if (name == g_intern_string("enable-html5-database"))
-        settings->setDatabasesEnabled(g_value_get_boolean(&value));
+#if ENABLE(DATABASE)
+    else if (name == g_intern_string("enable-html5-database")) {
+        Database::setIsAvailable(g_value_get_boolean(&value));
+    }
+#endif
     else if (name == g_intern_string("enable-html5-local-storage"))
         settings->setLocalStorageEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-xss-auditor"))
         settings->setXSSAuditorEnabled(g_value_get_boolean(&value));
+    else if (name == g_intern_string("enable-spatial-navigation"))
+        settings->setSpatialNavigationEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("javascript-can-open-windows-automatically"))
         settings->setJavaScriptCanOpenWindowsAutomatically(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-offline-web-application-cache"))
@@ -2866,8 +3021,11 @@
 static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures)
 {
     WebKitWebViewPrivate* priv = webView->priv;
+    
+    if (!webWindowFeatures)
+      return;
 
-    if(webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
+    if (webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
       return;
 
     g_object_unref(priv->webWindowFeatures);
@@ -3259,7 +3417,7 @@
  * @web_view: a #WebKitWebView
  * @string: a string to look for
  * @case_sensitive: whether to respect the case of text
- * @limit: the maximum number of strings to look for or %0 for all
+ * @limit: the maximum number of strings to look for or 0 for all
  *
  * Attempts to highlight all occurances of #string inside #web_view.
  *
@@ -3557,7 +3715,7 @@
  *
  * This function returns the list of targets this #WebKitWebView can
  * provide for clipboard copying and as DND source. The targets in the list are
- * added with %info values from the #WebKitWebViewTargetInfo enum,
+ * added with values from the #WebKitWebViewTargetInfo enum,
  * using gtk_target_list_add() and
  * gtk_target_list_add_text_targets().
  *
@@ -3574,7 +3732,7 @@
  *
  * This function returns the list of targets this #WebKitWebView can
  * provide for clipboard pasting and as DND destination. The targets in the list are
- * added with %info values from the #WebKitWebViewTargetInfo enum,
+ * added with values from the #WebKitWebViewTargetInfo enum,
  * using gtk_target_list_add() and
  * gtk_target_list_add_text_targets().
  *
@@ -3681,7 +3839,7 @@
         return;
 
     WebKitWebViewPrivate* priv = webView->priv;
-    frame->setZoomFactor(zoomLevel, !priv->zoomFullContent);
+    frame->setZoomFactor(zoomLevel, priv->zoomFullContent ? ZoomPage : ZoomTextOnly);
 }
 
 /**
@@ -3804,6 +3962,7 @@
  */
 SoupSession* webkit_get_default_session ()
 {
+    webkit_init();
     return ResourceHandle::defaultSession();
 }
 
@@ -3852,7 +4011,7 @@
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
 
-    String encoding = core(webView)->mainFrame()->loader()->encoding();
+    String encoding = core(webView)->mainFrame()->loader()->writer()->encoding();
 
     if (!encoding.isEmpty()) {
         WebKitWebViewPrivate* priv = webView->priv;
@@ -4219,6 +4378,8 @@
  */
 void webkit_set_cache_model(WebKitCacheModel model)
 {
+    webkit_init();
+
     if (cacheModel == model)
         return;
 
@@ -4267,5 +4428,6 @@
  */
 WebKitCacheModel webkit_get_cache_model()
 {
+    webkit_init();
     return cacheModel;
 }
diff --git a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
index cdb6858..a6fe1df 100644
--- a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
+++ b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
@@ -422,19 +422,24 @@
  */
 gboolean webkit_web_window_features_equal(WebKitWebWindowFeatures* features1, WebKitWebWindowFeatures* features2)
 {
+    if (features1 == features2)
+        return TRUE;
+    if (!features1 || !features2)
+        return FALSE; 
+    
     WebKitWebWindowFeaturesPrivate* priv1 = features1->priv;
     WebKitWebWindowFeaturesPrivate* priv2 = features2->priv;
 
-    if((priv1->x == priv2->x) &&
-       (priv1->y == priv2->y) &&
-       (priv1->width == priv2->width) &&
-       (priv1->height == priv2->height) &&
-       (priv1->toolbar_visible == priv2->toolbar_visible) &&
-       (priv1->statusbar_visible == priv2->statusbar_visible) &&
-       (priv1->scrollbar_visible == priv2->scrollbar_visible) &&
-       (priv1->menubar_visible == priv2->menubar_visible) &&
-       (priv1->locationbar_visible == priv2->locationbar_visible) &&
-       (priv1->fullscreen == priv2->fullscreen))
+    if ((priv1->x == priv2->x)
+        && (priv1->y == priv2->y)
+        && (priv1->width == priv2->width)
+        && (priv1->height == priv2->height)
+        && (priv1->toolbar_visible == priv2->toolbar_visible)
+        && (priv1->statusbar_visible == priv2->statusbar_visible)
+        && (priv1->scrollbar_visible == priv2->scrollbar_visible)
+        && (priv1->menubar_visible == priv2->menubar_visible)
+        && (priv1->locationbar_visible == priv2->locationbar_visible)
+        && (priv1->fullscreen == priv2->fullscreen))
         return TRUE;
     return FALSE;
 }
diff --git a/WebKit/gtk/webkitmarshal.list b/WebKit/gtk/webkitmarshal.list
index fefdff3..d8caa4c 100644
--- a/WebKit/gtk/webkitmarshal.list
+++ b/WebKit/gtk/webkitmarshal.list
@@ -1,6 +1,7 @@
 BOOLEAN:ENUM,INT
 BOOLEAN:INT,INT,STRING
 BOOLEAN:OBJECT
+BOOLEAN:OBJECT,OBJECT
 BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT
 BOOLEAN:OBJECT,OBJECT,STRING,OBJECT
 BOOLEAN:OBJECT,STRING
diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog
index 93833fc..f09c456 100644
--- a/WebKit/haiku/ChangeLog
+++ b/WebKit/haiku/ChangeLog
@@ -1,3 +1,141 @@
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+        (WebCore::FrameLoaderClientHaiku::committedLoad):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebCoreSupport/ChromeClientHaiku.cpp:
+        (WebCore::ChromeClientHaiku::chooseIconForFiles):
+        * WebCoreSupport/ChromeClientHaiku.h:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+        (WebCore::FrameLoaderClientHaiku::committedLoad):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+        (WebCore::FrameLoaderClientHaiku::committedLoad):
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+        * WebCoreSupport/FrameLoaderClientHaiku.h:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebCoreSupport/ChromeClientHaiku.h:
+        (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame):
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h.
+
+        * WebCoreSupport/EditorClientHaiku.cpp:
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebCoreSupport/ChromeClientHaiku.cpp:
+        (WebCore::ChromeClientHaiku::chooseIconForFiles):
+        * WebCoreSupport/ChromeClientHaiku.h:
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * WebCoreSupport/InspectorClientHaiku.cpp:
+        (WebCore::InspectorClientHaiku::openInspectorFrontend):
+        * WebCoreSupport/InspectorClientHaiku.h:
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebCoreSupport/ChromeClientHaiku.cpp:
+        * WebCoreSupport/ChromeClientHaiku.h:
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the haiku port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebCoreSupport/ChromeClientHaiku.cpp:
+        (WebCore::ChromeClientHaiku::invalidateContents):
+        (WebCore::ChromeClientHaiku::invalidateWindow):
+        (WebCore::ChromeClientHaiku::invalidateContentsAndWindow):
+        (WebCore::ChromeClient::invalidateContentsForSlowScroll):
+        * WebCoreSupport/ChromeClientHaiku.h:
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebCoreSupport/ChromeClientHaiku.h:
+        (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame):
+
 2010-02-17  Dmitry Titov  <dimich@chromium.org>
 
         Reviewed by David Levin, Darin Fisher, Simon Hausmann.
diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
index a7f1145..2cf5c31 100644
--- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
@@ -32,6 +32,7 @@
 #include "FrameLoadRequest.h"
 #include "FrameView.h"
 #include "HitTestResult.h"
+#include "Icon.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 
@@ -253,7 +254,17 @@
     return IntRect();
 }
 
-void ChromeClientHaiku::repaint(const IntRect&, bool contentChanged, bool immediate, bool repaintContentOnly)
+void ChromeClientHaiku::invalidateWindow(const IntRect&, bool)
+{
+    notImplemented();
+}
+
+void ChromeClientHaiku::invalidateContentsAndWindow(const IntRect&, bool)
+{
+    notImplemented();
+}
+
+void ChromeClientHaiku::invalidateContentsForSlowScroll(const IntRect&, bool)
 {
     notImplemented();
 }
@@ -346,9 +357,9 @@
     notImplemented();
 }
 
-void ChromeClientHaiku::iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>)
+void ChromeClientHaiku::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
 {
-    notImplemented();
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 bool ChromeClientHaiku::setCursor(PlatformCursorHandle)
diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
index 3b0841b..d5a372b 100644
--- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
@@ -102,8 +102,11 @@
         bool tabsToLinks() const;
         IntRect windowResizerRect() const;
 
-        void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+        void invalidateWindow(const IntRect&, bool);
+        void invalidateContentsAndWindow(const IntRect&, bool);
+        void invalidateContentsForSlowScroll(const IntRect&, bool);
         void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
         IntPoint screenToWindow(const IntPoint&) const;
         IntRect windowToScreen(const IntRect&) const;
         PlatformPageClient platformPageClient() const;
@@ -130,11 +133,12 @@
 #endif
 
         // This is an asynchronous call. The ChromeClient can display UI asking the user for permission
-        // to use Geolococation. The ChromeClient must call Geolocation::setShouldClearCache() appropriately.
+        // to use Geolococation.
         void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+        void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { }
 
         void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
-        void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>);
+        void chooseIconForFiles(const Vector<String>&, FileChooser*);
 
         bool setCursor(PlatformCursorHandle);
 
diff --git a/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp
index a51e361..48957a0 100644
--- a/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp
@@ -36,10 +36,10 @@
 #include "Editor.h"
 #include "FocusController.h"
 #include "Frame.h"
-#include "KeyboardCodes.h"
 #include "KeyboardEvent.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
+#include "WindowsKeyboardCodes.h"
 
 #include "NotImplemented.h"
 
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
index 77c7cfc..430194a 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
@@ -510,7 +510,7 @@
         return;
 
     FrameLoader* frameLoader = loader->frameLoader();
-    frameLoader->setEncoding(m_response.textEncodingName(), false);
+    frameLoader->writer()->setEncoding(m_response.textEncodingName(), false);
     frameLoader->addData(data, length);
 }
 
@@ -634,11 +634,6 @@
     return false;
 }
 
-void FrameLoaderClientHaiku::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
-{
-    notImplemented();
-}
-
 void FrameLoaderClientHaiku::dispatchDidFailProvisionalLoad(const ResourceError&)
 {
     notImplemented();
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
index dadda19..cf2fb06 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
@@ -194,7 +194,6 @@
         virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*,
                                                             const ResourceRequest&,
                                                             const ResourceResponse&, int);
-        virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&);
 
         virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
         virtual void dispatchDidFailLoad(const ResourceError&);
diff --git a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp
index f06e96b..59232e9 100644
--- a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp
@@ -42,45 +42,7 @@
     notImplemented();
 }
 
-Page* InspectorClientHaiku::createPage()
-{
-    notImplemented();
-    return 0;
-}
-
-String InspectorClientHaiku::localizedStringsURL()
-{
-    notImplemented();
-    return String();
-}
-
-String InspectorClientHaiku::hiddenPanels()
-{
-    notImplemented();
-    return String();
-}
-
-void InspectorClientHaiku::showWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientHaiku::closeWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientHaiku::attachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientHaiku::detachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientHaiku::setAttachedWindowHeight(unsigned height)
+void InspectorClientHaiku::openInspectorFrontend(WebCore::InspectorController*)
 {
     notImplemented();
 }
@@ -95,16 +57,6 @@
     notImplemented();
 }
 
-void InspectorClientHaiku::inspectedURLChanged(const String&)
-{
-    notImplemented();
-}
-
-void InspectorClientHaiku::inspectorWindowObjectCleared()
-{
-    notImplemented();
-}
-
 void InspectorClientHaiku::populateSetting(const String& key, String* value)
 {
     notImplemented();
diff --git a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h
index 8788a5f..d427670 100644
--- a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h
@@ -42,29 +42,13 @@
     public:
         virtual void inspectorDestroyed();
 
-        virtual Page* createPage();
-
-        virtual String localizedStringsURL();
-
-        virtual String hiddenPanels();
-
-        virtual void showWindow();
-        virtual void closeWindow();
-
-        virtual void attachWindow();
-        virtual void detachWindow();
-
-        virtual void setAttachedWindowHeight(unsigned height);
+        virtual void openInspectorFrontend(WebCore::InspectorController*);
 
         virtual void highlight(Node*);
         virtual void hideHighlight();
 
-        virtual void inspectedURLChanged(const String& newURL);
-
         virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
         virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
-
-        virtual void inspectorWindowObjectCleared();
     };
 } // namespace WebCore
 
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index e1d0cc3..e45527f 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,1755 @@
+2010-04-21  Mark Rowe  <mrowe@apple.com>
+
+        Tiger build fix.
+
+        * Plugins/WebPluginController.mm: Add an #import that is necessary on Tiger.
+
+2010-04-21  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        <rdar://problem/7313430> Many crashes in Safari inside Flip4Mac below -[NSAlert didEndAlert:returnCode:contextInfo:]
+
+        Existing versions of the Flip4Mac WebKit plug-in have an object lifetime bug related to an NSAlert that is
+        used to notify the user about updates to the plug-in. This bug can result in Safari crashing if the page
+        containing the plug-in navigates while the alert is displayed (<rdar://problem/7313430>).
+
+        The gist of the bug is thus: Flip4Mac sets an instance of the TSUpdateCheck class as the modal delegate of the
+        NSAlert instance. This TSUpdateCheck instance itself has a delegate. The delegate is set to the WmvPlugin
+        instance which is the NSView subclass that is exposed to WebKit as the plug-in view. Since this relationship
+        is that of delegates the TSUpdateCheck does not retain the WmvPlugin. This leads to a bug if the WmvPlugin
+        instance is destroyed before the TSUpdateCheck instance as the TSUpdateCheck instance will be left with a
+        pointer to a stale object. This will happen if a page containing the Flip4Mac plug-in triggers a navigation
+        while the update sheet is visible as the WmvPlugin instance is removed from the view hierarchy and there are
+        no other references to keep the object alive.
+
+        We work around this bug by patching the following two messages:
+
+        1) -[NSAlert beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:]
+        2) -[TSUpdateCheck alertDidEnd:returnCode:contextInfo:]
+
+        Our override of 1) detects whether it is Flip4Mac's update sheet triggering the alert by checking whether the
+        modal delegate is an instance of TSUpdateCheck. If it is, it retains the modal delegate's delegate.
+
+        Our override of 2) then autoreleases the delegate, balancing the retain we added in 1).
+
+        These two overrides have the effect of ensuring that the WmvPlugin instance will always outlive the TSUpdateCheck
+        instance, preventing the TSUpdateCheck instance from accessing a stale delegate pointer and crashing the application.
+
+        * Plugins/WebPluginController.mm:
+        (-[WebPluginController addPlugin:]): Check whether the plug-in being instantiated is the Flip4Mac plug-in and
+        install our workaround if it is.
+        (isKindOfClass): Helper function that checks whether the given object is an instance of the named class.
+        (WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_): Autorelease the delegate.
+        (WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_): Retain the modal delegate's
+        delegate if this NSAlert belongs to the Flip4Mac plug-in.
+        (installFlip4MacPlugInWorkaroundIfNecessary): Swizzle the necessary methods.  We swizzle the TSUpdateCheck methods
+        first since it is possible that in some versions of Flip4Mac the TSUpdateCheck class may not exist or may not have
+        the method we're interested in.  In that case we want to bail out before patching any methods.
+
+2010-04-20  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/7856151> REGRESSION: NPP_Destroy is not called when page navigates when plug-in is displaying modal dialog
+
+        An interaction between the plug-in host and WebKit was resulting in WKPCSetModal being called while
+        NetscapePluginInstanceProxy was waiting on a reply to the GetScriptableNPObject message. This resulted
+        in calls to stop the plug-in being deferred due to the presence of plug-in code up the stack.  This
+        could lead to crashes as it was possible for the plug-in view to be deallocated during the modal runloop.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WKPCInvalidateRect):
+        (WKPCSetModal): Defer the handling of setModal until the next runloop iteration if the host proxy
+        is already processing requests.  This ensures that there will be no plug-in code on the stack when
+        the modal runloop is entered, which allows the plug-in to be stopped when the page is navigated while
+        a modal dialog is displayed.
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _canProvideDocumentSource]):
+        (-[WebFrame _receivedData:textEncodingName:]):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::chooseIconForFiles):
+
+2010-04-20  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57892.
+        http://trac.webkit.org/changeset/57892
+        https://bugs.webkit.org/show_bug.cgi?id=37864
+
+        Caused an assertion in Mac builds (Requested by smfr on
+        #webkit).
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _getVisibleRect:]):
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _install]):
+
+2010-04-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Clean up RenderPart/RenderPartObject/RenderFrame/RenderEmbeddedObject
+        https://bugs.webkit.org/show_bug.cgi?id=37741
+        
+        Make Frame::ownerRenderer() return a RenderFrameBase* rather than a
+        RenderPart*, and add the necessary toRenderFrameBase() and isRenderFrameBase().
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _getVisibleRect:]):
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _install]):
+
+2010-04-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Finish exposing extremal shrink factors WebHTMLView uses when shrinking pages to fit in the
+        printing width as SPI.
+
+        * WebKit.exp: Export _WebHTMLViewPrintingMinimumShrinkFactor and _WebHTMLViewPrintingMaximumShrinkFactor.
+
+2010-04-15  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Sam Weinig & Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37675
+        Remove casts/constructors to/from JSC::UString type from WebCore::String
+        
+        WebCore's strings should not know about JSC::UString, this should be abstracted
+        away in the bindings.  Add explicit conversion methods rather than relying on
+        overloaded cast operators / constructors being implicitly called.
+
+        This patch only changes the class String, once this has landed StringImpl, and
+        hopefully AtomicString too, should follow suit.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (identifierFromIdentifierRep):
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+        (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::ProxyInstance::getPropertyNames):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
+        * WebView/WebScriptDebugDelegate.mm:
+        (-[WebScriptCallFrame evaluateWebScript:]):
+        * WebView/WebScriptDebugger.mm:
+        (toNSURL):
+        * WebView/WebView.mm:
+        (aeDescFromJSValue):
+
+2010-04-16  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Expose the extremal shrink factors WebHTMLView uses when shrinking pages to fit in the
+        printing width as SPI.
+
+        * WebView/WebHTMLView.mm:
+        Replaced two macros with constants.
+        (-[WebHTMLView _beginPrintModeWithPageWidth:shrinkToFit:]): Changed to use the constants.
+        (-[WebHTMLView _scaleFactorForPrintOperation:]): Ditto.
+        * WebView/WebHTMLViewPrivate.h: Declared _WebHTMLViewPrintingMinimumShrinkFactor and
+        _WebHTMLViewPrintingMaximumShrinkFactor.
+
+2010-04-15  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7870651> WebDynamicScrollBarsView.h generates compile errors when included in plain Objective-C files.
+
+        * WebView/WebDynamicScrollBarsView.h:
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Export WebUserContentURLPattern from WebKit
+
+        Rubber-stamped by Mark Rowe.
+
+        * WebKit.exp:
+
+2010-04-15  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Made consecutive calls to -[WebHTMLView _beginPrintModeWithPageWidth:shrinkToFit:] work
+        without intermediate calls -[WebHTMLView _endPrintMode].
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]):
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Expose UserContentURLPattern as WebKit SPI
+
+        Fixes <http://webkit.org/b/37354>.
+
+        Reviewed by Tim Hatcher.
+
+        * Misc/WebUserContentURLPattern.h: Added.
+
+        * Misc/WebUserContentURLPattern.mm: Added.
+        (-[WebUserContentURLPattern initWithPatternString:]): Initialize
+        _private and then parse the passed-in string into a
+        UserContentURLPattern.
+        (-[WebUserContentURLPattern dealloc]): Release _private.
+
+        (-[WebUserContentURLPattern isValid]):
+        (-[WebUserContentURLPattern scheme]):
+        (-[WebUserContentURLPattern host]):
+        (-[WebUserContentURLPattern matchesSubdomains]):
+        Call through to UserContentURLPattern.
+
+2010-04-13  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Separated a DOMWrapperWorld's behavior of keeping wrappers alive from
+        its own lifetime, so a DOMWrapperWorld's controller can throw away
+        its wrappers even before its refcount reaches 0.
+
+        * WebView/WebScriptWorld.h:
+        * WebView/WebScriptWorld.mm:
+        (-[WebScriptWorld unregisterWorld]): Exported this function through WebKit.
+
+2010-04-12  Timothy Hatcher  <timothy@apple.com>
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * WebView/WebView.mm:
+        (+[WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
+        Call SecurityOrigin::removeOriginAccessWhitelistEntry.
+        * WebView/WebViewPrivate.h: Added _removeOriginAccessWhitelistEntryWithSourceOrigin.
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * WebView/WebView.mm:
+        (+[WebView _addOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
+        (+[WebView _resetOriginAccessWhitelists]):
+        * WebView/WebViewPrivate.h:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _canProvideDocumentSource]):
+        (-[WebFrame _receivedData:textEncodingName:]):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _canProvideDocumentSource]):
+        (-[WebFrame _receivedData:textEncodingName:]):
+
+2010-04-10  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        <rdar://problem/7845305> Further adoption of formal protocols for delegates.
+
+        Move EmptyProtocolDefinitions.h down in to WebCore, and add the new protocols. Adopt the protocols in the appropriate places.
+
+        * Misc/EmptyProtocolDefinitions.h: Removed.
+        * Misc/WebDownload.mm:
+        * WebKitPrefix.h:
+
+2010-04-09  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Work around QTMovieView bug (<rdar://problem/7712713>) by using a QTMovieLayer instead.
+        https://bugs.webkit.org/show_bug.cgi?id=37311 / <rdar://problem/7749993>
+
+        * WebView/WebVideoFullscreenController.mm:
+        (-[WebVideoFullscreenController windowDidLoad]):
+        (-[WebVideoFullscreenController setMediaElement:WebCore::]):
+
+2010-04-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24572
+        XMLHttpRequest.statusText returns always "OK" on Mac
+
+        * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
+
+2010-04-09  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r57343.
+        http://trac.webkit.org/changeset/57343
+        https://bugs.webkit.org/show_bug.cgi?id=37311
+
+        Broke Tiger compile.
+
+        * WebView/WebVideoFullscreenController.mm:
+        (-[WebVideoFullscreenController windowDidLoad]):
+        (-[WebVideoFullscreenController setMediaElement:WebCore::]):
+
+2010-04-09  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7846015> REGRESSION (r57332) - Crash in [WebDynamicScrollBarsView(WebInternal) reflectScrolledClipView:] when opening the Downloads window
+
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView initWithCoder:]): Added. Calls super and then initializes _private.
+
+2010-04-09  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Work around QTMovieView bug (<rdar://problem/7712713>) by using a QTMovieLayer instead.
+        https://bugs.webkit.org/show_bug.cgi?id=37311 / <rdar://problem/7749993>
+
+        * WebView/WebVideoFullscreenController.mm:
+        (-[WebVideoFullscreenController windowDidLoad]):
+        (-[WebVideoFullscreenController setMediaElement:WebCore::]):
+
+2010-04-08  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by John Sullivan.
+
+        <rdar://problem/7814899> REGRESSION(r56008): iTunes crashes on quit inside -[NSScrollView dealloc]
+
+        In r56008 new instance variables were added to WebDynamicScrollBarsView, increasing its size.
+        This causes problems for 32-bit applications that derive from WebDynamicScrollBarsView, as the
+        size and layout of their subclasses is baked in at compile time.  This results in instances
+        being allocated that are smaller than the new code expects, and may result in the new instance
+        variables sharing the same memory space as any instance variables that the subclass defines.
+
+        We can avoid this problem by having the class contain only a single member that acts as a pointer
+        to a heap-allocated structure that acts as storage for the real instance variables.  This makes
+        us free to add instance variables in the future without risk of changing the size of the class.
+        To ensure that 32-bit applications that are built against this new WebDynamicScrollBarsView header
+        are able to run against older versions of WebKit we pad the class out to its previous size.  This
+        results in any subclasses of WebDynamicScrollBarsView being created with a layout that is compatible
+        with both versions of the code.
+
+        This change could potentially break a subclass of WebDynamicScrollBarsView that directly accesses
+        instance variables of its superclass.  However, this is a private header and no known subclasses
+        of WebDynamicScrollBarsView access superclass instance variables in this fashion.
+
+        * WebView/WebDynamicScrollBarsView.h:
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView initWithFrame:]):
+        (-[WebDynamicScrollBarsView dealloc]):
+        (-[WebDynamicScrollBarsView finalize]):
+        (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]):
+        (-[WebDynamicScrollBarsView setAllowsScrollersToOverlapContent:]):
+        (-[WebDynamicScrollBarsView setAlwaysHideHorizontalScroller:]):
+        (-[WebDynamicScrollBarsView setAlwaysHideVerticalScroller:]):
+        (-[WebDynamicScrollBarsView horizontalScrollingAllowed]):
+        (-[WebDynamicScrollBarsView verticalScrollingAllowed]):
+        (-[WebDynamicScrollBarsView contentViewFrame]):
+        (-[WebDynamicScrollBarsView tile]):
+        (-[WebDynamicScrollBarsView setSuppressLayout:]):
+        (-[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]):
+        (-[WebDynamicScrollBarsView updateScrollers]):
+        (-[WebDynamicScrollBarsView reflectScrolledClipView:]):
+        (-[WebDynamicScrollBarsView allowsHorizontalScrolling]):
+        (-[WebDynamicScrollBarsView allowsVerticalScrolling]):
+        (-[WebDynamicScrollBarsView scrollingModes:WebCore::vertical:WebCore::]):
+        (-[WebDynamicScrollBarsView horizontalScrollingMode]):
+        (-[WebDynamicScrollBarsView verticalScrollingMode]):
+        (-[WebDynamicScrollBarsView setScrollingModes:vertical:andLock:]):
+        (-[WebDynamicScrollBarsView setHorizontalScrollingModeLocked:]):
+        (-[WebDynamicScrollBarsView setVerticalScrollingModeLocked:]):
+        (-[WebDynamicScrollBarsView setScrollingModesLocked:]):
+        (-[WebDynamicScrollBarsView horizontalScrollingModeLocked]):
+        (-[WebDynamicScrollBarsView verticalScrollingModeLocked]):
+        (-[WebDynamicScrollBarsView scrollWheel:]):
+
+2010-04-07  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24300, don't expose history info via CSS
+
+        Add SPI so that layout tests can access computed style including :visited information.
+
+        * WebView/WebRenderNode.mm:
+        (copyRenderNode):
+        * WebView/WebView.mm:
+        (-[WebView _computedStyleIncludingVisitedInfo:forElement:]):
+        * WebView/WebViewInternal.h:
+        * WebView/WebViewPrivate.h:
+
+2010-04-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Refactor WebHTMLView printing code and add private methods to enter and exit printing mode.
+        https://bugs.webkit.org/show_bug.cgi?id=37246
+
+        * Misc/WebNSPrintOperationExtras.h: Declared -_web_availablePaperWidth and -_web_availablePaperHeight.
+        * Misc/WebNSPrintOperationExtras.m:
+        (-[NSPrintOperation _web_availablePaperWidth]): Turned -[WebHTMLView _availablePaperWidthForPrintOperation:]
+        into this method.
+        (-[NSPrintOperation _web_availablePaperHeight]): Turned -[WebHTMLView _calculatePrintHeight] into this
+        method.
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _isInPrintMode]): Added this accessor.
+        (-[WebHTMLView _beginPrintModeWithPageWidth:shrinkToFit:]): Added. Moved the code from -knowsPageRange: that
+        computes the layout widths and enters printing mode into this private method.
+        (-[WebHTMLView _endPrintMode]): New private method (the old -_endPrintMode has been renamed).
+        (-[WebHTMLView _scaleFactorForPrintOperation:]): Use -[NSPrintOperation _web_availablePaperWidth].
+        (-[WebHTMLView _endPrintModeAndRestoreWindowAutodisplay]): Renamed -_endPrintMode to this, changed it to call
+        _endPrintMode.
+        (-[WebHTMLView _delayedEndPrintMode:]): Updated for rename.
+        (-[WebHTMLView knowsPageRange:]): Use -_beginPrintModeWithPageWidth:shrintToFit:,
+        -[NSPrintOperation _web_availablePaperWidth], and -[NSPrintOperation _web_availablePaperHeight]. Updated for
+        rename.
+        (-[WebHTMLView beginDocument]): Updated for rename.
+        (-[WebHTMLView endDocument]): Ditto.
+        * WebView/WebHTMLViewPrivate.h: Declared new private methods -_isInPrintMode,
+        -_beginPrintModeWithPageWidth:shrinkToFit: and -_endPrintMode.
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+
+2010-04-06  Dan Bernstein  <mitz@apple.com>
+
+        Tiger build fix after r57184.
+
+        * WebView/WebHTMLViewPrivate.h:
+
+2010-04-06  Dan Bernstein  <mitz@apple.com>
+
+        Tiger build fix after r57184.
+
+        * WebView/WebHTMLViewPrivate.h:
+
+2010-04-06  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Speculative build fix for Tiger.
+
+        * WebView/WebHTMLViewPrivate.h:
+
+2010-04-06  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig and Anders Carlsson.
+
+        Expose WebHTMLView’s page breaking logic as SPI.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]): Factored out of -adjustPageHeightNew:top:bottom:limit:
+        (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Call -_adjustedBottomOfPageWithTop:bottom:limit:
+        * WebView/WebHTMLViewPrivate.h: Declared -_adjustedBottomOfPageWithTop:bottom:limit:
+
+2010-04-06  Mark Rowe  <mrowe@apple.com>
+
+        Add an #if in order to make Tiger happy.
+
+        * WebView/WebViewData.mm:
+        (-[WebViewPrivate init]):
+
+2010-04-06  Mark Rowe  <mrowe@apple.com>
+
+        Build fix.
+
+        * WebView/WebViewData.mm:
+        (-[WebViewPrivate init]): Use objc_collectingEnabled like we do elsewhere in WebKit.
+
+2010-04-05  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Test case for <http://webkit.org/b/37115> / <rdar://problem/7829331>.
+        REGRESSION(r56989): Crash in Mail in WebCore::Position::isCandidate when deleting block using block deletion UI
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _updateFontPanel]): Ask the window whether it is the key window rather than doing the comparison
+        manually.  This allows DumpRenderTree's override of isKeyWindow to force this code path to be taken during tests.
+
+2010-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        * Plugins/Hosted/WebHostedNetscapePluginView.h: Removed _pluginDied - it was only used
+        for drawing replacement icon, and this information is now in WebCore.
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView pluginHostDied]): Tell RenderEmbeddedObject that the plug-in
+        has crashed.
+        (-[WebHostedNetscapePluginView drawRect:]): Removed the case for crashed plug-in host. It is
+        handled by WebCore now.
+
+        * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory crashedPluginText]): Added a string
+        for plug-in failure.        
+
+2010-04-03  yael aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Enable HTMLProgressElement for Safari on OSX
+        https://bugs.webkit.org/show_bug.cgi?id=36961
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-04-02  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Eric Carlson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36624
+        Add an INIT macro for the WebKitSystemInterface function wkQTMovieSelectPreferredAlternates.
+
+        * WebCoreSupport/WebSystemInterface.m:
+        (InitWebCoreSystemInterface):
+
+2010-04-02  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37043
+        Java regression tests spam stderr about being unable to set status message
+
+        With this change, there is still spam about "Attempt to access JavaScript from destroyed
+        applet, type 9." I haven't investigated if that indicates a problem or not.
+
+        * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerShowStatus:]):
+        Removed check for _documentView. We don't seem to care.
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add FILE_READER or FILE_WRITER feature defines.
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-04-01  Ada Chan  <adachan@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Change WebDatabaseManager::deleteOrigin() to return true if there are no errors in deleting the origin.
+        Ditto for WebDatabaseManager::deleteDatabase().
+        
+        https://bugs.webkit.org/show_bug.cgi?id=36988
+
+        * Storage/WebDatabaseManager.mm:
+        (-[WebDatabaseManager deleteOrigin:]):
+        (-[WebDatabaseManager deleteDatabase:withOrigin:]):
+        * Storage/WebDatabaseManagerPrivate.h:
+
+2010-04-01  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36976
+        <rdar://problem/7817498>
+        REGRESSION(r54783): Silverlight plug-in causes Safari to crash if JavaScript is disabled
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::get): The HashTable assertions aren't
+        there to catch potential future attempts to store empty/deleted values before these happen -
+        it's actually wrong to try to look up these values. Added an early return.
+        (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): Ditto.
+
+2010-04-01  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Added layerTreeAsText function to DRT (for Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=36782
+
+        This is the WebKit side for Mac. It plumbs the
+        call from WebCore to DRT.
+
+        * WebView/WebFrame.mm:WebKit (Mac) side of plumbing
+        (-[WebFrame _layerTreeAsText]):
+        * WebView/WebFramePrivate.h:
+
+2010-04-01  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36976
+        <rdar://problem/7817498>
+        REGRESSION(r54783): Silverlight plug-in causes Safari to crash if JavaScript is disabled
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::get): Use find() instead of get(),
+        because the latter fails with an assertion when looking up 0 or -1.
+        (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): Be prepared for unexpected
+        object IDs coming from plug-in host.
+
+2010-03-31  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 36845 - AX: need a way to set the label of a AXWebArea through WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=36845
+
+        Provide a way through WebKit to set an accessible label that describes the web area.    
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame setAccessibleName:]):
+        * WebView/WebFramePrivate.h:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::cancelGeolocationPermissionRequestForFrame):
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getCookies):
+        (WebKit::NetscapePluginInstanceProxy::getProxy):
+        (WebKit::NetscapePluginInstanceProxy::getAuthenticationInfo):
+        (WebKit::NetscapePluginInstanceProxy::resolveURL):
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView resolveURL:forTarget:]):
+
+2010-03-30  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36848
+        <rdar://problem/7362913>
+        Menu items appropriate only for rich-content editing can appear in plain-text contexts
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView validRequestorForSendType:returnType:]):
+        Don't return self for non-string content if _canEditRichly is false.
+
+2010-03-29  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36791
+        Add assertions for instance proxy validity
+
+        Add some assertions that the instance proxy hasn't been deleted. We sometimes keep a raw
+        pointer to one across complicated function calls, relying on the caller to protect the
+        reference.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        (WebKit::NetscapePluginInstanceProxy::renderContextID):
+        (WebKit::NetscapePluginInstanceProxy::pluginView):
+        (WebKit::NetscapePluginInstanceProxy::hostProxy):
+
+2010-03-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by David Kilzer.
+
+        Explicit guards for ENABLE_GEOLOCATION
+        https://bugs.webkit.org/show_bug.cgi?id=25756
+
+        * WebCoreSupport/WebGeolocationMock.mm:
+        (-[WebGeolocationMock setError:code:]): Make the body conditional on 
+        ENABLE(GEOLOCATION)
+        (-[WebGeolocationMock setPosition:]): Ditto.
+
+2010-03-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Change method name due to it dealing with both flattening
+        of frame sets and inner frames.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences isFrameFlatteningEnabled]):
+        (-[WebPreferences setFrameFlatteningEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChangedNotification:]):
+
+2010-03-27  Darin Adler  <darin@apple.com>
+
+        * Misc/WebNSFileManagerExtras.m:
+        (-[NSFileManager _webkit_pathWithUniqueFilenameForPath:]):
+        Removed stray "!". How did that get in there?
+
+2010-03-27  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        WebKit NSFileManager methods don't handle broken symlinks correctly.
+        Part of <rdar://problem/7574046>.
+
+        * Misc/WebNSFileManagerExtras.h: Removed unused defines and methods.
+        * Misc/WebNSFileManagerExtras.m: Removed unused methods.
+        (fileExists): Added. For use instead of fileExistsAtPath: for cases where we'd like
+        to treat a broken symlink as a file that does indeed exist.
+        (-[NSFileManager _webkit_pathWithUniqueFilenameForPath:]): Use fileExists.
+
+2010-03-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCRunSyncOpenPanel): Re-fetch host proxy in
+        a way that works in a function that doesn't have a pluginID argument for some reason.
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Build fix: no review.
+        
+        Another c_str() -> data().
+        
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::enumerate):
+
+2010-03-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Correctness fix after r56493.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCRunSyncOpenPanel): We still need to update
+        our hostProxy reference, even though we didn't use to have instanceProxy. Nothing guarantees
+        that the host proxy won't go away while the open panel is up.
+
+2010-03-24  Mark Rowe  <mrowe@apple.com>
+
+        Build fix after r56474.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WKPCRunSyncOpenPanel):
+
+2010-03-24  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36563
+        A plug-in makes Safari crash on http://www.itscodingtime.com/
+
+        * Plugins/Hosted/NetscapePluginHostProxy.h:
+        (WebKit::NetscapePluginHostProxy::port): Assert that the object is still alive. This isn't
+        beautifully systemic, but helped catch a bug, and may help catch more.
+        (WebKit::NetscapePluginHostProxy::clientPort): Ditto.
+        (WebKit::NetscapePluginHostProxy::isProcessingRequests): Changed m_processingRequests to a
+        static. This doesn't change behavior much, but helps avoid writing into deallocated memory.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Changed m_processingRequests
+        to a static.
+        (WebKit::NetscapePluginHostProxy::processRequests): Ditto. Changing m_processingRequests
+        after destroying the object in pluginHostDied() was wrong, but reasonably harmless, as there
+        wasn't much time for some other object to be allocated at this address.
+        (WKPCEvaluate): Refetch host proxy, as it may have been destroyed.
+        (WKPCInvoke): Ditto.
+        (WKPCInvokeDefault): Ditto.
+        (WKPCGetProperty): Ditto.
+        (WKPCSetProperty): Ditto.
+        (WKPCRemoveProperty): Ditto.
+        (WKPCHasProperty): Ditto.
+        (WKPCHasMethod): Ditto.
+        (WKPCEnumerate): Ditto.
+        (WKPCRunSyncOpenPanel): Ditto.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): Bail out of the 
+        "event loop" if host proxy went away while processing a request.
+
+2010-03-24  Hayato Ito  <hayato@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactor computePageRects so that Mac can make use of it.
+        https://bugs.webkit.org/show_bug.cgi?id=36159
+
+        Refactoring only, so no new tests.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::chooseIconForFiles):
+
+2010-03-23  Dan Bernstein  <mitz@apple.com>
+
+        Reverted accidental change from r56429.
+
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (WebContextMenuClient::getCustomMenuFromDefaultItems):
+
+2010-03-23  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        WebKit part of
+        <rdar://problem/7197736> Plug-in clip rect does not update when overflow
+        clip changes
+        https://bugs.webkit.org/show_bug.cgi?id=36479.
+
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView visibleRectDidChange]): Added. Calls
+        WKSyncSurfaceToView().
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView _windowClipRect]): Changed to use Widget::windowClipRect().
+        (-[WebBaseNetscapePluginView visibleRectDidChange]): Added. Invokes -renewGState.
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        This patch entirely WebNullPluginView.
+        
+        * Plugins/WebNetscapePluginView.mm:
+        * Plugins/WebNullPluginView.h: Removed.
+        * Plugins/WebNullPluginView.mm: Removed.
+        * Resources/nullplugin.tiff: Removed.
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createPlugin): Invoke the resource load delegate if the plug-in failed to load.
+
+2010-03-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36455
+        Make WebKit more resistant against plug-in crashes
+
+        No tests, because crashing on build bots isn't good, even if it's only helper processes
+        that crash.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        (WebKit::NetscapePluginInstanceProxy::waitForReply): Protect "this", because this function
+        needs it after waiting for reply. Some callers used to do this, but not all, and we really
+        shouldn't depend on callers here.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::wheelEvent): Don't protect the plug-in instance proxy,
+        because this function doesn't use it after waiting for reply.
+        (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): Ditto.
+
+        * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::invoke): Added an m_instanceProxy
+        null check for another code path.
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+
+        * WebCoreSupport/WebViewFactory.mm:
+        (-[WebViewFactory missingPluginText]): Added.
+
+2010-03-18  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36337
+        Log an error when an OOP plug-in sends an unknown object id
+
+        Making these LOG_ERROR and not ASSERTs, because I don't want early returns to look
+        temporary or redundant.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::evaluate):
+        (WebKit::NetscapePluginInstanceProxy::invoke):
+        (WebKit::NetscapePluginInstanceProxy::invokeDefault):
+        (WebKit::NetscapePluginInstanceProxy::construct):
+        (WebKit::NetscapePluginInstanceProxy::getProperty):
+        (WebKit::NetscapePluginInstanceProxy::setProperty):
+        (WebKit::NetscapePluginInstanceProxy::removeProperty):
+        (WebKit::NetscapePluginInstanceProxy::hasProperty):
+        (WebKit::NetscapePluginInstanceProxy::hasMethod):
+        (WebKit::NetscapePluginInstanceProxy::enumerate):
+
+2010-03-16  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36184
+        YouTube video resizing doesn't work with OOP plug-ins
+
+        Test: plugins/resize-from-plugin.html
+
+        We were calling _WKPHResizePluginInstance synchronously or asynchronously, depending on
+        whether the size has changed. But sync and async messages are not necessarily delivered in
+        order - plug-in host listens only to the former while waiting for a response to a message it
+        sent (a call to invoke() in this case).
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::resize):
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView updateAndSetWindow]):
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * WebCoreSupport/WebInspectorClient.h:
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorClient::WebInspectorClient):
+        (WebInspectorClient::inspectorDestroyed):
+        (WebInspectorClient::openInspectorFrontend):
+        (WebInspectorClient::highlight):
+        (WebInspectorClient::hideHighlight):
+        (WebInspectorFrontendClient::WebInspectorFrontendClient):
+        (WebInspectorFrontendClient::frontendLoaded):
+        (WebInspectorFrontendClient::localizedStringsURL):
+        (WebInspectorFrontendClient::hiddenPanels):
+        (WebInspectorFrontendClient::bringToFront):
+        (WebInspectorFrontendClient::closeWindow):
+        (WebInspectorFrontendClient::attachWindow):
+        (WebInspectorFrontendClient::detachWindow):
+        (WebInspectorFrontendClient::setAttachedWindowHeight):
+        (WebInspectorFrontendClient::inspectedURLChanged):
+        (WebInspectorFrontendClient::updateWindowTitle):
+        (-[WebInspectorWindowController dealloc]):
+        (-[WebInspectorWindowController windowShouldClose:]):
+        (-[WebInspectorWindowController close]):
+        (-[WebInspectorWindowController showWindow:]):
+        (-[WebInspectorWindowController attach]):
+        (-[WebInspectorWindowController detach]):
+        (-[WebInspectorWindowController attached]):
+        (-[WebInspectorWindowController setFrontendClient:]):
+        (-[WebInspectorWindowController destroyInspectorView]):
+        (-[WebNodeHighlighter initWithInspectedWebView:]):
+        (-[WebNodeHighlighter dealloc]):
+        (-[WebNodeHighlighter highlightNode:]):
+        (-[WebNodeHighlighter hideHighlight]):
+        (-[WebNodeHighlighter didAttachWebNodeHighlight:]):
+        (-[WebNodeHighlighter willDetachWebNodeHighlight:]):
+        * WebInspector/WebInspector.mm:
+        (-[WebInspector attach:]):
+        (-[WebInspector detach:]):
+
+2010-03-15  Andy Estes  <aestes@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Updated call to WKGetWheelEventDeltas() to match new method signature.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29601
+        <rdar://problem/7453254>
+
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView scrollWheel:]):
+
+2010-03-15  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Adam Roben.
+        
+        -[WebFrame setAlwaysHideHorizontal/VerticalScroller:] prevents keyboard scrolling
+        <https://bugs.webkit.org/show_bug.cgi?id=36125>
+
+        * WebView/WebDynamicScrollBarsView.h:
+        Added instance variables horizontalScrollingAllowedButScrollerHidden and
+        verticalScrollingAllowedButScrollerHidden. Renamed instance variables 
+        hideHorizontal/VerticalScroller to alwaysHideHorizontal/VerticalScroller for clarity.
+        Declared methods -horizontalScrollingAllowed and -verticalScrollingAllowed.
+        Added comments.
+        
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView setAlwaysHideHorizontalScroller:]):
+        Updated for instance variable renaming.
+        (-[WebDynamicScrollBarsView setAlwaysHideVerticalScroller:]):
+        Ditto.
+        (-[WebDynamicScrollBarsView horizontalScrollingAllowed]):
+        New method, returns YES if the scroller is showing or the only reason that the scroller
+        is not showing is that setAlwaysHideHorizontalScrolling has been called.
+        (-[WebDynamicScrollBarsView verticalScrollingAllowed]):
+        New method, returns YES if the scroller is showing or the only reason that the scroller
+        is not showing is that setAlwaysHideVerticalScrolling has been called.
+        (-[WebDynamicScrollBarsView updateScrollers]):
+        Updated for instance variable renamings. Now updates horizontalScrollingAllowedButScrollerHidden
+        and verticalScrollingAllowedButScrollerHidden. Now takes the always-hidden state into account
+        in the early-return code path, to avoid taking it into account twice in the regular code path.
+        
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _scrollToBeginningOfDocument]):
+        Use _isScrollable instead of _hasScrollBars.
+        (-[WebFrameView _scrollToEndOfDocument]):
+        Ditto.
+        (-[WebFrameView scrollToBeginningOfDocument:]):
+        Use _largestScrollableChild instead of _largestChildWithScrollBars.
+        (-[WebFrameView scrollToEndOfDocument:]):
+        Ditto.
+        (-[WebFrameView _pageVertically:]):
+        Use _isScrollable and _largestScrollableChild instead of _hasScrollBars
+        and _largestChildWithScrollBars.
+        (-[WebFrameView _pageHorizontally:]):
+        Ditto.
+        (-[WebFrameView _scrollLineVertically:]):
+        Ditto.
+        (-[WebFrameView _scrollLineHorizontally:]):
+        Ditto.
+        (-[WebFrameView keyDown:]):
+        Use _largestScrollableChild instead of _largestChildWithScrollBars.
+        (-[WebFrameView _isScrollable]):
+        New method, calls -[WebDynamicScrollBarsView horizontalScrollingAllowed] and
+        -[WebDynamicScrollBarsView verticalScrollingAllowed]
+        (-[WebFrameView _largestScrollableChild]):
+        New method, like _largestChildWithScrollBars but uses _isScrollable.
+        (-[WebFrameView _hasScrollBars]):
+        Added a comment that this is no longer used by Safari, and can thus probably be
+        deleted once we no longer want to support it for nightly build compatibility with
+        old versions of Safari.
+        (-[WebFrameView _largestChildWithScrollBars]):
+        Ditto.
+        
+        * WebView/WebFrameViewPrivate.h:
+        Declared -_isScrollable and -_largestScrollableChild. Added comments to
+        _hasScrollBars and _largestChildWithScrollBars saying that they are no longer
+        used by Safari, and can thus probably be deleted once we no longer want to 
+        support them for nightly build compatibility with old versions of Safari.
+
+2010-03-15  John Sullivan  <sullivan@apple.com>
+
+        Method name and parameter name mistakes from recent SPI addition
+        <https://bugs.webkit.org/show_bug.cgi?id=36119>
+
+        Reviewed by Dan Bernstein.
+
+        * WebView/WebDynamicScrollBarsView.h:
+        Renamed instance variable and method name from "setAllowXXX" to "setAllowsXXX".
+        
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView setAllowsScrollersToOverlapContent:]):
+        Updated for renamed instance variable and method.
+        (-[WebDynamicScrollBarsView setAlwaysHideHorizontalScroller:]):
+        Changed parameter name from shouldBeVisible to shouldBeHidden.
+        (-[WebDynamicScrollBarsView setAlwaysHideVerticalScroller:]):
+        Ditto.
+        (-[WebDynamicScrollBarsView contentViewFrame]):
+        Updated for renamed instance variable.
+        (-[WebDynamicScrollBarsView tile]):
+        Ditto.
+        (-[WebDynamicScrollBarsView reflectScrolledClipView:]):
+        Ditto.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame setAllowsScrollersToOverlapContent:]):
+        Renamed method from setAllowXXX, and updated for same change in WebDynamicScrollBarsView.
+
+        * WebView/WebFramePrivate.h:
+        Renamed method name from "setAllowXXX" to "setAllowsXXX".
+
+2010-03-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Remove unneeded dependency on non-string identifier for an NSTableColumn
+        https://bugs.webkit.org/show_bug.cgi?id=36106
+
+        * WebView/WebTextCompletionController.mm:
+        (-[WebTextCompletionController _buildUI]): Use init instead of initWithIdentifier:
+        because the table has only one column and that column does not need an identifier.
+
+2010-03-12  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen 
+        API naming is inconsistent
+        -and corresponding-
+        <rdar://problem/7729165>
+
+        This patch changes all occurrences of "fullScreen" to the more 
+        popular "fullscreen."
+
+        * Plugins/Hosted/NetscapePluginHostProxy.h:
+        (WebKit::NetscapePluginHostProxy::isFullscreenWindowShowing):
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+        (WebKit::NetscapePluginHostProxy::didEnterFullscreen):
+        (WebKit::NetscapePluginHostProxy::didExitFullscreen):
+        (WebKit::NetscapePluginHostProxy::setFullscreenWindowIsShowing):
+        (WKPCSetFullscreenWindowIsShowing):
+        * Plugins/Hosted/WebKitPluginClient.defs:
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView _workaroundSilverlightFullscreenBug:]):
+        (-[WebNetscapePluginView _createPlugin]):
+        (-[WebNetscapePluginView _destroyPlugin]):
+        * WebView/WebVideoFullscreenHUDWindowController.mm:
+        (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
+
+2010-03-12  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        Expose WebPDFView's underlying PDFDocument.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36045
+
+        * WebView/WebDocumentPrivate.h: Create a new protocol called
+        WebDocumentPDF.
+        * WebView/WebPDFView.h: Have WebPDFView implement said protocol.
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView PDFDocument]): Expose WebPDFView's underlying
+        PDFDocument by implementing -(PDFDocument*)PDFDocument from
+        WebDocumentPDF.
+
+2010-03-12  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        Remove an unused method.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35940
+
+        * Plugins/WebPluginController.mm:
+        removed - (void)showURL:(NSURL *) inFrame:(NSString *)
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by David Kilzer.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+        * Configurations/Base.xcconfig:
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
+        current Mac OS X version unless otherwise specified.
+
+        Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+        Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+        may not be usable when targetting a different Mac OS X version.
+
+        Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+        MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/DebugRelease.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+        * Configurations/Version.xcconfig:
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+
+2010-03-11  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35965
+        <rdar://problem/7742771> Crash when passing an object returned from plug-in back to the plug-in
+
+        Test: plugins/round-trip-npobject.html
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::retainLocalObject): Corrected the check - there is
+        now a separate ProxyRuntimeObject class for proxy pbjects.
+        (WebKit::NetscapePluginInstanceProxy::releaseLocalObject): Ditto.
+
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::ProxyInstance::invoke): Check if m_instanceProxy is still non-zero. The plug-in
+        could have crashed while we were waiting for response.
+        (WebKit::ProxyInstance::setFieldValue): Ditto.
+
+2010-03-10  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35975
+        <rdar://problem/7739922> Flash 10.1b crashes when generating snapshots
+
+        Do a version check before sending a drawRect event to a Flash plugin,
+        since 10.1.d51 has a bug that crashes when called this way.
+        
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView drawRect:]):
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView supportsSnapshotting]):
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView drawRect:]):
+
+2010-03-10  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7735387> input type other than text won't work with autofill
+        <https://bugs.webkit.org/show_bug.cgi?id=35963>
+
+        * WebView/WebHTMLRepresentation.mm:
+        (-[WebHTMLRepresentation elementDoesAutoComplete:]):
+        Return true for any text field that's not a password, rather than only
+        for TEXT type.
+
+2010-03-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        REGRESSION: WebInspector docking busted on Windows
+        <rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController showWindow:]): Use the InspectorController:: copy of the should attach settings key.
+        (-[WebInspectorWindowController attach]): Ditto.
+        (-[WebInspectorWindowController detach]): Ditto.
+
+2010-03-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Updated for FastMalloc reporting changes.
+        
+        * Misc/WebCoreStatistics.mm:
+        (+[WebCoreStatistics memoryStatistics]):
+
+2010-03-08  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        Move the new method to the end of the MIG definitions file, to avoid breaking
+        compatibility between WebKit and older versions of WebKitPluginHost.
+
+        * Plugins/Hosted/WebKitPluginHost.defs:
+
+2010-03-08  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Kevin Decker.
+
+        <rdar://problem/7714340> Need to grab image snapshot of Core Animation plugins
+        
+        Allow plug-ins using the Core Animation drawing model to be captured when doing a flattening paint,
+        by sending them a drawRect event as if they were software-painting.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::snapshot):
+        New snapshot() method that calls over to the plugin host, and then draws the image that comes back.
+        
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView drawRect:]): If we don't have a software renderer, but we're doing
+        a flattening paint, then call the snapshot method.
+        
+        * Plugins/Hosted/WebKitPluginHost.defs: Added snapshot method.
+        
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView inFlatteningPaint]):
+        New utility method that asks the FrameView whether the current paint behavior is
+        flattening.
+        
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView drawRect:]): If the plug-in is using CA but this is a flattening
+        paint, go ahead and send a drawRect event to the plug-in.
+
+2010-03-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Fix crash when you quit inside an unload handler.
+        rdar://problem/6958347
+
+        Test: manual-tests/quit-inside-unload.html
+
+        * WebView/WebView.mm:
+        (-[WebView _closeWithFastTeardown]): Removed code to set
+        _private->closed since _close now does this earlier, before
+        calling this method.
+        (-[WebView _close]): Moved code to set _private->closed to the
+        top of this method.
+        (-[WebView setHostWindow:]): Rewrote the code that forbade
+        setting the host window after closing so that it only forbids
+        non-nil host windows. That way, the code to clear away the host
+        window can run safely after setting _private->closed, yet client
+        code cannot set a new host window after closing.
+
+2010-03-08  Darin Adler  <darin@apple.com>
+
+        Roll out a file I checked in by accident.
+
+        * WebView/WebView.mm: Back to previous version.
+
+2010-03-08  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Turn on HW accel on Leopard even if coreVideoHas7228836Fix() is false, when WebGL is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=35759
+
+        This allows WebGL to work on Leopard without the fix. It exposes these users to the crash
+        that happens because of the CoreVideo bug, but it limits the exposure to those who have 
+        chosen to enable WebGL.
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChangedNotification:]):
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the mac port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::invalidateContents):
+        (WebChromeClient::invalidateWindow):
+        (WebChromeClient::invalidateContentsAndWindow):
+        (WebChromeClient::invalidateContentsForSlowScroll):
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+
+        Add ENABLE_BLOB_SLICE feature define.
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-03-08  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove the now-redundant Settings fields for the Database
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        No new tests; this code isn't called.
+
+        * WebView/WebView.mm: Remove the call into Settings.
+        (-[WebView _preferencesChangedNotification:]):
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Cameron Zwarich.
+
+        Remove unnecessary includes from header files, adding them to the handful of implementation files that need them.
+
+        * Misc/WebIconDatabase.mm:
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Cameron Zwarich.
+
+        Remove unnecessary includes from header files, adding them to the handful of implementation files that need them.
+
+        * Misc/WebNSPasteboardExtras.mm:
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7717249> DOMSVG.h includes a non-existent DOMSVGFEMorphologyElement.h
+
+        * MigrateHeaders.make: Migrate DOMSVGFEMorphologyElement.h and DOMSVGFEMorphologyElementInternal.h.
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Use a framework-style include to pull in WebInspector.h for consistency
+        with other parts of WebKit.
+
+        * WebInspector/WebInspectorPrivate.h:
+
+2010-03-04  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        REGRESSION (31281): -[WebArchive initWithCoder:] leaks
+        <rdar://problem/7702420> and https://bugs.webkit.org/show_bug.cgi?id=35534
+
+        * WebView/WebArchive.mm:
+        (-[WebArchive initWithCoder:]): Don't retain objects we don't own.
+
+2010-03-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35692
+        <rdar://problem/7703622> Crash when calling abort() on an XHR while in a windowless WebView
+
+        * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel runAsModalDialogWithChallenge:]):
+        Retain the challenge, just like it's done for sheet.
+
+2010-03-02  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Move database enable bit fully out of settings
+        This is stage one of a three-stage commit [webkit, then chromium, then
+        webkit again].  In this change I'm adding calls to
+        Database::setIsAvailable inside Settings::setDatabaseEnabled and
+        anywhere else that called it, and switching webkit fully over to using
+        that flag [added in a previous checkin].  Phase two will remove
+        Chromium's use of Settings for the Database, and phase three will remove
+        the Setting for the Database enable entirely, leaving only
+        Database::isAvailable/setIsAvailable.
+
+        No new tests; tested by existing storage tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35310
+
+        * WebView/WebView.mm:  Added a call to Database::setIsAvailable.
+        (-[WebView _preferencesChangedNotification:]):
+
+2010-03-02  Adam Roben  <aroben@apple.com>
+
+        Add -[WebView _registerURLSchemeAsSecure:]
+
+        Fixes <http://webkit.org/b/35580> <rdar://problem/7706407> Expose
+        SecurityOrigin::registerURLSchemeAsSecure as WebKit SPI
+
+        Reviewed by Tim Hatcher.
+
+        * WebView/WebView.mm:
+        (+[WebView _registerURLSchemeAsSecure:]):
+        * WebView/WebViewPrivate.h:
+        Added. Calls through to SecurityOrigin::registerURLSchemeAsSecure.
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChangedNotification:]):
+        (-[WebView _setZoomMultiplier:isTextOnly:]):
+        (-[WebView _realZoomMultiplierIsTextOnly]):
+
+2010-02-27  Jing Jin  <jjin@apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Move implementation of Bug 35449 into WebFramePrivate.
+
+        * WebView/WebFrame.h:
+        * WebView/WebFrame.mm:
+        (-[WebFrame setAllowScrollersToOverlapContent:]):
+        (-[WebFrame setAlwaysHideHorizontalScroller:]):
+        (-[WebFrame setAlwaysHideVerticalScroller:]):
+        * WebView/WebFramePrivate.h:
+
+2010-02-26  Jing Jin  <jjin@apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35449
+        Add ability to hide WebFrame scrollbars and to allow scrollbars to overlap with content.
+
+        * WebView/WebDynamicScrollBarsView.h:
+        * WebView/WebDynamicScrollBarsView.mm:
+        (-[WebDynamicScrollBarsView setAllowScrollersToOverlapContent:]): Allows scrollbars to 
+        overlap with the document and re-layouts the document.
+        (-[WebDynamicScrollBarsView setAlwaysHideHorizontalScroller:]): Hides the horizontal scrollbar.
+        (-[WebDynamicScrollBarsView setAlwaysHideVerticalScroller:]): Hides the vertical scrollbar.
+        (-[WebDynamicScrollBarsView contentViewFrame]): Calculates the appropriate frame based
+        on allowScrollersToOverlapContent.
+        (-[WebDynamicScrollBarsView tile]): If allowScrollersToOverlapContent is YES, set the
+        contentView's frame so it overlaps with the scrollbar.
+        (-[WebDynamicScrollBarsView updateScrollers]): Take into account hideHorizontalScroller
+        and hideVerticalScroller.
+        (-[WebDynamicScrollBarsView reflectScrolledClipView:]): set drawsBackground to NO when
+        scrollbars are overlapping with content, so we don't get trails during scrollbar draw updates.
+        * WebView/WebDynamicScrollBarsViewInternal.h:
+        * WebView/WebFrame.h:
+        * WebView/WebFrame.mm:
+        (-[WebFrame setAllowScrollersToOverlapContent:]): Hook for [WebDynamicScrollBarsView setAllowScrollersToOverlapContent:]
+        (-[WebFrame setAlwaysHideHorizontalScroller:]): Hook for [WebDynamicScrollBarsView setAlwaysHideHorizontalScroller:]
+        (-[WebFrame setAlwaysHideVerticalScroller:]): Hook for [WebDynamicScrollBarsView setAlwaysHideVerticalScroller:]
+
+2010-02-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Bug 35401 - Fix handling of errors in handling calls over bridge,
+        where base object bridge-type does not match method bridge-type.
+
+        The code assumes users will only attempt to invoke a Java method
+        on a Java base object, etc.
+        Add language specific subclasses of RuntimeMethod, and pass the
+        RuntimeMethod into invokeMethod, so we can typecheck before
+        casting.  Throw an exception on type mismatch.
+
+        * Plugins/Hosted/ProxyInstance.h:
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::PluginRuntimeMethod::PluginRuntimeMethod): new class to distinguish this type of RuntimeMethod.
+        (WebKit::ProxyInstance::getMethod): create an appropriate sublclass of RuntimeMethod.
+        (WebKit::ProxyInstance::invokeMethod): dynamically check the type of the RuntimeMethod.
+
+2010-02-25  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35394
+        <rdar://problem/7685262> Make passing objects between Java and plug-ins work
+
+        Added a ProxyInstance implementation of RuntimeObject.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+        * Plugins/Hosted/ProxyInstance.h:
+        * Plugins/Hosted/ProxyInstance.mm:
+        (WebKit::ProxyInstance::newRuntimeObject):
+        (WebKit::ProxyInstance::getClass):
+        * Plugins/Hosted/ProxyRuntimeObject.h: Added.
+        (WebKit::ProxyRuntimeObject::classInfo):
+        * Plugins/Hosted/ProxyRuntimeObject.mm: Added.
+        (WebKit::ProxyRuntimeObject::ProxyRuntimeObject):
+        (WebKit::ProxyRuntimeObject::~ProxyRuntimeObject):
+        (WebKit::ProxyRuntimeObject::getInternalProxyInstance):
+
+2010-02-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium API] Disambiguate allowJavaScript from didNotAllowScript
+        https://bugs.webkit.org/show_bug.cgi?id=35205
+
+        Make these two callsites explicit about not running script immediately.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
+        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
+
+2010-02-23  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher and Pavel Feldman.
+
+        Regression (r55107) - WebInspector docking is busted.
+        https://bugs.webkit.org/show_bug.cgi?id=35274
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController showWindow:]): Swap the order of the "should attach?" check
+          to get the expected behavior.
+
+2010-02-23  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        <rdar://problem/7611158> Incomplete repaint of YouTube timeline thumb while scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=34381
+
+        Test: fast/repaint/repaint-during-scroll.html
+
+        NSClipView offsets any rects marked as needing display during scrolling
+        by the scroll offset. Compensate for this when -setNeedsDisplay: is called
+        during scrolling.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _frameOrBoundsChanged]): Set inScrollPositionChanged to YES
+        around to call to FrameView::scrollPositionChanged().
+        (-[WebHTMLView setNeedsDisplayInRect:]): When called beneath
+        scrollPositionChanged(), adjust the rect by the inverse of the scroll offset.
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::cancelGeolocationPermissionRequestForFrame):
+
+2010-02-22  Alexey Proskuryakov  <ap@apple.com>
+
+        Rubber-stamped by Geoff Garen.
+
+        Rename RuntimeObjectImp to RuntimeObject.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+        (WebKit::NetscapePluginInstanceProxy::retainLocalObject):
+        (WebKit::NetscapePluginInstanceProxy::releaseLocalObject):
+
+2010-02-22  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Disable WebView docking to views that are too small.
+        <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController showWindow:]): No matter the preference, don't open the inspector 
+          window attached if WebCore says it shouldn't be attached.
+
+2010-02-22  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by John Sullivan.
+
+        <rdar://problem/7285392> 
+        On Leopard, we have to disable hardware acceleration if we detect that the
+        installed Core Video framework has bug <rdar://problem/7228836>.
+        
+        * WebView/WebView.mm:
+        (coreVideoHas7228836Fix):
+        (-[WebView _preferencesChangedNotification:]):
+
+2010-02-21  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        False warnings about needing layout in
+        -[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
+        https://bugs.webkit.org/show_bug.cgi?id=35218
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
+        Suppress the warning and the forced layout if the view is not being drawn
+        in this display operation.
+
+2010-02-21  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        plugInViewWithArguments: API sends wrong parameter for WebPlugInBaseURLKey
+        https://bugs.webkit.org/show_bug.cgi?id=35215
+        <rdar://problem/7673157>
+        
+        The plugInViewWithArguments: API passes a dictionary of plugin arguments. One of the parameters
+        is WebPlugInBaseURLKey, which is a key that represents the base URL of the document containing
+        the plug-in's view. Instead of sending the base URL, code in  WebFrameLoaderClient::createPlugin
+        would incorrectly pass the source URL of the plug-in resource.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createPlugin): When building the plug-in arguments dictionary, pass the
+        real base URL for the WebPlugInBaseURLKey key.
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        * Configurations/FeatureDefines.xcconfig:
+
+2010-02-19  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35132
+        <rdar://problem/7664353> Mouse cursor sometimes flickers over Flash content (35132)
+
+        * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
+        (WebNetscapePluginEventHandlerCarbon::mouseMoved): Send adjustCursor events on every mouse
+        move. This matches Firefox, and is actually required for plug-ins to manipulate cursor wihout
+        resorting to techniques such as fast firing timers.
+
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView handleMouseEntered:]): Some plug-ins handle mouse cursor internally,
+        but those that don't just need to get an arrow cursor (matching Firefox). This means that
+        e.g. a plugin inside <A> won't get a finger mouse pointer.
+
+        * Plugins/WebHostedNetscapePluginView.mm:
+        (-[WebNetscapePluginView handleMouseEntered:]):
+        (-[WebNetscapePluginView handleMouseExited:]):
+        Implement this behavior here, too. Also, out of process code didn't reset mouse pointer on
+        mouse exit, which it needed to do.
+
+        * WebView/WebHTMLView.mm:
+        (needsCursorRectsSupportAtPoint):
+        (setCursor):
+        (resetCursorRects):
+        Make sure that the same workaround we have for Web content also applies to Netscape plug-ins,
+        as AppKit would reset the mouse pointer to arrow if given a chance.
+        (+[WebHTMLViewPrivate initialize]): Renamed setCursorIMP on Leopard and higher to prevent
+        confusion - the method we override is completely different.
+        (-[WebHTMLView hitTest:]): Added a FIXME about a likely bug.
+
 2010-02-19  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebKit/mac/Configurations/Base.xcconfig b/WebKit/mac/Configurations/Base.xcconfig
index eb16d36..7914aed 100644
--- a/WebKit/mac/Configurations/Base.xcconfig
+++ b/WebKit/mac/Configurations/Base.xcconfig
@@ -53,6 +53,8 @@
 REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
 REAL_PLATFORM_NAME_macosx = macosx;
 
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
+
 
 // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
 // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -78,6 +80,26 @@
 // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
 // number.  Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
 // XCODE_VERSION_ACTUAL for the full version number.
-GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR));
-GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL));
-GCC_VERSION_0310 = 4.2;
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
diff --git a/WebKit/mac/Configurations/DebugRelease.xcconfig b/WebKit/mac/Configurations/DebugRelease.xcconfig
index 11a94ca..77f7893 100644
--- a/WebKit/mac/Configurations/DebugRelease.xcconfig
+++ b/WebKit/mac/Configurations/DebugRelease.xcconfig
@@ -23,7 +23,7 @@
 
 #include "Base.xcconfig"
 
-ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ARCHS_ = $(ARCHS_1040);
 ARCHS_1040 = $(NATIVE_ARCH);
 ARCHS_1050 = $(NATIVE_ARCH);
@@ -32,7 +32,7 @@
 
 ONLY_ACTIVE_ARCH = YES;
 
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR));
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 MACOSX_DEPLOYMENT_TARGET_ = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
@@ -43,7 +43,7 @@
 
 SECTORDER_FLAGS = ;
 
-WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(MAC_OS_X_VERSION_MAJOR));
+WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 WEBKIT_SYSTEM_INTERFACE_LIBRARY_ = WebKitSystemInterfaceTiger;
 WEBKIT_SYSTEM_INTERFACE_LIBRARY_1040 = WebKitSystemInterfaceTiger;
 WEBKIT_SYSTEM_INTERFACE_LIBRARY_1050 = WebKitSystemInterfaceLeopard;
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 8343ce7..881c788 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -31,16 +31,17 @@
 
 // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
 
-ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS;
 ENABLE_3D_CANVAS_1070 = ENABLE_3D_CANVAS;
 
-ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
+ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING;
 ENABLE_3D_RENDERING_1070 = ENABLE_3D_RENDERING;
 
+ENABLE_BLOB_SLICE = ENABLE_BLOB_SLICE;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
 ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
 ENABLE_DATABASE = ENABLE_DATABASE;
@@ -49,6 +50,8 @@
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -56,7 +59,9 @@
 ENABLE_MATHML = ;
 ENABLE_NOTIFICATIONS = ;
 ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
+ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG;
 ENABLE_RUBY = ENABLE_RUBY;
+ENABLE_SANDBOX = ENABLE_SANDBOX;
 ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS;
 ENABLE_SVG = ENABLE_SVG;
 ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
@@ -73,4 +78,4 @@
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 0e289b1..6aeb263 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
 MAJOR_VERSION = 533;
-MINOR_VERSION = 1;
+MINOR_VERSION = 6;
 TINY_VERSION = 0;
 FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
 
@@ -31,7 +31,7 @@
 SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
 
 // The system version prefix is based on the current system version.
-SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
+SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR.
 SYSTEM_VERSION_PREFIX_1040 = 4;
 SYSTEM_VERSION_PREFIX_1050 = 5;
diff --git a/WebKit/mac/ForwardingHeaders/runtime/Error.h b/WebKit/mac/ForwardingHeaders/runtime/Error.h
new file mode 100644
index 0000000..05d7752
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/runtime/Error.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/Error.h>
diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make
index f4bf744..061169e 100644
--- a/WebKit/mac/MigrateHeaders.make
+++ b/WebKit/mac/MigrateHeaders.make
@@ -291,6 +291,8 @@
     $(INTERNAL_HEADERS_DIR)/DOMSVGFEMergeElementInternal.h \
     $(PRIVATE_HEADERS_DIR)/DOMSVGFEMergeNodeElement.h \
     $(INTERNAL_HEADERS_DIR)/DOMSVGFEMergeNodeElementInternal.h \
+    $(PRIVATE_HEADERS_DIR)/DOMSVGFEMorphologyElement.h \
+    $(INTERNAL_HEADERS_DIR)/DOMSVGFEMorphologyElementInternal.h \
     $(PRIVATE_HEADERS_DIR)/DOMSVGFEOffsetElement.h \
     $(INTERNAL_HEADERS_DIR)/DOMSVGFEOffsetElementInternal.h \
     $(PRIVATE_HEADERS_DIR)/DOMSVGFEPointLightElement.h \
diff --git a/WebKit/mac/Misc/EmptyProtocolDefinitions.h b/WebKit/mac/Misc/EmptyProtocolDefinitions.h
deleted file mode 100644
index c52d8ce..0000000
--- a/WebKit/mac/Misc/EmptyProtocolDefinitions.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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 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.
- */
-
-#if defined(__OBJC__)
-
-#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
-#define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 0
-#else
-#define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 1
-#endif
-
-#if !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS
-
-#define EMPTY_PROTOCOL(NAME) \
-@protocol NAME <NSObject> \
-@end
-
-EMPTY_PROTOCOL(NSTableViewDataSource)
-EMPTY_PROTOCOL(NSTableViewDelegate)
-EMPTY_PROTOCOL(NSWindowDelegate)
-
-#undef EMPTY_PROTOCOL
-
-#endif /* !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS */
-
-#endif /* defined(__OBJC__) */
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index 9e8ae05..1351fe5 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -196,10 +196,9 @@
     JSLock lock(SilenceAssertionsOnly);
     Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
     return [NSDictionary dictionaryWithObjectsAndKeys:
-                [NSNumber numberWithInt:fastMallocStatistics.heapSize], @"FastMallocHeapSize",
-                [NSNumber numberWithInt:fastMallocStatistics.freeSizeInHeap], @"FastMallocFreeSizeInHeap",
-                [NSNumber numberWithInt:fastMallocStatistics.freeSizeInCaches], @"FastMallocFreeSizeInCaches",
-                [NSNumber numberWithInt:fastMallocStatistics.returnedSize], @"FastMallocReturnedSize",
+                [NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes",
+                [NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes",
+                [NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes",
                 [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize",
                 [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize",
             nil];
diff --git a/WebKit/mac/Misc/WebDownload.mm b/WebKit/mac/Misc/WebDownload.mm
index 01ed767..82c1259 100644
--- a/WebKit/mac/Misc/WebDownload.mm
+++ b/WebKit/mac/Misc/WebDownload.mm
@@ -56,7 +56,7 @@
              directory:(NSString *)directory;
 @end
 
-@interface WebDownloadInternal : NSObject
+@interface WebDownloadInternal : NSObject <NSURLDownloadDelegate>
 {
 @public
     id realDelegate;
diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm
index 62c8e2f..0ded0d5 100644
--- a/WebKit/mac/Misc/WebIconDatabase.mm
+++ b/WebKit/mac/Misc/WebIconDatabase.mm
@@ -40,6 +40,7 @@
 #import <WebCore/IconDatabase.h>
 #import <WebCore/Image.h>
 #import <WebCore/IntSize.h>
+#import <WebCore/SharedBuffer.h>
 #import <WebCore/ThreadCheck.h>
 
 using namespace WebCore;
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.h b/WebKit/mac/Misc/WebNSFileManagerExtras.h
index c2287f9..dcf62d0 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.h
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,19 +28,10 @@
 
 #import <Foundation/Foundation.h>
 
-#define WEB_UREAD     (00400)   /* Read by owner */
-#define WEB_UWRITE    (00200)   /* Write by owner */
-#define WEB_UEXEC     (00100)   /* Execute/Search by owner */
-
 @interface NSFileManager (WebNSFileManagerExtras)
-
-- (void)_webkit_backgroundRemoveFileAtPath:(NSString *)path;
-- (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path;
-- (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path;
 - (void)_webkit_setMetadataURL:(NSString *)URLString referrer:(NSString *)referrer atPath:(NSString *)path;
 - (NSString *)_webkit_startupVolumeName;
 - (NSString *)_webkit_pathWithUniqueFilenameForPath:(NSString *)path;
-
 @end
 
 
diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m
index fb1286f..f10781b 100644
--- a/WebKit/mac/Misc/WebNSFileManagerExtras.m
+++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,74 +30,13 @@
 
 #import "WebKitNSStringExtras.h"
 #import "WebNSURLExtras.h"
+#import <JavaScriptCore/Assertions.h>
 #import <WebCore/FoundationExtras.h>
 #import <WebKitSystemInterface.h>
-#import <pthread.h>
-#import <sys/mount.h>
-#import <JavaScriptCore/Assertions.h>
+#import <sys/stat.h>
 
 @implementation NSFileManager (WebNSFileManagerExtras)
 
-- (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path
-{
-    struct statfs buf;
-    BOOL result = unlink([path fileSystemRepresentation]) == 0;
-
-    // For mysterious reasons, MNT_DOVOLFS is the flag for "supports resource fork"
-    if ((statfs([path fileSystemRepresentation], &buf) == 0) && !(buf.f_flags & MNT_DOVOLFS)) {
-        NSString *lastPathComponent = [path lastPathComponent];
-        if ([lastPathComponent length] != 0 && ![lastPathComponent isEqualToString:@"/"]) {
-            NSString *resourcePath = [[path stringByDeletingLastPathComponent] stringByAppendingString:[@"._" stringByAppendingString:lastPathComponent]];
-            if (unlink([resourcePath fileSystemRepresentation]) != 0) {
-                result = NO;
-            }
-        }
-    }
-
-    return result;
-}
-
-- (void)_webkit_backgroundRemoveFileAtPath:(NSString *)path
-{
-    NSFileManager *manager;
-    NSString *moveToSubpath;
-    NSString *moveToPath;
-    int i;
-    
-    manager = [NSFileManager defaultManager];
-    
-    i = 0;
-    moveToSubpath = [path stringByDeletingLastPathComponent];
-    do {
-        moveToPath = [NSString stringWithFormat:@"%@/.tmp%d", moveToSubpath, i];
-        i++;
-    } while ([manager fileExistsAtPath:moveToPath]);
-
-    if ([manager moveItemAtPath:path toPath:moveToPath error:NULL])
-        [NSThread detachNewThreadSelector:@selector(_performRemoveFileAtPath:) toTarget:self withObject:moveToPath];
-}
-
-- (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path
-{
-    NSFileManager *manager;
-    NSString *leftoverSubpath;
-    NSString *leftoverPath;
-    int i;
-    
-    manager = [NSFileManager defaultManager];
-    leftoverSubpath = [path stringByDeletingLastPathComponent];
-    
-    i = 0;
-    while (1) {
-        leftoverPath = [NSString stringWithFormat:@"%@/.tmp%d", leftoverSubpath, i];
-        if (![manager fileExistsAtPath:leftoverPath]) {
-            break;
-        }
-        [NSThread detachNewThreadSelector:@selector(_performRemoveFileAtPath:) toTarget:self withObject:leftoverPath];
-        i++;
-    }
-}
-
 - (NSString *)_webkit_carbonPathForPath:(NSString *)posixPath
 {
     OSStatus error;
@@ -199,14 +138,22 @@
     return [path substringToIndex:[path length]-1];
 }
 
+// -[NSFileManager fileExistsAtPath:] returns NO if there is a broken symlink at the path.
+// So we use this function instead, which returns YES if there is anything there, including
+// a broken symlink.
+static BOOL fileExists(NSString *path)
+{
+    struct stat statBuffer;
+    return !lstat([path fileSystemRepresentation], &statBuffer);
+}
+
 - (NSString *)_webkit_pathWithUniqueFilenameForPath:(NSString *)path
 {
     // "Fix" the filename of the path.
     NSString *filename = [[path lastPathComponent] _webkit_filenameByFixingIllegalCharacters];
     path = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:filename];
 
-    NSFileManager *fileManager = [NSFileManager defaultManager];
-    if ([fileManager fileExistsAtPath:path]) {
+    if (fileExists(path)) {
         // Don't overwrite existing file by appending "-n", "-n.ext" or "-n.ext.ext" to the filename.
         NSString *extensions = nil;
         NSString *pathWithoutExtensions;
@@ -221,15 +168,11 @@
             pathWithoutExtensions = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:lastPathComponent];
         }
 
-        NSString *pathWithAppendedNumber;
-        unsigned i;
-
-        for (i = 1; 1; i++) {
-            pathWithAppendedNumber = [NSString stringWithFormat:@"%@-%d", pathWithoutExtensions, i];
+        for (unsigned i = 1; ; i++) {
+            NSString *pathWithAppendedNumber = [NSString stringWithFormat:@"%@-%d", pathWithoutExtensions, i];
             path = [extensions length] ? [pathWithAppendedNumber stringByAppendingPathExtension:extensions] : pathWithAppendedNumber;
-            if (![fileManager fileExistsAtPath:path]) {
+            if (!fileExists(path))
                 break;
-            }
         }
     }
 
@@ -238,8 +181,8 @@
 
 @end
 
-
 #ifdef BUILDING_ON_TIGER
+
 @implementation NSFileManager (WebNSFileManagerTigerForwardCompatibility)
 
 - (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error
@@ -293,4 +236,5 @@
 }
 
 @end
+
 #endif
diff --git a/WebKit/mac/Misc/WebNSPasteboardExtras.mm b/WebKit/mac/Misc/WebNSPasteboardExtras.mm
index 3cc1c7c..8cebeb6 100644
--- a/WebKit/mac/Misc/WebNSPasteboardExtras.mm
+++ b/WebKit/mac/Misc/WebNSPasteboardExtras.mm
@@ -37,14 +37,15 @@
 #import "WebURLsWithTitles.h"
 #import "WebViewPrivate.h"
 #import <WebCore/Element.h>
+#import <WebCore/Image.h>
 #import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/RenderImage.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKit/DOMPrivate.h>
-#import <wtf/Assertions.h>
-#import <wtf/StdLibExtras.h>
-#import <wtf/RetainPtr.h>
 #import <WebKitSystemInterface.h>
+#import <wtf/Assertions.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/StdLibExtras.h>
 
 @interface NSFilePromiseDragSource : NSObject
 - initWithSource:(id)draggingSource;
diff --git a/WebKit/mac/Misc/WebNSPrintOperationExtras.h b/WebKit/mac/Misc/WebNSPrintOperationExtras.h
index 44eb3df..3535369 100644
--- a/WebKit/mac/Misc/WebNSPrintOperationExtras.h
+++ b/WebKit/mac/Misc/WebNSPrintOperationExtras.h
@@ -31,5 +31,7 @@
 @interface NSPrintOperation (WebKitExtras)
 
 - (float)_web_pageSetupScaleFactor;
+- (float)_web_availablePaperWidth;
+- (float)_web_availablePaperHeight;
 
 @end
diff --git a/WebKit/mac/Misc/WebNSPrintOperationExtras.m b/WebKit/mac/Misc/WebNSPrintOperationExtras.m
index 4c45f17..0982b96 100644
--- a/WebKit/mac/Misc/WebNSPrintOperationExtras.m
+++ b/WebKit/mac/Misc/WebNSPrintOperationExtras.m
@@ -35,4 +35,16 @@
     return [[[[self printInfo] dictionary] objectForKey:NSPrintScalingFactor] floatValue];
 }
 
+- (float)_web_availablePaperWidth
+{
+    NSPrintInfo *printInfo = [self printInfo];
+    return [printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin];
+}
+
+- (float)_web_availablePaperHeight
+{
+    NSPrintInfo *printInfo = [self printInfo];
+    return [printInfo paperSize].height - [printInfo topMargin] - [printInfo bottomMargin];
+}
+
 @end
diff --git a/WebKit/mac/Misc/WebUserContentURLPattern.h b/WebKit/mac/Misc/WebUserContentURLPattern.h
new file mode 100644
index 0000000..6ec4bcf
--- /dev/null
+++ b/WebKit/mac/Misc/WebUserContentURLPattern.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+@class WebUserContentURLPatternPrivate;
+
+@interface WebUserContentURLPattern : NSObject {
+    WebUserContentURLPatternPrivate *_private;
+}
+
+- (id)initWithPatternString:(NSString *)patternString;
+
+- (BOOL)isValid;
+- (NSString *)scheme;
+- (NSString *)host;
+- (BOOL)matchesSubdomains;
+
+@end
diff --git a/WebKit/mac/Misc/WebUserContentURLPattern.mm b/WebKit/mac/Misc/WebUserContentURLPattern.mm
new file mode 100644
index 0000000..5d9f49e
--- /dev/null
+++ b/WebKit/mac/Misc/WebUserContentURLPattern.mm
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import "WebUserContentURLPattern.h"
+
+#import <WebCore/UserContentURLPattern.h>
+
+using namespace WebCore;
+
+@interface WebUserContentURLPatternPrivate : NSObject
+{
+@public
+    UserContentURLPattern pattern;
+}
+@end
+
+@implementation WebUserContentURLPatternPrivate
+@end
+
+@implementation WebUserContentURLPattern
+
+- (id)initWithPatternString:(NSString *)patternString
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _private = [[WebUserContentURLPatternPrivate alloc] init];
+    _private->pattern = UserContentURLPattern(patternString);
+
+    return self;
+}
+
+- (void)dealloc
+{
+    [_private release];
+    _private = nil;
+
+    [super dealloc];
+}
+
+- (BOOL)isValid
+{
+    return _private->pattern.isValid();
+}
+
+- (NSString *)scheme
+{
+    return _private->pattern.scheme();
+}
+
+- (NSString *)host
+{
+    return _private->pattern.host();
+}
+
+- (BOOL)matchesSubdomains
+{
+    return _private->pattern.matchSubdomains();
+}
+
+@end
diff --git a/WebKit/mac/Panels/WebAuthenticationPanel.m b/WebKit/mac/Panels/WebAuthenticationPanel.m
index f207d0c..c9442da 100644
--- a/WebKit/mac/Panels/WebAuthenticationPanel.m
+++ b/WebKit/mac/Panels/WebAuthenticationPanel.m
@@ -218,7 +218,9 @@
 - (void)runAsModalDialogWithChallenge:(NSURLAuthenticationChallenge *)chall
 {
     [self setUpForChallenge:chall];
+
     usingSheet = FALSE;
+    [chall retain];
     NSURLCredential *credential = nil;
 
     if ([[NSApplication sharedApplication] runModalForWindow:panel] == 0) {
@@ -227,6 +229,7 @@
 
     [callback performSelector:selector withObject:chall withObject:credential];
     [credential release];
+    [chall release];
 }
 
 - (void)runAsSheetOnWindow:(NSWindow *)window withChallenge:(NSURLAuthenticationChallenge *)chall
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
index cd3729f..d35503f 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
@@ -43,8 +43,8 @@
 public:
     NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN, bool shouldCacheMissingPropertiesAndMethods);
     
-    mach_port_t port() const { return m_pluginHostPort; }
-    mach_port_t clientPort() const { return m_clientPort; }
+    mach_port_t port() const { ASSERT(fastMallocSize(this)); return m_pluginHostPort; }
+    mach_port_t clientPort() const { ASSERT(fastMallocSize(this)); return m_clientPort; }
 
     void addPluginInstance(NetscapePluginInstanceProxy*);
     void removePluginInstance(NetscapePluginInstanceProxy*);
@@ -54,15 +54,15 @@
     bool isMenuBarVisible() const { return m_menuBarIsVisible; }
     void setMenuBarVisible(bool);
 
-    bool isFullScreenWindowShowing() const { return m_fullScreenWindowIsShowing; }
-    void setFullScreenWindowIsShowing(bool);
+    bool isFullscreenWindowShowing() const { return m_fullscreenWindowIsShowing; }
+    void setFullscreenWindowIsShowing(bool);
 
     void setModal(bool);
 
     void applicationDidBecomeActive();
     
     bool processRequests();
-    bool isProcessingRequests() const { return m_processingRequests; }
+    static bool isProcessingRequests() { return s_processingRequests; }
     
     bool shouldCacheMissingPropertiesAndMethods() const { return m_shouldCacheMissingPropertiesAndMethods; }
     
@@ -73,8 +73,8 @@
     void beginModal();
     void endModal();
 
-    void didEnterFullScreen() const;
-    void didExitFullScreen() const;
+    void didEnterFullscreen() const;
+    void didExitFullscreen() const;
 
     static void deadNameNotificationCallback(CFMachPortRef, void *msg, CFIndex size, void *info);
 
@@ -96,10 +96,10 @@
     RetainPtr<WebPlaceholderModalWindow *> m_placeholderWindow;
     unsigned m_isModal;
     bool m_menuBarIsVisible;
-    bool m_fullScreenWindowIsShowing;
+    bool m_fullscreenWindowIsShowing;
     const ProcessSerialNumber m_pluginHostPSN;
 
-    unsigned m_processingRequests;
+    static unsigned s_processingRequests;
 
     bool m_shouldCacheMissingPropertiesAndMethods;
 };
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 836277c..b437012 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -89,15 +89,16 @@
     return pluginProxyMap;
 }
 
+unsigned NetscapePluginHostProxy::s_processingRequests;
+
 NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN, bool shouldCacheMissingPropertiesAndMethods)
     : m_clientPort(clientPort)
     , m_portSet(MACH_PORT_NULL)
     , m_pluginHostPort(pluginHostPort)
     , m_isModal(false)
     , m_menuBarIsVisible(true)
-    , m_fullScreenWindowIsShowing(false)
+    , m_fullscreenWindowIsShowing(false)
     , m_pluginHostPSN(pluginHostPSN)
-    , m_processingRequests(0)
     , m_shouldCacheMissingPropertiesAndMethods(shouldCacheMissingPropertiesAndMethods)
 {
     pluginProxyMap().add(m_clientPort, this);
@@ -184,7 +185,9 @@
 
 NetscapePluginInstanceProxy* NetscapePluginHostProxy::pluginInstance(uint32_t pluginID)
 {
-    return m_instances.get(pluginID).get();
+    NetscapePluginInstanceProxy* result = m_instances.get(pluginID).get();
+    ASSERT(!result || result->hostProxy() == this);
+    return result;
 }
 
 void NetscapePluginHostProxy::deadNameNotificationCallback(CFMachPortRef port, void *msg, CFIndex size, void *info)
@@ -202,12 +205,12 @@
     [NSMenu setMenuBarVisible:visible];
 }
 
-void NetscapePluginHostProxy::didEnterFullScreen() const
+void NetscapePluginHostProxy::didEnterFullscreen() const
 {
     SetFrontProcess(&m_pluginHostPSN);
 }
 
-void NetscapePluginHostProxy::didExitFullScreen() const
+void NetscapePluginHostProxy::didExitFullscreen() const
 {
     // If the plug-in host is the current application then we should bring ourselves to the front when it exits full-screen mode.
 
@@ -223,16 +226,16 @@
     SetFrontProcess(&currentProcess);
 }
 
-void NetscapePluginHostProxy::setFullScreenWindowIsShowing(bool isShowing)
+void NetscapePluginHostProxy::setFullscreenWindowIsShowing(bool isShowing)
 {
-    if (m_fullScreenWindowIsShowing == isShowing)
+    if (m_fullscreenWindowIsShowing == isShowing)
         return;
 
-    m_fullScreenWindowIsShowing = isShowing;
-    if (m_fullScreenWindowIsShowing)
-        didEnterFullScreen();
+    m_fullscreenWindowIsShowing = isShowing;
+    if (m_fullscreenWindowIsShowing)
+        didEnterFullscreen();
     else
-        didExitFullScreen();
+        didExitFullscreen();
 
 }
 
@@ -294,7 +297,7 @@
     
 bool NetscapePluginHostProxy::processRequests()
 {
-    m_processingRequests++;
+    s_processingRequests++;
 
    if (!m_portSet) {
         mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &m_portSet);
@@ -310,7 +313,7 @@
     
     if (kr != KERN_SUCCESS) {
         LOG_ERROR("Could not receive mach message, error %x", kr);
-        m_processingRequests--;
+        s_processingRequests--;
         return false;
     }
     
@@ -323,24 +326,24 @@
             
             if (kr != KERN_SUCCESS) {
                 LOG_ERROR("Could not send mach message, error %x", kr);
-                m_processingRequests--;
+                s_processingRequests--;
                 return false;
             }
         }
         
-        m_processingRequests--;
+        s_processingRequests--;
         return true;
     }
     
     if (msg->msgh_local_port == CFMachPortGetPort(m_deadNameNotificationPort.get())) {
         ASSERT(msg->msgh_id == MACH_NOTIFY_DEAD_NAME);
         pluginHostDied();
-        m_processingRequests--;
+        s_processingRequests--;
         return false;
     }
     
     ASSERT_NOT_REACHED();
-    m_processingRequests--;
+    s_processingRequests--;
     return false;
 }
 
@@ -437,7 +440,7 @@
         if (NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID))
             instanceProxy->invalidateRect(x, y, width, height);
         return KERN_SUCCESS;
-    }        
+    }
 
     // Defer the work
     CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopDefaultMode, ^{
@@ -578,7 +581,11 @@
     data_t resultData = 0;
     mach_msg_type_number_t resultLength = 0;
     boolean_t returnValue = instanceProxy->evaluate(objectID, script, resultData, resultLength, allowPopups);
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
     if (resultData)
         mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
@@ -610,7 +617,7 @@
     ASSERT(identifier->isString());
   
     const char* str = identifier->string();    
-    return Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str)));
+    return Identifier(JSDOMWindow::commonJSGlobalData(), stringToUString(String::fromUTF8WithLatin1Fallback(str, strlen(str))));
 }
 
 kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier,
@@ -637,7 +644,11 @@
     data_t resultData = 0;
     mach_msg_type_number_t resultLength = 0;
     boolean_t returnValue = instanceProxy->invoke(objectID, methodNameIdentifier, argumentsData, argumentsLength, resultData, resultLength);
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
     if (resultData)
         mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
@@ -663,7 +674,11 @@
     data_t resultData = 0;
     mach_msg_type_number_t resultLength = 0;
     boolean_t returnValue = instanceProxy->invokeDefault(objectID, argumentsData, argumentsLength, resultData, resultLength);
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
     if (resultData)
         mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
@@ -701,7 +716,7 @@
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
     if (!instanceProxy)
         return KERN_FAILURE;
-    
+
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
     if (!IdentifierRep::isValid(identifier))
         return KERN_FAILURE;
@@ -717,7 +732,11 @@
         returnValue = instanceProxy->getProperty(objectID, propertyNameIdentifier, resultData, resultLength);
     } else 
         returnValue = instanceProxy->setProperty(objectID, identifier->number(), resultData, resultLength);
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
     if (resultData)
         mig_deallocate(reinterpret_cast<vm_address_t>(resultData), resultLength);
@@ -750,6 +769,10 @@
     } else 
         result = instanceProxy->setProperty(objectID, identifier->number(), valueData, valueLength);
 
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, result);
 
     return KERN_SUCCESS;
@@ -778,6 +801,10 @@
     } else 
         result = instanceProxy->removeProperty(objectID, identifier->number());
 
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, result);
 
     return KERN_SUCCESS;
@@ -805,7 +832,11 @@
         returnValue = instanceProxy->hasProperty(objectID, propertyNameIdentifier);
     } else 
         returnValue = instanceProxy->hasProperty(objectID, identifier->number());
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue);
     
     return KERN_SUCCESS;
@@ -830,6 +861,10 @@
     Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier);        
     boolean_t returnValue = instanceProxy->hasMethod(objectID, methodNameIdentifier);
 
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue);
 
     return KERN_SUCCESS;
@@ -872,7 +907,11 @@
     data_t resultData = 0;
     mach_msg_type_number_t resultLength = 0;
     boolean_t returnValue = instanceProxy->enumerate(objectID, resultData, resultLength);
-    
+
+    hostProxy = instanceProxy->hostProxy();
+    if (!hostProxy)
+        return KERN_FAILURE;
+
     _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength);
     
     if (resultData)
@@ -892,13 +931,13 @@
     return KERN_SUCCESS;
 }
 
-kern_return_t WKPCSetFullScreenWindowIsShowing(mach_port_t clientPort, boolean_t fullScreenWindowIsShowing)
+kern_return_t WKPCSetFullscreenWindowIsShowing(mach_port_t clientPort, boolean_t fullscreenWindowIsShowing)
 {
     NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     if (!hostProxy)
         return KERN_FAILURE;
 
-    hostProxy->setFullScreenWindowIsShowing(fullScreenWindowIsShowing);
+    hostProxy->setFullscreenWindowIsShowing(fullscreenWindowIsShowing);
 
     return KERN_SUCCESS;
 }
@@ -908,9 +947,18 @@
     NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     if (!hostProxy)
         return KERN_FAILURE;
-    
-    hostProxy->setModal(modal);
-    
+
+    if (!hostProxy->isProcessingRequests()) {
+        hostProxy->setModal(modal);
+        return KERN_SUCCESS;
+    }
+
+    // Defer the work
+    CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopDefaultMode, ^{
+        if (NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort))
+            hostProxy->setModal(modal);
+    });
+
     return KERN_SUCCESS;
 }
 
@@ -1090,7 +1138,7 @@
     NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     if (!hostProxy)
         return KERN_FAILURE;
-    
+
     NSOpenPanel *sheet = [NSOpenPanel openPanel];
     NSDictionary *panelState = [NSPropertyListSerialization propertyListFromData:[NSData dataWithBytes:panelData length:panelDataLength]
                                                                 mutabilityOption:NSPropertyListImmutable
@@ -1114,7 +1162,11 @@
     [sheet setRequiredFileType:[panelState objectForKey:@"requiredFileType"]];    
     [sheet setTitle:[panelState objectForKey:@"title"]];
     [sheet runModal];
-    
+
+    NetscapePluginHostProxy* newHostProxy = pluginProxyMap().get(clientPort);
+    if (newHostProxy != hostProxy)
+        return KERN_FAILURE;
+
     NSDictionary *ret = [NSDictionary dictionaryWithObjectsAndKeys:
                          [sheet filenames], @"filenames",
                          WKNoteOpenPanelFiles([sheet filenames]), @"extensions",
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
index 29a5a2d..593d336 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
@@ -72,14 +72,14 @@
         
         return m_pluginID;
     }
-    uint32_t renderContextID() const { return m_renderContextID; }
+    uint32_t renderContextID() const { ASSERT(fastMallocSize(this)); return m_renderContextID; }
     void setRenderContextID(uint32_t renderContextID) { m_renderContextID = renderContextID; }
     
     bool useSoftwareRenderer() const { return m_useSoftwareRenderer; }
     void setUseSoftwareRenderer(bool useSoftwareRenderer) { m_useSoftwareRenderer = useSoftwareRenderer; }
     
-    WebHostedNetscapePluginView *pluginView() const { return m_pluginView; }
-    NetscapePluginHostProxy* hostProxy() const { return m_pluginHostProxy; }
+    WebHostedNetscapePluginView *pluginView() const { ASSERT(fastMallocSize(this)); return m_pluginView; }
+    NetscapePluginHostProxy* hostProxy() const { ASSERT(fastMallocSize(this)); return m_pluginHostProxy; }
     
     bool cancelStreamLoad(uint32_t streamID, NPReason);
     void disconnectStream(HostedNetscapePluginStream*);
@@ -89,7 +89,7 @@
     
     void pluginHostDied();
     
-    void resize(NSRect size, NSRect clipRect, bool sync);
+    void resize(NSRect size, NSRect clipRect);
     void destroy();
     void focusChanged(bool hasFocus);
     void windowFocusChanged(bool hasFocus);
@@ -102,6 +102,7 @@
     void syntheticKeyDownWithCommandModifier(int keyCode, char character);
     void flagsChanged(NSEvent *);
     void print(CGContextRef, unsigned width, unsigned height);
+    void snapshot(CGContextRef, unsigned width, unsigned height);
     
     void startTimers(bool throttleTimers);
     void stopTimers();
@@ -256,8 +257,9 @@
     template <typename T>
     std::auto_ptr<T> waitForReply(uint32_t requestID)
     {
+        RefPtr<NetscapePluginInstanceProxy> protect(this); // Plug-in host may crash while we are waiting for reply, releasing all instances to the instance proxy.
+
         willCallPluginFunction();
-        
         m_waitingForReply = true;
 
         Reply* reply = processRequestsAndWaitForReply(requestID);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 515f9f7..f027534 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -30,6 +30,7 @@
 #import "HostedNetscapePluginStream.h"
 #import "NetscapePluginHostProxy.h"
 #import "ProxyInstance.h"
+#import "ProxyRuntimeObject.h"
 #import "WebDataSourceInternal.h"
 #import "WebFrameInternal.h"
 #import "WebHostedNetscapePluginView.h"
@@ -43,7 +44,6 @@
 #import <JavaScriptCore/Error.h>
 #import <JavaScriptCore/JSLock.h>
 #import <JavaScriptCore/PropertyNameArray.h>
-#import <WebCore/CString.h>
 #import <WebCore/CookieJar.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/Frame.h>
@@ -60,6 +60,7 @@
 #import <mach/mach.h>
 #import <utility>
 #import <wtf/RefCountedLeakCounter.h>
+#import <wtf/text/CString.h>
 
 extern "C" {
 #import "WebKitPluginClientServer.h"
@@ -116,6 +117,9 @@
 
 inline JSC::JSObject* NetscapePluginInstanceProxy::LocalObjectMap::get(uint32_t objectID) const
 {
+    if (objectID == HashTraits<uint32_t>::emptyValue() || HashTraits<uint32_t>::isDeletedValue(objectID))
+        return 0;
+
     return m_idToJSObjectMap.get(objectID);
 }
 
@@ -178,8 +182,16 @@
 
 bool NetscapePluginInstanceProxy::LocalObjectMap::forget(uint32_t objectID)
 {
+    if (objectID == HashTraits<uint32_t>::emptyValue() || HashTraits<uint32_t>::isDeletedValue(objectID)) {
+        LOG_ERROR("NetscapePluginInstanceProxy::LocalObjectMap::forget: local object id %u is not valid.", objectID);
+        return true;
+    }
+
     HashMap<uint32_t, JSC::ProtectedPtr<JSC::JSObject> >::iterator iter = m_idToJSObjectMap.find(objectID);
-    ASSERT(iter != m_idToJSObjectMap.end());
+    if (iter == m_idToJSObjectMap.end()) {
+        LOG_ERROR("NetscapePluginInstanceProxy::LocalObjectMap::forget: local object %u doesn't exist.", objectID);
+        return true;
+    }
 
     HashMap<JSC::JSObject*, pair<uint32_t, uint32_t> >::iterator rIter = m_jsObjectToIDMap.find(iter->second.get());
 
@@ -245,19 +257,17 @@
 #endif
 }
 
-void NetscapePluginInstanceProxy::resize(NSRect size, NSRect clipRect, bool sync)
+void NetscapePluginInstanceProxy::resize(NSRect size, NSRect clipRect)
 {
     uint32_t requestID = 0;
     
-    if (sync)
-        requestID = nextRequestID();
+    requestID = nextRequestID();
 
     _WKPHResizePluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID,
                               size.origin.x, size.origin.y, size.size.width, size.size.height,
                               clipRect.origin.x, clipRect.origin.y, clipRect.size.width, clipRect.size.height);
     
-    if (sync)
-        waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
+    waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
 }
 
 void NetscapePluginInstanceProxy::stopAllStreams()
@@ -464,9 +474,6 @@
                                   pluginPoint.x, pluginPoint.y, [event buttonNumber], 
                                   [event deltaX], [event deltaY], [event deltaZ]);
     
-    // Protect ourselves in case waiting for the reply causes us to be deleted.
-    RefPtr<NetscapePluginInstanceProxy> protect(this);
-
     auto_ptr<NetscapePluginInstanceProxy::BooleanReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
     if (!reply.get() || !reply->m_result)
         return false;
@@ -497,6 +504,22 @@
     CGContextRestoreGState(context);
 }
 
+void NetscapePluginInstanceProxy::snapshot(CGContextRef context, unsigned width, unsigned height)
+{
+    uint32_t requestID = nextRequestID();
+    _WKPHPluginInstanceSnapshot(m_pluginHostProxy->port(), m_pluginID, requestID, width, height);
+    
+    auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
+    if (!reply.get() || !reply->m_returnValue)
+        return;
+
+    RetainPtr<CGDataProvider> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(reply->m_result.get()));
+    RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
+    RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(width, height, 8, 32, width * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
+
+    CGContextDrawImage(context, CGRectMake(0, 0, width, height), image.get());
+}
+
 void NetscapePluginInstanceProxy::stopTimers()
 {
     _WKPHPluginInstanceStopTimers(m_pluginHostProxy->port(), m_pluginID);
@@ -765,10 +788,16 @@
 NetscapePluginInstanceProxy::Reply* NetscapePluginInstanceProxy::processRequestsAndWaitForReply(uint32_t requestID)
 {
     Reply* reply = 0;
-    
+
+    ASSERT(m_pluginHostProxy);
     while (!(reply = m_replies.take(requestID))) {
         if (!m_pluginHostProxy->processRequests())
             return 0;
+
+        // The host proxy can be destroyed while executing a nested processRequests() call, in which case it's normal
+        // to get a success result, but be unable to keep looping.
+        if (!m_pluginHostProxy)
+            return 0;
     }
     
     ASSERT(reply);
@@ -782,7 +811,7 @@
     if (!frame)
         return false;
     
-    if (!frame->script()->canExecuteScripts())
+    if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
         objectID = 0;
     else
         objectID = m_localObjects.idForObject(frame->script()->windowShell(pluginWorld())->window());
@@ -814,8 +843,10 @@
     resultData = 0;
     resultLength = 0;
 
-    if (!m_localObjects.contains(objectID))
+    if (!m_localObjects.contains(objectID)) {
+        LOG_ERROR("NetscapePluginInstanceProxy::evaluate: local object %u doesn't exist.", objectID);
         return false;
+    }
 
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -857,8 +888,10 @@
         return false;
     
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::invoke: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -891,8 +924,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::invokeDefault: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -924,8 +959,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::construct: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -958,8 +995,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::getProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -977,8 +1016,10 @@
 bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t& resultData, mach_msg_type_number_t& resultLength)
 {
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::getProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -999,8 +1040,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::setProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1023,8 +1066,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::setProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1046,8 +1091,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::removeProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1071,8 +1118,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::removeProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1096,8 +1145,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::hasProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1116,8 +1167,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::hasProperty: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1136,8 +1189,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::hasMethod: local object %u doesn't exist.", objectID);
         return false;
+    }
 
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1156,8 +1211,10 @@
         return false;
 
     JSObject* object = m_localObjects.get(objectID);
-    if (!object)
+    if (!object) {
+        LOG_ERROR("NetscapePluginInstanceProxy::enumerate: local object %u doesn't exist.", objectID);
         return false;
+    }
     
     Frame* frame = core([m_pluginView webFrame]);
     if (!frame)
@@ -1171,7 +1228,7 @@
 
     RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]);
     for (unsigned i = 0; i < propertyNames.size(); i++) {
-        uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().c_str()));
+        uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().data()));
 
         [array.get() addObject:[NSNumber numberWithLongLong:methodName]];
     }
@@ -1195,7 +1252,7 @@
 
     if (value.isString()) {
         [array addObject:[NSNumber numberWithInt:StringValueType]];
-        [array addObject:String(value.toString(exec))];
+        [array addObject:ustringToString(value.toString(exec))];
     } else if (value.isNumber()) {
         [array addObject:[NSNumber numberWithInt:DoubleValueType]];
         [array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]];
@@ -1206,9 +1263,9 @@
         [array addObject:[NSNumber numberWithInt:NullValueType]];
     else if (value.isObject()) {
         JSObject* object = asObject(value);
-        if (object->classInfo() == &RuntimeObjectImp::s_info) {
-            RuntimeObjectImp* imp = static_cast<RuntimeObjectImp*>(object);
-            if (ProxyInstance* instance = static_cast<ProxyInstance*>(imp->getInternalInstance())) {
+        if (object->classInfo() == &ProxyRuntimeObject::s_info) {
+            ProxyRuntimeObject* runtimeObject = static_cast<ProxyRuntimeObject*>(object);
+            if (ProxyInstance* instance = runtimeObject->getInternalProxyInstance()) {
                 [array addObject:[NSNumber numberWithInt:NPObjectValueType]];
                 [array addObject:[NSNumber numberWithInt:instance->objectID()]];
             }
@@ -1287,7 +1344,7 @@
             if (!frame)
                 return false;
             
-            if (!frame->script()->canExecuteScripts())
+            if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
                 return false;
 
             RefPtr<RootObject> rootObject = frame->script()->createRootObject(m_pluginView);
@@ -1335,26 +1392,18 @@
 
 void NetscapePluginInstanceProxy::retainLocalObject(JSC::JSValue value)
 {
-    if (!value.isObject())
+    if (!value.isObject() || value.inherits(&ProxyRuntimeObject::s_info))
         return;
 
-    JSObject* object = asObject(value);
-    if (object->classInfo() == &RuntimeObjectImp::s_info)
-        return;
-
-    m_localObjects.retain(object);
+    m_localObjects.retain(asObject(value));
 }
 
 void NetscapePluginInstanceProxy::releaseLocalObject(JSC::JSValue value)
 {
-    if (!value.isObject())
+    if (!value.isObject() || value.inherits(&ProxyRuntimeObject::s_info))
         return;
 
-    JSObject* object = asObject(value);
-    if (object->classInfo() == &RuntimeObjectImp::s_info)
-        return;
-
-    m_localObjects.release(object);
+    m_localObjects.release(asObject(value));
 }
 
 PassRefPtr<Instance> NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr<RootObject> rootObject)
@@ -1364,10 +1413,6 @@
     if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID, requestID) != KERN_SUCCESS)
         return 0;
 
-    // If the plug-in host crashes while we're waiting for a reply, the last reference to the instance proxy
-    // will go away. Prevent this by protecting it here.
-    RefPtr<NetscapePluginInstanceProxy> protect(this);
-    
     auto_ptr<GetScriptableNPObjectReply> reply = waitForReply<GetScriptableNPObjectReply>(requestID);
     if (!reply.get())
         return 0;
@@ -1375,6 +1420,7 @@
     if (!reply->m_objectID)
         return 0;
 
+    // Since the reply was non-null, "this" is still a valid pointer.
     return ProxyInstance::create(rootObject, this, reply->m_objectID);
 }
 
@@ -1458,7 +1504,7 @@
     
     if (Frame* frame = core([m_pluginView webFrame])) {
         String cookieString = cookies(frame->document(), url); 
-        WebCore::CString cookieStringUTF8 = cookieString.utf8();
+        WTF::CString cookieStringUTF8 = cookieString.utf8();
         if (cookieStringUTF8.isNull())
             return false;
         
@@ -1500,7 +1546,7 @@
     if (!url)
         return false;
 
-    WebCore::CString proxyStringUTF8 = proxiesForURL(url);
+    WTF::CString proxyStringUTF8 = proxiesForURL(url);
 
     proxyLength = proxyStringUTF8.length();
     mig_allocate(reinterpret_cast<vm_address_t*>(&proxyData), proxyLength);
@@ -1512,8 +1558,8 @@
 bool NetscapePluginInstanceProxy::getAuthenticationInfo(data_t protocolData, data_t hostData, uint32_t port, data_t schemeData, data_t realmData, 
                                                         data_t& usernameData, mach_msg_type_number_t& usernameLength, data_t& passwordData, mach_msg_type_number_t& passwordLength)
 {
-    WebCore::CString username;
-    WebCore::CString password;
+    WTF::CString username;
+    WTF::CString password;
     
     if (!WebKit::getAuthenticationInfo(protocolData, hostData, port, schemeData, realmData, username, password))
         return false;
@@ -1583,7 +1629,7 @@
 {
     ASSERT(m_pluginView);
     
-    WebCore::CString resolvedURL = [m_pluginView resolvedURLStringForURL:url target:target];
+    WTF::CString resolvedURL = [m_pluginView resolvedURLStringForURL:url target:target];
     
     resolvedURLLength = resolvedURL.length();
     mig_allocate(reinterpret_cast<vm_address_t*>(&resolvedURLData), resolvedURLLength);
@@ -1613,10 +1659,10 @@
 
     {
         JSLock lock(SilenceAssertionsOnly);
-        throwError(exec, GeneralError, globalExceptionString());
+        throwError(exec, GeneralError, stringToUString(globalExceptionString()));
     }
 
-    globalExceptionString() = UString();
+    globalExceptionString() = String();
 }
 
 } // namespace WebKit
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.h b/WebKit/mac/Plugins/Hosted/ProxyInstance.h
index 6e8ac47..c8fb118 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.h
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.h
@@ -58,10 +58,13 @@
     
 private:
     ProxyInstance(PassRefPtr<JSC::Bindings::RootObject>, NetscapePluginInstanceProxy*, uint32_t objectID);
-    
-    virtual JSC::Bindings::Class *getClass() const;
 
-    virtual JSC::JSValue invokeMethod(JSC::ExecState*, const JSC::Bindings::MethodList&, const JSC::ArgList& args);
+    virtual JSC::Bindings::RuntimeObject* newRuntimeObject(JSC::ExecState*);
+
+    virtual JSC::Bindings::Class* getClass() const;
+
+    virtual JSC::JSValue getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName);
+    virtual JSC::JSValue invokeMethod(JSC::ExecState*, JSC::RuntimeMethod*, const JSC::ArgList& args);
 
     virtual bool supportsInvokeDefaultMethod() const;
     virtual JSC::JSValue invokeDefaultMethod(JSC::ExecState*, const JSC::ArgList&);
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index c7a0ebe..9a976f9 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -28,9 +28,12 @@
 #import "ProxyInstance.h"
 
 #import "NetscapePluginHostProxy.h"
+#import "ProxyRuntimeObject.h"
 #import <WebCore/IdentifierRep.h>
 #import <WebCore/JSDOMWindow.h>
 #import <WebCore/npruntime_impl.h>
+#import <WebCore/runtime_method.h>
+#import <runtime/Error.h>
 #import <runtime/PropertyNameArray.h>
 
 extern "C" {
@@ -128,7 +131,12 @@
     invalidate();
 }
     
-JSC::Bindings::Class *ProxyInstance::getClass() const
+RuntimeObject* ProxyInstance::newRuntimeObject(ExecState* exec)
+{
+    return new (exec) ProxyRuntimeObject(exec, this);
+}
+
+JSC::Bindings::Class* ProxyInstance::getClass() const
 {
     return proxyClass();
 }
@@ -147,16 +155,20 @@
 
     if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID,
                             type, identifier, (char*)[arguments.get() bytes], [arguments.get() length]) != KERN_SUCCESS) {
-        for (unsigned i = 0; i < args.size(); i++)
-            m_instanceProxy->releaseLocalObject(args.at(i));
+        if (m_instanceProxy) {
+            for (unsigned i = 0; i < args.size(); i++)
+                m_instanceProxy->releaseLocalObject(args.at(i));
+        }
         return jsUndefined();
     }
     
     auto_ptr<NetscapePluginInstanceProxy::BooleanAndDataReply> reply = waitForReply<NetscapePluginInstanceProxy::BooleanAndDataReply>(requestID);
     NetscapePluginInstanceProxy::moveGlobalExceptionToExecState(exec);
 
-    for (unsigned i = 0; i < args.size(); i++)
-        m_instanceProxy->releaseLocalObject(args.at(i));
+    if (m_instanceProxy) {
+        for (unsigned i = 0; i < args.size(); i++)
+            m_instanceProxy->releaseLocalObject(args.at(i));
+    }
 
     if (!reply.get() || !reply->m_returnValue)
         return jsUndefined();
@@ -164,8 +176,33 @@
     return m_instanceProxy->demarshalValue(exec, (char*)CFDataGetBytePtr(reply->m_result.get()), CFDataGetLength(reply->m_result.get()));
 }
 
-JSValue ProxyInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList& args)
+class ProxyRuntimeMethod : public RuntimeMethod {
+public:
+    ProxyRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)
+        : RuntimeMethod(exec, name, list)
+    {
+    }
+
+    virtual const ClassInfo* classInfo() const { return &s_info; }
+
+    static const ClassInfo s_info;
+};
+
+const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMethod::s_info, 0, 0 };
+
+JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName)
 {
+    MethodList methodList = getClass()->methodsNamed(propertyName, this);
+    return new (exec) ProxyRuntimeMethod(exec, propertyName, methodList);
+}
+
+JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod, const ArgList& args)
+{
+    if (!asObject(runtimeMethod)->inherits(&ProxyRuntimeMethod::s_info))
+        return throwError(exec, TypeError, "Attempt to invoke non-plug-in method on plug-in object.");
+
+    const MethodList& methodList = *runtimeMethod->methods();
+
     ASSERT(methodList.size() == 1);
 
     ProxyMethod* method = static_cast<ProxyMethod*>(methodList[0]);
@@ -280,7 +317,7 @@
 
         if (identifier->isString()) {
             const char* str = identifier->string();
-            nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str))));
+            nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), stringToUString(String::fromUTF8WithLatin1Fallback(str, strlen(str)))));
         } else
             nameArray.add(Identifier::from(exec, identifier->number()));
     }
@@ -396,7 +433,8 @@
                                                 m_instanceProxy->pluginID(), requestID,
                                                 m_objectID, serverIdentifier, valueData, valueLength);
     mig_deallocate(reinterpret_cast<vm_address_t>(valueData), valueLength);
-    m_instanceProxy->releaseLocalObject(value);
+    if (m_instanceProxy)
+        m_instanceProxy->releaseLocalObject(value);
     if (kr != KERN_SUCCESS)
         return;
     
diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
new file mode 100644
index 0000000..af3c5db
--- /dev/null
+++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 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. 
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#ifndef ProxyRuntimeObject_h
+#define ProxyRuntimeObject_h
+
+#include <WebCore/runtime_object.h>
+
+namespace WebKit {
+
+class ProxyInstance;
+
+class ProxyRuntimeObject : public JSC::Bindings::RuntimeObject {
+public:
+    ProxyRuntimeObject(JSC::ExecState*, PassRefPtr<ProxyInstance>);
+    virtual ~ProxyRuntimeObject();
+
+    ProxyInstance* getInternalProxyInstance() const;
+
+    static const JSC::ClassInfo s_info;
+
+private:
+    virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+};
+
+}
+
+#endif
+#endif
diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
new file mode 100644
index 0000000..5ba6e15
--- /dev/null
+++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 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. 
+ */
+
+#if USE(PLUGIN_HOST_PROCESS)
+
+#include "ProxyInstance.h"
+#include "ProxyRuntimeObject.h"
+
+using namespace JSC;
+
+namespace WebKit {
+
+
+const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 };
+
+ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, PassRefPtr<ProxyInstance> instance)
+    : RuntimeObject(exec, instance)
+{
+}
+
+ProxyRuntimeObject::~ProxyRuntimeObject()
+{
+}
+
+ProxyInstance* ProxyRuntimeObject::getInternalProxyInstance() const
+{
+    return static_cast<ProxyInstance*>(getInternalInstance());
+}
+
+
+}
+
+#endif
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
index 5313ff2..1eb164d 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h
@@ -45,7 +45,6 @@
     
     NSSize _previousSize;
     RefPtr<WebKit::NetscapePluginInstanceProxy> _proxy;
-    BOOL _pluginHostDied;
 }
 
 - (id)initWithFrame:(NSRect)r
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index 0ad76f0..cd3724e 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -41,8 +41,9 @@
 #import <WebCore/Frame.h>
 #import <WebCore/FrameLoaderTypes.h>
 #import <WebCore/HTMLPlugInElement.h>
-#import <WebCore/runtime_root.h>
+#import <WebCore/RenderEmbeddedObject.h>
 #import <WebCore/WebCoreObjCExtras.h>
+#import <WebCore/runtime_root.h>
 #import <runtime/InitializeThreading.h>
 #import <wtf/Assertions.h>
 
@@ -180,10 +181,9 @@
     if (!shouldClipOutPlugin)
         visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow);
 
-    BOOL sizeChanged = !NSEqualSizes(_previousSize, boundsInWindow.size);
     _previousSize = boundsInWindow.size;
     
-    _proxy->resize(boundsInWindow, visibleRectInWindow, sizeChanged);
+    _proxy->resize(boundsInWindow, visibleRectInWindow);
 }
 
 - (void)windowFocusChanged:(BOOL)hasFocus
@@ -287,6 +287,9 @@
 
 - (void)handleMouseEntered:(NSEvent *)event
 {
+    // Set cursor to arrow. Plugins often handle cursor internally, but those that don't will just get this default one.
+    [[NSCursor arrowCursor] set];
+
     if (_isStarted && _proxy)
         _proxy->mouseEvent(self, event, NPCocoaEventMouseEntered);
 }
@@ -295,6 +298,11 @@
 {
     if (_isStarted && _proxy)
         _proxy->mouseEvent(self, event, NPCocoaEventMouseExited);
+
+    // Set cursor back to arrow cursor.  Because NSCursor doesn't know about changes that the plugin made, we could get confused about what we think the
+    // current cursor is otherwise.  Therefore we have no choice but to unconditionally reset the cursor when the mouse exits the plugin.
+    // FIXME: This should be job of plugin host, see <rdar://problem/7654434>.
+    [[NSCursor arrowCursor] set];
 }
 
 - (void)scrollWheel:(NSEvent *)event
@@ -348,7 +356,9 @@
 
 - (void)pluginHostDied
 {
-    _pluginHostDied = YES;
+    RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer());
+    if (renderer)
+        renderer->setShowsCrashedPluginIndicator();
 
     _pluginLayer = nil;
     _proxy = 0;
@@ -359,6 +369,11 @@
     [self invalidatePluginContentRect:[self bounds]];
 }
 
+- (void)visibleRectDidChange
+{
+    [super visibleRectDidChange];
+    WKSyncSurfaceToView(self);
+}
 
 - (void)drawRect:(NSRect)rect
 {
@@ -369,28 +384,12 @@
                 _proxy->didDraw();
             } else
                 _proxy->print(reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]), [self bounds].size.width, [self bounds].size.height);
+        } else if ([self inFlatteningPaint] && [self supportsSnapshotting]) {
+            _proxy->snapshot(reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]), [self bounds].size.width, [self bounds].size.height);
         }
-            
+
         return;
     }
-    
-    if (_pluginHostDied) {
-        static NSImage *nullPlugInImage;
-        if (!nullPlugInImage) {
-            NSBundle *bundle = [NSBundle bundleForClass:[WebHostedNetscapePluginView class]];
-            nullPlugInImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"nullplugin" ofType:@"tiff"]];
-            [nullPlugInImage setFlipped:YES];
-        }
-        
-        if (!nullPlugInImage)
-            return;
-        
-        NSSize imageSize = [nullPlugInImage size];
-        NSSize viewSize = [self bounds].size;
-        
-        NSPoint point = NSMakePoint((viewSize.width - imageSize.width) / 2.0, (viewSize.height - imageSize.height) / 2.0);
-        [nullPlugInImage drawAtPoint:point fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
-    }
 }
 
 - (PassRefPtr<JSC::Bindings::Instance>)createPluginBindingsInstance:(PassRefPtr<JSC::Bindings::RootObject>)rootObject
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 6522bf7..6b1a319 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -234,7 +234,7 @@
 simpleroutine PCRunSyncOpenPanel(clientPort :mach_port_t;
                                  panelData :data_t);
 
-simpleroutine PCSetFullScreenWindowIsShowing(clientPort :mach_port_t;
+simpleroutine PCSetFullscreenWindowIsShowing(clientPort :mach_port_t;
                                              isShowing :boolean_t);
 
 simpleroutine PCSetException(clientPort :mach_port_t;
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
index c7cec89..5d9df45 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
@@ -242,3 +242,9 @@
 
 simpleroutine PHSyncOpenPanelReply(pluginHostPort :mach_port_t;
                                    filenames :data_t);
+
+simpleroutine PHPluginInstanceSnapshot(pluginHostPort :mach_port_t;
+                                    pluginID :uint32_t;
+                                    requestID :uint32_t;
+                                    width :uint32_t;
+                                    height :uint32_t);
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index 18dc004..81d801a 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -41,13 +41,21 @@
 @class WebFrame;
 @class WebView;
 
-namespace WebCore {
+namespace WTF {
     class CString;
+}
+
+namespace WebCore {
     class HTMLPlugInElement;
 }
 
 class WebHaltablePlugin;
 
+// Also declared in WebCore/WidgetMac.mm
+@interface NSView (Widget)
+- (void)visibleRectDidChange;
+@end
+
 @interface WebBaseNetscapePluginView : NSView
 {
     RetainPtr<WebNetscapePluginPackage> _pluginPackage;
@@ -123,10 +131,12 @@
 - (void)addWindowObservers;
 - (void)removeWindowObservers;
 - (BOOL)shouldClipOutPlugin;
+- (BOOL)inFlatteningPaint;
+- (BOOL)supportsSnapshotting;
 
 - (BOOL)convertFromX:(double)sourceX andY:(double)sourceY space:(NPCoordinateSpace)sourceSpace
                  toX:(double *)destX andY:(double *)destY space:(NPCoordinateSpace)destSpace;
-- (WebCore::CString)resolvedURLStringForURL:(const char*)url target:(const char*)target;
+- (WTF::CString)resolvedURLStringForURL:(const char*)url target:(const char*)target;
 
 - (void)invalidatePluginContentRect:(NSRect)rect;
 
@@ -135,11 +145,11 @@
 
 namespace WebKit {
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-WebCore::CString proxiesForURL(NSURL *);
+WTF::CString proxiesForURL(NSURL *);
 #endif
     
 bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr,
-                           WebCore::CString& username, WebCore::CString& password);
+                           WTF::CString& username, WTF::CString& password);
 } 
 
 #endif
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index 04a42ea..eec80f8 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -46,7 +46,6 @@
 #import <WebCore/BitmapImage.h>
 #import <WebCore/Credential.h>
 #import <WebCore/CredentialStorage.h>
-#import <WebCore/CString.h>
 #import <WebCore/Document.h>
 #import <WebCore/Element.h>
 #import <WebCore/Frame.h>
@@ -60,6 +59,7 @@
 #import <WebKit/DOMPrivate.h>
 #import <runtime/InitializeThreading.h>
 #import <wtf/Assertions.h>
+#import <wtf/text/CString.h>
 
 #define LoginWindowDidSwitchFromUserNotification    @"WebLoginWindowDidSwitchFromUserNotification"
 #define LoginWindowDidSwitchToUserNotification      @"WebLoginWindowDidSwitchToUserNotification"
@@ -337,13 +337,10 @@
 - (NSRect)_windowClipRect
 {
     RenderObject* renderer = _element->renderer();
-    
-    if (renderer && renderer->view()) {
-        if (FrameView* frameView = renderer->view()->frameView())
-            return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true);
-    }
-    
-    return NSZeroRect;
+    if (!renderer || !renderer->view())
+        return NSZeroRect;
+
+    return toRenderWidget(renderer)->windowClipRect();
 }
 
 - (NSRect)visibleRect
@@ -353,6 +350,11 @@
     return NSIntersectionRect([self convertRect:[self _windowClipRect] fromView:nil], [super visibleRect]);
 }
 
+- (void)visibleRectDidChange
+{
+    [self renewGState];
+}
+
 - (BOOL)acceptsFirstResponder
 {
     return YES;
@@ -560,7 +562,30 @@
     NSWindow *window = [self window];
     return !window || [window isMiniaturized] || [NSApp isHidden] || ![self isDescendantOf:[[self window] contentView]] || [self isHiddenOrHasHiddenAncestor];
 }
+
+- (BOOL)inFlatteningPaint
+{
+    RenderObject* renderer = _element->renderer();
+    if (renderer && renderer->view()) {
+        if (FrameView* frameView = renderer->view()->frameView())
+            return frameView->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
+    }
+
+    return NO;
+}
+
+- (BOOL)supportsSnapshotting
+{
+    NSBundle *pluginBundle = [_pluginPackage.get() bundle];
+    if (![[pluginBundle bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"])
+        return YES;
     
+    // Flash has a bogus Info.plist entry for CFBundleVersionString, so use CFBundleShortVersionString.
+    NSString *versionString = [pluginBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
+    // Flash 10.1d51 has a crashing bug if sent a drawRect event when using the CA rendering model: <rdar://problem/7739922>
+    return ![versionString isEqual:@"10.1.51.95"];
+}
+
 - (BOOL)hasBeenHalted
 {
     return _hasBeenHalted;
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
index d8324f7..a5e8f73 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
@@ -199,8 +199,17 @@
 {
 }
 
-void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent*)
+void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent* theEvent)
 {
+    EventRecord event;
+    
+    getCarbonEvent(&event, theEvent);
+    event.what = adjustCursorEvent;
+    
+    BOOL acceptedEvent;
+    acceptedEvent = sendEvent(&event);
+    
+    LOG(PluginEvents, "NPP_HandleEvent(mouseMoved): %d", acceptedEvent);
 }
 
 void WebNetscapePluginEventHandlerCarbon::keyDown(NSEvent *theEvent)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index 8fb1503..388b84b 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -50,7 +50,6 @@
 #import "WebPluginContainerCheck.h"
 #import "WebNetscapeContainerCheckContextInfo.h"
 #import "WebNetscapePluginEventHandler.h"
-#import "WebNullPluginView.h"
 #import "WebPreferences.h"
 #import "WebPluginRequest.h"
 #import "WebViewInternal.h"
@@ -59,7 +58,6 @@
 #import <runtime/JSLock.h>
 #import <WebCore/npruntime_impl.h>
 #import <WebCore/CookieJar.h>
-#import <WebCore/CString.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/Element.h>
 #import <WebCore/Frame.h> 
@@ -77,12 +75,13 @@
 #import <WebKit/WebUIDelegate.h>
 #import <runtime/InitializeThreading.h>
 #import <wtf/Assertions.h>
+#import <wtf/text/CString.h>
 #import <objc/objc-runtime.h>
 
 #define LoginWindowDidSwitchFromUserNotification    @"WebLoginWindowDidSwitchFromUserNotification"
 #define LoginWindowDidSwitchToUserNotification      @"WebLoginWindowDidSwitchToUserNotification"
 #define WKNVSupportsCompositingCoreAnimationPluginsBool 74656  /* TRUE if the browser supports hardware compositing of Core Animation plug-ins  */
-static const int WKNVSilverlightFullScreenPerformanceIssueFixed = 7288546; /* TRUE if Siverlight addressed its underlying  bug in <rdar://problem/7288546> */
+static const int WKNVSilverlightFullscreenPerformanceIssueFixed = 7288546; /* TRUE if Siverlight addressed its underlying  bug in <rdar://problem/7288546> */
 
 using namespace WebCore;
 using namespace WebKit;
@@ -754,6 +753,9 @@
     if (!_isStarted)
         return;
 
+    // Set cursor to arrow. Plugins often handle cursor internally, but those that don't will just get this default one.
+    [[NSCursor arrowCursor] set];
+
     _eventHandler->mouseEntered(theEvent);
 }
 
@@ -1394,7 +1396,7 @@
 
 - (void)drawRect:(NSRect)rect
 {
-    if (drawingModel == NPDrawingModelCoreAnimation)
+    if (drawingModel == NPDrawingModelCoreAnimation && (![self inFlatteningPaint] || ![self supportsSnapshotting]))
         return;
 
     if (!_isStarted)
@@ -2276,7 +2278,7 @@
 
 - (char*)resolveURL:(const char*)url forTarget:(const char*)target
 {
-    WebCore::CString location = [self resolvedURLStringForURL:url target:target];
+    CString location = [self resolvedURLStringForURL:url target:target];
 
     if (location.isNull())
         return 0;
@@ -2307,13 +2309,13 @@
 // 1) Microsoft releases a genuine fix for 7288546.
 // 2) Enough Silverlight users update to the new Silverlight.
 // For now, we'll distinguish older broken versions of Silverlight by asking the plug-in if it resolved its full screen badness.
-- (void)_workaroundSilverlightFullScreenBug:(BOOL)initializedPlugin
+- (void)_workaroundSilverlightFullscreenBug:(BOOL)initializedPlugin
 {
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     ASSERT(_isSilverlight);
-    NPBool isFullScreenPerformanceIssueFixed = 0;
+    NPBool isFullscreenPerformanceIssueFixed = 0;
     NPPluginFuncs *pluginFuncs = [_pluginPackage.get() pluginFuncs];
-    if (pluginFuncs->getvalue && pluginFuncs->getvalue(plugin, static_cast<NPPVariable>(WKNVSilverlightFullScreenPerformanceIssueFixed), &isFullScreenPerformanceIssueFixed) == NPERR_NO_ERROR && isFullScreenPerformanceIssueFixed)
+    if (pluginFuncs->getvalue && pluginFuncs->getvalue(plugin, static_cast<NPPVariable>(WKNVSilverlightFullscreenPerformanceIssueFixed), &isFullscreenPerformanceIssueFixed) == NPERR_NO_ERROR && isFullscreenPerformanceIssueFixed)
         return;
     
     static CGLPixelFormatObj pixelFormatObject = 0;
@@ -2354,7 +2356,7 @@
     NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL);
     [[self class] setCurrentPluginView:nil];
     if (_isSilverlight)
-        [self _workaroundSilverlightFullScreenBug:YES];
+        [self _workaroundSilverlightFullscreenBug:YES];
     LOG(Plugins, "NPP_New: %d", npErr);
     return npErr;
 }
@@ -2364,7 +2366,7 @@
     PluginMainThreadScheduler::scheduler().unregisterPlugin(plugin);
     
     if (_isSilverlight)
-        [self _workaroundSilverlightFullScreenBug:NO];
+        [self _workaroundSilverlightFullscreenBug:NO];
     
     NPError npErr;
     npErr = ![_pluginPackage.get() pluginFuncs]->destroy(plugin, NULL);
diff --git a/WebKit/mac/Plugins/WebNullPluginView.h b/WebKit/mac/Plugins/WebNullPluginView.h
deleted file mode 100644
index 3ca1532..0000000
--- a/WebKit/mac/Plugins/WebNullPluginView.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2005, 2007 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-#import <AppKit/AppKit.h>
-
-@class DOMElement;
-
-@interface WebNullPluginView : NSImageView
-{
-    NSError *error;
-    DOMElement *element;
-}
-
-- (id)initWithFrame:(NSRect)frame error:(NSError *)error DOMElement:(DOMElement *)element;
-
-@end
diff --git a/WebKit/mac/Plugins/WebNullPluginView.mm b/WebKit/mac/Plugins/WebNullPluginView.mm
deleted file mode 100644
index bcc7a4b..0000000
--- a/WebKit/mac/Plugins/WebNullPluginView.mm
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2005, 2007 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-#import "WebNullPluginView.h"
-
-#import "DOMElementInternal.h"
-#import "WebDelegateImplementationCaching.h"
-#import "WebFrameInternal.h"
-#import "WebViewInternal.h"
-#import <WebCore/Document.h>
-#import <WebCore/Element.h>
-
-@implementation WebNullPluginView
-
-- initWithFrame:(NSRect)frame error:(NSError *)err DOMElement:(DOMElement *)elem
-{    
-    static NSImage *nullPlugInImage;
-    if (!nullPlugInImage) {
-        NSBundle *bundle = [NSBundle bundleForClass:[WebNullPluginView class]];
-        NSString *imagePath = [bundle pathForResource:@"nullplugin" ofType:@"tiff"];
-        nullPlugInImage = [[NSImage alloc] initWithContentsOfFile:imagePath];
-    }
-    
-    self = [super initWithFrame:frame];
-    if (!self)
-        return nil;
-
-    error = [err retain];
-    if (err)
-        element = [elem retain];
-
-    [self setImage:nullPlugInImage];
-
-    return self;
-}
-
-- (void)dealloc
-
-{
-    [error release];
-    [element release];
-    [super dealloc];
-}
-
-- (void)reportFailure
-{
-    NSError *localError = error;
-    DOMElement *localElement = element;
-
-    error = nil;
-    element = nil;
-
-    WebFrame *webFrame = kit(core(localElement)->document()->frame());
-    if (webFrame) {
-        WebView *webView = [webFrame webView];
-        WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView);
-        if (implementations->plugInFailedWithErrorFunc)
-            CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, webView,
-                @selector(webView:plugInFailedWithError:dataSource:), localError, [webFrame _dataSource]);
-    }
-
-    [localError release];
-    [localElement release];
-}
-
-- (void)viewDidMoveToWindow
-{
-    if (!error)
-        return;
-
-    if ([self window])
-        [self reportFailure];
-}
-
-@end
diff --git a/WebKit/mac/Plugins/WebPluginController.mm b/WebKit/mac/Plugins/WebPluginController.mm
index 4343119..1c85862 100644
--- a/WebKit/mac/Plugins/WebPluginController.mm
+++ b/WebKit/mac/Plugins/WebPluginController.mm
@@ -36,6 +36,7 @@
 #import "WebHTMLViewPrivate.h"
 #import "WebKitErrorsPrivate.h"
 #import "WebKitLogging.h"
+#import "WebNSObjectExtras.h"
 #import "WebNSURLExtras.h"
 #import "WebNSViewExtras.h"
 #import "WebPlugin.h"
@@ -57,6 +58,7 @@
 #import <WebCore/ResourceRequest.h>
 #import <WebCore/ScriptController.h>
 #import <WebCore/WebCoreURLResponse.h>
+#import <objc/objc-runtime.h>
 #import <runtime/JSLock.h>
 
 using namespace WebCore;
@@ -78,6 +80,10 @@
 - (void)pluginDestroy;
 @end
 
+static bool isKindOfClass(id, NSString* className);
+static void installFlip4MacPlugInWorkaroundIfNecessary();
+
+
 static NSMutableSet *pluginViews = nil;
 
 @implementation WebPluginController
@@ -209,7 +215,10 @@
         BOOL oldDefersCallbacks = [[self webView] defersCallbacks];
         if (!oldDefersCallbacks)
             [[self webView] setDefersCallbacks:YES];
-        
+
+        if (isKindOfClass(view, @"WmvPlugin"))
+            installFlip4MacPlugInWorkaroundIfNecessary();
+
         LOG(Plugins, "initializing plug-in %@", view);
         if ([view respondsToSelector:@selector(webPlugInInitialize)]) {
             JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
@@ -351,21 +360,11 @@
     }
 }
 
-// For compatibility only.
-- (void)showURL:(NSURL *)URL inFrame:(NSString *)target
-{
-    [self webPlugInContainerLoadRequest:[NSURLRequest requestWithURL:URL] inFrame:target];
-}
-
 - (void)webPlugInContainerShowStatus:(NSString *)message
 {
-    if (!message) {
+    if (!message)
         message = @"";
-    }
-    if (!_documentView) {
-        LOG_ERROR("could not show status message (%@) because plug-in has already been destroyed", message);
-        return;
-    }
+
     WebView *v = [_dataSource _webView];
     [[v _UIDelegateForwarder] webView:v setStatusText:message];
 }
@@ -475,3 +474,85 @@
 #endif
 
 @end
+
+static bool isKindOfClass(id object, NSString *className)
+{
+    Class cls = NSClassFromString(className);
+
+    if (!cls)
+        return false;
+
+    return [object isKindOfClass:cls];
+}
+
+
+// Existing versions of the Flip4Mac WebKit plug-in have an object lifetime bug related to an NSAlert that is
+// used to notify the user about updates to the plug-in. This bug can result in Safari crashing if the page
+// containing the plug-in navigates while the alert is displayed (<rdar://problem/7313430>).
+//
+// The gist of the bug is thus: Flip4Mac sets an instance of the TSUpdateCheck class as the modal delegate of the
+// NSAlert instance. This TSUpdateCheck instance itself has a delegate. The delegate is set to the WmvPlugin
+// instance which is the NSView subclass that is exposed to WebKit as the plug-in view. Since this relationship
+// is that of delegates the TSUpdateCheck does not retain the WmvPlugin. This leads to a bug if the WmvPlugin
+// instance is destroyed before the TSUpdateCheck instance as the TSUpdateCheck instance will be left with a
+// pointer to a stale object. This will happen if a page containing the Flip4Mac plug-in triggers a navigation
+// while the update sheet is visible as the WmvPlugin instance is removed from the view hierarchy and there are
+// no other references to keep the object alive.
+//
+// We work around this bug by patching the following two messages:
+//
+// 1) -[NSAlert beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:]
+// 2) -[TSUpdateCheck alertDidEnd:returnCode:contextInfo:]
+//
+// Our override of 1) detects whether it is Flip4Mac's update sheet triggering the alert by checking whether the
+// modal delegate is an instance of TSUpdateCheck. If it is, it retains the modal delegate's delegate.
+//
+// Our override of 2) then autoreleases the delegate, balancing the retain we added in 1).
+//
+// These two overrides have the effect of ensuring that the WmvPlugin instance will always outlive the TSUpdateCheck
+// instance, preventing the TSUpdateCheck instance from accessing a stale delegate pointer and crashing the application.
+
+
+typedef void (*beginSheetModalForWindowIMP)(id, SEL, NSWindow *, id, SEL, void*);
+static beginSheetModalForWindowIMP original_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_;
+
+typedef void (*alertDidEndIMP)(id, SEL, NSAlert *, NSInteger, void*);
+static alertDidEndIMP original_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_;
+
+static void WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_(id object, SEL selector, NSAlert *alert, NSInteger returnCode, void* contextInfo)
+{
+    [[object delegate] autorelease];
+
+    original_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_(object, selector, alert, returnCode, contextInfo);
+}
+
+static void WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(id object, SEL selector, NSWindow *window, id modalDelegate, SEL didEndSelector, void* contextInfo)
+{
+    if (isKindOfClass(modalDelegate, @"TSUpdateCheck"))
+        [[modalDelegate delegate] retain];
+
+    original_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(object, selector, window, modalDelegate, didEndSelector, contextInfo);
+}
+
+static void installFlip4MacPlugInWorkaroundIfNecessary()
+{
+    static bool hasInstalledFlip4MacPlugInWorkaround;
+    if (!hasInstalledFlip4MacPlugInWorkaround) {
+        Class TSUpdateCheck = objc_lookUpClass("TSUpdateCheck");
+        if (!TSUpdateCheck)
+            return;
+
+        Method methodToPatch = class_getInstanceMethod(TSUpdateCheck, @selector(alertDidEnd:returnCode:contextInfo:));
+        if (!methodToPatch)
+            return;
+
+        IMP originalMethod = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_));
+        original_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_ = reinterpret_cast<alertDidEndIMP>(originalMethod);
+
+        methodToPatch = class_getInstanceMethod(objc_getRequiredClass("NSAlert"), @selector(beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:));
+        originalMethod = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_));
+        original_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_ = reinterpret_cast<beginSheetModalForWindowIMP>(originalMethod);
+
+        hasInstalledFlip4MacPlugInWorkaround = true;
+    }
+}
diff --git a/WebKit/mac/Resources/nullplugin.tiff b/WebKit/mac/Resources/nullplugin.tiff
deleted file mode 100644
index 8a2d9df..0000000
--- a/WebKit/mac/Resources/nullplugin.tiff
+++ /dev/null
Binary files differ
diff --git a/WebKit/mac/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm
index a84f235..2c58889 100644
--- a/WebKit/mac/Storage/WebDatabaseManager.mm
+++ b/WebKit/mac/Storage/WebDatabaseManager.mm
@@ -107,14 +107,14 @@
     DatabaseTracker::tracker().deleteAllDatabases();
 }
 
-- (void)deleteOrigin:(WebSecurityOrigin *)origin
+- (BOOL)deleteOrigin:(WebSecurityOrigin *)origin
 {
-    DatabaseTracker::tracker().deleteOrigin([origin _core]);
+    return DatabaseTracker::tracker().deleteOrigin([origin _core]);
 }
 
-- (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin
+- (BOOL)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin
 {
-    DatabaseTracker::tracker().deleteDatabase([origin _core], databaseIdentifier);
+    return DatabaseTracker::tracker().deleteDatabase([origin _core], databaseIdentifier);
 }
 
 @end
diff --git a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h
index e373b1c..94d8109 100644
--- a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h
+++ b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h
@@ -60,8 +60,8 @@
 - (NSDictionary *)detailsForDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin;
 
 - (void)deleteAllDatabases; // Deletes all databases and all origins.
-- (void)deleteOrigin:(WebSecurityOrigin *)origin;
-- (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin;
+- (BOOL)deleteOrigin:(WebSecurityOrigin *)origin;
+- (BOOL)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin;
 
 @end
 
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h
index c8da53b..478269c 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -91,8 +91,11 @@
     
     virtual WebCore::IntRect windowResizerRect() const;
 
-    virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+    virtual void invalidateWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
+
     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
     virtual PlatformPageClient platformPageClient() const;
@@ -120,7 +123,7 @@
 #endif
 
     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
-    virtual void iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>);
+    virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*);
 
     virtual bool setCursor(WebCore::PlatformCursorHandle) { return false; }
 
@@ -160,7 +163,11 @@
 #endif
 
     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+<<<<<<< HEAD
     virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*) { }
+=======
+    virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*) { }
+>>>>>>> webkit.org at r58033
 
 private:
     WebView *m_webView;
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index b2240d9..d27a19c 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -56,6 +56,7 @@
 #import <WebCore/Geolocation.h>
 #import <WebCore/HitTestResult.h>
 #import <WebCore/HTMLNames.h>
+#import <WebCore/Icon.h>
 #import <WebCore/IntRect.h>
 #import <WebCore/Page.h>
 #import <WebCore/PlatformScreen.h>
@@ -439,20 +440,32 @@
     return enclosingIntRect([m_webView convertRect:rect fromView:nil]);
 }
 
-void WebChromeClient::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void WebChromeClient::invalidateWindow(const IntRect&, bool immediate)
 {
-    if ([m_webView _usesDocumentViews])
-        return;
-    
-    if (contentChanged)
-        [m_webView setNeedsDisplayInRect:rect];
-    
     if (immediate) {
         [[m_webView window] displayIfNeeded];
         [[m_webView window] flushWindowIfNeeded];
     }
 }
 
+void WebChromeClient::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
+{
+    if ([m_webView _usesDocumentViews])
+        return;
+
+    [m_webView setNeedsDisplayInRect:rect];
+
+    if (immediate) {
+        [[m_webView window] displayIfNeeded];
+        [[m_webView window] flushWindowIfNeeded];
+    }
+}
+
+void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
+{
+    invalidateContentsAndWindow(rect, immediate);
+}
+
 void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&)
 {
 }
@@ -631,9 +644,9 @@
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-void WebChromeClient::iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>)
+void WebChromeClient::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
 {
-    // FIXME: Move the code of Icon::createIconForFiles() here.
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 KeyboardUIMode WebChromeClient::keyboardUIMode()
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 988b8a6..d497513 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -126,7 +126,6 @@
     virtual void revertToProvisionalState(WebCore::DocumentLoader*);
     virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
     virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length);
-    virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&);
 
     virtual void willChangeEstimatedProgress();
     virtual void didChangeEstimatedProgress();
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index 52a24b4..0088eae 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -60,7 +60,6 @@
 #import "WebNSURLExtras.h"
 #import "WebNetscapePluginView.h"
 #import "WebNetscapePluginPackage.h"
-#import "WebNullPluginView.h"
 #import "WebPanelAuthenticationHandler.h"
 #import "WebPluginController.h"
 #import "WebPluginPackage.h"
@@ -349,10 +348,6 @@
     return true;
 }
 
-void WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
-{
-}
-
 void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
 {
     WebView *webView = getWebView(m_webFrame.get());
@@ -1524,8 +1519,11 @@
 
     WebView *webView = getWebView(m_webFrame.get());
     SEL selector = @selector(webView:plugInViewWithArguments:);
-    NSURL *URL = url;
 
+    Document* document = core(m_webFrame.get())->document();
+    NSURL *baseURL = document->baseURL();
+    NSURL *pluginURL = url;
+    
     if ([[webView UIDelegate] respondsToSelector:selector]) {
         NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:kit(paramValues) forKeys:kit(paramNames)];
         NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys:
@@ -1533,7 +1531,7 @@
             [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey,
             [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey,
             kit(element), WebPlugInContainingElementKey,
-            URL, WebPlugInBaseURLKey, // URL might be nil, so add it last
+            baseURL, WebPlugInBaseURLKey,
             nil];
 
         NSView *view = CallUIDelegate(webView, selector, arguments);
@@ -1555,7 +1553,7 @@
         pluginPackage = [webView _pluginForMIMEType:mimeType];
     }
     
-    NSString *extension = [[URL path] pathExtension];
+    NSString *extension = [[pluginURL path] pathExtension];
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     // don't allow proxy plug-in selection by file extension
     if (element->hasTagName(videoTag) || element->hasTagName(audioTag))
@@ -1573,8 +1571,6 @@
 
     NSView *view = nil;
 
-    Document* document = core(m_webFrame.get())->document();
-    NSURL *baseURL = document->baseURL();
     if (pluginPackage) {
         if ([pluginPackage isKindOfClass:[WebPluginPackage class]])
             view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, kit(paramNames), kit(paramValues), baseURL, kit(element), loadManually);
@@ -1584,7 +1580,7 @@
             WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc]
                 initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
                 pluginPackage:(WebNetscapePluginPackage *)pluginPackage
-                URL:URL
+                URL:pluginURL
                 baseURL:baseURL
                 MIMEType:MIMEType
                 attributeKeys:kit(paramNames)
@@ -1600,17 +1596,21 @@
 
     if (!errorCode && !view)
         errorCode = WebKitErrorCannotLoadPlugIn;
+    
+    if (errorCode && m_webFrame) {
+        WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView);
+        if (implementations->plugInFailedWithErrorFunc) {
+            KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage")));
+            if (!pluginPageURL.protocolInHTTPFamily())
+                pluginPageURL = KURL();
+            NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
+                                                            contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType];
+            CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
+                                     @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
+            [error release];
+        }
 
-    if (errorCode) {
-        KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage")));
-        if (!pluginPageURL.protocolInHTTPFamily())
-            pluginPageURL = KURL();
-        NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
-            contentURL:URL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType];
-        WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
-            error:error DOMElement:kit(element)] autorelease];
-        view = nullView;
-        [error release];
+        return 0;
     }
     
     ASSERT(view);
@@ -1691,14 +1691,13 @@
     }
 
     if (!view) {
-        NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable
-            contentURL:nil
-            pluginPageURL:nil
-            pluginName:[pluginPackage name]
-            MIMEType:MIMEType];
-        view = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height())
-            error:error DOMElement:kit(element)] autorelease];
-        [error release];
+        WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(getWebView(m_webFrame.get()));
+        if (implementations->plugInFailedWithErrorFunc) {
+            NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:[pluginPackage name] MIMEType:MIMEType];
+            CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
+                                     @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
+            [error release];
+        }
     }
 
     ASSERT(view);
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm b/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm
index 32e8d0d..1bdb616 100644
--- a/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm
+++ b/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm
@@ -38,6 +38,7 @@
 
 + (void)setPosition:(double)latitude:(double)longitude:(double)accuracy
 {
+#if ENABLE(GEOLOCATION)
     RefPtr<Coordinates> coordinates = Coordinates::create(latitude,
                                                           longitude,
                                                           false, 0.0,  // altitude
@@ -47,13 +48,16 @@
                                                           false, 0.0);  // speed
     RefPtr<Geoposition> position = Geoposition::create(coordinates.release(), currentTime() * 1000.0);
     GeolocationServiceMock::setPosition(position.release());
+#endif
 }
 
 + (void)setError:(int)code:(NSString *)message
 {
+#if ENABLE(GEOLOCATION)
     PositionError::ErrorCode codeEnum = static_cast<PositionError::ErrorCode>(code);
     RefPtr<PositionError> error = PositionError::create(codeEnum, message);
     GeolocationServiceMock::setError(error.release());
+#endif
 }
 
 @end
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
index 64621f8..ee81b25 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h
@@ -27,15 +27,18 @@
  */
 
 #import <WebCore/InspectorClient.h>
+#import <WebCore/InspectorFrontendClientLocal.h>
 #import <WebCore/PlatformString.h>
 
 #import <wtf/RetainPtr.h>
 
 #ifdef __OBJC__
 @class WebInspectorWindowController;
+@class WebNodeHighlighter;
 @class WebView;
 #else
 class WebInspectorWindowController;
+class WebNodeHighlighter;
 class WebView;
 #endif
 
@@ -45,32 +48,41 @@
 
     virtual void inspectorDestroyed();
 
-    virtual WebCore::Page* createPage();
-    virtual WebCore::String localizedStringsURL();
-
-    virtual WebCore::String hiddenPanels();
-
-    virtual void showWindow();
-    virtual void closeWindow();
-
-    virtual void attachWindow();
-    virtual void detachWindow();
-
-    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void openInspectorFrontend(WebCore::InspectorController*);
 
     virtual void highlight(WebCore::Node*);
     virtual void hideHighlight();
-    virtual void inspectedURLChanged(const WebCore::String& newURL);
 
     virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
     virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
 
-    virtual void inspectorWindowObjectCleared();
+private:
+    WebView *m_webView;
+    RetainPtr<WebNodeHighlighter> m_highlighter;
+};
+
+class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal {
+public:
+    WebInspectorFrontendClient(WebView*, WebInspectorWindowController*, WebCore::InspectorController*, WebCore::Page*);
+
+    virtual void frontendLoaded();
+    
+    virtual WebCore::String localizedStringsURL();
+    virtual WebCore::String hiddenPanels();
+    
+    virtual void bringToFront();
+    virtual void closeWindow();
+    
+    virtual void attachWindow();
+    virtual void detachWindow();
+    
+    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void inspectedURLChanged(const WebCore::String& newURL);
 
 private:
     void updateWindowTitle() const;
 
-    WebView *m_webView;
+    WebView* m_inspectedWebView;
     RetainPtr<WebInspectorWindowController> m_windowController;
     WebCore::String m_inspectedURL;
 };
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index 01515b1..00c51a9 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -41,54 +41,102 @@
 #import <WebCore/Page.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKitSystemInterface.h>
+#import <wtf/PassOwnPtr.h>
 
 using namespace WebCore;
 
-static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
-
 @interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> {
 @private
     WebView *_inspectedWebView;
     WebView *_webView;
-    WebNodeHighlight *_currentHighlight;
+    WebInspectorFrontendClient* _frontendClient;
     BOOL _attachedToInspectedWebView;
     BOOL _shouldAttach;
     BOOL _visible;
-    BOOL _movingWindows;
+    BOOL _destroyingInspectorView;
 }
 - (id)initWithInspectedWebView:(WebView *)webView;
-- (BOOL)inspectorVisible;
 - (WebView *)webView;
 - (void)attach;
 - (void)detach;
+- (BOOL)attached;
+- (void)setFrontendClient:(WebInspectorFrontendClient*)frontendClient;
 - (void)setAttachedWindowHeight:(unsigned)height;
+- (void)destroyInspectorView;
+@end
+
+#pragma mark -
+
+@interface WebNodeHighlighter : NSObject {
+@private
+    WebView *_inspectedWebView;
+    WebNodeHighlight *_currentHighlight;
+}
+- (id)initWithInspectedWebView:(WebView *)webView;
 - (void)highlightNode:(DOMNode *)node;
 - (void)hideHighlight;
 @end
 
 #pragma mark -
 
+
 WebInspectorClient::WebInspectorClient(WebView *webView)
 : m_webView(webView)
+, m_highlighter(AdoptNS, [[WebNodeHighlighter alloc] initWithInspectedWebView:webView])
 {
 }
 
 void WebInspectorClient::inspectorDestroyed()
 {
-    [[m_windowController.get() webView] close];
     delete this;
 }
 
-Page* WebInspectorClient::createPage()
+void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorController)
 {
-    if (m_windowController)
-        [[m_windowController.get() webView] close];
-    m_windowController.adoptNS([[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]);
+    RetainPtr<WebInspectorWindowController> windowController(AdoptNS, [[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]);
+    Page* frontendPage = core([windowController.get() webView]);
 
-    return core([m_windowController.get() webView]);
+    frontendPage->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, frontendPage));
 }
 
-String WebInspectorClient::localizedStringsURL()
+void WebInspectorClient::highlight(Node* node)
+{
+    [m_highlighter.get() highlightNode:kit(node)];
+}
+
+void WebInspectorClient::hideHighlight()
+{
+    [m_highlighter.get() hideHighlight];
+}
+
+WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, WebInspectorWindowController* windowController, InspectorController* inspectorController, Page* frontendPage)
+    : InspectorFrontendClientLocal(inspectorController,  frontendPage)
+    , m_inspectedWebView(inspectedWebView)
+    , m_windowController(windowController)
+{
+    [windowController setFrontendClient:this];
+}
+
+void WebInspectorFrontendClient::frontendLoaded()
+{
+    [m_windowController.get() showWindow:nil];
+    if ([m_windowController.get() attached])
+        restoreAttachedWindowHeight();
+
+    InspectorFrontendClientLocal::frontendLoaded();
+
+    WebFrame *frame = [m_inspectedWebView mainFrame];
+    
+    WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(m_inspectedWebView);
+    if (implementations->didClearInspectorWindowObjectForFrameFunc)
+        CallFrameLoadDelegate(implementations->didClearInspectorWindowObjectForFrameFunc, m_inspectedWebView,
+                              @selector(webView:didClearInspectorWindowObject:forFrame:), [frame windowObject], frame);
+
+    bool attached = [m_windowController.get() attached];
+    setAttachedWindow(attached);
+}
+
+String WebInspectorFrontendClient::localizedStringsURL()
 {
     NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"localizedStrings" ofType:@"js"];
     if (path)
@@ -96,7 +144,7 @@
     return String();
 }
 
-String WebInspectorClient::hiddenPanels()
+String WebInspectorFrontendClient::hiddenPanels()
 {
     NSString *hiddenPanels = [[NSUserDefaults standardUserDefaults] stringForKey:@"WebKitInspectorHiddenPanels"];
     if (hiddenPanels)
@@ -104,63 +152,47 @@
     return String();
 }
 
-void WebInspectorClient::showWindow()
+void WebInspectorFrontendClient::bringToFront()
 {
     updateWindowTitle();
     [m_windowController.get() showWindow:nil];
 }
 
-void WebInspectorClient::closeWindow()
+void WebInspectorFrontendClient::closeWindow()
 {
-    [m_windowController.get() close];
+    [m_windowController.get() destroyInspectorView];
 }
 
-void WebInspectorClient::attachWindow()
+void WebInspectorFrontendClient::attachWindow()
 {
+    if ([m_windowController.get() attached])
+        return;
     [m_windowController.get() attach];
+    restoreAttachedWindowHeight();
 }
 
-void WebInspectorClient::detachWindow()
+void WebInspectorFrontendClient::detachWindow()
 {
     [m_windowController.get() detach];
 }
 
-void WebInspectorClient::setAttachedWindowHeight(unsigned height)
+void WebInspectorFrontendClient::setAttachedWindowHeight(unsigned height)
 {
     [m_windowController.get() setAttachedWindowHeight:height];
 }
 
-void WebInspectorClient::highlight(Node* node)
-{
-    [m_windowController.get() highlightNode:kit(node)];
-}
-
-void WebInspectorClient::hideHighlight()
-{
-    [m_windowController.get() hideHighlight];
-}
-
-void WebInspectorClient::inspectedURLChanged(const String& newURL)
+void WebInspectorFrontendClient::inspectedURLChanged(const String& newURL)
 {
     m_inspectedURL = newURL;
     updateWindowTitle();
 }
 
-void WebInspectorClient::updateWindowTitle() const
+void WebInspectorFrontendClient::updateWindowTitle() const
 {
     NSString *title = [NSString stringWithFormat:UI_STRING("Web Inspector — %@", "Web Inspector window title"), (NSString *)m_inspectedURL];
     [[m_windowController.get() window] setTitle:title];
 }
 
-void WebInspectorClient::inspectorWindowObjectCleared()
-{
-    WebFrame *frame = [m_webView mainFrame];
-    
-    WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(m_webView);
-    if (implementations->didClearInspectorWindowObjectForFrameFunc)
-        CallFrameLoadDelegate(implementations->didClearInspectorWindowObjectForFrameFunc, m_webView,
-          @selector(webView:didClearInspectorWindowObject:forFrame:), [frame windowObject], frame);
-}
 
 #pragma mark -
 
@@ -223,18 +255,12 @@
 
 - (void)dealloc
 {
-    ASSERT(!_currentHighlight);
     [_webView release];
     [super dealloc];
 }
 
 #pragma mark -
 
-- (BOOL)inspectorVisible
-{
-    return _visible;
-}
-
 - (WebView *)webView
 {
     return _webView;
@@ -273,11 +299,7 @@
 
 - (BOOL)windowShouldClose:(id)sender
 {
-    _visible = NO;
-
-    [_inspectedWebView page]->inspectorController()->setWindowVisible(false);
-
-    [self hideHighlight];
+    [self destroyInspectorView];
 
     return YES;
 }
@@ -289,11 +311,6 @@
 
     _visible = NO;
 
-    if (!_movingWindows)
-        [_inspectedWebView page]->inspectorController()->setWindowVisible(false);
-
-    [self hideHighlight];
-
     if (_attachedToInspectedWebView) {
         if ([_inspectedWebView _isClosed])
             return;
@@ -327,8 +344,11 @@
     _visible = YES;
     
     // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
-    String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName);
+    String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(InspectorController::inspectorStartsAttachedSettingName());
     _shouldAttach = shouldAttach != "false";
+    
+    if (_shouldAttach && !_frontendClient->canAttachWindow())
+        _shouldAttach = NO;
 
     if (_shouldAttach) {
         WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
@@ -351,8 +371,6 @@
 
         [super showWindow:nil];
     }
-
-    [_inspectedWebView page]->inspectorController()->setWindowVisible(true, _shouldAttach);
 }
 
 #pragma mark -
@@ -362,13 +380,10 @@
     if (_attachedToInspectedWebView)
         return;
 
-    [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, "true");
-    _movingWindows = YES;
+    [_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "true");
 
     [self close];
     [self showWindow:nil];
-
-    _movingWindows = NO;
 }
 
 - (void)detach
@@ -376,14 +391,20 @@
     if (!_attachedToInspectedWebView)
         return;
 
-    [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, "false");
-    _movingWindows = YES;
+    [_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "false");
 
     [self close];
     [self showWindow:nil];
+}
 
-    _movingWindows = NO;
+- (BOOL)attached
+{
+    return _attachedToInspectedWebView;
+}
 
+- (void)setFrontendClient:(WebInspectorFrontendClient*)frontendClient
+{
+    _frontendClient = frontendClient;
 }
 
 - (void)setAttachedWindowHeight:(unsigned)height
@@ -404,29 +425,17 @@
     [frameView setFrame:frameViewRect];
 }
 
-#pragma mark -
-
-- (void)highlightNode:(DOMNode *)node
+- (void)destroyInspectorView
 {
-    // The scrollview's content view stays around between page navigations, so target it
-    NSView *view = [[[[[_inspectedWebView mainFrame] frameView] documentView] enclosingScrollView] contentView];
-    if (![view window])
-        return; // skip the highlight if we have no window (e.g. hidden tab)
+    if (_destroyingInspectorView)
+        return;
+    _destroyingInspectorView = YES;
 
-    if (!_currentHighlight) {
-        _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()];
-        [_currentHighlight setDelegate:self];
-        [_currentHighlight attach];
-    } else
-        [[_currentHighlight highlightView] setNeedsDisplay:YES];
-}
-
-- (void)hideHighlight
-{
-    [_currentHighlight detach];
-    [_currentHighlight setDelegate:nil];
-    [_currentHighlight release];
-    _currentHighlight = nil;
+    if (_attachedToInspectedWebView)
+        [self close];
+    _visible = NO;
+    [_inspectedWebView page]->inspectorController()->disconnectFrontend();
+    [_webView close];
 }
 
 #pragma mark -
@@ -496,3 +505,60 @@
 }
 
 @end
+
+
+#pragma mark -
+
+@implementation WebNodeHighlighter
+- (id)initWithInspectedWebView:(WebView *)webView
+{
+    // Don't retain to avoid a circular reference
+    _inspectedWebView = webView;
+    return self;
+}
+
+- (void)dealloc
+{
+    ASSERT(!_currentHighlight);
+    [super dealloc];
+}
+
+#pragma mark -
+
+- (void)highlightNode:(DOMNode *)node
+{
+    // The scrollview's content view stays around between page navigations, so target it
+    NSView *view = [[[[[_inspectedWebView mainFrame] frameView] documentView] enclosingScrollView] contentView];
+    if (![view window])
+        return; // skip the highlight if we have no window (e.g. hidden tab)
+    
+    if (!_currentHighlight) {
+        _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()];
+        [_currentHighlight setDelegate:self];
+        [_currentHighlight attach];
+    } else
+        [[_currentHighlight highlightView] setNeedsDisplay:YES];
+}
+
+- (void)hideHighlight
+{
+    [_currentHighlight detach];
+    [_currentHighlight setDelegate:nil];
+    [_currentHighlight release];
+    _currentHighlight = nil;
+}
+
+#pragma mark -
+#pragma mark WebNodeHighlight delegate
+
+- (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight
+{
+    [_inspectedWebView setCurrentNodeHighlight:highlight];
+}
+
+- (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight
+{
+    [_inspectedWebView setCurrentNodeHighlight:nil];
+}
+    
+@end
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
index 7f4effd..b792707 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.m
@@ -45,6 +45,7 @@
     INIT(AdvanceDefaultButtonPulseAnimation);
     INIT(CGContextGetShouldSmoothFonts);
     INIT(CopyCONNECTProxyResponse);
+    INIT(CopyNSURLResponseStatusLine);
     INIT(CreateCustomCFReadStream);
     INIT(CreateNSURLConnectionDelegateProxy);
     INIT(DrawCapsLockIndicator);
@@ -89,6 +90,7 @@
     INIT(QTMovieGetType);
     INIT(QTMovieHasClosedCaptions);
     INIT(QTMovieSetShowClosedCaptions);
+    INIT(QTMovieSelectPreferredAlternates);
     INIT(QTMovieViewSetDrawSynchronously);
 
 #ifndef BUILDING_ON_TIGER
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index 2607f18..fd6d5b0 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -640,6 +640,16 @@
     return nil;
 }
 
+- (NSString *)missingPluginText
+{
+    return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
+}
+
+- (NSString *)crashedPluginText
+{
+    return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
+}
+
 - (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles
 {
     return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
diff --git a/WebKit/mac/WebInspector/WebInspector.mm b/WebKit/mac/WebInspector/WebInspector.mm
index 258dd01..9b17459 100644
--- a/WebKit/mac/WebInspector/WebInspector.mm
+++ b/WebKit/mac/WebInspector/WebInspector.mm
@@ -175,14 +175,10 @@
 
 - (void)attach:(id)sender
 {
-    if (Page* page = core(_webView))
-        page->inspectorController()->attachWindow();
 }
 
 - (void)detach:(id)sender
 {
-    if (Page* page = core(_webView))
-        page->inspectorController()->detachWindow();
 }
 
 - (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script
diff --git a/WebKit/mac/WebInspector/WebInspectorPrivate.h b/WebKit/mac/WebInspector/WebInspectorPrivate.h
index c82bb92..d18f804 100644
--- a/WebKit/mac/WebInspector/WebInspectorPrivate.h
+++ b/WebKit/mac/WebInspector/WebInspectorPrivate.h
@@ -28,7 +28,7 @@
 
 // This header contains the WebInspector SPI.
 
-#import "WebInspector.h"
+#import <WebKit/WebInspector.h>
 
 @interface WebInspector (WebPrivate)
 - (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script;
diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp
index 904f389..d14d805 100644
--- a/WebKit/mac/WebKit.exp
+++ b/WebKit/mac/WebKit.exp
@@ -35,6 +35,7 @@
 .objc_class_name_WebStringTruncator
 .objc_class_name_WebTextIterator
 .objc_class_name_WebURLsWithTitles
+.objc_class_name_WebUserContentURLPattern
 .objc_class_name_WebView
 .objc_class_name_WebWorkersPrivate
 _HIWebViewCreate
@@ -120,4 +121,6 @@
 _WebViewProgressEstimateChangedNotification
 _WebViewProgressFinishedNotification
 _WebViewProgressStartedNotification
+__WebHTMLViewPrintingMaximumShrinkFactor
+__WebHTMLViewPrintingMinimumShrinkFactor
 __WebViewDidStartAcceleratedCompositingNotification
diff --git a/WebKit/mac/WebKitPrefix.h b/WebKit/mac/WebKitPrefix.h
index 2a894e6..fe0f214 100644
--- a/WebKit/mac/WebKitPrefix.h
+++ b/WebKit/mac/WebKitPrefix.h
@@ -72,7 +72,7 @@
 
 #include <wtf/Platform.h>
 
-#include "EmptyProtocolDefinitions.h"
+#include <WebCore/EmptyProtocolDefinitions.h>
 
 /* WebKit has no way to pull settings from WebCore/config.h for now */
 /* so we assume WebKit is always being compiled on top of JavaScriptCore */
diff --git a/WebKit/mac/WebView/WebArchive.mm b/WebKit/mac/WebView/WebArchive.mm
index 89c8335..86e29c8 100644
--- a/WebKit/mac/WebView/WebArchive.mm
+++ b/WebKit/mac/WebView/WebArchive.mm
@@ -239,13 +239,13 @@
     @try {
         id object = [decoder decodeObjectForKey:WebMainResourceKey];
         if ([object isKindOfClass:[WebResource class]])
-            mainResource = [object retain];
+            mainResource = object;
         object = [decoder decodeObjectForKey:WebSubresourcesKey];
         if (isArrayOfClass(object, [WebResource class]))
-            subresources = [object retain];
+            subresources = object;
         object = [decoder decodeObjectForKey:WebSubframeArchivesKey];
         if (isArrayOfClass(object, [WebArchive class]))
-            subframeArchives = [object retain];
+            subframeArchives = object;
     } @catch(id) {
         [self release];
         return nil;
diff --git a/WebKit/mac/WebView/WebDocumentPrivate.h b/WebKit/mac/WebView/WebDocumentPrivate.h
index f09d3bd..a495e4b 100644
--- a/WebKit/mac/WebView/WebDocumentPrivate.h
+++ b/WebKit/mac/WebView/WebDocumentPrivate.h
@@ -30,6 +30,7 @@
 #import <WebKit/WebHTMLView.h>
 
 @class DOMDocument;
+@class PDFDocument;
 
 @protocol WebDocumentImage <NSObject>
 - (NSImage *)image;
@@ -64,6 +65,10 @@
 - (NSView *)selectionView;
 @end
 
+@protocol WebDocumentPDF <WebDocumentText>
+- (PDFDocument *)PDFDocument;
+@end
+
 @protocol WebDocumentIncrementalSearching
 /*!
 @method searchFor:direction:caseSensitive:wrap:startInSelection:
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.h b/WebKit/mac/WebView/WebDynamicScrollBarsView.h
index 15ed7e4..c289a04 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.h
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.h
@@ -1,53 +1,61 @@
 /*
- * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2008, 2010 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.
  *
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
  */
 
 // This is a Private header (containing SPI), despite the fact that its name
 // does not contain the word Private.
 
-// This was once used by Safari, but has not been for a long time.
+#import <AppKit/NSScrollView.h>
 
 // FIXME: <rdar://problem/5898985> Mail currently expects this header to define WebCoreScrollbarAlwaysOn.
 extern const int WebCoreScrollbarAlwaysOn;
 
+struct WebDynamicScrollBarsViewPrivate;
 @interface WebDynamicScrollBarsView : NSScrollView {
-    int hScroll; // FIXME: Should be WebCore::ScrollbarMode if this was an ObjC++ header.
-    int vScroll; // Ditto.
-    BOOL hScrollModeLocked;
-    BOOL vScrollModeLocked;
-    BOOL suppressLayout;
-    BOOL suppressScrollers;
-    BOOL inUpdateScrollers;
-    BOOL verticallyPinnedByPreviousWheelEvent;
-    BOOL horizontallyPinnedByPreviousWheelEvent;
-    unsigned inUpdateScrollersLayoutPass;
+@private
+    struct WebDynamicScrollBarsViewPrivate *_private;
+
+#ifndef __OBJC2__
+    // We need to pad the class out to its former size.  See <rdar://problem/7814899> for more information.
+    char padding[16];
+#endif
 }
 
 // This was originally added for Safari's benefit, but Safari has not used it for a long time.
 // Perhaps it can be removed.
 - (void)setAllowsHorizontalScrolling:(BOOL)flag;
+
+// Determines whether the scrollers should be drawn outside of the content (as in normal scroll views)
+// or should overlap the content.
+- (void)setAllowsScrollersToOverlapContent:(BOOL)flag;
+
+// These methods hide the scrollers in a way that does not prevent scrolling.
+- (void)setAlwaysHideHorizontalScroller:(BOOL)flag;
+- (void)setAlwaysHideVerticalScroller:(BOOL)flag;
+
+// These methods return YES if the scrollers are visible, or if the only reason that they are not
+// visible is that they have been suppressed by setAlwaysHideHorizontal/VerticalScroller:.
+- (BOOL)horizontalScrollingAllowed;
+- (BOOL)verticalScrollingAllowed;
 @end
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
index b4424e1..3aaea46 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
@@ -1,29 +1,26 @@
 /*
- * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2008, 2010 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.
  *
- * 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. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
  */
 
 #import "WebDynamicScrollBarsViewInternal.h"
@@ -41,31 +38,150 @@
 // FIXME: <rdar://problem/5898985> Mail expects a constant of this name to exist.
 const int WebCoreScrollbarAlwaysOn = ScrollbarAlwaysOn;
 
+#ifndef __OBJC2__
+// In <rdar://problem/7814899> we saw crashes because WebDynamicScrollBarsView increased in size, breaking ABI compatiblity.
+COMPILE_ASSERT(sizeof(WebDynamicScrollBarsView) == 0x8c, WebDynamicScrollBarsView_is_expected_size);
+#endif
+
+struct WebDynamicScrollBarsViewPrivate {
+    unsigned inUpdateScrollersLayoutPass;
+
+    WebCore::ScrollbarMode hScroll;
+    WebCore::ScrollbarMode vScroll;
+
+    bool hScrollModeLocked;
+    bool vScrollModeLocked;
+    bool suppressLayout;
+    bool suppressScrollers;
+    bool inUpdateScrollers;
+    bool verticallyPinnedByPreviousWheelEvent;
+    bool horizontallyPinnedByPreviousWheelEvent;
+
+    bool allowsScrollersToOverlapContent;
+    bool alwaysHideHorizontalScroller;
+    bool alwaysHideVerticalScroller;
+    bool horizontalScrollingAllowedButScrollerHidden;
+    bool verticalScrollingAllowedButScrollerHidden;
+};
+
 @implementation WebDynamicScrollBarsView
 
+- (id)initWithFrame:(NSRect)frame
+{
+    if (!(self = [super initWithFrame:frame]))
+        return nil;
+
+    _private = new WebDynamicScrollBarsViewPrivate;
+    memset(_private, 0, sizeof(WebDynamicScrollBarsViewPrivate));
+    return self;
+}
+
+- (id)initWithCoder:(NSCoder *)aDecoder
+{
+    if (!(self = [super initWithCoder:aDecoder]))
+        return nil;
+
+    _private = new WebDynamicScrollBarsViewPrivate;
+    memset(_private, 0, sizeof(WebDynamicScrollBarsViewPrivate));
+    return self;
+}
+
+- (void)dealloc
+{
+    delete _private;
+    [super dealloc];
+}
+
+- (void)finalize
+{
+    delete _private;
+    [super finalize];
+}
+
 - (void)setAllowsHorizontalScrolling:(BOOL)flag
 {
-    if (hScrollModeLocked)
+    if (_private->hScrollModeLocked)
         return;
-    if (flag && hScroll == ScrollbarAlwaysOff)
-        hScroll = ScrollbarAuto;
-    else if (!flag && hScroll != ScrollbarAlwaysOff)
-        hScroll = ScrollbarAlwaysOff;
+    if (flag && _private->hScroll == ScrollbarAlwaysOff)
+        _private->hScroll = ScrollbarAuto;
+    else if (!flag && _private->hScroll != ScrollbarAlwaysOff)
+        _private->hScroll = ScrollbarAlwaysOff;
     [self updateScrollers];
 }
 
+- (void)setAllowsScrollersToOverlapContent:(BOOL)flag
+{
+    if (_private->allowsScrollersToOverlapContent == flag)
+        return;
+
+    _private->allowsScrollersToOverlapContent = flag;
+
+    [[self contentView] setFrame:[self contentViewFrame]];
+    [[self documentView] setNeedsLayout:YES];
+    [[self documentView] layout];
+}
+
+- (void)setAlwaysHideHorizontalScroller:(BOOL)shouldBeHidden
+{
+    if (_private->alwaysHideHorizontalScroller == shouldBeHidden)
+        return;
+
+    _private->alwaysHideHorizontalScroller = shouldBeHidden;
+    [self updateScrollers];
+}
+
+- (void)setAlwaysHideVerticalScroller:(BOOL)shouldBeHidden
+{
+    if (_private->alwaysHideVerticalScroller == shouldBeHidden)
+        return;
+
+    _private->alwaysHideVerticalScroller = shouldBeHidden;
+    [self updateScrollers];
+}
+
+- (BOOL)horizontalScrollingAllowed
+{
+    return _private->horizontalScrollingAllowedButScrollerHidden || [self hasHorizontalScroller];
+}
+
+- (BOOL)verticalScrollingAllowed
+{
+    return _private->verticalScrollingAllowedButScrollerHidden || [self hasVerticalScroller];
+}
+
 @end
 
 @implementation WebDynamicScrollBarsView (WebInternal)
 
+- (NSRect)contentViewFrame
+{
+    NSRect frame = [[self contentView] frame];
+
+    if ([self hasHorizontalScroller])
+        frame.size.height = (_private->allowsScrollersToOverlapContent ? NSMaxY([[self horizontalScroller] frame]) : NSMinY([[self horizontalScroller] frame]));
+    if ([self hasVerticalScroller])
+        frame.size.width = (_private->allowsScrollersToOverlapContent ? NSMaxX([[self verticalScroller] frame]) : NSMinX([[self verticalScroller] frame]));
+    return frame;
+}
+
+- (void)tile
+{
+    [super tile];
+
+    // [super tile] sets the contentView size so that it does not overlap with the scrollers,
+    // we want to re-set the contentView to overlap scrollers before displaying.
+    if (_private->allowsScrollersToOverlapContent)
+        [[self contentView] setFrame:[self contentViewFrame]];
+}
+
 - (void)setSuppressLayout:(BOOL)flag;
 {
-    suppressLayout = flag;
+    _private->suppressLayout = flag;
 }
 
 - (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint
 {
-    suppressScrollers = suppressed;
+    _private->suppressScrollers = suppressed;
 
     // This code was originally changes for a Leopard performance imporvement. We decided to 
     // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>.
@@ -74,13 +190,13 @@
         [[self verticalScroller] setNeedsDisplay:NO];
         [[self horizontalScroller] setNeedsDisplay:NO];
     }
-        
+
     if (!suppressed && repaint)
         [super reflectScrolledClipView:[self contentView]];
 #else
-    if (suppressed || repaint) { 
-        [[self verticalScroller] setNeedsDisplay: !suppressed]; 
-        [[self horizontalScroller] setNeedsDisplay: !suppressed]; 
+    if (suppressed || repaint) {
+        [[self verticalScroller] setNeedsDisplay:!suppressed];
+        [[self horizontalScroller] setNeedsDisplay:!suppressed];
     }
 #endif
 }
@@ -94,42 +210,50 @@
     // If we came in here with the view already needing a layout, then go ahead and do that
     // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
     // This layout will not re-enter updateScrollers and does not count towards our max layout pass total.
-    if (!suppressLayout && !suppressScrollers && [documentView isKindOfClass:[WebHTMLView class]]) {
+    if (!_private->suppressLayout && !_private->suppressScrollers && [documentView isKindOfClass:[WebHTMLView class]]) {
         WebHTMLView* htmlView = (WebHTMLView*)documentView;
         if ([htmlView _needsLayout]) {
-            inUpdateScrollers = YES;
+            _private->inUpdateScrollers = YES;
             [(id <WebDocumentView>)documentView layout];
-            inUpdateScrollers = NO;
+            _private->inUpdateScrollers = NO;
         }
     }
 
     BOOL hasHorizontalScroller = [self hasHorizontalScroller];
     BOOL hasVerticalScroller = [self hasVerticalScroller];
-    
+
     BOOL newHasHorizontalScroller = hasHorizontalScroller;
     BOOL newHasVerticalScroller = hasVerticalScroller;
-    
+
     if (!documentView) {
         newHasHorizontalScroller = NO;
         newHasVerticalScroller = NO;
-    } 
+    }
 
-    if (hScroll != ScrollbarAuto)
-        newHasHorizontalScroller = (hScroll == ScrollbarAlwaysOn);
-    if (vScroll != ScrollbarAuto)
-        newHasVerticalScroller = (vScroll == ScrollbarAlwaysOn);
-    
-    if (!documentView || suppressLayout || suppressScrollers || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) {
-        inUpdateScrollers = YES;
+    if (_private->hScroll != ScrollbarAuto)
+        newHasHorizontalScroller = (_private->hScroll == ScrollbarAlwaysOn);
+    if (_private->vScroll != ScrollbarAuto)
+        newHasVerticalScroller = (_private->vScroll == ScrollbarAlwaysOn);
+
+    if (!documentView || _private->suppressLayout || _private->suppressScrollers || (_private->hScroll != ScrollbarAuto && _private->vScroll != ScrollbarAuto)) {
+        _private->horizontalScrollingAllowedButScrollerHidden = newHasHorizontalScroller && _private->alwaysHideHorizontalScroller;
+        if (_private->horizontalScrollingAllowedButScrollerHidden)
+            newHasHorizontalScroller = NO;
+
+        _private->verticalScrollingAllowedButScrollerHidden = newHasVerticalScroller && _private->alwaysHideVerticalScroller;
+        if (_private->verticalScrollingAllowedButScrollerHidden)
+            newHasVerticalScroller = NO;
+
+        _private->inUpdateScrollers = YES;
         if (hasHorizontalScroller != newHasHorizontalScroller)
             [self setHasHorizontalScroller:newHasHorizontalScroller];
         if (hasVerticalScroller != newHasVerticalScroller)
             [self setHasVerticalScroller:newHasVerticalScroller];
-        if (suppressScrollers) {
+        if (_private->suppressScrollers) {
             [[self verticalScroller] setNeedsDisplay:NO];
             [[self horizontalScroller] setNeedsDisplay:NO];
         }
-        inUpdateScrollers = NO;
+        _private->inUpdateScrollers = NO;
         return;
     }
 
@@ -139,42 +263,50 @@
     NSSize visibleSize = [self documentVisibleRect].size;
     NSSize frameSize = [self frame].size;
 
-    if (hScroll == ScrollbarAuto) {
+    if (_private->hScroll == ScrollbarAuto) {
         newHasHorizontalScroller = documentSize.width > visibleSize.width;
-        if (newHasHorizontalScroller && !inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width)
+        if (newHasHorizontalScroller && !_private->inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width)
             newHasHorizontalScroller = NO;
     }
-    
-    if (vScroll == ScrollbarAuto) {
+
+    if (_private->vScroll == ScrollbarAuto) {
         newHasVerticalScroller = documentSize.height > visibleSize.height;
-        if (newHasVerticalScroller && !inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width)
+        if (newHasVerticalScroller && !_private->inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width)
             newHasVerticalScroller = NO;
     }
 
     // Unless in ScrollbarsAlwaysOn mode, if we ever turn one scrollbar off, always turn the other one off too.
     // Never ever try to both gain/lose a scrollbar in the same pass.
-    if (!newHasHorizontalScroller && hasHorizontalScroller && vScroll != ScrollbarAlwaysOn)
+    if (!newHasHorizontalScroller && hasHorizontalScroller && _private->vScroll != ScrollbarAlwaysOn)
         newHasVerticalScroller = NO;
-    if (!newHasVerticalScroller && hasVerticalScroller && hScroll != ScrollbarAlwaysOn)
+    if (!newHasVerticalScroller && hasVerticalScroller && _private->hScroll != ScrollbarAlwaysOn)
         newHasHorizontalScroller = NO;
 
+    _private->horizontalScrollingAllowedButScrollerHidden = newHasHorizontalScroller && _private->alwaysHideHorizontalScroller;
+    if (_private->horizontalScrollingAllowedButScrollerHidden)
+        newHasHorizontalScroller = NO;
+
+    _private->verticalScrollingAllowedButScrollerHidden = newHasVerticalScroller && _private->alwaysHideVerticalScroller;
+    if (_private->verticalScrollingAllowedButScrollerHidden)
+        newHasVerticalScroller = NO;
+
     if (hasHorizontalScroller != newHasHorizontalScroller) {
-        inUpdateScrollers = YES;
+        _private->inUpdateScrollers = YES;
         [self setHasHorizontalScroller:newHasHorizontalScroller];
-        inUpdateScrollers = NO;
+        _private->inUpdateScrollers = NO;
         needsLayout = YES;
     }
 
     if (hasVerticalScroller != newHasVerticalScroller) {
-        inUpdateScrollers = YES;
+        _private->inUpdateScrollers = YES;
         [self setHasVerticalScroller:newHasVerticalScroller];
-        inUpdateScrollers = NO;
+        _private->inUpdateScrollers = NO;
         needsLayout = YES;
     }
 
-    if (needsLayout && inUpdateScrollersLayoutPass < cMaxUpdateScrollbarsPass && 
+    if (needsLayout && _private->inUpdateScrollersLayoutPass < cMaxUpdateScrollbarsPass &&
         [documentView conformsToProtocol:@protocol(WebDocumentView)]) {
-        inUpdateScrollersLayoutPass++;
+        _private->inUpdateScrollersLayoutPass++;
         [(id <WebDocumentView>)documentView setNeedsLayout:YES];
         [(id <WebDocumentView>)documentView layout];
         NSSize newDocumentSize = [documentView frame].size;
@@ -184,7 +316,7 @@
             // Recur manually.
             [self updateScrollers];
         }
-        inUpdateScrollersLayoutPass--;
+        _private->inUpdateScrollersLayoutPass--;
     }
 }
 
@@ -192,6 +324,10 @@
 - (void)reflectScrolledClipView:(NSClipView *)clipView
 {
     if (clipView == [self contentView]) {
+        // Prevent appearance of trails because of overlapping views
+        if (_private->allowsScrollersToOverlapContent)
+            [self setDrawsBackground:NO];
+
         // FIXME: This hack here prevents infinite recursion that takes place when we
         // gyrate between having a vertical scroller and not having one. A reproducible
         // case is clicking on the "the Policy Routing text" link at
@@ -199,7 +335,7 @@
         // The underlying cause is some problem in the NSText machinery, but I was not
         // able to pin it down.
         NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
-        if (!inUpdateScrollers && (!currentContext || [currentContext isDrawingToScreen]))
+        if (!_private->inUpdateScrollers && (!currentContext || [currentContext isDrawingToScreen]))
             [self updateScrollers];
     }
 
@@ -207,15 +343,15 @@
     // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>.
 #ifndef BUILDING_ON_TIGER
     // Update the scrollers if they're not being suppressed.
-    if (!suppressScrollers)
+    if (!_private->suppressScrollers)
         [super reflectScrolledClipView:clipView];
 #else
-    [super reflectScrolledClipView:clipView]; 
-  
-    // Validate the scrollers if they're being suppressed. 
-    if (suppressScrollers) { 
-        [[self verticalScroller] setNeedsDisplay: NO]; 
-        [[self horizontalScroller] setNeedsDisplay: NO]; 
+    [super reflectScrolledClipView:clipView];
+
+    // Validate the scrollers if they're being suppressed.
+    if (_private->suppressScrollers) {
+        [[self verticalScroller] setNeedsDisplay:NO];
+        [[self horizontalScroller] setNeedsDisplay:NO];
     }
 #endif
 
@@ -231,28 +367,28 @@
 
 - (BOOL)allowsHorizontalScrolling
 {
-    return hScroll != ScrollbarAlwaysOff;
+    return _private->hScroll != ScrollbarAlwaysOff;
 }
 
 - (BOOL)allowsVerticalScrolling
 {
-    return vScroll != ScrollbarAlwaysOff;
+    return _private->vScroll != ScrollbarAlwaysOff;
 }
 
 - (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode
 {
-    *hMode = static_cast<ScrollbarMode>(hScroll);
-    *vMode = static_cast<ScrollbarMode>(vScroll);
+    *hMode = _private->hScroll;
+    *vMode = _private->vScroll;
 }
 
 - (ScrollbarMode)horizontalScrollingMode
 {
-    return static_cast<ScrollbarMode>(hScroll);
+    return _private->hScroll;
 }
 
 - (ScrollbarMode)verticalScrollingMode
 {
-    return static_cast<ScrollbarMode>(vScroll);
+    return _private->vScroll;
 }
 
 - (void)setHorizontalScrollingMode:(ScrollbarMode)horizontalMode andLock:(BOOL)lock
@@ -274,13 +410,13 @@
 - (void)setScrollingModes:(ScrollbarMode)horizontalMode vertical:(ScrollbarMode)verticalMode andLock:(BOOL)lock
 {
     BOOL update = NO;
-    if (verticalMode != vScroll && !vScrollModeLocked) {
-        vScroll = verticalMode;
+    if (verticalMode != _private->vScroll && !_private->vScrollModeLocked) {
+        _private->vScroll = verticalMode;
         update = YES;
     }
 
-    if (horizontalMode != hScroll && !hScrollModeLocked) {
-        hScroll = horizontalMode;
+    if (horizontalMode != _private->hScroll && !_private->hScrollModeLocked) {
+        _private->hScroll = horizontalMode;
         update = YES;
     }
 
@@ -293,27 +429,27 @@
 
 - (void)setHorizontalScrollingModeLocked:(BOOL)locked
 {
-    hScrollModeLocked = locked;
+    _private->hScrollModeLocked = locked;
 }
 
 - (void)setVerticalScrollingModeLocked:(BOOL)locked
 {
-    vScrollModeLocked = locked;
+    _private->vScrollModeLocked = locked;
 }
 
 - (void)setScrollingModesLocked:(BOOL)locked
 {
-    hScrollModeLocked = vScrollModeLocked = locked;
+    _private->hScrollModeLocked = _private->vScrollModeLocked = locked;
 }
 
 - (BOOL)horizontalScrollingModeLocked
 {
-    return hScrollModeLocked;
+    return _private->hScrollModeLocked;
 }
 
 - (BOOL)verticalScrollingModeLocked
 {
-    return vScrollModeLocked;
+    return _private->vScrollModeLocked;
 }
 
 - (BOOL)autoforwardsScrollWheelEvents
@@ -325,8 +461,10 @@
 {
     float deltaX;
     float deltaY;
+    float wheelTicksX;
+    float wheelTicksY;
     BOOL isContinuous;
-    WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous);
+    WKGetWheelEventDeltas(event, &deltaX, &deltaY, &wheelTicksX, &wheelTicksY, &isContinuous);
 
     BOOL isLatchingEvent = WKIsLatchingWheelEvent(event);
 
@@ -336,7 +474,7 @@
             return;
         }
 
-        if (isLatchingEvent && !verticallyPinnedByPreviousWheelEvent) {
+        if (isLatchingEvent && !_private->verticallyPinnedByPreviousWheelEvent) {
             double verticalPosition = [[self verticalScroller] doubleValue];
             if ((deltaY >= 0.0 && verticalPosition == 0.0) || (deltaY <= 0.0 && verticalPosition == 1.0))
                 return;
@@ -347,7 +485,7 @@
             return;
         }
 
-        if (isLatchingEvent && !horizontallyPinnedByPreviousWheelEvent) {
+        if (isLatchingEvent && !_private->horizontallyPinnedByPreviousWheelEvent) {
             double horizontalPosition = [[self horizontalScroller] doubleValue];
             if ((deltaX >= 0.0 && horizontalPosition == 0.0) || (deltaX <= 0.0 && horizontalPosition == 1.0))
                 return;
@@ -364,8 +502,8 @@
         double verticalPosition = [[self verticalScroller] doubleValue];
         double horizontalPosition = [[self horizontalScroller] doubleValue];
 
-        verticallyPinnedByPreviousWheelEvent = (verticalPosition == 0.0 || verticalPosition == 1.0);
-        horizontallyPinnedByPreviousWheelEvent = (horizontalPosition == 0.0 || horizontalPosition == 1.0);
+        _private->verticallyPinnedByPreviousWheelEvent = (verticalPosition == 0.0 || verticalPosition == 1.0);
+        _private->horizontallyPinnedByPreviousWheelEvent = (horizontalPosition == 0.0 || horizontalPosition == 1.0);
     }
 
     [self release];
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h b/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h
index 312cf9d..40be88d 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h
@@ -53,4 +53,6 @@
 - (void)updateScrollers;
 - (void)setSuppressLayout:(BOOL)flag;
 
+// Calculate the appropriate frame for the contentView based on allowsScrollersToOverlapContent.
+- (NSRect)contentViewFrame;
 @end
diff --git a/WebKit/mac/WebView/WebFrame.h b/WebKit/mac/WebView/WebFrame.h
index a6cdebb..64015fd 100644
--- a/WebKit/mac/WebView/WebFrame.h
+++ b/WebKit/mac/WebView/WebFrame.h
@@ -213,5 +213,4 @@
     bridge between the WebKit and JavaScriptCore APIs.
 */
 - (JSGlobalContextRef)globalContext;
-
 @end
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 267d319..b4169b6 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -39,6 +39,7 @@
 #import "WebChromeClient.h"
 #import "WebDataSourceInternal.h"
 #import "WebDocumentLoaderMac.h"
+#import "WebDynamicScrollBarsView.h"
 #import "WebFrameLoaderClient.h"
 #import "WebFrameViewInternal.h"
 #import "WebHTMLView.h"
@@ -73,6 +74,7 @@
 #import <WebCore/LegacyWebArchive.h>
 #import <WebCore/Page.h>
 #import <WebCore/PluginData.h>
+#import <WebCore/PrintContext.h>
 #import <WebCore/RenderLayer.h>
 #import <WebCore/RenderPart.h>
 #import <WebCore/RenderView.h>
@@ -581,22 +583,16 @@
     if (!documentView)
         return pages;
 
-    float currPageHeight = printHeight;
-    float docHeight = root->layer()->height();
     float docWidth = root->layer()->width();
-    float printWidth = docWidth/printWidthScaleFactor;
-    
-    // We need to give the part the opportunity to adjust the page height at each step.
-    for (float i = 0; i < docHeight; i += currPageHeight) {
-        float proposedBottom = min(docHeight, i + printHeight);
-        view->adjustPageHeight(&proposedBottom, i, proposedBottom, i);
-        currPageHeight = max(1.0f, proposedBottom - i);
-        for (float j = 0; j < docWidth; j += printWidth) {
-            NSValue* val = [NSValue valueWithRect: NSMakeRect(j, i, printWidth, currPageHeight)];
-            [pages addObject: val];
-        }
-    }
-    
+    float printWidth = docWidth / printWidthScaleFactor;
+
+    PrintContext printContext(_private->coreFrame);
+    printContext.computePageRectsWithPageSize(FloatSize(printWidth, printHeight), true);
+
+    const Vector<IntRect>& pageRects = printContext.pageRects();
+    const size_t pageCount = pageRects.size();
+    for (size_t pageNumber = 0; pageNumber < pageCount; ++pageNumber)
+        [pages addObject: [NSValue valueWithRect: NSRect(pageRects[pageNumber])]];
     return pages;
 }
 
@@ -634,7 +630,7 @@
         return @"";
 
     JSLock lock(SilenceAssertionsOnly);
-    return String(result.toString(_private->coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()));
+    return ustringToString(result.toString(_private->coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()));
 }
 
 - (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity
@@ -965,7 +961,7 @@
 - (BOOL)_canProvideDocumentSource
 {
     Frame* frame = _private->coreFrame;
-    String mimeType = frame->loader()->responseMIMEType();
+    String mimeType = frame->loader()->writer()->mimeType();
     PluginData* pluginData = frame->page() ? frame->page()->pluginData() : 0;
 
     if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
@@ -990,7 +986,7 @@
     bool userChosen = !encoding.isNull();
     if (encoding.isNull())
         encoding = textEncodingName;
-    _private->coreFrame->loader()->setEncoding(encoding, userChosen);
+    _private->coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
     [self _addData:data];
 }
 
@@ -1267,7 +1263,7 @@
         return @"";
 
     JSLock lock(SilenceAssertionsOnly);
-    return String(result.toString(anyWorldGlobalObject->globalExec()));
+    return ustringToString(result.toString(anyWorldGlobalObject->globalExec()));
 }
 
 - (JSGlobalContextRef)_globalContextForScriptWorld:(WebScriptWorld *)world
@@ -1281,6 +1277,48 @@
     return toGlobalRef(coreFrame->script()->globalObject(coreWorld)->globalExec());
 }
 
+- (void)setAllowsScrollersToOverlapContent:(BOOL)flag
+{
+    ASSERT([[[self frameView] _scrollView] isKindOfClass:[WebDynamicScrollBarsView class]]);
+    [(WebDynamicScrollBarsView *)[[self frameView] _scrollView] setAllowsScrollersToOverlapContent:flag];
+}
+
+- (void)setAlwaysHideHorizontalScroller:(BOOL)flag
+{
+    ASSERT([[[self frameView] _scrollView] isKindOfClass:[WebDynamicScrollBarsView class]]);
+    [(WebDynamicScrollBarsView *)[[self frameView] _scrollView] setAlwaysHideHorizontalScroller:flag];
+}
+- (void)setAlwaysHideVerticalScroller:(BOOL)flag
+{
+    ASSERT([[[self frameView] _scrollView] isKindOfClass:[WebDynamicScrollBarsView class]]);
+    [(WebDynamicScrollBarsView *)[[self frameView] _scrollView] setAlwaysHideVerticalScroller:flag];
+}
+
+- (void)setAccessibleName:(NSString *)name
+{
+#if HAVE(ACCESSIBILITY)
+    if (!AXObjectCache::accessibilityEnabled())
+        return;
+    
+    RenderView* root = toRenderView(_private->coreFrame->document()->renderer());
+    if (!root)
+        return;
+    
+    AccessibilityObject* rootObject = _private->coreFrame->document()->axObjectCache()->getOrCreate(root);
+    String strName(name);
+    rootObject->setAccessibleName(strName);
+#endif
+}
+
+- (NSString*)_layerTreeAsText
+{
+    Frame* coreFrame = _private->coreFrame;
+    if (!coreFrame)
+        return @"";
+
+    return coreFrame->layerTreeAsText();
+}
+
 @end
 
 @implementation WebFrame
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 462686f..0bda966 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -120,4 +120,20 @@
 - (NSMutableDictionary *)_cacheabilityDictionary;
 
 - (BOOL)_allowsFollowingLink:(NSURL *)URL;
+
+// Sets whether the scrollbars, if any, should be shown inside the document's border 
+// (thus overlapping some content) or outside the webView's border (default behavior). 
+// Changing this flag changes the size of the contentView and maintains the size of the frameView.
+- (void)setAllowsScrollersToOverlapContent:(BOOL)flag;
+
+// Sets if the scrollbar is always hidden, regardless of other scrollbar visibility settings. 
+// This does not affect the scrollability of the document.
+- (void)setAlwaysHideHorizontalScroller:(BOOL)flag;
+- (void)setAlwaysHideVerticalScroller:(BOOL)flag;
+
+// Sets the name presented to accessibility clients for the web area object.
+- (void)setAccessibleName:(NSString *)name;
+
+- (NSString*)_layerTreeAsText;
+
 @end
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index 422b605..9ded8e1 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -532,7 +532,7 @@
 {
     if ([self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument])
         return YES;
-    if (![self _hasScrollBars])
+    if (![self _isScrollable])
         return NO;
     NSPoint point = [[[self _scrollView] documentView] frame].origin;
     return [[self _contentView] _scrollTo:&point animate:YES];
@@ -542,7 +542,7 @@
 {
     if ([self _scrollOverflowInDirection:ScrollDown granularity:ScrollByDocument])
         return YES;
-    if (![self _hasScrollBars])
+    if (![self _isScrollable])
         return NO;
     NSRect frame = [[[self _scrollView] documentView] frame];
     NSPoint point = NSMakePoint(frame.origin.x, NSMaxY(frame));
@@ -554,7 +554,7 @@
     if ([self _scrollToBeginningOfDocument])
         return;
     
-    if (WebFrameView *child = [self _largestChildWithScrollBars]) {
+    if (WebFrameView *child = [self _largestScrollableChild]) {
         if ([child _scrollToBeginningOfDocument])
             return;
     }
@@ -566,7 +566,7 @@
     if ([self _scrollToEndOfDocument])
         return;
 
-    if (WebFrameView *child = [self _largestChildWithScrollBars]) {
+    if (WebFrameView *child = [self _largestScrollableChild]) {
         if ([child _scrollToEndOfDocument])
             return;
     }
@@ -619,8 +619,8 @@
     if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByPage])
         return YES;
     
-    if (![self _hasScrollBars])
-        return [[self _largestChildWithScrollBars] _pageVertically:up];
+    if (![self _isScrollable])
+        return [[self _largestScrollableChild] _pageVertically:up];
 
     float delta = [self _verticalPageScrollDistance];
     return [self _scrollVerticallyBy:up ? -delta : delta];
@@ -631,8 +631,8 @@
     if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByPage])
         return YES;
 
-    if (![self _hasScrollBars])
-        return [[self _largestChildWithScrollBars] _pageHorizontally:left];
+    if (![self _isScrollable])
+        return [[self _largestScrollableChild] _pageHorizontally:left];
     
     float delta = [self _horizontalPageScrollDistance];
     return [self _scrollHorizontallyBy:left ? -delta : delta];
@@ -643,8 +643,8 @@
     if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByLine])
         return YES;
 
-    if (![self _hasScrollBars])
-        return [[self _largestChildWithScrollBars] _scrollLineVertically:up];
+    if (![self _isScrollable])
+        return [[self _largestScrollableChild] _scrollLineVertically:up];
     
     float delta = [self _verticalKeyboardScrollDistance];
     return [self _scrollVerticallyBy:up ? -delta : delta];
@@ -655,8 +655,8 @@
     if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByLine])
         return YES;
 
-    if (![self _hasScrollBars])
-        return [[self _largestChildWithScrollBars] _scrollLineHorizontally:left];
+    if (![self _isScrollable])
+        return [[self _largestScrollableChild] _scrollLineHorizontally:left];
 
     float delta = [self _horizontalKeyboardScrollDistance];
     return [self _scrollHorizontallyBy:left ? -delta : delta];
@@ -730,7 +730,7 @@
                 // Checking for a control will allow events to percolate 
                 // correctly when the focus is on a form control and we
                 // are in full keyboard access mode.
-                if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) || [self _firstResponderIsFormControl]) {
+                if ((![self allowsScrolling] && ![self _largestScrollableChild]) || [self _firstResponderIsFormControl]) {
                     callSuper = YES;
                     break;
                 }
@@ -742,7 +742,7 @@
                 callSuper = NO;
                 break;
             case NSPageUpFunctionKey:
-                if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) {
+                if (![self allowsScrolling] && ![self _largestScrollableChild]) {
                     callSuper = YES;
                     break;
                 }
@@ -750,7 +750,7 @@
                 callSuper = NO;
                 break;
             case NSPageDownFunctionKey:
-                if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) {
+                if (![self allowsScrolling] && ![self _largestScrollableChild]) {
                     callSuper = YES;
                     break;
                 }
@@ -758,7 +758,7 @@
                 callSuper = NO;
                 break;
             case NSHomeFunctionKey:
-                if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) {
+                if (![self allowsScrolling] && ![self _largestScrollableChild]) {
                     callSuper = YES;
                     break;
                 }
@@ -766,7 +766,7 @@
                 callSuper = NO;
                 break;
             case NSEndFunctionKey:
-                if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) {
+                if (![self allowsScrolling] && ![self _largestScrollableChild]) {
                     callSuper = YES;
                     break;
                 }
@@ -779,7 +779,7 @@
                     callSuper = YES;
                     break;
                 }
-                if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) ||
+                if ((![self allowsScrolling] && ![self _largestScrollableChild]) ||
                     [[[self window] firstResponder] isKindOfClass:[NSPopUpButton class]]) {
                     // Let arrow keys go through to pop up buttons
                     // <rdar://problem/3455910>: hitting up or down arrows when focus is on a 
@@ -802,7 +802,7 @@
                     callSuper = YES;
                     break;
                 }
-                if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) ||
+                if ((![self allowsScrolling] && ![self _largestScrollableChild]) ||
                     [[[self window] firstResponder] isKindOfClass:[NSPopUpButton class]]) {
                     // Let arrow keys go through to pop up buttons
                     // <rdar://problem/3455910>: hitting up or down arrows when focus is on a 
@@ -834,7 +834,7 @@
                     [self _goBack];
                 } else {
                     // Now check scrolling related keys.
-                    if ((![self allowsScrolling] && ![self _largestChildWithScrollBars])) {
+                    if ((![self allowsScrolling] && ![self _largestScrollableChild])) {
                         callSuper = YES;
                         break;
                     }
@@ -862,7 +862,7 @@
                     [self _goForward];
                 } else {
                     // Now check scrolling related keys.
-                    if ((![self allowsScrolling] && ![self _largestChildWithScrollBars])) {
+                    if ((![self allowsScrolling] && ![self _largestScrollableChild])) {
                         callSuper = YES;
                         break;
                     }
@@ -939,14 +939,52 @@
     return frame.size.height * frame.size.width;
 }
 
+- (BOOL)_isScrollable
+{
+    WebDynamicScrollBarsView *scrollView = [self _scrollView];
+    return [scrollView horizontalScrollingAllowed] || [scrollView verticalScrollingAllowed];
+}
+
+- (WebFrameView *)_largestScrollableChild
+{
+    WebFrameView *largest = nil;
+    NSArray *frameChildren = [[self webFrame] childFrames];
+    
+    unsigned i;
+    for (i=0; i < [frameChildren count]; i++) {
+        WebFrameView *childFrameView = [[frameChildren objectAtIndex:i] frameView];
+        WebFrameView *scrollableFrameView = [childFrameView _isScrollable] ? childFrameView : [childFrameView _largestScrollableChild];
+        if (!scrollableFrameView)
+            continue;
+        
+        // Some ads lurk in child frames of zero width and height, see radar 4406994. These don't count as scrollable.
+        // Maybe someday we'll discover that this minimum area check should be larger, but this covers the known cases.
+        float area = [scrollableFrameView _area];
+        if (area < 1.0)
+            continue;
+        
+        if (!largest || (area > [largest _area])) {
+            largest = scrollableFrameView;
+        }
+    }
+    
+    return largest;
+}
+
 - (BOOL)_hasScrollBars
 {
+    // FIXME: This method was used by Safari 4.0.x and older versions, but has not been used by any other WebKit
+    // clients to my knowledge, and will not be used by future versions of Safari. It can probably be removed 
+    // once we no longer need to keep nightly WebKit builds working with Safari 4.0.x and earlier.
     NSScrollView *scrollView = [self _scrollView];
     return [scrollView hasHorizontalScroller] || [scrollView hasVerticalScroller];
 }
 
 - (WebFrameView *)_largestChildWithScrollBars
 {
+    // FIXME: This method was used by Safari 4.0.x and older versions, but has not been used by any other WebKit
+    // clients to my knowledge, and will not be used by future versions of Safari. It can probably be removed 
+    // once we no longer need to keep nightly WebKit builds working with Safari 4.0.x and earlier.
     WebFrameView *largest = nil;
     NSArray *frameChildren = [[self webFrame] childFrames];
     
diff --git a/WebKit/mac/WebView/WebFrameViewPrivate.h b/WebKit/mac/WebView/WebFrameViewPrivate.h
index 47c053e..93d36ec 100644
--- a/WebKit/mac/WebView/WebFrameViewPrivate.h
+++ b/WebKit/mac/WebView/WebFrameViewPrivate.h
@@ -30,13 +30,19 @@
 
 @interface WebFrameView (WebPrivate)
 
+// FIXME: This method was used by Safari 4.0.x and older versions, but has not been used by any other WebKit
+// clients to my knowledge, and will not be used by future versions of Safari. It can probably be removed 
+// once we no longer need to keep nightly WebKit builds working with Safari 4.0.x and earlier.
 /*!
     @method _largestChildWithScrollBars
     @abstract Of the child WebFrameViews that are displaying scroll bars, determines which has the largest area.
     @result A child WebFrameView that is displaying scroll bars, or nil if none.
-*/
+ */
 - (WebFrameView *)_largestChildWithScrollBars;
 
+// FIXME: This method was used by Safari 4.0.x and older versions, but has not been used by any other WebKit
+// clients to my knowledge, and will not be used by future versions of Safari. It can probably be removed 
+// once we no longer need to keep nightly WebKit builds working with Safari 4.0.x and earlier.
 /*!
     @method _hasScrollBars
     @result YES if at least one scroll bar is currently displayed
@@ -44,6 +50,21 @@
 - (BOOL)_hasScrollBars;
 
 /*!
+    @method _largestScrollableChild
+    @abstract Of the child WebFrameViews that allow scrolling, determines which has the largest area.
+    @result A child WebFrameView that is scrollable, or nil if none.
+ */
+- (WebFrameView *)_largestScrollableChild;
+
+/*!
+    @method _isScrollable
+    @result YES if scrolling is currently possible, whether or not scroll bars are currently showing. This
+    differs from -allowsScrolling in that the latter method only checks whether scrolling has been
+    explicitly disallowed via a call to setAllowsScrolling:NO.
+ */
+- (BOOL)_isScrollable;
+
+/*!
     @method _contentView
     @result The content view (NSClipView) of the WebFrameView's scroll view.
  */
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 3aaa914..2684004 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -302,7 +302,8 @@
 {
     HTMLInputElement* inputElement = inputElementFromDOMElement(element);
     return inputElement
-        && inputElement->inputType() == HTMLInputElement::TEXT
+        && inputElement->isTextField()
+        && inputElement->inputType() != HTMLInputElement::PASSWORD
         && inputElement->autoComplete();
 }
 
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index aa65920..daeeb10 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -148,26 +148,52 @@
 - (BOOL)receivedUnhandledCommand;
 @end
 
-static IMP oldSetCursorIMP = NULL;
+// if YES, do the standard NSView hit test (which can't give the right result when HTML overlaps a view)
+static BOOL forceNSViewHitTest;
 
-#ifdef BUILDING_ON_TIGER
+// if YES, do the "top WebHTMLView" hit test (which we'd like to do all the time but can't because of Java requirements [see bug 4349721])
+static BOOL forceWebHTMLViewHitTest;
 
-static IMP oldResetCursorRectsIMP = NULL;
+static WebHTMLView *lastHitView;
+
+static bool needsCursorRectsSupportAtPoint(NSWindow* window, NSPoint point)
+{
+    forceNSViewHitTest = YES;
+    NSView* view = [[window _web_borderView] hitTest:point];
+    forceNSViewHitTest = NO;
+
+    // WebHTMLView doesn't use cursor rects.
+    if ([view isKindOfClass:[WebHTMLView class]])
+        return false;
+
+    // Neither do NPAPI plug-ins.
+    if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
+        return false;
+
+    // Non-Web content, WebPDFView, and WebKit plug-ins use normal cursor handling.
+    return true;
+}
+
+#ifndef BUILDING_ON_TIGER
+
+static IMP oldSetCursorForMouseLocationIMP;
+
+// Overriding an internal method is a hack; <rdar://problem/7662987> tracks finding a better solution.
+static void setCursor(NSWindow* self, SEL cmd, NSPoint point)
+{
+    if (needsCursorRectsSupportAtPoint(self, point))
+        oldSetCursorForMouseLocationIMP(self, cmd, point);
+}
+
+#else
+
+static IMP oldResetCursorRectsIMP;
+static IMP oldSetCursorIMP;
 static BOOL canSetCursor = YES;
 
 static void resetCursorRects(NSWindow* self, SEL cmd)
 {
-    NSPoint point = [self mouseLocationOutsideOfEventStream];
-    NSView* view = [[self _web_borderView] hitTest:point];
-    if ([view isKindOfClass:[WebHTMLView class]]) {
-        WebHTMLView *htmlView = (WebHTMLView*)view;
-        NSPoint localPoint = [htmlView convertPoint:point fromView:nil];
-        NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO];
-        DOMElement *element = [dict objectForKey:WebElementDOMNodeKey];
-        if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] &&
-            ![element isKindOfClass:[DOMHTMLEmbedElement class]])
-            canSetCursor = NO;
-    }
+    canSetCursor = needsCursorRectsSupportAtPoint(self, [self mouseLocationOutsideOfEventStream]);
     oldResetCursorRectsIMP(self, cmd);
     canSetCursor = YES;
 }
@@ -178,23 +204,6 @@
         oldSetCursorIMP(self, cmd);
 }
 
-#else
-
-static void setCursor(NSWindow* self, SEL cmd, NSPoint point)
-{
-    NSView* view = [[self _web_borderView] hitTest:point];
-    if ([view isKindOfClass:[WebHTMLView class]]) {
-        WebHTMLView *htmlView = (WebHTMLView*)view;
-        NSPoint localPoint = [htmlView convertPoint:point fromView:nil];
-        NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO];
-        DOMElement *element = [dict objectForKey:WebElementDOMNodeKey];
-        if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] &&
-            ![element isKindOfClass:[DOMHTMLEmbedElement class]])
-            return;
-    }
-    oldSetCursorIMP(self, cmd, point);
-}
-
 #endif
 
 extern "C" {
@@ -241,13 +250,13 @@
 // print in IE and Camino. This lets them use fewer sheets than they
 // would otherwise, which is presumably why other browsers do this.
 // Wide pages will be scaled down more than this.
-#define PrintingMinimumShrinkFactor     1.25f
+const float _WebHTMLViewPrintingMinimumShrinkFactor = 1.25;
 
 // This number determines how small we are willing to reduce the page content
 // in order to accommodate the widest line. If the page would have to be
 // reduced smaller to make the widest line fit, we just clip instead (this
 // behavior matches MacIE and Mozilla, at least)
-#define PrintingMaximumShrinkFactor     2.0f
+const float _WebHTMLViewPrintingMaximumShrinkFactor = 2;
 
 // This number determines how short the last printed page of a multi-page print session
 // can be before we try to shrink the scale in order to reduce the number of pages, and
@@ -294,14 +303,6 @@
 @implementation WebCoreScrollView
 @end
 
-// if YES, do the standard NSView hit test (which can't give the right result when HTML overlaps a view)
-static BOOL forceNSViewHitTest;
-
-// if YES, do the "top WebHTMLView" hit test (which we'd like to do all the time but can't because of Java requirements [see bug 4349721])
-static BOOL forceWebHTMLViewHitTest;
-
-static WebHTMLView *lastHitView;
-
 // We need this to be able to safely reference the CachedImage for the promised drag data
 static CachedResourceClient* promisedDataClient()
 {
@@ -321,7 +322,6 @@
 - (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
 - (BOOL)_shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
 - (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action;
-- (float)_calculatePrintHeight;
 - (DOMRange *)_selectedRange;
 - (BOOL)_shouldDeleteRange:(DOMRange *)range;
 - (NSView *)_hitViewForEvent:(NSEvent *)event;
@@ -428,6 +428,9 @@
     BOOL exposeInputContext;
 
     NSPoint lastScrollPosition;
+#ifndef BUILDING_ON_TIGER
+    BOOL inScrollPositionChanged;
+#endif
 
     WebPluginController *pluginController;
     
@@ -490,20 +493,21 @@
 #ifndef BUILDING_ON_TIGER
     WebCoreObjCFinalizeOnMainThread(self);
 #endif
-
-    if (!oldSetCursorIMP) {
-#ifdef BUILDING_ON_TIGER
-        Method setCursorMethod = class_getInstanceMethod([NSCursor class], @selector(set));
-#else
+    
+#ifndef BUILDING_ON_TIGER
+    if (!oldSetCursorForMouseLocationIMP) {
         Method setCursorMethod = class_getInstanceMethod([NSWindow class], @selector(_setCursorForMouseLocation:));
-#endif
         ASSERT(setCursorMethod);
-
+        oldSetCursorForMouseLocationIMP = method_setImplementation(setCursorMethod, (IMP)setCursor);
+        ASSERT(oldSetCursorForMouseLocationIMP);
+    }
+#else
+    if (!oldSetCursorIMP) {
+        Method setCursorMethod = class_getInstanceMethod([NSCursor class], @selector(set));
+        ASSERT(setCursorMethod);
         oldSetCursorIMP = method_setImplementation(setCursorMethod, (IMP)setCursor);
         ASSERT(oldSetCursorIMP);
     }
-    
-#ifdef BUILDING_ON_TIGER
     if (!oldResetCursorRectsIMP) {
         Method resetCursorRectsMethod = class_getInstanceMethod([NSWindow class], @selector(resetCursorRects));
         ASSERT(resetCursorRectsMethod);
@@ -896,17 +900,6 @@
     return [self _shouldInsertText:text replacingDOMRange:[self _selectedRange] givenAction:action];
 }
 
-// Calculate the vertical size of the view that fits on a single page
-- (float)_calculatePrintHeight
-{
-    // Obtain the print info object for the current operation
-    NSPrintInfo *pi = [[NSPrintOperation currentOperation] printInfo];
-    
-    // Calculate the page height in points
-    NSSize paperSize = [pi paperSize];
-    return paperSize.height - [pi topMargin] - [pi bottomMargin];
-}
-
 - (DOMRange *)_selectedRange
 {
     Frame* coreFrame = core([self _frame]);
@@ -1169,8 +1162,15 @@
     NSPoint origin = [[self superview] bounds].origin;
     if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
         if (Frame* coreFrame = core([self _frame])) {
-            if (FrameView* coreView = coreFrame->view())
+            if (FrameView* coreView = coreFrame->view()) {
+#ifndef BUILDING_ON_TIGER
+                _private->inScrollPositionChanged = YES;
+#endif
                 coreView->scrollPositionChanged();
+#ifndef BUILDING_ON_TIGER
+                _private->inScrollPositionChanged = NO;
+#endif
+            }
         }
     
         [_private->completionController endRevertingChange:NO moveLeft:NO];
@@ -1290,11 +1290,15 @@
     // There are known cases where -viewWillDraw is not called on all views being drawn.
     // See <rdar://problem/6964278> for example. Performing layout at this point prevents us from
     // trying to paint without layout (which WebCore now refuses to do, instead bailing out without
-    // drawing at all), but we may still fail to update and regions dirtied by the layout which are
+    // drawing at all), but we may still fail to update any regions dirtied by the layout which are
     // not already dirty. 
     if ([self _needsLayout]) {
-        LOG_ERROR("View needs layout. Either -viewWillDraw wasn't called or layout was invalidated during the display operation. Performing layout now.");
-        [self _web_layoutIfNeededRecursive];
+        NSInteger rectCount;
+        [self getRectsBeingDrawn:0 count:&rectCount];
+        if (rectCount) {
+            LOG_ERROR("View needs layout. Either -viewWillDraw wasn't called or layout was invalidated during the display operation. Performing layout now.");
+            [self _web_layoutIfNeededRecursive];
+        }
     }
 #else
     // Because Tiger does not have viewWillDraw we need to do layout here.
@@ -1421,6 +1425,7 @@
     else if (forceWebHTMLViewHitTest)
         captureHitsOnSubviews = YES;
     else {
+        // FIXME: Why doesn't this include mouse entered/exited events, or other mouse button events?
         NSEvent *event = [[self window] currentEvent];
         captureHitsOnSubviews = !([event type] == NSMouseMoved
             || [event type] == NSRightMouseDown
@@ -2185,6 +2190,59 @@
 #endif
 }
 
+- (BOOL)_isInPrintMode
+{
+    return _private->printing;
+}
+
+- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth shrinkToFit:(BOOL)shrinkToFit
+{
+    Frame* frame = core([self _frame]);
+    if (!frame)
+        return NO;
+
+    float minLayoutWidth = 0;
+    float maxLayoutWidth = 0;
+
+    // If we are a frameset just print with the layout we have onscreen, otherwise relayout
+    // according to the page width.
+    if (!frame->document() || !frame->document()->isFrameSet()) {
+        minLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMinimumShrinkFactor : pageWidth;
+        maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth;
+    }
+    [self _setPrinting:YES minimumPageWidth:minLayoutWidth maximumPageWidth:maxLayoutWidth adjustViewSize:YES];
+
+    return YES;
+}
+
+- (void)_endPrintMode
+{
+    [self _setPrinting:NO minimumPageWidth:0 maximumPageWidth:0 adjustViewSize:YES];
+}
+
+- (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit
+{
+    Frame* frame = core([self _frame]);
+    if (!frame)
+        return bottom;
+
+    FrameView* view = frame->view();
+    if (!view)
+        return bottom;
+
+    float newBottom;
+    view->adjustPageHeight(&newBottom, top, bottom, bottomLimit);
+
+#ifdef __LP64__
+    // If the new bottom is equal to the old bottom (when both are treated as floats), we just return the original
+    // bottom. This prevents rounding errors that can occur when converting newBottom to a double.
+    if (fabs(static_cast<float>(bottom) - newBottom) <= numeric_limits<float>::epsilon()) 
+        return bottom;
+    else
+#endif
+        return newBottom;
+}
+
 @end
 
 @implementation NSView (WebHTMLViewFileInternal)
@@ -2522,7 +2580,13 @@
 - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
 {
     BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]);
-    BOOL isReturnTypeOK = !returnType || ([[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]);
+    BOOL isReturnTypeOK = NO;
+    if (!returnType)
+        isReturnTypeOK = YES;
+    else if ([[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]) {
+        // We can insert strings in any editable context.  We can insert other types, like images, only in rich edit contexts.
+        isReturnTypeOK = [returnType isEqualToString:NSStringPboardType] || [self _canEditRichly];
+    }
     if (isSendTypeOK && isReturnTypeOK)
         return self;
     return [[self nextResponder] validRequestorForSendType:sendType returnType:returnType];
@@ -3130,11 +3194,29 @@
     return [[self _webView] drawsBackground];
 }
 
+#if !LOG_DISABLED
 - (void)setNeedsDisplay:(BOOL)flag
 {
     LOG(View, "%@ setNeedsDisplay:%@", self, flag ? @"YES" : @"NO");
     [super setNeedsDisplay:flag];
 }
+#endif
+
+#ifndef BUILDING_ON_TIGER
+- (void)setNeedsDisplayInRect:(NSRect)invalidRect
+{
+    if (_private->inScrollPositionChanged) {
+        // When scrolling, the dirty regions are adjusted for the scroll only
+        // after NSViewBoundsDidChangeNotification is sent. Translate the invalid
+        // rect to pre-scrolled coordinates in order to get the right dirty region
+        // after adjustment. See <rdar://problem/7678927>.
+        NSPoint origin = [[self superview] bounds].origin;
+        invalidRect.origin.x -= _private->lastScrollPosition.x - origin.x;
+        invalidRect.origin.y -= _private->lastScrollPosition.y - origin.y;
+    }
+    [super setNeedsDisplayInRect:invalidRect];
+}
+#endif
 
 - (void)setNeedsLayout: (BOOL)flag
 {
@@ -3720,7 +3802,7 @@
         }
     }
 
-    if (printing != _private->printing) {
+    if (printing || _private->printing) {
         [_private->pageRects release];
         _private->pageRects = nil;
         _private->printing = printing;
@@ -3751,21 +3833,8 @@
     if (!wasInPrintingMode)
         [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
 
-    float newBottomFloat = *newBottom;
-    if (Frame* frame = core([self _frame])) {
-        if (FrameView* view = frame->view())
-            view->adjustPageHeight(&newBottomFloat, oldTop, oldBottom, bottomLimit);
-    }
+    *newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit];
 
-#ifdef __LP64__
-    // If the new bottom is equal to the old bottom (when both are treated as floats), we just copy
-    // oldBottom over to newBottom. This prevents rounding errors that can occur when converting newBottomFloat to a double.
-    if (fabs((float)oldBottom - newBottomFloat) <= numeric_limits<float>::epsilon()) 
-        *newBottom = oldBottom;
-    else
-#endif
-        *newBottom = newBottomFloat;
-    
     if (!wasInPrintingMode) {
         NSPrintOperation *currenPrintOperation = [NSPrintOperation currentOperation];
         if (currenPrintOperation)
@@ -3777,12 +3846,6 @@
     }
 }
 
-- (float)_availablePaperWidthForPrintOperation:(NSPrintOperation *)printOperation
-{
-    NSPrintInfo *printInfo = [printOperation printInfo];
-    return [printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin];
-}
-
 - (float)_scaleFactorForPrintOperation:(NSPrintOperation *)printOperation
 {
     float viewWidth = NSWidth([self bounds]);
@@ -3792,8 +3855,8 @@
     }
 
     float userScaleFactor = [printOperation _web_pageSetupScaleFactor];
-    float maxShrinkToFitScaleFactor = 1.0f / PrintingMaximumShrinkFactor;
-    float shrinkToFitScaleFactor = [self _availablePaperWidthForPrintOperation:printOperation]/viewWidth;
+    float maxShrinkToFitScaleFactor = 1.0f / _WebHTMLViewPrintingMaximumShrinkFactor;
+    float shrinkToFitScaleFactor = [printOperation _web_availablePaperWidth] / viewWidth;
     float shrinkToAvoidOrphan = _private->avoidingPrintOrphan ? (1.0f / PrintingOrphanShrinkAdjustment) : 1.0f;
     return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor) * shrinkToAvoidOrphan;
 }
@@ -3813,9 +3876,9 @@
     [self _setPrinting:YES minimumPageWidth:pageWidth maximumPageWidth:pageWidth adjustViewSize:YES];
 }
 
-- (void)_endPrintMode
+- (void)_endPrintModeAndRestoreWindowAutodisplay
 {
-    [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES];
+    [self _endPrintMode];
     [[self window] setAutodisplay:YES];
 }
 
@@ -3841,7 +3904,7 @@
         // cancelled, beginDocument and endDocument must not have been called, and we need to clean up
         // the print mode here.
         ASSERT(currentOperation == nil);
-        [self _endPrintMode];
+        [self _endPrintModeAndRestoreWindowAutodisplay];
     }
 }
 
@@ -3851,22 +3914,12 @@
     // Must do this explicit display here, because otherwise the view might redisplay while the print
     // sheet was up, using printer fonts (and looking different).
     [self displayIfNeeded];
-    [[self window] setAutodisplay:NO];
-    
-    // If we are a frameset just print with the layout we have onscreen, otherwise relayout
-    // according to the paper size
-    float minLayoutWidth = 0.0f;
-    float maxLayoutWidth = 0.0f;
-    Frame* frame = core([self _frame]);
-    if (!frame)
-        return NO;
-    if (!frame->document() || !frame->document()->isFrameSet()) {
-        float paperWidth = [self _availablePaperWidthForPrintOperation:[NSPrintOperation currentOperation]];
-        minLayoutWidth = paperWidth * PrintingMinimumShrinkFactor;
-        maxLayoutWidth = paperWidth * PrintingMaximumShrinkFactor;
-    }
-    [self _setPrinting:YES minimumPageWidth:minLayoutWidth maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; // will relayout
+    [[self window] setAutodisplay:NO];    
+
     NSPrintOperation *printOperation = [NSPrintOperation currentOperation];
+    if (![self _beginPrintModeWithPageWidth:[printOperation _web_availablePaperWidth] shrinkToFit:YES])
+        return NO;
+
     // Certain types of errors, including invalid page ranges, can cause beginDocument and
     // endDocument to be skipped after we've put ourselves in print mode (see 4145905). In those cases
     // we need to get out of print mode without relying on any more callbacks from the printing mechanism.
@@ -3884,9 +3937,9 @@
     float totalScaleFactor = [self _scaleFactorForPrintOperation:printOperation];
     float userScaleFactor = [printOperation _web_pageSetupScaleFactor];
     [_private->pageRects release];
-    float fullPageHeight = floorf([self _calculatePrintHeight]/totalScaleFactor);
-    NSArray *newPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor
-                                                                          printHeight:fullPageHeight];
+    float fullPageHeight = floorf([printOperation _web_availablePaperHeight] / totalScaleFactor);
+    WebFrame *frame = [self _frame];
+    NSArray *newPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight];
     
     // AppKit gets all messed up if you give it a zero-length page count (see 3576334), so if we
     // hit that case we'll pass along a degenerate 1 pixel square to print. This will print
@@ -3899,8 +3952,7 @@
         // content onto one fewer page. If it does, use the adjusted scale. If not, use the original scale.
         float lastPageHeight = NSHeight([[newPageRects lastObject] rectValue]);
         if (lastPageHeight/fullPageHeight < LastPrintedPageOrphanRatio) {
-            NSArray *adjustedPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor
-                                                                                       printHeight:fullPageHeight*PrintingOrphanShrinkAdjustment];
+            NSArray *adjustedPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight * PrintingOrphanShrinkAdjustment];
             // Use the adjusted rects only if the page count went down
             if ([adjustedPageRects count] < [newPageRects count]) {
                 newPageRects = adjustedPageRects;
@@ -3940,7 +3992,7 @@
     } @catch (NSException *localException) {
         // Exception during [super beginDocument] means that endDocument will not get called,
         // so we need to clean up our "print mode" here.
-        [self _endPrintMode];
+        [self _endPrintModeAndRestoreWindowAutodisplay];
     }
 }
 
@@ -3948,7 +4000,7 @@
 {
     [super endDocument];
     // Note sadly at this point [NSGraphicsContext currentContextDrawingToScreen] is still NO 
-    [self _endPrintMode];
+    [self _endPrintModeAndRestoreWindowAutodisplay];
 }
 
 - (void)keyDown:(NSEvent *)event
@@ -4986,22 +5038,21 @@
 {
     // FIXME: NSTextView bails out if becoming or resigning first responder, for which it has ivar flags. Not
     // sure if we need to do something similar.
-    
+
     if (![self _canEdit])
         return;
-    
+
     NSWindow *window = [self window];
     // FIXME: is this first-responder check correct? What happens if a subframe is editable and is first responder?
-    if ([NSApp keyWindow] != window || [window firstResponder] != self)
+    if (![window isKeyWindow] || [window firstResponder] != self)
         return;
-    
+
     bool multipleFonts = false;
     NSFont *font = nil;
     if (Frame* coreFrame = core([self _frame])) {
         if (const SimpleFontData* fd = coreFrame->editor()->fontForSelection(multipleFonts))
             font = fd->getNSFont();
     }
-    
 
     // FIXME: for now, return a bogus font that distinguishes the empty selection from the non-empty
     // selection. We should be able to remove this once the rest of this code works properly.
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index cb121d8..3beb0d6 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -32,6 +32,12 @@
 #define ENABLE_NETSCAPE_PLUGIN_API 1
 #endif
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+#define WebCGFloat float
+#else
+#define WebCGFloat CGFloat
+#endif
+
 @class DOMDocumentFragment;
 @class DOMNode;
 @class DOMRange;
@@ -46,6 +52,9 @@
 - (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line;
 @end
 
+extern const float _WebHTMLViewPrintingMinimumShrinkFactor;
+extern const float _WebHTMLViewPrintingMaximumShrinkFactor;
+
 @interface WebHTMLView (WebPrivate)
 
 + (NSArray *)supportedMIMETypes;
@@ -124,7 +133,13 @@
 // directly, this method must be called before paginating, or the computed height might be incorrect.
 // Typically this would be called from inside an override of -[NSView knowsPageRange:].
 - (void)_layoutForPrinting;
+- (WebCGFloat)_adjustedBottomOfPageWithTop:(WebCGFloat)top bottom:(WebCGFloat)bottom limit:(WebCGFloat)bottomLimit;
+- (BOOL)_isInPrintMode;
+- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth shrinkToFit:(BOOL)shrinkToFit;
+- (void)_endPrintMode;
 
 - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard;
 
 @end
+
+#undef WebCGFloat
diff --git a/WebKit/mac/WebView/WebPDFView.h b/WebKit/mac/WebView/WebPDFView.h
index bdd2a6e..e480a1b 100644
--- a/WebKit/mac/WebView/WebPDFView.h
+++ b/WebKit/mac/WebView/WebPDFView.h
@@ -32,7 +32,7 @@
 @class PDFView;
 @class WebDataSource;
 
-@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, _WebDocumentViewState, _WebDocumentZooming>
+@interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, WebDocumentPDF, _WebDocumentViewState, _WebDocumentZooming>
 {
     NSView *previewView;
     PDFView *PDFSubview;
@@ -51,5 +51,6 @@
 + (NSBundle *)PDFKitBundle;
 
 - (void)setPDFDocument:(PDFDocument *)doc;
+- (PDFDocument *)PDFDocument;
 
 @end
diff --git a/WebKit/mac/WebView/WebPDFView.mm b/WebKit/mac/WebView/WebPDFView.mm
index a38412e..1be3033 100644
--- a/WebKit/mac/WebView/WebPDFView.mm
+++ b/WebKit/mac/WebView/WebPDFView.mm
@@ -182,6 +182,11 @@
     _ignoreScaleAndDisplayModeAndPageNotifications = NO;
 }
 
+- (PDFDocument *)PDFDocument
+{
+    return [PDFSubview document];
+}
+
 #pragma mark NSObject OVERRIDES
 
 - (void)dealloc
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index 150a020..e74d0e5 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -91,7 +91,7 @@
 #define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
 #define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
 #define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
-#define WebKitFrameSetFlatteningEnabledPreferenceKey @"WebKitFrameSetFlatteningEnabled"
+#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index bd3c2a7..84a6e9e 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -357,7 +357,7 @@
         [NSNumber numberWithBool:NO],   WebKitWebGLEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitUsesProxiedOpenPanelPreferenceKey,
         [NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitFrameSetFlatteningEnabledPreferenceKey,
+        [NSNumber numberWithBool:NO],   WebKitFrameFlatteningEnabledPreferenceKey,
         nil];
 
     // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
@@ -1216,14 +1216,14 @@
     return [self _setIntegerValue:allowedRunTime forKey:WebKitPluginAllowedRunTimePreferenceKey];
 }
 
-- (BOOL)isFrameSetFlatteningEnabled
+- (BOOL)isFrameFlatteningEnabled
 {
-    return [self _boolValueForKey:WebKitFrameSetFlatteningEnabledPreferenceKey];
+    return [self _boolValueForKey:WebKitFrameFlatteningEnabledPreferenceKey];
 }
 
-- (void)setFrameSetFlatteningEnabled:(BOOL)flag
+- (void)setFrameFlatteningEnabled:(BOOL)flag
 {
-    [self _setBoolValue:flag forKey:WebKitFrameSetFlatteningEnabledPreferenceKey];
+    [self _setBoolValue:flag forKey:WebKitFrameFlatteningEnabledPreferenceKey];
 }
 
 - (void)didRemoveFromWebView
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index b516640..0b5f969 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -116,8 +116,8 @@
 - (unsigned)pluginAllowedRunTime;
 - (void)setPluginAllowedRunTime:(unsigned)allowedRunTime;
 
-- (BOOL)isFrameSetFlatteningEnabled;
-- (void)setFrameSetFlatteningEnabled:(BOOL)flag;
+- (BOOL)isFrameFlatteningEnabled;
+- (void)setFrameFlatteningEnabled:(BOOL)flag;
 
 // zero means do AutoScale
 - (float)PDFScaleFactor;
diff --git a/WebKit/mac/WebView/WebRenderNode.mm b/WebKit/mac/WebView/WebRenderNode.mm
index 4a839a5..eff1929 100644
--- a/WebKit/mac/WebView/WebRenderNode.mm
+++ b/WebKit/mac/WebView/WebRenderNode.mm
@@ -118,8 +118,15 @@
         IntRect box = text->linesBoundingBox();
         width = box.width();
         height = box.height();
+    } else if (node->isRenderInline()) {
+        RenderBoxModelObject* inlineFlow = toRenderBoxModelObject(node);
+        IntRect boundingBox = inlineFlow->borderBoundingBox();
+        x = boundingBox.x();
+        y = boundingBox.y();
+        width = boundingBox.width();
+        height = boundingBox.height();
     }
-    
+
     WebRenderNode *result = [[WebRenderNode alloc] _initWithName:name
                                                         position:absPos rect:NSMakeRect(x, y, width, height)
                                                        coreFrame:frame children:children];
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
index 8489c9b..9ffd36e 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegate.mm
+++ b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
@@ -242,14 +242,14 @@
         DynamicGlobalObjectScope globalObjectScope(globalObject->globalExec(), globalObject);
 
         JSValue exception;
-        JSValue result = evaluateInGlobalCallFrame(String(script), exception, globalObject);
+        JSValue result = evaluateInGlobalCallFrame(stringToUString(script), exception, globalObject);
         if (exception)
             return [self _convertValueToObjcValue:exception];
         return result ? [self _convertValueToObjcValue:result] : nil;        
     }
 
     JSValue exception;
-    JSValue result = _private->debuggerCallFrame->evaluate(String(script), exception);
+    JSValue result = _private->debuggerCallFrame->evaluate(stringToUString(script), exception);
     if (exception)
         return [self _convertValueToObjcValue:exception];
     return result ? [self _convertValueToObjcValue:result] : nil;
diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm
index a71d78b..c5e0ac8 100644
--- a/WebKit/mac/WebView/WebScriptDebugger.mm
+++ b/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -69,7 +69,7 @@
 {
     if (s.isEmpty())
         return nil;
-    return KURL(ParsedURLString, s);
+    return KURL(ParsedURLString, ustringToString(s));
 }
 
 static WebFrame *toWebFrame(JSGlobalObject* globalObject)
diff --git a/WebKit/mac/WebView/WebScriptWorld.h b/WebKit/mac/WebView/WebScriptWorld.h
index 7059b76..9a05f7f 100644
--- a/WebKit/mac/WebView/WebScriptWorld.h
+++ b/WebKit/mac/WebView/WebScriptWorld.h
@@ -36,4 +36,6 @@
 
 + (WebScriptWorld *)scriptWorldForGlobalContext:(JSGlobalContextRef)globalContext;
 
+- (void)unregisterWorld;
+
 @end
diff --git a/WebKit/mac/WebView/WebScriptWorld.mm b/WebKit/mac/WebView/WebScriptWorld.mm
index 7dab1b3..8ca6f44 100644
--- a/WebKit/mac/WebView/WebScriptWorld.mm
+++ b/WebKit/mac/WebView/WebScriptWorld.mm
@@ -75,6 +75,11 @@
     return [self initWithWorld:ScriptController::createWorld()];
 }
 
+- (void)unregisterWorld
+{
+    _private->world->unregisterWorld();
+}
+
 - (void)dealloc
 {
     ASSERT(allWorlds().contains(_private->world.get()));
diff --git a/WebKit/mac/WebView/WebTextCompletionController.mm b/WebKit/mac/WebView/WebTextCompletionController.mm
index 4f8e6e0..2421fd7 100644
--- a/WebKit/mac/WebView/WebTextCompletionController.mm
+++ b/WebKit/mac/WebView/WebTextCompletionController.mm
@@ -84,8 +84,7 @@
     NSRect scrollFrame = NSMakeRect(0, 0, 100, 100);
     NSRect tableFrame = NSZeroRect;    
     tableFrame.size = [NSScrollView contentSizeForFrameSize:scrollFrame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder];
-    // Added cast to work around problem with multiple Foundation initWithIdentifier: methods with different parameter types.
-    NSTableColumn *column = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier:[NSNumber numberWithInt:0]];
+    NSTableColumn *column = [[NSTableColumn alloc] init];
     [column setWidth:tableFrame.size.width];
     [column setEditable:NO];
     
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index e5fde5e..21e4814 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -37,7 +37,7 @@
 #import <wtf/UnusedParam.h>
 
 SOFT_LINK_FRAMEWORK(QTKit)
-SOFT_LINK_CLASS(QTKit, QTMovieView)
+SOFT_LINK_CLASS(QTKit, QTMovieLayer)
 
 SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
 
@@ -85,17 +85,20 @@
 
 - (void)windowDidLoad
 {
+#ifdef BUILDING_ON_TIGER
+    // WebVideoFullscreenController is not supported on Tiger:
+    ASSERT_NOT_REACHED();
+#else
     WebVideoFullscreenWindow *window = [self fullscreenWindow];
-    QTMovieView *view = [[getQTMovieViewClass() alloc] init];
-    [view setFillColor:[NSColor clearColor]];
-    [window setContentView:view];
-    [view setControllerVisible:NO];
-    [view setPreservesAspectRatio:YES];
+    QTMovieLayer *layer = [[getQTMovieLayerClass() alloc] init];
+    [[window contentView] setLayer:layer];
+    [[window contentView] setWantsLayer:YES];
     if (_mediaElement)
-        [view setMovie:_mediaElement->platformMedia().qtMovie];
+        [layer setMovie:_mediaElement->platformMedia().qtMovie];
     [window setHasShadow:YES]; // This is nicer with a shadow.
     [window setLevel:NSPopUpMenuWindowLevel-1];
-    [view release];
+    [layer release];
+#endif
 }
 
 - (WebCore::HTMLMediaElement*)mediaElement;
@@ -105,19 +108,24 @@
 
 - (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
 {
+#ifdef BUILDING_ON_TIGER
+    // WebVideoFullscreenController is not supported on Tiger:
+    ASSERT_NOT_REACHED();
+#else
     _mediaElement = mediaElement;
     if ([self isWindowLoaded]) {
-        QTMovieView *movieView = (QTMovieView *)[[self fullscreenWindow] contentView];
         QTMovie *movie = _mediaElement->platformMedia().qtMovie;
+        QTMovieLayer *movieLayer = (QTMovieLayer *)[[[self fullscreenWindow] contentView] layer];
 
-        ASSERT(movieView && [movieView isKindOfClass:[getQTMovieViewClass() class]]);
+        ASSERT(movieLayer && [movieLayer isKindOfClass:[getQTMovieLayerClass() class]]);
         ASSERT(movie);
-        [movieView setMovie:movie];
+        [movieLayer setMovie:movie];
         [[NSNotificationCenter defaultCenter] addObserver:self
                                                  selector:@selector(rateChanged:) 
                                                      name:QTMovieRateDidChangeNotification 
                                                    object:movie];
     }
+#endif
 }
 
 - (id <WebVideoFullscreenControllerDelegate>)delegate
diff --git a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
index 83e2d09..1aa501e 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
@@ -346,9 +346,9 @@
     static const CGFloat volumeButtonHeight = 16;
     static const CGFloat volumeUpButtonLeftMargin = 4;
     static const CGFloat volumeControlsTopMargin = 13;
-    static const CGFloat exitFullScreenButtonWidth = 25;
-    static const CGFloat exitFullScreenButtonHeight = 21;
-    static const CGFloat exitFullScreenButtonTopMargin = 11;
+    static const CGFloat exitFullscreenButtonWidth = 25;
+    static const CGFloat exitFullscreenButtonHeight = 21;
+    static const CGFloat exitFullscreenButtonTopMargin = 11;
     static const CGFloat timelineWidth = 315;
     static const CGFloat timelineHeight = 14;
     static const CGFloat timelineBottomMargin = 7;
@@ -380,8 +380,8 @@
     [_playButton setAction:@selector(togglePlaying:)];
     [contentView addSubview:_playButton];
 
-    CGFloat closeToRight = windowWidth - horizontalMargin - exitFullScreenButtonWidth;
-    NSControl *exitFullscreenButton = createControlWithMediaUIControlType(WKMediaUIControlExitFullscreenButton, NSMakeRect(closeToRight, windowHeight - exitFullScreenButtonTopMargin - exitFullScreenButtonHeight, exitFullScreenButtonWidth, exitFullScreenButtonHeight));
+    CGFloat closeToRight = windowWidth - horizontalMargin - exitFullscreenButtonWidth;
+    NSControl *exitFullscreenButton = createControlWithMediaUIControlType(WKMediaUIControlExitFullscreenButton, NSMakeRect(closeToRight, windowHeight - exitFullscreenButtonTopMargin - exitFullscreenButtonHeight, exitFullscreenButtonWidth, exitFullscreenButtonHeight));
     [exitFullscreenButton setAction:@selector(exitFullscreen:)];
     [exitFullscreenButton setTarget:self];
     [contentView addSubview:exitFullscreenButton];
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 44d4b58..b1b5c38 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -101,11 +101,15 @@
 #import "WebVideoFullscreenController.h"
 #import <CoreFoundation/CFSet.h>
 #import <Foundation/NSURLConnection.h>
+#import <JavaScriptCore/APICast.h>
+#import <JavaScriptCore/JSValueRef.h>
 #import <WebCore/ApplicationCacheStorage.h>
 #import <WebCore/BackForwardList.h>
 #import <WebCore/Cache.h>
 #import <WebCore/ColorMac.h>
+#import <WebCore/CSSComputedStyleDeclaration.h>
 #import <WebCore/Cursor.h>
+#import <WebCore/Database.h>
 #import <WebCore/Document.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/DragController.h>
@@ -123,6 +127,8 @@
 #import <WebCore/HTMLNames.h>
 #import <WebCore/HistoryItem.h>
 #import <WebCore/IconDatabase.h>
+#import <WebCore/JSCSSStyleDeclaration.h>
+#import <WebCore/JSElement.h>
 #import <WebCore/Logging.h>
 #import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/Page.h>
@@ -558,6 +564,16 @@
     return NO;    
 }
 
+static bool coreVideoHas7228836Fix()
+{
+#ifdef BUILDING_ON_LEOPARD
+    NSBundle* coreVideoFrameworkBundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/CoreVideo.framework"];
+    double version = [[coreVideoFrameworkBundle objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] doubleValue];
+    return (version >= 48);
+#endif
+    return true;
+}
+
 static bool shouldEnableLoadDeferring()
 {
     return !applicationIsAdobeInstaller();
@@ -964,8 +980,6 @@
     WTF::RefCountedLeakCounter::suppressMessages("At least one WebView was closed with fast teardown.");
 #endif
 
-    _private->closed = YES;
-    
     [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 
@@ -998,6 +1012,8 @@
     if (!_private || _private->closed)
         return;
 
+    _private->closed = YES;
+
     [self _closingEventHandling];
 
 #ifndef NDEBUG
@@ -1031,9 +1047,6 @@
 
     [_private->inspector webViewClosed];
 
-    // setHostWindow:nil must be called before this value is set (see 5408186)
-    _private->closed = YES;
-
     // To avoid leaks, call removeDragCaret in case it wasn't called after moveDragCaretToPoint.
     [self removeDragCaret];
 
@@ -1294,7 +1307,9 @@
     settings->setMinimumFontSize([preferences minimumFontSize]);
     settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]);
     settings->setPluginsEnabled([preferences arePlugInsEnabled]);
-    settings->setDatabasesEnabled([preferences databasesEnabled]);
+#if ENABLE(DATABASE)
+    Database::setIsAvailable([preferences databasesEnabled]);
+#endif
     settings->setLocalStorageEnabled([preferences localStorageEnabled]);
     settings->setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]);
     settings->setPrivateBrowsingEnabled([preferences privateBrowsingEnabled]);
@@ -1329,16 +1344,19 @@
     settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]);
     settings->setLocalFileContentSniffingEnabled([preferences localFileContentSniffingEnabled]);
     settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]);
-    settings->setZoomsTextOnly([preferences zoomsTextOnly]);
+    settings->setZoomMode([preferences zoomsTextOnly] ? ZoomTextOnly : ZoomPage);
     settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
     settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
-    settings->setAcceleratedCompositingEnabled([preferences acceleratedCompositingEnabled]);
+    
+    // FIXME: Enabling accelerated compositing when WebGL is enabled causes tests to fail on Leopard which expect HW compositing to be disabled.
+    // Until we fix that, I will comment out the test (CFM)
+    settings->setAcceleratedCompositingEnabled((coreVideoHas7228836Fix() || [preferences webGLEnabled]) && [preferences acceleratedCompositingEnabled]);
     settings->setShowDebugBorders([preferences showDebugBorders]);
     settings->setShowRepaintCounter([preferences showRepaintCounter]);
     settings->setPluginAllowedRunTime([preferences pluginAllowedRunTime]);
     settings->setWebGLEnabled([preferences webGLEnabled]);
     settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
-    settings->setFrameSetFlatteningEnabled([preferences isFrameSetFlatteningEnabled]);
+    settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
 }
 
 static inline IMP getMethod(id o, SEL s)
@@ -2229,14 +2247,19 @@
     return _private ? _private->insertionPasteboard : nil;
 }
 
-+ (void)_whiteListAccessFromOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains
++ (void)_addOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains
 {
-    SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+    SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
 }
 
-+(void)_resetOriginAccessWhiteLists
++ (void)_removeOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains
 {
-    SecurityOrigin::resetOriginAccessWhiteLists();
+    SecurityOrigin::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
++(void)_resetOriginAccessWhitelists
+{
+    SecurityOrigin::resetOriginAccessWhitelists();
 }
 
 - (void)_updateActiveState
@@ -2378,6 +2401,11 @@
     SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
 }
 
++ (void)_registerURLSchemeAsSecure:(NSString *)scheme
+{
+    SecurityOrigin::registerURLSchemeAsSecure(scheme);
+}
+
 @end
 
 @implementation _WebSafeForwarder
@@ -3105,13 +3133,13 @@
     _private->zoomMultiplier = m;
     ASSERT(_private->page);
     if (_private->page)
-        _private->page->settings()->setZoomsTextOnly(isTextOnly);
+        _private->page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage);
     
     // FIXME: it would be nice to rework this code so that _private->zoomMultiplier doesn't exist and callers
     // all access _private->page->settings().
     Frame* coreFrame = [self _mainCoreFrame];
     if (coreFrame)
-        coreFrame->setZoomFactor(m, isTextOnly);
+        coreFrame->setZoomFactor(m, isTextOnly ? ZoomTextOnly : ZoomPage);
 }
 
 - (float)_zoomMultiplier:(BOOL)isTextOnly
@@ -3131,7 +3159,7 @@
     if (!_private->page)
         return NO;
     
-    return _private->page->settings()->zoomsTextOnly();
+    return _private->page->settings()->zoomMode() == ZoomTextOnly;
 }
 
 #define MinimumZoomMultiplier       0.5f
@@ -3318,7 +3346,7 @@
 
 - (void)setHostWindow:(NSWindow *)hostWindow
 {
-    if (_private->closed)
+    if (_private->closed && hostWindow)
         return;
     if (hostWindow == _private->hostWindow)
         return;
@@ -4130,7 +4158,7 @@
     if (jsValue.isBoolean())
         return [NSAppleEventDescriptor descriptorWithBoolean:jsValue.getBoolean()];
     if (jsValue.isString())
-        return [NSAppleEventDescriptor descriptorWithString:String(jsValue.getString(exec))];
+        return [NSAppleEventDescriptor descriptorWithString:ustringToString(jsValue.getString(exec))];
     if (jsValue.isNumber()) {
         double value = jsValue.uncheckedGetNumber();
         int intValue = value;
@@ -5681,6 +5709,25 @@
 
 @end
 
+@implementation WebView (WebViewPrivateStyleInfo)
+
+- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value
+{
+    JSLock lock(SilenceAssertionsOnly);
+    ExecState* exec = toJS(context);
+    if (!value)
+        return JSValueMakeUndefined(context);
+    JSValue jsValue = toJS(exec, value);
+    if (!jsValue.inherits(&JSElement::s_info))
+        return JSValueMakeUndefined(context);
+    JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
+    Element* element = jsElement->impl();
+    RefPtr<CSSComputedStyleDeclaration> style = computedStyle(element, true);
+    return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
+}
+
+@end
+
 #ifdef BUILDING_ON_LEOPARD
 
 static IMP originalRecursivelyRemoveMailAttributesImp;
diff --git a/WebKit/mac/WebView/WebViewData.mm b/WebKit/mac/WebView/WebViewData.mm
index 21ba4c8..bf81dad 100644
--- a/WebKit/mac/WebView/WebViewData.mm
+++ b/WebKit/mac/WebView/WebViewData.mm
@@ -65,7 +65,11 @@
     dashboardBehaviorAllowWheelScrolling = YES;
 #endif
 
-    shouldCloseWithWindow = objc_collecting_enabled();
+#if !defined(BUILDING_ON_TIGER)
+    shouldCloseWithWindow = objc_collectingEnabled();
+#else
+    shouldCloseWithWindow = NO;
+#endif
 
     smartInsertDeleteEnabled = ![[NSUserDefaults standardUserDefaults] objectForKey:WebSmartInsertDeleteEnabled]
         || [[NSUserDefaults standardUserDefaults] boolForKey:WebSmartInsertDeleteEnabled];
diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h
index 3f38d58..a2ce646 100644
--- a/WebKit/mac/WebView/WebViewInternal.h
+++ b/WebKit/mac/WebView/WebViewInternal.h
@@ -174,4 +174,6 @@
 - (void)_exitFullscreen;
 #endif
 
+- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
+
 @end
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index b0a7039..327743a 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -489,10 +489,11 @@
 // - destinationProtocol: The protocol to grant access to.
 // - destinationHost: The host to grant access to.
 // - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively.
-+ (void)_whiteListAccessFromOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
++ (void)_addOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
++ (void)_removeOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
 
-// Removes all white list entries created with _whiteListAccessFromOrigin.
-+ (void)_resetOriginAccessWhiteLists;
+// Removes all white list entries created with _addOriginAccessWhitelistEntryWithSourceOrigin.
++ (void)_resetOriginAccessWhitelists;
 
 + (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime;
 + (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist;
@@ -517,6 +518,7 @@
 - (void)setCSSAnimationsSuspended:(BOOL)suspended;
 
 + (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme;
++ (void)_registerURLSchemeAsSecure:(NSString *)scheme;
 
 @end
 
@@ -598,6 +600,10 @@
 - (void)_geolocationDidFailWithError:(NSError *)error;
 @end
 
+@interface WebView (WebViewPrivateStyleInfo)
+- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
+@end
+
 @interface NSObject (WebFrameLoadDelegatePrivate)
 - (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
 
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro
index a8f2684..389fb5f 100644
--- a/WebKit/qt/Api/DerivedSources.pro
+++ b/WebKit/qt/Api/DerivedSources.pro
@@ -32,8 +32,6 @@
 
 for(HEADER, WEBKIT_API_HEADERS) {
     # 1. Append to QtWebKit header that includes all other header files
-
-    qtheader_module.depends += $$HEADER
     # Quotes need to be escaped once more when placed in eval()
     eval(qtheader_module.commands += echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$basename(HEADER)\\\"$${DOUBLE_ESCAPED_QUOTE} >> $${qtheader_module.target} &&)
 
@@ -53,6 +51,7 @@
     eval($${HEADER_TARGET}.commands = echo $${DOUBLE_ESCAPED_QUOTE}\$${LITERAL_HASH}include \\\"$$PATH_TO_HEADER\\\"$${DOUBLE_ESCAPED_QUOTE} > $$eval($${HEADER_TARGET}.target))
 
     QMAKE_EXTRA_TARGETS += $$HEADER_TARGET
+    qtheader_module.depends += $$eval($${HEADER_TARGET}.target)
 
     # 3. Extract class names of exported classes from the headers and generate
     # the class name header files
@@ -97,7 +96,7 @@
 QMAKE_EXTRA_TARGETS += qtheader_module
 
 qtheader_pri.target = $${DESTDIR}/classheaders.pri
-qtheader_pri.depends = $${WEBKIT_API_HEADERS} $${_PRO_FILE_}
+qtheader_pri.depends += $${_PRO_FILE_}
 qtheader_pri.commands = echo $${QUOTE}WEBKIT_CLASS_HEADERS = $${WEBKIT_CLASS_HEADERS}$${QUOTE} > $${qtheader_pri.target}
 QMAKE_EXTRA_TARGETS += qtheader_pri
 
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 9720e0c..c865c4d 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -26,7 +26,10 @@
 #include "qwebpage.h"
 #include "qwebpage_p.h"
 #include "QWebPageClient.h"
-#include <FrameView.h>
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "IntRect.h"
+#include "TiledBackingStore.h"
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qsharedpointer.h>
 #include <QtCore/qtimer.h>
@@ -35,14 +38,14 @@
 #include <QtGui/qgraphicssceneevent.h>
 #include <QtGui/qgraphicsview.h>
 #include <QtGui/qpixmapcache.h>
+#include <QtGui/qscrollbar.h>
 #include <QtGui/qstyleoption.h>
+#include <QtGui/qinputcontext.h>
 #if defined(Q_WS_X11)
 #include <QX11Info>
 #endif
 #include <Settings.h>
 
-#if USE(ACCELERATED_COMPOSITING)
-
 // the overlay is here for one reason only: to have the scroll-bars and other
 // extra UI elements appear on top of any QGraphicsItems created by CSS compositing layers
 class QGraphicsWebViewOverlay : public QGraphicsItem {
@@ -52,7 +55,9 @@
             , q(view)
     {
         setPos(0, 0);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
         setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
+#endif
         setCacheMode(QGraphicsItem::DeviceCoordinateCache);
     }
 
@@ -70,8 +75,6 @@
     QGraphicsWebView* q;
 };
 
-#endif
-
 class QGraphicsWebViewPrivate : public QWebPageClient {
 public:
     QGraphicsWebViewPrivate(QGraphicsWebView* parent)
@@ -92,6 +95,7 @@
     }
 
     virtual ~QGraphicsWebViewPrivate();
+
     virtual void scroll(int dx, int dy, const QRect&);
     virtual void update(const QRect& dirtyRect);
     virtual void setInputMethodEnabled(bool enable);
@@ -108,6 +112,7 @@
     virtual QPalette palette() const;
     virtual int screenNumber() const;
     virtual QWidget* ownerWidget() const;
+    virtual QRect geometryRelativeToOwnerWidget() const;
 
     virtual QObject* pluginParent() const;
 
@@ -117,34 +122,49 @@
     virtual void setRootGraphicsLayer(QGraphicsItem* layer);
     virtual void markForSync(bool scheduleSync);
     void updateCompositingScrollPosition();
+
+    // QGraphicsWebView can render composited layers
+    virtual bool allowsAcceleratedCompositing() const { return true; }
 #endif
-    
+
     void updateResizesToContentsForPage();
+    QRectF graphicsItemVisibleRect() const;
+#if ENABLE(TILED_BACKING_STORE)
+    void updateTiledBackingStoreScale();
+#endif
+
+    void createOrDeleteOverlay();
 
     void syncLayers();
+
+    void unsetPageIfExists();
+
     void _q_doLoadFinished(bool success);
     void _q_contentsSizeChanged(const QSize&);
+    void _q_scaleChanged();
+
+    void _q_updateMicroFocus();
+    void _q_pageDestroyed();
 
     QGraphicsWebView* q;
     QWebPage* page;
 
     bool resizesToContents;
 
-#if USE(ACCELERATED_COMPOSITING)
-    QGraphicsItem* rootGraphicsLayer;
-
     // the overlay gets instantiated when the root layer is attached, and get deleted when it's detached
     QSharedPointer<QGraphicsWebViewOverlay> overlay;
 
+    // we need to put the root graphics layer behind the overlay (which contains the scrollbar)
+    enum { RootGraphicsLayerZValue, OverlayZValue };
+
+#if USE(ACCELERATED_COMPOSITING)
+    QGraphicsItem* rootGraphicsLayer;
     // we need to sync the layers if we get a special call from the WebCore
     // compositor telling us to do so. We'll get that call from ChromeClientQt
     bool shouldSync;
 
     // we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue
     QMetaMethod syncMetaMethod;
-
-    // we need to put the root graphics layer behind the overlay (which contains the scrollbar)
-    enum { RootGraphicsLayerZValue, OverlayZValue };
 #endif
 };
 
@@ -160,6 +180,26 @@
 #endif
 }
 
+void QGraphicsWebViewPrivate::createOrDeleteOverlay()
+{
+    bool useOverlay = false;
+    if (!resizesToContents) {
+#if USE(ACCELERATED_COMPOSITING)
+        useOverlay = useOverlay || rootGraphicsLayer;
+#endif
+#if ENABLE(TILED_BACKING_STORE)
+        useOverlay = useOverlay || QWebFramePrivate::core(q->page()->mainFrame())->tiledBackingStore();
+#endif
+    }
+    if (useOverlay == !!overlay)
+        return;
+    if (useOverlay) {
+        overlay = QSharedPointer<QGraphicsWebViewOverlay>(new QGraphicsWebViewOverlay(q));
+        overlay->setZValue(OverlayZValue);
+    } else
+        overlay.clear();
+}
+
 #if USE(ACCELERATED_COMPOSITING)
 void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer)
 {
@@ -175,15 +215,9 @@
         layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
         layer->setParentItem(q);
         layer->setZValue(RootGraphicsLayerZValue);
-        if (!overlay) {
-            overlay = QSharedPointer<QGraphicsWebViewOverlay>(new QGraphicsWebViewOverlay(q));
-            overlay->setZValue(OverlayZValue);
-        }
         updateCompositingScrollPosition();
-    } else {
-        // we don't have compositing layers, we can render the scrollbars and content in one go
-        overlay.clear();
     }
+    createOrDeleteOverlay();
 }
 
 void QGraphicsWebViewPrivate::markForSync(bool scheduleSync)
@@ -200,7 +234,6 @@
         rootGraphicsLayer->setPos(-scrollPosition);
     }
 }
-
 #endif
 
 void QGraphicsWebViewPrivate::syncLayers()
@@ -222,9 +255,30 @@
     emit q->loadFinished(success);
 }
 
+void QGraphicsWebViewPrivate::_q_updateMicroFocus()
+{
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
+    // Ideally, this should be handled by a common call to an updateMicroFocus function
+    // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578.
+    QList<QGraphicsView*> views = q->scene()->views();
+    for (int c = 0; c < views.size(); ++c) {
+        QInputContext* ic = views.at(c)->inputContext();
+        if (ic)
+            ic->update();
+    }
+#endif
+}
+
+void QGraphicsWebViewPrivate::_q_pageDestroyed()
+{
+    page = 0;
+    q->setPage(0);
+}
+
 void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
 {
     q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll));
+
 #if USE(ACCELERATED_COMPOSITING)
     updateCompositingScrollPosition();
 #endif
@@ -233,9 +287,11 @@
 void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
 {
     q->update(QRectF(dirtyRect));
-#if USE(ACCELERATED_COMPOSITING)
+
+    createOrDeleteOverlay();
     if (overlay)
         overlay->update(QRectF(dirtyRect));
+#if USE(ACCELERATED_COMPOSITING)
     syncLayers();
 #endif
 }
@@ -286,10 +342,12 @@
 int QGraphicsWebViewPrivate::screenNumber() const
 {
 #if defined(Q_WS_X11)
-    const QList<QGraphicsView*> views = q->scene()->views();
+    if (QGraphicsScene* scene = q->scene()) {
+        const QList<QGraphicsView*> views = scene->views();
 
-    if (!views.isEmpty())
-        return views.at(0)->x11Info().screen();
+        if (!views.isEmpty())
+            return views.at(0)->x11Info().screen();
+    }
 #endif
 
     return 0;
@@ -297,8 +355,24 @@
 
 QWidget* QGraphicsWebViewPrivate::ownerWidget() const
 {
-    const QList<QGraphicsView*> views = q->scene()->views();
-    return views.value(0);
+    if (QGraphicsScene* scene = q->scene()) {
+        const QList<QGraphicsView*> views = scene->views();
+        return views.value(0);
+    }
+    return 0;
+}
+
+QRect QGraphicsWebViewPrivate::geometryRelativeToOwnerWidget() const
+{
+    if (!q->scene())
+        return QRect();
+
+    QList<QGraphicsView*> views = q->scene()->views();
+    if (views.isEmpty())
+        return QRect();
+
+    QGraphicsView* view = views.at(0);
+    return view->mapFromScene(q->boundingRect()).boundingRect();
 }
 
 QObject* QGraphicsWebViewPrivate::pluginParent() const
@@ -340,6 +414,42 @@
     q->setGeometry(QRectF(q->geometry().topLeft(), size));
 }
 
+void QGraphicsWebViewPrivate::_q_scaleChanged()
+{
+#if ENABLE(TILED_BACKING_STORE)
+    updateTiledBackingStoreScale();
+#endif
+}
+
+QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
+{
+    if (!q->scene())
+        return QRectF();
+    QList<QGraphicsView*> views = q->scene()->views();
+    if (views.size() > 1) {
+#ifndef QT_NO_DEBUG_STREAM
+        qDebug() << "QGraphicsWebView is in more than one graphics views, unable to compute the visible rect";
+#endif
+        return QRectF();
+    }
+    if (views.size() < 1)
+        return QRectF();
+
+    int xPosition = views[0]->horizontalScrollBar()->value();
+    int yPosition = views[0]->verticalScrollBar()->value();
+    return q->mapRectFromScene(QRectF(QPoint(xPosition, yPosition), views[0]->viewport()->size()));
+}
+
+#if ENABLE(TILED_BACKING_STORE)
+void QGraphicsWebViewPrivate::updateTiledBackingStoreScale()
+{
+    WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
+    if (!backingStore)
+        return;
+    backingStore->setContentsScale(q->scale());
+}
+#endif
+
 /*!
     \class QGraphicsWebView
     \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
@@ -433,6 +543,9 @@
 #endif
     setFocusPolicy(Qt::StrongFocus);
     setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
+#if ENABLE(TILED_BACKING_STORE)
+    QObject::connect(this, SIGNAL(scaleChanged()), this, SLOT(_q_scaleChanged()));
+#endif
 }
 
 /*!
@@ -482,6 +595,21 @@
 */
 void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
 {
+#if ENABLE(TILED_BACKING_STORE)
+    if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) {
+        // FIXME: We should set the backing store viewport earlier than in paint
+        if (d->resizesToContents)
+            backingStore->viewportChanged(WebCore::IntRect(d->graphicsItemVisibleRect()));
+        else {
+            QRectF visibleRect(d->page->mainFrame()->scrollPosition(), d->page->mainFrame()->geometry().size());
+            backingStore->viewportChanged(WebCore::IntRect(visibleRect));
+        }
+        // QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change.
+        WebCore::GraphicsContext context(painter); 
+        page()->mainFrame()->d->renderFromTiledBackingStore(&context, option->exposedRect.toAlignedRect());
+        return;
+    } 
+#endif
 #if USE(ACCELERATED_COMPOSITING)
     page()->mainFrame()->render(painter, d->overlay ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
 #else
@@ -589,6 +717,29 @@
     return QGraphicsWidget::event(event);
 }
 
+void QGraphicsWebViewPrivate::unsetPageIfExists()
+{
+    if (!page)
+        return;
+
+    // if the page client is the special client constructed for
+    // delegating the responsibilities to a QWidget, we need
+    // to destroy it.
+
+    if (page->d->client && page->d->client->isQWidgetClient())
+        delete page->d->client;
+
+    page->d->client = 0;
+
+    // if the page was created by us, we own it and need to
+    // destroy it as well.
+
+    if (page->parent() == q)
+        delete page;
+    else
+        page->disconnect(q);
+}
+
 /*!
     Makes \a page the new web page of the web graphicsitem.
 
@@ -603,26 +754,20 @@
     if (d->page == page)
         return;
 
-    if (d->page) {
-        d->page->d->client = 0; // unset the page client
-        if (d->page->parent() == this)
-            delete d->page;
-        else
-            d->page->disconnect(this);
-    }
-
+    d->unsetPageIfExists();
     d->page = page;
+
     if (!d->page)
         return;
-#if USE(ACCELERATED_COMPOSITING)
+
+    d->page->d->client = d; // set the page client
+
     if (d->overlay)
         d->overlay->prepareGeometryChange();
-#endif
-    d->page->d->client = d; // set the page client
 
     QSize size = geometry().size().toSize();
     page->setViewportSize(size);
-    
+
     if (d->resizesToContents)
         d->updateResizesToContentsForPage();
 
@@ -644,6 +789,10 @@
             this, SIGNAL(statusBarMessage(QString)));
     connect(d->page, SIGNAL(linkClicked(QUrl)),
             this, SIGNAL(linkClicked(QUrl)));
+    connect(d->page, SIGNAL(microFocusChanged()),
+            this, SLOT(_q_updateMicroFocus()));
+    connect(d->page, SIGNAL(destroyed()),
+            this, SLOT(_q_pageDestroyed()));
 }
 
 /*!
@@ -724,11 +873,8 @@
 */
 void QGraphicsWebView::updateGeometry()
 {
-
-#if USE(ACCELERATED_COMPOSITING)
     if (d->overlay)
         d->overlay->prepareGeometryChange();
-#endif
 
     QGraphicsWidget::updateGeometry();
 
@@ -745,10 +891,8 @@
 {
     QGraphicsWidget::setGeometry(rect);
 
-#if USE(ACCELERATED_COMPOSITING)
     if (d->overlay)
         d->overlay->prepareGeometryChange();
-#endif
 
     if (!d->page)
         return;
@@ -920,7 +1064,12 @@
 */
 QAction *QGraphicsWebView::pageAction(QWebPage::WebAction action) const
 {
+#ifdef QT_NO_ACTION
+    Q_UNUSED(action)
+    return 0;
+#else
     return page()->action(action);
+#endif
 }
 
 /*!
@@ -964,12 +1113,13 @@
 
     If this property is set, the QGraphicsWebView will automatically change its
     size to match the size of the main frame contents. As a result the top level frame
-    will never have scrollbars.
+    will never have scrollbars. It will also make CSS fixed positioning to behave like absolute positioning
+    with elements positioned relative to the document instead of the viewport.
 
     This property should be used in conjunction with the QWebPage::preferredContentsSize property.
     If not explicitly set, the preferredContentsSize is automatically set to a reasonable value.
 
-    \sa QWebPage::setPreferredContentsSize
+    \sa QWebPage::setPreferredContentsSize()
 */
 void QGraphicsWebView::setResizesToContents(bool enabled)
 {
@@ -985,6 +1135,48 @@
     return d->resizesToContents;
 }
 
+/*!
+    \property QGraphicsWebView::tiledBackingStoreFrozen
+    \brief whether the tiled backing store updates its contents
+    \since 4.7 
+
+    If the tiled backing store is enabled using QWebSettings::TiledBackingStoreEnabled attribute, this property
+    can be used to disable backing store updates temporarily. This can be useful for example for running
+    a smooth animation that changes the scale of the QGraphicsWebView.
+ 
+    When the backing store is unfrozen, its contents will be automatically updated to match the current
+    state of the document. If the QGraphicsWebView scale was changed, the backing store is also
+    re-rendered using the new scale.
+ 
+    If the tiled backing store is not enabled, this property does nothing.
+
+    \sa QWebSettings::TiledBackingStoreEnabled
+    \sa QGraphicsObject::scale
+*/
+bool QGraphicsWebView::isTiledBackingStoreFrozen() const
+{
+#if ENABLE(TILED_BACKING_STORE)
+    WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore();
+    if (!backingStore)
+        return false;
+    return backingStore->contentsFrozen();
+#else
+    return false;
+#endif
+}
+
+void QGraphicsWebView::setTiledBackingStoreFrozen(bool frozen)
+{
+#if ENABLE(TILED_BACKING_STORE)
+    WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore();
+    if (!backingStore)
+        return;
+    backingStore->setContentsFrozen(frozen);
+#else
+    UNUSED_PARAM(frozen);
+#endif
+}
+
 /*! \reimp
 */
 void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h
index 14de9d5..88729d3 100644
--- a/WebKit/qt/Api/qgraphicswebview.h
+++ b/WebKit/qt/Api/qgraphicswebview.h
@@ -46,6 +46,7 @@
 
     Q_PROPERTY(bool modified READ isModified)
     Q_PROPERTY(bool resizesToContents READ resizesToContents WRITE setResizesToContents)
+    Q_PROPERTY(bool tiledBackingStoreFrozen READ isTiledBackingStoreFrozen WRITE setTiledBackingStoreFrozen)
 
 public:
     explicit QGraphicsWebView(QGraphicsItem* parent = 0);
@@ -82,6 +83,9 @@
 
     bool resizesToContents() const;
     void setResizesToContents(bool enabled);
+    
+    bool isTiledBackingStoreFrozen() const;
+    void setTiledBackingStoreFrozen(bool frozen);
 
     virtual void setGeometry(const QRectF& rect);
     virtual void updateGeometry();
@@ -138,10 +142,13 @@
 
 private:
     Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
+    Q_PRIVATE_SLOT(d, void _q_updateMicroFocus())
+    Q_PRIVATE_SLOT(d, void _q_pageDestroyed())
     // we don't want to change the moc based on USE() macro, so this function is here
     // but will be empty if ACCLERATED_COMPOSITING is disabled
     Q_PRIVATE_SLOT(d, void syncLayers())
     Q_PRIVATE_SLOT(d, void _q_contentsSizeChanged(const QSize&))
+    Q_PRIVATE_SLOT(d, void _q_scaleChanged())
 
     QGraphicsWebViewPrivate* const d;
     friend class QGraphicsWebViewPrivate;
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index 9d4d0d0..8af7203 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -26,7 +26,6 @@
 #include "CSSRule.h"
 #include "CSSRuleList.h"
 #include "CSSStyleRule.h"
-#include "CString.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "FrameView.h"
@@ -45,6 +44,7 @@
 #include "runtime_root.h"
 #include <parser/SourceCode.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 #include <QPainter>
 
@@ -864,25 +864,7 @@
         return QStringList();
 
     QStringList classes =  attribute(QLatin1String("class")).simplified().split(QLatin1Char(' '), QString::SkipEmptyParts);
-#if QT_VERSION >= 0x040500
     classes.removeDuplicates();
-#else
-    int n = classes.size();
-    int j = 0;
-    QSet<QString> seen;
-    seen.reserve(n);
-    for (int i = 0; i < n; ++i) {
-        const QString& s = classes.at(i);
-        if (seen.contains(s))
-            continue;
-        seen.insert(s);
-        if (j != i)
-            classes[j] = s;
-        ++j;
-    }
-    if (n != j)
-        classes.erase(classes.begin() + j, classes.end());
-#endif
     return classes;
 }
 
diff --git a/WebKit/qt/Api/qwebelement.h b/WebKit/qt/Api/qwebelement.h
index 156d24b..c488d12 100644
--- a/WebKit/qt/Api/qwebelement.h
+++ b/WebKit/qt/Api/qwebelement.h
@@ -20,11 +20,11 @@
 #ifndef QWEBELEMENT_H
 #define QWEBELEMENT_H
 
-#include <QString>
-#include <QStringList>
-#include <QRect>
-#include <QVariant>
-#include <QExplicitlySharedDataPointer>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qshareddata.h>
 
 #include "qwebkitglobal.h"
 namespace WebCore {
@@ -154,6 +154,7 @@
 
     static QWebElement enclosingElement(WebCore::Node*);
 
+    friend class DumpRenderTreeSupportQt;
     friend class QWebFrame;
     friend class QWebElementCollection;
     friend class QWebHitTestResult;
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 15b5c00..e6ee00f 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -58,6 +58,7 @@
 #include "SelectionController.h"
 #include "SubstituteData.h"
 #include "SVGSMILElement.h"
+#include "TiledBackingStore.h"
 #include "htmlediting.h"
 #include "markup.h"
 #include "qt_instance.h"
@@ -87,182 +88,80 @@
 extern Q_GUI_EXPORT int qt_defaultDpi();
 QT_END_NAMESPACE
 
-bool QWEBKIT_EXPORT qt_drt_hasDocumentElement(QWebFrame* qframe)
+static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const QPoint& pos)
 {
-    return QWebFramePrivate::core(qframe)->document()->documentElement();
+    if (!frame || !frame->document() || !frame->view() || !frame->eventHandler())
+        return false;
+
+    QPoint contentsPos = frame->view()->windowToContents(pos);
+    Node* node = frame->document()->elementFromPoint(contentsPos.x(), contentsPos.y());
+    if (!node)
+        return false;
+
+    RenderObject* renderer = node->renderer();
+    if (!renderer)
+        return false;
+
+    if (renderer->isListBox())
+        return false;
+
+    RenderLayer* renderLayer = renderer->enclosingLayer();
+    if (!renderLayer)
+        return false;
+
+    bool scrolledHorizontal = false;
+    bool scrolledVertical = false;
+
+    if (dx > 0)
+        scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
+    else if (dx < 0)
+        scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+
+    if (dy > 0)
+        scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
+    else if (dy < 0)
+        scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
+
+    return (scrolledHorizontal || scrolledVertical);
 }
 
-void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled)
+
+/*!
+  \internal
+  Scrolls nested frames starting at this frame, \a dx pixels to the right 
+  and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts
+  to scroll elements with CSS overflow at position pos, followed by this frame. If this 
+  frame doesn't scroll, attempts to scroll the parent
+*/
+void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy, const QPoint& pos)
 {
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    Frame* frame = QWebFramePrivate::core(qframe);
-    InspectorController* controller = frame->page()->inspectorController();
-    if (!controller)
+    if (!qFrame)
         return;
-    if (enabled)
-        controller->enableProfiler();
-    else
-        controller->disableProfiler();
-#endif
-}
 
-// Pause a given CSS animation or transition on the target node at a specific time.
-// If the animation or transition is already paused, it will update its pause time.
-// This method is only intended to be used for testing the CSS animation and transition system.
-bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame *qframe, const QString &animationName, double time, const QString &elementId)
-{
-    Frame* frame = QWebFramePrivate::core(qframe);
-    if (!frame)
-        return false;
+    if (webframe_scrollOverflow(QWebFramePrivate::core(qFrame), dx, dy, pos))
+        return;
 
-    AnimationController* controller = frame->animation();
-    if (!controller)
-        return false;
+    bool scrollHorizontal = false;
+    bool scrollVertical = false;
 
-    Document* doc = frame->document();
-    Q_ASSERT(doc);
+    do {
+        if (dx > 0)  // scroll right
+            scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) < qFrame->scrollBarMaximum(Qt::Horizontal);
+        else if (dx < 0)  // scroll left
+            scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) > qFrame->scrollBarMinimum(Qt::Horizontal);
 
-    Node* coreNode = doc->getElementById(elementId);
-    if (!coreNode || !coreNode->renderer())
-        return false;
+        if (dy > 0)  // scroll down
+            scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical);
+            else if (dy < 0) //scroll up
+            scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical);
 
-    return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time);
-}
+        if (scrollHorizontal || scrollVertical) {
+            qFrame->scroll(dx, dy);
+            return;
+        }
 
-bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QString &propertyName, double time, const QString &elementId)
-{
-    Frame* frame = QWebFramePrivate::core(qframe);
-    if (!frame)
-        return false;
-
-    AnimationController* controller = frame->animation();
-    if (!controller)
-        return false;
-
-    Document* doc = frame->document();
-    Q_ASSERT(doc);
-
-    Node* coreNode = doc->getElementById(elementId);
-    if (!coreNode || !coreNode->renderer())
-        return false;
-
-    return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time);
-}
-
-// Pause a given SVG animation on the target node at a specific time.
-// This method is only intended to be used for testing the SVG animation system.
-bool QWEBKIT_EXPORT qt_drt_pauseSVGAnimation(QWebFrame *qframe, const QString &animationId, double time, const QString &elementId)
-{
-#if !ENABLE(SVG)
-    return false;
-#else
-    Frame* frame = QWebFramePrivate::core(qframe);
-    if (!frame)
-        return false;
-
-    Document* doc = frame->document();
-    Q_ASSERT(doc);
-
-    if (!doc->svgExtensions())
-        return false;
-
-    Node* coreNode = doc->getElementById(animationId);
-    if (!coreNode || !SVGSMILElement::isSMILElement(coreNode))
-        return false;
-
-    return doc->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreNode), time);
-#endif
-}
-
-// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
-int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe)
-{
-    Frame* frame = QWebFramePrivate::core(qframe);
-    if (!frame)
-        return false;
-
-    AnimationController* controller = frame->animation();
-    if (!controller)
-        return false;
-
-    return controller->numberOfActiveAnimations();
-}
-
-void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* qFrame)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    frame->tree()->clearName();
-}
-
-int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount()
-{
-    return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount();
-}
-
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collect()
-{
-    gcController().garbageCollectNow();
-}
-
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone)
-{
-    gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
-}
-
-// Returns the value of counter in the element specified by \a id.
-QString QWEBKIT_EXPORT qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (Document* document = frame->document()) {
-        Element* element = document->getElementById(id);
-        return WebCore::counterValueForElement(element);
-    }
-    return QString();
-}
-
-int QWEBKIT_EXPORT qt_drt_pageNumberForElementById(QWebFrame* qFrame, const QString& id, float width, float height)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (!frame)
-        return -1;
-
-    Element* element = frame->document()->getElementById(AtomicString(id));
-    if (!element)
-        return -1;
-
-    return PrintContext::pageNumberForElement(element, FloatSize(width, height));
-}
-
-int QWEBKIT_EXPORT qt_drt_numberOfPages(QWebFrame* qFrame, float width, float height)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (!frame)
-        return -1;
-
-    return PrintContext::numberOfPages(frame, FloatSize(width, height));
-}
-
-// Suspend active DOM objects in this frame.
-void QWEBKIT_EXPORT qt_suspendActiveDOMObjects(QWebFrame* qFrame)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (frame->document())
-        frame->document()->suspendActiveDOMObjects();
-}
-            
-// Resume active DOM objects in this frame.
-void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* qFrame)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (frame->document())
-        frame->document()->resumeActiveDOMObjects();
-}                        
-
-void QWEBKIT_EXPORT qt_drt_evaluateScriptInIsolatedWorld(QWebFrame* qFrame, int worldId, const QString& script)
-{
-    Frame* frame = QWebFramePrivate::core(qFrame);
-    if (frame)
-        JSC::JSValue result = frame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue();
+        qFrame = qFrame->parentFrame();
+    } while (qFrame);
 }
 
 QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
@@ -327,8 +226,11 @@
     return frame->view()->verticalScrollbar();
 }
 
-void QWebFramePrivate::renderContentsLayerAbsoluteCoords(GraphicsContext* context, const QRegion& clip)
+#if ENABLE(TILED_BACKING_STORE)
+void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, const QRegion& clip)
 {
+    ASSERT(frame->tiledBackingStore());
+
     if (!frame->view() || !frame->contentRenderer())
         return;
 
@@ -339,21 +241,25 @@
     QPainter* painter = context->platformContext();
 
     WebCore::FrameView* view = frame->view();
-    view->layoutIfNeededRecursive();
+    
+    int scrollX = view->scrollX();
+    int scrollY = view->scrollY();
+    context->translate(-scrollX, -scrollY);
 
     for (int i = 0; i < vector.size(); ++i) {
         const QRect& clipRect = vector.at(i);
 
         painter->save();
-        painter->setClipRect(clipRect, Qt::IntersectClip);
+        
+        QRect rect = clipRect.translated(scrollX, scrollY);
+        painter->setClipRect(rect, Qt::IntersectClip);
 
-        context->save();
-        view->paintContents(context, clipRect);
-        context->restore();
+        frame->tiledBackingStore()->paint(context, rect);
 
         painter->restore();
     }
 }
+#endif
 
 void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip)
 {
@@ -421,45 +327,6 @@
     }
 }
 
-bool QWebFramePrivate::scrollOverflow(int dx, int dy)
-{
-    if (!frame || !frame->document() || !frame->eventHandler())
-        return false;
-
-    Node* node = frame->document()->focusedNode();
-    if (!node)
-        node = frame->document()->elementFromPoint(frame->eventHandler()->currentMousePosition().x(),
-                                                   frame->eventHandler()->currentMousePosition().y());
-    if (!node)
-        return false;
-
-    RenderObject* renderer = node->renderer();
-    if (!renderer)
-        return false;
-
-    if (renderer->isListBox())
-        return false;
-
-    RenderLayer* renderLayer = renderer->enclosingLayer();
-    if (!renderLayer)
-        return false;
-
-    bool scrolledHorizontal = false;
-    bool scrolledVertical = false;
-
-    if (dx > 0)
-        scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
-    else if (dx < 0)
-        scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
-
-    if (dy > 0)
-        scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
-    else if (dy < 0)
-        scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
-
-    return (scrolledHorizontal || scrolledVertical);
-}
-
 /*!
     \class QWebFrame
     \since 4.4
@@ -731,8 +598,8 @@
 
 void QWebFrame::setUrl(const QUrl &url)
 {
-    d->frame->loader()->begin(ensureAbsoluteUrl(url));
-    d->frame->loader()->end();
+    d->frame->loader()->writer()->begin(ensureAbsoluteUrl(url));
+    d->frame->loader()->writer()->end();
     load(ensureAbsoluteUrl(url));
 }
 
@@ -807,6 +674,8 @@
 
 /*!
   The web page that contains this frame.
+
+  \sa pageChanged()
 */
 QWebPage *QWebFrame::page() const
 {
@@ -831,7 +700,7 @@
 
   \a body is optional and is only used for POST operations.
 
-  \note The view remains the same until enough data has arrived to display the new \a url.
+  \note The view remains the same until enough data has arrived to display the new content.
 
   \sa setUrl()
 */
@@ -990,13 +859,13 @@
     if (orientation == Qt::Horizontal) {
         d->horizontalScrollBarPolicy = policy;
         if (d->frame->view()) {
-            d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy, policy != Qt::ScrollBarAsNeeded /* lock */);
             d->frame->view()->updateCanHaveScrollbars();
         }
     } else {
         d->verticalScrollBarPolicy = policy;
         if (d->frame->view()) {
-            d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy, policy != Qt::ScrollBarAsNeeded /* lock */);
             d->frame->view()->updateCanHaveScrollbars();
         }
     }
@@ -1099,55 +968,6 @@
 }
 
 /*!
-  \since 4.7
-  Scrolls nested frames starting at this frame, \a dx pixels to the right 
-  and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts
-  to scroll elements with CSS overflow followed by this frame. If this 
-  frame doesn't scroll, attempts to scroll the parent
-
-  \sa QWebFrame::scroll
-*/
-bool QWebFrame::scrollRecursively(int dx, int dy)
-{
-    bool scrolledHorizontal = false;
-    bool scrolledVertical = false;
-    bool scrolledOverflow = d->scrollOverflow(dx, dy);
-
-    if (!scrolledOverflow) {
-        Frame* frame = d->frame;
-        if (!frame || !frame->view())
-            return false;
-
-        do {
-            IntSize scrollOffset = frame->view()->scrollOffset();
-            IntPoint maxScrollOffset = frame->view()->maximumScrollPosition();
-
-            if (dx > 0) // scroll right
-                scrolledHorizontal = scrollOffset.width() < maxScrollOffset.x();
-            else if (dx < 0) // scroll left
-                scrolledHorizontal = scrollOffset.width() > 0;
-
-            if (dy > 0) // scroll down
-                scrolledVertical = scrollOffset.height() < maxScrollOffset.y();
-            else if (dy < 0) //scroll up
-                scrolledVertical = scrollOffset.height() > 0;
-
-            if (scrolledHorizontal || scrolledVertical) {
-                frame->view()->scrollBy(IntSize(dx, dy));
-                return true;
-            }
-            frame = frame->tree()->parent(); 
-        } while (frame && frame->view());
-    }
-    return (scrolledHorizontal || scrolledVertical || scrolledOverflow);
-}
-
-bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy)
-{
-    return qFrame->scrollRecursively(dx, dy);
-}
-
-/*!
   \property QWebFrame::scrollPosition
   \since 4.5
   \brief the position the frame is currently scrolled to.
@@ -1245,7 +1065,7 @@
 */
 void QWebFrame::setTextSizeMultiplier(qreal factor)
 {
-    d->frame->setZoomFactor(factor, /*isTextOnly*/true);
+    d->frame->setZoomFactor(factor, ZoomTextOnly);
 }
 
 /*!
@@ -1264,7 +1084,7 @@
 
 void QWebFrame::setZoomFactor(qreal factor)
 {
-    d->frame->setZoomFactor(factor, d->frame->isZoomFactorTextOnly());
+    d->frame->setZoomFactor(factor, d->frame->zoomMode());
 }
 
 qreal QWebFrame::zoomFactor() const
@@ -1621,6 +1441,15 @@
 */
 
 /*!
+    \fn void QWebFrame::pageChanged()
+    \since 4.7
+
+    This signal is emitted when this frame has been moved to a different QWebPage.
+
+    \sa page()
+*/
+
+/*!
     \class QWebHitTestResult
     \since 4.4
     \brief The QWebHitTestResult class provides information about the web
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index 68594fd..ecd31de 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -50,6 +50,7 @@
 class QWebElement;
 class QWebElementCollection;
 
+class DumpRenderTreeSupportQt;
 namespace WebCore {
     class WidgetPrivate;
     class FrameLoaderClientQt;
@@ -156,7 +157,6 @@
     QRect scrollBarGeometry(Qt::Orientation orientation) const;
 
     void scroll(int, int);
-    bool scrollRecursively(int, int);
     QPoint scrollPosition() const;
     void setScrollPosition(const QPoint &pos);
 
@@ -222,9 +222,11 @@
     void pageChanged();
 
 private:
+    friend class QGraphicsWebView;
     friend class QWebPage;
     friend class QWebPagePrivate;
     friend class QWebFramePrivate;
+    friend class DumpRenderTreeSupportQt;
     friend class WebCore::WidgetPrivate;
     friend class WebCore::FrameLoaderClientQt;
     friend class WebCore::ChromeClientQt;
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 7d79474..fcc37e7 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -84,9 +84,9 @@
     static QWebFrame* kit(WebCore::Frame*);
 
     void renderRelativeCoords(WebCore::GraphicsContext*, QWebFrame::RenderLayer, const QRegion& clip);
-    void renderContentsLayerAbsoluteCoords(WebCore::GraphicsContext*, const QRegion& clip);
-
-    bool scrollOverflow(int dx, int dy);
+#if ENABLE(TILED_BACKING_STORE)
+    void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip);
+#endif
 
     QWebFrame *q;
     Qt::ScrollBarPolicy horizontalScrollBarPolicy;
diff --git a/WebKit/qt/Api/qwebinspector.cpp b/WebKit/qt/Api/qwebinspector.cpp
index c3ef530..c0e5277 100644
--- a/WebKit/qt/Api/qwebinspector.cpp
+++ b/WebKit/qt/Api/qwebinspector.cpp
@@ -161,6 +161,10 @@
 /*! \reimp */
 void QWebInspector::hideEvent(QHideEvent* event)
 {
+#if ENABLE(INSPECTOR)
+    if (d->page)
+        d->page->d->inspectorController()->close();
+#endif
 }
 
 /*! \reimp */
@@ -168,7 +172,7 @@
 {
 #if ENABLE(INSPECTOR)
     if (d->page)
-        d->page->d->inspectorController()->setWindowVisible(false);
+        d->page->d->inspectorController()->close();
 #endif
 }
 
diff --git a/WebKit/qt/Api/qwebinspector.h b/WebKit/qt/Api/qwebinspector.h
index 6cda479..f192e92 100644
--- a/WebKit/qt/Api/qwebinspector.h
+++ b/WebKit/qt/Api/qwebinspector.h
@@ -52,5 +52,6 @@
     friend class QWebPage;
     friend class QWebPagePrivate;
     friend class WebCore::InspectorClientQt;
+    friend class WebCore::InspectorFrontendClientQt;
 };
 #endif
diff --git a/WebKit/qt/Api/qwebkitglobal.h b/WebKit/qt/Api/qwebkitglobal.h
index 9e8979f..665bf1b 100644
--- a/WebKit/qt/Api/qwebkitglobal.h
+++ b/WebKit/qt/Api/qwebkitglobal.h
@@ -22,6 +22,12 @@
 
 #include <QtCore/qglobal.h>
 
+#define QTWEBKIT_VERSION_STR "2.0.0"
+// QTWEBKIT_VERSION is (major << 16) + (minor << 8) + patch. Similar to Qt.
+#define QTWEBKIT_VERSION 0x020000
+// Use: #if (QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 0, 0)). Similar to Qt.
+#define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
+
 #if defined(QT_MAKEDLL)        /* create a Qt DLL library */
 #  if defined(BUILD_WEBKIT)
 #      define QWEBKIT_EXPORT Q_DECL_EXPORT
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 2a8aced..0e11c15 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -80,6 +80,7 @@
 #include "Cache.h"
 #include "runtime/InitializeThreading.h"
 #include "PageGroup.h"
+#include "NotificationPresenterClientQt.h"
 #include "QWebPageClient.h"
 #include "WorkerThread.h"
 
@@ -119,81 +120,16 @@
 
 using namespace WebCore;
 
-void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
+void QWEBKIT_EXPORT qt_wrt_setViewMode(QWebPage* page, const QString& mode)
 {
-    PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
-
-    Vector<String> paths;
-    String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data());
-    qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths);
-
-    db->setPluginDirectories(paths);
-    db->refresh();
-}
-
-int QWEBKIT_EXPORT qt_drt_workerThreadCount()
-{
-#if ENABLE(WORKERS)
-    return WebCore::WorkerThread::workerThreadCount();
-#else
-    return 0;
-#endif
+    QWebPagePrivate::priv(page)->viewMode = mode;
+    WebCore::Frame* frame = QWebFramePrivate::core(page->mainFrame());
+    WebCore::FrameView* view = frame->view();
+    frame->document()->updateStyleSelector();
+    view->forceLayout();
 }
 
 bool QWebPagePrivate::drtRun = false;
-void QWEBKIT_EXPORT qt_drt_run(bool b)
-{
-    QWebPagePrivate::drtRun = b;
-}
-
-void QWEBKIT_EXPORT qt_drt_setFrameSetFlatteningEnabled(QWebPage* page, bool enabled)
-{
-    QWebPagePrivate::core(page)->settings()->setFrameSetFlatteningEnabled(enabled);
-}
-
-void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName)
-{
-    page->handle()->page->setGroupName(groupName);
-}
-
-QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
-{
-    return page->handle()->page->groupName();
-}
-
-#if ENABLE(INSPECTOR)
-void QWEBKIT_EXPORT qt_drt_webinspector_executeScript(QWebPage* page, long callId, const QString& script)
-{
-    if (!page->handle()->page->inspectorController())
-        return;
-    page->handle()->page->inspectorController()->evaluateForTestInFrontend(callId, script);
-}
-
-void QWEBKIT_EXPORT qt_drt_webinspector_close(QWebPage* page)
-{
-    if (!page->handle()->page->inspectorController())
-        return;
-    page->handle()->page->inspectorController()->close();
-}
-
-void QWEBKIT_EXPORT qt_drt_webinspector_show(QWebPage* page)
-{
-    if (!page->handle()->page->inspectorController())
-        return;
-    page->handle()->page->inspectorController()->show();
-}
-
-void QWEBKIT_EXPORT qt_drt_setTimelineProfilingEnabled(QWebPage* page, bool enabled)
-{
-    InspectorController* controller = page->handle()->page->inspectorController();
-    if (!controller)
-        return;
-    if (enabled)
-        controller->startTimelineProfiler();
-    else
-        controller->stopTimelineProfiler();
-}
-#endif
 
 class QWebPageWidgetClient : public QWebPageClient {
 public:
@@ -203,6 +139,8 @@
         Q_ASSERT(view);
     }
 
+    virtual bool isQWidgetClient() const { return true; }
+
     virtual void scroll(int dx, int dy, const QRect&);
     virtual void update(const QRect& dirtyRect);
     virtual void setInputMethodEnabled(bool enable);
@@ -219,6 +157,7 @@
     virtual QPalette palette() const;
     virtual int screenNumber() const;
     virtual QWidget* ownerWidget() const;
+    virtual QRect geometryRelativeToOwnerWidget() const;
 
     virtual QObject* pluginParent() const;
 
@@ -276,10 +215,8 @@
 int QWebPageWidgetClient::screenNumber() const
 {
 #if defined(Q_WS_X11)
-    if (view)
-        return view->x11Info().screen();
+    return view->x11Info().screen();
 #endif
-
     return 0;
 }
 
@@ -288,6 +225,11 @@
     return view;
 }
 
+QRect QWebPageWidgetClient::geometryRelativeToOwnerWidget() const
+{
+    return view->geometry();
+}
+
 QObject* QWebPageWidgetClient::pluginParent() const
 {
     return view;
@@ -464,11 +406,17 @@
 #ifndef QT_NO_CONTEXTMENU
     currentContextMenu = 0;
 #endif
+    smartInsertDeleteEnabled = false;
+    selectTrailingWhitespaceEnabled = false;
 
     history.d = new QWebHistoryPrivate(page->backForwardList());
     memset(actions, 0, sizeof(actions));
 
     PageGroup::setShouldTrackVisitedLinks(true);
+    
+#if ENABLE(NOTIFICATIONS)    
+    notificationPresenterClient = new NotificationPresenterClientQt();
+#endif
 }
 
 QWebPagePrivate::~QWebPagePrivate()
@@ -481,6 +429,10 @@
 #endif
     delete settings;
     delete page;
+    
+#if ENABLE(NOTIFICATIONS)
+    delete notificationPresenterClient;
+#endif
 }
 
 WebCore::Page* QWebPagePrivate::core(QWebPage* page)
@@ -488,6 +440,11 @@
     return page->d->page;
 }
 
+QWebPagePrivate* QWebPagePrivate::priv(QWebPage* page)
+{
+    return page->d;
+}
+
 bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type)
 {
     if (insideOpenCall
@@ -542,7 +499,10 @@
 QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu,
         const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions)
 {
-    QMenu* menu = new QMenu(q->view());
+    if (!client)
+        return 0;
+
+    QMenu* menu = new QMenu(client->ownerWidget());
     for (int i = 0; i < items->count(); ++i) {
         const ContextMenuItem &item = items->at(i);
         switch (item.type()) {
@@ -591,6 +551,7 @@
 }
 #endif // QT_NO_CONTEXTMENU
 
+#ifndef QT_NO_ACTION
 void QWebPagePrivate::_q_webActionTriggered(bool checked)
 {
     QAction *a = qobject_cast<QAction *>(q->sender());
@@ -599,6 +560,7 @@
     QWebPage::WebAction action = static_cast<QWebPage::WebAction>(a->data().toInt());
     q->triggerAction(action, checked);
 }
+#endif // QT_NO_ACTION
 
 void QWebPagePrivate::_q_cleanupLeakMessages()
 {
@@ -610,6 +572,9 @@
 
 void QWebPagePrivate::updateAction(QWebPage::WebAction action)
 {
+#ifdef QT_NO_ACTION
+    Q_UNUSED(action)
+#else
     QAction *a = actions[action];
     if (!a || !mainFrame)
         return;
@@ -669,6 +634,7 @@
 
     if (a->isCheckable())
         a->setChecked(checked);
+#endif // QT_NO_ACTION
 }
 
 void QWebPagePrivate::updateNavigationActions()
@@ -769,6 +735,11 @@
     if (!frame->view())
         return;
 
+    RefPtr<WebCore::Node> oldNode;
+    Frame* focusedFrame = page->focusController()->focusedFrame();
+    if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
+        oldNode = focusedDocument->focusedNode();
+
     if (tripleClickTimer.isActive()
             && (ev->pos().toPoint() - tripleClick).manhattanLength()
                 < QApplication::startDragDistance()) {
@@ -782,6 +753,14 @@
     if (mev.button() != NoButton)
         accepted = frame->eventHandler()->handleMousePressEvent(mev);
     ev->setAccepted(accepted);
+
+    RefPtr<WebCore::Node> newNode;
+    focusedFrame = page->focusController()->focusedFrame();
+    if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
+        newNode = focusedDocument->focusedNode();
+
+    if (newNode && oldNode != newNode)
+        clickCausedFocus = true;
 }
 
 void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
@@ -791,9 +770,9 @@
         return;
 
     RefPtr<WebCore::Node> oldNode;
-    if (page->focusController()->focusedFrame()
-        && page->focusController()->focusedFrame()->document())
-        oldNode = page->focusController()->focusedFrame()->document()->focusedNode();
+    Frame* focusedFrame = page->focusController()->focusedFrame();
+    if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
+        oldNode = focusedDocument->focusedNode();
 
     if (tripleClickTimer.isActive()
             && (ev->pos() - tripleClick).manhattanLength()
@@ -810,9 +789,9 @@
     ev->setAccepted(accepted);
 
     RefPtr<WebCore::Node> newNode;
-    if (page->focusController()->focusedFrame()
-        && page->focusController()->focusedFrame()->document())
-        newNode = page->focusController()->focusedFrame()->document()->focusedNode();
+    focusedFrame = page->focusController()->focusedFrame();
+    if (Document* focusedDocument = focusedFrame ? focusedFrame->document() : 0)
+        newNode = focusedDocument->focusedNode();
 
     if (newNode && oldNode != newNode)
         clickCausedFocus = true;
@@ -1050,10 +1029,8 @@
         { QKeySequence::SelectEndOfDocument, QWebPage::SelectEndOfDocument },
         { QKeySequence::DeleteStartOfWord, QWebPage::DeleteStartOfWord },
         { QKeySequence::DeleteEndOfWord, QWebPage::DeleteEndOfWord },
-#if QT_VERSION >= 0x040500
         { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator },
         { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator },
-#endif
         { QKeySequence::SelectAll, QWebPage::SelectAll },
         { QKeySequence::UnknownKey, QWebPage::NoWebAction }
     };
@@ -1078,8 +1055,8 @@
     if (!handled) {
         handled = true;
         QFont defaultFont;
-        if (q->view())
-            defaultFont = q->view()->font();
+        if (client)
+            defaultFont = client->ownerWidget()->font();
         QFontMetrics fm(defaultFont);
         if (!handleScrolling(ev, frame)) {
             switch (ev->key()) {
@@ -1294,7 +1271,7 @@
         case QInputMethodEvent::TextFormat: {
             QTextCharFormat textCharFormat = a.value.value<QTextFormat>().toCharFormat();
             QColor qcolor = textCharFormat.underlineColor();
-            underlines.append(CompositionUnderline(a.start, a.length, Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false));
+            underlines.append(CompositionUnderline(qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)), Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false));
             break;
         }
         case QInputMethodEvent::Cursor: {
@@ -1311,8 +1288,8 @@
 #if QT_VERSION >= 0x040600
         case QInputMethodEvent::Selection: {
             if (renderTextControl) {
-                renderTextControl->setSelectionStart(a.start);
-                renderTextControl->setSelectionEnd(a.start + a.length);
+                renderTextControl->setSelectionStart(qMin(a.start, (a.start + a.length)));
+                renderTextControl->setSelectionEnd(qMax(a.start, (a.start + a.length)));
             }
             break;
         }
@@ -1777,7 +1754,7 @@
     : QObject(parent)
     , d(new QWebPagePrivate(this))
 {
-    setView(qobject_cast<QWidget *>(parent));
+    setView(qobject_cast<QWidget*>(parent));
 
     connect(this, SIGNAL(loadProgress(int)), this, SLOT(_q_onLoadProgressChanged(int)));
 #ifndef NDEBUG
@@ -1861,21 +1838,28 @@
 
     \sa view()
 */
-void QWebPage::setView(QWidget *view)
+void QWebPage::setView(QWidget* view)
 {
-    if (this->view() != view) {
-        d->view = view;
-        if (!view) {
-            delete d->client;
-            d->client = 0;
-        } else {
-            if (!d->client) 
-                d->client = new QWebPageWidgetClient(view);
-            else
-                static_cast<QWebPageWidgetClient*>(d->client)->view = view;
-        }
-        setViewportSize(view ? view->size() : QSize(0, 0));
+    if (this->view() == view)
+        return;
+
+    d->view = view;
+    setViewportSize(view ? view->size() : QSize(0, 0));
+
+    // If we have no client, we install a special client delegating
+    // the responsibility to the QWidget. This is the code path
+    // handling a.o. the "legacy" QWebView.
+    //
+    // If such a special delegate already exist, we substitute the view.
+
+    if (d->client) {
+        if (d->client->isQWidgetClient())
+            static_cast<QWebPageWidgetClient*>(d->client)->view = view;
+        return;
     }
+
+    if (view)
+        d->client = new QWebPageWidgetClient(view);
 }
 
 /*!
@@ -1916,7 +1900,8 @@
 {
     Q_UNUSED(frame)
 #ifndef QT_NO_MESSAGEBOX
-    QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Ok);
+    QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+    QMessageBox::information(parent, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Ok);
 #endif
 }
 
@@ -1932,7 +1917,8 @@
 #ifdef QT_NO_MESSAGEBOX
     return true;
 #else
-    return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Yes, QMessageBox::No);
+    QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+    return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QMessageBox::Yes, QMessageBox::No);
 #endif
 }
 
@@ -1951,7 +1937,8 @@
     Q_UNUSED(frame)
     bool ok = false;
 #ifndef QT_NO_INPUTDIALOG
-    QString x = QInputDialog::getText(view(), tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QLineEdit::Normal, defaultValue, &ok);
+    QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+    QString x = QInputDialog::getText(parent, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), Qt::escape(msg), QLineEdit::Normal, defaultValue, &ok);
     if (ok && result)
         *result = x;
 #endif
@@ -1976,7 +1963,8 @@
 #ifdef QT_NO_MESSAGEBOX
     return false;
 #else
-    return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
+    QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+    return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
 #endif
 }
 
@@ -1995,7 +1983,7 @@
 */
 QWebPage *QWebPage::createWindow(WebWindowType type)
 {
-    QWebView *webView = qobject_cast<QWebView *>(view());
+    QWebView *webView = qobject_cast<QWebView*>(view());
     if (webView) {
         QWebView *newView = webView->createWindow(type);
         if (newView)
@@ -2260,6 +2248,7 @@
     return d->page->focusController()->focusedOrMainFrame()->selectedText();
 }
 
+#ifndef QT_NO_ACTION
 /*!
    Returns a QAction for the specified WebAction \a action.
 
@@ -2279,7 +2268,7 @@
 
     QString text;
     QIcon icon;
-    QStyle *style = view() ? view()->style() : qApp->style();
+    QStyle *style = d->client ? d->client->style() : qApp->style();
     bool checkable = false;
 
     switch (action) {
@@ -2532,6 +2521,7 @@
     d->updateAction(action);
     return a;
 }
+#endif // QT_NO_ACTION
 
 /*!
     \property QWebPage::modified
@@ -2801,6 +2791,7 @@
 */
 void QWebPage::updatePositionDependentActions(const QPoint &pos)
 {
+#ifndef QT_NO_ACTION
     // First we disable all actions, but keep track of which ones were originally enabled.
     QBitArray originallyEnabledWebActions(QWebPage::WebActionCount);
     for (int i = ContextMenuItemTagNoAction; i < ContextMenuItemBaseApplicationTag; ++i) {
@@ -2810,6 +2801,7 @@
             a->setEnabled(false);
         }
     }
+#endif // QT_NO_ACTION
 
     d->createMainFrame();
     WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
@@ -2836,6 +2828,7 @@
     d->currentContextMenu = d->createContextMenu(&menu, menu.platformDescription(), &visitedWebActions);
 #endif // QT_NO_CONTEXTMENU
 
+#ifndef QT_NO_ACTION
     // Finally, we restore the original enablement for the actions that were not put into the menu.
     originallyEnabledWebActions &= ~visitedWebActions; // Mask out visited actions (they're part of the menu)
     for (int i = 0; i < QWebPage::WebActionCount; ++i) {
@@ -2844,6 +2837,7 @@
                 a->setEnabled(true);
         }
     }
+#endif // QT_NO_ACTION
 
     // This whole process ensures that any actions put into to the context menu has the right
     // enablement, while also keeping the correct enablement for actions that were left out of
@@ -2976,7 +2970,8 @@
     if (extension == ChooseMultipleFilesExtension) {
         // FIXME: do not ignore suggestedFiles
         QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames;
-        QStringList names = QFileDialog::getOpenFileNames(view(), QString::null);
+        QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+        QStringList names = QFileDialog::getOpenFileNames(parent, QString::null);
         static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names;
         return true;
     }
@@ -3058,7 +3053,8 @@
 {
     Q_UNUSED(parentFrame)
 #ifndef QT_NO_FILEDIALOG
-    return QFileDialog::getOpenFileName(view(), QString::null, suggestedFile);
+    QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
+    return QFileDialog::getOpenFileName(parent, QString::null, suggestedFile);
 #else
     return QString::null;
 #endif
@@ -3129,6 +3125,8 @@
 
     "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
 
+    On mobile platforms such as Symbian S60 and Maemo, "Mobile Safari" is used instead of "Safari".
+
     In this string the following values are replaced at run-time:
     \list
     \o %Platform% and %Subplatform% are expanded to the windowing system and the operation system.
@@ -3336,8 +3334,8 @@
 
     // Language
     QLocale locale;
-    if (view())
-        locale = view()->locale();
+    if (d->client && d->client->ownerWidget())
+        locale = d->client->ownerWidget()->locale();
     QString name = locale.name();
     name[2] = QLatin1Char('-');
     ua.append(name);
@@ -3360,9 +3358,11 @@
         ua.append(QLatin1String(qVersion()));
     }
 
-    ua.append(QString(QLatin1String(" Safari/%1"))
-                      .arg(qWebKitVersion()));
-
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+    ua.append(QString(QLatin1String(" Mobile Safari/%1")).arg(qWebKitVersion()));
+#else
+    ua.append(QString(QLatin1String(" Safari/%1")).arg(qWebKitVersion()));
+#endif
     return ua;
 }
 
@@ -3515,7 +3515,11 @@
 /*!
     \fn void QWebPage::unsupportedContent(QNetworkReply *reply)
 
-    This signal is emitted when WebKit cannot handle a link the user navigated to.
+    This signal is emitted when WebKit cannot handle a link the user navigated to or a
+    web server's response includes a "Content-Disposition" header with the 'attachment' 
+    directive. If "Content-Disposition" is present in \a reply, the web server is indicating
+    that the client should prompt the user to save the content regardless of content-type. 
+    See RFC 2616 sections 19.5.1 for details about Content-Disposition.
 
     At signal emission time the meta-data of the QNetworkReply \a reply is available.
 
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index 4766cbd..c085fd7 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -54,6 +54,8 @@
     class EditorClientQt;
     class FrameLoaderClientQt;
     class InspectorClientQt;
+    class InspectorFrontendClientQt;
+    class NotificationPresenterClientQt;
     class ResourceHandle;
     class HitTestResult;
     class QNetworkReplyHandler;
@@ -219,7 +221,9 @@
 
     QString selectedText() const;
 
+#ifndef QT_NO_ACTION
     QAction *action(WebAction action) const;
+#endif
     virtual void triggerAction(WebAction action, bool checked = false);
 
     QSize viewportSize() const;
@@ -347,7 +351,9 @@
 
 private:
     Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int))
+#ifndef QT_NO_ACTION
     Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
+#endif
     Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages())
 
     QWebPagePrivate *d;
@@ -355,14 +361,19 @@
     friend class QWebFrame;
     friend class QWebPagePrivate;
     friend class QWebView;
+    friend class QWebViewPrivate;
     friend class QGraphicsWebView;
+    friend class QGraphicsWebViewPrivate;
     friend class QWebInspector;
     friend class WebCore::ChromeClientQt;
     friend class WebCore::EditorClientQt;
     friend class WebCore::FrameLoaderClientQt;
     friend class WebCore::InspectorClientQt;
+    friend class WebCore::InspectorFrontendClientQt;
+    friend class WebCore::NotificationPresenterClientQt;
     friend class WebCore::ResourceHandle;
     friend class WebCore::QNetworkReplyHandler;
+    friend class DumpRenderTreeSupportQt;
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(QWebPage::FindFlags)
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 15ddfb2..f40053b 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -44,6 +44,7 @@
     class EditorClientQt;
     class Element;
     class InspectorController;
+    class NotificationPresenterClientQt;
     class Node;
     class Page;
     class Frame;
@@ -64,6 +65,7 @@
     ~QWebPagePrivate();
 
     static WebCore::Page* core(QWebPage*);
+    static QWebPagePrivate* priv(QWebPage*);
 
     void createMainFrame();
 #ifndef QT_NO_CONTEXTMENU
@@ -162,6 +164,8 @@
     QNetworkAccessManager *networkManager;
 
     bool forwardUnsupportedContent;
+    bool smartInsertDeleteEnabled;
+    bool selectTrailingWhitespaceEnabled;
     QWebPage::LinkDelegationPolicy linkPolicy;
 
     QSize viewportSize;
@@ -184,6 +188,10 @@
     QWebInspector* inspector;
     bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
     Qt::DropAction m_lastDropAction;
+    
+    WebCore::NotificationPresenterClientQt* notificationPresenterClient;
+
+    QString viewMode;
 
     static bool drtRun;
 };
diff --git a/WebKit/qt/Api/qwebsecurityorigin.cpp b/WebKit/qt/Api/qwebsecurityorigin.cpp
index 6c26bd7..b69f24d 100644
--- a/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -30,21 +30,6 @@
 
 using namespace WebCore;
 
-void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
-{
-    SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
-}
-
-void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists()
-{
-    SecurityOrigin::resetOriginAccessWhiteLists();
-}
-
-void QWEBKIT_EXPORT qt_drt_setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
-{
-    SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
-}
-
 /*!
     \class QWebSecurityOrigin
     \since 4.5
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index d60f09c..1dff037 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -26,6 +26,7 @@
 
 #include "Cache.h"
 #include "CrossOriginPreflightResultCache.h"
+#include "Database.h"
 #include "FontCache.h"
 #include "Page.h"
 #include "PageCache.h"
@@ -73,6 +74,7 @@
     QString localStoragePath;
     QString offlineWebApplicationCachePath;
     qint64 offlineStorageDefaultQuota;
+    QUrl inspectorLocation;
 
     void apply();
     WebCore::Settings* settings;
@@ -158,6 +160,13 @@
 
         settings->setAcceleratedCompositingEnabled(value);
 #endif
+#if ENABLE(3D_CANVAS)
+        value = attributes.value(QWebSettings::WebGLEnabled,
+                                 global->attributes.value(QWebSettings::WebGLEnabled));
+
+        settings->setWebGLEnabled(value);
+#endif
+ 
         value = attributes.value(QWebSettings::JavascriptCanOpenWindows,
                                       global->attributes.value(QWebSettings::JavascriptCanOpenWindows));
         settings->setJavaScriptCanOpenWindowsAutomatically(value);
@@ -174,6 +183,10 @@
                                       global->attributes.value(QWebSettings::PrivateBrowsingEnabled));
         settings->setPrivateBrowsingEnabled(value);
 
+        value = attributes.value(QWebSettings::SpatialNavigationEnabled,
+                                      global->attributes.value(QWebSettings::SpatialNavigationEnabled));
+        settings->setSpatialNavigationEnabled(value);
+
         value = attributes.value(QWebSettings::JavascriptCanAccessClipboard,
                                       global->attributes.value(QWebSettings::JavascriptCanAccessClipboard));
         settings->setDOMPasteAllowed(value);
@@ -182,6 +195,10 @@
                                       global->attributes.value(QWebSettings::DeveloperExtrasEnabled));
         settings->setDeveloperExtrasEnabled(value);
 
+        value = attributes.value(QWebSettings::FrameFlatteningEnabled,
+                                      global->attributes.value(QWebSettings::FrameFlatteningEnabled));
+        settings->setFrameFlatteningEnabled(value);
+
         QUrl location = !userStyleSheetLocation.isEmpty() ? userStyleSheetLocation : global->userStyleSheetLocation;
         settings->setUserStyleSheetLocation(WebCore::KURL(location));
 
@@ -193,15 +210,17 @@
 
         value = attributes.value(QWebSettings::ZoomTextOnly,
                                  global->attributes.value(QWebSettings::ZoomTextOnly));
-        settings->setZoomsTextOnly(value);
+        settings->setZoomMode(value ? WebCore::ZoomTextOnly : WebCore::ZoomPage);
 
         value = attributes.value(QWebSettings::PrintElementBackgrounds,
                                       global->attributes.value(QWebSettings::PrintElementBackgrounds));
         settings->setShouldPrintBackgrounds(value);
 
+#if ENABLE(DATABASE)
         value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled,
                                       global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled));
-        settings->setDatabasesEnabled(value);
+        WebCore::Database::setIsAvailable(value);
+#endif
 
         value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled,
                                       global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
@@ -219,10 +238,16 @@
                                       global->attributes.value(QWebSettings::LocalContentCanAccessFileUrls));
         settings->setAllowFileAccessFromFileURLs(value);
 
-        value = attributes.value(QWebSettings::XSSAuditorEnabled,
-                                      global->attributes.value(QWebSettings::XSSAuditorEnabled));
+        value = attributes.value(QWebSettings::XSSAuditingEnabled,
+                                      global->attributes.value(QWebSettings::XSSAuditingEnabled));
         settings->setXSSAuditorEnabled(value);
 
+#if ENABLE(TILED_BACKING_STORE)
+        value = attributes.value(QWebSettings::TiledBackingStoreEnabled,
+                                      global->attributes.value(QWebSettings::TiledBackingStoreEnabled));
+        settings->setTiledBackingStoreEnabled(value);
+#endif
+
         settings->setUsesPageCache(WebCore::pageCache()->capacity());
     } else {
         QList<QWebSettingsPrivate*> settings = *::allSettings();
@@ -326,6 +351,7 @@
     \value MissingPluginGraphic The replacement graphic shown when a plugin could not be loaded.
     \value DefaultFrameIconGraphic The default icon for QWebFrame::icon().
     \value TextAreaSizeGripCornerGraphic The graphic shown for the size grip of text areas.
+    \value DeleteButtonGraphic The graphic shown for the WebKit-Editing-Delete-Button in Deletion UI.
 */
 
 /*!
@@ -352,6 +378,13 @@
         Currently this enables the "Inspect" element in the context menu as
         well as the use of QWebInspector which controls the WebKit WebInspector
         for web site debugging.
+    \value SpatialNavigationEnabled Enables or disables the Spatial Navigation
+        feature, which consists in the ability to navigate between focusable
+        elements in a Web page, such as hyperlinks and form controls, by using
+        Left, Right, Up and Down arrow keys. For example, if an user presses the
+        Right key, heuristics determine whether there is an element he might be
+        trying to reach towards the right, and if there are multiple elements,
+        which element he probably wants.
     \value LinksIncludedInFocusChain Specifies whether hyperlinks should be
         included in the keyboard focus chain.
     \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
@@ -367,8 +400,25 @@
     \value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use
         QWebSettings::LocalStorageEnabled instead.
     \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
-    \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are allowed to access other local  urls.
-    \value XSSAuditorEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
+    \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are allowed to access other local urls.
+    \value XSSAuditingEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
+    \value AcceleratedCompositingEnabled This feature, when used in conjunction with
+        QGraphicsWebView, accelerates animations of web content. CSS animations of the transform and
+        opacity properties will be rendered by composing the cached content of the animated elements.
+        This feature is enabled by default
+    \value TiledBackingStoreEnabled This setting enables the tiled backing store feature
+        for a QGraphicsWebView. With the tiled backing store enabled, the web page contents in and around
+        the current visible area is speculatively cached to bitmap tiles. The tiles are automatically kept
+        in sync with the web page as it changes. Enabling tiling can significantly speed up painting heavy 
+        operations like scrolling. Enabling the feature increases memory consumption. It does not work well 
+        with contents using CSS fixed positioning (see also \l{QGraphicsWebView::}{resizesToContents} property).
+        \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily freeze the contents of the backing store.
+    \value FrameFlatteningEnabled With this setting each subframe is expanded to its contents.
+        On touch devices, it is desired to not have any scrollable sub parts of the page
+        as it results in a confusing user experience, with scrolling sometimes scrolling sub parts
+        and at other times scrolling the page itself. For this reason iframes and framesets are
+        barely usable on touch devices. This will flatten all the frames to become one scrollable page.
+        Disabled by default.
 */
 
 /*!
@@ -392,6 +442,7 @@
     d->attributes.insert(QWebSettings::AutoLoadImages, true);
     d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false);
     d->attributes.insert(QWebSettings::JavascriptEnabled, true);
+    d->attributes.insert(QWebSettings::SpatialNavigationEnabled, false);
     d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true);
     d->attributes.insert(QWebSettings::ZoomTextOnly, false);
     d->attributes.insert(QWebSettings::PrintElementBackgrounds, true);
@@ -400,7 +451,10 @@
     d->attributes.insert(QWebSettings::LocalStorageEnabled, false);
     d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false);
     d->attributes.insert(QWebSettings::LocalContentCanAccessFileUrls, true);
-    d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, false);
+    d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true);
+    d->attributes.insert(QWebSettings::WebGLEnabled, false);
+    d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false);
+    d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false);
     d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
     d->defaultTextEncoding = QLatin1String("iso-8859-1");
 }
@@ -469,7 +523,8 @@
     The \a location must be either a path on the local filesystem, or a data URL
     with UTF-8 and Base64 encoded data, such as:
 
-    "data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;"
+    "data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow=="
+    NOTE: In case the base 64 data is not valid the style will not be applied.
 
     \sa userStyleSheetUrl()
 */
@@ -902,6 +957,8 @@
 void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize)
 {
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    WebCore::cacheStorage().empty();
+    WebCore::cacheStorage().vacuumDatabaseFile();
     WebCore::cacheStorage().setMaximumSize(maximumSize);
 #endif
 }
@@ -941,6 +998,31 @@
 }
 
 /*!
+    \since 4.7
+
+    Specifies the \a location of a frontend to load with each web page when using Web Inspector.
+
+    \sa inspectorUrl()
+*/
+void QWebSettings::setInspectorUrl(const QUrl& location)
+{
+    d->inspectorLocation = location;
+    d->apply();
+}
+
+/*!
+    \since 4.7
+
+    Returns the location of the Web Inspector frontend.
+
+    \sa setInspectorUrl()
+*/
+QUrl QWebSettings::inspectorUrl() const
+{
+    return d->inspectorLocation;
+}
+
+/*!
     \since 4.6
     \relates QWebSettings
 
@@ -969,8 +1051,9 @@
     QString storagePath;
 
     if (path.isEmpty()) {
+#ifndef QT_NO_DESKTOPSERVICES
         storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-
+#endif
         if (storagePath.isEmpty())
             storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
     } else
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index b1f5cf2..bd728d8 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -67,10 +67,14 @@
         LocalStorageDatabaseEnabled = LocalStorageEnabled,
 #endif
         LocalContentCanAccessRemoteUrls,
-        LocalContentCanAccessFileUrls,
         DnsPrefetchEnabled,
-        XSSAuditorEnabled,
-        AcceleratedCompositingEnabled
+        XSSAuditingEnabled,
+        AcceleratedCompositingEnabled,
+        WebGLEnabled,
+        SpatialNavigationEnabled,
+        LocalContentCanAccessFileUrls,
+        TiledBackingStoreEnabled,
+        FrameFlatteningEnabled
     };
     enum WebGraphic {
         MissingImageGraphic,
@@ -133,6 +137,9 @@
     void setLocalStoragePath(const QString& path);
     QString localStoragePath() const; 
 
+    void setInspectorUrl(const QUrl &location);
+    QUrl inspectorUrl() const;
+
     static void clearMemoryCaches();
 
     static void enablePersistentStorage(const QString& path = QString());
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 79c16c7..3ba1678 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -45,6 +45,7 @@
     }
 
     void _q_pageDestroyed();
+    void unsetPageIfExists();
 
     QWebView *view;
     QWebPage *page;
@@ -347,6 +348,29 @@
     return d->page;
 }
 
+void QWebViewPrivate::unsetPageIfExists()
+{
+    if (!page)
+        return;
+
+    // if the page client is the special client constructed for
+    // delegating the responsibilities to a QWidget, we need
+    // to destroy it.
+
+    if (page->d->client && page->d->client->isQWidgetClient())
+        delete page->d->client;
+
+    page->d->client = 0;
+
+    // if the page was created by us, we own it and need to
+    // destroy it as well.
+
+    if (page->parent() == view)
+        delete page;
+    else
+        page->disconnect(view);
+}
+
 /*!
     Makes \a page the new web page of the web view.
 
@@ -360,14 +384,10 @@
 {
     if (d->page == page)
         return;
-    if (d->page) {
-        d->page->d->client = 0; // unset the page client
-        if (d->page->parent() == this)
-            delete d->page;
-        else
-            d->page->disconnect(this);
-    }
+
+    d->unsetPageIfExists();
     d->page = page;
+
     if (d->page) {
         d->page->setView(this);
         d->page->setPalette(palette());
@@ -397,9 +417,6 @@
                 this, SLOT(_q_pageDestroyed()));
     }
     setAttribute(Qt::WA_OpaquePaintEvent, d->page);
-#if USE(ACCELERATED_COMPOSITING)
-    d->page->d->page->settings()->setAcceleratedCompositingEnabled(false);
-#endif
     update();
 }
 
@@ -565,6 +582,7 @@
     return QString();
 }
 
+#ifndef QT_NO_ACTION
 /*!
     Returns a pointer to a QAction that encapsulates the specified web action \a action.
 */
@@ -572,6 +590,7 @@
 {
     return page()->action(action);
 }
+#endif
 
 /*!
     Triggers the specified \a action. If it is a checkable action the specified
diff --git a/WebKit/qt/Api/qwebview.h b/WebKit/qt/Api/qwebview.h
index f681fbc..1d651d5 100644
--- a/WebKit/qt/Api/qwebview.h
+++ b/WebKit/qt/Api/qwebview.h
@@ -75,7 +75,9 @@
 
     QString selectedText() const;
 
+#ifndef QT_NO_ACTION
     QAction* pageAction(QWebPage::WebAction action) const;
+#endif
     void triggerPageAction(QWebPage::WebAction action, bool checked = false);
 
     bool isModified() const;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index fb832b3..54f5f65 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,1607 @@
+2010-04-21  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        List item markers are not always updated after changes in the DOM.
+        https://bugs.webkit.org/show_bug.cgi?id=37060
+
+        * Api/qwebelement.h: Make DumpRenderTreeSupportQt a friend class.
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::markerTextForListItem): Add a private API to get the marker text for a list item.
+
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Check the request empty or not in ChromeClientQt::createWindow()
+        https://bugs.webkit.org/show_bug.cgi?id=37821
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::createWindow):
+
+2010-04-21  Shu Chang  <chang.shu@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix Symbian build where QT_NO_SYSTEMTRAYICON is defined.
+        https://bugs.webkit.org/show_bug.cgi?id=37442
+
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (NotificationPresenterClientQt::show):
+        * WebCoreSupport/NotificationPresenterClientQt.h:
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r57963.
+        http://trac.webkit.org/changeset/57963
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        Three tests started crashing on the Qt bot.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::isCommandEnabled):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-04-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        Reviewed by Simon Fraser.
+
+        [Qt] Fix or remove the runtime flag for accelerated compositing.
+        https://bugs.webkit.org/show_bug.cgi?id=37313
+
+        This lets the QWebPageClient "veto" the settings value for accelerated compositing.
+        In this case we allow accelerated compositing only on QGraphicsWebView.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::allowsAcceleratedCompositing):
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::allowsAcceleratedCompositing):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed build fix.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setUrl):
+
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::finishedLoading):
+        (WebCore::FrameLoaderClientQt::setMainDocumentError):
+        (WebCore::FrameLoaderClientQt::committedLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::chooseIconForFiles):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-04-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix compilation against namespaced Qt.
+
+        * WebCoreSupport/ChromeClientQt.h:
+        * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-04-18  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add support for LayoutTestController commands:
+                   setSmartInsertDeleteEnabled
+                   setSelectTrailingWhitespaceEnabled
+                   execCommand
+                   isCommandEnabled
+
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled):
+        (DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled):
+        (DumpRenderTreeSupportQt::executeCoreCommandByName):
+        (DumpRenderTreeSupportQt::isCommandEnabled):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::smartInsertDeleteEnabled):
+        (WebCore::EditorClientQt::toggleSmartInsertDelete):
+        (WebCore::EditorClientQt::isSelectTrailingWhitespaceEnabled):
+        * WebCoreSupport/EditorClientQt.h:
+
+2010-04-15  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Mark QWebFrame::overloadedSlots autotest as expected failure
+
+        https://bugs.webkit.org/show_bug.cgi?id=37319
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-04-09  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Kenneth Christiansen and Tor Arne Vestbø.
+
+        REGRESSION(r56552): Broken scrollbars size
+        https://bugs.webkit.org/show_bug.cgi?id=36853
+
+        The regression was caused by r56552, which introduced a fix to bug
+        webkit.org/b/21300. The bug solved an issue with the resize handle on mac,
+        but did it in a way that affected all Qt platforms and thus broke the behavior
+        on non-mac platforms.
+
+        This patch makes the mac specific change ifdef'ed and only applied for the mac
+        platform.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::windowResizerRect):
+
+2010-04-15  Bruno Schmidt  <bruno.schmidt@gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Null QObjects properties cause Segmentation Fault
+        https://bugs.webkit.org/show_bug.cgi?id=34730
+
+        QObjects exported to the QWebkit javascript with properties that are
+        a null "QObject*" cause Segmentation Fault.
+
+        If an QObject is added to the javascript context and it contains
+        properties of the type QObject* with NULL value, calling the property
+        causes Segmentation Fault.
+
+        Follow the tests for the corrections done over WebCore.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (MyQObject::MyQObject): init the field m_objectStar
+        (MyQObject::objectStarProperty): read the Object* prop
+        (MyQObject::setObjectStarProperty): write the Object* prop
+        (tst_QWebFrame::getSetStaticProperty): new tests for the new prop
+
+2010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Changing view mode names due to specification changes
+        https://bugs.webkit.org/show_bug.cgi?id=37615
+
+        test: fast/media/media-feature-wgt-view-mode.html
+
+        specification: http://dev.w3.org/2006/waf/widgets-vmmf/
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::isWindowed):
+        (WebCore::ChromeClientQt::isFullscreen):
+        (WebCore::ChromeClientQt::isMaximized):
+        (WebCore::ChromeClientQt::isMinimized):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Moving setViewMode from DumpRenderTreeSupportQt to qwebpage.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37622
+
+        Method qt_wrt_setViewMode was removed from qwebpage.cpp by mistake in r57433
+        (bug 35844). Moving it back.
+
+        * Api/qwebpage.cpp:
+        (qt_wrt_setViewMode):
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::setMediaType):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-04-14  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Rendering artifacts on Qt plugins when scrolling the page
+        https://bugs.webkit.org/show_bug.cgi?id=37152
+
+        Because we no longer repaint the entire viewport on scroll,
+        we must trigger a repaint of QtPluginWidgets when their geometry changes.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+
+2010-04-14  Aaron Boodman  <aa@chromium.org>
+
+        Reviewed by David Levin.
+
+        Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting
+        the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are
+        unsupported. Fixed by resolving the relative URL first.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36623
+
+        Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows.
+
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (NotificationPresenterClientQt::show): Return type of NotificationContents::iconURL() changed.
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::whiteListAccessFromOrigin):
+        (DumpRenderTreeSupportQt::resetOriginAccessWhiteLists):
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::finishedLoading):
+        (WebCore::FrameLoaderClientQt::setMainDocumentError):
+        (WebCore::FrameLoaderClientQt::committedLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::finishedLoading):
+        (WebCore::FrameLoaderClientQt::setMainDocumentError):
+        (WebCore::FrameLoaderClientQt::committedLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+
+2010-04-11  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add setWillSendRequestReturnsNull and setWillSendRequestClearHeader
+
+        https://bugs.webkit.org/show_bug.cgi?id=37410
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (qt_set_will_send_request_returns_null):
+        (qt_set_will_send_request_clear_headers):
+        (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+
+2010-04-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Refactor Qt DRT support in QtWebKit
+
+        Move all QT DRT support functions to a static class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * Api/qwebframe.cpp: Remove static functions.
+        * Api/qwebframe.h: Make DumpRenderTreeSupportQt a friend.
+        * Api/qwebpage.cpp: Remove static functions.
+        * Api/qwebpage.h: Make DumpRenderTreeSupportQt a friend.
+        * Api/qwebsecurityorigin.cpp: Remove static functions.
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp: Added.
+        (DumpRenderTreeSupportQt::DumpRenderTreeSupportQt):
+        (DumpRenderTreeSupportQt::~DumpRenderTreeSupportQt):
+        (DumpRenderTreeSupportQt::overwritePluginDirectories):
+        (DumpRenderTreeSupportQt::workerThreadCount):
+        (DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled):
+        (DumpRenderTreeSupportQt::setFrameFlatteningEnabled):
+        (DumpRenderTreeSupportQt::webPageSetGroupName):
+        (DumpRenderTreeSupportQt::webPageGroupName):
+        (DumpRenderTreeSupportQt::webInspectorExecuteScript):
+        (DumpRenderTreeSupportQt::webInspectorClose):
+        (DumpRenderTreeSupportQt::webInspectorShow):
+        (DumpRenderTreeSupportQt::setTimelineProfilingEnabled):
+        (DumpRenderTreeSupportQt::hasDocumentElement):
+        (DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled):
+        (DumpRenderTreeSupportQt::pauseAnimation):
+        (DumpRenderTreeSupportQt::pauseTransitionOfProperty):
+        (DumpRenderTreeSupportQt::pauseSVGAnimation):
+        (DumpRenderTreeSupportQt::numberOfActiveAnimations):
+        (DumpRenderTreeSupportQt::clearFrameName):
+        (DumpRenderTreeSupportQt::javaScriptObjectsCount):
+        (DumpRenderTreeSupportQt::garbageCollectorCollect):
+        (DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread):
+        (DumpRenderTreeSupportQt::counterValueForElementById):
+        (DumpRenderTreeSupportQt::pageNumberForElementById):
+        (DumpRenderTreeSupportQt::numberOfPages):
+        (DumpRenderTreeSupportQt::suspendActiveDOMObjects):
+        (DumpRenderTreeSupportQt::resumeActiveDOMObjects):
+        (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld):
+        (DumpRenderTreeSupportQt::whiteListAccessFromOrigin):
+        (DumpRenderTreeSupportQt::resetOriginAccessWhiteLists):
+        (DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme):
+        (DumpRenderTreeSupportQt::setCaretBrowsingEnabled):
+        (DumpRenderTreeSupportQt::setMediaType):
+        (DumpRenderTreeSupportQt::setViewMode):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h: Added.
+        * WebCoreSupport/EditorClientQt.h:
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::multiplePageGroupsAndLocalStorage):
+        (tst_QWebPage::inputMethodsTextFormat):
+        (tst_QWebPage::protectBindingsRuntimeObjectsFromCollector):
+
+2010-04-11  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Update layoutTestController.DumpResourceLoadCallbacks to match other ports.
+
+        Unskip  http/tests/xmlhttprequest/abort-should-cancel-load.html
+                http/tests/misc/will-send-request-returns-null-on-redirect.html
+                fast/loader/user-style-sheet-resource-load-callbacks.html
+                http/tests/misc/window-dot-stop.html
+                http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html
+                http/tests/security/XFrameOptions/x-frame-options-deny.html
+                http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html
+                http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
+                http/tests/xmlhttprequest/abort-should-cancel-load.html
+
+        QNetworkReply::OperationCanceledError has a value of 5, so update expected results accordingly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37237
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (qt_set_will_send_request_returns_null_on_redirect):
+        (drtDescriptionSuitableForTestResult):
+        (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
+        (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+
+2010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement Desktop Notifications API for QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35503
+
+        Map WebKit notifications to Qt's SystemTray API and
+        implement DRT tracing.
+
+        This patch does not implement the security part of
+        WebKit notifications.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        * Api/qwebpage.h:
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::notificationPresenter):
+        * WebCoreSupport/ChromeClientQt.h:
+        * WebCoreSupport/NotificationPresenterClientQt.cpp: Added.
+        (qt_dump_notification):
+        (NotificationPresenterClientQt::NotificationPresenterClientQt):
+        (NotificationPresenterClientQt::show):
+        (NotificationPresenterClientQt::cancel):
+        (NotificationPresenterClientQt::notificationObjectDestroyed):
+        (NotificationPresenterClientQt::requestPermission):
+        (NotificationPresenterClientQt::checkPermission):
+        * WebCoreSupport/NotificationPresenterClientQt.h: Added.
+
+2010-04-09  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt]Fix compile error with QT_NO_IM
+        https://bugs.webkit.org/show_bug.cgi?id=36533
+
+        * WebCoreSupport/QtFallbackWebPopup.cpp:
+        (WebCore::QtFallbackWebPopupCombo::hidePopup):
+
+2010-04-09  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] tst_QWebFrame::popupFocus() fails
+        https://bugs.webkit.org/show_bug.cgi?id=37320
+
+        The QWebPopup class has been moved & renamed, so tst_QWebFrame::popupFocus() should use
+        the class name "QComboBox", rather than "WebCore::QWebPopup" to find the popup menu.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-04-09  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Holger Freyther.
+
+        Removing the use of topLevelWidget of QWidget class since it is deprecated/obsolete
+        since Qt 4.5. window() method is being used instead now.
+
+        See http://doc.trolltech.com/4.5/qwidget-obsolete.html#topLevelWidget for more info.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::windowRect):
+        (WebCore::ChromeClientQt::show):
+        (WebCore::ChromeClientQt::windowResizerRect):
+
+2010-04-09  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix compile error with QT_NO_ACTION
+        https://bugs.webkit.org/show_bug.cgi?id=36529
+
+        Make sure QT_NO_ACTION is not defined to use QAction
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::pageAction):
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::updateAction):
+        (QWebPage::updatePositionDependentActions):
+        * Api/qwebpage.h:
+        * Api/qwebview.cpp:
+        * Api/qwebview.h:
+
+2010-04-09  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Lars Knoll.
+
+        [Qt] tests/qgraphicswebview fails
+        https://bugs.webkit.org/show_bug.cgi?id=37317
+
+        * Api/qwebpage.cpp:
+        (QWebPage::userAgentForUrl): Don't crash if the ownerWidget is null.
+
+2010-04-08  Benjamin Poulain  <benjamin.poulain@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Warnings when compiling InspectorClientQt.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37266
+
+        Add a default: for the switch()-case to avoid
+        warnings.
+
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::variantToSetting):
+
+2010-04-01  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by David Hyatt.
+
+        [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+        https://bugs.webkit.org/show_bug.cgi?id=29431
+
+        Make use of the new lock parameter of set{Vertical,Horizontal}ScrollbarMode.
+
+        Always added a qt auto test for set scrollbar policy feature.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setScrollBarPolicy):
+        * tests/qwebframe/tst_qwebframe.cpp:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2010-04-08  Joe Ligman  <joseph.ligman@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] WebKit crashes while input text through input method.
+        The formatted text underline painting crashes when painting with invalid indexes.
+        https://bugs.webkit.org/show_bug.cgi?id=36870
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::inputMethodEvent):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::inputMethodsTextFormat_data):
+        (tst_QWebPage::inputMethodsTextFormat):
+
+2010-04-08  Joe Ligman  <joseph.ligman@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] qtwebkit_webframe_scrollRecursively scrolls when body.style.overflow="hidden"
+        https://bugs.webkit.org/show_bug.cgi?id=36674
+
+        The scrolling check was based on the frameview's scrolloffset, and
+        maximumScrollPosition, which does not acknowledge the overflow properties.
+
+        I am now basing the scrolling off the scrollbar position. The scrollbars are
+        affected by the overflow properties indicating when not to scroll. The scrollbar
+        positions also continue to work for CSS ::-webkit-scrollbar styles.
+
+        * Api/qwebframe.cpp:
+        (qtwebkit_webframe_scrollRecursively):
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-04-07  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36827
+
+        Updated the WebCore::shouldTreatAsAttachement function call with the
+        new more generic replacement WebCore::contentDispositionType.
+
+        See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+
+2010-04-07  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] When providing a widget for the PDF mime type it will cause a crash
+
+        m_pluginView may actually be a Widget (for embedded Qt widgets),
+        so always check isPluginView() before calling PluginView specific methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29450
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::finishedLoading):
+        (WebCore::FrameLoaderClientQt::setMainDocumentError):
+        (WebCore::FrameLoaderClientQt::committedLoad):
+
+2010-04-06  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add mechanism to detect QtWebKit 2.0 via the preprocessor
+        https://bugs.webkit.org/show_bug.cgi?id=36538
+
+        * Api/qwebkitglobal.h:
+
+2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] [Symbian] Rebaseline Symbian def file
+        https://bugs.webkit.org/show_bug.cgi?id=37038
+
+        Switch the ordinal numbers for qtwebkit_webframe_scrollRecursively
+        and QWebInspector::closeEvent to match QtWebkit 4.6 branch
+
+        Fix the signature for qt_drt_setFrameFlatteningEnabled
+        after r56718.
+
+        Add new QtWebKit API symbols introduced not listed in the file yet.
+
+        * symbian/eabi/QtWebKitu.def:
+
+2010-03-30  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Adam Treat.
+
+        Stored focused frame and document in a vars, instead of querying for them many times.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::mousePressEvent(QEvent* ev)):
+        (QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev):
+
+2010-04-02  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt]Fix compile error with QT_NO_SETTINGS
+        https://bugs.webkit.org/show_bug.cgi?id=36533
+
+        If QT_NO_SETTINGS is defined, QSettings is not available.
+
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::populateSetting):
+        (WebCore::InspectorClientQt::storeSetting):
+
+2010-04-02  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - customized popup for <select multiple> elements
+        https://bugs.webkit.org/show_bug.cgi?id=36368
+
+        Using QtMaemoWebPopup instead of QtFallbackWebPopup for Maemo.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::createSelectPopup):
+        * WebCoreSupport/QtFallbackWebPopup.cpp:
+        (WebCore::QtFallbackWebPopup::show):
+        (WebCore::QtFallbackWebPopup::populate):
+
+2010-04-01  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add Single and Multiple Selection Popup for Maemo 5.
+
+        [Qt] Maemo5 theme - popup dialogs
+        https://bugs.webkit.org/show_bug.cgi?id=36789
+
+        * WebCoreSupport/QtMaemoWebPopup.cpp:
+        (WebCore::Maemo5Popup::populateList):
+        (WebCore::Maemo5Popup::onItemSelected):
+        (WebCore::QtMaemoWebPopup::createSingleSelectionPopup):
+        (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup):
+        (WebCore::Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup):
+        (WebCore::MultipleItemListDelegate::MultipleItemListDelegate):
+        (WebCore::MultipleItemListDelegate::paint):
+        (WebCore::Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup):
+        * WebCoreSupport/QtMaemoWebPopup.h:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebCoreSupport/ChromeClientQt.h:
+        (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame):
+
+2010-03-31  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36446
+        [Qt] QWebSettings::TiledBackingStoreEnabled attribute lacks documentation and default value
+
+        * Api/qgraphicswebview.cpp:
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * Api/qwebelement.cpp:
+
+2010-03-30  Joe Ligman  <joseph.ligman@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] QGraphicsScene mousePressEvent does not set the clickCausedFocus flag
+        https://bugs.webkit.org/show_bug.cgi?id=35259
+
+        The clickCausedFocus flag is not being set in method
+        mousePressEvent(QGraphicsSceneMouseEvent* ev). This flag is used 
+        in conjunction with QStyle::RSIP_OnMouseClickAndAlreadyFocused when
+        deciding to launch the software input panel.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::mousePressEvent):
+
+2010-03-30  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Maemo5 theme - QtMaemoWebPopup class
+        https://bugs.webkit.org/show_bug.cgi?id=36790
+
+        A new QtAbstractWebPopup descendant class to be used for maemo menu lists.
+        This is the first step. The next step will be the dialogs implementation that
+        will come in bug 36789 and finally to use QtMaemoWebPopup instead of QtFallbackWebPopup
+        that will come in bug 36368.
+
+        * WebCoreSupport/QtMaemoWebPopup.cpp: Added.
+        (WebCore::QtMaemoWebPopup::QtMaemoWebPopup):
+        (WebCore::QtMaemoWebPopup::~QtMaemoWebPopup):
+        (WebCore::QtMaemoWebPopup::createSingleSelectionPopup):
+        (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup):
+        (WebCore::QtMaemoWebPopup::createPopup):
+        (WebCore::QtMaemoWebPopup::show):
+        (WebCore::QtMaemoWebPopup::hide):
+        (WebCore::QtMaemoWebPopup::popupClosed):
+        (WebCore::QtMaemoWebPopup::itemClicked):
+        * WebCoreSupport/QtMaemoWebPopup.h: Added.
+        (WebCore::Maemo5Popup::Maemo5Popup):
+
+2010-03-29  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Added support for handling the HTTP "Content-Disposition" header.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36395
+
+        Whenever a server response contains a "Content-Disposition: attachment..." header, 
+        treat the request as a download and emit the unsupportedContent signal.
+
+        * Api/qwebpage.cpp:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::download):
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType):
+
+2010-03-22  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add an internal Qt API for changing the view mode media feature
+        (http://www.w3.org/TR/widgets-vmmf/).
+
+        * Api/qwebpage.cpp:
+        (qt_wrt_setViewMode):
+        (QWebPagePrivate::priv):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::isDocked):
+        (WebCore::ChromeClientQt::isFloating):
+        (WebCore::ChromeClientQt::isApplication):
+        (WebCore::ChromeClientQt::isFullscreen):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-03-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Use 'Mobile Safari' instead of 'Safari' on mobile Qt platforms.
+
+        * Api/qwebpage.cpp:
+        (QWebPage::userAgentForUrl):
+
+2010-03-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] unit tests don't compile inside of Qt
+
+        https://bugs.webkit.org/show_bug.cgi?id=36756
+
+        * tests/tests.pri: Don't do the target substitution inside Qt and find the sources
+        through VPATH instead of relying on the location of the .pro file exclusively.
+
+2010-03-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Change due to renaming of frame flattening setting.
+
+        * Api/qwebpage.cpp:
+        (qt_drt_setFrameFlatteningEnabled):
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        * symbian/eabi/QtWebKitu.def:
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+
+2010-03-26  Olivier Goffart  <ogoffart@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Compile with QT_USE_FAST_OPERATOR_PLUS
+
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::populateSetting):
+        (WebCore::InspectorClientQt::storeSetting):
+
+2010-03-26  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Doc: Simplified Commercial Editions for Qt 4.7.
+
+        * docs/qtwebkit.qdoc:
+
+2010-03-26  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Symbian build fix.
+
+        [Qt] Updated the def file with new exports used by QtLauncher.
+
+        * symbian/eabi/QtWebKitu.def:
+
+2010-03-25  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] QtLauncher crashes on Mac OS and Linux when exiting with QGraphicsView mode enabled
+        https://bugs.webkit.org/show_bug.cgi?id=35251
+
+        Followed the way QWebView registers for the signal QWebPage::destroyed(), to prevent
+        QGraphicsWebView from referencing QWebPage after it was deleted.        
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::_q_pageDestroyed):
+        (QGraphicsWebView::setPage):
+        * Api/qgraphicswebview.h:
+
+2010-03-25  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] QWebFrame::pageChanged() signal is not documented
+        https://bugs.webkit.org/show_bug.cgi?id=36609
+
+        * Api/qwebframe.cpp:
+
+2010-03-25  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Implement ChromeClient::windowResizerRect()
+
+        https://bugs.webkit.org/show_bug.cgi?id=21300
+
+        We assume the resize corner to be in the lower right corner of
+        the window and having the width and height of the scrollbars.
+
+        The helper function geometryRelativeToOwnerWidget() in the page
+        client is used to clip the resize rect to the actual size of the
+        viewport, not the size of the QGraphicsView.
+
+        * Api/qgraphicswebview.cpp:
+        * Api/qwebpage.cpp:
+        * WebCoreSupport/ChromeClientQt.cpp:
+
+2010-03-25  Shu Chang  <chang.shu@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Added documentation for delete button.
+        https://bugs.webkit.org/show_bug.cgi?id=31560
+
+        * Api/qwebsettings.cpp:
+
+2010-03-25  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt]Fix compile error with QT_NO_DESKTOPSERVICES
+        https://bugs.webkit.org/show_bug.cgi?id=36533
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::enablePersistentStorage):
+
+2010-03-25  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        [Qt]Fix compile error with QT_NO_DEBUG_STREAM
+        https://bugs.webkit.org/show_bug.cgi?id=36533
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::graphicsItemVisibleRect):
+
+2010-03-25  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Make QWebPage not depend on view() but use the client->ownerWidget()
+        instead. Also, handle the case where there is not page client.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::createContextMenu):
+        (QWebPagePrivate::keyPressEvent):
+        (QWebPage::javaScriptAlert):
+        (QWebPage::javaScriptConfirm):
+        (QWebPage::javaScriptPrompt):
+        (QWebPage::shouldInterruptJavaScript):
+        (QWebPage::createWindow):
+        (QWebPage::action):
+        (QWebPage::extension):
+        (QWebPage::chooseFile):
+        (QWebPage::userAgentForUrl):
+
+2010-03-24  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add the FrameFlatteningEnabled WebAttribute to QWebSettings.
+
+        [Qt] Missing QWebSettings for Frame Flattening
+        https://bugs.webkit.org/show_bug.cgi?id=36553
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::QWebSettings):
+        * Api/qwebsettings.h:
+
+2010-03-24  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        Auto-uppercase and predictive text need to be disabled for S60 (as for maemo)
+        https://bugs.webkit.org/show_bug.cgi?id=33176
+
+        * WebCoreSupport/EditorClientQt.cpp:
+
+2010-03-24  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Rename QWebSettings::XSSAuditorEnabled to XSSAuditingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=36522
+
+        For consistency with other QWebSettings attributes.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        * Api/qwebsettings.h:
+
+2010-03-23  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        Calling setView(0) on a QWebPage being shown by a QGraphicsWebView,
+        would uninstall the page client, deleting the QGraphicsWebViewPrivate
+        instance. If called with an argument, it would do a wrong static_cast
+        and crash.
+
+        * Api/qwebpage.cpp:
+        (QWebPageWidgetClient::QWebPageWidgetClient):
+        (QWebPageWidgetClient::isQWidgetClient):
+        (QWebPageWidgetClient::screenNumber):
+        (QWebPage::QWebPage):
+        (QWebPage::setView):
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::unsetPageIfExists):
+        (QGraphicsWebView::setPage):
+        * Api/qwebpage.cpp:
+        (QWebPageWidgetClient::isQWidgetClient):
+        (QWebPageWidgetClient::screenNumber):
+        (QWebPage::QWebPage):
+        (QWebPage::setView):
+        * Api/qwebpage.h:
+        * Api/qwebview.cpp:
+        (QWebViewPrivate::unsetPageIfExists):
+        (QWebView::setPage):
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::chooseIconForFiles):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-03-23  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        QGraphicsWebView crash when calling setView on the QWebPage...
+        https://bugs.webkit.org/show_bug.cgi?id=36436
+
+        Checking for pageClient existance before showing popups.
+
+        * WebCoreSupport/QtFallbackWebPopup.cpp:
+        (WebCore::QtFallbackWebPopup::show):
+
+2010-03-23  Anders Bakken <anders.bakken@nokia.com>, Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Check if q->scene() is available before actually using it
+        on QGraphicsWebViewPrivate.
+
+        QGraphicsWebView crash
+        https://bugs.webkit.org/show_bug.cgi?id=32670
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::screenNumber):
+        (QGraphicsWebViewPrivate::ownerWidget):
+
+2010-03-23  David Leong  <david.leong@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        Build fix for Symbian Def file.
+
+        * symbian/eabi/QtWebKitu.def:
+
+2010-03-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove support for Qt v4.4
+        https://bugs.webkit.org/show_bug.cgi?id=36389
+
+        * Api/qwebelement.cpp:
+        (QWebElement::classes):
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::editorActionForKeyEvent):
+        (QWebPage::userAgentForUrl):
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent):
+        * tests/tests.pro:
+
+2010-03-22  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Fix qdoc warnings
+        https://bugs.webkit.org/show_bug.cgi?id=36447
+
+        * Api/qgraphicswebview.cpp: Add missing ().
+        * Api/qwebframe.cpp: Remove reference to non-existent parameter "url".
+        * Api/qwebsettings.cpp:  Document parameter "location".
+
+2010-03-22  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Don't construct a QLineEdit every time when painting a text field
+        https://bugs.webkit.org/show_bug.cgi?id=36373
+
+        Add a simple benchmark covering this area.
+
+        * tests/benchmarks/painting/tst_painting.cpp:
+        (tst_Painting::textAreas):
+
+2010-03-22  Yi Shen  <shenyi2006@gmail.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35933  
+        [Qt] [Symbian] Can not backward select (highlight) text using virtual keyboard
+        Make sure the selection start index is smaller than the selection end index.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::inputMethodEvent):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::inputMethods):
+
+2010-03-21  Kristian Amlie  <kristian.amlie@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Fixed updating the VKB display when inputting into QGraphicsWebView.
+        https://bugs.webkit.org/show_bug.cgi?id=36292
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::_q_updateMicroFocus):
+        (QGraphicsWebView::setPage):
+        * Api/qgraphicswebview.h:
+
+2010-03-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed.
+
+        Buildfix for Qt v4.5.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewOverlay::q):
+
+2010-03-18  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Make it possible for the Qt DRT to set the media type from
+        the LayoutTestController.
+
+        * Api/qwebframe.cpp:
+        (qt_drt_setMediaType):
+
+2010-03-18  Joe Ligman  <joseph.ligman@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] New API scrollRecursively has several problems.
+        https://bugs.webkit.org/show_bug.cgi?id=35873
+
+        Remove scrollRecursively from the Qt 4.7 API
+        Update the internal API to accept a hit test position 
+        for nested scrolling
+
+        * Api/qwebframe.cpp:
+        (webframe_scrollOverflow):
+        (qtwebkit_webframe_scrollRecursively):
+        * Api/qwebframe.h:
+        * Api/qwebframe_p.h:
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-03-18  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36102
+        [Qt] Scaling control API for tiled backing store
+        
+        The scale is set by passing the QGraphicsWebView scale to the backing store. The
+        only new API is the tiledBackingStoreFrozen property which allows disabling
+        all updates (for example during zoom animation).
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::_q_scaleChanged):
+        (QGraphicsWebViewPrivate::updateTiledBackingStoreScale):
+        (QGraphicsWebView::QGraphicsWebView):
+        (QGraphicsWebView::isTiledBackingStoreFrozen):
+        (QGraphicsWebView::setTiledBackingStoreFrozen):
+        * Api/qgraphicswebview.h:
+        * Api/qwebframe.cpp:
+        * Api/qwebframe_p.h:
+
+2010-03-17  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Fix Qt build with tiled backing store disabled.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe_p.h:
+
+2010-03-17  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36139
+        [Qt] Clean up cache while setting cache quota. This behavior matches other platforms,
+        such as mac and gtk.
+
+         * Api/qwebsettings.cpp:
+        (QWebSettings::setOfflineWebApplicationCacheQuota):
+
+2010-03-17  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Enable accelerated compositing by default
+        https://bugs.webkit.org/show_bug.cgi?id=35866
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2010-03-15  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36121
+        [Qt] Make WebKit scrollbars work with tiling
+        
+        - Use the scrollbar overlay (implemented for accelerated compositing) when in tiled mode. 
+        - Make overlay compile unconditionally, enable on demand. This removes bunch of unneeded ifdefs.
+        - Update the scroll position to the backing store as needed.
+        - Renamed some methods.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::):
+        (QGraphicsWebViewPrivate::createOrDeleteOverlay):
+        (QGraphicsWebViewPrivate::setRootGraphicsLayer):
+        (QGraphicsWebViewPrivate::updateCompositingScrollPosition):
+        (QGraphicsWebViewPrivate::scroll):
+        (QGraphicsWebViewPrivate::update):
+        (QGraphicsWebViewPrivate::graphicsItemVisibleRect):
+        (QGraphicsWebView::paint):
+        (QGraphicsWebView::setPage):
+        (QGraphicsWebView::updateGeometry):
+        (QGraphicsWebView::setGeometry):
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::renderFromTiledBackingStore):
+        * Api/qwebframe_p.h:
+
+2010-03-15  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix crash in QWebView::setPage()
+
+        tst_qwebpage was crashing on setPage(0)
+
+        https://bugs.webkit.org/show_bug.cgi?id=36137
+
+        * Api/qwebview.cpp:
+        (QWebView::setPage):
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * Api/qwebinspector.cpp:
+        (QWebInspector::hideEvent):
+        (QWebInspector::closeEvent):
+        * Api/qwebinspector.h:
+        * Api/qwebpage.h:
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::openInspectorFrontend):
+        (WebCore::InspectorFrontendClientQt::InspectorFrontendClientQt):
+        (WebCore::InspectorFrontendClientQt::frontendLoaded):
+        (WebCore::InspectorFrontendClientQt::localizedStringsURL):
+        (WebCore::InspectorFrontendClientQt::hiddenPanels):
+        (WebCore::InspectorFrontendClientQt::bringToFront):
+        (WebCore::InspectorFrontendClientQt::closeWindow):
+        (WebCore::InspectorFrontendClientQt::attachWindow):
+        (WebCore::InspectorFrontendClientQt::detachWindow):
+        (WebCore::InspectorFrontendClientQt::setAttachedWindowHeight):
+        (WebCore::InspectorFrontendClientQt::inspectedURLChanged):
+        (WebCore::InspectorFrontendClientQt::updateWindowTitle):
+        * WebCoreSupport/InspectorClientQt.h:
+
+2010-03-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed.
+
+        [Qt] Build fix if TILED_BACKING_STORE is disabled.
+
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
+
+2010-03-14  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] [Symbian] Use Symbian native dialog providers for combo pupups.
+        https://bugs.webkit.org/show_bug.cgi?id=35919
+
+        * WebCoreSupport/QtFallbackWebPopup.cpp:
+        (WebCore::QtFallbackWebPopup::show):
+        (WebCore::ResetAndDestroy):
+        (WebCore::QtFallbackWebPopup::showS60BrowserDialog):
+        * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-03-14  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35146
+        Support tiled backing store
+
+        Implements a basic tiled backing store mechanism. Tiles are created and 
+        deleted on demand. The page content is cached to the tiles. Tile content
+        is kept in sync with the document. Since the backing store covers area
+        larger than the currently visible viewport, the document can be scrolled
+        quickly without having to enter rendering tree painting.
+        
+        The tile management code is platform independent. This patch has simple QPixmap
+        based tile implementation for Qt.
+        
+        The feature is behind ENABLE_TILED_BACKING_STORE flag.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::visibleRect):
+        (QGraphicsWebView::paint):
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
+        * Api/qwebframe.h:
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        * Api/qwebsettings.h:
+
+2010-03-13  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Enable accelerated compositing by default
+        https://bugs.webkit.org/show_bug.cgi?id=35866
+
+        Unreviewed. Roll-out r55955, because it broke 3 tests:
+        - animations/fill-mode-transform.html
+        - animations/play-state.html
+        - animations/simultaneous-start-left.html
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2010-03-13  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Enable accelerated compositing by default
+        https://bugs.webkit.org/show_bug.cgi?id=35866
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-03-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add Support for WebKitEnableCaretBrowsing to Qt DRT
+
+        Unskip test fast/events/multiline-link-arrow-navigation.html
+        Fix typo (superfluous space) in QWebSettings docs.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35593
+
+        * Api/qwebpage.cpp:
+        (qt_drt_enableCaretBrowsing):
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply): fix typo in docs
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the qt port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::invalidateContents):
+        (WebCore::ChromeClientQt::invalidateWindow):
+        (WebCore::ChromeClientQt::invalidateContentsAndWindow):
+        (WebCore::ChromeClientQt::invalidateContentsForSlowScroll):
+        * WebCoreSupport/ChromeClientQt.h:
+
+2010-03-08  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Remove the now-redundant Settings fields for the Database
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        No new tests; this code isn't called.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply): Remove the call into Settings.
+
+2010-03-08  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Binary incompatibility between Qt 4.6's WebKit and trunk in QWebSettings
+        https://bugs.webkit.org/show_bug.cgi?id=35858
+
+        Moved the enum value added in r54873 to the end of the enum, to preserve
+        binary compatibility. DnsPrefetchEnabled was in the last release and needs
+        to remain after LocalContentCanAccessRemoteUrls.
+
+        * Api/qwebsettings.h:
+
+2010-03-06  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Sam Weinig.
+
+        Remove unnecessary includes of wtf/Platform.h.  This is already pulled in by the prefix header.
+
+        * WebCoreSupport/EditCommandQt.cpp:
+
+2010-03-02  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Hausmann.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [Qt] QWebSettings attribute for toggle Spatial Navigation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=33714 (Qt API part)
+
+        Added 'SpatialNavigationEnabled' attribute to QWebSettings.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        * Api/qwebsettings.h:
+
+2010-03-04  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] qwebelement.h does not include QtCore headers correctly
+        https://bugs.webkit.org/show_bug.cgi?id=35748
+
+        The header files of QtCore must be included as QtCore/foo.h.
+
+        See also http://bugreports.qt.nokia.com/browse/QTBUG-8661
+
+        * Api/qwebelement.h:
+
+2010-03-04  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
+
+        This also allows shadow builds relying only on qmake to work properly.
+
+        * tests/benchmarks/loading/loading.pro:
+        * tests/benchmarks/painting/painting.pro:
+        * tests/hybridPixmap/hybridPixmap.pro:
+        * tests/qgraphicswebview/qgraphicswebview.pro:
+        * tests/qwebelement/qwebelement.pro:
+        * tests/qwebframe/qwebframe.pro:
+        * tests/qwebhistory/qwebhistory.pro:
+        * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+        * tests/qwebinspector/qwebinspector.pro:
+        * tests/qwebpage/qwebpage.pro:
+        * tests/qwebplugindatabase/qwebplugindatabase.pro:
+
+2010-03-02  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix generation of forwarding headers
+
+        The dependencies were a bit wrong, so we ended up not generating
+        forwarding headers for qwebkitversion.h and qwebkitglobal.h
+
+        The forwarding headers are now the only targets depending on the
+        real headers. All other targets either depend on the generated
+        class headers, or the forwarding headers.
+
+        * Api/DerivedSources.pro:
+
+2010-03-02  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        Move database enable bit fully out of settings
+        This is stage one of a three-stage commit [webkit, then chromium, then
+        webkit again].  In this change I'm adding calls to
+        Database::setIsAvailable inside Settings::setDatabaseEnabled and
+        anywhere else that called it, and switching webkit fully over to using
+        that flag [added in a previous checkin].  Phase two will remove
+        Chromium's use of Settings for the Database, and phase three will remove
+        the Setting for the Database enable entirely, leaving only
+        Database::isAvailable/setIsAvailable.
+
+        No new tests; tested by existing storage tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35310
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):  Add a call to Database::setIsAvailable
+
+2010-03-02  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Symbian build fix.
+
+        [Qt] Updated the def file with one new export, to fix
+        QtLauncher linkage.
+
+        * symbian/eabi/QtWebKitu.def:
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setTextSizeMultiplier):
+        (QWebFrame::setZoomFactor):
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+
+2010-02-26  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Fix documentation of QWebSettings::setUserStyleSheetUrl method
+
+        The base 64 data in the exemple shows a not valid code.
+
+        REGRESSION: QWebSettings::setUserStyleSheetUrl is not working with a data URL (Base64)
+        https://bugs.webkit.org/show_bug.cgi?id=34802
+
+        * Api/qwebsettings.cpp:
+
+2010-02-26  Jamey Hicks  <jamey.hicks@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] added QWebSettings::setInspectorUrl() and QWebSettings::inspectorUrl()
+
+        Enables the use of alternate Web Inspector frontends by changing
+        the location of the frontend.
+
+        This is required so that the Web Inspector may be run from an
+        external process or an external tool such as Eclipse or Aptana may
+        be used instead of the in-process Web Inspector UI.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35340
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+        (QWebSettings::setInspectorUrl):
+        (QWebSettings::inspectorUrl):
+        * Api/qwebsettings.h:
+        * WebCoreSupport/InspectorClientQt.cpp:
+        (WebCore::InspectorClientQt::createPage):
+
+2010-02-25  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Qt WebGL support
+
+        Adds enabling and disabling of WebGL support to QWebSettings.
+        https://bugs.webkit.org/show_bug.cgi?id=35153
+
+        * Api/qwebsettings.cpp:
+        (QWebSettingsPrivate::apply):
+        (QWebSettings::QWebSettings):
+        * Api/qwebsettings.h:
+
+2010-02-19  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove QGVLauncher
+
+        https://bugs.webkit.org/show_bug.cgi?id=35292
+
+        * QGVLauncher/QGVLauncher.pro: Removed.
+        * QGVLauncher/main.cpp: Removed.
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebCoreSupport/ChromeClientQt.h:
+        (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame):
+
+2010-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed Symbian build fix.
+
+        [Qt] Updated the def file with new exports to enable
+        building DumpRenderTree.
+
+        * symbian/eabi/QtWebKitu.def:
+
 2010-02-18  Noam Rosenthal  <noam.rosenthal@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/QGVLauncher/QGVLauncher.pro b/WebKit/qt/QGVLauncher/QGVLauncher.pro
deleted file mode 100644
index 059ec1a..0000000
--- a/WebKit/qt/QGVLauncher/QGVLauncher.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-SOURCES += main.cpp
-CONFIG -= app_bundle
-CONFIG += uitools
-DESTDIR = ../../../bin
-
-include(../../../WebKit.pri)
-
-QT += network
-macx:QT+=xml
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E544
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/WebKit/qt/QGVLauncher/main.cpp b/WebKit/qt/QGVLauncher/main.cpp
deleted file mode 100644
index 448b4b0..0000000
--- a/WebKit/qt/QGVLauncher/main.cpp
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2006 George Staikos <staikos@kde.org>
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2009 Kenneth Christiansen <kenneth@webkit.org>
- * Copyright (C) 2009 Antonio Gomes <antonio.gomes@openbossa.org>
- * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
- *
- * 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 COMPUTER, 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 <QDebug>
-#include <QFile>
-#include <QGraphicsScene>
-#include <QGraphicsView>
-#include <QGraphicsWidget>
-#include <QNetworkRequest>
-#include <QTextStream>
-#include <QVector>
-#include <QtGui>
-#include <QtNetwork/QNetworkProxy>
-#include <cstdio>
-#include <qwebelement.h>
-#include <qwebframe.h>
-#include <qgraphicswebview.h>
-#include <qwebpage.h>
-#include <qwebsettings.h>
-#include <qwebview.h>
-
-static QUrl urlFromUserInput(const QString& string)
-{
-    QString input(string);
-    QFileInfo fi(input);
-    if (fi.exists() && fi.isRelative())
-        input = fi.absoluteFilePath();
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    return QUrl::fromUserInput(input);
-#else
-    return QUrl(input);
-#endif
-}
-
-class WebView : public QGraphicsWebView {
-    Q_OBJECT
-    Q_PROPERTY(qreal yRotation READ yRotation WRITE setYRotation)
-
-public:
-    WebView(QGraphicsItem* parent = 0)
-        : QGraphicsWebView(parent)
-    {
-        if (QApplication::instance()->arguments().contains("--cacheWebView"))
-            setCacheMode(QGraphicsItem::DeviceCoordinateCache);
-        if (QApplication::instance()->arguments().contains("--resizesToContents"))
-            setResizesToContents(true);
-    }
-    void setYRotation(qreal angle)
-    {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-        QRectF r = boundingRect();
-        setTransform(QTransform()
-            .translate(r.width() / 2, r.height() / 2)
-            .rotate(angle, Qt::YAxis)
-            .translate(-r.width() / 2, -r.height() / 2));
-#endif
-        m_yRotation = angle;
-    }
-    qreal yRotation() const
-    {
-        return m_yRotation;
-    }
-
-private:
-    qreal m_yRotation;
-};
-
-class WebPage : public QWebPage {
-    Q_OBJECT
-
-public:
-    WebPage(QObject* parent = 0)
-        : QWebPage(parent)
-    {
-        applyProxy();
-    }
-    virtual QWebPage* createWindow(QWebPage::WebWindowType);
-
-private:
-    void applyProxy()
-    {
-        QUrl proxyUrl = urlFromUserInput(qgetenv("http_proxy"));
-
-        if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) {
-            int proxyPort = (proxyUrl.port() > 0) ? proxyUrl.port() : 8080;
-            networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort));
-        }
-    }
-};
-
-class MainView : public QGraphicsView {
-    Q_OBJECT
-
-public:
-    MainView(QWidget* parent)
-        : QGraphicsView(parent)
-        , m_mainWidget(0)
-        , m_measureFps(QApplication::instance()->arguments().contains("--show-fps"))
-        , m_numTotalPaints(0)
-        , m_numPaintsSinceLastMeasure(0)
-    {
-        // Use the graphics view scrollbars when the webview is set to size to the content.
-        if (!QApplication::instance()->arguments().contains("--resizesToContents")) {
-            setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-            setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-        }
-
-        setFrameShape(QFrame::NoFrame);
-        setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-        if (m_measureFps) {
-            QTimer* fpsTimer = new QTimer(this);
-            fpsTimer->setInterval(5000);
-            m_totalStartTime = m_startTime = QTime::currentTime();
-            connect(fpsTimer, SIGNAL(timeout()), this, SLOT(printFps()));
-            fpsTimer->start();
-        }
-    }
-
-    void setMainWidget(WebView* widget)
-    {
-        m_mainWidget = widget;
-        if (m_mainWidget->resizesToContents())
-            return;
-        QRectF rect(QRect(QPoint(0, 0), size()));
-        m_mainWidget->setGeometry(rect);
-    }
-
-    void resizeEvent(QResizeEvent* event)
-    {
-        QGraphicsView::resizeEvent(event);
-        if (!m_mainWidget || m_mainWidget->resizesToContents())
-            return;
-        QRectF rect(QPoint(0, 0), event->size());
-        m_mainWidget->setGeometry(rect);
-    }
-
-    void paintEvent(QPaintEvent* event)
-    {
-        QGraphicsView::paintEvent(event);
-        if (m_measureFps) {
-            ++m_numPaintsSinceLastMeasure;
-            ++m_numTotalPaints;            
-        }
-    }
-
-    void setWaitCursor()
-    {
-        m_mainWidget->setCursor(Qt::WaitCursor);
-    }
-
-    void resetCursor()
-    {
-        m_mainWidget->unsetCursor();
-    }
-
-public slots:
-    void flip()
-    {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-        QSizeF center = m_mainWidget->boundingRect().size() / 2;
-        QPointF centerPoint = QPointF(center.width(), center.height());
-        m_mainWidget->setTransformOriginPoint(centerPoint);
-
-        m_mainWidget->setRotation(m_mainWidget->rotation() ? 0 : 180);
-#endif
-    }
-
-    void animatedFlip()
-    {
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-        QSizeF center = m_mainWidget->boundingRect().size() / 2;
-        QPointF centerPoint = QPointF(center.width(), center.height());
-        m_mainWidget->setTransformOriginPoint(centerPoint);
-
-        QPropertyAnimation* animation = new QPropertyAnimation(m_mainWidget, "rotation", this);
-        animation->setDuration(1000);
-
-        int rotation = int(m_mainWidget->rotation());
-
-        animation->setStartValue(rotation);
-        animation->setEndValue(rotation + 180 - (rotation % 180));
-
-        animation->start(QAbstractAnimation::DeleteWhenStopped);
-#endif
-    }
-
-    void animatedYFlip()
-    {
-        emit flipRequest();
-    }
-
-    void printFps()
-    {
-        // note that this might have a bug if you measure right around midnight, but we can live with that
-        QTime now = QTime::currentTime();
-        int msecs = m_startTime.msecsTo(now);
-        int totalMsecs = m_totalStartTime.msecsTo(now);
-        int totalFps = totalMsecs ? m_numTotalPaints * 1000 / totalMsecs : 0;
-        int curFps = msecs ? m_numPaintsSinceLastMeasure * 1000 / msecs : 0;
-        qDebug("[FPS] From start: %d, from last paint: %d", totalFps, curFps);
-        m_startTime = now;
-        m_numPaintsSinceLastMeasure = 0;
-    }
-
-signals:
-    void flipRequest();
-
-private:
-    WebView* m_mainWidget;
-    bool m_measureFps;
-    int m_numTotalPaints;
-    int m_numPaintsSinceLastMeasure;
-    QTime m_startTime;
-    QTime m_totalStartTime;
-};
-
-class SharedScene : public QSharedData {
-public:
-    SharedScene()
-    {
-        m_scene = new QGraphicsScene;
-        m_item = new WebView;
-        m_item->setPage((m_page = new WebPage));
-
-        m_scene->addItem(m_item);
-        m_scene->setActiveWindow(m_item);
-    }
-
-    ~SharedScene()
-    {
-        delete m_item;
-        delete m_scene;
-        delete m_page;
-    }
-
-    QGraphicsScene* scene() const { return m_scene; }
-    WebView* webView() const { return m_item; }
-
-private:
-    QGraphicsScene* m_scene;
-    WebView* m_item;
-    WebPage* m_page;
-};
-
-class MainWindow : public QMainWindow {
-    Q_OBJECT
-
-public:
-    MainWindow(QExplicitlySharedDataPointer<SharedScene> other)
-        : QMainWindow()
-        , view(new MainView(this))
-        , scene(other)
-    {
-        init();
-    }
-
-    MainWindow()
-        : QMainWindow()
-        , view(new MainView(this))
-        , scene(new SharedScene())
-    {
-        init();
-    }
-
-    void init()
-    {
-        setAttribute(Qt::WA_DeleteOnClose);
-
-        view->setScene(scene->scene());
-        const QStringList arguments = QApplication::instance()->arguments();
-        const int indexOfViewportUpdateMode = arguments.indexOf("--updateMode");
-        if (indexOfViewportUpdateMode > 1 && indexOfViewportUpdateMode < arguments.count() - 1) {
-            const QString updateMode = arguments[indexOfViewportUpdateMode+1] + "ViewportUpdate";
-            view->setViewportUpdateMode(static_cast<QGraphicsView::ViewportUpdateMode>(QGraphicsView::staticMetaObject.enumerator(QGraphicsView::staticMetaObject.indexOfEnumerator("ViewportUpdateMode")).keysToValue(updateMode.toAscii())));
-        }
-
-        setCentralWidget(view);
-
-        view->setMainWidget(scene->webView());
-
-        connect(scene->webView(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
-        connect(scene->webView(), SIGNAL(titleChanged(const QString&)), this, SLOT(setWindowTitle(const QString&)));
-        connect(scene->webView()->page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-        QStateMachine *machine = new QStateMachine(this);
-        QState *s0 = new QState(machine);
-        s0->assignProperty(scene->webView(), "yRotation", 0);
-
-        QState *s1 = new QState(machine);
-        s1->assignProperty(scene->webView(), "yRotation", 90);
-
-        QAbstractTransition *t1 = s0->addTransition(view, SIGNAL(flipRequest()), s1);
-        QPropertyAnimation *yRotationAnim = new QPropertyAnimation(scene->webView(), "yRotation", this);
-        yRotationAnim->setDuration(1000);
-        t1->addAnimation(yRotationAnim);
-
-        QState *s2 = new QState(machine);
-        s2->assignProperty(scene->webView(), "yRotation", -90);
-        s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2);
-
-        QAbstractTransition *t2 = s2->addTransition(s0);
-        t2->addAnimation(yRotationAnim);
-
-        machine->setInitialState(s0);
-        machine->start();
-#endif
-
-        resize(640, 480);
-        buildUI();
-    }
-
-    void load(const QString& url)
-    {
-        QUrl deducedUrl = urlFromUserInput(url);
-        if (!deducedUrl.isValid())
-            deducedUrl = QUrl("http://" + url + "/");
-
-        loadURL(deducedUrl);
-    }
-
-    QWebPage* page() const
-    {
-        return scene->webView()->page();
-    }
-
-protected slots:
-
-    void openFile()
-    {
-        static const QString filter("HTML Files (*.htm *.html);;Text Files (*.txt);;Image Files (*.gif *.jpg *.png);;All Files (*)");
-
-        QFileDialog fileDialog(this, tr("Open"), QString(), filter);
-        fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
-        fileDialog.setFileMode(QFileDialog::ExistingFile);
-        fileDialog.setOptions(QFileDialog::ReadOnly);
-
-        if (fileDialog.exec()) {
-            QString selectedFile = fileDialog.selectedFiles()[0];
-            if (!selectedFile.isEmpty())
-                loadURL(QUrl::fromLocalFile(selectedFile));
-        }
-    }
-
-    void changeLocation()
-    {
-        load(urlEdit->text());
-    }
-
-    void loadFinished(bool)
-    {
-        QUrl url = scene->webView()->url();
-        urlEdit->setText(url.toString());
-
-        QUrl::FormattingOptions opts;
-        opts |= QUrl::RemoveScheme;
-        opts |= QUrl::RemoveUserInfo;
-        opts |= QUrl::StripTrailingSlash;
-        QString s = url.toString(opts);
-        s = s.mid(2);
-        if (s.isEmpty())
-            return;
-        //FIXME: something missing here
-    }
-
-public slots:
-    void newWindow(const QString &url = QString())
-    {
-        MainWindow* mw = new MainWindow();
-        mw->load(url);
-        mw->show();
-    }
-
-    void clone()
-    {
-        MainWindow* mw = new MainWindow(scene);
-        mw->show();
-    }
-
-    void setWaitCursor()
-    {
-        view->setWaitCursor();
-    }
-
-    void resetCursor()
-    {
-        view->resetCursor();
-    }
-
-    void flip()
-    {
-        view->flip();
-    }
-
-    void animatedFlip()
-    {
-        view->animatedFlip();
-    }
-
-    void animatedYFlip()
-    {
-        view->animatedYFlip();
-    }
-
-private:
-
-    void loadURL(const QUrl& url)
-    {
-        if (!url.isValid())
-            return;
-    
-        urlEdit->setText(url.toString());
-        scene->webView()->load(url);
-        scene->webView()->setFocus(Qt::OtherFocusReason);
-    }
-
-    void buildUI()
-    {
-        QWebPage* page = scene->webView()->page();
-        urlEdit = new QLineEdit(this);
-        urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
-        connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
-
-        QToolBar* bar = addToolBar("Navigation");
-        bar->addAction(page->action(QWebPage::Back));
-        bar->addAction(page->action(QWebPage::Forward));
-        bar->addAction(page->action(QWebPage::Reload));
-        bar->addAction(page->action(QWebPage::Stop));
-        bar->addWidget(urlEdit);
-
-        QMenu* fileMenu = menuBar()->addMenu("&File");
-        fileMenu->addAction("New Window", this, SLOT(newWindow()), QKeySequence::New);
-        fileMenu->addAction("Open File...", this, SLOT(openFile()), QKeySequence::Open);
-        fileMenu->addAction("Clone Window", this, SLOT(clone()));
-        fileMenu->addAction("Close Window", this, SLOT(close()), QKeySequence::Close);
-        fileMenu->addSeparator();
-        fileMenu->addAction("Quit", QApplication::instance(), SLOT(closeAllWindows()), QKeySequence(Qt::CTRL | Qt::Key_Q));
-
-        QMenu* viewMenu = menuBar()->addMenu("&View");
-        viewMenu->addAction(page->action(QWebPage::Stop));
-        viewMenu->addAction(page->action(QWebPage::Reload));
-
-        QMenu* testMenu = menuBar()->addMenu("&Tests");
-        testMenu->addAction("Set Wait Cursor", this, SLOT(setWaitCursor()), QKeySequence("Ctrl+W"));
-        testMenu->addAction("Reset Cursor", this, SLOT(resetCursor()), QKeySequence("Ctrl+Shift+W"));
-
-        QMenu* fxMenu = menuBar()->addMenu("&Effects");
-        fxMenu->addAction("Flip", this, SLOT(flip()));
-        fxMenu->addAction("Animated Flip", this, SLOT(animatedFlip()), QKeySequence("Ctrl+R"));
-        fxMenu->addAction("Animated Y-Flip", this, SLOT(animatedYFlip()), QKeySequence("Ctrl+Y"));
-    }
-
-private:
-    MainView* view;
-    QExplicitlySharedDataPointer<SharedScene> scene;
-
-    QLineEdit* urlEdit;
-};
-
-QWebPage* WebPage::createWindow(QWebPage::WebWindowType)
-{
-    MainWindow* mw = new MainWindow;
-    mw->show();
-    return mw->page();
-}
-
-int main(int argc, char** argv)
-{
-    QApplication app(argc, argv);
-    if (app.arguments().contains("--help")) {
-        qDebug() << "Usage: QGVLauncher [--url url] [--compositing] [--updateMode Full|Minimal|Smart|No|BoundingRect] [--cacheWebView] [--resizesToContents]\n";
-        return 0;
-    }
-    QString url = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
-
-    app.setApplicationName("GQVLauncher");
-
-    QWebSettings::setObjectCacheCapacities((16 * 1024 * 1024) / 8, (16 * 1024 * 1024) / 8, 16 * 1024 * 1024);
-    QWebSettings::setMaximumPagesInCache(4);
-    QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
-    QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
-    QWebSettings::enablePersistentStorage();
-
-    const QStringList args = app.arguments();
-    const int indexOfUrl = args.indexOf("--url");
-    if (indexOfUrl > 0 && indexOfUrl < args.count() - 1)
-        url = args.at(indexOfUrl+1);
-    else if (args.count() > 1)
-        url = args.at(1);
-    if (args.contains("--compositing"))
-        QWebSettings::globalSettings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);
-
-    MainWindow* window = new MainWindow;
-    window->load(url);
-
-    for (int i = 2; i < args.count(); ++i)
-        if (!args.at(i).startsWith("-") && !args.at(i - 1).startsWith("-"))
-            window->newWindow(args.at(i));
-
-    window->show();
-    return app.exec();
-}
-
-#include "main.moc"
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index ecbabe4..5ea072d 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -36,10 +36,17 @@
 #include "FrameLoaderClientQt.h"
 #include "FrameView.h"
 #include "HitTestResult.h"
+#include "Icon.h"
+#include "NotificationPresenterClientQt.h"
 #include "NotImplemented.h"
+#include "ScrollbarTheme.h"
 #include "WindowFeatures.h"
 #include "DatabaseTracker.h"
+#if defined(Q_WS_MAEMO_5)
+#include "QtMaemoWebPopup.h"
+#else
 #include "QtFallbackWebPopup.h"
+#endif
 #include "QWebPageClient.h"
 #include "SecurityOrigin.h"
 
@@ -91,7 +98,7 @@
     QWidget* view = m_webPage->view();
     if (!view)
         return FloatRect();
-    return IntRect(view->topLevelWidget()->geometry());
+    return IntRect(view->window()->geometry());
 }
 
 
@@ -159,7 +166,9 @@
     QWebPage *newPage = m_webPage->createWindow(features.dialog ? QWebPage::WebModalDialog : QWebPage::WebBrowserWindow);
     if (!newPage)
         return 0;
-    newPage->mainFrame()->load(request.resourceRequest().url());
+
+    if (!request.isEmpty())
+        newPage->mainFrame()->load(request.resourceRequest().url());
     return newPage->d->page;
 }
 
@@ -170,7 +179,7 @@
     QWidget* view = m_webPage->view();
     if (!view)
         return;
-    view->topLevelWidget()->show();
+    view->window()->show();
 }
 
 
@@ -324,26 +333,66 @@
 
 IntRect ChromeClientQt::windowResizerRect() const
 {
+#if defined(Q_WS_MAC)
+    if (!m_webPage)
+        return IntRect();
+
+    QWebPageClient* pageClient = platformPageClient();
+    if (!pageClient)
+        return IntRect();
+
+    QWidget* ownerWidget = pageClient->ownerWidget();
+    if (!ownerWidget)
+        return IntRect();
+
+    QWidget* topLevelWidget = ownerWidget->window();
+    QRect topLevelGeometry(topLevelWidget->geometry());
+
+    // There's no API in Qt to query for the size of the resizer, so we assume
+    // it has the same width and height as the scrollbar thickness.
+    int scollbarThickness = ScrollbarTheme::nativeTheme()->scrollbarThickness();
+
+    // There's no API in Qt to query for the position of the resizer. Sometimes
+    // it's drawn by the system, and sometimes it's a QSizeGrip. For RTL locales
+    // it might even be on the lower left side of the window, but in WebKit we
+    // always draw scrollbars on the right hand side, so we assume this to be the
+    // location when computing the resize rect to reserve for WebKit.
+    QPoint resizeCornerTopLeft = ownerWidget->mapFrom(topLevelWidget,
+            QPoint(topLevelGeometry.width(), topLevelGeometry.height())
+            - QPoint(scollbarThickness, scollbarThickness));
+
+    QRect resizeCornerRect = QRect(resizeCornerTopLeft, QSize(scollbarThickness, scollbarThickness));
+    return resizeCornerRect.intersected(pageClient->geometryRelativeToOwnerWidget());
+#else
     return IntRect();
+#endif
 }
 
-void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool, bool)
+void ChromeClientQt::invalidateWindow(const IntRect&, bool)
+{
+    notImplemented();
+}
+
+void ChromeClientQt::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate)
 {
     // No double buffer, so only update the QWidget if content changed.
-    if (contentChanged) {
-        if (platformPageClient()) {
-            QRect rect(windowRect);
-            rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
-            if (!rect.isEmpty())
-                platformPageClient()->update(rect);
-        }
-        emit m_webPage->repaintRequested(windowRect);
+    if (platformPageClient()) {
+        QRect rect(windowRect);
+        rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
+        if (!rect.isEmpty())
+            platformPageClient()->update(rect);
     }
+    emit m_webPage->repaintRequested(windowRect);
 
     // FIXME: There is no "immediate" support for window painting.  This should be done always whenever the flag
     // is set.
 }
 
+void ChromeClientQt::invalidateContentsForSlowScroll(const IntRect& windowRect, bool immediate)
+{
+    invalidateContentsAndWindow(windowRect, immediate);
+}
+
 void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
 {
     if (platformPageClient())
@@ -431,6 +480,13 @@
 }
 #endif
 
+#if ENABLE(NOTIFICATIONS)
+NotificationPresenter* ChromeClientQt::notificationPresenter() const
+{
+    return m_webPage->d->notificationPresenterClient;
+}
+#endif
+
 void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
 {
     RefPtr<FileChooser> fileChooser = prpFileChooser;
@@ -463,10 +519,9 @@
     }
 }
 
-void ChromeClientQt::iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>)
+void ChromeClientQt::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
 {
-    // FIXME: Move the code of Icon::createIconForFiles() here.
-    notImplemented();
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 bool ChromeClientQt::setCursor(PlatformCursorHandle)
@@ -501,11 +556,48 @@
     if (platformPageClient())
         platformPageClient()->markForSync(true);
 }
+
+bool ChromeClientQt::allowsAcceleratedCompositing() const
+{
+    return (platformPageClient() && platformPageClient()->allowsAcceleratedCompositing());
+}
+
 #endif
 
 QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
 {
+#if defined(Q_WS_MAEMO_5)
+    return new QtMaemoWebPopup;
+#else
     return new QtFallbackWebPopup;
+#endif
 }
 
+#if ENABLE(WIDGETS_10_SUPPORT)
+bool ChromeClientQt::isWindowed()
+{
+    return m_webPage->d->viewMode == "windowed";
+}
+
+bool ChromeClientQt::isFloating()
+{
+    return m_webPage->d->viewMode == "floating";
+}
+
+bool ChromeClientQt::isFullscreen()
+{
+    return m_webPage->d->viewMode == "fullscreen";
+}
+
+bool ChromeClientQt::isMaximized()
+{
+    return m_webPage->d->viewMode == "maximized";
+}
+
+bool ChromeClientQt::isMinimized()
+{
+    return m_webPage->d->viewMode == "minimized";
+}
+#endif
+
 }
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 3d5cbe9..a4575e2 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -34,7 +34,10 @@
 #include "KURL.h"
 #include "PlatformString.h"
 
+QT_BEGIN_NAMESPACE
 class QEventLoop;
+QT_END_NAMESPACE
+
 class QWebPage;
 
 namespace WebCore {
@@ -105,8 +108,11 @@
         virtual bool tabsToLinks() const;
         virtual IntRect windowResizerRect() const;
 
-        virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+        virtual void invalidateWindow(const IntRect&, bool);
+        virtual void invalidateContentsAndWindow(const IntRect&, bool);
+        virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
         virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
         virtual IntPoint screenToWindow(const IntPoint&) const;
         virtual IntRect windowToScreen(const IntRect&) const;
         virtual PlatformPageClient platformPageClient() const;
@@ -125,12 +131,17 @@
         virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
 #endif
 
+#if ENABLE(NOTIFICATIONS)
+        virtual NotificationPresenter* notificationPresenter() const;
+#endif
+
 #if USE(ACCELERATED_COMPOSITING)
         // see ChromeClient.h
         // this is a hook for WebCore to tell us what we need to do with the GraphicsLayers
         virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
         virtual void setNeedsOneShotDrawingSynchronization();
         virtual void scheduleCompositingLayerSync();
+        virtual bool allowsAcceleratedCompositing() const;
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
@@ -138,7 +149,7 @@
 #endif
 
         virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
-        virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>);
+        virtual void chooseIconForFiles(const Vector<String>&, FileChooser*);
 
         virtual void formStateDidChange(const Node*) { }
 
@@ -149,6 +160,15 @@
         virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
 
         virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+        virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { }
+
+#if ENABLE(WIDGETS_10_SUPPORT)
+        virtual bool isWindowed();
+        virtual bool isFloating();
+        virtual bool isFullscreen();
+        virtual bool isMaximized();
+        virtual bool isMinimized();
+#endif
 
         QtAbstractWebPopup* createSelectPopup();
 
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
new file mode 100644
index 0000000..3f2e221
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -0,0 +1,372 @@
+/*
+    Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+    Copyright (C) 2008,2009,2010 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2007 Staikos Computing Services Inc.
+    Copyright (C) 2007 Apple Inc.
+
+    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 "DumpRenderTreeSupportQt.h"
+
+#include "ContextMenu.h"
+#include "ContextMenuClientQt.h"
+#include "ContextMenuController.h"
+#include "Editor.h"
+#include "Element.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GCController.h"
+#include "InspectorController.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PluginDatabase.h"
+#include "PrintContext.h"
+#include "RenderListItem.h"
+#include "RenderTreeAsText.h"
+#include "SecurityOrigin.h"
+#include "Settings.h"
+#if ENABLE(SVG)
+#include "SVGSMILElement.h"
+#endif
+#include "WorkerThread.h"
+
+#include "qwebframe.h"
+#include "qwebframe_p.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+
+using namespace WebCore;
+
+DumpRenderTreeSupportQt::DumpRenderTreeSupportQt()
+{
+}
+
+DumpRenderTreeSupportQt::~DumpRenderTreeSupportQt()
+{
+}
+
+void DumpRenderTreeSupportQt::overwritePluginDirectories()
+{
+    PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
+
+    Vector<String> paths;
+    String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data());
+    qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths);
+
+    db->setPluginDirectories(paths);
+    db->refresh();
+}
+
+int DumpRenderTreeSupportQt::workerThreadCount()
+{
+#if ENABLE(WORKERS)
+    return WebCore::WorkerThread::workerThreadCount();
+#else
+    return 0;
+#endif
+}
+
+void DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(bool b)
+{
+    QWebPagePrivate::drtRun = b;
+}
+
+void DumpRenderTreeSupportQt::setFrameFlatteningEnabled(QWebPage* page, bool enabled)
+{
+    QWebPagePrivate::core(page)->settings()->setFrameFlatteningEnabled(enabled);
+}
+
+void DumpRenderTreeSupportQt::webPageSetGroupName(QWebPage* page, const QString& groupName)
+{
+    page->handle()->page->setGroupName(groupName);
+}
+
+QString DumpRenderTreeSupportQt::webPageGroupName(QWebPage* page)
+{
+    return page->handle()->page->groupName();
+}
+
+#if ENABLE(INSPECTOR)
+void DumpRenderTreeSupportQt::webInspectorExecuteScript(QWebPage* page, long callId, const QString& script)
+{
+    if (!page->handle()->page->inspectorController())
+        return;
+    page->handle()->page->inspectorController()->evaluateForTestInFrontend(callId, script);
+}
+
+void DumpRenderTreeSupportQt::webInspectorClose(QWebPage* page)
+{
+    if (!page->handle()->page->inspectorController())
+        return;
+    page->handle()->page->inspectorController()->close();
+}
+
+void DumpRenderTreeSupportQt::webInspectorShow(QWebPage* page)
+{
+    if (!page->handle()->page->inspectorController())
+        return;
+    page->handle()->page->inspectorController()->show();
+}
+
+void DumpRenderTreeSupportQt::setTimelineProfilingEnabled(QWebPage* page, bool enabled)
+{
+    InspectorController* controller = page->handle()->page->inspectorController();
+    if (!controller)
+        return;
+    if (enabled)
+        controller->startTimelineProfiler();
+    else
+        controller->stopTimelineProfiler();
+}
+
+#endif
+
+bool DumpRenderTreeSupportQt::hasDocumentElement(QWebFrame* frame)
+{
+    return QWebFramePrivate::core(frame)->document()->documentElement();
+}
+
+void DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(QWebFrame* frame, bool enabled)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    InspectorController* controller = coreFrame->page()->inspectorController();
+    if (!controller)
+        return;
+    if (enabled)
+        controller->enableProfiler();
+    else
+        controller->disableProfiler();
+#endif
+}
+
+// Pause a given CSS animation or transition on the target node at a specific time.
+// If the animation or transition is already paused, it will update its pause time.
+// This method is only intended to be used for testing the CSS animation and transition system.
+bool DumpRenderTreeSupportQt::pauseAnimation(QWebFrame *frame, const QString &animationName, double time, const QString &elementId)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return false;
+
+    AnimationController* controller = coreFrame->animation();
+    if (!controller)
+        return false;
+
+    Document* doc = coreFrame->document();
+    Q_ASSERT(doc);
+
+    Node* coreNode = doc->getElementById(elementId);
+    if (!coreNode || !coreNode->renderer())
+        return false;
+
+    return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time);
+}
+
+bool DumpRenderTreeSupportQt::pauseTransitionOfProperty(QWebFrame *frame, const QString &propertyName, double time, const QString &elementId)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return false;
+
+    AnimationController* controller = coreFrame->animation();
+    if (!controller)
+        return false;
+
+    Document* doc = coreFrame->document();
+    Q_ASSERT(doc);
+
+    Node* coreNode = doc->getElementById(elementId);
+    if (!coreNode || !coreNode->renderer())
+        return false;
+
+    return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time);
+}
+
+// Pause a given SVG animation on the target node at a specific time.
+// This method is only intended to be used for testing the SVG animation system.
+bool DumpRenderTreeSupportQt::pauseSVGAnimation(QWebFrame *frame, const QString &animationId, double time, const QString &elementId)
+{
+#if !ENABLE(SVG)
+    return false;
+#else
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return false;
+
+    Document* doc = coreFrame->document();
+    Q_ASSERT(doc);
+
+    if (!doc->svgExtensions())
+        return false;
+
+    Node* coreNode = doc->getElementById(animationId);
+    if (!coreNode || !SVGSMILElement::isSMILElement(coreNode))
+        return false;
+
+    return doc->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreNode), time);
+#endif
+}
+
+// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
+int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return false;
+
+    AnimationController* controller = coreFrame->animation();
+    if (!controller)
+        return false;
+
+    return controller->numberOfActiveAnimations();
+}
+
+void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    coreFrame->tree()->clearName();
+}
+
+int DumpRenderTreeSupportQt::javaScriptObjectsCount()
+{
+    return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount();
+}
+
+void DumpRenderTreeSupportQt::garbageCollectorCollect()
+{
+    gcController().garbageCollectNow();
+}
+
+void DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(bool waitUntilDone)
+{
+    gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+}
+
+// Returns the value of counter in the element specified by \a id.
+QString DumpRenderTreeSupportQt::counterValueForElementById(QWebFrame* frame, const QString& id)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (Document* document = coreFrame->document()) {
+        Element* element = document->getElementById(id);
+        return WebCore::counterValueForElement(element);
+    }
+    return QString();
+}
+
+int DumpRenderTreeSupportQt::pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return -1;
+
+    Element* element = coreFrame->document()->getElementById(AtomicString(id));
+    if (!element)
+        return -1;
+
+    return PrintContext::pageNumberForElement(element, FloatSize(width, height));
+}
+
+int DumpRenderTreeSupportQt::numberOfPages(QWebFrame* frame, float width, float height)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return -1;
+
+    return PrintContext::numberOfPages(coreFrame, FloatSize(width, height));
+}
+
+// Suspend active DOM objects in this frame.
+void DumpRenderTreeSupportQt::suspendActiveDOMObjects(QWebFrame* frame)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (coreFrame->document())
+        coreFrame->document()->suspendActiveDOMObjects();
+}
+
+// Resume active DOM objects in this frame.
+void DumpRenderTreeSupportQt::resumeActiveDOMObjects(QWebFrame* frame)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (coreFrame->document())
+        coreFrame->document()->resumeActiveDOMObjects();
+}
+
+void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script)
+{
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (coreFrame)
+        JSC::JSValue result = coreFrame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue();
+}
+
+void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+    SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void DumpRenderTreeSupportQt::resetOriginAccessWhiteLists()
+{
+    SecurityOrigin::resetOriginAccessWhitelists();
+}
+
+void DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
+{
+    SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
+}
+
+void DumpRenderTreeSupportQt::setCaretBrowsingEnabled(QWebPage* page, bool value)
+{
+    page->handle()->page->settings()->setCaretBrowsingEnabled(value);
+}
+
+void DumpRenderTreeSupportQt::setMediaType(QWebFrame* frame, const QString& type)
+{
+    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    WebCore::FrameView* view = coreFrame->view();
+    view->setMediaType(type);
+    coreFrame->document()->updateStyleSelector();
+    view->forceLayout();
+}
+
+void DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(QWebPage* page, bool enabled)
+{
+    page->d->smartInsertDeleteEnabled = enabled;
+}
+
+
+void DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled)
+{
+    page->d->selectTrailingWhitespaceEnabled = enabled;
+}
+
+
+void DumpRenderTreeSupportQt::executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value)
+{
+    page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
+}
+
+bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& name)
+{
+    return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
+}
+
+QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listItem)
+{
+    return WebCore::markerTextForListItem(listItem.m_element);
+}
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
new file mode 100644
index 0000000..b92b86a
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -0,0 +1,87 @@
+/*
+    Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+    Copyright (C) 2008,2009,2010 Nokia Corporation and/or its subsidiary(-ies)
+    Copyright (C) 2007 Staikos Computing Services Inc.
+    Copyright (C) 2007 Apple Inc.
+
+    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 DumpRenderTreeSupportQt_h
+#define DumpRenderTreeSupportQt_h
+
+#include "qwebkitglobal.h"
+
+#include "qwebelement.h"
+
+class QWebPage;
+class QWebFrame;
+
+class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
+
+public:
+
+    DumpRenderTreeSupportQt();
+    ~DumpRenderTreeSupportQt();
+
+
+    static void executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value);
+    static bool isCommandEnabled(QWebPage* page, const QString& name);
+    static void setSmartInsertDeleteEnabled(QWebPage* page, bool enabled);
+    static void setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled);
+
+    static bool pauseAnimation(QWebFrame*, const QString& name, double time, const QString& elementId);
+    static bool pauseTransitionOfProperty(QWebFrame*, const QString& name, double time, const QString& elementId);
+    static bool pauseSVGAnimation(QWebFrame*, const QString& animationId, double time, const QString& elementId);
+    static void suspendActiveDOMObjects(QWebFrame* frame);
+    static void resumeActiveDOMObjects(QWebFrame* frame);
+
+    static void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
+    static void setFrameFlatteningEnabled(QWebPage*, bool);
+    static void setCaretBrowsingEnabled(QWebPage* page, bool value);
+    static void setMediaType(QWebFrame* qframe, const QString& type);
+    static void setDumpRenderTreeModeEnabled(bool b);
+
+    static void evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script);
+    static void garbageCollectorCollect();
+    static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
+    static void setJavaScriptProfilingEnabled(QWebFrame*, bool enabled);
+    static int javaScriptObjectsCount();
+
+    static void setTimelineProfilingEnabled(QWebPage*, bool enabled);
+    static void webInspectorExecuteScript(QWebPage* page, long callId, const QString& script);
+    static void webInspectorShow(QWebPage* page);
+    static void webInspectorClose(QWebPage* page);
+
+    static QString webPageGroupName(QWebPage *page);
+    static QString counterValueForElementById(QWebFrame* frame, const QString& id);
+    static void webPageSetGroupName(QWebPage* page, const QString& groupName);
+    static void clearFrameName(QWebFrame* frame);
+    static void overwritePluginDirectories();
+    static int numberOfActiveAnimations(QWebFrame*);
+    static int numberOfPages(QWebFrame* frame, float width, float height);
+    static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
+    static bool hasDocumentElement(QWebFrame* frame);
+
+    static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+    static void resetOriginAccessWhiteLists();
+
+    static int workerThreadCount();
+
+    static QString markerTextForListItem(const QWebElement& listItem);
+};
+
+#endif
diff --git a/WebKit/qt/WebCoreSupport/EditCommandQt.cpp b/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
index a166840..756ba4c 100644
--- a/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
@@ -18,7 +18,6 @@
 */
 
 #include "config.h"
-#include <wtf/Platform.h>
 #include "EditCommandQt.h"
 
 using namespace WebCore;
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 90ebb1d..8a0aa08 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -43,7 +43,6 @@
 #include "HTMLElement.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
-#include "KeyboardCodes.h"
 #include "KeyboardEvent.h"
 #include "NotImplemented.h"
 #include "Page.h"
@@ -51,6 +50,7 @@
 #include "PlatformKeyboardEvent.h"
 #include "QWebPageClient.h"
 #include "Range.h"
+#include "WindowsKeyboardCodes.h"
 
 #include <stdio.h>
 
@@ -333,14 +333,18 @@
 
 bool EditorClientQt::smartInsertDeleteEnabled()
 {
-    notImplemented();
-    return false;
+    return m_page->d->smartInsertDeleteEnabled;
+}
+
+void EditorClientQt::toggleSmartInsertDelete()
+{
+    bool current = m_page->d->smartInsertDeleteEnabled;
+    m_page->d->smartInsertDeleteEnabled = !current;
 }
 
 bool EditorClientQt::isSelectTrailingWhitespaceEnabled()
 {
-    notImplemented();
-    return false;
+    return m_page->d->selectTrailingWhitespaceEnabled;
 }
 
 void EditorClientQt::toggleContinuousSpellChecking()
@@ -384,18 +388,6 @@
         } else
 #endif // QT_NO_SHORTCUT
         switch (kevent->windowsVirtualKeyCode()) {
-#if QT_VERSION < 0x040500
-            case VK_RETURN:
-#ifdef QT_WS_MAC
-                if (kevent->shiftKey() || kevent->metaKey())
-#else
-                if (kevent->shiftKey())
-#endif
-                    frame->editor()->command("InsertLineBreak").execute();
-                else
-                    frame->editor()->command("InsertNewline").execute();
-                break;
-#endif
             case VK_BACK:
                 frame->editor()->deleteWithDirection(SelectionController::BACKWARD,
                         CharacterGranularity, false, true);
@@ -625,11 +617,11 @@
             }
         }
         webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
-#ifdef Q_WS_MAEMO_5
-        // Maemo 5 MicroB Browser disables auto-uppercase and predictive text, thus, so do we.
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
+        // disables auto-uppercase and predictive text for mobile devices
         webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true);
         webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true);
-#endif // Q_WS_MAEMO_5
+#endif // Q_WS_MAEMO_5 || Q_OS_SYMBIAN
 #endif // QT_VERSION check
         webPageClient->setInputMethodEnabled(active);
     }
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.h b/WebKit/qt/WebCoreSupport/EditorClientQt.h
index 42a402f..6c20898 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.h
@@ -48,13 +48,13 @@
     virtual bool shouldDeleteRange(Range*);
     virtual bool shouldShowDeleteInterface(HTMLElement*);
     virtual bool smartInsertDeleteEnabled(); 
+    virtual void toggleSmartInsertDelete();
     virtual bool isSelectTrailingWhitespaceEnabled(); 
     virtual bool isContinuousSpellCheckingEnabled();
     virtual void toggleContinuousSpellChecking();
     virtual bool isGrammarCheckingEnabled();
     virtual void toggleGrammarChecking();
     virtual int spellCheckerDocumentTag();
-    
     virtual bool selectWordBeforeMenuEvent();
     virtual bool isEditable();
 
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 2eb2761..f93b1cc 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -50,6 +50,7 @@
 #include "HTMLAppletElement.h"
 #include "HTMLFormElement.h"
 #include "HTMLPlugInElement.h"
+#include "HTTPParsers.h"
 #include "NotImplemented.h"
 #include "QNetworkReplyHandler.h"
 #include "ResourceHandleInternal.h"
@@ -74,10 +75,14 @@
 #include <QGraphicsWidget>
 #include <QNetworkRequest>
 #include <QNetworkReply>
+#include <QStringList>
 #include "qwebhistory_p.h"
 
 static bool dumpFrameLoaderCallbacks = false;
 static bool dumpResourceLoadCallbacks = false;
+static bool sendRequestReturnsNullOnRedirect = false;
+static bool sendRequestReturnsNull = false;
+static QStringList sendRequestClearHeaders;
 
 static QMap<unsigned long, QString> dumpAssignedUrls;
 
@@ -91,6 +96,21 @@
     dumpResourceLoadCallbacks = b;
 }
 
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null_on_redirect(bool b)
+{
+    sendRequestReturnsNullOnRedirect = b;
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null(bool b)
+{
+    sendRequestReturnsNull = b;
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_clear_headers(const QStringList& headers)
+{
+    sendRequestClearHeaders = headers;
+}
+
 // Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
 static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
 {
@@ -124,16 +144,16 @@
 static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRequest& request)
 {
     QString url = request.url().string();
-    return QString::fromLatin1("<NSURLRequest %1>").arg(url);
+    QString httpMethod = request.httpMethod();
+    QString mainDocumentUrl = request.firstPartyForCookies().string();
+    return QString::fromLatin1("<NSURLRequest URL %1, main document URL %2, http method %3>").arg(url).arg(mainDocumentUrl).arg(httpMethod);
 }
 
 static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceResponse& response)
 {
-    QString text = response.httpStatusText();
-    if (text.isEmpty())
-        return QLatin1String("(null)");
-
-    return text;
+    QString url = response.url().string();
+    int httpStatusCode = response.httpStatusCode();
+    return QString::fromLatin1("<NSURLResponse %1, http status code %2>").arg(url).arg(httpStatusCode);
 }
 
 
@@ -214,12 +234,17 @@
     QWebPage* page = m_webFrame->page();
     const QSize preferredLayoutSize = page->preferredContentsSize();
 
+    ScrollbarMode hScrollbar = (ScrollbarMode) m_webFrame->scrollBarPolicy(Qt::Horizontal);
+    ScrollbarMode vScrollbar = (ScrollbarMode) m_webFrame->scrollBarPolicy(Qt::Vertical);
+    bool hLock = hScrollbar != ScrollbarAuto;
+    bool vLock = vScrollbar != ScrollbarAuto;
+
     m_frame->createView(m_webFrame->page()->viewportSize(),
                         backgroundColor, !backgroundColor.alpha(),
                         preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(),
                         preferredLayoutSize.isValid(),
-                        (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
-                        (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
+                        hScrollbar, hLock,
+                        vScrollbar, vLock);
 }
 
 
@@ -511,12 +536,13 @@
     if (!m_pluginView) {
         if(m_firstData) {
             FrameLoader *fl = loader->frameLoader();
-            fl->setEncoding(m_response.textEncodingName(), false);
+            fl->writer()->setEncoding(m_response.textEncodingName(), false);
             m_firstData = false; 
         }
     }
     else {
-        m_pluginView->didFinishLoading();
+        if (m_pluginView->isPluginView())
+            m_pluginView->didFinishLoading();
         m_pluginView = 0;
         m_hasSentResponseToPlugin = false;
     }
@@ -701,11 +727,12 @@
 {
     if (!m_pluginView) {
         if (m_firstData) {
-            loader->frameLoader()->setEncoding(m_response.textEncodingName(), false);
+            loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
             m_firstData = false;
         }
     } else {
-        m_pluginView->didFail(error);
+        if (m_pluginView->isPluginView())
+            m_pluginView->didFail(error);
         m_pluginView = 0;
         m_hasSentResponseToPlugin = false;
     }
@@ -718,14 +745,14 @@
             return;
         FrameLoader *fl = loader->frameLoader();
         if (m_firstData) {
-            fl->setEncoding(m_response.textEncodingName(), false);
+            fl->writer()->setEncoding(m_response.textEncodingName(), false);
             m_firstData = false;
         }
         fl->addData(data, length);
     }
     
     // We re-check here as the plugin can have been created
-    if (m_pluginView) {
+    if (m_pluginView && m_pluginView->isPluginView()) {
         if (!m_hasSentResponseToPlugin) {
             m_pluginView->didReceiveResponse(loader->response());
             // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
@@ -819,7 +846,7 @@
     if (reply) {
         QWebPage *page = m_webFrame->page();
         if (page->forwardUnsupportedContent())
-            emit m_webFrame->page()->unsupportedContent(reply);
+            emit page->unsupportedContent(reply);
         else
             reply->abort();
     }
@@ -833,11 +860,23 @@
 
 void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse)
 {
+
     if (dumpResourceLoadCallbacks)
         printf("%s - willSendRequest %s redirectResponse %s\n",
                qPrintable(dumpAssignedUrls[identifier]),
                qPrintable(drtDescriptionSuitableForTestResult(newRequest)),
-               qPrintable(drtDescriptionSuitableForTestResult(redirectResponse)));
+               (redirectResponse.isNull()) ? "(null)" : qPrintable(drtDescriptionSuitableForTestResult(redirectResponse)));
+
+    if (sendRequestReturnsNull)
+        newRequest.setURL(QUrl());
+
+    if (sendRequestReturnsNullOnRedirect && !redirectResponse.isNull()) {
+        printf("Returning null for this redirect\n");
+        newRequest.setURL(QUrl());
+    }
+
+    for (int i = 0; i < sendRequestClearHeaders.size(); ++i)
+          newRequest.setHTTPHeaderField(sendRequestClearHeaders.at(i).toLocal8Bit().constData(), QString());
 
     // seems like the Mac code doesn't do anything here by default neither
     //qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string`();
@@ -860,11 +899,15 @@
     notImplemented();
 }
 
-void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceResponse& response)
+void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse& response)
 {
 
     m_response = response;
     m_firstData = true;
+    if (dumpResourceLoadCallbacks)
+        printf("%s - didReceiveResponse %s\n",
+               qPrintable(dumpAssignedUrls[identifier]),
+               qPrintable(drtDescriptionSuitableForTestResult(response)));
     //qDebug() << "    got response from" << response.url().string();
 }
 
@@ -872,18 +915,23 @@
 {
 }
 
-void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long)
+void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier)
 {
+    if (dumpResourceLoadCallbacks)
+        printf("%s - didFinishLoading\n",
+               (dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"));
 }
 
 void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const WebCore::ResourceError& error)
 {
     if (dumpResourceLoadCallbacks)
-        printf("%s - didFailLoadingWithError: %s\n", qPrintable(dumpAssignedUrls[identifier]), qPrintable(drtDescriptionSuitableForTestResult(error)));
+        printf("%s - didFailLoadingWithError: %s\n",
+               (dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"),
+               qPrintable(drtDescriptionSuitableForTestResult(error)));
 
     if (m_firstData) {
         FrameLoader *fl = loader->frameLoader();
-        fl->setEncoding(m_response.textEncodingName(), false);
+        fl->writer()->setEncoding(m_response.textEncodingName(), false);
         m_firstData = false;
     }
 }
@@ -894,11 +942,6 @@
     return false;
 }
 
-void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const WebCore::ScriptString&)
-{
-    notImplemented();
-}
-
 void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error)
 {
     QWebPage* page = m_webFrame->page();
@@ -966,7 +1009,10 @@
 void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WebCore::String& MIMEType, const WebCore::ResourceRequest&)
 {
     // we need to call directly here
-    if (canShowMIMEType(MIMEType))
+    const ResourceResponse& response = m_frame->loader()->activeDocumentLoader()->response();
+    if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment)
+        callPolicyFunction(function, PolicyDownload);
+    else if (canShowMIMEType(MIMEType))
         callPolicyFunction(function, PolicyUse);
     else
         callPolicyFunction(function, PolicyDownload);
@@ -1165,6 +1211,8 @@
         platformWidget()->setMask(clipRegion);
 
         handleVisibility();
+
+        platformWidget()->update();
     }
 
     virtual void show()
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index adeb31c..2756871 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -96,7 +96,6 @@
         virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long);
         virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceError&);
         virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int);
-        virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString& sourceString);
 
         virtual void dispatchDidHandleOnloadEvents();
         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 5f343ff..7fabbda 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -81,64 +81,21 @@
     delete this;
 }
 
-Page* InspectorClientQt::createPage()
+    
+void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
 {
-    QWebView* inspectorView = m_inspectorView.get();
-    if (!inspectorView) {
-        inspectorView = new QWebView;
-        InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
-        inspectorView->setPage(inspectorPage);
-        m_inspectorView.set(inspectorView);
-    }
+    QWebView* inspectorView = new QWebView;
+    InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
+    inspectorView->setPage(inspectorPage);
 
-    inspectorView->page()->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
+    QUrl inspectorUrl = m_inspectedWebPage->settings()->inspectorUrl();
+    if (!inspectorUrl.isValid())
+        inspectorUrl = QUrl("qrc:/webkit/inspector/inspector.html");
+    inspectorView->page()->mainFrame()->load(inspectorUrl);
     m_inspectedWebPage->d->inspectorFrontend = inspectorView;
     m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(inspectorView);
 
-    return inspectorView->page()->d->page;
-}
-
-String InspectorClientQt::localizedStringsURL()
-{
-    notImplemented();
-    return String();
-}
-
-String InspectorClientQt::hiddenPanels()
-{
-    notImplemented();
-    return String();
-}
-
-void InspectorClientQt::showWindow()
-{
-    updateWindowTitle();
-
-#if ENABLE(INSPECTOR)
-    m_inspectedWebPage->d->inspectorController()->setWindowVisible(true, true);
-#endif
-}
-
-void InspectorClientQt::closeWindow()
-{
-#if ENABLE(INSPECTOR)
-    m_inspectedWebPage->d->inspectorController()->setWindowVisible(false);
-#endif
-}
-
-void InspectorClientQt::attachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientQt::detachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientQt::setAttachedWindowHeight(unsigned)
-{
-    notImplemented();
+    inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView));
 }
 
 void InspectorClientQt::highlight(Node*)
@@ -151,27 +108,13 @@
     notImplemented();
 }
 
-void InspectorClientQt::inspectedURLChanged(const String& newURL)
-{
-    m_inspectedURL = newURL;
-    updateWindowTitle();
-}
-
-void InspectorClientQt::inspectorWindowObjectCleared()
-{
-    notImplemented();
-}
-
-void InspectorClientQt::updateWindowTitle()
-{
-    if (m_inspectedWebPage->d->inspector) {
-        QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
-        m_inspectedWebPage->d->inspector->setWindowTitle(caption);
-    }
-}
-
 void InspectorClientQt::populateSetting(const String& key, String* setting)
 {
+#ifdef QT_NO_SETTINGS
+    Q_UNUSED(key)
+    Q_UNUSED(setting)
+    qWarning("QWebInspector: QSettings is not supported by Qt.");
+#else
     QSettings qsettings;
     if (qsettings.status() == QSettings::AccessError) {
         // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called
@@ -180,15 +123,21 @@
         return;
     }
 
-    QString settingKey(settingStoragePrefix + key);
+    QString settingKey(settingStoragePrefix + QString(key));
     QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
     QVariant storedValue = qsettings.value(settingKey);
     storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
     *setting = variantToSetting(storedValue);
+#endif // QT_NO_SETTINGS
 }
 
 void InspectorClientQt::storeSetting(const String& key, const String& setting)
 {
+#ifdef QT_NO_SETTINGS
+    Q_UNUSED(key)
+    Q_UNUSED(setting)
+    qWarning("QWebInspector: QSettings is not supported by Qt.");
+#else
     QSettings qsettings;
     if (qsettings.status() == QSettings::AccessError) {
         qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
@@ -197,9 +146,10 @@
     }
 
     QVariant valueToStore = settingToVariant(setting);
-    QString settingKey(settingStoragePrefix + key);
+    QString settingKey(settingStoragePrefix + QString(key));
     qsettings.setValue(settingKey, valueToStore);
     qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
+#endif // QT_NO_SETTINGS
 }
 
 static String variantToSetting(const QVariant& qvariant)
@@ -211,6 +161,8 @@
         retVal = qvariant.toBool() ? "true" : "false";
     case QVariant::String:
         retVal = qvariant.toString();
+    default:
+        break;
     }
 
     return retVal;
@@ -223,6 +175,81 @@
     return retVal;
 }
 
+InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView)
+    : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page) 
+    , m_inspectedWebPage(inspectedWebPage)
+    , m_inspectorView(inspectorView)
+    , m_destroyingInspectorView(false)
+{
+}
+
+void InspectorFrontendClientQt::frontendLoaded()
+{
+    InspectorFrontendClientLocal::frontendLoaded();
+    setAttachedWindow(true);
+}
+
+String InspectorFrontendClientQt::localizedStringsURL()
+{
+    notImplemented();
+    return String();
+}
+
+String InspectorFrontendClientQt::hiddenPanels()
+{
+    notImplemented();
+    return String();
+}
+
+void InspectorFrontendClientQt::bringToFront()
+{
+    updateWindowTitle();
+}
+
+void InspectorFrontendClientQt::closeWindow()
+{
+    if (m_destroyingInspectorView)
+        return;
+    m_destroyingInspectorView = true;
+
+    // Clear reference from QWebInspector to the frontend view.
+    m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0);
+#if ENABLE(INSPECTOR)
+    m_inspectedWebPage->d->inspectorController()->disconnectFrontend();
+#endif
+    // Clear pointer before deleting WebView to avoid recursive calls to its destructor.
+    delete m_inspectorView.release();
+}
+
+void InspectorFrontendClientQt::attachWindow()
+{
+    notImplemented();
+}
+
+void InspectorFrontendClientQt::detachWindow()
+{
+    notImplemented();
+}
+
+void InspectorFrontendClientQt::setAttachedWindowHeight(unsigned)
+{
+    notImplemented();
+}
+
+void InspectorFrontendClientQt::inspectedURLChanged(const String& newURL)
+{
+    m_inspectedURL = newURL;
+    updateWindowTitle();
+}
+
+void InspectorFrontendClientQt::updateWindowTitle()
+{
+    if (m_inspectedWebPage->d->inspector) {
+        QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
+        m_inspectedWebPage->d->inspector->setWindowTitle(caption);
+    }
+}
+
 }
 
 #include "InspectorClientQt.moc"
diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 923bab4..4beadab 100644
--- a/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -31,52 +31,64 @@
 #define InspectorClientQt_h
 
 #include "InspectorClient.h"
+#include "InspectorFrontendClientLocal.h"
 #include "OwnPtr.h"
+#include "PassOwnPtr.h"
 #include <QtCore/QString>
 
 class QWebPage;
 class QWebView;
 
 namespace WebCore {
-    class Node;
-    class Page;
-    class String;
+class Node;
+class Page;
+class String;
 
-    class InspectorClientQt : public InspectorClient {
-    public:
-        InspectorClientQt(QWebPage*);
+class InspectorClientQt : public InspectorClient {
+public:
+    InspectorClientQt(QWebPage*);
 
-        virtual void inspectorDestroyed();
+    virtual void inspectorDestroyed();
 
-        virtual Page* createPage();
+    virtual void openInspectorFrontend(WebCore::InspectorController*);
 
-        virtual String localizedStringsURL();
+    virtual void highlight(Node*);
+    virtual void hideHighlight();
 
-        virtual String hiddenPanels();
+    virtual void populateSetting(const String& key, String* value);
+    virtual void storeSetting(const String& key, const String& value);
 
-        virtual void showWindow();
-        virtual void closeWindow();
+private:
+    QWebPage* m_inspectedWebPage;
+};
 
-        virtual void attachWindow();
-        virtual void detachWindow();
+class InspectorFrontendClientQt : public InspectorFrontendClientLocal {
+public:
+    InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView);
 
-        virtual void setAttachedWindowHeight(unsigned height);
+    virtual void frontendLoaded();
 
-        virtual void highlight(Node*);
-        virtual void hideHighlight();
-        virtual void inspectedURLChanged(const String& newURL);
+    virtual String localizedStringsURL();
 
-        virtual void populateSetting(const String& key, String* value);
-        virtual void storeSetting(const String& key, const String& value);
+    virtual String hiddenPanels();
 
-        virtual void inspectorWindowObjectCleared();
+    virtual void bringToFront();
+    virtual void closeWindow();
 
-    private:
-        void updateWindowTitle();
-        QWebPage* m_inspectedWebPage;
-        OwnPtr<QWebView> m_inspectorView;
-        QString m_inspectedURL;
-    };
+    virtual void attachWindow();
+    virtual void detachWindow();
+
+    virtual void setAttachedWindowHeight(unsigned height);
+
+    virtual void inspectedURLChanged(const String& newURL);
+
+private:
+    void updateWindowTitle();
+    QWebPage* m_inspectedWebPage;
+    OwnPtr<QWebView> m_inspectorView;
+    QString m_inspectedURL;
+    bool m_destroyingInspectorView;
+};
 }
 
 #endif
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
new file mode 100644
index 0000000..e440837
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 "NotificationPresenterClientQt.h"
+
+#include "Document.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "SecurityOrigin.h"
+
+#include "qwebkitglobal.h"
+
+#include <QtGui>
+
+static bool dumpNotification = false;
+
+void QWEBKIT_EXPORT qt_dump_notification(bool b)
+{
+    dumpNotification = b;
+}
+
+#if ENABLE(NOTIFICATIONS)
+
+using namespace WebCore;
+
+NotificationPresenterClientQt::NotificationPresenterClientQt()
+{
+}
+
+bool NotificationPresenterClientQt::show(Notification* notification)
+{
+    if (dumpNotification) {
+        if (notification->isHTML())
+            printf("DESKTOP NOTIFICATION: contents at %s\n", QString(notification->url().string()).toUtf8().constData());
+        else {
+            printf("DESKTOP NOTIFICATION: icon %s, title %s, text %s\n", 
+                QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(), 
+                QString(notification->contents().body()).toUtf8().constData());
+        }
+    }
+
+#ifndef QT_NO_SYSTEMTRAYICON
+    m_tray.show();
+    m_tray.showMessage(notification->contents().title(), notification->contents().body(), QSystemTrayIcon::Information);
+#endif
+    return true;
+}
+
+void NotificationPresenterClientQt::cancel(Notification* notification)
+{  
+    if (dumpNotification) {
+        if (notification->isHTML())
+            printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->url().string()).toUtf8().constData());
+        else
+            printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->contents().title()).toUtf8().constData());
+    }
+
+    notImplemented();
+}
+
+void NotificationPresenterClientQt::notificationObjectDestroyed(Notification* notification)
+{
+    notImplemented();
+}
+
+void NotificationPresenterClientQt::requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
+{  
+    if (dumpNotification)
+      printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(origin->toString()).toUtf8().constData());
+
+    notImplemented();
+}
+
+NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(const KURL&)
+{
+    // FIXME Implement permission policy
+    return NotificationPresenter::PermissionAllowed;
+}
+
+#endif // ENABLE(NOTIFICATIONS)
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
new file mode 100644
index 0000000..272c661
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 "Notification.h"
+#include "NotificationPresenter.h"
+
+#include <QSystemTrayIcon>
+
+#if ENABLE(NOTIFICATIONS)
+
+namespace WebCore {
+class Document;
+class KURL;
+
+class NotificationPresenterClientQt : public NotificationPresenter {
+public:
+    NotificationPresenterClientQt();
+
+    /* WebCore::NotificationPresenter interface */
+    virtual bool show(Notification*);
+    virtual void cancel(Notification*);
+    virtual void notificationObjectDestroyed(Notification*);
+    virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>);
+    virtual NotificationPresenter::Permission checkPermission(const KURL&);
+
+private: 
+#ifndef QT_NO_SYSTEMTRAYICON
+    QSystemTrayIcon m_tray;
+#endif
+};
+}
+
+#endif
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index c553c45..7514077 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -23,8 +23,8 @@
 
 #include "HostWindow.h"
 #include "PopupMenuClient.h"
-#include "qgraphicswebview.h"
 #include "QWebPageClient.h"
+#include "qgraphicswebview.h"
 #include <QAbstractItemView>
 #include <QApplication>
 #include <QGraphicsProxyWidget>
@@ -34,6 +34,12 @@
 #include <QMouseEvent>
 #include <QStandardItemModel>
 
+#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
+#include <BrCtlDialogsProvider.h>
+#include <BrowserDialogsProvider.h> // S60 platform private header file
+#include <e32base.h>
+#endif
+
 namespace WebCore {
 
 QtFallbackWebPopupCombo::QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup)
@@ -49,6 +55,7 @@
 
 void QtFallbackWebPopupCombo::hidePopup()
 {
+#ifndef QT_NO_IM
     QWidget* activeFocus = QApplication::focusWidget();
     if (activeFocus && activeFocus == QComboBox::view()
         && activeFocus->testAttribute(Qt::WA_InputMethodEnabled)) {
@@ -58,6 +65,7 @@
             qic->setFocusWidget(0);
         }
     }
+#endif // QT_NO_IM
 
     QComboBox::hidePopup();
 
@@ -93,17 +101,15 @@
 
 void QtFallbackWebPopup::show()
 {
+    if (!pageClient())
+        return;
+
+#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
+    TRAP_IGNORE(showS60BrowserDialog());
+#else
     populate();
     m_combo->setCurrentIndex(currentIndex());
 
-#if defined(Q_WS_MAEMO_5)
-    // Comboboxes with Qt on Maemo 5 come up in their full width on the screen, so neither
-    // the proxy widget, nor the coordinates are needed.
-    m_combo->setParent(pageClient()->ownerWidget());
-    m_combo->showPopup();
-    return;
-#endif
-
     QRect rect = geometry();
     if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) {
         if (!m_proxy) {
@@ -119,13 +125,65 @@
 
     }
 
-    // QCursor::pos() is not a great idea for a touch screen, but as Maemo 5 is handled
-    // separately above, this should be okay.
     QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton,
                       Qt::LeftButton, Qt::NoModifier);
     QCoreApplication::sendEvent(m_combo, &event);
+#endif
 }
 
+#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
+
+static void ResetAndDestroy(TAny* aPtr)
+{
+    RPointerArray<HBufC>* items = reinterpret_cast<RPointerArray<HBufC>* >(aPtr);
+    items->ResetAndDestroy();
+}
+
+void QtFallbackWebPopup::showS60BrowserDialog()
+{
+    static MBrCtlDialogsProvider* dialogs = CBrowserDialogsProvider::NewL(0);
+    if (!dialogs)
+        return;
+
+    int size = itemCount();
+    CArrayFix<TBrCtlSelectOptionData>* options = new CArrayFixFlat<TBrCtlSelectOptionData>(qMax(1, size));
+    RPointerArray<HBufC> items(qMax(1, size));
+    CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &items));
+
+    for (int i = 0; i < size; i++) {
+        if (itemType(i) == Separator) {
+            TBrCtlSelectOptionData data(_L("----------"), false, false, false);
+            options->AppendL(data);
+        } else {
+            HBufC16* itemStr = HBufC16::NewL(itemText(i).length());
+            itemStr->Des().Copy((const TUint16*)itemText(i).utf16(), itemText(i).length());
+            CleanupStack::PushL(itemStr);
+            TBrCtlSelectOptionData data(*itemStr, i == currentIndex(), false, itemIsEnabled(i));
+            options->AppendL(data);
+            items.AppendL(itemStr);
+            CleanupStack::Pop();
+        }
+    }
+
+    dialogs->DialogSelectOptionL(KNullDesC(), (TBrCtlSelectOptionType)(ESelectTypeSingle | ESelectTypeWithFindPane), *options);
+
+    CleanupStack::PopAndDestroy(&items);
+
+    int newIndex;
+    for (newIndex = 0; newIndex < options->Count() && !options->At(newIndex).IsSelected(); newIndex++) {}
+    if (newIndex == options->Count())
+        newIndex = currentIndex();
+    
+    m_popupVisible = false;
+    popupDidHide();
+
+    if (currentIndex() != newIndex && newIndex >= 0)
+        valueChanged(newIndex);
+
+    delete options;
+}
+#endif
+
 void QtFallbackWebPopup::hide()
 {
     m_combo->hidePopup();
@@ -138,7 +196,7 @@
     QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model());
     Q_ASSERT(model);
 
-#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5)
+#if !defined(Q_WS_S60)
     m_combo->setFont(font());
 #endif
     for (int i = 0; i < itemCount(); ++i) {
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
index 3924bf6..62b8aea 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -23,7 +23,9 @@
 #include "QtAbstractWebPopup.h"
 #include <QComboBox>
 
+QT_BEGIN_NAMESPACE
 class QGraphicsProxyWidget;
+QT_END_NAMESPACE
 
 namespace WebCore {
 
@@ -48,6 +50,9 @@
     QGraphicsProxyWidget* m_proxy;
 
     void populate();
+#if ENABLE(SYMBIAN_DIALOG_PROVIDERS)
+    void showS60BrowserDialog();
+#endif
 };
 
 class QtFallbackWebPopupCombo : public QComboBox {
diff --git a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp
new file mode 100644
index 0000000..29a16cb
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 "QtMaemoWebPopup.h"
+
+#include <QHBoxLayout>
+#include <QListWidget>
+#include <QListWidgetItem>
+#include <QPainter>
+#include <QPushButton>
+#include <QStyledItemDelegate>
+#include <QVBoxLayout>
+
+#include <libintl.h>
+
+
+namespace WebCore {
+
+static const int gMaemoListItemSize = 70;
+static const int gMaemoListPadding = 38;
+static const int gMaemoMaxVisibleItems = 5;
+
+void Maemo5Popup::populateList()
+{
+    QListWidgetItem* listItem;
+    for (int i = 0; i < m_data.itemCount(); ++i) {
+        if (m_data.itemType(i) == QtAbstractWebPopup::Option) {
+            listItem = new QListWidgetItem(m_data.itemText(i));
+            m_list->addItem(listItem);
+            listItem->setSelected(m_data.itemIsSelected(i));
+        } else if (m_data.itemType(i) == QtAbstractWebPopup::Group) {
+            listItem = new QListWidgetItem(m_data.itemText(i));
+            m_list->addItem(listItem);
+            listItem->setSelected(false);
+            listItem->setFlags(Qt::NoItemFlags);
+        }
+    }
+    connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemSelected(QListWidgetItem*)));
+}
+
+void Maemo5Popup::onItemSelected(QListWidgetItem* item)
+{
+    if (item->flags() != Qt::NoItemFlags)
+        emit itemClicked(m_list->row(item));
+}
+
+QtMaemoWebPopup::QtMaemoWebPopup()
+    : QtAbstractWebPopup()
+    , m_popup(0)
+{
+}
+
+QtMaemoWebPopup::~QtMaemoWebPopup()
+{
+    if (m_popup)
+        m_popup->deleteLater();
+}
+
+Maemo5Popup* QtMaemoWebPopup::createSingleSelectionPopup()
+{
+    return new Maemo5SingleSelectionPopup(*this);
+}
+
+Maemo5Popup* QtMaemoWebPopup::createMultipleSelectionPopup()
+{
+    return new Maemo5MultipleSelectionPopup(*this);
+}
+
+Maemo5Popup* QtMaemoWebPopup::createPopup()
+{
+    Maemo5Popup* result = multiple() ? createMultipleSelectionPopup() : createSingleSelectionPopup();
+    connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed()));
+    connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int)));
+    return result;
+}
+
+void QtMaemoWebPopup::show()
+{
+    if (!pageClient() || m_popup)
+        return;
+
+    m_popup = createPopup();
+    m_popup->show();
+}
+
+void QtMaemoWebPopup::hide()
+{
+    if (!m_popup)
+        return;
+
+    m_popup->accept();
+}
+
+void QtMaemoWebPopup::popupClosed()
+{
+    if (!m_popup)
+        return;
+
+    m_popup->deleteLater();
+    m_popup = 0;
+    popupDidHide();
+}
+
+void QtMaemoWebPopup::itemClicked(int idx)
+{
+    selectItem(idx, true, false);
+}
+
+Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup(QtAbstractWebPopup& data)
+    : Maemo5Popup(data)
+{
+    // we try to get the standard list title the web browser is using
+    const char* title = ::dgettext("osso-browser-ui", "weba_ti_texlist_single");
+    if (qstrcmp(title, "weba_ti_texlist_single"))
+        setWindowTitle(QString::fromUtf8(title));
+    else
+        setWindowTitle("Select item");
+
+    QHBoxLayout* hLayout = new QHBoxLayout(this);
+    hLayout->setContentsMargins(0, 0, 0, 0);
+
+    m_list = new QListWidget(this);
+    populateList();
+
+    hLayout->addSpacing(gMaemoListPadding);
+    hLayout->addWidget(m_list);
+    hLayout->addSpacing(gMaemoListPadding);
+
+    connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(accept()));
+
+    const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count();
+    resize(size().width(), visibleItemCount * gMaemoListItemSize);
+}
+
+
+class MultipleItemListDelegate : public QStyledItemDelegate {
+public:
+    MultipleItemListDelegate(QObject* parent = 0)
+           : QStyledItemDelegate(parent)
+    {
+        tickMark = QIcon::fromTheme("widgets_tickmark_list").pixmap(48, 48);
+    }
+
+    void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
+    {
+        QStyledItemDelegate::paint(painter, option, index);
+
+        if (option.state & QStyle::State_Selected)
+            painter->drawPixmap(option.rect.width() - tickMark.rect().width(), option.rect.y() + (option.rect.height() / 2 - tickMark.rect().height() / 2), tickMark);
+    }
+
+private:
+    QPixmap tickMark;
+};
+
+Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup(QtAbstractWebPopup& data)
+    : Maemo5Popup(data)
+{
+    // we try to get the standard list title the web browser is using
+    const char* title = ::dgettext("osso-browser-ui", "weba_ti_textlist_multi");
+    if (qstrcmp(title, "weba_ti_textlist_multi"))
+        setWindowTitle(QString::fromUtf8(title));
+    else
+        setWindowTitle("Select items");
+
+    QHBoxLayout* hLayout = new QHBoxLayout(this);
+    hLayout->setContentsMargins(0, 0, 0, 0);
+
+    m_list = new QListWidget(this);
+    m_list->setSelectionMode(QAbstractItemView::MultiSelection);
+    populateList();
+
+    MultipleItemListDelegate* delegate = new MultipleItemListDelegate(this);
+    m_list->setItemDelegate(delegate);
+
+    hLayout->addSpacing(gMaemoListPadding);
+    hLayout->addWidget(m_list);
+
+    QVBoxLayout* vLayout = new QVBoxLayout();
+
+    const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count();
+    vLayout->addSpacing((visibleItemCount - 1) * gMaemoListItemSize);
+
+    // we try to get the standard Done button title
+    QPushButton* done = new QPushButton(this);
+    title = ::dgettext("hildon-libs", "wdgt_bd_done");
+    if (qstrcmp(title, "wdgt_bd_done"))
+        done->setText(QString::fromUtf8(title));
+    else
+        done->setText("Done");
+
+    done->setMinimumWidth(178);
+    vLayout->addWidget(done);
+
+    hLayout->addSpacing(8);
+    hLayout->addLayout(vLayout);
+    hLayout->addSpacing(18);
+
+    connect(done, SIGNAL(clicked()), this, SLOT(accept()));
+    resize(size().width(), visibleItemCount * gMaemoListItemSize);
+}
+
+}
diff --git a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h
new file mode 100644
index 0000000..a163a20
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 QtMaemoWebPopup_h
+#define QtMaemoWebPopup_h
+
+#include "QtAbstractWebPopup.h"
+
+#include <QDialog>
+
+class QListWidgetItem;
+class QListWidget;
+
+
+namespace WebCore {
+
+class Maemo5Popup : public QDialog {
+    Q_OBJECT
+public:
+    Maemo5Popup(QtAbstractWebPopup& data) : m_data(data) {}
+
+signals:
+    void itemClicked(int idx);
+
+protected slots:
+    void onItemSelected(QListWidgetItem* item);
+
+protected:
+    void populateList();
+
+    QtAbstractWebPopup& m_data;
+    QListWidget* m_list;
+};
+
+
+class QtMaemoWebPopup : public QObject, public QtAbstractWebPopup {
+    Q_OBJECT
+public:
+    QtMaemoWebPopup();
+    ~QtMaemoWebPopup();
+
+    virtual void show();
+    virtual void hide();
+
+private slots:
+    void popupClosed();
+    void itemClicked(int idx);
+
+private:
+    Maemo5Popup* m_popup;
+
+    Maemo5Popup* createPopup();
+    Maemo5Popup* createSingleSelectionPopup();
+    Maemo5Popup* createMultipleSelectionPopup();
+};
+
+
+class Maemo5SingleSelectionPopup : public Maemo5Popup {
+    Q_OBJECT
+public:
+    Maemo5SingleSelectionPopup(QtAbstractWebPopup& data);
+};
+
+
+class Maemo5MultipleSelectionPopup : public Maemo5Popup {
+    Q_OBJECT
+public:
+    Maemo5MultipleSelectionPopup(QtAbstractWebPopup& data);
+};
+
+}
+
+#endif // QtMaemoWebPopup_h
diff --git a/WebKit/qt/docs/qtwebkit.qdoc b/WebKit/qt/docs/qtwebkit.qdoc
index 411762a..9e653e4 100644
--- a/WebKit/qt/docs/qtwebkit.qdoc
+++ b/WebKit/qt/docs/qtwebkit.qdoc
@@ -83,9 +83,6 @@
     QtWebKit is based on the Open Source WebKit engine. More information about
     WebKit itself can be found on the \l{WebKit Open Source Project} Web site.
 
-    The QtWebKit module is part of the \l{Qt Full Framework Edition}, and the
-    \l{Open Source Versions of Qt}.
-
     \note Building the QtWebKit module with debugging symbols is problematic
     on many platforms due to the size of the WebKit engine. We recommend
     building the module only in release mode for embedded platforms.
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index f53bb0d..145fe0b 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -693,9 +693,30 @@
 	_Z23qt_networkAccessAllowedb @ 692 NONAME
 	_Z25qt_resumeActiveDOMObjectsP9QWebFrame @ 693 NONAME
 	_Z26qt_suspendActiveDOMObjectsP9QWebFrame @ 694 NONAME
-	_Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameii @ 695 NONAME
-	_ZN13QWebInspector10closeEventEP11QCloseEvent @ 696 NONAME
-	_ZN9QWebFrame17scrollRecursivelyEii @ 697 NONAME
+	_Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameii @ 695 NONAME ABSENT
+	_Z35qtwebkit_webframe_scrollRecursivelyP9QWebFrameiiRK6QPoint @ 696 NONAME
+	_ZN9QWebFrame17scrollRecursivelyEii @ 697 NONAME ABSENT
 	_ZN16QGraphicsWebView20setResizesToContentsEb @ 698 NONAME
 	_ZNK16QGraphicsWebView17resizesToContentsEv @ 699 NONAME
-
+	_Z20qt_drt_numberOfPagesP9QWebFrameff @ 700 NONAME
+	_Z24qt_drt_pauseSVGAnimationP9QWebFrameRK7QStringdS3_ @ 701 NONAME
+	_Z24qt_drt_webinspector_showP8QWebPage @ 702 NONAME
+	_Z24qt_drt_workerThreadCountv @ 703 NONAME
+	_Z25qt_drt_hasDocumentElementP9QWebFrame @ 704 NONAME
+	_Z25qt_drt_webinspector_closeP8QWebPage @ 705 NONAME
+	_Z31qt_drt_pageNumberForElementByIdP9QWebFrameRK7QStringff @ 706 NONAME
+	_Z33qt_drt_webinspector_executeScriptP8QWebPagelRK7QString @ 707 NONAME
+	_Z34qt_drt_setTimelineProfilingEnabledP8QWebPageb @ 708 NONAME
+	_Z32qt_drt_setFrameFlatteningEnabledP8QWebPageb @ 709 NONAME
+	_Z36qt_drt_evaluateScriptInIsolatedWorldP9QWebFrameiRK7QString @ 710 NONAME
+	_Z47qt_drt_setDomainRelaxationForbiddenForURLSchemebRK7QString @ 711 NONAME
+	_ZN9QWebFrame11pageChangedEv @ 712 NONAME
+	_ZN9QWebFrame14scrollToAnchorERK7QString @ 713 NONAME
+	_ZN12QWebSettings15setInspectorUrlERK4QUrl @ 714 NONAME
+	_ZN13QWebInspector10closeEventEP11QCloseEvent @ 715 NONAME
+	_ZN16QGraphicsWebView26setTiledBackingStoreFrozenEb @ 716 NONAME
+	_ZNK16QGraphicsWebView25isTiledBackingStoreFrozenEv @ 717 NONAME
+	_Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME
+	_Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME
+	_Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME
+	_ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME
diff --git a/WebKit/qt/tests/benchmarks/loading/loading.pro b/WebKit/qt/tests/benchmarks/loading/loading.pro
index 8b24274..024211f 100644
--- a/WebKit/qt/tests/benchmarks/loading/loading.pro
+++ b/WebKit/qt/tests/benchmarks/loading/loading.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../..
 include(../../tests.pri)
diff --git a/WebKit/qt/tests/benchmarks/painting/painting.pro b/WebKit/qt/tests/benchmarks/painting/painting.pro
index 8acdd5c..b4fc56a 100644
--- a/WebKit/qt/tests/benchmarks/painting/painting.pro
+++ b/WebKit/qt/tests/benchmarks/painting/painting.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../..
 include(../../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp b/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp
index f4531fd..fc5b8e3 100644
--- a/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp
+++ b/WebKit/qt/tests/benchmarks/painting/tst_painting.cpp
@@ -19,6 +19,7 @@
 
 #include <QtTest/QtTest>
 
+#include <qwebelement.h>
 #include <qwebframe.h>
 #include <qwebview.h>
 #include <qpainter.h>
@@ -59,6 +60,7 @@
 private Q_SLOTS:
     void paint_data();
     void paint();
+    void textAreas();
 
 private:
     QWebView* m_view;
@@ -105,5 +107,30 @@
     }
 }
 
+void tst_Painting::textAreas()
+{
+    m_view->load(QUrl("data:text/html;<html><body></body></html>"));
+    ::waitForSignal(m_view, SIGNAL(loadFinished(bool)));
+
+    QWebElement bodyElement = m_page->mainFrame()->findFirstElement("body");
+
+    int count = 100;
+    while (count--) {
+        QString markup("<textarea cols='1' rows='1'></textarea>");
+        bodyElement.appendInside(markup);
+    }
+
+    /* force a layout */
+    QWebFrame* mainFrame = m_page->mainFrame();
+    mainFrame->toPlainText();
+
+    QPixmap pixmap(mainFrame->contentsSize());
+    QBENCHMARK {
+        QPainter painter(&pixmap);
+        mainFrame->render(&painter, QRect(QPoint(0, 0), mainFrame->contentsSize()));
+        painter.end();
+    }
+}
+
 QTEST_MAIN(tst_Painting)
 #include "tst_painting.moc"
diff --git a/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro b/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
index 0e49a70..9e80870 100644
--- a/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
+++ b/WebKit/qt/tests/hybridPixmap/hybridPixmap.pro
@@ -1,6 +1,7 @@
 # -------------------------------------------------
 # Project created by QtCreator 2009-12-10T11:25:02
 # -------------------------------------------------
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
 TARGET = hybridPixmap
 SOURCES += widget.cpp
diff --git a/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
+++ b/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebelement/qwebelement.pro b/WebKit/qt/tests/qwebelement/qwebelement.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebframe/qwebframe.pro b/WebKit/qt/tests/qwebframe/qwebframe.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 5ac3769..5f5a2f2 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -67,6 +67,7 @@
     Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
     Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType)
     Q_PROPERTY(QWebElement webElementProperty READ webElementProperty WRITE setWebElementProperty)
+    Q_PROPERTY(QObject* objectStarProperty READ objectStarProperty WRITE setObjectStarProperty)
     Q_ENUMS(Policy Strategy)
     Q_FLAGS(Ability)
 
@@ -104,6 +105,7 @@
             m_hiddenValue(456.0),
             m_writeOnlyValue(789),
             m_readOnlyValue(987),
+            m_objectStar(0),
             m_qtFunctionInvoked(-1) { }
 
     ~MyQObject() { }
@@ -197,6 +199,15 @@
         m_customType = c;
     }
 
+    QObject* objectStarProperty() const {
+        return m_objectStar;
+    }
+
+    void setObjectStarProperty(QObject* object) {
+        m_objectStar = object;
+    }
+
+
     int qtFunctionInvoked() const {
         return m_qtFunctionInvoked;
     }
@@ -482,6 +493,7 @@
     QKeySequence m_shortcut;
     QWebElement m_webElement;
     CustomType m_customType;
+    QObject* m_objectStar;
     int m_qtFunctionInvoked;
     QVariantList m_actuals;
 };
@@ -585,9 +597,9 @@
     void render();
     void scrollPosition();
     void scrollToAnchor();
+    void scrollbarsOff();
     void evaluateWillCauseRepaint();
     void qObjectWrapperWithSameIdentity();
-    void scrollRecursively();
     void introspectQtMethods_data();
     void introspectQtMethods();
 
@@ -878,6 +890,21 @@
     QCOMPARE(evalJS("myObject.readOnlyProperty = 654;"
                     "myObject.readOnlyProperty == 987"), sTrue);
     QCOMPARE(m_myObject->readOnlyProperty(), 987);
+
+    // QObject* property
+    m_myObject->setObjectStarProperty(0);
+    QCOMPARE(m_myObject->objectStarProperty(), (QObject*)0);
+    QCOMPARE(evalJS("myObject.objectStarProperty == null"), sTrue);
+    QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject);
+    QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sFalse);
+    QCOMPARE(evalJS("String(myObject.objectStarProperty) == 'null'"), sTrue);
+    QCOMPARE(evalJS("myObject.objectStarProperty.objectStarProperty"),
+        sUndefined);
+    m_myObject->setObjectStarProperty(this);
+    QCOMPARE(evalJS("myObject.objectStarProperty != null"), sTrue);
+    QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject);
+    QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sTrue);
+    QCOMPARE(evalJS("String(myObject.objectStarProperty) != 'null'"), sTrue);
 }
 
 void tst_QWebFrame::getSetDynamicProperty()
@@ -1908,6 +1935,7 @@
     // should pick myOverloadedSlot(QRegExp)
     m_myObject->resetQtFunctionInvoked();
     evalJS("myObject.myOverloadedSlot(document.body)");
+    QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=37319", Continue);
     QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
 
     // should pick myOverloadedSlot(QObject*)
@@ -2515,7 +2543,7 @@
 
     // open the popup by clicking. check if focus is on the popup
     QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
-    QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
+    QObject* webpopup = firstChildByClassName(&view, "QComboBox");
     QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
     QVERIFY(combo != 0);
     QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup
@@ -2797,6 +2825,38 @@
     QVERIFY(frame->scrollPosition().y() != 0);
 }
 
+
+void tst_QWebFrame::scrollbarsOff()
+{
+    QWebView view;
+    QWebFrame* mainFrame = view.page()->mainFrame();
+
+    mainFrame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+    mainFrame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+
+    QString html("<script>" \
+                 "   function checkScrollbar() {" \
+                 "       if (innerWidth === document.documentElement.offsetWidth)" \
+                 "           document.getElementById('span1').innerText = 'SUCCESS';" \
+                 "       else" \
+                 "           document.getElementById('span1').innerText = 'FAIL';" \
+                 "   }" \
+                 "</script>" \
+                 "<body>" \
+                 "   <div style='margin-top:1000px ; margin-left:1000px'>" \
+                 "       <a id='offscreen' href='a'>End</a>" \
+                 "   </div>" \
+                 "<span id='span1'></span>" \
+                 "</body>");
+
+
+    view.setHtml(html);
+    ::waitForSignal(&view, SIGNAL(loadFinished(bool)));
+
+    mainFrame->evaluateJavaScript("checkScrollbar();");
+    QCOMPARE(mainFrame->documentElement().findAll("span").at(0).toPlainText(), QString("SUCCESS"));
+}
+
 void tst_QWebFrame::evaluateWillCauseRepaint()
 {
     QWebView view;
@@ -2808,7 +2868,7 @@
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     QTest::qWaitForWindowShown(&view);
 #else
-    QTest::qWait(2000); 
+    QTest::qWait(2000);
 #endif
 
     view.page()->mainFrame()->evaluateJavaScript(
@@ -2855,70 +2915,6 @@
     QCOMPARE(mainFrame->toPlainText(), QString("test2"));
 }
 
-void tst_QWebFrame::scrollRecursively()
-{
-    // The test content is 
-    // a nested frame set
-    // The main frame scrolls
-    // and has two children
-    // an iframe and a div overflow
-    // both scroll
-    QWebView webView;
-    QWebPage* webPage = webView.page();
-    QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool)));
-    QUrl url = QUrl("qrc:///testiframe.html");
-    webPage->mainFrame()->load(url);
-    QTRY_COMPARE(loadSpy.count(), 1);
-
-    QList<QWebFrame*> children =  webPage->mainFrame()->childFrames();
-    QVERIFY(children.count() == 1);
-
-    // 1st test
-    // call scrollRecursively over mainframe
-    // verify scrolled
-    // verify scroll postion changed
-    QPoint scrollPosition(webPage->mainFrame()->scrollPosition());
-    QVERIFY(webPage->mainFrame()->scrollRecursively(10, 10));
-    QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
-
-    // 2nd test
-    // call scrollRecursively over child iframe
-    // verify scrolled
-    // verify child scroll position changed
-    // verify parent's scroll position did not change
-    scrollPosition = webPage->mainFrame()->scrollPosition();
-    QPoint childScrollPosition = children.at(0)->scrollPosition();
-    QVERIFY(children.at(0)->scrollRecursively(10, 10));
-    QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
-    QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
-
-    // 3rd test
-    // call scrollRecursively over div overflow
-    // verify scrolled == true
-    // verify parent and child frame's scroll postion did not change
-    QWebElement div = webPage->mainFrame()->documentElement().findFirst("#content1");
-    QMouseEvent evpres(QEvent::MouseMove, div.geometry().center(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
-    webPage->event(&evpres);
-    scrollPosition = webPage->mainFrame()->scrollPosition();
-    childScrollPosition = children.at(0)->scrollPosition();
-    QVERIFY(webPage->mainFrame()->scrollRecursively(5, 5));
-    QVERIFY(childScrollPosition == children.at(0)->scrollPosition());
-    QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition());
-
-    // 4th test
-    // call scrollRecursively twice over childs iframe
-    // verify scrolled == true first time
-    // verify parent's scroll == true second time
-    // verify parent and childs scroll position changed
-    childScrollPosition = children.at(0)->scrollPosition();
-    QVERIFY(children.at(0)->scrollRecursively(-10, -10));
-    QVERIFY(childScrollPosition != children.at(0)->scrollPosition());
-    scrollPosition = webPage->mainFrame()->scrollPosition();
-    QVERIFY(children.at(0)->scrollRecursively(-10, -10));
-    QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition());
-
-}
-
 void tst_QWebFrame::introspectQtMethods_data()
 {
     QTest::addColumn<QString>("objectExpression");
diff --git a/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/WebKit/qt/tests/qwebinspector/qwebinspector.pro
index e99c7f4..ac51929 100644
--- a/WebKit/qt/tests/qwebinspector/qwebinspector.pro
+++ b/WebKit/qt/tests/qwebinspector/qwebinspector.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
diff --git a/WebKit/qt/tests/qwebpage/qwebpage.pro b/WebKit/qt/tests/qwebpage/qwebpage.pro
index 4ca2bf6..d056014 100644
--- a/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index ba7a87e..c857b00 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -20,12 +20,14 @@
 */
 
 #include "../util.h"
+#include "../WebCoreSupport/DumpRenderTreeSupportQt.h"
 #include <QDir>
 #include <QGraphicsWidget>
 #include <QLineEdit>
 #include <QMenu>
 #include <QPushButton>
 #include <QtTest/QtTest>
+#include <QTextCharFormat>
 #include <qgraphicsscene.h>
 #include <qgraphicsview.h>
 #include <qgraphicswebview.h>
@@ -98,6 +100,8 @@
     void consoleOutput();
     void inputMethods_data();
     void inputMethods();
+    void inputMethodsTextFormat_data();
+    void inputMethodsTextFormat();
     void defaultTextEncoding();
     void errorPageExtension();
     void errorPageExtensionInIFrames();
@@ -722,10 +726,6 @@
 
 }
 
-// import private API
-void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
-QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
-
 void tst_QWebPage::multiplePageGroupsAndLocalStorage()
 {
     QDir dir(QDir::currentPath());
@@ -737,12 +737,12 @@
 
     view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
     view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
-    qt_webpage_setGroupName(view1.page(), "group1");
+    DumpRenderTreeSupportQt::webPageSetGroupName(view1.page(), "group1");
     view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);    
     view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
-    qt_webpage_setGroupName(view2.page(), "group2");
-    QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
-    QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
+    DumpRenderTreeSupportQt::webPageSetGroupName(view2.page(), "group2");
+    QCOMPARE(DumpRenderTreeSupportQt::webPageGroupName(view1.page()), QString("group1"));
+    QCOMPARE(DumpRenderTreeSupportQt::webPageGroupName(view2.page()), QString("group2"));
 
 
     view1.setHtml(QString("<html><body> </body></html>"), QUrl("http://www.myexample.com"));
@@ -1403,6 +1403,26 @@
     variant = page->inputMethodQuery(Qt::ImCurrentSelection);
     QString selectionValue = variant.value<QString>();
     QCOMPARE(selectionValue, QString("eb"));
+
+    //Set selection with negative length
+    inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 6, -5, QVariant());
+    QInputMethodEvent eventSelection2("",inputAttributes);
+    page->event(&eventSelection2);
+
+    //ImAnchorPosition
+    variant = page->inputMethodQuery(Qt::ImAnchorPosition);
+    anchorPosition =  variant.toInt();
+    QCOMPARE(anchorPosition, 1);
+
+    //ImCursorPosition
+    variant = page->inputMethodQuery(Qt::ImCursorPosition);
+    cursorPosition =  variant.toInt();
+    QCOMPARE(cursorPosition, 6);
+
+    //ImCurrentSelection
+    variant = page->inputMethodQuery(Qt::ImCurrentSelection);
+    selectionValue = variant.value<QString>();
+    QCOMPARE(selectionValue, QString("tWebK"));
 #endif
 
     //ImSurroundingText
@@ -1459,8 +1479,56 @@
     delete container;
 }
 
-// import a little DRT helper function to trigger the garbage collector
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
+void tst_QWebPage::inputMethodsTextFormat_data()
+{
+    QTest::addColumn<QString>("string");
+    QTest::addColumn<int>("start");
+    QTest::addColumn<int>("length");
+
+    QTest::newRow("") << QString("") << 0 << 0;
+    QTest::newRow("Q") << QString("Q") << 0 << 1;
+    QTest::newRow("Qt") << QString("Qt") << 0 << 1;
+    QTest::newRow("Qt") << QString("Qt") << 0 << 2;
+    QTest::newRow("Qt") << QString("Qt") << 1 << 1;
+    QTest::newRow("Qt ") << QString("Qt ") << 0 << 1;
+    QTest::newRow("Qt ") << QString("Qt ") << 1 << 1;
+    QTest::newRow("Qt ") << QString("Qt ") << 2 << 1;
+    QTest::newRow("Qt ") << QString("Qt ") << 2 << -1;
+    QTest::newRow("Qt ") << QString("Qt ") << -2 << 3;
+    QTest::newRow("Qt ") << QString("Qt ") << 0 << 3;
+    QTest::newRow("Qt by") << QString("Qt by") << 0 << 1;
+    QTest::newRow("Qt by Nokia") << QString("Qt by Nokia") << 0 << 1;
+}
+
+
+void tst_QWebPage::inputMethodsTextFormat()
+{
+    QWebPage* page = new QWebPage;
+    QWebView* view = new QWebView;
+    view->setPage(page);
+    page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont");
+    page->mainFrame()->setHtml("<html><body>" \
+                                            "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/>");
+    page->mainFrame()->evaluateJavaScript("document.getElementById('input1').focus()");
+    page->mainFrame()->setFocus();
+    view->show();
+
+    QFETCH(QString, string);
+    QFETCH(int, start);
+    QFETCH(int, length);
+
+    QList<QInputMethodEvent::Attribute> attrs;
+    QTextCharFormat format;
+    format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
+    format.setUnderlineColor(Qt::red);
+    attrs.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format));
+    QInputMethodEvent im(string, attrs);
+    page->event(&im);
+
+    QTest::qWait(1000);
+
+    delete view;
+}
 
 void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
 {
@@ -1478,7 +1546,7 @@
 
     newPage->mainFrame()->evaluateJavaScript("testme('foo')");
 
-    qt_drt_garbageCollector_collect();
+    DumpRenderTreeSupportQt::garbageCollectorCollect();
 
     // don't crash!
     newPage->mainFrame()->evaluateJavaScript("testme('bar')");
diff --git a/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
index e99c7f4..ac51929 100644
--- a/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
+++ b/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -1 +1,2 @@
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../tests.pri)
diff --git a/WebKit/qt/tests/tests.pri b/WebKit/qt/tests/tests.pri
index 187950a..0bdf6f6 100644
--- a/WebKit/qt/tests/tests.pri
+++ b/WebKit/qt/tests/tests.pri
@@ -1,8 +1,9 @@
 TEMPLATE = app
 CONFIG -= app_bundle
 
-TARGET = tst_$$TARGET
-SOURCES += $$_PRO_FILE_PWD_/$${TARGET}.cpp
+VPATH += $$_PRO_FILE_PWD_
+!CONFIG(QTDIR_build):TARGET = tst_$$TARGET
+SOURCES += $${TARGET}.cpp
 INCLUDEPATH += \
     $$PWD \
     $$PWD/../Api
diff --git a/WebKit/qt/tests/tests.pro b/WebKit/qt/tests/tests.pro
index 5e19202..22fece5 100644
--- a/WebKit/qt/tests/tests.pro
+++ b/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
 
 TEMPLATE = subdirs
 SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap
-greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting benchmarks/loading
+SUBDIRS += benchmarks/painting benchmarks/loading
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 8dd19ad..287a9be 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,989 @@
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::receivedData):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::chooseIconForFiles):
+        * WebCoreSupport/WebChromeClient.h:
+
+2010-04-16  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by NOBODY (Windows build fix).
+
+        * WebFrame.cpp:
+        (WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
+        * WebView.cpp:
+        (WebView::stringByEvaluatingJavaScriptFromString):
+
+2010-04-16  Adam Roben  <aroben@apple.com>
+
+        Make it possible for clients to instantiate a WebUserContentURLPattern
+
+        Reviewed by Tim Hatcher.
+
+        * ForEachCoClass.h: Added WebUserContentURLPattern to the FOR_EACH_COCLASS macro, which
+        lists all our instantiatable classes.
+
+        * WebKitClassFactory.cpp: Added a now-required #include.
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Expose UserContentURLPattern as WebKit SPI
+
+        Fixes <http://webkit.org/b/37354>.
+
+        Reviewed by Tim Hatcher.
+
+        * Interfaces/IWebUserContentURLPattern.idl: Added.
+
+        * Interfaces/WebKit.idl: Added WebUserContentURLPattern.
+
+        * WebKit.vcproj/Interfaces.vcproj: Added IWebUserContentURLPattern.
+
+        * WebKit.vcproj/WebKit.vcproj: Added WebUserContentURLPattern.
+
+        * WebUserContentURLPattern.cpp: Added.
+        (WebUserContentURLPattern::WebUserContentURLPattern):
+        (WebUserContentURLPattern::~WebUserContentURLPattern):
+        (WebUserContentURLPattern::createInstance):
+        (WebUserContentURLPattern::AddRef):
+        (WebUserContentURLPattern::Release):
+        (WebUserContentURLPattern::QueryInterface):
+        Standard COM implementations.
+
+        (WebUserContentURLPattern::parse): Parse the string into a
+        UserContentURLPattern and store it.
+
+        (WebUserContentURLPattern::isValid):
+        (WebUserContentURLPattern::scheme):
+        (WebUserContentURLPattern::host):
+        (WebUserContentURLPattern::matchesSubdomains):
+        Call through to UserContentURLPattern.
+
+        * WebUserContentURLPattern.h: Added.
+
+2010-04-14  Adam Roben  <aroben@apple.com>
+
+        Expose DOMWrapperWorld::unregisterWorld as WebKit SPI on Windows
+
+        Fixes <http://webkit.org/b/37619>.
+
+        Reviewed by Steve Falkenburg.
+
+        * Interfaces/IWebScriptWorld.idl: Added unregisterWorld.
+
+        * Interfaces/WebKit.idl: Touched to force a build.
+
+        * WebScriptWorld.cpp:
+        (WebScriptWorld::unregisterWorld):
+        * WebScriptWorld.h:
+        Added. Just calls through to DOMWrapperWorld::unregisterWorld.
+
+2010-04-12  Timothy Hatcher  <timothy@apple.com>
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * Interfaces/IWebViewPrivate.idl:
+        * WebView.cpp:
+        (WebView::removeOriginAccessWhitelistEntry): Call SecurityOrigin::removeOriginAccessWhitelistEntry.
+        * WebView.h: Added removeOriginAccessWhitelistEntry.
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * Interfaces/IWebViewPrivate.idl:
+        * WebView.cpp:
+        (WebView::addOriginAccessWhitelistEntry):
+        (WebView::resetOriginAccessWhitelists):
+        * WebView.h:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::receivedData):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::receivedData):
+
+2010-04-09  Adam Roben  <aroben@apple.com>
+
+        Windows Debug/Release build fix after r57244
+
+        * WebKit.vcproj/WebKit.vcproj: Don't delay-load QuartzCore.dll or
+        QuartzCoreInterface.dll in any configurations. r57244 made this change
+        only for Debug_Internal.
+
+2010-04-08  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebView::isLoading should null check m_mainFrame
+        https://bugs.webkit.org/show_bug.cgi?id=37294
+
+        * WebView.cpp:
+        (WebView::isLoading):
+
+2010-04-07  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Steve Falkenburg.
+
+        Remove QuartzCoreInterface from the build
+        
+        No longer needed since QuartzCore.dll is now included in  the latest Safari release (4.0.5).
+
+        * WebKit.vcproj/WebKit.vcproj:Removed delay load for QuartzCore and QuartzCoreInterface
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
+2010-04-05  Peter Nelson  <charn.opcode@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        Fixed style errors in DOMCoreClasses.h to bring it up to scratch
+        for https://bugs.webkit.org/show_bug.cgi?id=34979.
+
+        * DOMCoreClasses.h:
+        (DOMObject::throwException):
+        (DOMObject::callWebScriptMethod):
+        (DOMObject::evaluateWebScript):
+        (DOMObject::removeWebScriptKey):
+        (DOMObject::stringRepresentation):
+        (DOMObject::webScriptValueAtIndex):
+        (DOMObject::setWebScriptValueAtIndex):
+        (DOMObject::setException):
+        (DOMNodeList::throwException):
+        (DOMNodeList::callWebScriptMethod):
+        (DOMNodeList::evaluateWebScript):
+        (DOMNodeList::removeWebScriptKey):
+        (DOMNodeList::stringRepresentation):
+        (DOMNodeList::webScriptValueAtIndex):
+        (DOMNodeList::setWebScriptValueAtIndex):
+        (DOMNodeList::setException):
+        (DOMDocument::throwException):
+        (DOMDocument::callWebScriptMethod):
+        (DOMDocument::evaluateWebScript):
+        (DOMDocument::removeWebScriptKey):
+        (DOMDocument::stringRepresentation):
+        (DOMDocument::webScriptValueAtIndex):
+        (DOMDocument::setWebScriptValueAtIndex):
+        (DOMDocument::setException):
+        (DOMDocument::nodeName):
+        (DOMDocument::nodeValue):
+        (DOMDocument::setNodeValue):
+        (DOMDocument::nodeType):
+        (DOMDocument::parentNode):
+        (DOMDocument::childNodes):
+        (DOMDocument::firstChild):
+        (DOMDocument::lastChild):
+        (DOMDocument::previousSibling):
+        (DOMDocument::nextSibling):
+        (DOMDocument::attributes):
+        (DOMDocument::ownerDocument):
+        (DOMDocument::insertBefore):
+        (DOMDocument::replaceChild):
+        (DOMDocument::removeChild):
+        (DOMDocument::appendChild):
+        (DOMDocument::hasChildNodes):
+        (DOMDocument::cloneNode):
+        (DOMDocument::isSupported):
+        (DOMDocument::namespaceURI):
+        (DOMDocument::prefix):
+        (DOMDocument::setPrefix):
+        (DOMDocument::localName):
+        (DOMDocument::hasAttributes):
+        (DOMDocument::isSameNode):
+        (DOMDocument::isEqualNode):
+        (DOMDocument::textContent):
+        (DOMDocument::setTextContent):
+        (DOMElement::throwException):
+        (DOMElement::callWebScriptMethod):
+        (DOMElement::evaluateWebScript):
+        (DOMElement::removeWebScriptKey):
+        (DOMElement::stringRepresentation):
+        (DOMElement::webScriptValueAtIndex):
+        (DOMElement::setWebScriptValueAtIndex):
+        (DOMElement::setException):
+        (DOMElement::nodeName):
+        (DOMElement::nodeValue):
+        (DOMElement::setNodeValue):
+        (DOMElement::nodeType):
+        (DOMElement::parentNode):
+        (DOMElement::childNodes):
+        (DOMElement::firstChild):
+        (DOMElement::lastChild):
+        (DOMElement::previousSibling):
+        (DOMElement::nextSibling):
+        (DOMElement::attributes):
+        (DOMElement::ownerDocument):
+        (DOMElement::insertBefore):
+        (DOMElement::replaceChild):
+        (DOMElement::removeChild):
+        (DOMElement::appendChild):
+        (DOMElement::hasChildNodes):
+        (DOMElement::cloneNode):
+        (DOMElement::isSupported):
+        (DOMElement::namespaceURI):
+        (DOMElement::prefix):
+        (DOMElement::setPrefix):
+        (DOMElement::localName):
+        (DOMElement::hasAttributes):
+        (DOMElement::isSameNode):
+        (DOMElement::isEqualNode):
+        (DOMElement::textContent):
+        (DOMElement::setTextContent):
+
+2010-04-05  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37111
+        <rdar://problem/7790327> Draw replacement text when plug-in host crashes
+
+        * WebCoreLocalizedStrings.cpp: (WebCore::crashedPluginText): Added a stub string for plug-in
+        failure.
+
+2010-04-02  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Clean up unused calls after changes to checkPermission and requestPermission argument lists.
+
+        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
+        (WebDesktopNotificationsDelegate::requestPermission):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
+
+2010-04-01  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Added layerTreeAsText function to DRT (for Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=36782
+
+        This is the WebKit side for Windows. It plumbs the
+        call from WebCore to DRT.
+
+        * Interfaces/IWebFramePrivate.idl:
+        * WebFrame.cpp:WebKit (Windows) side of plumbing
+        (WebFrame::layerTreeAsText):
+        * WebFrame.h:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::cancelGeolocationPermissionRequestForFrame):
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * WebDownload.cpp:
+        * WebDownloadCFNet.cpp:
+        * WebDownloadCurl.cpp:
+        * WebHistoryItem.cpp:
+        * WebLocalizableStrings.cpp:
+        * WebMutableURLRequest.cpp:
+        * WebPreferences.cpp:
+        (WebPreferences::migrateWebKitPreferencesToCFPreferences):
+        * WebView.cpp:
+
+2010-03-30  Adam Roben  <aroben@apple.com>
+
+        Windows build fix
+
+        * Interfaces/WebKit.idl: Touched this to force a build.
+
+2010-03-29  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Default value of accelerated compositing should be false for Windows
+        https://bugs.webkit.org/show_bug.cgi?id=36805
+
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+
+2010-03-29  Rafael Weinstein  <rafaelw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Change NotificationPresenter::checkPermission() to take the source frames full KURL,
+        rather than its SecurityOrigin. This will aid chromium in having more fine grained
+        permissions to control notification spam.
+
+        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
+        (WebDesktopNotificationsDelegate::checkPermission):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
+
+2010-03-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Change method name due to it dealing with both flattening
+        of frame sets and inner frames.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::isFrameFlatteningEnabled):
+        (WebPreferences::setFrameFlatteningEnabled):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
+2010-03-24  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        <rdar://problem/7780798> Missing plug-ins should be represented by text
+        only, instead of lego block
+
+        https://bugs.webkit.org/show_bug.cgi?id=36583
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createPlugin):
+        Return 0 if we failed to initialize the plug-in, which causes the new
+        "missing plug-in" text to draw.
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::chooseIconForFiles):
+        * WebCoreSupport/WebChromeClient.h:
+
+2010-03-22  Darin Adler  <darin@apple.com>
+
+        * WebCoreLocalizedStrings.cpp:
+        (WebCore::missingPluginText): Fixed localization helper text to match the same
+        string from Mac WebKit.
+
+2010-03-22  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by John Sullivan.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36328
+        
+        * WebCoreLocalizedStrings.cpp:
+        (WebCore::missingPluginText): Added.
+
+2010-03-17  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Missing support for showing compositing layers borders and repaint count on Windows.
+        <rdar://problem/7760736>
+        <https://bugs.webkit.org/show_bug.cgi?id=36197>
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::showDebugBorders):
+        (WebPreferences::setShowDebugBorders):
+        (WebPreferences::showRepaintCounter):
+        (WebPreferences::setShowRepaintCounter):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorClient::WebInspectorClient):
+        (WebInspectorClient::~WebInspectorClient):
+        (WebInspectorClient::openInspectorFrontend):
+        (WebInspectorClient::highlight):
+        (WebInspectorClient::hideHighlight):
+        (WebInspectorClient::updateHighlight):
+        (WebInspectorFrontendClient::WebInspectorFrontendClient):
+        (WebInspectorFrontendClient::~WebInspectorFrontendClient):
+        (WebInspectorFrontendClient::frontendLoaded):
+        (WebInspectorFrontendClient::localizedStringsURL):
+        (WebInspectorFrontendClient::hiddenPanels):
+        (WebInspectorFrontendClient::bringToFront):
+        (WebInspectorFrontendClient::closeWindow):
+        (WebInspectorFrontendClient::attachWindow):
+        (WebInspectorFrontendClient::detachWindow):
+        (WebInspectorFrontendClient::setAttachedWindowHeight):
+        (WebInspectorFrontendClient::inspectedURLChanged):
+        (WebInspectorFrontendClient::closeWindowWithoutNotifications):
+        (WebInspectorFrontendClient::showWindowWithoutNotifications):
+        (WebInspectorFrontendClient::destroyInspectorView):
+        (WebInspectorFrontendClient::updateWindowTitle):
+        (WebInspectorFrontendClient::onGetMinMaxInfo):
+        (WebInspectorFrontendClient::onSize):
+        (WebInspectorFrontendClient::onClose):
+        (WebInspectorFrontendClient::onSetFocus):
+        (WebInspectorFrontendClient::onWebViewWindowPosChanging):
+        (WebInspectorWndProc):
+        (WebInspectorFrontendClient::windowReceivedMessage):
+        * WebCoreSupport/WebInspectorClient.h:
+        (WebInspectorClient::frontendClosing):
+        * WebInspector.cpp:
+        (WebInspector::attach):
+        (WebInspector::detach):
+
+2010-03-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit part of removing support for legacy versions of Core Graphics
+
+        * WebKitClassFactory.cpp:
+        (WebKitClassFactory::WebKitClassFactory): Removed call to populateFontDatabase().
+        * WebKitGraphics.cpp:
+        (makeFont): Ditto.
+        * WebTextRenderer.cpp:
+        (WebTextRenderer::registerPrivateFont): Removed call to wkAddFontsAtPath().
+
+2010-03-12  Enrica Casucci  <enrica@apple.com>
+
+        Fixed broken build on Windows.
+        Added contditional compilation for accelerated compositing.
+
+        * WebView.cpp:
+        (WebView::deleteBackingStore):
+        (WebView::addToDirtyRegion):
+        (WebView::updateBackingStore):
+
+2010-03-12  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=34942 Fullscreen 
+        API naming is inconsistent
+        -and corresponding-
+        <rdar://problem/7729165>
+
+        This patch changes all occurrences of "fullScreen" to the more 
+        popular "fullscreen."
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::onMouseDown):
+        (FullscreenVideoController::onMouseMove):
+        (FullscreenVideoController::onMouseUp):
+        * FullscreenVideoController.h:
+        (FullscreenVideoController::fullscreenToHUDCoordinates):
+
+2010-03-12  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=33739 Fullscreen 
+        video HUD stays on top when switching to another window (e.g. via 
+        Alt-Tab)
+        -and corresponding-
+        <rdar://problem/7547574>
+
+        The HUD was always on top because it had the WS_EX_TOPMOST style. 
+        So I removed the style and made m_videoWindow the owner of 
+        m_hudWindow. This keeps m_hudWindow on top only when m_videoWindow 
+        is the focused window.
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::exitFullscreen): ASSERT that movie()->exitFullscreen() also destroyed the hud.
+        (FullscreenVideoController::createHUDWindow):
+
+2010-03-12  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Content of 3D tests appears at the bottom right corner sometimes.
+        <rdar://problem/7556244>
+        <https://bugs.webkit.org/show_bug.cgi?id=36027>
+
+        See detailed comments in WebCore/ChangeLog.
+
+        * WebView.cpp:
+        (WebView::deleteBackingStore): Reset the dirty flag when deleting the backing store.
+        (WebView::addToDirtyRegion): Set the dirty flag when adding dirty rectangles to the
+        backing store dirty region.
+        (WebView::updateBackingStore): Reset the dirty flag after painting into the backing store.
+        (WebView::setAcceleratedCompositing): Removed unnecessary call to updateRootLayerContents.
+        (WebView::updateRootLayerContents): Changed the way we pass parameters to setScrollFrame.
+        We are passing width and height of the view content together with the offset for the scrolling.
+        It was confusing to pass it all as a rectangle, when it is not a rectangle.
+        
+2010-03-11  Aaron Boodman  <aa@chromium.org>
+
+        Kill WebDocument::applicationID() (part 1).
+
+        Modify interface to WebCore::NotificationPresenter::checkPermission()
+        and remove implementation of WebDocument::applicationID(). Breaking
+        API changes will be in a subsequent change.
+        https://bugs.webkit.org/show_bug.cgi?id=35846
+
+        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
+        (WebDesktopNotificationsDelegate::checkPermission):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        * WebCoreSupport/WebChromeClient.h:
+
+2010-03-10  Eric Uhrhane  <ericu@chromium.org>
+
+        Reviewed by David Levin.
+
+        The build fix for my patch on bug #35763 wasn't quite right--it removed
+        the call entirely, instead of replacing it with the new API.  This adds
+        the call to Database::setIsAvailable.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35763
+
+        * WebView.cpp: Added a call to Database::setIsAvailable where change 55667 removed the old Settings API call <http://trac.webkit.org/changeset/55667>.
+        (WebView::notifyPreferencesChanged):
+
+2010-03-10  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Tim Hatcher.
+        
+        <rdar://problem/7735387> input type other than text won't work with autofill
+        <https://bugs.webkit.org/show_bug.cgi?id=35963>
+
+        * WebFrame.cpp:
+        (WebFrame::elementDoesAutoComplete):
+        Return true for any text field that's not a password, rather than only
+        for TEXT type.
+
+2010-03-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        REGRESSION: WebInspector docking busted on Windows
+        <rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorClient::attachWindow): Use the InspectorController:: copy of the should attach settings key.
+        (WebInspectorClient::detachWindow): Ditto.
+        (WebInspectorClient::showWindowWithoutNotifications): Ditto.
+
+2010-03-09  John Sullivan  <sullivan@apple.com>
+
+        Fixed localized string key collision. update-webkit-localized-strings now
+        runs without errors.
+
+        Reviewed by Adam Roben.
+
+        * WebCoreLocalizedStrings.cpp:
+        (WebCore::AXMenuListPopupActionVerb):
+        Used LPCTSTR_UI_STRING_KEY for the 2nd use of "press".
+
+2010-03-08  Adam Treat  <atreat@rim.com>
+
+        Unreviewed build fix for Windows.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::invalidateContents):
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the win port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::invalidateContents):
+        (WebChromeClient::invalidateWindow):
+        (WebChromeClient::invalidateContentsAndWindow):
+        (WebChromeClient::invalidateContentsForSlowScroll):
+        * WebCoreSupport/WebChromeClient.h:
+
+2010-03-08  Daniel Bates  <dbates@rim.com>
+
+        Unreviewed, build fix.
+
+        Attempt to fix the Windows builds by applying the corresponding change
+        made in bug #35763 <https://bugs.webkit.org/show_bug.cgi?id=35763>.
+
+        * WebView.cpp: Removed call to settings->setDatabasesEnabled since this
+        setting no longer exists following changeset 55666 <http://trac.webkit.org/changeset/55666>.
+        (WebView::notifyPreferencesChanged):
+
+2010-03-07  Mark Rowe  <mrowe@apple.com>
+
+        Windows build fix.
+
+        * WebKitPrefix.h: Include CoreFoundation/CoreFoundation.h from the Windows prefix header
+        since some WebCore headers rely on the types declared within being available via the prefix
+        header.
+
+2010-03-05  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Got rid of platformLayer use in WebView.
+        https://bugs.webkit.org/show_bug.cgi?id=35798
+        
+        WKCACFLayer no longer depends on GraphicsLayer, so I got rid of
+        that dependency on WebView. Now WebChromeClient casts platformLayer
+        to WKCACFLayer which will always be the case on Windows.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::attachRootGraphicsLayer):
+        * WebView.cpp:
+        (WebView::setRootChildLayer):
+        * WebView.h:
+
+2010-03-04  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        WebCore::Page::setInstanceHandle() is now just 
+        WebCore::setInstanceHandle()
+
+        * WebKitDLL.cpp:
+        (DllMain):
+
+2010-03-03  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        Add a way to get an iframe's content frame
+
+        * DOMCoreClasses.cpp:
+        (DOMElement::createInstance):
+        Added case for DOMHTMLIFrameElement
+        * DOMHTMLClasses.cpp:
+        Adding the few DOMHTMLIFrameElement functions definitions that have 
+        distinct implementations (all others just call parent implementation)
+        (DOMHTMLIFrameElement::QueryInterface):
+        (DOMHTMLIFrameElement::contentFrame):
+        * DOMHTMLClasses.h:
+        Most of these function declarations have definitions that just call the parent implementation
+        (DOMHTMLIFrameElement::DOMHTMLIFrameElement):
+        (DOMHTMLIFrameElement::AddRef):
+        (DOMHTMLIFrameElement::Release):
+        (DOMHTMLIFrameElement::throwException):
+        (DOMHTMLIFrameElement::callWebScriptMethod):
+        (DOMHTMLIFrameElement::evaluateWebScript):
+        (DOMHTMLIFrameElement::removeWebScriptKey):
+        (DOMHTMLIFrameElement::stringRepresentation):
+        (DOMHTMLIFrameElement::webScriptValueAtIndex):
+        (DOMHTMLIFrameElement::setWebScriptValueAtIndex):
+        (DOMHTMLIFrameElement::setException):
+        (DOMHTMLIFrameElement::nodeName):
+        (DOMHTMLIFrameElement::nodeValue):
+        (DOMHTMLIFrameElement::setNodeValue):
+        (DOMHTMLIFrameElement::nodeType):
+        (DOMHTMLIFrameElement::parentNode):
+        (DOMHTMLIFrameElement::childNodes):
+        (DOMHTMLIFrameElement::firstChild):
+        (DOMHTMLIFrameElement::lastChild):
+        (DOMHTMLIFrameElement::previousSibling):
+        (DOMHTMLIFrameElement::nextSibling):
+        (DOMHTMLIFrameElement::attributes):
+        (DOMHTMLIFrameElement::ownerDocument):
+        (DOMHTMLIFrameElement::insertBefore):
+        (DOMHTMLIFrameElement::replaceChild):
+        (DOMHTMLIFrameElement::removeChild):
+        (DOMHTMLIFrameElement::appendChild):
+        (DOMHTMLIFrameElement::hasChildNodes):
+        (DOMHTMLIFrameElement::cloneNode):
+        (DOMHTMLIFrameElement::normalize):
+        (DOMHTMLIFrameElement::isSupported):
+        (DOMHTMLIFrameElement::namespaceURI):
+        (DOMHTMLIFrameElement::prefix):
+        (DOMHTMLIFrameElement::setPrefix):
+        (DOMHTMLIFrameElement::localName):
+        (DOMHTMLIFrameElement::hasAttributes):
+        (DOMHTMLIFrameElement::isSameNode):
+        (DOMHTMLIFrameElement::isEqualNode):
+        (DOMHTMLIFrameElement::textContent):
+        (DOMHTMLIFrameElement::setTextContent):
+        (DOMHTMLIFrameElement::tagName):
+        (DOMHTMLIFrameElement::getAttribute):
+        (DOMHTMLIFrameElement::setAttribute):
+        (DOMHTMLIFrameElement::removeAttribute):
+        (DOMHTMLIFrameElement::getAttributeNode):
+        (DOMHTMLIFrameElement::setAttributeNode):
+        (DOMHTMLIFrameElement::removeAttributeNode):
+        (DOMHTMLIFrameElement::getElementsByTagName):
+        (DOMHTMLIFrameElement::getAttributeNS):
+        (DOMHTMLIFrameElement::setAttributeNS):
+        (DOMHTMLIFrameElement::removeAttributeNS):
+        (DOMHTMLIFrameElement::getAttributeNodeNS):
+        (DOMHTMLIFrameElement::setAttributeNodeNS):
+        (DOMHTMLIFrameElement::getElementsByTagNameNS):
+        (DOMHTMLIFrameElement::hasAttribute):
+        (DOMHTMLIFrameElement::hasAttributeNS):
+        (DOMHTMLIFrameElement::focus):
+        (DOMHTMLIFrameElement::blur):
+        (DOMHTMLIFrameElement::idName):
+        (DOMHTMLIFrameElement::setIdName):
+        (DOMHTMLIFrameElement::title):
+        (DOMHTMLIFrameElement::setTitle):
+        (DOMHTMLIFrameElement::lang):
+        (DOMHTMLIFrameElement::setLang):
+        (DOMHTMLIFrameElement::dir):
+        (DOMHTMLIFrameElement::setDir):
+        (DOMHTMLIFrameElement::className):
+        (DOMHTMLIFrameElement::setClassName):
+        (DOMHTMLIFrameElement::innerHTML):
+        (DOMHTMLIFrameElement::setInnerHTML):
+        (DOMHTMLIFrameElement::innerText):
+        (DOMHTMLIFrameElement::setInnerText):
+        * Interfaces/DOMHTML.idl:
+        Added IDOMHTMLIFrameElement interface
+
+2010-03-03  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Export acceleratedCompositing flag in IWebPreferences.
+        https://bugs.webkit.org/show_bug.cgi?id=35610
+
+        * Interfaces/IWebPreferences.idl:
+
+2010-03-02  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Darin Adler and Adam Roben.
+
+        Tiny WebKit portion of fix for <rdar://problem/7485289> WebKit 
+        crashes on systems that don't support CoreAnimation
+
+        setHostWindow() no longer calls createRenderer(), so now that has 
+        to be called manually.
+
+        * WebView.cpp:
+        (WebView::setAcceleratedCompositing):
+
+2010-03-02  Adam Roben  <aroben@apple.com>
+
+        Add IWebViewPrivate::registerURLSchemeAsSecure
+
+        Fixes <http://webkit.org/b/35580> <rdar://problem/7706407> Expose
+        SecurityOrigin::registerURLSchemeAsSecure as WebKit SPI
+
+        Reviewed by Tim Hatcher.
+
+        * Interfaces/WebKit.idl: Touched to force a build.
+
+        * Interfaces/IWebViewPrivate.idl:
+        * WebView.cpp:
+        (WebView::registerURLSchemeAsSecure):
+        * WebView.h:
+        Added. Calls through to SecurityOrigin::registerURLSchemeAsSecure.
+
+2010-03-01  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Remove Windows line endings from some files.
+
+        Rubber-stamped by Alice Liu.
+
+        * Interfaces/IWebEmbeddedView.idl:
+
+        * WebCoreSupport/EmbeddedWidget.cpp:
+        (EmbeddedWidget::create):
+        (EmbeddedWidget::~EmbeddedWidget):
+        (EmbeddedWidget::createWindow):
+        (EmbeddedWidget::invalidateRect):
+        (EmbeddedWidget::setFrameRect):
+        (EmbeddedWidget::frameRectsChanged):
+        (EmbeddedWidget::setFocus):
+        (EmbeddedWidget::show):
+        (EmbeddedWidget::hide):
+        (EmbeddedWidget::windowClipRect):
+        (EmbeddedWidget::setParent):
+        (EmbeddedWidget::attachToWindow):
+        (EmbeddedWidget::detachFromWindow):
+        (EmbeddedWidget::didReceiveResponse):
+        (EmbeddedWidget::didReceiveData):
+        (EmbeddedWidget::didFinishLoading):
+        (EmbeddedWidget::didFail):
+
+        * WebCoreSupport/EmbeddedWidget.h:
+        (EmbeddedWidget::EmbeddedWidget):
+
+2010-03-01  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        Some WebKit DOMNode API is unimplemented.
+        https://bugs.webkit.org/show_bug.cgi?id=35554
+
+        Reviewed by Alice Liu.
+
+        * DOMCoreClasses.cpp:
+        (DOMNode::nextSibling):
+        Create a DOMNode to wrap m_node's next sibling, and assign it to the
+        out param 'result'.
+        (DOMNode::insertBefore):
+        Query for the DOMNode for newChild, and return early if we fail. Query
+        refChild for DOMNode. Call insertBefore(), passing the newChild's
+        WebCore node and refChild's WebCore node (if refChild is non-null). If
+        we successfully insert the child, fill the result out param with
+        newChild, ref it, and return S_OK. Otherwise, return E_FAIL.
+        (DOMNode::removeChild):
+        Query oldChild for DOMNode. If we fail, return E_FAIL. Call
+        removeChild(), passing the node's WebCore node. If this fails, return
+        E_FAIL. Otherwise, fill the result out param with oldChild, ref it, and
+        return S_OK.
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * WebFrame.cpp:
+        (WebFrame::setTextSizeMultiplier):
+        * WebView.cpp:
+        (WebView::setZoomMultiplier):
+        (WebView::zoomMultiplier):
+        (WebView::canMakeTextLarger):
+        (WebView::makeTextLarger):
+        (WebView::canMakeTextSmaller):
+        (WebView::makeTextSmaller):
+        (WebView::notifyPreferencesChanged):
+
+2010-02-26  Jon Honeycutt  <jhoneycutt@apple.com>
+
+        <rdar://problem/7703368> IWebUIDelegatePrivate::embeddedViewWithArguments
+        is passed wrong arguments
+
+        Reviewed by Adam Roben.
+
+        * Interfaces/IWebUIDelegatePrivate.idl:
+        Update copyright strings. Added a new key for the plug-in source URL.
+
+        * Interfaces/WebKit.idl:
+        Update copyright strings.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createPlugin):
+        Pass the URL of the plug-in as the source URL. Pass the document's
+        base URI for the base URL.
+
+2010-02-23  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher and Pavel Feldman.
+
+        Regression (r55107) - WebInspector docking is busted.
+        https://bugs.webkit.org/show_bug.cgi?id=35274
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorClient::showWindowWithoutNotifications): Swap the order of the "should attach?" check
+          to get the expected behavior.
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::cancelGeolocationPermissionRequestForFrame):
+
+2010-02-22  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit on Windows should pick up system setting changes without requiring explicit API calls
+        https://bugs.webkit.org/show_bug.cgi?id=35269
+
+        * WebKit.vcproj/WebKit.def: Removed WebKitSystemParameterChanged.
+        * WebKit.vcproj/WebKit_debug.def: Removed WebKitSystemParameterChanged.
+        * WebKitGraphics.cpp: Removed WebKitSystemParameterChanged.
+        * WebKitGraphics.h: Removed WebKitSystemParameterChanged.
+        * WebView.cpp:
+        (systemParameterChanged): Call through to wkSystemFontSmoothingChanged for font changes.
+        (WebView::windowReceivedMessage): Pick up WM_SETTINGCHANGE from windowReceivedMessage.
+
+2010-02-22  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Disable WebView docking to views that are too small.
+        <rdar://problem/7248409> and https://bugs.webkit.org/show_bug.cgi?id=35254
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorClient::showWindowWithoutNotifications): No matter the preference, don't open the inspector 
+          window attached if WebCore says it shouldn't be attached.
+
 2010-02-17  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebKit/win/DOMCoreClasses.cpp b/WebKit/win/DOMCoreClasses.cpp
index 8ea7c84..4e8af61 100644
--- a/WebKit/win/DOMCoreClasses.cpp
+++ b/WebKit/win/DOMCoreClasses.cpp
@@ -184,10 +184,15 @@
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::nextSibling( 
-    /* [retval][out] */ IDOMNode** /*result*/)
+    /* [retval][out] */ IDOMNode** result)
 {
-    ASSERT_NOT_REACHED();
-    return E_NOTIMPL;
+    if (!result)
+        return E_POINTER;
+    *result = 0;
+    if (!m_node)
+        return E_FAIL;
+    *result = DOMNode::createInstance(m_node->nextSibling());
+    return *result ? S_OK : E_FAIL;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::attributes( 
@@ -210,12 +215,31 @@
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::insertBefore( 
-    /* [in] */ IDOMNode* /*newChild*/,
-    /* [in] */ IDOMNode* /*refChild*/,
-    /* [retval][out] */ IDOMNode** /*result*/)
+    /* [in] */ IDOMNode* newChild,
+    /* [in] */ IDOMNode* refChild,
+    /* [retval][out] */ IDOMNode** result)
 {
-    ASSERT_NOT_REACHED();
-    return E_NOTIMPL;
+    if (!result)
+        return E_POINTER;
+
+    *result = 0;
+
+    if (!m_node)
+        return E_FAIL;
+
+    COMPtr<DOMNode> newChildNode(Query, newChild);
+    if (!newChildNode)
+        return E_FAIL;
+
+    COMPtr<DOMNode> refChildNode(Query, refChild);
+
+    ExceptionCode ec;
+    if (!m_node->insertBefore(newChildNode->node(), refChildNode ? refChildNode->node() : 0, ec))
+        return E_FAIL;
+
+    *result = newChild;
+    (*result)->AddRef();
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::replaceChild( 
@@ -228,11 +252,28 @@
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::removeChild( 
-    /* [in] */ IDOMNode* /*oldChild*/,
-    /* [retval][out] */ IDOMNode** /*result*/)
+    /* [in] */ IDOMNode* oldChild,
+    /* [retval][out] */ IDOMNode** result)
 {
-    ASSERT_NOT_REACHED();
-    return E_NOTIMPL;
+    if (!result)
+        return E_POINTER;
+
+    *result = 0;
+
+    if (!m_node)
+        return E_FAIL;
+
+    COMPtr<DOMNode> oldChildNode(Query, oldChild);
+    if (!oldChildNode)
+        return E_FAIL;
+
+    ExceptionCode ec;
+    if (!m_node->removeChild(oldChildNode->node(), ec))
+        return E_FAIL;
+
+    *result = oldChild;
+    (*result)->AddRef();
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE DOMNode::appendChild( 
@@ -1295,14 +1336,17 @@
     if (e->hasTagName(formTag)) {
         DOMHTMLFormElement* newElement = new DOMHTMLFormElement(e);
         hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
-    } else if (e->hasTagName(selectTag)) {
-        DOMHTMLSelectElement* newElement = new DOMHTMLSelectElement(e);
+    } else if (e->hasTagName(iframeTag)) {
+        DOMHTMLIFrameElement* newElement = new DOMHTMLIFrameElement(e);
+        hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
+    } else if (e->hasTagName(inputTag)) {
+        DOMHTMLInputElement* newElement = new DOMHTMLInputElement(e);
         hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
     } else if (e->hasTagName(optionTag)) {
         DOMHTMLOptionElement* newElement = new DOMHTMLOptionElement(e);
         hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
-    } else if (e->hasTagName(inputTag)) {
-        DOMHTMLInputElement* newElement = new DOMHTMLInputElement(e);
+    } else if (e->hasTagName(selectTag)) {
+        DOMHTMLSelectElement* newElement = new DOMHTMLSelectElement(e);
         hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement);
     } else if (e->hasTagName(textareaTag)) {
         DOMHTMLTextAreaElement* newElement = new DOMHTMLTextAreaElement(e);
diff --git a/WebKit/win/DOMCoreClasses.h b/WebKit/win/DOMCoreClasses.h
index 3941d13..f8a3dbb 100644
--- a/WebKit/win/DOMCoreClasses.h
+++ b/WebKit/win/DOMCoreClasses.h
@@ -30,14 +30,14 @@
 #include "WebScriptObject.h"
 
 namespace WebCore {
-    class Element;
-    class Document;
-    class Node;
-    class NodeList;
+class Element;
+class Document;
+class Node;
+class NodeList;
 }
 
-class DOMObject : public WebScriptObject, public IDOMObject
-{
+
+class DOMObject : public WebScriptObject, public IDOMObject {
 public:
     // IUnknown
     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
@@ -45,40 +45,39 @@
     virtual ULONG STDMETHODCALLTYPE Release(void) { return WebScriptObject::Release(); }
 
     // IWebScriptObject
-    virtual HRESULT STDMETHODCALLTYPE throwException( 
+    virtual HRESULT STDMETHODCALLTYPE throwException(
         /* [in] */ BSTR exceptionMessage,
-        /* [retval][out] */ BOOL *result) { return WebScriptObject::throwException(exceptionMessage, result); }
+        /* [retval][out] */ BOOL* result) { return WebScriptObject::throwException(exceptionMessage, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod(
         /* [in] */ BSTR name,
         /* [size_is][in] */ const VARIANT args[  ],
         /* [in] */ int cArgs,
-        /* [retval][out] */ VARIANT *result) { return WebScriptObject::callWebScriptMethod(name, args, cArgs, result); }
+        /* [retval][out] */ VARIANT* result) { return WebScriptObject::callWebScriptMethod(name, args, cArgs, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
         /* [in] */ BSTR script,
-        /* [retval][out] */ VARIANT *result) { return WebScriptObject::evaluateWebScript(script, result); }
+        /* [retval][out] */ VARIANT* result) { return WebScriptObject::evaluateWebScript(script, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey(
         /* [in] */ BSTR name) { return WebScriptObject::removeWebScriptKey(name); }
     
-    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation(
         /* [retval][out] */ BSTR* stringRepresentation) { return WebScriptObject::stringRepresentation(stringRepresentation); }
     
-    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex(
         /* [in] */ unsigned int index,
-        /* [retval][out] */ VARIANT *result) { return WebScriptObject::webScriptValueAtIndex(index, result); }
+        /* [retval][out] */ VARIANT* result) { return WebScriptObject::webScriptValueAtIndex(index, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex(
         /* [in] */ unsigned int index,
         /* [in] */ VARIANT val) { return WebScriptObject::setWebScriptValueAtIndex(index, val); }
     
-    virtual HRESULT STDMETHODCALLTYPE setException( 
+    virtual HRESULT STDMETHODCALLTYPE setException(
         /* [in] */ BSTR description) { return WebScriptObject::setException(description); }
 };
 
-class DECLSPEC_UUID("062AEEE3-9E42-44DC-A8A9-236B216FE011") DOMNode : public DOMObject, public IDOMNode, public IDOMEventTarget
-{
+class DECLSPEC_UUID("062AEEE3-9E42-44DC-A8A9-236B216FE011") DOMNode : public DOMObject, public IDOMNode, public IDOMEventTarget {
 protected:
     DOMNode(WebCore::Node* n);
     ~DOMNode();
@@ -93,149 +92,149 @@
     virtual ULONG STDMETHODCALLTYPE Release(void) { return DOMObject::Release(); }
 
     // IWebScriptObject
-    virtual HRESULT STDMETHODCALLTYPE throwException( 
+    virtual HRESULT STDMETHODCALLTYPE throwException(
         /* [in] */ BSTR exceptionMessage,
-        /* [retval][out] */ BOOL *result) { return DOMObject::throwException(exceptionMessage, result); }
+        /* [retval][out] */ BOOL* result) { return DOMObject::throwException(exceptionMessage, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod(
         /* [in] */ BSTR name,
         /* [size_is][in] */ const VARIANT args[  ],
         /* [in] */ int cArgs,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::callWebScriptMethod(name, args, cArgs, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::callWebScriptMethod(name, args, cArgs, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
         /* [in] */ BSTR script,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::evaluateWebScript(script, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::evaluateWebScript(script, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey(
         /* [in] */ BSTR name) { return DOMObject::removeWebScriptKey(name); }
     
-    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation(
         /* [retval][out] */ BSTR* stringRepresentation) { return DOMObject::stringRepresentation(stringRepresentation); }
     
-    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex(
         /* [in] */ unsigned int index,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::webScriptValueAtIndex(index, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::webScriptValueAtIndex(index, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex(
         /* [in] */ unsigned int index,
         /* [in] */ VARIANT val) { return DOMObject::setWebScriptValueAtIndex(index, val); }
     
-    virtual HRESULT STDMETHODCALLTYPE setException( 
+    virtual HRESULT STDMETHODCALLTYPE setException(
         /* [in] */ BSTR description) { return DOMObject::setException(description); }
 
     // IDOMNode
-    virtual HRESULT STDMETHODCALLTYPE nodeName( 
-        /* [retval][out] */ BSTR *result);
+    virtual HRESULT STDMETHODCALLTYPE nodeName(
+        /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE nodeValue( 
-        /* [retval][out] */ BSTR *result);
+    virtual HRESULT STDMETHODCALLTYPE nodeValue(
+        /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setNodeValue( 
+    virtual HRESULT STDMETHODCALLTYPE setNodeValue(
         /* [in] */ BSTR value);
     
-    virtual HRESULT STDMETHODCALLTYPE nodeType( 
-        /* [retval][out] */ unsigned short *result);
+    virtual HRESULT STDMETHODCALLTYPE nodeType(
+        /* [retval][out] */ unsigned short* result);
     
-    virtual HRESULT STDMETHODCALLTYPE parentNode( 
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE parentNode(
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE childNodes( 
-        /* [retval][out] */ IDOMNodeList **result);
+    virtual HRESULT STDMETHODCALLTYPE childNodes(
+        /* [retval][out] */ IDOMNodeList** result);
     
-    virtual HRESULT STDMETHODCALLTYPE firstChild( 
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE firstChild(
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE lastChild( 
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE lastChild(
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE previousSibling( 
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE previousSibling(
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE nextSibling( 
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE nextSibling(
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE attributes( 
-        /* [retval][out] */ IDOMNamedNodeMap **result);
+    virtual HRESULT STDMETHODCALLTYPE attributes(
+        /* [retval][out] */ IDOMNamedNodeMap** result);
     
-    virtual HRESULT STDMETHODCALLTYPE ownerDocument( 
-        /* [retval][out] */ IDOMDocument **result);
+    virtual HRESULT STDMETHODCALLTYPE ownerDocument(
+        /* [retval][out] */ IDOMDocument** result);
     
-    virtual HRESULT STDMETHODCALLTYPE insertBefore( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *refChild,
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE insertBefore(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* refChild,
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE replaceChild( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE replaceChild(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE removeChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE removeChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE appendChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result);
+    virtual HRESULT STDMETHODCALLTYPE appendChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE hasChildNodes( 
-        /* [retval][out] */ BOOL *result);
+    virtual HRESULT STDMETHODCALLTYPE hasChildNodes(
+        /* [retval][out] */ BOOL* result);
     
-    virtual HRESULT STDMETHODCALLTYPE cloneNode( 
+    virtual HRESULT STDMETHODCALLTYPE cloneNode(
         /* [in] */ BOOL deep,
-        /* [retval][out] */ IDOMNode **result);
+        /* [retval][out] */ IDOMNode** result);
     
     virtual HRESULT STDMETHODCALLTYPE normalize( void);
     
-    virtual HRESULT STDMETHODCALLTYPE isSupported( 
+    virtual HRESULT STDMETHODCALLTYPE isSupported(
         /* [in] */ BSTR feature,
         /* [in] */ BSTR version,
-        /* [retval][out] */ BOOL *result);
-    
-    virtual HRESULT STDMETHODCALLTYPE namespaceURI( 
-        /* [retval][out] */ BSTR *result);
-    
-    virtual HRESULT STDMETHODCALLTYPE prefix( 
-        /* [retval][out] */ BSTR *result);
-    
-    virtual HRESULT STDMETHODCALLTYPE setPrefix( 
-        /* [in] */ BSTR prefix);
-    
-    virtual HRESULT STDMETHODCALLTYPE localName( 
-        /* [retval][out] */ BSTR *result);
-    
-    virtual HRESULT STDMETHODCALLTYPE hasAttributes( 
-        /* [retval][out] */ BOOL *result);
-
-    virtual HRESULT STDMETHODCALLTYPE isSameNode( 
-        /* [in] */ IDOMNode* other,
         /* [retval][out] */ BOOL* result);
     
-    virtual HRESULT STDMETHODCALLTYPE isEqualNode( 
-        /* [in] */ IDOMNode* other,
-        /* [retval][out] */ BOOL* result);
-    
-    virtual HRESULT STDMETHODCALLTYPE textContent( 
+    virtual HRESULT STDMETHODCALLTYPE namespaceURI(
         /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setTextContent( 
+    virtual HRESULT STDMETHODCALLTYPE prefix(
+        /* [retval][out] */ BSTR* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE setPrefix(
+        /* [in] */ BSTR prefix);
+    
+    virtual HRESULT STDMETHODCALLTYPE localName(
+        /* [retval][out] */ BSTR* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE hasAttributes(
+        /* [retval][out] */ BOOL* result);
+
+    virtual HRESULT STDMETHODCALLTYPE isSameNode(
+        /* [in] */ IDOMNode* other,
+        /* [retval][out] */ BOOL* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE isEqualNode(
+        /* [in] */ IDOMNode* other,
+        /* [retval][out] */ BOOL* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE textContent(
+        /* [retval][out] */ BSTR* result);
+    
+    virtual HRESULT STDMETHODCALLTYPE setTextContent(
         /* [in] */ BSTR text);
 
     // IDOMEventTarget
-    virtual HRESULT STDMETHODCALLTYPE addEventListener( 
+    virtual HRESULT STDMETHODCALLTYPE addEventListener(
         /* [in] */ BSTR type,
         /* [in] */ IDOMEventListener *listener,
         /* [in] */ BOOL useCapture);
     
-    virtual HRESULT STDMETHODCALLTYPE removeEventListener( 
+    virtual HRESULT STDMETHODCALLTYPE removeEventListener(
         /* [in] */ BSTR type,
         /* [in] */ IDOMEventListener *listener,
         /* [in] */ BOOL useCapture);
     
-    virtual HRESULT STDMETHODCALLTYPE dispatchEvent( 
+    virtual HRESULT STDMETHODCALLTYPE dispatchEvent(
         /* [in] */ IDOMEvent *evt,
-        /* [retval][out] */ BOOL *result);
+        /* [retval][out] */ BOOL* result);
 
     // DOMNode
     WebCore::Node* node() const { return m_node; }
@@ -244,8 +243,7 @@
     WebCore::Node* m_node;
 };
 
-class DOMNodeList : public DOMObject, public IDOMNodeList
-{
+class DOMNodeList : public DOMObject, public IDOMNodeList {
 protected:
     DOMNodeList(WebCore::NodeList* l);
     ~DOMNodeList();
@@ -260,51 +258,50 @@
     virtual ULONG STDMETHODCALLTYPE Release(void) { return DOMObject::Release(); }
 
     // IWebScriptObject
-    virtual HRESULT STDMETHODCALLTYPE throwException( 
+    virtual HRESULT STDMETHODCALLTYPE throwException(
         /* [in] */ BSTR exceptionMessage,
-        /* [retval][out] */ BOOL *result) { return DOMObject::throwException(exceptionMessage, result); }
+        /* [retval][out] */ BOOL* result) { return DOMObject::throwException(exceptionMessage, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod(
         /* [in] */ BSTR name,
         /* [size_is][in] */ const VARIANT args[  ],
         /* [in] */ int cArgs,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::callWebScriptMethod(name, args, cArgs, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::callWebScriptMethod(name, args, cArgs, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
         /* [in] */ BSTR script,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::evaluateWebScript(script, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::evaluateWebScript(script, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey(
         /* [in] */ BSTR name) { return DOMObject::removeWebScriptKey(name); }
     
-    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation(
         /* [retval][out] */ BSTR* stringRepresentation) { return DOMObject::stringRepresentation(stringRepresentation); }
     
-    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex(
         /* [in] */ unsigned int index,
-        /* [retval][out] */ VARIANT *result) { return DOMObject::webScriptValueAtIndex(index, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMObject::webScriptValueAtIndex(index, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex(
         /* [in] */ unsigned int index,
         /* [in] */ VARIANT val) { return DOMObject::setWebScriptValueAtIndex(index, val); }
     
-    virtual HRESULT STDMETHODCALLTYPE setException( 
+    virtual HRESULT STDMETHODCALLTYPE setException(
         /* [in] */ BSTR description) { return DOMObject::setException(description); }
 
     // IDOMNodeList
-    virtual HRESULT STDMETHODCALLTYPE item( 
+    virtual HRESULT STDMETHODCALLTYPE item(
         /* [in] */ UINT index,
-        /* [retval][out] */ IDOMNode **result);
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE length( 
-        /* [retval][out] */ UINT *result);
+    virtual HRESULT STDMETHODCALLTYPE length(
+        /* [retval][out] */ UINT* result);
 
 protected:
     WebCore::NodeList* m_nodeList;
 };
 
-class DOMDocument : public DOMNode, public IDOMDocument, public IDOMViewCSS, public IDOMDocumentEvent
-{
+class DOMDocument : public DOMNode, public IDOMDocument, public IDOMViewCSS, public IDOMDocumentEvent {
 protected:
     DOMDocument(WebCore::Document* d);
     ~DOMDocument();
@@ -319,215 +316,215 @@
     virtual ULONG STDMETHODCALLTYPE Release(void) { return DOMNode::Release(); }
 
     // IWebScriptObject
-    virtual HRESULT STDMETHODCALLTYPE throwException( 
+    virtual HRESULT STDMETHODCALLTYPE throwException(
         /* [in] */ BSTR exceptionMessage,
-        /* [retval][out] */ BOOL *result) { return DOMNode::throwException(exceptionMessage, result); }
+        /* [retval][out] */ BOOL* result) { return DOMNode::throwException(exceptionMessage, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod(
         /* [in] */ BSTR name,
         /* [size_is][in] */ const VARIANT args[  ],
         /* [in] */ int cArgs,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::callWebScriptMethod(name, args, cArgs, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::callWebScriptMethod(name, args, cArgs, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
         /* [in] */ BSTR script,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::evaluateWebScript(script, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::evaluateWebScript(script, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey(
         /* [in] */ BSTR name) { return DOMNode::removeWebScriptKey(name); }
     
-    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation(
         /* [retval][out] */ BSTR* stringRepresentation) { return DOMNode::stringRepresentation(stringRepresentation); }
     
-    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex(
         /* [in] */ unsigned int index,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::webScriptValueAtIndex(index, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::webScriptValueAtIndex(index, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex(
         /* [in] */ unsigned int index,
         /* [in] */ VARIANT val) { return DOMNode::setWebScriptValueAtIndex(index, val); }
     
-    virtual HRESULT STDMETHODCALLTYPE setException( 
+    virtual HRESULT STDMETHODCALLTYPE setException(
         /* [in] */ BSTR description) { return DOMNode::setException(description); }
 
     // IDOMNode
-    virtual HRESULT STDMETHODCALLTYPE nodeName( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::nodeName(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeName(
+        /* [retval][out] */ BSTR* result) { return DOMNode::nodeName(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE nodeValue( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::nodeValue(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeValue(
+        /* [retval][out] */ BSTR* result) { return DOMNode::nodeValue(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setNodeValue( 
+    virtual HRESULT STDMETHODCALLTYPE setNodeValue(
         /* [in] */ BSTR value) { return DOMNode::setNodeValue(value); }
     
-    virtual HRESULT STDMETHODCALLTYPE nodeType( 
-        /* [retval][out] */ unsigned short *result) { return DOMNode::nodeType(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeType(
+        /* [retval][out] */ unsigned short* result) { return DOMNode::nodeType(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE parentNode( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::parentNode(result); }
+    virtual HRESULT STDMETHODCALLTYPE parentNode(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::parentNode(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE childNodes( 
-        /* [retval][out] */ IDOMNodeList **result) { return DOMNode::childNodes(result); }
+    virtual HRESULT STDMETHODCALLTYPE childNodes(
+        /* [retval][out] */ IDOMNodeList** result) { return DOMNode::childNodes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE firstChild( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::firstChild(result); }
+    virtual HRESULT STDMETHODCALLTYPE firstChild(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::firstChild(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE lastChild( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::lastChild(result); }
+    virtual HRESULT STDMETHODCALLTYPE lastChild(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::lastChild(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE previousSibling( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::previousSibling(result); }
+    virtual HRESULT STDMETHODCALLTYPE previousSibling(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::previousSibling(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE nextSibling( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::nextSibling(result); }
+    virtual HRESULT STDMETHODCALLTYPE nextSibling(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::nextSibling(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE attributes( 
-        /* [retval][out] */ IDOMNamedNodeMap **result) { return DOMNode::attributes(result); }
+    virtual HRESULT STDMETHODCALLTYPE attributes(
+        /* [retval][out] */ IDOMNamedNodeMap** result) { return DOMNode::attributes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE ownerDocument( 
-        /* [retval][out] */ IDOMDocument **result) { return DOMNode::ownerDocument(result); }
+    virtual HRESULT STDMETHODCALLTYPE ownerDocument(
+        /* [retval][out] */ IDOMDocument** result) { return DOMNode::ownerDocument(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE insertBefore( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *refChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::insertBefore(newChild, refChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE insertBefore(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* refChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::insertBefore(newChild, refChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE replaceChild( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::replaceChild(newChild, oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE replaceChild(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::replaceChild(newChild, oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::removeChild(oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE removeChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::removeChild(oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE appendChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::appendChild(oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE appendChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::appendChild(oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE hasChildNodes( 
-        /* [retval][out] */ BOOL *result) { return DOMNode::hasChildNodes(result); }
+    virtual HRESULT STDMETHODCALLTYPE hasChildNodes(
+        /* [retval][out] */ BOOL* result) { return DOMNode::hasChildNodes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE cloneNode( 
+    virtual HRESULT STDMETHODCALLTYPE cloneNode(
         /* [in] */ BOOL deep,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::cloneNode(deep, result); }
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::cloneNode(deep, result); }
     
     virtual HRESULT STDMETHODCALLTYPE normalize( void) { return DOMNode::normalize(); }
     
-    virtual HRESULT STDMETHODCALLTYPE isSupported( 
+    virtual HRESULT STDMETHODCALLTYPE isSupported(
         /* [in] */ BSTR feature,
         /* [in] */ BSTR version,
-        /* [retval][out] */ BOOL *result) { return DOMNode::isSupported(feature, version, result); }
+        /* [retval][out] */ BOOL* result) { return DOMNode::isSupported(feature, version, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE namespaceURI( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::namespaceURI(result); }
+    virtual HRESULT STDMETHODCALLTYPE namespaceURI(
+        /* [retval][out] */ BSTR* result) { return DOMNode::namespaceURI(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE prefix( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::prefix(result); }
+    virtual HRESULT STDMETHODCALLTYPE prefix(
+        /* [retval][out] */ BSTR* result) { return DOMNode::prefix(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setPrefix( 
+    virtual HRESULT STDMETHODCALLTYPE setPrefix(
         /* [in] */ BSTR prefix) { return DOMNode::setPrefix(prefix); }
     
-    virtual HRESULT STDMETHODCALLTYPE localName( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::localName(result); }
+    virtual HRESULT STDMETHODCALLTYPE localName(
+        /* [retval][out] */ BSTR* result) { return DOMNode::localName(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE hasAttributes( 
-        /* [retval][out] */ BOOL *result) { return DOMNode::hasAttributes(result); }
+    virtual HRESULT STDMETHODCALLTYPE hasAttributes(
+        /* [retval][out] */ BOOL* result) { return DOMNode::hasAttributes(result); }
 
-    virtual HRESULT STDMETHODCALLTYPE isSameNode( 
+    virtual HRESULT STDMETHODCALLTYPE isSameNode(
         /* [in] */ IDOMNode* other,
         /* [retval][out] */ BOOL* result) { return DOMNode::isSameNode(other, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE isEqualNode( 
+    virtual HRESULT STDMETHODCALLTYPE isEqualNode(
         /* [in] */ IDOMNode* other,
         /* [retval][out] */ BOOL* result) { return DOMNode::isEqualNode(other, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE textContent( 
+    virtual HRESULT STDMETHODCALLTYPE textContent(
         /* [retval][out] */ BSTR* result) { return DOMNode::textContent(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setTextContent( 
+    virtual HRESULT STDMETHODCALLTYPE setTextContent(
         /* [in] */ BSTR text) { return DOMNode::setTextContent(text); }
     
     // IDOMDocument
-    virtual HRESULT STDMETHODCALLTYPE doctype( 
-        /* [retval][out] */ IDOMDocumentType **result);
+    virtual HRESULT STDMETHODCALLTYPE doctype(
+        /* [retval][out] */ IDOMDocumentType** result);
     
-    virtual HRESULT STDMETHODCALLTYPE implementation( 
-        /* [retval][out] */ IDOMImplementation **result);
+    virtual HRESULT STDMETHODCALLTYPE implementation(
+        /* [retval][out] */ IDOMImplementation** result);
     
-    virtual HRESULT STDMETHODCALLTYPE documentElement( 
-        /* [retval][out] */ IDOMElement **result);
+    virtual HRESULT STDMETHODCALLTYPE documentElement(
+        /* [retval][out] */ IDOMElement** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createElement( 
+    virtual HRESULT STDMETHODCALLTYPE createElement(
         /* [in] */ BSTR tagName,
-        /* [retval][out] */ IDOMElement **result);
+        /* [retval][out] */ IDOMElement** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createDocumentFragment( 
-        /* [retval][out] */ IDOMDocumentFragment **result);
+    virtual HRESULT STDMETHODCALLTYPE createDocumentFragment(
+        /* [retval][out] */ IDOMDocumentFragment** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createTextNode( 
+    virtual HRESULT STDMETHODCALLTYPE createTextNode(
         /* [in] */ BSTR data,
-        /* [retval][out] */ IDOMText **result);
+        /* [retval][out] */ IDOMText** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createComment( 
+    virtual HRESULT STDMETHODCALLTYPE createComment(
         /* [in] */ BSTR data,
-        /* [retval][out] */ IDOMComment **result);
+        /* [retval][out] */ IDOMComment** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createCDATASection( 
+    virtual HRESULT STDMETHODCALLTYPE createCDATASection(
         /* [in] */ BSTR data,
-        /* [retval][out] */ IDOMCDATASection **result);
+        /* [retval][out] */ IDOMCDATASection** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createProcessingInstruction( 
+    virtual HRESULT STDMETHODCALLTYPE createProcessingInstruction(
         /* [in] */ BSTR target,
         /* [in] */ BSTR data,
-        /* [retval][out] */ IDOMProcessingInstruction **result);
+        /* [retval][out] */ IDOMProcessingInstruction** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createAttribute( 
+    virtual HRESULT STDMETHODCALLTYPE createAttribute(
         /* [in] */ BSTR name,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createEntityReference( 
+    virtual HRESULT STDMETHODCALLTYPE createEntityReference(
         /* [in] */ BSTR name,
-        /* [retval][out] */ IDOMEntityReference **result);
+        /* [retval][out] */ IDOMEntityReference** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getElementsByTagName( 
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagName(
         /* [in] */ BSTR tagName,
-        /* [retval][out] */ IDOMNodeList **result);
+        /* [retval][out] */ IDOMNodeList** result);
     
-    virtual HRESULT STDMETHODCALLTYPE importNode( 
-        /* [in] */ IDOMNode *importedNode,
+    virtual HRESULT STDMETHODCALLTYPE importNode(
+        /* [in] */ IDOMNode* importedNode,
         /* [in] */ BOOL deep,
-        /* [retval][out] */ IDOMNode **result);
+        /* [retval][out] */ IDOMNode** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createElementNS( 
+    virtual HRESULT STDMETHODCALLTYPE createElementNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR qualifiedName,
-        /* [retval][out] */ IDOMElement **result);
+        /* [retval][out] */ IDOMElement** result);
     
-    virtual HRESULT STDMETHODCALLTYPE createAttributeNS( 
+    virtual HRESULT STDMETHODCALLTYPE createAttributeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR qualifiedName,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getElementsByTagNameNS( 
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagNameNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName,
-        /* [retval][out] */ IDOMNodeList **result);
+        /* [retval][out] */ IDOMNodeList** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getElementById( 
+    virtual HRESULT STDMETHODCALLTYPE getElementById(
         /* [in] */ BSTR elementId,
-        /* [retval][out] */ IDOMElement **result);
+        /* [retval][out] */ IDOMElement** result);
 
     // IDOMViewCSS
-    virtual HRESULT STDMETHODCALLTYPE getComputedStyle( 
-        /* [in] */ IDOMElement *elt,
+    virtual HRESULT STDMETHODCALLTYPE getComputedStyle(
+        /* [in] */ IDOMElement* elt,
         /* [in] */ BSTR pseudoElt,
-        /* [retval][out] */ IDOMCSSStyleDeclaration **result);
+        /* [retval][out] */ IDOMCSSStyleDeclaration** result);
 
     // IDOMDocumentEvent
-    virtual HRESULT STDMETHODCALLTYPE createEvent( 
+    virtual HRESULT STDMETHODCALLTYPE createEvent(
         /* [in] */ BSTR eventType,
-        /* [retval][out] */ IDOMEvent **result);
+        /* [retval][out] */ IDOMEvent** result);
 
     // DOMDocument
     WebCore::Document* document() { return m_document; }
@@ -536,8 +533,7 @@
     WebCore::Document* m_document;
 };
 
-class DOMElement : public DOMNode, public IDOMElement, public IDOMElementPrivate, public IDOMNodeExtensions, public IDOMElementCSSInlineStyle, public IDOMElementExtensions
-{
+class DOMElement : public DOMNode, public IDOMElement, public IDOMElementPrivate, public IDOMNodeExtensions, public IDOMElementCSSInlineStyle, public IDOMElementExtensions {
 protected:
     DOMElement(WebCore::Element* e);
     ~DOMElement();
@@ -551,225 +547,225 @@
     virtual ULONG STDMETHODCALLTYPE Release(void) { return DOMNode::Release(); }
 
     // IWebScriptObject
-    virtual HRESULT STDMETHODCALLTYPE throwException( 
+    virtual HRESULT STDMETHODCALLTYPE throwException(
         /* [in] */ BSTR exceptionMessage,
-        /* [retval][out] */ BOOL *result) { return DOMNode::throwException(exceptionMessage, result); }
+        /* [retval][out] */ BOOL* result) { return DOMNode::throwException(exceptionMessage, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod(
         /* [in] */ BSTR name,
         /* [size_is][in] */ const VARIANT args[  ],
         /* [in] */ int cArgs,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::callWebScriptMethod(name, args, cArgs, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::callWebScriptMethod(name, args, cArgs, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
         /* [in] */ BSTR script,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::evaluateWebScript(script, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::evaluateWebScript(script, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey(
         /* [in] */ BSTR name) { return DOMNode::removeWebScriptKey(name); }
     
-    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation(
         /* [retval][out] */ BSTR* stringRepresentation) { return DOMNode::stringRepresentation(stringRepresentation); }
     
-    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex(
         /* [in] */ unsigned int index,
-        /* [retval][out] */ VARIANT *result) { return DOMNode::webScriptValueAtIndex(index, result); }
+        /* [retval][out] */ VARIANT* result) { return DOMNode::webScriptValueAtIndex(index, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex(
         /* [in] */ unsigned int index,
         /* [in] */ VARIANT val) { return DOMNode::setWebScriptValueAtIndex(index, val); }
     
-    virtual HRESULT STDMETHODCALLTYPE setException( 
+    virtual HRESULT STDMETHODCALLTYPE setException(
         /* [in] */ BSTR description) { return DOMNode::setException(description); }
 
     // IDOMNode
-    virtual HRESULT STDMETHODCALLTYPE nodeName( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::nodeName(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeName(
+        /* [retval][out] */ BSTR* result) { return DOMNode::nodeName(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE nodeValue( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::nodeValue(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeValue(
+        /* [retval][out] */ BSTR* result) { return DOMNode::nodeValue(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setNodeValue( 
+    virtual HRESULT STDMETHODCALLTYPE setNodeValue(
         /* [in] */ BSTR value) { return DOMNode::setNodeValue(value); }
     
-    virtual HRESULT STDMETHODCALLTYPE nodeType( 
-        /* [retval][out] */ unsigned short *result) { return DOMNode::nodeType(result); }
+    virtual HRESULT STDMETHODCALLTYPE nodeType(
+        /* [retval][out] */ unsigned short* result) { return DOMNode::nodeType(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE parentNode( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::parentNode(result); }
+    virtual HRESULT STDMETHODCALLTYPE parentNode(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::parentNode(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE childNodes( 
-        /* [retval][out] */ IDOMNodeList **result) { return DOMNode::childNodes(result); }
+    virtual HRESULT STDMETHODCALLTYPE childNodes(
+        /* [retval][out] */ IDOMNodeList** result) { return DOMNode::childNodes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE firstChild( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::firstChild(result); }
+    virtual HRESULT STDMETHODCALLTYPE firstChild(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::firstChild(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE lastChild( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::lastChild(result); }
+    virtual HRESULT STDMETHODCALLTYPE lastChild(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::lastChild(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE previousSibling( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::previousSibling(result); }
+    virtual HRESULT STDMETHODCALLTYPE previousSibling(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::previousSibling(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE nextSibling( 
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::nextSibling(result); }
+    virtual HRESULT STDMETHODCALLTYPE nextSibling(
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::nextSibling(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE attributes( 
-        /* [retval][out] */ IDOMNamedNodeMap **result) { return DOMNode::attributes(result); }
+    virtual HRESULT STDMETHODCALLTYPE attributes(
+        /* [retval][out] */ IDOMNamedNodeMap** result) { return DOMNode::attributes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE ownerDocument( 
-        /* [retval][out] */ IDOMDocument **result) { return DOMNode::ownerDocument(result); }
+    virtual HRESULT STDMETHODCALLTYPE ownerDocument(
+        /* [retval][out] */ IDOMDocument** result) { return DOMNode::ownerDocument(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE insertBefore( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *refChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::insertBefore(newChild, refChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE insertBefore(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* refChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::insertBefore(newChild, refChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE replaceChild( 
-        /* [in] */ IDOMNode *newChild,
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::replaceChild(newChild, oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE replaceChild(
+        /* [in] */ IDOMNode* newChild,
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::replaceChild(newChild, oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE removeChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::removeChild(oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE removeChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::removeChild(oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE appendChild( 
-        /* [in] */ IDOMNode *oldChild,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::appendChild(oldChild, result); }
+    virtual HRESULT STDMETHODCALLTYPE appendChild(
+        /* [in] */ IDOMNode* oldChild,
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::appendChild(oldChild, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE hasChildNodes( 
-        /* [retval][out] */ BOOL *result) { return DOMNode::hasChildNodes(result); }
+    virtual HRESULT STDMETHODCALLTYPE hasChildNodes(
+        /* [retval][out] */ BOOL* result) { return DOMNode::hasChildNodes(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE cloneNode( 
+    virtual HRESULT STDMETHODCALLTYPE cloneNode(
         /* [in] */ BOOL deep,
-        /* [retval][out] */ IDOMNode **result) { return DOMNode::cloneNode(deep, result); }
+        /* [retval][out] */ IDOMNode** result) { return DOMNode::cloneNode(deep, result); }
     
     virtual HRESULT STDMETHODCALLTYPE normalize( void) { return DOMNode::normalize(); }
     
-    virtual HRESULT STDMETHODCALLTYPE isSupported( 
+    virtual HRESULT STDMETHODCALLTYPE isSupported(
         /* [in] */ BSTR feature,
         /* [in] */ BSTR version,
-        /* [retval][out] */ BOOL *result) { return DOMNode::isSupported(feature, version, result); }
+        /* [retval][out] */ BOOL* result) { return DOMNode::isSupported(feature, version, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE namespaceURI( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::namespaceURI(result); }
+    virtual HRESULT STDMETHODCALLTYPE namespaceURI(
+        /* [retval][out] */ BSTR* result) { return DOMNode::namespaceURI(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE prefix( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::prefix(result); }
+    virtual HRESULT STDMETHODCALLTYPE prefix(
+        /* [retval][out] */ BSTR* result) { return DOMNode::prefix(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setPrefix( 
+    virtual HRESULT STDMETHODCALLTYPE setPrefix(
         /* [in] */ BSTR prefix) { return DOMNode::setPrefix(prefix); }
     
-    virtual HRESULT STDMETHODCALLTYPE localName( 
-        /* [retval][out] */ BSTR *result) { return DOMNode::localName(result); }
+    virtual HRESULT STDMETHODCALLTYPE localName(
+        /* [retval][out] */ BSTR* result) { return DOMNode::localName(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE hasAttributes( 
-        /* [retval][out] */ BOOL *result) { return DOMNode::hasAttributes(result); }
+    virtual HRESULT STDMETHODCALLTYPE hasAttributes(
+        /* [retval][out] */ BOOL* result) { return DOMNode::hasAttributes(result); }
 
-    virtual HRESULT STDMETHODCALLTYPE isSameNode( 
+    virtual HRESULT STDMETHODCALLTYPE isSameNode(
         /* [in] */ IDOMNode* other,
         /* [retval][out] */ BOOL* result) { return DOMNode::isSameNode(other, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE isEqualNode( 
+    virtual HRESULT STDMETHODCALLTYPE isEqualNode(
         /* [in] */ IDOMNode* other,
         /* [retval][out] */ BOOL* result) { return DOMNode::isEqualNode(other, result); }
     
-    virtual HRESULT STDMETHODCALLTYPE textContent( 
+    virtual HRESULT STDMETHODCALLTYPE textContent(
         /* [retval][out] */ BSTR* result) { return DOMNode::textContent(result); }
     
-    virtual HRESULT STDMETHODCALLTYPE setTextContent( 
+    virtual HRESULT STDMETHODCALLTYPE setTextContent(
         /* [in] */ BSTR text) { return DOMNode::setTextContent(text); }
     
     // IDOMElement
-    virtual HRESULT STDMETHODCALLTYPE tagName( 
-        /* [retval][out] */ BSTR *result);
+    virtual HRESULT STDMETHODCALLTYPE tagName(
+        /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE getAttribute( 
+    virtual HRESULT STDMETHODCALLTYPE getAttribute(
         /* [in] */ BSTR name,
-        /* [retval][out] */ BSTR *result);
+        /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setAttribute( 
+    virtual HRESULT STDMETHODCALLTYPE setAttribute(
         /* [in] */ BSTR name,
         /* [in] */ BSTR value);
     
-    virtual HRESULT STDMETHODCALLTYPE removeAttribute( 
+    virtual HRESULT STDMETHODCALLTYPE removeAttribute(
         /* [in] */ BSTR name);
     
-    virtual HRESULT STDMETHODCALLTYPE getAttributeNode( 
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNode(
         /* [in] */ BSTR name,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE setAttributeNode( 
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNode(
         /* [in] */ IDOMAttr *newAttr,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE removeAttributeNode( 
+    virtual HRESULT STDMETHODCALLTYPE removeAttributeNode(
         /* [in] */ IDOMAttr *oldAttr,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getElementsByTagName( 
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagName(
         /* [in] */ BSTR name,
-        /* [retval][out] */ IDOMNodeList **result);
+        /* [retval][out] */ IDOMNodeList** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getAttributeNS( 
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName,
-        /* [retval][out] */ BSTR *result);
+        /* [retval][out] */ BSTR* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setAttributeNS( 
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR qualifiedName,
         /* [in] */ BSTR value);
     
-    virtual HRESULT STDMETHODCALLTYPE removeAttributeNS( 
+    virtual HRESULT STDMETHODCALLTYPE removeAttributeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName);
     
-    virtual HRESULT STDMETHODCALLTYPE getAttributeNodeNS( 
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNodeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE setAttributeNodeNS( 
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNodeNS(
         /* [in] */ IDOMAttr *newAttr,
-        /* [retval][out] */ IDOMAttr **result);
+        /* [retval][out] */ IDOMAttr** result);
     
-    virtual HRESULT STDMETHODCALLTYPE getElementsByTagNameNS( 
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagNameNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName,
-        /* [retval][out] */ IDOMNodeList **result);
+        /* [retval][out] */ IDOMNodeList** result);
     
-    virtual HRESULT STDMETHODCALLTYPE hasAttribute( 
+    virtual HRESULT STDMETHODCALLTYPE hasAttribute(
         /* [in] */ BSTR name,
-        /* [retval][out] */ BOOL *result);
+        /* [retval][out] */ BOOL* result);
     
-    virtual HRESULT STDMETHODCALLTYPE hasAttributeNS( 
+    virtual HRESULT STDMETHODCALLTYPE hasAttributeNS(
         /* [in] */ BSTR namespaceURI,
         /* [in] */ BSTR localName,
-        /* [retval][out] */ BOOL *result);
+        /* [retval][out] */ BOOL* result);
 
     virtual HRESULT STDMETHODCALLTYPE focus( void);
     
     virtual HRESULT STDMETHODCALLTYPE blur( void);
 
     // IDOMNodeExtensions
-    virtual HRESULT STDMETHODCALLTYPE boundingBox( 
+    virtual HRESULT STDMETHODCALLTYPE boundingBox(
         /* [retval][out] */ LPRECT rect);
     
-    virtual HRESULT STDMETHODCALLTYPE lineBoxRects( 
+    virtual HRESULT STDMETHODCALLTYPE lineBoxRects(
         /* [size_is][in] */ RECT* rects,
         /* [in] */ int cRects);
 
     // IDOMElementPrivate
-    virtual HRESULT STDMETHODCALLTYPE coreElement( 
+    virtual HRESULT STDMETHODCALLTYPE coreElement(
         void** element);
 
-    virtual HRESULT STDMETHODCALLTYPE isEqual( 
-        /* [in] */ IDOMElement *other,
-        /* [retval][out] */ BOOL *result);
+    virtual HRESULT STDMETHODCALLTYPE isEqual(
+        /* [in] */ IDOMElement* other,
+        /* [retval][out] */ BOOL* result);
 
-    virtual HRESULT STDMETHODCALLTYPE isFocused( 
-        /* [retval][out] */ BOOL *result);
+    virtual HRESULT STDMETHODCALLTYPE isFocused(
+        /* [retval][out] */ BOOL* result);
 
     virtual HRESULT STDMETHODCALLTYPE innerText(
         /* [retval][out] */ BSTR* result);
@@ -781,53 +777,53 @@
         /* [retval][out] */ HBITMAP* image);
 
     // IDOMElementCSSInlineStyle
-    virtual HRESULT STDMETHODCALLTYPE style( 
-        /* [retval][out] */ IDOMCSSStyleDeclaration **result);
+    virtual HRESULT STDMETHODCALLTYPE style(
+        /* [retval][out] */ IDOMCSSStyleDeclaration** result);
 
     // IDOMElementExtensions
-    virtual HRESULT STDMETHODCALLTYPE offsetLeft( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE offsetLeft(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE offsetTop( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE offsetTop(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE offsetWidth( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE offsetWidth(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE offsetHeight( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE offsetHeight(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE offsetParent( 
-        /* [retval][out] */ IDOMElement **result);
+    virtual HRESULT STDMETHODCALLTYPE offsetParent(
+        /* [retval][out] */ IDOMElement** result);
     
-    virtual HRESULT STDMETHODCALLTYPE clientWidth( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE clientWidth(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE clientHeight( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE clientHeight(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollLeft( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE scrollLeft(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setScrollLeft( 
+    virtual HRESULT STDMETHODCALLTYPE setScrollLeft(
         /* [in] */ int newScrollLeft);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollTop( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE scrollTop(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE setScrollTop( 
+    virtual HRESULT STDMETHODCALLTYPE setScrollTop(
         /* [in] */ int newScrollTop);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollWidth( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE scrollWidth(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollHeight( 
-        /* [retval][out] */ int *result);
+    virtual HRESULT STDMETHODCALLTYPE scrollHeight(
+        /* [retval][out] */ int* result);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollIntoView( 
+    virtual HRESULT STDMETHODCALLTYPE scrollIntoView(
         /* [in] */ BOOL alignWithTop);
     
-    virtual HRESULT STDMETHODCALLTYPE scrollIntoViewIfNeeded( 
+    virtual HRESULT STDMETHODCALLTYPE scrollIntoViewIfNeeded(
         /* [in] */ BOOL centerIfNeeded);
 
     // DOMElement
diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp
index 4889ba9..f9634ff 100644
--- a/WebKit/win/DOMHTMLClasses.cpp
+++ b/WebKit/win/DOMHTMLClasses.cpp
@@ -27,6 +27,7 @@
 #include "WebKitDLL.h"
 #include "DOMHTMLClasses.h"
 #include "COMPtr.h"
+#include "WebFrame.h"
 
 #pragma warning(push, 0)
 #include <WebCore/BString.h>
@@ -36,6 +37,7 @@
 #include <WebCore/HTMLCollection.h>
 #include <WebCore/HTMLDocument.h>
 #include <WebCore/HTMLFormElement.h>
+#include <WebCore/HTMLIFrameElement.h>
 #include <WebCore/HTMLInputElement.h>
 #include <WebCore/HTMLNames.h>
 #include <WebCore/HTMLOptionElement.h>
@@ -1587,3 +1589,33 @@
         *result = TRUE;
     return S_OK;
 }
+
+// DOMHTMLIFrameElement - IUnknown --------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE DOMHTMLIFrameElement::QueryInterface(REFIID riid, void** ppvObject)
+{
+    *ppvObject = 0;
+    if (IsEqualGUID(riid, IID_IDOMHTMLIFrameElement))
+        *ppvObject = static_cast<IDOMHTMLIFrameElement*>(this);
+    else
+        return DOMHTMLElement::QueryInterface(riid, ppvObject);
+
+    AddRef();
+    return S_OK;
+}
+
+// DOMHTMLIFrameElement -------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE DOMHTMLIFrameElement::contentFrame( 
+    /* [retval][out] */ IWebFrame **result)
+{
+    if (!result)
+        return E_POINTER;
+    *result = 0;
+    ASSERT(m_element && m_element->hasTagName(iframeTag));
+    HTMLIFrameElement* iFrameElement = static_cast<HTMLIFrameElement*>(m_element);
+    COMPtr<IWebFrame> webFrame = kit(iFrameElement->contentFrame());
+    if (!webFrame)
+        return E_FAIL;
+    return webFrame.copyRefTo(result);
+}
diff --git a/WebKit/win/DOMHTMLClasses.h b/WebKit/win/DOMHTMLClasses.h
index f520c3c..baeecc9 100644
--- a/WebKit/win/DOMHTMLClasses.h
+++ b/WebKit/win/DOMHTMLClasses.h
@@ -2356,4 +2356,266 @@
         /* [retval][out] */ BOOL *result);
 };
 
+class DOMHTMLIFrameElement : public DOMHTMLElement, public IDOMHTMLIFrameElement
+{
+protected:
+    DOMHTMLIFrameElement();
+public:
+    DOMHTMLIFrameElement(WebCore::Element* e) : DOMHTMLElement(e) {}
+
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+    virtual ULONG STDMETHODCALLTYPE AddRef(void) { return DOMHTMLElement::AddRef(); }
+    virtual ULONG STDMETHODCALLTYPE Release(void) { return DOMHTMLElement::Release(); }
+
+    // IWebScriptObject
+    virtual HRESULT STDMETHODCALLTYPE throwException( 
+        /* [in] */ BSTR exceptionMessage,
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::throwException(exceptionMessage, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE callWebScriptMethod( 
+        /* [in] */ BSTR name,
+        /* [size_is][in] */ const VARIANT args[  ],
+        /* [in] */ int cArgs,
+        /* [retval][out] */ VARIANT *result) { return DOMHTMLElement::callWebScriptMethod(name, args, cArgs, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE evaluateWebScript( 
+        /* [in] */ BSTR script,
+        /* [retval][out] */ VARIANT *result) { return DOMHTMLElement::evaluateWebScript(script, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE removeWebScriptKey( 
+        /* [in] */ BSTR name) { return DOMHTMLElement::removeWebScriptKey(name); }
+    
+    virtual HRESULT STDMETHODCALLTYPE stringRepresentation( 
+        /* [retval][out] */ BSTR* stringRepresentation) { return DOMHTMLElement::stringRepresentation(stringRepresentation); }
+    
+    virtual HRESULT STDMETHODCALLTYPE webScriptValueAtIndex( 
+        /* [in] */ unsigned int index,
+        /* [retval][out] */ VARIANT *result) { return DOMHTMLElement::webScriptValueAtIndex(index, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setWebScriptValueAtIndex( 
+        /* [in] */ unsigned int index,
+        /* [in] */ VARIANT val) { return DOMHTMLElement::setWebScriptValueAtIndex(index, val); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setException( 
+        /* [in] */ BSTR description) { return DOMHTMLElement::setException(description); }
+
+    // IDOMNode
+    virtual HRESULT STDMETHODCALLTYPE nodeName( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::nodeName(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE nodeValue( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::nodeValue(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setNodeValue( 
+        /* [in] */ BSTR value) { return DOMHTMLElement::setNodeValue(value); }
+    
+    virtual HRESULT STDMETHODCALLTYPE nodeType( 
+        /* [retval][out] */ unsigned short *result) { return DOMHTMLElement::nodeType(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE parentNode( 
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::parentNode(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE childNodes( 
+        /* [retval][out] */ IDOMNodeList **result) { return DOMHTMLElement::childNodes(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE firstChild( 
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::firstChild(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE lastChild( 
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::lastChild(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE previousSibling( 
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::previousSibling(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE nextSibling( 
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::nextSibling(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE attributes( 
+        /* [retval][out] */ IDOMNamedNodeMap **result) { return DOMHTMLElement::attributes(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE ownerDocument( 
+        /* [retval][out] */ IDOMDocument **result) { return DOMHTMLElement::ownerDocument(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE insertBefore( 
+        /* [in] */ IDOMNode *newChild,
+        /* [in] */ IDOMNode *refChild,
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::insertBefore(newChild, refChild, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE replaceChild( 
+        /* [in] */ IDOMNode *newChild,
+        /* [in] */ IDOMNode *oldChild,
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::replaceChild(newChild, oldChild, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE removeChild( 
+        /* [in] */ IDOMNode *oldChild,
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::removeChild(oldChild, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE appendChild( 
+        /* [in] */ IDOMNode *oldChild,
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::appendChild(oldChild, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE hasChildNodes( 
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::hasChildNodes(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE cloneNode( 
+        /* [in] */ BOOL deep,
+        /* [retval][out] */ IDOMNode **result) { return DOMHTMLElement::cloneNode(deep, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE normalize( void) { return DOMHTMLElement::normalize(); }
+    
+    virtual HRESULT STDMETHODCALLTYPE isSupported( 
+        /* [in] */ BSTR feature,
+        /* [in] */ BSTR version,
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::isSupported(feature, version, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE namespaceURI( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::namespaceURI(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE prefix( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::prefix(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setPrefix( 
+        /* [in] */ BSTR prefix) { return DOMHTMLElement::setPrefix(prefix); }
+    
+    virtual HRESULT STDMETHODCALLTYPE localName( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::localName(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE hasAttributes( 
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::hasAttributes(result); }
+
+    virtual HRESULT STDMETHODCALLTYPE isSameNode( 
+        /* [in] */ IDOMNode* other,
+        /* [retval][out] */ BOOL* result) { return DOMHTMLElement::isSameNode(other, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE isEqualNode( 
+        /* [in] */ IDOMNode* other,
+        /* [retval][out] */ BOOL* result) { return DOMHTMLElement::isEqualNode(other, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE textContent( 
+        /* [retval][out] */ BSTR* result) { return DOMHTMLElement::textContent(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setTextContent( 
+        /* [in] */ BSTR text) { return DOMHTMLElement::setTextContent(text); }
+    
+    // IDOMElement
+    virtual HRESULT STDMETHODCALLTYPE tagName( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::tagName(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getAttribute( 
+        /* [in] */ BSTR name,
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::getAttribute(name, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setAttribute( 
+        /* [in] */ BSTR name,
+        /* [in] */ BSTR value) { return DOMHTMLElement::setAttribute(name, value); }
+    
+    virtual HRESULT STDMETHODCALLTYPE removeAttribute( 
+        /* [in] */ BSTR name) { return DOMHTMLElement::removeAttribute(name); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNode( 
+        /* [in] */ BSTR name,
+        /* [retval][out] */ IDOMAttr **result) { return DOMHTMLElement::getAttributeNode(name, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNode( 
+        /* [in] */ IDOMAttr *newAttr,
+        /* [retval][out] */ IDOMAttr **result) { return DOMHTMLElement::setAttributeNode(newAttr, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE removeAttributeNode( 
+        /* [in] */ IDOMAttr *oldAttr,
+        /* [retval][out] */ IDOMAttr **result) { return DOMHTMLElement::removeAttributeNode(oldAttr, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagName( 
+        /* [in] */ BSTR name,
+        /* [retval][out] */ IDOMNodeList **result) { return DOMHTMLElement::getElementsByTagName(name, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR localName,
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::getAttributeNS(namespaceURI, localName, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR qualifiedName,
+        /* [in] */ BSTR value) { return DOMHTMLElement::setAttributeNS(namespaceURI, qualifiedName, value); }
+    
+    virtual HRESULT STDMETHODCALLTYPE removeAttributeNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR localName) { return DOMHTMLElement::removeAttributeNS(namespaceURI, localName); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getAttributeNodeNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR localName,
+        /* [retval][out] */ IDOMAttr **result) { return DOMHTMLElement::getAttributeNodeNS(namespaceURI, localName, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setAttributeNodeNS( 
+        /* [in] */ IDOMAttr *newAttr,
+        /* [retval][out] */ IDOMAttr **result) { return DOMHTMLElement::setAttributeNodeNS(newAttr, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE getElementsByTagNameNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR localName,
+        /* [retval][out] */ IDOMNodeList **result) { return DOMHTMLElement::getElementsByTagNameNS(namespaceURI, localName, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE hasAttribute( 
+        /* [in] */ BSTR name,
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::hasAttribute(name, result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE hasAttributeNS( 
+        /* [in] */ BSTR namespaceURI,
+        /* [in] */ BSTR localName,
+        /* [retval][out] */ BOOL *result) { return DOMHTMLElement::hasAttributeNS(namespaceURI, localName, result); }
+
+    virtual HRESULT STDMETHODCALLTYPE focus( void) { return DOMHTMLElement::focus(); }
+    
+    virtual HRESULT STDMETHODCALLTYPE blur( void) { return DOMHTMLElement::blur(); }
+
+    // IDOMHTMLElement
+    virtual HRESULT STDMETHODCALLTYPE idName( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::idName(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setIdName( 
+        /* [in] */ BSTR idName) { return DOMHTMLElement::setIdName(idName); }
+    
+    virtual HRESULT STDMETHODCALLTYPE title( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::title(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setTitle( 
+        /* [in] */ BSTR title) { return DOMHTMLElement::setTitle(title); }
+    
+    virtual HRESULT STDMETHODCALLTYPE lang( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::lang(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setLang( 
+        /* [in] */ BSTR lang) { return DOMHTMLElement::setLang(lang); }
+    
+    virtual HRESULT STDMETHODCALLTYPE dir( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::dir(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setDir( 
+        /* [in] */ BSTR dir) { return DOMHTMLElement::setDir(dir); }
+    
+    virtual HRESULT STDMETHODCALLTYPE className( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::className(result); }
+    
+    virtual HRESULT STDMETHODCALLTYPE setClassName( 
+        /* [in] */ BSTR className) { return DOMHTMLElement::setClassName(className); }
+
+    virtual HRESULT STDMETHODCALLTYPE innerHTML( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::innerHTML(result); }
+        
+    virtual HRESULT STDMETHODCALLTYPE setInnerHTML( 
+        /* [in] */ BSTR html) { return DOMHTMLElement::setInnerHTML(html); }
+        
+    virtual HRESULT STDMETHODCALLTYPE innerText( 
+        /* [retval][out] */ BSTR *result) { return DOMHTMLElement::innerText(result); }
+        
+    virtual HRESULT STDMETHODCALLTYPE setInnerText( 
+        /* [in] */ BSTR text) { return DOMHTMLElement::setInnerText(text); }
+
+    // IDOMHTMLIFrameElement
+    virtual HRESULT STDMETHODCALLTYPE contentFrame( 
+        /* [retval][out] */ IWebFrame **result);
+};
+
 #endif
diff --git a/WebKit/win/ForEachCoClass.h b/WebKit/win/ForEachCoClass.h
index ab7182d..02aa097 100644
--- a/WebKit/win/ForEachCoClass.h
+++ b/WebKit/win/ForEachCoClass.h
@@ -66,6 +66,7 @@
     macro(WebScriptWorld) \
     macro(WebGeolocationPosition) \
     macro(WebSerializedJSValue) \
+    macro(WebUserContentURLPattern) \
     // end of macro
 
 // Everything below this point is deprecated. Please do not use.
diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp
index dbfc794..884f46a 100644
--- a/WebKit/win/FullscreenVideoController.cpp
+++ b/WebKit/win/FullscreenVideoController.cpp
@@ -226,12 +226,12 @@
 
 void FullscreenVideoController::exitFullscreen()
 {
+    SetWindowLongPtr(m_hudWindow, 0, 0);
     if (movie())
         movie()->exitFullscreen();
 
+    ASSERT(!IsWindow(m_hudWindow));
     m_videoWindow = 0;
-    SetWindowLongPtr(m_hudWindow, 0, 0);
-    DestroyWindow(m_hudWindow);
     m_hudWindow = 0;
 }
 
@@ -368,9 +368,9 @@
 
     registerHUDWindowClass();
 
-    m_hudWindow = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOPMOST | WS_EX_TOOLWINDOW, 
+    m_hudWindow = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, 
         fullscreenVideeoHUDWindowClassName, 0, WS_POPUP | WS_VISIBLE,
-        m_hudPosition.x(), m_hudPosition.y(), 0, 0, 0, 0, gInstance, 0);
+        m_hudPosition.x(), m_hudPosition.y(), 0, 0, m_videoWindow, 0, gInstance, 0);
     ASSERT(::IsWindow(m_hudWindow));
     SetWindowLongPtr(m_hudWindow, 0, reinterpret_cast<LONG_PTR>(this));
 
@@ -513,7 +513,7 @@
 
 void FullscreenVideoController::onMouseDown(const IntPoint& point)
 {
-    IntPoint convertedPoint(fullScreenToHUDCoordinates(point));
+    IntPoint convertedPoint(fullscreenToHUDCoordinates(point));
 
     // Don't bother hit testing if we're outside the bounds of the window
     if (convertedPoint.x() < 0 || convertedPoint.x() >= windowWidth || convertedPoint.y() < 0 || convertedPoint.y() >= windowHeight)
@@ -552,7 +552,7 @@
 
 void FullscreenVideoController::onMouseMove(const IntPoint& point)
 {
-    IntPoint convertedPoint(fullScreenToHUDCoordinates(point));
+    IntPoint convertedPoint(fullscreenToHUDCoordinates(point));
 
     if (m_hitWidget) {
         m_hitWidget->drag(convertedPoint, false);
@@ -567,7 +567,7 @@
 
 void FullscreenVideoController::onMouseUp(const IntPoint& point)
 {
-    IntPoint convertedPoint(fullScreenToHUDCoordinates(point));
+    IntPoint convertedPoint(fullscreenToHUDCoordinates(point));
     m_movingWindow = false;
 
     if (m_hitWidget) {
diff --git a/WebKit/win/FullscreenVideoController.h b/WebKit/win/FullscreenVideoController.h
index b39e30c..60145ad 100644
--- a/WebKit/win/FullscreenVideoController.h
+++ b/WebKit/win/FullscreenVideoController.h
@@ -128,7 +128,7 @@
     void beginScrubbing();
     void endScrubbing();
 
-    WebCore::IntPoint fullScreenToHUDCoordinates(const WebCore::IntPoint& point) const
+    WebCore::IntPoint fullscreenToHUDCoordinates(const WebCore::IntPoint& point) const
     {
         return WebCore::IntPoint(point.x()- m_hudPosition.x(), point.y() - m_hudPosition.y());
     }
diff --git a/WebKit/win/Interfaces/DOMHTML.idl b/WebKit/win/Interfaces/DOMHTML.idl
index 7ccb682..0ee651b 100644
--- a/WebKit/win/Interfaces/DOMHTML.idl
+++ b/WebKit/win/Interfaces/DOMHTML.idl
@@ -37,6 +37,7 @@
 interface IDOMElement;
 interface IDOMNode;
 interface IDOMNodeList;
+interface IWebFrame;
 
 /*
     @interface DOMHTMLCollection : DOMObject
@@ -933,3 +934,17 @@
     */
     HRESULT select();
 }
+
+/*
+    @interface DOMHTMLIFrameElement : DOMHTMLElement
+*/
+[
+    object,
+    oleautomation,
+    uuid(8CFFB1DA-7BA5-4cf7-B7E6-80583354855B),
+    pointer_default(unique)
+]
+interface IDOMHTMLIFrameElement : IDOMHTMLElement
+{
+    HRESULT contentFrame([out, retval] IWebFrame** result);
+}
diff --git a/WebKit/win/Interfaces/IWebEmbeddedView.idl b/WebKit/win/Interfaces/IWebEmbeddedView.idl
index fb47f60..14b61fd 100644
--- a/WebKit/win/Interfaces/IWebEmbeddedView.idl
+++ b/WebKit/win/Interfaces/IWebEmbeddedView.idl
@@ -1,46 +1,46 @@
-/*

- * Copyright (C) 2008 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 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 DO_NO_IMPORTS

-import "oaidl.idl";

-import "ocidl.idl";

-#endif

-

-[

-    object,

-    oleautomation,

-    uuid(F2771780-84C2-4684-8D52-D4F923E67F71),

-    pointer_default(unique)

-]

-interface IWebEmbeddedView : IUnknown

-{

-    HRESULT createViewWindow([in] OLE_HANDLE parentWindow, [in] LPSIZE pluginSize, [out, retval] OLE_HANDLE* window);

-

-    HRESULT didReceiveResponse([in] IWebURLResponse* response);

-    HRESULT didReceiveData([in] IStream* data);

-    HRESULT didFinishLoading();

-    HRESULT didFail([in] IWebError* error);

-}

+/*
+ * Copyright (C) 2008 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 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 DO_NO_IMPORTS
+import "oaidl.idl";
+import "ocidl.idl";
+#endif
+
+[
+    object,
+    oleautomation,
+    uuid(F2771780-84C2-4684-8D52-D4F923E67F71),
+    pointer_default(unique)
+]
+interface IWebEmbeddedView : IUnknown
+{
+    HRESULT createViewWindow([in] OLE_HANDLE parentWindow, [in] LPSIZE pluginSize, [out, retval] OLE_HANDLE* window);
+
+    HRESULT didReceiveResponse([in] IWebURLResponse* response);
+    HRESULT didReceiveData([in] IStream* data);
+    HRESULT didFinishLoading();
+    HRESULT didFail([in] IWebError* error);
+}
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index 4e26cfa..3172ce6 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -108,4 +108,6 @@
     HRESULT pageNumberForElementById([in] BSTR id, [in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
 
     HRESULT numberOfPages([in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
+
+    HRESULT layerTreeAsText([out, retval] BSTR* result);
 }
diff --git a/WebKit/win/Interfaces/IWebPreferences.idl b/WebKit/win/Interfaces/IWebPreferences.idl
index 9a52d7c..1c43135 100644
--- a/WebKit/win/Interfaces/IWebPreferences.idl
+++ b/WebKit/win/Interfaces/IWebPreferences.idl
@@ -186,4 +186,7 @@
 
     HRESULT setZoomsTextOnly(BOOL zoomsTextOnly);
     HRESULT zoomsTextOnly(BOOL *zoomsTextOnly);
+
+    HRESULT setAcceleratedCompositingEnabled(BOOL acceleratedCompositingEnabled);
+    HRESULT acceleratedCompositingEnabled(BOOL *acceleratedCompositingEnabled);
 }
diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
index 54c1d42..76ee3fa 100644
--- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
+++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
@@ -79,8 +79,8 @@
     HRESULT isXSSAuditorEnabled([out, retval] BOOL *enabled);
     HRESULT setXSSAuditorEnabled([in] BOOL enabled);
 
-    HRESULT isFrameSetFlatteningEnabled([out, retval] BOOL *enabled);
-    HRESULT setFrameSetFlatteningEnabled([in] BOOL enabled);
+    HRESULT isFrameFlatteningEnabled([out, retval] BOOL *enabled);
+    HRESULT setFrameFlatteningEnabled([in] BOOL enabled);
 
     HRESULT experimentalNotificationsEnabled([out, retval] BOOL *enabled);
     HRESULT setExperimentalNotificationsEnabled([in] BOOL enabled);
@@ -103,4 +103,10 @@
 
     HRESULT allowFileAccessFromFileURLs([out, retval] BOOL *allowAccess);
     HRESULT setAllowFileAccessFromFileURLs([in] BOOL allowAccess);
+
+    HRESULT setShowDebugBorders([in] BOOL);
+    HRESULT showDebugBorders([out, retval] BOOL*);
+
+    HRESULT setShowRepaintCounter([in] BOOL);
+    HRESULT showRepaintCounter([out, retval] BOOL*);
 }
diff --git a/WebKit/win/Interfaces/IWebScriptWorld.idl b/WebKit/win/Interfaces/IWebScriptWorld.idl
index bd8012d..b66c4ec 100644
--- a/WebKit/win/Interfaces/IWebScriptWorld.idl
+++ b/WebKit/win/Interfaces/IWebScriptWorld.idl
@@ -37,4 +37,5 @@
 interface IWebScriptWorld : IUnknown {
     HRESULT standardWorld([out, retval] IWebScriptWorld**);
     [local] HRESULT scriptWorldForGlobalContext([in] JSGlobalContextRef, [out, retval] IWebScriptWorld**);
+    HRESULT unregisterWorld();
 }
diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
index ce00430..d9702de 100755
--- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +33,7 @@
 
 cpp_quote("#define WebEmbeddedViewAttributesKey TEXT(\"WebEmbeddedViewAttributesKey\")")
 cpp_quote("#define WebEmbeddedViewBaseURLKey TEXT(\"WebEmbeddedViewBaseURLKey\")")
+cpp_quote("#define WebEmbeddedViewSourceURLKey TEXT(\"WebEmbeddedViewSourceURLKey\")")
 cpp_quote("#define WebEmbeddedViewContainingElementKey TEXT(\"WebEmbeddedViewContainingElementKey\")")
 cpp_quote("#define WebEmbeddedViewMIMETypeKey TEXT(\"WebEmbeddedViewMIMETypeKey\")")
 
diff --git a/WebKit/win/Interfaces/IWebUserContentURLPattern.idl b/WebKit/win/Interfaces/IWebUserContentURLPattern.idl
new file mode 100644
index 0000000..b261084
--- /dev/null
+++ b/WebKit/win/Interfaces/IWebUserContentURLPattern.idl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 DO_NO_IMPORTS
+import "oaidl.idl";
+import "ocidl.idl";
+#endif
+
+[
+    object,
+    oleautomation,
+    uuid(DBF18E5A-701B-49ab-B490-BED40053B788),
+    pointer_default(unique)
+]
+interface IWebUserContentURLPattern : IUnknown
+{
+    HRESULT parse([in] BSTR patternString);
+    HRESULT isValid([out, retval] BOOL* isValid);
+    HRESULT scheme([out, retval] BSTR*);
+    HRESULT host([out, retval] BSTR*);
+    HRESULT matchesSubdomains([out, retval] BOOL* matches);
+}
diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl
index 7ab2304..17378ce 100644
--- a/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -207,10 +207,13 @@
     // - destinationProtocol: The protocol to grant access to.
     // - destinationHost: The host to grant access to.
     // - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively.
-    HRESULT whiteListAccessFromOrigin([in] BSTR sourceOrigin, [in] BSTR destinationProtocol, [in] BSTR destinationHost, [in] BOOL allowDestinationSubdomains);
+    HRESULT addOriginAccessWhitelistEntry([in] BSTR sourceOrigin, [in] BSTR destinationProtocol, [in] BSTR destinationHost, [in] BOOL allowDestinationSubdomains);
 
-    // Removes all white list entries created with whiteListAccessFromOrigin.
-    HRESULT resetOriginAccessWhiteLists();
+    // Removes a white list entry created with addOriginAccessWhitelistEntry. See above.
+    HRESULT removeOriginAccessWhitelistEntry([in] BSTR sourceOrigin, [in] BSTR destinationProtocol, [in] BSTR destinationHost, [in] BOOL allowDestinationSubdomains);
+
+    // Removes all white list entries created with addOriginAccessWhitelistEntry.
+    HRESULT resetOriginAccessWhitelists();
 
     HRESULT setHistoryDelegate([in] IWebHistoryDelegate* historyDelegate);
     HRESULT historyDelegate([out,retval] IWebHistoryDelegate** historyDelegate);
@@ -226,4 +229,6 @@
     HRESULT geolocationDidFailWithError([in] IWebError* error);
 
     HRESULT setDomainRelaxationForbiddenForURLScheme([in] BOOL forbidden, [in] BSTR scheme);
+
+    HRESULT registerURLSchemeAsSecure([in] BSTR scheme);
 }
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index 0de6b0b..d25cdfe 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,7 +24,7 @@
  */
 
 cpp_quote("/*")
-cpp_quote(" * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.")
+cpp_quote(" * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.")
 cpp_quote(" *")
 cpp_quote(" * Redistribution and use in source and binary forms, with or without")
 cpp_quote(" * modification, are permitted provided that the following conditions")
@@ -134,6 +134,7 @@
 #include "IWebURLResponsePrivate.idl"
 #include "IWebUndoManager.idl"
 #include "IWebUndoTarget.idl"
+#include "IWebUserContentURLPattern.idl"
 #include "IWebView.idl"
 #include "IWebViewPrivate.idl"
 #include "IWebWorkersPrivate.idl"
@@ -293,4 +294,9 @@
     coclass WebGeolocationPosition {
         [default] interface IWebGeolocationPosition;
     }
+
+    [uuid(2D62AE25-DEAA-4945-A76E-CCE05E899664)]
+    coclass WebUserContentURLPattern {
+        [default] interface IWebUserContentURLPattern;
+    }
 }
diff --git a/WebKit/win/WebCoreLocalizedStrings.cpp b/WebKit/win/WebCoreLocalizedStrings.cpp
index 5850605..2d2f17f 100644
--- a/WebKit/win/WebCoreLocalizedStrings.cpp
+++ b/WebKit/win/WebCoreLocalizedStrings.cpp
@@ -93,11 +93,12 @@
 String WebCore::AXUncheckedCheckBoxActionVerb() { return String(LPCTSTR_UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility")); }
 String WebCore::AXLinkActionVerb() { return String(LPCTSTR_UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility")); }
 String WebCore::AXMenuListActionVerb() { return String(LPCTSTR_UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility")); }
-String WebCore::AXMenuListPopupActionVerb() { return String(LPCTSTR_UI_STRING("press", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility")); }
+String WebCore::AXMenuListPopupActionVerb() { return String(LPCTSTR_UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility")); }
 String WebCore::unknownFileSizeText() { return String(LPCTSTR_UI_STRING("Unknown", "Unknown filesize FTP directory listing item")); }
 String WebCore::uploadFileText() { return String(LPCTSTR_UI_STRING("Upload file", "(Windows) Form submit file upload dialog title")); }
 String WebCore::allFilesText() { return String(LPCTSTR_UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up")); }
-
+String WebCore::missingPluginText() { return String(LPCTSTR_UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing")); }
+String WebCore::crashedPluginText() { return String(LPCTSTR_UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed")); }
 String WebCore::imageTitle(const String& filename, const IntSize& size) 
 { 
     static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"));
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index 6bd8f44..463a986 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -1,238 +1,238 @@
-/*

- * Copyright (C) 2008 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 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 "EmbeddedWidget.h"

-

-#include <WebCore/Document.h>

-#include <WebCore/Element.h>

-#include <WebCore/FrameView.h>

-#include <WebCore/RenderObject.h>

-

-#include "MemoryStream.h"

-#include "WebError.h"

-#include "WebURLResponse.h"

-

-using namespace WebCore;

-

-PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)

-{

-    RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));

-

-    widget->createWindow(parentWindow, size);

-    return widget.release();

-}

-

-EmbeddedWidget::~EmbeddedWidget()

-{

-    if (m_window)

-        DestroyWindow(m_window);

-}

-

-bool EmbeddedWidget::createWindow(HWND parentWindow, const IntSize& size)

-{

-    ASSERT(!m_window);

-

-    HWND window;

-

-    SIZE pluginSize(size);

-

-    HRESULT hr = m_view->createViewWindow((OLE_HANDLE)parentWindow, &pluginSize, (OLE_HANDLE*)&window);

-        

-    if (FAILED(hr) || !window)

-        return false;

-

-    m_window = window;

-    return true;

-}

-

-void EmbeddedWidget::invalidateRect(const IntRect& rect)

-{

-    if (!m_window)

-        return;

-

-    RECT r = rect;

-   ::InvalidateRect(m_window, &r, false);

-}

-

-void EmbeddedWidget::setFrameRect(const IntRect& rect)

-{

-    if (m_element->document()->printing())

-        return;

-

-    if (rect != frameRect())

-        Widget::setFrameRect(rect);

-

-    frameRectsChanged();

-}

-

-void EmbeddedWidget::frameRectsChanged()

-{

-    if (!parent())

-        return;

-

-    ASSERT(parent()->isFrameView());

-    FrameView* frameView = static_cast<FrameView*>(parent());

-

-    IntRect oldWindowRect = m_windowRect;

-    IntRect oldClipRect = m_clipRect;

-

-    m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());

-    m_clipRect = windowClipRect();

-    m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());

-

-    if (!m_window)

-        return;

-

-    if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)

-        return;

-

-    HRGN rgn;

-

-    // To prevent flashes while scrolling, we disable drawing during the window

-    // update process by clipping the window to the zero rect.

-

-    bool clipToZeroRect = true;

-

-    if (clipToZeroRect) {

-        rgn = ::CreateRectRgn(0, 0, 0, 0);

-        ::SetWindowRgn(m_window, rgn, FALSE);

-    } else {

-        rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());

-        ::SetWindowRgn(m_window, rgn, TRUE);

-     }

-

-     if (m_windowRect != oldWindowRect)

-        ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);

-

-     if (clipToZeroRect) {

-        rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());

-        ::SetWindowRgn(m_window, rgn, TRUE);

-    }

-}

-

-void EmbeddedWidget::setFocus()

-{

-    if (m_window)

-        SetFocus(m_window);

-

-    Widget::setFocus();

-}

-

-void EmbeddedWidget::show()

-{

-    m_isVisible = true;

-

-    if (m_attachedToWindow && m_window)

-        ShowWindow(m_window, SW_SHOWNA);

-

-    Widget::show();

-}

-

-void EmbeddedWidget::hide()

-{

-    m_isVisible = false;

-

-    if (m_attachedToWindow && m_window)

-        ShowWindow(m_window, SW_HIDE);

-

-    Widget::hide();

-}

-

-IntRect EmbeddedWidget::windowClipRect() const

-{

-    // Start by clipping to our bounds.

-    IntRect clipRect(m_windowRect);

-    

-    // Take our element and get the clip rect from the enclosing layer and frame view.

-    RenderLayer* layer = m_element->renderer()->enclosingLayer();

-    FrameView* parentView = m_element->document()->view();

-    clipRect.intersect(parentView->windowClipRectForLayer(layer, true));

-

-    return clipRect;

-}

-

-void EmbeddedWidget::setParent(ScrollView* parent)

-{

-    Widget::setParent(parent);

-

-    if (!m_window)

-        return;

-

-    if (parent)

-        return;

-

-    // If the embedded window or one of its children have the focus, we need to 

-    // clear it to prevent the web view window from being focused because that can

-    // trigger a layout while the plugin element is being detached.

-    HWND focusedWindow = ::GetFocus();

-    if (m_window == focusedWindow || ::IsChild(m_window, focusedWindow))

-        ::SetFocus(0);

-}

-

-void EmbeddedWidget::attachToWindow()

-{

-    if (m_attachedToWindow)

-        return;

-

-    m_attachedToWindow = true;

-    if (m_isVisible && m_window)

-        ShowWindow(m_window, SW_SHOWNA);

-}

-

-void EmbeddedWidget::detachFromWindow()

-{

-    if (!m_attachedToWindow)

-        return;

-

-    if (m_isVisible && m_window)

-        ShowWindow(m_window, SW_HIDE);

-    m_attachedToWindow = false;

-}

-

-void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)

-{

-    ASSERT(m_view);

-

-    COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));

-    m_view->didReceiveResponse(urlResponse.get());

-}

-

-void EmbeddedWidget::didReceiveData(const char* data, int length)

-{

-    COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));

-    m_view->didReceiveData(stream.get());

-}

-

-void EmbeddedWidget::didFinishLoading()

-{

-    m_view->didFinishLoading();

-}

-

-void EmbeddedWidget::didFail(const ResourceError& error)

-{

-    COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));

-    m_view->didFail(webError.get());

-}

+/*
+ * Copyright (C) 2008 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 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 "EmbeddedWidget.h"
+
+#include <WebCore/Document.h>
+#include <WebCore/Element.h>
+#include <WebCore/FrameView.h>
+#include <WebCore/RenderObject.h>
+
+#include "MemoryStream.h"
+#include "WebError.h"
+#include "WebURLResponse.h"
+
+using namespace WebCore;
+
+PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
+{
+    RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
+
+    widget->createWindow(parentWindow, size);
+    return widget.release();
+}
+
+EmbeddedWidget::~EmbeddedWidget()
+{
+    if (m_window)
+        DestroyWindow(m_window);
+}
+
+bool EmbeddedWidget::createWindow(HWND parentWindow, const IntSize& size)
+{
+    ASSERT(!m_window);
+
+    HWND window;
+
+    SIZE pluginSize(size);
+
+    HRESULT hr = m_view->createViewWindow((OLE_HANDLE)parentWindow, &pluginSize, (OLE_HANDLE*)&window);
+        
+    if (FAILED(hr) || !window)
+        return false;
+
+    m_window = window;
+    return true;
+}
+
+void EmbeddedWidget::invalidateRect(const IntRect& rect)
+{
+    if (!m_window)
+        return;
+
+    RECT r = rect;
+   ::InvalidateRect(m_window, &r, false);
+}
+
+void EmbeddedWidget::setFrameRect(const IntRect& rect)
+{
+    if (m_element->document()->printing())
+        return;
+
+    if (rect != frameRect())
+        Widget::setFrameRect(rect);
+
+    frameRectsChanged();
+}
+
+void EmbeddedWidget::frameRectsChanged()
+{
+    if (!parent())
+        return;
+
+    ASSERT(parent()->isFrameView());
+    FrameView* frameView = static_cast<FrameView*>(parent());
+
+    IntRect oldWindowRect = m_windowRect;
+    IntRect oldClipRect = m_clipRect;
+
+    m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());
+    m_clipRect = windowClipRect();
+    m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
+
+    if (!m_window)
+        return;
+
+    if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
+        return;
+
+    HRGN rgn;
+
+    // To prevent flashes while scrolling, we disable drawing during the window
+    // update process by clipping the window to the zero rect.
+
+    bool clipToZeroRect = true;
+
+    if (clipToZeroRect) {
+        rgn = ::CreateRectRgn(0, 0, 0, 0);
+        ::SetWindowRgn(m_window, rgn, FALSE);
+    } else {
+        rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+        ::SetWindowRgn(m_window, rgn, TRUE);
+     }
+
+     if (m_windowRect != oldWindowRect)
+        ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
+
+     if (clipToZeroRect) {
+        rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+        ::SetWindowRgn(m_window, rgn, TRUE);
+    }
+}
+
+void EmbeddedWidget::setFocus()
+{
+    if (m_window)
+        SetFocus(m_window);
+
+    Widget::setFocus();
+}
+
+void EmbeddedWidget::show()
+{
+    m_isVisible = true;
+
+    if (m_attachedToWindow && m_window)
+        ShowWindow(m_window, SW_SHOWNA);
+
+    Widget::show();
+}
+
+void EmbeddedWidget::hide()
+{
+    m_isVisible = false;
+
+    if (m_attachedToWindow && m_window)
+        ShowWindow(m_window, SW_HIDE);
+
+    Widget::hide();
+}
+
+IntRect EmbeddedWidget::windowClipRect() const
+{
+    // Start by clipping to our bounds.
+    IntRect clipRect(m_windowRect);
+    
+    // Take our element and get the clip rect from the enclosing layer and frame view.
+    RenderLayer* layer = m_element->renderer()->enclosingLayer();
+    FrameView* parentView = m_element->document()->view();
+    clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
+
+    return clipRect;
+}
+
+void EmbeddedWidget::setParent(ScrollView* parent)
+{
+    Widget::setParent(parent);
+
+    if (!m_window)
+        return;
+
+    if (parent)
+        return;
+
+    // If the embedded window or one of its children have the focus, we need to 
+    // clear it to prevent the web view window from being focused because that can
+    // trigger a layout while the plugin element is being detached.
+    HWND focusedWindow = ::GetFocus();
+    if (m_window == focusedWindow || ::IsChild(m_window, focusedWindow))
+        ::SetFocus(0);
+}
+
+void EmbeddedWidget::attachToWindow()
+{
+    if (m_attachedToWindow)
+        return;
+
+    m_attachedToWindow = true;
+    if (m_isVisible && m_window)
+        ShowWindow(m_window, SW_SHOWNA);
+}
+
+void EmbeddedWidget::detachFromWindow()
+{
+    if (!m_attachedToWindow)
+        return;
+
+    if (m_isVisible && m_window)
+        ShowWindow(m_window, SW_HIDE);
+    m_attachedToWindow = false;
+}
+
+void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)
+{
+    ASSERT(m_view);
+
+    COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));
+    m_view->didReceiveResponse(urlResponse.get());
+}
+
+void EmbeddedWidget::didReceiveData(const char* data, int length)
+{
+    COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));
+    m_view->didReceiveData(stream.get());
+}
+
+void EmbeddedWidget::didFinishLoading()
+{
+    m_view->didFinishLoading();
+}
+
+void EmbeddedWidget::didFail(const ResourceError& error)
+{
+    COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));
+    m_view->didFail(webError.get());
+}
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index 5eee892..7930e0f 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -1,85 +1,85 @@
-/*

- * Copyright (C) 2008 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 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 EmbeddedWidget_h

-#define EmbeddedWidget_h

-

-#include <WebCore/COMPtr.h>

-#include <WebCore/IntRect.h>

-#include <WebCore/PluginView.h>

-

-namespace WebCore {

-    class Element;

-    class IntSize;

-}

-

-interface IWebEmbeddedView;

-

-class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {

-public:

-    static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);

-    ~EmbeddedWidget();

-

-private:

-    EmbeddedWidget(IWebEmbeddedView* view, WebCore::Element* element)

-        : m_view(view)

-        , m_element(element)

-        , m_window(0)

-        , m_isVisible(false)

-        , m_attachedToWindow(false)

-    {

-    }

-

-    bool createWindow(HWND parentWindow, const WebCore::IntSize& size);

-

-    virtual void didReceiveResponse(const WebCore::ResourceResponse&);

-    virtual void didReceiveData(const char*, int);

-    virtual void didFinishLoading();

-    virtual void didFail(const WebCore::ResourceError&);

-

-    virtual void invalidateRect(const WebCore::IntRect&);

-    virtual void setFrameRect(const WebCore::IntRect&);

-    virtual void frameRectsChanged();

-    virtual void setFocus();

-    virtual void show();

-    virtual void hide();

-    virtual WebCore::IntRect windowClipRect() const;

-    virtual void setParent(WebCore::ScrollView*);

-

-    virtual void attachToWindow();

-    virtual void detachFromWindow();

-

-    COMPtr<IWebEmbeddedView> m_view;

-    WebCore::Element* m_element;

-    HWND m_window;

-

-    bool m_isVisible;

-    bool m_attachedToWindow;

-        

-    WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.

-    WebCore::IntRect m_windowRect; // Our window rect.

-};

-

-#endif // EmbeddedWidget_h

+/*
+ * Copyright (C) 2008 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 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 EmbeddedWidget_h
+#define EmbeddedWidget_h
+
+#include <WebCore/COMPtr.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/PluginView.h>
+
+namespace WebCore {
+    class Element;
+    class IntSize;
+}
+
+interface IWebEmbeddedView;
+
+class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
+public:
+    static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
+    ~EmbeddedWidget();
+
+private:
+    EmbeddedWidget(IWebEmbeddedView* view, WebCore::Element* element)
+        : m_view(view)
+        , m_element(element)
+        , m_window(0)
+        , m_isVisible(false)
+        , m_attachedToWindow(false)
+    {
+    }
+
+    bool createWindow(HWND parentWindow, const WebCore::IntSize& size);
+
+    virtual void didReceiveResponse(const WebCore::ResourceResponse&);
+    virtual void didReceiveData(const char*, int);
+    virtual void didFinishLoading();
+    virtual void didFail(const WebCore::ResourceError&);
+
+    virtual void invalidateRect(const WebCore::IntRect&);
+    virtual void setFrameRect(const WebCore::IntRect&);
+    virtual void frameRectsChanged();
+    virtual void setFocus();
+    virtual void show();
+    virtual void hide();
+    virtual WebCore::IntRect windowClipRect() const;
+    virtual void setParent(WebCore::ScrollView*);
+
+    virtual void attachToWindow();
+    virtual void detachFromWindow();
+
+    COMPtr<IWebEmbeddedView> m_view;
+    WebCore::Element* m_element;
+    HWND m_window;
+
+    bool m_isVisible;
+    bool m_attachedToWindow;
+        
+    WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.
+    WebCore::IntRect m_windowRect; // Our window rect.
+};
+
+#endif // EmbeddedWidget_h
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 45f7662..587637f 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -46,7 +46,11 @@
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/Geolocation.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include <WebCore/GraphicsLayer.h>
+#endif
 #include <WebCore/HTMLNames.h>
+#include <WebCore/Icon.h>
 #include <WebCore/LocalizedStrings.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/Page.h>
@@ -451,10 +455,22 @@
     return IntRect();
 }
 
-void WebChromeClient::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void WebChromeClient::invalidateWindow(const IntRect& windowRect, bool immediate)
 {
     ASSERT(core(m_webView->topLevelFrame()));
-    m_webView->repaint(windowRect, contentChanged, immediate, repaintContentOnly);
+    m_webView->repaint(windowRect, false /*contentChanged*/, immediate, false /*repaintContentOnly*/);
+}
+
+void WebChromeClient::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate)
+{
+    ASSERT(core(m_webView->topLevelFrame()));
+    m_webView->repaint(windowRect, true /*contentChanged*/, immediate /*immediate*/, false /*repaintContentOnly*/);
+}
+
+void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& windowRect, bool immediate)
+{
+    ASSERT(core(m_webView->topLevelFrame()));
+    m_webView->repaint(windowRect, true /*contentChanged*/, immediate, true /*repaintContentOnly*/);
 }
 
 void WebChromeClient::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect)
@@ -734,10 +750,9 @@
     // FIXME: Show some sort of error if too many files are selected and the buffer is too small.  For now, this will fail silently.
 }
 
-void WebChromeClient::iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>)
+void WebChromeClient::chooseIconForFiles(const Vector<WebCore::String>& filenames, WebCore::FileChooser* chooser)
 {
-    // FIXME: Move the code of Icon::createIconForFiles() here.
-    notImplemented();
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 bool WebChromeClient::setCursor(PlatformCursorHandle cursor)
@@ -783,7 +798,7 @@
 #if USE(ACCELERATED_COMPOSITING)
 void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
 {
-    m_webView->setRootChildLayer(graphicsLayer ? graphicsLayer->platformLayer() : 0);
+    m_webView->setRootChildLayer(graphicsLayer ? static_cast<WKCACFLayer*>(graphicsLayer->platformLayer()) : 0);
 }
 
 void WebChromeClient::scheduleCompositingLayerSync()
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h
index 0958cf7..6954fde 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -93,8 +93,11 @@
     virtual bool tabsToLinks() const;
     virtual WebCore::IntRect windowResizerRect() const;
 
-    virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+    virtual void invalidateWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
+
     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint& p) const;
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect& r) const;
     virtual PlatformPageClient platformPageClient() const;
@@ -123,7 +126,7 @@
     virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&);
 
     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
-    virtual void iconForFiles(const Vector<WebCore::String>&, PassRefPtr<WebCore::FileChooser>);
+    virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*);
 
     virtual bool setCursor(WebCore::PlatformCursorHandle cursor);
 
@@ -147,6 +150,7 @@
     virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
 
     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
+    virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*) { }
 
 #if ENABLE(VIDEO)
     virtual bool supportsFullscreenForNode(const WebCore::Node*);
diff --git a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
index 3f6eb07..8c66d0e 100644
--- a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
+++ b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
@@ -172,7 +172,7 @@
         notificationDelegate()->requestNotificationPermission(org);
 }
 
-NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url, Document*)
+NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url)
 {
     int out = 0;
     BString org(SecurityOrigin::create(url)->toString());
diff --git a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
index d30b1e7..344c95b 100644
--- a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
+++ b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
@@ -50,7 +50,7 @@
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
     virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr<WebCore::VoidCallback> callback);
-    virtual WebCore::NotificationPresenter::Permission checkPermission(const KURL& url, Document* document);
+    virtual WebCore::NotificationPresenter::Permission checkPermission(const KURL& url);
 
 private:
     bool hasNotificationDelegate();
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 6ae6c5e..fc75ea4 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -243,10 +243,6 @@
     resourceLoadDelegate->didFailLoadingWithError(webView, identifier, webError.get(), getWebDataSource(loader));
 }
 
-void WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
-{
-}
-
 bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const unsigned char* data, const unsigned long long length)
 {
     WebView* webView = m_webFrame->webView();
@@ -513,7 +509,7 @@
     bool userChosen = !encoding.isNull();
     if (encoding.isNull())
         encoding = textEncoding;
-    coreFrame->loader()->setEncoding(encoding, userChosen);
+    coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
 
     coreFrame->loader()->addData(data, length);
 }
@@ -841,7 +837,8 @@
             HashMap<String, COMVariant> arguments;
 
             arguments.set(WebEmbeddedViewAttributesKey, viewArgumentsBag);
-            arguments.set(WebEmbeddedViewBaseURLKey, url.string());
+            arguments.set(WebEmbeddedViewSourceURLKey, url.string());
+            arguments.set(WebEmbeddedViewBaseURLKey, element->document()->baseURI().string());
             arguments.set(WebEmbeddedViewContainingElementKey, containingElement);
             arguments.set(WebEmbeddedViewMIMETypeKey, mimeType);
 
@@ -867,7 +864,7 @@
 
     dispatchDidFailToStartPlugin(pluginView.get());
 
-    return pluginView;
+    return 0;
 }
 
 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index a5f2b1b..0d89b2a 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -57,7 +57,6 @@
     virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived);
     virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier);
     virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&);
-    virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&);
     virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length);
 
     virtual void dispatchDidHandleOnloadEvents();
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 0dd6e58..16ad172 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -52,8 +52,6 @@
 
 using namespace WebCore;
 
-static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
-
 static LPCTSTR kWebInspectorWindowClassName = TEXT("WebInspectorWindowClass");
 static ATOM registerWindowClass();
 static LPCTSTR kWebInspectorPointerProp = TEXT("WebInspectorPointer");
@@ -71,25 +69,13 @@
 
 WebInspectorClient::WebInspectorClient(WebView* webView)
     : m_inspectedWebView(webView)
-    , m_hwnd(0)
-    , m_webViewHwnd(0)
-    , m_shouldAttachWhenShown(false)
-    , m_attached(false)
 {
     ASSERT(m_inspectedWebView);
-
     m_inspectedWebView->viewWindow((OLE_HANDLE*)&m_inspectedWebViewHwnd);
-
-    // FIXME: Implement window size/position save/restore
-#if 0
-    [self setWindowFrameAutosaveName:@"Web Inspector"];
-#endif
 }
 
 WebInspectorClient::~WebInspectorClient()
 {
-    if (m_hwnd)
-        ::DestroyWindow(m_hwnd);
 }
 
 void WebInspectorClient::inspectorDestroyed()
@@ -97,35 +83,30 @@
     delete this;
 }
 
-Page* WebInspectorClient::createPage()
+void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorController)
 {
     registerWindowClass();
 
-    if (m_hwnd)
-        ::DestroyWindow(m_hwnd);
-
-    m_hwnd = ::CreateWindowEx(0, kWebInspectorWindowClassName, 0, WS_OVERLAPPEDWINDOW,
+    HWND frontendHwnd = ::CreateWindowEx(0, kWebInspectorWindowClassName, 0, WS_OVERLAPPEDWINDOW,
         defaultWindowRect().x(), defaultWindowRect().y(), defaultWindowRect().width(), defaultWindowRect().height(),
         0, 0, 0, 0);
 
-    if (!m_hwnd)
-        return 0;
+    if (!frontendHwnd)
+        return;
 
-    ::SetProp(m_hwnd, kWebInspectorPointerProp, reinterpret_cast<HANDLE>(this));
+    COMPtr<WebView> frontendWebView(AdoptCOM, WebView::createInstance());
 
-    m_webView.adoptRef(WebView::createInstance());
-
-    if (FAILED(m_webView->setHostWindow((OLE_HANDLE)(ULONG64)m_hwnd)))
-        return 0;
+    if (FAILED(frontendWebView->setHostWindow((OLE_HANDLE)(ULONG64)frontendHwnd)))
+        return;
 
     RECT rect;
-    GetClientRect(m_hwnd, &rect);
-    if (FAILED(m_webView->initWithFrame(rect, 0, 0)))
-        return 0;
+    GetClientRect(frontendHwnd, &rect);
+    if (FAILED(frontendWebView->initWithFrame(rect, 0, 0)))
+        return;
 
     COMPtr<WebInspectorDelegate> delegate(AdoptCOM, WebInspectorDelegate::createInstance());
-    if (FAILED(m_webView->setUIDelegate(delegate.get())))
-        return 0;
+    if (FAILED(frontendWebView->setUIDelegate(delegate.get())))
+        return;
 
     // Keep preferences separate from the rest of the client, making sure we are using expected preference values.
     // One reason this is good is that it keeps the inspector out of history via "private browsing".
@@ -136,66 +117,126 @@
     COMPtr<WebPreferences> tempPreferences(AdoptCOM, WebPreferences::createInstance());
     COMPtr<IWebPreferences> iPreferences;
     if (FAILED(tempPreferences->initWithIdentifier(BString(L"WebInspectorPreferences"), &iPreferences)))
-        return 0;
+        return;
     COMPtr<WebPreferences> preferences(Query, iPreferences);
     if (!preferences)
-        return 0;
+        return;
     if (FAILED(preferences->setAutosaves(FALSE)))
-        return 0;
+        return;
     if (FAILED(preferences->setPrivateBrowsingEnabled(TRUE)))
-        return 0;
+        return;
     if (FAILED(preferences->setLoadsImagesAutomatically(TRUE)))
-        return 0;
+        return;
     if (FAILED(preferences->setAuthorAndUserStylesEnabled(TRUE)))
-        return 0;
+        return;
     if (FAILED(preferences->setAllowsAnimatedImages(TRUE)))
-        return 0;
+        return;
     if (FAILED(preferences->setLoadsImagesAutomatically(TRUE)))
-        return 0;
+        return;
     if (FAILED(preferences->setPlugInsEnabled(FALSE)))
-        return 0;
+        return;
     if (FAILED(preferences->setJavaEnabled(FALSE)))
-        return 0;
+        return;
     if (FAILED(preferences->setUserStyleSheetEnabled(FALSE)))
-        return 0;
+        return;
     if (FAILED(preferences->setTabsToLinks(FALSE)))
-        return 0;
+        return;
     if (FAILED(preferences->setMinimumFontSize(0)))
-        return 0;
+        return;
     if (FAILED(preferences->setMinimumLogicalFontSize(9)))
-        return 0;
+        return;
     if (FAILED(preferences->setFixedFontFamily(BString(L"Courier New"))))
-        return 0;
+        return;
     if (FAILED(preferences->setDefaultFixedFontSize(13)))
-        return 0;
+        return;
 
-    if (FAILED(m_webView->setPreferences(preferences.get())))
-        return 0;
+    if (FAILED(frontendWebView->setPreferences(preferences.get())))
+        return;
 
-    m_webView->setProhibitsMainFrameScrolling(TRUE);
+    frontendWebView->setProhibitsMainFrameScrolling(TRUE);
 
-    if (FAILED(m_webView->viewWindow(reinterpret_cast<OLE_HANDLE*>(&m_webViewHwnd))))
-        return 0;
+    HWND frontendWebViewHwnd;
+    if (FAILED(frontendWebView->viewWindow(reinterpret_cast<OLE_HANDLE*>(&frontendWebViewHwnd))))
+        return;
 
-    COMPtr<WebMutableURLRequest> request;
-    request.adoptRef(WebMutableURLRequest::createInstance());
+    COMPtr<WebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance());
 
     RetainPtr<CFURLRef> htmlURLRef(AdoptCF, CFBundleCopyResourceURL(getWebKitBundle(), CFSTR("inspector"), CFSTR("html"), CFSTR("inspector")));
     if (!htmlURLRef)
-        return 0;
+        return;
 
     CFStringRef urlStringRef = ::CFURLGetString(htmlURLRef.get());
     if (FAILED(request->initWithURL(BString(urlStringRef), WebURLRequestUseProtocolCachePolicy, 60)))
-        return 0;
+        return;
 
-    if (FAILED(m_webView->topLevelFrame()->loadRequest(request.get())))
-        return 0;
+    if (FAILED(frontendWebView->topLevelFrame()->loadRequest(request.get())))
+        return;
 
-    return core(m_webView.get());
+    Page* page = core(frontendWebView.get());
+    page->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_inspectedWebView, m_inspectedWebViewHwnd, frontendHwnd, frontendWebView, frontendWebViewHwnd, this));
+    m_frontendHwnd = frontendHwnd;
 }
 
+void WebInspectorClient::highlight(Node*)
+{
+    bool creatingHighlight = !m_highlight;
 
-String WebInspectorClient::localizedStringsURL()
+    if (creatingHighlight)
+        m_highlight.set(new WebNodeHighlight(m_inspectedWebView));
+
+    if (m_highlight->isShowing())
+        m_highlight->update();
+    else
+        m_highlight->setShowsWhileWebViewIsVisible(true);
+
+    if (creatingHighlight && IsWindowVisible(m_frontendHwnd))
+        m_highlight->placeBehindWindow(m_frontendHwnd);
+}
+
+void WebInspectorClient::hideHighlight()
+{
+    if (m_highlight)
+        m_highlight->setShowsWhileWebViewIsVisible(false);
+}
+
+void WebInspectorClient::updateHighlight()
+{
+    if (m_highlight && m_highlight->isShowing())
+        m_highlight->update();
+}
+
+WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frontendWebView, HWND frontendWebViewHwnd, WebInspectorClient* inspectorClient)
+    : InspectorFrontendClientLocal(inspectedWebView->page()->inspectorController(),  core(frontendWebView.get()))
+    , m_inspectedWebView(inspectedWebView)
+    , m_inspectedWebViewHwnd(inspectedWebViewHwnd)
+    , m_inspectorClient(inspectorClient)
+    , m_frontendHwnd(frontendHwnd)
+    , m_frontendWebView(frontendWebView)
+    , m_frontendWebViewHwnd(frontendWebViewHwnd)
+    , m_shouldAttachWhenShown(false)
+    , m_attached(false)
+    , m_destroyingInspectorView(false)
+{
+    ::SetProp(frontendHwnd, kWebInspectorPointerProp, reinterpret_cast<HANDLE>(this));
+    // FIXME: Implement window size/position save/restore
+#if 0
+    [self setWindowFrameAutosaveName:@"Web Inspector"];
+#endif
+}
+
+WebInspectorFrontendClient::~WebInspectorFrontendClient()
+{
+    destroyInspectorView();
+}
+
+void WebInspectorFrontendClient::frontendLoaded()
+{
+    InspectorFrontendClientLocal::frontendLoaded();
+
+    setAttachedWindow(m_attached);
+}
+
+String WebInspectorFrontendClient::localizedStringsURL()
 {
     RetainPtr<CFURLRef> url(AdoptCF, CFBundleCopyResourceURL(getWebKitBundle(), CFSTR("localizedStrings"), CFSTR("js"), 0));
     if (!url)
@@ -204,53 +245,45 @@
     return CFURLGetString(url.get());
 }
 
-
-String WebInspectorClient::hiddenPanels()
+String WebInspectorFrontendClient::hiddenPanels()
 {
     // FIXME: implement this
     return String();
 }
 
-void WebInspectorClient::showWindow()
+void WebInspectorFrontendClient::bringToFront()
 {
     showWindowWithoutNotifications();
-    m_inspectedWebView->page()->inspectorController()->setWindowVisible(true, m_shouldAttachWhenShown);
 }
 
-void WebInspectorClient::closeWindow()
+void WebInspectorFrontendClient::closeWindow()
 {
-    closeWindowWithoutNotifications();
-    m_inspectedWebView->page()->inspectorController()->setWindowVisible(false, m_shouldAttachWhenShown);
+    destroyInspectorView();
 }
 
-bool WebInspectorClient::windowVisible()
-{
-    return !!::IsWindowVisible(m_hwnd);
-}
-
-void WebInspectorClient::attachWindow()
+void WebInspectorFrontendClient::attachWindow()
 {
     if (m_attached)
         return;
 
-    m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, "true");
+    m_inspectedWebView->page()->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "true");
 
     closeWindowWithoutNotifications();
     showWindowWithoutNotifications();
 }
 
-void WebInspectorClient::detachWindow()
+void WebInspectorFrontendClient::detachWindow()
 {
     if (!m_attached)
         return;
 
-    m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, "false");
+    m_inspectedWebView->page()->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "false");
 
     closeWindowWithoutNotifications();
     showWindowWithoutNotifications();
 }
 
-void WebInspectorClient::setAttachedWindowHeight(unsigned height)
+void WebInspectorFrontendClient::setAttachedWindowHeight(unsigned height)
 {
     if (!m_attached)
         return;
@@ -268,98 +301,73 @@
     int totalHeight = hostWindowRect.bottom - hostWindowRect.top;
     int webViewWidth = inspectedRect.right - inspectedRect.left;
 
-    SetWindowPos(m_webViewHwnd, 0, 0, totalHeight - height, webViewWidth, height, SWP_NOZORDER);
+    SetWindowPos(m_frontendWebViewHwnd, 0, 0, totalHeight - height, webViewWidth, height, SWP_NOZORDER);
 
     // We want to set the inspected web view height to the totalHeight, because the height adjustment
     // of the inspected web view happens in onWebViewWindowPosChanging, not here.
     SetWindowPos(m_inspectedWebViewHwnd, 0, 0, 0, webViewWidth, totalHeight, SWP_NOZORDER);
 
-    RedrawWindow(m_webViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW); 
+    RedrawWindow(m_frontendWebViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW); 
     RedrawWindow(m_inspectedWebViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
 }
 
-void WebInspectorClient::highlight(Node*)
-{
-    bool creatingHighlight = !m_highlight;
-
-    if (creatingHighlight)
-        m_highlight.set(new WebNodeHighlight(m_inspectedWebView));
-
-    if (m_highlight->isShowing())
-        m_highlight->update();
-    else
-        m_highlight->setShowsWhileWebViewIsVisible(true);
-
-    if (creatingHighlight && IsWindowVisible(m_hwnd))
-        m_highlight->placeBehindWindow(m_hwnd);
-}
-
-void WebInspectorClient::hideHighlight()
-{
-    if (m_highlight)
-        m_highlight->setShowsWhileWebViewIsVisible(false);
-}
-
-void WebInspectorClient::inspectedURLChanged(const String& newURL)
+void WebInspectorFrontendClient::inspectedURLChanged(const String& newURL)
 {
     m_inspectedURL = newURL;
     updateWindowTitle();
 }
 
-void WebInspectorClient::inspectorWindowObjectCleared()
+void WebInspectorFrontendClient::closeWindowWithoutNotifications()
 {
-    notImplemented();
-}
-
-void WebInspectorClient::closeWindowWithoutNotifications()
-{
-    if (!m_hwnd)
+    if (!m_frontendHwnd)
         return;
 
     if (!m_attached) {
-        ShowWindow(m_hwnd, SW_HIDE);
+        ShowWindow(m_frontendHwnd, SW_HIDE);
         return;
     }
 
-    ASSERT(m_webView);
+    ASSERT(m_frontendWebView);
     ASSERT(m_inspectedWebViewHwnd);
-    ASSERT(!IsWindowVisible(m_hwnd));
+    ASSERT(!IsWindowVisible(m_frontendHwnd));
 
     // Remove the Inspector's WebView from the inspected WebView's parent window.
     WindowMessageBroadcaster::removeListener(m_inspectedWebViewHwnd, this);
 
     m_attached = false;
 
-    m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
+    m_frontendWebView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_frontendHwnd));
 
     // Make sure everything has the right size/position.
     HWND hostWindow;
     if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
         SendMessage(hostWindow, WM_SIZE, 0, 0);
 
-    if (m_highlight && m_highlight->isShowing())
-        m_highlight->update();
+    m_inspectorClient->updateHighlight();
 }
 
-void WebInspectorClient::showWindowWithoutNotifications()
+void WebInspectorFrontendClient::showWindowWithoutNotifications()
 {
-    if (!m_hwnd)
+    if (!m_frontendHwnd)
         return;
 
-    ASSERT(m_webView);
+    ASSERT(m_frontendWebView);
     ASSERT(m_inspectedWebViewHwnd);
 
     // If no preference is set - default to an attached window. This is important for inspector LayoutTests.
-    String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(inspectorStartsAttachedName);
+    String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(InspectorController::inspectorStartsAttachedSettingName());
     m_shouldAttachWhenShown = shouldAttach != "false";
-
+        
+    if (m_shouldAttachWhenShown && !canAttachWindow())
+        m_shouldAttachWhenShown = false;
+    
     if (!m_shouldAttachWhenShown) {
         // Put the Inspector's WebView inside our window and show it.
-        m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hwnd));
-        SendMessage(m_hwnd, WM_SIZE, 0, 0);
+        m_frontendWebView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_frontendHwnd));
+        SendMessage(m_frontendHwnd, WM_SIZE, 0, 0);
         updateWindowTitle();
 
-        SetWindowPos(m_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
+        SetWindowPos(m_frontendHwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
         return;
     }
 
@@ -370,20 +378,32 @@
     if (FAILED(m_inspectedWebView->hostWindow(reinterpret_cast<OLE_HANDLE*>(&hostWindow))))
         return;
 
-    m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(hostWindow));
+    m_frontendWebView->setHostWindow(reinterpret_cast<OLE_HANDLE>(hostWindow));
 
     // Then hide our own window.
-    ShowWindow(m_hwnd, SW_HIDE);
+    ShowWindow(m_frontendHwnd, SW_HIDE);
 
     m_attached = true;
 
     // Make sure everything has the right size/position.
     SendMessage(hostWindow, WM_SIZE, 0, 0);
-    if (m_highlight && m_highlight->isShowing())
-        m_highlight->update();
+    m_inspectorClient->updateHighlight();
 }
 
-void WebInspectorClient::updateWindowTitle()
+void WebInspectorFrontendClient::destroyInspectorView()
+{
+    if (m_destroyingInspectorView)
+        return;
+    m_destroyingInspectorView = true;
+
+    m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
+
+    closeWindowWithoutNotifications();
+    m_inspectorClient->frontendClosing();
+    ::DestroyWindow(m_frontendHwnd);
+}
+
+void WebInspectorFrontendClient::updateWindowTitle()
 {
     // FIXME: The series of appends should be replaced with a call to String::format()
     // when it can be figured out how to get the unicode em-dash to show up.
@@ -391,10 +411,10 @@
     title.append((UChar)0x2014); // em-dash
     title.append(' ');
     title.append(m_inspectedURL);
-    ::SetWindowText(m_hwnd, title.charactersWithNullTermination());
+    ::SetWindowText(m_frontendHwnd, title.charactersWithNullTermination());
 }
 
-LRESULT WebInspectorClient::onGetMinMaxInfo(WPARAM, LPARAM lParam)
+LRESULT WebInspectorFrontendClient::onGetMinMaxInfo(WPARAM, LPARAM lParam)
 {
     MINMAXINFO* info = reinterpret_cast<MINMAXINFO*>(lParam);
     POINT size = {400, 400};
@@ -403,33 +423,31 @@
     return 0;
 }
 
-LRESULT WebInspectorClient::onSize(WPARAM, LPARAM)
+LRESULT WebInspectorFrontendClient::onSize(WPARAM, LPARAM)
 {
     RECT rect;
-    ::GetClientRect(m_hwnd, &rect);
+    ::GetClientRect(m_frontendHwnd, &rect);
 
-    ::SetWindowPos(m_webViewHwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
+    ::SetWindowPos(m_frontendWebViewHwnd, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
 
     return 0;
 }
 
-LRESULT WebInspectorClient::onClose(WPARAM, LPARAM)
+LRESULT WebInspectorFrontendClient::onClose(WPARAM, LPARAM)
 {
-    ::ShowWindow(m_hwnd, SW_HIDE);
-    m_inspectedWebView->page()->inspectorController()->setWindowVisible(false, m_shouldAttachWhenShown);
-
-    hideHighlight();
+    ::ShowWindow(m_frontendHwnd, SW_HIDE);
+    m_inspectedWebView->page()->inspectorController()->close();
 
     return 0;
 }
 
-LRESULT WebInspectorClient::onSetFocus()
+LRESULT WebInspectorFrontendClient::onSetFocus()
 {
-    SetFocus(m_webViewHwnd);
+    SetFocus(m_frontendWebViewHwnd);
     return 0;
 }
 
-void WebInspectorClient::onWebViewWindowPosChanging(WPARAM, LPARAM lParam)
+void WebInspectorFrontendClient::onWebViewWindowPosChanging(WPARAM, LPARAM lParam)
 {
     ASSERT(m_attached);
 
@@ -440,17 +458,17 @@
         return;
 
     RECT inspectorRect;
-    GetClientRect(m_webViewHwnd, &inspectorRect);
+    GetClientRect(m_frontendWebViewHwnd, &inspectorRect);
     unsigned inspectorHeight = inspectorRect.bottom - inspectorRect.top;
 
     windowPos->cy -= inspectorHeight;
 
-    SetWindowPos(m_webViewHwnd, 0, windowPos->x, windowPos->y + windowPos->cy, windowPos->cx, inspectorHeight, SWP_NOZORDER);
+    SetWindowPos(m_frontendWebViewHwnd, 0, windowPos->x, windowPos->y + windowPos->cy, windowPos->cx, inspectorHeight, SWP_NOZORDER);
 }
 
 static LRESULT CALLBACK WebInspectorWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
-    WebInspectorClient* client = reinterpret_cast<WebInspectorClient*>(::GetProp(hwnd, kWebInspectorPointerProp));
+    WebInspectorFrontendClient* client = reinterpret_cast<WebInspectorFrontendClient*>(::GetProp(hwnd, kWebInspectorPointerProp));
     if (!client)
         return ::DefWindowProc(hwnd, msg, wParam, lParam);
 
@@ -470,7 +488,7 @@
     return ::DefWindowProc(hwnd, msg, wParam, lParam);
 }
 
-void WebInspectorClient::windowReceivedMessage(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
+void WebInspectorFrontendClient::windowReceivedMessage(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     switch (msg) {
         case WM_WINDOWPOSCHANGING:
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 3f65b0a..455e3a1 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -31,6 +31,7 @@
 
 #include <WebCore/COMPtr.h>
 #include <WebCore/InspectorClient.h>
+#include <WebCore/InspectorFrontendClientLocal.h>
 #include <WebCore/PlatformString.h>
 #include <WebCore/WindowMessageListener.h>
 #include <wtf/OwnPtr.h>
@@ -39,44 +40,60 @@
 class WebNodeHighlight;
 class WebView;
 
-class WebInspectorClient : public WebCore::InspectorClient, WebCore::WindowMessageListener {
+class WebInspectorClient : public WebCore::InspectorClient {
 public:
     WebInspectorClient(WebView*);
 
     // InspectorClient
     virtual void inspectorDestroyed();
 
-    virtual WebCore::Page* createPage();
-
-    virtual WebCore::String localizedStringsURL();
-
-    virtual WebCore::String hiddenPanels();
-
-    virtual void showWindow();
-    virtual void closeWindow();
-    virtual bool windowVisible();
-
-    virtual void attachWindow();
-    virtual void detachWindow();
-
-    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void openInspectorFrontend(WebCore::InspectorController*);
 
     virtual void highlight(WebCore::Node*);
     virtual void hideHighlight();
 
-    virtual void inspectedURLChanged(const WebCore::String& newURL);
-
     virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
     virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
 
-    virtual void inspectorWindowObjectCleared();
+    void updateHighlight();
+    void frontendClosing() { m_frontendHwnd = 0; }
 
 private:
     ~WebInspectorClient();
 
+    WebView* m_inspectedWebView;
+    HWND m_inspectedWebViewHwnd;
+    HWND m_frontendHwnd;
+
+    OwnPtr<WebNodeHighlight> m_highlight;
+};
+
+class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal, WebCore::WindowMessageListener {
+public:
+    WebInspectorFrontendClient(WebView* inspectedWebView, HWND inspectedWebViewHwnd, HWND frontendHwnd, const COMPtr<WebView>& frotnendWebView, HWND frontendWebViewHwnd, WebInspectorClient* inspectorClient);
+
+    virtual void frontendLoaded();
+    
+    virtual WebCore::String localizedStringsURL();
+    virtual WebCore::String hiddenPanels();
+    
+    virtual void bringToFront();
+    virtual void closeWindow();
+    
+    virtual void attachWindow();
+    virtual void detachWindow();
+    
+    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void inspectedURLChanged(const WebCore::String& newURL);
+
+private:
+    ~WebInspectorFrontendClient();
+
     void closeWindowWithoutNotifications();
     void showWindowWithoutNotifications();
 
+    void destroyInspectorView();
+
     void updateWindowTitle();
 
     LRESULT onGetMinMaxInfo(WPARAM, LPARAM);
@@ -90,16 +107,16 @@
 
     WebView* m_inspectedWebView;
     HWND m_inspectedWebViewHwnd;
-    HWND m_hwnd;
-    COMPtr<WebView> m_webView;
-    HWND m_webViewHwnd;
+    HWND m_frontendHwnd;
+    WebInspectorClient* m_inspectorClient;
+    COMPtr<WebView> m_frontendWebView;
+    HWND m_frontendWebViewHwnd;
 
     bool m_shouldAttachWhenShown;
     bool m_attached;
 
-    OwnPtr<WebNodeHighlight> m_highlight;
-
     WebCore::String m_inspectedURL;
+    bool m_destroyingInspectorView;
 
     static friend LRESULT CALLBACK WebInspectorWndProc(HWND, UINT, WPARAM, LPARAM);
 };
diff --git a/WebKit/win/WebDownload.cpp b/WebKit/win/WebDownload.cpp
index 0893a73..fc72232 100644
--- a/WebKit/win/WebDownload.cpp
+++ b/WebKit/win/WebDownload.cpp
@@ -27,7 +27,6 @@
 #include "WebKitDLL.h"
 #include "WebDownload.h"
 
-#include "CString.h"
 #include "DefaultDownloadDelegate.h"
 #include "MarshallingHelpers.h"
 #include "WebError.h"
@@ -37,6 +36,7 @@
 #include "WebURLAuthenticationChallenge.h"
 #include "WebURLCredential.h"
 #include "WebURLResponse.h"
+#include <wtf/text/CString.h>
 
 #include <io.h>
 #include <sys/stat.h>
diff --git a/WebKit/win/WebDownloadCFNet.cpp b/WebKit/win/WebDownloadCFNet.cpp
index d1ff23d..a199315 100644
--- a/WebKit/win/WebDownloadCFNet.cpp
+++ b/WebKit/win/WebDownloadCFNet.cpp
@@ -27,7 +27,6 @@
 #include "WebKitDLL.h"
 #include "WebDownload.h"
 
-#include "CString.h"
 #include "DefaultDownloadDelegate.h"
 #include "MarshallingHelpers.h"
 #include "WebError.h"
@@ -39,6 +38,7 @@
 #include "WebURLResponse.h"
 
 #include <wtf/platform.h>
+#include <wtf/text/CString.h>
 
 #include <io.h>
 #include <sys/stat.h>
diff --git a/WebKit/win/WebDownloadCurl.cpp b/WebKit/win/WebDownloadCurl.cpp
index 608830b..2025922 100644
--- a/WebKit/win/WebDownloadCurl.cpp
+++ b/WebKit/win/WebDownloadCurl.cpp
@@ -27,7 +27,6 @@
 #include "WebKitDLL.h"
 #include "WebDownload.h"
 
-#include "CString.h"
 #include "DefaultDownloadDelegate.h"
 #include "MarshallingHelpers.h"
 #include "WebError.h"
@@ -39,6 +38,7 @@
 #include "WebURLResponse.h"
 
 #include <wtf/platform.h>
+#include <wtf/text/CString.h>
 
 #include <io.h>
 #include <sys/stat.h>
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 8e03794..01cc2b1 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1074,7 +1074,7 @@
 {
     Frame* coreFrame = core(this);
     ASSERT(coreFrame);
-    coreFrame->setZoomFactor(multiplier, true);
+    coreFrame->setZoomFactor(multiplier, ZoomTextOnly);
 }
 
 HRESULT WebFrame::inViewSourceMode(BOOL* flag)
@@ -1152,7 +1152,7 @@
     if (!inputElement)
         *result = false;
     else
-        *result = (inputElement->inputType() == HTMLInputElement::TEXT && inputElement->autoComplete());
+        *result = inputElement->isTextField() && inputElement->inputType() != HTMLInputElement::PASSWORD && inputElement->autoComplete();
 
     return S_OK;
 }
@@ -1435,6 +1435,21 @@
     return hr;
 }
 
+HRESULT STDMETHODCALLTYPE WebFrame::layerTreeAsText(BSTR* result)
+{
+    if (!result)
+        return E_POINTER;
+    *result = 0;
+
+    Frame* frame = core(this);
+    if (!frame)
+        return E_FAIL;
+
+    String text = frame->layerTreeAsText();
+    *result = BString(text).release();
+    return S_OK;
+}
+
 void WebFrame::frameLoaderDestroyed()
 {
     // The FrameLoader going away is equivalent to the Frame going away,
@@ -2410,7 +2425,7 @@
         return S_OK;
 
     JSLock lock(SilenceAssertionsOnly);
-    String resultString = String(result.toString(anyWorldGlobalObject->globalExec()));
+    String resultString = ustringToString(result.toString(anyWorldGlobalObject->globalExec()));
     *evaluationResult = BString(resultString).release();
 
     return S_OK;
@@ -2473,3 +2488,4 @@
 
     coreFrame->view()->updateBackgroundRecursively(backgroundColor, webView()->transparent());
 }
+
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index f4973ea..0f1e4d8 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -265,6 +265,8 @@
 
     virtual HRESULT STDMETHODCALLTYPE visibleContentRect(RECT*);
 
+    virtual HRESULT STDMETHODCALLTYPE layerTreeAsText(BSTR*);
+
     // IWebDocumentText
     virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding( 
         /* [retval][out] */ BOOL* result);
diff --git a/WebKit/win/WebHistoryItem.cpp b/WebKit/win/WebHistoryItem.cpp
index aa839d6..098eb86 100644
--- a/WebKit/win/WebHistoryItem.cpp
+++ b/WebKit/win/WebHistoryItem.cpp
@@ -34,13 +34,13 @@
 
 #pragma warning(push, 0)
 #include <WebCore/BString.h>
-#include <WebCore/CString.h>
 #include <WebCore/HistoryItem.h>
 #include <WebCore/KURL.h>
 #pragma warning(pop)
 
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
 
 using namespace WebCore;
 
diff --git a/WebKit/win/WebInspector.cpp b/WebKit/win/WebInspector.cpp
index e4ac32b..0337711 100644
--- a/WebKit/win/WebInspector.cpp
+++ b/WebKit/win/WebInspector.cpp
@@ -131,19 +131,11 @@
 
 HRESULT STDMETHODCALLTYPE WebInspector::attach()
 {
-    if (m_webView)
-        if (Page* page = m_webView->page())
-            page->inspectorController()->attachWindow();
-
     return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE WebInspector::detach()
 {
-    if (m_webView)
-        if (Page* page = m_webView->page())
-            page->inspectorController()->detachWindow();
-
     return S_OK;
 }
 
diff --git a/WebKit/win/WebKit.vcproj/Interfaces.vcproj b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
index c6a0add..0dab8a8 100644
--- a/WebKit/win/WebKit.vcproj/Interfaces.vcproj
+++ b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
@@ -1664,6 +1664,26 @@
 			</FileConfiguration>

 		</File>

 		<File

+			RelativePath="..\Interfaces\IWebUserContentURLPattern.idl"

+			>

+			<FileConfiguration

+				Name="Debug|Win32"

+				ExcludedFromBuild="true"

+				>

+				<Tool

+					Name="VCMIDLTool"

+				/>

+			</FileConfiguration>

+			<FileConfiguration

+				Name="Release|Win32"

+				ExcludedFromBuild="true"

+				>

+				<Tool

+					Name="VCMIDLTool"

+				/>

+			</FileConfiguration>

+		</File>

+		<File

 			RelativePath="..\Interfaces\IWebView.idl"

 			>

 			<FileConfiguration

diff --git a/WebKit/win/WebKit.vcproj/WebKit.def b/WebKit/win/WebKit.vcproj/WebKit.def
index 9e6e55f..8d091ec 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.def
+++ b/WebKit/win/WebKit.vcproj/WebKit.def
@@ -20,7 +20,6 @@
         WebKitSetShouldUseFontSmoothing
         WebKitShouldUseFontSmoothing
         WebKitCreateInstance
-        WebKitSystemParameterChanged
 		
         ; These functions are deprecated
         WebLocalizedString
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index 57d1da2..36345ed 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -63,7 +63,7 @@
 				OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"

 				AdditionalLibraryDirectories="$(DXSDK_DIR)\Lib\x86"

 				ModuleDefinitionFile="WebKit$(WebKitDLLConfigSuffix).def"

-				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll;QuartzCore.dll;QuartzCoreInterface.dll"

+				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -140,7 +140,7 @@
 				OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"

 				AdditionalLibraryDirectories="$(DXSDK_DIR)\Lib\x86"

 				ModuleDefinitionFile="WebKit$(WebKitDLLConfigSuffix).def"

-				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll;QuartzCore.dll;QuartzCoreInterface.dll"

+				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -217,7 +217,7 @@
 				OutputFile="$(OutDir)\$(ProjectName)$(WebKitDLLConfigSuffix).dll"

 				AdditionalLibraryDirectories="$(DXSDK_DIR)\Lib\x86"

 				ModuleDefinitionFile="WebKit$(WebKitDLLConfigSuffix).def"

-				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll;QuartzCore.dll;QuartzCoreInterface.dll"

+				DelayLoadDLLs="comdlg32.dll;usp10.dll;comctl32.dll;version.dll;libxslt$(LibraryConfigSuffix).dll;SQLite3$(LibraryConfigSuffix).dll;msimg32.dll;QTMovieWin$(WebKitConfigSuffix).dll;iphlpapi.dll;rpcrt4.dll"

 			/>

 			<Tool

 				Name="VCALinkTool"

@@ -846,6 +846,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\WebUserContentURLPattern.h"

+				>

+			</File>

+			<File

 				RelativePath="..\WebView.h"

 				>

 			</File>

@@ -1258,6 +1262,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\WebUserContentURLPattern.cpp"

+				>

+			</File>

+			<File

 				RelativePath="..\WebView.cpp"

 				>

 			</File>

diff --git a/WebKit/win/WebKit.vcproj/WebKit_debug.def b/WebKit/win/WebKit.vcproj/WebKit_debug.def
index fac9d6f..c15957a 100644
--- a/WebKit/win/WebKit.vcproj/WebKit_debug.def
+++ b/WebKit/win/WebKit.vcproj/WebKit_debug.def
@@ -20,7 +20,6 @@
         WebKitSetShouldUseFontSmoothing
         WebKitShouldUseFontSmoothing
         WebKitCreateInstance
-        WebKitSystemParameterChanged
 		
         ; These functions are deprecated
         WebLocalizedString
diff --git a/WebKit/win/WebKitClassFactory.cpp b/WebKit/win/WebKitClassFactory.cpp
index d243588..8a956e3 100644
--- a/WebKit/win/WebKitClassFactory.cpp
+++ b/WebKit/win/WebKitClassFactory.cpp
@@ -54,11 +54,11 @@
 #include "WebURLCredential.h"
 #include "WebURLProtectionSpace.h"
 #include "WebURLResponse.h"
+#include "WebUserContentURLPattern.h"
 #include "WebView.h"
 #include "WebWorkersPrivate.h"
 #pragma warning(push, 0)
 #include <JavaScriptCore/InitializeThreading.h>
-#include <WebCore/FontDatabase.h>
 #include <WebCore/SoftLinking.h>
 #pragma warning(pop)
 
@@ -87,7 +87,6 @@
 #endif
 
     JSC::initializeThreading();
-    WebCore::populateFontDatabase();
 
     gClassCount++;
     gClassNameCount.add("WebKitClassFactory");
diff --git a/WebKit/win/WebKitDLL.cpp b/WebKit/win/WebKitDLL.cpp
index 9f4eaeb..f8aa261 100644
--- a/WebKit/win/WebKitDLL.cpp
+++ b/WebKit/win/WebKitDLL.cpp
@@ -36,6 +36,7 @@
 #include <WebCore/PageGroup.h>
 #include <WebCore/RenderThemeWin.h>
 #include <WebCore/SharedBuffer.h>
+#include <WebCore/WebCoreInstanceHandle.h>
 #include <WebCore/Widget.h>
 #include <wtf/Vector.h>
 #include <tchar.h>
@@ -60,7 +61,7 @@
         case DLL_PROCESS_ATTACH:
             gLockCount = gClassCount = 0;
             gInstance = hModule;
-            WebCore::Page::setInstanceHandle(hModule);
+            WebCore::setInstanceHandle(hModule);
             return TRUE;
 
         case DLL_PROCESS_DETACH:
diff --git a/WebKit/win/WebKitGraphics.cpp b/WebKit/win/WebKitGraphics.cpp
index 444c43c..d7123b4 100644
--- a/WebKit/win/WebKitGraphics.cpp
+++ b/WebKit/win/WebKitGraphics.cpp
@@ -34,7 +34,6 @@
 #pragma warning(push, 0)
 #include <WebCore/CharacterNames.h>
 #include <WebCore/Font.h>
-#include <WebCore/FontDatabase.h>
 #include <WebCore/FontDescription.h>
 #include <WebCore/FontSelector.h>
 #include <WebCore/GraphicsContext.h>
@@ -52,7 +51,6 @@
 static Font makeFont(const WebFontDescription& description)
 {
     AtomicString::init();
-    populateFontDatabase();
 
     String fontFamilyString(description.family, description.familyLength);
 
@@ -175,9 +173,3 @@
 {
     return WebCoreShouldUseFontSmoothing();
 }
-
-void WebKitSystemParameterChanged(UINT parameter)
-{
-    if (parameter == SPI_SETFONTSMOOTHING || parameter == SPI_SETFONTSMOOTHINGTYPE || parameter == SPI_SETFONTSMOOTHINGCONTRAST || parameter == SPI_SETFONTSMOOTHINGORIENTATION)
-        wkSystemFontSmoothingChanged();
-}
diff --git a/WebKit/win/WebKitGraphics.h b/WebKit/win/WebKitGraphics.h
index 75ab36c..59c874b 100644
--- a/WebKit/win/WebKitGraphics.h
+++ b/WebKit/win/WebKitGraphics.h
@@ -74,8 +74,6 @@
 void WebKitSetShouldUseFontSmoothing(bool);
 bool WebKitShouldUseFontSmoothing();
 
-void WebKitSystemParameterChanged(UINT parameter);
-
 }
 
 #endif // !defined(WebKitGraphics_h)
diff --git a/WebKit/win/WebKitPrefix.h b/WebKit/win/WebKitPrefix.h
index 13cf8e0..9b2fc85 100644
--- a/WebKit/win/WebKitPrefix.h
+++ b/WebKit/win/WebKitPrefix.h
@@ -47,4 +47,5 @@
 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
 #endif
 
+#include <CoreFoundation/CoreFoundation.h>
 #include <WebKit/WebKit.h>
diff --git a/WebKit/win/WebLocalizableStrings.cpp b/WebKit/win/WebLocalizableStrings.cpp
index 69675e2..ab2db5d 100644
--- a/WebKit/win/WebLocalizableStrings.cpp
+++ b/WebKit/win/WebLocalizableStrings.cpp
@@ -29,9 +29,9 @@
 #include "WebLocalizableStrings.h"
 
 #pragma warning(push, 0)
-#include <WebCore/CString.h>
 #include <WebCore/PlatformString.h>
 #include <WebCore/StringHash.h>
+#include <wtf/text/CString.h>
 #pragma warning(pop)
 
 #include <wtf/Assertions.h>
diff --git a/WebKit/win/WebMutableURLRequest.cpp b/WebKit/win/WebMutableURLRequest.cpp
index 69555c8..655b411 100644
--- a/WebKit/win/WebMutableURLRequest.cpp
+++ b/WebKit/win/WebMutableURLRequest.cpp
@@ -33,10 +33,10 @@
 #pragma warning(push, 0)
 #include <WebCore/BString.h>
 #include <WebCore/COMPtr.h>
-#include <WebCore/CString.h>
 #include <WebCore/FormData.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/ResourceHandle.h>
+#include <wtf/text/CString.h>
 #pragma warning(pop)
 
 #include <wtf/RetainPtr.h>
diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h
index d1e0f5e..c57934c 100644
--- a/WebKit/win/WebPreferenceKeysPrivate.h
+++ b/WebKit/win/WebPreferenceKeysPrivate.h
@@ -131,8 +131,12 @@
 
 #define WebKitPluginAllowedRunTimePreferenceKey "WebKitPluginAllowedRunTime"
 
-#define WebKitFrameSetFlatteningEnabledPreferenceKey "WebKitFrameSetFlatteningEnabled"
+#define WebKitFrameFlatteningEnabledPreferenceKey "WebKitFrameFlatteningEnabled"
 
 #define WebKitAcceleratedCompositingEnabledPreferenceKey "WebKitAcceleratedCompositingEnabled"
 
+#define WebKitShowDebugBordersPreferenceKey "WebKitShowDebugBorders"
+
+#define WebKitShowRepaintCounterPreferenceKey "WebKitShowRepaintCounter"
+
 #define WebKitCustomDragCursorsEnabledPreferenceKey "WebKitCustomDragCursorsEnabled"
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index 0e44d9f..b5937cb 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -32,7 +32,6 @@
 #include "WebNotificationCenter.h"
 #include "WebPreferenceKeysPrivate.h"
 
-#include <WebCore/CString.h>
 #include <WebCore/FileSystem.h>
 #include <WebCore/Font.h>
 #include <WebCore/PlatformString.h>
@@ -46,6 +45,7 @@
 #include <tchar.h>
 #include <wtf/HashMap.h>
 #include <wtf/OwnArrayPtr.h>
+#include <wtf/text/CString.h>
 
 #if PLATFORM(CG)
 #include <CoreGraphics/CoreGraphics.h>
@@ -207,7 +207,7 @@
     CFDictionaryAddValue(defaults, CFSTR(WebKitAllowUniversalAccessFromFileURLsPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitAllowFileAccessFromFileURLsPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitXSSAuditorEnabledPreferenceKey), kCFBooleanTrue);
-    CFDictionaryAddValue(defaults, CFSTR(WebKitFrameSetFlatteningEnabledPreferenceKey), kCFBooleanFalse);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitFrameFlatteningEnabledPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitPluginsEnabledPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitDatabasesEnabledPreferenceKey), kCFBooleanTrue);
@@ -256,7 +256,9 @@
     RetainPtr<CFStringRef> pluginAllowedRunTime(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%u"), numeric_limits<unsigned>::max()));
     CFDictionaryAddValue(defaults, CFSTR(WebKitPluginAllowedRunTimePreferenceKey), pluginAllowedRunTime.get());
 
-    CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanTrue);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanFalse);
+    
+    CFDictionaryAddValue(defaults, CFSTR(WebKitShowDebugBordersPreferenceKey), kCFBooleanFalse);
 
     defaultSettings = defaults;
 }
@@ -420,7 +422,7 @@
     setBoolValue(didMigrateKey, TRUE);
     m_autoSaves = oldValue;
 
-    CString path = oldPreferencesPath().utf8();
+    WTF::CString path = oldPreferencesPath().utf8();
 
     RetainPtr<CFURLRef> urlRef(AdoptCF, CFURLCreateFromFileSystemRepresentation(0, reinterpret_cast<const UInt8*>(path.data()), path.length(), false));
     if (!urlRef)
@@ -821,17 +823,17 @@
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebPreferences::isFrameSetFlatteningEnabled(
+HRESULT STDMETHODCALLTYPE WebPreferences::isFrameFlatteningEnabled(
     /* [retval][out] */ BOOL* enabled)
 {
-    *enabled = boolValueForKey(CFSTR(WebKitFrameSetFlatteningEnabledPreferenceKey));
+    *enabled = boolValueForKey(CFSTR(WebKitFrameFlatteningEnabledPreferenceKey));
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebPreferences::setFrameSetFlatteningEnabled(
+HRESULT STDMETHODCALLTYPE WebPreferences::setFrameFlatteningEnabled(
     /* [in] */ BOOL enabled)
 {
-    setBoolValue(CFSTR(WebKitFrameSetFlatteningEnabledPreferenceKey), enabled);
+    setBoolValue(CFSTR(WebKitFrameFlatteningEnabledPreferenceKey), enabled);
     return S_OK;
 }
 
@@ -1403,6 +1405,30 @@
     return S_OK;
 }
 
+HRESULT WebPreferences::showDebugBorders(BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitShowDebugBordersPreferenceKey));
+    return S_OK;
+}
+
+HRESULT WebPreferences::setShowDebugBorders(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitShowDebugBordersPreferenceKey), enabled);
+    return S_OK;
+}
+
+HRESULT WebPreferences::showRepaintCounter(BOOL* enabled)
+{
+    *enabled = boolValueForKey(CFSTR(WebKitShowRepaintCounterPreferenceKey));
+    return S_OK;
+}
+
+HRESULT WebPreferences::setShowRepaintCounter(BOOL enabled)
+{
+    setBoolValue(CFSTR(WebKitShowRepaintCounterPreferenceKey), enabled);
+    return S_OK;
+}
+
 HRESULT WebPreferences::setCustomDragCursorsEnabled(BOOL enabled)
 {
     setBoolValue(CFSTR(WebKitCustomDragCursorsEnabledPreferenceKey), enabled);
diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h
index e4af17a..241178d 100644
--- a/WebKit/win/WebPreferences.h
+++ b/WebKit/win/WebPreferences.h
@@ -386,10 +386,10 @@
     virtual HRESULT STDMETHODCALLTYPE pluginAllowedRunTime(
     /* [retval][out] */ UINT* allowedRunTime);
 
-    virtual HRESULT STDMETHODCALLTYPE isFrameSetFlatteningEnabled(
+    virtual HRESULT STDMETHODCALLTYPE isFrameFlatteningEnabled(
     /* [retval][out] */ BOOL* enabled);
 
-    virtual HRESULT STDMETHODCALLTYPE setFrameSetFlatteningEnabled(
+    virtual HRESULT STDMETHODCALLTYPE setFrameFlatteningEnabled(
     /* [in] */ BOOL enabled);
 
     virtual HRESULT STDMETHODCALLTYPE setPreferenceForTest(
@@ -402,7 +402,13 @@
     virtual HRESULT STDMETHODCALLTYPE setCustomDragCursorsEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE customDragCursorsEnabled(BOOL*);
 
-    // WebPreferences
+    virtual HRESULT STDMETHODCALLTYPE setShowDebugBorders(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE showDebugBorders(BOOL*);
+
+    virtual HRESULT STDMETHODCALLTYPE setShowRepaintCounter(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE showRepaintCounter(BOOL*);
+
+   // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.
     // See <rdar://5343767> for the justification.
diff --git a/WebKit/win/WebScriptWorld.cpp b/WebKit/win/WebScriptWorld.cpp
index 7bc04eb..9c661d9 100644
--- a/WebKit/win/WebScriptWorld.cpp
+++ b/WebKit/win/WebScriptWorld.cpp
@@ -136,3 +136,9 @@
         return E_POINTER;
     return findOrCreateWorld(currentWorld(toJS(context))).copyRefTo(outWorld);
 }
+
+HRESULT WebScriptWorld::unregisterWorld()
+{
+    m_world->unregisterWorld();
+    return S_OK;
+}
diff --git a/WebKit/win/WebScriptWorld.h b/WebKit/win/WebScriptWorld.h
index dc7e9db..f088a72 100644
--- a/WebKit/win/WebScriptWorld.h
+++ b/WebKit/win/WebScriptWorld.h
@@ -52,6 +52,7 @@
     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void** ppvObject);
     virtual HRESULT STDMETHODCALLTYPE standardWorld(IWebScriptWorld**);
     virtual HRESULT STDMETHODCALLTYPE scriptWorldForGlobalContext(JSGlobalContextRef, IWebScriptWorld**);
+    virtual HRESULT STDMETHODCALLTYPE unregisterWorld();
 
     ULONG m_refCount;
     RefPtr<WebCore::DOMWrapperWorld> m_world;
diff --git a/WebKit/win/WebTextRenderer.cpp b/WebKit/win/WebTextRenderer.cpp
index 7ff2ff3..6d6d9a3 100644
--- a/WebKit/win/WebTextRenderer.cpp
+++ b/WebKit/win/WebTextRenderer.cpp
@@ -31,12 +31,6 @@
 
 #include "WebKitDLL.h"
 
-#include <CoreFoundation/CFString.h>
-#if PLATFORM(CG)
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#endif
-#include <wtf/RetainPtr.h>
-
 WebTextRenderer* WebTextRenderer::createInstance()
 {
     WebTextRenderer* instance = new WebTextRenderer;
@@ -91,9 +85,5 @@
     if (!AddFontResourceEx(fontFilePath, FR_PRIVATE, 0))
         return E_FAIL;
 
-    RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(fontFilePath), static_cast<CFIndex>(wcslen(fontFilePath))));
-#if PLATFORM(CG)
-    wkAddFontsAtPath(string.get());
-#endif
     return S_OK;
 }
diff --git a/WebKit/win/WebUserContentURLPattern.cpp b/WebKit/win/WebUserContentURLPattern.cpp
new file mode 100644
index 0000000..5312fca
--- /dev/null
+++ b/WebKit/win/WebUserContentURLPattern.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "WebKitDLL.h"
+#include "WebUserContentURLPattern.h"
+
+#include <WebCore/BString.h>
+#include <WebCore/KURL.h>
+
+using namespace WebCore;
+
+inline WebUserContentURLPattern::WebUserContentURLPattern()
+    : m_refCount(0)
+{
+    ++gClassCount;
+    gClassNameCount.add("WebUserContentURLPattern");
+}
+
+WebUserContentURLPattern::~WebUserContentURLPattern()
+{
+    --gClassCount;
+    gClassNameCount.remove("WebUserContentURLPattern");
+}
+
+COMPtr<WebUserContentURLPattern> WebUserContentURLPattern::createInstance()
+{
+    return new WebUserContentURLPattern;
+}
+
+ULONG WebUserContentURLPattern::AddRef()
+{
+    return ++m_refCount;
+}
+
+ULONG WebUserContentURLPattern::Release()
+{
+    ULONG newRefCount = --m_refCount;
+    if (!newRefCount)
+        delete this;
+    return newRefCount;
+}
+
+HRESULT WebUserContentURLPattern::QueryInterface(REFIID riid, void** ppvObject)
+{
+    if (!ppvObject)
+        return E_POINTER;
+    *ppvObject = 0;
+
+    if (IsEqualIID(riid, __uuidof(WebUserContentURLPattern)))
+        *ppvObject = this;
+    else if (IsEqualIID(riid, __uuidof(IWebUserContentURLPattern)))
+        *ppvObject = static_cast<IWebUserContentURLPattern*>(this);
+    else if (IsEqualIID(riid, IID_IUnknown))
+        *ppvObject = static_cast<IUnknown*>(this);
+    else
+        return E_NOINTERFACE;
+
+    AddRef();
+    return S_OK;
+}
+
+HRESULT WebUserContentURLPattern::parse(BSTR patternString)
+{
+    m_pattern = UserContentURLPattern(String(patternString, SysStringLen(patternString)));
+    return S_OK;
+}
+
+HRESULT WebUserContentURLPattern::isValid(BOOL* isValid)
+{
+    if (!isValid)
+        return E_POINTER;
+    *isValid = m_pattern.isValid();
+    return S_OK;
+}
+
+HRESULT WebUserContentURLPattern::scheme(BSTR* scheme)
+{
+    if (!scheme)
+        return E_POINTER;
+    *scheme = BString(m_pattern.scheme()).release();
+    return S_OK;
+}
+
+HRESULT WebUserContentURLPattern::host(BSTR* host)
+{
+    if (!host)
+        return E_POINTER;
+    *host = BString(m_pattern.host()).release();
+    return S_OK;
+}
+
+HRESULT WebUserContentURLPattern::matchesSubdomains(BOOL* matches)
+{
+    if (!matches)
+        return E_POINTER;
+    *matches = m_pattern.matchSubdomains();
+    return S_OK;
+}
diff --git a/WebKit/win/WebUserContentURLPattern.h b/WebKit/win/WebUserContentURLPattern.h
new file mode 100644
index 0000000..143f644
--- /dev/null
+++ b/WebKit/win/WebUserContentURLPattern.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 WebUserContentURLPattern_h
+#define WebUserContentURLPattern_h
+
+#include <WebCore/COMPtr.h>
+#include <WebCore/UserContentURLPattern.h>
+
+namespace WebCore {
+    class UserContentURLPattern;
+}
+
+class WebUserContentURLPattern : public Noncopyable, public IWebUserContentURLPattern {
+public:
+    static COMPtr<WebUserContentURLPattern> createInstance();
+
+    virtual ULONG STDMETHODCALLTYPE AddRef();
+    virtual ULONG STDMETHODCALLTYPE Release();
+
+private:
+    WebUserContentURLPattern();
+    ~WebUserContentURLPattern();
+
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void** ppvObject);
+    virtual HRESULT STDMETHODCALLTYPE parse(BSTR patternString);
+    virtual HRESULT STDMETHODCALLTYPE isValid(BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE scheme(BSTR*);
+    virtual HRESULT STDMETHODCALLTYPE host(BSTR*);
+    virtual HRESULT STDMETHODCALLTYPE matchesSubdomains(BOOL* matches);
+
+    ULONG m_refCount;
+    WebCore::UserContentURLPattern m_pattern;
+};
+
+#endif // WebScriptWorld_h
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 8636d15..da2c436 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -66,13 +66,13 @@
 #include <WebCore/BString.h>
 #include <WebCore/BackForwardList.h>
 #include <WebCore/BitmapInfo.h>
-#include <WebCore/CString.h>
 #include <WebCore/Cache.h>
 #include <WebCore/Chrome.h>
 #include <WebCore/ContextMenu.h>
 #include <WebCore/ContextMenuController.h>
 #include <WebCore/CookieStorageWin.h>
 #include <WebCore/Cursor.h>
+#include <WebCore/Database.h>
 #include <WebCore/Document.h>
 #include <WebCore/DragController.h>
 #include <WebCore/DragData.h>
@@ -150,6 +150,7 @@
 #include <tchar.h>
 #include <windowsx.h>
 #include <wtf/HashSet.h>
+#include <wtf/text/CString.h>
 
 // Soft link functions for gestures and panning feedback
 SOFT_LINK_LIBRARY(USER32);
@@ -735,6 +736,10 @@
     }
     m_backingStoreBitmap.clear();
     m_backingStoreDirtyRegion.clear();
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_layerRenderer)
+        m_layerRenderer->setBackingStoreDirty(false);
+#endif
 
     m_backingStoreSize.cx = m_backingStoreSize.cy = 0;
 }
@@ -783,6 +788,11 @@
     } else
         m_backingStoreDirtyRegion.set(newRegion);
 
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_layerRenderer)
+        m_layerRenderer->setBackingStoreDirty(true);
+#endif
+
     if (m_uiDelegatePrivate)
         m_uiDelegatePrivate->webViewDidInvalidate(this);
 }
@@ -909,6 +919,10 @@
             m_uiDelegatePrivate->webViewPainted(this);
 
         m_backingStoreDirtyRegion.clear();
+#if USE(ACCELERATED_COMPOSITING)
+        if (m_layerRenderer)
+            m_layerRenderer->setBackingStoreDirty(false);
+#endif
     }
 
     if (!dc) {
@@ -2879,9 +2893,9 @@
 void WebView::setZoomMultiplier(float multiplier, bool isTextOnly)
 {
     m_zoomMultiplier = multiplier;
-    m_page->settings()->setZoomsTextOnly(isTextOnly);
+    m_page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage);
     if (Frame* coreFrame = core(m_mainFrame))
-        coreFrame->setZoomFactor(multiplier, isTextOnly);
+        coreFrame->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage);
 }
 
 HRESULT STDMETHODCALLTYPE WebView::textSizeMultiplier( 
@@ -2900,7 +2914,8 @@
 
 float WebView::zoomMultiplier(bool isTextOnly)
 {
-    if (isTextOnly != m_page->settings()->zoomsTextOnly())
+    ZoomMode zoomMode = isTextOnly ? ZoomTextOnly : ZoomPage;
+    if (zoomMode != m_page->settings()->zoomMode())
         return 1.0f;
     return m_zoomMultiplier;
 }
@@ -3049,7 +3064,7 @@
     else if (scriptExecutionResult.isString()) {
         JSLock lock(JSC::SilenceAssertionsOnly);
         JSC::ExecState* exec = coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec();
-        *result = BString(String(scriptExecutionResult.getString(exec)));
+        *result = BString(ustringToString(scriptExecutionResult.getString(exec)));
     }
 
     return S_OK;
@@ -3125,6 +3140,14 @@
     return E_NOTIMPL;
 }
 
+static void systemParameterChanged(WPARAM parameter)
+{
+#if PLATFORM(CG)
+    if (parameter == SPI_SETFONTSMOOTHING || parameter == SPI_SETFONTSMOOTHINGTYPE || parameter == SPI_SETFONTSMOOTHINGCONTRAST || parameter == SPI_SETFONTSMOOTHINGORIENTATION)
+        wkSystemFontSmoothingChanged();
+#endif
+}
+
 void WebView::windowReceivedMessage(HWND, UINT message, WPARAM wParam, LPARAM)
 {
     switch (message) {
@@ -3133,6 +3156,9 @@
         if (!wParam)
             deleteBackingStoreSoon();
         break;
+    case WM_SETTINGCHANGE:
+        systemParameterChanged(wParam);
+        break;
     }
 }
 
@@ -3402,6 +3428,9 @@
 
     *isLoading = FALSE;
 
+    if (!m_mainFrame)
+        return E_FAIL;
+
     if (SUCCEEDED(m_mainFrame->dataSource(&dataSource)))
         dataSource->isLoading(isLoading);
 
@@ -3669,7 +3698,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    bool canGrowMore = canZoomIn(m_page->settings()->zoomsTextOnly());
+    bool canGrowMore = canZoomIn(m_page->settings()->zoomMode() == ZoomTextOnly);
     *result = canGrowMore ? TRUE : FALSE;
     return S_OK;
 }
@@ -3691,7 +3720,7 @@
 HRESULT STDMETHODCALLTYPE WebView::makeTextLarger( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    return zoomIn(m_page->settings()->zoomsTextOnly());
+    return zoomIn(m_page->settings()->zoomMode() == ZoomTextOnly);
 }
 
 HRESULT STDMETHODCALLTYPE WebView::zoomPageIn( 
@@ -3712,7 +3741,7 @@
         /* [in] */ IUnknown* /*sender*/,
         /* [retval][out] */ BOOL* result)
 {
-    bool canShrinkMore = canZoomOut(m_page->settings()->zoomsTextOnly());
+    bool canShrinkMore = canZoomOut(m_page->settings()->zoomMode() == ZoomTextOnly);
     *result = canShrinkMore ? TRUE : FALSE;
     return S_OK;
 }
@@ -3734,7 +3763,7 @@
 HRESULT STDMETHODCALLTYPE WebView::makeTextSmaller( 
         /* [in] */ IUnknown* /*sender*/)
 {
-    return zoomOut(m_page->settings()->zoomsTextOnly());
+    return zoomOut(m_page->settings()->zoomMode() == ZoomTextOnly);
 }
 
 HRESULT STDMETHODCALLTYPE WebView::zoomPageOut( 
@@ -4565,7 +4594,7 @@
     hr = preferences->zoomsTextOnly(&enabled);
     if (FAILED(hr))
         return hr;
-    settings->setZoomsTextOnly(!!enabled);
+    settings->setZoomMode(enabled ? ZoomTextOnly : ZoomPage);
 
     settings->setShowsURLsInToolTips(false);
     settings->setForceFTPDirectoryListings(true);
@@ -4596,10 +4625,12 @@
         return hr;
     settings->setOfflineWebApplicationCacheEnabled(enabled);
 
+#if ENABLE(DATABASE)
     hr = prefsPrivate->databasesEnabled(&enabled);
     if (FAILED(hr))
         return hr;
-    settings->setDatabasesEnabled(enabled);
+    Database::setIsAvailable(enabled);
+#endif
 
     hr = prefsPrivate->localStorageEnabled(&enabled);
     if (FAILED(hr))
@@ -4649,10 +4680,10 @@
         return hr;
     settings->setPluginAllowedRunTime(runTime);
 
-    hr = prefsPrivate->isFrameSetFlatteningEnabled(&enabled);
+    hr = prefsPrivate->isFrameFlatteningEnabled(&enabled);
     if (FAILED(hr))
         return hr;
-    settings->setFrameSetFlatteningEnabled(enabled);
+    settings->setFrameFlatteningEnabled(enabled);
 
 #if USE(ACCELERATED_COMPOSITING)
     hr = prefsPrivate->acceleratedCompositingEnabled(&enabled);
@@ -4661,6 +4692,16 @@
     settings->setAcceleratedCompositingEnabled(enabled);
 #endif
 
+    hr = prefsPrivate->showDebugBorders(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setShowDebugBorders(enabled);
+
+    hr = prefsPrivate->showRepaintCounter(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setShowRepaintCounter(enabled);
+
 #if ENABLE(3D_CANVAS)
     settings->setWebGLEnabled(true);
 #endif  // ENABLE(3D_CANVAS)
@@ -5993,15 +6034,21 @@
     return S_OK;
 }
 
-HRESULT WebView::whiteListAccessFromOrigin(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
+HRESULT WebView::addOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
 {
-    SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
+    SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
     return S_OK;
 }
 
-HRESULT WebView::resetOriginAccessWhiteLists()
+HRESULT WebView::removeOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains)
 {
-    SecurityOrigin::resetOriginAccessWhiteLists();
+    SecurityOrigin::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains);
+    return S_OK;
+}
+
+HRESULT WebView::resetOriginAccessWhitelists()
+{
+    SecurityOrigin::resetOriginAccessWhitelists();
     return S_OK;
 }
  
@@ -6041,7 +6088,7 @@
 }
 
 #if USE(ACCELERATED_COMPOSITING)
-void WebView::setRootChildLayer(WebCore::PlatformLayer* layer)
+void WebView::setRootChildLayer(WebCore::WKCACFLayer* layer)
 {
     setAcceleratedCompositing(layer ? true : false);
     if (m_layerRenderer)
@@ -6061,7 +6108,7 @@
             // Create the root layer
             ASSERT(m_viewWindow);
             m_layerRenderer->setHostWindow(m_viewWindow);
-            updateRootLayerContents();
+            m_layerRenderer->createRenderer();
         }
     } else {
         m_layerRenderer = 0;
@@ -6100,7 +6147,7 @@
         return;
     FrameView* frameView = coreFrame->view();
 
-    m_layerRenderer->setScrollFrame(IntRect(frameView->scrollX(), frameView->scrollY(), frameView->layoutWidth(), frameView->layoutHeight()));
+    m_layerRenderer->setScrollFrame(IntPoint(frameView->scrollX(), frameView->scrollY()), IntSize(frameView->layoutWidth(), frameView->layoutHeight()));
 }
 #endif
 
@@ -6242,6 +6289,12 @@
     return S_OK;
 }
 
+HRESULT WebView::registerURLSchemeAsSecure(BSTR scheme)
+{
+    SecurityOrigin::registerURLSchemeAsSecure(toString(scheme));
+    return S_OK;
+}
+
 class EnumTextMatches : public IEnumTextMatches
 {
     long m_ref;
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 56fb40c..48f3ef8 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -761,9 +761,9 @@
 
     virtual HRESULT STDMETHODCALLTYPE invalidateBackingStore(const RECT*);
 
-    virtual HRESULT STDMETHODCALLTYPE whiteListAccessFromOrigin(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
-    virtual HRESULT STDMETHODCALLTYPE resetOriginAccessWhiteLists();
-
+    virtual HRESULT STDMETHODCALLTYPE addOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
+    virtual HRESULT STDMETHODCALLTYPE removeOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains);
+    virtual HRESULT STDMETHODCALLTYPE resetOriginAccessWhitelists();
 
     virtual HRESULT STDMETHODCALLTYPE setHistoryDelegate(IWebHistoryDelegate* historyDelegate);
     virtual HRESULT STDMETHODCALLTYPE historyDelegate(IWebHistoryDelegate** historyDelegate);
@@ -779,6 +779,7 @@
     virtual HRESULT STDMETHODCALLTYPE geolocationDidFailWithError(IWebError* error);
 
     virtual HRESULT STDMETHODCALLTYPE setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, BSTR scheme);
+    virtual HRESULT STDMETHODCALLTYPE registerURLSchemeAsSecure(BSTR);
 
     // WebView
     bool shouldUseEmbeddedView(const WebCore::String& mimeType) const;
@@ -875,7 +876,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
     void setRootLayerNeedsDisplay() { if (m_layerRenderer) m_layerRenderer->setNeedsDisplay(); }
-    void setRootChildLayer(WebCore::PlatformLayer* layer);
+    void setRootChildLayer(WebCore::WKCACFLayer* layer);
 #endif
 
     void enterFullscreenForNode(WebCore::Node*);
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 7d6d9dd..6e04904 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,193 @@
+2010-04-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::committedLoad):
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Change a parameter type of chooseIconForFiles()
+        https://bugs.webkit.org/show_bug.cgi?id=37504
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::chooseIconForFiles):
+        * WebKitSupport/ChromeClientWx.h:
+
+2010-04-19  Kevin Ollivier  <kevino@theolliviers.com>
+
+        Build fix, add stub for new FrameLoaderClient method.
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::dispatchDidChangeIcons):
+        * WebKitSupport/FrameLoaderClientWx.h:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57468.
+        http://trac.webkit.org/changeset/57468
+        https://bugs.webkit.org/show_bug.cgi?id=37433
+
+        Broke the world...  Must have applied the patch wrong
+        (Requested by abarth on #webkit).
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::committedLoad):
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor DocumentWriter out of FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=37175
+
+        Update these callsites because the method moved to DocumentWriter.
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::committedLoad):
+
+2010-04-07  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Removed redundant FrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest()
+        https://bugs.webkit.org/show_bug.cgi?id=36949
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        * WebKitSupport/FrameLoaderClientWx.h:
+
+2010-03-31  Marcus Bulach  <bulach@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Adds Geolocation param for cancelGeolocationPermissionRequestForFrame.
+        https://bugs.webkit.org/show_bug.cgi?id=35031
+
+        * WebKitSupport/ChromeClientWx.h:
+        (WebCore::ChromeClientWx::cancelGeolocationPermissionRequestForFrame):
+
+2010-03-30  Gavin Barraclough  <barraclough@apple.com>
+
+        Rubber stamped by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36866
+        Move CString to WTF
+
+        * WebFrame.cpp:
+        * WebView.cpp:
+
+2010-03-30  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after method name change.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
+2010-03-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Build fix. Include WindowsKeyboardCodes.h instead of KeyboardCodes.h.
+
+        * WebKitSupport/EditorClientWx.cpp:
+
+2010-03-24  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Make Icon::createIconForFiles() optional.
+        https://bugs.webkit.org/show_bug.cgi?id=35072
+
+        - Rename iconForFiles() to chooseIconForFiles().
+        - Call Icon::createIconForFiles() from chooseIconForFiles().
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::chooseIconForFiles):
+        * WebKitSupport/ChromeClientWx.h:
+
+2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fixes after recent changes, including move of setDatabasesEnabled from Settings.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+        * WebKitSupport/InspectorClientWx.cpp:
+        (WebCore::InspectorClientWx::openInspectorFrontend):
+        * WebSettings.cpp:
+        * WebSettings.h:
+        * WebView.cpp:
+        (wxWebView::Create):
+        (wxWebView::SetDatabasesEnabled):
+        (wxWebView::AreDatabasesEnabled):
+        * WebView.h:
+
+2010-03-16  Yury Semikhatsky <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Introduce InspectorFrontendClient that provides InspectorFrontend with an interface to the embedder. InspectorClient now serves as a delegate for InspectorController and does not contain methods for managing inspector frontend window. That allows to create remote InspectorFrontendHost.
+
+        Introduce InspectorFrontendClient that would provide InspectorFrontend with an interface to the embedder
+        https://bugs.webkit.org/show_bug.cgi?id=35036
+
+        * WebKitSupport/InspectorClientWx.cpp:
+        * WebKitSupport/InspectorClientWx.h:
+
+2010-03-11  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt.
+
+        Remove invalidateContents, it isn't used and it never makes sense to only invalidate the contents.
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        * WebKitSupport/ChromeClientWx.h:
+
+2010-03-02  Adam Treat  <atreat@rim.com>
+
+        Reviewed by Dave Hyatt.
+
+        Adapt the wx port to the refactoring of repaint methods.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34214
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::invalidateContents):
+        (WebCore::ChromeClientWx::invalidateWindow):
+        (WebCore::ChromeClientWx::invalidateContentsForSlowScroll):
+        (WebCore::ChromeClientWx::invalidateContentsAndWindow):
+        * WebKitSupport/ChromeClientWx.h:
+
+2010-03-01  Jakob Petsovits  <jpetsovits@rim.com>
+
+        Reviewed by Adam Barth.
+
+        Adapt to the new ZoomMode enum.
+        https://bugs.webkit.org/show_bug.cgi?id=35347
+
+        * WebFrame.cpp:
+        (wxWebFrame::IncreaseTextSize):
+        (wxWebFrame::DecreaseTextSize):
+        (wxWebFrame::ResetTextSize):
+
+2010-02-23  Steve Block  <steveblock@google.com>
+
+        Reviewed by Darin Adler.
+
+        Adds ChromeClient::cancelGeolocationPermissionRequestForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=34962
+
+        This method is required so that a Geolocation object can cancel an
+        asynchronous permission request. This allows the chrome client to cancel
+        any UI it is showing for the permission request.
+
+        * WebKitSupport/ChromeClientWx.h:
+        (WebCore::ChromeClientWx::cancelGeolocationPermissionRequestForFrame):
+
 2010-02-17  Dmitry Titov  <dimich@chromium.org>
 
         Reviewed by David Levin, Darin Fisher, Simon Hausmann.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index 6cda197..78427e4 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -25,7 +25,6 @@
 
 #include "config.h"
 #include "BackForwardList.h"
-#include "CString.h"
 #include "Document.h"
 #include "Editor.h"
 #include "Element.h"
@@ -50,6 +49,7 @@
 #include "JSDOMBinding.h"
 #include <runtime/JSValue.h>
 #include <runtime/UString.h>
+#include <wtf/text/CString.h>
 
 #include "EditorClientWx.h"
 #include "FrameLoaderClientWx.h"
@@ -201,12 +201,12 @@
         wxASSERT_MSG(hasLoaded, wxT("Document must be loaded before calling RunScript."));
         if (hasLoaded) {
             WebCore::ScriptController* controller = m_impl->frame->script();
-            bool jsEnabled = controller->canExecuteScripts(); 
+            bool jsEnabled = controller->canExecuteScripts(WebCore::AboutToExecuteScript); 
             wxASSERT_MSG(jsEnabled, wxT("RunScript requires JavaScript to be enabled."));
             if (jsEnabled) {
                 JSC::JSValue result = controller->executeScript(javascript, true).jsValue();
                 if (result)
-                    returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).UTF8String().c_str(), wxConvUTF8);        
+                    returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).UTF8String().data(), wxConvUTF8);        
             }
         }
     }
@@ -316,7 +316,7 @@
 {
     if (CanIncreaseTextSize()) {
         m_textMagnifier = m_textMagnifier*TextSizeMultiplierRatio;
-        m_impl->frame->setZoomFactor(m_textMagnifier, true);
+        m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
     }
 }
 
@@ -333,7 +333,7 @@
 {        
     if (CanDecreaseTextSize()) {
         m_textMagnifier = m_textMagnifier/TextSizeMultiplierRatio;
-        m_impl->frame->setZoomFactor(m_textMagnifier, true);
+        m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
     }
 }
 
@@ -341,7 +341,7 @@
 {
     m_textMagnifier = 1.0;
     if (m_impl->frame)
-        m_impl->frame->setZoomFactor(m_textMagnifier, true);
+        m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly);
 }
 
 void wxWebFrame::MakeEditable(bool enable)
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index ac25daf..a19644d 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -35,6 +35,7 @@
 #include "FloatRect.h"
 #include "Frame.h"
 #include "FrameLoadRequest.h"
+#include "Icon.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 #include "WindowFeatures.h"
@@ -336,14 +337,24 @@
     return IntRect();
 }
 
-void ChromeClientWx::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void ChromeClientWx::invalidateWindow(const IntRect& rect, bool immediate)
+{
+    if (immediate)
+        m_webView->Update();
+}
+
+void ChromeClientWx::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
+{
+    invalidateContentsAndWindow(rect, immediate);
+}
+
+void ChromeClientWx::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
 {
     if (!m_webView)
         return;
-    
-    if (contentChanged)
-        m_webView->RefreshRect(rect);
-    
+
+    m_webView->RefreshRect(rect);
+
     if (immediate) {
         m_webView->Update();
     }
@@ -431,9 +442,9 @@
     notImplemented();
 }
 
-void ChromeClientWx::iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>)
+void ChromeClientWx::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
 {
-    notImplemented();
+    chooser->iconLoaded(Icon::createIconForFiles(filenames));
 }
 
 bool ChromeClientWx::setCursor(PlatformCursorHandle)
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h
index 71ae48d..b900f3e 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -102,8 +102,11 @@
     virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
     virtual void updateBackingStore();
     
-    virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+    virtual void invalidateWindow(const IntRect&, bool);
+    virtual void invalidateContentsAndWindow(const IntRect&, bool);
+    virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
     virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
     virtual IntPoint screenToWindow(const IntPoint&) const;
     virtual IntRect windowToScreen(const IntRect&) const;
     virtual PlatformPageClient platformPageClient() const;
@@ -125,7 +128,7 @@
 #endif
 
     virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
-    virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>);
+    virtual void chooseIconForFiles(const Vector<String>&, FileChooser*);
 
     virtual void formStateDidChange(const Node*) { }
 
@@ -136,6 +139,7 @@
     virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
 
     virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+    virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { }
 
 private:
     wxWebView* m_webView;
diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
index b130557..627ebf9 100644
--- a/WebKit/wx/WebKitSupport/EditorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp
@@ -34,17 +34,16 @@
 #include "FrameView.h"
 #include "HostWindow.h"
 #include "KeyboardEvent.h"
-#include "KeyboardCodes.h"
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformString.h"
 #include "SelectionController.h"
-
 #include "WebFrame.h"
 #include "WebFramePrivate.h"
 #include "WebView.h"
 #include "WebViewPrivate.h"
+#include "WindowsKeyboardCodes.h"
 
 #include <stdio.h>
 
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 6afdd88..a163727 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -325,6 +325,11 @@
     }
 }
 
+void FrameLoaderClientWx::dispatchDidChangeIcons()
+{
+    notImplemented();
+}
+
 void FrameLoaderClientWx::dispatchDidFinishLoad()
 {
     notImplemented();
@@ -604,7 +609,7 @@
         return;
     if (!m_pluginView) {
         FrameLoader* fl = loader->frameLoader();
-        fl->setEncoding(m_response.textEncodingName(), false);
+        fl->writer()->setEncoding(m_response.textEncodingName(), false);
         fl->addData(data, length);
     }
     
@@ -733,11 +738,6 @@
     return false;
 }
 
-void FrameLoaderClientWx::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&)
-{
-  notImplemented();
-}
-
 void FrameLoaderClientWx::dispatchDidFailProvisionalLoad(const ResourceError&)
 {
     notImplemented();
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 62218ff..e9f566b 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -108,6 +108,7 @@
         virtual void dispatchDidFinishLoad();
         virtual void dispatchDidFirstLayout();
         virtual void dispatchDidFirstVisuallyNonEmptyLayout();
+        virtual void dispatchDidChangeIcons();
 
         virtual void dispatchShow();
         virtual void cancelPolicyCheck();
@@ -184,7 +185,6 @@
         virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long);
         virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&);
         virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int);
-        virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&);
 
         virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
         virtual void dispatchDidFailLoad(const ResourceError&);
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
index ff21ae0..5dc9ac7 100644
--- a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
@@ -47,45 +47,7 @@
     notImplemented();
 }
 
-Page* InspectorClientWx::createPage()
-{
-    notImplemented();
-    return 0;
-}
-
-String InspectorClientWx::localizedStringsURL()
-{
-    notImplemented();
-    return String();
-}
-
-String InspectorClientWx::hiddenPanels()
-{
-    notImplemented();
-    return String();
-}
-
-void InspectorClientWx::showWindow()
-{
-    notImplemented();
-}
-    
-void InspectorClientWx::closeWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientWx::attachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientWx::detachWindow()
-{
-    notImplemented();
-}
-
-void InspectorClientWx::setAttachedWindowHeight(unsigned height)
+void InspectorClientWx::openInspectorFrontend(WebCore::InspectorController*)
 {
     notImplemented();
 }
@@ -100,11 +62,6 @@
     notImplemented();
 }
 
-void InspectorClientWx::inspectedURLChanged(const String& newURL)
-{
-    notImplemented();
-}
-
 void InspectorClientWx::populateSetting(const String& key, String* setting)
 {
     notImplemented();
@@ -115,9 +72,4 @@
     notImplemented();
 }
 
-void InspectorClientWx::inspectorWindowObjectCleared()
-{
-    notImplemented();
-}
-
 };
diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.h b/WebKit/wx/WebKitSupport/InspectorClientWx.h
index f905817..7675dc1 100644
--- a/WebKit/wx/WebKitSupport/InspectorClientWx.h
+++ b/WebKit/wx/WebKitSupport/InspectorClientWx.h
@@ -41,29 +41,13 @@
 
     virtual void inspectorDestroyed();
 
-    virtual Page* createPage();
-
-    virtual String localizedStringsURL();
-
-    virtual String hiddenPanels();
-
-    virtual void showWindow();
-    virtual void closeWindow();
-
-    virtual void attachWindow();
-    virtual void detachWindow();
-
-    virtual void setAttachedWindowHeight(unsigned height);
+    virtual void openInspectorFrontend(WebCore::InspectorController*);
 
     virtual void highlight(Node*);
     virtual void hideHighlight();
 
-    virtual void inspectedURLChanged(const String& newURL);
-
     virtual void populateSetting(const String& key, String* value);
     virtual void storeSetting(const String& key, const String& value);
-
-    virtual void inspectorWindowObjectCleared();
 };
 
 } // namespace WebCore
diff --git a/WebKit/wx/WebSettings.cpp b/WebKit/wx/WebSettings.cpp
index 2aa246c..9317546 100644
--- a/WebKit/wx/WebSettings.cpp
+++ b/WebKit/wx/WebSettings.cpp
@@ -102,20 +102,6 @@
     return false;
 }
     
-void wxWebSettings::SetDatabasesEnabled(bool enabled)
-{
-    if (m_settings)
-        m_settings->setDatabasesEnabled(enabled);
-}
-    
-bool wxWebSettings::AreDatabasesEnabled() const
-{
-    if (m_settings)
-        return m_settings->databasesEnabled();
-        
-    return false;
-}
-    
 void wxWebSettings::SetLocalStoragePath(const wxString& path)
 {
     if (m_settings)
diff --git a/WebKit/wx/WebSettings.h b/WebKit/wx/WebSettings.h
index e526b70..148755a 100644
--- a/WebKit/wx/WebSettings.h
+++ b/WebKit/wx/WebSettings.h
@@ -119,16 +119,6 @@
     bool IsJavaScriptEnabled() const;
     
     /**
-        Sets whether or not web pages can create databases.
-    */
-    void SetDatabasesEnabled(bool enabled);
-    
-    /**
-        Returns whether or not the WebView runs JavaScript code.
-    */    
-    bool AreDatabasesEnabled() const;
-    
-    /**
         Sets the path where local data will be stored.
     */
     void SetLocalStoragePath(const wxString& path);
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index c448bbf..95730b9 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -28,7 +28,6 @@
 #include "ContextMenu.h"
 #include "ContextMenuItem.h"
 #include "ContextMenuController.h"
-#include "CString.h"
 #include "Document.h"
 #include "Element.h"
 #include "Editor.h"
@@ -69,8 +68,10 @@
 #include "JSDOMBinding.h"
 #include <runtime/JSValue.h>
 #include <runtime/UString.h>
+#include <wtf/text/CString.h>
 
 #if ENABLE(DATABASE)
+#include "Database.h"
 #include "DatabaseTracker.h"
 #endif
 
@@ -336,7 +337,7 @@
     settings->setJavaScriptEnabled(true);
 
 #if ENABLE(DATABASE)
-    settings->setDatabasesEnabled(true);
+    SetDatabasesEnabled(true);
 #endif
 
     m_isInitialized = true;
@@ -938,6 +939,23 @@
 #endif
 }
 
+/* static */
+void wxWebView::SetDatabasesEnabled(bool enabled)
+{
+#if ENABLE(DATABASE)
+    WebCore::Database::setIsAvailable(enabled);
+#endif
+}
+
+/* static */
+bool wxWebView::AreDatabasesEnabled()
+{
+#if ENABLE(DATABASE)
+    return WebCore::Database::isAvailable();
+#endif
+    return false;
+}
+
 static WebCore::ResourceHandleManager::ProxyType curlProxyType(wxProxyType type)
 {
     switch (type) {
diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h
index 9a6546c..f7b41dc 100644
--- a/WebKit/wx/WebView.h
+++ b/WebKit/wx/WebView.h
@@ -195,6 +195,16 @@
 
     static void SetDatabaseDirectory(const wxString& databaseDirectory);
     static wxString GetDatabaseDirectory();
+    
+    /**
+        Sets whether or not web pages can create databases.
+    */
+    static void SetDatabasesEnabled(bool enabled);
+    
+    /**
+        Returns whether or not the WebView runs JavaScript code.
+    */    
+    static bool AreDatabasesEnabled();
 
     static void SetProxyInfo(const wxString& host = wxEmptyString,
                              unsigned long port = 0,
diff --git a/WebKitExamplePlugins/ChangeLog b/WebKitExamplePlugins/ChangeLog
index 5421249..6133243 100644
--- a/WebKitExamplePlugins/ChangeLog
+++ b/WebKitExamplePlugins/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Kevin Decker.
+
+        NPWindow is now null in the Cocoa event model.
+
+        * NetscapeInputMethodPlugin/main.m:
+        (handleDraw):
+        (NPP_HandleEvent):
+
 2009-07-10  Adam Roben  <aroben@apple.com>
 
         Sort all our Xcode projects
diff --git a/WebKitExamplePlugins/NetscapeInputMethodPlugin/main.m b/WebKitExamplePlugins/NetscapeInputMethodPlugin/main.m
index ce5df45..0adc21b 100644
--- a/WebKitExamplePlugins/NetscapeInputMethodPlugin/main.m
+++ b/WebKitExamplePlugins/NetscapeInputMethodPlugin/main.m
@@ -207,11 +207,11 @@
 
 }
 
-static void handleDraw(PluginObject* obj)
+static void handleDraw(PluginObject* obj, NPCocoaEvent *event)
 {
     NSGraphicsContext *oldContext = [[NSGraphicsContext currentContext] retain];
     
-    NSGraphicsContext *context = [NSGraphicsContext graphicsContextWithGraphicsPort:((NP_CGContext*)obj->window.window)->context
+    NSGraphicsContext *context = [NSGraphicsContext graphicsContextWithGraphicsPort:event->data.draw.context
                                                                             flipped:YES];
 
 
@@ -356,7 +356,7 @@
     
     switch (cocoaEvent->type) {
         case NPCocoaEventDrawRect:
-            handleDraw(obj);
+            handleDraw(obj, cocoaEvent);
             return 1;
         case NPCocoaEventFocusChanged:
             handleFocusChanged(cocoaEvent, obj);
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 0bc9e66..ce443c0 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,137 @@
+2010-04-09  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24572
+        XMLHttpRequest.statusText returns always "OK" on Mac
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
+2010-04-07  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Steve Falkenburg.
+
+        Remove QuartzCoreInterface from the build
+        
+        No longer needed since QuartzCore.dll is now included in  the latest Safari release (4.0.5).
+
+        * win/bin/QuartzCoreInterface.dll: Removed.
+        * win/include/QuartzCoreInterface: Removed.
+        * win/include/QuartzCoreInterface/QuartzCoreInterface.h: Removed.
+        * win/lib/QuartzCoreInterface.lib: Removed.
+
+2010-04-02  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Eric Carlson.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=36624
+
+        Update WebKitSystemInterface
+
+        * WebKitSystemInterface.h: add WKQTMovieSelectPreferredAlternates.
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Adds ENABLE_FILE_READER and ENABLE_FILE_WRITER feature flags
+        for FileReader and FileWriter support.
+
+        * win/tools/vsprops/FeatureDefines.vsprops:
+        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2010-03-25  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Dan Bernstein.
+
+        Update WebCoreSQLite3 to SQLite v3.6.12.
+
+        * WebCoreSQLite3/sqlite3.h:
+        * WebCoreSQLite3/sqlite3ext.h:
+        * libWebCoreSQLite3.a:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
+2010-03-23  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        WebKitSystemInterface part of
+        <rdar://problem/7197736> Plug-in clip rect does not update when overflow
+        clip changes
+        https://bugs.webkit.org/show_bug.cgi?id=36479.
+
+        * WebKitSystemInterface.h: Added WKSyncSurfaceToView().
+        * libWebKitSystemInterfaceSnowLeopard.a: Updated
+
+2010-03-16  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fix incorrect glyph advances when using the Core Graphics (non-GDI) glyph look.
+
+        * win/lib/WebKitSystemInterface.lib:
+        * win/lib/WebKitSystemInterface_debug.lib:
+
+2010-03-15  Andy Estes  <aestes@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Added two new output arguments to WKGetWheelEventDeltas() to return
+        the number of scroll wheel ticks in the x and y directions.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29601.
+        <rdar://problem/7453254>
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
+2010-03-14  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKitSystemInterface part of removing support for legacy versions of Core Graphics
+
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h: Removed
+        wkCanCreateCGFontWithLOGFONT(), wkSetFontPlatformInfo(), wkAddFontsInDirectory(),
+        wkAddFontsAtPath(), wkAddFontsFromRegistry(), wkAddFontsFromPlist(), and
+        wkCreateFontsPlist().
+        * win/lib/WebKitSystemInterface.lib: Updated.
+        * win/lib/WebKitSystemInterface_debug.lib: Updated.
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+
+        Add ENABLE_BLOB_SLICE feature define.
+
+        * win/tools/vsprops/FeatureDefines.vsprops:
+        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        * win/tools/vsprops/FeatureDefines.vsprops:
+
 2010-02-18  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebKitLibraries/WebCoreSQLite3/sqlite3.h b/WebKitLibraries/WebCoreSQLite3/sqlite3.h
index 21a21b5..c66f608 100644
--- a/WebKitLibraries/WebCoreSQLite3/sqlite3.h
+++ b/WebKitLibraries/WebCoreSQLite3/sqlite3.h
@@ -17,7 +17,7 @@
 **
 ** Some of the definitions that are in this file are marked as
 ** "experimental".  Experimental interfaces are normally new
-** features recently added to SQLite.  We do not anticipate changes 
+** features recently added to SQLite.  We do not anticipate changes
 ** to experimental interfaces but reserve to make minor changes if
 ** experience from use "in the wild" suggest such changes are prudent.
 **
@@ -30,7 +30,7 @@
 ** the version number) and changes its name to "sqlite3.h" as
 ** part of the build process.
 **
-** @(#) $Id: sqlite.h.in,v 1.212 2007/06/14 20:57:19 drh Exp $
+** @(#) $Id: sqlite.h.in,v 1.436 2009/03/20 13:15:30 drh Exp $
 */
 #ifndef _SQLITE3_H_
 #define _SQLITE3_H_
@@ -43,9 +43,32 @@
 extern "C" {
 #endif
 
+
 /*
-** Make sure these symbols where not defined by some previous header
-** file.
+** Add the ability to override 'extern'
+*/
+#ifndef SQLITE_EXTERN
+# define SQLITE_EXTERN extern
+#endif
+
+/*
+** These no-op macros are used in front of interfaces to mark those
+** interfaces as either deprecated or experimental.  New applications
+** should not use deprecated intrfaces - they are support for backwards
+** compatibility only.  Application writers should be aware that
+** experimental interfaces are subject to change in point releases.
+**
+** These macros used to resolve to various kinds of compiler magic that
+** would generate warning messages when they were used.  But that
+** compiler magic ended up generating such a flurry of bug reports
+** that we have taken it all out and gone back to using simple
+** noop macros.
+*/
+#define SQLITE_DEPRECATED
+#define SQLITE_EXPERIMENTAL
+
+/*
+** Ensure these symbols were not defined by some previous header file.
 */
 #ifdef SQLITE_VERSION
 # undef SQLITE_VERSION
@@ -55,77 +78,113 @@
 #endif
 
 /*
-** CAPI3REF: Compile-Time Library Version Numbers
+** CAPI3REF: Compile-Time Library Version Numbers {H10010} <S60100>
 **
-** The version of the SQLite library is contained in the sqlite3.h
-** header file in a #define named SQLITE_VERSION.  The SQLITE_VERSION
-** macro resolves to a string constant.
+** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in
+** the sqlite3.h file specify the version of SQLite with which
+** that header file is associated.
 **
-** The format of the version string is "X.Y.Z", where
-** X is the major version number, Y is the minor version number and Z
-** is the release number.  The X.Y.Z might be followed by "alpha" or "beta".
-** For example "3.1.1beta".
-**
-** The X value is always 3 in SQLite.  The X value only changes when
-** backwards compatibility is broken and we intend to never break
-** backwards compatibility.  The Y value only changes when
+** The "version" of SQLite is a string of the form "X.Y.Z".
+** The phrase "alpha" or "beta" might be appended after the Z.
+** The X value is major version number always 3 in SQLite3.
+** The X value only changes when backwards compatibility is
+** broken and we intend to never break backwards compatibility.
+** The Y value is the minor version number and only changes when
 ** there are major feature enhancements that are forwards compatible
-** but not backwards compatible.  The Z value is incremented with
-** each release but resets back to 0 when Y is incremented.
-**
-** The SQLITE_VERSION_NUMBER is an integer with the value 
-** (X*1000000 + Y*1000 + Z). For example, for version "3.1.1beta", 
-** SQLITE_VERSION_NUMBER is set to 3001001. To detect if they are using 
-** version 3.1.1 or greater at compile time, programs may use the test 
-** (SQLITE_VERSION_NUMBER>=3001001).
+** but not backwards compatible.
+** The Z value is the release number and is incremented with
+** each release but resets back to 0 whenever Y is incremented.
 **
 ** See also: [sqlite3_libversion()] and [sqlite3_libversion_number()].
+**
+** Requirements: [H10011] [H10014]
 */
-#define SQLITE_VERSION         "3.4.0"
-#define SQLITE_VERSION_NUMBER 3004000
+#define SQLITE_VERSION         "3.6.12"
+#define SQLITE_VERSION_NUMBER  3006012
 
 /*
-** CAPI3REF: Run-Time Library Version Numbers
+** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
+** KEYWORDS: sqlite3_version
 **
-** These routines return values equivalent to the header constants
-** [SQLITE_VERSION] and [SQLITE_VERSION_NUMBER].  The values returned
-** by this routines should only be different from the header values
-** if you compile your program using an sqlite3.h header from a
-** different version of SQLite that the version of the library you
-** link against.
+** These features provide the same information as the [SQLITE_VERSION]
+** and [SQLITE_VERSION_NUMBER] #defines in the header, but are associated
+** with the library instead of the header file.  Cautious programmers might
+** include a check in their application to verify that
+** sqlite3_libversion_number() always returns the value
+** [SQLITE_VERSION_NUMBER].
 **
-** The sqlite3_version[] string constant contains the text of the
-** [SQLITE_VERSION] string.  The sqlite3_libversion() function returns
-** a poiner to the sqlite3_version[] string constant.  The function
-** is provided for DLL users who can only access functions and not
+** The sqlite3_libversion() function returns the same information as is
+** in the sqlite3_version[] string constant.  The function is provided
+** for use in DLLs since DLL users usually do not have direct access to string
 ** constants within the DLL.
+**
+** Requirements: [H10021] [H10022] [H10023]
 */
-extern const char sqlite3_version[];
+SQLITE_EXTERN const char sqlite3_version[];
 const char *sqlite3_libversion(void);
 int sqlite3_libversion_number(void);
 
 /*
-** CAPI3REF: Database Connection Handle
+** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} <S60100>
 **
-** Each open SQLite database is represented by pointer to an instance of the
-** opaque structure named "sqlite3".  It is useful to think of an sqlite3
-** pointer as an object.  The [sqlite3_open] interface is its constructor
-** and [sqlite3_close] is its destructor.  There are many other interfaces
-** (such as [sqlite3_prepare_v2], [sqlite3_create_function], and
-** [sqlite3_busy_timeout] to name but three) that are methods on this
-** object.
+** SQLite can be compiled with or without mutexes.  When
+** the [SQLITE_THREADSAFE] C preprocessor macro 1 or 2, mutexes
+** are enabled and SQLite is threadsafe.  When the
+** [SQLITE_THREADSAFE] macro is 0, 
+** the mutexes are omitted.  Without the mutexes, it is not safe
+** to use SQLite concurrently from more than one thread.
+**
+** Enabling mutexes incurs a measurable performance penalty.
+** So if speed is of utmost importance, it makes sense to disable
+** the mutexes.  But for maximum safety, mutexes should be enabled.
+** The default behavior is for mutexes to be enabled.
+**
+** This interface can be used by a program to make sure that the
+** version of SQLite that it is linking against was compiled with
+** the desired setting of the [SQLITE_THREADSAFE] macro.
+**
+** This interface only reports on the compile-time mutex setting
+** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
+** SQLITE_THREADSAFE=1 then mutexes are enabled by default but
+** can be fully or partially disabled using a call to [sqlite3_config()]
+** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
+** or [SQLITE_CONFIG_MUTEX].  The return value of this function shows
+** only the default compile-time setting, not any run-time changes
+** to that setting.
+**
+** See the [threading mode] documentation for additional information.
+**
+** Requirements: [H10101] [H10102]
+*/
+int sqlite3_threadsafe(void);
+
+/*
+** CAPI3REF: Database Connection Handle {H12000} <S40200>
+** KEYWORDS: {database connection} {database connections}
+**
+** Each open SQLite database is represented by a pointer to an instance of
+** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
+** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
+** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
+** is its destructor.  There are many other interfaces (such as
+** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
+** [sqlite3_busy_timeout()] to name but three) that are methods on an
+** sqlite3 object.
 */
 typedef struct sqlite3 sqlite3;
 
-
 /*
-** CAPI3REF: 64-Bit Integer Types
+** CAPI3REF: 64-Bit Integer Types {H10200} <S10110>
+** KEYWORDS: sqlite_int64 sqlite_uint64
 **
-** Some compilers do not support the "long long" datatype.  So we have
-** to do compiler-specific typedefs for 64-bit signed and unsigned integers.
+** Because there is no cross-platform way to specify 64-bit integer types
+** SQLite includes typedefs for 64-bit signed and unsigned integers.
 **
-** Many SQLite interface functions require a 64-bit integer arguments.
-** Those interfaces are declared using this typedef.
+** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
+** The sqlite_int64 and sqlite_uint64 types are supported for backwards
+** compatibility only.
+**
+** Requirements: [H10201] [H10202]
 */
 #ifdef SQLITE_INT64_TYPE
   typedef SQLITE_INT64_TYPE sqlite_int64;
@@ -137,26 +196,46 @@
   typedef long long int sqlite_int64;
   typedef unsigned long long int sqlite_uint64;
 #endif
+typedef sqlite_int64 sqlite3_int64;
+typedef sqlite_uint64 sqlite3_uint64;
 
 /*
 ** If compiling for a processor that lacks floating point support,
-** substitute integer for floating-point
+** substitute integer for floating-point.
 */
 #ifdef SQLITE_OMIT_FLOATING_POINT
-# define double sqlite_int64
+# define double sqlite3_int64
 #endif
 
 /*
-** CAPI3REF: Closing A Database Connection
+** CAPI3REF: Closing A Database Connection {H12010} <S30100><S40200>
 **
-** Call this function with a pointer to a structure that was previously
-** returned from [sqlite3_open()] and the corresponding database will by
-** closed.
+** This routine is the destructor for the [sqlite3] object.
 **
-** All SQL statements prepared using [sqlite3_prepare_v2()] or
-** [sqlite3_prepare16_v2()] must be destroyed using [sqlite3_finalize()]
-** before this routine is called. Otherwise, SQLITE_BUSY is returned and the
-** database connection remains open.
+** Applications should [sqlite3_finalize | finalize] all [prepared statements]
+** and [sqlite3_blob_close | close] all [BLOB handles] associated with
+** the [sqlite3] object prior to attempting to close the object.
+** The [sqlite3_next_stmt()] interface can be used to locate all
+** [prepared statements] associated with a [database connection] if desired.
+** Typical code might look like this:
+**
+** <blockquote><pre>
+** sqlite3_stmt *pStmt;
+** while( (pStmt = sqlite3_next_stmt(db, 0))!=0 ){
+** &nbsp;   sqlite3_finalize(pStmt);
+** }
+** </pre></blockquote>
+**
+** If [sqlite3_close()] is invoked while a transaction is open,
+** the transaction is automatically rolled back.
+**
+** The C parameter to [sqlite3_close(C)] must be either a NULL
+** pointer or an [sqlite3] object pointer obtained
+** from [sqlite3_open()], [sqlite3_open16()], or
+** [sqlite3_open_v2()], and not previously closed.
+**
+** Requirements:
+** [H12011] [H12012] [H12013] [H12014] [H12015] [H12019]
 */
 int sqlite3_close(sqlite3 *);
 
@@ -168,76 +247,73 @@
 typedef int (*sqlite3_callback)(void*,int,char**, char**);
 
 /*
-** CAPI3REF: One-Step Query Execution Interface
+** CAPI3REF: One-Step Query Execution Interface {H12100} <S10000>
 **
-** This interface is used to do a one-time evaluatation of zero
-** or more SQL statements.  UTF-8 text of the SQL statements to
-** be evaluted is passed in as the second parameter.  The statements
-** are prepared one by one using [sqlite3_prepare()], evaluated
-** using [sqlite3_step()], then destroyed using [sqlite3_finalize()].
+** The sqlite3_exec() interface is a convenient way of running one or more
+** SQL statements without having to write a lot of C code.  The UTF-8 encoded
+** SQL statements are passed in as the second parameter to sqlite3_exec().
+** The statements are evaluated one by one until either an error or
+** an interrupt is encountered, or until they are all done.  The 3rd parameter
+** is an optional callback that is invoked once for each row of any query
+** results produced by the SQL statements.  The 5th parameter tells where
+** to write any error messages.
 **
-** If one or more of the SQL statements are queries, then
-** the callback function specified by the 3rd parameter is
-** invoked once for each row of the query result.  This callback
-** should normally return 0.  If the callback returns a non-zero
-** value then the query is aborted, all subsequent SQL statements
-** are skipped and the sqlite3_exec() function returns the SQLITE_ABORT.
+** The error message passed back through the 5th parameter is held
+** in memory obtained from [sqlite3_malloc()].  To avoid a memory leak,
+** the calling application should call [sqlite3_free()] on any error
+** message returned through the 5th parameter when it has finished using
+** the error message.
 **
-** The 4th parameter to this interface is an arbitrary pointer that is
-** passed through to the callback function as its first parameter.
+** If the SQL statement in the 2nd parameter is NULL or an empty string
+** or a string containing only whitespace and comments, then no SQL
+** statements are evaluated and the database is not changed.
 **
-** The 2nd parameter to the callback function is the number of
-** columns in the query result.  The 3rd parameter to the callback
-** is an array of strings holding the values for each column
-** as extracted using [sqlite3_column_text()].
-** The 4th parameter to the callback is an array of strings
-** obtained using [sqlite3_column_name()] and holding
-** the names of each column.
+** The sqlite3_exec() interface is implemented in terms of
+** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()].
+** The sqlite3_exec() routine does nothing to the database that cannot be done
+** by [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()].
 **
-** The callback function may be NULL, even for queries.  A NULL
-** callback is not an error.  It just means that no callback
-** will be invoked.
+** The first parameter to [sqlite3_exec()] must be an valid and open
+** [database connection].
 **
-** If an error occurs while parsing or evaluating the SQL (but
-** not while executing the callback) then an appropriate error
-** message is written into memory obtained from [sqlite3_malloc()] and
-** *errmsg is made to point to that message.  The calling function
-** is responsible for freeing the memory that holds the error
-** message.   Use [sqlite3_free()] for this.  If errmsg==NULL,
-** then no error message is ever written.
+** The database connection must not be closed while
+** [sqlite3_exec()] is running.
 **
-** The return value is is SQLITE_OK if there are no errors and
-** some other [SQLITE_OK | return code] if there is an error.  
-** The particular return value depends on the type of error. 
+** The calling function should use [sqlite3_free()] to free
+** the memory that *errmsg is left pointing at once the error
+** message is no longer needed.
 **
+** The SQL statement text in the 2nd parameter to [sqlite3_exec()]
+** must remain unchanged while [sqlite3_exec()] is running.
+**
+** Requirements:
+** [H12101] [H12102] [H12104] [H12105] [H12107] [H12110] [H12113] [H12116]
+** [H12119] [H12122] [H12125] [H12131] [H12134] [H12137] [H12138]
 */
 int sqlite3_exec(
   sqlite3*,                                  /* An open database */
-  const char *sql,                           /* SQL to be evaluted */
+  const char *sql,                           /* SQL to be evaluated */
   int (*callback)(void*,int,char**,char**),  /* Callback function */
   void *,                                    /* 1st argument to callback */
   char **errmsg                              /* Error msg written here */
 );
 
 /*
-** CAPI3REF: Result Codes
-** KEYWORDS: SQLITE_OK
+** CAPI3REF: Result Codes {H10210} <S10700>
+** KEYWORDS: SQLITE_OK {error code} {error codes}
+** KEYWORDS: {result code} {result codes}
 **
 ** Many SQLite functions return an integer result code from the set shown
-** above in order to indicates success or failure.
+** here in order to indicates success or failure.
 **
-** The result codes above are the only ones returned by SQLite in its
-** default configuration.  However, the [sqlite3_extended_result_codes()]
-** API can be used to set a database connectoin to return more detailed
-** result codes.
+** New error codes may be added in future versions of SQLite.
 **
 ** See also: [SQLITE_IOERR_READ | extended result codes]
-**
 */
 #define SQLITE_OK           0   /* Successful result */
 /* beginning-of-error-codes */
 #define SQLITE_ERROR        1   /* SQL error or missing database */
-#define SQLITE_INTERNAL     2   /* NOT USED. Internal logic error in SQLite */
+#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
 #define SQLITE_PERM         3   /* Access permission denied */
 #define SQLITE_ABORT        4   /* Callback routine requested an abort */
 #define SQLITE_BUSY         5   /* The database file is locked */
@@ -254,7 +330,7 @@
 #define SQLITE_EMPTY       16   /* Database is empty */
 #define SQLITE_SCHEMA      17   /* The database schema changed */
 #define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
-#define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
+#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
 #define SQLITE_MISMATCH    20   /* Data type mismatch */
 #define SQLITE_MISUSE      21   /* Library used incorrectly */
 #define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
@@ -267,202 +343,1051 @@
 /* end-of-error-codes */
 
 /*
-** CAPI3REF: Extended Result Codes
+** CAPI3REF: Extended Result Codes {H10220} <S10700>
+** KEYWORDS: {extended error code} {extended error codes}
+** KEYWORDS: {extended result code} {extended result codes}
 **
 ** In its default configuration, SQLite API routines return one of 26 integer
-** result codes described at result-codes.  However, experience has shown that
-** many of these result codes are too course-grained.  They do not provide as
-** much information about problems as users might like.  In an effort to
+** [SQLITE_OK | result codes].  However, experience has shown that many of
+** these result codes are too coarse-grained.  They do not provide as
+** much information about problems as programmers might like.  In an effort to
 ** address this, newer versions of SQLite (version 3.3.8 and later) include
 ** support for additional result codes that provide more detailed information
-** about errors.  The extended result codes are enabled (or disabled) for 
-** each database
-** connection using the [sqlite3_extended_result_codes()] API.
-** 
-** Some of the available extended result codes are listed above.
-** We expect the number of extended result codes will be expand
+** about errors. The extended result codes are enabled or disabled
+** on a per database connection basis using the
+** [sqlite3_extended_result_codes()] API.
+**
+** Some of the available extended result codes are listed here.
+** One may expect the number of extended result codes will be expand
 ** over time.  Software that uses extended result codes should expect
 ** to see new result codes in future releases of SQLite.
-** 
-** The symbolic name for an extended result code always contains a related
-** primary result code as a prefix.  Primary result codes contain a single
-** "_" character.  Extended result codes contain two or more "_" characters.
-** The numeric value of an extended result code can be converted to its
-** corresponding primary result code by masking off the lower 8 bytes.
 **
 ** The SQLITE_OK result code will never be extended.  It will always
 ** be exactly zero.
 */
-#define SQLITE_IOERR_READ          (SQLITE_IOERR | (1<<8))
-#define SQLITE_IOERR_SHORT_READ    (SQLITE_IOERR | (2<<8))
-#define SQLITE_IOERR_WRITE         (SQLITE_IOERR | (3<<8))
-#define SQLITE_IOERR_FSYNC         (SQLITE_IOERR | (4<<8))
-#define SQLITE_IOERR_DIR_FSYNC     (SQLITE_IOERR | (5<<8))
-#define SQLITE_IOERR_TRUNCATE      (SQLITE_IOERR | (6<<8))
-#define SQLITE_IOERR_FSTAT         (SQLITE_IOERR | (7<<8))
-#define SQLITE_IOERR_UNLOCK        (SQLITE_IOERR | (8<<8))
-#define SQLITE_IOERR_RDLOCK        (SQLITE_IOERR | (9<<8))
-#define SQLITE_IOERR_DELETE        (SQLITE_IOERR | (10<<8))
-#define SQLITE_IOERR_BLOCKED       (SQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
+#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
+#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
+#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
+#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
+#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
+
+#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED | (1<<8) )
 
 /*
-** CAPI3REF: Enable Or Disable Extended Result Codes
+** CAPI3REF: Flags For File Open Operations {H10230} <H11120> <H12700>
 **
-** This routine enables or disables the
-** [SQLITE_IOERR_READ | extended result codes] feature.
-** By default, SQLite API routines return one of only 26 integer
-** [SQLITE_OK | result codes].  When extended result codes
-** are enabled by this routine, the repetoire of result codes can be
-** much larger and can (hopefully) provide more detailed information
-** about the cause of an error.
+** These bit values are intended for use in the
+** 3rd parameter to the [sqlite3_open_v2()] interface and
+** in the 4th parameter to the xOpen method of the
+** [sqlite3_vfs] object.
+*/
+#define SQLITE_OPEN_READONLY         0x00000001
+#define SQLITE_OPEN_READWRITE        0x00000002
+#define SQLITE_OPEN_CREATE           0x00000004
+#define SQLITE_OPEN_DELETEONCLOSE    0x00000008
+#define SQLITE_OPEN_EXCLUSIVE        0x00000010
+#define SQLITE_OPEN_AUTOPROXY        0x00000020
+#define SQLITE_OPEN_MAIN_DB          0x00000100
+#define SQLITE_OPEN_TEMP_DB          0x00000200
+#define SQLITE_OPEN_TRANSIENT_DB     0x00000400
+#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800
+#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000
+#define SQLITE_OPEN_SUBJOURNAL       0x00002000
+#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000
+#define SQLITE_OPEN_NOMUTEX          0x00008000
+#define SQLITE_OPEN_FULLMUTEX        0x00010000
+
+/*
+** CAPI3REF: Device Characteristics {H10240} <H11120>
 **
-** The second argument is a boolean value that turns extended result
-** codes on and off.  Extended result codes are off by default for
-** backwards compatibility with older versions of SQLite.
+** The xDeviceCapabilities method of the [sqlite3_io_methods]
+** object returns an integer which is a vector of the these
+** bit values expressing I/O characteristics of the mass storage
+** device that holds the file that the [sqlite3_io_methods]
+** refers to.
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().
+*/
+#define SQLITE_IOCAP_ATOMIC          0x00000001
+#define SQLITE_IOCAP_ATOMIC512       0x00000002
+#define SQLITE_IOCAP_ATOMIC1K        0x00000004
+#define SQLITE_IOCAP_ATOMIC2K        0x00000008
+#define SQLITE_IOCAP_ATOMIC4K        0x00000010
+#define SQLITE_IOCAP_ATOMIC8K        0x00000020
+#define SQLITE_IOCAP_ATOMIC16K       0x00000040
+#define SQLITE_IOCAP_ATOMIC32K       0x00000080
+#define SQLITE_IOCAP_ATOMIC64K       0x00000100
+#define SQLITE_IOCAP_SAFE_APPEND     0x00000200
+#define SQLITE_IOCAP_SEQUENTIAL      0x00000400
+
+/*
+** CAPI3REF: File Locking Levels {H10250} <H11120> <H11310>
+**
+** SQLite uses one of these integer values as the second
+** argument to calls it makes to the xLock() and xUnlock() methods
+** of an [sqlite3_io_methods] object.
+*/
+#define SQLITE_LOCK_NONE          0
+#define SQLITE_LOCK_SHARED        1
+#define SQLITE_LOCK_RESERVED      2
+#define SQLITE_LOCK_PENDING       3
+#define SQLITE_LOCK_EXCLUSIVE     4
+
+/*
+** CAPI3REF: Synchronization Type Flags {H10260} <H11120>
+**
+** When SQLite invokes the xSync() method of an
+** [sqlite3_io_methods] object it uses a combination of
+** these integer values as the second argument.
+**
+** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
+** sync operation only needs to flush data to mass storage.  Inode
+** information need not be flushed. The SQLITE_SYNC_NORMAL flag means
+** to use normal fsync() semantics. The SQLITE_SYNC_FULL flag means
+** to use Mac OS X style fullsync instead of fsync().
+*/
+#define SQLITE_SYNC_NORMAL        0x00002
+#define SQLITE_SYNC_FULL          0x00003
+#define SQLITE_SYNC_DATAONLY      0x00010
+
+/*
+** CAPI3REF: OS Interface Open File Handle {H11110} <S20110>
+**
+** An [sqlite3_file] object represents an open file in the OS
+** interface layer.  Individual OS interface implementations will
+** want to subclass this object by appending additional fields
+** for their own use.  The pMethods entry is a pointer to an
+** [sqlite3_io_methods] object that defines methods for performing
+** I/O operations on the open file.
+*/
+typedef struct sqlite3_file sqlite3_file;
+struct sqlite3_file {
+  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
+};
+
+/*
+** CAPI3REF: OS Interface File Virtual Methods Object {H11120} <S20110>
+**
+** Every file opened by the [sqlite3_vfs] xOpen method populates an
+** [sqlite3_file] object (or, more commonly, a subclass of the
+** [sqlite3_file] object) with a pointer to an instance of this object.
+** This object defines the methods used to perform various operations
+** against the open file represented by the [sqlite3_file] object.
+**
+** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
+** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
+** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
+** flag may be ORed in to indicate that only the data of the file
+** and not its inode needs to be synced.
+**
+** The integer values to xLock() and xUnlock() are one of
+** <ul>
+** <li> [SQLITE_LOCK_NONE],
+** <li> [SQLITE_LOCK_SHARED],
+** <li> [SQLITE_LOCK_RESERVED],
+** <li> [SQLITE_LOCK_PENDING], or
+** <li> [SQLITE_LOCK_EXCLUSIVE].
+** </ul>
+** xLock() increases the lock. xUnlock() decreases the lock.
+** The xCheckReservedLock() method checks whether any database connection,
+** either in this process or in some other process, is holding a RESERVED,
+** PENDING, or EXCLUSIVE lock on the file.  It returns true
+** if such a lock exists and false otherwise.
+**
+** The xFileControl() method is a generic interface that allows custom
+** VFS implementations to directly control an open file using the
+** [sqlite3_file_control()] interface.  The second "op" argument is an
+** integer opcode.  The third argument is a generic pointer intended to
+** point to a structure that may contain arguments or space in which to
+** write return values.  Potential uses for xFileControl() might be
+** functions to enable blocking locks with timeouts, to change the
+** locking strategy (for example to use dot-file locks), to inquire
+** about the status of a lock, or to break stale locks.  The SQLite
+** core reserves all opcodes less than 100 for its own use.
+** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.
+** Applications that define a custom xFileControl method should use opcodes
+** greater than 100 to avoid conflicts.
+**
+** The xSectorSize() method returns the sector size of the
+** device that underlies the file.  The sector size is the
+** minimum write that can be performed without disturbing
+** other bytes in the file.  The xDeviceCharacteristics()
+** method returns a bit vector describing behaviors of the
+** underlying device:
+**
+** <ul>
+** <li> [SQLITE_IOCAP_ATOMIC]
+** <li> [SQLITE_IOCAP_ATOMIC512]
+** <li> [SQLITE_IOCAP_ATOMIC1K]
+** <li> [SQLITE_IOCAP_ATOMIC2K]
+** <li> [SQLITE_IOCAP_ATOMIC4K]
+** <li> [SQLITE_IOCAP_ATOMIC8K]
+** <li> [SQLITE_IOCAP_ATOMIC16K]
+** <li> [SQLITE_IOCAP_ATOMIC32K]
+** <li> [SQLITE_IOCAP_ATOMIC64K]
+** <li> [SQLITE_IOCAP_SAFE_APPEND]
+** <li> [SQLITE_IOCAP_SEQUENTIAL]
+** </ul>
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().
+**
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
+** in the unread portions of the buffer with zeros.  A VFS that
+** fails to zero-fill short reads might seem to work.  However,
+** failure to zero-fill short reads will eventually lead to
+** database corruption.
+*/
+typedef struct sqlite3_io_methods sqlite3_io_methods;
+struct sqlite3_io_methods {
+  int iVersion;
+  int (*xClose)(sqlite3_file*);
+  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
+  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
+  int (*xSync)(sqlite3_file*, int flags);
+  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
+  int (*xLock)(sqlite3_file*, int);
+  int (*xUnlock)(sqlite3_file*, int);
+  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
+  int (*xFileControl)(sqlite3_file*, int op, void *pArg);
+  int (*xSectorSize)(sqlite3_file*);
+  int (*xDeviceCharacteristics)(sqlite3_file*);
+  /* Additional methods may be added in future releases */
+};
+
+/*
+** CAPI3REF: Standard File Control Opcodes {H11310} <S30800>
+**
+** These integer constants are opcodes for the xFileControl method
+** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
+** interface.
+**
+** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This
+** opcode causes the xFileControl method to write the current state of
+** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
+** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
+** into an integer that the pArg argument points to. This capability
+** is used during testing and only needs to be supported when SQLITE_TEST
+** is defined.
+*/
+#define SQLITE_FCNTL_LOCKSTATE        1
+#define SQLITE_GET_LOCKPROXYFILE      2
+#define SQLITE_SET_LOCKPROXYFILE      3
+#define SQLITE_LAST_ERRNO             4
+
+/*
+** CAPI3REF: Mutex Handle {H17110} <S20130>
+**
+** The mutex module within SQLite defines [sqlite3_mutex] to be an
+** abstract type for a mutex object.  The SQLite core never looks
+** at the internal representation of an [sqlite3_mutex].  It only
+** deals with pointers to the [sqlite3_mutex] object.
+**
+** Mutexes are created using [sqlite3_mutex_alloc()].
+*/
+typedef struct sqlite3_mutex sqlite3_mutex;
+
+/*
+** CAPI3REF: OS Interface Object {H11140} <S20100>
+**
+** An instance of the sqlite3_vfs object defines the interface between
+** the SQLite core and the underlying operating system.  The "vfs"
+** in the name of the object stands for "virtual file system".
+**
+** The value of the iVersion field is initially 1 but may be larger in
+** future versions of SQLite.  Additional fields may be appended to this
+** object when the iVersion value is increased.  Note that the structure
+** of the sqlite3_vfs object changes in the transaction between
+** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
+** modified.
+**
+** The szOsFile field is the size of the subclassed [sqlite3_file]
+** structure used by this VFS.  mxPathname is the maximum length of
+** a pathname in this VFS.
+**
+** Registered sqlite3_vfs objects are kept on a linked list formed by
+** the pNext pointer.  The [sqlite3_vfs_register()]
+** and [sqlite3_vfs_unregister()] interfaces manage this list
+** in a thread-safe way.  The [sqlite3_vfs_find()] interface
+** searches the list.  Neither the application code nor the VFS
+** implementation should use the pNext pointer.
+**
+** The pNext field is the only field in the sqlite3_vfs
+** structure that SQLite will ever modify.  SQLite will only access
+** or modify this field while holding a particular static mutex.
+** The application should never modify anything within the sqlite3_vfs
+** object once the object has been registered.
+**
+** The zName field holds the name of the VFS module.  The name must
+** be unique across all VFS modules.
+**
+** SQLite will guarantee that the zFilename parameter to xOpen
+** is either a NULL pointer or string obtained
+** from xFullPathname().  SQLite further guarantees that
+** the string will be valid and unchanged until xClose() is
+** called. Because of the previous sentense,
+** the [sqlite3_file] can safely store a pointer to the
+** filename if it needs to remember the filename for some reason.
+** If the zFilename parameter is xOpen is a NULL pointer then xOpen
+** must invite its own temporary name for the file.  Whenever the 
+** xFilename parameter is NULL it will also be the case that the
+** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
+**
+** The flags argument to xOpen() includes all bits set in
+** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
+** or [sqlite3_open16()] is used, then flags includes at least
+** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 
+** If xOpen() opens a file read-only then it sets *pOutFlags to
+** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
+**
+** SQLite will also add one of the following flags to the xOpen()
+** call, depending on the object being opened:
+**
+** <ul>
+** <li>  [SQLITE_OPEN_MAIN_DB]
+** <li>  [SQLITE_OPEN_MAIN_JOURNAL]
+** <li>  [SQLITE_OPEN_TEMP_DB]
+** <li>  [SQLITE_OPEN_TEMP_JOURNAL]
+** <li>  [SQLITE_OPEN_TRANSIENT_DB]
+** <li>  [SQLITE_OPEN_SUBJOURNAL]
+** <li>  [SQLITE_OPEN_MASTER_JOURNAL]
+** </ul>
+**
+** The file I/O implementation can use the object type flags to
+** change the way it deals with files.  For example, an application
+** that does not care about crash recovery or rollback might make
+** the open of a journal file a no-op.  Writes to this journal would
+** also be no-ops, and any attempt to read the journal would return
+** SQLITE_IOERR.  Or the implementation might recognize that a database
+** file will be doing page-aligned sector reads and writes in a random
+** order and set up its I/O subsystem accordingly.
+**
+** SQLite might also add one of the following flags to the xOpen method:
+**
+** <ul>
+** <li> [SQLITE_OPEN_DELETEONCLOSE]
+** <li> [SQLITE_OPEN_EXCLUSIVE]
+** </ul>
+**
+** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
+** deleted when it is closed.  The [SQLITE_OPEN_DELETEONCLOSE]
+** will be set for TEMP  databases, journals and for subjournals.
+**
+** The [SQLITE_OPEN_EXCLUSIVE] flag means the file should be opened
+** for exclusive access.  This flag is set for all files except
+** for the main database file.
+**
+** At least szOsFile bytes of memory are allocated by SQLite
+** to hold the  [sqlite3_file] structure passed as the third
+** argument to xOpen.  The xOpen method does not have to
+** allocate the structure; it should just fill it in.
+**
+** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
+** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
+** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
+** to test whether a file is at least readable.   The file can be a
+** directory.
+**
+** SQLite will always allocate at least mxPathname+1 bytes for the
+** output buffer xFullPathname.  The exact size of the output buffer
+** is also passed as a parameter to both  methods. If the output buffer
+** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
+** handled as a fatal error by SQLite, vfs implementations should endeavor
+** to prevent this by setting mxPathname to a sufficiently large value.
+**
+** The xRandomness(), xSleep(), and xCurrentTime() interfaces
+** are not strictly a part of the filesystem, but they are
+** included in the VFS structure for completeness.
+** The xRandomness() function attempts to return nBytes bytes
+** of good-quality randomness into zOut.  The return value is
+** the actual number of bytes of randomness obtained.
+** The xSleep() method causes the calling thread to sleep for at
+** least the number of microseconds given.  The xCurrentTime()
+** method returns a Julian Day Number for the current date and time.
+**
+*/
+typedef struct sqlite3_vfs sqlite3_vfs;
+struct sqlite3_vfs {
+  int iVersion;            /* Structure version number */
+  int szOsFile;            /* Size of subclassed sqlite3_file */
+  int mxPathname;          /* Maximum file pathname length */
+  sqlite3_vfs *pNext;      /* Next registered VFS */
+  const char *zName;       /* Name of this virtual file system */
+  void *pAppData;          /* Pointer to application-specific data */
+  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
+               int flags, int *pOutFlags);
+  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
+  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
+  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
+  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
+  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
+  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
+  void (*xDlClose)(sqlite3_vfs*, void*);
+  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
+  int (*xSleep)(sqlite3_vfs*, int microseconds);
+  int (*xCurrentTime)(sqlite3_vfs*, double*);
+  int (*xGetLastError)(sqlite3_vfs*, int, char *);
+  /* New fields may be appended in figure versions.  The iVersion
+  ** value will increment whenever this happens. */
+};
+
+/*
+** CAPI3REF: Flags for the xAccess VFS method {H11190} <H11140>
+**
+** These integer constants can be used as the third parameter to
+** the xAccess method of an [sqlite3_vfs] object. {END}  They determine
+** what kind of permissions the xAccess method is looking for.
+** With SQLITE_ACCESS_EXISTS, the xAccess method
+** simply checks whether the file exists.
+** With SQLITE_ACCESS_READWRITE, the xAccess method
+** checks whether the file is both readable and writable.
+** With SQLITE_ACCESS_READ, the xAccess method
+** checks whether the file is readable.
+*/
+#define SQLITE_ACCESS_EXISTS    0
+#define SQLITE_ACCESS_READWRITE 1
+#define SQLITE_ACCESS_READ      2
+
+/*
+** CAPI3REF: Initialize The SQLite Library {H10130} <S20000><S30100>
+**
+** The sqlite3_initialize() routine initializes the
+** SQLite library.  The sqlite3_shutdown() routine
+** deallocates any resources that were allocated by sqlite3_initialize().
+**
+** A call to sqlite3_initialize() is an "effective" call if it is
+** the first time sqlite3_initialize() is invoked during the lifetime of
+** the process, or if it is the first time sqlite3_initialize() is invoked
+** following a call to sqlite3_shutdown().  Only an effective call
+** of sqlite3_initialize() does any initialization.  All other calls
+** are harmless no-ops.
+**
+** Among other things, sqlite3_initialize() shall invoke
+** sqlite3_os_init().  Similarly, sqlite3_shutdown()
+** shall invoke sqlite3_os_end().
+**
+** The sqlite3_initialize() routine returns [SQLITE_OK] on success.
+** If for some reason, sqlite3_initialize() is unable to initialize
+** the library (perhaps it is unable to allocate a needed resource such
+** as a mutex) it returns an [error code] other than [SQLITE_OK].
+**
+** The sqlite3_initialize() routine is called internally by many other
+** SQLite interfaces so that an application usually does not need to
+** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]
+** calls sqlite3_initialize() so the SQLite library will be automatically
+** initialized when [sqlite3_open()] is called if it has not be initialized
+** already.  However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
+** compile-time option, then the automatic calls to sqlite3_initialize()
+** are omitted and the application must call sqlite3_initialize() directly
+** prior to using any other SQLite interface.  For maximum portability,
+** it is recommended that applications always invoke sqlite3_initialize()
+** directly prior to using any other SQLite interface.  Future releases
+** of SQLite may require this.  In other words, the behavior exhibited
+** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
+** default behavior in some future release of SQLite.
+**
+** The sqlite3_os_init() routine does operating-system specific
+** initialization of the SQLite library.  The sqlite3_os_end()
+** routine undoes the effect of sqlite3_os_init().  Typical tasks
+** performed by these routines include allocation or deallocation
+** of static resources, initialization of global variables,
+** setting up a default [sqlite3_vfs] module, or setting up
+** a default configuration using [sqlite3_config()].
+**
+** The application should never invoke either sqlite3_os_init()
+** or sqlite3_os_end() directly.  The application should only invoke
+** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()
+** interface is called automatically by sqlite3_initialize() and
+** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate
+** implementations for sqlite3_os_init() and sqlite3_os_end()
+** are built into SQLite when it is compiled for unix, windows, or os/2.
+** When built for other platforms (using the [SQLITE_OS_OTHER=1] compile-time
+** option) the application must supply a suitable implementation for
+** sqlite3_os_init() and sqlite3_os_end().  An application-supplied
+** implementation of sqlite3_os_init() or sqlite3_os_end()
+** must return [SQLITE_OK] on success and some other [error code] upon
+** failure.
+*/
+int sqlite3_initialize(void);
+int sqlite3_shutdown(void);
+int sqlite3_os_init(void);
+int sqlite3_os_end(void);
+
+/*
+** CAPI3REF: Configuring The SQLite Library {H14100} <S20000><S30200>
+** EXPERIMENTAL
+**
+** The sqlite3_config() interface is used to make global configuration
+** changes to SQLite in order to tune SQLite to the specific needs of
+** the application.  The default configuration is recommended for most
+** applications and so this routine is usually not necessary.  It is
+** provided to support rare applications with unusual needs.
+**
+** The sqlite3_config() interface is not threadsafe.  The application
+** must insure that no other SQLite interfaces are invoked by other
+** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()
+** may only be invoked prior to library initialization using
+** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
+** Note, however, that sqlite3_config() can be called as part of the
+** implementation of an application-defined [sqlite3_os_init()].
+**
+** The first argument to sqlite3_config() is an integer
+** [SQLITE_CONFIG_SINGLETHREAD | configuration option] that determines
+** what property of SQLite is to be configured.  Subsequent arguments
+** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option]
+** in the first argument.
+**
+** When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
+** If the option is unknown or SQLite is unable to set the option
+** then this routine returns a non-zero [error code].
+**
+** Requirements:
+** [H14103] [H14106] [H14120] [H14123] [H14126] [H14129] [H14132] [H14135]
+** [H14138] [H14141] [H14144] [H14147] [H14150] [H14153] [H14156] [H14159]
+** [H14162] [H14165] [H14168]
+*/
+SQLITE_EXPERIMENTAL int sqlite3_config(int, ...);
+
+/*
+** CAPI3REF: Configure database connections  {H14200} <S20000>
+** EXPERIMENTAL
+**
+** The sqlite3_db_config() interface is used to make configuration
+** changes to a [database connection].  The interface is similar to
+** [sqlite3_config()] except that the changes apply to a single
+** [database connection] (specified in the first argument).  The
+** sqlite3_db_config() interface can only be used immediately after
+** the database connection is created using [sqlite3_open()],
+** [sqlite3_open16()], or [sqlite3_open_v2()].  
+**
+** The second argument to sqlite3_db_config(D,V,...)  is the
+** configuration verb - an integer code that indicates what
+** aspect of the [database connection] is being configured.
+** The only choice for this value is [SQLITE_DBCONFIG_LOOKASIDE].
+** New verbs are likely to be added in future releases of SQLite.
+** Additional arguments depend on the verb.
+**
+** Requirements:
+** [H14203] [H14206] [H14209] [H14212] [H14215]
+*/
+SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...);
+
+/*
+** CAPI3REF: Memory Allocation Routines {H10155} <S20120>
+** EXPERIMENTAL
+**
+** An instance of this object defines the interface between SQLite
+** and low-level memory allocation routines.
+**
+** This object is used in only one place in the SQLite interface.
+** A pointer to an instance of this object is the argument to
+** [sqlite3_config()] when the configuration option is
+** [SQLITE_CONFIG_MALLOC].  By creating an instance of this object
+** and passing it to [sqlite3_config()] during configuration, an
+** application can specify an alternative memory allocation subsystem
+** for SQLite to use for all of its dynamic memory needs.
+**
+** Note that SQLite comes with a built-in memory allocator that is
+** perfectly adequate for the overwhelming majority of applications
+** and that this object is only useful to a tiny minority of applications
+** with specialized memory allocation requirements.  This object is
+** also used during testing of SQLite in order to specify an alternative
+** memory allocator that simulates memory out-of-memory conditions in
+** order to verify that SQLite recovers gracefully from such
+** conditions.
+**
+** The xMalloc, xFree, and xRealloc methods must work like the
+** malloc(), free(), and realloc() functions from the standard library.
+**
+** xSize should return the allocated size of a memory allocation
+** previously obtained from xMalloc or xRealloc.  The allocated size
+** is always at least as big as the requested size but may be larger.
+**
+** The xRoundup method returns what would be the allocated size of
+** a memory allocation given a particular requested size.  Most memory
+** allocators round up memory allocations at least to the next multiple
+** of 8.  Some allocators round up to a larger multiple or to a power of 2.
+**
+** The xInit method initializes the memory allocator.  (For example,
+** it might allocate any require mutexes or initialize internal data
+** structures.  The xShutdown method is invoked (indirectly) by
+** [sqlite3_shutdown()] and should deallocate any resources acquired
+** by xInit.  The pAppData pointer is used as the only parameter to
+** xInit and xShutdown.
+*/
+typedef struct sqlite3_mem_methods sqlite3_mem_methods;
+struct sqlite3_mem_methods {
+  void *(*xMalloc)(int);         /* Memory allocation function */
+  void (*xFree)(void*);          /* Free a prior allocation */
+  void *(*xRealloc)(void*,int);  /* Resize an allocation */
+  int (*xSize)(void*);           /* Return the size of an allocation */
+  int (*xRoundup)(int);          /* Round up request size to allocation size */
+  int (*xInit)(void*);           /* Initialize the memory allocator */
+  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */
+  void *pAppData;                /* Argument to xInit() and xShutdown() */
+};
+
+/*
+** CAPI3REF: Configuration Options {H10160} <S20000>
+** EXPERIMENTAL
+**
+** These constants are the available integer configuration options that
+** can be passed as the first argument to the [sqlite3_config()] interface.
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued.  Applications
+** should check the return code from [sqlite3_config()] to make sure that
+** the call worked.  The [sqlite3_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+** <dl>
+** <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
+** <dd>There are no arguments to this option.  This option disables
+** all mutexing and puts SQLite into a mode where it can only be used
+** by a single thread.</dd>
+**
+** <dt>SQLITE_CONFIG_MULTITHREAD</dt>
+** <dd>There are no arguments to this option.  This option disables
+** mutexing on [database connection] and [prepared statement] objects.
+** The application is responsible for serializing access to
+** [database connections] and [prepared statements].  But other mutexes
+** are enabled so that SQLite will be safe to use in a multi-threaded
+** environment as long as no two threads attempt to use the same
+** [database connection] at the same time.  See the [threading mode]
+** documentation for additional information.</dd>
+**
+** <dt>SQLITE_CONFIG_SERIALIZED</dt>
+** <dd>There are no arguments to this option.  This option enables
+** all mutexes including the recursive
+** mutexes on [database connection] and [prepared statement] objects.
+** In this mode (which is the default when SQLite is compiled with
+** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
+** to [database connections] and [prepared statements] so that the
+** application is free to use the same [database connection] or the
+** same [prepared statement] in different threads at the same time.
+** See the [threading mode] documentation for additional information.</dd>
+**
+** <dt>SQLITE_CONFIG_MALLOC</dt>
+** <dd>This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The argument specifies
+** alternative low-level memory allocation routines to be used in place of
+** the memory allocation routines built into SQLite.</dd>
+**
+** <dt>SQLITE_CONFIG_GETMALLOC</dt>
+** <dd>This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]
+** structure is filled with the currently defined memory allocation routines.
+** This option can be used to overload the default memory allocation
+** routines with a wrapper that simulations memory allocation failure or
+** tracks memory usage, for example.</dd>
+**
+** <dt>SQLITE_CONFIG_MEMSTATUS</dt>
+** <dd>This option takes single argument of type int, interpreted as a 
+** boolean, which enables or disables the collection of memory allocation 
+** statistics. When disabled, the following SQLite interfaces become 
+** non-operational:
+**   <ul>
+**   <li> [sqlite3_memory_used()]
+**   <li> [sqlite3_memory_highwater()]
+**   <li> [sqlite3_soft_heap_limit()]
+**   <li> [sqlite3_status()]
+**   </ul>
+** </dd>
+**
+** <dt>SQLITE_CONFIG_SCRATCH</dt>
+** <dd>This option specifies a static memory buffer that SQLite can use for
+** scratch memory.  There are three arguments:  A pointer to the memory, the
+** size of each scratch buffer (sz), and the number of buffers (N).  The sz
+** argument must be a multiple of 16. The sz parameter should be a few bytes
+** larger than the actual scratch space required due internal overhead.
+** The first
+** argument should point to an allocation of at least sz*N bytes of memory.
+** SQLite will use no more than one scratch buffer at once per thread, so
+** N should be set to the expected maximum number of threads.  The sz
+** parameter should be 6 times the size of the largest database page size.
+** Scratch buffers are used as part of the btree balance operation.  If
+** The btree balancer needs additional memory beyond what is provided by
+** scratch buffers or if no scratch buffer space is specified, then SQLite
+** goes to [sqlite3_malloc()] to obtain the memory it needs.</dd>
+**
+** <dt>SQLITE_CONFIG_PAGECACHE</dt>
+** <dd>This option specifies a static memory buffer that SQLite can use for
+** the database page cache with the default page cache implemenation.  
+** This configuration should not be used if an application-define page
+** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option.
+** There are three arguments to this option: A pointer to the
+** memory, the size of each page buffer (sz), and the number of pages (N).
+** The sz argument must be a power of two between 512 and 32768.  The first
+** argument should point to an allocation of at least sz*N bytes of memory.
+** SQLite will use the memory provided by the first argument to satisfy its
+** memory needs for the first N pages that it adds to cache.  If additional
+** page cache memory is needed beyond what is provided by this option, then
+** SQLite goes to [sqlite3_malloc()] for the additional storage space.
+** The implementation might use one or more of the N buffers to hold 
+** memory accounting information. </dd>
+**
+** <dt>SQLITE_CONFIG_HEAP</dt>
+** <dd>This option specifies a static memory buffer that SQLite will use
+** for all of its dynamic memory allocation needs beyond those provided
+** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].
+** There are three arguments: A pointer to the memory, the number of
+** bytes in the memory buffer, and the minimum allocation size.  If
+** the first pointer (the memory pointer) is NULL, then SQLite reverts
+** to using its default memory allocator (the system malloc() implementation),
+** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  If the
+** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or
+** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory
+** allocator is engaged to handle all of SQLites memory allocation needs.</dd>
+**
+** <dt>SQLITE_CONFIG_MUTEX</dt>
+** <dd>This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The argument specifies
+** alternative low-level mutex routines to be used in place
+** the mutex routines built into SQLite.</dd>
+**
+** <dt>SQLITE_CONFIG_GETMUTEX</dt>
+** <dd>This option takes a single argument which is a pointer to an
+** instance of the [sqlite3_mutex_methods] structure.  The
+** [sqlite3_mutex_methods]
+** structure is filled with the currently defined mutex routines.
+** This option can be used to overload the default mutex allocation
+** routines with a wrapper used to track mutex usage for performance
+** profiling or testing, for example.</dd>
+**
+** <dt>SQLITE_CONFIG_LOOKASIDE</dt>
+** <dd>This option takes two arguments that determine the default
+** memory allcation lookaside optimization.  The first argument is the
+** size of each lookaside buffer slot and the second is the number of
+** slots allocated to each database connection.</dd>
+**
+** <dt>SQLITE_CONFIG_PCACHE</dt>
+** <dd>This option takes a single argument which is a pointer to
+** an [sqlite3_pcache_methods] object.  This object specifies the interface
+** to a custom page cache implementation.  SQLite makes a copy of the
+** object and uses it for page cache memory allocations.</dd>
+**
+** <dt>SQLITE_CONFIG_GETPCACHE</dt>
+** <dd>This option takes a single argument which is a pointer to an
+** [sqlite3_pcache_methods] object.  SQLite copies of the current
+** page cache implementation into that object.</dd>
+**
+** </dl>
+*/
+#define SQLITE_CONFIG_SINGLETHREAD  1  /* nil */
+#define SQLITE_CONFIG_MULTITHREAD   2  /* nil */
+#define SQLITE_CONFIG_SERIALIZED    3  /* nil */
+#define SQLITE_CONFIG_MALLOC        4  /* sqlite3_mem_methods* */
+#define SQLITE_CONFIG_GETMALLOC     5  /* sqlite3_mem_methods* */
+#define SQLITE_CONFIG_SCRATCH       6  /* void*, int sz, int N */
+#define SQLITE_CONFIG_PAGECACHE     7  /* void*, int sz, int N */
+#define SQLITE_CONFIG_HEAP          8  /* void*, int nByte, int min */
+#define SQLITE_CONFIG_MEMSTATUS     9  /* boolean */
+#define SQLITE_CONFIG_MUTEX        10  /* sqlite3_mutex_methods* */
+#define SQLITE_CONFIG_GETMUTEX     11  /* sqlite3_mutex_methods* */
+/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ 
+#define SQLITE_CONFIG_LOOKASIDE    13  /* int int */
+#define SQLITE_CONFIG_PCACHE       14  /* sqlite3_pcache_methods* */
+#define SQLITE_CONFIG_GETPCACHE    15  /* sqlite3_pcache_methods* */
+
+/*
+** CAPI3REF: Configuration Options {H10170} <S20000>
+** EXPERIMENTAL
+**
+** These constants are the available integer configuration options that
+** can be passed as the second argument to the [sqlite3_db_config()] interface.
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued.  Applications
+** should check the return code from [sqlite3_db_config()] to make sure that
+** the call worked.  The [sqlite3_db_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+** <dl>
+** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
+** <dd>This option takes three additional arguments that determine the 
+** [lookaside memory allocator] configuration for the [database connection].
+** The first argument (the third parameter to [sqlite3_db_config()] is a
+** pointer to a memory buffer to use for lookaside memory.  The first
+** argument may be NULL in which case SQLite will allocate the lookaside
+** buffer itself using [sqlite3_malloc()].  The second argument is the
+** size of each lookaside buffer slot and the third argument is the number of
+** slots.  The size of the buffer in the first argument must be greater than
+** or equal to the product of the second and third arguments.</dd>
+**
+** </dl>
+*/
+#define SQLITE_DBCONFIG_LOOKASIDE    1001  /* void* int int */
+
+
+/*
+** CAPI3REF: Enable Or Disable Extended Result Codes {H12200} <S10700>
+**
+** The sqlite3_extended_result_codes() routine enables or disables the
+** [extended result codes] feature of SQLite. The extended result
+** codes are disabled by default for historical compatibility considerations.
+**
+** Requirements:
+** [H12201] [H12202]
 */
 int sqlite3_extended_result_codes(sqlite3*, int onoff);
 
 /*
-** CAPI3REF: Last Insert Rowid
+** CAPI3REF: Last Insert Rowid {H12220} <S10700>
 **
-** Each entry in an SQLite table has a unique 64-bit signed integer key
-** called the "rowid". The rowid is always available as an undeclared
-** column named ROWID, OID, or _ROWID_.  If the table has a column of
-** type INTEGER PRIMARY KEY then that column is another an alias for the
-** rowid.
+** Each entry in an SQLite table has a unique 64-bit signed
+** integer key called the [ROWID | "rowid"]. The rowid is always available
+** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
+** names are not also used by explicitly declared columns. If
+** the table has a column of type [INTEGER PRIMARY KEY] then that column
+** is another alias for the rowid.
 **
-** This routine returns the rowid of the most recent INSERT into
-** the database from the database connection given in the first 
-** argument.  If no inserts have ever occurred on this database
-** connection, zero is returned.
+** This routine returns the [rowid] of the most recent
+** successful [INSERT] into the database from the [database connection]
+** in the first argument.  If no successful [INSERT]s
+** have ever occurred on that database connection, zero is returned.
 **
-** If an INSERT occurs within a trigger, then the rowid of the
-** inserted row is returned by this routine as long as the trigger
-** is running.  But once the trigger terminates, the value returned
-** by this routine reverts to the last value inserted before the
-** trigger fired.
+** If an [INSERT] occurs within a trigger, then the [rowid] of the inserted
+** row is returned by this routine as long as the trigger is running.
+** But once the trigger terminates, the value returned by this routine
+** reverts to the last value inserted before the trigger fired.
+**
+** An [INSERT] that fails due to a constraint violation is not a
+** successful [INSERT] and does not change the value returned by this
+** routine.  Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK,
+** and INSERT OR ABORT make no changes to the return value of this
+** routine when their insertion fails.  When INSERT OR REPLACE
+** encounters a constraint violation, it does not fail.  The
+** INSERT continues to completion after deleting rows that caused
+** the constraint problem so INSERT OR REPLACE will always change
+** the return value of this interface.
+**
+** For the purposes of this routine, an [INSERT] is considered to
+** be successful even if it is subsequently rolled back.
+**
+** Requirements:
+** [H12221] [H12223]
+**
+** If a separate thread performs a new [INSERT] on the same
+** database connection while the [sqlite3_last_insert_rowid()]
+** function is running and thus changes the last insert [rowid],
+** then the value returned by [sqlite3_last_insert_rowid()] is
+** unpredictable and might not equal either the old or the new
+** last insert [rowid].
 */
-sqlite_int64 sqlite3_last_insert_rowid(sqlite3*);
+sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
 
 /*
-** CAPI3REF: Count The Number Of Rows Modified
+** CAPI3REF: Count The Number Of Rows Modified {H12240} <S10600>
 **
 ** This function returns the number of database rows that were changed
-** (or inserted or deleted) by the most recent SQL statement.  Only
-** changes that are directly specified by the INSERT, UPDATE, or
-** DELETE statement are counted.  Auxiliary changes caused by
-** triggers are not counted.  Use the [sqlite3_total_changes()] function
+** or inserted or deleted by the most recently completed SQL statement
+** on the [database connection] specified by the first parameter.
+** Only changes that are directly specified by the [INSERT], [UPDATE],
+** or [DELETE] statement are counted.  Auxiliary changes caused by
+** triggers are not counted. Use the [sqlite3_total_changes()] function
 ** to find the total number of changes including changes caused by triggers.
 **
-** Within the body of a trigger, the sqlite3_changes() interface can be
-** called to find the number of
+** A "row change" is a change to a single row of a single table
+** caused by an INSERT, DELETE, or UPDATE statement.  Rows that
+** are changed as side effects of REPLACE constraint resolution,
+** rollback, ABORT processing, DROP TABLE, or by any other
+** mechanisms do not count as direct row changes.
+**
+** A "trigger context" is a scope of execution that begins and
+** ends with the script of a trigger.  Most SQL statements are
+** evaluated outside of any trigger.  This is the "top level"
+** trigger context.  If a trigger fires from the top level, a
+** new trigger context is entered for the duration of that one
+** trigger.  Subtriggers create subcontexts for their duration.
+**
+** Calling [sqlite3_exec()] or [sqlite3_step()] recursively does
+** not create a new trigger context.
+**
+** This function returns the number of direct row changes in the
+** most recent INSERT, UPDATE, or DELETE statement within the same
+** trigger context.
+**
+** Thus, when called from the top level, this function returns the
+** number of changes in the most recent INSERT, UPDATE, or DELETE
+** that also occurred at the top level.  Within the body of a trigger,
+** the sqlite3_changes() interface can be called to find the number of
 ** changes in the most recently completed INSERT, UPDATE, or DELETE
-** statement within the body of the trigger.
-**
-** All changes are counted, even if they were later undone by a
-** ROLLBACK or ABORT.  Except, changes associated with creating and
-** dropping tables are not counted.
-**
-** If a callback invokes [sqlite3_exec()] or [sqlite3_step()] recursively,
-** then the changes in the inner, recursive call are counted together
-** with the changes in the outer call.
+** statement within the body of the same trigger.
+** However, the number returned does not include changes
+** caused by subtriggers since those have their own context.
 **
 ** SQLite implements the command "DELETE FROM table" without a WHERE clause
-** by dropping and recreating the table.  (This is much faster than going
-** through and deleting individual elements form the table.)  Because of
-** this optimization, the change count for "DELETE FROM table" will be
-** zero regardless of the number of elements that were originally in the
-** table. To get an accurate count of the number of rows deleted, use
-** "DELETE FROM table WHERE 1" instead.
+** by dropping and recreating the table.  Doing so is much faster than going
+** through and deleting individual elements from the table.  Because of this
+** optimization, the deletions in "DELETE FROM table" are not row changes and
+** will not be counted by the sqlite3_changes() or [sqlite3_total_changes()]
+** functions, regardless of the number of elements that were originally
+** in the table.  To get an accurate count of the number of rows deleted, use
+** "DELETE FROM table WHERE 1" instead.  Or recompile using the
+** [SQLITE_OMIT_TRUNCATE_OPTIMIZATION] compile-time option to disable the
+** optimization on all queries.
+**
+** Requirements:
+** [H12241] [H12243]
+**
+** If a separate thread makes changes on the same database connection
+** while [sqlite3_changes()] is running then the value returned
+** is unpredictable and not meaningful.
 */
 int sqlite3_changes(sqlite3*);
 
 /*
-** CAPI3REF: Total Number Of Rows Modified
-***
-** This function returns the number of database rows that have been
-** modified by INSERT, UPDATE or DELETE statements since the database handle
-** was opened. This includes UPDATE, INSERT and DELETE statements executed
-** as part of trigger programs. All changes are counted as soon as the
-** statement that makes them is completed (when the statement handle is
-** passed to [sqlite3_reset()] or [sqlite_finalise()]).
+** CAPI3REF: Total Number Of Rows Modified {H12260} <S10600>
 **
-** See also the [sqlite3_change()] interface.
+** This function returns the number of row changes caused by INSERT,
+** UPDATE or DELETE statements since the [database connection] was opened.
+** The count includes all changes from all trigger contexts.  However,
+** the count does not include changes used to implement REPLACE constraints,
+** do rollbacks or ABORT processing, or DROP table processing.
+** The changes are counted as soon as the statement that makes them is
+** completed (when the statement handle is passed to [sqlite3_reset()] or
+** [sqlite3_finalize()]).
 **
 ** SQLite implements the command "DELETE FROM table" without a WHERE clause
 ** by dropping and recreating the table.  (This is much faster than going
-** through and deleting individual elements form the table.)  Because of
-** this optimization, the change count for "DELETE FROM table" will be
-** zero regardless of the number of elements that were originally in the
-** table. To get an accurate count of the number of rows deleted, use
-** "DELETE FROM table WHERE 1" instead.
+** through and deleting individual elements from the table.)  Because of this
+** optimization, the deletions in "DELETE FROM table" are not row changes and
+** will not be counted by the sqlite3_changes() or [sqlite3_total_changes()]
+** functions, regardless of the number of elements that were originally
+** in the table.  To get an accurate count of the number of rows deleted, use
+** "DELETE FROM table WHERE 1" instead.   Or recompile using the
+** [SQLITE_OMIT_TRUNCATE_OPTIMIZATION] compile-time option to disable the
+** optimization on all queries.
+**
+** See also the [sqlite3_changes()] interface.
+**
+** Requirements:
+** [H12261] [H12263]
+**
+** If a separate thread makes changes on the same database connection
+** while [sqlite3_total_changes()] is running then the value
+** returned is unpredictable and not meaningful.
 */
 int sqlite3_total_changes(sqlite3*);
 
 /*
-** CAPI3REF: Interrupt A Long-Running Query
+** CAPI3REF: Interrupt A Long-Running Query {H12270} <S30500>
 **
 ** This function causes any pending database operation to abort and
-** return at its earliest opportunity.  This routine is typically
+** return at its earliest opportunity. This routine is typically
 ** called in response to a user action such as pressing "Cancel"
 ** or Ctrl-C where the user wants a long query operation to halt
 ** immediately.
 **
 ** It is safe to call this routine from a thread different from the
-** thread that is currently running the database operation.
+** thread that is currently running the database operation.  But it
+** is not safe to call this routine with a [database connection] that
+** is closed or might close before sqlite3_interrupt() returns.
 **
-** The SQL operation that is interrupted will return [SQLITE_INTERRUPT].
-** If an interrupted operation was an update that is inside an
-** explicit transaction, then the entire transaction will be rolled
-** back automatically.
+** If an SQL operation is very nearly finished at the time when
+** sqlite3_interrupt() is called, then it might not have an opportunity
+** to be interrupted and might continue to completion.
+**
+** An SQL operation that is interrupted will return [SQLITE_INTERRUPT].
+** If the interrupted SQL operation is an INSERT, UPDATE, or DELETE
+** that is inside an explicit transaction, then the entire transaction
+** will be rolled back automatically.
+**
+** A call to sqlite3_interrupt() has no effect on SQL statements
+** that are started after sqlite3_interrupt() returns.
+**
+** Requirements:
+** [H12271] [H12272]
+**
+** If the database connection closes while [sqlite3_interrupt()]
+** is running then bad things will likely happen.
 */
 void sqlite3_interrupt(sqlite3*);
 
 /*
-** CAPI3REF: Determine If An SQL Statement Is Complete
-**
-** These functions return true if the given input string comprises
-** one or more complete SQL statements. For the sqlite3_complete() call,
-** the parameter must be a nul-terminated UTF-8 string. For
-** sqlite3_complete16(), a nul-terminated machine byte order UTF-16 string
-** is required.
+** CAPI3REF: Determine If An SQL Statement Is Complete {H10510} <S70200>
 **
 ** These routines are useful for command-line input to determine if the
-** currently entered text forms one or more complete SQL statements or
-** if additional input is needed before sending the statements into
-** SQLite for parsing. The algorithm is simple.  If the 
-** last token other than spaces and comments is a semicolon, then return 
-** true.  Actually, the algorithm is a little more complicated than that
-** in order to deal with triggers, but the basic idea is the same:  the
-** statement is not complete unless it ends in a semicolon.
+** currently entered text seems to form complete a SQL statement or
+** if additional input is needed before sending the text into
+** SQLite for parsing.  These routines return true if the input string
+** appears to be a complete SQL statement.  A statement is judged to be
+** complete if it ends with a semicolon token and is not a fragment of a
+** CREATE TRIGGER statement.  Semicolons that are embedded within
+** string literals or quoted identifier names or comments are not
+** independent tokens (they are part of the token in which they are
+** embedded) and thus do not count as a statement terminator.
+**
+** These routines do not parse the SQL statements thus
+** will not detect syntactically incorrect SQL.
+**
+** Requirements: [H10511] [H10512]
+**
+** The input to [sqlite3_complete()] must be a zero-terminated
+** UTF-8 string.
+**
+** The input to [sqlite3_complete16()] must be a zero-terminated
+** UTF-16 string in native byte order.
 */
 int sqlite3_complete(const char *sql);
 int sqlite3_complete16(const void *sql);
 
 /*
-** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
+** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors {H12310} <S40400>
 **
-** This routine identifies a callback function that might be invoked
-** whenever an attempt is made to open a database table 
-** that another thread or process has locked.
-** If the busy callback is NULL, then [SQLITE_BUSY]
-** (or sometimes [SQLITE_IOERR_BLOCKED])
-** is returned immediately upon encountering the lock.
-** If the busy callback is not NULL, then the
-** callback will be invoked with two arguments.  The
-** first argument to the handler is a copy of the void* pointer which
-** is the third argument to this routine.  The second argument to
-** the handler is the number of times that the busy handler has
-** been invoked for this locking event. If the
+** This routine sets a callback function that might be invoked whenever
+** an attempt is made to open a database table that another thread
+** or process has locked.
+**
+** If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]
+** is returned immediately upon encountering the lock. If the busy callback
+** is not NULL, then the callback will be invoked with two arguments.
+**
+** The first argument to the handler is a copy of the void* pointer which
+** is the third argument to sqlite3_busy_handler().  The second argument to
+** the handler callback is the number of times that the busy handler has
+** been invoked for this locking event.  If the
 ** busy callback returns 0, then no additional attempts are made to
 ** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned.
-** If the callback returns non-zero, then another attempt is made to open the
-** database for reading and the cycle repeats.
+** If the callback returns non-zero, then another attempt
+** is made to open the database for reading and the cycle repeats.
 **
-** The presence of a busy handler does not guarantee that
-** it will be invoked when there is lock contention.
-** If SQLite determines that invoking the busy handler could result in
-** a deadlock, it will return [SQLITE_BUSY] instead.
+** The presence of a busy handler does not guarantee that it will be invoked
+** when there is lock contention. If SQLite determines that invoking the busy
+** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY]
+** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler.
 ** Consider a scenario where one process is holding a read lock that
 ** it is trying to promote to a reserved lock and
 ** a second process is holding a reserved lock that it is trying
@@ -476,8 +1401,8 @@
 **
 ** The default busy callback is NULL.
 **
-** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] when
-** SQLite is in the middle of a large transaction where all the
+** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED]
+** when SQLite is in the middle of a large transaction where all the
 ** changes will not fit into the in-memory cache.  SQLite will
 ** already hold a RESERVED lock on the database file, but it needs
 ** to promote this lock to EXCLUSIVE so that it can spill cache
@@ -486,109 +1411,140 @@
 ** cache will be left in an inconsistent state and so the error
 ** code is promoted from the relatively benign [SQLITE_BUSY] to
 ** the more severe [SQLITE_IOERR_BLOCKED].  This error code promotion
-** forces an automatic rollback of the changes. See the
-** <a href="http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError">
+** forces an automatic rollback of the changes.  See the
+** <a href="/cvstrac/wiki?p=CorruptionFollowingBusyError">
 ** CorruptionFollowingBusyError</a> wiki page for a discussion of why
 ** this is important.
-**	
-** Sqlite is re-entrant, so the busy handler may start a new query. 
-** (It is not clear why anyone would every want to do this, but it
-** is allowed, in theory.)  But the busy handler may not close the
-** database.  Closing the database from a busy handler will delete 
-** data structures out from under the executing query and will 
-** probably result in a segmentation fault or other runtime error.
 **
-** There can only be a single busy handler defined for each database
-** connection.  Setting a new busy handler clears any previous one.
-** Note that calling [sqlite3_busy_timeout()] will also set or clear
-** the busy handler.
+** There can only be a single busy handler defined for each
+** [database connection].  Setting a new busy handler clears any
+** previously set handler.  Note that calling [sqlite3_busy_timeout()]
+** will also set or clear the busy handler.
+**
+** The busy callback should not take any actions which modify the
+** database connection that invoked the busy handler.  Any such actions
+** result in undefined behavior.
+** 
+** Requirements:
+** [H12311] [H12312] [H12314] [H12316] [H12318]
+**
+** A busy handler must not close the database connection
+** or [prepared statement] that invoked the busy handler.
 */
 int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
 
 /*
-** CAPI3REF: Set A Busy Timeout
+** CAPI3REF: Set A Busy Timeout {H12340} <S40410>
 **
-** This routine sets a busy handler that sleeps for a while when a
-** table is locked.  The handler will sleep multiple times until 
-** at least "ms" milliseconds of sleeping have been done.  After
-** "ms" milliseconds of sleeping, the handler returns 0 which
-** causes [sqlite3_step()] to return [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED].
+** This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
+** for a specified amount of time when a table is locked.  The handler
+** will sleep multiple times until at least "ms" milliseconds of sleeping
+** have accumulated. {H12343} After "ms" milliseconds of sleeping,
+** the handler returns 0 which causes [sqlite3_step()] to return
+** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED].
 **
 ** Calling this routine with an argument less than or equal to zero
 ** turns off all busy handlers.
 **
-** There can only be a single busy handler for a particular database
-** connection.  If another busy handler was defined  
-** (using [sqlite3_busy_handler()]) prior to calling
+** There can only be a single busy handler for a particular
+** [database connection] any any given moment.  If another busy handler
+** was defined  (using [sqlite3_busy_handler()]) prior to calling
 ** this routine, that other busy handler is cleared.
+**
+** Requirements:
+** [H12341] [H12343] [H12344]
 */
 int sqlite3_busy_timeout(sqlite3*, int ms);
 
 /*
-** CAPI3REF: Convenience Routines For Running Queries
+** CAPI3REF: Convenience Routines For Running Queries {H12370} <S10000>
 **
-** This next routine is a convenience wrapper around [sqlite3_exec()].
-** Instead of invoking a user-supplied callback for each row of the
-** result, this routine remembers each row of the result in memory
-** obtained from [sqlite3_malloc()], then returns all of the result after the
-** query has finished. 
+** Definition: A <b>result table</b> is memory data structure created by the
+** [sqlite3_get_table()] interface.  A result table records the
+** complete query results from one or more queries.
 **
-** As an example, suppose the query result where this table:
+** The table conceptually has a number of rows and columns.  But
+** these numbers are not part of the result table itself.  These
+** numbers are obtained separately.  Let N be the number of rows
+** and M be the number of columns.
 **
-** <pre>
+** A result table is an array of pointers to zero-terminated UTF-8 strings.
+** There are (N+1)*M elements in the array.  The first M pointers point
+** to zero-terminated strings that  contain the names of the columns.
+** The remaining entries all point to query results.  NULL values result
+** in NULL pointers.  All other values are in their UTF-8 zero-terminated
+** string representation as returned by [sqlite3_column_text()].
+**
+** A result table might consist of one or more memory allocations.
+** It is not safe to pass a result table directly to [sqlite3_free()].
+** A result table should be deallocated using [sqlite3_free_table()].
+**
+** As an example of the result table format, suppose a query result
+** is as follows:
+**
+** <blockquote><pre>
 **        Name        | Age
 **        -----------------------
 **        Alice       | 43
 **        Bob         | 28
 **        Cindy       | 21
-** </pre>
+** </pre></blockquote>
 **
-** If the 3rd argument were &azResult then after the function returns
-** azResult will contain the following data:
+** There are two column (M==2) and three rows (N==3).  Thus the
+** result table has 8 entries.  Suppose the result table is stored
+** in an array names azResult.  Then azResult holds this content:
 **
-** <pre>
-**        azResult[0] = "Name";
-**        azResult[1] = "Age";
-**        azResult[2] = "Alice";
-**        azResult[3] = "43";
-**        azResult[4] = "Bob";
-**        azResult[5] = "28";
-**        azResult[6] = "Cindy";
-**        azResult[7] = "21";
-** </pre>
+** <blockquote><pre>
+**        azResult&#91;0] = "Name";
+**        azResult&#91;1] = "Age";
+**        azResult&#91;2] = "Alice";
+**        azResult&#91;3] = "43";
+**        azResult&#91;4] = "Bob";
+**        azResult&#91;5] = "28";
+**        azResult&#91;6] = "Cindy";
+**        azResult&#91;7] = "21";
+** </pre></blockquote>
 **
-** Notice that there is an extra row of data containing the column
-** headers.  But the *nrow return value is still 3.  *ncolumn is
-** set to 2.  In general, the number of values inserted into azResult
-** will be ((*nrow) + 1)*(*ncolumn).
+** The sqlite3_get_table() function evaluates one or more
+** semicolon-separated SQL statements in the zero-terminated UTF-8
+** string of its 2nd parameter.  It returns a result table to the
+** pointer given in its 3rd parameter.
 **
-** After the calling function has finished using the result, it should 
-** pass the result data pointer to sqlite3_free_table() in order to 
-** release the memory that was malloc-ed.  Because of the way the 
-** [sqlite3_malloc()] happens, the calling function must not try to call 
-** [sqlite3_free()] directly.  Only [sqlite3_free_table()] is able to release 
-** the memory properly and safely.
+** After the calling function has finished using the result, it should
+** pass the pointer to the result table to sqlite3_free_table() in order to
+** release the memory that was malloced.  Because of the way the
+** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling
+** function must not try to call [sqlite3_free()] directly.  Only
+** [sqlite3_free_table()] is able to release the memory properly and safely.
 **
-** The return value of this routine is the same as from [sqlite3_exec()].
+** The sqlite3_get_table() interface is implemented as a wrapper around
+** [sqlite3_exec()].  The sqlite3_get_table() routine does not have access
+** to any internal data structures of SQLite.  It uses only the public
+** interface defined here.  As a consequence, errors that occur in the
+** wrapper layer outside of the internal [sqlite3_exec()] call are not
+** reflected in subsequent calls to [sqlite3_errcode()] or [sqlite3_errmsg()].
+**
+** Requirements:
+** [H12371] [H12373] [H12374] [H12376] [H12379] [H12382]
 */
 int sqlite3_get_table(
-  sqlite3*,              /* An open database */
-  const char *sql,       /* SQL to be executed */
-  char ***resultp,       /* Result written to a char *[]  that this points to */
-  int *nrow,             /* Number of result rows written here */
-  int *ncolumn,          /* Number of result columns written here */
-  char **errmsg          /* Error msg written here */
+  sqlite3 *db,          /* An open database */
+  const char *zSql,     /* SQL to be evaluated */
+  char ***pazResult,    /* Results of the query */
+  int *pnRow,           /* Number of result rows written here */
+  int *pnColumn,        /* Number of result columns written here */
+  char **pzErrmsg       /* Error msg written here */
 );
 void sqlite3_free_table(char **result);
 
 /*
-** CAPI3REF: Formatted String Printing Functions
+** CAPI3REF: Formatted String Printing Functions {H17400} <S70000><S20000>
 **
 ** These routines are workalikes of the "printf()" family of functions
 ** from the standard C library.
 **
 ** The sqlite3_mprintf() and sqlite3_vmprintf() routines write their
-** results into memory obtained from [sqlite_malloc()].
+** results into memory obtained from [sqlite3_malloc()].
 ** The strings returned by these two routines should be
 ** released by [sqlite3_free()].  Both routines return a
 ** NULL pointer if [sqlite3_malloc()] is unable to allocate enough
@@ -597,7 +1553,7 @@
 ** In sqlite3_snprintf() routine is similar to "snprintf()" from
 ** the standard C library.  The result is written into the
 ** buffer supplied as the second parameter whose size is given by
-** the first parameter.  Note that the order of the
+** the first parameter. Note that the order of the
 ** first two parameters is reversed from snprintf().  This is an
 ** historical accident that cannot be fixed without breaking
 ** backwards compatibility.  Note also that sqlite3_snprintf()
@@ -615,8 +1571,8 @@
 **
 ** These routines all implement some additional formatting
 ** options that are useful for constructing SQL statements.
-** All of the usual printf formatting options apply.  In addition, there
-** is are "%q" and "%Q" options.
+** All of the usual printf() formatting options apply.  In addition, there
+** is are "%q", "%Q", and "%z" options.
 **
 ** The %q option works like %s in that it substitutes a null-terminated
 ** string from the argument list.  But %q also doubles every '\'' character.
@@ -624,7 +1580,7 @@
 ** character it escapes that character and allows it to be inserted into
 ** the string.
 **
-** For example, so some string variable contains text as follows:
+** For example, assume the string variable zText contains text as follows:
 **
 ** <blockquote><pre>
 **  char *zText = "It's a happy day!";
@@ -652,14 +1608,13 @@
 **  INSERT INTO table1 VALUES('It's a happy day!');
 ** </pre></blockquote>
 **
-** This second example is an SQL syntax error.  As a general rule you
-** should always use %q instead of %s when inserting text into a string 
-** literal.
+** This second example is an SQL syntax error.  As a general rule you should
+** always use %q instead of %s when inserting text into a string literal.
 **
 ** The %Q option works like %q except it also adds single quotes around
-** the outside of the total string.  Or if the parameter in the argument
-** list is a NULL pointer, %Q substitutes the text "NULL" (without single
-** quotes) in place of the %Q option.  So, for example, one could say:
+** the outside of the total string.  Additionally, if the parameter in the
+** argument list is a NULL pointer, %Q substitutes the text "NULL" (without
+** single quotes) in place of the %Q option.  So, for example, one could say:
 **
 ** <blockquote><pre>
 **  char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText);
@@ -669,76 +1624,215 @@
 **
 ** The code above will render a correct SQL statement in the zSQL
 ** variable even if the zText variable is a NULL pointer.
+**
+** The "%z" formatting option works exactly like "%s" with the
+** addition that after the string has been read and copied into
+** the result, [sqlite3_free()] is called on the input string. {END}
+**
+** Requirements:
+** [H17403] [H17406] [H17407]
 */
 char *sqlite3_mprintf(const char*,...);
 char *sqlite3_vmprintf(const char*, va_list);
 char *sqlite3_snprintf(int,char*,const char*, ...);
 
 /*
-** CAPI3REF: Memory Allocation Functions
+** CAPI3REF: Memory Allocation Subsystem {H17300} <S20000>
 **
-** SQLite uses its own memory allocator.  On some installations, this
-** memory allocator is identical to the standard malloc()/realloc()/free()
-** and can be used interchangable.  On others, the implementations are
-** different.  For maximum portability, it is best not to mix calls
-** to the standard malloc/realloc/free with the sqlite versions.
+** The SQLite core  uses these three routines for all of its own
+** internal memory allocation needs. "Core" in the previous sentence
+** does not include operating-system specific VFS implementation.  The
+** Windows VFS uses native malloc() and free() for some operations.
+**
+** The sqlite3_malloc() routine returns a pointer to a block
+** of memory at least N bytes in length, where N is the parameter.
+** If sqlite3_malloc() is unable to obtain sufficient free
+** memory, it returns a NULL pointer.  If the parameter N to
+** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns
+** a NULL pointer.
+**
+** Calling sqlite3_free() with a pointer previously returned
+** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
+** that it might be reused.  The sqlite3_free() routine is
+** a no-op if is called with a NULL pointer.  Passing a NULL pointer
+** to sqlite3_free() is harmless.  After being freed, memory
+** should neither be read nor written.  Even reading previously freed
+** memory might result in a segmentation fault or other severe error.
+** Memory corruption, a segmentation fault, or other severe error
+** might result if sqlite3_free() is called with a non-NULL pointer that
+** was not obtained from sqlite3_malloc() or sqlite3_realloc().
+**
+** The sqlite3_realloc() interface attempts to resize a
+** prior memory allocation to be at least N bytes, where N is the
+** second parameter.  The memory allocation to be resized is the first
+** parameter.  If the first parameter to sqlite3_realloc()
+** is a NULL pointer then its behavior is identical to calling
+** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc().
+** If the second parameter to sqlite3_realloc() is zero or
+** negative then the behavior is exactly the same as calling
+** sqlite3_free(P) where P is the first parameter to sqlite3_realloc().
+** sqlite3_realloc() returns a pointer to a memory allocation
+** of at least N bytes in size or NULL if sufficient memory is unavailable.
+** If M is the size of the prior allocation, then min(N,M) bytes
+** of the prior allocation are copied into the beginning of buffer returned
+** by sqlite3_realloc() and the prior allocation is freed.
+** If sqlite3_realloc() returns NULL, then the prior allocation
+** is not freed.
+**
+** The memory returned by sqlite3_malloc() and sqlite3_realloc()
+** is always aligned to at least an 8 byte boundary. {END}
+**
+** The default implementation of the memory allocation subsystem uses
+** the malloc(), realloc() and free() provided by the standard C library.
+** {H17382} However, if SQLite is compiled with the
+** SQLITE_MEMORY_SIZE=<i>NNN</i> C preprocessor macro (where <i>NNN</i>
+** is an integer), then SQLite create a static array of at least
+** <i>NNN</i> bytes in size and uses that array for all of its dynamic
+** memory allocation needs. {END}  Additional memory allocator options
+** may be added in future releases.
+**
+** In SQLite version 3.5.0 and 3.5.1, it was possible to define
+** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
+** implementation of these routines to be omitted.  That capability
+** is no longer provided.  Only built-in memory allocators can be used.
+**
+** The Windows OS interface layer calls
+** the system malloc() and free() directly when converting
+** filenames between the UTF-8 encoding used by SQLite
+** and whatever filename encoding is used by the particular Windows
+** installation.  Memory allocation errors are detected, but
+** they are reported back as [SQLITE_CANTOPEN] or
+** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
+**
+** Requirements:
+** [H17303] [H17304] [H17305] [H17306] [H17310] [H17312] [H17315] [H17318]
+** [H17321] [H17322] [H17323]
+**
+** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
+** must be either NULL or else pointers obtained from a prior
+** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
+** not yet been released.
+**
+** The application must not read or write any part of
+** a block of memory after it has been released using
+** [sqlite3_free()] or [sqlite3_realloc()].
 */
 void *sqlite3_malloc(int);
 void *sqlite3_realloc(void*, int);
 void sqlite3_free(void*);
 
 /*
-** CAPI3REF: Compile-Time Authorization Callbacks
-***
-** This routine registers a authorizer callback with the SQLite library.  
+** CAPI3REF: Memory Allocator Statistics {H17370} <S30210>
+**
+** SQLite provides these two interfaces for reporting on the status
+** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
+** routines, which form the built-in memory allocation subsystem.
+**
+** Requirements:
+** [H17371] [H17373] [H17374] [H17375]
+*/
+sqlite3_int64 sqlite3_memory_used(void);
+sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
+
+/*
+** CAPI3REF: Pseudo-Random Number Generator {H17390} <S20000>
+**
+** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
+** select random [ROWID | ROWIDs] when inserting new records into a table that
+** already uses the largest possible [ROWID].  The PRNG is also used for
+** the build-in random() and randomblob() SQL functions.  This interface allows
+** applications to access the same PRNG for other purposes.
+**
+** A call to this routine stores N bytes of randomness into buffer P.
+**
+** The first time this routine is invoked (either internally or by
+** the application) the PRNG is seeded using randomness obtained
+** from the xRandomness method of the default [sqlite3_vfs] object.
+** On all subsequent invocations, the pseudo-randomness is generated
+** internally and without recourse to the [sqlite3_vfs] xRandomness
+** method.
+**
+** Requirements:
+** [H17392]
+*/
+void sqlite3_randomness(int N, void *P);
+
+/*
+** CAPI3REF: Compile-Time Authorization Callbacks {H12500} <S70100>
+**
+** This routine registers a authorizer callback with a particular
+** [database connection], supplied in the first argument.
 ** The authorizer callback is invoked as SQL statements are being compiled
 ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
 ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  At various
 ** points during the compilation process, as logic is being created
 ** to perform various actions, the authorizer callback is invoked to
 ** see if those actions are allowed.  The authorizer callback should
-** return SQLITE_OK to allow the action, [SQLITE_IGNORE] to disallow the
+** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
 ** specific action but allow the SQL statement to continue to be
 ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
-** rejected with an error.  
+** rejected with an error.  If the authorizer callback returns
+** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
+** then the [sqlite3_prepare_v2()] or equivalent call that triggered
+** the authorizer will fail with an error message.
 **
-** Depending on the action, the [SQLITE_IGNORE] and [SQLITE_DENY] return
-** codes might mean something different or they might mean the same
-** thing.  If the action is, for example, to perform a delete opertion,
-** then [SQLITE_IGNORE] and [SQLITE_DENY] both cause the statement compilation
-** to fail with an error.  But if the action is to read a specific column
-** from a specific table, then [SQLITE_DENY] will cause the entire
-** statement to fail but [SQLITE_IGNORE] will cause a NULL value to be
-** read instead of the actual column value.
+** When the callback returns [SQLITE_OK], that means the operation
+** requested is ok.  When the callback returns [SQLITE_DENY], the
+** [sqlite3_prepare_v2()] or equivalent call that triggered the
+** authorizer will fail with an error message explaining that
+** access is denied.  If the authorizer code is [SQLITE_READ]
+** and the callback returns [SQLITE_IGNORE] then the
+** [prepared statement] statement is constructed to substitute
+** a NULL value in place of the table column that would have
+** been read if [SQLITE_OK] had been returned.  The [SQLITE_IGNORE]
+** return can be used to deny an untrusted user access to individual
+** columns of a table.
 **
-** The first parameter to the authorizer callback is a copy of
-** the third parameter to the sqlite3_set_authorizer() interface.
-** The second parameter to the callback is an integer 
-** [SQLITE_COPY | action code] that specifies the particular action
-** to be authorized.  The available action codes are
-** [SQLITE_COPY | documented separately].  The third through sixth
-** parameters to the callback are strings that contain additional
+** The first parameter to the authorizer callback is a copy of the third
+** parameter to the sqlite3_set_authorizer() interface. The second parameter
+** to the callback is an integer [SQLITE_COPY | action code] that specifies
+** the particular action to be authorized. The third through sixth parameters
+** to the callback are zero-terminated strings that contain additional
 ** details about the action to be authorized.
 **
-** An authorizer is used when preparing SQL statements from an untrusted
-** source, to ensure that the SQL statements do not try to access data
-** that they are not allowed to see, or that they do not try to
-** execute malicious statements that damage the database.  For
+** An authorizer is used when [sqlite3_prepare | preparing]
+** SQL statements from an untrusted source, to ensure that the SQL statements
+** do not try to access data they are not allowed to see, or that they do not
+** try to execute malicious statements that damage the database.  For
 ** example, an application may allow a user to enter arbitrary
 ** SQL queries for evaluation by a database.  But the application does
 ** not want the user to be able to make arbitrary changes to the
 ** database.  An authorizer could then be put in place while the
-** user-entered SQL is being prepared that disallows everything
-** except SELECT statements.  
+** user-entered SQL is being [sqlite3_prepare | prepared] that
+** disallows everything except [SELECT] statements.
+**
+** Applications that need to process SQL from untrusted sources
+** might also consider lowering resource limits using [sqlite3_limit()]
+** and limiting database size using the [max_page_count] [PRAGMA]
+** in addition to using an authorizer.
 **
 ** Only a single authorizer can be in place on a database connection
 ** at a time.  Each call to sqlite3_set_authorizer overrides the
-** previous call.  A NULL authorizer means that no authorization
-** callback is invoked.  The default authorizer is NULL.
+** previous call.  Disable the authorizer by installing a NULL callback.
+** The authorizer is disabled by default.
 **
-** Note that the authorizer callback is invoked only during 
+** The authorizer callback must not do anything that will modify
+** the database connection that invoked the authorizer callback.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
+**
+** When [sqlite3_prepare_v2()] is used to prepare a statement, the
+** statement might be reprepared during [sqlite3_step()] due to a 
+** schema change.  Hence, the application should ensure that the
+** correct authorizer callback remains in place during the [sqlite3_step()].
+**
+** Note that the authorizer callback is invoked only during
 ** [sqlite3_prepare()] or its variants.  Authorization is not
 ** performed during statement evaluation in [sqlite3_step()].
+**
+** Requirements:
+** [H12501] [H12502] [H12503] [H12504] [H12505] [H12506] [H12507] [H12510]
+** [H12511] [H12512] [H12520] [H12521] [H12522]
 */
 int sqlite3_set_authorizer(
   sqlite3*,
@@ -747,7 +1841,7 @@
 );
 
 /*
-** CAPI3REF: Authorizer Return Codes
+** CAPI3REF: Authorizer Return Codes {H12590} <H12500>
 **
 ** The [sqlite3_set_authorizer | authorizer callback function] must
 ** return either [SQLITE_OK] or one of these two constants in order
@@ -759,23 +1853,26 @@
 #define SQLITE_IGNORE 2   /* Don't allow access, but don't generate an error */
 
 /*
-** CAPI3REF: Authorizer Action Codes
+** CAPI3REF: Authorizer Action Codes {H12550} <H12500>
 **
 ** The [sqlite3_set_authorizer()] interface registers a callback function
-** that is invoked to authorizer certain SQL statement actions.  The
+** that is invoked to authorize certain SQL statement actions.  The
 ** second parameter to the callback is an integer code that specifies
 ** what action is being authorized.  These are the integer action codes that
 ** the authorizer callback may be passed.
 **
-** These action code values signify what kind of operation is to be 
-** authorized.  The 3rd and 4th parameters to the authorization callback
-** function will be parameters or NULL depending on which of these
+** These action code values signify what kind of operation is to be
+** authorized.  The 3rd and 4th parameters to the authorization
+** callback function will be parameters or NULL depending on which of these
 ** codes is used as the second parameter.  The 5th parameter to the
-** authorizer callback is the name of the database ("main", "temp", 
+** authorizer callback is the name of the database ("main", "temp",
 ** etc.) if applicable.  The 6th parameter to the authorizer callback
 ** is the name of the inner-most trigger or view that is responsible for
-** the access attempt or NULL if this access attempt is directly from 
+** the access attempt or NULL if this access attempt is directly from
 ** top-level SQL code.
+**
+** Requirements:
+** [H12551] [H12552] [H12553] [H12554]
 */
 /******************************************* 3rd ************ 4th ***********/
 #define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
@@ -799,7 +1896,7 @@
 #define SQLITE_PRAGMA               19   /* Pragma Name     1st arg or NULL */
 #define SQLITE_READ                 20   /* Table Name      Column Name     */
 #define SQLITE_SELECT               21   /* NULL            NULL            */
-#define SQLITE_TRANSACTION          22   /* NULL            NULL            */
+#define SQLITE_TRANSACTION          22   /* Operation       NULL            */
 #define SQLITE_UPDATE               23   /* Table Name      Column Name     */
 #define SQLITE_ATTACH               24   /* Filename        NULL            */
 #define SQLITE_DETACH               25   /* Database Name   NULL            */
@@ -808,83 +1905,144 @@
 #define SQLITE_ANALYZE              28   /* Table Name      NULL            */
 #define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */
 #define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */
-#define SQLITE_FUNCTION             31   /* Function Name   NULL            */
+#define SQLITE_FUNCTION             31   /* NULL            Function Name   */
+#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */
 #define SQLITE_COPY                  0   /* No longer used */
 
 /*
-** CAPI3REF: Tracing And Profiling Functions
+** CAPI3REF: Tracing And Profiling Functions {H12280} <S60400>
+** EXPERIMENTAL
 **
 ** These routines register callback functions that can be used for
 ** tracing and profiling the execution of SQL statements.
-** The callback function registered by sqlite3_trace() is invoked
-** at the first [sqlite3_step()] for the evaluation of an SQL statement.
-** The callback function registered by sqlite3_profile() is invoked
-** as each SQL statement finishes and includes
-** information on how long that statement ran.
 **
-** The sqlite3_profile() API is currently considered experimental and
-** is subject to change.
+** The callback function registered by sqlite3_trace() is invoked at
+** various times when an SQL statement is being run by [sqlite3_step()].
+** The callback returns a UTF-8 rendering of the SQL statement text
+** as the statement first begins executing.  Additional callbacks occur
+** as each triggered subprogram is entered.  The callbacks for triggers
+** contain a UTF-8 SQL comment that identifies the trigger.
+**
+** The callback function registered by sqlite3_profile() is invoked
+** as each SQL statement finishes.  The profile callback contains
+** the original statement text and an estimate of wall-clock time
+** of how long that statement took to run.
+**
+** Requirements:
+** [H12281] [H12282] [H12283] [H12284] [H12285] [H12287] [H12288] [H12289]
+** [H12290]
 */
-void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
-void *sqlite3_profile(sqlite3*,
-   void(*xProfile)(void*,const char*,sqlite_uint64), void*);
+SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
+SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
+   void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
 
 /*
-** CAPI3REF: Query Progress Callbacks
+** CAPI3REF: Query Progress Callbacks {H12910} <S60400>
 **
-** This routine configures a callback function - the progress callback - that
-** is invoked periodically during long running calls to [sqlite3_exec()],
-** [sqlite3_step()] and [sqlite3_get_table()].  An example use for this 
+** This routine configures a callback function - the
+** progress callback - that is invoked periodically during long
+** running calls to [sqlite3_exec()], [sqlite3_step()] and
+** [sqlite3_get_table()].  An example use for this
 ** interface is to keep a GUI updated during a large query.
 **
-** The progress callback is invoked once for every N virtual machine opcodes,
-** where N is the second argument to this function. The progress callback
-** itself is identified by the third argument to this function. The fourth
-** argument to this function is a void pointer passed to the progress callback
-** function each time it is invoked.
+** If the progress callback returns non-zero, the operation is
+** interrupted.  This feature can be used to implement a
+** "Cancel" button on a GUI progress dialog box.
 **
-** If a call to [sqlite3_exec()], [sqlite3_step()], or [sqlite3_get_table()]
-** results in fewer than N opcodes being executed, then the progress 
-** callback is never invoked.
-** 
-** Only a single progress callback function may be registered for each
-** open database connection.  Every call to sqlite3_progress_handler()
-** overwrites the results of the previous call.
-** To remove the progress callback altogether, pass NULL as the third
-** argument to this function.
+** The progress handler must not do anything that will modify
+** the database connection that invoked the progress handler.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
 **
-** If the progress callback returns a result other than 0, then the current 
-** query is immediately terminated and any database changes rolled back.
-** The containing [sqlite3_exec()], [sqlite3_step()], or
-** [sqlite3_get_table()] call returns SQLITE_INTERRUPT.   This feature
-** can be used, for example, to implement the "Cancel" button on a
-** progress dialog box in a GUI.
+** Requirements:
+** [H12911] [H12912] [H12913] [H12914] [H12915] [H12916] [H12917] [H12918]
+**
 */
 void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
 
 /*
-** CAPI3REF: Opening A New Database Connection
+** CAPI3REF: Opening A New Database Connection {H12700} <S40200>
 **
-** Open the sqlite database file "filename".  The "filename" is UTF-8
-** encoded for sqlite3_open() and UTF-16 encoded in the native byte order
-** for sqlite3_open16().  An [sqlite3*] handle is returned in *ppDb, even
-** if an error occurs. If the database is opened (or created) successfully,
-** then SQLITE_OK is returned. Otherwise an error code is returned. The
-** sqlite3_errmsg() or sqlite3_errmsg16()  routines can be used to obtain
+** These routines open an SQLite database file whose name is given by the
+** filename argument. The filename argument is interpreted as UTF-8 for
+** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
+** order for sqlite3_open16(). A [database connection] handle is usually
+** returned in *ppDb, even if an error occurs.  The only exception is that
+** if SQLite is unable to allocate memory to hold the [sqlite3] object,
+** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]
+** object. If the database is opened (and/or created) successfully, then
+** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.  The
+** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain
 ** an English language description of the error.
 **
-** If the database file does not exist, then a new database will be created
-** as needed.  The default encoding for the database will be UTF-8 if
-** sqlite3_open() is called and UTF-16 if sqlite3_open16 is used.
+** The default encoding for the database will be UTF-8 if
+** sqlite3_open() or sqlite3_open_v2() is called and
+** UTF-16 in the native byte order if sqlite3_open16() is used.
 **
-** Whether or not an error occurs when it is opened, resources associated
-** with the [sqlite3*] handle should be released by passing it to
-** sqlite3_close() when it is no longer required.
+** Whether or not an error occurs when it is opened, resources
+** associated with the [database connection] handle should be released by
+** passing it to [sqlite3_close()] when it is no longer required.
 **
-** Note to windows users:  The encoding used for the filename argument
-** of sqlite3_open() must be UTF-8, not whatever codepage is currently
-** defined.  Filenames containing international characters must be converted
-** to UTF-8 prior to passing them into sqlite3_open().
+** The sqlite3_open_v2() interface works like sqlite3_open()
+** except that it accepts two additional parameters for additional control
+** over the new database connection.  The flags parameter can take one of
+** the following three values, optionally combined with the 
+** [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags:
+**
+** <dl>
+** <dt>[SQLITE_OPEN_READONLY]</dt>
+** <dd>The database is opened in read-only mode.  If the database does not
+** already exist, an error is returned.</dd>
+**
+** <dt>[SQLITE_OPEN_READWRITE]</dt>
+** <dd>The database is opened for reading and writing if possible, or reading
+** only if the file is write protected by the operating system.  In either
+** case the database must already exist, otherwise an error is returned.</dd>
+**
+** <dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>
+** <dd>The database is opened for reading and writing, and is creates it if
+** it does not already exist. This is the behavior that is always used for
+** sqlite3_open() and sqlite3_open16().</dd>
+** </dl>
+**
+** If the 3rd parameter to sqlite3_open_v2() is not one of the
+** combinations shown above or one of the combinations shown above combined
+** with the [SQLITE_OPEN_NOMUTEX] or [SQLITE_OPEN_FULLMUTEX] flags,
+** then the behavior is undefined.
+**
+** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection
+** opens in the multi-thread [threading mode] as long as the single-thread
+** mode has not been set at compile-time or start-time.  If the
+** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens
+** in the serialized [threading mode] unless single-thread was
+** previously selected at compile-time or start-time.
+**
+** If the filename is ":memory:", then a private, temporary in-memory database
+** is created for the connection.  This in-memory database will vanish when
+** the database connection is closed.  Future versions of SQLite might
+** make use of additional special filenames that begin with the ":" character.
+** It is recommended that when a database filename actually does begin with
+** a ":" character you should prefix the filename with a pathname such as
+** "./" to avoid ambiguity.
+**
+** If the filename is an empty string, then a private, temporary
+** on-disk database will be created.  This private database will be
+** automatically deleted as soon as the database connection is closed.
+**
+** The fourth parameter to sqlite3_open_v2() is the name of the
+** [sqlite3_vfs] object that defines the operating system interface that
+** the new database connection should use.  If the fourth parameter is
+** a NULL pointer then the default [sqlite3_vfs] object is used.
+**
+** <b>Note to Windows users:</b>  The encoding used for the filename argument
+** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever
+** codepage is currently defined.  Filenames containing international
+** characters must be converted to UTF-8 prior to passing them into
+** sqlite3_open() or sqlite3_open_v2().
+**
+** Requirements:
+** [H12701] [H12702] [H12703] [H12704] [H12706] [H12707] [H12709] [H12711]
+** [H12712] [H12713] [H12714] [H12717] [H12719] [H12721] [H12723]
 */
 int sqlite3_open(
   const char *filename,   /* Database filename (UTF-8) */
@@ -894,53 +2052,69 @@
   const void *filename,   /* Database filename (UTF-16) */
   sqlite3 **ppDb          /* OUT: SQLite db handle */
 );
+int sqlite3_open_v2(
+  const char *filename,   /* Database filename (UTF-8) */
+  sqlite3 **ppDb,         /* OUT: SQLite db handle */
+  int flags,              /* Flags */
+  const char *zVfs        /* Name of VFS module to use */
+);
 
 /*
-** CAPI3REF: Error Codes And Messages
+** CAPI3REF: Error Codes And Messages {H12800} <S60200>
 **
-** The sqlite3_errcode() interface returns the numeric
-** [SQLITE_OK | result code] or [SQLITE_IOERR_READ | extended result code]
-** for the most recent failed sqlite3_* API call associated
-** with [sqlite3] handle 'db'.  If a prior API call failed but the
-** most recent API call succeeded, the return value from sqlite3_errcode()
-** is undefined. 
+** The sqlite3_errcode() interface returns the numeric [result code] or
+** [extended result code] for the most recent failed sqlite3_* API call
+** associated with a [database connection]. If a prior API call failed
+** but the most recent API call succeeded, the return value from
+** sqlite3_errcode() is undefined.  The sqlite3_extended_errcode()
+** interface is the same except that it always returns the 
+** [extended result code] even when extended result codes are
+** disabled.
 **
-** The sqlite3_errmsg() and sqlite3_errmsg16() return English-langauge
-** text that describes the error, as either UTF8 or UTF16 respectively.
-** Memory to hold the error message string is managed internally.  The 
-** string may be overwritten or deallocated by subsequent calls to SQLite
-** interface functions.
+** The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
+** text that describes the error, as either UTF-8 or UTF-16 respectively.
+** Memory to hold the error message string is managed internally.
+** The application does not need to worry about freeing the result.
+** However, the error string might be overwritten or deallocated by
+** subsequent calls to other SQLite interface functions.
 **
-** Calls to many sqlite3_* functions set the error code and string returned
-** by [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()]
-** (overwriting the previous values). Note that calls to [sqlite3_errcode()],
-** [sqlite3_errmsg()], and [sqlite3_errmsg16()] themselves do not affect the
-** results of future invocations.  Calls to API routines that do not return
-** an error code (examples: [sqlite3_data_count()] or [sqlite3_mprintf()]) do
-** not change the error code returned by this routine.
+** When the serialized [threading mode] is in use, it might be the
+** case that a second error occurs on a separate thread in between
+** the time of the first error and the call to these interfaces.
+** When that happens, the second error will be reported since these
+** interfaces always report the most recent result.  To avoid
+** this, each thread can obtain exclusive use of the [database connection] D
+** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
+** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
+** all calls to the interfaces listed here are completed.
 **
-** Assuming no other intervening sqlite3_* API calls are made, the error
-** code returned by this function is associated with the same error as
-** the strings returned by [sqlite3_errmsg()] and [sqlite3_errmsg16()].
+** If an interface fails with SQLITE_MISUSE, that means the interface
+** was invoked incorrectly by the application.  In that case, the
+** error code and message may or may not be set.
+**
+** Requirements:
+** [H12801] [H12802] [H12803] [H12807] [H12808] [H12809]
 */
 int sqlite3_errcode(sqlite3 *db);
+int sqlite3_extended_errcode(sqlite3 *db);
 const char *sqlite3_errmsg(sqlite3*);
 const void *sqlite3_errmsg16(sqlite3*);
 
 /*
-** CAPI3REF: SQL Statement Object
+** CAPI3REF: SQL Statement Object {H13000} <H13010>
+** KEYWORDS: {prepared statement} {prepared statements}
 **
-** Instance of this object represent single SQL statements.  This
-** is variously known as a "prepared statement" or a 
+** An instance of this object represents a single SQL statement.
+** This object is variously known as a "prepared statement" or a
 ** "compiled SQL statement" or simply as a "statement".
-** 
+**
 ** The life of a statement object goes something like this:
 **
 ** <ol>
 ** <li> Create the object using [sqlite3_prepare_v2()] or a related
 **      function.
-** <li> Bind values to host parameters using
-**      [sqlite3_bind_blob | sqlite3_bind_* interfaces].
+** <li> Bind values to [host parameters] using the sqlite3_bind_*()
+**      interfaces.
 ** <li> Run the SQL by calling [sqlite3_step()] one or more times.
 ** <li> Reset the statement using [sqlite3_reset()] then go back
 **      to step 2.  Do this zero or more times.
@@ -953,41 +2127,145 @@
 typedef struct sqlite3_stmt sqlite3_stmt;
 
 /*
-** CAPI3REF: Compiling An SQL Statement
+** CAPI3REF: Run-time Limits {H12760} <S20600>
+**
+** This interface allows the size of various constructs to be limited
+** on a connection by connection basis.  The first parameter is the
+** [database connection] whose limit is to be set or queried.  The
+** second parameter is one of the [limit categories] that define a
+** class of constructs to be size limited.  The third parameter is the
+** new limit for that construct.  The function returns the old limit.
+**
+** If the new limit is a negative number, the limit is unchanged.
+** For the limit category of SQLITE_LIMIT_XYZ there is a 
+** [limits | hard upper bound]
+** set by a compile-time C preprocessor macro named 
+** [limits | SQLITE_MAX_XYZ].
+** (The "_LIMIT_" in the name is changed to "_MAX_".)
+** Attempts to increase a limit above its hard upper bound are
+** silently truncated to the hard upper limit.
+**
+** Run time limits are intended for use in applications that manage
+** both their own internal database and also databases that are controlled
+** by untrusted external sources.  An example application might be a
+** web browser that has its own databases for storing history and
+** separate databases controlled by JavaScript applications downloaded
+** off the Internet.  The internal databases can be given the
+** large, default limits.  Databases managed by external sources can
+** be given much smaller limits designed to prevent a denial of service
+** attack.  Developers might also want to use the [sqlite3_set_authorizer()]
+** interface to further control untrusted SQL.  The size of the database
+** created by an untrusted script can be contained using the
+** [max_page_count] [PRAGMA].
+**
+** New run-time limit categories may be added in future releases.
+**
+** Requirements:
+** [H12762] [H12766] [H12769]
+*/
+int sqlite3_limit(sqlite3*, int id, int newVal);
+
+/*
+** CAPI3REF: Run-Time Limit Categories {H12790} <H12760>
+** KEYWORDS: {limit category} {limit categories}
+**
+** These constants define various performance limits
+** that can be lowered at run-time using [sqlite3_limit()].
+** The synopsis of the meanings of the various limits is shown below.
+** Additional information is available at [limits | Limits in SQLite].
+**
+** <dl>
+** <dt>SQLITE_LIMIT_LENGTH</dt>
+** <dd>The maximum size of any string or BLOB or table row.<dd>
+**
+** <dt>SQLITE_LIMIT_SQL_LENGTH</dt>
+** <dd>The maximum length of an SQL statement.</dd>
+**
+** <dt>SQLITE_LIMIT_COLUMN</dt>
+** <dd>The maximum number of columns in a table definition or in the
+** result set of a [SELECT] or the maximum number of columns in an index
+** or in an ORDER BY or GROUP BY clause.</dd>
+**
+** <dt>SQLITE_LIMIT_EXPR_DEPTH</dt>
+** <dd>The maximum depth of the parse tree on any expression.</dd>
+**
+** <dt>SQLITE_LIMIT_COMPOUND_SELECT</dt>
+** <dd>The maximum number of terms in a compound SELECT statement.</dd>
+**
+** <dt>SQLITE_LIMIT_VDBE_OP</dt>
+** <dd>The maximum number of instructions in a virtual machine program
+** used to implement an SQL statement.</dd>
+**
+** <dt>SQLITE_LIMIT_FUNCTION_ARG</dt>
+** <dd>The maximum number of arguments on a function.</dd>
+**
+** <dt>SQLITE_LIMIT_ATTACHED</dt>
+** <dd>The maximum number of [ATTACH | attached databases].</dd>
+**
+** <dt>SQLITE_LIMIT_LIKE_PATTERN_LENGTH</dt>
+** <dd>The maximum length of the pattern argument to the [LIKE] or
+** [GLOB] operators.</dd>
+**
+** <dt>SQLITE_LIMIT_VARIABLE_NUMBER</dt>
+** <dd>The maximum number of variables in an SQL statement that can
+** be bound.</dd>
+** </dl>
+*/
+#define SQLITE_LIMIT_LENGTH                    0
+#define SQLITE_LIMIT_SQL_LENGTH                1
+#define SQLITE_LIMIT_COLUMN                    2
+#define SQLITE_LIMIT_EXPR_DEPTH                3
+#define SQLITE_LIMIT_COMPOUND_SELECT           4
+#define SQLITE_LIMIT_VDBE_OP                   5
+#define SQLITE_LIMIT_FUNCTION_ARG              6
+#define SQLITE_LIMIT_ATTACHED                  7
+#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH       8
+#define SQLITE_LIMIT_VARIABLE_NUMBER           9
+
+/*
+** CAPI3REF: Compiling An SQL Statement {H13010} <S10000>
+** KEYWORDS: {SQL statement compiler}
 **
 ** To execute an SQL query, it must first be compiled into a byte-code
-** program using one of these routines. 
+** program using one of these routines.
 **
-** The first argument "db" is an [sqlite3 | SQLite database handle] 
-** obtained from a prior call to [sqlite3_open()] or [sqlite3_open16()].
-** The second argument "zSql" is the statement to be compiled, encoded
+** The first argument, "db", is a [database connection] obtained from a
+** prior call to [sqlite3_open()], [sqlite3_open_v2()] or [sqlite3_open16()].
+**
+** The second argument, "zSql", is the statement to be compiled, encoded
 ** as either UTF-8 or UTF-16.  The sqlite3_prepare() and sqlite3_prepare_v2()
-** interfaces uses UTF-8 and sqlite3_prepare16() and sqlite3_prepare16_v2()
-** use UTF-16. If the next argument, "nBytes", is less
-** than zero, then zSql is read up to the first zero terminator.  If
-** "nBytes" is not less than zero, then it is the length of the string zSql
-** in bytes (not characters).
+** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2()
+** use UTF-16.
 **
-** *pzTail is made to point to the first byte past the end of the first
-** SQL statement in zSql.  This routine only compiles the first statement
-** in zSql, so *pzTail is left pointing to what remains uncompiled.
+** If the nByte argument is less than zero, then zSql is read up to the
+** first zero terminator. If nByte is non-negative, then it is the maximum
+** number of  bytes read from zSql.  When nByte is non-negative, the
+** zSql string ends at either the first '\000' or '\u0000' character or
+** the nByte-th byte, whichever comes first. If the caller knows
+** that the supplied string is nul-terminated, then there is a small
+** performance advantage to be gained by passing an nByte parameter that
+** is equal to the number of bytes in the input string <i>including</i>
+** the nul-terminator bytes.
 **
-** *ppStmt is left pointing to a compiled 
-** [sqlite3_stmt | SQL statement structure] that can be
-** executed using [sqlite3_step()].  Or if there is an error, *ppStmt may be
-** set to NULL.  If the input text contained no SQL (if the input is and
-** empty string or a comment) then *ppStmt is set to NULL.  The calling
-** procedure is responsible for deleting the compiled SQL statement
-** using [sqlite3_finalize()] after it has finished with it.
+** *pzTail is made to point to the first byte past the end of the
+** first SQL statement in zSql.  These routines only compile the first
+** statement in zSql, so *pzTail is left pointing to what remains
+** uncompiled.
 **
-** On success, [SQLITE_OK] is returned.  Otherwise an 
-** [SQLITE_ERROR | error code] is returned.
+** *ppStmt is left pointing to a compiled [prepared statement] that can be
+** executed using [sqlite3_step()].  If there is an error, *ppStmt is set
+** to NULL.  If the input text contains no SQL (if the input is an empty
+** string or a comment) then *ppStmt is set to NULL.
+** {A13018} The calling procedure is responsible for deleting the compiled
+** SQL statement using [sqlite3_finalize()] after it has finished with it.
+**
+** On success, [SQLITE_OK] is returned, otherwise an [error code] is returned.
 **
 ** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are
 ** recommended for all new programs. The two older interfaces are retained
 ** for backwards compatibility, but their use is discouraged.
 ** In the "v2" interfaces, the prepared statement
-** that is returned (the [sqlite3_stmt] object) contains a copy of the 
+** that is returned (the [sqlite3_stmt] object) contains a copy of the
 ** original SQL text. This causes the [sqlite3_step()] interface to
 ** behave a differently in two ways:
 **
@@ -995,135 +2273,181 @@
 ** <li>
 ** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
 ** always used to do, [sqlite3_step()] will automatically recompile the SQL
-** statement and try to run it again.  If the schema has changed in a way
-** that makes the statement no longer valid, [sqlite3_step()] will still
+** statement and try to run it again.  If the schema has changed in
+** a way that makes the statement no longer valid, [sqlite3_step()] will still
 ** return [SQLITE_SCHEMA].  But unlike the legacy behavior, [SQLITE_SCHEMA] is
 ** now a fatal error.  Calling [sqlite3_prepare_v2()] again will not make the
-** error go away.  Note: use [sqlite3_errmsg()] to find the text of the parsing
-** error that results in an [SQLITE_SCHEMA] return.
+** error go away.  Note: use [sqlite3_errmsg()] to find the text
+** of the parsing error that results in an [SQLITE_SCHEMA] return.
 ** </li>
 **
 ** <li>
-** When an error occurs, 
-** [sqlite3_step()] will return one of the detailed 
-** [SQLITE_ERROR | result codes] or
-** [SQLITE_IOERR_READ | extended result codes] such as directly.
-** The legacy behavior was that [sqlite3_step()] would only return a generic
-** [SQLITE_ERROR] result code and you would have to make a second call to
-** [sqlite3_reset()] in order to find the underlying cause of the problem.
-** With the "v2" prepare interfaces, the underlying reason for the error is
-** returned immediately.
+** When an error occurs, [sqlite3_step()] will return one of the detailed
+** [error codes] or [extended error codes].  The legacy behavior was that
+** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
+** and you would have to make a second call to [sqlite3_reset()] in order
+** to find the underlying cause of the problem. With the "v2" prepare
+** interfaces, the underlying reason for the error is returned immediately.
 ** </li>
 ** </ol>
+**
+** Requirements:
+** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021]
+**
 */
 int sqlite3_prepare(
   sqlite3 *db,            /* Database handle */
   const char *zSql,       /* SQL statement, UTF-8 encoded */
-  int nBytes,             /* Length of zSql in bytes. */
+  int nByte,              /* Maximum length of zSql in bytes. */
   sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
   const char **pzTail     /* OUT: Pointer to unused portion of zSql */
 );
 int sqlite3_prepare_v2(
   sqlite3 *db,            /* Database handle */
   const char *zSql,       /* SQL statement, UTF-8 encoded */
-  int nBytes,             /* Length of zSql in bytes. */
+  int nByte,              /* Maximum length of zSql in bytes. */
   sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
   const char **pzTail     /* OUT: Pointer to unused portion of zSql */
 );
 int sqlite3_prepare16(
   sqlite3 *db,            /* Database handle */
   const void *zSql,       /* SQL statement, UTF-16 encoded */
-  int nBytes,             /* Length of zSql in bytes. */
+  int nByte,              /* Maximum length of zSql in bytes. */
   sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
   const void **pzTail     /* OUT: Pointer to unused portion of zSql */
 );
 int sqlite3_prepare16_v2(
   sqlite3 *db,            /* Database handle */
   const void *zSql,       /* SQL statement, UTF-16 encoded */
-  int nBytes,             /* Length of zSql in bytes. */
+  int nByte,              /* Maximum length of zSql in bytes. */
   sqlite3_stmt **ppStmt,  /* OUT: Statement handle */
   const void **pzTail     /* OUT: Pointer to unused portion of zSql */
 );
 
 /*
-** CAPI3REF:  Dynamically Typed Value Object
+** CAPI3REF: Retrieving Statement SQL {H13100} <H13000>
 **
-** SQLite uses dynamic typing for the values it stores.  Values can 
-** be integers, floating point values, strings, BLOBs, or NULL.  When
-** passing around values internally, each value is represented as
-** an instance of the sqlite3_value object.
+** This interface can be used to retrieve a saved copy of the original
+** SQL text used to create a [prepared statement] if that statement was
+** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].
+**
+** Requirements:
+** [H13101] [H13102] [H13103]
+*/
+const char *sqlite3_sql(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Dynamically Typed Value Object {H15000} <S20200>
+** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
+**
+** SQLite uses the sqlite3_value object to represent all values
+** that can be stored in a database table. SQLite uses dynamic typing
+** for the values it stores. Values stored in sqlite3_value objects
+** can be integers, floating point values, strings, BLOBs, or NULL.
+**
+** An sqlite3_value object may be either "protected" or "unprotected".
+** Some interfaces require a protected sqlite3_value.  Other interfaces
+** will accept either a protected or an unprotected sqlite3_value.
+** Every interface that accepts sqlite3_value arguments specifies
+** whether or not it requires a protected sqlite3_value.
+**
+** The terms "protected" and "unprotected" refer to whether or not
+** a mutex is held.  A internal mutex is held for a protected
+** sqlite3_value object but no mutex is held for an unprotected
+** sqlite3_value object.  If SQLite is compiled to be single-threaded
+** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0)
+** or if SQLite is run in one of reduced mutex modes 
+** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD]
+** then there is no distinction between protected and unprotected
+** sqlite3_value objects and they can be used interchangeably.  However,
+** for maximum code portability it is recommended that applications
+** still make the distinction between between protected and unprotected
+** sqlite3_value objects even when not strictly required.
+**
+** The sqlite3_value objects that are passed as parameters into the
+** implementation of [application-defined SQL functions] are protected.
+** The sqlite3_value object returned by
+** [sqlite3_column_value()] is unprotected.
+** Unprotected sqlite3_value objects may only be used with
+** [sqlite3_result_value()] and [sqlite3_bind_value()].
+** The [sqlite3_value_blob | sqlite3_value_type()] family of
+** interfaces require protected sqlite3_value objects.
 */
 typedef struct Mem sqlite3_value;
 
 /*
-** CAPI3REF:  SQL Function Context Object
+** CAPI3REF: SQL Function Context Object {H16001} <S20200>
 **
 ** The context in which an SQL function executes is stored in an
-** sqlite3_context object.  A pointer to such an object is the
-** first parameter to user-defined SQL functions.
+** sqlite3_context object.  A pointer to an sqlite3_context object
+** is always first parameter to [application-defined SQL functions].
+** The application-defined SQL function implementation will pass this
+** pointer through into calls to [sqlite3_result_int | sqlite3_result()],
+** [sqlite3_aggregate_context()], [sqlite3_user_data()],
+** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
+** and/or [sqlite3_set_auxdata()].
 */
 typedef struct sqlite3_context sqlite3_context;
 
 /*
-** CAPI3REF:  Binding Values To Prepared Statements
+** CAPI3REF: Binding Values To Prepared Statements {H13500} <S70300>
+** KEYWORDS: {host parameter} {host parameters} {host parameter name}
+** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
 **
 ** In the SQL strings input to [sqlite3_prepare_v2()] and its variants,
-** one or more literals can be replace by a parameter in one of these
-** forms:
+** literals may be replaced by a [parameter] in one of these forms:
 **
 ** <ul>
 ** <li>  ?
 ** <li>  ?NNN
-** <li>  :AAA
-** <li>  @AAA
+** <li>  :VVV
+** <li>  @VVV
 ** <li>  $VVV
 ** </ul>
 **
 ** In the parameter forms shown above NNN is an integer literal,
-** AAA is an alphanumeric identifier and VVV is a variable name according
-** to the syntax rules of the TCL programming language.
-** The values of these parameters (also called "host parameter names")
+** and VVV is an alpha-numeric parameter name. The values of these
+** parameters (also called "host parameter names" or "SQL parameters")
 ** can be set using the sqlite3_bind_*() routines defined here.
 **
-** The first argument to the sqlite3_bind_*() routines always is a pointer
-** to the [sqlite3_stmt] object returned from [sqlite3_prepare_v2()] or
-** its variants.  The second
-** argument is the index of the parameter to be set.  The first parameter has
-** an index of 1. When the same named parameter is used more than once, second
-** and subsequent
-** occurrences have the same index as the first occurrence.  The index for
-** named parameters can be looked up using the
-** [sqlite3_bind_parameter_name()] API if desired.  The index for "?NNN"
-** parametes is the value of NNN.
-** The NNN value must be between 1 and the compile-time
-** parameter SQLITE_MAX_VARIABLE_NUMBER (default value: 999).
-** See <a href="limits.html">limits.html</a> for additional information.
+** The first argument to the sqlite3_bind_*() routines is always
+** a pointer to the [sqlite3_stmt] object returned from
+** [sqlite3_prepare_v2()] or its variants.
+**
+** The second argument is the index of the SQL parameter to be set.
+** The leftmost SQL parameter has an index of 1.  When the same named
+** SQL parameter is used more than once, second and subsequent
+** occurrences have the same index as the first occurrence.
+** The index for named parameters can be looked up using the
+** [sqlite3_bind_parameter_index()] API if desired.  The index
+** for "?NNN" parameters is the value of NNN.
+** The NNN value must be between 1 and the [sqlite3_limit()]
+** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999).
 **
 ** The third argument is the value to bind to the parameter.
 **
-** In those
-** routines that have a fourth argument, its value is the number of bytes
-** in the parameter.  To be clear: the value is the number of bytes in the
-** string, not the number of characters.  The number
-** of bytes does not include the zero-terminator at the end of strings.
+** In those routines that have a fourth argument, its value is the
+** number of bytes in the parameter.  To be clear: the value is the
+** number of <u>bytes</u> in the value, not the number of characters.
 ** If the fourth parameter is negative, the length of the string is
-** number of bytes up to the first zero terminator.
+** the number of bytes up to the first zero terminator.
 **
 ** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and
 ** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
-** text after SQLite has finished with it.  If the fifth argument is the
-** special value [SQLITE_STATIC], then the library assumes that the information
-** is in static, unmanaged space and does not need to be freed.  If the
-** fifth argument has the value [SQLITE_TRANSIENT], then SQLite makes its
-** own private copy of the data immediately, before the sqlite3_bind_*()
-** routine returns.
+** string after SQLite has finished with it. If the fifth argument is
+** the special value [SQLITE_STATIC], then SQLite assumes that the
+** information is in static, unmanaged space and does not need to be freed.
+** If the fifth argument has the value [SQLITE_TRANSIENT], then
+** SQLite makes its own private copy of the data immediately, before
+** the sqlite3_bind_*() routine returns.
 **
-** The sqlite3_bind_zeroblob() routine binds a BLOB of length n that
-** is filled with zeros.  A zeroblob uses a fixed amount of memory
-** (just an integer to hold it size) while it is being processed.
-** Zeroblobs are intended to serve as place-holders for BLOBs whose
-** content is later written using 
-** [sqlite3_blob_open | increment BLOB I/O] routines.
+** The sqlite3_bind_zeroblob() routine binds a BLOB of length N that
+** is filled with zeroes.  A zeroblob uses a fixed amount of memory
+** (just an integer to hold its size) while it is being processed.
+** Zeroblobs are intended to serve as placeholders for BLOBs whose
+** content is later written using
+** [sqlite3_blob_open | incremental BLOB I/O] routines.
+** A negative value for the zeroblob results in a zero-length BLOB.
 **
 ** The sqlite3_bind_*() routines must be called after
 ** [sqlite3_prepare_v2()] (and its variants) or [sqlite3_reset()] and
@@ -1133,14 +2457,26 @@
 **
 ** These routines return [SQLITE_OK] on success or an error code if
 ** anything goes wrong.  [SQLITE_RANGE] is returned if the parameter
-** index is out of range.  [SQLITE_NOMEM] is returned if malloc fails.
-** [SQLITE_MISUSE] is returned if these routines are called on a virtual
-** machine that is the wrong state or which has already been finalized.
+** index is out of range.  [SQLITE_NOMEM] is returned if malloc() fails.
+** [SQLITE_MISUSE] might be returned if these routines are called on a
+** virtual machine that is the wrong state or which has already been finalized.
+** Detection of misuse is unreliable.  Applications should not depend
+** on SQLITE_MISUSE returns.  SQLITE_MISUSE is intended to indicate a
+** a logic error in the application.  Future versions of SQLite might
+** panic rather than return SQLITE_MISUSE.
+**
+** See also: [sqlite3_bind_parameter_count()],
+** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
+**
+** Requirements:
+** [H13506] [H13509] [H13512] [H13515] [H13518] [H13521] [H13524] [H13527]
+** [H13530] [H13533] [H13536] [H13539] [H13542] [H13545] [H13548] [H13551]
+**
 */
 int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
 int sqlite3_bind_double(sqlite3_stmt*, int, double);
 int sqlite3_bind_int(sqlite3_stmt*, int, int);
-int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite_int64);
+int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
 int sqlite3_bind_null(sqlite3_stmt*, int);
 int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
 int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
@@ -1148,116 +2484,175 @@
 int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
 
 /*
-** CAPI3REF: Number Of Host Parameters
+** CAPI3REF: Number Of SQL Parameters {H13600} <S70300>
 **
-** Return the largest host parameter index in the precompiled statement given
-** as the argument.  When the host parameters are of the forms like ":AAA"
-** or "?", then they are assigned sequential increasing numbers beginning
-** with one, so the value returned is the number of parameters.  However
-** if the same host parameter name is used multiple times, each occurrance
-** is given the same number, so the value returned in that case is the number
-** of unique host parameter names.  If host parameters of the form "?NNN"
-** are used (where NNN is an integer) then there might be gaps in the
-** numbering and the value returned by this interface is the index of the
-** host parameter with the largest index value.
+** This routine can be used to find the number of [SQL parameters]
+** in a [prepared statement].  SQL parameters are tokens of the
+** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as
+** placeholders for values that are [sqlite3_bind_blob | bound]
+** to the parameters at a later time.
+**
+** This routine actually returns the index of the largest (rightmost)
+** parameter. For all forms except ?NNN, this will correspond to the
+** number of unique parameters.  If parameters of the ?NNN are used,
+** there may be gaps in the list.
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_name()], and
+** [sqlite3_bind_parameter_index()].
+**
+** Requirements:
+** [H13601]
 */
 int sqlite3_bind_parameter_count(sqlite3_stmt*);
 
 /*
-** CAPI3REF: Name Of A Host Parameter
+** CAPI3REF: Name Of A Host Parameter {H13620} <S70300>
 **
-** This routine returns a pointer to the name of the n-th parameter in a 
-** [sqlite3_stmt | prepared statement].
-** Host parameters of the form ":AAA" or "@AAA" or "$VVV" have a name
-** which is the string ":AAA" or "@AAA" or "$VVV".  
-** In other words, the initial ":" or "$" or "@"
+** This routine returns a pointer to the name of the n-th
+** [SQL parameter] in a [prepared statement].
+** SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA"
+** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA"
+** respectively.
+** In other words, the initial ":" or "$" or "@" or "?"
 ** is included as part of the name.
-** Parameters of the form "?" or "?NNN" have no name.
+** Parameters of the form "?" without a following integer have no name
+** and are also referred to as "anonymous parameters".
 **
-** The first bound parameter has an index of 1, not 0.
+** The first host parameter has an index of 1, not 0.
 **
-** If the value n is out of range or if the n-th parameter is nameless,
-** then NULL is returned.  The returned string is always in the
-** UTF-8 encoding even if the named parameter was originally specified
-** as UTF-16 in [sqlite3_prepare16()] or [sqlite3_prepare16_v2()].
+** If the value n is out of range or if the n-th parameter is
+** nameless, then NULL is returned.  The returned string is
+** always in UTF-8 encoding even if the named parameter was
+** originally specified as UTF-16 in [sqlite3_prepare16()] or
+** [sqlite3_prepare16_v2()].
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_count()], and
+** [sqlite3_bind_parameter_index()].
+**
+** Requirements:
+** [H13621]
 */
 const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
 
 /*
-** CAPI3REF: Index Of A Parameter With A Given Name
+** CAPI3REF: Index Of A Parameter With A Given Name {H13640} <S70300>
 **
-** This routine returns the index of a host parameter with the given name.
-** The name must match exactly.  If no parameter with the given name is 
-** found, return 0.  Parameter names must be UTF8.
+** Return the index of an SQL parameter given its name.  The
+** index value returned is suitable for use as the second
+** parameter to [sqlite3_bind_blob|sqlite3_bind()].  A zero
+** is returned if no matching parameter is found.  The parameter
+** name must be given in UTF-8 even if the original statement
+** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_count()], and
+** [sqlite3_bind_parameter_index()].
+**
+** Requirements:
+** [H13641]
 */
 int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
 
 /*
-** CAPI3REF: Reset All Bindings On A Prepared Statement
+** CAPI3REF: Reset All Bindings On A Prepared Statement {H13660} <S70300>
 **
-** Contrary to the intuition of many, [sqlite3_reset()] does not
-** reset the [sqlite3_bind_blob | bindings] on a 
-** [sqlite3_stmt | prepared statement].  Use this routine to
-** reset all host parameters to NULL.
+** Contrary to the intuition of many, [sqlite3_reset()] does not reset
+** the [sqlite3_bind_blob | bindings] on a [prepared statement].
+** Use this routine to reset all host parameters to NULL.
+**
+** Requirements:
+** [H13661]
 */
 int sqlite3_clear_bindings(sqlite3_stmt*);
 
 /*
-** CAPI3REF: Number Of Columns In A Result Set
+** CAPI3REF: Number Of Columns In A Result Set {H13710} <S10700>
 **
-** Return the number of columns in the result set returned by the 
-** [sqlite3_stmt | compiled SQL statement]. This routine returns 0
-** if pStmt is an SQL statement that does not return data (for 
-** example an UPDATE).
+** Return the number of columns in the result set returned by the
+** [prepared statement]. This routine returns 0 if pStmt is an SQL
+** statement that does not return data (for example an [UPDATE]).
+**
+** Requirements:
+** [H13711]
 */
 int sqlite3_column_count(sqlite3_stmt *pStmt);
 
 /*
-** CAPI3REF: Column Names In A Result Set
+** CAPI3REF: Column Names In A Result Set {H13720} <S10700>
 **
 ** These routines return the name assigned to a particular column
-** in the result set of a SELECT statement.  The sqlite3_column_name()
-** interface returns a pointer to a UTF8 string and sqlite3_column_name16()
-** returns a pointer to a UTF16 string.  The first parameter is the
-** [sqlite_stmt | prepared statement] that implements the SELECT statement.
-** The second parameter is the column number.  The left-most column is
-** number 0.
+** in the result set of a [SELECT] statement.  The sqlite3_column_name()
+** interface returns a pointer to a zero-terminated UTF-8 string
+** and sqlite3_column_name16() returns a pointer to a zero-terminated
+** UTF-16 string.  The first parameter is the [prepared statement]
+** that implements the [SELECT] statement. The second parameter is the
+** column number.  The leftmost column is number 0.
 **
-** The returned string pointer is valid until either the 
-** [sqlite_stmt | prepared statement] is destroyed by [sqlite3_finalize()]
-** or until the next call sqlite3_column_name() or sqlite3_column_name16()
-** on the same column.
+** The returned string pointer is valid until either the [prepared statement]
+** is destroyed by [sqlite3_finalize()] or until the next call to
+** sqlite3_column_name() or sqlite3_column_name16() on the same column.
+**
+** If sqlite3_malloc() fails during the processing of either routine
+** (for example during a conversion from UTF-8 to UTF-16) then a
+** NULL pointer is returned.
+**
+** The name of a result column is the value of the "AS" clause for
+** that column, if there is an AS clause.  If there is no AS clause
+** then the name of the column is unspecified and may change from
+** one release of SQLite to the next.
+**
+** Requirements:
+** [H13721] [H13723] [H13724] [H13725] [H13726] [H13727]
 */
 const char *sqlite3_column_name(sqlite3_stmt*, int N);
 const void *sqlite3_column_name16(sqlite3_stmt*, int N);
 
 /*
-** CAPI3REF: Source Of Data In A Query Result
+** CAPI3REF: Source Of Data In A Query Result {H13740} <S10700>
 **
 ** These routines provide a means to determine what column of what
-** table in which database a result of a SELECT statement comes from.
+** table in which database a result of a [SELECT] statement comes from.
 ** The name of the database or table or column can be returned as
-** either a UTF8 or UTF16 string.  The returned string is valid until
-** the [sqlite3_stmt | prepared statement] is destroyed using
-** [sqlite3_finalize()] or until the same information is requested
-** again about the same column.
+** either a UTF-8 or UTF-16 string.  The _database_ routines return
+** the database name, the _table_ routines return the table name, and
+** the origin_ routines return the column name.
+** The returned string is valid until the [prepared statement] is destroyed
+** using [sqlite3_finalize()] or until the same information is requested
+** again in a different encoding.
 **
-** The first argument to the following calls is a 
-** [sqlite3_stmt | compiled SQL statement].
-** These functions return information about the Nth column returned by 
+** The names returned are the original un-aliased names of the
+** database, table, and column.
+**
+** The first argument to the following calls is a [prepared statement].
+** These functions return information about the Nth column returned by
 ** the statement, where N is the second function argument.
 **
-** If the Nth column returned by the statement is an expression
-** or subquery and is not a column value, then all of these functions
-** return NULL. Otherwise, they return the 
-** name of the attached database, table and column that query result
-** column was extracted from.
+** If the Nth column returned by the statement is an expression or
+** subquery and is not a column value, then all of these functions return
+** NULL.  These routine might also return NULL if a memory allocation error
+** occurs.  Otherwise, they return the name of the attached database, table
+** and column that query result column was extracted from.
 **
-** As with all other SQLite APIs, those postfixed with "16" return UTF-16
-** encoded strings, the other functions return UTF-8.
+** As with all other SQLite APIs, those postfixed with "16" return
+** UTF-16 encoded strings, the other functions return UTF-8. {END}
 **
-** These APIs are only available if the library was compiled with the 
-** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** These APIs are only available if the library was compiled with the
+** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined.
+**
+** {A13751}
+** If two or more threads call one or more of these routines against the same
+** prepared statement and column at the same time then the results are
+** undefined.
+**
+** Requirements:
+** [H13741] [H13742] [H13743] [H13744] [H13745] [H13746] [H13748]
+**
+** If two or more threads call one or more
+** [sqlite3_column_database_name | column metadata interfaces]
+** for the same [prepared statement] and result column
+** at the same time then the results are undefined.
 */
 const char *sqlite3_column_database_name(sqlite3_stmt*,int);
 const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
@@ -1267,26 +2662,26 @@
 const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
 
 /*
-** CAPI3REF: Declared Datatype Of A Query Result
+** CAPI3REF: Declared Datatype Of A Query Result {H13760} <S10700>
 **
-** The first parameter is a [sqlite3_stmt | compiled SQL statement]. 
-** If this statement is a SELECT statement and the Nth column of the 
-** returned result set  of that SELECT is a table column (not an
+** The first parameter is a [prepared statement].
+** If this statement is a [SELECT] statement and the Nth column of the
+** returned result set of that [SELECT] is a table column (not an
 ** expression or subquery) then the declared type of the table
-** column is returned. If the Nth column of the result set is an
+** column is returned.  If the Nth column of the result set is an
 ** expression or subquery, then a NULL pointer is returned.
-** The returned string is always UTF-8 encoded. For example, in
-** the database schema:
+** The returned string is always UTF-8 encoded. {END}
+**
+** For example, given the database schema:
 **
 ** CREATE TABLE t1(c1 VARIANT);
 **
-** And the following statement compiled:
+** and the following statement to be compiled:
 **
 ** SELECT c1 + 1, c1 FROM t1;
 **
-** Then this routine would return the string "VARIANT" for the second
-** result column (i==1), and a NULL pointer for the first result column
-** (i==0).
+** this routine would return the string "VARIANT" for the second result
+** column (i==1), and a NULL pointer for the first result column (i==0).
 **
 ** SQLite uses dynamic run-time typing.  So just because a column
 ** is declared to contain a particular type does not mean that the
@@ -1294,36 +2689,37 @@
 ** strongly typed, but the typing is dynamic not static.  Type
 ** is associated with individual values, not with the containers
 ** used to hold those values.
+**
+** Requirements:
+** [H13761] [H13762] [H13763]
 */
-const char *sqlite3_column_decltype(sqlite3_stmt *, int i);
+const char *sqlite3_column_decltype(sqlite3_stmt*,int);
 const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
 
-/* 
-** CAPI3REF:  Evaluate An SQL Statement
+/*
+** CAPI3REF: Evaluate An SQL Statement {H13200} <S10000>
 **
-** After an [sqlite3_stmt | SQL statement] has been prepared with a call
-** to either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or to one of
-** the legacy interfaces [sqlite3_prepare()] or [sqlite3_prepare16()],
-** then this function must be called one or more times to evaluate the 
-** statement.
+** After a [prepared statement] has been prepared using either
+** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy
+** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function
+** must be called one or more times to evaluate the statement.
 **
-** The details of the behavior of this sqlite3_step() interface depend
+** The details of the behavior of the sqlite3_step() interface depend
 ** on whether the statement was prepared using the newer "v2" interface
 ** [sqlite3_prepare_v2()] and [sqlite3_prepare16_v2()] or the older legacy
 ** interface [sqlite3_prepare()] and [sqlite3_prepare16()].  The use of the
 ** new "v2" interface is recommended for new applications but the legacy
 ** interface will continue to be supported.
 **
-** In the lagacy interface, the return value will be either [SQLITE_BUSY], 
+** In the legacy interface, the return value will be either [SQLITE_BUSY],
 ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE].
-** With the "v2" interface, any of the other [SQLITE_OK | result code]
-** or [SQLITE_IOERR_READ | extended result code] might be returned as
-** well.
+** With the "v2" interface, any of the other [result codes] or
+** [extended result codes] might be returned as well.
 **
 ** [SQLITE_BUSY] means that the database engine was unable to acquire the
-** database locks it needs to do its job.  If the statement is a COMMIT
+** database locks it needs to do its job.  If the statement is a [COMMIT]
 ** or occurs outside of an explicit transaction, then you can retry the
-** statement.  If the statement is not a COMMIT and occurs within a
+** statement.  If the statement is not a [COMMIT] and occurs within a
 ** explicit transaction then you should rollback the transaction before
 ** continuing.
 **
@@ -1332,62 +2728,59 @@
 ** machine without first calling [sqlite3_reset()] to reset the virtual
 ** machine back to its initial state.
 **
-** If the SQL statement being executed returns any data, then 
-** [SQLITE_ROW] is returned each time a new row of data is ready
-** for processing by the caller. The values may be accessed using
-** the [sqlite3_column_int | column access functions].
+** If the SQL statement being executed returns any data, then [SQLITE_ROW]
+** is returned each time a new row of data is ready for processing by the
+** caller. The values may be accessed using the [column access functions].
 ** sqlite3_step() is called again to retrieve the next row of data.
-** 
+**
 ** [SQLITE_ERROR] means that a run-time error (such as a constraint
 ** violation) has occurred.  sqlite3_step() should not be called again on
 ** the VM. More information may be found by calling [sqlite3_errmsg()].
-** With the legacy interface, a more specific error code (example:
+** With the legacy interface, a more specific error code (for example,
 ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth)
 ** can be obtained by calling [sqlite3_reset()] on the
-** [sqlite_stmt | prepared statement].  In the "v2" interface,
+** [prepared statement].  In the "v2" interface,
 ** the more specific error code is returned directly by sqlite3_step().
 **
 ** [SQLITE_MISUSE] means that the this routine was called inappropriately.
-** Perhaps it was called on a [sqlite_stmt | prepared statement] that has
-** already been [sqlite3_finalize | finalized] or on one that had 
+** Perhaps it was called on a [prepared statement] that has
+** already been [sqlite3_finalize | finalized] or on one that had
 ** previously returned [SQLITE_ERROR] or [SQLITE_DONE].  Or it could
 ** be the case that the same database connection is being used by two or
 ** more threads at the same moment in time.
 **
-** <b>Goofy Interface Alert:</b>
-** In the legacy interface, 
-** the sqlite3_step() API always returns a generic error code,
-** [SQLITE_ERROR], following any error other than [SQLITE_BUSY]
-** and [SQLITE_MISUSE].  You must call [sqlite3_reset()] or
-** [sqlite3_finalize()] in order to find one of the specific
-** [SQLITE_ERROR | result codes] that better describes the error.
+** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite3_step()
+** API always returns a generic error code, [SQLITE_ERROR], following any
+** error other than [SQLITE_BUSY] and [SQLITE_MISUSE].  You must call
+** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the
+** specific [error codes] that better describes the error.
 ** We admit that this is a goofy design.  The problem has been fixed
 ** with the "v2" interface.  If you prepare all of your SQL statements
 ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead
-** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()], then the 
-** more specific [SQLITE_ERROR | result codes] are returned directly
+** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
+** then the more specific [error codes] are returned directly
 ** by sqlite3_step().  The use of the "v2" interface is recommended.
+**
+** Requirements:
+** [H13202] [H15304] [H15306] [H15308] [H15310]
 */
 int sqlite3_step(sqlite3_stmt*);
 
 /*
-** CAPI3REF:
+** CAPI3REF: Number of columns in a result set {H13770} <S10700>
 **
-** Return the number of values in the current row of the result set.
+** Returns the number of values in the current row of the result set.
 **
-** After a call to [sqlite3_step()] that returns [SQLITE_ROW], this routine
-** will return the same value as the [sqlite3_column_count()] function.
-** After [sqlite3_step()] has returned an [SQLITE_DONE], [SQLITE_BUSY], or
-** a [SQLITE_ERROR | error code], or before [sqlite3_step()] has been 
-** called on the [sqlite_stmt | prepared statement] for the first time,
-** this routine returns zero.
+** Requirements:
+** [H13771] [H13772]
 */
 int sqlite3_data_count(sqlite3_stmt *pStmt);
 
 /*
-** CAPI3REF: Fundamental Datatypes
+** CAPI3REF: Fundamental Datatypes {H10265} <S10110><S10120>
+** KEYWORDS: SQLITE_TEXT
 **
-** Every value in SQLite has one of five fundamental datatypes:
+** {H10266} Every value in SQLite has one of five fundamental datatypes:
 **
 ** <ul>
 ** <li> 64-bit signed integer
@@ -1395,13 +2788,13 @@
 ** <li> string
 ** <li> BLOB
 ** <li> NULL
-** </ul>
+** </ul> {END}
 **
 ** These constants are codes for each of those types.
 **
 ** Note that the SQLITE_TEXT constant was also used in SQLite version 2
 ** for a completely different meaning.  Software that links against both
-** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT not
+** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not
 ** SQLITE_TEXT.
 */
 #define SQLITE_INTEGER  1
@@ -1416,21 +2809,31 @@
 #define SQLITE3_TEXT     3
 
 /*
-** CAPI3REF: Results Values From A Query
+** CAPI3REF: Result Values From A Query {H13800} <S10700>
+** KEYWORDS: {column access functions}
 **
-** These routines return information about the information
-** in a single column of the current result row of a query.  In every
-** case the first argument is a pointer to the 
-** [sqlite3_stmt | SQL statement] that is being
-** evaluate (the [sqlite_stmt*] that was returned from 
-** [sqlite3_prepare_v2()] or one of its variants) and
-** the second argument is the index of the column for which information 
-** should be returned.  The left-most column has an index of 0.
+** These routines form the "result set query" interface.
 **
-** If the SQL statement is not currently point to a valid row, or if the
-** the column index is out of range, the result is undefined.
+** These routines return information about a single column of the current
+** result row of a query.  In every case the first argument is a pointer
+** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
+** that was returned from [sqlite3_prepare_v2()] or one of its variants)
+** and the second argument is the index of the column for which information
+** should be returned.  The leftmost column of the result set has the index 0.
 **
-** The sqlite3_column_type() routine returns 
+** If the SQL statement does not currently point to a valid row, or if the
+** column index is out of range, the result is undefined.
+** These routines may only be called when the most recent call to
+** [sqlite3_step()] has returned [SQLITE_ROW] and neither
+** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently.
+** If any of these routines are called after [sqlite3_reset()] or
+** [sqlite3_finalize()] or after [sqlite3_step()] has returned
+** something other than [SQLITE_ROW], the results are undefined.
+** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()]
+** are called from a different thread while any of these routines
+** are pending, then the results are undefined.
+**
+** The sqlite3_column_type() routine returns the
 ** [SQLITE_INTEGER | datatype code] for the initial data type
 ** of the result column.  The returned value is one of [SQLITE_INTEGER],
 ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].  The value
@@ -1440,9 +2843,7 @@
 ** versions of SQLite may change the behavior of sqlite3_column_type()
 ** following a type conversion.
 **
-*** The sqlite3_column_nm
-**
-** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() 
+** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes()
 ** routine returns the number of bytes in that BLOB or string.
 ** If the result is a UTF-16 string, then sqlite3_column_bytes() converts
 ** the string to UTF-8 and then returns the number of bytes.
@@ -1453,20 +2854,32 @@
 ** of the string.  For clarity: the value returned is the number of
 ** bytes in the string, not the number of characters.
 **
+** Strings returned by sqlite3_column_text() and sqlite3_column_text16(),
+** even empty strings, are always zero terminated.  The return
+** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary
+** pointer, possibly even a NULL pointer.
+**
 ** The sqlite3_column_bytes16() routine is similar to sqlite3_column_bytes()
-** but leaves the result in UTF-16 instead of UTF-8.  
+** but leaves the result in UTF-16 in native byte order instead of UTF-8.
 ** The zero terminator is not included in this count.
 **
+** The object returned by [sqlite3_column_value()] is an
+** [unprotected sqlite3_value] object.  An unprotected sqlite3_value object
+** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()].
+** If the [unprotected sqlite3_value] object returned by
+** [sqlite3_column_value()] is used in any other way, including calls
+** to routines like [sqlite3_value_int()], [sqlite3_value_text()],
+** or [sqlite3_value_bytes()], then the behavior is undefined.
+**
 ** These routines attempt to convert the value where appropriate.  For
 ** example, if the internal representation is FLOAT and a text result
-** is requested, [sqlite3_snprintf()] is used internally to do the conversion
-** automatically.  The following table details the conversions that
-** are applied:
+** is requested, [sqlite3_snprintf()] is used internally to perform the
+** conversion automatically.  The following table details the conversions
+** that are applied:
 **
 ** <blockquote>
 ** <table border="1">
-** <tr><th> Internal <th> Requested <th> 
-** <tr><th>  Type    <th>    Type   <th> Conversion
+** <tr><th> Internal<br>Type <th> Requested<br>Type <th>  Conversion
 **
 ** <tr><td>  NULL    <td> INTEGER   <td> Result is 0
 ** <tr><td>  NULL    <td>  FLOAT    <td> Result is 0.0
@@ -1474,7 +2887,7 @@
 ** <tr><td>  NULL    <td>   BLOB    <td> Result is NULL pointer
 ** <tr><td> INTEGER  <td>  FLOAT    <td> Convert from integer to float
 ** <tr><td> INTEGER  <td>   TEXT    <td> ASCII rendering of the integer
-** <tr><td> INTEGER  <td>   BLOB    <td> Same as for INTEGER->TEXT
+** <tr><td> INTEGER  <td>   BLOB    <td> Same as INTEGER->TEXT
 ** <tr><td>  FLOAT   <td> INTEGER   <td> Convert from float to integer
 ** <tr><td>  FLOAT   <td>   TEXT    <td> ASCII rendering of the float
 ** <tr><td>  FLOAT   <td>   BLOB    <td> Same as FLOAT->TEXT
@@ -1489,176 +2902,230 @@
 **
 ** The table above makes reference to standard C library functions atoi()
 ** and atof().  SQLite does not really use these functions.  It has its
-** on equavalent internal routines.  The atoi() and atof() names are
+** own equivalent internal routines.  The atoi() and atof() names are
 ** used in the table for brevity and because they are familiar to most
 ** C programmers.
 **
 ** Note that when type conversions occur, pointers returned by prior
 ** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or
-** sqlite3_column_text16() may be invalidated. 
+** sqlite3_column_text16() may be invalidated.
 ** Type conversions and pointer invalidations might occur
 ** in the following cases:
 **
 ** <ul>
-** <li><p>  The initial content is a BLOB and sqlite3_column_text() 
-**          or sqlite3_column_text16() is called.  A zero-terminator might
-**          need to be added to the string.</p></li>
-**
-** <li><p>  The initial content is UTF-8 text and sqlite3_column_bytes16() or
-**          sqlite3_column_text16() is called.  The content must be converted
-**          to UTF-16.</p></li>
-**
-** <li><p>  The initial content is UTF-16 text and sqlite3_column_bytes() or
-**          sqlite3_column_text() is called.  The content must be converted
-**          to UTF-8.</p></li>
+** <li> The initial content is a BLOB and sqlite3_column_text() or
+**      sqlite3_column_text16() is called.  A zero-terminator might
+**      need to be added to the string.</li>
+** <li> The initial content is UTF-8 text and sqlite3_column_bytes16() or
+**      sqlite3_column_text16() is called.  The content must be converted
+**      to UTF-16.</li>
+** <li> The initial content is UTF-16 text and sqlite3_column_bytes() or
+**      sqlite3_column_text() is called.  The content must be converted
+**      to UTF-8.</li>
 ** </ul>
 **
 ** Conversions between UTF-16be and UTF-16le are always done in place and do
 ** not invalidate a prior pointer, though of course the content of the buffer
 ** that the prior pointer points to will have been modified.  Other kinds
-** of conversion are done in place when it is possible, but sometime it is
-** not possible and in those cases prior pointers are invalidated.  
+** of conversion are done in place when it is possible, but sometimes they
+** are not possible and in those cases prior pointers are invalidated.
 **
 ** The safest and easiest to remember policy is to invoke these routines
 ** in one of the following ways:
 **
-**  <ul>
+** <ul>
 **  <li>sqlite3_column_text() followed by sqlite3_column_bytes()</li>
 **  <li>sqlite3_column_blob() followed by sqlite3_column_bytes()</li>
 **  <li>sqlite3_column_text16() followed by sqlite3_column_bytes16()</li>
-**  </ul>
+** </ul>
 **
-** In other words, you should call sqlite3_column_text(), sqlite3_column_blob(),
-** or sqlite3_column_text16() first to force the result into the desired
-** format, then invoke sqlite3_column_bytes() or sqlite3_column_bytes16() to
-** find the size of the result.  Do not mix call to sqlite3_column_text() or
-** sqlite3_column_blob() with calls to sqlite3_column_bytes16().  And do not
-** mix calls to sqlite3_column_text16() with calls to sqlite3_column_bytes().
+** In other words, you should call sqlite3_column_text(),
+** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result
+** into the desired format, then invoke sqlite3_column_bytes() or
+** sqlite3_column_bytes16() to find the size of the result.  Do not mix calls
+** to sqlite3_column_text() or sqlite3_column_blob() with calls to
+** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16()
+** with calls to sqlite3_column_bytes().
+**
+** The pointers returned are valid until a type conversion occurs as
+** described above, or until [sqlite3_step()] or [sqlite3_reset()] or
+** [sqlite3_finalize()] is called.  The memory space used to hold strings
+** and BLOBs is freed automatically.  Do <b>not</b> pass the pointers returned
+** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into
+** [sqlite3_free()].
+**
+** If a memory allocation error occurs during the evaluation of any
+** of these routines, a default value is returned.  The default value
+** is either the integer 0, the floating point number 0.0, or a NULL
+** pointer.  Subsequent calls to [sqlite3_errcode()] will return
+** [SQLITE_NOMEM].
+**
+** Requirements:
+** [H13803] [H13806] [H13809] [H13812] [H13815] [H13818] [H13821] [H13824]
+** [H13827] [H13830]
 */
 const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
 int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
 int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
 double sqlite3_column_double(sqlite3_stmt*, int iCol);
 int sqlite3_column_int(sqlite3_stmt*, int iCol);
-sqlite_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
+sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
 const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
 const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
 int sqlite3_column_type(sqlite3_stmt*, int iCol);
 sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
 
 /*
-** CAPI3REF: Destroy A Prepared Statement Object
+** CAPI3REF: Destroy A Prepared Statement Object {H13300} <S70300><S30100>
 **
-** The sqlite3_finalize() function is called to delete a 
-** [sqlite3_stmt | compiled SQL statement]. If the statement was
-** executed successfully, or not executed at all, then SQLITE_OK is returned.
-** If execution of the statement failed then an 
-** [SQLITE_ERROR | error code] or [SQLITE_IOERR_READ | extended error code]
-** is returned. 
+** The sqlite3_finalize() function is called to delete a [prepared statement].
+** If the statement was executed successfully or not executed at all, then
+** SQLITE_OK is returned. If execution of the statement failed then an
+** [error code] or [extended error code] is returned.
 **
 ** This routine can be called at any point during the execution of the
-** [sqlite3_stmt | virtual machine].  If the virtual machine has not 
+** [prepared statement].  If the virtual machine has not
 ** completed execution when this routine is called, that is like
-** encountering an error or an interrupt.  (See [sqlite3_interrupt()].) 
-** Incomplete updates may be rolled back and transactions cancelled,  
-** depending on the circumstances, and the 
-** [SQLITE_ERROR | result code] returned will be [SQLITE_ABORT].
+** encountering an error or an [sqlite3_interrupt | interrupt].
+** Incomplete updates may be rolled back and transactions canceled,
+** depending on the circumstances, and the
+** [error code] returned will be [SQLITE_ABORT].
+**
+** Requirements:
+** [H11302] [H11304]
 */
 int sqlite3_finalize(sqlite3_stmt *pStmt);
 
 /*
-** CAPI3REF: Reset A Prepared Statement Object
+** CAPI3REF: Reset A Prepared Statement Object {H13330} <S70300>
 **
-** The sqlite3_reset() function is called to reset a 
-** [sqlite_stmt | compiled SQL statement] object.
-** back to it's initial state, ready to be re-executed.
+** The sqlite3_reset() function is called to reset a [prepared statement]
+** object back to its initial state, ready to be re-executed.
 ** Any SQL statement variables that had values bound to them using
 ** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values.
 ** Use [sqlite3_clear_bindings()] to reset the bindings.
+**
+** {H11332} The [sqlite3_reset(S)] interface resets the [prepared statement] S
+**          back to the beginning of its program.
+**
+** {H11334} If the most recent call to [sqlite3_step(S)] for the
+**          [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE],
+**          or if [sqlite3_step(S)] has never before been called on S,
+**          then [sqlite3_reset(S)] returns [SQLITE_OK].
+**
+** {H11336} If the most recent call to [sqlite3_step(S)] for the
+**          [prepared statement] S indicated an error, then
+**          [sqlite3_reset(S)] returns an appropriate [error code].
+**
+** {H11338} The [sqlite3_reset(S)] interface does not change the values
+**          of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
 */
 int sqlite3_reset(sqlite3_stmt *pStmt);
 
 /*
-** CAPI3REF: Create Or Redefine SQL Functions
+** CAPI3REF: Create Or Redefine SQL Functions {H16100} <S20200>
+** KEYWORDS: {function creation routines}
+** KEYWORDS: {application-defined SQL function}
+** KEYWORDS: {application-defined SQL functions}
 **
-** The following two functions are used to add SQL functions or aggregates
-** or to redefine the behavior of existing SQL functions or aggregates.  The
-** difference only between the two is that the second parameter, the
-** name of the (scalar) function or aggregate, is encoded in UTF-8 for
-** sqlite3_create_function() and UTF-16 for sqlite3_create_function16().
+** These two functions (collectively known as "function creation routines")
+** are used to add SQL functions or aggregates or to redefine the behavior
+** of existing SQL functions or aggregates.  The only difference between the
+** two is that the second parameter, the name of the (scalar) function or
+** aggregate, is encoded in UTF-8 for sqlite3_create_function() and UTF-16
+** for sqlite3_create_function16().
 **
-** The first argument is the [sqlite3 | database handle] that holds the
-** SQL function or aggregate is to be added or redefined. If a single
-** program uses more than one database handle internally, then SQL
-** functions or aggregates must be added individually to each database
-** handle with which they will be used.
+** The first parameter is the [database connection] to which the SQL
+** function is to be added.  If a single program uses more than one database
+** connection internally, then SQL functions must be added individually to
+** each database connection.
 **
-** The second parameter is the name of the SQL function to be created
-** or redefined.
-** The length of the name is limited to 255 bytes, exclusive of the 
-** zero-terminator.  Note that the name length limit is in bytes, not
+** The second parameter is the name of the SQL function to be created or
+** redefined.  The length of the name is limited to 255 bytes, exclusive of
+** the zero-terminator.  Note that the name length limit is in bytes, not
 ** characters.  Any attempt to create a function with a longer name
-** will result in an SQLITE_ERROR error.
+** will result in [SQLITE_ERROR] being returned.
 **
-** The third parameter is the number of arguments that the SQL function or
+** The third parameter (nArg)
+** is the number of arguments that the SQL function or
 ** aggregate takes. If this parameter is negative, then the SQL function or
 ** aggregate may take any number of arguments.
 **
-** The fourth parameter, eTextRep, specifies what 
+** The fourth parameter, eTextRep, specifies what
 ** [SQLITE_UTF8 | text encoding] this SQL function prefers for
 ** its parameters.  Any SQL function implementation should be able to work
 ** work with UTF-8, UTF-16le, or UTF-16be.  But some implementations may be
 ** more efficient with one encoding than another.  It is allowed to
-** invoke sqlite_create_function() or sqlite3_create_function16() multiple
+** invoke sqlite3_create_function() or sqlite3_create_function16() multiple
 ** times with the same function but with different values of eTextRep.
 ** When multiple implementations of the same function are available, SQLite
 ** will pick the one that involves the least amount of data conversion.
-** If there is only a single implementation which does not care what
-** text encoding is used, then the fourth argument should be
-** [SQLITE_ANY].
+** If there is only a single implementation which does not care what text
+** encoding is used, then the fourth argument should be [SQLITE_ANY].
 **
-** The fifth parameter is an arbitrary pointer.  The implementation
-** of the function can gain access to this pointer using
-** [sqlite_user_data()].
+** The fifth parameter is an arbitrary pointer.  The implementation of the
+** function can gain access to this pointer using [sqlite3_user_data()].
 **
 ** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are
-** pointers to C-language functions that implement the SQL
-** function or aggregate. A scalar SQL function requires an implementation of
-** the xFunc callback only, NULL pointers should be passed as the xStep
-** and xFinal parameters. An aggregate SQL function requires an implementation
-** of xStep and xFinal and NULL should be passed for xFunc. To delete an
-** existing SQL function or aggregate, pass NULL for all three function
-** callback.
+** pointers to C-language functions that implement the SQL function or
+** aggregate. A scalar SQL function requires an implementation of the xFunc
+** callback only, NULL pointers should be passed as the xStep and xFinal
+** parameters. An aggregate SQL function requires an implementation of xStep
+** and xFinal and NULL should be passed for xFunc. To delete an existing
+** SQL function or aggregate, pass NULL for all three function callbacks.
 **
 ** It is permitted to register multiple implementations of the same
 ** functions with the same name but with either differing numbers of
-** arguments or differing perferred text encodings.  SQLite will use
+** arguments or differing preferred text encodings.  SQLite will use
 ** the implementation most closely matches the way in which the
-** SQL function is used.
+** SQL function is used.  A function implementation with a non-negative
+** nArg parameter is a better match than a function implementation with
+** a negative nArg.  A function where the preferred text encoding
+** matches the database encoding is a better
+** match than a function where the encoding is different.  
+** A function where the encoding difference is between UTF16le and UTF16be
+** is a closer match than a function where the encoding difference is
+** between UTF8 and UTF16.
+**
+** Built-in functions may be overloaded by new application-defined functions.
+** The first application-defined function with a given name overrides all
+** built-in functions in the same [database connection] with the same name.
+** Subsequent application-defined functions of the same name only override 
+** prior application-defined functions that are an exact match for the
+** number of parameters and preferred encoding.
+**
+** An application-defined function is permitted to call other
+** SQLite interfaces.  However, such calls must not
+** close the database connection nor finalize or reset the prepared
+** statement in which the function is running.
+**
+** Requirements:
+** [H16103] [H16106] [H16109] [H16112] [H16118] [H16121] [H16124] [H16127]
+** [H16130] [H16133] [H16136] [H16139] [H16142]
 */
 int sqlite3_create_function(
-  sqlite3 *,
+  sqlite3 *db,
   const char *zFunctionName,
   int nArg,
   int eTextRep,
-  void*,
+  void *pApp,
   void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
   void (*xStep)(sqlite3_context*,int,sqlite3_value**),
   void (*xFinal)(sqlite3_context*)
 );
 int sqlite3_create_function16(
-  sqlite3*,
+  sqlite3 *db,
   const void *zFunctionName,
   int nArg,
   int eTextRep,
-  void*,
+  void *pApp,
   void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
   void (*xStep)(sqlite3_context*,int,sqlite3_value**),
   void (*xFinal)(sqlite3_context*)
 );
 
 /*
-** CAPI3REF: Text Encodings
+** CAPI3REF: Text Encodings {H10267} <S50200> <H16100>
 **
 ** These constant define integer codes that represent the various
 ** text encodings supported by SQLite.
@@ -1671,22 +3138,26 @@
 #define SQLITE_UTF16_ALIGNED  8    /* sqlite3_create_collation only */
 
 /*
-** CAPI3REF: Obsolete Functions
+** CAPI3REF: Deprecated Functions
+** DEPRECATED
 **
-** These functions are all now obsolete.  In order to maintain
-** backwards compatibility with older code, we continue to support
-** these functions.  However, new development projects should avoid
+** These functions are [deprecated].  In order to maintain
+** backwards compatibility with older code, these functions continue 
+** to be supported.  However, new applications should avoid
 ** the use of these functions.  To help encourage people to avoid
-** using these functions, we are not going to tell you want they do.
+** using these functions, we are not going to tell you what they do.
 */
-int sqlite3_aggregate_count(sqlite3_context*);
-int sqlite3_expired(sqlite3_stmt*);
-int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
-int sqlite3_global_recover(void);
-
+#ifndef SQLITE_OMIT_DEPRECATED
+SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
+SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
+SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
+SQLITE_DEPRECATED int sqlite3_global_recover(void);
+SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
+SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64);
+#endif
 
 /*
-** CAPI3REF: Obtaining SQL Function Parameter Values
+** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} <S20200>
 **
 ** The C-language implementation of SQL functions and aggregates uses
 ** this set of interface routines to access the parameter values on
@@ -1696,40 +3167,50 @@
 ** to [sqlite3_create_function()] and [sqlite3_create_function16()]
 ** define callbacks that implement the SQL functions and aggregates.
 ** The 4th parameter to these callbacks is an array of pointers to
-** [sqlite3_value] objects.  There is one [sqlite3_value] object for
+** [protected sqlite3_value] objects.  There is one [sqlite3_value] object for
 ** each parameter to the SQL function.  These routines are used to
 ** extract values from the [sqlite3_value] objects.
 **
-** These routines work just like the corresponding 
-** [sqlite3_column_blob | sqlite3_column_* routines] except that 
-** these routines take a single [sqlite3_value*] pointer instead
-** of an [sqlite3_stmt*] pointer and an integer column number.
+** These routines work only with [protected sqlite3_value] objects.
+** Any attempt to use these routines on an [unprotected sqlite3_value]
+** object results in undefined behavior.
 **
-** The sqlite3_value_text16() interface extracts a UTF16 string
+** These routines work just like the corresponding [column access functions]
+** except that  these routines take a single [protected sqlite3_value] object
+** pointer instead of a [sqlite3_stmt*] pointer and an integer column number.
+**
+** The sqlite3_value_text16() interface extracts a UTF-16 string
 ** in the native byte-order of the host machine.  The
 ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
-** extract UTF16 strings as big-endian and little-endian respectively.
+** extract UTF-16 strings as big-endian and little-endian respectively.
 **
 ** The sqlite3_value_numeric_type() interface attempts to apply
 ** numeric affinity to the value.  This means that an attempt is
 ** made to convert the value to an integer or floating point.  If
-** such a conversion is possible without loss of information (in order
-** words if the value is original a string that looks like a number)
-** then it is done.  Otherwise no conversion occurs.  The 
-** [SQLITE_INTEGER | datatype] after conversion is returned.
+** such a conversion is possible without loss of information (in other
+** words, if the value is a string that looks like a number)
+** then the conversion is performed.  Otherwise no conversion occurs.
+** The [SQLITE_INTEGER | datatype] after conversion is returned.
 **
-** Please pay particular attention to the fact that the pointer that
-** is returned from [sqlite3_value_blob()], [sqlite3_value_text()], or
+** Please pay particular attention to the fact that the pointer returned
+** from [sqlite3_value_blob()], [sqlite3_value_text()], or
 ** [sqlite3_value_text16()] can be invalidated by a subsequent call to
-** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite_value_text()],
-** or [sqlite3_value_text16()].  
+** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()],
+** or [sqlite3_value_text16()].
+**
+** These routines must be called from the same thread as
+** the SQL function that supplied the [sqlite3_value*] parameters.
+**
+** Requirements:
+** [H15103] [H15106] [H15109] [H15112] [H15115] [H15118] [H15121] [H15124]
+** [H15127] [H15130] [H15133] [H15136]
 */
 const void *sqlite3_value_blob(sqlite3_value*);
 int sqlite3_value_bytes(sqlite3_value*);
 int sqlite3_value_bytes16(sqlite3_value*);
 double sqlite3_value_double(sqlite3_value*);
 int sqlite3_value_int(sqlite3_value*);
-sqlite_int64 sqlite3_value_int64(sqlite3_value*);
+sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
 const unsigned char *sqlite3_value_text(sqlite3_value*);
 const void *sqlite3_value_text16(sqlite3_value*);
 const void *sqlite3_value_text16le(sqlite3_value*);
@@ -1738,76 +3219,120 @@
 int sqlite3_value_numeric_type(sqlite3_value*);
 
 /*
-** CAPI3REF: Obtain Aggregate Function Context
+** CAPI3REF: Obtain Aggregate Function Context {H16210} <S20200>
 **
 ** The implementation of aggregate SQL functions use this routine to allocate
-** a structure for storing their state.  The first time this routine
-** is called for a particular aggregate, a new structure of size nBytes
-** is allocated, zeroed, and returned.  On subsequent calls (for the
-** same aggregate instance) the same buffer is returned.  The implementation
-** of the aggregate can use the returned buffer to accumulate data.
+** a structure for storing their state.
 **
-** The buffer allocated is freed automatically by SQLite whan the aggregate
+** The first time the sqlite3_aggregate_context() routine is called for a
+** particular aggregate, SQLite allocates nBytes of memory, zeroes out that
+** memory, and returns a pointer to it. On second and subsequent calls to
+** sqlite3_aggregate_context() for the same aggregate function index,
+** the same buffer is returned. The implementation of the aggregate can use
+** the returned buffer to accumulate data.
+**
+** SQLite automatically frees the allocated buffer when the aggregate
 ** query concludes.
 **
-** The first parameter should be a copy of the 
-** [sqlite3_context | SQL function context] that is the first
-** parameter to the callback routine that implements the aggregate
-** function.
+** The first parameter should be a copy of the
+** [sqlite3_context | SQL function context] that is the first parameter
+** to the callback routine that implements the aggregate function.
+**
+** This routine must be called from the same thread in which
+** the aggregate SQL function is running.
+**
+** Requirements:
+** [H16211] [H16213] [H16215] [H16217]
 */
 void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
 
 /*
-** CAPI3REF: User Data For Functions
+** CAPI3REF: User Data For Functions {H16240} <S20200>
 **
-** The pUserData parameter to the [sqlite3_create_function()]
-** and [sqlite3_create_function16()] routines
-** used to register user functions is available to
-** the implementation of the function using this call.
+** The sqlite3_user_data() interface returns a copy of
+** the pointer that was the pUserData parameter (the 5th parameter)
+** of the [sqlite3_create_function()]
+** and [sqlite3_create_function16()] routines that originally
+** registered the application defined function. {END}
+**
+** This routine must be called from the same thread in which
+** the application-defined function is running.
+**
+** Requirements:
+** [H16243]
 */
 void *sqlite3_user_data(sqlite3_context*);
 
 /*
-** CAPI3REF: Function Auxiliary Data
+** CAPI3REF: Database Connection For Functions {H16250} <S60600><S20200>
+**
+** The sqlite3_context_db_handle() interface returns a copy of
+** the pointer to the [database connection] (the 1st parameter)
+** of the [sqlite3_create_function()]
+** and [sqlite3_create_function16()] routines that originally
+** registered the application defined function.
+**
+** Requirements:
+** [H16253]
+*/
+sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
+
+/*
+** CAPI3REF: Function Auxiliary Data {H16270} <S20200>
 **
 ** The following two functions may be used by scalar SQL functions to
-** associate meta-data with argument values. If the same value is passed to
+** associate metadata with argument values. If the same value is passed to
 ** multiple invocations of the same SQL function during query execution, under
-** some circumstances the associated meta-data may be preserved. This may
+** some circumstances the associated metadata may be preserved. This may
 ** be used, for example, to add a regular-expression matching scalar
 ** function. The compiled version of the regular expression is stored as
-** meta-data associated with the SQL value passed as the regular expression
+** metadata associated with the SQL value passed as the regular expression
 ** pattern.  The compiled regular expression can be reused on multiple
 ** invocations of the same function so that the original pattern string
 ** does not need to be recompiled on each invocation.
 **
-** The sqlite3_get_auxdata() interface returns a pointer to the meta-data
-** associated with the Nth argument value to the current SQL function
-** call, where N is the second parameter. If no meta-data has been set for
-** that value, then a NULL pointer is returned.
+** The sqlite3_get_auxdata() interface returns a pointer to the metadata
+** associated by the sqlite3_set_auxdata() function with the Nth argument
+** value to the application-defined function. If no metadata has been ever
+** been set for the Nth argument of the function, or if the corresponding
+** function parameter has changed since the meta-data was set,
+** then sqlite3_get_auxdata() returns a NULL pointer.
 **
-** The sqlite3_set_auxdata() is used to associate meta-data with an SQL
-** function argument. The third parameter is a pointer to the meta-data
-** to be associated with the Nth user function argument value. The fourth
-** parameter specifies a destructor that will be called on the meta-
-** data pointer to release it when it is no longer required. If the 
-** destructor is NULL, it is not invoked.
+** The sqlite3_set_auxdata() interface saves the metadata
+** pointed to by its 3rd parameter as the metadata for the N-th
+** argument of the application-defined function.  Subsequent
+** calls to sqlite3_get_auxdata() might return this data, if it has
+** not been destroyed.
+** If it is not NULL, SQLite will invoke the destructor
+** function given by the 4th parameter to sqlite3_set_auxdata() on
+** the metadata when the corresponding function parameter changes
+** or when the SQL statement completes, whichever comes first.
 **
-** In practice, meta-data is preserved between function calls for
+** SQLite is free to call the destructor and drop metadata on any
+** parameter of any function at any time.  The only guarantee is that
+** the destructor will be called before the metadata is dropped.
+**
+** In practice, metadata is preserved between function calls for
 ** expressions that are constant at compile time. This includes literal
 ** values and SQL variables.
+**
+** These routines must be called from the same thread in which
+** the SQL function is running.
+**
+** Requirements:
+** [H16272] [H16274] [H16276] [H16277] [H16278] [H16279]
 */
-void *sqlite3_get_auxdata(sqlite3_context*, int);
-void sqlite3_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));
+void *sqlite3_get_auxdata(sqlite3_context*, int N);
+void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
 
 
 /*
-** CAPI3REF: Constants Defining Special Destructor Behavior
+** CAPI3REF: Constants Defining Special Destructor Behavior {H10280} <S30100>
 **
-** These are special value for the destructor that is passed in as the
+** These are special values for the destructor that is passed in as the
 ** final argument to routines like [sqlite3_result_blob()].  If the destructor
 ** argument is SQLITE_STATIC, it means that the content pointer is constant
-** and will never change.  It does not need to be destroyed.  The 
+** and will never change.  It does not need to be destroyed.  The
 ** SQLITE_TRANSIENT value means that the content will likely change in
 ** the near future and that SQLite should make its own private copy of
 ** the content before returning.
@@ -1820,36 +3345,123 @@
 #define SQLITE_TRANSIENT   ((sqlite3_destructor_type)-1)
 
 /*
-** CAPI3REF: Setting The Result Of An SQL Function
+** CAPI3REF: Setting The Result Of An SQL Function {H16400} <S20200>
 **
 ** These routines are used by the xFunc or xFinal callbacks that
 ** implement SQL functions and aggregates.  See
 ** [sqlite3_create_function()] and [sqlite3_create_function16()]
 ** for additional information.
 **
-** These functions work very much like the 
-** [sqlite3_bind_blob | sqlite3_bind_*] family of functions used
-** to bind values to host parameters in prepared statements.
-** Refer to the
-** [sqlite3_bind_blob | sqlite3_bind_* documentation] for
-** additional information.
+** These functions work very much like the [parameter binding] family of
+** functions used to bind values to host parameters in prepared statements.
+** Refer to the [SQL parameter] documentation for additional information.
+**
+** The sqlite3_result_blob() interface sets the result from
+** an application-defined function to be the BLOB whose content is pointed
+** to by the second parameter and which is N bytes long where N is the
+** third parameter.
+**
+** The sqlite3_result_zeroblob() interfaces set the result of
+** the application-defined function to be a BLOB containing all zero
+** bytes and N bytes in size, where N is the value of the 2nd parameter.
+**
+** The sqlite3_result_double() interface sets the result from
+** an application-defined function to be a floating point value specified
+** by its 2nd argument.
 **
 ** The sqlite3_result_error() and sqlite3_result_error16() functions
-** cause the implemented SQL function to throw an exception.  The
-** parameter to sqlite3_result_error() or sqlite3_result_error16()
-** is the text of an error message.
+** cause the implemented SQL function to throw an exception.
+** SQLite uses the string pointed to by the
+** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16()
+** as the text of an error message.  SQLite interprets the error
+** message string from sqlite3_result_error() as UTF-8. SQLite
+** interprets the string from sqlite3_result_error16() as UTF-16 in native
+** byte order.  If the third parameter to sqlite3_result_error()
+** or sqlite3_result_error16() is negative then SQLite takes as the error
+** message all text up through the first zero character.
+** If the third parameter to sqlite3_result_error() or
+** sqlite3_result_error16() is non-negative then SQLite takes that many
+** bytes (not characters) from the 2nd parameter as the error message.
+** The sqlite3_result_error() and sqlite3_result_error16()
+** routines make a private copy of the error message text before
+** they return.  Hence, the calling function can deallocate or
+** modify the text after they return without harm.
+** The sqlite3_result_error_code() function changes the error code
+** returned by SQLite as a result of an error in a function.  By default,
+** the error code is SQLITE_ERROR.  A subsequent call to sqlite3_result_error()
+** or sqlite3_result_error16() resets the error code to SQLITE_ERROR.
 **
-** The sqlite3_result_toobig() cause the function implementation
-** to throw and error indicating that a string or BLOB is to long
-** to represent.
+** The sqlite3_result_toobig() interface causes SQLite to throw an error
+** indicating that a string or BLOB is to long to represent.
+**
+** The sqlite3_result_nomem() interface causes SQLite to throw an error
+** indicating that a memory allocation failed.
+**
+** The sqlite3_result_int() interface sets the return value
+** of the application-defined function to be the 32-bit signed integer
+** value given in the 2nd argument.
+** The sqlite3_result_int64() interface sets the return value
+** of the application-defined function to be the 64-bit signed integer
+** value given in the 2nd argument.
+**
+** The sqlite3_result_null() interface sets the return value
+** of the application-defined function to be NULL.
+**
+** The sqlite3_result_text(), sqlite3_result_text16(),
+** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces
+** set the return value of the application-defined function to be
+** a text string which is represented as UTF-8, UTF-16 native byte order,
+** UTF-16 little endian, or UTF-16 big endian, respectively.
+** SQLite takes the text result from the application from
+** the 2nd parameter of the sqlite3_result_text* interfaces.
+** If the 3rd parameter to the sqlite3_result_text* interfaces
+** is negative, then SQLite takes result text from the 2nd parameter
+** through the first zero character.
+** If the 3rd parameter to the sqlite3_result_text* interfaces
+** is non-negative, then as many bytes (not characters) of the text
+** pointed to by the 2nd parameter are taken as the application-defined
+** function result.
+** If the 4th parameter to the sqlite3_result_text* interfaces
+** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
+** function as the destructor on the text or BLOB result when it has
+** finished using that result.
+** If the 4th parameter to the sqlite3_result_text* interfaces or
+** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
+** assumes that the text or BLOB result is in constant space and does not
+** copy the it or call a destructor when it has finished using that result.
+** If the 4th parameter to the sqlite3_result_text* interfaces
+** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT
+** then SQLite makes a copy of the result into space obtained from
+** from [sqlite3_malloc()] before it returns.
+**
+** The sqlite3_result_value() interface sets the result of
+** the application-defined function to be a copy the
+** [unprotected sqlite3_value] object specified by the 2nd parameter.  The
+** sqlite3_result_value() interface makes a copy of the [sqlite3_value]
+** so that the [sqlite3_value] specified in the parameter may change or
+** be deallocated after sqlite3_result_value() returns without harm.
+** A [protected sqlite3_value] object may always be used where an
+** [unprotected sqlite3_value] object is required, so either
+** kind of [sqlite3_value] object can be used with this interface.
+**
+** If these routines are called from within the different thread
+** than the one containing the application-defined function that received
+** the [sqlite3_context] pointer, the results are undefined.
+**
+** Requirements:
+** [H16403] [H16406] [H16409] [H16412] [H16415] [H16418] [H16421] [H16424]
+** [H16427] [H16430] [H16433] [H16436] [H16439] [H16442] [H16445] [H16448]
+** [H16451] [H16454] [H16457] [H16460] [H16463]
 */
 void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
 void sqlite3_result_double(sqlite3_context*, double);
 void sqlite3_result_error(sqlite3_context*, const char*, int);
 void sqlite3_result_error16(sqlite3_context*, const void*, int);
 void sqlite3_result_error_toobig(sqlite3_context*);
+void sqlite3_result_error_nomem(sqlite3_context*);
+void sqlite3_result_error_code(sqlite3_context*, int);
 void sqlite3_result_int(sqlite3_context*, int);
-void sqlite3_result_int64(sqlite3_context*, sqlite_int64);
+void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
 void sqlite3_result_null(sqlite3_context*);
 void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
 void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
@@ -1859,46 +3471,50 @@
 void sqlite3_result_zeroblob(sqlite3_context*, int n);
 
 /*
-** CAPI3REF: Define New Collating Sequences
+** CAPI3REF: Define New Collating Sequences {H16600} <S20300>
 **
 ** These functions are used to add new collation sequences to the
-** [sqlite3*] handle specified as the first argument. 
+** [database connection] specified as the first argument.
 **
 ** The name of the new collation sequence is specified as a UTF-8 string
 ** for sqlite3_create_collation() and sqlite3_create_collation_v2()
-** and a UTF-16 string for sqlite3_create_collation16().  In all cases
+** and a UTF-16 string for sqlite3_create_collation16(). In all cases
 ** the name is passed as the second function argument.
 **
-** The third argument must be one of the constants [SQLITE_UTF8],
+** The third argument may be one of the constants [SQLITE_UTF8],
 ** [SQLITE_UTF16LE] or [SQLITE_UTF16BE], indicating that the user-supplied
 ** routine expects to be passed pointers to strings encoded using UTF-8,
-** UTF-16 little-endian or UTF-16 big-endian respectively.
+** UTF-16 little-endian, or UTF-16 big-endian, respectively. The
+** third argument might also be [SQLITE_UTF16_ALIGNED] to indicate that
+** the routine expects pointers to 16-bit word aligned strings
+** of UTF-16 in the native byte order of the host computer.
 **
 ** A pointer to the user supplied routine must be passed as the fifth
-** argument. If it is NULL, this is the same as deleting the collation
-** sequence (so that SQLite cannot call it anymore). Each time the user
-** supplied function is invoked, it is passed a copy of the void* passed as
-** the fourth argument to sqlite3_create_collation() or
-** sqlite3_create_collation16() as its first parameter.
+** argument.  If it is NULL, this is the same as deleting the collation
+** sequence (so that SQLite cannot call it anymore).
+** Each time the application supplied function is invoked, it is passed
+** as its first parameter a copy of the void* passed as the fourth argument
+** to sqlite3_create_collation() or sqlite3_create_collation16().
 **
-** The remaining arguments to the user-supplied routine are two strings,
-** each represented by a [length, data] pair and encoded in the encoding
+** The remaining arguments to the application-supplied routine are two strings,
+** each represented by a (length, data) pair and encoded in the encoding
 ** that was passed as the third argument when the collation sequence was
-** registered. The user routine should return negative, zero or positive if
-** the first string is less than, equal to, or greater than the second
-** string. i.e. (STRING1 - STRING2).
+** registered. {END}  The application defined collation routine should
+** return negative, zero or positive if the first string is less than,
+** equal to, or greater than the second string. i.e. (STRING1 - STRING2).
 **
 ** The sqlite3_create_collation_v2() works like sqlite3_create_collation()
-** excapt that it takes an extra argument which is a destructor for
+** except that it takes an extra argument which is a destructor for
 ** the collation.  The destructor is called when the collation is
 ** destroyed and is passed a copy of the fourth parameter void* pointer
-** of the sqlite3_create_collation_v2().  Collations are destroyed when
-** they are overridden by later calls to the collation creation functions
-** or when the [sqlite3*] database handle is closed using [sqlite3_close()].
+** of the sqlite3_create_collation_v2().
+** Collations are destroyed when they are overridden by later calls to the
+** collation creation functions or when the [database connection] is closed
+** using [sqlite3_close()].
 **
-** The sqlite3_create_collation_v2() interface is experimental and
-** subject to change in future releases.  The other collation creation
-** functions are stable.
+** Requirements:
+** [H16603] [H16604] [H16606] [H16609] [H16612] [H16615] [H16618] [H16621]
+** [H16624] [H16627] [H16630]
 */
 int sqlite3_create_collation(
   sqlite3*, 
@@ -1917,37 +3533,40 @@
 );
 int sqlite3_create_collation16(
   sqlite3*, 
-  const char *zName, 
+  const void *zName,
   int eTextRep, 
   void*,
   int(*xCompare)(void*,int,const void*,int,const void*)
 );
 
 /*
-** CAPI3REF: Collation Needed Callbacks
+** CAPI3REF: Collation Needed Callbacks {H16700} <S20300>
 **
 ** To avoid having to register all collation sequences before a database
 ** can be used, a single callback function may be registered with the
-** database handle to be called whenever an undefined collation sequence is
-** required.
+** [database connection] to be called whenever an undefined collation
+** sequence is required.
 **
 ** If the function is registered using the sqlite3_collation_needed() API,
 ** then it is passed the names of undefined collation sequences as strings
-** encoded in UTF-8. If sqlite3_collation_needed16() is used, the names
-** are passed as UTF-16 in machine native byte order. A call to either
-** function replaces any existing callback.
+** encoded in UTF-8. {H16703} If sqlite3_collation_needed16() is used,
+** the names are passed as UTF-16 in machine native byte order.
+** A call to either function replaces any existing callback.
 **
 ** When the callback is invoked, the first argument passed is a copy
 ** of the second argument to sqlite3_collation_needed() or
-** sqlite3_collation_needed16(). The second argument is the database
-** handle. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], or
-** [SQLITE_UTF16LE], indicating the most desirable form of the collation
-** sequence function required. The fourth parameter is the name of the
+** sqlite3_collation_needed16().  The second argument is the database
+** connection.  The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE],
+** or [SQLITE_UTF16LE], indicating the most desirable form of the collation
+** sequence function required.  The fourth parameter is the name of the
 ** required collation sequence.
 **
 ** The callback function should register the desired collation using
 ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
 ** [sqlite3_create_collation_v2()].
+**
+** Requirements:
+** [H16702] [H16704] [H16706]
 */
 int sqlite3_collation_needed(
   sqlite3*, 
@@ -1986,259 +3605,310 @@
 );
 
 /*
-** CAPI3REF:  Suspend Execution For A Short Time
+** CAPI3REF: Suspend Execution For A Short Time {H10530} <S40410>
 **
-** This function causes the current thread to suspect execution
-** a number of milliseconds specified in its parameter.
+** The sqlite3_sleep() function causes the current thread to suspend execution
+** for at least a number of milliseconds specified in its parameter.
 **
-** If the operating system does not support sleep requests with 
-** millisecond time resolution, then the time will be rounded up to 
-** the nearest second. The number of milliseconds of sleep actually 
+** If the operating system does not support sleep requests with
+** millisecond time resolution, then the time will be rounded up to
+** the nearest second. The number of milliseconds of sleep actually
 ** requested from the operating system is returned.
+**
+** SQLite implements this interface by calling the xSleep()
+** method of the default [sqlite3_vfs] object.
+**
+** Requirements: [H10533] [H10536]
 */
 int sqlite3_sleep(int);
 
 /*
-** CAPI3REF:  Name Of The Folder Holding Temporary Files
+** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} <S20000>
 **
 ** If this global variable is made to point to a string which is
-** the name of a folder (a.ka. directory), then all temporary files
+** the name of a folder (a.k.a. directory), then all temporary files
 ** created by SQLite will be placed in that directory.  If this variable
-** is NULL pointer, then SQLite does a search for an appropriate temporary
-** file directory.
+** is a NULL pointer, then SQLite performs a search for an appropriate
+** temporary file directory.
 **
-** Once [sqlite3_open()] has been called, changing this variable will
-** invalidate the current temporary database, if any.  Generally speaking,
-** it is not safe to invoke this routine after [sqlite3_open()] has
-** been called.
+** It is not safe to modify this variable once a [database connection]
+** has been opened.  It is intended that this variable be set once
+** as part of process initialization and before any SQLite interface
+** routines have been call and remain unchanged thereafter.
 */
-extern char *sqlite3_temp_directory;
+SQLITE_EXTERN char *sqlite3_temp_directory;
 
 /*
-** CAPI3REF:  Test To See If The Databse Is In Auto-Commit Mode
+** CAPI3REF: Test For Auto-Commit Mode {H12930} <S60200>
+** KEYWORDS: {autocommit mode}
 **
-** Test to see whether or not the database connection is in autocommit
-** mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
-** by default.  Autocommit is disabled by a BEGIN statement and reenabled
-** by the next COMMIT or ROLLBACK.
+** The sqlite3_get_autocommit() interface returns non-zero or
+** zero if the given database connection is or is not in autocommit mode,
+** respectively.  Autocommit mode is on by default.
+** Autocommit mode is disabled by a [BEGIN] statement.
+** Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK].
+**
+** If certain kinds of errors occur on a statement within a multi-statement
+** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR],
+** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the
+** transaction might be rolled back automatically.  The only way to
+** find out whether SQLite automatically rolled back the transaction after
+** an error is to use this function.
+**
+** If another thread changes the autocommit status of the database
+** connection while this routine is running, then the return value
+** is undefined.
+**
+** Requirements: [H12931] [H12932] [H12933] [H12934]
 */
 int sqlite3_get_autocommit(sqlite3*);
 
 /*
-** CAPI3REF:  Find The Database Handle Associated With A Prepared Statement
+** CAPI3REF: Find The Database Handle Of A Prepared Statement {H13120} <S60600>
 **
-** Return the [sqlite3*] database handle to which a
-** [sqlite3_stmt | prepared statement] belongs.
-** This is the same database handle that was
-** the first argument to the [sqlite3_prepare_v2()] or its variants
-** that was used to create the statement in the first place.
+** The sqlite3_db_handle interface returns the [database connection] handle
+** to which a [prepared statement] belongs.  The [database connection]
+** returned by sqlite3_db_handle is the same [database connection] that was the first argument
+** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
+** create the statement in the first place.
+**
+** Requirements: [H13123]
 */
 sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
 
+/*
+** CAPI3REF: Find the next prepared statement {H13140} <S60600>
+**
+** This interface returns a pointer to the next [prepared statement] after
+** pStmt associated with the [database connection] pDb.  If pStmt is NULL
+** then this interface returns a pointer to the first prepared statement
+** associated with the database connection pDb.  If no prepared statement
+** satisfies the conditions of this routine, it returns NULL.
+**
+** The [database connection] pointer D in a call to
+** [sqlite3_next_stmt(D,S)] must refer to an open database
+** connection and in particular must not be a NULL pointer.
+**
+** Requirements: [H13143] [H13146] [H13149] [H13152]
+*/
+sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
 
 /*
-** CAPI3REF: Commit And Rollback Notification Callbacks
+** CAPI3REF: Commit And Rollback Notification Callbacks {H12950} <S60400>
 **
-** These routines
-** register callback functions to be invoked whenever a transaction
-** is committed or rolled back.  The pArg argument is passed through
-** to the callback.  If the callback on a commit hook function 
-** returns non-zero, then the commit is converted into a rollback.
+** The sqlite3_commit_hook() interface registers a callback
+** function to be invoked whenever a transaction is committed.
+** Any callback set by a previous call to sqlite3_commit_hook()
+** for the same database connection is overridden.
+** The sqlite3_rollback_hook() interface registers a callback
+** function to be invoked whenever a transaction is committed.
+** Any callback set by a previous call to sqlite3_commit_hook()
+** for the same database connection is overridden.
+** The pArg argument is passed through to the callback.
+** If the callback on a commit hook function returns non-zero,
+** then the commit is converted into a rollback.
 **
-** If another function was previously registered, its pArg value is returned.
-** Otherwise NULL is returned.
+** If another function was previously registered, its
+** pArg value is returned.  Otherwise NULL is returned.
+**
+** The callback implementation must not do anything that will modify
+** the database connection that invoked the callback.  Any actions
+** to modify the database connection must be deferred until after the
+** completion of the [sqlite3_step()] call that triggered the commit
+** or rollback hook in the first place.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
 **
 ** Registering a NULL function disables the callback.
 **
-** For the purposes of this API, a transaction is said to have been 
+** For the purposes of this API, a transaction is said to have been
 ** rolled back if an explicit "ROLLBACK" statement is executed, or
-** an error or constraint causes an implicit rollback to occur. The 
-** callback is not invoked if a transaction is automatically rolled
-** back because the database connection is closed.
+** an error or constraint causes an implicit rollback to occur.
+** The rollback callback is not invoked if a transaction is
+** automatically rolled back because the database connection is closed.
+** The rollback callback is not invoked if a transaction is
+** rolled back because a commit callback returned non-zero.
+** <todo> Check on this </todo>
 **
-** These are experimental interfaces and are subject to change.
+** Requirements:
+** [H12951] [H12952] [H12953] [H12954] [H12955]
+** [H12961] [H12962] [H12963] [H12964]
 */
 void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
 void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
 
 /*
-** CAPI3REF: Data Change Notification Callbacks
+** CAPI3REF: Data Change Notification Callbacks {H12970} <S60400>
 **
-** Register a callback function with the database connection identified by the 
-** first argument to be invoked whenever a row is updated, inserted or deleted.
-** Any callback set by a previous call to this function for the same 
-** database connection is overridden.
+** The sqlite3_update_hook() interface registers a callback function
+** with the [database connection] identified by the first argument
+** to be invoked whenever a row is updated, inserted or deleted.
+** Any callback set by a previous call to this function
+** for the same database connection is overridden.
 **
-** The second argument is a pointer to the function to invoke when a 
-** row is updated, inserted or deleted. The first argument to the callback is
-** a copy of the third argument to sqlite3_update_hook(). The second callback 
-** argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending
-** on the operation that caused the callback to be invoked. The third and 
-** fourth arguments to the callback contain pointers to the database and 
-** table name containing the affected row. The final callback parameter is 
-** the rowid of the row. In the case of an update, this is the rowid after 
-** the update takes place.
+** The second argument is a pointer to the function to invoke when a
+** row is updated, inserted or deleted.
+** The first argument to the callback is a copy of the third argument
+** to sqlite3_update_hook().
+** The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
+** or [SQLITE_UPDATE], depending on the operation that caused the callback
+** to be invoked.
+** The third and fourth arguments to the callback contain pointers to the
+** database and table name containing the affected row.
+** The final callback parameter is the [rowid] of the row.
+** In the case of an update, this is the [rowid] after the update takes place.
 **
 ** The update hook is not invoked when internal system tables are
 ** modified (i.e. sqlite_master and sqlite_sequence).
 **
-** If another function was previously registered, its pArg value is returned.
-** Otherwise NULL is returned.
+** The update hook implementation must not do anything that will modify
+** the database connection that invoked the update hook.  Any actions
+** to modify the database connection must be deferred until after the
+** completion of the [sqlite3_step()] call that triggered the update hook.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
+**
+** If another function was previously registered, its pArg value
+** is returned.  Otherwise NULL is returned.
+**
+** Requirements:
+** [H12971] [H12973] [H12975] [H12977] [H12979] [H12981] [H12983] [H12986]
 */
 void *sqlite3_update_hook(
   sqlite3*, 
-  void(*)(void *,int ,char const *,char const *,sqlite_int64),
+  void(*)(void *,int ,char const *,char const *,sqlite3_int64),
   void*
 );
 
 /*
-** CAPI3REF:  Enable Or Disable Shared Pager Cache
+** CAPI3REF: Enable Or Disable Shared Pager Cache {H10330} <S30900>
+** KEYWORDS: {shared cache} {shared cache mode}
 **
 ** This routine enables or disables the sharing of the database cache
-** and schema data structures between connections to the same database.
-** Sharing is enabled if the argument is true and disabled if the argument
-** is false.
+** and schema data structures between [database connection | connections]
+** to the same database. Sharing is enabled if the argument is true
+** and disabled if the argument is false.
 **
-** Cache sharing is enabled and disabled on a thread-by-thread basis.
-** Each call to this routine enables or disables cache sharing only for
-** connections created in the same thread in which this routine is called.
-** There is no mechanism for sharing cache between database connections
-** running in different threads.
+** Cache sharing is enabled and disabled for an entire process.
+** This is a change as of SQLite version 3.5.0. In prior versions of SQLite,
+** sharing was enabled or disabled for each thread separately.
 **
-** Sharing must be disabled prior to shutting down a thread or else
-** the thread will leak memory.  Call this routine with an argument of
-** 0 to turn off sharing.  Or use the sqlite3_thread_cleanup() API.
-**
-** This routine must not be called when any database connections
-** are active in the current thread.  Enabling or disabling shared
-** cache while there are active database connections will result
-** in memory corruption.
-**
-** When the shared cache is enabled, the
-** following routines must always be called from the same thread:
-** [sqlite3_open()], [sqlite3_prepare_v2()], [sqlite3_step()],
-** [sqlite3_reset()], [sqlite3_finalize()], and [sqlite3_close()].
-** This is due to the fact that the shared cache makes use of
-** thread-specific storage so that it will be available for sharing
-** with other connections.
+** The cache sharing mode set by this interface effects all subsequent
+** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()].
+** Existing database connections continue use the sharing mode
+** that was in effect at the time they were opened.
 **
 ** Virtual tables cannot be used with a shared cache.  When shared
-** cache is enabled, the sqlite3_create_module() API used to register
+** cache is enabled, the [sqlite3_create_module()] API used to register
 ** virtual tables will always return an error.
 **
-** This routine returns [SQLITE_OK] if shared cache was
-** enabled or disabled successfully.  An [SQLITE_ERROR | error code]
-** is returned otherwise.
+** This routine returns [SQLITE_OK] if shared cache was enabled or disabled
+** successfully.  An [error code] is returned otherwise.
 **
-** Shared cache is disabled by default for backward compatibility.
+** Shared cache is disabled by default. But this might change in
+** future releases of SQLite.  Applications that care about shared
+** cache setting should set it explicitly.
+**
+** See Also:  [SQLite Shared-Cache Mode]
+**
+** Requirements: [H10331] [H10336] [H10337] [H10339]
 */
 int sqlite3_enable_shared_cache(int);
 
 /*
-** CAPI3REF:  Attempt To Free Heap Memory
+** CAPI3REF: Attempt To Free Heap Memory {H17340} <S30220>
 **
-** Attempt to free N bytes of heap memory by deallocating non-essential
-** memory allocations held by the database library (example: memory 
-** used to cache database pages to improve performance).
+** The sqlite3_release_memory() interface attempts to free N bytes
+** of heap memory by deallocating non-essential memory allocations
+** held by the database library. {END}  Memory used to cache database
+** pages to improve performance is an example of non-essential memory.
+** sqlite3_release_memory() returns the number of bytes actually freed,
+** which might be more or less than the amount requested.
 **
-** This function is not a part of standard builds.  It is only created
-** if SQLite is compiled with the SQLITE_ENABLE_MEMORY_MANAGEMENT macro.
+** Requirements: [H17341] [H17342]
 */
 int sqlite3_release_memory(int);
 
 /*
-** CAPI3REF:  Impose A Limit On Heap Size
+** CAPI3REF: Impose A Limit On Heap Size {H17350} <S30220>
 **
-** Place a "soft" limit on the amount of heap memory that may be allocated by
-** SQLite within the current thread. If an internal allocation is requested 
-** that would exceed the specified limit, [sqlite3_release_memory()] is invoked
-** one or more times to free up some space before the allocation is made.
+** The sqlite3_soft_heap_limit() interface places a "soft" limit
+** on the amount of heap memory that may be allocated by SQLite.
+** If an internal allocation is requested that would exceed the
+** soft heap limit, [sqlite3_release_memory()] is invoked one or
+** more times to free up some space before the allocation is performed.
 **
-** The limit is called "soft", because if [sqlite3_release_memory()] cannot free
-** sufficient memory to prevent the limit from being exceeded, the memory is
-** allocated anyway and the current operation proceeds.
-**
-** Prior to shutting down a thread sqlite3_soft_heap_limit() must be set to 
-** zero (the default) or else the thread will leak memory. Alternatively, use
-** the [sqlite3_thread_cleanup()] API.
+** The limit is called "soft", because if [sqlite3_release_memory()]
+** cannot free sufficient memory to prevent the limit from being exceeded,
+** the memory is allocated anyway and the current operation proceeds.
 **
 ** A negative or zero value for N means that there is no soft heap limit and
-** [sqlite3_release_memory()] will only be called when memory is exhaused.
+** [sqlite3_release_memory()] will only be called when memory is exhausted.
 ** The default value for the soft heap limit is zero.
 **
-** SQLite makes a best effort to honor the soft heap limit.  But if it
-** is unable to reduce memory usage below the soft limit, execution will
-** continue without error or notification.  This is why the limit is 
+** SQLite makes a best effort to honor the soft heap limit.
+** But if the soft heap limit cannot be honored, execution will
+** continue without error or notification.  This is why the limit is
 ** called a "soft" limit.  It is advisory only.
 **
-** This function is only available if the library was compiled with the 
-** SQLITE_ENABLE_MEMORY_MANAGEMENT option set.
-** memory-management has been enabled.
+** Prior to SQLite version 3.5.0, this routine only constrained the memory
+** allocated by a single thread - the same thread in which this routine
+** runs.  Beginning with SQLite version 3.5.0, the soft heap limit is
+** applied to all threads. The value specified for the soft heap limit
+** is an upper bound on the total memory allocation for all threads. In
+** version 3.5.0 there is no mechanism for limiting the heap usage for
+** individual threads.
+**
+** Requirements:
+** [H16351] [H16352] [H16353] [H16354] [H16355] [H16358]
 */
 void sqlite3_soft_heap_limit(int);
 
 /*
-** CAPI3REF:  Clean Up Thread Local Storage
+** CAPI3REF: Extract Metadata About A Column Of A Table {H12850} <S60300>
 **
-** This routine makes sure that all thread-local storage has been
-** deallocated for the current thread.
+** This routine returns metadata about a specific column of a specific
+** database table accessible using the [database connection] handle
+** passed as the first function argument.
 **
-** This routine is not technically necessary.  All thread-local storage
-** will be automatically deallocated once memory-management and
-** shared-cache are disabled and the soft heap limit has been set
-** to zero.  This routine is provided as a convenience for users who
-** want to make absolutely sure they have not forgotten something
-** prior to killing off a thread.
-*/
-void sqlite3_thread_cleanup(void);
-
-/*
-** CAPI3REF:  Extract Metadata About A Column Of A Table
-**
-** This routine
-** returns meta-data about a specific column of a specific database
-** table accessible using the connection handle passed as the first function 
-** argument.
-**
-** The column is identified by the second, third and fourth parameters to 
+** The column is identified by the second, third and fourth parameters to
 ** this function. The second parameter is either the name of the database
 ** (i.e. "main", "temp" or an attached database) containing the specified
 ** table or NULL. If it is NULL, then all attached databases are searched
-** for the table using the same algorithm as the database engine uses to 
+** for the table using the same algorithm used by the database engine to
 ** resolve unqualified table references.
 **
-** The third and fourth parameters to this function are the table and column 
-** name of the desired column, respectively. Neither of these parameters 
+** The third and fourth parameters to this function are the table and column
+** name of the desired column, respectively. Neither of these parameters
 ** may be NULL.
 **
-** Meta information is returned by writing to the memory locations passed as
-** the 5th and subsequent parameters to this function. Any of these 
-** arguments may be NULL, in which case the corresponding element of meta 
-** information is ommitted.
+** Metadata is returned by writing to the memory locations passed as the 5th
+** and subsequent parameters to this function. Any of these arguments may be
+** NULL, in which case the corresponding element of metadata is omitted.
 **
-** <pre>
-** Parameter     Output Type      Description
-** -----------------------------------
+** <blockquote>
+** <table border="1">
+** <tr><th> Parameter <th> Output<br>Type <th>  Description
 **
-**   5th         const char*      Data type
-**   6th         const char*      Name of the default collation sequence 
-**   7th         int              True if the column has a NOT NULL constraint
-**   8th         int              True if the column is part of the PRIMARY KEY
-**   9th         int              True if the column is AUTOINCREMENT
-** </pre>
+** <tr><td> 5th <td> const char* <td> Data type
+** <tr><td> 6th <td> const char* <td> Name of default collation sequence
+** <tr><td> 7th <td> int         <td> True if column has a NOT NULL constraint
+** <tr><td> 8th <td> int         <td> True if column is part of the PRIMARY KEY
+** <tr><td> 9th <td> int         <td> True if column is [AUTOINCREMENT]
+** </table>
+** </blockquote>
 **
+** The memory pointed to by the character pointers returned for the
+** declaration type and collation sequence is valid only until the next
+** call to any SQLite API function.
 **
-** The memory pointed to by the character pointers returned for the 
-** declaration type and collation sequence is valid only until the next 
-** call to any sqlite API function.
+** If the specified table is actually a view, an [error code] is returned.
 **
-** If the specified table is actually a view, then an error is returned.
-**
-** If the specified column is "rowid", "oid" or "_rowid_" and an 
-** INTEGER PRIMARY KEY column has been explicitly declared, then the output 
+** If the specified column is "rowid", "oid" or "_rowid_" and an
+** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output
 ** parameters are set for the explicitly declared column. If there is no
-** explicitly declared IPK column, then the output parameters are set as 
-** follows:
+** explicitly declared [INTEGER PRIMARY KEY] column, then the output
+** parameters are set as follows:
 **
 ** <pre>
 **     data type: "INTEGER"
@@ -2250,11 +3920,11 @@
 **
 ** This function may load one or more schemas from database files. If an
 ** error occurs during this process, or if the requested table or column
-** cannot be found, an SQLITE error code is returned and an error message
-** left in the database handle (to be retrieved using sqlite3_errmsg()).
+** cannot be found, an [error code] is returned and an error message left
+** in the [database connection] (to be retrieved using sqlite3_errmsg()).
 **
 ** This API is only available if the library was compiled with the
-** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined.
 */
 int sqlite3_table_column_metadata(
   sqlite3 *db,                /* Connection handle */
@@ -2265,24 +3935,34 @@
   char const **pzCollSeq,     /* OUTPUT: Collation sequence name */
   int *pNotNull,              /* OUTPUT: True if NOT NULL constraint exists */
   int *pPrimaryKey,           /* OUTPUT: True if column part of PK */
-  int *pAutoinc               /* OUTPUT: True if colums is auto-increment */
+  int *pAutoinc               /* OUTPUT: True if column is auto-increment */
 );
 
 /*
-** CAPI3REF: Load An Extension
+** CAPI3REF: Load An Extension {H12600} <S20500>
 **
-** Attempt to load an SQLite extension library contained in the file
-** zFile.  The entry point is zProc.  zProc may be 0 in which case the
-** name of the entry point defaults to "sqlite3_extension_init".
+** This interface loads an SQLite extension library from the named file.
 **
-** Return [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
+** {H12601} The sqlite3_load_extension() interface attempts to load an
+**          SQLite extension library contained in the file zFile.
 **
-** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with 
-** error message text.  The calling function should free this memory
-** by calling [sqlite3_free()].
+** {H12602} The entry point is zProc.
 **
-** Extension loading must be enabled using [sqlite3_enable_load_extension()]
-** prior to calling this API or an error will be returned.
+** {H12603} zProc may be 0, in which case the name of the entry point
+**          defaults to "sqlite3_extension_init".
+**
+** {H12604} The sqlite3_load_extension() interface shall return
+**          [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
+**
+** {H12605} If an error occurs and pzErrMsg is not 0, then the
+**          [sqlite3_load_extension()] interface shall attempt to
+**          fill *pzErrMsg with error message text stored in memory
+**          obtained from [sqlite3_malloc()]. {END}  The calling function
+**          should free this memory by calling [sqlite3_free()].
+**
+** {H12606} Extension loading must be enabled using
+**          [sqlite3_enable_load_extension()] prior to calling this API,
+**          otherwise an error will be returned.
 */
 int sqlite3_load_extension(
   sqlite3 *db,          /* Load the extension into this database connection */
@@ -2292,62 +3972,64 @@
 );
 
 /*
-** CAPI3REF:  Enable Or Disable Extension Loading
+** CAPI3REF: Enable Or Disable Extension Loading {H12620} <S20500>
 **
 ** So as not to open security holes in older applications that are
 ** unprepared to deal with extension loading, and as a means of disabling
-** extension loading while evaluating user-entered SQL, the following
-** API is provided to turn the [sqlite3_load_extension()] mechanism on and
-** off.  It is off by default.  See ticket #1863.
+** extension loading while evaluating user-entered SQL, the following API
+** is provided to turn the [sqlite3_load_extension()] mechanism on and off.
 **
-** Call this routine with onoff==1 to turn extension loading on
-** and call it with onoff==0 to turn it back off again.
+** Extension loading is off by default. See ticket #1863.
+**
+** {H12621} Call the sqlite3_enable_load_extension() routine with onoff==1
+**          to turn extension loading on and call it with onoff==0 to turn
+**          it back off again.
+**
+** {H12622} Extension loading is off by default.
 */
 int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
 
 /*
-** CAPI3REF: Make Arrangements To Automatically Load An Extension
-**
-** Register an extension entry point that is automatically invoked
-** whenever a new database connection is opened using
-** [sqlite3_open()] or [sqlite3_open16()].
+** CAPI3REF: Automatically Load An Extensions {H12640} <S20500>
 **
 ** This API can be invoked at program startup in order to register
 ** one or more statically linked extensions that will be available
-** to all new database connections.
+** to all new [database connections]. {END}
 **
-** Duplicate extensions are detected so calling this routine multiple
-** times with the same extension is harmless.
+** This routine stores a pointer to the extension in an array that is
+** obtained from [sqlite3_malloc()].  If you run a memory leak checker
+** on your program and it reports a leak because of this array, invoke
+** [sqlite3_reset_auto_extension()] prior to shutdown to free the memory.
 **
-** This routine stores a pointer to the extension in an array
-** that is obtained from malloc().  If you run a memory leak
-** checker on your program and it reports a leak because of this
-** array, then invoke [sqlite3_automatic_extension_reset()] prior
-** to shutdown to free the memory.
+** {H12641} This function registers an extension entry point that is
+**          automatically invoked whenever a new [database connection]
+**          is opened using [sqlite3_open()], [sqlite3_open16()],
+**          or [sqlite3_open_v2()].
 **
-** Automatic extensions apply across all threads.
+** {H12642} Duplicate extensions are detected so calling this routine
+**          multiple times with the same extension is harmless.
 **
-** This interface is experimental and is subject to change or
-** removal in future releases of SQLite.
+** {H12643} This routine stores a pointer to the extension in an array
+**          that is obtained from [sqlite3_malloc()].
+**
+** {H12644} Automatic extensions apply across all threads.
 */
-int sqlite3_auto_extension(void *xEntryPoint);
-
+int sqlite3_auto_extension(void (*xEntryPoint)(void));
 
 /*
-** CAPI3REF: Reset Automatic Extension Loading
+** CAPI3REF: Reset Automatic Extension Loading {H12660} <S20500>
 **
-** Disable all previously registered automatic extensions.  This
-** routine undoes the effect of all prior [sqlite3_automatic_extension()]
-** calls.
+** This function disables all previously registered automatic
+** extensions. {END}  It undoes the effect of all prior
+** [sqlite3_auto_extension()] calls.
 **
-** This call disabled automatic extensions in all threads.
+** {H12661} This function disables all previously registered
+**          automatic extensions.
 **
-** This interface is experimental and is subject to change or
-** removal in future releases of SQLite.
+** {H12662} This function disables automatic extensions in all threads.
 */
 void sqlite3_reset_auto_extension(void);
 
-
 /*
 ****** EXPERIMENTAL - subject to change without notice **************
 **
@@ -2355,7 +4037,7 @@
 ** to be experimental.  The interface might change in incompatible ways.
 ** If this is a problem for you, do not use the interface at this time.
 **
-** When the virtual-table mechanism stablizes, we will declare the
+** When the virtual-table mechanism stabilizes, we will declare the
 ** interface fixed, support it indefinitely, and remove this comment.
 */
 
@@ -2368,9 +4050,16 @@
 typedef struct sqlite3_module sqlite3_module;
 
 /*
+** CAPI3REF: Virtual Table Object {H18000} <S20400>
+** KEYWORDS: sqlite3_module
+** EXPERIMENTAL
+**
 ** A module is a class of virtual tables.  Each module is defined
 ** by an instance of the following structure.  This structure consists
 ** mostly of methods for the module.
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
 struct sqlite3_module {
   int iVersion;
@@ -2390,8 +4079,8 @@
   int (*xNext)(sqlite3_vtab_cursor*);
   int (*xEof)(sqlite3_vtab_cursor*);
   int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
-  int (*xRowid)(sqlite3_vtab_cursor*, sqlite_int64 *pRowid);
-  int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite_int64 *);
+  int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
+  int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
   int (*xBegin)(sqlite3_vtab *pVTab);
   int (*xSync)(sqlite3_vtab *pVTab);
   int (*xCommit)(sqlite3_vtab *pVTab);
@@ -2399,28 +4088,32 @@
   int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
                        void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
                        void **ppArg);
+  int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
 };
 
 /*
+** CAPI3REF: Virtual Table Indexing Information {H18100} <S20400>
+** KEYWORDS: sqlite3_index_info
+** EXPERIMENTAL
+**
 ** The sqlite3_index_info structure and its substructures is used to
 ** pass information into and receive the reply from the xBestIndex
 ** method of an sqlite3_module.  The fields under **Inputs** are the
 ** inputs to xBestIndex and are read-only.  xBestIndex inserts its
 ** results into the **Outputs** fields.
 **
-** The aConstraint[] array records WHERE clause constraints of the
-** form:
+** The aConstraint[] array records WHERE clause constraints of the form:
 **
-**         column OP expr
+** <pre>column OP expr</pre>
 **
-** Where OP is =, <, <=, >, or >=.  The particular operator is stored
-** in aConstraint[].op.  The index of the column is stored in 
+** where OP is =, &lt;, &lt;=, &gt;, or &gt;=.  The particular operator is
+** stored in aConstraint[].op.  The index of the column is stored in
 ** aConstraint[].iColumn.  aConstraint[].usable is TRUE if the
 ** expr on the right-hand side can be evaluated (and thus the constraint
 ** is usable) and false if it cannot.
 **
 ** The optimizer automatically inverts terms of the form "expr OP column"
-** and makes other simplificatinos to the WHERE clause in an attempt to
+** and makes other simplifications to the WHERE clause in an attempt to
 ** get as many WHERE clause terms into the form shown above as possible.
 ** The aConstraint[] array only reports WHERE clause terms in the correct
 ** form that refer to the particular virtual table being queried.
@@ -2446,27 +4139,29 @@
 ** particular lookup.  A full scan of a table with N entries should have
 ** a cost of N.  A binary search of a table of N entries should have a
 ** cost of approximately log(N).
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
 struct sqlite3_index_info {
   /* Inputs */
-  const int nConstraint;     /* Number of entries in aConstraint */
-  const struct sqlite3_index_constraint {
+  int nConstraint;           /* Number of entries in aConstraint */
+  struct sqlite3_index_constraint {
      int iColumn;              /* Column on left-hand side of constraint */
      unsigned char op;         /* Constraint operator */
      unsigned char usable;     /* True if this constraint is usable */
      int iTermOffset;          /* Used internally - xBestIndex should ignore */
-  } *const aConstraint;      /* Table of WHERE clause constraints */
-  const int nOrderBy;        /* Number of terms in the ORDER BY clause */
-  const struct sqlite3_index_orderby {
+  } *aConstraint;            /* Table of WHERE clause constraints */
+  int nOrderBy;              /* Number of terms in the ORDER BY clause */
+  struct sqlite3_index_orderby {
      int iColumn;              /* Column number */
      unsigned char desc;       /* True for DESC.  False for ASC. */
-  } *const aOrderBy;         /* The ORDER BY clause */
-
+  } *aOrderBy;               /* The ORDER BY clause */
   /* Outputs */
   struct sqlite3_index_constraint_usage {
     int argvIndex;           /* if >0, constraint is part of argv to xFilter */
     unsigned char omit;      /* Do not code a test for this constraint */
-  } *const aConstraintUsage;
+  } *aConstraintUsage;
   int idxNum;                /* Number used to identify the index */
   char *idxStr;              /* String, possibly obtained from sqlite3_malloc */
   int needToFreeIdxStr;      /* Free idxStr using sqlite3_free() if true */
@@ -2481,12 +4176,18 @@
 #define SQLITE_INDEX_CONSTRAINT_MATCH 64
 
 /*
-** This routine is used to register a new module name with an SQLite
-** connection.  Module names must be registered before creating new
-** virtual tables on the module, or before using preexisting virtual
-** tables of the module.
+** CAPI3REF: Register A Virtual Table Implementation {H18200} <S20400>
+** EXPERIMENTAL
+**
+** This routine is used to register a new module name with a
+** [database connection].  Module names must be registered before
+** creating new virtual tables on the module, or before using
+** preexisting virtual tables of the module.
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
-int sqlite3_create_module(
+SQLITE_EXPERIMENTAL int sqlite3_create_module(
   sqlite3 *db,               /* SQLite connection to register module with */
   const char *zName,         /* Name of the module */
   const sqlite3_module *,    /* Methods for the module */
@@ -2494,21 +4195,44 @@
 );
 
 /*
+** CAPI3REF: Register A Virtual Table Implementation {H18210} <S20400>
+** EXPERIMENTAL
+**
+** This routine is identical to the [sqlite3_create_module()] method above,
+** except that it allows a destructor function to be specified. It is
+** even more experimental than the rest of the virtual tables API.
+*/
+SQLITE_EXPERIMENTAL int sqlite3_create_module_v2(
+  sqlite3 *db,               /* SQLite connection to register module with */
+  const char *zName,         /* Name of the module */
+  const sqlite3_module *,    /* Methods for the module */
+  void *,                    /* Client data for xCreate/xConnect */
+  void(*xDestroy)(void*)     /* Module destructor function */
+);
+
+/*
+** CAPI3REF: Virtual Table Instance Object {H18010} <S20400>
+** KEYWORDS: sqlite3_vtab
+** EXPERIMENTAL
+**
 ** Every module implementation uses a subclass of the following structure
 ** to describe a particular instance of the module.  Each subclass will
-** be taylored to the specific needs of the module implementation.   The
-** purpose of this superclass is to define certain fields that are common
-** to all module implementations.
+** be tailored to the specific needs of the module implementation.
+** The purpose of this superclass is to define certain fields that are
+** common to all module implementations.
 **
 ** Virtual tables methods can set an error message by assigning a
-** string obtained from sqlite3_mprintf() to zErrMsg.  The method should
-** take care that any prior string is freed by a call to sqlite3_free()
+** string obtained from [sqlite3_mprintf()] to zErrMsg.  The method should
+** take care that any prior string is freed by a call to [sqlite3_free()]
 ** prior to assigning a new string to zErrMsg.  After the error message
 ** is delivered up to the client application, the string will be automatically
 ** freed by sqlite3_free() and the zErrMsg field will be zeroed.  Note
 ** that sqlite3_mprintf() and sqlite3_free() are used on the zErrMsg field
 ** since virtual tables are commonly implemented in loadable extensions which
 ** do not have access to sqlite3MPrintf() or sqlite3Free().
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
 struct sqlite3_vtab {
   const sqlite3_module *pModule;  /* The module for this virtual table */
@@ -2517,7 +4241,12 @@
   /* Virtual table implementations will typically add additional fields */
 };
 
-/* Every module implementation uses a subclass of the following structure
+/*
+** CAPI3REF: Virtual Table Cursor Object  {H18020} <S20400>
+** KEYWORDS: sqlite3_vtab_cursor
+** EXPERIMENTAL
+**
+** Every module implementation uses a subclass of the following structure
 ** to describe cursors that point into the virtual table and are used
 ** to loop through the virtual table.  Cursors are created using the
 ** xOpen method of the module.  Each module implementation will define
@@ -2525,6 +4254,9 @@
 **
 ** This superclass exists in order to define fields of the cursor that
 ** are common to all implementations.
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
 struct sqlite3_vtab_cursor {
   sqlite3_vtab *pVtab;      /* Virtual table of this cursor */
@@ -2532,13 +4264,22 @@
 };
 
 /*
+** CAPI3REF: Declare The Schema Of A Virtual Table {H18280} <S20400>
+** EXPERIMENTAL
+**
 ** The xCreate and xConnect methods of a module use the following API
 ** to declare the format (the names and datatypes of the columns) of
 ** the virtual tables they implement.
+**
+** This interface is experimental and is subject to change or
+** removal in future releases of SQLite.
 */
-int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable);
+SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable);
 
 /*
+** CAPI3REF: Overload A Function For A Virtual Table {H18300} <S20400>
+** EXPERIMENTAL
+**
 ** Virtual tables can provide alternative implementations of functions
 ** using the xFindFunction method.  But global versions of those functions
 ** must exist in order to be overloaded.
@@ -2548,13 +4289,13 @@
 ** before this API is called, a new function is created.  The implementation
 ** of the new function always causes an exception to be thrown.  So
 ** the new function is not good for anything by itself.  Its only
-** purpose is to be a place-holder function that can be overloaded
+** purpose is to be a placeholder function that can be overloaded
 ** by virtual tables.
 **
 ** This API should be considered part of the virtual table interface,
 ** which is experimental and subject to change.
 */
-int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
+SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
 
 /*
 ** The interface to the virtual-table mechanism defined above (back up
@@ -2562,110 +4303,1178 @@
 ** to be experimental.  The interface might change in incompatible ways.
 ** If this is a problem for you, do not use the interface at this time.
 **
-** When the virtual-table mechanism stablizes, we will declare the
+** When the virtual-table mechanism stabilizes, we will declare the
 ** interface fixed, support it indefinitely, and remove this comment.
 **
 ****** EXPERIMENTAL - subject to change without notice **************
 */
 
 /*
-** CAPI3REF: A Handle To An Open BLOB
+** CAPI3REF: A Handle To An Open BLOB {H17800} <S30230>
+** KEYWORDS: {BLOB handle} {BLOB handles}
 **
-** An instance of the following opaque structure is used to 
-** represent an blob-handle.  A blob-handle is created by
-** [sqlite3_blob_open()] and destroyed by [sqlite3_blob_close()].
+** An instance of this object represents an open BLOB on which
+** [sqlite3_blob_open | incremental BLOB I/O] can be performed.
+** Objects of this type are created by [sqlite3_blob_open()]
+** and destroyed by [sqlite3_blob_close()].
 ** The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces
-** can be used to read or write small subsections of the blob.
-** The [sqltie3_blob_size()] interface returns the size of the
-** blob in bytes.
+** can be used to read or write small subsections of the BLOB.
+** The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes.
 */
 typedef struct sqlite3_blob sqlite3_blob;
 
 /*
-** CAPI3REF: Open A BLOB For Incremental I/O
+** CAPI3REF: Open A BLOB For Incremental I/O {H17810} <S30230>
 **
-** Open a handle to the blob located in row iRow,, column zColumn, 
-** table zTable in database zDb. i.e. the same blob that would
-** be selected by:
+** This interfaces opens a [BLOB handle | handle] to the BLOB located
+** in row iRow, column zColumn, table zTable in database zDb;
+** in other words, the same BLOB that would be selected by:
 **
 ** <pre>
-**     SELECT zColumn FROM zDb.zTable WHERE rowid = iRow;
-** </pre>
+**     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+** </pre> {END}
 **
-** If the flags parameter is non-zero, the blob is opened for 
-** read and write access. If it is zero, the blob is opened for read 
-** access.
+** If the flags parameter is non-zero, the the BLOB is opened for read
+** and write access. If it is zero, the BLOB is opened for read access.
 **
-** On success, [SQLITE_OK] is returned and the new 
-** [sqlite3_blob | blob handle] is written to *ppBlob.
-** Otherwise an error code is returned and 
-** any value written to *ppBlob should not be used by the caller.
-** This function sets the database-handle error code and message
+** Note that the database name is not the filename that contains
+** the database but rather the symbolic name of the database that
+** is assigned when the database is connected using [ATTACH].
+** For the main database file, the database name is "main".
+** For TEMP tables, the database name is "temp".
+**
+** On success, [SQLITE_OK] is returned and the new [BLOB handle] is written
+** to *ppBlob. Otherwise an [error code] is returned and any value written
+** to *ppBlob should not be used by the caller.
+** This function sets the [database connection] error code and message
 ** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()].
+**
+** If the row that a BLOB handle points to is modified by an
+** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects
+** then the BLOB handle is marked as "expired".
+** This is true if any column of the row is changed, even a column
+** other than the one the BLOB handle is open on.
+** Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for
+** a expired BLOB handle fail with an return code of [SQLITE_ABORT].
+** Changes written into a BLOB prior to the BLOB expiring are not
+** rollback by the expiration of the BLOB.  Such changes will eventually
+** commit if the transaction continues to completion.
+**
+** Requirements:
+** [H17813] [H17814] [H17816] [H17819] [H17821] [H17824]
 */
 int sqlite3_blob_open(
   sqlite3*,
   const char *zDb,
   const char *zTable,
   const char *zColumn,
-  sqlite_int64 iRow,
+  sqlite3_int64 iRow,
   int flags,
   sqlite3_blob **ppBlob
 );
 
 /*
-** CAPI3REF:  Close A BLOB Handle
+** CAPI3REF: Close A BLOB Handle {H17830} <S30230>
 **
-** Close an open [sqlite3_blob | blob handle].
+** Closes an open [BLOB handle].
+**
+** Closing a BLOB shall cause the current transaction to commit
+** if there are no other BLOBs, no pending prepared statements, and the
+** database connection is in [autocommit mode].
+** If any writes were made to the BLOB, they might be held in cache
+** until the close operation if they will fit. {END}
+**
+** Closing the BLOB often forces the changes
+** out to disk and so if any I/O errors occur, they will likely occur
+** at the time when the BLOB is closed.  {H17833} Any errors that occur during
+** closing are reported as a non-zero return value.
+**
+** The BLOB is closed unconditionally.  Even if this routine returns
+** an error code, the BLOB is still closed.
+**
+** Requirements:
+** [H17833] [H17836] [H17839]
 */
 int sqlite3_blob_close(sqlite3_blob *);
 
 /*
-** CAPI3REF:  Return The Size Of An Open BLOB
+** CAPI3REF: Return The Size Of An Open BLOB {H17840} <S30230>
 **
-** Return the size in bytes of the blob accessible via the open 
-** [sqlite3_blob | blob-handle] passed as an argument.
+** Returns the size in bytes of the BLOB accessible via the open
+** []BLOB handle] in its only argument.
+**
+** Requirements:
+** [H17843]
 */
 int sqlite3_blob_bytes(sqlite3_blob *);
 
 /*
-** CAPI3REF:  Read Data From A BLOB Incrementally
+** CAPI3REF: Read Data From A BLOB Incrementally {H17850} <S30230>
 **
-** This function is used to read data from an open 
-** [sqlite3_blob | blob-handle] into a caller supplied buffer.
-** n bytes of data are copied into buffer
-** z from the open blob, starting at offset iOffset.
+** This function is used to read data from an open [BLOB handle] into a
+** caller-supplied buffer. N bytes of data are copied into buffer Z
+** from the open BLOB, starting at offset iOffset.
 **
-** On success, SQLITE_OK is returned. Otherwise, an 
-** [SQLITE_ERROR | SQLite error code] or an
-** [SQLITE_IOERR_READ | extended error code] is returned.
+** If offset iOffset is less than N bytes from the end of the BLOB,
+** [SQLITE_ERROR] is returned and no data is read.  If N or iOffset is
+** less than zero, [SQLITE_ERROR] is returned and no data is read.
+**
+** An attempt to read from an expired [BLOB handle] fails with an
+** error code of [SQLITE_ABORT].
+**
+** On success, SQLITE_OK is returned.
+** Otherwise, an [error code] or an [extended error code] is returned.
+**
+** Requirements:
+** [H17853] [H17856] [H17859] [H17862] [H17863] [H17865] [H17868]
 */
-int sqlite3_blob_read(sqlite3_blob *, void *z, int n, int iOffset);
+int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
 
 /*
-** CAPI3REF:  Write Data Into A BLOB Incrementally
+** CAPI3REF: Write Data Into A BLOB Incrementally {H17870} <S30230>
 **
-** This function is used to write data into an open 
-** [sqlite3_blob | blob-handle] from a user supplied buffer.
-** n bytes of data are copied from the buffer
-** pointed to by z into the open blob, starting at offset iOffset.
+** This function is used to write data into an open [BLOB handle] from a
+** caller-supplied buffer. N bytes of data are copied from the buffer Z
+** into the open BLOB, starting at offset iOffset.
 **
-** If the [sqlite3_blob | blob-handle] passed as the first argument
-** was not opened for writing (the flags parameter to [sqlite3_blob_open()]
-*** was zero), this function returns [SQLITE_READONLY].
+** If the [BLOB handle] passed as the first argument was not opened for
+** writing (the flags parameter to [sqlite3_blob_open()] was zero),
+** this function returns [SQLITE_READONLY].
 **
-** This function may only modify the contents of the blob, it is
-** not possible to increase the size of a blob using this API. If
-** offset iOffset is less than n bytes from the end of the blob, 
-** [SQLITE_ERROR] is returned and no data is written.
+** This function may only modify the contents of the BLOB; it is
+** not possible to increase the size of a BLOB using this API.
+** If offset iOffset is less than N bytes from the end of the BLOB,
+** [SQLITE_ERROR] is returned and no data is written.  If N is
+** less than zero [SQLITE_ERROR] is returned and no data is written.
 **
-** On success, SQLITE_OK is returned. Otherwise, an 
-** [SQLITE_ERROR | SQLite error code] or an
-** [SQLITE_IOERR_READ | extended error code] is returned.
+** An attempt to write to an expired [BLOB handle] fails with an
+** error code of [SQLITE_ABORT].  Writes to the BLOB that occurred
+** before the [BLOB handle] expired are not rolled back by the
+** expiration of the handle, though of course those changes might
+** have been overwritten by the statement that expired the BLOB handle
+** or by other independent statements.
+**
+** On success, SQLITE_OK is returned.
+** Otherwise, an  [error code] or an [extended error code] is returned.
+**
+** Requirements:
+** [H17873] [H17874] [H17875] [H17876] [H17877] [H17879] [H17882] [H17885]
+** [H17888]
 */
 int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
 
 /*
+** CAPI3REF: Virtual File System Objects {H11200} <S20100>
+**
+** A virtual filesystem (VFS) is an [sqlite3_vfs] object
+** that SQLite uses to interact
+** with the underlying operating system.  Most SQLite builds come with a
+** single default VFS that is appropriate for the host computer.
+** New VFSes can be registered and existing VFSes can be unregistered.
+** The following interfaces are provided.
+**
+** The sqlite3_vfs_find() interface returns a pointer to a VFS given its name.
+** Names are case sensitive.
+** Names are zero-terminated UTF-8 strings.
+** If there is no match, a NULL pointer is returned.
+** If zVfsName is NULL then the default VFS is returned.
+**
+** New VFSes are registered with sqlite3_vfs_register().
+** Each new VFS becomes the default VFS if the makeDflt flag is set.
+** The same VFS can be registered multiple times without injury.
+** To make an existing VFS into the default VFS, register it again
+** with the makeDflt flag set.  If two different VFSes with the
+** same name are registered, the behavior is undefined.  If a
+** VFS is registered with a name that is NULL or an empty string,
+** then the behavior is undefined.
+**
+** Unregister a VFS with the sqlite3_vfs_unregister() interface.
+** If the default VFS is unregistered, another VFS is chosen as
+** the default.  The choice for the new VFS is arbitrary.
+**
+** Requirements:
+** [H11203] [H11206] [H11209] [H11212] [H11215] [H11218]
+*/
+sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
+int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
+int sqlite3_vfs_unregister(sqlite3_vfs*);
+
+/*
+** CAPI3REF: Mutexes {H17000} <S20000>
+**
+** The SQLite core uses these routines for thread
+** synchronization. Though they are intended for internal
+** use by SQLite, code that links against SQLite is
+** permitted to use any of these routines.
+**
+** The SQLite source code contains multiple implementations
+** of these mutex routines.  An appropriate implementation
+** is selected automatically at compile-time.  The following
+** implementations are available in the SQLite core:
+**
+** <ul>
+** <li>   SQLITE_MUTEX_OS2
+** <li>   SQLITE_MUTEX_PTHREAD
+** <li>   SQLITE_MUTEX_W32
+** <li>   SQLITE_MUTEX_NOOP
+** </ul>
+**
+** The SQLITE_MUTEX_NOOP implementation is a set of routines
+** that does no real locking and is appropriate for use in
+** a single-threaded application.  The SQLITE_MUTEX_OS2,
+** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations
+** are appropriate for use on OS/2, Unix, and Windows.
+**
+** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
+** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex
+** implementation is included with the library. In this case the
+** application must supply a custom mutex implementation using the
+** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function
+** before calling sqlite3_initialize() or any other public sqlite3_
+** function that calls sqlite3_initialize().
+**
+** {H17011} The sqlite3_mutex_alloc() routine allocates a new
+** mutex and returns a pointer to it. {H17012} If it returns NULL
+** that means that a mutex could not be allocated. {H17013} SQLite
+** will unwind its stack and return an error. {H17014} The argument
+** to sqlite3_mutex_alloc() is one of these integer constants:
+**
+** <ul>
+** <li>  SQLITE_MUTEX_FAST
+** <li>  SQLITE_MUTEX_RECURSIVE
+** <li>  SQLITE_MUTEX_STATIC_MASTER
+** <li>  SQLITE_MUTEX_STATIC_MEM
+** <li>  SQLITE_MUTEX_STATIC_MEM2
+** <li>  SQLITE_MUTEX_STATIC_PRNG
+** <li>  SQLITE_MUTEX_STATIC_LRU
+** <li>  SQLITE_MUTEX_STATIC_LRU2
+** </ul>
+**
+** {H17015} The first two constants cause sqlite3_mutex_alloc() to create
+** a new mutex.  The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
+** is used but not necessarily so when SQLITE_MUTEX_FAST is used. {END}
+** The mutex implementation does not need to make a distinction
+** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
+** not want to.  {H17016} But SQLite will only request a recursive mutex in
+** cases where it really needs one.  {END} If a faster non-recursive mutex
+** implementation is available on the host platform, the mutex subsystem
+** might return such a mutex in response to SQLITE_MUTEX_FAST.
+**
+** {H17017} The other allowed parameters to sqlite3_mutex_alloc() each return
+** a pointer to a static preexisting mutex. {END}  Four static mutexes are
+** used by the current version of SQLite.  Future versions of SQLite
+** may add additional static mutexes.  Static mutexes are for internal
+** use by SQLite only.  Applications that use SQLite mutexes should
+** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
+** SQLITE_MUTEX_RECURSIVE.
+**
+** {H17018} Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
+** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
+** returns a different mutex on every call.  {H17034} But for the static
+** mutex types, the same mutex is returned on every call that has
+** the same type number.
+**
+** {H17019} The sqlite3_mutex_free() routine deallocates a previously
+** allocated dynamic mutex. {H17020} SQLite is careful to deallocate every
+** dynamic mutex that it allocates. {A17021} The dynamic mutexes must not be in
+** use when they are deallocated. {A17022} Attempting to deallocate a static
+** mutex results in undefined behavior. {H17023} SQLite never deallocates
+** a static mutex. {END}
+**
+** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
+** to enter a mutex. {H17024} If another thread is already within the mutex,
+** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
+** SQLITE_BUSY. {H17025}  The sqlite3_mutex_try() interface returns [SQLITE_OK]
+** upon successful entry.  {H17026} Mutexes created using
+** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread.
+** {H17027} In such cases the,
+** mutex must be exited an equal number of times before another thread
+** can enter.  {A17028} If the same thread tries to enter any other
+** kind of mutex more than once, the behavior is undefined.
+** {H17029} SQLite will never exhibit
+** such behavior in its own use of mutexes.
+**
+** Some systems (for example, Windows 95) do not support the operation
+** implemented by sqlite3_mutex_try().  On those systems, sqlite3_mutex_try()
+** will always return SQLITE_BUSY.  {H17030} The SQLite core only ever uses
+** sqlite3_mutex_try() as an optimization so this is acceptable behavior.
+**
+** {H17031} The sqlite3_mutex_leave() routine exits a mutex that was
+** previously entered by the same thread.  {A17032} The behavior
+** is undefined if the mutex is not currently entered by the
+** calling thread or is not currently allocated.  {H17033} SQLite will
+** never do either. {END}
+**
+** If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or
+** sqlite3_mutex_leave() is a NULL pointer, then all three routines
+** behave as no-ops.
+**
+** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
+*/
+sqlite3_mutex *sqlite3_mutex_alloc(int);
+void sqlite3_mutex_free(sqlite3_mutex*);
+void sqlite3_mutex_enter(sqlite3_mutex*);
+int sqlite3_mutex_try(sqlite3_mutex*);
+void sqlite3_mutex_leave(sqlite3_mutex*);
+
+/*
+** CAPI3REF: Mutex Methods Object {H17120} <S20130>
+** EXPERIMENTAL
+**
+** An instance of this structure defines the low-level routines
+** used to allocate and use mutexes.
+**
+** Usually, the default mutex implementations provided by SQLite are
+** sufficient, however the user has the option of substituting a custom
+** implementation for specialized deployments or systems for which SQLite
+** does not provide a suitable implementation. In this case, the user
+** creates and populates an instance of this structure to pass
+** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
+** Additionally, an instance of this structure can be used as an
+** output variable when querying the system for the current mutex
+** implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
+**
+** The xMutexInit method defined by this structure is invoked as
+** part of system initialization by the sqlite3_initialize() function.
+** {H17001} The xMutexInit routine shall be called by SQLite once for each
+** effective call to [sqlite3_initialize()].
+**
+** The xMutexEnd method defined by this structure is invoked as
+** part of system shutdown by the sqlite3_shutdown() function. The
+** implementation of this method is expected to release all outstanding
+** resources obtained by the mutex methods implementation, especially
+** those obtained by the xMutexInit method. {H17003} The xMutexEnd()
+** interface shall be invoked once for each call to [sqlite3_shutdown()].
+**
+** The remaining seven methods defined by this structure (xMutexAlloc,
+** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
+** xMutexNotheld) implement the following interfaces (respectively):
+**
+** <ul>
+**   <li>  [sqlite3_mutex_alloc()] </li>
+**   <li>  [sqlite3_mutex_free()] </li>
+**   <li>  [sqlite3_mutex_enter()] </li>
+**   <li>  [sqlite3_mutex_try()] </li>
+**   <li>  [sqlite3_mutex_leave()] </li>
+**   <li>  [sqlite3_mutex_held()] </li>
+**   <li>  [sqlite3_mutex_notheld()] </li>
+** </ul>
+**
+** The only difference is that the public sqlite3_XXX functions enumerated
+** above silently ignore any invocations that pass a NULL pointer instead
+** of a valid mutex handle. The implementations of the methods defined
+** by this structure are not required to handle this case, the results
+** of passing a NULL pointer instead of a valid mutex handle are undefined
+** (i.e. it is acceptable to provide an implementation that segfaults if
+** it is passed a NULL pointer).
+*/
+typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
+struct sqlite3_mutex_methods {
+  int (*xMutexInit)(void);
+  int (*xMutexEnd)(void);
+  sqlite3_mutex *(*xMutexAlloc)(int);
+  void (*xMutexFree)(sqlite3_mutex *);
+  void (*xMutexEnter)(sqlite3_mutex *);
+  int (*xMutexTry)(sqlite3_mutex *);
+  void (*xMutexLeave)(sqlite3_mutex *);
+  int (*xMutexHeld)(sqlite3_mutex *);
+  int (*xMutexNotheld)(sqlite3_mutex *);
+};
+
+/*
+** CAPI3REF: Mutex Verification Routines {H17080} <S20130> <S30800>
+**
+** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines
+** are intended for use inside assert() statements. {H17081} The SQLite core
+** never uses these routines except inside an assert() and applications
+** are advised to follow the lead of the core.  {H17082} The core only
+** provides implementations for these routines when it is compiled
+** with the SQLITE_DEBUG flag.  {A17087} External mutex implementations
+** are only required to provide these routines if SQLITE_DEBUG is
+** defined and if NDEBUG is not defined.
+**
+** {H17083} These routines should return true if the mutex in their argument
+** is held or not held, respectively, by the calling thread.
+**
+** {X17084} The implementation is not required to provided versions of these
+** routines that actually work. If the implementation does not provide working
+** versions of these routines, it should at least provide stubs that always
+** return true so that one does not get spurious assertion failures.
+**
+** {H17085} If the argument to sqlite3_mutex_held() is a NULL pointer then
+** the routine should return 1.  {END} This seems counter-intuitive since
+** clearly the mutex cannot be held if it does not exist.  But the
+** the reason the mutex does not exist is because the build is not
+** using mutexes.  And we do not want the assert() containing the
+** call to sqlite3_mutex_held() to fail, so a non-zero return is
+** the appropriate thing to do.  {H17086} The sqlite3_mutex_notheld()
+** interface should also return 1 when given a NULL pointer.
+*/
+int sqlite3_mutex_held(sqlite3_mutex*);
+int sqlite3_mutex_notheld(sqlite3_mutex*);
+
+/*
+** CAPI3REF: Mutex Types {H17001} <H17000>
+**
+** The [sqlite3_mutex_alloc()] interface takes a single argument
+** which is one of these integer constants.
+**
+** The set of static mutexes may change from one SQLite release to the
+** next.  Applications that override the built-in mutex logic must be
+** prepared to accommodate additional static mutexes.
+*/
+#define SQLITE_MUTEX_FAST             0
+#define SQLITE_MUTEX_RECURSIVE        1
+#define SQLITE_MUTEX_STATIC_MASTER    2
+#define SQLITE_MUTEX_STATIC_MEM       3  /* sqlite3_malloc() */
+#define SQLITE_MUTEX_STATIC_MEM2      4  /* NOT USED */
+#define SQLITE_MUTEX_STATIC_OPEN      4  /* sqlite3BtreeOpen() */
+#define SQLITE_MUTEX_STATIC_PRNG      5  /* sqlite3_random() */
+#define SQLITE_MUTEX_STATIC_LRU       6  /* lru page list */
+#define SQLITE_MUTEX_STATIC_LRU2      7  /* lru page list */
+
+/*
+** CAPI3REF: Retrieve the mutex for a database connection {H17002} <H17000>
+**
+** This interface returns a pointer the [sqlite3_mutex] object that 
+** serializes access to the [database connection] given in the argument
+** when the [threading mode] is Serialized.
+** If the [threading mode] is Single-thread or Multi-thread then this
+** routine returns a NULL pointer.
+*/
+sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
+
+/*
+** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
+**
+** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
+** xFileControl method for the [sqlite3_io_methods] object associated
+** with a particular database identified by the second argument. {H11302} The
+** name of the database is the name assigned to the database by the
+** <a href="lang_attach.html">ATTACH</a> SQL command that opened the
+** database. {H11303} To control the main database file, use the name "main"
+** or a NULL pointer. {H11304} The third and fourth parameters to this routine
+** are passed directly through to the second and third parameters of
+** the xFileControl method.  {H11305} The return value of the xFileControl
+** method becomes the return value of this routine.
+**
+** {H11306} If the second parameter (zDbName) does not match the name of any
+** open database file, then SQLITE_ERROR is returned. {H11307} This error
+** code is not remembered and will not be recalled by [sqlite3_errcode()]
+** or [sqlite3_errmsg()]. {A11308} The underlying xFileControl method might
+** also return SQLITE_ERROR.  {A11309} There is no way to distinguish between
+** an incorrect zDbName and an SQLITE_ERROR return from the underlying
+** xFileControl method. {END}
+**
+** See also: [SQLITE_FCNTL_LOCKSTATE]
+*/
+int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
+
+/*
+** CAPI3REF: Testing Interface {H11400} <S30800>
+**
+** The sqlite3_test_control() interface is used to read out internal
+** state of SQLite and to inject faults into SQLite for testing
+** purposes.  The first parameter is an operation code that determines
+** the number, meaning, and operation of all subsequent parameters.
+**
+** This interface is not for use by applications.  It exists solely
+** for verifying the correct operation of the SQLite library.  Depending
+** on how the SQLite library is compiled, this interface might not exist.
+**
+** The details of the operation codes, their meanings, the parameters
+** they take, and what they do are all subject to change without notice.
+** Unlike most of the SQLite API, this function is not guaranteed to
+** operate consistently from one release to the next.
+*/
+int sqlite3_test_control(int op, ...);
+
+/*
+** CAPI3REF: Testing Interface Operation Codes {H11410} <H11400>
+**
+** These constants are the valid operation code parameters used
+** as the first argument to [sqlite3_test_control()].
+**
+** These parameters and their meanings are subject to change
+** without notice.  These values are for testing purposes only.
+** Applications should not use any of these parameters or the
+** [sqlite3_test_control()] interface.
+*/
+#define SQLITE_TESTCTRL_PRNG_SAVE                5
+#define SQLITE_TESTCTRL_PRNG_RESTORE             6
+#define SQLITE_TESTCTRL_PRNG_RESET               7
+#define SQLITE_TESTCTRL_BITVEC_TEST              8
+#define SQLITE_TESTCTRL_FAULT_INSTALL            9
+#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS     10
+#define SQLITE_TESTCTRL_PENDING_BYTE            11
+
+/*
+** CAPI3REF: SQLite Runtime Status {H17200} <S60200>
+** EXPERIMENTAL
+**
+** This interface is used to retrieve runtime status information
+** about the preformance of SQLite, and optionally to reset various
+** highwater marks.  The first argument is an integer code for
+** the specific parameter to measure.  Recognized integer codes
+** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].
+** The current value of the parameter is returned into *pCurrent.
+** The highest recorded value is returned in *pHighwater.  If the
+** resetFlag is true, then the highest record value is reset after
+** *pHighwater is written. Some parameters do not record the highest
+** value.  For those parameters
+** nothing is written into *pHighwater and the resetFlag is ignored.
+** Other parameters record only the highwater mark and not the current
+** value.  For these latter parameters nothing is written into *pCurrent.
+**
+** This routine returns SQLITE_OK on success and a non-zero
+** [error code] on failure.
+**
+** This routine is threadsafe but is not atomic.  This routine can
+** called while other threads are running the same or different SQLite
+** interfaces.  However the values returned in *pCurrent and
+** *pHighwater reflect the status of SQLite at different points in time
+** and it is possible that another thread might change the parameter
+** in between the times when *pCurrent and *pHighwater are written.
+**
+** See also: [sqlite3_db_status()]
+*/
+SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
+
+
+/*
+** CAPI3REF: Status Parameters {H17250} <H17200>
+** EXPERIMENTAL
+**
+** These integer constants designate various run-time status parameters
+** that can be returned by [sqlite3_status()].
+**
+** <dl>
+** <dt>SQLITE_STATUS_MEMORY_USED</dt>
+** <dd>This parameter is the current amount of memory checked out
+** using [sqlite3_malloc()], either directly or indirectly.  The
+** figure includes calls made to [sqlite3_malloc()] by the application
+** and internal memory usage by the SQLite library.  Scratch memory
+** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache
+** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in
+** this parameter.  The amount returned is the sum of the allocation
+** sizes as reported by the xSize method in [sqlite3_mem_methods].</dd>
+**
+** <dt>SQLITE_STATUS_MALLOC_SIZE</dt>
+** <dd>This parameter records the largest memory allocation request
+** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their
+** internal equivalents).  Only the value returned in the
+** *pHighwater parameter to [sqlite3_status()] is of interest.  
+** The value written into the *pCurrent parameter is undefined.</dd>
+**
+** <dt>SQLITE_STATUS_PAGECACHE_USED</dt>
+** <dd>This parameter returns the number of pages used out of the
+** [pagecache memory allocator] that was configured using 
+** [SQLITE_CONFIG_PAGECACHE].  The
+** value returned is in pages, not in bytes.</dd>
+**
+** <dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt>
+** <dd>This parameter returns the number of bytes of page cache
+** allocation which could not be statisfied by the [SQLITE_CONFIG_PAGECACHE]
+** buffer and where forced to overflow to [sqlite3_malloc()].  The
+** returned value includes allocations that overflowed because they
+** where too large (they were larger than the "sz" parameter to
+** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because
+** no space was left in the page cache.</dd>
+**
+** <dt>SQLITE_STATUS_PAGECACHE_SIZE</dt>
+** <dd>This parameter records the largest memory allocation request
+** handed to [pagecache memory allocator].  Only the value returned in the
+** *pHighwater parameter to [sqlite3_status()] is of interest.  
+** The value written into the *pCurrent parameter is undefined.</dd>
+**
+** <dt>SQLITE_STATUS_SCRATCH_USED</dt>
+** <dd>This parameter returns the number of allocations used out of the
+** [scratch memory allocator] configured using
+** [SQLITE_CONFIG_SCRATCH].  The value returned is in allocations, not
+** in bytes.  Since a single thread may only have one scratch allocation
+** outstanding at time, this parameter also reports the number of threads
+** using scratch memory at the same time.</dd>
+**
+** <dt>SQLITE_STATUS_SCRATCH_OVERFLOW</dt>
+** <dd>This parameter returns the number of bytes of scratch memory
+** allocation which could not be statisfied by the [SQLITE_CONFIG_SCRATCH]
+** buffer and where forced to overflow to [sqlite3_malloc()].  The values
+** returned include overflows because the requested allocation was too
+** larger (that is, because the requested allocation was larger than the
+** "sz" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer
+** slots were available.
+** </dd>
+**
+** <dt>SQLITE_STATUS_SCRATCH_SIZE</dt>
+** <dd>This parameter records the largest memory allocation request
+** handed to [scratch memory allocator].  Only the value returned in the
+** *pHighwater parameter to [sqlite3_status()] is of interest.  
+** The value written into the *pCurrent parameter is undefined.</dd>
+**
+** <dt>SQLITE_STATUS_PARSER_STACK</dt>
+** <dd>This parameter records the deepest parser stack.  It is only
+** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].</dd>
+** </dl>
+**
+** New status parameters may be added from time to time.
+*/
+#define SQLITE_STATUS_MEMORY_USED          0
+#define SQLITE_STATUS_PAGECACHE_USED       1
+#define SQLITE_STATUS_PAGECACHE_OVERFLOW   2
+#define SQLITE_STATUS_SCRATCH_USED         3
+#define SQLITE_STATUS_SCRATCH_OVERFLOW     4
+#define SQLITE_STATUS_MALLOC_SIZE          5
+#define SQLITE_STATUS_PARSER_STACK         6
+#define SQLITE_STATUS_PAGECACHE_SIZE       7
+#define SQLITE_STATUS_SCRATCH_SIZE         8
+
+/*
+** CAPI3REF: Database Connection Status {H17500} <S60200>
+** EXPERIMENTAL
+**
+** This interface is used to retrieve runtime status information 
+** about a single [database connection].  The first argument is the
+** database connection object to be interrogated.  The second argument
+** is the parameter to interrogate.  Currently, the only allowed value
+** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED].
+** Additional options will likely appear in future releases of SQLite.
+**
+** The current value of the requested parameter is written into *pCur
+** and the highest instantaneous value is written into *pHiwtr.  If
+** the resetFlg is true, then the highest instantaneous value is
+** reset back down to the current value.
+**
+** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
+*/
+SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
+
+/*
+** CAPI3REF: Status Parameters for database connections {H17520} <H17500>
+** EXPERIMENTAL
+**
+** Status verbs for [sqlite3_db_status()].
+**
+** <dl>
+** <dt>SQLITE_DBSTATUS_LOOKASIDE_USED</dt>
+** <dd>This parameter returns the number of lookaside memory slots currently
+** checked out.</dd>
+** </dl>
+*/
+#define SQLITE_DBSTATUS_LOOKASIDE_USED     0
+
+
+/*
+** CAPI3REF: Prepared Statement Status {H17550} <S60200>
+** EXPERIMENTAL
+**
+** Each prepared statement maintains various
+** [SQLITE_STMTSTATUS_SORT | counters] that measure the number
+** of times it has performed specific operations.  These counters can
+** be used to monitor the performance characteristics of the prepared
+** statements.  For example, if the number of table steps greatly exceeds
+** the number of table searches or result rows, that would tend to indicate
+** that the prepared statement is using a full table scan rather than
+** an index.  
+**
+** This interface is used to retrieve and reset counter values from
+** a [prepared statement].  The first argument is the prepared statement
+** object to be interrogated.  The second argument
+** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter]
+** to be interrogated. 
+** The current value of the requested counter is returned.
+** If the resetFlg is true, then the counter is reset to zero after this
+** interface call returns.
+**
+** See also: [sqlite3_status()] and [sqlite3_db_status()].
+*/
+SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
+
+/*
+** CAPI3REF: Status Parameters for prepared statements {H17570} <H17550>
+** EXPERIMENTAL
+**
+** These preprocessor macros define integer codes that name counter
+** values associated with the [sqlite3_stmt_status()] interface.
+** The meanings of the various counters are as follows:
+**
+** <dl>
+** <dt>SQLITE_STMTSTATUS_FULLSCAN_STEP</dt>
+** <dd>This is the number of times that SQLite has stepped forward in
+** a table as part of a full table scan.  Large numbers for this counter
+** may indicate opportunities for performance improvement through 
+** careful use of indices.</dd>
+**
+** <dt>SQLITE_STMTSTATUS_SORT</dt>
+** <dd>This is the number of sort operations that have occurred.
+** A non-zero value in this counter may indicate an opportunity to
+** improvement performance through careful use of indices.</dd>
+**
+** </dl>
+*/
+#define SQLITE_STMTSTATUS_FULLSCAN_STEP     1
+#define SQLITE_STMTSTATUS_SORT              2
+
+/*
+** CAPI3REF: Custom Page Cache Object
+** EXPERIMENTAL
+**
+** The sqlite3_pcache type is opaque.  It is implemented by
+** the pluggable module.  The SQLite core has no knowledge of
+** its size or internal structure and never deals with the
+** sqlite3_pcache object except by holding and passing pointers
+** to the object.
+**
+** See [sqlite3_pcache_methods] for additional information.
+*/
+typedef struct sqlite3_pcache sqlite3_pcache;
+
+/*
+** CAPI3REF: Application Defined Page Cache.
+** EXPERIMENTAL
+**
+** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can
+** register an alternative page cache implementation by passing in an 
+** instance of the sqlite3_pcache_methods structure. The majority of the 
+** heap memory used by sqlite is used by the page cache to cache data read 
+** from, or ready to be written to, the database file. By implementing a 
+** custom page cache using this API, an application can control more 
+** precisely the amount of memory consumed by sqlite, the way in which 
+** said memory is allocated and released, and the policies used to 
+** determine exactly which parts of a database file are cached and for 
+** how long.
+**
+** The contents of the structure are copied to an internal buffer by sqlite
+** within the call to [sqlite3_config].
+**
+** The xInit() method is called once for each call to [sqlite3_initialize()]
+** (usually only once during the lifetime of the process). It is passed
+** a copy of the sqlite3_pcache_methods.pArg value. It can be used to set
+** up global structures and mutexes required by the custom page cache 
+** implementation. The xShutdown() method is called from within 
+** [sqlite3_shutdown()], if the application invokes this API. It can be used
+** to clean up any outstanding resources before process shutdown, if required.
+**
+** The xCreate() method is used to construct a new cache instance. The
+** first parameter, szPage, is the size in bytes of the pages that must
+** be allocated by the cache. szPage will not be a power of two. The
+** second argument, bPurgeable, is true if the cache being created will
+** be used to cache database pages read from a file stored on disk, or
+** false if it is used for an in-memory database. The cache implementation
+** does not have to do anything special based on the value of bPurgeable,
+** it is purely advisory. 
+**
+** The xCachesize() method may be called at any time by SQLite to set the
+** suggested maximum cache-size (number of pages stored by) the cache
+** instance passed as the first argument. This is the value configured using
+** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter,
+** the implementation is not required to do anything special with this
+** value, it is advisory only.
+**
+** The xPagecount() method should return the number of pages currently
+** stored in the cache supplied as an argument.
+** 
+** The xFetch() method is used to fetch a page and return a pointer to it. 
+** A 'page', in this context, is a buffer of szPage bytes aligned at an
+** 8-byte boundary. The page to be fetched is determined by the key. The
+** mimimum key value is 1. After it has been retrieved using xFetch, the page 
+** is considered to be pinned.
+**
+** If the requested page is already in the page cache, then a pointer to
+** the cached buffer should be returned with its contents intact. If the
+** page is not already in the cache, then the expected behaviour of the
+** cache is determined by the value of the createFlag parameter passed
+** to xFetch, according to the following table:
+**
+** <table border=1 width=85% align=center>
+**   <tr><th>createFlag<th>Expected Behaviour
+**   <tr><td>0<td>NULL should be returned. No new cache entry is created.
+**   <tr><td>1<td>If createFlag is set to 1, this indicates that 
+**                SQLite is holding pinned pages that can be unpinned
+**                by writing their contents to the database file (a
+**                relatively expensive operation). In this situation the
+**                cache implementation has two choices: it can return NULL,
+**                in which case SQLite will attempt to unpin one or more 
+**                pages before re-requesting the same page, or it can
+**                allocate a new page and return a pointer to it. If a new
+**                page is allocated, then the first sizeof(void*) bytes of
+**                it (at least) must be zeroed before it is returned.
+**   <tr><td>2<td>If createFlag is set to 2, then SQLite is not holding any
+**                pinned pages associated with the specific cache passed
+**                as the first argument to xFetch() that can be unpinned. The
+**                cache implementation should attempt to allocate a new
+**                cache entry and return a pointer to it. Again, the first
+**                sizeof(void*) bytes of the page should be zeroed before 
+**                it is returned. If the xFetch() method returns NULL when 
+**                createFlag==2, SQLite assumes that a memory allocation 
+**                failed and returns SQLITE_NOMEM to the user.
+** </table>
+**
+** xUnpin() is called by SQLite with a pointer to a currently pinned page
+** as its second argument. If the third parameter, discard, is non-zero,
+** then the page should be evicted from the cache. In this case SQLite 
+** assumes that the next time the page is retrieved from the cache using
+** the xFetch() method, it will be zeroed. If the discard parameter is
+** zero, then the page is considered to be unpinned. The cache implementation
+** may choose to reclaim (free or recycle) unpinned pages at any time.
+** SQLite assumes that next time the page is retrieved from the cache
+** it will either be zeroed, or contain the same data that it did when it
+** was unpinned.
+**
+** The cache is not required to perform any reference counting. A single 
+** call to xUnpin() unpins the page regardless of the number of prior calls 
+** to xFetch().
+**
+** The xRekey() method is used to change the key value associated with the
+** page passed as the second argument from oldKey to newKey. If the cache
+** previously contains an entry associated with newKey, it should be
+** discarded. Any prior cache entry associated with newKey is guaranteed not
+** to be pinned.
+**
+** When SQLite calls the xTruncate() method, the cache must discard all
+** existing cache entries with page numbers (keys) greater than or equal
+** to the value of the iLimit parameter passed to xTruncate(). If any
+** of these pages are pinned, they are implicitly unpinned, meaning that
+** they can be safely discarded.
+**
+** The xDestroy() method is used to delete a cache allocated by xCreate().
+** All resources associated with the specified cache should be freed. After
+** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
+** handle invalid, and will not use it with any other sqlite3_pcache_methods
+** functions.
+*/
+typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
+struct sqlite3_pcache_methods {
+  void *pArg;
+  int (*xInit)(void*);
+  void (*xShutdown)(void*);
+  sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
+  void (*xCachesize)(sqlite3_pcache*, int nCachesize);
+  int (*xPagecount)(sqlite3_pcache*);
+  void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
+  void (*xUnpin)(sqlite3_pcache*, void*, int discard);
+  void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
+  void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
+  void (*xDestroy)(sqlite3_pcache*);
+};
+
+/*
+** CAPI3REF: Online Backup Object
+** EXPERIMENTAL
+**
+** The sqlite3_backup object records state information about an ongoing
+** online backup operation.  The sqlite3_backup object is created by
+** a call to [sqlite3_backup_init()] and is destroyed by a call to
+** [sqlite3_backup_finish()].
+**
+** See Also: [Using the SQLite Online Backup API]
+*/
+typedef struct sqlite3_backup sqlite3_backup;
+
+/*
+** CAPI3REF: Online Backup API.
+** EXPERIMENTAL
+**
+** This API is used to overwrite the contents of one database with that
+** of another. It is useful either for creating backups of databases or
+** for copying in-memory databases to or from persistent files. 
+**
+** See Also: [Using the SQLite Online Backup API]
+**
+** Exclusive access is required to the destination database for the 
+** duration of the operation. However the source database is only
+** read-locked while it is actually being read, it is not locked
+** continuously for the entire operation. Thus, the backup may be
+** performed on a live database without preventing other users from
+** writing to the database for an extended period of time.
+** 
+** To perform a backup operation: 
+**   <ol>
+**     <li><b>sqlite3_backup_init()</b> is called once to initialize the
+**         backup, 
+**     <li><b>sqlite3_backup_step()</b> is called one or more times to transfer 
+**         the data between the two databases, and finally
+**     <li><b>sqlite3_backup_finish()</b> is called to release all resources 
+**         associated with the backup operation. 
+**   </ol>
+** There should be exactly one call to sqlite3_backup_finish() for each
+** successful call to sqlite3_backup_init().
+**
+** <b>sqlite3_backup_init()</b>
+**
+** The first two arguments passed to [sqlite3_backup_init()] are the database
+** handle associated with the destination database and the database name 
+** used to attach the destination database to the handle. The database name
+** is "main" for the main database, "temp" for the temporary database, or
+** the name specified as part of the [ATTACH] statement if the destination is
+** an attached database. The third and fourth arguments passed to 
+** sqlite3_backup_init() identify the [database connection]
+** and database name used
+** to access the source database. The values passed for the source and 
+** destination [database connection] parameters must not be the same.
+**
+** If an error occurs within sqlite3_backup_init(), then NULL is returned
+** and an error code and error message written into the [database connection] 
+** passed as the first argument. They may be retrieved using the
+** [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()] functions.
+** Otherwise, if successful, a pointer to an [sqlite3_backup] object is
+** returned. This pointer may be used with the sqlite3_backup_step() and
+** sqlite3_backup_finish() functions to perform the specified backup 
+** operation.
+**
+** <b>sqlite3_backup_step()</b>
+**
+** Function [sqlite3_backup_step()] is used to copy up to nPage pages between 
+** the source and destination databases, where nPage is the value of the 
+** second parameter passed to sqlite3_backup_step(). If nPage is a negative
+** value, all remaining source pages are copied. If the required pages are 
+** succesfully copied, but there are still more pages to copy before the 
+** backup is complete, it returns [SQLITE_OK]. If no error occured and there 
+** are no more pages to copy, then [SQLITE_DONE] is returned. If an error 
+** occurs, then an SQLite error code is returned. As well as [SQLITE_OK] and
+** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY],
+** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an
+** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code.
+**
+** As well as the case where the destination database file was opened for
+** read-only access, sqlite3_backup_step() may return [SQLITE_READONLY] if
+** the destination is an in-memory database with a different page size
+** from the source database.
+**
+** If sqlite3_backup_step() cannot obtain a required file-system lock, then
+** the [sqlite3_busy_handler | busy-handler function]
+** is invoked (if one is specified). If the 
+** busy-handler returns non-zero before the lock is available, then 
+** [SQLITE_BUSY] is returned to the caller. In this case the call to
+** sqlite3_backup_step() can be retried later. If the source
+** [database connection]
+** is being used to write to the source database when sqlite3_backup_step()
+** is called, then [SQLITE_LOCKED] is returned immediately. Again, in this
+** case the call to sqlite3_backup_step() can be retried later on. If
+** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or
+** [SQLITE_READONLY] is returned, then 
+** there is no point in retrying the call to sqlite3_backup_step(). These 
+** errors are considered fatal. At this point the application must accept 
+** that the backup operation has failed and pass the backup operation handle 
+** to the sqlite3_backup_finish() to release associated resources.
+**
+** Following the first call to sqlite3_backup_step(), an exclusive lock is
+** obtained on the destination file. It is not released until either 
+** sqlite3_backup_finish() is called or the backup operation is complete 
+** and sqlite3_backup_step() returns [SQLITE_DONE]. Additionally, each time 
+** a call to sqlite3_backup_step() is made a [shared lock] is obtained on
+** the source database file. This lock is released before the
+** sqlite3_backup_step() call returns. Because the source database is not
+** locked between calls to sqlite3_backup_step(), it may be modified mid-way
+** through the backup procedure. If the source database is modified by an
+** external process or via a database connection other than the one being
+** used by the backup operation, then the backup will be transparently
+** restarted by the next call to sqlite3_backup_step(). If the source 
+** database is modified by the using the same database connection as is used
+** by the backup operation, then the backup database is transparently 
+** updated at the same time.
+**
+** <b>sqlite3_backup_finish()</b>
+**
+** Once sqlite3_backup_step() has returned [SQLITE_DONE], or when the 
+** application wishes to abandon the backup operation, the [sqlite3_backup]
+** object should be passed to sqlite3_backup_finish(). This releases all
+** resources associated with the backup operation. If sqlite3_backup_step()
+** has not yet returned [SQLITE_DONE], then any active write-transaction on the
+** destination database is rolled back. The [sqlite3_backup] object is invalid
+** and may not be used following a call to sqlite3_backup_finish().
+**
+** The value returned by sqlite3_backup_finish is [SQLITE_OK] if no error
+** occurred, regardless or whether or not sqlite3_backup_step() was called
+** a sufficient number of times to complete the backup operation. Or, if
+** an out-of-memory condition or IO error occured during a call to
+** sqlite3_backup_step() then [SQLITE_NOMEM] or an
+** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] error code
+** is returned. In this case the error code and an error message are
+** written to the destination [database connection].
+**
+** A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() is
+** not a permanent error and does not affect the return value of
+** sqlite3_backup_finish().
+**
+** <b>sqlite3_backup_remaining(), sqlite3_backup_pagecount()</b>
+**
+** Each call to sqlite3_backup_step() sets two values stored internally
+** by an [sqlite3_backup] object. The number of pages still to be backed
+** up, which may be queried by sqlite3_backup_remaining(), and the total
+** number of pages in the source database file, which may be queried by
+** sqlite3_backup_pagecount().
+**
+** The values returned by these functions are only updated by
+** sqlite3_backup_step(). If the source database is modified during a backup
+** operation, then the values are not updated to account for any extra
+** pages that need to be updated or the size of the source database file
+** changing.
+**
+** <b>Concurrent Usage of Database Handles</b>
+**
+** The source [database connection] may be used by the application for other
+** purposes while a backup operation is underway or being initialized.
+** If SQLite is compiled and configured to support threadsafe database
+** connections, then the source database connection may be used concurrently
+** from within other threads.
+**
+** However, the application must guarantee that the destination database
+** connection handle is not passed to any other API (by any thread) after 
+** sqlite3_backup_init() is called and before the corresponding call to
+** sqlite3_backup_finish(). Unfortunately SQLite does not currently check
+** for this, if the application does use the destination [database connection]
+** for some other purpose during a backup operation, things may appear to
+** work correctly but in fact be subtly malfunctioning.  Use of the
+** destination database connection while a backup is in progress might
+** also cause a mutex deadlock.
+**
+** Furthermore, if running in [shared cache mode], the application must
+** guarantee that the shared cache used by the destination database
+** is not accessed while the backup is running. In practice this means
+** that the application must guarantee that the file-system file being 
+** backed up to is not accessed by any connection within the process,
+** not just the specific connection that was passed to sqlite3_backup_init().
+**
+** The [sqlite3_backup] object itself is partially threadsafe. Multiple 
+** threads may safely make multiple concurrent calls to sqlite3_backup_step().
+** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
+** APIs are not strictly speaking threadsafe. If they are invoked at the
+** same time as another thread is invoking sqlite3_backup_step() it is
+** possible that they return invalid values.
+*/
+sqlite3_backup *sqlite3_backup_init(
+  sqlite3 *pDest,                        /* Destination database handle */
+  const char *zDestName,                 /* Destination database name */
+  sqlite3 *pSource,                      /* Source database handle */
+  const char *zSourceName                /* Source database name */
+);
+int sqlite3_backup_step(sqlite3_backup *p, int nPage);
+int sqlite3_backup_finish(sqlite3_backup *p);
+int sqlite3_backup_remaining(sqlite3_backup *p);
+int sqlite3_backup_pagecount(sqlite3_backup *p);
+
+/*
+** CAPI3REF: Unlock Notification
+** EXPERIMENTAL
+**
+** When running in shared-cache mode, a database operation may fail with
+** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
+** individual tables within the shared-cache cannot be obtained. See
+** [SQLite Shared-Cache Mode] for a description of shared-cache locking. 
+** This API may be used to register a callback that SQLite will invoke 
+** when the connection currently holding the required lock relinquishes it.
+** This API is only available if the library was compiled with the
+** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined.
+**
+** See Also: [Using the SQLite Unlock Notification Feature].
+**
+** Shared-cache locks are released when a database connection concludes
+** its current transaction, either by committing it or rolling it back. 
+**
+** When a connection (known as the blocked connection) fails to obtain a
+** shared-cache lock and SQLITE_LOCKED is returned to the caller, the
+** identity of the database connection (the blocking connection) that
+** has locked the required resource is stored internally. After an 
+** application receives an SQLITE_LOCKED error, it may call the
+** sqlite3_unlock_notify() method with the blocked connection handle as 
+** the first argument to register for a callback that will be invoked
+** when the blocking connections current transaction is concluded. The
+** callback is invoked from within the [sqlite3_step] or [sqlite3_close]
+** call that concludes the blocking connections transaction.
+**
+** If sqlite3_unlock_notify() is called in a multi-threaded application,
+** there is a chance that the blocking connection will have already
+** concluded its transaction by the time sqlite3_unlock_notify() is invoked.
+** If this happens, then the specified callback is invoked immediately,
+** from within the call to sqlite3_unlock_notify().
+**
+** If the blocked connection is attempting to obtain a write-lock on a
+** shared-cache table, and more than one other connection currently holds
+** a read-lock on the same table, then SQLite arbitrarily selects one of 
+** the other connections to use as the blocking connection.
+**
+** There may be at most one unlock-notify callback registered by a 
+** blocked connection. If sqlite3_unlock_notify() is called when the
+** blocked connection already has a registered unlock-notify callback,
+** then the new callback replaces the old. If sqlite3_unlock_notify() is
+** called with a NULL pointer as its second argument, then any existing
+** unlock-notify callback is cancelled. The blocked connections 
+** unlock-notify callback may also be canceled by closing the blocked
+** connection using [sqlite3_close()].
+**
+** The unlock-notify callback is not reentrant. If an application invokes
+** any sqlite3_xxx API functions from within an unlock-notify callback, a
+** crash or deadlock may be the result.
+**
+** Unless deadlock is detected (see below), sqlite3_unlock_notify() always
+** returns SQLITE_OK.
+**
+** <b>Callback Invocation Details</b>
+**
+** When an unlock-notify callback is registered, the application provides a 
+** single void* pointer that is passed to the callback when it is invoked.
+** However, the signature of the callback function allows SQLite to pass
+** it an array of void* context pointers. The first argument passed to
+** an unlock-notify callback is a pointer to an array of void* pointers,
+** and the second is the number of entries in the array.
+**
+** When a blocking connections transaction is concluded, there may be
+** more than one blocked connection that has registered for an unlock-notify
+** callback. If two or more such blocked connections have specified the
+** same callback function, then instead of invoking the callback function
+** multiple times, it is invoked once with the set of void* context pointers
+** specified by the blocked connections bundled together into an array.
+** This gives the application an opportunity to prioritize any actions 
+** related to the set of unblocked database connections.
+**
+** <b>Deadlock Detection</b>
+**
+** Assuming that after registering for an unlock-notify callback a 
+** database waits for the callback to be issued before taking any further
+** action (a reasonable assumption), then using this API may cause the
+** application to deadlock. For example, if connection X is waiting for
+** connection Y's transaction to be concluded, and similarly connection
+** Y is waiting on connection X's transaction, then neither connection
+** will proceed and the system may remain deadlocked indefinitely.
+**
+** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock
+** detection. If a given call to sqlite3_unlock_notify() would put the
+** system in a deadlocked state, then SQLITE_LOCKED is returned and no
+** unlock-notify callback is registered. The system is said to be in
+** a deadlocked state if connection A has registered for an unlock-notify
+** callback on the conclusion of connection B's transaction, and connection
+** B has itself registered for an unlock-notify callback when connection
+** A's transaction is concluded. Indirect deadlock is also detected, so
+** the system is also considered to be deadlocked if connection B has
+** registered for an unlock-notify callback on the conclusion of connection
+** C's transaction, where connection C is waiting on connection A. Any
+** number of levels of indirection are allowed.
+**
+** <b>The "DROP TABLE" Exception</b>
+**
+** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost 
+** always appropriate to call sqlite3_unlock_notify(). There is however,
+** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement,
+** SQLite checks if there are any currently executing SELECT statements
+** that belong to the same connection. If there are, SQLITE_LOCKED is
+** returned. In this case there is no "blocking connection", so invoking
+** sqlite3_unlock_notify() results in the unlock-notify callback being
+** invoked immediately. If the application then re-attempts the "DROP TABLE"
+** or "DROP INDEX" query, an infinite loop might be the result.
+**
+** One way around this problem is to check the extended error code returned
+** by an sqlite3_step() call. If there is a blocking connection, then the
+** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
+** the special "DROP TABLE/INDEX" case, the extended error code is just 
+** SQLITE_LOCKED.
+*/
+int sqlite3_unlock_notify(
+  sqlite3 *pBlocked,                          /* Waiting connection */
+  void (*xNotify)(void **apArg, int nArg),    /* Callback function to invoke */
+  void *pNotifyArg                            /* Argument to pass to xNotify */
+);
+
+/*
 ** Undo the hack that converts floating point types to integer for
 ** builds on processors without floating point support.
 */
diff --git a/WebKitLibraries/WebCoreSQLite3/sqlite3ext.h b/WebKitLibraries/WebCoreSQLite3/sqlite3ext.h
index 0d70e64..5526646 100644
--- a/WebKitLibraries/WebCoreSQLite3/sqlite3ext.h
+++ b/WebKitLibraries/WebCoreSQLite3/sqlite3ext.h
@@ -15,7 +15,7 @@
 ** as extensions by SQLite should #include this file instead of 
 ** sqlite3.h.
 **
-** @(#) $Id: sqlite3ext.h,v 1.10 2007/03/29 18:46:01 drh Exp $
+** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $
 */
 #ifndef _SQLITE3EXT_H_
 #define _SQLITE3EXT_H_
@@ -24,8 +24,14 @@
 typedef struct sqlite3_api_routines sqlite3_api_routines;
 
 /*
-** The following structure hold pointers to all of the SQLite API
+** The following structure holds pointers to all of the SQLite API
 ** routines.
+**
+** WARNING:  In order to maintain backwards compatibility, add new
+** interfaces to the end of this structure only.  If you insert new
+** interfaces in the middle of this structure, then older different
+** versions of SQLite will not be able to load each others' shared
+** libraries!
 */
 struct sqlite3_api_routines {
   void * (*aggregate_context)(sqlite3_context*,int nBytes);
@@ -72,7 +78,7 @@
   int  (*complete)(const char*sql);
   int  (*complete16)(const void*sql);
   int  (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
-  int  (*create_collation16)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
+  int  (*create_collation16)(sqlite3*,const void*,int,void*,int(*)(void*,int,const void*,int,const void*));
   int  (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
   int  (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
   int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
@@ -143,10 +149,50 @@
   const void * (*value_text16le)(sqlite3_value*);
   int  (*value_type)(sqlite3_value*);
   char *(*vmprintf)(const char*,va_list);
+  /* Added ??? */
   int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
+  /* Added by 3.3.13 */
   int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
   int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
   int (*clear_bindings)(sqlite3_stmt*);
+  /* Added by 3.4.1 */
+  int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *));
+  /* Added by 3.5.0 */
+  int (*bind_zeroblob)(sqlite3_stmt*,int,int);
+  int (*blob_bytes)(sqlite3_blob*);
+  int (*blob_close)(sqlite3_blob*);
+  int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**);
+  int (*blob_read)(sqlite3_blob*,void*,int,int);
+  int (*blob_write)(sqlite3_blob*,const void*,int,int);
+  int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*));
+  int (*file_control)(sqlite3*,const char*,int,void*);
+  sqlite3_int64 (*memory_highwater)(int);
+  sqlite3_int64 (*memory_used)(void);
+  sqlite3_mutex *(*mutex_alloc)(int);
+  void (*mutex_enter)(sqlite3_mutex*);
+  void (*mutex_free)(sqlite3_mutex*);
+  void (*mutex_leave)(sqlite3_mutex*);
+  int (*mutex_try)(sqlite3_mutex*);
+  int (*open_v2)(const char*,sqlite3**,int,const char*);
+  int (*release_memory)(int);
+  void (*result_error_nomem)(sqlite3_context*);
+  void (*result_error_toobig)(sqlite3_context*);
+  int (*sleep)(int);
+  void (*soft_heap_limit)(int);
+  sqlite3_vfs *(*vfs_find)(const char*);
+  int (*vfs_register)(sqlite3_vfs*,int);
+  int (*vfs_unregister)(sqlite3_vfs*);
+  int (*xthreadsafe)(void);
+  void (*result_zeroblob)(sqlite3_context*,int);
+  void (*result_error_code)(sqlite3_context*,int);
+  int (*test_control)(int, ...);
+  void (*randomness)(int,void*);
+  sqlite3 *(*context_db_handle)(sqlite3_context*);
+  int (*extended_result_codes)(sqlite3*,int);
+  int (*limit)(sqlite3*,int,int);
+  sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
+  const char *(*sql)(sqlite3_stmt*);
+  int (*status)(int,int*,int*,int);
 };
 
 /*
@@ -162,7 +208,9 @@
 */
 #ifndef SQLITE_CORE
 #define sqlite3_aggregate_context      sqlite3_api->aggregate_context
+#ifndef SQLITE_OMIT_DEPRECATED
 #define sqlite3_aggregate_count        sqlite3_api->aggregate_count
+#endif
 #define sqlite3_bind_blob              sqlite3_api->bind_blob
 #define sqlite3_bind_double            sqlite3_api->bind_double
 #define sqlite3_bind_int               sqlite3_api->bind_int
@@ -209,6 +257,7 @@
 #define sqlite3_create_function        sqlite3_api->create_function
 #define sqlite3_create_function16      sqlite3_api->create_function16
 #define sqlite3_create_module          sqlite3_api->create_module
+#define sqlite3_create_module_v2       sqlite3_api->create_module_v2
 #define sqlite3_data_count             sqlite3_api->data_count
 #define sqlite3_db_handle              sqlite3_api->db_handle
 #define sqlite3_declare_vtab           sqlite3_api->declare_vtab
@@ -217,14 +266,18 @@
 #define sqlite3_errmsg                 sqlite3_api->errmsg
 #define sqlite3_errmsg16               sqlite3_api->errmsg16
 #define sqlite3_exec                   sqlite3_api->exec
+#ifndef SQLITE_OMIT_DEPRECATED
 #define sqlite3_expired                sqlite3_api->expired
+#endif
 #define sqlite3_finalize               sqlite3_api->finalize
 #define sqlite3_free                   sqlite3_api->free
 #define sqlite3_free_table             sqlite3_api->free_table
 #define sqlite3_get_autocommit         sqlite3_api->get_autocommit
 #define sqlite3_get_auxdata            sqlite3_api->get_auxdata
 #define sqlite3_get_table              sqlite3_api->get_table
+#ifndef SQLITE_OMIT_DEPRECATED
 #define sqlite3_global_recover         sqlite3_api->global_recover
+#endif
 #define sqlite3_interrupt              sqlite3_api->interruptx
 #define sqlite3_last_insert_rowid      sqlite3_api->last_insert_rowid
 #define sqlite3_libversion             sqlite3_api->libversion
@@ -262,7 +315,9 @@
 #define sqlite3_thread_cleanup         sqlite3_api->thread_cleanup
 #define sqlite3_total_changes          sqlite3_api->total_changes
 #define sqlite3_trace                  sqlite3_api->trace
+#ifndef SQLITE_OMIT_DEPRECATED
 #define sqlite3_transfer_bindings      sqlite3_api->transfer_bindings
+#endif
 #define sqlite3_update_hook            sqlite3_api->update_hook
 #define sqlite3_user_data              sqlite3_api->user_data
 #define sqlite3_value_blob             sqlite3_api->value_blob
@@ -282,9 +337,44 @@
 #define sqlite3_prepare_v2             sqlite3_api->prepare_v2
 #define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2
 #define sqlite3_clear_bindings         sqlite3_api->clear_bindings
+#define sqlite3_bind_zeroblob          sqlite3_api->bind_zeroblob
+#define sqlite3_blob_bytes             sqlite3_api->blob_bytes
+#define sqlite3_blob_close             sqlite3_api->blob_close
+#define sqlite3_blob_open              sqlite3_api->blob_open
+#define sqlite3_blob_read              sqlite3_api->blob_read
+#define sqlite3_blob_write             sqlite3_api->blob_write
+#define sqlite3_create_collation_v2    sqlite3_api->create_collation_v2
+#define sqlite3_file_control           sqlite3_api->file_control
+#define sqlite3_memory_highwater       sqlite3_api->memory_highwater
+#define sqlite3_memory_used            sqlite3_api->memory_used
+#define sqlite3_mutex_alloc            sqlite3_api->mutex_alloc
+#define sqlite3_mutex_enter            sqlite3_api->mutex_enter
+#define sqlite3_mutex_free             sqlite3_api->mutex_free
+#define sqlite3_mutex_leave            sqlite3_api->mutex_leave
+#define sqlite3_mutex_try              sqlite3_api->mutex_try
+#define sqlite3_open_v2                sqlite3_api->open_v2
+#define sqlite3_release_memory         sqlite3_api->release_memory
+#define sqlite3_result_error_nomem     sqlite3_api->result_error_nomem
+#define sqlite3_result_error_toobig    sqlite3_api->result_error_toobig
+#define sqlite3_sleep                  sqlite3_api->sleep
+#define sqlite3_soft_heap_limit        sqlite3_api->soft_heap_limit
+#define sqlite3_vfs_find               sqlite3_api->vfs_find
+#define sqlite3_vfs_register           sqlite3_api->vfs_register
+#define sqlite3_vfs_unregister         sqlite3_api->vfs_unregister
+#define sqlite3_threadsafe             sqlite3_api->xthreadsafe
+#define sqlite3_result_zeroblob        sqlite3_api->result_zeroblob
+#define sqlite3_result_error_code      sqlite3_api->result_error_code
+#define sqlite3_test_control           sqlite3_api->test_control
+#define sqlite3_randomness             sqlite3_api->randomness
+#define sqlite3_context_db_handle      sqlite3_api->context_db_handle
+#define sqlite3_extended_result_codes  sqlite3_api->extended_result_codes
+#define sqlite3_limit                  sqlite3_api->limit
+#define sqlite3_next_stmt              sqlite3_api->next_stmt
+#define sqlite3_sql                    sqlite3_api->sql
+#define sqlite3_status                 sqlite3_api->status
 #endif /* SQLITE_CORE */
 
-#define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api;
+#define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api = 0;
 #define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;
 
 #endif /* _SQLITE3EXT_H_ */
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index ed68410..18b612c 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -29,8 +29,9 @@
 NSArray *WKGetExtensionsForMIMEType(NSString *type);
 NSString *WKGetMIMETypeForExtension(NSString *extension);
 
-NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
-NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
+NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *);
+NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *);
+NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *);
 
 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
 
@@ -176,7 +177,7 @@
 
 BOOL WKCGContextIsBitmapContext(CGContextRef context);
 
-void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
+void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, float *wheelTicksX, float *wheelTicksY, BOOL *continuous);
 
 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
 
@@ -191,6 +192,8 @@
 
 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
+void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
+void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
 
 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
 int WKQTMovieDataRate(QTMovie* movie);
@@ -294,6 +297,7 @@
 
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
 NSMutableArray *WKNoteOpenPanelFiles(NSArray *paths);
+void WKSyncSurfaceToView(NSView *view);
 #endif
 
 #ifdef __cplusplus
diff --git a/WebKitLibraries/libWebCoreSQLite3.a b/WebKitLibraries/libWebCoreSQLite3.a
index 2e175e2..2e5fd15 100644
--- a/WebKitLibraries/libWebCoreSQLite3.a
+++ b/WebKitLibraries/libWebCoreSQLite3.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index 722044f..673465f 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index 3e3e1d7..20d0bae 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceTiger.a b/WebKitLibraries/libWebKitSystemInterfaceTiger.a
index 3dd651a..bcb6ab3 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceTiger.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceTiger.a
Binary files differ
diff --git a/WebKitLibraries/win/bin/QuartzCoreInterface.dll b/WebKitLibraries/win/bin/QuartzCoreInterface.dll
deleted file mode 100755
index 0b64349..0000000
--- a/WebKitLibraries/win/bin/QuartzCoreInterface.dll
+++ /dev/null
Binary files differ
diff --git a/WebKitLibraries/win/include/QuartzCoreInterface/QuartzCoreInterface.h b/WebKitLibraries/win/include/QuartzCoreInterface/QuartzCoreInterface.h
deleted file mode 100644
index b3cef10..0000000
--- a/WebKitLibraries/win/include/QuartzCoreInterface/QuartzCoreInterface.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- */
-
-#ifndef QuartzCoreInterface_h
-#define QuartzCoreInterface_h
-
-#ifdef QUARTZCOREINTERFACE_EXPORTS
-#define QUARTZCOREINTERFACE_API __declspec(dllexport)
-#else
-#define QUARTZCOREINTERFACE_API __declspec(dllimport)
-#endif
-
-// Interface to give access to QuartzCore data symbols.
-enum WKQCStringRefType { wkqckCACFLayer, wkqckCACFTransformLayer, wkqckCACFFilterLinear, wkqckCACFFilterNearest,
-                         wkqckCACFFilterTrilinear, wkqckCACFFilterLanczos, wkqckCACFGravityCenter, wkqckCACFGravityTop, 
-                         wkqckCACFGravityBottom, wkqckCACFGravityLeft, wkqckCACFGravityRight, wkqckCACFGravityTopLeft, 
-                         wkqckCACFGravityTopRight, wkqckCACFGravityBottomLeft, wkqckCACFGravityBottomRight, 
-                         wkqckCACFGravityResize, wkqckCACFGravityResizeAspect, wkqckCACFGravityResizeAspectFill };
-
-enum WKQCCARenderOGLCallbacksType { wkqckCARenderDX9Callbacks };
-
-typedef const struct __CFString * CFStringRef;
-typedef struct _CARenderOGLCallbacks CARenderOGLCallbacks;
-typedef struct CATransform3D CATransform3D;
-
-extern "C" {
-QUARTZCOREINTERFACE_API CFStringRef wkqcCFStringRef(WKQCStringRefType);
-QUARTZCOREINTERFACE_API const CARenderOGLCallbacks* wkqcCARenderOGLCallbacks(WKQCCARenderOGLCallbacksType);
-QUARTZCOREINTERFACE_API const CATransform3D& wkqcCATransform3DIdentity();
-}
-
-#endif // QuartzCoreInterface_h
diff --git a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
index 4534d6f..445b292 100644
--- a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
+++ b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
@@ -61,14 +61,7 @@
 void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont, bool usePlatformNativeGlyphs);
 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
 void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
-bool wkCanCreateCGFontWithLOGFONT();
-void wkSetFontPlatformInfo(CGFontRef, LOGFONT*, void(*)(void*));
 void wkSetUpFontCache(size_t s);
-void wkAddFontsInDirectory(CFStringRef);
-void wkAddFontsAtPath(CFStringRef);
-void wkAddFontsFromRegistry();
-void wkAddFontsFromPlist(CFPropertyListRef);
-CFPropertyListRef wkCreateFontsPlist();
 
 void wkSetPatternBaseCTM(CGContextRef, CGAffineTransform);
 void wkSetPatternPhaseInUserSpace(CGContextRef, CGPoint phasePoint);
diff --git a/WebKitLibraries/win/lib/QuartzCoreInterface.lib b/WebKitLibraries/win/lib/QuartzCoreInterface.lib
deleted file mode 100755
index 0a556d3..0000000
--- a/WebKitLibraries/win/lib/QuartzCoreInterface.lib
+++ /dev/null
Binary files differ
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface.lib b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
index ddcb692..4fcc36b 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
Binary files differ
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
index 965672f..6d836db 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
Binary files differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index e3893f2..2184f46 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
 	>
   <Tool
 		Name="VCCLCompilerTool"
-		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
 	/>
   <UserMacro
 		Name="ENABLE_3D_CANVAS"
@@ -22,6 +22,11 @@
 		PerformEnvironmentSet="true"
 	/>
   <UserMacro
+		Name="ENABLE_BLOB_SLICE"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
 		Name="ENABLE_CHANNEL_MESSAGING"
 		Value="ENABLE_CHANNEL_MESSAGING"
 		PerformEnvironmentSet="true"
@@ -62,6 +67,16 @@
 		PerformEnvironmentSet="true"
 	/>
   <UserMacro
+		Name="ENABLE_FILE_READER"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
+		Name="ENABLE_FILE_WRITER"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
 		Name="ENABLE_GEOLOCATION"
 		Value="ENABLE_GEOLOCATION"
 		PerformEnvironmentSet="true"
@@ -102,6 +117,11 @@
 		PerformEnvironmentSet="true"
 	/>
   <UserMacro
+		Name="ENABLE_SANDBOX"
+		Value="ENABLE_SANDBOX"
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
 		Name="ENABLE_SHARED_WORKERS"
 		Value="ENABLE_SHARED_WORKERS"
 		PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index 1c16a9b..14644d4 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
 	>
   <Tool
 		Name="VCCLCompilerTool"
-		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
 	/>
   <UserMacro
 		Name="ENABLE_3D_CANVAS"
@@ -22,6 +22,11 @@
 		PerformEnvironmentSet="true"
 	/>
   <UserMacro
+		Name="ENABLE_BLOB_SLICE"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
 		Name="ENABLE_CHANNEL_MESSAGING"
 		Value="ENABLE_CHANNEL_MESSAGING"
 		PerformEnvironmentSet="true"
@@ -62,6 +67,16 @@
 		PerformEnvironmentSet="true"
 	/>
   <UserMacro
+		Name="ENABLE_FILE_READER"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
+		Name="ENABLE_FILE_WRITER"
+		Value=""
+		PerformEnvironmentSet="true"
+	/>
+  <UserMacro
 		Name="ENABLE_GEOLOCATION"
 		Value=""
 		PerformEnvironmentSet="true"
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 3477c97..db7379d 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -15,6 +15,7 @@
 
                     { "name": "apple-macpro-1", "platform": "mac-snowleopard" },
                     { "name": "apple-macpro-2", "platform": "mac-snowleopard" },
+                    { "name": "apple-macpro-3", "platform": "mac-snowleopard" },
 
                     { "name": "apple-windows-1", "platform": "win"},
                     { "name": "apple-windows-2", "platform": "win"},
@@ -27,10 +28,17 @@
                     { "name": "gtk-linux-slave-4", "platform": "gtk"},
 
                     { "name": "szeged-linux-1", "platform": "qt"},
+                    { "name": "szeged-linux-2", "platform": "qt"},
+                    { "name": "szeged-linux-3", "platform": "qt"},
+                    { "name": "szeged-linux-4", "platform": "qt"},
+
+                    { "name": "szeged-windows-1", "platform": "qt"},
+                    { "name": "szeged-windows-2", "platform": "qt"},
 
                     { "name": "google-windows-1", "platform": "chromium" },
                     { "name": "google-mac-1", "platform": "chromium" },
-                    { "name": "google-linux-1", "platform": "chromium" }
+                    { "name": "google-linux-1", "platform": "chromium" },
+                    { "name": "google-new-tests", "platform": "mac-leopard" }
                   ],
 
     "builders":   [ { "name": "Tiger Intel Release", "type": "BuildAndTest", "builddir": "tiger-intel-release",
@@ -68,7 +76,7 @@
                     },
                     { "name": "SnowLeopard Intel Leaks", "type": "BuildAndTestLeaks", "builddir": "snowleopard-intel-leaks",
                       "platform": "mac-snowleopard", "configuration": "debug", "architectures": ["x86_64"],
-                      "slavenames": ["apple-macpro-1", "test-slave"]
+                      "slavenames": ["apple-macpro-1", "apple-macpro-3", "test-slave"]
                     },
                     {
                       "name": "Windows Release (Build)", "type": "Build", "builddir": "win-release",
@@ -118,6 +126,31 @@
                       "slavenames": ["szeged-linux-1"]
                     },
                     {
+                      "name": "Qt Linux Release minimal", "type": "Build", "builddir": "qt-linux-release-minimal",
+                      "platform": "qt", "configuration": "release", "architectures": ["i386"],
+                      "slavenames": ["szeged-linux-2"]
+                    },
+                    {
+                      "name": "Qt Linux ARMv5 Release", "type": "Build", "builddir": "qt-linux-armv5-release",
+                      "platform": "qt", "configuration": "release", "architectures": ["armv5"],
+                      "slavenames": ["szeged-linux-3"]
+                    },
+                    {
+                      "name": "Qt Linux ARMv7 Release", "type": "Build", "builddir": "qt-linux-armv7-release",
+                      "platform": "qt", "configuration": "release", "architectures": ["armv7"],
+                      "slavenames": ["szeged-linux-4"]
+                    },
+                    {
+                      "name": "Qt Windows 32-bit Release", "type": "Build", "builddir": "qt-windows-32bit-release",
+                      "platform": "qt", "configuration": "release", "architectures": ["i386"],
+                      "slavenames": ["szeged-windows-1"]
+                    },
+                    {
+                      "name": "Qt Windows 32-bit Debug", "type": "Build", "builddir": "qt-windows-32bit-debug",
+                      "platform": "qt", "configuration": "debug", "architectures": ["i386"],
+                      "slavenames": ["szeged-windows-2"]
+                    },
+                    {
                       "name": "Chromium Win Release", "type": "Build", "builddir": "chromium-win-release",
                       "platform": "chromium", "configuration": "release", "architectures": ["i386"],
                       "slavenames": ["google-windows-1"]
@@ -131,7 +164,12 @@
                       "name": "Chromium Linux Release", "type": "Build", "builddir": "chromium-linux-release",
                       "platform": "chromium", "configuration": "release", "architectures": ["i386"],
                       "slavenames": ["google-linux-1"]
-                    }
+                    },
+		    {
+		      "name": "New run-webkit-tests", "type": "NewBuildAndTest", "builddir": "google-new-tests",
+		      "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"],
+		      "slavenames": ["google-new-tests"]
+		    }
                   ],
 
     "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "branches": ["trunk"], "treeStableTimer": 45.0,
@@ -139,7 +177,8 @@
                                        "SnowLeopard Intel Release (Build)", "SnowLeopard Intel Leaks",
                                        "Windows Release (Build)", "Windows Debug (Build)",
                                        "GTK Linux 32-bit Release", "GTK Linux 32-bit Debug", "GTK Linux 64-bit Debug", "GTK Linux 64-bit Release",
-                                       "Qt Linux Release",
+                                       "Qt Linux Release", "Qt Linux Release minimal", "Qt Linux ARMv5 Release", "Qt Linux ARMv7 Release", 
+                                       "Qt Windows 32-bit Release", "Qt Windows 32-bit Debug",
                                        "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release"]
                     },
                     { "type": "Triggerable", "name": "leopard-intel-release-tests",
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 1823277..cd5e4e1 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -16,6 +16,8 @@
 import re
 import simplejson
 
+from webkitpy.common.net.buildbot import BuildBot as wkbuildbot
+
 WithProperties = properties.WithProperties
 
 class ConfigureBuild(buildstep.BuildStep):
@@ -53,6 +55,11 @@
     descriptionDone = ["installed dependencies"]
     command = ["perl", "./WebKitTools/Scripts/update-webkit-auxiliary-libs"]
 
+class KillOldProcesses(shell.Compile):
+    name = "kill old processes"
+    description = ["killing old processes"]
+    descriptionDone = ["killed old processes"]
+    command = ["python", "./WebKitTools/BuildSlaveSupport/win/kill-old-processes"]
 
 class InstallChromiumDependencies(shell.ShellCommand):
     name = "gclient"
@@ -230,6 +237,12 @@
         return [self.name]
 
 
+class NewRunWebKitTests(RunWebKitTests):
+    command = ["./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results",
+               "--results-directory", "layout-test-results",
+               WithProperties("--%(configuration)s")]
+
+
 class RunGtkAPITests(shell.Test):
     name = "API tests"
     description = ["API tests running"]
@@ -261,7 +274,7 @@
 
     def getText2(self, cmd, results):
         if results != SUCCESS and self.incorrectLines:
-            return ["%d API tests failed" % self.incorrectLines]
+            return ["%d API tests failed" % len(self.incorrectLines)]
 
         return [self.name]
 
@@ -301,7 +314,7 @@
         return master.MasterShellCommand.start(self)
 
     def finished(self, result):
-        url = self.build.getProperties().render(self.resultDirectory).replace("public_html/", "")
+        url = self.build.getProperties().render(self.resultDirectory).replace("public_html/", "/")
         self.addURL("view results", url)
         result = master.MasterShellCommand.finished(self, result)
         self.step_status.setText(["uploaded results"])
@@ -314,6 +327,7 @@
         self.addStep(ConfigureBuild, platform=platform, configuration=configuration, architecture=" ".join(architectures), buildOnly=buildOnly)
         self.addStep(CheckOutSource)
         if platform == "win":
+            self.addStep(KillOldProcesses)
             self.addStep(InstallWin32Dependencies)
         if platform == "chromium":
             self.addStep(InstallChromiumDependencies)
@@ -354,12 +368,18 @@
 class BuildAndTestLeaksFactory(BuildAndTestFactory):
     TestClass = RunWebKitLeakTests
 
+class NewBuildAndTestFactory(BuildAndTestFactory):
+    TestClass = NewRunWebKitTests
+
 
 def loadBuilderConfig(c):
     passwords = simplejson.load(open('passwords.json'))
 
     config = simplejson.load(open('config.json'))
 
+    # use webkitpy's buildbot module to test for core builders
+    wkbb = wkbuildbot()
+
     c['slaves'] = [BuildSlave(slave['name'], passwords[slave['name']], max_builds=1) for slave in config['slaves']]
 
     c['schedulers'] = []
@@ -388,6 +408,10 @@
 
         builder["factory"] = factory(*factoryArgs)
 
+        builder["category"] = "noncore"
+        if wkbb._is_core_builder(builder['name']):
+            builder["category"] = "core"
+
         c['builders'].append(builder)
 
 loadBuilderConfig(c)
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html
index b38adc9..d819cc7 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html
@@ -9,6 +9,8 @@
 <h1>Welcome to the Buildbot!</h1>
 
 <ul>
+  <li><a href="console?category=core">Core Console</a></li>
+  <li><a href="waterfall?category=core">Core Waterfall</a></li>
   <li><a href="console">Console</a></li>
   <li><a href="waterfall">Waterfall Display</a> will give you a time-oriented summary of recent buildbot activity.</li>
   <li><a href="one_box_per_builder">Latest Build</a> for each builder is here.</li>
diff --git a/WebKitTools/BuildSlaveSupport/built-product-archive b/WebKitTools/BuildSlaveSupport/built-product-archive
index ca43dad..b27cf77 100644
--- a/WebKitTools/BuildSlaveSupport/built-product-archive
+++ b/WebKitTools/BuildSlaveSupport/built-product-archive
@@ -48,7 +48,7 @@
 
 
 def archiveBuiltProduct(configuration, platform):
-    assert platform in ('mac', 'win')
+    assert platform in ('mac', 'win','qt')
 
     archiveFile = os.path.join(buildDirectory, configuration + ".zip")
 
@@ -81,8 +81,30 @@
 
         shutil.rmtree(thinDirectory)
 
+    elif platform == 'qt':
+        configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+        thinDirectory = os.path.join(configurationBuildDirectory, "thin")
+
+        if os.path.isdir(thinDirectory):
+            shutil.rmtree(thinDirectory)
+        os.mkdir(thinDirectory)
+
+        for dirname in ["bin", "lib", "JavaScriptCore"]:
+            fromDir = os.path.join(configurationBuildDirectory, dirname)
+            toDir = os.path.join(thinDirectory, dirname)
+            if subprocess.call(["cp", "-R", fromDir, toDir]):
+                return 1
+
+        for root, dirs, files in os.walk(thinDirectory, topdown=False):
+            for name in files:
+                if name.endswith(".o"):
+                    os.remove(os.path.join(root, name))
+
+        if subprocess.call(["zip", "-y", "-r", archiveFile, "."], cwd=thinDirectory):
+            return 1
+
 def extractBuiltProduct(configuration, platform):
-    assert platform in ('mac', 'win')
+    assert platform in ('mac', 'win','qt')
 
     archiveFile = os.path.join(buildDirectory, configuration + ".zip")
 
@@ -112,7 +134,15 @@
         if subprocess.call(["unzip", "-o", archiveFile], cwd=buildDirectory):
             return 1
 
-        
+    elif platform == 'qt':
+        configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+
+        if os.path.isdir(configurationBuildDirectory):
+            shutil.rmtree(configurationBuildDirectory)
+
+        if subprocess.call(["unzip", "-o", archiveFile, "-d", configurationBuildDirectory], cwd=buildDirectory):
+            return 1
+        os.unlink(archiveFile)
 
 if __name__ == '__main__':
     sys.exit(main())
diff --git a/WebKitTools/BuildSlaveSupport/win/kill-old-processes b/WebKitTools/BuildSlaveSupport/win/kill-old-processes
new file mode 100755
index 0000000..50fb8a5
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/win/kill-old-processes
@@ -0,0 +1,37 @@
+#!/usr/bin/python

+

+# Copyright (C) 2010 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 AND ITS 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 APPLE OR ITS 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.

+

+import os, sys

+

+def main():

+    tasksToKill = ["DumpRenderTree.exe", "DumpRenderTree_debug.exe", "testapi.exe", "testapi_debug.exe",

+                "svn.exe", "httpd.exe", "cl.exe", "link.exe", "midl.exe", "devenv.exe", "perl.exe",

+                "imagediff.exe", "imagediff_debug.exe", "jsc.exe", "jsc_debug.exe"]

+

+    for task in tasksToKill:

+        os.system("taskkill /f /im " + task)

+

+if __name__ == '__main__':

+    sys.exit(main())

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6a4b7b3..a03ae52 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,10307 @@
+2010-04-21  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        aria-liveregion-notifications.html fails on leopard release bot
+        https://bugs.webkit.org/show_bug.cgi?id=37112
+
+        Change the way that notifications are listened for by forcing clients
+        to call a remove listener as well to match the add listener. DRT will
+        assert if those are not done in the correct order. 
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (removeNotificationListenerCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::removeNotificationListener):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (-[AccessibilityNotificationHandler initWithPlatformElement:]):
+        (-[AccessibilityNotificationHandler dealloc]):
+        (-[AccessibilityNotificationHandler _notificationReceived:]):
+        (-[AccessibilityNotificationHandler setCallback:]):
+        (AccessibilityUIElement::AccessibilityUIElement):
+        (AccessibilityUIElement::~AccessibilityUIElement):
+        (AccessibilityUIElement::addNotificationListener):
+        (AccessibilityUIElement::removeNotificationListener):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::removeNotificationListener):
+
+2010-04-21  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add debug menu items to show/hide the Web View.
+        https://bugs.webkit.org/show_bug.cgi?id=37958
+
+        * MiniBrowser/mac/BrowserWindowController.h:
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController showHideWebView:]):
+        (-[BrowserWindowController removeReinsertWebView:]):
+        (-[BrowserWindowController validateMenuItem:]):
+        * MiniBrowser/mac/English.lproj/MainMenu.xib:
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed.  Rolling out unicode() changes as they broke NRWT for chromium.
+        Rolling out:
+        http://trac.webkit.org/changeset/58014
+        http://trac.webkit.org/changeset/58016
+        http://trac.webkit.org/changeset/58020
+
+        REGRESSION(57531): the commit-queue still hates Tor Arne Vestbo
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+        * Scripts/webkitpy/common/config/committers.py:
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+        * Scripts/webkitpy/common/net/statusserver.py:
+        * Scripts/webkitpy/common/prettypatch.py:
+        * Scripts/webkitpy/common/system/autoinstall.py:
+        * Scripts/webkitpy/common/system/deprecated_logging.py:
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/gtk.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        * Scripts/webkitpy/layout_tests/port/server_process.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+        * Scripts/webkitpy/style/filereader_unittest.py:
+        * Scripts/webkitpy/thirdparty/__init__.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+        * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, fixing NRWT for real this time.
+
+        REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+         - Add a hack to fix new-run-webkit-tests
+           my understanding of codecs.open(encoding=None)
+           must have been wrong.
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, just fixing exception seen on builders.
+
+        REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+         - Pass and encoding to _write_into_file_at_path
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        I fixed the queue to not ignore Tor as a reviwer in r57531,
+        but instead it throws an exception every time his name is in a patch.
+
+        This fixes our Executive.run_command code to work around a Popen
+        bug http://bugs.python.org/issue5290 whereby python versions before 2.6
+        do not correctly handle unicode objects as input or output to
+        Popen.communicate.
+
+        Following the advice of:
+        http://farmdev.com/talks/unicode/
+        I have changed all of webkitpy to use unicode() objects as strings
+        instead of str objects (which in Python 3 are renamed "bytes").
+
+        String literals were left as "foo" instead of converting to u"foo"
+        as u"foo" is only required if the string has a non-ascii code point.
+        Python is smart about comparing str() and unicode() values and will
+        log an error to the console if the comparison is ever invalid.
+
+        Executive.run* now correctly accept and return unicode() objects.
+        I attempted to fix all the places that we call .write() to make sure we
+        encode any unicode() objects into utf-8.
+
+        I removed several uses of StringIO.  StringIO should generally always be
+        passed a unicode() value.
+
+        Likewise I replaced most calls to open() with codecs.open().
+        codecs.open() matches Python 3 open semantics in requiring an encoding
+        parameter.  Files opened with codecs.open() with a unicode-compatible
+        encoding will vend unicode() objects from their read() calls, like how
+        StringIO created with a unicode() object will do.
+
+        I also deployed "with" statements wider (now that the project has
+        settled on Python 2.5) to close a bunch of file descriptor leaks.
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+         - Read/write utf-8 files instead of ascii.
+         - Update the tests to use test for proper unicode() handling.
+        * Scripts/webkitpy/common/checkout/changelog.py:
+         - Document that parse_latest_entry_from_file expects
+           file-like objects which return unicode strings.
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+         - Use unicode() strings instead of str() byte arrays.
+         - Deploy "with" to close file descriptor leaks.
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+         - Remove unneeded import.
+        * Scripts/webkitpy/common/checkout/scm.py:
+         - Remove use of str().
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+         - Read/write utf-8 files and use unicode() strings in testing.
+        * Scripts/webkitpy/common/config/committers.py:
+         - Use \u instead of \x to make slightly clearer what we're doing.
+        * Scripts/webkitpy/common/net/bugzilla.py:
+         - Add a new _string_contents() method and explain why
+            we have to call unicode() on the result of soup.string
+            and why it's safe to do so w/o needing to pass a codec name.
+          - Remove the (unused) support for passing a file object to add_patch_to_bug().
+        * Scripts/webkitpy/common/net/buildbot.py:
+         - Use unicode() instead of str() when needing to coax a
+            NavigableString object into a unicode() object.
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+         - Add a test which contains a unicode builder name.
+        * Scripts/webkitpy/common/net/statusserver.py:
+         - Remove use of str()
+        * Scripts/webkitpy/common/prettypatch.py:
+         - Write out the patch file as utf-8.
+        * Scripts/webkitpy/common/system/autoinstall.py:
+         - Write out files with a explicit encodings.
+         - Deploy "with" to close file descriptor leaks.
+        * Scripts/webkitpy/common/system/deprecated_logging.py:
+         - Write out log files as utf-8.
+        * Scripts/webkitpy/common/system/executive.py:
+         - Make run* properly take and return unicode() objects.
+         - Cleaned up input handling in run_command a little by adding
+           a _compute_input() method which can return early instead of having
+           such a long/cluttered if-block.
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+         - Added a unit test to make sure we don't break Tor again!
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+         - Write out the test list as utf-8.
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+         - Write out json files as utf-8.
+        * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+         - Deploy "with" to close file descriptor leaks.
+        * Scripts/webkitpy/layout_tests/port/chromium.py: Add Executive.py FIXME.
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py: ditto.
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py: ditto.
+        * Scripts/webkitpy/layout_tests/port/gtk.py: ditto.
+        * Scripts/webkitpy/layout_tests/port/mac.py: ditto.
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+         - Make the skipped file parsing test unicode.
+        * Scripts/webkitpy/layout_tests/port/qt.py: Add Executive.py FIXME.
+        * Scripts/webkitpy/layout_tests/port/server_process.py: ditto.
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+         - Deploy "with" to close file descriptor leaks.
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+         - Make explicit the encodings of log files and pid files.
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+         - Make encodings explicit and deploy "with".
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py: ditto.
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py: ditto.
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: ditto.
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py: ditto.
+        * Scripts/webkitpy/style/filereader_unittest.py: ditto.
+        * Scripts/webkitpy/thirdparty/__init__.py: ditto.
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+         - Removed extra import.
+        * Scripts/webkitpy/tool/commands/queues.py:
+         - No need to map args to strings now that run_command does.
+         - Update test results to match args changes.
+         - Document our global argument hacks.
+        * Scripts/webkitpy/tool/commands/upload.py:
+         - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+        * Scripts/webkitpy/tool/mocktool.py:
+         - Rename add_patch_to_bug argument to match bugzilla.py
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+         - Executive.run_* now require lists instead of strings.
+           The lack of this change was what broke webkit-patch
+           for svn users the first time this was landed.
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+         - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+        * Scripts/webkitpy/tool/steps/postdiffforcommit.py: ditto
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py: ditto
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+         - Fixed spurious logging seen when running test-webkitpy
+
+2010-04-21  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Unreviewed.
+
+        Add myself in committers.py.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-21  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        new-run-webkit-tests: fix a bug in the Chromium port where we would
+        try to talk to a crashed test_shell and raise exceptions that weren't
+        being caught.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37941
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed.
+
+        [Qt] [Symbian] Build fix.
+
+        Work around a Qt quirk. Some versions of Symbian port Qt
+        QFontDatabase::removeAllApplicationFonts symbol is not available.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::open):
+
+2010-04-21  Alexey Proskuryakov  <ap@apple.com>
+
+        Unreviewed.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37933
+        <rdar://problem/7719540> XMLHttpRequest.withCredentials should be better enforced.
+
+        Adding stub implementation of authenticateSession(). Depending on platform loader behavior,
+        a real implementation may or may not be necessary for the one test that currently uses it
+        to pass.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::authenticateSession):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37933
+        <rdar://problem/7719540> XMLHttpRequest.withCredentials should be better enforced.
+
+        Adding authenticateSession() method that adds credentials to per-process credential storage
+        (for platforms that even have such). No Windows implementation, because writing another
+        loader for DRT is painful.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (authenticateSessionCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (-[SynchronousLoader dealloc]):
+        (-[SynchronousLoader connectionShouldUseCredentialStorage:]):
+        (-[SynchronousLoader connection:didReceiveAuthenticationChallenge:]):
+        (-[SynchronousLoader connection:didFailWithError:]):
+        (-[SynchronousLoader connectionDidFinishLoading:]):
+        (+[SynchronousLoader makeRequest:withUsername:password:]):
+        (LayoutTestController::authenticateSession):
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::authenticateSession):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::authenticateSession):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::authenticateSession):
+        Stub implementations.
+
+2010-04-21  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Make DRT compilable in Chromium tree
+        https://bugs.webkit.org/show_bug.cgi?id=37923
+
+        We need to use different GYPs in a case of WebKit-only checkout
+        and a case of whole Chromium checkout because the relative paths
+        from webkit/ to WebKit/chromium/features.gypi are different in
+        these cases and we can't use 'conditions' for 'includes' in GYPs.
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-21  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        List item markers are not always updated after changes in the DOM.
+        https://bugs.webkit.org/show_bug.cgi?id=37060
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (markerTextForListItemCallback): A function that returns the marker text for a given list item.
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::markerTextForListItem): Implement it in the GTK port.
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::markerTextForListItem): Add a stub.
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::markerTextForListItem): Implement it in the Qt port.
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::markerTextForListItem): Add a stub.
+
+2010-04-21  Adam Roben  <aroben@apple.com>
+
+        Exclude leaks in CGGradientCreateWithColorComponents from
+        run-webkit-tests leaks output
+
+        The leak in CG is covered by <rdar://problem/7888492>.
+
+        Fixes <http://webkit.org/b/37927>.
+
+        Reviewed by Eric Carlson.
+
+        * Scripts/old-run-webkit-tests:
+        (sub countAndPrintLeaks): Exclude leaks in
+        CGGradientCreateWithColorComponents on certain OSs.
+
+2010-04-21  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [DRT/Chromium] Import MockSpellCheck from Chromium
+        https://bugs.webkit.org/show_bug.cgi?id=37910
+
+        Import webkit/tools/test_shell/mock_spellcheck.{cc,h} rev.37241 of Chromium.
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+          Add ICU explicitly because WTFString.h includes ICU headers.
+          Add MockSpellCheck.{cpp,h}.
+        * DumpRenderTree/chromium/MockSpellCheck.cpp: Added.
+        * DumpRenderTree/chromium/MockSpellCheck.h: Added.
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::spellCheck):
+        * DumpRenderTree/chromium/WebViewHost.h:
+        * DumpRenderTree/chromium/config.h: Define JS_EXPORTDATA, which is used
+          by wtf/text/AtomicString.h included by wtf/text/WTFString.h.
+
+2010-04-21  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add webkit-patch pretty-diff
+        https://bugs.webkit.org/show_bug.cgi?id=37892
+
+        This is slightly lame because it asks you whether the diff is correct,
+        but it's a starting point.
+
+        * Scripts/webkitpy/tool/commands/__init__.py:
+        * Scripts/webkitpy/tool/commands/prettydiff.py: Added.
+        * Scripts/webkitpy/tool/main.py:
+
+2010-04-21  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Remove mention of non-existant --no-build option
+        https://bugs.webkit.org/show_bug.cgi?id=37893
+
+        The option doesn't exist!
+
+        * Scripts/webkitpy/tool/commands/stepsequence.py:
+
+2010-04-21  Balazs Kelemen  <kb@inf.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Interrupting JavaScript is cumbersome when you use QtLaucher for testing or profiling.
+        https://bugs.webkit.org/show_bug.cgi?id=37198
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::toggleInterruptingJavaScriptEnabled):
+        (LauncherWindow::newWindow):
+        (LauncherWindow::cloneWindow):
+        (LauncherWindow::createChrome):
+        (main):
+        * QtLauncher/webpage.cpp:
+        (WebPage::WebPage):
+        (WebPage::shouldInterruptJavaScript):
+        * QtLauncher/webpage.h:
+        (WebPage::setInterruptingJavaScriptEnabled):
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r57963.
+        http://trac.webkit.org/changeset/57963
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        Three tests started crashing on the Qt bot.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Make new-run-webkit-tests work for the Qt port
+        https://bugs.webkit.org/show_bug.cgi?id=37588
+
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+
+2010-04-21  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests: try to detect alternate apache path
+        https://bugs.webkit.org/show_bug.cgi?id=37587
+
+        _check_port_build() also needs to return true in the
+        base implementation to not fail the check_build step.
+
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, test fix only.
+
+        new-run-webkit-tests: implement a --log trace message to be able to display detailed output of an individual test run
+        https://bugs.webkit.org/show_bug.cgi?id=37726
+
+        This change seems to have broken a test.
+        Attempting to handle the case where we don't have any
+        timing information.  Dirk may have to correct this change.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests has much higher startup latency than run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=37643
+
+        I got rid of the -expected.checksum reads during startup.
+        This makes startup noticably better on my laptop.
+
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+         - Use image_hash() instead of .image_hash now that expected.checksum
+           file reads are done lazily.
+        * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+         - Add debug logging for this sleep call.
+           In my testing I never saw this sleep() hit.
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+         - Sleep a shorter interval to make websocket server
+           startup more responsive.  On my machine startup was
+           taking around 1 second.
+         - Remove the unconditional .5s delay on startup.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+         - Make image_hash file reads done lazily in a new image_hash() function.
+         - Add a "Starting testing ..." meter update after DRT threads have
+           been started, but before we get updates from the first one.
+         - Rename variable "t" to a full english name to match WebKit style.
+
+2010-04-20  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37748
+
+        Make Sheriffbot more inspirational.
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Import Chromium image_diff as ImageDiff
+        https://bugs.webkit.org/show_bug.cgi?id=37790
+
+        ImageDiff.cpp is based on tools/imagediff/image_diff.cc r41911 of Chromium.
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+        * DumpRenderTree/chromium/ImageDiff.cpp: Added.
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+
+2010-04-20  Dirk Pranke <dpranke@chromium.org>
+
+        This patch to new-run-webkit-tests adds a --log 'trace' option
+        that prints out detailed info about a given test as it executes
+        (where the baselines are, what the expectation is, what we got,
+        how long it took).
+
+        https://bugs.webkit.org/show_bug.cgi?id=37726
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+          - use the newly exposed TestResult class and implement
+            --log trace
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_thread.py:
+          - rename TestStats to TestResult and make it more public, resulting
+            in cleaner code
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+          - add expectation_to_string() as a separate callable function
+
+2010-04-20  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r57907.
+        http://trac.webkit.org/changeset/57907
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        Appears to have broken MacEWS and possibly webkit-patch upload
+        for svn users.  Needs further investigation.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+        * Scripts/webkitpy/common/config/committers.py:
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+        * Scripts/webkitpy/common/net/statusserver.py:
+        * Scripts/webkitpy/common/prettypatch.py:
+        * Scripts/webkitpy/common/system/autoinstall.py:
+        * Scripts/webkitpy/common/system/deprecated_logging.py:
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+        * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+
+2010-04-20  Nate Chapin  <japhet@chromium.org>
+
+        Unreviewed.
+
+        Update my irc handle in committers.py (natechapin -> japhet).
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+        https://bugs.webkit.org/show_bug.cgi?id=37765
+
+        I fixed the queue to not ignore Tor as a reviwer in r57531,
+        but instead it throws an exception every time his name is in a patch.
+
+        This fixes our Executive.run_command code to work around a Popen
+        bug http://bugs.python.org/issue5290 whereby python versions before 2.6
+        do not correctly handle unicode objects as input or output to
+        Popen.communicate.
+
+        Following the advice of:
+        http://farmdev.com/talks/unicode/
+        I'm attempting to take the python unicode plunge and use unicode()
+        objects as strings instead of str() objects everywhere in webkitpy.
+
+        We do not have to use u"" instead of "" because u"a" == "a" as expected
+        in Python.  Python will generate a warning to the console in cases where
+        a unicode() == str() operation cannot be performed.
+
+        I also cleaned up the input handling in run_command a little by adding
+        a new _compute_input() method which can return early instead of having
+        such a long/cluttered if-block.
+
+        Executive.run* now correctly accept and return unicode() objects.
+        I attempted to fix all the places that we call .write() to make sure we
+        encode any unicode() objects into utf-8.
+
+        All places which use StringIO need to be sure to pass StringIO a
+        pre-encoded byte-array (str object) instead of unicode so that
+        clients which read from the StringIO don't have encoding exceptions.
+        To make this easier, I removed the patch_file_object support from
+        add_patch_to_bug, and changed the 4 places which previously used
+        StringIO to create a fake patch file.
+
+        I attempted to document any places where we are not correctly converting
+        to/from bytes (str() objects) to strings (unicode() objects).
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+         - Read/write utf-8 files instead of ascii.
+         - Update the tests to use test for proper unicode() handling.
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+         - Use unicode() strings instead of str() byte arrays.
+        * Scripts/webkitpy/common/checkout/scm.py:
+         - Remove use of str().
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+         - Read/write utf-8 files and use unicode() strings in testing.
+        * Scripts/webkitpy/common/config/committers.py:
+         - Use \u instead of \x to make slightly clearer what we're doing.
+        * Scripts/webkitpy/common/net/bugzilla.py:
+         - Add a new _string_contents() method and explain why
+           we have to call unicode() on the result of soup.string
+           and why it's safe to do so w/o needing to pass a codec name.
+         - Remove the (unused) support for passing a file object to add_patch_to_bug().
+        * Scripts/webkitpy/common/net/buildbot.py:
+         - Use unicode() instead of str() when needing to coax a
+           NavigableString object into a unicode() object.
+        * Scripts/webkitpy/common/net/statusserver.py:
+         - Remove use of str()
+        * Scripts/webkitpy/common/prettypatch.py:
+         - Write out the patch file as utf-8.
+        * Scripts/webkitpy/common/system/autoinstall.py:
+         - Add a FIXME about encoding.
+        * Scripts/webkitpy/common/system/deprecated_logging.py:
+         - Document that tee() works on bytes, not strings.
+        * Scripts/webkitpy/common/system/executive.py:
+         - Make run* properly take and return unicode() objects.
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+         - Added a unit test to make sure we don't break Tor again!
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+         - Write out the test list as utf-8.
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+         - Write out json files as utf-8.
+        * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+         - Add FIXME about encoding handling.
+        * Scripts/webkitpy/tool/commands/upload.py:
+         - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+        * Scripts/webkitpy/tool/mocktool.py:
+         - Rename add_patch_to_bug argument to match bugzilla.py
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+         - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+        * Scripts/webkitpy/tool/steps/postdiffforcommit.py: ditto.
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py: ditto.
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+         - Fixed spurious logging seen when running test-webkitpy
+
+2010-04-20  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        For check-webkit-style, implemented __eq__() and __ne__() (the
+        built-in equality and inequality methods) for the
+        DefaultStyleErrorHandler class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37850
+
+        This will facilitate unit-testing for a subsequent patch,
+        namely for https://bugs.webkit.org/show_bug.cgi?id=37850
+
+        * Scripts/webkitpy/style/error_handlers.py:
+          - Added __eq__() and __ne__() to the DefaultStyleErrorHandler
+            class.
+
+        * Scripts/webkitpy/style/error_handlers_unittest.py:
+          - Added unit tests for __eq__() and __ne__().
+          - Also included a minor clean-up refactoring of combining the
+            StyleErrorHandlerTestBase class (which has not needed to
+            be separate due to previous changes) into the
+            DefaultStyleErrorHandlerTest class.
+
+2010-04-20  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Unreviewed.
+
+        Add my IRC nick to the committers.py list.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20  Kim Grönholm  <kim.gronholm@nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Multitouch mocking in QtLauncher doesn't work with QGraphicsView
+        https://bugs.webkit.org/show_bug.cgi?id=37816
+        
+        Fix multi-touch mocking in QtLauncher when using QGraphicsView.
+        Test: https://bug-32434-attachments.webkit.org/attachment.cgi?id=44955
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::eventFilter):
+        (LauncherWindow::initializeView):
+
+2010-04-20  MORITA Hajime <morrita@google.com>
+
+        Unreviewed, add myself to the committers list.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [DRT/Chromium] Fix some unexpected results of editing
+        https://bugs.webkit.org/show_bug.cgi?id=37843
+
+        This change fixes about 70 unexpected results.
+        The original test_webview_delegate.cc doesn't have this bug.
+        The bug was introduced when I ported it to WebKit tree.
+
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (printRangeDescription): Replace the latter startContainer() with endContainer().
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        Turn off some unit tests for now - the new-run-webkit-tests dryrun
+        tests for chromium won't work if you don't have a chromium checkout.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37841
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        (Re-)add dryrun.py; this was renamed from passing.py in the previous
+        CL but apparently somehow didn't get checked in.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37841
+
+        * Scripts/webkitpy/layout_tests/port/dryrun.py: Added.
+
+2010-04-19  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by David Levin.
+
+        check-webkit-style: exits when encountering a deleted file
+        https://bugs.webkit.org/show_bug.cgi?id=37122
+
+        This reverts the quick fix done by r57119 and makes check_patch
+        not call check_file for deleted files.
+
+        Also this change fixes the behavior for "-", which should mean
+        stdin.  Before this change, the style checker just ignored "-"
+        with a warning message.
+
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-04-19  Daniel Bates  <dbates@rim.com>
+
+        No review, rolling out 57868.
+        http://trac.webkit.org/changeset/57868
+        https://bugs.webkit.org/show_bug.cgi?id=37748
+
+        Sheriffbot wasn't very inspirational after this patch.
+        Instead, he was silent when you said hi :-(. Rolling
+        out this patch so that I can debug/test this some more.
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-19  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37748
+
+        Make Sheriffbot more inspirational.
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-19  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix, add missing header.
+
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+ 
+         Reviewed by Adam Barth.
+ 
+         new-run-webkit-tests - repurpose the "Passing" port as "Dryrun" port
+         that can be used to test platforms other than the one you are running
+         on. This can be useful for checking baselines and testing code
+         coverage.
+ 
+         Note that running the code on the "wrong" port requires each
+         port-specific implementation to actually not require any
+         platform-specific python code (e.g., the chromium-win port must
+         test for the existence of windows functions before calling them).
+ 
+         https://bugs.webkit.org/show_bug.cgi?id=37782
+ 
+         * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+         * Scripts/webkitpy/layout_tests/port/dryrun.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py.
+         * Scripts/webkitpy/layout_tests/port/factory.py:
+         * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests: add --build (default) and --no-build
+        options to make that step optional. This flag modifies what happens
+        in port.check_build().
+
+        https://bugs.webkit.org/show_bug.cgi?id=37786
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        new-run-webkit-tests - fix a typo in r57480 that caused us to stop
+        logging the actual list of unexpected results.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37831
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Dirk Pranke <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        From a patch by Tor Arne Vestbo  <tor.arne.vestbo@nokia.com>
+
+        new-run-webkit-tests: make the retry step more explicit
+        https://bugs.webkit.org/show_bug.cgi?id=37606
+
+        It might be confusing to see the test and percent counters
+        reset without any notice of what's going on, so we make the
+        message that a retry-run is started explicit.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Sam Weinig  <weinig@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Add support for opening a new window (File->New Window) to
+        Windows MiniBrowser. Accelerator doesn't work.
+
+        * MiniBrowser/win/BrowserView.cpp:
+        (createNewPage): Use BrowserView::create.
+        * MiniBrowser/win/BrowserWindow.cpp:
+        (BrowserWindow::onCommand): Respond to ID_FILE_NEW_WINDOW
+        by creating a new window.
+        * MiniBrowser/win/BrowserWindow.h:
+        (BrowserWindow::create): Added. Don't allow creating
+        BrowserWindows on the stack by making constructor
+        private and exposing the create function.
+        * MiniBrowser/win/MiniBrowser.cpp:
+        (MiniBrowser::createNewWindow): Move new window creation
+        logic here.
+        * MiniBrowser/win/MiniBrowser.h:
+        * MiniBrowser/win/MiniBrowser.rc: 
+        * MiniBrowser/win/main.cpp:
+        (_tWinMain): Use the new MiniBrowser::createNewWindow().
+
+2010-04-19  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: aria-haspopup needs to be exposed
+        https://bugs.webkit.org/show_bug.cgi?id=37808
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::hasPopup):
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Submit a better workaround for r57806 than the one in r57831 - log
+        an error and exit if you try to run new-run-webkit-tests with --use-drt
+        on Windows.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37822
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-19  Jesus Sanchez-Palencia  <jesus@webkit.org>
+
+        Unreviewed.
+
+        Just adding myself as a committer.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Add slightly better logging to the websocket python wrapper script,
+        including a --verbose flag for debug output.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37233
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        * Scripts/new-run-webkit-websocketserver:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests: add a way (--print-unexpected-results) to
+        (re-)print out the tests that produced unexpected results in the
+        last run. Also add a way (--retry-unexpected-results) to
+        automatically re-test them.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37783
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Restructure the logging in new-run-webkit-tests so that many of log
+        messages that were logged to the MeteredStream also get logged in
+        --verbose mode.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37780
+
+        * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests: add 'summary' and 'unexpected-results' options
+        to the --log flag. Also add a 'progress' flag to enable the regular
+        progress bar (as opposed to 'detailed-progress', which enables the
+        dots). Also add a 'nothing' flag to allow you to be explicit that
+        you don't want any logging on the command line.
+
+        The default is
+        '--log detailed-progress,summary,unexpected,unexpected-results'
+
+        (The default logging is unchanged by this patch, this just makes things
+        properly configurable).
+
+        Note that 'nothing' doesn't work properly yet; I need a couple other
+        patches to land to avoid rewriting things several different ways.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37785
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        Make the URL change on committed load.
+
+        * QtLauncher/mainwindow.cpp:
+        (MainWindow::buildUI):
+        (MainWindow::setAddressUrl):
+        * QtLauncher/mainwindow.h:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix a typo in the rebaselining tool that causes us to use "debug"
+        instead of "Debug" in a directory path, which fails on platforms with
+        case-sensitive filesystems.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37819
+
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        Fix breakage of chromium-win canary bots caused by r57806. That patch
+        introduced the option of using Chrome's new port of DumpRenderTree,
+        but unfortunately that port relies on the webkit.py class
+        implementation which uses non-blocking I/O that isn't available on
+        Windows. This patch turns off that option and doesn't import the
+        class if we're running on Windows.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37817
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-19  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by abarth.
+
+        Fix a typo
+
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-19  Adam Roben  <aroben@apple.com>
+
+        Fix run-webkit-tests when there are spaces in the path
+
+        Fixes <http://webkit.org/b/37809>
+
+        Reviewed by Adam Barth.
+
+        * Scripts/run-webkit-tests: Use an "indirect object" to specify the
+        path to the harness to exec(). According to perldoc, this usage will
+        prohibit perl from parsing the arguments to exec() via the shell,
+        which would incorrectly split paths with spaces in them, etc.
+
+2010-04-19  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Adam Roben.
+
+        WinLauncher.h should use LF line-endings and use native line-endings style.
+        https://bugs.webkit.org/show_bug.cgi?id=37807
+
+        * WinLauncher/WinLauncher.h: Added property svn:eol-style, converted to LF line-endings.
+
+2010-04-19  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [DRT/Chromium] Fix a test initialization problem
+        https://bugs.webkit.org/show_bug.cgi?id=37791
+
+        * DumpRenderTree/chromium/DumpRenderTree.cpp:
+        (runTest): Call resetTestController() before runFileTest(). Some
+          controllers initialize their fields in reset() and not in their
+          constructors.
+
+2010-04-19  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] new-run-webkit-tests should use WebKitDriver for --use-drt
+        https://bugs.webkit.org/show_bug.cgi?id=37793
+
+        We need to use WebKitDriver instead of ChromiumDriver for Chromium
+        DRT because its interface is different from test_shell.
+
+        Chromium DRT has no UI.  So we can't use it to show test results.
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-18  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Make failure-reason more forgiving
+        https://bugs.webkit.org/show_bug.cgi?id=37525
+
+        Removed search_limit, which wasn't very useful anyway.
+        Added a log about the long load time loading from the builders.
+        Prompt the user for what revision to start walking from (makes it easy to restart upon failure).
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-18  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Created a class for check-webkit-style that encapsulates iterating
+        over text files and reading them.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37754
+
+        This revision is an intermediate step towards separating our
+        style-checking code from the logic of iterating over files and
+        reading them.
+
+        * Scripts/webkitpy/common/system/logtesting.py:
+          - Added a logMessages() method to the LoggingTestCase class.
+            This method provides unit tests with access to the raw list
+            of log messages in case the tester needs to do something more
+            than simply assert the list of existing messages.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added a ProcessorBase class that processors of lists of lines
+            should eventually inherit from.
+          - Also added a FIXME to use the ProcessorBase class and the
+            TextFileReader class added below.
+
+        * Scripts/webkitpy/style/filereader.py: Added.
+          - Created a TextFileReader class that encapsulates reading
+            and iterating over text files.
+
+        * Scripts/webkitpy/style/filereader_unittest.py: Added.
+          - Added a TextFileReaderTest class to unit-test the
+            new TextFileReader class.
+
+2010-04-15  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        [chromium] new-run-webkit-tests should be able to use chromium DRT
+        https://bugs.webkit.org/show_bug.cgi?id=37645
+
+        Make sure that the lack of a chromium checkout doesn't cause the script to
+        fail.
+
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py: Fix up a few paths
+            to be relative to an upstream output dir.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Add --use-drt flag.
+
+2010-04-18  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, fixing the Qt bot.
+
+        Add a layer of indirection when calling run-webkit-tests to allow testing new-run-webkit-tests on various platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37632
+
+        * Scripts/run-webkit-tests:
+         - Exit non-zero of launching the harness fails.
+
+2010-04-18  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, fixing the Qt bot.
+
+        Add a layer of indirection when calling run-webkit-tests to allow testing new-run-webkit-tests on various platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37632
+
+        * Scripts/run-webkit-tests:
+         - Fix the wrapper to work for users who do not
+           have WebKitTools/Scripts in their path.
+
+2010-04-14  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add a layer of indirection when calling run-webkit-tests to
+        allow testing new-run-webkit-tests on various platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=37632
+
+        This will let us test and fix bugs in new-run-webkit-tests
+        without needing to restart the buildbot master between tests.
+
+        Currently this change leaves run-webkit-tests as-is, but once
+        its landed we will easily be able to turn on/off
+        new-run-webkit-tests for various ports/configurations.
+
+        I will send a note out to webkit-dev about how we will
+        be using this launcher script to test on the bots.
+
+        * Scripts/old-run-webkit-tests: Copied from WebKitTools/Scripts/run-webkit-tests.
+        * Scripts/run-webkit-tests:
+         - A new script which decides whether to run new- or old-
+           run-webkit-tests based on the platform.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+         - Add some dummy argument handling for arguments which
+           old-run-webkit-tests supports but new-run-webkit-tests
+           does not yet.
+
+2010-04-18  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add Gtk bots to the list of "core builders" (builders which stop the commit-queue when they turn red)
+        https://bugs.webkit.org/show_bug.cgi?id=33295
+
+        The Gtk builders have been green every time I've looked
+        at them in the last 5 days or so.  It would appear webkit
+        is now keeping them green and we should update the core
+        builder list to match reality.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-18  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add support for LayoutTestController commands:
+                   setSmartInsertDeleteEnabled
+                   setSelectTrailingWhitespaceEnabled
+                   execCommand
+                   isCommandEnabled
+
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setSmartInsertDeleteEnabled):
+        (LayoutTestController::setSelectTrailingWhitespaceEnabled):
+        (LayoutTestController::execCommand):
+        (LayoutTestController::isCommandEnabled):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-17  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove steps_references and commands_references
+        https://bugs.webkit.org/show_bug.cgi?id=37758
+
+        We tried using the mumble_references convention to manage our
+        dependencies, but it doesn't seem to be providing much value for the
+        steps and commands module because these modules are small pieces of the
+        larger tool module.  In this patch, I've removed the references file
+        for these modules.
+ 
+        I've left the style_references file for the style module because that
+        module seems better isolated from the rest of webkitpy and the
+        style_references file appears to be providing some value.
+
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/commands_references.py: Removed.
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer_unittest.py:
+        * Scripts/webkitpy/tool/steps_references.py: Removed.
+
+2010-04-17  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        WebKit needs a Chromium Mac EWS Builder
+        https://bugs.webkit.org/show_bug.cgi?id=37742
+
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+
+2010-04-17  Adam Barth  <abarth@webkit.org>
+
+        Fix expected results for unit test broken by
+        http://trac.webkit.org/changeset/57772
+
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-17  Sam Weinig  <weinig@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Teach windows MiniBrowser how to work with window.open()
+        and targeted links.
+
+        * MiniBrowser/win/BrowserView.cpp:
+        (createNewPage): Create a new BrowserWindow and return its page.
+        (showPage): Show the page.
+        (closePage): Empty implementation.
+        (runJavaScriptAlert): Empty implementation.
+        (BrowserView::create): Register a UIClient.
+        * MiniBrowser/win/BrowserView.h:
+        (BrowserView::webView): Added.
+        Change create to take a BrowserWindow instead of an HWND.
+
+        * MiniBrowser/win/BrowserWindow.cpp:
+        (BrowserWindow::wndProc): Respond to WM_NCDESTROY.
+        (BrowserWindow::goToURL): Added. Forwards to BrowserView.
+        (BrowserWindow::onCreate): Don't always go to the default
+        url. Let the caller do this.
+        (BrowserWindow::onNCDestroy): Delete the window.
+        * MiniBrowser/win/BrowserWindow.h:
+        (BrowserWindow::view): Added.
+        (BrowserWindow::window): Added.
+
+        * MiniBrowser/win/main.cpp:
+        (_tWinMain):
+        Go to the default URL for the initial page. Allocate the initial
+        window on the heap for correctness.
+
+2010-04-16  Adam Roben  <aroben@apple.com>
+
+        Add the Windows Debug (Test) builder to the list of core builders
+
+        It's been green for a few days now, and all the known Windows
+        flakiness is Release-only.
+
+        Rubber-stamped by Mark Rowe.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        (BuildBot.core_builder_name_regexps): Added a regular expression to
+        match the "Windows Debug (Test)" builder.
+
+2010-04-16  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Fix window.open() and targeted links.
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (_createNewPage): Use the correct initializer to and load the window.
+
+2010-04-16  Adam Roben  <aroben@apple.com>
+
+        Fix links to layout test results from build status pages
+
+        Reviewed by Mark Rowe.
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+        (ExtractTestResults.finished): Prepend "/" on the URL of the test
+        results page so that it is treated as an absolute URL.
+
+2010-04-16  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] build DRT on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=37690
+
+        * Scripts/build-dumprendertree: Add support for win and linux
+
+2010-04-16  Sam Weinig  <weinig@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use the threaded process model for MiniBrowser if holding down
+        the shift key on startup.
+
+        * MiniBrowser/win/BrowserView.cpp:
+        (BrowserView::create): 
+
+2010-04-15  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium] Add TestShellGtk.cpp so we can link on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=37561
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Add new file and
+            add platform file exceptions.
+        * DumpRenderTree/chromium/TestShellGtk.cpp: Added.
+        (AlarmHandler):
+        (TestShell::waitTestFinished):
+
+2010-04-15  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        build DRT on chromium mac
+        https://bugs.webkit.org/show_bug.cgi?id=37639
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+        * Scripts/build-dumprendertree: enable build-dumprendertree --chromium
+
+2010-04-15  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add LayoutTestHelper for Mac
+        https://bugs.webkit.org/show_bug.cgi?id=37668
+
+        LayouTestHelper.mm is based on webkit/tools/test_shell/mac/layout_test_helper.mm
+        of Chromium.
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+        * DumpRenderTree/chromium/LayoutTestHelper.mm: Added.
+
+2010-04-15  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37494
+        <rdar://problem/7857060> REGRESSION (r57340): fast/events/mouse-drag-from-frame-to-other-frame.html
+        fails on Windows
+
+        * DumpRenderTree/win/EventSender.cpp: (makeEventSender):
+        * DumpRenderTree/win/EventSender.h:
+        Tell EventSender if it's being created for a top frame.
+        
+        * DumpRenderTree/win/FrameLoadDelegate.cpp:
+        (FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld): We only want to reset
+        EventSender machinery when a new test is loaded, not when an iframe (or just its global
+        object) is created.
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Fix Windows WebKit2 build.
+
+        * MiniBrowser/win/MiniBrowser.cpp:
+
+2010-04-15  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Include codereview issue number in patch description
+        https://bugs.webkit.org/show_bug.cgi?id=37677
+
+        This lets us know which rietveld issue this patch is tied to.
+
+        Also, make it so that --fancy-review overrides --no-review.
+
+        * Scripts/webkitpy/tool/steps/postcodereview.py:
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-04-15  Adam Roben  <aroben@apple.com>
+
+        Make --exit-after-n-failures work when all tests are timing out or crashing
+
+        Fixes <http://webkit.org/b/37679>.
+
+        Reviewed by Jon Honeycutt.
+
+        * Scripts/run-webkit-tests:
+        (top level): When a test crashes or times out, break out of the main loop if
+        stopRunningTestsEarlyIfNeeded returns true. Moved some code from the bottom of the main loop
+        from here...
+        (stopRunningTestsEarlyIfNeeded): ...to here.
+
+2010-04-15  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Add WebHistoryClient support.
+        https://bugs.webkit.org/show_bug.cgi?id=37671
+
+        Add HistoryClient logging.
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (_didNavigateWithNavigationData):
+        (_didPerformClientRedirect):
+        (_didPerformServerRedirect):
+        (_didUpdateHistoryTitle):
+        (-[BrowserWindowController awakeFromNib]):
+
+2010-04-15  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Start the mini browser in threaded mode if shift is pressed during startup.
+        https://bugs.webkit.org/show_bug.cgi?id=37670
+
+        * MiniBrowser/mac/AppDelegate.m:
+        (-[BrowserAppDelegate init]):
+
+2010-04-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AXHelp is being appended from ancestors incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=37659
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (getHelpTextCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::helpText):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::helpText):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::helpText):
+
+2010-04-15  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Re-format run-webkit-tests to fit in 80-columns for PEP-8 compliance.
+        (broken by r57463 and r57381, at least). I've also filed bug 37477
+        to fix check-webkit-style to catch these things.
+
+        https://bugs.webkit.org/show_bug.cgi?id=38586
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-15  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add a way to override the user-visible name for the test binary since
+        some ports don't call it DumpRenderTree (e.g., Chromium Win uses
+        test_shell, Chromium Mac uses TestShell) by adding a driver_name()
+        method to the Port interface.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37631
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-14  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Add "Force Repaint" to debug menu.
+        https://bugs.webkit.org/show_bug.cgi?id=37627
+
+        * MiniBrowser/mac/BrowserWindowController.h:
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController forceRepaint:]):
+        * MiniBrowser/mac/English.lproj/MainMenu.xib:
+
+2010-04-15  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Add debug-minibrowser script.
+
+        * Scripts/debug-minibrowser: Copied from Scripts/run-minibrowser.
+        * Scripts/webkitdirs.pm:
+
+2010-04-15  Roland Steiner  <rolandsteiner@chromium.org>
+ 
+        Reviewed by Dimitri Glazkov.
+
+        Bug 37636 - [DRT/Chromium] Implement DRT/Chromium for Windows
+        https://bugs.webkit.org/show_bug.cgi?id=37636
+ 
+        Second patch: add Windows-specific implementation parts
+        of TestShell.
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell::finishedEvent):
+        * DumpRenderTree/chromium/TestShellWin.cpp:
+        (watchDogThread):
+        (TestShell::waitTestFinished):
+
+2010-04-15  Roland Steiner  <rolandsteiner@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Bug 37636 - [DRT/Chromium] Implement DRT/Chromium for Windows
+        https://bugs.webkit.org/show_bug.cgi?id=37636
+
+        First patch: fix compiler errors.
+
+        * DumpRenderTree/chromium/EventSender.cpp:
+        (EventSender::reset):
+        (EventSender::dispatchMessage):
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::pathToLocalResource):
+        * DumpRenderTree/chromium/TestWebWorker.h:
+        * DumpRenderTree/chromium/TextInputController.cpp:
+        * DumpRenderTree/chromium/WebViewHost.h:
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Moving setViewMode from DumpRenderTreeSupportQt to qwebpage.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=37622
+
+        Method qt_wrt_setViewMode was removed from qwebpage.cpp by mistake in r57433
+        (bug 35844). Moving it back.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+
+2010-04-15  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add some very minimal unit tests for new-run-webkit-tests. This should
+        be enough to catch egregious brokenness like syntax errors and import
+        declaration issues.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37432
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py: Added.
+
+2010-04-14  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Adam Roben.
+
+        Add a way for the buildbot to kill any old processes that are running. This
+        is useful because the Windows bots can get in states where a process remains
+        running (httpd.exe, DumpRenderTree.exe), which causes the bots to get in a red
+        state, and the processes must be killed manually.
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg: If we are on Windows, kill
+            the old processes that might be running.
+        * BuildSlaveSupport/win/kill-old-processes: Added.
+
+2010-04-14  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Tear down WebKit more completely on window closing and application
+        termination. We still don't block application termination for pending
+        close, but this is a step in the right direction.
+
+        * MiniBrowser/mac/AppDelegate.m:
+        (-[BrowserAppDelegate applicationWillTerminate:]):
+        * MiniBrowser/mac/BrowserWindowController.h:
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController dealloc]):
+        (-[BrowserWindowController windowWillClose:]):
+        (-[BrowserWindowController applicationTerminating]):
+
+2010-04-14  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Use pretty patch for confirming webkit-patch diffs
+        https://bugs.webkit.org/show_bug.cgi?id=37489
+
+        * Scripts/webkitpy/common/prettypatch.py: Added.
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/confirmdiff.py:
+
+2010-04-14  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Teach webkit-patch how to handle revisions missing ChangeLogs
+        https://bugs.webkit.org/show_bug.cgi?id=37519
+
+        Make commit_info_for_revision return None when revision
+        is missing a ChangeLog.  Previously we would throw an array index
+        exception.
+        Teach callers how to handle None.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-13  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Add Qt Bot to the list of "core builders" (builders which block the commit-queue when red)
+        https://bugs.webkit.org/show_bug.cgi?id=33297
+
+        This is an experiment.  The bots have been green for
+        a while.  We'll see if adding them under sheriff-bot protection
+        will keep them green.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-13  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, just fixing a constant in the Rietveld unit test.
+
+        * Scripts/webkitpy/common/net/rietveld_unittest.py
+
+2010-04-13  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, just adding missing Mock to fix python tests.
+
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-13  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add experimental prototype Rietveld integration to webkit-patch upload
+        https://bugs.webkit.org/show_bug.cgi?id=37418
+
+        This patch adds bare-bones integration with Rietveld for code reviews.
+        The behavior is hidden behind the --fancy-review command line flag.
+        Currently, there's no support for uploading more than one patch per
+        issue (which is a nice feature of Rietveld).  The plan is to play with
+        this for a bit and see if it's useful.
+
+        Modified from Adam's original patch to autoinstall the rietveld upload script.
+
+        * Scripts/webkitpy/common/config/__init__.py:
+        * Scripts/webkitpy/common/net/rietveld.py: Added.
+        * Scripts/webkitpy/common/net/rietveld_unitttest.py: Added.
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/__init__.py:
+        * Scripts/webkitpy/tool/steps/options.py:
+        * Scripts/webkitpy/tool/steps/postcodereview.py: Added.
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-04-13  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Mark Rowe.
+
+        Add Makefile to MiniBrowser.
+
+        * MiniBrowser/Makefile: Added.
+
+2010-04-13  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, just adding a sanity check.
+
+        Add check to make sure commit-queue can never commit too short a message
+        https://bugs.webkit.org/show_bug.cgi?id=37528
+
+        The commit-queue made bogus messages here:
+        http://trac.webkit.org/changeset/57532
+        http://trac.webkit.org/changeset/57534
+
+        This was a regression caused by adding unicode parsing for
+        our ChangeLog files.  Popen does not seem to play nice with
+        unicode strings.
+
+        I'm also adding an "assert" to make sure short ChangeLogs never happen again.
+
+        * Scripts/webkitpy/common/system/executive.py:
+         - Cast input to strings before passing to POpen
+        * Scripts/webkitpy/tool/steps/commit.py:
+         - Validate that commit messages are not to short.
+
+2010-04-13  Adam Roben  <aroben@apple.com>
+
+        Robustify new-run-webkit-tests against paths with spaces in them
+
+        Reviewed by Eric Seidel.
+
+        * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+        (LayoutTestApacheHttpd.__init__): Quote all paths that we pass to
+        Apache to ensure that paths with spaces in them are interpreted
+        correctly.
+
+2010-04-13  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed buildfix after r57537.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.h: Declaration of removeOriginAccessWhitelistEntry() added.
+
+2010-04-13  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Make building new webkit API and MiniBrowser a little easier.
+
+        * Scripts/build-webkit: Make building with --webkit2 build the 
+        MiniBrowser as well and tell you how to use it.
+        * Scripts/run-minibrowser: Copied from Scripts/run-safari.
+        * Scripts/webkitdirs.pm: Add runMiniBrowser function.
+
+2010-04-12  Timothy Hatcher  <timothy@apple.com>
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (removeOriginAccessWhitelistEntryCallback): Added. Call LayoutTestController::removeOriginAccessWhitelistEntry.
+        (LayoutTestController::staticFunctions): Added removeOriginAccessWhitelistEntry.
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::whiteListAccessFromOrigin): FIXME to implement.
+        (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+
+2010-04-13  Timothy Hatcher  <timothy@apple.com>
+
+        Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And LayoutTestController.whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+        And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+        SecurityOrigin needs a way to remove individual OriginAccessEntries
+        https://bugs.webkit.org/show_bug.cgi?id=37449
+
+        Reviewed by Dave Hyatt.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (addOriginAccessWhitelistEntryCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::addOriginAccessWhitelistEntry):
+
+2010-04-13  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Remove duplicate function for new-run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=37517
+
+        The version() function was already implemented.
+
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-13  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by David Levin.
+
+        the commit-queue hates Tor Arne Vestbø
+        https://bugs.webkit.org/show_bug.cgi?id=37511
+
+        We were failing to read reviewers out of ChangeLogs
+        when the reviewer has unicode characters in his/her name.
+        I fixed this by explicitly decoding from utf8 every time we
+        read in a ChangeLog file (they are always UTF8).
+
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+
+2010-04-13  Adam Roben  <aroben@apple.com>
+
+        Fix run-webkit-tests on Windows with spaces in the path
+
+        Fixes <http://webkit.org/b/37509>.
+
+        Reviewed by Steve Falkenburg.
+
+        * Scripts/run-webkit-tests:
+        (convertPathUsingCygpath): Remove spaces from the path before passing
+        them to cygpath, then add them back in after conversion, as some
+        versions of cygpath seem to convert spaces into newlines.
+
+2010-04-13  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed, but approved by Dumitru Daniliuc.  (This patch is intended
+        to fix the downstream Chromium build bots.  Hopefully it will work!)
+
+        Add a driver script for the new websocket server
+        https://bugs.webkit.org/show_bug.cgi?id=37495
+
+        websocket_server.py can't be run directly because its a module and not
+        a standalone script.  This used to work by accident because it didn't
+        depend on any other modules.
+
+        * Scripts/new-run-webkit-websocketserver: Added.
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-12  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Make new-run-webkit-test PrettyPatch failure reporting more awesome
+        https://bugs.webkit.org/show_bug.cgi?id=37487
+
+        I also fixed an Executive/executive typo.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-04-12  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests should only build java support files on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=37482
+
+        Only the mac needs java support files, so I pushed _build_java
+        down into the Mac port using a new hook "_check_port_build".
+        In the process I noticed a bunch of code which could be shared
+        between all ports and thus got rid of _tests_for_disabled_features
+        and version() copy/paste between all webkit ports.
+        I also made check_build only bother to check for ImageDiff if we're
+        using pixel tests.
+
+        * Scripts/webkitpy/layout_tests/port/gtk.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-12  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, trying to make scripts work on machines without
+        Ruby...
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-04-12  Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Add stub files for running new-run-webkit-tests for the Qt port
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/qt.py: Added.
+
+2010-04-12  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Modify run_webkit_tests.py to not call sys.exit() at the end of test
+        run; doing so makes it more difficult to embed the routine for,
+        among other things, unit tests. We push the exit calling up into
+        new-run-webkit-tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37464
+
+        * Scripts/new-run-webkit-tests:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-12  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed.
+
+        Add stub Gtk implementation for new-run-webkit-tests.
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/gtk.py: Added.
+
+2010-04-12  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests fails with exception on systems missing ruby
+        https://bugs.webkit.org/show_bug.cgi?id=37441
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+         - Catch failures similar to how wdiff code path does.
+         - After one failure, stop trying.
+
+2010-04-12  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix how we import simplejson based on how it's used in this file.
+        This fixes exceptions raised when trying to write the simplejson output.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactored check-webkit-style so that the StyleChecker class
+        has no dependencies on patch-related concepts.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37065
+
+        This patch is an intermediate step towards making the StyleChecker
+        class a generalized file processor that can do arbitary operations
+        on the files corresponding to a list of paths.  This patch
+        also simplifies the unit-testing of patch-checking code.
+
+        * Scripts/check-webkit-style:
+          - Updated to use the new PatchChecker class.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Refactored the StyleChecker.check_patch() method into the
+            check() method of a new PatchChecker class.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Refactored the unit tests as necessary, changing the
+            StyleCheckerCheckPatchTest class to a PatchCheckerTest class.
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Fix new-run-webkit-tests regressions cased by Eric's option parsing patch
+        https://bugs.webkit.org/show_bug.cgi?id=37430
+
+        We need some basic unit testing of this script, or we're going to keep
+        breaking it like this.  Added missing namespace qualifiers and
+        propagated renaming of an option.
+
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/layout_tests/driver_test.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Break new-run-webkit-tests options into groups for easier re-use and possible relocation
+        https://bugs.webkit.org/show_bug.cgi?id=37408
+
+        new-run-webkit-tests currently has one huge function for
+        dealing with all options-parsing. 
+        This patch is a first attempt at trying to split that large
+        function down into smaller (hopefully more readable?) chunks
+        dealing with the different areas of options.
+        For example, it would make sense to move configuration
+        options off into some module which deals with the vagries of
+        WebKit's configuration system.  It would also make sense to move
+        Chromium options off onto the Chromium port object (where they are used).
+        It may make sense to move results.json options over to the results.json code.
+        This change is a first iteration, and we will certainly need more
+        refinement to this code over time.  Hopefully I didn't make things
+        harder to read here.
+
+        * Scripts/webkitpy/layout_tests/driver_test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        create-rollout copy needs to be updated to reflect removal of --no-build
+        https://bugs.webkit.org/show_bug.cgi?id=37425
+
+        Removed --no-build and --no-test from the instructions because these
+        don't exist anymore.
+
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+            - Updated the expected results to reflect the new copy.
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+
+2010-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r57460.
+        http://trac.webkit.org/changeset/57460
+        https://bugs.webkit.org/show_bug.cgi?id=37424
+
+        broke chromium builders (Requested by tony^work on #webkit).
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-11  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] update chromium DEPS for upstream compile
+        https://bugs.webkit.org/show_bug.cgi?id=36578
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Small fix to avoid a circular dependency between
+          WebKit.gyp and webkit.gyp.
+
+2010-04-11  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        svn-apply errors out when removing directories in git
+        https://bugs.webkit.org/show_bug.cgi?id=34871
+
+        * Scripts/svn-apply:
+        (isDirectoryEmptyForRemoval): early break if the directory doesn't exist
+        (scmRemove): have git ignore unmatched files
+
+2010-04-11  Daniel Bates  <dbates@rim.com>
+
+        No review, rolling out 57440.
+        http://trac.webkit.org/changeset/57440
+        https://bugs.webkit.org/show_bug.cgi?id=27204
+
+        Did not handle Git patches that included both file and property
+        changes to the same file. Rolling this change out while I look
+        into this.
+
+        * Scripts/VCSUtils.pm:
+        * Scripts/svn-apply:
+        * Scripts/svn-unapply:
+        * Scripts/webkitperl/VCSUtils_unittest/appendSVNExecutableBitChangeToPatch.pl: Removed.
+        * Scripts/webkitperl/VCSUtils_unittest/parseGitFileMode.pl: Removed.
+        * Scripts/webkitperl/VCSUtils_unittest/parseStartOfPatchOrPropertyChangeAndEndOfPropertyChange.pl: Removed.
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix typo in log path for AbstractQueue
+        https://bugs.webkit.org/show_bug.cgi?id=37414
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-04-11  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Add missing import statement.
+
+        * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-11  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add setWillSendRequestReturnsNull and setWillSendRequestClearHeader
+
+        https://bugs.webkit.org/show_bug.cgi?id=37410
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::reset):
+        (LayoutTestController::setWillSendRequestReturnsNull):
+        (LayoutTestController::setWillSendRequestClearHeader):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-11  Csaba Osztrogonác  <ossy@webkit.org>
+
+        [Qt] Unreviewed buildfix for --debug build after r57433.
+
+        Refactor Qt DRT support in QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * QtLauncher/main.cpp: qt_drt_garbageCollector_collect(); renamed to DumpRenderTreeSupportQt::garbageCollectorCollect();
+        (launcherMain):
+
+2010-04-11  Joseph Pecoraro  <joepeck@webkit.org>
+
+        Reviewed by Mark Rowe.
+
+        Make commit-log-editor Rubber-stamp aware. And other minor cleanups.
+        https://bugs.webkit.org/show_bug.cgi?id=37407
+
+        * Scripts/commit-log-editor:
+
+2010-04-11  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add PrettyPatch links to new-run-webkit-tests output
+        https://bugs.webkit.org/show_bug.cgi?id=37406
+
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+         - We're leaking a file handle here, add a FIXME.
+        * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+         - Add pretty diff links.
+        * Scripts/webkitpy/layout_tests/port/base.py:
+         - Add support for generating pretty diffs using PrettyPatch.
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+         - We're leaking another file handle here, another FIXME.
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+         - Update write_output_files signature.
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+         - Remove unused arguments from write_output_files.
+         - Add support for dumping pretty diffs to write_output_files.
+         - Fix a bunch of file descriptor leaks in this file.
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+         - Update write_output_files signature.
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        kill_process is copy/pasted in five places
+        https://bugs.webkit.org/show_bug.cgi?id=37405
+
+        We shouldn't replicate the kill_process logic in every port.  Instead,
+        we should move the process interaction to Executive.
+
+        Dirk mentioned that he wanted this abstraction to make it easier to
+        mock things out for testing.  It turns out this function is only used
+        in one place where it can't be used as a mock point for testing because
+        the corresponding create process actually creates a real process.  In
+        the long term, we should indirect both these calls through a non-static
+        Executive as a mock point.  However, we should wait on that until we
+        actually want to write the test.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests shouldn't alter its path to import packages
+        https://bugs.webkit.org/show_bug.cgi?id=37404
+
+        * Scripts/new-run-webkit-tests:
+        * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+        * Scripts/webkitpy/thirdparty/simplejson/decoder.py:
+
+2010-04-10  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests should store results to a directory under the build tree
+        https://bugs.webkit.org/show_bug.cgi?id=37380
+
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27204
+
+        Implement support for changing the executable bit of a file.
+        The executable bit is among the most changed file properties.
+        Future support can include other property changes.
+
+        Currently, if a patch changes the executable bit of a file
+        it is not respected by svn-apply or svn-unapply. Since the
+        commit-queue bot uses these tools as part of its workflow,
+        such patches cannot be committed by it. That is, such patches
+        need to be committed by hand. Instead, we should add support
+        for the executable bit so that such patches can be committed
+        by the commit-queue bot.
+
+        * Scripts/VCSUtils.pm: Also change reference to Apple Computer, Inc.
+        in copyright to Apple, Inc.
+        * Scripts/svn-apply:
+        * Scripts/svn-unapply:
+        * Scripts/webkitperl/VCSUtils_unittest/appendSVNExecutableBitChangeToPatch.pl: Added.
+        * Scripts/webkitperl/VCSUtils_unittest/parseGitFileMode.pl: Added.
+        * Scripts/webkitperl/VCSUtils_unittest/parseStartOfPatchOrPropertyChangeAndEndOfPropertyChange.pl: Added.
+
+2010-04-10  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        WinEWS bot fails to svn update because scm.clean_working_directory leaves files around
+        https://bugs.webkit.org/show_bug.cgi?id=37401
+
+        The Git-based bots don't have this trouble because
+        Git.clean_working_directory fully removes files that were
+        marked as "add".  SVN.clean_working_directory previously just
+        called "svn revert" which would leave added files in the
+        working directory untracked.  This patch makes
+        SVN.clean_working_directory function more like
+        Git.clean_working_directory by removing added files after revert.
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+         - Add SCM.absolute_path for easy conversion between
+           repository-relative paths and absolute paths.
+         - Add SCM.add and SCM.added_files
+         - Make SVN.clean_working_directory remove any added_files after svn revert.
+         - The new unit tests found a bug in Git.status_command, change to use git diff --name-status instead.
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+         - Add tests for added code.
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests can't find ImageDiff on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=37403
+
+        It turns out the build directory on Windows is structured differently
+        than it is on other platforms.  Instead of assuming the normal
+        structure, we should just ask perl to figure it out for us.
+
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        Change "Gathering files" status line to "Collecting tests".  Gathering
+        the files sounds silly to me.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix bugs to make new-run-webkit-tests almost run on windows
+        https://bugs.webkit.org/show_bug.cgi?id=37400
+
+        Fix some minor bugs that prevent new-run-webkit-tests from being run on
+        Windows.  I still haven't run it to completion, but I'm getting
+        further.
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Refactor Qt DRT support in QtWebKit
+
+        Update Qt DRT to use new DumpRenderTreeSupportQt static class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35844
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+        (WebCore::DumpRenderTree::dumpFramesAsText):
+        * DumpRenderTree/qt/DumpRenderTreeQt.h:
+        * DumpRenderTree/qt/GCControllerQt.cpp:
+        (GCController::collect):
+        (GCController::collectOnAlternateThread):
+        (GCController::getJSObjectCount):
+        * DumpRenderTree/qt/GCControllerQt.h:
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::counterValueForElementById):
+        (LayoutTestController::setViewModeMediaFeature):
+        (LayoutTestController::setMediaType):
+        (LayoutTestController::closeWebInspector):
+        (LayoutTestController::showWebInspector):
+        (LayoutTestController::evaluateInWebInspector):
+        (LayoutTestController::setFrameFlatteningEnabled):
+        (LayoutTestController::setJavaScriptProfilingEnabled):
+        (LayoutTestController::setTimelineProfilingEnabled):
+        (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+        (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+        (LayoutTestController::sampleSVGAnimationForElementAtTime):
+        (LayoutTestController::numberOfActiveAnimations):
+        (LayoutTestController::whiteListAccessFromOrigin):
+        (LayoutTestController::setCaretBrowsingEnabled):
+        (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+        (LayoutTestController::workerThreadCount):
+        (LayoutTestController::pageNumberForElementById):
+        (LayoutTestController::numberOfPages):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move global queue log to the logs directory so it survives git clean -f
+        https://bugs.webkit.org/show_bug.cgi?id=37395
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        SheriffBot should spam when it encounters errors
+        https://bugs.webkit.org/show_bug.cgi?id=37329
+
+        We need to always update the status server so we don't get stuck in a
+        spam loop.  I tried writing a test for this change, but it kind of
+        got out of control.  We need a better way to do failure injection.
+
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed attempt to fix the Chromium Mac canary.
+
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/common/config/ports_unittest.py:
+        * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Add the Apache bits to win.py for new-run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=37397
+
+        I still have run this yet, but I looked around to figure out what the
+        various paths appear to be.  I'll figure out a way to remove the
+        copy/paste code in a future patch.
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Sketch out the win port for new-run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=37393
+
+        I haven't tried running this yet, but we've got to start somewhere.
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        * Scripts/webkitpy/layout_tests/port/win.py: Added.
+
+2010-04-10  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch land should not build and test by default
+        https://bugs.webkit.org/show_bug.cgi?id=33631
+
+        Reverse the sense of --no-build and --no-test to be --build and --test.
+        Also, decoupled the build and test options so you can test without
+        building.
+
+        (Patch manngled by Adam Barth.  All bugs are his fault.)
+
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/steps/options.py:
+        * Scripts/webkitpy/tool/steps/runtests.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Factor WebKitPort out of MacPort to allow for WinPort
+        https://bugs.webkit.org/show_bug.cgi?id=37388
+
+        The split is a bit of a guess.  We might have to adjust things once we
+        actually have a second port to work with.
+
+        * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py: Added.
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-10  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        run_webkit_tests.py shouldn't have platform-specific logic
+        https://bugs.webkit.org/show_bug.cgi?id=37387
+
+        Dirk Pranke pointed out that my last patch was wrong because I
+        introduced platform-specific logic into run_webkit_tests.py, limiting
+        the parallelism in Chromium to work around a bug in the main Mac port.
+
+        * Scripts/webkitpy/common/system/executive.py:
+            - Fix a typo pointed out by Chris Jerdonek.
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-10  Robert Hogan  <robert@webkit.org>
+
+        Unreviewed fix to regressions in r57416.
+
+        [Qt] Fix regressions in http/tests/navigation from r57416
+
+        Reset willSendRequestReturnsNullOnRedirect after each test to
+        prevent it leaking to subsequent tests.
+
+        Error pointed out by Jakub Wieczorek.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37237
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::reset):
+
+2010-04-11  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Update layoutTestController.DumpResourceLoadCallbacks to match other ports.
+
+        Add support for layoutTestController.setWillSendRequestReturnsNullOnRedirect to Qt DRT.
+        Prevent dumping resource load callbacks once layout test has dumped.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37237
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::dump):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setWillSendRequestReturnsNullOnRedirect):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement Desktop Notifications API for QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35503
+
+        DRT stubs for notification. Enables to run and pass
+        3 (currently disabled) tests.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::grantDesktopNotificationPermission):
+        (LayoutTestController::checkDesktopNotificationPermission):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-09  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, another change to executive.py to make it run with
+        python 2.4.
+
+        * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-09  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, attempting to make executive.py run with python 2.4
+        (which is still used on Chromium's Windows canary bot).
+
+        * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-09  Kevin Watters  <kevinwatters@gmail.com>
+
+        Reviewed by Eric Seidel.
+
+        [wx] Basic implementation of SVG support for wx port.
+
+        * wx/build/settings.py:
+
+2010-04-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Don't reinvent Executive.cpu_count for every port
+        https://bugs.webkit.org/show_bug.cgi?id=37377
+
+        mac.py and chromium_mac.py had some copy/paste code.  This code doesn't
+        actually have anything to do with WebKit ports.  It's really just
+        something in the multiprocessing package.  The lame bit is that package
+        isn't available in older versions of Python, so we need to implement a
+        fallback.  However, we already have the fallback in common.  We don't
+        need to reinvent it specificly for layout_tests.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests --release fails to build release DRT when global configuration is Debug
+        https://bugs.webkit.org/show_bug.cgi?id=37376
+
+        We need to explicitly pass the --release flag.  I bet there are more
+        instances of this bug.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-04-09  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] DRT compile fix on win/linux
+        https://bugs.webkit.org/show_bug.cgi?id=37314
+
+        Looks like this was missed when upstreaming.
+
+        * DumpRenderTree/chromium/EventSender.cpp:
+        (applyKeyModifier):
+
+2010-04-09  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed, but approved by Dirk Pranke.
+
+        rename test_expectations_test.py to test_expectations_unittest.py so it actually gets run
+        https://bugs.webkit.org/show_bug.cgi?id=37372
+
+        We need to end unit tests with _unittest.py for them to be autodetected
+        by the test harness.  +6 tests.
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py.
+
+2010-04-09  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests should talk about DumpRenderTree not test_shell
+        https://bugs.webkit.org/show_bug.cgi?id=37371
+
+        test_shell is some strange Chromium thing.
+        DumpRenderTree (tm) is the real deal.
+
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py: Added.
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py: Removed.
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/server_process.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-09  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix 2 issues (what were introduced in r56524) in svn-create-patch's generateDiff()
+        https://bugs.webkit.org/show_bug.cgi?id=32582
+
+        Add missing return variable. Initialize $patch variable and remove unnecessary condition.
+
+        * Scripts/svn-create-patch:
+
+2010-04-09  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after addition of LayoutTestController method.
+
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+
+2010-04-09  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=37368
+        Add MiniBrowser.
+
+        * MiniBrowser: Added.
+        * MiniBrowser/MiniBrowser.vcproj: Added.
+        * MiniBrowser/MiniBrowser.xcodeproj: Added.
+        * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Added.
+        * MiniBrowser/mac: Added.
+        * MiniBrowser/mac/AppDelegate.h: Added.
+        * MiniBrowser/mac/AppDelegate.m: Added.
+        * MiniBrowser/mac/BrowserWindowController.h: Added.
+        * MiniBrowser/mac/BrowserWindowController.m: Added.
+        * MiniBrowser/mac/English.lproj: Added.
+        * MiniBrowser/mac/English.lproj/BrowserWindow.xib: Added.
+        * MiniBrowser/mac/English.lproj/InfoPlist.strings: Added.
+        * MiniBrowser/mac/English.lproj/MainMenu.xib: Added.
+        * MiniBrowser/mac/MiniBrowser-Info.plist: Added.
+        * MiniBrowser/mac/MiniBrowser_Prefix.pch: Added.
+        * MiniBrowser/mac/main.m: Added.
+        * MiniBrowser/win: Added.
+        * MiniBrowser/win/BrowserView.cpp: Added.
+        * MiniBrowser/win/BrowserView.h: Added.
+        * MiniBrowser/win/BrowserWindow.cpp: Added.
+        * MiniBrowser/win/BrowserWindow.h: Added.
+        * MiniBrowser/win/MiniBrowser.cpp: Added.
+        * MiniBrowser/win/MiniBrowser.h: Added.
+        * MiniBrowser/win/MiniBrowser.rc: Added.
+        * MiniBrowser/win/Resources: Added.
+        * MiniBrowser/win/main.cpp: Added.
+        * MiniBrowser/win/resource.h: Added.
+        * MiniBrowser/win/stdafx.cpp: Added.
+        * MiniBrowser/win/stdafx.h: Added.
+
+2010-04-09  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch attached my patch to the wrong bug
+        https://bugs.webkit.org/show_bug.cgi?id=37015
+
+        The problem here is that SVN was violating SCM's implicit
+        contract of always returning paths relative to the repository root.
+        That can easily be fixed by telling SVN that the CWD is the repository root.
+
+        When fixing this I realized there are a large number of places in SCM.py where
+        we want to consider explicitly passing self.checkout_root as the CWD.
+        That would allow scm methods to be executed even when the CWD is not inside
+        the scm tree at all, and would also make sure (in the case of SVN) that paths
+        returned are relative to the root.  Git (almost always) returns paths relative
+        to the repository root.
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+         - Explicitly pass self.checkout_root as cwd in run_status_and_extract_filenames
+         - Add a ton of FIXMEs about the need to go back and decide which methods require cwd=self.checkout_root
+           and which do not.  We'll probably add a helper function to scm (likely SCM._run) which
+           always passes cwd=self.checkout_root to Executive.run_command
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+         - Add a test for this change.
+        * Scripts/webkitpy/tool/commands/upload.py:
+         - Removed the explicit os.chdir to the repository root, since scm.py methods
+           should be robust against the cwd not being equal to the root.
+
+2010-04-09  Adam Roben  <aroben@apple.com>
+
+        Don't return 0 as a JSValueRef
+
+        That is an illegal use of the JSC API.
+
+        Fixes <http://webkit.org/b/37333> REGRESSION (r57292): :visited tests
+        are asserting on debug Windows and GTK builds
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+        Return an "undefined" JSValueRef instead of 0.
+
+2010-04-09  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Make DumpRenderTree parallelizable
+        https://bugs.webkit.org/show_bug.cgi?id=36899
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (libraryPathForDumpRenderTree): Use DUMPRENDERTREE_TEMP if exist.
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree): Use DUMPRENDERTREE_TEMP if exist.
+        * Scripts/run-webkit-tests:
+          - Create a unique temporary directory and pass its path to
+          DumpRenderTree with DUMPRENDERTREE_TEMP environment variable.
+
+2010-04-09  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        <http://webkit.org/b/37326> IDL files are being copied in to the WebCore framework again
+
+        Add a script to detect the presence of inappropriate files in the frameworks.  At present
+        it only looks for .css, .idl and .in files in the top level of WebCore.framework/Resources,
+        as these are the only cases we've encountered recently.  It can be extended to check the
+        other frameworks or for other inappropriate files in the future.
+
+        * Scripts/check-for-inappropriate-files-in-framework: Added.
+
+2010-04-08  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add option to build WebKit2 to build-webkit.
+
+        * Scripts/build-webkit:
+
+2010-04-08  Darin Adler  <darin@apple.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        run-webkit-tests should respect argument order
+        https://bugs.webkit.org/show_bug.cgi?id=37257
+
+        * Scripts/run-webkit-tests: Changed so that sorting is done only
+        on the results of iterating directories. Test order is based on
+        what's passed on the command line. Removed code that aimed to
+        eliminate duplicates since it can be useful to run the same test
+        more than once.
+
+2010-04-07  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24300, don't expose history info via CSS.  Add a new method for
+        obtaining computed style with :visited info included.  This allows layout tests to actually tell that
+        :visited is in effect.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (computedStyleIncludingVisitedInfoCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+
+2010-04-07  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Enable rebaseline-chromium-webkit-tests to run from a webkit-only
+        checkout (i.e., you don't need anything from the Chromium tree checked
+        out). This requires us to introduce the concept of a "target"
+        port/platform that we use to get configuration information from as well
+        as the "running" port that we use to make directories and diff images
+        and the "rebaselining" port we use to actually manage baselines.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37238
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-05  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+        https://bugs.webkit.org/show_bug.cgi?id=29431
+
+        Added stubs for Mac, win, gtk and wx DRTs to implement setScrollbarPolicy method.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setScrollbarPolicyCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setScrollbarPolicy):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setScrollbarPolicy):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setScrollbarPolicy):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setScrollbarPolicy):
+
+2010-04-01  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by David Hyatt.
+
+        [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+        https://bugs.webkit.org/show_bug.cgi?id=29431
+
+        Make possible to DRT to set scrollbar policies (on, off or auto).
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setScrollbarPolicy):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * QtLauncher/main.cpp:
+        (LauncherWindow::toggleScrollbars):
+        (LauncherWindow::createChrome):
+
+2010-04-08  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests should give a percent complete indication
+        https://bugs.webkit.org/show_bug.cgi?id=37258
+
+        Because it's awesome.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Add back the --target option because it's needed by the downstream
+        Chromium bots.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        new-run-webkit-tests should understand set-webkit-configuration
+        https://bugs.webkit.org/show_bug.cgi?id=37252
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Rename target to configuration in new-run-webkit-tests to match the rest of WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=37251
+
+        The rest of our tools call --debug or --release the configuration.
+        It's confusing to call it target in this script.
+
+        * Scripts/webkitpy/layout_tests/driver_test.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-04-07  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove depricated op.popen2 call in new-run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=37249
+
+        Python complains that this API is depricated.  We already solved this
+        problem in executive.py.
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-04-07  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests crashes when run on a 64-bit machine
+        https://bugs.webkit.org/show_bug.cgi?id=37248
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+         - The code was trying to always run the 32-bit intel version
+           of the DumpRenderTree binary.  DRT does not build 32-bit on 64-bit
+           machines so that makes no sense.  This may have made sense for test_shell
+           at some point, but I think we should just remove this for DRT.
+
+2010-04-07  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        WebKit Apache configs only listen on IPv4 addresses, causing random timeouts
+        https://bugs.webkit.org/show_bug.cgi?id=37104
+
+        Add warnings that the partial support for specifying what port numbers
+        apache should bind to is even more broken after this fix.
+
+        * Scripts/run-webkit-httpd:
+        * Scripts/run-webkit-tests:
+
+2010-04-07  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        LayoutTestController::m_handlesAuthenticationChallenges isn't initialized
+        https://bugs.webkit.org/show_bug.cgi?id=37190
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+
+2010-03-31  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add webkit-patch command to crawl buildbot history and find when tests
+        started to fail.
+        https://bugs.webkit.org/show_bug.cgi?id=36911
+
+        This is a very bare-bones implementation, which works, but isn't pretty.
+        We will need further re-factoring and improvement to this code, but
+        after long discussions with Adam, I think it's best that we land this
+        and iterate from there.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+         - Add revision_build_pairs_with_results for cleaner code and possible
+           optimization of this command.
+         - Return None if a build number can't be found for a revision in
+           build_for_revision
+         - Separate out suspect_revisions_for_transition for re-use by
+           FailureReason
+         - Add LayoutTestResults.failing_tests() and make our parsing code
+           explict about what tables it accepts.
+        * Scripts/webkitpy/tool/commands/queries.py:
+         - Move _print_blame_information_for_commit out of WhatBroke for re-use
+           by FailureReason.
+         - Add FailureReason command which can crawl a given builder and explain
+           why it is currently red on a per-test basis.
+
+2010-04-06  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add DumpRenderTree.gyp, and some small fixes
+        https://bugs.webkit.org/show_bug.cgi?id=37137
+
+        - Add DumpRenderTree.gyp
+        - Remove some dependencies to base/string_util.h,
+          base/compiler_specific.h, base/file_path.h, base/file_util.h,
+          base/message_loop.h, base/sys_string_conversions.h,
+
+        * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Added.
+        * DumpRenderTree/chromium/CppVariant.cpp:
+        (CppVariant::toStringVector):
+        * DumpRenderTree/chromium/EventSender.cpp:
+        (EventSender::EventSender):
+        (EventSender::keyDown):
+        (EventSender::scheduleAsynchronousClick):
+        (EventSender::beginDragWithFiles):
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::setUserStyleSheetLocation):
+        (LayoutTestController::pathToLocalResource):
+        * DumpRenderTree/chromium/TextInputController.cpp:
+        (TextInputController::markedRange):
+        (TextInputController::selectedRange):
+
+2010-04-06  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Write stack traces into the results directory for new-run-webkit-tests,
+        instead of writing them alongside the test file.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36504
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+
+2010-04-06  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed build fix.
+
+        Enable pixel tests by default in new-run-webkit-tests unless
+        explicitly set by the port or by the command line. This was broken in
+        the fix for bug 36801 (rev. 57173).
+
+        https://bugs.webkit.org/show_bug.cgi?id=37184
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-06  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Disable pixel tests on the mac port by default.
+
+        Also, revamp the way we check for pixel tests being enabled or
+        disabled. We now look for options.pixel_tests instead of
+        options.no_pixel_tests, and we have the "--pixel-tests" (force enable)
+        and "--no-pixel-tests" (force disable) flags.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36801
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-06  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] Added the iPhone and iPad latest user agent in QtLauncher UA switcher
+        https://bugs.webkit.org/show_bug.cgi?id=37159
+
+        * QtLauncher/useragentlist.txt:
+
+2010-04-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Add current user-agent string for Symbian for QtLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=37131
+
+        * QtLauncher/useragentlist.txt:
+
+2010-04-06  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Explain how to handle rollout patches
+        https://bugs.webkit.org/show_bug.cgi?id=37139
+
+        We need to set expectations for how long landing rollout patches with
+        the commit-queue takes.  The commit-queue is optimized for safety, not
+        performance.  Also, give folks an alternative way to land patches
+        quickly.
+
+        In addition, improve our testing of add_patch_to_bug by having
+        MockBugzilla log.  This caused me to tighten a bunch of tests and
+        notice that one of our tests wasn't being run.
+
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+
+2010-04-06  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Turns out commit_info.committer() can be None
+        https://bugs.webkit.org/show_bug.cgi?id=37106
+
+        When the committer isn't in committers.py, the committer() property on
+        commit_info can be None.  We need to handle that case gracefully.
+
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+        * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] [Symbian] Build fix for Dumprendertree if Qt printing is not supported
+        https://bugs.webkit.org/show_bug.cgi?id=37082
+
+        Use the QT_NO_PRINTER guard to flag QPrinter dependent code.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::dryRunPrint):
+
+2010-04-05  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        SheriffBot should force_build builders that are idle and have failed exactly once
+        https://bugs.webkit.org/show_bug.cgi?id=37059
+
+        We can get into a deadlocked state where the commit-queue is stopped
+        because the builders are red but the SheriffBot hasn't taken action
+        because the builder has failed only once.  The SheriffBot should force
+        build idle builders that have failed exactly once to either turn the
+        tree green again (if the test was flaky) or trigger the "failed twice"
+        remedies (IRC and bug posts).
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+        * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-05  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Fixed check-webkit-style issue where the script was prematurely
+        exiting when encountering deleted files in patches.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37122
+
+        * Scripts/webkitpy/style/checker.py:
+          - Changed non-existent file message from ERROR to WARN.
+          - StyleChecker.check_file() no longer raises an exception when
+            a file is not found.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated unit tests as necessary.
+
+2010-04-05  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        SheriffBot should include blamelist when posting to bugs
+        https://bugs.webkit.org/show_bug.cgi?id=37113
+
+        When posting on bugs, we should include the full list of SVN revisions
+        that caused the regression to folks have a better sense of whether they
+        are to blame.
+
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+        * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-05  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed after discussion with Adam, Darin, and Eric.
+
+        Deleted the auto-install directory since it is no longer needed in
+        source control (it is auto-generated).
+
+        Also added webkitpy/thirdparty/autoinstalled to webkitpy/thirdparty's
+        svn:ignore property.
+
+        * Scripts/webkitpy/thirdparty/autoinstalled: Removed.
+
+2010-04-05  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Test case for <http://webkit.org/b/37115> / <rdar://problem/7829331>.
+        REGRESSION(r56989): Crash in Mail in WebCore::Position::isCandidate when deleting block using block deletion UI
+
+        Add a JavaScript hook in DRT to call through to WebView's -setEditable:.  This is required in order to reproduce
+        the crash.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setWebViewEditableCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setWebViewEditable):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setWebViewEditable):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setWebViewEditable):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setWebViewEditable):
+        (LayoutTestController::layerTreeAsText):
+
+2010-04-05  Darin Adler  <darin@apple.com>
+
+        Ignore more files the Python tools strew about the working directory.
+
+        * Scripts/webkitpy: Added property svn:ignore.
+        * Scripts/webkitpy/common: Added property svn:ignore.
+        * Scripts/webkitpy/common/checkout: Added property svn:ignore.
+        * Scripts/webkitpy/common/config: Added property svn:ignore.
+        * Scripts/webkitpy/common/net: Added property svn:ignore.
+        * Scripts/webkitpy/common/thread: Added property svn:ignore.
+        * Scripts/webkitpy/python24: Added property svn:ignore.
+        * Scripts/webkitpy/thirdparty/autoinstalled: Modified property svn:ignore.
+        * Scripts/webkitpy/tool/bot: Added property svn:ignore.
+
+2010-04-05  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Add Vitaly Repeshko as a committer.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-05  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Update kenne's IRC nick to his registered nick.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-05  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        assorted helper functions and cleanup of git utilities
+        https://bugs.webkit.org/show_bug.cgi?id=37103
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+        No code currently uses the optional dry_run argument. So removing it.
+        Change all uses of "trunk" to read the correct value out of the git config.
+        Made the dcommit call actually get called when dry_run==true.
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+        * Scripts/webkitpy/common/net/credentials.py:
+        Move the git config call into scm.
+        * Scripts/webkitpy/common/net/credentials_unittest.py:
+        * Scripts/webkitpy/common/system/executive.py:
+        If return_exit_code==true, don't error out, just return the exit_code.
+
+2010-04-05  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        prepare-ChangeLog should take a merge-base for which git branch to diff against.
+        https://bugs.webkit.org/show_bug.cgi?id=36394
+
+        * Scripts/prepare-ChangeLog:
+
+2010-04-05  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Removed the PatchStyleErrorHandler class and incorporated its
+        functionality into the DefaultStyleErrorHandler class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37067
+
+        * Scripts/webkitpy/style/checker.py:
+          - In the StyleChecker class:
+            - Added a line_number parameter to the check_file() method.
+            - Renamed the handle_style_error parameter to
+              mock_handle_style_error to be consistent with the other mock_*
+              parameter names.
+            - Added a mock_check_file parameter to the check_patch() method
+              to facilitate unit testing the changes in this patch.
+            - Rewrote the check_patch() method with the patch-parsing logic
+              taken from the PatchStyleErrorHandler class.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Added a StyleCheckerCheckFileBase class and sub-classed the
+            existing StyleCheckerCheckFileTest class from it.
+          - Added a StyleCheckerCheckPatchTest class to unit-test the
+            rewritten check_patch() method.
+          - Removed the vestigial __main__ code at the bottom of the file.
+            This is left over from when check-webkit-style was implemented
+            as a module and a wrapper module.
+
+        * Scripts/webkitpy/style/error_handlers.py:
+          - Added an optional line_numbers parameter to the
+            DefaultStyleErrorHandler class constructor and adjusted the
+            __call__() method as necessary.
+          - Removed the PatchStyleErrorHandler class.
+
+        * Scripts/webkitpy/style/error_handlers_unittest.py:
+          - Removed the PatchStyleErrorHandlerTest class which unit-tested
+            the PatchStyleErrorHandler class which is being removed in this
+            patch.
+          - Added a test_line_numbers() test method to the
+            DefaultStyleErrorHandlerTest class to test use of the
+            DefaultStyleErrorHandler's new line_numbers attribute.
+
+2010-04-05  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Tighten SheriffBot's flaky test detector
+        https://bugs.webkit.org/show_bug.cgi?id=37063
+
+        Instead of just looking for two sequential red builds, look for two
+        sequential failures of the same test.  This should reduce sheriffbot
+        false positive substantially.
+
+        I'm landing this change unreviewed because I've noticed SheriffBot
+        triggering a lot more false positives now that we've expanded the set
+        of core builders.  I've tried to take Eric's comments on Bug 37063 into
+        account.  I'm happy to iterate on this patch tomorrow once Eric wakes
+        up.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-04  John Gregg  <johnnyg@google.com>
+
+        Unreviewed, add myself to the committers list.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04  Robert Hogan  <robert@webkit.org>
+
+        Unreviewed, add myself to the committers list.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, adding my IRC nickname to committers.py
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactored check-webkit-style's option-parsing code.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37064
+
+        * Scripts/check-webkit-style:
+          - Moved the "WebKit checkout not found" check from
+            ArgumentParser.parse() to the calling code.
+          - Moved the --git-commit argument validation from the calling
+            code to ArgumentParser.parse().
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated a unit test as necessary.
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Renamed ArgumentParser._exit_with_help() to _parse_error()
+            and made its error_message parameter required.
+          - Removed the found_checkout parameter from ArgumentParser.parse().
+          - Removed the "WebKit checkout not found" check and moved it
+            to the calling code.
+          - Added --git-commit argument checking.
+
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Adjusted the import statements to be fully qualified.
+          - Changed the ArgumentParserTest class to inherit from
+            LoggingTestCase, and updated the class as necessary.
+          - Added a unit-test for the --git-commit validation.
+          - Added unit tests for the --git-diff and --git-since variants
+            of --git-commit.
+
+2010-04-03  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        The check-webkit-style script now logs an ERROR and exits when
+        encountering a file path that does not exist.  Previously, it failed
+        silently on such paths.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36957
+
+        * Scripts/webkitpy/common/system/logtesting.py:
+          - Added a FIXME to rename the LoggingTestCase class to
+            LoggingTestCaseBase.
+
+        * Scripts/webkitpy/style/checker.py:
+          - In the StyleChecker.check_file() method:
+            - Added a mock_os_path_exists parameter.
+            - Renamed the process_file parameter to mock_process_file.
+            - Added logic to log an error and exist if the given path does
+              not exist.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Refactored the StyleCheckerCheckFileTest class slightly to
+            inherit from LoggingTestCase.
+          - Added a test method to unit-test the case of a file that
+            does not exist.
+          - Adjusted the other test methods as necessary.
+
+2010-04-03  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add Tiger Bot to the list of "core builders" (builders which block the commit-queue when red)
+        https://bugs.webkit.org/show_bug.cgi?id=33289
+
+        Add Tiger and SnowLeopard Tests to the core builders.  This is a bit of
+        an experiment now that the bots are green.  Hopefully we can keep them
+        on the list and have the tree stay greener.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Have Eric and Adam watch the SheriffBot
+        https://bugs.webkit.org/show_bug.cgi?id=37054
+
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+        * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        commit-queue should ignore builders when landing rollouts
+        https://bugs.webkit.org/show_bug.cgi?id=37051
+
+        When we moved the "builders are red" check into the master process, we
+        forgot about rollouts.  I thought we had a test covering this case, but
+        looking at the test, it was a bit too loose.  I added a new test and
+        introduced some new logging technology into MockTool to make the test
+        tighter.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-02  David Levin  <levin@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        sherrifbot should ensure that the rollout reason doesn't start with - (and fix webkit-patch upload).
+        https://bugs.webkit.org/show_bug.cgi?id=37030
+
+        * Scripts/webkitpy/tool/bot/sheriff.py: Ensure that the rollout reason doesn't
+          start with -.
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: A test with a rollout
+          reason which starts with -.
+        * Scripts/webkitpy/tool/steps/createbug.py: Fix webkit-patch upload.
+
+2010-04-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Fixed check-webkit-style to recognize the short form of the
+        --verbose option, as stated in --help.
+
+        * Scripts/check-webkit-style:
+          - Tweaked one line.
+
+2010-04-02  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix for DumpRenderTree after addition of layerTreeAsText.
+
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::layerTreeAsText):
+
+2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Eric Seidel.
+
+        Accept XHTML-MP content type as XHTML content
+        https://bugs.webkit.org/show_bug.cgi?id=34262
+
+        Register xhtmlmp file extension as the new type
+        for XHTML-MP test content.
+
+        * Scripts/run-webkit-tests:
+        * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+        * Scripts/webkitpy/layout_tests/port/lighttpd.conf:
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        create-rollout doesn't fill out ChangeLog
+        https://bugs.webkit.org/show_bug.cgi?id=37010
+
+        The contract between apply_reverse_diff and PrepareChangeLogForRevert
+        was unclear.  I broke filling out the ChangeLog during rollout earlier
+        when I changed apply_reverse_diff to revert the ChangeLogs because
+        PrepareChangeLogForRevert thought that it was supposed to do that.
+        I've now taught PrepareChangeLogsForRevert the new contract.
+
+        It's unclear to me how to test this change because it's essentially an
+        integration issue that requires the file system.  At some point we
+        should think about a testing strategy for integration.  As the system
+        becomes larger, we're running into more of these issues.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add cr-win-ews to QueueStatusServer
+        https://bugs.webkit.org/show_bug.cgi?id=37004
+
+        * QueueStatusServer/model/queues.py:
+        * QueueStatusServer/templates/dashboard.html:
+        * QueueStatusServer/templates/statusbubble.html:
+
+2010-04-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Unit-test networktransaction.py's log messages, and add a base
+        class to make unit-testing log messages even easier.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=36958
+
+        The purpose of this patch is also to provide a mini-tutorial on
+        how to unit-test Python logging.py messages.
+
+        * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+          - Unit-tested the log messages in test_retry().
+
+        * Scripts/webkitpy/common/system/logtesting.py:
+          - Adjusted the LogTesting class by moving the code that clears
+            the array of log messages into a finally block.  This prevents
+            redundant AssertionErrors from getting rendered to the screen
+            while running unit tests.
+          - Added a LoggingTestCase class so the setUp() and tearDown()
+            methods do not need to be implemented in order to test logging.
+            Rather, TestCase classes can simply inherit from this class.
+
+2010-04-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Re-wrote check-webkit-style's argument parsing code to use
+        Python's optparser module and more uniform error-handling logic.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34676
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Removed "option help" from check-webkit-style's usage string
+            since that is provided separately by the OptionParser class.
+          - Also changed the usage string from a function to a constant
+            string _USAGE.
+          - Added an _EPILOG string which renders after OptionParser's
+            usage string and option help.
+          - In the ArgumentParser class:
+            - Changed the constructor's stderr_write parameter to a
+              mock_stderr since the OptionParser accepts a sys.stderr
+              substitute rather than a sys.stderr.write substitute.
+            - Changed the constructor to set a _parser data attribute with
+              an OptionParser instance.
+            - Added a _create_option_parser() method which instantiates
+              the OptionParser.
+            - Updated _exit_with_help() to interact with the OptionParser's
+              help method.
+            - Updated the parse() method as necessary.  Also changed the
+              raising of ValueErrors to calls to _exit_with_help().
+
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Removed the CreateUsageTest class since the create_usage method
+            was replaced by a constant string.
+          - Added a _MockStdErr class to the ArgumentParserTest class.
+          - Updated the unit tests as necessary.
+
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        The master commit-queue process should take responsibility for checking that the builders are green
+        https://bugs.webkit.org/show_bug.cgi?id=37009
+
+        We had a failure where the child process noticed that the builders were
+        red.  We've always had this race condition, but the new optimistic
+        design made it easier to trigger.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Tweak rollout changelog to pass ValidateReviewer check
+        https://bugs.webkit.org/show_bug.cgi?id=37019
+
+        We need to use the magic word "unreviewed" to make the commit-queue
+        happy when landing rollouts.
+
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+
+2010-04-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Removed duplicate ChangeLog entry.
+
+2010-04-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Rubber-stamped by Eric Seidel.
+
+        To the Python 2.4 error message, added a link to the wiki page
+        that contains instructions on how to upgrade.
+
+        * Scripts/test-webkitpy:
+          - Eliminated a use of the ternary operator in configure_logging()
+            to let the version warning display in case of Python 2.4.
+
+        * Scripts/webkitpy/python24/versioning.py:
+          - Added this link to the error text:
+            http://trac.webkit.org/wiki/PythonGuidelines
+
+        * Scripts/webkitpy/python24/versioning_unittest.py:
+          - Updated unit test text.
+
+2010-04-02  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Record the IRC nick of folks who request rollouts
+        https://bugs.webkit.org/show_bug.cgi?id=36999
+
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add cr-win-ews
+        https://bugs.webkit.org/show_bug.cgi?id=36974
+
+        Adds support for an Early Warning System for Chromium on Linux.  The
+        interface to the Chromium port is the same on every platform, so we
+        don't need to create a new Port object for this queue.
+
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Using a failure exit code when failing to load a required import
+        https://bugs.webkit.org/show_bug.cgi?id=37000
+
+        Well spotted by Mark Rowe.
+
+        * Scripts/webkitpy/common/system/user.py:
+
+2010-04-01  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Rewrote the revision (r56942) to disable the 79 character line
+        length limit Python/PEP8 style check.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33639#c39
+
+        This rewrite puts the disabling not in the PythonProcessor but
+        in the calling code's default filter rule configuration.  This
+        allows the user to check line-length style from the command-line
+        if desired.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added "-pep8/E501" to the _BASE_FILTER_RULES configuration
+            variable to disable the line-length check.
+          - Added "-pep8/E501" to the list of recognized style categories
+            to permit the category to be checked from the command line.
+
+        * Scripts/webkitpy/style/processors/python.py:
+          - Reverted r56942: http://trac.webkit.org/changeset/56942
+
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add options to enable FILE_READER and FILE_WRITER support.
+
+        * Scripts/build-webkit:
+
+2010-04-01  Kent Tamura  <tkent@chromium.org>
+
+        Unreviewed. Add missing license header.
+
+        * DumpRenderTree/chromium/TestShellMac.mm:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Improve the error handling in rollout a bit
+        https://bugs.webkit.org/show_bug.cgi?id=36995
+
+        This patch does a few things to make the error handling in rollout a
+        bit more robust.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+            The old logic here was wrong.  We don't want to resolve the
+            ChangeLogs (that would remove the old ChangeLog entry).  Instead,
+            we want to revert the ChangeLogs so we can fill them with the new
+            message.
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+            Update test expectations because we're using a different mock object.
+        * Scripts/webkitpy/tool/commands/download.py:
+            - Added an update command to make updating from the SheriffBot more
+              robust.
+            - Now that we have CommitInfo, we can automatically CC the
+              responsible parties on the bug we create.
+            - Re-ordered the steps in create-rollout.  Our original thinking
+              was that we always wanted to create the bug, but that's not
+              really true given how things appear to be playing out.  If we
+              fail to apply the reverse diff, we don't want to create the bug.
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+            - Use the new, more robust update command.
+        * Scripts/webkitpy/tool/steps/createbug.py:
+            Allow commands to pre-load who they want to be CCed on a new bug.
+
+2010-04-01  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add TestShell and WebViewHost class, main(), and so on
+        https://bugs.webkit.org/show_bug.cgi?id=36814
+
+        This change introduces:
+        - WebViewHost class
+          It's an implementation of some delegates required by Chromium
+          WebKit API, and manages painting of a WebView. It's base on
+          src/webkit/tools/test_shell/test_webview_delegate.{cc,h} of
+          Chromium rev.40492.
+        - TestShell class
+          The TestShell instance holds global states of DumpRenderTree process.
+          Unlike TestShell class of Chromium test_shell, TestShell instance is
+          created just once.
+        - DumpRenderTree.cpp
+          The program entry.
+
+        * DumpRenderTree/chromium/DumpRenderTree.cpp: Added.
+        * DumpRenderTree/chromium/TestShell.cpp: Added.
+        * DumpRenderTree/chromium/TestShell.h: Added.
+        * DumpRenderTree/chromium/TestShellMac.mm: Added.
+        * DumpRenderTree/chromium/WebViewHost.cpp: Added.
+        * DumpRenderTree/chromium/WebViewHost.h: Added.
+        * DumpRenderTree/chromium/config.h: Added.
+
+2010-04-01  David Levin  <levin@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        sheriffbot rollout should verify that the svn revision is a number.
+        https://bugs.webkit.org/show_bug.cgi?id=37001
+
+        * Scripts/webkitpy/common/net/bugzilla.py: Allow for the message to be None.
+        * Scripts/webkitpy/tool/bot/sheriff.py: Did verification that svn revision
+         is a number. Fixed the imports (since the files uses ScriptError and log)
+         and a typo.
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: Added a test to verify
+         the behavior.
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Print an error message for readline bogosity in MacPorts
+        https://bugs.webkit.org/show_bug.cgi?id=36979
+
+        * Scripts/webkitpy/common/system/user.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Don't pass --non-interactive to create-rollout
+        https://bugs.webkit.org/show_bug.cgi?id=36989
+
+        It turns out you can't pass --non-interactive to create-rollout.  Also,
+        improve our error reporting slighly to catch the case where we error
+        out after creating the rollout bug.
+
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriff.py:
+
+2010-04-01  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        webkit-patch can incorrectly think the working directory is modified
+        https://bugs.webkit.org/show_bug.cgi?id=36985
+
+        If a file's modification time is modified, but the contents are not,
+        then diff-index will think the file has been modified unless you do
+        some crazy update-index call. Instead, call diff --name-only, which
+        has the index update builtin.
+
+        Tried to write a test, but could not reproduce this in a unittest.
+        To test manually:
+            touch file-in-repo
+            git diff-index HEAD
+            git diff HEAD --name-only
+
+        The diff-index call incorrectly shows file-in-repo as modified.
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add rollout command to sheriffbot
+        https://bugs.webkit.org/show_bug.cgi?id=36986
+
+        This IRC command creates a new bug an attaches a rollout patch.  To
+        actually commit the rollout, a committer needs to mark the patch
+        commit-queue+ in bugs.webkit.org.
+
+        Also, factored out some of the logic from the queue into a separate
+        object for easier testing.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/sheriff.py: Added.
+        * Scripts/webkitpy/tool/bot/sheriff_unittest.py: Added.
+        * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-04-01  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, only ignoring chatty style errors.
+
+        check-webkit-style: WebKit needs a python style checker
+        https://bugs.webkit.org/show_bug.cgi?id=33639
+
+        Remove the 79 char line limit by ignoring 
+        pep8/E501.  Because we have our own report_error
+        implementation we have to ignore E501 by hand
+        instead of passing --ignore=E501.
+
+        Right now over 1400 lines of our existing python
+        fail E501 so this rule just generates needless noise.
+        The rest of WebKit has no wrapping rule so it makes
+        little sense for our Python to differ here.
+
+        * Scripts/webkitpy/style/processors/python.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Add cmarrin's IRC nickname.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        EWS spins hot when unable to build
+        https://bugs.webkit.org/show_bug.cgi?id=36981
+
+        The problem is that the queue engine things we have more work to do,
+        but the bot isn't actually able to do anything.  After this change, we
+        back off the usual amount.
+
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-01  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Added layerTreeAsText function to DRT (for Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=36782
+
+        This is the DRT side. It exposes the call to JavaScript
+        through the LayoutTestController.
+
+        * DumpRenderTree/LayoutTestController.cpp:Platform independent JavaScript shim
+        (layerTreeAsTextCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:Mac specific plumbing to WebKit
+        (LayoutTestController::layerTreeAsText):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:Windows specific plumbing to WebKit
+        (LayoutTestController::layerTreeAsText):
+
+2010-04-01  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after addition of JavaScriptCore/wtf/text directory.
+
+        * wx/build/settings.py:
+
+2010-04-01  Jian Li  <jianli@chromium.org>
+
+        Rubber-stamped by David Levin.
+
+        Add myself to the reviewers list.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Turns out the Chromium Windows bots don't have pdevenv installed.
+
+        * Scripts/webkitdirs.pm:
+
+2010-04-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Let Chromium Windows build with Visual Studio Express
+        https://bugs.webkit.org/show_bug.cgi?id=36919
+
+        This is horrible, horrible copy/paste code, but that seems to be the
+        way of webkitdirs.pm.  :(
+
+        Someone needs to go through an cleanup this code, but I don't have the
+        heart to do it in this patch.
+
+        * Scripts/webkitdirs.pm:
+
+2010-04-01  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Add myself to the committers list.
+        https://bugs.webkit.org/show_bug.cgi?id=36953
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01  Eric Seidel  <eric@webkit.org>
+
+        Rubber-stamped by Adam Barth.
+
+        Add Snow Leopard Release bot to the list of "core builders" (builders which stop the commit-queue when they turn red)
+        https://bugs.webkit.org/show_bug.cgi?id=33292
+
+        Just adding the "Build" builder for now.
+        We'll add the "Test" builders when the tests
+        are less flaky.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-01  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add myself to the reviewers list.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36935
+
+        * Scripts/webkitpy/common/config/committers.py:
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Dave Levin.
+
+        Added Python style checking to check-webkit-style using
+        the third-party pep8 module (via autoinstall).
+
+        https://bugs.webkit.org/show_bug.cgi?id=33639
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added PYTHON to FileType.
+          - Updated ProcessorDispatcher to return a PythonProcessor
+            for *.py files.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated the ProcessorDispatcher unit tests for *.py files.
+
+        * Scripts/webkitpy/style/processors/python.py: Added.
+          - Added PythonProcessor class.
+
+        * Scripts/webkitpy/style/processors/python_unittest.py: Added.
+          - Added PythonProcessor unit tests.
+
+        * Scripts/webkitpy/style/processors/python_unittest_input.py: Added.
+          - Added a sample Python file to test the PythonProcessor.process()
+            code path (since pep8 accepts a file path).
+
+        * Scripts/webkitpy/style/unittests.py:
+          - Updated the style unit test file to import python_unittest.py.
+
+        * Scripts/webkitpy/style_references.py:
+          - Adjusted style references to import pep8.
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Dave Levin.
+
+        Rewrote autoinstall.py to support unzipping *.zip files after
+        download, unzipping and extracting *.tar.gz files after download,
+        and copying installed files to a given destination directory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35163
+
+        These changes will let us autoinstall pep8.py from the web and put
+        our third-party autoinstalled code in an explicit directory like
+        webkitpy/thirdparty/autoinstalled. These changes should also speed
+        up the execution of autoinstalled *.zip packages slightly since
+        *.pyc files cannot be generated when importing from zipped
+        packages using the current autoinstall.
+
+        * Scripts/test-webkitpy:
+          - Addressed the FIXME to enable auto-install logging once
+            autoinstall was rewritten not to log as verbosely.
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+          - Updated ircbot and irclib import statements.
+
+        * Scripts/webkitpy/common/net/networktransaction.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/common/net/statusserver.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/common/system/autoinstall.py: Added.
+          - Added AutoInstaller class.
+          - Added sample/testing usage to the __main__ block.
+
+        * Scripts/webkitpy/thirdparty/__init__.py:
+          - Updated the autoinstall lines to use the new autoinstall methods.
+          - Added pep8.py to the list of auto-installed packages.
+          - Added a README file to the target autoinstallation directory
+            so users know that the directory is safe to delete.
+
+        * Scripts/webkitpy/thirdparty/autoinstall.py: Removed.
+          - This is replaced by the rewritten autoinstall
+            webkitpy/common/system/autoinstall.py.
+
+        * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Removed.
+          - The target autoinstallation directory is now auto-generated.
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Tweak webkitpy's logtesting.LogTesting class to get more mileage out
+        of our unit tests that test log messages.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36886
+
+        This patch adds to the LogTesting class's tearDown() method a line
+        asserting that the array of remaining log messages is empty.  This
+        ensures that no extra log messages are getting logged that the caller
+        might not be aware of or may have forgotten to check for.
+
+        * Scripts/webkitpy/common/system/logtesting.py:
+          - Modified the tearDown() method as described above.
+          - Also modified the assertMessages() method to clear the array
+            of log messages after asserting.
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Added support for a --verbose-logging flag to test-webkitpy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36429
+
+        Verbose logging is useful for debugging test-webkitpy code that
+        runs before the actual unit tests -- things like autoinstalling and
+        unit-test auto-detection logic.  This is different from verbose
+        logging of the unit tests themselves (which corresponds to the
+        unittest module's --verbose flag).
+
+        * Scripts/test-webkitpy:
+          - In the configure_logging() method--
+            - Added an is_verbose_logging parameter that sets the logging
+              level to logging.DEBUG instead of logging.INFO.
+            - Changed the method to throttle the logging level on the
+              root logger's handler instead of directly on the root logger
+              itself.
+            - Enabled logging of the autoinstall module when the flag is set.
+
+        * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+          - Added a work-around for a bug in Python 2.6's logging module
+            that was discovered while working on this patch.
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Enabled Python's logging module for webkit-patch, and replaced
+        deprecated_logging with Python logging in networktransaction.py.
+        This eliminates some spurious output when running test-webkitpy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36725
+
+        * Scripts/webkit-patch:
+          - Replaced the configure_logging() function with a call to
+            the new logutils.configure_logging() function.
+
+        * Scripts/webkitpy/common/net/networktransaction.py:
+          - Replaced the use of deprecated_logging with Python logging.
+
+        * Scripts/webkitpy/common/system/logutils.py:
+          - Added _default_handlers() which creates the default logging
+            handler for webkitpy.
+          - Added configure_logging() which configures default logging
+            for webkitpy.
+
+        * Scripts/webkitpy/common/system/logutils_unittest.py:
+          - Added unit tests for logutils.configure_logging().
+
+        * Scripts/webkitpy/style/checker.py:
+          - Refactored check-webkit-style's configure_logging() method
+            to call the new logutils.configure_logging().
+
+        * Scripts/webkitpy/style_references.py:
+          - Updated references as necessary.
+
+2010-03-31  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch land fails if not run from the root directory
+        https://bugs.webkit.org/show_bug.cgi?id=35822
+
+        The root of the problem was that ChangeLog.__init__ expects a path
+        relative to the current working directory, and SCM expects to
+        return paths relative to the SCM root.  Fix it by converting from
+        SCM-relative to absolute paths in Checkout.modified_changelogs
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add more tests for webkitpy.common.checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36926
+
+        We don't have a great way of testing checkout, sadly.
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: EWS crashes on failure
+        https://bugs.webkit.org/show_bug.cgi?id=36924
+
+        Turns out we need to pass one more argument.  My test is kind of lame,
+        but at least it's there.
+
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Fixed typo in WebKitTools/ChangeLog: opsys -> ospath.
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Make the EWS go faster by being optimistic
+        https://bugs.webkit.org/show_bug.cgi?id=36916
+
+        Have the EWS be optimistic that a patch will correctly build.  This
+        should speed up the common case by not requiring two builds for every
+        patch.
+
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add the ability to restart sheriffbot from IRC
+        https://bugs.webkit.org/show_bug.cgi?id=36909
+
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add win-ews to QueueStatusServer
+        https://bugs.webkit.org/show_bug.cgi?id=36876
+
+        The win-ews is still experimental, but it seems to be more or less
+        running.  We should show its results to the people.
+
+        * QueueStatusServer/model/queues.py:
+        * QueueStatusServer/templates/dashboard.html:
+        * QueueStatusServer/templates/statusbubble.html:
+
+2010-03-30  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Update rebaseline tool to check the release image diff binary and
+        fallback to debug if the release version does not exist.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36245
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-31  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Teach buildbot.py how to parse builder activity from /one_box_per_builder
+        https://bugs.webkit.org/show_bug.cgi?id=36898
+
+        I also removed some obsolete FIXMEs and
+        refactored one_box_per_builder parsing into multiple
+        methods for easier reading.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-03-31  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix logging in new-run-webkit-tests so that we don't report IMAGE
+        expected failures as unexpected passes when we run with pixel tests
+        disabled.
+
+        This change splits some of the logic embedded into the TestExpectations
+        classes out into separate pure functions (result_was_expected,
+        remove_image_failures) to make them easier to test. This also adds
+        a parameter to matches_an_expected_result() to indicate whether or
+        not pixel test results should be included in the expectations.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36771
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-31  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        In webkitpy, refactored two calls to os.path.relpath() replacements
+        to use a common method.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36891
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+          - Replaced the relpath implementation with a call to
+            webkitpy.common.system.ospath.relpath().
+
+        * Scripts/webkitpy/common/system/ospath.py: Added.
+          - Moved the relpath() implementation from style/main.py.
+
+        * Scripts/webkitpy/common/system/ospath_unittest.py: Added.
+          - Moved the relpath() unit tests from style/main_unittest.py.
+
+        * Scripts/webkitpy/style/main.py:
+          - Replaced the relpath implementation with a call to
+            webkitpy.common.system.ospath.relpath().
+
+        * Scripts/webkitpy/style/main_unittest.py:
+          - Moved the relpath unit tests to ospath_unittest.py.
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add a Builder.force_build method
+        https://bugs.webkit.org/show_bug.cgi?id=36875
+
+        We plan to eventually use this in SheriffBot to break deadlocks created
+        by flaky tests.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        webkit-patch reads wrong bug url from unified diff context
+        https://bugs.webkit.org/show_bug.cgi?id=36477
+
+        Instead of trying to figure out the bug_id from the diff, we should
+        just get the information from the Checkout object, which understands
+        these concepts.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-03-31  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        webkit-patch commit-queue should land patches optimistically
+        https://bugs.webkit.org/show_bug.cgi?id=34187
+
+        This patch adds an optimistic path to commit-queue and a "fail twice"
+        requirement for rejecting patches.  That means we'll land good patches
+        faster (via the optmistic first run) and we'll reject many fewer
+        patches due to flaky tests.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-03-31  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Custom user agent for user agent switcher
+        https://bugs.webkit.org/show_bug.cgi?id=36757
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::showUserAgentDialog):
+
+2010-03-31  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        path to committers.py in commit-queue rejection message is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=36865
+
+        This fix would have only been 3 lines long if we had
+        1. Had access to an SCM object or tool to give us the checkout root
+        2. Been able to depend on Python 2.6
+        Instead I've added a bunch of hack code, but at least now
+        we should never have to update this string again as the location
+        of committers.py is fully dynamically discovered. :p
+
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+
+2010-03-31  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Unreviewed test fix for r56809.
+
+        webkit-patch what-broke throws exception
+        https://bugs.webkit.org/show_bug.cgi?id=36852
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-30  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Rubber stamped by Dave Levin.
+
+        Made check-webkit-style less chatty.
+
+        Examples include:
+         - https://bugs.webkit.org/show_bug.cgi?id=36866#c4
+         - https://bugs.webkit.org/show_bug.cgi?id=36472#c9
+
+        * Scripts/webkitpy/style/checker.py:
+          - Changed unrecognized file type log message from info to debug.
+
+2010-03-30  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after new method added.
+
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::callShouldCloseOnWebView):
+
+2010-03-30  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch what-broke throws exception
+        https://bugs.webkit.org/show_bug.cgi?id=36852
+
+        * Scripts/webkitpy/common/checkout/api.py: Add missing import StringIO.
+        * Scripts/webkitpy/common/checkout/api_unittest.py: Test the function which previously threw and exception.
+
+2010-03-30  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36616
+        Dvorak-Qwerty keyboard layout gives unexpected results in javascript keydown
+
+        https://bugs.webkit.org/show_bug.cgi?id=36797
+        For non-Roman layouts, keydown Event.keyCode is always 0
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController keyDown:withModifiers:withLocation:]): Generate a correct keyCode
+        for keys used in tests (we used to always pass 0 for 'A').
+
+2010-03-30  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Implement win-ews
+        https://bugs.webkit.org/show_bug.cgi?id=36809
+
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+
+2010-03-30  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Adjusted test-webkitpy to delete all orphaned *.pyc files
+        from webkitpy/ prior to importing any modules from webkitpy.
+        This ensures that no import statements in webkitpy falsely
+        succeed because of leftover *.pyc files.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36599
+
+        * Scripts/test-webkitpy:
+          - Added _clean_pyc_files() to delete orphaned *.pyc files
+            from a directory.
+          - Added _clean_webkitpy_with_test() to call and test
+            _clean_pyc_files().
+          - Moved the "import webkitpy.python24.versioning" statement
+            from the top of the module to the init() method -- immediately
+            after the call to _clean_webkitpy_with_test().
+
+2010-03-30  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [Chromium-Win] subprocess.call should be called with stdin=open(os.devnull,'r')
+        https://bugs.webkit.org/show_bug.cgi?id=36811
+
+        subproess.Popen() on Python 2.4/Windows with stdout,stdout, but no stdin will fail, because it uses return value of GetStdHandle(STD_INPUT_HANDLE), but DuplicateHandle requires integer, not the handle.
+        We don't need stdin, so use devnull as stdin.
+        Same as https://bugs.webkit.org/show_bug.cgi?id=36586
+
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py: open os.devnull for stdin
+
+2010-03-29  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, build fix only.
+
+        * Scripts/webkitpy/tool/steps/validatereviewer.py: Add missing import.
+
+2010-03-29  Hayato Ito  <hayato@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Remove '_flymake' suffix from base part of file name so that
+        check-webkit-style uses a correct header guard name when it is called from Emacs's flymake.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36573
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-03-29  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Get the following test-webkitpy unit test working again:
+        scm_unittest.SVNTest.test_svn_apply().
+
+        https://bugs.webkit.org/show_bug.cgi?id=36696
+
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+          - Add leading spaces to the empty lines of the ChangeLog strings.
+          - Manually set the _reviewer attribute on the Attachment object
+            to get the tests to pass.
+
+2010-03-29  Martin Robinson  <mrobinson@webkit.org>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] suppress (un)desired launcher output that can make layout test to fail with stderr
+        https://bugs.webkit.org/show_bug.cgi?id=36390
+
+        Suppress debugging messages sent to the GLib logger during DRT runs.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (logHandler): Added.
+        (main): Use logHandler as the default GLib log message handler.
+
+2010-03-29  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        sheriff-bot should comment on bugs when builders break
+        https://bugs.webkit.org/show_bug.cgi?id=36786
+
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+         - Add a new _post_blame_comment_to_bug and all it from process_work_item
+         - Move commit-queue logic into _post_rollout_patch to make its api match the other _post commands.
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+         - Test the new _post_blame_comment_to_bug call
+
+2010-03-29  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        sheriff-bot fails to get information about certain builds
+        https://bugs.webkit.org/show_bug.cgi?id=36768
+
+        This seems to be caused by:
+        http://buildbot.net/trac/ticket/753
+        I have no work-around, but for now at least we're logging
+        the error better.  I also added allow_none to our ServerProxy
+        creation in case that fixes things for other versions of python.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-03-29  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Add sign in/out link to TestResults appengine
+
+        Add a link to main menu for sign in/out to this appengine.
+        People signed in with admin privilege could perform
+        actions that are only allowed to admins like deleting files.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36767
+
+        * TestResultServer/handlers/menu.py:
+        * TestResultServer/stylesheets/menu.css:
+        (.sign):
+        * TestResultServer/templates/menu.html:
+
+2010-03-29  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        ValidateReviewer step is draconian and un-tested
+        https://bugs.webkit.org/show_bug.cgi?id=36792
+
+        ValidateReviewer logic was commented out in
+        http://trac.webkit.org/changeset/56744
+        That was a symptom of the fact that validatereviewer.py
+        is too inflexible to be used when real humans are driving webkit-patch.
+        For now we just disable ValidateReviewer when humans are at the keyboard.
+
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+         - Only run when in non-interactive mode.
+        * Scripts/webkitpy/tool/steps/validatereviewer_unittest.py: Added.
+         - Test our validation logic to make sure it's sane.
+
+2010-03-29  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Eliminate explicit slash characters from check-webkit-style's
+        _rel_path() method to make its implementation more platform
+        independent.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36759
+
+        * Scripts/webkitpy/style/main.py:
+          - Changed to use os.sep instead of slash_chars "/\\".  This can
+            be done since os.path.abspath() converts slashes to os.sep.
+
+2010-03-29  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Change new-run-webkit-tests to not use more than four threads by
+        default on the mac port until
+        https://bugs.webkit.org/show_bug.cgi?id=36622 is fixed.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36687
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-29  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Reformat port/mac.py to fit witin 80 columns for PEP-8 compliance.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36691
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-29  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests fails java/lc3 on a clean checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36078
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+         - Build the java support files in check_build
+         - Unwrap a line which would still fit under 80col
+
+2010-02-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add hooks to the Qt DRT for testing the view mode media feature.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-29  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Update expected results for unit tests.
+
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-03-29  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  I think Eric meant svn_revision.
+
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-03-26  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch commit-queue should notice if it breaks builders (and roll out its own changes)
+        https://bugs.webkit.org/show_bug.cgi?id=29311
+
+        Now that we have sheriff-bot watching the tree, it can post
+        rollout patches on behalf of the commit queue.
+
+        * Scripts/webkitpy/common/checkout/commitinfo.py: add responsible_parties()
+        * Scripts/webkitpy/common/checkout/commitinfo_unittest.py: test responsible_parties()
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+         - Break IRC logic out into _post_irc_warning for easier testing.
+         - Add _post_rollout_patch for posting rollout patches to bugzilla.
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+         - Test _rollout_reason
+        * Scripts/webkitpy/tool/grammar.py:
+         - Fix join_with_separators to not add Adam's "oxford comma" for two item lists.
+        * Scripts/webkitpy/tool/grammar_unittest.py:
+         - Test join_with_separators
+
+2010-03-29  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Sheriffbot should actually run commands
+        https://bugs.webkit.org/show_bug.cgi?id=36776
+
+        Some minor changes to Sheriffbot:
+
+        1) We should actually run commands (by giving control back to the
+        command processing object.
+
+        2) Use URLs instead of just numbers to represent SVN revisions (making
+        it easier to folks in IRC ot followup).
+
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-03-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Antti Koivisto.
+
+        Renaming of frame flattening LayoutTestController method
+        to setFrameFlatteningEnabled(bool)
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setFrameFlatteningEnabledCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setFrameFlatteningEnabled):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setFrameFlatteningEnabled):
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setFrameFlatteningEnabled):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setFrameFlatteningEnabled):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setFrameFlatteningEnabled):
+
+2010-03-28  Gustavo Noronha Silva  <gns@gnome.org>
+
+        No review, rolling out r56679.
+        http://trac.webkit.org/changeset/56679
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        Lots of tests broken.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (createWebView):
+
+2010-03-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Fixed typo in deprecated_logging_unittest.py, which is masking
+        sys.stderr while running test-webkitpy.
+
+        See also-- https://bugs.webkit.org/show_bug.cgi?id=36725#c3
+
+        * Scripts/webkitpy/common/system/deprecated_logging_unittest.py:
+
+2010-03-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Renamed check-webkit-style's --debug flag to --verbose to be more
+        in line with other WebKit scripts.  Also renamed the current
+        --verbose flag to --min-confidence to allow the --debug rename.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36521
+
+        We also renamed the internal "verbose" variables to "confidence" or
+        "min_confidence," as appropriate, to avoid confusion with the
+        --verbose flag, and because the new names are more accurate.
+
+        * Scripts/check-webkit-style:
+          - Renamed is_debug to is_verbose.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Renamed _DEFAULT_VERBOSITY to _DEFAULT_CONFIDENCE.
+          - Renamed "verbosity" parameters to "min_confidence" throughout.
+          - Renamed configure_logging()'s is_debug parameter to is_verbose.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated the unit tests as necessary.
+
+        * Scripts/webkitpy/style/error_handlers.py:
+          - Updated the call to StyleCheckerConfiguration.write_style_error().
+
+        * Scripts/webkitpy/style/error_handlers_unittest.py:
+          - Updated the unit tests as necessary.
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Updated the usage string with the new flag names.
+          - Renamed the verbosity parameter to min_confidence throughout.
+          - Renamed the is_debug parameter to is_verbose throughout.
+
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Updated the unit tests as necessary.
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+          - Renamed the verbosity parameter to min_confidence throughout.
+
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+          - Updated the unit tests as necessary.
+
+2010-03-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Added back a line that accidentally got deleted in r56690.
+
+        * Scripts/check-webkit-style:
+
+2010-03-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Add to check-webkit-style support for checking directories.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35234
+
+        * Scripts/check-webkit-style:
+          - Replaced the call to check_file() with a call to check_paths().
+
+        * Scripts/webkitpy/style/checker.py:
+          - In the StyleChecker class:
+            - Added a check_paths() method that accepts a list of paths
+              to files and directories.
+            - Added a _check_directory() method that checks the files
+              in a directory.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Added a StyleCheckerCheckPathsTest to unit-test the new
+            check_paths() method.
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Updated the usage string.
+
+2010-03-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Changed check-webkit-style to convert paths to paths relative to
+        the checkout root when invoking check-webkit-style with path
+        arguments.  Also added warning messages where appropriate.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35498
+
+        Converting paths to paths relative to the checkout root ensures
+        that style checking will behave as expected (since path-specific
+        rules assume input paths are relative to a source root).
+
+        * Scripts/check-webkit-style:
+          - Added debug logging of whether the current directory was found
+            to be in a WebKit checkout.
+          - Added the found_checkout parameter to the call to parser.parse().
+          - Renamed the files variable to paths.
+          - Added a call to change_directory() prior to checking style.
+
+        * Scripts/webkitpy/style/checker.py:
+          - For StyleChecker.check_file():
+            - Updated the docstring.
+            - Added two log messages.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated a call to parser.parse() with the found_checkout parameter.
+
+        * Scripts/webkitpy/style/main.py: Added.
+          - Added a new file so the code in this patch could be unit-tested,
+            as opposed to adding new code to check-webkit-style.
+          - Added the method _rel_path() as a substitute for os.path.relpath(),
+            which is available only in Python 2.6.
+          - Added the method change_directory(), which contains most of the
+            new functionality in this patch.
+
+        * Scripts/webkitpy/style/main_unittest.py: Added.
+          - Added RelPathTest to test main._rel_path().
+          - Added ChangeDirectoryTest to test main.change_directory().
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Updated check-webkit-style's usage string.
+          - For the ArgumentParser.parse() method:
+            - Added a found_checkout parameter.
+            - Renamed filenames to paths.
+            - Added logic so that an error is raised if no paths are passed
+              if found_checkout is False.
+
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Updated the ArgumentParser.parse() unit tests to include
+            coverage for the new found_checkout parameter.
+
+        * Scripts/webkitpy/style/unittests.py:
+          - Added an import statement for main_unittest.
+
+        * Scripts/webkitpy/style_references.py:
+          - Renamed SimpleScm to WebKitCheckout.
+          - Added a detect_checkout() function to allow returning None
+            instead of a WebKitCheckout instance if no checkout is found.
+          - Renamed checkout_root to root_path.
+
+2010-03-27  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        Print didHandleOnloadEventsForFrame in the callback of
+        onload-event signal comming from frame loader
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewOnloadEvent):
+        (createWebView): added connection to signal::onload-event and
+        signal callback
+
+2010-03-27  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        Print didCommitLoadForFrame in the callback of signal::load-committed
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewLoadCommitted):
+        (createWebView): added connection to sinal::load-committed and
+        signal callback
+
+2010-03-27  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        Print didStartProvisionalLoadForFrame in the callback of
+        notify::load-status property change notification
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webInspectorCloseWindow):
+        (webInspectorInspectWebView):
+        (createWebView): added connection to notify::load-status and
+        signal callback
+
+2010-03-27  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In webkitpy/, deleted the /unittests.py files since test-webkitpy
+        now auto-detects all *_unittest.py files.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36712
+
+        * Scripts/webkitpy/common/net/irc/unittests.py: Removed.
+        * Scripts/webkitpy/common/system/unittests.py: Removed.
+        * Scripts/webkitpy/common/thread/unittests.py: Removed.
+        * Scripts/webkitpy/common/unittests.py: Removed.
+        * Scripts/webkitpy/python24/unittests.py: Removed.
+        * Scripts/webkitpy/style/unittests.py: Removed.
+        * Scripts/webkitpy/tool/unittests.py: Removed.
+        * Scripts/webkitpy/unittests.py: Removed.
+
+2010-03-27  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        Add a CR after printing didFinishDocumentLoadForFrame
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewLoadFinished):
+
+2010-03-27  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Rubber-stamped by Adam Barth.
+
+        Fixed the name of a unit test file in webkitpy.
+
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py: Copied from WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py.
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py: Removed.
+
+2010-03-26  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        The test-webkitpy script now automatically detects all unit-test
+        files in webkitpy/.  This lets us eliminate the need to have and
+        maintain all of the unittests.py files.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36591
+
+        * Scripts/test-webkitpy:
+          - Replaced the "from webkitpy.unittests import *" with a call
+            to webkitpy.test.main.Tester().run_tests().
+
+        * Scripts/webkitpy/test/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+          - Required file for the new webkitpy/test/ directory.
+
+        * Scripts/webkitpy/test/main.py: Added.
+          - Added a Tester class that contains the following methods:
+            - _find_unittest_files() to detect all the unit-test files.
+            - _modules_from_paths() to convert the paths to the unit-test
+              files to fully-qualified module names.
+            - run_tests() which calls the above two methods and then passes
+              the module names to Python's unittest module.
+
+2010-03-27  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        [Qt/Win] Add support to unix and windows NS plugin for executing scripts on setWindow.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36701
+
+        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+        (webkit_test_plugin_new_instance): Add onSetWindow.
+        (webkit_test_plugin_destroy_instance): Add onSetWindow.
+        (webkit_test_plugin_set_window): Add onSetWindow.
+        * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+        (NPP_New): Add onSetWindow.
+        (NPP_Destroy): Add onSetWindow.
+        (NPP_SetWindow): Add onSetWindow.
+
+2010-03-26  Robert Hogan  <robert@roberthogan.net>
+
+        Reviewed by Simon Hausmann.
+
+        Allow plugins implemented by the application, such as mimetype 'x-qt-plugin',
+         when pluginsEnabled is false.
+
+        Add support for LayoutTestController.WebKitPluginsEnabled
+
+        https://bugs.webkit.org/show_bug.cgi?id=32196
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (copyWebSettingKey):
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::overridePreference):
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add some basic IRC commands to sheriffbot
+        https://bugs.webkit.org/show_bug.cgi?id=36684
+
+        Adds support for sheriffbot to respond to a "hi" command and a
+        "last-green-revision" command.  It's lame that we're rebuilding
+        MultiCommandTool, but as discussed in person we'll intergrate the two
+        once we see what the requirements are.
+
+        * Scripts/webkitpy/tool/bot/irc_command.py: Added.
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: Added.
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/unittests.py:
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  More errors in the IRC module.  I have no idea how to test
+        ircbot.py, which is too bad.  Hopefully we've abstracted it away enough
+        that we don't have to touch it very much after this patch.
+
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Add a missing "_".
+
+        * Scripts/webkitpy/common/net/irc/ircproxy.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy_unittest.py: Added.
+        * Scripts/webkitpy/common/net/irc/unittests.py:
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Fix a the commit queue after my recent change.
+
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+
+2010-03-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed fix.
+
+        Fix the return value for port/base.diff_image (changed from 1/0 to
+        True/False in bug 34826.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-03-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Change the Mac port of new-run-webkit-tests to look for a
+        test_expectations.txt file in addition to the Skipped files, so we
+        can track pixel failures.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36619
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Implement pixel tests (image diff) properly on the Mac port.
+
+        This change introduces a new "ServerPocess" class that can be used
+        to manage processes that the run-webkit-tests harness forks off and
+        expects to stay up for longer than a single request/response session.
+        Both DumpRenderTree and ImageDiff use this style of communication,
+        although the current code forks off a new ImageDiff for each diff
+        (We need to restructure other parts of the code to be able to do this
+        safely in a multi-threaded environment).
+
+        Also, now that the ServerProcess abstraction exists, we can probably
+        clean up and simplify some of the thread management logic in
+        test_shell_thread as well.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34826
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/server_process.py:
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+
+2010-03-26  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Eric Seidel.
+
+        Print didFinishLoadForFrame outcome in DRT
+
+        [GTK] Improve reporting of frame loader callbacks in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=36454
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewLoadCommitted):
+
+2010-03-26  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed test fix.
+        My change conflicted with one of Adam's causing test-webkitpy to fail.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        * Scripts/webkitpy/common/checkout/api_unittest.py:
+         - modified_changelogs is now on Checkout instead of scm.
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Refactor IRCBot controller logic to allow for commands
+        https://bugs.webkit.org/show_bug.cgi?id=36676
+
+        We need to move the controller logic into the tool package so it can
+        know about commands.  The changes to queueengine could go in a
+        different patch, but we're going to need it anyway.
+
+        * Scripts/webkitpy/common/config/irc.py: Added.
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/sheriffircbot.py: Added.
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Rubber stamped by Eric Seidel.
+
+        Move the threading code into its own module.  (It has nothing to do with IRC.)
+
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy.py:
+        * Scripts/webkitpy/common/net/irc/messagepump.py: Removed.
+        * Scripts/webkitpy/common/net/irc/messagepump_unittest.py: Removed.
+        * Scripts/webkitpy/common/net/irc/threadedmessagequeue.py: Removed.
+        * Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py: Removed.
+        * Scripts/webkitpy/common/net/irc/unittests.py:
+        * Scripts/webkitpy/common/thread: Added.
+        * Scripts/webkitpy/common/thread/__init__.py: Added.
+        * Scripts/webkitpy/common/thread/messagepump.py: Copied from Scripts/webkitpy/common/net/irc/messagepump.py.
+        * Scripts/webkitpy/common/thread/messagepump_unittest.py: Copied from Scripts/webkitpy/common/net/irc/messagepump_unittest.py.
+        * Scripts/webkitpy/common/thread/threadedmessagequeue.py: Copied from Scripts/webkitpy/common/net/irc/threadedmessagequeue.py.
+        * Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py: Copied from Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py.
+        * Scripts/webkitpy/common/thread/unittests.py: Added.
+        * Scripts/webkitpy/common/unittests.py:
+
+2010-03-26  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        Finally add some basic unit testing for Checkout.commit_message_for_this_commit
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/api_unittest.py: Added.
+        * Scripts/webkitpy/common/unittests.py:
+
+2010-03-26  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        [Qt] User Agent Switcher on QtLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=36451
+
+        Patch by Diego Gonzalez <diego.gonzalez@openbossa.org> on 2010-03-26
+        Reviewed by Simon Hausmann.
+
+        Make possible to change the QtLauncher user agent via
+        a predefined list.
+
+        * QtLauncher/QtLauncher.pro:
+        * QtLauncher/QtLauncher.qrc: Added.
+        * QtLauncher/main.cpp:
+        (LauncherWindow::showUserAgentDialog):
+        (LauncherWindow::createChrome):
+        * QtLauncher/useragentlist.txt: Added.
+        * QtLauncher/webpage.cpp:
+        (WebPage::userAgentForUrl):
+        * QtLauncher/webpage.h:
+        (WebPage::setUserAgent):
+
+2010-03-26  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Host layout test flakiness dashboard in TestResultServer appengine.
+
+        Flakiness dashboard is a tool to monitor layout test status and
+        help layout test regression diagnostics.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36195
+
+        * TestResultServer/handlers/dashboardhandler.py: Added.
+         - New handler to handle dashboard request
+        * TestResultServer/handlers/menu.py:
+         - Add new dashboard links
+        * TestResultServer/handlers/testfilehandler.py:
+         - Request routes refactory
+        * TestResultServer/index.yaml:
+        * TestResultServer/main.py:
+         - Add new dashboard request routes and refactor test result file rountes.
+        * TestResultServer/model/dashboardfile.py: Added.
+         - Model to access datastore for dashboard files
+        * TestResultServer/model/testfile.py:
+        * TestResultServer/stylesheets/dashboardfile.css: Added.
+        * TestResultServer/templates/dashboardfilelist.html: Added.
+        * TestResultServer/templates/showfilelist.html:
+
+2010-03-26  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove some evil statics from CommitInfo
+        https://bugs.webkit.org/show_bug.cgi?id=36637
+
+        These methods should really be on checkout.  You can tell because they
+        know about ChangeLogs and take an SCM as an argument.  :)
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/commitinfo.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-03-23  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Add an option to QtLauncher to enable/disable a QGLWidget as Viewport
+        of the QGraphicsView when the launcher is running on graphicsview mode.
+
+        [Qt] QtLauncher needs an option to Enable/Disable a QGLWidget as Viewport
+        https://bugs.webkit.org/show_bug.cgi?id=36270
+
+        * QtLauncher/QtLauncher.pro:
+        * QtLauncher/main.cpp:
+        (LauncherWindow::toggleQGLWidgetViewport):
+        (LauncherWindow::createChrome):
+
+2010-03-26  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [Chromium-Win] websocket_server.py failed to start
+        https://bugs.webkit.org/show_bug.cgi?id=36586
+        
+        subproess.Popen() on Python 2.4/Windows with stdout,stdout, but no stdin will fail, because it uses return value of GetStdHandle(STD_INPUT_HANDLE), but DuplicateHandle requires integer, not the handle.
+        We don't need stdin, so use devnull as stdin.
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py: open os.devnull for stdin
+
+2010-03-26  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add TestNavigationController and TestWebWorker
+        https://bugs.webkit.org/show_bug.cgi?id=36520
+
+        Add LayoutTestController class, which is going to be used by
+        DumpRenderTree Chromium port. These files are based on:
+        - src/webkit/tools/test_shell/layout_test_controller.cc
+        - src/webkit/tools/test_shell/layout_test_controller.h
+        of Chromium rev.40492.
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp: Added.
+        * DumpRenderTree/chromium/LayoutTestController.h: Added.
+
+2010-03-25  Charlie Reis  <creis@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        onbeforeunload not called at window close + frame or iframe focused
+        https://bugs.webkit.org/show_bug.cgi?id=27481
+
+        Adds a callShouldCloseOnWebView method to LayoutTestController,
+        to allow automated testing for bug 27481.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (callShouldCloseOnWebViewCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::callShouldCloseOnWebView):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::callShouldCloseOnWebView):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::callShouldCloseOnWebView):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::callShouldCloseOnWebView):
+
+2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add webkit-patch lkgr for finding last known good revision
+        https://bugs.webkit.org/show_bug.cgi?id=36626
+
+        This is rather slow for now because the command
+        has to compute this information from the buildbot.
+        A better long-term solution would be to have a server
+        somewhere store a pre-computed LKGR and then any
+        script (like webkit-patch) could just fetch it.
+
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move modified_changelogs (and friends) from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36636
+
+        These functions know about ChangeLogs, which is forbidden knowledge in
+        scm.py.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+        * Scripts/webkitpy/tool/steps/revertrevision.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move apply_patch from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36635
+
+        SCM shouldn't have any knowledge of WebKit scripts.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/applypatch.py:
+
+2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed build fix to un-break webkit-patch land.
+        Test-case coming in follow-up commit.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+
+2010-03-25  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7728903> Support color bitmap fonts
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added ColorBits.ttf
+        and ColorBits-A.png.
+        * DumpRenderTree/fonts/ColorBits-A.png: Copied from WebCore/inspector/front-end/Images/successGreenDot.png.
+        * DumpRenderTree/fonts/ColorBits.ttf: Added.
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (activateFonts): Activate ColorBits.ttf.
+
+2010-03-25  Mark Rowe  <mrowe@apple.com>
+
+        Remove a printf that was causing commit-log-editor to spew the name of the editor
+        to the terminal many times during a commit.
+
+        * Scripts/commit-log-editor:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        This function requires knowledge of ChangeLogs, but scm shouldn't know
+        about ChangeLogs.
+
+        * Scripts/webkitpy/common/checkout/api.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+        * Scripts/webkitpy/tool/steps/commit.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: webkit-patch land can't land "rubber-stamped" patches
+        https://bugs.webkit.org/show_bug.cgi?id=36582
+
+        Allow a "-" in rubber stamped.
+
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Fix some copyright lines to remove extraneous comma and
+        python directive.
+
+        * Scripts/webkitpy/tool/bot/patchcollection.py:
+        * Scripts/webkitpy/tool/bot/patchcollection_unittest.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/comments.py:
+        * Scripts/webkitpy/tool/grammar.py:
+        * Scripts/webkitpy/tool/multicommandtool.py:
+        * Scripts/webkitpy/tool/multicommandtool_unittest.py:
+
+2010-03-25  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler, Alexey Proskuryakov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36631
+        Allow the test plugin to run scripts in response to NPP_SetWindow calls
+        
+        Hook up the ability for the TestNetscapePlugIn to run JavaScript in
+        response to NPP_SetWindow.
+        
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (pluginAllocate):
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+        * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+        (NPP_New):
+        (NPP_Destroy):
+        (NPP_SetWindow):
+
+2010-03-25  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed, build fix.
+
+        [Qt] Fix QtLauncher guards.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::showFPS):
+        (LauncherWindow::updateFPS):
+
+2010-03-25  Yury Semikhatsky  <yurys@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Allow running tests with enabled developer extras and closed Web Inspector. Tests that have inspector-enabled/ in their path/url will have developer extras enabled.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36610
+
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (shouldEnableDeveloperExtras):
+        (runTest):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setJavaScriptProfilingEnabled):
+        (LayoutTestController::setDeveloperExtrasEnabled):
+        (LayoutTestController::showWebInspector):
+        (LayoutTestController::closeWebInspector):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (shouldEnableDeveloperExtras):
+        (runTest):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setJavaScriptProfilingEnabled):
+        (LayoutTestController::setDeveloperExtrasEnabled):
+        (LayoutTestController::showWebInspector):
+        (LayoutTestController::closeWebInspector):
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::shouldEnableDeveloperExtras):
+        (WebCore::DumpRenderTree::open):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::closeWebInspector):
+        (LayoutTestController::setDeveloperExtrasEnabled):
+        (LayoutTestController::showWebInspector):
+        (LayoutTestController::setJavaScriptProfilingEnabled):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (shouldEnableDeveloperExtras):
+        (runTest):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setJavaScriptProfilingEnabled):
+        (LayoutTestController::setDeveloperExtrasEnabled):
+        (LayoutTestController::showWebInspector):
+        (LayoutTestController::closeWebInspector):
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Rubber stamped by Eric Seidel.
+
+        Tweaks to sheriffbot to improve latency by keeping the working copy up
+        to date even when there's no build break.  Also, officially move
+        sheriffbot to #webkit.
+
+        (Also teach ValidateReviewer to understand rubber stamps.)
+
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-22  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Not displaying FPS info on the terminal. On S60 and Maemo the
+        Window title will be used and Status bar will used on desktop.
+
+        [Qt] QtLauncher's FPS info should not be displayed on the terminal
+        https://bugs.webkit.org/show_bug.cgi?id=36244
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::initializeView):
+        (LauncherWindow::showFPS):
+        (LauncherWindow::updateFPS):
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+        (WebViewGraphicsBased::updateFrameRate):
+        * QtLauncher/webview.h:
+        (WebViewGraphicsBased::frameRateMeasurementEnabled):
+
+2010-03-25  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Kenneth Christiansen.
+
+        Added missing frame flattening activation on
+        fast/frames/flattening/frameset-flattening-grid.html;
+        removed unnecessary CONSOLE MESSAGE from the expected file;
+        reset the setFrameSetFlatteningEnabled for each test.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::resetSettings):
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved deprecated_logging unit test import statement from
+        webkitpy/unittests.py to webkitpy/common/system/unittests.py.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/webkitpy/common/system/unittests.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved webkit_logging.py to common/system/deprecated_logging.py
+        inside webkitpy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/validate-committer-lists:
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/buildbot.py:
+        * Scripts/webkitpy/common/net/credentials.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy.py:
+        * Scripts/webkitpy/common/net/networktransaction.py:
+        * Scripts/webkitpy/common/net/statusserver.py:
+        * Scripts/webkitpy/common/system/deprecated_logging.py: Copied from WebKitTools/Scripts/webkitpy/webkit_logging.py.
+        * Scripts/webkitpy/common/system/deprecated_logging_unittest.py: Copied from WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py.
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+        * Scripts/webkitpy/tool/commands/openbugs.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/stepsequence.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/multicommandtool.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/tool/steps/applypatch.py:
+        * Scripts/webkitpy/tool/steps/build.py:
+        * Scripts/webkitpy/tool/steps/checkstyle.py:
+        * Scripts/webkitpy/tool/steps/closebug.py:
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+        * Scripts/webkitpy/tool/steps/confirmdiff.py:
+        * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
+        * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py:
+        * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+        * Scripts/webkitpy/tool/steps/runtests.py:
+        * Scripts/webkitpy/tool/steps/update.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+        * Scripts/webkitpy/unittests.py:
+        * Scripts/webkitpy/webkit_logging.py: Removed.
+        * Scripts/webkitpy/webkit_logging_unittest.py: Removed.
+
+2010-03-25  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        commit-log-editor can call itself in an infinite loop
+        https://bugs.webkit.org/show_bug.cgi?id=35291
+
+        if $editor ends up being commit-log-editor, the script will exec itself
+        in an infinite loop.
+
+        To avoid this, we now check that the $editor variable is not
+        commit-log-editor to avoid this case.
+
+        * Scripts/commit-log-editor: Added an isCommitLogEditor method and
+        reworked the $editor setting to add this check.
+
+2010-03-25  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add a Toggle Frame Flattening option to QtLauncher.
+        It will be enabled by default on Maemo5 and S60 platforms.
+
+        [Qt] Add enable/disable Frame Flattening option to QtLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=36558
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::applyPrefs):
+        (LauncherWindow::toggleFrameFlattening):
+        (LauncherWindow::createChrome):
+
+2010-03-25  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        svn-create-patch prints a warning for large patches
+        https://bugs.webkit.org/show_bug.cgi?id=32582
+
+        svn-create-patch prints a warning message for larger patches than 20k.
+
+        * Scripts/svn-create-patch:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Renamed early_warning_system.py to earlywarningsystem.py.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/tool/commands/early_warning_system.py: Removed.
+        * Scripts/webkitpy/tool/commands/early_warning_system_unittest.py: Removed.
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py: Copied from Scripts/webkitpy/tool/commands/early_warning_system.py.
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: Copied from Scripts/webkitpy/tool/commands/early_warning_system_unittest.py.
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/unittests.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In webkitpy, pushed the unit test import statements in
+        webkitpy/unittests.py into appropriate unittests.py files in the
+        new root-level packages beneath webkitpy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/webkitpy/common/system/unittests.py:
+        * Scripts/webkitpy/common/unittests.py: Added.
+        * Scripts/webkitpy/python24/unittests.py: Added.
+        * Scripts/webkitpy/tool/unittests.py: Added.
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move WebKitCheckout into the webkitpy.common.checkout
+        package.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/common/checkout/api.py: Copied from Scripts/webkitpy/webkitcheckout.py.
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/webkitcheckout.py: Removed.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move OutputCapture to webkitpy.common.system.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+        * Scripts/webkitpy/common/net/credentials_unittest.py:
+        * Scripts/webkitpy/common/system/outputcapture.py: Copied from Scripts/webkitpy/outputcapture.py.
+        * Scripts/webkitpy/outputcapture.py: Removed.
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/multicommandtool_unittest.py:
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move user.py to webkitpy.common.system.
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/net/bugzilla.py:
+        * Scripts/webkitpy/common/net/credentials.py:
+        * Scripts/webkitpy/common/system/user.py: Copied from Scripts/webkitpy/user.py.
+        * Scripts/webkitpy/common/system/user_unittest.py: Copied from Scripts/webkitpy/user_unittest.py.
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/unittests.py:
+        * Scripts/webkitpy/user.py: Removed.
+        * Scripts/webkitpy/user_unittest.py: Removed.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move executive.py to webkitpy.common.system.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+        * Scripts/webkitpy/common/checkout/scm_unittest.py:
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/common/config/ports_unittest.py:
+        * Scripts/webkitpy/common/net/credentials.py:
+        * Scripts/webkitpy/common/net/credentials_unittest.py:
+        * Scripts/webkitpy/common/system/executive.py: Copied from Scripts/webkitpy/executive.py.
+        * Scripts/webkitpy/common/system/executive_unittest.py: Copied from Scripts/webkitpy/executive_unittest.py.
+        * Scripts/webkitpy/executive.py: Removed.
+        * Scripts/webkitpy/executive_unittest.py: Removed.
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/early_warning_system.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/stepsequence.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/steps/checkstyle.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        * Scripts/webkitpy/unittests.py:
+        * Scripts/webkitpy/webkit_logging_unittest.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move grammary.py into webkitpy.tool.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/grammar.py: Removed.
+        * Scripts/webkitpy/grammar_unittest.py: Removed.
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/grammar.py: Copied from Scripts/webkitpy/grammar.py.
+        * Scripts/webkitpy/tool/grammar_unittest.py: Copied from Scripts/webkitpy/grammar_unittest.py.
+        * Scripts/webkitpy/tool/multicommandtool.py:
+        * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In webkitpy, moved init/ to common/system/.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/webkitpy/common/system: Copied from WebKitTools/Scripts/webkitpy/init.
+        * Scripts/webkitpy/common/system/logutils.py:
+        * Scripts/webkitpy/common/system/logutils_unittest.py:
+        * Scripts/webkitpy/init: Removed.
+        * Scripts/webkitpy/init/__init__.py: Removed.
+        * Scripts/webkitpy/init/logtesting.py: Removed.
+        * Scripts/webkitpy/init/logutils.py: Removed.
+        * Scripts/webkitpy/init/logutils_unittest.py: Removed.
+        * Scripts/webkitpy/init/unittests.py: Removed.
+        * Scripts/webkitpy/python24/versioning_unittest.py:
+        * Scripts/webkitpy/style_references.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move stepsequence to webkitpy.tool.commands.
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/stepsequence.py: Removed.
+        * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/stepsequence.py: Copied from Scripts/webkitpy/stepsequence.py.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Create webkitpy.common.checkout as described in
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/changelogs.py: Removed.
+        * Scripts/webkitpy/changelogs_unittest.py: Removed.
+        * Scripts/webkitpy/commitinfo.py: Removed.
+        * Scripts/webkitpy/commitinfo_unittest.py: Removed.
+        * Scripts/webkitpy/common/checkout: Added.
+        * Scripts/webkitpy/common/checkout/__init__.py: Copied from Scripts/webkitpy/common/__init__.py.
+        * Scripts/webkitpy/common/checkout/changelog.py: Copied from Scripts/webkitpy/changelogs.py.
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py: Copied from Scripts/webkitpy/changelogs_unittest.py.
+        * Scripts/webkitpy/common/checkout/commitinfo.py: Copied from Scripts/webkitpy/commitinfo.py.
+        * Scripts/webkitpy/common/checkout/commitinfo_unittest.py: Copied from Scripts/webkitpy/commitinfo_unittest.py.
+        * Scripts/webkitpy/common/checkout/diff_parser.py: Copied from Scripts/webkitpy/diff_parser.py.
+        * Scripts/webkitpy/common/checkout/diff_parser_unittest.py: Copied from Scripts/webkitpy/diff_parser_unittest.py.
+        * Scripts/webkitpy/common/checkout/scm.py: Copied from Scripts/webkitpy/scm.py.
+        * Scripts/webkitpy/common/checkout/scm_unittest.py: Copied from Scripts/webkitpy/scm_unittest.py.
+        * Scripts/webkitpy/common/net/credentials.py:
+        * Scripts/webkitpy/diff_parser.py: Removed.
+        * Scripts/webkitpy/diff_parser_unittest.py: Removed.
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/scm.py: Removed.
+        * Scripts/webkitpy/scm_unittest.py: Removed.
+        * Scripts/webkitpy/stepsequence.py:
+        * Scripts/webkitpy/style_references.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/comments.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+        * Scripts/webkitpy/unittests.py:
+        * Scripts/webkitpy/webkitcheckout.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In webkitpy, moved init/versioning.py to python24/.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/test-webkitpy:
+        * Scripts/webkit-patch:
+        * Scripts/webkitpy/init/unittests.py:
+        * Scripts/webkitpy/init/versioning.py: Removed.
+        * Scripts/webkitpy/init/versioning_unittest.py: Removed.
+        * Scripts/webkitpy/python24: Added.
+        * Scripts/webkitpy/python24/__init__.py: Copied from WebKitTools/Scripts/webkitpy/tool/__init__.py.
+        * Scripts/webkitpy/python24/versioning.py: Copied from WebKitTools/Scripts/webkitpy/init/versioning.py.
+        * Scripts/webkitpy/python24/versioning_unittest.py: Copied from WebKitTools/Scripts/webkitpy/init/versioning_unittest.py.
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Create webkitpy.common.net as described in
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/bugzilla.py: Removed.
+        * Scripts/webkitpy/bugzilla_unittest.py: Removed.
+        * Scripts/webkitpy/buildbot.py: Removed.
+        * Scripts/webkitpy/buildbot_unittest.py: Removed.
+        * Scripts/webkitpy/commitinfo.py:
+        * Scripts/webkitpy/common/net: Added.
+        * Scripts/webkitpy/common/net/__init__.py: Added.
+        * Scripts/webkitpy/common/net/bugzilla.py: Copied from Scripts/webkitpy/bugzilla.py.
+        * Scripts/webkitpy/common/net/bugzilla_unittest.py: Copied from Scripts/webkitpy/bugzilla_unittest.py.
+        * Scripts/webkitpy/common/net/buildbot.py: Copied from Scripts/webkitpy/buildbot.py.
+        * Scripts/webkitpy/common/net/buildbot_unittest.py: Copied from Scripts/webkitpy/buildbot_unittest.py.
+        * Scripts/webkitpy/common/net/credentials.py: Copied from Scripts/webkitpy/credentials.py.
+        * Scripts/webkitpy/common/net/credentials_unittest.py: Copied from Scripts/webkitpy/credentials_unittest.py.
+        * Scripts/webkitpy/common/net/irc: Copied from Scripts/webkitpy/irc.
+        * Scripts/webkitpy/common/net/irc/ircbot.py:
+        * Scripts/webkitpy/common/net/irc/ircproxy.py:
+        * Scripts/webkitpy/common/net/irc/messagepump_unittest.py:
+        * Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py:
+        * Scripts/webkitpy/common/net/irc/unittests.py:
+        * Scripts/webkitpy/common/net/networktransaction.py: Copied from Scripts/webkitpy/networktransaction.py.
+        * Scripts/webkitpy/common/net/networktransaction_unittest.py: Copied from Scripts/webkitpy/networktransaction_unittest.py.
+        * Scripts/webkitpy/common/net/statusserver.py: Copied from Scripts/webkitpy/statusserver.py.
+        * Scripts/webkitpy/credentials.py: Removed.
+        * Scripts/webkitpy/credentials_unittest.py: Removed.
+        * Scripts/webkitpy/irc: Removed.
+        * Scripts/webkitpy/irc/__init__.py: Removed.
+        * Scripts/webkitpy/irc/ircbot.py: Removed.
+        * Scripts/webkitpy/irc/ircproxy.py: Removed.
+        * Scripts/webkitpy/irc/messagepump.py: Removed.
+        * Scripts/webkitpy/irc/messagepump_unittest.py: Removed.
+        * Scripts/webkitpy/irc/threadedmessagequeue.py: Removed.
+        * Scripts/webkitpy/irc/threadedmessagequeue_unittest.py: Removed.
+        * Scripts/webkitpy/irc/unittests.py: Removed.
+        * Scripts/webkitpy/networktransaction.py: Removed.
+        * Scripts/webkitpy/networktransaction_unittest.py: Removed.
+        * Scripts/webkitpy/scm_unittest.py:
+        * Scripts/webkitpy/statusserver.py: Removed.
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In webkitpy, renamed MockBugzillaTool to MockTool.
+
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-25  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In Scripts/webkitpy, moved webkitport.py and committers.py into
+        common/config/ (also creating common/config/).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        This is part of the master bug to reorganize webkitpy.
+
+        * Scripts/validate-committer-lists:
+        * Scripts/webkitpy/bugzilla.py:
+        * Scripts/webkitpy/bugzilla_unittest.py:
+        * Scripts/webkitpy/changelogs.py:
+        * Scripts/webkitpy/commitinfo.py:
+        * Scripts/webkitpy/commitinfo_unittest.py:
+        * Scripts/webkitpy/committers.py: Removed.
+        * Scripts/webkitpy/committers_unittest.py: Removed.
+        * Scripts/webkitpy/common: Added.
+        * Scripts/webkitpy/common/__init__.py: Copied from WebKitTools/Scripts/webkitpy/style/__init__.py.
+        * Scripts/webkitpy/common/config: Added.
+        * Scripts/webkitpy/common/config/__init__.py: Copied from WebKitTools/Scripts/webkitpy/style/__init__.py.
+        * Scripts/webkitpy/common/config/committers.py: Copied from WebKitTools/Scripts/webkitpy/committers.py.
+        * Scripts/webkitpy/common/config/committers_unittest.py: Copied from WebKitTools/Scripts/webkitpy/committers_unittest.py.
+        * Scripts/webkitpy/common/config/ports.py: Copied from WebKitTools/Scripts/webkitpy/webkitport.py.
+        * Scripts/webkitpy/common/config/ports_unittest.py: Copied from WebKitTools/Scripts/webkitpy/webkitport_unittest.py.
+        * Scripts/webkitpy/mock_bugzillatool.py:
+        * Scripts/webkitpy/tool/commands/early_warning_system.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/unittests.py:
+        * Scripts/webkitpy/webkitport.py: Removed.
+        * Scripts/webkitpy/webkitport_unittest.py: Removed.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move mock_bugzillatool.py to tool/mocktool.py.
+
+        * Scripts/webkitpy/mock_bugzillatool.py: Removed.
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/mocktool.py: Copied from Scripts/webkitpy/mock_bugzillatool.py.
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move comments.py and multicommandtool.py to their new
+        home.
+
+        * Scripts/webkitpy/comments.py: Removed.
+        * Scripts/webkitpy/multicommandtool.py: Removed.
+        * Scripts/webkitpy/multicommandtool_unittest.py: Removed.
+        * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/openbugs.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/comments.py: Copied from Scripts/webkitpy/comments.py.
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/multicommandtool.py: Copied from Scripts/webkitpy/multicommandtool.py.
+        * Scripts/webkitpy/tool/multicommandtool_unittest.py: Copied from Scripts/webkitpy/multicommandtool_unittest.py.
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+        * Scripts/webkitpy/tool/steps/closepatch.py:
+        * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Fixup one import statement I didn't find because the .pyc
+        masked the error.
+
+        * Scripts/webkitpy/stepsequence.py:
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move queueengine.py to its new home.
+
+        * Scripts/webkitpy/queueengine.py: Removed.
+        * Scripts/webkitpy/queueengine_unittest.py: Removed.
+        * Scripts/webkitpy/tool/bot/queueengine.py: Copied from Scripts/webkitpy/queueengine.py.
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py: Copied from Scripts/webkitpy/queueengine_unittest.py.
+        * Scripts/webkitpy/tool/commands/early_warning_system.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Move patchcollection.py to its new home.
+
+        * Scripts/webkitpy/patchcollection.py: Removed.
+        * Scripts/webkitpy/patchcollection_unittest.py: Removed.
+        * Scripts/webkitpy/tool/bot: Added.
+        * Scripts/webkitpy/tool/bot/__init__.py: Added.
+        * Scripts/webkitpy/tool/bot/patchcollection.py: Copied from WebKitTools/Scripts/webkitpy/patchcollection.py.
+        * Scripts/webkitpy/tool/bot/patchcollection_unittest.py: Copied from WebKitTools/Scripts/webkitpy/patchcollection_unittest.py.
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-24  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In Scripts/webkitpy, moved steps_references.py and the steps
+        folder into webkitpy/patch.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36093
+
+        * Scripts/webkitpy/steps: Removed.
+        * Scripts/webkitpy/steps/__init__.py: Removed.
+        * Scripts/webkitpy/steps/abstractstep.py: Removed.
+        * Scripts/webkitpy/steps/applypatch.py: Removed.
+        * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: Removed.
+        * Scripts/webkitpy/steps/build.py: Removed.
+        * Scripts/webkitpy/steps/checkstyle.py: Removed.
+        * Scripts/webkitpy/steps/cleanworkingdirectory.py: Removed.
+        * Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py: Removed.
+        * Scripts/webkitpy/steps/closebug.py: Removed.
+        * Scripts/webkitpy/steps/closebugforlanddiff.py: Removed.
+        * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py: Removed.
+        * Scripts/webkitpy/steps/closepatch.py: Removed.
+        * Scripts/webkitpy/steps/commit.py: Removed.
+        * Scripts/webkitpy/steps/confirmdiff.py: Removed.
+        * Scripts/webkitpy/steps/createbug.py: Removed.
+        * Scripts/webkitpy/steps/editchangelog.py: Removed.
+        * Scripts/webkitpy/steps/ensurebuildersaregreen.py: Removed.
+        * Scripts/webkitpy/steps/ensurelocalcommitifneeded.py: Removed.
+        * Scripts/webkitpy/steps/metastep.py: Removed.
+        * Scripts/webkitpy/steps/obsoletepatches.py: Removed.
+        * Scripts/webkitpy/steps/options.py: Removed.
+        * Scripts/webkitpy/steps/postdiff.py: Removed.
+        * Scripts/webkitpy/steps/postdiffforcommit.py: Removed.
+        * Scripts/webkitpy/steps/postdiffforrevert.py: Removed.
+        * Scripts/webkitpy/steps/preparechangelog.py: Removed.
+        * Scripts/webkitpy/steps/preparechangelogforrevert.py: Removed.
+        * Scripts/webkitpy/steps/promptforbugortitle.py: Removed.
+        * Scripts/webkitpy/steps/reopenbugafterrollout.py: Removed.
+        * Scripts/webkitpy/steps/revertrevision.py: Removed.
+        * Scripts/webkitpy/steps/runtests.py: Removed.
+        * Scripts/webkitpy/steps/steps_unittest.py: Removed.
+        * Scripts/webkitpy/steps/update.py: Removed.
+        * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py: Removed.
+        * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: Removed.
+        * Scripts/webkitpy/steps/validatereviewer.py: Removed.
+        * Scripts/webkitpy/steps_references.py: Removed.
+        * Scripts/webkitpy/stepsequence.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/steps: Copied from WebKitTools/Scripts/webkitpy/steps.
+        * Scripts/webkitpy/tool/steps/__init__.py:
+        * Scripts/webkitpy/tool/steps/applypatch.py:
+        * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+        * Scripts/webkitpy/tool/steps/build.py:
+        * Scripts/webkitpy/tool/steps/checkstyle.py:
+        * Scripts/webkitpy/tool/steps/cleanworkingdirectory.py:
+        * Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py:
+        * Scripts/webkitpy/tool/steps/closebug.py:
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+        * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/tool/steps/closepatch.py:
+        * Scripts/webkitpy/tool/steps/commit.py:
+        * Scripts/webkitpy/tool/steps/confirmdiff.py:
+        * Scripts/webkitpy/tool/steps/createbug.py:
+        * Scripts/webkitpy/tool/steps/editchangelog.py:
+        * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
+        * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py:
+        * Scripts/webkitpy/tool/steps/metastep.py:
+        * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+        * Scripts/webkitpy/tool/steps/postdiff.py:
+        * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+        * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+        * Scripts/webkitpy/tool/steps/promptforbugortitle.py:
+        * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+        * Scripts/webkitpy/tool/steps/revertrevision.py:
+        * Scripts/webkitpy/tool/steps/runtests.py:
+        * Scripts/webkitpy/tool/steps/steps_unittest.py:
+        * Scripts/webkitpy/tool/steps/update.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+        * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+        * Scripts/webkitpy/tool/steps/validatereviewer.py:
+        * Scripts/webkitpy/tool/steps_references.py: Copied from WebKitTools/Scripts/webkitpy/steps_references.py.
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-24  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, build fix only.
+
+        Abstract LayoutTestResults logic for easier reuse
+        https://bugs.webkit.org/show_bug.cgi?id=36579
+
+        * Scripts/webkitpy/buildbot_unittest.py: Add a missing import.
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.  Fix a stray comma to test landing an patch without review.
+
+        * Scripts/webkitpy/commitinfo.py:
+
+2010-03-24  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        In Scripts/webkitpy, moved commands_references.py and the commands
+        folder into webkitpy/patch.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36483
+
+        This is part of master bug 36093 to organize webkitpy.
+
+        * Scripts/webkitpy/commands: Removed.
+        * Scripts/webkitpy/commands/__init__.py: Removed.
+        * Scripts/webkitpy/commands/abstractsequencedcommand.py: Removed.
+        * Scripts/webkitpy/commands/commandtest.py: Removed.
+        * Scripts/webkitpy/commands/download.py: Removed.
+        * Scripts/webkitpy/commands/download_unittest.py: Removed.
+        * Scripts/webkitpy/commands/early_warning_system.py: Removed.
+        * Scripts/webkitpy/commands/early_warning_system_unittest.py: Removed.
+        * Scripts/webkitpy/commands/openbugs.py: Removed.
+        * Scripts/webkitpy/commands/openbugs_unittest.py: Removed.
+        * Scripts/webkitpy/commands/queries.py: Removed.
+        * Scripts/webkitpy/commands/queries_unittest.py: Removed.
+        * Scripts/webkitpy/commands/queues.py: Removed.
+        * Scripts/webkitpy/commands/queues_unittest.py: Removed.
+        * Scripts/webkitpy/commands/queuestest.py: Removed.
+        * Scripts/webkitpy/commands/sheriffbot.py: Removed.
+        * Scripts/webkitpy/commands/sheriffbot_unittest.py: Removed.
+        * Scripts/webkitpy/commands/upload.py: Removed.
+        * Scripts/webkitpy/commands/upload_unittest.py: Removed.
+        * Scripts/webkitpy/commands_references.py: Removed.
+        * Scripts/webkitpy/tool/commands: Copied from WebKitTools/Scripts/webkitpy/commands.
+        * Scripts/webkitpy/tool/commands/commandtest.py:
+        * Scripts/webkitpy/tool/commands/download.py:
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/early_warning_system.py:
+        * Scripts/webkitpy/tool/commands/early_warning_system_unittest.py:
+        * Scripts/webkitpy/tool/commands/openbugs_unittest.py:
+        * Scripts/webkitpy/tool/commands/queries_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/commands_references.py: Copied from WebKitTools/Scripts/webkitpy/commands_references.py.
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Rename webkitpy.patch to webkitpy.tool
+        https://bugs.webkit.org/show_bug.cgi?id=36580
+
+        This is in preparation for the great webkitpy naming cleanup.
+
+        * Scripts/webkit-patch:
+        * Scripts/webkitpy/patch: Removed.
+        * Scripts/webkitpy/patch/__init__.py: Removed.
+        * Scripts/webkitpy/patch/patcher.py: Removed.
+        * Scripts/webkitpy/tool: Copied from WebKitTools/Scripts/webkitpy/patch.
+        * Scripts/webkitpy/tool/main.py: Copied from WebKitTools/Scripts/webkitpy/patch/patcher.py.
+        * Scripts/webkitpy/tool/patcher.py: Removed.
+
+2010-03-24  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Abstract LayoutTestResults logic for easier reuse
+        https://bugs.webkit.org/show_bug.cgi?id=36579
+
+        * Scripts/webkitpy/buildbot.py:
+         - Split out logic into new LayoutTestResults class.
+        * Scripts/webkitpy/buildbot_unittest.py:
+         - Rename the testing class to match.
+        * Scripts/webkitpy/commands/queries.py:
+         - Use the new LayoutTestResults class.
+
+2010-03-24  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move Bugzilla.prompt_for_component to User.prompt_with_list for re-use
+        https://bugs.webkit.org/show_bug.cgi?id=36577
+
+        * Scripts/webkitpy/bugzilla.py:
+         - Move prompt_for_component to User
+        * Scripts/webkitpy/commands/queries.py:
+         - Add a missing argument_names declaration.
+        * Scripts/webkitpy/user.py:
+         - Add prompt_with_list
+         - Make staticmethods classmethods for easier mocking
+
+2010-03-24  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36572> commit-log-editor: thinks mergeChangeLogs.pl is a ChangeLog file
+
+        Reviewed by Eric Seidel.
+
+        Fixes the following error when committing a file with
+        "ChangeLog" in the name that isn't a ChangeLog (like
+        mergeChangeLogs.pl from r56471 and r56472):
+
+            $ git commit .
+            Can't open WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLog at commit-log-editor line 132.
+            error: There was a problem with the editor 'commit-log-editor'.
+            Please supply the message using either -m or -F option.
+
+        * Scripts/commit-log-editor: Added '$' to anchor "ChangeLog" to
+        the end of the file name when searching for ChangeLog files in a
+        commit.
+
+2010-03-24  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36570> resolve-ChangeLogs: fall back to git-merge-file if ChangeLog can't be merged
+
+        Reviewed by Eric Seidel.
+
+        * Scripts/resolve-ChangeLogs: Switched to exec git-merge-file if
+        the merge attempt fails.
+
+2010-03-24  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        webkit-patch or pre-commit hook should validate reviewer lines before committing
+        https://bugs.webkit.org/show_bug.cgi?id=26927
+
+        Validate that patches have valid reivewers listed in their ChangeLogs
+        before landing.  For patches without reviewers can be landed if their
+        ChangeLogs state that they are unreviewed.
+
+        * Scripts/webkitpy/changelogs.py:
+        * Scripts/webkitpy/commands/download.py:
+        * Scripts/webkitpy/commitinfo.py:
+        * Scripts/webkitpy/commitinfo_unittest.py:
+        * Scripts/webkitpy/mock_bugzillatool.py:
+        * Scripts/webkitpy/steps/__init__.py:
+        * Scripts/webkitpy/steps/validatereviewer.py: Added.
+
+2010-03-19  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by David Levin.
+
+        Undefined names reported by pyflakes in python scripts
+        https://bugs.webkit.org/show_bug.cgi?id=36403
+
+        Attempt to use names that exist or can exist in the lexical
+        scope instead of not being available at all.
+
+        * Scripts/webkitpy/changelogs.py: Use self._content.
+        * Scripts/webkitpy/layout_tests/port/base.py: Use os.stat
+        * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Use self._port
+        * Scripts/webkitpy/style/processors/cpp_unittest.py: Use expected_message_re
+
+2010-03-24  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36560> resolve-ChangeLogs: git-rebase fails when resolve-ChangeLogs can't merge
+
+        Reviewed by Eric Seidel.
+
+        When resolve-ChangeLogs fails to merge a patch while running as
+        a git merge driver, it deletes the original file, which causes
+        an internal failure and stops git mid-merge:
+
+            fatal: Failed to execute internal merge
+
+        The fix is to use the --force switch with patch so that it will
+        always attempt to apply the patch.  (The change in
+        mergeChangeLogs() for the previous commit also fixed this, but
+        adding --force also prevents any potential user interaction that
+        patch may want to display.)
+
+        * Scripts/VCSUtils.pm:
+        (mergeChangeLogs): Added --force switch to patch command.  Also
+        changed to use the exit status from the patch command to
+        determine the return value for this method.
+        * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: Added
+        test to cover this bug.
+
+2010-03-24  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/36560> resolve-ChangeLogs: move mergeChanges() into VCSUtils package
+
+        Reviewed by Eric Seidel.
+
+        * Scripts/VCSUtils.pm:
+        (mergeChangeLogs): Copied from mergeChanges() in
+        resolve-ChangeLogs and renamed.  Added method documentation.
+        Fixed bug found by new tests where the original file to be
+        patched was deleted when cleaning up after a traditinal rejected
+        patch failed to apply.
+        * Scripts/resolve-ChangeLogs: Switched to using
+        mergeChangeLogs().
+        (mergeChanges): Moved to VCSUtils.pm and renamed to
+        mergeChangeLogs().
+        * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: Added.
+
+2010-03-24  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add support for qt's unassigned list to webkit-patch assign-to-committer
+        https://bugs.webkit.org/show_bug.cgi?id=36559
+
+        * Scripts/webkitpy/bugzilla.py:
+         - Move Bugzilla.unassigned_email into Bug and make it a set.
+        * Scripts/webkitpy/bugzilla_unittest.py:
+         - Test the new Bug.is_unassigned method
+        * Scripts/webkitpy/commands/upload.py:
+         - Use the new Bug.is_unassigned method instead of an explicit ==
+        * Scripts/webkitpy/mock_bugzillatool.py:
+         - Bugzilla.unassigned_email no longer needs mocking
+
+2010-03-24  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Rename QWebSettings::XSSAuditorEnabled to XSSAuditingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=36522
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setXSSAuditorEnabled): Use the new name.
+
+2010-03-24  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Added to check-webkit-style support for a --debug flag.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36100
+
+        The --debug flag adjusts the logging level to DEBUG and
+        includes the logger name and level in each log message.
+
+        * Scripts/check-webkit-style:
+          - Changed the code to check for the --debug flag and pass
+            the result to the configure_logging() method.
+        * Scripts/webkitpy/style/checker.py:
+          - Added an is_debug parameter to configure_logging().
+          - Refactored configure_logging() by adding calls to
+            the following two methods: _create_log_handlers() and
+            _create_debug_log_handlers().
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Added unit tests for configure_logging() with is_debug True
+            by splitting the ConfigureLoggingTest class into
+            ConfigureLoggingTest and ConfigureLoggingTestBase, and
+            adding ConfigureLoggingDebugTest.
+        * Scripts/webkitpy/style/optparser.py:
+          - Updated the usage string.
+          - Added an is_debug data attribute to the CommandOptionValues
+            class.
+          - Added support for the --debug flag to the ArgumentParser.parse()
+            method.
+          - Also added extra error information to the parse() method in
+            the case of an invalid flag.
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Updated the unit tests as necessary.
+          - Also fixed an issue with the CommandOptionValuesTest.test_eq()
+            unit test.
+
+2010-03-23  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add TestNavigationController and TestWebWorker
+        https://bugs.webkit.org/show_bug.cgi?id=36489
+
+        Add TestNavigationController and TestWebWorker classes, which are
+        going to be used by DumpRenderTree Chromium port. These files are
+        based on:
+        - src/webkit/tools/test_shell/test_navigation_controller.{cc,h}
+        - src/webkit/tools/test_shell/test_web_worker.h
+        of Chromium rev.40492.
+
+        TestNavigationController has non-style changes.
+        - Change ContentState type: binary string -> WebHistoryItem
+        - Remove TestShell dependency by introducing NavigationHost interface.
+
+        * DumpRenderTree/chromium/TestNavigationController.cpp: Added.
+        * DumpRenderTree/chromium/TestNavigationController.h: Added.
+        * DumpRenderTree/chromium/TestWebWorker.h: Added.
+
+2010-03-23  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add support for revision -> build lookup in buildbot.py and layout test result parsing
+        https://bugs.webkit.org/show_bug.cgi?id=36474
+
+        * Scripts/webkitpy/bugzilla_unittest.py: Added a FIXME about sharing code.
+        * Scripts/webkitpy/buildbot.py: 
+         - Add support for looking up builds by revision number.
+         - Add support for fetching and parsing results.html files from buildbot.
+         - build_for_revision has an allow_failed_lookups option to work around the fact that
+           our buildbot's xmlrpc calls return failure on old revision numbers.
+         - Add parsing support for twisted directory listings.
+        * Scripts/webkitpy/buildbot_unittest.py:
+         - Unit test all the new code.
+        * Scripts/webkitpy/commands/queries.py:
+         - Add a new results-for command which prints all the results for a given revision (very slow due to slow revision lookup)
+
+2010-03-23  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Adam Roben.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36048
+
+        Detect if the Windows Platform SDK is missing when building with
+        Visual C++ Express Edition and inform the user to download it.
+
+        * Scripts/webkitdirs.pm:
+
+2010-03-23  Darin Adler  <darin@apple.com>
+
+        Tell Subversion about more directories that expect to have .pyc files.
+
+        * Scripts/webkitpy: Modified property svn:ignore.
+        * Scripts/webkitpy/irc: Added property svn:ignore.
+
+2010-03-23  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36149
+
+        Import the GNU readline interface to modify the behavior
+        of raw_input so as to provide line editing support. In
+        particular this will prevent "delete" characters from
+        appearing in the returned value for function raw_input.
+
+        * Scripts/webkitpy/user.py:
+
+2010-03-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove support for Qt v4.4
+        https://bugs.webkit.org/show_bug.cgi?id=36389
+
+        * DumpRenderTree/qt/main.cpp:
+        (main):
+        * QtLauncher/mainwindow.cpp:
+        (MainWindow::MainWindow):
+
+2010-03-22  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Make build_webkit_command() pass MAKEFLAGS environment variable to make.
+        https://bugs.webkit.org/show_bug.cgi?id=36440
+
+        * Scripts/webkitpy/webkitport.py:
+        * Scripts/webkitpy/webkitport_unittest.py:
+
+2010-03-22  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Change baseline_path() to point to the upstream locations for the
+        Chromium ports. Also change the reabselining scripts to use the
+        correct functions to get the baseline directories, and fix the
+        script's sys.path to pull in simplejson correctly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36417
+
+        * Scripts/rebaseline-chromium-webkit-tests:
+          - fix sys.path to pick up simplejson properly
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+          - change baseline_path() to use webkit_baseline_path()
+          - error out correctly if we can't find the chromium base dir
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+          - call baseline_path(), not chromium_baseline_path()
+
+2010-03-22  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Refactored the cpu_count() code in executive.py.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36437
+
+        * Scripts/webkitpy/executive.py:
+          - Moved the import of the multiprocessing module to the top
+            of the file rather than importing from within a function.
+
+2010-03-22 Antonio Gomes <tonikitoo@webkit.org>
+
+        Unreviewed.
+
+        Rolling out r56183: http://trac.webkit.org/changeset/56183
+
+        https://bugs.webkit.org/show_bug.cgi?id=36244
+
+        Need to roll out because this patch will be re-worked by the author
+        and other reviewers agreed on it.
+
+2010-03-22  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Created a function for getting a module-specific logging.logger
+        based on the __file__ value of the module.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35821
+
+        This function allows us to get the module-specific logger for
+        a module without having to hard-code the fully-qualified name
+        of the module in the module itself.  The code can be the same
+        in every case: "_log = logutils.get_logger(__file__)".
+
+        * Scripts/webkitpy/init/logutils.py: Added.
+          - Added a module with a get_logger() function to return
+            a module-specific logger based on the module's __file__
+            variable.
+
+        * Scripts/webkitpy/init/logutils_unittest.py: Added.
+          - Added unit tests for logutils.py.
+
+        * Scripts/webkitpy/init/unittests.py:
+          - Added logutils_unittest to the list of imports.
+
+2010-03-22  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] REGRESSION (r56209): fast/media/print-restores-previous-mediatype.htm crashes
+        https://bugs.webkit.org/show_bug.cgi?id=36386
+
+        Fix the regression by implementing a null printer for Qt DRT.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::NullPrinter::NullPaintEngine::begin):
+        (WebCore::NullPrinter::NullPaintEngine::end):
+        (WebCore::NullPrinter::NullPaintEngine::type):
+        (WebCore::NullPrinter::NullPaintEngine::drawPixmap):
+        (WebCore::NullPrinter::NullPaintEngine::updateState):
+        (WebCore::NullPrinter::paintEngine):
+        (WebCore::DumpRenderTree::dryRunPrint):
+
+2010-03-20  Martin Robinson  <mrobinson@webkit.org>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] eventSender.zoomPageOut() bug?
+        https://bugs.webkit.org/show_bug.cgi?id=30575
+
+        Make zoomPage{In/Out}Callback respect the 1.2f zoom factor that DRT should be using.
+
+        * DumpRenderTree/gtk/EventSender.cpp:
+        (zoomIn): Added.
+        (zoomOut): Added.
+        (textZoomInCallback): Use zoomIn helper function.
+        (textZoomOutCallback): Use zoomOut helper function.
+        (zoomPageInCallback): Use zoomIn helper function, which respects zoom factor.
+        (zoomPageOutCallback): Use zoomOut helper function, which respects zoom factor.
+
+2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fix after recent database API change.
+
+        * wx/browser/browser.cpp:
+        (MyApp::OnInit):
+
+2010-03-20  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Renamed UnitTestLogStream to TestLogStream in webkitpy.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36099
+
+        TestLogStream is more concise and more consistent with the name of
+        the module (logtesting rather than logunittesting) and its main
+        class (LogTesting rather than LogUnitTesting).
+
+        * Scripts/webkitpy/init/logtesting.py:
+          - Renamings.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Renamings.
+
+        * Scripts/webkitpy/style_references.py:
+          - Renamings.
+
+2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Build fixes for new method in LayoutTestController.
+
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setSpatialNavigationEnabled):
+        * wx/build/settings.py:
+
+2010-03-20  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Unreviewed, tool fix.
+
+        Remove vestiges of downstream directory names to unbreak rebaselining tool.
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py: Changed paths to use WebKit repo.
+
+2010-03-20  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Re-enable the downstream test_expectations overrides file that was
+        disabled in bug 36396 / r56287.
+
+        https://bugs.chromium.org/show_bug.cgi?id=36401
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Disable the downstream override expectations temporarily to allow
+        us to test that we've upstreamed everything correctly. Also, stop
+        looking at the downstream baselines at all (now you will only be
+        able to update baselines upstream). In theory this should work, but
+        if we need to we can always add the downstream dirs back in.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36396
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-03-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        fix typo in chromium test expectations overrides routine
+        https://bugs.webkit.org/show_bug.cgi?id=36397
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Flip the Chromium ports to look first for the test expectations
+        in LayoutTests/platform/chromium and only afterwards look in the
+        Chromium repo downstream for overrides.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36326
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19  James Hawkins  <jhawkins@chromium.org>
+
+        Unreviewed.
+
+        Add myself to the committers list.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Fix SheriffBot exception lock when we can't retrieve the first build
+        from buildbot.  (I'll ask Eric to review this change after the fact,
+        but he's at lunch and I want to get the bot unlocked.)
+
+        * Scripts/webkitpy/buildbot.py:
+        * Scripts/webkitpy/buildbot_unittest.py:
+
+2010-03-19  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36380
+        websocket/tests/frame-lengths.html times out on Tiger bot
+
+        https://bugs.webkit.org/show_bug.cgi?id=35041
+        websocket/tests/frame-lengths.html / websocket/tests/simple-stress.html fail on Windows bot
+
+        Double the timeout (from 15 seconds to 30 seconds). We can increase it more, if necessary -
+        sampling the DRT process on Mac OS X takes much longer anyway, so it's better to avoid
+        timing out than to detect it early.
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setWaitToDump):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::waitUntilDone):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        * Scripts/run-webkit-tests:
+
+2010-03-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Unreviewed.
+
+        Buildfix for Qt v4.5.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::applyZoom):
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Operational tweaks to SheriffBot
+        https://bugs.webkit.org/show_bug.cgi?id=36385
+
+        These changes aren't pretty, but they're helpful to make SheriffBot
+        work operationally.  I plan to iterate in these areas, but I wanted to
+        get this patch landed so I could be running the bot against TOT.
+
+        * Scripts/webkitpy/commands/sheriffbot.py:
+        * Scripts/webkitpy/irc/ircbot.py:
+        * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+
+2010-03-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Help sheriff-bot avoid warning about flaky tests (and add more unit testing)
+        https://bugs.webkit.org/show_bug.cgi?id=36354
+
+        * Scripts/webkitpy/buildbot.py:
+         - Make Build creation easier to Mock and test
+        * Scripts/webkitpy/buildbot_unittest.py:
+         - Test finding green to red transitions and suspect revisions
+        * Scripts/webkitpy/commands/queries.py:
+         - Make what-broke note when builders have only failed once.
+
+2010-03-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix the rebaselining tool, which was broken by r36324 when I
+        added the concept of overridding expectations.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36374
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Misc bug fixes to make the SheriffBot actually work
+        https://bugs.webkit.org/show_bug.cgi?id=36355
+
+        With these changes, I can actually run the sheriff-bot from start to
+        finish.
+
+        * Scripts/webkitpy/irc/ircproxy.py:
+        * Scripts/webkitpy/patch/patcher.py:
+        * Scripts/webkitpy/statusserver.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Actually import the sheriff-bot command so we can run it.  Also, move
+        the bot to #webkit-test so it doesn't cause a ruckus while we test it.
+
+        * Scripts/webkitpy/patch/patcher.py:
+        * Scripts/webkitpy/irc/ircbot.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Second cut at SheriffBot
+        https://bugs.webkit.org/show_bug.cgi?id=36353
+
+        This patch should contain a complete SheriffBot that's capable of
+        saying reasonable things on IRC.  I had to refactor the use of
+        CommitInfo to make the SheriffBot testable, but I did the minimum
+        necessary.  We should grow webkitcheckout over time to contain the
+        knowledge of ChangeLogs from scm.
+
+        * Scripts/webkitpy/commands/sheriffbot.py:
+        * Scripts/webkitpy/commands/sheriffbot_unittest.py:
+        * Scripts/webkitpy/mock_bugzillatool.py:
+        * Scripts/webkitpy/patch/patcher.py:
+        * Scripts/webkitpy/webkitcheckout.py: Added.
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Fix Hyatt's IRC nickname.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Add IRC nicknames for the non-reviewer committers.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        More reviewer IRC nicknames.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Add a bunch of IRC nicknames for reviewers.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-19  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Oliver Hunt.
+
+        Added USE_SYSTEM_MALLOC flag to build-webkit
+        https://bugs.webkit.org/show_bug.cgi?id=21272
+
+        Add system-alloc flag to build-webkit. It makes easy to switch
+        between system allocator and TCmalloc.
+
+        * Scripts/build-webkit:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed "build" fix.
+
+        Of course, I caused a regression in the file that isn't tested.  :(
+
+        * Scripts/webkitpy/statusserver.py:
+
+2010-03-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add basic "who-broke-it" command and revision -> broken builder association code
+        https://bugs.webkit.org/show_bug.cgi?id=36352
+
+        The "what-broke" command prints builders and what revisions we suspect
+        broke them.  who-broke-it prints revisions and what builders we suspect
+        they broke.  The sheriff-bot needs this revision to broken builder mapping
+        so this change adds it!
+
+        * Scripts/webkitpy/buildbot.py:
+        * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Simplify BuildBot core builder code for easier re-use
+        https://bugs.webkit.org/show_bug.cgi?id=36350
+
+        I simply couldn't see anything through all this Yak-hair.
+
+        * Scripts/webkitpy/buildbot.py:
+        * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        committers.py should know IRC nicknames
+        https://bugs.webkit.org/show_bug.cgi?id=36349
+
+        I'll add the actual nicknames in another patch.
+
+        * Scripts/webkitpy/committers.py:
+        * Scripts/webkitpy/committers_unittest.py:
+
+2010-03-18  Anders Bakken  <agbakken@gmail.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36318
+
+        QtLauncher runs as a GuiClient by default in Qt Embedded which will
+        make it try to connect to an existing GuiServer. This patch makes it
+        run like a stand-alone app.
+
+        * QtLauncher/main.cpp:
+        (LauncherApplication::LauncherApplication):
+
+2010-03-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Move find_green_to_red_transition out of "what-broke" onto Builder for easier re-use
+        https://bugs.webkit.org/show_bug.cgi?id=36345
+
+        * Scripts/webkitpy/buildbot.py:
+        * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Actually pass the IRC password to the IRC object
+        https://bugs.webkit.org/show_bug.cgi?id=36346
+
+        I wanted to do this before, but both patches were in flight.  This
+        patch finally closes the loop and makes the IRCProxy system complete.
+
+        * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-18  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add a StatusServer front end to the SVNRevision table on QueueStatusServer
+        https://bugs.webkit.org/show_bug.cgi?id=36344
+
+        No test because Browser was too hard to mock.  :(  I couldn't figure
+        out how to make Mock be a dictionary as well as an object.
+
+        * Scripts/webkitpy/statusserver.py:
+
+2010-03-18  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Split out CommitInfo class and add unit tests
+        https://bugs.webkit.org/show_bug.cgi?id=36343
+
+        Move more logic out of "what-broke" into a shared CommitInfo
+        class so that it can be used by other commands and unit tested.
+
+        * Scripts/webkitpy/commands/queries.py:
+        * Scripts/webkitpy/commitinfo.py: Added.
+        * Scripts/webkitpy/commitinfo_unittest.py: Added.
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Fix LayoutTests/http/tests/appcache/max-size.html
+        https://bugs.webkit.org/show_bug.cgi?id=36207
+
+        Implement setAppCacheMaximumSize() for Qt.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setAppCacheMaximumSize):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-18  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        QueueStatusServer should be able to log broken bots
+        https://bugs.webkit.org/show_bug.cgi?id=36341
+
+        We need to add a new table to the QueueStatusServer to store persistent
+        information for the SheriffBot.  The new table will keep track of which
+        bots each SVN revision broke.
+
+        * QueueStatusServer/handlers/__init__.py:
+        * QueueStatusServer/handlers/svnrevision.py: Added.
+        * QueueStatusServer/handlers/updatebase.py: Added.
+        * QueueStatusServer/handlers/updatestatus.py:
+        * QueueStatusServer/handlers/updatesvnrevision.py: Added.
+        * QueueStatusServer/index.yaml:
+        * QueueStatusServer/main.py:
+        * QueueStatusServer/model/__init__.py:
+        * QueueStatusServer/model/svnrevision.py: Added.
+        * QueueStatusServer/templates/updatesvnrevision.html: Added.
+
+2010-03-18  Kenneth Rohde Christiansen  <kenneth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add a new method to the Qt LayoutTestController for
+        changing media type and make the DRT support dry-run printing.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::dryRunPrint):
+        * DumpRenderTree/qt/DumpRenderTreeQt.h:
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setMediaType):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-18  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add upstream LayoutTests/platform/chromium* directories to the
+        baseline search path for new-run-webkit-tests in preparation for
+        upstreaming all of the Chromium baselines. Note that this does
+        not actually create the directories themselves, but that's okay.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36324
+
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-03-18  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36327
+        Test that a plug-in can override Node methods of its element
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (normalizeOverride):
+        (pluginInvoke):
+        Override "normalize", and call back to let a test know that the plug-in was called.
+
+2010-03-17  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add the concept of an "overrides" file for expectations so that we
+        can store test_expectations both upstream and downstream for a port
+        that runs both in webkit.org and in a separate repository (like
+        Chromium). Also add some unit tests for the expectations module.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36249
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py: Added.
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-18  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add an overlay QGraphicsTextItem to QtLauncher so we can display FPS info
+        on the launcher and not on the terminal anymore.
+
+        [Qt] QtLauncher's FPS info should be displayed on an overlay text item
+        https://bugs.webkit.org/show_bug.cgi?id=36244
+
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::WebViewGraphicsBased):
+        (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+        (WebViewGraphicsBased::updateFrameRate):
+        * QtLauncher/webview.h:
+
+2010-03-18  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        First cut at SheriffBot
+        https://bugs.webkit.org/show_bug.cgi?id=36253
+
+        This patch contains a first attempt at writing a sheriff bot.
+        Currently, we're missing the logic that actually finds the SVN revision
+        numbers to complain about, but once we have that, we'll have the rest
+        of the infrustructure to ping IRC and to file bugs.
+
+        There's a lot to fill in for the SheriffBot, but this patch give us the
+        framework in which to do it.
+
+        This patch required a bit of refactoring of AbstractQueue because
+        SheriffBot is the first bot that doesn't process patches (it processes
+        SVN revisions).  Accordingly, I've factored out AbstractPatchQueue to
+        hold the parts of AbstractQueue that are specific to dealing with
+        patches.  Some of the choices here might not be obvious yet, but we can
+        tweak them as our needs become clearer.
+
+        * Scripts/webkitpy/commands/queues.py:
+        * Scripts/webkitpy/commands/queues_unittest.py:
+        * Scripts/webkitpy/commands/sheriffbot.py: Added.
+        * Scripts/webkitpy/commands/sheriffbot_unittest.py: Added.
+        * Scripts/webkitpy/mock_bugzillatool.py:
+            Added a MockIRC object to the mock tool.
+        * Scripts/webkitpy/multicommandtool.py:
+            Added a finalize method so the tool can disconnect from IRC
+            cleanly instead of just droping the socket.
+        * Scripts/webkitpy/multicommandtool_unittest.py:
+        * Scripts/webkitpy/patch/patcher.py:
+            Added support for talking to IRC.
+        * Scripts/webkitpy/unittests.py:
+            We should add a commands/unittests.py file at some point to make
+            the commands module more self-contained.
+
+2010-03-18  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36102
+        [Qt] Scaling control API for tiled backing store
+        
+        Add animated smooth zooming to Qt launcher when in tiled mode.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::zoomAnimationFinished):
+        (LauncherWindow::applyZoom):
+        (LauncherWindow::zoomIn):
+        (LauncherWindow::zoomOut):
+        * QtLauncher/webview.h:
+        (WebViewGraphicsBased::graphicsWebView):
+
+2010-03-18  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Support using IRC accounts with a password
+        https://bugs.webkit.org/show_bug.cgi?id=36287
+
+        Add a global option to specify an IRC password so we can use the
+        sheriffbot account (which needs a password).
+
+        * Scripts/webkitpy/irc/ircbot.py:
+        * Scripts/webkitpy/irc/ircproxy.py:
+        * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-18  Eric Seidel  <eric@webkit.org>
+
+        Just fixing missing parenthesis typo, no review.
+
+        * Scripts/webkitpy/commands/queries.py: '%' has higher precedence than 'or', use parentheses.
+
+2010-03-18  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Adam Roben and Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36210
+        plugins/resize-from-plugin.html fails on some platforms
+
+        Turns out that most platforms don't use "cross-platform" main.cpp. Copied code added for
+        the test to their versions of the file.
+
+        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+        (webkit_test_plugin_set_window):
+        * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+        (NPP_SetWindow):
+
+2010-03-18  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add support to run-launcher to open the EFL example browser.
+        http://webkit.org/b/36181
+
+        * Scripts/webkitdirs.pm:
+        * Scripts/run-launcher:
+
+2010-03-18  Sergio Villar Senin  <svillar@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Failing tests http/tests/misc/image-blocked-src-change.html
+        & http/tests/misc/image-blocked-src-no-change.html
+        https://bugs.webkit.org/show_bug.cgi?id=36227
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewConsoleMessage): print only the file name instead of the
+        whole URI when printing messages with local URI's
+
+2010-03-18  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Teach what-broke how to look up reviewer and author Committer objects by name
+        https://bugs.webkit.org/show_bug.cgi?id=36264
+
+        * Scripts/webkitpy/commands/queries.py:
+         - Add committer_by_name lookups for both reviewer and author
+         - Improve printing in the cases where lookups fail.
+        * Scripts/webkitpy/committers.py:
+         - Add committer_by_name
+        * Scripts/webkitpy/committers_unittest.py:
+         - Test committer_by_name
+
+2010-03-17  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        create-rollout should actually fill out the description
+        https://bugs.webkit.org/show_bug.cgi?id=36261
+
+        * Scripts/webkitpy/commands/download.py:
+            The % operator was applied to the wrong string.
+        * Scripts/webkitpy/commands/download_unittest.py:
+        * Scripts/webkitpy/commands/upload_unittest.py:
+        * Scripts/webkitpy/mock_bugzillatool.py:
+            Add support for seeing what we actually do with create_bug.
+
+2010-03-17  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Accelerated Compositing is now default on QtWebKit so the option
+        in QtLauncher must be true as default.
+
+        [Qt] QtLauncher's Accelerated Compositing option must be true as default
+        https://bugs.webkit.org/show_bug.cgi?id=36234
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::applyPrefs):
+        (LauncherWindow::toggleAcceleratedCompositing):
+        (LauncherApplication::handleUserOptions):
+
+2010-03-17  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Commit queue should ignore (probably red) builders when landing rollouts
+        https://bugs.webkit.org/show_bug.cgi?id=36169
+
+        When landing a rollout, the builders are probably red, so we need to
+        ignore them in the subprocess too.  Also, we might as well update the
+        working copy because we haven't validated anything about the current
+        revision prior to trying to land.
+
+        This change is testable, but it requires changing the mock executive to
+        log its arguments.  That will generate a lot of expectation changes, so
+        I'd like to do that in a separate patch.
+
+        * Scripts/webkitpy/commands/queues.py:
+
+2010-03-17  Chang Shu  <chang.shu@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36139
+        [Qt] Clean up cache each time DumpRenderTree starts. This behavior 
+        matches other platforms, such as mac and gtk.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+
+2010-03-17  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Turns out this needs to be a string.
+
+        * Scripts/webkitpy/bugzilla.py:
+
+2010-03-17  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add more infrastructure for sheriff-bot, including making what-broke more awesome
+        https://bugs.webkit.org/show_bug.cgi?id=36254
+
+        * Scripts/webkitpy/bugzilla.py:
+         - Made the various URL methods return None when passed None.
+        * Scripts/webkitpy/bugzilla_unittest.py:
+         - Test that the url methods work as expected.
+        * Scripts/webkitpy/buildbot.py:
+         - Add a static Build.build_url so that its possible to generate a build url without a Build object.
+         - Give users a URL in _fetch_xmlrpc_build_dictionary error message.
+        * Scripts/webkitpy/changelogs.py:
+         - Add a new ChangeLogEntry class to encapsulate entry-parsing logic.
+         - Add is_path_to_changelog to greatly simplify SCM.modified_changelogs code.
+         - Make ChangeLog.parse_latest_entry_from_file a public method.
+        * Scripts/webkitpy/changelogs_unittest.py:
+         - Add tests for new ChangeLog entry parsing.
+        * Scripts/webkitpy/commands/queries.py:
+         - Make "what-broke" not print "ok" builders, only failing ones.
+         - Print much more information on failing builders, including links and authorship/reviewer information.
+        * Scripts/webkitpy/commands/queues_unittest.py:
+         - Use a fake_checkout path since fixing the cwd (as part of fixing scm_unittests.py) was breaking tests.
+        * Scripts/webkitpy/mock_bugzillatool.py:
+         - Move MockSCM away from using os.getcwd() as that was fragile (and wrong).
+        * Scripts/webkitpy/patch/patcher.py:
+         - Remove code which was broken now that this file has moved.
+         - Code was also redundant now that SCM.find_checkout_root() exists.
+        * Scripts/webkitpy/scm.py:
+         - Greatly simplify modified_changelogs now that I understand list comprehensions.
+         - Expect ChangeLogEntry objects instead of raw strings.
+         - Add changed_files_for_revision, committer_email_for_revision and contents_at_revision
+         - Add commit_with_message argument to all sites since someone half-added it before. :(
+         - Get rid of copy/paste code using _status_regexp()
+        * Scripts/webkitpy/scm_unittest.py:
+         - Fix these tests!
+         - Add new tests for new scm code.
+         - Fix spelling of "awsome" to "awesome".
+
+2010-03-17  Daniel Bates  <dbates@rim.com>
+
+        Rubber-stamped by David Levin.
+
+        Add myself to the list of reviewers.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-17  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Change post-rollout to create-rollout and have it make a new bug
+        instead of posting the rollout to the old bug.
+        https://bugs.webkit.org/show_bug.cgi?id=36250
+
+        The new bug blocks the old bug instead of adding more complexity to the
+        old bug.  One tricky question is whether to create the bug if we're
+        unable to create a rollout patch.  In this patch, we do create the bug,
+        but we might revist this question in the future.
+
+        * Scripts/webkitpy/bugzilla.py:
+        * Scripts/webkitpy/commands/download.py:
+        * Scripts/webkitpy/commands/download_unittest.py:
+        * Scripts/webkitpy/steps/createbug.py:
+
+2010-03-17  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add a way for the bots to send messages to IRC
+        https://bugs.webkit.org/show_bug.cgi?id=36235
+
+        We'll use these classes to notify #webkit about bad SVN revisions.
+        This patch just has some skeleton code for us to play with.
+
+        * Scripts/webkitpy/irc/__init__.py: Added.
+        * Scripts/webkitpy/irc/ircbot.py: Added.
+            A bot that knows how to talk to IRC.
+        * Scripts/webkitpy/irc/ircproxy.py: Added.
+            We need to run the bot on its own thread because the irclib needs
+            its own mainloop.  This class provides an abstraction of the
+            threading.
+        * Scripts/webkitpy/irc/messagepump.py: Added.
+        * Scripts/webkitpy/irc/messagepump_unittest.py: Added.
+        * Scripts/webkitpy/irc/threadedmessagequeue.py: Added.
+            A thread-safe message queue for sending messages from the main
+            thread to the IRC thread.
+        * Scripts/webkitpy/irc/threadedmessagequeue_unittest.py: Added.
+        * Scripts/webkitpy/irc/unittests.py: Added.
+        * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+            Autoinstall irclib
+        * Scripts/webkitpy/unittests.py:
+
+2010-03-17  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix image_diff syntax in webkitpy/port/base.py.
+        The syntax is wrong if diff_filename is specified.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36230
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-03-16  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Kenneth Christiansen.
+
+        Provide to QtLauncher a way to change the ViewportUpdateMode
+        when it's in graphics based mode.
+
+        [Qt] Make QtLaucher able to select the ViewportUpdateMode
+        https://bugs.webkit.org/show_bug.cgi?id=36175
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::selectViewportUpdateMode):
+        (LauncherWindow::createChrome):
+
+2010-03-17  Zoltan Horvath  <zoltan@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Ambiguous error message when building for unspecified platform
+        https://bugs.webkit.org/show_bug.cgi?id=30203
+
+        Add an extra line information to the error message.
+
+        * Scripts/webkitdirs.pm:
+
+2010-03-16  Adam Barth  <abarth@webkit.org>
+
+        No review, rolling out r56044.
+        http://trac.webkit.org/changeset/56044
+        https://bugs.webkit.org/show_bug.cgi?id=36048
+
+        This patch broke Windows Debug (Tests)
+
+        * Scripts/webkitdirs.pm:
+
+2010-03-16  John Abd-El-Malek  <jam@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Give keyboard focus to PluginDocuments by default
+        https://bugs.webkit.org/show_bug.cgi?id=36147
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (pluginAllocate):
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+        * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+        (NPP_New):
+        (NPP_SetWindow):
+        (handleEventCarbon):
+        (handleEventCocoa):
+
+2010-03-16  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Mark Rowe.
+
+        Fix run-webkit-httpd on Windows.
+
+        * Scripts/webkitperl/httpd.pm:
+
+2010-03-16  Alexey Proskuryakov  <ap@apple.com>
+
+        Tiger build fix.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginGetProperty):
+        Added more type casts to shut down warnings.
+
+2010-03-16  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36184
+        YouTube video resizing doesn't work with OOP plug-ins
+
+        Added a resizeTo() method, which calls resizePlugin() in JS with the same arguments,
+        and a lastSetWindowArguments property, which returns a string describing the last NPWindow
+        passed to NPN_SetWindow.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (pluginGetProperty):
+        (testResizeTo):
+        (pluginInvoke):
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+        * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+        (NPP_SetWindow):
+
+2010-03-16  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35504
+        [Gtk] Evaluate and fix AtkTable for layout tables
+
+        Implements rowCount and columnCount for Gtk in DRT.
+
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::rowCount):
+        (AccessibilityUIElement::columnCount):
+
+2010-03-15  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add "what-broke" command for debugging when the tree broke
+        https://bugs.webkit.org/show_bug.cgi?id=36157
+
+        This is another step towards automated sheriffing of the webkit tree.
+        With this logic our scripts are able to determine what revision broke the
+        tree.  Buildbot should do this for us, but unfortunately buildbot doesn't
+        expose this kind of aggregate information.
+
+        * Scripts/webkitpy/buildbot.py:
+         - Add new Builder and Build classes (which will eventually replace the custom dictionaries previously used).
+         - Split out more network logic into _fetch methods which will eventually be their own class for mocking.
+         - Use XMLRPC to communicate with the buildbot master instead of scraping build pages.
+        * Scripts/webkitpy/buildbot_unittest.py:
+         - Test the newly added buildbot classes.
+        * Scripts/webkitpy/commands/queries.py:
+         - Add an experimental what-broke command.
+
+2010-03-15  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36048
+
+        Detect if the Windows Platform SDK is missing when building with
+        Visual C++ Express Edition and inform the user to download it.
+
+        * Scripts/webkitdirs.pm:
+
+2010-03-15  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Let commit-queue land rollout patches even when the tree is red
+        https://bugs.webkit.org/show_bug.cgi?id=36155
+
+        Now the commit-queue will land patches whose name begins with "ROLLOUT "
+        even if the tree is red.  The patches still go through the usual build
+        and test process, but they can be landed while the tree is on fire.
+
+        * Scripts/webkitpy/bugzilla.py:
+        * Scripts/webkitpy/commands/queues.py:
+        * Scripts/webkitpy/commands/queues_unittest.py:
+        * Scripts/webkitpy/commands/queuestest.py:
+        * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-03-15  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add webkit-patch post-rollout to upload rollouts to bugs.webkit.org for easy committing
+        https://bugs.webkit.org/show_bug.cgi?id=36154
+
+        This new command is a mashup of prepare-rollout and post.  This command
+        will be used by an experimental bot to post rollouts of patches that
+        break things to bugs.webkit.org where they can be landed with the
+        greatest of ease.
+
+        * Scripts/webkitpy/commands/download.py:
+        * Scripts/webkitpy/commands/download_unittest.py:
+        * Scripts/webkitpy/steps/__init__.py:
+        * Scripts/webkitpy/steps/postdiffforrevert.py: Added.
+
+2010-03-15  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        webkit-patch rollout should error out on conflicts
+        https://bugs.webkit.org/show_bug.cgi?id=36151
+
+        Instead of blindingly plowing ahead, we now throw an exception if there
+        are conflicts after applying a reverse diff.
+
+        * Scripts/webkitpy/scm.py:
+
+2010-03-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Unreviewed layout test fix.
+
+        VO not able to perform a VO-spacebar on facebook links
+        https://bugs.webkit.org/show_bug.cgi?id=36132
+
+        GTK needs to implement press for this test to work.
+     
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::press):
+
+2010-03-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Unreviewed layout test fix.
+
+        VO not able to perform a VO-spacebar on facebook links
+        https://bugs.webkit.org/show_bug.cgi?id=36132
+
+        Windows needs to implement press in DRT.
+
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::press):
+
+2010-03-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Unreviewed. Fix break of layout tests on win and gtk.
+
+        VO not able to perform a VO-spacebar on facebook links
+        https://bugs.webkit.org/show_bug.cgi?id=36132
+
+        Attempting to implement press action for windows and gtk.
+
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::press):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::press):
+
+2010-03-15  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        VO not able to perform a VO-spacebar on facebook links
+        https://bugs.webkit.org/show_bug.cgi?id=36132
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (pressCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::press):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::press):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::press):
+
+2010-03-15  Mark Rowe  <mrowe@apple.com>
+
+        Add a new build slave to replace the existing SnowLeopard Leaks build slave which
+        appears to be suffering a slow and painful death at the hands of its graphics hardware.
+
+        * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2010-03-15  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix a minor case where we'd deference a null pointer if we tried
+        to run new-run-webkit-tests on an unsupported platform (e.g.
+        Cygwin's python version).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36076
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+
+2010-03-15  Darin Adler  <darin@apple.com>
+
+        Tell Subversion about more directories that expect to have .pyc files.
+
+        * Scripts/webkitpy/layout_tests: Added property svn:ignore.
+        * Scripts/webkitpy/layout_tests/port: Added property svn:ignore.
+
+2010-03-15  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Operational scripts from running the EWS
+        https://bugs.webkit.org/show_bug.cgi?id=36097
+
+        These are the scripts I use to manage the EWS on EC2.  If someone other
+        than me wants to run the EWS, these scripts might be helpful.
+
+        * EWSTools/boot.sh: Added.
+        * EWSTools/create-webkit-git: Added.
+        * EWSTools/screen-config: Added.
+        * EWSTools/start-queue.sh: Added.
+
+2010-03-14  Adam Barth  <abarth@webkit.org>
+
+        Unreviewed.
+
+        Fix the webkit-patch bots.  Turns out they need the path of the main
+        script to run properly.
+
+        * Scripts/webkit-patch:
+        * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-14  Darin Adler  <darin@apple.com>
+
+        Tell Subversion about more directories that expect to have .pyc files.
+
+        * Scripts/webkitpy/init: Added property svn:ignore.
+        * Scripts/webkitpy/patch: Added property svn:ignore.
+        * Scripts/webkitpy/thirdparty: Added property svn:ignore.
+        * Scripts/webkitpy/thirdparty/autoinstalled: Added property svn:ignore.
+
+2010-03-14  Antti Koivisto  <koivisto@iki.fi>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35146
+        Support tiled backing store
+
+        QtLauncher support and build flag in build-webkit.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::applyPrefs):
+        (LauncherWindow::toggleTiledBackingStore):
+        (LauncherWindow::toggleResizesToContents):
+        (LauncherWindow::createChrome):
+        (LauncherApplication::handleUserOptions):
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::WebViewGraphicsBased):
+        (WebViewGraphicsBased::setResizesToContents):
+        (WebViewGraphicsBased::resizeEvent):
+        * QtLauncher/webview.h:
+        * Scripts/build-webkit:
+
+2010-03-13  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        The webkit-patch script now displays a warning if run using
+        a version of Python less than 2.5.  This will help users
+        understand why webkit-patch is erroring out if they are
+        using Python 2.4, for example.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31533
+
+        * Scripts/webkit-patch:
+          - Moved most of the file contents to webkitpy/patch/patcher.py
+            so the Python version can be checked before interpreting
+            any code that can cause the script to error out.
+          - Added a configure_logging() method to enable any version
+            warnings to show up.
+          - Added a main() method with calls to configure_logging(),
+            check_version(), and the main webkit patch method.
+
+        * Scripts/webkitpy/patch/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+          - This file is required to make a folder a package.
+
+        * Scripts/webkitpy/patch/patcher.py: Added.
+          - Moved code from Scripts/webkit-patch.
+
+2010-03-13  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Changed test-webkitpy so that messages logged as a side-effect
+        of unit-testing code do not get displayed to the screen.  These
+        messages clutter up the unit test results if not filtered out.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35835
+
+        * Scripts/test-webkitpy:
+          - Adjusted the configure_logging() method to filter out any
+            log messages from webkitpy.
+          - Also added an INFO message stating that most console logging
+            is getting suppressed.
+
+        * Scripts/webkitpy/init/versioning.py:
+          - Added a log parameter to the check_version() method.
+
+        * Scripts/webkitpy/init/versioning_unittest.py:
+          - Qualified a call to check_version() with the parameter names.
+
+2010-03-13  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        The test-webkitpy script now warns the user if the script is
+        being run using a Python version different from the minimum
+        version the webkitpy package was meant to support.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35788
+
+        Warning developers if their Python version is too low will help
+        them understand why test-webkitpy is failing.  Secondly, warning
+        developers if their Python version is higher than the minimum will
+        help them understand that their changes may not be okay for the
+        minimum supported version, even if test-webkitpy is passing.
+
+        * Scripts/test-webkitpy:
+          - Moved the "from ..._unittest import *" lines to the new
+            file Scripts/webkitpy/unittests.py.  This will allow the
+            version-check warning to be displayed even if an error occurs
+            while interpreting (i.e. importing) the unit test code.
+          - Added configure_logging() to configur logging for test-webkitpy.
+          - Added an init() method to configure logging and check the
+            current Python version.
+
+        * Scripts/webkitpy/init/unittests.py: Added.
+          - Added a file to import all unit test modules in the
+            webkitpy.init package.
+
+        * Scripts/webkitpy/init/versioning.py: Added.
+          - Added a _MINIMUM_SUPPORTED_PYTHON_VERSION variable and set
+            it equal to 2.5.
+          - Added a compare_version() method to compare the current Python
+            version against a target version.
+          - Added a check_version() method to check the current Python
+            version against the current minimum supported version, and to
+            log a warning message if the check fails.
+
+        * Scripts/webkitpy/init/versioning_unittest.py: Added.
+          - Added unit tests for the functions in versioning.py.
+
+        * Scripts/webkitpy/style/unittests.py:
+          - Fixed/updated a code comment.
+
+        * Scripts/webkitpy/unittests.py: Added.
+          - Moved the "from ..._unittest import *" lines from test-webkitpy.
+
+2010-03-13  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved all code in webkitpy/__init__.py to another location.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35828
+
+        Keeping webkitpy/__init__.py free of non-trivial code allows
+        calling code to import initialization code from webkitpy
+        before any errors or log messages occur due to code in
+        __init__.py.  Such initialization code can include things like
+        version checking code and logging configuration code.  This
+        also lets us move the autoinstall initialization code to a
+        location where it only executes if it is needed -- something
+        we have done in this patch.
+
+        * Scripts/webkitpy/__init__.py:
+          - Moved all executable code to the following location:
+            webkitpy/thirdparty/autoinstalled/__init__.py
+          - Added a code comment to keep this file free of non-trivial
+            code.
+
+        * Scripts/webkitpy/bugzilla.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/networktransaction.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/networktransaction_unittest.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/statusserver.py:
+          - Updated mechanize import statement.
+
+        * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Added.
+          - Copied the code from webkitpy/__init__.py and updated it
+            as necessary.
+
+2010-03-13  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved webkitpy/mock.py into webkitpy/thirdparty since it is
+        third-party code.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35499
+
+        Updated the import statement in all of the below except where noted.
+
+        * Scripts/webkitpy/bugzilla_unittest.py:
+        * Scripts/webkitpy/commands/commandtest.py:
+        * Scripts/webkitpy/commands/download_unittest.py:
+        * Scripts/webkitpy/commands/early_warning_system_unittest.py:
+        * Scripts/webkitpy/commands/queries_unittest.py:
+        * Scripts/webkitpy/commands/queues_unittest.py:
+        * Scripts/webkitpy/commands/queuestest.py:
+        * Scripts/webkitpy/commands/upload.py:
+        * Scripts/webkitpy/commands/upload_unittest.py:
+        * Scripts/webkitpy/commands_references.py: Added.
+          - Added a file containing an absolute import of Mock so that
+            the imports in the commands folder can import from this file
+            (similar to style_references.py).  This helps limit the
+            number of affected files in future refactorings.
+
+        * Scripts/webkitpy/credentials_unittest.py:
+        * Scripts/webkitpy/mock.py: Removed.
+          - Moved to Scripts/webkitpy/thirdparty.
+
+        * Scripts/webkitpy/mock_bugzillatool.py:
+        * Scripts/webkitpy/patchcollection_unittest.py:
+        * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py:
+        * Scripts/webkitpy/steps/steps_unittest.py:
+        * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py:
+        * Scripts/webkitpy/steps_references.py: Added.
+          - Added a file containing an absolute import of Mock so that
+            the imports in the steps folder can import from this file
+            (similar to style_references.py).  This helps limit the
+            number of affected files in future refactorings.
+
+        * Scripts/webkitpy/thirdparty/mock.py: Copied from WebKitTools/Scripts/webkitpy/mock.py.
+          - Also eliminated trailing white space and carriage returns.
+
+2010-03-12  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Amend incorrect typo patch for QtLauncher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35877
+
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+
+2010-03-13  Victor Wang  <victorw@chromium.org>
+
+        Add appengine app to host and serve webkit layout test results.
+
+        The app allows you post test result files (json) and serve them up.
+        Chromium flakiness dashboard will first use this app to host results.json
+        and expectations.json, but the files hosted by this app are not limited
+        to chromium results or json files. It can be used to host other files if needed.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35944
+
+        * TestResultServer: Added.
+        * TestResultServer/app.yaml: Added.
+        * TestResultServer/handlers: Added.
+        * TestResultServer/handlers/__init__.py: Added.
+        * TestResultServer/handlers/menu.py: Added.
+        * TestResultServer/handlers/testfilehandler.py: Added.
+        * TestResultServer/index.yaml: Added.
+        * TestResultServer/main.py: Added.
+        * TestResultServer/model: Added.
+        * TestResultServer/model/__init__.py: Added.
+        * TestResultServer/model/testfile.py: Added.
+        * TestResultServer/stylesheets: Added.
+        * TestResultServer/stylesheets/form.css: Added.
+        * TestResultServer/stylesheets/menu.css: Added.
+        * TestResultServer/stylesheets/testfile.css: Added.
+        * TestResultServer/templates: Added.
+        * TestResultServer/templates/menu.html: Added.
+        * TestResultServer/templates/showfilelist.html: Added.
+        * TestResultServer/templates/uploadform.html: Added.
+
+2010-03-13  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by David Levin.
+
+        new-run-webkit-tests fails with --debug option.
+        https://bugs.webkit.org/show_bug.cgi?id=36067
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add "Show FPS" menu option to QtLauncher.
+
+        [Qt] QtLauncher need a menu option to show/hide FPS
+        https://bugs.webkit.org/show_bug.cgi?id=35794
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::showFPS):
+        (LauncherWindow::createChrome):
+
+2010-03-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add a "Toggle FullScreen" option to QtLauncher Menu.
+
+        [Qt] QtLauncher needs an option to toggle FullScreen Mode
+        https://bugs.webkit.org/show_bug.cgi?id=35755
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::init):
+        (LauncherWindow::eventFilter):
+        (LauncherWindow::initializeView):
+        (LauncherWindow::toggleFullScreenMode):
+        (LauncherWindow::createChrome):
+
+2010-03-12  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix typo in websocket_server (path_from_base instead of 
+        path_from_chromium_base).
+
+        https://bugs.webkit.org/show_bug.cgi?id=36074
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-12  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        new-run-webkit-tests --new-baseline doesn't work at all.
+
+        It attempts to call a method that isn't defined. To fix it, I
+        removed the unnecessary and unnecessarily confusing 'platform'
+        argument to the test_type constructor and use the Port object that
+        is passed in instead, since we are only ever generating a baseline
+        from the port that is currently executing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36046
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+
+2010-03-12  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fix new-run-webkit-tests --run-singly
+
+        This script option is currently broken - the script attempts to
+        dereference methods and variables that don't exist, which causes
+        the Chromium Linux valgrind bot to be quite unhappy. This has been
+        broken since r54449 when I renamed Port.start_test_driver to
+        Port.start_driver.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36042
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Fix critical being printed to stderr on every test. This is
+        because the jar is only being created when soup hits the HTTP
+        path. We should reconsider the time of its creation.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+
+2010-03-12  Adam Roben  <aroben@apple.com>
+
+        Teach prepare-ChangeLog to find modified selectors in CSS files
+
+        Reviewed by Tim Hatcher.
+
+        Fixes <http://webkit.org/b/36064> prepare-ChangeLog should extract
+        modified selectors from CSS files
+
+        * Scripts/prepare-ChangeLog:
+        (get_function_line_ranges): Call get_selector_line_ranges_for_css for
+        .css files.
+        (get_selector_line_ranges_for_css): Added. Finds selectors and their
+        line ranges and returns them.
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Build fix (for EWS). Make sure the new code builds on older soup.
+
+        Thanks to Dan Winship.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setAlwaysAcceptCookies):
+
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Carlson.
+
+        [GTK] DRT does not handle cookie policy setting
+        https://bugs.webkit.org/show_bug.cgi?id=36056
+
+        Implement cookie accept policy setting for GTK+'s LayoutTestController.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setAlwaysAcceptCookies):
+
+2010-03-12  Adam Langley  <agl@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [chromium]: update Linux layout test scripts for RedHat like systems.
+
+        (Tested on Fedora 12.)
+
+        https://bugs.webkit.org/show_bug.cgi?id=35867
+
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+
+2010-03-12  Adam Roben  <aroben@apple.com>
+
+        Make svn-create-patch's diffs of ObjC header files more readable
+
+        Fixes <http://webkit.org/b/36055>.
+
+        Reviewed by John Sullivan.
+
+        * Scripts/svn-create-patch:
+        (diffOptionsForFile): Added. Returns the options that should be passed
+        to diff for the given file. All the options are the same for all
+        files, except for the option to specify which lines should be used as
+        hunk headers.
+        (generateDiff): Use diffOptionsForFile to get the options to pass to
+        diff.
+        (hunkHeaderLineRegExForFile): Added. Returns the regular expression
+        that should be used by diff to identify lines that should be included
+        after the "@@" in the hunk header lines of the diff. For ObjC[++]
+        source files, we use any lines starting with -, +, or
+        @implementation/@interface/@protocol. For ObjC[++] header files (which
+        we assume to be any .h files in a mac/ or objc/ directory), we use any
+        lines starting with @implementation/@interface/@protocol.
+
+2010-03-12  Jochen Eisinger  <jochen@chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Introduce setWillSendRequestClearHeader to LayoutTestController to selectively remove headers in willSendRequest. Used in http/tests/security/no-referrer.html
+        https://bugs.webkit.org/show_bug.cgi?id=35920
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setWillSendRequestClearHeaderCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        (LayoutTestController::willSendRequestClearHeaders):
+        (LayoutTestController::setWillSendRequestClearHeader):
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+        * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+        (ResourceLoadDelegate::willSendRequest):
+
+2010-03-11  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Unreviewed.
+
+        Fix typo in websocket_server.py
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-11  Garret Kelly  <gdk@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fixing minor typo in the commit queue status page.
+        https://bugs.webkit.org/show_bug.cgi?id=35979
+
+        * Scripts/webkitpy/commands/queues.py:
+
+2010-03-11  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Unreviewed.
+
+        Fix for WebSocket layout test runner on chromium/win port.
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py: register_cygwin and set CYGWIN_PATH
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by David Kilzer.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+        * DumpRenderTree/mac/Configurations/Base.xcconfig:
+
+2010-03-11  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by dglazkov@chromium.org.
+
+        rebaseline_chromium_webkit_tests can generate new baselines for
+        all platforms so it needs to know two ports in order to work correctly:
+        the port that the script is running on and the port that it generates
+        new baselines for. Update rebaselining tool to handle both port correctly.
+
+        https://bugs.webkit.org/show_bug.cgi?id=36032
+
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-11  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+        Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
+        current Mac OS X version unless otherwise specified.
+
+        Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+        Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+        may not be usable when targetting a different Mac OS X version.
+
+        Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+        MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+        * DumpRenderTree/mac/Configurations/Base.xcconfig:
+        * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
+        * DumpRenderTree/mac/DumpRenderTree.mm: Wrap the include of mach-o/getsect.h in 'extern "C"' as some versions of the
+        header in older SDKs do not do this inside the header.
+
+2010-03-11  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35965
+        <rdar://problem/7742771> Crash when passing an object returned from plug-in back to the plug-in
+
+        Made rememberedObject a member of PluginObject. A plug-in must not use its references
+        to browser NPObjects after being destroyed, but this wasn't the case with static variable.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (pluginInvoke):
+        (pluginInvalidate):
+        (pluginAllocate):
+        (pluginDeallocate):
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+
+2010-03-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35905
+        REGRESSION(55699?): media/video-no-autoplay.html times out on Leopard Commit Bot
+
+        Make sure we reset the WebGL preference, so that WebGL doesn't get left
+        on after being enabled via layoutTestController.overridePreference(),
+        which in turn causes accelerated compositing to be enabled on Leopard
+        when we don't want it to be.
+        
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetDefaultsToConsistentValues):
+
+2010-03-10  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        rebaseline_chromium_webkit_tests doesn't handle other plaforms
+        correctly (e.g., if you run on the Mac platform and try to
+        rebaseline the WIN results, the result gets written into
+        platform/mac instead of platform/chromium-win). Also, this script
+        doesn't work on non-Chromium ports, so we need to fix that at some
+        point.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35982
+
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-10  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35840
+
+        Updates the subroutine builtDylibPathForName() so that it adds the "d" suffix to
+        the QtWebKit library name on Windows. This change makes run-launcher work again
+        under Windows. Moreover, this change corresponds to the change made in change-
+        set 53924 <http://trac.webkit.org/changeset/53924>.
+
+        * Scripts/webkitdirs.pm:
+
+2010-03-10  Adam Roben  <aroben@apple.com>
+
+        Roll out the prepare-ChangeLog part of r55870
+
+        This change wasn't needed (prepare-ChangeLog calls svn-create-patch
+        when it's asked to print out diffs for the user) and was screwing up
+        its ability to find changed function names.
+
+        * Scripts/prepare-ChangeLog:
+        (diffCommand): Change the options we pass to svn-diff back to their
+        pre-r55870 form.
+
+2010-03-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add Support for WebKitEnableCaretBrowsing to Qt DRT
+
+        Unskip test fast/events/multiline-link-arrow-navigation.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=35593
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::overridePreference):
+        (LayoutTestController::setCaretBrowsingEnabled):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-10  Robert Hogan  <robert@webkit.org>
+
+        Reviewed by Holger Freyther.
+
+        QtLauncher: Fix typo in conditional statement in
+                    WebViewGraphicsBased::setFrameRateMeasurementEnabled.
+
+        '=' should be '=='!
+
+        https://bugs.webkit.org/show_bug.cgi?id=35877
+
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+
+2010-03-10  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactored and cleaned up the code for unit-testing logging.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35845
+
+        * Scripts/webkitpy/init/logtesting.py:
+          - Added more information to the module docstring.
+          - Added an assertMessages() method to the UnitTestLogStream
+            class.  This simplifies the calling code.
+          - Renamed the UnitTestLog class to LogTesting, and reformulated
+            it as follows:
+              - Moved the logging configuration code from the __init__
+                method to a new static setUp() method.
+              - Documented the __init__ method to be private.
+              - Improved the code so that the root logger does not have
+                its logging level changed.  Instead we set the handler's
+                level.  This makes the unit testing more unintrusive.
+              - Updated the assertMessages() method to call the
+                UnitTestLogStream class's assertMessages() method.
+              - More fully documented the class.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added a logger parameter to the configure_logging() method.
+            This allows us to prevent test messages from being sent
+            to the root logger during unit testing, which may be
+            rendering to the screen, etc.
+          - Simplified the code by removing the _LevelLoggingFilter class.
+          - Replaced the _LevelLoggingFilter class with a one-line lambda
+            expression in configure_logging().
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Changed relative imports to absolute to comply more with PEP8.
+          - In the ConfigureLoggingTest class:
+            - Changed the setUp() method to prevent test messages from
+              being propagated to the root logger.
+            - Changed the _log() method to a data attribute.
+            - Updated to accommodate changes to logtesting.py.
+
+        * Scripts/webkitpy/style_references.py:
+          - Updated an import statement.
+
+2010-03-10  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Python code for GDB 7 to support native printing of some WebCore types.
+
+        * gdb/webcore.py: Added.
+
+2010-03-10  Adam Roben  <aroben@apple.com>
+
+        Make svn-create-patch and prepare-ChangeLog show better section
+        headings for ObjC files
+
+        This makes the text at the end of each "@@" line in a diff actually
+        show the ObjC method or interface that contains the change, rather
+        than whatever the most-recently-defined C function was.
+
+        Fixes <http://webkit.org/b/35970>.
+
+        Reviewed by John Sullivan.
+
+        * Scripts/svn-create-patch: Pass -F'^[-+@]' to diff so that it will
+        treat any lines starting with -, +, or @ as section heading lines.
+        This works well for ObjC files, and shouldn't affect other types of
+        files.
+
+        * Scripts/prepare-ChangeLog: Changed the options passed to diff to
+        match those used in svn-create-patch.
+
+2010-03-10  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        Link QtLauncher against the WebKit library using a relative rpath.
+
+        This makes the launcher and the lib relocatable.
+
+        * QtLauncher/QtLauncher.pro:
+
+2010-03-10  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Rubber-stamped by Simon Hausmann.
+
+        [iExploder] Add new CSS Properties and HTML Attributes
+
+        The update-iexploder-cssproperties script was used to update
+        the various input files. The autobuffer HTML Attribute was removed
+        from WebKit and I manually added it back to the htmlattrs.in like
+        we have done it for other attributes in the past.
+
+        * iExploder/htdocs/cssproperties.in:
+        * iExploder/htdocs/htmlattrs.in:
+        * iExploder/htdocs/htmltags.in:
+
+2010-03-09  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Unreviewed.
+
+        Obvious fix for --cgi-paths of pywebsocket.
+
+        * Scripts/run-webkit-websocketserver:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-09  Jakub Wieczorek  <jwieczorek@webkit.org>
+
+        Unreviewed.
+
+        Adding myself to committers.py.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-03-09  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Nate Chapin.
+
+        Fix --clobber-old-results in new-run-webkit-tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35778
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-09  Andy Estes  <aestes@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Add the ability to dispatch scroll wheel events in DRT.  This was
+        necessary in order to write a test for
+        https://bugs.webkit.org/show_bug.cgi?id=34700.
+
+        * DumpRenderTree/mac/EventSendingController.mm: Add support for two
+        new methods to EventSender: mouseScrollBy(x, y) and
+        continuousMouseScrollBy(x, y).  The API to generate scroll events on
+        the mac was added in 10.5, so these methods are NOOPs on Tiger.
+        (+[EventSendingController isSelectorExcludedFromWebScript:]):
+        Regiester mouseScrollByX:andY: and continuousMouseScrollByX:andY:
+        (+[EventSendingController webScriptNameForSelector:]): Map JavaScript
+        method names to ObjC selectors.
+        (-[EventSendingController mouseScrollByX:andY:continuously:]): Generate
+        a scroll wheel event using CGEventCreateScrollWheelEvent() and dispatch
+        it to WebKit.
+        (-[EventSendingController continuousMouseScrollByX:andY:]): Generate a
+        continuous scrolling event by x and y pixels.
+        (-[EventSendingController mouseScrollByX:andY:]): Generate a notchy
+        scrolling event by x and y lines.
+
+2010-03-09  Chris Fleizach  <cfleizach@apple.com>
+
+        DRT build fix for Tiger. No review.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+        (AccessibilityController::elementAtPoint):
+
+2010-03-09  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: hit testing a list box doesn't work anymore
+        https://bugs.webkit.org/show_bug.cgi?id=35893
+
+        * DumpRenderTree/AccessibilityController.cpp:
+        (getElementAtPointCallback):
+        (AccessibilityController::getJSClass):
+        * DumpRenderTree/AccessibilityController.h:
+        * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+        (AccessibilityController::elementAtPoint):
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+        (AccessibilityController::elementAtPoint):
+        * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+        (AccessibilityController::elementAtPoint):
+
+2010-03-03  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        pywebsocket should support html and cgi in the same directory.
+        https://bugs.webkit.org/show_bug.cgi?id=34879
+
+        Import pywebsocket 0.4.9.2
+        Specify --server-host 127.0.0.1, so that it only binds listening socket
+        to 127.0.0.1 to prevent access from non-localhost.
+        Change --cgi-paths from /websocket/tests/cookies to /websocket/tests,
+        because pywebsocket 0.4.9.2 supports html and cgi in the same directory
+        and only executable (httponly-cookies.pl) will be handled as cgi
+        script.
+
+        * Scripts/run-webkit-tests:
+        * Scripts/run-webkit-websocketserver:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/README.webkit:
+        * Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt: Added.
+        * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/setup.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py:
+        * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README: Added.
+        * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl: Added.
+
+2010-03-09  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Simplified check-webkit-style's argument parsing code by removing
+        support for the vestigial "extra flag values" parameter.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34677
+
+        The "extra flag values" parameter was needed before WebKit
+        forked check-webkit-style from Google.  It was used to pass
+        through the option parser those command-line flags that WebKit
+        required but that Google's parser did not support (the --git-commit
+        flag in particular).
+            We can remove the parameter now because it is no longer
+        needed and unnecessarily clutters the argument-parsing code.
+
+        * Scripts/webkitpy/style/optparser.py:
+          - Removed the extra_flag_values parameter from the
+            CommandOptionValues class's constructor.
+          - Removed the extra_flags parameter from the ArgumentParser
+            class's parse() method.
+
+        * Scripts/webkitpy/style/optparser_unittest.py:
+          - Removed from the unit tests all references to the
+            extra_flag_values variable.
+
+2010-03-08  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add EventSender
+        https://bugs.webkit.org/show_bug.cgi?id=35859
+
+        Add EventSender classes, which are going to be used by
+        DumpRenderTree Chromium port. These files are based on:
+        - src/webkit/tools/test_shell/event_sending_controller.cc
+        - src/webkit/tools/test_shell/event_sending_controller.h
+        of Chromium rev.40492.
+
+        * DumpRenderTree/chromium/EventSender.cpp: Added.
+        * DumpRenderTree/chromium/EventSender.h: Added.
+
+2010-03-08  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add PlainTextController and TextInputController
+        https://bugs.webkit.org/show_bug.cgi?id=35852
+
+        Add PlainTextController and TextInputController classes, which are going
+        to be used by DumpRenderTree Chromium port. These files are based on:
+        - src/webkit/tools/test_shell/plain_text_controller.{cc,h} and
+        - src/webkit/tools/test_shell/text_input_controller.{cc,h}
+        of Chromium rev.40492.
+
+        * DumpRenderTree/chromium/PlainTextController.cpp: Added.
+        * DumpRenderTree/chromium/PlainTextController.h: Added.
+        * DumpRenderTree/chromium/TextInputController.cpp: Added.
+        * DumpRenderTree/chromium/TextInputController.h: Added.
+
+2010-03-08  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, Chromium build fix.
+
+        Reverting r55689.
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-08  Fumitoshi Ukai  <ukai@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fix webkit-patch post and land to work well with security bug
+        https://bugs.webkit.org/show_bug.cgi?id=35733
+
+        Bugzilla requires authentication to access security bug page,
+        so call authenticate() if it failed to fetch bug page.
+
+        * Scripts/webkitpy/bugzilla.py:
+
+2010-03-04  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitry Glazkov.
+
+        Fix --clobber-old-results in new-run-webkit-tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35778
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-08  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by NOBODY (but suggested by Steve Falkenburg and fixing a boneheaded mistake on my part last week)
+
+        Followup to https://bugs.webkit.org/show_bug.cgi?id=35532
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::apiTestGoToCurrentBackForwardItem): Can't pass in a null BOOL to WebKit APIs.
+
+2010-03-08  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Fixed incorrect import statement in validate-committer-lists:
+        webkitpy.BeautifulSoup -> webkitpy.thirdparty.BeautifulSoup.
+
+        * Scripts/validate-committer-lists:
+
+2010-03-08  Jian Li  <jianli@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Blob.slice support.
+        https://bugs.webkit.org/show_bug.cgi?id=32993
+
+        Add ENABLE_BLOB_SLICE feature define and  flag for build-webkit. It is
+        currently only turned on for Mac.
+
+        * Scripts/build-webkit:
+
+2010-03-08  Gustavo Noronha Silva  <gns@gnome.org>
+
+        No review, rolling out r55662.
+        http://trac.webkit.org/changeset/55662
+        https://bugs.webkit.org/show_bug.cgi?id=35863
+
+        Need to be coordinated with bots setup
+
+        * Scripts/run-webkit-tests:
+
+2010-03-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        [GTK] Tests fail when running with ipv6 addresses available, on Debian systems
+        https://bugs.webkit.org/show_bug.cgi?id=35863
+
+        If running on a Debian-based system, also listen on the ipv6 address.
+
+        * Scripts/run-webkit-tests:
+
+2010-03-08  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Darin Adler.
+
+        [iexploder] Automatically update htmltags.in and htmlattrs.in too
+        https://bugs.webkit.org/show_bug.cgi?id=33755
+
+        Change the update-iexploder-cssproperites script to update
+        the htmlattrs.in and htmltags.in of WebKitTools/iExploder/htdocs
+        automatically as well.
+
+        Change the reading and writing code to work with parameters
+        and extend the method that is parsing the .in files to handle
+        the HTMLTagNames.in and the HTMLAttributeNames.in files.
+
+        Remove custom code to determine the revision of files with a
+        utility of VCUtils.pm to determine the revision of the directory
+        these files are located in. This will also work with git checkout.
+
+        * Scripts/update-iexploder-cssproperties:
+
+2010-03-07  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        check-webkit-style: false positive for empty loop
+        https://bugs.webkit.org/show_bug.cgi?id=35717
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-03-07  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add AccessibilityController and AccessibilityUIElement
+        https://bugs.webkit.org/show_bug.cgi?id=35774
+
+        Add AccessibilityController and AccessibilityUIElement classes,
+        which are going to be used by DumpRenderTree Chromium port. These
+        files are based on:
+        - src/webkit/tools/test_shell/accessibility_controller.{cc,h} and
+        - src/webkit/tools/test_shell/accessibility_ui_element.{cc,h}
+        of Chromium rev.40492.
+
+        * DumpRenderTree/chromium/AccessibilityController.cpp: Added.
+        * DumpRenderTree/chromium/AccessibilityController.h: Added.
+        * DumpRenderTree/chromium/AccessibilityUIElement.cpp: Added.
+        * DumpRenderTree/chromium/AccessibilityUIElement.h: Added.
+
+2010-03-06  Hironori Bono  <hbono@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Typing into Flash with wmode = opaque|transparent and
+        non-latin language active outputs as if US keyboard layout active
+
+        https://bugs.webkit.org/show_bug.cgi?id=34936
+
+        To test keyboard events on the test plugin, this change implements
+        NPCocoaEventKeyDown and NPCocoaEventKeyUp handlers so the plugin
+        can write log messages.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+        (handleEventCocoa): Implemented the event handlers for NPCocoaKeyDown
+        and NPCocoaEventKeyUp.
+
+2010-03-05  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix Print option on QtLauncher by calling print directly from QWebFrame.
+
+        [Qt] QtLauncher Print option is not working on QGraphicsView mode
+        https://bugs.webkit.org/show_bug.cgi?id=35769
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::print):
+
+2010-03-05  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Changed the logging code for new-run-webkit-tests to use
+        module-specific loggers rather than the root logger. This is
+        a standard practice that allows logging specific to a package
+        to be configured independently of other modules.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35194
+
+        Added a line of the form "_log = logging.getLogger(<module>)"
+        to each module below, where <module> is the fully-qualified
+        name of the module, and updated the log lines to use the new
+        _log logger.
+
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+        * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+        * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-03-05  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Siedel.
+
+        Split the command-line invocation of the Chromium/python LigHTTPd
+        server implementation out into its own top level script to make it
+        a more "public" interface and to resolve some awkward layering
+        issues. This script will be called directly by other test scripts in
+        the Chromium tree.
+
+        At some point this script should be made to work with Apache-based
+        implementations and on other ports. I have filed
+        https://bugs.webkit.org/show_bug.cgi?id=35820 for this.
+
+        Also fix a bug in port/factory where options.chromium could be
+        dereferenced even if it wasn't set, raising an exception.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35812
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+        * Scripts/new-run-webkit-httpd: Added
+
+2010-03-02  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Holger Freyther
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [Gtk] Implement setSpatialNavigationEnabled in DRT.
+        https://bugs.webkit.org/show_bug.cgi?id=35705
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setSpatialNavigationEnabled):
+
+2010-02-23  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Kenneth Christiansen.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Add toggle on/off stub methods for Spatial Navigation in win, gtk and mac LayoutTestController class implementations.
+        https://bugs.webkit.org/show_bug.cgi?id=35699
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setSpatialNavigationEnabledCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setSpatialNavigationEnabled):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setSpatialNavigationEnabled):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setSpatialNavigationEnabled):
+
+2010-02-18  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Kenneth Christiansen.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        Add toggle on/off mechanism for Spatial Navigation in QtLauncher.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::toggleSpatialNavigation):
+        (LauncherWindow::setupUI):
+
+2010-03-02  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Hausmann.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [Qt] Add setSpatialNavigationEnabled method DRT
+        https://bugs.webkit.org/show_bug.cgi?id=33715
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::WebPage::WebPage):
+        (WebCore::WebPage::resetSettings):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setSpatialNavigationEnabled):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+        Unskipped fast/events/spatialnavigation/
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Rubber-stamped by Alice Liu.
+
+        Find the framework relative to TARGET_BUILD_DIR as that has a more obvious value during production builds.
+
+        * Scripts/check-for-webkit-framework-include-consistency:
+
+2010-03-04  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Add CppVariant and CppBoundClass
+        https://bugs.webkit.org/show_bug.cgi?id=35634
+
+        Add CppVariant and CppBoundClass classes, which are going to be
+        used by DumpRenderTree Chromium port. These files are based on:
+        - src/webkit/glue/cpp_variant.{cc,h} and
+        - src/webkit/glue/cpp_bound_class.{cc,h}
+        of Chromium rev.40492.
+
+        * DumpRenderTree/chromium/CppBoundClass.cpp: Added.
+        * DumpRenderTree/chromium/CppBoundClass.h: Added.
+        * DumpRenderTree/chromium/CppVariant.cpp: Added.
+        * DumpRenderTree/chromium/CppVariant.h: Added.
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Build fix for older versions of Ruby.
+
+        * Scripts/check-for-webkit-framework-include-consistency:
+
+2010-03-04  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add a script to verify that WebKit framework headers are internally consistent.
+
+        This script detects the following problematic situations:
+        * An exported WebKit header that includes a header from WebCore.
+        * An exported WebKit header that includes a header that does not exist in the WebKit framework.
+        * A public WebKit header that includes a private WebKit header.
+
+        * Scripts/check-for-webkit-framework-include-consistency: Added.
+
+2010-03-04  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Roben.
+
+        Making sure that the correct path is set before invoking
+        DumpRenderTree on cygwin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35768
+
+        * Scripts/run-webkit-tests:
+
+2010-03-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Revert the exceptions I just added, and make the error clearer.
+
+        * Scripts/check-for-global-initializers:
+
+2010-03-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Build fix: add exceptions to the check-for-global-initializers script
+        for FocusController and SpatialNavigation, and improve the script
+        to actually print out the globals found.
+
+        * Scripts/check-for-global-initializers:
+
+2010-03-04  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix dangling reference to "port" instead of "self._port_obj" that
+        was preventing the http_server from starting on Windows.
+
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+
+2010-03-04  Diego Gonzalez  <diego.gonzalez@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Make Qt DumpRenderTree EventSender able to send double click events
+
+        LayoutTests:
+            fast/events/dblclick-addEventListener.html
+
+        [Qt] DRT: Send double click event from EventSender
+        https://bugs.webkit.org/show_bug.cgi?id=35255
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+        * DumpRenderTree/qt/EventSenderQt.cpp:
+        (EventSender::EventSender):
+        (EventSender::mouseDown):
+        * DumpRenderTree/qt/EventSenderQt.h:
+        (EventSender::resetClickCount):
+
+2010-03-04  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
+
+        This also allows shadow builds relying only on qmake to work properly.
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/ImageDiff.pro:
+        * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+        * QtLauncher/QtLauncher.pro:
+
+2010-03-04  Gabor Rapcsanyi  <rgabor@inf.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Enable to use built-product-archive on Qt platform.
+
+        * BuildSlaveSupport/built-product-archive:
+
+2010-03-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Add a missing 'm_' to class variables names.
+
+        [Qt] QtLauncher is not respecting class variable names
+        https://bugs.webkit.org/show_bug.cgi?id=35542
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::init):
+        (LauncherWindow::sendTouchEvent):
+        (LauncherWindow::eventFilter):
+        (LauncherWindow::zoomIn):
+        (LauncherWindow::zoomOut):
+        (LauncherWindow::resetZoom):
+        (LauncherWindow::setEditable):
+        (LauncherWindow::setTouchMocking):
+        (LauncherWindow::initializeView):
+        (LauncherWindow::createChrome):
+
+2010-03-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Rubber-stamped by Mark Rowe.
+
+        Exclude leaks in Java that build bot complains about.
+
+        * Scripts/run-webkit-tests:
+
+2010-03-03  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Additional change to separate Accelerated Compositing test from 3D Rendering test
+        https://bugs.webkit.org/show_bug.cgi?id=35610
+        
+        I am now using #if ENABLED(3D_RENDERING) to emit the 3DRendering string from
+        DRT or not. This allows these flags to set independently. I also improved
+        the code flow in run-webkit-tests a bit.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (main):
+        * Scripts/run-webkit-tests:
+
+2010-03-03  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Added ability to print supported features to console to DRT
+        https://bugs.webkit.org/show_bug.cgi?id=35610
+        
+        This currently only prints whether or not Accelerated Compositing 
+        and 3D Rendering are supported, which is the only way to tell if you 
+        can run the compositing LayoutTests on Windows. But it can be expanded 
+        to give more information as needed. Currently it prints that both
+        AcceleratedCompositing and 3DRendering are available if accelerated compositing
+        is enabled since both have to be turned on together. This allows me to maintain
+        separate checks for them.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:Added --print-supported-features flag
+        (main):
+        * Scripts/run-webkit-tests:Runs DRT and enabled compositing tests if HW comp is available on Windows
+
+2010-03-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Simon Hausmann.
+
+        Refactor QtLauncher so it respects command line arguments
+        and inherits settings when you clone or create a new window.
+
+        Implemented with help of Kenneth Rohde Christiansen.
+
+        [Qt] QtLauncher must be refactored to fix command line arguments usage
+        https://bugs.webkit.org/show_bug.cgi?id=35536
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::init):
+        (LauncherWindow::isGraphicsBased):
+        (applySetting):
+        (LauncherWindow::applyPrefs):
+        (LauncherWindow::initializeView):
+        (LauncherWindow::newWindow):
+        (LauncherWindow::cloneWindow):
+        (LauncherWindow::createChrome):
+        (main):
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::WebViewGraphicsBased):
+        (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+        * QtLauncher/webview.h:
+        (WebViewGraphicsBased::itemCacheMode):
+        (WebViewGraphicsBased::frameRateMeasurementEnabled):
+
+2010-03-02  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=35210
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (geolocationPolicyDecisionRequested):
+        (createWebView):
+
+2010-03-02  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by David Levin.
+
+        Revert r55339 - the Chromium codebase downstream had a temporary
+        need for WebKitTools/pywebsocket to still exist after Chris Jerdonek
+        had moved it (scripts still referenced the old location). Those
+        scripts have been updated to the new location, so it should be safe
+        to delete this now.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35614
+
+        * pywebsocket/mod_pywebsocket/standalone.py: Removed.
+
+2010-03-02  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        new-run-webkit-tests on chromium-linux tests to see if
+        layout_test_helper exists, but we don't use layout_test_helper on
+        linux. The test derefences a None object, and we crash. This fixes
+        that.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35602
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+ 2010-03-02  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        r55388 (bug 35553) worked around a bug in Python's subprocess.Popen()
+        that was causing DRT to hang on exit in new-run-webkit-tests.
+        Unfortunately, that workaround doesn't work on chromium-win
+        (and the script fails completely). The good news is that the check
+        isn't actually necessary, and so this change makes it conditional.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35601
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-02  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 35576: WebKit should tell plug-in instances when private browsing state changes
+        <http://webkit.org/b/35576>
+
+        TestNetscapePlugin is another bit of plug-in code where copy-paste was heavily used
+        when porting.  Update the Windows and UNIX implementations of NPP_New and NPP_SetValue
+        to provide the expected behavior related to NPNVprivateModeBool.  Hopefully this code
+        duplication can be cleaned up in the future.
+
+        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+        (webkit_test_plugin_new_instance):
+        (webkit_test_plugin_set_value):
+        * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+        (NPP_New):
+        (NPP_SetValue):
+
+2010-03-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Test plugin still has issues with releasing objects, and variants
+        https://bugs.webkit.org/show_bug.cgi?id=35587
+
+        Fix the conditions for releasing the variants after calling
+        invoke, and avoid having a number of objects leak.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (testDocumentOpen):
+        (testWindowOpen):
+
+2010-03-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Refactored the StyleChecker class's file-processing method
+        _process_file().  This will make it easier to add new
+        file-processing capabilities to check-webkit-style.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35490
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added a _read_lines() method to the StyleChecker class
+            that extracts the lines from a file.
+          - Replaced part of _process_file() with a call to the new
+            _read_lines() method.
+          - Replaced another part of _process_file() with a call
+            to the new CarriageReturnProcessor.process() method.
+
+        * Scripts/webkitpy/style/processors/common.py:
+          - Replaced the check_no_carriage_return() function with a
+            new CarriageReturnProcessor class.
+
+        * Scripts/webkitpy/style/processors/common_unittest.py:
+          - Renamed the CarriageReturnTest class to
+            CarriageReturnProcessorTest and updated it as necessary.
+
+2010-03-02  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Started using the logging module in check-webkit-style.
+        This provides more options for debugging and a more flexible,
+        uniform way to report messages to the end-user.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35484
+
+        Also included classes in a central location to facilitate
+        the unit testing of logging code (setUp and tearDown of unit
+        test logging configurations, etc).
+
+        * Scripts/check-webkit-style:
+          - Added a call to configure_logging() in the beginning of main().
+          - Replaced two calls to sys.stderr.write() with appropriate
+            logging calls.
+
+        * Scripts/webkitpy/init/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+
+        * Scripts/webkitpy/init/logtesting.py: Added.
+          - Added a UnitTestLogStream class to capture log output
+            during unit tests.
+          - Added a UnitTestLog class that provides convenience methods
+            for unit-testing logging code.
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added a configure_logging() method.
+          - Added a _LevelLoggingFilter class to filter out log messages
+            above a certain logging level.
+          - Removed the _stderr_write() method from the StyleChecker class
+            and replaced its use with appropriate logging calls.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Added a ConfigureLoggingTest class to unit test the
+            configure_logging() method.
+          - Updated the StyleCheckerCheckFileTest class as necessary.
+
+        * Scripts/webkitpy/style_references.py:
+          - Added references to logtesting.UnitTestLog and
+            logtesting.UnitTestLogStream.
+
+2010-03-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Fixing broken DRT on Leopard/Tiger. Second try.
+
+        AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=35514
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2010-03-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Fixing broken DRT on Leopard/Tiger.
+
+        AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=35514
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2010-03-01  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Eric Seidel.
+
+        [GTK] plugins/setProperty.html fails on 64bit Release
+        https://bugs.webkit.org/show_bug.cgi?id=35425
+
+        Check invoke's return code before releasing the variant, since
+        there's a chance it won't be properly initialized, leading to
+        memory corruption, in some cases.
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (testCallback):
+        (testEnumerate):
+        (testDocumentOpen):
+        (testWindowOpen):
+        (handleCallback):
+
+2010-03-01  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by nobody. Build bustage :(
+
+        Fix stupid typo that I committed even after David Levin pointed
+        it out to me :(
+
+        https://bugs.webkit.org/show_bug.cgi?id=35553
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-01  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=35514
+
+        Add rowCount, columnCount for tables.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (rowCountCallback):
+        (columnCountCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::rowCount):
+        (AccessibilityUIElement::columnCount):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::rowCount):
+        (AccessibilityUIElement::columnCount):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::rowCount):
+        (AccessibilityUIElement::columnCount):
+
+2010-03-01  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Work around a bug in Python's subprocess.Popen() that keeps us from
+        cleaning up DumpRenderTree / test_shell properly when we finish the
+        tests in new-run-webkit-tests.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35553
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-01  Arno Renevier  <arno@renevier.net>
+
+        Reviewed by Xan Lopez.
+
+        webkit-build could pass unknown arguments to autogen.sh
+        https://bugs.webkit.org/show_bug.cgi?id=35454
+
+        * Scripts/build-webkit:
+
+2010-03-01  Dirk Pranke  <dpranke@chromium.org>
+
+        Rubber-stamped by Dimitri Glazkov.
+
+        Fix breakage from r55372.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35549
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-01  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        EWS can hang for five hours when compile output is too big
+        https://bugs.webkit.org/show_bug.cgi?id=35545
+
+        * Scripts/webkitpy/commands/queues.py: Limit uploads to 1MB instead of
+        5MB.  AppEngine seems to not like 5MB uploads.  I'm not sure what the
+        limit is.  Let's try 1MB for a while and see how it goes.
+        * Scripts/webkitpy/networktransaction.py: Tune the default parameters
+        to our exponential backoff.  I'm not sure why I picked five hours as
+        the retry limit.  That seems way too large.
+
+2010-03-01  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        REGRESSION: Telling a WebView to go to its current WebHistoryItem is broken.
+        <rdar://problem/7699371> and https://bugs.webkit.org/show_bug.cgi?id=35532
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (apiTestGoToCurrentBackForwardItemCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+
+        Stubs for now:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+
+2010-03-01  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by David Levin.
+
+        General cleanup of error handling in new-run-webkit-tests.
+
+        Add Port.check_build() call that is separate from Port.check_sys_deps()
+        (and add a --nocheck-build flag to skip). This breaks a circular
+        dependency where you would start the layout test helper before
+        checking sys deps, but checking sys deps was the thing that told
+        you if your binaries where there.
+
+        Also, made Port.check_sys_deps(), start_helper() and stop_helper()
+        optional by providing default implementations in the base class
+        rather than requiring ports to implement the routines regardless
+        of whether or not they were needed.
+
+        Lastly, tweak a bunch of log messages to be cleaner, including
+        changing messages in thirdparty/autoinstall.py to be silent at
+        the default log level.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35416
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/passing.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/thirdparty/autoinstall.py
+
+2010-03-01  Dirk Pranke <dpranke@chromium.org>
+
+         Reviewed by David Levin.
+
+         new-chromium-webkit-tests --platform=mac-leopard diffs are backwards
+         https://bugs.webkit.org/show_bug.cgi?id=35265
+
+         Some parts of the code passed arguments as
+         "actual, expected" and some passed as "expected, actual".
+         As you might imagine, this lead to great confusion and wrongness.
+         Standardize on "expected, actual" as that's the order which is
+         passed to the underlying diff tool.
+
+         Based on a patch by Eric Siedel <eric@webkit.org>.
+
+         * Scripts/webkitpy/layout_tests/port/base.py:
+         * Scripts/webkitpy/layout_tests/port/chromium.py:
+         * Scripts/webkitpy/layout_tests/port/test.py:
+         * Scripts/webkitpy/layout_tests/test_types/image_diff.py
+
+2010-03-01  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Rolling out: http://trac.webkit.org/changeset/55348
+
+        https://bugs.webkit.org/show_bug.cgi?id=35163
+
+        Rolling out since the changes to autoinstall do not work
+        with Python 2.4. In particular, ZipFile.extractall() was
+        added in Python 2.6.
+
+        * Scripts/webkitpy/__init__.py:
+        * Scripts/webkitpy/bugzilla.py:
+        * Scripts/webkitpy/init/__init__.py: Removed.
+        * Scripts/webkitpy/init/autoinstall.py: Removed.
+        * Scripts/webkitpy/networktransaction.py:
+        * Scripts/webkitpy/networktransaction_unittest.py:
+        * Scripts/webkitpy/statusserver.py:
+        * Scripts/webkitpy/thirdparty/autoinstall.py: Added.
+
+2010-03-01  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Unreviewed.
+
+        Rolling out r55350: http://trac.webkit.org/changeset/55350
+
+        https://bugs.webkit.org/show_bug.cgi?id=33639
+
+        Need to roll out because this patch (pep8) depends on the newly
+        rewritten autoinstall.py (r55348), which is breaking for people
+        with Python 2.4:
+
+        https://bugs.webkit.org/show_bug.cgi?id=35163#c21
+
+        That revision also needs to be rolled out and will be rolled out next.
+
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+        * Scripts/webkitpy/style/processors/python.py: Removed.
+        * Scripts/webkitpy/style/processors/python_unittest.py: Removed.
+        * Scripts/webkitpy/style/processors/python_unittest_input.py: Removed.
+        * Scripts/webkitpy/style/unittests.py:
+        * Scripts/webkitpy/style_references.py:
+
+2010-02-28  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Exempted WebKitTools/Scripts/webkitpy/thirdparty from all
+        style checks except for the whitespace/carriage_return check
+        and the pep8 tab and trailing white space checks.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35497
+
+        * Scripts/webkitpy/style/checker.py:
+          - Adjusted the _PATH_RULES_SPECIFIER configuration as necessary.
+          - Added enough pep8 categories to _all_categories() for the
+            unit tests to pass.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated the test_path_rules_specifier() unit test.
+
+2010-02-27  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by David Levin.
+
+        Added Python style checking to check-webkit-style using
+        the third-party pep8 module (via autoinstall).
+
+        https://bugs.webkit.org/show_bug.cgi?id=33639
+
+        * Scripts/webkitpy/style/checker.py:
+          - Added PYTHON to FileType.
+          - Updated ProcessorDispatcher to return a PythonProcessor
+            for *.py files.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated the ProcessorDispatcher unit tests for *.py files.
+
+        * Scripts/webkitpy/style/processors/python.py: Added.
+          - Added PythonProcessor class.
+
+        * Scripts/webkitpy/style/processors/python_unittest.py: Added.
+          - Added PythonProcessor unit tests.
+
+        * Scripts/webkitpy/style/processors/python_unittest_input.py: Added.
+          - Added a sample Python file to test the PythonProcessor.process()
+            code path (since pep8 accepts a file path).
+
+        * Scripts/webkitpy/style/unittests.py:
+          - Updated the style unit test file to import python_unittest.py.
+
+        * Scripts/webkitpy/style_references.py:
+          - Adjusted style references to import pep8.
+
+2010-02-26  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by David Levin.
+
+        Rewrote autoinstall.py to support unzipping *.zip files after
+        download, unzipping and extracting *.tar.gz files after download,
+        and copying installed files to a destination directory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35163
+
+        These changes will allow us to autoinstall pep8.py from the web
+        and to put our third-party autoinstalled code in an explicit
+        directory like webkitpy/thirdparty/autoinstalled. They should
+        also speed up imports from autoinstalled *.zip packages slightly
+        since *.pyc files cannot be generated when importing from
+        zipped packages.
+
+        * Scripts/webkitpy/__init__.py:
+          - Updated the autoinstall lines to use the new autoinstall methods.
+          - Added pep8.py to the list of auto-installed packages.
+
+        * Scripts/webkitpy/bugzilla.py:
+          - Updated mechanize import path.
+
+        * Scripts/webkitpy/init/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+
+        * Scripts/webkitpy/init/autoinstall.py: Added.
+          - Added AutoInstaller class.
+          - Added sample testing usage to __main__.
+
+        * Scripts/webkitpy/networktransaction.py:
+          - Updated mechanize import path.
+
+        * Scripts/webkitpy/networktransaction_unittest.py:
+          - Updated mechanize import path.
+
+        * Scripts/webkitpy/statusserver.py:
+          - Updated mechanize import path.
+
+        * Scripts/webkitpy/thirdparty/autoinstall.py: Removed.
+          - Replaced with rewritten autoinstall in init/autoinstall.py.
+
+2010-02-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Change the default port for new-run-webkit-tests when running on
+        a Mac from 'chromium-mac' to 'mac'. Add a '--chromium' switch to
+        pick up the default platform-specific version of chromium instead.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35462
+
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-02-26  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix
+
+        third time's the charm getting this path right?
+
+        * pywebsocket/mod_pywebsocket/standalone.py:
+
+2010-02-26  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, build fix.
+
+        * pywebsocket/mod_pywebsocket/standalone.py:
+
+2010-02-26  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Moving the script to the right location.
+
+        * pywebsocket/mod_pywebsocket: Added.
+        * pywebsocket/mod_pywebsocket/standalone.py: Copied from WebKitTools/pywebsocket/standalone.py.
+        * pywebsocket/standalone.py: Removed.
+
+2010-02-26  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Unreviewed, fixing the license.
+
+        * pywebsocket/standalone.py:
+
+2010-02-26  Dumitru Daniliuc  <dumi@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Adding pywebsocket/standalone.py back to fix the Chromium webkit
+        canaries. Once all layout tests pass, we can get in the patch that
+        moves this directorty to WebKitTools/Scripts, update all Chromium
+        scripts, and revert this patch.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35464
+
+        * pywebsocket: Added.
+        * pywebsocket/standalone.py: Added.
+
+2010-02-26  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Needs proper reporting of frame loader callbacks, in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=32170
+
+        Fix reporting of unload handlers, so that it is emitted where
+        needed, not after it.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewLoadFinished):
+        (webViewDocumentLoadFinished):
+        (createWebView):
+
+2010-02-26  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Gustavo Noronha.
+        Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+        [Gtk] Make DRT EventSender::keyDown to consider 'hardware_keycode' field when synthesizing an event.
+        https://bugs.webkit.org/show_bug.cgi?id=35432
+
+        When a directional key-press event (arrow keys, End, Home, PageUp,
+        PageDown, etc) is synthesized by DRT's EventSender and it targets
+        an editor (e.g. <input type=text>, <textare>, etc), event is processed
+        by WebCore::EventHandler. On the other hand, if event target is not
+        an editor, event is bubbled up to Gtk+ for processing. In such cases,
+        if 'hardware_keycode' is not provided at event synthesize time
+        its processing fails (at some point in gtk_bindings_activate_event),
+        and no scroll action is performed.
+
+        Unskip fast/events/node-event-anchor-lock.html
+
+        * DumpRenderTree/win/EventSender.cpp:
+        (keyDownCallback):
+        * platform/gtk/Skipped:
+
+2010-02-26  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by David Levin.
+
+        new-webkit-run-tests: Extraneous parenthesis in websocket_server.py
+        https://bugs.webkit.org/show_bug.cgi?id=35436
+
+         * Scripts/webkitpy/layout_tests/port/websocket_server.py: Removed extra paren.
+
+2010-02-26  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by David Levin.
+
+        Moved pywebsocket into the webkitpy/thirdparty directory and added
+        an associated README.webkit file to the pywebsocket directory.
+        This makes pywebsocket more consistent with the other third-party
+        Python code in our repository.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35198
+
+        * Scripts/run-webkit-tests:
+          - Updated paths to pywebsocket.
+
+        * Scripts/run-webkit-websocketserver:
+          - Updated paths to pywebsocket.
+
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+          - Updated paths to pywebsocket.
+
+        * Scripts/webkitpy/thirdparty/pywebsocket: Copied from WebKitTools/pywebsocket.
+        * Scripts/webkitpy/thirdparty/pywebsocket/README.webkit: Added.
+          - Added a file containing information about the contents
+            of the pywebsocket directory. This will make it easier to
+            understand where the third-party code came from and what
+            local changes have been made.
+
+        * pywebsocket: Removed.
+        * pywebsocket/COPYING: Removed.
+        * pywebsocket/MANIFEST.in: Removed.
+        * pywebsocket/README: Removed.
+        * pywebsocket/example: Removed.
+        * pywebsocket/example/echo_client.py: Removed.
+        * pywebsocket/example/echo_wsh.py: Removed.
+        * pywebsocket/mod_pywebsocket: Removed.
+        * pywebsocket/mod_pywebsocket/__init__.py: Removed.
+        * pywebsocket/mod_pywebsocket/dispatch.py: Removed.
+        * pywebsocket/mod_pywebsocket/handshake.py: Removed.
+        * pywebsocket/mod_pywebsocket/headerparserhandler.py: Removed.
+        * pywebsocket/mod_pywebsocket/memorizingfile.py: Removed.
+        * pywebsocket/mod_pywebsocket/msgutil.py: Removed.
+        * pywebsocket/mod_pywebsocket/standalone.py: Removed.
+        * pywebsocket/mod_pywebsocket/util.py: Removed.
+        * pywebsocket/setup.py: Removed.
+        * pywebsocket/test: Removed.
+        * pywebsocket/test/config.py: Removed.
+        * pywebsocket/test/mock.py: Removed.
+        * pywebsocket/test/run_all.py: Removed.
+        * pywebsocket/test/test_dispatch.py: Removed.
+        * pywebsocket/test/test_handshake.py: Removed.
+        * pywebsocket/test/test_memorizingfile.py: Removed.
+        * pywebsocket/test/test_mock.py: Removed.
+        * pywebsocket/test/test_msgutil.py: Removed.
+        * pywebsocket/test/test_util.py: Removed.
+        * pywebsocket/test/testdata: Removed.
+        * pywebsocket/test/testdata/handlers: Removed.
+        * pywebsocket/test/testdata/handlers/blank_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/origin_check_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub: Removed.
+        * pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub/plain_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py: Removed.
+        * pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py: Removed.
+
+2010-02-26  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Changed the diff_parser module to log to a module-specific
+        logging.logger rather than the root logger.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35391
+
+        * Scripts/webkitpy/diff_parser.py:
+
+2010-02-26  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] LayoutTestController.numberOfPages() should have default parameters
+        https://bugs.webkit.org/show_bug.cgi?id=35428
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp: maxViewWidth and maxViewHeight moved to
+        LayoutTestController to converge to platform independent implementation.
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::open):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Initialization of maxViewWidth and maxViewHeight added.
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+         - Default parameters for LayoutTestController.numberOfPages() added.
+         - maxViewWidth and maxViewHeight members added.
+
+2010-02-26  Jamey Hicks  <jamey.hicks@nokia.com>
+
+        Reviewed by Laszlo Gombos.
+
+        [Qt] added QWebSettings::setInspectorUrl() and QWebSettings::inspectorUrl()
+
+        Enables the use of alternate Web Inspector frontends by changing
+        the location of the frontend. The location is specified by providing 
+            -inspector-url url
+        as an argument to QtLauncher.
+
+        This is required so that the Web Inspector may be run from an
+        external process or an external tool such as Eclipse or Aptana may
+        be used instead of the in-process Web Inspector UI.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=35340
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::init):
+        (LauncherApplication::handleUserOptions):
+
+2010-02-25  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Add a 'passing' port implementation to new-run-webkit-tests that
+        acts as a wrapper around an existing implementation but stubs out
+        the actual test invocations (instead, the expected results are echoed
+        back to the harness). This is useful for coverage and perf testing
+        of the harness (especially perf testing as it essentially provides
+        a lower bound on how fast the harness can run).
+
+        Also added a --nostart-helper flag to new-run-webkit-tests so that
+        you can skip starting the layout_test_helper and actually run the
+        harness even if you don't have a build of that port.
+
+        Also fix a bug in the 'test' port implementation to actually
+        create the results directory under /tmp instead of /.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35370
+
+        * Scripts/webkitpy/layout_tests/port/factory.py: Modified.
+        * Scripts/webkitpy/layout_tests/port/passing.py: Added.
+        * Scripts/webkitpy/layout_tests/port/test.py: Added.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Modified.
+
+2010-02-25  Eric Seidel  <eric@webkit.org>
+
+        Fix typo in my last change.  No review.
+
+        Rename run-chromium-webkit-tests to new-run-webkit-tests to stop confusion
+        https://bugs.webkit.org/show_bug.cgi?id=35408
+
+        * Scripts/new-run-webkit-tests:
+
+2010-02-25  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Rename run-chromium-webkit-tests to new-run-webkit-tests to stop confusion
+        https://bugs.webkit.org/show_bug.cgi?id=35408
+
+        * Scripts/new-run-webkit-tests: Added.
+        * Scripts/run-chromium-webkit-tests: Removed.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py.
+
+2010-02-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by David Levin.
+
+        EWS leaks memory slowly
+        https://bugs.webkit.org/show_bug.cgi?id=35395
+
+        The EWS bots leak memory very slowly.  If you run them for about a
+        month, each one will take up around 1 GB of virutal memory.  If you run
+        several of them on one machine, you'll eventually exhaust all available
+        memory and grind the bots to a halt.
+
+        This patch introduces a --exit-after-iteration option to the queues so
+        that we run them for a finite amount of time.  Once they exit and
+        restart, they'll reclaim the leaked memory.  I'm not sure how many
+        iterations I'll end up running them for.  I'll need to sort that out
+        operationally, but my initial guess is around 1000.
+
+        * Scripts/webkitpy/commands/queues.py:
+        * Scripts/webkitpy/commands/queues_unittest.py:
+
+2010-02-25  Jarkko Sakkinen  <jarkko.sakkinen@tieto.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Qt WebGL support
+
+        Adds toggling of WebGL support to QtLauncher.
+        https://bugs.webkit.org/show_bug.cgi?id=35153
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::toggleWebGL):
+        (LauncherWindow::setupUI):
+
+2010-02-25  Ben Murdoch  <benm@google.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The target element of a Touch should be the target where that touch originated, not where it is now.
+        https://bugs.webkit.org/show_bug.cgi?id=34585
+
+        * DumpRenderTree/qt/EventSenderQt.cpp:
+        (EventSender::addTouchPoint): Fix a bug where touch points were not being given unique ids.
+
+2010-02-24  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] QtLauncher has a border when running on QGraphicsView mode
+        https://bugs.webkit.org/show_bug.cgi?id=35352
+
+        Fix 2-pixels frame on each border of QtLauncher when running on QGraphicsView mode.
+
+        * QtLauncher/webview.cpp:
+        (WebViewGraphicsBased::WebViewGraphicsBased):
+
+2010-02-23  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by David Levin.
+
+        When the run-chromium-webkit-tests code was landed and the code was
+        refactored into the 'port' package, I accidentally broke using
+        http_server.py or websocket_server.py as command-line scripts
+        (the constructors needed a port object they weren't getting). This
+        change fixes them so that --server start|stop actually works.
+
+        As a part of this, the two files need to be able to call port.get(),
+        but doing that is awkward from a file inside the package, so I moved
+        get() into factory.py and imported that into __init__.py so that
+        http_server.py and websocket_server.py can just import factory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35316
+
+        * Scripts/webkitpy/layout_tests/port/__init__.py:
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-02-24  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by David Levin.
+
+        Fix the function signature for check_sys_deps on the mac port, and
+        fix the ordering of port_obj.check_sys_deps() and
+        port_obj.start_helper() (helper needs to be started before we check
+        the system configuration).
+
+        http://bugs.webkit.org/show_bug.cgi?id=35367
+
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+
+2010-02-24  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Provide default username parameter to SVN.commit_with_message().
+
+        * Scripts/webkitpy/scm.py:
+
+2010-02-24  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Siedel.
+
+        Check the proper directory for a WebKit SVN version (Chromium does
+        not check out the entire WebKit tree directly, but rather pulls
+        individual subdirectories. So, checking for the SVN version in
+        WebKit/WebCore rather than just in WebKit works more reliably across
+        different ports).
+
+        http://bugs.webkit.org/show_bug.cgi?id=35321
+
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+
+2010-02-24  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35357
+        Two editing tests fail after DumpRenderTree run loop changes
+
+        AppKit decided that it wanted to group all editing commands for some reason (and thus undo
+        reverted them all at once).
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dump): Reverted the change that made DumpRenderTree use -[NSApplication run].
+        (runTest): Ditto.
+        (-[DumpRenderTreeApplication isRunning]): Override isRunning with a function that always
+        returns YES. This is another way to make the Java plug-in work.
+
+2010-02-23  Adam Roben  <aroben@apple.com>
+
+        Make commit-log-editor find just-added ChangeLog files
+
+        Fixes <http://webkit.org/b/35294> commit-log-editor doesn't find
+        just-added ChangeLog files
+
+        Reviewed by Dave Levin.
+
+        * Scripts/commit-log-editor:
+        (top level): Modified the regular expression that's used to find
+        modified ChangeLog files to also look for just-added ChangeLog files.
+
+2010-02-24  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        check-webkit-style false positive for WebCore forwarding header
+        https://bugs.webkit.org/show_bug.cgi?id=34604
+
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-02-23  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22602
+        Enable Java in DumpRenderTree (on Mac)
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (exitApplicationRunLoop):
+        (dump):
+        (runTest):
+        DumpRenderTree now runs an NSApplication, not just an event loop. This way, the Java plug-in
+        can start without freezing.
+
+        * Scripts/run-webkit-tests: Compile java sources in LayputTests/java.
+
+2010-02-23  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Need a final integration between QtLauncher and QGVLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=35292
+
+        WebKit coding style fixes.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::resetZoom):
+
+2010-02-23  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Need a final integration between QtLauncher and QGVLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=35292
+
+        Add cloneWindow feature to QtLauncher, when running on QGraphicsView mode.
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::~LauncherWindow):
+        (LauncherWindow::init):
+        (LauncherWindow::cloneWindow):
+        (LauncherWindow::setupUI):
+
+2010-02-23  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix handling of check_wdiff_install when wdiff isn't installed.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35304
+
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+
+2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by NOBODY.
+
+        Fix false positives for 'delete *pointer' statements.
+        http://webkit.org/b/35235
+
+        * WebKitTools/Scripts/webkitpy/style/processors/cpp.py:
+
+2010-02-23  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Gtk] Implement layoutTestController.numberOfPages
+        https://bugs.webkit.org/show_bug.cgi?id=35228
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::numberOfPages):
+
+2010-02-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] QtLauncher should not use internal JavaScriptCore and WebCore interfaces
+        https://bugs.webkit.org/show_bug.cgi?id=35248
+
+        * QtLauncher/QtLauncher.pro:
+        * QtLauncher/utils.h:
+
+2010-02-23  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34439
+
+        Prompts a person for their SVN username if not already cached (by Subversion).
+
+        Currently, webkit-patch is unable to commit to the SVN repo. unless the
+        WebKit SVN username is already cached (from of a prior commit by hand)
+        because "svn commit" (called by webkit-patch) defaults to using the system
+        login name unless the username is already cached or specified on the
+        command line.
+
+        * Scripts/webkitpy/scm.py: Added methods SVN.has_authorization_for_realm and
+        modified SVN.commit_with_message to call it. Added optional username parameter
+        to method SVN.commit_with_message.
+        * Scripts/webkitpy/scm_unittest.py: Added unit test methods: SVNTest.test_commit_with_username,
+        SVNTest.test_has_authorization_for_realm, and SVNTest.test_not_have_authorization_for_realm.
+
+2010-02-22  Dirk Pranke  <dpranke@chromium.org>
+
+        Reviewed by Eric Siedel.
+
+        Add more checking for missing binaries and packages to check_sys_deps()
+
+        https://bugs.webkit.org/show_bug.cgi?id=35062
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+
+2010-02-22  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by David Levin.
+
+        [Gtk] check-webkit-style: GTK style should be allowed in WebKitTools/DumpRenderTree/gtk
+        https://bugs.webkit.org/show_bug.cgi?id=35229
+
+        * Scripts/webkitpy/style/checker.py:
+        * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-02-22  James Robinson  <jamesr@chromium.org>
+
+        Unreviewed. Adding myself to committers list.
+
+        * Scripts/webkitpy/committers.py:
+
+2010-02-22  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Remove DRT hack that turns off hardware acceleration with older QuickTimes
+        https://bugs.webkit.org/show_bug.cgi?id=35275
+        
+        Now that WebKit does a version check to avoid a QuickTime-related
+        crash (r55100), DumpRenderTree does not need to.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetDefaultsToConsistentValues):
+
+2010-02-22  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Build the DRT in debug on Mac OS X
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2010-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Add support for layout tests on Symbian
+        https://bugs.webkit.org/show_bug.cgi?id=31589
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        * DumpRenderTree/qt/main.cpp:
+        (main):
+
+2010-02-20  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved simplejson into webkitpy/thirdparty directory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35196
+
+        * Scripts/run-chromium-webkit-tests:
+          - Added webkitpy/thirdparty to the script's search path.
+
+        * Scripts/webkitpy/thirdparty/simplejson: Copied from WebKitTools/simplejson.
+          - Copied simplejson directory.
+
+        * simplejson: Removed.
+        * simplejson/LICENSE.txt: Removed.
+        * simplejson/README.txt: Removed.
+        * simplejson/__init__.py: Removed.
+        * simplejson/_speedups.c: Removed.
+        * simplejson/decoder.py: Removed.
+        * simplejson/encoder.py: Removed.
+        * simplejson/jsonfilter.py: Removed.
+        * simplejson/scanner.py: Removed.
+
+2010-02-20  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Moved BeautifulSoup to webkitpy/thirdparty directory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35195
+
+        * Scripts/webkitpy/BeautifulSoup.py: Removed.
+          - Moved to webkitpy/thirdparty.
+
+        * Scripts/webkitpy/bugzilla.py:
+          - Updated import statement.
+
+        * Scripts/webkitpy/bugzilla_unittest.py:
+          - Updated import statement.
+
+        * Scripts/webkitpy/buildbot.py:
+          - Updated import statement.
+
+        * Scripts/webkitpy/buildbot_unittest.py:
+          - Updated import statement.
+
+        * Scripts/webkitpy/statusserver.py:
+          - Updated import statement.
+
+        * Scripts/webkitpy/thirdparty/BeautifulSoup.py: Copied from WebKitTools/Scripts/webkitpy/BeautifulSoup.py.
+
+2010-02-20  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Created a directory for third-party Python code, and moved
+        autoinstall.py into it.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34540
+
+        * Scripts/webkitpy/__init__.py:
+          - Updated "import autoinstall" statement.
+
+        * Scripts/webkitpy/autoinstall.py: Removed.
+          - Moved to thirdparty/autoinstall.py.
+
+        * Scripts/webkitpy/thirdparty: Added.
+        * Scripts/webkitpy/thirdparty/__init__.py: Added.
+        * Scripts/webkitpy/thirdparty/autoinstall.py: Copied from WebKitTools/Scripts/webkitpy/autoinstall.py.
+
+2010-02-20  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Unreviewed, obvious fix for the python failure in our new buildbot
+        step:
+
+        http://build.webkit.org/builders/GTK Linux 32-bit Release/builds/9075/steps/API tests/logs/err.text
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2010-02-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by David Levin.
+
+        Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+        https://bugs.webkit.org/show_bug.cgi?id=35147
+
+        * Scripts/build-webkit: Handle new flag.
+
+2010-02-19  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Shinichiro Hamaji.
+
+        [style-queue] should not complain about identifier names with underscores under WebKit/efl/ewk/
+        https://bugs.webkit.org/show_bug.cgi?id=35091
+
+        White list unix_hacker_style names in WebKit/efl/ewk because these
+        are used in the EFL API.
+
+        * Scripts/webkitpy/style/checker.py:
+         - Filter out readability/naming on WebKit/efl/ewk.
+
+2010-02-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Split out "prepare-rollout" from "rollout" and make --complete-rollout default
+        https://bugs.webkit.org/show_bug.cgi?id=33745
+
+        * Scripts/webkitpy/commands/download.py:
+         - Add a new AbstractRolloutPrepCommand to share code between PrepareRollout and Rollout
+         - Add PrepareRollout
+        * Scripts/webkitpy/commands/download_unittest.py: Test PrepareRollout, remove CompleteRollout tests.
+        * Scripts/webkitpy/steps/__init__.py: include ReopenBugAfterRollout step.
+        * Scripts/webkitpy/steps/completerollout.py: Removed.
+        * Scripts/webkitpy/steps/options.py: remove complete_rollout
+        * Scripts/webkitpy/steps/reopenbugafterrollout.py: Added.
+
 2010-02-19  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
index 045bc80..798389f 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
@@ -77,12 +77,26 @@
     return JSValueMakeUndefined(ctx);
 }
 
+static JSValueRef getElementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    int x = 0;
+    int y = 0;
+    if (argumentCount == 2) {
+        x = JSValueToNumber(context, arguments[0], exception);
+        y = JSValueToNumber(context, arguments[1], exception);
+    }
+    
+    AccessibilityController* controller = static_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject));
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, controller->elementAtPoint(x, y));
+}
+
 JSClassRef AccessibilityController::getJSClass()
 {
     static JSStaticFunction staticFunctions[] = {
         { "logFocusEvents", logFocusEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "logValueChangeEvents", logValueChangeEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "logScrollingStartEvents", logScrollingStartEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "elementAtPoint", getElementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0 }
     };
 
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.h b/WebKitTools/DumpRenderTree/AccessibilityController.h
index de58f84..5a6ca13 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.h
@@ -45,6 +45,7 @@
     // Controller Methods - platform-independent implementations
     AccessibilityUIElement rootElement();
     AccessibilityUIElement focusedElement();
+    AccessibilityUIElement elementAtPoint(int x, int y);
 
     void setLogFocusEvents(bool);
     void setLogValueChangeEvents(bool);
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 87fe05c..9cf34de 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -344,6 +344,12 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef pressCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    toAXElement(thisObject)->press();
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef takeFocusCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     toAXElement(thisObject)->takeFocus();
@@ -435,6 +441,12 @@
     return JSValueMakeString(context, language.get());
 }
 
+static JSValueRef getHelpTextCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> language(Adopt, toAXElement(thisObject)->helpText());
+    return JSValueMakeString(context, language.get());
+}
+
 static JSValueRef getOrientationCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     JSRetainPtr<JSStringRef> orientation(Adopt, toAXElement(thisObject)->orientation());
@@ -446,6 +458,16 @@
     return JSValueMakeNumber(context, toAXElement(thisObject)->childrenCount());
 }
 
+static JSValueRef rowCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeNumber(context, toAXElement(thisObject)->rowCount());
+}
+
+static JSValueRef columnCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeNumber(context, toAXElement(thisObject)->columnCount());
+}
+
 static JSValueRef getXCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     return JSValueMakeNumber(context, toAXElement(thisObject)->x());
@@ -602,6 +624,12 @@
     return JSValueMakeBoolean(context, succeeded);
 }
 
+static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    toAXElement(thisObject)->removeNotificationListener();
+    return JSValueMakeUndefined(context);
+}
+
 // Destruction
 
 static void finalize(JSObjectRef thisObject)
@@ -626,6 +654,7 @@
         { "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "description", getDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "language", getLanguageCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "helpText", getHelpTextCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "stringValue", getStringValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "x", getXCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "y", getYCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -637,6 +666,8 @@
         { "minValue", getMinValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "maxValue", getMaxValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "childrenCount", getChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "rowCount", rowCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "columnCount", columnCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "insertionPointLineNumber", getInsertionPointLineNumberCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "selectedTextRange", getSelectedTextRangeCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isEnabled", getIsEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -696,12 +727,14 @@
         { "increment", incrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "decrement", decrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "showMenu", showMenuCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "press", pressCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "disclosedRowAtIndex", disclosedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "ariaOwnsElementAtIndex", ariaOwnsElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "ariaFlowToElementAtIndex", ariaFlowToElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "selectedRowAtIndex", selectedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isEqual", isEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "addNotificationListener", addNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "removeNotificationListener", removeNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "takeFocus", takeFocusCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "takeSelection", takeSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "addSelection", addSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index e7d3bc7..f62ec1a 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -51,6 +51,14 @@
 typedef void* PlatformUIElement;
 #endif
 
+#if PLATFORM(MAC)
+#ifdef __OBJC__
+typedef id NotificationHandler;
+#else
+typedef struct objc_object* NotificationHandler;
+#endif
+#endif
+
 class AccessibilityUIElement {
 public:
     AccessibilityUIElement(PlatformUIElement);
@@ -89,6 +97,7 @@
     void increment();
     void decrement();
     void showMenu();
+    void press();
 
     // Attributes - platform-independent implementations
     JSStringRef stringAttributeValue(JSStringRef attribute);
@@ -104,6 +113,7 @@
     JSStringRef language();
     JSStringRef stringValue();
     JSStringRef accessibilityValue() const;
+    JSStringRef helpText() const;
     JSStringRef orientation() const;
     double x();
     double y();
@@ -143,6 +153,8 @@
     int indexInTable();
     JSStringRef rowIndexRange();
     JSStringRef columnIndexRange();
+    int rowCount();
+    int columnCount();
     
     // Tree/Outline specific attributes
     AccessibilityUIElement selectedRowAtIndex(unsigned);
@@ -170,12 +182,17 @@
     // Notifications
     // Function callback should take one argument, the name of the notification.
     bool addNotificationListener(JSObjectRef functionCallback);
+    // Make sure you call remove, because you can't rely on objects being deallocated in a timely fashion.
+    void removeNotificationListener();
     
 private:
     static JSClassRef getJSClass();
-
     PlatformUIElement m_element;
-    JSObjectRef m_notificationFunctionCallback;
+    
+    // A retained, platform specific object used to help manage notifications for this object.
+#if PLATFORM(MAC)
+    NotificationHandler m_notificationHandler;
+#endif
 };
 
 #endif // AccessibilityUIElement_h
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/WebKitTools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
new file mode 100644
index 0000000..82b8671
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp
@@ -0,0 +1,186 @@
+#
+# 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.
+#
+
+{
+    'includes': [
+        '../../../WebKit/chromium/features.gypi',
+    ],
+    'variables': {
+        'webkit_top': '../../..',
+        'webkit_api_dir': '<(webkit_top)/WebKit/chromium',
+        'conditions': [
+            # Location of the chromium src directory and target type is different
+            # if webkit is built inside chromium or as standalone project.
+            ['inside_chromium_build==0', {
+                # DumpRenderTree is being built outside of the full chromium project.
+                # e.g. via build-dumprendertree --chromium
+                'chromium_src_dir': '<(webkit_api_dir)',
+                'webkit_support_gyp': '<(webkit_api_dir)/webkit/support/webkit_support.gyp',
+            },{
+                # WebKit is checked out in src/chromium/third_party/WebKit
+                'chromium_src_dir': '<(webkit_top)/../..',
+                'webkit_support_gyp': '<(webkit_top)/../../webkit/webkit.gyp',
+            }],
+        ],
+    },
+    'target_defaults': {
+        'target_conditions': [
+            ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
+                'sources/': [
+                    ['exclude', '(Gtk|Linux)\\.cpp$']
+                ]
+            }],
+            ['OS!="win"', {
+                'sources/': [
+                    ['exclude', 'Win\\.cpp$'],
+                ]
+            }],
+            ['OS!="mac"', {
+                'sources/': [
+                    # .mm is already excluded by common.gypi
+                    ['exclude', 'Mac\\.cpp$'],
+                ]
+            }],
+        ],
+    },
+    'targets': [
+        {
+            'target_name': 'DumpRenderTree',
+            'type': 'executable',
+            'mac_bundle': 1,
+            'dependencies': [
+                '<(webkit_api_dir)/WebKit.gyp:webkit',
+                '<(webkit_top)/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config',
+                '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
+                '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+                '<(chromium_src_dir)/skia/skia.gyp:skia',
+                '<(webkit_support_gyp):webkit_support',
+            ],
+            'include_dirs': [
+                '.',
+                '<(webkit_api_dir)',
+                '<(webkit_top)/JavaScriptCore',
+                '<(webkit_top)/WebKit/mac/WebCoreSupport', # For WebSystemInterface.h
+                '<(chromium_src_dir)',
+            ],
+            'defines': [
+                # Technically not a unit test but require functions available only to
+                # unit tests.
+                'UNIT_TEST',
+            ],
+            'sources': [
+                '../chromium/AccessibilityController.cpp',
+                '../chromium/AccessibilityController.h',
+                '../chromium/AccessibilityUIElement.cpp',
+                '../chromium/AccessibilityUIElement.h',
+                '../chromium/CppBoundClass.cpp',
+                '../chromium/CppBoundClass.h',
+                '../chromium/CppVariant.cpp',
+                '../chromium/CppVariant.h',
+                '../chromium/DumpRenderTree.cpp',
+                '../chromium/EventSender.cpp',
+                '../chromium/EventSender.h',
+                '../chromium/LayoutTestController.cpp',
+                '../chromium/LayoutTestController.h',
+                '../chromium/MockSpellCheck.cpp',
+                '../chromium/MockSpellCheck.h',
+                '../chromium/PlainTextController.cpp',
+                '../chromium/PlainTextController.h',
+                '../chromium/TestNavigationController.cpp',
+                '../chromium/TestNavigationController.h',
+                '../chromium/TestShell.cpp',
+                '../chromium/TestShell.h',
+                '../chromium/TestShellGtk.cpp',
+                '../chromium/TestShellMac.mm',
+                '../chromium/TestShellWin.cpp',
+                '../chromium/TextInputController.cpp',
+                '../chromium/TextInputController.h',
+                '../chromium/WebViewHost.cpp',
+                '../chromium/WebViewHost.h',
+            ],
+            'mac_bundle_resources': [
+                '../qt/fonts/AHEM____.TTF',
+                '../fonts/WebKitWeightWatcher100.ttf',
+                '../fonts/WebKitWeightWatcher200.ttf',
+                '../fonts/WebKitWeightWatcher300.ttf',
+                '../fonts/WebKitWeightWatcher400.ttf',
+                '../fonts/WebKitWeightWatcher500.ttf',
+                '../fonts/WebKitWeightWatcher600.ttf',
+                '../fonts/WebKitWeightWatcher700.ttf',
+                '../fonts/WebKitWeightWatcher800.ttf',
+                '../fonts/WebKitWeightWatcher900.ttf',
+            ],
+            'conditions': [
+                ['OS=="mac"', {
+                    'dependencies': ['LayoutTestHelper'],
+                }],
+            ],
+        },
+
+        {
+            'target_name': 'ImageDiff',
+            'type': 'executable',
+            'dependencies': [
+                '<(webkit_top)/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+                '<(chromium_src_dir)/gfx/gfx.gyp:gfx',
+            ],
+            'include_dirs': [
+                '<(webkit_top)/JavaScriptCore',
+                '<(chromium_src_dir)',
+            ],
+            'sources': [
+                '../chromium/ImageDiff.cpp',
+            ],
+        },
+    ], # targets
+
+    'conditions': [
+        ['OS=="mac"', {
+            'targets': [
+                {
+                    'target_name': 'LayoutTestHelper',
+                    'type': 'executable',
+                    'sources': ['../chromium/LayoutTestHelper.mm'],
+                    'link_settings': {
+                        'libraries': [
+                            '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+                        ],
+                    },
+                },
+            ],
+        }],
+    ], # conditions
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index 06f0599..3adfaf2 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -35,6 +35,8 @@
 		1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */; };
 		1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7810D07589B00CD3161 /* TestObject.cpp */; };
 		23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; };
+		3713EDE2115BE19300705720 /* ColorBits-A.png in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDDF115BE16F00705720 /* ColorBits-A.png */; };
+		3713EDE3115BE19300705720 /* ColorBits.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDE0115BE16F00705720 /* ColorBits.ttf */; };
 		5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; };
 		5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; };
 		5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */ = {isa = PBXBuildFile; fileRef = AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */; };
@@ -156,6 +158,8 @@
 			dstSubfolderSpec = 7;
 			files = (
 				5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */,
+				3713EDE2115BE19300705720 /* ColorBits-A.png in Copy Font Files */,
+				3713EDE3115BE19300705720 /* ColorBits.ttf in Copy Font Files */,
 				5DB9AC980F722C3600684641 /* WebKitWeightWatcher100.ttf in Copy Font Files */,
 				5DB9AC990F722C3600684641 /* WebKitWeightWatcher200.ttf in Copy Font Files */,
 				5DB9AC9A0F722C3600684641 /* WebKitWeightWatcher300.ttf in Copy Font Files */,
@@ -182,6 +186,8 @@
 		1AC6C7810D07589B00CD3161 /* TestObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestObject.cpp; sourceTree = "<group>"; };
 		23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
 		32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
+		3713EDDF115BE16F00705720 /* ColorBits-A.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ColorBits-A.png"; path = "fonts/ColorBits-A.png"; sourceTree = "<group>"; };
+		3713EDE0115BE16F00705720 /* ColorBits.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ColorBits.ttf; path = fonts/ColorBits.ttf; sourceTree = "<group>"; };
 		375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; };
 		375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; };
 		375F09730DAC3CB600C8B4E5 /* WebKitWeightWatcher300.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher300.ttf; path = fonts/WebKitWeightWatcher300.ttf; sourceTree = "<group>"; };
@@ -417,6 +423,8 @@
 		9345229B0BD12B2C0086EDA0 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				3713EDDF115BE16F00705720 /* ColorBits-A.png */,
+				3713EDE0115BE16F00705720 /* ColorBits.ttf */,
 				AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */,
 				375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */,
 				375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */,
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index f528b31..a736160 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -74,6 +74,7 @@
     , m_globalFlag(false)
     , m_isGeolocationPermissionSet(false)
     , m_geolocationPermission(false)
+    , m_handlesAuthenticationChallenges(false)
     , m_testPathOrURL(testPathOrURL)
     , m_expectedPixelHash(expectedPixelHash)
 {
@@ -280,6 +281,14 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has mac & windows implementation
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+
+    return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView());
+}
+
 static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac & windows implementation
@@ -456,6 +465,23 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 1)
+        return JSValueMakeUndefined(context);
+    
+    // Has mac implementation
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
+}
+
+static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has mac & windows implementation
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    return JSValueMakeString(context, controller->layerTreeAsText().get());
+}
+
 static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac & windows implementation
@@ -914,14 +940,26 @@
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef setFrameSetFlatteningEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0]));
+
+    return JSValueMakeUndefined(context);
+}
+
+
+static JSValueRef setFrameFlatteningEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac & windows implementation
     if (argumentCount < 1)
         return JSValueMakeUndefined(context);
 
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->setFrameSetFlatteningEnabled(JSValueToBoolean(context, arguments[0]));
+    controller->setFrameFlatteningEnabled(JSValueToBoolean(context, arguments[0]));
 
     return JSValueMakeUndefined(context);
 }
@@ -1011,6 +1049,25 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has mac & windows implementation
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> header(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+
+    size_t maxLength = JSStringGetMaximumUTF8CStringSize(header.get());
+    char* headerBuffer = new char[maxLength + 1];
+    JSStringGetUTF8CString(header.get(), headerBuffer, maxLength + 1);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setWillSendRequestClearHeader(headerBuffer);
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef setWillSendRequestReturnsNullCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has cross-platform implementation
@@ -1217,7 +1274,7 @@
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef whiteListAccessFromOriginCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef addOriginAccessWhitelistEntryCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     if (argumentCount != 4)
         return JSValueMakeUndefined(context);
@@ -1231,7 +1288,40 @@
     bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
 
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->whiteListAccessFromOrigin(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
+    controller->addOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef removeOriginAccessWhitelistEntryCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 4)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> sourceOrigin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> destinationProtocol(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> destinationHost(Adopt, JSValueToStringCopy(context, arguments[2], exception));
+    ASSERT(!*exception);
+    bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->removeOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setScrollbarPolicyCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 2)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> orientation(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    ASSERT(!*exception);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setScrollbarPolicy(orientation.get(), policy.get());
     return JSValueMakeUndefined(context);
 }
 
@@ -1278,6 +1368,51 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef apiTestGoToCurrentBackForwardItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->apiTestGoToCurrentBackForwardItem();
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has Mac implementation
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setWebViewEditable(JSValueToBoolean(context, arguments[0]));
+
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+    return JSValueMakeString(context, controller->markerTextForListItem(context, arguments[0]).get());
+}
+
+static JSValueRef authenticateSessionCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // authenticateSession(url, username, password)
+    if (argumentCount != 3)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> username(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception));
+    ASSERT(!*exception);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->authenticateSession(url.get(), username.get(), password.get());
+    return JSValueMakeUndefined(context);
+}
+
 // Static Values
 
 static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
@@ -1355,10 +1490,13 @@
         { "addUserScript", addUserScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "addUserStyleSheet", addUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "apiTestNewWindowDataLoadBaseURL", apiTestNewWindowDataLoadBaseURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "apiTestGoToCurrentBackForwardItem", apiTestGoToCurrentBackForwardItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "callShouldCloseOnWebView", callShouldCloseOnWebViewCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1387,7 +1525,9 @@
         { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
         { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "numberOfPages", numberOfPagesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1404,6 +1544,7 @@
         { "queueNonLoadingScript", queueNonLoadingScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "queueReload", queueReloadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "removeAllVisitedLinks", removeAllVisitedLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "removeOriginAccessWhitelistEntry", removeOriginAccessWhitelistEntryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "repaintSweepHorizontally", repaintSweepHorizontallyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setAcceptsEditing", setAcceptsEditingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setAllowUniversalAccessFromFileURLs", setAllowUniversalAccessFromFileURLsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1413,45 +1554,50 @@
         { "setAuthenticationPassword", setAuthenticationPasswordCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setAuthenticationUsername", setAuthenticationUsernameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setAuthorAndUserStylesEnabled", setAuthorAndUserStylesEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setCacheModel", setCacheModelCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setCallCloseOnWebViews", setCallCloseOnWebViewsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setCanOpenWindows", setCanOpenWindowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setCacheModel", setCacheModelCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setCloseRemainingWindowsWhenComplete", setCloseRemainingWindowsWhenCompleteCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setCustomPolicyDelegate", setCustomPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setDatabaseQuota", setDatabaseQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
         { "setDomainRelaxationForbiddenForURLScheme", setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setFrameFlatteningEnabled", setFrameFlatteningEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setGeolocationPermission", setGeolocationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setJavaScriptProfilingEnabled", setJavaScriptProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setPopupBlockingEnabled", setPopupBlockingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setPrivateBrowsingEnabled", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "setFrameSetFlatteningEnabled", setFrameSetFlatteningEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setSelectTrailingWhitespaceEnabled", setSelectTrailingWhitespaceEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setSmartInsertDeleteEnabled", setSmartInsertDeleteEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setSpatialNavigationEnabled", setSpatialNavigationEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setStopProvisionalFrameLoads", setStopProvisionalFrameLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setTabKeyCyclesThroughElements", setTabKeyCyclesThroughElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setTimelineProfilingEnabled", setTimelineProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUseDashboardCompatibilityMode", setUseDashboardCompatibilityModeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUserStyleSheetEnabled", setUserStyleSheetEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUserStyleSheetLocation", setUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setWebViewEditable", setWebViewEditableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setWillSendRequestClearHeader", setWillSendRequestClearHeaderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWillSendRequestReturnsNull", setWillSendRequestReturnsNullCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWillSendRequestReturnsNullOnRedirect", setWillSendRequestReturnsNullOnRedirectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWindowIsKey", setWindowIsKeyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "showWebInspector", showWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "waitForPolicyDelegate", waitForPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "waitUntilDone", waitUntilDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "windowCount", windowCountCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "whiteListAccessFromOrigin", whiteListAccessFromOriginCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "addOriginAccessWhitelistEntry", addOriginAccessWhitelistEntryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setScrollbarPolicy", setScrollbarPolicyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "authenticateSession", authenticateSessionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0 }
     };
 
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 3add32a..198a9f3 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -31,9 +31,10 @@
 
 #include <JavaScriptCore/JSObjectRef.h>
 #include <JavaScriptCore/JSRetainPtr.h>
-#include <wtf/RefCounted.h>
+#include <set>
 #include <string>
 #include <vector>
+#include <wtf/RefCounted.h>
 
 class LayoutTestController : public RefCounted<LayoutTestController> {
 public:
@@ -46,6 +47,7 @@
     void clearAllDatabases();
     void clearBackForwardList();
     void clearPersistentUserStyleSheet();
+    bool callShouldCloseOnWebView();
     JSStringRef copyDecodedHostName(JSStringRef name);
     JSStringRef copyEncodedHostName(JSStringRef name);
     void disableImageLoading();
@@ -55,6 +57,7 @@
     JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef id);
     bool isCommandEnabled(JSStringRef name);
     void keepWebHistory();
+    JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
     void notifyDone();
     int numberOfPages(float pageWidthInPixels, float pageHeightInPixels);
     void overridePreference(JSStringRef key, JSStringRef value);
@@ -91,7 +94,9 @@
     void setUserStyleSheetEnabled(bool flag);
     void setUserStyleSheetLocation(JSStringRef path);
     void setXSSAuditorEnabled(bool flag);
-    void setFrameSetFlatteningEnabled(bool enable);
+    void setFrameFlatteningEnabled(bool enable);
+    void setSpatialNavigationEnabled(bool enable);
+    void setScrollbarPolicy(JSStringRef orientation, JSStringRef policy);
 
     void waitForPolicyDelegate();
     size_t webHistoryItemCount();
@@ -185,6 +190,9 @@
     void setWaitToDump(bool waitToDump);
     void waitToDumpWatchdogTimerFired();
 
+    const std::set<std::string>& willSendRequestClearHeaders() const { return m_willSendRequestClearHeaders; }
+    void setWillSendRequestClearHeader(std::string header) { m_willSendRequestClearHeaders.insert(header); }
+
     bool willSendRequestReturnsNull() const { return m_willSendRequestReturnsNull; }
     void setWillSendRequestReturnsNull(bool returnsNull) { m_willSendRequestReturnsNull = returnsNull; }
 
@@ -217,7 +225,8 @@
     bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId);
     unsigned numberOfActiveAnimations() const;
 
-    void whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
+    void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
+    void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
 
     void addUserScript(JSStringRef source, bool runAtStart);
     void addUserStyleSheet(JSStringRef source);
@@ -226,6 +235,7 @@
     bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
     bool geolocationPermission() const { return m_geolocationPermission; }
 
+    void setDeveloperExtrasEnabled(bool);
     void showWebInspector();
     void closeWebInspector();
     void setTimelineProfilingEnabled(bool enabled);
@@ -233,10 +243,20 @@
     void evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script);
 
     void setPOSIXLocale(JSStringRef locale);
-    
+
+    void setWebViewEditable(bool);
+
     // The following API test functions should probably be moved to platform-specific 
     // unit tests outside of DRT once they exist.
     void apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL);
+    void apiTestGoToCurrentBackForwardItem();
+
+    // Simulate a request an embedding application could make, populating per-session credential storage.
+    void authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password);
+
+    JSRetainPtr<JSStringRef> layerTreeAsText() const;
+
+    JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const;
 
     static const unsigned maxViewWidth;
     static const unsigned maxViewHeight;
@@ -282,6 +302,8 @@
     std::string m_authenticationPassword; 
     std::string m_testPathOrURL;
     std::string m_expectedPixelHash;    // empty string if no hash
+
+    std::set<std::string> m_willSendRequestClearHeaders;
     
     // origins which have been granted desktop notification access
     std::vector<JSStringRef> m_desktopNotificationAllowedOrigins;
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
index 8e278f5..7d388d0 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Collabora Ltd.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -134,6 +135,7 @@
     ID_PROPERTY_PRIVATE_BROWSING_ENABLED,
     ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED,
     ID_PROPERTY_THROW_EXCEPTION_PROPERTY,
+    ID_LAST_SET_WINDOW_ARGUMENTS,
     NUM_PROPERTY_IDENTIFIERS
 };
 
@@ -147,7 +149,8 @@
     "returnErrorFromNewStream",
     "privateBrowsingEnabled",
     "cachedPrivateBrowsingEnabled",
-    "testThrowExceptionProperty"
+    "testThrowExceptionProperty",
+    "lastSetWindowArguments"
 };
 
 enum {
@@ -181,6 +184,8 @@
     ID_GET_AND_FORGET_REMEMBERED_OBJECT,
     ID_REF_COUNT,
     ID_SET_STATUS,
+    ID_RESIZE_TO,
+    ID_NORMALIZE,
     NUM_METHOD_IDENTIFIERS
 };
 
@@ -215,7 +220,9 @@
     "getRememberedObject",
     "getAndForgetRememberedObject",
     "refCount",
-    "setStatus"
+    "setStatus",
+    "resizeTo",
+    "normalize"
 };
 
 static NPUTF8* createCStringFromNPVariant(const NPVariant* variant)
@@ -283,7 +290,15 @@
     } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
         browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
         return true;
+    } else if (name == pluginPropertyIdentifiers[ID_LAST_SET_WINDOW_ARGUMENTS]) {
+        char* buf = static_cast<char*>(browser->memalloc(256));
+        snprintf(buf, 256, "x: %d, y: %d, width: %u, height: %u, clipRect: (%u, %u, %u, %u)", (int)plugin->lastWindow.x, (int)plugin->lastWindow.y, (unsigned)plugin->lastWindow.width, (unsigned)plugin->lastWindow.height,
+            plugin->lastWindow.clipRect.left, plugin->lastWindow.clipRect.top, plugin->lastWindow.clipRect.right - plugin->lastWindow.clipRect.left, plugin->lastWindow.clipRect.bottom - plugin->lastWindow.clipRect.top);
+
+        STRINGZ_TO_NPVARIANT(buf, *result);
+        return true;
     }
+
     return false;
 }
 
@@ -405,8 +420,8 @@
     free(callbackString);
 
     NPVariant browserResult;
-    browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult);
-    browser->releasevariantvalue(&browserResult);
+    if (browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult))
+        browser->releasevariantvalue(&browserResult);
 
     browser->releaseobject(windowScriptObject);
     
@@ -519,8 +534,8 @@
             NPVariant args[1];
             STRINGZ_TO_NPVARIANT(string, args[0]);
             NPVariant browserResult;
-            browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult);
-            browser->releasevariantvalue(&browserResult);
+            if (browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult))
+                browser->releasevariantvalue(&browserResult);
             browser->memfree(string);
         }
 
@@ -710,8 +725,10 @@
 
     NPVariant docVariant;
     browser->getproperty(npp, windowObject, documentId, &docVariant);
-    if (docVariant.type != NPVariantType_Object)
+    if (docVariant.type != NPVariantType_Object) {
+        browser->releaseobject(windowObject);
         return false;
+    }
 
     NPObject *documentObject = NPVARIANT_TO_OBJECT(docVariant);
 
@@ -720,17 +737,25 @@
     STRINGZ_TO_NPVARIANT("_blank", openArgs[1]);
 
     NPVariant result;
-    browser->invoke(npp, documentObject, openId, openArgs, 2, &result);
-    browser->releaseobject(documentObject);
-
-    if (result.type == NPVariantType_Object) {
-        pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS");
-        notifyTestCompletion(npp, result.value.objectValue);
-        browser->releaseobject(result.value.objectValue);
-        return true;
+    if (!browser->invoke(npp, documentObject, openId, openArgs, 2, &result)) {
+        browser->releaseobject(windowObject);
+        browser->releaseobject(documentObject);
+        return false;
     }
 
-    return false;
+    browser->releaseobject(documentObject);
+
+    if (result.type != NPVariantType_Object) {
+        browser->releaseobject(windowObject);
+        browser->releasevariantvalue(&result);
+        return false;
+    }
+
+    pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS");
+    notifyTestCompletion(npp, result.value.objectValue);
+    browser->releaseobject(result.value.objectValue);
+    browser->releaseobject(windowObject);
+    return true;
 }
 
 bool testWindowOpen(NPP npp)
@@ -747,14 +772,22 @@
     STRINGZ_TO_NPVARIANT("_blank", openArgs[1]);
 
     NPVariant result;
-    browser->invoke(npp, windowObject, openId, openArgs, 2, &result);
-    if (result.type == NPVariantType_Object) {
-        pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS");
-        notifyTestCompletion(npp, result.value.objectValue);
-        browser->releaseobject(result.value.objectValue);
-        return true;
+    if (!browser->invoke(npp, windowObject, openId, openArgs, 2, &result)) {
+        browser->releaseobject(windowObject);
+        return false;
     }
-    return false;
+
+    if (result.type != NPVariantType_Object) {
+        browser->releaseobject(windowObject);
+        browser->releasevariantvalue(&result);
+        return false;
+    }
+
+    pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS");
+    notifyTestCompletion(npp, result.value.objectValue);
+    browser->releaseobject(result.value.objectValue);
+    browser->releaseobject(windowObject);
+    return true;
 }
 
 static bool testSetStatus(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
@@ -771,7 +804,40 @@
     return true;
 }
 
-static NPObject* rememberedObject;
+static bool testResizeTo(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+    VOID_TO_NPVARIANT(*result);
+
+    NPObject* windowObject;
+    if (NPERR_NO_ERROR != browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject))
+        return false;
+
+    NPVariant callResult;
+    if (browser->invoke(obj->npp, windowObject, browser->getstringidentifier("resizePlugin"), args, argCount, &callResult))
+        browser->releasevariantvalue(&callResult);
+
+    // Force layout.
+    if (browser->getproperty(obj->npp, windowObject, browser->getstringidentifier("pageYOffset"), &callResult))
+        browser->releasevariantvalue(&callResult);
+
+    return true;
+}
+
+static bool normalizeOverride(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+    VOID_TO_NPVARIANT(*result);
+
+    NPObject* windowObject;
+    if (NPERR_NO_ERROR != browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject))
+        return false;
+
+    NPVariant callResult;
+    if (browser->invoke(obj->npp, windowObject, browser->getstringidentifier("pluginCallback"), args, argCount, &callResult))
+        browser->releasevariantvalue(&callResult);
+
+    return true;
+}
+
 
 static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
@@ -834,21 +900,21 @@
         browser->setproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), &args[2]);
         return true;
     } else if (name == pluginMethodIdentifiers[ID_REMEMBER]) {
-        if (rememberedObject)
-            browser->releaseobject(rememberedObject);
-        rememberedObject = NPVARIANT_TO_OBJECT(args[0]);
-        browser->retainobject(rememberedObject);
+        if (plugin->rememberedObject)
+            browser->releaseobject(plugin->rememberedObject);
+        plugin->rememberedObject = NPVARIANT_TO_OBJECT(args[0]);
+        browser->retainobject(plugin->rememberedObject);
         VOID_TO_NPVARIANT(*result);
         return true;
     } else if (name == pluginMethodIdentifiers[ID_GET_REMEMBERED_OBJECT]) {
-        assert(rememberedObject);
-        browser->retainobject(rememberedObject);
-        OBJECT_TO_NPVARIANT(rememberedObject, *result);
+        assert(plugin->rememberedObject);
+        browser->retainobject(plugin->rememberedObject);
+        OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result);
         return true;
     } else if (name == pluginMethodIdentifiers[ID_GET_AND_FORGET_REMEMBERED_OBJECT]) {
-        assert(rememberedObject);
-        OBJECT_TO_NPVARIANT(rememberedObject, *result);
-        rememberedObject = 0;
+        assert(plugin->rememberedObject);
+        OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result);
+        plugin->rememberedObject = 0;
         return true;
     } else if (name == pluginMethodIdentifiers[ID_REF_COUNT]) {
         uint32_t refCount = NPVARIANT_TO_OBJECT(args[0])->referenceCount;
@@ -856,6 +922,10 @@
         return true;
     } else if (name == pluginMethodIdentifiers[ID_SET_STATUS])
         return testSetStatus(plugin, args, argCount, result);
+    else if (name == pluginMethodIdentifiers[ID_RESIZE_TO])
+        return testResizeTo(plugin, args, argCount, result);
+    else if (name == pluginMethodIdentifiers[ID_NORMALIZE])
+        return normalizeOverride(plugin, args, argCount, result);
     
     return false;
 }
@@ -870,6 +940,7 @@
 {
     PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
     plugin->testObject = 0;
+    plugin->rememberedObject = 0;
 }
 
 static NPObject *pluginAllocate(NPP npp, NPClass *theClass)
@@ -883,11 +954,13 @@
 
     newInstance->npp = npp;
     newInstance->testObject = browser->createobject(npp, getTestClass());
+    newInstance->rememberedObject = 0;
     newInstance->eventLogging = FALSE;
     newInstance->onStreamLoad = 0;
     newInstance->onStreamDestroy = 0;
     newInstance->onDestroy = 0;
     newInstance->onURLNotify = 0;
+    newInstance->onSetWindow = 0;
     newInstance->logDestroy = FALSE;
     newInstance->logSetWindow = FALSE;
     newInstance->returnErrorFromNewStream = FALSE;
@@ -900,6 +973,7 @@
 
     newInstance->testDocumentOpenInDestroyStream = FALSE;
     newInstance->testWindowOpen = FALSE;
+    newInstance->testKeyboardFocusForPlugins = FALSE;
 
     return (NPObject*)newInstance;
 }
@@ -909,6 +983,8 @@
     PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
     if (plugin->testObject)
         browser->releaseobject(plugin->testObject);
+    if (plugin->rememberedObject)
+        browser->releaseobject(plugin->rememberedObject);
 
     free(plugin->firstUrl);
     free(plugin->firstHeaders);
@@ -947,8 +1023,8 @@
         NULL_TO_NPVARIANT(args[1]);
 
     NPVariant browserResult;
-    browser->invoke(object->npp, windowScriptObject, callbackIdentifier, args, 2, &browserResult);
-    browser->releasevariantvalue(&browserResult);
+    if (browser->invoke(object->npp, windowScriptObject, callbackIdentifier, args, 2, &browserResult))
+        browser->releasevariantvalue(&browserResult);
 
     free(strHdr);
 }
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
index 157a1d2..2ae4dbf 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
@@ -37,13 +37,16 @@
     NPBool returnErrorFromNewStream;
     NPBool cachedPrivateBrowsingMode;
     NPObject* testObject;
+    NPObject* rememberedObject;
     NPStream* stream;
     NPBool testDocumentOpenInDestroyStream;
     NPBool testWindowOpen;
+    NPBool testKeyboardFocusForPlugins;
     char* onStreamLoad;
     char* onStreamDestroy;
     char* onDestroy;
     char* onURLNotify;
+    char* onSetWindow;
     char* firstUrl;
     char* firstHeaders;
     char* lastUrl;
@@ -51,6 +54,7 @@
 #ifdef XP_MACOSX
     NPEventModel eventModel;
 #endif
+    NPWindow lastWindow;
 } PluginObject;
 
 extern NPClass *getPluginClass(void);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp
index 8ef228a..a552774 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp
@@ -93,6 +93,8 @@
         else if (strcasecmp(argn[i], "src") == 0 &&
                  strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0)
             obj->returnErrorFromNewStream = TRUE;
+        else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+            obj->onSetWindow = strdup(argv[i]);
         else if (strcasecmp(argn[i], "logfirstsetwindow") == 0)
             obj->logSetWindow = TRUE;
         else if (strcasecmp(argn[i], "testnpruntime") == 0)
@@ -111,6 +113,8 @@
             obj->testDocumentOpenInDestroyStream = TRUE;
         else if (strcasecmp(argn[i], "testwindowopen") == 0)
             obj->testWindowOpen = TRUE;
+        else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl"))
+            obj->testKeyboardFocusForPlugins = TRUE;
     }
         
 #ifndef NP_NO_CARBON
@@ -160,6 +164,9 @@
 
         if (obj->onURLNotify)
             free(obj->onURLNotify);
+
+        if (obj->onSetWindow)
+            free(obj->onSetWindow);
         
         if (obj->logDestroy)
             pluginLog(instance, "NPP_Destroy");
@@ -174,15 +181,25 @@
     PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
 
     if (obj) {
+        obj->lastWindow = *window;
+
         if (obj->logSetWindow) {
             pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height);
-            obj->logSetWindow = false;
+            obj->logSetWindow = FALSE;
         }
 
+        if (obj->onSetWindow)
+            executeScript(obj, obj->onSetWindow);
+
         if (obj->testWindowOpen) {
             testWindowOpen(instance);
             obj->testWindowOpen = FALSE;
         }
+
+        if (obj->testKeyboardFocusForPlugins) {
+            obj->eventLogging = true;
+            executeScript(obj, "eventSender.keyDown('A');");
+        }
     }
     
     return NPERR_NO_ERROR;
@@ -275,6 +292,11 @@
             break;
         case keyUp:
             pluginLog(instance, "keyUp '%c'", (char)(event->message & 0xFF));
+            if (obj->testKeyboardFocusForPlugins) {
+                obj->eventLogging = false;
+                obj->testKeyboardFocusForPlugins = FALSE;
+                executeScript(obj, "layoutTestController.notifyDone();");
+            }
             break;
         case autoKey:
             pluginLog(instance, "autoKey '%c'", (char)(event->message & 0xFF));
@@ -338,7 +360,21 @@
             return 1;
 
         case NPCocoaEventKeyDown:
+            if (event->data.key.characters)
+                pluginLog(instance, "keyDown '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0));
+            return 1;
+
         case NPCocoaEventKeyUp:
+            if (event->data.key.characters) {
+                pluginLog(instance, "keyUp '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0));
+                if (obj->testKeyboardFocusForPlugins) {
+                    obj->eventLogging = false;
+                    obj->testKeyboardFocusForPlugins = FALSE;
+                    executeScript(obj, "layoutTestController.notifyDone();");
+                }
+            }
+            return 1;
+
         case NPCocoaEventFlagsChanged:
             return 1;
 
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp
new file mode 100644
index 0000000..afe850c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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 "AccessibilityController.h"
+
+#include "TestShell.h"
+#include "public/WebAccessibilityCache.h"
+#include "public/WebAccessibilityObject.h"
+#include "public/WebFrame.h"
+#include "public/WebString.h"
+#include "public/WebView.h"
+
+using namespace WebKit;
+
+AccessibilityController::AccessibilityController(TestShell* shell)
+    : m_shell(shell)
+{
+
+    bindMethod("logFocusEvents",
+        &AccessibilityController::logFocusEventsCallback);
+    bindMethod("logScrollingStartEvents",
+        &AccessibilityController::logScrollingStartEventsCallback);
+
+    bindProperty("focusedElement",
+        &AccessibilityController::focusedElementGetterCallback);
+    bindProperty("rootElement",
+        &AccessibilityController::rootElementGetterCallback);
+
+    bindFallbackMethod(&AccessibilityController::fallbackCallback);
+}
+
+void AccessibilityController::bindToJavascript(WebFrame* frame, const WebString& classname)
+{
+    WebAccessibilityCache::enableAccessibility();
+    CppBoundClass::bindToJavascript(frame, classname);
+}
+
+void AccessibilityController::reset()
+{
+    m_rootElement = WebAccessibilityObject();
+    m_focusedElement = WebAccessibilityObject();
+    m_elements.clear();
+}
+
+void AccessibilityController::setFocusedElement(const WebAccessibilityObject& focusedElement)
+{
+    m_focusedElement = focusedElement;
+}
+
+AccessibilityUIElement* AccessibilityController::getFocusedElement()
+{
+    if (m_focusedElement.isNull())
+        m_focusedElement = m_shell->webView()->accessibilityObject();
+    return m_elements.create(m_focusedElement);
+}
+
+AccessibilityUIElement* AccessibilityController::getRootElement()
+{
+    if (m_rootElement.isNull())
+        m_rootElement = m_shell->webView()->accessibilityObject();
+    return m_elements.createRoot(m_rootElement);
+}
+
+void AccessibilityController::logFocusEventsCallback(const CppArgumentList&, CppVariant* result)
+{
+    // As of r49031, this is not being used upstream.
+    result->setNull();
+}
+
+void AccessibilityController::logScrollingStartEventsCallback(const CppArgumentList&, CppVariant* result)
+{
+    // As of r49031, this is not being used upstream.
+    result->setNull();
+}
+
+void AccessibilityController::focusedElementGetterCallback(CppVariant* result)
+{
+    result->set(*(getFocusedElement()->getAsCppVariant()));
+}
+
+void AccessibilityController::rootElementGetterCallback(CppVariant* result)
+{
+    result->set(*(getRootElement()->getAsCppVariant()));
+}
+
+void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVariant* result)
+{
+    printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on "
+           "AccessibilityController\n");
+    result->setNull();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h
new file mode 100644
index 0000000..3cde7cc
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h
@@ -0,0 +1,73 @@
+/*
+ * 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 AccessibilityController_h
+#define AccessibilityController_h
+
+#include "AccessibilityUIElement.h"
+#include "CppBoundClass.h"
+
+namespace WebKit {
+class WebAccessibilityObject;
+class WebFrame;
+}
+
+class TestShell;
+
+class AccessibilityController : public CppBoundClass {
+public:
+    explicit AccessibilityController(TestShell*);
+
+    // Shadow to include accessibility initialization.
+    void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname);
+    void reset();
+
+    void setFocusedElement(const WebKit::WebAccessibilityObject&);
+    AccessibilityUIElement* getFocusedElement();
+    AccessibilityUIElement* getRootElement();
+
+private:
+    // Bound methods and properties
+    void logFocusEventsCallback(const CppArgumentList&, CppVariant*);
+    void logScrollingStartEventsCallback(const CppArgumentList&, CppVariant*);
+    void fallbackCallback(const CppArgumentList&, CppVariant*);
+
+    void focusedElementGetterCallback(CppVariant*);
+    void rootElementGetterCallback(CppVariant*);
+
+    WebKit::WebAccessibilityObject m_focusedElement;
+    WebKit::WebAccessibilityObject m_rootElement;
+
+    AccessibilityUIElementList m_elements;
+
+    TestShell* m_shell;
+};
+
+#endif // AccessibilityController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp
new file mode 100644
index 0000000..8698e25
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp
@@ -0,0 +1,585 @@
+/*
+ * 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 "AccessibilityUIElement.h"
+
+#include "public/WebAccessibilityObject.h"
+#include "public/WebCString.h"
+#include "public/WebString.h"
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+using namespace std;
+
+// Map role value to string, matching Safari/Mac platform implementation to
+// avoid rebaselining layout tests.
+static string roleToString(WebAccessibilityRole role)
+{
+    string result = "AXRole: AX";
+    switch (role) {
+    case WebAccessibilityRoleButton:
+        return result.append("Button");
+    case WebAccessibilityRoleRadioButton:
+        return result.append("RadioButton");
+    case WebAccessibilityRoleCheckBox:
+        return result.append("CheckBox");
+    case WebAccessibilityRoleSlider:
+        return result.append("Slider");
+    case WebAccessibilityRoleTabGroup:
+        return result.append("TabGroup");
+    case WebAccessibilityRoleTextField:
+        return result.append("TextField");
+    case WebAccessibilityRoleStaticText:
+        return result.append("StaticText");
+    case WebAccessibilityRoleTextArea:
+        return result.append("TextArea");
+    case WebAccessibilityRoleScrollArea:
+        return result.append("ScrollArea");
+    case WebAccessibilityRolePopUpButton:
+        return result.append("PopUpButton");
+    case WebAccessibilityRoleMenuButton:
+        return result.append("MenuButton");
+    case WebAccessibilityRoleTable:
+        return result.append("Table");
+    case WebAccessibilityRoleApplication:
+        return result.append("Application");
+    case WebAccessibilityRoleGroup:
+        return result.append("Group");
+    case WebAccessibilityRoleRadioGroup:
+        return result.append("RadioGroup");
+    case WebAccessibilityRoleList:
+        return result.append("List");
+    case WebAccessibilityRoleScrollBar:
+        return result.append("ScrollBar");
+    case WebAccessibilityRoleValueIndicator:
+        return result.append("ValueIndicator");
+    case WebAccessibilityRoleImage:
+        return result.append("Image");
+    case WebAccessibilityRoleMenuBar:
+        return result.append("MenuBar");
+    case WebAccessibilityRoleMenu:
+        return result.append("Menu");
+    case WebAccessibilityRoleMenuItem:
+        return result.append("MenuItem");
+    case WebAccessibilityRoleColumn:
+        return result.append("Column");
+    case WebAccessibilityRoleRow:
+        return result.append("Row");
+    case WebAccessibilityRoleToolbar:
+        return result.append("Toolbar");
+    case WebAccessibilityRoleBusyIndicator:
+        return result.append("BusyIndicator");
+    case WebAccessibilityRoleProgressIndicator:
+        return result.append("ProgressIndicator");
+    case WebAccessibilityRoleWindow:
+        return result.append("Window");
+    case WebAccessibilityRoleDrawer:
+        return result.append("Drawer");
+    case WebAccessibilityRoleSystemWide:
+        return result.append("SystemWide");
+    case WebAccessibilityRoleOutline:
+        return result.append("Outline");
+    case WebAccessibilityRoleIncrementor:
+        return result.append("Incrementor");
+    case WebAccessibilityRoleBrowser:
+        return result.append("Browser");
+    case WebAccessibilityRoleComboBox:
+        return result.append("ComboBox");
+    case WebAccessibilityRoleSplitGroup:
+        return result.append("SplitGroup");
+    case WebAccessibilityRoleSplitter:
+        return result.append("Splitter");
+    case WebAccessibilityRoleColorWell:
+        return result.append("ColorWell");
+    case WebAccessibilityRoleGrowArea:
+        return result.append("GrowArea");
+    case WebAccessibilityRoleSheet:
+        return result.append("Sheet");
+    case WebAccessibilityRoleHelpTag:
+        return result.append("HelpTag");
+    case WebAccessibilityRoleMatte:
+        return result.append("Matte");
+    case WebAccessibilityRoleRuler:
+        return result.append("Ruler");
+    case WebAccessibilityRoleRulerMarker:
+        return result.append("RulerMarker");
+    case WebAccessibilityRoleLink:
+        return result.append("Link");
+    case WebAccessibilityRoleDisclosureTriangle:
+        return result.append("DisclosureTriangle");
+    case WebAccessibilityRoleGrid:
+        return result.append("Grid");
+    case WebAccessibilityRoleCell:
+        return result.append("Cell");
+    case WebAccessibilityRoleColumnHeader:
+        return result.append("ColumnHeader");
+    case WebAccessibilityRoleRowHeader:
+        return result.append("RowHeader");
+    case WebAccessibilityRoleWebCoreLink:
+        // Maps to Link role.
+        return result.append("Link");
+    case WebAccessibilityRoleImageMapLink:
+        return result.append("ImageMapLink");
+    case WebAccessibilityRoleImageMap:
+        return result.append("ImageMap");
+    case WebAccessibilityRoleListMarker:
+        return result.append("ListMarker");
+    case WebAccessibilityRoleWebArea:
+        return result.append("WebArea");
+    case WebAccessibilityRoleHeading:
+        return result.append("Heading");
+    case WebAccessibilityRoleListBox:
+        return result.append("ListBox");
+    case WebAccessibilityRoleListBoxOption:
+        return result.append("ListBoxOption");
+    case WebAccessibilityRoleTableHeaderContainer:
+        return result.append("TableHeaderContainer");
+    case WebAccessibilityRoleDefinitionListTerm:
+        return result.append("DefinitionListTerm");
+    case WebAccessibilityRoleDefinitionListDefinition:
+        return result.append("DefinitionListDefinition");
+    case WebAccessibilityRoleAnnotation:
+        return result.append("Annotation");
+    case WebAccessibilityRoleSliderThumb:
+        return result.append("SliderThumb");
+    case WebAccessibilityRoleLandmarkApplication:
+        return result.append("LandmarkApplication");
+    case WebAccessibilityRoleLandmarkBanner:
+        return result.append("LandmarkBanner");
+    case WebAccessibilityRoleLandmarkComplementary:
+        return result.append("LandmarkComplementary");
+    case WebAccessibilityRoleLandmarkContentInfo:
+        return result.append("LandmarkContentInfo");
+    case WebAccessibilityRoleLandmarkMain:
+        return result.append("LandmarkMain");
+    case WebAccessibilityRoleLandmarkNavigation:
+        return result.append("LandmarkNavigation");
+    case WebAccessibilityRoleLandmarkSearch:
+        return result.append("LandmarkSearch");
+    case WebAccessibilityRoleApplicationLog:
+        return result.append("ApplicationLog");
+    case WebAccessibilityRoleApplicationMarquee:
+        return result.append("ApplicationMarquee");
+    case WebAccessibilityRoleApplicationStatus:
+        return result.append("ApplicationStatus");
+    case WebAccessibilityRoleApplicationTimer:
+        return result.append("ApplicationTimer");
+    case WebAccessibilityRoleDocument:
+        return result.append("Document");
+    case WebAccessibilityRoleDocumentArticle:
+        return result.append("DocumentArticle");
+    case WebAccessibilityRoleDocumentNote:
+        return result.append("DocumentNote");
+    case WebAccessibilityRoleDocumentRegion:
+        return result.append("DocumentRegion");
+    case WebAccessibilityRoleUserInterfaceTooltip:
+        return result.append("UserInterfaceTooltip");
+    default:
+        // Also matches WebAccessibilityRoleUnknown.
+        return result.append("Unknown");
+    }
+}
+
+string getDescription(const WebAccessibilityObject& object)
+{
+    string description = object.accessibilityDescription().utf8();
+    return description.insert(0, "AXDescription: ");
+}
+
+string getRole(const WebAccessibilityObject& object)
+{
+    return roleToString(object.roleValue());
+}
+
+string getTitle(const WebAccessibilityObject& object)
+{
+    string title = object.title().utf8();
+    return title.insert(0, "AXTitle: ");
+}
+
+string getAttributes(const WebAccessibilityObject& object)
+{
+    // FIXME: Concatenate all attributes of the AccessibilityObject.
+    string attributes(getTitle(object));
+    attributes.append("\n");
+    attributes.append(getRole(object));
+    attributes.append("\n");
+    attributes.append(getDescription(object));
+    return attributes;
+}
+
+
+// Collects attributes into a string, delimited by dashes. Used by all methods
+// that output lists of attributes: attributesOfLinkedUIElementsCallback,
+// AttributesOfChildrenCallback, etc.
+class AttributesCollector {
+public:
+    void collectAttributes(const WebAccessibilityObject& object)
+    {
+        m_attributes.append("\n------------\n");
+        m_attributes.append(getAttributes(object));
+    }
+
+    string attributes() const { return m_attributes; }
+
+private:
+    string m_attributes;
+};
+
+AccessibilityUIElement::AccessibilityUIElement(const WebAccessibilityObject& object, Factory* factory)
+    : m_accessibilityObject(object)
+    , m_factory(factory)
+{
+
+    ASSERT(factory);
+
+    bindMethod("allAttributes", &AccessibilityUIElement::allAttributesCallback);
+    bindMethod("attributesOfLinkedUIElements",
+               &AccessibilityUIElement::attributesOfLinkedUIElementsCallback);
+    bindMethod("attributesOfDocumentLinks",
+               &AccessibilityUIElement::attributesOfDocumentLinksCallback);
+    bindMethod("attributesOfChildren",
+               &AccessibilityUIElement::attributesOfChildrenCallback);
+    bindMethod("parameterizedAttributeNames",
+               &AccessibilityUIElement::parametrizedAttributeNamesCallback);
+    bindMethod("lineForIndex", &AccessibilityUIElement::lineForIndexCallback);
+    bindMethod("boundsForRange", &AccessibilityUIElement::boundsForRangeCallback);
+    bindMethod("stringForRange", &AccessibilityUIElement::stringForRangeCallback);
+    bindMethod("childAtIndex", &AccessibilityUIElement::childAtIndexCallback);
+    bindMethod("elementAtPoint", &AccessibilityUIElement::elementAtPointCallback);
+    bindMethod("attributesOfColumnHeaders",
+               &AccessibilityUIElement::attributesOfColumnHeadersCallback);
+    bindMethod("attributesOfRowHeaders",
+               &AccessibilityUIElement::attributesOfRowHeadersCallback);
+    bindMethod("attributesOfColumns",
+               &AccessibilityUIElement::attributesOfColumnsCallback);
+    bindMethod("attributesOfRows",
+               &AccessibilityUIElement::attributesOfRowsCallback);
+    bindMethod("attributesOfVisibleCells",
+               &AccessibilityUIElement::attributesOfVisibleCellsCallback);
+    bindMethod("attributesOfHeader",
+               &AccessibilityUIElement::attributesOfHeaderCallback);
+    bindMethod("indexInTable", &AccessibilityUIElement::indexInTableCallback);
+    bindMethod("rowIndexRange", &AccessibilityUIElement::rowIndexRangeCallback);
+    bindMethod("columnIndexRange",
+               &AccessibilityUIElement::columnIndexRangeCallback);
+    bindMethod("cellForColumnAndRow",
+               &AccessibilityUIElement::cellForColumnAndRowCallback);
+    bindMethod("titleUIElement", &AccessibilityUIElement::titleUIElementCallback);
+    bindMethod("setSelectedTextRange",
+               &AccessibilityUIElement::setSelectedTextRangeCallback);
+    bindMethod("attributeValue", &AccessibilityUIElement::attributeValueCallback);
+    bindMethod("isAttributeSettable",
+               &AccessibilityUIElement::isAttributeSettableCallback);
+    bindMethod("isActionSupported",
+               &AccessibilityUIElement::isActionSupportedCallback);
+    bindMethod("parentElement", &AccessibilityUIElement::parentElementCallback);
+    bindMethod("increment", &AccessibilityUIElement::incrementCallback);
+    bindMethod("decrement", &AccessibilityUIElement::decrementCallback);
+
+    bindProperty("role", &AccessibilityUIElement::roleGetterCallback);
+    bindProperty("subrole", &m_subrole);
+    bindProperty("title", &AccessibilityUIElement::titleGetterCallback);
+    bindProperty("description",
+                 &AccessibilityUIElement::descriptionGetterCallback);
+    bindProperty("language", &m_language);
+    bindProperty("x", &m_x);
+    bindProperty("y", &m_y);
+    bindProperty("width", &m_width);
+    bindProperty("height", &m_height);
+    bindProperty("clickPointX", &m_clickPointX);
+    bindProperty("clickPointY", &m_clickPointY);
+    bindProperty("intValue", &m_intValue);
+    bindProperty("minValue", &m_minValue);
+    bindProperty("maxValue", &m_maxValue);
+    bindProperty("childrenCount",
+                 &AccessibilityUIElement::childrenCountGetterCallback);
+    bindProperty("insertionPointLineNumber", &m_insertionPointLineNumber);
+    bindProperty("selectedTextRange", &m_selectedTextRange);
+    bindProperty("isEnabled", &AccessibilityUIElement::isEnabledGetterCallback);
+    bindProperty("isRequired", &m_isRequired);
+    bindProperty("isSelected", &AccessibilityUIElement::isSelectedGetterCallback);
+    bindProperty("valueDescription", &m_valueDescription);
+
+    bindFallbackMethod(&AccessibilityUIElement::fallbackCallback);
+}
+
+AccessibilityUIElement* AccessibilityUIElement::getChildAtIndex(unsigned index)
+{
+    return m_factory->create(accessibilityObject().childAt(index));
+}
+
+void AccessibilityUIElement::allAttributesCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->set(getAttributes(accessibilityObject()));
+}
+
+void AccessibilityUIElement::attributesOfLinkedUIElementsCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfDocumentLinksCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfChildrenCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+    AttributesCollector collector;
+    unsigned size = accessibilityObject().childCount();
+    for (unsigned i = 0; i < size; ++i)
+        collector.collectAttributes(accessibilityObject().childAt(i));
+    result->set(collector.attributes());
+}
+
+void AccessibilityUIElement::parametrizedAttributeNamesCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::lineForIndexCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::boundsForRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::stringForRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::childAtIndexCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (!arguments.size() || !arguments[0].isNumber()) {
+        result->setNull();
+        return;
+    }
+
+    AccessibilityUIElement* child = getChildAtIndex(arguments[0].toInt32());
+    if (!child) {
+        result->setNull();
+        return;
+    }
+
+    result->set(*(child->getAsCppVariant()));
+}
+
+void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfColumnHeadersCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfRowHeadersCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfColumnsCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfRowsCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfVisibleCellsCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfHeaderCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::indexInTableCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::rowIndexRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::columnIndexRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::cellForColumnAndRowCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::titleUIElementCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::setSelectedTextRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::attributeValueCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::isAttributeSettableCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() < 1 && !arguments[0].isString()) {
+        result->setNull();
+        return;
+    }
+
+    string attribute = arguments[0].toString();
+    bool settable = false;
+    if (attribute == "AXValue")
+        settable = accessibilityObject().canSetValueAttribute();
+    result->set(settable);
+}
+
+void AccessibilityUIElement::isActionSupportedCallback(const CppArgumentList&, CppVariant* result)
+{
+    // This one may be really hard to implement.
+    // Not exposed by AccessibilityObject.
+    result->setNull();
+}
+
+void AccessibilityUIElement::parentElementCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::incrementCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::decrementCallback(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::fallbackCallback(const CppArgumentList &, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void AccessibilityUIElement::childrenCountGetterCallback(CppVariant* result)
+{
+    int count = 1; // Root object always has only one child, the WebView.
+    if (!isRoot())
+        count = accessibilityObject().childCount();
+    result->set(count);
+}
+
+void AccessibilityUIElement::descriptionGetterCallback(CppVariant* result)
+{
+    result->set(getDescription(accessibilityObject()));
+}
+
+void AccessibilityUIElement::isEnabledGetterCallback(CppVariant* result)
+{
+    result->set(accessibilityObject().isEnabled());
+}
+
+void AccessibilityUIElement::isSelectedGetterCallback(CppVariant* result)
+{
+    result->setNull();
+}
+
+void AccessibilityUIElement::roleGetterCallback(CppVariant* result)
+{
+    result->set(getRole(accessibilityObject()));
+}
+
+void AccessibilityUIElement::titleGetterCallback(CppVariant* result)
+{
+    result->set(getTitle(accessibilityObject()));
+}
+
+
+RootAccessibilityUIElement::RootAccessibilityUIElement(const WebAccessibilityObject &object, Factory *factory)
+    : AccessibilityUIElement(object, factory) { }
+
+AccessibilityUIElement* RootAccessibilityUIElement::getChildAtIndex(unsigned index)
+{
+    if (index)
+        return 0;
+
+    return factory()->create(accessibilityObject());
+}
+
+
+AccessibilityUIElementList ::~AccessibilityUIElementList()
+{
+    clear();
+}
+
+void AccessibilityUIElementList::clear()
+{
+    for (ElementList::iterator i = m_elements.begin(); i != m_elements.end(); ++i)
+        delete (*i);
+    m_elements.clear();
+}
+
+AccessibilityUIElement* AccessibilityUIElementList::create(const WebAccessibilityObject& object)
+{
+    if (object.isNull())
+        return 0;
+
+    AccessibilityUIElement* element = new AccessibilityUIElement(object, this);
+    m_elements.append(element);
+    return element;
+}
+
+AccessibilityUIElement* AccessibilityUIElementList::createRoot(const WebAccessibilityObject& object)
+{
+    AccessibilityUIElement* element = new RootAccessibilityUIElement(object, this);
+    m_elements.append(element);
+    return element;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h
new file mode 100644
index 0000000..df3f5b9
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h
@@ -0,0 +1,142 @@
+/*
+ * 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 AccessibilityUIElement_h
+#define AccessibilityUIElement_h
+
+#include "CppBoundClass.h"
+#include "public/WebAccessibilityObject.h"
+#include <wtf/Vector.h>
+
+class AccessibilityUIElement : public CppBoundClass {
+public:
+    class Factory {
+    public:
+        virtual ~Factory() { }
+        virtual AccessibilityUIElement* create(const WebKit::WebAccessibilityObject&) = 0;
+    };
+
+    AccessibilityUIElement(const WebKit::WebAccessibilityObject&, Factory*);
+
+    virtual AccessibilityUIElement* getChildAtIndex(unsigned);
+    virtual bool isRoot() const { return false; }
+
+protected:
+    const WebKit::WebAccessibilityObject& accessibilityObject() const { return m_accessibilityObject; }
+    Factory* factory() const { return m_factory; }
+
+private:
+    // Bound methods and properties.
+    void allAttributesCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfLinkedUIElementsCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfDocumentLinksCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfChildrenCallback(const CppArgumentList&, CppVariant*);
+    void parametrizedAttributeNamesCallback(const CppArgumentList&, CppVariant*);
+    void lineForIndexCallback(const CppArgumentList&, CppVariant*);
+    void boundsForRangeCallback(const CppArgumentList&, CppVariant*);
+    void stringForRangeCallback(const CppArgumentList&, CppVariant*);
+    void childAtIndexCallback(const CppArgumentList&, CppVariant*);
+    void elementAtPointCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfColumnHeadersCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfRowHeadersCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfColumnsCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfRowsCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfVisibleCellsCallback(const CppArgumentList&, CppVariant*);
+    void attributesOfHeaderCallback(const CppArgumentList&, CppVariant*);
+    void indexInTableCallback(const CppArgumentList&, CppVariant*);
+    void rowIndexRangeCallback(const CppArgumentList&, CppVariant*);
+    void columnIndexRangeCallback(const CppArgumentList&, CppVariant*);
+    void cellForColumnAndRowCallback(const CppArgumentList&, CppVariant*);
+    void titleUIElementCallback(const CppArgumentList&, CppVariant*);
+    void setSelectedTextRangeCallback(const CppArgumentList&, CppVariant*);
+    void attributeValueCallback(const CppArgumentList&, CppVariant*);
+    void isAttributeSettableCallback(const CppArgumentList&, CppVariant*);
+    void isActionSupportedCallback(const CppArgumentList&, CppVariant*);
+    void parentElementCallback(const CppArgumentList&, CppVariant*);
+    void incrementCallback(const CppArgumentList&, CppVariant*);
+    void decrementCallback(const CppArgumentList&, CppVariant*);
+    void fallbackCallback(const CppArgumentList&, CppVariant*);
+
+    void childrenCountGetterCallback(CppVariant*);
+    void descriptionGetterCallback(CppVariant*);
+    void isEnabledGetterCallback(CppVariant*);
+    void isSelectedGetterCallback(CppVariant*);
+    void roleGetterCallback(CppVariant*);
+    void titleGetterCallback(CppVariant*);
+
+    CppVariant m_subrole;
+    CppVariant m_language;
+    CppVariant m_x;
+    CppVariant m_y;
+    CppVariant m_width;
+    CppVariant m_height;
+    CppVariant m_clickPointX;
+    CppVariant m_clickPointY;
+    CppVariant m_intValue;
+    CppVariant m_minValue;
+    CppVariant m_maxValue;
+    CppVariant m_childrenCount;
+    CppVariant m_insertionPointLineNumber;
+    CppVariant m_selectedTextRange;
+    CppVariant m_isRequired;
+    CppVariant m_valueDescription;
+
+    WebKit::WebAccessibilityObject m_accessibilityObject;
+    Factory* m_factory;
+};
+
+
+class RootAccessibilityUIElement : public AccessibilityUIElement {
+public:
+    RootAccessibilityUIElement(const WebKit::WebAccessibilityObject&, Factory*);
+
+    virtual AccessibilityUIElement* getChildAtIndex(unsigned);
+    virtual bool isRoot() const { return true; }
+};
+
+
+// Provides simple lifetime management of the AccessibilityUIElement instances:
+// all AccessibilityUIElements ever created from the controller are stored in
+// a list and cleared explicitly.
+class AccessibilityUIElementList : public AccessibilityUIElement::Factory {
+public:
+    AccessibilityUIElementList() { }
+    virtual ~AccessibilityUIElementList();
+
+    void clear();
+    virtual AccessibilityUIElement* create(const WebKit::WebAccessibilityObject&);
+    AccessibilityUIElement* createRoot(const WebKit::WebAccessibilityObject&);
+
+private:
+    typedef Vector<AccessibilityUIElement*> ElementList;
+    ElementList m_elements;
+};
+
+#endif // AccessibilityUIElement_h
diff --git a/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp
new file mode 100644
index 0000000..839787a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * 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.
+ */
+
+// This file contains definitions for CppBoundClass
+
+// Here's the control flow of a JS method getting forwarded to a class.
+// - Something calls our NPObject with a function like "Invoke".
+// - CppNPObject's static invoke() function forwards it to its attached
+//   CppBoundClass's invoke() method.
+// - CppBoundClass has then overridden invoke() to look up the function
+//   name in its internal map of methods, and then calls the appropriate
+//   method.
+
+#include "config.h"
+#include "CppBoundClass.h"
+
+#include "public/WebBindings.h"
+#include "public/WebFrame.h"
+#include "public/WebString.h"
+#include <wtf/Assertions.h>
+#include <wtf/OwnPtr.h>
+
+using namespace WebKit;
+using namespace std;
+
+class CppVariantPropertyCallback : public CppBoundClass::PropertyCallback {
+public:
+    CppVariantPropertyCallback(CppVariant* value) : m_value(value) { }
+
+    virtual bool getValue(CppVariant* value)
+    {
+        value->set(*m_value);
+        return true;
+    }
+
+    virtual bool setValue(const CppVariant& value)
+    {
+        m_value->set(value);
+        return true;
+    }
+
+private:
+    CppVariant* m_value;
+};
+
+class GetterPropertyCallback : public CppBoundClass::PropertyCallback {
+public:
+    GetterPropertyCallback(CppBoundClass::GetterCallback* callback)
+        : m_callback(callback) { }
+
+    virtual bool getValue(CppVariant* value)
+    {
+        m_callback->run(value);
+        return true;
+    }
+
+    virtual bool setValue(const CppVariant& value) { return false; }
+
+private:
+    OwnPtr<CppBoundClass::GetterCallback> m_callback;
+};
+
+// Our special NPObject type.  We extend an NPObject with a pointer to a
+// CppBoundClass, which is just a C++ interface that we forward all NPObject
+// callbacks to.
+struct CppNPObject {
+    NPObject parent; // This must be the first field in the struct.
+    CppBoundClass* boundClass;
+
+    //
+    // All following objects and functions are static, and just used to interface
+    // with NPObject/NPClass.
+    //
+
+    // An NPClass associates static functions of CppNPObject with the
+    // function pointers used by the JS runtime.
+    static NPClass npClass;
+
+    // Allocate a new NPObject with the specified class.
+    static NPObject* allocate(NPP, NPClass*);
+
+    // Free an object.
+    static void deallocate(NPObject*);
+
+    // Returns true if the C++ class associated with this NPObject exposes the
+    // given property.  Called by the JS runtime.
+    static bool hasProperty(NPObject*, NPIdentifier);
+
+    // Returns true if the C++ class associated with this NPObject exposes the
+    // given method.  Called by the JS runtime.
+    static bool hasMethod(NPObject*, NPIdentifier);
+
+    // If the given method is exposed by the C++ class associated with this
+    // NPObject, invokes it with the given arguments and returns a result.  Otherwise,
+    // returns "undefined" (in the JavaScript sense).  Called by the JS runtime.
+    static bool invoke(NPObject*, NPIdentifier,
+                       const NPVariant* arguments, uint32_t argumentCount,
+                       NPVariant* result);
+
+    // If the given property is exposed by the C++ class associated with this
+    // NPObject, returns its value.  Otherwise, returns "undefined" (in the
+    // JavaScript sense).  Called by the JS runtime.
+    static bool getProperty(NPObject*, NPIdentifier, NPVariant* result);
+
+    // If the given property is exposed by the C++ class associated with this
+    // NPObject, sets its value.  Otherwise, does nothing. Called by the JS
+    // runtime.
+    static bool setProperty(NPObject*, NPIdentifier, const NPVariant* value);
+};
+
+// Build CppNPObject's static function pointers into an NPClass, for use
+// in constructing NPObjects for the C++ classes.
+NPClass CppNPObject::npClass = {
+    NP_CLASS_STRUCT_VERSION,
+    CppNPObject::allocate,
+    CppNPObject::deallocate,
+    /* NPInvalidateFunctionPtr */ 0,
+    CppNPObject::hasMethod,
+    CppNPObject::invoke,
+    /* NPInvokeDefaultFunctionPtr */ 0,
+    CppNPObject::hasProperty,
+    CppNPObject::getProperty,
+    CppNPObject::setProperty,
+    /* NPRemovePropertyFunctionPtr */ 0
+};
+
+NPObject* CppNPObject::allocate(NPP npp, NPClass* aClass)
+{
+    CppNPObject* obj = new CppNPObject;
+    // obj->parent will be initialized by the NPObject code calling this.
+    obj->boundClass = 0;
+    return &obj->parent;
+}
+
+void CppNPObject::deallocate(NPObject* npObj)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    delete obj;
+}
+
+bool CppNPObject::hasMethod(NPObject* npObj, NPIdentifier ident)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    return obj->boundClass->hasMethod(ident);
+}
+
+bool CppNPObject::hasProperty(NPObject* npObj, NPIdentifier ident)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    return obj->boundClass->hasProperty(ident);
+}
+
+bool CppNPObject::invoke(NPObject* npObj, NPIdentifier ident,
+                         const NPVariant* arguments, uint32_t argumentCount,
+                         NPVariant* result)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    return obj->boundClass->invoke(ident, arguments, argumentCount, result);
+}
+
+bool CppNPObject::getProperty(NPObject* npObj, NPIdentifier ident, NPVariant* result)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    return obj->boundClass->getProperty(ident, result);
+}
+
+bool CppNPObject::setProperty(NPObject* npObj, NPIdentifier ident, const NPVariant* value)
+{
+    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+    return obj->boundClass->setProperty(ident, value);
+}
+
+CppBoundClass::~CppBoundClass()
+{
+    for (MethodList::iterator i = m_methods.begin(); i != m_methods.end(); ++i)
+        delete i->second;
+
+    for (PropertyList::iterator i = m_properties.begin(); i != m_properties.end(); ++i)
+        delete i->second;
+
+    // Unregister ourselves if we were bound to a frame.
+    if (m_boundToFrame)
+        WebBindings::unregisterObject(NPVARIANT_TO_OBJECT(m_selfVariant));
+}
+
+bool CppBoundClass::hasMethod(NPIdentifier ident) const
+{
+    return m_methods.find(ident) != m_methods.end();
+}
+
+bool CppBoundClass::hasProperty(NPIdentifier ident) const
+{
+    return m_properties.find(ident) != m_properties.end();
+}
+
+bool CppBoundClass::invoke(NPIdentifier ident,
+                           const NPVariant* arguments,
+                           size_t argumentCount,
+                           NPVariant* result) {
+    MethodList::const_iterator end = m_methods.end();
+    MethodList::const_iterator method = m_methods.find(ident);
+    Callback* callback;
+    if (method == end) {
+        if (!m_fallbackCallback.get()) {
+            VOID_TO_NPVARIANT(*result);
+            return false;
+        }
+        callback = m_fallbackCallback.get();
+    } else
+        callback = (*method).second;
+
+    // Build a CppArgumentList argument vector from the NPVariants coming in.
+    CppArgumentList cppArguments(argumentCount);
+    for (size_t i = 0; i < argumentCount; i++)
+        cppArguments[i].set(arguments[i]);
+
+    CppVariant cppResult;
+    callback->run(cppArguments, &cppResult);
+
+    cppResult.copyToNPVariant(result);
+    return true;
+}
+
+bool CppBoundClass::getProperty(NPIdentifier ident, NPVariant* result) const
+{
+    PropertyList::const_iterator callback = m_properties.find(ident);
+    if (callback == m_properties.end()) {
+        VOID_TO_NPVARIANT(*result);
+        return false;
+    }
+
+    CppVariant cppValue;
+    if (!callback->second->getValue(&cppValue))
+        return false;
+    cppValue.copyToNPVariant(result);
+    return true;
+}
+
+bool CppBoundClass::setProperty(NPIdentifier ident, const NPVariant* value)
+{
+    PropertyList::iterator callback = m_properties.find(ident);
+    if (callback == m_properties.end())
+        return false;
+
+    CppVariant cppValue;
+    cppValue.set(*value);
+    return (*callback).second->setValue(cppValue);
+}
+
+void CppBoundClass::bindCallback(const string& name, Callback* callback)
+{
+    NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+    MethodList::iterator oldCallback = m_methods.find(ident);
+    if (oldCallback != m_methods.end()) {
+        delete oldCallback->second;
+        if (!callback) {
+            m_methods.remove(oldCallback);
+            return;
+        }
+    }
+
+    m_methods.set(ident, callback);
+}
+
+void CppBoundClass::bindGetterCallback(const string& name, GetterCallback* callback)
+{
+    PropertyCallback* propertyCallback = callback ? new GetterPropertyCallback(callback) : 0;
+    bindProperty(name, propertyCallback);
+}
+
+void CppBoundClass::bindProperty(const string& name, CppVariant* prop)
+{
+    PropertyCallback* propertyCallback = prop ? new CppVariantPropertyCallback(prop) : 0;
+    bindProperty(name, propertyCallback);
+}
+
+void CppBoundClass::bindProperty(const string& name, PropertyCallback* callback)
+{
+    NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+    PropertyList::iterator oldCallback = m_properties.find(ident);
+    if (oldCallback != m_properties.end()) {
+        delete oldCallback->second;
+        if (!callback) {
+            m_properties.remove(oldCallback);
+            return;
+        }
+    }
+
+    m_properties.set(ident, callback);
+}
+
+bool CppBoundClass::isMethodRegistered(const string& name) const
+{
+    NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+    MethodList::const_iterator callback = m_methods.find(ident);
+    return callback != m_methods.end();
+}
+
+CppVariant* CppBoundClass::getAsCppVariant()
+{
+    if (!m_selfVariant.isObject()) {
+        // Create an NPObject using our static NPClass.  The first argument (a
+        // plugin's instance handle) is passed through to the allocate function
+        // directly, and we don't use it, so it's ok to be 0.
+        NPObject* npObj = WebBindings::createObject(0, &CppNPObject::npClass);
+        CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+        obj->boundClass = this;
+        m_selfVariant.set(npObj);
+        WebBindings::releaseObject(npObj); // CppVariant takes the reference.
+    }
+    ASSERT(m_selfVariant.isObject());
+    return &m_selfVariant;
+}
+
+void CppBoundClass::bindToJavascript(WebFrame* frame, const WebString& classname)
+{
+    // BindToWindowObject will take its own reference to the NPObject, and clean
+    // up after itself.  It will also (indirectly) register the object with V8,
+    // so we must remember this so we can unregister it when we're destroyed.
+    frame->bindToWindowObject(classname, NPVARIANT_TO_OBJECT(*getAsCppVariant()));
+    m_boundToFrame = true;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h
new file mode 100644
index 0000000..6cb638e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * 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.
+ */
+
+/*
+  CppBoundClass class:
+  This base class serves as a parent for C++ classes designed to be bound to
+  JavaScript objects.
+
+  Subclasses should define the constructor to build the property and method
+  lists needed to bind this class to a JS object.  They should also declare
+  and define member variables and methods to be exposed to JS through
+  that object.
+*/
+
+#ifndef CppBoundClass_h
+#define CppBoundClass_h
+
+#include "CppVariant.h"
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebKit {
+class WebFrame;
+class WebString;
+}
+
+typedef Vector<CppVariant> CppArgumentList;
+
+// CppBoundClass lets you map Javascript method calls and property accesses
+// directly to C++ method calls and CppVariant* variable access.
+class CppBoundClass : public Noncopyable {
+public:
+    class PropertyCallback {
+    public:
+        virtual ~PropertyCallback() { }
+
+        // Sets |value| to the value of the property. Returns false in case of
+        // failure. |value| is always non-0.
+        virtual bool getValue(CppVariant* result) = 0;
+
+        // sets the property value to |value|. Returns false in case of failure.
+        virtual bool setValue(const CppVariant&) = 0;
+    };
+
+    // Callback class for "void function(CppVariant*)"
+    class GetterCallback {
+    public:
+        virtual ~GetterCallback() {}
+        virtual void run(CppVariant*) = 0;
+    };
+
+    // The constructor should call BindMethod, BindProperty, and
+    // SetFallbackMethod as needed to set up the methods, properties, and
+    // fallback method.
+    CppBoundClass() : m_boundToFrame(false) {}
+    virtual ~CppBoundClass();
+
+    // Return a CppVariant representing this class, for use with BindProperty().
+    // The variant type is guaranteed to be NPVariantType_Object.
+    CppVariant* getAsCppVariant();
+
+    // Given a WebFrame, BindToJavascript builds the NPObject that will represent
+    // the class and binds it to the frame's window under the given name.  This
+    // should generally be called from the WebView delegate's
+    // WindowObjectCleared(). A class so bound will be accessible to JavaScript
+    // as window.<classname>. The owner of the CppBoundObject is responsible for
+    // keeping the object around while the frame is alive, and for destroying it
+    // afterwards.
+    void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname);
+
+    // Used by a test.  Returns true if a method with name |name| exists,
+    // regardless of whether a fallback is registered.
+    bool isMethodRegistered(const std::string&) const;
+
+protected:
+    // Callback for "void function(const CppArguemntList&, CppVariant*)"
+    class Callback {
+    public:
+        virtual ~Callback() {}
+        virtual void run(const CppArgumentList&, CppVariant*) = 0;
+    };
+
+    // Callback for "void T::method(const CppArguemntList&, CppVariant*)"
+    template <class T> class MemberCallback : public Callback {
+    public:
+        typedef void (T::*MethodType)(const CppArgumentList&, CppVariant*);
+        MemberCallback(T* object, MethodType method)
+            : m_object(object)
+            , m_method(method) {}
+        virtual ~MemberCallback() {}
+
+        virtual void run(const CppArgumentList& arguments, CppVariant* result)
+        {
+            (m_object->*m_method)(arguments, result);
+        }
+    private:
+        T* m_object;
+        MethodType m_method;
+    };
+
+    // Callback class for "void T::method(CppVariant*)"
+    template <class T> class MemberGetterCallback : public GetterCallback {
+    public:
+        typedef void (T::*MethodType)(CppVariant*);
+        MemberGetterCallback(T* object, MethodType method)
+            : m_object(object)
+            , m_method(method) {}
+        virtual ~MemberGetterCallback() {}
+
+        virtual void run(CppVariant* result) { (m_object->*m_method)(result); }
+    private:
+        T* m_object;
+        MethodType m_method;
+    };
+
+    // Bind the Javascript method called the string parameter to the C++ method.
+    void bindCallback(const std::string&, Callback*);
+
+    // A wrapper for bindCallback, to simplify the common case of binding a
+    // method on the current object.  Though not verified here, |method|
+    // must be a method of this CppBoundClass subclass.
+    template<class T>
+    void bindMethod(const std::string& name, void (T::*method)(const CppArgumentList&, CppVariant*))
+    {
+        Callback* callback = new MemberCallback<T>(static_cast<T*>(this), method);
+        bindCallback(name, callback);
+    }
+
+    // Bind Javascript property |name| to the C++ getter callback |callback|.
+    // This can be used to create read-only properties.
+    void bindGetterCallback(const std::string&, GetterCallback*);
+
+    // A wrapper for BindGetterCallback, to simplify the common case of binding a
+    // property on the current object.  Though not verified here, |method|
+    // must be a method of this CppBoundClass subclass.
+    template<class T>
+    void bindProperty(const std::string& name, void (T::*method)(CppVariant*))
+    {
+        GetterCallback* callback = new MemberGetterCallback<T>(static_cast<T*>(this), method);
+        bindGetterCallback(name, callback);
+    }
+
+    // Bind the Javascript property called |name| to a CppVariant.
+    void bindProperty(const std::string&, CppVariant*);
+
+    // Bind Javascript property called |name| to a PropertyCallback.
+    // CppBoundClass assumes control over the life time of the callback.
+    void bindProperty(const std::string&, PropertyCallback*);
+
+    // Set the fallback callback, which is called when when a callback is
+    // invoked that isn't bound.
+    // If it is 0 (its default value), a JavaScript exception is thrown in
+    // that case (as normally expected). If non 0, the fallback method is
+    // invoked and the script continues its execution.
+    // Passing 0 clears out any existing binding.
+    // It is used for tests and should probably only be used in such cases
+    // as it may cause unexpected behaviors (a JavaScript object with a
+    // fallback always returns true when checked for a method's
+    // existence).
+    void bindFallbackCallback(Callback* fallbackCallback)
+    {
+        m_fallbackCallback.set(fallbackCallback);
+    }
+
+    // A wrapper for BindFallbackCallback, to simplify the common case of
+    // binding a method on the current object.  Though not verified here,
+    // |method| must be a method of this CppBoundClass subclass.
+    // Passing 0 for |method| clears out any existing binding.
+    template<class T>
+    void bindFallbackMethod(void (T::*method)(const CppArgumentList&, CppVariant*))
+    {
+        if (method) {
+            Callback* callback = new MemberCallback<T>(static_cast<T*>(this), method);
+            bindFallbackCallback(callback);
+        } else
+            bindFallbackCallback(0);
+    }
+
+    // Some fields are protected because some tests depend on accessing them,
+    // but otherwise they should be considered private.
+
+    typedef HashMap<NPIdentifier, PropertyCallback*> PropertyList;
+    typedef HashMap<NPIdentifier, Callback*> MethodList;
+    // These maps associate names with property and method pointers to be
+    // exposed to JavaScript.
+    PropertyList m_properties;
+    MethodList m_methods;
+
+    // The callback gets invoked when a call is made to an nonexistent method.
+    OwnPtr<Callback> m_fallbackCallback;
+
+private:
+    // NPObject callbacks.
+    friend struct CppNPObject;
+    bool hasMethod(NPIdentifier) const;
+    bool invoke(NPIdentifier, const NPVariant* args, size_t argCount,
+                NPVariant* result);
+    bool hasProperty(NPIdentifier) const;
+    bool getProperty(NPIdentifier, NPVariant* result) const;
+    bool setProperty(NPIdentifier, const NPVariant*);
+
+    // A lazily-initialized CppVariant representing this class.  We retain 1
+    // reference to this object, and it is released on deletion.
+    CppVariant m_selfVariant;
+
+    // True if our np_object has been bound to a WebFrame, in which case it must
+    // be unregistered with V8 when we delete it.
+    bool m_boundToFrame;
+};
+
+#endif // CppBoundClass_h
diff --git a/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp b/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp
new file mode 100644
index 0000000..9539907
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp
@@ -0,0 +1,310 @@
+/*
+ * 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 "CppVariant.h"
+
+#include "public/WebBindings.h"
+#include <limits>
+#include <wtf/Assertions.h>
+#include <wtf/StringExtras.h>
+
+using namespace WebKit;
+using namespace std;
+
+CppVariant::CppVariant()
+{
+    type = NPVariantType_Null;
+}
+
+// Note that Set() performs a deep copy, which is necessary to safely
+// call FreeData() on the value in the destructor.
+CppVariant::CppVariant(const CppVariant& original)
+{
+    type = NPVariantType_Null;
+    set(original);
+}
+
+// See comment for copy constructor, above.
+CppVariant& CppVariant::operator=(const CppVariant& original)
+{
+    if (&original != this)
+        set(original);
+    return *this;
+}
+
+CppVariant::~CppVariant()
+{
+    freeData();
+}
+
+void CppVariant::freeData()
+{
+    WebBindings::releaseVariantValue(this);
+}
+
+bool CppVariant::isEqual(const CppVariant& other) const
+{
+    if (type != other.type)
+        return false;
+
+    switch (type) {
+    case NPVariantType_Bool:
+        return (value.boolValue == other.value.boolValue);
+    case NPVariantType_Int32:
+        return (value.intValue == other.value.intValue);
+    case NPVariantType_Double:
+        return (value.doubleValue == other.value.doubleValue);
+    case NPVariantType_String: {
+        const NPString *this_value = &value.stringValue;
+        const NPString *other_value = &other.value.stringValue;
+        uint32_t len = this_value->UTF8Length;
+        return len == other_value->UTF8Length
+            && !strncmp(this_value->UTF8Characters,
+                        other_value->UTF8Characters, len);
+    }
+    case NPVariantType_Null:
+    case NPVariantType_Void:
+        return true;
+    case NPVariantType_Object: {
+        NPObject* thisValue = value.objectValue;
+        NPObject* otherValue = other.value.objectValue;
+        return thisValue->_class == otherValue->_class
+            && thisValue->referenceCount == otherValue->referenceCount;
+    }
+    }
+    return false;
+}
+
+void CppVariant::copyToNPVariant(NPVariant* result) const
+{
+    result->type = type;
+    switch (type) {
+    case NPVariantType_Bool:
+        result->value.boolValue = value.boolValue;
+        break;
+    case NPVariantType_Int32:
+        result->value.intValue = value.intValue;
+        break;
+    case NPVariantType_Double:
+        result->value.doubleValue = value.doubleValue;
+        break;
+    case NPVariantType_String:
+        WebBindings::initializeVariantWithStringCopy(result, &value.stringValue);
+        break;
+    case NPVariantType_Null:
+    case NPVariantType_Void:
+        // Nothing to set.
+        break;
+    case NPVariantType_Object:
+        result->type = NPVariantType_Object;
+        result->value.objectValue = WebBindings::retainObject(value.objectValue);
+        break;
+    }
+}
+
+void CppVariant::set(const NPVariant& newValue)
+{
+    freeData();
+    switch (newValue.type) {
+    case NPVariantType_Bool:
+        set(newValue.value.boolValue);
+        break;
+    case NPVariantType_Int32:
+        set(newValue.value.intValue);
+        break;
+    case NPVariantType_Double:
+        set(newValue.value.doubleValue);
+        break;
+    case NPVariantType_String:
+        set(newValue.value.stringValue);
+        break;
+    case NPVariantType_Null:
+    case NPVariantType_Void:
+        type = newValue.type;
+        break;
+    case NPVariantType_Object:
+        set(newValue.value.objectValue);
+        break;
+    }
+}
+
+void CppVariant::setNull()
+{
+    freeData();
+    type = NPVariantType_Null;
+}
+
+void CppVariant::set(bool newValue)
+{
+    freeData();
+    type = NPVariantType_Bool;
+    value.boolValue = newValue;
+}
+
+void CppVariant::set(int32_t newValue)
+{
+    freeData();
+    type = NPVariantType_Int32;
+    value.intValue = newValue;
+}
+
+void CppVariant::set(double newValue)
+{
+    freeData();
+    type = NPVariantType_Double;
+    value.doubleValue = newValue;
+}
+
+// The newValue must be a null-terminated string.
+void CppVariant::set(const char* newValue)
+{
+    freeData();
+    type = NPVariantType_String;
+    NPString newString = {newValue,
+                          static_cast<uint32_t>(strlen(newValue))};
+    WebBindings::initializeVariantWithStringCopy(this, &newString);
+}
+
+void CppVariant::set(const string& newValue)
+{
+    freeData();
+    type = NPVariantType_String;
+    NPString newString = {newValue.data(),
+                          static_cast<uint32_t>(newValue.size())};
+    WebBindings::initializeVariantWithStringCopy(this, &newString);
+}
+
+void CppVariant::set(const NPString& newValue)
+{
+    freeData();
+    type = NPVariantType_String;
+    WebBindings::initializeVariantWithStringCopy(this, &newValue);
+}
+
+void CppVariant::set(NPObject* newValue)
+{
+    freeData();
+    type = NPVariantType_Object;
+    value.objectValue = WebBindings::retainObject(newValue);
+}
+
+string CppVariant::toString() const
+{
+    ASSERT(isString());
+    return string(value.stringValue.UTF8Characters,
+                  value.stringValue.UTF8Length);
+}
+
+int32_t CppVariant::toInt32() const
+{
+    if (isInt32())
+        return value.intValue;
+    if (isDouble())
+        return static_cast<int32_t>(value.doubleValue);
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+double CppVariant::toDouble() const
+{
+    if (isInt32())
+        return static_cast<double>(value.intValue);
+    if (isDouble())
+        return value.doubleValue;
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+bool CppVariant::toBoolean() const
+{
+    ASSERT(isBool());
+    return value.boolValue;
+}
+
+Vector<string> CppVariant::toStringVector() const
+{
+
+    ASSERT(isObject());
+    Vector<string> stringVector;
+    NPObject* npValue = value.objectValue;
+    NPIdentifier lengthId = WebBindings::getStringIdentifier("length");
+
+    if (!WebBindings::hasProperty(0, npValue, lengthId))
+        return stringVector;
+
+    NPVariant lengthValue;
+    if (!WebBindings::getProperty(0, npValue, lengthId, &lengthValue))
+        return stringVector;
+
+    int length = 0;
+    // The length is a double in some cases.
+    if (NPVARIANT_IS_DOUBLE(lengthValue))
+        length = static_cast<int>(NPVARIANT_TO_DOUBLE(lengthValue));
+    else if (NPVARIANT_IS_INT32(lengthValue))
+        length = NPVARIANT_TO_INT32(lengthValue);
+    WebBindings::releaseVariantValue(&lengthValue);
+
+    // For sanity, only allow 100 items.
+    length = min(100, length);
+    for (int i = 0; i < length; ++i) {
+        // Get each of the items.
+        char indexInChar[20]; // Enough size to store 32-bit integer
+        snprintf(indexInChar, 20, "%d", i);
+        string index(indexInChar);
+        NPIdentifier indexId = WebBindings::getStringIdentifier(index.c_str());
+        if (!WebBindings::hasProperty(0, npValue, indexId))
+            continue;
+        NPVariant indexValue;
+        if (!WebBindings::getProperty(0, npValue, indexId, &indexValue))
+            continue;
+        if (NPVARIANT_IS_STRING(indexValue)) {
+            string item(NPVARIANT_TO_STRING(indexValue).UTF8Characters,
+                        NPVARIANT_TO_STRING(indexValue).UTF8Length);
+            stringVector.append(item);
+        }
+        WebBindings::releaseVariantValue(&indexValue);
+    }
+    return stringVector;
+}
+
+bool CppVariant::invoke(const string& method, const CppVariant* arguments,
+                        uint32_t argumentCount, CppVariant& result) const
+{
+    ASSERT(isObject());
+    NPIdentifier methodName = WebBindings::getStringIdentifier(method.c_str());
+    NPObject* npObject = value.objectValue;
+    if (!WebBindings::hasMethod(0, npObject, methodName))
+        return false;
+    NPVariant r;
+    bool status = WebBindings::invoke(0, npObject, methodName, arguments, argumentCount, &r);
+    result.set(r);
+    return status;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/CppVariant.h b/WebKitTools/DumpRenderTree/chromium/CppVariant.h
new file mode 100644
index 0000000..d34a163
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppVariant.h
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+/*
+  This file contains the declaration for CppVariant, a type used by C++ classes
+  that are to be bound to JavaScript objects.
+
+  CppVariant exists primarily as an interface between C++ callers and the
+  corresponding NPVariant type.  CppVariant also provides a number of
+  convenience constructors and accessors, so that the NPVariantType values
+  don't need to be exposed, and a destructor to free any memory allocated for
+  string values.
+*/
+
+#ifndef CppVariant_h
+#define CppVariant_h
+
+#include "base/basictypes.h"
+#include "public/WebBindings.h"
+#include <string>
+#include <wtf/Vector.h>
+
+class CppVariant : public NPVariant {
+public:
+    CppVariant();
+    ~CppVariant();
+    void setNull();
+    void set(bool);
+    void set(int32_t);
+    void set(double);
+
+    // Note that setting a CppVariant to a string value involves copying the
+    // string data, which must be freed with a call to freeData() when the
+    // CppVariant is set to a different value or is no longer needed.  Normally
+    // this is handled by the other set() methods and by the destructor.
+    void set(const char*); // Must be a null-terminated string.
+    void set(const std::string&);
+    void set(const NPString&);
+    void set(const NPVariant&);
+
+    // Note that setting a CppVariant to an NPObject involves ref-counting
+    // the actual object. freeData() should only be called if the CppVariant
+    // is no longer needed. The other set() methods handle this internally.
+    // Also, the object's NPClass is expected to be a static object: neither
+    // the NP runtime nor CppVariant will ever free it.
+    void set(NPObject*_value);
+
+    // These three methods all perform deep copies of any string data.  This
+    // allows local CppVariants to be released by the destructor without
+    // corrupting their sources. In performance-critical code, or when strings
+    // are very long, avoid creating new CppVariants.
+    // In case of NPObject as the data, the copying involves ref-counting
+    // as opposed to deep-copying. The ref-counting ensures that sources don't
+    // get corrupted when the copies get destroyed.
+    void copyToNPVariant(NPVariant* result) const;
+    CppVariant& operator=(const CppVariant& original);
+    CppVariant(const CppVariant& original);
+
+    // Calls NPN_ReleaseVariantValue, which frees any string data
+    // held by the object and sets its type to null.
+    // In case of NPObject, the NPN_ReleaseVariantValue decrements
+    // the ref-count (releases when ref-count becomes 0)
+    void freeData();
+
+    // Compares this CppVariant's type and value to another's.  They must be
+    // identical in both type and value to be considered equal.  For string and
+    // object types, a deep comparison is performed; that is, the contents of the
+    // strings, or the classes and refcounts of the objects, must be the same,
+    // but they need not be the same pointers.
+    bool isEqual(const CppVariant&) const;
+
+    // The value of a CppVariant may be read directly from its NPVariant (but
+    // should only be set using one of the set() methods above). Although the
+    // type of a CppVariant is likewise public, it can be accessed through these
+    // functions rather than directly if a caller wishes to avoid dependence on
+    // the NPVariantType values.
+    bool isBool() const { return (type == NPVariantType_Bool); }
+    bool isInt32() const { return (type == NPVariantType_Int32); }
+    bool isDouble() const { return (type == NPVariantType_Double); }
+    bool isNumber() const { return (isInt32() || isDouble()); }
+    bool isString() const { return (type == NPVariantType_String); }
+    bool isVoid() const { return (type == NPVariantType_Void); }
+    bool isNull() const { return (type == NPVariantType_Null); }
+    bool isEmpty() const { return (isVoid() || isNull()); }
+    bool isObject() const { return (type == NPVariantType_Object); }
+
+    // Converters.  The CppVariant must be of a type convertible to these values.
+    // For example, toInt32() works only if isNumber() is true.
+    std::string toString() const;
+    int32_t toInt32() const;
+    double toDouble() const;
+    bool toBoolean() const;
+    // Returns a vector of strings for the specified argument. This is useful
+    // for converting a JavaScript array of strings into a vector of strings.
+    Vector<std::string> toStringVector() const;
+
+    // Invoke method of the given name on an object with the supplied arguments.
+    // The first argument should be the object on which the method is to be
+    // invoked.  Returns whether the method was successfully invoked.  If the
+    // method was invoked successfully, any return value is stored in the
+    // CppVariant specified by result.
+    bool invoke(const std::string&, const CppVariant* arguments,
+                uint32_t argumentCount, CppVariant& result) const;
+};
+
+#endif // CppVariant_h
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
new file mode 100644
index 0000000..c81480f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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 "TestShell.h"
+#include "webkit/support/webkit_support.h"
+#include <wtf/Vector.h>
+#if OS(MAC_OS_X)
+#include "WebSystemInterface.h"
+#endif
+
+using namespace std;
+
+static const char optionComplexText[] = "--complex-text";
+static const char optionDumpAllPixels[] = "--dump-all-pixels";
+static const char optionNotree[] = "--notree";
+static const char optionPixelTests[] = "--pixel-tests";
+static const char optionThreaded[] = "--threaded";
+static const char optionTree[] = "--tree";
+
+static void runTest(TestShell& shell, TestParams& params, const string& testName)
+{
+    string pathOrURL = testName;
+    string::size_type separatorPosition = pathOrURL.find("'");
+    if (separatorPosition != string::npos) {
+        params.pixelHash = pathOrURL.substr(separatorPosition + 1);
+        pathOrURL.erase(separatorPosition);
+    }
+    params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL);
+    shell.resetTestController();
+    shell.runFileTest(params);
+}
+
+int main(int argc, char* argv[])
+{
+#if OS(MAC_OS_X)
+    // Need to call before instantiate WebKitClient.
+     InitWebCoreSystemInterface();
+#endif
+    webkit_support::SetUpTestEnvironment();
+
+    TestParams params;
+    Vector<string> tests;
+    bool serverMode = false;
+    for (int i = 1; i < argc; ++i) {
+        string argument(argv[i]);
+        if (argument == "-")
+            serverMode = true;
+        else if (argument == optionNotree)
+            params.dumpTree = false;
+        else if (argument == optionPixelTests)
+            params.dumpPixels = true;
+        else if (argument.size() && argument[0] == '-')
+            fprintf(stderr, "Unknown option: %s\n", argv[i]);
+        else
+            tests.append(argument);
+    }
+
+    { // Explicit scope for the TestShell instance.
+        TestShell shell;
+        if (serverMode && !tests.size()) {
+            params.printSeparators = true;
+            char testString[2048]; // 2048 is the same as the sizes of other platforms.
+            while (fgets(testString, sizeof(testString), stdin)) {
+                char* newLinePosition = strchr(testString, '\n');
+                if (newLinePosition)
+                    *newLinePosition = '\0';
+                if (testString[0] == '\0')
+                    continue;
+                runTest(shell, params, testString);
+            }
+        } else if (!tests.size())
+            printf("#EOF\n");
+        else {
+            params.printSeparators = tests.size() > 1;
+            for (unsigned i = 0; i < tests.size(); i++)
+                runTest(shell, params, tests[i]);
+        }
+
+        shell.callJSGC();
+        shell.callJSGC();
+
+        // When we finish the last test, cleanup the LayoutTestController.
+        // It may have references to not-yet-cleaned up windows.  By
+        // cleaning up here we help purify reports.
+        shell.resetTestController();
+    }
+
+    webkit_support::TearDownTestEnvironment();
+    return EXIT_SUCCESS;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
new file mode 100644
index 0000000..c48aaf4
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
@@ -0,0 +1,807 @@
+/*
+ * 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.
+ */
+
+// This file contains the definition for EventSender.
+//
+// Some notes about drag and drop handling:
+// Windows drag and drop goes through a system call to doDragDrop.  At that
+// point, program control is given to Windows which then periodically makes
+// callbacks into the webview.  This won't work for layout tests, so instead,
+// we queue up all the mouse move and mouse up events.  When the test tries to
+// start a drag (by calling EvenSendingController::doDragDrop), we take the
+// events in the queue and replay them.
+// The behavior of queuing events and replaying them can be disabled by a
+// layout test by setting eventSender.dragMode to false.
+
+#include "config.h"
+#include "EventSender.h"
+
+#include "TestShell.h"
+#include "base/keyboard_codes.h"
+#include "base/time.h"
+#include "public/WebDragData.h"
+#include "public/WebDragOperation.h"
+#include "public/WebPoint.h"
+#include "public/WebString.h"
+#include "public/WebView.h"
+#include "webkit/support/webkit_support.h"
+#include <wtf/Deque.h>
+#include <wtf/StringExtras.h>
+
+#if OS(WINDOWS)
+#include "public/win/WebInputEventFactory.h"
+#endif
+
+// FIXME: layout before each event?
+
+using namespace base;
+using namespace std;
+using namespace WebKit;
+
+TestShell* EventSender::testShell = 0;
+WebPoint EventSender::lastMousePos;
+WebMouseEvent::Button EventSender::pressedButton = WebMouseEvent::ButtonNone;
+WebMouseEvent::Button EventSender::lastButtonType = WebMouseEvent::ButtonNone;
+
+struct SavedEvent {
+    enum SavedEventType {
+        Unspecified,
+        MouseUp,
+        MouseMove,
+        LeapForward
+    };
+
+    SavedEventType type;
+    WebMouseEvent::Button buttonType; // For MouseUp.
+    WebPoint pos; // For MouseMove.
+    int milliseconds; // For LeapForward.
+
+    SavedEvent()
+        : type(Unspecified)
+        , buttonType(WebMouseEvent::ButtonNone)
+        , milliseconds(0) {}
+};
+
+static WebDragData currentDragData;
+static WebDragOperation currentDragEffect;
+static WebDragOperationsMask currentDragEffectsAllowed;
+static bool replayingSavedEvents = false;
+static Deque<SavedEvent> mouseEventQueue;
+
+// Time and place of the last mouse up event.
+static double lastClickTimeSec = 0;
+static WebPoint lastClickPos;
+static int clickCount = 0;
+
+// maximum distance (in space and time) for a mouse click
+// to register as a double or triple click
+static const double multipleClickTimeSec = 1;
+static const int multipleClickRadiusPixels = 5;
+
+// How much we should scroll per event - the value here is chosen to
+// match the WebKit impl and layout test results.
+static const float scrollbarPixelsPerTick = 40.0f;
+
+inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b)
+{
+    return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)) >
+        multipleClickRadiusPixels * multipleClickRadiusPixels;
+}
+
+// Used to offset the time the event hander things an event happened.  This is
+// done so tests can run without a delay, but bypass checks that are time
+// dependent (e.g., dragging has a timeout vs selection).
+static uint32 timeOffsetMs = 0;
+
+static double getCurrentEventTimeSec()
+{
+    return (TimeTicks::Now().ToInternalValue() / Time::kMicrosecondsPerMillisecond + timeOffsetMs) / 1000.0;
+}
+
+static void advanceEventTime(int32_t deltaMs)
+{
+    timeOffsetMs += deltaMs;
+}
+
+static void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b,
+                           const gfx::Point& pos, WebMouseEvent* e)
+{
+    e->type = t;
+    e->button = b;
+    e->modifiers = 0;
+    e->x = pos.x();
+    e->y = pos.y();
+    e->globalX = pos.x();
+    e->globalY = pos.y();
+    e->timeStampSeconds = getCurrentEventTimeSec();
+    e->clickCount = clickCount;
+}
+
+// Returns true if the specified key is the system key.
+static bool applyKeyModifier(const string& modifierName, WebInputEvent* event)
+{
+    bool isSystemKey = false;
+    const char* characters = modifierName.c_str();
+    if (!strcmp(characters, "ctrlKey")
+#if !OS(MAC_OS_X)
+        || !strcmp(characters, "addSelectionKey")
+#endif
+        ) {
+        event->modifiers |= WebInputEvent::ControlKey;
+    } else if (!strcmp(characters, "shiftKey") || !strcmp(characters, "rangeSelectionKey"))
+        event->modifiers |= WebInputEvent::ShiftKey;
+    else if (!strcmp(characters, "altKey")) {
+        event->modifiers |= WebInputEvent::AltKey;
+#if !OS(MAC_OS_X)
+        // On Windows all keys with Alt modifier will be marked as system key.
+        // We keep the same behavior on Linux, see:
+        // WebKit/chromium/src/gtk/WebInputEventFactory.cpp
+        // If we want to change this behavior on Linux, this piece of code must be
+        // kept in sync with the related code in above file.
+        isSystemKey = true;
+#endif
+#if OS(MAC_OS_X)
+    } else if (!strcmp(characters, "metaKey") || !strcmp(characters, "addSelectionKey")) {
+        event->modifiers |= WebInputEvent::MetaKey;
+        // On Mac only command key presses are marked as system key.
+        // See the related code in: WebKit/chromium/src/mac/WebInputEventFactory.cpp
+        // It must be kept in sync with the related code in above file.
+        isSystemKey = true;
+#else
+    } else if (!strcmp(characters, "metaKey")) {
+        event->modifiers |= WebInputEvent::MetaKey;
+#endif
+    }
+    return isSystemKey;
+}
+
+static bool applyKeyModifiers(const CppVariant* argument, WebInputEvent* event)
+{
+    bool isSystemKey = false;
+    if (argument->isObject()) {
+        Vector<string> modifiers = argument->toStringVector();
+        for (Vector<string>::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i)
+            isSystemKey |= applyKeyModifier(*i, event);
+    } else if (argument->isString())
+        isSystemKey = applyKeyModifier(argument->toString(), event);
+    return isSystemKey;
+}
+
+// Get the edit command corresponding to a keyboard event.
+// Returns true if the specified event corresponds to an edit command, the name
+// of the edit command will be stored in |*name|.
+bool getEditCommand(const WebKeyboardEvent& event, string* name)
+{
+#if OS(MAC_OS_X)
+    // We only cares about Left,Right,Up,Down keys with Command or Command+Shift
+    // modifiers. These key events correspond to some special movement and
+    // selection editor commands, and was supposed to be handled in
+    // WebKit/chromium/src/EditorClientImpl.cpp. But these keys will be marked
+    // as system key, which prevents them from being handled. Thus they must be
+    // handled specially.
+    if ((event.modifiers & ~WebKeyboardEvent::ShiftKey) != WebKeyboardEvent::MetaKey)
+        return false;
+
+    switch (event.windowsKeyCode) {
+    case base::VKEY_LEFT:
+        *name = "MoveToBeginningOfLine";
+        break;
+    case base::VKEY_RIGHT:
+        *name = "MoveToEndOfLine";
+        break;
+    case base::VKEY_UP:
+        *name = "MoveToBeginningOfDocument";
+        break;
+    case base::VKEY_DOWN:
+        *name = "MoveToEndOfDocument";
+        break;
+    default:
+        return false;
+    }
+
+    if (event.modifiers & WebKeyboardEvent::ShiftKey)
+        name->append("AndModifySelection");
+
+    return true;
+#else
+    return false;
+#endif
+}
+
+// Key event location code introduced in DOM Level 3.
+// See also: http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents
+enum KeyLocationCode {
+    DOMKeyLocationStandard      = 0x00,
+    DOMKeyLocationLeft          = 0x01,
+    DOMKeyLocationRight         = 0x02,
+    DOMKeyLocationNumpad        = 0x03
+};
+
+EventSender::EventSender(TestShell* shell)
+    : m_methodFactory(this)
+{
+    // Set static testShell variable since we can't do it in an initializer list.
+    // We also need to be careful not to assign testShell to new windows which are
+    // temporary.
+    if (!testShell)
+        testShell = shell;
+
+    // Initialize the map that associates methods of this class with the names
+    // they will use when called by JavaScript.  The actual binding of those
+    // names to their methods will be done by calling bindToJavaScript() (defined
+    // by CppBoundClass, the parent to EventSender).
+    bindMethod("mouseDown", &EventSender::mouseDown);
+    bindMethod("mouseUp", &EventSender::mouseUp);
+    bindMethod("contextClick", &EventSender::contextClick);
+    bindMethod("mouseMoveTo", &EventSender::mouseMoveTo);
+    bindMethod("mouseWheelTo", &EventSender::mouseWheelTo);
+    bindMethod("leapForward", &EventSender::leapForward);
+    bindMethod("keyDown", &EventSender::keyDown);
+    bindMethod("dispatchMessage", &EventSender::dispatchMessage);
+    bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging);
+    bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsToElement);
+    bindMethod("clearKillRing", &EventSender::clearKillRing);
+    bindMethod("textZoomIn", &EventSender::textZoomIn);
+    bindMethod("textZoomOut", &EventSender::textZoomOut);
+    bindMethod("zoomPageIn", &EventSender::zoomPageIn);
+    bindMethod("zoomPageOut", &EventSender::zoomPageOut);
+    bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick);
+    bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles);
+
+    // When set to true (the default value), we batch mouse move and mouse up
+    // events so we can simulate drag & drop.
+    bindProperty("dragMode", &dragMode);
+#if OS(WINDOWS)
+    bindProperty("WM_KEYDOWN", &wmKeyDown);
+    bindProperty("WM_KEYUP", &wmKeyUp);
+    bindProperty("WM_CHAR", &wmChar);
+    bindProperty("WM_DEADCHAR", &wmDeadChar);
+    bindProperty("WM_SYSKEYDOWN", &wmSysKeyDown);
+    bindProperty("WM_SYSKEYUP", &wmSysKeyUp);
+    bindProperty("WM_SYSCHAR", &wmSysChar);
+    bindProperty("WM_SYSDEADCHAR", &wmSysDeadChar);
+#endif
+}
+
+void EventSender::reset()
+{
+    // The test should have finished a drag and the mouse button state.
+    ASSERT(currentDragData.isNull());
+    currentDragData.reset();
+    currentDragEffect = WebKit::WebDragOperationNone;
+    currentDragEffectsAllowed = WebKit::WebDragOperationNone;
+    pressedButton = WebMouseEvent::ButtonNone;
+    dragMode.set(true);
+#if OS(WINDOWS)
+    wmKeyDown.set(WM_KEYDOWN);
+    wmKeyUp.set(WM_KEYUP);
+    wmChar.set(WM_CHAR);
+    wmDeadChar.set(WM_DEADCHAR);
+    wmSysKeyDown.set(WM_SYSKEYDOWN);
+    wmSysKeyUp.set(WM_SYSKEYUP);
+    wmSysChar.set(WM_SYSCHAR);
+    wmSysDeadChar.set(WM_SYSDEADCHAR);
+#endif
+    lastMousePos = WebPoint(0, 0);
+    lastClickTimeSec = 0;
+    lastClickPos = WebPoint(0, 0);
+    clickCount = 0;
+    lastButtonType = WebMouseEvent::ButtonNone;
+    timeOffsetMs = 0;
+}
+
+WebView* EventSender::webview()
+{
+    return testShell->webView();
+}
+
+void EventSender::doDragDrop(const WebKit::WebPoint& eventPos,
+                             const WebDragData& dragData,
+                             WebDragOperationsMask mask)
+{
+    WebMouseEvent event;
+    initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event);
+    WebPoint clientPoint(event.x, event.y);
+    WebPoint screenPoint(event.globalX, event.globalY);
+    currentDragData = dragData;
+    currentDragEffectsAllowed = mask;
+    currentDragEffect = webview()->dragTargetDragEnter(dragData, 0, clientPoint, screenPoint, currentDragEffectsAllowed);
+
+    // Finish processing events.
+    replaySavedEvents();
+}
+
+WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode)
+{
+    if (!buttonCode)
+        return WebMouseEvent::ButtonLeft;
+    if (buttonCode == 2)
+        return WebMouseEvent::ButtonRight;
+    return WebMouseEvent::ButtonMiddle;
+}
+
+int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments)
+{
+    int buttonCode = 0;
+    if (arguments.size() > 0 && arguments[0].isNumber())
+        buttonCode = arguments[0].toInt32();
+    return buttonCode;
+}
+
+void EventSender::updateClickCountForButton(WebMouseEvent::Button buttonType)
+{
+    if ((getCurrentEventTimeSec() - lastClickTimeSec < multipleClickTimeSec)
+        && (!outsideMultiClickRadius(lastMousePos, lastClickPos))
+        && (buttonType == lastButtonType))
+        ++clickCount;
+    else {
+        clickCount = 1;
+        lastButtonType = buttonType;
+    }
+}
+
+//
+// Implemented javascript methods.
+//
+
+void EventSender::mouseDown(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (result) // Could be 0 if invoked asynchronously.
+        result->setNull();
+
+    webview()->layout();
+
+    int buttonNumber = getButtonNumberFromSingleArg(arguments);
+    ASSERT(buttonNumber != -1);
+
+    WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
+
+    updateClickCountForButton(buttonType);
+
+    WebMouseEvent event;
+    pressedButton = buttonType;
+    initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event);
+    if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+        applyKeyModifiers(&(arguments[1]), &event);
+    webview()->handleInputEvent(event);
+}
+
+void EventSender::mouseUp(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (result) // Could be 0 if invoked asynchronously.
+        result->setNull();
+
+    webview()->layout();
+
+    int buttonNumber = getButtonNumberFromSingleArg(arguments);
+    ASSERT(buttonNumber != -1);
+
+    WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
+
+    if (isDragMode() && !replayingSavedEvents) {
+        SavedEvent savedEvent;
+        savedEvent.type = SavedEvent::MouseUp;
+        savedEvent.buttonType = buttonType;
+        mouseEventQueue.append(savedEvent);
+        replaySavedEvents();
+    } else {
+        WebMouseEvent event;
+        initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event);
+        if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+            applyKeyModifiers(&(arguments[1]), &event);
+        doMouseUp(event);
+    }
+}
+
+void EventSender::doMouseUp(const WebMouseEvent& e)
+{
+    webview()->handleInputEvent(e);
+
+    pressedButton = WebMouseEvent::ButtonNone;
+    lastClickTimeSec = e.timeStampSeconds;
+    lastClickPos = lastMousePos;
+
+    // If we're in a drag operation, complete it.
+    if (currentDragData.isNull())
+        return;
+    WebPoint clientPoint(e.x, e.y);
+    WebPoint screenPoint(e.globalX, e.globalY);
+
+    currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed);
+    if (currentDragEffect)
+        webview()->dragTargetDrop(clientPoint, screenPoint);
+    else
+        webview()->dragTargetDragLeave();
+    webview()->dragSourceEndedAt(clientPoint, screenPoint, currentDragEffect);
+    webview()->dragSourceSystemDragEnded();
+
+    currentDragData.reset();
+}
+
+void EventSender::mouseMoveTo(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+        return;
+    webview()->layout();
+
+    WebPoint mousePos(arguments[0].toInt32(), arguments[1].toInt32());
+
+    if (isDragMode() && pressedButton == WebMouseEvent::ButtonLeft && !replayingSavedEvents) {
+        SavedEvent savedEvent;
+        savedEvent.type = SavedEvent::MouseMove;
+        savedEvent.pos = mousePos;
+        mouseEventQueue.append(savedEvent);
+    } else {
+        WebMouseEvent event;
+        initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event);
+        doMouseMove(event);
+    }
+}
+
+void EventSender::mouseWheelTo(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+        return;
+
+    // Force a layout here just to make sure every position has been
+    // determined before we send events (as well as all the other methods
+    // that send an event do). The layout test calling this
+    // (scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html, only one
+    // for now) does not rely on this though.
+    webview()->layout();
+
+    int horizontal = arguments[0].toInt32();
+    int vertical = arguments[1].toInt32();
+
+    WebMouseWheelEvent event;
+    initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event);
+    event.wheelTicksX = static_cast<float>(horizontal);
+    event.wheelTicksY = static_cast<float>(vertical);
+    event.deltaX = -horizontal * scrollbarPixelsPerTick;
+    event.deltaY = -vertical * scrollbarPixelsPerTick;
+    webview()->handleInputEvent(event);
+}
+
+void EventSender::doMouseMove(const WebMouseEvent& e)
+{
+    lastMousePos = WebPoint(e.x, e.y);
+
+    webview()->handleInputEvent(e);
+
+    if (pressedButton == WebMouseEvent::ButtonNone || currentDragData.isNull())
+        return;
+    WebPoint clientPoint(e.x, e.y);
+    WebPoint screenPoint(e.globalX, e.globalY);
+    currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed);
+}
+
+void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 1 || !arguments[0].isString())
+        return;
+    bool generateChar = false;
+
+    // FIXME: I'm not exactly sure how we should convert the string to a key
+    // event. This seems to work in the cases I tested.
+    // FIXME: Should we also generate a KEY_UP?
+    string codeStr = arguments[0].toString();
+
+    // Convert \n -> VK_RETURN.  Some layout tests use \n to mean "Enter", when
+    // Windows uses \r for "Enter".
+    int code = 0;
+    int text = 0;
+    bool needsShiftKeyModifier = false;
+    if ("\n" == codeStr) {
+        generateChar = true;
+        text = code = base::VKEY_RETURN;
+    } else if ("rightArrow" == codeStr)
+        code = base::VKEY_RIGHT;
+    else if ("downArrow" == codeStr)
+        code = base::VKEY_DOWN;
+    else if ("leftArrow" == codeStr)
+        code = base::VKEY_LEFT;
+    else if ("upArrow" == codeStr)
+        code = base::VKEY_UP;
+    else if ("delete" == codeStr)
+        code = base::VKEY_BACK;
+    else if ("pageUp" == codeStr)
+        code = base::VKEY_PRIOR;
+    else if ("pageDown" == codeStr)
+        code = base::VKEY_NEXT;
+    else if ("home" == codeStr)
+        code = base::VKEY_HOME;
+    else if ("end" == codeStr)
+        code = base::VKEY_END;
+    else {
+        // Compare the input string with the function-key names defined by the
+        // DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key
+        // name, set its key code.
+        for (int i = 1; i <= 24; ++i) {
+            char functionChars[10];
+            snprintf(functionChars, 10, "F%d", i);
+            string functionKeyName(functionChars);
+            if (functionKeyName == codeStr) {
+                code = base::VKEY_F1 + (i - 1);
+                break;
+            }
+        }
+        if (!code) {
+            WebString webCodeStr = WebString::fromUTF8(codeStr.data(), codeStr.size());
+            ASSERT(webCodeStr.length() == 1);
+            text = code = webCodeStr.data()[0];
+            needsShiftKeyModifier = needsShiftModifier(code);
+            if ((code & 0xFF) >= 'a' && (code & 0xFF) <= 'z')
+                code -= 'a' - 'A';
+            generateChar = true;
+        }
+    }
+
+    // For one generated keyboard event, we need to generate a keyDown/keyUp
+    // pair; refer to EventSender.cpp in WebKit/WebKitTools/DumpRenderTree/win.
+    // On Windows, we might also need to generate a char event to mimic the
+    // Windows event flow; on other platforms we create a merged event and test
+    // the event flow that that platform provides.
+    WebKeyboardEvent eventDown, eventChar, eventUp;
+    eventDown.type = WebInputEvent::RawKeyDown;
+    eventDown.modifiers = 0;
+    eventDown.windowsKeyCode = code;
+    if (generateChar) {
+        eventDown.text[0] = text;
+        eventDown.unmodifiedText[0] = text;
+    }
+    eventDown.setKeyIdentifierFromWindowsKeyCode();
+
+    if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+        eventDown.isSystemKey = applyKeyModifiers(&(arguments[1]), &eventDown);
+
+    if (needsShiftKeyModifier)
+        eventDown.modifiers |= WebInputEvent::ShiftKey;
+
+    // See if KeyLocation argument is given.
+    if (arguments.size() >= 3 && arguments[2].isNumber()) {
+        int location = arguments[2].toInt32();
+        if (location == DOMKeyLocationNumpad)
+            eventDown.modifiers |= WebInputEvent::IsKeyPad;
+    }
+
+    eventChar = eventUp = eventDown;
+    eventUp.type = WebInputEvent::KeyUp;
+    // EventSender.m forces a layout here, with at least one
+    // test (fast/forms/focus-control-to-page.html) relying on this.
+    webview()->layout();
+
+    // In the browser, if a keyboard event corresponds to an editor command,
+    // the command will be dispatched to the renderer just before dispatching
+    // the keyboard event, and then it will be executed in the
+    // RenderView::handleCurrentKeyboardEvent() method, which is called from
+    // third_party/WebKit/WebKit/chromium/src/EditorClientImpl.cpp.
+    // We just simulate the same behavior here.
+    string editCommand;
+    if (getEditCommand(eventDown, &editCommand))
+        testShell->webViewHost()->setEditCommand(editCommand, "");
+
+    webview()->handleInputEvent(eventDown);
+
+    testShell->webViewHost()->clearEditCommand();
+
+    if (generateChar) {
+        eventChar.type = WebInputEvent::Char;
+        eventChar.keyIdentifier[0] = '\0';
+        webview()->handleInputEvent(eventChar);
+    }
+
+    webview()->handleInputEvent(eventUp);
+}
+
+void EventSender::dispatchMessage(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+#if OS(WINDOWS)
+    if (arguments.size() == 3) {
+        // Grab the message id to see if we need to dispatch it.
+        int msg = arguments[0].toInt32();
+
+        // WebKit's version of this function stuffs a MSG struct and uses
+        // TranslateMessage and DispatchMessage. We use a WebKeyboardEvent, which
+        // doesn't need to receive the DeadChar and SysDeadChar messages.
+        if (msg == WM_DEADCHAR || msg == WM_SYSDEADCHAR)
+            return;
+
+        webview()->layout();
+
+        unsigned long lparam = static_cast<unsigned long>(arguments[2].toDouble());
+        webview()->handleInputEvent(WebInputEventFactory::keyboardEvent(0, msg, arguments[1].toInt32(), lparam));
+    } else
+        ASSERT_NOT_REACHED();
+#endif
+}
+
+bool EventSender::needsShiftModifier(int keyCode)
+{
+    // If code is an uppercase letter, assign a SHIFT key to
+    // eventDown.modifier, this logic comes from
+    // WebKit/WebKitTools/DumpRenderTree/Win/EventSender.cpp
+    return (keyCode & 0xFF) >= 'A' && (keyCode & 0xFF) <= 'Z';
+}
+
+void EventSender::leapForward(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    if (arguments.size() < 1 || !arguments[0].isNumber())
+        return;
+
+    int milliseconds = arguments[0].toInt32();
+    if (isDragMode() && pressedButton == WebMouseEvent::ButtonLeft && !replayingSavedEvents) {
+        SavedEvent savedEvent;
+        savedEvent.type = SavedEvent::LeapForward;
+        savedEvent.milliseconds = milliseconds;
+        mouseEventQueue.append(savedEvent);
+    } else
+        doLeapForward(milliseconds);
+}
+
+void EventSender::doLeapForward(int milliseconds)
+{
+    advanceEventTime(milliseconds);
+}
+
+// Apple's port of WebKit zooms by a factor of 1.2 (see
+// WebKit/WebView/WebView.mm)
+void EventSender::textZoomIn(const CppArgumentList&, CppVariant* result)
+{
+    webview()->setZoomLevel(true, webview()->zoomLevel() + 1);
+    result->setNull();
+}
+
+void EventSender::textZoomOut(const CppArgumentList&, CppVariant* result)
+{
+    webview()->setZoomLevel(true, webview()->zoomLevel() - 1);
+    result->setNull();
+}
+
+void EventSender::zoomPageIn(const CppArgumentList&, CppVariant* result)
+{
+    webview()->setZoomLevel(false, webview()->zoomLevel() + 1);
+    result->setNull();
+}
+
+void EventSender::zoomPageOut(const CppArgumentList&, CppVariant* result)
+{
+    webview()->setZoomLevel(false, webview()->zoomLevel() - 1);
+    result->setNull();
+}
+
+void EventSender::replaySavedEvents()
+{
+    replayingSavedEvents = true;
+    while (!mouseEventQueue.isEmpty()) {
+        SavedEvent e = mouseEventQueue.first();
+        mouseEventQueue.removeFirst();
+
+        switch (e.type) {
+        case SavedEvent::MouseMove: {
+            WebMouseEvent event;
+            initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event);
+            doMouseMove(event);
+            break;
+        }
+        case SavedEvent::LeapForward:
+            doLeapForward(e.milliseconds);
+            break;
+        case SavedEvent::MouseUp: {
+            WebMouseEvent event;
+            initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event);
+            doMouseUp(event);
+            break;
+        }
+        default:
+            ASSERT_NOT_REACHED();
+        }
+    }
+
+    replayingSavedEvents = false;
+}
+
+void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    webview()->layout();
+
+    updateClickCountForButton(WebMouseEvent::ButtonRight);
+
+    // Generate right mouse down and up.
+
+    WebMouseEvent event;
+    pressedButton = WebMouseEvent::ButtonRight;
+    initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event);
+    webview()->handleInputEvent(event);
+
+    initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event);
+    webview()->handleInputEvent(event);
+
+    pressedButton = WebMouseEvent::ButtonNone;
+}
+
+void EventSender::scheduleAsynchronousClick(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    webkit_support::PostTaskFromHere(m_methodFactory.NewRunnableMethod(
+            &EventSender::mouseDown, arguments, static_cast<CppVariant*>(0)));
+    webkit_support::PostTaskFromHere(m_methodFactory.NewRunnableMethod(
+            &EventSender::mouseUp, arguments, static_cast<CppVariant*>(0)));
+}
+
+void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVariant* result)
+{
+    currentDragData.initialize();
+    Vector<string> files = arguments[0].toStringVector();
+    for (size_t i = 0; i < files.size(); ++i)
+        currentDragData.appendToFileNames(webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]));
+    currentDragEffectsAllowed = WebKit::WebDragOperationCopy;
+
+    // Provide a drag source.
+    webview()->dragTargetDragEnter(currentDragData, 0, lastMousePos, lastMousePos, currentDragEffectsAllowed);
+
+    // dragMode saves events and then replays them later. We don't need/want that.
+    dragMode.set(false);
+
+    // Make the rest of eventSender think a drag is in progress.
+    pressedButton = WebMouseEvent::ButtonLeft;
+
+    result->setNull();
+}
+
+//
+// Unimplemented stubs
+//
+
+void EventSender::enableDOMUIEventLogging(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void EventSender::fireKeyboardEventsToElement(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
+
+void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.h b/WebKitTools/DumpRenderTree/chromium/EventSender.h
new file mode 100644
index 0000000..756b008
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.h
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+/*
+  EventSender class:
+  Bound to a JavaScript window.eventSender object using
+  CppBoundClass::bindToJavascript(), this allows layout tests to fire DOM events.
+*/
+
+#ifndef EventSender_h
+#define EventSender_h
+
+#include "CppBoundClass.h"
+#include "base/task.h"
+#include "public/WebDragOperation.h"
+#include "public/WebInputEvent.h"
+#include "public/WebPoint.h"
+
+class TestShell;
+
+namespace WebKit {
+class WebDragData;
+class WebView;
+}
+
+class EventSender : public CppBoundClass {
+public:
+    // Builds the property and method lists needed to bind this class to a JS
+    // object.
+    EventSender(TestShell*);
+
+    // Resets some static variable state.
+    void reset();
+
+    // Simulate drag&drop system call.
+    static void doDragDrop(const WebKit::WebPoint&,
+                           const WebKit::WebDragData&,
+                           WebKit::WebDragOperationsMask);
+
+    // JS callback methods.
+    void mouseDown(const CppArgumentList&, CppVariant*);
+    void mouseUp(const CppArgumentList&, CppVariant*);
+    void mouseMoveTo(const CppArgumentList&, CppVariant*);
+    void mouseWheelTo(const CppArgumentList&, CppVariant*);
+    void leapForward(const CppArgumentList&, CppVariant*);
+    void keyDown(const CppArgumentList&, CppVariant*);
+    void dispatchMessage(const CppArgumentList&, CppVariant*);
+    void textZoomIn(const CppArgumentList&, CppVariant*);
+    void textZoomOut(const CppArgumentList&, CppVariant*);
+    void zoomPageIn(const CppArgumentList&, CppVariant*);
+    void zoomPageOut(const CppArgumentList&, CppVariant*);
+    void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*);
+    void beginDragWithFiles(const CppArgumentList&, CppVariant*);
+    CppVariant dragMode;
+
+    // Unimplemented stubs
+    void contextClick(const CppArgumentList&, CppVariant*);
+    void enableDOMUIEventLogging(const CppArgumentList&, CppVariant*);
+    void fireKeyboardEventsToElement(const CppArgumentList&, CppVariant*);
+    void clearKillRing(const CppArgumentList&, CppVariant*);
+
+    // Properties used in layout tests.
+#if defined(OS_WIN)
+    CppVariant wmKeyDown;
+    CppVariant wmKeyUp;
+    CppVariant wmChar;
+    CppVariant wmDeadChar;
+    CppVariant wmSysKeyDown;
+    CppVariant wmSysKeyUp;
+    CppVariant wmSysChar;
+    CppVariant wmSysDeadChar;
+#endif
+
+private:
+    // Returns the test shell's webview.
+    static WebKit::WebView* webview();
+
+    // Returns true if dragMode is true.
+    bool isDragMode() { return dragMode.isBool() && dragMode.toBoolean(); }
+
+    // Sometimes we queue up mouse move and mouse up events for drag drop
+    // handling purposes.  These methods dispatch the event.
+    static void doMouseMove(const WebKit::WebMouseEvent&);
+    static void doMouseUp(const WebKit::WebMouseEvent&);
+    static void doLeapForward(int milliseconds);
+    static void replaySavedEvents();
+
+    // Helper to return the button type given a button code
+    static WebKit::WebMouseEvent::Button getButtonTypeFromButtonNumber(int);
+
+    // Helper to extract the button number from the optional argument in
+    // mouseDown and mouseUp
+    static int getButtonNumberFromSingleArg(const CppArgumentList&);
+
+    // Returns true if the specified key code passed in needs a shift key
+    // modifier to be passed into the generated event.
+    bool needsShiftModifier(int);
+
+    void updateClickCountForButton(WebKit::WebMouseEvent::Button);
+
+    ScopedRunnableMethodFactory<EventSender> m_methodFactory;
+
+    // Non-owning pointer.  The EventSender is owned by the TestShell.
+    static TestShell* testShell;
+
+    // Location of last mouseMoveTo event.
+    static WebKit::WebPoint lastMousePos;
+
+    // Currently pressed mouse button (Left/Right/Middle or None)
+    static WebKit::WebMouseEvent::Button pressedButton;
+
+    // The last button number passed to mouseDown and mouseUp.
+    // Used to determine whether the click count continues to
+    // increment or not.
+    static WebKit::WebMouseEvent::Button lastButtonType;
+};
+
+#endif // EventSender_h
diff --git a/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
new file mode 100644
index 0000000..81d5f62
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
@@ -0,0 +1,407 @@
+/*
+ * 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.
+ */
+
+// This file input format is based loosely on
+// WebKitTools/DumpRenderTree/ImageDiff.m
+
+// The exact format of this tool's output to stdout is important, to match
+// what the run-webkit-tests script expects.
+
+#include "config.h"
+
+#include "gfx/codec/png_codec.h"
+#include <algorithm>
+#include <stdio.h>
+#include <string.h>
+#include <string>
+#include <vector>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/Vector.h>
+
+using namespace gfx;
+using namespace std;
+
+// Causes the app to remain open, waiting for pairs of filenames on stdin.
+// The caller is then responsible for terminating this app.
+static const char optionPollStdin[] = "--use-stdin";
+static const char optionGenerateDiff[] = "--diff";
+
+// Return codes used by this utility.
+static const int statusSame = 0;
+static const int statusDifferent = 1;
+static const int statusError = 2;
+
+// Color codes.
+static const uint32_t rgbaRed = 0x000000ff;
+static const uint32_t rgbaAlpha = 0xff000000;
+
+class Image {
+public:
+    Image()
+        : m_width(0)
+        , m_height(0) {}
+
+    Image(const Image& image)
+        : m_width(image.m_width)
+        , m_height(image.m_height)
+        , m_data(image.m_data) {}
+
+    bool hasImage() const { return m_width > 0 && m_height > 0; }
+    int width() const { return m_width; }
+    int height() const { return m_height; }
+    const unsigned char* data() const { return &m_data.front(); }
+
+    // Creates the image from stdin with the given data length. On success, it
+    // will return true. On failure, no other methods should be accessed.
+    bool craeteFromStdin(size_t byteLength)
+    {
+        if (!byteLength)
+            return false;
+
+        OwnArrayPtr<unsigned char> source(new unsigned char[byteLength]);
+        if (fread(source.get(), 1, byteLength, stdin) != byteLength)
+            return false;
+
+        if (!PNGCodec::Decode(source.get(), byteLength, PNGCodec::FORMAT_RGBA,
+                              &m_data, &m_width, &m_height)) {
+            clear();
+            return false;
+        }
+        return true;
+    }
+
+    // Creates the image from the given filename on disk, and returns true on
+    // success.
+    bool createFromFilename(const char* filename)
+    {
+        FILE* f = fopen(filename, "rb");
+        if (!f)
+            return false;
+
+        vector<unsigned char> compressed;
+        const int bufSize = 1024;
+        unsigned char buf[bufSize];
+        size_t numRead = 0;
+        while ((numRead = fread(buf, 1, bufSize, f)) > 0)
+            std::copy(buf, &buf[numRead], std::back_inserter(compressed));
+
+        fclose(f);
+
+        if (!PNGCodec::Decode(&compressed[0], compressed.size(),
+                              PNGCodec::FORMAT_RGBA, &m_data, &m_width, &m_height)) {
+            clear();
+            return false;
+        }
+        return true;
+    }
+
+    void clear()
+    {
+        m_width = m_height = 0;
+        m_data.clear();
+    }
+
+    // Returns the RGBA value of the pixel at the given location
+    const uint32_t pixelAt(int x, int y) const
+    {
+        ASSERT(x >= 0 && x < m_width);
+        ASSERT(y >= 0 && y < m_height);
+        return *reinterpret_cast<const uint32_t*>(&(m_data[(y * m_width + x) * 4]));
+    }
+
+    void setPixelAt(int x, int y, uint32_t color) const
+    {
+        ASSERT(x >= 0 && x < m_width);
+        ASSERT(y >= 0 && y < m_height);
+        void* addr = &const_cast<unsigned char*>(&m_data.front())[(y * m_width + x) * 4];
+        *reinterpret_cast<uint32_t*>(addr) = color;
+    }
+
+private:
+    // pixel dimensions of the image
+    int m_width, m_height;
+
+    vector<unsigned char> m_data;
+};
+
+float percentageDifferent(const Image& baseline, const Image& actual)
+{
+    int w = min(baseline.width(), actual.width());
+    int h = min(baseline.height(), actual.height());
+
+    // Compute pixels different in the overlap
+    int pixelsDifferent = 0;
+    for (int y = 0; y < h; y++) {
+        for (int x = 0; x < w; x++) {
+            if (baseline.pixelAt(x, y) != actual.pixelAt(x, y))
+                pixelsDifferent++;
+        }
+    }
+
+    // Count pixels that are a difference in size as also being different
+    int maxWidth = max(baseline.width(), actual.width());
+    int maxHeight = max(baseline.height(), actual.height());
+
+    // ...pixels off the right side, but not including the lower right corner
+    pixelsDifferent += (maxWidth - w) * h;
+
+    // ...pixels along the bottom, including the lower right corner
+    pixelsDifferent += (maxHeight - h) * maxWidth;
+
+    // Like the WebKit ImageDiff tool, we define percentage different in terms
+    // of the size of the 'actual' bitmap.
+    float totalPixels = static_cast<float>(actual.width()) * static_cast<float>(actual.height());
+    if (!totalPixels)
+        return 100.0f; // When the bitmap is empty, they are 100% different.
+    return static_cast<float>(pixelsDifferent) / totalPixels * 100;
+}
+
+void printHelp()
+{
+    fprintf(stderr,
+            "Usage:\n"
+            "  ImageDiff <compare file> <reference file>\n"
+            "    Compares two files on disk, returning 0 when they are the same\n"
+            "  ImageDiff --use-stdin\n"
+            "    Stays open reading pairs of filenames from stdin, comparing them,\n"
+            "    and sending 0 to stdout when they are the same\n"
+            "  ImageDiff --diff <compare file> <reference file> <output file>\n"
+            "    Compares two files on disk, outputs an image that visualizes the"
+            "    difference to <output file>\n");
+    /* For unfinished webkit-like-mode (see below)
+       "\n"
+       "  ImageDiff -s\n"
+       "    Reads stream input from stdin, should be EXACTLY of the format\n"
+       "    \"Content-length: <byte length> <data>Content-length: ...\n"
+       "    it will take as many file pairs as given, and will compare them as\n"
+       "    (cmp_file, reference_file) pairs\n");
+    */
+}
+
+int compareImages(const char* file1, const char* file2)
+{
+    Image actualImage;
+    Image baselineImage;
+
+    if (!actualImage.createFromFilename(file1)) {
+        fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file1);
+        return statusError;
+    }
+    if (!baselineImage.createFromFilename(file2)) {
+        fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file2);
+        return statusError;
+    }
+
+    float percent = percentageDifferent(actualImage, baselineImage);
+    if (percent > 0.0) {
+        // failure: The WebKit version also writes the difference image to
+        // stdout, which seems excessive for our needs.
+        printf("diff: %01.2f%% failed\n", percent);
+        return statusDifferent;
+    }
+
+    // success
+    printf("diff: %01.2f%% passed\n", percent);
+    return statusSame;
+
+}
+
+// Untested mode that acts like WebKit's image comparator. I wrote this but
+// decided it's too complicated. We may use it in the future if it looks useful.
+int untestedCompareImages()
+{
+    Image actualImage;
+    Image baselineImage;
+    char buffer[2048];
+    while (fgets(buffer, sizeof(buffer), stdin)) {
+        if (!strncmp("Content-length: ", buffer, 16)) {
+            char* context;
+#if OS(WINDOWS)
+            strtok_s(buffer, " ", &context);
+            int imageSize = strtol(strtok_s(0, " ", &context), 0, 10);
+#else
+            strtok_r(buffer, " ", &context);
+            int imageSize = strtol(strtok_r(0, " ", &context), 0, 10);
+#endif
+
+            bool success = false;
+            if (imageSize > 0 && !actualImage.hasImage()) {
+                if (!actualImage.craeteFromStdin(imageSize)) {
+                    fputs("Error, input image can't be decoded.\n", stderr);
+                    return 1;
+                }
+            } else if (imageSize > 0 && !baselineImage.hasImage()) {
+                if (!baselineImage.craeteFromStdin(imageSize)) {
+                    fputs("Error, baseline image can't be decoded.\n", stderr);
+                    return 1;
+                }
+            } else {
+                fputs("Error, image size must be specified.\n", stderr);
+                return 1;
+            }
+        }
+
+        if (actualImage.hasImage() && baselineImage.hasImage()) {
+            float percent = percentageDifferent(actualImage, baselineImage);
+            if (percent > 0.0) {
+                // failure: The WebKit version also writes the difference image to
+                // stdout, which seems excessive for our needs.
+                printf("diff: %01.2f%% failed\n", percent);
+            } else {
+                // success
+                printf("diff: %01.2f%% passed\n", percent);
+            }
+            actualImage.clear();
+            baselineImage.clear();
+        }
+        fflush(stdout);
+    }
+    return 0;
+}
+
+bool createImageDiff(const Image& image1, const Image& image2, Image* out)
+{
+    int w = min(image1.width(), image2.width());
+    int h = min(image1.height(), image2.height());
+    *out = Image(image1);
+    bool same = (image1.width() == image2.width()) && (image1.height() == image2.height());
+
+    // FIXME: do something with the extra pixels if the image sizes are different.
+    for (int y = 0; y < h; y++) {
+        for (int x = 0; x < w; x++) {
+            uint32_t basePixel = image1.pixelAt(x, y);
+            if (basePixel != image2.pixelAt(x, y)) {
+                // Set differing pixels red.
+                out->setPixelAt(x, y, rgbaRed | rgbaAlpha);
+                same = false;
+            } else {
+                // Set same pixels as faded.
+                uint32_t alpha = basePixel & rgbaAlpha;
+                uint32_t newPixel = basePixel - ((alpha / 2) & rgbaAlpha);
+                out->setPixelAt(x, y, newPixel);
+            }
+        }
+    }
+
+    return same;
+}
+
+static bool writeFile(const char* outFile, const unsigned char* data, size_t dataSize)
+{
+    FILE* file = fopen(outFile, "wb");
+    if (!file) {
+        fprintf(stderr, "ImageDiff: Unable to create file \"%s\"\n", file);
+        return false;
+    }
+    if (dataSize != fwrite(data, 1, dataSize, file)) {
+        fclose(file);
+        fprintf(stderr, "ImageDiff: Unable to write data to file \"%s\"\n", file);
+        return false;
+    }
+    fclose(file);
+    return true;
+}
+
+int diffImages(const char* file1, const char* file2, const char* outFile)
+{
+    Image actualImage;
+    Image baselineImage;
+
+    if (!actualImage.createFromFilename(file1)) {
+        fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file1);
+        return statusError;
+    }
+    if (!baselineImage.createFromFilename(file2)) {
+        fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file2);
+        return statusError;
+    }
+
+    Image diffImage;
+    bool same = createImageDiff(baselineImage, actualImage, &diffImage);
+    if (same)
+        return statusSame;
+
+    vector<unsigned char> pngData;
+    PNGCodec::Encode(diffImage.data(), PNGCodec::FORMAT_RGBA, diffImage.width(),
+                     diffImage.height(), diffImage.width() * 4, false, &pngData);
+    if (!writeFile(outFile, &pngData.front(), pngData.size()))
+        return statusError;
+    return statusDifferent;
+}
+
+int main(int argc, const char* argv[])
+{
+    Vector<const char*> values;
+    bool pollStdin = false;
+    bool generateDiff = false;
+    for (int i = 1; i < argc; ++i) {
+        if (!strcmp(argv[i], optionPollStdin))
+            pollStdin = true;
+        else if (!strcmp(argv[i], optionGenerateDiff))
+            generateDiff = true;
+        else
+            values.append(argv[i]);
+    }
+
+    if (pollStdin) {
+        // Watch stdin for filenames.
+        const size_t bufferSize = PATH_MAX;
+        char stdinBuffer[bufferSize];
+        char firstName[bufferSize];
+        bool haveFirstName = false;
+        while (fgets(stdinBuffer, bufferSize, stdin)) {
+            if (!stdinBuffer[0])
+                continue;
+
+            if (haveFirstName) {
+                // compareImages writes results to stdout unless an error occurred.
+                if (compareImages(firstName, stdinBuffer) == statusError)
+                    printf("error\n");
+                fflush(stdout);
+                haveFirstName = false;
+            } else {
+                // Save the first filename in another buffer and wait for the second
+                // filename to arrive via stdin.
+                strcpy(firstName, stdinBuffer);
+                haveFirstName = true;
+            }
+        }
+        return 0;
+    }
+
+    if (generateDiff) {
+        if (values.size() == 3)
+            return diffImages(values[0], values[1], values[2]);
+    } else if (values.size() == 2)
+        return compareImages(argv[1], argv[2]);
+
+    printHelp();
+    return statusError;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
new file mode 100644
index 0000000..d0dca69
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -0,0 +1,1179 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * 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 "LayoutTestController.h"
+
+#include "TestShell.h"
+#include "WebViewHost.h"
+#include "base/string_util.h"
+#include "public/WebAnimationController.h"
+#include "public/WebConsoleMessage.h"
+#include "public/WebDocument.h"
+#include "public/WebFrame.h"
+#include "public/WebInputElement.h"
+#include "public/WebKit.h"
+#include "public/WebScriptSource.h"
+#include "public/WebSecurityPolicy.h"
+#include "public/WebSettings.h"
+#include "public/WebSize.h"
+#include "public/WebURL.h"
+#include "public/WebView.h"
+#include "webkit/support/webkit_support.h"
+
+#if OS(WINDOWS)
+#include <wtf/OwnArrayPtr.h>
+#endif
+
+using namespace WebKit;
+using namespace std;
+
+LayoutTestController::LayoutTestController(TestShell* shell)
+    : m_timeoutFactory(this)
+    , m_shell(shell)
+    , m_workQueue(this)
+{
+
+    // Initialize the map that associates methods of this class with the names
+    // they will use when called by JavaScript.  The actual binding of those
+    // names to their methods will be done by calling bindToJavaScript() (defined
+    // by CppBoundClass, the parent to LayoutTestController).
+    bindMethod("dumpAsText", &LayoutTestController::dumpAsText);
+    bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
+    bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText);
+    bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
+    bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
+    bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
+    bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
+    bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
+    bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges);
+    bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges);
+    bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
+    bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
+    bindMethod("notifyDone", &LayoutTestController::notifyDone);
+    bindMethod("queueReload", &LayoutTestController::queueReload);
+    bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript);
+    bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript);
+    bindMethod("queueLoad", &LayoutTestController::queueLoad);
+    bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation);
+    bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation);
+    bindMethod("windowCount", &LayoutTestController::windowCount);
+    bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
+    bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
+    bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
+    bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
+    bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
+    bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
+    bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
+    bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
+    bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource);
+    bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
+    bindMethod("execCommand", &LayoutTestController::execCommand);
+    bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
+    bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
+    bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
+    bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
+    bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
+    bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
+    bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
+    bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
+    bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
+    bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
+    bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
+    bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
+    bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
+    bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
+    bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull);
+    bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
+    bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
+    bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
+    bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
+    bindMethod("counterValueForElementById", &LayoutTestController::counterValueForElementById);
+    bindMethod("addUserScript", &LayoutTestController::addUserScript);
+    bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
+    bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
+    bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
+
+    // The following are stubs.
+    bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
+    bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder);
+    bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
+    bindMethod("display", &LayoutTestController::display);
+    bindMethod("testRepaint", &LayoutTestController::testRepaint);
+    bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
+    bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
+    bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
+    bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
+    bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject);
+    bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf);
+    bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL);
+    bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews);
+    bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled);
+    bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode);
+
+    bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
+    bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
+    bindMethod("overridePreference", &LayoutTestController::overridePreference);
+    bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
+    bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
+    bindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
+    bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
+    bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+
+    // The fallback method is called when an unknown method is invoked.
+    bindFallbackMethod(&LayoutTestController::fallbackMethod);
+
+    // Shared properties.
+    // globalFlag is used by a number of layout tests in
+    // LayoutTests\http\tests\security\dataURL.
+    bindProperty("globalFlag", &m_globalFlag);
+    // webHistoryItemCount is used by tests in LayoutTests\http\tests\history
+    bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
+}
+
+LayoutTestController::WorkQueue::~WorkQueue()
+{
+    reset();
+}
+
+void LayoutTestController::WorkQueue::processWorkSoon()
+{
+    if (m_controller->m_shell->webViewHost()->topLoadingFrame())
+        return;
+
+    if (!m_queue.isEmpty()) {
+        // We delay processing queued work to avoid recursion problems.
+        m_timer.Start(base::TimeDelta(), this, &WorkQueue::processWork);
+    } else if (!m_controller->m_waitUntilDone) {
+        m_controller->m_shell->testFinished();
+    }
+}
+
+void LayoutTestController::WorkQueue::processWork()
+{
+    TestShell* shell = m_controller->m_shell;
+    // Quit doing work once a load is in progress.
+    while (!m_queue.isEmpty()) {
+        bool startedLoad = m_queue.first()->run(shell);
+        delete m_queue.first();
+        m_queue.removeFirst();
+        if (startedLoad)
+            return;
+    }
+
+    if (!m_controller->m_waitUntilDone && !shell->webViewHost()->topLoadingFrame())
+        shell->testFinished();
+}
+
+void LayoutTestController::WorkQueue::reset()
+{
+    m_frozen = false;
+    while (!m_queue.isEmpty()) {
+        delete m_queue.first();
+        m_queue.removeFirst();
+    }
+}
+
+void LayoutTestController::WorkQueue::addWork(WorkItem* work)
+{
+    if (m_frozen) {
+        delete work;
+        return;
+    }
+    m_queue.append(work);
+}
+
+void LayoutTestController::dumpAsText(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpAsText = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)
+{
+    // Do nothing; we don't use this flag anywhere for now
+    result->setNull();
+}
+
+void LayoutTestController::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpEditingCallbacks = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpBackForwardList = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpFrameLoadCallbacks = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpResourceLoadCallbacks = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpChildFrameScrollPositions = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpChildFramesAsText = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpWindowStatusChanges = true;
+    result->setNull();
+}
+
+void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpTitleChanges = true;
+    result->setNull();
+}
+
+void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_acceptsEditing = arguments[0].value.boolValue;
+    result->setNull();
+}
+
+void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* result)
+{
+    if (!webkit_support::BeingDebugged()) {
+        webkit_support::PostDelayedTaskFromHere(
+            m_timeoutFactory.NewRunnableMethod(&LayoutTestController::notifyDoneTimedOut),
+            m_shell->layoutTestTimeout());
+    }
+    m_waitUntilDone = true;
+    result->setNull();
+}
+
+void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result)
+{
+    // Test didn't timeout. Kill the timeout timer.
+    m_timeoutFactory.RevokeAll();
+
+    completeNotifyDone(false);
+    result->setNull();
+}
+
+void LayoutTestController::notifyDoneTimedOut()
+{
+    completeNotifyDone(true);
+}
+
+void LayoutTestController::completeNotifyDone(bool isTimeout)
+{
+    if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) {
+        if (isTimeout)
+            m_shell->testTimedOut();
+        else
+            m_shell->testFinished();
+    }
+    m_waitUntilDone = false;
+}
+
+class WorkItemBackForward : public LayoutTestController::WorkItem {
+public:
+    WorkItemBackForward(int distance) : m_distance(distance) {}
+    bool run(TestShell* shell)
+    {
+        shell->goToOffset(m_distance);
+        return true; // FIXME: Did it really start a navigation?
+    }
+private:
+    int m_distance;
+};
+
+void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isNumber())
+        m_workQueue.addWork(new WorkItemBackForward(-arguments[0].toInt32()));
+    result->setNull();
+}
+
+void LayoutTestController::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isNumber())
+        m_workQueue.addWork(new WorkItemBackForward(arguments[0].toInt32()));
+    result->setNull();
+}
+
+class WorkItemReload : public LayoutTestController::WorkItem {
+public:
+    bool run(TestShell* shell)
+    {
+        shell->reload();
+        return true;
+    }
+};
+
+void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result)
+{
+    m_workQueue.addWork(new WorkItemReload);
+    result->setNull();
+}
+
+class WorkItemLoadingScript : public LayoutTestController::WorkItem {
+public:
+    WorkItemLoadingScript(const string& script) : m_script(script) {}
+    bool run(TestShell* shell)
+    {
+        shell->webView()->mainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(m_script)));
+        return true; // FIXME: Did it really start a navigation?
+    }
+private:
+    string m_script;
+};
+
+class WorkItemNonLoadingScript : public LayoutTestController::WorkItem {
+public:
+    WorkItemNonLoadingScript(const string& script) : m_script(script) {}
+    bool run(TestShell* shell)
+    {
+        shell->webView()->mainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(m_script)));
+        return false;
+    }
+private:
+    string m_script;
+};
+
+void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isString())
+        m_workQueue.addWork(new WorkItemLoadingScript(arguments[0].toString()));
+    result->setNull();
+}
+
+void LayoutTestController::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isString())
+        m_workQueue.addWork(new WorkItemNonLoadingScript(arguments[0].toString()));
+    result->setNull();
+}
+
+class WorkItemLoad : public LayoutTestController::WorkItem {
+public:
+    WorkItemLoad(const WebURL& url, const WebString& target)
+        : m_url(url)
+        , m_target(target) {}
+    bool run(TestShell* shell)
+    {
+        shell->webViewHost()->loadURLForFrame(m_url, m_target);
+        return true; // FIXME: Did it really start a navigation?
+    }
+private:
+    WebURL m_url;
+    WebString m_target;
+};
+
+void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isString()) {
+        // FIXME: Implement WebURL::resolve() and avoid GURL.
+        GURL currentURL = m_shell->webView()->mainFrame()->url();
+        GURL fullURL = currentURL.Resolve(arguments[0].toString());
+
+        string target = "";
+        if (arguments.size() > 1 && arguments[1].isString())
+            target = arguments[1].toString();
+
+        m_workQueue.addWork(new WorkItemLoad(fullURL, WebString::fromUTF8(target)));
+    }
+    result->setNull();
+}
+
+void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() < 2) {
+        // This is the best we can do to return an error.
+        result->setNull();
+        return;
+    }
+    result->set(arguments[0].isEqual(arguments[1]));
+}
+
+void LayoutTestController::reset()
+{
+    if (m_shell) {
+        m_shell->webView()->setZoomLevel(false, 0);
+        m_shell->webView()->setTabKeyCyclesThroughElements(true);
+#if defined(OS_LINUX)
+        // (Constants copied because we can't depend on the header that defined
+        // them from this file.)
+        m_shell->webView()->setSelectionColors(0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff323232);
+#endif // defined(OS_LINUX)
+        m_shell->webView()->removeAllUserContent();
+    }
+    m_dumpAsText = false;
+    m_dumpEditingCallbacks = false;
+    m_dumpFrameLoadCallbacks = false;
+    m_dumpResourceLoadCallbacks = false;
+    m_dumpBackForwardList = false;
+    m_dumpChildFrameScrollPositions = false;
+    m_dumpChildFramesAsText = false;
+    m_dumpWindowStatusChanges = false;
+    m_dumpSelectionRect = false;
+    m_dumpTitleChanges = false;
+    m_acceptsEditing = true;
+    m_waitUntilDone = false;
+    m_canOpenWindows = false;
+    m_testRepaint = false;
+    m_sweepHorizontally = false;
+    m_shouldAddFileToPasteboard = false;
+    m_stopProvisionalFrameLoads = false;
+    m_globalFlag.set(false);
+    m_webHistoryItemCount.set(0);
+
+    webkit_support::SetAcceptAllCookies(false);
+    WebSecurityPolicy::resetOriginAccessWhiteLists();
+
+    // Reset the default quota for each origin to 5MB
+    webkit_support::SetDatabaseQuota(5 * 1024 * 1024);
+
+    setlocale(LC_ALL, "");
+
+    if (m_closeRemainingWindows)
+        m_shell->closeRemainingWindows();
+    else
+        m_closeRemainingWindows = true;
+    m_workQueue.reset();
+}
+
+void LayoutTestController::locationChangeDone()
+{
+    m_webHistoryItemCount.set(m_shell->navigationEntryCount());
+
+    // No more new work after the first complete load.
+    m_workQueue.setFrozen(true);
+
+    if (!m_waitUntilDone)
+        m_workQueue.processWorkSoon();
+}
+
+void LayoutTestController::policyDelegateDone()
+{
+    ASSERT(m_waitUntilDone);
+    m_shell->testFinished();
+    m_waitUntilDone = false;
+}
+
+void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
+{
+    m_canOpenWindows = true;
+    result->setNull();
+}
+
+void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webView()->setTabKeyCyclesThroughElements(arguments[0].toBoolean());
+    result->setNull();
+}
+
+void LayoutTestController::windowCount(const CppArgumentList&, CppVariant* result)
+{
+    result->set(static_cast<int>(m_shell->windowCount()));
+}
+
+void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_closeRemainingWindows = arguments[0].value.boolValue;
+    result->setNull();
+}
+
+void LayoutTestController::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0)
+        webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0]));
+    result->setNull();
+}
+
+void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->setFocus(m_shell->webView(), arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webView()->settings()->setUserStyleSheetLocation(arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL());
+    result->setNull();
+}
+
+void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isString()) {
+        m_userStyleSheetLocation = webkit_support::RewriteLayoutTestsURL(arguments[0].toString());
+        m_shell->webView()->settings()->setUserStyleSheetLocation(m_userStyleSheetLocation);
+    }
+    result->setNull();
+}
+
+void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() <= 0 || !arguments[0].isString())
+        return;
+
+    std::string command = arguments[0].toString();
+    std::string value("");
+    // Ignore the second parameter (which is userInterface)
+    // since this command emulates a manual action.
+    if (arguments.size() >= 3 && arguments[2].isString())
+        value = arguments[2].toString();
+
+    // Note: webkit's version does not return the boolean, so neither do we.
+    m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value));
+}
+
+void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() <= 0 || !arguments[0].isString()) {
+        result->setNull();
+        return;
+    }
+
+    std::string command = arguments[0].toString();
+    bool rv = m_shell->webView()->focusedFrame()->isCommandEnabled(WebString::fromUTF8(command));
+    result->set(rv);
+}
+
+void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool()) {
+        bool blockPopups = arguments[0].toBoolean();
+        m_shell->webView()->settings()->setJavaScriptCanOpenWindowsAutomatically(!blockPopups);
+    }
+    result->setNull();
+}
+
+void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)
+{
+    // We have no need to support Dashboard Compatibility Mode (mac-only)
+    result->setNull();
+}
+
+void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool()) {
+        bool enable = arguments[0].value.boolValue;
+        bool permissive = false;
+        if (arguments.size() > 1 && arguments[1].isBool())
+            permissive = arguments[1].value.boolValue;
+        m_shell->webViewHost()->setCustomPolicyDelegate(enable, permissive);
+    }
+    result->setNull();
+}
+
+void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result)
+{
+    m_shell->webViewHost()->waitForPolicyDelegate();
+    m_waitUntilDone = true;
+    result->setNull();
+}
+
+void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webViewHost()->setBlockRedirects(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webViewHost()->setRequestReturnNull(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() <= 0 || !arguments[0].isString())
+        return;
+
+    string url = arguments[0].toString();
+#if OS(WINDOWS)
+    if (StartsWithASCII(url, "/tmp/", true)) {
+        // We want a temp file.
+        const unsigned tempPrefixLength = 5;
+        size_t bufferSize = MAX_PATH;
+        OwnArrayPtr<WCHAR> tempPath(new WCHAR[bufferSize]);
+        DWORD tempLength = ::GetTempPathW(bufferSize, tempPath.get());
+        if (tempLength + url.length() - tempPrefixLength + 1 > bufferSize) {
+            bufferSize = tempLength + url.length() - tempPrefixLength + 1;
+            tempPath.set(new WCHAR[bufferSize]);
+            tempLength = GetTempPathW(bufferSize, tempPath.get());
+            ASSERT(tempLength < bufferSize);
+        }
+        std::string resultPath(WebString(tempPath.get(), tempLength).utf8());
+        resultPath.append(url.substr(tempPrefixLength));
+        result->set(resultPath);
+        return;
+    }
+#endif
+
+    // Some layout tests use file://// which we resolve as a UNC path.  Normalize
+    // them to just file:///.
+    while (StartsWithASCII(url, "file:////", false))
+        url = url.substr(0, 8) + url.substr(9);
+    result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
+}
+
+void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+    m_shouldAddFileToPasteboard = true;
+}
+
+void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+    m_stopProvisionalFrameLoads = true;
+}
+
+void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId)
+{
+    WebFrame* webFrame = m_shell->webView()->mainFrame();
+    if (!webFrame)
+        return false;
+
+    WebAnimationController* controller = webFrame->animationController();
+    if (!controller)
+        return false;
+
+    WebElement element = webFrame->document().getElementById(elementId);
+    if (element.isNull())
+        return false;
+    return controller->pauseAnimationAtTime(element, animationName, time);
+}
+
+bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId)
+{
+    WebFrame* webFrame = m_shell->webView()->mainFrame();
+    if (!webFrame)
+        return false;
+
+    WebAnimationController* controller = webFrame->animationController();
+    if (!controller)
+        return false;
+
+    WebElement element = webFrame->document().getElementById(elementId);
+    if (element.isNull())
+        return false;
+    return controller->pauseTransitionAtTime(element, propertyName, time);
+}
+
+bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId)
+{
+    WebFrame* webFrame = m_shell->webView()->mainFrame();
+    if (!webFrame)
+        return false;
+
+    WebElement element = webFrame->document().getElementById(elementId);
+    if (element.isNull() || !element.hasTagName("input"))
+        return false;
+
+    WebInputElement inputElement = element.toElement<WebInputElement>();
+    return inputElement.autoComplete();
+}
+
+int LayoutTestController::numberOfActiveAnimations()
+{
+    WebFrame* webFrame = m_shell->webView()->mainFrame();
+    if (!webFrame)
+        return -1;
+
+    WebAnimationController* controller = webFrame->animationController();
+    if (!controller)
+        return -1;
+
+    return controller->numberOfActiveAnimations();
+}
+
+void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->set(false);
+    if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
+        WebString animationName = cppVariantToWebString(arguments[0]);
+        double time = arguments[1].toDouble();
+        WebString elementId = cppVariantToWebString(arguments[2]);
+        result->set(pauseAnimationAtTimeOnElementWithId(animationName, time, elementId));
+    }
+}
+
+void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->set(false);
+    if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
+        WebString propertyName = cppVariantToWebString(arguments[0]);
+        double time = arguments[1].toDouble();
+        WebString elementId = cppVariantToWebString(arguments[2]);
+        result->set(pauseTransitionAtTimeOnElementWithId(propertyName, time, elementId));
+    }
+}
+
+void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() != 1 || !arguments[0].isString()) {
+        result->set(false);
+        return;
+    }
+    WebString elementId = cppVariantToWebString(arguments[0]);
+    result->set(elementDoesAutoCompleteForElementWithId(elementId));
+}
+
+void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result)
+{
+    result->set(numberOfActiveAnimations());
+}
+
+void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
+{
+    m_shell->webView()->settings()->setLoadsImagesAutomatically(false);
+    result->setNull();
+}
+
+void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)
+{
+    // We don't use the WebKit icon database.
+    result->setNull();
+}
+
+//
+// Unimplemented stubs
+//
+
+void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
+{
+    m_dumpSelectionRect = true;
+    result->setNull();
+}
+
+void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result)
+{
+    WebViewHost* host = m_shell->webViewHost();
+    const WebKit::WebSize& size = m_shell->webView()->size();
+    WebRect rect(0, 0, size.width, size.height);
+    host->updatePaintRect(rect);
+    host->paintInvalidatedRegion();
+    host->displayRepaintMask();
+    result->setNull();
+}
+
+void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result)
+{
+    m_testRepaint = true;
+    result->setNull();
+}
+
+void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
+{
+    m_sweepHorizontally = true;
+    result->setNull();
+}
+
+void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::keepWebHistory(const CppArgumentList& arguments,  CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+}
+
+void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webView()->settings()->setXSSAuditorEnabled(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) {
+        WebScriptSource source(WebString::fromUTF8(arguments[1].toString()));
+        // This relies on the iframe focusing itself when it loads. This is a bit
+        // sketchy, but it seems to be what other tests do.
+        m_shell->webView()->focusedFrame()->executeScriptInIsolatedWorld(arguments[0].toInt32(), &source, 1, 1);
+    }
+    result->setNull();
+}
+
+void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webView()->settings()->setAllowUniversalAccessFromFileURLs(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+{
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_shell->webView()->settings()->setAllowFileAccessFromFileURLs(arguments[0].value.boolValue);
+    result->setNull();
+}
+
+// Need these conversions because the format of the value for booleans
+// may vary - for example, on mac "1" and "0" are used for boolean.
+bool LayoutTestController::cppVariantToBool(const CppVariant& value)
+{
+    if (value.isBool())
+        return value.toBoolean();
+    if (value.isInt32())
+        return value.toInt32();
+    if (value.isString()) {
+        string valueString = value.toString();
+        if (valueString == "true" || valueString == "1")
+            return true;
+        if (valueString == "false" || valueString == "0")
+            return false;
+    }
+    logErrorToConsole("Invalid value. Expected boolean value.");
+    return false;
+}
+
+int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value)
+{
+    if (value.isInt32())
+        return value.toInt32();
+    if (value.isString()) {
+        int number;
+        if (StringToInt(value.toString(), &number))
+            return number;
+    }
+    logErrorToConsole("Invalid value for preference. Expected integer value.");
+    return 0;
+}
+
+WebString LayoutTestController::cppVariantToWebString(const CppVariant& value)
+{
+    if (!value.isString()) {
+        logErrorToConsole("Invalid value for preference. Expected string value.");
+        return WebString();
+    }
+    return WebString::fromUTF8(value.toString());
+}
+
+void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() != 2 || !arguments[0].isString())
+        return;
+
+    string key = arguments[0].toString();
+    CppVariant value = arguments[1];
+    WebSettings* settings = m_shell->webView()->settings();
+    if (key == "WebKitStandardFont")
+        settings->setStandardFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitFixedFont")
+        settings->setFixedFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitSerifFont")
+        settings->setSerifFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitSansSerifFont")
+        settings->setSansSerifFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitCursiveFont")
+        settings->setCursiveFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitFantasyFont")
+        settings->setFantasyFontFamily(cppVariantToWebString(value));
+    else if (key == "WebKitDefaultFontSize")
+        settings->setDefaultFontSize(cppVariantToInt32(value));
+    else if (key == "WebKitDefaultFixedFontSize")
+        settings->setDefaultFixedFontSize(cppVariantToInt32(value));
+    else if (key == "WebKitMinimumFontSize")
+        settings->setMinimumFontSize(cppVariantToInt32(value));
+    else if (key == "WebKitMinimumLogicalFontSize")
+        settings->setMinimumLogicalFontSize(cppVariantToInt32(value));
+    else if (key == "WebKitDefaultTextEncodingName")
+        settings->setDefaultTextEncodingName(cppVariantToWebString(value));
+    else if (key == "WebKitJavaScriptEnabled")
+        settings->setJavaScriptEnabled(cppVariantToBool(value));
+    else if (key == "WebKitWebSecurityEnabled")
+        settings->setWebSecurityEnabled(cppVariantToBool(value));
+    else if (key == "WebKitJavaScriptCanOpenWindowsAutomatically")
+        settings->setJavaScriptCanOpenWindowsAutomatically(cppVariantToBool(value));
+    else if (key == "WebKitDisplayImagesKey")
+        settings->setLoadsImagesAutomatically(cppVariantToBool(value));
+    else if (key == "WebKitPluginsEnabled")
+        settings->setPluginsEnabled(cppVariantToBool(value));
+    else if (key == "WebKitDOMPasteAllowedPreferenceKey")
+        settings->setDOMPasteAllowed(cppVariantToBool(value));
+    else if (key == "WebKitDeveloperExtrasEnabledPreferenceKey")
+        settings->setDeveloperExtrasEnabled(cppVariantToBool(value));
+    else if (key == "WebKitShrinksStandaloneImagesToFit")
+        settings->setShrinksStandaloneImagesToFit(cppVariantToBool(value));
+    else if (key == "WebKitTextAreasAreResizable")
+        settings->setTextAreasAreResizable(cppVariantToBool(value));
+    else if (key == "WebKitJavaEnabled")
+        settings->setJavaEnabled(cppVariantToBool(value));
+    else if (key == "WebKitUsesPageCachePreferenceKey")
+        settings->setUsesPageCache(cppVariantToBool(value));
+    else if (key == "WebKitXSSAuditorEnabled")
+        settings->setXSSAuditorEnabled(cppVariantToBool(value));
+    else if (key == "WebKitLocalStorageEnabledPreferenceKey")
+        settings->setLocalStorageEnabled(cppVariantToBool(value));
+    else if (key == "WebKitOfflineWebApplicationCacheEnabled")
+        settings->setOfflineWebApplicationCacheEnabled(cppVariantToBool(value));
+    else if (key == "WebKitTabToLinksPreferenceKey")
+        m_shell->webView()->setTabsToLinks(cppVariantToBool(value));
+    else if (key == "WebKitWebGLEnabled")
+        settings->setExperimentalWebGLEnabled(cppVariantToBool(value));
+    else {
+        string message("Invalid name for preference: ");
+        message.append(key);
+        logErrorToConsole(message);
+    }
+}
+
+void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result)
+{
+    printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n");
+    result->setNull();
+}
+
+void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    if (arguments.size() != 4 || !arguments[0].isString() || !arguments[1].isString()
+        || !arguments[2].isString() || !arguments[3].isBool())
+        return;
+
+    WebKit::WebURL url(GURL(arguments[0].toString()));
+    if (!url.isValid())
+        return;
+
+    WebSecurityPolicy::whiteListAccessFromOrigin(url,
+                                                 WebString::fromUTF8(arguments[1].toString()),
+                                                 WebString::fromUTF8(arguments[2].toString()),
+                                                 arguments[3].toBoolean());
+}
+
+void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    webkit_support::ClearAllDatabases();
+}
+
+void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if ((arguments.size() >= 1) && arguments[0].isInt32())
+        webkit_support::SetDatabaseQuota(arguments[0].toInt32());
+}
+
+void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() == 1 && arguments[0].isString())
+        setlocale(LC_ALL, arguments[0].toString().c_str());
+}
+
+void LayoutTestController::counterValueForElementById(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 1 || !arguments[0].isString())
+        return;
+    WebFrame* frame = m_shell->webView()->mainFrame();
+    if (!frame)
+        return;
+    WebString counterValue = frame->counterValueForElementById(cppVariantToWebString(arguments[0]));
+    if (counterValue.isNull())
+        return;
+    result->set(counterValue.utf8());
+}
+
+static bool parsePageSizeParameters(const CppArgumentList& arguments,
+                                    int argOffset,
+                                    float* pageWidthInPixels,
+                                    float* pageHeightInPixels)
+{
+    // WebKit is using the window width/height of DumpRenderTree as the
+    // default value of the page size.
+    // FIXME: share these values with other ports.
+    *pageWidthInPixels = 800;
+    *pageHeightInPixels = 600;
+    switch (arguments.size() - argOffset) {
+    case 2:
+        if (!arguments[argOffset].isNumber() || !arguments[1 + argOffset].isNumber())
+            return false;
+        *pageWidthInPixels = static_cast<float>(arguments[argOffset].toInt32());
+        *pageHeightInPixels = static_cast<float>(arguments[1 + argOffset].toInt32());
+        // fall through.
+    case 0:
+        break;
+    default:
+        return false;
+    }
+    return true;
+}
+
+void LayoutTestController::pageNumberForElementById(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    float pageWidthInPixels = 0;
+    float pageHeightInPixels = 0;
+    if (!parsePageSizeParameters(arguments, 1,
+                                 &pageWidthInPixels, &pageHeightInPixels))
+        return;
+    if (!arguments[0].isString())
+        return;
+    WebFrame* frame = m_shell->webView()->mainFrame();
+    if (!frame)
+        return;
+    result->set(frame->pageNumberForElementById(cppVariantToWebString(arguments[0]),
+                                                pageWidthInPixels, pageHeightInPixels));
+}
+
+void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    float pageWidthInPixels = 0;
+    float pageHeightInPixels = 0;
+    if (!parsePageSizeParameters(arguments, 0, &pageWidthInPixels, &pageHeightInPixels))
+        return;
+
+    WebFrame* frame = m_shell->webView()->mainFrame();
+    if (!frame)
+        return;
+    WebSize size(pageWidthInPixels, pageHeightInPixels);
+    int numberOfPages = frame->printBegin(size);
+    frame->printEnd();
+    result->set(numberOfPages);
+}
+
+void LayoutTestController::logErrorToConsole(const std::string& text)
+{
+    m_shell->webViewHost()->didAddMessageToConsole(
+        WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)),
+        WebString(), 0);
+}
+
+void LayoutTestController::setTimelineProfilingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 1 || !arguments[0].isBool())
+        return;
+    // FIXME: Should call TestShellDevToolsAgent::setTimelineProfilingEnabled().
+}
+
+void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString())
+        return;
+    // FIXME: Should call TestShellDevToolsAgent::evaluateInWebInspector().
+}
+
+void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0);
+}
+
+void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 1 || !arguments[0].isString() || !arguments[1].isBool())
+        return;
+    m_shell->webView()->addUserScript(WebString::fromUTF8(arguments[0].toString()), arguments[1].toBoolean());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
new file mode 100644
index 0000000..a8639da
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -0,0 +1,440 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * 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.
+ */
+
+/*
+  LayoutTestController class:
+  Bound to a JavaScript window.layoutTestController object using the
+  CppBoundClass::bindToJavascript(), this allows layout tests that are run in
+  the test_shell (or, in principle, any web page loaded into a client app built
+  with this class) to control various aspects of how the tests are run and what
+  sort of output they produce.
+*/
+
+#ifndef LayoutTestController_h
+#define LayoutTestController_h
+
+#include "CppBoundClass.h"
+#include "base/timer.h" // FIXME: Remove this.
+#include "public/WebString.h"
+#include "public/WebURL.h"
+#include <wtf/Deque.h>
+
+class TestShell;
+
+class LayoutTestController : public CppBoundClass {
+public:
+    // Builds the property and method lists needed to bind this class to a JS
+    // object.
+    LayoutTestController(TestShell*);
+
+    // This function sets a flag that tells the test_shell to dump pages as
+    // plain text, rather than as a text representation of the renderer's state.
+    // It takes no arguments, and ignores any that may be present.
+    void dumpAsText(const CppArgumentList&, CppVariant*);
+
+    // This function should set a flag that tells the test_shell to print a line
+    // of descriptive text for each database command.  It should take no
+    // arguments, and ignore any that may be present. However, at the moment, we
+    // don't have any DB function that prints messages, so for now this function
+    // doesn't do anything.
+    void dumpDatabaseCallbacks(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print a line of
+    // descriptive text for each editing command.  It takes no arguments, and
+    // ignores any that may be present.
+    void dumpEditingCallbacks(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print a line of
+    // descriptive text for each frame load callback.  It takes no arguments, and
+    // ignores any that may be present.
+    void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print out a text
+    // representation of the back/forward list.  It ignores all arguments.
+    void dumpBackForwardList(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print out the
+    // scroll offsets of the child frames.  It ignores all.
+    void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to recursively
+    // dump all frames as plain text if the dumpAsText flag is set.
+    // It takes no arguments, and ignores any that may be present.
+    void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to dump all calls
+    // to window.status().
+    // It takes no arguments, and ignores any that may be present.
+    void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
+
+    // When called with a boolean argument, this sets a flag that controls
+    // whether content-editable elements accept editing focus when an editing
+    // attempt is made. It ignores any additional arguments.
+    void setAcceptsEditing(const CppArgumentList&, CppVariant*);
+
+    // Functions for dealing with windows.  By default we block all new windows.
+    void windowCount(const CppArgumentList&, CppVariant*);
+    void setCanOpenWindows(const CppArgumentList&, CppVariant*);
+    void setCloseRemainingWindowsWhenComplete(const CppArgumentList&, CppVariant*);
+
+    // By default, tests end when page load is complete.  These methods are used
+    // to delay the completion of the test until notifyDone is called.
+    void waitUntilDone(const CppArgumentList&, CppVariant*);
+    void notifyDone(const CppArgumentList&, CppVariant*);
+    void notifyDoneTimedOut();
+
+    // Methods for adding actions to the work queue.  Used in conjunction with
+    // waitUntilDone/notifyDone above.
+    void queueBackNavigation(const CppArgumentList&, CppVariant*);
+    void queueForwardNavigation(const CppArgumentList&, CppVariant*);
+    void queueReload(const CppArgumentList&, CppVariant*);
+    void queueLoadingScript(const CppArgumentList&, CppVariant*);
+    void queueNonLoadingScript(const CppArgumentList&, CppVariant*);
+    void queueLoad(const CppArgumentList&, CppVariant*);
+
+    // Although this is named "objC" to match the Mac version, it actually tests
+    // the identity of its two arguments in C++.
+    void objCIdentityIsEqual(const CppArgumentList&, CppVariant*);
+
+    // Changes the cookie policy from the default to allow all cookies.
+    void setAlwaysAcceptCookies(const CppArgumentList&, CppVariant*);
+
+    // Gives focus to the window.
+    void setWindowIsKey(const CppArgumentList&, CppVariant*);
+
+    // Method that controls whether pressing Tab key cycles through page elements
+    // or inserts a '\t' char in text area
+    void setTabKeyCyclesThroughElements(const CppArgumentList&, CppVariant*);
+
+    // Passes through to WebPreferences which allows the user to have a custom
+    // style sheet.
+    void setUserStyleSheetEnabled(const CppArgumentList&, CppVariant*);
+    void setUserStyleSheetLocation(const CppArgumentList&, CppVariant*);
+
+    // Puts Webkit in "dashboard compatibility mode", which is used in obscure
+    // Mac-only circumstances. It's not really necessary, and will most likely
+    // never be used by Chrome, but some layout tests depend on its presence.
+    void setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant*);
+
+    // Causes navigation actions just printout the intended navigation instead
+    // of taking you to the page. This is used for cases like mailto, where you
+    // don't actually want to open the mail program.
+    void setCustomPolicyDelegate(const CppArgumentList&, CppVariant*);
+
+    // Delays completion of the test until the policy delegate runs.
+    void waitForPolicyDelegate(const CppArgumentList&, CppVariant*);
+
+    // Causes WillSendRequest to block redirects.
+    void setWillSendRequestReturnsNullOnRedirect(const CppArgumentList&, CppVariant*);
+
+    // Causes WillSendRequest to return an empty request.
+    void setWillSendRequestReturnsNull(const CppArgumentList&, CppVariant*);
+
+    // Converts a URL starting with file:///tmp/ to the local mapping.
+    void pathToLocalResource(const CppArgumentList&, CppVariant*);
+
+    // Sets a bool such that when a drag is started, we fill the drag clipboard
+    // with a fake file object.
+    void addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant*);
+
+    // Executes an internal command (superset of document.execCommand() commands).
+    void execCommand(const CppArgumentList&, CppVariant*);
+
+    // Checks if an internal command is currently available.
+    void isCommandEnabled(const CppArgumentList&, CppVariant*);
+
+    // Set the WebPreference that controls webkit's popup blocking.
+    void setPopupBlockingEnabled(const CppArgumentList&, CppVariant*);
+
+    // If true, causes provisional frame loads to be stopped for the remainder of
+    // the test.
+    void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*);
+
+    // Enable or disable smart insert/delete.  This is enabled by default.
+    void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*);
+
+    // Enable or disable trailing whitespace selection on double click.
+    void setSelectTrailingWhitespaceEnabled(const CppArgumentList&, CppVariant*);
+
+    void pauseAnimationAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
+    void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
+    void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
+    void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
+
+    void disableImageLoading(const CppArgumentList&, CppVariant*);
+
+    void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
+
+    void dumpSelectionRect(const CppArgumentList&, CppVariant*);
+
+    // The following are only stubs.  TODO(pamg): Implement any of these that
+    // are needed to pass the layout tests.
+    void dumpAsWebArchive(const CppArgumentList&, CppVariant*);
+    void dumpTitleChanges(const CppArgumentList&, CppVariant*);
+    void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);
+    void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);
+    void display(const CppArgumentList&, CppVariant*);
+    void testRepaint(const CppArgumentList&, CppVariant*);
+    void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);
+    void clearBackForwardList(const CppArgumentList&, CppVariant*);
+    void keepWebHistory(const CppArgumentList&, CppVariant*);
+    void storeWebScriptObject(const CppArgumentList&, CppVariant*);
+    void accessStoredWebScriptObject(const CppArgumentList&, CppVariant*);
+    void objCClassNameOf(const CppArgumentList&, CppVariant*);
+    void addDisallowedURL(const CppArgumentList&, CppVariant*);
+    void setCallCloseOnWebViews(const CppArgumentList&, CppVariant*);
+    void setPrivateBrowsingEnabled(const CppArgumentList&, CppVariant*);
+
+    void setXSSAuditorEnabled(const CppArgumentList&, CppVariant*);
+    void evaluateScriptInIsolatedWorld(const CppArgumentList&, CppVariant*);
+    void overridePreference(const CppArgumentList&, CppVariant*);
+    void setAllowUniversalAccessFromFileURLs(const CppArgumentList&, CppVariant*);
+    void setAllowFileAccessFromFileURLs(const CppArgumentList&, CppVariant*);
+
+
+    // The fallback method is called when a nonexistent method is called on
+    // the layout test controller object.
+    // It is usefull to catch typos in the JavaScript code (a few layout tests
+    // do have typos in them) and it allows the script to continue running in
+    // that case (as the Mac does).
+    void fallbackMethod(const CppArgumentList&, CppVariant*);
+
+    // Allows layout tests to call SecurityOrigin::addOriginAccessWhitelistEntry().
+    void addOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
+
+    // Clears all databases.
+    void clearAllDatabases(const CppArgumentList&, CppVariant*);
+    // Sets the default quota for all origins
+    void setDatabaseQuota(const CppArgumentList&, CppVariant*);
+
+    // Calls setlocale(LC_ALL, ...) for a specified locale.
+    // Resets between tests.
+    void setPOSIXLocale(const CppArgumentList&, CppVariant*);
+
+    // Gets the value of the counter in the element specified by its ID.
+    void counterValueForElementById(const CppArgumentList&, CppVariant*);
+
+    // Gets the number of page where the specified element will be put.
+    void pageNumberForElementById(const CppArgumentList&, CppVariant*);
+
+    // Gets the number of pages to be printed.
+    void numberOfPages(const CppArgumentList&, CppVariant*);
+
+
+    // Allows layout tests to start Timeline profiling.
+    void setTimelineProfilingEnabled(const CppArgumentList&, CppVariant*);
+
+    // Allows layout tests to exec scripts at WebInspector side.
+    void evaluateInWebInspector(const CppArgumentList&, CppVariant*);
+
+    // Forces the selection colors for testing under Linux.
+    void forceRedSelectionColors(const CppArgumentList&, CppVariant*);
+
+    // Adds a user script to be injected into new documents.
+    void addUserScript(const CppArgumentList&, CppVariant*);
+
+public:
+    // The following methods are not exposed to JavaScript.
+    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
+
+    bool shouldDumpAsText() { return m_dumpAsText; }
+    bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
+    bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
+    void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
+    bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
+    bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
+    bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
+    bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
+    bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }
+    bool shouldDumpChildFrameScrollPositions() { return m_dumpChildFrameScrollPositions; }
+    bool shouldDumpChildFramesAsText() { return m_dumpChildFramesAsText; }
+    bool acceptsEditing() { return m_acceptsEditing; }
+    bool canOpenWindows() { return m_canOpenWindows; }
+    bool shouldAddFileToPasteboard() { return m_shouldAddFileToPasteboard; }
+    bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
+
+    bool testRepaint() const { return m_testRepaint; }
+    bool sweepHorizontally() const { return m_sweepHorizontally; }
+
+    // Called by the webview delegate when the toplevel frame load is done.
+    void locationChangeDone();
+
+    // Called by the webview delegate when the policy delegate runs if the
+    // waitForPolicyDelegate was called.
+    void policyDelegateDone();
+
+    // Reinitializes all static values.  The reset() method should be called
+    // before the start of each test (currently from
+    // TestShell::runFileTest).
+    void reset();
+
+    // A single item in the work queue.
+    class WorkItem {
+    public:
+        virtual ~WorkItem() {}
+
+        // Returns true if this started a load.
+        virtual bool run(TestShell* shell) = 0;
+    };
+
+private:
+    friend class WorkItem;
+    friend class WorkQueue;
+
+    // Helper class for managing events queued by methods like queueLoad or
+    // queueScript.
+    class WorkQueue {
+    public:
+        WorkQueue(LayoutTestController* controller) : m_controller(controller) {}
+        virtual ~WorkQueue();
+        void processWorkSoon();
+
+        // Reset the state of the class between tests.
+        void reset();
+
+        void addWork(WorkItem* work);
+
+        void setFrozen(bool frozen) { m_frozen = frozen; }
+        bool isEmpty() { return m_queue.isEmpty(); }
+
+    private:
+        void processWork();
+
+        base::OneShotTimer<WorkQueue> m_timer;
+        Deque<WorkItem*> m_queue;
+        bool m_frozen;
+        LayoutTestController* m_controller;
+    };
+
+    // Support for overridePreference.
+    bool cppVariantToBool(const CppVariant&);
+    int32_t cppVariantToInt32(const CppVariant&);
+    WebKit::WebString cppVariantToWebString(const CppVariant&);
+
+    void logErrorToConsole(const std::string&);
+    void completeNotifyDone(bool isTimeout);
+
+    bool pauseAnimationAtTimeOnElementWithId(const WebKit::WebString& animationName, double time, const WebKit::WebString& elementId);
+    bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
+    bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&);
+    int numberOfActiveAnimations();
+
+    // Used for test timeouts.
+    ScopedRunnableMethodFactory<LayoutTestController> m_timeoutFactory;
+
+    // Non-owning pointer.  The LayoutTestController is owned by the host.
+    TestShell* m_shell;
+
+    // If true, the test_shell will produce a plain text dump rather than a
+    // text representation of the renderer.
+    bool m_dumpAsText;
+
+    // If true, the test_shell will write a descriptive line for each editing
+    // command.
+    bool m_dumpEditingCallbacks;
+
+    // If true, the test_shell will draw the bounds of the current selection rect
+    // taking possible transforms of the selection rect into account.
+    bool m_dumpSelectionRect;
+
+    // If true, the test_shell will output a descriptive line for each frame
+    // load callback.
+    bool m_dumpFrameLoadCallbacks;
+
+    // If true, the test_shell will output a descriptive line for each resource
+    // load callback.
+    bool m_dumpResourceLoadCallbacks;
+
+    // If true, the test_shell will produce a dump of the back forward list as
+    // well.
+    bool m_dumpBackForwardList;
+
+    // If true, the test_shell will print out the child frame scroll offsets as
+    // well.
+    bool m_dumpChildFrameScrollPositions;
+
+    // If true and if dump_as_text_ is true, the test_shell will recursively
+    // dump all frames as plain text.
+    bool m_dumpChildFramesAsText;
+
+    // If true, the test_shell will dump all changes to window.status.
+    bool m_dumpWindowStatusChanges;
+
+    // If true, output a message when the page title is changed.
+    bool m_dumpTitleChanges;
+
+    // If true, the element will be treated as editable.  This value is returned
+    // from various editing callbacks that are called just before edit operations
+    // are allowed.
+    bool m_acceptsEditing;
+
+    // If true, new windows can be opened via javascript or by plugins.  By
+    // default, set to false and can be toggled to true using
+    // setCanOpenWindows().
+    bool m_canOpenWindows;
+
+    // When reset is called, go through and close all but the main test shell
+    // window.  By default, set to true but toggled to false using
+    // setCloseRemainingWindowsWhenComplete().
+    bool m_closeRemainingWindows;
+
+    // If true, pixel dump will be produced as a series of 1px-tall, view-wide
+    // individual paints over the height of the view.
+    bool m_testRepaint;
+    // If true and test_repaint_ is true as well, pixel dump will be produced as
+    // a series of 1px-wide, view-tall paints across the width of the view.
+    bool m_sweepHorizontally;
+
+    // If true and a drag starts, adds a file to the drag&drop clipboard.
+    bool m_shouldAddFileToPasteboard;
+
+    // If true, stops provisional frame loads during the
+    // DidStartProvisionalLoadForFrame callback.
+    bool m_stopProvisionalFrameLoads;
+
+    // If true, don't dump output until notifyDone is called.
+    bool m_waitUntilDone;
+
+    // To prevent infinite loops, only the first page of a test can add to a
+    // work queue (since we may well come back to that same page).
+    bool m_workQueueFrozen;
+
+    WorkQueue m_workQueue;
+
+    CppVariant m_globalFlag;
+
+    // Bound variable counting the number of top URLs visited.
+    CppVariant m_webHistoryItemCount;
+
+    WebKit::WebURL m_userStyleSheetLocation;
+};
+
+#endif // LayoutTestController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm
new file mode 100644
index 0000000..e34cf5f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+
+#import <AppKit/AppKit.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// This is a simple helper app that changes the color sync profile to the
+// generic profile and back when done.  This program is managed by the layout
+// test script, so it can do the job for multiple DumpRenderTree while they are
+// running layout tests.
+
+static CMProfileRef userColorProfile = 0;
+
+static void saveCurrentColorProfile()
+{
+    CGDirectDisplayID displayID = CGMainDisplayID();
+    CMProfileRef previousProfile;
+    CMError error = CMGetProfileByAVID((UInt32)displayID, &previousProfile);
+    if (error) {
+        NSLog(@"failed to get the current color profile, pixmaps won't match. "
+              @"Error: %d", (int)error);
+    } else {
+        userColorProfile = previousProfile;
+    }
+}
+
+static void installLayoutTestColorProfile()
+{
+    // To make sure we get consistent colors (not dependent on the Main display),
+    // we force the generic rgb color profile.  This cases a change the user can
+    // see.
+
+    CGDirectDisplayID displayID = CGMainDisplayID();
+    NSColorSpace* genericSpace = [NSColorSpace genericRGBColorSpace];
+    CMProfileRef genericProfile = (CMProfileRef)[genericSpace colorSyncProfile];
+    CMError error = CMSetProfileByAVID((UInt32)displayID, genericProfile);
+    if (error) {
+        NSLog(@"failed install the generic color profile, pixmaps won't match. "
+              @"Error: %d", (int)error);
+    }
+}
+
+static void restoreUserColorProfile(void)
+{
+    if (!userColorProfile)
+        return;
+    CGDirectDisplayID displayID = CGMainDisplayID();
+    CMError error = CMSetProfileByAVID((UInt32)displayID, userColorProfile);
+    CMCloseProfile(userColorProfile);
+    if (error) {
+        NSLog(@"Failed to restore color profile, use System Preferences -> "
+              @"Displays -> Color to reset. Error: %d", (int)error);
+    }
+    userColorProfile = 0;
+}
+
+static void simpleSignalHandler(int sig)
+{
+    // Try to restore the color profile and try to go down cleanly
+    restoreUserColorProfile();
+    exit(128 + sig);
+}
+
+int main(int argc, char* argv[])
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+    // Hooks the ways we might get told to clean up...
+    signal(SIGINT, simpleSignalHandler);
+    signal(SIGHUP, simpleSignalHandler);
+    signal(SIGTERM, simpleSignalHandler);
+
+    // Save off the current profile, and then install the layout test profile.
+    saveCurrentColorProfile();
+    installLayoutTestColorProfile();
+
+    // Let the script know we're ready
+    printf("ready\n");
+    fflush(stdout);
+
+    // Wait for any key (or signal)
+    getchar();
+
+    // Restore the profile
+    restoreUserColorProfile();
+
+    [pool release];
+    return 0;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
new file mode 100644
index 0000000..fe70cab
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
@@ -0,0 +1,149 @@
+/*
+ * 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 "MockSpellCheck.h"
+
+#include "public/WebString.h"
+#include <wtf/ASCIICType.h>
+#include <wtf/Assertions.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+MockSpellCheck::MockSpellCheck()
+    : m_initialized(false) {}
+
+MockSpellCheck::~MockSpellCheck() {}
+
+static bool isNotASCIIAlpha(UChar ch) { return !isASCIIAlpha(ch); }
+
+bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset, int* misspelledLength)
+{
+    ASSERT(misspelledOffset);
+    ASSERT(misspelledLength);
+
+    // Initialize this spellchecker.
+    initializeIfNeeded();
+
+    // Reset the result values as our spellchecker does.
+    *misspelledOffset = 0;
+    *misspelledLength = 0;
+
+    // Convert to a String because we store String instances in
+    // m_misspelledWords and WebString has no find().
+    const String stringText(text.data(), text.length());
+
+    // Extract the first possible English word from the given string.
+    // The given string may include non-ASCII characters or numbers. So, we
+    // should filter out such characters before start looking up our
+    // misspelled-word table.
+    // (This is a simple version of our SpellCheckWordIterator class.)
+    // If the given string doesn't include any ASCII characters, we can treat the
+    // string as valid one.
+    // Unfortunately, This implementation splits a contraction, i.e. "isn't" is
+    // split into two pieces "isn" and "t". This is OK because webkit tests
+    // don't have misspelled contractions.
+    int wordOffset = stringText.find(isASCIIAlpha);
+    if (wordOffset == -1)
+        return true;
+    int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset);
+    int wordLength = wordEnd == -1 ? stringText.length() - wordOffset : wordEnd - wordOffset;
+
+    // Look up our misspelled-word table to check if the extracted word is a
+    // known misspelled word, and return the offset and the length of the
+    // extracted word if this word is a known misspelled word.
+    // (See the comment in MockSpellCheck::initializeIfNeeded() why we use a
+    // misspelled-word table.)
+    String word = stringText.substring(wordOffset, wordLength);
+    if (!m_misspelledWords.contains(word))
+        return true;
+
+    *misspelledOffset = wordOffset;
+    *misspelledLength = wordLength;
+    return false;
+}
+
+bool MockSpellCheck::initializeIfNeeded()
+{
+    // Exit if we have already initialized this object.
+    if (m_initialized)
+        return false;
+
+    // Create a table that consists of misspelled words used in WebKit layout
+    // tests.
+    // Since WebKit layout tests don't have so many misspelled words as
+    // well-spelled words, it is easier to compare the given word with misspelled
+    // ones than to compare with well-spelled ones.
+    static const char* misspelledWords[] = {
+        // These words are known misspelled words in webkit tests.
+        // If there are other misspelled words in webkit tests, please add them in
+        // this array.
+        "foo",
+        "Foo",
+        "baz",
+        "fo",
+        "LibertyF",
+        "chello",
+        "xxxtestxxx",
+        "XXxxx",
+        "Textx",
+        "blockquoted",
+        "asd",
+        "Lorem",
+        "Nunc",
+        "Curabitur",
+        "eu",
+        "adlj",
+        "adaasj",
+        "sdklj",
+        "jlkds",
+        "jsaada",
+        "jlda",
+        "zz",
+        "contentEditable",
+        // The following words are used by unit tests.
+        "ifmmp",
+        "qwertyuiopasd",
+        "qwertyuiopasdf",
+    };
+
+    m_misspelledWords.clear();
+    for (size_t i = 0; i < arraysize(misspelledWords); ++i)
+        m_misspelledWords.add(String::fromUTF8(misspelledWords[i]), false);
+
+    // Mark as initialized to prevent this object from being initialized twice
+    // or more.
+    m_initialized = true;
+
+    // Since this MockSpellCheck class doesn't download dictionaries, this
+    // function always returns false.
+    return false;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
new file mode 100644
index 0000000..8c2ba92
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
@@ -0,0 +1,82 @@
+/*
+ * 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 MockSpellCheck_h
+#define MockSpellCheck_h
+
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+class WebString;
+}
+
+// A mock implementation of a spell-checker used for WebKit tests.
+// This class only implements the minimal functionarities required by WebKit
+// tests, i.e. this class just compares the given string with known misspelled
+// words in webkit tests and mark them as missspelled.
+// Even though this is sufficent for webkit tests, this class is not suitable
+// for any other usages.
+class MockSpellCheck {
+public:
+    MockSpellCheck();
+    ~MockSpellCheck();
+
+    // Checks the spellings of the specified text.
+    // This function returns true if the text consists of valid words, and
+    // returns false if it includes invalid words.
+    // When the given text includes invalid words, this function sets the
+    // position of the first invalid word to misspelledOffset, and the length of
+    // the first invalid word to misspelledLength, respectively.
+    // For example, when the given text is "   zz zz", this function sets 3 to
+    // misspelledOffset and 2 to misspelledLength, respectively.
+    bool spellCheckWord(const WebKit::WebString& text,
+                        int* misspelledOffset,
+                        int* misspelledLength);
+
+private:
+    // Initialize the internal resources if we need to initialize it.
+    // Initializing this object may take long time. To prevent from hurting
+    // the performance of test_shell, we initialize this object when
+    // SpellCheckWord() is called for the first time.
+    // To be compliant with SpellCheck:InitializeIfNeeded(), this function
+    // returns true if this object is downloading a dictionary, otherwise
+    // it returns false.
+    bool initializeIfNeeded();
+
+    // A table that consists of misspelled words.
+    HashMap<WebCore::String, bool> m_misspelledWords;
+
+    // A flag representing whether or not this object is initialized.
+    bool m_initialized;
+};
+
+#endif // MockSpellCheck_h
diff --git a/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp b/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp
new file mode 100644
index 0000000..6e6cf11
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * 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 "PlainTextController.h"
+
+#include "TestShell.h"
+#include "public/WebBindings.h"
+#include "public/WebRange.h"
+#include "public/WebString.h"
+
+using namespace WebKit;
+
+PlainTextController::PlainTextController()
+{
+    // Initialize the map that associates methods of this class with the names
+    // they will use when called by JavaScript. The actual binding of those
+    // names to their methods will be done by calling bindToJavaScript() (defined
+    // by CppBoundClass, the parent to PlainTextController).
+    bindMethod("plainText", &PlainTextController::plainText);
+
+    // The fallback method is called when an unknown method is invoked.
+    bindFallbackMethod(&PlainTextController::fallbackMethod);
+}
+
+void PlainTextController::plainText(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    if (arguments.size() < 1 || !arguments[0].isObject())
+        return;
+
+    // Check that passed-in object is, in fact, a range.
+    NPObject* npobject = NPVARIANT_TO_OBJECT(arguments[0]);
+    if (!npobject)
+        return;
+    WebRange range;
+    if (!WebBindings::getRange(npobject, &range))
+        return;
+
+    // Extract the text using the Range's text() method
+    WebString text = range.toPlainText();
+    result->set(text.utf8());
+}
+
+void PlainTextController::fallbackMethod(const CppArgumentList&, CppVariant* result)
+{
+    printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on PlainTextController\n");
+    result->setNull();
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/PlainTextController.h b/WebKitTools/DumpRenderTree/chromium/PlainTextController.h
new file mode 100644
index 0000000..3d3a04c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/PlainTextController.h
@@ -0,0 +1,52 @@
+/*
+ * 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 PlainTextController_h
+#define PlainTextController_h
+
+#include "CppBoundClass.h"
+
+class TestShell;
+
+class PlainTextController : public CppBoundClass {
+public:
+    // Builds the property and method lists needed to bind this class to a JS
+    // object.
+    explicit PlainTextController();
+
+    // JS callback methods.
+    void plainText(const CppArgumentList&, CppVariant*);
+
+    // Fall-back method: called if an unknown method is invoked.
+    void fallbackMethod(const CppArgumentList&, CppVariant*);
+};
+
+#endif // PlainTextController_h
+
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
new file mode 100644
index 0000000..8b4f954
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
@@ -0,0 +1,269 @@
+/*
+ * 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 "TestNavigationController.h"
+
+#include "TestShell.h"
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+using namespace std;
+
+// ----------------------------------------------------------------------------
+// TestNavigationEntry
+
+TestNavigationEntry::TestNavigationEntry()
+    : m_pageID(-1) {}
+
+TestNavigationEntry::TestNavigationEntry(
+    int pageID, const WebURL& url, const WebString& title, const WebString& targetFrame)
+    : m_pageID(pageID)
+    , m_url(url)
+    , m_title(title)
+    , m_targetFrame(targetFrame) {}
+
+TestNavigationEntry::~TestNavigationEntry() {}
+
+void TestNavigationEntry::setContentState(const WebHistoryItem& state)
+{
+    m_state = state;
+}
+
+// ----------------------------------------------------------------------------
+// TestNavigationController
+
+TestNavigationController::TestNavigationController(NavigationHost* host)
+    : m_pendingEntry(0)
+    , m_lastCommittedEntryIndex(-1)
+    , m_pendingEntryIndex(-1)
+    , m_host(host)
+    , m_maxPageID(-1) {}
+
+TestNavigationController::~TestNavigationController()
+{
+    discardPendingEntry();
+}
+
+void TestNavigationController::reset()
+{
+    m_entries.clear();
+    discardPendingEntry();
+
+    m_lastCommittedEntryIndex = -1;
+}
+
+void TestNavigationController::reload()
+{
+    // Base the navigation on where we are now...
+    int currentIndex = currentEntryIndex();
+
+    // If we are no where, then we can't reload.  TODO(darin): We should add a
+    // CanReload method.
+    if (currentIndex == -1)
+        return;
+
+    discardPendingEntry();
+
+    m_pendingEntryIndex = currentIndex;
+    navigateToPendingEntry(true);
+}
+
+void TestNavigationController::goToOffset(int offset)
+{
+    int index = m_lastCommittedEntryIndex + offset;
+    if (index < 0 || index >= entryCount())
+        return;
+
+    goToIndex(index);
+}
+
+void TestNavigationController::goToIndex(int index)
+{
+    ASSERT(index >= 0);
+    ASSERT(index < static_cast<int>(m_entries.size()));
+
+    discardPendingEntry();
+
+    m_pendingEntryIndex = index;
+    navigateToPendingEntry(false);
+}
+
+void TestNavigationController::loadEntry(TestNavigationEntry* entry)
+{
+    // When navigating to a new page, we don't know for sure if we will actually
+    // end up leaving the current page.  The new page load could for example
+    // result in a download or a 'no content' response (e.g., a mailto: URL).
+    discardPendingEntry();
+    m_pendingEntry = entry;
+    navigateToPendingEntry(false);
+}
+
+
+TestNavigationEntry* TestNavigationController::lastCommittedEntry() const
+{
+    if (m_lastCommittedEntryIndex == -1)
+        return 0;
+    return m_entries[m_lastCommittedEntryIndex].get();
+}
+
+TestNavigationEntry* TestNavigationController::activeEntry() const
+{
+    TestNavigationEntry* entry = m_pendingEntry;
+    if (!entry)
+        entry = lastCommittedEntry();
+    return entry;
+}
+
+int TestNavigationController::currentEntryIndex() const
+{
+    if (m_pendingEntryIndex != -1)
+        return m_pendingEntryIndex;
+    return m_lastCommittedEntryIndex;
+}
+
+
+TestNavigationEntry* TestNavigationController::entryAtIndex(int index) const
+{
+    if (index < 0 || index >= entryCount())
+        return 0;
+    return m_entries[index].get();
+}
+
+TestNavigationEntry* TestNavigationController::entryWithPageID(int32_t pageID) const
+{
+    int index = entryIndexWithPageID(pageID);
+    return (index != -1) ? m_entries[index].get() : 0;
+}
+
+void TestNavigationController::didNavigateToEntry(TestNavigationEntry* entry)
+{
+    // If the entry is that of a page with PageID larger than any this Tab has
+    // seen before, then consider it a new navigation.
+    if (entry->pageID() > maxPageID()) {
+        insertEntry(entry);
+        return;
+    }
+
+    // Otherwise, we just need to update an existing entry with matching PageID.
+    // If the existing entry corresponds to the entry which is pending, then we
+    // must update the current entry index accordingly.  When navigating to the
+    // same URL, a new PageID is not created.
+
+    int existingEntryIndex = entryIndexWithPageID(entry->pageID());
+    TestNavigationEntry* existingEntry = (existingEntryIndex != -1) ?
+        m_entries[existingEntryIndex].get() : 0;
+    if (!existingEntry) {
+        // No existing entry, then simply ignore this navigation!
+    } else if (existingEntry == m_pendingEntry) {
+        // The given entry might provide a new URL... e.g., navigating back to a
+        // page in session history could have resulted in a new client redirect.
+        existingEntry->setURL(entry->URL());
+        existingEntry->setContentState(entry->contentState());
+        m_lastCommittedEntryIndex = m_pendingEntryIndex;
+        m_pendingEntryIndex = -1;
+        m_pendingEntry = 0;
+    } else if (m_pendingEntry && m_pendingEntry->pageID() == -1
+               && GURL(m_pendingEntry->URL()) == GURL(existingEntry->URL().spec())) {
+        // Not a new navigation
+        discardPendingEntry();
+    } else {
+        // The given entry might provide a new URL... e.g., navigating to a page
+        // might result in a client redirect, which should override the URL of the
+        // existing entry.
+        existingEntry->setURL(entry->URL());
+        existingEntry->setContentState(entry->contentState());
+
+        // The navigation could have been issued by the renderer, so be sure that
+        // we update our current index.
+        m_lastCommittedEntryIndex = existingEntryIndex;
+    }
+
+    delete entry;
+    updateMaxPageID();
+}
+
+void TestNavigationController::discardPendingEntry()
+{
+    if (m_pendingEntryIndex == -1)
+        delete m_pendingEntry;
+    m_pendingEntry = 0;
+    m_pendingEntryIndex = -1;
+}
+
+void TestNavigationController::insertEntry(TestNavigationEntry* entry)
+{
+    discardPendingEntry();
+
+    // Prune any entry which are in front of the current entry
+    int currentSize = static_cast<int>(m_entries.size());
+    if (currentSize > 0) {
+        while (m_lastCommittedEntryIndex < (currentSize - 1)) {
+            m_entries.removeLast();
+            currentSize--;
+        }
+    }
+
+    m_entries.append(linked_ptr<TestNavigationEntry>(entry));
+    m_lastCommittedEntryIndex = static_cast<int>(m_entries.size()) - 1;
+    updateMaxPageID();
+}
+
+int TestNavigationController::entryIndexWithPageID(int32 pageID) const
+{
+    for (int i = static_cast<int>(m_entries.size()) - 1; i >= 0; --i) {
+        if (m_entries[i]->pageID() == pageID)
+            return i;
+    }
+    return -1;
+}
+
+void TestNavigationController::navigateToPendingEntry(bool reload)
+{
+    // For session history navigations only the pending_entry_index_ is set.
+    if (!m_pendingEntry) {
+        ASSERT(m_pendingEntryIndex != -1);
+        m_pendingEntry = m_entries[m_pendingEntryIndex].get();
+    }
+
+    if (m_host->navigate(*m_pendingEntry, reload)) {
+        // Note: this is redundant if navigation completed synchronously because
+        // DidNavigateToEntry call this as well.
+        updateMaxPageID();
+    } else
+        discardPendingEntry();
+}
+
+void TestNavigationController::updateMaxPageID()
+{
+    TestNavigationEntry* entry = activeEntry();
+    if (entry)
+        m_maxPageID = max(m_maxPageID, entry->pageID());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
new file mode 100644
index 0000000..bd3c2f4
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
@@ -0,0 +1,204 @@
+/*
+ * 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 TestNavigationController_h
+#define TestNavigationController_h
+
+#include "base/basictypes.h"
+#include "base/linked_ptr.h"
+#include "public/WebDataSource.h"
+#include "public/WebHistoryItem.h"
+#include "public/WebString.h"
+#include "public/WebURL.h"
+#include <string>
+#include <wtf/Vector.h>
+
+// Associated with browser-initated navigations to hold tracking data.
+class TestShellExtraData : public WebKit::WebDataSource::ExtraData {
+public:
+    TestShellExtraData(int32_t pendingPageID)
+        : pendingPageID(pendingPageID)
+        , requestCommitted(false) {}
+
+    // Contains the page_id for this navigation or -1 if there is none yet.
+    int32_t pendingPageID;
+
+    // True if we have already processed the "DidCommitLoad" event for this
+    // request. Used by session history.
+    bool requestCommitted;
+};
+
+// Stores one back/forward navigation state for the test shell.
+class TestNavigationEntry: public Noncopyable {
+public:
+    TestNavigationEntry();
+    TestNavigationEntry(int pageID,
+                        const WebKit::WebURL&,
+                        const WebKit::WebString& title,
+                        const WebKit::WebString& targetFrame);
+
+    // Virtual to allow test_shell to extend the class.
+    ~TestNavigationEntry();
+
+    // Set / Get the URI
+    void setURL(const WebKit::WebURL& url) { m_url = url; }
+    const WebKit::WebURL& URL() const { return m_url; }
+
+    // Set / Get the title
+    void setTitle(const WebKit::WebString& title) { m_title = title; }
+    const WebKit::WebString& title() const { return m_title; }
+
+    // Set / Get a state.
+    void setContentState(const WebKit::WebHistoryItem&);
+    const WebKit::WebHistoryItem& contentState() const { return m_state; }
+
+    // Get the page id corresponding to the tab's state.
+    void setPageID(int pageID) { m_pageID = pageID; }
+    int32_t pageID() const { return m_pageID; }
+
+    const WebKit::WebString& targetFrame() const { return m_targetFrame; }
+
+private:
+    // Describes the current page that the tab represents. This is not relevant
+    // for all tab contents types.
+    int32_t m_pageID;
+
+    WebKit::WebURL m_url;
+    WebKit::WebString m_title;
+    WebKit::WebHistoryItem m_state;
+    WebKit::WebString m_targetFrame;
+};
+
+class NavigationHost {
+public:
+    virtual bool navigate(const TestNavigationEntry&, bool reload) = 0;
+};
+
+// Test shell's NavigationController. The goal is to be as close to the Chrome
+// version as possible.
+class TestNavigationController: public Noncopyable {
+public:
+    TestNavigationController(NavigationHost*);
+    ~TestNavigationController();
+
+    void reset();
+
+    // Causes the controller to reload the current (or pending) entry.
+    void reload();
+
+    // Causes the controller to go to the specified offset from current. Does
+    // nothing if out of bounds.
+    void goToOffset(int);
+
+    // Causes the controller to go to the specified index.
+    void goToIndex(int);
+
+    // Causes the controller to load the specified entry.  The controller
+    // assumes ownership of the entry.
+    // NOTE: Do not pass an entry that the controller already owns!
+    void loadEntry(TestNavigationEntry*);
+
+    // Returns the last committed entry, which may be null if there are no
+    // committed entries.
+    TestNavigationEntry* lastCommittedEntry() const;
+
+    // Returns the number of entries in the NavigationControllerBase, excluding
+    // the pending entry if there is one.
+    int entryCount() const { return static_cast<int>(m_entries.size()); }
+
+    // Returns the active entry, which is the pending entry if a navigation is in
+    // progress or the last committed entry otherwise.  NOTE: This can be 0!!
+    //
+    // If you are trying to get the current state of the NavigationControllerBase,
+    // this is the method you will typically want to call.
+    TestNavigationEntry* activeEntry() const;
+
+    // Returns the index from which we would go back/forward or reload. This is
+    // the m_lastCommittedEntryIndex if m_pendingEntryIndex is -1. Otherwise,
+    // it is the m_pendingEntryIndex.
+    int currentEntryIndex() const;
+
+    // Returns the entry at the specified index.  Returns 0 if out of
+    // bounds.
+    TestNavigationEntry* entryAtIndex(int) const;
+
+    // Return the entry with the corresponding type and page ID, or 0 if
+    // not found.
+    TestNavigationEntry* entryWithPageID(int32_t) const;
+
+    // Returns the index of the last committed entry.
+    int lastCommittedEntryIndex() const { return m_lastCommittedEntryIndex; }
+
+    // Used to inform us of a navigation being committed for a tab. We will take
+    // ownership of the entry. Any entry located forward to the current entry will
+    // be deleted. The new entry becomes the current entry.
+    void didNavigateToEntry(TestNavigationEntry*);
+
+    // Used to inform us to discard its pending entry.
+    void discardPendingEntry();
+
+private:
+    // Inserts an entry after the current position, removing all entries after it.
+    // The new entry will become the active one.
+    void insertEntry(TestNavigationEntry*);
+
+    int maxPageID() const { return m_maxPageID; }
+    void navigateToPendingEntry(bool reload);
+
+    // Return the index of the entry with the corresponding type and page ID,
+    // or -1 if not found.
+    int entryIndexWithPageID(int32_t) const;
+
+    // Updates the max page ID with that of the given entry, if is larger.
+    void updateMaxPageID();
+
+    // List of NavigationEntry for this tab
+    typedef Vector<linked_ptr<TestNavigationEntry> > NavigationEntryList;
+    typedef NavigationEntryList::iterator NavigationEntryListIterator;
+    NavigationEntryList m_entries;
+
+    // An entry we haven't gotten a response for yet.  This will be discarded
+    // when we navigate again.  It's used only so we know what the currently
+    // displayed tab is.
+    TestNavigationEntry* m_pendingEntry;
+
+    // currently visible entry
+    int m_lastCommittedEntryIndex;
+
+    // index of pending entry if it is in entries_, or -1 if pending_entry_ is a
+    // new entry (created by LoadURL).
+    int m_pendingEntryIndex;
+
+    NavigationHost* m_host;
+    int m_maxPageID;
+};
+
+#endif // TestNavigationController_h
+
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
new file mode 100644
index 0000000..d2bc110
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -0,0 +1,614 @@
+/*
+ * 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 "TestShell.h"
+
+#include "LayoutTestController.h"
+#include "WebViewHost.h"
+#include "base/md5.h" // FIXME: Wrap by webkit_support.
+#include "base/string16.h"
+#include "gfx/codec/png_codec.h" // FIXME: Remove dependecy. WebCore/platform/image-encoder is better?
+#include "net/base/escape.h" // FIXME: Remove dependency.
+#include "public/WebDataSource.h"
+#include "public/WebDocument.h"
+#include "public/WebElement.h"
+#include "public/WebFrame.h"
+#include "public/WebHistoryItem.h"
+#include "public/WebRuntimeFeatures.h"
+#include "public/WebScriptController.h"
+#include "public/WebSettings.h"
+#include "public/WebSize.h"
+#include "public/WebString.h"
+#include "public/WebURLRequest.h"
+#include "public/WebURLResponse.h"
+#include "public/WebView.h"
+#include "skia/ext/bitmap_platform_device.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/support/webkit_support.h"
+#include <algorithm>
+#include <cctype>
+#include <vector>
+
+using namespace WebKit;
+using namespace std;
+
+// Content area size for newly created windows.
+static const int testWindowWidth = 800;
+static const int testWindowHeight = 600;
+
+// The W3C SVG layout tests use a different size than the other layout tests.
+static const int SVGTestWindowWidth = 480;
+static const int SVGTestWindowHeight = 360;
+
+static const char layoutTestsPattern[] = "/LayoutTests/";
+static const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
+static const char fileUrlPattern[] = "file:/";
+static const char fileTestPrefix[] = "(file test):";
+static const char dataUrlPattern[] = "data:";
+static const string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
+
+TestShell::TestShell()
+    : m_testIsPending(false)
+    , m_testIsPreparing(false)
+    , m_focusedWidget(0)
+{
+    m_accessibilityController.set(new AccessibilityController(this));
+    m_layoutTestController.set(new LayoutTestController(this));
+    m_eventSender.set(new EventSender(this));
+    m_plainTextController.set(new PlainTextController());
+    m_textInputController.set(new TextInputController(this));
+
+    m_webViewHost = createWebView();
+    m_webView = m_webViewHost->webView();
+}
+
+TestShell::~TestShell()
+{
+    loadURL(GURL("about:blank"));
+    // Call GC twice to clean up garbage.
+    callJSGC();
+    callJSGC();
+
+    // Destroy the WebView before its WebViewHost.
+    m_webView->close();
+}
+
+void TestShell::resetWebSettings(WebView& webView)
+{
+    // Match the settings used by Mac DumpRenderTree, with the exception of
+    // fonts.
+    WebSettings* settings = webView.settings();
+#if OS(MAC_OS_X)
+    WebString serif = WebString::fromUTF8("Times");
+    settings->setCursiveFontFamily(WebString::fromUTF8("Apple Chancery"));
+    settings->setFantasyFontFamily(WebString::fromUTF8("Papyrus"));
+#else
+    // NOTE: case matters here, this must be 'times new roman', else
+    // some layout tests fail.
+    WebString serif = WebString::fromUTF8("times new roman");
+
+    // These two fonts are picked from the intersection of
+    // Win XP font list and Vista font list :
+    //   http://www.microsoft.com/typography/fonts/winxp.htm
+    //   http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx
+    // Some of them are installed only with CJK and complex script
+    // support enabled on Windows XP and are out of consideration here.
+    // (although we enabled both on our buildbots.)
+    // They (especially Impact for fantasy) are not typical cursive
+    // and fantasy fonts, but it should not matter for layout tests
+    // as long as they're available.
+    settings->setCursiveFontFamily(WebString::fromUTF8("Comic Sans MS"));
+    settings->setFantasyFontFamily(WebString::fromUTF8("Impact"));
+#endif
+    settings->setSerifFontFamily(serif);
+    settings->setStandardFontFamily(serif);
+    settings->setFixedFontFamily(WebString::fromUTF8("Courier"));
+
+    settings->setDefaultTextEncodingName(WebString::fromUTF8("ISO-8859-1"));
+    settings->setDefaultFontSize(16);
+    settings->setDefaultFixedFontSize(13);
+    settings->setMinimumFontSize(1);
+    settings->setMinimumLogicalFontSize(9);
+    settings->setJavaScriptCanOpenWindowsAutomatically(true);
+    settings->setDOMPasteAllowed(true);
+    settings->setDeveloperExtrasEnabled(false);
+    settings->setNeedsSiteSpecificQuirks(true);
+    settings->setShrinksStandaloneImagesToFit(false);
+    settings->setUsesEncodingDetector(false);
+    settings->setTextAreasAreResizable(false);
+    settings->setJavaEnabled(false);
+    settings->setAllowScriptsToCloseWindows(false);
+    settings->setXSSAuditorEnabled(false);
+    settings->setDownloadableBinaryFontsEnabled(true);
+    settings->setLocalStorageEnabled(true);
+    settings->setOfflineWebApplicationCacheEnabled(true);
+    settings->setAllowFileAccessFromFileURLs(true);
+
+    // LayoutTests were written with Safari Mac in mind which does not allow
+    // tabbing to links by default.
+    webView.setTabsToLinks(false);
+
+    // Allow those layout tests running as local files, i.e. under
+    // LayoutTests/http/tests/local, to access http server.
+    settings->setAllowUniversalAccessFromFileURLs(true);
+
+    settings->setJavaScriptEnabled(true);
+    settings->setPluginsEnabled(true);
+    settings->setWebSecurityEnabled(true);
+    settings->setEditableLinkBehaviorNeverLive();
+    settings->setFontRenderingModeNormal();
+    settings->setShouldPaintCustomScrollbars(true);
+    settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
+
+    settings->setLoadsImagesAutomatically(true);
+    settings->setImagesEnabled(true);
+}
+
+void TestShell::runFileTest(const TestParams& params)
+{
+    m_testIsPreparing = true;
+    m_params = params;
+    string testUrl = m_params.testUrl.spec();
+
+    bool inspectorTestMode = testUrl.find("/inspector/") != string::npos
+        || testUrl.find("\\inspector\\") != string::npos;
+    m_webView->settings()->setDeveloperExtrasEnabled(inspectorTestMode);
+    loadURL(m_params.testUrl);
+
+    m_testIsPreparing = false;
+    waitTestFinished();
+}
+
+static inline bool isSVGTestURL(const WebURL& url)
+{
+    return url.isValid() && string(url.spec()).find("W3C-SVG-1.1") != string::npos;
+}
+
+void TestShell::resizeWindowForTest(WebViewHost* window, const WebURL& url)
+{
+    int width, height;
+    if (isSVGTestURL(url)) {
+        width = SVGTestWindowWidth;
+        height = SVGTestWindowHeight;
+    } else {
+        width = testWindowWidth;
+        height = testWindowHeight;
+    }
+    window->setWindowRect(WebRect(0, 0, width + virtualWindowBorder * 2, height + virtualWindowBorder * 2));
+}
+
+void TestShell::resetTestController()
+{
+    m_accessibilityController->reset();
+    m_layoutTestController->reset();
+    m_eventSender->reset();
+    m_webViewHost->reset();
+}
+
+void TestShell::loadURL(const WebURL& url)
+{
+    m_webViewHost->loadURLForFrame(url, WebString());
+}
+
+void TestShell::reload()
+{
+    m_webViewHost->navigationController()->reload();
+}
+
+void TestShell::goToOffset(int offset)
+{
+     m_webViewHost->navigationController()->goToOffset(offset);
+}
+
+int TestShell::navigationEntryCount() const
+{
+    return m_webViewHost->navigationController()->entryCount();
+}
+
+void TestShell::callJSGC()
+{
+    m_webView->mainFrame()->collectGarbage();
+}
+
+void TestShell::setFocus(WebWidget* widget, bool enable)
+{
+    // Simulate the effects of InteractiveSetFocus(), which includes calling
+    // both setFocus() and setIsActive().
+    if (enable) {
+        if (m_focusedWidget != widget) {
+            if (m_focusedWidget)
+                m_focusedWidget->setFocus(false);
+            webView()->setIsActive(enable);
+            widget->setFocus(enable);
+            m_focusedWidget = widget;
+        }
+    } else {
+        if (m_focusedWidget == widget) {
+            widget->setFocus(enable);
+            webView()->setIsActive(enable);
+            m_focusedWidget = 0;
+        }
+    }
+}
+
+void TestShell::testFinished()
+{
+    if (!m_testIsPending)
+        return;
+    m_testIsPending = false;
+    dump();
+    webkit_support::QuitMessageLoop();
+}
+
+void TestShell::testTimedOut()
+{
+    fprintf(stderr, "FAIL: Timed out waiting for notifyDone to be called\n");
+    fprintf(stdout, "FAIL: Timed out waiting for notifyDone to be called\n");
+    testFinished();
+}
+
+static string dumpDocumentText(WebFrame* frame)
+{
+    // We use the document element's text instead of the body text here because
+    // not all documents have a body, such as XML documents.
+    WebElement documentElement = frame->document().documentElement();
+    if (documentElement.isNull())
+        return string();
+    return documentElement.innerText().utf8();
+}
+
+static string dumpFramesAsText(WebFrame* frame, bool recursive)
+{
+    string result;
+
+    // Add header for all but the main frame. Skip empty frames.
+    if (frame->parent() && !frame->document().documentElement().isNull()) {
+        result.append("\n--------\nFrame: '");
+        result.append(frame->name().utf8().data());
+        result.append("'\n--------\n");
+    }
+
+    result.append(dumpDocumentText(frame));
+    result.append("\n");
+
+    if (recursive) {
+        for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
+            result.append(dumpFramesAsText(child, recursive));
+    }
+
+    return result;
+}
+
+static void dumpFrameScrollPosition(WebFrame* frame, bool recursive)
+{
+    WebSize offset = frame->scrollOffset();
+    if (offset.width > 0 || offset.height > 0) {
+        if (frame->parent())
+            printf("frame '%s' ", frame->name().utf8().data());
+        printf("scrolled to %d,%d\n", offset.width, offset.height);
+    }
+
+    if (!recursive)
+        return;
+    for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
+        dumpFrameScrollPosition(child, recursive);
+}
+
+struct ToLower {
+    char16 operator()(char16 c) { return tolower(c); }
+};
+
+// FIXME: Eliminate std::transform(), std::vector, and std::sort().
+
+// Returns True if item1 < item2.
+static bool HistoryItemCompareLess(const WebHistoryItem& item1, const WebHistoryItem& item2)
+{
+    string16 target1 = item1.target();
+    string16 target2 = item2.target();
+    std::transform(target1.begin(), target1.end(), target1.begin(), ToLower());
+    std::transform(target2.begin(), target2.end(), target2.begin(), ToLower());
+    return target1 < target2;
+}
+
+static string dumpHistoryItem(const WebHistoryItem& item, int indent, bool isCurrent)
+{
+    string result;
+
+    if (isCurrent) {
+        result.append("curr->");
+        result.append(indent - 6, ' '); // 6 == "curr->".length()
+    } else {
+        result.append(indent, ' ');
+    }
+
+    string url = item.urlString().utf8();
+    size_t pos;
+    if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) {
+        // adjust file URLs to match upstream results.
+        url.replace(0, pos + layoutTestsPatternSize, fileTestPrefix);
+    } else if (!url.find(dataUrlPattern)) {
+        // URL-escape data URLs to match results upstream.
+        string path = EscapePath(url.substr(dataUrlPatternSize));
+        url.replace(dataUrlPatternSize, url.length(), path);
+    }
+
+    result.append(url);
+    if (!item.target().isEmpty()) {
+        result.append(" (in frame \"");
+        result.append(item.target().utf8());
+        result.append("\")");
+    }
+    if (item.isTargetItem())
+        result.append("  **nav target**");
+    result.append("\n");
+
+    const WebVector<WebHistoryItem>& children = item.children();
+    if (!children.isEmpty()) {
+        // Must sort to eliminate arbitrary result ordering which defeats
+        // reproducible testing.
+        // FIXME: WebVector should probably just be a std::vector!!
+        std::vector<WebHistoryItem> sortedChildren;
+        for (size_t i = 0; i < children.size(); ++i)
+            sortedChildren.push_back(children[i]);
+        std::sort(sortedChildren.begin(), sortedChildren.end(), HistoryItemCompareLess);
+        for (size_t i = 0; i < sortedChildren.size(); ++i)
+            result += dumpHistoryItem(sortedChildren[i], indent + 4, false);
+    }
+
+    return result;
+}
+
+static void dumpBackForwardList(const TestNavigationController& navigationController, string& result)
+{
+    result.append("\n============== Back Forward List ==============\n");
+    for (int index = 0; index < navigationController.entryCount(); ++index) {
+        int currentIndex = navigationController.lastCommittedEntryIndex();
+        WebHistoryItem historyItem = navigationController.entryAtIndex(index)->contentState();
+        if (historyItem.isNull()) {
+            historyItem.initialize();
+            historyItem.setURLString(navigationController.entryAtIndex(index)->URL().spec().utf16());
+        }
+        result.append(dumpHistoryItem(historyItem, 8, index == currentIndex));
+    }
+    result.append("===============================================\n");
+}
+
+string TestShell::dumpAllBackForwardLists()
+{
+    string result;
+    for (unsigned i = 0; i < m_windowList.size(); ++i)
+        dumpBackForwardList(*m_windowList[i]->navigationController(), result);
+    return result;
+}
+
+void TestShell::dump()
+{
+    WebScriptController::flushConsoleMessages();
+
+    // Dump the requested representation.
+    WebFrame* frame = m_webView->mainFrame();
+    if (!frame)
+        return;
+    bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText();
+    bool dumpedAnything = false;
+    if (m_params.dumpTree) {
+        dumpedAnything = true;
+        printf("Content-Type: text/plain\n");
+        // Text output: the test page can request different types of output
+        // which we handle here.
+        if (!shouldDumpAsText) {
+            // Plain text pages should be dumped as text
+            string mimeType = frame->dataSource()->response().mimeType().utf8();
+            shouldDumpAsText = mimeType == "text/plain";
+        }
+        if (shouldDumpAsText) {
+            bool recursive = m_layoutTestController->shouldDumpChildFramesAsText();
+            string dataUtf8 = dumpFramesAsText(frame, recursive);
+            if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size())
+                FATAL("Short write to stdout, disk full?\n");
+        } else {
+            printf("%s", frame->renderTreeAsText().utf8().data());
+            bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions();
+            dumpFrameScrollPosition(frame, recursive);
+        }
+        if (m_layoutTestController->shouldDumpBackForwardList())
+            printf("%s", dumpAllBackForwardLists().c_str());
+    }
+    if (dumpedAnything && m_params.printSeparators)
+        printf("#EOF\n");
+
+    if (m_params.dumpPixels && !shouldDumpAsText) {
+        // Image output: we write the image data to the file given on the
+        // command line (for the dump pixels argument), and the MD5 sum to
+        // stdout.
+        dumpedAnything = true;
+        m_webView->layout();
+        if (m_layoutTestController->testRepaint()) {
+            WebSize viewSize = m_webView->size();
+            int width = viewSize.width;
+            int height = viewSize.height;
+            if (m_layoutTestController->sweepHorizontally()) {
+                for (WebRect column(0, 0, 1, height); column.x < width; column.x++)
+                    m_webViewHost->paintRect(column);
+            } else {
+                for (WebRect line(0, 0, width, 1); line.y < height; line.y++)
+                    m_webViewHost->paintRect(line);
+            }
+        } else
+            m_webViewHost->paintInvalidatedRegion();
+
+        // See if we need to draw the selection bounds rect. Selection bounds
+        // rect is the rect enclosing the (possibly transformed) selection.
+        // The rect should be drawn after everything is laid out and painted.
+        if (m_layoutTestController->shouldDumpSelectionRect()) {
+            // If there is a selection rect - draw a red 1px border enclosing rect
+            WebRect wr = frame->selectionBoundsRect();
+            if (!wr.isEmpty()) {
+                // Render a red rectangle bounding selection rect
+                SkPaint paint;
+                paint.setColor(0xFFFF0000); // Fully opaque red
+                paint.setStyle(SkPaint::kStroke_Style);
+                paint.setFlags(SkPaint::kAntiAlias_Flag);
+                paint.setStrokeWidth(1.0f);
+                SkIRect rect; // Bounding rect
+                rect.set(wr.x, wr.y, wr.x + wr.width, wr.y + wr.height);
+                m_webViewHost->canvas()->drawIRect(rect, paint);
+            }
+        }
+
+        string md5sum = dumpImage(m_webViewHost->canvas(), m_params.pixelHash);
+    }
+    printf("#EOF\n"); // For the image.
+    fflush(stdout);
+    fflush(stderr);
+}
+
+string TestShell::dumpImage(skia::PlatformCanvas* canvas, const string& expectedHash)
+{
+    skia::BitmapPlatformDevice& device =
+        static_cast<skia::BitmapPlatformDevice&>(canvas->getTopPlatformDevice());
+    const SkBitmap& sourceBitmap = device.accessBitmap(false);
+
+    SkAutoLockPixels sourceBitmapLock(sourceBitmap);
+
+    // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want
+    // to keep it. On Windows, the alpha channel is wrong since text/form control
+    // drawing may have erased it in a few places. So on Windows we force it to
+    // opaque and also don't write the alpha channel for the reference. Linux
+    // doesn't have the wrong alpha like Windows, but we ignore it anyway.
+#if OS(WINDOWS)
+    bool discardTransparency = true;
+    device.makeOpaque(0, 0, sourceBitmap.width(), sourceBitmap.height());
+#elif OS(MAC_OS_X)
+    bool discardTransparency = false;
+#elif OS(UNIX)
+    bool discardTransparency = true;
+#endif
+
+    // Compute MD5 sum.  We should have done this before calling
+    // device.makeOpaque on Windows.  Because we do it after the call, there are
+    // some images that are the pixel identical on windows and other platforms
+    // but have different MD5 sums.  At this point, rebaselining all the windows
+    // tests is too much of a pain, so we just check in different baselines.
+    MD5Context ctx;
+    MD5Init(&ctx);
+    MD5Update(&ctx, sourceBitmap.getPixels(), sourceBitmap.getSize());
+
+    MD5Digest digest;
+    MD5Final(&digest, &ctx);
+    string md5hash = MD5DigestToBase16(digest);
+    printf("\nActualHash: %s\n", md5hash.c_str());
+    if (!expectedHash.empty())
+        printf("\nExpectedHash: %s\n", expectedHash.c_str());
+
+    // Only encode and dump the png if the hashes don't match. Encoding the image
+    // is really expensive.
+    if (md5hash.compare(expectedHash)) {
+        std::vector<unsigned char> png;
+        gfx::PNGCodec::ColorFormat colorFormat = gfx::PNGCodec::FORMAT_BGRA;
+        gfx::PNGCodec::Encode(
+            reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()),
+            colorFormat, sourceBitmap.width(), sourceBitmap.height(),
+            static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, &png);
+
+        printf("Content-Type: image/png\n");
+        printf("Content-Length: %u\n", png.size());
+        // Write to disk.
+        if (fwrite(&png[0], 1, png.size(), stdout) != png.size())
+            FATAL("Short write to stdout.\n");
+    }
+
+    return md5hash;
+}
+
+void TestShell::bindJSObjectsToWindow(WebFrame* frame)
+{
+    m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController"));
+    m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController"));
+    m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender"));
+    m_plainTextController->bindToJavascript(frame, WebString::fromUTF8("plainText"));
+    m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController"));
+}
+
+int TestShell::layoutTestTimeout()
+{
+    return 10 * 1000;
+}
+
+WebViewHost* TestShell::createWebView()
+{
+    return createNewWindow(WebURL());
+}
+
+WebViewHost* TestShell::createNewWindow(const WebURL& url)
+{
+    WebViewHost* host = new WebViewHost(this);
+    WebView* view = WebView::create(host);
+    host->setWebWidget(view);
+    resetWebSettings(*view);
+    view->initializeMainFrame(host);
+    m_windowList.append(host);
+    host->loadURLForFrame(url, WebString());
+    return host;
+}
+
+void TestShell::closeWindow(WebViewHost* window)
+{
+    size_t i = m_windowList.find(window);
+    if (i == notFound) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    m_windowList.remove(i);
+    window->webWidget()->close();
+    delete window;
+}
+
+void TestShell::closeRemainingWindows()
+{
+    // Iterate through the window list and close everything except the main
+    // ihwindow. We don't want to delete elements as we're iterating, so we copy
+    // to a temp vector first.
+    Vector<WebViewHost*> windowsToDelete;
+    for (unsigned i = 0; i < m_windowList.size(); ++i) {
+        if (m_windowList[i] != webViewHost())
+            windowsToDelete.append(m_windowList[i]);
+    }
+    ASSERT(windowsToDelete.size() + 1 == m_windowList.size());
+    for (unsigned i = 0; i < windowsToDelete.size(); ++i)
+        closeWindow(windowsToDelete[i]);
+    ASSERT(m_windowList.size() == 1);
+}
+
+int TestShell::windowCount()
+{
+    return m_windowList.size();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
new file mode 100644
index 0000000..c6a5b2e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -0,0 +1,149 @@
+/*
+ * 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 "AccessibilityController.h"
+#include "EventSender.h"
+#include "LayoutTestController.h"
+#include "PlainTextController.h"
+#include "TextInputController.h"
+#include "WebViewHost.h"
+#include <string>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+// TestShell is a container of global variables and has bridge functions between
+// various objects. Only one instance is created in one DRT process.
+
+namespace WebKit {
+class WebFrame;
+class WebPreferences;
+class WebView;
+class WebURL;
+}
+namespace skia {
+class PlatformCanvas;
+}
+
+struct TestParams {
+    bool dumpTree;
+    bool dumpPixels;
+    bool printSeparators;
+    WebKit::WebURL testUrl;
+    std::string pixelFileName;
+    std::string pixelHash;
+
+    TestParams()
+        : dumpTree(true)
+        , dumpPixels(false)
+        , printSeparators(false) {}
+};
+
+class TestShell {
+public:
+    TestShell();
+    ~TestShell();
+    // The main WebView.
+    WebKit::WebView* webView() const { return m_webView; }
+    // Returns the host for the main WebView.
+    WebViewHost* webViewHost() const { return m_webViewHost; }
+    LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); }
+    AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
+
+    void bindJSObjectsToWindow(WebKit::WebFrame*);
+    void runFileTest(const TestParams&);
+    void callJSGC();
+    void resetTestController();
+    void waitTestFinished();
+
+    // Operations to the main window.
+    void loadURL(const WebKit::WebURL& url);
+    void reload();
+    void goToOffset(int offset);
+    int navigationEntryCount() const;
+
+    void setFocus(WebKit::WebWidget*, bool enable);
+    bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
+    bool shouldDumpResourceLoadCallbacks() const  { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
+    void setIsLoading(bool flag) { m_isLoading = flag; }
+
+    // Called by the LayoutTestController to signal test completion.
+    void testFinished();
+    // Called by LayoutTestController when a test hits the timeout, but does not
+    // cause a hang. We can avoid killing TestShell in this case and still dump
+    // the test results.
+    void testTimedOut();
+
+#if defined(OS_WIN)
+    // Access to the finished event.  Used by the static WatchDog thread.
+    HANDLE finishedEvent() { return m_finishedEvent; }
+#endif
+
+    // Get the timeout for running a test in milliseconds.
+    static int layoutTestTimeout();
+    static int layoutTestTimeoutForWatchDog() { return layoutTestTimeout() + 1000; }
+
+    WebViewHost* createWebView();
+    WebViewHost* createNewWindow(const WebKit::WebURL&);
+    void closeWindow(WebViewHost*);
+    void closeRemainingWindows();
+    int windowCount();
+    static void resizeWindowForTest(WebViewHost*, const WebKit::WebURL&);
+
+    static const int virtualWindowBorder = 3;
+
+private:
+    static void resetWebSettings(WebKit::WebView&);
+    void dump();
+    std::string dumpAllBackForwardLists();
+    static std::string dumpImage(skia::PlatformCanvas*, const std::string& expectedHash);
+
+    bool m_testIsPending;
+    bool m_testIsPreparing;
+    bool m_isLoading;
+    WebKit::WebView* m_webView;
+    WebKit::WebWidget* m_focusedWidget;
+    WebViewHost* m_webViewHost;
+    OwnPtr<AccessibilityController*> m_accessibilityController;
+    OwnPtr<EventSender*> m_eventSender;
+    OwnPtr<LayoutTestController*> m_layoutTestController;
+    OwnPtr<PlainTextController*> m_plainTextController;
+    OwnPtr<TextInputController*> m_textInputController;
+    TestParams m_params;
+
+    // List of all windows in this process.
+    // The main window should be put into windowList[0].
+    typedef Vector<WebViewHost*> WindowList;
+    WindowList m_windowList;
+
+#if defined(OS_WIN)
+    // Used by the watchdog to know when it's finished.
+    HANDLE m_finishedEvent;
+#endif
+};
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
new file mode 100644
index 0000000..d71881a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 "TestShell.h"
+
+#include "webkit/support/webkit_support.h"
+#include <signal.h>
+
+static void AlarmHandler(int signatl)
+{
+    // If the alarm alarmed, kill the process since we have a really bad hang.
+    puts("\n#TEST_TIMED_OUT\n");
+    puts("#EOF\n");
+    fflush(stdout);
+    exit(0);
+}
+
+void TestShell::waitTestFinished()
+{
+    ASSERT(!m_testIsPending);
+
+    m_testIsPending = true;
+
+    // Install an alarm signal handler that will kill us if we time out.
+    signal(SIGALRM, AlarmHandler);
+    alarm(layoutTestTimeoutForWatchDog() / 1000);
+
+    // TestFinished() will post a quit message to break this loop when the page
+    // finishes loading.
+    while (m_testIsPending)
+        webkit_support::RunMessageLoop();
+
+    // Remove the alarm.
+    alarm(0);
+    signal(SIGALRM, SIG_DFL);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
new file mode 100644
index 0000000..ec8dbac
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
@@ -0,0 +1,125 @@
+/*
+ * 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 "TestShell.h"
+#include "webkit/support/webkit_support.h"
+#import <AppKit/AppKit.h>
+
+// A class to be the target/selector of the "watchdog" thread that ensures
+// pages timeout if they take too long and tells the test harness via stdout.
+@interface WatchDogTarget : NSObject {
+@private
+    NSTimeInterval _timeout;
+}
+// |timeout| is in seconds
+- (id)initWithTimeout:(NSTimeInterval)timeout;
+// serves as the "run" method of a NSThread.
+- (void)run:(id)sender;
+@end
+
+@implementation WatchDogTarget
+
+- (id)initWithTimeout:(NSTimeInterval)timeout
+{
+    if ((self = [super init]))
+        _timeout = timeout;
+    return self;
+}
+
+- (void)run:(id)ignore
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+    // check for debugger, just bail if so. We don't want the timeouts hitting
+    // when we're trying to track down an issue.
+    if (webkit_support::BeingDebugged())
+        return;
+
+    NSThread* currentThread = [NSThread currentThread];
+
+    // Wait to be cancelled. If we are that means the test finished. If it hasn't,
+    // then we need to tell the layout script we timed out and start again.
+    NSDate* limitDate = [NSDate dateWithTimeIntervalSinceNow:_timeout];
+    while ([(NSDate*)[NSDate date] compare:limitDate] == NSOrderedAscending &&
+           ![currentThread isCancelled]) {
+        // sleep for a small increment then check again
+        NSDate* incrementDate = [NSDate dateWithTimeIntervalSinceNow:1.0];
+        [NSThread sleepUntilDate:incrementDate];
+    }
+    if (![currentThread isCancelled]) {
+        // Print a warning to be caught by the layout-test script.
+        // Note: the layout test driver may or may not recognize
+        // this as a timeout.
+        puts("#TEST_TIMED_OUT\n");
+        puts("#EOF\n");
+        fflush(stdout);
+        exit(0);
+    }
+
+    [pool release];
+}
+
+@end
+
+void TestShell::waitTestFinished()
+{
+    ASSERT(!m_testIsPending);
+
+    m_testIsPending = true;
+
+    // Create a watchdog thread which just sets a timer and
+    // kills the process if it times out.  This catches really
+    // bad hangs where the shell isn't coming back to the
+    // message loop.  If the watchdog is what catches a
+    // timeout, it can't do anything except terminate the test
+    // shell, which is unfortunate.
+    // Windows multiplies by 2.5, but that causes us to run for far, far too
+    // long. We use the passed value and let the scripts flag override
+    // the value as needed.
+    NSTimeInterval timeoutSeconds = layoutTestTimeoutForWatchDog() / 1000;
+    WatchDogTarget* watchdog = [[[WatchDogTarget alloc]
+                                    initWithTimeout:timeoutSeconds] autorelease];
+    NSThread* thread = [[NSThread alloc] initWithTarget:watchdog
+                                         selector:@selector(run:)
+                                         object:nil];
+    [thread start];
+
+    // TestFinished() will post a quit message to break this loop when the page
+    // finishes loading.
+    while (m_testIsPending)
+        webkit_support::RunMessageLoop();
+
+    // Tell the watchdog that we're finished. No point waiting to re-join, it'll
+    // die on its own.
+    [thread cancel];
+    [thread release];
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
new file mode 100644
index 0000000..2d806a2
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
@@ -0,0 +1,100 @@
+/*
+ * 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 "TestShell.h"
+
+#include "webkit/support/webkit_support.h"
+#include <process.h>
+
+// Default timeout in ms for file page loads when in layout test mode.
+const int kDefaultFileTestTimeoutMillisecs = 10 * 1000;
+const int kDefaultWatchDogTimeoutMillisecs = kDefaultFileTestTimeoutMillisecs + 1 * 1000;
+
+// Thread main to run for the thread which just tests for timeout.
+unsigned int __stdcall watchDogThread(void *arg)
+{
+    // If we're debugging a layout test, don't timeout.
+    if (::IsDebuggerPresent())
+    return 0;
+
+    TestShell* shell = static_cast<TestShell*>(arg);
+    // FIXME: Do we need user-specified time settings as with the original
+    // Chromium implementation?
+    DWORD timeout = static_cast<DWORD>(kDefaultWatchDogTimeoutMillisecs);
+    DWORD rv = WaitForSingleObject(shell->finishedEvent(), timeout);
+    if (rv == WAIT_TIMEOUT) {
+        // Print a warning to be caught by the layout-test script.
+        // Note: the layout test driver may or may not recognize
+        // this as a timeout.
+        puts("#TEST_TIMED_OUT\n");
+        puts("#EOF\n");
+        fflush(stdout);
+        TerminateProcess(GetCurrentProcess(), 0);
+    }
+    // Finished normally.
+    return 0;
+}
+
+void TestShell::waitTestFinished()
+{
+    DCHECK(!m_testIsPending) << "cannot be used recursively";
+
+    m_testIsPending = true;
+
+    // Create a watchdog thread which just sets a timer and
+    // kills the process if it times out.  This catches really
+    // bad hangs where the shell isn't coming back to the
+    // message loop.  If the watchdog is what catches a
+    // timeout, it can't do anything except terminate the test
+    // shell, which is unfortunate.
+    m_finishedEvent = CreateEvent(0, TRUE, FALSE, 0);
+    DCHECK(m_finishedEvent);
+
+    HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(
+                                                       0,
+                                                       0,
+                                                       &watchDogThread,
+                                                       this,
+                                                       0,
+                                                       0));
+    DCHECK(threadHandle);
+
+    // TestFinished() will post a quit message to break this loop when the page
+    // finishes loading.
+    while (m_testIsPending)
+        webkit_support::RunMessageLoop();
+
+    // Tell the watchdog that we are finished.
+    SetEvent(m_finishedEvent);
+
+    // Wait to join the watchdog thread.  (up to 1s, then quit)
+    WaitForSingleObject(threadHandle, 1000);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h b/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h
new file mode 100644
index 0000000..899514e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h
@@ -0,0 +1,88 @@
+/*
+ * 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 TestWebWorker_h
+#define TestWebWorker_h
+
+#include "public/WebMessagePortChannel.h"
+#include "public/WebWorker.h"
+#include "public/WebWorkerClient.h"
+#include <wtf/RefCounted.h>
+
+namespace WebKit {
+class WebNotificationPresenter;
+class WebString;
+class WebURL;
+}
+
+class TestWebWorker : public WebKit::WebWorker,
+                      public WebKit::WebWorkerClient,
+                      public WTF::RefCounted<TestWebWorker> {
+public:
+    TestWebWorker()
+    {
+        ref();
+        // The initial counter value should be 2. One for a worker object,
+        // another for a worker context object. We need to call ref() just once
+        // because the default counter value of RefCounted is 1.
+    }
+
+    // WebWorker methods:
+    virtual void startWorkerContext(const WebKit::WebURL&, const WebKit::WebString&, const WebKit::WebString&) {}
+    virtual void terminateWorkerContext() {}
+    virtual void postMessageToWorkerContext(const WebKit::WebString&, const WebKit::WebMessagePortChannelArray&) {}
+    virtual void workerObjectDestroyed()
+    {
+        // Releases the reference held for worker object.
+        deref();
+    }
+    virtual void clientDestroyed() {}
+
+    // WebWorkerClient methods:
+    virtual void postMessageToWorkerObject(const WebKit::WebString&, const WebKit::WebMessagePortChannelArray&) {}
+    virtual void postExceptionToWorkerObject(const WebKit::WebString&, int, const WebKit::WebString&) {}
+    virtual void postConsoleMessageToWorkerObject(int, int, int, int, const WebKit::WebString&, int, const WebKit::WebString&) {}
+    virtual void confirmMessageFromWorkerObject(bool) {}
+    virtual void reportPendingActivity(bool) {}
+    virtual void workerContextClosed() {}
+    virtual void workerContextDestroyed()
+    {
+        // Releases the reference held for worker context object.
+        deref();
+    }
+    virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient*) { return 0; }
+    virtual WebKit::WebNotificationPresenter* notificationPresenter() { return 0; }
+
+private:
+    ~TestWebWorker() {}
+    friend class WTF::RefCounted<TestWebWorker>;
+};
+
+#endif // TestWebWorker_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
new file mode 100644
index 0000000..63c4719
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -0,0 +1,216 @@
+/*
+ * 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 "TextInputController.h"
+
+#include "TestShell.h"
+#include "public/WebFrame.h"
+#include "public/WebRange.h"
+#include "public/WebString.h"
+#include "public/WebView.h"
+#include <wtf/StringExtras.h>
+#include <string>
+
+using namespace WebKit;
+using namespace std;
+
+TestShell* TextInputController::testShell = 0;
+
+TextInputController::TextInputController(TestShell* shell)
+{
+    // Set static testShell variable. Be careful not to assign testShell to new
+    // windows which are temporary.
+    if (!testShell)
+        testShell = shell;
+
+    bindMethod("insertText", &TextInputController::insertText);
+    bindMethod("doCommand", &TextInputController::doCommand);
+    bindMethod("setMarkedText", &TextInputController::setMarkedText);
+    bindMethod("unmarkText", &TextInputController::unmarkText);
+    bindMethod("hasMarkedText", &TextInputController::hasMarkedText);
+    bindMethod("conversationIdentifier", &TextInputController::conversationIdentifier);
+    bindMethod("substringFromRange", &TextInputController::substringFromRange);
+    bindMethod("attributedSubstringFromRange", &TextInputController::attributedSubstringFromRange);
+    bindMethod("markedRange", &TextInputController::markedRange);
+    bindMethod("selectedRange", &TextInputController::selectedRange);
+    bindMethod("firstRectForCharacterRange", &TextInputController::firstRectForCharacterRange);
+    bindMethod("characterIndexForPoint", &TextInputController::characterIndexForPoint);
+    bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
+    bindMethod("makeAttributedString", &TextInputController::makeAttributedString);
+}
+
+WebFrame* TextInputController::getMainFrame()
+{
+    return testShell->webView()->mainFrame();
+}
+
+void TextInputController::insertText(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+    if (arguments.size() < 1 || !arguments[0].isString())
+        return;
+
+    if (mainFrame->hasMarkedText()) {
+        mainFrame->unmarkText();
+        mainFrame->replaceSelection(WebString());
+    }
+    mainFrame->insertText(WebString::fromUTF8(arguments[0].toString()));
+}
+
+void TextInputController::doCommand(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    if (arguments.size() >= 1 && arguments[0].isString())
+        mainFrame->executeCommand(WebString::fromUTF8(arguments[0].toString()));
+}
+
+void TextInputController::setMarkedText(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    if (arguments.size() >= 3 && arguments[0].isString()
+        && arguments[1].isNumber() && arguments[2].isNumber()) {
+        mainFrame->setMarkedText(WebString::fromUTF8(arguments[0].toString()),
+                                 arguments[1].toInt32(),
+                                 arguments[2].toInt32());
+    }
+}
+
+void TextInputController::unmarkText(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    mainFrame->unmarkText();
+}
+
+void TextInputController::hasMarkedText(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    result->set(mainFrame->hasMarkedText());
+}
+
+void TextInputController::conversationIdentifier(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void TextInputController::substringFromRange(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void TextInputController::attributedSubstringFromRange(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void TextInputController::markedRange(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    WebRange range = mainFrame->markedRange();
+    char buffer[30];
+    snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset());
+    result->set(string(buffer));
+}
+
+void TextInputController::selectedRange(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    WebRange range = mainFrame->selectionRange();
+    char buffer[30];
+    snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset());
+    result->set(string(buffer));
+}
+
+void TextInputController::firstRectForCharacterRange(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void TextInputController::characterIndexForPoint(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
+
+void TextInputController::validAttributesForMarkedText(const CppArgumentList&, CppVariant* result)
+{
+    result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    result->set("NSUnderline,NSUnderlineColor,NSMarkedClauseSegment,"
+                "NSTextInputReplacementRangeAttributeName");
+}
+
+void TextInputController::makeAttributedString(const CppArgumentList&, CppVariant* result)
+{
+    // FIXME: Implement this.
+    result->setNull();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
new file mode 100644
index 0000000..a912ba1
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+<<<<<<< HEAD:WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
+#include "config.h"
+#include "V8Navigator.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "V8DOMWindow.h"
+#include "V8DOMWrapper.h"
+
+#if PLATFORM(ANDROID)
+#include "ExceptionCode.h"
+#include "V8CustomApplicationInstalledCallback.h"
+#include "V8Proxy.h"
+#endif
+
+namespace WebCore {
+
+v8::Handle<v8::Value> toV8(Navigator* impl)
+{
+    if (!impl)
+        return v8::Null();
+    v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+    if (wrapper.IsEmpty()) {
+        wrapper = V8Navigator::wrap(impl);
+        if (!wrapper.IsEmpty())
+            V8DOMWrapper::setHiddenWindowReference(impl->frame(), V8DOMWindow::navigatorIndex, wrapper);
+    }
+    return wrapper;
+}
+
+#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
+
+static PassRefPtr<ApplicationInstalledCallback> createApplicationInstalledCallback(
+        v8::Local<v8::Value> value, bool& succeeded)
+{
+    succeeded = true;
+
+    if (!value->IsFunction()) {
+        succeeded = false;
+        throwError("The second argument should be a function");
+        return 0;
+    }
+
+    Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+    return V8CustomApplicationInstalledCallback::create(value, frame);
+}
+
+v8::Handle<v8::Value> V8Navigator::isApplicationInstalledCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.isApplicationInstalled()");
+    bool succeeded = false;
+
+    if (args.Length() < 2)
+        return throwError("Two arguments required: an application name and a callback.", V8Proxy::SyntaxError);
+
+    if (!args[0]->IsString())
+        return throwError("The first argument should be a string.");
+
+    RefPtr<ApplicationInstalledCallback> callback =
+        createApplicationInstalledCallback(args[1], succeeded);
+    if (!succeeded)
+        return v8::Undefined();
+
+    ASSERT(callback);
+
+    Navigator* navigator = V8Navigator::toNative(args.Holder());
+    if (!navigator->isApplicationInstalled(toWebCoreString(args[0]), callback.release()))
+        return throwError(INVALID_STATE_ERR);
+
+    return v8::Undefined();
+}
+
+#endif // PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
+
+} // namespace WebCore
+=======
+// TextInputController is bound to window.textInputController in Javascript
+// when DRT is running. Layout tests use it to exercise various corners of
+// text input.
+
+#ifndef TextInputController_h
+#define TextInputController_h
+
+#include "CppBoundClass.h"
+
+class TestShell;
+
+namespace WebKit {
+class WebFrame;
+}
+
+class TextInputController : public CppBoundClass {
+public:
+    TextInputController(TestShell*);
+
+    void insertText(const CppArgumentList&, CppVariant*);
+    void doCommand(const CppArgumentList&, CppVariant*);
+    void setMarkedText(const CppArgumentList&, CppVariant*);
+    void unmarkText(const CppArgumentList&, CppVariant*);
+    void hasMarkedText(const CppArgumentList&, CppVariant*);
+    void conversationIdentifier(const CppArgumentList&, CppVariant*);
+    void substringFromRange(const CppArgumentList&, CppVariant*);
+    void attributedSubstringFromRange(const CppArgumentList&, CppVariant*);
+    void markedRange(const CppArgumentList&, CppVariant*);
+    void selectedRange(const CppArgumentList&, CppVariant*);
+    void firstRectForCharacterRange(const CppArgumentList&, CppVariant*);
+    void characterIndexForPoint(const CppArgumentList&, CppVariant*);
+    void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
+    void makeAttributedString(const CppArgumentList&, CppVariant*);
+
+private:
+    // Returns the test shell's main WebFrame.
+    static WebKit::WebFrame* getMainFrame();
+
+    // Non-owning pointer. The TextInputController is owned by the TestShell.
+    static TestShell* testShell;
+};
+
+#endif // TextInputController_h
+>>>>>>> webkit.org at r58033:WebKitTools/DumpRenderTree/chromium/TextInputController.h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
new file mode 100644
index 0000000..95b1c7e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -0,0 +1,1316 @@
+/*
+ * 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 "WebViewHost.h"
+
+#include "LayoutTestController.h"
+#include "TestNavigationController.h"
+#include "TestShell.h"
+#include "TestWebWorker.h"
+#include "net/base/net_errors.h" // FIXME: can we remove this?
+#include "public/WebCString.h"
+#include "public/WebConsoleMessage.h"
+#include "public/WebContextMenuData.h"
+#include "public/WebDataSource.h"
+#include "public/WebDragData.h"
+#include "public/WebFrame.h"
+#include "public/WebHistoryItem.h"
+#include "public/WebNode.h"
+#include "public/WebRange.h"
+#include "public/WebRect.h"
+#include "public/WebScreenInfo.h"
+#include "public/WebSize.h"
+#include "public/WebStorageNamespace.h"
+#include "public/WebURLRequest.h"
+#include "public/WebURLResponse.h"
+#include "public/WebView.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/support/webkit_support.h"
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+using namespace skia;
+using namespace std;
+
+static const int screenWidth = 1920;
+static const int screenHeight = 1080;
+static const int screenUnavailableBorder = 8;
+
+// WebNavigationType debugging strings taken from PolicyDelegate.mm.
+static const char* linkClickedString = "link clicked";
+static const char* formSubmittedString = "form submitted";
+static const char* backForwardString = "back/forward";
+static const char* reloadString = "reload";
+static const char* formResubmittedString = "form resubmitted";
+static const char* otherString = "other";
+static const char* illegalString = "illegal value";
+
+static int nextPageID = 1;
+
+// Used to write a platform neutral file:/// URL by only taking the filename
+// (e.g., converts "file:///tmp/foo.txt" to just "foo.txt").
+static string urlSuitableForTestResult(const string& url)
+{
+    if (url.empty() || string::npos == url.find("file://"))
+        return url;
+
+    size_t pos = url.rfind('/');
+    if (pos == string::npos) {
+#if OS(WINDOWS)
+        pos = url.rfind('\\');
+        if (pos == string::npos)
+            pos = 0;
+#else
+        pos = 0;
+#endif
+    }
+    string filename = url.substr(pos + 1);
+    if (filename.empty())
+        return "file:"; // A WebKit test has this in its expected output.
+    return filename;
+}
+
+// Used to write a platform neutral file:/// URL by taking the
+// filename and its directory. (e.g., converts
+// "file:///tmp/foo/bar.txt" to just "bar.txt").
+static string descriptionSuitableForTestResult(const string& url)
+{
+    if (url.empty() || string::npos == url.find("file://"))
+        return url;
+
+    size_t pos = url.rfind('/');
+    if (pos == string::npos || !pos)
+        return "ERROR:" + url;
+    pos = url.rfind('/', pos - 1);
+    if (pos == string::npos)
+        return "ERROR:" + url;
+
+    return url.substr(pos + 1);
+}
+
+// Adds a file called "DRTFakeFile" to |data_object| (CF_HDROP).  Use to fake
+// dragging a file.
+static void addDRTFakeFileToDataObject(WebDragData* dragData)
+{
+    dragData->appendToFileNames(WebString::fromUTF8("DRTFakeFile"));
+}
+
+// Get a debugging string from a WebNavigationType.
+static const char* webNavigationTypeToString(WebNavigationType type)
+{
+    switch (type) {
+    case WebKit::WebNavigationTypeLinkClicked:
+        return linkClickedString;
+    case WebKit::WebNavigationTypeFormSubmitted:
+        return formSubmittedString;
+    case WebKit::WebNavigationTypeBackForward:
+        return backForwardString;
+    case WebKit::WebNavigationTypeReload:
+        return reloadString;
+    case WebKit::WebNavigationTypeFormResubmitted:
+        return formResubmittedString;
+    case WebKit::WebNavigationTypeOther:
+        return otherString;
+    }
+    return illegalString;
+}
+
+static string URLDescription(const GURL& url)
+{
+    if (url.SchemeIs("file"))
+        return url.ExtractFileName();
+    return url.possibly_invalid_spec();
+}
+
+static void printResponseDescription(const WebURLResponse& response)
+{
+    if (response.isNull()) {
+        fputs("(null)", stdout);
+        return;
+    }
+    string url = response.url().spec();
+    printf("<NSURLResponse %s, http status code %d>",
+           descriptionSuitableForTestResult(url).c_str(),
+           response.httpStatusCode());
+}
+
+static void printErrorDescription(const WebURLError& error)
+{
+    string domain = error.domain.utf8();
+    int code = error.reason;
+
+    if (domain == net::kErrorDomain) {
+        domain = "NSURLErrorDomain";
+        switch (error.reason) {
+        case net::ERR_ABORTED:
+            code = -999;
+            break;
+        case net::ERR_UNSAFE_PORT:
+            // Our unsafe port checking happens at the network stack level, but we
+            // make this translation here to match the behavior of stock WebKit.
+            domain = "WebKitErrorDomain";
+            code = 103;
+            break;
+        case net::ERR_ADDRESS_INVALID:
+        case net::ERR_ADDRESS_UNREACHABLE:
+            code = -1004;
+            break;
+        }
+    } else
+        LOG_ERROR("Unknown error domain");
+
+    printf("<NSError domain %s, code %d, failing URL \"%s\">",
+           domain.c_str(), code, error.unreachableURL.spec().data());
+}
+
+static void printNodeDescription(const WebNode& node, int exception)
+{
+    if (exception) {
+        fputs("ERROR", stdout);
+        return;
+    }
+    if (node.isNull()) {
+        fputs("(null)", stdout);
+        return;
+    }
+    fputs(node.nodeName().utf8().data(), stdout);
+    const WebNode& parent = node.parentNode();
+    if (!parent.isNull()) {
+        fputs(" > ", stdout);
+        printNodeDescription(parent, 0);
+    }
+}
+
+static void printRangeDescription(const WebRange& range)
+{
+    if (range.isNull()) {
+        fputs("(null)", stdout);
+        return;
+    }
+    printf("range from %d of ", range.startOffset());
+    int exception = 0;
+    WebNode startNode = range.startContainer(exception);
+    printNodeDescription(startNode, exception);
+    printf(" to %d of ", range.endOffset());
+    WebNode endNode = range.endContainer(exception);
+    printNodeDescription(endNode, exception);
+}
+
+static string editingActionDescription(WebEditingAction action)
+{
+    switch (action) {
+    case WebKit::WebEditingActionTyped:
+        return "WebViewInsertActionTyped";
+    case WebKit::WebEditingActionPasted:
+        return "WebViewInsertActionPasted";
+    case WebKit::WebEditingActionDropped:
+        return "WebViewInsertActionDropped";
+    }
+    return "(UNKNOWN ACTION)";
+}
+
+static string textAffinityDescription(WebTextAffinity affinity)
+{
+    switch (affinity) {
+    case WebKit::WebTextAffinityUpstream:
+        return "NSSelectionAffinityUpstream";
+    case WebKit::WebTextAffinityDownstream:
+        return "NSSelectionAffinityDownstream";
+    }
+    return "(UNKNOWN AFFINITY)";
+}
+
+// WebViewClient -------------------------------------------------------------
+
+WebView* WebViewHost::createView(WebFrame*)
+{
+    if (!layoutTestController()->canOpenWindows())
+        return 0;
+    return m_shell->createWebView()->webView();
+}
+
+WebWidget* WebViewHost::createPopupMenu(bool)
+{
+    return 0;
+}
+
+WebWidget* WebViewHost::createPopupMenu(const WebPopupMenuInfo&)
+{
+    return 0;
+}
+
+WebStorageNamespace* WebViewHost::createSessionStorageNamespace()
+{
+    return WebKit::WebStorageNamespace::createSessionStorageNamespace();
+}
+
+void WebViewHost::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine)
+{
+    // This matches win DumpRenderTree's UIDelegate.cpp.
+    string newMessage;
+    if (!message.text.isEmpty()) {
+        newMessage = message.text.utf8();
+        size_t fileProtocol = newMessage.find("file://");
+        if (fileProtocol != string::npos) {
+            newMessage = newMessage.substr(0, fileProtocol)
+                + urlSuitableForTestResult(newMessage.substr(fileProtocol));
+        }
+    }
+    printf("CONSOLE MESSAGE: line %d: %s\n", sourceLine, newMessage.data());
+}
+
+void WebViewHost::didStartLoading()
+{
+    m_shell->setIsLoading(true);
+}
+
+void WebViewHost::didStopLoading()
+{
+    m_shell->setIsLoading(false);
+}
+
+// The output from these methods in layout test mode should match that
+// expected by the layout tests.  See EditingDelegate.m in DumpRenderTree.
+
+bool WebViewHost::shouldBeginEditing(const WebRange& range)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout);
+        printRangeDescription(range);
+        fputs("\n", stdout);
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldEndEditing(const WebRange& range)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout);
+        printRangeDescription(range);
+        fputs("\n", stdout);
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        fputs("EDITING DELEGATE: shouldInsertNode:", stdout);
+        printNodeDescription(node, 0);
+        fputs(" replacingDOMRange:", stdout);
+        printRangeDescription(range);
+        printf(" givenAction:%s\n", editingActionDescription(action).c_str());
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data());
+        printRangeDescription(range);
+        printf(" givenAction:%s\n", editingActionDescription(action).c_str());
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldChangeSelectedRange(
+    const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout);
+        printRangeDescription(fromRange);
+        fputs(" toDOMRange:", stdout);
+        printRangeDescription(toRange);
+        printf(" affinity:%s stillSelecting:%s\n",
+               textAffinityDescription(affinity).c_str(),
+               (stillSelecting ? "TRUE" : "FALSE"));
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldDeleteRange(const WebRange& range)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout);
+        printRangeDescription(range);
+        fputs("\n", stdout);
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks()) {
+        printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data());
+        printRangeDescription(range);
+        fputs("\n", stdout);
+    }
+    return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::isSmartInsertDeleteEnabled()
+{
+    return m_smartInsertDeleteEnabled;
+}
+
+bool WebViewHost::isSelectTrailingWhitespaceEnabled()
+{
+    return m_selectTrailingWhitespaceEnabled;
+}
+
+void WebViewHost::didBeginEditing()
+{
+    if (!layoutTestController()->shouldDumpEditingCallbacks())
+        return;
+    fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout);
+}
+
+void WebViewHost::didChangeSelection(bool isEmptySelection)
+{
+    if (layoutTestController()->shouldDumpEditingCallbacks())
+        fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout);
+    // No need to update clipboard with the selected text in DRT.
+}
+
+void WebViewHost::didChangeContents()
+{
+    if (!layoutTestController()->shouldDumpEditingCallbacks())
+        return;
+    fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout);
+}
+
+void WebViewHost::didEndEditing()
+{
+    if (!layoutTestController()->shouldDumpEditingCallbacks())
+        return;
+    fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout);
+}
+
+bool WebViewHost::handleCurrentKeyboardEvent()
+{
+    if (m_editCommandName.empty())
+        return false;
+    WebFrame* frame = webView()->focusedFrame();
+    if (!frame)
+        return false;
+
+    return frame->executeCommand(WebString::fromUTF8(m_editCommandName), WebString::fromUTF8(m_editCommandValue));
+}
+
+void WebViewHost::spellCheck(const WebString& text, int& misspelledOffset, int& misspelledLength)
+{
+    // Check the spelling of the given text.
+#if OS(MAC_OS_X)
+    // FIXME: rebaseline layout-test results of Windows and Linux so we
+    // can enable this mock spellchecker on them.
+    m_spellcheck.spellCheckWord(text, &misspelledOffset, &misspelledLength);
+#endif
+}
+
+WebString WebViewHost::autoCorrectWord(const WebString&)
+{
+    // Returns an empty string as Mac WebKit ('WebKitSupport/WebEditorClient.mm')
+    // does. (If this function returns a non-empty string, WebKit replaces the
+    // given misspelled string with the result one. This process executes some
+    // editor commands and causes layout-test failures.)
+    return WebString();
+}
+
+void WebViewHost::runModalAlertDialog(WebFrame*, const WebString& message)
+{
+    printf("ALERT: %s\n", message.utf8().data());
+}
+
+bool WebViewHost::runModalConfirmDialog(WebFrame*, const WebString& message)
+{
+    printf("CONFIRM: %s\n", message.utf8().data());
+    return true;
+}
+
+bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message,
+                                       const WebString& defaultValue, WebString*)
+{
+    printf("PROMPT: %s, default text: %s\n", message.utf8().data(), defaultValue.utf8().data());
+    return true;
+}
+
+bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString&)
+{
+    return true; // Allow window closure.
+}
+
+void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData&)
+{
+}
+
+
+void WebViewHost::setStatusText(const WebString& text)
+{
+    if (!layoutTestController()->shouldDumpStatusCallbacks())
+        return;
+    // When running tests, write to stdout.
+    printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());
+}
+
+void WebViewHost::startDragging(const WebPoint& mouseCoords, const WebDragData& data, WebDragOperationsMask mask)
+{
+    WebDragData mutableDragData = data;
+    if (layoutTestController()->shouldAddFileToPasteboard()) {
+        // Add a file called DRTFakeFile to the drag&drop clipboard.
+        addDRTFakeFileToDataObject(&mutableDragData);
+    }
+
+    // When running a test, we need to fake a drag drop operation otherwise
+    // Windows waits for real mouse events to know when the drag is over.
+    EventSender::doDragDrop(mouseCoords, mutableDragData, mask);
+}
+
+void WebViewHost::navigateBackForwardSoon(int offset)
+{
+    navigationController()->goToOffset(offset);
+}
+
+int WebViewHost::historyBackListCount()
+{
+    return navigationController()->lastCommittedEntryIndex();
+}
+
+int WebViewHost::historyForwardListCount()
+{
+    int currentIndex =navigationController()->lastCommittedEntryIndex();
+    return navigationController()->entryCount() - currentIndex - 1;
+}
+
+void WebViewHost::focusAccessibilityObject(const WebAccessibilityObject& object)
+{
+    m_shell->accessibilityController()->setFocusedElement(object);
+}
+
+// WebWidgetClient -----------------------------------------------------------
+
+void WebViewHost::didInvalidateRect(const WebRect& rect)
+{
+    if (m_isPainting)
+        LOG_ERROR("unexpected invalidation while painting");
+    updatePaintRect(rect);
+}
+
+void WebViewHost::didScrollRect(int, int, const WebRect& clipRect)
+{
+    // This is used for optimizing painting when the renderer is scrolled. We're
+    // currently not doing any optimizations so just invalidate the region.
+    didInvalidateRect(clipRect);
+}
+
+void WebViewHost::didFocus()
+{
+    m_shell->setFocus(webWidget(), true);
+}
+
+void WebViewHost::didBlur()
+{
+    m_shell->setFocus(webWidget(), false);
+}
+
+WebScreenInfo WebViewHost::screenInfo()
+{
+    // We don't need to set actual values.
+    WebScreenInfo info;
+    info.depth = 24;
+    info.depthPerComponent = 8;
+    info.isMonochrome = false;
+    info.rect = WebRect(0, 0, screenWidth, screenHeight);
+    // Use values different from info.rect for testing.
+    info.availableRect = WebRect(screenUnavailableBorder, screenUnavailableBorder,
+                                 screenWidth - screenUnavailableBorder * 2,
+                                 screenHeight - screenUnavailableBorder * 2);
+    return info;
+}
+
+void WebViewHost::show(WebNavigationPolicy)
+{
+    m_hasWindow = true;
+    WebSize size = webWidget()->size();
+    updatePaintRect(WebRect(0, 0, size.width, size.height));
+}
+
+void WebViewHost::closeWidgetSoon()
+{
+    m_hasWindow = false;
+    m_shell->closeWindow(this);
+}
+
+void WebViewHost::didChangeCursor(const WebCursorInfo& cursorInfo)
+{
+    if (!hasWindow())
+        return;
+    m_currentCursor = cursorInfo;
+}
+
+WebRect WebViewHost::windowRect()
+{
+    return m_windowRect;
+}
+
+void WebViewHost::setWindowRect(const WebRect& rect)
+{
+    m_windowRect = rect;
+    const int border2 = TestShell::virtualWindowBorder * 2;
+    if (m_windowRect.width <= border2)
+        m_windowRect.width = 1 + border2;
+    if (m_windowRect.height <= border2)
+        m_windowRect.height = 1 + border2;
+    int width = m_windowRect.width - border2;
+    int height = m_windowRect.height - border2;
+    discardBackingStore();
+    webWidget()->resize(WebSize(width, height));
+    updatePaintRect(WebRect(0, 0, width, height));
+}
+
+WebRect WebViewHost::rootWindowRect()
+{
+    return windowRect();
+}
+
+WebRect WebViewHost::windowResizerRect()
+{
+    // Not necessary.
+    return WebRect();
+}
+
+void WebViewHost::runModal()
+{
+    // FIXME: Should we implement this in DRT?
+}
+
+// WebFrameClient ------------------------------------------------------------
+
+WebPlugin* WebViewHost::createPlugin(WebFrame* frame, const WebPluginParams& params)
+{
+    return webkit_support::CreateWebPlugin(frame, params);
+}
+
+WebWorker* WebViewHost::createWorker(WebFrame*, WebWorkerClient*)
+{
+    return new TestWebWorker();
+}
+
+WebMediaPlayer* WebViewHost::createMediaPlayer(WebFrame* frame, WebMediaPlayerClient* client)
+{
+    return webkit_support::CreateMediaPlayer(frame, client);
+}
+
+bool WebViewHost::allowPlugins(WebFrame* frame, bool enabledPerSettings)
+{
+    return enabledPerSettings;
+}
+
+bool WebViewHost::allowImages(WebFrame* frame, bool enabledPerSettings)
+{
+    return enabledPerSettings;
+}
+
+void WebViewHost::loadURLExternally(WebFrame*, const WebURLRequest& request, WebNavigationPolicy policy)
+{
+    ASSERT(policy !=  WebKit::WebNavigationPolicyCurrentTab);
+    WebViewHost* another = m_shell->createNewWindow(request.url());
+    if (another)
+        another->show(policy);
+}
+
+WebNavigationPolicy WebViewHost::decidePolicyForNavigation(
+    WebFrame*, const WebURLRequest& request,
+    WebNavigationType type, const WebNode& originatingNode,
+    WebNavigationPolicy defaultPolicy, bool isRedirect)
+{
+    WebNavigationPolicy result;
+    if (!m_policyDelegateEnabled)
+        return defaultPolicy;
+
+    printf("Policy delegate: attempt to load %s with navigation type '%s'",
+           URLDescription(request.url()).c_str(), webNavigationTypeToString(type));
+    if (!originatingNode.isNull()) {
+        fputs(" originating from ", stdout);
+        printNodeDescription(originatingNode, 0);
+    }
+    fputs("\n", stdout);
+    if (m_policyDelegateIsPermissive)
+        result = WebKit::WebNavigationPolicyCurrentTab;
+    else
+        result = WebKit::WebNavigationPolicyIgnore;
+
+    if (m_policyDelegateShouldNotifyDone)
+        layoutTestController()->policyDelegateDone();
+    return result;
+}
+
+bool WebViewHost::canHandleRequest(WebFrame*, const WebURLRequest& request)
+{
+    GURL url = request.url();
+    // Just reject the scheme used in
+    // LayoutTests/http/tests/misc/redirect-to-external-url.html
+    return !url.SchemeIs("spaceballs");
+}
+
+WebURLError WebViewHost::cannotHandleRequestError(WebFrame*, const WebURLRequest& request)
+{
+    WebURLError error;
+    // A WebKit layout test expects the following values.
+    // unableToImplementPolicyWithError() below prints them.
+    error.domain = WebString::fromUTF8("WebKitErrorDomain");
+    error.reason = 101;
+    error.unreachableURL = request.url();
+    return error;
+}
+
+WebURLError WebViewHost::cancelledError(WebFrame*, const WebURLRequest& request)
+{
+    WebURLError error;
+    error.domain = WebString::fromUTF8(net::kErrorDomain);
+    error.reason = net::ERR_ABORTED;
+    error.unreachableURL = request.url();
+    return error;
+}
+
+void WebViewHost::unableToImplementPolicyWithError(WebFrame* frame, const WebURLError& error)
+{
+    printf("Policy delegate: unable to implement policy with error domain '%s', "
+           "error code %d, in frame '%s'\n",
+           error.domain.utf8().data(), error.reason, frame->name().utf8().data());
+}
+
+void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,
+                                            double interval, double fire_time)
+{
+    if (!m_shell->shouldDumpFrameLoadCallbacks())
+        return;
+    printFrameDescription(frame);
+    printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());
+}
+
+void WebViewHost::didCancelClientRedirect(WebFrame* frame)
+{
+    if (!m_shell->shouldDumpFrameLoadCallbacks())
+        return;
+    printFrameDescription(frame);
+    fputs(" - didCancelClientRedirectForFrame\n", stdout);
+}
+
+void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
+{
+    ds->setExtraData(m_pendingExtraData.release());
+}
+
+void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didStartProvisionalLoadForFrame\n", stdout);
+    }
+
+    if (!m_topLoadingFrame)
+        m_topLoadingFrame = frame;
+
+    if (layoutTestController()->stopProvisionalFrameLoads()) {
+        printFrameDescription(frame);
+        fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);
+        frame->stopLoading();
+    }
+    updateAddressBar(frame->view());
+}
+
+void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didReceiveServerRedirectForProvisionalLoadForFrame\n", stdout);
+    }
+    updateAddressBar(frame->view());
+}
+
+void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& error)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didFailProvisionalLoadWithError\n", stdout);
+    }
+
+    locationChangeDone(frame);
+
+    // Don't display an error page if we're running layout tests, because
+    // DumpRenderTree doesn't.
+}
+
+void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didCommitLoadForFrame\n", stdout);
+    }
+    updateForCommittedLoad(frame, isNewNavigation);
+}
+
+void WebViewHost::didClearWindowObject(WebFrame* frame)
+{
+    m_shell->bindJSObjectsToWindow(frame);
+}
+
+void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title)
+{
+    WebCString title8 = title.utf8();
+
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        printf(" - didReceiveTitle: %s\n", title8.data());
+    }
+
+    if (layoutTestController()->shouldDumpTitleChanges())
+        printf("TITLE CHANGED: %s\n", title8.data());
+
+    setPageTitle(title);
+}
+
+void WebViewHost::didFinishDocumentLoad(WebFrame* frame)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didFinishDocumentLoadForFrame\n", stdout);
+    } else {
+        unsigned pendingUnloadEvents = frame->unloadListenerCount();
+        if (pendingUnloadEvents) {
+            printFrameDescription(frame);
+            printf(" - has %u onunload handler(s)\n", pendingUnloadEvents);
+        }
+    }
+}
+
+void WebViewHost::didHandleOnloadEvents(WebFrame* frame)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didHandleOnloadEventsForFrame\n", stdout);
+    }
+}
+
+void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didFailLoadWithError\n", stdout);
+    }
+    locationChangeDone(frame);
+}
+
+void WebViewHost::didFinishLoad(WebFrame* frame)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didFinishLoadForFrame\n", stdout);
+    }
+    updateAddressBar(frame->view());
+    locationChangeDone(frame);
+}
+
+void WebViewHost::didChangeLocationWithinPage(WebFrame* frame, bool isNewNavigation)
+{
+    frame->dataSource()->setExtraData(m_pendingExtraData.release());
+    if (m_shell->shouldDumpFrameLoadCallbacks()) {
+        printFrameDescription(frame);
+        fputs(" - didChangeLocationWithinPageForFrame\n", stdout);
+    }
+    updateForCommittedLoad(frame, isNewNavigation);
+}
+
+void WebViewHost::assignIdentifierToRequest(WebFrame*, unsigned identifier, const WebURLRequest& request)
+{
+    if (!m_shell->shouldDumpResourceLoadCallbacks())
+        return;
+    m_resourceIdentifierMap.set(identifier, descriptionSuitableForTestResult(request.url().spec()));
+}
+
+void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest& request, const WebURLResponse& redirectResponse)
+{
+    // Need to use GURL for host() and SchemeIs()
+    GURL url = request.url();
+    string requestURL = url.possibly_invalid_spec();
+
+    if (layoutTestController()->shouldDumpResourceLoadCallbacks()) {
+        GURL mainDocumentURL = request.firstPartyForCookies();
+        printResourceDescription(identifier);
+        printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s,"
+               " http method %s> redirectResponse %s\n",
+               descriptionSuitableForTestResult(requestURL).c_str(),
+               URLDescription(mainDocumentURL).c_str(),
+               request.httpMethod().utf8().data());
+        printResponseDescription(redirectResponse);
+        fputs("\n", stdout);
+    }
+
+    if (!redirectResponse.isNull() && m_blocksRedirects) {
+        fputs("Returning null for this redirect\n", stdout);
+        // To block the request, we set its URL to an empty one.
+        request.setURL(WebURL());
+        return;
+    }
+
+    if (m_requestReturnNull) {
+        // To block the request, we set its URL to an empty one.
+        request.setURL(WebURL());
+        return;
+    }
+
+    string host = url.host();
+    // 255.255.255.255 is used in some tests that expect to get back an error.
+    if (!host.empty() && (url.SchemeIs("http") || url.SchemeIs("https"))
+        && host != "127.0.0.1"
+        && host != "255.255.255.255"
+        && host != "localhost") {
+        printf("Blocked access to external URL %s\n", requestURL.c_str());
+
+        // To block the request, we set its URL to an empty one.
+        request.setURL(WebURL());
+        return;
+    }
+
+    // Set the new substituted URL.
+    request.setURL(webkit_support::RewriteLayoutTestsURL(request.url().spec()));
+}
+
+void WebViewHost::didReceiveResponse(WebFrame*, unsigned identifier, const WebURLResponse& response)
+{
+    if (!m_shell->shouldDumpResourceLoadCallbacks())
+        return;
+    printResourceDescription(identifier);
+    fputs(" - didReceiveResponse ", stdout);
+    printResponseDescription(response);
+    fputs("\n", stdout);
+}
+
+void WebViewHost::didFinishResourceLoad(WebFrame*, unsigned identifier)
+{
+    if (m_shell->shouldDumpResourceLoadCallbacks()) {
+        printResourceDescription(identifier);
+        fputs(" - didFinishLoading\n", stdout);
+    }
+    m_resourceIdentifierMap.remove(identifier);
+}
+
+void WebViewHost::didFailResourceLoad(WebFrame*, unsigned identifier, const WebURLError& error)
+{
+    if (m_shell->shouldDumpResourceLoadCallbacks()) {
+        printResourceDescription(identifier);
+        fputs(" - didFailLoadingWithError: ", stdout);
+        printErrorDescription(error);
+        fputs("\n", stdout);
+    }
+    m_resourceIdentifierMap.remove(identifier);
+}
+
+void WebViewHost::didDisplayInsecureContent(WebFrame*)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks())
+        fputs("didDisplayInsecureContent\n", stdout);
+}
+
+void WebViewHost::didRunInsecureContent(WebFrame*, const WebSecurityOrigin& origin)
+{
+    if (m_shell->shouldDumpFrameLoadCallbacks())
+        fputs("didRunInsecureContent\n", stdout);
+}
+
+bool WebViewHost::allowScript(WebFrame*, bool enabledPerSettings)
+{
+    return enabledPerSettings;
+}
+
+// Public functions -----------------------------------------------------------
+
+WebViewHost::WebViewHost(TestShell* shell)
+    : m_policyDelegateEnabled(false)
+    , m_policyDelegateIsPermissive(false)
+    , m_policyDelegateShouldNotifyDone(false)
+    , m_shell(shell)
+    , m_topLoadingFrame(0)
+    , m_hasWindow(false)
+    , m_pageId(-1)
+    , m_lastPageIdUpdated(-1)
+    , m_smartInsertDeleteEnabled(true)
+#if OS(WINDOWS)
+    , m_selectTrailingWhitespaceEnabled(true)
+#else
+    , m_selectTrailingWhitespaceEnabled(false)
+#endif
+    , m_blocksRedirects(false)
+    , m_requestReturnNull(false)
+    , m_isPainting(false)
+    , m_webWidget(0)
+{
+    m_navigationController.set(new TestNavigationController(this));
+}
+
+WebViewHost::~WebViewHost()
+{
+}
+
+WebView* WebViewHost::webView() const
+{
+    ASSERT(m_webWidget);
+    // DRT does not support popup widgets. So m_webWidget is always a WebView.
+    return static_cast<WebView*>(m_webWidget);
+}
+
+WebWidget* WebViewHost::webWidget() const
+{
+    ASSERT(m_webWidget);
+    return m_webWidget;
+}
+
+void WebViewHost::reset()
+{
+    // Do a little placement new dance...
+    TestShell* shell = m_shell;
+    WebWidget* widget = m_webWidget;
+    this->~WebViewHost();
+    new (this) WebViewHost(shell);
+    setWebWidget(widget);
+}
+
+void WebViewHost::setSelectTrailingWhitespaceEnabled(bool enabled)
+{
+    m_selectTrailingWhitespaceEnabled = enabled;
+    // In upstream WebKit, smart insert/delete is mutually exclusive with select
+    // trailing whitespace, however, we allow both because Chromium on Windows
+    // allows both.
+}
+
+void WebViewHost::setSmartInsertDeleteEnabled(bool enabled)
+{
+    m_smartInsertDeleteEnabled = enabled;
+    // In upstream WebKit, smart insert/delete is mutually exclusive with select
+    // trailing whitespace, however, we allow both because Chromium on Windows
+    // allows both.
+}
+
+void WebViewHost::setCustomPolicyDelegate(bool isCustom, bool isPermissive)
+{
+    m_policyDelegateEnabled = isCustom;
+    m_policyDelegateIsPermissive = isPermissive;
+}
+
+void WebViewHost::waitForPolicyDelegate()
+{
+    m_policyDelegateEnabled = true;
+    m_policyDelegateShouldNotifyDone = true;
+}
+
+void WebViewHost::setEditCommand(const string& name, const string& value)
+{
+    m_editCommandName = name;
+    m_editCommandValue = value;
+}
+
+void WebViewHost::clearEditCommand()
+{
+    m_editCommandName.clear();
+    m_editCommandValue.clear();
+}
+
+void WebViewHost::loadURLForFrame(const WebURL& url, const WebString& frameName)
+{
+    if (!url.isValid())
+        return;
+    TestShell::resizeWindowForTest(this, url);
+    navigationController()->loadEntry(new TestNavigationEntry(-1, url, WebString(), frameName));
+}
+
+bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload)
+{
+    // Get the right target frame for the entry.
+    WebFrame* frame = webView()->mainFrame();
+    if (!entry.targetFrame().isEmpty())
+        frame = webView()->findFrameByName(entry.targetFrame());
+
+    // TODO(mpcomplete): should we clear the target frame, or should
+    // back/forward navigations maintain the target frame?
+
+    // A navigation resulting from loading a javascript URL should not be
+    // treated as a browser initiated event.  Instead, we want it to look as if
+    // the page initiated any load resulting from JS execution.
+    if (!GURL(entry.URL()).SchemeIs("javascript"))
+        setPendingExtraData(new TestShellExtraData(entry.pageID()));
+
+    // If we are reloading, then WebKit will use the state of the current page.
+    // Otherwise, we give it the state to navigate to.
+    if (reload) {
+        frame->reload(false);
+    } else if (!entry.contentState().isNull()) {
+        ASSERT(entry.pageID() != -1);
+        frame->loadHistoryItem(entry.contentState());
+    } else {
+        ASSERT(entry.pageID() == -1);
+        frame->loadRequest(WebURLRequest(entry.URL()));
+    }
+
+    // In case LoadRequest failed before DidCreateDataSource was called.
+    setPendingExtraData(0);
+
+    // Restore focus to the main frame prior to loading new request.
+    // This makes sure that we don't have a focused iframe. Otherwise, that
+    // iframe would keep focus when the SetFocus called immediately after
+    // LoadRequest, thus making some tests fail (see http://b/issue?id=845337
+    // for more details).
+    webView()->setFocusedFrame(frame);
+    m_shell->setFocus(webView(), true);
+
+    return true;
+}
+
+// Private functions ----------------------------------------------------------
+
+LayoutTestController* WebViewHost::layoutTestController() const
+{
+    return m_shell->layoutTestController();
+}
+
+void WebViewHost::updateAddressBar(WebView* webView)
+{
+    WebFrame* mainFrame = webView->mainFrame();
+    WebDataSource* dataSource = mainFrame->dataSource();
+    if (!dataSource)
+        dataSource = mainFrame->provisionalDataSource();
+    if (!dataSource)
+        return;
+
+    setAddressBarURL(dataSource->request().firstPartyForCookies());
+}
+
+void WebViewHost::locationChangeDone(WebFrame* frame)
+{
+    if (frame != m_topLoadingFrame)
+        return;
+    m_topLoadingFrame = 0;
+    layoutTestController()->locationChangeDone();
+}
+
+void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation)
+{
+    // Code duplicated from RenderView::DidCommitLoadForFrame.
+    TestShellExtraData* extraData = static_cast<TestShellExtraData*>(frame->dataSource()->extraData());
+
+    if (isNewNavigation) {
+        // New navigation.
+        updateSessionHistory(frame);
+        m_pageId = nextPageID++;
+    } else if (extraData && extraData->pendingPageID != -1 && !extraData->requestCommitted) {
+        // This is a successful session history navigation!
+        updateSessionHistory(frame);
+        m_pageId = extraData->pendingPageID;
+    }
+
+    // Don't update session history multiple times.
+    if (extraData)
+        extraData->requestCommitted = true;
+
+    updateURL(frame);
+}
+
+void WebViewHost::updateURL(WebFrame* frame)
+{
+    WebDataSource* ds = frame->dataSource();
+    ASSERT(ds);
+    const WebURLRequest& request = ds->request();
+    OwnPtr<TestNavigationEntry> entry(new TestNavigationEntry);
+
+    // The referrer will be empty on https->http transitions. It
+    // would be nice if we could get the real referrer from somewhere.
+    entry->setPageID(m_pageId);
+    if (ds->hasUnreachableURL())
+        entry->setURL(ds->unreachableURL());
+    else
+        entry->setURL(request.url());
+
+    const WebHistoryItem& historyItem = frame->currentHistoryItem();
+    if (!historyItem.isNull())
+        entry->setContentState(historyItem);
+
+    navigationController()->didNavigateToEntry(entry.release());
+    m_lastPageIdUpdated = max(m_lastPageIdUpdated, m_pageId);
+}
+
+void WebViewHost::updateSessionHistory(WebFrame* frame)
+{
+    // If we have a valid page ID at this point, then it corresponds to the page
+    // we are navigating away from.  Otherwise, this is the first navigation, so
+    // there is no past session history to record.
+    if (m_pageId == -1)
+        return;
+
+    TestNavigationEntry* entry = static_cast<TestNavigationEntry*>(navigationController()->entryWithPageID(m_pageId));
+    if (!entry)
+        return;
+
+    const WebHistoryItem& historyItem = webView()->mainFrame()->previousHistoryItem();
+    if (historyItem.isNull())
+        return;
+
+    entry->setContentState(historyItem);
+}
+
+void WebViewHost::printFrameDescription(WebFrame* webframe)
+{
+    string name8 = webframe->name().utf8();
+    if (webframe == webView()->mainFrame()) {
+        if (!name8.length()) {
+            fputs("main frame", stdout);
+            return;
+        }
+        printf("main frame \"%s\"", name8.c_str());
+        return;
+    }
+    if (!name8.length()) {
+        fputs("frame (anonymous)", stdout);
+        return;
+    }
+    printf("frame \"%s\"", name8.c_str());
+}
+
+void WebViewHost::printResourceDescription(unsigned identifier)
+{
+    ResourceMap::iterator it = m_resourceIdentifierMap.find(identifier);
+    printf("%s", it != m_resourceIdentifierMap.end() ? it->second.c_str() : "<unknown>");
+}
+
+void WebViewHost::setPendingExtraData(TestShellExtraData* extraData)
+{
+    m_pendingExtraData.set(extraData);
+}
+
+void WebViewHost::setPageTitle(const WebString&)
+{
+    // Nothing to do in layout test.
+}
+
+void WebViewHost::setAddressBarURL(const WebURL&)
+{
+    // Nothing to do in layout test.
+}
+
+// Painting functions ---------------------------------------------------------
+
+void WebViewHost::updatePaintRect(const WebRect& rect)
+{
+    // m_paintRect = m_paintRect U rect
+    if (rect.isEmpty())
+        return;
+    if (m_paintRect.isEmpty()) {
+        m_paintRect = rect;
+        return;
+    }
+    int left = min(m_paintRect.x, rect.x);
+    int top = min(m_paintRect.y, rect.y);
+    int right = max(m_paintRect.x + m_paintRect.width, rect.x + rect.width);
+    int bottom = max(m_paintRect.y + m_paintRect.height, rect.y + rect.height);
+    m_paintRect = WebRect(left, top, right - left, bottom - top);
+}
+
+void WebViewHost::paintRect(const WebRect& rect)
+{
+    ASSERT(!m_isPainting);
+    ASSERT(canvas());
+    m_isPainting = true;
+#if PLATFORM(CG)
+    webWidget()->paint(m_canvas->getTopPlatformDevice().GetBitmapContext(), rect);
+#else
+    webWidget()->paint(m_canvas.get(), rect);
+#endif
+    m_isPainting = false;
+}
+
+void WebViewHost::paintInvalidatedRegion()
+{
+    webWidget()->layout();
+    WebSize widgetSize = webWidget()->size();
+    WebRect clientRect(0, 0, widgetSize.width, widgetSize.height);
+
+    // Paint the canvas if necessary.  Allow painting to generate extra rects the
+    // first time we call it.  This is necessary because some WebCore rendering
+    // objects update their layout only when painted.
+    // Store the total area painted in total_paint. Then tell the gdk window
+    // to update that area after we're done painting it.
+    for (int i = 0; i < 2; ++i) {
+        // m_paintRect = intersect(m_paintRect , clientRect)
+        int left = max(m_paintRect.x, clientRect.x);
+        int top = max(m_paintRect.y, clientRect.y);
+        int right = min(m_paintRect.x + m_paintRect.width, clientRect.x + clientRect.width);
+        int bottom = min(m_paintRect.y + m_paintRect.height, clientRect.y + clientRect.height);
+        if (left >= right || top >= bottom)
+            m_paintRect = WebRect();
+        else
+            m_paintRect = WebRect(left, top, right - left, bottom - top);
+
+        if (m_paintRect.isEmpty())
+            continue;
+        WebRect rect(m_paintRect);
+        m_paintRect = WebRect();
+        paintRect(rect);
+        if (i == 1)
+            LOG_ERROR("painting caused additional invalidations");
+    }
+    ASSERT(m_paintRect.isEmpty());
+}
+
+PlatformCanvas* WebViewHost::canvas()
+{
+    if (m_canvas)
+        return m_canvas.get();
+    WebSize widgetSize = webWidget()->size();
+    resetScrollRect();
+    m_paintRect = WebRect(0, 0, widgetSize.width, widgetSize.height);
+    m_canvas.set(new PlatformCanvas(widgetSize.width, widgetSize.height, true));
+    return m_canvas.get();
+}
+
+void WebViewHost::resetScrollRect()
+{
+}
+
+void WebViewHost::discardBackingStore()
+{
+    m_canvas.clear();
+}
+
+// Paints the entire canvas a semi-transparent black (grayish). This is used
+// by the layout tests in fast/repaint. The alpha value matches upstream.
+void WebViewHost::displayRepaintMask()
+{
+    canvas()->drawARGB(167, 0, 0, 0);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
new file mode 100644
index 0000000..fd1e0f5
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -0,0 +1,271 @@
+/*
+ * 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 WebViewHost_h
+#define WebViewHost_h
+
+#include "MockSpellCheck.h"
+#include "TestNavigationController.h"
+#include "public/WebCursorInfo.h"
+#include "public/WebFrameClient.h"
+#include "public/WebViewClient.h"
+#include <wtf/HashMap.h>
+#include <wtf/Vector.h>
+
+class LayoutTestController;
+class TestShell;
+namespace WebKit {
+class WebFrame;
+class WebURL;
+struct WebURLError;
+struct WebRect;
+}
+namespace skia {
+class PlatformCanvas;
+}
+
+class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost {
+ public:
+    WebViewHost(TestShell* shell);
+    ~WebViewHost();
+    void setWebWidget(WebKit::WebWidget* widget) { m_webWidget = widget; }
+    WebKit::WebView* webView() const;
+    WebKit::WebWidget* webWidget() const;
+    void reset();
+    void setSelectTrailingWhitespaceEnabled(bool);
+    void setSmartInsertDeleteEnabled(bool);
+    void waitForPolicyDelegate();
+    void setCustomPolicyDelegate(bool, bool);
+    WebKit::WebFrame* topLoadingFrame() { return m_topLoadingFrame; }
+    void setBlockRedirects(bool block) { m_blocksRedirects = block; }
+    void setRequestReturnNull(bool returnNull) { m_requestReturnNull = returnNull; }
+    void setEditCommand(const std::string& name, const std::string& value);
+    void clearEditCommand();
+    void setPendingExtraData(TestShellExtraData*);
+
+    void paintRect(const WebKit::WebRect&);
+    void updatePaintRect(const WebKit::WebRect&);
+    void paintInvalidatedRegion();
+    skia::PlatformCanvas* canvas();
+    void displayRepaintMask();
+
+    void loadURLForFrame(const WebKit::WebURL&, const WebKit::WebString& frameName);
+    TestNavigationController* navigationController() { return m_navigationController.get(); }
+
+    // NavigationHost
+    virtual bool navigate(const TestNavigationEntry&, bool reload);
+
+    // WebKit::WebViewClient
+    virtual WebKit::WebView* createView(WebKit::WebFrame*);
+    virtual WebKit::WebWidget* createPopupMenu(bool activatable);
+    virtual WebKit::WebWidget* createPopupMenu(const WebKit::WebPopupMenuInfo&);
+    virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
+    virtual void didAddMessageToConsole(const WebKit::WebConsoleMessage&, const WebKit::WebString& sourceName, unsigned sourceLine);
+    virtual void didStartLoading();
+    virtual void didStopLoading();
+    virtual bool shouldBeginEditing(const WebKit::WebRange&);
+    virtual bool shouldEndEditing(const WebKit::WebRange&);
+    virtual bool shouldInsertNode(const WebKit::WebNode&, const WebKit::WebRange&, WebKit::WebEditingAction);
+    virtual bool shouldInsertText(const WebKit::WebString&, const WebKit::WebRange&, WebKit::WebEditingAction);
+    virtual bool shouldChangeSelectedRange(const WebKit::WebRange& from, const WebKit::WebRange& to, WebKit::WebTextAffinity, bool stillSelecting);
+    virtual bool shouldDeleteRange(const WebKit::WebRange&);
+    virtual bool shouldApplyStyle(const WebKit::WebString& style, const WebKit::WebRange&);
+    virtual bool isSmartInsertDeleteEnabled();
+    virtual bool isSelectTrailingWhitespaceEnabled();
+    virtual void didBeginEditing();
+    virtual void didChangeSelection(bool isSelectionEmpty);
+    virtual void didChangeContents();
+    virtual void didEndEditing();
+    virtual bool handleCurrentKeyboardEvent();
+    virtual void spellCheck(const WebKit::WebString&, int& offset, int& length);
+    virtual WebKit::WebString autoCorrectWord(const WebKit::WebString&);
+    virtual void runModalAlertDialog(WebKit::WebFrame*, const WebKit::WebString&);
+    virtual bool runModalConfirmDialog(WebKit::WebFrame*, const WebKit::WebString&);
+    virtual bool runModalPromptDialog(WebKit::WebFrame*, const WebKit::WebString& message, const WebKit::WebString& defaultValue, WebKit::WebString* actualValue);
+    virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&);
+    virtual void showContextMenu(WebKit::WebFrame*, const WebKit::WebContextMenuData&);
+    virtual void setStatusText(const WebKit::WebString&);
+    virtual void startDragging(const WebKit::WebPoint&, const WebKit::WebDragData&, WebKit::WebDragOperationsMask);
+    virtual void navigateBackForwardSoon(int offset);
+    virtual int historyBackListCount();
+    virtual int historyForwardListCount();
+    virtual void focusAccessibilityObject(const WebKit::WebAccessibilityObject&);
+
+    // WebKit::WebWidgetClient
+    virtual void didInvalidateRect(const WebKit::WebRect&);
+    virtual void didScrollRect(int dx, int dy, const WebKit::WebRect&);
+    virtual void didFocus();
+    virtual void didBlur();
+    virtual void didChangeCursor(const WebKit::WebCursorInfo&);
+    virtual void closeWidgetSoon();
+    virtual void show(WebKit::WebNavigationPolicy);
+    virtual void runModal();
+    virtual WebKit::WebRect windowRect();
+    virtual void setWindowRect(const WebKit::WebRect&);
+    virtual WebKit::WebRect rootWindowRect();
+    virtual WebKit::WebRect windowResizerRect();
+    virtual WebKit::WebScreenInfo screenInfo();
+
+    // WebKit::WebFrameClient
+    virtual WebKit::WebPlugin* createPlugin(WebKit::WebFrame*, const WebKit::WebPluginParams&);
+    virtual WebKit::WebWorker* createWorker(WebKit::WebFrame*, WebKit::WebWorkerClient*);
+    virtual WebKit::WebMediaPlayer* createMediaPlayer(WebKit::WebFrame*, WebKit::WebMediaPlayerClient*);
+    virtual bool allowPlugins(WebKit::WebFrame*, bool enabledPerSettings);
+    virtual bool allowImages(WebKit::WebFrame*, bool enabledPerSettings);
+    virtual void loadURLExternally(WebKit::WebFrame*, const WebKit::WebURLRequest&, WebKit::WebNavigationPolicy);
+    virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
+        WebKit::WebFrame*, const WebKit::WebURLRequest&,
+        WebKit::WebNavigationType, const WebKit::WebNode&,
+        WebKit::WebNavigationPolicy, bool isRedirect);
+    virtual bool canHandleRequest(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+    virtual WebKit::WebURLError cannotHandleRequestError(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+    virtual WebKit::WebURLError cancelledError(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+    virtual void unableToImplementPolicyWithError(WebKit::WebFrame*, const WebKit::WebURLError&);
+    virtual void willPerformClientRedirect(
+        WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to,
+        double interval, double fireTime);
+    virtual void didCancelClientRedirect(WebKit::WebFrame*);
+    virtual void didCreateDataSource(WebKit::WebFrame*, WebKit::WebDataSource*);
+    virtual void didStartProvisionalLoad(WebKit::WebFrame*);
+    virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*);
+    virtual void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
+    virtual void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation);
+    virtual void didClearWindowObject(WebKit::WebFrame*);
+    virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&);
+    virtual void didFinishDocumentLoad(WebKit::WebFrame*);
+    virtual void didHandleOnloadEvents(WebKit::WebFrame*);
+    virtual void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
+    virtual void didFinishLoad(WebKit::WebFrame*);
+    virtual void didChangeLocationWithinPage(WebKit::WebFrame*, bool isNewNavigation);
+    virtual void assignIdentifierToRequest(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLRequest&);
+    virtual void willSendRequest(WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&, const WebKit::WebURLResponse&);
+    virtual void didReceiveResponse(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLResponse&);
+    virtual void didFinishResourceLoad(WebKit::WebFrame*, unsigned identifier);
+    virtual void didFailResourceLoad(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&);
+    virtual void didDisplayInsecureContent(WebKit::WebFrame*);
+    virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&);
+    virtual bool allowScript(WebKit::WebFrame*, bool enabledPerSettings);
+
+private:
+    LayoutTestController* layoutTestController() const;
+
+    // Called the title of the page changes.
+    // Can be used to update the title of the window.
+    void setPageTitle(const WebKit::WebString&);
+
+    // Called when the URL of the page changes.
+    // Extracts the URL and forwards on to SetAddressBarURL().
+    void updateAddressBar(WebKit::WebView*);
+
+    // Called when the URL of the page changes.
+    // Should be used to update the text of the URL bar.
+    void setAddressBarURL(const WebKit::WebURL&);
+
+    // In the Mac code, this is called to trigger the end of a test after the
+    // page has finished loading.  From here, we can generate the dump for the
+    // test.
+    void locationChangeDone(WebKit::WebFrame*);
+
+    void updateForCommittedLoad(WebKit::WebFrame*, bool isNewNavigation);
+    void updateURL(WebKit::WebFrame*);
+    void updateSessionHistory(WebKit::WebFrame*);
+
+    // Dumping a frame to the console.
+    void printFrameDescription(WebKit::WebFrame*);
+
+    bool hasWindow() const { return m_hasWindow; }
+    void resetScrollRect();
+    void discardBackingStore();
+
+    // Causes navigation actions just printout the intended navigation instead
+    // of taking you to the page. This is used for cases like mailto, where you
+    // don't actually want to open the mail program.
+    bool m_policyDelegateEnabled;
+
+    // Toggles the behavior of the policy delegate.  If true, then navigations
+    // will be allowed.  Otherwise, they will be ignored (dropped).
+    bool m_policyDelegateIsPermissive;
+
+    // If true, the policy delegate will signal layout test completion.
+    bool m_policyDelegateShouldNotifyDone;
+
+    // Non-owning pointer. The WebViewHost instance is owned by this TestShell instance.
+    TestShell* m_shell;
+
+    // This delegate works for the following widget.
+    WebKit::WebWidget* m_webWidget;
+
+    // This is non-0 IFF a load is in progress.
+    WebKit::WebFrame* m_topLoadingFrame;
+
+    // For tracking session history.  See RenderView.
+    int m_pageId;
+    int m_lastPageIdUpdated;
+
+    OwnPtr<TestShellExtraData> m_pendingExtraData;
+
+    // Maps resource identifiers to a descriptive string.
+    typedef HashMap<unsigned, std::string> ResourceMap;
+    ResourceMap m_resourceIdentifierMap;
+    void printResourceDescription(unsigned identifier);
+
+    WebKit::WebCursorInfo m_currentCursor;
+
+    bool m_hasWindow;
+    WebKit::WebRect m_windowRect;
+
+    // true if we want to enable smart insert/delete.
+    bool m_smartInsertDeleteEnabled;
+
+    // true if we want to enable selection of trailing whitespaces
+    bool m_selectTrailingWhitespaceEnabled;
+
+    // true if we should block any redirects
+    bool m_blocksRedirects;
+
+    // true if we should block (set an empty request for) any requests
+    bool m_requestReturnNull;
+
+    // Edit command associated to the current keyboard event.
+    std::string m_editCommandName;
+    std::string m_editCommandValue;
+
+    // The mock spellchecker used in spellCheck().
+    MockSpellCheck m_spellcheck;
+
+    // Painting.
+    OwnPtr<skia::PlatformCanvas> m_canvas;
+    WebKit::WebRect m_paintRect;
+    bool m_isPainting;
+
+    OwnPtr<TestNavigationController*> m_navigationController;
+};
+
+#endif // WebViewHost_h
diff --git a/WebKitTools/DumpRenderTree/chromium/config.h b/WebKitTools/DumpRenderTree/chromium/config.h
new file mode 100644
index 0000000..6029532
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/config.h
@@ -0,0 +1,54 @@
+/*
+ * 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 config_h
+#define config_h
+
+// To avoid confict of LOG in wtf/Assertions.h and LOG in base/logging.h,
+// skip base/loggin.h by defining BASE_LOGGING_H_ and define some macros
+// provided by base/logging.h.
+// FIXME: Remove this hack!
+#include <iostream>
+#define BASE_LOGGING_H_
+#define CHECK(condition) while (false && (condition)) std::cerr
+#define DCHECK(condition) while (false && (condition)) std::cerr
+#define DCHECK_EQ(a, b) while (false && (a) == (b)) std::cerr
+#define DCHECK_NE(a, b) while (false && (a) != (b)) std::cerr
+
+#include <wtf/Platform.h>
+
+// JS_EXPORTDATA is needed to inlucde wtf/WTFString.h.
+#if OS(WINDOWS) && !COMPILER(GCC)
+#define JS_EXPORTDATA __declspec(dllimport)
+#else
+#define JS_EXPORTDATA
+#endif
+
+#endif // config_h
diff --git a/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png b/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png
new file mode 100644
index 0000000..8b9319c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf b/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf
new file mode 100644
index 0000000..cd919e8
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
index 12653fc..ab9f021 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
@@ -46,6 +46,12 @@
 {
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    // FIXME: implement
+    return 0;
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     AtkObject* accessible =  webkit_web_frame_get_focused_accessible_element(mainFrame);
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index abfe115..fabada3 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -75,6 +75,26 @@
     }
 }
 
+int AccessibilityUIElement::rowCount()
+{
+    if (!m_element)
+        return 0;
+
+    ASSERT(ATK_IS_TABLE(m_element));
+
+    return atk_table_get_n_rows(ATK_TABLE(m_element));
+}
+
+int AccessibilityUIElement::columnCount()
+{
+    if (!m_element)
+        return 0;
+
+    ASSERT(ATK_IS_TABLE(m_element));
+
+    return atk_table_get_n_columns(ATK_TABLE(m_element));
+}
+
 int AccessibilityUIElement::childrenCount()
 {
     if (!m_element)
@@ -204,6 +224,11 @@
     return JSStringCreateWithCharacters(0, 0);
 }
 
+JSStringRef AccessibilityUIElement::helpText() const
+{
+    return 0;
+}
+
 double AccessibilityUIElement::x()
 {
     int x, y;
@@ -492,6 +517,11 @@
     // FIXME: implement
 }
 
+void AccessibilityUIElement::press()
+{
+    // FIXME: implement
+}
+
 void AccessibilityUIElement::showMenu()
 {
     // FIXME: implement
@@ -558,6 +588,11 @@
     return false;
 }
 
+void AccessibilityUIElement::removeNotificationListener()
+{
+    // FIXME: implement
+}
+
 bool AccessibilityUIElement::isSelectable() const
 {
     // FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index a2fc79b..e37613d 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -117,6 +117,11 @@
     return strstr(pathOrURL, "inspector/");
 }
 
+static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+{
+    return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");
+}
+
 void dumpFrameScrollPosition(WebKitWebFrame* frame)
 {
 
@@ -319,6 +324,7 @@
                  "enable-html5-database", TRUE,
                  "enable-html5-local-storage", TRUE,
                  "enable-xss-auditor", FALSE,
+                 "enable-spatial-navigation", FALSE,
                  "javascript-can-open-windows-automatically", TRUE,
                  "enable-offline-web-application-cache", TRUE,
                  "enable-universal-access-from-file-uris", TRUE,
@@ -335,6 +341,7 @@
                  "enable-page-cache", FALSE,
                  "auto-resize-window", TRUE,
                  "enable-java-applet", FALSE,
+                 "enable-plugins", TRUE,
                  NULL);
 
     webkit_web_frame_clear_main_frame_name(mainFrame);
@@ -346,6 +353,16 @@
 
     webkit_reset_origin_access_white_lists();
 
+#ifdef HAVE_LIBSOUP_2_29_90
+    SoupSession* session = webkit_get_default_session();
+    SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+
+    // We only create the jar when the soup backend needs to do
+    // HTTP. Should we initialize it earlier, perhaps?
+    if (jar)
+        g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY, NULL);
+#endif
+
     setlocale(LC_ALL, "");
 }
 
@@ -468,8 +485,11 @@
     if (shouldLogFrameLoadDelegates(pathOrURL.c_str()))
         gLayoutTestController->setDumpFrameLoadCallbacks(true);
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
-        gLayoutTestController->showWebInspector();
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+        gLayoutTestController->setDeveloperExtrasEnabled(true);
+        if (shouldOpenWebInspector(pathOrURL.c_str()))
+            gLayoutTestController->showWebInspector();
+    }
 
     WorkQueue::shared()->clear();
     WorkQueue::shared()->setFrozen(false);
@@ -502,7 +522,8 @@
 
     gtk_main();
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
+    // If developer extras enabled Web Inspector may have been open by the test.
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str()))
         gLayoutTestController->closeWebInspector();
 
     // Also check if we still have opened webViews and free them.
@@ -550,7 +571,7 @@
         // This is a bit strange. Shouldn't web_frame_get_name return NULL?
         if (frameName && (frameName[0] != '\0')) {
             char* tmp = g_strdup_printf("main frame \"%s\"", frameName);
-            g_free (frameName);
+            g_free(frameName);
             frameName = tmp;
         } else {
             g_free(frameName);
@@ -559,20 +580,31 @@
     } else if (!frameName || (frameName[0] == '\0')) {
         g_free(frameName);
         frameName = g_strdup("frame (anonymous)");
+    } else {
+        char* tmp = g_strdup_printf("frame \"%s\"", frameName);
+        g_free(frameName);
+        frameName = tmp;
     }
 
     return frameName;
 }
 
+static void webViewLoadCommitted(WebKitWebView* view, WebKitWebFrame* frame, void*)
+{
+    if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+        char* frameName = getFrameNameSuitableForTestResult(view, frame);
+        printf("%s - didCommitLoadForFrame\n", frameName);
+        g_free(frameName);
+    }
+}
+
+
 static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
 {
-    if (!done && !gLayoutTestController->dumpFrameLoadCallbacks()) {
-        guint pendingFrameUnloadEvents = webkit_web_frame_get_pending_unload_event_count(frame);
-        if (pendingFrameUnloadEvents) {
-            char* frameName = getFrameNameSuitableForTestResult(view, frame);
-            printf("%s - has %u onunload handler(s)\n", frameName, pendingFrameUnloadEvents);
-            g_free(frameName);
-        }
+    if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+        char* frameName = getFrameNameSuitableForTestResult(view, frame);
+        printf("%s - didFinishLoadForFrame\n", frameName);
+        g_free(frameName);
     }
 
     if (frame != topLoadingFrame)
@@ -589,6 +621,31 @@
         dump();
 }
 
+static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
+{
+    if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+        char* frameName = getFrameNameSuitableForTestResult(view, frame);
+        printf("%s - didFinishDocumentLoadForFrame\n", frameName);
+        g_free(frameName);
+    } else if (!done) {
+        guint pendingFrameUnloadEvents = webkit_web_frame_get_pending_unload_event_count(frame);
+        if (pendingFrameUnloadEvents) {
+            char* frameName = getFrameNameSuitableForTestResult(view, frame);
+            printf("%s - has %u onunload handler(s)\n", frameName, pendingFrameUnloadEvents);
+            g_free(frameName);
+        }
+    }
+}
+
+static void webViewOnloadEvent(WebKitWebView* view, WebKitWebFrame* frame, void*)
+{
+    if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+        char* frameName = getFrameNameSuitableForTestResult(view, frame);
+        printf("%s - didHandleOnloadEventsForFrame\n", frameName);
+        g_free(frameName);
+    }
+}
+
 static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data)
 {
     JSValueRef exception = 0;
@@ -611,7 +668,26 @@
 
 static gboolean webViewConsoleMessage(WebKitWebView* view, const gchar* message, unsigned int line, const gchar* sourceId, gpointer data)
 {
-    fprintf(stdout, "CONSOLE MESSAGE: line %d: %s\n", line, message);
+    gchar* testMessage = 0;
+    const gchar* uriScheme;
+
+    // Tests expect only the filename part of local URIs
+    uriScheme = g_strstr_len(message, -1, "file://");
+    if (uriScheme) {
+        GString* tempString = g_string_sized_new(strlen(message));
+        gchar* filename = g_strrstr(uriScheme, G_DIR_SEPARATOR_S);
+
+        if (filename) {
+            filename += strlen(G_DIR_SEPARATOR_S);
+            tempString = g_string_append_len(tempString, message, (uriScheme - message));
+            tempString = g_string_append_len(tempString, filename, strlen(filename));
+            testMessage = g_string_free(tempString, FALSE);
+        }
+    }
+
+    fprintf(stdout, "CONSOLE MESSAGE: line %d: %s\n", line, testMessage ? testMessage : message);
+    g_free(testMessage);
+
     return TRUE;
 }
 
@@ -725,6 +801,19 @@
     webkit_security_origin_set_web_database_quota(origin, 5 * 1024 * 1024);
 }
 
+static bool
+geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision)
+{
+    if (!gLayoutTestController->isGeolocationPermissionSet())
+        return FALSE;
+    if (gLayoutTestController->geolocationPermission())
+        webkit_geolocation_policy_allow(decision);
+    else
+        webkit_geolocation_policy_deny(decision);
+
+    return TRUE;
+}
+
 
 static WebKitWebView* webViewCreate(WebKitWebView*, WebKitWebFrame*);
 
@@ -764,6 +853,7 @@
     g_object_connect(G_OBJECT(view),
                      "signal::load-started", webViewLoadStarted, 0,
                      "signal::load-finished", webViewLoadFinished, 0,
+                     "signal::load-committed", webViewLoadCommitted, 0,
                      "signal::window-object-cleared", webViewWindowObjectCleared, 0,
                      "signal::console-message", webViewConsoleMessage, 0,
                      "signal::script-alert", webViewScriptAlert, 0,
@@ -775,6 +865,9 @@
                      "signal::create-web-view", webViewCreate, 0,
                      "signal::close-web-view", webViewClose, 0,
                      "signal::database-quota-exceeded", databaseQuotaExceeded, 0,
+                     "signal::document-load-finished", webViewDocumentLoadFinished, 0,
+                     "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
+                     "signal::onload-event", webViewOnloadEvent, 0,
                      NULL);
 
     WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);
@@ -806,11 +899,22 @@
     return newWebView;
 }
 
+static void logHandler(const gchar* domain, GLogLevelFlags level, const gchar* message, gpointer data)
+{
+    if (level < G_LOG_LEVEL_DEBUG)
+        fprintf(stderr, "%s\n", message);
+}
+
 int main(int argc, char* argv[])
 {
     g_thread_init(NULL);
     gtk_init(&argc, &argv);
 
+    // Some plugins might try to use the GLib logger for printing debug
+    // messages. This will cause tests to fail because of unexpected output.
+    // We squelch all debug messages sent to the logger.
+    g_log_set_default_handler(logHandler, 0);
+
 #if PLATFORM(X11)
     FcInit();
     initializeFonts();
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 458e0ba..9c27d8c 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -557,8 +557,18 @@
     event.key.state = state;
     event.key.window = GTK_WIDGET(view)->window;
 
+    // When synthesizing an event, an invalid hardware_keycode value
+    // can cause it to be badly processed by Gtk+.
+    GdkKeymapKey* keys;
+    gint n_keys;
+    if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), gdkKeySym, &keys, &n_keys)) {
+        event.key.hardware_keycode = keys[0].keycode;
+        g_free(keys);
+    }
+
     gboolean return_val;
     event.key.type = GDK_KEY_PRESS;
+
     g_signal_emit_by_name(view, "key-press-event", &event.key, &return_val);
 
     event.key.type = GDK_KEY_RELEASE;
@@ -567,47 +577,49 @@
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static void zoomIn(gboolean fullContentsZoom)
 {
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     if (!view)
-        return JSValueMakeUndefined(context);
+        return;
 
+    webkit_web_view_set_full_content_zoom(view, fullContentsZoom);
     gfloat currentZoom = webkit_web_view_get_zoom_level(view);
     webkit_web_view_set_zoom_level(view, currentZoom * zoomMultiplierRatio);
+}
 
+static void zoomOut(gboolean fullContentsZoom)
+{
+    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+    if (!view)
+        return;
+
+    webkit_web_view_set_full_content_zoom(view, fullContentsZoom);
+    gfloat currentZoom = webkit_web_view_get_zoom_level(view);
+    webkit_web_view_set_zoom_level(view, currentZoom / zoomMultiplierRatio);
+}
+
+static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    zoomIn(FALSE);
     return JSValueMakeUndefined(context);
 }
 
 static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
-    if (!view)
-        return JSValueMakeUndefined(context);
-
-    gfloat currentZoom = webkit_web_view_get_zoom_level(view);
-    webkit_web_view_set_zoom_level(view, currentZoom / zoomMultiplierRatio);
-
+    zoomOut(FALSE);
     return JSValueMakeUndefined(context);
 }
 
 static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
-    if (!view)
-        return JSValueMakeUndefined(context);
-
-    webkit_web_view_zoom_in(view);
+    zoomIn(TRUE);
     return JSValueMakeUndefined(context);
 }
 
 static JSValueRef zoomPageOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
-    if (!view)
-        return JSValueMakeUndefined(context);
-
-    webkit_web_view_zoom_out(view);
+    zoomOut(TRUE);
     return JSValueMakeUndefined(context);
 }
 
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 668b852..58d2631 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -56,7 +56,9 @@
 void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
 gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id);
 int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight);
+int webkit_web_frame_number_of_pages(WebKitWebFrame* frame, float pageWidth, float pageHeight);
 void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script);
+gchar* webkit_web_frame_marker_text_for_list_item(WebKitWebFrame* frame, JSContextRef context, JSValueRef nodeObject);
 }
 
 static gchar* copyWebSettingKey(gchar* preferenceKey)
@@ -65,12 +67,13 @@
 
     if (!keyTable) {
         // If you add a pref here, make sure you reset the value in
-        // DumpRenderTree::resetWebViewToConsistentStateBeforeTesting.
+        // DumpRenderTree::resetDefaultsToConsistentValues.
         keyTable = g_hash_table_new(g_str_hash, g_str_equal);
         g_hash_table_insert(keyTable, g_strdup("WebKitJavaScriptEnabled"), g_strdup("enable-scripts"));
         g_hash_table_insert(keyTable, g_strdup("WebKitDefaultFontSize"), g_strdup("default-font-size"));
         g_hash_table_insert(keyTable, g_strdup("WebKitEnableCaretBrowsing"), g_strdup("enable-caret-browsing"));
         g_hash_table_insert(keyTable, g_strdup("WebKitUsesPageCachePreferenceKey"), g_strdup("enable-page-cache"));
+        g_hash_table_insert(keyTable, g_strdup("WebKitPluginsEnabled"), g_strdup("enable-plugins"));
     }
 
     return g_strdup(static_cast<gchar*>(g_hash_table_lookup(keyTable, preferenceKey)));
@@ -141,6 +144,19 @@
     // FIXME: implement
 }
 
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{
+    // FIXME: Implement this.
+    return JSValueMakeUndefined(context);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+    // FIXME: implement
+    JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString(""));
+    return string;
+}
+
 int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidth, float pageHeight)
 {
     gchar* idGChar = JSStringCopyUTF8CString(id);
@@ -149,10 +165,9 @@
     return pageNumber;
 }
 
-int LayoutTestController::numberOfPages(float, float)
+int LayoutTestController::numberOfPages(float pageWidth, float pageHeight)
 {
-    // FIXME: implement
-    return -1;
+    return webkit_web_frame_number_of_pages(mainFrame, pageWidth, pageHeight);
 }
 
 size_t LayoutTestController::webHistoryItemCount()
@@ -210,7 +225,19 @@
 
 void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
 {
-    // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
+#ifdef HAVE_LIBSOUP_2_29_90
+    SoupSession* session = webkit_get_default_session();
+    SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+
+    SoupCookieJarAcceptPolicy policy;
+
+    if (alwaysAcceptCookies)
+        policy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+    else
+        policy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+
+    g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL);
+#endif
 }
 
 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
@@ -224,7 +251,12 @@
     setWaitToDump(true);
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+    // FIXME: implement
+}
+
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
 {
     gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin);
     gchar* protocolGChar = JSStringCopyUTF8CString(protocol);
@@ -235,6 +267,11 @@
     g_free(hostGChar);
 }
 
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+{
+    // FIXME: implement
+}
+
 void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
 {
     // FIXME: implement
@@ -303,7 +340,7 @@
 
 void LayoutTestController::setWaitToDump(bool waitUntilDone)
 {
-    static const int timeoutSeconds = 15;
+    static const int timeoutSeconds = 30;
 
     m_waitToDump = waitUntilDone;
     if (m_waitToDump && !waitToDumpWatchdog)
@@ -334,11 +371,20 @@
     g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL);
 }
 
-void LayoutTestController::setFrameSetFlatteningEnabled(bool flag)
+void LayoutTestController::setFrameFlatteningEnabled(bool flag)
 {
     // FIXME: implement
 }
 
+void LayoutTestController::setSpatialNavigationEnabled(bool flag)
+{
+    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+    ASSERT(view);
+
+    WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+    g_object_set(G_OBJECT(settings), "enable-spatial-navigation", flag, NULL);
+}
+
 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag)
 {
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
@@ -390,8 +436,7 @@
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     ASSERT(view);
 
-    WebKitWebSettings* settings = webkit_web_view_get_settings(view);
-    g_object_set(G_OBJECT(settings), "enable-developer-extras", flag, NULL);
+    setDeveloperExtrasEnabled(flag);
 
     WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);
     g_object_set(G_OBJECT(inspector), "javascript-profiling-enabled", flag, NULL);
@@ -556,24 +601,28 @@
     printf("LayoutTestController::addUserStyleSheet not implemented.\n");
 }
 
-void LayoutTestController::showWebInspector()
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
 {
     WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
     WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView);
+
+    g_object_set(webSettings, "enable-developer-extras", enabled, NULL);
+}
+
+void LayoutTestController::showWebInspector()
+{
+    WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
     WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
 
-    g_object_set(webSettings, "enable-developer-extras", TRUE, NULL);
     webkit_web_inspector_show(inspector);
 }
 
 void LayoutTestController::closeWebInspector()
 {
     WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
-    WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView);
     WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
 
     webkit_web_inspector_close(inspector);
-    g_object_set(webSettings, "enable-developer-extras", FALSE, NULL);
 }
 
 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -596,7 +645,37 @@
     // FIXME: Implement this.
 }
 
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+    // FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27481
+    return false;
+}
+
 void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
 {
 
 }
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+    gchar* markerTextGChar = webkit_web_frame_marker_text_for_list_item(mainFrame, context, nodeObject);
+    if (!markerTextGChar)
+        return 0;
+
+    JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithUTF8CString(markerTextGChar));
+    g_free(markerTextGChar);
+    return markerText;
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
index 4d2da6e..9d7edef 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
@@ -40,6 +40,12 @@
 {
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    id accessibilityObject = [[[mainFrame frameView] documentView] accessibilityHitTest:NSMakePoint(x, y)];
+    return AccessibilityUIElement(accessibilityObject);    
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     // FIXME: we could do some caching here.
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index e9361f2..a39dabb 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -57,32 +57,11 @@
 
 @interface NSObject (WebKitAccessibilityAdditions)
 - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
-- (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context;
+- (void)accessibilitySetShouldRepostNotifications:(BOOL)repost;
 - (NSUInteger)accessibilityIndexOfChild:(id)child;
+- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
 @end
 
-AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
-    : m_element(element)
-    , m_notificationFunctionCallback(0)
-{
-    [m_element retain];
-}
-
-AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
-    : m_element(other.m_element)
-    , m_notificationFunctionCallback(0)
-{
-    [m_element retain];
-}
-
-AccessibilityUIElement::~AccessibilityUIElement()
-{
-    // Make sure that our notification callback does not stick around.
-    if (m_notificationFunctionCallback)
-        [m_element accessibilitySetPostedNotificationCallback:0 withContext:0];
-    [m_element release];
-}
-
 @interface NSString (JSStringRefAdditions)
 + (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef;
 - (JSStringRef)createJSStringRef;
@@ -106,6 +85,88 @@
 
 @end
 
+@interface AccessibilityNotificationHandler : NSObject
+{
+    id m_platformElement;
+    JSObjectRef m_notificationFunctionCallback;
+}
+
+@end
+
+@implementation AccessibilityNotificationHandler
+
+- (id)initWithPlatformElement:(id)platformElement
+{
+    self = [super init];
+
+    m_platformElement = platformElement;
+    
+    // Once an object starts requesting notifications, it's on for the duration of the program.
+    // This is to avoid any race conditions between tests turning this flag on and off. Instead
+    // AccessibilityNotificationHandler can just listen when they want to.
+    [m_platformElement accessibilitySetShouldRepostNotifications:YES];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_notificationReceived:) name:@"AXDRTNotification" object:nil];
+
+    return self;
+}
+ 
+- (void)dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    JSValueUnprotect([mainFrame globalContext], m_notificationFunctionCallback);
+    m_notificationFunctionCallback = 0;
+    
+    [super dealloc];
+}
+
+- (void)_notificationReceived:(NSNotification *)notification
+{
+    NSString *notificationName = [[notification userInfo] objectForKey:@"notificationName"];
+    if (!notificationName)
+        return;
+    
+    JSRetainPtr<JSStringRef> jsNotification(Adopt, [notificationName createJSStringRef]);
+    JSValueRef argument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
+    JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 1, &argument, 0);
+}
+
+- (void)setCallback:(JSObjectRef)callback
+{
+    if (!callback)
+        return;
+ 
+    // Release the old callback.
+    if (m_notificationFunctionCallback) 
+        JSValueUnprotect([mainFrame globalContext], m_notificationFunctionCallback);
+    
+    m_notificationFunctionCallback = callback;
+    JSValueProtect([mainFrame globalContext], m_notificationFunctionCallback);
+}
+
+@end
+
+AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
+    : m_element(element)
+    , m_notificationHandler(0)
+{
+    // FIXME: ap@webkit.org says ObjC objects need to be CFRetained/CFRelease to be GC-compliant on the mac.
+    [m_element retain];
+}
+
+AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
+    : m_element(other.m_element)
+    , m_notificationHandler(0)
+{
+    [m_element retain];
+}
+
+AccessibilityUIElement::~AccessibilityUIElement()
+{
+    // The notification handler should be nil because removeNotificationListener() should have been called in the test.
+    ASSERT(!m_notificationHandler);
+    [m_element release];
+}
+
 static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObject)
 {
     if (!valueObject)
@@ -439,6 +500,12 @@
     return concatenateAttributeAndValue(@"AXLanguage", description);
 }
 
+JSStringRef AccessibilityUIElement::helpText() const
+{
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityHelpAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXHelp", description);
+}
+
 double AccessibilityUIElement::x()
 {
     NSValue* positionValue = [m_element accessibilityAttributeValue:NSAccessibilityPositionAttribute];
@@ -676,6 +743,16 @@
     return descriptionOfElements(headerVector);
 }
 
+int AccessibilityUIElement::rowCount()
+{
+    return [m_element accessibilityArrayAttributeCount:NSAccessibilityRowsAttribute];
+}
+
+int AccessibilityUIElement::columnCount()
+{
+    return [m_element accessibilityArrayAttributeCount:NSAccessibilityColumnsAttribute];
+}
+
 int AccessibilityUIElement::indexInTable()
 {
     NSNumber* indexNumber = [m_element accessibilityAttributeValue:NSAccessibilityIndexAttribute];
@@ -736,6 +813,11 @@
     [m_element accessibilityPerformAction:NSAccessibilityShowMenuAction];
 }
 
+void AccessibilityUIElement::press()
+{
+    [m_element accessibilityPerformAction:NSAccessibilityPressAction];
+}
+
 JSStringRef AccessibilityUIElement::accessibilityValue() const
 {
     // FIXME: implement
@@ -758,28 +840,30 @@
     return [[url absoluteString] createJSStringRef];    
 }
 
-static void _accessibilityNotificationCallback(id element, NSString* notification, void* context)
-{
-    if (!context)
-        return;
-
-    JSObjectRef functionCallback = static_cast<JSObjectRef>(context);
-
-    JSRetainPtr<JSStringRef> jsNotification(Adopt, [notification createJSStringRef]);
-    JSValueRef argument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
-    JSObjectCallAsFunction([mainFrame globalContext], functionCallback, NULL, 1, &argument, NULL);
-}
-
 bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
 {
     if (!functionCallback)
         return false;
  
-    m_notificationFunctionCallback = functionCallback;
-    [platformUIElement() accessibilitySetPostedNotificationCallback:_accessibilityNotificationCallback withContext:reinterpret_cast<void*>(m_notificationFunctionCallback)];
+    // Mac programmers should not be adding more than one notification listener per element.
+    // Other platforms may be different.
+    if (m_notificationHandler)
+        return false;
+    m_notificationHandler = [[AccessibilityNotificationHandler alloc] initWithPlatformElement:platformUIElement()];
+    [m_notificationHandler setCallback:functionCallback];
+
     return true;
 }
 
+void AccessibilityUIElement::removeNotificationListener()
+{
+    // Mac programmers should not be trying to remove a listener that's already removed.
+    ASSERT(m_notificationHandler);
+
+    [m_notificationHandler release];
+    m_notificationHandler = nil;
+}
+
 bool AccessibilityUIElement::isSelectable() const
 {
     // FIXME: implement
@@ -812,7 +896,9 @@
 
 bool AccessibilityUIElement::hasPopup() const
 {
-    // FIXME: implement
+    id value = [m_element accessibilityAttributeValue:@"AXHasPopup"];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
     return false;
 }
 
diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
index a72dd7d..5f989e0 100644
--- a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
+++ b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
@@ -34,3 +34,35 @@
 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO
 WARNING_CFLAGS = -Wall -W -Wno-unused-parameter
 LINKER_DISPLAYS_MANGLED_NAMES = YES;
+
+
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
+
+
+// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0.
+// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
+// number.  Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
+// XCODE_VERSION_ACTUAL for the full version number.
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
index 96a39a9..ab3278e 100644
--- a/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
+++ b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
@@ -23,7 +23,7 @@
 
 #include "Base.xcconfig"
 
-ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
 ARCHS_ = $(ARCHS_1040);
 ARCHS_1040 = $(NATIVE_ARCH);
 ARCHS_1050 = $(NATIVE_ARCH);
@@ -32,7 +32,7 @@
 
 ONLY_ACTIVE_ARCH = YES;
 
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR))
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR))
 MACOSX_DEPLOYMENT_TARGET_ = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
 MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index c7ddf21..0210cf0 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -76,15 +76,21 @@
 #import <WebKit/WebTypesInternal.h>
 #import <WebKit/WebViewPrivate.h>
 #import <getopt.h>
-#import <mach-o/getsect.h>
 #import <objc/objc-runtime.h>
 #import <wtf/Assertions.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/Threading.h>
 #import <wtf/OwnPtr.h>
 
+extern "C" {
+#import <mach-o/getsect.h>
+}
+
 using namespace std;
 
+@interface DumpRenderTreeApplication : NSApplication
+@end
+
 @interface DumpRenderTreeEvent : NSEvent
 @end
 
@@ -246,6 +252,7 @@
 
     static const char* fontFileNames[] = {
         "AHEM____.TTF",
+        "ColorBits.ttf",
         "WebKitWeightWatcher100.ttf",
         "WebKitWeightWatcher200.ttf",
         "WebKitWeightWatcher300.ttf",
@@ -355,7 +362,14 @@
 
 static NSString *libraryPathForDumpRenderTree()
 {
-    return [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath];
+    //FIXME: This may not be sufficient to prevent interactions/crashes
+    //when running more than one copy of DumpRenderTree.
+    //See https://bugs.webkit.org/show_bug.cgi?id=10906
+    char* dumpRenderTreeTemp = getenv("DUMPRENDERTREE_TEMP");
+    if (dumpRenderTreeTemp)
+        return [[NSFileManager defaultManager] stringWithFileSystemRepresentation:dumpRenderTreeTemp length:strlen(dumpRenderTreeTemp)];
+    else
+        return [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath];
 }
 
 // Called before each test.
@@ -420,7 +434,7 @@
     [preferences setOfflineWebApplicationCacheEnabled:YES];
     [preferences setDeveloperExtrasEnabled:NO];
     [preferences setLoadsImagesAutomatically:YES];
-    [preferences setFrameSetFlatteningEnabled:NO];
+    [preferences setFrameFlatteningEnabled:NO];
     if (persistentUserStyleSheetLocation) {
         [preferences setUserStyleSheetLocation:[NSURL URLWithString:(NSString *)(persistentUserStyleSheetLocation.get())]];
         [preferences setUserStyleSheetEnabled:YES];
@@ -430,20 +444,8 @@
     // The back/forward cache is causing problems due to layouts during transition from one page to another.
     // So, turn it off for now, but we might want to turn it back on some day.
     [preferences setUsesPageCache:NO];
-
-#if defined(BUILDING_ON_LEOPARD)
-    // Disable hardware composititing to avoid timeouts and crashes from buggy CoreVideo teardown code.
-    // https://bugs.webkit.org/show_bug.cgi?id=28845 and rdar://problem/7228836
-    SInt32 qtVersion;
-    OSErr err = Gestalt(gestaltQuickTimeVersion, &qtVersion);
-    assert(err == noErr);
-    // Bug 7228836 exists in at least 7.6.3 through 7.6.4, hopefully it will be fixed in 7.6.5.
-    // FIXME: Once we know the exact versions of QuickTime affected, we can update this check.
-    if (qtVersion <= 0x07648000) // 7.6.4, final release (0x8).  See http://developer.apple.com/mac/library/techn
-        [preferences setAcceleratedCompositingEnabled:NO];
-    else
-#endif
-        [preferences setAcceleratedCompositingEnabled:YES];
+    [preferences setAcceleratedCompositingEnabled:YES];
+    [preferences setWebGLEnabled:NO];
 
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
 
@@ -686,7 +688,7 @@
 int main(int argc, const char *argv[])
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-    [NSApplication sharedApplication]; // Force AppKit to init itself
+    [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
     dumpRenderTree(argc, argv);
     [WebCoreStatistics garbageCollectJavaScriptObjects];
     [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts    
@@ -1139,9 +1141,15 @@
     return strstr(pathOrURL, "inspector/");
 }
 
+static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+{
+    return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");
+}
+
 static void resetWebViewToConsistentStateBeforeTesting()
 {
     WebView *webView = [mainFrame webView];
+    [webView setEditable:NO];
     [(EditingDelegate *)[webView editingDelegate] setAcceptsEditing:YES];
     [webView makeTextStandardSize:nil];
     [webView resetPageZoom:nil];
@@ -1162,7 +1170,7 @@
     [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:NO];
 
     [WebView _setUsesTestModeFocusRingColor:YES];
-    [WebView _resetOriginAccessWhiteLists];
+    [WebView _resetOriginAccessWhitelists];
 }
 
 static void runTest(const string& testPathOrURL)
@@ -1217,8 +1225,11 @@
     else
         [[mainFrame webView] setHistoryDelegate:nil];
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
-        gLayoutTestController->showWebInspector();
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+        gLayoutTestController->setDeveloperExtrasEnabled(true);
+        if (shouldOpenWebInspector(pathOrURL.c_str()))
+            gLayoutTestController->showWebInspector();
+    }
 
     if ([WebHistory optionalSharedHistory])
         [WebHistory setOptionalSharedHistory:nil];
@@ -1238,9 +1249,10 @@
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [mainFrame loadRequest:[NSURLRequest requestWithURL:url]];
     [pool release];
+
     while (!done) {
         pool = [[NSAutoreleasePool alloc] init];
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]]; 
         [pool release];
     }
 
@@ -1268,7 +1280,8 @@
         }
     }
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
+    // If developer extras enabled Web Inspector may have been open by the test.
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str()))
         gLayoutTestController->closeWebInspector();
 
     resetWebViewToConsistentStateBeforeTesting();
@@ -1307,3 +1320,13 @@
 }
 
 @end
+
+@implementation DumpRenderTreeApplication
+
+- (BOOL)isRunning
+{
+    // <rdar://problem/7686123> Java plug-in freezes unless NSApplication is running
+    return YES;
+}
+
+@end
diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
index feaeddc..8c5cebf 100644
--- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
+++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
@@ -134,7 +134,9 @@
             || aSelector == @selector(textZoomIn)
             || aSelector == @selector(textZoomOut)
             || aSelector == @selector(zoomPageIn)
-            || aSelector == @selector(zoomPageOut))
+            || aSelector == @selector(zoomPageOut)
+            || aSelector == @selector(mouseScrollByX:andY:)
+            || aSelector == @selector(continuousMouseScrollByX:andY:))
         return NO;
     return YES;
 }
@@ -166,6 +168,10 @@
         return @"mouseMoveTo";
     if (aSelector == @selector(setDragMode:))
         return @"setDragMode";
+    if (aSelector == @selector(mouseScrollByX:andY:))
+        return @"mouseScrollBy";
+    if (aSelector == @selector(continuousMouseScrollByX:andY:))
+        return @"continuousMouseScrollBy";
     return nil;
 }
 
@@ -453,6 +459,39 @@
     }
 }
 
+- (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)c
+{
+    // CGEventCreateScrollWheelEvent() was introduced in 10.5
+#if !defined(BUILDING_ON_TIGER)
+    CGScrollEventUnit unit = c?kCGScrollEventUnitPixel:kCGScrollEventUnitLine;
+    CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, unit, 2, y, x);
+    
+    // CGEvent locations are in global display coordinates.
+    CGPoint lastGlobalMousePosition = {
+        lastMousePosition.x,
+        [[NSScreen mainScreen] frame].size.height - lastMousePosition.y
+    };
+    CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition);
+
+    NSEvent *scrollEvent = [NSEvent eventWithCGEvent:cgScrollEvent];
+    CFRelease(cgScrollEvent);
+
+    NSView *subView = [[mainFrame webView] hitTest:[scrollEvent locationInWindow]];
+    if (subView)
+        [subView scrollWheel:scrollEvent];
+#endif
+}
+
+- (void)continuousMouseScrollByX:(int)x andY:(int)y
+{
+    [self mouseScrollByX:x andY:y continuously:YES];
+}
+
+- (void)mouseScrollByX:(int)x andY:(int)y
+{
+    [self mouseScrollByX:x andY:y continuously:NO];
+}
+
 - (void)contextClick
 {
     [[[mainFrame frameView] documentView] layout];
@@ -507,33 +546,43 @@
 - (void)keyDown:(NSString *)character withModifiers:(WebScriptObject *)modifiers withLocation:(unsigned long)keyLocation
 {
     NSString *eventCharacter = character;
+    unsigned short keyCode = 0;
     if ([character isEqualToString:@"leftArrow"]) {
         const unichar ch = NSLeftArrowFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x7B;
     } else if ([character isEqualToString:@"rightArrow"]) {
         const unichar ch = NSRightArrowFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x7C;
     } else if ([character isEqualToString:@"upArrow"]) {
         const unichar ch = NSUpArrowFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x7E;
     } else if ([character isEqualToString:@"downArrow"]) {
         const unichar ch = NSDownArrowFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x7D;
     } else if ([character isEqualToString:@"pageUp"]) {
         const unichar ch = NSPageUpFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x74;
     } else if ([character isEqualToString:@"pageDown"]) {
         const unichar ch = NSPageDownFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x79;
     } else if ([character isEqualToString:@"home"]) {
         const unichar ch = NSHomeFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x73;
     } else if ([character isEqualToString:@"end"]) {
         const unichar ch = NSEndFunctionKey;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x77;
     } else if ([character isEqualToString:@"delete"]) {
         const unichar ch = 0x7f;
         eventCharacter = [NSString stringWithCharacters:&ch length:1];
+        keyCode = 0x75;
     }
 
     // Compare the input string with the function-key names defined by the DOM spec (i.e. "F1",...,"F24").
@@ -542,9 +591,59 @@
         if ([character isEqualToString:[NSString stringWithFormat:@"F%u", i]]) {
             const unichar ch = NSF1FunctionKey + (i - 1);
             eventCharacter = [NSString stringWithCharacters:&ch length:1];
+            switch (i) {
+                case 1: keyCode = 0x7A; break;
+                case 2: keyCode = 0x78; break;
+                case 3: keyCode = 0x63; break;
+                case 4: keyCode = 0x76; break;
+                case 5: keyCode = 0x60; break;
+                case 6: keyCode = 0x61; break;
+                case 7: keyCode = 0x62; break;
+                case 8: keyCode = 0x64; break;
+                case 9: keyCode = 0x65; break;
+                case 10: keyCode = 0x6D; break;
+                case 11: keyCode = 0x67; break;
+                case 12: keyCode = 0x6F; break;
+                case 13: keyCode = 0x69; break;
+                case 14: keyCode = 0x6B; break;
+                case 15: keyCode = 0x71; break;
+                case 16: keyCode = 0x6A; break;
+                case 17: keyCode = 0x40; break;
+                case 18: keyCode = 0x4F; break;
+                case 19: keyCode = 0x50; break;
+                case 20: keyCode = 0x5A; break;
+            }
         }
     }
 
+    // FIXME: No keyCode is set for most keys.
+    if ([character isEqualToString:@"\t"])
+        keyCode = 0x30;
+    else if ([character isEqualToString:@" "])
+        keyCode = 0x31;
+    else if ([character isEqualToString:@"\r"])
+        keyCode = 0x24;
+    else if ([character isEqualToString:@"\n"])
+        keyCode = 0x4C;
+    else if ([character isEqualToString:@"\x8"])
+        keyCode = 0x33;
+    else if ([character isEqualToString:@"7"])
+        keyCode = 0x1A;
+    else if ([character isEqualToString:@"5"])
+        keyCode = 0x17;
+    else if ([character isEqualToString:@"9"])
+        keyCode = 0x19;
+    else if ([character isEqualToString:@"0"])
+        keyCode = 0x1D;
+    else if ([character isEqualToString:@"a"])
+        keyCode = 0x00;
+    else if ([character isEqualToString:@"b"])
+        keyCode = 0x0B;
+    else if ([character isEqualToString:@"d"])
+        keyCode = 0x02;
+    else if ([character isEqualToString:@"e"])
+        keyCode = 0x0E;
+
     NSString *charactersIgnoringModifiers = eventCharacter;
 
     int modifierFlags = 0;
@@ -570,7 +669,7 @@
                         characters:eventCharacter
                         charactersIgnoringModifiers:charactersIgnoringModifiers
                         isARepeat:NO
-                        keyCode:0];
+                        keyCode:keyCode];
 
     [[[[mainFrame webView] window] firstResponder] keyDown:event];
 
@@ -583,7 +682,7 @@
                         characters:eventCharacter
                         charactersIgnoringModifiers:charactersIgnoringModifiers
                         isARepeat:NO
-                        keyCode:0];
+                        keyCode:keyCode];
 
     [[[[mainFrame webView] window] firstResponder] keyUp:event];
 }
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 66ba5f0..e62e411 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -115,6 +115,11 @@
     CFSetAddValue(disallowedURLs, [request URL]);
 }
 
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+    return [[mainFrame webView] shouldClose];
+}
+
 void LayoutTestController::clearAllDatabases()
 {
     [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases];
@@ -176,6 +181,23 @@
     }
 }
 
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{   
+    return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+    JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText]));
+    return string;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+    // FIXME: Implement me.
+    return JSRetainPtr<JSStringRef>();
+}
+
 int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
 {
     RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id));
@@ -302,7 +324,7 @@
 
 void LayoutTestController::setJavaScriptProfilingEnabled(bool profilingEnabled)
 {
-    [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:profilingEnabled];
+    setDeveloperExtrasEnabled(profilingEnabled);
     [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:profilingEnabled];
 }
 
@@ -324,9 +346,14 @@
     [[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled];
 }
 
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
 {
-    [[[mainFrame webView] preferences] setFrameSetFlatteningEnabled:enabled];
+    [[[mainFrame webView] preferences] setFrameFlatteningEnabled:enabled];
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+{
+    // FIXME: Implement for SpatialNavigation layout tests.
 }
 
 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -424,7 +451,7 @@
     [[mainFrame webView] setSelectTrailingWhitespaceEnabled:flag];
 }
 
-static const CFTimeInterval waitToDumpWatchdogInterval = 15.0;
+static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
 
 static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info)
 {
@@ -541,7 +568,7 @@
     [[mainFrame webView] setPolicyDelegate:policyDelegate];
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 {
     RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
     NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
@@ -549,7 +576,23 @@
     NSString *destinationProtocolNS = (NSString *)protocolCF.get();
     RetainPtr<CFStringRef> hostCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationHost));
     NSString *destinationHostNS = (NSString *)hostCF.get();
-    [WebView _whiteListAccessFromOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
+    [WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+    RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
+    NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
+    RetainPtr<CFStringRef> protocolCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationProtocol));
+    NSString *destinationProtocolNS = (NSString *)protocolCF.get();
+    RetainPtr<CFStringRef> hostCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationHost));
+    NSString *destinationHostNS = (NSString *)hostCF.get();
+    [WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
+}
+
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+    // FIXME: implement
 }
 
 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
@@ -566,16 +609,19 @@
     [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil];
 }
 
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+{
+    [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:enabled];
+}
+
 void LayoutTestController::showWebInspector()
 {
-    [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:true];
     [[[mainFrame webView] inspector] show:nil];
 }
 
 void LayoutTestController::closeWebInspector()
 {
     [[[mainFrame webView] inspector] close:nil];
-    [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:false];
 }
 
 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -686,3 +732,101 @@
     [delegate release];
     [pool release];
 }
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+    WebView *view = [mainFrame webView];
+    [view goToBackForwardItem:[[view backForwardList] currentItem]];
+}
+
+void LayoutTestController::setWebViewEditable(bool editable)
+{
+    WebView *view = [mainFrame webView];
+    [view setEditable:editable];
+}
+
+#ifndef BUILDING_ON_TIGER
+static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoaderRunLoopMode";
+
+@interface SynchronousLoader : NSObject
+{
+    NSString *m_username;
+    NSString *m_password;
+    BOOL m_isDone;
+}
++ (void)makeRequest:(NSURLRequest *)request withUsername:(NSString *)username password:(NSString *)password;
+@end
+
+@implementation SynchronousLoader : NSObject
+- (void)dealloc
+{
+    [m_username release];
+    [m_password release];
+
+    [super dealloc];
+}
+
+- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection
+{
+    return YES;
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+    if ([challenge previousFailureCount] == 0) {
+        NSURLCredential *credential = [[NSURLCredential alloc]  initWithUser:m_username password:m_password persistence:NSURLCredentialPersistenceForSession];
+        [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
+        return;
+    }
+    [[challenge sender] cancelAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+    printf("SynchronousLoader failed: %s\n", [[error description] UTF8String]);
+    m_isDone = YES;
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+    m_isDone = YES;
+}
+
++ (void)makeRequest:(NSURLRequest *)request withUsername:(NSString *)username password:(NSString *)password
+{
+    ASSERT(![[request URL] user]);
+    ASSERT(![[request URL] password]);
+
+    SynchronousLoader *delegate = [[SynchronousLoader alloc] init];
+    delegate->m_username = [username copy];
+    delegate->m_password = [password copy];
+
+    NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
+    [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:SynchronousLoaderRunLoopMode];
+    [connection start];
+    
+    while (!delegate->m_isDone)
+        [[NSRunLoop currentRunLoop] runMode:SynchronousLoaderRunLoopMode beforeDate:[NSDate distantFuture]];
+
+    [connection cancel];
+    
+    [connection release];
+    [delegate release];
+}
+
+@end
+#endif
+
+void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
+{
+    // See <rdar://problem/7880699>.
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+    RetainPtr<CFStringRef> urlStringCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
+    RetainPtr<CFStringRef> usernameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, username));
+    RetainPtr<CFStringRef> passwordCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, password));
+
+    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(NSString *)urlStringCF.get()]];
+
+    [SynchronousLoader makeRequest:request withUsername:(NSString *)usernameCF.get() password:(NSString *)passwordCF.get()];
+#endif
+}
diff --git a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
index 6f82e01..9244110 100644
--- a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
@@ -35,6 +35,8 @@
 #import <WebKit/WebTypesInternal.h>
 #import <wtf/Assertions.h>
 
+using namespace std;
+
 @interface NSURL (DRTExtras)
 - (NSString *)_drt_descriptionSuitableForTestResult;
 @end
@@ -121,10 +123,10 @@
     return @"<unknown>";
 }
 
--(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
+-(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
 {
     if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
-        NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [newRequest _drt_descriptionSuitableForTestResult],
+        NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [request _drt_descriptionSuitableForTestResult],
             [redirectResponse _drt_descriptionSuitableForTestResult]];
         printf("%s\n", [string UTF8String]);
     }
@@ -137,7 +139,7 @@
         return nil;
     }
 
-    NSURL *url = [newRequest URL];
+    NSURL *url = [request URL];
     NSString *host = [url host];
     if (host
         && (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"])
@@ -151,7 +153,15 @@
     if (disallowedURLs && CFSetContainsValue(disallowedURLs, url))
         return nil;
 
-    return newRequest;
+    NSMutableURLRequest *newRequest = [request mutableCopy];
+    const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+    for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
+        NSString *nsHeader = [[NSString alloc] initWithUTF8String:header->c_str()];
+        [newRequest setValue:nil forHTTPHeaderField:nsHeader];
+        [nsHeader release];
+    }
+
+    return [newRequest autorelease];
 }
 
 - (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
index ad42bdd..b66eb5d 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
@@ -2,12 +2,8 @@
 CONFIG  -= app_bundle
 CONFIG += uitools
 
-mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
-    CONFIG -= debug
-    CONFIG += release
-}
-
 BASEDIR = $$PWD/../
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
 
 include(../../../WebKit.pri)
 INCLUDEPATH += /usr/include/freetype2
@@ -17,7 +13,7 @@
 INCLUDEPATH += $$BASEDIR
 DESTDIR = ../../../bin
 
-!win32 {
+!win32:!symbian {
     CONFIG += link_pkgconfig
     PKGCONFIG += fontconfig
 }
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 43f1318..2c2db92 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -32,6 +32,7 @@
 #include "config.h"
 
 #include "DumpRenderTreeQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
 #include "EventSenderQt.h"
 #include "GCControllerQt.h"
 #include "LayoutTestControllerQt.h"
@@ -39,12 +40,11 @@
 #include "testplugin.h"
 #include "WorkQueue.h"
 
+#include <QApplication>
 #include <QBuffer>
 #include <QCryptographicHash>
 #include <QDir>
 #include <QFile>
-#include <QApplication>
-#include <QUrl>
 #include <QFileInfo>
 #include <QFocusEvent>
 #include <QFontDatabase>
@@ -52,7 +52,13 @@
 #include <QNetworkAccessManager>
 #include <QNetworkReply>
 #include <QNetworkRequest>
+#include <QPaintDevice>
+#include <QPaintEngine>
+#ifndef QT_NO_PRINTER
+#include <QPrinter>
+#endif
 #include <QUndoStack>
+#include <QUrl>
 
 #include <qwebsettings.h>
 #include <qwebsecurityorigin.h>
@@ -66,6 +72,7 @@
 #endif
 
 #include <limits.h>
+#include <locale.h>
 
 #ifndef Q_OS_WIN
 #include <unistd.h>
@@ -73,20 +80,12 @@
 
 #include <qdebug.h>
 
-extern void qt_drt_run(bool b);
 extern void qt_dump_set_accepts_editing(bool b);
 extern void qt_dump_frame_loader(bool b);
-extern void qt_drt_clearFrameName(QWebFrame* qFrame);
-extern void qt_drt_overwritePluginDirectories();
-extern void qt_drt_resetOriginAccessWhiteLists();
-extern bool qt_drt_hasDocumentElement(QWebFrame* qFrame);
+extern void qt_dump_resource_load_callbacks(bool b);
 
 namespace WebCore {
 
-// Choose some default values.
-const unsigned int maxViewWidth = 800;
-const unsigned int maxViewHeight = 600;
-
 NetworkAccessManager::NetworkAccessManager(QObject* parent)
     : QNetworkAccessManager(parent)
 {
@@ -116,6 +115,26 @@
 }
 #endif
 
+
+#ifndef QT_NO_PRINTER
+class NullPrinter : public QPrinter {
+public:
+    class NullPaintEngine : public QPaintEngine {
+    public:
+        virtual bool begin(QPaintDevice*) { return true; }
+        virtual bool end() { return true; }
+        virtual QPaintEngine::Type type() const { return QPaintEngine::User; }
+        virtual void drawPixmap(const QRectF& r, const QPixmap& pm, const QRectF& sr) { }
+        virtual void updateState(const QPaintEngineState& state) { }
+    };
+
+    virtual QPaintEngine* paintEngine() const { return const_cast<NullPaintEngine*>(&m_engine); }
+
+    NullPaintEngine m_engine;
+};
+#endif
+
+
 WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
     : QWebPage(parent)
     , m_webInspector(0)
@@ -135,6 +154,7 @@
     globalSettings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
     globalSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
     globalSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false);
+    globalSettings->setAttribute(QWebSettings::SpatialNavigationEnabled, false);
 
     connect(this, SIGNAL(geometryChangeRequested(const QRect &)),
             this, SLOT(setViewGeometry(const QRect & )));
@@ -165,9 +185,16 @@
     settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows);
     settings()->resetAttribute(QWebSettings::JavascriptEnabled);
     settings()->resetAttribute(QWebSettings::PrivateBrowsingEnabled);
+    settings()->resetAttribute(QWebSettings::SpatialNavigationEnabled);
     settings()->resetAttribute(QWebSettings::LinksIncludedInFocusChain);
     settings()->resetAttribute(QWebSettings::OfflineWebApplicationCacheEnabled);
     settings()->resetAttribute(QWebSettings::LocalContentCanAccessRemoteUrls);
+    settings()->resetAttribute(QWebSettings::PluginsEnabled);
+
+    m_drt->layoutTestController()->setCaretBrowsingEnabled(false);
+    m_drt->layoutTestController()->setFrameFlatteningEnabled(false);
+    m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true);
+    m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false);
 
     // globalSettings must be reset explicitly.
     m_drt->layoutTestController()->setXSSAuditorEnabled(false);
@@ -315,16 +342,25 @@
     , m_enableTextOutput(false)
     , m_singleFileMode(false)
 {
-    qt_drt_overwritePluginDirectories();
-    QWebSettings::enablePersistentStorage();
+    DumpRenderTreeSupportQt::overwritePluginDirectories();
+
+    char* dumpRenderTreeTemp = getenv("DUMPRENDERTREE_TEMP");
+    if (dumpRenderTreeTemp)
+        QWebSettings::enablePersistentStorage(QString(dumpRenderTreeTemp));
+    else
+        QWebSettings::enablePersistentStorage();
 
     // create our primary testing page/view.
     m_mainView = new QWebView(0);
-    m_mainView->resize(QSize(maxViewWidth, maxViewHeight));
+    m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight));
     m_page = new WebPage(m_mainView, this);
     m_mainView->setPage(m_page);
     m_mainView->setContextMenuPolicy(Qt::NoContextMenu);
 
+    // clean up cache by resetting quota.
+    qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota();
+    webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
+
     // create our controllers. This has to be done before connectFrame,
     // as it exports there to the JavaScript DOM window.
     m_controller = new LayoutTestController(this);
@@ -348,6 +384,7 @@
     connect(m_page, SIGNAL(loadStarted()),
             m_controller, SLOT(resetLoadFinished()));
     connect(m_page, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));
+    connect(m_page, SIGNAL(printRequested(QWebFrame*)), this, SLOT(dryRunPrint(QWebFrame*)));
 
     connect(m_page->mainFrame(), SIGNAL(titleChanged(const QString&)),
             SLOT(titleChanged(const QString&)));
@@ -357,7 +394,8 @@
             this, SLOT(statusBarMessage(const QString&)));
 
     QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection);
-    qt_drt_run(true);
+
+    DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(true);
     QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason);
     QApplication::sendEvent(m_mainView, &event);
 }
@@ -381,6 +419,14 @@
     history->setMaximumItemCount(itemCount);
 }
 
+void DumpRenderTree::dryRunPrint(QWebFrame* frame)
+{
+#ifndef QT_NO_PRINTER
+    NullPrinter printer;
+    frame->print(&printer);
+#endif
+}
+
 void DumpRenderTree::resetToConsistentStateBeforeTesting()
 {
     // reset so that any current loads are stopped
@@ -395,18 +441,24 @@
     // of the DRT.
     m_controller->reset();
 
+    // reset mouse clicks counter
+    m_eventSender->resetClickCount();
+
     closeRemainingWindows();
 
     m_page->resetSettings();
     m_page->undoStack()->clear();
     m_page->mainFrame()->setZoomFactor(1.0);
     clearHistory(m_page);
-    qt_drt_clearFrameName(m_page->mainFrame());
+    DumpRenderTreeSupportQt::clearFrameName(m_page->mainFrame());
+
+    m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
+    m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded);
 
     WorkQueue::shared()->clear();
     WorkQueue::shared()->setFrozen(false);
 
-    qt_drt_resetOriginAccessWhiteLists();
+    DumpRenderTreeSupportQt::resetOriginAccessWhiteLists();
 
     QLocale::setDefault(QLocale::c());
     setlocale(LC_ALL, "");
@@ -419,20 +471,30 @@
     return false;
 }
 
+static bool shouldEnableDeveloperExtras(const QUrl& url)
+{
+    return isWebInspectorTest(url) || url.path().contains("inspector-enabled/");
+}
+
 void DumpRenderTree::open(const QUrl& url)
 {
     resetToConsistentStateBeforeTesting();
 
-    if (isWebInspectorTest(m_page->mainFrame()->url()))
+    if (shouldEnableDeveloperExtras(m_page->mainFrame()->url())) {
         layoutTestController()->closeWebInspector();
+        layoutTestController()->setDeveloperExtrasEnabled(false);
+    }
 
-    if (isWebInspectorTest(url))
-        layoutTestController()->showWebInspector();
+    if (shouldEnableDeveloperExtras(url)) {
+        layoutTestController()->setDeveloperExtrasEnabled(true);
+        if (isWebInspectorTest(url))
+            layoutTestController()->showWebInspector();
+    }
 
     // W3C SVG tests expect to be 480x360
     bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1");
-    int width = isW3CTest ? 480 : maxViewWidth;
-    int height = isW3CTest ? 360 : maxViewHeight;
+    int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth;
+    int height = isW3CTest ? 360 : LayoutTestController::maxViewHeight;
     m_mainView->resize(QSize(width, height));
     m_page->setPreferredContentsSize(QSize());
     m_page->setViewportSize(QSize(width, height));
@@ -441,7 +503,9 @@
     m_page->event(&ev);
 
     QWebSettings::clearMemoryCaches();
+#if !(defined(Q_WS_S60) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2))
     QFontDatabase::removeAllApplicationFonts();
+#endif
 #if defined(Q_WS_X11)
     initializeFonts();
 #endif
@@ -557,7 +621,7 @@
 
 QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame)
 {
-    if (!frame || !qt_drt_hasDocumentElement(frame))
+    if (!frame || !DumpRenderTreeSupportQt::hasDocumentElement(frame))
         return QString();
 
     QString result;
@@ -666,8 +730,9 @@
 
 void DumpRenderTree::dump()
 {
-    // Prevent any further frame load callbacks from appearing after we dump the result.
+    // Prevent any further frame load or resource load callbacks from appearing after we dump the result.
     qt_dump_frame_loader(false);
+    qt_dump_resource_load_callbacks(false);
 
     QWebFrame *mainFrame = m_page->mainFrame();
 
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
index 8d80f87..8309492 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -53,6 +53,7 @@
 class QWebFrame;
 
 class LayoutTestController;
+class DumpRenderTreeSupportQt;
 class EventSender;
 class TextInputController;
 class GCController;
@@ -118,6 +119,7 @@
 private Q_SLOTS:
     void showPage();
     void hidePage();
+    void dryRunPrint(QWebFrame*);
 
 private:
     QString dumpFramesAsText(QWebFrame* frame);
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
index 1ef2d3f..7432052 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -67,6 +67,8 @@
     endOfQueue = 0;
     startOfQueue = 0;
     m_eventLoop = 0;
+    m_currentButton = 0;
+    resetClickCount();
     m_page->view()->installEventFilter(this);
 }
 
@@ -92,11 +94,28 @@
         break;
     }
 
+    // only consider a click to count, an event originated by the
+    // same previous button and at the same position.
+    if (m_currentButton == button
+        && m_mousePos == m_clickPos
+        && m_clickTimer.isActive())
+        m_clickCount++;
+    else
+        m_clickCount = 1;
+
+    m_currentButton = button;
+    m_clickPos = m_mousePos;
     m_mouseButtons |= mouseButton;
 
 //     qDebug() << "EventSender::mouseDown" << frame;
-    QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonPress, m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+    QMouseEvent* event;
+    event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick :
+                    QEvent::MouseButtonPress, m_mousePos, m_mousePos,
+                    mouseButton, m_mouseButtons, Qt::NoModifier);
+
     sendOrQueueEvent(event);
+
+    m_clickTimer.start(QApplication::doubleClickInterval(), this);
 }
 
 void EventSender::mouseUp(int button)
@@ -289,11 +308,15 @@
 void EventSender::addTouchPoint(int x, int y)
 {
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    int id = m_touchPoints.count();
+    // Use index to refer to the position in the vector that this touch
+    // is stored. We then create a unique id for the touch that will be
+    // passed into WebCore.
+    int index = m_touchPoints.count();
+    int id = m_touchPoints.isEmpty() ? 0 : m_touchPoints.last().id() + 1;
     QTouchEvent::TouchPoint point(id);
     m_touchPoints.append(point);
-    updateTouchPoint(id, x, y);
-    m_touchPoints[id].setState(Qt::TouchPointPressed);
+    updateTouchPoint(index, x, y);
+    m_touchPoints[index].setState(Qt::TouchPointPressed);
 #endif
 }
 
@@ -510,3 +533,8 @@
     }
     return false;
 }
+
+void EventSender::timerEvent(QTimerEvent* ev)
+{
+    m_clickTimer.stop();
+}
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
index 38bca89..e824e0f 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
@@ -30,6 +30,7 @@
 #define EventSenderQt_h
 
 #include <QApplication>
+#include <QBasicTimer>
 #include <QEvent>
 #include <QEventLoop>
 #include <QMouseEvent>
@@ -50,6 +51,7 @@
 public:
     EventSender(QWebPage* parent);
     virtual bool eventFilter(QObject* watched, QEvent* event);
+    void resetClickCount() { m_clickCount = 0; }
 
 public slots:
     void mouseDown(int button = 0);
@@ -73,18 +75,24 @@
     void clearTouchPoints();
     void releaseTouchPoint(int index);
 
+protected:
+    void timerEvent(QTimerEvent*);
+
 private:
     void sendTouchEvent(QEvent::Type);
     void sendOrQueueEvent(QEvent*);
     void replaySavedEvents(bool flush);
     QPoint m_mousePos;
+    QPoint m_clickPos;
     Qt::MouseButtons m_mouseButtons;
     QWebPage* m_page;
-    int m_timeLeap;
+    int m_clickCount;
+    int m_currentButton;
     bool m_mouseButtonPressed;
     bool m_drag;
     QEventLoop* m_eventLoop;
     QWebFrame* frameUnderMouse() const;
+    QBasicTimer m_clickTimer;
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     QList<QTouchEvent::TouchPoint> m_touchPoints;
     Qt::KeyboardModifiers m_touchModifiers;
diff --git a/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
index 9cc3aa7..ba7e2c3 100644
--- a/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
@@ -29,14 +29,10 @@
 
 #include "config.h"
 #include "GCControllerQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
 
 #include <qwebpage.h>
 
-extern int qt_drt_javaScriptObjectsCount();
-extern void qt_drt_garbageCollector_collect();
-
-extern void qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone);
-
 GCController::GCController(QWebPage* parent)
     : QObject(parent)
 {
@@ -44,15 +40,15 @@
 
 void GCController::collect() const
 {
-    qt_drt_garbageCollector_collect();
+    DumpRenderTreeSupportQt::garbageCollectorCollect();
 }
 
 void GCController::collectOnAlternateThread(bool waitUntilDone) const
 {
-    qt_drt_garbageCollector_collectOnAlternateThread(waitUntilDone);
+    DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(waitUntilDone);
 }
 
 size_t GCController::getJSObjectCount() const
 {
-    return qt_drt_javaScriptObjectsCount();
+    return DumpRenderTreeSupportQt::javaScriptObjectsCount();
 }
diff --git a/WebKitTools/DumpRenderTree/qt/GCControllerQt.h b/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
index 8f5b432..ed2a858 100644
--- a/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
@@ -32,6 +32,7 @@
 #include <QObject>
 
 class QWebPage;
+class DumpRenderTreeSupportQt;
 
 class GCController : public QObject
 {
@@ -43,6 +44,7 @@
     void collect() const;
     void collectOnAlternateThread(bool waitUntilDone) const;
     size_t getJSObjectCount() const;
+
 };
 
 #endif
diff --git a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
index 636835a..74fabf8 100644
--- a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
+++ b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
@@ -1,9 +1,10 @@
 TARGET = ImageDiff
 CONFIG  -= app_bundle
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
 include(../../../WebKit.pri)
 INCLUDEPATH += ../../../JavaScriptCore
-DESTDIR = ../../../bin
+DESTDIR = $$OUTPUT_DIR/bin
 
 QT = core gui
 
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index a26bc3d..b95fe23 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -28,6 +28,7 @@
  */
 #include "config.h"
 #include "LayoutTestControllerQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
 
 #include "DumpRenderTreeQt.h"
 #include "WorkQueue.h"
@@ -36,32 +37,23 @@
 #include <QLocale>
 #include <qwebsettings.h>
 
+extern void qt_wrt_setViewMode(QWebPage* page, const QString& mode);
 extern void qt_dump_editing_callbacks(bool b);
 extern void qt_dump_frame_loader(bool b);
 extern void qt_dump_resource_load_callbacks(bool b);
-extern void qt_drt_setFrameSetFlatteningEnabled(QWebPage*, bool);
-extern void qt_drt_setJavaScriptProfilingEnabled(QWebFrame*, bool enabled);
-extern void qt_drt_setTimelineProfilingEnabled(QWebPage*, bool enabled);
-extern bool qt_drt_pauseAnimation(QWebFrame*, const QString& name, double time, const QString& elementId);
-extern bool qt_drt_pauseTransitionOfProperty(QWebFrame*, const QString& name, double time, const QString& elementId);
-extern bool qt_drt_pauseSVGAnimation(QWebFrame*, const QString& animationId, double time, const QString& elementId);
-extern int qt_drt_numberOfActiveAnimations(QWebFrame*);
-extern void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
+extern void qt_set_will_send_request_returns_null_on_redirect(bool b);
+extern void qt_set_will_send_request_returns_null(bool b);
+extern void qt_set_will_send_request_clear_headers(const QStringList& headers);
 
-extern void qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
-extern QString qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id);
-extern int qt_drt_workerThreadCount();
-extern int qt_drt_pageNumberForElementById(QWebFrame* qFrame, const QString& id, float width, float height);
-extern int qt_drt_numberOfPages(QWebFrame* qFrame, float width, float height);
-extern void qt_drt_webinspector_executeScript(QWebPage* page, long callId, const QString& script);
-extern void qt_drt_webinspector_show(QWebPage *page);
-extern void qt_drt_webinspector_close(QWebPage *page);
+extern void qt_dump_notification(bool b);
 
 LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
     : QObject()
     , m_drt(drt)
 {
+    qRegisterMetaType<QWebElement>("QWebElement");
     reset();
+    qt_dump_notification(true);
 }
 
 void LayoutTestController::reset()
@@ -85,6 +77,9 @@
     qt_dump_editing_callbacks(false);
     qt_dump_frame_loader(false);
     qt_dump_resource_load_callbacks(false);
+    qt_set_will_send_request_returns_null_on_redirect(false);
+    qt_set_will_send_request_returns_null(false);
+    qt_set_will_send_request_clear_headers(QStringList());
     emit hidePage();
 }
 
@@ -136,12 +131,17 @@
 {
     //qDebug() << ">>>>waitForDone";
     m_waitForDone = true;
-    m_timeoutTimer.start(15000, this);
+    m_timeoutTimer.start(30000, this);
 }
 
 QString LayoutTestController::counterValueForElementById(const QString& id)
 {
-    return qt_drt_counterValueForElementById(m_drt->webPage()->mainFrame(), id);
+    return DumpRenderTreeSupportQt::counterValueForElementById(m_drt->webPage()->mainFrame(), id);
+}
+
+void LayoutTestController::setViewModeMediaFeature(const QString& mode)
+{
+    qt_wrt_setViewMode(m_drt->webPage(), mode);
 }
 
 int LayoutTestController::webHistoryItemCount()
@@ -188,6 +188,17 @@
     return m_drt->windowCount();
 }
 
+void LayoutTestController::grantDesktopNotificationPermission(const QString& origin)
+{
+    // FIXME: Implement for notification security
+}
+
+bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin)
+{
+    // FIXME: Implement for notification security
+    return true;
+}
+
 void LayoutTestController::display()
 {
     emit showPage();
@@ -220,6 +231,21 @@
     qt_dump_resource_load_callbacks(true);
 }
 
+void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled)
+{
+    qt_set_will_send_request_returns_null_on_redirect(enabled);
+}
+
+void LayoutTestController::setWillSendRequestReturnsNull(bool enabled)
+{
+    qt_set_will_send_request_returns_null(enabled);
+}
+
+void LayoutTestController::setWillSendRequestClearHeader(const QStringList& headers)
+{
+    qt_set_will_send_request_clear_headers(headers);
+}
+
 void LayoutTestController::queueBackNavigation(int howFarBackward)
 {
     //qDebug() << ">>>queueBackNavigation" << howFarBackward;
@@ -290,27 +316,36 @@
     return decoded;
 }
 
+void LayoutTestController::setMediaType(const QString& type)
+{
+    DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type);
+}
 
 void LayoutTestController::closeWebInspector()
 {
-    qt_drt_webinspector_close(m_drt->webPage());
+    DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage());
     m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
 }
 
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+{
+    m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled);
+}
+
 void LayoutTestController::showWebInspector()
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
-    qt_drt_webinspector_show(m_drt->webPage());
+    DumpRenderTreeSupportQt::webInspectorShow(m_drt->webPage());
 }
 
 void LayoutTestController::evaluateInWebInspector(long callId, const QString& script)
 {
-    qt_drt_webinspector_executeScript(m_drt->webPage(), callId, script);
+    DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->webPage(), callId, script);
 }
 
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
 {
-    qt_drt_setFrameSetFlatteningEnabled(m_drt->webPage(), enabled);
+    DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled);
 }
 
 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -323,15 +358,20 @@
     m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled);
 }
 
+void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota)
+{
+    m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
+}
+
 void LayoutTestController::setJavaScriptProfilingEnabled(bool enable)
 {
-    m_topLoadingFrame->page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
-    qt_drt_setJavaScriptProfilingEnabled(m_topLoadingFrame, enable);
+    setDeveloperExtrasEnabled(enable);
+    DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(m_topLoadingFrame, enable);
 }
 
 void LayoutTestController::setTimelineProfilingEnabled(bool enable)
 {
-    qt_drt_setTimelineProfilingEnabled(m_drt->webPage(), enable);
+    DumpRenderTreeSupportQt::setTimelineProfilingEnabled(m_drt->webPage(), enable);
 }
 
 void LayoutTestController::setFixedContentsSize(int width, int height)
@@ -344,6 +384,11 @@
     m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable);
 }
 
+void LayoutTestController::setSpatialNavigationEnabled(bool enable)
+{
+    m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable);
+}
+
 void LayoutTestController::setPopupBlockingEnabled(bool enable)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable);
@@ -367,12 +412,12 @@
 
 void LayoutTestController::setXSSAuditorEnabled(bool enable)
 {
-    // Set XSSAuditorEnabled globally so that windows created by the test inherit it too.
+    // Set XSSAuditingEnabled globally so that windows created by the test inherit it too.
     // resetSettings() will call this to reset the page and global setting to false again.
     // Needed by http/tests/security/xssAuditor/link-opens-new-window.html
     QWebSettings* globalSettings = QWebSettings::globalSettings();
-    globalSettings->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
-    m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
+    globalSettings->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
+    m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
 }
 
 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName,
@@ -381,7 +426,7 @@
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     Q_ASSERT(frame);
-    return qt_drt_pauseAnimation(frame, animationName, time, elementId);
+    return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId);
 }
 
 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& propertyName,
@@ -390,7 +435,7 @@
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     Q_ASSERT(frame);
-    return qt_drt_pauseTransitionOfProperty(frame, propertyName, time, elementId);
+    return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId);
 }
 
 bool LayoutTestController::sampleSVGAnimationForElementAtTime(const QString& animationId,
@@ -399,14 +444,14 @@
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     Q_ASSERT(frame);
-    return qt_drt_pauseSVGAnimation(frame, animationId, time, elementId);
+    return DumpRenderTreeSupportQt::pauseSVGAnimation(frame, animationId, time, elementId);
 }
 
 unsigned LayoutTestController::numberOfActiveAnimations() const
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     Q_ASSERT(frame);
-    return qt_drt_numberOfActiveAnimations(frame);
+    return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
 }
 
 void LayoutTestController::disableImageLoading()
@@ -432,9 +477,14 @@
     QWebDatabase::removeAllDatabases();
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 {
-    qt_drt_whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+    DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+    // FIXME: Implement.
 }
 
 void LayoutTestController::waitForPolicyDelegate()
@@ -457,6 +507,10 @@
         settings->setFontSize(QWebSettings::DefaultFontSize, value.toInt());
     else if (name == "WebKitUsesPageCachePreferenceKey")
         QWebSettings::setMaximumPagesInCache(value.toInt());
+    else if (name == "WebKitEnableCaretBrowsing")
+        setCaretBrowsingEnabled(value.toBool());
+    else if (name == "WebKitPluginsEnabled")
+        settings->setAttribute(QWebSettings::PluginsEnabled, value.toBool());
     else
         printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n",
             name.toLatin1().data());
@@ -467,6 +521,11 @@
     m_userStyleSheetLocation = QUrl(url);
 }
 
+void LayoutTestController::setCaretBrowsingEnabled(bool value)
+{
+    DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->webPage(), value);
+}
+
 void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
 {
     if (enabled)
@@ -477,12 +536,12 @@
 
 void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
 {
-    qt_drt_setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
+    DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
 }
 
 int LayoutTestController::workerThreadCount()
 {
-    return qt_drt_workerThreadCount();
+    return DumpRenderTreeSupportQt::workerThreadCount();
 }
 
 int LayoutTestController::pageNumberForElementById(const QString& id, float width, float height)
@@ -493,10 +552,74 @@
         height = m_drt->webPage()->viewportSize().height();
     }
 
-    return qt_drt_pageNumberForElementById(m_drt->webPage()->mainFrame(), id, width, height);
+    return DumpRenderTreeSupportQt::pageNumberForElementById(m_drt->webPage()->mainFrame(), id, width, height);
 }
 
 int LayoutTestController::numberOfPages(float width, float height)
 {
-    return qt_drt_numberOfPages(m_drt->webPage()->mainFrame(), width, height);
+    return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height);
 }
+
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+    // FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27481
+    return false;
+}
+
+void LayoutTestController::setScrollbarPolicy(const QString& orientation, const QString& policy)
+{
+    Qt::Orientation o;
+    Qt::ScrollBarPolicy p;
+
+    if (orientation == "vertical")
+        o = Qt::Vertical;
+    else if (orientation == "horizontal")
+        o = Qt::Horizontal;
+    else
+        return;
+
+    if (policy == "on")
+        p = Qt::ScrollBarAlwaysOn;
+    else if (policy == "auto")
+        p = Qt::ScrollBarAsNeeded;
+    else if (policy == "off")
+        p = Qt::ScrollBarAlwaysOff;
+    else
+        return;
+
+    m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p);
+}
+
+void LayoutTestController::setSmartInsertDeleteEnabled(bool enable)
+{
+    DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->webPage(), enable);
+}
+
+void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool enable)
+{
+    DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->webPage(), enable);
+}
+
+void LayoutTestController::execCommand(const QString& name, const QString& value)
+{
+    DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->webPage(), name, value);
+}
+
+bool LayoutTestController::isCommandEnabled(const QString& name) const
+{
+    return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name);
+}
+
+QString LayoutTestController::markerTextForListItem(const QWebElement& listItem)
+{
+    return DumpRenderTreeSupportQt::markerTextForListItem(listItem);
+}
+
+void LayoutTestController::authenticateSession(const QString&, const QString&, const QString&)
+{
+    // FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use.
+}
+
+
+const unsigned LayoutTestController::maxViewWidth = 800;
+const unsigned LayoutTestController::maxViewHeight = 600;
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index d73794e..df645e1 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -40,12 +40,14 @@
 #include <QVariant>
 
 #include <qwebdatabase.h>
+#include <qwebelement.h>
 #include <qwebframe.h>
 #include <qwebhistory.h>
 #include <qwebpage.h>
 #include <qwebsecurityorigin.h>
 
 class QWebFrame;
+class DumpRenderTreeSupportQt;
 namespace WebCore {
     class DumpRenderTree;
 }
@@ -70,6 +72,9 @@
 
     void reset();
 
+    static const unsigned int maxViewWidth;
+    static const unsigned int maxViewHeight;
+
 protected:
     void timerEvent(QTimerEvent*);
 
@@ -98,6 +103,9 @@
     void dumpEditingCallbacks();
     void dumpFrameLoadCallbacks();
     void dumpResourceLoadCallbacks();
+    void setWillSendRequestReturnsNullOnRedirect(bool enabled);
+    void setWillSendRequestReturnsNull(bool enabled);
+    void setWillSendRequestClearHeader(const QStringList& headers);
     void queueBackNavigation(int howFarBackward);
     void queueForwardNavigation(int howFarForward);
     void queueLoad(const QString& url, const QString& target = QString());
@@ -107,6 +115,8 @@
     void provisionalLoad();
     void setCloseRemainingWindowsWhenComplete(bool = false) {}
     int windowCount();
+    void grantDesktopNotificationPermission(const QString& origin);
+    bool checkDesktopNotificationPermission(const QString& origin);
     void display();
     void clearBackForwardList();
     QString pathToLocalResource(const QString& url);
@@ -114,23 +124,33 @@
     QString encodeHostName(const QString& host);
     QString decodeHostName(const QString& host);
     void dumpSelectionRect() const {}
+    void setDeveloperExtrasEnabled(bool);
     void showWebInspector();
     void closeWebInspector();
     void evaluateInWebInspector(long callId, const QString& script);
 
-    void setFrameSetFlatteningEnabled(bool enable);
+    void setMediaType(const QString& type);
+    void setFrameFlatteningEnabled(bool enable);
     void setAllowUniversalAccessFromFileURLs(bool enable);
     void setAllowFileAccessFromFileURLs(bool enable);
+    void setAppCacheMaximumSize(unsigned long long quota);
     void setJavaScriptProfilingEnabled(bool enable);
     void setTimelineProfilingEnabled(bool enable);
     void setFixedContentsSize(int width, int height);
     void setPrivateBrowsingEnabled(bool enable);
+    void setSpatialNavigationEnabled(bool enabled);
     void setPopupBlockingEnabled(bool enable);
     void setPOSIXLocale(const QString& locale);
     void resetLoadFinished() { m_loadFinished = false; }
     void setWindowIsKey(bool isKey);
     void setMainFrameIsFirstResponder(bool isFirst);
     void setXSSAuditorEnabled(bool enable);
+    void setCaretBrowsingEnabled(bool enable);
+    void setViewModeMediaFeature(const QString& mode);
+    void setSmartInsertDeleteEnabled(bool enable);
+    void setSelectTrailingWhitespaceEnabled(bool enable);
+    void execCommand(const QString& name, const QString& value = QString());
+    bool isCommandEnabled(const QString& name) const;
 
     bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId);
     bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId);
@@ -138,7 +158,8 @@
 
     unsigned numberOfActiveAnimations() const;
 
-    void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+    void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+    void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
 
     void dispatchPendingLoadRequests();
     void disableImageLoading();
@@ -153,7 +174,19 @@
     void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
     int workerThreadCount();
     int pageNumberForElementById(const QString& id, float width = 0, float height = 0);
-    int numberOfPages(float width, float height);
+    int numberOfPages(float width = maxViewWidth, float height = maxViewHeight);
+    bool callShouldCloseOnWebView();
+
+    /*
+        Policy values: 'on', 'auto' or 'off'.
+        Orientation values: 'vertical' or 'horizontal'.
+    */
+    void setScrollbarPolicy(const QString& orientation, const QString& policy);
+
+    QString markerTextForListItem(const QWebElement& listItem);
+
+    // Simulate a request an embedding application could make, populating per-session credential storage.
+    void authenticateSession(const QString& url, const QString& username, const QString& password);
 
 private slots:
     void processWork();
diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
index 7b8162b..9b19231 100644
--- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
+++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
@@ -2,6 +2,7 @@
 TARGET = TestNetscapePlugIn
 
 VPATH = ../../unix/TestNetscapePlugin ../../TestNetscapePlugIn.subproj
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
 include(../../../../WebKit.pri)
 
 DESTDIR = $$OUTPUT_DIR/lib/plugins
diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp
index 7d72982..7d1c08c 100644
--- a/WebKitTools/DumpRenderTree/qt/main.cpp
+++ b/WebKitTools/DumpRenderTree/qt/main.cpp
@@ -93,7 +93,7 @@
     return s;
 }
 
-#ifndef Q_OS_WIN
+#if HAVE(SIGNAL_H)
 static NO_RETURN void crashHandler(int sig)
 {
     fprintf(stderr, "%s\n", strsignal(sig));
@@ -114,10 +114,7 @@
     WebCore::DumpRenderTree::initializeFonts();
 #endif
 
-#if QT_VERSION >= 0x040500
     QApplication::setGraphicsSystem("raster");
-#endif
-
     QApplication::setStyle(new QWindowsStyle);
 
     QFont f("Sans Serif");
@@ -132,7 +129,7 @@
     QX11Info::setAppDpiX(0, 96);
 #endif
 
-#ifndef Q_OS_WIN
+#if HAVE(SIGNAL_H)
     signal(SIGILL, crashHandler);    /* 4:   illegal instruction (not reset when caught) */
     signal(SIGTRAP, crashHandler);   /* 5:   trace trap (not reset when caught) */
     signal(SIGFPE, crashHandler);    /* 8:   floating point exception */
diff --git a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
index cb01267..a3c6773 100644
--- a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
+++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
@@ -58,6 +58,7 @@
 {
     if (browser->version >= 14) {
         PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
+        instance->pdata = obj;
 
         for (int i = 0; i < argc; i++) {
             if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
@@ -85,8 +86,11 @@
                 obj->testDocumentOpenInDestroyStream = TRUE;
             else if (strcasecmp(argn[i], "testwindowopen") == 0)
                 obj->testWindowOpen = TRUE;
+            else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+                obj->onSetWindow = strdup(argv[i]);
         }
-        instance->pdata = obj;
+
+        browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
     }
 
     return NPERR_NO_ERROR;
@@ -114,6 +118,9 @@
         if (obj->logDestroy)
             pluginLog(instance, "NPP_Destroy");
 
+        if (obj->onSetWindow)
+            free(obj->onSetWindow);
+
         browser->releaseobject(&obj->header);
     }
 
@@ -126,10 +133,14 @@
     PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
 
     if (obj) {
+        obj->lastWindow = *window;
+
         if (obj->logSetWindow) {
             pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height);
             obj->logSetWindow = false;
         }
+        if (obj->onSetWindow)
+            executeScript(obj, obj->onSetWindow);
 
         if (obj->testWindowOpen) {
             testWindowOpen(instance);
@@ -282,9 +293,17 @@
 }
 
 static NPError
-webkit_test_plugin_set_value(NPP /*instance*/, NPNVariable /*variable*/, void* /*value*/)
+webkit_test_plugin_set_value(NPP instance, NPNVariable variable, void* value)
 {
-    return NPERR_NO_ERROR;
+    PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+
+    switch (variable) {
+        case NPNVprivateModeBool:
+            obj->cachedPrivateBrowsingMode = *(NPBool*)value;
+            return NPERR_NO_ERROR;
+        default:
+            return NPERR_GENERIC_ERROR;
+    }
 }
 
 char *
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
index 6b35948..255bfc3 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
@@ -59,6 +59,12 @@
         JSValueUnprotect(frame->globalContext(), it->second);
 }
 
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    // FIXME: implement
+    return 0;
+}
+
 AccessibilityUIElement AccessibilityController::focusedElement()
 {
     COMPtr<IAccessible> rootAccessible = rootElement().platformUIElement();
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 301112f..9f00ae4 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -83,6 +83,18 @@
     return childCount;
 }
 
+int AccessibilityUIElement::rowCount()
+{
+    // FIXME: implement
+    return 0;
+}
+ 
+int AccessibilityUIElement::columnCount()
+{
+    // FIXME: implement
+    return 0;
+}
+
 AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
 {
     return 0;
@@ -224,6 +236,11 @@
     return JSStringCreateWithCharacters(0, 0);
 }
 
+JSStringRef AccessibilityUIElement::helpText() const
+{
+    return 0;
+}
+
 double AccessibilityUIElement::x()
 {
     long x, y, width, height;
@@ -477,6 +494,11 @@
     m_element->accDoDefaultAction(self());
 }
 
+void AccessibilityUIElement::press()
+{
+    // FIXME: implement
+}
+
 AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
 {
     return 0;
@@ -540,6 +562,11 @@
     return true;
 }
 
+void AccessibilityUIElement::removeNotificationListener()
+{
+    // FIXME: implement
+}
+
 bool AccessibilityUIElement::isSelectable() const
 {
     DWORD state = accessibilityState(m_element);
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index ddfca95..f9b40d1 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -84,6 +84,7 @@
 static bool leakChecking = false;
 static bool threaded = false;
 static bool forceComplexText = false;
+static bool printSupportedFeatures = false;
 static RetainPtr<CFStringRef> persistentUserStyleSheetLocation;
 
 volatile bool done;
@@ -731,6 +732,11 @@
     return strstr(pathOrURL, "/inspector/") || strstr(pathOrURL, "\\inspector\\");
 }
 
+static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+{
+    return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "/inspector-enabled/") || strstr(pathOrURL, "\\inspector-enabled\\");
+}
+
 static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
 {
 #ifdef USE_MAC_FONTS
@@ -790,7 +796,7 @@
         prefsPrivate->setExperimentalNotificationsEnabled(TRUE);
         prefsPrivate->setShouldPaintNativeControls(FALSE); // FIXME - need to make DRT pass with Windows native controls <http://bugs.webkit.org/show_bug.cgi?id=25592>
         prefsPrivate->setXSSAuditorEnabled(FALSE);
-        prefsPrivate->setFrameSetFlatteningEnabled(FALSE);
+        prefsPrivate->setFrameFlatteningEnabled(FALSE);
         prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE);
     }
     setAlwaysAcceptCookies(false);
@@ -836,7 +842,7 @@
         SetFocus(viewWindow);
 
     webViewPrivate->clearMainFrameName();
-    webViewPrivate->resetOriginAccessWhiteLists();
+    webViewPrivate->resetOriginAccessWhitelists();
 
     BSTR groupName;
     if (SUCCEEDED(webView->groupName(&groupName))) {
@@ -910,8 +916,11 @@
 
     resetWebViewToConsistentStateBeforeTesting();
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
-        gLayoutTestController->showWebInspector();
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+        gLayoutTestController->setDeveloperExtrasEnabled(true);
+        if (shouldOpenWebInspector(pathOrURL.c_str()))
+            gLayoutTestController->showWebInspector();
+    }
 
     prevTestBFItem = 0;
     if (webView) {
@@ -947,7 +956,7 @@
         DispatchMessage(&msg);
     }
 
-    if (shouldOpenWebInspector(pathOrURL.c_str()))
+    if (shouldEnableDeveloperExtras(pathOrURL.c_str()))
         gLayoutTestController->closeWebInspector();
 
     resetWebViewToConsistentStateBeforeTesting();
@@ -1222,6 +1231,11 @@
             continue;
         }
 
+        if (!stricmp(argv[i], "--print-supported-features")) {
+            printSupportedFeatures = true;
+            continue;
+        }
+
         tests.append(argv[i]);
     }
 
@@ -1246,6 +1260,20 @@
     standardPreferences->setJavaScriptEnabled(TRUE);
     standardPreferences->setDefaultFontSize(16);
 
+    if (printSupportedFeatures) {
+        BOOL acceleratedCompositingAvailable;
+        standardPreferences->acceleratedCompositingEnabled(&acceleratedCompositingAvailable);
+        BOOL threeDRenderingAvailable = 
+#if ENABLE(3D_RENDERING)
+            true;
+#else
+            false;
+#endif
+
+        printf("SupportedFeatures:%s %s\n", acceleratedCompositingAvailable ? "AcceleratedCompositing" : "", threeDRenderingAvailable ? "3DRendering" : "");
+        return 0;
+    }
+
     COMPtr<IWebView> webView(AdoptCOM, createWebViewAndOffscreenWindow(&webViewWindow));
     if (!webView)
         return -1;
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp
index 5a42b00..2a36d8d 100644
--- a/WebKitTools/DumpRenderTree/win/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp
@@ -667,20 +667,21 @@
     return eventSenderClass;
 }
 
-JSObjectRef makeEventSender(JSContextRef context)
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
 {
-    down = false;
-    dragMode = true;
-    replayingSavedEvents = false;
-    timeOffset = 0;
-    lastMousePosition.x = 0;
-    lastMousePosition.y = 0;
+    if (isTopFrame) {
+        down = false;
+        dragMode = true;
+        replayingSavedEvents = false;
+        timeOffset = 0;
+        lastMousePosition.x = 0;
+        lastMousePosition.y = 0;
 
-    endOfQueue = 0;
-    startOfQueue = 0;
+        endOfQueue = 0;
+        startOfQueue = 0;
 
-    didDragEnter = false;
-    draggingInfo = 0;
-
+        didDragEnter = false;
+        draggingInfo = 0;
+    }
     return JSObjectMake(context, getClass(context), 0);
 }
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.h b/WebKitTools/DumpRenderTree/win/EventSender.h
index 79d7dab..a0add85 100644
--- a/WebKitTools/DumpRenderTree/win/EventSender.h
+++ b/WebKitTools/DumpRenderTree/win/EventSender.h
@@ -35,7 +35,7 @@
 typedef const struct OpaqueJSContext* JSContextRef;
 typedef struct OpaqueJSValue* JSObjectRef;
 
-JSObjectRef makeEventSender(JSContextRef context);
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
 void replaySavedEvents(HRESULT* oleDragAndDropReturnValue = 0);
 
 extern DraggingInfo* draggingInfo;
diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
index 37d5e1c..29f99ab 100644
--- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
@@ -336,6 +336,9 @@
     JSGlobalContextRef context = frame->globalContext();
     JSObjectRef windowObject = JSContextGetGlobalObject(context);
 
+    IWebFrame* parentFrame = 0;
+    frame->parentFrame(&parentFrame);
+
     JSValueRef exception = 0;
 
     ::gLayoutTestController->makeWindowObject(context, windowObject, &exception);
@@ -348,7 +351,7 @@
     ASSERT(!exception);
 
     JSStringRef eventSenderStr = JSStringCreateWithUTF8CString("eventSender");
-    JSValueRef eventSender = makeEventSender(context);
+    JSValueRef eventSender = makeEventSender(context, !parentFrame);
     JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
     JSStringRelease(eventSenderStr);
 }
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 9f84488..24ddc3b 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -110,6 +110,21 @@
     backForwardList->goToItem(item.get());
 }
 
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+    COMPtr<IWebView> webView;
+    if (FAILED(frame->webView(&webView)))
+        return false;
+
+    COMPtr<IWebViewPrivate> viewPrivate;
+    if (FAILED(webView->QueryInterface(&viewPrivate)))
+        return false;
+
+    BOOL result;
+    viewPrivate->shouldClose(&result);
+    return result;
+}
+
 JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
 {
     // FIXME: Implement!
@@ -158,6 +173,33 @@
     history->setOptionalSharedHistory(sharedHistory.get());
 }
 
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{
+    // FIXME: Implement this.
+    return JSValueMakeUndefined(context);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+    COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+    if (!framePrivate)
+        return false;
+
+    BSTR textBSTR = 0;
+    HRESULT hr = framePrivate->layerTreeAsText(&textBSTR);
+
+    wstring text(textBSTR, SysStringLen(textBSTR));
+    SysFreeString(textBSTR);
+    JSRetainPtr<JSStringRef> textValueJS(Adopt, JSStringCreateWithCharacters(text.data(), text.length()));
+    return textValueJS;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+    // FIXME: Implement me.
+    return JSRetainPtr<JSStringRef>();
+}
+
 void LayoutTestController::waitForPolicyDelegate()
 {
     // FIXME: Implement this.
@@ -372,7 +414,7 @@
     prefsPrivate->setXSSAuditorEnabled(enabled);
 }
 
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
 {
     COMPtr<IWebView> webView;
     if (FAILED(frame->webView(&webView)))
@@ -386,7 +428,12 @@
     if (!prefsPrivate)
         return;
 
-    prefsPrivate->setFrameSetFlatteningEnabled(enabled);
+    prefsPrivate->setFrameFlatteningEnabled(enabled);
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+{
+    // FIXME: Implement for SpatialNavigation layout tests.
 }
 
 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -688,19 +735,11 @@
     if (FAILED(webView->QueryInterface(&viewPrivate)))
         return;
 
-    COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(&preferences)))
-        return;
-
-    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
-    if (!prefsPrivate)
-        return;
-
     COMPtr<IWebInspector> inspector;
     if (FAILED(viewPrivate->inspector(&inspector)))
         return;
 
-    prefsPrivate->setDeveloperExtrasEnabled(flag);
+    setDeveloperExtrasEnabled(flag);
     inspector->setJavaScriptProfilingEnabled(flag);
 }
 
@@ -717,7 +756,7 @@
     viewEditing->setSelectTrailingWhitespaceEnabled(flag ? TRUE : FALSE);
 }
 
-static const CFTimeInterval waitToDumpWatchdogInterval = 15.0;
+static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
 
 static void CALLBACK waitUntilDoneWatchdogFired(HWND, UINT, UINT_PTR, DWORD)
 {
@@ -950,13 +989,27 @@
     return _bstr_t(JSStringCopyBSTR(jsString), false);
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 {
     COMPtr<IWebViewPrivate> webView;
     if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
         return;
 
-    webView->whiteListAccessFromOrigin(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+    webView->addOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+    COMPtr<IWebViewPrivate> webView;
+    if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
+        return;
+
+    webView->removeOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+}
+
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+    // FIXME: implement
 }
 
 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
@@ -986,7 +1039,7 @@
     webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0);
 }
 
-void LayoutTestController::showWebInspector()
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
 {
     COMPtr<IWebView> webView;
     if (FAILED(frame->webView(&webView)))
@@ -1000,7 +1053,14 @@
     if (!prefsPrivate)
         return;
 
-    prefsPrivate->setDeveloperExtrasEnabled(true);
+    prefsPrivate->setDeveloperExtrasEnabled(enabled);
+}
+
+void LayoutTestController::showWebInspector()
+{
+    COMPtr<IWebView> webView;
+    if (FAILED(frame->webView(&webView)))
+        return;
 
     COMPtr<IWebViewPrivate> viewPrivate(Query, webView);
     if (!viewPrivate)
@@ -1026,16 +1086,6 @@
         return;
 
     inspector->close();
-
-    COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(&preferences)))
-        return;
-
-    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
-    if (!prefsPrivate)
-        return;
-
-    prefsPrivate->setDeveloperExtrasEnabled(false);
 }
 
 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -1169,3 +1219,29 @@
 {
 
 }
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+    COMPtr<IWebView> webView;
+    if (FAILED(frame->webView(&webView)))
+        return;
+
+    COMPtr<IWebBackForwardList> backForwardList;
+    if (FAILED(webView->backForwardList(&backForwardList)))
+        return;
+
+    COMPtr<IWebHistoryItem> item;
+    if (FAILED(backForwardList->currentItem(&item)))
+        return;
+
+    BOOL success;
+    webView->goToBackForwardItem(item.get(), &success);
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
diff --git a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
index 19bf84a..2e031da 100644
--- a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
@@ -31,28 +31,35 @@
 
 #include "DumpRenderTree.h"
 #include "LayoutTestController.h"
-#include <comutil.h>
 #include <WebKit/WebKitCOMAPI.h>
+#include <comutil.h>
+#include <sstream>
+#include <tchar.h>
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
-#include <sstream>
 
-
-using std::wstring;
-using std::wiostream;
+using namespace std;
 
 static inline wstring wstringFromBSTR(BSTR str)
 {
     return wstring(str, ::SysStringLen(str));
 }
 
-wstring wstringFromInt(int i)
+static inline wstring wstringFromInt(int i)
 {
-    std::wostringstream ss;
+    wostringstream ss;
     ss << i;
     return ss.str();
 }
 
+static inline BSTR BSTRFromString(const string& str)
+{
+    int length = ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), 0, 0);
+    BSTR result = ::SysAllocStringLen(0, length);
+    ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), result, length);
+    return result;
+}
+
 typedef HashMap<unsigned long, wstring> IdentifierMap;
 
 IdentifierMap& urlMap()
@@ -254,8 +261,16 @@
         return S_OK;
     }
 
-    request->AddRef();
-    *newRequest = request;
+    IWebMutableURLRequest* requestCopy = 0;
+    request->mutableCopy(&requestCopy);
+    const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+    for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
+      BSTR bstrHeader = BSTRFromString(*header);
+      requestCopy->setValue(0, bstrHeader);
+      SysFreeString(bstrHeader);
+    }
+
+    *newRequest = requestCopy;
     return S_OK;
 }
 
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
index 08a2f6a..eeacb7e 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
+++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
@@ -6,7 +6,7 @@
  redistribute this Apple software.
  
  In consideration of your agreement to abide by the following terms, and subject to these 
- terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in 
+ terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in
  this original Apple software (the "Apple Software"), to use, reproduce, modify and 
  redistribute the Apple Software, with or without modifications, in source and/or binary 
  forms; provided that if you redistribute the Apple Software in its entirety and without 
@@ -89,7 +89,8 @@
 {
     if (browser->version >= 14) {
         PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
-        
+        instance->pdata = obj;
+
         for (int16 i = 0; i < argc; i++) {
             if (_stricmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
                 obj->onStreamLoad = _strdup(argv[i]);
@@ -107,9 +108,11 @@
                 obj->testDocumentOpenInDestroyStream = TRUE;
               else if (_stricmp(argn[i], "testwindowopen") == 0)
                 obj->testWindowOpen = TRUE;
+            else if (_stricmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+                obj->onSetWindow = strdup(argv[i]);
         }
-        
-        instance->pdata = obj;
+
+        browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
     }
 
     return NPERR_NO_ERROR;
@@ -136,6 +139,9 @@
         if (obj->logDestroy)
             printf("PLUGIN: NPP_Destroy\n");
 
+        if (obj->onSetWindow)
+            free(obj->onSetWindow);
+
         browser->releaseobject(&obj->header);
     }
     return NPERR_NO_ERROR;
@@ -146,6 +152,11 @@
     PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
 
     if (obj) {
+        obj->lastWindow = *window;
+
+        if (obj->onSetWindow)
+            executeScript(obj, obj->onSetWindow);
+
         if (obj->testWindowOpen) {
             testWindowOpen(instance);
             obj->testWindowOpen = FALSE;
@@ -238,5 +249,13 @@
 
 NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
 {
-    return NPERR_GENERIC_ERROR;
+    PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+
+    switch (variable) {
+        case NPNVprivateModeBool:
+            obj->cachedPrivateBrowsingMode = *(NPBool*)value;
+            return NPERR_NO_ERROR;
+        default:
+            return NPERR_GENERIC_ERROR;
+    }
 }
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index ce1bda5..873e8d8 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -35,6 +35,8 @@
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <JavaScriptCore/JSStringRef.h>
 
+#include <stdio.h>
+
 
 
 LayoutTestController::~LayoutTestController()
@@ -170,7 +172,7 @@
     // FIXME: implement
 }
 
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
 {
     // FIXME: implement
 }
@@ -360,9 +362,19 @@
 
 }
 
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 {
+    // FIXME: implement
+}
 
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+    // FIXME: implement
+}
+
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+    // FIXME: implement
 }
 
 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id)
@@ -386,3 +398,36 @@
 {
 
 }
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool)
+{
+
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+    return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+    return 0;
+}
+
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
+{
+    return 0;
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
diff --git a/WebKitTools/EWSTools/boot.sh b/WebKitTools/EWSTools/boot.sh
new file mode 100644
index 0000000..733441e
--- /dev/null
+++ b/WebKitTools/EWSTools/boot.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# 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.
+
+screen -c ~/tools/screen-config
diff --git a/WebKitTools/EWSTools/create-webkit-git b/WebKitTools/EWSTools/create-webkit-git
new file mode 100644
index 0000000..0088a47
--- /dev/null
+++ b/WebKitTools/EWSTools/create-webkit-git
@@ -0,0 +1,36 @@
+#/bin/bash
+# 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.
+
+cd /mnt/git
+git clone git://git.webkit.org/WebKit.git webkit
+cd webkit
+git svn init -T trunk http://svn.webkit.org/repository/webkit
+git update-ref refs/remotes/trunk origin/master
+git svn rebase
+
diff --git a/WebKitTools/EWSTools/screen-config b/WebKitTools/EWSTools/screen-config
new file mode 100644
index 0000000..5c003df
--- /dev/null
+++ b/WebKitTools/EWSTools/screen-config
@@ -0,0 +1,4 @@
+screen -t style ./start-queue.sh style-queue
+screen -t qt ./start-queue.sh qt-ews
+screen -t kr ./start-queue.sh chromium-ews
+screen -t gtk ./start-queue.sh gtk-ews
diff --git a/WebKitTools/EWSTools/start-queue.sh b/WebKitTools/EWSTools/start-queue.sh
new file mode 100644
index 0000000..1e0403f
--- /dev/null
+++ b/WebKitTools/EWSTools/start-queue.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# 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.
+
+cd /mnt/git/webkit-$1
+while :
+do
+  git reset --hard
+  git clean -f
+  git svn rebase
+  ./WebKitTools/Scripts/webkit-patch $1 --no-confirm --exit-after-iteration 100
+done
diff --git a/WebKitTools/MiniBrowser/Makefile b/WebKitTools/MiniBrowser/Makefile
new file mode 100644
index 0000000..1f1dbbc
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Makefile
@@ -0,0 +1,2 @@
+SCRIPTS_PATH = ../Scripts
+include ../../Makefile.shared
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.vcproj b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
new file mode 100644
index 0000000..8b956e7
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="MiniBrowser"

+	ProjectGUID="{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}"

+	RootNamespace="MiniBrowser"

+	Keyword="Win32Proj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(WebKitOutputDir)\bin"

+			IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"

+			UseOfATL="1"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include&quot;"

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="2"

+				WarningLevel="3"

+				WarnAsError="true"

+				Detect64BitPortabilityProblems="false"

+				DebugInformationFormat="4"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="&quot;$(IntDir)\include&quot;;..\..\Internal\Safari\win\WTL80\include"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="shlwapi.lib WebKit2$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"

+				LinkIncremental="2"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				TypeLibraryFile=""

+				ComponentFileName=""

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(WebKitOutputDir)\bin"

+			IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"

+			UseOfATL="1"

+			CharacterSet="1"

+			WholeProgramOptimization="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include&quot;"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"

+				RuntimeLibrary="2"

+				UsePrecompiledHeader="2"

+				WarningLevel="3"

+				WarnAsError="true"

+				Detect64BitPortabilityProblems="false"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="&quot;$(IntDir)\include&quot;;..\Safari\win\WTL80\include"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="shlwapi.lib WebKit2$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"

+				LinkIncremental="1"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath=".\win\BrowserView.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\win\BrowserWindow.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\win\main.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\win\MiniBrowser.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\win\stdafx.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+			<File

+				RelativePath=".\win\BrowserView.h"

+				>

+			</File>

+			<File

+				RelativePath=".\win\BrowserWindow.h"

+				>

+			</File>

+			<File

+				RelativePath=".\win\MiniBrowser.h"

+				>

+			</File>

+			<File

+				RelativePath=".\win\Resource.h"

+				>

+			</File>

+			<File

+				RelativePath=".\win\stdafx.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+			<File

+				RelativePath=".\win\MiniBrowser.rc"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..6c5b9a1
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
@@ -0,0 +1,304 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 45;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
+		256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */; };
+		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+		BC329487116A92E2008635D0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329486116A92E2008635D0 /* main.m */; };
+		BC329498116A941B008635D0 /* BrowserWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329497116A941B008635D0 /* BrowserWindowController.m */; };
+		BC3294A3116A9852008635D0 /* BrowserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC3294A1116A9852008635D0 /* BrowserWindow.xib */; };
+		BC8FB5A8116AA1FE0080D413 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		089C165DFE840E0CC02AAC07 /* InfoPlist.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = InfoPlist.strings; path = mac/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+		13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+		1DDD58150DA1D0A300B32029 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = mac/English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+		256AC3D80F4B6AC300CF3369 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = mac/AppDelegate.h; sourceTree = "<group>"; };
+		256AC3D90F4B6AC300CF3369 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = mac/AppDelegate.m; sourceTree = "<group>"; };
+		256AC3F00F4B6AF500CF3369 /* MiniBrowser_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MiniBrowser_Prefix.pch; path = mac/MiniBrowser_Prefix.pch; sourceTree = "<group>"; };
+		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+		8D1107310486CEB800E47090 /* MiniBrowser-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "MiniBrowser-Info.plist"; path = "mac/MiniBrowser-Info.plist"; sourceTree = "<group>"; };
+		8D1107320486CEB800E47090 /* MiniBrowser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MiniBrowser.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		BC329486116A92E2008635D0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = mac/main.m; sourceTree = "<group>"; };
+		BC329496116A941B008635D0 /* BrowserWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrowserWindowController.h; path = mac/BrowserWindowController.h; sourceTree = "<group>"; };
+		BC329497116A941B008635D0 /* BrowserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserWindowController.m; path = mac/BrowserWindowController.m; sourceTree = "<group>"; };
+		BC3294A2116A9852008635D0 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = mac/English.lproj/BrowserWindow.xib; sourceTree = "<group>"; };
+		BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		8D11072E0486CEB800E47090 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+				BC8FB5A8116AA1FE0080D413 /* WebKit2.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		080E96DDFE201D6D7F000001 /* Classes */ = {
+			isa = PBXGroup;
+			children = (
+				256AC3D80F4B6AC300CF3369 /* AppDelegate.h */,
+				256AC3D90F4B6AC300CF3369 /* AppDelegate.m */,
+				BC329496116A941B008635D0 /* BrowserWindowController.h */,
+				BC329497116A941B008635D0 /* BrowserWindowController.m */,
+			);
+			name = Classes;
+			sourceTree = "<group>";
+		};
+		1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+				BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */,
+			);
+			name = "Linked Frameworks";
+			sourceTree = "<group>";
+		};
+		1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+				13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
+				29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+			);
+			name = "Other Frameworks";
+			sourceTree = "<group>";
+		};
+		19C28FACFE9D520D11CA2CBB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				8D1107320486CEB800E47090 /* MiniBrowser.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		29B97314FDCFA39411CA2CEA /* MiniBrowser */ = {
+			isa = PBXGroup;
+			children = (
+				080E96DDFE201D6D7F000001 /* Classes */,
+				29B97315FDCFA39411CA2CEA /* Other Sources */,
+				29B97317FDCFA39411CA2CEA /* Resources */,
+				29B97323FDCFA39411CA2CEA /* Frameworks */,
+				19C28FACFE9D520D11CA2CBB /* Products */,
+			);
+			name = MiniBrowser;
+			sourceTree = "<group>";
+		};
+		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+			isa = PBXGroup;
+			children = (
+				256AC3F00F4B6AF500CF3369 /* MiniBrowser_Prefix.pch */,
+				BC329486116A92E2008635D0 /* main.m */,
+			);
+			name = "Other Sources";
+			sourceTree = "<group>";
+		};
+		29B97317FDCFA39411CA2CEA /* Resources */ = {
+			isa = PBXGroup;
+			children = (
+				8D1107310486CEB800E47090 /* MiniBrowser-Info.plist */,
+				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+				BC3294A1116A9852008635D0 /* BrowserWindow.xib */,
+				1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
+			);
+			name = Resources;
+			sourceTree = "<group>";
+		};
+		29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+				1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		8D1107260486CEB800E47090 /* MiniBrowser */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */;
+			buildPhases = (
+				8D1107290486CEB800E47090 /* Resources */,
+				8D11072C0486CEB800E47090 /* Sources */,
+				8D11072E0486CEB800E47090 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = MiniBrowser;
+			productInstallPath = "$(HOME)/Applications";
+			productName = MiniBrowser;
+			productReference = 8D1107320486CEB800E47090 /* MiniBrowser.app */;
+			productType = "com.apple.product-type.application";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		29B97313FDCFA39411CA2CEA /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MiniBrowser" */;
+			compatibilityVersion = "Xcode 3.1";
+			hasScannedForEncodings = 1;
+			mainGroup = 29B97314FDCFA39411CA2CEA /* MiniBrowser */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				8D1107260486CEB800E47090 /* MiniBrowser */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		8D1107290486CEB800E47090 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+				1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+				BC3294A3116A9852008635D0 /* BrowserWindow.xib in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		8D11072C0486CEB800E47090 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */,
+				BC329487116A92E2008635D0 /* main.m in Sources */,
+				BC329498116A941B008635D0 /* BrowserWindowController.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+		089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				089C165DFE840E0CC02AAC07 /* InfoPlist.strings */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+		1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
+			isa = PBXVariantGroup;
+			children = (
+				1DDD58150DA1D0A300B32029 /* MainMenu.xib */,
+			);
+			name = MainMenu.xib;
+			sourceTree = "<group>";
+		};
+		BC3294A1116A9852008635D0 /* BrowserWindow.xib */ = {
+			isa = PBXVariantGroup;
+			children = (
+				BC3294A2116A9852008635D0 /* English */,
+			);
+			name = BrowserWindow.xib;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		C01FCF4B08A954540054247B /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch;
+				INFOPLIST_FILE = "mac/MiniBrowser-Info.plist";
+				INSTALL_PATH = "$(HOME)/Applications";
+				PRODUCT_NAME = MiniBrowser;
+			};
+			name = Debug;
+		};
+		C01FCF4C08A954540054247B /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_MODEL_TUNING = G5;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch;
+				INFOPLIST_FILE = "mac/MiniBrowser-Info.plist";
+				INSTALL_PATH = "$(HOME)/Applications";
+				PRODUCT_NAME = MiniBrowser;
+			};
+			name = Release;
+		};
+		C01FCF4F08A954540054247B /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				PREBINDING = NO;
+				SDKROOT = macosx10.6;
+			};
+			name = Debug;
+		};
+		C01FCF5008A954540054247B /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				PREBINDING = NO;
+				SDKROOT = macosx10.6;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C01FCF4B08A954540054247B /* Debug */,
+				C01FCF4C08A954540054247B /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MiniBrowser" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C01FCF4F08A954540054247B /* Debug */,
+				C01FCF5008A954540054247B /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.h b/WebKitTools/MiniBrowser/mac/AppDelegate.h
new file mode 100644
index 0000000..79683f3
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <WebKit2/WebKit2.h>
+
+@interface BrowserAppDelegate : NSObject <NSApplicationDelegate> {
+    WKProcessModel currentProcessModel;
+    WKPageNamespaceRef pageNamespace;
+}
+
+- (WKPageNamespaceRef)getPageNamespace;
+
+- (IBAction)setSharedProcessProcessModel:(id)sender;
+- (IBAction)setSharedThreadProcessModel:(id)sender;
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m
new file mode 100644
index 0000000..e10deb1
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import "AppDelegate.h"
+#import "BrowserWindowController.h"
+
+static NSString *defaultURL = @"http://webkit.org/";
+static const WKProcessModel defaultProcessModel = kWKProcessModelSecondaryProcess;
+
+@implementation BrowserAppDelegate
+
+- (id)init
+{
+    self = [super init];
+    if (self) {
+        if ([NSEvent modifierFlags] & NSShiftKeyMask)
+            currentProcessModel = kWKProcessModelSecondaryThread;
+        else
+            currentProcessModel = kWKProcessModelSecondaryProcess;
+    }
+
+    return self;
+}
+
+- (IBAction)newWindow:(id)sender
+{
+    BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:[self getPageNamespace]];
+    [[controller window] makeKeyAndOrderFront:sender];
+    
+    [controller loadURLString:defaultURL];
+}
+
+- (WKPageNamespaceRef)getPageNamespace
+{
+    if (!pageNamespace) {
+        WKContextRef context = WKContextCreateWithProcessModel(currentProcessModel);
+        pageNamespace = WKPageNamespaceCreate(context);
+        WKContextRelease(context);
+    }
+    
+    return pageNamespace;
+}
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+    if ([menuItem action] == @selector(setSharedProcessProcessModel:))
+        [menuItem setState:currentProcessModel == kWKProcessModelSecondaryProcess ? NSOnState : NSOffState];
+    else if ([menuItem action] == @selector(setSharedThreadProcessModel:))
+        [menuItem setState:currentProcessModel == kWKProcessModelSecondaryThread ? NSOnState : NSOffState];
+    return YES;
+}        
+
+- (void)_setProcessModel:(WKProcessModel)processModel
+{
+    if (processModel == currentProcessModel)
+        return;
+ 
+    currentProcessModel = processModel;
+    if (pageNamespace) {
+        WKPageNamespaceRelease(pageNamespace);
+        pageNamespace = 0;
+    }
+}
+
+- (IBAction)setSharedProcessProcessModel:(id)sender
+{
+    [self _setProcessModel:kWKProcessModelSecondaryProcess];
+}
+
+- (IBAction)setSharedThreadProcessModel:(id)sender
+{
+    [self _setProcessModel:kWKProcessModelSecondaryThread];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+    [self newWindow:self];
+}
+
+- (void)applicationWillTerminate:(NSNotification *)notification
+{
+    NSArray* windows = [NSApp windows];
+    for (NSWindow* window in windows) {
+        BrowserWindowController *controller = (BrowserWindowController *)[window delegate];
+        [controller applicationTerminating];
+    }
+
+    if (pageNamespace) {
+        WKPageNamespaceRelease(pageNamespace);
+        pageNamespace = 0;
+    }
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.h b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
new file mode 100644
index 0000000..f817e89
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+#import <WebKit2/WebKit2.h>
+
+@interface BrowserWindowController : NSWindowController {
+    IBOutlet NSProgressIndicator *progressIndicator;
+    IBOutlet NSButton *reloadButton;
+    IBOutlet NSTextField *urlText;
+    IBOutlet NSView *containerView;
+
+    WKPageNamespaceRef _pageNamespace;
+    WKView *_webView;
+}
+- (IBAction)fetch:(id)sender;
+- (IBAction)reload:(id)sender;
+- (IBAction)forceRepaint:(id)sender;
+
+- (IBAction)showHideWebView:(id)sender;
+- (IBAction)removeReinsertWebView:(id)sender;
+
+- (id)initWithPageNamespace:(WKPageNamespaceRef)pageNamespace;
+- (void)loadURLString:(NSString *)urlString;
+- (void)applicationTerminating;
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
new file mode 100644
index 0000000..b9306c0
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -0,0 +1,378 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import "BrowserWindowController.h"
+
+#import <WebKit2/WKStringCF.h>
+#import <WebKit2/WKURLCF.h>
+
+@interface BrowserWindowController ()
+- (void)didStartProgress;
+- (void)didChangeProgress:(double)value;
+- (void)didFinishProgress;
+@end
+
+@implementation BrowserWindowController
+
+- (id)initWithPageNamespace:(WKPageNamespaceRef)pageNamespace
+{
+    if (self = [super initWithWindowNibName:@"BrowserWindow"])
+        _pageNamespace = WKPageNamespaceRetain(pageNamespace);
+    
+    return self;
+}
+
+- (void)dealloc
+{
+    assert(!_pageNamespace);
+    [super dealloc];
+}
+
+- (IBAction)fetch:(id)sender
+{
+    CFURLRef cfURL = CFURLCreateWithString(0, (CFStringRef)[urlText stringValue], 0);
+    WKURLRef url = WKURLCreateWithCFURL(cfURL);
+    CFRelease(cfURL);
+
+    WKPageLoadURL(_webView.pageRef, url);
+    WKURLRelease(url);
+}
+
+- (IBAction)showHideWebView:(id)sender
+{
+    BOOL hidden = ![_webView isHidden];
+    
+    [_webView setHidden:hidden];
+}
+
+- (IBAction)removeReinsertWebView:(id)sender
+{
+    if ([_webView window]) {
+        [_webView retain];
+        [_webView removeFromSuperview]; 
+    } else {
+        [containerView addSubview:_webView];
+        [_webView release];
+    }
+}
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+    if ([menuItem action] == @selector(showHideWebView:))
+        [menuItem setTitle:[_webView isHidden] ? @"Show Web View" : @"Hide Web View"];
+    else if ([menuItem action] == @selector(removeReinsertWebView:))
+        [menuItem setTitle:[_webView window] ? @"Remove Web View" : @"Insert Web View"];
+    return YES;
+}
+
+- (IBAction)reload:(id)sender
+{
+    WKPageReload(_webView.pageRef);
+}
+
+- (IBAction)forceRepaint:(id)sender
+{
+    [_webView setNeedsDisplay:YES];
+}
+
+- (BOOL)windowShouldClose:(id)sender
+{
+    NSLog(@"windowShouldClose");
+    BOOL canCloseImmediately = WKPageTryClose(_webView.pageRef);
+    return canCloseImmediately;
+}
+
+- (void)windowWillClose:(NSNotification *)notification
+{
+    WKPageNamespaceRelease(_pageNamespace);
+    _pageNamespace = 0;
+}
+
+- (void)applicationTerminating
+{
+    WKPageClose(_webView.pageRef);
+    WKPageRelease(_webView.pageRef);
+}
+
+#pragma mark Loader Client Callbacks
+
+static void _didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didStartProvisionalLoadForFrame");
+}
+
+static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didReceiveServerRedirectForProvisionalLoadForFrame");
+}
+
+static void _didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didFailProvisionalLoadWithErrorForFrame");
+}
+
+static void _didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didCommitLoadForFrame");
+}
+
+static void _didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didFinishLoadForFrame");
+}
+
+static void _didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didFailLoadWithErrorForFrame");
+}
+
+static void _didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo)
+{
+    CFStringRef cfTitle = WKStringCopyCFString(0, title);
+    NSLog(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
+    CFRelease(cfTitle);
+}
+
+static void _didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didFirstLayoutForFrame");
+}
+
+static void _didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
+{
+    NSLog(@"didFirstVisuallyNonEmptyLayoutForFrame");
+}
+
+static void _didStartProgress(WKPageRef page, const void *clientInfo)
+{
+    [(BrowserWindowController *)clientInfo didStartProgress];
+}
+
+static void _didChangeProgress(WKPageRef page, double value, const void *clientInfo)
+{
+    [(BrowserWindowController *)clientInfo didChangeProgress:value];
+}
+
+static void _didFinishProgress(WKPageRef page, const void *clientInfo)
+{
+    [(BrowserWindowController *)clientInfo didFinishProgress];
+}
+
+static void _didBecomeUnresponsive(WKPageRef page, const void *clientInfo)
+{
+    NSLog(@"didBecomeUnresponsive");
+}
+
+static void _didBecomeResponsive(WKPageRef page, const void *clientInfo)
+{
+    NSLog(@"didBecomeResponsive");
+}
+
+#pragma mark Policy Client Callbacks
+
+static void _decidePolicyForNavigationAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+    NSLog(@"decidePolicyForNavigationAction");
+    WKFramePolicyListenerUse(listener);
+}
+
+static void _decidePolicyForNewWindowAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+    NSLog(@"decidePolicyForNewWindowAction");
+    WKFramePolicyListenerUse(listener);
+}
+
+static void _decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+    WKFramePolicyListenerUse(listener);
+}
+
+#pragma mark UI Client Callbacks
+
+static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo)
+{
+    NSLog(@"createNewPage");
+    BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)];
+    [controller loadWindow];
+
+    return controller->_webView.pageRef;
+}
+
+static void _showPage(WKPageRef page, const void *clientInfo)
+{
+    NSLog(@"showPage");
+    [[(BrowserWindowController *)clientInfo window] orderFront:nil];
+}
+
+static void _closePage(WKPageRef page, const void *clientInfo)
+{
+    NSLog(@"closePage");
+    WKPageClose(page);
+    [[(BrowserWindowController *)clientInfo window] close];
+    WKPageRelease(page);
+}
+
+static void _runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+{
+    NSAlert* alert = [[NSAlert alloc] init];
+
+    CFURLRef cfURL = WKURLCopyCFURL(0, WKFrameGetURL(frame));
+    [alert setMessageText:[NSString stringWithFormat:@"JavaScript Alert from %@.", [(NSURL *)cfURL absoluteString]]];
+    CFRelease(cfURL);
+
+    CFStringRef cfAlertText = WKStringCopyCFString(0, alertText);
+    [alert setInformativeText:(NSString *)alertText];
+    CFRelease(cfAlertText);
+
+    [alert addButtonWithTitle:@"OK"];
+
+    [alert runModal];
+    [alert release];
+}
+
+
+#pragma mark History Client Callbacks
+
+static void _didNavigateWithNavigationData(WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef frame, const void *clientInfo)
+{
+    CFStringRef title = WKStringCopyCFString(0, WKNavigationDataGetTitle(navigationData));
+    CFURLRef url = WKURLCopyCFURL(0, WKNavigationDataGetURL(navigationData));
+    NSLog(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
+    CFRelease(title);
+    CFRelease(url);
+}
+
+static void _didPerformClientRedirect(WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+    CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+    CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+    NSLog(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+    CFRelease(cfSourceURL);
+    CFRelease(cfDestinationURL);
+}
+
+static void _didPerformServerRedirect(WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+    CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+    CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+    NSLog(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+    CFRelease(cfSourceURL);
+    CFRelease(cfDestinationURL);
+}
+
+static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef frame, const void *clientInfo)
+{
+    CFStringRef cfTitle = WKStringCopyCFString(0, title);
+    CFURLRef cfURL = WKURLCopyCFURL(0, URL);
+    NSLog(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
+    CFRelease(cfTitle);
+    CFRelease(cfURL);
+}
+
+- (void)awakeFromNib
+{
+    _webView = [[WKView alloc] initWithFrame:[containerView frame] pageNamespaceRef:_pageNamespace];
+
+    [containerView addSubview:_webView];
+    [_webView setFrame:[containerView frame]];
+    
+    [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+    
+    WKPageLoaderClient loadClient = {
+        0,      /* version */
+        self,   /* clientInfo */
+        _didStartProvisionalLoadForFrame,
+        _didReceiveServerRedirectForProvisionalLoadForFrame,
+        _didFailProvisionalLoadWithErrorForFrame,
+        _didCommitLoadForFrame,
+        _didFinishLoadForFrame,
+        _didFailLoadWithErrorForFrame,
+        _didReceiveTitleForFrame,
+        _didFirstLayoutForFrame,
+        _didFirstVisuallyNonEmptyLayoutForFrame,
+        _didStartProgress,
+        _didChangeProgress,
+        _didFinishProgress,
+        _didBecomeUnresponsive,
+        _didBecomeResponsive
+    };
+    WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
+    
+    WKPagePolicyClient policyClient = {
+        0,          /* version */
+        self,       /* clientInfo */
+        _decidePolicyForNavigationAction,
+        _decidePolicyForNewWindowAction,
+        _decidePolicyForMIMEType
+    };
+    WKPageSetPagePolicyClient(_webView.pageRef, &policyClient);
+
+    WKPageUIClient uiClient = {
+        0,          /* version */
+        self,       /* clientInfo */
+        _createNewPage,
+        _showPage,
+        _closePage,
+        _runJavaScriptAlert
+    };
+    WKPageSetPageUIClient(_webView.pageRef, &uiClient);
+
+    WKPageHistoryClient historyClient = {
+        0,
+        self,
+        _didNavigateWithNavigationData,
+        _didPerformClientRedirect,
+        _didPerformServerRedirect,
+        _didUpdateHistoryTitle,
+    };
+
+    WKPageSetPageHistoryClient(_webView.pageRef, &historyClient);
+}
+
+- (void)didStartProgress
+{
+    [progressIndicator setDoubleValue:0.0];
+    [progressIndicator setHidden:NO];
+}
+
+- (void)didChangeProgress:(double)value
+{
+    [progressIndicator setDoubleValue:value];
+}
+
+- (void)didFinishProgress
+{
+    [progressIndicator setHidden:YES];
+    [progressIndicator setDoubleValue:1.0];
+}
+
+- (void)loadURLString:(NSString *)urlString
+{
+    // FIXME: We shouldn't have to set the url text here.
+    [urlText setStringValue:urlString];
+    [self fetch:nil];
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/English.lproj/BrowserWindow.xib b/WebKitTools/MiniBrowser/mac/English.lproj/BrowserWindow.xib
new file mode 100644
index 0000000..dbd4344
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/English.lproj/BrowserWindow.xib
@@ -0,0 +1,869 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+	<data>
+		<int key="IBDocument.SystemTarget">1060</int>
+		<string key="IBDocument.SystemVersion">10D573</string>
+		<string key="IBDocument.InterfaceBuilderVersion">740</string>
+		<string key="IBDocument.AppKitVersion">1038.29</string>
+		<string key="IBDocument.HIToolboxVersion">460.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+			<string key="NS.object.0">740</string>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="2"/>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys" id="0">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1001">
+				<string key="NSClassName">BrowserWindowController</string>
+			</object>
+			<object class="NSCustomObject" id="1003">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1004">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSWindowTemplate" id="1005">
+				<int key="NSWindowStyleMask">4111</int>
+				<int key="NSWindowBacking">2</int>
+				<string key="NSWindowRect">{{517, 280}, {776, 658}}</string>
+				<int key="NSWTFlags">544735232</int>
+				<string key="NSWindowTitle">Window</string>
+				<string key="NSWindowClass">NSWindow</string>
+				<nil key="NSViewClass"/>
+				<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+				<object class="NSView" key="NSWindowView" id="1006">
+					<reference key="NSNextResponder"/>
+					<int key="NSvFlags">256</int>
+					<object class="NSMutableArray" key="NSSubviews">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSCustomView" id="877383975">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">274</int>
+							<string key="NSFrameSize">{776, 608}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<int key="NSViewLayerContentsRedrawPolicy">2</int>
+							<string key="NSClassName">NSView</string>
+						</object>
+						<object class="NSTextField" id="690456651">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">266</int>
+							<string key="NSFrame">{{45, 618}, {699, 22}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<int key="NSViewLayerContentsRedrawPolicy">2</int>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSTextFieldCell" key="NSCell" id="1023147716">
+								<int key="NSCellFlags">-1804468671</int>
+								<int key="NSCellFlags2">268436480</int>
+								<string key="NSContents"/>
+								<object class="NSFont" key="NSSupport" id="1064395332">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">13</double>
+									<int key="NSfFlags">1044</int>
+								</object>
+								<reference key="NSControlView" ref="690456651"/>
+								<bool key="NSDrawsBackground">YES</bool>
+								<object class="NSColor" key="NSBackgroundColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">textBackgroundColor</string>
+									<object class="NSColor" key="NSColor">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MQA</bytes>
+									</object>
+								</object>
+								<object class="NSColor" key="NSTextColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">textColor</string>
+									<object class="NSColor" key="NSColor" id="365730878">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MAA</bytes>
+									</object>
+								</object>
+							</object>
+						</object>
+						<object class="NSProgressIndicator" id="128750774">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">1289</int>
+							<object class="NSPSMatrix" key="NSDrawMatrix"/>
+							<string key="NSFrame">{{752, 621}, {16, 16}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<int key="NSpiFlags">28936</int>
+							<double key="NSMaxValue">1</double>
+						</object>
+						<object class="NSButton" id="35464578">
+							<reference key="NSNextResponder" ref="1006"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{8, 616}, {29, 25}}</string>
+							<reference key="NSSuperview" ref="1006"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSButtonCell" key="NSCell" id="366486485">
+								<int key="NSCellFlags">-2080244224</int>
+								<int key="NSCellFlags2">134217728</int>
+								<string key="NSContents"/>
+								<reference key="NSSupport" ref="1064395332"/>
+								<reference key="NSControlView" ref="35464578"/>
+								<int key="NSButtonFlags">-2033434369</int>
+								<int key="NSButtonFlags2">163</int>
+								<object class="NSCustomResource" key="NSNormalImage">
+									<string key="NSClassName">NSImage</string>
+									<string key="NSResourceName">NSRefreshTemplate</string>
+								</object>
+								<string key="NSAlternateContents"/>
+								<string key="NSKeyEquivalent"/>
+								<int key="NSPeriodicDelay">400</int>
+								<int key="NSPeriodicInterval">75</int>
+							</object>
+						</object>
+					</object>
+					<string key="NSFrameSize">{776, 658}</string>
+					<reference key="NSSuperview"/>
+					<int key="NSViewLayerContentsRedrawPolicy">2</int>
+				</object>
+				<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
+				<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">window</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="1005"/>
+					</object>
+					<int key="connectionID">3</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="1005"/>
+						<reference key="destination" ref="1001"/>
+					</object>
+					<int key="connectionID">4</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">urlText</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="690456651"/>
+					</object>
+					<int key="connectionID">32</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">progressIndicator</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="128750774"/>
+					</object>
+					<int key="connectionID">33</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">reloadButton</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="35464578"/>
+					</object>
+					<int key="connectionID">34</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">reload:</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="35464578"/>
+					</object>
+					<int key="connectionID">35</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">fetch:</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="690456651"/>
+					</object>
+					<int key="connectionID">36</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">containerView</string>
+						<reference key="source" ref="1001"/>
+						<reference key="destination" ref="877383975"/>
+					</object>
+					<int key="connectionID">37</int>
+				</object>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<reference key="object" ref="0"/>
+						<reference key="children" ref="1000"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1001"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1003"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1004"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">Application</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1</int>
+						<reference key="object" ref="1005"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1006"/>
+						</object>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">2</int>
+						<reference key="object" ref="1006"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="690456651"/>
+							<reference ref="128750774"/>
+							<reference ref="35464578"/>
+							<reference ref="877383975"/>
+						</object>
+						<reference key="parent" ref="1005"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">10</int>
+						<reference key="object" ref="690456651"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1023147716"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">11</int>
+						<reference key="object" ref="1023147716"/>
+						<reference key="parent" ref="690456651"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">21</int>
+						<reference key="object" ref="128750774"/>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="35464578"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="366486485"/>
+						</object>
+						<reference key="parent" ref="1006"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="366486485"/>
+						<reference key="parent" ref="35464578"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">9</int>
+						<reference key="object" ref="877383975"/>
+						<reference key="parent" ref="1006"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>1.IBEditorWindowLastContentRect</string>
+					<string>1.IBPluginDependency</string>
+					<string>1.IBWindowTemplateEditedContentRect</string>
+					<string>1.NSWindowTemplate.visibleAtLaunch</string>
+					<string>1.WindowOrigin</string>
+					<string>1.editorWindowContentRectSynchronizationRect</string>
+					<string>10.IBPluginDependency</string>
+					<string>11.IBPluginDependency</string>
+					<string>2.IBPluginDependency</string>
+					<string>21.IBPluginDependency</string>
+					<string>21.IBViewIntegration.shadowBlurRadius</string>
+					<string>21.IBViewIntegration.shadowColor</string>
+					<string>21.IBViewIntegration.shadowOffsetHeight</string>
+					<string>21.IBViewIntegration.shadowOffsetWidth</string>
+					<string>23.IBPluginDependency</string>
+					<string>24.IBPluginDependency</string>
+					<string>9.IBPluginDependency</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>{{308, 154}, {776, 658}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{308, 154}, {776, 658}}</string>
+					<integer value="1"/>
+					<string>{196, 240}</string>
+					<string>{{202, 428}, {480, 270}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<real value="0.0"/>
+					<reference ref="365730878"/>
+					<real value="0.0"/>
+					<real value="0.0"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization"/>
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID"/>
+			<int key="maxID">37</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">BrowserWindowController</string>
+					<string key="superclassName">NSWindowController</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>fetch:</string>
+							<string>reload:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>containerView</string>
+							<string>progressIndicator</string>
+							<string>reloadButton</string>
+							<string>urlText</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSView</string>
+							<string>NSProgressIndicator</string>
+							<string>NSButton</string>
+							<string>NSTextField</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">mac/BrowserWindowController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">BrowserWindowController</string>
+					<string key="superclassName">NSWindowController</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSActionCell</string>
+					<string key="superclassName">NSCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="558771426">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="344596456">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="428409299">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSButton</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSButtonCell</string>
+					<string key="superclassName">NSActionCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSCell</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSControl</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="297186634">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSFormatter</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMenu</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="808053469">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="558771426"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="344596456"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="428409299"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="297186634"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="808053469"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="555757547">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSProgressIndicator</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextField</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextFieldCell</string>
+					<string key="superclassName">NSActionCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<string key="superclassName">NSResponder</string>
+					<reference key="sourceIdentifier" ref="555757547"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindowController</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">showWindow:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+					</object>
+				</object>
+			</object>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+			<integer value="1060" key="NS.object.0"/>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+			<integer value="3000" key="NS.object.0"/>
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<string key="IBDocument.LastKnownRelativeProjectPath">../../MiniBrowser.xcodeproj</string>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>
diff --git a/WebKitTools/MiniBrowser/mac/English.lproj/InfoPlist.strings b/WebKitTools/MiniBrowser/mac/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..477b28f
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/English.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/WebKitTools/MiniBrowser/mac/English.lproj/MainMenu.xib b/WebKitTools/MiniBrowser/mac/English.lproj/MainMenu.xib
new file mode 100644
index 0000000..ca3010c
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/English.lproj/MainMenu.xib
@@ -0,0 +1,4603 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+	<data>
+		<int key="IBDocument.SystemTarget">1060</int>
+		<string key="IBDocument.SystemVersion">10D573</string>
+		<string key="IBDocument.InterfaceBuilderVersion">783</string>
+		<string key="IBDocument.AppKitVersion">1038.29</string>
+		<string key="IBDocument.HIToolboxVersion">460.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+			<string key="NS.object.0">783</string>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="535"/>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys" id="0">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1021">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSCustomObject" id="1014">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1050">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSMenu" id="649796088">
+				<string key="NSTitle">AMainMenu</string>
+				<object class="NSMutableArray" key="NSMenuItems">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="NSMenuItem" id="694149608">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">MiniBrowser</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<object class="NSCustomResource" key="NSOnImage" id="35465992">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">NSMenuCheckmark</string>
+						</object>
+						<object class="NSCustomResource" key="NSMixedImage" id="502551668">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">NSMenuMixedState</string>
+						</object>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="110575045">
+							<string key="NSTitle">MiniBrowser</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="238522557">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">About MiniBrowser</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="304266470">
+									<reference key="NSMenu" ref="110575045"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="609285721">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Preferences…</string>
+									<string key="NSKeyEquiv">,</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="481834944">
+									<reference key="NSMenu" ref="110575045"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1046388886">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Services</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="752062318">
+										<string key="NSTitle">Services</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+										</object>
+										<string key="NSName">_NSServicesMenu</string>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="646227648">
+									<reference key="NSMenu" ref="110575045"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="755159360">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Hide MiniBrowser</string>
+									<string key="NSKeyEquiv">h</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="342932134">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Hide Others</string>
+									<string key="NSKeyEquiv">h</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="908899353">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Show All</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1056857174">
+									<reference key="NSMenu" ref="110575045"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="632727374">
+									<reference key="NSMenu" ref="110575045"/>
+									<string key="NSTitle">Quit MiniBrowser</string>
+									<string key="NSKeyEquiv">q</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+							<string key="NSName">_NSAppleMenu</string>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="379814623">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">File</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="720053764">
+							<string key="NSTitle">File</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="705341025">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">New Window</string>
+									<string key="NSKeyEquiv">n</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="722745758">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Open…</string>
+									<string key="NSKeyEquiv">o</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1025936716">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Open Recent</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="1065607017">
+										<string key="NSTitle">Open Recent</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="759406840">
+												<reference key="NSMenu" ref="1065607017"/>
+												<string key="NSTitle">Clear Menu</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+										<string key="NSName">_NSRecentDocumentsMenu</string>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="425164168">
+									<reference key="NSMenu" ref="720053764"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="776162233">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Close</string>
+									<string key="NSKeyEquiv">w</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1023925487">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Save</string>
+									<string key="NSKeyEquiv">s</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="117038363">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Save As…</string>
+									<string key="NSKeyEquiv">S</string>
+									<int key="NSKeyEquivModMask">1179648</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="579971712">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Revert to Saved</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1010469920">
+									<reference key="NSMenu" ref="720053764"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="294629803">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Page Setup...</string>
+									<string key="NSKeyEquiv">P</string>
+									<int key="NSKeyEquivModMask">1179648</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSToolTip"/>
+								</object>
+								<object class="NSMenuItem" id="49223823">
+									<reference key="NSMenu" ref="720053764"/>
+									<string key="NSTitle">Print…</string>
+									<string key="NSKeyEquiv">p</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="952259628">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Edit</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="789758025">
+							<string key="NSTitle">Edit</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="1058277027">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Undo</string>
+									<string key="NSKeyEquiv">z</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="790794224">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Redo</string>
+									<string key="NSKeyEquiv">Z</string>
+									<int key="NSKeyEquivModMask">1179648</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1040322652">
+									<reference key="NSMenu" ref="789758025"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="296257095">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Cut</string>
+									<string key="NSKeyEquiv">x</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="860595796">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Copy</string>
+									<string key="NSKeyEquiv">c</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="29853731">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Paste</string>
+									<string key="NSKeyEquiv">v</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="82994268">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Paste and Match Style</string>
+									<string key="NSKeyEquiv">V</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="437104165">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Delete</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="583158037">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Select All</string>
+									<string key="NSKeyEquiv">a</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="212016141">
+									<reference key="NSMenu" ref="789758025"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="892235320">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Find</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="963351320">
+										<string key="NSTitle">Find</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="447796847">
+												<reference key="NSMenu" ref="963351320"/>
+												<string key="NSTitle">Find…</string>
+												<string key="NSKeyEquiv">f</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">1</int>
+											</object>
+											<object class="NSMenuItem" id="326711663">
+												<reference key="NSMenu" ref="963351320"/>
+												<string key="NSTitle">Find Next</string>
+												<string key="NSKeyEquiv">g</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">2</int>
+											</object>
+											<object class="NSMenuItem" id="270902937">
+												<reference key="NSMenu" ref="963351320"/>
+												<string key="NSTitle">Find Previous</string>
+												<string key="NSKeyEquiv">G</string>
+												<int key="NSKeyEquivModMask">1179648</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">3</int>
+											</object>
+											<object class="NSMenuItem" id="159080638">
+												<reference key="NSMenu" ref="963351320"/>
+												<string key="NSTitle">Use Selection for Find</string>
+												<string key="NSKeyEquiv">e</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">7</int>
+											</object>
+											<object class="NSMenuItem" id="88285865">
+												<reference key="NSMenu" ref="963351320"/>
+												<string key="NSTitle">Jump to Selection</string>
+												<string key="NSKeyEquiv">j</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="972420730">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Spelling and Grammar</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="769623530">
+										<string key="NSTitle">Spelling and Grammar</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="679648819">
+												<reference key="NSMenu" ref="769623530"/>
+												<string key="NSTitle">Show Spelling and Grammar</string>
+												<string key="NSKeyEquiv">:</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="96193923">
+												<reference key="NSMenu" ref="769623530"/>
+												<string key="NSTitle">Check Document Now</string>
+												<string key="NSKeyEquiv">;</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="859480356">
+												<reference key="NSMenu" ref="769623530"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="948374510">
+												<reference key="NSMenu" ref="769623530"/>
+												<string key="NSTitle">Check Spelling While Typing</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="967646866">
+												<reference key="NSMenu" ref="769623530"/>
+												<string key="NSTitle">Check Grammar With Spelling</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="795346622">
+												<reference key="NSMenu" ref="769623530"/>
+												<string key="NSTitle">Correct Spelling Automatically</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="507821607">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Substitutions</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="698887838">
+										<string key="NSTitle">Substitutions</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="65139061">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Show Substitutions</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="19036812">
+												<reference key="NSMenu" ref="698887838"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="605118523">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Smart Copy/Paste</string>
+												<string key="NSKeyEquiv">f</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">1</int>
+											</object>
+											<object class="NSMenuItem" id="197661976">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Smart Quotes</string>
+												<string key="NSKeyEquiv">g</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">2</int>
+											</object>
+											<object class="NSMenuItem" id="672708820">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Smart Dashes</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="708854459">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Smart Links</string>
+												<string key="NSKeyEquiv">G</string>
+												<int key="NSKeyEquivModMask">1179648</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">3</int>
+											</object>
+											<object class="NSMenuItem" id="537092702">
+												<reference key="NSMenu" ref="698887838"/>
+												<string key="NSTitle">Text Replacement</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="288088188">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Transformations</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="579392910">
+										<string key="NSTitle">Transformations</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="1060694897">
+												<reference key="NSMenu" ref="579392910"/>
+												<string key="NSTitle">Make Upper Case</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="879586729">
+												<reference key="NSMenu" ref="579392910"/>
+												<string key="NSTitle">Make Lower Case</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="56570060">
+												<reference key="NSMenu" ref="579392910"/>
+												<string key="NSTitle">Capitalize</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="676164635">
+									<reference key="NSMenu" ref="789758025"/>
+									<string key="NSTitle">Speech</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="785027613">
+										<string key="NSTitle">Speech</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="731782645">
+												<reference key="NSMenu" ref="785027613"/>
+												<string key="NSTitle">Start Speaking</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="680220178">
+												<reference key="NSMenu" ref="785027613"/>
+												<string key="NSTitle">Stop Speaking</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="302598603">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Format</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="941447902">
+							<string key="NSTitle">Format</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="792887677">
+									<reference key="NSMenu" ref="941447902"/>
+									<string key="NSTitle">Font</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="786677654">
+										<string key="NSTitle">Font</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="159677712">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Show Fonts</string>
+												<string key="NSKeyEquiv">t</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="305399458">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Bold</string>
+												<string key="NSKeyEquiv">b</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">2</int>
+											</object>
+											<object class="NSMenuItem" id="814362025">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Italic</string>
+												<string key="NSKeyEquiv">i</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">1</int>
+											</object>
+											<object class="NSMenuItem" id="330926929">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Underline</string>
+												<string key="NSKeyEquiv">u</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="533507878">
+												<reference key="NSMenu" ref="786677654"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="158063935">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Bigger</string>
+												<string key="NSKeyEquiv">+</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">3</int>
+											</object>
+											<object class="NSMenuItem" id="885547335">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Smaller</string>
+												<string key="NSKeyEquiv">-</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<int key="NSTag">4</int>
+											</object>
+											<object class="NSMenuItem" id="901062459">
+												<reference key="NSMenu" ref="786677654"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="767671776">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Kern</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<string key="NSAction">submenuAction:</string>
+												<object class="NSMenu" key="NSSubmenu" id="175441468">
+													<string key="NSTitle">Kern</string>
+													<object class="NSMutableArray" key="NSMenuItems">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSMenuItem" id="252969304">
+															<reference key="NSMenu" ref="175441468"/>
+															<string key="NSTitle">Use Default</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="766922938">
+															<reference key="NSMenu" ref="175441468"/>
+															<string key="NSTitle">Use None</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="677519740">
+															<reference key="NSMenu" ref="175441468"/>
+															<string key="NSTitle">Tighten</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="238351151">
+															<reference key="NSMenu" ref="175441468"/>
+															<string key="NSTitle">Loosen</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+													</object>
+												</object>
+											</object>
+											<object class="NSMenuItem" id="691570813">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Ligature</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<string key="NSAction">submenuAction:</string>
+												<object class="NSMenu" key="NSSubmenu" id="1058217995">
+													<string key="NSTitle">Ligature</string>
+													<object class="NSMutableArray" key="NSMenuItems">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSMenuItem" id="706297211">
+															<reference key="NSMenu" ref="1058217995"/>
+															<string key="NSTitle">Use Default</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="568384683">
+															<reference key="NSMenu" ref="1058217995"/>
+															<string key="NSTitle">Use None</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="663508465">
+															<reference key="NSMenu" ref="1058217995"/>
+															<string key="NSTitle">Use All</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+													</object>
+												</object>
+											</object>
+											<object class="NSMenuItem" id="769124883">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Baseline</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<string key="NSAction">submenuAction:</string>
+												<object class="NSMenu" key="NSSubmenu" id="18263474">
+													<string key="NSTitle">Baseline</string>
+													<object class="NSMutableArray" key="NSMenuItems">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSMenuItem" id="257962622">
+															<reference key="NSMenu" ref="18263474"/>
+															<string key="NSTitle">Use Default</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="644725453">
+															<reference key="NSMenu" ref="18263474"/>
+															<string key="NSTitle">Superscript</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="1037576581">
+															<reference key="NSMenu" ref="18263474"/>
+															<string key="NSTitle">Subscript</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="941806246">
+															<reference key="NSMenu" ref="18263474"/>
+															<string key="NSTitle">Raise</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="1045724900">
+															<reference key="NSMenu" ref="18263474"/>
+															<string key="NSTitle">Lower</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+													</object>
+												</object>
+											</object>
+											<object class="NSMenuItem" id="739652853">
+												<reference key="NSMenu" ref="786677654"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="1012600125">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Show Colors</string>
+												<string key="NSKeyEquiv">C</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="214559597">
+												<reference key="NSMenu" ref="786677654"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="596732606">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Copy Style</string>
+												<string key="NSKeyEquiv">c</string>
+												<int key="NSKeyEquivModMask">1572864</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="393423671">
+												<reference key="NSMenu" ref="786677654"/>
+												<string key="NSTitle">Paste Style</string>
+												<string key="NSKeyEquiv">v</string>
+												<int key="NSKeyEquivModMask">1572864</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+										<string key="NSName">_NSFontMenu</string>
+									</object>
+								</object>
+								<object class="NSMenuItem" id="215659978">
+									<reference key="NSMenu" ref="941447902"/>
+									<string key="NSTitle">Text</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="446991534">
+										<string key="NSTitle">Text</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="875092757">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Align Left</string>
+												<string key="NSKeyEquiv">{</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="630155264">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Center</string>
+												<string key="NSKeyEquiv">|</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="945678886">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Justify</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="512868991">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Align Right</string>
+												<string key="NSKeyEquiv">}</string>
+												<int key="NSKeyEquivModMask">1048576</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="163117631">
+												<reference key="NSMenu" ref="446991534"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="31516759">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Writing Direction</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+												<string key="NSAction">submenuAction:</string>
+												<object class="NSMenu" key="NSSubmenu" id="956096989">
+													<string key="NSTitle">Writing Direction</string>
+													<object class="NSMutableArray" key="NSMenuItems">
+														<bool key="EncodedWithXMLCoder">YES</bool>
+														<object class="NSMenuItem" id="257099033">
+															<reference key="NSMenu" ref="956096989"/>
+															<bool key="NSIsDisabled">YES</bool>
+															<string key="NSTitle">Paragraph</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="551969625">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="249532473">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="607364498">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="508151438">
+															<reference key="NSMenu" ref="956096989"/>
+															<bool key="NSIsDisabled">YES</bool>
+															<bool key="NSIsSeparator">YES</bool>
+															<string key="NSTitle"/>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="981751889">
+															<reference key="NSMenu" ref="956096989"/>
+															<bool key="NSIsDisabled">YES</bool>
+															<string key="NSTitle">Selection</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="380031999">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CURlZmF1bHQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="825984362">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CUxlZnQgdG8gUmlnaHQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+														<object class="NSMenuItem" id="560145579">
+															<reference key="NSMenu" ref="956096989"/>
+															<string type="base64-UTF8" key="NSTitle">CVJpZ2h0IHRvIExlZnQ</string>
+															<string key="NSKeyEquiv"/>
+															<int key="NSMnemonicLoc">2147483647</int>
+															<reference key="NSOnImage" ref="35465992"/>
+															<reference key="NSMixedImage" ref="502551668"/>
+														</object>
+													</object>
+												</object>
+											</object>
+											<object class="NSMenuItem" id="908105787">
+												<reference key="NSMenu" ref="446991534"/>
+												<bool key="NSIsDisabled">YES</bool>
+												<bool key="NSIsSeparator">YES</bool>
+												<string key="NSTitle"/>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="644046920">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Show Ruler</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="231811626">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Copy Ruler</string>
+												<string key="NSKeyEquiv">c</string>
+												<int key="NSKeyEquivModMask">1310720</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="883618387">
+												<reference key="NSMenu" ref="446991534"/>
+												<string key="NSTitle">Paste Ruler</string>
+												<string key="NSKeyEquiv">v</string>
+												<int key="NSKeyEquivModMask">1310720</int>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="586577488">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">View</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="466310130">
+							<string key="NSTitle">View</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="102151532">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Show Toolbar</string>
+									<string key="NSKeyEquiv">t</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="237841660">
+									<reference key="NSMenu" ref="466310130"/>
+									<string key="NSTitle">Customize Toolbar…</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="713487014">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Window</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSKeyEquivModMask">1048576</int>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="835318025">
+							<string key="NSTitle">Window</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="1011231497">
+									<reference key="NSMenu" ref="835318025"/>
+									<string key="NSTitle">Minimize</string>
+									<string key="NSKeyEquiv">m</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="575023229">
+									<reference key="NSMenu" ref="835318025"/>
+									<string key="NSTitle">Zoom</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="299356726">
+									<reference key="NSMenu" ref="835318025"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="625202149">
+									<reference key="NSMenu" ref="835318025"/>
+									<string key="NSTitle">Bring All to Front</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+							<string key="NSName">_NSWindowsMenu</string>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="448692316">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Help</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="992780483">
+							<string key="NSTitle">Help</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="105068016">
+									<reference key="NSMenu" ref="992780483"/>
+									<string key="NSTitle">MiniBrowser Help</string>
+									<string key="NSKeyEquiv">?</string>
+									<int key="NSKeyEquivModMask">1048576</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+							</object>
+							<string key="NSName">_NSHelpMenu</string>
+						</object>
+					</object>
+					<object class="NSMenuItem" id="816668511">
+						<reference key="NSMenu" ref="649796088"/>
+						<string key="NSTitle">Debug</string>
+						<string key="NSKeyEquiv"/>
+						<int key="NSMnemonicLoc">2147483647</int>
+						<reference key="NSOnImage" ref="35465992"/>
+						<reference key="NSMixedImage" ref="502551668"/>
+						<string key="NSAction">submenuAction:</string>
+						<object class="NSMenu" key="NSSubmenu" id="865232259">
+							<string key="NSTitle">Debug</string>
+							<object class="NSMutableArray" key="NSMenuItems">
+								<bool key="EncodedWithXMLCoder">YES</bool>
+								<object class="NSMenuItem" id="878165919">
+									<reference key="NSMenu" ref="865232259"/>
+									<string key="NSTitle">Force Repaint</string>
+									<string key="NSKeyEquiv">r</string>
+									<int key="NSKeyEquivModMask">1572864</int>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="137933275">
+									<reference key="NSMenu" ref="865232259"/>
+									<string key="NSTitle">Hide Web View</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="1027125810">
+									<reference key="NSMenu" ref="865232259"/>
+									<string key="NSTitle">Remove Web View</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="162978490">
+									<reference key="NSMenu" ref="865232259"/>
+									<bool key="NSIsDisabled">YES</bool>
+									<bool key="NSIsSeparator">YES</bool>
+									<string key="NSTitle"/>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+								</object>
+								<object class="NSMenuItem" id="340689355">
+									<reference key="NSMenu" ref="865232259"/>
+									<string key="NSTitle">Process Model</string>
+									<string key="NSKeyEquiv"/>
+									<int key="NSMnemonicLoc">2147483647</int>
+									<reference key="NSOnImage" ref="35465992"/>
+									<reference key="NSMixedImage" ref="502551668"/>
+									<string key="NSAction">submenuAction:</string>
+									<object class="NSMenu" key="NSSubmenu" id="935112943">
+										<string key="NSTitle">Process Model</string>
+										<object class="NSMutableArray" key="NSMenuItems">
+											<bool key="EncodedWithXMLCoder">YES</bool>
+											<object class="NSMenuItem" id="993856752">
+												<reference key="NSMenu" ref="935112943"/>
+												<string key="NSTitle">Shared Process</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+											<object class="NSMenuItem" id="516840223">
+												<reference key="NSMenu" ref="935112943"/>
+												<string key="NSTitle">Shared Thread</string>
+												<string key="NSKeyEquiv"/>
+												<int key="NSMnemonicLoc">2147483647</int>
+												<reference key="NSOnImage" ref="35465992"/>
+												<reference key="NSMixedImage" ref="502551668"/>
+											</object>
+										</object>
+									</object>
+								</object>
+							</object>
+						</object>
+					</object>
+				</object>
+				<string key="NSName">_NSMainMenu</string>
+			</object>
+			<object class="NSCustomObject" id="976324537">
+				<string key="NSClassName">BrowserAppDelegate</string>
+			</object>
+			<object class="NSCustomObject" id="755631768">
+				<string key="NSClassName">NSFontManager</string>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performMiniaturize:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1011231497"/>
+					</object>
+					<int key="connectionID">37</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">arrangeInFront:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="625202149"/>
+					</object>
+					<int key="connectionID">39</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">print:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="49223823"/>
+					</object>
+					<int key="connectionID">86</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">runPageLayout:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="294629803"/>
+					</object>
+					<int key="connectionID">87</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">clearRecentDocuments:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="759406840"/>
+					</object>
+					<int key="connectionID">127</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">orderFrontStandardAboutPanel:</string>
+						<reference key="source" ref="1021"/>
+						<reference key="destination" ref="238522557"/>
+					</object>
+					<int key="connectionID">142</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performClose:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="776162233"/>
+					</object>
+					<int key="connectionID">193</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleContinuousSpellChecking:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="948374510"/>
+					</object>
+					<int key="connectionID">222</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">undo:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1058277027"/>
+					</object>
+					<int key="connectionID">223</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">copy:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="860595796"/>
+					</object>
+					<int key="connectionID">224</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">checkSpelling:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="96193923"/>
+					</object>
+					<int key="connectionID">225</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">paste:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="29853731"/>
+					</object>
+					<int key="connectionID">226</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">stopSpeaking:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="680220178"/>
+					</object>
+					<int key="connectionID">227</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">cut:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="296257095"/>
+					</object>
+					<int key="connectionID">228</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">showGuessPanel:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="679648819"/>
+					</object>
+					<int key="connectionID">230</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">redo:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="790794224"/>
+					</object>
+					<int key="connectionID">231</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectAll:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="583158037"/>
+					</object>
+					<int key="connectionID">232</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">startSpeaking:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="731782645"/>
+					</object>
+					<int key="connectionID">233</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">delete:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="437104165"/>
+					</object>
+					<int key="connectionID">235</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performZoom:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="575023229"/>
+					</object>
+					<int key="connectionID">240</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performFindPanelAction:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="447796847"/>
+					</object>
+					<int key="connectionID">241</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">centerSelectionInVisibleArea:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="88285865"/>
+					</object>
+					<int key="connectionID">245</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleGrammarChecking:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="967646866"/>
+					</object>
+					<int key="connectionID">347</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleSmartInsertDelete:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="605118523"/>
+					</object>
+					<int key="connectionID">355</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleAutomaticQuoteSubstitution:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="197661976"/>
+					</object>
+					<int key="connectionID">356</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleAutomaticLinkDetection:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="708854459"/>
+					</object>
+					<int key="connectionID">357</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">saveDocument:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1023925487"/>
+					</object>
+					<int key="connectionID">362</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">saveDocumentAs:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="117038363"/>
+					</object>
+					<int key="connectionID">363</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">revertDocumentToSaved:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="579971712"/>
+					</object>
+					<int key="connectionID">364</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">runToolbarCustomizationPalette:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="237841660"/>
+					</object>
+					<int key="connectionID">365</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleToolbarShown:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="102151532"/>
+					</object>
+					<int key="connectionID">366</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">hide:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="755159360"/>
+					</object>
+					<int key="connectionID">367</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">hideOtherApplications:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="342932134"/>
+					</object>
+					<int key="connectionID">368</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">unhideAllApplications:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="908899353"/>
+					</object>
+					<int key="connectionID">370</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">openDocument:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="722745758"/>
+					</object>
+					<int key="connectionID">374</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">addFontTrait:</string>
+						<reference key="source" ref="755631768"/>
+						<reference key="destination" ref="305399458"/>
+					</object>
+					<int key="connectionID">421</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">addFontTrait:</string>
+						<reference key="source" ref="755631768"/>
+						<reference key="destination" ref="814362025"/>
+					</object>
+					<int key="connectionID">422</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">modifyFont:</string>
+						<reference key="source" ref="755631768"/>
+						<reference key="destination" ref="885547335"/>
+					</object>
+					<int key="connectionID">423</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">orderFrontFontPanel:</string>
+						<reference key="source" ref="755631768"/>
+						<reference key="destination" ref="159677712"/>
+					</object>
+					<int key="connectionID">424</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">modifyFont:</string>
+						<reference key="source" ref="755631768"/>
+						<reference key="destination" ref="158063935"/>
+					</object>
+					<int key="connectionID">425</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">raiseBaseline:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="941806246"/>
+					</object>
+					<int key="connectionID">426</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">lowerBaseline:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1045724900"/>
+					</object>
+					<int key="connectionID">427</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">copyFont:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="596732606"/>
+					</object>
+					<int key="connectionID">428</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">subscript:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1037576581"/>
+					</object>
+					<int key="connectionID">429</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">superscript:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="644725453"/>
+					</object>
+					<int key="connectionID">430</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">tightenKerning:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="677519740"/>
+					</object>
+					<int key="connectionID">431</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">underline:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="330926929"/>
+					</object>
+					<int key="connectionID">432</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">orderFrontColorPanel:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1012600125"/>
+					</object>
+					<int key="connectionID">433</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">useAllLigatures:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="663508465"/>
+					</object>
+					<int key="connectionID">434</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">loosenKerning:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="238351151"/>
+					</object>
+					<int key="connectionID">435</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">pasteFont:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="393423671"/>
+					</object>
+					<int key="connectionID">436</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">unscript:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="257962622"/>
+					</object>
+					<int key="connectionID">437</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">useStandardKerning:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="252969304"/>
+					</object>
+					<int key="connectionID">438</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">useStandardLigatures:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="706297211"/>
+					</object>
+					<int key="connectionID">439</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">turnOffLigatures:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="568384683"/>
+					</object>
+					<int key="connectionID">440</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">turnOffKerning:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="766922938"/>
+					</object>
+					<int key="connectionID">441</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">terminate:</string>
+						<reference key="source" ref="1050"/>
+						<reference key="destination" ref="632727374"/>
+					</object>
+					<int key="connectionID">449</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleAutomaticSpellingCorrection:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="795346622"/>
+					</object>
+					<int key="connectionID">456</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">orderFrontSubstitutionsPanel:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="65139061"/>
+					</object>
+					<int key="connectionID">458</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleAutomaticDashSubstitution:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="672708820"/>
+					</object>
+					<int key="connectionID">461</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleAutomaticTextReplacement:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="537092702"/>
+					</object>
+					<int key="connectionID">463</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">uppercaseWord:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1060694897"/>
+					</object>
+					<int key="connectionID">464</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">capitalizeWord:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="56570060"/>
+					</object>
+					<int key="connectionID">467</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">lowercaseWord:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="879586729"/>
+					</object>
+					<int key="connectionID">468</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">pasteAsPlainText:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="82994268"/>
+					</object>
+					<int key="connectionID">486</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performFindPanelAction:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="326711663"/>
+					</object>
+					<int key="connectionID">487</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performFindPanelAction:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="270902937"/>
+					</object>
+					<int key="connectionID">488</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">performFindPanelAction:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="159080638"/>
+					</object>
+					<int key="connectionID">489</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">showHelp:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="105068016"/>
+					</object>
+					<int key="connectionID">493</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="1021"/>
+						<reference key="destination" ref="976324537"/>
+					</object>
+					<int key="connectionID">495</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">alignCenter:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="630155264"/>
+					</object>
+					<int key="connectionID">518</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">pasteRuler:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="883618387"/>
+					</object>
+					<int key="connectionID">519</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">toggleRuler:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="644046920"/>
+					</object>
+					<int key="connectionID">520</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">alignRight:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="512868991"/>
+					</object>
+					<int key="connectionID">521</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">copyRuler:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="231811626"/>
+					</object>
+					<int key="connectionID">522</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">alignJustified:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="945678886"/>
+					</object>
+					<int key="connectionID">523</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">alignLeft:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="875092757"/>
+					</object>
+					<int key="connectionID">524</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeBaseWritingDirectionNatural:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="551969625"/>
+					</object>
+					<int key="connectionID">525</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeBaseWritingDirectionLeftToRight:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="249532473"/>
+					</object>
+					<int key="connectionID">526</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeBaseWritingDirectionRightToLeft:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="607364498"/>
+					</object>
+					<int key="connectionID">527</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeTextWritingDirectionNatural:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="380031999"/>
+					</object>
+					<int key="connectionID">528</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeTextWritingDirectionLeftToRight:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="825984362"/>
+					</object>
+					<int key="connectionID">529</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">makeTextWritingDirectionRightToLeft:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="560145579"/>
+					</object>
+					<int key="connectionID">530</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">newWindow:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="705341025"/>
+					</object>
+					<int key="connectionID">533</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">setSharedProcessProcessModel:</string>
+						<reference key="source" ref="976324537"/>
+						<reference key="destination" ref="993856752"/>
+					</object>
+					<int key="connectionID">543</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">setSharedThreadProcessModel:</string>
+						<reference key="source" ref="976324537"/>
+						<reference key="destination" ref="516840223"/>
+					</object>
+					<int key="connectionID">544</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">forceRepaint:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="878165919"/>
+					</object>
+					<int key="connectionID">547</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">showHideWebView:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="137933275"/>
+					</object>
+					<int key="connectionID">549</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">removeReinsertWebView:</string>
+						<reference key="source" ref="1014"/>
+						<reference key="destination" ref="1027125810"/>
+					</object>
+					<int key="connectionID">551</int>
+				</object>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<reference key="object" ref="0"/>
+						<reference key="children" ref="1048"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1021"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1014"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1050"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">Application</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">29</int>
+						<reference key="object" ref="649796088"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="713487014"/>
+							<reference ref="694149608"/>
+							<reference ref="952259628"/>
+							<reference ref="379814623"/>
+							<reference ref="586577488"/>
+							<reference ref="302598603"/>
+							<reference ref="448692316"/>
+							<reference ref="816668511"/>
+						</object>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">19</int>
+						<reference key="object" ref="713487014"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="835318025"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">56</int>
+						<reference key="object" ref="694149608"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="110575045"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">217</int>
+						<reference key="object" ref="952259628"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="789758025"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">83</int>
+						<reference key="object" ref="379814623"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="720053764"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">81</int>
+						<reference key="object" ref="720053764"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1023925487"/>
+							<reference ref="117038363"/>
+							<reference ref="49223823"/>
+							<reference ref="722745758"/>
+							<reference ref="705341025"/>
+							<reference ref="1025936716"/>
+							<reference ref="294629803"/>
+							<reference ref="776162233"/>
+							<reference ref="425164168"/>
+							<reference ref="579971712"/>
+							<reference ref="1010469920"/>
+						</object>
+						<reference key="parent" ref="379814623"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">75</int>
+						<reference key="object" ref="1023925487"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">80</int>
+						<reference key="object" ref="117038363"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">78</int>
+						<reference key="object" ref="49223823"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">72</int>
+						<reference key="object" ref="722745758"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">82</int>
+						<reference key="object" ref="705341025"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">124</int>
+						<reference key="object" ref="1025936716"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1065607017"/>
+						</object>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">77</int>
+						<reference key="object" ref="294629803"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">73</int>
+						<reference key="object" ref="776162233"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">79</int>
+						<reference key="object" ref="425164168"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">112</int>
+						<reference key="object" ref="579971712"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">74</int>
+						<reference key="object" ref="1010469920"/>
+						<reference key="parent" ref="720053764"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">125</int>
+						<reference key="object" ref="1065607017"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="759406840"/>
+						</object>
+						<reference key="parent" ref="1025936716"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">126</int>
+						<reference key="object" ref="759406840"/>
+						<reference key="parent" ref="1065607017"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">205</int>
+						<reference key="object" ref="789758025"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="437104165"/>
+							<reference ref="583158037"/>
+							<reference ref="1058277027"/>
+							<reference ref="212016141"/>
+							<reference ref="296257095"/>
+							<reference ref="29853731"/>
+							<reference ref="860595796"/>
+							<reference ref="1040322652"/>
+							<reference ref="790794224"/>
+							<reference ref="892235320"/>
+							<reference ref="972420730"/>
+							<reference ref="676164635"/>
+							<reference ref="507821607"/>
+							<reference ref="288088188"/>
+							<reference ref="82994268"/>
+						</object>
+						<reference key="parent" ref="952259628"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">202</int>
+						<reference key="object" ref="437104165"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">198</int>
+						<reference key="object" ref="583158037"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">207</int>
+						<reference key="object" ref="1058277027"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">214</int>
+						<reference key="object" ref="212016141"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">199</int>
+						<reference key="object" ref="296257095"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">203</int>
+						<reference key="object" ref="29853731"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">197</int>
+						<reference key="object" ref="860595796"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">206</int>
+						<reference key="object" ref="1040322652"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">215</int>
+						<reference key="object" ref="790794224"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">218</int>
+						<reference key="object" ref="892235320"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="963351320"/>
+						</object>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">216</int>
+						<reference key="object" ref="972420730"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="769623530"/>
+						</object>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">200</int>
+						<reference key="object" ref="769623530"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="948374510"/>
+							<reference ref="96193923"/>
+							<reference ref="679648819"/>
+							<reference ref="967646866"/>
+							<reference ref="859480356"/>
+							<reference ref="795346622"/>
+						</object>
+						<reference key="parent" ref="972420730"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">219</int>
+						<reference key="object" ref="948374510"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">201</int>
+						<reference key="object" ref="96193923"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">204</int>
+						<reference key="object" ref="679648819"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">220</int>
+						<reference key="object" ref="963351320"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="270902937"/>
+							<reference ref="88285865"/>
+							<reference ref="159080638"/>
+							<reference ref="326711663"/>
+							<reference ref="447796847"/>
+						</object>
+						<reference key="parent" ref="892235320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">213</int>
+						<reference key="object" ref="270902937"/>
+						<reference key="parent" ref="963351320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">210</int>
+						<reference key="object" ref="88285865"/>
+						<reference key="parent" ref="963351320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">221</int>
+						<reference key="object" ref="159080638"/>
+						<reference key="parent" ref="963351320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">208</int>
+						<reference key="object" ref="326711663"/>
+						<reference key="parent" ref="963351320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">209</int>
+						<reference key="object" ref="447796847"/>
+						<reference key="parent" ref="963351320"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">57</int>
+						<reference key="object" ref="110575045"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="238522557"/>
+							<reference ref="755159360"/>
+							<reference ref="908899353"/>
+							<reference ref="632727374"/>
+							<reference ref="646227648"/>
+							<reference ref="609285721"/>
+							<reference ref="481834944"/>
+							<reference ref="304266470"/>
+							<reference ref="1046388886"/>
+							<reference ref="1056857174"/>
+							<reference ref="342932134"/>
+						</object>
+						<reference key="parent" ref="694149608"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">58</int>
+						<reference key="object" ref="238522557"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">134</int>
+						<reference key="object" ref="755159360"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">150</int>
+						<reference key="object" ref="908899353"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">136</int>
+						<reference key="object" ref="632727374"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">144</int>
+						<reference key="object" ref="646227648"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">129</int>
+						<reference key="object" ref="609285721"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">143</int>
+						<reference key="object" ref="481834944"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">236</int>
+						<reference key="object" ref="304266470"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">131</int>
+						<reference key="object" ref="1046388886"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="752062318"/>
+						</object>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">149</int>
+						<reference key="object" ref="1056857174"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">145</int>
+						<reference key="object" ref="342932134"/>
+						<reference key="parent" ref="110575045"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">130</int>
+						<reference key="object" ref="752062318"/>
+						<reference key="parent" ref="1046388886"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">24</int>
+						<reference key="object" ref="835318025"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="299356726"/>
+							<reference ref="625202149"/>
+							<reference ref="575023229"/>
+							<reference ref="1011231497"/>
+						</object>
+						<reference key="parent" ref="713487014"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">92</int>
+						<reference key="object" ref="299356726"/>
+						<reference key="parent" ref="835318025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">5</int>
+						<reference key="object" ref="625202149"/>
+						<reference key="parent" ref="835318025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">239</int>
+						<reference key="object" ref="575023229"/>
+						<reference key="parent" ref="835318025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">23</int>
+						<reference key="object" ref="1011231497"/>
+						<reference key="parent" ref="835318025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">295</int>
+						<reference key="object" ref="586577488"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="466310130"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">296</int>
+						<reference key="object" ref="466310130"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="102151532"/>
+							<reference ref="237841660"/>
+						</object>
+						<reference key="parent" ref="586577488"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">297</int>
+						<reference key="object" ref="102151532"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">298</int>
+						<reference key="object" ref="237841660"/>
+						<reference key="parent" ref="466310130"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">211</int>
+						<reference key="object" ref="676164635"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="785027613"/>
+						</object>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">212</int>
+						<reference key="object" ref="785027613"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="680220178"/>
+							<reference ref="731782645"/>
+						</object>
+						<reference key="parent" ref="676164635"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">195</int>
+						<reference key="object" ref="680220178"/>
+						<reference key="parent" ref="785027613"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">196</int>
+						<reference key="object" ref="731782645"/>
+						<reference key="parent" ref="785027613"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">346</int>
+						<reference key="object" ref="967646866"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">348</int>
+						<reference key="object" ref="507821607"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="698887838"/>
+						</object>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">349</int>
+						<reference key="object" ref="698887838"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="605118523"/>
+							<reference ref="197661976"/>
+							<reference ref="708854459"/>
+							<reference ref="65139061"/>
+							<reference ref="19036812"/>
+							<reference ref="672708820"/>
+							<reference ref="537092702"/>
+						</object>
+						<reference key="parent" ref="507821607"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">350</int>
+						<reference key="object" ref="605118523"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">351</int>
+						<reference key="object" ref="197661976"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">354</int>
+						<reference key="object" ref="708854459"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">375</int>
+						<reference key="object" ref="302598603"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="941447902"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">376</int>
+						<reference key="object" ref="941447902"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="792887677"/>
+							<reference ref="215659978"/>
+						</object>
+						<reference key="parent" ref="302598603"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">377</int>
+						<reference key="object" ref="792887677"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="786677654"/>
+						</object>
+						<reference key="parent" ref="941447902"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">388</int>
+						<reference key="object" ref="786677654"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="159677712"/>
+							<reference ref="305399458"/>
+							<reference ref="814362025"/>
+							<reference ref="330926929"/>
+							<reference ref="533507878"/>
+							<reference ref="158063935"/>
+							<reference ref="885547335"/>
+							<reference ref="901062459"/>
+							<reference ref="767671776"/>
+							<reference ref="691570813"/>
+							<reference ref="769124883"/>
+							<reference ref="739652853"/>
+							<reference ref="1012600125"/>
+							<reference ref="214559597"/>
+							<reference ref="596732606"/>
+							<reference ref="393423671"/>
+						</object>
+						<reference key="parent" ref="792887677"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">389</int>
+						<reference key="object" ref="159677712"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">390</int>
+						<reference key="object" ref="305399458"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">391</int>
+						<reference key="object" ref="814362025"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">392</int>
+						<reference key="object" ref="330926929"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">393</int>
+						<reference key="object" ref="533507878"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">394</int>
+						<reference key="object" ref="158063935"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">395</int>
+						<reference key="object" ref="885547335"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">396</int>
+						<reference key="object" ref="901062459"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">397</int>
+						<reference key="object" ref="767671776"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="175441468"/>
+						</object>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">398</int>
+						<reference key="object" ref="691570813"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1058217995"/>
+						</object>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">399</int>
+						<reference key="object" ref="769124883"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="18263474"/>
+						</object>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">400</int>
+						<reference key="object" ref="739652853"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">401</int>
+						<reference key="object" ref="1012600125"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">402</int>
+						<reference key="object" ref="214559597"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">403</int>
+						<reference key="object" ref="596732606"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">404</int>
+						<reference key="object" ref="393423671"/>
+						<reference key="parent" ref="786677654"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">405</int>
+						<reference key="object" ref="18263474"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="257962622"/>
+							<reference ref="644725453"/>
+							<reference ref="1037576581"/>
+							<reference ref="941806246"/>
+							<reference ref="1045724900"/>
+						</object>
+						<reference key="parent" ref="769124883"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">406</int>
+						<reference key="object" ref="257962622"/>
+						<reference key="parent" ref="18263474"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">407</int>
+						<reference key="object" ref="644725453"/>
+						<reference key="parent" ref="18263474"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">408</int>
+						<reference key="object" ref="1037576581"/>
+						<reference key="parent" ref="18263474"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">409</int>
+						<reference key="object" ref="941806246"/>
+						<reference key="parent" ref="18263474"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">410</int>
+						<reference key="object" ref="1045724900"/>
+						<reference key="parent" ref="18263474"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">411</int>
+						<reference key="object" ref="1058217995"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="706297211"/>
+							<reference ref="568384683"/>
+							<reference ref="663508465"/>
+						</object>
+						<reference key="parent" ref="691570813"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">412</int>
+						<reference key="object" ref="706297211"/>
+						<reference key="parent" ref="1058217995"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">413</int>
+						<reference key="object" ref="568384683"/>
+						<reference key="parent" ref="1058217995"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">414</int>
+						<reference key="object" ref="663508465"/>
+						<reference key="parent" ref="1058217995"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">415</int>
+						<reference key="object" ref="175441468"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="252969304"/>
+							<reference ref="766922938"/>
+							<reference ref="677519740"/>
+							<reference ref="238351151"/>
+						</object>
+						<reference key="parent" ref="767671776"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">416</int>
+						<reference key="object" ref="252969304"/>
+						<reference key="parent" ref="175441468"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">417</int>
+						<reference key="object" ref="766922938"/>
+						<reference key="parent" ref="175441468"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">418</int>
+						<reference key="object" ref="677519740"/>
+						<reference key="parent" ref="175441468"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">419</int>
+						<reference key="object" ref="238351151"/>
+						<reference key="parent" ref="175441468"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">420</int>
+						<reference key="object" ref="755631768"/>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">450</int>
+						<reference key="object" ref="288088188"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="579392910"/>
+						</object>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">451</int>
+						<reference key="object" ref="579392910"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="1060694897"/>
+							<reference ref="879586729"/>
+							<reference ref="56570060"/>
+						</object>
+						<reference key="parent" ref="288088188"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">452</int>
+						<reference key="object" ref="1060694897"/>
+						<reference key="parent" ref="579392910"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">453</int>
+						<reference key="object" ref="859480356"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">454</int>
+						<reference key="object" ref="795346622"/>
+						<reference key="parent" ref="769623530"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">457</int>
+						<reference key="object" ref="65139061"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">459</int>
+						<reference key="object" ref="19036812"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">460</int>
+						<reference key="object" ref="672708820"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">462</int>
+						<reference key="object" ref="537092702"/>
+						<reference key="parent" ref="698887838"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">465</int>
+						<reference key="object" ref="879586729"/>
+						<reference key="parent" ref="579392910"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">466</int>
+						<reference key="object" ref="56570060"/>
+						<reference key="parent" ref="579392910"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">485</int>
+						<reference key="object" ref="82994268"/>
+						<reference key="parent" ref="789758025"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">490</int>
+						<reference key="object" ref="448692316"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="992780483"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">491</int>
+						<reference key="object" ref="992780483"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="105068016"/>
+						</object>
+						<reference key="parent" ref="448692316"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">492</int>
+						<reference key="object" ref="105068016"/>
+						<reference key="parent" ref="992780483"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">494</int>
+						<reference key="object" ref="976324537"/>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">496</int>
+						<reference key="object" ref="215659978"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="446991534"/>
+						</object>
+						<reference key="parent" ref="941447902"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">497</int>
+						<reference key="object" ref="446991534"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="875092757"/>
+							<reference ref="630155264"/>
+							<reference ref="945678886"/>
+							<reference ref="512868991"/>
+							<reference ref="163117631"/>
+							<reference ref="31516759"/>
+							<reference ref="908105787"/>
+							<reference ref="644046920"/>
+							<reference ref="231811626"/>
+							<reference ref="883618387"/>
+						</object>
+						<reference key="parent" ref="215659978"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">498</int>
+						<reference key="object" ref="875092757"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">499</int>
+						<reference key="object" ref="630155264"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">500</int>
+						<reference key="object" ref="945678886"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">501</int>
+						<reference key="object" ref="512868991"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">502</int>
+						<reference key="object" ref="163117631"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">503</int>
+						<reference key="object" ref="31516759"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="956096989"/>
+						</object>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">504</int>
+						<reference key="object" ref="908105787"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">505</int>
+						<reference key="object" ref="644046920"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">506</int>
+						<reference key="object" ref="231811626"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">507</int>
+						<reference key="object" ref="883618387"/>
+						<reference key="parent" ref="446991534"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">508</int>
+						<reference key="object" ref="956096989"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="257099033"/>
+							<reference ref="551969625"/>
+							<reference ref="249532473"/>
+							<reference ref="607364498"/>
+							<reference ref="508151438"/>
+							<reference ref="981751889"/>
+							<reference ref="380031999"/>
+							<reference ref="825984362"/>
+							<reference ref="560145579"/>
+						</object>
+						<reference key="parent" ref="31516759"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">509</int>
+						<reference key="object" ref="257099033"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">510</int>
+						<reference key="object" ref="551969625"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">511</int>
+						<reference key="object" ref="249532473"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">512</int>
+						<reference key="object" ref="607364498"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">513</int>
+						<reference key="object" ref="508151438"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">514</int>
+						<reference key="object" ref="981751889"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">515</int>
+						<reference key="object" ref="380031999"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">516</int>
+						<reference key="object" ref="825984362"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">517</int>
+						<reference key="object" ref="560145579"/>
+						<reference key="parent" ref="956096989"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">534</int>
+						<reference key="object" ref="816668511"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="865232259"/>
+						</object>
+						<reference key="parent" ref="649796088"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">535</int>
+						<reference key="object" ref="865232259"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="340689355"/>
+							<reference ref="878165919"/>
+							<reference ref="162978490"/>
+							<reference ref="137933275"/>
+							<reference ref="1027125810"/>
+						</object>
+						<reference key="parent" ref="816668511"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">537</int>
+						<reference key="object" ref="340689355"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="935112943"/>
+						</object>
+						<reference key="parent" ref="865232259"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">538</int>
+						<reference key="object" ref="935112943"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="993856752"/>
+							<reference ref="516840223"/>
+						</object>
+						<reference key="parent" ref="340689355"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">539</int>
+						<reference key="object" ref="993856752"/>
+						<reference key="parent" ref="935112943"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">540</int>
+						<reference key="object" ref="516840223"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+						</object>
+						<reference key="parent" ref="935112943"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">545</int>
+						<reference key="object" ref="878165919"/>
+						<reference key="parent" ref="865232259"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">546</int>
+						<reference key="object" ref="162978490"/>
+						<reference key="parent" ref="865232259"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">548</int>
+						<reference key="object" ref="137933275"/>
+						<reference key="parent" ref="865232259"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">550</int>
+						<reference key="object" ref="1027125810"/>
+						<reference key="parent" ref="865232259"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-3.IBPluginDependency</string>
+					<string>112.IBPluginDependency</string>
+					<string>112.ImportedFromIB2</string>
+					<string>124.IBPluginDependency</string>
+					<string>124.ImportedFromIB2</string>
+					<string>125.IBPluginDependency</string>
+					<string>125.ImportedFromIB2</string>
+					<string>125.editorWindowContentRectSynchronizationRect</string>
+					<string>126.IBPluginDependency</string>
+					<string>126.ImportedFromIB2</string>
+					<string>129.IBPluginDependency</string>
+					<string>129.ImportedFromIB2</string>
+					<string>130.IBPluginDependency</string>
+					<string>130.ImportedFromIB2</string>
+					<string>130.editorWindowContentRectSynchronizationRect</string>
+					<string>131.IBPluginDependency</string>
+					<string>131.ImportedFromIB2</string>
+					<string>134.IBPluginDependency</string>
+					<string>134.ImportedFromIB2</string>
+					<string>136.IBPluginDependency</string>
+					<string>136.ImportedFromIB2</string>
+					<string>143.IBPluginDependency</string>
+					<string>143.ImportedFromIB2</string>
+					<string>144.IBPluginDependency</string>
+					<string>144.ImportedFromIB2</string>
+					<string>145.IBPluginDependency</string>
+					<string>145.ImportedFromIB2</string>
+					<string>149.IBPluginDependency</string>
+					<string>149.ImportedFromIB2</string>
+					<string>150.IBPluginDependency</string>
+					<string>150.ImportedFromIB2</string>
+					<string>19.IBPluginDependency</string>
+					<string>19.ImportedFromIB2</string>
+					<string>195.IBPluginDependency</string>
+					<string>195.ImportedFromIB2</string>
+					<string>196.IBPluginDependency</string>
+					<string>196.ImportedFromIB2</string>
+					<string>197.IBPluginDependency</string>
+					<string>197.ImportedFromIB2</string>
+					<string>198.IBPluginDependency</string>
+					<string>198.ImportedFromIB2</string>
+					<string>199.IBPluginDependency</string>
+					<string>199.ImportedFromIB2</string>
+					<string>200.IBEditorWindowLastContentRect</string>
+					<string>200.IBPluginDependency</string>
+					<string>200.ImportedFromIB2</string>
+					<string>200.editorWindowContentRectSynchronizationRect</string>
+					<string>201.IBPluginDependency</string>
+					<string>201.ImportedFromIB2</string>
+					<string>202.IBPluginDependency</string>
+					<string>202.ImportedFromIB2</string>
+					<string>203.IBPluginDependency</string>
+					<string>203.ImportedFromIB2</string>
+					<string>204.IBPluginDependency</string>
+					<string>204.ImportedFromIB2</string>
+					<string>205.IBEditorWindowLastContentRect</string>
+					<string>205.IBPluginDependency</string>
+					<string>205.ImportedFromIB2</string>
+					<string>205.editorWindowContentRectSynchronizationRect</string>
+					<string>206.IBPluginDependency</string>
+					<string>206.ImportedFromIB2</string>
+					<string>207.IBPluginDependency</string>
+					<string>207.ImportedFromIB2</string>
+					<string>208.IBPluginDependency</string>
+					<string>208.ImportedFromIB2</string>
+					<string>209.IBPluginDependency</string>
+					<string>209.ImportedFromIB2</string>
+					<string>210.IBPluginDependency</string>
+					<string>210.ImportedFromIB2</string>
+					<string>211.IBPluginDependency</string>
+					<string>211.ImportedFromIB2</string>
+					<string>212.IBPluginDependency</string>
+					<string>212.ImportedFromIB2</string>
+					<string>212.editorWindowContentRectSynchronizationRect</string>
+					<string>213.IBPluginDependency</string>
+					<string>213.ImportedFromIB2</string>
+					<string>214.IBPluginDependency</string>
+					<string>214.ImportedFromIB2</string>
+					<string>215.IBPluginDependency</string>
+					<string>215.ImportedFromIB2</string>
+					<string>216.IBPluginDependency</string>
+					<string>216.ImportedFromIB2</string>
+					<string>217.IBPluginDependency</string>
+					<string>217.ImportedFromIB2</string>
+					<string>218.IBPluginDependency</string>
+					<string>218.ImportedFromIB2</string>
+					<string>219.IBPluginDependency</string>
+					<string>219.ImportedFromIB2</string>
+					<string>220.IBEditorWindowLastContentRect</string>
+					<string>220.IBPluginDependency</string>
+					<string>220.ImportedFromIB2</string>
+					<string>220.editorWindowContentRectSynchronizationRect</string>
+					<string>221.IBPluginDependency</string>
+					<string>221.ImportedFromIB2</string>
+					<string>23.IBPluginDependency</string>
+					<string>23.ImportedFromIB2</string>
+					<string>236.IBPluginDependency</string>
+					<string>236.ImportedFromIB2</string>
+					<string>239.IBPluginDependency</string>
+					<string>239.ImportedFromIB2</string>
+					<string>24.IBEditorWindowLastContentRect</string>
+					<string>24.IBPluginDependency</string>
+					<string>24.ImportedFromIB2</string>
+					<string>24.editorWindowContentRectSynchronizationRect</string>
+					<string>29.IBEditorWindowLastContentRect</string>
+					<string>29.IBPluginDependency</string>
+					<string>29.ImportedFromIB2</string>
+					<string>29.WindowOrigin</string>
+					<string>29.editorWindowContentRectSynchronizationRect</string>
+					<string>295.IBPluginDependency</string>
+					<string>296.IBEditorWindowLastContentRect</string>
+					<string>296.IBPluginDependency</string>
+					<string>296.editorWindowContentRectSynchronizationRect</string>
+					<string>297.IBPluginDependency</string>
+					<string>298.IBPluginDependency</string>
+					<string>346.IBPluginDependency</string>
+					<string>346.ImportedFromIB2</string>
+					<string>348.IBPluginDependency</string>
+					<string>348.ImportedFromIB2</string>
+					<string>349.IBEditorWindowLastContentRect</string>
+					<string>349.IBPluginDependency</string>
+					<string>349.ImportedFromIB2</string>
+					<string>349.editorWindowContentRectSynchronizationRect</string>
+					<string>350.IBPluginDependency</string>
+					<string>350.ImportedFromIB2</string>
+					<string>351.IBPluginDependency</string>
+					<string>351.ImportedFromIB2</string>
+					<string>354.IBPluginDependency</string>
+					<string>354.ImportedFromIB2</string>
+					<string>375.IBPluginDependency</string>
+					<string>376.IBEditorWindowLastContentRect</string>
+					<string>376.IBPluginDependency</string>
+					<string>377.IBPluginDependency</string>
+					<string>388.IBEditorWindowLastContentRect</string>
+					<string>388.IBPluginDependency</string>
+					<string>389.IBPluginDependency</string>
+					<string>390.IBPluginDependency</string>
+					<string>391.IBPluginDependency</string>
+					<string>392.IBPluginDependency</string>
+					<string>393.IBPluginDependency</string>
+					<string>394.IBPluginDependency</string>
+					<string>395.IBPluginDependency</string>
+					<string>396.IBPluginDependency</string>
+					<string>397.IBPluginDependency</string>
+					<string>398.IBPluginDependency</string>
+					<string>399.IBPluginDependency</string>
+					<string>400.IBPluginDependency</string>
+					<string>401.IBPluginDependency</string>
+					<string>402.IBPluginDependency</string>
+					<string>403.IBPluginDependency</string>
+					<string>404.IBPluginDependency</string>
+					<string>405.IBPluginDependency</string>
+					<string>406.IBPluginDependency</string>
+					<string>407.IBPluginDependency</string>
+					<string>408.IBPluginDependency</string>
+					<string>409.IBPluginDependency</string>
+					<string>410.IBPluginDependency</string>
+					<string>411.IBPluginDependency</string>
+					<string>412.IBPluginDependency</string>
+					<string>413.IBPluginDependency</string>
+					<string>414.IBPluginDependency</string>
+					<string>415.IBPluginDependency</string>
+					<string>416.IBPluginDependency</string>
+					<string>417.IBPluginDependency</string>
+					<string>418.IBPluginDependency</string>
+					<string>419.IBPluginDependency</string>
+					<string>450.IBPluginDependency</string>
+					<string>451.IBEditorWindowLastContentRect</string>
+					<string>451.IBPluginDependency</string>
+					<string>452.IBPluginDependency</string>
+					<string>453.IBPluginDependency</string>
+					<string>454.IBPluginDependency</string>
+					<string>457.IBPluginDependency</string>
+					<string>459.IBPluginDependency</string>
+					<string>460.IBPluginDependency</string>
+					<string>462.IBPluginDependency</string>
+					<string>465.IBPluginDependency</string>
+					<string>466.IBPluginDependency</string>
+					<string>485.IBPluginDependency</string>
+					<string>490.IBPluginDependency</string>
+					<string>491.IBEditorWindowLastContentRect</string>
+					<string>491.IBPluginDependency</string>
+					<string>492.IBPluginDependency</string>
+					<string>496.IBPluginDependency</string>
+					<string>497.IBEditorWindowLastContentRect</string>
+					<string>497.IBPluginDependency</string>
+					<string>498.IBPluginDependency</string>
+					<string>499.IBPluginDependency</string>
+					<string>5.IBPluginDependency</string>
+					<string>5.ImportedFromIB2</string>
+					<string>500.IBPluginDependency</string>
+					<string>501.IBPluginDependency</string>
+					<string>502.IBPluginDependency</string>
+					<string>503.IBPluginDependency</string>
+					<string>504.IBPluginDependency</string>
+					<string>505.IBPluginDependency</string>
+					<string>506.IBPluginDependency</string>
+					<string>507.IBPluginDependency</string>
+					<string>508.IBEditorWindowLastContentRect</string>
+					<string>508.IBPluginDependency</string>
+					<string>509.IBPluginDependency</string>
+					<string>510.IBPluginDependency</string>
+					<string>511.IBPluginDependency</string>
+					<string>512.IBPluginDependency</string>
+					<string>513.IBPluginDependency</string>
+					<string>514.IBPluginDependency</string>
+					<string>515.IBPluginDependency</string>
+					<string>516.IBPluginDependency</string>
+					<string>517.IBPluginDependency</string>
+					<string>534.IBPluginDependency</string>
+					<string>535.IBEditorWindowLastContentRect</string>
+					<string>535.IBPluginDependency</string>
+					<string>537.IBPluginDependency</string>
+					<string>538.IBEditorWindowLastContentRect</string>
+					<string>538.IBPluginDependency</string>
+					<string>539.IBPluginDependency</string>
+					<string>540.IBPluginDependency</string>
+					<string>545.IBPluginDependency</string>
+					<string>546.IBPluginDependency</string>
+					<string>548.IBPluginDependency</string>
+					<string>550.IBPluginDependency</string>
+					<string>56.IBPluginDependency</string>
+					<string>56.ImportedFromIB2</string>
+					<string>57.IBEditorWindowLastContentRect</string>
+					<string>57.IBPluginDependency</string>
+					<string>57.ImportedFromIB2</string>
+					<string>57.editorWindowContentRectSynchronizationRect</string>
+					<string>58.IBPluginDependency</string>
+					<string>58.ImportedFromIB2</string>
+					<string>72.IBPluginDependency</string>
+					<string>72.ImportedFromIB2</string>
+					<string>73.IBPluginDependency</string>
+					<string>73.ImportedFromIB2</string>
+					<string>74.IBPluginDependency</string>
+					<string>74.ImportedFromIB2</string>
+					<string>75.IBPluginDependency</string>
+					<string>75.ImportedFromIB2</string>
+					<string>77.IBPluginDependency</string>
+					<string>77.ImportedFromIB2</string>
+					<string>78.IBPluginDependency</string>
+					<string>78.ImportedFromIB2</string>
+					<string>79.IBPluginDependency</string>
+					<string>79.ImportedFromIB2</string>
+					<string>80.IBPluginDependency</string>
+					<string>80.ImportedFromIB2</string>
+					<string>81.IBEditorWindowLastContentRect</string>
+					<string>81.IBPluginDependency</string>
+					<string>81.ImportedFromIB2</string>
+					<string>81.editorWindowContentRectSynchronizationRect</string>
+					<string>82.IBPluginDependency</string>
+					<string>82.ImportedFromIB2</string>
+					<string>83.IBPluginDependency</string>
+					<string>83.ImportedFromIB2</string>
+					<string>92.IBPluginDependency</string>
+					<string>92.ImportedFromIB2</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{522, 812}, {146, 23}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{436, 809}, {64, 6}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{753, 187}, {275, 113}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{608, 612}, {275, 83}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{546, 553}, {254, 283}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{187, 434}, {243, 243}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{608, 612}, {167, 43}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{753, 217}, {238, 103}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{608, 612}, {241, 103}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{639, 872}, {194, 73}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{525, 802}, {197, 73}}</string>
+					<string>{{317, 945}, {517, 20}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{74, 862}</string>
+					<string>{{6, 978}, {478, 20}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{656, 793}, {231, 43}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{475, 832}, {234, 43}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{746, 287}, {220, 133}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{608, 612}, {215, 63}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{527, 902}, {83, 43}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{523, 2}, {178, 283}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{753, 197}, {170, 63}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{714, 922}, {193, 23}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{674, 260}, {204, 183}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{878, 180}, {164, 173}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{759, 852}, {211, 93}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{944, 872}, {154, 43}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{286, 129}, {275, 183}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{23, 794}, {245, 183}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{504, 633}, {196, 203}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>{{145, 474}, {199, 203}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<integer value="1"/>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization"/>
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<reference key="dict.sortedKeys" ref="0"/>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID"/>
+			<int key="maxID">551</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">BrowserAppDelegate</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>setSharedProcessProcessModel:</string>
+							<string>setSharedThreadProcessModel:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>setSharedProcessProcessModel:</string>
+							<string>setSharedThreadProcessModel:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">setSharedProcessProcessModel:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">setSharedThreadProcessModel:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">mac/AppDelegate.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">BrowserAppDelegate</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="outlets">
+						<string key="NS.key.0">window</string>
+						<string key="NS.object.0">NSWindow</string>
+					</object>
+					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
+						<string key="NS.key.0">window</string>
+						<object class="IBToOneOutletInfo" key="NS.object.0">
+							<string key="name">window</string>
+							<string key="candidateClassName">NSWindow</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">BrowserWindowController</string>
+					<string key="superclassName">NSWindowController</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>fetch:</string>
+							<string>forceRepaint:</string>
+							<string>reload:</string>
+							<string>removeReinsertWebView:</string>
+							<string>showHideWebView:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>fetch:</string>
+							<string>forceRepaint:</string>
+							<string>reload:</string>
+							<string>removeReinsertWebView:</string>
+							<string>showHideWebView:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">fetch:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">forceRepaint:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">reload:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">removeReinsertWebView:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">showHideWebView:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>containerView</string>
+							<string>progressIndicator</string>
+							<string>reloadButton</string>
+							<string>urlText</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSView</string>
+							<string>NSProgressIndicator</string>
+							<string>NSButton</string>
+							<string>NSTextField</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="toOneOutletInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>containerView</string>
+							<string>progressIndicator</string>
+							<string>reloadButton</string>
+							<string>urlText</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBToOneOutletInfo">
+								<string key="name">containerView</string>
+								<string key="candidateClassName">NSView</string>
+							</object>
+							<object class="IBToOneOutletInfo">
+								<string key="name">progressIndicator</string>
+								<string key="candidateClassName">NSProgressIndicator</string>
+							</object>
+							<object class="IBToOneOutletInfo">
+								<string key="name">reloadButton</string>
+								<string key="candidateClassName">NSButton</string>
+							</object>
+							<object class="IBToOneOutletInfo">
+								<string key="name">urlText</string>
+								<string key="candidateClassName">NSTextField</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">mac/BrowserWindowController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">FirstResponder</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>forceRepaint:</string>
+							<string>newWindow:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>forceRepaint:</string>
+							<string>newWindow:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">forceRepaint:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">newWindow:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBUserSource</string>
+						<string key="minorKey"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="822405504">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="850738725">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="624831158">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSApplication</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSBrowser</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSButton</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSControl</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="310914472">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSDocument</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>printDocument:</string>
+							<string>revertDocumentToSaved:</string>
+							<string>runPageLayout:</string>
+							<string>saveDocument:</string>
+							<string>saveDocumentAs:</string>
+							<string>saveDocumentTo:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>printDocument:</string>
+							<string>revertDocumentToSaved:</string>
+							<string>runPageLayout:</string>
+							<string>saveDocument:</string>
+							<string>saveDocumentAs:</string>
+							<string>saveDocumentTo:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">printDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">revertDocumentToSaved:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">runPageLayout:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocumentAs:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveDocumentTo:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSDocument</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSDocumentController</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>clearRecentDocuments:</string>
+							<string>newDocument:</string>
+							<string>openDocument:</string>
+							<string>saveAllDocuments:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+							<string>id</string>
+						</object>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>clearRecentDocuments:</string>
+							<string>newDocument:</string>
+							<string>openDocument:</string>
+							<string>saveAllDocuments:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">clearRecentDocuments:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">newDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">openDocument:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">saveAllDocuments:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSFontManager</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="946436764">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSFormatter</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMatrix</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMatrix.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMenu</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="1056362899">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMenuItem</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="472958451">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSMovieView</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSMovieView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="822405504"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="850738725"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="624831158"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="310914472"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="946436764"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<reference key="sourceIdentifier" ref="1056362899"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="809545482">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier" id="260078765">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSProgressIndicator</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSResponder</string>
+					<string key="superclassName">NSObject</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTableView</string>
+					<string key="superclassName">NSControl</string>
+					<reference key="sourceIdentifier" ref="809545482"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSText</string>
+					<string key="superclassName">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSText.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextField</string>
+					<string key="superclassName">NSControl</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSTextView</string>
+					<string key="superclassName">NSText</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSTextView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<reference key="sourceIdentifier" ref="472958451"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSView</string>
+					<string key="superclassName">NSResponder</string>
+					<reference key="sourceIdentifier" ref="260078765"/>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindow</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSWindowController</string>
+					<string key="superclassName">NSResponder</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">showWindow:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<string key="NS.key.0">showWindow:</string>
+						<object class="IBActionInfo" key="NS.object.0">
+							<string key="name">showWindow:</string>
+							<string key="candidateClassName">id</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+					</object>
+				</object>
+			</object>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+			<integer value="1060" key="NS.object.0"/>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+			<integer value="3000" key="NS.object.0"/>
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<string key="IBDocument.LastKnownRelativeProjectPath">../../MiniBrowser.xcodeproj</string>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>NSMenuCheckmark</string>
+				<string>NSMenuMixedState</string>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<string>{9, 8}</string>
+				<string>{7, 2}</string>
+			</object>
+		</object>
+	</data>
+</archive>
diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser-Info.plist b/WebKitTools/MiniBrowser/mac/MiniBrowser-Info.plist
new file mode 100644
index 0000000..7564a7e
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/MiniBrowser-Info.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIconFile</key>
+	<string>MiniBrowser</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>${MACOSX_DEPLOYMENT_TARGET}</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>NSMainNibFile</key>
+	<string>MainMenu</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>
diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
new file mode 100644
index 0000000..bd7fc4b
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#ifdef __OBJC__
+    #import <Cocoa/Cocoa.h>
+#endif
diff --git a/WebKitTools/MiniBrowser/mac/main.m b/WebKitTools/MiniBrowser/mac/main.m
new file mode 100644
index 0000000..7f56737
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/main.m
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+    return NSApplicationMain(argc,  (const char **) argv);
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
new file mode 100644
index 0000000..95385ca
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "StdAfx.h"
+#include "BrowserView.h"
+
+#include "BrowserWindow.h"
+#include <WebKit2/WKURLCF.h>
+
+static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000;
+
+BrowserView::BrowserView()
+    : m_webView(0)
+{
+}
+
+// UI Client Callbacks
+
+static WKPageRef createNewPage(WKPageRef page, const void* clientInfo)
+{
+    BrowserWindow* browserWindow = BrowserWindow::create();
+    browserWindow->createWindow(0, 0, 800, 600);
+
+    return WKViewGetPage(browserWindow->view().webView());
+}
+
+static void showPage(WKPageRef page, const void *clientInfo)
+{
+    static_cast<BrowserWindow*>(const_cast<void*>(clientInfo))->showWindow();
+}
+
+static void closePage(WKPageRef page, const void *clientInfo)
+{
+}
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+
+void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
+{
+    assert(!m_webView);
+
+    bool isShiftKeyDown = ::GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT;
+
+    //WKContextRef context = WKContextCreateWithProcessModel(isShiftKeyDown ? kWKProcessModelSecondaryThread : kWKProcessModelSecondaryProcess);
+    WKContextRef context = WKContextCreateWithProcessModel(kWKProcessModelSecondaryThread);
+    WKPageNamespaceRef pageNamespace = WKPageNamespaceCreate(context);
+
+    m_webView = WKViewCreate(webViewRect, pageNamespace, parentWindow->window());
+
+    WKPageUIClient uiClient = {
+        0,              /* version */
+        parentWindow,   /* clientInfo */
+        createNewPage,
+        showPage,
+        closePage,
+        runJavaScriptAlert
+    };
+    WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
+}
+
+void BrowserView::setFrame(RECT rect)
+{
+    HWND webViewWindow = WKViewGetWindow(m_webView);
+    ::SetWindowPos(webViewWindow, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
+}
+
+void BrowserView::goToURL(const std::wstring& urlString)
+{
+    CFStringRef string = CFStringCreateWithCharacters(0, (const UniChar*)urlString.data(), urlString.size());
+    CFURLRef cfURL = CFURLCreateWithString(0, string, 0);
+    CFRelease(string);
+
+    WKURLRef url = WKURLCreateWithCFURL(cfURL);
+    CFRelease(cfURL); 
+
+    WKPageRef page = WKViewGetPage(m_webView);
+    WKPageLoadURL(page, url);
+    WKURLRelease(url);
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.h b/WebKitTools/MiniBrowser/win/BrowserView.h
new file mode 100644
index 0000000..08c5e4a
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserView.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 BrowserView_h
+#define BrowserView_h
+
+#include <WebKit2/WebKit2.h>
+#include <string>
+
+class BrowserWindow;
+
+class BrowserView  {
+public:
+    BrowserView();
+
+    void goToURL(const std::wstring& url);
+
+    void create(RECT, BrowserWindow* parentWindow);
+    void setFrame(RECT);
+
+    WKViewRef webView() const { return m_webView; }
+
+private:
+    WKViewRef m_webView;
+};
+
+#endif // BrowserView_h
diff --git a/WebKitTools/MiniBrowser/win/BrowserWindow.cpp b/WebKitTools/MiniBrowser/win/BrowserWindow.cpp
new file mode 100644
index 0000000..afe7e42
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserWindow.cpp
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "StdAfx.h"
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include "Resource.h"
+
+#include <commctrl.h>
+#include <shlwapi.h>
+#include <vector>
+#include <wininet.h>
+
+using namespace std;
+
+BrowserWindow::BrowserWindow()
+    : m_window(0)
+    , m_rebarWindow(0)
+    , m_comboBoxWindow(0)
+{
+}
+
+LRESULT CALLBACK BrowserWindow::BrowserWindowWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    LONG_PTR longPtr = ::GetWindowLongPtr(window, 0);
+    
+    if (BrowserWindow* browserView = reinterpret_cast<BrowserWindow*>(longPtr))
+        return browserView->wndProc(window, message, wParam, lParam);
+
+    if (message == WM_CREATE) {
+        LPCREATESTRUCT createStruct = reinterpret_cast<LPCREATESTRUCT>(lParam);
+        BrowserWindow* browserWindow = static_cast<BrowserWindow*>(createStruct->lpCreateParams);
+        browserWindow->m_window = window;
+
+        ::SetWindowLongPtr(window, 0, (LONG_PTR)browserWindow);
+
+        browserWindow->onCreate(createStruct);
+        return 0;
+    }
+
+    return ::DefWindowProc(window, message, wParam, lParam);
+}
+
+LRESULT BrowserWindow::wndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    LRESULT lResult = 0;
+    bool handled = true;
+
+    switch (message) {
+    case WM_COMMAND:
+        lResult = onCommand(LOWORD(wParam), handled);
+        break;
+
+    case WM_SIZE:
+        onSize(LOWORD(lParam), HIWORD(lParam));
+        break;
+
+    case WM_DESTROY:
+        onDestroy();
+        break;
+
+    case WM_NCDESTROY:
+        onNCDestroy();
+        break;
+
+    default:
+        handled = false;
+    }
+
+    if (!handled)
+        lResult = ::DefWindowProc(window, message, wParam, lParam);
+
+    return lResult;
+}
+
+void BrowserWindow::createWindow(int x, int y, int width, int height)
+{
+    assert(!m_window);
+
+    // Register the class.
+    WNDCLASSEX windowClass = { 0 };
+    windowClass.cbSize = sizeof(windowClass);
+    windowClass.style = 0;
+    windowClass.lpfnWndProc = BrowserWindowWndProc;
+    windowClass.cbClsExtra = 0;
+    windowClass.cbWndExtra = sizeof(this);
+    windowClass.hInstance = MiniBrowser::shared().instance();
+    windowClass.hIcon = 0;
+    windowClass.hCursor = ::LoadCursor(0, IDC_ARROW);
+    windowClass.hbrBackground = 0;
+    windowClass.lpszMenuName = MAKEINTRESOURCE(IDR_MAINFRAME);
+    windowClass.lpszClassName = L"MiniBrowser";
+    windowClass.hIconSm = 0;
+
+    ::RegisterClassEx(&windowClass);
+
+    ::CreateWindowW(L"MiniBrowser", L"MiniBrowser", WS_OVERLAPPEDWINDOW, x, y, width, height, 0, 0, MiniBrowser::shared().instance(), this);
+}
+
+void BrowserWindow::showWindow()
+{
+    assert(m_window);
+
+    ::ShowWindow(m_window, SW_SHOWNORMAL);
+}
+
+void BrowserWindow::goToURL(const std::wstring& url)
+{
+    m_browserView.goToURL(url);
+}
+
+void BrowserWindow::onCreate(LPCREATESTRUCT createStruct)
+{
+    // Register our window.
+    MiniBrowser::shared().registerWindow(this);
+
+    // Create the rebar control.
+    m_rebarWindow = ::CreateWindowEx(0, REBARCLASSNAME, 0, WS_VISIBLE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VARHEIGHT | RBS_BANDBORDERS,
+                                     0, 0, 0, 0, m_window, 0, createStruct->hInstance, 0);
+    REBARINFO rebarInfo = { 0 };
+    rebarInfo.cbSize = sizeof(rebarInfo);
+    rebarInfo.fMask = 0;
+    ::SendMessage(m_rebarWindow, RB_SETBARINFO, 0, (LPARAM)&rebarInfo);
+
+    // Create the combo box control.
+    m_comboBoxWindow = ::CreateWindowEx(0, L"combobox", 0, WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_VSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN,
+                                        0, 0, 0, 0, m_rebarWindow, 0, createStruct->hInstance, 0);
+    SendMessage(m_comboBoxWindow, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
+
+    REBARBANDINFO bandInfo;
+    bandInfo.cbSize = sizeof(bandInfo);
+    bandInfo.fMask = RBBIM_STYLE | RBBIM_TEXT | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE;
+    bandInfo.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS;
+    bandInfo.lpText = L"Address";
+    bandInfo.hwndChild = m_comboBoxWindow;
+
+    RECT comboBoxRect;
+    ::GetWindowRect(m_comboBoxWindow, &comboBoxRect);
+    bandInfo.cx = 100;
+    bandInfo.cxMinChild = comboBoxRect.right - comboBoxRect.left;
+    bandInfo.cyMinChild = comboBoxRect.bottom - comboBoxRect.top;
+
+    // Add the band to the rebar.
+    int result = ::SendMessage(m_rebarWindow, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&bandInfo);
+    
+    // Create the browser view.
+    RECT webViewRect = { 0, 0, 0, 0};
+    m_browserView.create(webViewRect, this);
+}
+
+void BrowserWindow::onDestroy()
+{
+    MiniBrowser::shared().unregisterWindow(this);
+
+    // FIXME: Should we close the browser view here?
+}
+
+void BrowserWindow::onNCDestroy()
+{
+    delete this;
+}
+
+void BrowserWindow::onSize(int width, int height)
+{
+    RECT rebarRect;
+    ::GetClientRect(m_rebarWindow, &rebarRect);
+
+    // Resize the rebar.
+    ::MoveWindow(m_rebarWindow, 0, 0, width, rebarRect.bottom - rebarRect.top, true);
+
+    RECT webViewRect;
+    webViewRect.top = rebarRect.bottom;
+    webViewRect.left = 0;
+    webViewRect.right = width;
+    webViewRect.bottom = height;
+    m_browserView.setFrame(webViewRect);
+}
+
+LRESULT BrowserWindow::onCommand(int commandID, bool& handled)
+{
+    switch (commandID) {
+    case ID_FILE_NEW_WINDOW:
+        MiniBrowser::shared().createNewWindow();
+        break;
+    case ID_FILE_CLOSE:
+        ::PostMessage(m_window, WM_CLOSE, 0, 0);
+        break;
+    default:
+        handled = false;
+    }
+
+    return 0;
+}
+
+bool BrowserWindow::handleMessage(const MSG* message)
+{
+    if (message->hwnd != m_comboBoxWindow && !::IsChild(m_comboBoxWindow, message->hwnd))
+        return false;
+
+    // Look for a WM_KEYDOWN message.
+    if (message->message != WM_KEYDOWN)
+        return false;
+
+    // Look for the VK_RETURN key.
+    if (message->wParam != VK_RETURN)
+        return false;
+
+    std::vector<WCHAR> buffer;
+    int textLength = ::GetWindowTextLength(m_comboBoxWindow);
+
+    buffer.resize(textLength + 1);
+    ::GetWindowText(m_comboBoxWindow, &buffer[0], buffer.size());
+
+    std::wstring url(&buffer[0], buffer.size() - 1);
+
+    if (url.find(L"http://"))
+        url = L"http://" + url;
+
+    m_browserView.goToURL(url);
+
+    // We handled this message.
+    return true;
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserWindow.h b/WebKitTools/MiniBrowser/win/BrowserWindow.h
new file mode 100644
index 0000000..1cf7350
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserWindow.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 BrowserWindow_h
+#define BrowserWindow_h
+
+#include "BrowserView.h"
+#include <string>
+
+class BrowserWindow {
+public:
+    static BrowserWindow* create()
+    {
+        return new BrowserWindow;
+    }
+
+    void createWindow(int x, int y, int width, int height);
+    void showWindow();
+
+    void goToURL(const std::wstring& url);
+
+    bool handleMessage(const MSG*);
+
+    const BrowserView& view() const { return m_browserView; }
+    HWND window() const { return m_window; }
+
+private:
+    BrowserWindow();
+
+    static LRESULT CALLBACK BrowserWindowWndProc(HWND, UINT, WPARAM, LPARAM);
+
+    // Message handlers.
+    LRESULT wndProc(HWND, UINT, WPARAM, LPARAM);
+    void onCreate(LPCREATESTRUCT);
+    void onDestroy();
+    void onNCDestroy();
+
+    void onSize(int width, int height);
+    LRESULT onCommand(int commandID, bool& handled);
+
+    HWND m_window;
+
+    HWND m_rebarWindow;
+    HWND m_comboBoxWindow;
+    BrowserView m_browserView;
+};
+
+#endif // BrowserWindow_h
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.cpp b/WebKitTools/MiniBrowser/win/MiniBrowser.cpp
new file mode 100644
index 0000000..7e3d488
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "stdafx.h"
+
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include <assert.h>
+
+MiniBrowser::MiniBrowser()
+    : m_instance(0)
+{
+}
+
+MiniBrowser& MiniBrowser::shared()
+{
+    static MiniBrowser miniBrowser;
+
+    return miniBrowser;
+}
+
+void MiniBrowser::initialize(HINSTANCE instance)
+{
+    assert(!m_instance);
+
+    m_instance = instance;
+}
+
+void MiniBrowser::createNewWindow()
+{
+    static const wchar_t* kDefaultURLString = L"http://webkit.org/";
+
+    BrowserWindow* browserWindow = BrowserWindow::create();
+    browserWindow->createWindow(0, 0, 800, 600);
+    browserWindow->showWindow();
+    browserWindow->goToURL(kDefaultURLString);
+}
+
+void MiniBrowser::registerWindow(BrowserWindow* window)
+{
+    m_browserWindows.insert(window);
+}
+
+void MiniBrowser::unregisterWindow(BrowserWindow* window)
+{
+    m_browserWindows.erase(window);
+
+    if (m_browserWindows.empty())
+        ::PostQuitMessage(0);
+}
+
+bool MiniBrowser::handleMessage(const MSG* message)
+{
+    for (std::set<BrowserWindow*>::const_iterator it = m_browserWindows.begin(), end = m_browserWindows.end(); it != end; ++it) {
+        BrowserWindow* browserWindow = *it;
+
+        if (browserWindow->handleMessage(message))
+            return true;
+    }
+
+    return false;
+}
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.h b/WebKitTools/MiniBrowser/win/MiniBrowser.h
new file mode 100644
index 0000000..c7b5177
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 MiniBrowser_h
+#define MiniBrowser_h
+
+#include <set>
+
+class BrowserWindow;
+
+class MiniBrowser {
+public:
+    static MiniBrowser& shared();
+
+    void initialize(HINSTANCE);
+
+    void createNewWindow();
+
+    void registerWindow(BrowserWindow*);
+    void unregisterWindow(BrowserWindow*);
+
+    bool handleMessage(const MSG*);
+
+    HINSTANCE instance() const { return m_instance; }
+
+private:
+    MiniBrowser();
+
+    HINSTANCE m_instance;
+    std::set<BrowserWindow*> m_browserWindows;
+};
+
+#endif // MiniBrowser_h
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.rc b/WebKitTools/MiniBrowser/win/MiniBrowser.rc
new file mode 100644
index 0000000..556b0f6
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.rc
@@ -0,0 +1,30 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+#include "winresrc.h"

+

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+IDR_MAINFRAME MENU 

+BEGIN

+    POPUP "&File"

+    BEGIN

+        MENUITEM "&New Window\tCtrl+N",         ID_FILE_NEW_WINDOW

+        MENUITEM SEPARATOR

+        MENUITEM "&Close",                      ID_FILE_CLOSE

+    END

+END

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Accelerator

+//

+

+IDR_MAINFRAME_ACCEL ACCELERATORS 

+BEGIN

+    "N",            ID_FILE_NEW_WINDOW,           VIRTKEY, CONTROL, NOINVERT

+END

diff --git a/WebKitTools/MiniBrowser/win/main.cpp b/WebKitTools/MiniBrowser/win/main.cpp
new file mode 100644
index 0000000..0c125ba
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/main.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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 "stdafx.h"
+
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include <string>
+
+#if defined _M_IX86
+#define PROCESSORARCHITECTURE "x86"
+#elif defined _M_IA64
+#define PROCESSORARCHITECTURE "ia64"
+#elif defined _M_X64
+#define PROCESSORARCHITECTURE "amd64"
+#else
+#define PROCESSORARCHITECTURE "*"
+#endif
+
+#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='6595b64144ccf1df' language='*'\"")
+
+int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpstrCmdLine, int nCmdShow)
+{
+    MiniBrowser::shared().initialize(hInstance);
+
+    // Create and show our initial window.
+    MiniBrowser::shared().createNewWindow();
+
+    MSG message;
+    while (BOOL result = ::GetMessage(&message, 0, 0, 0)) {
+        if (result == -1)
+            break;
+        ::TranslateMessage(&message);
+
+        if (!MiniBrowser::shared().handleMessage(&message))
+            ::DispatchMessage(&message);
+    }
+
+    return 0;
+}
diff --git a/WebKitTools/MiniBrowser/win/resource.h b/WebKitTools/MiniBrowser/win/resource.h
new file mode 100644
index 0000000..ce07800
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/resource.h
@@ -0,0 +1,22 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by MiniBrowser.rc
+//
+
+#define ID_FILE_NEW_WINDOW              32770
+#define ID_FILE_OPEN                    32771
+#define ID_FILE_CLOSE                   32772
+
+#define IDR_MAINFRAME                   128
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC                     1
+#define _APS_NEXT_RESOURCE_VALUE        132
+#define _APS_NEXT_COMMAND_VALUE         32775
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           110
+#endif
+#endif
diff --git a/WebKitTools/MiniBrowser/win/stdafx.cpp b/WebKitTools/MiniBrowser/win/stdafx.cpp
new file mode 100644
index 0000000..c664e32
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/stdafx.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+// stdafx.cpp : source file that includes just the standard includes
+// MiniBrowser.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/WebKitTools/MiniBrowser/win/stdafx.h b/WebKitTools/MiniBrowser/win/stdafx.h
new file mode 100644
index 0000000..c5a35f9
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/stdafx.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+
+#include <tchar.h>
+#include <windows.h>
diff --git a/WebKitTools/QtLauncher/QtLauncher.pro b/WebKitTools/QtLauncher/QtLauncher.pro
index 7dcc8e4..0873bda 100644
--- a/WebKitTools/QtLauncher/QtLauncher.pro
+++ b/WebKitTools/QtLauncher/QtLauncher.pro
@@ -20,17 +20,37 @@
 
 CONFIG -= app_bundle
 CONFIG += uitools
-DESTDIR = ../../bin
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
 include(../../WebKit.pri)
 
-INCLUDEPATH += ../../JavaScriptCore
+DESTDIR = $$OUTPUT_DIR/bin
 
 QT += network
 macx:QT+=xml
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+linux-* {
+    # From Creator's src/rpath.pri:
+    # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
+    # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
+    QMAKE_RPATHDIR = \$\$ORIGIN/../lib $$QMAKE_RPATHDIR
+    MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
+
+    QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
+    QMAKE_RPATHDIR =
+} else {
+    QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+}
 
 symbian {
     TARGET.UID3 = 0xA000E543
     TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
 }
+
+contains(QT_CONFIG, opengl) {
+    QT += opengl
+    DEFINES += QT_CONFIGURED_WITH_OPENGL
+}
+
+RESOURCES += \
+    QtLauncher.qrc
diff --git a/WebKitTools/QtLauncher/QtLauncher.qrc b/WebKitTools/QtLauncher/QtLauncher.qrc
new file mode 100644
index 0000000..ffe77b0
--- /dev/null
+++ b/WebKitTools/QtLauncher/QtLauncher.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>useragentlist.txt</file>
+    </qresource>
+</RCC>
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
index 1203ce7..a03d135 100644
--- a/WebKitTools/QtLauncher/main.cpp
+++ b/WebKitTools/QtLauncher/main.cpp
@@ -32,6 +32,11 @@
 
 #include <QtGui>
 #include <QtNetwork/QNetworkRequest>
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+#include <QtOpenGL/QGLWidget>
+#endif
+
 #if !defined(QT_NO_PRINTER)
 #include <QPrintPreviewDialog>
 #endif
@@ -43,7 +48,6 @@
 #include <QDebug>
 
 #include <cstdio>
-#include "mainwindow.h"
 #include <qevent.h>
 #include <qwebelement.h>
 #include <qwebframe.h>
@@ -54,11 +58,13 @@
 #include <qx11info_x11.h>
 #endif
 
+#include "mainwindow.h"
 #include "urlloader.h"
 #include "utils.h"
 #include "webinspector.h"
 #include "webpage.h"
 #include "webview.h"
+#include "../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
 
 #ifdef Q_WS_MAEMO_5
 #include <X11/Xatom.h>
@@ -66,23 +72,32 @@
 #undef KeyPress
 #endif
 
-#ifndef NDEBUG
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
-#endif
-
-
+static const int gExitClickArea = 80;
 static bool gUseGraphicsView = false;
-static bool gUseCompositing = false;
+static bool gUseCompositing = true;
 static bool gCacheWebView = false;
 static bool gShowFrameRate = false;
 static QGraphicsView::ViewportUpdateMode gViewportUpdateMode = QGraphicsView::MinimalViewportUpdate;
+static QUrl gInspectorUrl;
+static bool gResizesToContents = false;
+static bool gUseTiledBackingStore = false;
+
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
+static bool gUseFrameFlattening = true;
+#else
+static bool gUseFrameFlattening = false;
+#endif
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+static bool gUseQGLWidgetViewport = false;
+#endif
 
 
 class LauncherWindow : public MainWindow {
     Q_OBJECT
 
 public:
-    LauncherWindow(QString url = QString());
+    LauncherWindow(LauncherWindow* other = 0, bool shareScene = false);
     virtual ~LauncherWindow();
 
     virtual void keyPressEvent(QKeyEvent* event);
@@ -90,9 +105,10 @@
 
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     void sendTouchEvent();
-    bool eventFilter(QObject* obj, QEvent* event);
 #endif
 
+    bool eventFilter(QObject* obj, QEvent* event);
+
 protected slots:
     void loadStarted();
     void loadFinished();
@@ -103,6 +119,7 @@
     void zoomOut();
     void resetZoom();
     void toggleZoomTextOnly(bool on);
+    void zoomAnimationFinished();
 
     void print();
     void screenshot();
@@ -116,69 +133,83 @@
 
     void setTouchMocking(bool on);
     void toggleAcceleratedCompositing(bool toggle);
+    void toggleTiledBackingStore(bool toggle);
+    void toggleResizesToContents(bool toggle);
+
+    void toggleWebGL(bool toggle);
     void initializeView(bool useGraphicsView = false);
+    void toggleSpatialNavigation(bool b);
+    void toggleFullScreenMode(bool enable);
+    void showFPS(bool enable);
+    void changeViewportUpdateMode(int mode);
+    void toggleFrameFlattening(bool toggle);
+    void toggleInterruptingJavaScriptEnabled(bool enable);
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+    void toggleQGLWidgetViewport(bool enable);
+#endif
+
+    void showUserAgentDialog();
 
 public slots:
-    void newWindow(const QString& url = QString());
+    LauncherWindow* newWindow();
+    LauncherWindow* cloneWindow();
+    void updateFPS(int fps);
+
+signals:
+    void enteredFullScreenMode(bool on);
 
 private:
-    // create the status bar, tool bar & menu
-    void setupUI();
+    void createChrome();
+    void applyZoom();
 
 private:
-    QVector<int> zoomLevels;
-    int currentZoom;
+    QVector<int> m_zoomLevels;
+    int m_currentZoom;
 
     QWidget* m_view;
-    WebInspector* inspector;
+    WebInspector* m_inspector;
 
-    QAction* formatMenuAction;
-    QAction* flipAnimated;
-    QAction* flipYAnimated;
+    QAction* m_formatMenuAction;
+    QAction* m_flipAnimated;
+    QAction* m_flipYAnimated;
 
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    QList<QTouchEvent::TouchPoint> touchPoints;
-    bool touchMocking;
+    QPropertyAnimation* m_zoomAnimation;
+    QList<QTouchEvent::TouchPoint> m_touchPoints;
+    bool m_touchMocking;
 #endif
+
+    void init(bool useGraphicsView = false);
+    bool isGraphicsBased() const;
+    void applyPrefs(LauncherWindow* other = 0);
 };
 
-
-LauncherWindow::LauncherWindow(QString url)
-    : MainWindow(url)
-    , currentZoom(100)
-{
-    QSplitter* splitter = new QSplitter(Qt::Vertical, this);
-    setCentralWidget(splitter);
-
-#if defined(Q_WS_S60)
-    showMaximized();
-#else
-    resize(800, 600);
+LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
+    : MainWindow()
+    , m_currentZoom(100)
+    , m_view(0)
+    , m_inspector(0)
+    , m_formatMenuAction(0)
+    , m_flipAnimated(0)
+    , m_flipYAnimated(0)
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    , m_zoomAnimation(0)
 #endif
+{
+    if (other) {
+        init(other->isGraphicsBased());
+        applyPrefs(other);
+        if (shareScene && other->isGraphicsBased()) {
+            QGraphicsView* otherView = static_cast<QGraphicsView*>(other->m_view);
+            static_cast<QGraphicsView*>(m_view)->setScene(otherView->scene());
+        }
+    } else {
+        init(gUseGraphicsView);
+        applyPrefs();
+    }
 
-    m_view = 0;
-    initializeView();
-
-    connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
-    connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
-    connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
-            this, SLOT(showLinkHover(const QString&, const QString&)));
-
-    inspector = new WebInspector(splitter);
-    inspector->setPage(page());
-    inspector->hide();
-    connect(this, SIGNAL(destroyed()), inspector, SLOT(deleteLater()));
-
-    setupUI();
-
-    // the zoom values are chosen to be like in Mozilla Firefox 3
-    zoomLevels << 30 << 50 << 67 << 80 << 90;
-    zoomLevels << 100;
-    zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
-
-    grabZoomKeys(true);
-
-    load(url);
+    createChrome();
 }
 
 LauncherWindow::~LauncherWindow()
@@ -186,6 +217,77 @@
     grabZoomKeys(false);
 }
 
+void LauncherWindow::init(bool useGraphicsView)
+{
+    QSplitter* splitter = new QSplitter(Qt::Vertical, this);
+    setCentralWidget(splitter);
+
+#if defined(Q_WS_S60)
+    setWindowState(Qt::WindowMaximized);
+#else
+    setWindowState(Qt::WindowNoState);
+    resize(800, 600);
+#endif
+
+    initializeView(useGraphicsView);
+
+    connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
+    connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
+    connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
+            this, SLOT(showLinkHover(const QString&, const QString&)));
+    connect(this, SIGNAL(enteredFullScreenMode(bool)), this, SLOT(toggleFullScreenMode(bool)));
+
+    if (!gInspectorUrl.isEmpty())
+      page()->settings()->setInspectorUrl(gInspectorUrl);
+
+    m_inspector = new WebInspector(splitter);
+    m_inspector->setPage(page());
+    m_inspector->hide();
+    connect(this, SIGNAL(destroyed()), m_inspector, SLOT(deleteLater()));
+
+    // the zoom values are chosen to be like in Mozilla Firefox 3
+    m_zoomLevels << 30 << 50 << 67 << 80 << 90;
+    m_zoomLevels << 100;
+    m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
+
+    grabZoomKeys(true);
+}
+
+bool LauncherWindow::isGraphicsBased() const
+{
+    return bool(qobject_cast<QGraphicsView*>(m_view));
+}
+
+inline void applySetting(QWebSettings::WebAttribute type, QWebSettings* settings, QWebSettings* other, bool defaultValue)
+{
+    settings->setAttribute(type, other ? other->testAttribute(type) : defaultValue);
+}
+
+void LauncherWindow::applyPrefs(LauncherWindow* source)
+{
+    QWebSettings* other = source ? source->page()->settings() : 0;
+    QWebSettings* settings = page()->settings();
+
+    applySetting(QWebSettings::AcceleratedCompositingEnabled, settings, other, gUseCompositing);
+    applySetting(QWebSettings::TiledBackingStoreEnabled, settings, other, gUseTiledBackingStore);
+    applySetting(QWebSettings::WebGLEnabled, settings, other, false);
+    applySetting(QWebSettings::FrameFlatteningEnabled, settings, other, gUseFrameFlattening);
+
+    if (!isGraphicsBased())
+        return;
+
+    WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+    WebViewGraphicsBased* otherView = source ? qobject_cast<WebViewGraphicsBased*>(source->m_view) : 0;
+
+    view->setViewportUpdateMode(otherView ? otherView->viewportUpdateMode() : gViewportUpdateMode);
+    view->setFrameRateMeasurementEnabled(otherView ? otherView->frameRateMeasurementEnabled() : gShowFrameRate);
+
+    if (otherView)
+        view->setItemCacheMode(otherView->itemCacheMode());
+    else
+        view->setItemCacheMode(gCacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
+}
+
 void LauncherWindow::keyPressEvent(QKeyEvent* event)
 {
 #ifdef Q_WS_MAEMO_5
@@ -225,31 +327,45 @@
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
 void LauncherWindow::sendTouchEvent()
 {
-    if (touchPoints.isEmpty())
+    if (m_touchPoints.isEmpty())
         return;
 
     QEvent::Type type = QEvent::TouchUpdate;
-    if (touchPoints.size() == 1) {
-        if (touchPoints[0].state() == Qt::TouchPointReleased)
+    if (m_touchPoints.size() == 1) {
+        if (m_touchPoints[0].state() == Qt::TouchPointReleased)
             type = QEvent::TouchEnd;
-        else if (touchPoints[0].state() == Qt::TouchPointPressed)
+        else if (m_touchPoints[0].state() == Qt::TouchPointPressed)
             type = QEvent::TouchBegin;
     }
 
     QTouchEvent touchEv(type);
-    touchEv.setTouchPoints(touchPoints);
+    touchEv.setTouchPoints(m_touchPoints);
     QCoreApplication::sendEvent(page(), &touchEv);
 
     // After sending the event, remove all touchpoints that were released
-    if (touchPoints[0].state() == Qt::TouchPointReleased)
-        touchPoints.removeAt(0);
-    if (touchPoints.size() > 1 && touchPoints[1].state() == Qt::TouchPointReleased)
-        touchPoints.removeAt(1);
+    if (m_touchPoints[0].state() == Qt::TouchPointReleased)
+        m_touchPoints.removeAt(0);
+    if (m_touchPoints.size() > 1 && m_touchPoints[1].state() == Qt::TouchPointReleased)
+        m_touchPoints.removeAt(1);
 }
+#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
 
 bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
 {
-    if (!touchMocking || obj != m_view)
+    // If click pos is the bottom right corner (square with size defined by gExitClickArea)
+    // and the window is on FullScreen, the window must return to its original state.
+    if (event->type() == QEvent::MouseButtonRelease) {
+        QMouseEvent* ev = static_cast<QMouseEvent*>(event);
+        if (windowState() == Qt::WindowFullScreen
+            && ev->pos().x() > (width() - gExitClickArea)
+            && ev->pos().y() > (height() - gExitClickArea)) {
+
+            emit enteredFullScreenMode(false);
+        }
+    }
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    if (!m_touchMocking)
         return QObject::eventFilter(obj, event);
 
     if (event->type() == QEvent::MouseButtonPress
@@ -276,12 +392,12 @@
         touchPoint.setPressure(1);
 
         // If the point already exists, update it. Otherwise create it.
-        if (touchPoints.size() > 0 && !touchPoints[0].id())
-            touchPoints[0] = touchPoint;
-        else if (touchPoints.size() > 1 && !touchPoints[1].id())
-            touchPoints[1] = touchPoint;
+        if (m_touchPoints.size() > 0 && !m_touchPoints[0].id())
+            m_touchPoints[0] = touchPoint;
+        else if (m_touchPoints.size() > 1 && !m_touchPoints[1].id())
+            m_touchPoints[1] = touchPoint;
         else
-            touchPoints.append(touchPoint);
+            m_touchPoints.append(touchPoint);
 
         sendTouchEvent();
     } else if (event->type() == QEvent::KeyPress
@@ -289,12 +405,12 @@
         && static_cast<QKeyEvent*>(event)->modifiers() == Qt::ControlModifier) {
 
         // If the keyboard point is already pressed, release it.
-        // Otherwise create it and append to touchPoints.
-        if (touchPoints.size() > 0 && touchPoints[0].id() == 1) {
-            touchPoints[0].setState(Qt::TouchPointReleased);
+        // Otherwise create it and append to m_touchPoints.
+        if (m_touchPoints.size() > 0 && m_touchPoints[0].id() == 1) {
+            m_touchPoints[0].setState(Qt::TouchPointReleased);
             sendTouchEvent();
-        } else if (touchPoints.size() > 1 && touchPoints[1].id() == 1) {
-            touchPoints[1].setState(Qt::TouchPointReleased);
+        } else if (m_touchPoints.size() > 1 && m_touchPoints[1].id() == 1) {
+            m_touchPoints[1].setState(Qt::TouchPointReleased);
             sendTouchEvent();
         } else {
             QTouchEvent::TouchPoint touchPoint;
@@ -303,16 +419,17 @@
             touchPoint.setScreenPos(QCursor::pos());
             touchPoint.setPos(m_view->mapFromGlobal(QCursor::pos()));
             touchPoint.setPressure(1);
-            touchPoints.append(touchPoint);
+            m_touchPoints.append(touchPoint);
             sendTouchEvent();
 
             // After sending the event, change the touchpoint state to stationary
-            touchPoints.last().setState(Qt::TouchPointStationary);
+            m_touchPoints.last().setState(Qt::TouchPointStationary);
         }
     }
+#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+
     return false;
 }
-#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
 
 void LauncherWindow::loadStarted()
 {
@@ -322,7 +439,7 @@
 void LauncherWindow::loadFinished()
 {
     QUrl url = page()->mainFrame()->url();
-    setAddressUrl(url.toString());
+    setAddressUrl(url.toString(QUrl::RemoveUserInfo));
     addCompleterEntry(url);
 }
 
@@ -337,30 +454,62 @@
 #endif
 }
 
+void LauncherWindow::zoomAnimationFinished()
+{
+    if (!isGraphicsBased())
+        return;
+    QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView();
+    view->setTiledBackingStoreFrozen(false);
+}
+
+void LauncherWindow::applyZoom()
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    if (isGraphicsBased() && page()->settings()->testAttribute(QWebSettings::TiledBackingStoreEnabled)) {
+        QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView();
+        view->setTiledBackingStoreFrozen(true);
+        if (!m_zoomAnimation) {
+            m_zoomAnimation = new QPropertyAnimation(view, "scale");
+            m_zoomAnimation->setStartValue(view->scale());
+            connect(m_zoomAnimation, SIGNAL(finished()), this, SLOT(zoomAnimationFinished()));
+        } else {
+            m_zoomAnimation->stop();
+            m_zoomAnimation->setStartValue(m_zoomAnimation->currentValue());
+        }
+
+        m_zoomAnimation->setDuration(300);
+        m_zoomAnimation->setEndValue(qreal(m_currentZoom) / 100.);
+        m_zoomAnimation->start();
+        return;
+    }
+#endif
+    page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);
+}
+
 void LauncherWindow::zoomIn()
 {
-    int i = zoomLevels.indexOf(currentZoom);
+    int i = m_zoomLevels.indexOf(m_currentZoom);
     Q_ASSERT(i >= 0);
-    if (i < zoomLevels.count() - 1)
-        currentZoom = zoomLevels[i + 1];
+    if (i < m_zoomLevels.count() - 1)
+        m_currentZoom = m_zoomLevels[i + 1];
 
-    page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
+    applyZoom();
 }
 
 void LauncherWindow::zoomOut()
 {
-    int i = zoomLevels.indexOf(currentZoom);
+    int i = m_zoomLevels.indexOf(m_currentZoom);
     Q_ASSERT(i >= 0);
     if (i > 0)
-        currentZoom = zoomLevels[i - 1];
+        m_currentZoom = m_zoomLevels[i - 1];
 
-    page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
+    applyZoom();
 }
 
 void LauncherWindow::resetZoom()
 {
-   currentZoom = 100;
-   page()->mainFrame()->setZoomFactor(1.0);
+    m_currentZoom = 100;
+    page()->mainFrame()->setZoomFactor(1.0);
 }
 
 void LauncherWindow::toggleZoomTextOnly(bool b)
@@ -373,7 +522,7 @@
 #if !defined(QT_NO_PRINTER)
     QPrintPreviewDialog dlg(this);
     connect(&dlg, SIGNAL(paintRequested(QPrinter*)),
-            m_view, SLOT(print(QPrinter*)));
+            page()->mainFrame(), SLOT(print(QPrinter*)));
     dlg.exec();
 #endif
 }
@@ -397,7 +546,7 @@
 void LauncherWindow::setEditable(bool on)
 {
     page()->setContentEditable(on);
-    formatMenuAction->setVisible(on);
+    m_formatMenuAction->setVisible(on);
 }
 
 /*
@@ -436,15 +585,31 @@
 void LauncherWindow::setTouchMocking(bool on)
 {
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    touchMocking = on;
+    m_touchMocking = on;
 #endif
 }
 
 void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
 {
+    gUseCompositing = toggle;
     page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, toggle);
 }
 
+void LauncherWindow::toggleTiledBackingStore(bool toggle)
+{
+    page()->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, toggle);
+}
+
+void LauncherWindow::toggleResizesToContents(bool toggle)
+{
+    static_cast<WebViewGraphicsBased*>(m_view)->setResizesToContents(toggle);
+}
+
+void LauncherWindow::toggleWebGL(bool toggle)
+{
+    page()->settings()->setAttribute(QWebSettings::WebGLEnabled, toggle);
+}
+
 void LauncherWindow::initializeView(bool useGraphicsView)
 {
     delete m_view;
@@ -454,38 +619,177 @@
     if (!useGraphicsView) {
         WebViewTraditional* view = new WebViewTraditional(splitter);
         view->setPage(page());
+
+        view->installEventFilter(this);
+
         m_view = view;
     } else {
         WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
         view->setPage(page());
-        view->setViewportUpdateMode(gViewportUpdateMode);
-        view->setItemCacheMode(gCacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
-        if (gShowFrameRate)
-            view->enableFrameRateMeasurement();
-        page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, gUseCompositing);
 
-        if (flipAnimated)
-            connect(flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
+        if (m_flipAnimated)
+            connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
 
-        if (flipYAnimated)
-            connect(flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
+        if (m_flipYAnimated)
+            connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
+
+        connect(view, SIGNAL(currentFPSUpdated(int)), this, SLOT(updateFPS(int)));
+
+        view->installEventFilter(this);
+        // The implementation of QAbstractScrollArea::eventFilter makes us need
+        // to install the event filter also on the viewport of a QGraphicsView.
+        view->viewport()->installEventFilter(this);
 
         m_view = view;
     }
 
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-    m_view->installEventFilter(this);
-    touchMocking = false;
+    m_touchMocking = false;
 #endif
 }
 
-void LauncherWindow::newWindow(const QString& url)
+void LauncherWindow::toggleSpatialNavigation(bool b)
 {
-    LauncherWindow* mw = new LauncherWindow(url);
-    mw->show();
+    page()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, b);
 }
 
-void LauncherWindow::setupUI()
+void LauncherWindow::toggleFullScreenMode(bool enable)
+{
+    if (enable)
+        setWindowState(Qt::WindowFullScreen);
+    else {
+#if defined(Q_WS_S60)
+        setWindowState(Qt::WindowMaximized);
+#else
+        setWindowState(Qt::WindowNoState);
+#endif
+    }
+}
+
+void LauncherWindow::showFPS(bool enable)
+{
+    if (!isGraphicsBased())
+        return;
+
+    gShowFrameRate = enable;
+    WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+    view->setFrameRateMeasurementEnabled(enable);
+
+    if (!enable) {
+#if defined(Q_WS_MAEMO_5) && defined(Q_WS_S60)
+        setWindowTitle("");
+#else
+        statusBar()->clearMessage();
+#endif
+    }
+}
+
+void LauncherWindow::changeViewportUpdateMode(int mode)
+{
+    gViewportUpdateMode = QGraphicsView::ViewportUpdateMode(mode);
+
+    if (!isGraphicsBased())
+        return;
+
+    WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+    view->setViewportUpdateMode(gViewportUpdateMode);
+}
+
+void LauncherWindow::toggleFrameFlattening(bool toggle)
+{
+    gUseFrameFlattening = toggle;
+    page()->settings()->setAttribute(QWebSettings::FrameFlatteningEnabled, toggle);
+}
+
+void LauncherWindow::toggleInterruptingJavaScriptEnabled(bool enable)
+{
+    page()->setInterruptingJavaScriptEnabled(enable);
+}
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+void LauncherWindow::toggleQGLWidgetViewport(bool enable)
+{
+    if (!isGraphicsBased())
+        return;
+
+    gUseQGLWidgetViewport = enable;
+    WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+
+    view->setViewport(enable ? new QGLWidget() : 0);
+}
+#endif
+
+void LauncherWindow::showUserAgentDialog()
+{
+    QStringList items;
+    QFile file(":/useragentlist.txt");
+    if (file.open(QIODevice::ReadOnly)) {
+         while (!file.atEnd())
+            items << file.readLine().trimmed();
+        file.close();
+    }
+
+    QSettings settings;
+    QString customUserAgent = settings.value("CustomUserAgent").toString();
+    if (!items.contains(customUserAgent) && !customUserAgent.isEmpty())
+        items << customUserAgent;
+
+    QDialog* dialog = new QDialog(this);
+    dialog->setWindowTitle("Change User Agent");
+
+    QVBoxLayout* layout = new QVBoxLayout(dialog);
+    dialog->setLayout(layout);
+
+    QComboBox* combo = new QComboBox(dialog);
+    combo->setMaximumWidth(size().width() * 0.7);
+    combo->setEditable(true);
+    combo->insertItems(0, items);
+    layout->addWidget(combo);
+
+    int index = combo->findText(page()->userAgentForUrl(QUrl()));
+    combo->setCurrentIndex(index);
+
+    QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
+            | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
+    connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
+    connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
+    layout->addWidget(buttonBox);
+
+    if (dialog->exec() && !combo->currentText().isEmpty()) {
+        page()->setUserAgent(combo->currentText());
+        if (!items.contains(combo->currentText()))
+            settings.setValue("CustomUserAgent", combo->currentText());
+    }
+
+    delete dialog;
+}
+
+LauncherWindow* LauncherWindow::newWindow()
+{
+    LauncherWindow* mw = new LauncherWindow(this, false);
+    mw->show();
+    return mw;
+}
+
+LauncherWindow* LauncherWindow::cloneWindow()
+{
+    LauncherWindow* mw = new LauncherWindow(this, true);
+    mw->show();
+    return mw;
+}
+
+void LauncherWindow::updateFPS(int fps)
+{
+    QString fpsStatusText = QString("Current FPS: %1").arg(fps);
+
+#if defined(Q_WS_MAEMO_5) && defined(Q_WS_S60)
+    setWindowTitle(fpsStatusText);
+#else
+    statusBar()->showMessage(fpsStatusText);
+#endif
+}
+
+void LauncherWindow::createChrome()
 {
     QMenu* fileMenu = menuBar()->addMenu("&File");
     fileMenu->addAction("New Window", this, SLOT(newWindow()), QKeySequence::New);
@@ -523,8 +827,8 @@
     // viewMenu->addAction("Dump plugins", this, SLOT(dumpPlugins()));
 
     QMenu* formatMenu = new QMenu("F&ormat", this);
-    formatMenuAction = menuBar()->addMenu(formatMenu);
-    formatMenuAction->setVisible(false);
+    m_formatMenuAction = menuBar()->addMenu(formatMenu);
+    m_formatMenuAction->setVisible(false);
     formatMenu->addAction(page()->action(QWebPage::ToggleBold));
     formatMenu->addAction(page()->action(QWebPage::ToggleItalic));
     formatMenu->addAction(page()->action(QWebPage::ToggleUnderline));
@@ -537,11 +841,20 @@
     zoomOut->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Minus));
     resetZoom->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
 
+    QMenu* windowMenu = menuBar()->addMenu("&Window");
+    QAction* toggleFullScreen = windowMenu->addAction("Toggle FullScreen", this, SIGNAL(enteredFullScreenMode(bool)));
+    toggleFullScreen->setCheckable(true);
+    toggleFullScreen->setChecked(false);
+
+    // when exit fullscreen mode by clicking on the exit area (bottom right corner) we must
+    // uncheck the Toggle FullScreen action
+    toggleFullScreen->connect(this, SIGNAL(enteredFullScreenMode(bool)), SLOT(setChecked(bool)));
+
     QMenu* toolsMenu = menuBar()->addMenu("&Develop");
     toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
-    QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
+    QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
     showInspectorAction->setCheckable(true);
-    showInspectorAction->connect(inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
+    showInspectorAction->connect(m_inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
 
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     QAction* touchMockAction = toolsMenu->addAction("Toggle multitouch mocking", this, SLOT(setTouchMocking(bool)));
@@ -549,26 +862,131 @@
     touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
 #endif
 
+    QWebSettings* settings = page()->settings();
+
     QMenu* graphicsViewMenu = toolsMenu->addMenu("QGraphicsView");
     QAction* toggleGraphicsView = graphicsViewMenu->addAction("Toggle use of QGraphicsView", this, SLOT(initializeView(bool)));
     toggleGraphicsView->setCheckable(true);
-    toggleGraphicsView->setChecked(false);
+    toggleGraphicsView->setChecked(isGraphicsBased());
+
+    QAction* toggleWebGL = toolsMenu->addAction("Toggle WebGL", this, SLOT(toggleWebGL(bool)));
+    toggleWebGL->setCheckable(true);
+    toggleWebGL->setChecked(settings->testAttribute(QWebSettings::WebGLEnabled));
 
     QAction* toggleAcceleratedCompositing = graphicsViewMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
     toggleAcceleratedCompositing->setCheckable(true);
-    toggleAcceleratedCompositing->setChecked(false);
-    toggleAcceleratedCompositing->setEnabled(false);
+    toggleAcceleratedCompositing->setChecked(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
+    toggleAcceleratedCompositing->setEnabled(isGraphicsBased());
     toggleAcceleratedCompositing->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
 
+    QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
+    toggleResizesToContents->setCheckable(true);
+    toggleResizesToContents->setChecked(false);
+    toggleResizesToContents->setEnabled(false);
+    toggleResizesToContents->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+    QAction* toggleTiledBackingStore = graphicsViewMenu->addAction("Toggle Tiled Backing Store", this, SLOT(toggleTiledBackingStore(bool)));
+    toggleTiledBackingStore->setCheckable(true);
+    toggleTiledBackingStore->setChecked(false);
+    toggleTiledBackingStore->setEnabled(false);
+    toggleTiledBackingStore->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+    QAction* spatialNavigationAction = toolsMenu->addAction("Toggle Spatial Navigation", this, SLOT(toggleSpatialNavigation(bool)));
+    spatialNavigationAction->setCheckable(true);
+    spatialNavigationAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_S));
+
+    QAction* toggleFrameFlattening = toolsMenu->addAction("Toggle Frame Flattening", this, SLOT(toggleFrameFlattening(bool)));
+    toggleFrameFlattening->setCheckable(true);
+    toggleFrameFlattening->setChecked(settings->testAttribute(QWebSettings::FrameFlatteningEnabled));
+
+    QAction* toggleInterruptingJavaScripteEnabled = toolsMenu->addAction("Enable interrupting js scripts", this, SLOT(toggleInterruptingJavaScriptEnabled(bool)));
+    toggleInterruptingJavaScripteEnabled->setCheckable(true);
+    toggleInterruptingJavaScripteEnabled->setChecked(false);
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+    QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool)));
+    toggleQGLWidgetViewport->setCheckable(true);
+    toggleQGLWidgetViewport->setChecked(gUseQGLWidgetViewport);
+    toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
+    toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+#endif
+
+    QAction* userAgentAction = toolsMenu->addAction("Change User Agent", this, SLOT(showUserAgentDialog()));
+    userAgentAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_U));
+
     graphicsViewMenu->addSeparator();
 
-    flipAnimated = graphicsViewMenu->addAction("Animated Flip");
-    flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-    flipAnimated->setEnabled(false);
+    m_flipAnimated = graphicsViewMenu->addAction("Animated Flip");
+    m_flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+    m_flipAnimated->setEnabled(isGraphicsBased());
 
-    flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
-    flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-    flipYAnimated->setEnabled(false);
+    m_flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
+    m_flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+    m_flipYAnimated->setEnabled(isGraphicsBased());
+
+    if (isGraphicsBased()) {
+        WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+        connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
+        connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
+    }
+
+    graphicsViewMenu->addSeparator();
+
+    QAction* cloneWindow = graphicsViewMenu->addAction("Clone Window", this, SLOT(cloneWindow()));
+    cloneWindow->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+    cloneWindow->setEnabled(isGraphicsBased());
+
+    QAction* showFPS = graphicsViewMenu->addAction("Show FPS", this, SLOT(showFPS(bool)));
+    showFPS->setCheckable(true);
+    showFPS->setEnabled(isGraphicsBased());
+    showFPS->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+    showFPS->setChecked(gShowFrameRate);
+
+    QMenu* viewportUpdateMenu = graphicsViewMenu->addMenu("Change Viewport Update Mode");
+    viewportUpdateMenu->setEnabled(isGraphicsBased());
+    viewportUpdateMenu->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+    QAction* fullUpdate = viewportUpdateMenu->addAction("FullViewportUpdate");
+    fullUpdate->setCheckable(true);
+    fullUpdate->setChecked((gViewportUpdateMode == QGraphicsView::FullViewportUpdate) ? true : false);
+
+    QAction* minimalUpdate = viewportUpdateMenu->addAction("MinimalViewportUpdate");
+    minimalUpdate->setCheckable(true);
+    minimalUpdate->setChecked((gViewportUpdateMode == QGraphicsView::MinimalViewportUpdate) ? true : false);
+
+    QAction* smartUpdate = viewportUpdateMenu->addAction("SmartViewportUpdate");
+    smartUpdate->setCheckable(true);
+    smartUpdate->setChecked((gViewportUpdateMode == QGraphicsView::SmartViewportUpdate) ? true : false);
+
+    QAction* boundingRectUpdate = viewportUpdateMenu->addAction("BoundingRectViewportUpdate");
+    boundingRectUpdate->setCheckable(true);
+    boundingRectUpdate->setChecked((gViewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) ? true : false);
+
+    QAction* noUpdate = viewportUpdateMenu->addAction("NoViewportUpdate");
+    noUpdate->setCheckable(true);
+    noUpdate->setChecked((gViewportUpdateMode == QGraphicsView::NoViewportUpdate) ? true : false);
+
+    QSignalMapper* signalMapper = new QSignalMapper(viewportUpdateMenu);
+    signalMapper->setMapping(fullUpdate, QGraphicsView::FullViewportUpdate);
+    signalMapper->setMapping(minimalUpdate, QGraphicsView::MinimalViewportUpdate);
+    signalMapper->setMapping(smartUpdate, QGraphicsView::SmartViewportUpdate);
+    signalMapper->setMapping(boundingRectUpdate, QGraphicsView::BoundingRectViewportUpdate);
+    signalMapper->setMapping(noUpdate, QGraphicsView::NoViewportUpdate);
+
+    connect(fullUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+    connect(minimalUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+    connect(smartUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+    connect(boundingRectUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+    connect(noUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+
+    connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(changeViewportUpdateMode(int)));
+
+    QActionGroup* viewportUpdateModeActions = new QActionGroup(viewportUpdateMenu);
+    viewportUpdateModeActions->addAction(fullUpdate);
+    viewportUpdateModeActions->addAction(minimalUpdate);
+    viewportUpdateModeActions->addAction(smartUpdate);
+    viewportUpdateModeActions->addAction(boundingRectUpdate);
+    viewportUpdateModeActions->addAction(noUpdate);
 }
 
 QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
@@ -602,7 +1020,7 @@
 {
 #ifndef NDEBUG
     int retVal = app.exec();
-    qt_drt_garbageCollector_collect();
+    DumpRenderTreeSupportQt::garbageCollectorCollect();
     QWebSettings::clearMemoryCaches();
     return retVal;
 #else
@@ -639,7 +1057,7 @@
 }
 
 LauncherApplication::LauncherApplication(int& argc, char** argv)
-    : QApplication(argc, argv)
+    : QApplication(argc, argv, QApplication::GuiServer)
     , m_isRobotized(false)
 {
     // To allow QWebInspector's configuration persistence
@@ -673,11 +1091,14 @@
     if (args.contains("-help")) {
         qDebug() << "Usage:" << programName.toLatin1().data()
              << "[-graphicsbased]"
-             << "[-compositing]"
+             << "[-no-compositing]"
              << QString("[-viewport-update-mode %1]").arg(formatKeys(updateModes)).toLatin1().data()
              << "[-cache-webview]"
              << "[-show-fps]"
              << "[-r list]"
+             << "[-inspector-url location]"
+             << "[-tiled-backing-store]"
+             << "[-resizes-to-contents]"
              << "URLs";
         appQuit(0);
     }
@@ -685,9 +1106,9 @@
     if (args.contains("-graphicsbased"))
         gUseGraphicsView = true;
 
-    if (args.contains("-compositing")) {
-        requiresGraphicsView("-compositing");
-        gUseCompositing = true;
+    if (args.contains("-no-compositing")) {
+        requiresGraphicsView("-no-compositing");
+        gUseCompositing = false;
     }
 
     if (args.contains("-show-fps")) {
@@ -700,6 +1121,16 @@
         gCacheWebView = true;
     }
 
+    if (args.contains("-tiled-backing-store")) {
+        requiresGraphicsView("-tiled-backing-store");
+        gUseTiledBackingStore = true;
+    }
+
+    if (args.contains("-resizes-to-contents")) {
+        requiresGraphicsView("-resizes-to-contents");
+        gResizesToContents = true;
+    }
+
     QString arg1("-viewport-update-mode");
     int modeIndex = args.indexOf(arg1);
     if (modeIndex != -1) {
@@ -715,6 +1146,11 @@
         gViewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
     }
 
+    QString inspectorUrlArg("-inspector-url");
+    int inspectorUrlIndex = args.indexOf(inspectorUrlArg);
+    if (inspectorUrlIndex != -1)
+       gInspectorUrl = takeOptionValue(&args, inspectorUrlIndex);
+
     int robotIndex = args.indexOf("-r");
     if (robotIndex != -1) {
         QString listFile = takeOptionValue(&args, robotIndex);
@@ -758,10 +1194,13 @@
 
     LauncherWindow* window = 0;
     foreach (QString url, urls) {
+        LauncherWindow* newWindow;
         if (!window)
-            window = new LauncherWindow(url);
+            newWindow = window = new LauncherWindow();
         else
-            window->newWindow(url);
+            newWindow = window->newWindow();
+
+        newWindow->load(url);
     }
 
     window->show();
diff --git a/WebKitTools/QtLauncher/mainwindow.cpp b/WebKitTools/QtLauncher/mainwindow.cpp
index 47755ec..aa6aa26 100644
--- a/WebKitTools/QtLauncher/mainwindow.cpp
+++ b/WebKitTools/QtLauncher/mainwindow.cpp
@@ -39,10 +39,8 @@
     : m_page(new WebPage(this))
 {
     setAttribute(Qt::WA_DeleteOnClose);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)
     if (qgetenv("QTLAUNCHER_USE_ARGB_VISUALS").toInt() == 1)
         setAttribute(Qt::WA_TranslucentBackground);
-#endif
 
     buildUI();
 }
@@ -73,6 +71,7 @@
 
     connect(page()->mainFrame(), SIGNAL(titleChanged(const QString&)),
             this, SLOT(setWindowTitle(const QString&)));
+    connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(setAddressUrl(QUrl)));
     connect(page(), SIGNAL(loadProgress(int)), urlEdit, SLOT(setProgress(int)));
     connect(page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
 
@@ -97,6 +96,11 @@
     return m_page;
 }
 
+void MainWindow::setAddressUrl(const QUrl& url)
+{
+    urlEdit->setText(url.toString(QUrl::RemoveUserInfo));
+}
+
 void MainWindow::setAddressUrl(const QString& url)
 {
     urlEdit->setText(url);
diff --git a/WebKitTools/QtLauncher/mainwindow.h b/WebKitTools/QtLauncher/mainwindow.h
index 1a30a09..d753a46 100644
--- a/WebKitTools/QtLauncher/mainwindow.h
+++ b/WebKitTools/QtLauncher/mainwindow.h
@@ -44,7 +44,6 @@
 public:
     MainWindow(const QString& url = QString());
 
-    void setAddressUrl(const QString& url);
     void addCompleterEntry(const QUrl& url);
 
     void load(const QString& url);
@@ -53,6 +52,8 @@
     WebPage* page();
 
 protected slots:
+    void setAddressUrl(const QString& url);
+    void setAddressUrl(const QUrl& url);
     void openFile();
     void changeLocation();
 
diff --git a/WebKitTools/QtLauncher/useragentlist.txt b/WebKitTools/QtLauncher/useragentlist.txt
new file mode 100644
index 0000000..ca53693
--- /dev/null
+++ b/WebKitTools/QtLauncher/useragentlist.txt
@@ -0,0 +1,9 @@
+Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/533.3 (KHTML, like Gecko) QtLauncher/0.1 Safari/533.3
+Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0; en-GB) AppleWebKit/533.3 (KHTML, like Gecko) QtLauncher/0.1 Mobile Safari/533.3
+Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8
+Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2
+Mozilla/5.0 (iPhone; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
+Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
+Opera/9.25 (Windows NT 6.0; U; en)
+Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
+Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
diff --git a/WebKitTools/QtLauncher/utils.h b/WebKitTools/QtLauncher/utils.h
index 9a16067..b67351e 100644
--- a/WebKitTools/QtLauncher/utils.h
+++ b/WebKitTools/QtLauncher/utils.h
@@ -28,10 +28,18 @@
 #ifndef utils_h
 #define utils_h
 
-#include <wtf/AlwaysInline.h>
-
 #include <QtCore>
 
+#ifndef NO_RETURN
+#if defined(__CC_ARM) || defined(__ARMCC__)
+#define NO_RETURN __declspec(noreturn)
+#elif defined(__GNUC__)
+#define NO_RETURN __attribute((__noreturn__))
+#else
+#define NO_RETURN
+#endif
+#endif
+
 // options handling
 QString takeOptionValue(QStringList* arguments, int index);
 QString formatKeys(QList<QString> keys);
diff --git a/WebKitTools/QtLauncher/webpage.cpp b/WebKitTools/QtLauncher/webpage.cpp
index 2fe1306..624a66f 100644
--- a/WebKitTools/QtLauncher/webpage.cpp
+++ b/WebKitTools/QtLauncher/webpage.cpp
@@ -39,6 +39,8 @@
 
 WebPage::WebPage(QObject* parent)
     : QWebPage(parent)
+    , m_userAgent()
+    , m_interruptingJavaScriptEnabled(false)
 {
     applyProxy();
 }
@@ -103,4 +105,16 @@
         QDesktopServices::openUrl(url);
 }
 
+QString WebPage::userAgentForUrl(const QUrl& url) const
+{
+    if (!m_userAgent.isEmpty())
+        return m_userAgent;
+    return QWebPage::userAgentForUrl(url);
+}
 
+bool WebPage::shouldInterruptJavaScript()
+{
+    if (!m_interruptingJavaScriptEnabled)
+        return false;
+    return QWebPage::shouldInterruptJavaScript();
+}
diff --git a/WebKitTools/QtLauncher/webpage.h b/WebKitTools/QtLauncher/webpage.h
index 14a0571..061deb5 100644
--- a/WebKitTools/QtLauncher/webpage.h
+++ b/WebKitTools/QtLauncher/webpage.h
@@ -49,11 +49,18 @@
 
     virtual bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
 
+    QString userAgentForUrl(const QUrl& url) const;
+    void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; }
+
 public slots:
     void openUrlInDefaultBrowser(const QUrl& url = QUrl());
+    void setUserAgent(const QString& ua) { m_userAgent = ua; }
+    bool shouldInterruptJavaScript();
 
 private:
     void applyProxy();
+    QString m_userAgent;
+    bool m_interruptingJavaScriptEnabled;
 };
 
 #endif
diff --git a/WebKitTools/QtLauncher/webview.cpp b/WebKitTools/QtLauncher/webview.cpp
index 311d79b..8c94438 100644
--- a/WebKitTools/QtLauncher/webview.cpp
+++ b/WebKitTools/QtLauncher/webview.cpp
@@ -41,10 +41,12 @@
     , m_numPaintsTotal(0)
     , m_numPaintsSinceLastMeasure(0)
     , m_measureFps(false)
+    , m_resizesToContents(false)
 {
     setScene(new QGraphicsScene(this));
     scene()->addItem(m_item);
 
+    setFrameShape(QFrame::NoFrame);
     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
@@ -71,23 +73,42 @@
     machine->setInitialState(s0);
     machine->start();
 #endif
+
+    m_updateTimer = new QTimer(this);
+    m_updateTimer->setInterval(1000);
+    connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
+}
+
+void WebViewGraphicsBased::setResizesToContents(bool b)
+{
+    m_resizesToContents = b;
+    m_item->setResizesToContents(m_resizesToContents);
+    if (m_resizesToContents) {
+        setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+        setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+    } else {
+        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    }
 }
 
 void WebViewGraphicsBased::resizeEvent(QResizeEvent* event)
 {
     QGraphicsView::resizeEvent(event);
+    if (m_resizesToContents)
+        return;
     QRectF rect(QPoint(0, 0), event->size());
     m_item->setGeometry(rect);
 }
 
-void WebViewGraphicsBased::enableFrameRateMeasurement()
+void WebViewGraphicsBased::setFrameRateMeasurementEnabled(bool enabled)
 {
-    m_measureFps = true;
-    m_lastConsultTime = m_startTime = QTime::currentTime();
-    QTimer* updateTimer = new QTimer(this);
-    updateTimer->setInterval(1000);
-    connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
-    updateTimer->start();
+    m_measureFps = enabled;
+    if (m_measureFps) {
+        m_lastConsultTime = m_startTime = QTime::currentTime();
+        m_updateTimer->start();
+    } else
+        m_updateTimer->stop();
 }
 
 void WebViewGraphicsBased::updateFrameRate()
@@ -100,7 +121,7 @@
     int average = total ? m_numPaintsTotal * 1000 / total : 0;
     int current = interval ? m_numPaintsSinceLastMeasure * 1000 / interval : 0;
 
-    qDebug("[FPS] average: %d, current: %d", average, current);
+    emit currentFPSUpdated(current);
 
     m_lastConsultTime = now;
     m_numPaintsSinceLastMeasure = 0;
diff --git a/WebKitTools/QtLauncher/webview.h b/WebKitTools/QtLauncher/webview.h
index 297d975..e8c3226 100644
--- a/WebKitTools/QtLauncher/webview.h
+++ b/WebKitTools/QtLauncher/webview.h
@@ -73,10 +73,15 @@
     virtual void resizeEvent(QResizeEvent*);
     void setPage(QWebPage* page) { m_item->setPage(page); }
     void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
+    QGraphicsItem::CacheMode itemCacheMode() { return m_item->cacheMode(); }
 
-    void enableFrameRateMeasurement();
+    void setFrameRateMeasurementEnabled(bool enabled);
+    bool frameRateMeasurementEnabled() const { return m_measureFps; }
+
     virtual void paintEvent(QPaintEvent* event);
 
+    void setResizesToContents(bool b);
+
     void setYRotation(qreal angle)
     {
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
@@ -93,6 +98,8 @@
         return m_yRotation;
     }
 
+    GraphicsWebView* graphicsWebView() const { return m_item; }
+
 public slots:
     void updateFrameRate();
     void animatedFlip();
@@ -100,6 +107,7 @@
 
 signals:
     void yFlipRequest();
+    void currentFPSUpdated(int fps);
 
 private:
     GraphicsWebView* m_item;
@@ -107,8 +115,10 @@
     int m_numPaintsSinceLastMeasure;
     QTime m_startTime;
     QTime m_lastConsultTime;
+    QTimer* m_updateTimer;
     bool m_measureFps;
     qreal m_yRotation;
+    bool m_resizesToContents;
 };
 
 #endif
diff --git a/WebKitTools/QueueStatusServer/handlers/__init__.py b/WebKitTools/QueueStatusServer/handlers/__init__.py
index ef65bee..296e173 100644
--- a/WebKitTools/QueueStatusServer/handlers/__init__.py
+++ b/WebKitTools/QueueStatusServer/handlers/__init__.py
@@ -1 +1,3 @@
 # Required for Python to search this directory for module files
+
+from handlers.updatebase import UpdateBase
diff --git a/WebKitTools/QueueStatusServer/handlers/svnrevision.py b/WebKitTools/QueueStatusServer/handlers/svnrevision.py
new file mode 100644
index 0000000..36eab33
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/svnrevision.py
@@ -0,0 +1,40 @@
+# Copyright (C) 2009 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.
+
+from google.appengine.ext import webapp
+
+import model
+
+
+class SVNRevision(webapp.RequestHandler):
+    def get(self, svn_revision_number):
+        svn_revisions = model.SVNRevision.all().filter('number =', int(svn_revision_number)).order('-date').fetch(1)
+        if not svn_revisions:
+            self.error(404)
+            return
+        self.response.out.write(svn_revisions[0].to_xml())
diff --git a/WebKitTools/QueueStatusServer/handlers/updatebase.py b/WebKitTools/QueueStatusServer/handlers/updatebase.py
new file mode 100644
index 0000000..b087e83
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/updatebase.py
@@ -0,0 +1,41 @@
+# 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.
+
+from google.appengine.api import users
+from google.appengine.ext import webapp, db
+
+
+class UpdateBase(webapp.RequestHandler):
+    def _int_from_request(self, name):
+        string_value = self.request.get(name)
+        try:
+            int_value = int(string_value)
+            return int_value
+        except ValueError, TypeError:
+            pass
+        return None
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 3ad7b77..50d4b6e 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -30,23 +30,14 @@
 from google.appengine.ext import webapp, db
 from google.appengine.ext.webapp import template
 
+from handlers.updatebase import UpdateBase
 from model.attachment import Attachment
 from model.queuestatus import QueueStatus
 
-
-class UpdateStatus(webapp.RequestHandler):
+class UpdateStatus(UpdateBase):
     def get(self):
         self.response.out.write(template.render("templates/updatestatus.html", None))
 
-    def _int_from_request(self, name):
-        string_value = self.request.get(name)
-        try:
-            int_value = int(string_value)
-            return int_value
-        except ValueError, TypeError:
-            pass
-        return None
-
     def post(self):
         queue_status = QueueStatus()
 
diff --git a/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py b/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py
new file mode 100644
index 0000000..075982a
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py
@@ -0,0 +1,53 @@
+# 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.
+
+from google.appengine.ext import webapp, db
+from google.appengine.ext.webapp import template
+
+import handlers
+import model
+
+
+class UpdateSVNRevision(handlers.UpdateBase):
+    def get(self):
+        self.response.out.write(template.render("templates/updatesvnrevision.html", None))
+
+    def post(self):
+        svn_revision_number = self._int_from_request("number")
+
+        svn_revisions = model.SVNRevision.all().filter('number =', svn_revision_number).order('-date').fetch(1)
+        svn_revision = None
+        if svn_revisions:
+            svn_revision = svn_revisions[0]
+        else:
+            svn_revision = model.SVNRevision()
+            svn_revision.number = svn_revision_number
+        svn_revision.broken_bots.append(self.request.get("broken_bot"))
+        svn_revision.put()
+
+        self.response.out.write(svn_revision.key().id())
diff --git a/WebKitTools/QueueStatusServer/index.yaml b/WebKitTools/QueueStatusServer/index.yaml
index 60ba3df..94b6692 100644
--- a/WebKitTools/QueueStatusServer/index.yaml
+++ b/WebKitTools/QueueStatusServer/index.yaml
@@ -28,3 +28,9 @@
   - name: queue_name
   - name: date
     direction: desc
+
+- kind: SVNRevision
+  properties:
+  - name: number
+  - name: date
+    direction: desc
diff --git a/WebKitTools/QueueStatusServer/main.py b/WebKitTools/QueueStatusServer/main.py
index 8efc771..8bfa7e9 100644
--- a/WebKitTools/QueueStatusServer/main.py
+++ b/WebKitTools/QueueStatusServer/main.py
@@ -40,7 +40,9 @@
 from handlers.recentstatus import RecentStatus
 from handlers.showresults import ShowResults
 from handlers.statusbubble import StatusBubble
+from handlers.svnrevision import SVNRevision
 from handlers.updatestatus import UpdateStatus
+from handlers.updatesvnrevision import UpdateSVNRevision
 
 webapp.template.register_template_library('filters.webkit_extras')
 
@@ -52,8 +54,10 @@
     (r'/patch/(.*)', Patch),
     (r'/results/(.*)', ShowResults),
     (r'/status-bubble/(.*)', StatusBubble),
+    (r'/svn-revision/(.*)', SVNRevision),
     (r'/queue-status/(.*)', RecentStatus),
     ('/update-status', UpdateStatus),
+    ('/update-svn-revision', UpdateSVNRevision),
 ]
 
 application = webapp.WSGIApplication(routes, debug=True)
diff --git a/WebKitTools/QueueStatusServer/model/__init__.py b/WebKitTools/QueueStatusServer/model/__init__.py
index ef65bee..1eaa044 100644
--- a/WebKitTools/QueueStatusServer/model/__init__.py
+++ b/WebKitTools/QueueStatusServer/model/__init__.py
@@ -1 +1,3 @@
 # Required for Python to search this directory for module files
+
+from model.svnrevision import SVNRevision
diff --git a/WebKitTools/QueueStatusServer/model/queues.py b/WebKitTools/QueueStatusServer/model/queues.py
index 8d48aff..57463de 100644
--- a/WebKitTools/QueueStatusServer/model/queues.py
+++ b/WebKitTools/QueueStatusServer/model/queues.py
@@ -27,10 +27,12 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 queues = [
+    "commit-queue",
     "style-queue",
     "chromium-ews",
+    "cr-win-ews",
     "qt-ews",
-    "mac-ews",
     "gtk-ews",
-    "commit-queue",
+    "mac-ews",
+    "win-ews",
 ]
diff --git a/WebKitTools/QueueStatusServer/model/svnrevision.py b/WebKitTools/QueueStatusServer/model/svnrevision.py
new file mode 100644
index 0000000..70ec0cc
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/svnrevision.py
@@ -0,0 +1,34 @@
+# 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.
+
+from google.appengine.ext import db
+
+class SVNRevision(db.Model):
+    number = db.IntegerProperty()
+    broken_bots = db.StringListProperty(default=[])
+    date = db.DateTimeProperty(auto_now_add=True)
diff --git a/WebKitTools/QueueStatusServer/templates/dashboard.html b/WebKitTools/QueueStatusServer/templates/dashboard.html
index 84ecabb..14b7ede 100644
--- a/WebKitTools/QueueStatusServer/templates/dashboard.html
+++ b/WebKitTools/QueueStatusServer/templates/dashboard.html
@@ -18,9 +18,11 @@
       <th>Bug</th>
       <th>Attachment</th>
       <th>Style</th>
-      <th>Chromium</th>
+      <th>Cr-Linux</th>
+      <th>Cr-Win</th>
       <th>Qt</th>
       <th>Mac</th>
+      <th>Win</th>
       <th>Gtk</th>
       <th>Commit</th>
     </tr>
@@ -42,6 +44,10 @@
           onclick="statusDetail({{ summary.attachment_id }})"
           title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
       </td>
+      <td class="status {{ summary.cr_win_ews.state }}"{% if summary.cr_win_ews.status %}
+          onclick="statusDetail({{ summary.attachment_id }})"
+          title="{{ summary.cr_win_ews.status.date|timesince }} ago"{% endif %}>
+      </td>
       <td class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
           onclick="statusDetail({{ summary.attachment_id }})"
           title="{{ summary.qt_ews.status.date|timesince }} ago"{% endif %}>
@@ -50,6 +56,10 @@
           onclick="statusDetail({{ summary.attachment_id }})"
           title="{{ summary.mac_ews.status.date|timesince }} ago"{% endif %}>
       </td>
+      <td class="status {{ summary.win_ews.state }}"{% if summary.win_ews.status %}
+          onclick="statusDetail({{ summary.attachment_id }})"
+          title="{{ summary.win_ews.status.date|timesince }} ago"{% endif %}>
+      </td>
       <td class="status {{ summary.gtk_ews.state }}"{% if summary.gtk_ews.status %}
           onclick="statusDetail({{ summary.attachment_id }})"
           title="{{ summary.gtk_ews.status.date|timesince }} ago"{% endif %}>
diff --git a/WebKitTools/QueueStatusServer/templates/statusbubble.html b/WebKitTools/QueueStatusServer/templates/statusbubble.html
index d1f331c..c6e2134 100644
--- a/WebKitTools/QueueStatusServer/templates/statusbubble.html
+++ b/WebKitTools/QueueStatusServer/templates/statusbubble.html
@@ -56,7 +56,12 @@
 <div class="status {{ summary.chromium_ews.state }}"{% if summary.chromium_ews.status %}
     onclick="statusDetail({{ summary.attachment_id }})"
     title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
-  chromium
+  cr-linux
+</div>
+<div class="status {{ summary.cr_win_ews.state }}"{% if summary.cr_win_ews.status %}
+    onclick="statusDetail({{ summary.attachment_id }})"
+    title="{{ summary.cr_win_ews.status.date|timesince }} ago"{% endif %}>
+  cr-win
 </div>
 <div class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
     onclick="statusDetail({{ summary.attachment_id }})"
@@ -73,5 +78,10 @@
     title="{{ summary.mac_ews.status.date|timesince }} ago"{% endif %}>
   mac
 </div>
+<div class="status {{ summary.win_ews.state }}"{% if summary.win_ews.status %}
+    onclick="statusDetail({{ summary.attachment_id }})"
+    title="{{ summary.win_ews.status.date|timesince }} ago"{% endif %}>
+  win
+</div>
 </body>
 </html>
diff --git a/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html b/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html
new file mode 100644
index 0000000..6ea4e7b
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html
@@ -0,0 +1,8 @@
+<form name="update_svn_revision" method="post">
+Update an SVN revision: <input name="number">
+  <div>
+     Broken Bot:
+    <input name="broken_bot">
+  </div>
+  <div><input type="submit" value="Update"></div>
+</form>
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index 022c72a..25a319b 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -61,6 +61,7 @@
         &isSVNDirectory
         &isSVNVersion16OrNewer
         &makeFilePathRelative
+        &mergeChangeLogs
         &normalizePath
         &parsePatch
         &pathRelativeToSVNRepositoryRootForPath
@@ -815,6 +816,76 @@
     return $exitStatus;
 }
 
+# Merge ChangeLog patches using a three-file approach.
+#
+# This is used by resolve-ChangeLogs when it's operated as a merge driver
+# and when it's used to merge conflicts after a patch is applied or after
+# an svn update.
+#
+# It's also used for traditional rejected patches.
+#
+# Args:
+#   $fileMine:  The merged version of the file.  Also known in git as the
+#               other branch's version (%B) or "ours".
+#               For traditional patch rejects, this is the *.rej file.
+#   $fileOlder: The base version of the file.  Also known in git as the
+#               ancestor version (%O) or "base".
+#               For traditional patch rejects, this is the *.orig file.
+#   $fileNewer: The current version of the file.  Also known in git as the
+#               current version (%A) or "theirs".
+#               For traditional patch rejects, this is the original-named
+#               file.
+#
+# Returns 1 if merge was successful, else 0.
+sub mergeChangeLogs($$$)
+{
+    my ($fileMine, $fileOlder, $fileNewer) = @_;
+
+    my $traditionalReject = $fileMine =~ /\.rej$/ ? 1 : 0;
+
+    local $/ = undef;
+
+    my $patch;
+    if ($traditionalReject) {
+        open(DIFF, "<", $fileMine) or die $!;
+        $patch = <DIFF>;
+        close(DIFF);
+        rename($fileMine, "$fileMine.save");
+        rename($fileOlder, "$fileOlder.save");
+    } else {
+        open(DIFF, "-|", qw(diff -u -a --binary), $fileOlder, $fileMine) or die $!;
+        $patch = <DIFF>;
+        close(DIFF);
+    }
+
+    unlink("${fileNewer}.orig");
+    unlink("${fileNewer}.rej");
+
+    open(PATCH, "| patch --force --fuzz=3 --binary $fileNewer > " . File::Spec->devnull()) or die $!;
+    print PATCH ($traditionalReject ? $patch : fixChangeLogPatch($patch));
+    close(PATCH);
+
+    my $result = !exitStatus($?);
+
+    # Refuse to merge the patch if it did not apply cleanly
+    if (-e "${fileNewer}.rej") {
+        unlink("${fileNewer}.rej");
+        if (-f "${fileNewer}.orig") {
+            unlink($fileNewer);
+            rename("${fileNewer}.orig", $fileNewer);
+        }
+    } else {
+        unlink("${fileNewer}.orig");
+    }
+
+    if ($traditionalReject) {
+        rename("$fileMine.save", $fileMine);
+        rename("$fileOlder.save", $fileOlder);
+    }
+
+    return $result;
+}
+
 sub gitConfig($)
 {
     return unless $isGit;
diff --git a/WebKitTools/Scripts/build-dumprendertree b/WebKitTools/Scripts/build-dumprendertree
index 72e81b0..14690a8 100755
--- a/WebKitTools/Scripts/build-dumprendertree
+++ b/WebKitTools/Scripts/build-dumprendertree
@@ -45,6 +45,7 @@
   --gtk         Build the GTK+ port
   --qt          Build the Qt port
   --wx          Build the wxWindows port
+  --chromium    Build the Chromium port
 EOF
 
 GetOptions(
@@ -72,6 +73,17 @@
 } elsif (isQt() || isGtk() || isWx()) {
     # Qt, Gtk and wxWindows build everything in one shot. No need to build anything here.
     $result = 0;
+} elsif (isChromium()) {
+    if (isDarwin()) {
+        $result = buildXCodeProject("DumpRenderTree.gyp/DumpRenderTree", $clean, @ARGV);
+    } elsif (isCygwin() || isWindows()) {
+        # Windows build - builds the root visual studio solution.
+        $result = buildChromiumVisualStudioProject("DumpRenderTree.gyp/DumpRenderTree.sln", $clean);
+    } elsif (isLinux()) {
+        $result = buildChromiumMakefile("../../WebKit/chromium/", "DumpRenderTree", $clean);
+    } else {
+        die "This platform is not supported by Chromium.\n";
+    }
 } else {
     die "Building not defined for this platform!\n";
 }
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 5ae1aae..2d172c5 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -48,15 +48,17 @@
 my $showHelp = 0;
 my $clean = 0;
 my $minimal = 0;
+my $webkit2 = 0;
 my $makeArgs;
 my $startTime = time();
 
 my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport,
     $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $indexedDatabaseSupport,
-    $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $sharedWorkersSupport,
+    $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport,
     $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
     $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
-    $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport);
+    $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport,
+    $fileReaderSupport, $fileWriterSupport);
 
 my @features = (
     { option => "3d-canvas", desc => "Toggle 3D canvas support",
@@ -65,6 +67,9 @@
     { option => "3d-rendering", desc => "Toggle 3D rendering support",
       define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDRenderingSupport },
 
+    { option => "blob-slice", desc => "Toggle Blob.slice support",
+      define => "ENABLE_BLOB_SLICE", default => (isAppleMacWebKit()), value => \$blobSliceSupport },
+
     { option => "channel-messaging", desc => "Toggle MessageChannel and MessagePort support",
       define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
 
@@ -116,6 +121,12 @@
     { option => "ruby", desc => "Toggle HTML5 Ruby support",
       define => "ENABLE_RUBY", default => 1, value => \$rubySupport },
 
+    { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
+      define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
+
+    { option => "sandbox", desc => "Toggle HTML5 Sandboxed iframe support",
+      define => "ENABLE_SANDBOX", default => 1, value => \$sandboxSupport },
+
     { option => "shared-workers", desc => "Toggle SharedWorkers support",
       define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$sharedWorkersSupport },
 
@@ -140,6 +151,9 @@
     { option => "svg-use", desc => "Toggle SVG use element support (implies SVG support)",
       define => "ENABLE_SVG_USE", default => 1, value => \$svgUseSupport },
 
+    { option => "tiled-backing-store", desc => "Toggle Tiled Backing Store support",
+      define => "ENABLE_TILED_BACKING_STORE", default => isQt(), value => \$tiledBackingStoreSupport },
+
     { option => "video", desc => "Toggle Video support",
       define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk()), value => \$videoSupport },
 
@@ -163,6 +177,12 @@
 
     { option => "xslt", desc => "Toggle XSLT support",
       define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
+
+    { option => "file-reader", desc => "Toggle FileReader support",
+      define => "ENABLE_FILE_READER", default => 0, value => \$fileReaderSupport },
+
+    { option => "file-writer", desc => "Toggle FileWriter support",
+      define => "ENABLE_FILE_WRITER", default => 0, value => \$fileWriterSupport },
 );
 
 # Update defaults from Qt's project file
@@ -204,6 +224,7 @@
   --chromium                        Build the Chromium port on Mac/Win/Linux
   --gtk                             Build the GTK+ port
   --qt                              Build the Qt port
+  --webkit2                         Build the WebKit2 framework
   --inspector-frontend              Copy changes to the inspector front-end files to the build directory
 
   --makeargs=<arguments>            Optional Makefile flags
@@ -217,6 +238,7 @@
     'clean' => \$clean,
     'makeargs=s' => \$makeArgs,
     'minimal' => \$minimal,
+    'webkit2' => \$webkit2,
 );
 
 # Build usage text and options list from features
@@ -239,7 +261,14 @@
 my $productDir = productDir();
 
 # Check that all the project directories are there.
-my @projects = ("JavaScriptCore", "WebCore", "WebKit");
+my @projects = ("JavaScriptCore", "WebCore");
+
+if (!$webkit2) {
+    push @projects, "WebKit";
+} else {
+    push @projects, ("WebKit2", "WebKitTools/MiniBrowser");
+}
+
 # Only Apple builds JavaScriptGlue, and only on the Mac
 splice @projects, 1, 0, "JavaScriptGlue" if isAppleMacWebKit();
 
@@ -254,6 +283,7 @@
 
 # enable autotool options accordingly
 if (isGtk()) {
+    @options = @ARGV;
     foreach (@features) {
         push @options, autotoolsFlag(${$_->{value}}, $_->{option});
     }
@@ -359,7 +389,18 @@
     } elsif (isQt()) {
         $result = buildQMakeQtProject($dir, $clean, @options);
     } elsif (isAppleMacWebKit()) {
-        $result = buildXCodeProject($dir, $clean, @options, @ARGV);
+        my @completeOptions = @options;
+        if ($webkit2 && $dir eq "WebCore") {
+            my @webKit2SpecificOverrides = (
+                'UMBRELLA_LDFLAGS=',
+                'GCC_PREPROCESSOR_DEFINITIONS=$(GCC_PREPROCESSOR_DEFINITIONS) ' .
+                    'ENABLE_EXPERIMENTAL_SINGLE_VIEW_MODE=1 ' .
+                    'WTF_USE_WEB_THREAD=1 '
+            );
+            push @completeOptions, @webKit2SpecificOverrides;
+        }
+
+        $result = buildXCodeProject($dir, $clean, @completeOptions, @ARGV);
     } elsif (isAppleWinWebKit()) {
         if ($dir eq "WebKit") {
             $result = buildVisualStudioProject("win/WebKit.vcproj/WebKit.sln", $clean);
@@ -420,10 +461,16 @@
 
     print "\n";
     print "===========================================================\n";
-    print " WebKit is now built ($buildTime). \n";
-    if (!isChromium()) {
-        print " To run $launcherName with this newly-built code, use the\n";
-        print " \"$launcherPath\" script.\n";
+    if ($webkit2) {
+        print " WebKit2 is now built ($buildTime). \n";
+        print " To run MiniBrowser with this newly-built code, use the\n";
+        print " \"run-minibrowser\" script.\n";
+    } else {
+        print " WebKit is now built ($buildTime). \n";
+        if (!isChromium()) {
+            print " To run $launcherName with this newly-built code, use the\n";
+            print " \"$launcherPath\" script.\n";
+        }
     }
     print "===========================================================\n";
 }
diff --git a/WebKitTools/Scripts/check-for-global-initializers b/WebKitTools/Scripts/check-for-global-initializers
index cf83048..0472901 100755
--- a/WebKitTools/Scripts/check-for-global-initializers
+++ b/WebKitTools/Scripts/check-for-global-initializers
@@ -37,6 +37,7 @@
 use File::Basename;
 
 sub touch($);
+sub demangle($);
 
 my $arch = $ENV{'CURRENT_ARCH'};
 my $configuration = $ENV{'CONFIGURATION'};
@@ -78,9 +79,14 @@
         next;
     }
     my $sawGlobal = 0;
+    my @globals;
     while (<NM>) {
         if (/^STDOUT:/) {
-            $sawGlobal = 1 if /__GLOBAL__I/;
+            my $line = $_;
+            if ($line =~ /__GLOBAL__I(.+)$/) {
+                $sawGlobal = 1;
+                push(@globals, demangle($1));
+            }
         } else {
             print STDERR if $_ ne "nm: no name list\n";
         }
@@ -119,7 +125,7 @@
             }
         }
 
-        print "ERROR: $shortName has a global initializer in it! ($file)\n";
+        print "ERROR: $shortName has one or more global initializers in it! ($file), near @globals\n";
         $sawError = 1;
     }
 }
@@ -138,3 +144,17 @@
     open(TOUCH, ">", $path) or die "$!";
     close(TOUCH);
 }
+
+sub demangle($)
+{
+    my ($symbol) = @_;
+    if (!open FILT, "c++filt $symbol |") {
+        print "ERROR: Could not open c++filt\n";
+        return;
+    }
+    my $result = <FILT>;
+    close FILT;
+    chomp $result;
+    return $result;
+}
+
diff --git a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
new file mode 100755
index 0000000..2bc65d4
--- /dev/null
+++ b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
@@ -0,0 +1,66 @@
+#!/usr/bin/env ruby
+
+# Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
+project_name = ENV['PROJECT_NAME'] or throw "Unable to find PROJECT_NAME in the environment!"
+
+$INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*.css", "*.in", "*.idl"] } }
+
+Dir.chdir base_directory
+
+$error_printed = false
+
+def print_error msg
+  $error_printed = true
+  STDERR.puts "ERROR: #{msg}"
+end
+
+def print_inappropriate_file_error framework, relative_path
+  print_error "#{framework}.framework/#{relative_path} should not be present in the framework."
+end
+
+def check_framework framework
+  $INAPPROPRIATE_FILES[framework].each do |directory, patterns|
+    Dir.chdir "#{framework}.framework/Versions/A/#{directory}" do
+      patterns.each do |pattern|
+        Dir.glob(pattern).each do |inappropriate_file|
+          print_inappropriate_file_error framework, "Resources/#{inappropriate_file}"
+          File.unlink inappropriate_file
+        end
+      end
+    end
+  end
+end
+
+check_framework project_name
+
+if $error_printed
+  STDERR.puts
+  STDERR.puts "    Inappropriate files were detected and have been removed from the framework."
+  STDERR.puts "    If this error continues to appear after building again then the build system needs"
+  STDERR.puts "    to be modified so that the inappropriate files are no longer copied in to the framework."
+  STDERR.puts
+  exit 1
+end
diff --git a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
new file mode 100755
index 0000000..693dd6a
--- /dev/null
+++ b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
@@ -0,0 +1,109 @@
+#!/usr/bin/env ruby
+
+# Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+
+base_directory = ENV['TARGET_BUILD_DIR']
+
+unless base_directory
+  throw "Unable to find TARGET_BUILD_DIR in the environment!"
+end
+
+Dir.chdir base_directory
+
+$PERMITTED_INCLUDE_TYPES = { :public => [ :public ], :private => [ :public, :private ] }
+
+$HEADER_NAMES_TO_TYPE = { }
+$HEADERS_BY_TYPE = { :public => [], :private => [] }
+
+$error_printed = false
+
+def print_error msg
+  $error_printed = true
+  STDERR.puts "ERROR: #{msg}"
+end
+
+def build_header_maps
+  all_headers = `find WebKit.framework/Versions/A/{,Private}Headers -type f -name '*.h'`.split
+
+  all_headers.each do |header|
+    if /\/Headers\/(.*)/.match(header)
+      $HEADER_NAMES_TO_TYPE[$1] = :public
+      $HEADERS_BY_TYPE[:public] << header
+    elsif /\/PrivateHeaders\/(.*)/.match(header)
+      $HEADER_NAMES_TO_TYPE[$1] = :private
+      $HEADERS_BY_TYPE[:private] << header
+    else
+      print_error "Unknown header type: #{header}"
+    end
+  end
+end
+
+def resolve_include(header, included_header, permitted_types)
+  # Ignore includes that aren't in the typical framework style.
+  return unless /<([^\/]+)\/(.*)>/.match(included_header)
+
+  framework, included_header_name = [$1, $2]
+
+  # Ignore includes that aren't related to other WebKit headers.
+  return unless framework =~ /^Web/
+
+  # A header of any type including a WebCore header is a recipe for disaster.
+  if framework == "WebCore"
+    # <rdar://problem/7718826> WebKeyGenerator.h should not include a WebCore header
+    return if header =~ /\/WebKeyGenerator.h$/ and included_header_name == "WebCoreKeyGenerator.h"
+
+    print_error "#{header} included #{included_header}!"
+    return
+  end
+
+  header_type = $HEADER_NAMES_TO_TYPE[included_header_name]
+
+  if not header_type
+    print_error "#{header} included #{included_header} but I could not find a header of that name!"
+  elsif not permitted_types.member?(header_type)
+    print_error "#{header} included #{included_header} which is #{header_type}!"
+  end
+end
+
+def verify_includes(header, permitted_types)
+  File.open(header) do |file|
+    file.each_line do |line|
+      if /#(include|import) (.*)/.match(line)
+        resolve_include(header, $2, permitted_types)
+      end
+    end
+  end
+end
+
+build_header_maps
+
+$HEADERS_BY_TYPE.each do |header_type, headers|
+  permitted_types = $PERMITTED_INCLUDE_TYPES[header_type]
+  headers.each do |header|
+    verify_includes header, permitted_types
+  end
+end
+
+exit 1 if $error_printed
diff --git a/WebKitTools/Scripts/check-webkit-style b/WebKitTools/Scripts/check-webkit-style
index ea2e943..9897fbd 100755
--- a/WebKitTools/Scripts/check-webkit-style
+++ b/WebKitTools/Scripts/check-webkit-style
@@ -43,51 +43,84 @@
 """
 
 import codecs
+import logging
 import os
 import os.path
 import sys
 
+from webkitpy.style_references import detect_checkout
 import webkitpy.style.checker as checker
-from webkitpy.style_references import SimpleScm
+from webkitpy.style.checker import PatchChecker
+from webkitpy.style.main import change_directory
 
+_log = logging.getLogger("check-webkit-style")
+
+
+# FIXME: Move this code to style.main.
 def main():
     # Change stderr to write with replacement characters so we don't die
     # if we try to print something containing non-ASCII characters.
-    sys.stderr = codecs.StreamReaderWriter(sys.stderr,
-                                           codecs.getreader('utf8'),
-                                           codecs.getwriter('utf8'),
-                                           'replace')
+    stderr = codecs.StreamReaderWriter(sys.stderr,
+                                       codecs.getreader('utf8'),
+                                       codecs.getwriter('utf8'),
+                                       'replace')
+    # Setting an "encoding" attribute on the stream is necessary to
+    # prevent the logging module from raising an error.  See
+    # the checker.configure_logging() function for more information.
+    stderr.encoding = "UTF-8"
+
+    # FIXME: Change webkitpy.style so that we do not need to overwrite
+    #        the global sys.stderr.  This involves updating the code to
+    #        accept a stream parameter where necessary, and not calling
+    #        sys.stderr explicitly anywhere.
+    sys.stderr = stderr
+
+    args = sys.argv[1:]
+
+    # Checking for the verbose flag before calling check_webkit_style_parser()
+    # lets us enable verbose logging earlier.
+    is_verbose = "-v" in args or "--verbose" in args
+
+    checker.configure_logging(stream=stderr, is_verbose=is_verbose)
+    _log.debug("Verbose logging enabled.")
+
+    checkout = detect_checkout()
+
+    if checkout is None:
+        checkout_root = None
+        _log.debug("WebKit checkout not found for current directory.")
+    else:
+        checkout_root = checkout.root_path()
+        _log.debug("WebKit checkout found with root: %s" % checkout_root)
+
     parser = checker.check_webkit_style_parser()
-    (files, options) = parser.parse(sys.argv[1:])
+    (paths, options) = parser.parse(args)
+
+    if checkout is None and not paths:
+        _log.error("WebKit checkout not found: You must run this script "
+                   "from within a WebKit checkout if you are not passing "
+                   "specific paths to check.")
+        sys.exit(1)
 
     configuration = checker.check_webkit_style_configuration(options)
     style_checker = checker.StyleChecker(configuration)
 
-    if files:
-        for filename in files:
-            style_checker.check_file(filename)
+    paths = change_directory(checkout_root=checkout_root, paths=paths)
 
+    if paths:
+        style_checker.check_paths(paths)
     else:
-        scm = SimpleScm()
-
-        os.chdir(scm.checkout_root())
-
         if options.git_commit:
-            commit = options.git_commit
-            if '..' in commit:
-                # FIXME: If the range is a "...", the code should find the common ancestor and
-                # start there (see git diff --help for information about how ... usually works).
-                commit = commit[:commit.find('..')]
-                print >> sys.stderr, "Warning: Ranges are not supported for --git-commit. Checking all changes since %s.\n" % commit
-            patch = scm.create_patch_since_local_commit(commit)
+            patch = checkout.create_patch_since_local_commit(options.git_commit)
         else:
-            patch = scm.create_patch()
-        style_checker.check_patch(patch)
+            patch = checkout.create_patch()
+        patch_checker = PatchChecker(style_checker)
+        patch_checker.check(patch)
 
     error_count = style_checker.error_count
     file_count = style_checker.file_count
-    sys.stderr.write('Total errors found: %d in %d files\n'
-                     % (error_count, file_count))
+    _log.info("Total errors found: %d in %d files"
+              % (error_count, file_count))
     # We fail when style errors are found or there are no checked files.
     sys.exit(error_count > 0 or file_count == 0)
 
diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor
index 75017e3..a642731 100755
--- a/WebKitTools/Scripts/commit-log-editor
+++ b/WebKitTools/Scripts/commit-log-editor
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.
 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,7 @@
 
 sub normalizeLineEndings($$);
 sub removeLongestCommonPrefixEndingInDoubleNewline(\%);
+sub isCommitLogEditor($);
 
 sub usage
 {
@@ -61,30 +62,33 @@
 my $baseDir = baseProductDir();
 
 my $editor = $ENV{SVN_LOG_EDITOR};
-if (!$editor) {
+if (!$editor || isCommitLogEditor($editor)) {
     $editor = $ENV{CVS_LOG_EDITOR};
 }
-if (!$editor) {
+if (!$editor || isCommitLogEditor($editor)) {
     my $builtEditorApplication = "$baseDir/Release/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
     $editor = $builtEditorApplication if -x $builtEditorApplication;
 }
-if (!$editor) {
+if (!$editor || isCommitLogEditor($editor)) {
     my $builtEditorApplication = "$baseDir/Debug/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
     $editor = $builtEditorApplication if -x $builtEditorApplication;
 }
-if (!$editor) {
+if (!$editor || isCommitLogEditor($editor)) {
     my $installedEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
     $editor = $installedEditorApplication if -x $installedEditorApplication;
 }
-if (!$editor) {
-    $editor = $ENV{EDITOR} || "/usr/bin/vi";
+if (!$editor || isCommitLogEditor($editor)) {
+    $editor = $ENV{EDITOR};
+}
+if (!$editor || isCommitLogEditor($editor)) {
+    $editor = "/usr/bin/vi";
 }
 
 my $inChangesToBeCommitted = !isGit();
 my @changeLogs = ();
 my $logContents = "";
 my $existingLog = 0;
-open LOG, $log or die;
+open LOG, $log or die "Could not open the log file.";
 while (<LOG>) {
     if (isGit()) {
         if (/^# Changes to be committed:$/) {
@@ -102,7 +106,7 @@
     }
     $existingLog = isGit() && !(/^#/ || /^\s*$/) unless $existingLog;
 
-    push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^M....(.*ChangeLog)\r?\n?$/ || /^#\tmodified:   (.*ChangeLog)/) && !/-ChangeLog/;
+    push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file):   (.*ChangeLog)$/) && !/-ChangeLog$/;
 }
 close LOG;
 
@@ -151,8 +155,8 @@
             # Remove indentation spaces
             $line =~ s/^ {8}//;
 
-            # Save the reviewed by line
-            if ($line =~ m/^Reviewed by .*/) {
+            # Save the reviewed / rubber stamped by line.
+            if ($line =~ m/^Reviewed by .*/ || $line =~ m/^Rubber[ \-]?stamped by .*/) {
                 $reviewedByLine = $line;
                 next;
             }
@@ -184,7 +188,6 @@
                 $reviewedByLine = "";
             }
 
-
             $lineCount++;
             $contents .= $line;
         } else {
@@ -204,12 +207,6 @@
     my $sortKey = lc $label;
     if ($label eq "top level") {
         $sortKey = "";
-    } elsif ($label eq "Tools") {
-        $sortKey = "-, just after top level";
-    } elsif ($label eq "WebBrowser") {
-        $sortKey = lc "WebKit, WebBrowser after";
-    } elsif ($label eq "WebCore") {
-        $sortKey = lc "WebFoundation, WebCore after";
     } elsif ($label eq "LayoutTests") {
         $sortKey = lc "~, LayoutTests last";
     }
@@ -307,3 +304,9 @@
     }
     return substr($prefix, 0, $lastDoubleNewline + 2);
 }
+
+sub isCommitLogEditor($)
+{
+    my $editor = shift;
+    return $editor =~ m/commit-log-editor/;
+}
diff --git a/WebKitTools/Scripts/debug-minibrowser b/WebKitTools/Scripts/debug-minibrowser
new file mode 100755
index 0000000..06685b4
--- /dev/null
+++ b/WebKitTools/Scripts/debug-minibrowser
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2005, 2007 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. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+
+# Simplified "debug" script for debugging the WebKit2 MiniBrowser.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(debugMiniBrowser());
diff --git a/WebKitTools/Scripts/new-run-webkit-httpd b/WebKitTools/Scripts/new-run-webkit-httpd
new file mode 100755
index 0000000..88ae84e
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-httpd
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+# 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.
+
+"""A utility script for starting and stopping the HTTP server with the
+   same configuration as used in the layout tests."""
+
+#
+# FIXME: currently this code only works with the Chromium ports and LigHTTPd.
+# It should be made to work on all ports.
+#
+# This script is also used by Chromium's ui_tests to run http layout tests
+# in a browser.
+#
+import optparse
+import os
+import sys
+import tempfile
+
+scripts_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
+webkitpy_directory = os.path.join(scripts_directory, "webkitpy")
+sys.path.append(os.path.join(webkitpy_directory, "layout_tests"))
+
+import port
+from port import http_server
+
+def run(options):
+    if not options.server:
+        print ('Usage: %s --server {start|stop} [--root=root_dir]'
+               ' [--port=port_number]' % sys.argv[0])
+    else:
+        if (options.root is None) and (options.port is not None):
+            # specifying root but not port means we want httpd on default
+            # set of ports that LayoutTest use, but pointing to a different
+            # source of tests. Specifying port but no root does not seem
+            # meaningful.
+            raise 'Specifying port requires also a root.'
+        port_obj = port.get(None, options)
+        httpd = http_server.Lighttpd(port_obj,
+                                     tempfile.gettempdir(),
+                                     port=options.port,
+                                     root=options.root,
+                                     register_cygwin=options.register_cygwin,
+                                     run_background=options.run_background)
+        if options.server == 'start':
+            httpd.start()
+        else:
+            httpd.stop(force=True)
+
+
+def main():
+    option_parser = optparse.OptionParser()
+    option_parser.add_option('-k', '--server',
+        help='Server action (start|stop)')
+    option_parser.add_option('-p', '--port',
+        help='Port to listen on (overrides layout test ports)')
+    option_parser.add_option('-r', '--root',
+        help='Absolute path to DocumentRoot (overrides layout test roots)')
+    option_parser.add_option('--register_cygwin', action="store_true",
+        dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
+    option_parser.add_option('--run_background', action="store_true",
+        dest="run_background",
+        help='Run on background (for running as UI test)')
+    options, args = option_parser.parse_args()
+
+    # FIXME: Make this work with other ports as well.
+    options.chromium = True
+
+    run(options)
+
+
+if '__main__' == __name__:
+    main()
diff --git a/WebKitTools/Scripts/new-run-webkit-tests b/WebKitTools/Scripts/new-run-webkit-tests
new file mode 100755
index 0000000..2ebe1da
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-tests
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+# 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.
+
+"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
+import sys
+
+import webkitpy.layout_tests.run_webkit_tests as run_webkit_tests
+
+if __name__ == '__main__':
+    options, args = run_webkit_tests.parse_args()
+    sys.exit(run_webkit_tests.main(options, args))
diff --git a/WebKitTools/Scripts/new-run-webkit-websocketserver b/WebKitTools/Scripts/new-run-webkit-websocketserver
new file mode 100644
index 0000000..8e4aeaa
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-websocketserver
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+# 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.
+
+"""A utility script for starting and stopping the web socket server with the
+   same configuration as used in the layout tests."""
+
+import logging
+import optparse
+import tempfile
+
+import webkitpy.layout_tests.port.factory as factory
+import webkitpy.layout_tests.port.websocket_server as websocket_server
+
+
+def main():
+    option_parser = optparse.OptionParser()
+    option_parser.add_option('--server', type='choice',
+                             choices=['start', 'stop'], default='start',
+                             help='Server action (start|stop)')
+    option_parser.add_option('-p', '--port', dest='port',
+                             default=None, help='Port to listen on')
+    option_parser.add_option('-r', '--root',
+                             help='Absolute path to DocumentRoot '
+                                  '(overrides layout test roots)')
+    option_parser.add_option('-t', '--tls', dest='use_tls',
+                             action='store_true',
+                             default=False, help='use TLS (wss://)')
+    option_parser.add_option('-k', '--private_key', dest='private_key',
+                             default='', help='TLS private key file.')
+    option_parser.add_option('-c', '--certificate', dest='certificate',
+                             default='', help='TLS certificate file.')
+    option_parser.add_option('--register_cygwin', action="store_true",
+                             dest="register_cygwin",
+                             help='Register Cygwin paths (on Win try bots)')
+    option_parser.add_option('--pidfile', help='path to pid file.')
+    option_parser.add_option('-v', '--verbose', action='store_true',
+                             default=False, help='include debug-level logging')
+    options, args = option_parser.parse_args()
+
+    if not options.port:
+        if options.use_tls:
+            # FIXME: We shouldn't grab at this private variable.
+            options.port = websocket_server._DEFAULT_WSS_PORT
+        else:
+            # FIXME: We shouldn't grab at this private variable.
+            options.port = websocket_server._DEFAULT_WS_PORT
+
+    kwds = {'port': options.port, 'use_tls': options.use_tls}
+    if options.root:
+        kwds['root'] = options.root
+    if options.private_key:
+        kwds['private_key'] = options.private_key
+    if options.certificate:
+        kwds['certificate'] = options.certificate
+    kwds['register_cygwin'] = options.register_cygwin
+    if options.pidfile:
+        kwds['pidfile'] = options.pidfile
+
+    port_obj = factory.get()
+    pywebsocket = websocket_server.PyWebSocket(port_obj, tempfile.gettempdir(), **kwds)
+
+    log_level = logging.WARN
+    if options.verbose:
+        log_level = logging.DEBUG
+    logging.basicConfig(level=log_level)
+
+    if 'start' == options.server:
+        pywebsocket.start()
+    else:
+        pywebsocket.stop(force=True)
+
+if '__main__' == __name__:
+    main()
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
new file mode 100755
index 0000000..d5d7349
--- /dev/null
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -0,0 +1,2281 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
+# Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)
+# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2009 Andras Becsi (becsi.andras@stud.u-szeged.hu), University of Szeged
+#
+# 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. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+
+# Script to run the WebKit Open Source Project layout tests.
+
+# Run all the tests passed in on the command line.
+# If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .xhtmlmp, .pl, .php (and svg) files in the test directory.
+
+# Run each text.
+# Compare against the existing file xxx-expected.txt.
+# If there is a mismatch, generate xxx-actual.txt and xxx-diffs.txt.
+
+# At the end, report:
+#   the number of tests that got the expected results
+#   the number of tests that ran, but did not get the expected results
+#   the number of tests that failed to run
+#   the number of tests that were run but had no expected results to compare against
+
+use strict;
+use warnings;
+
+use Cwd;
+use Data::Dumper;
+use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
+use File::Basename;
+use File::Copy;
+use File::Find;
+use File::Path;
+use File::Spec;
+use File::Spec::Functions;
+use File::Temp;
+use FindBin;
+use Getopt::Long;
+use IPC::Open2;
+use IPC::Open3;
+use Time::HiRes qw(time usleep);
+
+use List::Util 'shuffle';
+
+use lib $FindBin::Bin;
+use webkitperl::features;
+use webkitperl::httpd;
+use webkitdirs;
+use VCSUtils;
+use POSIX;
+
+sub buildPlatformResultHierarchy();
+sub buildPlatformTestHierarchy(@);
+sub closeCygpaths();
+sub closeDumpTool();
+sub closeWebSocketServer();
+sub configureAndOpenHTTPDIfNeeded();
+sub countAndPrintLeaks($$$);
+sub countFinishedTest($$$$);
+sub deleteExpectedAndActualResults($);
+sub dumpToolDidCrash();
+sub epiloguesAndPrologues($$);
+sub expectedDirectoryForTest($;$;$);
+sub fileNameWithNumber($$);
+sub htmlForResultsSection(\@$&);
+sub isTextOnlyTest($);
+sub launchWithEnv(\@\%);
+sub resolveAndMakeTestResultsDirectory();
+sub numericcmp($$);
+sub openDiffTool();
+sub openDumpTool();
+sub parseLeaksandPrintUniqueLeaks();
+sub openWebSocketServerIfNeeded();
+sub pathcmp($$);
+sub printFailureMessageForTest($$);
+sub processIgnoreTests($$);
+sub readFromDumpToolWithTimer(**);
+sub readSkippedFiles($);
+sub recordActualResultsAndDiff($$);
+sub sampleDumpTool();
+sub setFileHandleNonBlocking(*$);
+sub slowestcmp($$);
+sub splitpath($);
+sub stopRunningTestsEarlyIfNeeded();
+sub stripExtension($);
+sub stripMetrics($$);
+sub testCrashedOrTimedOut($$$$$);
+sub toURL($);
+sub toWindowsPath($);
+sub validateSkippedArg($$;$);
+sub writeToFile($$);
+
+# Argument handling
+my $addPlatformExceptions = 0;
+my $complexText = 0;
+my $exitAfterNFailures = 0;
+my $generateNewResults = isAppleMacWebKit() ? 1 : 0;
+my $guardMalloc = '';
+# FIXME: Dynamic HTTP-port configuration in this file is wrong.  The various
+# apache config files in LayoutTests/http/config govern the port numbers.
+# Dynamic configuration as-written will also cause random failures in
+# an IPv6 environment.  See https://bugs.webkit.org/show_bug.cgi?id=37104.
+my $httpdPort = 8000;
+my $httpdSSLPort = 8443;
+my $ignoreMetrics = 0;
+my $webSocketPort = 8880;
+# wss is disabled until all platforms support pyOpenSSL.
+# my $webSocketSecurePort = 9323;
+my $ignoreTests = '';
+my $iterations = 1;
+my $launchSafari = 1;
+my $mergeDepth;
+my $pixelTests = '';
+my $platform;
+my $quiet = '';
+my $randomizeTests = 0;
+my $repeatEach = 1;
+my $report10Slowest = 0;
+my $resetResults = 0;
+my $reverseTests = 0;
+my $root;
+my $runSample = 1;
+my $shouldCheckLeaks = 0;
+my $showHelp = 0;
+my $stripEditingCallbacks = isCygwin();
+my $testHTTP = 1;
+my $testMedia = 1;
+my $tmpDir = "/tmp";
+my $testResultsDirectory = File::Spec->catfile($tmpDir, "layout-test-results");
+my $testsPerDumpTool = 1000;
+my $threaded = 0;
+# DumpRenderTree has an internal timeout of 30 seconds, so this must be > 30.
+my $timeoutSeconds = 35;
+my $tolerance = 0;
+my $treatSkipped = "default";
+my $useRemoteLinksToTests = 0;
+my $useValgrind = 0;
+my $verbose = 0;
+my $shouldWaitForHTTPD = 0;
+
+my @leaksFilenames;
+
+if (isWindows() || isMsys()) {
+    print "This script has to be run under Cygwin to function correctly.\n";
+    exit 1;
+}
+
+# Default to --no-http for wx for now.
+$testHTTP = 0 if (isWx());
+
+my $expectedTag = "expected";
+my $actualTag = "actual";
+my $prettyDiffTag = "pretty-diff";
+my $diffsTag = "diffs";
+my $errorTag = "stderr";
+
+my @macPlatforms = ("mac-tiger", "mac-leopard", "mac-snowleopard", "mac");
+
+if (isAppleMacWebKit()) {
+    if (isTiger()) {
+        $platform = "mac-tiger";
+        $tolerance = 1.0;
+    } elsif (isLeopard()) {
+        $platform = "mac-leopard";
+        $tolerance = 0.1;
+    } elsif (isSnowLeopard()) {
+        $platform = "mac-snowleopard";
+        $tolerance = 0.1;
+    } else {
+        $platform = "mac";
+    }
+} elsif (isQt()) {
+    if (isDarwin()) {
+        $platform = "qt-mac";
+    } elsif (isLinux()) {
+        $platform = "qt-linux";
+    } elsif (isWindows() || isCygwin()) {
+        $platform = "qt-win";
+    } else {
+        $platform = "qt";
+    }
+} elsif (isGtk()) {
+    $platform = "gtk";
+    if (!$ENV{"WEBKIT_TESTFONTS"}) {
+        print "The WEBKIT_TESTFONTS environment variable is not defined.\n";
+        print "You must set it before running the tests.\n";
+        print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
+        exit 1;
+    }
+} elsif (isWx()) {
+    $platform = "wx";
+} elsif (isCygwin()) {
+    $platform = "win";
+}
+
+if (!defined($platform)) {
+    print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
+    $platform = "undefined";
+}
+
+my $programName = basename($0);
+my $launchSafariDefault = $launchSafari ? "launch" : "do not launch";
+my $httpDefault = $testHTTP ? "run" : "do not run";
+my $sampleDefault = $runSample ? "run" : "do not run";
+
+my $usage = <<EOF;
+Usage: $programName [options] [testdir|testpath ...]
+  --add-platform-exceptions       Put new results for non-platform-specific failing tests into the platform-specific results directory
+  --complex-text                  Use the complex text code path for all text (Mac OS X and Windows only)
+  -c|--configuration config       Set DumpRenderTree build configuration
+  -g|--guard-malloc               Enable malloc guard
+  --exit-after-n-failures N       Exit after the first N failures instead of running all tests
+  -h|--help                       Show this help message
+  --[no-]http                     Run (or do not run) http tests (default: $httpDefault)
+  --[no-]wait-for-httpd           Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: $shouldWaitForHTTPD) 
+  -i|--ignore-tests               Comma-separated list of directories or tests to ignore
+  --iterations n                  Number of times to run the set of tests (e.g. ABCABCABC)
+  --[no-]launch-safari            Launch (or do not launch) Safari to display test results (default: $launchSafariDefault)
+  -l|--leaks                      Enable leaks checking
+  --[no-]new-test-results         Generate results for new tests
+  --nthly n                       Restart DumpRenderTree every n tests (default: $testsPerDumpTool)
+  -p|--pixel-tests                Enable pixel tests
+  --tolerance t                   Ignore image differences less than this percentage (default: $tolerance)
+  --platform                      Override the detected platform to use for tests and results (default: $platform)
+  --port                          Web server port to use with http tests
+  -q|--quiet                      Less verbose output
+  --reset-results                 Reset ALL results (including pixel tests if --pixel-tests is set)
+  -o|--results-directory          Output results directory (default: $testResultsDirectory)
+  --random                        Run the tests in a random order
+  --repeat-each n                 Number of times to run each test (e.g. AAABBBCCC)
+  --reverse                       Run the tests in reverse alphabetical order
+  --root                          Path to root tools build
+  --[no-]sample-on-timeout        Run sample on timeout (default: $sampleDefault) (Mac OS X only)
+  -1|--singly                     Isolate each test case run (implies --nthly 1 --verbose)
+  --skipped=[default|ignore|only] Specifies how to treat the Skipped file
+                                     default: Tests/directories listed in the Skipped file are not tested
+                                     ignore:  The Skipped file is ignored
+                                     only:    Only those tests/directories listed in the Skipped file will be run
+  --slowest                       Report the 10 slowest tests
+  --ignore-metrics                Ignore metrics in tests
+  --[no-]strip-editing-callbacks  Remove editing callbacks from expected results
+  -t|--threaded                   Run a concurrent JavaScript thead with each test
+  --timeout t                     Sets the number of seconds before a test times out (default: $timeoutSeconds)
+  --valgrind                      Run DumpRenderTree inside valgrind (Qt/Linux only)
+  -v|--verbose                    More verbose output (overrides --quiet)
+  -m|--merge-leak-depth arg       Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg.  Defaults to 5.
+  --use-remote-links-to-tests     Link to test files within the SVN repository in the results.
+EOF
+
+setConfiguration();
+
+my $getOptionsResult = GetOptions(
+    'add-platform-exceptions' => \$addPlatformExceptions,
+    'complex-text' => \$complexText,
+    'exit-after-n-failures=i' => \$exitAfterNFailures,
+    'guard-malloc|g' => \$guardMalloc,
+    'help|h' => \$showHelp,
+    'http!' => \$testHTTP,
+    'wait-for-httpd!' => \$shouldWaitForHTTPD,
+    'ignore-metrics!' => \$ignoreMetrics,
+    'ignore-tests|i=s' => \$ignoreTests,
+    'iterations=i' => \$iterations,
+    'launch-safari!' => \$launchSafari,
+    'leaks|l' => \$shouldCheckLeaks,
+    'merge-leak-depth|m:5' => \$mergeDepth,
+    'new-test-results!' => \$generateNewResults,
+    'nthly=i' => \$testsPerDumpTool,
+    'pixel-tests|p' => \$pixelTests,
+    'platform=s' => \$platform,
+    'port=i' => \$httpdPort,
+    'quiet|q' => \$quiet,
+    'random' => \$randomizeTests,
+    'repeat-each=i' => \$repeatEach,
+    'reset-results' => \$resetResults,
+    'results-directory|o=s' => \$testResultsDirectory,
+    'reverse' => \$reverseTests,
+    'root=s' => \$root,
+    'sample-on-timeout!' => \$runSample,
+    'singly|1' => sub { $testsPerDumpTool = 1; },
+    'skipped=s' => \&validateSkippedArg,
+    'slowest' => \$report10Slowest,
+    'strip-editing-callbacks!' => \$stripEditingCallbacks,
+    'threaded|t' => \$threaded,
+    'timeout=i' => \$timeoutSeconds,
+    'tolerance=f' => \$tolerance,
+    'use-remote-links-to-tests' => \$useRemoteLinksToTests,
+    'valgrind' => \$useValgrind,
+    'verbose|v' => \$verbose,
+);
+
+if (!$getOptionsResult || $showHelp) {
+    print STDERR $usage;
+    exit 1;
+}
+
+my $ignoreSkipped = $treatSkipped eq "ignore";
+my $skippedOnly = $treatSkipped eq "only";
+
+my $configuration = configuration();
+
+# We need an environment variable to be able to enable the feature per-slave
+$shouldWaitForHTTPD = $ENV{"WEBKIT_WAIT_FOR_HTTPD"} unless ($shouldWaitForHTTPD);
+$verbose = 1 if $testsPerDumpTool == 1;
+
+if ($shouldCheckLeaks && $testsPerDumpTool > 1000) {
+    print STDERR "\nWARNING: Running more than 1000 tests at a time with MallocStackLogging enabled may cause a crash.\n\n";
+}
+
+# Stack logging does not play well with QuickTime on Tiger (rdar://problem/5537157)
+$testMedia = 0 if $shouldCheckLeaks && isTiger();
+
+# Generating remote links causes a lot of unnecessary spew on GTK build bot
+$useRemoteLinksToTests = 0 if isGtk();
+
+setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
+my $productDir = productDir();
+$productDir .= "/bin" if isQt();
+$productDir .= "/Programs" if isGtk();
+
+chdirWebKit();
+
+if (!defined($root)) {
+    print STDERR "Running build-dumprendertree\n";
+
+    local *DEVNULL;
+    my ($childIn, $childOut, $childErr);
+    if ($quiet) {
+        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
+        $childOut = ">&DEVNULL";
+        $childErr = ">&DEVNULL";
+    } else {
+        # When not quiet, let the child use our stdout/stderr.
+        $childOut = ">&STDOUT";
+        $childErr = ">&STDERR";
+    }
+
+    my @args = argumentsForConfiguration();
+    my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/build-dumprendertree", @args) or die "Failed to run build-dumprendertree";
+    close($childIn);
+    waitpid $buildProcess, 0;
+    my $buildResult = $?;
+    close($childOut);
+    close($childErr);
+
+    close DEVNULL if ($quiet);
+
+    if ($buildResult) {
+        print STDERR "Compiling DumpRenderTree failed!\n";
+        exit exitStatus($buildResult);
+    }
+}
+
+my $dumpToolName = "DumpRenderTree";
+$dumpToolName .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
+my $dumpTool = "$productDir/$dumpToolName";
+die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool;
+
+my $imageDiffTool = "$productDir/ImageDiff";
+$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
+die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
+
+checkFrameworks() unless isCygwin();
+
+if (isAppleMacWebKit()) {
+    push @INC, $productDir;
+    require DumpRenderTreeSupport;
+}
+
+my $layoutTestsName = "LayoutTests";
+my $testDirectory = File::Spec->rel2abs($layoutTestsName);
+my $expectedDirectory = $testDirectory;
+my $platformBaseDirectory = catdir($testDirectory, "platform");
+my $platformTestDirectory = catdir($platformBaseDirectory, $platform);
+my @platformResultHierarchy = buildPlatformResultHierarchy();
+my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy);
+
+$expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
+
+$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
+my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
+
+if (isAppleMacWebKit()) {
+    print STDERR "Compiling Java tests\n";
+    my $javaTestsDirectory = catdir($testDirectory, "java");
+
+    if (system("/usr/bin/make", "-C", "$javaTestsDirectory")) {
+        exit 1;
+    }
+}
+
+
+print "Running tests from $testDirectory\n";
+if ($pixelTests) {
+    print "Enabling pixel tests with a tolerance of $tolerance%\n";
+    if (isDarwin()) {
+        print "WARNING: Temporarily changing the main display color profile:\n";
+        print "\tThe colors on your screen will change for the duration of the testing.\n";
+        print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
+        
+        if (isPerianInstalled()) {
+            print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
+            print "\tYou should avoid generating new pixel results in this environment.\n";
+            print "\tSee https://bugs.webkit.org/show_bug.cgi?id=22615 for details.\n";
+        }
+    }
+}
+
+system "ln", "-s", $testDirectory, "/tmp/LayoutTests" unless -x "/tmp/LayoutTests";
+
+my %ignoredFiles = ( "results.html" => 1 );
+my %ignoredDirectories = map { $_ => 1 } qw(platform);
+my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources script-tests);
+my %supportedFileExtensions = map { $_ => 1 } qw(html shtml xml xhtml xhtmlmp pl php);
+
+if (!checkWebCoreFeatureSupport("MathML", 0)) {
+    $ignoredDirectories{'mathml'} = 1;
+}
+
+# FIXME: We should fix webkitperl/features.pm:hasFeature() to do the correct feature detection for Cygwin.
+if (checkWebCoreFeatureSupport("SVG", 0)) {
+    $supportedFileExtensions{'svg'} = 1;
+} elsif (isCygwin()) {
+    $supportedFileExtensions{'svg'} = 1;
+} else {
+    $ignoredLocalDirectories{'svg'} = 1;
+}
+
+if (!$testHTTP) {
+    $ignoredDirectories{'http'} = 1;
+    $ignoredDirectories{'websocket'} = 1;
+}
+
+if (!$testMedia) {
+    $ignoredDirectories{'media'} = 1;
+    $ignoredDirectories{'http/tests/media'} = 1;
+}
+
+my $supportedFeaturesResult = "";
+
+if (isCygwin()) {
+    # Collect supported features list
+    setPathForRunningWebKitApp(\%ENV);
+    my $supportedFeaturesCommand = $dumpTool . " --print-supported-features 2>&1";
+    $supportedFeaturesResult = `$supportedFeaturesCommand 2>&1`;
+}
+
+my $hasAcceleratedCompositing = 0;
+my $has3DRendering = 0;
+
+if (isCygwin()) {
+    $hasAcceleratedCompositing = $supportedFeaturesResult =~ /AcceleratedCompositing/;
+    $has3DRendering = $supportedFeaturesResult =~ /3DRendering/;
+} else {
+    $hasAcceleratedCompositing = checkWebCoreFeatureSupport("Accelerated Compositing", 0);
+    $has3DRendering = checkWebCoreFeatureSupport("3D Rendering", 0);
+}
+
+if (!$hasAcceleratedCompositing) {
+    $ignoredDirectories{'compositing'} = 1;
+}
+
+if (!$has3DRendering) {
+    $ignoredDirectories{'animations/3d'} = 1;
+    $ignoredDirectories{'transforms/3d'} = 1;
+}
+
+if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
+    $ignoredDirectories{'fast/canvas/webgl'} = 1;
+}
+
+if (checkWebCoreFeatureSupport("WML", 0)) {
+    $supportedFileExtensions{'wml'} = 1;
+} else {
+    $ignoredDirectories{'http/tests/wml'} = 1;
+    $ignoredDirectories{'fast/wml'} = 1;
+    $ignoredDirectories{'wml'} = 1;
+}
+
+if (!checkWebCoreFeatureSupport("XHTMLMP", 0)) {
+    $ignoredDirectories{'fast/xhtmlmp'} = 1;
+}
+
+processIgnoreTests($ignoreTests, "ignore-tests") if $ignoreTests;
+if (!$ignoreSkipped) {
+    if (!$skippedOnly || @ARGV == 0) {
+        readSkippedFiles("");
+    } else {
+        # Since readSkippedFiles() appends to @ARGV, we must use a foreach
+        # loop so that we only iterate over the original argument list.
+        foreach my $argnum (0 .. $#ARGV) {
+            readSkippedFiles(shift @ARGV);
+        }
+    }
+}
+
+my @tests = findTestsToRun();
+
+die "no tests to run\n" if !@tests;
+
+my %counts;
+my %tests;
+my %imagesPresent;
+my %imageDifferences;
+my %durations;
+my $count = 0;
+my $leaksOutputFileNumber = 1;
+my $totalLeaks = 0;
+
+my @toolArgs = ();
+push @toolArgs, "--pixel-tests" if $pixelTests;
+push @toolArgs, "--threaded" if $threaded;
+push @toolArgs, "--complex-text" if $complexText;
+push @toolArgs, "-";
+
+my @diffToolArgs = ();
+push @diffToolArgs, "--tolerance", $tolerance;
+
+$| = 1;
+
+my $dumpToolPID;
+my $isDumpToolOpen = 0;
+my $dumpToolCrashed = 0;
+my $imageDiffToolPID;
+my $isDiffToolOpen = 0;
+
+my $atLineStart = 1;
+my $lastDirectory = "";
+
+my $isHttpdOpen = 0;
+my $isWebSocketServerOpen = 0;
+my $webSocketServerPID = 0;
+my $failedToStartWebSocketServer = 0;
+# wss is disabled until all platforms support pyOpenSSL.
+# my $webSocketSecureServerPID = 0;
+
+sub catch_pipe { $dumpToolCrashed = 1; }
+$SIG{"PIPE"} = "catch_pipe";
+
+print "Testing ", scalar @tests, " test cases";
+print " $iterations times" if ($iterations > 1);
+print ", repeating each test $repeatEach times" if ($repeatEach > 1);
+print ".\n";
+
+my $overallStartTime = time;
+
+my %expectedResultPaths;
+
+my @originalTests = @tests;
+# Add individual test repetitions
+if ($repeatEach > 1) {
+    @tests = ();
+    foreach my $test (@originalTests) {
+        for (my $i = 0; $i < $repeatEach; $i++) {
+            push(@tests, $test);
+        }
+    }
+}
+# Add test set repetitions
+for (my $i = 1; $i < $iterations; $i++) {
+    push(@tests, @originalTests);
+}
+
+for my $test (@tests) {
+    my $newDumpTool = not $isDumpToolOpen;
+    openDumpTool();
+
+    my $base = stripExtension($test);
+    my $expectedExtension = ".txt";
+    
+    my $dir = $base;
+    $dir =~ s|/[^/]+$||;
+
+    if ($newDumpTool || $dir ne $lastDirectory) {
+        foreach my $logue (epiloguesAndPrologues($newDumpTool ? "" : $lastDirectory, $dir)) {
+            if (isCygwin()) {
+                $logue = toWindowsPath($logue);
+            } else {
+                $logue = canonpath($logue);
+            }
+            if ($verbose) {
+                print "running epilogue or prologue $logue\n";
+            }
+            print OUT "$logue\n";
+            # Throw away output from DumpRenderTree.
+            # Once for the test output and once for pixel results (empty)
+            while (<IN>) {
+                last if /#EOF/;
+            }
+            while (<IN>) {
+                last if /#EOF/;
+            }
+        }
+    }
+
+    if ($verbose) {
+        print "running $test -> ";
+        $atLineStart = 0;
+    } elsif (!$quiet) {
+        if ($dir ne $lastDirectory) {
+            print "\n" unless $atLineStart;
+            print "$dir ";
+        }
+        print ".";
+        $atLineStart = 0;
+    }
+
+    $lastDirectory = $dir;
+
+    my $result;
+
+    my $startTime = time if $report10Slowest;
+
+    # Try to read expected hash file for pixel tests
+    my $suffixExpectedHash = "";
+    if ($pixelTests && !$resetResults) {
+        my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+        if (open EXPECTEDHASH, "$expectedPixelDir/$base-$expectedTag.checksum") {
+            my $expectedHash = <EXPECTEDHASH>;
+            chomp($expectedHash);
+            close EXPECTEDHASH;
+            
+            # Format expected hash into a suffix string that is appended to the path / URL passed to DRT
+            $suffixExpectedHash = "'$expectedHash";
+        }
+    }
+
+    if ($test =~ /^http\//) {
+        configureAndOpenHTTPDIfNeeded();
+        if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
+            my $path = canonpath($test);
+            $path =~ s/^http\/tests\///;
+            print OUT "http://127.0.0.1:$httpdPort/$path$suffixExpectedHash\n";
+        } elsif ($test =~ /^http\/tests\/ssl\//) {
+            my $path = canonpath($test);
+            $path =~ s/^http\/tests\///;
+            print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixExpectedHash\n";
+        } else {
+            my $testPath = "$testDirectory/$test";
+            if (isCygwin()) {
+                $testPath = toWindowsPath($testPath);
+            } else {
+                $testPath = canonpath($testPath);
+            }
+            print OUT "$testPath$suffixExpectedHash\n";
+        }
+    } elsif ($test =~ /^websocket\//) {
+        if ($test =~ /^websocket\/tests\/local\//) {
+            my $testPath = "$testDirectory/$test";
+            if (isCygwin()) {
+                $testPath = toWindowsPath($testPath);
+            } else {
+                $testPath = canonpath($testPath);
+            }
+            print OUT "$testPath\n";
+        } else {
+            if (openWebSocketServerIfNeeded()) {
+                my $path = canonpath($test);
+                if ($test =~ /^websocket\/tests\/ssl\//) {
+                    # wss is disabled until all platforms support pyOpenSSL.
+                    print STDERR "Error: wss is disabled until all platforms support pyOpenSSL.";
+                    # print OUT "https://127.0.0.1:$webSocketSecurePort/$path\n";
+                } else {
+                    print OUT "http://127.0.0.1:$webSocketPort/$path\n";
+                }
+            } else {
+                # We failed to launch the WebSocket server.  Display a useful error message rather than attempting
+                # to run tests that expect the server to be available.
+                my $errorMessagePath = "$testDirectory/websocket/resources/server-failed-to-start.html";
+                $errorMessagePath = isCygwin() ? toWindowsPath($errorMessagePath) : canonpath($errorMessagePath);
+                print OUT "$errorMessagePath\n";
+            }
+        }
+    } else {
+        my $testPath = "$testDirectory/$test";
+        if (isCygwin()) {
+            $testPath = toWindowsPath($testPath);
+        } else {
+            $testPath = canonpath($testPath);
+        }
+        print OUT "$testPath$suffixExpectedHash\n" if defined $testPath;
+    }
+
+    # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
+    # Each block is terminated by a #EOF on a line by itself.
+    # The first block is the output of the test (in text, RenderTree or other formats).
+    # The second block is for optional pixel data in PNG format, and may be empty if
+    # pixel tests are not being run, or the test does not dump pixels (e.g. text tests).
+    my $readResults = readFromDumpToolWithTimer(IN, ERROR);
+
+    my $actual = $readResults->{output};
+    my $error = $readResults->{error};
+
+    $expectedExtension = $readResults->{extension};
+    my $expectedFileName = "$base-$expectedTag.$expectedExtension";
+
+    my $isText = isTextOnlyTest($actual);
+
+    my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension);
+    $expectedResultPaths{$base} = "$expectedDir/$expectedFileName";
+
+    unless ($readResults->{status} eq "success") {
+        my $crashed = $readResults->{status} eq "crashed";
+        testCrashedOrTimedOut($test, $base, $crashed, $actual, $error);
+        countFinishedTest($test, $base, $crashed ? "crash" : "timedout", 0);
+        last if stopRunningTestsEarlyIfNeeded();
+        next;
+    }
+
+    $durations{$test} = time - $startTime if $report10Slowest;
+
+    my $expected;
+
+    if (!$resetResults && open EXPECTED, "<", "$expectedDir/$expectedFileName") {
+        $expected = "";
+        while (<EXPECTED>) {
+            next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/;
+            $expected .= $_;
+        }
+        close EXPECTED;
+    }
+
+    if ($ignoreMetrics && !$isText && defined $expected) {
+        ($actual, $expected) = stripMetrics($actual, $expected);
+    }
+
+    if ($shouldCheckLeaks && $testsPerDumpTool == 1) {
+        print "        $test -> ";
+    }
+
+    my $actualPNG = "";
+    my $diffPNG = "";
+    my $diffPercentage = 0;
+    my $diffResult = "passed";
+
+    my $actualHash = "";
+    my $expectedHash = "";
+    my $actualPNGSize = 0;
+
+    while (<IN>) {
+        last if /#EOF/;
+        if (/ActualHash: ([a-f0-9]{32})/) {
+            $actualHash = $1;
+        } elsif (/ExpectedHash: ([a-f0-9]{32})/) {
+            $expectedHash = $1;
+        } elsif (/Content-Length: (\d+)\s*/) {
+            $actualPNGSize = $1;
+            read(IN, $actualPNG, $actualPNGSize);
+        }
+    }
+
+    if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) {
+        if ($actualHash eq "" && $expectedHash eq "") {
+            printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!");
+        } elsif ($actualHash eq "") {
+            printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!");
+        } elsif ($expectedHash eq "") {
+            printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!");
+        }
+    }
+
+    if ($actualPNGSize > 0) {
+        my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+
+        if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) {
+            if (-f "$expectedPixelDir/$base-$expectedTag.png") {
+                my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png";
+                my $expectedPNG = "";
+                open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png";
+                read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize);
+
+                openDiffTool();
+                print DIFFOUT "Content-Length: $actualPNGSize\n";
+                print DIFFOUT $actualPNG;
+
+                print DIFFOUT "Content-Length: $expectedPNGSize\n";
+                print DIFFOUT $expectedPNG;
+
+                while (<DIFFIN>) {
+                    last if /^error/ || /^diff:/;
+                    if (/Content-Length: (\d+)\s*/) {
+                        read(DIFFIN, $diffPNG, $1);
+                    }
+                }
+
+                if (/^diff: (.+)% (passed|failed)/) {
+                    $diffPercentage = $1 + 0;
+                    $imageDifferences{$base} = $diffPercentage;
+                    $diffResult = $2;
+                }
+                
+                if (!$diffPercentage) {
+                    printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)");
+                }
+            } elsif ($verbose) {
+                printFailureMessageForTest($test, "WARNING: expected image is missing!");
+            }
+        }
+
+        if ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png") {
+            mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir;
+            writeToFile("$expectedPixelDir/$base-$expectedTag.png", $actualPNG);
+        }
+
+        if ($actualHash ne "" && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.checksum")) {
+            writeToFile("$expectedPixelDir/$base-$expectedTag.checksum", $actualHash);
+        }
+    }
+
+    if (dumpToolDidCrash()) {
+        $result = "crash";
+        testCrashedOrTimedOut($test, $base, 1, $actual, $error);
+    } elsif (!defined $expected) {
+        if ($verbose) {
+            print "new " . ($resetResults ? "result" : "test") ."\n";
+            $atLineStart = 1;
+        }
+        $result = "new";
+
+        if ($generateNewResults || $resetResults) {
+            mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir;
+            writeToFile("$expectedDir/$expectedFileName", $actual);
+        }
+        deleteExpectedAndActualResults($base);
+        recordActualResultsAndDiff($base, $actual);
+        if (!$resetResults) {
+            # Always print the file name for new tests, as they will probably need some manual inspection.
+            # in verbose mode we already printed the test case, so no need to do it again.
+            unless ($verbose) {
+                print "\n" unless $atLineStart;
+                print "$test -> ";
+            }
+            my $resultsDir = catdir($expectedDir, dirname($base));
+            if ($generateNewResults) {
+                print "new (results generated in $resultsDir)\n";
+            } else {
+                print "new\n";
+            }
+            $atLineStart = 1;
+        }
+    } elsif ($actual eq $expected && $diffResult eq "passed") {
+        if ($verbose) {
+            print "succeeded\n";
+            $atLineStart = 1;
+        }
+        $result = "match";
+        deleteExpectedAndActualResults($base);
+    } else {
+        $result = "mismatch";
+
+        my $pixelTestFailed = $pixelTests && $diffPNG && $diffPNG ne "";
+        my $testFailed = $actual ne $expected;
+
+        my $message = !$testFailed ? "pixel test failed" : "failed";
+
+        if (($testFailed || $pixelTestFailed) && $addPlatformExceptions) {
+            my $testBase = catfile($testDirectory, $base);
+            my $expectedBase = catfile($expectedDir, $base);
+            my $testIsMaximallyPlatformSpecific = $testBase =~ m|^\Q$platformTestDirectory\E/|;
+            my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|;
+            if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) {
+                mkpath catfile($platformTestDirectory, dirname($base));
+                if ($testFailed) {
+                    my $expectedFile = catfile($platformTestDirectory, "$expectedFileName");
+                    writeToFile("$expectedFile", $actual);
+                }
+                if ($pixelTestFailed) {
+                    my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.checksum");
+                    writeToFile("$expectedFile", $actualHash);
+
+                    $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.png");
+                    writeToFile("$expectedFile", $actualPNG);
+                }
+                $message .= " (results generated in $platformTestDirectory)";
+            }
+        }
+
+        printFailureMessageForTest($test, $message);
+
+        my $dir = "$testResultsDirectory/$base";
+        $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
+        my $testName = $1;
+        mkpath $dir;
+
+        deleteExpectedAndActualResults($base);
+        recordActualResultsAndDiff($base, $actual);
+
+        if ($pixelTestFailed) {
+            $imagesPresent{$base} = 1;
+
+            writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG);
+            writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG);
+
+            my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+            copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png");
+
+            open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die;
+            print DIFFHTML "<html>\n";
+            print DIFFHTML "<head>\n";
+            print DIFFHTML "<title>$base Image Compare</title>\n";
+            print DIFFHTML "<script language=\"Javascript\" type=\"text/javascript\">\n";
+            print DIFFHTML "var currentImage = 0;\n";
+            print DIFFHTML "var imageNames = new Array(\"Actual\", \"Expected\");\n";
+            print DIFFHTML "var imagePaths = new Array(\"$testName-$actualTag.png\", \"$testName-$expectedTag.png\");\n";
+            if (-f "$testDirectory/$base-w3c.png") {
+                copy("$testDirectory/$base-w3c.png", "$testResultsDirectory/$base-w3c.png");
+                print DIFFHTML "imageNames.push(\"W3C\");\n";
+                print DIFFHTML "imagePaths.push(\"$testName-w3c.png\");\n";
+            }
+            print DIFFHTML "function animateImage() {\n";
+            print DIFFHTML "    var image = document.getElementById(\"animatedImage\");\n";
+            print DIFFHTML "    var imageText = document.getElementById(\"imageText\");\n";
+            print DIFFHTML "    image.src = imagePaths[currentImage];\n";
+            print DIFFHTML "    imageText.innerHTML = imageNames[currentImage] + \" Image\";\n";
+            print DIFFHTML "    currentImage = (currentImage + 1) % imageNames.length;\n";
+            print DIFFHTML "    setTimeout('animateImage()',2000);\n";
+            print DIFFHTML "}\n";
+            print DIFFHTML "</script>\n";
+            print DIFFHTML "</head>\n";
+            print DIFFHTML "<body onLoad=\"animateImage();\">\n";
+            print DIFFHTML "<table>\n";
+            if ($diffPercentage) {
+                print DIFFHTML "<tr>\n";
+                print DIFFHTML "<td>Difference between images: <a href=\"$testName-$diffsTag.png\">$diffPercentage%</a></td>\n";
+                print DIFFHTML "</tr>\n";
+            }
+            print DIFFHTML "<tr>\n";
+            print DIFFHTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">test file</a></td>\n";
+            print DIFFHTML "</tr>\n";
+            print DIFFHTML "<tr>\n";
+            print DIFFHTML "<td id=\"imageText\" style=\"text-weight: bold;\">Actual Image</td>\n";
+            print DIFFHTML "</tr>\n";
+            print DIFFHTML "<tr>\n";
+            print DIFFHTML "<td><img src=\"$testName-$actualTag.png\" id=\"animatedImage\"></td>\n";
+            print DIFFHTML "</tr>\n";
+            print DIFFHTML "</table>\n";
+            print DIFFHTML "</body>\n";
+            print DIFFHTML "</html>\n";
+        }
+    }
+
+    if ($error) {
+        my $dir = "$testResultsDirectory/$base";
+        $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
+        mkpath $dir;
+        
+        writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
+        
+        $counts{error}++;
+        push @{$tests{error}}, $test;
+    }
+
+    countFinishedTest($test, $base, $result, $isText);
+    last if stopRunningTestsEarlyIfNeeded();
+}
+
+my $totalTestingTime = time - $overallStartTime;
+my $waitTime = getWaitTime();
+if ($waitTime > 0.1) {
+    my $normalizedTestingTime = $totalTestingTime - $waitTime;
+    printf "\n%0.2fs HTTPD waiting time\n", $waitTime . "";
+    printf "%0.2fs normalized testing time", $normalizedTestingTime . "";
+}
+printf "\n%0.2fs total testing time\n", $totalTestingTime . "";
+
+!$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
+
+$isHttpdOpen = !closeHTTPD();
+closeWebSocketServer();
+
+# Because multiple instances of this script are running concurrently we cannot 
+# safely delete this symlink.
+# system "rm /tmp/LayoutTests";
+
+# FIXME: Do we really want to check the image-comparison tool for leaks every time?
+if ($isDiffToolOpen && $shouldCheckLeaks) {
+    $totalLeaks += countAndPrintLeaks("ImageDiff", $imageDiffToolPID, "$testResultsDirectory/ImageDiff-leaks.txt");
+}
+
+if ($totalLeaks) {
+    if ($mergeDepth) {
+        parseLeaksandPrintUniqueLeaks();
+    } else { 
+        print "\nWARNING: $totalLeaks total leaks found!\n";
+        print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
+    }
+}
+
+close IN;
+close OUT;
+close ERROR;
+
+if ($report10Slowest) {
+    print "\n\nThe 10 slowest tests:\n\n";
+    my $count = 0;
+    for my $test (sort slowestcmp keys %durations) {
+        printf "%0.2f secs: %s\n", $durations{$test}, $test;
+        last if ++$count == 10;
+    }
+}
+
+print "\n";
+
+if ($skippedOnly && $counts{"match"}) {
+    print "The following tests are in the Skipped file (" . File::Spec->abs2rel("$platformTestDirectory/Skipped", $testDirectory) . "), but succeeded:\n";
+    foreach my $test (@{$tests{"match"}}) {
+        print "  $test\n";
+    }
+}
+
+if ($resetResults || ($counts{match} && $counts{match} == $count)) {
+    print "all $count test cases succeeded\n";
+    unlink $testResults;
+    exit;
+}
+
+printResults();
+
+mkpath $testResultsDirectory;
+
+open HTML, ">", $testResults or die "Failed to open $testResults. $!";
+print HTML "<html>\n";
+print HTML "<head>\n";
+print HTML "<title>Layout Test Results</title>\n";
+print HTML "</head>\n";
+print HTML "<body>\n";
+
+if ($ignoreMetrics) {
+    print HTML "<h4>Tested with metrics ignored.</h4>";
+}
+
+print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest);
+print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest);
+
+print HTML "</body>\n";
+print HTML "</html>\n";
+close HTML;
+
+my @configurationArgs = argumentsForConfiguration();
+
+if (isGtk()) {
+  system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
+} elsif (isQt()) {
+  unshift @configurationArgs, qw(-graphicssystem raster -style windows);
+  if (isCygwin()) {
+    $testResults = "/" . toWindowsPath($testResults);
+    $testResults =~ s/\\/\//g;
+  }
+  system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
+} elsif (isCygwin()) {
+  system "cygstart", $testResults if $launchSafari;
+} else {
+  system "WebKitTools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari;
+}
+
+closeCygpaths() if isCygwin();
+
+exit 1;
+
+sub countAndPrintLeaks($$$)
+{
+    my ($dumpToolName, $dumpToolPID, $leaksFilePath) = @_;
+
+    print "\n" unless $atLineStart;
+    $atLineStart = 1;
+
+    # We are excluding the following reported leaks so they don't get in our way when looking for WebKit leaks:
+    # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
+    # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
+    # fixed, it will be listed here until the bot has been updated with the newer frameworks.
+
+    my @typesToExclude = (
+    );
+
+    my @callStacksToExclude = (
+        "Flash_EnforceLocalSecurity" # leaks in Flash plug-in code, rdar://problem/4449747
+    );
+
+    if (isTiger()) {
+        # Leak list for the version of Tiger used on the build bot.
+        push @callStacksToExclude, (
+            "CFRunLoopRunSpecific \\| malloc_zone_malloc", "CFRunLoopRunSpecific \\| CFAllocatorAllocate ", # leak in CFRunLoopRunSpecific, rdar://problem/4670839
+            "CGImageSourceGetPropertiesAtIndex", # leak in ImageIO, rdar://problem/4628809
+            "FOGetCoveredUnicodeChars", # leak in ATS, rdar://problem/3943604
+            "GetLineDirectionPreference", "InitUnicodeUtilities", # leaks tool falsely reporting leak in CFNotificationCenterAddObserver, rdar://problem/4964790
+            "ICCFPrefWrapper::GetPrefDictionary", # leaks in Internet Config. code, rdar://problem/4449794
+            "NSHTTPURLProtocol setResponseHeader:", # leak in multipart/mixed-replace handling in Foundation, no Radar, but fixed in Leopard
+            "NSURLCache cachedResponseForRequest", # leak in CFURL cache, rdar://problem/4768430
+            "PCFragPrepareClosureFromFile", # leak in Code Fragment Manager, rdar://problem/3426998
+            "WebCore::Selection::toRange", # bug in 'leaks', rdar://problem/4967949
+            "WebCore::SubresourceLoader::create", # bug in 'leaks', rdar://problem/4985806
+            "_CFPreferencesDomainDeepCopyDictionary", # leak in CFPreferences, rdar://problem/4220786
+            "_objc_msgForward", # leak in NSSpellChecker, rdar://problem/4965278
+            "gldGetString", # leak in OpenGL, rdar://problem/5013699
+            "_setDefaultUserInfoFromURL", # leak in NSHTTPAuthenticator, rdar://problem/5546453 
+            "SSLHandshake", # leak in SSL, rdar://problem/5546440 
+            "SecCertificateCreateFromData", # leak in SSL code, rdar://problem/4464397
+        );
+        push @typesToExclude, (
+            "THRD", # bug in 'leaks', rdar://problem/3387783
+            "DRHT", # ditto (endian little hate i)
+        );
+    }
+
+    if (isLeopard()) {
+        # Leak list for the version of Leopard used on the build bot.
+        push @callStacksToExclude, (
+            "CFHTTPMessageAppendBytes", # leak in CFNetwork, rdar://problem/5435912
+            "sendDidReceiveDataCallback", # leak in CFNetwork, rdar://problem/5441619
+            "_CFHTTPReadStreamReadMark", # leak in CFNetwork, rdar://problem/5441468
+            "httpProtocolStart", # leak in CFNetwork, rdar://problem/5468837
+            "_CFURLConnectionSendCallbacks", # leak in CFNetwork, rdar://problem/5441600
+            "DispatchQTMsg", # leak in QuickTime, PPC only, rdar://problem/5667132
+            "QTMovieContentView createVisualContext", # leak in QuickTime, PPC only, rdar://problem/5667132
+            "_CopyArchitecturesForJVMVersion", # leak in Java, rdar://problem/5910823
+        );
+    }
+
+    if (isSnowLeopard()) {
+        push @callStacksToExclude, (
+            "readMakerNoteProps", # <rdar://problem/7156432> leak in ImageIO
+            "QTKitMovieControllerView completeUISetup", # <rdar://problem/7155156> leak in QTKit
+            "getVMInitArgs", # <rdar://problem/7714444> leak in Java
+            "Java_java_lang_System_initProperties", # <rdar://problem/7714465> leak in Java
+        );
+    }
+
+    if (isDarwin() && !isTiger() && !isLeopard() && !isSnowLeopard()) {
+        push @callStacksToExclude, (
+            "CGGradientCreateWithColorComponents", # leak in CoreGraphics, <rdar://problem/7888492>
+        );
+    }
+
+    my $leaksTool = sourceDir() . "/WebKitTools/Scripts/run-leaks";
+    my $excludeString = "--exclude-callstack '" . (join "' --exclude-callstack '", @callStacksToExclude) . "'";
+    $excludeString .= " --exclude-type '" . (join "' --exclude-type '", @typesToExclude) . "'" if @typesToExclude;
+
+    print " ? checking for leaks in $dumpToolName\n";
+    my $leaksOutput = `$leaksTool $excludeString $dumpToolPID`;
+    my ($count, $bytes) = $leaksOutput =~ /Process $dumpToolPID: (\d+) leaks? for (\d+) total/;
+    my ($excluded) = $leaksOutput =~ /(\d+) leaks? excluded/;
+
+    my $adjustedCount = $count;
+    $adjustedCount -= $excluded if $excluded;
+
+    if (!$adjustedCount) {
+        print " - no leaks found\n";
+        unlink $leaksFilePath;
+        return 0;
+    } else {
+        my $dir = $leaksFilePath;
+        $dir =~ s|/[^/]+$|| or die;
+        mkpath $dir;
+
+        if ($excluded) {
+            print " + $adjustedCount leaks ($bytes bytes including $excluded excluded leaks) were found, details in $leaksFilePath\n";
+        } else {
+            print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n";
+        }
+
+        writeToFile($leaksFilePath, $leaksOutput);
+        
+        push @leaksFilenames, $leaksFilePath;
+    }
+
+    return $adjustedCount;
+}
+
+sub writeToFile($$)
+{
+    my ($filePath, $contents) = @_;
+    open NEWFILE, ">", "$filePath" or die "Could not create $filePath. $!\n";
+    print NEWFILE $contents;
+    close NEWFILE;
+}
+
+# Break up a path into the directory (with slash) and base name.
+sub splitpath($)
+{
+    my ($path) = @_;
+
+    my $pathSeparator = "/";
+    my $dirname = dirname($path) . $pathSeparator;
+    $dirname = "" if $dirname eq "." . $pathSeparator;
+
+    return ($dirname, basename($path));
+}
+
+# Sort first by directory, then by file, so all paths in one directory are grouped
+# rather than being interspersed with items from subdirectories.
+# Use numericcmp to sort directory and filenames to make order logical.
+sub pathcmp($$)
+{
+    my ($patha, $pathb) = @_;
+
+    my ($dira, $namea) = splitpath($patha);
+    my ($dirb, $nameb) = splitpath($pathb);
+
+    return numericcmp($dira, $dirb) if $dira ne $dirb;
+    return numericcmp($namea, $nameb);
+}
+
+# Sort numeric parts of strings as numbers, other parts as strings.
+# Makes 1.33 come after 1.3, which is cool.
+sub numericcmp($$)
+{
+    my ($aa, $bb) = @_;
+
+    my @a = split /(\d+)/, $aa;
+    my @b = split /(\d+)/, $bb;
+
+    # Compare one chunk at a time.
+    # Each chunk is either all numeric digits, or all not numeric digits.
+    while (@a && @b) {
+        my $a = shift @a;
+        my $b = shift @b;
+        
+        # Use numeric comparison if chunks are non-equal numbers.
+        return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
+
+        # Use string comparison if chunks are any other kind of non-equal string.
+        return $a cmp $b if $a ne $b;
+    }
+    
+    # One of the two is now empty; compare lengths for result in this case.
+    return @a <=> @b;
+}
+
+# Sort slowest tests first.
+sub slowestcmp($$)
+{
+    my ($testa, $testb) = @_;
+
+    my $dura = $durations{$testa};
+    my $durb = $durations{$testb};
+    return $durb <=> $dura if $dura != $durb;
+    return pathcmp($testa, $testb);
+}
+
+sub launchWithEnv(\@\%)
+{
+    my ($args, $env) = @_;
+
+    # Dump the current environment as perl code and then put it in quotes so it is one parameter.
+    my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]);
+    $environmentDumper->Indent(0);
+    $environmentDumper->Purity(1);
+    my $allEnvVars = $environmentDumper->Dump();
+    unshift @{$args}, "\"$allEnvVars\"";
+
+    my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv));
+    unshift @{$args}, $execScript;
+    return @{$args};
+}
+
+sub resolveAndMakeTestResultsDirectory()
+{
+    my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
+    mkpath $absTestResultsDirectory;
+    return $absTestResultsDirectory;
+}
+
+sub openDiffTool()
+{
+    return if $isDiffToolOpen;
+    return if !$pixelTests;
+
+    my %CLEAN_ENV;
+    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
+    $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n";
+    $isDiffToolOpen = 1;
+}
+
+sub openDumpTool()
+{
+    return if $isDumpToolOpen;
+
+    my %CLEAN_ENV;
+
+    # Generic environment variables
+    if (defined $ENV{'WEBKIT_TESTFONTS'}) {
+        $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'};
+    }
+
+    # unique temporary directory for each DumpRendertree - needed for running more DumpRenderTree in parallel
+    $CLEAN_ENV{DUMPRENDERTREE_TEMP} = File::Temp::tempdir('DumpRenderTree-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+    $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
+
+    # Platform spesifics
+    if (isLinux()) {
+        if (defined $ENV{'DISPLAY'}) {
+            $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'};
+        } else {
+            $CLEAN_ENV{DISPLAY} = ":1";
+        }
+        if (defined $ENV{'XAUTHORITY'}) {
+            $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'};
+        }
+
+        $CLEAN_ENV{HOME} = $ENV{'HOME'};
+
+        if (defined $ENV{'LD_LIBRARY_PATH'}) {
+            $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'};
+        }
+        if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) {
+            $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
+        }
+    } elsif (isDarwin()) {
+        if (defined $ENV{'DYLD_LIBRARY_PATH'}) {
+            $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'};
+        }
+
+        $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+        $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
+    } elsif (isCygwin()) {
+        $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
+        $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
+
+        setPathForRunningWebKitApp(\%CLEAN_ENV);
+    }
+
+    # Port spesifics
+    if (isQt()) {
+        $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins";
+    }
+    
+    my @args = ($dumpTool, @toolArgs);
+    if (isAppleMacWebKit() and !isTiger()) { 
+        unshift @args, "arch", "-" . architecture();             
+    }
+
+    if ($useValgrind) {
+        unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors";
+    } 
+
+    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
+
+    $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n";
+    $isDumpToolOpen = 1;
+    $dumpToolCrashed = 0;
+}
+
+sub closeDumpTool()
+{
+    return if !$isDumpToolOpen;
+
+    close IN;
+    close OUT;
+    waitpid $dumpToolPID, 0;
+    
+    # check for WebCore counter leaks.
+    if ($shouldCheckLeaks) {
+        while (<ERROR>) {
+            print;
+        }
+    }
+    close ERROR;
+    $isDumpToolOpen = 0;
+}
+
+sub dumpToolDidCrash()
+{
+    return 1 if $dumpToolCrashed;
+    return 0 unless $isDumpToolOpen;
+    my $pid = waitpid(-1, WNOHANG);
+    return 1 if ($pid == $dumpToolPID);
+
+    # On Mac OS X, crashing may be significantly delayed by crash reporter.
+    return 0 unless isAppleMacWebKit();
+
+    return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
+}
+
+sub configureAndOpenHTTPDIfNeeded()
+{
+    return if $isHttpdOpen;
+    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+    my $listen = "127.0.0.1:$httpdPort";
+    my @args = (
+        "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
+        "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
+        "-C", "Listen $listen"
+    );
+
+    my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
+    @args = (@defaultArgs, @args);
+
+    waitForHTTPDLock() if $shouldWaitForHTTPD;
+    $isHttpdOpen = openHTTPD(@args);
+}
+
+sub openWebSocketServerIfNeeded()
+{
+    return 1 if $isWebSocketServerOpen;
+    return 0 if $failedToStartWebSocketServer;
+
+    my $webSocketServerPath = "/usr/bin/python";
+    my $webSocketPythonPath = "WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket";
+    my $webSocketHandlerDir = "$testDirectory";
+    my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
+    my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt";
+    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
+    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+    my $logFile = "$absTestResultsDirectory/pywebsocket_log.txt";
+
+    my @args = (
+        "WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py",
+        "--server-host", "127.0.0.1",
+        "--port", "$webSocketPort",
+        "--document-root", "$webSocketHandlerDir",
+        "--scan-dir", "$webSocketHandlerScanDir",
+        "--websock-handlers-map-file", "$webSocketHandlerMapFile",
+        "--cgi-paths", "/websocket/tests",
+        "--log-file", "$logFile",
+        "--strict",
+    );
+    # wss is disabled until all platforms support pyOpenSSL.
+    # my @argsSecure = (
+    #     "WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py",
+    #     "-p", "$webSocketSecurePort",
+    #     "-d", "$webSocketHandlerDir",
+    #     "-t",
+    #     "-k", "$sslCertificate",
+    #     "-c", "$sslCertificate",
+    # );
+
+    $ENV{"PYTHONPATH"} = $webSocketPythonPath;
+    $webSocketServerPID = open3(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, \*WEBSOCKETSERVER_ERR, $webSocketServerPath, @args);
+    # wss is disabled until all platforms support pyOpenSSL.
+    # $webSocketSecureServerPID = open3(\*WEBSOCKETSECURESERVER_IN, \*WEBSOCKETSECURESERVER_OUT, \*WEBSOCKETSECURESERVER_ERR, $webSocketServerPath, @argsSecure);
+    # my @listen = ("http://127.0.0.1:$webSocketPort", "https://127.0.0.1:$webSocketSecurePort");
+    my @listen = ("http://127.0.0.1:$webSocketPort");
+    for (my $i = 0; $i < @listen; $i++) {
+        my $retryCount = 10;
+        while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen[$i]") && $retryCount) {
+            sleep 1;
+            --$retryCount;
+        }
+        unless ($retryCount) {
+            print STDERR "Timed out waiting for WebSocketServer to start.\n";
+            $failedToStartWebSocketServer = 1;
+            return 0;
+        }
+    }
+
+    $isWebSocketServerOpen = 1;
+    return 1;
+}
+
+sub closeWebSocketServer()
+{
+    return if !$isWebSocketServerOpen;
+
+    close WEBSOCKETSERVER_IN;
+    close WEBSOCKETSERVER_OUT;
+    close WEBSOCKETSERVER_ERR;
+    kill 15, $webSocketServerPID;
+
+    # wss is disabled until all platforms support pyOpenSSL.
+    # close WEBSOCKETSECURESERVER_IN;
+    # close WEBSOCKETSECURESERVER_OUT;
+    # close WEBSOCKETSECURESERVER_ERR;
+    # kill 15, $webSocketSecureServerPID;
+
+    $isWebSocketServerOpen = 0;
+}
+
+sub fileNameWithNumber($$)
+{
+    my ($base, $number) = @_;
+    return "$base$number" if ($number > 1);
+    return $base;
+}
+
+sub processIgnoreTests($$)
+{
+    my @ignoreList = split(/\s*,\s*/, shift);
+    my $listName = shift;
+
+    my $disabledSuffix = "-disabled";
+
+    my $addIgnoredDirectories = sub {
+        return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
+        $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)} = 1;
+        return @_;
+    };
+    foreach my $item (@ignoreList) {
+        my $path = catfile($testDirectory, $item); 
+        if (-d $path) {
+            $ignoredDirectories{$item} = 1;
+            find({ preprocess => $addIgnoredDirectories, wanted => sub {} }, $path);
+        }
+        elsif (-f $path) {
+            $ignoredFiles{$item} = 1;
+        } elsif (-f $path . $disabledSuffix) {
+            # The test is disabled, so do nothing.
+        } else {
+            print "$listName list contained '$item', but no file of that name could be found\n";
+        }
+    }
+}
+
+sub stripExtension($)
+{
+    my ($test) = @_;
+
+    $test =~ s/\.[a-zA-Z]+$//;
+    return $test;
+}
+
+sub isTextOnlyTest($)
+{
+    my ($actual) = @_;
+    my $isText;
+    if ($actual =~ /^layer at/ms) {
+        $isText = 0;
+    } else {
+        $isText = 1;
+    }
+    return $isText;
+}
+
+sub expectedDirectoryForTest($;$;$)
+{
+    my ($base, $isText, $expectedExtension) = @_;
+
+    my @directories = @platformResultHierarchy;
+    push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if isCygwin();
+    push @directories, $expectedDirectory;
+
+    # If we already have expected results, just return their location.
+    foreach my $directory (@directories) {
+        return $directory if (-f "$directory/$base-$expectedTag.$expectedExtension");
+    }
+
+    # For cross-platform tests, text-only results should go in the cross-platform directory,
+    # while render tree dumps should go in the least-specific platform directory.
+    return $isText ? $expectedDirectory : $platformResultHierarchy[$#platformResultHierarchy];
+}
+
+sub countFinishedTest($$$$)
+{
+    my ($test, $base, $result, $isText) = @_;
+
+    if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) {
+        if ($shouldCheckLeaks) {
+            my $fileName;
+            if ($testsPerDumpTool == 1) {
+                $fileName = "$testResultsDirectory/$base-leaks.txt";
+            } else {
+                $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt";
+            }
+            my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName);
+            $totalLeaks += $leakCount;
+            $leaksOutputFileNumber++ if ($leakCount);
+        }
+
+        closeDumpTool();
+    }
+    
+    $count++;
+    $counts{$result}++;
+    push @{$tests{$result}}, $test;
+}
+
+sub testCrashedOrTimedOut($$$$$)
+{
+    my ($test, $base, $didCrash, $actual, $error) = @_;
+
+    printFailureMessageForTest($test, $didCrash ? "crashed" : "timed out");
+
+    sampleDumpTool() unless $didCrash;
+
+    my $dir = "$testResultsDirectory/$base";
+    $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
+    mkpath $dir;
+
+    deleteExpectedAndActualResults($base);
+
+    if (defined($error) && length($error)) {
+        writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
+    }
+
+    recordActualResultsAndDiff($base, $actual);
+
+    kill 9, $dumpToolPID unless $didCrash;
+
+    closeDumpTool();
+}
+
+sub printFailureMessageForTest($$)
+{
+    my ($test, $description) = @_;
+
+    unless ($verbose) {
+        print "\n" unless $atLineStart;
+        print "$test -> ";
+    }
+    print "$description\n";
+    $atLineStart = 1;
+}
+
+my %cygpaths = ();
+
+sub openCygpathIfNeeded($)
+{
+    my ($options) = @_;
+
+    return unless isCygwin();
+    return $cygpaths{$options} if $cygpaths{$options} && $cygpaths{$options}->{"open"};
+
+    local (*CYGPATHIN, *CYGPATHOUT);
+    my $pid = open2(\*CYGPATHIN, \*CYGPATHOUT, "cygpath -f - $options");
+    my $cygpath =  {
+        "pid" => $pid,
+        "in" => *CYGPATHIN,
+        "out" => *CYGPATHOUT,
+        "open" => 1
+    };
+
+    $cygpaths{$options} = $cygpath;
+
+    return $cygpath;
+}
+
+sub closeCygpaths()
+{
+    return unless isCygwin();
+
+    foreach my $cygpath (values(%cygpaths)) {
+        close $cygpath->{"in"};
+        close $cygpath->{"out"};
+        waitpid($cygpath->{"pid"}, 0);
+        $cygpath->{"open"} = 0;
+
+    }
+}
+
+sub convertPathUsingCygpath($$)
+{
+    my ($path, $options) = @_;
+
+    # cygpath -f (at least in Cygwin 1.7) converts spaces into newlines. We remove spaces here and
+    # add them back in after conversion to work around this.
+    my $spaceSubstitute = "__NOTASPACE__";
+    $path =~ s/ /\Q$spaceSubstitute\E/g;
+
+    my $cygpath = openCygpathIfNeeded($options);
+    local *inFH = $cygpath->{"in"};
+    local *outFH = $cygpath->{"out"};
+    print outFH $path . "\n";
+    my $convertedPath = <inFH>;
+    chomp($convertedPath) if defined $convertedPath;
+
+    $convertedPath =~ s/\Q$spaceSubstitute\E/ /g;
+    return $convertedPath;
+}
+
+sub toWindowsPath($)
+{
+    my ($path) = @_;
+    return unless isCygwin();
+
+    return convertPathUsingCygpath($path, "-w");
+}
+
+sub toURL($)
+{
+    my ($path) = @_;
+
+    if ($useRemoteLinksToTests) {
+        my $relativePath = File::Spec->abs2rel($path, $testDirectory);
+
+        # If the file is below the test directory then convert it into a link to the file in SVN
+        if ($relativePath !~ /^\.\.\//) {
+            my $revision = svnRevisionForDirectory($testDirectory);
+            my $svnPath = pathRelativeToSVNRepositoryRootForPath($path);
+            return "http://trac.webkit.org/export/$revision/$svnPath";
+        }
+    }
+
+    return $path unless isCygwin();
+
+    return "file:///" . convertPathUsingCygpath($path, "-m");
+}
+
+sub validateSkippedArg($$;$)
+{
+    my ($option, $value, $value2) = @_;
+    my %validSkippedValues = map { $_ => 1 } qw(default ignore only);
+    $value = lc($value);
+    die "Invalid argument '" . $value . "' for option $option" unless $validSkippedValues{$value};
+    $treatSkipped = $value;
+}
+
+sub htmlForResultsSection(\@$&)
+{
+    my ($tests, $description, $linkGetter) = @_;
+
+    my @html = ();
+    return join("\n", @html) unless @{$tests};
+
+    push @html, "<p>$description:</p>";
+    push @html, "<table>";
+    foreach my $test (@{$tests}) {
+        push @html, "<tr>";
+        push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
+        foreach my $link (@{&{$linkGetter}($test)}) {
+            push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>";
+        }
+        push @html, "</tr>";
+    }
+    push @html, "</table>";
+
+    return join("\n", @html);
+}
+
+sub linksForExpectedAndActualResults($)
+{
+    my ($base) = @_;
+
+    my @links = ();
+
+    return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt";
+    
+    my $expectedResultPath = $expectedResultPaths{$base};
+    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+
+    push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" };
+    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" };
+    push @links, { href => "$base-$diffsTag.txt", text => "diff" };
+    push @links, { href => "$base-$prettyDiffTag.html", text => "pretty diff" };
+
+    return \@links;
+}
+
+sub linksForMismatchTest
+{
+    my ($test) = @_;
+
+    my @links = ();
+
+    my $base = stripExtension($test);
+
+    push @links, @{linksForExpectedAndActualResults($base)};
+    return \@links unless $pixelTests && $imagesPresent{$base};
+
+    push @links, { href => "$base-$expectedTag.png", text => "expected image" };
+    push @links, { href => "$base-$diffsTag.html", text => "image diffs" };
+    push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" };
+
+    return \@links;
+}
+
+sub linksForErrorTest
+{
+    my ($test) = @_;
+
+    my @links = ();
+
+    my $base = stripExtension($test);
+
+    push @links, @{linksForExpectedAndActualResults($base)};
+    push @links, { href => "$base-$errorTag.txt", text => "stderr" };
+
+    return \@links;
+}
+
+sub linksForNewTest
+{
+    my ($test) = @_;
+
+    my @links = ();
+
+    my $base = stripExtension($test);
+
+    my $expectedResultPath = $expectedResultPaths{$base};
+    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+
+    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
+    if ($pixelTests && $imagesPresent{$base}) {
+        push @links, { href => "$base-$expectedTag.png", text => "image" };
+    }
+
+    return \@links;
+}
+
+sub deleteExpectedAndActualResults($)
+{
+    my ($base) = @_;
+
+    unlink "$testResultsDirectory/$base-$actualTag.txt";
+    unlink "$testResultsDirectory/$base-$diffsTag.txt";
+    unlink "$testResultsDirectory/$base-$errorTag.txt";
+}
+
+sub recordActualResultsAndDiff($$)
+{
+    my ($base, $actualResults) = @_;
+
+    return unless defined($actualResults) && length($actualResults);
+
+    my $expectedResultPath = $expectedResultPaths{$base};
+    my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+    my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension";
+    my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension";
+
+    mkpath(dirname($actualResultsPath));
+    writeToFile("$actualResultsPath", $actualResults);
+
+    if (-f $expectedResultPath) {
+        copy("$expectedResultPath", "$copiedExpectedResultsPath");
+    } else {
+        open EMPTY, ">$copiedExpectedResultsPath";
+        close EMPTY;
+    }
+
+    my $diffOuputBasePath = "$testResultsDirectory/$base";
+    my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
+    system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\"";
+
+    my $prettyDiffOutputPath = "$diffOuputBasePath-$prettyDiffTag.html";
+    my $prettyPatchPath = "BugsSite/PrettyPatch/";
+    my $prettifyPath = "$prettyPatchPath/prettify.rb";
+    system "ruby -I \"$prettyPatchPath\" \"$prettifyPath\" \"$diffOutputPath\" > \"$prettyDiffOutputPath\"";
+}
+
+sub buildPlatformResultHierarchy()
+{
+    mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory");
+
+    my @platforms;
+    if ($platform =~ /^mac-/) {
+        my $i;
+        for ($i = 0; $i < @macPlatforms; $i++) {
+            last if $macPlatforms[$i] eq $platform;
+        }
+        for (; $i < @macPlatforms; $i++) {
+            push @platforms, $macPlatforms[$i];
+        }
+    } elsif ($platform =~ /^qt-/) {
+        push @platforms, $platform;
+        push @platforms, "qt";
+    } else {
+        @platforms = $platform;
+    }
+
+    my @hierarchy;
+    for (my $i = 0; $i < @platforms; $i++) {
+        my $scoped = catdir($platformBaseDirectory, $platforms[$i]);
+        push(@hierarchy, $scoped) if (-d $scoped);
+    }
+
+    return @hierarchy;
+}
+
+sub buildPlatformTestHierarchy(@)
+{
+    my (@platformHierarchy) = @_;
+    return @platformHierarchy if (@platformHierarchy < 2);
+
+    return ($platformHierarchy[0], $platformHierarchy[$#platformHierarchy]);
+}
+
+sub epiloguesAndPrologues($$)
+{
+    my ($lastDirectory, $directory) = @_;
+    my @lastComponents = split('/', $lastDirectory);
+    my @components = split('/', $directory);
+
+    while (@lastComponents) {
+        if (!defined($components[0]) || $lastComponents[0] ne $components[0]) {
+            last;
+        }
+        shift @components;
+        shift @lastComponents;
+    }
+
+    my @result;
+    my $leaving = $lastDirectory;
+    foreach (@lastComponents) {
+        my $epilogue = $leaving . "/resources/run-webkit-tests-epilogue.html";
+        foreach (@platformResultHierarchy) {
+            push @result, catdir($_, $epilogue) if (stat(catdir($_, $epilogue)));
+        }
+        push @result, catdir($testDirectory, $epilogue) if (stat(catdir($testDirectory, $epilogue)));
+        $leaving =~ s|(^\|/)[^/]+$||;
+    }
+
+    my $entering = $leaving;
+    foreach (@components) {
+        $entering .= '/' . $_;
+        my $prologue = $entering . "/resources/run-webkit-tests-prologue.html";
+        push @result, catdir($testDirectory, $prologue) if (stat(catdir($testDirectory, $prologue)));
+        foreach (reverse @platformResultHierarchy) {
+            push @result, catdir($_, $prologue) if (stat(catdir($_, $prologue)));
+        }
+    }
+    return @result;
+}
+    
+sub parseLeaksandPrintUniqueLeaks()
+{
+    return unless @leaksFilenames;
+     
+    my $mergedFilenames = join " ", @leaksFilenames;
+    my $parseMallocHistoryTool = sourceDir() . "/WebKitTools/Scripts/parse-malloc-history";
+    
+    open MERGED_LEAKS, "cat $mergedFilenames | $parseMallocHistoryTool --merge-depth $mergeDepth  - |" ;
+    my @leakLines = <MERGED_LEAKS>;
+    close MERGED_LEAKS;
+    
+    my $uniqueLeakCount = 0;
+    my $totalBytes;
+    foreach my $line (@leakLines) {
+        ++$uniqueLeakCount if ($line =~ /^(\d*)\scalls/);
+        $totalBytes = $1 if $line =~ /^total\:\s(.*)\s\(/;
+    }
+    
+    print "\nWARNING: $totalLeaks total leaks found for a total of $totalBytes!\n";
+    print "WARNING: $uniqueLeakCount unique leaks found!\n";
+    print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
+    
+}
+
+sub extensionForMimeType($)
+{
+    my ($mimeType) = @_;
+
+    if ($mimeType eq "application/x-webarchive") {
+        return "webarchive";
+    } elsif ($mimeType eq "application/pdf") {
+        return "pdf";
+    }
+    return "txt";
+}
+
+# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts.
+sub readFromDumpToolWithTimer(**)
+{
+    my ($fhIn, $fhError) = @_;
+
+    setFileHandleNonBlocking($fhIn, 1);
+    setFileHandleNonBlocking($fhError, 1);
+
+    my $maximumSecondsWithoutOutput = $timeoutSeconds;
+    $maximumSecondsWithoutOutput *= 10 if $guardMalloc;
+    my $microsecondsToWaitBeforeReadingAgain = 1000;
+
+    my $timeOfLastSuccessfulRead = time;
+
+    my @output = ();
+    my @error = ();
+    my $status = "success";
+    my $mimeType = "text/plain";
+    # We don't have a very good way to know when the "headers" stop
+    # and the content starts, so we use this as a hack:
+    my $haveSeenContentType = 0;
+    my $haveSeenEofIn = 0;
+    my $haveSeenEofError = 0;
+
+    while (1) {
+        if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) {
+            $status = dumpToolDidCrash() ? "crashed" : "timedOut";
+            last;
+        }
+
+        # Once we've seen the EOF, we must not read anymore.
+        my $lineIn = readline($fhIn) unless $haveSeenEofIn;
+        my $lineError = readline($fhError) unless $haveSeenEofError;
+        if (!defined($lineIn) && !defined($lineError)) {
+            last if ($haveSeenEofIn && $haveSeenEofError);
+
+            if ($! != EAGAIN) {
+                $status = "crashed";
+                last;
+            }
+
+            # No data ready
+            usleep($microsecondsToWaitBeforeReadingAgain);
+            next;
+        }
+
+        $timeOfLastSuccessfulRead = time;
+
+        if (defined($lineIn)) {
+            if (!$haveSeenContentType && $lineIn =~ /^Content-Type: (\S+)$/) {
+                $mimeType = $1;
+                $haveSeenContentType = 1;
+            } elsif ($lineIn =~ /#EOF/) {
+                $haveSeenEofIn = 1;
+            } else {
+                push @output, $lineIn;
+            }
+        }
+        if (defined($lineError)) {
+            if ($lineError =~ /#EOF/) {
+                $haveSeenEofError = 1;
+            } else {
+                push @error, $lineError;
+            }
+        }
+    }
+
+    setFileHandleNonBlocking($fhIn, 0);
+    setFileHandleNonBlocking($fhError, 0);
+    return {
+        output => join("", @output),
+        error => join("", @error),
+        status => $status,
+        mimeType => $mimeType,
+        extension => extensionForMimeType($mimeType)
+    };
+}
+
+sub setFileHandleNonBlocking(*$)
+{
+    my ($fh, $nonBlocking) = @_;
+
+    my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags";
+
+    if ($nonBlocking) {
+        $flags |= O_NONBLOCK;
+    } else {
+        $flags &= ~O_NONBLOCK;
+    }
+
+    fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags";
+
+    return 1;
+}
+
+sub sampleDumpTool()
+{
+    return unless isAppleMacWebKit();
+    return unless $runSample;
+
+    my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree";
+    -d $outputDirectory or mkdir $outputDirectory;
+
+    my $outputFile = "$outputDirectory/HangReport.txt";
+    system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile;
+}
+
+sub stripMetrics($$)
+{
+    my ($actual, $expected) = @_;
+
+    foreach my $result ($actual, $expected) {
+        $result =~ s/at \(-?[0-9]+,-?[0-9]+\) *//g;
+        $result =~ s/size -?[0-9]+x-?[0-9]+ *//g;
+        $result =~ s/text run width -?[0-9]+: //g;
+        $result =~ s/text run width -?[0-9]+ [a-zA-Z ]+: //g;
+        $result =~ s/RenderButton {BUTTON} .*/RenderButton {BUTTON}/g;
+        $result =~ s/RenderImage {INPUT} .*/RenderImage {INPUT}/g;
+        $result =~ s/RenderBlock {INPUT} .*/RenderBlock {INPUT}/g;
+        $result =~ s/RenderTextControl {INPUT} .*/RenderTextControl {INPUT}/g;
+        $result =~ s/\([0-9]+px/px/g;
+        $result =~ s/ *" *\n +" */ /g;
+        $result =~ s/" +$/"/g;
+
+        $result =~ s/- /-/g;
+        $result =~ s/\n( *)"\s+/\n$1"/g;
+        $result =~ s/\s+"\n/"\n/g;
+        $result =~ s/scrollWidth [0-9]+/scrollWidth/g;
+        $result =~ s/scrollHeight [0-9]+/scrollHeight/g;
+    }
+
+    return ($actual, $expected);
+}
+
+sub fileShouldBeIgnored
+{
+    my ($filePath) = @_;
+    foreach my $ignoredDir (keys %ignoredDirectories) {
+        if ($filePath =~ m/^$ignoredDir/) {
+            return 1;
+        }
+    }
+    return 0;
+}
+
+sub readSkippedFiles($)
+{
+    my ($constraintPath) = @_;
+
+    foreach my $level (@platformTestHierarchy) {
+        if (open SKIPPED, "<", "$level/Skipped") {
+            if ($verbose) {
+                my ($dir, $name) = splitpath($level);
+                print "Skipped tests in $name:\n";
+            }
+
+            while (<SKIPPED>) {
+                my $skipped = $_;
+                chomp $skipped;
+                $skipped =~ s/^[ \n\r]+//;
+                $skipped =~ s/[ \n\r]+$//;
+                if ($skipped && $skipped !~ /^#/) {
+                    if ($skippedOnly) {
+                        if (!fileShouldBeIgnored($skipped)) {
+                            if (!$constraintPath) {
+                                # Always add $skipped since no constraint path was specified on the command line.
+                                push(@ARGV, $skipped);
+                            } elsif ($skipped =~ /^($constraintPath)/) {
+                                # Add $skipped only if it matches the current path constraint, e.g.,
+                                # "--skipped=only dir1" with "dir1/file1.html" on the skipped list.
+                                push(@ARGV, $skipped);
+                            } elsif ($constraintPath =~ /^($skipped)/) {
+                                # Add current path constraint if it is more specific than the skip list entry,
+                                # e.g., "--skipped=only dir1/dir2/dir3" with "dir1" on the skipped list.
+                                push(@ARGV, $constraintPath);
+                            }
+                        } elsif ($verbose) {
+                            print "    $skipped\n";
+                        }
+                    } else {
+                        if ($verbose) {
+                            print "    $skipped\n";
+                        }
+                        processIgnoreTests($skipped, "Skipped");
+                    }
+                }
+            }
+            close SKIPPED;
+        }
+    }
+}
+
+my @testsFound;
+
+sub directoryFilter
+{
+    return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
+    return () if exists $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)};
+    return @_;
+}
+
+sub fileFilter
+{
+    my $filename = $_;
+    if ($filename =~ /\.([^.]+)$/) {
+        if (exists $supportedFileExtensions{$1}) {
+            my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testDirectory);
+            push @testsFound, $path if !exists $ignoredFiles{$path};
+        }
+    }
+}
+
+sub findTestsToRun
+{
+    my @testsToRun = ();
+
+    for my $test (@ARGV) {
+        $test =~ s/^($layoutTestsName|$testDirectory)\///;
+        my $fullPath = catfile($testDirectory, $test);
+        if (file_name_is_absolute($test)) {
+            print "can't run test $test outside $testDirectory\n";
+        } elsif (-f $fullPath) {
+            my ($filename, $pathname, $fileExtension) = fileparse($test, qr{\.[^.]+$});
+            if (!exists $supportedFileExtensions{substr($fileExtension, 1)}) {
+                print "test $test does not have a supported extension\n";
+            } elsif ($testHTTP || $pathname !~ /^http\//) {
+                push @testsToRun, $test;
+            }
+        } elsif (-d $fullPath) {
+            @testsFound = ();
+            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $fullPath);
+            for my $level (@platformTestHierarchy) {
+                my $platformPath = catfile($level, $test);
+                find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $platformPath) if (-d $platformPath);
+            }
+            push @testsToRun, sort pathcmp @testsFound;
+            @testsFound = ();
+        } else {
+            print "test $test not found\n";
+        }
+    }
+
+    if (!scalar @ARGV) {
+        @testsFound = ();
+        find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testDirectory);
+        for my $level (@platformTestHierarchy) {
+            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $level);
+        }
+        push @testsToRun, sort pathcmp @testsFound;
+        @testsFound = ();
+
+        # We need to minimize the time when Apache and WebSocketServer is locked by tests
+        # so run them last if no explicit order was specified in the argument list.
+        my @httpTests;
+        my @websocketTests;
+        my @otherTests;
+        foreach my $test (@testsToRun) {
+            if ($test =~ /^http\//) {
+                push(@httpTests, $test);
+            } elsif ($test =~ /^websocket\//) {
+                push(@websocketTests, $test);
+            } else {
+                push(@otherTests, $test);
+            }
+        }
+        @testsToRun = (@otherTests, @httpTests, @websocketTests);
+    }
+
+    # Reverse the tests
+    @testsToRun = reverse @testsToRun if $reverseTests;
+
+    # Shuffle the array
+    @testsToRun = shuffle(@testsToRun) if $randomizeTests;
+
+    return @testsToRun;
+}
+
+sub printResults
+{
+    my %text = (
+        match => "succeeded",
+        mismatch => "had incorrect layout",
+        new => "were new",
+        timedout => "timed out",
+        crash => "crashed",
+        error => "had stderr output"
+    );
+
+    for my $type ("match", "mismatch", "new", "timedout", "crash", "error") {
+        my $typeCount = $counts{$type};
+        next unless $typeCount;
+        my $typeText = $text{$type};
+        my $message;
+        if ($typeCount == 1) {
+            $typeText =~ s/were/was/;
+            $message = sprintf "1 test case (%d%%) %s\n", 1 * 100 / $count, $typeText;
+        } else {
+            $message = sprintf "%d test cases (%d%%) %s\n", $typeCount, $typeCount * 100 / $count, $typeText;
+        }
+        $message =~ s-\(0%\)-(<1%)-;
+        print $message;
+    }
+}
+
+sub stopRunningTestsEarlyIfNeeded()
+{
+    # --reset-results does not check pass vs. fail, so exitAfterNFailures makes no sense with --reset-results.
+    return 0 if !$exitAfterNFailures || $resetResults;
+
+    my $passCount = $counts{match} || 0; # $counts{match} will be undefined if we've not yet passed a test (e.g. the first test fails).
+    my $failureCount = $count - $passCount; # "Failure" here includes new tests, timeouts, crashes, etc.
+    return 0 if $failureCount < $exitAfterNFailures;
+
+    print "\nExiting early after $failureCount failures. $count tests run.";
+    closeDumpTool();
+    return 1;
+}
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index 3350aa3..b087f67 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -89,6 +89,7 @@
 sub get_function_line_ranges_for_c($$);
 sub get_function_line_ranges_for_java($$);
 sub get_function_line_ranges_for_javascript($$);
+sub get_selector_line_ranges_for_css($$);
 sub method_decl_to_selector($);
 sub processPaths(\@);
 sub reviewerAndDescriptionForGitCommit($);
@@ -101,6 +102,7 @@
 my $bugNumber;
 my $name;
 my $emailAddress;
+my $mergeBase = 0;
 my $gitCommit = 0;
 my $gitIndex = "";
 my $gitReviewer = "";
@@ -114,6 +116,7 @@
                "bug:i" => \$bugNumber,
                "name:s" => \$name,
                "email:s" => \$emailAddress,
+               "merge-base:s" => \$mergeBase,
                "git-commit:s" => \$gitCommit,
                "git-index" => \$gitIndex,
                "git-reviewer:s" => \$gitReviewer,
@@ -125,6 +128,7 @@
     print STDERR basename($0) . " [--bug] [-d|--diff] [-h|--help] [-o|--open] [--git-commit=<committish>] [--git-reviewer=<name>] [svndir1 [svndir2 ...]]\n";
     print STDERR "  --bug          Fill in the ChangeLog bug information from the given bug.\n";
     print STDERR "  -d|--diff      Spew diff to stdout when running\n";
+    print STDERR "  --merge-base   Populate the ChangeLogs with the diff to this branch\n";
     print STDERR "  --git-commit   Populate the ChangeLogs from the specified git commit\n";
     print STDERR "  --git-index    Populate the ChangeLogs from the git index only\n";
     print STDERR "  --git-reviewer When populating the ChangeLogs from a git commit claim that the spcified name reviewed the change.\n";
@@ -474,6 +478,8 @@
         return get_function_line_ranges_for_java ($file_handle, $file_name);
     } elsif ($file_name =~ /\.js$/) {
         return get_function_line_ranges_for_javascript ($file_handle, $file_name);
+    } elsif ($file_name =~ /\.css$/) {
+        return get_selector_line_ranges_for_css ($file_handle, $file_name);
     }
     return ();
 }
@@ -1173,6 +1179,41 @@
     return @ranges;
 }
 
+# Read a file and get all the line ranges of the things that look like CSS selectors.  A selector is
+# anything before an opening brace on a line. A selector starts at the line containing the opening
+# brace and ends at the closing brace.
+# FIXME: Comments are parsed just like uncommented text.
+#
+# Result is a list of triples: [ start_line, end_line, selector ].
+
+sub get_selector_line_ranges_for_css($$)
+{
+    my ($fileHandle, $fileName) = @_;
+
+    my @ranges;
+
+    my $currentSelector = "";
+    my $start = 0;
+
+    while (<$fileHandle>) {
+        if (/^[ \t]*(.*[^ \t])[ \t]*{/) {
+            $currentSelector = $1;
+            $start = $.;
+        }
+        if (index($_, "}") >= 0) {
+            unless ($start) {
+                warn "mismatched braces in $fileName\n";
+                next;
+            }
+            push(@ranges, [$start, $., $currentSelector]);
+            $currentSelector = "";
+            $start = 0;
+            next;
+        }
+    }
+
+    return @ranges;
+}
 
 sub processPaths(\@)
 {
@@ -1216,6 +1257,7 @@
     return $gitCommit if $gitCommit =~ m/.+\.\..+/;
     return "\"$gitCommit^\" \"$gitCommit\"" if $gitCommit;
     return "--cached" if $gitIndex;
+    return $mergeBase if $mergeBase;
     return "HEAD" if $isGit;
 }
 
@@ -1230,7 +1272,7 @@
         $command = "$SVN diff --diff-cmd diff -x -N $pathsString";
     } elsif ($isGit) {
         $command = "$GIT diff --no-ext-diff -U0 " . diffFromToString();
-        $command .= " -- $pathsString" unless $gitCommit;
+        $command .= " -- $pathsString" unless $gitCommit or $mergeBase;
     }
 
     return $command;
diff --git a/WebKitTools/Scripts/rebaseline-chromium-webkit-tests b/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
index 302995c..8d14b86 100755
--- a/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
+++ b/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
@@ -31,9 +31,12 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
-                             "webkitpy", "layout_tests"))
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))
+scripts_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
+webkitpy_directory = os.path.join(scripts_directory, "webkitpy")
+sys.path.append(os.path.join(webkitpy_directory, "layout_tests"))
+
+# For simplejson
+sys.path.append(os.path.join(webkitpy_directory, "thirdparty"))
 
 import rebaseline_chromium_webkit_tests
 
diff --git a/WebKitTools/Scripts/resolve-ChangeLogs b/WebKitTools/Scripts/resolve-ChangeLogs
index 3238350..6635711 100755
--- a/WebKitTools/Scripts/resolve-ChangeLogs
+++ b/WebKitTools/Scripts/resolve-ChangeLogs
@@ -49,7 +49,6 @@
 sub fixOneMergedChangeLog($);
 sub hasGitUnmergedFiles();
 sub isInGitFilterBranch();
-sub mergeChanges($$$);
 sub parseFixMerged($$;$);
 sub removeChangeLogArguments($);
 sub resolveChangeLog($);
@@ -130,11 +129,11 @@
     fixMergedChangeLogs($commitRange, @changeLogFiles);
 } elsif ($mergeDriver) {
     my ($base, $theirs, $ours) = @ARGV;
-    if (mergeChanges($ours, $base, $theirs)) {
+    if (mergeChangeLogs($ours, $base, $theirs)) {
         unlink($ours);
         copy($theirs, $ours) or die $!;
     } else {
-        exit 1;
+        exec qw(git merge-file -L THEIRS -L BASE -L OURS), $theirs, $base, $ours;
     }
 } elsif (@changeLogFiles) {
     for my $file (@changeLogFiles) {
@@ -401,55 +400,6 @@
     return exists $ENV{MAPPED_PREVIOUS_COMMIT} && $ENV{MAPPED_PREVIOUS_COMMIT};
 }
 
-sub mergeChanges($$$)
-{
-    my ($fileMine, $fileOlder, $fileNewer) = @_;
-
-    my $traditionalReject = $fileMine =~ /\.rej$/ ? 1 : 0;
-
-    local $/ = undef;
-
-    my $patch;
-    if ($traditionalReject) {
-        open(DIFF, "<", $fileMine) or die $!;
-        $patch = <DIFF>;
-        close(DIFF);
-        rename($fileMine, "$fileMine.save");
-        rename($fileOlder, "$fileOlder.save");
-    } else {
-        open(DIFF, "-|", qw(diff -u -a --binary), $fileOlder, $fileMine) or die $!;
-        $patch = <DIFF>;
-        close(DIFF);
-    }
-
-    unlink("${fileNewer}.orig");
-    unlink("${fileNewer}.rej");
-
-    open(PATCH, "| patch --fuzz=3 --binary $fileNewer > " . File::Spec->devnull()) or die $!;
-    print PATCH fixChangeLogPatch($patch);
-    close(PATCH);
-
-    my $result;
-
-    # Refuse to merge the patch if it did not apply cleanly
-    if (-e "${fileNewer}.rej") {
-        unlink("${fileNewer}.rej");
-        unlink($fileNewer);
-        rename("${fileNewer}.orig", $fileNewer);
-        $result = 0;
-    } else {
-        unlink("${fileNewer}.orig");
-        $result = 1;
-    }
-
-    if ($traditionalReject) {
-        rename("$fileMine.save", $fileMine);
-        rename("$fileOlder.save", $fileOlder);
-    }
-
-    return $result;
-}
-
 sub parseFixMerged($$;$)
 {
     my ($switchName, $key, $value) = @_;
@@ -491,7 +441,7 @@
 
     return unless $fileMine && $fileOlder && $fileNewer;
 
-    if (mergeChanges($fileMine, $fileOlder, $fileNewer)) {
+    if (mergeChangeLogs($fileMine, $fileOlder, $fileNewer)) {
         if ($file ne $fileNewer) {
             unlink($file);
             rename($fileNewer, $file) or die $!;
diff --git a/WebKitTools/Scripts/run-chromium-webkit-tests b/WebKitTools/Scripts/run-chromium-webkit-tests
deleted file mode 100755
index 221b5aa..0000000
--- a/WebKitTools/Scripts/run-chromium-webkit-tests
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""Wrapper around webkitpy/layout_tests/run-chromium-webkit-tests.py"""
-import os
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
-                             "webkitpy", "layout_tests"))
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))
-import run_chromium_webkit_tests
-
-if __name__ == '__main__':
-    options, args = run_chromium_webkit_tests.parse_args()
-    run_chromium_webkit_tests.main(options, args)
diff --git a/WebKitTools/Scripts/run-launcher b/WebKitTools/Scripts/run-launcher
index e12a64a..bc00aac 100755
--- a/WebKitTools/Scripts/run-launcher
+++ b/WebKitTools/Scripts/run-launcher
@@ -64,6 +64,10 @@
         $launcherPath = catdir($launcherPath, "Programs", "GtkLauncher");
     }
     
+    if (isEfl()) {
+        $launcherPath = catdir($launcherPath, "Programs", "EWebLauncher");
+    }
+    
     if (isWx()) {
         if (isDarwin()) {
             $launcherPath = catdir($launcherPath, 'wxBrowser.app', 'Contents', 'MacOS', 'wxBrowser');
diff --git a/WebKitTools/Scripts/run-minibrowser b/WebKitTools/Scripts/run-minibrowser
new file mode 100755
index 0000000..c2fd412
--- /dev/null
+++ b/WebKitTools/Scripts/run-minibrowser
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2005, 2007 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. 
+# 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
+
+# Simplified "run" script for launching the WebKit2 MiniBrowser.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(runMiniBrowser());
diff --git a/WebKitTools/Scripts/run-webkit-httpd b/WebKitTools/Scripts/run-webkit-httpd
index 018f64c..9ea2551 100755
--- a/WebKitTools/Scripts/run-webkit-httpd
+++ b/WebKitTools/Scripts/run-webkit-httpd
@@ -42,6 +42,10 @@
 use webkitperl::httpd;
 use webkitdirs;
 
+# FIXME: Dynamic HTTP-port configuration in this file is wrong.  The various
+# apache config files in LayoutTests/http/config govern the port numbers.
+# Dynamic configuration as-written will also cause random failures in
+# an IPv6 environment.  See https://bugs.webkit.org/show_bug.cgi?id=37104.
 # Argument handling
 my $httpdPort = 8000;
 my $allInterfaces = 0;
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests
index 809e078..f28f20a 100755
--- a/WebKitTools/Scripts/run-webkit-tests
+++ b/WebKitTools/Scripts/run-webkit-tests
@@ -1,2222 +1,81 @@
 #!/usr/bin/perl
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
-# Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 Andras Becsi (becsi.andras@stud.u-szeged.hu), University of Szeged
+# 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:
+# 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. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
+#     * 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 APPLE AND ITS 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 APPLE OR ITS 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.
+# 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.
 
-# Script to run the WebKit Open Source Project layout tests.
+# This file is a temporary hack.
+# It will be removed as soon as all platforms are are ready to move to
+# new-run-webkit-tests and we can then update the buildbots to explicitly
+# call old-run-webkit-tests for any platforms which will never support
+# a Python run-webkit-tests.
 
-# Run all the tests passed in on the command line.
-# If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .pl, .php (and svg) files in the test directory.
-
-# Run each text.
-# Compare against the existing file xxx-expected.txt.
-# If there is a mismatch, generate xxx-actual.txt and xxx-diffs.txt.
-
-# At the end, report:
-#   the number of tests that got the expected results
-#   the number of tests that ran, but did not get the expected results
-#   the number of tests that failed to run
-#   the number of tests that were run but had no expected results to compare against
+# This is intentionally written in Perl to guarantee support on
+# the same set of platforms as old-run-webkit-tests currently supports.
+# The buildbot master.cfg also currently passes run-webkit-tests to
+# perl directly instead of executing it in a shell.
 
 use strict;
 use warnings;
 
-use Cwd;
-use Data::Dumper;
-use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-use File::Basename;
-use File::Copy;
-use File::Find;
-use File::Path;
-use File::Spec;
-use File::Spec::Functions;
 use FindBin;
-use Getopt::Long;
-use IPC::Open2;
-use IPC::Open3;
-use Time::HiRes qw(time usleep);
-
-use List::Util 'shuffle';
-
 use lib $FindBin::Bin;
-use webkitperl::features;
-use webkitperl::httpd;
 use webkitdirs;
-use VCSUtils;
-use POSIX;
 
-sub buildPlatformResultHierarchy();
-sub buildPlatformTestHierarchy(@);
-sub closeCygpaths();
-sub closeDumpTool();
-sub closeWebSocketServer();
-sub configureAndOpenHTTPDIfNeeded();
-sub countAndPrintLeaks($$$);
-sub countFinishedTest($$$$);
-sub deleteExpectedAndActualResults($);
-sub dumpToolDidCrash();
-sub epiloguesAndPrologues($$);
-sub expectedDirectoryForTest($;$;$);
-sub fileNameWithNumber($$);
-sub htmlForResultsSection(\@$&);
-sub isTextOnlyTest($);
-sub launchWithEnv(\@\%);
-sub resolveAndMakeTestResultsDirectory();
-sub numericcmp($$);
-sub openDiffTool();
-sub openDumpTool();
-sub parseLeaksandPrintUniqueLeaks();
-sub openWebSocketServerIfNeeded();
-sub pathcmp($$);
-sub printFailureMessageForTest($$);
-sub processIgnoreTests($$);
-sub readFromDumpToolWithTimer(**);
-sub readSkippedFiles($);
-sub recordActualResultsAndDiff($$);
-sub sampleDumpTool();
-sub setFileHandleNonBlocking(*$);
-sub slowestcmp($$);
-sub splitpath($);
-sub stripExtension($);
-sub stripMetrics($$);
-sub testCrashedOrTimedOut($$$$$);
-sub toURL($);
-sub toWindowsPath($);
-sub validateSkippedArg($$;$);
-sub writeToFile($$);
-
-# Argument handling
-my $addPlatformExceptions = 0;
-my $complexText = 0;
-my $exitAfterNFailures = 0;
-my $generateNewResults = isAppleMacWebKit() ? 1 : 0;
-my $guardMalloc = '';
-my $httpdPort = 8000;
-my $httpdSSLPort = 8443;
-my $ignoreMetrics = 0;
-my $webSocketPort = 8880;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecurePort = 9323;
-my $ignoreTests = '';
-my $iterations = 1;
-my $launchSafari = 1;
-my $mergeDepth;
-my $pixelTests = '';
-my $platform;
-my $quiet = '';
-my $randomizeTests = 0;
-my $repeatEach = 1;
-my $report10Slowest = 0;
-my $resetResults = 0;
-my $reverseTests = 0;
-my $root;
-my $runSample = 1;
-my $shouldCheckLeaks = 0;
-my $showHelp = 0;
-my $stripEditingCallbacks = isCygwin();
-my $testHTTP = 1;
-my $testMedia = 1;
-my $tmpDir = "/tmp";
-my $testResultsDirectory = File::Spec->catfile($tmpDir, "layout-test-results");
-my $testsPerDumpTool = 1000;
-my $threaded = 0;
-# DumpRenderTree has an internal timeout of 15 seconds, so this must be > 15.
-my $timeoutSeconds = 20;
-my $tolerance = 0;
-my $treatSkipped = "default";
-my $useRemoteLinksToTests = 0;
-my $useValgrind = 0;
-my $verbose = 0;
-my $shouldWaitForHTTPD = 0;
-
-my @leaksFilenames;
-
-if (isWindows() || isMsys()) {
-    print "This script has to be run under Cygwin to function correctly.\n";
-    exit 1;
-}
-
-# Default to --no-http for wx for now.
-$testHTTP = 0 if (isWx());
-
-my $expectedTag = "expected";
-my $actualTag = "actual";
-my $prettyDiffTag = "pretty-diff";
-my $diffsTag = "diffs";
-my $errorTag = "stderr";
-
-my @macPlatforms = ("mac-tiger", "mac-leopard", "mac-snowleopard", "mac");
-
-if (isAppleMacWebKit()) {
-    if (isTiger()) {
-        $platform = "mac-tiger";
-        $tolerance = 1.0;
-    } elsif (isLeopard()) {
-        $platform = "mac-leopard";
-        $tolerance = 0.1;
-    } elsif (isSnowLeopard()) {
-        $platform = "mac-snowleopard";
-        $tolerance = 0.1;
-    } else {
-        $platform = "mac";
-    }
-} elsif (isQt()) {
-    if (isDarwin()) {
-        $platform = "qt-mac";
-    } elsif (isLinux()) {
-        $platform = "qt-linux";
-    } elsif (isWindows() || isCygwin()) {
-        $platform = "qt-win";
-    } else {
-        $platform = "qt";
-    }
-} elsif (isGtk()) {
-    $platform = "gtk";
-    if (!$ENV{"WEBKIT_TESTFONTS"}) {
-        print "The WEBKIT_TESTFONTS environment variable is not defined.\n";
-        print "You must set it before running the tests.\n";
-        print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
-        exit 1;
-    }
-} elsif (isWx()) {
-    $platform = "wx";
-} elsif (isCygwin()) {
-    $platform = "win";
-}
-
-if (!defined($platform)) {
-    print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
-    $platform = "undefined";
-}
-
-my $programName = basename($0);
-my $launchSafariDefault = $launchSafari ? "launch" : "do not launch";
-my $httpDefault = $testHTTP ? "run" : "do not run";
-my $sampleDefault = $runSample ? "run" : "do not run";
-
-my $usage = <<EOF;
-Usage: $programName [options] [testdir|testpath ...]
-  --add-platform-exceptions       Put new results for non-platform-specific failing tests into the platform-specific results directory
-  --complex-text                  Use the complex text code path for all text (Mac OS X and Windows only)
-  -c|--configuration config       Set DumpRenderTree build configuration
-  -g|--guard-malloc               Enable malloc guard
-  --exit-after-n-failures N       Exit after the first N failures instead of running all tests
-  -h|--help                       Show this help message
-  --[no-]http                     Run (or do not run) http tests (default: $httpDefault)
-  --[no-]wait-for-httpd           Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: $shouldWaitForHTTPD) 
-  -i|--ignore-tests               Comma-separated list of directories or tests to ignore
-  --iterations n                  Number of times to run the set of tests (e.g. ABCABCABC)
-  --[no-]launch-safari            Launch (or do not launch) Safari to display test results (default: $launchSafariDefault)
-  -l|--leaks                      Enable leaks checking
-  --[no-]new-test-results         Generate results for new tests
-  --nthly n                       Restart DumpRenderTree every n tests (default: $testsPerDumpTool)
-  -p|--pixel-tests                Enable pixel tests
-  --tolerance t                   Ignore image differences less than this percentage (default: $tolerance)
-  --platform                      Override the detected platform to use for tests and results (default: $platform)
-  --port                          Web server port to use with http tests
-  -q|--quiet                      Less verbose output
-  --reset-results                 Reset ALL results (including pixel tests if --pixel-tests is set)
-  -o|--results-directory          Output results directory (default: $testResultsDirectory)
-  --random                        Run the tests in a random order
-  --repeat-each n                 Number of times to run each test (e.g. AAABBBCCC)
-  --reverse                       Run the tests in reverse alphabetical order
-  --root                          Path to root tools build
-  --[no-]sample-on-timeout        Run sample on timeout (default: $sampleDefault) (Mac OS X only)
-  -1|--singly                     Isolate each test case run (implies --nthly 1 --verbose)
-  --skipped=[default|ignore|only] Specifies how to treat the Skipped file
-                                     default: Tests/directories listed in the Skipped file are not tested
-                                     ignore:  The Skipped file is ignored
-                                     only:    Only those tests/directories listed in the Skipped file will be run
-  --slowest                       Report the 10 slowest tests
-  --ignore-metrics                Ignore metrics in tests
-  --[no-]strip-editing-callbacks  Remove editing callbacks from expected results
-  -t|--threaded                   Run a concurrent JavaScript thead with each test
-  --timeout t                     Sets the number of seconds before a test times out (default: $timeoutSeconds)
-  --valgrind                      Run DumpRenderTree inside valgrind (Qt/Linux only)
-  -v|--verbose                    More verbose output (overrides --quiet)
-  -m|--merge-leak-depth arg       Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg.  Defaults to 5.
-  --use-remote-links-to-tests     Link to test files within the SVN repository in the results.
-EOF
-
-setConfiguration();
-
-my $getOptionsResult = GetOptions(
-    'add-platform-exceptions' => \$addPlatformExceptions,
-    'complex-text' => \$complexText,
-    'exit-after-n-failures=i' => \$exitAfterNFailures,
-    'guard-malloc|g' => \$guardMalloc,
-    'help|h' => \$showHelp,
-    'http!' => \$testHTTP,
-    'wait-for-httpd!' => \$shouldWaitForHTTPD,
-    'ignore-metrics!' => \$ignoreMetrics,
-    'ignore-tests|i=s' => \$ignoreTests,
-    'iterations=i' => \$iterations,
-    'launch-safari!' => \$launchSafari,
-    'leaks|l' => \$shouldCheckLeaks,
-    'merge-leak-depth|m:5' => \$mergeDepth,
-    'new-test-results!' => \$generateNewResults,
-    'nthly=i' => \$testsPerDumpTool,
-    'pixel-tests|p' => \$pixelTests,
-    'platform=s' => \$platform,
-    'port=i' => \$httpdPort,
-    'quiet|q' => \$quiet,
-    'random' => \$randomizeTests,
-    'repeat-each=i' => \$repeatEach,
-    'reset-results' => \$resetResults,
-    'results-directory|o=s' => \$testResultsDirectory,
-    'reverse' => \$reverseTests,
-    'root=s' => \$root,
-    'sample-on-timeout!' => \$runSample,
-    'singly|1' => sub { $testsPerDumpTool = 1; },
-    'skipped=s' => \&validateSkippedArg,
-    'slowest' => \$report10Slowest,
-    'strip-editing-callbacks!' => \$stripEditingCallbacks,
-    'threaded|t' => \$threaded,
-    'timeout=i' => \$timeoutSeconds,
-    'tolerance=f' => \$tolerance,
-    'use-remote-links-to-tests' => \$useRemoteLinksToTests,
-    'valgrind' => \$useValgrind,
-    'verbose|v' => \$verbose,
-);
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR $usage;
-    exit 1;
-}
-
-my $ignoreSkipped = $treatSkipped eq "ignore";
-my $skippedOnly = $treatSkipped eq "only";
-
-my $configuration = configuration();
-
-# We need an environment variable to be able to enable the feature per-slave
-$shouldWaitForHTTPD = $ENV{"WEBKIT_WAIT_FOR_HTTPD"} unless ($shouldWaitForHTTPD);
-$verbose = 1 if $testsPerDumpTool == 1;
-
-if ($shouldCheckLeaks && $testsPerDumpTool > 1000) {
-    print STDERR "\nWARNING: Running more than 1000 tests at a time with MallocStackLogging enabled may cause a crash.\n\n";
-}
-
-# Stack logging does not play well with QuickTime on Tiger (rdar://problem/5537157)
-$testMedia = 0 if $shouldCheckLeaks && isTiger();
-
-# Generating remote links causes a lot of unnecessary spew on GTK build bot
-$useRemoteLinksToTests = 0 if isGtk();
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-my $productDir = productDir();
-$productDir .= "/bin" if isQt();
-$productDir .= "/Programs" if isGtk();
-
-chdirWebKit();
-
-if (!defined($root)) {
-    print STDERR "Running build-dumprendertree\n";
-
-    local *DEVNULL;
-    my ($childIn, $childOut, $childErr);
-    if ($quiet) {
-        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
-        $childOut = ">&DEVNULL";
-        $childErr = ">&DEVNULL";
-    } else {
-        # When not quiet, let the child use our stdout/stderr.
-        $childOut = ">&STDOUT";
-        $childErr = ">&STDERR";
-    }
-
-    my @args = argumentsForConfiguration();
-    my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/build-dumprendertree", @args) or die "Failed to run build-dumprendertree";
-    close($childIn);
-    waitpid $buildProcess, 0;
-    my $buildResult = $?;
-    close($childOut);
-    close($childErr);
-
-    close DEVNULL if ($quiet);
-
-    if ($buildResult) {
-        print STDERR "Compiling DumpRenderTree failed!\n";
-        exit exitStatus($buildResult);
-    }
-}
-
-my $dumpToolName = "DumpRenderTree";
-$dumpToolName .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
-my $dumpTool = "$productDir/$dumpToolName";
-die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool;
-
-my $imageDiffTool = "$productDir/ImageDiff";
-$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
-die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
-
-checkFrameworks() unless isCygwin();
-
-if (isAppleMacWebKit()) {
-    push @INC, $productDir;
-    require DumpRenderTreeSupport;
-}
-
-my $layoutTestsName = "LayoutTests";
-my $testDirectory = File::Spec->rel2abs($layoutTestsName);
-my $expectedDirectory = $testDirectory;
-my $platformBaseDirectory = catdir($testDirectory, "platform");
-my $platformTestDirectory = catdir($platformBaseDirectory, $platform);
-my @platformResultHierarchy = buildPlatformResultHierarchy();
-my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy);
-
-$expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
-
-$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
-my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
-
-print "Running tests from $testDirectory\n";
-if ($pixelTests) {
-    print "Enabling pixel tests with a tolerance of $tolerance%\n";
-    if (isDarwin()) {
-        print "WARNING: Temporarily changing the main display color profile:\n";
-        print "\tThe colors on your screen will change for the duration of the testing.\n";
-        print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
-        
-        if (isPerianInstalled()) {
-            print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
-            print "\tYou should avoid generating new pixel results in this environment.\n";
-            print "\tSee https://bugs.webkit.org/show_bug.cgi?id=22615 for details.\n";
-        }
-    }
-}
-
-system "ln", "-s", $testDirectory, "/tmp/LayoutTests" unless -x "/tmp/LayoutTests";
-
-my %ignoredFiles = ( "results.html" => 1 );
-my %ignoredDirectories = map { $_ => 1 } qw(platform);
-my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources script-tests);
-my %supportedFileExtensions = map { $_ => 1 } qw(html shtml xml xhtml pl php);
-
-if (!checkWebCoreFeatureSupport("MathML", 0)) {
-    $ignoredDirectories{'mathml'} = 1;
-}
-
-# FIXME: We should fix webkitperl/features.pm:hasFeature() to do the correct feature detection for Cygwin.
-if (checkWebCoreFeatureSupport("SVG", 0)) {
-    $supportedFileExtensions{'svg'} = 1;
-} elsif (isCygwin()) {
-    $supportedFileExtensions{'svg'} = 1;
-} else {
-    $ignoredLocalDirectories{'svg'} = 1;
-}
-
-if (!$testHTTP) {
-    $ignoredDirectories{'http'} = 1;
-    $ignoredDirectories{'websocket'} = 1;
-}
-
-if (!$testMedia) {
-    $ignoredDirectories{'media'} = 1;
-    $ignoredDirectories{'http/tests/media'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("Accelerated Compositing", 0)) {
-    $ignoredDirectories{'compositing'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("3D Rendering", 0)) {
-    $ignoredDirectories{'animations/3d'} = 1;
-    $ignoredDirectories{'transforms/3d'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
-    $ignoredDirectories{'fast/canvas/webgl'} = 1;
-}
-
-if (checkWebCoreFeatureSupport("WML", 0)) {
-    $supportedFileExtensions{'wml'} = 1;
-} else {
-    $ignoredDirectories{'http/tests/wml'} = 1;
-    $ignoredDirectories{'fast/wml'} = 1;
-    $ignoredDirectories{'wml'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("XHTMLMP", 0)) {
-    $ignoredDirectories{'fast/xhtmlmp'} = 1;
-}
-
-processIgnoreTests($ignoreTests, "ignore-tests") if $ignoreTests;
-if (!$ignoreSkipped) {
-    if (!$skippedOnly || @ARGV == 0) {
-        readSkippedFiles("");
-    } else {
-        # Since readSkippedFiles() appends to @ARGV, we must use a foreach
-        # loop so that we only iterate over the original argument list.
-        foreach my $argnum (0 .. $#ARGV) {
-            readSkippedFiles(shift @ARGV);
-        }
-    }
-}
-
-my @tests = findTestsToRun();
-
-die "no tests to run\n" if !@tests;
-
-my %counts;
-my %tests;
-my %imagesPresent;
-my %imageDifferences;
-my %durations;
-my $count = 0;
-my $leaksOutputFileNumber = 1;
-my $totalLeaks = 0;
-
-my @toolArgs = ();
-push @toolArgs, "--pixel-tests" if $pixelTests;
-push @toolArgs, "--threaded" if $threaded;
-push @toolArgs, "--complex-text" if $complexText;
-push @toolArgs, "-";
-
-my @diffToolArgs = ();
-push @diffToolArgs, "--tolerance", $tolerance;
-
-$| = 1;
-
-my $dumpToolPID;
-my $isDumpToolOpen = 0;
-my $dumpToolCrashed = 0;
-my $imageDiffToolPID;
-my $isDiffToolOpen = 0;
-
-my $atLineStart = 1;
-my $lastDirectory = "";
-
-my $isHttpdOpen = 0;
-my $isWebSocketServerOpen = 0;
-my $webSocketServerPID = 0;
-my $failedToStartWebSocketServer = 0;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecureServerPID = 0;
-
-sub catch_pipe { $dumpToolCrashed = 1; }
-$SIG{"PIPE"} = "catch_pipe";
-
-print "Testing ", scalar @tests, " test cases";
-print " $iterations times" if ($iterations > 1);
-print ", repeating each test $repeatEach times" if ($repeatEach > 1);
-print ".\n";
-
-my $overallStartTime = time;
-
-my %expectedResultPaths;
-
-my @originalTests = @tests;
-# Add individual test repetitions
-if ($repeatEach > 1) {
-    @tests = ();
-    foreach my $test (@originalTests) {
-        for (my $i = 0; $i < $repeatEach; $i++) {
-            push(@tests, $test);
-        }
-    }
-}
-# Add test set repetitions
-for (my $i = 1; $i < $iterations; $i++) {
-    push(@tests, @originalTests);
-}
-
-for my $test (@tests) {
-    my $newDumpTool = not $isDumpToolOpen;
-    openDumpTool();
-
-    my $base = stripExtension($test);
-    my $expectedExtension = ".txt";
-    
-    my $dir = $base;
-    $dir =~ s|/[^/]+$||;
-
-    if ($newDumpTool || $dir ne $lastDirectory) {
-        foreach my $logue (epiloguesAndPrologues($newDumpTool ? "" : $lastDirectory, $dir)) {
-            if (isCygwin()) {
-                $logue = toWindowsPath($logue);
-            } else {
-                $logue = canonpath($logue);
-            }
-            if ($verbose) {
-                print "running epilogue or prologue $logue\n";
-            }
-            print OUT "$logue\n";
-            # Throw away output from DumpRenderTree.
-            # Once for the test output and once for pixel results (empty)
-            while (<IN>) {
-                last if /#EOF/;
-            }
-            while (<IN>) {
-                last if /#EOF/;
-            }
-        }
-    }
-
-    if ($verbose) {
-        print "running $test -> ";
-        $atLineStart = 0;
-    } elsif (!$quiet) {
-        if ($dir ne $lastDirectory) {
-            print "\n" unless $atLineStart;
-            print "$dir ";
-        }
-        print ".";
-        $atLineStart = 0;
-    }
-
-    $lastDirectory = $dir;
-
-    my $result;
-
-    my $startTime = time if $report10Slowest;
-
-    # Try to read expected hash file for pixel tests
-    my $suffixExpectedHash = "";
-    if ($pixelTests && !$resetResults) {
-        my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-        if (open EXPECTEDHASH, "$expectedPixelDir/$base-$expectedTag.checksum") {
-            my $expectedHash = <EXPECTEDHASH>;
-            chomp($expectedHash);
-            close EXPECTEDHASH;
-            
-            # Format expected hash into a suffix string that is appended to the path / URL passed to DRT
-            $suffixExpectedHash = "'$expectedHash";
-        }
-    }
-
-    if ($test =~ /^http\//) {
-        configureAndOpenHTTPDIfNeeded();
-        if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
-            my $path = canonpath($test);
-            $path =~ s/^http\/tests\///;
-            print OUT "http://127.0.0.1:$httpdPort/$path$suffixExpectedHash\n";
-        } elsif ($test =~ /^http\/tests\/ssl\//) {
-            my $path = canonpath($test);
-            $path =~ s/^http\/tests\///;
-            print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixExpectedHash\n";
-        } else {
-            my $testPath = "$testDirectory/$test";
-            if (isCygwin()) {
-                $testPath = toWindowsPath($testPath);
-            } else {
-                $testPath = canonpath($testPath);
-            }
-            print OUT "$testPath$suffixExpectedHash\n";
-        }
-    } elsif ($test =~ /^websocket\//) {
-        if ($test =~ /^websocket\/tests\/local\//) {
-            my $testPath = "$testDirectory/$test";
-            if (isCygwin()) {
-                $testPath = toWindowsPath($testPath);
-            } else {
-                $testPath = canonpath($testPath);
-            }
-            print OUT "$testPath\n";
-        } else {
-            if (openWebSocketServerIfNeeded()) {
-                my $path = canonpath($test);
-                if ($test =~ /^websocket\/tests\/ssl\//) {
-                    # wss is disabled until all platforms support pyOpenSSL.
-                    print STDERR "Error: wss is disabled until all platforms support pyOpenSSL.";
-                    # print OUT "https://127.0.0.1:$webSocketSecurePort/$path\n";
-                } else {
-                    print OUT "http://127.0.0.1:$webSocketPort/$path\n";
-                }
-            } else {
-                # We failed to launch the WebSocket server.  Display a useful error message rather than attempting
-                # to run tests that expect the server to be available.
-                my $errorMessagePath = "$testDirectory/websocket/resources/server-failed-to-start.html";
-                $errorMessagePath = isCygwin() ? toWindowsPath($errorMessagePath) : canonpath($errorMessagePath);
-                print OUT "$errorMessagePath\n";
-            }
-        }
-    } else {
-        my $testPath = "$testDirectory/$test";
-        if (isCygwin()) {
-            $testPath = toWindowsPath($testPath);
-        } else {
-            $testPath = canonpath($testPath);
-        }
-        print OUT "$testPath$suffixExpectedHash\n" if defined $testPath;
-    }
-
-    # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
-    # Each block is terminated by a #EOF on a line by itself.
-    # The first block is the output of the test (in text, RenderTree or other formats).
-    # The second block is for optional pixel data in PNG format, and may be empty if
-    # pixel tests are not being run, or the test does not dump pixels (e.g. text tests).
-    my $readResults = readFromDumpToolWithTimer(IN, ERROR);
-
-    my $actual = $readResults->{output};
-    my $error = $readResults->{error};
-
-    $expectedExtension = $readResults->{extension};
-    my $expectedFileName = "$base-$expectedTag.$expectedExtension";
-
-    my $isText = isTextOnlyTest($actual);
-
-    my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension);
-    $expectedResultPaths{$base} = "$expectedDir/$expectedFileName";
-
-    unless ($readResults->{status} eq "success") {
-        my $crashed = $readResults->{status} eq "crashed";
-        testCrashedOrTimedOut($test, $base, $crashed, $actual, $error);
-        countFinishedTest($test, $base, $crashed ? "crash" : "timedout", 0);
-        next;
-    }
-
-    $durations{$test} = time - $startTime if $report10Slowest;
-
-    my $expected;
-
-    if (!$resetResults && open EXPECTED, "<", "$expectedDir/$expectedFileName") {
-        $expected = "";
-        while (<EXPECTED>) {
-            next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/;
-            $expected .= $_;
-        }
-        close EXPECTED;
-    }
-
-    if ($ignoreMetrics && !$isText && defined $expected) {
-        ($actual, $expected) = stripMetrics($actual, $expected);
-    }
-
-    if ($shouldCheckLeaks && $testsPerDumpTool == 1) {
-        print "        $test -> ";
-    }
-
-    my $actualPNG = "";
-    my $diffPNG = "";
-    my $diffPercentage = 0;
-    my $diffResult = "passed";
-
-    my $actualHash = "";
-    my $expectedHash = "";
-    my $actualPNGSize = 0;
-
-    while (<IN>) {
-        last if /#EOF/;
-        if (/ActualHash: ([a-f0-9]{32})/) {
-            $actualHash = $1;
-        } elsif (/ExpectedHash: ([a-f0-9]{32})/) {
-            $expectedHash = $1;
-        } elsif (/Content-Length: (\d+)\s*/) {
-            $actualPNGSize = $1;
-            read(IN, $actualPNG, $actualPNGSize);
-        }
-    }
-
-    if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) {
-        if ($actualHash eq "" && $expectedHash eq "") {
-            printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!");
-        } elsif ($actualHash eq "") {
-            printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!");
-        } elsif ($expectedHash eq "") {
-            printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!");
-        }
-    }
-
-    if ($actualPNGSize > 0) {
-        my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-
-        if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) {
-            if (-f "$expectedPixelDir/$base-$expectedTag.png") {
-                my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png";
-                my $expectedPNG = "";
-                open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png";
-                read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize);
-
-                openDiffTool();
-                print DIFFOUT "Content-Length: $actualPNGSize\n";
-                print DIFFOUT $actualPNG;
-
-                print DIFFOUT "Content-Length: $expectedPNGSize\n";
-                print DIFFOUT $expectedPNG;
-
-                while (<DIFFIN>) {
-                    last if /^error/ || /^diff:/;
-                    if (/Content-Length: (\d+)\s*/) {
-                        read(DIFFIN, $diffPNG, $1);
-                    }
-                }
-
-                if (/^diff: (.+)% (passed|failed)/) {
-                    $diffPercentage = $1 + 0;
-                    $imageDifferences{$base} = $diffPercentage;
-                    $diffResult = $2;
-                }
-                
-                if (!$diffPercentage) {
-                    printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)");
-                }
-            } elsif ($verbose) {
-                printFailureMessageForTest($test, "WARNING: expected image is missing!");
-            }
-        }
-
-        if ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png") {
-            mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir;
-            writeToFile("$expectedPixelDir/$base-$expectedTag.png", $actualPNG);
-        }
-
-        if ($actualHash ne "" && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.checksum")) {
-            writeToFile("$expectedPixelDir/$base-$expectedTag.checksum", $actualHash);
-        }
-    }
-
-    if (dumpToolDidCrash()) {
-        $result = "crash";
-        testCrashedOrTimedOut($test, $base, 1, $actual, $error);
-    } elsif (!defined $expected) {
-        if ($verbose) {
-            print "new " . ($resetResults ? "result" : "test") ."\n";
-            $atLineStart = 1;
-        }
-        $result = "new";
-
-        if ($generateNewResults || $resetResults) {
-            mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir;
-            writeToFile("$expectedDir/$expectedFileName", $actual);
-        }
-        deleteExpectedAndActualResults($base);
-        recordActualResultsAndDiff($base, $actual);
-        if (!$resetResults) {
-            # Always print the file name for new tests, as they will probably need some manual inspection.
-            # in verbose mode we already printed the test case, so no need to do it again.
-            unless ($verbose) {
-                print "\n" unless $atLineStart;
-                print "$test -> ";
-            }
-            my $resultsDir = catdir($expectedDir, dirname($base));
-            if ($generateNewResults) {
-                print "new (results generated in $resultsDir)\n";
-            } else {
-                print "new\n";
-            }
-            $atLineStart = 1;
-        }
-    } elsif ($actual eq $expected && $diffResult eq "passed") {
-        if ($verbose) {
-            print "succeeded\n";
-            $atLineStart = 1;
-        }
-        $result = "match";
-        deleteExpectedAndActualResults($base);
-    } else {
-        $result = "mismatch";
-
-        my $pixelTestFailed = $pixelTests && $diffPNG && $diffPNG ne "";
-        my $testFailed = $actual ne $expected;
-
-        my $message = !$testFailed ? "pixel test failed" : "failed";
-
-        if (($testFailed || $pixelTestFailed) && $addPlatformExceptions) {
-            my $testBase = catfile($testDirectory, $base);
-            my $expectedBase = catfile($expectedDir, $base);
-            my $testIsMaximallyPlatformSpecific = $testBase =~ m|^\Q$platformTestDirectory\E/|;
-            my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|;
-            if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) {
-                mkpath catfile($platformTestDirectory, dirname($base));
-                if ($testFailed) {
-                    my $expectedFile = catfile($platformTestDirectory, "$expectedFileName");
-                    writeToFile("$expectedFile", $actual);
-                }
-                if ($pixelTestFailed) {
-                    my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.checksum");
-                    writeToFile("$expectedFile", $actualHash);
-
-                    $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.png");
-                    writeToFile("$expectedFile", $actualPNG);
-                }
-                $message .= " (results generated in $platformTestDirectory)";
-            }
-        }
-
-        printFailureMessageForTest($test, $message);
-
-        my $dir = "$testResultsDirectory/$base";
-        $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
-        my $testName = $1;
-        mkpath $dir;
-
-        deleteExpectedAndActualResults($base);
-        recordActualResultsAndDiff($base, $actual);
-
-        if ($pixelTestFailed) {
-            $imagesPresent{$base} = 1;
-
-            writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG);
-            writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG);
-
-            my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-            copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png");
-
-            open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die;
-            print DIFFHTML "<html>\n";
-            print DIFFHTML "<head>\n";
-            print DIFFHTML "<title>$base Image Compare</title>\n";
-            print DIFFHTML "<script language=\"Javascript\" type=\"text/javascript\">\n";
-            print DIFFHTML "var currentImage = 0;\n";
-            print DIFFHTML "var imageNames = new Array(\"Actual\", \"Expected\");\n";
-            print DIFFHTML "var imagePaths = new Array(\"$testName-$actualTag.png\", \"$testName-$expectedTag.png\");\n";
-            if (-f "$testDirectory/$base-w3c.png") {
-                copy("$testDirectory/$base-w3c.png", "$testResultsDirectory/$base-w3c.png");
-                print DIFFHTML "imageNames.push(\"W3C\");\n";
-                print DIFFHTML "imagePaths.push(\"$testName-w3c.png\");\n";
-            }
-            print DIFFHTML "function animateImage() {\n";
-            print DIFFHTML "    var image = document.getElementById(\"animatedImage\");\n";
-            print DIFFHTML "    var imageText = document.getElementById(\"imageText\");\n";
-            print DIFFHTML "    image.src = imagePaths[currentImage];\n";
-            print DIFFHTML "    imageText.innerHTML = imageNames[currentImage] + \" Image\";\n";
-            print DIFFHTML "    currentImage = (currentImage + 1) % imageNames.length;\n";
-            print DIFFHTML "    setTimeout('animateImage()',2000);\n";
-            print DIFFHTML "}\n";
-            print DIFFHTML "</script>\n";
-            print DIFFHTML "</head>\n";
-            print DIFFHTML "<body onLoad=\"animateImage();\">\n";
-            print DIFFHTML "<table>\n";
-            if ($diffPercentage) {
-                print DIFFHTML "<tr>\n";
-                print DIFFHTML "<td>Difference between images: <a href=\"$testName-$diffsTag.png\">$diffPercentage%</a></td>\n";
-                print DIFFHTML "</tr>\n";
-            }
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">test file</a></td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td id=\"imageText\" style=\"text-weight: bold;\">Actual Image</td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td><img src=\"$testName-$actualTag.png\" id=\"animatedImage\"></td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "</table>\n";
-            print DIFFHTML "</body>\n";
-            print DIFFHTML "</html>\n";
-        }
-    }
-
-    if ($error) {
-        my $dir = "$testResultsDirectory/$base";
-        $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
-        mkpath $dir;
-        
-        writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
-        
-        $counts{error}++;
-        push @{$tests{error}}, $test;
-    }
-
-    countFinishedTest($test, $base, $result, $isText);
-
-    # --reset-results does not check pass vs. fail, so exitAfterNFailures makes no sense with --reset-results.
-    if ($exitAfterNFailures && !$resetResults) {
-        my $passCount = $counts{match} || 0; # $counts{match} will be undefined if we've not yet passed a test (e.g. the first test fails).
-        my $failureCount = $count - $passCount; # "Failure" here includes new tests, timeouts, crashes, etc.
-        if ($failureCount >= $exitAfterNFailures) {
-            print "\nExiting early after $failureCount failures. $count tests run.";
-            closeDumpTool();
-            last;
-        }
-    }
-}
-my $totalTestingTime = time - $overallStartTime;
-my $waitTime = getWaitTime();
-if ($waitTime > 0.1) {
-    my $normalizedTestingTime = $totalTestingTime - $waitTime;
-    printf "\n%0.2fs HTTPD waiting time\n", $waitTime . "";
-    printf "%0.2fs normalized testing time", $normalizedTestingTime . "";
-}
-printf "\n%0.2fs total testing time\n", $totalTestingTime . "";
-
-!$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
-
-$isHttpdOpen = !closeHTTPD();
-closeWebSocketServer();
-
-# Because multiple instances of this script are running concurrently we cannot 
-# safely delete this symlink.
-# system "rm /tmp/LayoutTests";
-
-# FIXME: Do we really want to check the image-comparison tool for leaks every time?
-if ($isDiffToolOpen && $shouldCheckLeaks) {
-    $totalLeaks += countAndPrintLeaks("ImageDiff", $imageDiffToolPID, "$testResultsDirectory/ImageDiff-leaks.txt");
-}
-
-if ($totalLeaks) {
-    if ($mergeDepth) {
-        parseLeaksandPrintUniqueLeaks();
-    } else { 
-        print "\nWARNING: $totalLeaks total leaks found!\n";
-        print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
-    }
-}
-
-close IN;
-close OUT;
-close ERROR;
-
-if ($report10Slowest) {
-    print "\n\nThe 10 slowest tests:\n\n";
-    my $count = 0;
-    for my $test (sort slowestcmp keys %durations) {
-        printf "%0.2f secs: %s\n", $durations{$test}, $test;
-        last if ++$count == 10;
-    }
-}
-
-print "\n";
-
-if ($skippedOnly && $counts{"match"}) {
-    print "The following tests are in the Skipped file (" . File::Spec->abs2rel("$platformTestDirectory/Skipped", $testDirectory) . "), but succeeded:\n";
-    foreach my $test (@{$tests{"match"}}) {
-        print "  $test\n";
-    }
-}
-
-if ($resetResults || ($counts{match} && $counts{match} == $count)) {
-    print "all $count test cases succeeded\n";
-    unlink $testResults;
-    exit;
-}
-
-printResults();
-
-mkpath $testResultsDirectory;
-
-open HTML, ">", $testResults or die "Failed to open $testResults. $!";
-print HTML "<html>\n";
-print HTML "<head>\n";
-print HTML "<title>Layout Test Results</title>\n";
-print HTML "</head>\n";
-print HTML "<body>\n";
-
-if ($ignoreMetrics) {
-    print HTML "<h4>Tested with metrics ignored.</h4>";
-}
-
-print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest);
-print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest);
-
-print HTML "</body>\n";
-print HTML "</html>\n";
-close HTML;
-
-my @configurationArgs = argumentsForConfiguration();
-
-if (isGtk()) {
-  system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isQt()) {
-  unshift @configurationArgs, qw(-graphicssystem raster -style windows);
-  if (isCygwin()) {
-    $testResults = "/" . toWindowsPath($testResults);
-    $testResults =~ s/\\/\//g;
-  }
-  system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isCygwin()) {
-  system "cygstart", $testResults if $launchSafari;
-} else {
-  system "WebKitTools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari;
-}
-
-closeCygpaths() if isCygwin();
-
-exit 1;
-
-sub countAndPrintLeaks($$$)
+sub runningOnBuildBot()
 {
-    my ($dumpToolName, $dumpToolPID, $leaksFilePath) = @_;
-
-    print "\n" unless $atLineStart;
-    $atLineStart = 1;
-
-    # We are excluding the following reported leaks so they don't get in our way when looking for WebKit leaks:
-    # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
-    # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
-    # fixed, it will be listed here until the bot has been updated with the newer frameworks.
-
-    my @typesToExclude = (
-    );
-
-    my @callStacksToExclude = (
-        "Flash_EnforceLocalSecurity" # leaks in Flash plug-in code, rdar://problem/4449747
-    );
-
-    if (isTiger()) {
-        # Leak list for the version of Tiger used on the build bot.
-        push @callStacksToExclude, (
-            "CFRunLoopRunSpecific \\| malloc_zone_malloc", "CFRunLoopRunSpecific \\| CFAllocatorAllocate ", # leak in CFRunLoopRunSpecific, rdar://problem/4670839
-            "CGImageSourceGetPropertiesAtIndex", # leak in ImageIO, rdar://problem/4628809
-            "FOGetCoveredUnicodeChars", # leak in ATS, rdar://problem/3943604
-            "GetLineDirectionPreference", "InitUnicodeUtilities", # leaks tool falsely reporting leak in CFNotificationCenterAddObserver, rdar://problem/4964790
-            "ICCFPrefWrapper::GetPrefDictionary", # leaks in Internet Config. code, rdar://problem/4449794
-            "NSHTTPURLProtocol setResponseHeader:", # leak in multipart/mixed-replace handling in Foundation, no Radar, but fixed in Leopard
-            "NSURLCache cachedResponseForRequest", # leak in CFURL cache, rdar://problem/4768430
-            "PCFragPrepareClosureFromFile", # leak in Code Fragment Manager, rdar://problem/3426998
-            "WebCore::Selection::toRange", # bug in 'leaks', rdar://problem/4967949
-            "WebCore::SubresourceLoader::create", # bug in 'leaks', rdar://problem/4985806
-            "_CFPreferencesDomainDeepCopyDictionary", # leak in CFPreferences, rdar://problem/4220786
-            "_objc_msgForward", # leak in NSSpellChecker, rdar://problem/4965278
-            "gldGetString", # leak in OpenGL, rdar://problem/5013699
-            "_setDefaultUserInfoFromURL", # leak in NSHTTPAuthenticator, rdar://problem/5546453 
-            "SSLHandshake", # leak in SSL, rdar://problem/5546440 
-            "SecCertificateCreateFromData", # leak in SSL code, rdar://problem/4464397
-        );
-        push @typesToExclude, (
-            "THRD", # bug in 'leaks', rdar://problem/3387783
-            "DRHT", # ditto (endian little hate i)
-        );
-    }
-
-    if (isLeopard()) {
-        # Leak list for the version of Leopard used on the build bot.
-        push @callStacksToExclude, (
-            "CFHTTPMessageAppendBytes", # leak in CFNetwork, rdar://problem/5435912
-            "sendDidReceiveDataCallback", # leak in CFNetwork, rdar://problem/5441619
-            "_CFHTTPReadStreamReadMark", # leak in CFNetwork, rdar://problem/5441468
-            "httpProtocolStart", # leak in CFNetwork, rdar://problem/5468837
-            "_CFURLConnectionSendCallbacks", # leak in CFNetwork, rdar://problem/5441600
-            "DispatchQTMsg", # leak in QuickTime, PPC only, rdar://problem/5667132
-            "QTMovieContentView createVisualContext", # leak in QuickTime, PPC only, rdar://problem/5667132
-            "_CopyArchitecturesForJVMVersion", # leak in Java, rdar://problem/5910823
-        );
-    }
-
-    if (isSnowLeopard()) {
-        push @callStacksToExclude, (
-            "readMakerNoteProps", # <rdar://problem/7156432> leak in ImageIO
-            "QTKitMovieControllerView completeUISetup", # <rdar://problem/7155156> leak in QTKit
-        );
-    }
-
-    my $leaksTool = sourceDir() . "/WebKitTools/Scripts/run-leaks";
-    my $excludeString = "--exclude-callstack '" . (join "' --exclude-callstack '", @callStacksToExclude) . "'";
-    $excludeString .= " --exclude-type '" . (join "' --exclude-type '", @typesToExclude) . "'" if @typesToExclude;
-
-    print " ? checking for leaks in $dumpToolName\n";
-    my $leaksOutput = `$leaksTool $excludeString $dumpToolPID`;
-    my ($count, $bytes) = $leaksOutput =~ /Process $dumpToolPID: (\d+) leaks? for (\d+) total/;
-    my ($excluded) = $leaksOutput =~ /(\d+) leaks? excluded/;
-
-    my $adjustedCount = $count;
-    $adjustedCount -= $excluded if $excluded;
-
-    if (!$adjustedCount) {
-        print " - no leaks found\n";
-        unlink $leaksFilePath;
-        return 0;
-    } else {
-        my $dir = $leaksFilePath;
-        $dir =~ s|/[^/]+$|| or die;
-        mkpath $dir;
-
-        if ($excluded) {
-            print " + $adjustedCount leaks ($bytes bytes including $excluded excluded leaks) were found, details in $leaksFilePath\n";
-        } else {
-            print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n";
-        }
-
-        writeToFile($leaksFilePath, $leaksOutput);
-        
-        push @leaksFilenames, $leaksFilePath;
-    }
-
-    return $adjustedCount;
+    # This is a hack to detect if we're running on the buildbot so we can
+    # pass --verbose to new-run-webkit-tests.  This will be removed when we
+    # update the buildbot config to call new-run-webkit-tests explicitly.
+    my %isBuildBotUser = ("apple" => 1, "buildbot" => 1);
+    return $isBuildBotUser{$ENV{"USER"}};
 }
 
-sub writeToFile($$)
+sub useNewRunWebKitTests()
 {
-    my ($filePath, $contents) = @_;
-    open NEWFILE, ">", "$filePath" or die "Could not create $filePath. $!\n";
-    print NEWFILE $contents;
-    close NEWFILE;
-}
-
-# Break up a path into the directory (with slash) and base name.
-sub splitpath($)
-{
-    my ($path) = @_;
-
-    my $pathSeparator = "/";
-    my $dirname = dirname($path) . $pathSeparator;
-    $dirname = "" if $dirname eq "." . $pathSeparator;
-
-    return ($dirname, basename($path));
-}
-
-# Sort first by directory, then by file, so all paths in one directory are grouped
-# rather than being interspersed with items from subdirectories.
-# Use numericcmp to sort directory and filenames to make order logical.
-sub pathcmp($$)
-{
-    my ($patha, $pathb) = @_;
-
-    my ($dira, $namea) = splitpath($patha);
-    my ($dirb, $nameb) = splitpath($pathb);
-
-    return numericcmp($dira, $dirb) if $dira ne $dirb;
-    return numericcmp($namea, $nameb);
-}
-
-# Sort numeric parts of strings as numbers, other parts as strings.
-# Makes 1.33 come after 1.3, which is cool.
-sub numericcmp($$)
-{
-    my ($aa, $bb) = @_;
-
-    my @a = split /(\d+)/, $aa;
-    my @b = split /(\d+)/, $bb;
-
-    # Compare one chunk at a time.
-    # Each chunk is either all numeric digits, or all not numeric digits.
-    while (@a && @b) {
-        my $a = shift @a;
-        my $b = shift @b;
-        
-        # Use numeric comparison if chunks are non-equal numbers.
-        return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
-
-        # Use string comparison if chunks are any other kind of non-equal string.
-        return $a cmp $b if $a ne $b;
-    }
-    
-    # One of the two is now empty; compare lengths for result in this case.
-    return @a <=> @b;
-}
-
-# Sort slowest tests first.
-sub slowestcmp($$)
-{
-    my ($testa, $testb) = @_;
-
-    my $dura = $durations{$testa};
-    my $durb = $durations{$testb};
-    return $durb <=> $dura if $dura != $durb;
-    return pathcmp($testa, $testb);
-}
-
-sub launchWithEnv(\@\%)
-{
-    my ($args, $env) = @_;
-
-    # Dump the current environment as perl code and then put it in quotes so it is one parameter.
-    my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]);
-    $environmentDumper->Indent(0);
-    $environmentDumper->Purity(1);
-    my $allEnvVars = $environmentDumper->Dump();
-    unshift @{$args}, "\"$allEnvVars\"";
-
-    my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv));
-    unshift @{$args}, $execScript;
-    return @{$args};
-}
-
-sub resolveAndMakeTestResultsDirectory()
-{
-    my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
-    mkpath $absTestResultsDirectory;
-    return $absTestResultsDirectory;
-}
-
-sub openDiffTool()
-{
-    return if $isDiffToolOpen;
-    return if !$pixelTests;
-
-    my %CLEAN_ENV;
-    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
-    $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n";
-    $isDiffToolOpen = 1;
-}
-
-sub openDumpTool()
-{
-    return if $isDumpToolOpen;
-
-    my %CLEAN_ENV;
-
-    # Generic environment variables
-    if (defined $ENV{'WEBKIT_TESTFONTS'}) {
-        $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'};
-    }
-
-    $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
-
-    # Platform spesifics
-    if (isLinux()) {
-        if (defined $ENV{'DISPLAY'}) {
-            $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'};
-        } else {
-            $CLEAN_ENV{DISPLAY} = ":1";
-        }
-        if (defined $ENV{'XAUTHORITY'}) {
-            $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'};
-        }
-
-        $CLEAN_ENV{HOME} = $ENV{'HOME'};
-
-        if (defined $ENV{'LD_LIBRARY_PATH'}) {
-            $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'};
-        }
-        if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) {
-            $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
-        }
-    } elsif (isDarwin()) {
-        if (defined $ENV{'DYLD_LIBRARY_PATH'}) {
-            $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'};
-        }
-
-        $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-        $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-    } elsif (isCygwin()) {
-        $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
-        $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
-
-        setPathForRunningWebKitApp(\%CLEAN_ENV);
-    }
-
-    # Port spesifics
-    if (isQt()) {
-        $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins";
-    }
-    
-    my @args = ($dumpTool, @toolArgs);
-    if (isAppleMacWebKit() and !isTiger()) { 
-        unshift @args, "arch", "-" . architecture();             
-    }
-
-    if ($useValgrind) {
-        unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors";
-    } 
-
-    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
-
-    $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n";
-    $isDumpToolOpen = 1;
-    $dumpToolCrashed = 0;
-}
-
-sub closeDumpTool()
-{
-    return if !$isDumpToolOpen;
-
-    close IN;
-    close OUT;
-    waitpid $dumpToolPID, 0;
-    
-    # check for WebCore counter leaks.
-    if ($shouldCheckLeaks) {
-        while (<ERROR>) {
-            print;
-        }
-    }
-    close ERROR;
-    $isDumpToolOpen = 0;
-}
-
-sub dumpToolDidCrash()
-{
-    return 1 if $dumpToolCrashed;
-    return 0 unless $isDumpToolOpen;
-    my $pid = waitpid(-1, WNOHANG);
-    return 1 if ($pid == $dumpToolPID);
-
-    # On Mac OS X, crashing may be significantly delayed by crash reporter.
-    return 0 unless isAppleMacWebKit();
-
-    return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
-}
-
-sub configureAndOpenHTTPDIfNeeded()
-{
-    return if $isHttpdOpen;
-    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
-    my $listen = "127.0.0.1:$httpdPort";
-    my @args = (
-        "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
-        "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
-        "-C", "Listen $listen"
-    );
-
-    my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
-    @args = (@defaultArgs, @args);
-
-    waitForHTTPDLock() if $shouldWaitForHTTPD;
-    $isHttpdOpen = openHTTPD(@args);
-}
-
-sub openWebSocketServerIfNeeded()
-{
-    return 1 if $isWebSocketServerOpen;
-    return 0 if $failedToStartWebSocketServer;
-
-    my $webSocketServerPath = "/usr/bin/python";
-    my $webSocketPythonPath = "WebKitTools/pywebsocket";
-    my $webSocketHandlerDir = "$testDirectory";
-    my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
-    my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt";
-    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
-    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
-    my $logFile = "$absTestResultsDirectory/pywebsocket_log.txt";
-
-    my @args = (
-        "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
-        "-p", "$webSocketPort",
-        "-d", "$webSocketHandlerDir",
-        "-s", "$webSocketHandlerScanDir",
-        "-m", "$webSocketHandlerMapFile",
-        "-x", "/websocket/tests/cookies",
-        "-l", "$logFile",
-        "--strict",
-    );
-    # wss is disabled until all platforms support pyOpenSSL.
-    # my @argsSecure = (
-    #     "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
-    #     "-p", "$webSocketSecurePort",
-    #     "-d", "$webSocketHandlerDir",
-    #     "-t",
-    #     "-k", "$sslCertificate",
-    #     "-c", "$sslCertificate",
-    # );
-
-    $ENV{"PYTHONPATH"} = $webSocketPythonPath;
-    $webSocketServerPID = open3(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, \*WEBSOCKETSERVER_ERR, $webSocketServerPath, @args);
-    # wss is disabled until all platforms support pyOpenSSL.
-    # $webSocketSecureServerPID = open3(\*WEBSOCKETSECURESERVER_IN, \*WEBSOCKETSECURESERVER_OUT, \*WEBSOCKETSECURESERVER_ERR, $webSocketServerPath, @argsSecure);
-    # my @listen = ("http://127.0.0.1:$webSocketPort", "https://127.0.0.1:$webSocketSecurePort");
-    my @listen = ("http://127.0.0.1:$webSocketPort");
-    for (my $i = 0; $i < @listen; $i++) {
-        my $retryCount = 10;
-        while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen[$i]") && $retryCount) {
-            sleep 1;
-            --$retryCount;
-        }
-        unless ($retryCount) {
-            print STDERR "Timed out waiting for WebSocketServer to start.\n";
-            $failedToStartWebSocketServer = 1;
-            return 0;
-        }
-    }
-
-    $isWebSocketServerOpen = 1;
-    return 1;
-}
-
-sub closeWebSocketServer()
-{
-    return if !$isWebSocketServerOpen;
-
-    close WEBSOCKETSERVER_IN;
-    close WEBSOCKETSERVER_OUT;
-    close WEBSOCKETSERVER_ERR;
-    kill 15, $webSocketServerPID;
-
-    # wss is disabled until all platforms support pyOpenSSL.
-    # close WEBSOCKETSECURESERVER_IN;
-    # close WEBSOCKETSECURESERVER_OUT;
-    # close WEBSOCKETSECURESERVER_ERR;
-    # kill 15, $webSocketSecureServerPID;
-
-    $isWebSocketServerOpen = 0;
-}
-
-sub fileNameWithNumber($$)
-{
-    my ($base, $number) = @_;
-    return "$base$number" if ($number > 1);
-    return $base;
-}
-
-sub processIgnoreTests($$)
-{
-    my @ignoreList = split(/\s*,\s*/, shift);
-    my $listName = shift;
-
-    my $disabledSuffix = "-disabled";
-
-    my $addIgnoredDirectories = sub {
-        return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
-        $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)} = 1;
-        return @_;
-    };
-    foreach my $item (@ignoreList) {
-        my $path = catfile($testDirectory, $item); 
-        if (-d $path) {
-            $ignoredDirectories{$item} = 1;
-            find({ preprocess => $addIgnoredDirectories, wanted => sub {} }, $path);
-        }
-        elsif (-f $path) {
-            $ignoredFiles{$item} = 1;
-        } elsif (-f $path . $disabledSuffix) {
-            # The test is disabled, so do nothing.
-        } else {
-            print "$listName list contained '$item', but no file of that name could be found\n";
-        }
-    }
-}
-
-sub stripExtension($)
-{
-    my ($test) = @_;
-
-    $test =~ s/\.[a-zA-Z]+$//;
-    return $test;
-}
-
-sub isTextOnlyTest($)
-{
-    my ($actual) = @_;
-    my $isText;
-    if ($actual =~ /^layer at/ms) {
-        $isText = 0;
-    } else {
-        $isText = 1;
-    }
-    return $isText;
-}
-
-sub expectedDirectoryForTest($;$;$)
-{
-    my ($base, $isText, $expectedExtension) = @_;
-
-    my @directories = @platformResultHierarchy;
-    push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if isCygwin();
-    push @directories, $expectedDirectory;
-
-    # If we already have expected results, just return their location.
-    foreach my $directory (@directories) {
-        return $directory if (-f "$directory/$base-$expectedTag.$expectedExtension");
-    }
-
-    # For cross-platform tests, text-only results should go in the cross-platform directory,
-    # while render tree dumps should go in the least-specific platform directory.
-    return $isText ? $expectedDirectory : $platformResultHierarchy[$#platformResultHierarchy];
-}
-
-sub countFinishedTest($$$$)
-{
-    my ($test, $base, $result, $isText) = @_;
-
-    if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) {
-        if ($shouldCheckLeaks) {
-            my $fileName;
-            if ($testsPerDumpTool == 1) {
-                $fileName = "$testResultsDirectory/$base-leaks.txt";
-            } else {
-                $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt";
-            }
-            my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName);
-            $totalLeaks += $leakCount;
-            $leaksOutputFileNumber++ if ($leakCount);
-        }
-
-        closeDumpTool();
-    }
-    
-    $count++;
-    $counts{$result}++;
-    push @{$tests{$result}}, $test;
-}
-
-sub testCrashedOrTimedOut($$$$$)
-{
-    my ($test, $base, $didCrash, $actual, $error) = @_;
-
-    printFailureMessageForTest($test, $didCrash ? "crashed" : "timed out");
-
-    sampleDumpTool() unless $didCrash;
-
-    my $dir = "$testResultsDirectory/$base";
-    $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
-    mkpath $dir;
-
-    deleteExpectedAndActualResults($base);
-
-    if (defined($error) && length($error)) {
-        writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
-    }
-
-    recordActualResultsAndDiff($base, $actual);
-
-    kill 9, $dumpToolPID unless $didCrash;
-
-    closeDumpTool();
-}
-
-sub printFailureMessageForTest($$)
-{
-    my ($test, $description) = @_;
-
-    unless ($verbose) {
-        print "\n" unless $atLineStart;
-        print "$test -> ";
-    }
-    print "$description\n";
-    $atLineStart = 1;
-}
-
-my %cygpaths = ();
-
-sub openCygpathIfNeeded($)
-{
-    my ($options) = @_;
-
-    return unless isCygwin();
-    return $cygpaths{$options} if $cygpaths{$options} && $cygpaths{$options}->{"open"};
-
-    local (*CYGPATHIN, *CYGPATHOUT);
-    my $pid = open2(\*CYGPATHIN, \*CYGPATHOUT, "cygpath -f - $options");
-    my $cygpath =  {
-        "pid" => $pid,
-        "in" => *CYGPATHIN,
-        "out" => *CYGPATHOUT,
-        "open" => 1
-    };
-
-    $cygpaths{$options} = $cygpath;
-
-    return $cygpath;
-}
-
-sub closeCygpaths()
-{
-    return unless isCygwin();
-
-    foreach my $cygpath (values(%cygpaths)) {
-        close $cygpath->{"in"};
-        close $cygpath->{"out"};
-        waitpid($cygpath->{"pid"}, 0);
-        $cygpath->{"open"} = 0;
-
-    }
-}
-
-sub convertPathUsingCygpath($$)
-{
-    my ($path, $options) = @_;
-
-    my $cygpath = openCygpathIfNeeded($options);
-    local *inFH = $cygpath->{"in"};
-    local *outFH = $cygpath->{"out"};
-    print outFH $path . "\n";
-    my $convertedPath = <inFH>;
-    chomp($convertedPath) if defined $convertedPath;
-    return $convertedPath;
-}
-
-sub toWindowsPath($)
-{
-    my ($path) = @_;
-    return unless isCygwin();
-
-    return convertPathUsingCygpath($path, "-w");
-}
-
-sub toURL($)
-{
-    my ($path) = @_;
-
-    if ($useRemoteLinksToTests) {
-        my $relativePath = File::Spec->abs2rel($path, $testDirectory);
-
-        # If the file is below the test directory then convert it into a link to the file in SVN
-        if ($relativePath !~ /^\.\.\//) {
-            my $revision = svnRevisionForDirectory($testDirectory);
-            my $svnPath = pathRelativeToSVNRepositoryRootForPath($path);
-            return "http://trac.webkit.org/export/$revision/$svnPath";
-        }
-    }
-
-    return $path unless isCygwin();
-
-    return "file:///" . convertPathUsingCygpath($path, "-m");
-}
-
-sub validateSkippedArg($$;$)
-{
-    my ($option, $value, $value2) = @_;
-    my %validSkippedValues = map { $_ => 1 } qw(default ignore only);
-    $value = lc($value);
-    die "Invalid argument '" . $value . "' for option $option" unless $validSkippedValues{$value};
-    $treatSkipped = $value;
-}
-
-sub htmlForResultsSection(\@$&)
-{
-    my ($tests, $description, $linkGetter) = @_;
-
-    my @html = ();
-    return join("\n", @html) unless @{$tests};
-
-    push @html, "<p>$description:</p>";
-    push @html, "<table>";
-    foreach my $test (@{$tests}) {
-        push @html, "<tr>";
-        push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
-        foreach my $link (@{&{$linkGetter}($test)}) {
-            push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>";
-        }
-        push @html, "</tr>";
-    }
-    push @html, "</table>";
-
-    return join("\n", @html);
-}
-
-sub linksForExpectedAndActualResults($)
-{
-    my ($base) = @_;
-
-    my @links = ();
-
-    return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt";
-    
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
-    push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" };
-    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" };
-    push @links, { href => "$base-$diffsTag.txt", text => "diff" };
-    push @links, { href => "$base-$prettyDiffTag.html", text => "pretty diff" };
-
-    return \@links;
-}
-
-sub linksForMismatchTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    push @links, @{linksForExpectedAndActualResults($base)};
-    return \@links unless $pixelTests && $imagesPresent{$base};
-
-    push @links, { href => "$base-$expectedTag.png", text => "expected image" };
-    push @links, { href => "$base-$diffsTag.html", text => "image diffs" };
-    push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" };
-
-    return \@links;
-}
-
-sub linksForErrorTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    push @links, @{linksForExpectedAndActualResults($base)};
-    push @links, { href => "$base-$errorTag.txt", text => "stderr" };
-
-    return \@links;
-}
-
-sub linksForNewTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
-    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
-    if ($pixelTests && $imagesPresent{$base}) {
-        push @links, { href => "$base-$expectedTag.png", text => "image" };
-    }
-
-    return \@links;
-}
-
-sub deleteExpectedAndActualResults($)
-{
-    my ($base) = @_;
-
-    unlink "$testResultsDirectory/$base-$actualTag.txt";
-    unlink "$testResultsDirectory/$base-$diffsTag.txt";
-    unlink "$testResultsDirectory/$base-$errorTag.txt";
-}
-
-sub recordActualResultsAndDiff($$)
-{
-    my ($base, $actualResults) = @_;
-
-    return unless defined($actualResults) && length($actualResults);
-
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-    my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension";
-    my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension";
-
-    mkpath(dirname($actualResultsPath));
-    writeToFile("$actualResultsPath", $actualResults);
-
-    if (-f $expectedResultPath) {
-        copy("$expectedResultPath", "$copiedExpectedResultsPath");
-    } else {
-        open EMPTY, ">$copiedExpectedResultsPath";
-        close EMPTY;
-    }
-
-    my $diffOuputBasePath = "$testResultsDirectory/$base";
-    my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
-    system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\"";
-
-    my $prettyDiffOutputPath = "$diffOuputBasePath-$prettyDiffTag.html";
-    my $prettyPatchPath = "BugsSite/PrettyPatch/";
-    my $prettifyPath = "$prettyPatchPath/prettify.rb";
-    system "ruby -I \"$prettyPatchPath\" \"$prettifyPath\" \"$diffOutputPath\" > \"$prettyDiffOutputPath\"";
-}
-
-sub buildPlatformResultHierarchy()
-{
-    mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory");
-
-    my @platforms;
-    if ($platform =~ /^mac-/) {
-        my $i;
-        for ($i = 0; $i < @macPlatforms; $i++) {
-            last if $macPlatforms[$i] eq $platform;
-        }
-        for (; $i < @macPlatforms; $i++) {
-            push @platforms, $macPlatforms[$i];
-        }
-    } elsif ($platform =~ /^qt-/) {
-        push @platforms, $platform;
-        push @platforms, "qt";
-    } else {
-        @platforms = $platform;
-    }
-
-    my @hierarchy;
-    for (my $i = 0; $i < @platforms; $i++) {
-        my $scoped = catdir($platformBaseDirectory, $platforms[$i]);
-        push(@hierarchy, $scoped) if (-d $scoped);
-    }
-
-    return @hierarchy;
-}
-
-sub buildPlatformTestHierarchy(@)
-{
-    my (@platformHierarchy) = @_;
-    return @platformHierarchy if (@platformHierarchy < 2);
-
-    return ($platformHierarchy[0], $platformHierarchy[$#platformHierarchy]);
-}
-
-sub epiloguesAndPrologues($$)
-{
-    my ($lastDirectory, $directory) = @_;
-    my @lastComponents = split('/', $lastDirectory);
-    my @components = split('/', $directory);
-
-    while (@lastComponents) {
-        if (!defined($components[0]) || $lastComponents[0] ne $components[0]) {
-            last;
-        }
-        shift @components;
-        shift @lastComponents;
-    }
-
-    my @result;
-    my $leaving = $lastDirectory;
-    foreach (@lastComponents) {
-        my $epilogue = $leaving . "/resources/run-webkit-tests-epilogue.html";
-        foreach (@platformResultHierarchy) {
-            push @result, catdir($_, $epilogue) if (stat(catdir($_, $epilogue)));
-        }
-        push @result, catdir($testDirectory, $epilogue) if (stat(catdir($testDirectory, $epilogue)));
-        $leaving =~ s|(^\|/)[^/]+$||;
-    }
-
-    my $entering = $leaving;
-    foreach (@components) {
-        $entering .= '/' . $_;
-        my $prologue = $entering . "/resources/run-webkit-tests-prologue.html";
-        push @result, catdir($testDirectory, $prologue) if (stat(catdir($testDirectory, $prologue)));
-        foreach (reverse @platformResultHierarchy) {
-            push @result, catdir($_, $prologue) if (stat(catdir($_, $prologue)));
-        }
-    }
-    return @result;
-}
-    
-sub parseLeaksandPrintUniqueLeaks()
-{
-    return unless @leaksFilenames;
-     
-    my $mergedFilenames = join " ", @leaksFilenames;
-    my $parseMallocHistoryTool = sourceDir() . "/WebKitTools/Scripts/parse-malloc-history";
-    
-    open MERGED_LEAKS, "cat $mergedFilenames | $parseMallocHistoryTool --merge-depth $mergeDepth  - |" ;
-    my @leakLines = <MERGED_LEAKS>;
-    close MERGED_LEAKS;
-    
-    my $uniqueLeakCount = 0;
-    my $totalBytes;
-    foreach my $line (@leakLines) {
-        ++$uniqueLeakCount if ($line =~ /^(\d*)\scalls/);
-        $totalBytes = $1 if $line =~ /^total\:\s(.*)\s\(/;
-    }
-    
-    print "\nWARNING: $totalLeaks total leaks found for a total of $totalBytes!\n";
-    print "WARNING: $uniqueLeakCount unique leaks found!\n";
-    print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
-    
-}
-
-sub extensionForMimeType($)
-{
-    my ($mimeType) = @_;
-
-    if ($mimeType eq "application/x-webarchive") {
-        return "webarchive";
-    } elsif ($mimeType eq "application/pdf") {
-        return "pdf";
-    }
-    return "txt";
-}
-
-# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts.
-sub readFromDumpToolWithTimer(**)
-{
-    my ($fhIn, $fhError) = @_;
-
-    setFileHandleNonBlocking($fhIn, 1);
-    setFileHandleNonBlocking($fhError, 1);
-
-    my $maximumSecondsWithoutOutput = $timeoutSeconds;
-    $maximumSecondsWithoutOutput *= 10 if $guardMalloc;
-    my $microsecondsToWaitBeforeReadingAgain = 1000;
-
-    my $timeOfLastSuccessfulRead = time;
-
-    my @output = ();
-    my @error = ();
-    my $status = "success";
-    my $mimeType = "text/plain";
-    # We don't have a very good way to know when the "headers" stop
-    # and the content starts, so we use this as a hack:
-    my $haveSeenContentType = 0;
-    my $haveSeenEofIn = 0;
-    my $haveSeenEofError = 0;
-
-    while (1) {
-        if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) {
-            $status = dumpToolDidCrash() ? "crashed" : "timedOut";
-            last;
-        }
-
-        # Once we've seen the EOF, we must not read anymore.
-        my $lineIn = readline($fhIn) unless $haveSeenEofIn;
-        my $lineError = readline($fhError) unless $haveSeenEofError;
-        if (!defined($lineIn) && !defined($lineError)) {
-            last if ($haveSeenEofIn && $haveSeenEofError);
-
-            if ($! != EAGAIN) {
-                $status = "crashed";
-                last;
-            }
-
-            # No data ready
-            usleep($microsecondsToWaitBeforeReadingAgain);
-            next;
-        }
-
-        $timeOfLastSuccessfulRead = time;
-
-        if (defined($lineIn)) {
-            if (!$haveSeenContentType && $lineIn =~ /^Content-Type: (\S+)$/) {
-                $mimeType = $1;
-                $haveSeenContentType = 1;
-            } elsif ($lineIn =~ /#EOF/) {
-                $haveSeenEofIn = 1;
-            } else {
-                push @output, $lineIn;
-            }
-        }
-        if (defined($lineError)) {
-            if ($lineError =~ /#EOF/) {
-                $haveSeenEofError = 1;
-            } else {
-                push @error, $lineError;
-            }
-        }
-    }
-
-    setFileHandleNonBlocking($fhIn, 0);
-    setFileHandleNonBlocking($fhError, 0);
-    return {
-        output => join("", @output),
-        error => join("", @error),
-        status => $status,
-        mimeType => $mimeType,
-        extension => extensionForMimeType($mimeType)
-    };
-}
-
-sub setFileHandleNonBlocking(*$)
-{
-    my ($fh, $nonBlocking) = @_;
-
-    my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags";
-
-    if ($nonBlocking) {
-        $flags |= O_NONBLOCK;
-    } else {
-        $flags &= ~O_NONBLOCK;
-    }
-
-    fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags";
-
-    return 1;
-}
-
-sub sampleDumpTool()
-{
-    return unless isAppleMacWebKit();
-    return unless $runSample;
-
-    my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree";
-    -d $outputDirectory or mkdir $outputDirectory;
-
-    my $outputFile = "$outputDirectory/HangReport.txt";
-    system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile;
-}
-
-sub stripMetrics($$)
-{
-    my ($actual, $expected) = @_;
-
-    foreach my $result ($actual, $expected) {
-        $result =~ s/at \(-?[0-9]+,-?[0-9]+\) *//g;
-        $result =~ s/size -?[0-9]+x-?[0-9]+ *//g;
-        $result =~ s/text run width -?[0-9]+: //g;
-        $result =~ s/text run width -?[0-9]+ [a-zA-Z ]+: //g;
-        $result =~ s/RenderButton {BUTTON} .*/RenderButton {BUTTON}/g;
-        $result =~ s/RenderImage {INPUT} .*/RenderImage {INPUT}/g;
-        $result =~ s/RenderBlock {INPUT} .*/RenderBlock {INPUT}/g;
-        $result =~ s/RenderTextControl {INPUT} .*/RenderTextControl {INPUT}/g;
-        $result =~ s/\([0-9]+px/px/g;
-        $result =~ s/ *" *\n +" */ /g;
-        $result =~ s/" +$/"/g;
-
-        $result =~ s/- /-/g;
-        $result =~ s/\n( *)"\s+/\n$1"/g;
-        $result =~ s/\s+"\n/"\n/g;
-        $result =~ s/scrollWidth [0-9]+/scrollWidth/g;
-        $result =~ s/scrollHeight [0-9]+/scrollHeight/g;
-    }
-
-    return ($actual, $expected);
-}
-
-sub fileShouldBeIgnored
-{
-    my ($filePath) = @_;
-    foreach my $ignoredDir (keys %ignoredDirectories) {
-        if ($filePath =~ m/^$ignoredDir/) {
-            return 1;
-        }
-    }
+    # Change this check to control which platforms use
+    # new-run-webkit-tests by default.
     return 0;
 }
 
-sub readSkippedFiles($)
-{
-    my ($constraintPath) = @_;
+my $harnessName = "old-run-webkit-tests";
 
-    foreach my $level (@platformTestHierarchy) {
-        if (open SKIPPED, "<", "$level/Skipped") {
-            if ($verbose) {
-                my ($dir, $name) = splitpath($level);
-                print "Skipped tests in $name:\n";
-            }
-
-            while (<SKIPPED>) {
-                my $skipped = $_;
-                chomp $skipped;
-                $skipped =~ s/^[ \n\r]+//;
-                $skipped =~ s/[ \n\r]+$//;
-                if ($skipped && $skipped !~ /^#/) {
-                    if ($skippedOnly) {
-                        if (!fileShouldBeIgnored($skipped)) {
-                            if (!$constraintPath) {
-                                # Always add $skipped since no constraint path was specified on the command line.
-                                push(@ARGV, $skipped);
-                            } elsif ($skipped =~ /^($constraintPath)/) {
-                                # Add $skipped only if it matches the current path constraint, e.g.,
-                                # "--skipped=only dir1" with "dir1/file1.html" on the skipped list.
-                                push(@ARGV, $skipped);
-                            } elsif ($constraintPath =~ /^($skipped)/) {
-                                # Add current path constraint if it is more specific than the skip list entry,
-                                # e.g., "--skipped=only dir1/dir2/dir3" with "dir1" on the skipped list.
-                                push(@ARGV, $constraintPath);
-                            }
-                        } elsif ($verbose) {
-                            print "    $skipped\n";
-                        }
-                    } else {
-                        if ($verbose) {
-                            print "    $skipped\n";
-                        }
-                        processIgnoreTests($skipped, "Skipped");
-                    }
-                }
-            }
-            close SKIPPED;
-        }
+if (useNewRunWebKitTests()) {
+    $harnessName = "new-run-webkit-tests";
+    if (runningOnBuildBot()) {
+        push(@ARGV, "--verbose");
+        # old-run-webkit-tests treats --results-directory as $CWD relative.
+        # new-run-webkit-tests treats --results-directory as build directory relative.
+        # Override the passed in --results-directory by appending a new one
+        # (later arguments override earlier ones in Python's optparse).
+        push(@ARGV, "--results-directory");
+        # The buildbot always uses $SRCDIR/layout-test-results, hardcode it:
+        push(@ARGV, sourceDir() . "/layout-test-results");
     }
 }
 
-my @testsToRun;
-
-sub directoryFilter
-{
-    return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
-    return () if exists $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)};
-    return @_;
-}
-
-sub fileFilter
-{
-    my $filename = $_;
-    if ($filename =~ /\.([^.]+)$/) {
-        if (exists $supportedFileExtensions{$1}) {
-            my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testDirectory);
-            push @testsToRun, $path if !exists $ignoredFiles{$path};
-        }
-    }
-}
-
-sub findTestsToRun
-{
-    @testsToRun = ();
-
-    for my $test (@ARGV) {
-        $test =~ s/^($layoutTestsName|$testDirectory)\///;
-        my $fullPath = catfile($testDirectory, $test);
-        if (file_name_is_absolute($test)) {
-            print "can't run test $test outside $testDirectory\n";
-        } elsif (-f $fullPath) {
-            my ($filename, $pathname, $fileExtension) = fileparse($test, qr{\.[^.]+$});
-            if (!exists $supportedFileExtensions{substr($fileExtension, 1)}) {
-                print "test $test does not have a supported extension\n";
-            } elsif ($testHTTP || $pathname !~ /^http\//) {
-                push @testsToRun, $test;
-            }
-        } elsif (-d $fullPath) {
-            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $fullPath);
-            for my $level (@platformTestHierarchy) {
-                my $platformPath = catfile($level, $test);
-                find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $platformPath) if (-d $platformPath);
-            }
-        } else {
-            print "test $test not found\n";
-        }
-    }
-
-    if (!scalar @ARGV) {
-        find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testDirectory);
-        for my $level (@platformTestHierarchy) {
-            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $level);
-        }
-    }
-
-    # Remove duplicate tests
-    @testsToRun = keys %{{ map { $_ => 1 } @testsToRun }};
-
-    @testsToRun = sort pathcmp @testsToRun;
-
-    # We need to minimize the time when Apache and WebSocketServer is locked by tests
-    # so run them last if no explicit order was specified in the argument list.
-    if (!scalar @ARGV) {
-        my @httpTests;
-        my @websocketTests;
-        my @otherTests;
-        foreach my $test (@testsToRun) {
-            if ($test =~ /^http\//) {
-                push(@httpTests, $test);
-            } elsif ($test =~ /^websocket\//) {
-                push(@websocketTests, $test);
-            } else {
-                push(@otherTests, $test);
-            }
-        }
-        @testsToRun = (@otherTests, @httpTests, @websocketTests);
-    }
-
-    # Reverse the tests
-    @testsToRun = reverse @testsToRun if $reverseTests;
-
-    # Shuffle the array
-    @testsToRun = shuffle(@testsToRun) if $randomizeTests;
-
-    return @testsToRun;
-}
-
-sub printResults
-{
-    my %text = (
-        match => "succeeded",
-        mismatch => "had incorrect layout",
-        new => "were new",
-        timedout => "timed out",
-        crash => "crashed",
-        error => "had stderr output"
-    );
-
-    for my $type ("match", "mismatch", "new", "timedout", "crash", "error") {
-        my $typeCount = $counts{$type};
-        next unless $typeCount;
-        my $typeText = $text{$type};
-        my $message;
-        if ($typeCount == 1) {
-            $typeText =~ s/were/was/;
-            $message = sprintf "1 test case (%d%%) %s\n", 1 * 100 / $count, $typeText;
-        } else {
-            $message = sprintf "%d test cases (%d%%) %s\n", $typeCount, $typeCount * 100 / $count, $typeText;
-        }
-        $message =~ s-\(0%\)-(<1%)-;
-        print $message;
-    }
-}
+my $harnessPath = sprintf("%s/%s", relativeScriptsDir(), $harnessName);
+exec $harnessPath ($harnessPath, @ARGV) or die "Failed to execute $harnessPath";
diff --git a/WebKitTools/Scripts/run-webkit-websocketserver b/WebKitTools/Scripts/run-webkit-websocketserver
index 64a724d..06f9079 100755
--- a/WebKitTools/Scripts/run-webkit-websocketserver
+++ b/WebKitTools/Scripts/run-webkit-websocketserver
@@ -64,18 +64,19 @@
 sub openWebSocketServer()
 {
     my $webSocketServerPath = "/usr/bin/python";
-    my $webSocketPythonPath = "$srcDir/WebKitTools/pywebsocket";
+    my $webSocketPythonPath = "$srcDir/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket";
     my $webSocketHandlerDir = "$testDirectory";
     my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
     my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt";
 
     my @args = (
-        "$srcDir/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
-        "-p", "$webSocketPort",
-        "-d", "$webSocketHandlerDir",
-        "-s", "$webSocketHandlerScanDir",
-        "-m", "$webSocketHandlerMapFile",
-        "-x", "/websocket/tests/cookies",
+        "$srcDir/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py",
+        "--server-host", "127.0.0.1",
+        "--port", "$webSocketPort",
+        "--document-root", "$webSocketHandlerDir",
+        "--scan-dir", "$webSocketHandlerScanDir",
+        "--websock-handlers-map-file", "$webSocketHandlerMapFile",
+        "--cgi-paths", "/websocket/tests",
     );
 
     $ENV{"PYTHONPATH"} = $webSocketPythonPath;
diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply
index f586211..61d193d 100755
--- a/WebKitTools/Scripts/svn-apply
+++ b/WebKitTools/Scripts/svn-apply
@@ -310,6 +310,7 @@
 sub isDirectoryEmptyForRemoval($)
 {
     my ($dir) = @_;
+    return 1 unless -d $dir;
     my $directoryIsEmpty = 1;
     opendir DIR, $dir or die "Could not open '$dir' to list files: $?";
     for (my $item = readdir DIR; $item && $directoryIsEmpty; $item = readdir DIR) {
@@ -481,6 +482,12 @@
         close SVN;
         print $svnOutput if $svnOutput;
     } elsif (isGit()) {
-        system("git", "rm", "--force", $path) == 0 or die  "Failed to git rm --force $path.";
+        # Git removes a directory if it becomes empty when the last file it contains is
+        # removed by `git rm`. In svn-apply this can happen when a directory is being
+        # removed in a patch, and all of the files inside of the directory are removed
+        # before attemping to remove the directory itself. In this case, Git will have 
+        # already deleted the directory and `git rm` would exit with an error claiming
+        # there was no file. The --ignore-unmatch switch gracefully handles this case.
+        system("git", "rm", "--force", "--ignore-unmatch", $path) == 0 or die "Failed to git rm --force --ignore-unmatch $path.";
     }
 }
diff --git a/WebKitTools/Scripts/svn-create-patch b/WebKitTools/Scripts/svn-create-patch
index 768a8ed..5aead2e 100755
--- a/WebKitTools/Scripts/svn-create-patch
+++ b/WebKitTools/Scripts/svn-create-patch
@@ -56,12 +56,14 @@
 use VCSUtils;
 
 sub binarycmp($$);
+sub diffOptionsForFile($);
 sub findBaseUrl($);
 sub findMimeType($;$);
 sub findModificationType($);
 sub findSourceFileAndRevision($);
 sub generateDiff($$);
 sub generateFileList($\%);
+sub hunkHeaderLineRegExForFile($);
 sub isBinaryMimeType($);
 sub manufacturePatchForAdditionWithHistory($);
 sub numericcmp($$);
@@ -99,9 +101,16 @@
 my $svnRoot = determineSVNRoot();
 my $prefix = chdirReturningRelativePath($svnRoot);
 
+my $patchSize = 0;
+
 # Generate the diffs, in a order chosen for easy reviewing.
 for my $path (sort patchpathcmp values %diffFiles) {
-    generateDiff($path, $prefix);
+    $patchSize += generateDiff($path, $prefix);
+}
+
+if ($patchSize > 20480) {
+    print STDERR "WARNING: Patch's size is " . int($patchSize/1024) . " kbytes.\n";
+    print STDERR "Patches 20k or smaller are more likely to be reviewed. Larger patches may sit unreviewed for a long time.\n";
 }
 
 exit 0;
@@ -130,6 +139,19 @@
     return $fileDataA->{isBinary} <=> $fileDataB->{isBinary};
 }
 
+sub diffOptionsForFile($)
+{
+    my ($file) = @_;
+
+    my $options = "uaNp";
+
+    if (my $hunkHeaderLineRegEx = hunkHeaderLineRegExForFile($file)) {
+        $options .= "F'$hunkHeaderLineRegEx'";
+    }
+
+    return $options;
+}
+
 sub findBaseUrl($)
 {
     my ($infoPath) = @_;
@@ -196,24 +218,27 @@
     my $file = File::Spec->catdir($prefix, $fileData->{path});
     
     if ($ignoreChangelogs && basename($file) eq "ChangeLog") {
-        return;
+        return 0;
     }
     
-    my $patch;
+    my $patch = "";
     if ($fileData->{modificationType} eq "additionWithHistory") {
         manufacturePatchForAdditionWithHistory($fileData);
     }
-    open DIFF, "svn diff --diff-cmd diff -x -uaNp '$file' |" or die;
+
+    my $diffOptions = diffOptionsForFile($file);
+    open DIFF, "svn diff --diff-cmd diff -x -$diffOptions '$file' |" or die;
     while (<DIFF>) {
         $patch .= $_;
     }
     close DIFF;
     $patch = fixChangeLogPatch($patch) if basename($file) eq "ChangeLog";
-    print $patch if $patch;
+    print $patch;
     if ($fileData->{isBinary}) {
         print "\n" if ($patch && $patch =~ m/\n\S+$/m);
         outputBinaryContent($file);
     }
+    return length($patch);
 }
 
 sub generateFileList($\%)
@@ -252,6 +277,15 @@
     close STAT;
 }
 
+sub hunkHeaderLineRegExForFile($)
+{
+    my ($file) = @_;
+
+    my $startOfObjCInterfaceRegEx = "@(implementation\\|interface\\|protocol)";
+    return "^[-+]\\|$startOfObjCInterfaceRegEx" if $file =~ /\.mm?$/;
+    return "^$startOfObjCInterfaceRegEx" if $file =~ /^(.*\/)?(mac|objc)\// && $file =~ /\.h$/;
+}
+
 sub isBinaryMimeType($)
 {
     my ($file) = @_;
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index 8617330..e35c6e6 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -27,41 +28,213 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+import logging
+import os
 import sys
-import unittest
 
-from webkitpy.bugzilla_unittest import *
-from webkitpy.buildbot_unittest import *
-from webkitpy.changelogs_unittest import *
-from webkitpy.commands.download_unittest import *
-from webkitpy.commands.early_warning_system_unittest import *
-from webkitpy.commands.openbugs_unittest import OpenBugsTest
-from webkitpy.commands.upload_unittest import *
-from webkitpy.commands.queries_unittest import *
-from webkitpy.commands.queues_unittest import *
-from webkitpy.committers_unittest import *
-from webkitpy.credentials_unittest import *
-from webkitpy.diff_parser_unittest import *
-from webkitpy.executive_unittest import *
-from webkitpy.grammar_unittest import *
-from webkitpy.layout_tests.port.mac_unittest import *
-from webkitpy.multicommandtool_unittest import *
-from webkitpy.networktransaction_unittest import *
-from webkitpy.patchcollection_unittest import *
-from webkitpy.queueengine_unittest import *
-from webkitpy.steps.steps_unittest import *
-from webkitpy.steps.closebugforlanddiff_unittest import *
-from webkitpy.steps.updatechangelogswithreview_unittests import *
-from webkitpy.style.unittests import * # for check-webkit-style
-from webkitpy.user_unittest import *
-from webkitpy.webkit_logging_unittest import *
-from webkitpy.webkitport_unittest import *
+# Do not import anything from webkitpy prior to cleaning webkitpy of
+# orphaned *.pyc files.  This ensures that no orphaned *.pyc files are
+# accidentally imported during the course of this script.
+#
+# Also, do not import or execute any Python code incompatible with
+# Python 2.4 until after execution of the init() method below.
+
+
+_log = logging.getLogger("test-webkitpy")
+
+
+# Verbose logging is useful for debugging test-webkitpy code that runs
+# before the actual unit tests -- things like autoinstall downloading and
+# unit-test auto-detection logic.  This is different from verbose logging
+# of the unit tests themselves (i.e. the unittest module's --verbose flag).
+def configure_logging(is_verbose_logging):
+    """Configure the root logger.
+
+    Configure the root logger not to log any messages from webkitpy --
+    except for messages from the autoinstall module.  Also set the
+    logging level as described below.
+
+    Args:
+      is_verbose_logging: A boolean value of whether logging should be
+                          verbose.  If this parameter is true, the logging
+                          level for the handler on the root logger is set to
+                          logging.DEBUG.  Otherwise, it is set to logging.INFO.
+
+    """
+    # Don't use the Python ternary operator here so that this method will
+    # work with Python 2.4.
+    if is_verbose_logging:
+        logging_level = logging.DEBUG
+    else:
+        logging_level = logging.INFO
+
+    handler = logging.StreamHandler(sys.stderr)
+    # We constrain the level on the handler rather than on the root
+    # logger itself.  This is probably better because the handler is
+    # configured and known only to this module, whereas the root logger
+    # is an object shared (and potentially modified) by many modules.
+    # Modifying the handler, then, is less intrusive and less likely to
+    # interfere with modifications made by other modules (e.g. in unit
+    # tests).
+    handler.setLevel(logging_level)
+    formatter = logging.Formatter("%(name)s: %(levelname)-8s %(message)s")
+    handler.setFormatter(formatter)
+
+    logger = logging.getLogger()
+    logger.addHandler(handler)
+    logger.setLevel(logging.NOTSET)
+
+    # Filter out most webkitpy messages.
+    #
+    # Messages can be selectively re-enabled for this script by updating
+    # this method accordingly.
+    def filter(record):
+        """Filter out autoinstall and non-third-party webkitpy messages."""
+        # FIXME: Figure out a way not to use strings here, for example by
+        #        using syntax like webkitpy.test.__name__.  We want to be
+        #        sure not to import any non-Python 2.4 code, though, until
+        #        after the version-checking code has executed.
+        if (record.name.startswith("webkitpy.common.system.autoinstall") or
+            record.name.startswith("webkitpy.test")):
+            return True
+        if record.name.startswith("webkitpy"):
+            return False
+        return True
+
+    testing_filter = logging.Filter()
+    testing_filter.filter = filter
+
+    # Display a message so developers are not mystified as to why
+    # logging does not work in the unit tests.
+    _log.info("Suppressing most webkitpy logging while running unit tests.")
+    handler.addFilter(testing_filter)
+
+
+def _clean_pyc_files(dir_to_clean, paths_not_to_log):
+    """Delete from a directory all .pyc files that have no .py file.
+
+    Args:
+      dir_to_clean: The path to the directory to clean.
+      paths_not_to_log: A list of paths to .pyc files whose deletions should
+                        not be logged.  This list should normally include
+                        only test .pyc files.
+
+    """
+    _log.debug("Cleaning orphaned *.pyc files from: %s" % dir_to_clean)
+
+    # Normalize paths not to log.
+    paths_not_to_log = [os.path.abspath(path) for path in paths_not_to_log]
+
+    for dir_path, dir_names, file_names in os.walk(dir_to_clean):
+        for file_name in file_names:
+            if file_name.endswith(".pyc") and file_name[:-1] not in file_names:
+                file_path = os.path.join(dir_path, file_name)
+                if os.path.abspath(file_path) not in paths_not_to_log:
+                    _log.info("Deleting orphan *.pyc file: %s" % file_path)
+                os.remove(file_path)
+
+
+# As a substitute for a unit test, this method tests _clean_pyc_files()
+# in addition to calling it.  We chose not to use the unittest module
+# because _clean_pyc_files() is called only once and is not used elsewhere.
+def _clean_webkitpy_with_test():
+    webkitpy_dir = os.path.join(os.path.dirname(__file__), "webkitpy")
+
+    # The test .pyc file is--
+    # webkitpy/python24/TEMP_test-webkitpy_test_pyc_file.pyc.
+    test_path = os.path.join(webkitpy_dir, "python24",
+                             "TEMP_test-webkitpy_test_pyc_file.pyc")
+
+    test_file = open(test_path, "w")
+    try:
+        test_file.write("Test .pyc file generated by test-webkitpy.")
+    finally:
+        test_file.close()
+
+    # Confirm that the test file exists so that when we check that it does
+    # not exist, the result is meaningful.
+    if not os.path.exists(test_path):
+        raise Exception("Test .pyc file not created: %s" % test_path)
+
+    _clean_pyc_files(webkitpy_dir, [test_path])
+
+    if os.path.exists(test_path):
+        raise Exception("Test .pyc file not deleted: %s" % test_path)
+
+
+def init(command_args):
+    """Execute code prior to importing from webkitpy.unittests.
+
+    Args:
+        command_args: The list of command-line arguments -- usually
+                      sys.argv[1:].
+
+    """
+    verbose_logging_flag = "--verbose-logging"
+    is_verbose_logging = verbose_logging_flag in command_args
+    if is_verbose_logging:
+        # Remove the flag so it doesn't cause unittest.main() to error out.
+        #
+        # FIXME: Get documentation for the --verbose-logging flag to show
+        #        up in the usage instructions, which are currently generated
+        #        by unittest.main().  It's possible that this will require
+        #        re-implementing the option parser for unittest.main()
+        #        since there may not be an easy way to modify its existing
+        #        option parser.
+        sys.argv.remove(verbose_logging_flag)
+
+    configure_logging(is_verbose_logging)
+    _log.debug("Verbose WebKit logging enabled.")
+
+    # We clean orphaned *.pyc files from webkitpy prior to importing from
+    # webkitpy to make sure that no import statements falsely succeed.
+    # This helps to check that import statements have been updated correctly
+    # after any file moves.  Otherwise, incorrect import statements can
+    # be masked.
+    #
+    # For example, if webkitpy/python24/versioning.py were moved to a
+    # different location without changing any import statements, and if
+    # the corresponding .pyc file were left behind without deleting it,
+    # then "import webkitpy.python24.versioning" would continue to succeed
+    # even though it would fail for someone checking out a fresh copy
+    # of the source tree.  This is because of a Python feature:
+    #
+    # "It is possible to have a file called spam.pyc (or spam.pyo when -O
+    # is used) without a file spam.py for the same module. This can be used
+    # to distribute a library of Python code in a form that is moderately
+    # hard to reverse engineer."
+    #
+    # ( http://docs.python.org/tutorial/modules.html#compiled-python-files )
+    #
+    # Deleting the orphaned .pyc file prior to importing, however, would
+    # cause an ImportError to occur on import as desired.
+    _clean_webkitpy_with_test()
+
+    import webkitpy.python24.versioning as versioning
+
+    versioning.check_version(log=_log)
+
+    (comparison, current_version, minimum_version) = \
+        versioning.compare_version()
+
+    if comparison > 0:
+        # Then the current version is later than the minimum version.
+        message = ("You are testing webkitpy with a Python version (%s) "
+                   "higher than the minimum version (%s) it was meant "
+                   "to support." % (current_version, minimum_version))
+        _log.warn(message)
+
 
 if __name__ == "__main__":
-    # FIXME: This is a hack, but I'm tired of commenting out the test.
-    #        See https://bugs.webkit.org/show_bug.cgi?id=31818
-    if len(sys.argv) > 1 and sys.argv[1] == "--all":
-        sys.argv.remove("--all")
-        from webkitpy.scm_unittest import *
 
-    unittest.main()
+    init(sys.argv[1:])
+
+    # We import the unit test code after init() to ensure that any
+    # Python version warnings are displayed in case an error occurs
+    # while interpreting webkitpy.unittests.  This also allows
+    # logging to be configured prior to importing -- for example to
+    # enable the display of autoinstall logging.log messages while
+    # running the unit tests.
+    from webkitpy.test.main import Tester
+
+    Tester().run_tests(sys.argv)
diff --git a/WebKitTools/Scripts/update-iexploder-cssproperties b/WebKitTools/Scripts/update-iexploder-cssproperties
index b7ae6cb..3fbcf83 100755
--- a/WebKitTools/Scripts/update-iexploder-cssproperties
+++ b/WebKitTools/Scripts/update-iexploder-cssproperties
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright (C) 2007 Apple Inc.  All rights reserved.
+# Copyright (C) 2010 Holger Hans Peter Freyther
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -26,87 +27,103 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# This script updates WebKitTools/iExploder/htdocs/cssproperties.in based on
-# WebCore/css/CSSPropertyNames.in.
+# This script updates WebKitTools/iExploder/htdocs/*.in based on
+# WebCore/css/CSSPropertyNames.in, WebCore/html/HTMLTagNames.in
+# and WebCore/html/HTMLAttributeNames.in
 
 use warnings;
 use strict;
 
 use FindBin;
 use lib $FindBin::Bin;
+use VCSUtils;
 use webkitdirs;
 
 use File::Spec;
 
-sub generateSectionFromCSSPropertyNamesFile();
-sub readiExploderFile();
-sub svnRevision($);
-sub writeiExploderFile();
+sub generateEntityListFromFile($);
+sub readiExploderFile($);
+sub update($$);
+sub writeiExploderFile($@);
 
-my $iExploderFile = File::Spec->catfile(sourceDir(), split("/", "WebKitTools/iExploder/htdocs/cssproperties.in"));
-my $cssPropertyNamesFile = File::Spec->catfile(sourceDir(), split("/", "WebCore/css/CSSPropertyNames.in"));
-
-my @sections = readiExploderFile();
-$sections[0] = generateSectionFromCSSPropertyNamesFile();
-writeiExploderFile();
-
-print `svn stat $iExploderFile`;
+update("cssproperties.in", "css/CSSPropertyNames.in");
+update("htmlattrs.in", "html/HTMLAttributeNames.in");
+update("htmltags.in", "html/HTMLTagNames.in");
 print "Successfully updated!\n";
 
 exit 0;
 
-sub generateSectionFromCSSPropertyNamesFile()
+sub generateEntityListFromFile($)
 {
-    my $revision = svnRevision($cssPropertyNamesFile);
-    my $path = File::Spec->abs2rel($cssPropertyNamesFile, sourceDir());
+    my ($filename) = @_;
+
+    my $revision = svnRevisionForDirectory(dirname($filename));
+    my $path = File::Spec->abs2rel($filename, sourceDir());
     my $result = "# From WebKit svn r" . $revision . " (" . $path . ")\n";
 
-    my @properties = ();
+    my @entities = ();
+    my $in_namespace = 0;
 
-    open(IN, $cssPropertyNamesFile) || die "$!";
+    open(IN, $filename) || die "$!";
     while (my $l = <IN>) {
         chomp $l;
+        if ($l =~ m/^namespace=\"/) {
+            $in_namespace = 1;
+        } elsif ($in_namespace && $l =~ m/^$/) {
+            $in_namespace = 0;
+        }
+
+        next if $in_namespace;
         next if $l =~ m/^\s*#/ || $l =~ m/^\s*$/;
-        push(@properties, $l);
+
+        # For HTML Tags that can have additional information
+        if ($l =~ m/ /) {
+            my @split = split / /, $l;
+            $l = $split[0]
+        }
+
+        push(@entities, $l);
     }
     close(IN);
 
-    $result .= join("\n", sort { $a cmp $b } @properties) . "\n\n";
+    $result .= join("\n", sort { $a cmp $b } @entities) . "\n\n";
 
     return $result;
 }
 
-sub readiExploderFile()
+sub readiExploderFile($)
 {
+    my ($filename) = @_;
+
     my @sections = ();
     local $/ = "\n\n";
 
-    open(IN, $iExploderFile) || die "$!";
+    open(IN, $filename) || die "$!";
     @sections = <IN>;
     close(IN);
 
     return @sections;
 }
 
-sub svnRevision($)
+sub update($$)
 {
-    my ($file) = @_;
-    my $revision = "";
+    my ($iexploderPath, $webcorePath) = @_;
 
-    open INFO, "svn info '$file' |" or die;
-    while (<INFO>) {
-        if (/^Revision: (.+)/) {
-            $revision = $1;
-        }
-    }
-    close INFO;
+    $iexploderPath = File::Spec->catfile(sourceDir(), "WebKitTools", "iExploder", "htdocs", split("/", $iexploderPath));
+    $webcorePath = File::Spec->catfile(sourceDir(), "WebCore", split("/", $webcorePath));
 
-    return $revision ? $revision : "UNKNOWN";
+    my @sections = readiExploderFile($iexploderPath);
+    $sections[0] = generateEntityListFromFile($webcorePath);
+    writeiExploderFile($iexploderPath, @sections);
 }
 
-sub writeiExploderFile()
+
+sub writeiExploderFile($@)
 {
-    open(OUT, "> $iExploderFile") || die "$!";
+    my ($filename, @sections) = @_;
+
+    open(OUT, "> $filename") || die "$!";
     print OUT join("", @sections);
     close(OUT);
 }
+
diff --git a/WebKitTools/Scripts/validate-committer-lists b/WebKitTools/Scripts/validate-committer-lists
index 2f2dd32..ad3d358 100755
--- a/WebKitTools/Scripts/validate-committer-lists
+++ b/WebKitTools/Scripts/validate-committer-lists
@@ -36,13 +36,13 @@
 import re
 import urllib2
 from datetime import date, datetime, timedelta
-from webkitpy.committers import CommitterList
-from webkitpy.webkit_logging import log, error
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.system.deprecated_logging import log, error
 from webkitpy.scm import Git
 
 # WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
 # so this import should always succeed.
-from webkitpy.BeautifulSoup import BeautifulSoup
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
 
 def print_list_if_non_empty(title, list_to_print):
     if not list_to_print:
diff --git a/WebKitTools/Scripts/webkit-patch b/WebKitTools/Scripts/webkit-patch
index b4bcc4c..e0170ed 100755
--- a/WebKitTools/Scripts/webkit-patch
+++ b/WebKitTools/Scripts/webkit-patch
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 # Copyright (c) 2009, Google Inc. All rights reserved.
 # Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -31,79 +32,25 @@
 # A tool for automating dealing with bugzilla, posting patches, committing patches, etc.
 
 import os
+import sys
 
-from webkitpy.bugzilla import Bugzilla
-from webkitpy.buildbot import BuildBot
-from webkitpy.commands.download import *
-from webkitpy.commands.early_warning_system import *
-from webkitpy.commands.openbugs import OpenBugs
-from webkitpy.commands.queries import *
-from webkitpy.commands.queues import *
-from webkitpy.commands.upload import *
-from webkitpy.executive import Executive
-from webkitpy.webkit_logging import log
-from webkitpy.multicommandtool import MultiCommandTool
-from webkitpy.scm import detect_scm_system
-from webkitpy.user import User
+from webkitpy.common.system.logutils import configure_logging
+import webkitpy.python24.versioning as versioning
 
 
-class WebKitPatch(MultiCommandTool):
-    global_options = [
-        make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
-        make_option("--status-host", action="store", dest="status_host", type="string", nargs=1, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
-    ]
+def main():
+    configure_logging()
 
-    def __init__(self):
-        MultiCommandTool.__init__(self)
+    versioning.check_version()
 
-        self.bugs = Bugzilla()
-        self.buildbot = BuildBot()
-        self.executive = Executive()
-        self.user = User()
-        self._scm = None
-        self.status_server = StatusServer()
+    # Import webkit-patch code only after version-checking so that
+    # script doesn't error out before having a chance to report the
+    # version warning.
+    from webkitpy.tool.main import WebKitPatch
 
-    def scm(self):
-        # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
-        original_cwd = os.path.abspath(".")
-        if not self._scm:
-            self._scm = detect_scm_system(original_cwd)
-
-        if not self._scm:
-            script_directory = os.path.abspath(sys.path[0])
-            webkit_directory = os.path.abspath(os.path.join(script_directory, "../.."))
-            self._scm = detect_scm_system(webkit_directory)
-            if self._scm:
-                log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, webkit_directory))
-            else:
-                error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, webkit_directory))
-
-        return self._scm
-
-    def path(self):
-        return __file__
-
-    def should_show_in_main_help(self, command):
-        if not command.show_in_main_help:
-            return False
-        if command.requires_local_commits:
-            return self.scm().supports_local_commits()
-        return True
-
-    # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
-    def handle_global_options(self, options):
-        if options.dry_run:
-            self.scm().dryrun = True
-            self.bugs.dryrun = True
-        if options.status_host:
-            self.status_server.set_host(options.status_host)
-
-    def should_execute_command(self, command):
-        if command.requires_local_commits and not self.scm().supports_local_commits():
-            failure_reason = "%s requires local commits using %s in %s." % (command.name, self.scm().display_name(), self.scm().checkout_root)
-            return (False, failure_reason)
-        return (True, None)
+    WebKitPatch(__file__).main()
 
 
 if __name__ == "__main__":
-    WebKitPatch().main()
+
+    main()
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index 7985790..0b18373 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -63,6 +63,7 @@
 my %qtFeatureDefaults;
 my $isGtk;
 my $isWx;
+my $isEfl;
 my @wxArgs;
 my $isChromium;
 my $isInspectorFrontend;
@@ -71,6 +72,7 @@
 my $vcBuildPath;
 my $windowsTmpPath;
 my $windowsSourceDir;
+my $willUseVCExpressWhenBuilding = 0;
 
 # Defined in VCSUtils.
 sub exitStatus($);
@@ -245,6 +247,7 @@
     push(@args, '--qt') if isQt();
     push(@args, '--symbian') if isSymbian();
     push(@args, '--gtk') if isGtk();
+    push(@args, '--efl') if isEfl();
     push(@args, '--wx') if isWx();
     push(@args, '--chromium') if isChromium();
     push(@args, '--inspector-frontend') if isInspectorFrontend();
@@ -270,11 +273,11 @@
     if (isAppleWinWebKit() && !isWx()) {
         $configurationProductDir = "$baseProductDir/bin";
     } else {
-        # [Gtk] We don't have Release/Debug configurations in straight
+        # [Gtk][Efl] We don't have Release/Debug configurations in straight
         # autotool builds (non build-webkit). In this case and if
         # WEBKITOUTPUTDIR exist, use that as our configuration dir. This will
         # allows us to run run-webkit-tests without using build-webkit.
-        if ($ENV{"WEBKITOUTPUTDIR"} && isGtk()) {
+        if ($ENV{"WEBKITOUTPUTDIR"} && (isGtk() || isEfl())) {
             $configurationProductDir = "$baseProductDir";
         } else {
             $configurationProductDir = "$baseProductDir/$configuration";
@@ -325,7 +328,7 @@
     my $productDir = productDir();
     $productDir .= "/JavaScriptCore" if isQt();
     $productDir .= "/$configuration" if (isQt() && isWindows());
-    $productDir .= "/Programs" if isGtk();
+    $productDir .= "/Programs" if (isGtk() || isEfl());
 
     return $productDir;
 }
@@ -541,6 +544,11 @@
         if (isDarwin() and -d "$configurationProductDir/lib/$libraryName.framework") {
             return "$configurationProductDir/lib/$libraryName.framework/$libraryName";
         } elsif (isWindows()) {
+            if (configuration() eq "Debug") {
+                # On Windows, there is a "d" suffix to the library name. See <http://trac.webkit.org/changeset/53924/>.
+                $libraryName .= "d";
+            }
+
             my $mkspec = `qmake -query QMAKE_MKSPECS`;
             $mkspec =~ s/[\n|\r]$//g;
             my $qtMajorVersion = retrieveQMakespecVar("$mkspec/qconfig.pri", "QT_MAJOR_VERSION");
@@ -558,6 +566,9 @@
     if (isGtk()) {
         return "$configurationProductDir/$libraryName/../.libs/libwebkit-1.0.so";
     }
+    if (isEfl()) {
+        return "$configurationProductDir/$libraryName/../.libs/libewebkit.so";
+    }
     if (isAppleMacWebKit()) {
         return "$configurationProductDir/$libraryName.framework/Versions/A/$libraryName";
     }
@@ -569,7 +580,7 @@
         }
     }
 
-    die "Unsupported platform, can't determine built library locations.";
+    die "Unsupported platform, can't determine built library locations.\nTry `build-webkit --help` for more information.\n";
 }
 
 # Check to see that all the frameworks are built.
@@ -657,8 +668,8 @@
         return;
     }
 
-    # The presence of QTDIR only means Qt if --gtk is not on the command-line
-    if (isGtk() || isWx()) {
+    # The presence of QTDIR only means Qt if --gtk or --wx or --efl are not on the command-line
+    if (isGtk() || isWx() || isEfl()) {
         $isQt = 0;
         return;
     }
@@ -678,6 +689,18 @@
     $isSymbian = defined($ENV{'EPOCROOT'});
 }
 
+sub determineIsEfl()
+{
+    return if defined($isEfl);
+    $isEfl = checkForArgumentAndRemoveFromARGV("--efl");
+}
+
+sub isEfl()
+{
+    determineIsEfl();
+    return $isEfl;
+}
+
 sub isGtk()
 {
     determineIsGtk();
@@ -769,7 +792,7 @@
 
 sub isAppleWebKit()
 {
-    return !(isQt() or isGtk() or isWx() or isChromium());
+    return !(isQt() or isGtk() or isWx() or isChromium() or isEfl());
 }
 
 sub isAppleMacWebKit()
@@ -856,7 +879,7 @@
 sub launcherPath()
 {
     my $relativeScriptsPath = relativeScriptsDir();
-    if (isGtk() || isQt() || isWx()) {
+    if (isGtk() || isQt() || isWx() || isEfl()) {
         return "$relativeScriptsPath/run-launcher";
     } elsif (isAppleWebKit()) {
         return "$relativeScriptsPath/run-safari";
@@ -873,6 +896,8 @@
         return "wxBrowser";
     } elsif (isAppleWebKit()) {
         return "Safari";
+    } elsif (isEfl()) {
+        return "EWebLauncher";
     }
 }
 
@@ -895,7 +920,7 @@
             print "http://developer.apple.com/tools/xcode\n";
             print "*************************************************************\n";
         }
-    } elsif (isGtk() or isQt() or isWx()) {
+    } elsif (isGtk() or isQt() or isWx() or isEfl()) {
         my @cmds = qw(flex bison gperf);
         my @missing = ();
         foreach my $cmd (@cmds) {
@@ -1002,6 +1027,7 @@
             print "*************************************************************\n";
             die;
         }
+        $willUseVCExpressWhenBuilding = 1;
     }
 
     my $qtSDKPath = "$programFilesPath/QuickTime SDK";
@@ -1023,6 +1049,23 @@
     print "WEBKITLIBRARIESDIR is set to: ", $ENV{"WEBKITLIBRARIESDIR"}, "\n";
 }
 
+sub dieIfWindowsPlatformSDKNotInstalled
+{
+    my $windowsPlatformSDKRegistryEntry = "/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1";
+
+    return if -e $windowsPlatformSDKRegistryEntry;
+
+    print "*************************************************************\n";
+    print "Cannot find '$windowsPlatformSDKRegistryEntry'.\n";
+    print "Please download and install the Microsoft Windows Server 2003 R2\n";
+    print "Platform SDK from <http://www.microsoft.com/downloads/details.aspx?\n";
+    print "familyid=0baf2b35-c656-4969-ace8-e4c0c0716adb&displaylang=en>.\n\n";
+    print "Then follow step 2 in the Windows section of the \"Installing Developer\n";
+    print "Tools\" instructions at <http://www.webkit.org/building/tools.html>.\n";
+    print "*************************************************************\n";
+    die;
+}
+
 sub copyInspectorFrontendFiles
 {
     my $productDir = productDir();
@@ -1040,6 +1083,9 @@
     } elsif (isQt() || isGtk()) {
         my $prefix = $ENV{"WebKitInstallationPrefix"};
         $inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/webkit-1.0/webinspector";
+    } elsif (isEfl()) {
+        my $prefix = $ENV{"WebKitInstallationPrefix"};
+        $inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/ewebkit/webinspector";
     }
 
     if (! -d $inspectorResourcesDirPath) {
@@ -1074,6 +1120,8 @@
 
     my $config = configurationForVisualStudio();
 
+    dieIfWindowsPlatformSDKNotInstalled() if $willUseVCExpressWhenBuilding;
+
     chomp(my $winProjectPath = `cygpath -w "$project"`);
     
     my $action = "/build";
@@ -1403,6 +1451,19 @@
     $vsInstallDir = `cygpath "$vsInstallDir"` if isCygwin();
     chomp $vsInstallDir;
     $vcBuildPath = "$vsInstallDir/Common7/IDE/devenv.com";
+    if (! -e $vcBuildPath) {
+        # Visual Studio not found, try VC++ Express
+        $vcBuildPath = "$vsInstallDir/Common7/IDE/VCExpress.exe";
+        if (! -e $vcBuildPath) {
+            print "*************************************************************\n";
+            print "Cannot find '$vcBuildPath'\n";
+            print "Please execute the file 'vcvars32.bat' from\n";
+            print "'$programFilesPath\\Microsoft Visual Studio 8\\VC\\bin\\'\n";
+            print "to setup the necessary environment variables.\n";
+            print "*************************************************************\n";
+            die;
+        }
+    }
 
     # Create command line and execute it.
     my @command = ($vcBuildPath, $projectPath, $action, $config);
@@ -1491,4 +1552,44 @@
     return 1;
 }
 
+sub runMiniBrowser
+{
+    if (isAppleMacWebKit()) {
+        my $productDir = productDir();
+        print "Starting MiniBrowser with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+        $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+        $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+        my $miniBrowserPath = "$productDir/MiniBrowser.app/Contents/MacOS/MiniBrowser";
+        if (!isTiger() && architecture()) {
+            return system "arch", "-" . architecture(), $miniBrowserPath, @ARGV;
+        } else {
+            return system $miniBrowserPath, @ARGV;
+        }
+    }
+
+    return 1;
+}
+
+sub debugMiniBrowser
+{
+    if (isAppleMacWebKit()) {
+        my $gdbPath = "/usr/bin/gdb";
+        die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath;
+
+        my $productDir = productDir();
+
+        $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+        $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = 'YES';
+
+        my $miniBrowserPath = "$productDir/MiniBrowser.app/Contents/MacOS/MiniBrowser";
+
+        print "Starting MiniBrowser under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit2 in $productDir.\n";
+        my @architectureFlags = ("-arch", architecture()) if !isTiger();
+        exec $gdbPath, @architectureFlags, $miniBrowserPath or die;
+        return;
+    }
+    
+    return 1;
+}
+
 1;
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl
new file mode 100644
index 0000000..a226e43
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl
@@ -0,0 +1,336 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2010 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+# Unit tests of VCSUtils::mergeChangeLogs().
+
+use strict;
+
+use Test::Simple tests => 16;
+use File::Temp qw(tempfile);
+use VCSUtils;
+
+# Read contents of a file and return it.
+sub readFile($)
+{
+    my ($fileName) = @_;
+
+    local $/;
+    open(FH, "<", $fileName);
+    my $content = <FH>;
+    close(FH);
+
+    return $content;
+}
+
+# Write a temporary file and return the filename.
+sub writeTempFile($$$)
+{
+    my ($name, $extension, $content) = @_;
+
+    my ($FH, $fileName) = tempfile(
+        $name . "-XXXXXXXX",
+        DIR => ($ENV{'TMPDIR'} || "/tmp"),
+        UNLINK => 0,
+    );
+    print $FH $content;
+    close $FH;
+
+    if ($extension) {
+        my $newFileName = $fileName . $extension;
+        rename($fileName, $newFileName);
+        $fileName = $newFileName;
+    }
+
+    return $fileName;
+}
+
+# --------------------------------------------------------------------------------
+
+{
+    # New test
+    my $title = "mergeChangeLogs: traditional rejected patch success";
+
+    my $fileNewerContent = <<'EOF';
+2010-01-29  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileNewer = writeTempFile("file", "", $fileNewerContent);
+
+    my $fileMineContent = <<'EOF';
+***************
+*** 1,3 ****
+  2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+  
+          Rubber-stamped by Maciej Stachowiak.
+--- 1,9 ----
++ 2010-01-29  Oliver Hunt  <oliver@apple.com>
++ 
++         Reviewed by Darin Adler.
++ 
++         JSC is failing to propagate anonymous slot count on some transitions
++ 
+  2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+  
+          Rubber-stamped by Maciej Stachowiak.
+EOF
+    my $fileMine = writeTempFile("file", ".rej", $fileMineContent);
+    rename($fileMine, $fileNewer . ".rej");
+    $fileMine = $fileNewer . ".rej";
+
+    my $fileOlderContent = $fileNewerContent;
+    my $fileOlder = writeTempFile("file", ".orig", $fileOlderContent);
+    rename($fileOlder, $fileNewer . ".orig");
+    $fileOlder = $fileNewer . ".orig";
+
+    my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+    # mergeChangeLogs() should return 1 since the patch succeeded.
+    ok($exitStatus == 1, "$title: should return 1 for success");
+
+    ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+    ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+    my $expectedContent = <<'EOF';
+2010-01-29  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        JSC is failing to propagate anonymous slot count on some transitions
+
+EOF
+    $expectedContent .= $fileNewerContent;
+    ok(readFile($fileNewer) eq $expectedContent, "$title: \$fileNewer should be updated to include patch");
+
+    unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+    # New test
+    my $title = "mergeChangeLogs: traditional rejected patch failure";
+
+    my $fileNewerContent = <<'EOF';
+2010-01-29  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileNewer = writeTempFile("file", "", $fileNewerContent);
+
+    my $fileMineContent = <<'EOF';
+***************
+*** 1,9 ****
+- 2010-01-29  Oliver Hunt  <oliver@apple.com>
+- 
+-         Reviewed by Darin Adler.
+- 
+-         JSC is failing to propagate anonymous slot count on some transitions
+- 
+  2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+  
+          Rubber-stamped by Maciej Stachowiak.
+--- 1,3 ----
+  2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+  
+          Rubber-stamped by Maciej Stachowiak.
+EOF
+    my $fileMine = writeTempFile("file", ".rej", $fileMineContent);
+    rename($fileMine, $fileNewer . ".rej");
+    $fileMine = $fileNewer . ".rej";
+
+    my $fileOlderContent = $fileNewerContent;
+    my $fileOlder = writeTempFile("file", ".orig", $fileOlderContent);
+    rename($fileOlder, $fileNewer . ".orig");
+    $fileOlder = $fileNewer . ".orig";
+
+    my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+    # mergeChangeLogs() should return 0 since the patch failed.
+    ok($exitStatus == 0, "$title: should return 0 for failure");
+
+    ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+    ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+    ok(readFile($fileNewer) eq $fileNewerContent, "$title: \$fileNewer should be unchanged");
+
+    unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+    # New test
+    my $title = "mergeChangeLogs: patch succeeds";
+
+    my $fileMineContent = <<'EOF';
+2010-01-29  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileMine = writeTempFile("fileMine", "", $fileMineContent);
+
+    my $fileOlderContent = <<'EOF';
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileOlder = writeTempFile("fileOlder", "", $fileOlderContent);
+
+    my $fileNewerContent = <<'EOF';
+2010-01-29  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileNewer = writeTempFile("fileNewer", "", $fileNewerContent);
+
+    my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+    # mergeChangeLogs() should return 1 since the patch succeeded.
+    ok($exitStatus == 1, "$title: should return 1 for success");
+
+    ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+    ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+    my $expectedContent = <<'EOF';
+2010-01-29  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        JSC is failing to propagate anonymous slot count on some transitions
+
+EOF
+    $expectedContent .= $fileNewerContent;
+
+    ok(readFile($fileNewer) eq $expectedContent, "$title: \$fileNewer should be patched");
+
+    unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+    # New test
+    my $title = "mergeChangeLogs: patch fails";
+
+    my $fileMineContent = <<'EOF';
+2010-01-29  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileMine = writeTempFile("fileMine", "", $fileMineContent);
+
+    my $fileOlderContent = <<'EOF';
+2010-01-29  Mark Rowe  <mrowe@apple.com>
+
+        Fix the Mac build.
+
+        Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileOlder = writeTempFile("fileOlder", "", $fileOlderContent);
+
+    my $fileNewerContent = <<'EOF';
+2010-01-29  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Darin Adler.
+
+        JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Rubber-stamped by Maciej Stachowiak.
+
+        Fix the ARM build.
+EOF
+    my $fileNewer = writeTempFile("fileNewer", "", $fileNewerContent);
+
+    my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+    # mergeChangeLogs() should return a non-zero exit status since the patch failed.
+    ok($exitStatus == 0, "$title: return non-zero exit status for failure");
+
+    ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+    ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+    # $fileNewer should still exist unchanged because the patch failed
+    ok(readFile($fileNewer) eq $fileNewerContent, "$title: \$fileNewer should be unchanged");
+
+    unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
diff --git a/WebKitTools/Scripts/webkitperl/httpd.pm b/WebKitTools/Scripts/webkitperl/httpd.pm
index 05eb21c..240f368 100644
--- a/WebKitTools/Scripts/webkitperl/httpd.pm
+++ b/WebKitTools/Scripts/webkitperl/httpd.pm
@@ -31,6 +31,7 @@
 use strict;
 use warnings;
 
+use File::Copy;
 use File::Path;
 use File::Spec;
 use File::Spec::Functions;
diff --git a/WebKitTools/Scripts/webkitpy/__init__.py b/WebKitTools/Scripts/webkitpy/__init__.py
index 94ecc70..b376bf2 100644
--- a/WebKitTools/Scripts/webkitpy/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/__init__.py
@@ -1,8 +1,13 @@
 # Required for Python to search this directory for module files
 
-import autoinstall
-
-# List our third-party library dependencies here and where they can be
-# downloaded.
-autoinstall.bind("ClientForm", "http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip", "ClientForm-0.2.10")
-autoinstall.bind("mechanize", "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip", "mechanize-0.1.11")
+# Keep this file free of any code or import statements that could
+# cause either an error to occur or a log message to be logged.
+# This ensures that calling code can import initialization code from
+# webkitpy before any errors or log messages due to code in this file.
+# Initialization code can include things like version-checking code and
+# logging configuration code.
+#
+# We do not execute any version-checking code or logging configuration
+# code in this file so that callers can opt-in as they want.  This also
+# allows different callers to choose different initialization code,
+# as necessary.
diff --git a/WebKitTools/Scripts/webkitpy/autoinstall.py b/WebKitTools/Scripts/webkitpy/autoinstall.py
deleted file mode 100644
index 467e6b4..0000000
--- a/WebKitTools/Scripts/webkitpy/autoinstall.py
+++ /dev/null
@@ -1,335 +0,0 @@
-# Copyright (c) 2009, Daniel Krech 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 the Daniel Krech 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
-# HOLDER 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.
-
-"""\
-package loader for auto installing Python packages.
-
-A package loader in the spirit of Zero Install that can be used to
-inject dependencies into the import process. 
-
-
-To install::
-
-    easy_install -U autoinstall
-
-      or 
-
-    download, unpack, python setup.py install
-
-      or 
-
-    try the bootstrap loader. See below.
-
-
-To use::
-
-    # You can bind any package name to a URL pointing to something
-    # that can be imported using the zipimporter.
-
-    autoinstall.bind("pymarc", "http://pypi.python.org/packages/2.5/p/pymarc/pymarc-2.1-py2.5.egg")
-
-    import pymarc
-
-    print pymarc.__version__, pymarc.__file__
-
-    
-Changelog::
-
-- added support for non top level packages.
-- cache files now use filename part from URL.
-- applied patch from Eric Seidel <eseidel@google.com> to add support
-for loading modules where the module is not at the root of the .zip
-file.
-
-
-TODO::
-
-- a description of the intended use case
-- address other issues pointed out in:
-
-    http://mail.python.org/pipermail/python-dev/2008-March/077926.html
-
-Scribbles::
-
-pull vs. push
-user vs. system
-web vs. filesystem
-auto vs. manual
-
-manage development sandboxes
-
-optional interfaces...
-
-    def get_data(pathname) -> string with file data.
-
-    Return the data associated with 'pathname'. Raise IOError if
-    the file wasn't found.");
-
-    def is_package,
-    "is_package(fullname) -> bool.
-
-    Return True if the module specified by fullname is a package.
-    Raise ZipImportError is the module couldn't be found.");
-
-    def get_code,
-    "get_code(fullname) -> code object.
-
-    Return the code object for the specified module. Raise ZipImportError
-    is the module couldn't be found.");
-
-    def get_source,
-    "get_source(fullname) -> source string.
-
-    Return the source code for the specified module. Raise ZipImportError
-    is the module couldn't be found, return None if the archive does
-    contain the module, but has no source for it.");
-
-
-Autoinstall can also be bootstraped with the nascent package loader
-bootstrap module. For example::
-
-    #  or via the bootstrap
-    # loader.
-
-    try:
-        _version = "0.2"
-        import autoinstall
-        if autoinstall.__version__ != _version:
-            raise ImportError("A different version than expected found.")
-    except ImportError, e:
-        # http://svn.python.org/projects/sandbox/trunk/bootstrap/bootstrap.py
-        import bootstrap 
-        pypi = "http://pypi.python.org"
-        dir = "packages/source/a/autoinstall"
-        url = "%s/%s/autoinstall-%s.tar.gz" % (pypi, dir, _version)
-        bootstrap.main((url,))
-        import autoinstall
-
-References::
-
-  http://0install.net/
-  http://www.python.org/dev/peps/pep-0302/
-  http://svn.python.org/projects/sandbox/trunk/import_in_py
-  http://0install.net/injector-find.html
-  http://roscidus.com/desktop/node/903
-
-"""
-
-# To allow use of the "with" keyword for Python 2.5 users.
-from __future__ import with_statement
-
-__version__ = "0.2"
-__docformat__ = "restructuredtext en"
-
-import os
-import new
-import sys
-import urllib
-import logging
-import tempfile
-import zipimport
-
-_logger = logging.getLogger(__name__)
-
-
-_importer = None
-
-def _getImporter():
-    global _importer
-    if _importer is None:
-        _importer = Importer()
-        sys.meta_path.append(_importer)
-    return _importer
-
-def bind(package_name, url, zip_subpath=None):
-    """bind a top level package name to a URL.
-
-    The package name should be a package name and the url should be a
-    url to something that can be imported using the zipimporter.
-
-    Optional zip_subpath parameter allows searching for modules
-    below the root level of the zip file.
-    """
-    _getImporter().bind(package_name, url, zip_subpath)
-
-
-class Cache(object):
-
-    def __init__(self, directory=None):
-        if directory is None:
-            # Default to putting the cache directory in the same directory
-            # as this file.
-            containing_directory = os.path.dirname(__file__)
-            directory = os.path.join(containing_directory, "autoinstall.cache.d");
-
-        self.directory = directory
-        try:
-            if not os.path.exists(self.directory):
-                self._create_cache_directory()
-        except Exception, err:
-            _logger.exception(err)
-            self.cache_directry = tempfile.mkdtemp()
-        _logger.info("Using cache directory '%s'." % self.directory)
-    
-    def _create_cache_directory(self):
-        _logger.debug("Creating cache directory '%s'." % self.directory)
-        os.mkdir(self.directory)
-        readme_path = os.path.join(self.directory, "README")
-        with open(readme_path, "w") as f:
-            f.write("This directory was auto-generated by '%s'.\n"
-                    "It is safe to delete.\n" % __file__)
-
-    def get(self, url):
-        _logger.info("Getting '%s' from cache." % url)
-        filename = url.rsplit("/")[-1]
-
-        # so that source url is significant in determining cache hits
-        d = os.path.join(self.directory, "%s" % hash(url))
-        if not os.path.exists(d):
-            os.mkdir(d)
-
-        filename = os.path.join(d, filename) 
-
-        if os.path.exists(filename):
-            _logger.debug("... already cached in file '%s'." % filename)
-        else:
-            _logger.debug("... not in cache. Caching in '%s'." % filename)
-            stream = file(filename, "wb")
-            self.download(url, stream)
-            stream.close()
-        return filename
-
-    def download(self, url, stream):
-        _logger.info("Downloading: %s" % url)
-        try:
-            netstream = urllib.urlopen(url)
-            code = 200
-            if hasattr(netstream, "getcode"):
-                code = netstream.getcode()
-            if not 200 <= code < 300:
-                raise ValueError("HTTP Error code %s" % code)
-        except Exception, err:
-            _logger.exception(err)
-
-        BUFSIZE = 2**13  # 8KB
-        size = 0
-        while True:
-            data = netstream.read(BUFSIZE)
-            if not data:
-                break
-            stream.write(data)
-            size += len(data)
-        netstream.close()
-        _logger.info("Downloaded %d bytes." % size)
-
-
-class Importer(object):
-
-    def __init__(self):
-        self.packages = {}
-        self.__cache = None
-
-    def __get_store(self):
-        return self.__store
-    store = property(__get_store)
-
-    def _get_cache(self):
-        if self.__cache is None:
-            self.__cache = Cache()
-        return self.__cache
-    def _set_cache(self, cache):
-        self.__cache = cache
-    cache = property(_get_cache, _set_cache)
-
-    def find_module(self, fullname, path=None):
-        """-> self or None.
-
-        Search for a module specified by 'fullname'. 'fullname' must be
-        the fully qualified (dotted) module name. It returns the
-        zipimporter instance itself if the module was found, or None if
-        it wasn't. The optional 'path' argument is ignored -- it's
-        there for compatibility with the importer protocol.");
-        """
-        _logger.debug("find_module(%s, path=%s)" % (fullname, path))
-
-        if fullname in self.packages:
-            (url, zip_subpath) = self.packages[fullname]
-            filename = self.cache.get(url)
-            zip_path = "%s/%s" % (filename, zip_subpath) if zip_subpath else filename
-            _logger.debug("fullname: %s url: %s path: %s zip_path: %s" % (fullname, url, path, zip_path))
-            try:
-                loader = zipimport.zipimporter(zip_path)
-                _logger.debug("returning: %s" % loader)
-            except Exception, e:
-                _logger.exception(e)
-                return None
-            return loader
-        return None
-
-    def bind(self, package_name, url, zip_subpath):
-        _logger.info("binding: %s -> %s subpath: %s" % (package_name, url, zip_subpath))
-        self.packages[package_name] = (url, zip_subpath)
-
-
-if __name__=="__main__":
-    import logging
-    #logging.basicConfig()
-    logger = logging.getLogger()
-
-    console = logging.StreamHandler()
-    console.setLevel(logging.DEBUG)
-    # set a format which is simpler for console use
-    formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
-    # tell the handler to use this format
-    console.setFormatter(formatter)
-    # add the handler to the root logger
-    logger.addHandler(console)
-    logger.setLevel(logging.INFO)
-
-    bind("pymarc", "http://pypi.python.org/packages/2.5/p/pymarc/pymarc-2.1-py2.5.egg")
-
-    import pymarc
-
-    print pymarc.__version__, pymarc.__file__
-
-    assert pymarc.__version__=="2.1"
-
-    d = _getImporter().cache.directory
-    assert d in pymarc.__file__, "'%s' not found in pymarc.__file__ (%s)" % (d, pymarc.__file__)
-
-    # Can now also bind to non top level packages. The packages
-    # leading up to the package being bound will need to be defined
-    # however.
-    #
-    # bind("rdf.plugins.stores.memory", 
-    #      "http://pypi.python.org/packages/2.5/r/rdf.plugins.stores.memeory/rdf.plugins.stores.memory-0.9a-py2.5.egg")
-    #
-    # from rdf.plugins.stores.memory import Memory
-
-
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla.py b/WebKitTools/Scripts/webkitpy/bugzilla.py
deleted file mode 100644
index 4506af2..0000000
--- a/WebKitTools/Scripts/webkitpy/bugzilla.py
+++ /dev/null
@@ -1,790 +0,0 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Copyright (c) 2009 Apple Inc. All rights reserved.
-# Copyright (c) 2010 Research In Motion Limited. 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.
-#
-# WebKit's Python module for interacting with Bugzilla
-
-import re
-import subprocess
-
-from datetime import datetime # used in timestamp()
-
-# Import WebKit-specific modules.
-from webkitpy.webkit_logging import error, log
-from webkitpy.committers import CommitterList
-from webkitpy.credentials import Credentials
-from webkitpy.user import User
-
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup, SoupStrainer
-
-from mechanize import Browser
-
-
-def parse_bug_id(message):
-    match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message)
-    if match:
-        return int(match.group('bug_id'))
-    match = re.search(
-        Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)",
-        message)
-    if match:
-        return int(match.group('bug_id'))
-    return None
-
-
-def timestamp():
-    return datetime.now().strftime("%Y%m%d%H%M%S")
-
-
-class Attachment(object):
-
-    def __init__(self, attachment_dictionary, bug):
-        self._attachment_dictionary = attachment_dictionary
-        self._bug = bug
-        self._reviewer = None
-        self._committer = None
-
-    def _bugzilla(self):
-        return self._bug._bugzilla
-
-    def id(self):
-        return int(self._attachment_dictionary.get("id"))
-
-    def attacher_is_committer(self):
-        return self._bugzilla.committers.committer_by_email(
-            patch.attacher_email())
-
-    def attacher_email(self):
-        return self._attachment_dictionary.get("attacher_email")
-
-    def bug(self):
-        return self._bug
-
-    def bug_id(self):
-        return int(self._attachment_dictionary.get("bug_id"))
-
-    def is_patch(self):
-        return not not self._attachment_dictionary.get("is_patch")
-
-    def is_obsolete(self):
-        return not not self._attachment_dictionary.get("is_obsolete")
-
-    def name(self):
-        return self._attachment_dictionary.get("name")
-
-    def review(self):
-        return self._attachment_dictionary.get("review")
-
-    def commit_queue(self):
-        return self._attachment_dictionary.get("commit-queue")
-
-    def url(self):
-        # FIXME: This should just return
-        # self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
-        # depends on the current behavior.
-        return self._attachment_dictionary.get("url")
-
-    def _validate_flag_value(self, flag):
-        email = self._attachment_dictionary.get("%s_email" % flag)
-        if not email:
-            return None
-        committer = getattr(self._bugzilla().committers,
-                            "%s_by_email" % flag)(email)
-        if committer:
-            return committer
-        log("Warning, attachment %s on bug %s has invalid %s (%s)" % (
-                 self._attachment_dictionary['id'],
-                 self._attachment_dictionary['bug_id'], flag, email))
-
-    def reviewer(self):
-        if not self._reviewer:
-            self._reviewer = self._validate_flag_value("reviewer")
-        return self._reviewer
-
-    def committer(self):
-        if not self._committer:
-            self._committer = self._validate_flag_value("committer")
-        return self._committer
-
-
-class Bug(object):
-    # FIXME: This class is kinda a hack for now.  It exists so we have one
-    # place to hold bug logic, even if much of the code deals with
-    # dictionaries still.
-
-    def __init__(self, bug_dictionary, bugzilla):
-        self.bug_dictionary = bug_dictionary
-        self._bugzilla = bugzilla
-
-    def id(self):
-        return self.bug_dictionary["id"]
-
-    def assigned_to_email(self):
-        return self.bug_dictionary["assigned_to_email"]
-
-    # Rarely do we actually want obsolete attachments
-    def attachments(self, include_obsolete=False):
-        attachments = self.bug_dictionary["attachments"]
-        if not include_obsolete:
-            attachments = filter(lambda attachment:
-                                 not attachment["is_obsolete"], attachments)
-        return [Attachment(attachment, self) for attachment in attachments]
-
-    def patches(self, include_obsolete=False):
-        return [patch for patch in self.attachments(include_obsolete)
-                                   if patch.is_patch()]
-
-    def unreviewed_patches(self):
-        return [patch for patch in self.patches() if patch.review() == "?"]
-
-    def reviewed_patches(self, include_invalid=False):
-        patches = [patch for patch in self.patches() if patch.review() == "+"]
-        if include_invalid:
-            return patches
-        # Checking reviewer() ensures that it was both reviewed and has a valid
-        # reviewer.
-        return filter(lambda patch: patch.reviewer(), patches)
-
-    def commit_queued_patches(self, include_invalid=False):
-        patches = [patch for patch in self.patches()
-                                      if patch.commit_queue() == "+"]
-        if include_invalid:
-            return patches
-        # Checking committer() ensures that it was both commit-queue+'d and has
-        # a valid committer.
-        return filter(lambda patch: patch.committer(), patches)
-
-
-# A container for all of the logic for making and parsing buzilla queries.
-class BugzillaQueries(object):
-
-    def __init__(self, bugzilla):
-        self._bugzilla = bugzilla
-
-    # Note: _load_query and _fetch_bug are the only two methods which access
-    # self._bugzilla.
-
-    def _load_query(self, query):
-        self._bugzilla.authenticate()
-
-        full_url = "%s%s" % (self._bugzilla.bug_server_url, query)
-        return self._bugzilla.browser.open(full_url)
-
-    def _fetch_bug(self, bug_id):
-        return self._bugzilla.fetch_bug(bug_id)
-
-    def _fetch_bug_ids_advanced_query(self, query):
-        soup = BeautifulSoup(self._load_query(query))
-        # The contents of the <a> inside the cells in the first column happen
-        # to be the bug id.
-        return [int(bug_link_cell.find("a").string)
-                for bug_link_cell in soup('td', "first-child")]
-
-    def _parse_attachment_ids_request_query(self, page):
-        digits = re.compile("\d+")
-        attachment_href = re.compile("attachment.cgi\?id=\d+&action=review")
-        attachment_links = SoupStrainer("a", href=attachment_href)
-        return [int(digits.search(tag["href"]).group(0))
-                for tag in BeautifulSoup(page, parseOnlyThese=attachment_links)]
-
-    def _fetch_attachment_ids_request_query(self, query):
-        return self._parse_attachment_ids_request_query(self._load_query(query))
-
-    # List of all r+'d bugs.
-    def fetch_bug_ids_from_pending_commit_list(self):
-        needs_commit_query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review%2B"
-        return self._fetch_bug_ids_advanced_query(needs_commit_query_url)
-
-    def fetch_patches_from_pending_commit_list(self):
-        return sum([self._fetch_bug(bug_id).reviewed_patches()
-            for bug_id in self.fetch_bug_ids_from_pending_commit_list()], [])
-
-    def fetch_bug_ids_from_commit_queue(self):
-        commit_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=commit-queue%2B&order=Last+Changed"
-        return self._fetch_bug_ids_advanced_query(commit_queue_url)
-
-    def fetch_patches_from_commit_queue(self):
-        # This function will only return patches which have valid committers
-        # set.  It won't reject patches with invalid committers/reviewers.
-        return sum([self._fetch_bug(bug_id).commit_queued_patches()
-                    for bug_id in self.fetch_bug_ids_from_commit_queue()], [])
-
-    def _fetch_bug_ids_from_review_queue(self):
-        review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
-        return self._fetch_bug_ids_advanced_query(review_queue_url)
-
-    def fetch_patches_from_review_queue(self, limit=None):
-        # [:None] returns the whole array.
-        return sum([self._fetch_bug(bug_id).unreviewed_patches()
-            for bug_id in self._fetch_bug_ids_from_review_queue()[:limit]], [])
-
-    # FIXME: Why do we have both fetch_patches_from_review_queue and
-    # fetch_attachment_ids_from_review_queue??
-    # NOTE: This is also the only client of _fetch_attachment_ids_request_query
-
-    def fetch_attachment_ids_from_review_queue(self):
-        review_queue_url = "request.cgi?action=queue&type=review&group=type"
-        return self._fetch_attachment_ids_request_query(review_queue_url)
-
-
-class CommitterValidator(object):
-
-    def __init__(self, bugzilla):
-        self._bugzilla = bugzilla
-
-    # _view_source_url belongs in some sort of webkit_config.py module.
-    def _view_source_url(self, local_path):
-        return "http://trac.webkit.org/browser/trunk/%s" % local_path
-
-    def _flag_permission_rejection_message(self, setter_email, flag_name):
-        # This could be computed from CommitterList.__file__
-        committer_list = "WebKitTools/Scripts/webkitpy/committers.py"
-        # Should come from some webkit_config.py
-        contribution_guidlines = "http://webkit.org/coding/contributing.html"
-        # This could be queried from the status_server.
-        queue_administrator = "eseidel@chromium.org"
-        # This could be queried from the tool.
-        queue_name = "commit-queue"
-        message = "%s does not have %s permissions according to %s." % (
-                        setter_email,
-                        flag_name,
-                        self._view_source_url(committer_list))
-        message += "\n\n- If you do not have %s rights please read %s for instructions on how to use bugzilla flags." % (
-                        flag_name, contribution_guidlines)
-        message += "\n\n- If you have %s rights please correct the error in %s by adding yourself to the file (no review needed).  " % (
-                        flag_name, committer_list)
-        message += "Due to bug 30084 the %s will require a restart after your change.  " % queue_name
-        message += "Please contact %s to request a %s restart.  " % (
-                        queue_administrator, queue_name)
-        message += "After restart the %s will correctly respect your %s rights." % (
-                        queue_name, flag_name)
-        return message
-
-    def _validate_setter_email(self, patch, result_key, rejection_function):
-        committer = getattr(patch, result_key)()
-        # If the flag is set, and we don't recognize the setter, reject the
-        # flag!
-        setter_email = patch._attachment_dictionary.get("%s_email" % result_key)
-        if setter_email and not committer:
-            rejection_function(patch.id(),
-                self._flag_permission_rejection_message(setter_email,
-                                                        result_key))
-            return False
-        return True
-
-    def patches_after_rejecting_invalid_commiters_and_reviewers(self, patches):
-        validated_patches = []
-        for patch in patches:
-            if (self._validate_setter_email(
-                    patch, "reviewer", self.reject_patch_from_review_queue)
-                and self._validate_setter_email(
-                    patch, "committer", self.reject_patch_from_commit_queue)):
-                validated_patches.append(patch)
-        return validated_patches
-
-    def reject_patch_from_commit_queue(self,
-                                       attachment_id,
-                                       additional_comment_text=None):
-        comment_text = "Rejecting patch %s from commit-queue." % attachment_id
-        self._bugzilla.set_flag_on_attachment(attachment_id,
-                                              "commit-queue",
-                                              "-",
-                                              comment_text,
-                                              additional_comment_text)
-
-    def reject_patch_from_review_queue(self,
-                                       attachment_id,
-                                       additional_comment_text=None):
-        comment_text = "Rejecting patch %s from review queue." % attachment_id
-        self._bugzilla.set_flag_on_attachment(attachment_id,
-                                              'review',
-                                              '-',
-                                              comment_text,
-                                              additional_comment_text)
-
-
-class Bugzilla(object):
-
-    def __init__(self, dryrun=False, committers=CommitterList()):
-        self.dryrun = dryrun
-        self.authenticated = False
-        self.queries = BugzillaQueries(self)
-        self.committers = committers
-
-        # FIXME: We should use some sort of Browser mock object when in dryrun
-        # mode (to prevent any mistakes).
-        self.browser = Browser()
-        # Ignore bugs.webkit.org/robots.txt until we fix it to allow this
-        # script.
-        self.browser.set_handle_robots(False)
-
-    # FIXME: Much of this should go into some sort of config module:
-    bug_server_host = "bugs.webkit.org"
-    bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host)
-    bug_server_url = "https://%s/" % bug_server_host
-    unassigned_email = "webkit-unassigned@lists.webkit.org"
-
-    def bug_url_for_bug_id(self, bug_id, xml=False):
-        content_type = "&ctype=xml" if xml else ""
-        return "%sshow_bug.cgi?id=%s%s" % (self.bug_server_url,
-                                           bug_id,
-                                           content_type)
-
-    def short_bug_url_for_bug_id(self, bug_id):
-        return "http://webkit.org/b/%s" % bug_id
-
-    def attachment_url_for_id(self, attachment_id, action="view"):
-        action_param = ""
-        if action and action != "view":
-            action_param = "&action=%s" % action
-        return "%sattachment.cgi?id=%s%s" % (self.bug_server_url,
-                                             attachment_id,
-                                             action_param)
-
-    def _parse_attachment_flag(self,
-                               element,
-                               flag_name,
-                               attachment,
-                               result_key):
-        flag = element.find('flag', attrs={'name': flag_name})
-        if flag:
-            attachment[flag_name] = flag['status']
-            if flag['status'] == '+':
-                attachment[result_key] = flag['setter']
-
-    def _parse_attachment_element(self, element, bug_id):
-        attachment = {}
-        attachment['bug_id'] = bug_id
-        attachment['is_obsolete'] = (element.has_key('isobsolete') and element['isobsolete'] == "1")
-        attachment['is_patch'] = (element.has_key('ispatch') and element['ispatch'] == "1")
-        attachment['id'] = int(element.find('attachid').string)
-        # FIXME: No need to parse out the url here.
-        attachment['url'] = self.attachment_url_for_id(attachment['id'])
-        attachment['name'] = unicode(element.find('desc').string)
-        attachment['attacher_email'] = str(element.find('attacher').string)
-        attachment['type'] = str(element.find('type').string)
-        self._parse_attachment_flag(
-                element, 'review', attachment, 'reviewer_email')
-        self._parse_attachment_flag(
-                element, 'commit-queue', attachment, 'committer_email')
-        return attachment
-
-    def _parse_bug_page(self, page):
-        soup = BeautifulSoup(page)
-        bug = {}
-        bug["id"] = int(soup.find("bug_id").string)
-        bug["title"] = unicode(soup.find("short_desc").string)
-        bug["reporter_email"] = str(soup.find("reporter").string)
-        bug["assigned_to_email"] = str(soup.find("assigned_to").string)
-        bug["cc_emails"] = [str(element.string)
-                            for element in soup.findAll('cc')]
-        bug["attachments"] = [self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment')]
-        return bug
-
-    # Makes testing fetch_*_from_bug() possible until we have a better
-    # BugzillaNetwork abstration.
-
-    def _fetch_bug_page(self, bug_id):
-        bug_url = self.bug_url_for_bug_id(bug_id, xml=True)
-        log("Fetching: %s" % bug_url)
-        return self.browser.open(bug_url)
-
-    def fetch_bug_dictionary(self, bug_id):
-        return self._parse_bug_page(self._fetch_bug_page(bug_id))
-
-    # FIXME: A BugzillaCache object should provide all these fetch_ methods.
-
-    def fetch_bug(self, bug_id):
-        return Bug(self.fetch_bug_dictionary(bug_id), self)
-
-    def _parse_bug_id_from_attachment_page(self, page):
-        # The "Up" relation happens to point to the bug.
-        up_link = BeautifulSoup(page).find('link', rel='Up')
-        if not up_link:
-            # This attachment does not exist (or you don't have permissions to
-            # view it).
-            return None
-        match = re.search("show_bug.cgi\?id=(?P<bug_id>\d+)", up_link['href'])
-        return int(match.group('bug_id'))
-
-    def bug_id_for_attachment_id(self, attachment_id):
-        self.authenticate()
-
-        attachment_url = self.attachment_url_for_id(attachment_id, 'edit')
-        log("Fetching: %s" % attachment_url)
-        page = self.browser.open(attachment_url)
-        return self._parse_bug_id_from_attachment_page(page)
-
-    # FIXME: This should just return Attachment(id), which should be able to
-    # lazily fetch needed data.
-
-    def fetch_attachment(self, attachment_id):
-        # We could grab all the attachment details off of the attachment edit
-        # page but we already have working code to do so off of the bugs page,
-        # so re-use that.
-        bug_id = self.bug_id_for_attachment_id(attachment_id)
-        if not bug_id:
-            return None
-        attachments = self.fetch_bug(bug_id).attachments(include_obsolete=True)
-        for attachment in attachments:
-            if attachment.id() == int(attachment_id):
-                return attachment
-        return None # This should never be hit.
-
-    def authenticate(self):
-        if self.authenticated:
-            return
-
-        if self.dryrun:
-            log("Skipping log in for dry run...")
-            self.authenticated = True
-            return
-
-        attempts = 0
-        while not self.authenticated:
-            attempts += 1
-            (username, password) = Credentials(
-                self.bug_server_host, git_prefix="bugzilla").read_credentials()
-
-            log("Logging in as %s..." % username)
-            self.browser.open(self.bug_server_url +
-                              "index.cgi?GoAheadAndLogIn=1")
-            self.browser.select_form(name="login")
-            self.browser['Bugzilla_login'] = username
-            self.browser['Bugzilla_password'] = password
-            response = self.browser.submit()
-
-            match = re.search("<title>(.+?)</title>", response.read())
-            # If the resulting page has a title, and it contains the word
-            # "invalid" assume it's the login failure page.
-            if match and re.search("Invalid", match.group(1), re.IGNORECASE):
-                errorMessage = "Bugzilla login failed: %s" % match.group(1)
-                # raise an exception only if this was the last attempt
-                if attempts < 5:
-                    log(errorMessage)
-                else:
-                    raise Exception(errorMessage)
-            else:
-                self.authenticated = True
-
-    def _fill_attachment_form(self,
-                              description,
-                              patch_file_object,
-                              comment_text=None,
-                              mark_for_review=False,
-                              mark_for_commit_queue=False,
-                              mark_for_landing=False, bug_id=None):
-        self.browser['description'] = description
-        self.browser['ispatch'] = ("1",)
-        self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
-
-        if mark_for_landing:
-            self.browser['flag_type-3'] = ('+',)
-        elif mark_for_commit_queue:
-            self.browser['flag_type-3'] = ('?',)
-        else:
-            self.browser['flag_type-3'] = ('X',)
-
-        if bug_id:
-            patch_name = "bug-%s-%s.patch" % (bug_id, timestamp())
-        else:
-            patch_name ="%s.patch" % timestamp()
-        self.browser.add_file(patch_file_object,
-                              "text/plain",
-                              patch_name,
-                              'data')
-
-    def add_patch_to_bug(self,
-                         bug_id,
-                         patch_file_object,
-                         description,
-                         comment_text=None,
-                         mark_for_review=False,
-                         mark_for_commit_queue=False,
-                         mark_for_landing=False):
-        self.authenticate()
-
-        log('Adding patch "%s" to %sshow_bug.cgi?id=%s' % (description,
-                                                           self.bug_server_url,
-                                                           bug_id))
-
-        if self.dryrun:
-            log(comment_text)
-            return
-
-        self.browser.open("%sattachment.cgi?action=enter&bugid=%s" % (
-                          self.bug_server_url, bug_id))
-        self.browser.select_form(name="entryform")
-        self._fill_attachment_form(description,
-                                   patch_file_object,
-                                   mark_for_review=mark_for_review,
-                                   mark_for_commit_queue=mark_for_commit_queue,
-                                   mark_for_landing=mark_for_landing,
-                                   bug_id=bug_id)
-        if comment_text:
-            log(comment_text)
-            self.browser['comment'] = comment_text
-        self.browser.submit()
-
-    def prompt_for_component(self, components):
-        log("Please pick a component:")
-        i = 0
-        for name in components:
-            i += 1
-            log("%2d. %s" % (i, name))
-        result = int(User.prompt("Enter a number: ")) - 1
-        return components[result]
-
-    def _check_create_bug_response(self, response_html):
-        match = re.search("<title>Bug (?P<bug_id>\d+) Submitted</title>",
-                          response_html)
-        if match:
-            return match.group('bug_id')
-
-        match = re.search(
-            '<div id="bugzilla-body">(?P<error_message>.+)<div id="footer">',
-            response_html,
-            re.DOTALL)
-        error_message = "FAIL"
-        if match:
-            text_lines = BeautifulSoup(
-                    match.group('error_message')).findAll(text=True)
-            error_message = "\n" + '\n'.join(
-                    ["  " + line.strip()
-                     for line in text_lines if line.strip()])
-        raise Exception("Bug not created: %s" % error_message)
-
-    def create_bug(self,
-                   bug_title,
-                   bug_description,
-                   component=None,
-                   patch_file_object=None,
-                   patch_description=None,
-                   cc=None,
-                   mark_for_review=False,
-                   mark_for_commit_queue=False):
-        self.authenticate()
-
-        log('Creating bug with title "%s"' % bug_title)
-        if self.dryrun:
-            log(bug_description)
-            return
-
-        self.browser.open(self.bug_server_url + "enter_bug.cgi?product=WebKit")
-        self.browser.select_form(name="Create")
-        component_items = self.browser.find_control('component').items
-        component_names = map(lambda item: item.name, component_items)
-        if not component:
-            component = "New Bugs"
-        if component not in component_names:
-            component = self.prompt_for_component(component_names)
-        self.browser['component'] = [component]
-        if cc:
-            self.browser['cc'] = cc
-        self.browser['short_desc'] = bug_title
-        self.browser['comment'] = bug_description
-
-        if patch_file_object:
-            self._fill_attachment_form(
-                    patch_description,
-                    patch_file_object,
-                    mark_for_review=mark_for_review,
-                    mark_for_commit_queue=mark_for_commit_queue)
-
-        response = self.browser.submit()
-
-        bug_id = self._check_create_bug_response(response.read())
-        log("Bug %s created." % bug_id)
-        log("%sshow_bug.cgi?id=%s" % (self.bug_server_url, bug_id))
-        return bug_id
-
-    def _find_select_element_for_flag(self, flag_name):
-        # FIXME: This will break if we ever re-order attachment flags
-        if flag_name == "review":
-            return self.browser.find_control(type='select', nr=0)
-        if flag_name == "commit-queue":
-            return self.browser.find_control(type='select', nr=1)
-        raise Exception("Don't know how to find flag named \"%s\"" % flag_name)
-
-    def clear_attachment_flags(self,
-                               attachment_id,
-                               additional_comment_text=None):
-        self.authenticate()
-
-        comment_text = "Clearing flags on attachment: %s" % attachment_id
-        if additional_comment_text:
-            comment_text += "\n\n%s" % additional_comment_text
-        log(comment_text)
-
-        if self.dryrun:
-            return
-
-        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
-        self.browser.select_form(nr=1)
-        self.browser.set_value(comment_text, name='comment', nr=0)
-        self._find_select_element_for_flag('review').value = ("X",)
-        self._find_select_element_for_flag('commit-queue').value = ("X",)
-        self.browser.submit()
-
-    def set_flag_on_attachment(self,
-                               attachment_id,
-                               flag_name,
-                               flag_value,
-                               comment_text,
-                               additional_comment_text):
-        # FIXME: We need a way to test this function on a live bugzilla
-        # instance.
-
-        self.authenticate()
-
-        if additional_comment_text:
-            comment_text += "\n\n%s" % additional_comment_text
-        log(comment_text)
-
-        if self.dryrun:
-            return
-
-        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
-        self.browser.select_form(nr=1)
-        self.browser.set_value(comment_text, name='comment', nr=0)
-        self._find_select_element_for_flag(flag_name).value = (flag_value,)
-        self.browser.submit()
-
-    # FIXME: All of these bug editing methods have a ridiculous amount of
-    # copy/paste code.
-
-    def obsolete_attachment(self, attachment_id, comment_text=None):
-        self.authenticate()
-
-        log("Obsoleting attachment: %s" % attachment_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
-        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
-        self.browser.select_form(nr=1)
-        self.browser.find_control('isobsolete').items[0].selected = True
-        # Also clear any review flag (to remove it from review/commit queues)
-        self._find_select_element_for_flag('review').value = ("X",)
-        self._find_select_element_for_flag('commit-queue').value = ("X",)
-        if comment_text:
-            log(comment_text)
-            # Bugzilla has two textareas named 'comment', one is somehow
-            # hidden.  We want the first.
-            self.browser.set_value(comment_text, name='comment', nr=0)
-        self.browser.submit()
-
-    def add_cc_to_bug(self, bug_id, email_address_list):
-        self.authenticate()
-
-        log("Adding %s to the CC list for bug %s" % (email_address_list,
-                                                     bug_id))
-        if self.dryrun:
-            return
-
-        self.browser.open(self.bug_url_for_bug_id(bug_id))
-        self.browser.select_form(name="changeform")
-        self.browser["newcc"] = ", ".join(email_address_list)
-        self.browser.submit()
-
-    def post_comment_to_bug(self, bug_id, comment_text, cc=None):
-        self.authenticate()
-
-        log("Adding comment to bug %s" % bug_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
-        self.browser.open(self.bug_url_for_bug_id(bug_id))
-        self.browser.select_form(name="changeform")
-        self.browser["comment"] = comment_text
-        if cc:
-            self.browser["newcc"] = ", ".join(cc)
-        self.browser.submit()
-
-    def close_bug_as_fixed(self, bug_id, comment_text=None):
-        self.authenticate()
-
-        log("Closing bug %s as fixed" % bug_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
-        self.browser.open(self.bug_url_for_bug_id(bug_id))
-        self.browser.select_form(name="changeform")
-        if comment_text:
-            log(comment_text)
-            self.browser['comment'] = comment_text
-        self.browser['bug_status'] = ['RESOLVED']
-        self.browser['resolution'] = ['FIXED']
-        self.browser.submit()
-
-    def reassign_bug(self, bug_id, assignee, comment_text=None):
-        self.authenticate()
-
-        log("Assigning bug %s to %s" % (bug_id, assignee))
-        if self.dryrun:
-            log(comment_text)
-            return
-
-        self.browser.open(self.bug_url_for_bug_id(bug_id))
-        self.browser.select_form(name="changeform")
-        if comment_text:
-            log(comment_text)
-            self.browser["comment"] = comment_text
-        self.browser["assigned_to"] = assignee
-        self.browser.submit()
-
-    def reopen_bug(self, bug_id, comment_text):
-        self.authenticate()
-
-        log("Re-opening bug %s" % bug_id)
-        # Bugzilla requires a comment when re-opening a bug, so we know it will
-        # never be None.
-        log(comment_text)
-        if self.dryrun:
-            return
-
-        self.browser.open(self.bug_url_for_bug_id(bug_id))
-        self.browser.select_form(name="changeform")
-        bug_status = self.browser.find_control("bug_status", type="select")
-        # This is a hack around the fact that ClientForm.ListControl seems to
-        # have no simpler way to ask if a control has an item named "REOPENED"
-        # without using exceptions for control flow.
-        possible_bug_statuses = map(lambda item: item.name, bug_status.items)
-        if "REOPENED" in possible_bug_statuses:
-            bug_status.value = ["REOPENED"]
-        else:
-            log("Did not reopen bug %s.  " +
-                "It appears to already be open with status %s." % (
-                        bug_id, bug_status.value))
-        self.browser['comment'] = comment_text
-        self.browser.submit()
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla_unittest.py b/WebKitTools/Scripts/webkitpy/bugzilla_unittest.py
deleted file mode 100644
index d555f78..0000000
--- a/WebKitTools/Scripts/webkitpy/bugzilla_unittest.py
+++ /dev/null
@@ -1,303 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.committers import CommitterList, Reviewer, Committer
-from webkitpy.bugzilla import Bugzilla, BugzillaQueries, parse_bug_id, CommitterValidator
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
-
-from webkitpy.BeautifulSoup import BeautifulSoup
-
-
-class MockBrowser(object):
-    def open(self, url):
-        pass
-
-    def select_form(self, name):
-        pass
-
-    def __setitem__(self, key, value):
-        pass
-
-    def submit(self):
-        pass
-
-class CommitterValidatorTest(unittest.TestCase):
-    def test_flag_permission_rejection_message(self):
-        validator = CommitterValidator(bugzilla=None)
-        expected_messsage="""foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/committers.py.
-
-- If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
-
-- If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/committers.py by adding yourself to the file (no review needed).  Due to bug 30084 the commit-queue will require a restart after your change.  Please contact eseidel@chromium.org to request a commit-queue restart.  After restart the commit-queue will correctly respect your review rights."""
-        self.assertEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage)
-
-
-class BugzillaTest(unittest.TestCase):
-    _example_attachment = '''
-        <attachment
-          isobsolete="1"
-          ispatch="1"
-          isprivate="0"
-        >
-        <attachid>33721</attachid>
-        <date>2009-07-29 10:23 PDT</date>
-        <desc>Fixed whitespace issue</desc>
-        <filename>patch</filename>
-        <type>text/plain</type>
-        <size>9719</size>
-        <attacher>christian.plesner.hansen@gmail.com</attacher>
-          <flag name="review"
-                id="17931"
-                status="+"
-                setter="one@test.com"
-           />
-          <flag name="commit-queue"
-                id="17932"
-                status="+"
-                setter="two@test.com"
-           />
-        </attachment>
-'''
-    _expected_example_attachment_parsing = {
-        'bug_id' : 100,
-        'is_obsolete' : True,
-        'is_patch' : True,
-        'id' : 33721,
-        'url' : "https://bugs.webkit.org/attachment.cgi?id=33721",
-        'name' : "Fixed whitespace issue",
-        'type' : "text/plain",
-        'review' : '+',
-        'reviewer_email' : 'one@test.com',
-        'commit-queue' : '+',
-        'committer_email' : 'two@test.com',
-        'attacher_email' : 'christian.plesner.hansen@gmail.com',
-    }
-
-    def test_parse_bug_id(self):
-        # FIXME: These would be all better as doctests
-        bugs = Bugzilla()
-        self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
-        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
-        self.assertEquals(12345, parse_bug_id(bugs.short_bug_url_for_bug_id(12345)))
-        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345)))
-        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))
-
-        # Our bug parser is super-fragile, but at least we're testing it.
-        self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345"))
-        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345"))
-
-    _example_bug = """
-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/bugzilla.dtd">
-<bugzilla version="3.2.3"
-          urlbase="https://bugs.webkit.org/"
-          maintainer="admin@webkit.org"
-          exporter="eric@webkit.org"
->
-    <bug>
-          <bug_id>32585</bug_id>
-          <creation_ts>2009-12-15 15:17 PST</creation_ts>
-          <short_desc>bug to test webkit-patch and commit-queue failures</short_desc>
-          <delta_ts>2009-12-27 21:04:50 PST</delta_ts>
-          <reporter_accessible>1</reporter_accessible>
-          <cclist_accessible>1</cclist_accessible>
-          <classification_id>1</classification_id>
-          <classification>Unclassified</classification>
-          <product>WebKit</product>
-          <component>Tools / Tests</component>
-          <version>528+ (Nightly build)</version>
-          <rep_platform>PC</rep_platform>
-          <op_sys>Mac OS X 10.5</op_sys>
-          <bug_status>NEW</bug_status>
-          <priority>P2</priority>
-          <bug_severity>Normal</bug_severity>
-          <target_milestone>---</target_milestone>
-          <everconfirmed>1</everconfirmed>
-          <reporter name="Eric Seidel">eric@webkit.org</reporter>
-          <assigned_to name="Nobody">webkit-unassigned@lists.webkit.org</assigned_to>
-          <cc>foo@bar.com</cc>
-    <cc>example@example.com</cc>
-          <long_desc isprivate="0">
-            <who name="Eric Seidel">eric@webkit.org</who>
-            <bug_when>2009-12-15 15:17:28 PST</bug_when>
-            <thetext>bug to test webkit-patch and commit-queue failures
-
-Ignore this bug.  Just for testing failure modes of webkit-patch and the commit-queue.</thetext>
-          </long_desc>
-          <attachment 
-              isobsolete="0"
-              ispatch="1"
-              isprivate="0"
-          > 
-            <attachid>45548</attachid> 
-            <date>2009-12-27 23:51 PST</date> 
-            <desc>Patch</desc> 
-            <filename>bug-32585-20091228005112.patch</filename> 
-            <type>text/plain</type> 
-            <size>10882</size> 
-            <attacher>mjs@apple.com</attacher> 
-            
-              <token>1261988248-dc51409e9c421a4358f365fa8bec8357</token> 
-              <data encoding="base64">SW5kZXg6IFdlYktpdC9tYWMvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
-removed-because-it-was-really-long
-ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
-</data>        
- 
-              <flag name="review"
-                    id="27602"
-                    status="?"
-                    setter="mjs@apple.com"
-               /> 
-          </attachment> 
-    </bug>
-</bugzilla>
-"""
-    _expected_example_bug_parsing = {
-        "id" : 32585,
-        "title" : u"bug to test webkit-patch and commit-queue failures",
-        "cc_emails" : ["foo@bar.com", "example@example.com"],
-        "reporter_email" : "eric@webkit.org",
-        "assigned_to_email" : "webkit-unassigned@lists.webkit.org",
-        "attachments" : [{
-            'name': u'Patch',
-            'url' : "https://bugs.webkit.org/attachment.cgi?id=45548",
-            'is_obsolete': False,
-            'review': '?',
-            'is_patch': True,
-            'attacher_email': 'mjs@apple.com',
-            'bug_id': 32585,
-            'type': 'text/plain',
-            'id': 45548
-        }],
-    }
-
-    def _assert_dictionaries_equal(self, actual, expected):
-        # Make sure we aren't parsing more or less than we expect
-        self.assertEquals(sorted(actual.keys()), sorted(expected.keys()))
-
-        for key, expected_value in expected.items():
-            self.assertEquals(actual[key], expected_value, ("Failure for key: %s: Actual='%s' Expected='%s'" % (key, actual[key], expected_value)))
-
-    def test_bug_parsing(self):
-        bug = Bugzilla()._parse_bug_page(self._example_bug)
-        self._assert_dictionaries_equal(bug, self._expected_example_bug_parsing)
-
-    # This could be combined into test_bug_parsing later if desired.
-    def test_attachment_parsing(self):
-        bugzilla = Bugzilla()
-        soup = BeautifulSoup(self._example_attachment)
-        attachment_element = soup.find("attachment")
-        attachment = bugzilla._parse_attachment_element(attachment_element, self._expected_example_attachment_parsing['bug_id'])
-        self.assertTrue(attachment)
-        self._assert_dictionaries_equal(attachment, self._expected_example_attachment_parsing)
-
-    _sample_attachment_detail_page = """
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-                      "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-  <head>
-    <title>
-  Attachment 41073 Details for Bug 27314</title>
-<link rel="Top" href="https://bugs.webkit.org/">
-    <link rel="Up" href="show_bug.cgi?id=27314">
-"""
-
-    def test_attachment_detail_bug_parsing(self):
-        bugzilla = Bugzilla()
-        self.assertEquals(27314, bugzilla._parse_bug_id_from_attachment_page(self._sample_attachment_detail_page))
-
-    def test_add_cc_to_bug(self):
-        bugzilla = Bugzilla()
-        bugzilla.browser = MockBrowser()
-        bugzilla.authenticate = lambda: None
-        expected_stderr = "Adding ['adam@example.com'] to the CC list for bug 42\n"
-        OutputCapture().assert_outputs(self, bugzilla.add_cc_to_bug, [42, ["adam@example.com"]], expected_stderr=expected_stderr)
-
-
-class BugzillaQueriesTest(unittest.TestCase):
-    _sample_request_page = """
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-                      "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-  <head>
-    <title>Request Queue</title>
-  </head>
-<body>
-
-<h3>Flag: review</h3>
-  <table class="requests" cellspacing="0" cellpadding="4" border="1">
-    <tr>
-        <th>Requester</th>
-        <th>Requestee</th>
-        <th>Bug</th>
-        <th>Attachment</th>
-        <th>Created</th>
-    </tr>
-    <tr>
-        <td>Shinichiro Hamaji &lt;hamaji&#64;chromium.org&gt;</td>
-        <td></td>
-        <td><a href="show_bug.cgi?id=30015">30015: text-transform:capitalize is failing in CSS2.1 test suite</a></td>
-        <td><a href="attachment.cgi?id=40511&amp;action=review">
-40511: Patch v0</a></td>
-        <td>2009-10-02 04:58 PST</td>
-    </tr>
-    <tr>
-        <td>Zan Dobersek &lt;zandobersek&#64;gmail.com&gt;</td>
-        <td></td>
-        <td><a href="show_bug.cgi?id=26304">26304: [GTK] Add controls for playing html5 video.</a></td>
-        <td><a href="attachment.cgi?id=40722&amp;action=review">
-40722: Media controls, the simple approach</a></td>
-        <td>2009-10-06 09:13 PST</td>
-    </tr>
-    <tr>
-        <td>Zan Dobersek &lt;zandobersek&#64;gmail.com&gt;</td>
-        <td></td>
-        <td><a href="show_bug.cgi?id=26304">26304: [GTK] Add controls for playing html5 video.</a></td>
-        <td><a href="attachment.cgi?id=40723&amp;action=review">
-40723: Adjust the media slider thumb size</a></td>
-        <td>2009-10-06 09:15 PST</td>
-    </tr>
-  </table>
-</body>
-</html>
-"""
-
-    def test_request_page_parsing(self):
-        queries = BugzillaQueries(None)
-        self.assertEquals([40511, 40722, 40723], queries._parse_attachment_ids_request_query(self._sample_request_page))
-
-    def test_load_query(self):
-        queries = BugzillaQueries(Mock())
-        queries._load_query("request.cgi?action=queue&type=review&group=type")
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/buildbot.py b/WebKitTools/Scripts/webkitpy/buildbot.py
deleted file mode 100644
index 38828fd..0000000
--- a/WebKitTools/Scripts/webkitpy/buildbot.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (c) 2009, 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.
-#
-# WebKit's Python module for interacting with WebKit's buildbot
-
-import re
-import urllib2
-
-# Import WebKit-specific modules.
-from webkitpy.webkit_logging import log
-
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup
-
-
-class BuildBot:
-
-    default_host = "build.webkit.org"
-
-    def __init__(self, host=default_host):
-        self.buildbot_host = host
-        self.buildbot_server_url = "http://%s/" % self.buildbot_host
-
-        # If any Leopard builder/tester, Windows builder or Chromium builder is
-        # red we should not be landing patches.  Other builders should be added
-        # to this list once they are known to be reliable.
-        # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
-        self.core_builder_names_regexps = [
-            "Leopard",
-            "Windows.*Build",
-            "Chromium",
-        ]
-
-    def _parse_builder_status_from_row(self, status_row):
-        # If WebKit's buildbot has an XMLRPC interface we could use, we could
-        # do something more sophisticated here.  For now we just parse out the
-        # basics, enough to support basic questions like "is the tree green?"
-        status_cells = status_row.findAll('td')
-        builder = {}
-
-        name_link = status_cells[0].find('a')
-        builder['name'] = name_link.string
-        # We could generate the builder_url from the name in a future version
-        # of this code.
-        builder['builder_url'] = self.buildbot_server_url + name_link['href']
-
-        status_link = status_cells[1].find('a')
-        if not status_link:
-            # We failed to find a link in the first cell, just give up.  This
-            # can happen if a builder is just-added, the first cell will just
-            # be "no build"
-            # Other parts of the code depend on is_green being present.
-            builder['is_green'] = False
-            return builder
-        # Will be either a revision number or a build number
-        revision_string = status_link.string
-        # If revision_string has non-digits assume it's not a revision number.
-        builder['built_revision'] = int(revision_string) \
-                                    if not re.match('\D', revision_string) \
-                                    else None
-        builder['is_green'] = not re.search('fail',
-                                            status_cells[1].renderContents())
-        # We could parse out the build number instead, but for now just store
-        # the URL.
-        builder['build_url'] = self.buildbot_server_url + status_link['href']
-
-        # We could parse out the current activity too.
-
-        return builder
-
-    def _builder_statuses_with_names_matching_regexps(self,
-                                                      builder_statuses,
-                                                      name_regexps):
-        builders = []
-        for builder in builder_statuses:
-            for name_regexp in name_regexps:
-                if re.match(name_regexp, builder['name']):
-                    builders.append(builder)
-        return builders
-
-    def red_core_builders(self):
-        red_builders = []
-        for builder in self._builder_statuses_with_names_matching_regexps(
-                               self.builder_statuses(),
-                               self.core_builder_names_regexps):
-            if not builder['is_green']:
-                red_builders.append(builder)
-        return red_builders
-
-    def red_core_builders_names(self):
-        red_builders = self.red_core_builders()
-        return map(lambda builder: builder['name'], red_builders)
-
-    def core_builders_are_green(self):
-        return not self.red_core_builders()
-
-    def builder_statuses(self):
-        build_status_url = self.buildbot_server_url + 'one_box_per_builder'
-        page = urllib2.urlopen(build_status_url)
-        soup = BeautifulSoup(page)
-
-        builders = []
-        status_table = soup.find('table')
-        for status_row in status_table.findAll('tr'):
-            builder = self._parse_builder_status_from_row(status_row)
-            builders.append(builder)
-        return builders
diff --git a/WebKitTools/Scripts/webkitpy/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/buildbot_unittest.py
deleted file mode 100644
index bde3e04..0000000
--- a/WebKitTools/Scripts/webkitpy/buildbot_unittest.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.buildbot import BuildBot
-
-from webkitpy.BeautifulSoup import BeautifulSoup
-
-class BuildBotTest(unittest.TestCase):
-
-    _example_one_box_status = '''
-    <table>
-    <tr>
-    <td class="box"><a href="builders/Windows%20Debug%20%28Tests%29">Windows Debug (Tests)</a></td>
-      <td align="center" class="LastBuild box success"><a href="builders/Windows%20Debug%20%28Tests%29/builds/3693">47380</a><br />build<br />successful</td>
-      <td align="center" class="Activity building">building<br />ETA in<br />~ 14 mins<br />at 13:40</td>
-    <tr>
-    <td class="box"><a href="builders/SnowLeopard%20Intel%20Release">SnowLeopard Intel Release</a></td>
-      <td class="LastBuild box" >no build</td>
-      <td align="center" class="Activity building">building<br />< 1 min</td>
-    <tr>
-    <td class="box"><a href="builders/Qt%20Linux%20Release">Qt Linux Release</a></td>
-      <td align="center" class="LastBuild box failure"><a href="builders/Qt%20Linux%20Release/builds/654">47383</a><br />failed<br />compile-webkit</td>
-      <td align="center" class="Activity idle">idle</td>
-    </table>
-'''
-    _expected_example_one_box_parsings = [
-        {
-            'builder_url': u'http://build.webkit.org/builders/Windows%20Debug%20%28Tests%29',
-            'build_url': u'http://build.webkit.org/builders/Windows%20Debug%20%28Tests%29/builds/3693',
-            'is_green': True,
-            'name': u'Windows Debug (Tests)',
-            'built_revision': 47380
-        },
-        {
-            'builder_url': u'http://build.webkit.org/builders/SnowLeopard%20Intel%20Release',
-            'is_green': False,
-            'name': u'SnowLeopard Intel Release',
-        },
-        {
-            'builder_url': u'http://build.webkit.org/builders/Qt%20Linux%20Release',
-            'build_url': u'http://build.webkit.org/builders/Qt%20Linux%20Release/builds/654',
-            'is_green': False,
-            'name': u'Qt Linux Release',
-            'built_revision': 47383
-        },
-    ]
-
-    def test_status_parsing(self):
-        buildbot = BuildBot()
-
-        soup = BeautifulSoup(self._example_one_box_status)
-        status_table = soup.find("table")
-        input_rows = status_table.findAll('tr')
-
-        for x in range(len(input_rows)):
-            status_row = input_rows[x]
-            expected_parsing = self._expected_example_one_box_parsings[x]
-
-            builder = buildbot._parse_builder_status_from_row(status_row)
-
-            # Make sure we aren't parsing more or less than we expect
-            self.assertEquals(builder.keys(), expected_parsing.keys())
-
-            for key, expected_value in expected_parsing.items():
-                self.assertEquals(builder[key], expected_value, ("Builder %d parse failure for key: %s: Actual='%s' Expected='%s'" % (x, key, builder[key], expected_value)))
-
-    def test_core_builder_methods(self):
-        buildbot = BuildBot()
-
-        # Override builder_statuses function to not touch the network.
-        def example_builder_statuses(): # We could use instancemethod() to bind 'self' but we don't need to.
-            return BuildBotTest._expected_example_one_box_parsings
-        buildbot.builder_statuses = example_builder_statuses
-
-        buildbot.core_builder_names_regexps = [ 'Leopard', "Windows.*Build" ]
-        self.assertEquals(buildbot.red_core_builders_names(), [])
-        self.assertTrue(buildbot.core_builders_are_green())
-
-        buildbot.core_builder_names_regexps = [ 'SnowLeopard', 'Qt' ]
-        self.assertEquals(buildbot.red_core_builders_names(), [ u'SnowLeopard Intel Release', u'Qt Linux Release' ])
-        self.assertFalse(buildbot.core_builders_are_green())
-
-    def test_builder_name_regexps(self):
-        buildbot = BuildBot()
-
-        # For complete testing, this list should match the list of builders at build.webkit.org:
-        example_builders = [
-            { 'name': u'Tiger Intel Release', },
-            { 'name': u'Leopard Intel Release (Build)', },
-            { 'name': u'Leopard Intel Release (Tests)', },
-            { 'name': u'Leopard Intel Debug (Build)', },
-            { 'name': u'Leopard Intel Debug (Tests)', },
-            { 'name': u'SnowLeopard Intel Release (Build)', },
-            { 'name': u'SnowLeopard Intel Release (Tests)', },
-            { 'name': u'SnowLeopard Intel Leaks', },
-            { 'name': u'Windows Release (Build)', },
-            { 'name': u'Windows Release (Tests)', },
-            { 'name': u'Windows Debug (Build)', },
-            { 'name': u'Windows Debug (Tests)', },
-            { 'name': u'Qt Linux Release', },
-            { 'name': u'Gtk Linux Release', },
-            { 'name': u'Gtk Linux 32-bit Debug', },
-            { 'name': u'Gtk Linux 64-bit Debug', },
-            { 'name': u'Chromium Linux Release', },
-            { 'name': u'Chromium Mac Release', },
-            { 'name': u'Chromium Win Release', },
-        ]
-        name_regexps = [ "Leopard", "Windows.*Build", "Chromium" ]
-        expected_builders = [
-            { 'name': u'Leopard Intel Release (Build)', },
-            { 'name': u'Leopard Intel Release (Tests)', },
-            { 'name': u'Leopard Intel Debug (Build)', },
-            { 'name': u'Leopard Intel Debug (Tests)', },
-            { 'name': u'Windows Release (Build)', },
-            { 'name': u'Windows Debug (Build)', },
-            { 'name': u'Chromium Linux Release', },
-            { 'name': u'Chromium Mac Release', },
-            { 'name': u'Chromium Win Release', },
-        ]
-
-        # This test should probably be updated if the default regexp list changes
-        self.assertEquals(buildbot.core_builder_names_regexps, name_regexps)
-
-        builders = buildbot._builder_statuses_with_names_matching_regexps(example_builders, name_regexps)
-        self.assertEquals(builders, expected_builders)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/changelogs.py b/WebKitTools/Scripts/webkitpy/changelogs.py
deleted file mode 100644
index ebc89c4..0000000
--- a/WebKitTools/Scripts/webkitpy/changelogs.py
+++ /dev/null
@@ -1,134 +0,0 @@
-# Copyright (C) 2009, 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.
-#
-# WebKit's Python module for parsing and modifying ChangeLog files
-
-import fileinput # inplace file editing for set_reviewer_in_changelog
-import re
-import textwrap
-
-
-def view_source_url(revision_number):
-    # FIMXE: This doesn't really belong in this file, but we don't have a
-    # better home for it yet.
-    # Maybe eventually a webkit_config.py?
-    return "http://trac.webkit.org/changeset/%s" % revision_number
-
-
-class ChangeLog:
-
-    def __init__(self, path):
-        self.path = path
-
-    _changelog_indent = " " * 8
-
-    # e.g. 2009-06-03  Eric Seidel  <eric@webkit.org>
-    date_line_regexp = re.compile('^(\d{4}-\d{2}-\d{2})' # Consume the date.
-                                + '\s+(.+)\s+' # Consume the name.
-                                + '<([^<>]+)>$') # And the email address.
-
-    @staticmethod
-    def _parse_latest_entry_from_file(changelog_file):
-        entry_lines = []
-        # The first line should be a date line.
-        first_line = changelog_file.readline()
-        if not ChangeLog.date_line_regexp.match(first_line):
-            return None
-        entry_lines.append(first_line)
-
-        for line in changelog_file:
-            # If we've hit the next entry, return.
-            if ChangeLog.date_line_regexp.match(line):
-                # Remove the extra newline at the end
-                return ''.join(entry_lines[:-1])
-            entry_lines.append(line)
-        return None # We never found a date line!
-
-    def latest_entry(self):
-        changelog_file = open(self.path)
-        try:
-            return self._parse_latest_entry_from_file(changelog_file)
-        finally:
-            changelog_file.close()
-
-    # _wrap_line and _wrap_lines exist to work around
-    # http://bugs.python.org/issue1859
-
-    def _wrap_line(self, line):
-        return textwrap.fill(line,
-                             width=70,
-                             initial_indent=self._changelog_indent,
-                             # Don't break urls which may be longer than width.
-                             break_long_words=False,
-                             subsequent_indent=self._changelog_indent)
-
-    # Workaround as suggested by guido in
-    # http://bugs.python.org/issue1859#msg60040
-
-    def _wrap_lines(self, message):
-        lines = [self._wrap_line(line) for line in message.splitlines()]
-        return "\n".join(lines)
-
-    # This probably does not belong in changelogs.py
-    def _message_for_revert(self, revision, reason, bug_url):
-        message = "No review, rolling out r%s.\n" % revision
-        message += "%s\n" % view_source_url(revision)
-        if bug_url:
-            message += "%s\n" % bug_url
-        # Add an extra new line after the rollout links, before any reason.
-        message += "\n"
-        if reason:
-            message += "%s\n\n" % reason
-        return self._wrap_lines(message)
-
-    def update_for_revert(self, revision, reason, bug_url=None):
-        reviewed_by_regexp = re.compile(
-                "%sReviewed by NOBODY \(OOPS!\)\." % self._changelog_indent)
-        removing_boilerplate = False
-        # inplace=1 creates a backup file and re-directs stdout to the file
-        for line in fileinput.FileInput(self.path, inplace=1):
-            if reviewed_by_regexp.search(line):
-                message_lines = self._message_for_revert(revision,
-                                                         reason,
-                                                         bug_url)
-                print reviewed_by_regexp.sub(message_lines, line),
-                # Remove all the ChangeLog boilerplate between the Reviewed by
-                # line and the first changed file.
-                removing_boilerplate = True
-            elif removing_boilerplate:
-                if line.find('*') >= 0: # each changed file is preceded by a *
-                    removing_boilerplate = False
-
-            if not removing_boilerplate:
-                print line,
-
-    def set_reviewer(self, reviewer):
-        # inplace=1 creates a backup file and re-directs stdout to the file
-        for line in fileinput.FileInput(self.path, inplace=1):
-            # Trailing comma suppresses printing newline
-            print line.replace("NOBODY (OOPS!)", reviewer.encode("utf-8")),
diff --git a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py b/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
deleted file mode 100644
index de3e60c..0000000
--- a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
+++ /dev/null
@@ -1,179 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-from changelogs import *
-
-import os
-import tempfile
-from StringIO import StringIO
-
-class ChangeLogsTest(unittest.TestCase):
-
-    _example_entry = '''2009-08-17  Peter Kasting  <pkasting@google.com>
-
-        Reviewed by Steve Falkenburg.
-
-        https://bugs.webkit.org/show_bug.cgi?id=27323
-        Only add Cygwin to the path when it isn't already there.  This avoids
-        causing problems for people who purposefully have non-Cygwin versions of
-        executables like svn in front of the Cygwin ones in their paths.
-
-        * DumpRenderTree/win/DumpRenderTree.vcproj:
-        * DumpRenderTree/win/ImageDiff.vcproj:
-        * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
-'''
-
-    # More example text than we need.  Eventually we need to support parsing this all and write tests for the parsing.
-    _example_changelog = '''2009-08-17  David Kilzer  <ddkilzer@apple.com>
-
-        <http://webkit.org/b/28393> check-webkit-style: add check for use of std::max()/std::min() instead of MAX()/MIN()
-
-        Reviewed by David Levin.
-
-        * Scripts/modules/cpp_style.py:
-        (_ERROR_CATEGORIES): Added 'runtime/max_min_macros'.
-        (check_max_min_macros): Added.  Returns level 4 error when MAX()
-        and MIN() macros are used in header files and C++ source files.
-        (check_style): Added call to check_max_min_macros().
-        * Scripts/modules/cpp_style_unittest.py: Added unit tests.
-        (test_max_macro): Added.
-        (test_min_macro): Added.
-
-2009-08-16  David Kilzer  <ddkilzer@apple.com>
-
-        Backed out r47343 which was mistakenly committed
-
-        * Scripts/bugzilla-tool:
-        * Scripts/modules/scm.py:
-
-2009-06-18  Darin Adler  <darin@apple.com>
-
-        Rubber stamped by Mark Rowe.
-
-        * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
-        (-[DumpRenderTreeWindow close]): Resolved crashes seen during regression
-        tests. The close method can be called on a window that's already closed
-        so we can't assert here.
-
-== Rolled over to ChangeLog-2009-06-16 ==
-'''
-
-    def test_latest_entry_parse(self):
-        changelog_contents = "%s\n%s" % (self._example_entry, self._example_changelog)
-        changelog_file = StringIO(changelog_contents)
-        latest_entry = ChangeLog._parse_latest_entry_from_file(changelog_file)
-        self.assertEquals(self._example_entry, latest_entry)
-
-    @staticmethod
-    def _write_tmp_file_with_contents(contents):
-        (file_descriptor, file_path) = tempfile.mkstemp() # NamedTemporaryFile always deletes the file on close in python < 2.6
-        file = os.fdopen(file_descriptor, 'w')
-        file.write(contents)
-        file.close()
-        return file_path
-
-    @staticmethod
-    def _read_file_contents(file_path):
-        file = open(file_path)
-        contents = file.read()
-        file.close()
-        return contents
-
-    _new_entry_boilerplate = '''2009-08-19  Eric Seidel  <eric@webkit.org>
-
-        Reviewed by NOBODY (OOPS!).
-
-        Need a short description and bug URL (OOPS!)
-
-        * Scripts/bugzilla-tool:
-'''
-
-    def test_set_reviewer(self):
-        changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
-        changelog_path = self._write_tmp_file_with_contents(changelog_contents)
-        reviewer_name = 'Test Reviewer'
-        ChangeLog(changelog_path).set_reviewer(reviewer_name)
-        actual_contents = self._read_file_contents(changelog_path)
-        expected_contents = changelog_contents.replace('NOBODY (OOPS!)', reviewer_name)
-        os.remove(changelog_path)
-        self.assertEquals(actual_contents, expected_contents)
-
-    _revert_message = """        No review, rolling out r12345.
-        http://trac.webkit.org/changeset/12345
-        http://example.com/123
-
-        This is a very long reason which should be long enough so that
-        _message_for_revert will need to wrap it.  We'll also include
-        a
-        https://veryveryveryveryverylongbugurl.com/reallylongbugthingy.cgi?bug_id=12354
-        link so that we can make sure we wrap that right too.
-"""
-
-    def test_message_for_revert(self):
-        changelog = ChangeLog("/fake/path")
-        long_reason = "This is a very long reason which should be long enough so that _message_for_revert will need to wrap it.  We'll also include a https://veryveryveryveryverylongbugurl.com/reallylongbugthingy.cgi?bug_id=12354 link so that we can make sure we wrap that right too."
-        message = changelog._message_for_revert(12345, long_reason, "http://example.com/123")
-        self.assertEquals(message, self._revert_message)
-
-    _revert_entry_with_bug_url = '''2009-08-19  Eric Seidel  <eric@webkit.org>
-
-        No review, rolling out r12345.
-        http://trac.webkit.org/changeset/12345
-        http://example.com/123
-
-        Reason
-
-        * Scripts/bugzilla-tool:
-'''
-
-    _revert_entry_without_bug_url = '''2009-08-19  Eric Seidel  <eric@webkit.org>
-
-        No review, rolling out r12345.
-        http://trac.webkit.org/changeset/12345
-
-        Reason
-
-        * Scripts/bugzilla-tool:
-'''
-
-    def _assert_update_for_revert_output(self, args, expected_entry):
-        changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
-        changelog_path = self._write_tmp_file_with_contents(changelog_contents)
-        changelog = ChangeLog(changelog_path)
-        changelog.update_for_revert(*args)
-        actual_entry = changelog.latest_entry()
-        os.remove(changelog_path)
-        self.assertEquals(actual_entry, expected_entry)
-
-    def test_update_for_revert(self):
-        self._assert_update_for_revert_output([12345, "Reason"], self._revert_entry_without_bug_url)
-        self._assert_update_for_revert_output([12345, "Reason", "http://example.com/123"], self._revert_entry_with_bug_url)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py b/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py
deleted file mode 100644
index 53af5b1..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py
+++ /dev/null
@@ -1,43 +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.
-
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.stepsequence import StepSequence
-
-
-class AbstractSequencedCommand(AbstractDeclarativeCommand):
-    steps = None
-    def __init__(self):
-        self._sequence = StepSequence(self.steps)
-        AbstractDeclarativeCommand.__init__(self, self._sequence.options())
-
-    def _prepare_state(self, options, args, tool):
-        return None
-
-    def execute(self, options, args, tool):
-        self._sequence.run_and_handle_errors(tool, options, self._prepare_state(options, args, tool))
diff --git a/WebKitTools/Scripts/webkitpy/commands/commandtest.py b/WebKitTools/Scripts/webkitpy/commands/commandtest.py
deleted file mode 100644
index a56cb05..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/commandtest.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-class CommandsTest(unittest.TestCase):
-    def assert_execute_outputs(self, command, args, expected_stdout="", expected_stderr="", options=Mock(), tool=MockBugzillaTool()):
-        command.bind_to_tool(tool)
-        OutputCapture().assert_outputs(self, command.execute, [options, args, tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.py b/WebKitTools/Scripts/webkitpy/commands/download.py
deleted file mode 100644
index 49a6862..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/download.py
+++ /dev/null
@@ -1,284 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-
-import os
-
-from optparse import make_option
-
-import webkitpy.steps as steps
-
-from webkitpy.bugzilla import parse_bug_id
-# We could instead use from modules import buildsteps and then prefix every buildstep with "buildsteps."
-from webkitpy.changelogs import ChangeLog
-from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.executive import ScriptError
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.stepsequence import StepSequence
-
-
-class Build(AbstractSequencedCommand):
-    name = "build"
-    help_text = "Update working copy and build"
-    steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.Build,
-    ]
-
-
-class BuildAndTest(AbstractSequencedCommand):
-    name = "build-and-test"
-    help_text = "Update working copy, build, and run the tests"
-    steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.Build,
-        steps.RunTests,
-    ]
-
-
-class Land(AbstractSequencedCommand):
-    name = "land"
-    help_text = "Land the current working directory diff and updates the associated bug if any"
-    argument_names = "[BUGID]"
-    show_in_main_help = True
-    steps = [
-        steps.EnsureBuildersAreGreen,
-        steps.UpdateChangeLogsWithReviewer,
-        steps.EnsureBuildersAreGreen,
-        steps.Build,
-        steps.RunTests,
-        steps.Commit,
-        steps.CloseBugForLandDiff,
-    ]
-    long_help = """land commits the current working copy diff (just as svn or git commit would).
-land will build and run the tests before committing.
-If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing."""
-
-    def _prepare_state(self, options, args, tool):
-        return {
-            "bug_id" : (args and args[0]) or parse_bug_id(tool.scm().create_patch()),
-        }
-
-
-class AbstractPatchProcessingCommand(AbstractDeclarativeCommand):
-    # Subclasses must implement the methods below.  We don't declare them here
-    # because we want to be able to implement them with mix-ins.
-    #
-    # def _fetch_list_of_patches_to_process(self, options, args, tool):
-    # def _prepare_to_process(self, options, args, tool):
-
-    @staticmethod
-    def _collect_patches_by_bug(patches):
-        bugs_to_patches = {}
-        for patch in patches:
-            bugs_to_patches[patch.bug_id()] = bugs_to_patches.get(patch.bug_id(), []) + [patch]
-        return bugs_to_patches
-
-    def execute(self, options, args, tool):
-        self._prepare_to_process(options, args, tool)
-        patches = self._fetch_list_of_patches_to_process(options, args, tool)
-
-        # It's nice to print out total statistics.
-        bugs_to_patches = self._collect_patches_by_bug(patches)
-        log("Processing %s from %s." % (pluralize("patch", len(patches)), pluralize("bug", len(bugs_to_patches))))
-
-        for patch in patches:
-            self._process_patch(patch, options, args, tool)
-
-
-class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand):
-    prepare_steps = None
-    main_steps = None
-
-    def __init__(self):
-        options = []
-        self._prepare_sequence = StepSequence(self.prepare_steps)
-        self._main_sequence = StepSequence(self.main_steps)
-        options = sorted(set(self._prepare_sequence.options() + self._main_sequence.options()))
-        AbstractPatchProcessingCommand.__init__(self, options)
-
-    def _prepare_to_process(self, options, args, tool):
-        self._prepare_sequence.run_and_handle_errors(tool, options)
-
-    def _process_patch(self, patch, options, args, tool):
-        state = { "patch" : patch }
-        self._main_sequence.run_and_handle_errors(tool, options, state)
-
-
-class ProcessAttachmentsMixin(object):
-    def _fetch_list_of_patches_to_process(self, options, args, tool):
-        return map(lambda patch_id: tool.bugs.fetch_attachment(patch_id), args)
-
-
-class ProcessBugsMixin(object):
-    def _fetch_list_of_patches_to_process(self, options, args, tool):
-        all_patches = []
-        for bug_id in args:
-            patches = tool.bugs.fetch_bug(bug_id).reviewed_patches()
-            log("%s found on bug %s." % (pluralize("reviewed patch", len(patches)), bug_id))
-            all_patches += patches
-        return all_patches
-
-
-class CheckStyle(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
-    name = "check-style"
-    help_text = "Run check-webkit-style on the specified attachments"
-    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
-    main_steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.ApplyPatch,
-        steps.CheckStyle,
-    ]
-
-
-class BuildAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
-    name = "build-attachment"
-    help_text = "Apply and build patches from bugzilla"
-    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
-    main_steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.ApplyPatch,
-        steps.Build,
-    ]
-
-
-class AbstractPatchApplyingCommand(AbstractPatchSequencingCommand):
-    prepare_steps = [
-        steps.EnsureLocalCommitIfNeeded,
-        steps.CleanWorkingDirectoryWithLocalCommits,
-        steps.Update,
-    ]
-    main_steps = [
-        steps.ApplyPatchWithLocalCommit,
-    ]
-    long_help = """Updates the working copy.
-Downloads and applies the patches, creating local commits if necessary."""
-
-
-class ApplyAttachment(AbstractPatchApplyingCommand, ProcessAttachmentsMixin):
-    name = "apply-attachment"
-    help_text = "Apply an attachment to the local working directory"
-    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
-    show_in_main_help = True
-
-
-class ApplyFromBug(AbstractPatchApplyingCommand, ProcessBugsMixin):
-    name = "apply-from-bug"
-    help_text = "Apply reviewed patches from provided bugs to the local working directory"
-    argument_names = "BUGID [BUGIDS]"
-    show_in_main_help = True
-
-
-class AbstractPatchLandingCommand(AbstractPatchSequencingCommand):
-    prepare_steps = [
-        steps.EnsureBuildersAreGreen,
-    ]
-    main_steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.ApplyPatch,
-        steps.EnsureBuildersAreGreen,
-        steps.Build,
-        steps.RunTests,
-        steps.Commit,
-        steps.ClosePatch,
-        steps.CloseBug,
-    ]
-    long_help = """Checks to make sure builders are green.
-Updates the working copy.
-Applies the patch.
-Builds.
-Runs the layout tests.
-Commits the patch.
-Clears the flags on the patch.
-Closes the bug if no patches are marked for review."""
-
-
-class LandAttachment(AbstractPatchLandingCommand, ProcessAttachmentsMixin):
-    name = "land-attachment"
-    help_text = "Land patches from bugzilla, optionally building and testing them first"
-    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
-    show_in_main_help = True
-
-
-class LandFromBug(AbstractPatchLandingCommand, ProcessBugsMixin):
-    name = "land-from-bug"
-    help_text = "Land all patches on the given bugs, optionally building and testing them first"
-    argument_names = "BUGID [BUGIDS]"
-    show_in_main_help = True
-
-
-class Rollout(AbstractSequencedCommand):
-    name = "rollout"
-    show_in_main_help = True
-    help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"
-    argument_names = "REVISION REASON"
-    long_help = """Updates the working copy.
-Applies the inverse diff for the provided revision.
-Creates an appropriate rollout ChangeLog, including a trac link and bug link.
-Opens the generated ChangeLogs in $EDITOR.
-Shows the prepared diff for confirmation.
-Commits the revert and updates the bug (including re-opening the bug if necessary)."""
-    steps = [
-        steps.CleanWorkingDirectory,
-        steps.Update,
-        steps.RevertRevision,
-        steps.PrepareChangeLogForRevert,
-        steps.EditChangeLog,
-        steps.ConfirmDiff,
-        steps.CompleteRollout,
-    ]
-
-    @staticmethod
-    def _parse_bug_id_from_revision_diff(tool, revision):
-        original_diff = tool.scm().diff_for_revision(revision)
-        return parse_bug_id(original_diff)
-
-    def execute(self, options, args, tool):
-        revision = args[0]
-        reason = args[1]
-        bug_id = self._parse_bug_id_from_revision_diff(tool, revision)
-        if options.complete_rollout:
-            if bug_id:
-                log("Will re-open bug %s after rollout." % bug_id)
-            else:
-                log("Failed to parse bug number from diff.  No bugs will be updated/reopened after the rollout.")
-
-        state = {
-            "revision" : revision,
-            "bug_id" : bug_id,
-            "reason" : reason,
-        }
-        self._sequence.run_and_handle_errors(tool, options, state)
diff --git a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py b/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
deleted file mode 100644
index f60c5b8..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright (C) 2009 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.
-
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.download import *
-from webkitpy.mock import Mock
-
-class DownloadCommandsTest(CommandsTest):
-    def _default_options(self):
-        options = Mock()
-        options.force_clean = False
-        options.clean = True
-        options.check_builders = True
-        options.quiet = False
-        options.non_interactive = False
-        options.update = True
-        options.build = True
-        options.test = True
-        options.close_bug = True
-        options.complete_rollout = False
-        return options
-
-    def test_build(self):
-        expected_stderr = "Updating working directory\nBuilding WebKit\n"
-        self.assert_execute_outputs(Build(), [], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_build_and_test(self):
-        expected_stderr = "Updating working directory\nBuilding WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\n"
-        self.assert_execute_outputs(BuildAndTest(), [], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_apply_attachment(self):
-        options = self._default_options()
-        options.update = True
-        options.local_commit = True
-        expected_stderr = "Updating working directory\nProcessing 1 patch from 1 bug.\nProcessing patch 197 from bug 42.\n"
-        self.assert_execute_outputs(ApplyAttachment(), [197], options=options, expected_stderr=expected_stderr)
-
-    def test_apply_patches(self):
-        options = self._default_options()
-        options.update = True
-        options.local_commit = True
-        expected_stderr = "Updating working directory\n2 reviewed patches found on bug 42.\nProcessing 2 patches from 1 bug.\nProcessing patch 197 from bug 42.\nProcessing patch 128 from bug 42.\n"
-        self.assert_execute_outputs(ApplyFromBug(), [42], options=options, expected_stderr=expected_stderr)
-
-    def test_land_diff(self):
-        expected_stderr = "Building WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\nUpdating bug 42\n"
-        self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_check_style(self):
-        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nRunning check-webkit-style\n"
-        self.assert_execute_outputs(CheckStyle(), [197], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_build_attachment(self):
-        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nBuilding WebKit\n"
-        self.assert_execute_outputs(BuildAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_land_attachment(self):
-        # FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
-        expected_stderr = """Processing 1 patch from 1 bug.
-Updating working directory
-Processing patch 197 from bug 42.
-Building WebKit
-Running Python unit tests
-Running Perl unit tests
-Running JavaScriptCore tests
-Running run-webkit-tests
-Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
-"""
-        self.assert_execute_outputs(LandAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_land_patches(self):
-        # FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
-        expected_stderr = """2 reviewed patches found on bug 42.
-Processing 2 patches from 1 bug.
-Updating working directory
-Processing patch 197 from bug 42.
-Building WebKit
-Running Python unit tests
-Running Perl unit tests
-Running JavaScriptCore tests
-Running run-webkit-tests
-Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
-Updating working directory
-Processing patch 128 from bug 42.
-Building WebKit
-Running Python unit tests
-Running Perl unit tests
-Running JavaScriptCore tests
-Running run-webkit-tests
-Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
-"""
-        self.assert_execute_outputs(LandFromBug(), [42], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_rollout(self):
-        expected_stderr = "Updating working directory\nRunning prepare-ChangeLog\n\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land 12345\" to commit the rollout.\n"
-        self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
-
-    def test_complete_rollout(self):
-        options = self._default_options()
-        options.complete_rollout = True
-        expected_stderr = "Will re-open bug 12345 after rollout.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n"
-        self.assert_execute_outputs(Rollout(), [852, "Reason"], options=options, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py b/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py
deleted file mode 100644
index e3e14dd..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, 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.
-
-from StringIO import StringIO
-
-from webkitpy.commands.queues import AbstractReviewQueue
-from webkitpy.committers import CommitterList
-from webkitpy.executive import ScriptError
-from webkitpy.webkitport import WebKitPort
-from webkitpy.queueengine import QueueEngine
-
-
-class AbstractEarlyWarningSystem(AbstractReviewQueue):
-    _build_style = "release"
-
-    def __init__(self):
-        AbstractReviewQueue.__init__(self)
-        self.port = WebKitPort.port(self.port_name)
-
-    def should_proceed_with_work_item(self, patch):
-        try:
-            self.run_webkit_patch([
-                "build",
-                self.port.flag(),
-                "--build-style=%s" % self._build_style,
-                "--force-clean",
-                "--quiet"])
-            self._update_status("Building", patch)
-        except ScriptError, e:
-            self._update_status("Unable to perform a build")
-            return False
-        return True
-
-    def _review_patch(self, patch):
-        self.run_webkit_patch([
-            "build-attachment",
-            self.port.flag(),
-            "--build-style=%s" % self._build_style,
-            "--force-clean",
-            "--quiet",
-            "--non-interactive",
-            "--parent-command=%s" % self.name,
-            "--no-update",
-            patch.id()])
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        is_svn_apply = script_error.command_name() == "svn-apply"
-        status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
-        if is_svn_apply:
-            QueueEngine.exit_after_handled_error(script_error)
-        results_link = tool.status_server.results_url_for_status(status_id)
-        message = "Attachment %s did not build on %s:\nBuild output: %s" % (state["patch"].id(), cls.port_name, results_link)
-        tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
-        exit(1)
-
-
-class GtkEWS(AbstractEarlyWarningSystem):
-    name = "gtk-ews"
-    port_name = "gtk"
-    watchers = AbstractEarlyWarningSystem.watchers + [
-        "gns@gnome.org",
-        "xan.lopez@gmail.com",
-    ]
-
-
-class QtEWS(AbstractEarlyWarningSystem):
-    name = "qt-ews"
-    port_name = "qt"
-
-
-class ChromiumEWS(AbstractEarlyWarningSystem):
-    name = "chromium-ews"
-    port_name = "chromium"
-    watchers = AbstractEarlyWarningSystem.watchers + [
-        "dglazkov@chromium.org",
-    ]
-
-
-# For platforms that we can't run inside a VM (like Mac OS X), we require
-# patches to be uploaded by committers, who are generally trustworthy folk. :)
-class AbstractCommitterOnlyEWS(AbstractEarlyWarningSystem):
-    def __init__(self, committers=CommitterList()):
-        AbstractEarlyWarningSystem.__init__(self)
-        self._committers = committers
-
-    def process_work_item(self, patch):
-        if not self._committers.committer_by_email(patch.attacher_email()):
-            self._did_error(patch, "%s cannot process patches from non-committers :(" % self.name)
-            return
-        AbstractEarlyWarningSystem.process_work_item(self, patch)
-
-
-class MacEWS(AbstractCommitterOnlyEWS):
-    name = "mac-ews"
-    port_name = "mac"
diff --git a/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py b/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py
deleted file mode 100644
index d516b84..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2009 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.
-
-import os
-
-from webkitpy.commands.early_warning_system import *
-from webkitpy.commands.queuestest import QueuesTest
-from webkitpy.mock import Mock
-
-class EarlyWarningSytemTest(QueuesTest):
-    def test_chromium_ews(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: chromium-ews will discard all local changes in \"%s\"\nRunning WebKit chromium-ews.\n" % os.getcwd(),
-            "handle_unexpected_error" : "Mock error message\n",
-        }
-        self.assert_queue_outputs(ChromiumEWS(), expected_stderr=expected_stderr)
-
-    def test_qt_ews(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: qt-ews will discard all local changes in \"%s\"\nRunning WebKit qt-ews.\n" % os.getcwd(),
-            "handle_unexpected_error" : "Mock error message\n",
-        }
-        self.assert_queue_outputs(QtEWS(), expected_stderr=expected_stderr)
-
-    def test_gtk_ews(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: gtk-ews will discard all local changes in \"%s\"\nRunning WebKit gtk-ews.\n" % os.getcwd(),
-            "handle_unexpected_error" : "Mock error message\n",
-        }
-        self.assert_queue_outputs(GtkEWS(), expected_stderr=expected_stderr)
-
-    def test_mac_ews(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: mac-ews will discard all local changes in \"%s\"\nRunning WebKit mac-ews.\n" % os.getcwd(),
-            "handle_unexpected_error" : "Mock error message\n",
-        }
-        self.assert_queue_outputs(MacEWS(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/openbugs.py b/WebKitTools/Scripts/webkitpy/commands/openbugs.py
deleted file mode 100644
index 25bdefc..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/openbugs.py
+++ /dev/null
@@ -1,63 +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.
-
-import re
-import sys
-
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.webkit_logging import log
-
-
-class OpenBugs(AbstractDeclarativeCommand):
-    name = "open-bugs"
-    help_text = "Finds all bug numbers passed in arguments (or stdin if no args provided) and opens them in a web browser"
-
-    bug_number_regexp = re.compile(r"\b\d{4,6}\b")
-
-    def _open_bugs(self, bug_ids):
-        for bug_id in bug_ids:
-            bug_url = self.tool.bugs.bug_url_for_bug_id(bug_id)
-            self.tool.user.open_url(bug_url)
-
-    # _find_bugs_in_string mostly exists for easy unit testing.
-    def _find_bugs_in_string(self, string):
-        return self.bug_number_regexp.findall(string)
-
-    def _find_bugs_in_iterable(self, iterable):
-        return sum([self._find_bugs_in_string(string) for string in iterable], [])
-
-    def execute(self, options, args, tool):
-        if args:
-            bug_ids = self._find_bugs_in_iterable(args)
-        else:
-            # This won't open bugs until stdin is closed but could be made to easily.  That would just make unit testing slightly harder.
-            bug_ids = self._find_bugs_in_iterable(sys.stdin)
-
-        log("%s bugs found in input." % len(bug_ids))
-
-        self._open_bugs(bug_ids)
diff --git a/WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py b/WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py
deleted file mode 100644
index 71fefd2..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2009 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.
-
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.openbugs import OpenBugs
-
-class OpenBugsTest(CommandsTest):
-
-    find_bugs_in_string_expectations = [
-        ["123", []],
-        ["1234", ["1234"]],
-        ["12345", ["12345"]],
-        ["123456", ["123456"]],
-        ["1234567", []],
-        [" 123456 234567", ["123456", "234567"]],
-    ]
-
-    def test_find_bugs_in_string(self):
-        openbugs = OpenBugs()
-        for expectation in self.find_bugs_in_string_expectations:
-            self.assertEquals(openbugs._find_bugs_in_string(expectation[0]), expectation[1])
-
-    def test_args_parsing(self):
-        expected_stderr = "2 bugs found in input.\nMOCK: user.open_url: http://example.com/12345\nMOCK: user.open_url: http://example.com/23456\n"
-        self.assert_execute_outputs(OpenBugs(), ["12345\n23456"], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries.py b/WebKitTools/Scripts/webkitpy/commands/queries.py
deleted file mode 100644
index 3ca4f42..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queries.py
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-
-
-from optparse import make_option
-
-from webkitpy.buildbot import BuildBot
-from webkitpy.committers import CommitterList
-from webkitpy.webkit_logging import log
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-
-
-class BugsToCommit(AbstractDeclarativeCommand):
-    name = "bugs-to-commit"
-    help_text = "List bugs in the commit-queue"
-
-    def execute(self, options, args, tool):
-        # FIXME: This command is poorly named.  It's fetching the commit-queue list here.  The name implies it's fetching pending-commit (all r+'d patches).
-        bug_ids = tool.bugs.queries.fetch_bug_ids_from_commit_queue()
-        for bug_id in bug_ids:
-            print "%s" % bug_id
-
-
-class PatchesInCommitQueue(AbstractDeclarativeCommand):
-    name = "patches-in-commit-queue"
-    help_text = "List patches in the commit-queue"
-
-    def execute(self, options, args, tool):
-        patches = tool.bugs.queries.fetch_patches_from_commit_queue()
-        log("Patches in commit queue:")
-        for patch in patches:
-            print patch.url()
-
-
-class PatchesToCommitQueue(AbstractDeclarativeCommand):
-    name = "patches-to-commit-queue"
-    help_text = "Patches which should be added to the commit queue"
-    def __init__(self):
-        options = [
-            make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"),
-        ]
-        AbstractDeclarativeCommand.__init__(self, options=options)
-
-    @staticmethod
-    def _needs_commit_queue(patch):
-        if patch.commit_queue() == "+": # If it's already cq+, ignore the patch.
-            log("%s already has cq=%s" % (patch.id(), patch.commit_queue()))
-            return False
-
-        # We only need to worry about patches from contributers who are not yet committers.
-        committer_record = CommitterList().committer_by_email(patch.attacher_email())
-        if committer_record:
-            log("%s committer = %s" % (patch.id(), committer_record))
-        return not committer_record
-
-    def execute(self, options, args, tool):
-        patches = tool.bugs.queries.fetch_patches_from_pending_commit_list()
-        patches_needing_cq = filter(self._needs_commit_queue, patches)
-        if options.bugs:
-            bugs_needing_cq = map(lambda patch: patch.bug_id(), patches_needing_cq)
-            bugs_needing_cq = sorted(set(bugs_needing_cq))
-            for bug_id in bugs_needing_cq:
-                print "%s" % tool.bugs.bug_url_for_bug_id(bug_id)
-        else:
-            for patch in patches_needing_cq:
-                print "%s" % tool.bugs.attachment_url_for_id(patch.id(), action="edit")
-
-
-class PatchesToReview(AbstractDeclarativeCommand):
-    name = "patches-to-review"
-    help_text = "List patches that are pending review"
-
-    def execute(self, options, args, tool):
-        patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
-        log("Patches pending review:")
-        for patch_id in patch_ids:
-            print patch_id
-
-
-class TreeStatus(AbstractDeclarativeCommand):
-    name = "tree-status"
-    help_text = "Print the status of the %s buildbots" % BuildBot.default_host
-    long_help = """Fetches build status from http://build.webkit.org/one_box_per_builder
-and displayes the status of each builder."""
-
-    def execute(self, options, args, tool):
-        for builder in tool.buildbot.builder_statuses():
-            status_string = "ok" if builder["is_green"] else "FAIL"
-            print "%s : %s" % (status_string.ljust(4), builder["name"])
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries_unittest.py b/WebKitTools/Scripts/webkitpy/commands/queries_unittest.py
deleted file mode 100644
index b858777..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queries_unittest.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2009 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.
-
-from webkitpy.bugzilla import Bugzilla
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.queries import *
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-
-class QueryCommandsTest(CommandsTest):
-    def test_bugs_to_commit(self):
-        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\n"
-        self.assert_execute_outputs(BugsToCommit(), None, "42\n77\n", expected_stderr)
-
-    def test_patches_in_commit_queue(self):
-        expected_stdout = "http://example.com/197\nhttp://example.com/103\n"
-        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nPatches in commit queue:\n"
-        self.assert_execute_outputs(PatchesInCommitQueue(), None, expected_stdout, expected_stderr)
-
-    def test_patches_to_commit_queue(self):
-        expected_stdout = "http://example.com/104&action=edit\n"
-        expected_stderr = "197 already has cq=+\n128 already has cq=+\n105 committer = \"Eric Seidel\" <eric@webkit.org>\n"
-        options = Mock()
-        options.bugs = False
-        self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
-
-        expected_stdout = "http://example.com/77\n"
-        options.bugs = True
-        self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
-
-    def test_patches_to_review(self):
-        expected_stdout = "103\n"
-        expected_stderr = "Patches pending review:\n"
-        self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr)
-
-    def test_tree_status(self):
-        expected_stdout = "ok   : Builder1\nok   : Builder2\n"
-        self.assert_execute_outputs(TreeStatus(), None, expected_stdout)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues.py b/WebKitTools/Scripts/webkitpy/commands/queues.py
deleted file mode 100644
index 6ea1c48..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queues.py
+++ /dev/null
@@ -1,295 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-
-import traceback
-import os
-
-from datetime import datetime
-from optparse import make_option
-from StringIO import StringIO
-
-from webkitpy.bugzilla import CommitterValidator
-from webkitpy.executive import ScriptError
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import Command
-from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
-from webkitpy.statusserver import StatusServer
-from webkitpy.stepsequence import StepSequenceErrorHandler
-from webkitpy.queueengine import QueueEngine, QueueEngineDelegate
-
-class AbstractQueue(Command, QueueEngineDelegate):
-    watchers = [
-        "webkit-bot-watchers@googlegroups.com",
-    ]
-
-    _pass_status = "Pass"
-    _fail_status = "Fail"
-    _error_status = "Error"
-
-    def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
-        options_list = (options or []) + [
-            make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
-        ]
-        Command.__init__(self, "Run the %s" % self.name, options=options_list)
-
-    def _cc_watchers(self, bug_id):
-        try:
-            self.tool.bugs.add_cc_to_bug(bug_id, self.watchers)
-        except Exception, e:
-            traceback.print_exc()
-            log("Failed to CC watchers.")
-
-    def _update_status(self, message, patch=None, results_file=None):
-        self.tool.status_server.update_status(self.name, message, patch, results_file)
-
-    def _did_pass(self, patch):
-        self._update_status(self._pass_status, patch)
-
-    def _did_fail(self, patch):
-        self._update_status(self._fail_status, patch)
-
-    def _did_error(self, patch, reason):
-        message = "%s: %s" % (self._error_status, reason)
-        self._update_status(message, patch)
-
-    def queue_log_path(self):
-        return "%s.log" % self.name
-
-    def work_item_log_path(self, patch):
-        return os.path.join("%s-logs" % self.name, "%s.log" % patch.bug_id())
-
-    def begin_work_queue(self):
-        log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self.tool.scm().checkout_root))
-        if self.options.confirm:
-            response = self.tool.user.prompt("Are you sure?  Type \"yes\" to continue: ")
-            if (response != "yes"):
-                error("User declined.")
-        log("Running WebKit %s." % self.name)
-
-    def should_continue_work_queue(self):
-        return True
-
-    def next_work_item(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def should_proceed_with_work_item(self, work_item):
-        raise NotImplementedError, "subclasses must implement"
-
-    def process_work_item(self, work_item):
-        raise NotImplementedError, "subclasses must implement"
-
-    def handle_unexpected_error(self, work_item, message):
-        raise NotImplementedError, "subclasses must implement"
-
-    def run_webkit_patch(self, args):
-        webkit_patch_args = [self.tool.path()]
-        # FIXME: This is a hack, we should have a more general way to pass global options.
-        webkit_patch_args += ["--status-host=%s" % self.tool.status_server.host]
-        webkit_patch_args += map(str, args)
-        self.tool.executive.run_and_throw_if_fail(webkit_patch_args)
-
-    def log_progress(self, patch_ids):
-        log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
-
-    def execute(self, options, args, tool, engine=QueueEngine):
-        self.options = options
-        self.tool = tool
-        return engine(self.name, self).run()
-
-    @classmethod
-    def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
-        message = script_error.message
-        if is_error:
-            message = "Error: %s" % message
-        output = script_error.message_with_output(output_limit=5*1024*1024) # 5MB
-        return tool.status_server.update_status(cls.name, message, state["patch"], StringIO(output))
-
-
-class CommitQueue(AbstractQueue, StepSequenceErrorHandler):
-    name = "commit-queue"
-    def __init__(self):
-        AbstractQueue.__init__(self)
-
-    # AbstractQueue methods
-
-    def begin_work_queue(self):
-        AbstractQueue.begin_work_queue(self)
-        self.committer_validator = CommitterValidator(self.tool.bugs)
-
-    def _validate_patches_in_commit_queue(self):
-        # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
-        bug_ids = self.tool.bugs.queries.fetch_bug_ids_from_commit_queue()
-        all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
-        return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
-
-    def next_work_item(self):
-        patches = self._validate_patches_in_commit_queue()
-        # FIXME: We could sort the patches in a specific order here, was suggested by https://bugs.webkit.org/show_bug.cgi?id=33395
-        if not patches:
-            self._update_status("Empty queue")
-            return None
-        # Only bother logging if we have patches in the queue.
-        self.log_progress([patch.id() for patch in patches])
-        return patches[0]
-
-    def _can_build_and_test(self):
-        try:
-            self.run_webkit_patch(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"])
-        except ScriptError, e:
-            self._update_status("Unabled to successfully build and test", None)
-            return False
-        return True
-
-    def _builders_are_green(self):
-        red_builders_names = self.tool.buildbot.red_core_builders_names()
-        if red_builders_names:
-            red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
-            self._update_status("Builders [%s] are red. See http://build.webkit.org" % ", ".join(red_builders_names), None)
-            return False
-        return True
-
-    def should_proceed_with_work_item(self, patch):
-        if not self._builders_are_green():
-            return False
-        if not self._can_build_and_test():
-            return False
-        if not self._builders_are_green():
-            return False
-        self._update_status("Landing patch", patch)
-        return True
-
-    def process_work_item(self, patch):
-        try:
-            self._cc_watchers(patch.bug_id())
-            # We pass --no-update here because we've already validated
-            # that the current revision actually builds and passes the tests.
-            # If we update, we risk moving to a revision that doesn't!
-            self.run_webkit_patch(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch.id()])
-            self._did_pass(patch)
-        except ScriptError, e:
-            self._did_fail(patch)
-            raise e
-
-    def handle_unexpected_error(self, patch, message):
-        self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
-
-    # StepSequenceErrorHandler methods
-
-    @staticmethod
-    def _error_message_for_bug(tool, status_id, script_error):
-        if not script_error.output:
-            return script_error.message_with_output()
-        results_link = tool.status_server.results_url_for_status(status_id)
-        return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        status_id = cls._update_status_for_script_error(tool, state, script_error)
-        validator = CommitterValidator(tool.bugs)
-        validator.reject_patch_from_commit_queue(state["patch"].id(), cls._error_message_for_bug(tool, status_id, script_error))
-
-
-class AbstractReviewQueue(AbstractQueue, PersistentPatchCollectionDelegate, StepSequenceErrorHandler):
-    def __init__(self, options=None):
-        AbstractQueue.__init__(self, options)
-
-    def _review_patch(self, patch):
-        raise NotImplementedError, "subclasses must implement"
-
-    # PersistentPatchCollectionDelegate methods
-
-    def collection_name(self):
-        return self.name
-
-    def fetch_potential_patch_ids(self):
-        return self.tool.bugs.queries.fetch_attachment_ids_from_review_queue()
-
-    def status_server(self):
-        return self.tool.status_server
-
-    def is_terminal_status(self, status):
-        return status == "Pass" or status == "Fail" or status.startswith("Error:")
-
-    # AbstractQueue methods
-
-    def begin_work_queue(self):
-        AbstractQueue.begin_work_queue(self)
-        self._patches = PersistentPatchCollection(self)
-
-    def next_work_item(self):
-        patch_id = self._patches.next()
-        if patch_id:
-            return self.tool.bugs.fetch_attachment(patch_id)
-        self._update_status("Empty queue")
-
-    def should_proceed_with_work_item(self, patch):
-        raise NotImplementedError, "subclasses must implement"
-
-    def process_work_item(self, patch):
-        try:
-            self._review_patch(patch)
-            self._did_pass(patch)
-        except ScriptError, e:
-            if e.exit_code != QueueEngine.handled_error_code:
-                self._did_fail(patch)
-            raise e
-
-    def handle_unexpected_error(self, patch, message):
-        log(message)
-
-    # StepSequenceErrorHandler methods
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        log(script_error.message_with_output())
-
-
-class StyleQueue(AbstractReviewQueue):
-    name = "style-queue"
-    def __init__(self):
-        AbstractReviewQueue.__init__(self)
-
-    def should_proceed_with_work_item(self, patch):
-        self._update_status("Checking style", patch)
-        return True
-
-    def _review_patch(self, patch):
-        self.run_webkit_patch(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch.id()])
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        is_svn_apply = script_error.command_name() == "svn-apply"
-        status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
-        if is_svn_apply:
-            QueueEngine.exit_after_handled_error(script_error)
-        message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
-        tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
-        exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
deleted file mode 100644
index 87cd645..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (C) 2009 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.
-
-import os
-
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.queues import *
-from webkitpy.commands.queuestest import QueuesTest
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-
-class TestQueue(AbstractQueue):
-    name = "test-queue"
-
-
-class TestReviewQueue(AbstractReviewQueue):
-    name = "test-review-queue"
-
-
-class AbstractQueueTest(CommandsTest):
-    def _assert_log_progress_output(self, patch_ids, progress_output):
-        OutputCapture().assert_outputs(self, TestQueue().log_progress, [patch_ids], expected_stderr=progress_output)
-
-    def test_log_progress(self):
-        self._assert_log_progress_output([1,2,3], "3 patches in test-queue [1, 2, 3]\n")
-        self._assert_log_progress_output(["1","2","3"], "3 patches in test-queue [1, 2, 3]\n")
-        self._assert_log_progress_output([1], "1 patch in test-queue [1]\n")
-
-    def _assert_run_webkit_patch(self, run_args):
-        queue = TestQueue()
-        tool = MockBugzillaTool()
-        queue.bind_to_tool(tool)
-
-        queue.run_webkit_patch(run_args)
-        expected_run_args = ["echo", "--status-host=example.com"] + map(str, run_args)
-        tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
-
-    def test_run_webkit_patch(self):
-        self._assert_run_webkit_patch([1])
-        self._assert_run_webkit_patch(["one", 2])
-
-
-class AbstractReviewQueueTest(CommandsTest):
-    def test_patch_collection_delegate_methods(self):
-        queue = TestReviewQueue()
-        tool = MockBugzillaTool()
-        queue.bind_to_tool(tool)
-        self.assertEquals(queue.collection_name(), "test-review-queue")
-        self.assertEquals(queue.fetch_potential_patch_ids(), [103])
-        queue.status_server()
-        self.assertTrue(queue.is_terminal_status("Pass"))
-        self.assertTrue(queue.is_terminal_status("Fail"))
-        self.assertTrue(queue.is_terminal_status("Error: Your patch exploded"))
-        self.assertFalse(queue.is_terminal_status("Foo"))
-
-
-class CommitQueueTest(QueuesTest):
-    def test_commit_queue(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % os.getcwd(),
-            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
-            "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-2 patches in commit-queue [197, 106]
-""",
-        }
-        self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
-
-
-class StyleQueueTest(QueuesTest):
-    def test_style_queue(self):
-        expected_stderr = {
-            "begin_work_queue" : "CAUTION: style-queue will discard all local changes in \"%s\"\nRunning WebKit style-queue.\n" % os.getcwd(),
-            "handle_unexpected_error" : "Mock error message\n",
-        }
-        self.assert_queue_outputs(StyleQueue(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/commands/queuestest.py
deleted file mode 100644
index 09d1c26..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queuestest.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.bugzilla import Attachment
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-
-class MockQueueEngine(object):
-    def __init__(self, name, queue):
-        pass
-
-    def run(self):
-        pass
-
-
-class QueuesTest(unittest.TestCase):
-    mock_work_item = Attachment({
-        "id" : 1234,
-        "bug_id" : 345,
-        "attacher_email": "adam@example.com",
-    }, None)
-
-    def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, options=Mock(), tool=MockBugzillaTool()):
-        if not expected_stdout:
-            expected_stdout = {}
-        if not expected_stderr:
-            expected_stderr = {}
-        if not args:
-            args = []
-        if not work_item:
-            work_item = self.mock_work_item
-        tool.user.prompt = lambda message: "yes"
-
-        queue.execute(options, args, tool, engine=MockQueueEngine)
-
-        OutputCapture().assert_outputs(self,
-                queue.queue_log_path,
-                expected_stdout=expected_stdout.get("queue_log_path", ""),
-                expected_stderr=expected_stderr.get("queue_log_path", ""))
-        OutputCapture().assert_outputs(self,
-                queue.work_item_log_path,
-                args=[work_item],
-                expected_stdout=expected_stdout.get("work_item_log_path", ""),
-                expected_stderr=expected_stderr.get("work_item_log_path", ""))
-        OutputCapture().assert_outputs(self,
-                queue.begin_work_queue,
-                expected_stdout=expected_stdout.get("begin_work_queue", ""),
-                expected_stderr=expected_stderr.get("begin_work_queue", ""))
-        OutputCapture().assert_outputs(self,
-                queue.should_continue_work_queue,
-                expected_stdout=expected_stdout.get("should_continue_work_queue", ""), expected_stderr=expected_stderr.get("should_continue_work_queue", ""))
-        OutputCapture().assert_outputs(self,
-                queue.next_work_item,
-                expected_stdout=expected_stdout.get("next_work_item", ""),
-                expected_stderr=expected_stderr.get("next_work_item", ""))
-        OutputCapture().assert_outputs(self,
-                queue.should_proceed_with_work_item,
-                args=[work_item],
-                expected_stdout=expected_stdout.get("should_proceed_with_work_item", ""),
-                expected_stderr=expected_stderr.get("should_proceed_with_work_item", ""))
-        OutputCapture().assert_outputs(self,
-                queue.process_work_item,
-                args=[work_item],
-                expected_stdout=expected_stdout.get("process_work_item", ""),
-                expected_stderr=expected_stderr.get("process_work_item", ""))
-        OutputCapture().assert_outputs(self,
-                queue.handle_unexpected_error,
-                args=[work_item, "Mock error message"],
-                expected_stdout=expected_stdout.get("handle_unexpected_error", ""),
-                expected_stderr=expected_stderr.get("handle_unexpected_error", ""))
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.py b/WebKitTools/Scripts/webkitpy/commands/upload.py
deleted file mode 100644
index 15bdfbb..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/upload.py
+++ /dev/null
@@ -1,447 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-
-import os
-import re
-import StringIO
-import sys
-
-from optparse import make_option
-
-import webkitpy.steps as steps
-
-from webkitpy.bugzilla import parse_bug_id
-from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand
-from webkitpy.comments import bug_comment_from_svn_revision
-from webkitpy.committers import CommitterList
-from webkitpy.grammar import pluralize, join_with_separators
-from webkitpy.webkit_logging import error, log
-from webkitpy.mock import Mock
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.user import User
-
-class CommitMessageForCurrentDiff(AbstractDeclarativeCommand):
-    name = "commit-message"
-    help_text = "Print a commit message suitable for the uncommitted changes"
-
-    def execute(self, options, args, tool):
-        os.chdir(tool.scm().checkout_root)
-        print "%s" % tool.scm().commit_message_for_this_commit().message()
-
-class CleanPendingCommit(AbstractDeclarativeCommand):
-    name = "clean-pending-commit"
-    help_text = "Clear r+ on obsolete patches so they do not appear in the pending-commit list."
-
-    # NOTE: This was designed to be generic, but right now we're only processing patches from the pending-commit list, so only r+ matters.
-    def _flags_to_clear_on_patch(self, patch):
-        if not patch.is_obsolete():
-            return None
-        what_was_cleared = []
-        if patch.review() == "+":
-            if patch.reviewer():
-                what_was_cleared.append("%s's review+" % patch.reviewer().full_name)
-            else:
-                what_was_cleared.append("review+")
-        return join_with_separators(what_was_cleared)
-
-    def execute(self, options, args, tool):
-        committers = CommitterList()
-        for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
-            bug = self.tool.bugs.fetch_bug(bug_id)
-            patches = bug.patches(include_obsolete=True)
-            for patch in patches:
-                flags_to_clear = self._flags_to_clear_on_patch(patch)
-                if not flags_to_clear:
-                    continue
-                message = "Cleared %s from obsolete attachment %s so that this bug does not appear in http://webkit.org/pending-commit." % (flags_to_clear, patch.id())
-                self.tool.bugs.obsolete_attachment(patch.id(), message)
-
-
-class AssignToCommitter(AbstractDeclarativeCommand):
-    name = "assign-to-committer"
-    help_text = "Assign bug to whoever attached the most recent r+'d patch"
-
-    def _patches_have_commiters(self, reviewed_patches):
-        for patch in reviewed_patches:
-            if not patch.committer():
-                return False
-        return True
-
-    def _assign_bug_to_last_patch_attacher(self, bug_id):
-        committers = CommitterList()
-        bug = self.tool.bugs.fetch_bug(bug_id)
-        assigned_to_email = bug.assigned_to_email()
-        if assigned_to_email != self.tool.bugs.unassigned_email:
-            log("Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
-            return
-
-        reviewed_patches = bug.reviewed_patches()
-        if not reviewed_patches:
-            log("Bug %s has no non-obsolete patches, ignoring." % bug_id)
-            return
-
-        # We only need to do anything with this bug if one of the r+'d patches does not have a valid committer (cq+ set).
-        if self._patches_have_commiters(reviewed_patches):
-            log("All reviewed patches on bug %s already have commit-queue+, ignoring." % bug_id)
-            return
-
-        latest_patch = reviewed_patches[-1]
-        attacher_email = latest_patch.attacher_email()
-        committer = committers.committer_by_email(attacher_email)
-        if not committer:
-            log("Attacher %s is not a committer.  Bug %s likely needs commit-queue+." % (attacher_email, bug_id))
-            return
-
-        reassign_message = "Attachment %s was posted by a committer and has review+, assigning to %s for commit." % (latest_patch.id(), committer.full_name)
-        self.tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
-
-    def execute(self, options, args, tool):
-        for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
-            self._assign_bug_to_last_patch_attacher(bug_id)
-
-
-class ObsoleteAttachments(AbstractSequencedCommand):
-    name = "obsolete-attachments"
-    help_text = "Mark all attachments on a bug as obsolete"
-    argument_names = "BUGID"
-    steps = [
-        steps.ObsoletePatches,
-    ]
-
-    def _prepare_state(self, options, args, tool):
-        return { "bug_id" : args[0] }
-
-
-class AbstractPatchUploadingCommand(AbstractSequencedCommand):
-    def _bug_id(self, args, tool, state):
-        # Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs).
-        bug_id = args and args[0]
-        if not bug_id:
-            state["diff"] = tool.scm().create_patch()
-            bug_id = parse_bug_id(state["diff"])
-        return bug_id
-
-    def _prepare_state(self, options, args, tool):
-        state = {}
-        state["bug_id"] = self._bug_id(args, tool, state)
-        if not state["bug_id"]:
-            error("No bug id passed and no bug url found in diff.")
-        return state
-
-
-class Post(AbstractPatchUploadingCommand):
-    name = "post"
-    help_text = "Attach the current working directory diff to a bug as a patch file"
-    argument_names = "[BUGID]"
-    show_in_main_help = True
-    steps = [
-        steps.CheckStyle,
-        steps.ConfirmDiff,
-        steps.ObsoletePatches,
-        steps.PostDiff,
-    ]
-
-
-class LandSafely(AbstractPatchUploadingCommand):
-    name = "land-safely"
-    help_text = "Land the current diff via the commit-queue (Experimental)"
-    argument_names = "[BUGID]"
-    steps = [
-        steps.UpdateChangeLogsWithReviewer,
-        steps.ObsoletePatches,
-        steps.PostDiffForCommit,
-    ]
-
-
-class Prepare(AbstractSequencedCommand):
-    name = "prepare"
-    help_text = "Creates a bug (or prompts for an existing bug) and prepares the ChangeLogs"
-    argument_names = "[BUGID]"
-    show_in_main_help = True
-    steps = [
-        steps.PromptForBugOrTitle,
-        steps.CreateBug,
-        steps.PrepareChangeLog,
-    ]
-
-    def _prepare_state(self, options, args, tool):
-        bug_id = args and args[0]
-        return { "bug_id" : bug_id }
-
-
-class Upload(AbstractPatchUploadingCommand):
-    name = "upload"
-    help_text = "Automates the process of uploading a patch for review"
-    argument_names = "[BUGID]"
-    show_in_main_help = True
-    steps = [
-        steps.CheckStyle,
-        steps.PromptForBugOrTitle,
-        steps.CreateBug,
-        steps.PrepareChangeLog,
-        steps.EditChangeLog,
-        steps.ConfirmDiff,
-        steps.ObsoletePatches,
-        steps.PostDiff,
-    ]
-    long_help = """upload uploads the current diff to bugs.webkit.org.
-    If no bug id is provided, upload will create a bug.
-    If the current diff does not have a ChangeLog, upload
-    will prepare a ChangeLog.  Once a patch is read, upload
-    will open the ChangeLogs for editing using the command in the
-    EDITOR environment variable and will display the diff using the
-    command in the PAGER environment variable."""
-
-    def _prepare_state(self, options, args, tool):
-        state = {}
-        state["bug_id"] = self._bug_id(args, tool, state)
-        return state
-
-
-class EditChangeLogs(AbstractSequencedCommand):
-    name = "edit-changelogs"
-    help_text = "Opens modified ChangeLogs in $EDITOR"
-    show_in_main_help = True
-    steps = [
-        steps.EditChangeLog,
-    ]
-
-
-class PostCommits(AbstractDeclarativeCommand):
-    name = "post-commits"
-    help_text = "Attach a range of local commits to bugs as patch files"
-    argument_names = "COMMITISH"
-
-    def __init__(self):
-        options = [
-            make_option("-b", "--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
-            make_option("--add-log-as-comment", action="store_true", dest="add_log_as_comment", default=False, help="Add commit log message as a comment when uploading the patch."),
-            make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: description from commit message)"),
-            steps.Options.obsolete_patches,
-            steps.Options.review,
-            steps.Options.request_commit,
-        ]
-        AbstractDeclarativeCommand.__init__(self, options=options, requires_local_commits=True)
-
-    def _comment_text_for_commit(self, options, commit_message, tool, commit_id):
-        comment_text = None
-        if (options.add_log_as_comment):
-            comment_text = commit_message.body(lstrip=True)
-            comment_text += "---\n"
-            comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
-        return comment_text
-
-    def _diff_file_for_commit(self, tool, commit_id):
-        diff = tool.scm().create_patch_from_local_commit(commit_id)
-        return StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
-
-    def execute(self, options, args, tool):
-        commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
-        if len(commit_ids) > 10: # We could lower this limit, 10 is too many for one bug as-is.
-            error("webkit-patch does not support attaching %s at once.  Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
-
-        have_obsoleted_patches = set()
-        for commit_id in commit_ids:
-            commit_message = tool.scm().commit_message_for_local_commit(commit_id)
-
-            # Prefer --bug-id=, then a bug url in the commit message, then a bug url in the entire commit diff (i.e. ChangeLogs).
-            bug_id = options.bug_id or parse_bug_id(commit_message.message()) or parse_bug_id(tool.scm().create_patch_from_local_commit(commit_id))
-            if not bug_id:
-                log("Skipping %s: No bug id found in commit or specified with --bug-id." % commit_id)
-                continue
-
-            if options.obsolete_patches and bug_id not in have_obsoleted_patches:
-                state = { "bug_id": bug_id }
-                steps.ObsoletePatches(tool, options).run(state)
-                have_obsoleted_patches.add(bug_id)
-
-            diff_file = self._diff_file_for_commit(tool, commit_id)
-            description = options.description or commit_message.description(lstrip=True, strip_url=True)
-            comment_text = self._comment_text_for_commit(options, commit_message, tool, commit_id)
-            tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
-
-
-class MarkBugFixed(AbstractDeclarativeCommand):
-    name = "mark-bug-fixed"
-    help_text = "Mark the specified bug as fixed"
-    argument_names = "[SVN_REVISION]"
-    def __init__(self):
-        options = [
-            make_option("--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
-            make_option("--comment", action="store", type="string", dest="comment", help="Text to include in bug comment."),
-            make_option("--open", action="store_true", default=False, dest="open_bug", help="Open bug in default web browser (Mac only)."),
-            make_option("--update-only", action="store_true", default=False, dest="update_only", help="Add comment to the bug, but do not close it."),
-        ]
-        AbstractDeclarativeCommand.__init__(self, options=options)
-
-    def _fetch_commit_log(self, tool, svn_revision):
-        if not svn_revision:
-            return tool.scm().last_svn_commit_log()
-        return tool.scm().svn_commit_log(svn_revision)
-
-    def _determine_bug_id_and_svn_revision(self, tool, bug_id, svn_revision):
-        commit_log = self._fetch_commit_log(tool, svn_revision)
-
-        if not bug_id:
-            bug_id = parse_bug_id(commit_log)
-
-        if not svn_revision:
-            match = re.search("^r(?P<svn_revision>\d+) \|", commit_log, re.MULTILINE)
-            if match:
-                svn_revision = match.group('svn_revision')
-
-        if not bug_id or not svn_revision:
-            not_found = []
-            if not bug_id:
-                not_found.append("bug id")
-            if not svn_revision:
-                not_found.append("svn revision")
-            error("Could not find %s on command-line or in %s."
-                  % (" or ".join(not_found), "r%s" % svn_revision if svn_revision else "last commit"))
-
-        return (bug_id, svn_revision)
-
-    def execute(self, options, args, tool):
-        bug_id = options.bug_id
-
-        svn_revision = args and args[0]
-        if svn_revision:
-            if re.match("^r[0-9]+$", svn_revision, re.IGNORECASE):
-                svn_revision = svn_revision[1:]
-            if not re.match("^[0-9]+$", svn_revision):
-                error("Invalid svn revision: '%s'" % svn_revision)
-
-        needs_prompt = False
-        if not bug_id or not svn_revision:
-            needs_prompt = True
-            (bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(tool, bug_id, svn_revision)
-
-        log("Bug: <%s> %s" % (tool.bugs.bug_url_for_bug_id(bug_id), tool.bugs.fetch_bug_dictionary(bug_id)["title"]))
-        log("Revision: %s" % svn_revision)
-
-        if options.open_bug:
-            tool.user.open_url(tool.bugs.bug_url_for_bug_id(bug_id))
-
-        if needs_prompt:
-            if not tool.user.confirm("Is this correct?"):
-                exit(1)
-
-        bug_comment = bug_comment_from_svn_revision(svn_revision)
-        if options.comment:
-            bug_comment = "%s\n\n%s" % (options.comment, bug_comment)
-
-        if options.update_only:
-            log("Adding comment to Bug %s." % bug_id)
-            tool.bugs.post_comment_to_bug(bug_id, bug_comment)
-        else:
-            log("Adding comment to Bug %s and marking as Resolved/Fixed." % bug_id)
-            tool.bugs.close_bug_as_fixed(bug_id, bug_comment)
-
-
-# FIXME: Requires unit test.  Blocking issue: too complex for now.
-class CreateBug(AbstractDeclarativeCommand):
-    name = "create-bug"
-    help_text = "Create a bug from local changes or local commits"
-    argument_names = "[COMMITISH]"
-
-    def __init__(self):
-        options = [
-            steps.Options.cc,
-            steps.Options.component,
-            make_option("--no-prompt", action="store_false", dest="prompt", default=True, help="Do not prompt for bug title and comment; use commit log instead."),
-            make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review."),
-            make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."),
-        ]
-        AbstractDeclarativeCommand.__init__(self, options=options)
-
-    def create_bug_from_commit(self, options, args, tool):
-        commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
-        if len(commit_ids) > 3:
-            error("Are you sure you want to create one bug with %s patches?" % len(commit_ids))
-
-        commit_id = commit_ids[0]
-
-        bug_title = ""
-        comment_text = ""
-        if options.prompt:
-            (bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
-        else:
-            commit_message = tool.scm().commit_message_for_local_commit(commit_id)
-            bug_title = commit_message.description(lstrip=True, strip_url=True)
-            comment_text = commit_message.body(lstrip=True)
-            comment_text += "---\n"
-            comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
-
-        diff = tool.scm().create_patch_from_local_commit(commit_id)
-        diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
-        bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
-
-        if bug_id and len(commit_ids) > 1:
-            options.bug_id = bug_id
-            options.obsolete_patches = False
-            # FIXME: We should pass through --no-comment switch as well.
-            PostCommits.execute(self, options, commit_ids[1:], tool)
-
-    def create_bug_from_patch(self, options, args, tool):
-        bug_title = ""
-        comment_text = ""
-        if options.prompt:
-            (bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
-        else:
-            commit_message = tool.scm().commit_message_for_this_commit()
-            bug_title = commit_message.description(lstrip=True, strip_url=True)
-            comment_text = commit_message.body(lstrip=True)
-
-        diff = tool.scm().create_patch()
-        diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
-        bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
-
-    def prompt_for_bug_title_and_comment(self):
-        bug_title = User.prompt("Bug title: ")
-        print "Bug comment (hit ^D on blank line to end):"
-        lines = sys.stdin.readlines()
-        try:
-            sys.stdin.seek(0, os.SEEK_END)
-        except IOError:
-            # Cygwin raises an Illegal Seek (errno 29) exception when the above
-            # seek() call is made. Ignoring it seems to cause no harm.
-            # FIXME: Figure out a way to get avoid the exception in the first
-            # place.
-            pass
-        comment_text = "".join(lines)
-        return (bug_title, comment_text)
-
-    def execute(self, options, args, tool):
-        if len(args):
-            if (not tool.scm().supports_local_commits()):
-                error("Extra arguments not supported; patch is taken from working directory.")
-            self.create_bug_from_commit(options, args, tool)
-        else:
-            self.create_bug_from_patch(options, args, tool)
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
deleted file mode 100644
index 7fa8797..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2009 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.
-
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.upload import *
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-
-class UploadCommandsTest(CommandsTest):
-    def test_commit_message_for_current_diff(self):
-        tool = MockBugzillaTool()
-        mock_commit_message_for_this_commit = Mock()
-        mock_commit_message_for_this_commit.message = lambda: "Mock message"
-        tool._scm.commit_message_for_this_commit = lambda: mock_commit_message_for_this_commit
-        expected_stdout = "Mock message\n"
-        self.assert_execute_outputs(CommitMessageForCurrentDiff(), [], expected_stdout=expected_stdout, tool=tool)
-
-    def test_clean_pending_commit(self):
-        self.assert_execute_outputs(CleanPendingCommit(), [])
-
-    def test_assign_to_committer(self):
-        tool = MockBugzillaTool()
-        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nBug 77 is already assigned to foo@foo.com (None).\nBug 76 has no non-obsolete patches, ignoring.\n"
-        self.assert_execute_outputs(AssignToCommitter(), [], expected_stderr=expected_stderr, tool=tool)
-        tool.bugs.reassign_bug.assert_called_with(42, "eric@webkit.org", "Attachment 128 was posted by a committer and has review+, assigning to Eric Seidel for commit.")
-
-    def test_obsolete_attachments(self):
-        expected_stderr = "Obsoleting 2 old patches on bug 42\n"
-        self.assert_execute_outputs(ObsoleteAttachments(), [42], expected_stderr=expected_stderr)
-
-    def test_post(self):
-        expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\n"
-        self.assert_execute_outputs(Post(), [42], expected_stderr=expected_stderr)
-
-    def test_post(self):
-        expected_stderr = "Obsoleting 2 old patches on bug 42\n"
-        self.assert_execute_outputs(LandSafely(), [42], expected_stderr=expected_stderr)
-
-    def test_prepare_diff_with_arg(self):
-        self.assert_execute_outputs(Prepare(), [42])
-
-    def test_prepare(self):
-        self.assert_execute_outputs(Prepare(), [])
-
-    def test_upload(self):
-        expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\nMOCK: user.open_url: http://example.com/42\n"
-        self.assert_execute_outputs(Upload(), [42], expected_stderr=expected_stderr)
-
-    def test_mark_bug_fixed(self):
-        tool = MockBugzillaTool()
-        tool._scm.last_svn_commit_log = lambda: "r9876 |"
-        options = Mock()
-        options.bug_id = 42
-        expected_stderr = """Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.
-Revision: 9876
-MOCK: user.open_url: http://example.com/42
-Adding comment to Bug 42.
-"""
-        self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
-
-    def test_edit_changelog(self):
-        self.assert_execute_outputs(EditChangeLogs(), [])
diff --git a/WebKitTools/Scripts/webkitpy/comments.py b/WebKitTools/Scripts/webkitpy/comments.py
deleted file mode 100755
index 77ad239..0000000
--- a/WebKitTools/Scripts/webkitpy/comments.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-#     * 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.
-#
-# A tool for automating dealing with bugzilla, posting patches, committing
-# patches, etc.
-
-from webkitpy.changelogs import view_source_url
-
-
-def bug_comment_from_svn_revision(svn_revision):
-    return "Committed r%s: <%s>" % (svn_revision,
-                                    view_source_url(svn_revision))
-
-
-def bug_comment_from_commit_text(scm, commit_text):
-    svn_revision = scm.svn_revision_from_commit_text(commit_text)
-    return bug_comment_from_svn_revision(svn_revision)
diff --git a/WebKitTools/Scripts/webkitpy/committers.py b/WebKitTools/Scripts/webkitpy/committers.py
deleted file mode 100644
index 6413243..0000000
--- a/WebKitTools/Scripts/webkitpy/committers.py
+++ /dev/null
@@ -1,270 +0,0 @@
-# Copyright (c) 2009, 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.
-#
-# WebKit's Python module for committer and reviewer validation
-
-
-class Committer:
-
-    def __init__(self, name, email_or_emails):
-        self.full_name = name
-        if isinstance(email_or_emails, str):
-            self.emails = [email_or_emails]
-        else:
-            self.emails = email_or_emails
-        self.can_review = False
-
-    def bugzilla_email(self):
-        # FIXME: We're assuming the first email is a valid bugzilla email,
-        # which might not be right.
-        return self.emails[0]
-
-    def __str__(self):
-        return '"%s" <%s>' % (self.full_name, self.emails[0])
-
-
-class Reviewer(Committer):
-
-    def __init__(self, name, email_or_emails):
-        Committer.__init__(self, name, email_or_emails)
-        self.can_review = True
-
-
-# This is intended as a canonical, machine-readable list of all non-reviewer
-# committers for WebKit.  If your name is missing here and you are a committer,
-# please add it.  No review needed.  All reviewers are committers, so this list
-# is only of committers who are not reviewers.
-
-
-committers_unable_to_review = [
-    Committer("Aaron Boodman", "aa@chromium.org"),
-    Committer("Adam Langley", "agl@chromium.org"),
-    Committer("Albert J. Wong", "ajwong@chromium.org"),
-    Committer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"]),
-    Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"]),
-    Committer("Alexander Pavlov", "apavlov@chromium.org"),
-    Committer("Andre Boule", "aboule@apple.com"),
-    Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"]),
-    Committer("Andras Becsi", "abecsi@webkit.org"),
-    Committer("Anthony Ricaud", "rik@webkit.org"),
-    Committer("Anton Muhin", "antonm@chromium.org"),
-    Committer("Antonio Gomes", "tonikitoo@webkit.org"),
-    Committer("Ben Murdoch", "benm@google.com"),
-    Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"]),
-    Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"]),
-    Committer("Brent Fulgham", "bfulgham@webkit.org"),
-    Committer("Brett Wilson", "brettw@chromium.org"),
-    Committer("Brian Weinstein", "bweinstein@apple.com"),
-    Committer("Cameron McCormack", "cam@webkit.org"),
-    Committer("Carol Szabo", "carol.szabo@nokia.com"),
-    Committer("Chang Shu", "Chang.Shu@nokia.com"),
-    Committer("Chris Fleizach", "cfleizach@apple.com"),
-    Committer("Chris Jerdonek", "cjerdonek@webkit.org"),
-    Committer("Chris Marrin", "cmarrin@apple.com"),
-    Committer("Chris Petersen", "cpetersen@apple.com"),
-    Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]),
-    Committer("Collin Jackson", "collinj@webkit.org"),
-    Committer("Csaba Osztrogonac", "ossy@webkit.org"),
-    Committer("Daniel Bates", "dbates@webkit.org"),
-    Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"]),
-    Committer("Dean Jackson", "dino@apple.com"),
-    Committer("Dirk Pranke", "dpranke@chromium.org"),
-    Committer("Drew Wilson", "atwilson@chromium.org"),
-    Committer("Dumitru Daniliuc", "dumi@chromium.org"),
-    Committer("Eli Fidler", "eli@staikos.net"),
-    Committer("Enrica Casucci", "enrica@apple.com"),
-    Committer("Erik Arvidsson", "arv@chromium.org"),
-    Committer("Eric Roman", "eroman@chromium.org"),
-    Committer("Feng Qian", "feng@chromium.org"),
-    Committer("Fumitoshi Ukai", "ukai@chromium.org"),
-    Committer("Gabor Loki", "loki@webkit.org"),
-    Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"]),
-    Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
-    Committer("Greg Bolsinga", "bolsinga@apple.com"),
-    Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
-    Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"]),
-    Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]),
-    Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"]),
-    Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]),
-    Committer("Jian Li", "jianli@chromium.org"),
-    Committer("John Abd-El-Malek", "jam@chromium.org"),
-    Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"]),
-    Committer("Joseph Pecoraro", "joepeck@webkit.org"),
-    Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"]),
-    Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]),
-    Committer("Jungshik Shin", "jshin@chromium.org"),
-    Committer("Keishi Hattori", "keishi@webkit.org"),
-    Committer("Kelly Norton", "knorton@google.com"),
-    Committer("Kenneth Russell", "kbr@google.com"),
-    Committer("Kent Tamura", "tkent@chromium.org"),
-    Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
-    Committer("Levi Weintraub", "lweintraub@apple.com"),
-    Committer("Mads Ager", "ager@chromium.org"),
-    Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
-    Committer("Matt Perry", "mpcomplete@chromium.org"),
-    Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
-    Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"]),
-    Committer("Martin Robinson", ["mrobinson@webkit.org", "martin.james.robinson@gmail.com"]),
-    Committer("Michelangelo De Simone", "michelangelo@webkit.org"),
-    Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
-    Committer("Mike Fenton", ["mike.fenton@torchmobile.com", "mifenton@rim.com"]),
-    Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
-    Committer("Mikhail Naganov", "mnaganov@chromium.org"),
-    Committer("Ojan Vafai", "ojan@chromium.org"),
-    Committer("Pam Greene", "pam@chromium.org"),
-    Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"]),
-    Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"]),
-    Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"]),
-    Committer("Pierre-Olivier Latour", "pol@apple.com"),
-    Committer("Roland Steiner", "rolandsteiner@chromium.org"),
-    Committer("Ryosuke Niwa", "rniwa@webkit.org"),
-    Committer("Scott Violet", "sky@chromium.org"),
-    Committer("Stephen White", "senorblanco@chromium.org"),
-    Committer("Steve Block", "steveblock@google.com"),
-    Committer("Tony Chang", "tony@chromium.org"),
-    Committer("Trey Matteson", "trey@usa.net"),
-    Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
-    Committer("Victor Wang", "victorw@chromium.org"),
-    Committer("William Siegrist", "wsiegrist@apple.com"),
-    Committer("Yael Aharon", "yael.aharon@nokia.com"),
-    Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]),
-    Committer("Yong Li", ["yong.li@torchmobile.com", "yong.li.webkit@gmail.com"]),
-    Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"),
-    Committer("Yury Semikhatsky", "yurys@chromium.org"),
-    Committer("Yuzo Fujishima", "yuzo@google.com"),
-    Committer("Zoltan Herczeg", "zherczeg@webkit.org"),
-    Committer("Zoltan Horvath", "zoltan@webkit.org"),
-]
-
-
-# This is intended as a canonical, machine-readable list of all reviewers for
-# WebKit.  If your name is missing here and you are a reviewer, please add it.
-# No review needed.
-
-
-reviewers_list = [
-    Reviewer("Ada Chan", "adachan@apple.com"),
-    Reviewer("Adam Barth", "abarth@webkit.org"),
-    Reviewer("Adam Roben", "aroben@apple.com"),
-    Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org"]),
-    Reviewer("Adele Peterson", "adele@apple.com"),
-    Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"]),
-    Reviewer("Alice Liu", "alice.liu@apple.com"),
-    Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"]),
-    Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"]),
-    Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com"]),
-    Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@webkit.org"]),
-    Reviewer("Beth Dakin", "bdakin@apple.com"),
-    Reviewer("Brady Eidson", "beidson@apple.com"),
-    Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
-    Reviewer("Chris Blumenberg", "cblu@apple.com"),
-    Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"]),
-    Reviewer("Darin Adler", "darin@apple.com"),
-    Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"]),
-    Reviewer("David Harrison", "harrison@apple.com"),
-    Reviewer("David Hyatt", "hyatt@apple.com"),
-    Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"]),
-    Reviewer("David Levin", "levin@chromium.org"),
-    Reviewer("Dimitri Glazkov", "dglazkov@chromium.org"),
-    Reviewer("Dirk Schulze", "krit@webkit.org"),
-    Reviewer("Dmitry Titov", "dimich@chromium.org"),
-    Reviewer("Don Melton", "gramps@apple.com"),
-    Reviewer("Eric Carlson", "eric.carlson@apple.com"),
-    Reviewer("Eric Seidel", "eric@webkit.org"),
-    Reviewer("Gavin Barraclough", "barraclough@apple.com"),
-    Reviewer("Geoffrey Garen", "ggaren@apple.com"),
-    Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
-    Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org"]),
-    Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"]),
-    Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"]),
-    Reviewer("Jeremy Orlow", "jorlow@chromium.org"),
-    Reviewer("John Sullivan", "sullivan@apple.com"),
-    Reviewer("Jon Honeycutt", "jhoneycutt@apple.com"),
-    Reviewer("Justin Garcia", "justin.garcia@apple.com"),
-    Reviewer("Ken Kocienda", "kocienda@apple.com"),
-    Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org"]),
-    Reviewer("Kevin Decker", "kdecker@apple.com"),
-    Reviewer("Kevin McCullough", "kmccullough@apple.com"),
-    Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"]),
-    Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org"]),
-    Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com"),
-    Reviewer("Maciej Stachowiak", "mjs@apple.com"),
-    Reviewer("Mark Rowe", "mrowe@apple.com"),
-    Reviewer("Nate Chapin", "japhet@chromium.org"),
-    Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"]),
-    Reviewer("Oliver Hunt", "oliver@apple.com"),
-    Reviewer("Pavel Feldman", "pfeldman@chromium.org"),
-    Reviewer("Richard Williamson", "rjw@apple.com"),
-    Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org"]),
-    Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"]),
-    Reviewer("Shinichiro Hamaji", "hamaji@chromium.org"),
-    Reviewer("Simon Fraser", "simon.fraser@apple.com"),
-    Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"]),
-    Reviewer("Stephanie Lewis", "slewis@apple.com"),
-    Reviewer("Steve Falkenburg", "sfalken@apple.com"),
-    Reviewer("Tim Omernick", "timo@apple.com"),
-    Reviewer("Timothy Hatcher", ["timothy@hatcher.name", "timothy@apple.com"]),
-    Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org"),
-    Reviewer("Vicki Murley", "vicki@apple.com"),
-    Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org"]),
-    Reviewer("Zack Rusin", "zack@kde.org"),
-]
-
-
-class CommitterList:
-
-    # Committers and reviewers are passed in to allow easy testing
-
-    def __init__(self,
-                 committers=committers_unable_to_review,
-                 reviewers=reviewers_list):
-        self._committers = committers + reviewers
-        self._reviewers = reviewers
-        self._committers_by_email = {}
-
-    def committers(self):
-        return self._committers
-
-    def reviewers(self):
-        return self._reviewers
-
-    def _email_to_committer_map(self):
-        if not len(self._committers_by_email):
-            for committer in self._committers:
-                for email in committer.emails:
-                    self._committers_by_email[email] = committer
-        return self._committers_by_email
-
-    def committer_by_email(self, email):
-        return self._email_to_committer_map().get(email)
-
-    def reviewer_by_email(self, email):
-        committer = self.committer_by_email(email)
-        if committer and not committer.can_review:
-            return None
-        return committer
diff --git a/WebKitTools/Scripts/webkitpy/committers_unittest.py b/WebKitTools/Scripts/webkitpy/committers_unittest.py
deleted file mode 100644
index f5dc539..0000000
--- a/WebKitTools/Scripts/webkitpy/committers_unittest.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-from committers import CommitterList, Committer, Reviewer
-
-class CommittersTest(unittest.TestCase):
-
-    def test_committer_lookup(self):
-        committer = Committer('Test One', 'one@test.com')
-        reviewer = Reviewer('Test Two', ['two@test.com', 'two@rad.com', 'so_two@gmail.com'])
-        committer_list = CommitterList(committers=[committer], reviewers=[reviewer])
-
-        # Test valid committer and reviewer lookup
-        self.assertEqual(committer_list.committer_by_email('one@test.com'), committer)
-        self.assertEqual(committer_list.reviewer_by_email('two@test.com'), reviewer)
-        self.assertEqual(committer_list.committer_by_email('two@test.com'), reviewer)
-        self.assertEqual(committer_list.committer_by_email('two@rad.com'), reviewer)
-        self.assertEqual(committer_list.reviewer_by_email('so_two@gmail.com'), reviewer)
-
-        # Test that the first email is assumed to be the Bugzilla email address (for now)
-        self.assertEqual(committer_list.committer_by_email('two@rad.com').bugzilla_email(), 'two@test.com')
-
-        # Test that a known committer is not returned during reviewer lookup
-        self.assertEqual(committer_list.reviewer_by_email('one@test.com'), None)
-
-        # Test that unknown email address fail both committer and reviewer lookup
-        self.assertEqual(committer_list.committer_by_email('bar@bar.com'), None)
-        self.assertEqual(committer_list.reviewer_by_email('bar@bar.com'), None)
-
-        # Test that emails returns a list.
-        self.assertEqual(committer.emails, ['one@test.com'])
-
-        # Test that committers returns committers and reviewers and reviewers() just reviewers.
-        self.assertEqual(committer_list.committers(), [committer, reviewer])
-        self.assertEqual(committer_list.reviewers(), [reviewer])
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/__init__.py
similarity index 100%
rename from WebKitTools/Scripts/webkitpy/commands/__init__.py
rename to WebKitTools/Scripts/webkitpy/common/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api.py b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
new file mode 100644
index 0000000..c4e2b69
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
@@ -0,0 +1,140 @@
+# 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.
+
+import os
+import subprocess
+import StringIO
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.checkout.scm import CommitMessage
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.deprecated_logging import log
+
+
+# This class represents the WebKit-specific parts of the checkout (like
+# ChangeLogs).
+# FIXME: Move a bunch of ChangeLog-specific processing from SCM to this object.
+class Checkout(object):
+    def __init__(self, scm):
+        self._scm = scm
+
+    def _is_path_to_changelog(self, path):
+        return os.path.basename(path) == "ChangeLog"
+
+    def _latest_entry_for_changelog_at_revision(self, changelog_path, revision):
+        changelog_contents = self._scm.contents_at_revision(changelog_path, revision)
+        return ChangeLog.parse_latest_entry_from_file(StringIO.StringIO(changelog_contents))
+
+    def changelog_entries_for_revision(self, revision):
+        changed_files = self._scm.changed_files_for_revision(revision)
+        return [self._latest_entry_for_changelog_at_revision(path, revision) for path in changed_files if self._is_path_to_changelog(path)]
+
+    def commit_info_for_revision(self, revision):
+        committer_email = self._scm.committer_email_for_revision(revision)
+        changelog_entries = self.changelog_entries_for_revision(revision)
+        # Assume for now that the first entry has everything we need:
+        # FIXME: This will throw an exception if there were no ChangeLogs.
+        if not len(changelog_entries):
+            return None
+        changelog_entry = changelog_entries[0]
+        changelog_data = {
+            "bug_id": parse_bug_id(changelog_entry.contents()),
+            "author_name": changelog_entry.author_name(),
+            "author_email": changelog_entry.author_email(),
+            "author": changelog_entry.author(),
+            "reviewer_text": changelog_entry.reviewer_text(),
+            "reviewer": changelog_entry.reviewer(),
+        }
+        # We could pass the changelog_entry instead of a dictionary here, but that makes
+        # mocking slightly more involved, and would make aggregating data from multiple
+        # entries more difficult to wire in if we need to do that in the future.
+        return CommitInfo(revision, committer_email, changelog_data)
+
+    def bug_id_for_revision(self, revision):
+        return self.commit_info_for_revision(revision).bug_id()
+
+    def modified_changelogs(self):
+        # SCM returns paths relative to scm.checkout_root
+        # Callers (especially those using the ChangeLog class) may
+        # expect absolute paths, so this method returns absolute paths.
+        changed_files = self._scm.changed_files()
+        absolute_paths = [os.path.join(self._scm.checkout_root, path) for path in changed_files]
+        return [path for path in absolute_paths if self._is_path_to_changelog(path)]
+
+    def commit_message_for_this_commit(self):
+        changelog_paths = self.modified_changelogs()
+        if not len(changelog_paths):
+            raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
+                              "All changes require a ChangeLog.  See:\n"
+                              "http://webkit.org/coding/contributing.html")
+
+        changelog_messages = []
+        for changelog_path in changelog_paths:
+            log("Parsing ChangeLog: %s" % changelog_path)
+            changelog_entry = ChangeLog(changelog_path).latest_entry()
+            if not changelog_entry:
+                raise ScriptError(message="Failed to parse ChangeLog: %s" % os.path.abspath(changelog_path))
+            changelog_messages.append(changelog_entry.contents())
+
+        # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
+        return CommitMessage("".join(changelog_messages).splitlines())
+
+    def bug_id_for_this_commit(self):
+        try:
+            return parse_bug_id(self.commit_message_for_this_commit().message())
+        except ScriptError, e:
+            pass # We might not have ChangeLogs.
+
+    def apply_patch(self, patch, force=False):
+        # It's possible that the patch was not made from the root directory.
+        # We should detect and handle that case.
+        # FIXME: Use Executive instead of subprocess here.
+        curl_process = subprocess.Popen(['curl', '--location', '--silent', '--show-error', patch.url()], stdout=subprocess.PIPE)
+        # FIXME: Move _scm.script_path here once we get rid of all the dependencies.
+        args = [self._scm.script_path('svn-apply')]
+        if patch.reviewer():
+            args += ['--reviewer', patch.reviewer().full_name]
+        if force:
+            args.append('--force')
+
+        run_command(args, input=curl_process.stdout)
+
+    def apply_reverse_diff(self, revision):
+        self._scm.apply_reverse_diff(revision)
+
+        # We revert the ChangeLogs because removing lines from a ChangeLog
+        # doesn't make sense.  ChangeLogs are append only.
+        changelog_paths = self.modified_changelogs()
+        if len(changelog_paths):
+            self._scm.revert_files(changelog_paths)
+
+        conflicts = self._scm.conflicted_files()
+        if len(conflicts):
+            raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts)))
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
new file mode 100644
index 0000000..e99caee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
@@ -0,0 +1,169 @@
+# 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.
+
+import os
+import shutil
+import tempfile
+import unittest
+
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.changelog import ChangeLogEntry
+from webkitpy.common.checkout.scm import detect_scm_system, CommitMessage
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+# FIXME: Copied from scm_unittest.py
+def write_into_file_at_path(file_path, contents):
+    new_file = open(file_path, 'w')
+    new_file.write(contents)
+    new_file.close()
+
+
+_changelog1entry1 = """2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed build fix to un-break webkit-patch land.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+"""
+_changelog1entry2 = """2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        * Scripts/webkitpy/common/checkout/api.py:
+"""
+_changelog1 = "\n".join([_changelog1entry1, _changelog1entry2])
+_changelog2 = """2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed build fix to un-break webkit-patch land.
+
+        Second part of this complicated change.
+
+        * Path/To/Complicated/File: Added.
+
+2010-03-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Filler change.
+"""
+
+class CommitMessageForThisCommitTest(unittest.TestCase):
+    expected_commit_message = """2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed build fix to un-break webkit-patch land.
+
+        Move commit_message_for_this_commit from scm to checkout
+        https://bugs.webkit.org/show_bug.cgi?id=36629
+
+        * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+2010-03-25  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed build fix to un-break webkit-patch land.
+
+        Second part of this complicated change.
+
+        * Path/To/Complicated/File: Added.
+"""
+
+    def setUp(self):
+        self.temp_dir = tempfile.mkdtemp(suffix="changelogs")
+        self.old_cwd = os.getcwd()
+        os.chdir(self.temp_dir)
+        write_into_file_at_path("ChangeLog1", _changelog1)
+        write_into_file_at_path("ChangeLog2", _changelog2)
+
+    def tearDown(self):
+        shutil.rmtree(self.temp_dir, ignore_errors=True)
+        os.chdir(self.old_cwd)
+
+    # FIXME: This should not need to touch the file system, however
+    # ChangeLog is difficult to mock at current.
+    def test_commit_message_for_this_commit(self):
+        checkout = Checkout(None)
+        checkout.modified_changelogs = lambda: ["ChangeLog1", "ChangeLog2"]
+        output = OutputCapture()
+        expected_stderr = "Parsing ChangeLog: ChangeLog1\nParsing ChangeLog: ChangeLog2\n"
+        commit_message = output.assert_outputs(self, checkout.commit_message_for_this_commit, expected_stderr=expected_stderr)
+        self.assertEqual(commit_message.message(), self.expected_commit_message)
+
+
+class CheckoutTest(unittest.TestCase):
+    def test_latest_entry_for_changelog_at_revision(self):
+        scm = Mock()
+        def mock_contents_at_revision(changelog_path, revision):
+            self.assertEqual(changelog_path, "foo")
+            self.assertEqual(revision, "bar")
+            return _changelog1
+        scm.contents_at_revision = mock_contents_at_revision
+        checkout = Checkout(scm)
+        entry = checkout._latest_entry_for_changelog_at_revision("foo", "bar")
+        self.assertEqual(entry.contents(), _changelog1entry1)
+
+    def test_commit_info_for_revision(self):
+        scm = Mock()
+        scm.committer_email_for_revision = lambda revision: "committer@example.com"
+        checkout = Checkout(scm)
+        checkout.changelog_entries_for_revision = lambda revision: [ChangeLogEntry(_changelog1entry1)]
+        commitinfo = checkout.commit_info_for_revision(4)
+        self.assertEqual(commitinfo.bug_id(), 36629)
+        self.assertEqual(commitinfo.author_name(), "Eric Seidel")
+        self.assertEqual(commitinfo.author_email(), "eric@webkit.org")
+        self.assertEqual(commitinfo.reviewer_text(), None)
+        self.assertEqual(commitinfo.reviewer(), None)
+        self.assertEqual(commitinfo.committer_email(), "committer@example.com")
+        self.assertEqual(commitinfo.committer(), None)
+
+        checkout.changelog_entries_for_revision = lambda revision: []
+        self.assertEqual(checkout.commit_info_for_revision(1), None)
+
+    def test_bug_id_for_revision(self):
+        scm = Mock()
+        scm.committer_email_for_revision = lambda revision: "committer@example.com"
+        checkout = Checkout(scm)
+        checkout.changelog_entries_for_revision = lambda revision: [ChangeLogEntry(_changelog1entry1)]
+        self.assertEqual(checkout.bug_id_for_revision(4), 36629)
+
+    def test_bug_id_for_this_commit(self):
+        scm = Mock()
+        checkout = Checkout(scm)
+        checkout.commit_message_for_this_commit = lambda: CommitMessage(ChangeLogEntry(_changelog1entry1).contents().splitlines())
+        self.assertEqual(checkout.bug_id_for_this_commit(), 36629)
+
+    def test_modified_changelogs(self):
+        scm = Mock()
+        scm.checkout_root = "/foo/bar"
+        scm.changed_files = lambda:["file1", "ChangeLog", "relative/path/ChangeLog"]
+        checkout = Checkout(scm)
+        expected_changlogs = ["/foo/bar/ChangeLog", "/foo/bar/relative/path/ChangeLog"]
+        self.assertEqual(checkout.modified_changelogs(), expected_changlogs)
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py b/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
new file mode 100644
index 0000000..e93896f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
@@ -0,0 +1,181 @@
+# Copyright (C) 2009, 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.
+#
+# WebKit's Python module for parsing and modifying ChangeLog files
+
+import codecs
+import fileinput # inplace file editing for set_reviewer_in_changelog
+import os.path
+import re
+import textwrap
+
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config.committers import CommitterList
+
+def view_source_url(revision_number):
+    # FIMXE: This doesn't really belong in this file, but we don't have a
+    # better home for it yet.
+    # Maybe eventually a webkit_config.py?
+    return "http://trac.webkit.org/changeset/%s" % revision_number
+
+
+class ChangeLogEntry(object):
+    # e.g. 2009-06-03  Eric Seidel  <eric@webkit.org>
+    date_line_regexp = r'^(?P<date>\d{4}-\d{2}-\d{2})\s+(?P<name>.+?)\s+<(?P<email>[^<>]+)>$'
+
+    def __init__(self, contents, committer_list=CommitterList()):
+        self._contents = contents
+        self._committer_list = committer_list
+        self._parse_entry()
+
+    def _parse_entry(self):
+        match = re.match(self.date_line_regexp, self._contents, re.MULTILINE)
+        if not match:
+            log("WARNING: Creating invalid ChangeLogEntry:\n%s" % self._contents)
+
+        # FIXME: group("name") does not seem to be Unicode?  Probably due to self._contents not being unicode.
+        self._author_name = match.group("name") if match else None
+        self._author_email = match.group("email") if match else None
+
+        match = re.search("^\s+Reviewed by (?P<reviewer>.*?)[\.,]?\s*$", self._contents, re.MULTILINE) # Discard everything after the first period
+        self._reviewer_text = match.group("reviewer") if match else None
+
+        self._reviewer = self._committer_list.committer_by_name(self._reviewer_text)
+        self._author = self._committer_list.committer_by_email(self._author_email) or self._committer_list.committer_by_name(self._author_name)
+
+    def author_name(self):
+        return self._author_name
+
+    def author_email(self):
+        return self._author_email
+
+    def author(self):
+        return self._author # Might be None
+
+    # FIXME: Eventually we would like to map reviwer names to reviewer objects.
+    # See https://bugs.webkit.org/show_bug.cgi?id=26533
+    def reviewer_text(self):
+        return self._reviewer_text
+
+    def reviewer(self):
+        return self._reviewer # Might be None
+
+    def contents(self):
+        return self._contents
+
+
+# FIXME: Various methods on ChangeLog should move into ChangeLogEntry instead.
+class ChangeLog(object):
+
+    def __init__(self, path):
+        self.path = path
+
+    _changelog_indent = " " * 8
+
+    @staticmethod
+    def parse_latest_entry_from_file(changelog_file):
+        date_line_regexp = re.compile(ChangeLogEntry.date_line_regexp)
+        entry_lines = []
+        # The first line should be a date line.
+        first_line = changelog_file.readline()
+        if not date_line_regexp.match(first_line):
+            return None
+        entry_lines.append(first_line)
+
+        for line in changelog_file:
+            # If we've hit the next entry, return.
+            if date_line_regexp.match(line):
+                # Remove the extra newline at the end
+                return ChangeLogEntry(''.join(entry_lines[:-1]))
+            entry_lines.append(line)
+        return None # We never found a date line!
+
+    def latest_entry(self):
+        # ChangeLog files are always UTF-8, we read them in as such to support Reviewers with unicode in their names.
+        changelog_file = codecs.open(self.path, "r", "utf-8")
+        try:
+            return self.parse_latest_entry_from_file(changelog_file)
+        finally:
+            changelog_file.close()
+
+    # _wrap_line and _wrap_lines exist to work around
+    # http://bugs.python.org/issue1859
+
+    def _wrap_line(self, line):
+        return textwrap.fill(line,
+                             width=70,
+                             initial_indent=self._changelog_indent,
+                             # Don't break urls which may be longer than width.
+                             break_long_words=False,
+                             subsequent_indent=self._changelog_indent)
+
+    # Workaround as suggested by guido in
+    # http://bugs.python.org/issue1859#msg60040
+
+    def _wrap_lines(self, message):
+        lines = [self._wrap_line(line) for line in message.splitlines()]
+        return "\n".join(lines)
+
+    # This probably does not belong in changelogs.py
+    def _message_for_revert(self, revision, reason, bug_url):
+        message = "Unreviewed, rolling out r%s.\n" % revision
+        message += "%s\n" % view_source_url(revision)
+        if bug_url:
+            message += "%s\n" % bug_url
+        # Add an extra new line after the rollout links, before any reason.
+        message += "\n"
+        if reason:
+            message += "%s\n\n" % reason
+        return self._wrap_lines(message)
+
+    def update_for_revert(self, revision, reason, bug_url=None):
+        reviewed_by_regexp = re.compile(
+                "%sReviewed by NOBODY \(OOPS!\)\." % self._changelog_indent)
+        removing_boilerplate = False
+        # inplace=1 creates a backup file and re-directs stdout to the file
+        for line in fileinput.FileInput(self.path, inplace=1):
+            if reviewed_by_regexp.search(line):
+                message_lines = self._message_for_revert(revision,
+                                                         reason,
+                                                         bug_url)
+                print reviewed_by_regexp.sub(message_lines, line),
+                # Remove all the ChangeLog boilerplate between the Reviewed by
+                # line and the first changed file.
+                removing_boilerplate = True
+            elif removing_boilerplate:
+                if line.find('*') >= 0: # each changed file is preceded by a *
+                    removing_boilerplate = False
+
+            if not removing_boilerplate:
+                print line,
+
+    def set_reviewer(self, reviewer):
+        # inplace=1 creates a backup file and re-directs stdout to the file
+        for line in fileinput.FileInput(self.path, inplace=1):
+            # Trailing comma suppresses printing newline
+            print line.replace("NOBODY (OOPS!)", reviewer.encode("utf-8")),
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py
new file mode 100644
index 0000000..9210c9c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py
@@ -0,0 +1,190 @@
+# Copyright (C) 2009 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.
+
+import unittest
+import os
+import tempfile
+
+from StringIO import StringIO
+
+from webkitpy.common.checkout.changelog import *
+
+
+class ChangeLogsTest(unittest.TestCase):
+
+    _example_entry = u'''2009-08-17  Peter Kasting  <pkasting@google.com>
+
+        Reviewed by Tor Arne Vestb\xf8.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27323
+        Only add Cygwin to the path when it isn't already there.  This avoids
+        causing problems for people who purposefully have non-Cygwin versions of
+        executables like svn in front of the Cygwin ones in their paths.
+
+        * DumpRenderTree/win/DumpRenderTree.vcproj:
+        * DumpRenderTree/win/ImageDiff.vcproj:
+        * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+'''
+
+    # More example text than we need.  Eventually we need to support parsing this all and write tests for the parsing.
+    _example_changelog = '''2009-08-17  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/28393> check-webkit-style: add check for use of std::max()/std::min() instead of MAX()/MIN()
+
+        Reviewed by David Levin.
+
+        * Scripts/modules/cpp_style.py:
+        (_ERROR_CATEGORIES): Added 'runtime/max_min_macros'.
+        (check_max_min_macros): Added.  Returns level 4 error when MAX()
+        and MIN() macros are used in header files and C++ source files.
+        (check_style): Added call to check_max_min_macros().
+        * Scripts/modules/cpp_style_unittest.py: Added unit tests.
+        (test_max_macro): Added.
+        (test_min_macro): Added.
+
+2009-08-16  David Kilzer  <ddkilzer@apple.com>
+
+        Backed out r47343 which was mistakenly committed
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/scm.py:
+
+2009-06-18  Darin Adler  <darin@apple.com>
+
+        Rubber stamped by Mark Rowe.
+
+        * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+        (-[DumpRenderTreeWindow close]): Resolved crashes seen during regression
+        tests. The close method can be called on a window that's already closed
+        so we can't assert here.
+
+== Rolled over to ChangeLog-2009-06-16 ==
+'''
+
+    def test_latest_entry_parse(self):
+        changelog_contents = "%s\n%s" % (self._example_entry, self._example_changelog)
+        changelog_file = StringIO(changelog_contents)
+        latest_entry = ChangeLog.parse_latest_entry_from_file(changelog_file)
+        self.assertEquals(latest_entry.contents(), self._example_entry)
+        self.assertEquals(latest_entry.author_name(), "Peter Kasting")
+        self.assertEquals(latest_entry.author_email(), "pkasting@google.com")
+        self.assertEquals(latest_entry.reviewer_text(), u"Tor Arne Vestb\xf8")
+        self.assertTrue(latest_entry.reviewer())  # Make sure that our UTF8-based lookup of Tor works.
+
+    @staticmethod
+    def _write_tmp_file_with_contents(contents):
+        (file_descriptor, file_path) = tempfile.mkstemp() # NamedTemporaryFile always deletes the file on close in python < 2.6
+        file = os.fdopen(file_descriptor, 'w')
+        file.write(contents)
+        file.close()
+        return file_path
+
+    @staticmethod
+    def _read_file_contents(file_path):
+        file = open(file_path)
+        contents = file.read()
+        file.close()
+        return contents
+
+    _new_entry_boilerplate = '''2009-08-19  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by NOBODY (OOPS!).
+
+        Need a short description and bug URL (OOPS!)
+
+        * Scripts/bugzilla-tool:
+'''
+
+    def test_set_reviewer(self):
+        changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+        changelog_path = self._write_tmp_file_with_contents(changelog_contents)
+        reviewer_name = 'Test Reviewer'
+        ChangeLog(changelog_path).set_reviewer(reviewer_name)
+        actual_contents = self._read_file_contents(changelog_path)
+        expected_contents = changelog_contents.replace('NOBODY (OOPS!)', reviewer_name)
+        os.remove(changelog_path)
+        self.assertEquals(actual_contents, expected_contents)
+
+    _revert_message = """        Unreviewed, rolling out r12345.
+        http://trac.webkit.org/changeset/12345
+        http://example.com/123
+
+        This is a very long reason which should be long enough so that
+        _message_for_revert will need to wrap it.  We'll also include
+        a
+        https://veryveryveryveryverylongbugurl.com/reallylongbugthingy.cgi?bug_id=12354
+        link so that we can make sure we wrap that right too.
+"""
+
+    def test_message_for_revert(self):
+        changelog = ChangeLog("/fake/path")
+        long_reason = "This is a very long reason which should be long enough so that _message_for_revert will need to wrap it.  We'll also include a https://veryveryveryveryverylongbugurl.com/reallylongbugthingy.cgi?bug_id=12354 link so that we can make sure we wrap that right too."
+        message = changelog._message_for_revert(12345, long_reason, "http://example.com/123")
+        self.assertEquals(message, self._revert_message)
+
+    _revert_entry_with_bug_url = '''2009-08-19  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r12345.
+        http://trac.webkit.org/changeset/12345
+        http://example.com/123
+
+        Reason
+
+        * Scripts/bugzilla-tool:
+'''
+
+    _revert_entry_without_bug_url = '''2009-08-19  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r12345.
+        http://trac.webkit.org/changeset/12345
+
+        Reason
+
+        * Scripts/bugzilla-tool:
+'''
+
+    def _assert_update_for_revert_output(self, args, expected_entry):
+        changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+        changelog_path = self._write_tmp_file_with_contents(changelog_contents)
+        changelog = ChangeLog(changelog_path)
+        changelog.update_for_revert(*args)
+        actual_entry = changelog.latest_entry()
+        os.remove(changelog_path)
+        self.assertEquals(actual_entry.contents(), expected_entry)
+        self.assertEquals(actual_entry.reviewer_text(), None)
+        # These checks could be removed to allow this to work on other entries:
+        self.assertEquals(actual_entry.author_name(), "Eric Seidel")
+        self.assertEquals(actual_entry.author_email(), "eric@webkit.org")
+
+    def test_update_for_revert(self):
+        self._assert_update_for_revert_output([12345, "Reason"], self._revert_entry_without_bug_url)
+        self._assert_update_for_revert_output([12345, "Reason", "http://example.com/123"], self._revert_entry_with_bug_url)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py
new file mode 100644
index 0000000..7c3315f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py
@@ -0,0 +1,95 @@
+# 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.
+#
+# WebKit's python module for holding information on a commit
+
+import StringIO
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.common.config.committers import CommitterList
+
+
+class CommitInfo(object):
+    def __init__(self, revision, committer_email, changelog_data, committer_list=CommitterList()):
+        self._revision = revision
+        self._committer_email = committer_email
+        self._bug_id = changelog_data["bug_id"]
+        self._author_name = changelog_data["author_name"]
+        self._author_email = changelog_data["author_email"]
+        self._author = changelog_data["author"]
+        self._reviewer_text = changelog_data["reviewer_text"]
+        self._reviewer = changelog_data["reviewer"]
+
+        # Derived values:
+        self._committer = committer_list.committer_by_email(committer_email)
+
+    def revision(self):
+        return self._revision
+
+    def committer(self):
+        return self._committer  # None if committer isn't in committers.py
+
+    def committer_email(self):
+        return self._committer_email
+
+    def bug_id(self):
+        return self._bug_id  # May be None
+
+    def author(self):
+        return self._author  # May be None
+
+    def author_name(self):
+        return self._author_name
+
+    def author_email(self):
+        return self._author_email
+
+    def reviewer(self):
+        return self._reviewer # May be None
+
+    def reviewer_text(self):
+        return self._reviewer_text # May be None
+
+    def responsible_parties(self):
+        responsible_parties = [
+            self.committer(),
+            self.author(),
+            self.reviewer(),
+        ]
+        return set([party for party in responsible_parties if party]) # Filter out None
+
+    # FIXME: It is slightly lame that this "view" method is on this "model" class (in MVC terms)
+    def blame_string(self, bugs):
+        string = "r%s:\n" % self.revision()
+        string += "  %s\n" % view_source_url(self.revision())
+        string += "  Bug: %s (%s)\n" % (self.bug_id(), bugs.bug_url_for_bug_id(self.bug_id()))
+        author_line = "\"%s\" <%s>" % (self.author_name(), self.author_email())
+        string += "  Author: %s\n" % (self.author() or author_line)
+        string += "  Reviewer: %s\n" % (self.reviewer() or self.reviewer_text())
+        string += "  Committer: %s" % self.committer()
+        return string
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
new file mode 100644
index 0000000..f58e6f1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
@@ -0,0 +1,61 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.config.committers import CommitterList, Committer, Reviewer
+
+class CommitInfoTest(unittest.TestCase):
+
+    def test_commit_info_creation(self):
+        author = Committer("Author", "author@example.com")
+        committer = Committer("Committer", "committer@example.com")
+        reviewer = Reviewer("Reviewer", "reviewer@example.com")
+        committer_list = CommitterList(committers=[author, committer], reviewers=[reviewer])
+
+        changelog_data = {
+            "bug_id": 1234,
+            "author_name": "Committer",
+            "author_email": "author@example.com",
+            "author": author,
+            "reviewer_text": "Reviewer",
+            "reviewer": reviewer,
+        }
+        commit = CommitInfo(123, "committer@example.com", changelog_data, committer_list)
+
+        self.assertEqual(commit.revision(), 123)
+        self.assertEqual(commit.bug_id(), 1234)
+        self.assertEqual(commit.author_name(), "Committer")
+        self.assertEqual(commit.author_email(), "author@example.com")
+        self.assertEqual(commit.author(), author)
+        self.assertEqual(commit.reviewer_text(), "Reviewer")
+        self.assertEqual(commit.reviewer(), reviewer)
+        self.assertEqual(commit.committer(), committer)
+        self.assertEqual(commit.committer_email(), "committer@example.com")
+        self.assertEqual(commit.responsible_parties(), set([author, committer, reviewer]))
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py
new file mode 100644
index 0000000..d8ebae6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py
@@ -0,0 +1,165 @@
+# Copyright (C) 2009 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.
+
+"""WebKit's Python module for interacting with patches."""
+
+import logging
+import re
+
+_log = logging.getLogger("webkitpy.common.checkout.diff_parser")
+
+_regexp_compile_cache = {}
+
+
+def match(pattern, string):
+    """Matches the string with the pattern, caching the compiled regexp."""
+    if not pattern in _regexp_compile_cache:
+        _regexp_compile_cache[pattern] = re.compile(pattern)
+    return _regexp_compile_cache[pattern].match(string)
+
+
+def git_diff_to_svn_diff(line):
+    """Converts a git formatted diff line to a svn formatted line.
+
+    Args:
+      line: A string representing a line of the diff.
+    """
+    conversion_patterns = (("^diff --git \w/(.+) \w/(?P<FilePath>.+)", lambda matched: "Index: " + matched.group('FilePath') + "\n"),
+                           ("^new file.*", lambda matched: "\n"),
+                           ("^index [0-9a-f]{7}\.\.[0-9a-f]{7} [0-9]{6}", lambda matched: "===================================================================\n"),
+                           ("^--- \w/(?P<FilePath>.+)", lambda matched: "--- " + matched.group('FilePath') + "\n"),
+                           ("^\+\+\+ \w/(?P<FilePath>.+)", lambda matched: "+++ " + matched.group('FilePath') + "\n"))
+
+    for pattern, conversion in conversion_patterns:
+        matched = match(pattern, line)
+        if matched:
+            return conversion(matched)
+    return line
+
+
+def get_diff_converter(first_diff_line):
+    """Gets a converter function of diff lines.
+
+    Args:
+      first_diff_line: The first filename line of a diff file.
+                       If this line is git formatted, we'll return a
+                       converter from git to SVN.
+    """
+    if match(r"^diff --git \w/", first_diff_line):
+        return git_diff_to_svn_diff
+    return lambda input: input
+
+
+_INITIAL_STATE = 1
+_DECLARED_FILE_PATH = 2
+_PROCESSING_CHUNK = 3
+
+
+class DiffFile:
+    """Contains the information for one file in a patch.
+
+    The field "lines" is a list which contains tuples in this format:
+       (deleted_line_number, new_line_number, line_string)
+    If deleted_line_number is zero, it means this line is newly added.
+    If new_line_number is zero, it means this line is deleted.
+    """
+
+    def __init__(self, filename):
+        self.filename = filename
+        self.lines = []
+
+    def add_new_line(self, line_number, line):
+        self.lines.append((0, line_number, line))
+
+    def add_deleted_line(self, line_number, line):
+        self.lines.append((line_number, 0, line))
+
+    def add_unchanged_line(self, deleted_line_number, new_line_number, line):
+        self.lines.append((deleted_line_number, new_line_number, line))
+
+
+class DiffParser:
+    """A parser for a patch file.
+
+    The field "files" is a dict whose key is the filename and value is
+    a DiffFile object.
+    """
+
+    def __init__(self, diff_input):
+        """Parses a diff.
+
+        Args:
+          diff_input: An iterable object.
+        """
+        state = _INITIAL_STATE
+
+        self.files = {}
+        current_file = None
+        old_diff_line = None
+        new_diff_line = None
+        for line in diff_input:
+            line = line.rstrip("\n")
+            if state == _INITIAL_STATE:
+                transform_line = get_diff_converter(line)
+            line = transform_line(line)
+
+            file_declaration = match(r"^Index: (?P<FilePath>.+)", line)
+            if file_declaration:
+                filename = file_declaration.group('FilePath')
+                current_file = DiffFile(filename)
+                self.files[filename] = current_file
+                state = _DECLARED_FILE_PATH
+                continue
+
+            lines_changed = match(r"^@@ -(?P<OldStartLine>\d+)(,\d+)? \+(?P<NewStartLine>\d+)(,\d+)? @@", line)
+            if lines_changed:
+                if state != _DECLARED_FILE_PATH and state != _PROCESSING_CHUNK:
+                    _log.error('Unexpected line change without file path '
+                               'declaration: %r' % line)
+                old_diff_line = int(lines_changed.group('OldStartLine'))
+                new_diff_line = int(lines_changed.group('NewStartLine'))
+                state = _PROCESSING_CHUNK
+                continue
+
+            if state == _PROCESSING_CHUNK:
+                if line.startswith('+'):
+                    current_file.add_new_line(new_diff_line, line[1:])
+                    new_diff_line += 1
+                elif line.startswith('-'):
+                    current_file.add_deleted_line(old_diff_line, line[1:])
+                    old_diff_line += 1
+                elif line.startswith(' '):
+                    current_file.add_unchanged_line(old_diff_line, new_diff_line, line[1:])
+                    old_diff_line += 1
+                    new_diff_line += 1
+                elif line == '\\ No newline at end of file':
+                    # Nothing to do.  We may still have some added lines.
+                    pass
+                else:
+                    _log.error('Unexpected diff format when parsing a '
+                               'chunk: %r' % line)
diff --git a/WebKitTools/Scripts/webkitpy/diff_parser_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
similarity index 100%
rename from WebKitTools/Scripts/webkitpy/diff_parser_unittest.py
rename to WebKitTools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
new file mode 100644
index 0000000..2704f07
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
@@ -0,0 +1,616 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+#
+# Python module for interacting with an SCM system (like SVN or Git)
+
+import os
+import re
+
+# FIXME: Instead of using run_command directly, most places in this
+# class would rather use an SCM.run method which automatically set
+# cwd=self.checkout_root.
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.user import User
+from webkitpy.common.system.deprecated_logging import error, log
+
+
+def detect_scm_system(path):
+    if SVN.in_working_directory(path):
+        return SVN(cwd=path)
+    
+    if Git.in_working_directory(path):
+        return Git(cwd=path)
+    
+    return None
+
+
+def first_non_empty_line_after_index(lines, index=0):
+    first_non_empty_line = index
+    for line in lines[index:]:
+        if re.match("^\s*$", line):
+            first_non_empty_line += 1
+        else:
+            break
+    return first_non_empty_line
+
+
+class CommitMessage:
+    def __init__(self, message):
+        self.message_lines = message[first_non_empty_line_after_index(message, 0):]
+
+    def body(self, lstrip=False):
+        lines = self.message_lines[first_non_empty_line_after_index(self.message_lines, 1):]
+        if lstrip:
+            lines = [line.lstrip() for line in lines]
+        return "\n".join(lines) + "\n"
+
+    def description(self, lstrip=False, strip_url=False):
+        line = self.message_lines[0]
+        if lstrip:
+            line = line.lstrip()
+        if strip_url:
+            line = re.sub("^(\s*)<.+> ", "\1", line)
+        return line
+
+    def message(self):
+        return "\n".join(self.message_lines) + "\n"
+
+
+class CheckoutNeedsUpdate(ScriptError):
+    def __init__(self, script_args, exit_code, output, cwd):
+        ScriptError.__init__(self, script_args=script_args, exit_code=exit_code, output=output, cwd=cwd)
+
+
+def commit_error_handler(error):
+    if re.search("resource out of date", error.output):
+        raise CheckoutNeedsUpdate(script_args=error.script_args, exit_code=error.exit_code, output=error.output, cwd=error.cwd)
+    Executive.default_error_handler(error)
+
+
+# SCM methods are expected to return paths relative to self.checkout_root.
+class SCM:
+    def __init__(self, cwd):
+        self.cwd = cwd
+        self.checkout_root = self.find_checkout_root(self.cwd)
+        self.dryrun = False
+
+    # SCM always returns repository relative path, but sometimes we need
+    # absolute paths to pass to rm, etc.
+    def absolute_path(self, repository_relative_path):
+        return os.path.join(self.checkout_root, repository_relative_path)
+
+    # FIXME: This belongs in Checkout, not SCM.
+    def scripts_directory(self):
+        return os.path.join(self.checkout_root, "WebKitTools", "Scripts")
+
+    # FIXME: This belongs in Checkout, not SCM.
+    def script_path(self, script_name):
+        return os.path.join(self.scripts_directory(), script_name)
+
+    def ensure_clean_working_directory(self, force_clean):
+        if not force_clean and not self.working_directory_is_clean():
+            # FIXME: Shouldn't this use cwd=self.checkout_root?
+            print run_command(self.status_command(), error_handler=Executive.ignore_error)
+            raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.")
+        
+        log("Cleaning working directory")
+        self.clean_working_directory()
+    
+    def ensure_no_local_commits(self, force):
+        if not self.supports_local_commits():
+            return
+        commits = self.local_commits()
+        if not len(commits):
+            return
+        if not force:
+            error("Working directory has local commits, pass --force-clean to continue.")
+        self.discard_local_commits()
+
+    def run_status_and_extract_filenames(self, status_command, status_regexp):
+        filenames = []
+        # We run with cwd=self.checkout_root so that returned-paths are root-relative.
+        for line in run_command(status_command, cwd=self.checkout_root).splitlines():
+            match = re.search(status_regexp, line)
+            if not match:
+                continue
+            # status = match.group('status')
+            filename = match.group('filename')
+            filenames.append(filename)
+        return filenames
+
+    def strip_r_from_svn_revision(self, svn_revision):
+        match = re.match("^r(?P<svn_revision>\d+)", svn_revision)
+        if (match):
+            return match.group('svn_revision')
+        return svn_revision
+
+    def svn_revision_from_commit_text(self, commit_text):
+        match = re.search(self.commit_success_regexp(), commit_text, re.MULTILINE)
+        return match.group('svn_revision')
+
+    @staticmethod
+    def in_working_directory(path):
+        raise NotImplementedError, "subclasses must implement"
+
+    @staticmethod
+    def find_checkout_root(path):
+        raise NotImplementedError, "subclasses must implement"
+
+    @staticmethod
+    def commit_success_regexp():
+        raise NotImplementedError, "subclasses must implement"
+
+    def working_directory_is_clean(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def clean_working_directory(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def status_command(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def add(self, path):
+        raise NotImplementedError, "subclasses must implement"
+
+    def changed_files(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def changed_files_for_revision(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def added_files(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def conflicted_files(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def display_name(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def create_patch(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def committer_email_for_revision(self, revision):
+        raise NotImplementedError, "subclasses must implement"
+
+    def contents_at_revision(self, path, revision):
+        raise NotImplementedError, "subclasses must implement"
+
+    def diff_for_revision(self, revision):
+        raise NotImplementedError, "subclasses must implement"
+
+    def apply_reverse_diff(self, revision):
+        raise NotImplementedError, "subclasses must implement"
+
+    def revert_files(self, file_paths):
+        raise NotImplementedError, "subclasses must implement"
+
+    def commit_with_message(self, message, username=None):
+        raise NotImplementedError, "subclasses must implement"
+
+    def svn_commit_log(self, svn_revision):
+        raise NotImplementedError, "subclasses must implement"
+
+    def last_svn_commit_log(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    # Subclasses must indicate if they support local commits,
+    # but the SCM baseclass will only call local_commits methods when this is true.
+    @staticmethod
+    def supports_local_commits():
+        raise NotImplementedError, "subclasses must implement"
+
+    def svn_merge_base():
+        raise NotImplementedError, "subclasses must implement"
+
+    def create_patch_from_local_commit(self, commit_id):
+        error("Your source control manager does not support creating a patch from a local commit.")
+
+    def create_patch_since_local_commit(self, commit_id):
+        error("Your source control manager does not support creating a patch from a local commit.")
+
+    def commit_locally_with_message(self, message):
+        error("Your source control manager does not support local commits.")
+
+    def discard_local_commits(self):
+        pass
+
+    def local_commits(self):
+        return []
+
+
+class SVN(SCM):
+    # FIXME: We should move these values to a WebKit-specific config. file.
+    svn_server_host = "svn.webkit.org"
+    svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge"
+
+    def __init__(self, cwd):
+        SCM.__init__(self, cwd)
+        self.cached_version = None
+    
+    @staticmethod
+    def in_working_directory(path):
+        return os.path.isdir(os.path.join(path, '.svn'))
+    
+    @classmethod
+    def find_uuid(cls, path):
+        if not cls.in_working_directory(path):
+            return None
+        return cls.value_from_svn_info(path, 'Repository UUID')
+
+    @classmethod
+    def value_from_svn_info(cls, path, field_name):
+        svn_info_args = ['svn', 'info', path]
+        info_output = run_command(svn_info_args).rstrip()
+        match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE)
+        if not match:
+            raise ScriptError(script_args=svn_info_args, message='svn info did not contain a %s.' % field_name)
+        return match.group('value')
+
+    @staticmethod
+    def find_checkout_root(path):
+        uuid = SVN.find_uuid(path)
+        # If |path| is not in a working directory, we're supposed to return |path|.
+        if not uuid:
+            return path
+        # Search up the directory hierarchy until we find a different UUID.
+        last_path = None
+        while True:
+            if uuid != SVN.find_uuid(path):
+                return last_path
+            last_path = path
+            (path, last_component) = os.path.split(path)
+            if last_path == path:
+                return None
+
+    @staticmethod
+    def commit_success_regexp():
+        return "^Committed revision (?P<svn_revision>\d+)\.$"
+
+    def has_authorization_for_realm(self, realm=svn_server_realm, home_directory=os.getenv("HOME")):
+        # Assumes find and grep are installed.
+        if not os.path.isdir(os.path.join(home_directory, ".subversion")):
+            return False
+        find_args = ["find", ".subversion", "-type", "f", "-exec", "grep", "-q", realm, "{}", ";", "-print"];
+        find_output = run_command(find_args, cwd=home_directory, error_handler=Executive.ignore_error).rstrip()
+        return find_output and os.path.isfile(os.path.join(home_directory, find_output))
+
+    def svn_version(self):
+        if not self.cached_version:
+            self.cached_version = run_command(['svn', '--version', '--quiet'])
+        
+        return self.cached_version
+
+    def working_directory_is_clean(self):
+        return run_command(["svn", "diff"], cwd=self.checkout_root) == ""
+
+    def clean_working_directory(self):
+        # svn revert -R is not as awesome as git reset --hard.
+        # It will leave added files around, causing later svn update
+        # calls to fail on the bots.  We make this mirror git reset --hard
+        # by deleting any added files as well.
+        added_files = reversed(sorted(self.added_files()))
+        # added_files() returns directories for SVN, we walk the files in reverse path
+        # length order so that we remove files before we try to remove the directories.
+        run_command(["svn", "revert", "-R", "."], cwd=self.checkout_root)
+        for path in added_files:
+            # This is robust against cwd != self.checkout_root
+            absolute_path = self.absolute_path(path)
+            # Completely lame that there is no easy way to remove both types with one call.
+            if os.path.isdir(path):
+                os.rmdir(absolute_path)
+            else:
+                os.remove(absolute_path)
+
+    def status_command(self):
+        return ['svn', 'status']
+
+    def _status_regexp(self, expected_types):
+        field_count = 6 if self.svn_version() > "1.6" else 5
+        return "^(?P<status>[%s]).{%s} (?P<filename>.+)$" % (expected_types, field_count)
+
+    def add(self, path):
+        # path is assumed to be cwd relative?
+        run_command(["svn", "add", path])
+
+    def changed_files(self):
+        return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("ACDMR"))
+
+    def changed_files_for_revision(self, revision):
+        # As far as I can tell svn diff --summarize output looks just like svn status output.
+        status_command = ["svn", "diff", "--summarize", "-c", str(revision)]
+        return self.run_status_and_extract_filenames(status_command, self._status_regexp("ACDMR"))
+
+    def conflicted_files(self):
+        return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("C"))
+
+    def added_files(self):
+        return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A"))
+
+    @staticmethod
+    def supports_local_commits():
+        return False
+
+    def display_name(self):
+        return "svn"
+
+    def create_patch(self):
+        return run_command(self.script_path("svn-create-patch"), cwd=self.checkout_root, return_stderr=False)
+
+    def committer_email_for_revision(self, revision):
+        return run_command(["svn", "propget", "svn:author", "--revprop", "-r", str(revision)]).rstrip()
+
+    def contents_at_revision(self, path, revision):
+        remote_path = "%s/%s" % (self._repository_url(), path)
+        return run_command(["svn", "cat", "-r", str(revision), remote_path])
+
+    def diff_for_revision(self, revision):
+        # FIXME: This should probably use cwd=self.checkout_root
+        return run_command(['svn', 'diff', '-c', str(revision)])
+
+    def _repository_url(self):
+        return self.value_from_svn_info(self.checkout_root, 'URL')
+
+    def apply_reverse_diff(self, revision):
+        # '-c -revision' applies the inverse diff of 'revision'
+        svn_merge_args = ['svn', 'merge', '--non-interactive', '-c', '-%s' % revision, self._repository_url()]
+        log("WARNING: svn merge has been known to take more than 10 minutes to complete.  It is recommended you use git for rollouts.")
+        log("Running '%s'" % " ".join(svn_merge_args))
+        # FIXME: Should this use cwd=self.checkout_root?
+        run_command(svn_merge_args)
+
+    def revert_files(self, file_paths):
+        # FIXME: This should probably use cwd=self.checkout_root.
+        run_command(['svn', 'revert'] + file_paths)
+
+    def commit_with_message(self, message, username=None):
+        if self.dryrun:
+            # Return a string which looks like a commit so that things which parse this output will succeed.
+            return "Dry run, no commit.\nCommitted revision 0."
+        svn_commit_args = ["svn", "commit"]
+        if not username and not self.has_authorization_for_realm():
+            username = User.prompt("%s login: " % self.svn_server_host, repeat=5)
+            if not username:
+                raise Exception("You need to specify the username on %s to perform the commit as." % self.svn_server_host)
+        if username:
+            svn_commit_args.extend(["--username", username])
+        svn_commit_args.extend(["-m", message])
+        # FIXME: Should this use cwd=self.checkout_root?
+        return run_command(svn_commit_args, error_handler=commit_error_handler)
+
+    def svn_commit_log(self, svn_revision):
+        svn_revision = self.strip_r_from_svn_revision(str(svn_revision))
+        return run_command(['svn', 'log', '--non-interactive', '--revision', svn_revision]);
+
+    def last_svn_commit_log(self):
+        # BASE is the checkout revision, HEAD is the remote repository revision
+        # http://svnbook.red-bean.com/en/1.0/ch03s03.html
+        return self.svn_commit_log('BASE')
+
+# All git-specific logic should go here.
+class Git(SCM):
+    def __init__(self, cwd):
+        SCM.__init__(self, cwd)
+
+    @classmethod
+    def in_working_directory(cls, path):
+        return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
+
+    @classmethod
+    def find_checkout_root(cls, path):
+        # "git rev-parse --show-cdup" would be another way to get to the root
+        (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=path))
+        # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path)
+        if not os.path.isabs(checkout_root): # Sometimes git returns relative paths
+            checkout_root = os.path.join(path, checkout_root)
+        return checkout_root
+
+    @classmethod
+    def read_git_config(cls, key):
+        # FIXME: This should probably use cwd=self.checkout_root.
+        return run_command(["git", "config", key],
+            error_handler=Executive.ignore_error).rstrip('\n')
+
+    @staticmethod
+    def commit_success_regexp():
+        return "^Committed r(?P<svn_revision>\d+)$"
+
+    def discard_local_commits(self):
+        # FIXME: This should probably use cwd=self.checkout_root
+        run_command(['git', 'reset', '--hard', self.svn_branch_name()])
+    
+    def local_commits(self):
+        # FIXME: This should probably use cwd=self.checkout_root
+        return run_command(['git', 'log', '--pretty=oneline', 'HEAD...' + self.svn_branch_name()]).splitlines()
+
+    def rebase_in_progress(self):
+        return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))
+
+    def working_directory_is_clean(self):
+        # FIXME: This should probably use cwd=self.checkout_root
+        return run_command(['git', 'diff', 'HEAD', '--name-only']) == ""
+
+    def clean_working_directory(self):
+        # FIXME: These should probably use cwd=self.checkout_root.
+        # Could run git clean here too, but that wouldn't match working_directory_is_clean
+        run_command(['git', 'reset', '--hard', 'HEAD'])
+        # Aborting rebase even though this does not match working_directory_is_clean
+        if self.rebase_in_progress():
+            run_command(['git', 'rebase', '--abort'])
+
+    def status_command(self):
+        # git status returns non-zero when there are changes, so we use git diff name --name-status HEAD instead.
+        return ["git", "diff", "--name-status", "HEAD"]
+
+    def _status_regexp(self, expected_types):
+        return '^(?P<status>[%s])\t(?P<filename>.+)$' % expected_types
+
+    def add(self, path):
+        # path is assumed to be cwd relative?
+        run_command(["git", "add", path])
+
+    def changed_files(self):
+        status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', 'HEAD']
+        return self.run_status_and_extract_filenames(status_command, self._status_regexp("ADM"))
+
+    def _changes_files_for_commit(self, git_commit):
+        # --pretty="format:" makes git show not print the commit log header,
+        changed_files = run_command(["git", "show", "--pretty=format:", "--name-only", git_commit]).splitlines()
+        # instead it just prints a blank line at the top, so we skip the blank line:
+        return changed_files[1:]
+
+    def changed_files_for_revision(self, revision):
+        commit_id = self.git_commit_from_svn_revision(revision)
+        return self._changes_files_for_commit(commit_id)
+
+    def conflicted_files(self):
+        status_command = ['git', 'diff', '--name-status', '-C', '-M', '--diff-filter=U']
+        return self.run_status_and_extract_filenames(status_command, self._status_regexp("U"))
+
+    def added_files(self):
+        return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A"))
+
+    @staticmethod
+    def supports_local_commits():
+        return True
+
+    def display_name(self):
+        return "git"
+
+    def create_patch(self):
+        # FIXME: This should probably use cwd=self.checkout_root
+        return run_command(['git', 'diff', '--binary', 'HEAD'])
+
+    @classmethod
+    def git_commit_from_svn_revision(cls, revision):
+        # FIXME: This should probably use cwd=self.checkout_root
+        git_commit = run_command(['git', 'svn', 'find-rev', 'r%s' % revision]).rstrip()
+        # git svn find-rev always exits 0, even when the revision is not found.
+        if not git_commit:
+            raise ScriptError(message='Failed to find git commit for revision %s, your checkout likely needs an update.' % revision)
+        return git_commit
+
+    def contents_at_revision(self, path, revision):
+        return run_command(["git", "show", "%s:%s" % (self.git_commit_from_svn_revision(revision), path)])
+
+    def diff_for_revision(self, revision):
+        git_commit = self.git_commit_from_svn_revision(revision)
+        return self.create_patch_from_local_commit(git_commit)
+
+    def committer_email_for_revision(self, revision):
+        git_commit = self.git_commit_from_svn_revision(revision)
+        committer_email = run_command(["git", "log", "-1", "--pretty=format:%ce", git_commit])
+        # Git adds an extra @repository_hash to the end of every committer email, remove it:
+        return committer_email.rsplit("@", 1)[0]
+
+    def apply_reverse_diff(self, revision):
+        # Assume the revision is an svn revision.
+        git_commit = self.git_commit_from_svn_revision(revision)
+        # I think this will always fail due to ChangeLogs.
+        run_command(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
+
+    def revert_files(self, file_paths):
+        run_command(['git', 'checkout', 'HEAD'] + file_paths)
+
+    def commit_with_message(self, message, username=None):
+        # Username is ignored during Git commits.
+        self.commit_locally_with_message(message)
+        return self.push_local_commits_to_server()
+
+    def svn_commit_log(self, svn_revision):
+        svn_revision = self.strip_r_from_svn_revision(svn_revision)
+        return run_command(['git', 'svn', 'log', '-r', svn_revision])
+
+    def last_svn_commit_log(self):
+        return run_command(['git', 'svn', 'log', '--limit=1'])
+
+    # Git-specific methods:
+
+    def delete_branch(self, branch):
+        if run_command(['git', 'show-ref', '--quiet', '--verify', 'refs/heads/' + branch], return_exit_code=True) == 0:
+            run_command(['git', 'branch', '-D', branch])
+
+    def svn_merge_base(self):
+        return run_command(['git', 'merge-base', self.svn_branch_name(), 'HEAD']).strip()
+
+    def svn_branch_name(self):
+        return Git.read_git_config('svn-remote.svn.fetch').split(':')[1]
+
+    def create_patch_from_local_commit(self, commit_id):
+        return run_command(['git', 'diff', '--binary', commit_id + "^.." + commit_id])
+
+    def create_patch_since_local_commit(self, commit_id):
+        return run_command(['git', 'diff', '--binary', commit_id])
+
+    def commit_locally_with_message(self, message):
+        run_command(['git', 'commit', '--all', '-F', '-'], input=message)
+
+    def push_local_commits_to_server(self):
+        dcommit_command = ['git', 'svn', 'dcommit']
+        if self.dryrun:
+            dcommit_command.append('--dry-run')
+        output = run_command(dcommit_command, error_handler=commit_error_handler)
+        # Return a string which looks like a commit so that things which parse this output will succeed.
+        if self.dryrun:
+            output += "\nCommitted r0"
+        return output
+
+    # This function supports the following argument formats:
+    # no args : rev-list trunk..HEAD
+    # A..B    : rev-list A..B
+    # A...B   : error!
+    # A B     : [A, B]  (different from git diff, which would use "rev-list A..B")
+    def commit_ids_from_commitish_arguments(self, args):
+        if not len(args):
+            args.append('%s..HEAD' % self.svn_branch_name())
+
+        commit_ids = []
+        for commitish in args:
+            if '...' in commitish:
+                raise ScriptError(message="'...' is not supported (found in '%s'). Did you mean '..'?" % commitish)
+            elif '..' in commitish:
+                commit_ids += reversed(run_command(['git', 'rev-list', commitish]).splitlines())
+            else:
+                # Turn single commits or branch or tag names into commit ids.
+                commit_ids += run_command(['git', 'rev-parse', '--revs-only', commitish]).splitlines()
+        return commit_ids
+
+    def commit_message_for_local_commit(self, commit_id):
+        commit_lines = run_command(['git', 'cat-file', 'commit', commit_id]).splitlines()
+
+        # Skip the git headers.
+        first_line_after_headers = 0
+        for line in commit_lines:
+            first_line_after_headers += 1
+            if line == "":
+                break
+        return CommitMessage(commit_lines[first_line_after_headers:])
+
+    def files_changed_summary_for_commit(self, commit_id):
+        return run_command(['git', 'diff-tree', '--shortstat', '--no-commit-id', commit_id])
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
new file mode 100644
index 0000000..c0a64d4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
@@ -0,0 +1,783 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2009 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:
+#
+#    * 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.
+
+import base64
+import getpass
+import os
+import os.path
+import re
+import stat
+import subprocess
+import tempfile
+import unittest
+import urllib
+
+from datetime import date
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.scm import detect_scm_system, SCM, SVN, CheckoutNeedsUpdate, commit_error_handler
+from webkitpy.common.config.committers import Committer  # FIXME: This should not be needed
+from webkitpy.common.net.bugzilla import Attachment # FIXME: This should not be needed
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+
+# Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
+# Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
+
+# FIXME: This should be unified into one of the executive.py commands!
+def run_silent(args, cwd=None):
+    process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
+    process.communicate() # ignore output
+    exit_code = process.wait()
+    if exit_code:
+        raise ScriptError('Failed to run "%s"  exit_code: %d  cwd: %s' % (args, exit_code, cwd))
+
+def write_into_file_at_path(file_path, contents):
+    file = open(file_path, 'w')
+    file.write(contents)
+    file.close()
+
+def read_from_path(file_path):
+    file = open(file_path, 'r')
+    contents = file.read()
+    file.close()
+    return contents
+
+# Exists to share svn repository creation code between the git and svn tests
+class SVNTestRepository:
+    @classmethod
+    def _svn_add(cls, path):
+        run_command(["svn", "add", path])
+
+    @classmethod
+    def _svn_commit(cls, message):
+        run_command(["svn", "commit", "--quiet", "--message", message])
+
+    @classmethod
+    def _setup_test_commits(cls, test_object):
+        # Add some test commits
+        os.chdir(test_object.svn_checkout_path)
+
+        write_into_file_at_path("test_file", "test1")
+        cls._svn_add("test_file")
+        cls._svn_commit("initial commit")
+
+        write_into_file_at_path("test_file", "test1test2")
+        # This used to be the last commit, but doing so broke
+        # GitTest.test_apply_git_patch which use the inverse diff of the last commit.
+        # svn-apply fails to remove directories in Git, see:
+        # https://bugs.webkit.org/show_bug.cgi?id=34871
+        os.mkdir("test_dir")
+        # Slash should always be the right path separator since we use cygwin on Windows.
+        test_file3_path = "test_dir/test_file3"
+        write_into_file_at_path(test_file3_path, "third file")
+        cls._svn_add("test_dir")
+        cls._svn_commit("second commit")
+
+        write_into_file_at_path("test_file", "test1test2test3\n")
+        write_into_file_at_path("test_file2", "second file")
+        cls._svn_add("test_file2")
+        cls._svn_commit("third commit")
+
+        write_into_file_at_path("test_file", "test1test2test3\ntest4\n")
+        cls._svn_commit("fourth commit")
+
+        # svn does not seem to update after commit as I would expect.
+        run_command(['svn', 'update'])
+
+    @classmethod
+    def setup(cls, test_object):
+        # Create an test SVN repository
+        test_object.svn_repo_path = tempfile.mkdtemp(suffix="svn_test_repo")
+        test_object.svn_repo_url = "file://%s" % test_object.svn_repo_path # Not sure this will work on windows
+        # git svn complains if we don't pass --pre-1.5-compatible, not sure why:
+        # Expected FS format '2'; found format '3' at /usr/local/libexec/git-core//git-svn line 1477
+        run_command(['svnadmin', 'create', '--pre-1.5-compatible', test_object.svn_repo_path])
+
+        # Create a test svn checkout
+        test_object.svn_checkout_path = tempfile.mkdtemp(suffix="svn_test_checkout")
+        run_command(['svn', 'checkout', '--quiet', test_object.svn_repo_url, test_object.svn_checkout_path])
+
+        cls._setup_test_commits(test_object)
+
+    @classmethod
+    def tear_down(cls, test_object):
+        run_command(['rm', '-rf', test_object.svn_repo_path])
+        run_command(['rm', '-rf', test_object.svn_checkout_path])
+
+        # Now that we've deleted the checkout paths, cwddir may be invalid
+        # Change back to a valid directory so that later calls to os.getcwd() do not fail.
+        os.chdir(detect_scm_system(os.path.dirname(__file__)).checkout_root)
+
+# For testing the SCM baseclass directly.
+class SCMClassTests(unittest.TestCase):
+    def setUp(self):
+        self.dev_null = open(os.devnull, "w") # Used to make our Popen calls quiet.
+
+    def tearDown(self):
+        self.dev_null.close()
+
+    def test_run_command_with_pipe(self):
+        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null)
+        self.assertEqual(run_command(['grep', 'bar'], input=input_process.stdout), "bar\n")
+
+        # Test the non-pipe case too:
+        self.assertEqual(run_command(['grep', 'bar'], input="foo\nbar"), "bar\n")
+
+        command_returns_non_zero = ['/bin/sh', '--invalid-option']
+        # Test when the input pipe process fails.
+        input_process = subprocess.Popen(command_returns_non_zero, stdout=subprocess.PIPE, stderr=self.dev_null)
+        self.assertTrue(input_process.poll() != 0)
+        self.assertRaises(ScriptError, run_command, ['grep', 'bar'], input=input_process.stdout)
+
+        # Test when the run_command process fails.
+        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null) # grep shows usage and calls exit(2) when called w/o arguments.
+        self.assertRaises(ScriptError, run_command, command_returns_non_zero, input=input_process.stdout)
+
+    def test_error_handlers(self):
+        git_failure_message="Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
+        svn_failure_message="""svn: Commit failed (details follow):
+svn: File or directory 'ChangeLog' is out of date; try updating
+svn: resource out of date; try updating
+"""
+        command_does_not_exist = ['does_not_exist', 'invalid_option']
+        self.assertRaises(OSError, run_command, command_does_not_exist)
+        self.assertRaises(OSError, run_command, command_does_not_exist, error_handler=Executive.ignore_error)
+
+        command_returns_non_zero = ['/bin/sh', '--invalid-option']
+        self.assertRaises(ScriptError, run_command, command_returns_non_zero)
+        # Check if returns error text:
+        self.assertTrue(run_command(command_returns_non_zero, error_handler=Executive.ignore_error))
+
+        self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=git_failure_message))
+        self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=svn_failure_message))
+        self.assertRaises(ScriptError, commit_error_handler, ScriptError(output='blah blah blah'))
+
+
+# GitTest and SVNTest inherit from this so any test_ methods here will be run once for this class and then once for each subclass.
+class SCMTest(unittest.TestCase):
+    def _create_patch(self, patch_contents):
+        patch_path = os.path.join(self.svn_checkout_path, 'patch.diff')
+        write_into_file_at_path(patch_path, patch_contents)
+        patch = {}
+        patch['bug_id'] = '12345'
+        patch['url'] = 'file://%s' % urllib.pathname2url(patch_path)
+
+        attachment = Attachment(patch, None) # FIXME: This is a hack, scm.py shouldn't be fetching attachment data.
+        joe_cool = Committer(name="Joe Cool", email_or_emails=None)
+        attachment._reviewer = joe_cool
+
+        return attachment
+
+    def _setup_webkittools_scripts_symlink(self, local_scm):
+        webkit_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
+        webkit_scripts_directory = webkit_scm.scripts_directory()
+        local_scripts_directory = local_scm.scripts_directory()
+        os.mkdir(os.path.dirname(local_scripts_directory))
+        os.symlink(webkit_scripts_directory, local_scripts_directory)
+
+    # Tests which both GitTest and SVNTest should run.
+    # FIXME: There must be a simpler way to add these w/o adding a wrapper method to both subclasses
+    def _shared_test_commit_with_message(self, username="dbates@webkit.org"):
+        write_into_file_at_path('test_file', 'more test content')
+        commit_text = self.scm.commit_with_message("another test commit", username)
+        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '5')
+
+        self.scm.dryrun = True
+        write_into_file_at_path('test_file', 'still more test content')
+        commit_text = self.scm.commit_with_message("yet another test commit", username)
+        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
+
+    def _shared_test_changed_files(self):
+        write_into_file_at_path("test_file", "changed content")
+        self.assertEqual(self.scm.changed_files(), ["test_file"])
+        write_into_file_at_path("test_dir/test_file3", "new stuff")
+        self.assertEqual(self.scm.changed_files(), ["test_dir/test_file3", "test_file"])
+        old_cwd = os.getcwd()
+        os.chdir("test_dir")
+        # Validate that changed_files does not change with our cwd, see bug 37015.
+        self.assertEqual(self.scm.changed_files(), ["test_dir/test_file3", "test_file"])
+        os.chdir(old_cwd)
+
+    def _shared_test_added_files(self):
+        write_into_file_at_path("test_file", "changed content")
+        self.assertEqual(self.scm.added_files(), [])
+
+        write_into_file_at_path("added_file", "new stuff")
+        self.scm.add("added_file")
+
+        os.mkdir("added_dir")
+        write_into_file_at_path("added_dir/added_file2", "new stuff")
+        self.scm.add("added_dir")
+
+        # SVN reports directory changes, Git does not.
+        added_files = self.scm.added_files()
+        if "added_dir" in added_files:
+            added_files.remove("added_dir")
+        self.assertEqual(added_files, ["added_dir/added_file2", "added_file"])
+
+        # Test also to make sure clean_working_directory removes added files
+        self.scm.clean_working_directory()
+        self.assertEqual(self.scm.added_files(), [])
+        self.assertFalse(os.path.exists("added_file"))
+        self.assertFalse(os.path.exists("added_dir"))
+
+    def _shared_test_changed_files_for_revision(self):
+        # SVN reports directory changes, Git does not.
+        changed_files = self.scm.changed_files_for_revision(2)
+        if "test_dir" in changed_files:
+            changed_files.remove("test_dir")
+        self.assertEqual(changed_files, ["test_dir/test_file3", "test_file"])
+        self.assertEqual(sorted(self.scm.changed_files_for_revision(3)), sorted(["test_file", "test_file2"])) # Git and SVN return different orders.
+        self.assertEqual(self.scm.changed_files_for_revision(4), ["test_file"])
+
+    def _shared_test_contents_at_revision(self):
+        self.assertEqual(self.scm.contents_at_revision("test_file", 2), "test1test2")
+        self.assertEqual(self.scm.contents_at_revision("test_file", 3), "test1test2test3\n")
+        self.assertEqual(self.scm.contents_at_revision("test_file", 4), "test1test2test3\ntest4\n")
+
+        self.assertEqual(self.scm.contents_at_revision("test_file2", 3), "second file")
+        # Files which don't exist:
+        # Currently we raise instead of returning None because detecting the difference between
+        # "file not found" and any other error seems impossible with svn (git seems to expose such through the return code).
+        self.assertRaises(ScriptError, self.scm.contents_at_revision, "test_file2", 2)
+        self.assertRaises(ScriptError, self.scm.contents_at_revision, "does_not_exist", 2)
+
+    def _shared_test_committer_email_for_revision(self):
+        self.assertEqual(self.scm.committer_email_for_revision(2), getpass.getuser()) # Committer "email" will be the current user
+
+    def _shared_test_reverse_diff(self):
+        self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs
+        # Only test the simple case, as any other will end up with conflict markers.
+        self.scm.apply_reverse_diff('4')
+        self.assertEqual(read_from_path('test_file'), "test1test2test3\n")
+
+    def _shared_test_diff_for_revision(self):
+        # Patch formats are slightly different between svn and git, so just regexp for things we know should be there.
+        r3_patch = self.scm.diff_for_revision(3)
+        self.assertTrue(re.search('test3', r3_patch))
+        self.assertFalse(re.search('test4', r3_patch))
+        self.assertTrue(re.search('test2', r3_patch))
+        self.assertTrue(re.search('test2', self.scm.diff_for_revision(2)))
+
+    def _shared_test_svn_apply_git_patch(self):
+        self._setup_webkittools_scripts_symlink(self.scm)
+        git_binary_addition = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+new file mode 100644
+index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d90
+60151690
+GIT binary patch
+literal 512
+zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
+zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
+zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
+zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
+zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
+zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
+zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
+z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
+z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
+ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
+
+literal 0
+HcmV?d00001
+
+"""
+        self.checkout.apply_patch(self._create_patch(git_binary_addition))
+        added = read_from_path('fizzbuzz7.gif')
+        self.assertEqual(512, len(added))
+        self.assertTrue(added.startswith('GIF89a'))
+        self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
+
+        # The file already exists.
+        self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_addition))
+
+        git_binary_modification = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+index 64a9532e7794fcd791f6f12157406d9060151690..323fae03f4606ea9991df8befbb2fca7
+GIT binary patch
+literal 7
+OcmYex&reD$;sO8*F9L)B
+
+literal 512
+zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
+zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
+zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
+zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
+zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
+zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
+zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
+z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
+z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
+ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
+
+"""
+        self.checkout.apply_patch(self._create_patch(git_binary_modification))
+        modified = read_from_path('fizzbuzz7.gif')
+        self.assertEqual('foobar\n', modified)
+        self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
+
+        # Applying the same modification should fail.
+        self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_modification))
+
+        git_binary_deletion = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+deleted file mode 100644
+index 323fae0..0000000
+GIT binary patch
+literal 0
+HcmV?d00001
+
+literal 7
+OcmYex&reD$;sO8*F9L)B
+
+"""
+        self.checkout.apply_patch(self._create_patch(git_binary_deletion))
+        self.assertFalse(os.path.exists('fizzbuzz7.gif'))
+        self.assertFalse('fizzbuzz7.gif' in self.scm.changed_files())
+
+        # Cannot delete again.
+        self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_deletion))
+
+
+class SVNTest(SCMTest):
+
+    @staticmethod
+    def _set_date_and_reviewer(changelog_entry):
+        # Joe Cool matches the reviewer set in SCMTest._create_patch
+        changelog_entry = changelog_entry.replace('REVIEWER_HERE', 'Joe Cool')
+        # svn-apply will update ChangeLog entries with today's date.
+        return changelog_entry.replace('DATE_HERE', date.today().isoformat())
+
+    def test_svn_apply(self):
+        first_entry = """2009-10-26  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Foo Bar.
+
+        Most awesome change ever.
+
+        * scm_unittest.py:
+"""
+        intermediate_entry = """2009-10-27  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Baz Bar.
+
+        A more awesomer change yet!
+
+        * scm_unittest.py:
+"""
+        one_line_overlap_patch = """Index: ChangeLog
+===================================================================
+--- ChangeLog	(revision 5)
++++ ChangeLog	(working copy)
+@@ -1,5 +1,13 @@
+ 2009-10-26  Eric Seidel  <eric@webkit.org>
+ 
++        Reviewed by NOBODY (OOPS!).
++
++        Second most awesome change ever.
++
++        * scm_unittest.py:
++
++2009-10-26  Eric Seidel  <eric@webkit.org>
++
+         Reviewed by Foo Bar.
+ 
+         Most awesome change ever.
+"""
+        one_line_overlap_entry = """DATE_HERE  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by REVIEWER_HERE.
+
+        Second most awesome change ever.
+
+        * scm_unittest.py:
+"""
+        two_line_overlap_patch = """Index: ChangeLog
+===================================================================
+--- ChangeLog	(revision 5)
++++ ChangeLog	(working copy)
+@@ -2,6 +2,14 @@
+ 
+         Reviewed by Foo Bar.
+ 
++        Second most awesome change ever.
++
++        * scm_unittest.py:
++
++2009-10-26  Eric Seidel  <eric@webkit.org>
++
++        Reviewed by Foo Bar.
++
+         Most awesome change ever.
+ 
+         * scm_unittest.py:
+"""
+        two_line_overlap_entry = """DATE_HERE  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Foo Bar.
+
+        Second most awesome change ever.
+
+        * scm_unittest.py:
+"""
+        write_into_file_at_path('ChangeLog', first_entry)
+        run_command(['svn', 'add', 'ChangeLog'])
+        run_command(['svn', 'commit', '--quiet', '--message', 'ChangeLog commit'])
+
+        # Patch files were created against just 'first_entry'.
+        # Add a second commit to make svn-apply have to apply the patches with fuzz.
+        changelog_contents = "%s\n%s" % (intermediate_entry, first_entry)
+        write_into_file_at_path('ChangeLog', changelog_contents)
+        run_command(['svn', 'commit', '--quiet', '--message', 'Intermediate commit'])
+
+        self._setup_webkittools_scripts_symlink(self.scm)
+        self.checkout.apply_patch(self._create_patch(one_line_overlap_patch))
+        expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(one_line_overlap_entry), changelog_contents)
+        self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
+
+        self.scm.revert_files(['ChangeLog'])
+        self.checkout.apply_patch(self._create_patch(two_line_overlap_patch))
+        expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(two_line_overlap_entry), changelog_contents)
+        self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
+
+    def setUp(self):
+        SVNTestRepository.setup(self)
+        os.chdir(self.svn_checkout_path)
+        self.scm = detect_scm_system(self.svn_checkout_path)
+        # For historical reasons, we test some checkout code here too.
+        self.checkout = Checkout(self.scm)
+
+    def tearDown(self):
+        SVNTestRepository.tear_down(self)
+
+    def test_create_patch_is_full_patch(self):
+        test_dir_path = os.path.join(self.svn_checkout_path, "test_dir2")
+        os.mkdir(test_dir_path)
+        test_file_path = os.path.join(test_dir_path, 'test_file2')
+        write_into_file_at_path(test_file_path, 'test content')
+        run_command(['svn', 'add', 'test_dir2'])
+
+        # create_patch depends on 'svn-create-patch', so make a dummy version.
+        scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
+        os.makedirs(scripts_path)
+        create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
+        write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
+        os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
+
+        # Change into our test directory and run the create_patch command.
+        os.chdir(test_dir_path)
+        scm = detect_scm_system(test_dir_path)
+        self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
+        patch_contents = scm.create_patch()
+        # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
+        self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
+
+    def test_detection(self):
+        scm = detect_scm_system(self.svn_checkout_path)
+        self.assertEqual(scm.display_name(), "svn")
+        self.assertEqual(scm.supports_local_commits(), False)
+
+    def test_apply_small_binary_patch(self):
+        patch_contents = """Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+   + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+"""
+        expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==")
+        self._setup_webkittools_scripts_symlink(self.scm)
+        patch_file = self._create_patch(patch_contents)
+        self.checkout.apply_patch(patch_file)
+        actual_contents = read_from_path("test_file.swf")
+        self.assertEqual(actual_contents, expected_contents)
+
+    def test_apply_svn_patch(self):
+        scm = detect_scm_system(self.svn_checkout_path)
+        patch = self._create_patch(run_command(['svn', 'diff', '-r4:3']))
+        self._setup_webkittools_scripts_symlink(scm)
+        Checkout(scm).apply_patch(patch)
+
+    def test_apply_svn_patch_force(self):
+        scm = detect_scm_system(self.svn_checkout_path)
+        patch = self._create_patch(run_command(['svn', 'diff', '-r2:4']))
+        self._setup_webkittools_scripts_symlink(scm)
+        self.assertRaises(ScriptError, Checkout(scm).apply_patch, patch, force=True)
+
+    def test_commit_logs(self):
+        # Commits have dates and usernames in them, so we can't just direct compare.
+        self.assertTrue(re.search('fourth commit', self.scm.last_svn_commit_log()))
+        self.assertTrue(re.search('second commit', self.scm.svn_commit_log(2)))
+
+    def test_commit_text_parsing(self):
+        self._shared_test_commit_with_message()
+
+    def test_commit_with_username(self):
+        self._shared_test_commit_with_message("dbates@webkit.org")
+
+    def test_has_authorization_for_realm(self):
+        scm = detect_scm_system(self.svn_checkout_path)
+        fake_home_dir = tempfile.mkdtemp(suffix="fake_home_dir")
+        svn_config_dir_path = os.path.join(fake_home_dir, ".subversion")
+        os.mkdir(svn_config_dir_path)
+        fake_webkit_auth_file = os.path.join(svn_config_dir_path, "fake_webkit_auth_file")
+        write_into_file_at_path(fake_webkit_auth_file, SVN.svn_server_realm)
+        self.assertTrue(scm.has_authorization_for_realm(home_directory=fake_home_dir))
+        os.remove(fake_webkit_auth_file)
+        os.rmdir(svn_config_dir_path)
+        os.rmdir(fake_home_dir)
+
+    def test_not_have_authorization_for_realm(self):
+        scm = detect_scm_system(self.svn_checkout_path)
+        fake_home_dir = tempfile.mkdtemp(suffix="fake_home_dir")
+        svn_config_dir_path = os.path.join(fake_home_dir, ".subversion")
+        os.mkdir(svn_config_dir_path)
+        self.assertFalse(scm.has_authorization_for_realm(home_directory=fake_home_dir))
+        os.rmdir(svn_config_dir_path)
+        os.rmdir(fake_home_dir)
+
+    def test_reverse_diff(self):
+        self._shared_test_reverse_diff()
+
+    def test_diff_for_revision(self):
+        self._shared_test_diff_for_revision()
+
+    def test_svn_apply_git_patch(self):
+        self._shared_test_svn_apply_git_patch()
+
+    def test_changed_files(self):
+        self._shared_test_changed_files()
+
+    def test_changed_files_for_revision(self):
+        self._shared_test_changed_files_for_revision()
+
+    def test_added_files(self):
+        self._shared_test_added_files()
+
+    def test_contents_at_revision(self):
+        self._shared_test_contents_at_revision()
+
+    def test_committer_email_for_revision(self):
+        self._shared_test_committer_email_for_revision()
+
+
+class GitTest(SCMTest):
+
+    def _setup_git_clone_of_svn_repository(self):
+        self.git_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout")
+        # --quiet doesn't make git svn silent, so we use run_silent to redirect output
+        run_silent(['git', 'svn', '--quiet', 'clone', self.svn_repo_url, self.git_checkout_path])
+
+    def _tear_down_git_clone_of_svn_repository(self):
+        run_command(['rm', '-rf', self.git_checkout_path])
+
+    def setUp(self):
+        SVNTestRepository.setup(self)
+        self._setup_git_clone_of_svn_repository()
+        os.chdir(self.git_checkout_path)
+        self.scm = detect_scm_system(self.git_checkout_path)
+        # For historical reasons, we test some checkout code here too.
+        self.checkout = Checkout(self.scm)
+
+    def tearDown(self):
+        SVNTestRepository.tear_down(self)
+        self._tear_down_git_clone_of_svn_repository()
+
+    def test_detection(self):
+        scm = detect_scm_system(self.git_checkout_path)
+        self.assertEqual(scm.display_name(), "git")
+        self.assertEqual(scm.supports_local_commits(), True)
+
+    def test_read_git_config(self):
+        key = 'test.git-config'
+        value = 'git-config value'
+        run_command(['git', 'config', key, value])
+        self.assertEqual(self.scm.read_git_config(key), value)
+
+    def test_local_commits(self):
+        test_file = os.path.join(self.git_checkout_path, 'test_file')
+        write_into_file_at_path(test_file, 'foo')
+        run_command(['git', 'commit', '-a', '-m', 'local commit'])
+
+        self.assertEqual(len(self.scm.local_commits()), 1)
+
+    def test_discard_local_commits(self):
+        test_file = os.path.join(self.git_checkout_path, 'test_file')
+        write_into_file_at_path(test_file, 'foo')
+        run_command(['git', 'commit', '-a', '-m', 'local commit'])
+
+        self.assertEqual(len(self.scm.local_commits()), 1)
+        self.scm.discard_local_commits()
+        self.assertEqual(len(self.scm.local_commits()), 0)
+
+    def test_delete_branch(self):
+        old_branch = run_command(['git', 'symbolic-ref', 'HEAD']).strip()
+        new_branch = 'foo'
+
+        run_command(['git', 'checkout', '-b', new_branch])
+        self.assertEqual(run_command(['git', 'symbolic-ref', 'HEAD']).strip(), 'refs/heads/' + new_branch)
+
+        run_command(['git', 'checkout', old_branch])
+        self.scm.delete_branch(new_branch)
+
+        self.assertFalse(re.search(r'foo', run_command(['git', 'branch'])))
+
+    def test_svn_merge_base(self):
+        # Diff to merge-base should include working-copy changes,
+        # which the diff to svn_branch.. doesn't.
+        test_file = os.path.join(self.git_checkout_path, 'test_file')
+        write_into_file_at_path(test_file, 'foo')
+
+        diff_to_common_base = run_command(['git', 'diff', self.scm.svn_branch_name() + '..'])
+        diff_to_merge_base = run_command(['git', 'diff', self.scm.svn_merge_base()])
+
+        self.assertFalse(re.search(r'foo', diff_to_common_base))
+        self.assertTrue(re.search(r'foo', diff_to_merge_base))
+
+    def test_rebase_in_progress(self):
+        svn_test_file = os.path.join(self.svn_checkout_path, 'test_file')
+        write_into_file_at_path(svn_test_file, "svn_checkout")
+        run_command(['svn', 'commit', '--message', 'commit to conflict with git commit'], cwd=self.svn_checkout_path)
+
+        git_test_file = os.path.join(self.git_checkout_path, 'test_file')
+        write_into_file_at_path(git_test_file, "git_checkout")
+        run_command(['git', 'commit', '-a', '-m', 'commit to be thrown away by rebase abort'])
+
+        # --quiet doesn't make git svn silent, so use run_silent to redirect output
+        self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase']) # Will fail due to a conflict leaving us mid-rebase.
+
+        scm = detect_scm_system(self.git_checkout_path)
+        self.assertTrue(scm.rebase_in_progress())
+
+        # Make sure our cleanup works.
+        scm.clean_working_directory()
+        self.assertFalse(scm.rebase_in_progress())
+
+        # Make sure cleanup doesn't throw when no rebase is in progress.
+        scm.clean_working_directory()
+
+    def test_commitish_parsing(self):
+        scm = detect_scm_system(self.git_checkout_path)
+    
+        # Multiple revisions are cherry-picked.
+        self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD~2'])), 1)
+        self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD', 'HEAD~2'])), 2)
+    
+        # ... is an invalid range specifier
+        self.assertRaises(ScriptError, scm.commit_ids_from_commitish_arguments, ['trunk...HEAD'])
+
+    def test_commitish_order(self):
+        scm = detect_scm_system(self.git_checkout_path)
+
+        commit_range = 'HEAD~3..HEAD'
+
+        actual_commits = scm.commit_ids_from_commitish_arguments([commit_range])
+        expected_commits = []
+        expected_commits += reversed(run_command(['git', 'rev-list', commit_range]).splitlines())
+
+        self.assertEqual(actual_commits, expected_commits)
+
+    def test_apply_git_patch(self):
+        scm = detect_scm_system(self.git_checkout_path)
+        # We carefullly pick a diff which does not have a directory addition
+        # as currently svn-apply will error out when trying to remove directories
+        # in Git: https://bugs.webkit.org/show_bug.cgi?id=34871
+        patch = self._create_patch(run_command(['git', 'diff', 'HEAD..HEAD^']))
+        self._setup_webkittools_scripts_symlink(scm)
+        Checkout(scm).apply_patch(patch)
+
+    def test_apply_git_patch_force(self):
+        scm = detect_scm_system(self.git_checkout_path)
+        patch = self._create_patch(run_command(['git', 'diff', 'HEAD~2..HEAD']))
+        self._setup_webkittools_scripts_symlink(scm)
+        self.assertRaises(ScriptError, Checkout(scm).apply_patch, patch, force=True)
+
+    def test_commit_text_parsing(self):
+        self._shared_test_commit_with_message()
+
+    def test_reverse_diff(self):
+        self._shared_test_reverse_diff()
+
+    def test_diff_for_revision(self):
+        self._shared_test_diff_for_revision()
+
+    def test_svn_apply_git_patch(self):
+        self._shared_test_svn_apply_git_patch()
+
+    def test_create_binary_patch(self):
+        # Create a git binary patch and check the contents.
+        scm = detect_scm_system(self.git_checkout_path)
+        test_file_name = 'binary_file'
+        test_file_path = os.path.join(self.git_checkout_path, test_file_name)
+        file_contents = ''.join(map(chr, range(256)))
+        write_into_file_at_path(test_file_path, file_contents)
+        run_command(['git', 'add', test_file_name])
+        patch = scm.create_patch()
+        self.assertTrue(re.search(r'\nliteral 0\n', patch))
+        self.assertTrue(re.search(r'\nliteral 256\n', patch))
+
+        # Check if we can apply the created patch.
+        run_command(['git', 'rm', '-f', test_file_name])
+        self._setup_webkittools_scripts_symlink(scm)
+        self.checkout.apply_patch(self._create_patch(patch))
+        self.assertEqual(file_contents, read_from_path(test_file_path))
+
+        # Check if we can create a patch from a local commit.
+        write_into_file_at_path(test_file_path, file_contents)
+        run_command(['git', 'add', test_file_name])
+        run_command(['git', 'commit', '-m', 'binary diff'])
+        patch_from_local_commit = scm.create_patch_from_local_commit('HEAD')
+        self.assertTrue(re.search(r'\nliteral 0\n', patch_from_local_commit))
+        self.assertTrue(re.search(r'\nliteral 256\n', patch_from_local_commit))
+        patch_since_local_commit = scm.create_patch_since_local_commit('HEAD^1')
+        self.assertTrue(re.search(r'\nliteral 0\n', patch_since_local_commit))
+        self.assertTrue(re.search(r'\nliteral 256\n', patch_since_local_commit))
+        self.assertEqual(patch_from_local_commit, patch_since_local_commit)
+
+    def test_changed_files(self):
+        self._shared_test_changed_files()
+
+    def test_changed_files_for_revision(self):
+        self._shared_test_changed_files_for_revision()
+
+    def test_contents_at_revision(self):
+        self._shared_test_contents_at_revision()
+
+    def test_added_files(self):
+        self._shared_test_added_files()
+
+    def test_committer_email_for_revision(self):
+        self._shared_test_committer_email_for_revision()
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/config/__init__.py b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
new file mode 100644
index 0000000..03f1bc7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
@@ -0,0 +1,7 @@
+# Required for Python to search this directory for module files
+
+import re
+
+codereview_server_host = "wkrietveld.appspot.com"
+codereview_server_regex = "https?://%s/" % re.sub('\.', '\\.', codereview_server_host)
+codereview_server_url = "https://%s/" % codereview_server_host
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
new file mode 100644
index 0000000..a92dbd3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -0,0 +1,288 @@
+# Copyright (c) 2009, 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.
+#
+# WebKit's Python module for committer and reviewer validation
+
+
+class Committer:
+
+    def __init__(self, name, email_or_emails, irc_nickname=None):
+        self.full_name = name
+        if isinstance(email_or_emails, str):
+            self.emails = [email_or_emails]
+        else:
+            self.emails = email_or_emails
+        self.irc_nickname = irc_nickname
+        self.can_review = False
+
+    def bugzilla_email(self):
+        # FIXME: We're assuming the first email is a valid bugzilla email,
+        # which might not be right.
+        return self.emails[0]
+
+    def __str__(self):
+        return '"%s" <%s>' % (self.full_name, self.emails[0])
+
+
+class Reviewer(Committer):
+
+    def __init__(self, name, email_or_emails, irc_nickname=None):
+        Committer.__init__(self, name, email_or_emails, irc_nickname)
+        self.can_review = True
+
+
+# This is intended as a canonical, machine-readable list of all non-reviewer
+# committers for WebKit.  If your name is missing here and you are a committer,
+# please add it.  No review needed.  All reviewers are committers, so this list
+# is only of committers who are not reviewers.
+
+
+committers_unable_to_review = [
+    Committer("Aaron Boodman", "aa@chromium.org", "aboodman"),
+    Committer("Adam Langley", "agl@chromium.org", "agl"),
+    Committer("Albert J. Wong", "ajwong@chromium.org"),
+    Committer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"]),
+    Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"], "lypanov"),
+    Committer("Alexander Pavlov", "apavlov@chromium.org"),
+    Committer("Andre Boule", "aboule@apple.com"),
+    Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"], "proton"),
+    Committer("Andras Becsi", "abecsi@webkit.org", "bbandix"),
+    Committer("Andy Estes", "aestes@apple.com", "estes"),
+    Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
+    Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
+    Committer("Antonio Gomes", "tonikitoo@webkit.org", "tonikitoo"),
+    Committer("Ben Murdoch", "benm@google.com", "benm"),
+    Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"], "icefox"),
+    Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"),
+    Committer("Brent Fulgham", "bfulgham@webkit.org", "bfulgham"),
+    Committer("Brett Wilson", "brettw@chromium.org", "brettx"),
+    Committer("Brian Weinstein", "bweinstein@apple.com", "bweinstein"),
+    Committer("Cameron McCormack", "cam@webkit.org", "heycam"),
+    Committer("Carol Szabo", "carol.szabo@nokia.com"),
+    Committer("Chang Shu", "Chang.Shu@nokia.com"),
+    Committer("Chris Fleizach", "cfleizach@apple.com"),
+    Committer("Chris Jerdonek", "cjerdonek@webkit.org", "cjerdonek"),
+    Committer("Chris Marrin", "cmarrin@apple.com", "cmarrin"),
+    Committer("Chris Petersen", "cpetersen@apple.com", "cpetersen"),
+    Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]),
+    Committer("Collin Jackson", "collinj@webkit.org"),
+    Committer("Csaba Osztrogonac", "ossy@webkit.org", "ossy"),
+    Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"], "catfishman"),
+    Committer("Dean Jackson", "dino@apple.com", "dino"),
+    Committer("Dirk Pranke", "dpranke@chromium.org"),
+    Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"),
+    Committer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"),
+    Committer("Eli Fidler", "eli@staikos.net", "QBin"),
+    Committer("Enrica Casucci", "enrica@apple.com"),
+    Committer("Erik Arvidsson", "arv@chromium.org", "arv"),
+    Committer("Eric Roman", "eroman@chromium.org", "eroman"),
+    Committer("Feng Qian", "feng@chromium.org"),
+    Committer("Fumitoshi Ukai", "ukai@chromium.org", "ukai"),
+    Committer("Gabor Loki", "loki@webkit.org", "loki04"),
+    Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"]),
+    Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
+    Committer("Greg Bolsinga", "bolsinga@apple.com"),
+    Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
+    Committer("Ilya Tikhonovsky", "loislo@chromium.org", "loislo"),
+    Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
+    Committer("Jakub Wieczorek", "jwieczorek@webkit.org", "fawek"),
+    Committer("James Hawkins", ["jhawkins@chromium.org", "jhawkins@google.com"], "jhawkins"),
+    Committer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"]),
+    Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]),
+    Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"], "jeremymos"),
+    Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]),
+    Committer("Jesus Sanchez-Palencia", ["jesus@webkit.org", "jesus.palencia@openbossa.org"], "jeez_"),
+    Committer("John Abd-El-Malek", "jam@chromium.org", "jam"),
+    Committer("John Gregg", ["johnnyg@google.com", "johnnyg@chromium.org"], "johnnyg"),
+    Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"),
+    Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"),
+    Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]),
+    Committer("Jungshik Shin", "jshin@chromium.org"),
+    Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
+    Committer("Kelly Norton", "knorton@google.com"),
+    Committer("Kenneth Russell", "kbr@google.com"),
+    Committer("Kent Tamura", "tkent@chromium.org", "tkent"),
+    Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
+    Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
+    Committer("Levi Weintraub", "lweintraub@apple.com"),
+    Committer("Mads Ager", "ager@chromium.org"),
+    Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
+    Committer("Matt Perry", "mpcomplete@chromium.org"),
+    Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
+    Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"], "maxime.simon"),
+    Committer("Martin Robinson", ["mrobinson@webkit.org", "martin.james.robinson@gmail.com"]),
+    Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
+    Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
+    Committer("Mike Fenton", ["mike.fenton@torchmobile.com", "mifenton@rim.com"], "mfenton"),
+    Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
+    Committer("Mikhail Naganov", "mnaganov@chromium.org"),
+    Committer("MORITA Hajime", "morrita@google.com", "morrita"),
+    Committer("Ojan Vafai", "ojan@chromium.org", "ojan"),
+    Committer("Pam Greene", "pam@chromium.org", "pamg"),
+    Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"),
+    Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"], "pnormand"),
+    Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"], "pdherbemont"),
+    Committer("Pierre-Olivier Latour", "pol@apple.com", "pol"),
+    Committer("Robert Hogan", ["robert@webkit.org", "robert@roberthogan.net"], "mwenge"),
+    Committer("Roland Steiner", "rolandsteiner@chromium.org"),
+    Committer("Ryosuke Niwa", "rniwa@webkit.org", "rniwa"),
+    Committer("Scott Violet", "sky@chromium.org", "sky"),
+    Committer("Stephen White", "senorblanco@chromium.org", "senorblanco"),
+    Committer("Steve Block", "steveblock@google.com"),
+    Committer("Tony Chang", "tony@chromium.org", "tony^work"),
+    Committer("Trey Matteson", "trey@usa.net", "trey"),
+    Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
+    Committer("Victor Wang", "victorw@chromium.org"),
+    Committer("Vitaly Repeshko", "vitalyr@chromium.org"),
+    Committer("William Siegrist", "wsiegrist@apple.com", "wms"),
+    Committer("Yael Aharon", "yael.aharon@nokia.com"),
+    Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]),
+    Committer("Yong Li", ["yong.li@torchmobile.com", "yong.li.webkit@gmail.com"], "yong"),
+    Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"),
+    Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
+    Committer("Zoltan Herczeg", "zherczeg@webkit.org", "zherczeg"),
+    Committer("Zoltan Horvath", "zoltan@webkit.org", "zoltan"),
+]
+
+
+# This is intended as a canonical, machine-readable list of all reviewers for
+# WebKit.  If your name is missing here and you are a reviewer, please add it.
+# No review needed.
+
+
+reviewers_list = [
+    Reviewer("Ada Chan", "adachan@apple.com", "chanada"),
+    Reviewer("Adam Barth", "abarth@webkit.org", "abarth"),
+    Reviewer("Adam Roben", "aroben@apple.com", "aroben"),
+    Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org"], "manyoso"),
+    Reviewer("Adele Peterson", "adele@apple.com", "adele"),
+    Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"], "ap"),
+    Reviewer("Alice Liu", "alice.liu@apple.com", "aliu"),
+    Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"], "alp"),
+    Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"], "andersca"),
+    Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com"], "anttik"),
+    Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@webkit.org"], "ariya"),
+    Reviewer("Beth Dakin", "bdakin@apple.com", "dethbakin"),
+    Reviewer("Brady Eidson", "beidson@apple.com", "bradee-oh"),
+    Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
+    Reviewer("Chris Blumenberg", "cblu@apple.com", "cblu"),
+    Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"], "mitzpettel"),
+    Reviewer("Daniel Bates", "dbates@webkit.org", "dydz"),
+    Reviewer("Darin Adler", "darin@apple.com", "darin"),
+    Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"], "fishd"),
+    Reviewer("David Harrison", "harrison@apple.com", "harrison"),
+    Reviewer("David Hyatt", "hyatt@apple.com", "hyatt"),
+    Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"], "ddkilzer"),
+    Reviewer("David Levin", "levin@chromium.org", "dave_levin"),
+    Reviewer("Dimitri Glazkov", "dglazkov@chromium.org", "dglazkov"),
+    Reviewer("Dirk Schulze", "krit@webkit.org", "krit"),
+    Reviewer("Dmitry Titov", "dimich@chromium.org", "dimich"),
+    Reviewer("Don Melton", "gramps@apple.com", "gramps"),
+    Reviewer("Eric Carlson", "eric.carlson@apple.com"),
+    Reviewer("Eric Seidel", "eric@webkit.org", "eseidel"),
+    Reviewer("Gavin Barraclough", "barraclough@apple.com", "gbarra"),
+    Reviewer("Geoffrey Garen", "ggaren@apple.com", "ggaren"),
+    Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
+    Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org"], "kov"),
+    Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"], "zecke"),
+    Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"], "janm"),
+    Reviewer("Jeremy Orlow", "jorlow@chromium.org", "jorlow"),
+    Reviewer("Jian Li", "jianli@chromium.org", "jianli"),
+    Reviewer("John Sullivan", "sullivan@apple.com", "sullivan"),
+    Reviewer("Jon Honeycutt", "jhoneycutt@apple.com", "jhoneycutt"),
+    Reviewer("Joseph Pecoraro", "joepeck@webkit.org", "JoePeck"),
+    Reviewer("Justin Garcia", "justin.garcia@apple.com", "justing"),
+    Reviewer("Ken Kocienda", "kocienda@apple.com"),
+    Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org"], "kenne"),
+    Reviewer("Kevin Decker", "kdecker@apple.com", "superkevin"),
+    Reviewer("Kevin McCullough", "kmccullough@apple.com", "maculloch"),
+    Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"], "kollivier"),
+    Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org"], "lars"),
+    Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com", "lgombos"),
+    Reviewer("Maciej Stachowiak", "mjs@apple.com", "othermaciej"),
+    Reviewer("Mark Rowe", "mrowe@apple.com", "bdash"),
+    Reviewer("Nate Chapin", "japhet@chromium.org", "japhet"),
+    Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"], "wildfox"),
+    Reviewer("Oliver Hunt", "oliver@apple.com", "olliej"),
+    Reviewer("Pavel Feldman", "pfeldman@chromium.org", "pfeldman"),
+    Reviewer("Richard Williamson", "rjw@apple.com", "rjw"),
+    Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org"], "rwlbuis"),
+    Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"], "weinig"),
+    Reviewer("Shinichiro Hamaji", "hamaji@chromium.org", "hamaji"),
+    Reviewer("Simon Fraser", "simon.fraser@apple.com", "smfr"),
+    Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"], "tronical"),
+    Reviewer("Stephanie Lewis", "slewis@apple.com", "sundiamonde"),
+    Reviewer("Steve Falkenburg", "sfalken@apple.com", "sfalken"),
+    Reviewer("Tim Omernick", "timo@apple.com"),
+    Reviewer("Timothy Hatcher", ["timothy@hatcher.name", "timothy@apple.com"], "xenon"),
+    Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org", "torarne"),
+    Reviewer("Vicki Murley", "vicki@apple.com"),
+    Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org"], "xan"),
+    Reviewer("Yury Semikhatsky", "yurys@chromium.org", "yurys"),
+    Reviewer("Zack Rusin", "zack@kde.org", "zackr"),
+]
+
+
+class CommitterList:
+
+    # Committers and reviewers are passed in to allow easy testing
+
+    def __init__(self,
+                 committers=committers_unable_to_review,
+                 reviewers=reviewers_list):
+        self._committers = committers + reviewers
+        self._reviewers = reviewers
+        self._committers_by_email = {}
+
+    def committers(self):
+        return self._committers
+
+    def reviewers(self):
+        return self._reviewers
+
+    def _email_to_committer_map(self):
+        if not len(self._committers_by_email):
+            for committer in self._committers:
+                for email in committer.emails:
+                    self._committers_by_email[email] = committer
+        return self._committers_by_email
+
+    def committer_by_name(self, name):
+        # This could be made into a hash lookup if callers need it to be fast.
+        for committer in self.committers():
+            if committer.full_name == name:
+                return committer
+
+    def committer_by_email(self, email):
+        return self._email_to_committer_map().get(email)
+
+    def reviewer_by_email(self, email):
+        committer = self.committer_by_email(email)
+        if committer and not committer.can_review:
+            return None
+        return committer
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py
new file mode 100644
index 0000000..068c0ee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py
@@ -0,0 +1,72 @@
+# Copyright (C) 2009 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.
+
+import unittest
+from webkitpy.common.config.committers import CommitterList, Committer, Reviewer
+
+class CommittersTest(unittest.TestCase):
+
+    def test_committer_lookup(self):
+        committer = Committer('Test One', 'one@test.com', 'one')
+        reviewer = Reviewer('Test Two', ['two@test.com', 'two@rad.com', 'so_two@gmail.com'])
+        committer_list = CommitterList(committers=[committer], reviewers=[reviewer])
+
+        # Test valid committer and reviewer lookup
+        self.assertEqual(committer_list.committer_by_email('one@test.com'), committer)
+        self.assertEqual(committer_list.reviewer_by_email('two@test.com'), reviewer)
+        self.assertEqual(committer_list.committer_by_email('two@test.com'), reviewer)
+        self.assertEqual(committer_list.committer_by_email('two@rad.com'), reviewer)
+        self.assertEqual(committer_list.reviewer_by_email('so_two@gmail.com'), reviewer)
+
+        # Test valid committer and reviewer lookup
+        self.assertEqual(committer_list.committer_by_name("Test One"), committer)
+        self.assertEqual(committer_list.committer_by_name("Test Two"), reviewer)
+        self.assertEqual(committer_list.committer_by_name("Test Three"), None)
+
+        # Test that the first email is assumed to be the Bugzilla email address (for now)
+        self.assertEqual(committer_list.committer_by_email('two@rad.com').bugzilla_email(), 'two@test.com')
+
+        # Test that a known committer is not returned during reviewer lookup
+        self.assertEqual(committer_list.reviewer_by_email('one@test.com'), None)
+
+        # Test that unknown email address fail both committer and reviewer lookup
+        self.assertEqual(committer_list.committer_by_email('bar@bar.com'), None)
+        self.assertEqual(committer_list.reviewer_by_email('bar@bar.com'), None)
+
+        # Test that emails returns a list.
+        self.assertEqual(committer.emails, ['one@test.com'])
+
+        self.assertEqual(committer.irc_nickname, 'one')
+
+        # Test that committers returns committers and reviewers and reviewers() just reviewers.
+        self.assertEqual(committer_list.committers(), [committer, reviewer])
+        self.assertEqual(committer_list.reviewers(), [reviewer])
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/config/irc.py b/WebKitTools/Scripts/webkitpy/common/config/irc.py
new file mode 100644
index 0000000..950c573
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/irc.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2009 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.
+
+server="irc.freenode.net"
+port=6667
+channel="#webkit"
diff --git a/WebKitTools/Scripts/webkitpy/common/config/ports.py b/WebKitTools/Scripts/webkitpy/common/config/ports.py
new file mode 100644
index 0000000..a881a67
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports.py
@@ -0,0 +1,190 @@
+# Copyright (C) 2009, 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.
+#
+# WebKit's Python module for understanding the various ports
+
+import os
+import platform
+
+from webkitpy.common.system.executive import Executive
+
+
+class WebKitPort(object):
+
+    # We might need to pass scm into this function for scm.checkout_root
+    @classmethod
+    def script_path(cls, script_name):
+        return os.path.join("WebKitTools", "Scripts", script_name)
+
+    @staticmethod
+    def port(port_name):
+        ports = {
+            "chromium": ChromiumPort,
+            "gtk": GtkPort,
+            "mac": MacPort,
+            "win": WinPort,
+            "qt": QtPort,
+        }
+        default_port = {
+            "Windows": WinPort,
+            "Darwin": MacPort,
+        }
+        # Do we really need MacPort as the ultimate default?
+        return ports.get(port_name, default_port.get(platform.system(), MacPort))
+
+    @staticmethod
+    def makeArgs():
+        args = '--makeargs="-j%s"' % Executive().cpu_count()
+        if os.environ.has_key('MAKEFLAGS'):
+            args = '--makeargs="%s"' % os.environ['MAKEFLAGS']
+        return args
+
+    @classmethod
+    def name(cls):
+        raise NotImplementedError("subclasses must implement")
+
+    @classmethod
+    def flag(cls):
+        raise NotImplementedError("subclasses must implement")
+
+    @classmethod
+    def update_webkit_command(cls):
+        return [cls.script_path("update-webkit")]
+
+    @classmethod
+    def build_webkit_command(cls, build_style=None):
+        command = [cls.script_path("build-webkit")]
+        if build_style == "debug":
+            command.append("--debug")
+        if build_style == "release":
+            command.append("--release")
+        return command
+
+    @classmethod
+    def run_javascriptcore_tests_command(cls):
+        return [cls.script_path("run-javascriptcore-tests")]
+
+    @classmethod
+    def run_webkit_tests_command(cls):
+        return [cls.script_path("run-webkit-tests")]
+
+    @classmethod
+    def run_python_unittests_command(cls):
+        return [cls.script_path("test-webkitpy")]
+
+    @classmethod
+    def run_perl_unittests_command(cls):
+        return [cls.script_path("test-webkitperl")]
+
+
+class MacPort(WebKitPort):
+
+    @classmethod
+    def name(cls):
+        return "Mac"
+
+    @classmethod
+    def flag(cls):
+        return "--port=mac"
+
+
+class WinPort(WebKitPort):
+
+    @classmethod
+    def name(cls):
+        return "Win"
+
+    @classmethod
+    def flag(cls):
+        # FIXME: This is lame.  We should autogenerate this from a codename or something.
+        return "--port=win"
+
+
+class GtkPort(WebKitPort):
+
+    @classmethod
+    def name(cls):
+        return "Gtk"
+
+    @classmethod
+    def flag(cls):
+        return "--port=gtk"
+
+    @classmethod
+    def build_webkit_command(cls, build_style=None):
+        command = WebKitPort.build_webkit_command(build_style=build_style)
+        command.append("--gtk")
+        command.append(WebKitPort.makeArgs())
+        return command
+
+    @classmethod
+    def run_webkit_tests_command(cls):
+        command = WebKitPort.run_webkit_tests_command()
+        command.append("--gtk")
+        return command
+
+
+class QtPort(WebKitPort):
+
+    @classmethod
+    def name(cls):
+        return "Qt"
+
+    @classmethod
+    def flag(cls):
+        return "--port=qt"
+
+    @classmethod
+    def build_webkit_command(cls, build_style=None):
+        command = WebKitPort.build_webkit_command(build_style=build_style)
+        command.append("--qt")
+        command.append(WebKitPort.makeArgs())
+        return command
+
+
+class ChromiumPort(WebKitPort):
+
+    @classmethod
+    def name(cls):
+        return "Chromium"
+
+    @classmethod
+    def flag(cls):
+        return "--port=chromium"
+
+    @classmethod
+    def update_webkit_command(cls):
+        command = WebKitPort.update_webkit_command()
+        command.append("--chromium")
+        return command
+
+    @classmethod
+    def build_webkit_command(cls, build_style=None):
+        command = WebKitPort.build_webkit_command(build_style=build_style)
+        command.append("--chromium")
+        return command
diff --git a/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
new file mode 100644
index 0000000..c42d2d0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+# Copyright (c) 2009, 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.
+
+import unittest
+
+from webkitpy.common.config.ports import WebKitPort, MacPort, GtkPort, QtPort, ChromiumPort
+
+
+class WebKitPortTest(unittest.TestCase):
+    def test_mac_port(self):
+        self.assertEquals(MacPort.name(), "Mac")
+        self.assertEquals(MacPort.flag(), "--port=mac")
+        self.assertEquals(MacPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
+        self.assertEquals(MacPort.build_webkit_command(), [WebKitPort.script_path("build-webkit")])
+        self.assertEquals(MacPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug"])
+        self.assertEquals(MacPort.build_webkit_command(build_style="release"), [WebKitPort.script_path("build-webkit"), "--release"])
+
+    def test_gtk_port(self):
+        self.assertEquals(GtkPort.name(), "Gtk")
+        self.assertEquals(GtkPort.flag(), "--port=gtk")
+        self.assertEquals(GtkPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests"), "--gtk"])
+        self.assertEquals(GtkPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--gtk", WebKitPort.makeArgs()])
+        self.assertEquals(GtkPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--gtk", WebKitPort.makeArgs()])
+
+    def test_qt_port(self):
+        self.assertEquals(QtPort.name(), "Qt")
+        self.assertEquals(QtPort.flag(), "--port=qt")
+        self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
+        self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt", WebKitPort.makeArgs()])
+        self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--qt", WebKitPort.makeArgs()])
+
+    def test_chromium_port(self):
+        self.assertEquals(ChromiumPort.name(), "Chromium")
+        self.assertEquals(ChromiumPort.flag(), "--port=chromium")
+        self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
+        self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium"])
+        self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium"])
+        self.assertEquals(ChromiumPort.update_webkit_command(), [WebKitPort.script_path("update-webkit"), "--chromium"])
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/net/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/common/net/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
new file mode 100644
index 0000000..6920d67
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
@@ -0,0 +1,835 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2010 Research In Motion Limited. 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.
+#
+# WebKit's Python module for interacting with Bugzilla
+
+import os.path
+import re
+import subprocess
+
+from datetime import datetime # used in timestamp()
+
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.config import committers
+from webkitpy.common.net.credentials import Credentials
+from webkitpy.common.system.ospath import relpath
+from webkitpy.common.system.user import User
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer
+
+
+def parse_bug_id(message):
+    if not message:
+        return None
+    match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message)
+    if match:
+        return int(match.group('bug_id'))
+    match = re.search(
+        Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)",
+        message)
+    if match:
+        return int(match.group('bug_id'))
+    return None
+
+
+def timestamp():
+    return datetime.now().strftime("%Y%m%d%H%M%S")
+
+
+class Attachment(object):
+
+    rollout_preamble = "ROLLOUT of r"
+
+    def __init__(self, attachment_dictionary, bug):
+        self._attachment_dictionary = attachment_dictionary
+        self._bug = bug
+        self._reviewer = None
+        self._committer = None
+
+    def _bugzilla(self):
+        return self._bug._bugzilla
+
+    def id(self):
+        return int(self._attachment_dictionary.get("id"))
+
+    def attacher_is_committer(self):
+        return self._bugzilla.committers.committer_by_email(
+            patch.attacher_email())
+
+    def attacher_email(self):
+        return self._attachment_dictionary.get("attacher_email")
+
+    def bug(self):
+        return self._bug
+
+    def bug_id(self):
+        return int(self._attachment_dictionary.get("bug_id"))
+
+    def is_patch(self):
+        return not not self._attachment_dictionary.get("is_patch")
+
+    def is_obsolete(self):
+        return not not self._attachment_dictionary.get("is_obsolete")
+
+    def is_rollout(self):
+        return self.name().startswith(self.rollout_preamble)
+
+    def name(self):
+        return self._attachment_dictionary.get("name")
+
+    def review(self):
+        return self._attachment_dictionary.get("review")
+
+    def commit_queue(self):
+        return self._attachment_dictionary.get("commit-queue")
+
+    def url(self):
+        # FIXME: This should just return
+        # self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
+        # depends on the current behavior.
+        return self._attachment_dictionary.get("url")
+
+    def _validate_flag_value(self, flag):
+        email = self._attachment_dictionary.get("%s_email" % flag)
+        if not email:
+            return None
+        committer = getattr(self._bugzilla().committers,
+                            "%s_by_email" % flag)(email)
+        if committer:
+            return committer
+        log("Warning, attachment %s on bug %s has invalid %s (%s)" % (
+                 self._attachment_dictionary['id'],
+                 self._attachment_dictionary['bug_id'], flag, email))
+
+    def reviewer(self):
+        if not self._reviewer:
+            self._reviewer = self._validate_flag_value("reviewer")
+        return self._reviewer
+
+    def committer(self):
+        if not self._committer:
+            self._committer = self._validate_flag_value("committer")
+        return self._committer
+
+
+class Bug(object):
+    # FIXME: This class is kinda a hack for now.  It exists so we have one
+    # place to hold bug logic, even if much of the code deals with
+    # dictionaries still.
+
+    def __init__(self, bug_dictionary, bugzilla):
+        self.bug_dictionary = bug_dictionary
+        self._bugzilla = bugzilla
+
+    def id(self):
+        return self.bug_dictionary["id"]
+
+    def assigned_to_email(self):
+        return self.bug_dictionary["assigned_to_email"]
+
+    # FIXME: This information should be stored in some sort of webkit_config.py instead of here.
+    unassigned_emails = frozenset([
+        "webkit-unassigned@lists.webkit.org",
+        "webkit-qt-unassigned@trolltech.com",
+    ])
+    def is_unassigned(self):
+        return self.assigned_to_email() in self.unassigned_emails
+
+    # Rarely do we actually want obsolete attachments
+    def attachments(self, include_obsolete=False):
+        attachments = self.bug_dictionary["attachments"]
+        if not include_obsolete:
+            attachments = filter(lambda attachment:
+                                 not attachment["is_obsolete"], attachments)
+        return [Attachment(attachment, self) for attachment in attachments]
+
+    def patches(self, include_obsolete=False):
+        return [patch for patch in self.attachments(include_obsolete)
+                                   if patch.is_patch()]
+
+    def unreviewed_patches(self):
+        return [patch for patch in self.patches() if patch.review() == "?"]
+
+    def reviewed_patches(self, include_invalid=False):
+        patches = [patch for patch in self.patches() if patch.review() == "+"]
+        if include_invalid:
+            return patches
+        # Checking reviewer() ensures that it was both reviewed and has a valid
+        # reviewer.
+        return filter(lambda patch: patch.reviewer(), patches)
+
+    def commit_queued_patches(self, include_invalid=False):
+        patches = [patch for patch in self.patches()
+                                      if patch.commit_queue() == "+"]
+        if include_invalid:
+            return patches
+        # Checking committer() ensures that it was both commit-queue+'d and has
+        # a valid committer.
+        return filter(lambda patch: patch.committer(), patches)
+
+
+# A container for all of the logic for making and parsing buzilla queries.
+class BugzillaQueries(object):
+
+    def __init__(self, bugzilla):
+        self._bugzilla = bugzilla
+
+    # Note: _load_query and _fetch_bug are the only two methods which access
+    # self._bugzilla.
+
+    def _load_query(self, query):
+        self._bugzilla.authenticate()
+
+        full_url = "%s%s" % (self._bugzilla.bug_server_url, query)
+        return self._bugzilla.browser.open(full_url)
+
+    def _fetch_bug(self, bug_id):
+        return self._bugzilla.fetch_bug(bug_id)
+
+    def _fetch_bug_ids_advanced_query(self, query):
+        soup = BeautifulSoup(self._load_query(query))
+        # The contents of the <a> inside the cells in the first column happen
+        # to be the bug id.
+        return [int(bug_link_cell.find("a").string)
+                for bug_link_cell in soup('td', "first-child")]
+
+    def _parse_attachment_ids_request_query(self, page):
+        digits = re.compile("\d+")
+        attachment_href = re.compile("attachment.cgi\?id=\d+&action=review")
+        attachment_links = SoupStrainer("a", href=attachment_href)
+        return [int(digits.search(tag["href"]).group(0))
+                for tag in BeautifulSoup(page, parseOnlyThese=attachment_links)]
+
+    def _fetch_attachment_ids_request_query(self, query):
+        return self._parse_attachment_ids_request_query(self._load_query(query))
+
+    def _parse_quips(self, page):
+        soup = BeautifulSoup(page, convertEntities=BeautifulSoup.HTML_ENTITIES)
+        quips = soup.find(text=re.compile(r"Existing quips:")).findNext("ul").findAll("li")
+        return [unicode(quip_entry.string) for quip_entry in quips]
+
+    def fetch_quips(self):
+        return self._parse_quips(self._load_query("/quips.cgi?action=show"))
+
+    # List of all r+'d bugs.
+    def fetch_bug_ids_from_pending_commit_list(self):
+        needs_commit_query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review%2B"
+        return self._fetch_bug_ids_advanced_query(needs_commit_query_url)
+
+    def fetch_patches_from_pending_commit_list(self):
+        return sum([self._fetch_bug(bug_id).reviewed_patches()
+            for bug_id in self.fetch_bug_ids_from_pending_commit_list()], [])
+
+    def fetch_bug_ids_from_commit_queue(self):
+        commit_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=commit-queue%2B&order=Last+Changed"
+        return self._fetch_bug_ids_advanced_query(commit_queue_url)
+
+    def fetch_patches_from_commit_queue(self):
+        # This function will only return patches which have valid committers
+        # set.  It won't reject patches with invalid committers/reviewers.
+        return sum([self._fetch_bug(bug_id).commit_queued_patches()
+                    for bug_id in self.fetch_bug_ids_from_commit_queue()], [])
+
+    def _fetch_bug_ids_from_review_queue(self):
+        review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
+        return self._fetch_bug_ids_advanced_query(review_queue_url)
+
+    def fetch_patches_from_review_queue(self, limit=None):
+        # [:None] returns the whole array.
+        return sum([self._fetch_bug(bug_id).unreviewed_patches()
+            for bug_id in self._fetch_bug_ids_from_review_queue()[:limit]], [])
+
+    # FIXME: Why do we have both fetch_patches_from_review_queue and
+    # fetch_attachment_ids_from_review_queue??
+    # NOTE: This is also the only client of _fetch_attachment_ids_request_query
+
+    def fetch_attachment_ids_from_review_queue(self):
+        review_queue_url = "request.cgi?action=queue&type=review&group=type"
+        return self._fetch_attachment_ids_request_query(review_queue_url)
+
+
+class CommitterValidator(object):
+
+    def __init__(self, bugzilla):
+        self._bugzilla = bugzilla
+
+    # _view_source_url belongs in some sort of webkit_config.py module.
+    def _view_source_url(self, local_path):
+        return "http://trac.webkit.org/browser/trunk/%s" % local_path
+
+    def _checkout_root(self):
+        # FIXME: This is a hack, we would have this from scm.checkout_root
+        # if we had any way to get to an scm object here.
+        components = __file__.split(os.sep)
+        tools_index = components.index("WebKitTools")
+        return os.sep.join(components[:tools_index])
+
+    def _committers_py_path(self):
+        # extension can sometimes be .pyc, we always want .py
+        (path, extension) = os.path.splitext(committers.__file__)
+        # FIXME: When we're allowed to use python 2.6 we can use the real
+        # os.path.relpath
+        path = relpath(path, self._checkout_root())
+        return ".".join([path, "py"])
+
+    def _flag_permission_rejection_message(self, setter_email, flag_name):
+        # Should come from some webkit_config.py
+        contribution_guidlines = "http://webkit.org/coding/contributing.html"
+        # This could be queried from the status_server.
+        queue_administrator = "eseidel@chromium.org"
+        # This could be queried from the tool.
+        queue_name = "commit-queue"
+        committers_list = self._committers_py_path()
+        message = "%s does not have %s permissions according to %s." % (
+                        setter_email,
+                        flag_name,
+                        self._view_source_url(committers_list))
+        message += "\n\n- If you do not have %s rights please read %s for instructions on how to use bugzilla flags." % (
+                        flag_name, contribution_guidlines)
+        message += "\n\n- If you have %s rights please correct the error in %s by adding yourself to the file (no review needed).  " % (
+                        flag_name, committers_list)
+        message += "Due to bug 30084 the %s will require a restart after your change.  " % queue_name
+        message += "Please contact %s to request a %s restart.  " % (
+                        queue_administrator, queue_name)
+        message += "After restart the %s will correctly respect your %s rights." % (
+                        queue_name, flag_name)
+        return message
+
+    def _validate_setter_email(self, patch, result_key, rejection_function):
+        committer = getattr(patch, result_key)()
+        # If the flag is set, and we don't recognize the setter, reject the
+        # flag!
+        setter_email = patch._attachment_dictionary.get("%s_email" % result_key)
+        if setter_email and not committer:
+            rejection_function(patch.id(),
+                self._flag_permission_rejection_message(setter_email,
+                                                        result_key))
+            return False
+        return True
+
+    def patches_after_rejecting_invalid_commiters_and_reviewers(self, patches):
+        validated_patches = []
+        for patch in patches:
+            if (self._validate_setter_email(
+                    patch, "reviewer", self.reject_patch_from_review_queue)
+                and self._validate_setter_email(
+                    patch, "committer", self.reject_patch_from_commit_queue)):
+                validated_patches.append(patch)
+        return validated_patches
+
+    def reject_patch_from_commit_queue(self,
+                                       attachment_id,
+                                       additional_comment_text=None):
+        comment_text = "Rejecting patch %s from commit-queue." % attachment_id
+        self._bugzilla.set_flag_on_attachment(attachment_id,
+                                              "commit-queue",
+                                              "-",
+                                              comment_text,
+                                              additional_comment_text)
+
+    def reject_patch_from_review_queue(self,
+                                       attachment_id,
+                                       additional_comment_text=None):
+        comment_text = "Rejecting patch %s from review queue." % attachment_id
+        self._bugzilla.set_flag_on_attachment(attachment_id,
+                                              'review',
+                                              '-',
+                                              comment_text,
+                                              additional_comment_text)
+
+
+class Bugzilla(object):
+
+    def __init__(self, dryrun=False, committers=committers.CommitterList()):
+        self.dryrun = dryrun
+        self.authenticated = False
+        self.queries = BugzillaQueries(self)
+        self.committers = committers
+        self.cached_quips = []
+
+        # FIXME: We should use some sort of Browser mock object when in dryrun
+        # mode (to prevent any mistakes).
+        self.browser = Browser()
+        # Ignore bugs.webkit.org/robots.txt until we fix it to allow this
+        # script.
+        self.browser.set_handle_robots(False)
+
+    # FIXME: Much of this should go into some sort of config module:
+    bug_server_host = "bugs.webkit.org"
+    bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host)
+    bug_server_url = "https://%s/" % bug_server_host
+
+    def quips(self):
+        # We only fetch and parse the list of quips once per instantiation
+        # so that we do not burden bugs.webkit.org.
+        if not self.cached_quips and not self.dryrun:
+            self.cached_quips = self.queries.fetch_quips()
+        return self.cached_quips
+
+    def bug_url_for_bug_id(self, bug_id, xml=False):
+        if not bug_id:
+            return None
+        content_type = "&ctype=xml" if xml else ""
+        return "%sshow_bug.cgi?id=%s%s" % (self.bug_server_url,
+                                           bug_id,
+                                           content_type)
+
+    def short_bug_url_for_bug_id(self, bug_id):
+        if not bug_id:
+            return None
+        return "http://webkit.org/b/%s" % bug_id
+
+    def attachment_url_for_id(self, attachment_id, action="view"):
+        if not attachment_id:
+            return None
+        action_param = ""
+        if action and action != "view":
+            action_param = "&action=%s" % action
+        return "%sattachment.cgi?id=%s%s" % (self.bug_server_url,
+                                             attachment_id,
+                                             action_param)
+
+    def _parse_attachment_flag(self,
+                               element,
+                               flag_name,
+                               attachment,
+                               result_key):
+        flag = element.find('flag', attrs={'name': flag_name})
+        if flag:
+            attachment[flag_name] = flag['status']
+            if flag['status'] == '+':
+                attachment[result_key] = flag['setter']
+
+    def _parse_attachment_element(self, element, bug_id):
+        attachment = {}
+        attachment['bug_id'] = bug_id
+        attachment['is_obsolete'] = (element.has_key('isobsolete') and element['isobsolete'] == "1")
+        attachment['is_patch'] = (element.has_key('ispatch') and element['ispatch'] == "1")
+        attachment['id'] = int(element.find('attachid').string)
+        # FIXME: No need to parse out the url here.
+        attachment['url'] = self.attachment_url_for_id(attachment['id'])
+        attachment['name'] = unicode(element.find('desc').string)
+        attachment['attacher_email'] = str(element.find('attacher').string)
+        attachment['type'] = str(element.find('type').string)
+        self._parse_attachment_flag(
+                element, 'review', attachment, 'reviewer_email')
+        self._parse_attachment_flag(
+                element, 'commit-queue', attachment, 'committer_email')
+        return attachment
+
+    def _parse_bug_page(self, page):
+        soup = BeautifulSoup(page)
+        bug = {}
+        bug["id"] = int(soup.find("bug_id").string)
+        bug["title"] = unicode(soup.find("short_desc").string)
+        bug["reporter_email"] = str(soup.find("reporter").string)
+        bug["assigned_to_email"] = str(soup.find("assigned_to").string)
+        bug["cc_emails"] = [str(element.string)
+                            for element in soup.findAll('cc')]
+        bug["attachments"] = [self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment')]
+        return bug
+
+    # Makes testing fetch_*_from_bug() possible until we have a better
+    # BugzillaNetwork abstration.
+
+    def _fetch_bug_page(self, bug_id):
+        bug_url = self.bug_url_for_bug_id(bug_id, xml=True)
+        log("Fetching: %s" % bug_url)
+        return self.browser.open(bug_url)
+
+    def fetch_bug_dictionary(self, bug_id):
+        try:
+            return self._parse_bug_page(self._fetch_bug_page(bug_id))
+        except:
+            self.authenticate()
+            return self._parse_bug_page(self._fetch_bug_page(bug_id))
+
+    # FIXME: A BugzillaCache object should provide all these fetch_ methods.
+
+    def fetch_bug(self, bug_id):
+        return Bug(self.fetch_bug_dictionary(bug_id), self)
+
+    def _parse_bug_id_from_attachment_page(self, page):
+        # The "Up" relation happens to point to the bug.
+        up_link = BeautifulSoup(page).find('link', rel='Up')
+        if not up_link:
+            # This attachment does not exist (or you don't have permissions to
+            # view it).
+            return None
+        match = re.search("show_bug.cgi\?id=(?P<bug_id>\d+)", up_link['href'])
+        return int(match.group('bug_id'))
+
+    def bug_id_for_attachment_id(self, attachment_id):
+        self.authenticate()
+
+        attachment_url = self.attachment_url_for_id(attachment_id, 'edit')
+        log("Fetching: %s" % attachment_url)
+        page = self.browser.open(attachment_url)
+        return self._parse_bug_id_from_attachment_page(page)
+
+    # FIXME: This should just return Attachment(id), which should be able to
+    # lazily fetch needed data.
+
+    def fetch_attachment(self, attachment_id):
+        # We could grab all the attachment details off of the attachment edit
+        # page but we already have working code to do so off of the bugs page,
+        # so re-use that.
+        bug_id = self.bug_id_for_attachment_id(attachment_id)
+        if not bug_id:
+            return None
+        attachments = self.fetch_bug(bug_id).attachments(include_obsolete=True)
+        for attachment in attachments:
+            if attachment.id() == int(attachment_id):
+                return attachment
+        return None # This should never be hit.
+
+    def authenticate(self):
+        if self.authenticated:
+            return
+
+        if self.dryrun:
+            log("Skipping log in for dry run...")
+            self.authenticated = True
+            return
+
+        attempts = 0
+        while not self.authenticated:
+            attempts += 1
+            (username, password) = Credentials(
+                self.bug_server_host, git_prefix="bugzilla").read_credentials()
+
+            log("Logging in as %s..." % username)
+            self.browser.open(self.bug_server_url +
+                              "index.cgi?GoAheadAndLogIn=1")
+            self.browser.select_form(name="login")
+            self.browser['Bugzilla_login'] = username
+            self.browser['Bugzilla_password'] = password
+            response = self.browser.submit()
+
+            match = re.search("<title>(.+?)</title>", response.read())
+            # If the resulting page has a title, and it contains the word
+            # "invalid" assume it's the login failure page.
+            if match and re.search("Invalid", match.group(1), re.IGNORECASE):
+                errorMessage = "Bugzilla login failed: %s" % match.group(1)
+                # raise an exception only if this was the last attempt
+                if attempts < 5:
+                    log(errorMessage)
+                else:
+                    raise Exception(errorMessage)
+            else:
+                self.authenticated = True
+
+    def _fill_attachment_form(self,
+                              description,
+                              patch_file_object,
+                              comment_text=None,
+                              mark_for_review=False,
+                              mark_for_commit_queue=False,
+                              mark_for_landing=False, bug_id=None):
+        self.browser['description'] = description
+        self.browser['ispatch'] = ("1",)
+        self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
+
+        if mark_for_landing:
+            self.browser['flag_type-3'] = ('+',)
+        elif mark_for_commit_queue:
+            self.browser['flag_type-3'] = ('?',)
+        else:
+            self.browser['flag_type-3'] = ('X',)
+
+        if bug_id:
+            patch_name = "bug-%s-%s.patch" % (bug_id, timestamp())
+        else:
+            patch_name ="%s.patch" % timestamp()
+        self.browser.add_file(patch_file_object,
+                              "text/plain",
+                              patch_name,
+                              'data')
+
+    def add_patch_to_bug(self,
+                         bug_id,
+                         patch_file_object,
+                         description,
+                         comment_text=None,
+                         mark_for_review=False,
+                         mark_for_commit_queue=False,
+                         mark_for_landing=False):
+        self.authenticate()
+
+        log('Adding patch "%s" to %sshow_bug.cgi?id=%s' % (description,
+                                                           self.bug_server_url,
+                                                           bug_id))
+
+        if self.dryrun:
+            log(comment_text)
+            return
+
+        self.browser.open("%sattachment.cgi?action=enter&bugid=%s" % (
+                          self.bug_server_url, bug_id))
+        self.browser.select_form(name="entryform")
+        self._fill_attachment_form(description,
+                                   patch_file_object,
+                                   mark_for_review=mark_for_review,
+                                   mark_for_commit_queue=mark_for_commit_queue,
+                                   mark_for_landing=mark_for_landing,
+                                   bug_id=bug_id)
+        if comment_text:
+            log(comment_text)
+            self.browser['comment'] = comment_text
+        self.browser.submit()
+
+    def _check_create_bug_response(self, response_html):
+        match = re.search("<title>Bug (?P<bug_id>\d+) Submitted</title>",
+                          response_html)
+        if match:
+            return match.group('bug_id')
+
+        match = re.search(
+            '<div id="bugzilla-body">(?P<error_message>.+)<div id="footer">',
+            response_html,
+            re.DOTALL)
+        error_message = "FAIL"
+        if match:
+            text_lines = BeautifulSoup(
+                    match.group('error_message')).findAll(text=True)
+            error_message = "\n" + '\n'.join(
+                    ["  " + line.strip()
+                     for line in text_lines if line.strip()])
+        raise Exception("Bug not created: %s" % error_message)
+
+    def create_bug(self,
+                   bug_title,
+                   bug_description,
+                   component=None,
+                   patch_file_object=None,
+                   patch_description=None,
+                   cc=None,
+                   blocked=None,
+                   mark_for_review=False,
+                   mark_for_commit_queue=False):
+        self.authenticate()
+
+        log('Creating bug with title "%s"' % bug_title)
+        if self.dryrun:
+            log(bug_description)
+            return
+
+        self.browser.open(self.bug_server_url + "enter_bug.cgi?product=WebKit")
+        self.browser.select_form(name="Create")
+        component_items = self.browser.find_control('component').items
+        component_names = map(lambda item: item.name, component_items)
+        if not component:
+            component = "New Bugs"
+        if component not in component_names:
+            component = User.prompt_with_list("Please pick a component:", component_names)
+        self.browser["component"] = [component]
+        if cc:
+            self.browser["cc"] = cc
+        if blocked:
+            self.browser["blocked"] = str(blocked)
+        self.browser["short_desc"] = bug_title
+        self.browser["comment"] = bug_description
+
+        if patch_file_object:
+            self._fill_attachment_form(
+                    patch_description,
+                    patch_file_object,
+                    mark_for_review=mark_for_review,
+                    mark_for_commit_queue=mark_for_commit_queue)
+
+        response = self.browser.submit()
+
+        bug_id = self._check_create_bug_response(response.read())
+        log("Bug %s created." % bug_id)
+        log("%sshow_bug.cgi?id=%s" % (self.bug_server_url, bug_id))
+        return bug_id
+
+    def _find_select_element_for_flag(self, flag_name):
+        # FIXME: This will break if we ever re-order attachment flags
+        if flag_name == "review":
+            return self.browser.find_control(type='select', nr=0)
+        if flag_name == "commit-queue":
+            return self.browser.find_control(type='select', nr=1)
+        raise Exception("Don't know how to find flag named \"%s\"" % flag_name)
+
+    def clear_attachment_flags(self,
+                               attachment_id,
+                               additional_comment_text=None):
+        self.authenticate()
+
+        comment_text = "Clearing flags on attachment: %s" % attachment_id
+        if additional_comment_text:
+            comment_text += "\n\n%s" % additional_comment_text
+        log(comment_text)
+
+        if self.dryrun:
+            return
+
+        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
+        self.browser.select_form(nr=1)
+        self.browser.set_value(comment_text, name='comment', nr=0)
+        self._find_select_element_for_flag('review').value = ("X",)
+        self._find_select_element_for_flag('commit-queue').value = ("X",)
+        self.browser.submit()
+
+    def set_flag_on_attachment(self,
+                               attachment_id,
+                               flag_name,
+                               flag_value,
+                               comment_text,
+                               additional_comment_text):
+        # FIXME: We need a way to test this function on a live bugzilla
+        # instance.
+
+        self.authenticate()
+
+        if additional_comment_text:
+            comment_text += "\n\n%s" % additional_comment_text
+        log(comment_text)
+
+        if self.dryrun:
+            return
+
+        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
+        self.browser.select_form(nr=1)
+        self.browser.set_value(comment_text, name='comment', nr=0)
+        self._find_select_element_for_flag(flag_name).value = (flag_value,)
+        self.browser.submit()
+
+    # FIXME: All of these bug editing methods have a ridiculous amount of
+    # copy/paste code.
+
+    def obsolete_attachment(self, attachment_id, comment_text=None):
+        self.authenticate()
+
+        log("Obsoleting attachment: %s" % attachment_id)
+        if self.dryrun:
+            log(comment_text)
+            return
+
+        self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
+        self.browser.select_form(nr=1)
+        self.browser.find_control('isobsolete').items[0].selected = True
+        # Also clear any review flag (to remove it from review/commit queues)
+        self._find_select_element_for_flag('review').value = ("X",)
+        self._find_select_element_for_flag('commit-queue').value = ("X",)
+        if comment_text:
+            log(comment_text)
+            # Bugzilla has two textareas named 'comment', one is somehow
+            # hidden.  We want the first.
+            self.browser.set_value(comment_text, name='comment', nr=0)
+        self.browser.submit()
+
+    def add_cc_to_bug(self, bug_id, email_address_list):
+        self.authenticate()
+
+        log("Adding %s to the CC list for bug %s" % (email_address_list,
+                                                     bug_id))
+        if self.dryrun:
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        self.browser["newcc"] = ", ".join(email_address_list)
+        self.browser.submit()
+
+    def post_comment_to_bug(self, bug_id, comment_text, cc=None):
+        self.authenticate()
+
+        log("Adding comment to bug %s" % bug_id)
+        if self.dryrun:
+            log(comment_text)
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        self.browser["comment"] = comment_text
+        if cc:
+            self.browser["newcc"] = ", ".join(cc)
+        self.browser.submit()
+
+    def close_bug_as_fixed(self, bug_id, comment_text=None):
+        self.authenticate()
+
+        log("Closing bug %s as fixed" % bug_id)
+        if self.dryrun:
+            log(comment_text)
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        if comment_text:
+            log(comment_text)
+            self.browser['comment'] = comment_text
+        self.browser['bug_status'] = ['RESOLVED']
+        self.browser['resolution'] = ['FIXED']
+        self.browser.submit()
+
+    def reassign_bug(self, bug_id, assignee, comment_text=None):
+        self.authenticate()
+
+        log("Assigning bug %s to %s" % (bug_id, assignee))
+        if self.dryrun:
+            log(comment_text)
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        if comment_text:
+            log(comment_text)
+            self.browser["comment"] = comment_text
+        self.browser["assigned_to"] = assignee
+        self.browser.submit()
+
+    def reopen_bug(self, bug_id, comment_text):
+        self.authenticate()
+
+        log("Re-opening bug %s" % bug_id)
+        # Bugzilla requires a comment when re-opening a bug, so we know it will
+        # never be None.
+        log(comment_text)
+        if self.dryrun:
+            return
+
+        self.browser.open(self.bug_url_for_bug_id(bug_id))
+        self.browser.select_form(name="changeform")
+        bug_status = self.browser.find_control("bug_status", type="select")
+        # This is a hack around the fact that ClientForm.ListControl seems to
+        # have no simpler way to ask if a control has an item named "REOPENED"
+        # without using exceptions for control flow.
+        possible_bug_statuses = map(lambda item: item.name, bug_status.items)
+        if "REOPENED" in possible_bug_statuses:
+            bug_status.value = ["REOPENED"]
+        else:
+            log("Did not reopen bug %s.  " +
+                "It appears to already be open with status %s." % (
+                        bug_id, bug_status.value))
+        self.browser['comment'] = comment_text
+        self.browser.submit()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
new file mode 100644
index 0000000..4c44cdf
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
@@ -0,0 +1,347 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.config.committers import CommitterList, Reviewer, Committer
+from webkitpy.common.net.bugzilla import Bugzilla, BugzillaQueries, parse_bug_id, CommitterValidator, Bug
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+
+class MockBrowser(object):
+    def open(self, url):
+        pass
+
+    def select_form(self, name):
+        pass
+
+    def __setitem__(self, key, value):
+        pass
+
+    def submit(self):
+        pass
+
+
+class BugTest(unittest.TestCase):
+    def test_is_unassigned(self):
+        for email in Bug.unassigned_emails:
+            bug = Bug({"assigned_to_email" : email}, bugzilla=None)
+            self.assertTrue(bug.is_unassigned())
+        bug = Bug({"assigned_to_email" : "test@test.com"}, bugzilla=None)
+        self.assertFalse(bug.is_unassigned())
+
+
+class CommitterValidatorTest(unittest.TestCase):
+    def test_flag_permission_rejection_message(self):
+        validator = CommitterValidator(bugzilla=None)
+        self.assertEqual(validator._committers_py_path(), "WebKitTools/Scripts/webkitpy/common/config/committers.py")
+        expected_messsage="""foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  Due to bug 30084 the commit-queue will require a restart after your change.  Please contact eseidel@chromium.org to request a commit-queue restart.  After restart the commit-queue will correctly respect your review rights."""
+        self.assertEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage)
+
+
+class BugzillaTest(unittest.TestCase):
+    _example_attachment = '''
+        <attachment
+          isobsolete="1"
+          ispatch="1"
+          isprivate="0"
+        >
+        <attachid>33721</attachid>
+        <date>2009-07-29 10:23 PDT</date>
+        <desc>Fixed whitespace issue</desc>
+        <filename>patch</filename>
+        <type>text/plain</type>
+        <size>9719</size>
+        <attacher>christian.plesner.hansen@gmail.com</attacher>
+          <flag name="review"
+                id="17931"
+                status="+"
+                setter="one@test.com"
+           />
+          <flag name="commit-queue"
+                id="17932"
+                status="+"
+                setter="two@test.com"
+           />
+        </attachment>
+'''
+    _expected_example_attachment_parsing = {
+        'bug_id' : 100,
+        'is_obsolete' : True,
+        'is_patch' : True,
+        'id' : 33721,
+        'url' : "https://bugs.webkit.org/attachment.cgi?id=33721",
+        'name' : "Fixed whitespace issue",
+        'type' : "text/plain",
+        'review' : '+',
+        'reviewer_email' : 'one@test.com',
+        'commit-queue' : '+',
+        'committer_email' : 'two@test.com',
+        'attacher_email' : 'christian.plesner.hansen@gmail.com',
+    }
+
+    def test_url_creation(self):
+        # FIXME: These would be all better as doctests
+        bugs = Bugzilla()
+        self.assertEquals(None, bugs.bug_url_for_bug_id(None))
+        self.assertEquals(None, bugs.short_bug_url_for_bug_id(None))
+        self.assertEquals(None, bugs.attachment_url_for_id(None))
+
+    def test_parse_bug_id(self):
+        # FIXME: These would be all better as doctests
+        bugs = Bugzilla()
+        self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
+        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
+        self.assertEquals(12345, parse_bug_id(bugs.short_bug_url_for_bug_id(12345)))
+        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345)))
+        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))
+
+        # Our bug parser is super-fragile, but at least we're testing it.
+        self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345"))
+        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345"))
+
+    _example_bug = """
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/bugzilla.dtd">
+<bugzilla version="3.2.3"
+          urlbase="https://bugs.webkit.org/"
+          maintainer="admin@webkit.org"
+          exporter="eric@webkit.org"
+>
+    <bug>
+          <bug_id>32585</bug_id>
+          <creation_ts>2009-12-15 15:17 PST</creation_ts>
+          <short_desc>bug to test webkit-patch and commit-queue failures</short_desc>
+          <delta_ts>2009-12-27 21:04:50 PST</delta_ts>
+          <reporter_accessible>1</reporter_accessible>
+          <cclist_accessible>1</cclist_accessible>
+          <classification_id>1</classification_id>
+          <classification>Unclassified</classification>
+          <product>WebKit</product>
+          <component>Tools / Tests</component>
+          <version>528+ (Nightly build)</version>
+          <rep_platform>PC</rep_platform>
+          <op_sys>Mac OS X 10.5</op_sys>
+          <bug_status>NEW</bug_status>
+          <priority>P2</priority>
+          <bug_severity>Normal</bug_severity>
+          <target_milestone>---</target_milestone>
+          <everconfirmed>1</everconfirmed>
+          <reporter name="Eric Seidel">eric@webkit.org</reporter>
+          <assigned_to name="Nobody">webkit-unassigned@lists.webkit.org</assigned_to>
+          <cc>foo@bar.com</cc>
+    <cc>example@example.com</cc>
+          <long_desc isprivate="0">
+            <who name="Eric Seidel">eric@webkit.org</who>
+            <bug_when>2009-12-15 15:17:28 PST</bug_when>
+            <thetext>bug to test webkit-patch and commit-queue failures
+
+Ignore this bug.  Just for testing failure modes of webkit-patch and the commit-queue.</thetext>
+          </long_desc>
+          <attachment 
+              isobsolete="0"
+              ispatch="1"
+              isprivate="0"
+          > 
+            <attachid>45548</attachid> 
+            <date>2009-12-27 23:51 PST</date> 
+            <desc>Patch</desc> 
+            <filename>bug-32585-20091228005112.patch</filename> 
+            <type>text/plain</type> 
+            <size>10882</size> 
+            <attacher>mjs@apple.com</attacher> 
+            
+              <token>1261988248-dc51409e9c421a4358f365fa8bec8357</token> 
+              <data encoding="base64">SW5kZXg6IFdlYktpdC9tYWMvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
+removed-because-it-was-really-long
+ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
+</data>        
+ 
+              <flag name="review"
+                    id="27602"
+                    status="?"
+                    setter="mjs@apple.com"
+               /> 
+          </attachment> 
+    </bug>
+</bugzilla>
+"""
+    _expected_example_bug_parsing = {
+        "id" : 32585,
+        "title" : u"bug to test webkit-patch and commit-queue failures",
+        "cc_emails" : ["foo@bar.com", "example@example.com"],
+        "reporter_email" : "eric@webkit.org",
+        "assigned_to_email" : "webkit-unassigned@lists.webkit.org",
+        "attachments" : [{
+            'name': u'Patch',
+            'url' : "https://bugs.webkit.org/attachment.cgi?id=45548",
+            'is_obsolete': False,
+            'review': '?',
+            'is_patch': True,
+            'attacher_email': 'mjs@apple.com',
+            'bug_id': 32585,
+            'type': 'text/plain',
+            'id': 45548
+        }],
+    }
+
+    # FIXME: This should move to a central location and be shared by more unit tests.
+    def _assert_dictionaries_equal(self, actual, expected):
+        # Make sure we aren't parsing more or less than we expect
+        self.assertEquals(sorted(actual.keys()), sorted(expected.keys()))
+
+        for key, expected_value in expected.items():
+            self.assertEquals(actual[key], expected_value, ("Failure for key: %s: Actual='%s' Expected='%s'" % (key, actual[key], expected_value)))
+
+    def test_bug_parsing(self):
+        bug = Bugzilla()._parse_bug_page(self._example_bug)
+        self._assert_dictionaries_equal(bug, self._expected_example_bug_parsing)
+
+    # This could be combined into test_bug_parsing later if desired.
+    def test_attachment_parsing(self):
+        bugzilla = Bugzilla()
+        soup = BeautifulSoup(self._example_attachment)
+        attachment_element = soup.find("attachment")
+        attachment = bugzilla._parse_attachment_element(attachment_element, self._expected_example_attachment_parsing['bug_id'])
+        self.assertTrue(attachment)
+        self._assert_dictionaries_equal(attachment, self._expected_example_attachment_parsing)
+
+    _sample_attachment_detail_page = """
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                      "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <title>
+  Attachment 41073 Details for Bug 27314</title>
+<link rel="Top" href="https://bugs.webkit.org/">
+    <link rel="Up" href="show_bug.cgi?id=27314">
+"""
+
+    def test_attachment_detail_bug_parsing(self):
+        bugzilla = Bugzilla()
+        self.assertEquals(27314, bugzilla._parse_bug_id_from_attachment_page(self._sample_attachment_detail_page))
+
+    def test_add_cc_to_bug(self):
+        bugzilla = Bugzilla()
+        bugzilla.browser = MockBrowser()
+        bugzilla.authenticate = lambda: None
+        expected_stderr = "Adding ['adam@example.com'] to the CC list for bug 42\n"
+        OutputCapture().assert_outputs(self, bugzilla.add_cc_to_bug, [42, ["adam@example.com"]], expected_stderr=expected_stderr)
+
+
+class BugzillaQueriesTest(unittest.TestCase):
+    _sample_request_page = """
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                      "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <title>Request Queue</title>
+  </head>
+<body>
+
+<h3>Flag: review</h3>
+  <table class="requests" cellspacing="0" cellpadding="4" border="1">
+    <tr>
+        <th>Requester</th>
+        <th>Requestee</th>
+        <th>Bug</th>
+        <th>Attachment</th>
+        <th>Created</th>
+    </tr>
+    <tr>
+        <td>Shinichiro Hamaji &lt;hamaji&#64;chromium.org&gt;</td>
+        <td></td>
+        <td><a href="show_bug.cgi?id=30015">30015: text-transform:capitalize is failing in CSS2.1 test suite</a></td>
+        <td><a href="attachment.cgi?id=40511&amp;action=review">
+40511: Patch v0</a></td>
+        <td>2009-10-02 04:58 PST</td>
+    </tr>
+    <tr>
+        <td>Zan Dobersek &lt;zandobersek&#64;gmail.com&gt;</td>
+        <td></td>
+        <td><a href="show_bug.cgi?id=26304">26304: [GTK] Add controls for playing html5 video.</a></td>
+        <td><a href="attachment.cgi?id=40722&amp;action=review">
+40722: Media controls, the simple approach</a></td>
+        <td>2009-10-06 09:13 PST</td>
+    </tr>
+    <tr>
+        <td>Zan Dobersek &lt;zandobersek&#64;gmail.com&gt;</td>
+        <td></td>
+        <td><a href="show_bug.cgi?id=26304">26304: [GTK] Add controls for playing html5 video.</a></td>
+        <td><a href="attachment.cgi?id=40723&amp;action=review">
+40723: Adjust the media slider thumb size</a></td>
+        <td>2009-10-06 09:15 PST</td>
+    </tr>
+  </table>
+</body>
+</html>
+"""
+    _sample_quip_page = u"""
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+                      "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <title>Bugzilla Quip System</title>
+  </head>
+  <body>
+    <h2>
+
+      Existing quips:
+    </h2>
+    <ul>
+        <li>Everything should be made as simple as possible, but not simpler. - Albert Einstein</li>
+        <li>Good artists copy. Great artists steal. - Pablo Picasso</li>
+        <li>\u00e7gua mole em pedra dura, tanto bate at\u008e que fura.</li>
+
+    </ul>
+  </body>
+</html>
+"""
+
+    def test_request_page_parsing(self):
+        queries = BugzillaQueries(None)
+        self.assertEquals([40511, 40722, 40723], queries._parse_attachment_ids_request_query(self._sample_request_page))
+
+    def test_quip_page_parsing(self):
+        queries = BugzillaQueries(None)
+        expected_quips = ["Everything should be made as simple as possible, but not simpler. - Albert Einstein", "Good artists copy. Great artists steal. - Pablo Picasso", u"\u00e7gua mole em pedra dura, tanto bate at\u008e que fura."]
+        self.assertEquals(expected_quips, queries._parse_quips(self._sample_quip_page))
+
+    def test_load_query(self):
+        queries = BugzillaQueries(Mock())
+        queries._load_query("request.cgi?action=queue&type=review&group=type")
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
new file mode 100644
index 0000000..753e909
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -0,0 +1,495 @@
+# Copyright (c) 2009, 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.
+#
+# WebKit's Python module for interacting with WebKit's buildbot
+
+import operator
+import re
+import urllib
+import urllib2
+import xmlrpclib
+
+from webkitpy.common.system.logutils import get_logger
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+
+_log = get_logger(__file__)
+
+
+class Builder(object):
+    def __init__(self, name, buildbot):
+        self._name = unicode(name)
+        self._buildbot = buildbot
+        self._builds_cache = {}
+        self._revision_to_build_number = None
+        self._browser = Browser()
+        self._browser.set_handle_robots(False) # The builder pages are excluded by robots.txt
+
+    def name(self):
+        return self._name
+
+    def results_url(self):
+        return "http://%s/results/%s" % (self._buildbot.buildbot_host, self.url_encoded_name())
+
+    def url_encoded_name(self):
+        return urllib.quote(self._name)
+
+    def url(self):
+        return "http://%s/builders/%s" % (self._buildbot.buildbot_host, self.url_encoded_name())
+
+    # This provides a single place to mock
+    def _fetch_build(self, build_number):
+        build_dictionary = self._buildbot._fetch_xmlrpc_build_dictionary(self, build_number)
+        if not build_dictionary:
+            return None
+        return Build(self,
+            build_number=int(build_dictionary['number']),
+            revision=int(build_dictionary['revision']),
+            is_green=(build_dictionary['results'] == 0) # Undocumented, buildbot XMLRPC, 0 seems to mean "pass"
+        )
+
+    def build(self, build_number):
+        if not build_number:
+            return None
+        cached_build = self._builds_cache.get(build_number)
+        if cached_build:
+            return cached_build
+
+        build = self._fetch_build(build_number)
+        self._builds_cache[build_number] = build
+        return build
+
+    def force_build(self, username="webkit-patch", comments=None):
+        def predicate(form):
+            try:
+                return form.find_control("username")
+            except Exception, e:
+                return False
+        self._browser.open(self.url())
+        self._browser.select_form(predicate=predicate)
+        self._browser["username"] = username
+        if comments:
+            self._browser["comments"] = comments
+        return self._browser.submit()
+
+    file_name_regexp = re.compile(r"r(?P<revision>\d+) \((?P<build_number>\d+)\)")
+    def _revision_and_build_for_filename(self, filename):
+        # Example: "r47483 (1)/" or "r47483 (1).zip"
+        match = self.file_name_regexp.match(filename)
+        return (int(match.group("revision")), int(match.group("build_number")))
+
+    def _fetch_revision_to_build_map(self):
+        # All _fetch requests go through _buildbot for easier mocking
+        try:
+            # FIXME: This method is horribly slow due to the huge network load.
+            # FIXME: This is a poor way to do revision -> build mapping.
+            # Better would be to ask buildbot through some sort of API.
+            print "Loading revision/build list from %s." % self.results_url()
+            print "This may take a while..."
+            result_files = self._buildbot._fetch_twisted_directory_listing(self.results_url())
+        except urllib2.HTTPError, error:
+            if error.code != 404:
+                raise
+            result_files = []
+
+        # This assumes there was only one build per revision, which is false but we don't care for now.
+        return dict([self._revision_and_build_for_filename(file_info["filename"]) for file_info in result_files])
+
+    def _revision_to_build_map(self):
+        if not self._revision_to_build_number:
+            self._revision_to_build_number = self._fetch_revision_to_build_map()
+        return self._revision_to_build_number
+
+    def revision_build_pairs_with_results(self):
+        return self._revision_to_build_map().items()
+
+    # This assumes there can be only one build per revision, which is false, but we don't care for now.
+    def build_for_revision(self, revision, allow_failed_lookups=False):
+        # NOTE: This lookup will fail if that exact revision was never built.
+        build_number = self._revision_to_build_map().get(int(revision))
+        if not build_number:
+            return None
+        build = self.build(build_number)
+        if not build and allow_failed_lookups:
+            # Builds for old revisions with fail to lookup via buildbot's xmlrpc api.
+            build = Build(self,
+                build_number=build_number,
+                revision=revision,
+                is_green=False,
+            )
+        return build
+
+    def find_failure_transition(self, red_build, look_back_limit=30):
+        if not red_build or red_build.is_green():
+            return (None, None)
+        common_failures = None
+        current_build = red_build
+        build_after_current_build = None
+        look_back_count = 0
+        while current_build:
+            if current_build.is_green():
+                # current_build can't possibly have any failures in common
+                # with red_build because it's green.
+                break
+            results = current_build.layout_test_results()
+            # We treat a lack of results as if all the test failed.
+            # This occurs, for example, when we can't compile at all.
+            if results:
+                failures = set(results.failing_tests())
+                if common_failures == None:
+                    common_failures = failures
+                common_failures = common_failures.intersection(failures)
+                if not common_failures:
+                    # current_build doesn't have any failures in common with
+                    # the red build we're worried about.  We assume that any
+                    # failures in current_build were due to flakiness.
+                    break
+            look_back_count += 1
+            if look_back_count > look_back_limit:
+                return (None, current_build)
+            build_after_current_build = current_build
+            current_build = current_build.previous_build()
+        # We must iterate at least once because red_build is red.
+        assert(build_after_current_build)
+        # Current build must either be green or have no failures in common
+        # with red build, so we've found our failure transition.
+        return (current_build, build_after_current_build)
+
+    # FIXME: This likely does not belong on Builder
+    def suspect_revisions_for_transition(self, last_good_build, first_bad_build):
+        suspect_revisions = range(first_bad_build.revision(),
+                                  last_good_build.revision(),
+                                  -1)
+        suspect_revisions.reverse()
+        return suspect_revisions
+
+    def blameworthy_revisions(self, red_build_number, look_back_limit=30, avoid_flakey_tests=True):
+        red_build = self.build(red_build_number)
+        (last_good_build, first_bad_build) = \
+            self.find_failure_transition(red_build, look_back_limit)
+        if not last_good_build:
+            return [] # We ran off the limit of our search
+        # If avoid_flakey_tests, require at least 2 bad builds before we
+        # suspect a real failure transition.
+        if avoid_flakey_tests and first_bad_build == red_build:
+            return []
+        return self.suspect_revisions_for_transition(last_good_build, first_bad_build)
+
+
+# FIXME: This should be unified with all the layout test results code in the layout_tests package
+class LayoutTestResults(object):
+    stderr_key = u'Tests that had stderr output:'
+    fail_key = u'Tests where results did not match expected results:'
+    timeout_key = u'Tests that timed out:'
+    crash_key = u'Tests that caused the DumpRenderTree tool to crash:'
+    missing_key = u'Tests that had no expected results (probably new):'
+
+    expected_keys = [
+        stderr_key,
+        fail_key,
+        crash_key,
+        timeout_key,
+        missing_key,
+    ]
+
+    @classmethod
+    def _parse_results_html(cls, page):
+        parsed_results = {}
+        tables = BeautifulSoup(page).findAll("table")
+        for table in tables:
+            table_title = table.findPreviousSibling("p").string
+            if table_title not in cls.expected_keys:
+                # This Exception should only ever be hit if run-webkit-tests changes its results.html format.
+                raise Exception("Unhandled title: %s" % str(table_title))
+            # We might want to translate table titles into identifiers before storing.
+            parsed_results[table_title] = [row.find("a").string for row in table.findAll("tr")]
+
+        return parsed_results
+
+    @classmethod
+    def _fetch_results_html(cls, base_url):
+        results_html = "%s/results.html" % base_url
+        # FIXME: We need to move this sort of 404 logic into NetworkTransaction or similar.
+        try:
+            page = urllib2.urlopen(results_html)
+            return cls._parse_results_html(page)
+        except urllib2.HTTPError, error:
+            if error.code != 404:
+                raise
+
+    @classmethod
+    def results_from_url(cls, base_url):
+        parsed_results = cls._fetch_results_html(base_url)
+        if not parsed_results:
+            return None
+        return cls(base_url, parsed_results)
+
+    def __init__(self, base_url, parsed_results):
+        self._base_url = base_url
+        self._parsed_results = parsed_results
+
+    def parsed_results(self):
+        return self._parsed_results
+
+    def failing_tests(self):
+        failing_keys = [self.fail_key, self.crash_key, self.timeout_key]
+        return sorted(sum([tests for key, tests in self._parsed_results.items() if key in failing_keys], []))
+
+
+class Build(object):
+    def __init__(self, builder, build_number, revision, is_green):
+        self._builder = builder
+        self._number = build_number
+        self._revision = revision
+        self._is_green = is_green
+        self._layout_test_results = None
+
+    @staticmethod
+    def build_url(builder, build_number):
+        return "%s/builds/%s" % (builder.url(), build_number)
+
+    def url(self):
+        return self.build_url(self.builder(), self._number)
+
+    def results_url(self):
+        results_directory = "r%s (%s)" % (self.revision(), self._number)
+        return "%s/%s" % (self._builder.results_url(), urllib.quote(results_directory))
+
+    def layout_test_results(self):
+        if not self._layout_test_results:
+            self._layout_test_results = LayoutTestResults.results_from_url(self.results_url())
+        return self._layout_test_results
+
+    def builder(self):
+        return self._builder
+
+    def revision(self):
+        return self._revision
+
+    def is_green(self):
+        return self._is_green
+
+    def previous_build(self):
+        # previous_build() allows callers to avoid assuming build numbers are sequential.
+        # They may not be sequential across all master changes, or when non-trunk builds are made.
+        return self._builder.build(self._number - 1)
+
+
+class BuildBot(object):
+    # FIXME: This should move into some sort of webkit_config.py
+    default_host = "build.webkit.org"
+
+    def __init__(self, host=default_host):
+        self.buildbot_host = host
+        self._builder_by_name = {}
+
+        # If any core builder is red we should not be landing patches.  Other
+        # builders should be added to this list once they are known to be
+        # reliable.
+        # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
+        self.core_builder_names_regexps = [
+            "SnowLeopard.*Build",
+            "SnowLeopard.*Test",
+            "Leopard",
+            "Tiger",
+            "Windows.*Build",
+            "Windows.*Debug.*Test",
+            "GTK",
+            "Qt",
+            "Chromium",
+        ]
+
+    def _parse_last_build_cell(self, builder, cell):
+        status_link = cell.find('a')
+        if status_link:
+            # Will be either a revision number or a build number
+            revision_string = status_link.string
+            # If revision_string has non-digits assume it's not a revision number.
+            builder['built_revision'] = int(revision_string) \
+                                        if not re.match('\D', revision_string) \
+                                        else None
+            builder['is_green'] = not re.search('fail', cell.renderContents())
+
+            status_link_regexp = r"builders/(?P<builder_name>.*)/builds/(?P<build_number>\d+)"
+            link_match = re.match(status_link_regexp, status_link['href'])
+            builder['build_number'] = int(link_match.group("build_number"))
+        else:
+            # We failed to find a link in the first cell, just give up.  This
+            # can happen if a builder is just-added, the first cell will just
+            # be "no build"
+            # Other parts of the code depend on is_green being present.
+            builder['is_green'] = False
+            builder['built_revision'] = None
+            builder['build_number'] = None
+
+    def _parse_current_build_cell(self, builder, cell):
+        activity_lines = cell.renderContents().split("<br />")
+        builder["activity"] = activity_lines[0] # normally "building" or "idle"
+        # The middle lines document how long left for any current builds.
+        match = re.match("(?P<pending_builds>\d) pending", activity_lines[-1])
+        builder["pending_builds"] = int(match.group("pending_builds")) if match else 0
+
+    def _parse_builder_status_from_row(self, status_row):
+        status_cells = status_row.findAll('td')
+        builder = {}
+
+        # First cell is the name
+        name_link = status_cells[0].find('a')
+        builder["name"] = name_link.string
+
+        self._parse_last_build_cell(builder, status_cells[1])
+        self._parse_current_build_cell(builder, status_cells[2])
+        return builder
+
+    def _matches_regexps(self, builder_name, name_regexps):
+        for name_regexp in name_regexps:
+            if re.match(name_regexp, builder_name):
+                return True
+        return False
+
+    # FIXME: Should move onto Builder
+    def _is_core_builder(self, builder_name):
+        return self._matches_regexps(builder_name, self.core_builder_names_regexps)
+
+    # FIXME: This method needs to die, but is used by a unit test at the moment.
+    def _builder_statuses_with_names_matching_regexps(self, builder_statuses, name_regexps):
+        return [builder for builder in builder_statuses if self._matches_regexps(builder["name"], name_regexps)]
+
+    def red_core_builders(self):
+        return [builder for builder in self.core_builder_statuses() if not builder["is_green"]]
+
+    def red_core_builders_names(self):
+        return [builder["name"] for builder in self.red_core_builders()]
+
+    def idle_red_core_builders(self):
+        return [builder for builder in self.red_core_builders() if builder["activity"] == "idle"]
+
+    def core_builders_are_green(self):
+        return not self.red_core_builders()
+
+    # FIXME: These _fetch methods should move to a networking class.
+    def _fetch_xmlrpc_build_dictionary(self, builder, build_number):
+        # The buildbot XMLRPC API is super-limited.
+        # For one, you cannot fetch info on builds which are incomplete.
+        proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host, allow_none=True)
+        try:
+            return proxy.getBuild(builder.name(), int(build_number))
+        except xmlrpclib.Fault, err:
+            build_url = Build.build_url(builder, build_number)
+            _log.error("Error fetching data for %s build %s (%s): %s" % (builder.name(), build_number, build_url, err))
+            return None
+
+    def _fetch_one_box_per_builder(self):
+        build_status_url = "http://%s/one_box_per_builder" % self.buildbot_host
+        return urllib2.urlopen(build_status_url)
+
+    def _parse_twisted_file_row(self, file_row):
+        string_or_empty = lambda string: str(string) if string else ""
+        file_cells = file_row.findAll('td')
+        return {
+            "filename" : string_or_empty(file_cells[0].find("a").string),
+            "size" : string_or_empty(file_cells[1].string),
+            "type" : string_or_empty(file_cells[2].string),
+            "encoding" : string_or_empty(file_cells[3].string),
+        }
+
+    def _parse_twisted_directory_listing(self, page):
+        soup = BeautifulSoup(page)
+        # HACK: Match only table rows with a class to ignore twisted header/footer rows.
+        file_rows = soup.find('table').findAll('tr', { "class" : True })
+        return [self._parse_twisted_file_row(file_row) for file_row in file_rows]
+
+    # FIXME: There should be a better way to get this information directly from twisted.
+    def _fetch_twisted_directory_listing(self, url):
+        return self._parse_twisted_directory_listing(urllib2.urlopen(url))
+
+    def builders(self):
+        return [self.builder_with_name(status["name"]) for status in self.builder_statuses()]
+
+    # This method pulls from /one_box_per_builder as an efficient way to get information about
+    def builder_statuses(self):
+        soup = BeautifulSoup(self._fetch_one_box_per_builder())
+        return [self._parse_builder_status_from_row(status_row) for status_row in soup.find('table').findAll('tr')]
+
+    def core_builder_statuses(self):
+        return [builder for builder in self.builder_statuses() if self._is_core_builder(builder["name"])]
+
+    def builder_with_name(self, name):
+        builder = self._builder_by_name.get(name)
+        if not builder:
+            builder = Builder(name, self)
+            self._builder_by_name[name] = builder
+        return builder
+
+    def revisions_causing_failures(self, only_core_builders=True):
+        builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+        revision_to_failing_bots = {}
+        for builder_status in builder_statuses:
+            if builder_status["is_green"]:
+                continue
+            builder = self.builder_with_name(builder_status["name"])
+            revisions = builder.blameworthy_revisions(builder_status["build_number"])
+            for revision in revisions:
+                failing_bots = revision_to_failing_bots.get(revision, [])
+                failing_bots.append(builder)
+                revision_to_failing_bots[revision] = failing_bots
+        return revision_to_failing_bots
+
+    # This makes fewer requests than calling Builder.latest_build would.  It grabs all builder
+    # statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
+    def _latest_builds_from_builders(self, only_core_builders=True):
+        builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+        return [self.builder_with_name(status["name"]).build(status["build_number"]) for status in builder_statuses]
+
+    def _build_at_or_before_revision(self, build, revision):
+        while build:
+            if build.revision() <= revision:
+                return build
+            build = build.previous_build()
+
+    def last_green_revision(self, only_core_builders=True):
+        builds = self._latest_builds_from_builders(only_core_builders)
+        target_revision = builds[0].revision()
+        # An alternate way to do this would be to start at one revision and walk backwards
+        # checking builder.build_for_revision, however build_for_revision is very slow on first load.
+        while True:
+            # Make builds agree on revision
+            builds = [self._build_at_or_before_revision(build, target_revision) for build in builds]
+            if None in builds: # One of the builds failed to load from the server.
+                return None
+            min_revision = min(map(lambda build: build.revision(), builds))
+            if min_revision != target_revision:
+                target_revision = min_revision
+                continue # Builds don't all agree on revision, keep searching
+            # Check to make sure they're all green
+            all_are_green = reduce(operator.and_, map(lambda build: build.is_green(), builds))
+            if not all_are_green:
+                target_revision -= 1
+                continue
+            return min_revision
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
new file mode 100644
index 0000000..f765f6e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -0,0 +1,433 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.net.buildbot import BuildBot, Builder, Build, LayoutTestResults
+
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+
+class BuilderTest(unittest.TestCase):
+    def _install_fetch_build(self, failure):
+        def _mock_fetch_build(build_number):
+            build = Build(
+                builder=self.builder,
+                build_number=build_number,
+                revision=build_number + 1000,
+                is_green=build_number < 4
+            )
+            build._layout_test_results = LayoutTestResults(
+                "http://buildbot.example.com/foo", {
+                    LayoutTestResults.fail_key: failure(build_number),
+                })
+            return build
+        self.builder._fetch_build = _mock_fetch_build
+
+    def setUp(self):
+        self.buildbot = BuildBot()
+        self.builder = Builder("Test Builder", self.buildbot)
+        self._install_fetch_build(lambda build_number: ["test1", "test2"])
+
+    def test_find_failure_transition(self):
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build.revision(), 1003)
+        self.assertEqual(red_build.revision(), 1004)
+
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10), look_back_limit=2)
+        self.assertEqual(green_build, None)
+        self.assertEqual(red_build.revision(), 1008)
+
+    def test_none_build(self):
+        self.builder._fetch_build = lambda build_number: None
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build, None)
+        self.assertEqual(red_build, None)
+
+    def test_flaky_tests(self):
+        self._install_fetch_build(lambda build_number: ["test1"] if build_number % 2 else ["test2"])
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build.revision(), 1009)
+        self.assertEqual(red_build.revision(), 1010)
+
+    def test_failure_and_flaky(self):
+        self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build.revision(), 1003)
+        self.assertEqual(red_build.revision(), 1004)
+
+    def test_no_results(self):
+        self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build.revision(), 1003)
+        self.assertEqual(red_build.revision(), 1004)
+
+    def test_failure_after_flaky(self):
+        self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number > 6 else ["test3"])
+        (green_build, red_build) = self.builder.find_failure_transition(self.builder.build(10))
+        self.assertEqual(green_build.revision(), 1006)
+        self.assertEqual(red_build.revision(), 1007)
+
+    def test_blameworthy_revisions(self):
+        self.assertEqual(self.builder.blameworthy_revisions(10), [1004])
+        self.assertEqual(self.builder.blameworthy_revisions(10, look_back_limit=2), [])
+        # Flakey test avoidance requires at least 2 red builds:
+        self.assertEqual(self.builder.blameworthy_revisions(4), [])
+        self.assertEqual(self.builder.blameworthy_revisions(4, avoid_flakey_tests=False), [1004])
+        # Green builder:
+        self.assertEqual(self.builder.blameworthy_revisions(3), [])
+
+    def test_build_caching(self):
+        self.assertEqual(self.builder.build(10), self.builder.build(10))
+
+    def test_build_and_revision_for_filename(self):
+        expectations = {
+            "r47483 (1)/" : (47483, 1),
+            "r47483 (1).zip" : (47483, 1),
+        }
+        for filename, revision_and_build in expectations.items():
+            self.assertEqual(self.builder._revision_and_build_for_filename(filename), revision_and_build)
+
+
+class LayoutTestResultsTest(unittest.TestCase):
+    _example_results_html = """
+<html>
+<head>
+<title>Layout Test Results</title>
+</head>
+<body>
+<p>Tests that had stderr output:</p>
+<table>
+<tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/accessibility/aria-activedescendant-crash.html">accessibility/aria-activedescendant-crash.html</a></td>
+<td><a href="accessibility/aria-activedescendant-crash-stderr.txt">stderr</a></td>
+</tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/http/tests/security/canvas-remote-read-svg-image.html">http/tests/security/canvas-remote-read-svg-image.html</a></td>
+<td><a href="http/tests/security/canvas-remote-read-svg-image-stderr.txt">stderr</a></td>
+</tr>
+</table><p>Tests that had no expected results (probably new):</p>
+<table>
+<tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/fast/repaint/no-caret-repaint-in-non-content-editable-element.html">fast/repaint/no-caret-repaint-in-non-content-editable-element.html</a></td>
+<td><a href="fast/repaint/no-caret-repaint-in-non-content-editable-element-actual.txt">result</a></td>
+</tr>
+</table></body>
+</html>
+"""
+
+    _expected_layout_test_results = {
+        'Tests that had stderr output:' : [
+            'accessibility/aria-activedescendant-crash.html'
+        ],
+        'Tests that had no expected results (probably new):' : [
+            'fast/repaint/no-caret-repaint-in-non-content-editable-element.html'
+        ]
+    }
+    def test_parse_layout_test_results(self):
+        results = LayoutTestResults._parse_results_html(self._example_results_html)
+        self.assertEqual(self._expected_layout_test_results, results)
+
+
+class BuildBotTest(unittest.TestCase):
+
+    _example_one_box_status = '''
+    <table>
+    <tr>
+    <td class="box"><a href="builders/Windows%20Debug%20%28Tests%29">Windows Debug (Tests)</a></td>
+      <td align="center" class="LastBuild box success"><a href="builders/Windows%20Debug%20%28Tests%29/builds/3693">47380</a><br />build<br />successful</td>
+      <td align="center" class="Activity building">building<br />ETA in<br />~ 14 mins<br />at 13:40</td>
+    <tr>
+    <td class="box"><a href="builders/SnowLeopard%20Intel%20Release">SnowLeopard Intel Release</a></td>
+      <td class="LastBuild box" >no build</td>
+      <td align="center" class="Activity building">building<br />< 1 min</td>
+    <tr>
+    <td class="box"><a href="builders/Qt%20Linux%20Release">Qt Linux Release</a></td>
+      <td align="center" class="LastBuild box failure"><a href="builders/Qt%20Linux%20Release/builds/654">47383</a><br />failed<br />compile-webkit</td>
+      <td align="center" class="Activity idle">idle<br />3 pending</td>
+    </table>
+'''
+    _expected_example_one_box_parsings = [
+        {
+            'is_green': True,
+            'build_number' : 3693,
+            'name': u'Windows Debug (Tests)',
+            'built_revision': 47380,
+            'activity': 'building',
+            'pending_builds': 0,
+        },
+        {
+            'is_green': False,
+            'build_number' : None,
+            'name': u'SnowLeopard Intel Release',
+            'built_revision': None,
+            'activity': 'building',
+            'pending_builds': 0,
+        },
+        {
+            'is_green': False,
+            'build_number' : 654,
+            'name': u'Qt Linux Release',
+            'built_revision': 47383,
+            'activity': 'idle',
+            'pending_builds': 3,
+        },
+    ]
+
+    def test_status_parsing(self):
+        buildbot = BuildBot()
+
+        soup = BeautifulSoup(self._example_one_box_status)
+        status_table = soup.find("table")
+        input_rows = status_table.findAll('tr')
+
+        for x in range(len(input_rows)):
+            status_row = input_rows[x]
+            expected_parsing = self._expected_example_one_box_parsings[x]
+
+            builder = buildbot._parse_builder_status_from_row(status_row)
+
+            # Make sure we aren't parsing more or less than we expect
+            self.assertEquals(builder.keys(), expected_parsing.keys())
+
+            for key, expected_value in expected_parsing.items():
+                self.assertEquals(builder[key], expected_value, ("Builder %d parse failure for key: %s: Actual='%s' Expected='%s'" % (x, key, builder[key], expected_value)))
+
+    def test_core_builder_methods(self):
+        buildbot = BuildBot()
+
+        # Override builder_statuses function to not touch the network.
+        def example_builder_statuses(): # We could use instancemethod() to bind 'self' but we don't need to.
+            return BuildBotTest._expected_example_one_box_parsings
+        buildbot.builder_statuses = example_builder_statuses
+
+        buildbot.core_builder_names_regexps = [ 'Leopard', "Windows.*Build" ]
+        self.assertEquals(buildbot.red_core_builders_names(), [])
+        self.assertTrue(buildbot.core_builders_are_green())
+
+        buildbot.core_builder_names_regexps = [ 'SnowLeopard', 'Qt' ]
+        self.assertEquals(buildbot.red_core_builders_names(), [ u'SnowLeopard Intel Release', u'Qt Linux Release' ])
+        self.assertFalse(buildbot.core_builders_are_green())
+
+    def test_builder_name_regexps(self):
+        buildbot = BuildBot()
+
+        # For complete testing, this list should match the list of builders at build.webkit.org:
+        example_builders = [
+            {'name': u'Tiger Intel Release', },
+            {'name': u'Leopard Intel Release (Build)', },
+            {'name': u'Leopard Intel Release (Tests)', },
+            {'name': u'Leopard Intel Debug (Build)', },
+            {'name': u'Leopard Intel Debug (Tests)', },
+            {'name': u'SnowLeopard Intel Release (Build)', },
+            {'name': u'SnowLeopard Intel Release (Tests)', },
+            {'name': u'SnowLeopard Intel Leaks', },
+            {'name': u'Windows Release (Build)', },
+            {'name': u'Windows Release (Tests)', },
+            {'name': u'Windows Debug (Build)', },
+            {'name': u'Windows Debug (Tests)', },
+            {'name': u'GTK Linux 32-bit Release', },
+            {'name': u'GTK Linux 32-bit Debug', },
+            {'name': u'GTK Linux 64-bit Debug', },
+            {'name': u'GTK Linux 64-bit Release', },
+            {'name': u'Qt Linux Release', },
+            {'name': u'Qt Linux Release minimal', },
+            {'name': u'Qt Linux ARMv5 Release', },
+            {'name': u'Qt Linux ARMv7 Release', },
+            {'name': u'Qt Windows 32-bit Release', },
+            {'name': u'Qt Windows 32-bit Debug', },
+            {'name': u'Chromium Linux Release', },
+            {'name': u'Chromium Mac Release', },
+            {'name': u'Chromium Win Release', },
+            {'name': u'New run-webkit-tests', },
+        ]
+        name_regexps = [
+            "SnowLeopard.*Build",
+            "SnowLeopard.*Test",
+            "Leopard",
+            "Tiger",
+            "Windows.*Build",
+            "Windows.*Debug.*Test",
+            "GTK",
+            "Qt",
+            "Chromium",
+        ]
+        expected_builders = [
+            {'name': u'Tiger Intel Release', },
+            {'name': u'Leopard Intel Release (Build)', },
+            {'name': u'Leopard Intel Release (Tests)', },
+            {'name': u'Leopard Intel Debug (Build)', },
+            {'name': u'Leopard Intel Debug (Tests)', },
+            {'name': u'SnowLeopard Intel Release (Build)', },
+            {'name': u'SnowLeopard Intel Release (Tests)', },
+            {'name': u'Windows Release (Build)', },
+            {'name': u'Windows Debug (Build)', },
+            {'name': u'Windows Debug (Tests)', },
+            {'name': u'GTK Linux 32-bit Release', },
+            {'name': u'GTK Linux 32-bit Debug', },
+            {'name': u'GTK Linux 64-bit Debug', },
+            {'name': u'GTK Linux 64-bit Release', },
+            {'name': u'Qt Linux Release', },
+            {'name': u'Qt Linux Release minimal', },
+            {'name': u'Qt Linux ARMv5 Release', },
+            {'name': u'Qt Linux ARMv7 Release', },
+            {'name': u'Qt Windows 32-bit Release', },
+            {'name': u'Qt Windows 32-bit Debug', },
+            {'name': u'Chromium Linux Release', },
+            {'name': u'Chromium Mac Release', },
+            {'name': u'Chromium Win Release', },
+        ]
+
+        # This test should probably be updated if the default regexp list changes
+        self.assertEquals(buildbot.core_builder_names_regexps, name_regexps)
+
+        builders = buildbot._builder_statuses_with_names_matching_regexps(example_builders, name_regexps)
+        self.assertEquals(builders, expected_builders)
+
+    def test_builder_with_name(self):
+        buildbot = BuildBot()
+
+        builder = buildbot.builder_with_name("Test Builder")
+        self.assertEqual(builder.name(), "Test Builder")
+        self.assertEqual(builder.url(), "http://build.webkit.org/builders/Test%20Builder")
+        self.assertEqual(builder.url_encoded_name(), "Test%20Builder")
+        self.assertEqual(builder.results_url(), "http://build.webkit.org/results/Test%20Builder")
+
+        # Override _fetch_xmlrpc_build_dictionary function to not touch the network.
+        def mock_fetch_xmlrpc_build_dictionary(self, build_number):
+            build_dictionary = {
+                "revision" : 2 * build_number,
+                "number" : int(build_number),
+                "results" : build_number % 2, # 0 means pass
+            }
+            return build_dictionary
+        buildbot._fetch_xmlrpc_build_dictionary = mock_fetch_xmlrpc_build_dictionary
+
+        build = builder.build(10)
+        self.assertEqual(build.builder(), builder)
+        self.assertEqual(build.url(), "http://build.webkit.org/builders/Test%20Builder/builds/10")
+        self.assertEqual(build.results_url(), "http://build.webkit.org/results/Test%20Builder/r20%20%2810%29")
+        self.assertEqual(build.revision(), 20)
+        self.assertEqual(build.is_green(), True)
+
+        build = build.previous_build()
+        self.assertEqual(build.builder(), builder)
+        self.assertEqual(build.url(), "http://build.webkit.org/builders/Test%20Builder/builds/9")
+        self.assertEqual(build.results_url(), "http://build.webkit.org/results/Test%20Builder/r18%20%289%29")
+        self.assertEqual(build.revision(), 18)
+        self.assertEqual(build.is_green(), False)
+
+        self.assertEqual(builder.build(None), None)
+
+    _example_directory_listing = '''
+<h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1>
+
+<table>
+    <thead>
+        <tr>
+            <th>Filename</th>
+            <th>Size</th>
+            <th>Content type</th>
+            <th>Content encoding</th>
+        </tr>
+    </thead>
+    <tbody>
+<tr class="odd">
+    <td><a href="r47483%20%281%29/">r47483 (1)/</a></td>
+    <td></td>
+    <td>[Directory]</td>
+    <td></td>
+</tr>
+<tr class="odd">
+    <td><a href="r47484%20%282%29.zip">r47484 (2).zip</a></td>
+    <td>89K</td>
+    <td>[application/zip]</td>
+    <td></td>
+</tr>
+'''
+    _expected_files = [
+        {
+            "filename" : "r47483 (1)/",
+            "size" : "",
+            "type" : "[Directory]",
+            "encoding" : "",
+        },
+        {
+            "filename" : "r47484 (2).zip",
+            "size" : "89K",
+            "type" : "[application/zip]",
+            "encoding" : "",
+        },
+    ]
+
+    def test_parse_build_to_revision_map(self):
+        buildbot = BuildBot()
+        files = buildbot._parse_twisted_directory_listing(self._example_directory_listing)
+        self.assertEqual(self._expected_files, files)
+
+    # Revision, is_green
+    # Ordered from newest (highest number) to oldest.
+    fake_builder1 = [
+        [2, False],
+        [1, True],
+    ]
+    fake_builder2 = [
+        [2, False],
+        [1, True],
+    ]
+    fake_builders = [
+        fake_builder1,
+        fake_builder2,
+    ]
+    def _build_from_fake(self, fake_builder, index):
+        if index >= len(fake_builder):
+            return None
+        fake_build = fake_builder[index]
+        build = Build(
+            builder=fake_builder,
+            build_number=index,
+            revision=fake_build[0],
+            is_green=fake_build[1],
+        )
+        def mock_previous_build():
+            return self._build_from_fake(fake_builder, index + 1)
+        build.previous_build = mock_previous_build
+        return build
+
+    def _fake_builds_at_index(self, index):
+        return [self._build_from_fake(builder, index) for builder in self.fake_builders]
+
+    def test_last_green_revision(self):
+        buildbot = BuildBot()
+        def mock_builds_from_builders(only_core_builders):
+            return self._fake_builds_at_index(0)
+        buildbot._latest_builds_from_builders = mock_builds_from_builders
+        self.assertEqual(buildbot.last_green_revision(), 1)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials.py b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
new file mode 100644
index 0000000..1d5f83d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
@@ -0,0 +1,126 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+#     * 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.
+#
+# Python module for reading stored web credentials from the OS.
+
+import getpass
+import os
+import platform
+import re
+
+from webkitpy.common.checkout.scm import Git
+from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system.user import User
+from webkitpy.common.system.deprecated_logging import log
+
+
+class Credentials(object):
+
+    def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd()):
+        self.host = host
+        self.git_prefix = "%s." % git_prefix if git_prefix else ""
+        self.executive = executive or Executive()
+        self.cwd = cwd
+
+    def _credentials_from_git(self):
+        return [Git.read_git_config(self.git_prefix + "username"),
+                Git.read_git_config(self.git_prefix + "password")]
+
+    def _keychain_value_with_label(self, label, source_text):
+        match = re.search("%s\"(?P<value>.+)\"" % label,
+                                                  source_text,
+                                                  re.MULTILINE)
+        if match:
+            return match.group('value')
+
+    def _is_mac_os_x(self):
+        return platform.mac_ver()[0]
+
+    def _parse_security_tool_output(self, security_output):
+        username = self._keychain_value_with_label("^\s*\"acct\"<blob>=",
+                                                   security_output)
+        password = self._keychain_value_with_label("^password: ",
+                                                   security_output)
+        return [username, password]
+
+    def _run_security_tool(self, username=None):
+        security_command = [
+            "/usr/bin/security",
+            "find-internet-password",
+            "-g",
+            "-s",
+            self.host,
+        ]
+        if username:
+            security_command += ["-a", username]
+
+        log("Reading Keychain for %s account and password.  "
+            "Click \"Allow\" to continue..." % self.host)
+        try:
+            return self.executive.run_command(security_command)
+        except ScriptError:
+            # Failed to either find a keychain entry or somekind of OS-related
+            # error occured (for instance, couldn't find the /usr/sbin/security
+            # command).
+            log("Could not find a keychain entry for %s." % self.host)
+            return None
+
+    def _credentials_from_keychain(self, username=None):
+        if not self._is_mac_os_x():
+            return [username, None]
+
+        security_output = self._run_security_tool(username)
+        if security_output:
+            return self._parse_security_tool_output(security_output)
+        else:
+            return [None, None]
+
+    def read_credentials(self):
+        username = None
+        password = None
+
+        try:
+            if Git.in_working_directory(self.cwd):
+                (username, password) = self._credentials_from_git()
+        except OSError, e:
+            # Catch and ignore OSError exceptions such as "no such file 
+            # or directory" (OSError errno 2), which imply that the Git
+            # command cannot be found/is not installed.
+            pass
+
+        if not username or not password:
+            (username, password) = self._credentials_from_keychain(username)
+
+        if not username:
+            username = User.prompt("%s login: " % self.host)
+        if not password:
+            password = getpass.getpass("%s password for %s: " % (self.host,
+                                                                 username))
+
+        return [username, password]
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
new file mode 100644
index 0000000..9a42bdd
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
@@ -0,0 +1,117 @@
+# Copyright (C) 2009 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.
+
+import os
+import tempfile
+import unittest
+from webkitpy.common.net.credentials import Credentials
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+class CredentialsTest(unittest.TestCase):
+    example_security_output = """keychain: "/Users/test/Library/Keychains/login.keychain"
+class: "inet"
+attributes:
+    0x00000007 <blob>="bugs.webkit.org (test@webkit.org)"
+    0x00000008 <blob>=<NULL>
+    "acct"<blob>="test@webkit.org"
+    "atyp"<blob>="form"
+    "cdat"<timedate>=0x32303039303832353233353231365A00  "20090825235216Z\000"
+    "crtr"<uint32>=<NULL>
+    "cusi"<sint32>=<NULL>
+    "desc"<blob>="Web form password"
+    "icmt"<blob>="default"
+    "invi"<sint32>=<NULL>
+    "mdat"<timedate>=0x32303039303930393137323635315A00  "20090909172651Z\000"
+    "nega"<sint32>=<NULL>
+    "path"<blob>=<NULL>
+    "port"<uint32>=0x00000000 
+    "prot"<blob>=<NULL>
+    "ptcl"<uint32>="htps"
+    "scrp"<sint32>=<NULL>
+    "sdmn"<blob>=<NULL>
+    "srvr"<blob>="bugs.webkit.org"
+    "type"<uint32>=<NULL>
+password: "SECRETSAUCE"
+"""
+
+    def test_keychain_lookup_on_non_mac(self):
+        class FakeCredentials(Credentials):
+            def _is_mac_os_x(self):
+                return False
+        credentials = FakeCredentials("bugs.webkit.org")
+        self.assertEqual(credentials._is_mac_os_x(), False)
+        self.assertEqual(credentials._credentials_from_keychain("foo"), ["foo", None])
+
+    def test_security_output_parse(self):
+        credentials = Credentials("bugs.webkit.org")
+        self.assertEqual(credentials._parse_security_tool_output(self.example_security_output), ["test@webkit.org", "SECRETSAUCE"])
+
+    def test_security_output_parse_entry_not_found(self):
+        credentials = Credentials("foo.example.com")
+        if not credentials._is_mac_os_x():
+            return # This test does not run on a non-Mac.
+
+        # Note, we ignore the captured output because it is already covered
+        # by the test case CredentialsTest._assert_security_call (below).
+        outputCapture = OutputCapture()
+        outputCapture.capture_output()
+        self.assertEqual(credentials._run_security_tool(), None)
+        outputCapture.restore_output()
+
+    def _assert_security_call(self, username=None):
+        executive_mock = Mock()
+        credentials = Credentials("example.com", executive=executive_mock)
+
+        expected_stderr = "Reading Keychain for example.com account and password.  Click \"Allow\" to continue...\n"
+        OutputCapture().assert_outputs(self, credentials._run_security_tool, [username], expected_stderr=expected_stderr)
+
+        security_args = ["/usr/bin/security", "find-internet-password", "-g", "-s", "example.com"]
+        if username:
+            security_args += ["-a", username]
+        executive_mock.run_command.assert_called_with(security_args)
+
+    def test_security_calls(self):
+        self._assert_security_call()
+        self._assert_security_call(username="foo")
+
+    def test_read_credentials_without_git_repo(self):
+        class FakeCredentials(Credentials):
+            def _is_mac_os_x(self):
+                return True
+            def _credentials_from_keychain(self, username):
+                return ["test@webkit.org", "SECRETSAUCE"]
+
+        temp_dir_path = tempfile.mkdtemp(suffix="not_a_git_repo")
+        credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
+        self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "SECRETSAUCE"])
+        os.rmdir(temp_dir_path)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py
new file mode 100644
index 0000000..f742867
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py
@@ -0,0 +1,91 @@
+# 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.
+
+import webkitpy.common.config.irc as config_irc
+
+from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
+from webkitpy.thirdparty.autoinstalled.irc import ircbot
+from webkitpy.thirdparty.autoinstalled.irc import irclib
+
+
+class IRCBotDelegate(object):
+    def irc_message_received(self, nick, message):
+        raise NotImplementedError, "subclasses must implement"
+
+    def irc_nickname(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def irc_password(self):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class IRCBot(ircbot.SingleServerIRCBot, MessagePumpDelegate):
+    # FIXME: We should get this information from a config file.
+    def __init__(self,
+                 message_queue,
+                 delegate):
+        self._message_queue = message_queue
+        self._delegate = delegate
+        ircbot.SingleServerIRCBot.__init__(
+            self,
+            [(
+                config_irc.server,
+                config_irc.port,
+                self._delegate.irc_password()
+            )],
+            self._delegate.irc_nickname(),
+            self._delegate.irc_nickname())
+        self._channel = config_irc.channel
+
+    # ircbot.SingleServerIRCBot methods
+
+    def on_nicknameinuse(self, connection, event):
+        connection.nick(connection.get_nickname() + "_")
+
+    def on_welcome(self, connection, event):
+        connection.join(self._channel)
+        self._message_pump = MessagePump(self, self._message_queue)
+
+    def on_pubmsg(self, connection, event):
+        nick = irclib.nm_to_n(event.source())
+        request = event.arguments()[0].split(":", 1)
+        if len(request) > 1 and irclib.irc_lower(request[0]) == irclib.irc_lower(self.connection.get_nickname()):
+            response = self._delegate.irc_message_received(nick, request[1])
+            if response:
+                connection.privmsg(self._channel, response)
+
+    # MessagePumpDelegate methods
+
+    def schedule(self, interval, callback):
+        self.connection.execute_delayed(interval, callback)
+
+    def message_available(self, message):
+        self.connection.privmsg(self._channel, message)
+
+    def final_message_delivered(self):
+        self.die()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py
new file mode 100644
index 0000000..13348b4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py
@@ -0,0 +1,62 @@
+# 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.
+
+import threading
+
+from webkitpy.common.net.irc.ircbot import IRCBot
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+from webkitpy.common.system.deprecated_logging import log
+
+
+class _IRCThread(threading.Thread):
+    def __init__(self, message_queue, irc_delegate, irc_bot):
+        threading.Thread.__init__(self)
+        self.setDaemon(True)
+        self._message_queue = message_queue
+        self._irc_delegate = irc_delegate
+        self._irc_bot = irc_bot
+
+    def run(self):
+        bot = self._irc_bot(self._message_queue, self._irc_delegate)
+        bot.start()
+
+
+class IRCProxy(object):
+    def __init__(self, irc_delegate, irc_bot=IRCBot):
+        log("Connecting to IRC")
+        self._message_queue = ThreadedMessageQueue()
+        self._child_thread = _IRCThread(self._message_queue, irc_delegate, irc_bot)
+        self._child_thread.start()
+
+    def post(self, message):
+        self._message_queue.post(message)
+
+    def disconnect(self):
+        log("Disconnecting from IRC...")
+        self._message_queue.stop()
+        self._child_thread.join()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
new file mode 100644
index 0000000..b44ce40
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
@@ -0,0 +1,43 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.net.irc.ircproxy import IRCProxy
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+class IRCProxyTest(unittest.TestCase):
+    def test_trivial(self):
+        def fun():
+            proxy = IRCProxy(Mock(), Mock())
+            proxy.post("hello")
+            proxy.disconnect()
+
+        expected_stderr = "Connecting to IRC\nDisconnecting from IRC...\n"
+        OutputCapture().assert_outputs(self, fun, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
new file mode 100644
index 0000000..c82fc6f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
@@ -0,0 +1,68 @@
+# 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.
+
+import logging
+import time
+
+from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError
+from webkitpy.common.system.deprecated_logging import log
+
+
+_log = logging.getLogger(__name__)
+
+
+class NetworkTimeout(Exception):
+    pass
+
+
+class NetworkTransaction(object):
+    def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds=10*60):
+        self._initial_backoff_seconds = initial_backoff_seconds
+        self._grown_factor = grown_factor
+        self._timeout_seconds = timeout_seconds
+
+    def run(self, request):
+        self._total_sleep = 0
+        self._backoff_seconds = self._initial_backoff_seconds
+        while True:
+            try:
+                return request()
+            except HTTPError, e:
+                self._check_for_timeout()
+                _log.warn("Received HTTP status %s from server.  Retrying in "
+                          "%s seconds..." % (e.code, self._backoff_seconds))
+                self._sleep()
+
+    def _check_for_timeout(self):
+        if self._total_sleep + self._backoff_seconds > self._timeout_seconds:
+            raise NetworkTimeout()
+
+    def _sleep(self):
+        time.sleep(self._backoff_seconds)
+        self._total_sleep += self._backoff_seconds
+        self._backoff_seconds *= self._grown_factor
diff --git a/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
new file mode 100644
index 0000000..cd0702b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
@@ -0,0 +1,86 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.net.networktransaction import NetworkTransaction, NetworkTimeout
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError
+
+
+class NetworkTransactionTest(LoggingTestCase):
+    exception = Exception("Test exception")
+
+    def test_success(self):
+        transaction = NetworkTransaction()
+        self.assertEqual(transaction.run(lambda: 42), 42)
+
+    def _raise_exception(self):
+        raise self.exception
+
+    def test_exception(self):
+        transaction = NetworkTransaction()
+        did_process_exception = False
+        did_throw_exception = True
+        try:
+            transaction.run(lambda: self._raise_exception())
+            did_throw_exception = False
+        except Exception, e:
+            did_process_exception = True
+            self.assertEqual(e, self.exception)
+        self.assertTrue(did_throw_exception)
+        self.assertTrue(did_process_exception)
+
+    def _raise_http_error(self):
+        self._run_count += 1
+        if self._run_count < 3:
+            raise HTTPError("http://example.com/", 500, "inteneral server error", None, None)
+        return 42
+
+    def test_retry(self):
+        self._run_count = 0
+        transaction = NetworkTransaction(initial_backoff_seconds=0)
+        self.assertEqual(transaction.run(lambda: self._raise_http_error()), 42)
+        self.assertEqual(self._run_count, 3)
+        self.assertLog(['WARNING: Received HTTP status 500 from server.  '
+                        'Retrying in 0 seconds...\n',
+                        'WARNING: Received HTTP status 500 from server.  '
+                        'Retrying in 0.0 seconds...\n'])
+
+    def test_timeout(self):
+        self._run_count = 0
+        transaction = NetworkTransaction(initial_backoff_seconds=60*60, timeout_seconds=60)
+        did_process_exception = False
+        did_throw_exception = True
+        try:
+            transaction.run(lambda: self._raise_http_error())
+            did_throw_exception = False
+        except NetworkTimeout, e:
+            did_process_exception = True
+        self.assertTrue(did_throw_exception)
+        self.assertTrue(did_process_exception)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/rietveld.py b/WebKitTools/Scripts/webkitpy/common/net/rietveld.py
new file mode 100644
index 0000000..a9e5b1a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/rietveld.py
@@ -0,0 +1,89 @@
+# 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.
+
+import os
+import re
+import stat
+
+import webkitpy.common.config as config
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.system.executive import ScriptError
+import webkitpy.thirdparty.autoinstalled.rietveld.upload as upload
+
+
+def parse_codereview_issue(message):
+    if not message:
+        return None
+    match = re.search(config.codereview_server_regex +
+                      "(?P<codereview_issue>\d+)",
+                      message)
+    if match:
+        return int(match.group('codereview_issue'))
+
+
+class Rietveld(object):
+    def __init__(self, executive, dryrun=False):
+        self.dryrun = dryrun
+        self._executive = executive
+        self._upload_py = upload.__file__
+        # Chop off the last character so we modify permissions on the py file instead of the pyc.
+        if os.path.splitext(self._upload_py)[1] == ".pyc":
+            self._upload_py = self._upload_py[:-1]
+        os.chmod(self._upload_py, os.stat(self._upload_py).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
+
+    def url_for_issue(self, codereview_issue):
+        if not codereview_issue:
+            return None
+        return "%s%s" % (config.codereview_server_url, codereview_issue)
+
+    def post(self, message=None, codereview_issue=None, cc=None):
+        if not message:
+            raise ScriptError("Rietveld requires a message.")
+
+        args = [
+            self._upload_py,
+            "--assume_yes",
+            "--server=%s" % config.codereview_server_host,
+            "--message=%s" % message,
+        ]
+        if codereview_issue:
+            args.append("--issue=%s" % codereview_issue)
+        if cc:
+            args.append("--cc=%s" % cc)
+
+        if self.dryrun:
+            log("Would have run %s" % args)
+            return
+
+        output = self._executive.run_and_throw_if_fail(args)
+        match = re.search("Issue created\. URL: " +
+                          config.codereview_server_regex +
+                          "(?P<codereview_issue>\d+)",
+                          output)
+        if match:
+            return int(match.group('codereview_issue'))
diff --git a/WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py
new file mode 100644
index 0000000..9c5a29e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py
@@ -0,0 +1,39 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.net.rietveld import Rietveld
+from webkitpy.thirdparty.mock import Mock
+
+
+class RietveldTest(unittest.TestCase):
+    def test_url_for_issue(self):
+        rietveld = Rietveld(Mock())
+        self.assertEqual(rietveld.url_for_issue(34223),
+                         "https://wkrietveld.appspot.com/34223")
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
new file mode 100644
index 0000000..e8987a9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -0,0 +1,108 @@
+# Copyright (C) 2009 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.
+
+from webkitpy.common.net.networktransaction import NetworkTransaction
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+import urllib2
+
+
+class StatusServer:
+    default_host = "webkit-commit-queue.appspot.com"
+
+    def __init__(self, host=default_host):
+        self.set_host(host)
+        self.browser = Browser()
+
+    def set_host(self, host):
+        self.host = host
+        self.url = "http://%s" % self.host
+
+    def results_url_for_status(self, status_id):
+        return "%s/results/%s" % (self.url, status_id)
+
+    def _add_patch(self, patch):
+        if not patch:
+            return
+        if patch.bug_id():
+            self.browser["bug_id"] = str(patch.bug_id())
+        if patch.id():
+            self.browser["patch_id"] = str(patch.id())
+
+    def _add_results_file(self, results_file):
+        if not results_file:
+            return
+        self.browser.add_file(results_file, "text/plain", "results.txt", 'results_file')
+
+    def _post_status_to_server(self, queue_name, status, patch, results_file):
+        if results_file:
+            # We might need to re-wind the file if we've already tried to post it.
+            results_file.seek(0)
+
+        update_status_url = "%s/update-status" % self.url
+        self.browser.open(update_status_url)
+        self.browser.select_form(name="update_status")
+        self.browser["queue_name"] = queue_name
+        self._add_patch(patch)
+        self.browser["status"] = status
+        self._add_results_file(results_file)
+        return self.browser.submit().read() # This is the id of the newly created status object.
+
+    def _post_svn_revision_to_server(self, svn_revision_number, broken_bot):
+        update_svn_revision_url = "%s/update-svn-revision" % self.url
+        self.browser.open(update_svn_revision_url)
+        self.browser.select_form(name="update_svn_revision")
+        self.browser["number"] = str(svn_revision_number)
+        self.browser["broken_bot"] = broken_bot
+        return self.browser.submit().read()
+
+    def update_status(self, queue_name, status, patch=None, results_file=None):
+        log(status)
+        return NetworkTransaction().run(lambda: self._post_status_to_server(queue_name, status, patch, results_file))
+
+    def update_svn_revision(self, svn_revision_number, broken_bot):
+        log("SVN revision: %s broke %s" % (svn_revision_number, broken_bot))
+        return NetworkTransaction().run(lambda: self._post_svn_revision_to_server(svn_revision_number, broken_bot))
+
+    def _fetch_url(self, url):
+        try:
+            return urllib2.urlopen(url).read()
+        except urllib2.HTTPError, e:
+            if e.code == 404:
+                return None
+            raise e
+
+    def patch_status(self, queue_name, patch_id):
+        patch_status_url = "%s/patch-status/%s/%s" % (self.url, queue_name, patch_id)
+        return self._fetch_url(patch_status_url)
+
+    def svn_revision(self, svn_revision_number):
+        svn_revision_url = "%s/svn-revision/%s" % (self.url, svn_revision_number)
+        return self._fetch_url(svn_revision_url)
diff --git a/WebKitTools/Scripts/webkitpy/common/prettypatch.py b/WebKitTools/Scripts/webkitpy/common/prettypatch.py
new file mode 100644
index 0000000..8157f9c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/prettypatch.py
@@ -0,0 +1,55 @@
+# 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.
+
+import os
+import tempfile
+
+
+class PrettyPatch(object):
+    def __init__(self, executive, checkout_root):
+        self._executive = executive
+        self._checkout_root = checkout_root
+
+    def pretty_diff_file(self, diff):
+        pretty_diff = self.pretty_diff(diff)
+        diff_file = tempfile.NamedTemporaryFile(suffix=".html")
+        diff_file.write(pretty_diff)
+        diff_file.flush()
+        return diff_file
+
+    def pretty_diff(self, diff):
+        pretty_patch_path = os.path.join(self._checkout_root,
+                                         "BugsSite", "PrettyPatch")
+        prettify_path = os.path.join(pretty_patch_path, "prettify.rb")
+        args = [
+            "ruby",
+            "-I",
+            pretty_patch_path,
+            prettify_path,
+        ]
+        return self._executive.run_command(args, input=diff)
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/system/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/common/system/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py b/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py
new file mode 100755
index 0000000..32fd2cf
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py
@@ -0,0 +1,518 @@
+# Copyright (c) 2009, Daniel Krech All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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 the Daniel Krech 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
+# HOLDER 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.
+
+"""Support for automatically downloading Python packages from an URL."""
+
+import logging
+import new
+import os
+import shutil
+import sys
+import tarfile
+import tempfile
+import urllib
+import urlparse
+import zipfile
+import zipimport
+
+_log = logging.getLogger(__name__)
+
+
+class AutoInstaller(object):
+
+    """Supports automatically installing Python packages from an URL.
+
+    Supports uncompressed files, .tar.gz, and .zip formats.
+
+    Basic usage:
+
+    installer = AutoInstaller()
+
+    installer.install(url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+                      url_subpath="pep8-0.5.0/pep8.py")
+    installer.install(url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+                      url_subpath="mechanize")
+
+    """
+
+    def __init__(self, append_to_search_path=False, make_package=True,
+                 target_dir=None, temp_dir=None):
+        """Create an AutoInstaller instance, and set up the target directory.
+
+        Args:
+          append_to_search_path: A boolean value of whether to append the
+                                 target directory to the sys.path search path.
+          make_package: A boolean value of whether to make the target
+                        directory a package.  This adds an __init__.py file
+                        to the target directory -- allowing packages and
+                        modules within the target directory to be imported
+                        explicitly using dotted module names.
+          target_dir: The directory path to which packages should be installed.
+                      Defaults to a subdirectory of the folder containing
+                      this module called "autoinstalled".
+          temp_dir: The directory path to use for any temporary files
+                    generated while downloading, unzipping, and extracting
+                    packages to install.  Defaults to a standard temporary
+                    location generated by the tempfile module.  This
+                    parameter should normally be used only for development
+                    testing.
+
+        """
+        if target_dir is None:
+            this_dir = os.path.dirname(__file__)
+            target_dir = os.path.join(this_dir, "autoinstalled")
+
+        # Ensure that the target directory exists.
+        self._set_up_target_dir(target_dir, append_to_search_path, make_package)
+
+        self._target_dir = target_dir
+        self._temp_dir = temp_dir
+
+    def _log_transfer(self, message, source, target, log_method=None):
+        """Log a debug message that involves a source and target."""
+        if log_method is None:
+            log_method = _log.debug
+
+        log_method("%s" % message)
+        log_method('    From: "%s"' % source)
+        log_method('      To: "%s"' % target)
+
+    def _create_directory(self, path, name=None):
+        """Create a directory."""
+        log = _log.debug
+
+        name = name + " " if name is not None else ""
+        log('Creating %sdirectory...' % name)
+        log('    "%s"' % path)
+
+        os.makedirs(path)
+
+    def _write_file(self, path, text):
+        """Create a file at the given path with given text.
+
+        This method overwrites any existing file.
+
+        """
+        _log.debug("Creating file...")
+        _log.debug('    "%s"' % path)
+        file = open(path, "w")
+        try:
+            file.write(text)
+        finally:
+            file.close()
+
+    def _set_up_target_dir(self, target_dir, append_to_search_path,
+                           make_package):
+        """Set up a target directory.
+
+        Args:
+          target_dir: The path to the target directory to set up.
+          append_to_search_path: A boolean value of whether to append the
+                                 target directory to the sys.path search path.
+          make_package: A boolean value of whether to make the target
+                        directory a package.  This adds an __init__.py file
+                        to the target directory -- allowing packages and
+                        modules within the target directory to be imported
+                        explicitly using dotted module names.
+
+        """
+        if not os.path.exists(target_dir):
+            self._create_directory(target_dir, "autoinstall target")
+
+        if append_to_search_path:
+            sys.path.append(target_dir)
+
+        if make_package:
+            init_path = os.path.join(target_dir, "__init__.py")
+            if not os.path.exists(init_path):
+                text = ("# This file is required for Python to search this "
+                        "directory for modules.\n")
+                self._write_file(init_path, text)
+
+    def _create_scratch_directory_inner(self, prefix):
+        """Create a scratch directory without exception handling.
+
+        Creates a scratch directory inside the AutoInstaller temp
+        directory self._temp_dir, or inside a platform-dependent temp
+        directory if self._temp_dir is None.  Returns the path to the
+        created scratch directory.
+
+        Raises:
+          OSError: [Errno 2] if the containing temp directory self._temp_dir
+                             is not None and does not exist.
+
+        """
+        # The tempfile.mkdtemp() method function requires that the
+        # directory corresponding to the "dir" parameter already exist
+        # if it is not None.
+        scratch_dir = tempfile.mkdtemp(prefix=prefix, dir=self._temp_dir)
+        return scratch_dir
+
+    def _create_scratch_directory(self, target_name):
+        """Create a temporary scratch directory, and return its path.
+
+        The scratch directory is generated inside the temp directory
+        of this AutoInstaller instance.  This method also creates the
+        temp directory if it does not already exist.
+
+        """
+        prefix = target_name + "_"
+        try:
+            scratch_dir = self._create_scratch_directory_inner(prefix)
+        except OSError:
+            # Handle case of containing temp directory not existing--
+            # OSError: [Errno 2] No such file or directory:...
+            temp_dir = self._temp_dir
+            if temp_dir is None or os.path.exists(temp_dir):
+                raise
+            # Else try again after creating the temp directory.
+            self._create_directory(temp_dir, "autoinstall temp")
+            scratch_dir = self._create_scratch_directory_inner(prefix)
+
+        return scratch_dir
+
+    def _url_downloaded_path(self, target_name):
+        """Return the path to the file containing the URL downloaded."""
+        filename = ".%s.url" % target_name
+        path = os.path.join(self._target_dir, filename)
+        return path
+
+    def _is_downloaded(self, target_name, url):
+        """Return whether a package version has been downloaded."""
+        version_path = self._url_downloaded_path(target_name)
+
+        _log.debug('Checking %s URL downloaded...' % target_name)
+        _log.debug('    "%s"' % version_path)
+
+        if not os.path.exists(version_path):
+            # Then no package version has been downloaded.
+            _log.debug("No URL file found.")
+            return False
+
+        file = open(version_path, "r")
+        try:
+            version = file.read()
+        finally:
+            file.close()
+
+        return version.strip() == url.strip()
+
+    def _record_url_downloaded(self, target_name, url):
+        """Record the URL downloaded to a file."""
+        version_path = self._url_downloaded_path(target_name)
+        _log.debug("Recording URL downloaded...")
+        _log.debug('    URL: "%s"' % url)
+        _log.debug('     To: "%s"' % version_path)
+
+        self._write_file(version_path, url)
+
+    def _extract_targz(self, path, scratch_dir):
+        # tarfile.extractall() extracts to a path without the
+        # trailing ".tar.gz".
+        target_basename = os.path.basename(path[:-len(".tar.gz")])
+        target_path = os.path.join(scratch_dir, target_basename)
+
+        self._log_transfer("Starting gunzip/extract...", path, target_path)
+
+        try:
+            tar_file = tarfile.open(path)
+        except tarfile.ReadError, err:
+            # Append existing Error message to new Error.
+            message = ("Could not open tar file: %s\n"
+                       " The file probably does not have the correct format.\n"
+                       " --> Inner message: %s"
+                       % (path, err))
+            raise Exception(message)
+
+        try:
+            # This is helpful for debugging purposes.
+            _log.debug("Listing tar file contents...")
+            for name in tar_file.getnames():
+                _log.debug('    * "%s"' % name)
+            _log.debug("Extracting gzipped tar file...")
+            tar_file.extractall(target_path)
+        finally:
+            tar_file.close()
+
+        return target_path
+
+    # This is a replacement for ZipFile.extractall(), which is
+    # available in Python 2.6 but not in earlier versions.
+    def _extract_all(self, zip_file, target_dir):
+        self._log_transfer("Extracting zip file...", zip_file, target_dir)
+
+        # This is helpful for debugging purposes.
+        _log.debug("Listing zip file contents...")
+        for name in zip_file.namelist():
+            _log.debug('    * "%s"' % name)
+
+        for name in zip_file.namelist():
+            path = os.path.join(target_dir, name)
+            self._log_transfer("Extracting...", name, path)
+
+            if not os.path.basename(path):
+                # Then the path ends in a slash, so it is a directory.
+                self._create_directory(path)
+                continue
+            # Otherwise, it is a file.
+
+            try:
+                outfile = open(path, 'wb')
+            except IOError, err:
+                # Not all zip files seem to list the directories explicitly,
+                # so try again after creating the containing directory.
+                _log.debug("Got IOError: retrying after creating directory...")
+                dir = os.path.dirname(path)
+                self._create_directory(dir)
+                outfile = open(path, 'wb')
+
+            try:
+                outfile.write(zip_file.read(name))
+            finally:
+                outfile.close()
+
+    def _unzip(self, path, scratch_dir):
+        # zipfile.extractall() extracts to a path without the
+        # trailing ".zip".
+        target_basename = os.path.basename(path[:-len(".zip")])
+        target_path = os.path.join(scratch_dir, target_basename)
+
+        self._log_transfer("Starting unzip...", path, target_path)
+
+        try:
+            zip_file = zipfile.ZipFile(path, "r")
+        except zipfile.BadZipfile, err:
+            message = ("Could not open zip file: %s\n"
+                       " --> Inner message: %s"
+                       % (path, err))
+            raise Exception(message)
+
+        try:
+            self._extract_all(zip_file, scratch_dir)
+        finally:
+            zip_file.close()
+
+        return target_path
+
+    def _prepare_package(self, path, scratch_dir):
+        """Prepare a package for use, if necessary, and return the new path.
+
+        For example, this method unzips zipped files and extracts
+        tar files.
+
+        Args:
+          path: The path to the downloaded URL contents.
+          scratch_dir: The scratch directory.  Note that the scratch
+                       directory contains the file designated by the
+                       path parameter.
+
+        """
+        # FIXME: Add other natural extensions.
+        if path.endswith(".zip"):
+            new_path = self._unzip(path, scratch_dir)
+        elif path.endswith(".tar.gz"):
+            new_path = self._extract_targz(path, scratch_dir)
+        else:
+            # No preparation is needed.
+            new_path = path
+
+        return new_path
+
+    def _download_to_stream(self, url, stream):
+        """Download an URL to a stream, and return the number of bytes."""
+        try:
+            netstream = urllib.urlopen(url)
+        except IOError, err:
+            # Append existing Error message to new Error.
+            message = ('Could not download Python modules from URL "%s".\n'
+                       " Make sure you are connected to the internet.\n"
+                       " You must be connected to the internet when "
+                       "downloading needed modules for the first time.\n"
+                       " --> Inner message: %s"
+                       % (url, err))
+            raise IOError(message)
+        code = 200
+        if hasattr(netstream, "getcode"):
+            code = netstream.getcode()
+        if not 200 <= code < 300:
+            raise ValueError("HTTP Error code %s" % code)
+
+        BUFSIZE = 2**13  # 8KB
+        bytes = 0
+        while True:
+            data = netstream.read(BUFSIZE)
+            if not data:
+                break
+            stream.write(data)
+            bytes += len(data)
+        netstream.close()
+        return bytes
+
+    def _download(self, url, scratch_dir):
+        """Download URL contents, and return the download path."""
+        url_path = urlparse.urlsplit(url)[2]
+        url_path = os.path.normpath(url_path)  # Removes trailing slash.
+        target_filename = os.path.basename(url_path)
+        target_path = os.path.join(scratch_dir, target_filename)
+
+        self._log_transfer("Starting download...", url, target_path)
+
+        stream = file(target_path, "wb")
+        bytes = self._download_to_stream(url, stream)
+        stream.close()
+
+        _log.debug("Downloaded %s bytes." % bytes)
+
+        return target_path
+
+    def _install(self, scratch_dir, package_name, target_path, url,
+                 url_subpath):
+        """Install a python package from an URL.
+
+        This internal method overwrites the target path if the target
+        path already exists.
+
+        """
+        path = self._download(url=url, scratch_dir=scratch_dir)
+        path = self._prepare_package(path, scratch_dir)
+
+        if url_subpath is None:
+            source_path = path
+        else:
+            source_path = os.path.join(path, url_subpath)
+
+        if os.path.exists(target_path):
+            _log.debug('Refreshing install: deleting "%s".' % target_path)
+            if os.path.isdir(target_path):
+                shutil.rmtree(target_path)
+            else:
+                os.remove(target_path)
+
+        self._log_transfer("Moving files into place...", source_path, target_path)
+
+        # The shutil.move() command creates intermediate directories if they
+        # do not exist, but we do not rely on this behavior since we
+        # need to create the __init__.py file anyway.
+        shutil.move(source_path, target_path)
+
+        self._record_url_downloaded(package_name, url)
+
+    def install(self, url, should_refresh=False, target_name=None,
+                url_subpath=None):
+        """Install a python package from an URL.
+
+        Args:
+          url: The URL from which to download the package.
+
+        Optional Args:
+          should_refresh: A boolean value of whether the package should be
+                          downloaded again if the package is already present.
+          target_name: The name of the folder or file in the autoinstaller
+                       target directory at which the package should be
+                       installed.  Defaults to the base name of the
+                       URL sub-path.  This parameter must be provided if
+                       the URL sub-path is not specified.
+          url_subpath: The relative path of the URL directory that should
+                       be installed.  Defaults to the full directory, or
+                       the entire URL contents.
+
+        """
+        if target_name is None:
+            if not url_subpath:
+                raise ValueError('The "target_name" parameter must be '
+                                 'provided if the "url_subpath" parameter '
+                                 "is not provided.")
+            # Remove any trailing slashes.
+            url_subpath = os.path.normpath(url_subpath)
+            target_name = os.path.basename(url_subpath)
+
+        target_path = os.path.join(self._target_dir, target_name)
+        if not should_refresh and self._is_downloaded(target_name, url):
+            _log.debug('URL for %s already downloaded.  Skipping...'
+                       % target_name)
+            _log.debug('    "%s"' % url)
+            return
+
+        self._log_transfer("Auto-installing package: %s" % target_name,
+                            url, target_path, log_method=_log.info)
+
+        # The scratch directory is where we will download and prepare
+        # files specific to this install until they are ready to move
+        # into place.
+        scratch_dir = self._create_scratch_directory(target_name)
+
+        try:
+            self._install(package_name=target_name,
+                          target_path=target_path,
+                          scratch_dir=scratch_dir,
+                          url=url,
+                          url_subpath=url_subpath)
+        except Exception, err:
+            # Append existing Error message to new Error.
+            message = ("Error auto-installing the %s package to:\n"
+                       ' "%s"\n'
+                       " --> Inner message: %s"
+                       % (target_name, target_path, err))
+            raise Exception(message)
+        finally:
+            _log.debug('Cleaning up: deleting "%s".' % scratch_dir)
+            shutil.rmtree(scratch_dir)
+        _log.debug('Auto-installed %s to:' % target_name)
+        _log.debug('    "%s"' % target_path)
+
+
+if __name__=="__main__":
+
+    # Configure the autoinstall logger to log DEBUG messages for
+    # development testing purposes.
+    console = logging.StreamHandler()
+
+    formatter = logging.Formatter('%(name)s: %(levelname)-8s %(message)s')
+    console.setFormatter(formatter)
+    _log.addHandler(console)
+    _log.setLevel(logging.DEBUG)
+
+    # Use a more visible temp directory for debug purposes.
+    this_dir = os.path.dirname(__file__)
+    target_dir = os.path.join(this_dir, "autoinstalled")
+    temp_dir = os.path.join(target_dir, "Temp")
+
+    installer = AutoInstaller(target_dir=target_dir,
+                              temp_dir=temp_dir)
+
+    installer.install(should_refresh=False,
+                      target_name="pep8.py",
+                      url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+                      url_subpath="pep8-0.5.0/pep8.py")
+    installer.install(should_refresh=False,
+                      target_name="mechanize",
+                      url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+                      url_subpath="mechanize")
+
diff --git a/WebKitTools/Scripts/webkitpy/webkit_logging.py b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging.py
similarity index 100%
rename from WebKitTools/Scripts/webkitpy/webkit_logging.py
rename to WebKitTools/Scripts/webkitpy/common/system/deprecated_logging.py
diff --git a/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py
new file mode 100644
index 0000000..2b71803
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2009 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.
+
+import os
+import subprocess
+import StringIO
+import tempfile
+import unittest
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.deprecated_logging import *
+
+class LoggingTest(unittest.TestCase):
+
+    def assert_log_equals(self, log_input, expected_output):
+        original_stderr = sys.stderr
+        test_stderr = StringIO.StringIO()
+        sys.stderr = test_stderr
+
+        try:
+            log(log_input)
+            actual_output = test_stderr.getvalue()
+        finally:
+            sys.stderr = original_stderr
+
+        self.assertEquals(actual_output, expected_output, "log(\"%s\") expected: %s actual: %s" % (log_input, expected_output, actual_output))
+
+    def test_log(self):
+        self.assert_log_equals("test", "test\n")
+
+        # Test that log() does not throw an exception when passed an object instead of a string.
+        self.assert_log_equals(ScriptError(message="ScriptError"), "ScriptError\n")
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive.py b/WebKitTools/Scripts/webkitpy/common/system/executive.py
new file mode 100644
index 0000000..b6126e4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive.py
@@ -0,0 +1,209 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+#     * 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.
+
+try:
+    # This API exists only in Python 2.6 and higher.  :(
+    import multiprocessing
+except ImportError:
+    multiprocessing = None
+
+import os
+import platform
+import StringIO
+import signal
+import subprocess
+import sys
+
+from webkitpy.common.system.deprecated_logging import tee
+
+
+class ScriptError(Exception):
+
+    def __init__(self,
+                 message=None,
+                 script_args=None,
+                 exit_code=None,
+                 output=None,
+                 cwd=None):
+        if not message:
+            message = 'Failed to run "%s"' % script_args
+            if exit_code:
+                message += " exit_code: %d" % exit_code
+            if cwd:
+                message += " cwd: %s" % cwd
+
+        Exception.__init__(self, message)
+        self.script_args = script_args # 'args' is already used by Exception
+        self.exit_code = exit_code
+        self.output = output
+        self.cwd = cwd
+
+    def message_with_output(self, output_limit=500):
+        if self.output:
+            if output_limit and len(self.output) > output_limit:
+                return "%s\nLast %s characters of output:\n%s" % \
+                    (self, output_limit, self.output[-output_limit:])
+            return "%s\n%s" % (self, self.output)
+        return str(self)
+
+    def command_name(self):
+        command_path = self.script_args
+        if type(command_path) is list:
+            command_path = command_path[0]
+        return os.path.basename(command_path)
+
+
+def run_command(*args, **kwargs):
+    # FIXME: This should not be a global static.
+    # New code should use Executive.run_command directly instead
+    return Executive().run_command(*args, **kwargs)
+
+
+class Executive(object):
+
+    def _run_command_with_teed_output(self, args, teed_output):
+        child_process = subprocess.Popen(args,
+                                         stdout=subprocess.PIPE,
+                                         stderr=subprocess.STDOUT)
+
+        # Use our own custom wait loop because Popen ignores a tee'd
+        # stderr/stdout.
+        # FIXME: This could be improved not to flatten output to stdout.
+        while True:
+            output_line = child_process.stdout.readline()
+            if output_line == "" and child_process.poll() != None:
+                return child_process.poll()
+            teed_output.write(output_line)
+
+    def run_and_throw_if_fail(self, args, quiet=False):
+        # Cache the child's output locally so it can be used for error reports.
+        child_out_file = StringIO.StringIO()
+        tee_stdout = sys.stdout
+        if quiet:
+            dev_null = open(os.devnull, "w")
+            tee_stdout = dev_null
+        child_stdout = tee(child_out_file, tee_stdout)
+        exit_code = self._run_command_with_teed_output(args, child_stdout)
+        if quiet:
+            dev_null.close()
+
+        child_output = child_out_file.getvalue()
+        child_out_file.close()
+
+        if exit_code:
+            raise ScriptError(script_args=args,
+                              exit_code=exit_code,
+                              output=child_output)
+        return child_output
+
+    def cpu_count(self):
+        if multiprocessing:
+            return multiprocessing.cpu_count()
+        # Darn.  We don't have the multiprocessing package.
+        system_name = platform.system()
+        if system_name == "Darwin":
+            return int(self.run_command(["sysctl", "-n", "hw.ncpu"]))
+        elif system_name == "Windows":
+            return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+        elif system_name == "Linux":
+            num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
+            if isinstance(num_cores, int) and num_cores > 0:
+                return num_cores
+        # This quantity is a lie but probably a reasonable guess for modern
+        # machines.
+        return 2
+
+    def kill_process(self, pid):
+        if platform.system() == "Windows":
+            # According to http://docs.python.org/library/os.html
+            # os.kill isn't available on Windows.  However, when I tried it
+            # using Cygwin, it worked fine.  We should investigate whether
+            # we need this platform specific code here.
+            subprocess.call(('taskkill.exe', '/f', '/pid', str(pid)),
+                            stdin=open(os.devnull, 'r'),
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+            return
+        os.kill(pid, signal.SIGKILL)
+
+    # Error handlers do not need to be static methods once all callers are
+    # updated to use an Executive object.
+
+    @staticmethod
+    def default_error_handler(error):
+        raise error
+
+    @staticmethod
+    def ignore_error(error):
+        pass
+
+    # FIXME: This should be merged with run_and_throw_if_fail
+
+    def run_command(self,
+                    args,
+                    cwd=None,
+                    input=None,
+                    error_handler=None,
+                    return_exit_code=False,
+                    return_stderr=True):
+        if hasattr(input, 'read'): # Check if the input is a file.
+            stdin = input
+            string_to_communicate = None
+        else:
+            stdin = None
+            if input:
+                stdin = subprocess.PIPE
+            # string_to_communicate seems to need to be a str for proper
+            # communication with shell commands.
+            # See https://bugs.webkit.org/show_bug.cgi?id=37528
+            # For an example of a regresion caused by passing a unicode string through.
+            string_to_communicate = str(input)
+        if return_stderr:
+            stderr = subprocess.STDOUT
+        else:
+            stderr = None
+
+        process = subprocess.Popen(args,
+                                   stdin=stdin,
+                                   stdout=subprocess.PIPE,
+                                   stderr=stderr,
+                                   cwd=cwd)
+        output = process.communicate(string_to_communicate)[0]
+        exit_code = process.wait()
+
+        if return_exit_code:
+            return exit_code
+
+        if exit_code:
+            script_error = ScriptError(script_args=args,
+                                       exit_code=exit_code,
+                                       output=output,
+                                       cwd=cwd)
+            (error_handler or self.default_error_handler)(script_error)
+        return output
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py
new file mode 100644
index 0000000..ac380f8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py
@@ -0,0 +1,42 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). 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.
+
+import unittest
+
+from webkitpy.common.system.executive import Executive, run_command
+
+class ExecutiveTest(unittest.TestCase):
+
+    def test_run_command_with_bad_command(self):
+        def run_bad_command():
+            run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True)
+        self.failUnlessRaises(OSError, run_bad_command)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logtesting.py b/WebKitTools/Scripts/webkitpy/common/system/logtesting.py
new file mode 100644
index 0000000..e361cb5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logtesting.py
@@ -0,0 +1,258 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Supports the unit-testing of logging code.
+
+Provides support for unit-testing messages logged using the built-in
+logging module.
+
+Inherit from the LoggingTestCase class for basic testing needs.  For
+more advanced needs (e.g. unit-testing methods that configure logging),
+see the TestLogStream class, and perhaps also the LogTesting class.
+
+"""
+
+import logging
+import unittest
+
+
+class TestLogStream(object):
+
+    """Represents a file-like object for unit-testing logging.
+
+    This is meant for passing to the logging.StreamHandler constructor.
+    Log messages captured by instances of this object can be tested
+    using self.assertMessages() below.
+
+    """
+
+    def __init__(self, test_case):
+        """Create an instance.
+
+        Args:
+          test_case: A unittest.TestCase instance.
+
+        """
+        self._test_case = test_case
+        self.messages = []
+        """A list of log messages written to the stream."""
+
+    # Python documentation says that any object passed to the StreamHandler
+    # constructor should support write() and flush():
+    #
+    # http://docs.python.org/library/logging.html#module-logging.handlers
+    def write(self, message):
+        self.messages.append(message)
+
+    def flush(self):
+        pass
+
+    def assertMessages(self, messages):
+        """Assert that the given messages match the logged messages.
+
+        messages: A list of log message strings.
+
+        """
+        self._test_case.assertEquals(messages, self.messages)
+
+
+class LogTesting(object):
+
+    """Supports end-to-end unit-testing of log messages.
+
+        Sample usage:
+
+          class SampleTest(unittest.TestCase):
+
+              def setUp(self):
+                  self._log = LogTesting.setUp(self)  # Turn logging on.
+
+              def tearDown(self):
+                  self._log.tearDown()  # Turn off and reset logging.
+
+              def test_logging_in_some_method(self):
+                  call_some_method()  # Contains calls to _log.info(), etc.
+
+                  # Check the resulting log messages.
+                  self._log.assertMessages(["INFO: expected message #1",
+                                          "WARNING: expected message #2"])
+
+    """
+
+    def __init__(self, test_stream, handler):
+        """Create an instance.
+
+        This method should never be called directly.  Instances should
+        instead be created using the static setUp() method.
+
+        Args:
+          test_stream: A TestLogStream instance.
+          handler: The handler added to the logger.
+
+        """
+        self._test_stream = test_stream
+        self._handler = handler
+
+    @staticmethod
+    def _getLogger():
+        """Return the logger being tested."""
+        # It is possible we might want to return something other than
+        # the root logger in some special situation.  For now, the
+        # root logger seems to suffice.
+        return logging.getLogger()
+
+    @staticmethod
+    def setUp(test_case, logging_level=logging.INFO):
+        """Configure logging for unit testing.
+
+        Configures the root logger to log to a testing log stream.
+        Only messages logged at or above the given level are logged
+        to the stream.  Messages logged to the stream are formatted
+        in the following way, for example--
+
+        "INFO: This is a test log message."
+
+        This method should normally be called in the setUp() method
+        of a unittest.TestCase.  See the docstring of this class
+        for more details.
+
+        Returns:
+          A LogTesting instance.
+
+        Args:
+          test_case: A unittest.TestCase instance.
+          logging_level: An integer logging level that is the minimum level
+                         of log messages you would like to test.
+
+        """
+        stream = TestLogStream(test_case)
+        handler = logging.StreamHandler(stream)
+        handler.setLevel(logging_level)
+        formatter = logging.Formatter("%(levelname)s: %(message)s")
+        handler.setFormatter(formatter)
+
+        # Notice that we only change the root logger by adding a handler
+        # to it.  In particular, we do not reset its level using
+        # logger.setLevel().  This ensures that we have not interfered
+        # with how the code being tested may have configured the root
+        # logger.
+        logger = LogTesting._getLogger()
+        logger.addHandler(handler)
+
+        return LogTesting(stream, handler)
+
+    def tearDown(self):
+        """Assert there are no remaining log messages, and reset logging.
+
+        This method asserts that there are no more messages in the array of
+        log messages, and then restores logging to its original state.
+        This method should normally be called in the tearDown() method of a
+        unittest.TestCase.  See the docstring of this class for more details.
+
+        """
+        self.assertMessages([])
+        logger = LogTesting._getLogger()
+        logger.removeHandler(self._handler)
+
+    def messages(self):
+        """Return the current list of log messages."""
+        return self._test_stream.messages
+
+    # FIXME: Add a clearMessages() method for cases where the caller
+    #        deliberately doesn't want to assert every message.
+
+    # We clear the log messages after asserting since they are no longer
+    # needed after asserting.  This serves two purposes: (1) it simplifies
+    # the calling code when we want to check multiple logging calls in a
+    # single test method, and (2) it lets us check in the tearDown() method
+    # that there are no remaining log messages to be asserted.
+    #
+    # The latter ensures that no extra log messages are getting logged that
+    # the caller might not be aware of or may have forgotten to check for.
+    # This gets us a bit more mileage out of our tests without writing any
+    # additional code.
+    def assertMessages(self, messages):
+        """Assert the current array of log messages, and clear its contents.
+
+        Args:
+          messages: A list of log message strings.
+
+        """
+        try:
+            self._test_stream.assertMessages(messages)
+        finally:
+            # We want to clear the array of messages even in the case of
+            # an Exception (e.g. an AssertionError).  Otherwise, another
+            # AssertionError can occur in the tearDown() because the
+            # array might not have gotten emptied.
+            self._test_stream.messages = []
+
+
+# This class needs to inherit from unittest.TestCase.  Otherwise, the
+# setUp() and tearDown() methods will not get fired for test case classes
+# that inherit from this class -- even if the class inherits from *both*
+# unittest.TestCase and LoggingTestCase.
+#
+# FIXME: Rename this class to LoggingTestCaseBase to be sure that
+#        the unittest module does not interpret this class as a unittest
+#        test case itself.
+class LoggingTestCase(unittest.TestCase):
+
+    """Supports end-to-end unit-testing of log messages.
+
+        Sample usage:
+
+          class SampleTest(LoggingTestCase):
+
+              def test_logging_in_some_method(self):
+                  call_some_method()  # Contains calls to _log.info(), etc.
+
+                  # Check the resulting log messages.
+                  self.assertLog(["INFO: expected message #1",
+                                  "WARNING: expected message #2"])
+
+    """
+
+    def setUp(self):
+        self._log = LogTesting.setUp(self)
+
+    def tearDown(self):
+        self._log.tearDown()
+
+    def logMessages(self):
+        """Return the current list of log messages."""
+        return self._log.messages()
+
+    # FIXME: Add a clearMessages() method for cases where the caller
+    #        deliberately doesn't want to assert every message.
+
+    # See the code comments preceding LogTesting.assertMessages() for
+    # an explanation of why we clear the array of messages after
+    # asserting its contents.
+    def assertLog(self, messages):
+        """Assert the current array of log messages, and clear its contents.
+
+        Args:
+          messages: A list of log message strings.
+
+        """
+        self._log.assertMessages(messages)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logutils.py b/WebKitTools/Scripts/webkitpy/common/system/logutils.py
new file mode 100644
index 0000000..cd4e60f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logutils.py
@@ -0,0 +1,207 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Supports webkitpy logging."""
+
+# FIXME: Move this file to webkitpy/python24 since logging needs to
+#        be configured prior to running version-checking code.
+
+import logging
+import os
+import sys
+
+import webkitpy
+
+
+_log = logging.getLogger(__name__)
+
+# We set these directory paths lazily in get_logger() below.
+_scripts_dir = ""
+"""The normalized, absolute path to the ...Scripts directory."""
+
+_webkitpy_dir = ""
+"""The normalized, absolute path to the ...Scripts/webkitpy directory."""
+
+
+def _normalize_path(path):
+    """Return the given path normalized.
+
+    Converts a path to an absolute path, removes any trailing slashes,
+    removes any extension, and lower-cases it.
+
+    """
+    path = os.path.abspath(path)
+    path = os.path.normpath(path)
+    path = os.path.splitext(path)[0]  # Remove the extension, if any.
+    path = path.lower()
+
+    return path
+
+
+# Observe that the implementation of this function does not require
+# the use of any hard-coded strings like "webkitpy", etc.
+#
+# The main benefit this function has over using--
+#
+# _log = logging.getLogger(__name__)
+#
+# is that get_logger() returns the same value even if __name__ is
+# "__main__" -- i.e. even if the module is the script being executed
+# from the command-line.
+def get_logger(path):
+    """Return a logging.logger for the given path.
+
+    Returns:
+      A logger whose name is the name of the module corresponding to
+      the given path.  If the module is in webkitpy, the name is
+      the fully-qualified dotted module name beginning with webkitpy....
+      Otherwise, the name is the base name of the module (i.e. without
+      any dotted module name prefix).
+
+    Args:
+      path: The path of the module.  Normally, this parameter should be
+            the __file__ variable of the module.
+
+    Sample usage:
+
+      import webkitpy.common.system.logutils as logutils
+
+      _log = logutils.get_logger(__file__)
+
+    """
+    # Since we assign to _scripts_dir and _webkitpy_dir in this function,
+    # we need to declare them global.
+    global _scripts_dir
+    global _webkitpy_dir
+
+    path = _normalize_path(path)
+
+    # Lazily evaluate _webkitpy_dir and _scripts_dir.
+    if not _scripts_dir:
+        # The normalized, absolute path to ...Scripts/webkitpy/__init__.
+        webkitpy_path = _normalize_path(webkitpy.__file__)
+
+        _webkitpy_dir = os.path.split(webkitpy_path)[0]
+        _scripts_dir = os.path.split(_webkitpy_dir)[0]
+
+    if path.startswith(_webkitpy_dir):
+        # Remove the initial Scripts directory portion, so the path
+        # starts with /webkitpy, for example "/webkitpy/init/logutils".
+        path = path[len(_scripts_dir):]
+
+        parts = []
+        while True:
+            (path, tail) = os.path.split(path)
+            if not tail:
+                break
+            parts.insert(0, tail)
+
+        logger_name = ".".join(parts)  # For example, webkitpy.common.system.logutils.
+    else:
+        # The path is outside of webkitpy.  Default to the basename
+        # without the extension.
+        basename = os.path.basename(path)
+        logger_name = os.path.splitext(basename)[0]
+
+    return logging.getLogger(logger_name)
+
+
+def _default_handlers(stream):
+    """Return a list of the default logging handlers to use.
+
+    Args:
+      stream: See the configure_logging() docstring.
+
+    """
+    # Create the filter.
+    def should_log(record):
+        """Return whether a logging.LogRecord should be logged."""
+        # FIXME: Enable the logging of autoinstall messages once
+        #        autoinstall is adjusted.  Currently, autoinstall logs
+        #        INFO messages when importing already-downloaded packages,
+        #        which is too verbose.
+        if record.name.startswith("webkitpy.thirdparty.autoinstall"):
+            return False
+        return True
+
+    logging_filter = logging.Filter()
+    logging_filter.filter = should_log
+
+    # Create the handler.
+    handler = logging.StreamHandler(stream)
+    formatter = logging.Formatter("%(name)s: [%(levelname)s] %(message)s")
+    handler.setFormatter(formatter)
+    handler.addFilter(logging_filter)
+
+    return [handler]
+
+
+def configure_logging(logging_level=None, logger=None, stream=None,
+                      handlers=None):
+    """Configure logging for standard purposes.
+
+    Returns:
+      A list of references to the logging handlers added to the root
+      logger.  This allows the caller to later remove the handlers
+      using logger.removeHandler.  This is useful primarily during unit
+      testing where the caller may want to configure logging temporarily
+      and then undo the configuring.
+
+    Args:
+      logging_level: The minimum logging level to log.  Defaults to
+                     logging.INFO.
+      logger: A logging.logger instance to configure.  This parameter
+              should be used only in unit tests.  Defaults to the
+              root logger.
+      stream: A file-like object to which to log used in creating the default
+              handlers.  The stream must define an "encoding" data attribute,
+              or else logging raises an error.  Defaults to sys.stderr.
+      handlers: A list of logging.Handler instances to add to the logger
+                being configured.  If this parameter is provided, then the
+                stream parameter is not used.
+
+    """
+    # If the stream does not define an "encoding" data attribute, the
+    # logging module can throw an error like the following:
+    #
+    # Traceback (most recent call last):
+    #   File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
+    #         lib/python2.6/logging/__init__.py", line 761, in emit
+    #     self.stream.write(fs % msg.encode(self.stream.encoding))
+    # LookupError: unknown encoding: unknown
+    if logging_level is None:
+        logging_level = logging.INFO
+    if logger is None:
+        logger = logging.getLogger()
+    if stream is None:
+        stream = sys.stderr
+    if handlers is None:
+        handlers = _default_handlers(stream)
+
+    logger.setLevel(logging_level)
+
+    for handler in handlers:
+        logger.addHandler(handler)
+
+    _log.debug("Debug logging enabled.")
+
+    return handlers
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py
new file mode 100644
index 0000000..a4a6496
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py
@@ -0,0 +1,142 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Unit tests for logutils.py."""
+
+import logging
+import os
+import unittest
+
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.common.system.logtesting import TestLogStream
+import webkitpy.common.system.logutils as logutils
+
+
+class GetLoggerTest(unittest.TestCase):
+
+    """Tests get_logger()."""
+
+    def test_get_logger_in_webkitpy(self):
+        logger = logutils.get_logger(__file__)
+        self.assertEquals(logger.name, "webkitpy.common.system.logutils_unittest")
+
+    def test_get_logger_not_in_webkitpy(self):
+        # Temporarily change the working directory so that we
+        # can test get_logger() for a path outside of webkitpy.
+        working_directory = os.getcwd()
+        root_dir = "/"
+        os.chdir(root_dir)
+
+        logger = logutils.get_logger("/WebKitTools/Scripts/test-webkitpy")
+        self.assertEquals(logger.name, "test-webkitpy")
+
+        logger = logutils.get_logger("/WebKitTools/Scripts/test-webkitpy.py")
+        self.assertEquals(logger.name, "test-webkitpy")
+
+        os.chdir(working_directory)
+
+
+class ConfigureLoggingTestBase(unittest.TestCase):
+
+    """Base class for configure_logging() unit tests."""
+
+    def _logging_level(self):
+        raise Exception("Not implemented.")
+
+    def setUp(self):
+        log_stream = TestLogStream(self)
+
+        # Use a logger other than the root logger or one prefixed with
+        # "webkitpy." so as not to conflict with test-webkitpy logging.
+        logger = logging.getLogger("unittest")
+
+        # Configure the test logger not to pass messages along to the
+        # root logger.  This prevents test messages from being
+        # propagated to loggers used by test-webkitpy logging (e.g.
+        # the root logger).
+        logger.propagate = False
+
+        logging_level = self._logging_level()
+        self._handlers = logutils.configure_logging(logging_level=logging_level,
+                                                    logger=logger,
+                                                    stream=log_stream)
+        self._log = logger
+        self._log_stream = log_stream
+
+    def tearDown(self):
+        """Reset logging to its original state.
+
+        This method ensures that the logging configuration set up
+        for a unit test does not affect logging in other unit tests.
+
+        """
+        logger = self._log
+        for handler in self._handlers:
+            logger.removeHandler(handler)
+
+    def _assert_log_messages(self, messages):
+        """Assert that the logged messages equal the given messages."""
+        self._log_stream.assertMessages(messages)
+
+
+class ConfigureLoggingTest(ConfigureLoggingTestBase):
+
+    """Tests configure_logging() with the default logging level."""
+
+    def _logging_level(self):
+        return None
+
+    def test_info_message(self):
+        self._log.info("test message")
+        self._assert_log_messages(["unittest: [INFO] test message\n"])
+
+    def test_below_threshold_message(self):
+        # We test the boundary case of a logging level equal to 19.
+        # In practice, we will probably only be calling log.debug(),
+        # which corresponds to a logging level of 10.
+        level = logging.INFO - 1  # Equals 19.
+        self._log.log(level, "test message")
+        self._assert_log_messages([])
+
+    def test_two_messages(self):
+        self._log.info("message1")
+        self._log.info("message2")
+        self._assert_log_messages(["unittest: [INFO] message1\n",
+                                   "unittest: [INFO] message2\n"])
+
+
+class ConfigureLoggingCustomLevelTest(ConfigureLoggingTestBase):
+
+    """Tests configure_logging() with a custom logging level."""
+
+    _level = 36
+
+    def _logging_level(self):
+        return self._level
+
+    def test_logged_message(self):
+        self._log.log(self._level, "test message")
+        self._assert_log_messages(["unittest: [Level 36] test message\n"])
+
+    def test_below_threshold_message(self):
+        self._log.log(self._level - 1, "test message")
+        self._assert_log_messages([])
diff --git a/WebKitTools/Scripts/webkitpy/common/system/ospath.py b/WebKitTools/Scripts/webkitpy/common/system/ospath.py
new file mode 100644
index 0000000..aed7a3d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/ospath.py
@@ -0,0 +1,83 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Contains a substitute for Python 2.6's os.path.relpath()."""
+
+import os
+
+
+# This function is a replacement for os.path.relpath(), which is only
+# available in Python 2.6:
+#
+# http://docs.python.org/library/os.path.html#os.path.relpath
+#
+# It should behave essentially the same as os.path.relpath(), except for
+# returning None on paths not contained in abs_start_path.
+def relpath(path, start_path, os_path_abspath=None):
+    """Return a path relative to the given start path, or None.
+
+    Returns None if the path is not contained in the directory start_path.
+
+    Args:
+      path: An absolute or relative path to convert to a relative path.
+      start_path: The path relative to which the given path should be
+                  converted.
+      os_path_abspath: A replacement function for unit testing.  This
+                       function should strip trailing slashes just like
+                       os.path.abspath().  Defaults to os.path.abspath.
+
+    """
+    if os_path_abspath is None:
+        os_path_abspath = os.path.abspath
+
+    # Since os_path_abspath() calls os.path.normpath()--
+    #
+    # (see http://docs.python.org/library/os.path.html#os.path.abspath )
+    #
+    # it also removes trailing slashes and converts forward and backward
+    # slashes to the preferred slash os.sep.
+    start_path = os_path_abspath(start_path)
+    path = os_path_abspath(path)
+
+    if not path.lower().startswith(start_path.lower()):
+        # Then path is outside the directory given by start_path.
+        return None
+
+    rel_path = path[len(start_path):]
+
+    if not rel_path:
+        # Then the paths are the same.
+        pass
+    elif rel_path[0] == os.sep:
+        # It is probably sufficient to remove just the first character
+        # since os.path.normpath() collapses separators, but we use
+        # lstrip() just to be sure.
+        rel_path = rel_path.lstrip(os.sep)
+    else:
+        # We are in the case typified by the following example:
+        #
+        # start_path = "/tmp/foo"
+        # path = "/tmp/foobar"
+        # rel_path = "bar"
+        return None
+
+    return rel_path
diff --git a/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py
new file mode 100644
index 0000000..0493c68
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Unit tests for ospath.py."""
+
+import os
+import unittest
+
+from webkitpy.common.system.ospath import relpath
+
+
+# Make sure the tests in this class are platform independent.
+class RelPathTest(unittest.TestCase):
+
+    """Tests relpath()."""
+
+    os_path_abspath = lambda self, path: path
+
+    def _rel_path(self, path, abs_start_path):
+        return relpath(path, abs_start_path, self.os_path_abspath)
+
+    def test_same_path(self):
+        rel_path = self._rel_path("WebKit", "WebKit")
+        self.assertEquals(rel_path, "")
+
+    def test_long_rel_path(self):
+        start_path = "WebKit"
+        expected_rel_path = os.path.join("test", "Foo.txt")
+        path = os.path.join(start_path, expected_rel_path)
+
+        rel_path = self._rel_path(path, start_path)
+        self.assertEquals(expected_rel_path, rel_path)
+
+    def test_none_rel_path(self):
+        """Test _rel_path() with None return value."""
+        start_path = "WebKit"
+        path = os.path.join("other_dir", "foo.txt")
+
+        rel_path = self._rel_path(path, start_path)
+        self.assertTrue(rel_path is None)
+
+        rel_path = self._rel_path("WebKitTools", "WebKit")
+        self.assertTrue(rel_path is None)
diff --git a/WebKitTools/Scripts/webkitpy/outputcapture.py b/WebKitTools/Scripts/webkitpy/common/system/outputcapture.py
similarity index 100%
rename from WebKitTools/Scripts/webkitpy/outputcapture.py
rename to WebKitTools/Scripts/webkitpy/common/system/outputcapture.py
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user.py b/WebKitTools/Scripts/webkitpy/common/system/user.py
new file mode 100644
index 0000000..076f965
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/user.py
@@ -0,0 +1,82 @@
+# Copyright (c) 2009, 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.
+
+import os
+import shlex
+import subprocess
+import webbrowser
+
+try:
+    import readline
+except ImportError:
+    print "Unable to import readline.  If you're using MacPorts, try running:"
+    print "  sudo port install py25-readline"
+    exit(1)
+
+
+class User(object):
+    # FIXME: These are @classmethods because scm.py and bugzilla.py don't have a Tool object (thus no User instance).
+    @classmethod
+    def prompt(cls, message, repeat=1, raw_input=raw_input):
+        response = None
+        while (repeat and not response):
+            repeat -= 1
+            response = raw_input(message)
+        return response
+
+    @classmethod
+    def prompt_with_list(cls, list_title, list_items):
+        print list_title
+        i = 0
+        for item in list_items:
+            i += 1
+            print "%2d. %s" % (i, item)
+        result = int(cls.prompt("Enter a number: ")) - 1
+        return list_items[result]
+
+    def edit(self, files):
+        editor = os.environ.get("EDITOR") or "vi"
+        args = shlex.split(editor)
+        subprocess.call(args + files)
+
+    def page(self, message):
+        pager = os.environ.get("PAGER") or "less"
+        try:
+            child_process = subprocess.Popen([pager], stdin=subprocess.PIPE)
+            child_process.communicate(input=message)
+        except IOError, e:
+            pass
+
+    def confirm(self, message=None):
+        if not message:
+            message = "Continue?"
+        response = raw_input("%s [Y/n]: " % message)
+        return not response or response.lower() == "y"
+
+    def open_url(self, url):
+        webbrowser.open(url)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
new file mode 100644
index 0000000..dadead3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
@@ -0,0 +1,54 @@
+# Copyright (C) 2010 Research in Motion Ltd. 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 Research in Motion Ltd. 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.
+
+import unittest
+
+from webkitpy.common.system.user import User
+
+class UserTest(unittest.TestCase):
+
+    example_user_response = "example user response"
+
+    def test_prompt_repeat(self):
+        self.repeatsRemaining = 2
+        def mock_raw_input(message):
+            self.repeatsRemaining -= 1
+            if not self.repeatsRemaining:
+                return UserTest.example_user_response
+            return None
+        self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), UserTest.example_user_response)
+
+    def test_prompt_when_exceeded_repeats(self):
+        self.repeatsRemaining = 2
+        def mock_raw_input(message):
+            self.repeatsRemaining -= 1
+            return None
+        self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), None)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/thread/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/common/thread/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py b/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py
new file mode 100644
index 0000000..0e39285
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py
@@ -0,0 +1,59 @@
+# 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.
+
+
+class MessagePumpDelegate(object):
+    def schedule(self, interval, callback):
+        raise NotImplementedError, "subclasses must implement"
+
+    def message_available(self, message):
+        raise NotImplementedError, "subclasses must implement"
+
+    def final_message_delivered(self):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class MessagePump(object):
+    interval = 10 # seconds
+
+    def __init__(self, delegate, message_queue):
+        self._delegate = delegate
+        self._message_queue = message_queue
+        self._schedule()
+
+    def _schedule(self):
+        self._delegate.schedule(self.interval, self._callback)
+
+    def _callback(self):
+        (messages, is_running) = self._message_queue.take_all()
+        for message in messages:
+            self._delegate.message_available(message)
+        if not is_running:
+            self._delegate.final_message_delivered()
+            return
+        self._schedule()
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py b/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py
new file mode 100644
index 0000000..f731db2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py
@@ -0,0 +1,83 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+
+class TestDelegate(MessagePumpDelegate):
+    def __init__(self):
+        self.log = []
+
+    def schedule(self, interval, callback):
+        self.callback = callback
+        self.log.append("schedule")
+
+    def message_available(self, message):
+        self.log.append("message_available: %s" % message)
+
+    def final_message_delivered(self):
+        self.log.append("final_message_delivered")
+
+
+class MessagePumpTest(unittest.TestCase):
+
+    def test_basic(self):
+        queue = ThreadedMessageQueue()
+        delegate = TestDelegate()
+        pump = MessagePump(delegate, queue)
+        self.assertEqual(delegate.log, [
+            'schedule'
+        ])
+        delegate.callback()
+        queue.post("Hello")
+        queue.post("There")
+        delegate.callback()
+        self.assertEqual(delegate.log, [
+            'schedule',
+            'schedule',
+            'message_available: Hello',
+            'message_available: There',
+            'schedule'
+        ])
+        queue.post("More")
+        queue.post("Messages")
+        queue.stop()
+        delegate.callback()
+        self.assertEqual(delegate.log, [
+            'schedule',
+            'schedule',
+            'message_available: Hello',
+            'message_available: There',
+            'schedule',
+            'message_available: More',
+            'message_available: Messages',
+            'final_message_delivered'
+        ])
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py
new file mode 100644
index 0000000..6cb6f8c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py
@@ -0,0 +1,55 @@
+# 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.
+
+import threading
+
+
+class ThreadedMessageQueue(object):
+    def __init__(self):
+        self._messages = []
+        self._is_running = True
+        self._lock = threading.Lock()
+
+    def post(self, message):
+        self._lock.acquire()
+        self._messages.append(message)
+        self._lock.release()
+
+    def stop(self):
+        self._lock.acquire()
+        self._is_running = False
+        self._lock.release()
+
+    def take_all(self):
+        self._lock.acquire()
+        messages = self._messages
+        is_running = self._is_running
+        self._messages = []
+        self._lock.release()
+        return (messages, is_running)
+
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py
new file mode 100644
index 0000000..cb67c1e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py
@@ -0,0 +1,53 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+class ThreadedMessageQueueTest(unittest.TestCase):
+
+    def test_basic(self):
+        queue = ThreadedMessageQueue()
+        queue.post("Hello")
+        queue.post("There")
+        (messages, is_running) = queue.take_all()
+        self.assertEqual(messages, ["Hello", "There"])
+        self.assertTrue(is_running)
+        (messages, is_running) = queue.take_all()
+        self.assertEqual(messages, [])
+        self.assertTrue(is_running)
+        queue.post("More")
+        queue.stop()
+        queue.post("Messages")
+        (messages, is_running) = queue.take_all()
+        self.assertEqual(messages, ["More", "Messages"])
+        self.assertFalse(is_running)
+        (messages, is_running) = queue.take_all()
+        self.assertEqual(messages, [])
+        self.assertFalse(is_running)
diff --git a/WebKitTools/Scripts/webkitpy/credentials.py b/WebKitTools/Scripts/webkitpy/credentials.py
deleted file mode 100644
index 295c576..0000000
--- a/WebKitTools/Scripts/webkitpy/credentials.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-#     * 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.
-#
-# Python module for reading stored web credentials from the OS.
-
-import getpass
-import os
-import platform
-import re
-
-from webkitpy.executive import Executive, ScriptError
-from webkitpy.webkit_logging import log
-from webkitpy.scm import Git
-from webkitpy.user import User
-
-
-class Credentials(object):
-
-    def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd()):
-        self.host = host
-        self.git_prefix = git_prefix
-        self.executive = executive or Executive()
-        self.cwd = cwd
-
-    def _credentials_from_git(self):
-        return [self._read_git_config("username"),
-                self._read_git_config("password")]
-
-    def _read_git_config(self, key):
-        config_key = "%s.%s" % (self.git_prefix, key) if self.git_prefix \
-                                                      else key
-        return self.executive.run_command(
-                ["git", "config", "--get", config_key],
-                error_handler=Executive.ignore_error).rstrip('\n')
-
-    def _keychain_value_with_label(self, label, source_text):
-        match = re.search("%s\"(?P<value>.+)\"" % label,
-                                                  source_text,
-                                                  re.MULTILINE)
-        if match:
-            return match.group('value')
-
-    def _is_mac_os_x(self):
-        return platform.mac_ver()[0]
-
-    def _parse_security_tool_output(self, security_output):
-        username = self._keychain_value_with_label("^\s*\"acct\"<blob>=",
-                                                   security_output)
-        password = self._keychain_value_with_label("^password: ",
-                                                   security_output)
-        return [username, password]
-
-    def _run_security_tool(self, username=None):
-        security_command = [
-            "/usr/bin/security",
-            "find-internet-password",
-            "-g",
-            "-s",
-            self.host,
-        ]
-        if username:
-            security_command += ["-a", username]
-
-        log("Reading Keychain for %s account and password.  "
-            "Click \"Allow\" to continue..." % self.host)
-        try:
-            return self.executive.run_command(security_command)
-        except ScriptError:
-            # Failed to either find a keychain entry or somekind of OS-related
-            # error occured (for instance, couldn't find the /usr/sbin/security
-            # command).
-            log("Could not find a keychain entry for %s." % self.host)
-            return None
-
-    def _credentials_from_keychain(self, username=None):
-        if not self._is_mac_os_x():
-            return [username, None]
-
-        security_output = self._run_security_tool(username)
-        if security_output:
-            return self._parse_security_tool_output(security_output)
-        else:
-            return [None, None]
-
-    def read_credentials(self):
-        username = None
-        password = None
-
-        try:
-            if Git.in_working_directory(self.cwd):
-                (username, password) = self._credentials_from_git()
-        except OSError, e:
-            # Catch and ignore OSError exceptions such as "no such file 
-            # or directory" (OSError errno 2), which imply that the Git
-            # command cannot be found/is not installed.
-            pass
-
-        if not username or not password:
-            (username, password) = self._credentials_from_keychain(username)
-
-        if not username:
-            username = User.prompt("%s login: " % self.host)
-        if not password:
-            password = getpass.getpass("%s password for %s: " % (self.host,
-                                                                 username))
-
-        return [username, password]
diff --git a/WebKitTools/Scripts/webkitpy/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/credentials_unittest.py
deleted file mode 100644
index 0bd5340..0000000
--- a/WebKitTools/Scripts/webkitpy/credentials_unittest.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright (C) 2009 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.
-
-import os
-import tempfile
-import unittest
-from webkitpy.credentials import Credentials
-from webkitpy.executive import Executive
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
-
-class CredentialsTest(unittest.TestCase):
-    example_security_output = """keychain: "/Users/test/Library/Keychains/login.keychain"
-class: "inet"
-attributes:
-    0x00000007 <blob>="bugs.webkit.org (test@webkit.org)"
-    0x00000008 <blob>=<NULL>
-    "acct"<blob>="test@webkit.org"
-    "atyp"<blob>="form"
-    "cdat"<timedate>=0x32303039303832353233353231365A00  "20090825235216Z\000"
-    "crtr"<uint32>=<NULL>
-    "cusi"<sint32>=<NULL>
-    "desc"<blob>="Web form password"
-    "icmt"<blob>="default"
-    "invi"<sint32>=<NULL>
-    "mdat"<timedate>=0x32303039303930393137323635315A00  "20090909172651Z\000"
-    "nega"<sint32>=<NULL>
-    "path"<blob>=<NULL>
-    "port"<uint32>=0x00000000 
-    "prot"<blob>=<NULL>
-    "ptcl"<uint32>="htps"
-    "scrp"<sint32>=<NULL>
-    "sdmn"<blob>=<NULL>
-    "srvr"<blob>="bugs.webkit.org"
-    "type"<uint32>=<NULL>
-password: "SECRETSAUCE"
-"""
-
-    def test_keychain_lookup_on_non_mac(self):
-        class FakeCredentials(Credentials):
-            def _is_mac_os_x(self):
-                return False
-        credentials = FakeCredentials("bugs.webkit.org")
-        self.assertEqual(credentials._is_mac_os_x(), False)
-        self.assertEqual(credentials._credentials_from_keychain("foo"), ["foo", None])
-
-    def test_security_output_parse(self):
-        credentials = Credentials("bugs.webkit.org")
-        self.assertEqual(credentials._parse_security_tool_output(self.example_security_output), ["test@webkit.org", "SECRETSAUCE"])
-
-    def test_security_output_parse_entry_not_found(self):
-        credentials = Credentials("foo.example.com")
-        if not credentials._is_mac_os_x():
-            return # This test does not run on a non-Mac.
-
-        # Note, we ignore the captured output because it is already covered
-        # by the test case CredentialsTest._assert_security_call (below).
-        outputCapture = OutputCapture()
-        outputCapture.capture_output()
-        self.assertEqual(credentials._run_security_tool(), None)
-        outputCapture.restore_output()
-
-    def _assert_security_call(self, username=None):
-        executive_mock = Mock()
-        credentials = Credentials("example.com", executive=executive_mock)
-
-        expected_stderr = "Reading Keychain for example.com account and password.  Click \"Allow\" to continue...\n"
-        OutputCapture().assert_outputs(self, credentials._run_security_tool, [username], expected_stderr=expected_stderr)
-
-        security_args = ["/usr/bin/security", "find-internet-password", "-g", "-s", "example.com"]
-        if username:
-            security_args += ["-a", username]
-        executive_mock.run_command.assert_called_with(security_args)
-
-    def test_security_calls(self):
-        self._assert_security_call()
-        self._assert_security_call(username="foo")
-
-    def test_git_config_calls(self):
-        executive_mock = Mock()
-        credentials = Credentials("example.com", executive=executive_mock)
-        credentials._read_git_config("foo")
-        executive_mock.run_command.assert_called_with(["git", "config", "--get", "foo"], error_handler=Executive.ignore_error)
-
-        credentials = Credentials("example.com", git_prefix="test_prefix", executive=executive_mock)
-        credentials._read_git_config("foo")
-        executive_mock.run_command.assert_called_with(["git", "config", "--get", "test_prefix.foo"], error_handler=Executive.ignore_error)
-
-    def test_read_credentials_without_git_repo(self):
-        class FakeCredentials(Credentials):
-            def _is_mac_os_x(self):
-                return True
-            def _credentials_from_keychain(self, username):
-                return ["test@webkit.org", "SECRETSAUCE"]
-
-        temp_dir_path = tempfile.mkdtemp(suffix="not_a_git_repo")
-        credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
-        self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "SECRETSAUCE"])
-        os.rmdir(temp_dir_path)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/diff_parser.py b/WebKitTools/Scripts/webkitpy/diff_parser.py
deleted file mode 100644
index 7dce7e8..0000000
--- a/WebKitTools/Scripts/webkitpy/diff_parser.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright (C) 2009 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.
-
-"""WebKit's Python module for interacting with patches."""
-
-import logging
-import re
-
-
-_regexp_compile_cache = {}
-
-
-def match(pattern, string):
-    """Matches the string with the pattern, caching the compiled regexp."""
-    if not pattern in _regexp_compile_cache:
-        _regexp_compile_cache[pattern] = re.compile(pattern)
-    return _regexp_compile_cache[pattern].match(string)
-
-
-def git_diff_to_svn_diff(line):
-    """Converts a git formatted diff line to a svn formatted line.
-
-    Args:
-      line: A string representing a line of the diff.
-    """
-    conversion_patterns = (("^diff --git \w/(.+) \w/(?P<FilePath>.+)", lambda matched: "Index: " + matched.group('FilePath') + "\n"),
-                           ("^new file.*", lambda matched: "\n"),
-                           ("^index [0-9a-f]{7}\.\.[0-9a-f]{7} [0-9]{6}", lambda matched: "===================================================================\n"),
-                           ("^--- \w/(?P<FilePath>.+)", lambda matched: "--- " + matched.group('FilePath') + "\n"),
-                           ("^\+\+\+ \w/(?P<FilePath>.+)", lambda matched: "+++ " + matched.group('FilePath') + "\n"))
-
-    for pattern, conversion in conversion_patterns:
-        matched = match(pattern, line)
-        if matched:
-            return conversion(matched)
-    return line
-
-
-def get_diff_converter(first_diff_line):
-    """Gets a converter function of diff lines.
-
-    Args:
-      first_diff_line: The first filename line of a diff file.
-                       If this line is git formatted, we'll return a
-                       converter from git to SVN.
-    """
-    if match(r"^diff --git \w/", first_diff_line):
-        return git_diff_to_svn_diff
-    return lambda input: input
-
-
-_INITIAL_STATE = 1
-_DECLARED_FILE_PATH = 2
-_PROCESSING_CHUNK = 3
-
-
-class DiffFile:
-    """Contains the information for one file in a patch.
-
-    The field "lines" is a list which contains tuples in this format:
-       (deleted_line_number, new_line_number, line_string)
-    If deleted_line_number is zero, it means this line is newly added.
-    If new_line_number is zero, it means this line is deleted.
-    """
-
-    def __init__(self, filename):
-        self.filename = filename
-        self.lines = []
-
-    def add_new_line(self, line_number, line):
-        self.lines.append((0, line_number, line))
-
-    def add_deleted_line(self, line_number, line):
-        self.lines.append((line_number, 0, line))
-
-    def add_unchanged_line(self, deleted_line_number, new_line_number, line):
-        self.lines.append((deleted_line_number, new_line_number, line))
-
-
-class DiffParser:
-    """A parser for a patch file.
-
-    The field "files" is a dict whose key is the filename and value is
-    a DiffFile object.
-    """
-
-    def __init__(self, diff_input):
-        """Parses a diff.
-
-        Args:
-          diff_input: An iterable object.
-        """
-        state = _INITIAL_STATE
-
-        self.files = {}
-        current_file = None
-        old_diff_line = None
-        new_diff_line = None
-        for line in diff_input:
-            line = line.rstrip("\n")
-            if state == _INITIAL_STATE:
-                transform_line = get_diff_converter(line)
-            line = transform_line(line)
-
-            file_declaration = match(r"^Index: (?P<FilePath>.+)", line)
-            if file_declaration:
-                filename = file_declaration.group('FilePath')
-                current_file = DiffFile(filename)
-                self.files[filename] = current_file
-                state = _DECLARED_FILE_PATH
-                continue
-
-            lines_changed = match(r"^@@ -(?P<OldStartLine>\d+)(,\d+)? \+(?P<NewStartLine>\d+)(,\d+)? @@", line)
-            if lines_changed:
-                if state != _DECLARED_FILE_PATH and state != _PROCESSING_CHUNK:
-                    logging.error('Unexpected line change without file path declaration: %r' % line)
-                old_diff_line = int(lines_changed.group('OldStartLine'))
-                new_diff_line = int(lines_changed.group('NewStartLine'))
-                state = _PROCESSING_CHUNK
-                continue
-
-            if state == _PROCESSING_CHUNK:
-                if line.startswith('+'):
-                    current_file.add_new_line(new_diff_line, line[1:])
-                    new_diff_line += 1
-                elif line.startswith('-'):
-                    current_file.add_deleted_line(old_diff_line, line[1:])
-                    old_diff_line += 1
-                elif line.startswith(' '):
-                    current_file.add_unchanged_line(old_diff_line, new_diff_line, line[1:])
-                    old_diff_line += 1
-                    new_diff_line += 1
-                elif line == '\\ No newline at end of file':
-                    # Nothing to do.  We may still have some added lines.
-                    pass
-                else:
-                    logging.error('Unexpected diff format when parsing a chunk: %r' % line)
diff --git a/WebKitTools/Scripts/webkitpy/executive.py b/WebKitTools/Scripts/webkitpy/executive.py
deleted file mode 100644
index 50b119b..0000000
--- a/WebKitTools/Scripts/webkitpy/executive.py
+++ /dev/null
@@ -1,171 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-#     * 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.
-
-import os
-import StringIO
-import subprocess
-import sys
-
-from webkitpy.webkit_logging import tee
-
-
-class ScriptError(Exception):
-
-    def __init__(self,
-                 message=None,
-                 script_args=None,
-                 exit_code=None,
-                 output=None,
-                 cwd=None):
-        if not message:
-            message = 'Failed to run "%s"' % script_args
-            if exit_code:
-                message += " exit_code: %d" % exit_code
-            if cwd:
-                message += " cwd: %s" % cwd
-
-        Exception.__init__(self, message)
-        self.script_args = script_args # 'args' is already used by Exception
-        self.exit_code = exit_code
-        self.output = output
-        self.cwd = cwd
-
-    def message_with_output(self, output_limit=500):
-        if self.output:
-            if output_limit and len(self.output) > output_limit:
-                return "%s\nLast %s characters of output:\n%s" % \
-                    (self, output_limit, self.output[-output_limit:])
-            return "%s\n%s" % (self, self.output)
-        return str(self)
-
-    def command_name(self):
-        command_path = self.script_args
-        if type(command_path) is list:
-            command_path = command_path[0]
-        return os.path.basename(command_path)
-
-
-def run_command(*args, **kwargs):
-    # FIXME: This should not be a global static.
-    # New code should use Executive.run_command directly instead
-    return Executive().run_command(*args, **kwargs)
-
-
-class Executive(object):
-
-    def _run_command_with_teed_output(self, args, teed_output):
-        child_process = subprocess.Popen(args,
-                                         stdout=subprocess.PIPE,
-                                         stderr=subprocess.STDOUT)
-
-        # Use our own custom wait loop because Popen ignores a tee'd
-        # stderr/stdout.
-        # FIXME: This could be improved not to flatten output to stdout.
-        while True:
-            output_line = child_process.stdout.readline()
-            if output_line == "" and child_process.poll() != None:
-                return child_process.poll()
-            teed_output.write(output_line)
-
-    def run_and_throw_if_fail(self, args, quiet=False):
-        # Cache the child's output locally so it can be used for error reports.
-        child_out_file = StringIO.StringIO()
-        if quiet:
-            dev_null = open(os.devnull, "w")
-        child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
-        exit_code = self._run_command_with_teed_output(args, child_stdout)
-        if quiet:
-            dev_null.close()
-
-        child_output = child_out_file.getvalue()
-        child_out_file.close()
-
-        if exit_code:
-            raise ScriptError(script_args=args,
-                              exit_code=exit_code,
-                              output=child_output)
-
-    @staticmethod
-    def cpu_count():
-        # This API exists only in Python 2.6 and higher.  :(
-        try:
-            import multiprocessing
-            return multiprocessing.cpu_count()
-        except (ImportError, NotImplementedError):
-            # This quantity is a lie but probably a reasonable guess for modern
-            # machines.
-            return 2
-
-    # Error handlers do not need to be static methods once all callers are
-    # updated to use an Executive object.
-
-    @staticmethod
-    def default_error_handler(error):
-        raise error
-
-    @staticmethod
-    def ignore_error(error):
-        pass
-
-    # FIXME: This should be merged with run_and_throw_if_fail
-
-    def run_command(self,
-                    args,
-                    cwd=None,
-                    input=None,
-                    error_handler=None,
-                    return_exit_code=False,
-                    return_stderr=True):
-        if hasattr(input, 'read'): # Check if the input is a file.
-            stdin = input
-            string_to_communicate = None
-        else:
-            stdin = subprocess.PIPE if input else None
-            string_to_communicate = input
-        if return_stderr:
-            stderr = subprocess.STDOUT
-        else:
-            stderr = None
-
-        process = subprocess.Popen(args,
-                                   stdin=stdin,
-                                   stdout=subprocess.PIPE,
-                                   stderr=stderr,
-                                   cwd=cwd)
-        output = process.communicate(string_to_communicate)[0]
-        exit_code = process.wait()
-        if exit_code:
-            script_error = ScriptError(script_args=args,
-                                       exit_code=exit_code,
-                                       output=output,
-                                       cwd=cwd)
-            (error_handler or self.default_error_handler)(script_error)
-        if return_exit_code:
-            return exit_code
-        return output
diff --git a/WebKitTools/Scripts/webkitpy/executive_unittest.py b/WebKitTools/Scripts/webkitpy/executive_unittest.py
deleted file mode 100644
index f78e301..0000000
--- a/WebKitTools/Scripts/webkitpy/executive_unittest.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). 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.
-
-import unittest
-from webkitpy.executive import Executive, run_command
-
-class ExecutiveTest(unittest.TestCase):
-
-    def test_run_command_with_bad_command(self):
-        def run_bad_command():
-            run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True)
-        self.failUnlessRaises(OSError, run_bad_command)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/grammar.py b/WebKitTools/Scripts/webkitpy/grammar.py
deleted file mode 100644
index 651bbc9..0000000
--- a/WebKitTools/Scripts/webkitpy/grammar.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-#     * 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.
-
-import re
-
-
-def plural(noun):
-    # This is a dumb plural() implementation that is just enough for our uses.
-    if re.search("h$", noun):
-        return noun + "es"
-    else:
-        return noun + "s"
-
-
-def pluralize(noun, count):
-    if count != 1:
-        noun = plural(noun)
-    return "%d %s" % (count, noun)
-
-
-def join_with_separators(list_of_strings, separator=', ', last_separator=', and '):
-    if not list_of_strings:
-        return ""
-    if len(list_of_strings) == 1:
-        return list_of_strings[0]
-    return "%s%s%s" % (separator.join(list_of_strings[:-1]), last_separator, list_of_strings[-1])
diff --git a/WebKitTools/Scripts/webkitpy/grammar_unittest.py b/WebKitTools/Scripts/webkitpy/grammar_unittest.py
deleted file mode 100644
index 3d8b179..0000000
--- a/WebKitTools/Scripts/webkitpy/grammar_unittest.py
+++ /dev/null
@@ -1,38 +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.
-
-import unittest
-from webkitpy.grammar import join_with_separators
-
-class GrammarTest(unittest.TestCase):
-
-    def test_join_with_separators(self):
-        self.assertEqual(join_with_separators(["one", "two", "three"]), "one, two, and three")
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py b/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
index 6e4ba99..231ed70 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
@@ -61,17 +61,19 @@
 
 
 if __name__ == '__main__':
-    optparser = optparse.OptionParser()
-    optparser.add_option('-p', '--platform', action='store', default='mac',
-                         help='Platform to test (e.g., "mac", "chromium-mac", etc.')
-    optparser.add_option('-t', '--target', action='store', default='Release',
-                         help='build type ("Debug" or "Release")')
-    optparser.add_option('', '--timeout', action='store', default='2000',
-                         help='test timeout in milliseconds (2000 by default)')
-    optparser.add_option('', '--wrapper', action='store')
-    optparser.add_option('', '--no-pixel-tests', action='store_true',
-                         default=False,
-                         help='disable pixel-to-pixel PNG comparisons')
+    # FIXME: configuration_options belong in a shared location.
+    configuration_options = [
+        optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
+        optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
+    ]
+    misc_options = [
+        optparse.make_option('-p', '--platform', action='store', default='mac', help='Platform to test (e.g., "mac", "chromium-mac", etc.'),
+        optparse.make_option('--timeout', action='store', default='2000', help='test timeout in milliseconds (2000 by default)'),
+        optparse.make_option('--wrapper', action='store'),
+        optparse.make_option('--no-pixel-tests', action='store_true', default=False, help='disable pixel-to-pixel PNG comparisons'),
+    ]
+    option_list = configuration_options + misc_options
+    optparser = optparse.OptionParser(option_list=option_list)
     options, args = optparser.parse_args()
     p = port.get(options.platform, options)
     run_tests(p, options, args)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
new file mode 100644
index 0000000..e61d11f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -0,0 +1,454 @@
+#!/usr/bin/env python
+# 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.
+
+"""A Thread object for running DumpRenderTree and processing URLs from a
+shared queue.
+
+Each thread runs a separate instance of the DumpRenderTree binary and validates
+the output.  When there are no more URLs to process in the shared queue, the
+thread exits.
+"""
+
+import copy
+import logging
+import os
+import Queue
+import signal
+import sys
+import thread
+import threading
+import time
+
+import test_failures
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+                         "dump_render_tree_thread")
+
+
+def process_output(port, test_info, test_types, test_args, configuration,
+                   output_dir, crash, timeout, test_run_time, actual_checksum,
+                   output, error):
+    """Receives the output from a DumpRenderTree process, subjects it to a
+    number of tests, and returns a list of failure types the test produced.
+
+    Args:
+      port: port-specific hooks
+      proc: an active DumpRenderTree process
+      test_info: Object containing the test filename, uri and timeout
+      test_types: list of test types to subject the output to
+      test_args: arguments to be passed to each test
+      configuration: Debug or Release
+      output_dir: directory to put crash stack traces into
+
+    Returns: a TestResult object
+    """
+    failures = []
+
+    # Some test args, such as the image hash, may be added or changed on a
+    # test-by-test basis.
+    local_test_args = copy.copy(test_args)
+
+    local_test_args.hash = actual_checksum
+
+    if crash:
+        failures.append(test_failures.FailureCrash())
+    if timeout:
+        failures.append(test_failures.FailureTimeout())
+
+    if crash:
+        _log.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
+        # Strip off "file://" since RelativeTestFilename expects
+        # filesystem paths.
+        filename = os.path.join(output_dir, port.relative_test_filename(
+                                test_info.filename))
+        filename = os.path.splitext(filename)[0] + "-stack.txt"
+        port.maybe_make_directory(os.path.split(filename)[0])
+        open(filename, "wb").write(error)  # FIXME: This leaks a file handle.
+    elif error:
+        _log.debug("Previous test output extra lines after dump:\n%s" %
+                   error)
+
+    # Check the output and save the results.
+    start_time = time.time()
+    time_for_diffs = {}
+    for test_type in test_types:
+        start_diff_time = time.time()
+        new_failures = test_type.compare_output(port, test_info.filename,
+                                                output, local_test_args,
+                                                configuration)
+        # Don't add any more failures if we already have a crash, so we don't
+        # double-report those tests. We do double-report for timeouts since
+        # we still want to see the text and image output.
+        if not crash:
+            failures.extend(new_failures)
+        time_for_diffs[test_type.__class__.__name__] = (
+            time.time() - start_diff_time)
+
+    total_time_for_all_diffs = time.time() - start_diff_time
+    return TestResult(test_info.filename, failures, test_run_time,
+                      total_time_for_all_diffs, time_for_diffs)
+
+
+class TestResult(object):
+
+    def __init__(self, filename, failures, test_run_time,
+                 total_time_for_all_diffs, time_for_diffs):
+        self.failures = failures
+        self.filename = filename
+        self.test_run_time = test_run_time
+        self.time_for_diffs = time_for_diffs
+        self.total_time_for_all_diffs = total_time_for_all_diffs
+        self.type = test_failures.determine_result_type(failures)
+
+
+class SingleTestThread(threading.Thread):
+    """Thread wrapper for running a single test file."""
+
+    def __init__(self, port, image_path, shell_args, test_info,
+        test_types, test_args, configuration, output_dir):
+        """
+        Args:
+          port: object implementing port-specific hooks
+          test_info: Object containing the test filename, uri and timeout
+          output_dir: Directory to put crash stacks into.
+          See TestShellThread for documentation of the remaining arguments.
+        """
+
+        threading.Thread.__init__(self)
+        self._port = port
+        self._image_path = image_path
+        self._shell_args = shell_args
+        self._test_info = test_info
+        self._test_types = test_types
+        self._test_args = test_args
+        self._configuration = configuration
+        self._output_dir = output_dir
+
+    def run(self):
+        test_info = self._test_info
+        driver = self._port.start_driver(self._image_path, self._shell_args)
+        start = time.time()
+        crash, timeout, actual_checksum, output, error = \
+            driver.run_test(test_info.uri.strip(), test_info.timeout,
+                            test_info.image_hash())
+        end = time.time()
+        self._test_result = process_output(self._port,
+            test_info, self._test_types, self._test_args,
+            self._configuration, self._output_dir, crash, timeout, end - start,
+            actual_checksum, output, error)
+        driver.stop()
+
+    def get_test_result(self):
+        return self._test_result
+
+
+class TestShellThread(threading.Thread):
+
+    def __init__(self, port, filename_list_queue, result_queue,
+                 test_types, test_args, image_path, shell_args, options):
+        """Initialize all the local state for this DumpRenderTree thread.
+
+        Args:
+          port: interface to port-specific hooks
+          filename_list_queue: A thread safe Queue class that contains lists
+              of tuples of (filename, uri) pairs.
+          result_queue: A thread safe Queue class that will contain tuples of
+              (test, failure lists) for the test results.
+          test_types: A list of TestType objects to run the test output
+              against.
+          test_args: A TestArguments object to pass to each TestType.
+          shell_args: Any extra arguments to be passed to DumpRenderTree.
+          options: A property dictionary as produced by optparse. The
+              command-line options should match those expected by
+              run_webkit_tests; they are typically passed via the
+              run_webkit_tests.TestRunner class."""
+        threading.Thread.__init__(self)
+        self._port = port
+        self._filename_list_queue = filename_list_queue
+        self._result_queue = result_queue
+        self._filename_list = []
+        self._test_types = test_types
+        self._test_args = test_args
+        self._driver = None
+        self._image_path = image_path
+        self._shell_args = shell_args
+        self._options = options
+        self._canceled = False
+        self._exception_info = None
+        self._directory_timing_stats = {}
+        self._test_results = []
+        self._num_tests = 0
+        self._start_time = 0
+        self._stop_time = 0
+
+        # Current directory of tests we're running.
+        self._current_dir = None
+        # Number of tests in self._current_dir.
+        self._num_tests_in_current_dir = None
+        # Time at which we started running tests from self._current_dir.
+        self._current_dir_start_time = None
+
+    def get_directory_timing_stats(self):
+        """Returns a dictionary mapping test directory to a tuple of
+        (number of tests in that directory, time to run the tests)"""
+        return self._directory_timing_stats
+
+    def get_test_results(self):
+        """Return the list of all tests run on this thread.
+
+        This is used to calculate per-thread statistics.
+
+        """
+        return self._test_results
+
+    def cancel(self):
+        """Set a flag telling this thread to quit."""
+        self._canceled = True
+
+    def get_exception_info(self):
+        """If run() terminated on an uncaught exception, return it here
+        ((type, value, traceback) tuple).
+        Returns None if run() terminated normally. Meant to be called after
+        joining this thread."""
+        return self._exception_info
+
+    def get_total_time(self):
+        return max(self._stop_time - self._start_time, 0.0)
+
+    def get_num_tests(self):
+        return self._num_tests
+
+    def run(self):
+        """Delegate main work to a helper method and watch for uncaught
+        exceptions."""
+        self._start_time = time.time()
+        self._num_tests = 0
+        try:
+            _log.debug('%s starting' % (self.getName()))
+            self._run(test_runner=None, result_summary=None)
+            _log.debug('%s done (%d tests)' % (self.getName(),
+                       self.get_num_tests()))
+        except:
+            # Save the exception for our caller to see.
+            self._exception_info = sys.exc_info()
+            self._stop_time = time.time()
+            # Re-raise it and die.
+            _log.error('%s dying: %s' % (self.getName(),
+                       self._exception_info))
+            raise
+        self._stop_time = time.time()
+
+    def run_in_main_thread(self, test_runner, result_summary):
+        """This hook allows us to run the tests from the main thread if
+        --num-test-shells==1, instead of having to always run two or more
+        threads. This allows us to debug the test harness without having to
+        do multi-threaded debugging."""
+        self._run(test_runner, result_summary)
+
+    def _run(self, test_runner, result_summary):
+        """Main work entry point of the thread. Basically we pull urls from the
+        filename queue and run the tests until we run out of urls.
+
+        If test_runner is not None, then we call test_runner.UpdateSummary()
+        with the results of each test."""
+        batch_size = 0
+        batch_count = 0
+        if self._options.batch_size:
+            try:
+                batch_size = int(self._options.batch_size)
+            except:
+                _log.info("Ignoring invalid batch size '%s'" %
+                          self._options.batch_size)
+
+        # Append tests we're running to the existing tests_run.txt file.
+        # This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
+        tests_run_filename = os.path.join(self._options.results_directory,
+                                          "tests_run.txt")
+        tests_run_file = open(tests_run_filename, "a")
+
+        while True:
+            if self._canceled:
+                _log.info('Testing canceled')
+                tests_run_file.close()
+                return
+
+            if len(self._filename_list) is 0:
+                if self._current_dir is not None:
+                    self._directory_timing_stats[self._current_dir] = \
+                        (self._num_tests_in_current_dir,
+                         time.time() - self._current_dir_start_time)
+
+                try:
+                    self._current_dir, self._filename_list = \
+                        self._filename_list_queue.get_nowait()
+                except Queue.Empty:
+                    self._kill_dump_render_tree()
+                    tests_run_file.close()
+                    return
+
+                self._num_tests_in_current_dir = len(self._filename_list)
+                self._current_dir_start_time = time.time()
+
+            test_info = self._filename_list.pop()
+
+            # We have a url, run tests.
+            batch_count += 1
+            self._num_tests += 1
+            if self._options.run_singly:
+                result = self._run_test_singly(test_info)
+            else:
+                result = self._run_test(test_info)
+
+            filename = test_info.filename
+            tests_run_file.write(filename + "\n")
+            if result.failures:
+                # Check and kill DumpRenderTree if we need to.
+                if len([1 for f in result.failures
+                        if f.should_kill_dump_render_tree()]):
+                    self._kill_dump_render_tree()
+                    # Reset the batch count since the shell just bounced.
+                    batch_count = 0
+                # Print the error message(s).
+                error_str = '\n'.join(['  ' + f.message() for
+                                       f in result.failures])
+                _log.debug("%s %s failed:\n%s" % (self.getName(),
+                           self._port.relative_test_filename(filename),
+                           error_str))
+            else:
+                _log.debug("%s %s passed" % (self.getName(),
+                           self._port.relative_test_filename(filename)))
+            self._result_queue.put(result)
+
+            if batch_size > 0 and batch_count > batch_size:
+                # Bounce the shell and reset count.
+                self._kill_dump_render_tree()
+                batch_count = 0
+
+            if test_runner:
+                test_runner.update_summary(result_summary)
+
+    def _run_test_singly(self, test_info):
+        """Run a test in a separate thread, enforcing a hard time limit.
+
+        Since we can only detect the termination of a thread, not any internal
+        state or progress, we can only run per-test timeouts when running test
+        files singly.
+
+        Args:
+          test_info: Object containing the test filename, uri and timeout
+
+        Returns:
+          A TestResult
+
+        """
+        worker = SingleTestThread(self._port, self._image_path,
+                                  self._shell_args,
+                                  test_info,
+                                  self._test_types,
+                                  self._test_args,
+                                  self._options.configuration,
+                                  self._options.results_directory)
+
+        worker.start()
+
+        # When we're running one test per DumpRenderTree process, we can
+        # enforce a hard timeout.  The DumpRenderTree watchdog uses 2.5x
+        # the timeout; we want to be larger than that.
+        worker.join(int(test_info.timeout) * 3.0 / 1000.0)
+        if worker.isAlive():
+            # If join() returned with the thread still running, the
+            # DumpRenderTree is completely hung and there's nothing
+            # more we can do with it.  We have to kill all the
+            # DumpRenderTrees to free it up. If we're running more than
+            # one DumpRenderTree thread, we'll end up killing the other
+            # DumpRenderTrees too, introducing spurious crashes. We accept
+            # that tradeoff in order to avoid losing the rest of this
+            # thread's results.
+            _log.error('Test thread hung: killing all DumpRenderTrees')
+            worker._driver.stop()
+
+        try:
+            result = worker.get_test_result()
+        except AttributeError, e:
+            failures = []
+            _log.error('Cannot get results of test: %s' %
+                       test_info.filename)
+            result = TestResult(test_info.filename, failures=[],
+                                test_run_time=0, total_time_for_all_diffs=0,
+                                time_for_diffs=0)
+
+        return result
+
+    def _run_test(self, test_info):
+        """Run a single test file using a shared DumpRenderTree process.
+
+        Args:
+          test_info: Object containing the test filename, uri and timeout
+
+        Returns:
+          A list of TestFailure objects describing the error.
+
+        """
+        self._ensure_dump_render_tree_is_running()
+        # The pixel_hash is used to avoid doing an image dump if the
+        # checksums match, so it should be set to a blank value if we
+        # are generating a new baseline.  (Otherwise, an image from a
+        # previous run will be copied into the baseline.)
+        image_hash = test_info.image_hash()
+        if image_hash and self._test_args.new_baseline:
+            image_hash = ""
+        start = time.time()
+        crash, timeout, actual_checksum, output, error = \
+           self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
+        end = time.time()
+
+        result = process_output(self._port, test_info, self._test_types,
+                                self._test_args, self._options.configuration,
+                                self._options.results_directory, crash,
+                                timeout, end - start, actual_checksum,
+                                output, error)
+        self._test_results.append(result)
+        return result
+
+    def _ensure_dump_render_tree_is_running(self):
+        """Start the shared DumpRenderTree, if it's not running.
+
+        This is not for use when running tests singly, since those each start
+        a separate DumpRenderTree in their own thread.
+
+        """
+        if (not self._driver or self._driver.poll() is not None):
+            self._driver = self._port.start_driver(
+                self._image_path, self._shell_args)
+
+    def _kill_dump_render_tree(self):
+        """Kill the DumpRenderTree process if it's running."""
+        if self._driver:
+            self._driver.stop()
+            self._driver = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index 520ab1f..cee44ad 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -29,12 +29,11 @@
 
 import logging
 import os
-import simplejson
 
-from layout_package import json_results_generator
-from layout_package import test_expectations
-from layout_package import test_failures
-
+from webkitpy.layout_tests.layout_package import json_results_generator
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_failures
+import webkitpy.thirdparty.simplejson as simplejson
 
 class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGenerator):
     """A JSON results generator for layout tests."""
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 84be0e1..6263540 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -29,14 +29,17 @@
 
 import logging
 import os
-import simplejson
 import subprocess
 import sys
 import time
 import urllib2
 import xml.dom.minidom
 
-from layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_expectations
+import webkitpy.thirdparty.simplejson as simplejson
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+                         "json_results_generator")
 
 
 class JSONResultsGenerator(object):
@@ -154,8 +157,8 @@
             # Check if we have the archived JSON file on the buildbot server.
             results_file_url = (self._builder_base_url +
                 self._build_name + "/" + self.RESULTS_FILENAME)
-            logging.error("Local results.json file does not exist. Grabbing "
-                "it off the archive at " + results_file_url)
+            _log.error("Local results.json file does not exist. Grabbing "
+                       "it off the archive at " + results_file_url)
 
             try:
                 results_file = urllib2.urlopen(results_file_url)
@@ -177,11 +180,11 @@
             try:
                 results_json = simplejson.loads(old_results)
             except:
-                logging.debug("results.json was not valid JSON. Clobbering.")
+                _log.debug("results.json was not valid JSON. Clobbering.")
                 # The JSON file is not valid JSON. Just clobber the results.
                 results_json = {}
         else:
-            logging.debug('Old JSON results do not exist. Starting fresh.')
+            _log.debug('Old JSON results do not exist. Starting fresh.')
             results_json = {}
 
         return results_json, error
@@ -192,14 +195,14 @@
         if error:
             # If there was an error don't write a results.json
             # file at all as it would lose all the information on the bot.
-            logging.error("Archive directory is inaccessible. Not modifying "
-                "or clobbering the results.json file: " + str(error))
+            _log.error("Archive directory is inaccessible. Not modifying "
+                       "or clobbering the results.json file: " + str(error))
             return None
 
         builder_name = self._builder_name
         if results_json and builder_name not in results_json:
-            logging.debug("Builder name (%s) is not in the results.json file."
-                          % builder_name)
+            _log.debug("Builder name (%s) is not in the results.json file."
+                       % builder_name)
 
         self._convert_json_to_current_version(results_json)
 
@@ -307,16 +310,20 @@
         # These next two branches test to see which source repos we can
         # pull revisions from.
         if hasattr(self._port, 'path_from_webkit_base'):
-            path_to_webkit = self._port.path_from_webkit_base()
+            path_to_webkit = self._port.path_from_webkit_base('WebCore')
             self._insert_item_into_raw_list(results_for_builder,
                 self._get_svn_revision(path_to_webkit),
                 self.WEBKIT_SVN)
 
         if hasattr(self._port, 'path_from_chromium_base'):
-            path_to_chrome = self._port.path_from_chromium_base()
-            self._insert_item_into_raw_list(results_for_builder,
-                self._get_svn_revision(path_to_chrome),
-                self.CHROME_SVN)
+            try:
+                path_to_chrome = self._port.path_from_chromium_base()
+                self._insert_item_into_raw_list(results_for_builder,
+                    self._get_svn_revision(path_to_chrome),
+                    self.CHROME_SVN)
+            except AssertionError:
+                # We're not in a Chromium checkout, that's ok.
+                pass
 
         self._insert_item_into_raw_list(results_for_builder,
             int(time.time()),
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
index 72b30a1..930b9e4 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
@@ -34,6 +34,10 @@
 can be used to produce effects like progress bars.
 """
 
+import logging
+
+_log = logging.getLogger("webkitpy.layout_tests.metered_stream")
+
 
 class MeteredStream:
     """This class is a wrapper around a stream that allows you to implement
@@ -57,8 +61,7 @@
         self._last_update = ""
 
     def write(self, txt):
-        """Write text directly to the stream, overwriting and resetting the
-        meter."""
+        """Write to the stream, overwriting and resetting the meter."""
         if self._dirty:
             self.update("")
             self._dirty = False
@@ -68,22 +71,43 @@
         """Flush any buffered output."""
         self._stream.flush()
 
-    def update(self, str):
-        """Write an update to the stream that will get overwritten by the next
-        update() or by a write().
+    def progress(self, str):
+        """
+        Write a message to the stream that will get overwritten.
 
         This is used for progress updates that don't need to be preserved in
-        the log. Note that verbose disables this routine; we have this in
-        case we are logging lots of output and the update()s will get lost
-        or won't work properly (typically because verbose streams are
-        redirected to files.
+        the log. If the MeteredStream was initialized with verbose==True,
+        then this output is discarded. We have this in case we are logging
+        lots of output and the update()s will get lost or won't work
+        properly (typically because verbose streams are redirected to files).
 
-        TODO(dpranke): figure out if there is a way to detect if we're writing
-        to a stream that handles CRs correctly (e.g., terminals). That might
-        be a cleaner way of handling this.
         """
         if self._verbose:
             return
+        self._write(str)
+
+    def update(self, str):
+        """
+        Write a message that is also included when logging verbosely.
+
+        This routine preserves the same console logging behavior as progress(),
+        but will also log the message if verbose() was true.
+
+        """
+        # Note this is a separate routine that calls either into the logger
+        # or the metering stream. We have to be careful to avoid a layering
+        # inversion (stream calling back into the logger).
+        if self._verbose:
+            _log.info(str)
+        else:
+            self._write(str)
+
+    def _write(self, str):
+        """Actually write the message to the stream."""
+
+        # FIXME: Figure out if there is a way to detect if we're writing
+        # to a stream that handles CRs correctly (e.g., terminals). That might
+        # be a cleaner way of handling this.
 
         # Print the necessary number of backspaces to erase the previous
         # message.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index 01add62..38223dd 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -36,7 +36,10 @@
 import re
 import sys
 
-import simplejson
+import webkitpy.thirdparty.simplejson as simplejson
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+                         "test_expectations")
 
 # Test expectation and modifier constants.
 (PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, TIMEOUT, CRASH, SKIP, WONTFIX,
@@ -46,11 +49,46 @@
 (NO_CHANGE, REMOVE_TEST, REMOVE_PLATFORM, ADD_PLATFORMS_EXCEPT_THIS) = range(4)
 
 
+def result_was_expected(result, expected_results, test_needs_rebaselining,
+                        test_is_skipped):
+    """Returns whether we got a result we were expecting.
+    Args:
+        result: actual result of a test execution
+        expected_results: set of results listed in test_expectations
+        test_needs_rebaselining: whether test was marked as REBASELINE
+        test_is_skipped: whether test was marked as SKIP"""
+    if result in expected_results:
+        return True
+    if result in (IMAGE, TEXT, IMAGE_PLUS_TEXT) and FAIL in expected_results:
+        return True
+    if result == MISSING and test_needs_rebaselining:
+        return True
+    if result == SKIP and test_is_skipped:
+        return True
+    return False
+
+
+def remove_pixel_failures(expected_results):
+    """Returns a copy of the expected results for a test, except that we
+    drop any pixel failures and return the remaining expectations. For example,
+    if we're not running pixel tests, then tests expected to fail as IMAGE
+    will PASS."""
+    expected_results = expected_results.copy()
+    if IMAGE in expected_results:
+        expected_results.remove(IMAGE)
+        expected_results.add(PASS)
+    if IMAGE_PLUS_TEXT in expected_results:
+        expected_results.remove(IMAGE_PLUS_TEXT)
+        expected_results.add(TEXT)
+    return expected_results
+
+
 class TestExpectations:
     TEST_LIST = "test_expectations.txt"
 
     def __init__(self, port, tests, expectations, test_platform_name,
-                 is_debug_mode, is_lint_mode, tests_are_present=True):
+                 is_debug_mode, is_lint_mode, tests_are_present=True,
+                 overrides=None):
         """Loads and parses the test expectations given in the string.
         Args:
             port: handle to object containing platform-specific functionality
@@ -67,10 +105,14 @@
                 system and can be probed for. This is useful for distinguishing
                 test files from directories, and is needed by the LTTF
                 dashboard, where the files aren't actually locally present.
+            overrides: test expectations that are allowed to override any
+                entries in |expectations|. This is used by callers
+                that need to manage two sets of expectations (e.g., upstream
+                and downstream expectations).
         """
         self._expected_failures = TestExpectationsFile(port, expectations,
             tests, test_platform_name, is_debug_mode, is_lint_mode,
-            tests_are_present=tests_are_present)
+            tests_are_present=tests_are_present, overrides=overrides)
 
     # TODO(ojan): Allow for removing skipped tests when getting the list of
     # tests to run, but not when getting metrics.
@@ -101,12 +143,16 @@
         retval = []
 
         for expectation in expectations:
-            for item in TestExpectationsFile.EXPECTATIONS.items():
-                if item[1] == expectation:
-                    retval.append(item[0])
-                    break
+            retval.append(self.expectation_to_string(expectation))
 
-        return " ".join(retval).upper()
+        return " ".join(retval)
+
+    def expectation_to_string(self, expectation):
+        """Return the uppercased string equivalent of a given expectation."""
+        for item in TestExpectationsFile.EXPECTATIONS.items():
+            if item[1] == expectation:
+                return item[0].upper()
+        return ""
 
     def get_timeline_for_test(self, test):
         return self._expected_failures.get_timeline_for_test(test)
@@ -117,14 +163,13 @@
     def get_tests_with_timeline(self, timeline):
         return self._expected_failures.get_tests_with_timeline(timeline)
 
-    def matches_an_expected_result(self, test, result):
-        """Returns whether we got one of the expected results for this test."""
-        return (result in self._expected_failures.get_expectations(test) or
-                (result in (IMAGE, TEXT, IMAGE_PLUS_TEXT) and
-                FAIL in self._expected_failures.get_expectations(test)) or
-                result == MISSING and self.is_rebaselining(test) or
-                result == SKIP and self._expected_failures.has_modifier(test,
-                                                                        SKIP))
+    def matches_an_expected_result(self, test, result,
+                                   pixel_tests_are_enabled):
+        expected_results = self._expected_failures.get_expectations(test)
+        if not pixel_tests_are_enabled:
+            expected_results = remove_pixel_failures(expected_results)
+        return result_was_expected(result, expected_results,
+            self.is_rebaselining(test), self.has_modifier(test, SKIP))
 
     def is_rebaselining(self, test):
         return self._expected_failures.has_modifier(test, REBASELINE)
@@ -232,8 +277,8 @@
                                 IMAGE: ('image mismatch', 'image mismatch'),
                                 IMAGE_PLUS_TEXT: ('image and text mismatch',
                                                   'image and text mismatch'),
-                                CRASH: ('test shell crash',
-                                        'test shell crashes'),
+                                CRASH: ('DumpRenderTree crash',
+                                        'DumpRenderTree crashes'),
                                 TIMEOUT: ('test timed out', 'tests timed out'),
                                 MISSING: ('no expected result found',
                                           'no expected results found')}
@@ -261,7 +306,7 @@
 
     def __init__(self, port, expectations, full_test_list, test_platform_name,
         is_debug_mode, is_lint_mode, suppress_errors=False,
-        tests_are_present=True):
+        tests_are_present=True, overrides=None):
         """
         expectations: Contents of the expectations file
         full_test_list: The list of all tests to be run pending processing of
@@ -275,6 +320,10 @@
         tests_are_present: Whether the test files are present in the local
             filesystem. The LTTF Dashboard uses False here to avoid having to
             keep a local copy of the tree.
+        overrides: test expectations that are allowed to override any
+            entries in |expectations|. This is used by callers
+            that need to manage two sets of expectations (e.g., upstream
+            and downstream expectations).
         """
 
         self._port = port
@@ -284,6 +333,7 @@
         self._is_debug_mode = is_debug_mode
         self._is_lint_mode = is_lint_mode
         self._tests_are_present = tests_are_present
+        self._overrides = overrides
         self._suppress_errors = suppress_errors
         self._errors = []
         self._non_fatal_errors = []
@@ -311,7 +361,50 @@
         self._timeline_to_tests = self._dict_of_sets(self.TIMELINES)
         self._result_type_to_tests = self._dict_of_sets(self.RESULT_TYPES)
 
-        self._read(self._get_iterable_expectations())
+        self._read(self._get_iterable_expectations(self._expectations),
+                   overrides_allowed=False)
+
+        # List of tests that are in the overrides file (used for checking for
+        # duplicates inside the overrides file itself). Note that just because
+        # a test is in this set doesn't mean it's necessarily overridding a
+        # expectation in the regular expectations; the test might not be
+        # mentioned in the regular expectations file at all.
+        self._overridding_tests = set()
+
+        if overrides:
+            self._read(self._get_iterable_expectations(self._overrides),
+                       overrides_allowed=True)
+
+        self._handle_any_read_errors()
+        self._process_tests_without_expectations()
+
+    def _handle_any_read_errors(self):
+        if not self._suppress_errors and (
+            len(self._errors) or len(self._non_fatal_errors)):
+            if self._is_debug_mode:
+                build_type = 'DEBUG'
+            else:
+                build_type = 'RELEASE'
+            _log.error('')
+            _log.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" %
+                       (self._test_platform_name.upper(), build_type))
+
+            for error in self._non_fatal_errors:
+                _log.error(error)
+            _log.error('')
+
+            if len(self._errors):
+                raise SyntaxError('\n'.join(map(str, self._errors)))
+
+    def _process_tests_without_expectations(self):
+        expectations = set([PASS])
+        options = []
+        modifiers = []
+        if self._full_test_list:
+            for test in self._full_test_list:
+                if not test in self._test_list_paths:
+                    self._add_test(test, modifiers, expectations, options,
+                        overrides_allowed=False)
 
     def _dict_of_sets(self, strings_to_constants):
         """Takes a dict of strings->constants and returns a dict mapping
@@ -321,12 +414,11 @@
             d[c] = set()
         return d
 
-    def _get_iterable_expectations(self):
+    def _get_iterable_expectations(self, expectations_str):
         """Returns an object that can be iterated over. Allows for not caring
         about whether we're iterating over a file or a new-line separated
         string."""
-        iterable = [x + "\n" for x in
-            self._expectations.split("\n")]
+        iterable = [x + "\n" for x in expectations_str.split("\n")]
         # Strip final entry if it's empty to avoid added in an extra
         # newline.
         if iterable[-1] == "\n":
@@ -388,7 +480,7 @@
           the updated string.
         """
 
-        f_orig = self._get_iterable_expectations()
+        f_orig = self._get_iterable_expectations(self._expectations)
         f_new = []
 
         tests_removed = 0
@@ -400,20 +492,20 @@
                                                       platform)
             if action == NO_CHANGE:
                 # Save the original line back to the file
-                logging.debug('No change to test: %s', line)
+                _log.debug('No change to test: %s', line)
                 f_new.append(line)
             elif action == REMOVE_TEST:
                 tests_removed += 1
-                logging.info('Test removed: %s', line)
+                _log.info('Test removed: %s', line)
             elif action == REMOVE_PLATFORM:
                 parts = line.split(':')
                 new_options = parts[0].replace(platform.upper() + ' ', '', 1)
                 new_line = ('%s:%s' % (new_options, parts[1]))
                 f_new.append(new_line)
                 tests_updated += 1
-                logging.info('Test updated: ')
-                logging.info('  old: %s', line)
-                logging.info('  new: %s', new_line)
+                _log.info('Test updated: ')
+                _log.info('  old: %s', line)
+                _log.info('  new: %s', new_line)
             elif action == ADD_PLATFORMS_EXCEPT_THIS:
                 parts = line.split(':')
                 new_options = parts[0]
@@ -430,15 +522,15 @@
                 new_line = ('%s:%s' % (new_options, parts[1]))
                 f_new.append(new_line)
                 tests_updated += 1
-                logging.info('Test updated: ')
-                logging.info('  old: %s', line)
-                logging.info('  new: %s', new_line)
+                _log.info('Test updated: ')
+                _log.info('  old: %s', line)
+                _log.info('  new: %s', new_line)
             else:
-                logging.error('Unknown update action: %d; line: %s',
-                              action, line)
+                _log.error('Unknown update action: %d; line: %s',
+                           action, line)
 
-        logging.info('Total tests removed: %d', tests_removed)
-        logging.info('Total tests updated: %d', tests_updated)
+        _log.info('Total tests removed: %d', tests_removed)
+        _log.info('Total tests updated: %d', tests_updated)
 
         return "".join(f_new)
 
@@ -574,7 +666,7 @@
         self._all_expectations[test].append(
             ModifiersAndExpectations(options, expectations))
 
-    def _read(self, expectations):
+    def _read(self, expectations, overrides_allowed):
         """For each test in an expectations iterable, generate the
         expectations for it."""
         lineno = 0
@@ -625,30 +717,7 @@
                 tests = self._expand_tests(test_list_path)
 
             self._add_tests(tests, expectations, test_list_path, lineno,
-                           modifiers, options)
-
-        if not self._suppress_errors and (
-            len(self._errors) or len(self._non_fatal_errors)):
-            if self._is_debug_mode:
-                build_type = 'DEBUG'
-            else:
-                build_type = 'RELEASE'
-            print "\nFAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" \
-                % (self._test_platform_name.upper(), build_type)
-
-            for error in self._non_fatal_errors:
-                logging.error(error)
-            if len(self._errors):
-                raise SyntaxError('\n'.join(map(str, self._errors)))
-
-        # Now add in the tests that weren't present in the expectations file
-        expectations = set([PASS])
-        options = []
-        modifiers = []
-        if self._full_test_list:
-            for test in self._full_test_list:
-                if not test in self._test_list_paths:
-                    self._add_test(test, modifiers, expectations, options)
+                           modifiers, options, overrides_allowed)
 
     def _get_options_list(self, listString):
         return [part.strip().lower() for part in listString.strip().split(' ')]
@@ -692,15 +761,18 @@
         return path
 
     def _add_tests(self, tests, expectations, test_list_path, lineno,
-                   modifiers, options):
+                   modifiers, options, overrides_allowed):
         for test in tests:
-            if self._already_seen_test(test, test_list_path, lineno):
+            if self._already_seen_test(test, test_list_path, lineno,
+                                       overrides_allowed):
                 continue
 
             self._clear_expectations_for_test(test, test_list_path)
-            self._add_test(test, modifiers, expectations, options)
+            self._add_test(test, modifiers, expectations, options,
+                           overrides_allowed)
 
-    def _add_test(self, test, modifiers, expectations, options):
+    def _add_test(self, test, modifiers, expectations, options,
+                  overrides_allowed):
         """Sets the expected state for a given test.
 
         This routine assumes the test has not been added before. If it has,
@@ -711,7 +783,9 @@
           test: test to add
           modifiers: sequence of modifier keywords ('wontfix', 'slow', etc.)
           expectations: sequence of expectations (PASS, IMAGE, etc.)
-          options: sequence of keywords and bug identifiers."""
+          options: sequence of keywords and bug identifiers.
+          overrides_allowed: whether we're parsing the regular expectations
+              or the overridding expectations"""
         self._test_to_expectations[test] = expectations
         for expectation in expectations:
             self._expectation_to_tests[expectation].add(test)
@@ -739,6 +813,9 @@
         else:
             self._result_type_to_tests[FAIL].add(test)
 
+        if overrides_allowed:
+            self._overridding_tests.add(test)
+
     def _clear_expectations_for_test(self, test, test_list_path):
         """Remove prexisting expectations for this test.
         This happens if we are seeing a more precise path
@@ -763,7 +840,8 @@
             if test in set_of_tests:
                 set_of_tests.remove(test)
 
-    def _already_seen_test(self, test, test_list_path, lineno):
+    def _already_seen_test(self, test, test_list_path, lineno,
+                           allow_overrides):
         """Returns true if we've already seen a more precise path for this test
         than the test_list_path.
         """
@@ -772,8 +850,19 @@
 
         prev_base_path = self._test_list_paths[test]
         if (prev_base_path == os.path.normpath(test_list_path)):
-            self._add_error(lineno, 'Duplicate expectations.', test)
-            return True
+            if (not allow_overrides or test in self._overridding_tests):
+                if allow_overrides:
+                    expectation_source = "override"
+                else:
+                    expectation_source = "expectation"
+                self._add_error(lineno, 'Duplicate %s.' % expectation_source,
+                                   test)
+                return True
+            else:
+                # We have seen this path, but that's okay because its
+                # in the overrides and the earlier path was in the
+                # expectations.
+                return False
 
         # Check if we've already seen a more precise path.
         return prev_base_path.startswith(os.path.normpath(test_list_path))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
new file mode 100644
index 0000000..d11f3e2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
@@ -0,0 +1,169 @@
+#!/usr/bin/python
+# 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.
+
+"""Unit tests for test_expectations.py."""
+
+import os
+import sys
+import unittest
+
+try:
+   d = os.path.dirname(__file__)
+except NameError:
+   d = os.path.dirname(sys.argv[0])
+
+sys.path.append(os.path.abspath(os.path.join(d, '..')))
+sys.path.append(os.path.abspath(os.path.join(d, '../../thirdparty')))
+
+import port
+from test_expectations import *
+
+class FunctionsTest(unittest.TestCase):
+    def test_result_was_expected(self):
+        # test basics
+        self.assertEquals(result_was_expected(PASS, set([PASS]),
+                                              False, False), True)
+        self.assertEquals(result_was_expected(TEXT, set([PASS]),
+                                              False, False), False)
+
+        # test handling of FAIL expectations
+        self.assertEquals(result_was_expected(IMAGE_PLUS_TEXT, set([FAIL]),
+                                              False, False), True)
+        self.assertEquals(result_was_expected(IMAGE, set([FAIL]),
+                                              False, False), True)
+        self.assertEquals(result_was_expected(TEXT, set([FAIL]),
+                                              False, False), True)
+        self.assertEquals(result_was_expected(CRASH, set([FAIL]),
+                                              False, False), False)
+
+        # test handling of SKIPped tests and results
+        self.assertEquals(result_was_expected(SKIP, set([CRASH]),
+                                              False, True), True)
+        self.assertEquals(result_was_expected(SKIP, set([CRASH]),
+                                              False, False), False)
+
+        # test handling of MISSING results and the REBASELINE modifier
+        self.assertEquals(result_was_expected(MISSING, set([PASS]),
+                                              True, False), True)
+        self.assertEquals(result_was_expected(MISSING, set([PASS]),
+                                              False, False), False)
+
+    def test_remove_pixel_failures(self):
+        self.assertEquals(remove_pixel_failures(set([TEXT])),
+                          set([TEXT]))
+        self.assertEquals(remove_pixel_failures(set([PASS])),
+                          set([PASS]))
+        self.assertEquals(remove_pixel_failures(set([IMAGE])),
+                          set([PASS]))
+        self.assertEquals(remove_pixel_failures(set([IMAGE_PLUS_TEXT])),
+                          set([TEXT]))
+        self.assertEquals(remove_pixel_failures(set([PASS, IMAGE, CRASH])),
+                          set([PASS, CRASH]))
+
+
+class TestExpectationsTest(unittest.TestCase):
+
+    def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
+        self._port = port.get('test', None)
+        self._exp = None
+        unittest.TestCase.__init__(self, testFunc)
+
+    def get_test(self, test_name):
+        return os.path.join(self._port.layout_tests_dir(), test_name)
+
+    def get_basic_tests(self):
+        return [self.get_test('fast/html/article-element.html'),
+                self.get_test('fast/html/header-element.html'),
+                self.get_test('fast/html/keygen.html'),
+                self.get_test('fast/html/tab-order.html'),
+                self.get_test('fast/events/space-scroll-event.html'),
+                self.get_test('fast/events/tab-imagemap.html')]
+
+    def get_basic_expectations(self):
+        return """
+BUG_TEST : fast/html/article-element.html = TEXT
+BUG_TEST SKIP : fast/html/keygen.html = CRASH
+BUG_TEST REBASELINE : fast/htmltab-order.html = MISSING
+BUG_TEST : fast/events = IMAGE
+"""
+
+    def parse_exp(self, expectations, overrides=None):
+        self._exp = TestExpectations(self._port,
+             tests=self.get_basic_tests(),
+             expectations=expectations,
+             test_platform_name=self._port.test_platform_name(),
+             is_debug_mode=False,
+             is_lint_mode=False,
+             tests_are_present=True,
+             overrides=overrides)
+
+    def assert_exp(self, test, result):
+        self.assertEquals(self._exp.get_expectations(self.get_test(test)),
+                          set([result]))
+
+    def test_basic(self):
+       self.parse_exp(self.get_basic_expectations())
+       self.assert_exp('fast/html/article-element.html', TEXT)
+       self.assert_exp('fast/events/tab-imagemap.html', IMAGE)
+       self.assert_exp('fast/html/header-element.html', PASS)
+
+    def test_duplicates(self):
+       self.assertRaises(SyntaxError, self.parse_exp, """
+BUG_TEST : fast/html/article-element.html = TEXT
+BUG_TEST : fast/html/article-element.html = IMAGE""")
+       self.assertRaises(SyntaxError, self.parse_exp,
+           self.get_basic_expectations(), """
+BUG_TEST : fast/html/article-element.html = TEXT
+BUG_TEST : fast/html/article-element.html = IMAGE""")
+
+    def test_overrides(self):
+       self.parse_exp(self.get_basic_expectations(), """
+BUG_OVERRIDE : fast/html/article-element.html = IMAGE""")
+       self.assert_exp('fast/html/article-element.html', IMAGE)
+
+    def test_matches_an_expected_result(self):
+
+       def match(test, result, pixel_tests_enabled):
+           return self._exp.matches_an_expected_result(
+               self.get_test(test), result, pixel_tests_enabled)
+
+       self.parse_exp(self.get_basic_expectations())
+       self.assertTrue(match('fast/html/article-element.html', TEXT, True))
+       self.assertTrue(match('fast/html/article-element.html', TEXT, False))
+       self.assertFalse(match('fast/html/article-element.html', CRASH, True))
+       self.assertFalse(match('fast/html/article-element.html', CRASH, False))
+
+       self.assertTrue(match('fast/events/tab-imagemap.html', IMAGE, True))
+       self.assertTrue(match('fast/events/tab-imagemap.html', PASS, False))
+
+       self.assertTrue(match('fast/html/keygen.html', SKIP, False))
+       self.assertTrue(match('fast/html/tab-order.html', PASS, False))
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
index 56d7b5a..60bdbca 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -79,8 +79,8 @@
         """Returns an HTML string to be included on the results.html page."""
         raise NotImplemented
 
-    def should_kill_test_shell(self):
-        """Returns True if we should kill the test shell before the next
+    def should_kill_dump_render_tree(self):
+        """Returns True if we should kill DumpRenderTree before the next
         test."""
         return False
 
@@ -110,7 +110,7 @@
 
     def __init__(self, test_type):
         TestFailure.__init__(self)
-        # TODO(ojan): This class no longer needs to know the test_type.
+        # FIXME: This class no longer needs to know the test_type.
         self._test_type = test_type
 
     # Filename suffixes used by ResultHtmlOutput.
@@ -127,6 +127,9 @@
               single item is the [actual] filename suffix.
               If out_names is empty, returns the empty string.
         """
+        # FIXME: Seems like a bad idea to separate the display name data
+        # from the path data by hard-coding the display name here
+        # and passing in the path information via out_names.
         links = ['']
         uris = [self.relative_output_filename(filename, fn) for
                 fn in out_names]
@@ -138,6 +141,8 @@
             links.append("<a href='%s'>diff</a>" % uris[2])
         if len(uris) > 3:
             links.append("<a href='%s'>wdiff</a>" % uris[3])
+        if len(uris) > 4:
+            links.append("<a href='%s'>pretty diff</a>" % uris[4])
         return ' '.join(links)
 
     def result_html_output(self, filename):
@@ -145,7 +150,7 @@
 
 
 class FailureTimeout(TestFailure):
-    """Test timed out.  We also want to restart the test shell if this
+    """Test timed out.  We also want to restart DumpRenderTree if this
     happens."""
 
     @staticmethod
@@ -155,7 +160,7 @@
     def result_html_output(self, filename):
         return "<strong>%s</strong>" % self.message()
 
-    def should_kill_test_shell(self):
+    def should_kill_dump_render_tree(self):
         return True
 
 
@@ -172,7 +177,7 @@
         return "<strong>%s</strong> <a href=%s>stack</a>" % (self.message(),
                                                              stack)
 
-    def should_kill_test_shell(self):
+    def should_kill_dump_render_tree(self):
         return True
 
 
@@ -192,9 +197,10 @@
 class FailureTextMismatch(FailureWithType):
     """Text diff output failed."""
     # Filename suffixes used by ResultHtmlOutput.
+    # FIXME: Why don't we use the constants from TestTypeBase here?
     OUT_FILENAMES = ["-actual.txt", "-expected.txt", "-diff.txt"]
     OUT_FILENAMES_WDIFF = ["-actual.txt", "-expected.txt", "-diff.txt",
-                           "-wdiff.html"]
+                           "-wdiff.html", "-pretty-diff.html"]
 
     def __init__(self, test_type, has_wdiff):
         FailureWithType.__init__(self, test_type)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py
index 3c087c0..6754fa6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py
@@ -36,9 +36,16 @@
 
 import glob
 import os
+import time
+
+from webkitpy.common.system import logutils
+
+
+_log = logutils.get_logger(__file__)
+
 
 # When collecting test cases, we include any file with these extensions.
-_supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl',
+_supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.xhtmlmp', '.pl',
                                   '.php', '.svg'])
 # When collecting test cases, skip these directories
 _skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests'])
@@ -51,6 +58,7 @@
       paths: a list of command line paths relative to the webkit/tests
           directory. glob patterns are ok.
     """
+    gather_start_time = time.time()
     paths_to_walk = set()
     # if paths is empty, provide a pre-defined list.
     if paths:
@@ -73,10 +81,16 @@
             continue
 
         for root, dirs, files in os.walk(path):
-            # don't walk skipped directories and sub directories
+            # Don't walk skipped directories or their sub-directories.
             if os.path.basename(root) in _skipped_directories:
                 del dirs[:]
                 continue
+            # This copy and for-in is slightly inefficient, but
+            # the extra walk avoidance consistently shaves .5 seconds
+            # off of total walk() time on my MacBook Pro.
+            for directory in dirs[:]:
+                if directory in _skipped_directories:
+                    dirs.remove(directory)
 
             for filename in files:
                 if _has_supported_extension(filename):
@@ -84,6 +98,9 @@
                     filename = os.path.normpath(filename)
                     test_files.add(filename)
 
+    gather_time = time.time() - gather_start_time
+    _log.debug("Test gathering took %f seconds" % gather_time)
+
     return test_files
 
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
deleted file mode 100644
index 3452035..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
+++ /dev/null
@@ -1,440 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""A Thread object for running the test shell and processing URLs from a
-shared queue.
-
-Each thread runs a separate instance of the test_shell binary and validates
-the output.  When there are no more URLs to process in the shared queue, the
-thread exits.
-"""
-
-import copy
-import logging
-import os
-import Queue
-import signal
-import sys
-import thread
-import threading
-import time
-
-import test_failures
-
-
-def process_output(port, test_info, test_types, test_args, target, output_dir,
-                   crash, timeout, test_run_time, actual_checksum,
-                   output, error):
-    """Receives the output from a test_shell process, subjects it to a number
-    of tests, and returns a list of failure types the test produced.
-
-    Args:
-      port: port-specific hooks
-      proc: an active test_shell process
-      test_info: Object containing the test filename, uri and timeout
-      test_types: list of test types to subject the output to
-      test_args: arguments to be passed to each test
-      target: Debug or Release
-      output_dir: directory to put crash stack traces into
-
-    Returns: a list of failure objects and times for the test being processed
-    """
-    failures = []
-
-    # Some test args, such as the image hash, may be added or changed on a
-    # test-by-test basis.
-    local_test_args = copy.copy(test_args)
-
-    local_test_args.hash = actual_checksum
-
-    if crash:
-        failures.append(test_failures.FailureCrash())
-    if timeout:
-        failures.append(test_failures.FailureTimeout())
-
-    if crash:
-        logging.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
-        # Strip off "file://" since RelativeTestFilename expects
-        # filesystem paths.
-        filename = os.path.join(output_dir, test_info.filename)
-        filename = os.path.splitext(filename)[0] + "-stack.txt"
-        port.maybe_make_directory(os.path.split(filename)[0])
-        open(filename, "wb").write(error)
-    elif error:
-        logging.debug("Previous test output extra lines after dump:\n%s" %
-            error)
-
-    # Check the output and save the results.
-    start_time = time.time()
-    time_for_diffs = {}
-    for test_type in test_types:
-        start_diff_time = time.time()
-        new_failures = test_type.compare_output(port, test_info.filename,
-                                                output, local_test_args,
-                                                target)
-        # Don't add any more failures if we already have a crash, so we don't
-        # double-report those tests. We do double-report for timeouts since
-        # we still want to see the text and image output.
-        if not crash:
-            failures.extend(new_failures)
-        time_for_diffs[test_type.__class__.__name__] = (
-            time.time() - start_diff_time)
-
-    total_time_for_all_diffs = time.time() - start_diff_time
-    return TestStats(test_info.filename, failures, test_run_time,
-        total_time_for_all_diffs, time_for_diffs)
-
-
-class TestStats:
-
-    def __init__(self, filename, failures, test_run_time,
-                 total_time_for_all_diffs, time_for_diffs):
-        self.filename = filename
-        self.failures = failures
-        self.test_run_time = test_run_time
-        self.total_time_for_all_diffs = total_time_for_all_diffs
-        self.time_for_diffs = time_for_diffs
-
-
-class SingleTestThread(threading.Thread):
-    """Thread wrapper for running a single test file."""
-
-    def __init__(self, port, image_path, shell_args, test_info,
-        test_types, test_args, target, output_dir):
-        """
-        Args:
-          port: object implementing port-specific hooks
-          test_info: Object containing the test filename, uri and timeout
-          output_dir: Directory to put crash stacks into.
-          See TestShellThread for documentation of the remaining arguments.
-        """
-
-        threading.Thread.__init__(self)
-        self._port = port
-        self._image_path = image_path
-        self._shell_args = shell_args
-        self._test_info = test_info
-        self._test_types = test_types
-        self._test_args = test_args
-        self._target = target
-        self._output_dir = output_dir
-
-    def run(self):
-        driver = self._port.start_test_driver(self._image_path,
-            self._shell_args)
-        start = time.time()
-        crash, timeout, actual_checksum, output, error = \
-            driver.run_test(test_info.uri.strip(), test_info.timeout,
-                            test_info.image_hash)
-        end = time.time()
-        self._test_stats = process_output(self._port,
-            self._test_info, self._test_types, self._test_args,
-            self._target, self._output_dir, crash, timeout, end - start,
-            actual_checksum, output, error)
-        driver.stop()
-
-    def get_test_stats(self):
-        return self._test_stats
-
-
-class TestShellThread(threading.Thread):
-
-    def __init__(self, port, filename_list_queue, result_queue,
-                 test_types, test_args, image_path, shell_args, options):
-        """Initialize all the local state for this test shell thread.
-
-        Args:
-          port: interface to port-specific hooks
-          filename_list_queue: A thread safe Queue class that contains lists
-              of tuples of (filename, uri) pairs.
-          result_queue: A thread safe Queue class that will contain tuples of
-              (test, failure lists) for the test results.
-          test_types: A list of TestType objects to run the test output
-              against.
-          test_args: A TestArguments object to pass to each TestType.
-          shell_args: Any extra arguments to be passed to test_shell.exe.
-          options: A property dictionary as produced by optparse. The
-              command-line options should match those expected by
-              run_webkit_tests; they are typically passed via the
-              run_webkit_tests.TestRunner class."""
-        threading.Thread.__init__(self)
-        self._port = port
-        self._filename_list_queue = filename_list_queue
-        self._result_queue = result_queue
-        self._filename_list = []
-        self._test_types = test_types
-        self._test_args = test_args
-        self._driver = None
-        self._image_path = image_path
-        self._shell_args = shell_args
-        self._options = options
-        self._canceled = False
-        self._exception_info = None
-        self._directory_timing_stats = {}
-        self._test_stats = []
-        self._num_tests = 0
-        self._start_time = 0
-        self._stop_time = 0
-
-        # Current directory of tests we're running.
-        self._current_dir = None
-        # Number of tests in self._current_dir.
-        self._num_tests_in_current_dir = None
-        # Time at which we started running tests from self._current_dir.
-        self._current_dir_start_time = None
-
-    def get_directory_timing_stats(self):
-        """Returns a dictionary mapping test directory to a tuple of
-        (number of tests in that directory, time to run the tests)"""
-        return self._directory_timing_stats
-
-    def get_individual_test_stats(self):
-        """Returns a list of (test_filename, time_to_run_test,
-        total_time_for_all_diffs, time_for_diffs) tuples."""
-        return self._test_stats
-
-    def cancel(self):
-        """Set a flag telling this thread to quit."""
-        self._canceled = True
-
-    def get_exception_info(self):
-        """If run() terminated on an uncaught exception, return it here
-        ((type, value, traceback) tuple).
-        Returns None if run() terminated normally. Meant to be called after
-        joining this thread."""
-        return self._exception_info
-
-    def get_total_time(self):
-        return max(self._stop_time - self._start_time, 0.0)
-
-    def get_num_tests(self):
-        return self._num_tests
-
-    def run(self):
-        """Delegate main work to a helper method and watch for uncaught
-        exceptions."""
-        self._start_time = time.time()
-        self._num_tests = 0
-        try:
-            logging.debug('%s starting' % (self.getName()))
-            self._run(test_runner=None, result_summary=None)
-            logging.debug('%s done (%d tests)' % (self.getName(),
-                          self.get_num_tests()))
-        except:
-            # Save the exception for our caller to see.
-            self._exception_info = sys.exc_info()
-            self._stop_time = time.time()
-            # Re-raise it and die.
-            logging.error('%s dying: %s' % (self.getName(),
-                          self._exception_info))
-            raise
-        self._stop_time = time.time()
-
-    def run_in_main_thread(self, test_runner, result_summary):
-        """This hook allows us to run the tests from the main thread if
-        --num-test-shells==1, instead of having to always run two or more
-        threads. This allows us to debug the test harness without having to
-        do multi-threaded debugging."""
-        self._run(test_runner, result_summary)
-
-    def _run(self, test_runner, result_summary):
-        """Main work entry point of the thread. Basically we pull urls from the
-        filename queue and run the tests until we run out of urls.
-
-        If test_runner is not None, then we call test_runner.UpdateSummary()
-        with the results of each test."""
-        batch_size = 0
-        batch_count = 0
-        if self._options.batch_size:
-            try:
-                batch_size = int(self._options.batch_size)
-            except:
-                logging.info("Ignoring invalid batch size '%s'" %
-                             self._options.batch_size)
-
-        # Append tests we're running to the existing tests_run.txt file.
-        # This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
-        tests_run_filename = os.path.join(self._options.results_directory,
-                                          "tests_run.txt")
-        tests_run_file = open(tests_run_filename, "a")
-
-        while True:
-            if self._canceled:
-                logging.info('Testing canceled')
-                tests_run_file.close()
-                return
-
-            if len(self._filename_list) is 0:
-                if self._current_dir is not None:
-                    self._directory_timing_stats[self._current_dir] = \
-                        (self._num_tests_in_current_dir,
-                         time.time() - self._current_dir_start_time)
-
-                try:
-                    self._current_dir, self._filename_list = \
-                        self._filename_list_queue.get_nowait()
-                except Queue.Empty:
-                    self._kill_test_shell()
-                    tests_run_file.close()
-                    return
-
-                self._num_tests_in_current_dir = len(self._filename_list)
-                self._current_dir_start_time = time.time()
-
-            test_info = self._filename_list.pop()
-
-            # We have a url, run tests.
-            batch_count += 1
-            self._num_tests += 1
-            if self._options.run_singly:
-                failures = self._run_test_singly(test_info)
-            else:
-                failures = self._run_test(test_info)
-
-            filename = test_info.filename
-            tests_run_file.write(filename + "\n")
-            if failures:
-                # Check and kill test shell if we need too.
-                if len([1 for f in failures if f.should_kill_test_shell()]):
-                    self._kill_test_shell()
-                    # Reset the batch count since the shell just bounced.
-                    batch_count = 0
-                # Print the error message(s).
-                error_str = '\n'.join(['  ' + f.message() for f in failures])
-                logging.debug("%s %s failed:\n%s" % (self.getName(),
-                              self._port.relative_test_filename(filename),
-                              error_str))
-            else:
-                logging.debug("%s %s passed" % (self.getName(),
-                              self._port.relative_test_filename(filename)))
-            self._result_queue.put((filename, failures))
-
-            if batch_size > 0 and batch_count > batch_size:
-                # Bounce the shell and reset count.
-                self._kill_test_shell()
-                batch_count = 0
-
-            if test_runner:
-                test_runner.update_summary(result_summary)
-
-    def _run_test_singly(self, test_info):
-        """Run a test in a separate thread, enforcing a hard time limit.
-
-        Since we can only detect the termination of a thread, not any internal
-        state or progress, we can only run per-test timeouts when running test
-        files singly.
-
-        Args:
-          test_info: Object containing the test filename, uri and timeout
-
-        Return:
-          A list of TestFailure objects describing the error.
-        """
-        worker = SingleTestThread(self._port, self._image_path,
-                                  self._shell_args,
-                                  test_info,
-                                  self._test_types,
-                                  self._test_args,
-                                  self._options.target,
-                                  self._options.results_directory)
-
-        worker.start()
-
-        # When we're running one test per test_shell process, we can enforce
-        # a hard timeout. the test_shell watchdog uses 2.5x the timeout
-        # We want to be larger than that.
-        worker.join(int(test_info.timeout) * 3.0 / 1000.0)
-        if worker.isAlive():
-            # If join() returned with the thread still running, the
-            # test_shell.exe is completely hung and there's nothing
-            # more we can do with it.  We have to kill all the
-            # test_shells to free it up. If we're running more than
-            # one test_shell thread, we'll end up killing the other
-            # test_shells too, introducing spurious crashes. We accept that
-            # tradeoff in order to avoid losing the rest of this thread's
-            # results.
-            logging.error('Test thread hung: killing all test_shells')
-            worker._driver.stop()
-
-        try:
-            stats = worker.get_test_stats()
-            self._test_stats.append(stats)
-            failures = stats.failures
-        except AttributeError, e:
-            failures = []
-            logging.error('Cannot get results of test: %s' %
-                          test_info.filename)
-
-        return failures
-
-    def _run_test(self, test_info):
-        """Run a single test file using a shared test_shell process.
-
-        Args:
-          test_info: Object containing the test filename, uri and timeout
-
-        Return:
-          A list of TestFailure objects describing the error.
-        """
-        self._ensure_test_shell_is_running()
-        # The pixel_hash is used to avoid doing an image dump if the
-        # checksums match, so it should be set to a blank value if we
-        # are generating a new baseline.  (Otherwise, an image from a
-        # previous run will be copied into the baseline.)
-        image_hash = test_info.image_hash
-        if image_hash and self._test_args.new_baseline:
-            image_hash = ""
-        start = time.time()
-        crash, timeout, actual_checksum, output, error = \
-           self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
-        end = time.time()
-
-        stats = process_output(self._port, test_info, self._test_types,
-                               self._test_args, self._options.target,
-                               self._options.results_directory, crash,
-                               timeout, end - start, actual_checksum,
-                               output, error)
-
-        self._test_stats.append(stats)
-        return stats.failures
-
-    def _ensure_test_shell_is_running(self):
-        """Start the shared test shell, if it's not running.  Not for use when
-        running tests singly, since those each start a separate test shell in
-        their own thread.
-        """
-        if (not self._driver or self._driver.poll() is not None):
-            self._driver = self._port.start_driver(
-                self._image_path, self._shell_args)
-
-    def _kill_test_shell(self):
-        """Kill the test shell process if it's running."""
-        if self._driver:
-            self._driver.stop()
-            self._driver = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
index 3509675..e3ad6f4 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
@@ -29,37 +29,4 @@
 
 """Port-specific entrypoints for the layout tests test infrastructure."""
 
-
-import sys
-
-
-def get(port_name=None, options=None):
-    """Returns an object implementing the Port interface. If
-    port_name is None, this routine attempts to guess at the most
-    appropriate port on this platform."""
-    port_to_use = port_name
-    if port_to_use is None:
-        if sys.platform == 'win32':
-            port_to_use = 'chromium-win'
-        elif sys.platform == 'linux2':
-            port_to_use = 'chromium-linux'
-        elif sys.platform == 'darwin':
-            port_to_use = 'chromium-mac'
-
-    if port_to_use == 'test':
-        import test
-        return test.TestPort(port_name, options)
-    elif port_to_use.startswith('mac'):
-        import mac
-        return mac.MacPort(port_name, options)
-    elif port_to_use.startswith('chromium-mac'):
-        import chromium_mac
-        return chromium_mac.ChromiumMacPort(port_name, options)
-    elif port_to_use.startswith('chromium-linux'):
-        import chromium_linux
-        return chromium_linux.ChromiumLinuxPort(port_name, options)
-    elif port_to_use.startswith('chromium-win'):
-        import chromium_win
-        return chromium_win.ChromiumWinPort(port_name, options)
-
-    raise NotImplementedError('unsupported port: %s' % port_to_use)
+from factory import get
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
index 9ff3671..1dd5b93 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
@@ -38,6 +38,8 @@
 
 import http_server_base
 
+_log = logging.getLogger("webkitpy.layout_tests.port.apache_http_server")
+
 
 class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
 
@@ -77,14 +79,15 @@
         error_log = self._cygwin_safe_join(output_dir, "error_log.txt")
         document_root = self._cygwin_safe_join(test_dir, "http", "tests")
 
+        # FIXME: We shouldn't be calling a protected method of _port_obj!
         executable = self._port_obj._path_to_apache()
         if self._is_cygwin():
             executable = self._get_cygwin_path(executable)
 
         cmd = [executable,
-            '-f', self._get_apache_config_file_path(test_dir, output_dir),
-            '-C', "\'DocumentRoot %s\'" % document_root,
-            '-c', "\'Alias /js-test-resources %s\'" % js_test_resources_dir,
+            '-f', "\"%s\"" % self._get_apache_config_file_path(test_dir, output_dir),
+            '-C', "\'DocumentRoot \"%s\"\'" % document_root,
+            '-c', "\'Alias /js-test-resources \"%s\"'" % js_test_resources_dir,
             '-C', "\'Listen %s\'" % "127.0.0.1:8000",
             '-C', "\'Listen %s\'" % "127.0.0.1:8081",
             '-c', "\'TypesConfig \"%s\"\'" % mime_types_path,
@@ -174,7 +177,7 @@
         It will listen to 127.0.0.1 on each of the given port.
         """
         return '\n'.join(('<VirtualHost 127.0.0.1:%s>' % port,
-                          'DocumentRoot %s' % document_root,
+                          'DocumentRoot "%s"' % document_root,
                           ssl and 'SSLEngine On' or '',
                           '</VirtualHost>', ''))
 
@@ -188,7 +191,7 @@
             shell=True)
         err = self._httpd_proc.stderr.read()
         if len(err):
-            logging.debug(err)
+            _log.debug(err)
             return False
         return True
 
@@ -197,22 +200,23 @@
         # Stop any currently running servers.
         self.stop()
 
-        logging.debug("Starting apache http server")
+        _log.debug("Starting apache http server")
         server_started = self.wait_for_action(self._start_httpd_process)
         if server_started:
-            logging.debug("Apache started. Testing ports")
+            _log.debug("Apache started. Testing ports")
             server_started = self.wait_for_action(
                 self.is_server_running_on_all_ports)
 
         if server_started:
-            logging.debug("Server successfully started")
+            _log.debug("Server successfully started")
         else:
             raise Exception('Failed to start http server')
 
     def stop(self):
         """Stops the apache http server."""
-        logging.debug("Shutting down any running http servers")
+        _log.debug("Shutting down any running http servers")
         httpd_pid = None
         if os.path.exists(self._pid_file):
             httpd_pid = int(open(self._pid_file).readline())
+        # FIXME: We shouldn't be calling a protected method of _port_obj!
         self._port_obj._shut_down_http_server(httpd_pid)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index 2b25e29..fb6fddf 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -36,27 +36,49 @@
 import os
 import subprocess
 import sys
+import time
 
 import apache_http_server
 import http_server
 import websocket_server
 
+from webkitpy.common.system import logutils
+from webkitpy.common.system.executive import Executive, ScriptError
+
+
+_log = logutils.get_logger(__file__)
+
+
 # Python bug workaround.  See Port.wdiff_text() for an explanation.
 _wdiff_available = True
-
+_pretty_patch_available = True
 
 # FIXME: This class should merge with webkitpy.webkit_port at some point.
 class Port(object):
     """Abstract class for Port-specific hooks for the layout_test package.
     """
 
-    def __init__(self, port_name=None, options=None):
+    @staticmethod
+    def flag_from_configuration(configuration):
+        flags_by_configuration = {
+            "Debug": "--debug",
+            "Release": "--release",
+        }
+        return flags_by_configuration[configuration]
+
+    def __init__(self, port_name=None, options=None, executive=Executive()):
         self._name = port_name
         self._options = options
         self._helper = None
         self._http_server = None
         self._webkit_base_dir = None
         self._websocket_server = None
+        self._executive = executive
+
+    def default_child_processes(self):
+        """Return the number of DumpRenderTree instances to use for this
+        port."""
+        return self._executive.cpu_count()
 
     def baseline_path(self):
         """Return the absolute path to the directory to store new baselines
@@ -68,38 +90,53 @@
         baselines. The directories are searched in order."""
         raise NotImplementedError('Port.baseline_search_path')
 
-    def check_sys_deps(self):
+    def check_build(self, needs_http):
+        """This routine is used to ensure that the build is up to date
+        and all the needed binaries are present."""
+        raise NotImplementedError('Port.check_build')
+
+    def check_sys_deps(self, needs_http):
         """If the port needs to do some runtime checks to ensure that the
-        tests can be run successfully, they should be done here.
+        tests can be run successfully, it should override this routine.
+        This step can be skipped with --nocheck-sys-deps.
 
         Returns whether the system is properly configured."""
-        raise NotImplementedError('Port.check_sys_deps')
+        return True
 
-    def compare_text(self, actual_text, expected_text):
+    def check_image_diff(self, override_step=None, logging=True):
+        """This routine is used to check whether image_diff binary exists."""
+        raise NotImplemented('Port.check_image_diff')
+
+    def compare_text(self, expected_text, actual_text):
         """Return whether or not the two strings are *not* equal. This
         routine is used to diff text output.
 
         While this is a generic routine, we include it in the Port
         interface so that it can be overriden for testing purposes."""
-        return actual_text != expected_text
+        return expected_text != actual_text
 
-    def diff_image(self, actual_filename, expected_filename,
+    def diff_image(self, expected_filename, actual_filename,
                    diff_filename=None):
         """Compare two image files and produce a delta image file.
 
-        Return 1 if the two files are different, 0 if they are the same.
+        Return True if the two files are different, False if they are the same.
         Also produce a delta image of the two images and write that into
         |diff_filename| if it is not None.
 
         While this is a generic routine, we include it in the Port
         interface so that it can be overriden for testing purposes."""
         executable = self._path_to_image_diff()
-        cmd = [executable, '--diff', actual_filename, expected_filename]
+
         if diff_filename:
-            cmd.append(diff_filename)
-        result = 1
+            cmd = [executable, '--diff', expected_filename, actual_filename,
+                   diff_filename]
+        else:
+            cmd = [executable, expected_filename, actual_filename]
+
+        result = True
         try:
-            result = subprocess.call(cmd)
+            if subprocess.call(cmd) == 0:
+                return False
         except OSError, e:
             if e.errno == errno.ENOENT or e.errno == errno.EACCES:
                 _compare_available = False
@@ -111,8 +148,8 @@
             pass
         return result
 
-    def diff_text(self, actual_text, expected_text,
-                  actual_filename, expected_filename):
+    def diff_text(self, expected_text, actual_text,
+                  expected_filename, actual_filename):
         """Returns a string containing the diff of the two text strings
         in 'unified diff' format.
 
@@ -124,6 +161,13 @@
                                     actual_filename)
         return ''.join(diff)
 
+    def driver_name(self):
+        """Returns the name of the actual binary that is performing the test,
+        so that it can be referred to in log messages. In most cases this
+        will be DumpRenderTree, but if a port uses a binary with a different
+        name, it can be overridden here."""
+        return "DumpRenderTree"
+
     def expected_baselines(self, filename, suffix, all_baselines=False):
         """Given a test name, finds where the baseline results are located.
 
@@ -262,14 +306,7 @@
         may be different (e.g., 'win-xp' instead of 'chromium-win-xp'."""
         return self._name
 
-    def num_cores(self):
-        """Return the number of cores/cpus available on this machine.
-
-        This routine is used to determine the default amount of parallelism
-        used by run-chromium-webkit-tests."""
-        raise NotImplementedError('Port.num_cores')
-
-    # FIXME: This could be replaced by functions in webkitpy.scm.
+    # FIXME: This could be replaced by functions in webkitpy.common.checkout.scm.
     def path_from_webkit_base(self, *comps):
         """Returns the full path to path made by joining the top of the
         WebKit source tree and the list of path components in |*comps|."""
@@ -288,7 +325,7 @@
         This is used by the rebaselining tool. Raises NotImplementedError
         if the port does not use expectations files."""
         raise NotImplementedError('Port.path_to_test_expectations_file')
- 
+
     def remove_directory(self, *path):
         """Recursively removes a directory, even if it's marked read-only.
 
@@ -321,7 +358,7 @@
                 win32 = False
 
             def remove_with_retry(rmfunc, path):
-                os.chmod(path, stat.S_IWRITE)
+                os.chmod(path, os.stat.S_IWRITE)
                 if win32:
                     win32api.SetFileAttributes(path,
                                               win32con.FILE_ATTRIBUTE_NORMAL)
@@ -381,10 +418,10 @@
         raise NotImplementedError('Port.start_driver')
 
     def start_helper(self):
-        """Start a layout test helper if needed on this port. The test helper
-        is used to reconfigure graphics settings and do other things that
-        may be necessary to ensure a known test configuration."""
-        raise NotImplementedError('Port.start_helper')
+        """If a port needs to reconfigure graphics settings or do other
+        things to ensure a known test configuration, it should override this
+        method."""
+        pass
 
     def start_http_server(self):
         """Start a web server if it is available. Do nothing if
@@ -408,8 +445,9 @@
 
     def stop_helper(self):
         """Shut down the test helper if it is running. Do nothing if
-        it isn't, or it isn't available."""
-        raise NotImplementedError('Port.stop_helper')
+        it isn't, or it isn't available. If a port overrides start_helper()
+        it must override this routine as well."""
+        pass
 
     def stop_http_server(self):
         """Shut down the http server if it is running. Do nothing if
@@ -430,6 +468,15 @@
         test_expectations file. See test_expectations.py for more details."""
         raise NotImplementedError('Port.test_expectations')
 
+    def test_expectations_overrides(self):
+        """Returns an optional set of overrides for the test_expectations.
+
+        This is used by ports that have code in two repositories, and where
+        it is possible that you might need "downstream" expectations that
+        temporarily override the "upstream" expectations until the port can
+        sync up the two repos."""
+        return None
+
     def test_base_platform_names(self):
         """Return a list of the 'base' platforms on your port. The base
         platforms represent different architectures, operating systems,
@@ -458,6 +505,12 @@
         might return 'mac' as a test_platform name'."""
         raise NotImplementedError('Port.platforms')
 
+    def test_platform_name_to_name(self, test_platform_name):
+        """Returns the Port platform name that corresponds to the name as
+        referenced in the expectations file. E.g., "mac" returns
+        "chromium-mac" on the Chromium ports."""
+        raise NotImplementedError('Port.test_platform_name_to_name')
+
     def version(self):
         """Returns a string indicating the version of a given platform, e.g.
         '-leopard' or '-xp'.
@@ -476,8 +529,9 @@
                '--end-delete=##WDIFF_END##',
                '--start-insert=##WDIFF_ADD##',
                '--end-insert=##WDIFF_END##',
-               expected_filename,
-               actual_filename]
+               actual_filename,
+               expected_filename]
+        # FIXME: Why not just check os.exists(executable) once?
         global _wdiff_available
         result = ''
         try:
@@ -500,6 +554,7 @@
             # http://bugs.python.org/issue1236
             if _wdiff_available:
                 try:
+                    # FIXME: Use Executive() here.
                     wdiff = subprocess.Popen(cmd,
                         stdout=subprocess.PIPE).communicate()[0]
                 except ValueError, e:
@@ -521,6 +576,31 @@
                 raise e
         return result
 
+    _pretty_patch_error_html = "Failed to run PrettyPatch, see error console."
+
+    def pretty_patch_text(self, diff_path):
+        global _pretty_patch_available
+        if not _pretty_patch_available:
+            return self._pretty_patch_error_html
+        pretty_patch_path = self.path_from_webkit_base("BugsSite", "PrettyPatch")
+        prettify_path = os.path.join(pretty_patch_path, "prettify.rb")
+        command = ["ruby", "-I", pretty_patch_path, prettify_path, diff_path]
+        try:
+            return self._executive.run_command(command)
+        except OSError, e:
+            # If the system is missing ruby log the error and stop trying.
+            _pretty_patch_available = False
+            _log.error("Failed to run PrettyPatch (%s): %s" % (command, e))
+            return self._pretty_patch_error_html
+        except ScriptError, e:
+            # If ruby failed to run for some reason, log the command output and stop trying.
+            _pretty_patch_available = False
+            _log.error("Failed to run PrettyPatch (%s):\n%s" % (command, e.message_with_output()))
+            return self._pretty_patch_error_html
+
+    def default_configuration(self):
+        return "Release"
+
     #
     # PROTECTED ROUTINES
     #
@@ -528,13 +608,6 @@
     # or any of its subclasses.
     #
 
-    def _kill_process(self, pid):
-        """Forcefully kill a process.
-
-        This routine should not be used or needed generically, but can be
-        used in helper files like http_server.py."""
-        raise NotImplementedError('Port.kill_process')
-
     def _path_to_apache(self):
         """Returns the full path to the apache binary.
 
@@ -547,7 +620,7 @@
         This is needed only by ports that use the apache_http_server module."""
         raise NotImplementedError('Port.path_to_apache_config_file')
 
-    def _path_to_driver(self):
+    def _path_to_driver(self, configuration=None):
         """Returns the full path to the test driver (DumpRenderTree)."""
         raise NotImplementedError('Port.path_to_driver')
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 1123376..8bae2a9 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -36,11 +36,43 @@
 import subprocess
 import sys
 import time
+import webbrowser
 
 import base
 import http_server
+
+# FIXME: To use the DRT-based version of this file, we need to be able to
+# run the webkit code, which uses server_process, which requires UNIX-style
+# non-blocking I/O with selects(), which requires fcntl() which doesn't exist
+# on Windows.
+if sys.platform not in ('win32', 'cygwin'):
+    import webkit
+
 import websocket_server
 
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium")
+
+
+# FIXME: This function doesn't belong in this package.
+def check_file_exists(path_to_file, file_description, override_step=None,
+                      logging=True):
+    """Verify the file is present where expected or log an error.
+
+    Args:
+        file_name: The (human friendly) name or description of the file
+            you're looking for (e.g., "HTTP Server"). Used for error logging.
+        override_step: An optional string to be logged if the check fails.
+        logging: Whether or not log the error messages."""
+    if not os.path.exists(path_to_file):
+        if logging:
+            _log.error('Unable to find %s' % file_description)
+            _log.error('    at %s' % path_to_file)
+            if override_step:
+                _log.error('    %s' % override_step)
+                _log.error('')
+        return False
+    return True
+
 
 class ChromiumPort(base.Port):
     """Abstract base class for Chromium implementations of the Port class."""
@@ -50,81 +82,116 @@
         self._chromium_base_dir = None
 
     def baseline_path(self):
-        return self._chromium_baseline_path(self._name)
+        return self._webkit_baseline_path(self._name)
 
-    def check_sys_deps(self):
+    def check_build(self, needs_http):
         result = True
-        test_shell_binary_path = self._path_to_driver()
-        if os.path.exists(test_shell_binary_path):
-            proc = subprocess.Popen([test_shell_binary_path,
-                                     '--check-layout-test-sys-deps'])
-            if proc.wait() != 0:
-                logging.error("Aborting because system dependencies check "
-                              "failed.")
-                logging.error("To override, invoke with --nocheck-sys-deps")
-                result = False
-        else:
-            logging.error('test driver is not found at %s' %
-                          test_shell_binary_path)
+
+        # FIXME: see comment above re: import webkit
+        if (sys.platform in ('win32', 'cygwin') and self._options and
+            hasattr(self._options, 'use_drt') and self._options.use_drt):
+            _log.error('--use-drt is not supported on Windows yet')
+            _log.error('')
             result = False
 
-        image_diff_path = self._path_to_image_diff()
-        if (not os.path.exists(image_diff_path) and not
-            self._options.no_pixel_tests):
-            logging.error('image diff not found at %s' % image_diff_path)
-            logging.error("To override, invoke with --no-pixel-tests")
-            result = False
+        dump_render_tree_binary_path = self._path_to_driver()
+        result = check_file_exists(dump_render_tree_binary_path,
+                                    'test driver') and result
+        if result and self._options.build:
+            result = self._check_driver_build_up_to_date(
+                self._options.configuration)
+        else:
+            _log.error('')
+
+        helper_path = self._path_to_helper()
+        if helper_path:
+            result = check_file_exists(helper_path,
+                                       'layout test helper') and result
+
+        if self._options.pixel_tests:
+            result = self.check_image_diff(
+                'To override, invoke with --no-pixel-tests') and result
 
         return result
 
-    def compare_text(self, actual_text, expected_text):
-        return actual_text != expected_text
+    def check_sys_deps(self, needs_http):
+        dump_render_tree_binary_path = self._path_to_driver()
+        proc = subprocess.Popen([dump_render_tree_binary_path,
+                                '--check-layout-test-sys-deps'])
+        if proc.wait():
+            _log.error('System dependencies check failed.')
+            _log.error('To override, invoke with --nocheck-sys-deps')
+            _log.error('')
+            return False
+        return True
+
+    def check_image_diff(self, override_step=None, logging=True):
+        image_diff_path = self._path_to_image_diff()
+        return check_file_exists(image_diff_path, 'image diff exe',
+                                 override_step, logging)
+
+    def driver_name(self):
+        return "test_shell"
 
     def path_from_chromium_base(self, *comps):
         """Returns the full path to path made by joining the top of the
         Chromium source tree and the list of path components in |*comps|."""
         if not self._chromium_base_dir:
             abspath = os.path.abspath(__file__)
-            self._chromium_base_dir = abspath[0:abspath.find('third_party')]
+            offset = abspath.find('third_party')
+            if offset == -1:
+                raise AssertionError('could not find Chromium base dir from ' +
+                                     abspath)
+            self._chromium_base_dir = abspath[0:offset]
         return os.path.join(self._chromium_base_dir, *comps)
 
     def path_to_test_expectations_file(self):
-        return self.path_from_chromium_base('webkit', 'tools', 'layout_tests',
-                                            'test_expectations.txt')
+        return self.path_from_webkit_base('LayoutTests', 'platform',
+            'chromium', 'test_expectations.txt')
 
     def results_directory(self):
-        return self.path_from_chromium_base('webkit', self._options.target,
-                                            self._options.results_directory)
+        try:
+            return self.path_from_chromium_base('webkit',
+                self._options.configuration, self._options.results_directory)
+        except AssertionError:
+            return self.path_from_webkit_base('WebKit', 'chromium',
+                'xcodebuild', self._options.configuration,
+                self._options.results_directory)
 
     def setup_test_run(self):
         # Delete the disk cache if any to ensure a clean test run.
-        test_shell_binary_path = self._path_to_driver()
-        cachedir = os.path.split(test_shell_binary_path)[0]
+        dump_render_tree_binary_path = self._path_to_driver()
+        cachedir = os.path.split(dump_render_tree_binary_path)[0]
         cachedir = os.path.join(cachedir, "cache")
         if os.path.exists(cachedir):
             shutil.rmtree(cachedir)
 
     def show_results_html_file(self, results_filename):
-        subprocess.Popen([self._path_to_driver(),
-                          self.filename_to_uri(results_filename)])
+        uri = self.filename_to_uri(results_filename)
+        if self._options.use_drt:
+            webbrowser.open(uri, new=1)
+        else:
+            subprocess.Popen([self._path_to_driver(), uri])
 
     def start_driver(self, image_path, options):
         """Starts a new Driver and returns a handle to it."""
+        if self._options.use_drt:
+            return webkit.WebKitDriver(self, image_path, options)
         return ChromiumDriver(self, image_path, options)
 
     def start_helper(self):
         helper_path = self._path_to_helper()
         if helper_path:
-            logging.debug("Starting layout helper %s" % helper_path)
+            _log.debug("Starting layout helper %s" % helper_path)
             self._helper = subprocess.Popen([helper_path],
                 stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None)
             is_ready = self._helper.stdout.readline()
             if not is_ready.startswith('ready'):
-                logging.error("layout_test_helper failed to be ready")
+                _log.error("layout_test_helper failed to be ready")
 
     def stop_helper(self):
         if self._helper:
-            logging.debug("Stopping layout test helper")
+            _log.debug("Stopping layout test helper")
             self._helper.stdin.write("x\n")
             self._helper.stdin.close()
             self._helper.wait()
@@ -140,10 +207,27 @@
         expectations_file = self.path_to_test_expectations_file()
         return file(expectations_file, "r").read()
 
+    def test_expectations_overrides(self):
+        try:
+            overrides_file = self.path_from_chromium_base('webkit', 'tools',
+                'layout_tests', 'test_expectations.txt')
+        except AssertionError:
+            return None
+        if os.path.exists(overrides_file):
+            return file(overrides_file, "r").read()
+        else:
+            return None
+
     def test_platform_names(self):
         return self.test_base_platform_names() + ('win-xp',
             'win-vista', 'win-7')
 
+    def test_platform_name_to_name(self, test_platform_name):
+        if test_platform_name in self.test_platform_names():
+            return 'chromium-' + test_platform_name
+        raise ValueError('Unsupported test_platform_name: %s' %
+                         test_platform_name)
+
     #
     # PROTECTED METHODS
     #
@@ -151,11 +235,34 @@
     # or any subclasses.
     #
 
+    def _check_driver_build_up_to_date(self, configuration):
+        if configuration in ('Debug', 'Release'):
+            try:
+                debug_path = self._path_to_driver('Debug')
+                release_path = self._path_to_driver('Release')
+
+                debug_mtime = os.stat(debug_path).st_mtime
+                release_mtime = os.stat(release_path).st_mtime
+
+                if (debug_mtime > release_mtime and configuration == 'Release' or
+                    release_mtime > debug_mtime and configuration == 'Debug'):
+                    _log.warning('You are not running the most '
+                                 'recent DumpRenderTree binary. You need to '
+                                 'pass --debug or not to select between '
+                                 'Debug and Release.')
+                    _log.warning('')
+            # This will fail if we don't have both a debug and release binary.
+            # That's fine because, in this case, we must already be running the
+            # most up-to-date one.
+            except OSError:
+                pass
+        return True
+
     def _chromium_baseline_path(self, platform):
         if platform is None:
             platform = self.name()
-        return self.path_from_chromium_base('webkit', 'data', 'layout_tests',
-            'platform', platform, 'LayoutTests')
+        return self.path_from_webkit_base('LayoutTests', 'platform', platform)
+
 
 class ChromiumDriver(base.Driver):
     """Abstract interface for the DumpRenderTree interface."""
@@ -163,7 +270,7 @@
     def __init__(self, port, image_path, options):
         self._port = port
         self._options = options
-        self._target = port._options.target
+        self._configuration = port._options.configuration
         self._image_path = image_path
 
         cmd = []
@@ -181,10 +288,17 @@
         cmd += [port._path_to_driver(), '--layout-tests']
         if options:
             cmd += options
+
+        # We need to pass close_fds=True to work around Python bug #2320
+        # (otherwise we can hang when we kill DumpRenderTree when we are running
+        # multiple threads). See http://bugs.python.org/issue2320 .
+        # Note that close_fds isn't supported on Windows, but this bug only
+        # shows up on Mac and Linux.
+        close_flag = sys.platform not in ('win32', 'cygwin')
         self._proc = subprocess.Popen(cmd, stdin=subprocess.PIPE,
                                       stdout=subprocess.PIPE,
-                                      stderr=subprocess.STDOUT)
-
+                                      stderr=subprocess.STDOUT,
+                                      close_fds=close_flag)
     def poll(self):
         return self._proc.poll()
 
@@ -207,14 +321,19 @@
             cmd += ' ' + checksum
         cmd += "\n"
 
-        self._proc.stdin.write(cmd)
-        line = self._proc.stdout.readline()
-        while line.rstrip() != "#EOF":
+        try:
+            self._proc.stdin.write(cmd)
+            line = self._proc.stdout.readline()
+        except IOError, e:
+            _log.error("IOError communicating w/ test_shell: " + str(e))
+            crash = True
+
+        while not crash and line.rstrip() != "#EOF":
             # Make sure we haven't crashed.
             if line == '' and self.poll() is not None:
                 # This is hex code 0xc000001d, which is used for abrupt
                 # termination. This happens if we hit ctrl+c from the prompt
-                # and we happen to be waiting on the test_shell.
+                # and we happen to be waiting on the DumpRenderTree.
                 # sdoyon: Not sure for which OS and in what circumstances the
                 # above code is valid. What works for me under Linux to detect
                 # ctrl+c is for the subprocess returncode to be negative
@@ -229,8 +348,8 @@
             if line.startswith("#URL:"):
                 actual_uri = line.rstrip()[5:]
                 if uri != actual_uri:
-                    logging.fatal("Test got out of sync:\n|%s|\n|%s|" %
-                                (uri, actual_uri))
+                    _log.fatal("Test got out of sync:\n|%s|\n|%s|" %
+                               (uri, actual_uri))
                     raise AssertionError("test out of sync")
             elif line.startswith("#MD5:"):
                 actual_checksum = line.rstrip()[5:]
@@ -242,7 +361,11 @@
             else:
                 error.append(line)
 
-            line = self._proc.stdout.readline()
+            try:
+                line = self._proc.stdout.readline()
+            except IOError, e:
+                _log.error("IOError while reading: " + str(e))
+                crash = True
 
         return (crash, timeout, actual_checksum, ''.join(output),
                 ''.join(error))
@@ -253,10 +376,20 @@
             self._proc.stdout.close()
             if self._proc.stderr:
                 self._proc.stderr.close()
-            if (sys.platform not in ('win32', 'cygwin') and
-                not self._proc.poll()):
-                # Closing stdin/stdout/stderr hangs sometimes on OS X.
-                null = open(os.devnull, "w")
-                subprocess.Popen(["kill", "-9",
-                                 str(self._proc.pid)], stderr=null)
-                null.close()
+            if sys.platform not in ('win32', 'cygwin'):
+                # Closing stdin/stdout/stderr hangs sometimes on OS X,
+                # (see __init__(), above), and anyway we don't want to hang
+                # the harness if DumpRenderTree is buggy, so we wait a couple
+                # seconds to give DumpRenderTree a chance to clean up, but then
+                # force-kill the process if necessary.
+                KILL_TIMEOUT = 3.0
+                timeout = time.time() + KILL_TIMEOUT
+                while self._proc.poll() is None and time.time() < timeout:
+                    time.sleep(0.1)
+                if self._proc.poll() is None:
+                    _log.warning('stopping test driver timed out, '
+                                 'killing it')
+                    null = open(os.devnull, "w")
+                    subprocess.Popen(["kill", "-9",
+                                     str(self._proc.pid)], stderr=null)
+                    null.close()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index b817251..9a595f2 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -27,8 +27,9 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-"""Chromium Mac implementation of the Port interface."""
+"""Chromium Linux implementation of the Port interface."""
 
+import logging
 import os
 import platform
 import signal
@@ -36,6 +37,8 @@
 
 import chromium
 
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_linux")
+
 
 class ChromiumLinuxPort(chromium.ChromiumPort):
     """Chromium Linux implementation of the Port class."""
@@ -43,25 +46,32 @@
     def __init__(self, port_name=None, options=None):
         if port_name is None:
             port_name = 'chromium-linux'
-        if options and not hasattr(options, 'target'):
-            options.target = 'Release'
+        if options and not hasattr(options, 'configuration'):
+            options.configuration = 'Release'
         chromium.ChromiumPort.__init__(self, port_name, options)
 
     def baseline_search_path(self):
-        return [self.baseline_path(),
-                self._chromium_baseline_path('chromium-win'),
+        return [self._webkit_baseline_path('chromium-linux'),
+                self._webkit_baseline_path('chromium-win'),
+                self._webkit_baseline_path('chromium'),
                 self._webkit_baseline_path('win'),
                 self._webkit_baseline_path('mac')]
 
-    def check_sys_deps(self):
-        # We have no platform-specific dependencies to check.
-        return True
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
+        if needs_http:
+            if self._options.use_apache:
+                result = self._check_apache_install() and result
+            else:
+                result = self._check_lighttpd_install() and result
+        result = self._check_wdiff_install() and result
 
-    def num_cores(self):
-        num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
-        if isinstance(num_cores, int) and num_cores > 0:
-            return num_cores
-        return 1
+        if not result:
+            _log.error('For complete Linux build requirements, please see:')
+            _log.error('')
+            _log.error('    http://code.google.com/p/chromium/wiki/'
+                       'LinuxBuildInstructions')
+        return result
 
     def test_platform_name(self):
         # We use 'linux' instead of 'chromium-linux' in test_expectations.txt.
@@ -78,19 +88,42 @@
     def _build_path(self, *comps):
         base = self.path_from_chromium_base()
         if os.path.exists(os.path.join(base, 'sconsbuild')):
-            return self.path_from_chromium_base('sconsbuild',
-                self._options.target, *comps)
+            return self.path_from_chromium_base('sconsbuild', *comps)
         else:
-            return self.path_from_chromium_base('out',
-                self._options.target, *comps)
+            return self.path_from_chromium_base('out', *comps)
 
-    def _kill_process(self, pid):
-        """Forcefully kill the process.
+    def _check_apache_install(self):
+        result = chromium.check_file_exists(self._path_to_apache(),
+            "apache2")
+        result = chromium.check_file_exists(self._path_to_apache_config_file(),
+            "apache2 config file") and result
+        if not result:
+            _log.error('    Please install using: "sudo apt-get install '
+                       'apache2 libapache2-mod-php5"')
+            _log.error('')
+        return result
 
-        Args:
-        pid: The id of the process to be killed.
-        """
-        os.kill(pid, signal.SIGKILL)
+    def _check_lighttpd_install(self):
+        result = chromium.check_file_exists(
+            self._path_to_lighttpd(), "LigHTTPd executable")
+        result = chromium.check_file_exists(self._path_to_lighttpd_php(),
+            "PHP CGI executable") and result
+        result = chromium.check_file_exists(self._path_to_lighttpd_modules(),
+            "LigHTTPd modules") and result
+        if not result:
+            _log.error('    Please install using: "sudo apt-get install '
+                       'lighttpd php5-cgi"')
+            _log.error('')
+        return result
+
+    def _check_wdiff_install(self):
+        result = chromium.check_file_exists(self._path_to_wdiff(), 'wdiff')
+        if not result:
+            _log.error('    Please install using: "sudo apt-get install '
+                       'wdiff"')
+            _log.error('')
+        return result
+
 
     def _kill_all_process(self, process_name):
         null = open(os.devnull)
@@ -99,11 +132,19 @@
         null.close()
 
     def _path_to_apache(self):
-        return '/usr/sbin/apache2'
+        if self._is_redhat_based():
+            return '/usr/sbin/httpd'
+        else:
+            return '/usr/sbin/apache2'
 
     def _path_to_apache_config_file(self):
+        if self._is_redhat_based():
+            config_name = 'fedora-httpd.conf'
+        else:
+            config_name = 'apache2-debian-httpd.conf'
+
         return os.path.join(self.layout_tests_dir(), 'http', 'conf',
-                            'apache2-debian-httpd.conf')
+                            config_name)
 
     def _path_to_lighttpd(self):
         return "/usr/sbin/lighttpd"
@@ -114,17 +155,25 @@
     def _path_to_lighttpd_php(self):
         return "/usr/bin/php-cgi"
 
-    def _path_to_driver(self):
-        return self._build_path('test_shell')
+    def _path_to_driver(self, configuration=None):
+        if not configuration:
+            configuration = self._options.configuration
+        return self._build_path(configuration, 'test_shell')
 
     def _path_to_helper(self):
         return None
 
     def _path_to_image_diff(self):
-        return self._build_path('image_diff')
+        return self._build_path(self._options.configuration, 'image_diff')
 
     def _path_to_wdiff(self):
-        return 'wdiff'
+        if self._is_redhat_based():
+            return '/usr/bin/dwdiff'
+        else:
+            return '/usr/bin/wdiff'
+
+    def _is_redhat_based(self):
+        return os.path.exists(os.path.join('/etc', 'redhat-release'))
 
     def _shut_down_http_server(self, server_pid):
         """Shut down the lighttpd web server. Blocks until it's fully
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index bcffcf8..d5e1757 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -29,6 +29,7 @@
 
 """Chromium Mac implementation of the Port interface."""
 
+import logging
 import os
 import platform
 import signal
@@ -36,6 +37,8 @@
 
 import chromium
 
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac")
+
 
 class ChromiumMacPort(chromium.ChromiumPort):
     """Chromium Mac implementation of the Port class."""
@@ -43,22 +46,31 @@
     def __init__(self, port_name=None, options=None):
         if port_name is None:
             port_name = 'chromium-mac'
-        if options and not hasattr(options, 'target'):
-            options.target = 'Release'
+        if options and not hasattr(options, 'configuration'):
+            options.configuration = 'Release'
         chromium.ChromiumPort.__init__(self, port_name, options)
 
     def baseline_search_path(self):
-        return [self.baseline_path(),
+        return [self._webkit_baseline_path('chromium-mac'),
+                self._webkit_baseline_path('chromium'),
                 self._webkit_baseline_path('mac' + self.version()),
                 self._webkit_baseline_path('mac')]
 
-    def check_sys_deps(self):
-        # We have no specific platform dependencies.
-        return True
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
+        result = self._check_wdiff_install() and result
+        if not result:
+            _log.error('For complete Mac build requirements, please see:')
+            _log.error('')
+            _log.error('    http://code.google.com/p/chromium/wiki/'
+                       'MacBuildInstructions')
+        return result
 
-    def num_cores(self):
-        return int(subprocess.Popen(['sysctl','-n','hw.ncpu'],
-                                    stdout=subprocess.PIPE).stdout.read())
+    def driver_name(self):
+        """name for this port's equivalent of DumpRenderTree."""
+        if self._options.use_drt:
+            return "DumpRenderTree"
+        return "TestShell"
 
     def test_platform_name(self):
         # We use 'mac' instead of 'chromium-mac'
@@ -81,21 +93,27 @@
     #
 
     def _build_path(self, *comps):
-        return self.path_from_chromium_base('xcodebuild', self._options.target,
-                                            *comps)
+        if self._options.use_drt:
+            return self.path_from_webkit_base('WebKit', 'chromium',
+                                              'xcodebuild', *comps)
+        return self.path_from_chromium_base('xcodebuild', *comps)
+
+    def _check_wdiff_install(self):
+        f = open(os.devnull, 'w')
+        rcode = 0
+        try:
+            rcode = subprocess.call(['wdiff'], stderr=f)
+        except OSError:
+            _log.warning('wdiff not found. Install using MacPorts or some '
+                         'other means')
+            pass
+        f.close()
+        return True
 
     def _lighttpd_path(self, *comps):
         return self.path_from_chromium_base('third_party', 'lighttpd',
                                             'mac', *comps)
 
-    def _kill_process(self, pid):
-        """Forcefully kill the process.
-
-        Args:
-            pid: The id of the process to be killed.
-        """
-        os.kill(pid, signal.SIGKILL)
-
     def _kill_all_process(self, process_name):
         """Kill any processes running under this name."""
         # On Mac OS X 10.6, killall has a new constraint: -SIGNALNAME or
@@ -116,25 +134,33 @@
                             'apache2-httpd.conf')
 
     def _path_to_lighttpd(self):
-        return self._lighttp_path('bin', 'lighttp')
+        return self._lighttpd_path('bin', 'lighttpd')
 
     def _path_to_lighttpd_modules(self):
-        return self._lighttp_path('lib')
+        return self._lighttpd_path('lib')
 
     def _path_to_lighttpd_php(self):
         return self._lighttpd_path('bin', 'php-cgi')
 
-    def _path_to_driver(self):
-        # TODO(pinkerton): make |target| happy with case-sensitive file
+    def _path_to_driver(self, configuration=None):
+        # FIXME: make |configuration| happy with case-sensitive file
         # systems.
-        return self._build_path('TestShell.app', 'Contents', 'MacOS', 
-                                'TestShell')
+        if not configuration:
+            configuration = self._options.configuration
+        return self._build_path(configuration, self.driver_name() + '.app',
+            'Contents', 'MacOS', self.driver_name())
 
     def _path_to_helper(self):
-        return self._build_path('layout_test_helper')
+        binary_name = 'layout_test_helper'
+        if self._options.use_drt:
+            binary_name = 'LayoutTestHelper'
+        return self._build_path(self._options.configuration, binary_name)
 
     def _path_to_image_diff(self):
-        return self._build_path('image_diff')
+        binary_name = 'image_diff'
+        if self._options.use_drt:
+            binary_name = 'ImageDiff'
+        return self._build_path(self._options.configuration, binary_name)
 
     def _path_to_wdiff(self):
         return 'wdiff'
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 5eb0ba1..2e3de85 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -29,6 +29,7 @@
 
 """Chromium Win implementation of the Port interface."""
 
+import logging
 import os
 import platform
 import signal
@@ -37,6 +38,8 @@
 
 import chromium
 
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_win")
+
 
 class ChromiumWinPort(chromium.ChromiumPort):
     """Chromium Win implementation of the Port class."""
@@ -44,33 +47,37 @@
     def __init__(self, port_name=None, options=None):
         if port_name is None:
             port_name = 'chromium-win' + self.version()
-        if options and not hasattr(options, 'target'):
-            options.target = 'Release'
+        if options and not hasattr(options, 'configuration'):
+            options.configuration = 'Release'
         chromium.ChromiumPort.__init__(self, port_name, options)
 
     def baseline_search_path(self):
         dirs = []
         if self._name == 'chromium-win-xp':
-            dirs.append(self._chromium_baseline_path(self._name))
+            dirs.append(self._webkit_baseline_path('chromium-win-xp'))
         if self._name in ('chromium-win-xp', 'chromium-win-vista'):
-            dirs.append(self._chromium_baseline_path('chromium-win-vista'))
-        dirs.append(self._chromium_baseline_path('chromium-win'))
+            dirs.append(self._webkit_baseline_path('chromium-win-vista'))
+        dirs.append(self._webkit_baseline_path('chromium-win'))
+        dirs.append(self._webkit_baseline_path('chromium'))
         dirs.append(self._webkit_baseline_path('win'))
         dirs.append(self._webkit_baseline_path('mac'))
         return dirs
 
-    def check_sys_deps(self):
-        # TODO(dpranke): implement this
-        return True
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
+        if not result:
+            _log.error('For complete Windows build requirements, please '
+                       'see:')
+            _log.error('')
+            _log.error('    http://dev.chromium.org/developers/how-tos/'
+                       'build-instructions-windows')
+        return result
 
     def get_absolute_path(self, filename):
         """Return the absolute path in unix format for the given filename."""
         abspath = os.path.abspath(filename)
         return abspath.replace('\\', '/')
 
-    def num_cores(self):
-        return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
-
     def relative_test_filename(self, filename):
         path = filename[len(self.layout_tests_dir()) + 1:]
         return path.replace('\\', '/')
@@ -80,6 +87,8 @@
         return 'win' + self.version()
 
     def version(self):
+        if not hasattr(sys, 'getwindowsversion'):
+            return ''
         winver = sys.getwindowsversion()
         if winver[0] == 6 and (winver[1] == 1):
             return '-7'
@@ -94,24 +103,15 @@
     #
 
     def _build_path(self, *comps):
-        # FIXME(dpranke): allow for builds under 'chrome' as well.
-        return self.path_from_chromium_base('webkit', self._options.target,
-                                            *comps)
+        p = self.path_from_chromium_base('webkit', *comps)
+        if os.path.exists(p):
+            return p
+        return self.path_from_chromium_base('chrome', *comps)
 
     def _lighttpd_path(self, *comps):
         return self.path_from_chromium_base('third_party', 'lighttpd', 'win',
                                             *comps)
 
-    def _kill_process(self, pid):
-        """Forcefully kill the process.
-
-        Args:
-        pid: The id of the process to be killed.
-        """
-        subprocess.call(('taskkill.exe', '/f', '/pid', str(pid)),
-                        stdout=subprocess.PIPE,
-                        stderr=subprocess.PIPE)
-
     def _path_to_apache(self):
         return self.path_from_chromium_base('third_party', 'cygwin', 'usr',
                                             'sbin', 'httpd')
@@ -129,14 +129,16 @@
     def _path_to_lighttpd_php(self):
         return self._lighttpd_path('php5', 'php-cgi.exe')
 
-    def _path_to_driver(self):
-        return self._build_path('test_shell.exe')
+    def _path_to_driver(self, configuration=None):
+        if not configuration:
+            configuration = self._options.configuration
+        return self._build_path(configuration, 'test_shell.exe')
 
     def _path_to_helper(self):
-        return self._build_path('layout_test_helper.exe')
+        return self._build_path(self._options.configuration, 'layout_test_helper.exe')
 
     def _path_to_image_diff(self):
-        return self._build_path('image_diff.exe')
+        return self._build_path(self._options.configuration, 'image_diff.exe')
 
     def _path_to_wdiff(self):
         return self.path_from_chromium_base('third_party', 'cygwin', 'bin',
@@ -150,8 +152,10 @@
             server_pid: The process ID of the running server.
         """
         subprocess.Popen(('taskkill.exe', '/f', '/im', 'LightTPD.exe'),
+                        stdin=open(os.devnull, 'r'),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE).wait()
         subprocess.Popen(('taskkill.exe', '/f', '/im', 'httpd.exe'),
+                        stdin=open(os.devnull, 'r'),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE).wait()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
new file mode 100644
index 0000000..7a6717f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
@@ -0,0 +1,189 @@
+#!/usr/bin/env python
+# 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 Google name 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.
+
+"""This is a test implementation of the Port interface that generates the
+   correct output for every test. It can be used for perf testing, because
+   it is pretty much a lower limit on how fast a port can possibly run.
+
+   This implementation acts as a wrapper around a real port (the real port
+   is held as a delegate object). To specify which port, use the port name
+   'dryrun-XXX' (e.g., 'dryrun-chromium-mac-leopard'). If you use just
+   'dryrun', it uses the default port.
+
+   Note that because this is really acting as a wrapper around the underlying
+   port, you must be able to run the underlying port as well
+   (check_build() and check_sys_deps() must pass and auxiliary binaries
+   like layout_test_helper and httpd must work).
+
+   This implementation also modifies the test expectations so that all
+   tests are either SKIPPED or expected to PASS."""
+
+from __future__ import with_statement
+
+import base
+import factory
+
+
+def _read_file(path, mode='r'):
+    """Return the contents of a file as a string.
+
+    Returns '' if anything goes wrong, instead of throwing an IOError.
+
+    """
+    contents = ''
+    try:
+        with open(path, mode) as f:
+            contents = f.read()
+    except IOError:
+        pass
+    return contents
+
+
+def _write_file(path, contents, mode='w'):
+    """Write the string to the specified path.
+
+    Returns nothing if the write fails, instead of raising an IOError.
+
+    """
+    try:
+        with open(path, mode) as f:
+            f.write(contents)
+    except IOError:
+        pass
+
+
+class DryRunPort(object):
+    """DryRun implementation of the Port interface."""
+
+    def __init__(self, port_name=None, options=None):
+        pfx = 'dryrun-'
+        if port_name.startswith(pfx):
+            port_name = port_name[len(pfx):]
+        else:
+            port_name = None
+        self.__delegate = factory.get(port_name, options)
+
+    def __getattr__(self, name):
+        return getattr(self.__delegate, name)
+
+    def check_build(self, needs_http):
+        return True
+
+    def check_sys_deps(self, needs_http):
+        return True
+
+    def start_helper(self):
+        pass
+
+    def start_http_server(self):
+        pass
+
+    def start_websocket_server(self):
+        pass
+
+    def stop_helper(self):
+        pass
+
+    def stop_http_server(self):
+        pass
+
+    def stop_websocket_server(self):
+        pass
+
+    def start_driver(self, image_path, options):
+        return DryrunDriver(self, image_path, options)
+
+
+class DryrunDriver(base.Driver):
+    """Dryrun implementation of the DumpRenderTree / Driver interface."""
+
+    def __init__(self, port, image_path, test_driver_options):
+        self._port = port
+        self._driver_options = test_driver_options
+        self._image_path = image_path
+        self._layout_tests_dir = None
+
+    def poll(self):
+        return None
+
+    def returncode(self):
+        return 0
+
+    def run_test(self, uri, timeoutms, image_hash):
+        test_name = self._uri_to_test(uri)
+
+        text_filename = self._port.expected_filename(test_name, '.txt')
+        text_output = _read_file(text_filename)
+
+        if image_hash:
+            image_filename = self._port.expected_filename(test_name, '.png')
+            image = _read_file(image_filename, 'rb')
+            if self._image_path:
+                _write_file(self._image_path, image)
+            hash_filename = self._port.expected_filename(test_name,
+                '.checksum')
+            hash = _read_file(hash_filename)
+        else:
+            hash = None
+        return (False, False, hash, text_output, None)
+
+    def stop(self):
+        pass
+
+    def _uri_to_test(self, uri):
+        """Return the base layout test name for a given URI.
+
+        This returns the test name for a given URI, e.g., if you passed in
+        "file:///src/LayoutTests/fast/html/keygen.html" it would return
+        "fast/html/keygen.html".
+
+        """
+        if not self._layout_tests_dir:
+            self._layout_tests_dir = self._port.layout_tests_dir()
+        test = uri
+
+        if uri.startswith("file:///"):
+            test = test.replace('file://', '')
+            return test
+        elif uri.startswith("http://127.0.0.1:8880/"):
+            # websocket tests
+            test = test.replace('http://127.0.0.1:8880/',
+                                self._layout_tests_dir + '/')
+            return test
+        elif uri.startswith("http://"):
+            # regular HTTP test
+            test = test.replace('http://127.0.0.1:8000/',
+                                self._layout_tests_dir + '/http/tests/')
+            return test
+        elif uri.startswith("https://"):
+            test = test.replace('https://127.0.0.1:8443/',
+                                self._layout_tests_dir + '/http/tests/')
+            return test
+        else:
+            raise NotImplementedError('unknown url type: %s' % uri)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
new file mode 100644
index 0000000..95b90da
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+# 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.
+
+"""Factory method to retrieve the appropriate port implementation."""
+
+
+import sys
+
+
+def get(port_name=None, options=None):
+    """Returns an object implementing the Port interface. If
+    port_name is None, this routine attempts to guess at the most
+    appropriate port on this platform."""
+    port_to_use = port_name
+    if port_to_use is None:
+        if sys.platform == 'win32' or sys.platform == 'cygwin':
+            if options and hasattr(options, 'chromium') and options.chromium:
+                port_to_use = 'chromium-win'
+            else:
+                port_to_use = 'win'
+        elif sys.platform == 'linux2':
+            port_to_use = 'chromium-linux'
+        elif sys.platform == 'darwin':
+            if options and hasattr(options, 'chromium') and options.chromium:
+                port_to_use = 'chromium-mac'
+            else:
+                port_to_use = 'mac'
+
+    if port_to_use is None:
+        raise NotImplementedError('unknown port; sys.platform = "%s"' %
+                                  sys.platform)
+
+    if port_to_use == 'test':
+        import test
+        return test.TestPort(port_name, options)
+    elif port_to_use.startswith('dryrun'):
+        import dryrun
+        return dryrun.DryRunPort(port_name, options)
+    elif port_to_use.startswith('mac'):
+        import mac
+        return mac.MacPort(port_name, options)
+    elif port_to_use.startswith('win'):
+        import win
+        return win.WinPort(port_name, options)
+    elif port_to_use.startswith('gtk'):
+        import gtk
+        return gtk.GtkPort(port_name, options)
+    elif port_to_use.startswith('qt'):
+        import qt
+        return qt.QtPort(port_name, options)
+    elif port_to_use.startswith('chromium-mac'):
+        import chromium_mac
+        return chromium_mac.ChromiumMacPort(port_name, options)
+    elif port_to_use.startswith('chromium-linux'):
+        import chromium_linux
+        return chromium_linux.ChromiumLinuxPort(port_name, options)
+    elif port_to_use.startswith('chromium-win'):
+        import chromium_win
+        return chromium_win.ChromiumWinPort(port_name, options)
+
+    raise NotImplementedError('unsupported port: %s' % port_to_use)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
new file mode 100644
index 0000000..de5e28a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
@@ -0,0 +1,91 @@
+# 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 Google name 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.
+
+"""WebKit Gtk implementation of the Port interface."""
+
+import logging
+import os
+import subprocess
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.gtk")
+
+
+class GtkPort(WebKitPort):
+    """WebKit Gtk implementation of the Port class."""
+
+    def __init__(self, port_name=None, options=None):
+        if port_name is None:
+            port_name = 'gtk'
+        WebKitPort.__init__(self, port_name, options)
+
+    def _tests_for_other_platforms(self):
+        # FIXME: This list could be dynamic based on platform name and
+        # pushed into base.Port.
+        # This really need to be automated.
+        return [
+            "platform/chromium",
+            "platform/win",
+            "platform/qt",
+            "platform/mac",
+        ]
+
+    def _path_to_apache_config_file(self):
+        # FIXME: This needs to detect the distribution and change config files.
+        return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+                            'apache2-debian-httpd.conf')
+
+    def _kill_all_process(self, process_name):
+        null = open(os.devnull)
+        subprocess.call(['killall', '-TERM', '-u', os.getenv('USER'),
+                        process_name], stderr=null)
+        null.close()
+
+    def _shut_down_http_server(self, server_pid):
+        """Shut down the httpd web server. Blocks until it's fully
+        shut down.
+
+        Args:
+            server_pid: The process ID of the running server.
+        """
+        # server_pid is not set when "http_server.py stop" is run manually.
+        if server_pid is None:
+            # FIXME: This isn't ideal, since it could conflict with
+            # lighttpd processes not started by http_server.py,
+            # but good enough for now.
+            self._kill_all_process('apache2')
+        else:
+            try:
+                os.kill(server_pid, signal.SIGTERM)
+                # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+            except OSError:
+                # Sometimes we get a bad PID (e.g. from a stale httpd.pid
+                # file), so if kill fails on the given PID, just try to
+                # 'killall' web servers.
+                self._shut_down_http_server(None)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
index 0315704..cc434bc 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
@@ -40,8 +40,11 @@
 import time
 import urllib
 
+import factory
 import http_server_base
 
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server")
+
 
 class HttpdNotStarted(Exception):
     pass
@@ -200,11 +203,11 @@
                 env['PATH'])
 
         if sys.platform == 'win32' and self._register_cygwin:
-            setup_mount = port.path_from_chromium_base('third_party',
+            setup_mount = self._port_obj.path_from_chromium_base('third_party',
                 'cygwin', 'setup_mount.bat')
             subprocess.Popen(setup_mount).wait()
 
-        logging.debug('Starting http server')
+        _log.debug('Starting http server')
         self._process = subprocess.Popen(start_cmd, env=env)
 
         # Wait for server to start.
@@ -216,7 +219,7 @@
         if not server_started or self._process.returncode != None:
             raise google.httpd_utils.HttpdNotStarted('Failed to start httpd.')
 
-        logging.debug("Server successfully started")
+        _log.debug("Server successfully started")
 
     # TODO(deanm): Find a nicer way to shutdown cleanly.  Our log files are
     # probably not being flushed, etc... why doesn't our python have os.kill ?
@@ -233,40 +236,3 @@
         if self._process:
             self._process.wait()
             self._process = None
-
-if '__main__' == __name__:
-    # Provide some command line params for starting/stopping the http server
-    # manually. Also used in ui_tests to run http layout tests in a browser.
-    option_parser = optparse.OptionParser()
-    option_parser.add_option('-k', '--server',
-        help='Server action (start|stop)')
-    option_parser.add_option('-p', '--port',
-        help='Port to listen on (overrides layout test ports)')
-    option_parser.add_option('-r', '--root',
-        help='Absolute path to DocumentRoot (overrides layout test roots)')
-    option_parser.add_option('--register_cygwin', action="store_true",
-        dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
-    option_parser.add_option('--run_background', action="store_true",
-        dest="run_background",
-        help='Run on background (for running as UI test)')
-    options, args = option_parser.parse_args()
-
-    if not options.server:
-        print ('Usage: %s --server {start|stop} [--root=root_dir]'
-               ' [--port=port_number]' % sys.argv[0])
-    else:
-        if (options.root is None) and (options.port is not None):
-            # specifying root but not port means we want httpd on default
-            # set of ports that LayoutTest use, but pointing to a different
-            # source of tests. Specifying port but no root does not seem
-            # meaningful.
-            raise 'Specifying port requires also a root.'
-        httpd = Lighttpd(tempfile.gettempdir(),
-                         port=options.port,
-                         root=options.root,
-                         register_cygwin=options.register_cygwin,
-                         run_background=options.run_background)
-        if 'start' == options.server:
-            httpd.start()
-        else:
-            httpd.stop(force=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
index e82943e..c9805d6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
@@ -34,6 +34,8 @@
 import time
 import urllib
 
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server_base")
+
 
 class HttpServerBase(object):
 
@@ -47,6 +49,7 @@
         while time.time() - start_time < 20:
             if action():
                 return True
+            _log.debug("Waiting for action: %s" % action)
             time.sleep(1)
 
         return False
@@ -63,9 +66,9 @@
 
             try:
                 response = urllib.urlopen(url)
-                logging.debug("Server running at %s" % url)
+                _log.debug("Server running at %s" % url)
             except IOError:
-                logging.debug("Server NOT running at %s" % url)
+                _log.debug("Server NOT running at %s" % url)
                 return False
 
         return True
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf b/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
index d3150dd..2e9c82e 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
@@ -21,6 +21,7 @@
   ".html"         =>      "text/html",
   ".htm"          =>      "text/html",
   ".xhtml"        =>      "application/xhtml+xml",
+  ".xhtmlmp"      =>      "application/vnd.wap.xhtml+xml",
   ".js"           =>      "text/javascript",
   ".log"          =>      "text/plain",
   ".conf"         =>      "text/plain",
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index d355f62..cf4daa8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright (C) 2010 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -29,31 +28,41 @@
 
 """WebKit Mac implementation of the Port interface."""
 
-import fcntl
 import logging
 import os
 import pdb
 import platform
-import select
+import re
+import shutil
 import signal
 import subprocess
 import sys
 import time
 import webbrowser
 
-import base
+import webkitpy.common.system.ospath as ospath
+import webkitpy.layout_tests.port.server_process as server_process
+from webkitpy.layout_tests.port.webkit import WebKitPort, WebKitDriver
 
-import webkitpy
-from webkitpy import executive
+_log = logging.getLogger("webkitpy.layout_tests.port.mac")
 
-class MacPort(base.Port):
+
+class MacPort(WebKitPort):
     """WebKit Mac implementation of the Port class."""
 
     def __init__(self, port_name=None, options=None):
         if port_name is None:
             port_name = 'mac' + self.version()
-        base.Port.__init__(self, port_name, options)
-        self._cached_build_root = None
+        WebKitPort.__init__(self, port_name, options)
+
+    def default_child_processes(self):
+        # FIXME: new-run-webkit-tests is unstable on Mac running more than
+        # four threads in parallel.
+        # See https://bugs.webkit.org/show_bug.cgi?id=36622
+        child_processes = WebKitPort.default_child_processes(self)
+        if child_processes > 4:
+            return 4
+        return child_processes
 
     def baseline_search_path(self):
         dirs = []
@@ -66,53 +75,13 @@
         dirs.append(self._webkit_baseline_path('mac'))
         return dirs
 
-    def check_sys_deps(self):
-        if executive.run_command([self.script_path("build-dumprendertree")], return_exit_code=True) != 0:
-            return False
-
-        driver_path = self._path_to_driver()
-        if not os.path.exists(driver_path):
-            logging.error("DumpRenderTree was not found at %s" % driver_path)
-            return False
-
-        # This should also validate that the ImageDiff path is valid (once this script knows how to use ImageDiff).
-        # https://bugs.webkit.org/show_bug.cgi?id=34826
-        return True
-
-    def num_cores(self):
-        return int(os.popen2("sysctl -n hw.ncpu")[1].read())
-
-    def results_directory(self):
-        return ('/tmp/run-chromium-webkit-tests-' +
-                self._options.results_directory)
-
-    def setup_test_run(self):
-        # This port doesn't require any specific configuration.
-        pass
-
-    def show_results_html_file(self, results_filename):
-        uri = self.filename_to_uri(results_filename)
-        webbrowser.open(uri, new=1)
-
-    def start_driver(self, image_path, options):
-        """Starts a new Driver and returns a handle to it."""
-        return MacDriver(self, image_path, options)
-
-    def start_helper(self):
-        # This port doesn't use a helper process.
-        pass
-
-    def stop_helper(self):
-        # This port doesn't use a helper process.
-        pass
-
-    def test_base_platform_names(self):
-        # At the moment we don't use test platform names, but we have
-        # to return something.
-        return ('mac',)
+    def path_to_test_expectations_file(self):
+        return self.path_from_webkit_base('LayoutTests', 'platform',
+           'mac', 'test_expectations.txt')
 
     def _skipped_file_paths(self):
-        # FIXME: This method will need to be made work for non-mac platforms and moved into base.Port.
+        # FIXME: This method will need to be made work for non-mac
+        # platforms and moved into base.Port.
         skipped_files = []
         if self._name in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'):
             skipped_files.append(os.path.join(
@@ -121,79 +90,8 @@
                                           'Skipped'))
         return skipped_files
 
-    def _tests_for_other_platforms(self):
-        # The original run-webkit-tests builds up a "whitelist" of tests to run, and passes that to DumpRenderTree.
-        # run-chromium-webkit-tests assumes we run *all* tests and test_expectations.txt functions as a blacklist.
-        # FIXME: This list could be dynamic based on platform name and pushed into base.Port.
-        return [
-            "platform/chromium",
-            "platform/gtk",
-            "platform/qt",
-            "platform/win",
-        ]
-
-    def _tests_for_disabled_features(self):
-        # FIXME: This should use the feature detection from webkitperl/features.pm to match run-webkit-tests.
-        # For now we hard-code a list of features known to be disabled on the Mac platform.
-        disabled_feature_tests = [
-            "fast/xhtmlmp",
-            "http/tests/wml",
-            "mathml",
-            "wml",
-        ]
-        # FIXME: webarchive tests expect to read-write from -expected.webarchive files instead of .txt files.
-        # This script doesn't know how to do that yet, so pretend they're just "disabled".
-        webarchive_tests = [
-            "webarchive",
-            "svg/webarchive",
-            "http/tests/webarchive",
-            "svg/custom/image-with-prefix-in-webarchive.svg",
-        ]
-        return disabled_feature_tests + webarchive_tests
-
-    def _tests_from_skipped_file(self, skipped_file):
-        tests_to_skip = []
-        for line in skipped_file.readlines():
-            line = line.strip()
-            if line.startswith('#') or not len(line):
-                continue
-            tests_to_skip.append(line)
-        return tests_to_skip
-
-    def _expectations_from_skipped_files(self):
-        tests_to_skip = []
-        for filename in self._skipped_file_paths():
-            if not os.path.exists(filename):
-                logging.warn("Failed to open Skipped file: %s" % filename)
-                continue
-            skipped_file = file(filename)
-            tests_to_skip.extend(self._tests_from_skipped_file(skipped_file))
-            skipped_file.close()
-        return tests_to_skip
-
-    def test_expectations(self):
-        # The WebKit mac port uses 'Skipped' files at the moment. Each
-        # file contains a list of files or directories to be skipped during
-        # the test run. The total list of tests to skipped is given by the
-        # contents of the generic Skipped file found in platform/X plus
-        # a version-specific file found in platform/X-version. Duplicate
-        # entries are allowed. This routine reads those files and turns
-        # contents into the format expected by test_expectations.
-        tests_to_skip = set(self._expectations_from_skipped_files()) # Use a set to allow duplicates
-        tests_to_skip.update(self._tests_for_other_platforms())
-        tests_to_skip.update(self._tests_for_disabled_features())
-        expectations = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip)
-        return "\n".join(expectations)
-
     def test_platform_name(self):
-        # At the moment we don't use test platform names, but we have
-        # to return something.
-        return 'mac'
-
-    def test_platform_names(self):
-        # At the moment we don't use test platform names, but we have
-        # to return something.
-        return ('mac',)
+        return 'mac' + self.version()
 
     def version(self):
         os_version_string = platform.mac_ver()[0]  # e.g. "10.5.6"
@@ -208,23 +106,32 @@
             return '-snowleopard'
         return ''
 
-    #
-    # PROTECTED METHODS
-    #
+    def _build_java_test_support(self):
+        java_tests_path = os.path.join(self.layout_tests_dir(), "java")
+        build_java = ["/usr/bin/make", "-C", java_tests_path]
+        if self._executive.run_command(build_java, return_exit_code=True):
+            _log.error("Failed to build Java support files: %s" % build_java)
+            return False
+        return True
 
-    def _build_path(self, *comps):
-        if not self._cached_build_root:
-            self._cached_build_root = executive.run_command([self.script_path("webkit-build-directory"), "--top-level"]).rstrip()
-        return os.path.join(self._cached_build_root, self._options.target, *comps)
+    def _check_port_build(self):
+        return self._build_java_test_support()
 
-    def _kill_process(self, pid):
-        """Forcefully kill the process.
+    def _tests_for_other_platforms(self):
+        # The original run-webkit-tests builds up a "whitelist" of tests to
+        # run, and passes that to DumpRenderTree. new-run-webkit-tests assumes
+        # we run *all* tests and test_expectations.txt functions as a
+        # blacklist.
+        # FIXME: This list could be dynamic based on platform name and
+        # pushed into base.Port.
+        return [
+            "platform/chromium",
+            "platform/gtk",
+            "platform/qt",
+            "platform/win",
+        ]
 
-        Args:
-        pid: The id of the process to be killed.
-        """
-        os.kill(pid, signal.SIGKILL)
-
+    # FIXME: This doesn't have anything to do with WebKit.
     def _kill_all_process(self, process_name):
         # On Mac OS X 10.6, killall has a new constraint: -SIGNALNAME or
         # -SIGNALNUMBER must come first.  Example problem:
@@ -236,25 +143,11 @@
                         process_name], stderr=null)
         null.close()
 
-    def _path_to_apache(self):
-        return '/usr/sbin/httpd'
-
     def _path_to_apache_config_file(self):
         return os.path.join(self.layout_tests_dir(), 'http', 'conf',
                             'apache2-httpd.conf')
 
-    def _path_to_driver(self):
-        return self._build_path('DumpRenderTree')
-
-    def _path_to_helper(self):
-        return None
-
-    def _path_to_image_diff(self):
-        return self._build_path('image_diff') # FIXME: This is wrong and should be "ImageDiff", but having the correct path causes other parts of the script to hang.
-
-    def _path_to_wdiff(self):
-        return 'wdiff' # FIXME: This does not exist on a default Mac OS X Leopard install.
-
+    # FIXME: This doesn't have anything to do with WebKit.
     def _shut_down_http_server(self, server_pid):
         """Shut down the lighttpd web server. Blocks until it's fully
         shut down.
@@ -264,209 +157,16 @@
         """
         # server_pid is not set when "http_server.py stop" is run manually.
         if server_pid is None:
-            # TODO(mmoss) This isn't ideal, since it could conflict with
+            # FIXME: This isn't ideal, since it could conflict with
             # lighttpd processes not started by http_server.py,
             # but good enough for now.
             self._kill_all_process('httpd')
         else:
             try:
                 os.kill(server_pid, signal.SIGTERM)
-                # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+                # FIXME: Maybe throw in a SIGKILL just to be sure?
             except OSError:
                 # Sometimes we get a bad PID (e.g. from a stale httpd.pid
                 # file), so if kill fails on the given PID, just try to
                 # 'killall' web servers.
                 self._shut_down_http_server(None)
-
-
-class MacDriver(base.Driver):
-    """implementation of the DumpRenderTree interface."""
-
-    def __init__(self, port, image_path, driver_options):
-        self._port = port
-        self._driver_options = driver_options
-        self._target = port._options.target
-        self._image_path = image_path
-        self._stdout_fd = None
-        self._cmd = None
-        self._env = None
-        self._proc = None
-        self._read_buffer = ''
-
-        cmd = []
-        # Hook for injecting valgrind or other runtime instrumentation,
-        # used by e.g. tools/valgrind/valgrind_tests.py.
-        wrapper = os.environ.get("BROWSER_WRAPPER", None)
-        if wrapper != None:
-            cmd += [wrapper]
-        if self._port._options.wrapper:
-            # This split() isn't really what we want -- it incorrectly will
-            # split quoted strings within the wrapper argument -- but in
-            # practice it shouldn't come up and the --help output warns
-            # about it anyway.
-            cmd += self._options.wrapper.split()
-        # FIXME: Using arch here masks any possible file-not-found errors from a non-existant driver executable.
-        cmd += ['arch', '-i386', port._path_to_driver(), '-']
-
-        # FIXME: This is a hack around our lack of ImageDiff support for now.
-        if not self._port._options.no_pixel_tests:
-            logging.warn("This port does not yet support pixel tests.")
-            self._port._options.no_pixel_tests = True
-            #cmd.append('--pixel-tests')
-
-        #if driver_options:
-        #    cmd += driver_options
-        env = os.environ
-        env['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
-        self._cmd = cmd
-        self._env = env
-        self.restart()
-
-    def poll(self):
-        return self._proc.poll()
-
-    def restart(self):
-        self.stop()
-        self._proc = subprocess.Popen(self._cmd, stdin=subprocess.PIPE,
-                                      stdout=subprocess.PIPE,
-                                      stderr=subprocess.PIPE,
-                                      env=self._env)
-
-    def returncode(self):
-        return self._proc.returncode
-
-    def run_test(self, uri, timeoutms, image_hash):
-        output = []
-        error = []
-        image = ''
-        crash = False
-        timeout = False
-        actual_uri = None
-        actual_image_hash = None
-
-        if uri.startswith("file:///"):
-            cmd = uri[7:]
-        else:
-            cmd = uri
-
-        if image_hash:
-            cmd += "'" + image_hash
-        cmd += "\n"
-
-        self._proc.stdin.write(cmd)
-        self._stdout_fd = self._proc.stdout.fileno()
-        fl = fcntl.fcntl(self._stdout_fd, fcntl.F_GETFL)
-        fcntl.fcntl(self._stdout_fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
-
-        stop_time = time.time() + (int(timeoutms) / 1000.0)
-        resp = ''
-        (timeout, line) = self._read_line(timeout, stop_time)
-        resp += line
-        have_seen_content_type = False
-        while not timeout and line.rstrip() != "#EOF":
-            # Make sure we haven't crashed.
-            if line == '' and self.poll() is not None:
-                # This is hex code 0xc000001d, which is used for abrupt
-                # termination. This happens if we hit ctrl+c from the prompt
-                # and we happen to be waiting on the test_shell.
-                # sdoyon: Not sure for which OS and in what circumstances the
-                # above code is valid. What works for me under Linux to detect
-                # ctrl+c is for the subprocess returncode to be negative
-                # SIGINT. And that agrees with the subprocess documentation.
-                if (-1073741510 == self.returncode() or
-                    - signal.SIGINT == self.returncode()):
-                    raise KeyboardInterrupt
-                crash = True
-                break
-
-            elif (line.startswith('Content-Type:') and not
-                  have_seen_content_type):
-                have_seen_content_type = True
-                pass
-            else:
-                output.append(line)
-
-            (timeout, line) = self._read_line(timeout, stop_time)
-            resp += line
-
-        # Now read a second block of text for the optional image data
-        image_length = 0
-        (timeout, line) = self._read_line(timeout, stop_time)
-        resp += line
-        HASH_HEADER = 'ActualHash: '
-        LENGTH_HEADER = 'Content-Length: '
-        while not timeout and not crash and line.rstrip() != "#EOF":
-            if line == '' and self.poll() is not None:
-                if (-1073741510 == self.returncode() or
-                    - signal.SIGINT == self.returncode()):
-                    raise KeyboardInterrupt
-                crash = True
-                break
-            elif line.startswith(HASH_HEADER):
-                actual_image_hash = line[len(HASH_HEADER):].strip()
-            elif line.startswith('Content-Type:'):
-                pass
-            elif line.startswith(LENGTH_HEADER):
-                image_length = int(line[len(LENGTH_HEADER):])
-            elif image_length:
-                image += line
-
-            (timeout, line) = self._read_line(timeout, stop_time, image_length)
-            resp += line
-
-        if timeout:
-            self.restart()
-
-        if self._image_path and len(self._image_path):
-            image_file = file(self._image_path, "wb")
-            image_file.write(image)
-            image_file.close()
-
-        return (crash, timeout, actual_image_hash,
-                ''.join(output), ''.join(error))
-
-    def stop(self):
-        if self._proc:
-            self._proc.stdin.close()
-            self._proc.stdout.close()
-            if self._proc.stderr:
-                self._proc.stderr.close()
-            if (sys.platform not in ('win32', 'cygwin') and
-                not self._proc.poll()):
-                # Closing stdin/stdout/stderr hangs sometimes on OS X.
-                null = open(os.devnull, "w")
-                subprocess.Popen(["kill", "-9",
-                                 str(self._proc.pid)], stderr=null)
-                null.close()
-
-    def _read_line(self, timeout, stop_time, image_length=0):
-        now = time.time()
-        read_fds = []
-
-        # first check to see if we have a line already read or if we've
-        # read the entire image
-        if image_length and len(self._read_buffer) >= image_length:
-            out = self._read_buffer[0:image_length]
-            self._read_buffer = self._read_buffer[image_length:]
-            return (timeout, out)
-
-        idx = self._read_buffer.find('\n')
-        if not image_length and idx != -1:
-            out = self._read_buffer[0:idx + 1]
-            self._read_buffer = self._read_buffer[idx + 1:]
-            return (timeout, out)
-
-        # If we've timed out, return just what we have, if anything
-        if timeout or now >= stop_time:
-            out = self._read_buffer
-            self._read_buffer = ''
-            return (True, out)
-
-        (read_fds, write_fds, err_fds) = select.select(
-            [self._stdout_fd], [], [], stop_time - now)
-        try:
-            if timeout or len(read_fds) == 1:
-                self._read_buffer += self._proc.stdout.read()
-        except IOError, e:
-            read = []
-        return self._read_line(timeout, stop_time)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
new file mode 100644
index 0000000..67cdefe
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
@@ -0,0 +1,99 @@
+# 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 Google name 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.
+
+"""QtWebKit implementation of the Port interface."""
+
+import logging
+import os
+import subprocess
+import signal
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.qt")
+
+
+class QtPort(WebKitPort):
+    """QtWebKit implementation of the Port class."""
+
+    def __init__(self, port_name=None, options=None):
+        if port_name is None:
+            port_name = 'qt'
+        WebKitPort.__init__(self, port_name, options)
+
+    def _tests_for_other_platforms(self):
+        # FIXME: This list could be dynamic based on platform name and
+        # pushed into base.Port.
+        # This really need to be automated.
+        return [
+            "platform/chromium",
+            "platform/win",
+            "platform/gtk",
+            "platform/mac",
+        ]
+
+    def _path_to_apache_config_file(self):
+        # FIXME: This needs to detect the distribution and change config files.
+        return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+                            'apache2-debian-httpd.conf')
+
+    def _kill_all_process(self, process_name):
+        null = open(os.devnull)
+        subprocess.call(['killall', '-TERM', '-u', os.getenv('USER'),
+                        process_name], stderr=null)
+        null.close()
+
+    def _shut_down_http_server(self, server_pid):
+        """Shut down the httpd web server. Blocks until it's fully
+        shut down.
+
+        Args:
+            server_pid: The process ID of the running server.
+        """
+        # server_pid is not set when "http_server.py stop" is run manually.
+        if server_pid is None:
+            # FIXME: This isn't ideal, since it could conflict with
+            # lighttpd processes not started by http_server.py,
+            # but good enough for now.
+            self._kill_all_process('apache2')
+        else:
+            try:
+                os.kill(server_pid, signal.SIGTERM)
+                # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+            except OSError:
+                # Sometimes we get a bad PID (e.g. from a stale httpd.pid
+                # file), so if kill fails on the given PID, just try to
+                # 'killall' web servers.
+                self._shut_down_http_server(None)
+
+    def _build_driver(self):
+        # The Qt port builds DRT as part of the main build step
+        return True
+
+    def _path_to_driver(self):
+        return self._build_path('bin/DumpRenderTree')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
new file mode 100644
index 0000000..f1c6d73
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
@@ -0,0 +1,223 @@
+#!/usr/bin/env python
+# 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 Google name 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.
+
+"""Package that implements the ServerProcess wrapper class"""
+
+import fcntl
+import logging
+import os
+import select
+import signal
+import subprocess
+import sys
+import time
+
+_log = logging.getLogger("webkitpy.layout_tests.port.server_process")
+
+
+class ServerProcess:
+    """This class provides a wrapper around a subprocess that
+    implements a simple request/response usage model. The primary benefit
+    is that reading responses takes a timeout, so that we don't ever block
+    indefinitely. The class also handles transparently restarting processes
+    as necessary to keep issuing commands."""
+
+    def __init__(self, port_obj, name, cmd, env=None):
+        self._port = port_obj
+        self._name = name
+        self._cmd = cmd
+        self._env = env
+        self._reset()
+
+    def _reset(self):
+        self._proc = None
+        self._output = ''
+        self.crashed = False
+        self.timed_out = False
+        self.error = ''
+
+    def _start(self):
+        if self._proc:
+            raise ValueError("%s already running" % self._name)
+        self._reset()
+        close_fds = sys.platform not in ('win32', 'cygwin')
+        self._proc = subprocess.Popen(self._cmd, stdin=subprocess.PIPE,
+                                      stdout=subprocess.PIPE,
+                                      stderr=subprocess.PIPE,
+                                      close_fds=close_fds,
+                                      env=self._env)
+        fd = self._proc.stdout.fileno()
+        fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+        fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+        fd = self._proc.stderr.fileno()
+        fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+        fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+
+    def handle_interrupt(self):
+        """This routine checks to see if the process crashed or exited
+        because of a keyboard interrupt and raises KeyboardInterrupt
+        accordingly."""
+        if self.crashed:
+            # This is hex code 0xc000001d, which is used for abrupt
+            # termination. This happens if we hit ctrl+c from the prompt
+            # and we happen to be waiting on the DumpRenderTree.
+            # sdoyon: Not sure for which OS and in what circumstances the
+            # above code is valid. What works for me under Linux to detect
+            # ctrl+c is for the subprocess returncode to be negative
+            # SIGINT. And that agrees with the subprocess documentation.
+            if (-1073741510 == self._proc.returncode or
+                - signal.SIGINT == self._proc.returncode):
+                raise KeyboardInterrupt
+            return
+
+    def poll(self):
+        """Check to see if the underlying process is running; returns None
+        if it still is (wrapper around subprocess.poll)."""
+        if self._proc:
+            return self._proc.poll()
+        return None
+
+    def returncode(self):
+        """Returns the exit code from the subprcoess; returns None if the
+        process hasn't exited (this is a wrapper around subprocess.returncode).
+        """
+        if self._proc:
+            return self._proc.returncode
+        return None
+
+    def write(self, input):
+        """Write a request to the subprocess. The subprocess is (re-)start()'ed
+        if is not already running."""
+        if not self._proc:
+            self._start()
+        self._proc.stdin.write(input)
+
+    def read_line(self, timeout):
+        """Read a single line from the subprocess, waiting until the deadline.
+        If the deadline passes, the call times out. Note that even if the
+        subprocess has crashed or the deadline has passed, if there is output
+        pending, it will be returned.
+
+        Args:
+            timeout: floating-point number of seconds the call is allowed
+                to block for. A zero or negative number will attempt to read
+                any existing data, but will not block. There is no way to
+                block indefinitely.
+        Returns:
+            output: data returned, if any. If no data is available and the
+                call times out or crashes, an empty string is returned. Note
+                that the returned string includes the newline ('\n')."""
+        return self._read(timeout, size=0)
+
+    def read(self, timeout, size):
+        """Attempts to read size characters from the subprocess, waiting until
+        the deadline passes. If the deadline passes, any available data will be
+        returned. Note that even if the deadline has passed or if the
+        subprocess has crashed, any available data will still be returned.
+
+        Args:
+            timeout: floating-point number of seconds the call is allowed
+                to block for. A zero or negative number will attempt to read
+                any existing data, but will not block. There is no way to
+                block indefinitely.
+            size: amount of data to read. Must be a postive integer.
+        Returns:
+            output: data returned, if any. If no data is available, an empty
+                string is returned.
+        """
+        if size <= 0:
+            raise ValueError('ServerProcess.read() called with a '
+                             'non-positive size: %d ' % size)
+        return self._read(timeout, size)
+
+    def _read(self, timeout, size):
+        """Internal routine that actually does the read."""
+        index = -1
+        out_fd = self._proc.stdout.fileno()
+        err_fd = self._proc.stderr.fileno()
+        select_fds = (out_fd, err_fd)
+        deadline = time.time() + timeout
+        while not self.timed_out and not self.crashed:
+            if self._proc.poll() != None:
+                self.crashed = True
+                self.handle_interrupt()
+
+            now = time.time()
+            if now > deadline:
+                self.timed_out = True
+
+            # Check to see if we have any output we can return.
+            if size and len(self._output) >= size:
+                index = size
+            elif size == 0:
+                index = self._output.find('\n') + 1
+
+            if index or self.crashed or self.timed_out:
+                output = self._output[0:index]
+                self._output = self._output[index:]
+                return output
+
+            # Nope - wait for more data.
+            (read_fds, write_fds, err_fds) = select.select(select_fds, [],
+                                                           select_fds,
+                                                           deadline - now)
+            try:
+                if out_fd in read_fds:
+                    self._output += self._proc.stdout.read()
+                if err_fd in read_fds:
+                    self.error += self._proc.stderr.read()
+            except IOError, e:
+                pass
+
+    def stop(self):
+        """Stop (shut down) the subprocess), if it is running."""
+        pid = self._proc.pid
+        self._proc.stdin.close()
+        self._proc.stdout.close()
+        if self._proc.stderr:
+            self._proc.stderr.close()
+        if sys.platform not in ('win32', 'cygwin'):
+            # Closing stdin/stdout/stderr hangs sometimes on OS X,
+            # (see restart(), above), and anyway we don't want to hang
+            # the harness if DumpRenderTree is buggy, so we wait a couple
+            # seconds to give DumpRenderTree a chance to clean up, but then
+            # force-kill the process if necessary.
+            KILL_TIMEOUT = 3.0
+            timeout = time.time() + KILL_TIMEOUT
+            while self._proc.poll() is None and time.time() < timeout:
+                time.sleep(0.1)
+            if self._proc.poll() is None:
+                _log.warning('stopping %s timed out, killing it' %
+                             self._name)
+                null = open(os.devnull, "w")
+                subprocess.Popen(["kill", "-9",
+                                  str(self._proc.pid)], stderr=null)
+                null.close()
+                _log.warning('killed')
+        self._reset()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index c3e97be..edef485 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -52,31 +52,28 @@
     def baseline_search_path(self):
         return [self.baseline_path()]
 
-    def check_sys_deps(self):
+    def check_build(self, needs_http):
         return True
 
-    def diff_image(self, actual_filename, expected_filename,
+    def compare_text(self, expected_text, actual_text):
+        return False
+
+    def diff_image(self, expected_filename, actual_filename,
                    diff_filename=None):
         return False
 
-    def compare_text(self, actual_text, expected_text):
-        return False
-
-    def diff_text(self, actual_text, expected_text,
-                  actual_filename, expected_filename):
+    def diff_text(self, expected_text, actual_text,
+                  expected_filename, actual_filename):
         return ''
 
     def name(self):
         return self._name
 
-    def num_cores(self):
-        return int(os.popen2("sysctl -n hw.ncpu")[1].read())
-
     def options(self):
         return self._options
 
     def results_directory(self):
-        return '/tmp' + self._options.results_directory
+        return '/tmp/' + self._options.results_directory
 
     def setup_test_run(self):
         pass
@@ -93,18 +90,12 @@
     def start_websocket_server(self):
         pass
 
-    def start_helper(self):
-        pass
-
     def stop_http_server(self):
         pass
 
     def stop_websocket_server(self):
         pass
 
-    def stop_helper(self):
-        pass
-
     def test_expectations(self):
         return ''
 
@@ -120,7 +111,7 @@
     def version():
         return ''
 
-    def wdiff_text(self, actual_filename, expected_filename):
+    def wdiff_text(self, expected_filename, actual_filename):
         return ''
 
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
new file mode 100644
index 0000000..f2f5237
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -0,0 +1,448 @@
+#!/usr/bin/env python
+# 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 Google name 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.
+
+"""WebKit implementations of the Port interface."""
+
+import logging
+import os
+import pdb
+import platform
+import re
+import shutil
+import signal
+import subprocess
+import sys
+import time
+import webbrowser
+
+import webkitpy.common.system.ospath as ospath
+import webkitpy.layout_tests.port.base as base
+import webkitpy.layout_tests.port.server_process as server_process
+
+_log = logging.getLogger("webkitpy.layout_tests.port.webkit")
+
+
+class WebKitPort(base.Port):
+    """WebKit implementation of the Port class."""
+
+    def __init__(self, port_name=None, options=None):
+        base.Port.__init__(self, port_name, options)
+        self._cached_build_root = None
+        self._cached_apache_path = None
+
+        # FIXME: disable pixel tests until they are run by default on the
+        # build machines.
+        if options and (not hasattr(options, "pixel_tests") or
+           options.pixel_tests is None):
+            options.pixel_tests = False
+
+    def baseline_path(self):
+        return self._webkit_baseline_path(self._name)
+
+    def baseline_search_path(self):
+        return [self._webkit_baseline_path(self._name)]
+
+    def path_to_test_expectations_file(self):
+        return os.path.join(self._webkit_baseline_path(self._name),
+                            'test_expectations.txt')
+
+    # Only needed by ports which maintain versioned test expectations (like mac-tiger vs. mac-leopard)
+    def version(self):
+        return ''
+
+    def _build_driver(self):
+        return not self._executive.run_command([
+            self.script_path("build-dumprendertree"),
+            self.flag_from_configuration(self._options.configuration),
+        ], return_exit_code=True)
+
+    def _check_driver(self):
+        driver_path = self._path_to_driver()
+        if not os.path.exists(driver_path):
+            _log.error("DumpRenderTree was not found at %s" % driver_path)
+            return False
+        return True
+
+    def check_build(self, needs_http):
+        if self._options.build and not self._build_driver():
+            return False
+        if not self._check_driver():
+            return False
+        if self._options.pixel_tests:
+            if not self.check_image_diff():
+                return False
+        if not self._check_port_build():
+            return False
+        return True
+
+    def _check_port_build(self):
+        # Ports can override this method to do additional checks.
+        return True
+
+    def check_image_diff(self, override_step=None, logging=True):
+        image_diff_path = self._path_to_image_diff()
+        if not os.path.exists(image_diff_path):
+            _log.error("ImageDiff was not found at %s" % image_diff_path)
+            return False
+        return True
+
+    def diff_image(self, expected_filename, actual_filename,
+                   diff_filename=None):
+        """Return True if the two files are different. Also write a delta
+        image of the two images into |diff_filename| if it is not None."""
+
+        # Handle the case where the test didn't actually generate an image.
+        actual_length = os.stat(actual_filename).st_size
+        if actual_length == 0:
+            if diff_filename:
+                shutil.copyfile(actual_filename, expected_filename)
+            return True
+
+        sp = self._diff_image_request(expected_filename, actual_filename)
+        return self._diff_image_reply(sp, expected_filename, diff_filename)
+
+    def _diff_image_request(self, expected_filename, actual_filename):
+        # FIXME: either expose the tolerance argument as a command-line
+        # parameter, or make it go away and aways use exact matches.
+        command = [self._path_to_image_diff(), '--tolerance', '0.1']
+        sp = server_process.ServerProcess(self, 'ImageDiff', command)
+
+        actual_length = os.stat(actual_filename).st_size
+        actual_file = open(actual_filename).read()
+        expected_length = os.stat(expected_filename).st_size
+        expected_file = open(expected_filename).read()
+        sp.write('Content-Length: %d\n%sContent-Length: %d\n%s' %
+                 (actual_length, actual_file, expected_length, expected_file))
+
+        return sp
+
+    def _diff_image_reply(self, sp, expected_filename, diff_filename):
+        timeout = 2.0
+        deadline = time.time() + timeout
+        output = sp.read_line(timeout)
+        while not sp.timed_out and not sp.crashed and output:
+            if output.startswith('Content-Length'):
+                m = re.match('Content-Length: (\d+)', output)
+                content_length = int(m.group(1))
+                timeout = deadline - time.time()
+                output = sp.read(timeout, content_length)
+                break
+            elif output.startswith('diff'):
+                break
+            else:
+                timeout = deadline - time.time()
+                output = sp.read_line(deadline)
+
+        result = True
+        if output.startswith('diff'):
+            m = re.match('diff: (.+)% (passed|failed)', output)
+            if m.group(2) == 'passed':
+                result = False
+        elif output and diff_filename:
+            open(diff_filename, 'w').write(output)  # FIXME: This leaks a file handle.
+        elif sp.timed_out:
+            _log.error("ImageDiff timed out on %s" % expected_filename)
+        elif sp.crashed:
+            _log.error("ImageDiff crashed")
+        sp.stop()
+        return result
+
+    def results_directory(self):
+        # Results are store relative to the built products to make it easy
+        # to have multiple copies of webkit checked out and built.
+        return self._build_path(self._options.results_directory)
+
+    def setup_test_run(self):
+        # This port doesn't require any specific configuration.
+        pass
+
+    def show_results_html_file(self, results_filename):
+        uri = self.filename_to_uri(results_filename)
+        # FIXME: We should open results in the version of WebKit we built.
+        webbrowser.open(uri, new=1)
+
+    def start_driver(self, image_path, options):
+        return WebKitDriver(self, image_path, options)
+
+    def test_base_platform_names(self):
+        # At the moment we don't use test platform names, but we have
+        # to return something.
+        return ('mac', 'win')
+
+    def _tests_for_other_platforms(self):
+        raise NotImplementedError('WebKitPort._tests_for_other_platforms')
+        # The original run-webkit-tests builds up a "whitelist" of tests to
+        # run, and passes that to DumpRenderTree. new-run-webkit-tests assumes
+        # we run *all* tests and test_expectations.txt functions as a
+        # blacklist.
+        # FIXME: This list could be dynamic based on platform name and
+        # pushed into base.Port.
+        return [
+            "platform/chromium",
+            "platform/gtk",
+            "platform/qt",
+            "platform/win",
+        ]
+
+    def _tests_for_disabled_features(self):
+        # FIXME: This should use the feature detection from
+        # webkitperl/features.pm to match run-webkit-tests.
+        # For now we hard-code a list of features known to be disabled on
+        # the Mac platform.
+        disabled_feature_tests = [
+            "fast/xhtmlmp",
+            "http/tests/wml",
+            "mathml",
+            "wml",
+        ]
+        # FIXME: webarchive tests expect to read-write from
+        # -expected.webarchive files instead of .txt files.
+        # This script doesn't know how to do that yet, so pretend they're
+        # just "disabled".
+        webarchive_tests = [
+            "webarchive",
+            "svg/webarchive",
+            "http/tests/webarchive",
+            "svg/custom/image-with-prefix-in-webarchive.svg",
+        ]
+        return disabled_feature_tests + webarchive_tests
+
+    def _tests_from_skipped_file(self, skipped_file):
+        tests_to_skip = []
+        for line in skipped_file.readlines():
+            line = line.strip()
+            if line.startswith('#') or not len(line):
+                continue
+            tests_to_skip.append(line)
+        return tests_to_skip
+
+    def _skipped_file_paths(self):
+        return [os.path.join(self._webkit_baseline_path(self._name),
+                                                        'Skipped')]
+
+    def _expectations_from_skipped_files(self):
+        tests_to_skip = []
+        for filename in self._skipped_file_paths():
+            if not os.path.exists(filename):
+                _log.warn("Failed to open Skipped file: %s" % filename)
+                continue
+            skipped_file = file(filename)
+            tests_to_skip.extend(self._tests_from_skipped_file(skipped_file))
+            skipped_file.close()
+        return tests_to_skip
+
+    def test_expectations(self):
+        # The WebKit mac port uses a combination of a test_expectations file
+        # and 'Skipped' files.
+        expectations_file = self.path_to_test_expectations_file()
+        expectations = file(expectations_file, "r").read()
+        return expectations + self._skips()
+
+    def _skips(self):
+        # Each Skipped file contains a list of files
+        # or directories to be skipped during the test run. The total list
+        # of tests to skipped is given by the contents of the generic
+        # Skipped file found in platform/X plus a version-specific file
+        # found in platform/X-version. Duplicate entries are allowed.
+        # This routine reads those files and turns contents into the
+        # format expected by test_expectations.
+
+        # Use a set to allow duplicates
+        tests_to_skip = set(self._expectations_from_skipped_files())
+
+        tests_to_skip.update(self._tests_for_other_platforms())
+        tests_to_skip.update(self._tests_for_disabled_features())
+        skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" %
+                                test_path, tests_to_skip)
+        return "\n".join(skip_lines)
+
+    def test_platform_name(self):
+        return self._name + self.version()
+
+    def test_platform_names(self):
+        return self.test_base_platform_names() + (
+            'mac-tiger', 'mac-leopard', 'mac-snowleopard')
+
+    def default_configuration(self):
+        # This is a bit of a hack. This state exists in a much nicer form in
+        # perl-land.
+        configuration = ospath.relpath(
+            self._webkit_build_directory(["--configuration"]),
+            self._webkit_build_directory(["--top-level"]))
+        assert(configuration == "Debug" or configuration == "Release")
+        return configuration
+
+    def _webkit_build_directory(self, args):
+        args = [self.script_path("webkit-build-directory")] + args
+        return self._executive.run_command(args).rstrip()
+
+    def _build_path(self, *comps):
+        if not self._cached_build_root:
+            self._cached_build_root = self._webkit_build_directory([
+                "--configuration",
+                self.flag_from_configuration(self._options.configuration),
+            ])
+        return os.path.join(self._cached_build_root, *comps)
+
+    def _path_to_driver(self):
+        return self._build_path('DumpRenderTree')
+
+    def _path_to_helper(self):
+        return None
+
+    def _path_to_image_diff(self):
+        return self._build_path('ImageDiff')
+
+    def _path_to_wdiff(self):
+        # FIXME: This does not exist on a default Mac OS X Leopard install.
+        return 'wdiff'
+
+    def _path_to_apache(self):
+        if not self._cached_apache_path:
+            # The Apache binary path can vary depending on OS and distribution
+            # See http://wiki.apache.org/httpd/DistrosDefaultLayout
+            for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
+                if os.path.exists(path):
+                    self._cached_apache_path = path
+                    break
+
+            if not self._cached_apache_path:
+                _log.error("Could not find apache. Not installed or unknown path.")
+
+        return self._cached_apache_path
+
+
+class WebKitDriver(base.Driver):
+    """WebKit implementation of the DumpRenderTree interface."""
+
+    def __init__(self, port, image_path, driver_options):
+        self._port = port
+        self._driver_options = driver_options
+        self._image_path = image_path
+
+        command = []
+        # Hook for injecting valgrind or other runtime instrumentation,
+        # used by e.g. tools/valgrind/valgrind_tests.py.
+        wrapper = os.environ.get("BROWSER_WRAPPER", None)
+        if wrapper != None:
+            command += [wrapper]
+        if self._port._options.wrapper:
+            # This split() isn't really what we want -- it incorrectly will
+            # split quoted strings within the wrapper argument -- but in
+            # practice it shouldn't come up and the --help output warns
+            # about it anyway.
+            # FIXME: Use a real shell parser.
+            command += self._options.wrapper.split()
+
+        command += [port._path_to_driver(), '-']
+
+        if image_path:
+            command.append('--pixel-tests')
+        environment = os.environ
+        environment['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
+        self._server_process = server_process.ServerProcess(self._port,
+            "DumpRenderTree", command, environment)
+
+    def poll(self):
+        return self._server_process.poll()
+
+    def restart(self):
+        self._server_process.stop()
+        self._server_process.start()
+        return
+
+    def returncode(self):
+        return self._server_process.returncode()
+
+    # FIXME: This function is huge.
+    def run_test(self, uri, timeoutms, image_hash):
+        if uri.startswith("file:///"):
+            command = uri[7:]
+        else:
+            command = uri
+
+        if image_hash:
+            command += "'" + image_hash
+        command += "\n"
+
+        # pdb.set_trace()
+        self._server_process.write(command)
+
+        have_seen_content_type = False
+        actual_image_hash = None
+        output = ''
+        image = ''
+
+        timeout = int(timeoutms) / 1000.0
+        deadline = time.time() + timeout
+        line = self._server_process.read_line(timeout)
+        while (not self._server_process.timed_out
+               and not self._server_process.crashed
+               and line.rstrip() != "#EOF"):
+            if (line.startswith('Content-Type:') and not
+                have_seen_content_type):
+                have_seen_content_type = True
+            else:
+                output += line
+            line = self._server_process.read_line(timeout)
+            timeout = deadline - time.time()
+
+        # Now read a second block of text for the optional image data
+        remaining_length = -1
+        HASH_HEADER = 'ActualHash: '
+        LENGTH_HEADER = 'Content-Length: '
+        line = self._server_process.read_line(timeout)
+        while (not self._server_process.timed_out
+               and not self._server_process.crashed
+               and line.rstrip() != "#EOF"):
+            if line.startswith(HASH_HEADER):
+                actual_image_hash = line[len(HASH_HEADER):].strip()
+            elif line.startswith('Content-Type:'):
+                pass
+            elif line.startswith(LENGTH_HEADER):
+                timeout = deadline - time.time()
+                content_length = int(line[len(LENGTH_HEADER):])
+                image = self._server_process.read(timeout, content_length)
+            timeout = deadline - time.time()
+            line = self._server_process.read_line(timeout)
+
+        if self._image_path and len(self._image_path):
+            image_file = file(self._image_path, "wb")
+            image_file.write(image)
+            image_file.close()
+        return (self._server_process.crashed,
+                self._server_process.timed_out,
+                actual_image_hash,
+                output,
+                self._server_process.error)
+
+    def stop(self):
+        if self._server_process:
+            self._server_process.stop()
+            self._server_process = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
index 54c2f6f..a9ba160 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
@@ -39,8 +39,13 @@
 import time
 import urllib
 
+import factory
 import http_server
 
+from webkitpy.common.system.executive import Executive
+
+_log = logging.getLogger("webkitpy.layout_tests.port.websocket_server")
+
 _WS_LOG_PREFIX = 'pywebsocket.ws.log-'
 _WSS_LOG_PREFIX = 'pywebsocket.wss.log-'
 
@@ -59,6 +64,7 @@
     Return:
       True if the url is alive.
     """
+    sleep_time = 0.5
     wait_time = 5
     while wait_time > 0:
         try:
@@ -67,9 +73,9 @@
             return True
         except IOError:
             pass
-        wait_time -= 1
-        # Wait a second and try again.
-        time.sleep(1)
+        # Wait for sleep_time before trying again.
+        wait_time -= sleep_time
+        time.sleep(sleep_time)
 
     return False
 
@@ -86,7 +92,7 @@
 
     def __init__(self, port_obj, output_dir, port=_DEFAULT_WS_PORT,
                  root=None, use_tls=False,
-                 register_cygwin=None,
+                 register_cygwin=True,
                  pidfile=None):
         """Args:
           output_dir: the absolute path to the layout test result directory
@@ -126,7 +132,7 @@
 
     def start(self):
         if not self._web_socket_tests:
-            logging.info('No need to start %s server.' % self._server_name)
+            _log.info('No need to start %s server.' % self._server_name)
             return
         if self.is_running():
             raise PyWebSocketNotStarted('%s is already running.' %
@@ -150,27 +156,27 @@
         python_interp = sys.executable
         pywebsocket_base = os.path.join(
             os.path.dirname(os.path.dirname(os.path.dirname(
-            os.path.dirname(os.path.dirname(
-            os.path.abspath(__file__)))))), 'pywebsocket')
+            os.path.abspath(__file__)))), 'thirdparty', 'pywebsocket')
         pywebsocket_script = os.path.join(pywebsocket_base, 'mod_pywebsocket',
             'standalone.py')
         start_cmd = [
             python_interp, pywebsocket_script,
-            '-p', str(self._port),
-            '-d', self._layout_tests,
-            '-s', self._web_socket_tests,
-            '-x', '/websocket/tests/cookies',
-            '-l', error_log,
+            '--server-host', '127.0.0.1',
+            '--port', str(self._port),
+            '--document-root', self._layout_tests,
+            '--scan-dir', self._web_socket_tests,
+            '--cgi-paths', '/websocket/tests',
+            '--log-file', error_log,
         ]
 
         handler_map_file = os.path.join(self._web_socket_tests,
                                         'handler_map.txt')
         if os.path.exists(handler_map_file):
-            logging.debug('Using handler_map_file: %s' % handler_map_file)
-            start_cmd.append('-m')
+            _log.debug('Using handler_map_file: %s' % handler_map_file)
+            start_cmd.append('--websock-handlers-map-file')
             start_cmd.append(handler_map_file)
         else:
-            logging.warning('No handler_map_file found')
+            _log.warning('No handler_map_file found')
 
         if self._use_tls:
             start_cmd.extend(['-t', '-k', self._private_key,
@@ -183,6 +189,8 @@
                 self._port_obj.path_from_chromium_base('third_party',
                                                        'cygwin', 'bin'),
                 env['PATH'])
+            env['CYGWIN_PATH'] = self._port_obj.path_from_chromium_base(
+                'third_party', 'cygwin', 'bin')
 
         if sys.platform == 'win32' and self._register_cygwin:
             setup_mount = self._port_obj.path_from_chromium_base(
@@ -192,16 +200,16 @@
         env['PYTHONPATH'] = (pywebsocket_base + os.path.pathsep +
                              env.get('PYTHONPATH', ''))
 
-        logging.debug('Starting %s server on %d.' % (
-            self._server_name, self._port))
-        logging.debug('cmdline: %s' % ' '.join(start_cmd))
-        self._process = subprocess.Popen(start_cmd, stdout=self._wsout,
+        _log.debug('Starting %s server on %d.' % (
+                   self._server_name, self._port))
+        _log.debug('cmdline: %s' % ' '.join(start_cmd))
+        # FIXME: We should direct this call through Executive for testing.
+        self._process = subprocess.Popen(start_cmd,
+                                         stdin=open(os.devnull, 'r'),
+                                         stdout=self._wsout,
                                          stderr=subprocess.STDOUT,
                                          env=env)
 
-        # Wait a bit before checking the liveness of the server.
-        time.sleep(0.5)
-
         if self._use_tls:
             url = 'https'
         else:
@@ -211,7 +219,7 @@
             fp = open(output_log)
             try:
                 for line in fp:
-                    logging.error(line)
+                    _log.error(line)
             finally:
                 fp.close()
             raise PyWebSocketNotStarted(
@@ -231,6 +239,7 @@
         if not force and not self.is_running():
             return
 
+        pid = None
         if self._process:
             pid = self._process.pid
         elif self._pidfile:
@@ -242,8 +251,9 @@
             raise PyWebSocketNotFound(
                 'Failed to find %s server pid.' % self._server_name)
 
-        logging.debug('Shutting down %s server %d.' % (self._server_name, pid))
-        self._port_obj._kill_process(pid)
+        _log.debug('Shutting down %s server %d.' % (self._server_name, pid))
+        # FIXME: We should use a non-static Executive for easier testing.
+        Executive().kill_process(pid)
 
         if self._process:
             self._process.wait()
@@ -252,53 +262,3 @@
         if self._wsout:
             self._wsout.close()
             self._wsout = None
-
-
-if '__main__' == __name__:
-    # Provide some command line params for starting the PyWebSocket server
-    # manually.
-    option_parser = optparse.OptionParser()
-    option_parser.add_option('--server', type='choice',
-                             choices=['start', 'stop'], default='start',
-                             help='Server action (start|stop)')
-    option_parser.add_option('-p', '--port', dest='port',
-                             default=None, help='Port to listen on')
-    option_parser.add_option('-r', '--root',
-                             help='Absolute path to DocumentRoot '
-                                  '(overrides layout test roots)')
-    option_parser.add_option('-t', '--tls', dest='use_tls',
-                             action='store_true',
-                             default=False, help='use TLS (wss://)')
-    option_parser.add_option('-k', '--private_key', dest='private_key',
-                             default='', help='TLS private key file.')
-    option_parser.add_option('-c', '--certificate', dest='certificate',
-                             default='', help='TLS certificate file.')
-    option_parser.add_option('--register_cygwin', action="store_true",
-                             dest="register_cygwin",
-                             help='Register Cygwin paths (on Win try bots)')
-    option_parser.add_option('--pidfile', help='path to pid file.')
-    options, args = option_parser.parse_args()
-
-    if not options.port:
-        if options.use_tls:
-            options.port = _DEFAULT_WSS_PORT
-        else:
-            options.port = _DEFAULT_WS_PORT
-
-    kwds = {'port': options.port, 'use_tls': options.use_tls}
-    if options.root:
-        kwds['root'] = options.root
-    if options.private_key:
-        kwds['private_key'] = options.private_key
-    if options.certificate:
-        kwds['certificate'] = options.certificate
-    kwds['register_cygwin'] = options.register_cygwin
-    if options.pidfile:
-        kwds['pidfile'] = options.pidfile
-
-    pywebsocket = PyWebSocket(tempfile.gettempdir(), **kwds)
-
-    if 'start' == options.server:
-        pywebsocket.start()
-    else:
-        pywebsocket.stop(force=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
new file mode 100644
index 0000000..2bf692b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
@@ -0,0 +1,75 @@
+# 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 Google name 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.
+
+"""WebKit Win implementation of the Port interface."""
+
+import logging
+import os
+import subprocess
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.win")
+
+
+class WinPort(WebKitPort):
+    """WebKit Win implementation of the Port class."""
+
+    def __init__(self, port_name=None, options=None):
+        if port_name is None:
+            port_name = 'win'
+        WebKitPort.__init__(self, port_name, options)
+
+    def _tests_for_other_platforms(self):
+        # FIXME: This list could be dynamic based on platform name and
+        # pushed into base.Port.
+        # This really need to be automated.
+        return [
+            "platform/chromium",
+            "platform/gtk",
+            "platform/qt",
+            "platform/mac",
+        ]
+
+    def _path_to_apache_config_file(self):
+        return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+                            'cygwin-httpd.conf')
+
+    def _shut_down_http_server(self, server_pid):
+        """Shut down the httpd web server. Blocks until it's fully
+        shut down.
+
+        Args:
+            server_pid: The process ID of the running server.
+        """
+        # Looks like we ignore server_pid.
+        # Copy/pasted from chromium-win.
+        subprocess.Popen(('taskkill.exe', '/f', '/im', 'httpd.exe'),
+                        stdin=open(os.devnull, 'r'),
+                        stdout=subprocess.PIPE,
+                        stderr=subprocess.PIPE).wait()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
index 4604a1a..b972154 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -41,6 +41,7 @@
 At the end, the script generates a html that compares old and new baselines.
 """
 
+import copy
 import logging
 import optparse
 import os
@@ -59,6 +60,9 @@
 from test_types import image_diff
 from test_types import text_diff
 
+_log = logging.getLogger("webkitpy.layout_tests."
+                         "rebaseline_chromium_webkit_tests")
+
 # Repository type constants.
 REPO_SVN, REPO_UNKNOWN = range(2)
 
@@ -137,11 +141,11 @@
         msg = '%s %s %s' % (dashes, msg, dashes)
 
     if logging_level == logging.ERROR:
-        logging.error(msg)
+        _log.error(msg)
     elif logging_level == logging.WARNING:
-        logging.warn(msg)
+        _log.warn(msg)
     else:
-        logging.info(msg)
+        _log.info(msg)
 
 
 def setup_html_directory(html_directory):
@@ -163,11 +167,11 @@
         os.mkdir(html_directory)
 
     html_directory = os.path.join(html_directory, 'rebaseline_html')
-    logging.info('Html directory: "%s"', html_directory)
+    _log.info('Html directory: "%s"', html_directory)
 
     if os.path.exists(html_directory):
         shutil.rmtree(html_directory, True)
-        logging.info('Deleted file at html directory: "%s"', html_directory)
+        _log.info('Deleted file at html directory: "%s"', html_directory)
 
     if not os.path.exists(html_directory):
         os.mkdir(html_directory)
@@ -191,7 +195,7 @@
     base, ext = os.path.splitext(baseline_filename)
     result_filename = '%s-%s-%s%s' % (base, platform, result_type, ext)
     fullpath = os.path.join(html_directory, result_filename)
-    logging.debug('  Result file full path: "%s".', fullpath)
+    _log.debug('  Result file full path: "%s".', fullpath)
     return fullpath
 
 
@@ -200,12 +204,21 @@
 
     REVISION_REGEX = r'<a href=\"(\d+)/\">'
 
-    def __init__(self, port, platform, options):
-        self._file_dir = port.path_from_chromium_base('webkit', 'tools',
-            'layout_tests')
-        self._port = port
+    def __init__(self, running_port, target_port, platform, options):
+        """
+        Args:
+            running_port: the Port the script is running on.
+            target_port: the Port the script uses to find port-specific
+                configuration information like the test_expectations.txt
+                file location and the list of test platforms.
+            platform: the test platform to rebaseline
+            options: the command-line options object."""
         self._platform = platform
         self._options = options
+        self._port = running_port
+        self._target_port = target_port
+        self._rebaseline_port = port.get(
+            self._target_port.test_platform_name_to_name(platform), options)
         self._rebaselining_tests = []
         self._rebaselined_tests = []
 
@@ -213,9 +226,9 @@
         #   -. compile list of tests that need rebaselining.
         #   -. update the tests in test_expectations file after rebaseline
         #      is done.
-        expectations_str = self._port.test_expectations()
+        expectations_str = self._rebaseline_port.test_expectations()
         self._test_expectations = \
-            test_expectations.TestExpectations(self._port,
+            test_expectations.TestExpectations(self._rebaseline_port,
                                                None,
                                                expectations_str,
                                                self._platform,
@@ -233,9 +246,9 @@
 
         log_dashed_string('Downloading archive', self._platform)
         archive_file = self._download_buildbot_archive()
-        logging.info('')
+        _log.info('')
         if not archive_file:
-            logging.error('No archive found.')
+            _log.error('No archive found.')
             return False
 
         log_dashed_string('Extracting and adding new baselines',
@@ -246,19 +259,19 @@
         log_dashed_string('Updating rebaselined tests in file',
                           self._platform)
         self._update_rebaselined_tests_in_file(backup)
-        logging.info('')
+        _log.info('')
 
         if len(self._rebaselining_tests) != len(self._rebaselined_tests):
-            logging.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
-                            'REBASELINED.')
-            logging.warning('  Total tests needing rebaselining: %d',
-                            len(self._rebaselining_tests))
-            logging.warning('  Total tests rebaselined: %d',
-                            len(self._rebaselined_tests))
+            _log.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
+                         'REBASELINED.')
+            _log.warning('  Total tests needing rebaselining: %d',
+                         len(self._rebaselining_tests))
+            _log.warning('  Total tests rebaselined: %d',
+                         len(self._rebaselined_tests))
             return False
 
-        logging.warning('All tests needing rebaselining were successfully '
-                        'rebaselined.')
+        _log.warning('All tests needing rebaselining were successfully '
+                     'rebaselined.')
 
         return True
 
@@ -285,16 +298,16 @@
         self._rebaselining_tests = \
             self._test_expectations.get_rebaselining_failures()
         if not self._rebaselining_tests:
-            logging.warn('No tests found that need rebaselining.')
+            _log.warn('No tests found that need rebaselining.')
             return None
 
-        logging.info('Total number of tests needing rebaselining '
-                     'for "%s": "%d"', self._platform,
-                     len(self._rebaselining_tests))
+        _log.info('Total number of tests needing rebaselining '
+                  'for "%s": "%d"', self._platform,
+                  len(self._rebaselining_tests))
 
         test_no = 1
         for test in self._rebaselining_tests:
-            logging.info('  %d: %s', test_no, test)
+            _log.info('  %d: %s', test_no, test)
             test_no += 1
 
         return self._rebaselining_tests
@@ -310,7 +323,7 @@
           None on failure.
         """
 
-        logging.debug('Url to retrieve revision: "%s"', url)
+        _log.debug('Url to retrieve revision: "%s"', url)
 
         f = urllib.urlopen(url)
         content = f.read()
@@ -318,11 +331,11 @@
 
         revisions = re.findall(self.REVISION_REGEX, content)
         if not revisions:
-            logging.error('Failed to find revision, content: "%s"', content)
+            _log.error('Failed to find revision, content: "%s"', content)
             return None
 
         revisions.sort(key=int)
-        logging.info('Latest revision: "%s"', revisions[len(revisions) - 1])
+        _log.info('Latest revision: "%s"', revisions[len(revisions) - 1])
         return revisions[len(revisions) - 1]
 
     def _get_archive_dir_name(self, platform, webkit_canary):
@@ -339,8 +352,8 @@
         if platform in ARCHIVE_DIR_NAME_DICT:
             return ARCHIVE_DIR_NAME_DICT[platform]
         else:
-            logging.error('Cannot find platform key %s in archive '
-                          'directory name dictionary', platform)
+            _log.error('Cannot find platform key %s in archive '
+                       'directory name dictionary', platform)
             return None
 
     def _get_archive_url(self):
@@ -356,7 +369,7 @@
         if not dir_name:
             return None
 
-        logging.debug('Buildbot platform dir name: "%s"', dir_name)
+        _log.debug('Buildbot platform dir name: "%s"', dir_name)
 
         url_base = '%s/%s/' % (self._options.archive_url, dir_name)
         latest_revision = self._get_latest_revision(url_base)
@@ -364,7 +377,7 @@
             return None
         archive_url = ('%s%s/layout-test-results.zip' % (url_base,
                                                          latest_revision))
-        logging.info('Archive url: "%s"', archive_url)
+        _log.info('Archive url: "%s"', archive_url)
         return archive_url
 
     def _download_buildbot_archive(self):
@@ -380,7 +393,7 @@
             return None
 
         fn = urllib.urlretrieve(url)[0]
-        logging.info('Archive downloaded and saved to file: "%s"', fn)
+        _log.info('Archive downloaded and saved to file: "%s"', fn)
         return fn
 
     def _extract_and_add_new_baselines(self, archive_file):
@@ -397,17 +410,18 @@
         zip_file = zipfile.ZipFile(archive_file, 'r')
         zip_namelist = zip_file.namelist()
 
-        logging.debug('zip file namelist:')
+        _log.debug('zip file namelist:')
         for name in zip_namelist:
-            logging.debug('  ' + name)
+            _log.debug('  ' + name)
 
-        platform = self._port.name()
-        logging.debug('Platform dir: "%s"', platform)
+        platform = self._rebaseline_port.test_platform_name_to_name(
+            self._platform)
+        _log.debug('Platform dir: "%s"', platform)
 
         test_no = 1
         self._rebaselined_tests = []
         for test in self._rebaselining_tests:
-            logging.info('Test %d: %s', test_no, test)
+            _log.info('Test %d: %s', test_no, test)
 
             found = False
             svn_error = False
@@ -415,14 +429,14 @@
             for suffix in BASELINE_SUFFIXES:
                 archive_test_name = ('layout-test-results/%s-actual%s' %
                                       (test_basename, suffix))
-                logging.debug('  Archive test file name: "%s"',
-                              archive_test_name)
+                _log.debug('  Archive test file name: "%s"',
+                           archive_test_name)
                 if not archive_test_name in zip_namelist:
-                    logging.info('  %s file not in archive.', suffix)
+                    _log.info('  %s file not in archive.', suffix)
                     continue
 
                 found = True
-                logging.info('  %s file found in archive.', suffix)
+                _log.info('  %s file found in archive.', suffix)
 
                 # Extract new baseline from archive and save it to a temp file.
                 data = zip_file.read(archive_test_name)
@@ -433,11 +447,10 @@
 
                 expected_filename = '%s-expected%s' % (test_basename, suffix)
                 expected_fullpath = os.path.join(
-                    self._port._chromium_baseline_path(platform),
-                    expected_filename)
+                    self._rebaseline_port.baseline_path(), expected_filename)
                 expected_fullpath = os.path.normpath(expected_fullpath)
-                logging.debug('  Expected file full path: "%s"',
-                              expected_fullpath)
+                _log.debug('  Expected file full path: "%s"',
+                           expected_fullpath)
 
                 # TODO(victorw): for now, the rebaselining tool checks whether
                 # or not THIS baseline is duplicate and should be skipped.
@@ -466,12 +479,12 @@
                     self._create_html_baseline_files(expected_fullpath)
 
             if not found:
-                logging.warn('  No new baselines found in archive.')
+                _log.warn('  No new baselines found in archive.')
             else:
                 if svn_error:
-                    logging.warn('  Failed to add baselines to SVN.')
+                    _log.warn('  Failed to add baselines to SVN.')
                 else:
-                    logging.info('  Rebaseline succeeded.')
+                    _log.info('  Rebaseline succeeded.')
                     self._rebaselined_tests.append(test)
 
             test_no += 1
@@ -499,9 +512,10 @@
           True if the baseline is unnecessary.
           False otherwise.
         """
-        test_filepath = os.path.join(self._port.layout_tests_dir(), test)
-        all_baselines = self._port.expected_baselines(test_filepath,
-                                                      suffix, True)
+        test_filepath = os.path.join(self._target_port.layout_tests_dir(),
+                                     test)
+        all_baselines = self._rebaseline_port.expected_baselines(
+            test_filepath, suffix, True)
         for (fallback_dir, fallback_file) in all_baselines:
             if fallback_dir and fallback_file:
                 fallback_fullpath = os.path.normpath(
@@ -509,8 +523,8 @@
                 if fallback_fullpath.lower() != baseline_path.lower():
                     if not self._diff_baselines(new_baseline,
                                                 fallback_fullpath):
-                        logging.info('  Found same baseline at %s',
-                                     fallback_fullpath)
+                        _log.info('  Found same baseline at %s',
+                                  fallback_fullpath)
                         return True
                     else:
                         return False
@@ -531,15 +545,15 @@
         ext1 = os.path.splitext(file1)[1].upper()
         ext2 = os.path.splitext(file2)[1].upper()
         if ext1 != ext2:
-            logging.warn('Files to compare have different ext. '
-                         'File1: %s; File2: %s', file1, file2)
+            _log.warn('Files to compare have different ext. '
+                      'File1: %s; File2: %s', file1, file2)
             return True
 
         if ext1 == '.PNG':
-            return image_diff.ImageDiff(self._port, self._platform,
-                '').diff_files(self._port, file1, file2)
+            return image_diff.ImageDiff(self._port,
+               '').diff_files(self._port, file1, file2)
         else:
-            return text_diff.TestTextDiff(self._port, self._platform,
+            return text_diff.TestTextDiff(self._port,
                 '').diff_files(self._port, file1, file2)
 
     def _delete_baseline(self, filename):
@@ -575,20 +589,20 @@
             new_expectations = (
                 self._test_expectations.remove_platform_from_expectations(
                 self._rebaselined_tests, self._platform))
-            path = self._port.path_to_test_expectations_file()
+            path = self._target_port.path_to_test_expectations_file()
             if backup:
                 date_suffix = time.strftime('%Y%m%d%H%M%S',
                                             time.localtime(time.time()))
                 backup_file = ('%s.orig.%s' % (path, date_suffix))
                 if os.path.exists(backup_file):
                     os.remove(backup_file)
-                logging.info('Saving original file to "%s"', backup_file)
+                _log.info('Saving original file to "%s"', backup_file)
                 os.rename(path, backup_file)
             f = open(path, "w")
             f.write(new_expectations)
             f.close()
         else:
-            logging.info('No test was rebaselined so nothing to remove.')
+            _log.info('No test was rebaselined so nothing to remove.')
 
     def _svn_add(self, filename):
         """Add the file to SVN repository.
@@ -607,7 +621,7 @@
 
         parent_dir, basename = os.path.split(filename)
         if self._repo_type != REPO_SVN or parent_dir == filename:
-            logging.info("No svn checkout found, skip svn add.")
+            _log.info("No svn checkout found, skip svn add.")
             return True
 
         original_dir = os.getcwd()
@@ -616,12 +630,12 @@
         os.chdir(original_dir)
         output = status_output.upper()
         if output.startswith('A') or output.startswith('M'):
-            logging.info('  File already added to SVN: "%s"', filename)
+            _log.info('  File already added to SVN: "%s"', filename)
             return True
 
         if output.find('IS NOT A WORKING COPY') >= 0:
-            logging.info('  File is not a working copy, add its parent: "%s"',
-                         parent_dir)
+            _log.info('  File is not a working copy, add its parent: "%s"',
+                      parent_dir)
             return self._svn_add(parent_dir)
 
         os.chdir(parent_dir)
@@ -629,19 +643,19 @@
         os.chdir(original_dir)
         output = add_output.upper().rstrip()
         if output.startswith('A') and output.find(basename.upper()) >= 0:
-            logging.info('  Added new file: "%s"', filename)
+            _log.info('  Added new file: "%s"', filename)
             self._svn_prop_set(filename)
             return True
 
         if (not status_output) and (add_output.upper().find(
             'ALREADY UNDER VERSION CONTROL') >= 0):
-            logging.info('  File already under SVN and has no change: "%s"',
-                         filename)
+            _log.info('  File already under SVN and has no change: "%s"',
+                      filename)
             return True
 
-        logging.warn('  Failed to add file to SVN: "%s"', filename)
-        logging.warn('  Svn status output: "%s"', status_output)
-        logging.warn('  Svn add output: "%s"', add_output)
+        _log.warn('  Failed to add file to SVN: "%s"', filename)
+        _log.warn('  Svn status output: "%s"', status_output)
+        _log.warn('  Svn add output: "%s"', add_output)
         return False
 
     def _svn_prop_set(self, filename):
@@ -667,7 +681,7 @@
         else:
             cmd = ['svn', 'pset', 'svn:eol-style', 'LF', basename]
 
-        logging.debug('  Set svn prop: %s', ' '.join(cmd))
+        _log.debug('  Set svn prop: %s', ' '.join(cmd))
         run_shell(cmd, False)
         os.chdir(original_dir)
 
@@ -689,14 +703,14 @@
                                             baseline_filename, self._platform,
                                             'new')
         shutil.copyfile(baseline_fullpath, new_file)
-        logging.info('  Html: copied new baseline file from "%s" to "%s".',
-                     baseline_fullpath, new_file)
+        _log.info('  Html: copied new baseline file from "%s" to "%s".',
+                  baseline_fullpath, new_file)
 
         # Get the old baseline from SVN and save to the html directory.
         output = run_shell(['svn', 'cat', '-r', 'BASE', baseline_fullpath])
         if (not output) or (output.upper().rstrip().endswith(
             'NO SUCH FILE OR DIRECTORY')):
-            logging.info('  No base file: "%s"', baseline_fullpath)
+            _log.info('  No base file: "%s"', baseline_fullpath)
             return
         base_file = get_result_file_fullpath(self._options.html_directory,
                                              baseline_filename, self._platform,
@@ -704,8 +718,8 @@
         f = open(base_file, 'wb')
         f.write(output)
         f.close()
-        logging.info('  Html: created old baseline file: "%s".',
-                     base_file)
+        _log.info('  Html: created old baseline file: "%s".',
+                  base_file)
 
         # Get the diff between old and new baselines and save to the html dir.
         if baseline_filename.upper().endswith('.TXT'):
@@ -721,7 +735,7 @@
             else:
                 parent_dir = sys.path[0]  # tempdir is not secure.
             bogus_dir = os.path.join(parent_dir, "temp_svn_config")
-            logging.debug('  Html: temp config dir: "%s".', bogus_dir)
+            _log.debug('  Html: temp config dir: "%s".', bogus_dir)
             if not os.path.exists(bogus_dir):
                 os.mkdir(bogus_dir)
                 delete_bogus_dir = True
@@ -737,13 +751,13 @@
                 f = open(diff_file, 'wb')
                 f.write(output)
                 f.close()
-                logging.info('  Html: created baseline diff file: "%s".',
-                             diff_file)
+                _log.info('  Html: created baseline diff file: "%s".',
+                          diff_file)
 
             if delete_bogus_dir:
                 shutil.rmtree(bogus_dir, True)
-                logging.debug('  Html: removed temp config dir: "%s".',
-                              bogus_dir)
+                _log.debug('  Html: removed temp config dir: "%s".',
+                           bogus_dir)
 
 
 class HtmlGenerator(object):
@@ -792,9 +806,9 @@
                         '<img style="width: 200" src="%(uri)s" /></a></td>')
     HTML_TR = '<tr>%s</tr>'
 
-    def __init__(self, port, options, platforms, rebaselining_tests):
+    def __init__(self, target_port, options, platforms, rebaselining_tests):
         self._html_directory = options.html_directory
-        self._port = port
+        self._target_port = target_port
         self._platforms = platforms
         self._rebaselining_tests = rebaselining_tests
         self._html_file = os.path.join(options.html_directory,
@@ -803,7 +817,7 @@
     def generate_html(self):
         """Generate html file for rebaselining result comparison."""
 
-        logging.info('Generating html file')
+        _log.info('Generating html file')
 
         html_body = ''
         if not self._rebaselining_tests:
@@ -814,29 +828,29 @@
 
             test_no = 1
             for test in tests:
-                logging.info('Test %d: %s', test_no, test)
+                _log.info('Test %d: %s', test_no, test)
                 html_body += self._generate_html_for_one_test(test)
 
         html = self.HTML_REBASELINE % ({'time': time.asctime(),
                                         'body': html_body})
-        logging.debug(html)
+        _log.debug(html)
 
         f = open(self._html_file, 'w')
         f.write(html)
         f.close()
 
-        logging.info('Baseline comparison html generated at "%s"',
-                     self._html_file)
+        _log.info('Baseline comparison html generated at "%s"',
+                  self._html_file)
 
     def show_html(self):
         """Launch the rebaselining html in brwoser."""
 
-        logging.info('Launching html: "%s"', self._html_file)
+        _log.info('Launching html: "%s"', self._html_file)
 
-        html_uri = self._port.filename_to_uri(self._html_file)
+        html_uri = self._target_port.filename_to_uri(self._html_file)
         webbrowser.open(html_uri, 1)
 
-        logging.info('Html launched.')
+        _log.info('Html launched.')
 
     def _generate_baseline_links(self, test_basename, suffix, platform):
         """Generate links for baseline results (old, new and diff).
@@ -851,18 +865,18 @@
         """
 
         baseline_filename = '%s-expected%s' % (test_basename, suffix)
-        logging.debug('    baseline filename: "%s"', baseline_filename)
+        _log.debug('    baseline filename: "%s"', baseline_filename)
 
         new_file = get_result_file_fullpath(self._html_directory,
                                             baseline_filename, platform, 'new')
-        logging.info('    New baseline file: "%s"', new_file)
+        _log.info('    New baseline file: "%s"', new_file)
         if not os.path.exists(new_file):
-            logging.info('    No new baseline file: "%s"', new_file)
+            _log.info('    No new baseline file: "%s"', new_file)
             return ''
 
         old_file = get_result_file_fullpath(self._html_directory,
                                             baseline_filename, platform, 'old')
-        logging.info('    Old baseline file: "%s"', old_file)
+        _log.info('    Old baseline file: "%s"', old_file)
         if suffix == '.png':
             html_td_link = self.HTML_TD_LINK_IMG
         else:
@@ -871,24 +885,25 @@
         links = ''
         if os.path.exists(old_file):
             links += html_td_link % {
-                'uri': self._port.filename_to_uri(old_file),
+                'uri': self._target_port.filename_to_uri(old_file),
                 'name': baseline_filename}
         else:
-            logging.info('    No old baseline file: "%s"', old_file)
+            _log.info('    No old baseline file: "%s"', old_file)
             links += self.HTML_TD_NOLINK % ''
 
-        links += html_td_link % {'uri': self._port.filename_to_uri(new_file),
+        links += html_td_link % {'uri': self._target_port.filename_to_uri(
+                                     new_file),
                                  'name': baseline_filename}
 
         diff_file = get_result_file_fullpath(self._html_directory,
                                              baseline_filename, platform,
                                              'diff')
-        logging.info('    Baseline diff file: "%s"', diff_file)
+        _log.info('    Baseline diff file: "%s"', diff_file)
         if os.path.exists(diff_file):
-            links += html_td_link % {'uri': self._port.filename_to_uri(
+            links += html_td_link % {'uri': self._target_port.filename_to_uri(
                 diff_file), 'name': 'Diff'}
         else:
-            logging.info('    No baseline diff file: "%s"', diff_file)
+            _log.info('    No baseline diff file: "%s"', diff_file)
             links += self.HTML_TD_NOLINK % ''
 
         return links
@@ -904,13 +919,13 @@
         """
 
         test_basename = os.path.basename(os.path.splitext(test)[0])
-        logging.info('  basename: "%s"', test_basename)
+        _log.info('  basename: "%s"', test_basename)
         rows = []
         for suffix in BASELINE_SUFFIXES:
             if suffix == '.checksum':
                 continue
 
-            logging.info('  Checking %s files', suffix)
+            _log.info('  Checking %s files', suffix)
             for platform in self._platforms:
                 links = self._generate_baseline_links(test_basename, suffix,
                     platform)
@@ -919,17 +934,18 @@
                         suffix)
                     row += self.HTML_TD_NOLINK % platform
                     row += links
-                    logging.debug('    html row: %s', row)
+                    _log.debug('    html row: %s', row)
 
                     rows.append(self.HTML_TR % row)
 
         if rows:
-            test_path = os.path.join(self._port.layout_tests_dir(), test)
-            html = self.HTML_TR_TEST % (self._port.filename_to_uri(test_path),
-                test)
+            test_path = os.path.join(self._target_port.layout_tests_dir(),
+                                     test)
+            html = self.HTML_TR_TEST % (
+                self._target_port.filename_to_uri(test_path), test)
             html += self.HTML_TEST_DETAIL % ' '.join(rows)
 
-            logging.debug('    html for test: %s', html)
+            _log.debug('    html for test: %s', html)
             return self.HTML_TABLE_TEST % html
 
         return ''
@@ -982,8 +998,23 @@
                              help=('The directory that stores the results for'
                                    ' rebaselining comparison.'))
 
+    option_parser.add_option('', '--target-platform',
+                             default='chromium',
+                             help=('The target platform to rebaseline '
+                                   '("mac", "chromium", "qt", etc.). Defaults '
+                                   'to "chromium".'))
     options = option_parser.parse_args()[0]
-    port_obj = port.get(None, options)
+
+    # We need to create three different Port objects over the life of this
+    # script. |target_port_obj| is used to determine configuration information:
+    # location of the expectations file, names of ports to rebaseline, etc.
+    # |port_obj| is used for runtime functionality like actually diffing
+    # Then we create a rebaselining port to actual find and manage the
+    # baselines.
+    target_options = copy.copy(options)
+    if options.target_platform == 'chromium':
+        target_options.chromium = True
+    target_port_obj = port.get(None, target_options)
 
     # Set up our logging format.
     log_level = logging.INFO
@@ -994,15 +1025,27 @@
                                 '%(levelname)s %(message)s'),
                         datefmt='%y%m%d %H:%M:%S')
 
+    # options.configuration is used by port to locate image_diff binary.
+    # Check the imgage_diff release binary, if it does not exist,
+    # fallback to debug.
+    options.configuration = "Release"
+    port_obj = port.get(None, options)
+    if not port_obj.check_image_diff(override_step=None, logging=False):
+        _log.debug('No release version image diff binary found.')
+        options.configuration = "Debug"
+        port_obj = port.get(None, options)
+    else:
+        _log.debug('Found release version image diff binary.')
+
     # Verify 'platforms' option is valid
     if not options.platforms:
-        logging.error('Invalid "platforms" option. --platforms must be '
-                      'specified in order to rebaseline.')
+        _log.error('Invalid "platforms" option. --platforms must be '
+                   'specified in order to rebaseline.')
         sys.exit(1)
     platforms = [p.strip().lower() for p in options.platforms.split(',')]
     for platform in platforms:
         if not platform in REBASELINE_PLATFORM_ORDER:
-            logging.error('Invalid platform: "%s"' % (platform))
+            _log.error('Invalid platform: "%s"' % (platform))
             sys.exit(1)
 
     # Adjust the platform order so rebaseline tool is running at the order of
@@ -1019,9 +1062,9 @@
     rebaselining_tests = set()
     backup = options.backup
     for platform in rebaseline_platforms:
-        rebaseliner = Rebaseliner(port_obj, platform, options)
+        rebaseliner = Rebaseliner(port_obj, target_port_obj, platform, options)
 
-        logging.info('')
+        _log.info('')
         log_dashed_string('Rebaseline started', platform)
         if rebaseliner.run(backup):
             # Only need to backup one original copy of test expectation file.
@@ -1032,9 +1075,9 @@
 
         rebaselining_tests |= set(rebaseliner.get_rebaselining_tests())
 
-    logging.info('')
+    _log.info('')
     log_dashed_string('Rebaselining result comparison started', None)
-    html_generator = HtmlGenerator(port_obj,
+    html_generator = HtmlGenerator(target_port_obj,
                                    options,
                                    rebaseline_platforms,
                                    rebaselining_tests)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py
deleted file mode 100755
index f0b68ee..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py
+++ /dev/null
@@ -1,1624 +0,0 @@
-#!/usr/bin/env python
-# 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.
-
-"""Run layout tests using the test_shell.
-
-This is a port of the existing webkit test script run-webkit-tests.
-
-The TestRunner class runs a series of tests (TestType interface) against a set
-of test files.  If a test file fails a TestType, it returns a list TestFailure
-objects to the TestRunner.  The TestRunner then aggregates the TestFailures to
-create a final report.
-
-This script reads several files, if they exist in the test_lists subdirectory
-next to this script itself.  Each should contain a list of paths to individual
-tests or entire subdirectories of tests, relative to the outermost test
-directory.  Entire lines starting with '//' (comments) will be ignored.
-
-For details of the files' contents and purposes, see test_lists/README.
-"""
-
-import errno
-import glob
-import logging
-import math
-import optparse
-import os
-import Queue
-import random
-import re
-import shutil
-import sys
-import time
-import traceback
-
-import simplejson
-
-from layout_package import test_expectations
-from layout_package import json_layout_results_generator
-from layout_package import metered_stream
-from layout_package import test_failures
-from layout_package import test_shell_thread
-from layout_package import test_files
-from test_types import fuzzy_image_diff
-from test_types import image_diff
-from test_types import test_type_base
-from test_types import text_diff
-
-import port
-
-# Indicates that we want detailed progress updates in the output (prints
-# directory-by-directory feedback).
-LOG_DETAILED_PROGRESS = 'detailed-progress'
-
-# Log any unexpected results while running (instead of just at the end).
-LOG_UNEXPECTED = 'unexpected'
-
-# Builder base URL where we have the archived test results.
-BUILDER_BASE_URL = "http://build.chromium.org/buildbot/layout_test_results/"
-
-TestExpectationsFile = test_expectations.TestExpectationsFile
-
-
-class TestInfo:
-    """Groups information about a test for easy passing of data."""
-
-    def __init__(self, port, filename, timeout):
-        """Generates the URI and stores the filename and timeout for this test.
-        Args:
-          filename: Full path to the test.
-          timeout: Timeout for running the test in TestShell.
-          """
-        self.filename = filename
-        self.uri = port.filename_to_uri(filename)
-        self.timeout = timeout
-        expected_hash_file = port.expected_filename(filename, '.checksum')
-        try:
-            self.image_hash = open(expected_hash_file, "r").read()
-        except IOError, e:
-            if errno.ENOENT != e.errno:
-                raise
-            self.image_hash = None
-
-
-class ResultSummary(object):
-    """A class for partitioning the test results we get into buckets.
-
-    This class is basically a glorified struct and it's private to this file
-    so we don't bother with any information hiding."""
-
-    def __init__(self, expectations, test_files):
-        self.total = len(test_files)
-        self.remaining = self.total
-        self.expectations = expectations
-        self.expected = 0
-        self.unexpected = 0
-        self.tests_by_expectation = {}
-        self.tests_by_timeline = {}
-        self.results = {}
-        self.unexpected_results = {}
-        self.failures = {}
-        self.tests_by_expectation[test_expectations.SKIP] = set()
-        for expectation in TestExpectationsFile.EXPECTATIONS.values():
-            self.tests_by_expectation[expectation] = set()
-        for timeline in TestExpectationsFile.TIMELINES.values():
-            self.tests_by_timeline[timeline] = (
-                expectations.get_tests_with_timeline(timeline))
-
-    def add(self, test, failures, result, expected):
-        """Add a result into the appropriate bin.
-
-        Args:
-          test: test file name
-          failures: list of failure objects from test execution
-          result: result of test (PASS, IMAGE, etc.).
-          expected: whether the result was what we expected it to be.
-        """
-
-        self.tests_by_expectation[result].add(test)
-        self.results[test] = result
-        self.remaining -= 1
-        if len(failures):
-            self.failures[test] = failures
-        if expected:
-            self.expected += 1
-        else:
-            self.unexpected_results[test] = result
-            self.unexpected += 1
-
-
-class TestRunner:
-    """A class for managing running a series of tests on a series of layout
-    test files."""
-
-    HTTP_SUBDIR = os.sep.join(['', 'http', ''])
-    WEBSOCKET_SUBDIR = os.sep.join(['', 'websocket', ''])
-
-    # The per-test timeout in milliseconds, if no --time-out-ms option was
-    # given to run_webkit_tests. This should correspond to the default timeout
-    # in test_shell.exe.
-    DEFAULT_TEST_TIMEOUT_MS = 6 * 1000
-
-    NUM_RETRY_ON_UNEXPECTED_FAILURE = 1
-
-    def __init__(self, port, options, meter):
-        """Initialize test runner data structures.
-
-        Args:
-          port: an object implementing port-specific
-          options: a dictionary of command line options
-          meter: a MeteredStream object to record updates to.
-        """
-        self._port = port
-        self._options = options
-        self._meter = meter
-
-        # disable wss server. need to install pyOpenSSL on buildbots.
-        # self._websocket_secure_server = websocket_server.PyWebSocket(
-        #        options.results_directory, use_tls=True, port=9323)
-
-        # a list of TestType objects
-        self._test_types = []
-
-        # a set of test files, and the same tests as a list
-        self._test_files = set()
-        self._test_files_list = None
-        self._result_queue = Queue.Queue()
-
-        # These are used for --log detailed-progress to track status by
-        # directory.
-        self._current_dir = None
-        self._current_progress_str = ""
-        self._current_test_number = 0
-
-    def __del__(self):
-        logging.debug("flushing stdout")
-        sys.stdout.flush()
-        logging.debug("flushing stderr")
-        sys.stderr.flush()
-        logging.debug("stopping http server")
-        self._port.stop_http_server()
-        logging.debug("stopping websocket server")
-        self._port.stop_websocket_server()
-
-    def gather_file_paths(self, paths):
-        """Find all the files to test.
-
-        Args:
-          paths: a list of globs to use instead of the defaults."""
-        self._test_files = test_files.gather_test_files(self._port, paths)
-
-    def parse_expectations(self, test_platform_name, is_debug_mode):
-        """Parse the expectations from the test_list files and return a data
-        structure holding them. Throws an error if the test_list files have
-        invalid syntax."""
-        if self._options.lint_test_files:
-            test_files = None
-        else:
-            test_files = self._test_files
-
-        try:
-            expectations_str = self._port.test_expectations()
-            self._expectations = test_expectations.TestExpectations(
-                self._port, test_files, expectations_str, test_platform_name,
-                is_debug_mode, self._options.lint_test_files)
-            return self._expectations
-        except Exception, err:
-            if self._options.lint_test_files:
-                print str(err)
-            else:
-                raise err
-
-    def prepare_lists_and_print_output(self, write):
-        """Create appropriate subsets of test lists and returns a
-        ResultSummary object. Also prints expected test counts.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-             sys.stdout.write.
-        """
-
-        # Remove skipped - both fixable and ignored - files from the
-        # top-level list of files to test.
-        num_all_test_files = len(self._test_files)
-        write("Found:  %d tests" % (len(self._test_files)))
-        skipped = set()
-        if num_all_test_files > 1 and not self._options.force:
-            skipped = self._expectations.get_tests_with_result_type(
-                           test_expectations.SKIP)
-            self._test_files -= skipped
-
-        # Create a sorted list of test files so the subset chunk,
-        # if used, contains alphabetically consecutive tests.
-        self._test_files_list = list(self._test_files)
-        if self._options.randomize_order:
-            random.shuffle(self._test_files_list)
-        else:
-            self._test_files_list.sort()
-
-        # If the user specifies they just want to run a subset of the tests,
-        # just grab a subset of the non-skipped tests.
-        if self._options.run_chunk or self._options.run_part:
-            chunk_value = self._options.run_chunk or self._options.run_part
-            test_files = self._test_files_list
-            try:
-                (chunk_num, chunk_len) = chunk_value.split(":")
-                chunk_num = int(chunk_num)
-                assert(chunk_num >= 0)
-                test_size = int(chunk_len)
-                assert(test_size > 0)
-            except:
-                logging.critical("invalid chunk '%s'" % chunk_value)
-                sys.exit(1)
-
-            # Get the number of tests
-            num_tests = len(test_files)
-
-            # Get the start offset of the slice.
-            if self._options.run_chunk:
-                chunk_len = test_size
-                # In this case chunk_num can be really large. We need
-                # to make the slave fit in the current number of tests.
-                slice_start = (chunk_num * chunk_len) % num_tests
-            else:
-                # Validate the data.
-                assert(test_size <= num_tests)
-                assert(chunk_num <= test_size)
-
-                # To count the chunk_len, and make sure we don't skip
-                # some tests, we round to the next value that fits exactly
-                # all the parts.
-                rounded_tests = num_tests
-                if rounded_tests % test_size != 0:
-                    rounded_tests = (num_tests + test_size -
-                                     (num_tests % test_size))
-
-                chunk_len = rounded_tests / test_size
-                slice_start = chunk_len * (chunk_num - 1)
-                # It does not mind if we go over test_size.
-
-            # Get the end offset of the slice.
-            slice_end = min(num_tests, slice_start + chunk_len)
-
-            files = test_files[slice_start:slice_end]
-
-            tests_run_msg = 'Running: %d tests (chunk slice [%d:%d] of %d)' % (
-                (slice_end - slice_start), slice_start, slice_end, num_tests)
-            write(tests_run_msg)
-
-            # If we reached the end and we don't have enough tests, we run some
-            # from the beginning.
-            if (self._options.run_chunk and
-                (slice_end - slice_start < chunk_len)):
-                extra = 1 + chunk_len - (slice_end - slice_start)
-                extra_msg = ('   last chunk is partial, appending [0:%d]' %
-                            extra)
-                write(extra_msg)
-                tests_run_msg += "\n" + extra_msg
-                files.extend(test_files[0:extra])
-            tests_run_filename = os.path.join(self._options.results_directory,
-                                              "tests_run.txt")
-            tests_run_file = open(tests_run_filename, "w")
-            tests_run_file.write(tests_run_msg + "\n")
-            tests_run_file.close()
-
-            len_skip_chunk = int(len(files) * len(skipped) /
-                                 float(len(self._test_files)))
-            skip_chunk_list = list(skipped)[0:len_skip_chunk]
-            skip_chunk = set(skip_chunk_list)
-
-            # Update expectations so that the stats are calculated correctly.
-            # We need to pass a list that includes the right # of skipped files
-            # to ParseExpectations so that ResultSummary() will get the correct
-            # stats. So, we add in the subset of skipped files, and then
-            # subtract them back out.
-            self._test_files_list = files + skip_chunk_list
-            self._test_files = set(self._test_files_list)
-
-            self._expectations = self.parse_expectations(
-                self._port.test_platform_name(),
-                self._options.target == 'Debug')
-
-            self._test_files = set(files)
-            self._test_files_list = files
-        else:
-            skip_chunk = skipped
-
-        result_summary = ResultSummary(self._expectations,
-            self._test_files | skip_chunk)
-        self._print_expected_results_of_type(write, result_summary,
-            test_expectations.PASS, "passes")
-        self._print_expected_results_of_type(write, result_summary,
-            test_expectations.FAIL, "failures")
-        self._print_expected_results_of_type(write, result_summary,
-            test_expectations.FLAKY, "flaky")
-        self._print_expected_results_of_type(write, result_summary,
-            test_expectations.SKIP, "skipped")
-
-
-        if self._options.force:
-            write('Running all tests, including skips (--force)')
-        else:
-            # Note that we don't actually run the skipped tests (they were
-            # subtracted out of self._test_files, above), but we stub out the
-            # results here so the statistics can remain accurate.
-            for test in skip_chunk:
-                result_summary.add(test, [], test_expectations.SKIP,
-                                   expected=True)
-        write("")
-
-        return result_summary
-
-    def add_test_type(self, test_type):
-        """Add a TestType to the TestRunner."""
-        self._test_types.append(test_type)
-
-    def _get_dir_for_test_file(self, test_file):
-        """Returns the highest-level directory by which to shard the given
-        test file."""
-        index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
-
-        test_file = test_file[index + len('LayoutTests/'):]
-        test_file_parts = test_file.split(os.sep, 1)
-        directory = test_file_parts[0]
-        test_file = test_file_parts[1]
-
-        # The http tests are very stable on mac/linux.
-        # TODO(ojan): Make the http server on Windows be apache so we can
-        # turn shard the http tests there as well. Switching to apache is
-        # what made them stable on linux/mac.
-        return_value = directory
-        while ((directory != 'http' or sys.platform in ('darwin', 'linux2'))
-                and test_file.find(os.sep) >= 0):
-            test_file_parts = test_file.split(os.sep, 1)
-            directory = test_file_parts[0]
-            return_value = os.path.join(return_value, directory)
-            test_file = test_file_parts[1]
-
-        return return_value
-
-    def _get_test_info_for_file(self, test_file):
-        """Returns the appropriate TestInfo object for the file. Mostly this
-        is used for looking up the timeout value (in ms) to use for the given
-        test."""
-        if self._expectations.has_modifier(test_file, test_expectations.SLOW):
-            return TestInfo(self._port, test_file,
-                            self._options.slow_time_out_ms)
-        return TestInfo(self._port, test_file, self._options.time_out_ms)
-
-    def _get_test_file_queue(self, test_files):
-        """Create the thread safe queue of lists of (test filenames, test URIs)
-        tuples. Each TestShellThread pulls a list from this queue and runs
-        those tests in order before grabbing the next available list.
-
-        Shard the lists by directory. This helps ensure that tests that depend
-        on each other (aka bad tests!) continue to run together as most
-        cross-tests dependencies tend to occur within the same directory.
-
-        Return:
-          The Queue of lists of TestInfo objects.
-        """
-
-        if (self._options.experimental_fully_parallel or
-            self._is_single_threaded()):
-            filename_queue = Queue.Queue()
-            for test_file in test_files:
-                filename_queue.put(
-                    ('.', [self._get_test_info_for_file(test_file)]))
-            return filename_queue
-
-        tests_by_dir = {}
-        for test_file in test_files:
-            directory = self._get_dir_for_test_file(test_file)
-            tests_by_dir.setdefault(directory, [])
-            tests_by_dir[directory].append(
-                self._get_test_info_for_file(test_file))
-
-        # Sort by the number of tests in the dir so that the ones with the
-        # most tests get run first in order to maximize parallelization.
-        # Number of tests is a good enough, but not perfect, approximation
-        # of how long that set of tests will take to run. We can't just use
-        # a PriorityQueue until we move # to Python 2.6.
-        test_lists = []
-        http_tests = None
-        for directory in tests_by_dir:
-            test_list = tests_by_dir[directory]
-            # Keep the tests in alphabetical order.
-            # TODO: Remove once tests are fixed so they can be run in any
-            # order.
-            test_list.reverse()
-            test_list_tuple = (directory, test_list)
-            if directory == 'LayoutTests' + os.sep + 'http':
-                http_tests = test_list_tuple
-            else:
-                test_lists.append(test_list_tuple)
-        test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
-
-        # Put the http tests first. There are only a couple hundred of them,
-        # but each http test takes a very long time to run, so sorting by the
-        # number of tests doesn't accurately capture how long they take to run.
-        if http_tests:
-            test_lists.insert(0, http_tests)
-
-        filename_queue = Queue.Queue()
-        for item in test_lists:
-            filename_queue.put(item)
-        return filename_queue
-
-    def _get_test_shell_args(self, index):
-        """Returns the tuple of arguments for tests and for test_shell."""
-        shell_args = []
-        test_args = test_type_base.TestArguments()
-        png_path = None
-        if not self._options.no_pixel_tests:
-            png_path = os.path.join(self._options.results_directory,
-                                    "png_result%s.png" % index)
-            shell_args.append("--pixel-tests=" + png_path)
-            test_args.png_path = png_path
-
-        test_args.new_baseline = self._options.new_baseline
-
-        test_args.show_sources = self._options.sources
-
-        if self._options.startup_dialog:
-            shell_args.append('--testshell-startup-dialog')
-
-        if self._options.gp_fault_error_box:
-            shell_args.append('--gp-fault-error-box')
-
-        return test_args, png_path, shell_args
-
-    def _contains_tests(self, subdir):
-        for test_file in self._test_files_list:
-            if test_file.find(subdir) >= 0:
-                return True
-        return False
-
-    def _instantiate_test_shell_threads(self, test_files, result_summary):
-        """Instantitates and starts the TestShellThread(s).
-
-        Return:
-          The list of threads.
-        """
-        filename_queue = self._get_test_file_queue(test_files)
-
-        # Instantiate TestShellThreads and start them.
-        threads = []
-        for i in xrange(int(self._options.num_test_shells)):
-            # Create separate TestTypes instances for each thread.
-            test_types = []
-            for t in self._test_types:
-                test_types.append(t(self._port, self._options.platform,
-                                    self._options.results_directory))
-
-            test_args, png_path, shell_args = self._get_test_shell_args(i)
-            thread = test_shell_thread.TestShellThread(self._port,
-                                                       filename_queue,
-                                                       self._result_queue,
-                                                       test_types,
-                                                       test_args,
-                                                       png_path,
-                                                       shell_args,
-                                                       self._options)
-            if self._is_single_threaded():
-                thread.run_in_main_thread(self, result_summary)
-            else:
-                thread.start()
-            threads.append(thread)
-
-        return threads
-
-    def _is_single_threaded(self):
-        """Returns whether we should run all the tests in the main thread."""
-        return int(self._options.num_test_shells) == 1
-
-    def _run_tests(self, file_list, result_summary):
-        """Runs the tests in the file_list.
-
-        Return: A tuple (failures, thread_timings, test_timings,
-            individual_test_timings)
-            failures is a map from test to list of failure types
-            thread_timings is a list of dicts with the total runtime
-              of each thread with 'name', 'num_tests', 'total_time' properties
-            test_timings is a list of timings for each sharded subdirectory
-              of the form [time, directory_name, num_tests]
-            individual_test_timings is a list of run times for each test
-              in the form {filename:filename, test_run_time:test_run_time}
-            result_summary: summary object to populate with the results
-        """
-        threads = self._instantiate_test_shell_threads(file_list,
-                                                       result_summary)
-
-        # Wait for the threads to finish and collect test failures.
-        failures = {}
-        test_timings = {}
-        individual_test_timings = []
-        thread_timings = []
-        try:
-            for thread in threads:
-                while thread.isAlive():
-                    # Let it timeout occasionally so it can notice a
-                    # KeyboardInterrupt. Actually, the timeout doesn't
-                    # really matter: apparently it suffices to not use
-                    # an indefinite blocking join for it to
-                    # be interruptible by KeyboardInterrupt.
-                    thread.join(0.1)
-                    self.update_summary(result_summary)
-                thread_timings.append({'name': thread.getName(),
-                                       'num_tests': thread.get_num_tests(),
-                                       'total_time': thread.get_total_time()})
-                test_timings.update(thread.get_directory_timing_stats())
-                individual_test_timings.extend(
-                    thread.get_individual_test_stats())
-        except KeyboardInterrupt:
-            for thread in threads:
-                thread.cancel()
-            self._port.stop_helper()
-            raise
-        for thread in threads:
-            # Check whether a TestShellThread died before normal completion.
-            exception_info = thread.get_exception_info()
-            if exception_info is not None:
-                # Re-raise the thread's exception here to make it clear that
-                # testing was aborted. Otherwise, the tests that did not run
-                # would be assumed to have passed.
-                raise exception_info[0], exception_info[1], exception_info[2]
-
-        # Make sure we pick up any remaining tests.
-        self.update_summary(result_summary)
-        return (thread_timings, test_timings, individual_test_timings)
-
-    def run(self, result_summary):
-        """Run all our tests on all our test files.
-
-        For each test file, we run each test type. If there are any failures,
-        we collect them for reporting.
-
-        Args:
-          result_summary: a summary object tracking the test results.
-
-        Return:
-          We return nonzero if there are regressions compared to the last run.
-        """
-        if not self._test_files:
-            return 0
-        start_time = time.time()
-
-        # Start up any helper needed
-        if not self._options.no_pixel_tests:
-            self._port.start_helper()
-
-        if self._contains_tests(self.HTTP_SUBDIR):
-            self._port.start_http_server()
-
-        if self._contains_tests(self.WEBSOCKET_SUBDIR):
-            self._port.start_websocket_server()
-            # self._websocket_secure_server.Start()
-
-        thread_timings, test_timings, individual_test_timings = (
-            self._run_tests(self._test_files_list, result_summary))
-
-        # We exclude the crashes from the list of results to retry, because
-        # we want to treat even a potentially flaky crash as an error.
-        failures = self._get_failures(result_summary, include_crashes=False)
-        retries = 0
-        retry_summary = result_summary
-        while (retries < self.NUM_RETRY_ON_UNEXPECTED_FAILURE and
-               len(failures)):
-            logging.debug("Retrying %d unexpected failure(s)" % len(failures))
-            retries += 1
-            retry_summary = ResultSummary(self._expectations, failures.keys())
-            self._run_tests(failures.keys(), retry_summary)
-            failures = self._get_failures(retry_summary, include_crashes=True)
-
-        self._port.stop_helper()
-        end_time = time.time()
-
-        write = create_logging_writer(self._options, 'timing')
-        self._print_timing_statistics(write, end_time - start_time,
-                                    thread_timings, test_timings,
-                                    individual_test_timings,
-                                    result_summary)
-
-        self._meter.update("")
-
-        if self._options.verbose:
-            # We write this block to stdout for compatibility with the
-            # buildbot log parser, which only looks at stdout, not stderr :(
-            write = lambda s: sys.stdout.write("%s\n" % s)
-        else:
-            write = create_logging_writer(self._options, 'actual')
-
-        self._print_result_summary(write, result_summary)
-
-        sys.stdout.flush()
-        sys.stderr.flush()
-
-        if (LOG_DETAILED_PROGRESS in self._options.log or
-            (LOG_UNEXPECTED in self._options.log and
-             result_summary.total != result_summary.expected)):
-            print
-
-        # This summary data gets written to stdout regardless of log level
-        self._print_one_line_summary(result_summary.total,
-                                  result_summary.expected)
-
-        unexpected_results = self._summarize_unexpected_results(result_summary,
-            retry_summary)
-        self._print_unexpected_results(unexpected_results)
-
-        # Write the same data to log files.
-        self._write_json_files(unexpected_results, result_summary,
-                             individual_test_timings)
-
-        # Write the summary to disk (results.html) and maybe open the
-        # test_shell to this file.
-        wrote_results = self._write_results_html_file(result_summary)
-        if not self._options.noshow_results and wrote_results:
-            self._show_results_html_file()
-
-        # Ignore flaky failures and unexpected passes so we don't turn the
-        # bot red for those.
-        return unexpected_results['num_regressions']
-
-    def update_summary(self, result_summary):
-        """Update the summary while running tests."""
-        while True:
-            try:
-                (test, fail_list) = self._result_queue.get_nowait()
-                result = test_failures.determine_result_type(fail_list)
-                expected = self._expectations.matches_an_expected_result(test,
-                                                                      result)
-                result_summary.add(test, fail_list, result, expected)
-                if (LOG_DETAILED_PROGRESS in self._options.log and
-                    (self._options.experimental_fully_parallel or
-                     self._is_single_threaded())):
-                    self._display_detailed_progress(result_summary)
-                else:
-                    if not expected and LOG_UNEXPECTED in self._options.log:
-                        self._print_unexpected_test_result(test, result)
-                    self._display_one_line_progress(result_summary)
-            except Queue.Empty:
-                return
-
-    def _display_one_line_progress(self, result_summary):
-        """Displays the progress through the test run."""
-        self._meter.update("Testing: %d ran as expected, %d didn't, %d left" %
-            (result_summary.expected, result_summary.unexpected,
-             result_summary.remaining))
-
-    def _display_detailed_progress(self, result_summary):
-        """Display detailed progress output where we print the directory name
-        and one dot for each completed test. This is triggered by
-        "--log detailed-progress"."""
-        if self._current_test_number == len(self._test_files_list):
-            return
-
-        next_test = self._test_files_list[self._current_test_number]
-        next_dir = os.path.dirname(
-            self._port.relative_test_filename(next_test))
-        if self._current_progress_str == "":
-            self._current_progress_str = "%s: " % (next_dir)
-            self._current_dir = next_dir
-
-        while next_test in result_summary.results:
-            if next_dir != self._current_dir:
-                self._meter.write("%s\n" % (self._current_progress_str))
-                self._current_progress_str = "%s: ." % (next_dir)
-                self._current_dir = next_dir
-            else:
-                self._current_progress_str += "."
-
-            if (next_test in result_summary.unexpected_results and
-                LOG_UNEXPECTED in self._options.log):
-                result = result_summary.unexpected_results[next_test]
-                self._meter.write("%s\n" % self._current_progress_str)
-                self._print_unexpected_test_result(next_test, result)
-                self._current_progress_str = "%s: " % self._current_dir
-
-            self._current_test_number += 1
-            if self._current_test_number == len(self._test_files_list):
-                break
-
-            next_test = self._test_files_list[self._current_test_number]
-            next_dir = os.path.dirname(
-                self._port.relative_test_filename(next_test))
-
-        if result_summary.remaining:
-            remain_str = " (%d)" % (result_summary.remaining)
-            self._meter.update("%s%s" %
-                               (self._current_progress_str, remain_str))
-        else:
-            self._meter.write("%s\n" % (self._current_progress_str))
-
-    def _get_failures(self, result_summary, include_crashes):
-        """Filters a dict of results and returns only the failures.
-
-        Args:
-          result_summary: the results of the test run
-          include_crashes: whether crashes are included in the output.
-            We use False when finding the list of failures to retry
-            to see if the results were flaky. Although the crashes may also be
-            flaky, we treat them as if they aren't so that they're not ignored.
-        Returns:
-          a dict of files -> results
-        """
-        failed_results = {}
-        for test, result in result_summary.unexpected_results.iteritems():
-            if (result == test_expectations.PASS or
-                result == test_expectations.CRASH and not include_crashes):
-                continue
-            failed_results[test] = result
-
-        return failed_results
-
-    def _summarize_unexpected_results(self, result_summary, retry_summary):
-        """Summarize any unexpected results as a dict.
-
-        TODO(dpranke): split this data structure into a separate class?
-
-        Args:
-          result_summary: summary object from initial test runs
-          retry_summary: summary object from final test run of retried tests
-        Returns:
-          A dictionary containing a summary of the unexpected results from the
-          run, with the following fields:
-            'version': a version indicator (1 in this version)
-            'fixable': # of fixable tests (NOW - PASS)
-            'skipped': # of skipped tests (NOW & SKIPPED)
-            'num_regressions': # of non-flaky failures
-            'num_flaky': # of flaky failures
-            'num_passes': # of unexpected passes
-            'tests': a dict of tests -> {'expected': '...', 'actual': '...'}
-        """
-        results = {}
-        results['version'] = 1
-
-        tbe = result_summary.tests_by_expectation
-        tbt = result_summary.tests_by_timeline
-        results['fixable'] = len(tbt[test_expectations.NOW] -
-                                 tbe[test_expectations.PASS])
-        results['skipped'] = len(tbt[test_expectations.NOW] &
-                                 tbe[test_expectations.SKIP])
-
-        num_passes = 0
-        num_flaky = 0
-        num_regressions = 0
-        keywords = {}
-        for k, v in TestExpectationsFile.EXPECTATIONS.iteritems():
-            keywords[v] = k.upper()
-
-        tests = {}
-        for filename, result in result_summary.unexpected_results.iteritems():
-            # Note that if a test crashed in the original run, we ignore
-            # whether or not it crashed when we retried it (if we retried it),
-            # and always consider the result not flaky.
-            test = self._port.relative_test_filename(filename)
-            expected = self._expectations.get_expectations_string(filename)
-            actual = [keywords[result]]
-
-            if result == test_expectations.PASS:
-                num_passes += 1
-            elif result == test_expectations.CRASH:
-                num_regressions += 1
-            else:
-                if filename not in retry_summary.unexpected_results:
-                    actual.extend(
-                        self._expectations.get_expectations_string(
-                        filename).split(" "))
-                    num_flaky += 1
-                else:
-                    retry_result = retry_summary.unexpected_results[filename]
-                    if result != retry_result:
-                        actual.append(keywords[retry_result])
-                        num_flaky += 1
-                    else:
-                        num_regressions += 1
-
-            tests[test] = {}
-            tests[test]['expected'] = expected
-            tests[test]['actual'] = " ".join(actual)
-
-        results['tests'] = tests
-        results['num_passes'] = num_passes
-        results['num_flaky'] = num_flaky
-        results['num_regressions'] = num_regressions
-
-        return results
-
-    def _write_json_files(self, unexpected_results, result_summary,
-                        individual_test_timings):
-        """Writes the results of the test run as JSON files into the results
-        dir.
-
-        There are three different files written into the results dir:
-          unexpected_results.json: A short list of any unexpected results.
-            This is used by the buildbots to display results.
-          expectations.json: This is used by the flakiness dashboard.
-          results.json: A full list of the results - used by the flakiness
-            dashboard and the aggregate results dashboard.
-
-        Args:
-          unexpected_results: dict of unexpected results
-          result_summary: full summary object
-          individual_test_timings: list of test times (used by the flakiness
-            dashboard).
-        """
-        logging.debug("Writing JSON files in %s." %
-                      self._options.results_directory)
-        unexpected_file = open(os.path.join(self._options.results_directory,
-            "unexpected_results.json"), "w")
-        unexpected_file.write(simplejson.dumps(unexpected_results,
-                              sort_keys=True, indent=2))
-        unexpected_file.close()
-
-        # Write a json file of the test_expectations.txt file for the layout
-        # tests dashboard.
-        expectations_file = open(os.path.join(self._options.results_directory,
-            "expectations.json"), "w")
-        expectations_json = \
-            self._expectations.get_expectations_json_for_all_platforms()
-        expectations_file.write("ADD_EXPECTATIONS(" + expectations_json + ");")
-        expectations_file.close()
-
-        json_layout_results_generator.JSONLayoutResultsGenerator(
-            self._port, self._options.builder_name, self._options.build_name,
-            self._options.build_number, self._options.results_directory,
-            BUILDER_BASE_URL, individual_test_timings,
-            self._expectations, result_summary, self._test_files_list)
-
-        logging.debug("Finished writing JSON files.")
-
-    def _print_expected_results_of_type(self, write, result_summary,
-                                        result_type, result_type_str):
-        """Print the number of the tests in a given result class.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-             sys.stdout.write.
-          result_summary - the object containing all the results to report on
-          result_type - the particular result type to report in the summary.
-          result_type_str - a string description of the result_type.
-        """
-        tests = self._expectations.get_tests_with_result_type(result_type)
-        now = result_summary.tests_by_timeline[test_expectations.NOW]
-        wontfix = result_summary.tests_by_timeline[test_expectations.WONTFIX]
-        defer = result_summary.tests_by_timeline[test_expectations.DEFER]
-
-        # We use a fancy format string in order to print the data out in a
-        # nicely-aligned table.
-        fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd defer, %%%dd wontfix)"
-                  % (self._num_digits(now), self._num_digits(defer),
-                  self._num_digits(wontfix)))
-        write(fmtstr % (len(tests), result_type_str, len(tests & now),
-              len(tests & defer), len(tests & wontfix)))
-
-    def _num_digits(self, num):
-        """Returns the number of digits needed to represent the length of a
-        sequence."""
-        ndigits = 1
-        if len(num):
-            ndigits = int(math.log10(len(num))) + 1
-        return ndigits
-
-    def _print_timing_statistics(self, write, total_time, thread_timings,
-                               directory_test_timings, individual_test_timings,
-                               result_summary):
-        """Record timing-specific information for the test run.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          total_time: total elapsed time (in seconds) for the test run
-          thread_timings: wall clock time each thread ran for
-          directory_test_timings: timing by directory
-          individual_test_timings: timing by file
-          result_summary: summary object for the test run
-        """
-        write("Test timing:")
-        write("  %6.2f total testing time" % total_time)
-        write("")
-        write("Thread timing:")
-        cuml_time = 0
-        for t in thread_timings:
-            write("    %10s: %5d tests, %6.2f secs" %
-                  (t['name'], t['num_tests'], t['total_time']))
-            cuml_time += t['total_time']
-        write("   %6.2f cumulative, %6.2f optimal" %
-              (cuml_time, cuml_time / int(self._options.num_test_shells)))
-        write("")
-
-        self._print_aggregate_test_statistics(write, individual_test_timings)
-        self._print_individual_test_times(write, individual_test_timings,
-                                          result_summary)
-        self._print_directory_timings(write, directory_test_timings)
-
-    def _print_aggregate_test_statistics(self, write, individual_test_timings):
-        """Prints aggregate statistics (e.g. median, mean, etc.) for all tests.
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          individual_test_timings: List of test_shell_thread.TestStats for all
-              tests.
-        """
-        test_types = individual_test_timings[0].time_for_diffs.keys()
-        times_for_test_shell = []
-        times_for_diff_processing = []
-        times_per_test_type = {}
-        for test_type in test_types:
-            times_per_test_type[test_type] = []
-
-        for test_stats in individual_test_timings:
-            times_for_test_shell.append(test_stats.test_run_time)
-            times_for_diff_processing.append(
-                test_stats.total_time_for_all_diffs)
-            time_for_diffs = test_stats.time_for_diffs
-            for test_type in test_types:
-                times_per_test_type[test_type].append(
-                    time_for_diffs[test_type])
-
-        self._print_statistics_for_test_timings(write,
-            "PER TEST TIME IN TESTSHELL (seconds):", times_for_test_shell)
-        self._print_statistics_for_test_timings(write,
-            "PER TEST DIFF PROCESSING TIMES (seconds):",
-            times_for_diff_processing)
-        for test_type in test_types:
-            self._print_statistics_for_test_timings(write,
-                "PER TEST TIMES BY TEST TYPE: %s" % test_type,
-                times_per_test_type[test_type])
-
-    def _print_individual_test_times(self, write, individual_test_timings,
-                                  result_summary):
-        """Prints the run times for slow, timeout and crash tests.
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          individual_test_timings: List of test_shell_thread.TestStats for all
-              tests.
-          result_summary: summary object for test run
-        """
-        # Reverse-sort by the time spent in test_shell.
-        individual_test_timings.sort(lambda a, b:
-            cmp(b.test_run_time, a.test_run_time))
-
-        num_printed = 0
-        slow_tests = []
-        timeout_or_crash_tests = []
-        unexpected_slow_tests = []
-        for test_tuple in individual_test_timings:
-            filename = test_tuple.filename
-            is_timeout_crash_or_slow = False
-            if self._expectations.has_modifier(filename,
-                                               test_expectations.SLOW):
-                is_timeout_crash_or_slow = True
-                slow_tests.append(test_tuple)
-
-            if filename in result_summary.failures:
-                result = result_summary.results[filename]
-                if (result == test_expectations.TIMEOUT or
-                    result == test_expectations.CRASH):
-                    is_timeout_crash_or_slow = True
-                    timeout_or_crash_tests.append(test_tuple)
-
-            if (not is_timeout_crash_or_slow and
-                num_printed < self._options.num_slow_tests_to_log):
-                num_printed = num_printed + 1
-                unexpected_slow_tests.append(test_tuple)
-
-        write("")
-        self._print_test_list_timing(write, "%s slowest tests that are not "
-            "marked as SLOW and did not timeout/crash:" %
-            self._options.num_slow_tests_to_log, unexpected_slow_tests)
-        write("")
-        self._print_test_list_timing(write, "Tests marked as SLOW:",
-                                     slow_tests)
-        write("")
-        self._print_test_list_timing(write, "Tests that timed out or crashed:",
-                                     timeout_or_crash_tests)
-        write("")
-
-    def _print_test_list_timing(self, write, title, test_list):
-        """Print timing info for each test.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          title: section heading
-          test_list: tests that fall in this section
-        """
-        write(title)
-        for test_tuple in test_list:
-            filename = test_tuple.filename[len(
-                self._port.layout_tests_dir()) + 1:]
-            filename = filename.replace('\\', '/')
-            test_run_time = round(test_tuple.test_run_time, 1)
-            write("  %s took %s seconds" % (filename, test_run_time))
-
-    def _print_directory_timings(self, write, directory_test_timings):
-        """Print timing info by directory for any directories that
-        take > 10 seconds to run.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          directory_test_timing: time info for each directory
-        """
-        timings = []
-        for directory in directory_test_timings:
-            num_tests, time_for_directory = directory_test_timings[directory]
-            timings.append((round(time_for_directory, 1), directory,
-                            num_tests))
-        timings.sort()
-
-        write("Time to process slowest subdirectories:")
-        min_seconds_to_print = 10
-        for timing in timings:
-            if timing[0] > min_seconds_to_print:
-                write("  %s took %s seconds to run %s tests." % (timing[1],
-                      timing[0], timing[2]))
-        write("")
-
-    def _print_statistics_for_test_timings(self, write, title, timings):
-        """Prints the median, mean and standard deviation of the values in
-        timings.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          title: Title for these timings.
-          timings: A list of floats representing times.
-        """
-        write(title)
-        timings.sort()
-
-        num_tests = len(timings)
-        percentile90 = timings[int(.9 * num_tests)]
-        percentile99 = timings[int(.99 * num_tests)]
-
-        if num_tests % 2 == 1:
-            median = timings[((num_tests - 1) / 2) - 1]
-        else:
-            lower = timings[num_tests / 2 - 1]
-            upper = timings[num_tests / 2]
-            median = (float(lower + upper)) / 2
-
-        mean = sum(timings) / num_tests
-
-        for time in timings:
-            sum_of_deviations = math.pow(time - mean, 2)
-
-        std_deviation = math.sqrt(sum_of_deviations / num_tests)
-        write("  Median:          %6.3f" % median)
-        write("  Mean:            %6.3f" % mean)
-        write("  90th percentile: %6.3f" % percentile90)
-        write("  99th percentile: %6.3f" % percentile99)
-        write("  Standard dev:    %6.3f" % std_deviation)
-        write("")
-
-    def _print_result_summary(self, write, result_summary):
-        """Print a short summary about how many tests passed.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          result_summary: information to log
-        """
-        failed = len(result_summary.failures)
-        skipped = len(
-            result_summary.tests_by_expectation[test_expectations.SKIP])
-        total = result_summary.total
-        passed = total - failed - skipped
-        pct_passed = 0.0
-        if total > 0:
-            pct_passed = float(passed) * 100 / total
-
-        write("")
-        write("=> Results: %d/%d tests passed (%.1f%%)" %
-                     (passed, total, pct_passed))
-        write("")
-        self._print_result_summary_entry(write, result_summary,
-            test_expectations.NOW, "Tests to be fixed for the current release")
-
-        write("")
-        self._print_result_summary_entry(write, result_summary,
-            test_expectations.DEFER,
-            "Tests we'll fix in the future if they fail (DEFER)")
-
-        write("")
-        self._print_result_summary_entry(write, result_summary,
-            test_expectations.WONTFIX,
-            "Tests that will only be fixed if they crash (WONTFIX)")
-
-    def _print_result_summary_entry(self, write, result_summary, timeline,
-                                    heading):
-        """Print a summary block of results for a particular timeline of test.
-
-        Args:
-          write: A callback to write info to (e.g., a LoggingWriter) or
-              sys.stdout.write.
-          result_summary: summary to print results for
-          timeline: the timeline to print results for (NOT, WONTFIX, etc.)
-          heading: a textual description of the timeline
-        """
-        total = len(result_summary.tests_by_timeline[timeline])
-        not_passing = (total -
-           len(result_summary.tests_by_expectation[test_expectations.PASS] &
-               result_summary.tests_by_timeline[timeline]))
-        write("=> %s (%d):" % (heading, not_passing))
-
-        for result in TestExpectationsFile.EXPECTATION_ORDER:
-            if result == test_expectations.PASS:
-                continue
-            results = (result_summary.tests_by_expectation[result] &
-                       result_summary.tests_by_timeline[timeline])
-            desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result]
-            if not_passing and len(results):
-                pct = len(results) * 100.0 / not_passing
-                write("  %5d %-24s (%4.1f%%)" % (len(results),
-                      desc[len(results) != 1], pct))
-
-    def _print_one_line_summary(self, total, expected):
-        """Print a one-line summary of the test run to stdout.
-
-        Args:
-          total: total number of tests run
-          expected: number of expected results
-        """
-        unexpected = total - expected
-        if unexpected == 0:
-            print "All %d tests ran as expected." % expected
-        elif expected == 1:
-            print "1 test ran as expected, %d didn't:" % unexpected
-        else:
-            print "%d tests ran as expected, %d didn't:" % (expected,
-                unexpected)
-
-    def _print_unexpected_results(self, unexpected_results):
-        """Prints any unexpected results in a human-readable form to stdout."""
-        passes = {}
-        flaky = {}
-        regressions = {}
-
-        if len(unexpected_results['tests']):
-            print ""
-
-        for test, results in unexpected_results['tests'].iteritems():
-            actual = results['actual'].split(" ")
-            expected = results['expected'].split(" ")
-            if actual == ['PASS']:
-                if 'CRASH' in expected:
-                    _add_to_dict_of_lists(passes,
-                                          'Expected to crash, but passed',
-                                          test)
-                elif 'TIMEOUT' in expected:
-                    _add_to_dict_of_lists(passes,
-                                          'Expected to timeout, but passed',
-                                           test)
-                else:
-                    _add_to_dict_of_lists(passes,
-                                          'Expected to fail, but passed',
-                                          test)
-            elif len(actual) > 1:
-                # We group flaky tests by the first actual result we got.
-                _add_to_dict_of_lists(flaky, actual[0], test)
-            else:
-                _add_to_dict_of_lists(regressions, results['actual'], test)
-
-        if len(passes):
-            for key, tests in passes.iteritems():
-                print "%s: (%d)" % (key, len(tests))
-                tests.sort()
-                for test in tests:
-                    print "  %s" % test
-                print
-
-        if len(flaky):
-            descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
-            for key, tests in flaky.iteritems():
-                result = TestExpectationsFile.EXPECTATIONS[key.lower()]
-                print "Unexpected flakiness: %s (%d)" % (
-                  descriptions[result][1], len(tests))
-                tests.sort()
-
-                for test in tests:
-                    result = unexpected_results['tests'][test]
-                    actual = result['actual'].split(" ")
-                    expected = result['expected'].split(" ")
-                    result = TestExpectationsFile.EXPECTATIONS[key.lower()]
-                    new_expectations_list = list(set(actual) | set(expected))
-                    print "  %s = %s" % (test, " ".join(new_expectations_list))
-                print
-
-        if len(regressions):
-            descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
-            for key, tests in regressions.iteritems():
-                result = TestExpectationsFile.EXPECTATIONS[key.lower()]
-                print "Regressions: Unexpected %s : (%d)" % (
-                  descriptions[result][1], len(tests))
-                tests.sort()
-                for test in tests:
-                    print "  %s = %s" % (test, key)
-                print
-
-        if len(unexpected_results['tests']) and self._options.verbose:
-            print "-" * 78
-
-    def _print_unexpected_test_result(self, test, result):
-        """Prints one unexpected test result line."""
-        desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result][0]
-        self._meter.write("  %s -> unexpected %s\n" %
-                          (self._port.relative_test_filename(test), desc))
-
-    def _write_results_html_file(self, result_summary):
-        """Write results.html which is a summary of tests that failed.
-
-        Args:
-          result_summary: a summary of the results :)
-
-        Returns:
-          True if any results were written (since expected failures may be
-          omitted)
-        """
-        # test failures
-        if self._options.full_results_html:
-            test_files = result_summary.failures.keys()
-        else:
-            unexpected_failures = self._get_failures(result_summary,
-                include_crashes=True)
-            test_files = unexpected_failures.keys()
-        if not len(test_files):
-            return False
-
-        out_filename = os.path.join(self._options.results_directory,
-                                    "results.html")
-        out_file = open(out_filename, 'w')
-        # header
-        if self._options.full_results_html:
-            h2 = "Test Failures"
-        else:
-            h2 = "Unexpected Test Failures"
-        out_file.write("<html><head><title>Layout Test Results (%(time)s)"
-                       "</title></head><body><h2>%(h2)s (%(time)s)</h2>\n"
-                       % {'h2': h2, 'time': time.asctime()})
-
-        test_files.sort()
-        for test_file in test_files:
-            test_failures = result_summary.failures.get(test_file, [])
-            out_file.write("<p><a href='%s'>%s</a><br />\n"
-                           % (self._port.filename_to_uri(test_file),
-                              self._port.relative_test_filename(test_file)))
-            for failure in test_failures:
-                out_file.write("&nbsp;&nbsp;%s<br/>"
-                               % failure.result_html_output(
-                                 self._port.relative_test_filename(test_file)))
-            out_file.write("</p>\n")
-
-        # footer
-        out_file.write("</body></html>\n")
-        return True
-
-    def _show_results_html_file(self):
-        """Launches the test shell open to the results.html page."""
-        results_filename = os.path.join(self._options.results_directory,
-                                        "results.html")
-        self._port.show_results_html_file(results_filename)
-
-
-def _add_to_dict_of_lists(dict, key, value):
-    dict.setdefault(key, []).append(value)
-
-
-def read_test_files(files):
-    tests = []
-    for file in files:
-        for line in open(file):
-            line = test_expectations.strip_comments(line)
-            if line:
-                tests.append(line)
-    return tests
-
-
-def create_logging_writer(options, log_option):
-    """Returns a write() function that will write the string to logging.info()
-    if comp was specified in --log or if --verbose is true. Otherwise the
-    message is dropped.
-
-    Args:
-      options: list of command line options from optparse
-      log_option: option to match in options.log in order for the messages
-          to be logged (e.g., 'actual' or 'expected')
-    """
-    if options.verbose or log_option in options.log.split(","):
-        return logging.info
-    return lambda str: 1
-
-
-def main(options, args):
-    """Run the tests.  Will call sys.exit when complete.
-
-    Args:
-      options: a dictionary of command line options
-      args: a list of sub directories or files to test
-    """
-
-    if options.sources:
-        options.verbose = True
-
-    # Set up our logging format.
-    meter = metered_stream.MeteredStream(options.verbose, sys.stderr)
-    log_fmt = '%(message)s'
-    log_datefmt = '%y%m%d %H:%M:%S'
-    log_level = logging.INFO
-    if options.verbose:
-        log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s '
-                  '%(message)s')
-        log_level = logging.DEBUG
-    logging.basicConfig(level=log_level, format=log_fmt, datefmt=log_datefmt,
-                        stream=meter)
-
-    if not options.target:
-        if options.debug:
-            options.target = "Debug"
-        else:
-            options.target = "Release"
-
-    port_obj = port.get(options.platform, options)
-
-    if not options.use_apache:
-        options.use_apache = sys.platform in ('darwin', 'linux2')
-
-    if options.results_directory.startswith("/"):
-        # Assume it's an absolute path and normalize.
-        options.results_directory = port_obj.get_absolute_path(
-            options.results_directory)
-    else:
-        # If it's a relative path, make the output directory relative to
-        # Debug or Release.
-        options.results_directory = port_obj.results_directory()
-
-    if options.clobber_old_results:
-        # Just clobber the actual test results directories since the other
-        # files in the results directory are explicitly used for cross-run
-        # tracking.
-        path = os.path.join(options.results_directory, 'LayoutTests')
-        if os.path.exists(path):
-            shutil.rmtree(path)
-
-    if not options.num_test_shells:
-        # TODO(ojan): Investigate perf/flakiness impact of using numcores + 1.
-        options.num_test_shells = port_obj.num_cores()
-
-    write = create_logging_writer(options, 'config')
-    write("Running %s test_shells in parallel" % options.num_test_shells)
-
-    if not options.time_out_ms:
-        if options.target == "Debug":
-            options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS)
-        else:
-            options.time_out_ms = str(TestRunner.DEFAULT_TEST_TIMEOUT_MS)
-
-    options.slow_time_out_ms = str(5 * int(options.time_out_ms))
-    write("Regular timeout: %s, slow test timeout: %s" %
-          (options.time_out_ms, options.slow_time_out_ms))
-
-    # Include all tests if none are specified.
-    new_args = []
-    for arg in args:
-        if arg and arg != '':
-            new_args.append(arg)
-
-    paths = new_args
-    if not paths:
-        paths = []
-    if options.test_list:
-        paths += read_test_files(options.test_list)
-
-    # Create the output directory if it doesn't already exist.
-    port_obj.maybe_make_directory(options.results_directory)
-    meter.update("Gathering files ...")
-
-    test_runner = TestRunner(port_obj, options, meter)
-    test_runner.gather_file_paths(paths)
-
-    if options.lint_test_files:
-        # Creating the expecations for each platform/target pair does all the
-        # test list parsing and ensures it's correct syntax (e.g. no dupes).
-        for platform in port_obj.test_platform_names():
-            test_runner.parse_expectations(platform, is_debug_mode=True)
-            test_runner.parse_expectations(platform, is_debug_mode=False)
-        print ("If there are no fail messages, errors or exceptions, then the "
-            "lint succeeded.")
-        sys.exit(0)
-
-    # Check that the system dependencies (themes, fonts, ...) are correct.
-    if not options.nocheck_sys_deps:
-        if not port_obj.check_sys_deps():
-            sys.exit(1)
-
-    write = create_logging_writer(options, "config")
-    write("Using port '%s'" % port_obj.name())
-    write("Placing test results in %s" % options.results_directory)
-    if options.new_baseline:
-        write("Placing new baselines in %s" % port_obj.baseline_path())
-    write("Using %s build" % options.target)
-    if options.no_pixel_tests:
-        write("Not running pixel tests")
-    write("")
-
-    meter.update("Parsing expectations ...")
-    test_runner.parse_expectations(port_obj.test_platform_name(),
-                                   options.target == 'Debug')
-
-    meter.update("Preparing tests ...")
-    write = create_logging_writer(options, "expected")
-    result_summary = test_runner.prepare_lists_and_print_output(write)
-
-    port_obj.setup_test_run()
-
-    test_runner.add_test_type(text_diff.TestTextDiff)
-    if not options.no_pixel_tests:
-        test_runner.add_test_type(image_diff.ImageDiff)
-        if options.fuzzy_pixel_tests:
-            test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff)
-
-    meter.update("Starting ...")
-    has_new_failures = test_runner.run(result_summary)
-
-    logging.debug("Exit status: %d" % has_new_failures)
-    sys.exit(has_new_failures)
-
-
-def parse_args(args=None):
-    """Provides a default set of command line args.
-
-    Returns a tuple of options, args from optparse"""
-    option_parser = optparse.OptionParser()
-    option_parser.add_option("", "--no-pixel-tests", action="store_true",
-                             default=False,
-                             help="disable pixel-to-pixel PNG comparisons")
-    option_parser.add_option("", "--fuzzy-pixel-tests", action="store_true",
-                             default=False,
-                             help="Also use fuzzy matching to compare pixel "
-                                  "test outputs.")
-    option_parser.add_option("", "--results-directory",
-                             default="layout-test-results",
-                             help="Output results directory source dir,"
-                                  " relative to Debug or Release")
-    option_parser.add_option("", "--new-baseline", action="store_true",
-                             default=False,
-                             help="save all generated results as new baselines"
-                                  " into the platform directory, overwriting "
-                                  "whatever's already there.")
-    option_parser.add_option("", "--noshow-results", action="store_true",
-                             default=False, help="don't launch the test_shell"
-                             " with results after the tests are done")
-    option_parser.add_option("", "--full-results-html", action="store_true",
-                             default=False, help="show all failures in "
-                             "results.html, rather than only regressions")
-    option_parser.add_option("", "--clobber-old-results", action="store_true",
-                             default=False, help="Clobbers test results from "
-                             "previous runs.")
-    option_parser.add_option("", "--lint-test-files", action="store_true",
-                             default=False, help="Makes sure the test files "
-                             "parse for all configurations. Does not run any "
-                             "tests.")
-    option_parser.add_option("", "--force", action="store_true",
-                             default=False,
-                             help="Run all tests, even those marked SKIP "
-                                  "in the test list")
-    option_parser.add_option("", "--num-test-shells",
-                             help="Number of testshells to run in parallel.")
-    option_parser.add_option("", "--use-apache", action="store_true",
-                             default=False,
-                             help="Whether to use apache instead of lighttpd.")
-    option_parser.add_option("", "--time-out-ms", default=None,
-                             help="Set the timeout for each test")
-    option_parser.add_option("", "--run-singly", action="store_true",
-                             default=False,
-                             help="run a separate test_shell for each test")
-    option_parser.add_option("", "--debug", action="store_true", default=False,
-                             help="use the debug binary instead of the release"
-                                  " binary")
-    option_parser.add_option("", "--num-slow-tests-to-log", default=50,
-                             help="Number of slow tests whose timings "
-                                  "to print.")
-    option_parser.add_option("", "--platform",
-                             help="Override the platform for expected results")
-    option_parser.add_option("", "--target", default="",
-                             help="Set the build target configuration "
-                                  "(overrides --debug)")
-    option_parser.add_option("", "--log", action="store",
-                             default="detailed-progress,unexpected",
-                             help="log various types of data. The param should"
-                             " be a comma-separated list of values from: "
-                             "actual,config," + LOG_DETAILED_PROGRESS +
-                             ",expected,timing," + LOG_UNEXPECTED + " "
-                             "(defaults to " +
-                             "--log detailed-progress,unexpected)")
-    option_parser.add_option("-v", "--verbose", action="store_true",
-                             default=False, help="include debug-level logging")
-    option_parser.add_option("", "--sources", action="store_true",
-                             help="show expected result file path for each "
-                                  "test (implies --verbose)")
-    option_parser.add_option("", "--startup-dialog", action="store_true",
-                             default=False,
-                             help="create a dialog on test_shell.exe startup")
-    option_parser.add_option("", "--gp-fault-error-box", action="store_true",
-                             default=False,
-                             help="enable Windows GP fault error box")
-    option_parser.add_option("", "--wrapper",
-                             help="wrapper command to insert before "
-                                  "invocations of test_shell; option is split "
-                                  "on whitespace before running. (Example: "
-                                  "--wrapper='valgrind --smc-check=all')")
-    option_parser.add_option("", "--test-list", action="append",
-                             help="read list of tests to run from file",
-                             metavar="FILE")
-    option_parser.add_option("", "--nocheck-sys-deps", action="store_true",
-                             default=False,
-                             help="Don't check the system dependencies "
-                                  "(themes)")
-    option_parser.add_option("", "--randomize-order", action="store_true",
-                             default=False,
-                             help=("Run tests in random order (useful for "
-                                   "tracking down corruption)"))
-    option_parser.add_option("", "--run-chunk",
-                             default=None,
-                             help=("Run a specified chunk (n:l), the "
-                                   "nth of len l, of the layout tests"))
-    option_parser.add_option("", "--run-part",
-                             default=None,
-                             help=("Run a specified part (n:m), the nth of m"
-                                   " parts, of the layout tests"))
-    option_parser.add_option("", "--batch-size",
-                             default=None,
-                             help=("Run a the tests in batches (n), after "
-                                   "every n tests, the test shell is "
-                                   "relaunched."))
-    option_parser.add_option("", "--builder-name",
-                             default="DUMMY_BUILDER_NAME",
-                             help=("The name of the builder shown on the "
-                                   "waterfall running this script e.g. "
-                                   "WebKit."))
-    option_parser.add_option("", "--build-name",
-                             default="DUMMY_BUILD_NAME",
-                             help=("The name of the builder used in its path, "
-                                   "e.g. webkit-rel."))
-    option_parser.add_option("", "--build-number",
-                             default="DUMMY_BUILD_NUMBER",
-                             help=("The build number of the builder running"
-                                   "this script."))
-    option_parser.add_option("", "--experimental-fully-parallel",
-                             action="store_true", default=False,
-                             help="run all tests in parallel")
-    return option_parser.parse_args(args)
-
-if '__main__' == __name__:
-    options, args = parse_args()
-    main(options, args)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
new file mode 100755
index 0000000..73195b3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -0,0 +1,1853 @@
+#!/usr/bin/env python
+# 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.
+
+"""Run layout tests.
+
+This is a port of the existing webkit test script run-webkit-tests.
+
+The TestRunner class runs a series of tests (TestType interface) against a set
+of test files.  If a test file fails a TestType, it returns a list TestFailure
+objects to the TestRunner.  The TestRunner then aggregates the TestFailures to
+create a final report.
+
+This script reads several files, if they exist in the test_lists subdirectory
+next to this script itself.  Each should contain a list of paths to individual
+tests or entire subdirectories of tests, relative to the outermost test
+directory.  Entire lines starting with '//' (comments) will be ignored.
+
+For details of the files' contents and purposes, see test_lists/README.
+"""
+
+from __future__ import with_statement
+
+import codecs
+import errno
+import glob
+import logging
+import math
+import optparse
+import os
+import platform
+import Queue
+import random
+import re
+import shutil
+import sys
+import time
+import traceback
+
+from layout_package import test_expectations
+from layout_package import json_layout_results_generator
+from layout_package import metered_stream
+from layout_package import test_failures
+from layout_package import dump_render_tree_thread
+from layout_package import test_files
+from test_types import fuzzy_image_diff
+from test_types import image_diff
+from test_types import test_type_base
+from test_types import text_diff
+
+from webkitpy.common.system.executive import Executive
+from webkitpy.thirdparty import simplejson
+
+import port
+
+_log = logging.getLogger("webkitpy.layout_tests.run_webkit_tests")
+
+# dummy value used for command-line explicitness to disable defaults
+LOG_NOTHING = 'nothing'
+
+# Display the one-line progress bar (% completed) while testing
+LOG_PROGRESS = 'progress'
+
+# Indicates that we want detailed progress updates in the output (prints
+# directory-by-directory feedback).
+LOG_DETAILED_PROGRESS = 'detailed-progress'
+
+# Log the one-line summary at the end of the run
+LOG_SUMMARY = 'summary'
+
+# "Trace" the test - log the expected result, the actual result, and the
+# baselines used
+LOG_TRACE = 'trace'
+
+# Log any unexpected results while running (instead of just at the end).
+LOG_UNEXPECTED = 'unexpected'
+LOG_UNEXPECTED_RESULTS = 'unexpected-results'
+
+LOG_VALUES = ",".join(("actual", "config", LOG_DETAILED_PROGRESS, "expected",
+                      LOG_NOTHING, LOG_PROGRESS, LOG_SUMMARY, "timing",
+                      LOG_UNEXPECTED, LOG_UNEXPECTED_RESULTS))
+LOG_DEFAULT_VALUE = ",".join((LOG_DETAILED_PROGRESS, LOG_SUMMARY,
+                              LOG_UNEXPECTED, LOG_UNEXPECTED_RESULTS))
+
+# Builder base URL where we have the archived test results.
+BUILDER_BASE_URL = "http://build.chromium.org/buildbot/layout_test_results/"
+
+TestExpectationsFile = test_expectations.TestExpectationsFile
+
+
+class TestInfo:
+    """Groups information about a test for easy passing of data."""
+
+    def __init__(self, port, filename, timeout):
+        """Generates the URI and stores the filename and timeout for this test.
+        Args:
+          filename: Full path to the test.
+          timeout: Timeout for running the test in TestShell.
+          """
+        self.filename = filename
+        self.uri = port.filename_to_uri(filename)
+        self.timeout = timeout
+        # FIXME: Confusing that the file is .checksum and we call it "hash"
+        self._expected_hash_path = port.expected_filename(filename, '.checksum')
+        self._have_read_expected_hash = False
+        self._image_hash = None
+
+    def _read_image_hash(self):
+        try:
+            with codecs.open(self._expected_hash_path, "r", "ascii") as hash_file:
+                return hash_file.read()
+        except IOError, e:
+            if errno.ENOENT != e.errno:
+                raise
+
+    def image_hash(self):
+        # Read the image_hash lazily to reduce startup time.
+        # This class is accessed across threads, but only one thread should
+        # ever be dealing with any given TestInfo so no locking is needed.
+        if not self._have_read_expected_hash:
+            self._have_read_expected_hash = True
+            self._image_hash = self._read_image_hash()
+        return self._image_hash
+
+
+class ResultSummary(object):
+    """A class for partitioning the test results we get into buckets.
+
+    This class is basically a glorified struct and it's private to this file
+    so we don't bother with any information hiding."""
+
+    def __init__(self, expectations, test_files):
+        self.total = len(test_files)
+        self.remaining = self.total
+        self.expectations = expectations
+        self.expected = 0
+        self.unexpected = 0
+        self.tests_by_expectation = {}
+        self.tests_by_timeline = {}
+        self.results = {}
+        self.unexpected_results = {}
+        self.failures = {}
+        self.tests_by_expectation[test_expectations.SKIP] = set()
+        for expectation in TestExpectationsFile.EXPECTATIONS.values():
+            self.tests_by_expectation[expectation] = set()
+        for timeline in TestExpectationsFile.TIMELINES.values():
+            self.tests_by_timeline[timeline] = (
+                expectations.get_tests_with_timeline(timeline))
+
+    def add(self, result, expected):
+        """Add a TestResult into the appropriate bin.
+
+        Args:
+          result: TestResult from dump_render_tree_thread.
+          expected: whether the result was what we expected it to be.
+        """
+
+        self.tests_by_expectation[result.type].add(result.filename)
+        self.results[result.filename] = result.type
+        self.remaining -= 1
+        if len(result.failures):
+            self.failures[result.filename] = result.failures
+        if expected:
+            self.expected += 1
+        else:
+            self.unexpected_results[result.filename] = result.type
+            self.unexpected += 1
+
+
+class TestRunner:
+    """A class for managing running a series of tests on a series of layout
+    test files."""
+
+    HTTP_SUBDIR = os.sep.join(['', 'http', ''])
+    WEBSOCKET_SUBDIR = os.sep.join(['', 'websocket', ''])
+
+    # The per-test timeout in milliseconds, if no --time-out-ms option was
+    # given to run_webkit_tests. This should correspond to the default timeout
+    # in DumpRenderTree.
+    DEFAULT_TEST_TIMEOUT_MS = 6 * 1000
+
+    NUM_RETRY_ON_UNEXPECTED_FAILURE = 1
+
+    def __init__(self, port, options, meter):
+        """Initialize test runner data structures.
+
+        Args:
+          port: an object implementing port-specific
+          options: a dictionary of command line options
+          meter: a MeteredStream object to record updates to.
+        """
+        self._port = port
+        self._options = options
+        self._meter = meter
+
+        # disable wss server. need to install pyOpenSSL on buildbots.
+        # self._websocket_secure_server = websocket_server.PyWebSocket(
+        #        options.results_directory, use_tls=True, port=9323)
+
+        # a list of TestType objects
+        self._test_types = []
+
+        # a set of test files, and the same tests as a list
+        self._test_files = set()
+        self._test_files_list = None
+        self._result_queue = Queue.Queue()
+
+        # These are used for --log detailed-progress to track status by
+        # directory.
+        self._current_dir = None
+        self._current_progress_str = ""
+        self._current_test_number = 0
+
+        self._retries = 0
+
+    def __del__(self):
+        _log.debug("flushing stdout")
+        sys.stdout.flush()
+        _log.debug("flushing stderr")
+        sys.stderr.flush()
+        _log.debug("stopping http server")
+        self._port.stop_http_server()
+        _log.debug("stopping websocket server")
+        self._port.stop_websocket_server()
+
+    def gather_file_paths(self, paths):
+        """Find all the files to test.
+
+        Args:
+          paths: a list of globs to use instead of the defaults."""
+        self._test_files = test_files.gather_test_files(self._port, paths)
+
+    def parse_expectations(self, test_platform_name, is_debug_mode):
+        """Parse the expectations from the test_list files and return a data
+        structure holding them. Throws an error if the test_list files have
+        invalid syntax."""
+        if self._options.lint_test_files:
+            test_files = None
+        else:
+            test_files = self._test_files
+
+        try:
+            expectations_str = self._port.test_expectations()
+            overrides_str = self._port.test_expectations_overrides()
+            self._expectations = test_expectations.TestExpectations(
+                self._port, test_files, expectations_str, test_platform_name,
+                is_debug_mode, self._options.lint_test_files,
+                tests_are_present=True, overrides=overrides_str)
+            return self._expectations
+        except SyntaxError, err:
+            if self._options.lint_test_files:
+                print str(err)
+            else:
+                raise err
+
+    def prepare_lists_and_print_output(self, write):
+        """Create appropriate subsets of test lists and returns a
+        ResultSummary object. Also prints expected test counts.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+             sys.stdout.write.
+        """
+
+        # Remove skipped - both fixable and ignored - files from the
+        # top-level list of files to test.
+        num_all_test_files = len(self._test_files)
+        write("Found:  %d tests" % (len(self._test_files)))
+        skipped = set()
+        if num_all_test_files > 1 and not self._options.force:
+            skipped = self._expectations.get_tests_with_result_type(
+                           test_expectations.SKIP)
+            self._test_files -= skipped
+
+        # Create a sorted list of test files so the subset chunk,
+        # if used, contains alphabetically consecutive tests.
+        self._test_files_list = list(self._test_files)
+        if self._options.randomize_order:
+            random.shuffle(self._test_files_list)
+        else:
+            self._test_files_list.sort()
+
+        # If the user specifies they just want to run a subset of the tests,
+        # just grab a subset of the non-skipped tests.
+        if self._options.run_chunk or self._options.run_part:
+            chunk_value = self._options.run_chunk or self._options.run_part
+            test_files = self._test_files_list
+            try:
+                (chunk_num, chunk_len) = chunk_value.split(":")
+                chunk_num = int(chunk_num)
+                assert(chunk_num >= 0)
+                test_size = int(chunk_len)
+                assert(test_size > 0)
+            except:
+                _log.critical("invalid chunk '%s'" % chunk_value)
+                sys.exit(1)
+
+            # Get the number of tests
+            num_tests = len(test_files)
+
+            # Get the start offset of the slice.
+            if self._options.run_chunk:
+                chunk_len = test_size
+                # In this case chunk_num can be really large. We need
+                # to make the slave fit in the current number of tests.
+                slice_start = (chunk_num * chunk_len) % num_tests
+            else:
+                # Validate the data.
+                assert(test_size <= num_tests)
+                assert(chunk_num <= test_size)
+
+                # To count the chunk_len, and make sure we don't skip
+                # some tests, we round to the next value that fits exactly
+                # all the parts.
+                rounded_tests = num_tests
+                if rounded_tests % test_size != 0:
+                    rounded_tests = (num_tests + test_size -
+                                     (num_tests % test_size))
+
+                chunk_len = rounded_tests / test_size
+                slice_start = chunk_len * (chunk_num - 1)
+                # It does not mind if we go over test_size.
+
+            # Get the end offset of the slice.
+            slice_end = min(num_tests, slice_start + chunk_len)
+
+            files = test_files[slice_start:slice_end]
+
+            tests_run_msg = 'Running: %d tests (chunk slice [%d:%d] of %d)' % (
+                (slice_end - slice_start), slice_start, slice_end, num_tests)
+            write(tests_run_msg)
+
+            # If we reached the end and we don't have enough tests, we run some
+            # from the beginning.
+            if (self._options.run_chunk and
+                (slice_end - slice_start < chunk_len)):
+                extra = 1 + chunk_len - (slice_end - slice_start)
+                extra_msg = ('   last chunk is partial, appending [0:%d]' %
+                            extra)
+                write(extra_msg)
+                tests_run_msg += "\n" + extra_msg
+                files.extend(test_files[0:extra])
+            tests_run_filename = os.path.join(self._options.results_directory,
+                                              "tests_run.txt")
+            tests_run_file = open(tests_run_filename, "w")
+            tests_run_file.write(tests_run_msg + "\n")
+            tests_run_file.close()
+
+            len_skip_chunk = int(len(files) * len(skipped) /
+                                 float(len(self._test_files)))
+            skip_chunk_list = list(skipped)[0:len_skip_chunk]
+            skip_chunk = set(skip_chunk_list)
+
+            # Update expectations so that the stats are calculated correctly.
+            # We need to pass a list that includes the right # of skipped files
+            # to ParseExpectations so that ResultSummary() will get the correct
+            # stats. So, we add in the subset of skipped files, and then
+            # subtract them back out.
+            self._test_files_list = files + skip_chunk_list
+            self._test_files = set(self._test_files_list)
+
+            self._expectations = self.parse_expectations(
+                self._port.test_platform_name(),
+                self._options.configuration == 'Debug')
+
+            self._test_files = set(files)
+            self._test_files_list = files
+        else:
+            skip_chunk = skipped
+
+        result_summary = ResultSummary(self._expectations,
+            self._test_files | skip_chunk)
+        self._print_expected_results_of_type(write, result_summary,
+            test_expectations.PASS, "passes")
+        self._print_expected_results_of_type(write, result_summary,
+            test_expectations.FAIL, "failures")
+        self._print_expected_results_of_type(write, result_summary,
+            test_expectations.FLAKY, "flaky")
+        self._print_expected_results_of_type(write, result_summary,
+            test_expectations.SKIP, "skipped")
+
+        if self._options.force:
+            write('Running all tests, including skips (--force)')
+        else:
+            # Note that we don't actually run the skipped tests (they were
+            # subtracted out of self._test_files, above), but we stub out the
+            # results here so the statistics can remain accurate.
+            for test in skip_chunk:
+                result = dump_render_tree_thread.TestResult(test,
+                    failures=[], test_run_time=0, total_time_for_all_diffs=0,
+                    time_for_diffs=0)
+                result.type = test_expectations.SKIP
+                result_summary.add(result, expected=True)
+        write("")
+
+        return result_summary
+
+    def add_test_type(self, test_type):
+        """Add a TestType to the TestRunner."""
+        self._test_types.append(test_type)
+
+    def _get_dir_for_test_file(self, test_file):
+        """Returns the highest-level directory by which to shard the given
+        test file."""
+        index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
+
+        test_file = test_file[index + len('LayoutTests/'):]
+        test_file_parts = test_file.split(os.sep, 1)
+        directory = test_file_parts[0]
+        test_file = test_file_parts[1]
+
+        # The http tests are very stable on mac/linux.
+        # TODO(ojan): Make the http server on Windows be apache so we can
+        # turn shard the http tests there as well. Switching to apache is
+        # what made them stable on linux/mac.
+        return_value = directory
+        while ((directory != 'http' or sys.platform in ('darwin', 'linux2'))
+                and test_file.find(os.sep) >= 0):
+            test_file_parts = test_file.split(os.sep, 1)
+            directory = test_file_parts[0]
+            return_value = os.path.join(return_value, directory)
+            test_file = test_file_parts[1]
+
+        return return_value
+
+    def _get_test_info_for_file(self, test_file):
+        """Returns the appropriate TestInfo object for the file. Mostly this
+        is used for looking up the timeout value (in ms) to use for the given
+        test."""
+        if self._expectations.has_modifier(test_file, test_expectations.SLOW):
+            return TestInfo(self._port, test_file,
+                            self._options.slow_time_out_ms)
+        return TestInfo(self._port, test_file, self._options.time_out_ms)
+
+    def _get_test_file_queue(self, test_files):
+        """Create the thread safe queue of lists of (test filenames, test URIs)
+        tuples. Each TestShellThread pulls a list from this queue and runs
+        those tests in order before grabbing the next available list.
+
+        Shard the lists by directory. This helps ensure that tests that depend
+        on each other (aka bad tests!) continue to run together as most
+        cross-tests dependencies tend to occur within the same directory.
+
+        Return:
+          The Queue of lists of TestInfo objects.
+        """
+
+        if (self._options.experimental_fully_parallel or
+            self._is_single_threaded()):
+            filename_queue = Queue.Queue()
+            for test_file in test_files:
+                filename_queue.put(
+                    ('.', [self._get_test_info_for_file(test_file)]))
+            return filename_queue
+
+        tests_by_dir = {}
+        for test_file in test_files:
+            directory = self._get_dir_for_test_file(test_file)
+            tests_by_dir.setdefault(directory, [])
+            tests_by_dir[directory].append(
+                self._get_test_info_for_file(test_file))
+
+        # Sort by the number of tests in the dir so that the ones with the
+        # most tests get run first in order to maximize parallelization.
+        # Number of tests is a good enough, but not perfect, approximation
+        # of how long that set of tests will take to run. We can't just use
+        # a PriorityQueue until we move # to Python 2.6.
+        test_lists = []
+        http_tests = None
+        for directory in tests_by_dir:
+            test_list = tests_by_dir[directory]
+            # Keep the tests in alphabetical order.
+            # TODO: Remove once tests are fixed so they can be run in any
+            # order.
+            test_list.reverse()
+            test_list_tuple = (directory, test_list)
+            if directory == 'LayoutTests' + os.sep + 'http':
+                http_tests = test_list_tuple
+            else:
+                test_lists.append(test_list_tuple)
+        test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
+
+        # Put the http tests first. There are only a couple hundred of them,
+        # but each http test takes a very long time to run, so sorting by the
+        # number of tests doesn't accurately capture how long they take to run.
+        if http_tests:
+            test_lists.insert(0, http_tests)
+
+        filename_queue = Queue.Queue()
+        for item in test_lists:
+            filename_queue.put(item)
+        return filename_queue
+
+    def _get_dump_render_tree_args(self, index):
+        """Returns the tuple of arguments for tests and for DumpRenderTree."""
+        shell_args = []
+        test_args = test_type_base.TestArguments()
+        png_path = None
+        if self._options.pixel_tests:
+            png_path = os.path.join(self._options.results_directory,
+                                    "png_result%s.png" % index)
+            shell_args.append("--pixel-tests=" + png_path)
+            test_args.png_path = png_path
+
+        test_args.new_baseline = self._options.new_baseline
+
+        test_args.show_sources = self._options.sources
+
+        if self._options.startup_dialog:
+            shell_args.append('--testshell-startup-dialog')
+
+        if self._options.gp_fault_error_box:
+            shell_args.append('--gp-fault-error-box')
+
+        return test_args, png_path, shell_args
+
+    def _contains_tests(self, subdir):
+        for test_file in self._test_files:
+            if test_file.find(subdir) >= 0:
+                return True
+        return False
+
+    def _instantiate_dump_render_tree_threads(self, test_files,
+                                              result_summary):
+        """Instantitates and starts the TestShellThread(s).
+
+        Return:
+          The list of threads.
+        """
+        filename_queue = self._get_test_file_queue(test_files)
+
+        # Instantiate TestShellThreads and start them.
+        threads = []
+        for i in xrange(int(self._options.child_processes)):
+            # Create separate TestTypes instances for each thread.
+            test_types = []
+            for test_type in self._test_types:
+                test_types.append(test_type(self._port,
+                                    self._options.results_directory))
+
+            test_args, png_path, shell_args = \
+                self._get_dump_render_tree_args(i)
+            thread = dump_render_tree_thread.TestShellThread(self._port,
+                filename_queue, self._result_queue, test_types, test_args,
+                png_path, shell_args, self._options)
+            if self._is_single_threaded():
+                thread.run_in_main_thread(self, result_summary)
+            else:
+                thread.start()
+            threads.append(thread)
+
+        return threads
+
+    def _is_single_threaded(self):
+        """Returns whether we should run all the tests in the main thread."""
+        return int(self._options.child_processes) == 1
+
+    def _run_tests(self, file_list, result_summary):
+        """Runs the tests in the file_list.
+
+        Return: A tuple (failures, thread_timings, test_timings,
+            individual_test_timings)
+            failures is a map from test to list of failure types
+            thread_timings is a list of dicts with the total runtime
+              of each thread with 'name', 'num_tests', 'total_time' properties
+            test_timings is a list of timings for each sharded subdirectory
+              of the form [time, directory_name, num_tests]
+            individual_test_timings is a list of run times for each test
+              in the form {filename:filename, test_run_time:test_run_time}
+            result_summary: summary object to populate with the results
+        """
+        plural = ""
+        if self._options.child_processes > 1:
+            plural = "s"
+        self._meter.update('Starting %s%s ...' %
+                           (self._port.driver_name(), plural))
+        threads = self._instantiate_dump_render_tree_threads(file_list,
+                                                             result_summary)
+        self._meter.update("Starting testing ...")
+
+        # Wait for the threads to finish and collect test failures.
+        failures = {}
+        test_timings = {}
+        individual_test_timings = []
+        thread_timings = []
+        try:
+            for thread in threads:
+                while thread.isAlive():
+                    # Let it timeout occasionally so it can notice a
+                    # KeyboardInterrupt. Actually, the timeout doesn't
+                    # really matter: apparently it suffices to not use
+                    # an indefinite blocking join for it to
+                    # be interruptible by KeyboardInterrupt.
+                    thread.join(0.1)
+                    self.update_summary(result_summary)
+                thread_timings.append({'name': thread.getName(),
+                                       'num_tests': thread.get_num_tests(),
+                                       'total_time': thread.get_total_time()})
+                test_timings.update(thread.get_directory_timing_stats())
+                individual_test_timings.extend(
+                    thread.get_test_results())
+        except KeyboardInterrupt:
+            for thread in threads:
+                thread.cancel()
+            raise
+        for thread in threads:
+            # Check whether a TestShellThread died before normal completion.
+            exception_info = thread.get_exception_info()
+            if exception_info is not None:
+                # Re-raise the thread's exception here to make it clear that
+                # testing was aborted. Otherwise, the tests that did not run
+                # would be assumed to have passed.
+                raise exception_info[0], exception_info[1], exception_info[2]
+
+        # Make sure we pick up any remaining tests.
+        self.update_summary(result_summary)
+        return (thread_timings, test_timings, individual_test_timings)
+
+    def needs_http(self):
+        """Returns whether the test runner needs an HTTP server."""
+        return self._contains_tests(self.HTTP_SUBDIR)
+
+    def run(self, result_summary, print_results):
+        """Run all our tests on all our test files.
+
+        For each test file, we run each test type. If there are any failures,
+        we collect them for reporting.
+
+        Args:
+          result_summary: a summary object tracking the test results.
+          print_results: whether or not to print the summary at the end
+
+        Return:
+          The number of unexpected results (0 == success)
+        """
+        if not self._test_files:
+            return 0
+        start_time = time.time()
+
+        if self.needs_http():
+            self._meter.update('Starting HTTP server ...')
+            self._port.start_http_server()
+
+        if self._contains_tests(self.WEBSOCKET_SUBDIR):
+            self._meter.update('Starting WebSocket server ...')
+            self._port.start_websocket_server()
+            # self._websocket_secure_server.Start()
+
+        thread_timings, test_timings, individual_test_timings = (
+            self._run_tests(self._test_files_list, result_summary))
+
+        # We exclude the crashes from the list of results to retry, because
+        # we want to treat even a potentially flaky crash as an error.
+        failures = self._get_failures(result_summary, include_crashes=False)
+        retry_summary = result_summary
+        while (self._retries < self.NUM_RETRY_ON_UNEXPECTED_FAILURE and
+               len(failures)):
+            _log.info('')
+            _log.info("Retrying %d unexpected failure(s)" % len(failures))
+            _log.info('')
+            self._retries += 1
+            retry_summary = ResultSummary(self._expectations, failures.keys())
+            self._run_tests(failures.keys(), retry_summary)
+            failures = self._get_failures(retry_summary, include_crashes=True)
+
+        end_time = time.time()
+
+        write = create_logging_writer(self._options, 'timing')
+        self._print_timing_statistics(write, end_time - start_time,
+                                    thread_timings, test_timings,
+                                    individual_test_timings,
+                                    result_summary)
+
+        self._meter.update("")
+
+        if self._options.verbose:
+            # We write this block to stdout for compatibility with the
+            # buildbot log parser, which only looks at stdout, not stderr :(
+            write = lambda s: sys.stdout.write("%s\n" % s)
+        else:
+            write = create_logging_writer(self._options, 'actual')
+
+        self._print_result_summary(write, result_summary)
+
+        sys.stdout.flush()
+        sys.stderr.flush()
+
+        # This summary data gets written to stdout regardless of log level
+        # (unless of course we're printing nothing).
+        if print_results:
+            if (LOG_DETAILED_PROGRESS in self._options.log or
+                (LOG_UNEXPECTED in self._options.log and
+                 result_summary.total != result_summary.expected)):
+                print
+            if LOG_SUMMARY in self._options.log:
+                self._print_one_line_summary(result_summary.total,
+                                             result_summary.expected)
+
+        unexpected_results = self._summarize_unexpected_results(result_summary,
+            retry_summary)
+        if LOG_UNEXPECTED_RESULTS in self._options.log:
+            self._print_unexpected_results(unexpected_results)
+
+        # Write the same data to log files.
+        self._write_json_files(unexpected_results, result_summary,
+                             individual_test_timings)
+
+        # Write the summary to disk (results.html) and display it if requested.
+        wrote_results = self._write_results_html_file(result_summary)
+        if self._options.show_results and wrote_results:
+            self._show_results_html_file()
+
+        # Ignore flaky failures and unexpected passes so we don't turn the
+        # bot red for those.
+        return unexpected_results['num_regressions']
+
+    def update_summary(self, result_summary):
+        """Update the summary and print results with any completed tests."""
+        while True:
+            try:
+                result = self._result_queue.get_nowait()
+            except Queue.Empty:
+                return
+            expected = self._expectations.matches_an_expected_result(
+                result.filename, result.type, self._options.pixel_tests)
+            result_summary.add(result, expected)
+            self._print_test_results(result, expected, result_summary)
+
+    def _print_test_results(self, result, expected, result_summary):
+        "Print the result of the test as determined by the --log switches."
+        if LOG_TRACE in self._options.log:
+            self._print_test_trace(result)
+        elif (LOG_DETAILED_PROGRESS in self._options.log and
+              (self._options.experimental_fully_parallel or
+               self._is_single_threaded())):
+            self._print_detailed_progress(result_summary)
+        else:
+            if (not expected and LOG_UNEXPECTED in self._options.log):
+                self._print_unexpected_test_result(result)
+            self._print_one_line_progress(result_summary)
+
+    def _print_test_trace(self, result):
+        """Print detailed results of a test (triggered by --log trace).
+        For each test, print:
+           - location of the expected baselines
+           - expected results
+           - actual result
+           - timing info
+        """
+        filename = result.filename
+        test_name = self._port.relative_test_filename(filename)
+        _log.info('trace: %s' % test_name)
+        _log.info('  txt: %s' %
+                  self._port.relative_test_filename(
+                       self._port.expected_filename(filename, '.txt')))
+        png_file = self._port.expected_filename(filename, '.png')
+        if os.path.exists(png_file):
+            _log.info('  png: %s' %
+                      self._port.relative_test_filename(filename))
+        else:
+            _log.info('  png: <none>')
+        _log.info('  exp: %s' %
+                  self._expectations.get_expectations_string(filename))
+        _log.info('  got: %s' %
+                  self._expectations.expectation_to_string(result.type))
+        _log.info(' took: %-.3f' % result.test_run_time)
+        _log.info('')
+
+    def _print_one_line_progress(self, result_summary):
+        """Displays the progress through the test run."""
+        percent_complete = 100 * (result_summary.expected +
+            result_summary.unexpected) / result_summary.total
+        action = "Testing"
+        if self._retries > 0:
+            action = "Retrying"
+        self._meter.progress("%s (%d%%): %d ran as expected, %d didn't,"
+            " %d left" % (action, percent_complete, result_summary.expected,
+             result_summary.unexpected, result_summary.remaining))
+
+    def _print_detailed_progress(self, result_summary):
+        """Display detailed progress output where we print the directory name
+        and one dot for each completed test. This is triggered by
+        "--log detailed-progress"."""
+        if self._current_test_number == len(self._test_files_list):
+            return
+
+        next_test = self._test_files_list[self._current_test_number]
+        next_dir = os.path.dirname(
+            self._port.relative_test_filename(next_test))
+        if self._current_progress_str == "":
+            self._current_progress_str = "%s: " % (next_dir)
+            self._current_dir = next_dir
+
+        while next_test in result_summary.results:
+            if next_dir != self._current_dir:
+                self._meter.write("%s\n" % (self._current_progress_str))
+                self._current_progress_str = "%s: ." % (next_dir)
+                self._current_dir = next_dir
+            else:
+                self._current_progress_str += "."
+
+            if (next_test in result_summary.unexpected_results and
+                LOG_UNEXPECTED in self._options.log):
+                result = result_summary.unexpected_results[next_test]
+                self._meter.write("%s\n" % self._current_progress_str)
+                self._print_unexpected_test_result(next_test, result)
+                self._current_progress_str = "%s: " % self._current_dir
+
+            self._current_test_number += 1
+            if self._current_test_number == len(self._test_files_list):
+                break
+
+            next_test = self._test_files_list[self._current_test_number]
+            next_dir = os.path.dirname(
+                self._port.relative_test_filename(next_test))
+
+        if result_summary.remaining:
+            remain_str = " (%d)" % (result_summary.remaining)
+            self._meter.progress("%s%s" %
+                                 (self._current_progress_str, remain_str))
+        else:
+            self._meter.progress("%s\n" % (self._current_progress_str))
+
+    def _print_unexpected_test_result(self, result):
+        """Prints one unexpected test result line."""
+        desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result.type][0]
+        self._meter.write("  %s -> unexpected %s\n" %
+                          (self._port.relative_test_filename(result.filename),
+                           desc))
+
+    def _get_failures(self, result_summary, include_crashes):
+        """Filters a dict of results and returns only the failures.
+
+        Args:
+          result_summary: the results of the test run
+          include_crashes: whether crashes are included in the output.
+            We use False when finding the list of failures to retry
+            to see if the results were flaky. Although the crashes may also be
+            flaky, we treat them as if they aren't so that they're not ignored.
+        Returns:
+          a dict of files -> results
+        """
+        failed_results = {}
+        for test, result in result_summary.unexpected_results.iteritems():
+            if (result == test_expectations.PASS or
+                result == test_expectations.CRASH and not include_crashes):
+                continue
+            failed_results[test] = result
+
+        return failed_results
+
+    def _summarize_unexpected_results(self, result_summary, retry_summary):
+        """Summarize any unexpected results as a dict.
+
+        TODO(dpranke): split this data structure into a separate class?
+
+        Args:
+          result_summary: summary object from initial test runs
+          retry_summary: summary object from final test run of retried tests
+        Returns:
+          A dictionary containing a summary of the unexpected results from the
+          run, with the following fields:
+            'version': a version indicator (1 in this version)
+            'fixable': # of fixable tests (NOW - PASS)
+            'skipped': # of skipped tests (NOW & SKIPPED)
+            'num_regressions': # of non-flaky failures
+            'num_flaky': # of flaky failures
+            'num_passes': # of unexpected passes
+            'tests': a dict of tests -> {'expected': '...', 'actual': '...'}
+        """
+        results = {}
+        results['version'] = 1
+
+        tbe = result_summary.tests_by_expectation
+        tbt = result_summary.tests_by_timeline
+        results['fixable'] = len(tbt[test_expectations.NOW] -
+                                 tbe[test_expectations.PASS])
+        results['skipped'] = len(tbt[test_expectations.NOW] &
+                                 tbe[test_expectations.SKIP])
+
+        num_passes = 0
+        num_flaky = 0
+        num_regressions = 0
+        keywords = {}
+        for k, v in TestExpectationsFile.EXPECTATIONS.iteritems():
+            keywords[v] = k.upper()
+
+        tests = {}
+        for filename, result in result_summary.unexpected_results.iteritems():
+            # Note that if a test crashed in the original run, we ignore
+            # whether or not it crashed when we retried it (if we retried it),
+            # and always consider the result not flaky.
+            test = self._port.relative_test_filename(filename)
+            expected = self._expectations.get_expectations_string(filename)
+            actual = [keywords[result]]
+
+            if result == test_expectations.PASS:
+                num_passes += 1
+            elif result == test_expectations.CRASH:
+                num_regressions += 1
+            else:
+                if filename not in retry_summary.unexpected_results:
+                    actual.extend(
+                        self._expectations.get_expectations_string(
+                        filename).split(" "))
+                    num_flaky += 1
+                else:
+                    retry_result = retry_summary.unexpected_results[filename]
+                    if result != retry_result:
+                        actual.append(keywords[retry_result])
+                        num_flaky += 1
+                    else:
+                        num_regressions += 1
+
+            tests[test] = {}
+            tests[test]['expected'] = expected
+            tests[test]['actual'] = " ".join(actual)
+
+        results['tests'] = tests
+        results['num_passes'] = num_passes
+        results['num_flaky'] = num_flaky
+        results['num_regressions'] = num_regressions
+
+        return results
+
+    def _write_json_files(self, unexpected_results, result_summary,
+                        individual_test_timings):
+        """Writes the results of the test run as JSON files into the results
+        dir.
+
+        There are three different files written into the results dir:
+          unexpected_results.json: A short list of any unexpected results.
+            This is used by the buildbots to display results.
+          expectations.json: This is used by the flakiness dashboard.
+          results.json: A full list of the results - used by the flakiness
+            dashboard and the aggregate results dashboard.
+
+        Args:
+          unexpected_results: dict of unexpected results
+          result_summary: full summary object
+          individual_test_timings: list of test times (used by the flakiness
+            dashboard).
+        """
+        _log.debug("Writing JSON files in %s." %
+                   self._options.results_directory)
+        unexpected_file = open(os.path.join(self._options.results_directory,
+            "unexpected_results.json"), "w")
+        unexpected_file.write(simplejson.dumps(unexpected_results,
+                              sort_keys=True, indent=2))
+        unexpected_file.close()
+
+        # Write a json file of the test_expectations.txt file for the layout
+        # tests dashboard.
+        expectations_file = open(os.path.join(self._options.results_directory,
+            "expectations.json"), "w")
+        expectations_json = \
+            self._expectations.get_expectations_json_for_all_platforms()
+        expectations_file.write("ADD_EXPECTATIONS(" + expectations_json + ");")
+        expectations_file.close()
+
+        json_layout_results_generator.JSONLayoutResultsGenerator(
+            self._port, self._options.builder_name, self._options.build_name,
+            self._options.build_number, self._options.results_directory,
+            BUILDER_BASE_URL, individual_test_timings,
+            self._expectations, result_summary, self._test_files_list)
+
+        _log.debug("Finished writing JSON files.")
+
+    def _print_expected_results_of_type(self, write, result_summary,
+                                        result_type, result_type_str):
+        """Print the number of the tests in a given result class.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+             sys.stdout.write.
+          result_summary - the object containing all the results to report on
+          result_type - the particular result type to report in the summary.
+          result_type_str - a string description of the result_type.
+        """
+        tests = self._expectations.get_tests_with_result_type(result_type)
+        now = result_summary.tests_by_timeline[test_expectations.NOW]
+        wontfix = result_summary.tests_by_timeline[test_expectations.WONTFIX]
+        defer = result_summary.tests_by_timeline[test_expectations.DEFER]
+
+        # We use a fancy format string in order to print the data out in a
+        # nicely-aligned table.
+        fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd defer, %%%dd wontfix)"
+                  % (self._num_digits(now), self._num_digits(defer),
+                  self._num_digits(wontfix)))
+        write(fmtstr % (len(tests), result_type_str, len(tests & now),
+              len(tests & defer), len(tests & wontfix)))
+
+    def _num_digits(self, num):
+        """Returns the number of digits needed to represent the length of a
+        sequence."""
+        ndigits = 1
+        if len(num):
+            ndigits = int(math.log10(len(num))) + 1
+        return ndigits
+
+    def _print_timing_statistics(self, write, total_time, thread_timings,
+                               directory_test_timings, individual_test_timings,
+                               result_summary):
+        """Record timing-specific information for the test run.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          total_time: total elapsed time (in seconds) for the test run
+          thread_timings: wall clock time each thread ran for
+          directory_test_timings: timing by directory
+          individual_test_timings: timing by file
+          result_summary: summary object for the test run
+        """
+        write("Test timing:")
+        write("  %6.2f total testing time" % total_time)
+        write("")
+        write("Thread timing:")
+        cuml_time = 0
+        for t in thread_timings:
+            write("    %10s: %5d tests, %6.2f secs" %
+                  (t['name'], t['num_tests'], t['total_time']))
+            cuml_time += t['total_time']
+        write("   %6.2f cumulative, %6.2f optimal" %
+              (cuml_time, cuml_time / int(self._options.child_processes)))
+        write("")
+
+        self._print_aggregate_test_statistics(write, individual_test_timings)
+        self._print_individual_test_times(write, individual_test_timings,
+                                          result_summary)
+        self._print_directory_timings(write, directory_test_timings)
+
+    def _print_aggregate_test_statistics(self, write, individual_test_timings):
+        """Prints aggregate statistics (e.g. median, mean, etc.) for all tests.
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          individual_test_timings: List of dump_render_tree_thread.TestStats
+              for all tests.
+        """
+        test_types = []  # Unit tests don't actually produce any timings.
+        if individual_test_timings:
+            test_types = individual_test_timings[0].time_for_diffs.keys()
+        times_for_dump_render_tree = []
+        times_for_diff_processing = []
+        times_per_test_type = {}
+        for test_type in test_types:
+            times_per_test_type[test_type] = []
+
+        for test_stats in individual_test_timings:
+            times_for_dump_render_tree.append(test_stats.test_run_time)
+            times_for_diff_processing.append(
+                test_stats.total_time_for_all_diffs)
+            time_for_diffs = test_stats.time_for_diffs
+            for test_type in test_types:
+                times_per_test_type[test_type].append(
+                    time_for_diffs[test_type])
+
+        self._print_statistics_for_test_timings(write,
+            "PER TEST TIME IN TESTSHELL (seconds):",
+            times_for_dump_render_tree)
+        self._print_statistics_for_test_timings(write,
+            "PER TEST DIFF PROCESSING TIMES (seconds):",
+            times_for_diff_processing)
+        for test_type in test_types:
+            self._print_statistics_for_test_timings(write,
+                "PER TEST TIMES BY TEST TYPE: %s" % test_type,
+                times_per_test_type[test_type])
+
+    def _print_individual_test_times(self, write, individual_test_timings,
+                                  result_summary):
+        """Prints the run times for slow, timeout and crash tests.
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          individual_test_timings: List of dump_render_tree_thread.TestStats
+              for all tests.
+          result_summary: summary object for test run
+        """
+        # Reverse-sort by the time spent in DumpRenderTree.
+        individual_test_timings.sort(lambda a, b:
+            cmp(b.test_run_time, a.test_run_time))
+
+        num_printed = 0
+        slow_tests = []
+        timeout_or_crash_tests = []
+        unexpected_slow_tests = []
+        for test_tuple in individual_test_timings:
+            filename = test_tuple.filename
+            is_timeout_crash_or_slow = False
+            if self._expectations.has_modifier(filename,
+                                               test_expectations.SLOW):
+                is_timeout_crash_or_slow = True
+                slow_tests.append(test_tuple)
+
+            if filename in result_summary.failures:
+                result = result_summary.results[filename]
+                if (result == test_expectations.TIMEOUT or
+                    result == test_expectations.CRASH):
+                    is_timeout_crash_or_slow = True
+                    timeout_or_crash_tests.append(test_tuple)
+
+            if (not is_timeout_crash_or_slow and
+                num_printed < self._options.num_slow_tests_to_log):
+                num_printed = num_printed + 1
+                unexpected_slow_tests.append(test_tuple)
+
+        write("")
+        self._print_test_list_timing(write, "%s slowest tests that are not "
+            "marked as SLOW and did not timeout/crash:" %
+            self._options.num_slow_tests_to_log, unexpected_slow_tests)
+        write("")
+        self._print_test_list_timing(write, "Tests marked as SLOW:",
+                                     slow_tests)
+        write("")
+        self._print_test_list_timing(write, "Tests that timed out or crashed:",
+                                     timeout_or_crash_tests)
+        write("")
+
+    def _print_test_list_timing(self, write, title, test_list):
+        """Print timing info for each test.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          title: section heading
+          test_list: tests that fall in this section
+        """
+        write(title)
+        for test_tuple in test_list:
+            filename = test_tuple.filename[len(
+                self._port.layout_tests_dir()) + 1:]
+            filename = filename.replace('\\', '/')
+            test_run_time = round(test_tuple.test_run_time, 1)
+            write("  %s took %s seconds" % (filename, test_run_time))
+
+    def _print_directory_timings(self, write, directory_test_timings):
+        """Print timing info by directory for any directories that
+        take > 10 seconds to run.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          directory_test_timing: time info for each directory
+        """
+        timings = []
+        for directory in directory_test_timings:
+            num_tests, time_for_directory = directory_test_timings[directory]
+            timings.append((round(time_for_directory, 1), directory,
+                            num_tests))
+        timings.sort()
+
+        write("Time to process slowest subdirectories:")
+        min_seconds_to_print = 10
+        for timing in timings:
+            if timing[0] > min_seconds_to_print:
+                write("  %s took %s seconds to run %s tests." % (timing[1],
+                      timing[0], timing[2]))
+        write("")
+
+    def _print_statistics_for_test_timings(self, write, title, timings):
+        """Prints the median, mean and standard deviation of the values in
+        timings.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          title: Title for these timings.
+          timings: A list of floats representing times.
+        """
+        write(title)
+        timings.sort()
+
+        num_tests = len(timings)
+        if not num_tests:
+            return
+        percentile90 = timings[int(.9 * num_tests)]
+        percentile99 = timings[int(.99 * num_tests)]
+
+        if num_tests % 2 == 1:
+            median = timings[((num_tests - 1) / 2) - 1]
+        else:
+            lower = timings[num_tests / 2 - 1]
+            upper = timings[num_tests / 2]
+            median = (float(lower + upper)) / 2
+
+        mean = sum(timings) / num_tests
+
+        for time in timings:
+            sum_of_deviations = math.pow(time - mean, 2)
+
+        std_deviation = math.sqrt(sum_of_deviations / num_tests)
+        write("  Median:          %6.3f" % median)
+        write("  Mean:            %6.3f" % mean)
+        write("  90th percentile: %6.3f" % percentile90)
+        write("  99th percentile: %6.3f" % percentile99)
+        write("  Standard dev:    %6.3f" % std_deviation)
+        write("")
+
+    def _print_result_summary(self, write, result_summary):
+        """Print a short summary about how many tests passed.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          result_summary: information to log
+        """
+        failed = len(result_summary.failures)
+        skipped = len(
+            result_summary.tests_by_expectation[test_expectations.SKIP])
+        total = result_summary.total
+        passed = total - failed - skipped
+        pct_passed = 0.0
+        if total > 0:
+            pct_passed = float(passed) * 100 / total
+
+        write("")
+        write("=> Results: %d/%d tests passed (%.1f%%)" %
+                     (passed, total, pct_passed))
+        write("")
+        self._print_result_summary_entry(write, result_summary,
+            test_expectations.NOW, "Tests to be fixed for the current release")
+
+        write("")
+        self._print_result_summary_entry(write, result_summary,
+            test_expectations.DEFER,
+            "Tests we'll fix in the future if they fail (DEFER)")
+
+        write("")
+        self._print_result_summary_entry(write, result_summary,
+            test_expectations.WONTFIX,
+            "Tests that will only be fixed if they crash (WONTFIX)")
+
+    def _print_result_summary_entry(self, write, result_summary, timeline,
+                                    heading):
+        """Print a summary block of results for a particular timeline of test.
+
+        Args:
+          write: A callback to write info to (e.g., a LoggingWriter) or
+              sys.stdout.write.
+          result_summary: summary to print results for
+          timeline: the timeline to print results for (NOT, WONTFIX, etc.)
+          heading: a textual description of the timeline
+        """
+        total = len(result_summary.tests_by_timeline[timeline])
+        not_passing = (total -
+           len(result_summary.tests_by_expectation[test_expectations.PASS] &
+               result_summary.tests_by_timeline[timeline]))
+        write("=> %s (%d):" % (heading, not_passing))
+
+        for result in TestExpectationsFile.EXPECTATION_ORDER:
+            if result == test_expectations.PASS:
+                continue
+            results = (result_summary.tests_by_expectation[result] &
+                       result_summary.tests_by_timeline[timeline])
+            desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result]
+            if not_passing and len(results):
+                pct = len(results) * 100.0 / not_passing
+                write("  %5d %-24s (%4.1f%%)" % (len(results),
+                      desc[len(results) != 1], pct))
+
+    def _print_one_line_summary(self, total, expected):
+        """Print a one-line summary of the test run to stdout.
+
+        Args:
+          total: total number of tests run
+          expected: number of expected results
+        """
+        unexpected = total - expected
+        if unexpected == 0:
+            print "All %d tests ran as expected." % expected
+        elif expected == 1:
+            print "1 test ran as expected, %d didn't:" % unexpected
+        else:
+            print "%d tests ran as expected, %d didn't:" % (expected,
+                unexpected)
+
+    def _print_unexpected_results(self, unexpected_results):
+        """Prints any unexpected results in a human-readable form to stdout."""
+        passes = {}
+        flaky = {}
+        regressions = {}
+
+        if len(unexpected_results['tests']):
+            print ""
+
+        for test, results in unexpected_results['tests'].iteritems():
+            actual = results['actual'].split(" ")
+            expected = results['expected'].split(" ")
+            if actual == ['PASS']:
+                if 'CRASH' in expected:
+                    _add_to_dict_of_lists(passes,
+                                          'Expected to crash, but passed',
+                                          test)
+                elif 'TIMEOUT' in expected:
+                    _add_to_dict_of_lists(passes,
+                                          'Expected to timeout, but passed',
+                                           test)
+                else:
+                    _add_to_dict_of_lists(passes,
+                                          'Expected to fail, but passed',
+                                          test)
+            elif len(actual) > 1:
+                # We group flaky tests by the first actual result we got.
+                _add_to_dict_of_lists(flaky, actual[0], test)
+            else:
+                _add_to_dict_of_lists(regressions, results['actual'], test)
+
+        if len(passes):
+            for key, tests in passes.iteritems():
+                print "%s: (%d)" % (key, len(tests))
+                tests.sort()
+                for test in tests:
+                    print "  %s" % test
+                print
+
+        if len(flaky):
+            descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
+            for key, tests in flaky.iteritems():
+                result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+                print "Unexpected flakiness: %s (%d)" % (
+                  descriptions[result][1], len(tests))
+                tests.sort()
+
+                for test in tests:
+                    result = unexpected_results['tests'][test]
+                    actual = result['actual'].split(" ")
+                    expected = result['expected'].split(" ")
+                    result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+                    new_expectations_list = list(set(actual) | set(expected))
+                    print "  %s = %s" % (test, " ".join(new_expectations_list))
+                print
+
+        if len(regressions):
+            descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
+            for key, tests in regressions.iteritems():
+                result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+                print "Regressions: Unexpected %s : (%d)" % (
+                  descriptions[result][1], len(tests))
+                tests.sort()
+                for test in tests:
+                    print "  %s = %s" % (test, key)
+                print
+
+        if len(unexpected_results['tests']) and self._options.verbose:
+            print "-" * 78
+
+    def _write_results_html_file(self, result_summary):
+        """Write results.html which is a summary of tests that failed.
+
+        Args:
+          result_summary: a summary of the results :)
+
+        Returns:
+          True if any results were written (since expected failures may be
+          omitted)
+        """
+        # test failures
+        if self._options.full_results_html:
+            test_files = result_summary.failures.keys()
+        else:
+            unexpected_failures = self._get_failures(result_summary,
+                include_crashes=True)
+            test_files = unexpected_failures.keys()
+        if not len(test_files):
+            return False
+
+        out_filename = os.path.join(self._options.results_directory,
+                                    "results.html")
+        out_file = open(out_filename, 'w')
+        # header
+        if self._options.full_results_html:
+            h2 = "Test Failures"
+        else:
+            h2 = "Unexpected Test Failures"
+        out_file.write("<html><head><title>Layout Test Results (%(time)s)"
+                       "</title></head><body><h2>%(h2)s (%(time)s)</h2>\n"
+                       % {'h2': h2, 'time': time.asctime()})
+
+        test_files.sort()
+        for test_file in test_files:
+            test_failures = result_summary.failures.get(test_file, [])
+            out_file.write("<p><a href='%s'>%s</a><br />\n"
+                           % (self._port.filename_to_uri(test_file),
+                              self._port.relative_test_filename(test_file)))
+            for failure in test_failures:
+                out_file.write("&nbsp;&nbsp;%s<br/>"
+                               % failure.result_html_output(
+                                 self._port.relative_test_filename(test_file)))
+            out_file.write("</p>\n")
+
+        # footer
+        out_file.write("</body></html>\n")
+        return True
+
+    def _show_results_html_file(self):
+        """Shows the results.html page."""
+        results_filename = os.path.join(self._options.results_directory,
+                                        "results.html")
+        self._port.show_results_html_file(results_filename)
+
+
+def _add_to_dict_of_lists(dict, key, value):
+    dict.setdefault(key, []).append(value)
+
+
+def read_test_files(files):
+    tests = []
+    for file in files:
+        for line in open(file):
+            line = test_expectations.strip_comments(line)
+            if line:
+                tests.append(line)
+    return tests
+
+
+def create_logging_writer(options, log_option):
+    """Returns a write() function that will write the string to _log.info()
+    if comp was specified in --log or if --verbose is true. Otherwise the
+    message is dropped.
+
+    Args:
+      options: list of command line options from optparse
+      log_option: option to match in options.log in order for the messages
+          to be logged (e.g., 'actual' or 'expected')
+    """
+    if options.verbose or log_option in options.log.split(","):
+        return _log.info
+    return lambda str: 1
+
+
+def main(options, args, print_results=True):
+    """Run the tests.
+
+    Args:
+      options: a dictionary of command line options
+      args: a list of sub directories or files to test
+      print_results: whether or not to log anything to stdout.
+          Set to false by the unit tests
+    Returns:
+      the number of unexpected results that occurred, or -1 if there is an
+          error.
+    """
+
+    if options.sources:
+        options.verbose = True
+
+    # Set up our logging format.
+    meter = metered_stream.MeteredStream(options.verbose, sys.stderr)
+    log_fmt = '%(message)s'
+    log_datefmt = '%y%m%d %H:%M:%S'
+    log_level = logging.INFO
+    if options.verbose:
+        log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s '
+                  '%(message)s')
+        log_level = logging.DEBUG
+    logging.basicConfig(level=log_level, format=log_fmt, datefmt=log_datefmt,
+                        stream=meter)
+
+    port_obj = port.get(options.platform, options)
+    executive = Executive()
+
+    if not options.configuration:
+        options.configuration = port_obj.default_configuration()
+
+    if options.pixel_tests is None:
+        options.pixel_tests = True
+
+    if not options.use_apache:
+        options.use_apache = sys.platform in ('darwin', 'linux2')
+
+    if options.results_directory.startswith("/"):
+        # Assume it's an absolute path and normalize.
+        options.results_directory = port_obj.get_absolute_path(
+            options.results_directory)
+    else:
+        # If it's a relative path, make the output directory relative to
+        # Debug or Release.
+        options.results_directory = port_obj.results_directory()
+
+    last_unexpected_results = []
+    if options.print_unexpected_results or options.retry_unexpected_results:
+        unexpected_results_filename = os.path.join(
+           options.results_directory, "unexpected_results.json")
+        f = file(unexpected_results_filename)
+        results = simplejson.load(f)
+        f.close()
+        last_unexpected_results = results['tests'].keys()
+        if options.print_unexpected_results:
+            print "\n".join(last_unexpected_results) + "\n"
+            return 0
+
+    if options.clobber_old_results:
+        # Just clobber the actual test results directories since the other
+        # files in the results directory are explicitly used for cross-run
+        # tracking.
+        meter.update("Clobbering old results in %s" %
+                     options.results_directory)
+        layout_tests_dir = port_obj.layout_tests_dir()
+        possible_dirs = os.listdir(layout_tests_dir)
+        for dirname in possible_dirs:
+            if os.path.isdir(os.path.join(layout_tests_dir, dirname)):
+                shutil.rmtree(os.path.join(options.results_directory, dirname),
+                              ignore_errors=True)
+
+    if not options.child_processes:
+        # FIXME: Investigate perf/flakiness impact of using cpu_count + 1.
+        options.child_processes = port_obj.default_child_processes()
+
+    write = create_logging_writer(options, 'config')
+    if options.child_processes == 1:
+        write("Running one %s" % port_obj.driver_name)
+    else:
+        write("Running %s %ss in parallel" % (
+              options.child_processes, port_obj.driver_name()))
+
+    if not options.time_out_ms:
+        if options.configuration == "Debug":
+            options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS)
+        else:
+            options.time_out_ms = str(TestRunner.DEFAULT_TEST_TIMEOUT_MS)
+
+    options.slow_time_out_ms = str(5 * int(options.time_out_ms))
+    write("Regular timeout: %s, slow test timeout: %s" %
+          (options.time_out_ms, options.slow_time_out_ms))
+
+    # Include all tests if none are specified.
+    new_args = []
+    for arg in args:
+        if arg and arg != '':
+            new_args.append(arg)
+
+    paths = new_args
+    if not paths:
+        paths = []
+    paths += last_unexpected_results
+    if options.test_list:
+        paths += read_test_files(options.test_list)
+
+    # Create the output directory if it doesn't already exist.
+    port_obj.maybe_make_directory(options.results_directory)
+    meter.update("Collecting tests ...")
+
+    test_runner = TestRunner(port_obj, options, meter)
+    test_runner.gather_file_paths(paths)
+
+    if options.lint_test_files:
+        # Creating the expecations for each platform/configuration pair does
+        # all the test list parsing and ensures it's correct syntax (e.g. no
+        # dupes).
+        for platform_name in port_obj.test_platform_names():
+            test_runner.parse_expectations(platform_name, is_debug_mode=True)
+            test_runner.parse_expectations(platform_name, is_debug_mode=False)
+        meter.update("")
+        print ("If there are no fail messages, errors or exceptions, then the "
+            "lint succeeded.")
+        return 0
+
+    write = create_logging_writer(options, "config")
+    write("Using port '%s'" % port_obj.name())
+    write("Placing test results in %s" % options.results_directory)
+    if options.new_baseline:
+        write("Placing new baselines in %s" % port_obj.baseline_path())
+    write("Using %s build" % options.configuration)
+    if options.pixel_tests:
+        write("Pixel tests enabled")
+    else:
+        write("Pixel tests disabled")
+    write("")
+
+    meter.update("Parsing expectations ...")
+    test_runner.parse_expectations(port_obj.test_platform_name(),
+                                   options.configuration == 'Debug')
+
+    meter.update("Checking build ...")
+    if not port_obj.check_build(test_runner.needs_http()):
+        return -1
+
+    meter.update("Starting helper ...")
+    port_obj.start_helper()
+
+    # Check that the system dependencies (themes, fonts, ...) are correct.
+    if not options.nocheck_sys_deps:
+        meter.update("Checking system dependencies ...")
+        if not port_obj.check_sys_deps(test_runner.needs_http()):
+            return -1
+
+    meter.update("Preparing tests ...")
+    write = create_logging_writer(options, "expected")
+    result_summary = test_runner.prepare_lists_and_print_output(write)
+
+    port_obj.setup_test_run()
+
+    test_runner.add_test_type(text_diff.TestTextDiff)
+    if options.pixel_tests:
+        test_runner.add_test_type(image_diff.ImageDiff)
+        if options.fuzzy_pixel_tests:
+            test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff)
+
+    num_unexpected_results = test_runner.run(result_summary, print_results)
+
+    port_obj.stop_helper()
+
+    _log.debug("Exit status: %d" % num_unexpected_results)
+    return num_unexpected_results
+
+
+def _compat_shim_callback(option, opt_str, value, parser):
+    print "Ignoring unsupported option: %s" % opt_str
+
+
+def _compat_shim_option(option_name, nargs=0):
+    return optparse.make_option(option_name, action="callback", callback=_compat_shim_callback, nargs=nargs, help="Ignored, for old-run-webkit-tests compat only.")
+
+
+def parse_args(args=None):
+    """Provides a default set of command line args.
+
+    Returns a tuple of options, args from optparse"""
+
+    # FIXME: All of these options should be stored closer to the code which
+    # FIXME: actually uses them. configuration_options should move
+    # FIXME: to WebKitPort and be shared across all scripts.
+    configuration_options = [
+        optparse.make_option("-t", "--target", dest="configuration",
+                             help="(DEPRECATED)"),
+        # FIXME: --help should display which configuration is default.
+        optparse.make_option('--debug', action='store_const', const='Debug',
+                             dest="configuration",
+                             help='Set the configuration to Debug'),
+        optparse.make_option('--release', action='store_const',
+                             const='Release', dest="configuration",
+                             help='Set the configuration to Release'),
+        # old-run-webkit-tests also accepts -c, --configuration CONFIGURATION.
+    ]
+
+    logging_options = [
+        optparse.make_option("--log", action="store",
+            default=LOG_DEFAULT_VALUE,
+            help=("log various types of data. The argument value should be a "
+                  "comma-separated list of values from: %s (defaults to "
+                  "--log %s)" % (LOG_VALUES, LOG_DEFAULT_VALUE))),
+       optparse.make_option("-v", "--verbose", action="store_true",
+            default=False, help="include debug-level logging"),
+        optparse.make_option("--sources", action="store_true",
+            help="show expected result file path for each test " +
+                 "(implies --verbose)"),
+        # old-run-webkit-tests has a --slowest option which just prints
+        # the slowest 10.
+        optparse.make_option("--num-slow-tests-to-log", default=50,
+            help="Number of slow tests whose timings to print."),
+    ]
+
+    # FIXME: These options should move onto the ChromiumPort.
+    chromium_options = [
+        optparse.make_option("--chromium", action="store_true", default=False,
+            help="use the Chromium port"),
+        optparse.make_option("--startup-dialog", action="store_true",
+            default=False, help="create a dialog on DumpRenderTree startup"),
+        optparse.make_option("--gp-fault-error-box", action="store_true",
+            default=False, help="enable Windows GP fault error box"),
+        optparse.make_option("--nocheck-sys-deps", action="store_true",
+            default=False,
+            help="Don't check the system dependencies (themes)"),
+        optparse.make_option("--use-drt", action="store_true",
+            default=False,
+            help="Use DumpRenderTree instead of test_shell"),
+    ]
+
+    # Missing Mac-specific old-run-webkit-tests options:
+    # FIXME: Need: -g, --guard for guard malloc support on Mac.
+    # FIXME: Need: -l --leaks    Enable leaks checking.
+    # FIXME: Need: --sample-on-timeout Run sample on timeout
+
+    old_run_webkit_tests_compat = [
+        # NRWT doesn't generate results by default anyway.
+        _compat_shim_option("--no-new-test-results"),
+        # NRWT doesn't sample on timeout yet anyway.
+        _compat_shim_option("--no-sample-on-timeout"),
+        # FIXME: NRWT needs to support remote links eventually.
+        _compat_shim_option("--use-remote-links-to-tests"),
+        # FIXME: NRWT doesn't need this option as much since failures are
+        # designed to be cheap.  We eventually plan to add this support.
+        _compat_shim_option("--exit-after-n-failures", nargs=1),
+    ]
+
+    results_options = [
+        # NEED for bots: --use-remote-links-to-tests Link to test files
+        # within the SVN repository in the results.
+        optparse.make_option("-p", "--pixel-tests", action="store_true",
+            dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"),
+        optparse.make_option("--no-pixel-tests", action="store_false",
+            dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
+        optparse.make_option("--fuzzy-pixel-tests", action="store_true",
+            default=False,
+            help="Also use fuzzy matching to compare pixel test outputs."),
+        # old-run-webkit-tests allows a specific tolerance: --tolerance t
+        # Ignore image differences less than this percentage (default: 0.1)
+        optparse.make_option("--results-directory",
+            default="layout-test-results",
+            help="Output results directory source dir, relative to Debug or "
+                 "Release"),
+        optparse.make_option("--new-baseline", action="store_true",
+            default=False, help="Save all generated results as new baselines "
+                 "into the platform directory, overwriting whatever's "
+                 "already there."),
+        optparse.make_option("--no-show-results", action="store_false",
+            default=True, dest="show_results",
+            help="Don't launch a browser with results after the tests "
+                 "are done"),
+        # FIXME: We should have a helper function to do this sort of
+        # deprectated mapping and automatically log, etc.
+        optparse.make_option("--noshow-results", action="store_false",
+            dest="show_results",
+            help="Deprecated, same as --no-show-results."),
+        optparse.make_option("--no-launch-safari", action="store_false",
+            dest="show_results",
+            help="old-run-webkit-tests compat, same as --noshow-results."),
+        # old-run-webkit-tests:
+        # --[no-]launch-safari    Launch (or do not launch) Safari to display
+        #                         test results (default: launch)
+        optparse.make_option("--full-results-html", action="store_true",
+            default=False,
+            help="Show all failures in results.html, rather than only "
+                 "regressions"),
+        optparse.make_option("--clobber-old-results", action="store_true",
+            default=False, help="Clobbers test results from previous runs."),
+        optparse.make_option("--platform",
+            help="Override the platform for expected results"),
+        # old-run-webkit-tests also has HTTP toggle options:
+        # --[no-]http                     Run (or do not run) http tests
+        #                                 (default: run)
+        # --[no-]wait-for-httpd           Wait for httpd if some other test
+        #                                 session is using it already (same
+        #                                 as WEBKIT_WAIT_FOR_HTTPD=1).
+        #                                 (default: 0)
+    ]
+
+    test_options = [
+        optparse.make_option("--build", dest="build",
+            action="store_true", default=True,
+            help="Check to ensure the DumpRenderTree build is up-to-date "
+                 "(default)."),
+        optparse.make_option("--no-build", dest="build",
+            action="store_false", help="Don't check to see if the "
+                                       "DumpRenderTree build is up-to-date."),
+        # old-run-webkit-tests has --valgrind instead of wrapper.
+        optparse.make_option("--wrapper",
+            help="wrapper command to insert before invocations of "
+                 "DumpRenderTree; option is split on whitespace before "
+                 "running. (Example: --wrapper='valgrind --smc-check=all')"),
+        # old-run-webkit-tests:
+        # -i|--ignore-tests               Comma-separated list of directories
+        #                                 or tests to ignore
+        optparse.make_option("--test-list", action="append",
+            help="read list of tests to run from file", metavar="FILE"),
+        # old-run-webkit-tests uses --skipped==[default|ignore|only]
+        # instead of --force:
+        optparse.make_option("--force", action="store_true", default=False,
+            help="Run all tests, even those marked SKIP in the test list"),
+        optparse.make_option("--use-apache", action="store_true",
+            default=False, help="Whether to use apache instead of lighttpd."),
+        optparse.make_option("--time-out-ms",
+            help="Set the timeout for each test"),
+        # old-run-webkit-tests calls --randomize-order --random:
+        optparse.make_option("--randomize-order", action="store_true",
+            default=False, help=("Run tests in random order (useful "
+                                "for tracking down corruption)")),
+        optparse.make_option("--run-chunk",
+            help=("Run a specified chunk (n:l), the nth of len l, "
+                 "of the layout tests")),
+        optparse.make_option("--run-part", help=("Run a specified part (n:m), "
+                  "the nth of m parts, of the layout tests")),
+        # old-run-webkit-tests calls --batch-size: --nthly n
+        #   Restart DumpRenderTree every n tests (default: 1000)
+        optparse.make_option("--batch-size",
+            help=("Run a the tests in batches (n), after every n tests, "
+                  "DumpRenderTree is relaunched.")),
+        # old-run-webkit-tests calls --run-singly: -1|--singly
+        # Isolate each test case run (implies --nthly 1 --verbose)
+        optparse.make_option("--run-singly", action="store_true",
+            default=False, help="run a separate DumpRenderTree for each test"),
+        optparse.make_option("--child-processes",
+            help="Number of DumpRenderTrees to run in parallel."),
+        # FIXME: Display default number of child processes that will run.
+        optparse.make_option("--experimental-fully-parallel",
+            action="store_true", default=False,
+            help="run all tests in parallel"),
+        # FIXME: Need --exit-after-n-failures N
+        #      Exit after the first N failures instead of running all tests
+        # FIXME: consider: --iterations n
+        #      Number of times to run the set of tests (e.g. ABCABCABC)
+        optparse.make_option("--print-unexpected-results", action="store_true",
+            default=False, help="print the tests in the last run that "
+            "had unexpected results."),
+        optparse.make_option("--retry-unexpected-results", action="store_true",
+            default=False, help="re-try the tests in the last run that "
+            "had unexpected results."),
+    ]
+
+    misc_options = [
+        optparse.make_option("--lint-test-files", action="store_true",
+        default=False, help=("Makes sure the test files parse for all "
+                            "configurations. Does not run any tests.")),
+    ]
+
+    # FIXME: Move these into json_results_generator.py
+    results_json_options = [
+        optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME",
+            help=("The name of the builder shown on the waterfall running "
+                  "this script e.g. WebKit.")),
+        optparse.make_option("--build-name", default="DUMMY_BUILD_NAME",
+            help=("The name of the builder used in its path, e.g. "
+                  "webkit-rel.")),
+        optparse.make_option("--build-number", default="DUMMY_BUILD_NUMBER",
+            help=("The build number of the builder running this script.")),
+    ]
+
+    option_list = (configuration_options + logging_options +
+                   chromium_options + results_options + test_options +
+                   misc_options + results_json_options +
+                   old_run_webkit_tests_compat)
+    option_parser = optparse.OptionParser(option_list=option_list)
+    return option_parser.parse_args(args)
+
+if '__main__' == __name__:
+    options, args = parse_args()
+    sys.exit(main(options, args))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
new file mode 100644
index 0000000..9fe0e74
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -0,0 +1,74 @@
+#!/usr/bin/python
+# 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.
+
+"""Unit tests for run_webkit_tests."""
+
+import os
+import sys
+import unittest
+
+import webkitpy.layout_tests.run_webkit_tests as run_webkit_tests
+
+
+def passing_run(args):
+    options, args = run_webkit_tests.parse_args(args)
+    res = run_webkit_tests.main(options, args, False)
+    return res == 0
+
+
+class MainTest(unittest.TestCase):
+    def test_fast(self):
+        self.assertTrue(passing_run(['--platform', 'test',
+                                     'fast/html']))
+        self.assertTrue(passing_run(['--platform', 'test',
+                                     '--run-singly',
+                                     'fast/html']))
+        self.assertTrue(passing_run(['--platform', 'test',
+                                     'fast/html/article-element.html']))
+        self.assertTrue(passing_run(['--platform', 'test',
+                                    '--child-processes', '1',
+                                     '--log', 'unexpected',
+                                     'fast/html']))
+
+
+class DryrunTest(unittest.TestCase):
+    def test_basics(self):
+        self.assertTrue(passing_run(['--platform', 'dryrun',
+                                     'fast/html']))
+        #self.assertTrue(passing_run(['--platform', 'dryrun-mac',
+        #                             'fast/html']))
+        #self.assertTrue(passing_run(['--platform', 'dryrun-chromium-mac',
+        #                             'fast/html']))
+        #self.assertTrue(passing_run(['--platform', 'dryrun-chromium-win',
+        #                             'fast/html']))
+        #self.assertTrue(passing_run(['--platform', 'dryrun-chromium-linux',
+        #                             'fast/html']))
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
index 89dd192..64dfb20 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
@@ -36,13 +36,15 @@
 import os
 import shutil
 
-from layout_package import test_failures
-from test_types import test_type_base
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests.test_types import test_type_base
+
+_log = logging.getLogger("webkitpy.layout_tests.test_types.fuzzy_image_diff")
 
 
 class FuzzyImageDiff(test_type_base.TestTypeBase):
 
-    def compare_output(self, filename, output, test_args, target):
+    def compare_output(self, filename, output, test_args, configuration):
         """Implementation of CompareOutput that checks the output image and
         checksum against the expected files from the LayoutTest directory.
         """
@@ -55,14 +57,14 @@
         expected_png_file = self._port.expected_filename(filename, '.png')
 
         if test_args.show_sources:
-            logging.debug('Using %s' % expected_png_file)
+            _log.debug('Using %s' % expected_png_file)
 
         # Also report a missing expected PNG file.
         if not os.path.isfile(expected_png_file):
             failures.append(test_failures.FailureMissingImage(self))
 
         # Run the fuzzymatcher
-        r = port.fuzzy_diff(test_args.png_path, expected_png_file)
+        r = self._port.fuzzy_diff(test_args.png_path, expected_png_file)
         if r != 0:
             failures.append(test_failures.FailureFuzzyFailure(self))
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
index 1df7ca3..b414358 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
@@ -39,13 +39,15 @@
 import os
 import shutil
 
-from layout_package import test_failures
-from test_types import test_type_base
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests.test_types import test_type_base
 
 # Cache whether we have the image_diff executable available.
 _compare_available = True
 _compare_msg_printed = False
 
+_log = logging.getLogger("webkitpy.layout_tests.test_types.image_diff")
+
 
 class ImageDiff(test_type_base.TestTypeBase):
 
@@ -82,12 +84,13 @@
         self._save_baseline_data(filename, png_data, ".png")
         self._save_baseline_data(filename, checksum, ".checksum")
 
-    def _create_image_diff(self, port, filename, target):
+    def _create_image_diff(self, port, filename, configuration):
         """Creates the visual diff of the expected/actual PNGs.
 
         Args:
           filename: the name of the test
-          target: Debug or Release
+          configuration: Debug or Release
+        Returns True if the files are different, False if they match
         """
         diff_filename = self.output_filename(filename,
           self.FILENAME_SUFFIX_COMPARE)
@@ -96,9 +99,10 @@
         expected_filename = self.output_filename(filename,
           self.FILENAME_SUFFIX_EXPECTED + '.png')
 
+        result = True
         try:
             _compare_available = True
-            result = port.diff_image(actual_filename, expected_filename,
+            result = port.diff_image(expected_filename, actual_filename,
                                      diff_filename)
         except ValueError:
             _compare_available = False
@@ -106,12 +110,12 @@
         global _compare_msg_printed
         if not _compare_available and not _compare_msg_printed:
             _compare_msg_printed = True
-            print('image_diff not found. Make sure you have a ' + target +
-                  ' build of the image_diff executable.')
+            print('image_diff not found. Make sure you have a ' +
+                  configuration + ' build of the image_diff executable.')
 
         return result
 
-    def compare_output(self, port, filename, output, test_args, target):
+    def compare_output(self, port, filename, output, test_args, configuration):
         """Implementation of CompareOutput that checks the output image and
         checksum against the expected files from the LayoutTest directory.
         """
@@ -133,8 +137,8 @@
         expected_png_file = self._port.expected_filename(filename, '.png')
 
         if test_args.show_sources:
-            logging.debug('Using %s' % expected_hash_file)
-            logging.debug('Using %s' % expected_png_file)
+            _log.debug('Using %s' % expected_hash_file)
+            _log.debug('Using %s' % expected_png_file)
 
         try:
             expected_hash = open(expected_hash_file, "r").read()
@@ -146,9 +150,9 @@
 
         if not os.path.isfile(expected_png_file):
             # Report a missing expected PNG file.
-            self.write_output_files(port, filename, '', '.checksum',
+            self.write_output_files(port, filename, '.checksum',
                                     test_args.hash, expected_hash,
-                                    diff=False, wdiff=False)
+                                    print_text_diffs=False)
             self._copy_output_png(filename, test_args.png_path, '-actual.png')
             failures.append(test_failures.FailureMissingImage(self))
             return failures
@@ -156,25 +160,22 @@
             # Hash matched (no diff needed, okay to return).
             return failures
 
-
-        self.write_output_files(port, filename, '', '.checksum',
+        self.write_output_files(port, filename, '.checksum',
                                 test_args.hash, expected_hash,
-                                diff=False, wdiff=False)
+                                print_text_diffs=False)
         self._copy_output_png(filename, test_args.png_path, '-actual.png')
         self._copy_output_png(filename, expected_png_file, '-expected.png')
 
-        # Even though we only use result in one codepath below but we
+        # Even though we only use the result in one codepath below but we
         # still need to call CreateImageDiff for other codepaths.
-        result = self._create_image_diff(port, filename, target)
+        images_are_different = self._create_image_diff(port, filename, configuration)
         if expected_hash == '':
             failures.append(test_failures.FailureMissingImageHash(self))
         elif test_args.hash != expected_hash:
-            # Hashes don't match, so see if the images match. If they do, then
-            # the hash is wrong.
-            if result == 0:
-                failures.append(test_failures.FailureImageHashIncorrect(self))
-            else:
+            if images_are_different:
                 failures.append(test_failures.FailureImageHashMismatch(self))
+            else:
+                failures.append(test_failures.FailureImageHashIncorrect(self))
 
         return failures
 
@@ -188,10 +189,7 @@
           True if two files are different.
           False otherwise.
         """
-
         try:
-            result = port.diff_image(file1, file2)
+            return port.diff_image(file1, file2)
         except ValueError, e:
             return True
-
-        return result == 1
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
index efa2e8c..4c99be0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
@@ -37,6 +37,8 @@
 import logging
 import os.path
 
+_log = logging.getLogger("webkitpy.layout_tests.test_types.test_type_base")
+
 
 class TestArguments(object):
     """Struct-like wrapper for additional arguments needed by
@@ -68,19 +70,18 @@
     FILENAME_SUFFIX_EXPECTED = "-expected"
     FILENAME_SUFFIX_DIFF = "-diff"
     FILENAME_SUFFIX_WDIFF = "-wdiff.html"
+    FILENAME_SUFFIX_PRETTY_PATCH = "-pretty-diff.html"
     FILENAME_SUFFIX_COMPARE = "-diff.png"
 
-    def __init__(self, port, platform, root_output_dir):
+    def __init__(self, port, root_output_dir):
         """Initialize a TestTypeBase object.
 
         Args:
-          platform: the platform (e.g., 'chromium-mac-leopard')
-            identifying the platform-specific results to be used.
+          port: object implementing port-specific information and methods
           root_output_dir: The unix style path to the output dir.
         """
         self._root_output_dir = root_output_dir
         self._port = port
-        self._platform = platform
 
     def _make_output_directory(self, filename):
         """Creates the output directory (if needed) for a given test
@@ -90,7 +91,7 @@
         self._port.maybe_make_directory(os.path.split(output_filename)[0])
 
     def _save_baseline_data(self, filename, data, modifier):
-        """Saves a new baseline file into the platform directory.
+        """Saves a new baseline file into the port's baseline directory.
 
         The file will be named simply "<test>-expected<modifier>", suitable for
         use as the expected results in a later run.
@@ -102,15 +103,16 @@
         """
         relative_dir = os.path.dirname(
             self._port.relative_test_filename(filename))
-        output_dir = os.path.join(
-            self._port.chromium_baseline_path(self._platform), relative_dir)
+
+        baseline_path = self._port.baseline_path()
+        output_dir = os.path.join(baseline_path, relative_dir)
         output_file = os.path.basename(os.path.splitext(filename)[0] +
             self.FILENAME_SUFFIX_EXPECTED + modifier)
 
         self._port.maybe_make_directory(output_dir)
         output_path = os.path.join(output_dir, output_file)
-        logging.debug('writing new baseline to "%s"' % (output_path))
-        open(output_path, "wb").write(data)
+        _log.debug('writing new baseline to "%s"' % (output_path))
+        self._write_into_file_at_path(output_path, data)
 
     def output_filename(self, filename, modifier):
         """Returns a filename inside the output dir that contains modifier.
@@ -130,7 +132,7 @@
             self._port.relative_test_filename(filename))
         return os.path.splitext(output_filename)[0] + modifier
 
-    def compare_output(self, port, filename, output, test_args, target):
+    def compare_output(self, port, filename, output, test_args, configuration):
         """Method that compares the output from the test with the
         expected value.
 
@@ -141,56 +143,59 @@
           output: a string containing the output of the test
           test_args: a TestArguments object holding optional additional
               arguments
-          target: Debug or Release
+          configuration: Debug or Release
 
         Return:
           a list of TestFailure objects, empty if the test passes
         """
         raise NotImplemented
 
-    def write_output_files(self, port, filename, test_type, file_type,
-                           output, expected, diff=True, wdiff=False):
+    def _write_into_file_at_path(self, file_path, contents):
+        file = open(file_path, "wb")
+        file.write(contents)
+        file.close()
+
+    def write_output_files(self, port, filename, file_type,
+                           output, expected, print_text_diffs=False):
         """Writes the test output, the expected output and optionally the diff
         between the two to files in the results directory.
 
         The full output filename of the actual, for example, will be
-          <filename><test_type>-actual<file_type>
+          <filename>-actual<file_type>
         For instance,
-          my_test-simp-actual.txt
+          my_test-actual.txt
 
         Args:
           filename: The test filename
-          test_type: A string describing the test type, e.g. "simp"
           file_type: A string describing the test output file type, e.g. ".txt"
           output: A string containing the test output
           expected: A string containing the expected test output
-          diff: if True, write a file containing the diffs too. This should be
-              False for results that are not text
-          wdiff: if True, write an HTML file containing word-by-word diffs
+          print_text_diffs: True for text diffs. (FIXME: We should be able to get this from the file type?)
         """
         self._make_output_directory(filename)
-        actual_filename = self.output_filename(filename,
-            test_type + self.FILENAME_SUFFIX_ACTUAL + file_type)
-        expected_filename = self.output_filename(filename,
-            test_type + self.FILENAME_SUFFIX_EXPECTED + file_type)
+        actual_filename = self.output_filename(filename, self.FILENAME_SUFFIX_ACTUAL + file_type)
+        expected_filename = self.output_filename(filename, self.FILENAME_SUFFIX_EXPECTED + file_type)
         if output:
-            open(actual_filename, "wb").write(output)
+            self._write_into_file_at_path(actual_filename, output)
         if expected:
-            open(expected_filename, "wb").write(expected)
+            self._write_into_file_at_path(expected_filename, expected)
 
         if not output or not expected:
             return
 
-        if diff:
-            diff = port.diff_text(expected, output, expected_filename,
-                                  actual_filename)
-            diff_filename = self.output_filename(filename,
-                test_type + self.FILENAME_SUFFIX_DIFF + file_type)
-            open(diff_filename, "wb").write(diff)
+        if not print_text_diffs:
+            return
 
-        if wdiff:
-            # Shell out to wdiff to get colored inline diffs.
-            wdiff = port.wdiff_text(expected_filename, actual_filename)
-            filename = self.output_filename(filename, test_type +
-                                            self.FILENAME_SUFFIX_WDIFF)
-            out = open(filename, 'wb').write(wdiff)
+        diff = port.diff_text(expected, output, expected_filename, actual_filename)
+        diff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_DIFF + file_type)
+        self._write_into_file_at_path(diff_filename, diff)
+
+        # Shell out to wdiff to get colored inline diffs.
+        wdiff = port.wdiff_text(expected_filename, actual_filename)
+        wdiff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_WDIFF)
+        self._write_into_file_at_path(wdiff_filename, wdiff)
+
+        # Use WebKit's PrettyPatch.rb to get an HTML diff.
+        pretty_patch = port.pretty_patch_text(diff_filename)
+        pretty_patch_filename = self.output_filename(filename, self.FILENAME_SUFFIX_PRETTY_PATCH)
+        self._write_into_file_at_path(pretty_patch_filename, pretty_patch)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
index 54b332b..8f7907c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -37,8 +37,10 @@
 import logging
 import os.path
 
-from layout_package import test_failures
-from test_types import test_type_base
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests.test_types import test_type_base
+
+_log = logging.getLogger("webkitpy.layout_tests.test_types.text_diff")
 
 
 def is_render_tree_dump(data):
@@ -63,7 +65,7 @@
         # Read the port-specific expected text.
         expected_filename = self._port.expected_filename(filename, '.txt')
         if show_sources:
-            logging.debug('Using %s' % expected_filename)
+            _log.debug('Using %s' % expected_filename)
 
         return self.get_normalized_text(expected_filename)
 
@@ -78,7 +80,7 @@
         # Normalize line endings
         return text.strip("\r\n").replace("\r\n", "\n") + "\n"
 
-    def compare_output(self, port, filename, output, test_args, target):
+    def compare_output(self, port, filename, output, test_args, configuration):
         """Implementation of CompareOutput that checks the output text against
         the expected text from the LayoutTest directory."""
         failures = []
@@ -96,8 +98,8 @@
         # Write output files for new tests, too.
         if port.compare_text(output, expected):
             # Text doesn't match, write output files.
-            self.write_output_files(port, filename, "", ".txt", output,
-                                    expected, diff=True, wdiff=True)
+            self.write_output_files(port, filename, ".txt", output,
+                                    expected, print_text_diffs=True)
 
             if expected == '':
                 failures.append(test_failures.FailureMissingResult(self))
diff --git a/WebKitTools/Scripts/webkitpy/mock.py b/WebKitTools/Scripts/webkitpy/mock.py
deleted file mode 100644
index f6f328e..0000000
--- a/WebKitTools/Scripts/webkitpy/mock.py
+++ /dev/null
@@ -1,309 +0,0 @@
-# mock.py

-# Test tools for mocking and patching.

-# Copyright (C) 2007-2009 Michael Foord

-# E-mail: fuzzyman AT voidspace DOT org DOT uk

-

-# mock 0.6.0

-# http://www.voidspace.org.uk/python/mock/

-

-# Released subject to the BSD License

-# Please see http://www.voidspace.org.uk/python/license.shtml

-

-# 2009-11-25: Licence downloaded from above URL.

-# BEGIN DOWNLOADED LICENSE

-#

-# Copyright (c) 2003-2009, Michael Foord

-# All rights reserved.

-# E-mail : fuzzyman AT voidspace DOT org DOT uk

-# 

-# 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 Michael Foord nor the name of Voidspace

-#       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.

-#

-# END DOWNLOADED LICENSE

-

-# Scripts maintained at http://www.voidspace.org.uk/python/index.shtml

-# Comments, suggestions and bug reports welcome.

-

-

-__all__ = (

-    'Mock',

-    'patch',

-    'patch_object',

-    'sentinel',

-    'DEFAULT'

-)

-

-__version__ = '0.6.0'

-

-class SentinelObject(object):

-    def __init__(self, name):

-        self.name = name

-        

-    def __repr__(self):

-        return '<SentinelObject "%s">' % self.name

-

-

-class Sentinel(object):

-    def __init__(self):

-        self._sentinels = {}

-        

-    def __getattr__(self, name):

-        return self._sentinels.setdefault(name, SentinelObject(name))

-    

-    

-sentinel = Sentinel()

-

-DEFAULT = sentinel.DEFAULT

-

-class OldStyleClass:

-    pass

-ClassType = type(OldStyleClass)

-

-def _is_magic(name):

-    return '__%s__' % name[2:-2] == name

-

-def _copy(value):

-    if type(value) in (dict, list, tuple, set):

-        return type(value)(value)

-    return value

-

-

-class Mock(object):

-

-    def __init__(self, spec=None, side_effect=None, return_value=DEFAULT, 

-                 name=None, parent=None, wraps=None):

-        self._parent = parent

-        self._name = name

-        if spec is not None and not isinstance(spec, list):

-            spec = [member for member in dir(spec) if not _is_magic(member)]

-        

-        self._methods = spec

-        self._children = {}

-        self._return_value = return_value

-        self.side_effect = side_effect

-        self._wraps = wraps

-        

-        self.reset_mock()

-        

-

-    def reset_mock(self):

-        self.called = False

-        self.call_args = None

-        self.call_count = 0

-        self.call_args_list = []

-        self.method_calls = []

-        for child in self._children.itervalues():

-            child.reset_mock()

-        if isinstance(self._return_value, Mock):

-            self._return_value.reset_mock()

-        

-    

-    def __get_return_value(self):

-        if self._return_value is DEFAULT:

-            self._return_value = Mock()

-        return self._return_value

-    

-    def __set_return_value(self, value):

-        self._return_value = value

-        

-    return_value = property(__get_return_value, __set_return_value)

-

-

-    def __call__(self, *args, **kwargs):

-        self.called = True

-        self.call_count += 1

-        self.call_args = (args, kwargs)

-        self.call_args_list.append((args, kwargs))

-        

-        parent = self._parent

-        name = self._name

-        while parent is not None:

-            parent.method_calls.append((name, args, kwargs))

-            if parent._parent is None:

-                break

-            name = parent._name + '.' + name

-            parent = parent._parent

-        

-        ret_val = DEFAULT

-        if self.side_effect is not None:

-            if (isinstance(self.side_effect, Exception) or 

-                isinstance(self.side_effect, (type, ClassType)) and

-                issubclass(self.side_effect, Exception)):

-                raise self.side_effect

-            

-            ret_val = self.side_effect(*args, **kwargs)

-            if ret_val is DEFAULT:

-                ret_val = self.return_value

-        

-        if self._wraps is not None and self._return_value is DEFAULT:

-            return self._wraps(*args, **kwargs)

-        if ret_val is DEFAULT:

-            ret_val = self.return_value

-        return ret_val

-    

-    

-    def __getattr__(self, name):

-        if self._methods is not None:

-            if name not in self._methods:

-                raise AttributeError("Mock object has no attribute '%s'" % name)

-        elif _is_magic(name):

-            raise AttributeError(name)

-        

-        if name not in self._children:

-            wraps = None

-            if self._wraps is not None:

-                wraps = getattr(self._wraps, name)

-            self._children[name] = Mock(parent=self, name=name, wraps=wraps)

-            

-        return self._children[name]

-    

-    

-    def assert_called_with(self, *args, **kwargs):

-        assert self.call_args == (args, kwargs), 'Expected: %s\nCalled with: %s' % ((args, kwargs), self.call_args)

-        

-

-def _dot_lookup(thing, comp, import_path):

-    try:

-        return getattr(thing, comp)

-    except AttributeError:

-        __import__(import_path)

-        return getattr(thing, comp)

-

-

-def _importer(target):

-    components = target.split('.')

-    import_path = components.pop(0)

-    thing = __import__(import_path)

-

-    for comp in components:

-        import_path += ".%s" % comp

-        thing = _dot_lookup(thing, comp, import_path)

-    return thing

-

-

-class _patch(object):

-    def __init__(self, target, attribute, new, spec, create):

-        self.target = target

-        self.attribute = attribute

-        self.new = new

-        self.spec = spec

-        self.create = create

-        self.has_local = False

-

-

-    def __call__(self, func):

-        if hasattr(func, 'patchings'):

-            func.patchings.append(self)

-            return func

-

-        def patched(*args, **keywargs):

-            # don't use a with here (backwards compatability with 2.5)

-            extra_args = []

-            for patching in patched.patchings:

-                arg = patching.__enter__()

-                if patching.new is DEFAULT:

-                    extra_args.append(arg)

-            args += tuple(extra_args)

-            try:

-                return func(*args, **keywargs)

-            finally:

-                for patching in getattr(patched, 'patchings', []):

-                    patching.__exit__()

-

-        patched.patchings = [self]

-        patched.__name__ = func.__name__ 

-        patched.compat_co_firstlineno = getattr(func, "compat_co_firstlineno", 

-                                                func.func_code.co_firstlineno)

-        return patched

-

-

-    def get_original(self):

-        target = self.target

-        name = self.attribute

-        create = self.create

-        

-        original = DEFAULT

-        if _has_local_attr(target, name):

-            try:

-                original = target.__dict__[name]

-            except AttributeError:

-                # for instances of classes with slots, they have no __dict__

-                original = getattr(target, name)

-        elif not create and not hasattr(target, name):

-            raise AttributeError("%s does not have the attribute %r" % (target, name))

-        return original

-

-    

-    def __enter__(self):

-        new, spec, = self.new, self.spec

-        original = self.get_original()

-        if new is DEFAULT:

-            # XXXX what if original is DEFAULT - shouldn't use it as a spec

-            inherit = False

-            if spec == True:

-                # set spec to the object we are replacing

-                spec = original

-                if isinstance(spec, (type, ClassType)):

-                    inherit = True

-            new = Mock(spec=spec)

-            if inherit:

-                new.return_value = Mock(spec=spec)

-        self.temp_original = original

-        setattr(self.target, self.attribute, new)

-        return new

-

-

-    def __exit__(self, *_):

-        if self.temp_original is not DEFAULT:

-            setattr(self.target, self.attribute, self.temp_original)

-        else:

-            delattr(self.target, self.attribute)

-        del self.temp_original

-            

-                

-def patch_object(target, attribute, new=DEFAULT, spec=None, create=False):

-    return _patch(target, attribute, new, spec, create)

-

-

-def patch(target, new=DEFAULT, spec=None, create=False):

-    try:

-        target, attribute = target.rsplit('.', 1)    

-    except (TypeError, ValueError):

-        raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))

-    target = _importer(target)

-    return _patch(target, attribute, new, spec, create)

-

-

-

-def _has_local_attr(obj, name):

-    try:

-        return name in vars(obj)

-    except TypeError:

-        # objects without a __dict__

-        return hasattr(obj, name)

diff --git a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py b/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
deleted file mode 100644
index f522e40..0000000
--- a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
+++ /dev/null
@@ -1,368 +0,0 @@
-# Copyright (C) 2009 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.
-
-import os
-
-from webkitpy.bugzilla import Bug, Attachment
-from webkitpy.committers import CommitterList, Reviewer
-from webkitpy.mock import Mock
-from webkitpy.scm import CommitMessage
-from webkitpy.webkit_logging import log
-
-
-def _id_to_object_dictionary(*objects):
-    dictionary = {}
-    for thing in objects:
-        dictionary[thing["id"]] = thing
-    return dictionary
-
-
-# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
-
-
-_patch1 = {
-    "id": 197,
-    "bug_id": 42,
-    "url": "http://example.com/197",
-    "is_obsolete": False,
-    "is_patch": True,
-    "review": "+",
-    "reviewer_email": "foo@bar.com",
-    "commit-queue": "+",
-    "committer_email": "foo@bar.com",
-    "attacher_email": "Contributer1",
-}
-
-
-_patch2 = {
-    "id": 128,
-    "bug_id": 42,
-    "url": "http://example.com/128",
-    "is_obsolete": False,
-    "is_patch": True,
-    "review": "+",
-    "reviewer_email": "foo@bar.com",
-    "commit-queue": "+",
-    "committer_email": "non-committer@example.com",
-    "attacher_email": "eric@webkit.org",
-}
-
-
-_patch3 = {
-    "id": 103,
-    "bug_id": 75,
-    "url": "http://example.com/103",
-    "is_obsolete": False,
-    "is_patch": True,
-    "review": "?",
-    "attacher_email": "eric@webkit.org",
-}
-
-
-_patch4 = {
-    "id": 104,
-    "bug_id": 77,
-    "url": "http://example.com/103",
-    "is_obsolete": False,
-    "is_patch": True,
-    "review": "+",
-    "commit-queue": "?",
-    "reviewer_email": "foo@bar.com",
-    "attacher_email": "Contributer2",
-}
-
-
-_patch5 = {
-    "id": 105,
-    "bug_id": 77,
-    "url": "http://example.com/103",
-    "is_obsolete": False,
-    "is_patch": True,
-    "review": "+",
-    "reviewer_email": "foo@bar.com",
-    "attacher_email": "eric@webkit.org",
-}
-
-
-_patch6 = { # Valid committer, but no reviewer.
-    "id": 106,
-    "bug_id": 77,
-    "url": "http://example.com/103",
-    "is_obsolete": False,
-    "is_patch": True,
-    "commit-queue": "+",
-    "committer_email": "foo@bar.com",
-    "attacher_email": "eric@webkit.org",
-}
-
-
-_patch7 = { # Valid review, patch is marked obsolete.
-    "id": 107,
-    "bug_id": 76,
-    "url": "http://example.com/103",
-    "is_obsolete": True,
-    "is_patch": True,
-    "review": "+",
-    "reviewer_email": "foo@bar.com",
-    "attacher_email": "eric@webkit.org",
-}
-
-
-# This must be defined before we define the bugs, thus we don't use
-# MockBugzilla.unassigned_email directly.
-_unassigned_email = "unassigned@example.com"
-
-
-# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
-
-
-_bug1 = {
-    "id": 42,
-    "title": "Bug with two r+'d and cq+'d patches, one of which has an "
-             "invalid commit-queue setter.",
-    "assigned_to_email": _unassigned_email,
-    "attachments": [_patch1, _patch2],
-}
-
-
-_bug2 = {
-    "id": 75,
-    "title": "Bug with a patch needing review.",
-    "assigned_to_email": "foo@foo.com",
-    "attachments": [_patch3],
-}
-
-
-_bug3 = {
-    "id": 76,
-    "title": "The third bug",
-    "assigned_to_email": _unassigned_email,
-    "attachments": [_patch7],
-}
-
-
-_bug4 = {
-    "id": 77,
-    "title": "The fourth bug",
-    "assigned_to_email": "foo@foo.com",
-    "attachments": [_patch4, _patch5, _patch6],
-}
-
-
-class MockBugzillaQueries(Mock):
-
-    def __init__(self, bugzilla):
-        Mock.__init__(self)
-        self._bugzilla = bugzilla
-
-    def _all_bugs(self):
-        return map(lambda bug_dictionary: Bug(bug_dictionary, self._bugzilla),
-                   self._bugzilla.bug_cache.values())
-
-    def fetch_bug_ids_from_commit_queue(self):
-        bugs_with_commit_queued_patches = filter(
-                lambda bug: bug.commit_queued_patches(),
-                self._all_bugs())
-        return map(lambda bug: bug.id(), bugs_with_commit_queued_patches)
-
-    def fetch_attachment_ids_from_review_queue(self):
-        unreviewed_patches = sum([bug.unreviewed_patches()
-                                  for bug in self._all_bugs()], [])
-        return map(lambda patch: patch.id(), unreviewed_patches)
-
-    def fetch_patches_from_commit_queue(self):
-        return sum([bug.commit_queued_patches()
-                    for bug in self._all_bugs()], [])
-
-    def fetch_bug_ids_from_pending_commit_list(self):
-        bugs_with_reviewed_patches = filter(lambda bug: bug.reviewed_patches(),
-                                            self._all_bugs())
-        bug_ids = map(lambda bug: bug.id(), bugs_with_reviewed_patches)
-        # NOTE: This manual hack here is to allow testing logging in
-        # test_assign_to_committer the real pending-commit query on bugzilla
-        # will return bugs with patches which have r+, but are also obsolete.
-        return bug_ids + [76]
-
-    def fetch_patches_from_pending_commit_list(self):
-        return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
-
-
-# FIXME: Bugzilla is the wrong Mock-point.  Once we have a BugzillaNetwork
-#        class we should mock that instead.
-# Most of this class is just copy/paste from Bugzilla.
-
-
-class MockBugzilla(Mock):
-
-    bug_server_url = "http://example.com"
-
-    unassigned_email = _unassigned_email
-
-    bug_cache = _id_to_object_dictionary(_bug1, _bug2, _bug3, _bug4)
-
-    attachment_cache = _id_to_object_dictionary(_patch1,
-                                                _patch2,
-                                                _patch3,
-                                                _patch4,
-                                                _patch5,
-                                                _patch6,
-                                                _patch7)
-
-    def __init__(self):
-        Mock.__init__(self)
-        self.queries = MockBugzillaQueries(self)
-        self.committers = CommitterList(reviewers=[Reviewer("Foo Bar",
-                                                            "foo@bar.com")])
-
-    def fetch_bug(self, bug_id):
-        return Bug(self.bug_cache.get(bug_id), self)
-
-    def fetch_attachment(self, attachment_id):
-        # This could be changed to .get() if we wish to allow failed lookups.
-        attachment_dictionary = self.attachment_cache[attachment_id]
-        bug = self.fetch_bug(attachment_dictionary["bug_id"])
-        for attachment in bug.attachments(include_obsolete=True):
-            if attachment.id() == int(attachment_id):
-                return attachment
-
-    def bug_url_for_bug_id(self, bug_id):
-        return "%s/%s" % (self.bug_server_url, bug_id)
-
-    def fetch_bug_dictionary(self, bug_id):
-        return self.bug_cache.get(bug_id)
-
-    def attachment_url_for_id(self, attachment_id, action="view"):
-        action_param = ""
-        if action and action != "view":
-            action_param = "&action=%s" % action
-        return "%s/%s%s" % (self.bug_server_url, attachment_id, action_param)
-
-
-class MockBuildBot(Mock):
-
-    def builder_statuses(self):
-        return [{
-            "name": "Builder1",
-            "is_green": True,
-        }, {
-            "name": "Builder2",
-            "is_green": True,
-        }]
-
-    def red_core_builders_names(self):
-        return []
-
-
-class MockSCM(Mock):
-
-    def __init__(self):
-        Mock.__init__(self)
-        self.checkout_root = os.getcwd()
-
-    def create_patch(self):
-        return "Patch1"
-
-    def commit_ids_from_commitish_arguments(self, args):
-        return ["Commitish1", "Commitish2"]
-
-    def commit_message_for_local_commit(self, commit_id):
-        if commit_id == "Commitish1":
-            return CommitMessage("CommitMessage1\n" \
-                "https://bugs.example.org/show_bug.cgi?id=42\n")
-        if commit_id == "Commitish2":
-            return CommitMessage("CommitMessage2\n" \
-                "https://bugs.example.org/show_bug.cgi?id=75\n")
-        raise Exception("Bogus commit_id in commit_message_for_local_commit.")
-
-    def create_patch_from_local_commit(self, commit_id):
-        if commit_id == "Commitish1":
-            return "Patch1"
-        if commit_id == "Commitish2":
-            return "Patch2"
-        raise Exception("Bogus commit_id in commit_message_for_local_commit.")
-
-    def diff_for_revision(self, revision):
-        return "DiffForRevision%s\n" \
-               "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision
-
-    def svn_revision_from_commit_text(self, commit_text):
-        return "49824"
-
-    def modified_changelogs(self):
-        # Ideally we'd return something more interesting here.  The problem is
-        # that LandDiff will try to actually read the path from disk!
-        return []
-
-
-class MockUser(object):
-
-    @staticmethod
-    def prompt(message, repeat=1, raw_input=raw_input):
-        return "Mock user response"
-
-    def edit(self, files):
-        pass
-
-    def page(self, message):
-        pass
-
-    def confirm(self, message=None):
-        return True
-
-    def open_url(self, url):
-        log("MOCK: user.open_url: %s" % url)
-        pass
-
-
-class MockStatusServer(object):
-
-    def __init__(self):
-        self.host = "example.com"
-
-    def patch_status(self, queue_name, patch_id):
-        return None
-
-    def update_status(self, queue_name, status, patch=None, results_file=None):
-        return 187
-
-
-class MockBugzillaTool():
-
-    def __init__(self):
-        self.bugs = MockBugzilla()
-        self.buildbot = MockBuildBot()
-        self.executive = Mock()
-        self.user = MockUser()
-        self._scm = MockSCM()
-        self.status_server = MockStatusServer()
-
-    def scm(self):
-        return self._scm
-
-    def path(self):
-        return "echo"
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool.py b/WebKitTools/Scripts/webkitpy/multicommandtool.py
deleted file mode 100644
index 10cf426..0000000
--- a/WebKitTools/Scripts/webkitpy/multicommandtool.py
+++ /dev/null
@@ -1,299 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-#
-# MultiCommandTool provides a framework for writing svn-like/git-like tools
-# which are called with the following format:
-# tool-name [global options] command-name [command options]
-
-import sys
-
-from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option
-
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import log
-
-
-class Command(object):
-    name = None
-    show_in_main_help = False
-    def __init__(self, help_text, argument_names=None, options=None, long_help=None, requires_local_commits=False):
-        self.help_text = help_text
-        self.long_help = long_help
-        self.argument_names = argument_names
-        self.required_arguments = self._parse_required_arguments(argument_names)
-        self.options = options
-        self.requires_local_commits = requires_local_commits
-        self.tool = None
-        # option_parser can be overriden by the tool using set_option_parser
-        # This default parser will be used for standalone_help printing.
-        self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
-
-    # This design is slightly awkward, but we need the
-    # the tool to be able to create and modify the option_parser
-    # before it knows what Command to run.
-    def set_option_parser(self, option_parser):
-        self.option_parser = option_parser
-        self._add_options_to_parser()
-
-    def _add_options_to_parser(self):
-        options = self.options or []
-        for option in options:
-            self.option_parser.add_option(option)
-
-    # The tool calls bind_to_tool on each Command after adding it to its list.
-    def bind_to_tool(self, tool):
-        # Command instances can only be bound to one tool at a time.
-        if self.tool and tool != self.tool:
-            raise Exception("Command already bound to tool!")
-        self.tool = tool
-
-    @staticmethod
-    def _parse_required_arguments(argument_names):
-        required_args = []
-        if not argument_names:
-            return required_args
-        split_args = argument_names.split(" ")
-        for argument in split_args:
-            if argument[0] == '[':
-                # For now our parser is rather dumb.  Do some minimal validation that
-                # we haven't confused it.
-                if argument[-1] != ']':
-                    raise Exception("Failure to parse argument string %s.  Argument %s is missing ending ]" % (argument_names, argument))
-            else:
-                required_args.append(argument)
-        return required_args
-
-    def name_with_arguments(self):
-        usage_string = self.name
-        if self.options:
-            usage_string += " [options]"
-        if self.argument_names:
-            usage_string += " " + self.argument_names
-        return usage_string
-
-    def parse_args(self, args):
-        return self.option_parser.parse_args(args)
-
-    def check_arguments_and_execute(self, options, args, tool=None):
-        if len(args) < len(self.required_arguments):
-            log("%s required, %s provided.  Provided: %s  Required: %s\nSee '%s help %s' for usage." % (
-                pluralize("argument", len(self.required_arguments)),
-                pluralize("argument", len(args)),
-                "'%s'" % " ".join(args),
-                " ".join(self.required_arguments),
-                tool.name(),
-                self.name))
-            return 1
-        return self.execute(options, args, tool) or 0
-
-    def standalone_help(self):
-        help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n\n"
-        if self.long_help:
-            help_text += "%s\n\n" % self.long_help
-        help_text += self.option_parser.format_option_help(IndentedHelpFormatter())
-        return help_text
-
-    def execute(self, options, args, tool):
-        raise NotImplementedError, "subclasses must implement"
-
-    # main() exists so that Commands can be turned into stand-alone scripts.
-    # Other parts of the code will likely require modification to work stand-alone.
-    def main(self, args=sys.argv):
-        (options, args) = self.parse_args(args)
-        # Some commands might require a dummy tool
-        return self.check_arguments_and_execute(options, args)
-
-
-# FIXME: This should just be rolled into Command.  help_text and argument_names do not need to be instance variables.
-class AbstractDeclarativeCommand(Command):
-    help_text = None
-    argument_names = None
-    long_help = None
-    def __init__(self, options=None, **kwargs):
-        Command.__init__(self, self.help_text, self.argument_names, options=options, long_help=self.long_help, **kwargs)
-
-
-class HelpPrintingOptionParser(OptionParser):
-    def __init__(self, epilog_method=None, *args, **kwargs):
-        self.epilog_method = epilog_method
-        OptionParser.__init__(self, *args, **kwargs)
-
-    def error(self, msg):
-        self.print_usage(sys.stderr)
-        error_message = "%s: error: %s\n" % (self.get_prog_name(), msg)
-        # This method is overriden to add this one line to the output:
-        error_message += "\nType \"%s --help\" to see usage.\n" % self.get_prog_name()
-        self.exit(1, error_message)
-
-    # We override format_epilog to avoid the default formatting which would paragraph-wrap the epilog
-    # and also to allow us to compute the epilog lazily instead of in the constructor (allowing it to be context sensitive).
-    def format_epilog(self, epilog):
-        if self.epilog_method:
-            return "\n%s\n" % self.epilog_method()
-        return ""
-
-
-class HelpCommand(AbstractDeclarativeCommand):
-    name = "help"
-    help_text = "Display information about this program or its subcommands"
-    argument_names = "[COMMAND]"
-
-    def __init__(self):
-        options = [
-            make_option("-a", "--all-commands", action="store_true", dest="show_all_commands", help="Print all available commands"),
-        ]
-        AbstractDeclarativeCommand.__init__(self, options)
-        self.show_all_commands = False # A hack used to pass --all-commands to _help_epilog even though it's called by the OptionParser.
-
-    def _help_epilog(self):
-        # Only show commands which are relevant to this checkout's SCM system.  Might this be confusing to some users?
-        if self.show_all_commands:
-            epilog = "All %prog commands:\n"
-            relevant_commands = self.tool.commands[:]
-        else:
-            epilog = "Common %prog commands:\n"
-            relevant_commands = filter(self.tool.should_show_in_main_help, self.tool.commands)
-        longest_name_length = max(map(lambda command: len(command.name), relevant_commands))
-        relevant_commands.sort(lambda a, b: cmp(a.name, b.name))
-        command_help_texts = map(lambda command: "   %s   %s\n" % (command.name.ljust(longest_name_length), command.help_text), relevant_commands)
-        epilog += "%s\n" % "".join(command_help_texts)
-        epilog += "See '%prog help --all-commands' to list all commands.\n"
-        epilog += "See '%prog help COMMAND' for more information on a specific command.\n"
-        return epilog.replace("%prog", self.tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
-
-    # FIXME: This is a hack so that we don't show --all-commands as a global option:
-    def _remove_help_options(self):
-        for option in self.options:
-            self.option_parser.remove_option(option.get_opt_string())
-
-    def execute(self, options, args, tool):
-        if args:
-            command = self.tool.command_by_name(args[0])
-            if command:
-                print command.standalone_help()
-                return 0
-
-        self.show_all_commands = options.show_all_commands
-        self._remove_help_options()
-        self.option_parser.print_help()
-        return 0
-
-
-class MultiCommandTool(object):
-    global_options = None
-
-    def __init__(self, name=None, commands=None):
-        self._name = name or OptionParser(prog=name).get_prog_name() # OptionParser has nice logic for fetching the name.
-        # Allow the unit tests to disable command auto-discovery.
-        self.commands = commands or [cls() for cls in self._find_all_commands() if cls.name]
-        self.help_command = self.command_by_name(HelpCommand.name)
-        # Require a help command, even if the manual test list doesn't include one.
-        if not self.help_command:
-            self.help_command = HelpCommand()
-            self.commands.append(self.help_command)
-        for command in self.commands:
-            command.bind_to_tool(self)
-
-    @classmethod
-    def _add_all_subclasses(cls, class_to_crawl, seen_classes):
-        for subclass in class_to_crawl.__subclasses__():
-            if subclass not in seen_classes:
-                seen_classes.add(subclass)
-                cls._add_all_subclasses(subclass, seen_classes)
-
-    @classmethod
-    def _find_all_commands(cls):
-        commands = set()
-        cls._add_all_subclasses(Command, commands)
-        return sorted(commands)
-
-    def name(self):
-        return self._name
-
-    def _create_option_parser(self):
-        usage = "Usage: %prog [options] COMMAND [ARGS]"
-        return HelpPrintingOptionParser(epilog_method=self.help_command._help_epilog, prog=self.name(), usage=usage)
-
-    @staticmethod
-    def _split_command_name_from_args(args):
-        # Assume the first argument which doesn't start with "-" is the command name.
-        command_index = 0
-        for arg in args:
-            if arg[0] != "-":
-                break
-            command_index += 1
-        else:
-            return (None, args[:])
-
-        command = args[command_index]
-        return (command, args[:command_index] + args[command_index + 1:])
-
-    def command_by_name(self, command_name):
-        for command in self.commands:
-            if command_name == command.name:
-                return command
-        return None
-
-    def path(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def should_show_in_main_help(self, command):
-        return command.show_in_main_help
-
-    def should_execute_command(self, command):
-        return True
-
-    def _add_global_options(self, option_parser):
-        global_options = self.global_options or []
-        for option in global_options:
-            option_parser.add_option(option)
-
-    def handle_global_options(self, options):
-        pass
-
-    def main(self, argv=sys.argv):
-        (command_name, args) = self._split_command_name_from_args(argv[1:])
-
-        option_parser = self._create_option_parser()
-        self._add_global_options(option_parser)
-
-        command = self.command_by_name(command_name) or self.help_command
-        if not command:
-            option_parser.error("%s is not a recognized command" % command_name)
-
-        command.set_option_parser(option_parser)
-        (options, args) = command.parse_args(args)
-        self.handle_global_options(options)
-
-        (should_execute, failure_reason) = self.should_execute_command(command)
-        if not should_execute:
-            log(failure_reason)
-            return 0 # FIXME: Should this really be 0?
-
-        return command.check_arguments_and_execute(options, args, self)
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py b/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
deleted file mode 100644
index ae77e73..0000000
--- a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright (c) 2009, 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.
-
-import sys
-import unittest
-from multicommandtool import MultiCommandTool, Command
-from webkitpy.outputcapture import OutputCapture
-
-from optparse import make_option
-
-class TrivialCommand(Command):
-    name = "trivial"
-    show_in_main_help = True
-    def __init__(self, **kwargs):
-        Command.__init__(self, "help text", **kwargs)
-
-    def execute(self, options, args, tool):
-        pass
-
-class UncommonCommand(TrivialCommand):
-    name = "uncommon"
-    show_in_main_help = False
-
-class CommandTest(unittest.TestCase):
-    def test_name_with_arguments(self):
-        command_with_args = TrivialCommand(argument_names="ARG1 ARG2")
-        self.assertEqual(command_with_args.name_with_arguments(), "trivial ARG1 ARG2")
-
-        command_with_args = TrivialCommand(options=[make_option("--my_option")])
-        self.assertEqual(command_with_args.name_with_arguments(), "trivial [options]")
-
-    def test_parse_required_arguments(self):
-        self.assertEqual(Command._parse_required_arguments("ARG1 ARG2"), ["ARG1", "ARG2"])
-        self.assertEqual(Command._parse_required_arguments("[ARG1] [ARG2]"), [])
-        self.assertEqual(Command._parse_required_arguments("[ARG1] ARG2"), ["ARG2"])
-        # Note: We might make our arg parsing smarter in the future and allow this type of arguments string.
-        self.assertRaises(Exception, Command._parse_required_arguments, "[ARG1 ARG2]")
-
-    def test_required_arguments(self):
-        two_required_arguments = TrivialCommand(argument_names="ARG1 ARG2 [ARG3]")
-        expected_missing_args_error = "2 arguments required, 1 argument provided.  Provided: 'foo'  Required: ARG1 ARG2\nSee 'trivial-tool help trivial' for usage.\n"
-        exit_code = OutputCapture().assert_outputs(self, two_required_arguments.check_arguments_and_execute, [None, ["foo"], TrivialTool()], expected_stderr=expected_missing_args_error)
-        self.assertEqual(exit_code, 1)
-
-
-class TrivialTool(MultiCommandTool):
-    def __init__(self, commands=None):
-        MultiCommandTool.__init__(self, name="trivial-tool", commands=commands)
-
-    def path():
-        return __file__
-
-    def should_execute_command(self, command):
-        return (True, None)
-
-
-class MultiCommandToolTest(unittest.TestCase):
-    def _assert_split(self, args, expected_split):
-        self.assertEqual(MultiCommandTool._split_command_name_from_args(args), expected_split)
-
-    def test_split_args(self):
-        # MultiCommandToolTest._split_command_name_from_args returns: (command, args)
-        full_args = ["--global-option", "command", "--option", "arg"]
-        full_args_expected = ("command", ["--global-option", "--option", "arg"])
-        self._assert_split(full_args, full_args_expected)
-
-        full_args = []
-        full_args_expected = (None, [])
-        self._assert_split(full_args, full_args_expected)
-
-        full_args = ["command", "arg"]
-        full_args_expected = ("command", ["arg"])
-        self._assert_split(full_args, full_args_expected)
-
-    def test_command_by_name(self):
-        # This also tests Command auto-discovery.
-        tool = TrivialTool()
-        self.assertEqual(tool.command_by_name("trivial").name, "trivial")
-        self.assertEqual(tool.command_by_name("bar"), None)
-
-    def _assert_tool_main_outputs(self, tool, main_args, expected_stdout, expected_stderr = "", expected_exit_code=0):
-        exit_code = OutputCapture().assert_outputs(self, tool.main, [main_args], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
-        self.assertEqual(exit_code, expected_exit_code)
-
-    def test_global_help(self):
-        tool = TrivialTool(commands=[TrivialCommand(), UncommonCommand()])
-        expected_common_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
-
-Options:
-  -h, --help  show this help message and exit
-
-Common trivial-tool commands:
-   trivial   help text
-
-See 'trivial-tool help --all-commands' to list all commands.
-See 'trivial-tool help COMMAND' for more information on a specific command.
-
-"""
-        self._assert_tool_main_outputs(tool, ["tool"], expected_common_commands_help)
-        self._assert_tool_main_outputs(tool, ["tool", "help"], expected_common_commands_help)
-        expected_all_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
-
-Options:
-  -h, --help  show this help message and exit
-
-All trivial-tool commands:
-   help       Display information about this program or its subcommands
-   trivial    help text
-   uncommon   help text
-
-See 'trivial-tool help --all-commands' to list all commands.
-See 'trivial-tool help COMMAND' for more information on a specific command.
-
-"""
-        self._assert_tool_main_outputs(tool, ["tool", "help", "--all-commands"], expected_all_commands_help)
-        # Test that arguments can be passed before commands as well
-        self._assert_tool_main_outputs(tool, ["tool", "--all-commands", "help"], expected_all_commands_help)
-
-
-    def test_command_help(self):
-        command_with_options = TrivialCommand(options=[make_option("--my_option")], long_help="LONG HELP")
-        tool = TrivialTool(commands=[command_with_options])
-        expected_subcommand_help = "trivial [options]   help text\n\nLONG HELP\n\nOptions:\n  --my_option=MY_OPTION\n\n"
-        self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help)
-
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction.py b/WebKitTools/Scripts/webkitpy/networktransaction.py
deleted file mode 100644
index 65ea27d..0000000
--- a/WebKitTools/Scripts/webkitpy/networktransaction.py
+++ /dev/null
@@ -1,63 +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.
-
-import time
-
-from mechanize import HTTPError
-from webkitpy.webkit_logging import log
-
-
-class NetworkTimeout(Exception):
-    pass
-
-
-class NetworkTransaction(object):
-    def __init__(self, initial_backoff_seconds=10, grown_factor=1.1, timeout_seconds=5*60*60):
-        self._initial_backoff_seconds = initial_backoff_seconds
-        self._grown_factor = grown_factor
-        self._timeout_seconds = timeout_seconds
-
-    def run(self, request):
-        self._total_sleep = 0
-        self._backoff_seconds = self._initial_backoff_seconds
-        while True:
-            try:
-                return request()
-            except HTTPError, e:
-                self._check_for_timeout()
-                log("Received HTTP status %s from server.  Retrying in %s seconds..." % (e.code, self._backoff_seconds))
-                self._sleep()
-
-    def _check_for_timeout(self):
-        if self._total_sleep + self._backoff_seconds > self._timeout_seconds:
-            raise NetworkTimeout()
-
-    def _sleep(self):
-        time.sleep(self._backoff_seconds)
-        self._total_sleep += self._backoff_seconds
-        self._backoff_seconds *= self._grown_factor
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py b/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
deleted file mode 100644
index 3cffe02..0000000
--- a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
+++ /dev/null
@@ -1,80 +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.
-
-import unittest
-
-from mechanize import HTTPError
-from webkitpy.networktransaction import NetworkTransaction, NetworkTimeout
-
-class NetworkTransactionTest(unittest.TestCase):
-    exception = Exception("Test exception")
-
-    def test_success(self):
-        transaction = NetworkTransaction()
-        self.assertEqual(transaction.run(lambda: 42), 42)
-
-    def _raise_exception(self):
-        raise self.exception
-
-    def test_exception(self):
-        transaction = NetworkTransaction()
-        did_process_exception = False
-        did_throw_exception = True
-        try:
-            transaction.run(lambda: self._raise_exception())
-            did_throw_exception = False
-        except Exception, e:
-            did_process_exception = True
-            self.assertEqual(e, self.exception)
-        self.assertTrue(did_throw_exception)
-        self.assertTrue(did_process_exception)
-
-    def _raise_http_error(self):
-        self._run_count += 1
-        if self._run_count < 3:
-            raise HTTPError("http://example.com/", 500, "inteneral server error", None, None)
-        return 42
-
-    def test_retry(self):
-        self._run_count = 0
-        transaction = NetworkTransaction(initial_backoff_seconds=0)
-        self.assertEqual(transaction.run(lambda: self._raise_http_error()), 42)
-        self.assertEqual(self._run_count, 3)
-
-    def test_timeout(self):
-        self._run_count = 0
-        transaction = NetworkTransaction(initial_backoff_seconds=60*60, timeout_seconds=60)
-        did_process_exception = False
-        did_throw_exception = True
-        try:
-            transaction.run(lambda: self._raise_http_error())
-            did_throw_exception = False
-        except NetworkTimeout, e:
-            did_process_exception = True
-        self.assertTrue(did_throw_exception)
-        self.assertTrue(did_process_exception)
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection.py b/WebKitTools/Scripts/webkitpy/patchcollection.py
deleted file mode 100644
index 7e8603c..0000000
--- a/WebKitTools/Scripts/webkitpy/patchcollection.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, 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.
-
-class PersistentPatchCollectionDelegate:
-    def collection_name(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def fetch_potential_patch_ids(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def status_server(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def is_terminal_status(self, status):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class PersistentPatchCollection:
-    def __init__(self, delegate):
-        self._delegate = delegate
-        self._name = self._delegate.collection_name()
-        self._status = self._delegate.status_server()
-        self._status_cache = {}
-
-    def _cached_status(self, patch_id):
-        cached = self._status_cache.get(patch_id)
-        if cached:
-            return cached
-        status = self._status.patch_status(self._name, patch_id)
-        if status and self._delegate.is_terminal_status(status):
-            self._status_cache[patch_id] = status
-        return status
-
-    def next(self):
-        patch_ids = self._delegate.fetch_potential_patch_ids()
-        for patch_id in patch_ids:
-            status = self._cached_status(patch_id)
-            if not status or not self._delegate.is_terminal_status(status):
-                return patch_id
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py b/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
deleted file mode 100644
index 811fed9..0000000
--- a/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, 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.
-
-import unittest
-
-from webkitpy.mock import Mock
-from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
-
-
-class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate):
-    def collection_name(self):
-        return "test-collection"
-
-    def fetch_potential_patch_ids(self):
-        return [42, 192, 87]
-
-    def status_server(self):
-        return Mock()
-
-    def is_terminal_status(self, status):
-        return False
-
-
-class PersistentPatchCollectionTest(unittest.TestCase):
-    def test_next(self):
-        collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate())
-        collection.next()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/python24/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/python24/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/python24/versioning.py b/WebKitTools/Scripts/webkitpy/python24/versioning.py
new file mode 100644
index 0000000..8b1f21b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/python24/versioning.py
@@ -0,0 +1,133 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Supports Python version checking."""
+
+import logging
+import sys
+
+_log = logging.getLogger("webkitpy.python24.versioning")
+
+# The minimum Python version the webkitpy package supports.
+_MINIMUM_SUPPORTED_PYTHON_VERSION = "2.5"
+
+
+def compare_version(sysmodule=None, target_version=None):
+    """Compare the current Python version with a target version.
+
+    Args:
+      sysmodule: An object with version and version_info data attributes
+                 used to detect the current Python version.  The attributes
+                 should have the same semantics as sys.version and
+                 sys.version_info.  This parameter should only be used
+                 for unit testing.  Defaults to sys.
+      target_version: A string representing the Python version to compare
+                      the current version against.  The string should have
+                      one of the following three forms: 2, 2.5, or 2.5.3.
+                      Defaults to the minimum version that the webkitpy
+                      package supports.
+
+    Returns:
+      A triple of (comparison, current_version, target_version).
+
+      comparison: An integer representing the result of comparing the
+                  current version with the target version.  A positive
+                  number means the current version is greater than the
+                  target, 0 means they are the same, and a negative number
+                  means the current version is less than the target.
+                      This method compares version information only up
+                  to the precision of the given target version.  For
+                  example, if the target version is 2.6 and the current
+                  version is 2.5.3, this method uses 2.5 for the purposes
+                  of comparing with the target.
+      current_version: A string representing the current Python version, for
+                       example 2.5.3.
+      target_version: A string representing the version that the current
+                      version was compared against, for example 2.5.
+
+    """
+    if sysmodule is None:
+        sysmodule = sys
+    if target_version is None:
+        target_version = _MINIMUM_SUPPORTED_PYTHON_VERSION
+
+    # The number of version parts to compare.
+    precision = len(target_version.split("."))
+
+    # We use sys.version_info rather than sys.version since its first
+    # three elements are guaranteed to be integers.
+    current_version_info_to_compare = sysmodule.version_info[:precision]
+    # Convert integers to strings.
+    current_version_info_to_compare = map(str, current_version_info_to_compare)
+    current_version_to_compare = ".".join(current_version_info_to_compare)
+
+    # Compare version strings lexicographically.
+    if current_version_to_compare > target_version:
+        comparison = 1
+    elif current_version_to_compare == target_version:
+        comparison = 0
+    else:
+        comparison = -1
+
+    # The version number portion of the current version string, for
+    # example "2.6.4".
+    current_version = sysmodule.version.split()[0]
+
+    return (comparison, current_version, target_version)
+
+
+# FIXME: Add a logging level parameter to allow the version message
+#        to be logged at levels other than WARNING, for example CRITICAL.
+def check_version(log=None, sysmodule=None, target_version=None):
+    """Check the current Python version against a target version.
+
+    Logs a warning message if the current version is less than the
+    target version.
+
+    Args:
+      log: A logging.logger instance to use when logging the version warning.
+           Defaults to the logger of this module.
+      sysmodule: See the compare_version() docstring.
+      target_version: See the compare_version() docstring.
+
+    Returns:
+      A boolean value of whether the current version is greater than
+      or equal to the target version.
+
+    """
+    if log is None:
+        log = _log
+
+    (comparison, current_version, target_version) = \
+        compare_version(sysmodule, target_version)
+
+    if comparison >= 0:
+        # Then the current version is at least the minimum version.
+        return True
+
+    message = ("WebKit Python scripts do not support your current Python "
+               "version (%s).  The minimum supported version is %s.\n"
+               "  See the following page to upgrade your Python version:\n\n"
+               "    http://trac.webkit.org/wiki/PythonGuidelines\n"
+               % (current_version, target_version))
+    log.warn(message)
+    return False
diff --git a/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py b/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py
new file mode 100644
index 0000000..6939e2d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py
@@ -0,0 +1,134 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Contains unit tests for versioning.py."""
+
+import logging
+import unittest
+
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.python24.versioning import check_version
+from webkitpy.python24.versioning import compare_version
+
+class MockSys(object):
+
+    """A mock sys module for passing to version-checking methods."""
+
+    def __init__(self, current_version):
+        """Create an instance.
+
+        current_version: A version string with major, minor, and micro
+                         version parts.
+
+        """
+        version_info = current_version.split(".")
+        version_info = map(int, version_info)
+
+        self.version = current_version + " Version details."
+        self.version_info = version_info
+
+
+class CompareVersionTest(unittest.TestCase):
+
+    """Tests compare_version()."""
+
+    def _mock_sys(self, current_version):
+        return MockSys(current_version)
+
+    def test_default_minimum_version(self):
+        """Test the configured minimum version that webkitpy supports."""
+        (comparison, current_version, min_version) = compare_version()
+        self.assertEquals(min_version, "2.5")
+
+    def compare_version(self, target_version, current_version=None):
+        """Call compare_version()."""
+        if current_version is None:
+            current_version = "2.5.3"
+        mock_sys = self._mock_sys(current_version)
+        return compare_version(mock_sys, target_version)
+
+    def compare(self, target_version, current_version=None):
+        """Call compare_version(), and return the comparison."""
+        return self.compare_version(target_version, current_version)[0]
+
+    def test_returned_current_version(self):
+        """Test the current_version return value."""
+        current_version = self.compare_version("2.5")[1]
+        self.assertEquals(current_version, "2.5.3")
+
+    def test_returned_target_version(self):
+        """Test the current_version return value."""
+        target_version = self.compare_version("2.5")[2]
+        self.assertEquals(target_version, "2.5")
+
+    def test_target_version_major(self):
+        """Test major version for target."""
+        self.assertEquals(-1, self.compare("3"))
+        self.assertEquals(0, self.compare("2"))
+        self.assertEquals(1, self.compare("2", "3.0.0"))
+
+    def test_target_version_minor(self):
+        """Test minor version for target."""
+        self.assertEquals(-1, self.compare("2.6"))
+        self.assertEquals(0, self.compare("2.5"))
+        self.assertEquals(1, self.compare("2.4"))
+
+    def test_target_version_micro(self):
+        """Test minor version for target."""
+        self.assertEquals(-1, self.compare("2.5.4"))
+        self.assertEquals(0, self.compare("2.5.3"))
+        self.assertEquals(1, self.compare("2.5.2"))
+
+
+class CheckVersionTest(unittest.TestCase):
+
+    """Tests check_version()."""
+
+    def setUp(self):
+        self._log = LogTesting.setUp(self)
+
+    def tearDown(self):
+        self._log.tearDown()
+
+    def _check_version(self, minimum_version):
+        """Call check_version()."""
+        mock_sys = MockSys("2.5.3")
+        return check_version(sysmodule=mock_sys, target_version=minimum_version)
+
+    def test_true_return_value(self):
+        """Test the configured minimum version that webkitpy supports."""
+        is_current = self._check_version("2.4")
+        self.assertEquals(True, is_current)
+        self._log.assertMessages([])  # No warning was logged.
+
+    def test_false_return_value(self):
+        """Test the configured minimum version that webkitpy supports."""
+        is_current = self._check_version("2.6")
+        self.assertEquals(False, is_current)
+        expected_message = ('WARNING: WebKit Python scripts do not support '
+                            'your current Python version (2.5.3).  '
+                            'The minimum supported version is 2.6.\n  '
+                            'See the following page to upgrade your Python '
+                            'version:\n\n    '
+                            'http://trac.webkit.org/wiki/PythonGuidelines\n\n')
+        self._log.assertMessages([expected_message])
+
diff --git a/WebKitTools/Scripts/webkitpy/queueengine.py b/WebKitTools/Scripts/webkitpy/queueengine.py
deleted file mode 100644
index d14177d..0000000
--- a/WebKitTools/Scripts/webkitpy/queueengine.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-
-import os
-import time
-import traceback
-
-from datetime import datetime, timedelta
-
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import log, OutputTee
-from webkitpy.statusserver import StatusServer
-
-class QueueEngineDelegate:
-    def queue_log_path(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def work_item_log_path(self, work_item):
-        raise NotImplementedError, "subclasses must implement"
-
-    def begin_work_queue(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def should_continue_work_queue(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def next_work_item(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def should_proceed_with_work_item(self, work_item):
-        # returns (safe_to_proceed, waiting_message, patch)
-        raise NotImplementedError, "subclasses must implement"
-
-    def process_work_item(self, work_item):
-        raise NotImplementedError, "subclasses must implement"
-
-    def handle_unexpected_error(self, work_item, message):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class QueueEngine:
-    def __init__(self, name, delegate):
-        self._name = name
-        self._delegate = delegate
-        self._output_tee = OutputTee()
-
-    log_date_format = "%Y-%m-%d %H:%M:%S"
-    sleep_duration_text = "5 mins"
-    seconds_to_sleep = 300
-    handled_error_code = 2
-
-    # Child processes exit with a special code to the parent queue process can detect the error was handled.
-    @classmethod
-    def exit_after_handled_error(cls, error):
-        log(error)
-        exit(cls.handled_error_code)
-
-    def run(self):
-        self._begin_logging()
-
-        self._delegate.begin_work_queue()
-        while (self._delegate.should_continue_work_queue()):
-            try:
-                self._ensure_work_log_closed()
-                work_item = self._delegate.next_work_item()
-                if not work_item:
-                    self._sleep("No work item.")
-                    continue
-                if not self._delegate.should_proceed_with_work_item(work_item):
-                    self._sleep("Not proceeding with work item.")
-                    continue
-
-                # FIXME: Work logs should not depend on bug_id specificaly.
-                #        This looks fixed, no?
-                self._open_work_log(work_item)
-                try:
-                    self._delegate.process_work_item(work_item)
-                except ScriptError, e:
-                    # Use a special exit code to indicate that the error was already
-                    # handled in the child process and we should just keep looping.
-                    if e.exit_code == self.handled_error_code:
-                        continue
-                    message = "Unexpected failure when landing patch!  Please file a bug against webkit-patch.\n%s" % e.message_with_output()
-                    self._delegate.handle_unexpected_error(work_item, message)
-            except KeyboardInterrupt, e:
-                log("\nUser terminated queue.")
-                return 1
-            except Exception, e:
-                traceback.print_exc()
-                # Don't try tell the status bot, in case telling it causes an exception.
-                self._sleep("Exception while preparing queue")
-        # Never reached.
-        self._ensure_work_log_closed()
-
-    def _begin_logging(self):
-        self._queue_log = self._output_tee.add_log(self._delegate.queue_log_path())
-        self._work_log = None
-
-    def _open_work_log(self, work_item):
-        work_item_log_path = self._delegate.work_item_log_path(work_item)
-        self._work_log = self._output_tee.add_log(work_item_log_path)
-
-    def _ensure_work_log_closed(self):
-        # If we still have a bug log open, close it.
-        if self._work_log:
-            self._output_tee.remove_log(self._work_log)
-            self._work_log = None
-
-    @classmethod
-    def _sleep_message(cls, message):
-        wake_time = datetime.now() + timedelta(seconds=cls.seconds_to_sleep)
-        return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(cls.log_date_format), cls.sleep_duration_text)
-
-    @classmethod
-    def _sleep(cls, message):
-        log(cls._sleep_message(message))
-        time.sleep(cls.seconds_to_sleep)
diff --git a/WebKitTools/Scripts/webkitpy/queueengine_unittest.py b/WebKitTools/Scripts/webkitpy/queueengine_unittest.py
deleted file mode 100644
index a4036ea..0000000
--- a/WebKitTools/Scripts/webkitpy/queueengine_unittest.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, 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.
-
-import os
-import shutil
-import tempfile
-import unittest
-
-from webkitpy.executive import ScriptError
-from webkitpy.queueengine import QueueEngine, QueueEngineDelegate
-
-class LoggingDelegate(QueueEngineDelegate):
-    def __init__(self, test):
-        self._test = test
-        self._callbacks = []
-        self._run_before = False
-
-    expected_callbacks = [
-        'queue_log_path',
-        'begin_work_queue',
-        'should_continue_work_queue',
-        'next_work_item',
-        'should_proceed_with_work_item',
-        'work_item_log_path',
-        'process_work_item',
-        'should_continue_work_queue'
-    ]
-
-    def record(self, method_name):
-        self._callbacks.append(method_name)
-
-    def queue_log_path(self):
-        self.record("queue_log_path")
-        return os.path.join(self._test.temp_dir, "queue_log_path")
-
-    def work_item_log_path(self, work_item):
-        self.record("work_item_log_path")
-        return os.path.join(self._test.temp_dir, "work_log_path", "%s.log" % work_item)
-
-    def begin_work_queue(self):
-        self.record("begin_work_queue")
-
-    def should_continue_work_queue(self):
-        self.record("should_continue_work_queue")
-        if not self._run_before:
-            self._run_before = True
-            return True
-        return False
-
-    def next_work_item(self):
-        self.record("next_work_item")
-        return "work_item"
-
-    def should_proceed_with_work_item(self, work_item):
-        self.record("should_proceed_with_work_item")
-        self._test.assertEquals(work_item, "work_item")
-        fake_patch = { 'bug_id' : 42 }
-        return (True, "waiting_message", fake_patch)
-
-    def process_work_item(self, work_item):
-        self.record("process_work_item")
-        self._test.assertEquals(work_item, "work_item")
-
-    def handle_unexpected_error(self, work_item, message):
-        self.record("handle_unexpected_error")
-        self._test.assertEquals(work_item, "work_item")
-
-
-class ThrowErrorDelegate(LoggingDelegate):
-    def __init__(self, test, error_code):
-        LoggingDelegate.__init__(self, test)
-        self.error_code = error_code
-
-    def process_work_item(self, work_item):
-        self.record("process_work_item")
-        raise ScriptError(exit_code=self.error_code)
-
-
-class NotSafeToProceedDelegate(LoggingDelegate):
-    def should_proceed_with_work_item(self, work_item):
-        self.record("should_proceed_with_work_item")
-        self._test.assertEquals(work_item, "work_item")
-        return False
-
-
-class FastQueueEngine(QueueEngine):
-    def __init__(self, delegate):
-        QueueEngine.__init__(self, "fast-queue", delegate)
-
-    # No sleep for the wicked.
-    seconds_to_sleep = 0
-
-    def _sleep(self, message):
-        pass
-
-
-class QueueEngineTest(unittest.TestCase):
-    def test_trivial(self):
-        delegate = LoggingDelegate(self)
-        work_queue = QueueEngine("trivial-queue", delegate)
-        work_queue.run()
-        self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
-        self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
-        self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
-
-    def test_unexpected_error(self):
-        delegate = ThrowErrorDelegate(self, 3)
-        work_queue = QueueEngine("error-queue", delegate)
-        work_queue.run()
-        expected_callbacks = LoggingDelegate.expected_callbacks[:]
-        work_item_index = expected_callbacks.index('process_work_item')
-        # The unexpected error should be handled right after process_work_item starts
-        # but before any other callback.  Otherwise callbacks should be normal.
-        expected_callbacks.insert(work_item_index + 1, 'handle_unexpected_error')
-        self.assertEquals(delegate._callbacks, expected_callbacks)
-
-    def test_handled_error(self):
-        delegate = ThrowErrorDelegate(self, QueueEngine.handled_error_code)
-        work_queue = QueueEngine("handled-error-queue", delegate)
-        work_queue.run()
-        self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
-
-    def test_not_safe_to_proceed(self):
-        delegate = NotSafeToProceedDelegate(self)
-        work_queue = FastQueueEngine(delegate)
-        work_queue.run()
-        expected_callbacks = LoggingDelegate.expected_callbacks[:]
-        next_work_item_index = expected_callbacks.index('next_work_item')
-        # We slice out the common part of the expected callbacks.
-        # We add 2 here to include should_proceed_with_work_item, which is
-        # a pain to search for directly because it occurs twice.
-        expected_callbacks = expected_callbacks[:next_work_item_index + 2]
-        expected_callbacks.append('should_continue_work_queue')
-        self.assertEquals(delegate._callbacks, expected_callbacks)
-
-    def setUp(self):
-        self.temp_dir = tempfile.mkdtemp(suffix="work_queue_test_logs")
-
-    def tearDown(self):
-        shutil.rmtree(self.temp_dir)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/scm.py b/WebKitTools/Scripts/webkitpy/scm.py
deleted file mode 100644
index 743f3fe..0000000
--- a/WebKitTools/Scripts/webkitpy/scm.py
+++ /dev/null
@@ -1,513 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-# 
-#     * 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.
-#
-# Python module for interacting with an SCM system (like SVN or Git)
-
-import os
-import re
-import subprocess
-
-# Import WebKit-specific modules.
-from webkitpy.changelogs import ChangeLog
-from webkitpy.executive import Executive, run_command, ScriptError
-from webkitpy.webkit_logging import error, log
-
-def detect_scm_system(path):
-    if SVN.in_working_directory(path):
-        return SVN(cwd=path)
-    
-    if Git.in_working_directory(path):
-        return Git(cwd=path)
-    
-    return None
-
-def first_non_empty_line_after_index(lines, index=0):
-    first_non_empty_line = index
-    for line in lines[index:]:
-        if re.match("^\s*$", line):
-            first_non_empty_line += 1
-        else:
-            break
-    return first_non_empty_line
-
-
-class CommitMessage:
-    def __init__(self, message):
-        self.message_lines = message[first_non_empty_line_after_index(message, 0):]
-
-    def body(self, lstrip=False):
-        lines = self.message_lines[first_non_empty_line_after_index(self.message_lines, 1):]
-        if lstrip:
-            lines = [line.lstrip() for line in lines]
-        return "\n".join(lines) + "\n"
-
-    def description(self, lstrip=False, strip_url=False):
-        line = self.message_lines[0]
-        if lstrip:
-            line = line.lstrip()
-        if strip_url:
-            line = re.sub("^(\s*)<.+> ", "\1", line)
-        return line
-
-    def message(self):
-        return "\n".join(self.message_lines) + "\n"
-
-
-class CheckoutNeedsUpdate(ScriptError):
-    def __init__(self, script_args, exit_code, output, cwd):
-        ScriptError.__init__(self, script_args=script_args, exit_code=exit_code, output=output, cwd=cwd)
-
-
-def commit_error_handler(error):
-    if re.search("resource out of date", error.output):
-        raise CheckoutNeedsUpdate(script_args=error.script_args, exit_code=error.exit_code, output=error.output, cwd=error.cwd)
-    Executive.default_error_handler(error)
-
-
-class SCM:
-    def __init__(self, cwd, dryrun=False):
-        self.cwd = cwd
-        self.checkout_root = self.find_checkout_root(self.cwd)
-        self.dryrun = dryrun
-
-    def scripts_directory(self):
-        return os.path.join(self.checkout_root, "WebKitTools", "Scripts")
-
-    def script_path(self, script_name):
-        return os.path.join(self.scripts_directory(), script_name)
-
-    def ensure_clean_working_directory(self, force_clean):
-        if not force_clean and not self.working_directory_is_clean():
-            print run_command(self.status_command(), error_handler=Executive.ignore_error)
-            raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.")
-        
-        log("Cleaning working directory")
-        self.clean_working_directory()
-    
-    def ensure_no_local_commits(self, force):
-        if not self.supports_local_commits():
-            return
-        commits = self.local_commits()
-        if not len(commits):
-            return
-        if not force:
-            error("Working directory has local commits, pass --force-clean to continue.")
-        self.discard_local_commits()
-
-    def apply_patch(self, patch, force=False):
-        # It's possible that the patch was not made from the root directory.
-        # We should detect and handle that case.
-        # FIXME: scm.py should not deal with fetching Attachment data.  Attachment should just have a .data() accessor.
-        curl_process = subprocess.Popen(['curl', '--location', '--silent', '--show-error', patch.url()], stdout=subprocess.PIPE)
-        args = [self.script_path('svn-apply')]
-        if patch.reviewer():
-            args += ['--reviewer', patch.reviewer().full_name]
-        if force:
-            args.append('--force')
-
-        run_command(args, input=curl_process.stdout)
-
-    def run_status_and_extract_filenames(self, status_command, status_regexp):
-        filenames = []
-        for line in run_command(status_command).splitlines():
-            match = re.search(status_regexp, line)
-            if not match:
-                continue
-            # status = match.group('status')
-            filename = match.group('filename')
-            filenames.append(filename)
-        return filenames
-
-    def strip_r_from_svn_revision(self, svn_revision):
-        match = re.match("^r(?P<svn_revision>\d+)", svn_revision)
-        if (match):
-            return match.group('svn_revision')
-        return svn_revision
-
-    def svn_revision_from_commit_text(self, commit_text):
-        match = re.search(self.commit_success_regexp(), commit_text, re.MULTILINE)
-        return match.group('svn_revision')
-
-    # ChangeLog-specific code doesn't really belong in scm.py, but this function is very useful.
-    def modified_changelogs(self):
-        changelog_paths = []
-        paths = self.changed_files()
-        for path in paths:
-            if os.path.basename(path) == "ChangeLog":
-                changelog_paths.append(path)
-        return changelog_paths
-
-    # FIXME: Requires unit test
-    # FIXME: commit_message_for_this_commit and modified_changelogs don't
-    #        really belong here.  We should have a separate module for
-    #        handling ChangeLogs.
-    def commit_message_for_this_commit(self):
-        changelog_paths = self.modified_changelogs()
-        if not len(changelog_paths):
-            raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
-                              "All changes require a ChangeLog.  See:\n"
-                              "http://webkit.org/coding/contributing.html")
-
-        changelog_messages = []
-        for changelog_path in changelog_paths:
-            log("Parsing ChangeLog: %s" % changelog_path)
-            changelog_entry = ChangeLog(changelog_path).latest_entry()
-            if not changelog_entry:
-                raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
-            changelog_messages.append(changelog_entry)
-
-        # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
-        return CommitMessage("".join(changelog_messages).splitlines())
-
-    @staticmethod
-    def in_working_directory(path):
-        raise NotImplementedError, "subclasses must implement"
-
-    @staticmethod
-    def find_checkout_root(path):
-        raise NotImplementedError, "subclasses must implement"
-
-    @staticmethod
-    def commit_success_regexp():
-        raise NotImplementedError, "subclasses must implement"
-
-    def working_directory_is_clean(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def clean_working_directory(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def status_command(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def changed_files(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def display_name(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def create_patch(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def diff_for_revision(self, revision):
-        raise NotImplementedError, "subclasses must implement"
-
-    def apply_reverse_diff(self, revision):
-        raise NotImplementedError, "subclasses must implement"
-
-    def revert_files(self, file_paths):
-        raise NotImplementedError, "subclasses must implement"
-
-    def commit_with_message(self, message):
-        raise NotImplementedError, "subclasses must implement"
-
-    def svn_commit_log(self, svn_revision):
-        raise NotImplementedError, "subclasses must implement"
-
-    def last_svn_commit_log(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    # Subclasses must indicate if they support local commits,
-    # but the SCM baseclass will only call local_commits methods when this is true.
-    @staticmethod
-    def supports_local_commits():
-        raise NotImplementedError, "subclasses must implement"
-
-    def create_patch_from_local_commit(self, commit_id):
-        error("Your source control manager does not support creating a patch from a local commit.")
-
-    def create_patch_since_local_commit(self, commit_id):
-        error("Your source control manager does not support creating a patch from a local commit.")
-
-    def commit_locally_with_message(self, message):
-        error("Your source control manager does not support local commits.")
-
-    def discard_local_commits(self):
-        pass
-
-    def local_commits(self):
-        return []
-
-
-class SVN(SCM):
-    def __init__(self, cwd, dryrun=False):
-        SCM.__init__(self, cwd, dryrun)
-        self.cached_version = None
-    
-    @staticmethod
-    def in_working_directory(path):
-        return os.path.isdir(os.path.join(path, '.svn'))
-    
-    @classmethod
-    def find_uuid(cls, path):
-        if not cls.in_working_directory(path):
-            return None
-        return cls.value_from_svn_info(path, 'Repository UUID')
-
-    @classmethod
-    def value_from_svn_info(cls, path, field_name):
-        svn_info_args = ['svn', 'info', path]
-        info_output = run_command(svn_info_args).rstrip()
-        match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE)
-        if not match:
-            raise ScriptError(script_args=svn_info_args, message='svn info did not contain a %s.' % field_name)
-        return match.group('value')
-
-    @staticmethod
-    def find_checkout_root(path):
-        uuid = SVN.find_uuid(path)
-        # If |path| is not in a working directory, we're supposed to return |path|.
-        if not uuid:
-            return path
-        # Search up the directory hierarchy until we find a different UUID.
-        last_path = None
-        while True:
-            if uuid != SVN.find_uuid(path):
-                return last_path
-            last_path = path
-            (path, last_component) = os.path.split(path)
-            if last_path == path:
-                return None
-
-    @staticmethod
-    def commit_success_regexp():
-        return "^Committed revision (?P<svn_revision>\d+)\.$"
-
-    def svn_version(self):
-        if not self.cached_version:
-            self.cached_version = run_command(['svn', '--version', '--quiet'])
-        
-        return self.cached_version
-
-    def working_directory_is_clean(self):
-        return run_command(['svn', 'diff']) == ""
-
-    def clean_working_directory(self):
-        run_command(['svn', 'revert', '-R', '.'])
-
-    def status_command(self):
-        return ['svn', 'status']
-
-    def changed_files(self):
-        if self.svn_version() > "1.6":
-            status_regexp = "^(?P<status>[ACDMR]).{6} (?P<filename>.+)$"
-        else:
-            status_regexp = "^(?P<status>[ACDMR]).{5} (?P<filename>.+)$"
-        return self.run_status_and_extract_filenames(self.status_command(), status_regexp)
-
-    @staticmethod
-    def supports_local_commits():
-        return False
-
-    def display_name(self):
-        return "svn"
-
-    def create_patch(self):
-        return run_command(self.script_path("svn-create-patch"), cwd=self.checkout_root, return_stderr=False)
-
-    def diff_for_revision(self, revision):
-        return run_command(['svn', 'diff', '-c', str(revision)])
-
-    def _repository_url(self):
-        return self.value_from_svn_info(self.checkout_root, 'URL')
-
-    def apply_reverse_diff(self, revision):
-        # '-c -revision' applies the inverse diff of 'revision'
-        svn_merge_args = ['svn', 'merge', '--non-interactive', '-c', '-%s' % revision, self._repository_url()]
-        log("WARNING: svn merge has been known to take more than 10 minutes to complete.  It is recommended you use git for rollouts.")
-        log("Running '%s'" % " ".join(svn_merge_args))
-        run_command(svn_merge_args)
-
-    def revert_files(self, file_paths):
-        run_command(['svn', 'revert'] + file_paths)
-
-    def commit_with_message(self, message):
-        if self.dryrun:
-            # Return a string which looks like a commit so that things which parse this output will succeed.
-            return "Dry run, no commit.\nCommitted revision 0."
-        return run_command(['svn', 'commit', '-m', message], error_handler=commit_error_handler)
-
-    def svn_commit_log(self, svn_revision):
-        svn_revision = self.strip_r_from_svn_revision(str(svn_revision))
-        return run_command(['svn', 'log', '--non-interactive', '--revision', svn_revision]);
-
-    def last_svn_commit_log(self):
-        # BASE is the checkout revision, HEAD is the remote repository revision
-        # http://svnbook.red-bean.com/en/1.0/ch03s03.html
-        return self.svn_commit_log('BASE')
-
-# All git-specific logic should go here.
-class Git(SCM):
-    def __init__(self, cwd, dryrun=False):
-        SCM.__init__(self, cwd, dryrun)
-
-    @classmethod
-    def in_working_directory(cls, path):
-        return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
-
-    @classmethod
-    def find_checkout_root(cls, path):
-        # "git rev-parse --show-cdup" would be another way to get to the root
-        (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=path))
-        # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path)
-        if not os.path.isabs(checkout_root): # Sometimes git returns relative paths
-            checkout_root = os.path.join(path, checkout_root)
-        return checkout_root
-    
-    @staticmethod
-    def commit_success_regexp():
-        return "^Committed r(?P<svn_revision>\d+)$"
-
-
-    def discard_local_commits(self):
-        run_command(['git', 'reset', '--hard', 'trunk'])
-    
-    def local_commits(self):
-        return run_command(['git', 'log', '--pretty=oneline', 'HEAD...trunk']).splitlines()
-
-    def rebase_in_progress(self):
-        return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))
-
-    def working_directory_is_clean(self):
-        return run_command(['git', 'diff-index', 'HEAD']) == ""
-
-    def clean_working_directory(self):
-        # Could run git clean here too, but that wouldn't match working_directory_is_clean
-        run_command(['git', 'reset', '--hard', 'HEAD'])
-        # Aborting rebase even though this does not match working_directory_is_clean
-        if self.rebase_in_progress():
-            run_command(['git', 'rebase', '--abort'])
-
-    def status_command(self):
-        return ['git', 'status']
-
-    def changed_files(self):
-        status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', 'HEAD']
-        status_regexp = '^(?P<status>[ADM])\t(?P<filename>.+)$'
-        return self.run_status_and_extract_filenames(status_command, status_regexp)
-    
-    @staticmethod
-    def supports_local_commits():
-        return True
-
-    def display_name(self):
-        return "git"
-
-    def create_patch(self):
-        return run_command(['git', 'diff', '--binary', 'HEAD'])
-
-    @classmethod
-    def git_commit_from_svn_revision(cls, revision):
-        # git svn find-rev always exits 0, even when the revision is not found.
-        return run_command(['git', 'svn', 'find-rev', 'r%s' % revision]).rstrip()
-
-    def diff_for_revision(self, revision):
-        git_commit = self.git_commit_from_svn_revision(revision)
-        return self.create_patch_from_local_commit(git_commit)
-
-    def apply_reverse_diff(self, revision):
-        # Assume the revision is an svn revision.
-        git_commit = self.git_commit_from_svn_revision(revision)
-        if not git_commit:
-            raise ScriptError(message='Failed to find git commit for revision %s, git svn log output: "%s"' % (revision, git_commit))
-
-        # I think this will always fail due to ChangeLogs.
-        # FIXME: We need to detec specific failure conditions and handle them.
-        run_command(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
-
-        # Fix any ChangeLogs if necessary.
-        changelog_paths = self.modified_changelogs()
-        if len(changelog_paths):
-            run_command([self.script_path('resolve-ChangeLogs')] + changelog_paths)
-
-    def revert_files(self, file_paths):
-        run_command(['git', 'checkout', 'HEAD'] + file_paths)
-
-    def commit_with_message(self, message):
-        self.commit_locally_with_message(message)
-        return self.push_local_commits_to_server()
-
-    def svn_commit_log(self, svn_revision):
-        svn_revision = self.strip_r_from_svn_revision(svn_revision)
-        return run_command(['git', 'svn', 'log', '-r', svn_revision])
-
-    def last_svn_commit_log(self):
-        return run_command(['git', 'svn', 'log', '--limit=1'])
-
-    # Git-specific methods:
-
-    def create_patch_from_local_commit(self, commit_id):
-        return run_command(['git', 'diff', '--binary', commit_id + "^.." + commit_id])
-
-    def create_patch_since_local_commit(self, commit_id):
-        return run_command(['git', 'diff', '--binary', commit_id])
-
-    def commit_locally_with_message(self, message):
-        run_command(['git', 'commit', '--all', '-F', '-'], input=message)
-        
-    def push_local_commits_to_server(self):
-        if self.dryrun:
-            # Return a string which looks like a commit so that things which parse this output will succeed.
-            return "Dry run, no remote commit.\nCommitted r0"
-        return run_command(['git', 'svn', 'dcommit'], error_handler=commit_error_handler)
-
-    # This function supports the following argument formats:
-    # no args : rev-list trunk..HEAD
-    # A..B    : rev-list A..B
-    # A...B   : error!
-    # A B     : [A, B]  (different from git diff, which would use "rev-list A..B")
-    def commit_ids_from_commitish_arguments(self, args):
-        if not len(args):
-            # FIXME: trunk is not always the remote branch name, need a way to detect the name.
-            args.append('trunk..HEAD')
-
-        commit_ids = []
-        for commitish in args:
-            if '...' in commitish:
-                raise ScriptError(message="'...' is not supported (found in '%s'). Did you mean '..'?" % commitish)
-            elif '..' in commitish:
-                commit_ids += reversed(run_command(['git', 'rev-list', commitish]).splitlines())
-            else:
-                # Turn single commits or branch or tag names into commit ids.
-                commit_ids += run_command(['git', 'rev-parse', '--revs-only', commitish]).splitlines()
-        return commit_ids
-
-    def commit_message_for_local_commit(self, commit_id):
-        commit_lines = run_command(['git', 'cat-file', 'commit', commit_id]).splitlines()
-
-        # Skip the git headers.
-        first_line_after_headers = 0
-        for line in commit_lines:
-            first_line_after_headers += 1
-            if line == "":
-                break
-        return CommitMessage(commit_lines[first_line_after_headers:])
-
-    def files_changed_summary_for_commit(self, commit_id):
-        return run_command(['git', 'diff-tree', '--shortstat', '--no-commit-id', commit_id])
diff --git a/WebKitTools/Scripts/webkitpy/scm_unittest.py b/WebKitTools/Scripts/webkitpy/scm_unittest.py
deleted file mode 100644
index 73faf40..0000000
--- a/WebKitTools/Scripts/webkitpy/scm_unittest.py
+++ /dev/null
@@ -1,595 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 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:
-#
-#    * 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.
-
-import base64
-import os
-import os.path
-import re
-import stat
-import subprocess
-import tempfile
-import unittest
-import urllib
-
-from datetime import date
-from webkitpy.executive import Executive, run_command, ScriptError
-from webkitpy.scm import detect_scm_system, SCM, CheckoutNeedsUpdate, commit_error_handler
-from webkitpy.bugzilla import Attachment # FIXME: This should not be needed
-
-# Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
-# Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
-
-# FIXME: This should be unified into one of the executive.py commands!
-def run_silent(args, cwd=None):
-    process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
-    process.communicate() # ignore output
-    exit_code = process.wait()
-    if exit_code:
-        raise ScriptError('Failed to run "%s"  exit_code: %d  cwd: %s' % (args, exit_code, cwd))
-
-def write_into_file_at_path(file_path, contents):
-    file = open(file_path, 'w')
-    file.write(contents)
-    file.close()
-
-def read_from_path(file_path):
-    file = open(file_path, 'r')
-    contents = file.read()
-    file.close()
-    return contents
-
-# Exists to share svn repository creation code between the git and svn tests
-class SVNTestRepository:
-    @staticmethod
-    def _setup_test_commits(test_object):
-        # Add some test commits
-        os.chdir(test_object.svn_checkout_path)
-        test_file = open('test_file', 'w')
-        test_file.write("test1")
-        test_file.flush()
-        
-        run_command(['svn', 'add', 'test_file'])
-        run_command(['svn', 'commit', '--quiet', '--message', 'initial commit'])
-        
-        test_file.write("test2")
-        test_file.flush()
-        
-        run_command(['svn', 'commit', '--quiet', '--message', 'second commit'])
-        
-        test_file.write("test3\n")
-        test_file.flush()
-        
-        run_command(['svn', 'commit', '--quiet', '--message', 'third commit'])
-
-        test_file.write("test4\n")
-        test_file.close()
-
-        run_command(['svn', 'commit', '--quiet', '--message', 'fourth commit'])
-
-        # svn does not seem to update after commit as I would expect.
-        run_command(['svn', 'update'])
-
-    @classmethod
-    def setup(cls, test_object):
-        # Create an test SVN repository
-        test_object.svn_repo_path = tempfile.mkdtemp(suffix="svn_test_repo")
-        test_object.svn_repo_url = "file://%s" % test_object.svn_repo_path # Not sure this will work on windows
-        # git svn complains if we don't pass --pre-1.5-compatible, not sure why:
-        # Expected FS format '2'; found format '3' at /usr/local/libexec/git-core//git-svn line 1477
-        run_command(['svnadmin', 'create', '--pre-1.5-compatible', test_object.svn_repo_path])
-
-        # Create a test svn checkout
-        test_object.svn_checkout_path = tempfile.mkdtemp(suffix="svn_test_checkout")
-        run_command(['svn', 'checkout', '--quiet', test_object.svn_repo_url, test_object.svn_checkout_path])
-
-        cls._setup_test_commits(test_object)
-
-    @classmethod
-    def tear_down(cls, test_object):
-        run_command(['rm', '-rf', test_object.svn_repo_path])
-        run_command(['rm', '-rf', test_object.svn_checkout_path])
-
-# For testing the SCM baseclass directly.
-class SCMClassTests(unittest.TestCase):
-    def setUp(self):
-        self.dev_null = open(os.devnull, "w") # Used to make our Popen calls quiet.
-
-    def tearDown(self):
-        self.dev_null.close()
-
-    def test_run_command_with_pipe(self):
-        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null)
-        self.assertEqual(run_command(['grep', 'bar'], input=input_process.stdout), "bar\n")
-
-        # Test the non-pipe case too:
-        self.assertEqual(run_command(['grep', 'bar'], input="foo\nbar"), "bar\n")
-
-        command_returns_non_zero = ['/bin/sh', '--invalid-option']
-        # Test when the input pipe process fails.
-        input_process = subprocess.Popen(command_returns_non_zero, stdout=subprocess.PIPE, stderr=self.dev_null)
-        self.assertTrue(input_process.poll() != 0)
-        self.assertRaises(ScriptError, run_command, ['grep', 'bar'], input=input_process.stdout)
-
-        # Test when the run_command process fails.
-        input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null) # grep shows usage and calls exit(2) when called w/o arguments.
-        self.assertRaises(ScriptError, run_command, command_returns_non_zero, input=input_process.stdout)
-
-    def test_error_handlers(self):
-        git_failure_message="Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
-        svn_failure_message="""svn: Commit failed (details follow):
-svn: File or directory 'ChangeLog' is out of date; try updating
-svn: resource out of date; try updating
-"""
-        command_does_not_exist = ['does_not_exist', 'invalid_option']
-        self.assertRaises(OSError, run_command, command_does_not_exist)
-        self.assertRaises(OSError, run_command, command_does_not_exist, error_handler=Executive.ignore_error)
-
-        command_returns_non_zero = ['/bin/sh', '--invalid-option']
-        self.assertRaises(ScriptError, run_command, command_returns_non_zero)
-        # Check if returns error text:
-        self.assertTrue(run_command(command_returns_non_zero, error_handler=Executive.ignore_error))
-
-        self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=git_failure_message))
-        self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=svn_failure_message))
-        self.assertRaises(ScriptError, commit_error_handler, ScriptError(output='blah blah blah'))
-
-
-# GitTest and SVNTest inherit from this so any test_ methods here will be run once for this class and then once for each subclass.
-class SCMTest(unittest.TestCase):
-    def _create_patch(self, patch_contents):
-        patch_path = os.path.join(self.svn_checkout_path, 'patch.diff')
-        write_into_file_at_path(patch_path, patch_contents)
-        patch = {}
-        patch['reviewer'] = 'Joe Cool'
-        patch['bug_id'] = '12345'
-        patch['url'] = 'file://%s' % urllib.pathname2url(patch_path)
-        return Attachment(patch, None) # FIXME: This is a hack, scm.py shouldn't be fetching attachment data.
-
-    def _setup_webkittools_scripts_symlink(self, local_scm):
-        webkit_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
-        webkit_scripts_directory = webkit_scm.scripts_directory()
-        local_scripts_directory = local_scm.scripts_directory()
-        os.mkdir(os.path.dirname(local_scripts_directory))
-        os.symlink(webkit_scripts_directory, local_scripts_directory)
-
-    # Tests which both GitTest and SVNTest should run.
-    # FIXME: There must be a simpler way to add these w/o adding a wrapper method to both subclasses
-    def _shared_test_commit_with_message(self):
-        write_into_file_at_path('test_file', 'more test content')
-        commit_text = self.scm.commit_with_message('another test commit')
-        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '5')
-
-        self.scm.dryrun = True
-        write_into_file_at_path('test_file', 'still more test content')
-        commit_text = self.scm.commit_with_message('yet another test commit')
-        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
-
-    def _shared_test_reverse_diff(self):
-        self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs
-        # Only test the simple case, as any other will end up with conflict markers.
-        self.scm.apply_reverse_diff('4')
-        self.assertEqual(read_from_path('test_file'), "test1test2test3\n")
-
-    def _shared_test_diff_for_revision(self):
-        # Patch formats are slightly different between svn and git, so just regexp for things we know should be there.
-        r3_patch = self.scm.diff_for_revision(3)
-        self.assertTrue(re.search('test3', r3_patch))
-        self.assertFalse(re.search('test4', r3_patch))
-        self.assertTrue(re.search('test2', r3_patch))
-        self.assertTrue(re.search('test2', self.scm.diff_for_revision(2)))
-
-    def _shared_test_svn_apply_git_patch(self):
-        self._setup_webkittools_scripts_symlink(self.scm)
-        git_binary_addition = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-new file mode 100644
-index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d90
-60151690
-GIT binary patch
-literal 512
-zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
-zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
-zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
-zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
-zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
-zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
-zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
-z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
-z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
-ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
-
-literal 0
-HcmV?d00001
-
-"""
-        self.scm.apply_patch(self._create_patch(git_binary_addition))
-        added = read_from_path('fizzbuzz7.gif')
-        self.assertEqual(512, len(added))
-        self.assertTrue(added.startswith('GIF89a'))
-        self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
-
-        # The file already exists.
-        self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_addition))
-
-        git_binary_modification = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-index 64a9532e7794fcd791f6f12157406d9060151690..323fae03f4606ea9991df8befbb2fca7
-GIT binary patch
-literal 7
-OcmYex&reD$;sO8*F9L)B
-
-literal 512
-zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
-zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
-zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
-zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
-zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
-zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
-zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
-z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
-z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
-ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
-
-"""
-        self.scm.apply_patch(self._create_patch(git_binary_modification))
-        modified = read_from_path('fizzbuzz7.gif')
-        self.assertEqual('foobar\n', modified)
-        self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
-
-        # Applying the same modification should fail.
-        self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_modification))
-
-        git_binary_deletion = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-deleted file mode 100644
-index 323fae0..0000000
-GIT binary patch
-literal 0
-HcmV?d00001
-
-literal 7
-OcmYex&reD$;sO8*F9L)B
-
-"""
-        self.scm.apply_patch(self._create_patch(git_binary_deletion))
-        self.assertFalse(os.path.exists('fizzbuzz7.gif'))
-        self.assertFalse('fizzbuzz7.gif' in self.scm.changed_files())
-
-        # Cannot delete again.
-        self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_deletion))
-
-
-class SVNTest(SCMTest):
-
-    @staticmethod
-    def _set_date_and_reviewer(changelog_entry):
-        # Joe Cool matches the reviewer set in SCMTest._create_patch
-        changelog_entry = changelog_entry.replace('REVIEWER_HERE', 'Joe Cool')
-        # svn-apply will update ChangeLog entries with today's date.
-        return changelog_entry.replace('DATE_HERE', date.today().isoformat())
-
-    def test_svn_apply(self):
-        first_entry = """2009-10-26  Eric Seidel  <eric@webkit.org>
-
-        Reviewed by Foo Bar.
-
-        Most awesome change ever.
-
-        * scm_unittest.py:
-"""
-        intermediate_entry = """2009-10-27  Eric Seidel  <eric@webkit.org>
-
-        Reviewed by Baz Bar.
-
-        A more awesomer change yet!
-
-        * scm_unittest.py:
-"""
-        one_line_overlap_patch = """Index: ChangeLog
-===================================================================
---- ChangeLog	(revision 5)
-+++ ChangeLog	(working copy)
-@@ -1,5 +1,13 @@
- 2009-10-26  Eric Seidel  <eric@webkit.org>
-
-+        Reviewed by NOBODY (OOPS!).
-+
-+        Second most awsome change ever.
-+
-+        * scm_unittest.py:
-+
-+2009-10-26  Eric Seidel  <eric@webkit.org>
-+
-         Reviewed by Foo Bar.
-
-         Most awesome change ever.
-"""
-        one_line_overlap_entry = """DATE_HERE  Eric Seidel  <eric@webkit.org>
-
-        Reviewed by REVIEWER_HERE.
-
-        Second most awsome change ever.
-
-        * scm_unittest.py:
-"""
-        two_line_overlap_patch = """Index: ChangeLog
-===================================================================
---- ChangeLog	(revision 5)
-+++ ChangeLog	(working copy)
-@@ -2,6 +2,14 @@
-
-         Reviewed by Foo Bar.
-
-+        Second most awsome change ever.
-+
-+        * scm_unittest.py:
-+
-+2009-10-26  Eric Seidel  <eric@webkit.org>
-+
-+        Reviewed by Foo Bar.
-+
-         Most awesome change ever.
-
-         * scm_unittest.py:
-"""
-        two_line_overlap_entry = """DATE_HERE  Eric Seidel  <eric@webkit.org>
-
-        Reviewed by Foo Bar.
-
-        Second most awsome change ever.
-
-        * scm_unittest.py:
-"""
-        write_into_file_at_path('ChangeLog', first_entry)
-        run_command(['svn', 'add', 'ChangeLog'])
-        run_command(['svn', 'commit', '--quiet', '--message', 'ChangeLog commit'])
-
-        # Patch files were created against just 'first_entry'.
-        # Add a second commit to make svn-apply have to apply the patches with fuzz.
-        changelog_contents = "%s\n%s" % (intermediate_entry, first_entry)
-        write_into_file_at_path('ChangeLog', changelog_contents)
-        run_command(['svn', 'commit', '--quiet', '--message', 'Intermediate commit'])
-
-        self._setup_webkittools_scripts_symlink(self.scm)
-        self.scm.apply_patch(self._create_patch(one_line_overlap_patch))
-        expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(one_line_overlap_entry), changelog_contents)
-        self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
-
-        self.scm.revert_files(['ChangeLog'])
-        self.scm.apply_patch(self._create_patch(two_line_overlap_patch))
-        expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(two_line_overlap_entry), changelog_contents)
-        self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
-
-    def setUp(self):
-        SVNTestRepository.setup(self)
-        os.chdir(self.svn_checkout_path)
-        self.scm = detect_scm_system(self.svn_checkout_path)
-
-    def tearDown(self):
-        SVNTestRepository.tear_down(self)
-
-    def test_create_patch_is_full_patch(self):
-        test_dir_path = os.path.join(self.svn_checkout_path, 'test_dir')
-        os.mkdir(test_dir_path)
-        test_file_path = os.path.join(test_dir_path, 'test_file2')
-        write_into_file_at_path(test_file_path, 'test content')
-        run_command(['svn', 'add', 'test_dir'])
-
-        # create_patch depends on 'svn-create-patch', so make a dummy version.
-        scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
-        os.makedirs(scripts_path)
-        create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
-        write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
-        os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
-
-        # Change into our test directory and run the create_patch command.
-        os.chdir(test_dir_path)
-        scm = detect_scm_system(test_dir_path)
-        self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
-        patch_contents = scm.create_patch()
-        # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
-        self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
-
-    def test_detection(self):
-        scm = detect_scm_system(self.svn_checkout_path)
-        self.assertEqual(scm.display_name(), "svn")
-        self.assertEqual(scm.supports_local_commits(), False)
-
-    def test_apply_small_binary_patch(self):
-        patch_contents = """Index: test_file.swf
-===================================================================
-Cannot display: file marked as a binary type.
-svn:mime-type = application/octet-stream
-
-Property changes on: test_file.swf
-___________________________________________________________________
-Name: svn:mime-type
-   + application/octet-stream
-
-
-Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
-"""
-        expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==")
-        self._setup_webkittools_scripts_symlink(self.scm)
-        patch_file = self._create_patch(patch_contents)
-        self.scm.apply_patch(patch_file)
-        actual_contents = read_from_path("test_file.swf")
-        self.assertEqual(actual_contents, expected_contents)
-
-    def test_apply_svn_patch(self):
-        scm = detect_scm_system(self.svn_checkout_path)
-        patch = self._create_patch(run_command(['svn', 'diff', '-r4:3']))
-        self._setup_webkittools_scripts_symlink(scm)
-        scm.apply_patch(patch)
-
-    def test_apply_svn_patch_force(self):
-        scm = detect_scm_system(self.svn_checkout_path)
-        patch = self._create_patch(run_command(['svn', 'diff', '-r2:4']))
-        self._setup_webkittools_scripts_symlink(scm)
-        self.assertRaises(ScriptError, scm.apply_patch, patch, force=True)
-
-    def test_commit_logs(self):
-        # Commits have dates and usernames in them, so we can't just direct compare.
-        self.assertTrue(re.search('fourth commit', self.scm.last_svn_commit_log()))
-        self.assertTrue(re.search('second commit', self.scm.svn_commit_log(2)))
-
-    def test_commit_text_parsing(self):
-        self._shared_test_commit_with_message()
-
-    def test_reverse_diff(self):
-        self._shared_test_reverse_diff()
-
-    def test_diff_for_revision(self):
-        self._shared_test_diff_for_revision()
-
-    def test_svn_apply_git_patch(self):
-        self._shared_test_svn_apply_git_patch()
-
-class GitTest(SCMTest):
-
-    def _setup_git_clone_of_svn_repository(self):
-        self.git_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout")
-        # --quiet doesn't make git svn silent, so we use run_silent to redirect output
-        run_silent(['git', 'svn', '--quiet', 'clone', self.svn_repo_url, self.git_checkout_path])
-
-    def _tear_down_git_clone_of_svn_repository(self):
-        run_command(['rm', '-rf', self.git_checkout_path])
-
-    def setUp(self):
-        SVNTestRepository.setup(self)
-        self._setup_git_clone_of_svn_repository()
-        os.chdir(self.git_checkout_path)
-        self.scm = detect_scm_system(self.git_checkout_path)
-
-    def tearDown(self):
-        SVNTestRepository.tear_down(self)
-        self._tear_down_git_clone_of_svn_repository()
-
-    def test_detection(self):
-        scm = detect_scm_system(self.git_checkout_path)
-        self.assertEqual(scm.display_name(), "git")
-        self.assertEqual(scm.supports_local_commits(), True)
-
-    def test_rebase_in_progress(self):
-        svn_test_file = os.path.join(self.svn_checkout_path, 'test_file')
-        write_into_file_at_path(svn_test_file, "svn_checkout")
-        run_command(['svn', 'commit', '--message', 'commit to conflict with git commit'], cwd=self.svn_checkout_path)
-
-        git_test_file = os.path.join(self.git_checkout_path, 'test_file')
-        write_into_file_at_path(git_test_file, "git_checkout")
-        run_command(['git', 'commit', '-a', '-m', 'commit to be thrown away by rebase abort'])
-
-        # --quiet doesn't make git svn silent, so use run_silent to redirect output
-        self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase']) # Will fail due to a conflict leaving us mid-rebase.
-
-        scm = detect_scm_system(self.git_checkout_path)
-        self.assertTrue(scm.rebase_in_progress())
-
-        # Make sure our cleanup works.
-        scm.clean_working_directory()
-        self.assertFalse(scm.rebase_in_progress())
-
-        # Make sure cleanup doesn't throw when no rebase is in progress.
-        scm.clean_working_directory()
-
-    def test_commitish_parsing(self):
-        scm = detect_scm_system(self.git_checkout_path)
-    
-        # Multiple revisions are cherry-picked.
-        self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD~2'])), 1)
-        self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD', 'HEAD~2'])), 2)
-    
-        # ... is an invalid range specifier
-        self.assertRaises(ScriptError, scm.commit_ids_from_commitish_arguments, ['trunk...HEAD'])
-
-    def test_commitish_order(self):
-        scm = detect_scm_system(self.git_checkout_path)
-
-        commit_range = 'HEAD~3..HEAD'
-
-        actual_commits = scm.commit_ids_from_commitish_arguments([commit_range])
-        expected_commits = []
-        expected_commits += reversed(run_command(['git', 'rev-list', commit_range]).splitlines())
-
-        self.assertEqual(actual_commits, expected_commits)
-
-    def test_apply_git_patch(self):
-        scm = detect_scm_system(self.git_checkout_path)
-        patch = self._create_patch(run_command(['git', 'diff', 'HEAD..HEAD^']))
-        self._setup_webkittools_scripts_symlink(scm)
-        scm.apply_patch(patch)
-
-    def test_apply_git_patch_force(self):
-        scm = detect_scm_system(self.git_checkout_path)
-        patch = self._create_patch(run_command(['git', 'diff', 'HEAD~2..HEAD']))
-        self._setup_webkittools_scripts_symlink(scm)
-        self.assertRaises(ScriptError, scm.apply_patch, patch, force=True)
-
-    def test_commit_text_parsing(self):
-        self._shared_test_commit_with_message()
-
-    def test_reverse_diff(self):
-        self._shared_test_reverse_diff()
-
-    def test_diff_for_revision(self):
-        self._shared_test_diff_for_revision()
-
-    def test_svn_apply_git_patch(self):
-        self._shared_test_svn_apply_git_patch()
-
-    def test_create_binary_patch(self):
-        # Create a git binary patch and check the contents.
-        scm = detect_scm_system(self.git_checkout_path)
-        test_file_name = 'binary_file'
-        test_file_path = os.path.join(self.git_checkout_path, test_file_name)
-        file_contents = ''.join(map(chr, range(256)))
-        write_into_file_at_path(test_file_path, file_contents)
-        run_command(['git', 'add', test_file_name])
-        patch = scm.create_patch()
-        self.assertTrue(re.search(r'\nliteral 0\n', patch))
-        self.assertTrue(re.search(r'\nliteral 256\n', patch))
-
-        # Check if we can apply the created patch.
-        run_command(['git', 'rm', '-f', test_file_name])
-        self._setup_webkittools_scripts_symlink(scm)
-        self.scm.apply_patch(self._create_patch(patch))
-        self.assertEqual(file_contents, read_from_path(test_file_path))
-
-        # Check if we can create a patch from a local commit.
-        write_into_file_at_path(test_file_path, file_contents)
-        run_command(['git', 'add', test_file_name])
-        run_command(['git', 'commit', '-m', 'binary diff'])
-        patch_from_local_commit = scm.create_patch_from_local_commit('HEAD')
-        self.assertTrue(re.search(r'\nliteral 0\n', patch_from_local_commit))
-        self.assertTrue(re.search(r'\nliteral 256\n', patch_from_local_commit))
-        patch_since_local_commit = scm.create_patch_since_local_commit('HEAD^1')
-        self.assertTrue(re.search(r'\nliteral 0\n', patch_since_local_commit))
-        self.assertTrue(re.search(r'\nliteral 256\n', patch_since_local_commit))
-        self.assertEqual(patch_from_local_commit, patch_since_local_commit)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/statusserver.py b/WebKitTools/Scripts/webkitpy/statusserver.py
deleted file mode 100644
index ff0ddfa..0000000
--- a/WebKitTools/Scripts/webkitpy/statusserver.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (C) 2009 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.
-
-from webkitpy.networktransaction import NetworkTransaction
-from webkitpy.webkit_logging import log
-from mechanize import Browser
-
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup
-
-import urllib2
-
-
-class StatusServer:
-    default_host = "webkit-commit-queue.appspot.com"
-
-    def __init__(self, host=default_host):
-        self.set_host(host)
-        self.browser = Browser()
-
-    def set_host(self, host):
-        self.host = host
-        self.url = "http://%s" % self.host
-
-    def results_url_for_status(self, status_id):
-        return "%s/results/%s" % (self.url, status_id)
-
-    def _add_patch(self, patch):
-        if not patch:
-            return
-        if patch.bug_id():
-            self.browser["bug_id"] = str(patch.bug_id())
-        if patch.id():
-            self.browser["patch_id"] = str(patch.id())
-
-    def _add_results_file(self, results_file):
-        if not results_file:
-            return
-        self.browser.add_file(results_file, "text/plain", "results.txt", 'results_file')
-
-    def _post_to_server(self, queue_name, status, patch, results_file):
-        if results_file:
-            # We might need to re-wind the file if we've already tried to post it.
-            results_file.seek(0)
-
-        update_status_url = "%s/update-status" % self.url
-        self.browser.open(update_status_url)
-        self.browser.select_form(name="update_status")
-        self.browser['queue_name'] = queue_name
-        self._add_patch(patch)
-        self.browser['status'] = status
-        self._add_results_file(results_file)
-        return self.browser.submit().read() # This is the id of the newly created status object.
-
-    def update_status(self, queue_name, status, patch=None, results_file=None):
-        # During unit testing, host is None
-        if not self.host:
-            return
-
-        log(status)
-        return NetworkTransaction().run(lambda: self._post_to_server(queue_name, status, patch, results_file))
-
-    def patch_status(self, queue_name, patch_id):
-        update_status_url = "%s/patch-status/%s/%s" % (self.url, queue_name, patch_id)
-        try:
-            return urllib2.urlopen(update_status_url).read()
-        except urllib2.HTTPError, e:
-            if e.code == 404:
-                return None
-            raise e
diff --git a/WebKitTools/Scripts/webkitpy/steps/__init__.py b/WebKitTools/Scripts/webkitpy/steps/__init__.py
deleted file mode 100644
index 5ae4bea..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/__init__.py
+++ /dev/null
@@ -1,56 +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.
-
-# FIXME: Is this the right way to do this?
-from webkitpy.steps.applypatch import ApplyPatch
-from webkitpy.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
-from webkitpy.steps.build import Build
-from webkitpy.steps.checkstyle import CheckStyle
-from webkitpy.steps.cleanworkingdirectory import CleanWorkingDirectory
-from webkitpy.steps.cleanworkingdirectorywithlocalcommits import CleanWorkingDirectoryWithLocalCommits
-from webkitpy.steps.closebug import CloseBug
-from webkitpy.steps.closebugforlanddiff import CloseBugForLandDiff
-from webkitpy.steps.closepatch import ClosePatch
-from webkitpy.steps.commit import Commit
-from webkitpy.steps.completerollout import CompleteRollout
-from webkitpy.steps.confirmdiff import ConfirmDiff
-from webkitpy.steps.createbug import CreateBug
-from webkitpy.steps.editchangelog import EditChangeLog
-from webkitpy.steps.ensurebuildersaregreen import EnsureBuildersAreGreen
-from webkitpy.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
-from webkitpy.steps.obsoletepatches import ObsoletePatches
-from webkitpy.steps.options import Options
-from webkitpy.steps.postdiff import PostDiff
-from webkitpy.steps.postdiffforcommit import PostDiffForCommit
-from webkitpy.steps.preparechangelogforrevert import PrepareChangeLogForRevert
-from webkitpy.steps.preparechangelog import PrepareChangeLog
-from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
-from webkitpy.steps.revertrevision import RevertRevision
-from webkitpy.steps.runtests import RunTests
-from webkitpy.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
-from webkitpy.steps.update import Update
diff --git a/WebKitTools/Scripts/webkitpy/steps/abstractstep.py b/WebKitTools/Scripts/webkitpy/steps/abstractstep.py
deleted file mode 100644
index 639cf55..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/abstractstep.py
+++ /dev/null
@@ -1,69 +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.
-
-from webkitpy.webkit_logging import log
-from webkitpy.webkitport import WebKitPort
-
-
-class AbstractStep(object):
-    def __init__(self, tool, options):
-        self._tool = tool
-        self._options = options
-        self._port = None
-
-    def _run_script(self, script_name, quiet=False, port=WebKitPort):
-        log("Running %s" % script_name)
-        # FIXME: This should use self.port()
-        self._tool.executive.run_and_throw_if_fail(port.script_path(script_name), quiet)
-
-    # FIXME: The port should live on the tool.
-    def port(self):
-        if self._port:
-            return self._port
-        self._port = WebKitPort.port(self._options.port)
-        return self._port
-
-    _well_known_keys = {
-        "diff" : lambda self: self._tool.scm().create_patch(),
-        "changelogs" : lambda self: self._tool.scm().modified_changelogs(),
-    }
-
-    def cached_lookup(self, state, key, promise=None):
-        if state.get(key):
-            return state[key]
-        if not promise:
-            promise = self._well_known_keys.get(key)
-        state[key] = promise(self)
-        return state[key]
-
-    @classmethod
-    def options(cls):
-        return []
-
-    def run(self, state):
-        raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatch.py b/WebKitTools/Scripts/webkitpy/steps/applypatch.py
deleted file mode 100644
index aba81ae..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/applypatch.py
+++ /dev/null
@@ -1,42 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-class ApplyPatch(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.non_interactive,
-        ]
-
-    def run(self, state):
-        log("Processing patch %s from bug %s." % (state["patch"].id(), state["patch"].bug_id()))
-        self._tool.scm().apply_patch(state["patch"], force=self._options.non_interactive)
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py b/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py
deleted file mode 100644
index bfaf52a..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py
+++ /dev/null
@@ -1,43 +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.
-
-from webkitpy.steps.applypatch import ApplyPatch
-from webkitpy.steps.options import Options
-
-class ApplyPatchWithLocalCommit(ApplyPatch):
-    @classmethod
-    def options(cls):
-        return [
-            Options.local_commit,
-        ] + ApplyPatch.options()
-
-    def run(self, state):
-        ApplyPatch.run(self, state)
-        if self._options.local_commit:
-            commit_message = self._tool.scm().commit_message_for_this_commit()
-            self._tool.scm().commit_locally_with_message(commit_message.message() or state["patch"].name())
diff --git a/WebKitTools/Scripts/webkitpy/steps/build.py b/WebKitTools/Scripts/webkitpy/steps/build.py
deleted file mode 100644
index 1823cff..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/build.py
+++ /dev/null
@@ -1,54 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class Build(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.build,
-            Options.quiet,
-            Options.build_style,
-        ]
-
-    def build(self, build_style):
-        self._tool.executive.run_and_throw_if_fail(self.port().build_webkit_command(build_style=build_style), self._options.quiet)
-
-    def run(self, state):
-        if not self._options.build:
-            return
-        log("Building WebKit")
-        if self._options.build_style == "both":
-            self.build("debug")
-            self.build("release")
-        else:
-            self.build(self._options.build_style)
diff --git a/WebKitTools/Scripts/webkitpy/steps/checkstyle.py b/WebKitTools/Scripts/webkitpy/steps/checkstyle.py
deleted file mode 100644
index c8e20f8..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/checkstyle.py
+++ /dev/null
@@ -1,56 +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.
-
-import os
-
-from webkitpy.executive import ScriptError
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
-
-class CheckStyle(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.non_interactive,
-            Options.check_style,
-        ]
-
-    def run(self, state):
-        if not self._options.check_style:
-            return
-        os.chdir(self._tool.scm().checkout_root)
-        try:
-            self._run_script("check-webkit-style")
-        except ScriptError, e:
-            if self._options.non_interactive:
-                # We need to re-raise the exception here to have the
-                # style-queue do the right thing.
-                raise e
-            if not self._tool.user.confirm("Are you sure you want to continue?"):
-                exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py b/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py
deleted file mode 100644
index 88e38f5..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py
+++ /dev/null
@@ -1,52 +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.
-
-import os
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-
-
-class CleanWorkingDirectory(AbstractStep):
-    def __init__(self, tool, options, allow_local_commits=False):
-        AbstractStep.__init__(self, tool, options)
-        self._allow_local_commits = allow_local_commits
-
-    @classmethod
-    def options(cls):
-        return [
-            Options.force_clean,
-            Options.clean,
-        ]
-
-    def run(self, state):
-        os.chdir(self._tool.scm().checkout_root)
-        if not self._allow_local_commits:
-            self._tool.scm().ensure_no_local_commits(self._options.force_clean)
-        if self._options.clean:
-            self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean)
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py b/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py
deleted file mode 100644
index cabeba2..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py
+++ /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.
-#     * 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.
-
-from webkitpy.steps.cleanworkingdirectory import CleanWorkingDirectory
-
-class CleanWorkingDirectoryWithLocalCommits(CleanWorkingDirectory):
-    def __init__(self, tool, options):
-        # FIXME: This a bit of a hack.  Consider doing this more cleanly.
-        CleanWorkingDirectory.__init__(self, tool, options, allow_local_commits=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebug.py b/WebKitTools/Scripts/webkitpy/steps/closebug.py
deleted file mode 100644
index 2640ee3..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closebug.py
+++ /dev/null
@@ -1,51 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class CloseBug(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.close_bug,
-        ]
-
-    def run(self, state):
-        if not self._options.close_bug:
-            return
-        # Check to make sure there are no r? or r+ patches on the bug before closing.
-        # Assume that r- patches are just previous patches someone forgot to obsolete.
-        patches = self._tool.bugs.fetch_bug(state["patch"].bug_id()).patches()
-        for patch in patches:
-            if patch.review() == "?" or patch.review() == "+":
-                log("Not closing bug %s as attachment %s has review=%s.  Assuming there are more patches to land from this bug." % (patch.bug_id(), patch.id(), patch.review()))
-                return
-        self._tool.bugs.close_bug_as_fixed(state["patch"].bug_id(), "All reviewed patches have been landed.  Closing bug.")
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py b/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py
deleted file mode 100644
index 43a0c66..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py
+++ /dev/null
@@ -1,58 +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.
-
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class CloseBugForLandDiff(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.close_bug,
-        ]
-
-    def run(self, state):
-        comment_text = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
-        bug_id = state.get("bug_id")
-        if not bug_id and state.get("patch"):
-            bug_id = state.get("patch").bug_id()
-
-        if bug_id:
-            log("Updating bug %s" % bug_id)
-            if self._options.close_bug:
-                self._tool.bugs.close_bug_as_fixed(bug_id, comment_text)
-            else:
-                # FIXME: We should a smart way to figure out if the patch is attached
-                # to the bug, and if so obsolete it.
-                self._tool.bugs.post_comment_to_bug(bug_id, comment_text)
-        else:
-            log(comment_text)
-            log("No bug id provided.")
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py b/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py
deleted file mode 100644
index 73561ab..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.steps.closebugforlanddiff import CloseBugForLandDiff
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-class CloseBugForLandDiffTest(unittest.TestCase):
-    def test_empty_state(self):
-        capture = OutputCapture()
-        step = CloseBugForLandDiff(MockBugzillaTool(), Mock())
-        expected_stderr = "Committed r49824: <http://trac.webkit.org/changeset/49824>\nNo bug id provided.\n"
-        capture.assert_outputs(self, step.run, [{"commit_text" : "Mock commit text"}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/steps/closepatch.py b/WebKitTools/Scripts/webkitpy/steps/closepatch.py
deleted file mode 100644
index f20fe7e..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closepatch.py
+++ /dev/null
@@ -1,36 +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.
-
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class ClosePatch(AbstractStep):
-    def run(self, state):
-        comment_text = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
-        self._tool.bugs.clear_attachment_flags(state["patch"].id(), comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/steps/commit.py b/WebKitTools/Scripts/webkitpy/steps/commit.py
deleted file mode 100644
index dd1fed7..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/commit.py
+++ /dev/null
@@ -1,35 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class Commit(AbstractStep):
-    def run(self, state):
-        commit_message = self._tool.scm().commit_message_for_this_commit()
-        state["commit_text"] =  self._tool.scm().commit_with_message(commit_message.message())
diff --git a/WebKitTools/Scripts/webkitpy/steps/completerollout.py b/WebKitTools/Scripts/webkitpy/steps/completerollout.py
deleted file mode 100644
index 8534956..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/completerollout.py
+++ /dev/null
@@ -1,66 +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.
-
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.build import Build
-from webkitpy.steps.commit import Commit
-from webkitpy.steps.metastep import MetaStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class CompleteRollout(MetaStep):
-    substeps = [
-        Build,
-        Commit,
-    ]
-
-    @classmethod
-    def options(cls):
-        collected_options = cls._collect_options_from_steps(cls.substeps)
-        collected_options.append(Options.complete_rollout)
-        return collected_options
-
-    def run(self, state):
-        bug_id = state["bug_id"]
-        # FIXME: Fully automated rollout is not 100% idiot-proof yet, so for now just log with instructions on how to complete the rollout.
-        # Once we trust rollout we will remove this option.
-        if not self._options.complete_rollout:
-            log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land %s\" to commit the rollout." % bug_id)
-            return
-
-        MetaStep.run(self, state)
-
-        commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
-        comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
-
-        if not bug_id:
-            log(comment_text)
-            log("No bugs were updated.")
-            return
-        self._tool.bugs.reopen_bug(bug_id, comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.py b/WebKitTools/Scripts/webkitpy/steps/confirmdiff.py
deleted file mode 100644
index fc28f8f..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.py
+++ /dev/null
@@ -1,47 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
-
-
-class ConfirmDiff(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.confirm,
-        ]
-
-    def run(self, state):
-        if not self._options.confirm:
-            return
-        diff = self.cached_lookup(state, "diff")
-        self._tool.user.page(diff)
-        if not self._tool.user.confirm("Was that diff correct?"):
-            exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/steps/createbug.py b/WebKitTools/Scripts/webkitpy/steps/createbug.py
deleted file mode 100644
index 75bf17f..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/createbug.py
+++ /dev/null
@@ -1,45 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-
-
-class CreateBug(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.cc,
-            Options.component,
-        ]
-
-    def run(self, state):
-        # No need to create a bug if we already have one.
-        if state.get("bug_id"):
-            return
-        state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], component=self._options.component, cc=self._options.cc)
diff --git a/WebKitTools/Scripts/webkitpy/steps/editchangelog.py b/WebKitTools/Scripts/webkitpy/steps/editchangelog.py
deleted file mode 100644
index d545c72..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/editchangelog.py
+++ /dev/null
@@ -1,37 +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.
-
-import os
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class EditChangeLog(AbstractStep):
-    def run(self, state):
-        os.chdir(self._tool.scm().checkout_root)
-        self._tool.user.edit(self.cached_lookup(state, "changelogs"))
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py b/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py
deleted file mode 100644
index 96f265a..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py
+++ /dev/null
@@ -1,48 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
-
-
-class EnsureBuildersAreGreen(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.check_builders,
-        ]
-
-    def run(self, state):
-        if not self._options.check_builders:
-            return
-        red_builders_names = self._tool.buildbot.red_core_builders_names()
-        if not red_builders_names:
-            return
-        red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
-        error("Builders [%s] are red, please do not commit.\nSee http://%s.\nPass --ignore-builders to bypass this check." % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host))
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py b/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py
deleted file mode 100644
index cecf891..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py
+++ /dev/null
@@ -1,43 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
-
-
-class EnsureLocalCommitIfNeeded(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.local_commit,
-        ]
-
-    def run(self, state):
-        if self._options.local_commit and not self._tool.scm().supports_local_commits():
-            error("--local-commit passed, but %s does not support local commits" % self._tool.scm.display_name())
diff --git a/WebKitTools/Scripts/webkitpy/steps/metastep.py b/WebKitTools/Scripts/webkitpy/steps/metastep.py
deleted file mode 100644
index 9f368de..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/metastep.py
+++ /dev/null
@@ -1,54 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-# FIXME: Unify with StepSequence?  I'm not sure yet which is the better design.
-class MetaStep(AbstractStep):
-    substeps = [] # Override in subclasses
-    def __init__(self, tool, options):
-        AbstractStep.__init__(self, tool, options)
-        self._step_instances = []
-        for step_class in self.substeps:
-            self._step_instances.append(step_class(tool, options))
-
-    @staticmethod
-    def _collect_options_from_steps(steps):
-        collected_options = []
-        for step in steps:
-            collected_options = collected_options + step.options()
-        return collected_options
-
-    @classmethod
-    def options(cls):
-        return cls._collect_options_from_steps(cls.substeps)
-
-    def run(self, state):
-        for step in self._step_instances:
-             step.run(state)
diff --git a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py b/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py
deleted file mode 100644
index dbdbabd..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py
+++ /dev/null
@@ -1,51 +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.
-
-from webkitpy.grammar import pluralize
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class ObsoletePatches(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.obsolete_patches,
-        ]
-
-    def run(self, state):
-        if not self._options.obsolete_patches:
-            return
-        bug_id = state["bug_id"]
-        patches = self._tool.bugs.fetch_bug(bug_id).patches()
-        if not patches:
-            return
-        log("Obsoleting %s on bug %s" % (pluralize("old patch", len(patches)), bug_id))
-        for patch in patches:
-            self._tool.bugs.obsolete_attachment(patch.id())
diff --git a/WebKitTools/Scripts/webkitpy/steps/options.py b/WebKitTools/Scripts/webkitpy/steps/options.py
deleted file mode 100644
index 8b28f27..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/options.py
+++ /dev/null
@@ -1,56 +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.
-
-from optparse import make_option
-
-class Options(object):
-    build = make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test.")
-    build_style = make_option("--build-style", action="store", dest="build_style", default=None, help="Whether to build debug, release, or both.")
-    cc = make_option("--cc", action="store", type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
-    check_builders = make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing.")
-    check_style = make_option("--ignore-style", action="store_false", dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
-    clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
-    close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
-    complete_rollout = make_option("--complete-rollout", action="store_true", dest="complete_rollout", help="Commit the revert and re-open the original bug.")
-    component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
-    confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
-    description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
-    email = make_option("--email", action="store", type="string", dest="email", help="Email address to use in ChangeLogs.")
-    force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
-    local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
-    non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.")
-    obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
-    open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
-    parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
-    port = make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...).")
-    quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
-    request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
-    review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
-    reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
-    test = make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests.")
-    update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.")
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiff.py b/WebKitTools/Scripts/webkitpy/steps/postdiff.py
deleted file mode 100644
index a5ba2a4..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/postdiff.py
+++ /dev/null
@@ -1,51 +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.
-
-import StringIO
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-
-
-class PostDiff(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.description,
-            Options.review,
-            Options.request_commit,
-            Options.open_bug,
-        ]
-
-    def run(self, state):
-        diff = self.cached_lookup(state, "diff")
-        diff_file = StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
-        description = self._options.description or "Patch"
-        self._tool.bugs.add_patch_to_bug(state["bug_id"], diff_file, description, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
-        if self._options.open_bug:
-            self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(state["bug_id"]))
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py b/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py
deleted file mode 100644
index 449381c..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py
+++ /dev/null
@@ -1,41 +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.
-
-import StringIO
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class PostDiffForCommit(AbstractStep):
-    def run(self, state):
-        self._tool.bugs.add_patch_to_bug(
-            state["bug_id"],
-            StringIO.StringIO(self.cached_lookup(state, "diff")),
-            "Patch for landing",
-            mark_for_review=False,
-            mark_for_landing=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/steps/preparechangelog.py
deleted file mode 100644
index bd41f0b..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.py
+++ /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.
-#     * 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.
-
-import os
-
-from webkitpy.executive import ScriptError
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
-
-
-class PrepareChangeLog(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.port,
-            Options.quiet,
-            Options.email,
-        ]
-
-    def run(self, state):
-        if self.cached_lookup(state, "changelogs"):
-            return
-        os.chdir(self._tool.scm().checkout_root)
-        args = [self.port().script_path("prepare-ChangeLog")]
-        if state["bug_id"]:
-            args.append("--bug=%s" % state["bug_id"])
-        if self._options.email:
-            args.append("--email=%s" % self._options.email)
-        try:
-            self._tool.executive.run_and_throw_if_fail(args, self._options.quiet)
-        except ScriptError, e:
-            error("Unable to prepare ChangeLogs.")
-        state["diff"] = None # We've changed the diff
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py b/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
deleted file mode 100644
index 88e5134..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
+++ /dev/null
@@ -1,49 +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.
-
-import os
-
-from webkitpy.changelogs import ChangeLog
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class PrepareChangeLogForRevert(AbstractStep):
-    def run(self, state):
-        # First, discard the ChangeLog changes from the rollout.
-        os.chdir(self._tool.scm().checkout_root)
-        changelog_paths = self._tool.scm().modified_changelogs()
-        self._tool.scm().revert_files(changelog_paths)
-
-        # Second, make new ChangeLog entries for this rollout.
-        # This could move to prepare-ChangeLog by adding a --revert= option.
-        self._run_script("prepare-ChangeLog")
-        bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
-        for changelog_path in changelog_paths:
-            # FIXME: Seems we should prepare the message outside of changelogs.py and then just pass in
-            # text that we want to use to replace the reviewed by line.
-            ChangeLog(changelog_path).update_for_revert(state["revision"], state["reason"], bug_url)
diff --git a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py b/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py
deleted file mode 100644
index fb2f877..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py
+++ /dev/null
@@ -1,45 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class PromptForBugOrTitle(AbstractStep):
-    def run(self, state):
-        # No need to prompt if we alrady have the bug_id.
-        if state.get("bug_id"):
-            return
-        user_response = self._tool.user.prompt("Please enter a bug number or a title for a new bug:\n")
-        # If the user responds with a number, we assume it's bug number.
-        # Otherwise we assume it's a bug subject.
-        try:
-            state["bug_id"] = int(user_response)
-        except ValueError, TypeError:
-            state["bug_title"] = user_response
-            # FIXME: This is kind of a lame description.
-            state["bug_description"] = user_response
diff --git a/WebKitTools/Scripts/webkitpy/steps/revertrevision.py b/WebKitTools/Scripts/webkitpy/steps/revertrevision.py
deleted file mode 100644
index ce6c263..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/revertrevision.py
+++ /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.
-#     * 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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-
-
-class RevertRevision(AbstractStep):
-    def run(self, state):
-        self._tool.scm().apply_reverse_diff(state["revision"])
diff --git a/WebKitTools/Scripts/webkitpy/steps/runtests.py b/WebKitTools/Scripts/webkitpy/steps/runtests.py
deleted file mode 100644
index ebe809f..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/runtests.py
+++ /dev/null
@@ -1,66 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-class RunTests(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.build,
-            Options.test,
-            Options.non_interactive,
-            Options.quiet,
-            Options.port,
-        ]
-
-    def run(self, state):
-        if not self._options.build:
-            return
-        if not self._options.test:
-            return
-
-        # Run the scripting unit tests first because they're quickest.
-        log("Running Python unit tests")
-        self._tool.executive.run_and_throw_if_fail(self.port().run_python_unittests_command())
-        log("Running Perl unit tests")
-        self._tool.executive.run_and_throw_if_fail(self.port().run_perl_unittests_command())
-        log("Running JavaScriptCore tests")
-        self._tool.executive.run_and_throw_if_fail(self.port().run_javascriptcore_tests_command(), quiet=True)
-
-        log("Running run-webkit-tests")
-        args = self.port().run_webkit_tests_command()
-        if self._options.non_interactive:
-            args.append("--no-launch-safari")
-            args.append("--exit-after-n-failures=1")
-        if self._options.quiet:
-            args.append("--quiet")
-        self._tool.executive.run_and_throw_if_fail(args)
-
diff --git a/WebKitTools/Scripts/webkitpy/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/steps/steps_unittest.py
deleted file mode 100644
index 3e6a032..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/steps_unittest.py
+++ /dev/null
@@ -1,56 +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.
-
-import unittest
-
-from webkitpy.steps.update import Update
-from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
-
-
-class StepsTest(unittest.TestCase):
-    def _run_step(self, step, tool=None, options=None, state=None):
-        if not tool:
-            tool = MockBugzillaTool()
-        if not options:
-            options = Mock()
-        if not state:
-            state = {}
-        step(tool, options).run(state)
-
-    def test_update_step(self):
-        options = Mock()
-        options.update = True
-        self._run_step(Update, options)
-
-    def test_prompt_for_bug_or_title_step(self):
-        tool = MockBugzillaTool()
-        tool.user.prompt = lambda message: 42
-        self._run_step(PromptForBugOrTitle, tool=tool)
diff --git a/WebKitTools/Scripts/webkitpy/steps/update.py b/WebKitTools/Scripts/webkitpy/steps/update.py
deleted file mode 100644
index 0f45671..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/update.py
+++ /dev/null
@@ -1,46 +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.
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class Update(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.update,
-            Options.port,
-        ]
-
-    def run(self, state):
-        if not self._options.update:
-            return
-        log("Updating working directory")
-        self._tool.executive.run_and_throw_if_fail(self.port().update_webkit_command(), quiet=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py b/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py
deleted file mode 100644
index 102a454..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2009 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.
-
-import unittest
-
-from webkitpy.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-class UpdateChangeLogsWithReviewerTest(unittest.TestCase):
-    def test_guess_reviewer_from_bug(self):
-        capture = OutputCapture()
-        step = UpdateChangeLogsWithReviewer(MockBugzillaTool(), Mock())
-        expected_stderr = "0 reviewed patches on bug 75, cannot infer reviewer.\n"
-        capture.assert_outputs(self, step._guess_reviewer_from_bug, [75], expected_stderr=expected_stderr)
-
-    def test_empty_state(self):
-        capture = OutputCapture()
-        step = UpdateChangeLogsWithReviewer(MockBugzillaTool(), Mock())
-        capture.assert_outputs(self, step.run, [{}])
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py b/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
deleted file mode 100644
index 90fdc35..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
+++ /dev/null
@@ -1,71 +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.
-
-import os
-
-from webkitpy.changelogs import ChangeLog
-from webkitpy.grammar import pluralize
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log, error
-
-class UpdateChangeLogsWithReviewer(AbstractStep):
-    @classmethod
-    def options(cls):
-        return [
-            Options.reviewer,
-        ]
-
-    def _guess_reviewer_from_bug(self, bug_id):
-        patches = self._tool.bugs.fetch_bug(bug_id).reviewed_patches()
-        if len(patches) != 1:
-            log("%s on bug %s, cannot infer reviewer." % (pluralize("reviewed patch", len(patches)), bug_id))
-            return None
-        patch = patches[0]
-        log("Guessing \"%s\" as reviewer from attachment %s on bug %s." % (patch.reviewer().full_name, patch.id(), bug_id))
-        return patch.reviewer().full_name
-
-    def run(self, state):
-        bug_id = state.get("bug_id")
-        if not bug_id and state.get("patch"):
-            bug_id = state.get("patch").bug_id()
-
-        reviewer = self._options.reviewer
-        if not reviewer:
-            if not bug_id:
-                log("No bug id provided and --reviewer= not provided.  Not updating ChangeLogs with reviewer.")
-                return
-            reviewer = self._guess_reviewer_from_bug(bug_id)
-
-        if not reviewer:
-            log("Failed to guess reviewer from bug %s and --reviewer= not provided.  Not updating ChangeLogs with reviewer." % bug_id)
-            return
-
-        os.chdir(self._tool.scm().checkout_root)
-        for changelog_path in self._tool.scm().modified_changelogs():
-            ChangeLog(changelog_path).set_reviewer(reviewer)
diff --git a/WebKitTools/Scripts/webkitpy/stepsequence.py b/WebKitTools/Scripts/webkitpy/stepsequence.py
deleted file mode 100644
index 008b366..0000000
--- a/WebKitTools/Scripts/webkitpy/stepsequence.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright (C) 2009 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.
-
-import webkitpy.steps as steps
-
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import log
-from webkitpy.scm import CheckoutNeedsUpdate
-from webkitpy.queueengine import QueueEngine
-
-
-class StepSequenceErrorHandler():
-    @classmethod
-    def handle_script_error(cls, tool, patch, script_error):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class StepSequence(object):
-    def __init__(self, steps):
-        self._steps = steps or []
-
-    def options(self):
-        collected_options = [
-            steps.Options.parent_command,
-            steps.Options.quiet,
-        ]
-        for step in self._steps:
-            collected_options = collected_options + step.options()
-        # Remove duplicates.
-        collected_options = sorted(set(collected_options))
-        return collected_options
-
-    def _run(self, tool, options, state):
-        for step in self._steps:
-            step(tool, options).run(state)
-
-    def run_and_handle_errors(self, tool, options, state=None):
-        if not state:
-            state = {}
-        try:
-            self._run(tool, options, state)
-        except CheckoutNeedsUpdate, e:
-            log("Commit failed because the checkout is out of date.  Please update and try again.")
-            log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.")
-            QueueEngine.exit_after_handled_error(e)
-        except ScriptError, e:
-            if not options.quiet:
-                log(e.message_with_output())
-            if options.parent_command:
-                command = tool.command_by_name(options.parent_command)
-                command.handle_script_error(tool, state, e)
-            QueueEngine.exit_after_handled_error(e)
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index 9beda9e..84ae3da 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -1,5 +1,6 @@
 # Copyright (C) 2009 Google Inc. All rights reserved.
 # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) 2010 ProFUSION embedded systems
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -30,23 +31,26 @@
 """Front end of some style-checker modules."""
 
 import codecs
+import logging
 import os.path
 import sys
 
-from .. style_references import parse_patch
 from error_handlers import DefaultStyleErrorHandler
-from error_handlers import PatchStyleErrorHandler
 from filter import FilterConfiguration
 from optparser import ArgumentParser
 from optparser import DefaultCommandOptionValues
-from processors.common import check_no_carriage_return
 from processors.common import categories as CommonCategories
+from processors.common import CarriageReturnProcessor
 from processors.cpp import CppProcessor
+from processors.python import PythonProcessor
 from processors.text import TextProcessor
+from webkitpy.style_references import parse_patch
+from webkitpy.style_references import configure_logging as _configure_logging
 
+_log = logging.getLogger("webkitpy.style.checker")
 
 # These are default option values for the command-line option parser.
-_DEFAULT_VERBOSITY = 1
+_DEFAULT_MIN_CONFIDENCE = 1
 _DEFAULT_OUTPUT_FORMAT = 'emacs'
 
 
@@ -85,6 +89,16 @@
     '-whitespace/blank_line',
     '-whitespace/end_of_line',
     '-whitespace/labels',
+    # List Python pep8 categories last.
+    #
+    # Because much of WebKit's Python code base does not abide by the
+    # PEP8 79 character limit, we ignore the 79-character-limit category
+    # pep8/E501 for now.
+    #
+    # FIXME: Consider bringing WebKit's Python code base into conformance
+    #        with the 79 character limit, or some higher limit that is
+    #        agreeable to the WebKit project.
+    '-pep8/E501',
     ]
 
 
@@ -106,9 +120,10 @@
       "WebKit/qt/QGVLauncher/"],
      ["-build/include",
       "-readability/streams"]),
-    ([# The GTK+ APIs use GTK+ naming style, which includes
-      # lower-cased, underscore-separated values.
-      "WebKit/gtk/webkit/",
+    ([# The EFL APIs use EFL naming style, which includes
+      # both lower-cased and camel-cased, underscore-sparated
+      # values.
+      "WebKit/efl/ewk/",
       # There is no clean way to avoid "yy_*" names used by flex.
       "WebCore/css/CSSParser.cpp",
       # There is no clean way to avoid "xxx_data" methods inside
@@ -117,6 +132,29 @@
       "WebKit/qt/tests/",
       "JavaScriptCore/qt/tests"],
      ["-readability/naming"]),
+    ([# The GTK+ APIs use GTK+ naming style, which includes
+      # lower-cased, underscore-separated values.
+      # Also, GTK+ allows the use of NULL.
+      "WebKit/gtk/webkit/",
+      "WebKitTools/DumpRenderTree/gtk/"],
+     ["-readability/naming",
+      "-readability/null"]),
+    ([# Header files in ForwardingHeaders have no header guards or
+      # exceptional header guards (e.g., WebCore_FWD_Debugger_h).
+      "/ForwardingHeaders/"],
+     ["-build/header_guard"]),
+
+    # For third-party Python code, keep only the following checks--
+    #
+    #   No tabs: to avoid having to set the SVN allow-tabs property.
+    #   No trailing white space: since this is easy to correct.
+    #   No carriage-return line endings: since this is easy to correct.
+    #
+    (["webkitpy/thirdparty/"],
+     ["-",
+      "+pep8/W191",  # Tabs
+      "+pep8/W291",  # Trailing white space
+      "+whitespace/carriage_return"]),
 ]
 
 
@@ -140,7 +178,8 @@
 # Don't include a warning for skipped files that are more common
 # and more obvious.
 _SKIPPED_FILES_WITHOUT_WARNING = [
-    "LayoutTests/"
+    "LayoutTests/",
+    ".pyc",
     ]
 
 
@@ -154,13 +193,22 @@
 def _all_categories():
     """Return the set of all categories used by check-webkit-style."""
     # Take the union across all processors.
-    return CommonCategories.union(CppProcessor.categories)
+    categories = CommonCategories.union(CppProcessor.categories)
+
+    # FIXME: Consider adding all of the pep8 categories.  Since they
+    #        are not too meaningful for documentation purposes, for
+    #        now we add only the categories needed for the unit tests
+    #        (which validate the consistency of the configuration
+    #        settings against the known categories, etc).
+    categories = categories.union(["pep8/W191", "pep8/W291", "pep8/E501"])
+
+    return categories
 
 
 def _check_webkit_style_defaults():
     """Return the default command-line options for check-webkit-style."""
-    return DefaultCommandOptionValues(output_format=_DEFAULT_OUTPUT_FORMAT,
-                                      verbosity=_DEFAULT_VERBOSITY)
+    return DefaultCommandOptionValues(min_confidence=_DEFAULT_MIN_CONFIDENCE,
+                                      output_format=_DEFAULT_OUTPUT_FORMAT)
 
 
 # This function assists in optparser not having to import from checker.
@@ -186,9 +234,97 @@
 
     return StyleCheckerConfiguration(filter_configuration=filter_configuration,
                max_reports_per_category=_MAX_REPORTS_PER_CATEGORY,
+               min_confidence=options.min_confidence,
                output_format=options.output_format,
-               stderr_write=sys.stderr.write,
-               verbosity=options.verbosity)
+               stderr_write=sys.stderr.write)
+
+
+def _create_log_handlers(stream):
+    """Create and return a default list of logging.Handler instances.
+
+    Format WARNING messages and above to display the logging level, and
+    messages strictly below WARNING not to display it.
+
+    Args:
+      stream: See the configure_logging() docstring.
+
+    """
+    # Handles logging.WARNING and above.
+    error_handler = logging.StreamHandler(stream)
+    error_handler.setLevel(logging.WARNING)
+    formatter = logging.Formatter("%(levelname)s: %(message)s")
+    error_handler.setFormatter(formatter)
+
+    # Create a logging.Filter instance that only accepts messages
+    # below WARNING (i.e. filters out anything WARNING or above).
+    non_error_filter = logging.Filter()
+    # The filter method accepts a logging.LogRecord instance.
+    non_error_filter.filter = lambda record: record.levelno < logging.WARNING
+
+    non_error_handler = logging.StreamHandler(stream)
+    non_error_handler.addFilter(non_error_filter)
+    formatter = logging.Formatter("%(message)s")
+    non_error_handler.setFormatter(formatter)
+
+    return [error_handler, non_error_handler]
+
+
+def _create_debug_log_handlers(stream):
+    """Create and return a list of logging.Handler instances for debugging.
+
+    Args:
+      stream: See the configure_logging() docstring.
+
+    """
+    handler = logging.StreamHandler(stream)
+    formatter = logging.Formatter("%(name)s: %(levelname)-8s %(message)s")
+    handler.setFormatter(formatter)
+
+    return [handler]
+
+
+def configure_logging(stream, logger=None, is_verbose=False):
+    """Configure logging, and return the list of handlers added.
+
+    Returns:
+      A list of references to the logging handlers added to the root
+      logger.  This allows the caller to later remove the handlers
+      using logger.removeHandler.  This is useful primarily during unit
+      testing where the caller may want to configure logging temporarily
+      and then undo the configuring.
+
+    Args:
+      stream: A file-like object to which to log.  The stream must
+              define an "encoding" data attribute, or else logging
+              raises an error.
+      logger: A logging.logger instance to configure.  This parameter
+              should be used only in unit tests.  Defaults to the
+              root logger.
+      is_verbose: A boolean value of whether logging should be verbose.
+
+    """
+    # If the stream does not define an "encoding" data attribute, the
+    # logging module can throw an error like the following:
+    #
+    # Traceback (most recent call last):
+    #   File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
+    #         lib/python2.6/logging/__init__.py", line 761, in emit
+    #     self.stream.write(fs % msg.encode(self.stream.encoding))
+    # LookupError: unknown encoding: unknown
+    if logger is None:
+        logger = logging.getLogger()
+
+    if is_verbose:
+        logging_level = logging.DEBUG
+        handlers = _create_debug_log_handlers(stream)
+    else:
+        logging_level = logging.INFO
+        handlers = _create_log_handlers(stream)
+
+    handlers = _configure_logging(logging_level=logging_level, logger=logger,
+                                  handlers=handlers)
+
+    return handlers
 
 
 # Enum-like idiom
@@ -197,7 +333,8 @@
     NONE = 1
     # Alphabetize remaining types
     CPP = 2
-    TEXT = 3
+    PYTHON = 3
+    TEXT = 4
 
 
 class ProcessorDispatcher(object):
@@ -218,7 +355,6 @@
         'mm',
         'php',
         'pm',
-        'py',
         'txt',
         )
 
@@ -252,20 +388,26 @@
             # reading from stdin, cpp_style tests should not rely on
             # the extension.
             return FileType.CPP
-        elif ("ChangeLog" in file_path
-              or "WebKitTools/Scripts/" in file_path
-              or file_extension in self.text_file_extensions):
+        elif file_extension == "py":
+            return FileType.PYTHON
+        elif ("ChangeLog" in file_path or
+              (not file_extension and "WebKitTools/Scripts/" in file_path) or
+              file_extension in self.text_file_extensions):
             return FileType.TEXT
         else:
             return FileType.NONE
 
-    def _create_processor(self, file_type, file_path, handle_style_error, verbosity):
+    def _create_processor(self, file_type, file_path, handle_style_error,
+                          min_confidence):
         """Instantiate and return a style processor based on file type."""
         if file_type == FileType.NONE:
             processor = None
         elif file_type == FileType.CPP:
             file_extension = self._file_extension(file_path)
-            processor = CppProcessor(file_path, file_extension, handle_style_error, verbosity)
+            processor = CppProcessor(file_path, file_extension,
+                                     handle_style_error, min_confidence)
+        elif file_type == FileType.PYTHON:
+            processor = PythonProcessor(file_path, handle_style_error)
         elif file_type == FileType.TEXT:
             processor = TextProcessor(file_path, handle_style_error)
         else:
@@ -278,39 +420,41 @@
 
         return processor
 
-    def dispatch_processor(self, file_path, handle_style_error, verbosity):
+    def dispatch_processor(self, file_path, handle_style_error, min_confidence):
         """Instantiate and return a style processor based on file path."""
         file_type = self._file_type(file_path)
 
         processor = self._create_processor(file_type,
                                            file_path,
                                            handle_style_error,
-                                           verbosity)
+                                           min_confidence)
         return processor
 
 
+# FIXME: Remove the stderr_write attribute from this class and replace
+#        its use with calls to a logging module logger.
 class StyleCheckerConfiguration(object):
 
     """Stores configuration values for the StyleChecker class.
 
     Attributes:
+      min_confidence: An integer between 1 and 5 inclusive that is the
+                      minimum confidence level of style errors to report.
+
       max_reports_per_category: The maximum number of errors to report
                                 per category, per file.
 
       stderr_write: A function that takes a string as a parameter and
                     serves as stderr.write.
 
-      verbosity: An integer between 1-5 inclusive that restricts output
-                 to errors with a confidence score at or above this value.
-
     """
 
     def __init__(self,
                  filter_configuration,
                  max_reports_per_category,
+                 min_confidence,
                  output_format,
-                 stderr_write,
-                 verbosity):
+                 stderr_write):
         """Create a StyleCheckerConfiguration instance.
 
         Args:
@@ -321,6 +465,10 @@
           max_reports_per_category: The maximum number of errors to report
                                     per category, per file.
 
+          min_confidence: An integer between 1 and 5 inclusive that is the
+                          minimum confidence level of style errors to report.
+                          The default is 1, which reports all style errors.
+
           output_format: A string that is the output format.  The supported
                          output formats are "emacs" which emacs can parse
                          and "vs7" which Microsoft Visual Studio 7 can parse.
@@ -328,42 +476,37 @@
           stderr_write: A function that takes a string as a parameter and
                         serves as stderr.write.
 
-          verbosity: An integer between 1-5 inclusive that restricts output
-                     to errors with a confidence score at or above this value.
-                     The default is 1, which reports all errors.
-
         """
         self._filter_configuration = filter_configuration
         self._output_format = output_format
 
         self.max_reports_per_category = max_reports_per_category
+        self.min_confidence = min_confidence
         self.stderr_write = stderr_write
-        self.verbosity = verbosity
 
     def is_reportable(self, category, confidence_in_error, file_path):
         """Return whether an error is reportable.
 
         An error is reportable if both the confidence in the error is
-        at least the current verbosity level and the current filter
+        at least the minimum confidence level and the current filter
         says the category should be checked for the given path.
 
         Args:
           category: A string that is a style category.
-          confidence_in_error: An integer between 1 and 5, inclusive, that
-                               represents the application's confidence in
-                               the error.  A higher number signifies greater
-                               confidence.
+          confidence_in_error: An integer between 1 and 5 inclusive that is
+                               the application's confidence in the error.
+                               A higher number means greater confidence.
           file_path: The path of the file being checked
 
         """
-        if confidence_in_error < self.verbosity:
+        if confidence_in_error < self.min_confidence:
             return False
 
         return self._filter_configuration.should_check(category, file_path)
 
     def write_style_error(self,
                           category,
-                          confidence,
+                          confidence_in_error,
                           file_path,
                           line_number,
                           message):
@@ -377,9 +520,38 @@
                                            line_number,
                                            message,
                                            category,
-                                           confidence))
+                                           confidence_in_error))
 
 
+class ProcessorBase(object):
+
+    """The base class for processors of lists of lines."""
+
+    def should_process(self, file_path):
+        """Return whether the file at file_path should be processed."""
+        raise NotImplementedError('Subclasses should implement.')
+
+    def process(self, lines, file_path, **kwargs):
+        """Process lines of text read from a file.
+
+        Args:
+          lines: A list of lines of text to process.
+          file_path: The path from which the lines were read.
+          **kwargs: This argument signifies that the process() method of
+                    subclasses of ProcessorBase may support additional
+                    keyword arguments.
+                        For example, a style processor's process() method
+                    may support a "reportable_lines" parameter that represents
+                    the line numbers of the lines for which style errors
+                    should be reported.
+
+        """
+        raise NotImplementedError('Subclasses should implement.')
+
+
+# FIXME: Modify this class to start using the TextFileReader class in
+#        webkitpy/style/filereader.py.  This probably means creating
+#        a StyleProcessor class that inherits from ProcessorBase.
 class StyleChecker(object):
 
     """Supports checking style in files and patches.
@@ -406,79 +578,142 @@
         self.error_count = 0
         self.file_count = 0
 
-    def _stderr_write(self, message):
-        self._configuration.stderr_write(message)
-
     def _increment_error_count(self):
         """Increment the total count of reported errors."""
         self.error_count += 1
 
-    def _process_file(self, processor, file_path, handle_style_error):
-        """Process the file using the given processor."""
-        try:
-            # Support the UNIX convention of using "-" for stdin.  Note that
-            # we are not opening the file with universal newline support
-            # (which codecs doesn't support anyway), so the resulting lines do
-            # contain trailing '\r' characters if we are reading a file that
-            # has CRLF endings.
-            # If after the split a trailing '\r' is present, it is removed
-            # below. If it is not expected to be present (i.e. os.linesep !=
-            # '\r\n' as in Windows), a warning is issued below if this file
-            # is processed.
-            if file_path == '-':
-                file = codecs.StreamReaderWriter(sys.stdin,
-                                                 codecs.getreader('utf8'),
-                                                 codecs.getwriter('utf8'),
-                                                 'replace')
-            else:
-                file = codecs.open(file_path, 'r', 'utf8', 'replace')
+    def _read_lines(self, file_path):
+        """Read the file at a path, and return its lines.
 
-            contents = file.read()
+        Raises:
+          IOError: if the file does not exist or cannot be read.
 
-        except IOError:
-            self._stderr_write("Skipping input '%s': Can't open for reading\n" % file_path)
-            return
+        """
+        # Support the UNIX convention of using "-" for stdin.
+        if file_path == '-':
+            file = codecs.StreamReaderWriter(sys.stdin,
+                                             codecs.getreader('utf8'),
+                                             codecs.getwriter('utf8'),
+                                             'replace')
+        else:
+            # We do not open the file with universal newline support
+            # (codecs does not support it anyway), so the resulting
+            # lines contain trailing "\r" characters if we are reading
+            # a file with CRLF endings.
+            file = codecs.open(file_path, 'r', 'utf8', 'replace')
+
+        contents = file.read()
 
         lines = contents.split("\n")
+        return lines
 
-        for line_number in range(len(lines)):
-            # FIXME: We should probably use the SVN "eol-style" property
-            #        or a white list to decide whether or not to do
-            #        the carriage-return check. Originally, we did the
-            #        check only if (os.linesep != '\r\n').
-            #
-            # FIXME: As a minor optimization, we can have
-            #        check_no_carriage_return() return whether
-            #        the line ends with "\r".
-            check_no_carriage_return(lines[line_number], line_number,
-                                     handle_style_error)
-            if lines[line_number].endswith("\r"):
-                lines[line_number] = lines[line_number].rstrip("\r")
+    def _process_file(self, processor, file_path, handle_style_error):
+        """Process the file using the given style processor."""
+        try:
+            lines = self._read_lines(file_path)
+        except IOError:
+            message = 'Could not read file. Skipping: "%s"' % file_path
+            _log.warn(message)
+            return
+
+        # Check for and remove trailing carriage returns ("\r").
+        #
+        # FIXME: We should probably use the SVN "eol-style" property
+        #        or a white list to decide whether or not to do
+        #        the carriage-return check. Originally, we did the
+        #        check only if (os.linesep != '\r\n').
+        carriage_return_processor = CarriageReturnProcessor(handle_style_error)
+        lines = carriage_return_processor.process(lines)
 
         processor.process(lines)
 
-    def check_file(self, file_path, handle_style_error=None, process_file=None):
+    def check_paths(self, paths, mock_check_file=None, mock_os=None):
+        """Check style in the given files or directories.
+
+        Args:
+          paths: A list of file paths and directory paths.
+          mock_check_file: A mock of self.check_file for unit testing.
+          mock_os: A mock os for unit testing.
+
+        """
+        check_file = self.check_file if mock_check_file is None else \
+                     mock_check_file
+        os_module = os if mock_os is None else mock_os
+
+        for path in paths:
+            if os_module.path.isdir(path):
+                self._check_directory(directory=path,
+                                      check_file=check_file,
+                                      mock_os_walk=os_module.walk)
+            else:
+                check_file(path)
+
+    def _check_directory(self, directory, check_file, mock_os_walk=None):
+        """Check style in all files in a directory, recursively.
+
+        Args:
+          directory: A path to a directory.
+          check_file: The function to use in place of self.check_file().
+          mock_os_walk: A mock os.walk for unit testing.
+
+        """
+        os_walk = os.walk if mock_os_walk is None else mock_os_walk
+
+        for dir_path, dir_names, file_names in os_walk(directory):
+            for file_name in file_names:
+                file_path = os.path.join(dir_path, file_name)
+                check_file(file_path)
+
+    def check_file(self, file_path, line_numbers=None,
+                   mock_handle_style_error=None,
+                   mock_os_path_exists=None,
+                   mock_process_file=None):
         """Check style in the given file.
 
         Args:
-          file_path: A string that is the path of the file to process.
-          handle_style_error: The function to call when a style error
-                              occurs. This parameter is meant for internal
-                              use within this class. Defaults to a
-                              DefaultStyleErrorHandler instance.
-          process_file: The function to call to process the file. This
-                        parameter should be used only for unit tests.
-                        Defaults to the file processing method of this class.
+          file_path: The path of the file to process.  If possible, the path
+                     should be relative to the source root.  Otherwise,
+                     path-specific logic may not behave as expected.
+          line_numbers: An array of line numbers of the lines for which
+                        style errors should be reported, or None if errors
+                        for all lines should be reported.  Normally, this
+                        array contains the line numbers corresponding to the
+                        modified lines of a patch.
+          mock_handle_style_error: A unit-testing replacement for the function
+                                   to call when a style error occurs. Defaults
+                                   to a DefaultStyleErrorHandler instance.
+          mock_os_path_exists: A unit-test replacement for os.path.exists.
+                               This parameter should only be used for unit
+                               tests.
+          mock_process_file: The function to call to process the file. This
+                             parameter should be used only for unit tests.
+                             Defaults to the file processing method of this
+                             class.
+
+        Raises:
+          SystemExit: if the file does not exist.
 
         """
-        if handle_style_error is None:
+        if mock_handle_style_error is None:
+            increment = self._increment_error_count
             handle_style_error = DefaultStyleErrorHandler(
                                      configuration=self._configuration,
                                      file_path=file_path,
-                                     increment_error_count=
-                                         self._increment_error_count)
-        if process_file is None:
-            process_file = self._process_file
+                                     increment_error_count=increment,
+                                     line_numbers=line_numbers)
+        else:
+            handle_style_error = mock_handle_style_error
+
+        os_path_exists = (os.path.exists if mock_os_path_exists is None else
+                          mock_os_path_exists)
+        process_file = (self._process_file if mock_process_file is None else
+                        mock_process_file)
+
+        if not os_path_exists(file_path) and file_path != "-":
+            _log.error("File does not exist: %s" % file_path)
+            sys.exit(1)
+
+        _log.debug("Checking: " + file_path)
 
         self.file_count += 1
 
@@ -487,31 +722,58 @@
         if dispatcher.should_skip_without_warning(file_path):
             return
         if dispatcher.should_skip_with_warning(file_path):
-            self._stderr_write('Ignoring "%s": this file is exempt from the '
-                               "style guide.\n" % file_path)
+            _log.warn('File exempt from style guide. Skipping: "%s"'
+                      % file_path)
             return
 
-        verbosity = self._configuration.verbosity
+        min_confidence = self._configuration.min_confidence
         processor = dispatcher.dispatch_processor(file_path,
                                                   handle_style_error,
-                                                  verbosity)
+                                                  min_confidence)
         if processor is None:
+            _log.debug('File not a recognized type to check. Skipping: "%s"'
+                       % file_path)
             return
 
+        _log.debug("Using class: " + processor.__class__.__name__)
+
         process_file(processor, file_path, handle_style_error)
 
-    def check_patch(self, patch_string):
-        """Check style in the given patch.
+
+class PatchChecker(object):
+
+    """Supports checking style in patches."""
+
+    def __init__(self, style_checker):
+        """Create a PatchChecker instance.
 
         Args:
-          patch_string: A string that is a patch string.
+          style_checker: A StyleChecker instance.
 
         """
-        patch_files = parse_patch(patch_string)
-        for file_path, diff in patch_files.iteritems():
-            style_error_handler = PatchStyleErrorHandler(diff,
-                                      file_path,
-                                      self._configuration,
-                                      self._increment_error_count)
+        self._file_checker = style_checker
 
-            self.check_file(file_path, style_error_handler)
+    def check(self, patch_string):
+        """Check style in the given patch."""
+        patch_files = parse_patch(patch_string)
+
+        # The diff variable is a DiffFile instance.
+        for path, diff in patch_files.iteritems():
+            line_numbers = set()
+            for line in diff.lines:
+                # When deleted line is not set, it means that
+                # the line is newly added (or modified).
+                if not line[0]:
+                    line_numbers.add(line[1])
+
+            _log.debug('Found %s new or modified lines in: %s'
+                       % (len(line_numbers), path))
+
+            # If line_numbers is empty, the file has no new or
+            # modified lines.  In this case, we don't check the file
+            # because we'll never output errors for the file.
+            # This optimization also prevents the program from exiting
+            # due to a deleted file.
+            if line_numbers:
+                self._file_checker.check_file(file_path=path,
+                                              line_numbers=line_numbers)
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index fe12512..401a7b3 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -34,16 +34,23 @@
 
 """Unit tests for style.py."""
 
+import logging
+import os
 import unittest
 
 import checker as style
+from webkitpy.style_references import parse_patch
+from webkitpy.style_references import LogTesting
+from webkitpy.style_references import TestLogStream
 from checker import _BASE_FILTER_RULES
 from checker import _MAX_REPORTS_PER_CATEGORY
 from checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER
 from checker import _all_categories
 from checker import check_webkit_style_configuration
 from checker import check_webkit_style_parser
+from checker import configure_logging
 from checker import ProcessorDispatcher
+from checker import PatchChecker
 from checker import StyleChecker
 from checker import StyleCheckerConfiguration
 from filter import validate_filter_rules
@@ -51,7 +58,94 @@
 from optparser import ArgumentParser
 from optparser import CommandOptionValues
 from processors.cpp import CppProcessor
+from processors.python import PythonProcessor
 from processors.text import TextProcessor
+from webkitpy.common.system.logtesting import LoggingTestCase
+
+
+class ConfigureLoggingTestBase(unittest.TestCase):
+
+    """Base class for testing configure_logging().
+
+    Sub-classes should implement:
+
+      is_verbose: The is_verbose value to pass to configure_logging().
+
+    """
+
+    def setUp(self):
+        is_verbose = self.is_verbose
+
+        log_stream = TestLogStream(self)
+
+        # Use a logger other than the root logger or one prefixed with
+        # webkit so as not to conflict with test-webkitpy logging.
+        logger = logging.getLogger("unittest")
+
+        # Configure the test logger not to pass messages along to the
+        # root logger.  This prevents test messages from being
+        # propagated to loggers used by test-webkitpy logging (e.g.
+        # the root logger).
+        logger.propagate = False
+
+        self._handlers = configure_logging(stream=log_stream, logger=logger,
+                                           is_verbose=is_verbose)
+        self._log = logger
+        self._log_stream = log_stream
+
+    def tearDown(self):
+        """Reset logging to its original state.
+
+        This method ensures that the logging configuration set up
+        for a unit test does not affect logging in other unit tests.
+
+        """
+        logger = self._log
+        for handler in self._handlers:
+            logger.removeHandler(handler)
+
+    def assert_log_messages(self, messages):
+        """Assert that the logged messages equal the given messages."""
+        self._log_stream.assertMessages(messages)
+
+
+class ConfigureLoggingTest(ConfigureLoggingTestBase):
+
+    """Tests the configure_logging() function."""
+
+    is_verbose = False
+
+    def test_warning_message(self):
+        self._log.warn("test message")
+        self.assert_log_messages(["WARNING: test message\n"])
+
+    def test_below_warning_message(self):
+        # We test the boundary case of a logging level equal to 29.
+        # In practice, we will probably only be calling log.info(),
+        # which corresponds to a logging level of 20.
+        level = logging.WARNING - 1  # Equals 29.
+        self._log.log(level, "test message")
+        self.assert_log_messages(["test message\n"])
+
+    def test_debug_message(self):
+        self._log.debug("test message")
+        self.assert_log_messages([])
+
+    def test_two_messages(self):
+        self._log.info("message1")
+        self._log.info("message2")
+        self.assert_log_messages(["message1\n", "message2\n"])
+
+
+class ConfigureLoggingVerboseTest(ConfigureLoggingTestBase):
+
+    """Tests the configure_logging() function with is_verbose True."""
+
+    is_verbose = True
+
+    def test_debug_message(self):
+        self._log.debug("test message")
+        self.assert_log_messages(["unittest: DEBUG    test message\n"])
 
 
 class GlobalVariablesTest(unittest.TestCase):
@@ -91,7 +185,9 @@
                                 default_options=default_options)
         # No need to test the return value here since we test parse()
         # on valid arguments elsewhere.
-        parser.parse([]) # arguments valid: no error or SystemExit
+        #
+        # The default options are valid: no error or SystemExit.
+        parser.parse(args=[])
 
     def test_path_rules_specifier(self):
         all_categories = self._all_categories()
@@ -125,6 +221,10 @@
                     "readability/naming")
         assertNoCheck("WebKit/gtk/webkit/webkit.h",
                       "readability/naming")
+        assertNoCheck("WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp",
+                      "readability/null")
+        assertNoCheck("WebKit/efl/ewk/ewk_view.h",
+                      "readability/naming")
         assertNoCheck("WebCore/css/CSSParser.cpp",
                       "readability/naming")
         assertNoCheck("WebKit/qt/tests/qwebelement/tst_qwebelement.cpp",
@@ -132,6 +232,16 @@
         assertNoCheck(
             "JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp",
             "readability/naming")
+        assertNoCheck("WebCore/ForwardingHeaders/debugger/Debugger.h",
+                      "build/header_guard")
+
+        # Third-party Python code: webkitpy/thirdparty
+        path = "WebKitTools/Scripts/webkitpy/thirdparty/mock.py"
+        assertNoCheck(path, "build/include")
+        assertNoCheck(path, "pep8/E401")  # A random pep8 category.
+        assertCheck(path, "pep8/W191")
+        assertCheck(path, "pep8/W291")
+        assertCheck(path, "whitespace/carriage_return")
 
     def test_max_reports_per_category(self):
         """Check that _MAX_REPORTS_PER_CATEGORY is valid."""
@@ -212,7 +322,7 @@
         dispatcher = ProcessorDispatcher()
         processor = dispatcher.dispatch_processor(file_path,
                                                   self.mock_handle_style_error,
-                                                  verbosity=3)
+                                                  min_confidence=3)
         return processor
 
     def assert_processor_none(self, file_path):
@@ -235,6 +345,10 @@
         """Assert that the dispatched processor is a CppProcessor."""
         self.assert_processor(file_path, CppProcessor)
 
+    def assert_processor_python(self, file_path):
+        """Assert that the dispatched processor is a PythonProcessor."""
+        self.assert_processor(file_path, PythonProcessor)
+
     def assert_processor_text(self, file_path):
         """Assert that the dispatched processor is a TextProcessor."""
         self.assert_processor(file_path, TextProcessor)
@@ -260,7 +374,7 @@
         self.assertEquals(processor.file_extension, file_extension)
         self.assertEquals(processor.file_path, file_path)
         self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
-        self.assertEquals(processor.verbosity, 3)
+        self.assertEquals(processor.min_confidence, 3)
         # Check "-" for good measure.
         file_base = "-"
         file_extension = ""
@@ -270,6 +384,26 @@
         self.assertEquals(processor.file_extension, file_extension)
         self.assertEquals(processor.file_path, file_path)
 
+    def test_python_paths(self):
+        """Test paths that should be checked as Python."""
+        paths = [
+           "foo.py",
+           "WebKitTools/Scripts/modules/text_style.py",
+        ]
+
+        for path in paths:
+            self.assert_processor_python(path)
+
+        # Check processor attributes on a typical input.
+        file_base = "foo"
+        file_extension = "css"
+        file_path = file_base + "." + file_extension
+        self.assert_processor_text(file_path)
+        processor = self.dispatch_processor(file_path)
+        self.assertEquals(processor.file_path, file_path)
+        self.assertEquals(processor.handle_style_error,
+                          self.mock_handle_style_error)
+
     def test_text_paths(self):
         """Test paths that should be checked as text."""
         paths = [
@@ -281,14 +415,12 @@
            "foo.mm",
            "foo.php",
            "foo.pm",
-           "foo.py",
            "foo.txt",
            "FooChangeLog.bak",
            "WebCore/ChangeLog",
            "WebCore/inspector/front-end/inspector.js",
-           "WebKitTools/Scripts/check-webkit=style",
-           "WebKitTools/Scripts/modules/text_style.py",
-            ]
+           "WebKitTools/Scripts/check-webkit-style",
+        ]
 
         for path in paths:
             self.assert_processor_text(path)
@@ -333,9 +465,9 @@
         return StyleCheckerConfiguration(
                    filter_configuration=filter_configuration,
                    max_reports_per_category={"whitespace/newline": 1},
+                   min_confidence=3,
                    output_format=output_format,
-                   stderr_write=self._mock_stderr_write,
-                   verbosity=3)
+                   stderr_write=self._mock_stderr_write)
 
     def test_init(self):
         """Test the __init__() method."""
@@ -345,7 +477,7 @@
         self.assertEquals(configuration.max_reports_per_category,
                           {"whitespace/newline": 1})
         self.assertEquals(configuration.stderr_write, self._mock_stderr_write)
-        self.assertEquals(configuration.verbosity, 3)
+        self.assertEquals(configuration.min_confidence, 3)
 
     def test_is_reportable(self):
         """Test the is_reportable() method."""
@@ -362,7 +494,7 @@
     def _call_write_style_error(self, output_format):
         config = self._style_checker_configuration(output_format=output_format)
         config.write_style_error(category="whitespace/tab",
-                                 confidence=5,
+                                 confidence_in_error=5,
                                  file_path="foo.h",
                                  line_number=100,
                                  message="message")
@@ -395,9 +527,9 @@
         configuration = StyleCheckerConfiguration(
                             filter_configuration=FilterConfiguration(),
                             max_reports_per_category={},
+                            min_confidence=3,
                             output_format="vs7",
-                            stderr_write=self._mock_stderr_write,
-                            verbosity=3)
+                            stderr_write=self._mock_stderr_write)
 
         style_checker = self._style_checker(configuration)
 
@@ -406,7 +538,25 @@
         self.assertEquals(style_checker.file_count, 0)
 
 
-class StyleCheckerCheckFileTest(unittest.TestCase):
+class StyleCheckerCheckFileBase(LoggingTestCase):
+
+    def setUp(self):
+        LoggingTestCase.setUp(self)
+        self.warning_messages = ""
+
+    def mock_stderr_write(self, warning_message):
+        self.warning_messages += warning_message
+
+    def _style_checker_configuration(self):
+        return StyleCheckerConfiguration(
+            filter_configuration=FilterConfiguration(),
+            max_reports_per_category={"whitespace/newline": 1},
+            min_confidence=3,
+            output_format="vs7",
+            stderr_write=self.mock_stderr_write)
+
+
+class StyleCheckerCheckFileTest(StyleCheckerCheckFileBase):
 
     """Test the check_file() method of the StyleChecker class.
 
@@ -432,17 +582,19 @@
 
     """
     def setUp(self):
+        StyleCheckerCheckFileBase.setUp(self)
         self.got_file_path = None
         self.got_handle_style_error = None
         self.got_processor = None
-        self.warning_messages = ""
-
-    def mock_stderr_write(self, warning_message):
-        self.warning_messages += warning_message
 
     def mock_handle_style_error(self):
         pass
 
+    def mock_os_path_exists(self, path):
+        # We deliberately make it so that this method returns False unless
+        # the caller has made an effort to put "does_exist" in the path.
+        return path.find("does_exist") > -1
+
     def mock_process_file(self, processor, file_path, handle_style_error):
         """A mock _process_file().
 
@@ -470,25 +622,48 @@
         # Confirm that the attributes are reset.
         self.assert_attributes(None, None, None, "")
 
-        configuration = StyleCheckerConfiguration(
-                            filter_configuration=FilterConfiguration(),
-                            max_reports_per_category={"whitespace/newline": 1},
-                            output_format="vs7",
-                            stderr_write=self.mock_stderr_write,
-                            verbosity=3)
+        configuration = self._style_checker_configuration()
 
         style_checker = StyleChecker(configuration)
 
-        style_checker.check_file(file_path,
-                                 self.mock_handle_style_error,
-                                 self.mock_process_file)
+        style_checker.check_file(file_path=file_path,
+            mock_handle_style_error=self.mock_handle_style_error,
+            mock_os_path_exists=self.mock_os_path_exists,
+            mock_process_file=self.mock_process_file)
 
-        self.assertEquals(1, style_checker.file_count)
+        self.assertEquals(style_checker.file_count, 1)
+
+    def test_check_file_does_not_exist(self):
+        file_path = "file_does_not_exist.txt"
+
+        # Confirm that the file does not exist.
+        self.assertFalse(self.mock_os_path_exists(file_path))
+
+        # Check the outcome.
+        self.assertRaises(SystemExit, self.call_check_file, file_path)
+        self.assertLog(["ERROR: File does not exist: "
+                        "file_does_not_exist.txt\n"])
+
+    def test_check_file_stdin(self):
+        file_path = "-"
+
+        # Confirm that the file does not exist.
+        self.assertFalse(self.mock_os_path_exists(file_path))
+
+        # Check the outcome.
+        self.call_check_file(file_path)
+        expected_processor = CppProcessor(file_path,
+                                          "",
+                                          self.mock_handle_style_error, 3)
+        self.assert_attributes(file_path,
+                               self.mock_handle_style_error,
+                               expected_processor,
+                               "")
 
     def test_check_file_on_skip_without_warning(self):
         """Test check_file() for a skipped-without-warning file."""
 
-        file_path = "LayoutTests/foo.txt"
+        file_path = "LayoutTests/does_exist/foo.txt"
 
         dispatcher = ProcessorDispatcher()
         # Confirm that the input file is truly a skipped-without-warning file.
@@ -501,7 +676,7 @@
     def test_check_file_on_skip_with_warning(self):
         """Test check_file() for a skipped-with-warning file."""
 
-        file_path = "gtk2drawing.c"
+        file_path = "does_exist/gtk2drawing.c"
 
         dispatcher = ProcessorDispatcher()
         # Check that the input file is truly a skipped-with-warning file.
@@ -509,15 +684,16 @@
 
         # Check the outcome.
         self.call_check_file(file_path)
-        self.assert_attributes(None, None, None,
-                               'Ignoring "gtk2drawing.c": this file is exempt from the style guide.\n')
+        self.assert_attributes(None, None, None, "")
+        self.assertLog(["WARNING: File exempt from style guide. "
+                        'Skipping: "does_exist/gtk2drawing.c"\n'])
 
     def test_check_file_on_non_skipped(self):
 
         # We use a C++ file since by using a CppProcessor, we can check
         # that all of the possible information is getting passed to
-        # process_file (in particular, the verbosity).
-        file_base = "foo"
+        # process_file (in particular, the min_confidence parameter).
+        file_base = "foo_does_exist"
         file_extension = "cpp"
         file_path = file_base + "." + file_extension
 
@@ -536,7 +712,97 @@
                                "")
 
 
-if __name__ == '__main__':
-    import sys
+class StyleCheckerCheckPathsTest(unittest.TestCase):
 
-    unittest.main()
+    """Test the check_paths() method of the StyleChecker class."""
+
+    class MockOs(object):
+
+        class MockPath(object):
+
+            """A mock os.path."""
+
+            def isdir(self, path):
+                return path == "directory"
+
+        def __init__(self):
+            self.path = self.MockPath()
+
+        def walk(self, directory):
+            """A mock of os.walk."""
+            if directory == "directory":
+                dirs = [("dir_path1", [], ["file1", "file2"]),
+                        ("dir_path2", [], ["file3"])]
+                return dirs
+            return None
+
+    def setUp(self):
+        self._checked_files = []
+
+    def _mock_check_file(self, file):
+        self._checked_files.append(file)
+
+    def test_check_paths(self):
+        """Test StyleChecker.check_paths()."""
+        checker = StyleChecker(configuration=None)
+        mock_check_file = self._mock_check_file
+        mock_os = self.MockOs()
+
+        # Confirm that checked files is empty at the outset.
+        self.assertEquals(self._checked_files, [])
+        checker.check_paths(["path1", "directory"],
+                            mock_check_file=mock_check_file,
+                            mock_os=mock_os)
+        self.assertEquals(self._checked_files,
+                          ["path1",
+                           os.path.join("dir_path1", "file1"),
+                           os.path.join("dir_path1", "file2"),
+                           os.path.join("dir_path2", "file3")])
+
+
+class PatchCheckerTest(unittest.TestCase):
+
+    """Test the PatchChecker class."""
+
+    class MockStyleChecker(object):
+
+        def __init__(self):
+            self.checked_files = []
+            """A list of (file_path, line_numbers) pairs."""
+
+        def check_file(self, file_path, line_numbers):
+            self.checked_files.append((file_path, line_numbers))
+
+    def setUp(self):
+        style_checker = self.MockStyleChecker()
+        self._style_checker = style_checker
+        self._patch_checker = PatchChecker(style_checker)
+
+    def _call_check_patch(self, patch_string):
+        self._patch_checker.check(patch_string)
+
+    def _assert_checked(self, checked_files):
+        self.assertEquals(self._style_checker.checked_files, checked_files)
+
+    def test_check_patch(self):
+        # The modified line_numbers array for this patch is: [2].
+        self._call_check_patch("""diff --git a/__init__.py b/__init__.py
+index ef65bee..e3db70e 100644
+--- a/__init__.py
++++ b/__init__.py
+@@ -1,1 +1,2 @@
+ # Required for Python to search this directory for module files
++# New line
+""")
+        self._assert_checked([("__init__.py", set([2]))])
+
+    def test_check_patch_with_deletion(self):
+        self._call_check_patch("""Index: __init__.py
+===================================================================
+--- __init__.py  (revision 3593)
++++ __init__.py  (working copy)
+@@ -1 +0,0 @@
+-foobar
+""")
+        # _mock_check_file should not be called for the deletion patch.
+        self._assert_checked([])
diff --git a/WebKitTools/Scripts/webkitpy/style/error_handlers.py b/WebKitTools/Scripts/webkitpy/style/error_handlers.py
index 6bc3f15..5666bfb 100644
--- a/WebKitTools/Scripts/webkitpy/style/error_handlers.py
+++ b/WebKitTools/Scripts/webkitpy/style/error_handlers.py
@@ -40,10 +40,10 @@
       line_number: The integer line number of the line containing the error.
       category: The name of the category of the error, for example
                 "whitespace/newline".
-      confidence: An integer between 1-5 that represents the level of
-                  confidence in the error. The value 5 means that we are
-                  certain of the problem, and the value 1 means that it
-                  could be a legitimate construct.
+      confidence: An integer between 1 and 5 inclusive that represents the
+                  application's level of confidence in the error. The value
+                  5 means that we are certain of the problem, and the
+                  value 1 means that it could be a legitimate construct.
       message: The error message to report.
 
 """
@@ -56,7 +56,8 @@
 
     """The default style error handler."""
 
-    def __init__(self, file_path, configuration, increment_error_count):
+    def __init__(self, file_path, configuration, increment_error_count,
+                 line_numbers=None):
         """Create a default style error handler.
 
         Args:
@@ -66,16 +67,44 @@
           increment_error_count: A function that takes no arguments and
                                  increments the total count of reportable
                                  errors.
+          line_numbers: An array of line numbers of the lines for which
+                        style errors should be reported, or None if errors
+                        for all lines should be reported.  When it is not
+                        None, this array normally contains the line numbers
+                        corresponding to the modified lines of a patch.
 
         """
+        if line_numbers is not None:
+            line_numbers = set(line_numbers)
+
         self._file_path = file_path
         self._configuration = configuration
         self._increment_error_count = increment_error_count
+        self._line_numbers = line_numbers
 
         # A string to integer dictionary cache of the number of reportable
         # errors per category passed to this instance.
         self._category_totals = {}
 
+    # Useful for unit testing.
+    def __eq__(self, other):
+        """Return whether this instance is equal to another."""
+        if self._configuration != other._configuration:
+            return False
+        if self._file_path != other._file_path:
+            return False
+        if self._increment_error_count != other._increment_error_count:
+            return False
+        if self._line_numbers != other._line_numbers:
+            return False
+
+        return True
+
+    # Useful for unit testing.
+    def __ne__(self, other):
+        # Python does not automatically deduce __ne__ from __eq__.
+        return not self.__eq__(other)
+
     def _add_reportable_error(self, category):
         """Increment the error count and return the new category total."""
         self._increment_error_count() # Increment the total.
@@ -100,6 +129,12 @@
         See the docstring of this module for more information.
 
         """
+        if (self._line_numbers is not None and
+            line_number not in self._line_numbers):
+            # Then the error occurred in a line that was not modified, so
+            # the error is not reportable.
+            return
+
         if not self._configuration.is_reportable(category=category,
                                                  confidence_in_error=confidence,
                                                  file_path=self._file_path):
@@ -114,7 +149,7 @@
             return
 
         self._configuration.write_style_error(category=category,
-                                              confidence=confidence,
+                                              confidence_in_error=confidence,
                                               file_path=self._file_path,
                                               line_number=line_number,
                                               message=message)
@@ -122,56 +157,3 @@
         if category_total == max_reports:
             self._configuration.stderr_write("Suppressing further [%s] reports "
                                              "for this file.\n" % category)
-
-
-class PatchStyleErrorHandler(object):
-
-    """The style error function for patch files."""
-
-    def __init__(self, diff, file_path, configuration, increment_error_count):
-        """Create a patch style error handler for the given path.
-
-        Args:
-          diff: A DiffFile instance.
-          Other arguments: see the DefaultStyleErrorHandler.__init__()
-                           documentation for the other arguments.
-
-        """
-        self._diff = diff
-
-        self._default_error_handler = DefaultStyleErrorHandler(
-                                          configuration=configuration,
-                                          file_path=file_path,
-                                          increment_error_count=
-                                              increment_error_count)
-
-        # The line numbers of the modified lines. This is set lazily.
-        self._line_numbers = set()
-
-    def _get_line_numbers(self):
-        """Return the line numbers of the modified lines."""
-        if not self._line_numbers:
-            for line in self._diff.lines:
-                # When deleted line is not set, it means that
-                # the line is newly added (or modified).
-                if not line[0]:
-                    self._line_numbers.add(line[1])
-
-        return self._line_numbers
-
-    def __call__(self, line_number, category, confidence, message):
-        """Handle the occurrence of a style error.
-
-        This function does not report errors occurring in lines not
-        marked as modified or added in the patch.
-
-        See the docstring of this module for more information.
-
-        """
-        if line_number not in self._get_line_numbers():
-            # Then the error is not reportable.
-            return
-
-        self._default_error_handler(line_number, category, confidence,
-                                    message)
-
diff --git a/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py b/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
index a39ba2a..05e725a 100644
--- a/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
@@ -25,18 +25,25 @@
 
 import unittest
 
-from .. style_references import parse_patch
 from checker import StyleCheckerConfiguration
 from error_handlers import DefaultStyleErrorHandler
-from error_handlers import PatchStyleErrorHandler
 from filter import FilterConfiguration
 
-class StyleErrorHandlerTestBase(unittest.TestCase):
+
+class DefaultStyleErrorHandlerTest(unittest.TestCase):
+
+    """Tests the DefaultStyleErrorHandler class."""
 
     def setUp(self):
         self._error_messages = []
         self._error_count = 0
 
+    _category = "whitespace/tab"
+    """The category name for the tests in this class."""
+
+    _file_path = "foo.h"
+    """The file path for the tests in this class."""
+
     def _mock_increment_error_count(self):
         self._error_count += 1
 
@@ -51,38 +58,66 @@
         return StyleCheckerConfiguration(
                    filter_configuration=filter_configuration,
                    max_reports_per_category={"whitespace/tab": 2},
+                   min_confidence=3,
                    output_format="vs7",
-                   stderr_write=self._mock_stderr_write,
-                   verbosity=3)
+                   stderr_write=self._mock_stderr_write)
 
-
-class DefaultStyleErrorHandlerTest(StyleErrorHandlerTestBase):
-
-    """Tests DefaultStyleErrorHandler class."""
-
-    _category = "whitespace/tab"
-    """The category name for the tests in this class."""
-
-    _file_path = "foo.h"
-    """The file path for the tests in this class."""
+    def _error_handler(self, configuration, line_numbers=None):
+        return DefaultStyleErrorHandler(configuration=configuration,
+                   file_path=self._file_path,
+                   increment_error_count=self._mock_increment_error_count,
+                   line_numbers=line_numbers)
 
     def _check_initialized(self):
         """Check that count and error messages are initialized."""
         self.assertEquals(0, self._error_count)
         self.assertEquals(0, len(self._error_messages))
 
-    def _error_handler(self, configuration):
-        return DefaultStyleErrorHandler(configuration=configuration,
-                   file_path=self._file_path,
-                   increment_error_count=self._mock_increment_error_count)
-
-    def _call_error_handler(self, handle_error, confidence):
+    def _call_error_handler(self, handle_error, confidence, line_number=100):
         """Call the given error handler with a test error."""
-        handle_error(line_number=100,
+        handle_error(line_number=line_number,
                      category=self._category,
                      confidence=confidence,
                      message="message")
 
+    def test_eq__true_return_value(self):
+        """Test the __eq__() method for the return value of True."""
+        handler1 = self._error_handler(configuration=None)
+        handler2 = self._error_handler(configuration=None)
+
+        self.assertTrue(handler1.__eq__(handler2))
+
+    def test_eq__false_return_value(self):
+        """Test the __eq__() method for the return value of False."""
+        def make_handler(configuration=self._style_checker_configuration(),
+                file_path='foo.txt', increment_error_count=lambda: True,
+                line_numbers=[100]):
+            return DefaultStyleErrorHandler(configuration=configuration,
+                       file_path=file_path,
+                       increment_error_count=increment_error_count,
+                       line_numbers=line_numbers)
+
+        handler = make_handler()
+
+        # Establish a baseline for our comparisons below.
+        self.assertTrue(handler.__eq__(make_handler()))
+
+        # Verify that a difference in any argument causes equality to fail.
+        self.assertFalse(handler.__eq__(make_handler(configuration=None)))
+        self.assertFalse(handler.__eq__(make_handler(file_path='bar.txt')))
+        self.assertFalse(handler.__eq__(make_handler(increment_error_count=None)))
+        self.assertFalse(handler.__eq__(make_handler(line_numbers=[50])))
+
+    def test_ne(self):
+        """Test the __ne__() method."""
+        # By default, __ne__ always returns true on different objects.
+        # Thus, check just the distinguishing case to verify that the
+        # code defines __ne__.
+        handler1 = self._error_handler(configuration=None)
+        handler2 = self._error_handler(configuration=None)
+
+        self.assertFalse(handler1.__ne__(handler2))
+
     def test_non_reportable_error(self):
         """Test __call__() with a non-reportable error."""
         self._check_initialized()
@@ -132,52 +167,21 @@
         self.assertEquals(3, self._error_count)
         self.assertEquals(3, len(self._error_messages))
 
-
-class PatchStyleErrorHandlerTest(StyleErrorHandlerTestBase):
-
-    """Tests PatchStyleErrorHandler class."""
-
-    _file_path = "__init__.py"
-
-    _patch_string = """diff --git a/__init__.py b/__init__.py
-index ef65bee..e3db70e 100644
---- a/__init__.py
-+++ b/__init__.py
-@@ -1 +1,2 @@
- # Required for Python to search this directory for module files
-+# New line
-
-"""
-
-    def test_call(self):
-        patch_files = parse_patch(self._patch_string)
-        diff = patch_files[self._file_path]
-
+    def test_line_numbers(self):
+        """Test the line_numbers parameter."""
+        self._check_initialized()
         configuration = self._style_checker_configuration()
-
-        handle_error = PatchStyleErrorHandler(diff=diff,
-                                              file_path=self._file_path,
-                                              configuration=configuration,
-                                              increment_error_count=
-                                              self._mock_increment_error_count)
-
-        category = "whitespace/tab"
+        error_handler = self._error_handler(configuration,
+                                            line_numbers=[50])
         confidence = 5
-        message = "message"
 
-        # Confirm error is reportable.
-        self.assertTrue(configuration.is_reportable(category,
-                                                    confidence,
-                                                    self._file_path))
-
-        # Confirm error count initialized to zero.
+        # Error on non-modified line: no error.
+        self._call_error_handler(error_handler, confidence, line_number=60)
         self.assertEquals(0, self._error_count)
+        self.assertEquals([], self._error_messages)
 
-        # Test error in unmodified line (error count does not increment).
-        handle_error(1, category, confidence, message)
-        self.assertEquals(0, self._error_count)
-
-        # Test error in modified line (error count increments).
-        handle_error(2, category, confidence, message)
+        # Error on modified line: error.
+        self._call_error_handler(error_handler, confidence, line_number=50)
         self.assertEquals(1, self._error_count)
-
+        self.assertEquals(self._error_messages,
+                          ["foo.h(50):  message  [whitespace/tab] [5]\n"])
diff --git a/WebKitTools/Scripts/webkitpy/style/filereader.py b/WebKitTools/Scripts/webkitpy/style/filereader.py
new file mode 100644
index 0000000..081e6dc
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/filereader.py
@@ -0,0 +1,148 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) 2010 ProFUSION embedded systems
+#
+# 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.
+
+"""Supports reading and processing text files."""
+
+import codecs
+import logging
+import os
+import sys
+
+
+_log = logging.getLogger(__name__)
+
+
+class TextFileReader(object):
+
+    """Supports reading and processing text files.
+
+       Attributes:
+         file_count: The total number of files passed to this instance
+                     for processing, including non-text files and files
+                     that should be skipped.
+
+    """
+
+    def __init__(self, processor):
+        """Create an instance.
+
+        Arguments:
+          processor: A ProcessorBase instance.
+
+        """
+        self._processor = processor
+        self.file_count = 0
+
+    def _read_lines(self, file_path):
+        """Read the file at a path, and return its lines.
+
+        Raises:
+          IOError: If the file does not exist or cannot be read.
+
+        """
+        # Support the UNIX convention of using "-" for stdin.
+        if file_path == '-':
+            file = codecs.StreamReaderWriter(sys.stdin,
+                                             codecs.getreader('utf8'),
+                                             codecs.getwriter('utf8'),
+                                             'replace')
+        else:
+            # We do not open the file with universal newline support
+            # (codecs does not support it anyway), so the resulting
+            # lines contain trailing "\r" characters if we are reading
+            # a file with CRLF endings.
+            file = codecs.open(file_path, 'r', 'utf8', 'replace')
+
+        try:
+            contents = file.read()
+        finally:
+            file.close()
+
+        lines = contents.split('\n')
+        return lines
+
+    def process_file(self, file_path, **kwargs):
+        """Process the given file by calling the processor's process() method.
+
+        Args:
+          file_path: The path of the file to process.
+          **kwargs: Any additional keyword parameters that should be passed
+                    to the processor's process() method.  The process()
+                    method should support these keyword arguments.
+
+        Raises:
+          SystemExit: If no file at file_path exists.
+
+        """
+        self.file_count += 1
+
+        if not self._processor.should_process(file_path):
+            _log.debug("Skipping file: '%s'" % file_path)
+            return
+        _log.debug("Processing file: '%s'" % file_path)
+
+        try:
+            lines = self._read_lines(file_path)
+        except IOError, err:
+            if not os.path.exists(file_path):
+                _log.error("File does not exist: '%s'" % file_path)
+                sys.exit(1)
+
+            message = ("Could not read file. Skipping: '%s'\n  %s"
+                       % (file_path, err))
+            _log.warn(message)
+            return
+
+        self._processor.process(lines, file_path, **kwargs)
+
+    def _process_directory(self, directory):
+        """Process all files in the given directory, recursively.
+
+        Args:
+          directory: A directory path.
+
+        """
+        for dir_path, dir_names, file_names in os.walk(directory):
+            for file_name in file_names:
+                file_path = os.path.join(dir_path, file_name)
+                self.process_file(file_path)
+
+    def process_paths(self, paths):
+        """Process the given file and directory paths.
+
+        Args:
+          paths: A list of file and directory paths.
+
+        """
+        for path in paths:
+            if os.path.isdir(path):
+                self._process_directory(directory=path)
+            else:
+                self.process_file(path)
diff --git a/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py b/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py
new file mode 100644
index 0000000..8d1a159
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py
@@ -0,0 +1,151 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Contains unit tests for filereader.py."""
+
+import os
+import shutil
+import tempfile
+import unittest
+
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.style.checker import ProcessorBase
+from webkitpy.style.filereader import TextFileReader
+
+
+class TextFileReaderTest(LoggingTestCase):
+
+    class MockProcessor(ProcessorBase):
+
+        """A processor for test purposes.
+
+        This processor simply records the parameters passed to its process()
+        method for later checking by the unittest test methods.
+
+        """
+
+        def __init__(self):
+            self.processed = []
+            """The parameters passed for all calls to the process() method."""
+
+        def should_process(self, file_path):
+            return not file_path.endswith('should_not_process.txt')
+
+        def process(self, lines, file_path, test_kwarg=None):
+            self.processed.append((lines, file_path, test_kwarg))
+
+    def setUp(self):
+        LoggingTestCase.setUp(self)
+        processor = TextFileReaderTest.MockProcessor()
+
+        temp_dir = tempfile.mkdtemp()
+
+        self._file_reader = TextFileReader(processor)
+        self._processor = processor
+        self._temp_dir = temp_dir
+
+    def tearDown(self):
+        LoggingTestCase.tearDown(self)
+        shutil.rmtree(self._temp_dir)
+
+    def _create_file(self, rel_path, text):
+        """Create a file with given text and return the path to the file."""
+        file_path = os.path.join(self._temp_dir, rel_path)
+
+        file = open(file_path, 'w')
+        file.write(text)
+        file.close()
+
+        return file_path
+
+    def _passed_to_processor(self):
+        """Return the parameters passed to MockProcessor.process()."""
+        return self._processor.processed
+
+    def _assert_file_reader(self, passed_to_processor, file_count):
+        """Assert the state of the file reader."""
+        self.assertEquals(passed_to_processor, self._passed_to_processor())
+        self.assertEquals(file_count, self._file_reader.file_count)
+
+    def test_process_file__should_not_process(self):
+        self._file_reader.process_file('should_not_process.txt')
+        self._assert_file_reader([], 1)
+
+    def test_process_file__does_not_exist(self):
+        try:
+            self._file_reader.process_file('does_not_exist.txt')
+        except SystemExit, err:
+            self.assertEquals(str(err), '1')
+        else:
+            self.fail('No Exception raised.')
+        self._assert_file_reader([], 1)
+        self.assertLog(["ERROR: File does not exist: 'does_not_exist.txt'\n"])
+
+    def test_process_file__is_dir(self):
+        temp_dir = os.path.join(self._temp_dir, 'test_dir')
+        os.mkdir(temp_dir)
+
+        self._file_reader.process_file(temp_dir)
+
+        # Because the log message below contains exception text, it is
+        # possible that the text varies across platforms.  For this reason,
+        # we check only the portion of the log message that we control,
+        # namely the text at the beginning.
+        log_messages = self.logMessages()
+        # We remove the message we are looking at to prevent the tearDown()
+        # from raising an exception when it asserts that no log messages
+        # remain.
+        message = log_messages.pop()
+
+        self.assertTrue(message.startswith('WARNING: Could not read file. '
+                                           "Skipping: '%s'\n  " % temp_dir))
+
+        self._assert_file_reader([], 1)
+
+    def test_process_file__multiple_lines(self):
+        file_path = self._create_file('foo.txt', 'line one\r\nline two\n')
+
+        self._file_reader.process_file(file_path)
+        processed = [(['line one\r', 'line two', ''], file_path, None)]
+        self._assert_file_reader(processed, 1)
+
+    def test_process_file__with_kwarg(self):
+        file_path = self._create_file('foo.txt', 'file contents')
+
+        self._file_reader.process_file(file_path=file_path, test_kwarg='foo')
+        processed = [(['file contents'], file_path, 'foo')]
+        self._assert_file_reader(processed, 1)
+
+    def test_process_paths(self):
+        # We test a list of paths that contains both a file and a directory.
+        dir = os.path.join(self._temp_dir, 'foo_dir')
+        os.mkdir(dir)
+
+        file_path1 = self._create_file('file1.txt', 'foo')
+
+        rel_path = os.path.join('foo_dir', 'file2.txt')
+        file_path2 = self._create_file(rel_path, 'bar')
+
+        self._file_reader.process_paths([dir, file_path1])
+        processed = [(['bar'], file_path2, None),
+                     (['foo'], file_path1, None)]
+        self._assert_file_reader(processed, 2)
diff --git a/WebKitTools/Scripts/webkitpy/style/main.py b/WebKitTools/Scripts/webkitpy/style/main.py
new file mode 100644
index 0000000..c933c6d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/main.py
@@ -0,0 +1,130 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+import logging
+import os
+import sys
+
+from webkitpy.common.system.ospath import relpath as _relpath
+
+
+_log = logging.getLogger(__name__)
+
+
+def change_directory(checkout_root, paths, mock_os=None):
+    """Change the working directory to the WebKit checkout root, if possible.
+
+    If every path in the paths parameter is below the checkout root (or if
+    the paths parameter is empty or None), this method changes the current
+    working directory to the checkout root and converts the paths parameter
+    as described below.
+        This allows the paths being checked to be displayed relative to the
+    checkout root, and for path-specific style checks to work as expected.
+    Path-specific checks include whether files should be skipped, whether
+    custom style rules should apply to certain files, etc.
+        If the checkout root is None or the empty string, this method returns
+    the paths parameter unchanged.
+
+    Returns:
+      paths: A copy of the paths parameter -- possibly converted, as follows.
+             If this method changed the current working directory to the
+             checkout root, then the list is the paths parameter converted to
+             normalized paths relative to the checkout root.  Otherwise, the
+             paths are not converted.
+
+    Args:
+      paths: A list of paths to the files that should be checked for style.
+             This argument can be None or the empty list if a git commit
+             or all changes under the checkout root should be checked.
+      checkout_root: The path to the root of the WebKit checkout, or None or
+                     the empty string if no checkout could be detected.
+      mock_os: A replacement module for unit testing.  Defaults to os.
+
+    """
+    os_module = os if mock_os is None else mock_os
+
+    if paths is not None:
+        paths = list(paths)
+
+    if not checkout_root:
+        if not paths:
+            raise Exception("The paths parameter must be non-empty if "
+                            "there is no checkout root.")
+
+        # FIXME: Consider trying to detect the checkout root for each file
+        #        being checked rather than only trying to detect the checkout
+        #        root for the current working directory.  This would allow
+        #        files to be checked correctly even if the script is being
+        #        run from outside any WebKit checkout.
+        #
+        #        Moreover, try to find the "source root" for each file
+        #        using path-based heuristics rather than using only the
+        #        presence of a WebKit checkout.  For example, we could
+        #        examine parent directories until a directory is found
+        #        containing JavaScriptCore, WebCore, WebKit, WebKitSite,
+        #        and WebKitTools.
+        #             Then log an INFO message saying that a source root not
+        #        in a WebKit checkout was found.  This will allow us to check
+        #        the style of non-scm copies of the source tree (e.g.
+        #        nightlies).
+        _log.warn("WebKit checkout root not found:\n"
+                  "  Path-dependent style checks may not work correctly.\n"
+                  "  See the help documentation for more info.")
+
+        return paths
+
+    if paths:
+        # Then try converting all of the paths to paths relative to
+        # the checkout root.
+        rel_paths = []
+        for path in paths:
+            rel_path = _relpath(path, checkout_root)
+            if rel_path is None:
+                # Then the path is not below the checkout root.  Since all
+                # paths should be interpreted relative to the same root,
+                # do not interpret any of the paths as relative to the
+                # checkout root.  Interpret all of them relative to the
+                # current working directory, and do not change the current
+                # working directory.
+                _log.warn(
+"""Path-dependent style checks may not work correctly:
+
+  One of the given paths is outside the WebKit checkout of the current
+  working directory:
+
+    Path: %s
+    Checkout root: %s
+
+  Pass only files below the checkout root to ensure correct results.
+  See the help documentation for more info.
+"""
+                          % (path, checkout_root))
+
+                return paths
+            rel_paths.append(rel_path)
+        # If we got here, the conversion was successful.
+        paths = rel_paths
+
+    _log.debug("Changing to checkout root: " + checkout_root)
+    os_module.chdir(checkout_root)
+
+    return paths
diff --git a/WebKitTools/Scripts/webkitpy/style/main_unittest.py b/WebKitTools/Scripts/webkitpy/style/main_unittest.py
new file mode 100644
index 0000000..fe448f5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/main_unittest.py
@@ -0,0 +1,124 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Unit tests for main.py."""
+
+import os
+import unittest
+
+from main import change_directory
+from webkitpy.style_references import LogTesting
+
+
+class ChangeDirectoryTest(unittest.TestCase):
+
+    """Tests change_directory()."""
+
+    _original_directory = "/original"
+    _checkout_root = "/WebKit"
+
+    class _MockOs(object):
+
+        """A mock os module for unit testing."""
+
+        def __init__(self, test_case):
+            self._test_case = test_case
+            self._current_directory = \
+                ChangeDirectoryTest._original_directory
+
+        def chdir(self, current_directory):
+            self._current_directory = current_directory
+
+        def assertCurrentDirectory(self, expected_directory):
+            self._test_case.assertEquals(expected_directory,
+                                         self._current_directory)
+
+    def setUp(self):
+        self._log = LogTesting.setUp(self)
+        self._mock_os = self._MockOs(self)
+
+    def tearDown(self):
+        self._log.tearDown()
+
+    # This method is a convenient wrapper for change_working_directory() that
+    # passes the mock_os for this unit testing class.
+    def _change_directory(self, paths, checkout_root):
+        return change_directory(paths=paths,
+                                checkout_root=checkout_root,
+                                mock_os=self._mock_os)
+
+    def _assert_result(self, actual_return_value, expected_return_value,
+                       expected_log_messages, expected_current_directory):
+        self.assertEquals(actual_return_value, expected_return_value)
+        self._log.assertMessages(expected_log_messages)
+        self._mock_os.assertCurrentDirectory(expected_current_directory)
+
+    def test_checkout_root_none_paths_none(self):
+        self.assertRaises(Exception, self._change_directory,
+                          checkout_root=None, paths=None)
+        self._log.assertMessages([])
+        self._mock_os.assertCurrentDirectory(self._original_directory)
+
+    def test_checkout_root_none(self):
+        paths = self._change_directory(checkout_root=None,
+                                       paths=["path1"])
+        log_messages = [
+"""WARNING: WebKit checkout root not found:
+  Path-dependent style checks may not work correctly.
+  See the help documentation for more info.
+"""]
+        self._assert_result(paths, ["path1"], log_messages,
+                            self._original_directory)
+
+    def test_paths_none(self):
+        paths = self._change_directory(checkout_root=self._checkout_root,
+                                       paths=None)
+        self._assert_result(paths, None, [], self._checkout_root)
+
+    def test_paths_convertible(self):
+        paths=["/WebKit/foo1.txt",
+               "/WebKit/foo2.txt"]
+        paths = self._change_directory(checkout_root=self._checkout_root,
+                                       paths=paths)
+        self._assert_result(paths, ["foo1.txt", "foo2.txt"], [],
+                            self._checkout_root)
+
+    def test_with_scm_paths_unconvertible(self):
+        paths=["/WebKit/foo1.txt",
+               "/outside/foo2.txt"]
+        paths = self._change_directory(checkout_root=self._checkout_root,
+                                       paths=paths)
+        log_messages = [
+"""WARNING: Path-dependent style checks may not work correctly:
+
+  One of the given paths is outside the WebKit checkout of the current
+  working directory:
+
+    Path: /outside/foo2.txt
+    Checkout root: /WebKit
+
+  Pass only files below the checkout root to ensure correct results.
+  See the help documentation for more info.
+
+"""]
+        self._assert_result(paths, paths, log_messages,
+                            self._original_directory)
diff --git a/WebKitTools/Scripts/webkitpy/style/optparser.py b/WebKitTools/Scripts/webkitpy/style/optparser.py
index 4137c8b..576c16a 100644
--- a/WebKitTools/Scripts/webkitpy/style/optparser.py
+++ b/WebKitTools/Scripts/webkitpy/style/optparser.py
@@ -22,84 +22,83 @@
 
 """Supports the parsing of command-line options for check-webkit-style."""
 
-import getopt
+import logging
+from optparse import OptionParser
 import os.path
 import sys
 
 from filter import validate_filter_rules
 # This module should not import anything from checker.py.
 
+_log = logging.getLogger(__name__)
 
-def _create_usage(default_options):
-    """Return the usage string to display for command help.
+_USAGE = """usage: %prog [--help] [options] [path1] [path2] ...
 
-    Args:
-      default_options: A DefaultCommandOptionValues instance.
+Overview:
+  Check coding style according to WebKit style guidelines:
 
-    """
-    usage = """
-Syntax: %(program_name)s [--verbose=#] [--git-commit=<SingleCommit>] [--output=vs7]
-        [--filter=-x,+y,...] [file] ...
+      http://webkit.org/coding/coding-style.html
 
-  The style guidelines this tries to follow are here:
-    http://webkit.org/coding/coding-style.html
+  Path arguments can be files and directories.  If neither a git commit nor
+  paths are passed, then all changes in your source control working directory
+  are checked.
 
-  Every style error is given a confidence score from 1-5, with 5 meaning
-  we are certain of the problem, and 1 meaning it could be a legitimate
-  construct.  This can miss some errors and does not substitute for
-  code review.
+Style errors:
+  This script assigns to every style error a confidence score from 1-5 and
+  a category name.  A confidence score of 5 means the error is certainly
+  a problem, and 1 means it could be fine.
 
-  To prevent specific lines from being linted, add a '// NOLINT' comment to the
-  end of the line.
+  Category names appear in error messages in brackets, for example
+  [whitespace/indent].  See the options section below for an option that
+  displays all available categories and which are reported by default.
 
-  Linted extensions are .cpp, .c and .h.  Other file types are ignored.
+Filters:
+  Use filters to configure what errors to report.  Filters are specified using
+  a comma-separated list of boolean filter rules.  The script reports errors
+  in a category if the category passes the filter, as described below.
 
-  The file parameter is optional and accepts multiple files.  Leaving
-  out the file parameter applies the check to all files considered changed
-  by your source control management system.
+  All categories start out passing.  Boolean filter rules are then evaluated
+  from left to right, with later rules taking precedence.  For example, the
+  rule "+foo" passes any category that starts with "foo", and "-foo" fails
+  any such category.  The filter input "-whitespace,+whitespace/braces" fails
+  the category "whitespace/tab" and passes "whitespace/braces".
 
-  Flags:
+  Examples: --filter=-whitespace,+whitespace/braces
+            --filter=-whitespace,-runtime/printf,+runtime/printf_format
+            --filter=-,+build/include_what_you_use
 
-    verbose=#
-      A number 1-5 that restricts output to errors with a confidence
-      score at or above this value. In particular, the value 1 displays
-      all errors. The default is %(default_verbosity)s.
+Paths:
+  Certain style-checking behavior depends on the paths relative to
+  the WebKit source root of the files being checked.  For example,
+  certain types of errors may be handled differently for files in
+  WebKit/gtk/webkit/ (e.g. by suppressing "readability/naming" errors
+  for files in this directory).
 
-    git-commit=<SingleCommit>
-      Checks the style of everything from the given commit to the local tree.
+  Consequently, if the path relative to the source root cannot be
+  determined for a file being checked, then style checking may not
+  work correctly for that file.  This can occur, for example, if no
+  WebKit checkout can be found, or if the source root can be detected,
+  but one of the files being checked lies outside the source tree.
 
-    output=vs7
-      The output format, which may be one of
-        emacs : to ease emacs parsing
-        vs7   : compatible with Visual Studio
-      Defaults to "%(default_output_format)s". Other formats are unsupported.
+  If a WebKit checkout can be detected and all files being checked
+  are in the source tree, then all paths will automatically be
+  converted to paths relative to the source root prior to checking.
+  This is also useful for display purposes.
 
-    filter=-x,+y,...
-      A comma-separated list of boolean filter rules used to filter
-      which categories of style guidelines to check.  The script checks
-      a category if the category passes the filter rules, as follows.
+  Currently, this command can detect the source root only if the
+  command is run from within a WebKit checkout (i.e. if the current
+  working directory is below the root of a checkout).  In particular,
+  it is not recommended to run this script from a directory outside
+  a checkout.
 
-      Any webkit category starts out passing.  All filter rules are then
-      evaluated left to right, with later rules taking precedence.  For
-      example, the rule "+foo" passes any category that starts with "foo",
-      and "-foo" fails any such category.  The filter input "-whitespace,
-      +whitespace/braces" fails the category "whitespace/tab" and passes
-      "whitespace/braces".
+  Running this script from a top-level WebKit source directory and
+  checking only files in the source tree will ensure that all style
+  checking behaves correctly -- whether or not a checkout can be
+  detected.  This is because all file paths will already be relative
+  to the source root and so will not need to be converted."""
 
-      Examples: --filter=-whitespace,+whitespace/braces
-                --filter=-whitespace,-runtime/printf,+runtime/printf_format
-                --filter=-,+build/include_what_you_use
-
-      Category names appear in error messages in brackets, for example
-      [whitespace/indent].  To see a list of all categories available to
-      %(program_name)s, along with which are enabled by default, pass
-      the empty filter as follows:
-         --filter=
-""" % {'program_name': os.path.basename(sys.argv[0]),
-       'default_verbosity': default_options.verbosity,
-       'default_output_format': default_options.output_format}
-
-    return usage
+_EPILOG = ("This script can miss errors and does not substitute for "
+           "code review.")
 
 
 # This class should not have knowledge of the flag key names.
@@ -109,26 +108,22 @@
 
     Attributes:
       output_format: A string that is the default output format.
-      verbosity: An integer that is the default verbosity level.
+      min_confidence: An integer that is the default minimum confidence level.
 
     """
 
-    def __init__(self, output_format, verbosity):
+    def __init__(self, min_confidence, output_format):
+        self.min_confidence = min_confidence
         self.output_format = output_format
-        self.verbosity = verbosity
 
 
-# FIXME: Eliminate support for "extra_flag_values".
-#
 # This class should not have knowledge of the flag key names.
 class CommandOptionValues(object):
 
     """Stores the option values passed by the user via the command line.
 
     Attributes:
-      extra_flag_values: A string-string dictionary of all flag key-value
-                         pairs that are not otherwise represented by this
-                         class.  The default is the empty dictionary.
+      is_verbose: A boolean value of whether verbose logging is enabled.
 
       filter_rules: The list of filter rules provided by the user.
                     These rules are appended to the base rules and
@@ -138,54 +133,52 @@
       git_commit: A string representing the git commit to check.
                   The default is None.
 
+      min_confidence: An integer between 1 and 5 inclusive that is the
+                      minimum confidence level of style errors to report.
+                      The default is 1, which reports all errors.
+
       output_format: A string that is the output format.  The supported
                      output formats are "emacs" which emacs can parse
                      and "vs7" which Microsoft Visual Studio 7 can parse.
 
-      verbosity: An integer between 1-5 inclusive that restricts output
-                 to errors with a confidence score at or above this value.
-                 The default is 1, which reports all errors.
-
     """
     def __init__(self,
-                 extra_flag_values=None,
                  filter_rules=None,
                  git_commit=None,
-                 output_format="emacs",
-                 verbosity=1):
-        if extra_flag_values is None:
-            extra_flag_values = {}
+                 is_verbose=False,
+                 min_confidence=1,
+                 output_format="emacs"):
         if filter_rules is None:
             filter_rules = []
 
+        if (min_confidence < 1) or (min_confidence > 5):
+            raise ValueError('Invalid "min_confidence" parameter: value '
+                             "must be an integer between 1 and 5 inclusive. "
+                             'Value given: "%s".' % min_confidence)
+
         if output_format not in ("emacs", "vs7"):
             raise ValueError('Invalid "output_format" parameter: '
                              'value must be "emacs" or "vs7". '
                              'Value given: "%s".' % output_format)
 
-        if (verbosity < 1) or (verbosity > 5):
-            raise ValueError('Invalid "verbosity" parameter: '
-                             "value must be an integer between 1-5 inclusive. "
-                             'Value given: "%s".' % verbosity)
-
-        self.extra_flag_values = extra_flag_values
         self.filter_rules = filter_rules
         self.git_commit = git_commit
+        self.is_verbose = is_verbose
+        self.min_confidence = min_confidence
         self.output_format = output_format
-        self.verbosity = verbosity
 
     # Useful for unit testing.
     def __eq__(self, other):
         """Return whether this instance is equal to another."""
-        if self.extra_flag_values != other.extra_flag_values:
-            return False
         if self.filter_rules != other.filter_rules:
             return False
         if self.git_commit != other.git_commit:
             return False
-        if self.output_format != other.output_format:
+        if self.is_verbose != other.is_verbose:
             return False
-        if self.verbosity != other.verbosity:
+        if self.min_confidence != other.min_confidence:
+            return False
+        if self.output_format != other.output_format:
             return False
 
         return True
@@ -212,10 +205,9 @@
           options: A CommandOptionValues instance.
 
         """
-        flags = options.extra_flag_values.copy()
-
+        flags = {}
+        flags['min-confidence'] = options.min_confidence
         flags['output'] = options.output_format
-        flags['verbose'] = options.verbosity
         # Only include the filter flag if user-provided rules are present.
         filter_rules = options.filter_rules
         if filter_rules:
@@ -231,7 +223,6 @@
         return flag_string.strip()
 
 
-# FIXME: Replace the use of getopt.getopt() with optparse.OptionParser.
 class ArgumentParser(object):
 
     # FIXME: Move the documentation of the attributes to the __init__
@@ -256,8 +247,8 @@
                  all_categories,
                  default_options,
                  base_filter_rules=None,
-                 create_usage=None,
-                 stderr_write=None):
+                 mock_stderr=None,
+                 usage=None):
         """Create an ArgumentParser instance.
 
         Args:
@@ -279,31 +270,96 @@
         """
         if base_filter_rules is None:
             base_filter_rules = []
-        if create_usage is None:
-            create_usage = _create_usage
-        if stderr_write is None:
-            stderr_write = sys.stderr.write
+        stderr = sys.stderr if mock_stderr is None else mock_stderr
+        if usage is None:
+            usage = _USAGE
 
         self._all_categories = all_categories
         self._base_filter_rules = base_filter_rules
+
         # FIXME: Rename these to reflect that they are internal.
-        self.create_usage = create_usage
         self.default_options = default_options
-        self.stderr_write = stderr_write
+        self.stderr_write = stderr.write
 
-    def _exit_with_usage(self, error_message=''):
-        """Exit and print a usage string with an optional error message.
+        self._parser = self._create_option_parser(stderr=stderr,
+            usage=usage,
+            default_min_confidence=self.default_options.min_confidence,
+            default_output_format=self.default_options.output_format)
 
-        Args:
-          error_message: A string that is an error message to print.
+    def _create_option_parser(self, stderr, usage,
+                              default_min_confidence, default_output_format):
+        # Since the epilog string is short, it is not necessary to replace
+        # the epilog string with a mock epilog string when testing.
+        # For this reason, we use _EPILOG directly rather than passing it
+        # as an argument like we do for the usage string.
+        parser = OptionParser(usage=usage, epilog=_EPILOG)
 
-        """
-        usage = self.create_usage(self.default_options)
-        self.stderr_write(usage)
+        filter_help = ('set a filter to control what categories of style '
+                       'errors to report.  Specify a filter using a comma-'
+                       'delimited list of boolean filter rules, for example '
+                       '"--filter -whitespace,+whitespace/braces".  To display '
+                       'all categories and which are enabled by default, pass '
+                       """no value (e.g. '-f ""' or '--filter=').""")
+        parser.add_option("-f", "--filter-rules", metavar="RULES",
+                          dest="filter_value", help=filter_help)
+
+        git_help = "check all changes after the given git commit."
+        parser.add_option("-g", "--git-commit", "--git-diff", "--git-since",
+                          metavar="COMMIT", dest="git_since", help=git_help,)
+
+        min_confidence_help = ("set the minimum confidence of style errors "
+                               "to report.  Can be an integer 1-5, with 1 "
+                               "displaying all errors.  Defaults to %default.")
+        parser.add_option("-m", "--min-confidence", metavar="INT",
+                          type="int", dest="min_confidence",
+                          default=default_min_confidence,
+                          help=min_confidence_help)
+
+        output_format_help = ('set the output format, which can be "emacs" '
+                              'or "vs7" (for Visual Studio).  '
+                              'Defaults to "%default".')
+        parser.add_option("-o", "--output-format", metavar="FORMAT",
+                          choices=["emacs", "vs7"],
+                          dest="output_format", default=default_output_format,
+                          help=output_format_help)
+
+        verbose_help = "enable verbose logging."
+        parser.add_option("-v", "--verbose", dest="is_verbose", default=False,
+                          action="store_true", help=verbose_help)
+
+        # Override OptionParser's error() method so that option help will
+        # also display when an error occurs.  Normally, just the usage
+        # string displays and not option help.
+        parser.error = self._parse_error
+
+        # Override OptionParser's print_help() method so that help output
+        # does not render to the screen while running unit tests.
+        print_help = parser.print_help
+        parser.print_help = lambda: print_help(file=stderr)
+
+        return parser
+
+    def _parse_error(self, error_message):
+        """Print the help string and an error message, and exit."""
+        # The method format_help() includes both the usage string and
+        # the flag options.
+        help = self._parser.format_help()
+        # Separate help from the error message with a single blank line.
+        self.stderr_write(help + "\n")
         if error_message:
-            sys.exit('\nFATAL ERROR: ' + error_message)
-        else:
-            sys.exit(1)
+            _log.error(error_message)
+
+        # Since we are using this method to replace/override the Python
+        # module optparse's OptionParser.error() method, we match its
+        # behavior and exit with status code 2.
+        #
+        # As additional background, Python documentation says--
+        #
+        # "Unix programs generally use 2 for command line syntax errors
+        #  and 1 for all other kind of errors."
+        #
+        # (from http://docs.python.org/library/sys.html#sys.exit )
+        sys.exit(2)
 
     def _exit_with_categories(self):
         """Exit and print the style categories and default filter rules."""
@@ -335,90 +391,67 @@
             filters.append(filter)
         return filters
 
-    def parse(self, args, extra_flags=None):
+    def parse(self, args):
         """Parse the command line arguments to check-webkit-style.
 
         Args:
           args: A list of command-line arguments as returned by sys.argv[1:].
-          extra_flags: A list of flags whose values we want to extract, but
-                       are not supported by the CommandOptionValues class.
-                       An example flag "new_flag=". This defaults to the
-                       empty list.
 
         Returns:
-          A tuple of (filenames, options)
+          A tuple of (paths, options)
 
-          filenames: The list of filenames to check.
+          paths: The list of paths to check.
           options: A CommandOptionValues instance.
 
         """
-        if extra_flags is None:
-            extra_flags = []
+        (options, paths) = self._parser.parse_args(args=args)
 
-        output_format = self.default_options.output_format
-        verbosity = self.default_options.verbosity
+        filter_value = options.filter_value
+        git_commit = options.git_since
+        is_verbose = options.is_verbose
+        min_confidence = options.min_confidence
+        output_format = options.output_format
 
-        # The flags already supported by the CommandOptionValues class.
-        flags = ['help', 'output=', 'verbose=', 'filter=', 'git-commit=']
+        if filter_value is not None and not filter_value:
+            # Then the user explicitly passed no filter, for
+            # example "-f ''" or "--filter=".
+            self._exit_with_categories()
 
-        for extra_flag in extra_flags:
-            if extra_flag in flags:
-                raise ValueError('Flag \'%(extra_flag)s is duplicated '
-                                 'or already supported.' %
-                                 {'extra_flag': extra_flag})
-            flags.append(extra_flag)
+        # Validate user-provided values.
+
+        if paths and git_commit:
+            self._parse_error('You cannot provide both paths and a git '
+                              'commit at the same time.')
+
+        # FIXME: Add unit tests.
+        if git_commit and '..' in git_commit:
+            # FIXME: If the range is a "...", the code should find the common
+            #        ancestor and start there.  See git diff --help for how
+            #        "..." usually works.
+            self._parse_error('invalid --git-commit option: option does '
+                              'not support ranges "..": %s' % git_commit)
+
+        min_confidence = int(min_confidence)
+        if (min_confidence < 1) or (min_confidence > 5):
+            self._parse_error('option --min-confidence: invalid integer: '
+                              '%s: value must be between 1 and 5'
+                              % min_confidence)
+
+        if filter_value:
+            filter_rules = self._parse_filter_flag(filter_value)
+        else:
+            filter_rules = []
 
         try:
-            (opts, filenames) = getopt.getopt(args, '', flags)
-        except getopt.GetoptError:
-            # FIXME: Settle on an error handling approach: come up
-            #        with a consistent guideline as to when and whether
-            #        a ValueError should be raised versus calling
-            #        sys.exit when needing to interrupt execution.
-            self._exit_with_usage('Invalid arguments.')
+            validate_filter_rules(filter_rules, self._all_categories)
+        except ValueError, err:
+            self._parse_error(err)
 
-        extra_flag_values = {}
-        git_commit = None
-        filter_rules = []
+        options = CommandOptionValues(filter_rules=filter_rules,
+                                      git_commit=git_commit,
+                                      is_verbose=is_verbose,
+                                      min_confidence=min_confidence,
+                                      output_format=output_format)
 
-        for (opt, val) in opts:
-            if opt == '--help':
-                self._exit_with_usage()
-            elif opt == '--output':
-                output_format = val
-            elif opt == '--verbose':
-                verbosity = val
-            elif opt == '--git-commit':
-                git_commit = val
-            elif opt == '--filter':
-                if not val:
-                    self._exit_with_categories()
-                filter_rules = self._parse_filter_flag(val)
-            else:
-                extra_flag_values[opt] = val
-
-        # Check validity of resulting values.
-        if filenames and (git_commit != None):
-            self._exit_with_usage('It is not possible to check files and a '
-                                  'specific commit at the same time.')
-
-        if output_format not in ('emacs', 'vs7'):
-            raise ValueError('Invalid --output value "%s": The only '
-                             'allowed output formats are emacs and vs7.' %
-                             output_format)
-
-        validate_filter_rules(filter_rules, self._all_categories)
-
-        verbosity = int(verbosity)
-        if (verbosity < 1) or (verbosity > 5):
-            raise ValueError('Invalid --verbose value %s: value must '
-                             'be between 1-5.' % verbosity)
-
-        options = CommandOptionValues(extra_flag_values=extra_flag_values,
-                                 filter_rules=filter_rules,
-                                 git_commit=git_commit,
-                                 output_format=output_format,
-                                 verbosity=verbosity)
-
-        return (filenames, options)
+        return (paths, options)
 
diff --git a/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py b/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py
index f23c5d1..1c525c6 100644
--- a/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py
@@ -24,22 +24,11 @@
 
 import unittest
 
-from optparser import _create_usage
-from optparser import ArgumentParser
-from optparser import ArgumentPrinter
-from optparser import CommandOptionValues as ProcessorOptions
-from optparser import DefaultCommandOptionValues
-
-
-class CreateUsageTest(unittest.TestCase):
-
-    """Tests the _create_usage() function."""
-
-    def test_create_usage(self):
-        default_options = DefaultCommandOptionValues(output_format="vs7",
-                                                     verbosity=3)
-        # Exercise the code path to make sure the function does not error out.
-        _create_usage(default_options)
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.style.optparser import ArgumentParser
+from webkitpy.style.optparser import ArgumentPrinter
+from webkitpy.style.optparser import CommandOptionValues as ProcessorOptions
+from webkitpy.style.optparser import DefaultCommandOptionValues
 
 
 class ArgumentPrinterTest(unittest.TestCase):
@@ -50,61 +39,65 @@
 
     def _create_options(self,
                         output_format='emacs',
-                        verbosity=3,
+                        min_confidence=3,
                         filter_rules=[],
-                        git_commit=None,
-                        extra_flag_values={}):
-        return ProcessorOptions(extra_flag_values=extra_flag_values,
-                                filter_rules=filter_rules,
+                        git_commit=None):
+        return ProcessorOptions(filter_rules=filter_rules,
                                 git_commit=git_commit,
-                                output_format=output_format,
-                                verbosity=verbosity)
+                                min_confidence=min_confidence,
+                                output_format=output_format)
 
     def test_to_flag_string(self):
-        options = self._create_options('vs7', 5, ['+foo', '-bar'], 'git',
-                                       {'a': 0, 'z': 1})
-        self.assertEquals('--a=0 --filter=+foo,-bar --git-commit=git '
-                          '--output=vs7 --verbose=5 --z=1',
+        options = self._create_options('vs7', 5, ['+foo', '-bar'], 'git')
+        self.assertEquals('--filter=+foo,-bar --git-commit=git '
+                          '--min-confidence=5 --output=vs7',
                           self._printer.to_flag_string(options))
 
         # This is to check that --filter and --git-commit do not
         # show up when not user-specified.
         options = self._create_options()
-        self.assertEquals('--output=emacs --verbose=3',
+        self.assertEquals('--min-confidence=3 --output=emacs',
                           self._printer.to_flag_string(options))
 
 
-class ArgumentParserTest(unittest.TestCase):
+class ArgumentParserTest(LoggingTestCase):
 
     """Test the ArgumentParser class."""
 
-    def _parse(self):
-        """Return a default parse() function for testing."""
-        return self._create_parser().parse
+    class _MockStdErr(object):
 
-    def _create_defaults(self):
-        """Return a DefaultCommandOptionValues instance for testing."""
-        base_filter_rules = ["-", "+whitespace"]
-        return DefaultCommandOptionValues(output_format="vs7",
-                                          verbosity=3)
-
-    def _create_parser(self):
-        """Return an ArgumentParser instance for testing."""
-        def stderr_write(message):
+        def write(self, message):
             # We do not want the usage string or style categories
             # to print during unit tests, so print nothing.
             return
 
+    def _parse(self, args):
+        """Call a test parser.parse()."""
+        parser = self._create_parser()
+        return parser.parse(args)
+
+    def _create_defaults(self):
+        """Return a DefaultCommandOptionValues instance for testing."""
+        base_filter_rules = ["-", "+whitespace"]
+        return DefaultCommandOptionValues(min_confidence=3,
+                                          output_format="vs7")
+
+    def _create_parser(self):
+        """Return an ArgumentParser instance for testing."""
         default_options = self._create_defaults()
 
         all_categories = ["build" ,"whitespace"]
+
+        mock_stderr = self._MockStdErr()
+
         return ArgumentParser(all_categories=all_categories,
                               base_filter_rules=[],
                               default_options=default_options,
-                              stderr_write=stderr_write)
+                              mock_stderr=mock_stderr,
+                              usage="test usage")
 
     def test_parse_documentation(self):
-        parse = self._parse()
+        parse = self._parse
 
         # FIXME: Test both the printing of the usage string and the
         #        filter categories help.
@@ -115,56 +108,75 @@
         self.assertRaises(SystemExit, parse, ['--filter='])
 
     def test_parse_bad_values(self):
-        parse = self._parse()
+        parse = self._parse
 
         # Pass an unsupported argument.
         self.assertRaises(SystemExit, parse, ['--bad'])
+        self.assertLog(['ERROR: no such option: --bad\n'])
 
-        self.assertRaises(ValueError, parse, ['--verbose=bad'])
-        self.assertRaises(ValueError, parse, ['--verbose=0'])
-        self.assertRaises(ValueError, parse, ['--verbose=6'])
-        parse(['--verbose=1']) # works
-        parse(['--verbose=5']) # works
+        self.assertRaises(SystemExit, parse, ['--git-diff=aa..bb'])
+        self.assertLog(['ERROR: invalid --git-commit option: '
+                        'option does not support ranges "..": aa..bb\n'])
 
-        self.assertRaises(ValueError, parse, ['--output=bad'])
+        self.assertRaises(SystemExit, parse, ['--min-confidence=bad'])
+        self.assertLog(['ERROR: option --min-confidence: '
+                        "invalid integer value: 'bad'\n"])
+        self.assertRaises(SystemExit, parse, ['--min-confidence=0'])
+        self.assertLog(['ERROR: option --min-confidence: invalid integer: 0: '
+                        'value must be between 1 and 5\n'])
+        self.assertRaises(SystemExit, parse, ['--min-confidence=6'])
+        self.assertLog(['ERROR: option --min-confidence: invalid integer: 6: '
+                        'value must be between 1 and 5\n'])
+        parse(['--min-confidence=1']) # works
+        parse(['--min-confidence=5']) # works
+
+        self.assertRaises(SystemExit, parse, ['--output=bad'])
+        self.assertLog(['ERROR: option --output-format: invalid choice: '
+                        "'bad' (choose from 'emacs', 'vs7')\n"])
         parse(['--output=vs7']) # works
 
         # Pass a filter rule not beginning with + or -.
-        self.assertRaises(ValueError, parse, ['--filter=build'])
+        self.assertRaises(SystemExit, parse, ['--filter=build'])
+        self.assertLog(['ERROR: Invalid filter rule "build": '
+                        'every rule must start with + or -.\n'])
         parse(['--filter=+build']) # works
         # Pass files and git-commit at the same time.
-        self.assertRaises(SystemExit, parse, ['--git-commit=', 'file.txt'])
-        # Pass an extra flag already supported.
-        self.assertRaises(ValueError, parse, [], ['filter='])
-        parse([], ['extra=']) # works
-        # Pass an extra flag with typo.
-        self.assertRaises(SystemExit, parse, ['--extratypo='], ['extra='])
-        parse(['--extra='], ['extra=']) # works
-        self.assertRaises(ValueError, parse, [], ['extra=', 'extra='])
-
+        self.assertRaises(SystemExit, parse, ['--git-commit=committish',
+                                              'file.txt'])
+        self.assertLog(['ERROR: You cannot provide both paths and '
+                        'a git commit at the same time.\n'])
 
     def test_parse_default_arguments(self):
-        parse = self._parse()
+        parse = self._parse
 
         (files, options) = parse([])
 
         self.assertEquals(files, [])
 
-        self.assertEquals(options.output_format, 'vs7')
-        self.assertEquals(options.verbosity, 3)
         self.assertEquals(options.filter_rules, [])
         self.assertEquals(options.git_commit, None)
+        self.assertEquals(options.is_verbose, False)
+        self.assertEquals(options.min_confidence, 3)
+        self.assertEquals(options.output_format, 'vs7')
 
     def test_parse_explicit_arguments(self):
-        parse = self._parse()
+        parse = self._parse
 
         # Pass non-default explicit values.
+        (files, options) = parse(['--min-confidence=4'])
+        self.assertEquals(options.min_confidence, 4)
         (files, options) = parse(['--output=emacs'])
         self.assertEquals(options.output_format, 'emacs')
-        (files, options) = parse(['--verbose=4'])
-        self.assertEquals(options.verbosity, 4)
+        (files, options) = parse(['-g', 'commit'])
+        self.assertEquals(options.git_commit, 'commit')
         (files, options) = parse(['--git-commit=commit'])
         self.assertEquals(options.git_commit, 'commit')
+        (files, options) = parse(['--git-diff=commit'])
+        self.assertEquals(options.git_commit, 'commit')
+        (files, options) = parse(['--git-since=commit'])
+        self.assertEquals(options.git_commit, 'commit')
+        (files, options) = parse(['--verbose'])
+        self.assertEquals(options.is_verbose, True)
 
         # Pass user_rules.
         (files, options) = parse(['--filter=+build,-whitespace'])
@@ -176,16 +188,8 @@
         self.assertEquals(options.filter_rules,
                           ["+build", "-whitespace"])
 
-        # Pass extra flag values.
-        (files, options) = parse(['--extra'], ['extra'])
-        self.assertEquals(options.extra_flag_values, {'--extra': ''})
-        (files, options) = parse(['--extra='], ['extra='])
-        self.assertEquals(options.extra_flag_values, {'--extra': ''})
-        (files, options) = parse(['--extra=x'], ['extra='])
-        self.assertEquals(options.extra_flag_values, {'--extra': 'x'})
-
     def test_parse_files(self):
-        parse = self._parse()
+        parse = self._parse
 
         (files, options) = parse(['foo.cpp'])
         self.assertEquals(files, ['foo.cpp'])
@@ -203,56 +207,60 @@
         """Test __init__ constructor."""
         # Check default parameters.
         options = ProcessorOptions()
-        self.assertEquals(options.extra_flag_values, {})
         self.assertEquals(options.filter_rules, [])
         self.assertEquals(options.git_commit, None)
+        self.assertEquals(options.is_verbose, False)
+        self.assertEquals(options.min_confidence, 1)
         self.assertEquals(options.output_format, "emacs")
-        self.assertEquals(options.verbosity, 1)
 
         # Check argument validation.
         self.assertRaises(ValueError, ProcessorOptions, output_format="bad")
         ProcessorOptions(output_format="emacs") # No ValueError: works
         ProcessorOptions(output_format="vs7") # works
-        self.assertRaises(ValueError, ProcessorOptions, verbosity=0)
-        self.assertRaises(ValueError, ProcessorOptions, verbosity=6)
-        ProcessorOptions(verbosity=1) # works
-        ProcessorOptions(verbosity=5) # works
+        self.assertRaises(ValueError, ProcessorOptions, min_confidence=0)
+        self.assertRaises(ValueError, ProcessorOptions, min_confidence=6)
+        ProcessorOptions(min_confidence=1) # works
+        ProcessorOptions(min_confidence=5) # works
 
         # Check attributes.
-        options = ProcessorOptions(extra_flag_values={"extra_value" : 2},
-                                   filter_rules=["+"],
+        options = ProcessorOptions(filter_rules=["+"],
                                    git_commit="commit",
-                                   output_format="vs7",
-                                   verbosity=3)
-        self.assertEquals(options.extra_flag_values, {"extra_value" : 2})
+                                   is_verbose=True,
+                                   min_confidence=3,
+                                   output_format="vs7")
         self.assertEquals(options.filter_rules, ["+"])
         self.assertEquals(options.git_commit, "commit")
+        self.assertEquals(options.is_verbose, True)
+        self.assertEquals(options.min_confidence, 3)
         self.assertEquals(options.output_format, "vs7")
-        self.assertEquals(options.verbosity, 3)
 
     def test_eq(self):
         """Test __eq__ equality function."""
-        # == calls __eq__.
-        self.assertTrue(ProcessorOptions() == ProcessorOptions())
+        self.assertTrue(ProcessorOptions().__eq__(ProcessorOptions()))
 
-        # Verify that a difference in any argument causes equality to fail.
-        options = ProcessorOptions(extra_flag_values={"extra_value" : 1},
-                                   filter_rules=["+"],
-                                   git_commit="commit",
-                                   output_format="vs7",
-                                   verbosity=1)
-        self.assertFalse(options == ProcessorOptions(extra_flag_values=
-                                                     {"extra_value" : 2}))
-        self.assertFalse(options == ProcessorOptions(filter_rules=["-"]))
-        self.assertFalse(options == ProcessorOptions(git_commit="commit2"))
-        self.assertFalse(options == ProcessorOptions(output_format="emacs"))
-        self.assertFalse(options == ProcessorOptions(verbosity=2))
+        # Also verify that a difference in any argument causes equality to fail.
+
+        # Explicitly create a ProcessorOptions instance with all default
+        # values.  We do this to be sure we are assuming the right default
+        # values in our self.assertFalse() calls below.
+        options = ProcessorOptions(filter_rules=[],
+                                   git_commit=None,
+                                   is_verbose=False,
+                                   min_confidence=1,
+                                   output_format="emacs")
+        # Verify that we created options correctly.
+        self.assertTrue(options.__eq__(ProcessorOptions()))
+
+        self.assertFalse(options.__eq__(ProcessorOptions(filter_rules=["+"])))
+        self.assertFalse(options.__eq__(ProcessorOptions(git_commit="commit")))
+        self.assertFalse(options.__eq__(ProcessorOptions(is_verbose=True)))
+        self.assertFalse(options.__eq__(ProcessorOptions(min_confidence=2)))
+        self.assertFalse(options.__eq__(ProcessorOptions(output_format="vs7")))
 
     def test_ne(self):
         """Test __ne__ inequality function."""
-        # != calls __ne__.
         # By default, __ne__ always returns true on different objects.
         # Thus, just check the distinguishing case to verify that the
         # code defines __ne__.
-        self.assertFalse(ProcessorOptions() != ProcessorOptions())
+        self.assertFalse(ProcessorOptions().__ne__(ProcessorOptions()))
 
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/common.py b/WebKitTools/Scripts/webkitpy/style/processors/common.py
index dbf4bea..30b8fed 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/common.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/common.py
@@ -20,7 +20,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-"""Supports style checking not specific to any one processor."""
+"""Supports style checking not specific to any one file type."""
 
 
 # FIXME: Test this list in the same way that the list of CppProcessor
@@ -33,27 +33,25 @@
 ])
 
 
-def check_no_carriage_return(line, line_number, error):
-    """Check that a line does not end with a carriage return.
+class CarriageReturnProcessor(object):
 
-    Returns true if the check is successful (i.e. if the line does not
-    end with a carriage return), and false otherwise.
+    """Supports checking for and handling carriage returns."""
 
-    Args:
-      line: A string that is the line to check.
-      line_number: The line number.
-      error: The function to call with any errors found.
+    def __init__(self, handle_style_error):
+        self._handle_style_error = handle_style_error
 
-    """
+    def process(self, lines):
+        """Check for and strip trailing carriage returns from lines."""
+        for line_number in range(len(lines)):
+            if not lines[line_number].endswith("\r"):
+                continue
 
-    if line.endswith("\r"):
-        error(line_number,
-              "whitespace/carriage_return",
-              1,
-              "One or more unexpected \\r (^M) found; "
-              "better to use only a \\n")
-        return False
+            self._handle_style_error(line_number + 1,  # Correct for offset.
+                                     "whitespace/carriage_return",
+                                     1,
+                                     "One or more unexpected \\r (^M) found; "
+                                     "better to use only a \\n")
 
-    return True
+            lines[line_number] = lines[line_number].rstrip("\r")
 
-
+        return lines
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py
index 9362b65..3dde7b9 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py
@@ -22,10 +22,9 @@
 
 """Unit tests for common.py."""
 
-
 import unittest
 
-from common import check_no_carriage_return
+from common import CarriageReturnProcessor
 
 
 # FIXME: The unit tests for the cpp, text, and common processors should
@@ -33,13 +32,15 @@
 #        mock style error handling code and the code to check that all
 #        of a processor's categories are covered by the unit tests.
 #        Such shared code can be located in a shared test file, perhaps
-#        ilke this one.
-class CarriageReturnTest(unittest.TestCase):
+#        even this file.
+class CarriageReturnProcessorTest(unittest.TestCase):
 
     """Tests check_no_carriage_return()."""
 
     _category = "whitespace/carriage_return"
     _confidence = 1
+    _expected_message = ("One or more unexpected \\r (^M) found; "
+                         "better to use only a \\n")
 
     def setUp(self):
         self._style_errors = [] # The list of accumulated style errors.
@@ -50,33 +51,44 @@
         error = (line_number, category, confidence, message)
         self._style_errors.append(error)
 
-    def assert_carriage_return(self, line, is_error):
-        """Call check_no_carriage_return() and assert the result."""
-        line_number = 100
+    def assert_carriage_return(self, input_lines, expected_lines, error_lines):
+        """Process the given line and assert that the result is correct."""
         handle_style_error = self._mock_style_error_handler
 
-        check_no_carriage_return(line, line_number, handle_style_error)
+        processor = CarriageReturnProcessor(handle_style_error)
+        output_lines = processor.process(input_lines)
 
-        expected_message = ("One or more unexpected \\r (^M) found; "
-                            "better to use only a \\n")
+        # Check both the return value and error messages.
+        self.assertEquals(output_lines, expected_lines)
 
-        if is_error:
-            expected_errors = [(line_number, self._category, self._confidence,
-                                expected_message)]
-            self.assertEquals(self._style_errors, expected_errors)
-        else:
-            self.assertEquals(self._style_errors, [])
+        expected_errors = [(line_number, self._category, self._confidence,
+                            self._expected_message)
+                           for line_number in error_lines]
+        self.assertEquals(self._style_errors, expected_errors)
 
     def test_ends_with_carriage(self):
-        self.assert_carriage_return("carriage return\r", is_error=True)
+        self.assert_carriage_return(["carriage return\r"],
+                                    ["carriage return"],
+                                    [1])
 
     def test_ends_with_nothing(self):
-        self.assert_carriage_return("no carriage return", is_error=False)
+        self.assert_carriage_return(["no carriage return"],
+                                    ["no carriage return"],
+                                    [])
 
     def test_ends_with_newline(self):
-        self.assert_carriage_return("no carriage return\n", is_error=False)
+        self.assert_carriage_return(["no carriage return\n"],
+                                    ["no carriage return\n"],
+                                    [])
 
-    def test_ends_with_carriage_newline(self):
-        # Check_no_carriage_return only() checks the final character.
-        self.assert_carriage_return("carriage\r in a string", is_error=False)
+    def test_carriage_in_middle(self):
+        # The CarriageReturnProcessor checks only the final character
+        # of each line.
+        self.assert_carriage_return(["carriage\r in a string"],
+                                    ["carriage\r in a string"],
+                                    [])
 
+    def test_multiple_errors(self):
+        self.assert_carriage_return(["line1", "line2\r", "line3\r"],
+                                    ["line1", "line2", "line3"],
+                                    [2, 3])
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
index f83ae6a..23be9f9 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
@@ -272,18 +272,18 @@
     """Tracks current function name and the number of lines in its body.
 
     Attributes:
-      verbosity: The verbosity level to use while checking style.
+      min_confidence: The minimum confidence level to use while checking style.
 
     """
 
     _NORMAL_TRIGGER = 250  # for --v=0, 500 for --v=1, etc.
     _TEST_TRIGGER = 400    # about 50% more than _NORMAL_TRIGGER.
 
-    def __init__(self, verbosity):
-        self.verbosity = verbosity
+    def __init__(self, min_confidence):
+        self.min_confidence = min_confidence
+        self.current_function = ''
         self.in_a_function = False
         self.lines_in_function = 0
-        self.current_function = ''
 
     def begin(self, function_name):
         """Start analyzing function body.
@@ -311,7 +311,7 @@
             base_trigger = self._TEST_TRIGGER
         else:
             base_trigger = self._NORMAL_TRIGGER
-        trigger = base_trigger * 2 ** self.verbosity
+        trigger = base_trigger * 2 ** self.min_confidence
 
         if self.lines_in_function > trigger:
             error_level = int(math.log(self.lines_in_function / base_trigger, 2))
@@ -642,6 +642,10 @@
 
     """
 
+    # Restores original filename in case that style checker is invoked from Emacs's
+    # flymake.
+    filename = re.sub(r'_flymake\.h$', '.h', filename)
+
     return sub(r'[-.\s]', '_', os.path.basename(filename))
 
 
@@ -1367,7 +1371,7 @@
 
     if file_extension == 'cpp':
         # C++ should have the & or * beside the type not the variable name.
-        matched = match(r'\s*\w+(?<!\breturn)\s+(?P<pointer_operator>\*|\&)\w+', line)
+        matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
         if matched:
             error(line_number, 'whitespace/declaration', 3,
                   'Declaration has space between type name and %s in %s' % (matched.group('pointer_operator'), matched.group(0).strip()))
@@ -1652,7 +1656,7 @@
         # We check if a closed brace has started a line to see if a
         # one line control statement was previous.
         previous_line = clean_lines.elided[line_number - 2]
-        if (previous_line.find('{') > 0
+        if (previous_line.find('{') > 0 and previous_line.find('}') < 0
             and search(r'\b(if|for|foreach|while|else)\b', previous_line)):
             error(line_number, 'whitespace/braces', 4,
                   'One line control clauses should not use braces.')
@@ -2769,9 +2773,7 @@
     # found.
     # e.g. If the file name is 'foo_flymake.cpp', we should search for 'foo.h'
     # instead of 'foo_flymake.h'
-    emacs_flymake_suffix = '_flymake.cpp'
-    if abs_filename.endswith(emacs_flymake_suffix):
-        abs_filename = abs_filename[:-len(emacs_flymake_suffix)] + '.cpp'
+    abs_filename = re.sub(r'_flymake\.cpp$', '.cpp', abs_filename)
 
     # include_state is modified during iteration, so we iterate over a copy of
     # the keys.
@@ -2836,7 +2838,7 @@
     check_invalid_increment(clean_lines, line, error)
 
 
-def _process_lines(filename, file_extension, lines, error, verbosity):
+def _process_lines(filename, file_extension, lines, error, min_confidence):
     """Performs lint checks and reports any errors to the given error function.
 
     Args:
@@ -2850,7 +2852,7 @@
              ['// marker so line numbers end in a known way'])
 
     include_state = _IncludeState()
-    function_state = _FunctionState(verbosity)
+    function_state = _FunctionState(min_confidence)
     class_state = _ClassState()
     file_state = _FileState()
 
@@ -2948,7 +2950,8 @@
         'whitespace/todo',
         ])
 
-    def __init__(self, file_path, file_extension, handle_style_error, verbosity):
+    def __init__(self, file_path, file_extension, handle_style_error,
+                 min_confidence):
         """Create a CppProcessor instance.
 
         Args:
@@ -2959,7 +2962,7 @@
         self.file_extension = file_extension
         self.file_path = file_path
         self.handle_style_error = handle_style_error
-        self.verbosity = verbosity
+        self.min_confidence = min_confidence
 
     # Useful for unit testing.
     def __eq__(self, other):
@@ -2970,7 +2973,7 @@
             return False
         if self.handle_style_error != other.handle_style_error:
             return False
-        if self.verbosity != other.verbosity:
+        if self.min_confidence != other.min_confidence:
             return False
 
         return True
@@ -2982,10 +2985,10 @@
 
     def process(self, lines):
         _process_lines(self.file_path, self.file_extension, lines,
-                       self.handle_style_error, self.verbosity)
+                       self.handle_style_error, self.min_confidence)
 
 
 # FIXME: Remove this function (requires refactoring unit tests).
-def process_file_data(filename, file_extension, lines, error, verbosity):
-    processor = CppProcessor(filename, file_extension, error, verbosity)
+def process_file_data(filename, file_extension, lines, error, min_confidence):
+    processor = CppProcessor(filename, file_extension, error, min_confidence)
     processor.process(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
index c786b8e..0a3fe08 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
@@ -119,20 +119,21 @@
     """Provides some useful helper functions for cpp_style tests.
 
     Attributes:
-      verbosity: An integer that is the current verbosity level for
-                 the tests.
+      min_confidence: An integer that is the current minimum confidence
+                      level for the tests.
 
     """
 
-    # FIXME: Refactor the unit tests so the verbosity level is passed
+    # FIXME: Refactor the unit tests so the confidence level is passed
     #        explicitly, just like it is in the real code.
-    verbosity = 1;
+    min_confidence = 1;
 
-    # Helper function to avoid needing to explicitly pass verbosity
+    # Helper function to avoid needing to explicitly pass confidence
     # in all the unit test calls to cpp_style.process_file_data().
     def process_file_data(self, filename, file_extension, lines, error):
-        """Call cpp_style.process_file_data() with the current verbosity."""
-        return cpp_style.process_file_data(filename, file_extension, lines, error, self.verbosity)
+        """Call cpp_style.process_file_data() with the min_confidence."""
+        return cpp_style.process_file_data(filename, file_extension, lines,
+                                           error, self.min_confidence)
 
     # Perform lint on single line of input and return the error message.
     def perform_single_line_lint(self, code, file_name):
@@ -141,7 +142,7 @@
         cpp_style.remove_multi_line_comments(lines, error_collector)
         clean_lines = cpp_style.CleansedLines(lines)
         include_state = cpp_style._IncludeState()
-        function_state = cpp_style._FunctionState(self.verbosity)
+        function_state = cpp_style._FunctionState(self.min_confidence)
         ext = file_name[file_name.rfind('.') + 1:]
         class_state = cpp_style._ClassState()
         file_state = cpp_style._FileState()
@@ -199,7 +200,7 @@
           The accumulated errors.
         """
         error_collector = ErrorCollector(self.assert_)
-        function_state = cpp_style._FunctionState(self.verbosity)
+        function_state = cpp_style._FunctionState(self.min_confidence)
         lines = code.split('\n')
         cpp_style.remove_multi_line_comments(lines, error_collector)
         lines = cpp_style.CleansedLines(lines)
@@ -238,7 +239,7 @@
             if re.search(expected_message_re, message):
                 return
 
-        self.assertEquals(expected_message, messages)
+        self.assertEquals(expected_message_re, messages)
 
     def assert_multi_line_lint(self, code, expected_message, file_name='foo.h'):
         file_extension = file_name[file_name.rfind('.') + 1:]
@@ -1547,6 +1548,7 @@
                          'Declaration has space between type name and * in int *b  [whitespace/declaration] [3]',
                          'foo.cpp')
         self.assert_lint('return *b;', '', 'foo.cpp')
+        self.assert_lint('delete *b;', '', 'foo.cpp')
         self.assert_lint('int *b;', '', 'foo.c')
         self.assert_lint('int* b;',
                          'Declaration has space between * and variable name in int* b  [whitespace/declaration] [3]',
@@ -1734,6 +1736,26 @@
                 '  [build/header_guard] [5]' % expected_guard),
             error_collector.result_list())
 
+        # Special case for flymake
+        error_collector = ErrorCollector(self.assert_)
+        self.process_file_data('mydir/Foo_flymake.h', 'h',
+                               ['#ifndef %s' % expected_guard,
+                                '#define %s' % expected_guard,
+                                '#endif // %s' % expected_guard],
+                               error_collector)
+        for line in error_collector.result_list():
+            if line.find('build/header_guard') != -1:
+                self.fail('Unexpected error: %s' % line)
+
+        error_collector = ErrorCollector(self.assert_)
+        self.process_file_data('mydir/Foo_flymake.h', 'h', [], error_collector)
+        self.assertEquals(
+            1,
+            error_collector.result_list().count(
+                'No #ifndef header guard found, suggested CPP variable is: %s'
+                '  [build/header_guard] [5]' % expected_guard),
+            error_collector.result_list())
+
     def test_build_printf_format(self):
         self.assert_lint(
             r'printf("\%%d", value);',
@@ -2227,11 +2249,11 @@
         cpp_style._FunctionState._TEST_TRIGGER = self.old_test_trigger
 
     # FIXME: Eliminate the need for this function.
-    def set_verbosity(self, verbosity):
-        """Set new test verbosity and return old test verbosity."""
-        old_verbosity = self.verbosity
-        self.verbosity = verbosity
-        return old_verbosity
+    def set_min_confidence(self, min_confidence):
+        """Set new test confidence and return old test confidence."""
+        old_min_confidence = self.min_confidence
+        self.min_confidence = min_confidence
+        return old_min_confidence
 
     def assert_function_lengths_check(self, code, expected_message):
         """Check warnings for long function bodies are as expected.
@@ -2272,7 +2294,7 @@
           lines: Number of lines to generate.
           error_level:  --v setting for cpp_style.
         """
-        trigger_level = self.trigger_lines(self.verbosity)
+        trigger_level = self.trigger_lines(self.min_confidence)
         self.assert_function_lengths_check(
             'void test(int x)' + self.function_body(lines),
             ('Small and focused functions are preferred: '
@@ -2355,29 +2377,29 @@
             '')
 
     def test_function_length_check_definition_below_severity0(self):
-        old_verbosity = self.set_verbosity(0)
+        old_min_confidence = self.set_min_confidence(0)
         self.assert_function_length_check_definition_ok(self.trigger_lines(0) - 1)
-        self.set_verbosity(old_verbosity)
+        self.set_min_confidence(old_min_confidence)
 
     def test_function_length_check_definition_at_severity0(self):
-        old_verbosity = self.set_verbosity(0)
+        old_min_confidence = self.set_min_confidence(0)
         self.assert_function_length_check_definition_ok(self.trigger_lines(0))
-        self.set_verbosity(old_verbosity)
+        self.set_min_confidence(old_min_confidence)
 
     def test_function_length_check_definition_above_severity0(self):
-        old_verbosity = self.set_verbosity(0)
+        old_min_confidence = self.set_min_confidence(0)
         self.assert_function_length_check_above_error_level(0)
-        self.set_verbosity(old_verbosity)
+        self.set_min_confidence(old_min_confidence)
 
     def test_function_length_check_definition_below_severity1v0(self):
-        old_verbosity = self.set_verbosity(0)
+        old_min_confidence = self.set_min_confidence(0)
         self.assert_function_length_check_below_error_level(1)
-        self.set_verbosity(old_verbosity)
+        self.set_min_confidence(old_min_confidence)
 
     def test_function_length_check_definition_at_severity1v0(self):
-        old_verbosity = self.set_verbosity(0)
+        old_min_confidence = self.set_min_confidence(0)
         self.assert_function_length_check_at_error_level(1)
-        self.set_verbosity(old_verbosity)
+        self.set_min_confidence(old_min_confidence)
 
     def test_function_length_check_definition_below_severity1(self):
         self.assert_function_length_check_definition_ok(self.trigger_lines(1) - 1)
@@ -2391,7 +2413,7 @@
     def test_function_length_check_definition_severity1_plus_blanks(self):
         error_level = 1
         error_lines = self.trigger_lines(error_level) + 1
-        trigger_level = self.trigger_lines(self.verbosity)
+        trigger_level = self.trigger_lines(self.min_confidence)
         self.assert_function_lengths_check(
             'void test_blanks(int x)' + self.function_body(error_lines),
             ('Small and focused functions are preferred: '
@@ -2403,7 +2425,7 @@
     def test_function_length_check_complex_definition_severity1(self):
         error_level = 1
         error_lines = self.trigger_lines(error_level) + 1
-        trigger_level = self.trigger_lines(self.verbosity)
+        trigger_level = self.trigger_lines(self.min_confidence)
         self.assert_function_lengths_check(
             ('my_namespace::my_other_namespace::MyVeryLongTypeName*\n'
              'my_namespace::my_other_namespace::MyFunction(int arg1, char* arg2)'
@@ -2418,7 +2440,7 @@
     def test_function_length_check_definition_severity1_for_test(self):
         error_level = 1
         error_lines = self.trigger_test_lines(error_level) + 1
-        trigger_level = self.trigger_test_lines(self.verbosity)
+        trigger_level = self.trigger_test_lines(self.min_confidence)
         self.assert_function_lengths_check(
             'TEST_F(Test, Mutator)' + self.function_body(error_lines),
             ('Small and focused functions are preferred: '
@@ -2430,7 +2452,7 @@
     def test_function_length_check_definition_severity1_for_split_line_test(self):
         error_level = 1
         error_lines = self.trigger_test_lines(error_level) + 1
-        trigger_level = self.trigger_test_lines(self.verbosity)
+        trigger_level = self.trigger_test_lines(self.min_confidence)
         self.assert_function_lengths_check(
             ('TEST_F(GoogleUpdateRecoveryRegistryProtectedTest,\n'
              '    FixGoogleUpdate_AllValues_MachineApp)'  # note: 4 spaces
@@ -2445,7 +2467,7 @@
     def test_function_length_check_definition_severity1_for_bad_test_doesnt_break(self):
         error_level = 1
         error_lines = self.trigger_test_lines(error_level) + 1
-        trigger_level = self.trigger_test_lines(self.verbosity)
+        trigger_level = self.trigger_test_lines(self.min_confidence)
         self.assert_function_lengths_check(
             ('TEST_F('
              + self.function_body(error_lines)),
@@ -2458,7 +2480,7 @@
     def test_function_length_check_definition_severity1_with_embedded_no_lints(self):
         error_level = 1
         error_lines = self.trigger_lines(error_level) + 1
-        trigger_level = self.trigger_lines(self.verbosity)
+        trigger_level = self.trigger_lines(self.min_confidence)
         self.assert_function_lengths_check(
             'void test(int x)' + self.function_body_with_no_lints(error_lines),
             ('Small and focused functions are preferred: '
@@ -3063,6 +3085,20 @@
             '}\n',
             ['More than one command on the same line in if  [whitespace/parens] [4]',
              'One line control clauses should not use braces.  [whitespace/braces] [4]'])
+        self.assert_multi_line_lint(
+            'void func()\n'
+            '{\n'
+            '    while (condition) { }\n'
+            '    return 0;\n'
+            '}\n',
+            '')
+        self.assert_multi_line_lint(
+            'void func()\n'
+            '{\n'
+            '    for (i = 0; i < 42; i++) { foobar(); }\n'
+            '    return 0;\n'
+            '}\n',
+            'More than one command on the same line in for  [whitespace/parens] [4]')
 
         # 3. An else if statement should be written as an if statement
         #    when the prior if concludes with a return statement.
@@ -3653,7 +3689,7 @@
         self.assertEquals(processor.file_extension, "h")
         self.assertEquals(processor.file_path, "foo")
         self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
-        self.assertEquals(processor.verbosity, 3)
+        self.assertEquals(processor.min_confidence, 3)
 
     def test_eq(self):
         """Test __eq__ equality function."""
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python.py b/WebKitTools/Scripts/webkitpy/style/processors/python.py
new file mode 100644
index 0000000..8ab936d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/processors/python.py
@@ -0,0 +1,56 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Supports checking WebKit style in Python files."""
+
+from ...style_references import pep8
+
+
+class PythonProcessor(object):
+
+    """Processes text lines for checking style."""
+
+    def __init__(self, file_path, handle_style_error):
+        self._file_path = file_path
+        self._handle_style_error = handle_style_error
+
+    def process(self, lines):
+        # Initialize pep8.options, which is necessary for
+        # Checker.check_all() to execute.
+        pep8.process_options(arglist=[self._file_path])
+
+        checker = pep8.Checker(self._file_path)
+
+        def _pep8_handle_error(line_number, offset, text, check):
+            # FIXME: Incorporate the character offset into the error output.
+            #        This will require updating the error handler __call__
+            #        signature to include an optional "offset" parameter.
+            pep8_code = text[:4]
+            pep8_message = text[5:]
+
+            category = "pep8/" + pep8_code
+
+            self._handle_style_error(line_number, category, 5, pep8_message)
+
+        checker.report_error = _pep8_handle_error
+
+        errors = checker.check_all()
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py
new file mode 100644
index 0000000..3ce3311
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Unit tests for python.py."""
+
+import os
+import unittest
+
+from python import PythonProcessor
+
+
+class PythonProcessorTest(unittest.TestCase):
+
+    """Tests the PythonProcessor class."""
+
+    def test_init(self):
+        """Test __init__() method."""
+        def _mock_handle_style_error(self):
+            pass
+
+        processor = PythonProcessor("foo.txt", _mock_handle_style_error)
+        self.assertEquals(processor._file_path, "foo.txt")
+        self.assertEquals(processor._handle_style_error,
+                          _mock_handle_style_error)
+
+    def test_process(self):
+        """Test process() method."""
+        errors = []
+
+        def _mock_handle_style_error(line_number, category, confidence,
+                                     message):
+            error = (line_number, category, confidence, message)
+            errors.append(error)
+
+        current_dir = os.path.dirname(__file__)
+        file_path = os.path.join(current_dir, "python_unittest_input.py")
+
+        processor = PythonProcessor(file_path, _mock_handle_style_error)
+        processor.process(lines=[])
+
+        self.assertEquals(len(errors), 1)
+        self.assertEquals(errors[0],
+                          (2, "pep8/W291", 5, "trailing whitespace"))
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py
new file mode 100644
index 0000000..9f1d118
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/processors/python_unittest_input.py
@@ -0,0 +1,2 @@
+# This file is sample input for python_unittest.py and includes a single
+# error which is an extra space at the end of this line. 
diff --git a/WebKitTools/Scripts/webkitpy/style/unittests.py b/WebKitTools/Scripts/webkitpy/style/unittests.py
deleted file mode 100644
index 62615ab..0000000
--- a/WebKitTools/Scripts/webkitpy/style/unittests.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
-#
-# 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 Apple Computer, Inc. ("Apple") 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.
-
-"""Runs style package unit tests."""
-
-# This module is imported by test-webkitpy.
-
-import sys
-import unittest
-
-from checker_unittest import *
-from error_handlers_unittest import *
-from filter_unittest import *
-from optparser_unittest import *
-from processors.common_unittest import *
-from processors.cpp_unittest import *
-from processors.text_unittest import *
diff --git a/WebKitTools/Scripts/webkitpy/style_references.py b/WebKitTools/Scripts/webkitpy/style_references.py
index 2528c4d..ba2806e 100644
--- a/WebKitTools/Scripts/webkitpy/style_references.py
+++ b/WebKitTools/Scripts/webkitpy/style_references.py
@@ -40,8 +40,20 @@
 
 import os
 
-from diff_parser import DiffParser
-from scm import detect_scm_system
+from webkitpy.common.checkout.diff_parser import DiffParser
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.common.system.logtesting import TestLogStream
+from webkitpy.common.system.logutils import configure_logging
+from webkitpy.common.checkout.scm import detect_scm_system
+from webkitpy.thirdparty.autoinstalled import pep8
+
+
+def detect_checkout():
+    """Return a WebKitCheckout instance, or None if it cannot be found."""
+    cwd = os.path.abspath(os.curdir)
+    scm = detect_scm_system(cwd)
+
+    return None if scm is None else WebKitCheckout(scm)
 
 
 def parse_patch(patch_string):
@@ -52,16 +64,15 @@
     return patch.files
 
 
-class SimpleScm(object):
+class WebKitCheckout(object):
 
-    """Simple facade to SCM for use by style package."""
+    """Simple facade to the SCM class for use by style package."""
 
-    def __init__(self):
-        cwd = os.path.abspath('.')
-        self._scm = detect_scm_system(cwd)
+    def __init__(self, scm):
+        self._scm = scm
 
-    def checkout_root(self):
-        """Return the source control root as an absolute path."""
+    def root_path(self):
+        """Return the checkout root as an absolute path."""
         return self._scm.checkout_root
 
     def create_patch(self):
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/test/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/test/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/test/main.py b/WebKitTools/Scripts/webkitpy/test/main.py
new file mode 100644
index 0000000..daf255f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/main.py
@@ -0,0 +1,129 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+"""Contains the entry method for test-webkitpy."""
+
+import logging
+import os
+import sys
+import unittest
+
+import webkitpy
+
+
+_log = logging.getLogger(__name__)
+
+
+class Tester(object):
+
+    """Discovers and runs webkitpy unit tests."""
+
+    def _find_unittest_files(self, webkitpy_dir):
+        """Return a list of paths to all unit-test files."""
+        unittest_paths = []  # Return value.
+
+        for dir_path, dir_names, file_names in os.walk(webkitpy_dir):
+            for file_name in file_names:
+                if not file_name.endswith("_unittest.py"):
+                    continue
+                unittest_path = os.path.join(dir_path, file_name)
+                unittest_paths.append(unittest_path)
+
+        return unittest_paths
+
+    def _modules_from_paths(self, webkitpy_dir, paths):
+        """Return a list of fully-qualified module names given paths."""
+        webkitpy_dir = os.path.abspath(webkitpy_dir)
+        webkitpy_name = os.path.split(webkitpy_dir)[1]  # Equals "webkitpy".
+
+        prefix_length = len(webkitpy_dir)
+
+        modules = []
+        for path in paths:
+            path = os.path.abspath(path)
+            # This gives us, for example: /common/config/ports_unittest.py
+            rel_path = path[prefix_length:]
+            # This gives us, for example: /common/config/ports_unittest
+            rel_path = os.path.splitext(rel_path)[0]
+
+            parts = []
+            while True:
+                (rel_path, tail) = os.path.split(rel_path)
+                if not tail:
+                    break
+                parts.insert(0, tail)
+            # We now have, for example: common.config.ports_unittest
+            parts.insert(0, webkitpy_name)  # Put "webkitpy" at the beginning.
+            module = ".".join(parts)
+            modules.append(module)
+
+        return modules
+
+    def run_tests(self, sys_argv):
+        """Run the unit tests in all *_unittest.py modules in webkitpy.
+
+        This method excludes "webkitpy.common.checkout.scm_unittest" unless
+        the --all option is the second element of sys_argv.
+
+        Args:
+          sys_argv: A reference to sys.argv.
+
+        """
+        if len(sys_argv) > 1 and not sys_argv[-1].startswith("-"):
+            # Then explicit modules or test names were provided, which
+            # the unittest module is equipped to handle.
+            unittest.main(argv=sys_argv, module=None)
+            # No need to return since unitttest.main() exits.
+
+        # Otherwise, auto-detect all unit tests.
+
+        webkitpy_dir = os.path.dirname(webkitpy.__file__)
+        unittest_paths = self._find_unittest_files(webkitpy_dir)
+
+        modules = self._modules_from_paths(webkitpy_dir, unittest_paths)
+        modules.sort()
+
+        # This is a sanity check to ensure that the unit-test discovery
+        # methods are working.
+        if len(modules) < 1:
+            raise Exception("No unit-test modules found.")
+
+        for module in modules:
+            _log.debug("Found: %s" % module)
+
+        # FIXME: This is a hack, but I'm tired of commenting out the test.
+        #        See https://bugs.webkit.org/show_bug.cgi?id=31818
+        if len(sys_argv) > 1 and sys.argv[1] == "--all":
+            sys.argv.remove("--all")
+        else:
+            excluded_module = "webkitpy.common.checkout.scm_unittest"
+            _log.info("Excluding: %s (use --all to include)" % excluded_module)
+            modules.remove(excluded_module)
+
+        sys_argv.extend(modules)
+
+        # We pass None for the module because we do not want the unittest
+        # module to resolve module names relative to a given module.
+        # (This would require importing all of the unittest modules from
+        # this module.)  See the loadTestsFromName() method of the
+        # unittest.TestLoader class for more details on this parameter.
+        unittest.main(argv=sys_argv, module=None)
diff --git a/WebKitTools/Scripts/webkitpy/BeautifulSoup.py b/WebKitTools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
similarity index 100%
rename from WebKitTools/Scripts/webkitpy/BeautifulSoup.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
new file mode 100644
index 0000000..f1e5334
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
@@ -0,0 +1,97 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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. AND ITS 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 APPLE INC. OR ITS 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.
+
+# This module is required for Python to treat this directory as a package.
+
+"""Autoinstalls third-party code required by WebKit."""
+
+import os
+
+from webkitpy.common.system.autoinstall import AutoInstaller
+
+# Putting the autoinstall code into webkitpy/thirdparty/__init__.py
+# ensures that no autoinstalling occurs until a caller imports from
+# webkitpy.thirdparty.  This is useful if the caller wants to configure
+# logging prior to executing autoinstall code.
+
+# FIXME: Ideally, a package should be autoinstalled only if the caller
+#        attempts to import from that individual package.  This would
+#        make autoinstalling lazier than it is currently.  This can
+#        perhaps be done using Python's import hooks as the original
+#        autoinstall implementation did.
+
+# We put auto-installed third-party modules in this directory--
+#
+#     webkitpy/thirdparty/autoinstalled
+thirdparty_dir = os.path.dirname(__file__)
+autoinstalled_dir = os.path.join(thirdparty_dir, "autoinstalled")
+
+# We need to download ClientForm since the mechanize package that we download
+# below requires it.  The mechanize package uses ClientForm, for example,
+# in _html.py.  Since mechanize imports ClientForm in the following way,
+#
+# > import sgmllib, ClientForm
+#
+# the search path needs to include ClientForm.  We put ClientForm in
+# its own directory so that we can include it in the search path without
+# including other modules as a side effect.
+clientform_dir = os.path.join(autoinstalled_dir, "clientform")
+installer = AutoInstaller(append_to_search_path=True,
+                          target_dir=clientform_dir)
+installer.install(url="http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip",
+                  url_subpath="ClientForm.py")
+
+# The remaining packages do not need to be in the search path, so we create
+# a new AutoInstaller instance that does not append to the search path.
+installer = AutoInstaller(target_dir=autoinstalled_dir)
+
+installer.install(url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+                  url_subpath="mechanize")
+installer.install(url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+                  url_subpath="pep8-0.5.0/pep8.py")
+
+
+rietveld_dir = os.path.join(autoinstalled_dir, "rietveld")
+installer = AutoInstaller(target_dir=rietveld_dir)
+installer.install(url="http://webkit-rietveld.googlecode.com/svn/trunk/static/upload.py",
+                  target_name="upload.py")
+
+
+# Since irclib and ircbot are two top-level packages, we need to import
+# them separately.  We group them into an irc package for better
+# organization purposes.
+irc_dir = os.path.join(autoinstalled_dir, "irc")
+installer = AutoInstaller(target_dir=irc_dir)
+installer.install(url="http://iweb.dl.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip",
+                  url_subpath="irclib.py")
+installer.install(url="http://iweb.dl.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip",
+                  url_subpath="ircbot.py")
+
+readme_path = os.path.join(autoinstalled_dir, "README")
+if not os.path.exists(readme_path):
+    file = open(readme_path, "w")
+    try:
+        file.write("This directory is auto-generated by WebKit and is "
+                   "safe to delete.\nIt contains needed third-party Python "
+                   "packages automatically downloaded from the web.")
+    finally:
+        file.close()
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/mock.py b/WebKitTools/Scripts/webkitpy/thirdparty/mock.py
new file mode 100644
index 0000000..015c19e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/mock.py
@@ -0,0 +1,309 @@
+# mock.py
+# Test tools for mocking and patching.
+# Copyright (C) 2007-2009 Michael Foord
+# E-mail: fuzzyman AT voidspace DOT org DOT uk
+
+# mock 0.6.0
+# http://www.voidspace.org.uk/python/mock/
+
+# Released subject to the BSD License
+# Please see http://www.voidspace.org.uk/python/license.shtml
+
+# 2009-11-25: Licence downloaded from above URL.
+# BEGIN DOWNLOADED LICENSE
+#
+# Copyright (c) 2003-2009, Michael Foord
+# All rights reserved.
+# E-mail : fuzzyman AT voidspace DOT org DOT uk
+#
+# 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 Michael Foord nor the name of Voidspace
+#       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.
+#
+# END DOWNLOADED LICENSE
+
+# Scripts maintained at http://www.voidspace.org.uk/python/index.shtml
+# Comments, suggestions and bug reports welcome.
+
+
+__all__ = (
+    'Mock',
+    'patch',
+    'patch_object',
+    'sentinel',
+    'DEFAULT'
+)
+
+__version__ = '0.6.0'
+
+class SentinelObject(object):
+    def __init__(self, name):
+        self.name = name
+
+    def __repr__(self):
+        return '<SentinelObject "%s">' % self.name
+
+
+class Sentinel(object):
+    def __init__(self):
+        self._sentinels = {}
+
+    def __getattr__(self, name):
+        return self._sentinels.setdefault(name, SentinelObject(name))
+
+
+sentinel = Sentinel()
+
+DEFAULT = sentinel.DEFAULT
+
+class OldStyleClass:
+    pass
+ClassType = type(OldStyleClass)
+
+def _is_magic(name):
+    return '__%s__' % name[2:-2] == name
+
+def _copy(value):
+    if type(value) in (dict, list, tuple, set):
+        return type(value)(value)
+    return value
+
+
+class Mock(object):
+
+    def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
+                 name=None, parent=None, wraps=None):
+        self._parent = parent
+        self._name = name
+        if spec is not None and not isinstance(spec, list):
+            spec = [member for member in dir(spec) if not _is_magic(member)]
+
+        self._methods = spec
+        self._children = {}
+        self._return_value = return_value
+        self.side_effect = side_effect
+        self._wraps = wraps
+
+        self.reset_mock()
+
+
+    def reset_mock(self):
+        self.called = False
+        self.call_args = None
+        self.call_count = 0
+        self.call_args_list = []
+        self.method_calls = []
+        for child in self._children.itervalues():
+            child.reset_mock()
+        if isinstance(self._return_value, Mock):
+            self._return_value.reset_mock()
+
+
+    def __get_return_value(self):
+        if self._return_value is DEFAULT:
+            self._return_value = Mock()
+        return self._return_value
+
+    def __set_return_value(self, value):
+        self._return_value = value
+
+    return_value = property(__get_return_value, __set_return_value)
+
+
+    def __call__(self, *args, **kwargs):
+        self.called = True
+        self.call_count += 1
+        self.call_args = (args, kwargs)
+        self.call_args_list.append((args, kwargs))
+
+        parent = self._parent
+        name = self._name
+        while parent is not None:
+            parent.method_calls.append((name, args, kwargs))
+            if parent._parent is None:
+                break
+            name = parent._name + '.' + name
+            parent = parent._parent
+
+        ret_val = DEFAULT
+        if self.side_effect is not None:
+            if (isinstance(self.side_effect, Exception) or
+                isinstance(self.side_effect, (type, ClassType)) and
+                issubclass(self.side_effect, Exception)):
+                raise self.side_effect
+
+            ret_val = self.side_effect(*args, **kwargs)
+            if ret_val is DEFAULT:
+                ret_val = self.return_value
+
+        if self._wraps is not None and self._return_value is DEFAULT:
+            return self._wraps(*args, **kwargs)
+        if ret_val is DEFAULT:
+            ret_val = self.return_value
+        return ret_val
+
+
+    def __getattr__(self, name):
+        if self._methods is not None:
+            if name not in self._methods:
+                raise AttributeError("Mock object has no attribute '%s'" % name)
+        elif _is_magic(name):
+            raise AttributeError(name)
+
+        if name not in self._children:
+            wraps = None
+            if self._wraps is not None:
+                wraps = getattr(self._wraps, name)
+            self._children[name] = Mock(parent=self, name=name, wraps=wraps)
+
+        return self._children[name]
+
+
+    def assert_called_with(self, *args, **kwargs):
+        assert self.call_args == (args, kwargs), 'Expected: %s\nCalled with: %s' % ((args, kwargs), self.call_args)
+
+
+def _dot_lookup(thing, comp, import_path):
+    try:
+        return getattr(thing, comp)
+    except AttributeError:
+        __import__(import_path)
+        return getattr(thing, comp)
+
+
+def _importer(target):
+    components = target.split('.')
+    import_path = components.pop(0)
+    thing = __import__(import_path)
+
+    for comp in components:
+        import_path += ".%s" % comp
+        thing = _dot_lookup(thing, comp, import_path)
+    return thing
+
+
+class _patch(object):
+    def __init__(self, target, attribute, new, spec, create):
+        self.target = target
+        self.attribute = attribute
+        self.new = new
+        self.spec = spec
+        self.create = create
+        self.has_local = False
+
+
+    def __call__(self, func):
+        if hasattr(func, 'patchings'):
+            func.patchings.append(self)
+            return func
+
+        def patched(*args, **keywargs):
+            # don't use a with here (backwards compatability with 2.5)
+            extra_args = []
+            for patching in patched.patchings:
+                arg = patching.__enter__()
+                if patching.new is DEFAULT:
+                    extra_args.append(arg)
+            args += tuple(extra_args)
+            try:
+                return func(*args, **keywargs)
+            finally:
+                for patching in getattr(patched, 'patchings', []):
+                    patching.__exit__()
+
+        patched.patchings = [self]
+        patched.__name__ = func.__name__
+        patched.compat_co_firstlineno = getattr(func, "compat_co_firstlineno",
+                                                func.func_code.co_firstlineno)
+        return patched
+
+
+    def get_original(self):
+        target = self.target
+        name = self.attribute
+        create = self.create
+
+        original = DEFAULT
+        if _has_local_attr(target, name):
+            try:
+                original = target.__dict__[name]
+            except AttributeError:
+                # for instances of classes with slots, they have no __dict__
+                original = getattr(target, name)
+        elif not create and not hasattr(target, name):
+            raise AttributeError("%s does not have the attribute %r" % (target, name))
+        return original
+
+
+    def __enter__(self):
+        new, spec, = self.new, self.spec
+        original = self.get_original()
+        if new is DEFAULT:
+            # XXXX what if original is DEFAULT - shouldn't use it as a spec
+            inherit = False
+            if spec == True:
+                # set spec to the object we are replacing
+                spec = original
+                if isinstance(spec, (type, ClassType)):
+                    inherit = True
+            new = Mock(spec=spec)
+            if inherit:
+                new.return_value = Mock(spec=spec)
+        self.temp_original = original
+        setattr(self.target, self.attribute, new)
+        return new
+
+
+    def __exit__(self, *_):
+        if self.temp_original is not DEFAULT:
+            setattr(self.target, self.attribute, self.temp_original)
+        else:
+            delattr(self.target, self.attribute)
+        del self.temp_original
+
+
+def patch_object(target, attribute, new=DEFAULT, spec=None, create=False):
+    return _patch(target, attribute, new, spec, create)
+
+
+def patch(target, new=DEFAULT, spec=None, create=False):
+    try:
+        target, attribute = target.rsplit('.', 1)
+    except (TypeError, ValueError):
+        raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))
+    target = _importer(target)
+    return _patch(target, attribute, new, spec, create)
+
+
+
+def _has_local_attr(obj, name):
+    try:
+        return name in vars(obj)
+    except TypeError:
+        # objects without a __dict__
+        return hasattr(obj, name)
diff --git a/WebKitTools/pywebsocket/COPYING b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/COPYING
similarity index 100%
rename from WebKitTools/pywebsocket/COPYING
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/COPYING
diff --git a/WebKitTools/pywebsocket/MANIFEST.in b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/MANIFEST.in
similarity index 100%
rename from WebKitTools/pywebsocket/MANIFEST.in
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/MANIFEST.in
diff --git a/WebKitTools/pywebsocket/README b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/README
similarity index 100%
rename from WebKitTools/pywebsocket/README
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/README
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/README.webkit b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/README.webkit
new file mode 100644
index 0000000..83e3cee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/README.webkit
@@ -0,0 +1,14 @@
+This directory contains a copy of the pywebsocket Python module obtained
+from the following location:
+
+http://code.google.com/p/pywebsocket/
+
+This directory currently contains the following version:
+0.4.9.2
+
+The following modifications have been made to this local version:
+minor updates in WebSocketRequestHandler.is_cgi
+
+More information on these local modifications can be found here:
+
+http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py
new file mode 100644
index 0000000..2b976e1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py
@@ -0,0 +1,209 @@
+#!/usr/bin/env python
+#
+# Copyright 2009, 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.
+
+
+"""Web Socket Echo client.
+
+This is an example Web Socket client that talks with echo_wsh.py.
+This may be useful for checking mod_pywebsocket installation.
+
+Note:
+This code is far from robust, e.g., we cut corners in handshake.
+"""
+
+
+import codecs
+from optparse import OptionParser
+import socket
+import sys
+
+
+_TIMEOUT_SEC = 10
+
+_DEFAULT_PORT = 80
+_DEFAULT_SECURE_PORT = 443
+_UNDEFINED_PORT = -1
+
+_UPGRADE_HEADER = 'Upgrade: WebSocket\r\n'
+_CONNECTION_HEADER = 'Connection: Upgrade\r\n'
+_EXPECTED_RESPONSE = (
+        'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
+        _UPGRADE_HEADER +
+        _CONNECTION_HEADER)
+
+_GOODBYE_MESSAGE = 'Goodbye'
+
+
+def _method_line(resource):
+    return 'GET %s HTTP/1.1\r\n' % resource
+
+
+def _origin_header(origin):
+    return 'Origin: %s\r\n' % origin
+
+
+class _TLSSocket(object):
+    """Wrapper for a TLS connection."""
+
+    def __init__(self, raw_socket):
+        self._ssl = socket.ssl(raw_socket)
+
+    def send(self, bytes):
+        return self._ssl.write(bytes)
+
+    def recv(self, size=-1):
+        return self._ssl.read(size)
+
+    def close(self):
+        # Nothing to do.
+        pass
+
+
+class EchoClient(object):
+    """Web Socket echo client."""
+
+    def __init__(self, options):
+        self._options = options
+        self._socket = None
+
+    def run(self):
+        """Run the client.
+
+        Shake hands and then repeat sending message and receiving its echo.
+        """
+        self._socket = socket.socket()
+        self._socket.settimeout(self._options.socket_timeout)
+        try:
+            self._socket.connect((self._options.server_host,
+                                  self._options.server_port))
+            if self._options.use_tls:
+                self._socket = _TLSSocket(self._socket)
+            self._handshake()
+            for line in self._options.message.split(',') + [_GOODBYE_MESSAGE]:
+                frame = '\x00' + line.encode('utf-8') + '\xff'
+                self._socket.send(frame)
+                if self._options.verbose:
+                    print 'Send: %s' % line
+                received = self._socket.recv(len(frame))
+                if received != frame:
+                    raise Exception('Incorrect echo: %r' % received)
+                if self._options.verbose:
+                    print 'Recv: %s' % received[1:-1].decode('utf-8',
+                                                             'replace')
+        finally:
+            self._socket.close()
+
+    def _handshake(self):
+        self._socket.send(_method_line(self._options.resource))
+        self._socket.send(_UPGRADE_HEADER)
+        self._socket.send(_CONNECTION_HEADER)
+        self._socket.send(self._format_host_header())
+        self._socket.send(_origin_header(self._options.origin))
+        self._socket.send('\r\n')
+
+        for expected_char in _EXPECTED_RESPONSE:
+            received = self._socket.recv(1)[0]
+            if expected_char != received:
+                raise Exception('Handshake failure')
+        # We cut corners and skip other headers.
+        self._skip_headers()
+
+    def _skip_headers(self):
+        terminator = '\r\n\r\n'
+        pos = 0
+        while pos < len(terminator):
+            received = self._socket.recv(1)[0]
+            if received == terminator[pos]:
+                pos += 1
+            elif received == terminator[0]:
+                pos = 1
+            else:
+                pos = 0
+
+    def _format_host_header(self):
+        host = 'Host: ' + self._options.server_host
+        if ((not self._options.use_tls and
+             self._options.server_port != _DEFAULT_PORT) or
+            (self._options.use_tls and
+             self._options.server_port != _DEFAULT_SECURE_PORT)):
+            host += ':' + str(self._options.server_port)
+        host += '\r\n'
+        return host
+
+
+def main():
+    sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
+
+    parser = OptionParser()
+    parser.add_option('-s', '--server-host', '--server_host',
+                      dest='server_host', type='string',
+                      default='localhost', help='server host')
+    parser.add_option('-p', '--server-port', '--server_port',
+                      dest='server_port', type='int',
+                      default=_UNDEFINED_PORT, help='server port')
+    parser.add_option('-o', '--origin', dest='origin', type='string',
+                      default='http://localhost/', help='origin')
+    parser.add_option('-r', '--resource', dest='resource', type='string',
+                      default='/echo', help='resource path')
+    parser.add_option('-m', '--message', dest='message', type='string',
+                      help=('comma-separated messages to send excluding "%s" '
+                            'that is always sent at the end' %
+                            _GOODBYE_MESSAGE))
+    parser.add_option('-q', '--quiet', dest='verbose', action='store_false',
+                      default=True, help='suppress messages')
+    parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
+                      default=False, help='use TLS (wss://)')
+    parser.add_option('-k', '--socket-timeout', '--socket_timeout',
+                      dest='socket_timeout', type='int', default=_TIMEOUT_SEC,
+                      help='Timeout(sec) for sockets')
+
+    (options, unused_args) = parser.parse_args()
+
+    # Default port number depends on whether TLS is used.
+    if options.server_port == _UNDEFINED_PORT:
+        if options.use_tls:
+            options.server_port = _DEFAULT_SECURE_PORT
+        else:
+            options.server_port = _DEFAULT_PORT
+
+    # optparse doesn't seem to handle non-ascii default values.
+    # Set default message here.
+    if not options.message:
+        options.message = u'Hello,\u65e5\u672c'   # "Japan" in Japanese
+
+    EchoClient(options).run()
+
+
+if __name__ == '__main__':
+    main()
+
+
+# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/example/echo_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/echo_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/example/echo_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/echo_wsh.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt
new file mode 100644
index 0000000..21c4c09
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt
@@ -0,0 +1,11 @@
+# websocket handler map file, used by standalone.py -m option.
+# A line starting with '#' is a comment line.
+# Each line consists of 'alias_resource_path' and 'existing_resource_path'
+# separated by spaces.
+# Aliasing is processed from the top to the bottom of the line, and
+# 'existing_resource_path' must exist before it is aliased.
+# For example,
+#  / /echo
+# means that a request to '/' will be handled by handlers for '/echo'.
+/ /echo
+
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/__init__.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/__init__.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/__init__.py
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/dispatch.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/dispatch.py
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/handshake.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/handshake.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/handshake.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/handshake.py
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/headerparserhandler.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/headerparserhandler.py
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/memorizingfile.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/memorizingfile.py
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/msgutil.py
similarity index 100%
rename from WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/msgutil.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py
new file mode 100644
index 0000000..f411910
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py
@@ -0,0 +1,453 @@
+#!/usr/bin/env python
+#
+# Copyright 2009, 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.
+
+
+"""Standalone Web Socket server.
+
+Use this server to run mod_pywebsocket without Apache HTTP Server.
+
+Usage:
+    python standalone.py [-p <ws_port>] [-w <websock_handlers>]
+                         [-s <scan_dir>]
+                         [-d <document_root>]
+                         [-m <websock_handlers_map_file>]
+                         ... for other options, see _main below ...
+
+<ws_port> is the port number to use for ws:// connection.
+
+<document_root> is the path to the root directory of HTML files.
+
+<websock_handlers> is the path to the root directory of Web Socket handlers.
+See __init__.py for details of <websock_handlers> and how to write Web Socket
+handlers. If this path is relative, <document_root> is used as the base.
+
+<scan_dir> is a path under the root directory. If specified, only the handlers
+under scan_dir are scanned. This is useful in saving scan time.
+
+Note:
+This server is derived from SocketServer.ThreadingMixIn. Hence a thread is
+used for each request.
+"""
+
+import BaseHTTPServer
+import CGIHTTPServer
+import SimpleHTTPServer
+import SocketServer
+import logging
+import logging.handlers
+import optparse
+import os
+import re
+import socket
+import sys
+
+_HAS_OPEN_SSL = False
+try:
+    import OpenSSL.SSL
+    _HAS_OPEN_SSL = True
+except ImportError:
+    pass
+
+import dispatch
+import handshake
+import memorizingfile
+import util
+
+
+_LOG_LEVELS = {
+    'debug': logging.DEBUG,
+    'info': logging.INFO,
+    'warn': logging.WARN,
+    'error': logging.ERROR,
+    'critical': logging.CRITICAL};
+
+_DEFAULT_LOG_MAX_BYTES = 1024 * 256
+_DEFAULT_LOG_BACKUP_COUNT = 5
+
+_DEFAULT_REQUEST_QUEUE_SIZE = 128
+
+# 1024 is practically large enough to contain WebSocket handshake lines.
+_MAX_MEMORIZED_LINES = 1024
+
+def _print_warnings_if_any(dispatcher):
+    warnings = dispatcher.source_warnings()
+    if warnings:
+        for warning in warnings:
+            logging.warning('mod_pywebsocket: %s' % warning)
+
+
+class _StandaloneConnection(object):
+    """Mimic mod_python mp_conn."""
+
+    def __init__(self, request_handler):
+        """Construct an instance.
+
+        Args:
+            request_handler: A WebSocketRequestHandler instance.
+        """
+        self._request_handler = request_handler
+
+    def get_local_addr(self):
+        """Getter to mimic mp_conn.local_addr."""
+        return (self._request_handler.server.server_name,
+                self._request_handler.server.server_port)
+    local_addr = property(get_local_addr)
+
+    def get_remote_addr(self):
+        """Getter to mimic mp_conn.remote_addr.
+
+        Setting the property in __init__ won't work because the request
+        handler is not initialized yet there."""
+        return self._request_handler.client_address
+    remote_addr = property(get_remote_addr)
+
+    def write(self, data):
+        """Mimic mp_conn.write()."""
+        return self._request_handler.wfile.write(data)
+
+    def read(self, length):
+        """Mimic mp_conn.read()."""
+        return self._request_handler.rfile.read(length)
+
+    def get_memorized_lines(self):
+        """Get memorized lines."""
+        return self._request_handler.rfile.get_memorized_lines()
+
+
+class _StandaloneRequest(object):
+    """Mimic mod_python request."""
+
+    def __init__(self, request_handler, use_tls):
+        """Construct an instance.
+
+        Args:
+            request_handler: A WebSocketRequestHandler instance.
+        """
+        self._request_handler = request_handler
+        self.connection = _StandaloneConnection(request_handler)
+        self._use_tls = use_tls
+
+    def get_uri(self):
+        """Getter to mimic request.uri."""
+        return self._request_handler.path
+    uri = property(get_uri)
+
+    def get_headers_in(self):
+        """Getter to mimic request.headers_in."""
+        return self._request_handler.headers
+    headers_in = property(get_headers_in)
+
+    def is_https(self):
+        """Mimic request.is_https()."""
+        return self._use_tls
+
+
+class WebSocketServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
+    """HTTPServer specialized for Web Socket."""
+
+    SocketServer.ThreadingMixIn.daemon_threads = True
+
+    def __init__(self, server_address, RequestHandlerClass):
+        """Override SocketServer.BaseServer.__init__."""
+
+        SocketServer.BaseServer.__init__(
+                self, server_address, RequestHandlerClass)
+        self.socket = self._create_socket()
+        self.server_bind()
+        self.server_activate()
+
+    def _create_socket(self):
+        socket_ = socket.socket(self.address_family, self.socket_type)
+        if WebSocketServer.options.use_tls:
+            ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
+            ctx.use_privatekey_file(WebSocketServer.options.private_key)
+            ctx.use_certificate_file(WebSocketServer.options.certificate)
+            socket_ = OpenSSL.SSL.Connection(ctx, socket_)
+        return socket_
+
+    def handle_error(self, rquest, client_address):
+        """Override SocketServer.handle_error."""
+
+        logging.error(
+            ('Exception in processing request from: %r' % (client_address,)) +
+            '\n' + util.get_stack_trace())
+        # Note: client_address is a tuple. To match it against %r, we need the
+        # trailing comma.
+
+
+class WebSocketRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
+    """CGIHTTPRequestHandler specialized for Web Socket."""
+
+    def setup(self):
+        """Override SocketServer.StreamRequestHandler.setup."""
+
+        self.connection = self.request
+        self.rfile = memorizingfile.MemorizingFile(
+                socket._fileobject(self.request, 'rb', self.rbufsize),
+                max_memorized_lines=_MAX_MEMORIZED_LINES)
+        self.wfile = socket._fileobject(self.request, 'wb', self.wbufsize)
+
+    def __init__(self, *args, **keywords):
+        self._request = _StandaloneRequest(
+                self, WebSocketRequestHandler.options.use_tls)
+        self._dispatcher = WebSocketRequestHandler.options.dispatcher
+        self._print_warnings_if_any()
+        self._handshaker = handshake.Handshaker(
+                self._request, self._dispatcher,
+                WebSocketRequestHandler.options.strict)
+        CGIHTTPServer.CGIHTTPRequestHandler.__init__(
+                self, *args, **keywords)
+
+    def _print_warnings_if_any(self):
+        warnings = self._dispatcher.source_warnings()
+        if warnings:
+            for warning in warnings:
+                logging.warning('mod_pywebsocket: %s' % warning)
+
+    def parse_request(self):
+        """Override BaseHTTPServer.BaseHTTPRequestHandler.parse_request.
+
+        Return True to continue processing for HTTP(S), False otherwise.
+        """
+        result = CGIHTTPServer.CGIHTTPRequestHandler.parse_request(self)
+        if result:
+            try:
+                self._handshaker.do_handshake()
+                self._dispatcher.transfer_data(self._request)
+                return False
+            except handshake.HandshakeError, e:
+                # Handshake for ws(s) failed. Assume http(s).
+                logging.info('mod_pywebsocket: %s' % e)
+                return True
+            except dispatch.DispatchError, e:
+                logging.warning('mod_pywebsocket: %s' % e)
+                return False
+            except Exception, e:
+                logging.warning('mod_pywebsocket: %s' % e)
+                logging.info('mod_pywebsocket: %s' % util.get_stack_trace())
+                return False
+        return result
+
+    def log_request(self, code='-', size='-'):
+        """Override BaseHTTPServer.log_request."""
+
+        logging.info('"%s" %s %s',
+                     self.requestline, str(code), str(size))
+
+    def log_error(self, *args):
+        """Override BaseHTTPServer.log_error."""
+
+        # Despite the name, this method is for warnings than for errors.
+        # For example, HTTP status code is logged by this method.
+        logging.warn('%s - %s' % (self.address_string(), (args[0] % args[1:])))
+
+    def is_cgi(self):
+        """Test whether self.path corresponds to a CGI script.
+
+        Add extra check that self.path doesn't contains ..
+        Also check if the file is a executable file or not.
+        If the file is not executable, it is handled as static file or dir
+        rather than a CGI script.
+        """
+        if CGIHTTPServer.CGIHTTPRequestHandler.is_cgi(self):
+            if '..' in self.path:
+                return False
+            # strip query parameter from request path
+            resource_name = self.path.split('?', 2)[0]
+            # convert resource_name into real path name in filesystem.
+            scriptfile = self.translate_path(resource_name)
+            if not os.path.isfile(scriptfile):
+                return False
+            if not self.is_executable(scriptfile):
+                return False
+            return True
+        return False
+
+
+def _configure_logging(options):
+    logger = logging.getLogger()
+    logger.setLevel(_LOG_LEVELS[options.log_level])
+    if options.log_file:
+        handler = logging.handlers.RotatingFileHandler(
+                options.log_file, 'a', options.log_max, options.log_count)
+    else:
+        handler = logging.StreamHandler()
+    formatter = logging.Formatter(
+            "[%(asctime)s] [%(levelname)s] %(name)s: %(message)s")
+    handler.setFormatter(formatter)
+    logger.addHandler(handler)
+
+def _alias_handlers(dispatcher, websock_handlers_map_file):
+    """Set aliases specified in websock_handler_map_file in dispatcher.
+
+    Args:
+        dispatcher: dispatch.Dispatcher instance
+        websock_handler_map_file: alias map file
+    """
+    fp = open(websock_handlers_map_file)
+    try:
+        for line in fp:
+            if line[0] == '#' or line.isspace():
+                continue
+            m = re.match('(\S+)\s+(\S+)', line)
+            if not m:
+                logging.warning('Wrong format in map file:' + line)
+                continue
+            try:
+                dispatcher.add_resource_path_alias(
+                    m.group(1), m.group(2))
+            except dispatch.DispatchError, e:
+                logging.error(str(e))
+    finally:
+        fp.close()
+
+
+
+def _main():
+    parser = optparse.OptionParser()
+    parser.add_option('-H', '--server-host', '--server_host',
+                      dest='server_host',
+                      default='',
+                      help='server hostname to listen to')
+    parser.add_option('-p', '--port', dest='port', type='int',
+                      default=handshake._DEFAULT_WEB_SOCKET_PORT,
+                      help='port to listen to')
+    parser.add_option('-w', '--websock-handlers', '--websock_handlers',
+                      dest='websock_handlers',
+                      default='.',
+                      help='Web Socket handlers root directory.')
+    parser.add_option('-m', '--websock-handlers-map-file',
+                      '--websock_handlers_map_file',
+                      dest='websock_handlers_map_file',
+                      default=None,
+                      help=('Web Socket handlers map file. '
+                            'Each line consists of alias_resource_path and '
+                            'existing_resource_path, separated by spaces.'))
+    parser.add_option('-s', '--scan-dir', '--scan_dir', dest='scan_dir',
+                      default=None,
+                      help=('Web Socket handlers scan directory. '
+                            'Must be a directory under websock_handlers.'))
+    parser.add_option('-d', '--document-root', '--document_root',
+                      dest='document_root', default='.',
+                      help='Document root directory.')
+    parser.add_option('-x', '--cgi-paths', '--cgi_paths', dest='cgi_paths',
+                      default=None,
+                      help=('CGI paths relative to document_root.'
+                            'Comma-separated. (e.g -x /cgi,/htbin) '
+                            'Files under document_root/cgi_path are handled '
+                            'as CGI programs. Must be executable.'))
+    parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
+                      default=False, help='use TLS (wss://)')
+    parser.add_option('-k', '--private-key', '--private_key',
+                      dest='private_key',
+                      default='', help='TLS private key file.')
+    parser.add_option('-c', '--certificate', dest='certificate',
+                      default='', help='TLS certificate file.')
+    parser.add_option('-l', '--log-file', '--log_file', dest='log_file',
+                      default='', help='Log file.')
+    parser.add_option('--log-level', '--log_level', type='choice',
+                      dest='log_level', default='warn',
+                      choices=['debug', 'info', 'warn', 'error', 'critical'],
+                      help='Log level.')
+    parser.add_option('--log-max', '--log_max', dest='log_max', type='int',
+                      default=_DEFAULT_LOG_MAX_BYTES,
+                      help='Log maximum bytes')
+    parser.add_option('--log-count', '--log_count', dest='log_count',
+                      type='int', default=_DEFAULT_LOG_BACKUP_COUNT,
+                      help='Log backup count')
+    parser.add_option('--strict', dest='strict', action='store_true',
+                      default=False, help='Strictly check handshake request')
+    parser.add_option('-q', '--queue', dest='request_queue_size', type='int',
+                      default=_DEFAULT_REQUEST_QUEUE_SIZE,
+                      help='request queue size')
+    options = parser.parse_args()[0]
+
+    os.chdir(options.document_root)
+
+    _configure_logging(options)
+
+    SocketServer.TCPServer.request_queue_size = options.request_queue_size
+    CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = []
+
+    if options.cgi_paths:
+        CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = \
+            options.cgi_paths.split(',')
+        if sys.platform in ('cygwin', 'win32'):
+            cygwin_path = None
+            # For Win32 Python, it is expected that CYGWIN_PATH
+            # is set to a directory of cygwin binaries.
+            # For example, websocket_server.py in Chromium sets CYGWIN_PATH to
+            # full path of third_party/cygwin/bin.
+            if 'CYGWIN_PATH' in os.environ:
+                cygwin_path = os.environ['CYGWIN_PATH']
+            util.wrap_popen3_for_win(cygwin_path)
+            def __check_script(scriptpath):
+                return util.get_script_interp(scriptpath, cygwin_path)
+            CGIHTTPServer.executable = __check_script
+
+    if options.use_tls:
+        if not _HAS_OPEN_SSL:
+            logging.critical('To use TLS, install pyOpenSSL.')
+            sys.exit(1)
+        if not options.private_key or not options.certificate:
+            logging.critical(
+                    'To use TLS, specify private_key and certificate.')
+            sys.exit(1)
+
+    if not options.scan_dir:
+        options.scan_dir = options.websock_handlers
+
+    try:
+        # Share a Dispatcher among request handlers to save time for
+        # instantiation.  Dispatcher can be shared because it is thread-safe.
+        options.dispatcher = dispatch.Dispatcher(options.websock_handlers,
+                                                 options.scan_dir)
+        if options.websock_handlers_map_file:
+            _alias_handlers(options.dispatcher,
+                            options.websock_handlers_map_file)
+        _print_warnings_if_any(options.dispatcher)
+
+        WebSocketRequestHandler.options = options
+        WebSocketServer.options = options
+
+        server = WebSocketServer((options.server_host, options.port),
+                                 WebSocketRequestHandler)
+        server.serve_forever()
+    except Exception, e:
+        logging.critical(str(e))
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    _main()
+
+
+# vi:sts=4 sw=4 et
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py
new file mode 100644
index 0000000..8ec9dca
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py
@@ -0,0 +1,121 @@
+# Copyright 2009, 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.
+
+
+"""Web Sockets utilities.
+"""
+
+
+import StringIO
+import os
+import re
+import traceback
+
+
+def get_stack_trace():
+    """Get the current stack trace as string.
+
+    This is needed to support Python 2.3.
+    TODO: Remove this when we only support Python 2.4 and above.
+          Use traceback.format_exc instead.
+    """
+
+    out = StringIO.StringIO()
+    traceback.print_exc(file=out)
+    return out.getvalue()
+
+
+def prepend_message_to_exception(message, exc):
+    """Prepend message to the exception."""
+
+    exc.args = (message + str(exc),)
+    return
+
+
+def __translate_interp(interp, cygwin_path):
+    """Translate interp program path for Win32 python to run cygwin program
+    (e.g. perl).  Note that it doesn't support path that contains space,
+    which is typically true for Unix, where #!-script is written.
+    For Win32 python, cygwin_path is a directory of cygwin binaries.
+
+    Args:
+      interp: interp command line
+      cygwin_path: directory name of cygwin binary, or None
+    Returns:
+      translated interp command line.
+    """
+    if not cygwin_path:
+        return interp
+    m = re.match("^[^ ]*/([^ ]+)( .*)?", interp)
+    if m:
+        cmd = os.path.join(cygwin_path, m.group(1))
+        return cmd + m.group(2)
+    return interp
+
+
+def get_script_interp(script_path, cygwin_path=None):
+    """Gets #!-interpreter command line from the script.
+
+    It also fixes command path.  When Cygwin Python is used, e.g. in WebKit,
+    it could run "/usr/bin/perl -wT hello.pl".
+    When Win32 Python is used, e.g. in Chromium, it couldn't.  So, fix
+    "/usr/bin/perl" to "<cygwin_path>\perl.exe".
+
+    Args:
+      script_path: pathname of the script
+      cygwin_path: directory name of cygwin binary, or None
+    Returns:
+      #!-interpreter command line, or None if it is not #!-script.
+    """
+    fp = open(script_path)
+    line = fp.readline()
+    fp.close()
+    m = re.match("^#!(.*)", line)
+    if m:
+        return __translate_interp(m.group(1), cygwin_path)
+    return None
+
+def wrap_popen3_for_win(cygwin_path):
+    """Wrap popen3 to support #!-script on Windows.
+
+    Args:
+      cygwin_path:  path for cygwin binary if command path is needed to be
+                    translated.  None if no translation required.
+    """
+    __orig_popen3 = os.popen3
+    def __wrap_popen3(cmd, mode='t', bufsize=-1):
+        cmdline = cmd.split(' ')
+        interp = get_script_interp(cmdline[0], cygwin_path)
+        if interp:
+            cmd = interp + " " + cmd
+        return __orig_popen3(cmd, mode, bufsize)
+    os.popen3 = __wrap_popen3
+
+
+# vi:sts=4 sw=4 et
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/setup.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/setup.py
new file mode 100644
index 0000000..a34a83b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/setup.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+#
+# Copyright 2009, 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.
+
+
+"""Set up script for mod_pywebsocket.
+"""
+
+
+from distutils.core import setup
+import sys
+
+
+_PACKAGE_NAME = 'mod_pywebsocket'
+
+if sys.version < '2.3':
+    print >>sys.stderr, '%s requires Python 2.3 or later.' % _PACKAGE_NAME
+    sys.exit(1)
+
+setup(author='Yuzo Fujishima',
+      author_email='yuzo@chromium.org',
+      description='Web Socket extension for Apache HTTP Server.',
+      long_description=(
+              'mod_pywebsocket is an Apache HTTP Server extension for '
+              'Web Socket (http://tools.ietf.org/html/'
+              'draft-hixie-thewebsocketprotocol). '
+              'See mod_pywebsocket/__init__.py for more detail.'),
+      license='See COPYING',
+      name=_PACKAGE_NAME,
+      packages=[_PACKAGE_NAME],
+      url='http://code.google.com/p/pywebsocket/',
+      version='0.4.9.2',
+      )
+
+
+# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/config.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/config.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/config.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/config.py
diff --git a/WebKitTools/pywebsocket/test/mock.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/mock.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/mock.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/mock.py
diff --git a/WebKitTools/pywebsocket/test/run_all.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/run_all.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/run_all.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/run_all.py
diff --git a/WebKitTools/pywebsocket/test/test_dispatch.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_dispatch.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/test_dispatch.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_dispatch.py
diff --git a/WebKitTools/pywebsocket/test/test_handshake.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_handshake.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/test_handshake.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_handshake.py
diff --git a/WebKitTools/pywebsocket/test/test_memorizingfile.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_memorizingfile.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/test_memorizingfile.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_memorizingfile.py
diff --git a/WebKitTools/pywebsocket/test/test_mock.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_mock.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/test_mock.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_mock.py
diff --git a/WebKitTools/pywebsocket/test/test_msgutil.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_msgutil.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/test_msgutil.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_msgutil.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py
new file mode 100644
index 0000000..61f0db5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+#
+# Copyright 2009, 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.
+
+
+"""Tests for util module."""
+
+
+import os
+import sys
+import unittest
+
+import config  # This must be imported before mod_pywebsocket.
+from mod_pywebsocket import util
+
+_TEST_DATA_DIR = os.path.join(os.path.split(__file__)[0], 'testdata')
+
+class UtilTest(unittest.TestCase):
+    def test_get_stack_trace(self):
+        self.assertEqual('None\n', util.get_stack_trace())
+        try:
+            a = 1 / 0  # Intentionally raise exception.
+        except Exception:
+            trace = util.get_stack_trace()
+            self.failUnless(trace.startswith('Traceback'))
+            self.failUnless(trace.find('ZeroDivisionError') != -1)
+
+    def test_prepend_message_to_exception(self):
+        exc = Exception('World')
+        self.assertEqual('World', str(exc))
+        util.prepend_message_to_exception('Hello ', exc)
+        self.assertEqual('Hello World', str(exc))
+
+    def test_get_script_interp(self):
+        cygwin_path = 'c:\\cygwin\\bin'
+        cygwin_perl = os.path.join(cygwin_path, 'perl')
+        self.assertEqual(None, util.get_script_interp(
+            os.path.join(_TEST_DATA_DIR, 'README')))
+        self.assertEqual(None, util.get_script_interp(
+            os.path.join(_TEST_DATA_DIR, 'README'), cygwin_path))
+        self.assertEqual('/usr/bin/perl -wT', util.get_script_interp(
+            os.path.join(_TEST_DATA_DIR, 'hello.pl')))
+        self.assertEqual(cygwin_perl + ' -wT', util.get_script_interp(
+            os.path.join(_TEST_DATA_DIR, 'hello.pl'), cygwin_path))
+
+
+if __name__ == '__main__':
+    unittest.main()
+
+
+# vi:sts=4 sw=4 et
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README
new file mode 100644
index 0000000..c001aa5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README
@@ -0,0 +1 @@
+Test data directory
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/blank_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/blank_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/blank_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/blank_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/origin_check_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/origin_check_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/plain_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/plain_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
similarity index 100%
rename from WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl
new file mode 100644
index 0000000..9dd01b4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl
@@ -0,0 +1,2 @@
+#!/usr/bin/perl -wT
+print "Hello\n";
diff --git a/WebKitTools/simplejson/LICENSE.txt b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/LICENSE.txt
similarity index 100%
rename from WebKitTools/simplejson/LICENSE.txt
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/LICENSE.txt
diff --git a/WebKitTools/simplejson/README.txt b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/README.txt
similarity index 100%
rename from WebKitTools/simplejson/README.txt
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/README.txt
diff --git a/WebKitTools/simplejson/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/__init__.py
similarity index 100%
rename from WebKitTools/simplejson/__init__.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/__init__.py
diff --git a/WebKitTools/simplejson/_speedups.c b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/_speedups.c
similarity index 100%
rename from WebKitTools/simplejson/_speedups.c
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/_speedups.c
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
new file mode 100644
index 0000000..b887b58
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
@@ -0,0 +1,273 @@
+"""
+Implementation of JSONDecoder
+"""
+import re
+
+from .scanner import Scanner, pattern
+
+FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
+
+def _floatconstants():
+    import struct
+    import sys
+    _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
+    if sys.byteorder != 'big':
+        _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
+    nan, inf = struct.unpack('dd', _BYTES)
+    return nan, inf, -inf
+
+NaN, PosInf, NegInf = _floatconstants()
+
+def linecol(doc, pos):
+    lineno = doc.count('\n', 0, pos) + 1
+    if lineno == 1:
+        colno = pos
+    else:
+        colno = pos - doc.rindex('\n', 0, pos)
+    return lineno, colno
+
+def errmsg(msg, doc, pos, end=None):
+    lineno, colno = linecol(doc, pos)
+    if end is None:
+        return '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos)
+    endlineno, endcolno = linecol(doc, end)
+    return '%s: line %d column %d - line %d column %d (char %d - %d)' % (
+        msg, lineno, colno, endlineno, endcolno, pos, end)
+
+_CONSTANTS = {
+    '-Infinity': NegInf,
+    'Infinity': PosInf,
+    'NaN': NaN,
+    'true': True,
+    'false': False,
+    'null': None,
+}
+
+def JSONConstant(match, context, c=_CONSTANTS):
+    return c[match.group(0)], None
+pattern('(-?Infinity|NaN|true|false|null)')(JSONConstant)
+
+def JSONNumber(match, context):
+    match = JSONNumber.regex.match(match.string, *match.span())
+    integer, frac, exp = match.groups()
+    if frac or exp:
+        res = float(integer + (frac or '') + (exp or ''))
+    else:
+        res = int(integer)
+    return res, None
+pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(JSONNumber)
+
+STRINGCHUNK = re.compile(r'(.*?)(["\\])', FLAGS)
+BACKSLASH = {
+    '"': u'"', '\\': u'\\', '/': u'/',
+    'b': u'\b', 'f': u'\f', 'n': u'\n', 'r': u'\r', 't': u'\t',
+}
+
+DEFAULT_ENCODING = "utf-8"
+
+def scanstring(s, end, encoding=None, _b=BACKSLASH, _m=STRINGCHUNK.match):
+    if encoding is None:
+        encoding = DEFAULT_ENCODING
+    chunks = []
+    _append = chunks.append
+    begin = end - 1
+    while 1:
+        chunk = _m(s, end)
+        if chunk is None:
+            raise ValueError(
+                errmsg("Unterminated string starting at", s, begin))
+        end = chunk.end()
+        content, terminator = chunk.groups()
+        if content:
+            if not isinstance(content, unicode):
+                content = unicode(content, encoding)
+            _append(content)
+        if terminator == '"':
+            break
+        try:
+            esc = s[end]
+        except IndexError:
+            raise ValueError(
+                errmsg("Unterminated string starting at", s, begin))
+        if esc != 'u':
+            try:
+                m = _b[esc]
+            except KeyError:
+                raise ValueError(
+                    errmsg("Invalid \\escape: %r" % (esc,), s, end))
+            end += 1
+        else:
+            esc = s[end + 1:end + 5]
+            try:
+                m = unichr(int(esc, 16))
+                if len(esc) != 4 or not esc.isalnum():
+                    raise ValueError
+            except ValueError:
+                raise ValueError(errmsg("Invalid \\uXXXX escape", s, end))
+            end += 5
+        _append(m)
+    return u''.join(chunks), end
+
+def JSONString(match, context):
+    encoding = getattr(context, 'encoding', None)
+    return scanstring(match.string, match.end(), encoding)
+pattern(r'"')(JSONString)
+
+WHITESPACE = re.compile(r'\s*', FLAGS)
+
+def JSONObject(match, context, _w=WHITESPACE.match):
+    pairs = {}
+    s = match.string
+    end = _w(s, match.end()).end()
+    nextchar = s[end:end + 1]
+    # trivial empty object
+    if nextchar == '}':
+        return pairs, end + 1
+    if nextchar != '"':
+        raise ValueError(errmsg("Expecting property name", s, end))
+    end += 1
+    encoding = getattr(context, 'encoding', None)
+    iterscan = JSONScanner.iterscan
+    while True:
+        key, end = scanstring(s, end, encoding)
+        end = _w(s, end).end()
+        if s[end:end + 1] != ':':
+            raise ValueError(errmsg("Expecting : delimiter", s, end))
+        end = _w(s, end + 1).end()
+        try:
+            value, end = iterscan(s, idx=end, context=context).next()
+        except StopIteration:
+            raise ValueError(errmsg("Expecting object", s, end))
+        pairs[key] = value
+        end = _w(s, end).end()
+        nextchar = s[end:end + 1]
+        end += 1
+        if nextchar == '}':
+            break
+        if nextchar != ',':
+            raise ValueError(errmsg("Expecting , delimiter", s, end - 1))
+        end = _w(s, end).end()
+        nextchar = s[end:end + 1]
+        end += 1
+        if nextchar != '"':
+            raise ValueError(errmsg("Expecting property name", s, end - 1))
+    object_hook = getattr(context, 'object_hook', None)
+    if object_hook is not None:
+        pairs = object_hook(pairs)
+    return pairs, end
+pattern(r'{')(JSONObject)
+            
+def JSONArray(match, context, _w=WHITESPACE.match):
+    values = []
+    s = match.string
+    end = _w(s, match.end()).end()
+    # look-ahead for trivial empty array
+    nextchar = s[end:end + 1]
+    if nextchar == ']':
+        return values, end + 1
+    iterscan = JSONScanner.iterscan
+    while True:
+        try:
+            value, end = iterscan(s, idx=end, context=context).next()
+        except StopIteration:
+            raise ValueError(errmsg("Expecting object", s, end))
+        values.append(value)
+        end = _w(s, end).end()
+        nextchar = s[end:end + 1]
+        end += 1
+        if nextchar == ']':
+            break
+        if nextchar != ',':
+            raise ValueError(errmsg("Expecting , delimiter", s, end))
+        end = _w(s, end).end()
+    return values, end
+pattern(r'\[')(JSONArray)
+ 
+ANYTHING = [
+    JSONObject,
+    JSONArray,
+    JSONString,
+    JSONConstant,
+    JSONNumber,
+]
+
+JSONScanner = Scanner(ANYTHING)
+
+class JSONDecoder(object):
+    """
+    Simple JSON <http://json.org> decoder
+
+    Performs the following translations in decoding:
+    
+    +---------------+-------------------+
+    | JSON          | Python            |
+    +===============+===================+
+    | object        | dict              |
+    +---------------+-------------------+
+    | array         | list              |
+    +---------------+-------------------+
+    | string        | unicode           |
+    +---------------+-------------------+
+    | number (int)  | int, long         |
+    +---------------+-------------------+
+    | number (real) | float             |
+    +---------------+-------------------+
+    | true          | True              |
+    +---------------+-------------------+
+    | false         | False             |
+    +---------------+-------------------+
+    | null          | None              |
+    +---------------+-------------------+
+
+    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
+    their corresponding ``float`` values, which is outside the JSON spec.
+    """
+
+    _scanner = Scanner(ANYTHING)
+    __all__ = ['__init__', 'decode', 'raw_decode']
+
+    def __init__(self, encoding=None, object_hook=None):
+        """
+        ``encoding`` determines the encoding used to interpret any ``str``
+        objects decoded by this instance (utf-8 by default).  It has no
+        effect when decoding ``unicode`` objects.
+        
+        Note that currently only encodings that are a superset of ASCII work,
+        strings of other encodings should be passed in as ``unicode``.
+
+        ``object_hook``, if specified, will be called with the result
+        of every JSON object decoded and its return value will be used in
+        place of the given ``dict``.  This can be used to provide custom
+        deserializations (e.g. to support JSON-RPC class hinting).
+        """
+        self.encoding = encoding
+        self.object_hook = object_hook
+
+    def decode(self, s, _w=WHITESPACE.match):
+        """
+        Return the Python representation of ``s`` (a ``str`` or ``unicode``
+        instance containing a JSON document)
+        """
+        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
+        end = _w(s, end).end()
+        if end != len(s):
+            raise ValueError(errmsg("Extra data", s, end, len(s)))
+        return obj
+
+    def raw_decode(self, s, **kw):
+        """
+        Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning
+        with a JSON document) and return a 2-tuple of the Python
+        representation and the index in ``s`` where the document ended.
+
+        This can be used to decode a JSON document from a string that may
+        have extraneous data at the end.
+        """
+        kw.setdefault('context', self)
+        try:
+            obj, end = self._scanner.iterscan(s, **kw).next()
+        except StopIteration:
+            raise ValueError("No JSON object could be decoded")
+        return obj, end
+
+__all__ = ['JSONDecoder']
diff --git a/WebKitTools/simplejson/encoder.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/encoder.py
similarity index 100%
rename from WebKitTools/simplejson/encoder.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/encoder.py
diff --git a/WebKitTools/simplejson/jsonfilter.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py
similarity index 100%
rename from WebKitTools/simplejson/jsonfilter.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py
diff --git a/WebKitTools/simplejson/scanner.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/scanner.py
similarity index 100%
rename from WebKitTools/simplejson/scanner.py
rename to WebKitTools/Scripts/webkitpy/thirdparty/simplejson/scanner.py
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/tool/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/bot/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/Scripts/webkitpy/tool/bot/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
new file mode 100644
index 0000000..c21fdc6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
@@ -0,0 +1,82 @@
+# 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.
+
+import random
+import webkitpy.common.config.irc as config_irc
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.tool.bot.queueengine import TerminateQueue
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.executive import ScriptError
+
+# FIXME: Merge with Command?
+class IRCCommand(object):
+    def execute(self, nick, args, tool, sheriff):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class LastGreenRevision(IRCCommand):
+    def execute(self, nick, args, tool, sheriff):
+        return "%s: %s" % (nick,
+            view_source_url(tool.buildbot.last_green_revision()))
+
+
+class Restart(IRCCommand):
+    def execute(self, nick, args, tool, sheriff):
+        tool.irc().post("Restarting...")
+        raise TerminateQueue()
+
+
+class Rollout(IRCCommand):
+    def execute(self, nick, args, tool, sheriff):
+        if len(args) < 2:
+            tool.irc().post("%s: Usage: SVN_REVISION REASON" % nick)
+            return
+        svn_revision = args[0]
+        rollout_reason = " ".join(args[1:])
+        tool.irc().post("Preparing rollout for r%s..." % svn_revision)
+        try:
+            complete_reason = "%s (Requested by %s on %s)." % (
+                rollout_reason, nick, config_irc.channel)
+            bug_id = sheriff.post_rollout_patch(svn_revision, complete_reason)
+            bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
+            tool.irc().post("%s: Created rollout: %s" % (nick, bug_url))
+        except ScriptError, e:
+            tool.irc().post("%s: Failed to create rollout patch:" % nick)
+            tool.irc().post("%s" % e)
+            bug_id = parse_bug_id(e.output)
+            if bug_id:
+                tool.irc().post("Ugg...  Might have created %s" %
+                    tool.bugs.bug_url_for_bug_id(bug_id))
+
+
+class Hi(IRCCommand):
+    def execute(self, nick, args, tool, sheriff):
+        quips = tool.bugs.quips()
+        quips.append('"Only you can prevent forest fires." -- Smokey the Bear')
+        return random.choice(quips)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
new file mode 100644
index 0000000..9a2cdfa
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
@@ -0,0 +1,64 @@
+# Copyright (c) 2009 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.
+
+class PersistentPatchCollectionDelegate:
+    def collection_name(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def fetch_potential_patch_ids(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def status_server(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def is_terminal_status(self, status):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class PersistentPatchCollection:
+    def __init__(self, delegate):
+        self._delegate = delegate
+        self._name = self._delegate.collection_name()
+        self._status = self._delegate.status_server()
+        self._status_cache = {}
+
+    def _cached_status(self, patch_id):
+        cached = self._status_cache.get(patch_id)
+        if cached:
+            return cached
+        status = self._status.patch_status(self._name, patch_id)
+        if status and self._delegate.is_terminal_status(status):
+            self._status_cache[patch_id] = status
+        return status
+
+    def next(self):
+        patch_ids = self._delegate.fetch_potential_patch_ids()
+        for patch_id in patch_ids:
+            status = self._cached_status(patch_id)
+            if not status or not self._delegate.is_terminal_status(status):
+                return patch_id
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py
new file mode 100644
index 0000000..4ec6e25
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection_unittest.py
@@ -0,0 +1,52 @@
+# Copyright (c) 2009 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.
+
+import unittest
+
+from webkitpy.tool.bot.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
+from webkitpy.thirdparty.mock import Mock
+
+
+class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate):
+    def collection_name(self):
+        return "test-collection"
+
+    def fetch_potential_patch_ids(self):
+        return [42, 192, 87]
+
+    def status_server(self):
+        return Mock()
+
+    def is_terminal_status(self, status):
+        return False
+
+
+class PersistentPatchCollectionTest(unittest.TestCase):
+    def test_next(self):
+        collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate())
+        collection.next()
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
new file mode 100644
index 0000000..2c45ab6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
@@ -0,0 +1,152 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+
+import os
+import time
+import traceback
+
+from datetime import datetime, timedelta
+
+from webkitpy.common.net.statusserver import StatusServer
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.deprecated_logging import log, OutputTee
+
+
+class TerminateQueue(Exception):
+    pass
+
+
+class QueueEngineDelegate:
+    def queue_log_path(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def work_item_log_path(self, work_item):
+        raise NotImplementedError, "subclasses must implement"
+
+    def begin_work_queue(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def should_continue_work_queue(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def next_work_item(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def should_proceed_with_work_item(self, work_item):
+        # returns (safe_to_proceed, waiting_message, patch)
+        raise NotImplementedError, "subclasses must implement"
+
+    def process_work_item(self, work_item):
+        raise NotImplementedError, "subclasses must implement"
+
+    def handle_unexpected_error(self, work_item, message):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class QueueEngine:
+    def __init__(self, name, delegate, wakeup_event):
+        self._name = name
+        self._delegate = delegate
+        self._wakeup_event = wakeup_event
+        self._output_tee = OutputTee()
+
+    log_date_format = "%Y-%m-%d %H:%M:%S"
+    sleep_duration_text = "5 mins"
+    seconds_to_sleep = 300
+    handled_error_code = 2
+
+    # Child processes exit with a special code to the parent queue process can detect the error was handled.
+    @classmethod
+    def exit_after_handled_error(cls, error):
+        log(error)
+        exit(cls.handled_error_code)
+
+    def run(self):
+        self._begin_logging()
+
+        self._delegate.begin_work_queue()
+        while (self._delegate.should_continue_work_queue()):
+            try:
+                self._ensure_work_log_closed()
+                work_item = self._delegate.next_work_item()
+                if not work_item:
+                    self._sleep("No work item.")
+                    continue
+                if not self._delegate.should_proceed_with_work_item(work_item):
+                    self._sleep("Not proceeding with work item.")
+                    continue
+
+                # FIXME: Work logs should not depend on bug_id specificaly.
+                #        This looks fixed, no?
+                self._open_work_log(work_item)
+                try:
+                    if not self._delegate.process_work_item(work_item):
+                        self._sleep("Unable to process work item.")
+                except ScriptError, e:
+                    # Use a special exit code to indicate that the error was already
+                    # handled in the child process and we should just keep looping.
+                    if e.exit_code == self.handled_error_code:
+                        continue
+                    message = "Unexpected failure when landing patch!  Please file a bug against webkit-patch.\n%s" % e.message_with_output()
+                    self._delegate.handle_unexpected_error(work_item, message)
+            except TerminateQueue, e:
+                log("\nTerminateQueue exception received.")
+                return 0
+            except KeyboardInterrupt, e:
+                log("\nUser terminated queue.")
+                return 1
+            except Exception, e:
+                traceback.print_exc()
+                # Don't try tell the status bot, in case telling it causes an exception.
+                self._sleep("Exception while preparing queue")
+        # Never reached.
+        self._ensure_work_log_closed()
+
+    def _begin_logging(self):
+        self._queue_log = self._output_tee.add_log(self._delegate.queue_log_path())
+        self._work_log = None
+
+    def _open_work_log(self, work_item):
+        work_item_log_path = self._delegate.work_item_log_path(work_item)
+        self._work_log = self._output_tee.add_log(work_item_log_path)
+
+    def _ensure_work_log_closed(self):
+        # If we still have a bug log open, close it.
+        if self._work_log:
+            self._output_tee.remove_log(self._work_log)
+            self._work_log = None
+
+    def _sleep_message(self, message):
+        wake_time = datetime.now() + timedelta(seconds=self.seconds_to_sleep)
+        return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(self.log_date_format), self.sleep_duration_text)
+
+    def _sleep(self, message):
+        log(self._sleep_message(message))
+        self._wakeup_event.wait(self.seconds_to_sleep)
+        self._wakeup_event.clear()
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
new file mode 100644
index 0000000..626181d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
@@ -0,0 +1,171 @@
+# Copyright (c) 2009 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.
+
+import os
+import shutil
+import tempfile
+import threading
+import unittest
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
+
+class LoggingDelegate(QueueEngineDelegate):
+    def __init__(self, test):
+        self._test = test
+        self._callbacks = []
+        self._run_before = False
+
+    expected_callbacks = [
+        'queue_log_path',
+        'begin_work_queue',
+        'should_continue_work_queue',
+        'next_work_item',
+        'should_proceed_with_work_item',
+        'work_item_log_path',
+        'process_work_item',
+        'should_continue_work_queue'
+    ]
+
+    def record(self, method_name):
+        self._callbacks.append(method_name)
+
+    def queue_log_path(self):
+        self.record("queue_log_path")
+        return os.path.join(self._test.temp_dir, "queue_log_path")
+
+    def work_item_log_path(self, work_item):
+        self.record("work_item_log_path")
+        return os.path.join(self._test.temp_dir, "work_log_path", "%s.log" % work_item)
+
+    def begin_work_queue(self):
+        self.record("begin_work_queue")
+
+    def should_continue_work_queue(self):
+        self.record("should_continue_work_queue")
+        if not self._run_before:
+            self._run_before = True
+            return True
+        return False
+
+    def next_work_item(self):
+        self.record("next_work_item")
+        return "work_item"
+
+    def should_proceed_with_work_item(self, work_item):
+        self.record("should_proceed_with_work_item")
+        self._test.assertEquals(work_item, "work_item")
+        fake_patch = { 'bug_id' : 42 }
+        return (True, "waiting_message", fake_patch)
+
+    def process_work_item(self, work_item):
+        self.record("process_work_item")
+        self._test.assertEquals(work_item, "work_item")
+        return True
+
+    def handle_unexpected_error(self, work_item, message):
+        self.record("handle_unexpected_error")
+        self._test.assertEquals(work_item, "work_item")
+
+
+class ThrowErrorDelegate(LoggingDelegate):
+    def __init__(self, test, error_code):
+        LoggingDelegate.__init__(self, test)
+        self.error_code = error_code
+
+    def process_work_item(self, work_item):
+        self.record("process_work_item")
+        raise ScriptError(exit_code=self.error_code)
+
+
+class NotSafeToProceedDelegate(LoggingDelegate):
+    def should_proceed_with_work_item(self, work_item):
+        self.record("should_proceed_with_work_item")
+        self._test.assertEquals(work_item, "work_item")
+        return False
+
+
+class FastQueueEngine(QueueEngine):
+    def __init__(self, delegate):
+        QueueEngine.__init__(self, "fast-queue", delegate, threading.Event())
+
+    # No sleep for the wicked.
+    seconds_to_sleep = 0
+
+    def _sleep(self, message):
+        pass
+
+
+class QueueEngineTest(unittest.TestCase):
+    def test_trivial(self):
+        delegate = LoggingDelegate(self)
+        work_queue = QueueEngine("trivial-queue", delegate, threading.Event())
+        work_queue.run()
+        self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
+        self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
+        self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
+
+    def test_unexpected_error(self):
+        delegate = ThrowErrorDelegate(self, 3)
+        work_queue = QueueEngine("error-queue", delegate, threading.Event())
+        work_queue.run()
+        expected_callbacks = LoggingDelegate.expected_callbacks[:]
+        work_item_index = expected_callbacks.index('process_work_item')
+        # The unexpected error should be handled right after process_work_item starts
+        # but before any other callback.  Otherwise callbacks should be normal.
+        expected_callbacks.insert(work_item_index + 1, 'handle_unexpected_error')
+        self.assertEquals(delegate._callbacks, expected_callbacks)
+
+    def test_handled_error(self):
+        delegate = ThrowErrorDelegate(self, QueueEngine.handled_error_code)
+        work_queue = QueueEngine("handled-error-queue", delegate, threading.Event())
+        work_queue.run()
+        self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
+
+    def test_not_safe_to_proceed(self):
+        delegate = NotSafeToProceedDelegate(self)
+        work_queue = FastQueueEngine(delegate)
+        work_queue.run()
+        expected_callbacks = LoggingDelegate.expected_callbacks[:]
+        next_work_item_index = expected_callbacks.index('next_work_item')
+        # We slice out the common part of the expected callbacks.
+        # We add 2 here to include should_proceed_with_work_item, which is
+        # a pain to search for directly because it occurs twice.
+        expected_callbacks = expected_callbacks[:next_work_item_index + 2]
+        expected_callbacks.append('should_continue_work_queue')
+        self.assertEquals(delegate._callbacks, expected_callbacks)
+
+    def setUp(self):
+        self.temp_dir = tempfile.mkdtemp(suffix="work_queue_test_logs")
+
+    def tearDown(self):
+        shutil.rmtree(self.temp_dir)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py
new file mode 100644
index 0000000..a38c3cf
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py
@@ -0,0 +1,131 @@
+# 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.
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.grammar import join_with_separators
+
+
+class Sheriff(object):
+    def __init__(self, tool, sheriffbot):
+        self._tool = tool
+        self._sheriffbot = sheriffbot
+
+    def post_irc_warning(self, commit_info, builders):
+        irc_nicknames = sorted([party.irc_nickname for
+                                party in commit_info.responsible_parties()
+                                if party.irc_nickname])
+        irc_prefix = ": " if irc_nicknames else ""
+        irc_message = "%s%s%s might have broken %s" % (
+            ", ".join(irc_nicknames),
+            irc_prefix,
+            view_source_url(commit_info.revision()),
+            join_with_separators([builder.name() for builder in builders]))
+
+        self._tool.irc().post(irc_message)
+
+    def post_rollout_patch(self, svn_revision, rollout_reason):
+        # Ensure that svn_revision is a number (and not an option to
+        # create-rollout).
+        try:
+            svn_revision = int(svn_revision)
+        except:
+            raise ScriptError(message="Invalid svn revision number \"%s\"."
+                              % svn_revision)
+
+        if rollout_reason.startswith("-"):
+            raise ScriptError(message="The rollout reason may not begin "
+                              "with - (\"%s\")." % rollout_reason)
+
+        output = self._sheriffbot.run_webkit_patch([
+            "create-rollout",
+            "--force-clean",
+            # In principle, we should pass --non-interactive here, but it
+            # turns out that create-rollout doesn't need it yet.  We can't
+            # pass it prophylactically because we reject unrecognized command
+            # line switches.
+            "--parent-command=sheriff-bot",
+            svn_revision,
+            rollout_reason,
+        ])
+        return parse_bug_id(output)
+
+    def _rollout_reason(self, builders):
+        # FIXME: This should explain which layout tests failed
+        # however, that would require Build objects here, either passed
+        # in through failure_info, or through Builder.latest_build.
+        names = [builder.name() for builder in builders]
+        return "Caused builders %s to fail." % join_with_separators(names)
+
+    def post_automatic_rollout_patch(self, commit_info, builders):
+        # For now we're only posting rollout patches for commit-queue patches.
+        commit_bot_email = "eseidel@chromium.org"
+        if commit_bot_email == commit_info.committer_email():
+            try:
+                self.post_rollout_patch(commit_info.revision(),
+                                        self._rollout_reason(builders))
+            except ScriptError, e:
+                log("Failed to create-rollout.")
+
+    def post_blame_comment_on_bug(self, commit_info, builders, blame_list):
+        if not commit_info.bug_id():
+            return
+        comment = "%s might have broken %s" % (
+            view_source_url(commit_info.revision()),
+            join_with_separators([builder.name() for builder in builders]))
+        if len(blame_list) > 1:
+            comment += "\nThe following changes are on the blame list:\n"
+            comment += "\n".join(map(view_source_url, blame_list))
+        self._tool.bugs.post_comment_to_bug(commit_info.bug_id(),
+                                            comment,
+                                            cc=self._sheriffbot.watchers)
+
+    # FIXME: Should some of this logic be on BuildBot?
+    def provoke_flaky_builders(self, revisions_causing_failures):
+        # We force_build builders that are red but have not "failed" (i.e.,
+        # been red twice). We do this to avoid a deadlock situation where a
+        # flaky test blocks the commit-queue and there aren't any other
+        # patches being landed to re-spin the builder.
+        failed_builders = sum([revisions_causing_failures[key] for
+                               key in revisions_causing_failures.keys()], [])
+        failed_builder_names = \
+            set([builder.name() for builder in failed_builders])
+        idle_red_builder_names = \
+            set([builder["name"]
+                 for builder in self._tool.buildbot.idle_red_core_builders()])
+
+        # We only want to provoke these builders if they are idle and have not
+        # yet "failed" (i.e., been red twice) to avoid overloading the bots.
+        flaky_builder_names = idle_red_builder_names - failed_builder_names
+
+        for name in flaky_builder_names:
+            flaky_builder = self._tool.buildbot.builder_with_name(name)
+            flaky_builder.force_build(username=self._sheriffbot.name,
+                                      comments="Probe for flakiness.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
new file mode 100644
index 0000000..dd048a1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
@@ -0,0 +1,105 @@
+# 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.
+
+import os
+import unittest
+
+from webkitpy.common.net.buildbot import Builder
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.mocktool import MockTool, mock_builder
+
+
+class MockSheriffBot(object):
+    name = "mock-sheriff-bot"
+    watchers = [
+        "watcher@example.com",
+    ]
+
+    def run_webkit_patch(self, args):
+        return "Created bug https://bugs.webkit.org/show_bug.cgi?id=36936\n"
+
+
+class SheriffTest(unittest.TestCase):
+    def test_rollout_reason(self):
+        sheriff = Sheriff(MockTool(), MockSheriffBot())
+        builders = [
+            Builder("Foo", None),
+            Builder("Bar", None),
+        ]
+        reason = "Caused builders Foo and Bar to fail."
+        self.assertEquals(sheriff._rollout_reason(builders), reason)
+
+    def test_post_blame_comment_on_bug(self):
+        def run():
+            sheriff = Sheriff(MockTool(), MockSheriffBot())
+            builders = [
+                Builder("Foo", None),
+                Builder("Bar", None),
+            ]
+            commit_info = Mock()
+            commit_info.bug_id = lambda: None
+            commit_info.revision = lambda: 4321
+            # Should do nothing with no bug_id
+            sheriff.post_blame_comment_on_bug(commit_info, builders, [])
+            sheriff.post_blame_comment_on_bug(commit_info, builders, [2468, 5646])
+            # Should try to post a comment to the bug, but MockTool.bugs does nothing.
+            commit_info.bug_id = lambda: 1234
+            sheriff.post_blame_comment_on_bug(commit_info, builders, [])
+            sheriff.post_blame_comment_on_bug(commit_info, builders, [3432])
+            sheriff.post_blame_comment_on_bug(commit_info, builders, [841, 5646])
+
+        expected_stderr = u"MOCK bug comment: bug_id=1234, cc=['watcher@example.com']\n--- Begin comment ---\\http://trac.webkit.org/changeset/4321 might have broken Foo and Bar\n--- End comment ---\n\nMOCK bug comment: bug_id=1234, cc=['watcher@example.com']\n--- Begin comment ---\\http://trac.webkit.org/changeset/4321 might have broken Foo and Bar\n--- End comment ---\n\nMOCK bug comment: bug_id=1234, cc=['watcher@example.com']\n--- Begin comment ---\\http://trac.webkit.org/changeset/4321 might have broken Foo and Bar\nThe following changes are on the blame list:\nhttp://trac.webkit.org/changeset/841\nhttp://trac.webkit.org/changeset/5646\n--- End comment ---\n\n"
+        OutputCapture().assert_outputs(self, run, expected_stderr=expected_stderr)
+
+    def test_provoke_flaky_builders(self):
+        def run():
+            tool = MockTool()
+            tool.buildbot.light_tree_on_fire()
+            sheriff = Sheriff(tool, MockSheriffBot())
+            revisions_causing_failures = {}
+            sheriff.provoke_flaky_builders(revisions_causing_failures)
+        expected_stderr = "MOCK: force_build: name=Builder2, username=mock-sheriff-bot, comments=Probe for flakiness.\n"
+        OutputCapture().assert_outputs(self, run, expected_stderr=expected_stderr)
+
+    def test_post_blame_comment_on_bug(self):
+        sheriff = Sheriff(MockTool(), MockSheriffBot())
+        builders = [
+            Builder("Foo", None),
+            Builder("Bar", None),
+        ]
+        commit_info = Mock()
+        commit_info.bug_id = lambda: None
+        commit_info.revision = lambda: 4321
+        commit_info.committer = lambda: None
+        commit_info.committer_email = lambda: "foo@example.com"
+        commit_info.reviewer = lambda: None
+        commit_info.author = lambda: None
+        sheriff.post_automatic_rollout_patch(commit_info, builders)
+
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py
new file mode 100644
index 0000000..43aa9c3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py
@@ -0,0 +1,93 @@
+# 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.
+
+import webkitpy.tool.bot.irc_command as irc_command
+
+from webkitpy.common.net.irc.ircbot import IRCBotDelegate
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+
+class _IRCThreadTearoff(IRCBotDelegate):
+    def __init__(self, password, message_queue, wakeup_event):
+        self._password = password
+        self._message_queue = message_queue
+        self._wakeup_event = wakeup_event
+
+    # IRCBotDelegate methods
+
+    def irc_message_received(self, nick, message):
+        self._message_queue.post([nick, message])
+        self._wakeup_event.set()
+
+    def irc_nickname(self):
+        return "sheriffbot"
+
+    def irc_password(self):
+        return self._password
+
+
+class SheriffIRCBot(object):
+    # FIXME: Lame.  We should have an auto-registering CommandCenter.
+    commands = {
+        "last-green-revision": irc_command.LastGreenRevision,
+        "restart": irc_command.Restart,
+        "rollout": irc_command.Rollout,
+        "hi": irc_command.Hi,
+    }
+
+    def __init__(self, tool, sheriff):
+        self._tool = tool
+        self._sheriff = sheriff
+        self._message_queue = ThreadedMessageQueue()
+
+    def irc_delegate(self):
+        return _IRCThreadTearoff(self._tool.irc_password,
+                                 self._message_queue,
+                                 self._tool.wakeup_event)
+
+    def process_message(self, message):
+        (nick, request) = message
+        tokenized_request = request.strip().split(" ")
+        if not tokenized_request:
+            return
+        command = self.commands.get(tokenized_request[0])
+        if not command:
+            self._tool.irc().post("%s: Available commands: %s" % (
+                                  nick, ", ".join(self.commands.keys())))
+            return
+        response = command().execute(nick,
+                                     tokenized_request[1:],
+                                     self._tool,
+                                     self._sheriff)
+        if response:
+            self._tool.irc().post(response)
+
+    def process_pending_messages(self):
+        (messages, is_running) = self._message_queue.take_all()
+        for message in messages:
+            self.process_message(message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
new file mode 100644
index 0000000..d5116e4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
@@ -0,0 +1,91 @@
+# 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.
+
+import unittest
+import random
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot
+from webkitpy.tool.bot.sheriff_unittest import MockSheriffBot
+from webkitpy.tool.mocktool import MockTool
+
+
+def run(message):
+    tool = MockTool()
+    tool.ensure_irc_connected(None)
+    bot = SheriffIRCBot(tool, Sheriff(tool, MockSheriffBot()))
+    bot._message_queue.post(["mock_nick", message])
+    bot.process_pending_messages()
+
+
+class SheriffIRCBotTest(unittest.TestCase):
+    def test_hi(self):
+        random.seed(23324)
+        expected_stderr = 'MOCK: irc.post: "Only you can prevent forest fires." -- Smokey the Bear\n'
+        OutputCapture().assert_outputs(self, run, args=["hi"], expected_stderr=expected_stderr)
+
+    def test_bogus(self):
+        expected_stderr = "MOCK: irc.post: mock_nick: Available commands: rollout, hi, restart, last-green-revision\n"
+        OutputCapture().assert_outputs(self, run, args=["bogus"], expected_stderr=expected_stderr)
+
+    def test_lgr(self):
+        expected_stderr = "MOCK: irc.post: mock_nick: http://trac.webkit.org/changeset/9479\n"
+        OutputCapture().assert_outputs(self, run, args=["last-green-revision"], expected_stderr=expected_stderr)
+
+    def test_rollout(self):
+        expected_stderr = "MOCK: irc.post: Preparing rollout for r21654...\nMOCK: irc.post: mock_nick: Created rollout: http://example.com/36936\n"
+        OutputCapture().assert_outputs(self, run, args=["rollout 21654 This patch broke the world"], expected_stderr=expected_stderr)
+
+    def test_rollout_bananas(self):
+        expected_stderr = "MOCK: irc.post: mock_nick: Usage: SVN_REVISION REASON\n"
+        OutputCapture().assert_outputs(self, run, args=["rollout bananas"], expected_stderr=expected_stderr)
+
+    def test_rollout_invalidate_revision(self):
+        expected_stderr = ("MOCK: irc.post: Preparing rollout for r--component=Tools...\n"
+                           "MOCK: irc.post: mock_nick: Failed to create rollout patch:\n"
+                           "MOCK: irc.post: Invalid svn revision number \"--component=Tools\".\n")
+        OutputCapture().assert_outputs(self, run,
+                                       args=["rollout "
+                                             "--component=Tools 21654"],
+                                       expected_stderr=expected_stderr)
+
+    def test_rollout_invalidate_reason(self):
+        expected_stderr = ("MOCK: irc.post: Preparing rollout for "
+                           "r21654...\nMOCK: irc.post: mock_nick: Failed to "
+                           "create rollout patch:\nMOCK: irc.post: The rollout"
+                           " reason may not begin with - (\"-bad (Requested "
+                           "by mock_nick on #webkit).\").\n")
+        OutputCapture().assert_outputs(self, run,
+                                       args=["rollout "
+                                             "21654 -bad"],
+                                       expected_stderr=expected_stderr)
+
+    def test_rollout_no_reason(self):
+        expected_stderr = "MOCK: irc.post: mock_nick: Usage: SVN_REVISION REASON\n"
+        OutputCapture().assert_outputs(self, run, args=["rollout 21654"], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
new file mode 100644
index 0000000..71c3719
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
@@ -0,0 +1,4 @@
+# Required for Python to search this directory for module files
+
+from webkitpy.tool.commands.prettydiff import PrettyDiff
+# FIXME: Add the rest of the commands here.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py b/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
new file mode 100644
index 0000000..fc5a794
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
@@ -0,0 +1,43 @@
+# 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.
+
+from webkitpy.tool.commands.stepsequence import StepSequence
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+
+
+class AbstractSequencedCommand(AbstractDeclarativeCommand):
+    steps = None
+    def __init__(self):
+        self._sequence = StepSequence(self.steps)
+        AbstractDeclarativeCommand.__init__(self, self._sequence.options())
+
+    def _prepare_state(self, options, args, tool):
+        return None
+
+    def execute(self, options, args, tool):
+        self._sequence.run_and_handle_errors(tool, options, self._prepare_state(options, args, tool))
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py b/WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py
new file mode 100644
index 0000000..887802c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.thirdparty.mock import Mock
+
+class CommandsTest(unittest.TestCase):
+    def assert_execute_outputs(self, command, args, expected_stdout="", expected_stderr="", options=Mock(), tool=MockTool()):
+        command.bind_to_tool(tool)
+        OutputCapture().assert_outputs(self, command.execute, [options, args, tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
new file mode 100644
index 0000000..d960bbe
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -0,0 +1,355 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+
+import os
+
+from optparse import make_option
+
+import webkitpy.tool.steps as steps
+
+from webkitpy.common.checkout.changelog import ChangeLog, view_source_url
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+from webkitpy.tool.commands.stepsequence import StepSequence
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import error, log
+
+
+class Update(AbstractSequencedCommand):
+    name = "update"
+    help_text = "Update working copy (used internally)"
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+    ]
+
+
+class Build(AbstractSequencedCommand):
+    name = "build"
+    help_text = "Update working copy and build"
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.Build,
+    ]
+
+
+class BuildAndTest(AbstractSequencedCommand):
+    name = "build-and-test"
+    help_text = "Update working copy, build, and run the tests"
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.Build,
+        steps.RunTests,
+    ]
+
+
+class Land(AbstractSequencedCommand):
+    name = "land"
+    help_text = "Land the current working directory diff and updates the associated bug if any"
+    argument_names = "[BUGID]"
+    show_in_main_help = True
+    steps = [
+        steps.EnsureBuildersAreGreen,
+        steps.UpdateChangeLogsWithReviewer,
+        steps.ValidateReviewer,
+        steps.EnsureBuildersAreGreen,
+        steps.Build,
+        steps.RunTests,
+        steps.Commit,
+        steps.CloseBugForLandDiff,
+    ]
+    long_help = """land commits the current working copy diff (just as svn or git commit would).
+land will build and run the tests before committing.
+If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing."""
+
+    def _prepare_state(self, options, args, tool):
+        return {
+            "bug_id" : (args and args[0]) or tool.checkout().bug_id_for_this_commit()
+        }
+
+
+class AbstractPatchProcessingCommand(AbstractDeclarativeCommand):
+    # Subclasses must implement the methods below.  We don't declare them here
+    # because we want to be able to implement them with mix-ins.
+    #
+    # def _fetch_list_of_patches_to_process(self, options, args, tool):
+    # def _prepare_to_process(self, options, args, tool):
+
+    @staticmethod
+    def _collect_patches_by_bug(patches):
+        bugs_to_patches = {}
+        for patch in patches:
+            bugs_to_patches[patch.bug_id()] = bugs_to_patches.get(patch.bug_id(), []) + [patch]
+        return bugs_to_patches
+
+    def execute(self, options, args, tool):
+        self._prepare_to_process(options, args, tool)
+        patches = self._fetch_list_of_patches_to_process(options, args, tool)
+
+        # It's nice to print out total statistics.
+        bugs_to_patches = self._collect_patches_by_bug(patches)
+        log("Processing %s from %s." % (pluralize("patch", len(patches)), pluralize("bug", len(bugs_to_patches))))
+
+        for patch in patches:
+            self._process_patch(patch, options, args, tool)
+
+
+class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand):
+    prepare_steps = None
+    main_steps = None
+
+    def __init__(self):
+        options = []
+        self._prepare_sequence = StepSequence(self.prepare_steps)
+        self._main_sequence = StepSequence(self.main_steps)
+        options = sorted(set(self._prepare_sequence.options() + self._main_sequence.options()))
+        AbstractPatchProcessingCommand.__init__(self, options)
+
+    def _prepare_to_process(self, options, args, tool):
+        self._prepare_sequence.run_and_handle_errors(tool, options)
+
+    def _process_patch(self, patch, options, args, tool):
+        state = { "patch" : patch }
+        self._main_sequence.run_and_handle_errors(tool, options, state)
+
+
+class ProcessAttachmentsMixin(object):
+    def _fetch_list_of_patches_to_process(self, options, args, tool):
+        return map(lambda patch_id: tool.bugs.fetch_attachment(patch_id), args)
+
+
+class ProcessBugsMixin(object):
+    def _fetch_list_of_patches_to_process(self, options, args, tool):
+        all_patches = []
+        for bug_id in args:
+            patches = tool.bugs.fetch_bug(bug_id).reviewed_patches()
+            log("%s found on bug %s." % (pluralize("reviewed patch", len(patches)), bug_id))
+            all_patches += patches
+        return all_patches
+
+
+class CheckStyle(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
+    name = "check-style"
+    help_text = "Run check-webkit-style on the specified attachments"
+    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+    main_steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.ApplyPatch,
+        steps.CheckStyle,
+    ]
+
+
+class BuildAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
+    name = "build-attachment"
+    help_text = "Apply and build patches from bugzilla"
+    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+    main_steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.ApplyPatch,
+        steps.Build,
+    ]
+
+
+class AbstractPatchApplyingCommand(AbstractPatchSequencingCommand):
+    prepare_steps = [
+        steps.EnsureLocalCommitIfNeeded,
+        steps.CleanWorkingDirectoryWithLocalCommits,
+        steps.Update,
+    ]
+    main_steps = [
+        steps.ApplyPatchWithLocalCommit,
+    ]
+    long_help = """Updates the working copy.
+Downloads and applies the patches, creating local commits if necessary."""
+
+
+class ApplyAttachment(AbstractPatchApplyingCommand, ProcessAttachmentsMixin):
+    name = "apply-attachment"
+    help_text = "Apply an attachment to the local working directory"
+    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+    show_in_main_help = True
+
+
+class ApplyFromBug(AbstractPatchApplyingCommand, ProcessBugsMixin):
+    name = "apply-from-bug"
+    help_text = "Apply reviewed patches from provided bugs to the local working directory"
+    argument_names = "BUGID [BUGIDS]"
+    show_in_main_help = True
+
+
+class AbstractPatchLandingCommand(AbstractPatchSequencingCommand):
+    prepare_steps = [
+        steps.EnsureBuildersAreGreen,
+    ]
+    main_steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.ApplyPatch,
+        steps.ValidateReviewer,
+        steps.EnsureBuildersAreGreen,
+        steps.Build,
+        steps.RunTests,
+        steps.Commit,
+        steps.ClosePatch,
+        steps.CloseBug,
+    ]
+    long_help = """Checks to make sure builders are green.
+Updates the working copy.
+Applies the patch.
+Builds.
+Runs the layout tests.
+Commits the patch.
+Clears the flags on the patch.
+Closes the bug if no patches are marked for review."""
+
+
+class LandAttachment(AbstractPatchLandingCommand, ProcessAttachmentsMixin):
+    name = "land-attachment"
+    help_text = "Land patches from bugzilla, optionally building and testing them first"
+    argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+    show_in_main_help = True
+
+
+class LandFromBug(AbstractPatchLandingCommand, ProcessBugsMixin):
+    name = "land-from-bug"
+    help_text = "Land all patches on the given bugs, optionally building and testing them first"
+    argument_names = "BUGID [BUGIDS]"
+    show_in_main_help = True
+
+
+class AbstractRolloutPrepCommand(AbstractSequencedCommand):
+    argument_names = "REVISION REASON"
+
+    def _commit_info(self, revision):
+        commit_info = self.tool.checkout().commit_info_for_revision(revision)
+        if commit_info and commit_info.bug_id():
+            # Note: Don't print a bug URL here because it will confuse the
+            #       SheriffBot because the SheriffBot just greps the output
+            #       of create-rollout for bug URLs.  It should do better
+            #       parsing instead.
+            log("Preparing rollout for bug %s." % commit_info.bug_id())
+            return commit_info
+        log("Unable to parse bug number from diff.")
+
+    def _prepare_state(self, options, args, tool):
+        revision = args[0]
+        commit_info = self._commit_info(revision)
+        cc_list = sorted([party.bugzilla_email()
+                          for party in commit_info.responsible_parties()
+                          if party.bugzilla_email()])
+        return {
+            "revision": revision,
+            "bug_id": commit_info.bug_id(),
+            # FIXME: We should used the list as the canonical representation.
+            "bug_cc": ",".join(cc_list),
+            "reason": args[1],
+        }
+
+
+class PrepareRollout(AbstractRolloutPrepCommand):
+    name = "prepare-rollout"
+    help_text = "Revert the given revision in the working copy and prepare ChangeLogs with revert reason"
+    long_help = """Updates the working copy.
+Applies the inverse diff for the provided revision.
+Creates an appropriate rollout ChangeLog, including a trac link and bug link.
+"""
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.RevertRevision,
+        steps.PrepareChangeLogForRevert,
+    ]
+
+
+class CreateRollout(AbstractRolloutPrepCommand):
+    name = "create-rollout"
+    help_text = "Creates a bug to track a broken SVN revision and uploads a rollout patch."
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.RevertRevision,
+        steps.CreateBug,
+        steps.PrepareChangeLogForRevert,
+        steps.PostDiffForRevert,
+    ]
+
+    def _prepare_state(self, options, args, tool):
+        state = AbstractRolloutPrepCommand._prepare_state(self, options, args, tool)
+        # Currently, state["bug_id"] points to the bug that caused the
+        # regression.  We want to create a new bug that blocks the old bug
+        # so we move state["bug_id"] to state["bug_blocked"] and delete the
+        # old state["bug_id"] so that steps.CreateBug will actually create
+        # the new bug that we want (and subsequently store its bug id into
+        # state["bug_id"])
+        state["bug_blocked"] = state["bug_id"]
+        del state["bug_id"]
+        state["bug_title"] = "REGRESSION(r%s): %s" % (state["revision"], state["reason"])
+        state["bug_description"] = "%s broke the build:\n%s" % (view_source_url(state["revision"]), state["reason"])
+        # FIXME: If we had more context here, we could link to other open bugs
+        #        that mention the test that regressed.
+        if options.parent_command == "sheriff-bot":
+            state["bug_description"] += """
+
+This is an automatic bug report generated by the sheriff-bot. If this bug
+report was created because of a flaky test, please file a bug for the flaky
+test (if we don't already have one on file) and dup this bug against that bug
+so that we can track how often these flaky tests case pain.
+
+"Only you can prevent forest fires." -- Smokey the Bear
+"""
+        return state
+
+
+class Rollout(AbstractRolloutPrepCommand):
+    name = "rollout"
+    show_in_main_help = True
+    help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"
+    long_help = """Updates the working copy.
+Applies the inverse diff for the provided revision.
+Creates an appropriate rollout ChangeLog, including a trac link and bug link.
+Opens the generated ChangeLogs in $EDITOR.
+Shows the prepared diff for confirmation.
+Commits the revert and updates the bug (including re-opening the bug if necessary)."""
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.RevertRevision,
+        steps.PrepareChangeLogForRevert,
+        steps.EditChangeLog,
+        steps.ConfirmDiff,
+        steps.Build,
+        steps.Commit,
+        steps.ReopenBugAfterRollout,
+    ]
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
new file mode 100644
index 0000000..926037c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
@@ -0,0 +1,147 @@
+# Copyright (C) 2009 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.
+
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.download import *
+
+
+class DownloadCommandsTest(CommandsTest):
+    def _default_options(self):
+        options = Mock()
+        options.force_clean = False
+        options.clean = True
+        options.check_builders = True
+        options.quiet = False
+        options.non_interactive = False
+        options.update = True
+        options.build = True
+        options.test = True
+        options.close_bug = True
+        return options
+
+    def test_build(self):
+        expected_stderr = "Updating working directory\nBuilding WebKit\n"
+        self.assert_execute_outputs(Build(), [], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_build_and_test(self):
+        expected_stderr = "Updating working directory\nBuilding WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\n"
+        self.assert_execute_outputs(BuildAndTest(), [], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_apply_attachment(self):
+        options = self._default_options()
+        options.update = True
+        options.local_commit = True
+        expected_stderr = "Updating working directory\nProcessing 1 patch from 1 bug.\nProcessing patch 197 from bug 42.\n"
+        self.assert_execute_outputs(ApplyAttachment(), [197], options=options, expected_stderr=expected_stderr)
+
+    def test_apply_patches(self):
+        options = self._default_options()
+        options.update = True
+        options.local_commit = True
+        expected_stderr = "Updating working directory\n2 reviewed patches found on bug 42.\nProcessing 2 patches from 1 bug.\nProcessing patch 197 from bug 42.\nProcessing patch 128 from bug 42.\n"
+        self.assert_execute_outputs(ApplyFromBug(), [42], options=options, expected_stderr=expected_stderr)
+
+    def test_land_diff(self):
+        expected_stderr = "Building WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\nUpdating bug 42\n"
+        self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_check_style(self):
+        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nRunning check-webkit-style\n"
+        self.assert_execute_outputs(CheckStyle(), [197], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_build_attachment(self):
+        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nBuilding WebKit\n"
+        self.assert_execute_outputs(BuildAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_land_attachment(self):
+        # FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
+        expected_stderr = """Processing 1 patch from 1 bug.
+Updating working directory
+Processing patch 197 from bug 42.
+Building WebKit
+Running Python unit tests
+Running Perl unit tests
+Running JavaScriptCore tests
+Running run-webkit-tests
+Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
+"""
+        self.assert_execute_outputs(LandAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_land_patches(self):
+        # FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
+        expected_stderr = """2 reviewed patches found on bug 42.
+Processing 2 patches from 1 bug.
+Updating working directory
+Processing patch 197 from bug 42.
+Building WebKit
+Running Python unit tests
+Running Perl unit tests
+Running JavaScriptCore tests
+Running run-webkit-tests
+Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
+Updating working directory
+Processing patch 128 from bug 42.
+Building WebKit
+Running Python unit tests
+Running Perl unit tests
+Running JavaScriptCore tests
+Running run-webkit-tests
+Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patches to land from this bug.
+"""
+        self.assert_execute_outputs(LandFromBug(), [42], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_prepare_rollout(self):
+        expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\n"
+        self.assert_execute_outputs(PrepareRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_create_rollout(self):
+        expected_stderr = """Preparing rollout for bug 42.
+Updating working directory
+MOCK create_bug
+bug_title: REGRESSION(r852): Reason
+bug_description: http://trac.webkit.org/changeset/852 broke the build:
+Reason
+Running prepare-ChangeLog
+MOCK add_patch_to_bug: bug_id=None, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
+-- Begin comment --
+Any committer can land this patch automatically by marking it commit-queue+.  The commit-queue will build and test the patch before landing to ensure that the rollout will be successful.  This process takes approximately 15 minutes.
+
+If you would like to land the rollout faster, you can use the following command:
+
+  webkit-patch land-attachment ATTACHMENT_ID --ignore-builders
+
+where ATTACHMENT_ID is the ID of this attachment.
+-- End comment --
+"""
+        self.assert_execute_outputs(CreateRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
+    def test_rollout(self):
+        expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\nMOCK: user.open_url: file://...\nBuilding WebKit\n"
+        self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
new file mode 100644
index 0000000..9ea34c0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -0,0 +1,160 @@
+# Copyright (c) 2009 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.
+
+from StringIO import StringIO
+
+from webkitpy.tool.commands.queues import AbstractReviewQueue
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.bot.queueengine import QueueEngine
+
+
+class AbstractEarlyWarningSystem(AbstractReviewQueue):
+    _build_style = "release"
+
+    def __init__(self):
+        AbstractReviewQueue.__init__(self)
+        self.port = WebKitPort.port(self.port_name)
+
+    def should_proceed_with_work_item(self, patch):
+        return True
+
+    def _can_build(self):
+        try:
+            self.run_webkit_patch([
+                "build",
+                self.port.flag(),
+                "--build",
+                "--build-style=%s" % self._build_style,
+                "--force-clean",
+                "--no-update",
+                "--quiet"])
+            return True
+        except ScriptError, e:
+            self._update_status("Unable to perform a build")
+            return False
+
+    def _build(self, patch, first_run=False):
+        try:
+            args = [
+                "build-attachment",
+                self.port.flag(),
+                "--build",
+                "--build-style=%s" % self._build_style,
+                "--force-clean",
+                "--quiet",
+                "--non-interactive",
+                patch.id()]
+            if not first_run:
+                # See commit-queue for an explanation of what we're doing here.
+                args.append("--no-update")
+                args.append("--parent-command=%s" % self.name)
+            self.run_webkit_patch(args)
+            return True
+        except ScriptError, e:
+            if first_run:
+                return False
+            raise
+
+    def review_patch(self, patch):
+        if not self._build(patch, first_run=True):
+            if not self._can_build():
+                return False
+            self._build(patch)
+        return True
+
+    @classmethod
+    def handle_script_error(cls, tool, state, script_error):
+        is_svn_apply = script_error.command_name() == "svn-apply"
+        status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
+        if is_svn_apply:
+            QueueEngine.exit_after_handled_error(script_error)
+        results_link = tool.status_server.results_url_for_status(status_id)
+        message = "Attachment %s did not build on %s:\nBuild output: %s" % (state["patch"].id(), cls.port_name, results_link)
+        tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
+        exit(1)
+
+
+class GtkEWS(AbstractEarlyWarningSystem):
+    name = "gtk-ews"
+    port_name = "gtk"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "gns@gnome.org",
+        "xan.lopez@gmail.com",
+    ]
+
+
+class QtEWS(AbstractEarlyWarningSystem):
+    name = "qt-ews"
+    port_name = "qt"
+
+
+class WinEWS(AbstractEarlyWarningSystem):
+    name = "win-ews"
+    port_name = "win"
+
+
+class AbstractChromiumEWS(AbstractEarlyWarningSystem):
+    port_name = "chromium"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "dglazkov@chromium.org",
+    ]
+
+
+class ChromiumLinuxEWS(AbstractChromiumEWS):
+    # FIXME: We should rename this command to cr-linux-ews, but that requires
+    #        a database migration. :(
+    name = "chromium-ews"
+
+
+class ChromiumWindowsEWS(AbstractChromiumEWS):
+    name = "cr-win-ews"
+
+
+class ChromiumMacEWS(AbstractChromiumEWS):
+    name = "cr-mac-ews"
+
+
+# For platforms that we can't run inside a VM (like Mac OS X), we require
+# patches to be uploaded by committers, who are generally trustworthy folk. :)
+class AbstractCommitterOnlyEWS(AbstractEarlyWarningSystem):
+    def __init__(self, committers=CommitterList()):
+        AbstractEarlyWarningSystem.__init__(self)
+        self._committers = committers
+
+    def process_work_item(self, patch):
+        if not self._committers.committer_by_email(patch.attacher_email()):
+            self._did_error(patch, "%s cannot process patches from non-committers :(" % self.name)
+            return
+        AbstractEarlyWarningSystem.process_work_item(self, patch)
+
+
+class MacEWS(AbstractCommitterOnlyEWS):
+    name = "mac-ews"
+    port_name = "mac"
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
new file mode 100644
index 0000000..4d23a4c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -0,0 +1,75 @@
+# Copyright (C) 2009 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.
+
+import os
+
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.earlywarningsystem import *
+from webkitpy.tool.commands.queuestest import QueuesTest
+
+class EarlyWarningSytemTest(QueuesTest):
+    def test_failed_builds(self):
+        ews = ChromiumLinuxEWS()
+        ews._build = lambda patch, first_run=False: False
+        ews._can_build = lambda: True
+        ews.review_patch(Mock())
+
+    def test_chromium_linux_ews(self):
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: chromium-ews will discard all local changes in \"%s\"\nRunning WebKit chromium-ews.\n" % os.getcwd(),
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(ChromiumLinuxEWS(), expected_stderr=expected_stderr)
+
+    def test_chromium_windows_ews(self):
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: cr-win-ews will discard all local changes in \"%s\"\nRunning WebKit cr-win-ews.\n" % os.getcwd(),
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(ChromiumWindowsEWS(), expected_stderr=expected_stderr)
+
+    def test_qt_ews(self):
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: qt-ews will discard all local changes in \"%s\"\nRunning WebKit qt-ews.\n" % os.getcwd(),
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(QtEWS(), expected_stderr=expected_stderr)
+
+    def test_gtk_ews(self):
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: gtk-ews will discard all local changes in \"%s\"\nRunning WebKit gtk-ews.\n" % os.getcwd(),
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(GtkEWS(), expected_stderr=expected_stderr)
+
+    def test_mac_ews(self):
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: mac-ews will discard all local changes in \"%s\"\nRunning WebKit mac-ews.\n" % os.getcwd(),
+            "handle_unexpected_error": "Mock error message\n",
+        }
+        self.assert_queue_outputs(MacEWS(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
new file mode 100644
index 0000000..5da5bbb
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
@@ -0,0 +1,63 @@
+# 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.
+
+import re
+import sys
+
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import log
+
+
+class OpenBugs(AbstractDeclarativeCommand):
+    name = "open-bugs"
+    help_text = "Finds all bug numbers passed in arguments (or stdin if no args provided) and opens them in a web browser"
+
+    bug_number_regexp = re.compile(r"\b\d{4,6}\b")
+
+    def _open_bugs(self, bug_ids):
+        for bug_id in bug_ids:
+            bug_url = self.tool.bugs.bug_url_for_bug_id(bug_id)
+            self.tool.user.open_url(bug_url)
+
+    # _find_bugs_in_string mostly exists for easy unit testing.
+    def _find_bugs_in_string(self, string):
+        return self.bug_number_regexp.findall(string)
+
+    def _find_bugs_in_iterable(self, iterable):
+        return sum([self._find_bugs_in_string(string) for string in iterable], [])
+
+    def execute(self, options, args, tool):
+        if args:
+            bug_ids = self._find_bugs_in_iterable(args)
+        else:
+            # This won't open bugs until stdin is closed but could be made to easily.  That would just make unit testing slightly harder.
+            bug_ids = self._find_bugs_in_iterable(sys.stdin)
+
+        log("%s bugs found in input." % len(bug_ids))
+
+        self._open_bugs(bug_ids)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py
new file mode 100644
index 0000000..40a6e1b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py
@@ -0,0 +1,50 @@
+# Copyright (C) 2009 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.
+
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.openbugs import OpenBugs
+
+class OpenBugsTest(CommandsTest):
+
+    find_bugs_in_string_expectations = [
+        ["123", []],
+        ["1234", ["1234"]],
+        ["12345", ["12345"]],
+        ["123456", ["123456"]],
+        ["1234567", []],
+        [" 123456 234567", ["123456", "234567"]],
+    ]
+
+    def test_find_bugs_in_string(self):
+        openbugs = OpenBugs()
+        for expectation in self.find_bugs_in_string_expectations:
+            self.assertEquals(openbugs._find_bugs_in_string(expectation[0]), expectation[1])
+
+    def test_args_parsing(self):
+        expected_stderr = "2 bugs found in input.\nMOCK: user.open_url: http://example.com/12345\nMOCK: user.open_url: http://example.com/23456\n"
+        self.assert_execute_outputs(OpenBugs(), ["12345\n23456"], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py b/WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py
new file mode 100644
index 0000000..e3fc00c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py
@@ -0,0 +1,38 @@
+# 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.
+
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+import webkitpy.tool.steps as steps
+
+
+class PrettyDiff(AbstractSequencedCommand):
+    name = "pretty-diff"
+    help_text = "Shows the pretty diff in the default browser"
+    steps = [
+        steps.ConfirmDiff,
+    ]
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
new file mode 100644
index 0000000..645060c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -0,0 +1,285 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+
+
+from optparse import make_option
+
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.system.user import User
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import log
+
+
+class BugsToCommit(AbstractDeclarativeCommand):
+    name = "bugs-to-commit"
+    help_text = "List bugs in the commit-queue"
+
+    def execute(self, options, args, tool):
+        # FIXME: This command is poorly named.  It's fetching the commit-queue list here.  The name implies it's fetching pending-commit (all r+'d patches).
+        bug_ids = tool.bugs.queries.fetch_bug_ids_from_commit_queue()
+        for bug_id in bug_ids:
+            print "%s" % bug_id
+
+
+class PatchesInCommitQueue(AbstractDeclarativeCommand):
+    name = "patches-in-commit-queue"
+    help_text = "List patches in the commit-queue"
+
+    def execute(self, options, args, tool):
+        patches = tool.bugs.queries.fetch_patches_from_commit_queue()
+        log("Patches in commit queue:")
+        for patch in patches:
+            print patch.url()
+
+
+class PatchesToCommitQueue(AbstractDeclarativeCommand):
+    name = "patches-to-commit-queue"
+    help_text = "Patches which should be added to the commit queue"
+    def __init__(self):
+        options = [
+            make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"),
+        ]
+        AbstractDeclarativeCommand.__init__(self, options=options)
+
+    @staticmethod
+    def _needs_commit_queue(patch):
+        if patch.commit_queue() == "+": # If it's already cq+, ignore the patch.
+            log("%s already has cq=%s" % (patch.id(), patch.commit_queue()))
+            return False
+
+        # We only need to worry about patches from contributers who are not yet committers.
+        committer_record = CommitterList().committer_by_email(patch.attacher_email())
+        if committer_record:
+            log("%s committer = %s" % (patch.id(), committer_record))
+        return not committer_record
+
+    def execute(self, options, args, tool):
+        patches = tool.bugs.queries.fetch_patches_from_pending_commit_list()
+        patches_needing_cq = filter(self._needs_commit_queue, patches)
+        if options.bugs:
+            bugs_needing_cq = map(lambda patch: patch.bug_id(), patches_needing_cq)
+            bugs_needing_cq = sorted(set(bugs_needing_cq))
+            for bug_id in bugs_needing_cq:
+                print "%s" % tool.bugs.bug_url_for_bug_id(bug_id)
+        else:
+            for patch in patches_needing_cq:
+                print "%s" % tool.bugs.attachment_url_for_id(patch.id(), action="edit")
+
+
+class PatchesToReview(AbstractDeclarativeCommand):
+    name = "patches-to-review"
+    help_text = "List patches that are pending review"
+
+    def execute(self, options, args, tool):
+        patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
+        log("Patches pending review:")
+        for patch_id in patch_ids:
+            print patch_id
+
+
+class LastGreenRevision(AbstractDeclarativeCommand):
+    name = "last-green-revision"
+    help_text = "Prints the last known good revision"
+
+    def execute(self, options, args, tool):
+        print self.tool.buildbot.last_green_revision()
+
+
+class WhatBroke(AbstractDeclarativeCommand):
+    name = "what-broke"
+    help_text = "Print failing buildbots (%s) and what revisions broke them" % BuildBot.default_host
+
+    def _print_builder_line(self, builder_name, max_name_width, status_message):
+        print "%s : %s" % (builder_name.ljust(max_name_width), status_message)
+
+    # FIXME: This is slightly different from Builder.suspect_revisions_for_green_to_red_transition
+    # due to needing to detect the "hit the limit" case an print a special message.
+    def _print_blame_information_for_builder(self, builder_status, name_width, avoid_flakey_tests=True):
+        builder = self.tool.buildbot.builder_with_name(builder_status["name"])
+        red_build = builder.build(builder_status["build_number"])
+        (last_green_build, first_red_build) = builder.find_failure_transition(red_build)
+        if not first_red_build:
+            self._print_builder_line(builder.name(), name_width, "FAIL (error loading build information)")
+            return
+        if not last_green_build:
+            self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: sometime before %s?)" % first_red_build.revision())
+            return
+
+        suspect_revisions = range(first_red_build.revision(), last_green_build.revision(), -1)
+        suspect_revisions.reverse()
+        first_failure_message = ""
+        if (first_red_build == builder.build(builder_status["build_number"])):
+            first_failure_message = " FIRST FAILURE, possibly a flaky test"
+        self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: %s%s)" % (suspect_revisions, first_failure_message))
+        for revision in suspect_revisions:
+            commit_info = self.tool.checkout().commit_info_for_revision(revision)
+            if commit_info:
+                print commit_info.blame_string(self.tool.bugs)
+            else:
+                print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+
+    def execute(self, options, args, tool):
+        builder_statuses = tool.buildbot.builder_statuses()
+        longest_builder_name = max(map(len, map(lambda builder: builder["name"], builder_statuses)))
+        failing_builders = 0
+        for builder_status in builder_statuses:
+            # If the builder is green, print OK, exit.
+            if builder_status["is_green"]:
+                continue
+            self._print_blame_information_for_builder(builder_status, name_width=longest_builder_name)
+            failing_builders += 1
+        if failing_builders:
+            print "%s of %s are failing" % (failing_builders, pluralize("builder", len(builder_statuses)))
+        else:
+            print "All builders are passing!"
+
+
+class WhoBrokeIt(AbstractDeclarativeCommand):
+    name = "who-broke-it"
+    help_text = "Print a list of revisions causing failures on %s" % BuildBot.default_host
+
+    def execute(self, options, args, tool):
+        for revision, builders in self.tool.buildbot.revisions_causing_failures(False).items():
+            print "r%s appears to have broken %s" % (revision, [builder.name() for builder in builders])
+
+
+class ResultsFor(AbstractDeclarativeCommand):
+    name = "results-for"
+    help_text = "Print a list of failures for the passed revision from bots on %s" % BuildBot.default_host
+    argument_names = "REVISION"
+
+    def _print_layout_test_results(self, results):
+        if not results:
+            print " No results."
+            return
+        for title, files in results.parsed_results().items():
+            print " %s" % title
+            for filename in files:
+                print "  %s" % filename
+
+    def execute(self, options, args, tool):
+        builders = self.tool.buildbot.builders()
+        for builder in builders:
+            print "%s:" % builder.name()
+            build = builder.build_for_revision(args[0], allow_failed_lookups=True)
+            self._print_layout_test_results(build.layout_test_results())
+
+
+class FailureReason(AbstractDeclarativeCommand):
+    name = "failure-reason"
+    help_text = "Lists revisions where individual test failures started at %s" % BuildBot.default_host
+
+    def _print_blame_information_for_transition(self, green_build, red_build, failing_tests):
+        suspect_revisions = green_build.builder().suspect_revisions_for_transition(green_build, red_build)
+        print "SUCCESS: Build %s (r%s) was the first to show failures: %s" % (red_build._number, red_build.revision(), failing_tests)
+        print "Suspect revisions:"
+        for revision in suspect_revisions:
+            commit_info = self.tool.checkout().commit_info_for_revision(revision)
+            if commit_info:
+                print commit_info.blame_string(self.tool.bugs)
+            else:
+                print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+
+    def _explain_failures_for_builder(self, builder, start_revision):
+        print "Examining failures for \"%s\", starting at r%s" % (builder.name(), start_revision)
+        revision_to_test = start_revision
+        build = builder.build_for_revision(revision_to_test, allow_failed_lookups=True)
+        layout_test_results = build.layout_test_results()
+        if not layout_test_results:
+            # FIXME: This could be made more user friendly.
+            print "Failed to load layout test results; can't continue. (start revision = r%s)" % start_revision
+            return 1
+
+        results_to_explain = set(layout_test_results.failing_tests())
+        last_build_with_results = build
+        print "Starting at %s" % revision_to_test
+        while results_to_explain:
+            revision_to_test -= 1
+            new_build = builder.build_for_revision(revision_to_test, allow_failed_lookups=True)
+            if not new_build:
+                print "No build for %s" % revision_to_test
+                continue
+            build = new_build
+            latest_results = build.layout_test_results()
+            if not latest_results:
+                print "No results build %s (r%s)" % (build._number, build.revision())
+                continue
+            failures = set(latest_results.failing_tests())
+            if len(failures) >= 20:
+                # FIXME: We may need to move this logic into the LayoutTestResults class.
+                # The buildbot stops runs after 20 failures so we don't have full results to work with here.
+                print "Too many failures in build %s (r%s), ignoring." % (build._number, build.revision())
+                continue
+            fixed_results = results_to_explain - failures
+            if not fixed_results:
+                print "No change in build %s (r%s), %s unexplained failures (%s in this build)" % (build._number, build.revision(), len(results_to_explain), len(failures))
+                last_build_with_results = build
+                continue
+            self._print_blame_information_for_transition(build, last_build_with_results, fixed_results)
+            last_build_with_results = build
+            results_to_explain -= fixed_results
+        if results_to_explain:
+            print "Failed to explain failures: %s" % results_to_explain
+            return 1
+        print "Explained all results for %s" % builder.name()
+        return 0
+
+    def _builder_to_explain(self):
+        builder_statuses = self.tool.buildbot.builder_statuses()
+        red_statuses = [status for status in builder_statuses if not status["is_green"]]
+        print "%s failing" % (pluralize("builder", len(red_statuses)))
+        builder_choices = [status["name"] for status in red_statuses]
+        # We could offer an "All" choice here.
+        chosen_name = User.prompt_with_list("Which builder to diagnose:", builder_choices)
+        # FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
+        for status in red_statuses:
+            if status["name"] == chosen_name:
+                return (self.tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
+
+    def execute(self, options, args, tool):
+        (builder, latest_revision) = self._builder_to_explain()
+        start_revision = self.tool.user.prompt("Revision to walk backwards from? [%s] " % latest_revision) or latest_revision
+        if not start_revision:
+            print "Revision required."
+            return 1
+        return self._explain_failures_for_builder(builder, start_revision=int(start_revision))
+
+class TreeStatus(AbstractDeclarativeCommand):
+    name = "tree-status"
+    help_text = "Print the status of the %s buildbots" % BuildBot.default_host
+    long_help = """Fetches build status from http://build.webkit.org/one_box_per_builder
+and displayes the status of each builder."""
+
+    def execute(self, options, args, tool):
+        for builder in tool.buildbot.builder_statuses():
+            status_string = "ok" if builder["is_green"] else "FAIL"
+            print "%s : %s" % (status_string.ljust(4), builder["name"])
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
new file mode 100644
index 0000000..98ed545
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -0,0 +1,63 @@
+# Copyright (C) 2009 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.
+
+from webkitpy.common.net.bugzilla import Bugzilla
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.queries import *
+from webkitpy.tool.mocktool import MockTool
+
+class QueryCommandsTest(CommandsTest):
+    def test_bugs_to_commit(self):
+        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\n"
+        self.assert_execute_outputs(BugsToCommit(), None, "42\n77\n", expected_stderr)
+
+    def test_patches_in_commit_queue(self):
+        expected_stdout = "http://example.com/197\nhttp://example.com/103\n"
+        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nPatches in commit queue:\n"
+        self.assert_execute_outputs(PatchesInCommitQueue(), None, expected_stdout, expected_stderr)
+
+    def test_patches_to_commit_queue(self):
+        expected_stdout = "http://example.com/104&action=edit\n"
+        expected_stderr = "197 already has cq=+\n128 already has cq=+\n105 committer = \"Eric Seidel\" <eric@webkit.org>\n"
+        options = Mock()
+        options.bugs = False
+        self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
+
+        expected_stdout = "http://example.com/77\n"
+        options.bugs = True
+        self.assert_execute_outputs(PatchesToCommitQueue(), None, expected_stdout, expected_stderr, options=options)
+
+    def test_patches_to_review(self):
+        expected_stdout = "103\n"
+        expected_stderr = "Patches pending review:\n"
+        self.assert_execute_outputs(PatchesToReview(), None, expected_stdout, expected_stderr)
+
+    def test_tree_status(self):
+        expected_stdout = "ok   : Builder1\nok   : Builder2\n"
+        self.assert_execute_outputs(TreeStatus(), None, expected_stdout)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
new file mode 100644
index 0000000..f0da379
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -0,0 +1,364 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+
+import traceback
+import os
+
+from datetime import datetime
+from optparse import make_option
+from StringIO import StringIO
+
+from webkitpy.common.net.bugzilla import CommitterValidator
+from webkitpy.common.net.statusserver import StatusServer
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+from webkitpy.tool.bot.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
+from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import Command
+
+class AbstractQueue(Command, QueueEngineDelegate):
+    watchers = [
+        "webkit-bot-watchers@googlegroups.com",
+    ]
+
+    _pass_status = "Pass"
+    _fail_status = "Fail"
+    _error_status = "Error"
+
+    def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
+        options_list = (options or []) + [
+            make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
+            make_option("--exit-after-iteration", action="store", type="int", dest="iterations", default=None, help="Stop running the queue after iterating this number of times."),
+        ]
+        Command.__init__(self, "Run the %s" % self.name, options=options_list)
+        self._iteration_count = 0
+
+    def _cc_watchers(self, bug_id):
+        try:
+            self.tool.bugs.add_cc_to_bug(bug_id, self.watchers)
+        except Exception, e:
+            traceback.print_exc()
+            log("Failed to CC watchers.")
+
+    def run_webkit_patch(self, args):
+        webkit_patch_args = [self.tool.path()]
+        # FIXME: This is a hack, we should have a more general way to pass global options.
+        webkit_patch_args += ["--status-host=%s" % self.tool.status_server.host]
+        webkit_patch_args += map(str, args)
+        return self.tool.executive.run_and_throw_if_fail(webkit_patch_args)
+
+    def _log_directory(self):
+        return "%s-logs" % self.name
+
+    # QueueEngineDelegate methods
+
+    def queue_log_path(self):
+        return os.path.join(self._log_directory(), "%s.log" % self.name)
+
+    def work_item_log_path(self, work_item):
+        raise NotImplementedError, "subclasses must implement"
+
+    def begin_work_queue(self):
+        log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self.tool.scm().checkout_root))
+        if self.options.confirm:
+            response = self.tool.user.prompt("Are you sure?  Type \"yes\" to continue: ")
+            if (response != "yes"):
+                error("User declined.")
+        log("Running WebKit %s." % self.name)
+
+    def should_continue_work_queue(self):
+        self._iteration_count += 1
+        return not self.options.iterations or self._iteration_count <= self.options.iterations
+
+    def next_work_item(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def should_proceed_with_work_item(self, work_item):
+        raise NotImplementedError, "subclasses must implement"
+
+    def process_work_item(self, work_item):
+        raise NotImplementedError, "subclasses must implement"
+
+    def handle_unexpected_error(self, work_item, message):
+        raise NotImplementedError, "subclasses must implement"
+
+    # Command methods
+
+    def execute(self, options, args, tool, engine=QueueEngine):
+        self.options = options
+        self.tool = tool
+        return engine(self.name, self, self.tool.wakeup_event).run()
+
+    @classmethod
+    def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
+        message = script_error.message
+        if is_error:
+            message = "Error: %s" % message
+        output = script_error.message_with_output(output_limit=1024*1024) # 1MB
+        return tool.status_server.update_status(cls.name, message, state["patch"], StringIO(output))
+
+
+class AbstractPatchQueue(AbstractQueue):
+    def _update_status(self, message, patch=None, results_file=None):
+        self.tool.status_server.update_status(self.name, message, patch, results_file)
+
+    def _did_pass(self, patch):
+        self._update_status(self._pass_status, patch)
+
+    def _did_fail(self, patch):
+        self._update_status(self._fail_status, patch)
+
+    def _did_error(self, patch, reason):
+        message = "%s: %s" % (self._error_status, reason)
+        self._update_status(message, patch)
+
+    def work_item_log_path(self, patch):
+        return os.path.join(self._log_directory(), "%s.log" % patch.bug_id())
+
+    def log_progress(self, patch_ids):
+        log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
+
+
+class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
+    name = "commit-queue"
+    def __init__(self):
+        AbstractPatchQueue.__init__(self)
+
+    # AbstractPatchQueue methods
+
+    def begin_work_queue(self):
+        AbstractPatchQueue.begin_work_queue(self)
+        self.committer_validator = CommitterValidator(self.tool.bugs)
+
+    def _validate_patches_in_commit_queue(self):
+        # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
+        bug_ids = self.tool.bugs.queries.fetch_bug_ids_from_commit_queue()
+        all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
+        valid_patches = self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
+        if not self._builders_are_green():
+            return filter(lambda patch: patch.is_rollout(), valid_patches)
+        return valid_patches
+
+    def next_work_item(self):
+        patches = self._validate_patches_in_commit_queue()
+        # FIXME: We could sort the patches in a specific order here, was suggested by https://bugs.webkit.org/show_bug.cgi?id=33395
+        if not patches:
+            self._update_status("Empty queue")
+            return None
+        # Only bother logging if we have patches in the queue.
+        self.log_progress([patch.id() for patch in patches])
+        return patches[0]
+
+    def _can_build_and_test(self):
+        try:
+            self.run_webkit_patch([
+                "build-and-test",
+                "--force-clean",
+                "--build",
+                "--test",
+                "--non-interactive",
+                "--no-update",
+                "--build-style=both",
+                "--quiet"])
+        except ScriptError, e:
+            self._update_status("Unable to successfully build and test", None)
+            return False
+        return True
+
+    def _builders_are_green(self):
+        red_builders_names = self.tool.buildbot.red_core_builders_names()
+        if red_builders_names:
+            red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
+            self._update_status("Builders [%s] are red. See http://build.webkit.org" % ", ".join(red_builders_names), None)
+            return False
+        return True
+
+    def should_proceed_with_work_item(self, patch):
+        if not patch.is_rollout():
+            if not self._builders_are_green():
+                return False
+        self._update_status("Landing patch", patch)
+        return True
+
+    def _land(self, patch, first_run=False):
+        try:
+            # We need to check the builders, unless we're trying to land a
+            # rollout (in which case the builders are probably red.)
+            if not patch.is_rollout() and not self._builders_are_green():
+                # We return true here because we want to return to the main
+                # QueueEngine loop as quickly as possible.
+                return True
+            args = [
+                "land-attachment",
+                "--force-clean",
+                "--build",
+                "--test",
+                "--non-interactive",
+                # The master process is responsible for checking the status
+                # of the builders (see above call to _builders_are_green).
+                "--ignore-builders",
+                "--build-style=both",
+                "--quiet",
+                patch.id()
+            ]
+            if not first_run:
+                # The first time through, we don't reject the patch from the
+                # commit queue because we want to make sure we can build and
+                # test ourselves. However, the second time through, we
+                # register ourselves as the parent-command so we can reject
+                # the patch on failure.
+                args.append("--parent-command=commit-queue")
+                # The second time through, we also don't want to update so we
+                # know we're testing the same revision that we successfully
+                # built and tested.
+                args.append("--no-update")
+            self.run_webkit_patch(args)
+            self._did_pass(patch)
+            return True
+        except ScriptError, e:
+            if first_run:
+                return False
+            self._did_fail(patch)
+            raise
+
+    def process_work_item(self, patch):
+        self._cc_watchers(patch.bug_id())
+        if not self._land(patch, first_run=True):
+            # The patch failed to land, but the bots were green. It's possible
+            # that the bots were behind. To check that case, we try to build and
+            # test ourselves.
+            if not self._can_build_and_test():
+                return False
+            # Hum, looks like the patch is actually bad. Of course, we could
+            # have been bitten by a flaky test the first time around.  We try
+            # to land again.  If it fails a second time, we're pretty sure its
+            # a bad test and re can reject it outright.
+            self._land(patch)
+        return True
+
+    def handle_unexpected_error(self, patch, message):
+        self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
+
+    # StepSequenceErrorHandler methods
+
+    @staticmethod
+    def _error_message_for_bug(tool, status_id, script_error):
+        if not script_error.output:
+            return script_error.message_with_output()
+        results_link = tool.status_server.results_url_for_status(status_id)
+        return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)
+
+    @classmethod
+    def handle_script_error(cls, tool, state, script_error):
+        status_id = cls._update_status_for_script_error(tool, state, script_error)
+        validator = CommitterValidator(tool.bugs)
+        validator.reject_patch_from_commit_queue(state["patch"].id(), cls._error_message_for_bug(tool, status_id, script_error))
+
+
+class AbstractReviewQueue(AbstractPatchQueue, PersistentPatchCollectionDelegate, StepSequenceErrorHandler):
+    def __init__(self, options=None):
+        AbstractPatchQueue.__init__(self, options)
+
+    def review_patch(self, patch):
+        raise NotImplementedError, "subclasses must implement"
+
+    # PersistentPatchCollectionDelegate methods
+
+    def collection_name(self):
+        return self.name
+
+    def fetch_potential_patch_ids(self):
+        return self.tool.bugs.queries.fetch_attachment_ids_from_review_queue()
+
+    def status_server(self):
+        return self.tool.status_server
+
+    def is_terminal_status(self, status):
+        return status == "Pass" or status == "Fail" or status.startswith("Error:")
+
+    # AbstractPatchQueue methods
+
+    def begin_work_queue(self):
+        AbstractPatchQueue.begin_work_queue(self)
+        self._patches = PersistentPatchCollection(self)
+
+    def next_work_item(self):
+        patch_id = self._patches.next()
+        if patch_id:
+            return self.tool.bugs.fetch_attachment(patch_id)
+        self._update_status("Empty queue")
+
+    def should_proceed_with_work_item(self, patch):
+        raise NotImplementedError, "subclasses must implement"
+
+    def process_work_item(self, patch):
+        try:
+            if not self.review_patch(patch):
+                return False
+            self._did_pass(patch)
+            return True
+        except ScriptError, e:
+            if e.exit_code != QueueEngine.handled_error_code:
+                self._did_fail(patch)
+            raise e
+
+    def handle_unexpected_error(self, patch, message):
+        log(message)
+
+    # StepSequenceErrorHandler methods
+
+    @classmethod
+    def handle_script_error(cls, tool, state, script_error):
+        log(script_error.message_with_output())
+
+
+class StyleQueue(AbstractReviewQueue):
+    name = "style-queue"
+    def __init__(self):
+        AbstractReviewQueue.__init__(self)
+
+    def should_proceed_with_work_item(self, patch):
+        self._update_status("Checking style", patch)
+        return True
+
+    def review_patch(self, patch):
+        self.run_webkit_patch(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch.id()])
+        return True
+
+    @classmethod
+    def handle_script_error(cls, tool, state, script_error):
+        is_svn_apply = script_error.command_name() == "svn-apply"
+        status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
+        if is_svn_apply:
+            QueueEngine.exit_after_handled_error(script_error)
+        message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
+        tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
+        exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
new file mode 100644
index 0000000..f0f7c86
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -0,0 +1,164 @@
+# Copyright (C) 2009 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.
+
+import os
+
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.queues import *
+from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.mocktool import MockTool, MockSCM
+
+
+class TestQueue(AbstractPatchQueue):
+    name = "test-queue"
+
+
+class TestReviewQueue(AbstractReviewQueue):
+    name = "test-review-queue"
+
+
+class MockPatch(object):
+    def is_rollout(self):
+        return True
+
+    def bug_id(self):
+        return 12345
+
+    def id(self):
+        return 76543
+
+
+class AbstractQueueTest(CommandsTest):
+    def _assert_log_progress_output(self, patch_ids, progress_output):
+        OutputCapture().assert_outputs(self, TestQueue().log_progress, [patch_ids], expected_stderr=progress_output)
+
+    def test_log_progress(self):
+        self._assert_log_progress_output([1,2,3], "3 patches in test-queue [1, 2, 3]\n")
+        self._assert_log_progress_output(["1","2","3"], "3 patches in test-queue [1, 2, 3]\n")
+        self._assert_log_progress_output([1], "1 patch in test-queue [1]\n")
+
+    def test_log_directory(self):
+        self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
+
+    def _assert_run_webkit_patch(self, run_args):
+        queue = TestQueue()
+        tool = MockTool()
+        tool.executive = Mock()
+        queue.bind_to_tool(tool)
+
+        queue.run_webkit_patch(run_args)
+        expected_run_args = ["echo", "--status-host=example.com"] + map(str, run_args)
+        tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
+
+    def test_run_webkit_patch(self):
+        self._assert_run_webkit_patch([1])
+        self._assert_run_webkit_patch(["one", 2])
+
+    def test_iteration_count(self):
+        queue = TestQueue()
+        queue.options = Mock()
+        queue.options.iterations = 3
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertFalse(queue.should_continue_work_queue())
+
+    def test_no_iteration_count(self):
+        queue = TestQueue()
+        queue.options = Mock()
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertTrue(queue.should_continue_work_queue())
+        self.assertTrue(queue.should_continue_work_queue())
+
+
+class AbstractReviewQueueTest(CommandsTest):
+    def test_patch_collection_delegate_methods(self):
+        queue = TestReviewQueue()
+        tool = MockTool()
+        queue.bind_to_tool(tool)
+        self.assertEquals(queue.collection_name(), "test-review-queue")
+        self.assertEquals(queue.fetch_potential_patch_ids(), [103])
+        queue.status_server()
+        self.assertTrue(queue.is_terminal_status("Pass"))
+        self.assertTrue(queue.is_terminal_status("Fail"))
+        self.assertTrue(queue.is_terminal_status("Error: Your patch exploded"))
+        self.assertFalse(queue.is_terminal_status("Foo"))
+
+
+class CommitQueueTest(QueuesTest):
+    def test_commit_queue(self):
+        expected_stderr = {
+            "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
+            "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+2 patches in commit-queue [197, 106]
+""",
+        }
+        self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
+
+    def test_rollout(self):
+        tool = MockTool(log_executive=True)
+        tool.buildbot.light_tree_on_fire()
+        expected_stderr = {
+            "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
+            "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+1 patch in commit-queue [106]
+""",
+        }
+        self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
+
+    def test_rollout_lands(self):
+        tool = MockTool(log_executive=True)
+        tool.buildbot.light_tree_on_fire()
+        rollout_patch = MockPatch()
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
+            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
+            "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+1 patch in commit-queue [106]
+""",
+            "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--test', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', '76543']\n",
+        }
+        self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_stderr=expected_stderr)
+
+
+class StyleQueueTest(QueuesTest):
+    def test_style_queue(self):
+        expected_stderr = {
+            "begin_work_queue" : "CAUTION: style-queue will discard all local changes in \"%s\"\nRunning WebKit style-queue.\n" % MockSCM.fake_checkout_root,
+            "handle_unexpected_error" : "Mock error message\n",
+        }
+        self.assert_queue_outputs(StyleQueue(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
new file mode 100644
index 0000000..bf7e32a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -0,0 +1,100 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.mocktool import MockTool
+
+
+class MockQueueEngine(object):
+    def __init__(self, name, queue, wakeup_event):
+        pass
+
+    def run(self):
+        pass
+
+
+class QueuesTest(unittest.TestCase):
+    mock_work_item = Attachment({
+        "id": 1234,
+        "bug_id": 345,
+        "name": "Patch",
+        "attacher_email": "adam@example.com",
+    }, None)
+
+    def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, options=Mock(), tool=MockTool()):
+        if not expected_stdout:
+            expected_stdout = {}
+        if not expected_stderr:
+            expected_stderr = {}
+        if not args:
+            args = []
+        if not work_item:
+            work_item = self.mock_work_item
+        tool.user.prompt = lambda message: "yes"
+
+        queue.execute(options, args, tool, engine=MockQueueEngine)
+
+        OutputCapture().assert_outputs(self,
+                queue.queue_log_path,
+                expected_stdout=expected_stdout.get("queue_log_path", ""),
+                expected_stderr=expected_stderr.get("queue_log_path", ""))
+        OutputCapture().assert_outputs(self,
+                queue.work_item_log_path,
+                args=[work_item],
+                expected_stdout=expected_stdout.get("work_item_log_path", ""),
+                expected_stderr=expected_stderr.get("work_item_log_path", ""))
+        OutputCapture().assert_outputs(self,
+                queue.begin_work_queue,
+                expected_stdout=expected_stdout.get("begin_work_queue", ""),
+                expected_stderr=expected_stderr.get("begin_work_queue", ""))
+        OutputCapture().assert_outputs(self,
+                queue.should_continue_work_queue,
+                expected_stdout=expected_stdout.get("should_continue_work_queue", ""), expected_stderr=expected_stderr.get("should_continue_work_queue", ""))
+        OutputCapture().assert_outputs(self,
+                queue.next_work_item,
+                expected_stdout=expected_stdout.get("next_work_item", ""),
+                expected_stderr=expected_stderr.get("next_work_item", ""))
+        OutputCapture().assert_outputs(self,
+                queue.should_proceed_with_work_item,
+                args=[work_item],
+                expected_stdout=expected_stdout.get("should_proceed_with_work_item", ""),
+                expected_stderr=expected_stderr.get("should_proceed_with_work_item", ""))
+        OutputCapture().assert_outputs(self,
+                queue.process_work_item,
+                args=[work_item],
+                expected_stdout=expected_stdout.get("process_work_item", ""),
+                expected_stderr=expected_stderr.get("process_work_item", ""))
+        OutputCapture().assert_outputs(self,
+                queue.handle_unexpected_error,
+                args=[work_item, "Mock error message"],
+                expected_stdout=expected_stdout.get("handle_unexpected_error", ""),
+                expected_stderr=expected_stderr.get("handle_unexpected_error", ""))
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
new file mode 100644
index 0000000..eb80d8f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
@@ -0,0 +1,107 @@
+# Copyright (c) 2009 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.
+
+import os
+
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot
+from webkitpy.tool.commands.queues import AbstractQueue
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+
+
+class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
+    name = "sheriff-bot"
+    watchers = AbstractQueue.watchers + [
+        "abarth@webkit.org",
+        "eric@webkit.org",
+    ]
+
+    def _update(self):
+        self.run_webkit_patch(["update", "--force-clean", "--quiet"])
+
+    # AbstractQueue methods
+
+    def begin_work_queue(self):
+        AbstractQueue.begin_work_queue(self)
+        self._sheriff = Sheriff(self.tool, self)
+        self._irc_bot = SheriffIRCBot(self.tool, self._sheriff)
+        self.tool.ensure_irc_connected(self._irc_bot.irc_delegate())
+
+    def work_item_log_path(self, new_failures):
+        return os.path.join("%s-logs" % self.name, "%s.log" % new_failures.keys()[0])
+
+    def next_work_item(self):
+        self._irc_bot.process_pending_messages()
+        self._update()
+        new_failures = {}
+        revisions_causing_failures = self.tool.buildbot.revisions_causing_failures()
+        for svn_revision, builders in revisions_causing_failures.items():
+            if self.tool.status_server.svn_revision(svn_revision):
+                # FIXME: We should re-process the work item after some time delay.
+                # https://bugs.webkit.org/show_bug.cgi?id=36581
+                continue
+            new_failures[svn_revision] = builders
+        self._sheriff.provoke_flaky_builders(revisions_causing_failures)
+        return new_failures
+
+    def should_proceed_with_work_item(self, new_failures):
+        # Currently, we don't have any reasons not to proceed with work items.
+        return True
+
+    def process_work_item(self, new_failures):
+        blame_list = new_failures.keys()
+        for svn_revision, builders in new_failures.items():
+            try:
+                commit_info = self.tool.checkout().commit_info_for_revision(svn_revision)
+                if not commit_info:
+                    print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+                    continue
+                self._sheriff.post_irc_warning(commit_info, builders)
+                self._sheriff.post_blame_comment_on_bug(commit_info,
+                                                        builders,
+                                                        blame_list)
+                self._sheriff.post_automatic_rollout_patch(commit_info,
+                                                           builders)
+            finally:
+                for builder in builders:
+                    self.tool.status_server.update_svn_revision(svn_revision,
+                                                                builder.name())
+        return True
+
+    def handle_unexpected_error(self, new_failures, message):
+        log(message)
+
+    # StepSequenceErrorHandler methods
+
+    @classmethod
+    def handle_script_error(cls, tool, state, script_error):
+        # Ideally we would post some information to IRC about what went wrong
+        # here, but we don't have the IRC password in the child process.
+        pass
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
new file mode 100644
index 0000000..f121eda
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
@@ -0,0 +1,47 @@
+# 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.
+
+import os
+
+from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.commands.sheriffbot import SheriffBot
+from webkitpy.tool.mocktool import mock_builder
+
+
+class SheriffBotTest(QueuesTest):
+    def test_sheriff_bot(self):
+        mock_work_item = {
+            29837: [mock_builder],
+        }
+        expected_stderr = {
+            "begin_work_queue": "CAUTION: sheriff-bot will discard all local changes in \"%s\"\nRunning WebKit sheriff-bot.\n" % os.getcwd(),
+            "next_work_item": "",
+            "process_work_item": "MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Mock builder name (Tests)\nMOCK bug comment: bug_id=42, cc=['webkit-bot-watchers@googlegroups.com', 'abarth@webkit.org', 'eric@webkit.org']\n--- Begin comment ---\\http://trac.webkit.org/changeset/29837 might have broken Mock builder name (Tests)\n--- End comment ---\n\n",
+            "handle_unexpected_error": "Mock error message\n"
+        }
+        self.assert_queue_outputs(SheriffBot(), work_item=mock_work_item, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py b/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py
new file mode 100644
index 0000000..c6de79f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py
@@ -0,0 +1,76 @@
+# Copyright (C) 2009 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.
+
+import webkitpy.tool.steps as steps
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
+from webkitpy.tool.bot.queueengine import QueueEngine
+from webkitpy.common.system.deprecated_logging import log
+
+
+class StepSequenceErrorHandler():
+    @classmethod
+    def handle_script_error(cls, tool, patch, script_error):
+        raise NotImplementedError, "subclasses must implement"
+
+
+class StepSequence(object):
+    def __init__(self, steps):
+        self._steps = steps or []
+
+    def options(self):
+        collected_options = [
+            steps.Options.parent_command,
+            steps.Options.quiet,
+        ]
+        for step in self._steps:
+            collected_options = collected_options + step.options()
+        # Remove duplicates.
+        collected_options = sorted(set(collected_options))
+        return collected_options
+
+    def _run(self, tool, options, state):
+        for step in self._steps:
+            step(tool, options).run(state)
+
+    def run_and_handle_errors(self, tool, options, state=None):
+        if not state:
+            state = {}
+        try:
+            self._run(tool, options, state)
+        except CheckoutNeedsUpdate, e:
+            log("Commit failed because the checkout is out of date.  Please update and try again.")
+            QueueEngine.exit_after_handled_error(e)
+        except ScriptError, e:
+            if not options.quiet:
+                log(e.message_with_output())
+            if options.parent_command:
+                command = tool.command_by_name(options.parent_command)
+                command.handle_script_error(tool, state, e)
+            QueueEngine.exit_after_handled_error(e)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
new file mode 100644
index 0000000..bdf060a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
@@ -0,0 +1,451 @@
+#!/usr/bin/env python
+# Copyright (c) 2009, 2010 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+
+import os
+import re
+import StringIO
+import sys
+
+from optparse import make_option
+
+import webkitpy.tool.steps as steps
+
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.user import User
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+from webkitpy.tool.grammar import pluralize, join_with_separators
+from webkitpy.tool.comments import bug_comment_from_svn_revision
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import error, log
+
+class CommitMessageForCurrentDiff(AbstractDeclarativeCommand):
+    name = "commit-message"
+    help_text = "Print a commit message suitable for the uncommitted changes"
+
+    def execute(self, options, args, tool):
+        # This command is a useful test to make sure commit_message_for_this_commit
+        # always returns the right value regardless of the current working directory.
+        print "%s" % tool.checkout().commit_message_for_this_commit().message()
+
+class CleanPendingCommit(AbstractDeclarativeCommand):
+    name = "clean-pending-commit"
+    help_text = "Clear r+ on obsolete patches so they do not appear in the pending-commit list."
+
+    # NOTE: This was designed to be generic, but right now we're only processing patches from the pending-commit list, so only r+ matters.
+    def _flags_to_clear_on_patch(self, patch):
+        if not patch.is_obsolete():
+            return None
+        what_was_cleared = []
+        if patch.review() == "+":
+            if patch.reviewer():
+                what_was_cleared.append("%s's review+" % patch.reviewer().full_name)
+            else:
+                what_was_cleared.append("review+")
+        return join_with_separators(what_was_cleared)
+
+    def execute(self, options, args, tool):
+        committers = CommitterList()
+        for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
+            bug = self.tool.bugs.fetch_bug(bug_id)
+            patches = bug.patches(include_obsolete=True)
+            for patch in patches:
+                flags_to_clear = self._flags_to_clear_on_patch(patch)
+                if not flags_to_clear:
+                    continue
+                message = "Cleared %s from obsolete attachment %s so that this bug does not appear in http://webkit.org/pending-commit." % (flags_to_clear, patch.id())
+                self.tool.bugs.obsolete_attachment(patch.id(), message)
+
+
+class AssignToCommitter(AbstractDeclarativeCommand):
+    name = "assign-to-committer"
+    help_text = "Assign bug to whoever attached the most recent r+'d patch"
+
+    def _patches_have_commiters(self, reviewed_patches):
+        for patch in reviewed_patches:
+            if not patch.committer():
+                return False
+        return True
+
+    def _assign_bug_to_last_patch_attacher(self, bug_id):
+        committers = CommitterList()
+        bug = self.tool.bugs.fetch_bug(bug_id)
+        if not bug.is_unassigned():
+            assigned_to_email = bug.assigned_to_email()
+            log("Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
+            return
+
+        reviewed_patches = bug.reviewed_patches()
+        if not reviewed_patches:
+            log("Bug %s has no non-obsolete patches, ignoring." % bug_id)
+            return
+
+        # We only need to do anything with this bug if one of the r+'d patches does not have a valid committer (cq+ set).
+        if self._patches_have_commiters(reviewed_patches):
+            log("All reviewed patches on bug %s already have commit-queue+, ignoring." % bug_id)
+            return
+
+        latest_patch = reviewed_patches[-1]
+        attacher_email = latest_patch.attacher_email()
+        committer = committers.committer_by_email(attacher_email)
+        if not committer:
+            log("Attacher %s is not a committer.  Bug %s likely needs commit-queue+." % (attacher_email, bug_id))
+            return
+
+        reassign_message = "Attachment %s was posted by a committer and has review+, assigning to %s for commit." % (latest_patch.id(), committer.full_name)
+        self.tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
+
+    def execute(self, options, args, tool):
+        for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
+            self._assign_bug_to_last_patch_attacher(bug_id)
+
+
+class ObsoleteAttachments(AbstractSequencedCommand):
+    name = "obsolete-attachments"
+    help_text = "Mark all attachments on a bug as obsolete"
+    argument_names = "BUGID"
+    steps = [
+        steps.ObsoletePatches,
+    ]
+
+    def _prepare_state(self, options, args, tool):
+        return { "bug_id" : args[0] }
+
+
+class AbstractPatchUploadingCommand(AbstractSequencedCommand):
+    def _bug_id(self, args, tool, state):
+        # Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs).
+        bug_id = args and args[0]
+        if not bug_id:
+            bug_id = tool.checkout().bug_id_for_this_commit()
+        return bug_id
+
+    def _prepare_state(self, options, args, tool):
+        state = {}
+        state["bug_id"] = self._bug_id(args, tool, state)
+        if not state["bug_id"]:
+            error("No bug id passed and no bug url found in ChangeLogs.")
+        return state
+
+
+class Post(AbstractPatchUploadingCommand):
+    name = "post"
+    help_text = "Attach the current working directory diff to a bug as a patch file"
+    argument_names = "[BUGID]"
+    show_in_main_help = True
+    steps = [
+        steps.CheckStyle,
+        steps.ConfirmDiff,
+        steps.PostCodeReview,
+        steps.ObsoletePatches,
+        steps.PostDiff,
+    ]
+
+
+class LandSafely(AbstractPatchUploadingCommand):
+    name = "land-safely"
+    help_text = "Land the current diff via the commit-queue (Experimental)"
+    argument_names = "[BUGID]"
+    steps = [
+        steps.UpdateChangeLogsWithReviewer,
+        steps.ObsoletePatches,
+        steps.PostDiffForCommit,
+    ]
+
+
+class Prepare(AbstractSequencedCommand):
+    name = "prepare"
+    help_text = "Creates a bug (or prompts for an existing bug) and prepares the ChangeLogs"
+    argument_names = "[BUGID]"
+    show_in_main_help = True
+    steps = [
+        steps.PromptForBugOrTitle,
+        steps.CreateBug,
+        steps.PrepareChangeLog,
+    ]
+
+    def _prepare_state(self, options, args, tool):
+        bug_id = args and args[0]
+        return { "bug_id" : bug_id }
+
+
+class Upload(AbstractPatchUploadingCommand):
+    name = "upload"
+    help_text = "Automates the process of uploading a patch for review"
+    argument_names = "[BUGID]"
+    show_in_main_help = True
+    steps = [
+        steps.CheckStyle,
+        steps.PromptForBugOrTitle,
+        steps.CreateBug,
+        steps.PrepareChangeLog,
+        steps.EditChangeLog,
+        steps.ConfirmDiff,
+        steps.PostCodeReview,
+        steps.ObsoletePatches,
+        steps.PostDiff,
+    ]
+    long_help = """upload uploads the current diff to bugs.webkit.org.
+    If no bug id is provided, upload will create a bug.
+    If the current diff does not have a ChangeLog, upload
+    will prepare a ChangeLog.  Once a patch is read, upload
+    will open the ChangeLogs for editing using the command in the
+    EDITOR environment variable and will display the diff using the
+    command in the PAGER environment variable."""
+
+    def _prepare_state(self, options, args, tool):
+        state = {}
+        state["bug_id"] = self._bug_id(args, tool, state)
+        return state
+
+
+class EditChangeLogs(AbstractSequencedCommand):
+    name = "edit-changelogs"
+    help_text = "Opens modified ChangeLogs in $EDITOR"
+    show_in_main_help = True
+    steps = [
+        steps.EditChangeLog,
+    ]
+
+
+class PostCommits(AbstractDeclarativeCommand):
+    name = "post-commits"
+    help_text = "Attach a range of local commits to bugs as patch files"
+    argument_names = "COMMITISH"
+
+    def __init__(self):
+        options = [
+            make_option("-b", "--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
+            make_option("--add-log-as-comment", action="store_true", dest="add_log_as_comment", default=False, help="Add commit log message as a comment when uploading the patch."),
+            make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: description from commit message)"),
+            steps.Options.obsolete_patches,
+            steps.Options.review,
+            steps.Options.request_commit,
+        ]
+        AbstractDeclarativeCommand.__init__(self, options=options, requires_local_commits=True)
+
+    def _comment_text_for_commit(self, options, commit_message, tool, commit_id):
+        comment_text = None
+        if (options.add_log_as_comment):
+            comment_text = commit_message.body(lstrip=True)
+            comment_text += "---\n"
+            comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
+        return comment_text
+
+    def _diff_file_for_commit(self, tool, commit_id):
+        diff = tool.scm().create_patch_from_local_commit(commit_id)
+        return StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
+
+    def execute(self, options, args, tool):
+        commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
+        if len(commit_ids) > 10: # We could lower this limit, 10 is too many for one bug as-is.
+            error("webkit-patch does not support attaching %s at once.  Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
+
+        have_obsoleted_patches = set()
+        for commit_id in commit_ids:
+            commit_message = tool.scm().commit_message_for_local_commit(commit_id)
+
+            # Prefer --bug-id=, then a bug url in the commit message, then a bug url in the entire commit diff (i.e. ChangeLogs).
+            bug_id = options.bug_id or parse_bug_id(commit_message.message()) or parse_bug_id(tool.scm().create_patch_from_local_commit(commit_id))
+            if not bug_id:
+                log("Skipping %s: No bug id found in commit or specified with --bug-id." % commit_id)
+                continue
+
+            if options.obsolete_patches and bug_id not in have_obsoleted_patches:
+                state = { "bug_id": bug_id }
+                steps.ObsoletePatches(tool, options).run(state)
+                have_obsoleted_patches.add(bug_id)
+
+            diff_file = self._diff_file_for_commit(tool, commit_id)
+            description = options.description or commit_message.description(lstrip=True, strip_url=True)
+            comment_text = self._comment_text_for_commit(options, commit_message, tool, commit_id)
+            tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+
+
+# FIXME: This command needs to be brought into the modern age with steps and CommitInfo.
+class MarkBugFixed(AbstractDeclarativeCommand):
+    name = "mark-bug-fixed"
+    help_text = "Mark the specified bug as fixed"
+    argument_names = "[SVN_REVISION]"
+    def __init__(self):
+        options = [
+            make_option("--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
+            make_option("--comment", action="store", type="string", dest="comment", help="Text to include in bug comment."),
+            make_option("--open", action="store_true", default=False, dest="open_bug", help="Open bug in default web browser (Mac only)."),
+            make_option("--update-only", action="store_true", default=False, dest="update_only", help="Add comment to the bug, but do not close it."),
+        ]
+        AbstractDeclarativeCommand.__init__(self, options=options)
+
+    # FIXME: We should be using checkout().changelog_entries_for_revision(...) instead here.
+    def _fetch_commit_log(self, tool, svn_revision):
+        if not svn_revision:
+            return tool.scm().last_svn_commit_log()
+        return tool.scm().svn_commit_log(svn_revision)
+
+    def _determine_bug_id_and_svn_revision(self, tool, bug_id, svn_revision):
+        commit_log = self._fetch_commit_log(tool, svn_revision)
+
+        if not bug_id:
+            bug_id = parse_bug_id(commit_log)
+
+        if not svn_revision:
+            match = re.search("^r(?P<svn_revision>\d+) \|", commit_log, re.MULTILINE)
+            if match:
+                svn_revision = match.group('svn_revision')
+
+        if not bug_id or not svn_revision:
+            not_found = []
+            if not bug_id:
+                not_found.append("bug id")
+            if not svn_revision:
+                not_found.append("svn revision")
+            error("Could not find %s on command-line or in %s."
+                  % (" or ".join(not_found), "r%s" % svn_revision if svn_revision else "last commit"))
+
+        return (bug_id, svn_revision)
+
+    def execute(self, options, args, tool):
+        bug_id = options.bug_id
+
+        svn_revision = args and args[0]
+        if svn_revision:
+            if re.match("^r[0-9]+$", svn_revision, re.IGNORECASE):
+                svn_revision = svn_revision[1:]
+            if not re.match("^[0-9]+$", svn_revision):
+                error("Invalid svn revision: '%s'" % svn_revision)
+
+        needs_prompt = False
+        if not bug_id or not svn_revision:
+            needs_prompt = True
+            (bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(tool, bug_id, svn_revision)
+
+        log("Bug: <%s> %s" % (tool.bugs.bug_url_for_bug_id(bug_id), tool.bugs.fetch_bug_dictionary(bug_id)["title"]))
+        log("Revision: %s" % svn_revision)
+
+        if options.open_bug:
+            tool.user.open_url(tool.bugs.bug_url_for_bug_id(bug_id))
+
+        if needs_prompt:
+            if not tool.user.confirm("Is this correct?"):
+                exit(1)
+
+        bug_comment = bug_comment_from_svn_revision(svn_revision)
+        if options.comment:
+            bug_comment = "%s\n\n%s" % (options.comment, bug_comment)
+
+        if options.update_only:
+            log("Adding comment to Bug %s." % bug_id)
+            tool.bugs.post_comment_to_bug(bug_id, bug_comment)
+        else:
+            log("Adding comment to Bug %s and marking as Resolved/Fixed." % bug_id)
+            tool.bugs.close_bug_as_fixed(bug_id, bug_comment)
+
+
+# FIXME: Requires unit test.  Blocking issue: too complex for now.
+class CreateBug(AbstractDeclarativeCommand):
+    name = "create-bug"
+    help_text = "Create a bug from local changes or local commits"
+    argument_names = "[COMMITISH]"
+
+    def __init__(self):
+        options = [
+            steps.Options.cc,
+            steps.Options.component,
+            make_option("--no-prompt", action="store_false", dest="prompt", default=True, help="Do not prompt for bug title and comment; use commit log instead."),
+            make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review."),
+            make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."),
+        ]
+        AbstractDeclarativeCommand.__init__(self, options=options)
+
+    def create_bug_from_commit(self, options, args, tool):
+        commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
+        if len(commit_ids) > 3:
+            error("Are you sure you want to create one bug with %s patches?" % len(commit_ids))
+
+        commit_id = commit_ids[0]
+
+        bug_title = ""
+        comment_text = ""
+        if options.prompt:
+            (bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
+        else:
+            commit_message = tool.scm().commit_message_for_local_commit(commit_id)
+            bug_title = commit_message.description(lstrip=True, strip_url=True)
+            comment_text = commit_message.body(lstrip=True)
+            comment_text += "---\n"
+            comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
+
+        diff = tool.scm().create_patch_from_local_commit(commit_id)
+        diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
+        bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+
+        if bug_id and len(commit_ids) > 1:
+            options.bug_id = bug_id
+            options.obsolete_patches = False
+            # FIXME: We should pass through --no-comment switch as well.
+            PostCommits.execute(self, options, commit_ids[1:], tool)
+
+    def create_bug_from_patch(self, options, args, tool):
+        bug_title = ""
+        comment_text = ""
+        if options.prompt:
+            (bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
+        else:
+            commit_message = tool.checkout().commit_message_for_this_commit()
+            bug_title = commit_message.description(lstrip=True, strip_url=True)
+            comment_text = commit_message.body(lstrip=True)
+
+        diff = tool.scm().create_patch()
+        diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
+        bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+
+    def prompt_for_bug_title_and_comment(self):
+        bug_title = User.prompt("Bug title: ")
+        print "Bug comment (hit ^D on blank line to end):"
+        lines = sys.stdin.readlines()
+        try:
+            sys.stdin.seek(0, os.SEEK_END)
+        except IOError:
+            # Cygwin raises an Illegal Seek (errno 29) exception when the above
+            # seek() call is made. Ignoring it seems to cause no harm.
+            # FIXME: Figure out a way to get avoid the exception in the first
+            # place.
+            pass
+        comment_text = "".join(lines)
+        return (bug_title, comment_text)
+
+    def execute(self, options, args, tool):
+        if len(args):
+            if (not tool.scm().supports_local_commits()):
+                error("Extra arguments not supported; patch is taken from working directory.")
+            self.create_bug_from_commit(options, args, tool)
+        else:
+            self.create_bug_from_patch(options, args, tool)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
new file mode 100644
index 0000000..271df01
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
@@ -0,0 +1,111 @@
+# Copyright (C) 2009 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.
+
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.upload import *
+from webkitpy.tool.mocktool import MockTool
+
+class UploadCommandsTest(CommandsTest):
+    def test_commit_message_for_current_diff(self):
+        tool = MockTool()
+        mock_commit_message_for_this_commit = Mock()
+        mock_commit_message_for_this_commit.message = lambda: "Mock message"
+        tool._checkout.commit_message_for_this_commit = lambda: mock_commit_message_for_this_commit
+        expected_stdout = "Mock message\n"
+        self.assert_execute_outputs(CommitMessageForCurrentDiff(), [], expected_stdout=expected_stdout, tool=tool)
+
+    def test_clean_pending_commit(self):
+        self.assert_execute_outputs(CleanPendingCommit(), [])
+
+    def test_assign_to_committer(self):
+        tool = MockTool()
+        expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nBug 77 is already assigned to foo@foo.com (None).\nBug 76 has no non-obsolete patches, ignoring.\n"
+        self.assert_execute_outputs(AssignToCommitter(), [], expected_stderr=expected_stderr, tool=tool)
+        tool.bugs.reassign_bug.assert_called_with(42, "eric@webkit.org", "Attachment 128 was posted by a committer and has review+, assigning to Eric Seidel for commit.")
+
+    def test_obsolete_attachments(self):
+        expected_stderr = "Obsoleting 2 old patches on bug 42\n"
+        self.assert_execute_outputs(ObsoleteAttachments(), [42], expected_stderr=expected_stderr)
+
+    def test_post(self):
+        options = Mock()
+        options.description = "MOCK description"
+        options.request_commit = False
+        options.review = True
+        options.cc = None
+        expected_stderr = """Running check-webkit-style
+MOCK: user.open_url: file://...
+Obsoleting 2 old patches on bug 42
+MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
+-- Begin comment --
+None
+-- End comment --
+MOCK: user.open_url: http://example.com/42
+"""
+        self.assert_execute_outputs(Post(), [42], options=options, expected_stderr=expected_stderr)
+
+    def test_land_safely(self):
+        expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n-- Begin comment --\nNone\n-- End comment --\n"
+        self.assert_execute_outputs(LandSafely(), [42], expected_stderr=expected_stderr)
+
+    def test_prepare_diff_with_arg(self):
+        self.assert_execute_outputs(Prepare(), [42])
+
+    def test_prepare(self):
+        expected_stderr = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\n"
+        self.assert_execute_outputs(Prepare(), [], expected_stderr=expected_stderr)
+
+    def test_upload(self):
+        options = Mock()
+        options.description = "MOCK description"
+        options.request_commit = False
+        options.review = True
+        options.cc = None
+        expected_stderr = """Running check-webkit-style
+MOCK: user.open_url: file://...
+Obsoleting 2 old patches on bug 42
+MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
+-- Begin comment --
+None
+-- End comment --
+MOCK: user.open_url: http://example.com/42
+"""
+        self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
+
+    def test_mark_bug_fixed(self):
+        tool = MockTool()
+        tool._scm.last_svn_commit_log = lambda: "r9876 |"
+        options = Mock()
+        options.bug_id = 42
+        options.comment = "MOCK comment"
+        expected_stderr = "Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.\nRevision: 9876\nMOCK: user.open_url: http://example.com/42\nAdding comment to Bug 42.\nMOCK bug comment: bug_id=42, cc=None\n--- Begin comment ---\\MOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- End comment ---\n\n"
+        self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
+
+    def test_edit_changelog(self):
+        self.assert_execute_outputs(EditChangeLogs(), [])
diff --git a/WebKitTools/Scripts/webkitpy/tool/comments.py b/WebKitTools/Scripts/webkitpy/tool/comments.py
new file mode 100755
index 0000000..83f2be8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/comments.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+#     * 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.
+#
+# A tool for automating dealing with bugzilla, posting patches, committing
+# patches, etc.
+
+from webkitpy.common.checkout.changelog import view_source_url
+
+
+def bug_comment_from_svn_revision(svn_revision):
+    return "Committed r%s: <%s>" % (svn_revision,
+                                    view_source_url(svn_revision))
+
+
+def bug_comment_from_commit_text(scm, commit_text):
+    svn_revision = scm.svn_revision_from_commit_text(commit_text)
+    return bug_comment_from_svn_revision(svn_revision)
diff --git a/WebKitTools/Scripts/webkitpy/tool/grammar.py b/WebKitTools/Scripts/webkitpy/tool/grammar.py
new file mode 100644
index 0000000..8db9826
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/grammar.py
@@ -0,0 +1,54 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+#     * 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.
+
+import re
+
+
+def plural(noun):
+    # This is a dumb plural() implementation that is just enough for our uses.
+    if re.search("h$", noun):
+        return noun + "es"
+    else:
+        return noun + "s"
+
+
+def pluralize(noun, count):
+    if count != 1:
+        noun = plural(noun)
+    return "%d %s" % (count, noun)
+
+
+def join_with_separators(list_of_strings, separator=', ', only_two_separator=" and ", last_separator=', and '):
+    if not list_of_strings:
+        return ""
+    if len(list_of_strings) == 1:
+        return list_of_strings[0]
+    if len(list_of_strings) == 2:
+        return only_two_separator.join(list_of_strings)
+    return "%s%s%s" % (separator.join(list_of_strings[:-1]), last_separator, list_of_strings[-1])
diff --git a/WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py b/WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py
new file mode 100644
index 0000000..cab71db
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py
@@ -0,0 +1,41 @@
+# 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.
+
+import unittest
+
+from webkitpy.tool.grammar import join_with_separators
+
+class GrammarTest(unittest.TestCase):
+
+    def test_join_with_separators(self):
+        self.assertEqual(join_with_separators(["one"]), "one")
+        self.assertEqual(join_with_separators(["one", "two"]), "one and two")
+        self.assertEqual(join_with_separators(["one", "two", "three"]), "one, two, and three")
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
new file mode 100755
index 0000000..06cde74
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -0,0 +1,139 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+#     * 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.
+#
+# A tool for automating dealing with bugzilla, posting patches, committing patches, etc.
+
+import os
+import threading
+
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.scm import detect_scm_system
+from webkitpy.common.net.bugzilla import Bugzilla
+from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.net.rietveld import Rietveld
+from webkitpy.common.net.irc.ircproxy import IRCProxy
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.user import User
+import webkitpy.tool.commands as commands
+# FIXME: Remove these imports once all the commands are in the root of the
+# command package.
+from webkitpy.tool.commands.download import *
+from webkitpy.tool.commands.earlywarningsystem import *
+from webkitpy.tool.commands.openbugs import OpenBugs
+from webkitpy.tool.commands.queries import *
+from webkitpy.tool.commands.queues import *
+from webkitpy.tool.commands.sheriffbot import *
+from webkitpy.tool.commands.upload import *
+from webkitpy.tool.multicommandtool import MultiCommandTool
+from webkitpy.common.system.deprecated_logging import log
+
+
+class WebKitPatch(MultiCommandTool):
+    global_options = [
+        make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
+        make_option("--status-host", action="store", dest="status_host", type="string", nargs=1, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
+        make_option("--irc-password", action="store", dest="irc_password", type="string", nargs=1, help="Password to use when communicating via IRC."),
+    ]
+
+    def __init__(self, path):
+        MultiCommandTool.__init__(self)
+
+        self._path = path
+        self.wakeup_event = threading.Event()
+        self.bugs = Bugzilla()
+        self.buildbot = BuildBot()
+        self.executive = Executive()
+        self._irc = None
+        self.user = User()
+        self._scm = None
+        self._checkout = None
+        self.status_server = StatusServer()
+        self.codereview = Rietveld(self.executive)
+
+    def scm(self):
+        # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
+        original_cwd = os.path.abspath(".")
+        if not self._scm:
+            self._scm = detect_scm_system(original_cwd)
+
+        if not self._scm:
+            script_directory = os.path.abspath(sys.path[0])
+            self._scm = detect_scm_system(script_directory)
+            if self._scm:
+                log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, self._scm.checkout_root))
+            else:
+                error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, script_directory))
+
+        return self._scm
+
+    def checkout(self):
+        if not self._checkout:
+            self._checkout = Checkout(self.scm())
+        return self._checkout
+
+    def ensure_irc_connected(self, irc_delegate):
+        if not self._irc:
+            self._irc = IRCProxy(irc_delegate)
+
+    def irc(self):
+        # We don't automatically construct IRCProxy here because constructing
+        # IRCProxy actually connects to IRC.  We want clients to explicitly
+        # connect to IRC.
+        return self._irc
+
+    def path(self):
+        return self._path
+
+    def command_completed(self):
+        if self._irc:
+            self._irc.disconnect()
+
+    def should_show_in_main_help(self, command):
+        if not command.show_in_main_help:
+            return False
+        if command.requires_local_commits:
+            return self.scm().supports_local_commits()
+        return True
+
+    # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
+    def handle_global_options(self, options):
+        if options.dry_run:
+            self.scm().dryrun = True
+            self.bugs.dryrun = True
+            self.codereview.dryrun = True
+        if options.status_host:
+            self.status_server.set_host(options.status_host)
+        if options.irc_password:
+            self.irc_password = options.irc_password
+
+    def should_execute_command(self, command):
+        if command.requires_local_commits and not self.scm().supports_local_commits():
+            failure_reason = "%s requires local commits using %s in %s." % (command.name, self.scm().display_name(), self.scm().checkout_root)
+            return (False, failure_reason)
+        return (True, None)
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
new file mode 100644
index 0000000..cc361ff
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -0,0 +1,545 @@
+# Copyright (C) 2009 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.
+
+import os
+import threading
+
+from webkitpy.common.config.committers import CommitterList, Reviewer
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.checkout.scm import CommitMessage
+from webkitpy.common.net.bugzilla import Bug, Attachment
+from webkitpy.common.net.rietveld import Rietveld
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.common.system.deprecated_logging import log
+
+
+def _id_to_object_dictionary(*objects):
+    dictionary = {}
+    for thing in objects:
+        dictionary[thing["id"]] = thing
+    return dictionary
+
+# Testing
+
+# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
+
+
+_patch1 = {
+    "id": 197,
+    "bug_id": 42,
+    "url": "http://example.com/197",
+    "name": "Patch1",
+    "is_obsolete": False,
+    "is_patch": True,
+    "review": "+",
+    "reviewer_email": "foo@bar.com",
+    "commit-queue": "+",
+    "committer_email": "foo@bar.com",
+    "attacher_email": "Contributer1",
+}
+
+
+_patch2 = {
+    "id": 128,
+    "bug_id": 42,
+    "url": "http://example.com/128",
+    "name": "Patch2",
+    "is_obsolete": False,
+    "is_patch": True,
+    "review": "+",
+    "reviewer_email": "foo@bar.com",
+    "commit-queue": "+",
+    "committer_email": "non-committer@example.com",
+    "attacher_email": "eric@webkit.org",
+}
+
+
+_patch3 = {
+    "id": 103,
+    "bug_id": 75,
+    "url": "http://example.com/103",
+    "name": "Patch3",
+    "is_obsolete": False,
+    "is_patch": True,
+    "review": "?",
+    "attacher_email": "eric@webkit.org",
+}
+
+
+_patch4 = {
+    "id": 104,
+    "bug_id": 77,
+    "url": "http://example.com/103",
+    "name": "Patch3",
+    "is_obsolete": False,
+    "is_patch": True,
+    "review": "+",
+    "commit-queue": "?",
+    "reviewer_email": "foo@bar.com",
+    "attacher_email": "Contributer2",
+}
+
+
+_patch5 = {
+    "id": 105,
+    "bug_id": 77,
+    "url": "http://example.com/103",
+    "name": "Patch5",
+    "is_obsolete": False,
+    "is_patch": True,
+    "review": "+",
+    "reviewer_email": "foo@bar.com",
+    "attacher_email": "eric@webkit.org",
+}
+
+
+_patch6 = { # Valid committer, but no reviewer.
+    "id": 106,
+    "bug_id": 77,
+    "url": "http://example.com/103",
+    "name": "ROLLOUT of r3489",
+    "is_obsolete": False,
+    "is_patch": True,
+    "commit-queue": "+",
+    "committer_email": "foo@bar.com",
+    "attacher_email": "eric@webkit.org",
+}
+
+
+_patch7 = { # Valid review, patch is marked obsolete.
+    "id": 107,
+    "bug_id": 76,
+    "url": "http://example.com/103",
+    "name": "Patch7",
+    "is_obsolete": True,
+    "is_patch": True,
+    "review": "+",
+    "reviewer_email": "foo@bar.com",
+    "attacher_email": "eric@webkit.org",
+}
+
+
+# This matches one of Bug.unassigned_emails
+_unassigned_email = "webkit-unassigned@lists.webkit.org"
+
+
+# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
+
+
+_bug1 = {
+    "id": 42,
+    "title": "Bug with two r+'d and cq+'d patches, one of which has an "
+             "invalid commit-queue setter.",
+    "assigned_to_email": _unassigned_email,
+    "attachments": [_patch1, _patch2],
+}
+
+
+_bug2 = {
+    "id": 75,
+    "title": "Bug with a patch needing review.",
+    "assigned_to_email": "foo@foo.com",
+    "attachments": [_patch3],
+}
+
+
+_bug3 = {
+    "id": 76,
+    "title": "The third bug",
+    "assigned_to_email": _unassigned_email,
+    "attachments": [_patch7],
+}
+
+
+_bug4 = {
+    "id": 77,
+    "title": "The fourth bug",
+    "assigned_to_email": "foo@foo.com",
+    "attachments": [_patch4, _patch5, _patch6],
+}
+
+
+class MockBuilder(object):
+
+    def name(self):
+        return "Mock builder name (Tests)"
+
+
+mock_builder = MockBuilder()
+
+
+class MockBugzillaQueries(Mock):
+
+    def __init__(self, bugzilla):
+        Mock.__init__(self)
+        self._bugzilla = bugzilla
+
+    def _all_bugs(self):
+        return map(lambda bug_dictionary: Bug(bug_dictionary, self._bugzilla),
+                   self._bugzilla.bug_cache.values())
+
+    def fetch_bug_ids_from_commit_queue(self):
+        bugs_with_commit_queued_patches = filter(
+                lambda bug: bug.commit_queued_patches(),
+                self._all_bugs())
+        return map(lambda bug: bug.id(), bugs_with_commit_queued_patches)
+
+    def fetch_attachment_ids_from_review_queue(self):
+        unreviewed_patches = sum([bug.unreviewed_patches()
+                                  for bug in self._all_bugs()], [])
+        return map(lambda patch: patch.id(), unreviewed_patches)
+
+    def fetch_patches_from_commit_queue(self):
+        return sum([bug.commit_queued_patches()
+                    for bug in self._all_bugs()], [])
+
+    def fetch_bug_ids_from_pending_commit_list(self):
+        bugs_with_reviewed_patches = filter(lambda bug: bug.reviewed_patches(),
+                                            self._all_bugs())
+        bug_ids = map(lambda bug: bug.id(), bugs_with_reviewed_patches)
+        # NOTE: This manual hack here is to allow testing logging in
+        # test_assign_to_committer the real pending-commit query on bugzilla
+        # will return bugs with patches which have r+, but are also obsolete.
+        return bug_ids + [76]
+
+    def fetch_patches_from_pending_commit_list(self):
+        return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
+
+
+# FIXME: Bugzilla is the wrong Mock-point.  Once we have a BugzillaNetwork
+#        class we should mock that instead.
+# Most of this class is just copy/paste from Bugzilla.
+
+
+class MockBugzilla(Mock):
+
+    bug_server_url = "http://example.com"
+
+    bug_cache = _id_to_object_dictionary(_bug1, _bug2, _bug3, _bug4)
+
+    attachment_cache = _id_to_object_dictionary(_patch1,
+                                                _patch2,
+                                                _patch3,
+                                                _patch4,
+                                                _patch5,
+                                                _patch6,
+                                                _patch7)
+
+    def __init__(self):
+        Mock.__init__(self)
+        self.queries = MockBugzillaQueries(self)
+        self.committers = CommitterList(reviewers=[Reviewer("Foo Bar",
+                                                            "foo@bar.com")])
+
+    def create_bug(self,
+                   bug_title,
+                   bug_description,
+                   component=None,
+                   patch_file_object=None,
+                   patch_description=None,
+                   cc=None,
+                   blocked=None,
+                   mark_for_review=False,
+                   mark_for_commit_queue=False):
+        log("MOCK create_bug")
+        log("bug_title: %s" % bug_title)
+        log("bug_description: %s" % bug_description)
+
+    def quips(self):
+        return ["Good artists copy. Great artists steal. - Pablo Picasso"]
+
+    def fetch_bug(self, bug_id):
+        return Bug(self.bug_cache.get(bug_id), self)
+
+    def fetch_attachment(self, attachment_id):
+        # This could be changed to .get() if we wish to allow failed lookups.
+        attachment_dictionary = self.attachment_cache[attachment_id]
+        bug = self.fetch_bug(attachment_dictionary["bug_id"])
+        for attachment in bug.attachments(include_obsolete=True):
+            if attachment.id() == int(attachment_id):
+                return attachment
+
+    def bug_url_for_bug_id(self, bug_id):
+        return "%s/%s" % (self.bug_server_url, bug_id)
+
+    def fetch_bug_dictionary(self, bug_id):
+        return self.bug_cache.get(bug_id)
+
+    def attachment_url_for_id(self, attachment_id, action="view"):
+        action_param = ""
+        if action and action != "view":
+            action_param = "&action=%s" % action
+        return "%s/%s%s" % (self.bug_server_url, attachment_id, action_param)
+
+    def post_comment_to_bug(self, bug_id, comment_text, cc=None):
+        log("MOCK bug comment: bug_id=%s, cc=%s\n--- Begin comment ---\%s\n--- End comment ---\n" % (
+            bug_id, cc, comment_text))
+
+    def add_patch_to_bug(self,
+                         bug_id,
+                         patch_file_object,
+                         description,
+                         comment_text=None,
+                         mark_for_review=False,
+                         mark_for_commit_queue=False,
+                         mark_for_landing=False):
+        log("MOCK add_patch_to_bug: bug_id=%s, description=%s, mark_for_review=%s, mark_for_commit_queue=%s, mark_for_landing=%s" %
+            (bug_id, description, mark_for_review, mark_for_commit_queue, mark_for_landing))
+        log("-- Begin comment --")
+        log(comment_text)
+        log("-- End comment --")
+
+
+class MockBuilder(object):
+    def __init__(self, name):
+        self._name = name
+
+    def force_build(self, username, comments):
+        log("MOCK: force_build: name=%s, username=%s, comments=%s" % (
+            self._name, username, comments))
+
+
+class MockBuildBot(object):
+    def __init__(self):
+        self._mock_builder1_status = {
+            "name": "Builder1",
+            "is_green": True,
+            "activity": "building",
+        }
+        self._mock_builder2_status = {
+            "name": "Builder2",
+            "is_green": True,
+            "activity": "idle",
+        }
+
+    def builder_with_name(self, name):
+        return MockBuilder(name)
+
+    def builder_statuses(self):
+        return [
+            self._mock_builder1_status,
+            self._mock_builder2_status,
+        ]
+
+    def red_core_builders_names(self):
+        if not self._mock_builder2_status["is_green"]:
+            return [self._mock_builder2_status["name"]]
+        return []
+
+    def red_core_builders(self):
+        if not self._mock_builder2_status["is_green"]:
+            return [self._mock_builder2_status]
+        return []
+
+    def idle_red_core_builders(self):
+        if not self._mock_builder2_status["is_green"]:
+            return [self._mock_builder2_status]
+        return []
+
+    def last_green_revision(self):
+        return 9479
+
+    def light_tree_on_fire(self):
+        self._mock_builder2_status["is_green"] = False
+
+    def revisions_causing_failures(self):
+        return {
+            "29837": [mock_builder]
+        }
+
+
+class MockSCM(Mock):
+
+    fake_checkout_root = os.path.realpath("/tmp") # realpath is needed to allow for Mac OS X's /private/tmp
+
+    def __init__(self):
+        Mock.__init__(self)
+        # FIXME: We should probably use real checkout-root detection logic here.
+        # os.getcwd() can't work here because other parts of the code assume that "checkout_root"
+        # will actually be the root.  Since getcwd() is wrong, use a globally fake root for now.
+        self.checkout_root = self.fake_checkout_root
+
+    def create_patch(self):
+        return "Patch1"
+
+    def commit_ids_from_commitish_arguments(self, args):
+        return ["Commitish1", "Commitish2"]
+
+    def commit_message_for_local_commit(self, commit_id):
+        if commit_id == "Commitish1":
+            return CommitMessage("CommitMessage1\n" \
+                "https://bugs.example.org/show_bug.cgi?id=42\n")
+        if commit_id == "Commitish2":
+            return CommitMessage("CommitMessage2\n" \
+                "https://bugs.example.org/show_bug.cgi?id=75\n")
+        raise Exception("Bogus commit_id in commit_message_for_local_commit.")
+
+    def create_patch_from_local_commit(self, commit_id):
+        if commit_id == "Commitish1":
+            return "Patch1"
+        if commit_id == "Commitish2":
+            return "Patch2"
+        raise Exception("Bogus commit_id in commit_message_for_local_commit.")
+
+    def diff_for_revision(self, revision):
+        return "DiffForRevision%s\n" \
+               "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision
+
+    def svn_revision_from_commit_text(self, commit_text):
+        return "49824"
+
+
+class MockCheckout(object):
+
+    _committer_list = CommitterList()
+
+    def commit_info_for_revision(self, svn_revision):
+        return CommitInfo(svn_revision, "eric@webkit.org", {
+            "bug_id": 42,
+            "author_name": "Adam Barth",
+            "author_email": "abarth@webkit.org",
+            "author": self._committer_list.committer_by_email("abarth@webkit.org"),
+            "reviewer_text": "Darin Adler",
+            "reviewer": self._committer_list.committer_by_name("Darin Adler"),
+        })
+
+    def bug_id_for_revision(self, svn_revision):
+        return 12345
+
+    def modified_changelogs(self):
+        # Ideally we'd return something more interesting here.  The problem is
+        # that LandDiff will try to actually read the patch from disk!
+        return []
+
+    def commit_message_for_this_commit(self):
+        commit_message = Mock()
+        commit_message.message = lambda:"This is a fake commit message that is at least 50 characters."
+        return commit_message
+
+    def apply_patch(self, patch, force=False):
+        pass
+
+    def apply_reverse_diff(self, revision):
+        pass
+
+
+class MockUser(object):
+
+    @staticmethod
+    def prompt(message, repeat=1, raw_input=raw_input):
+        return "Mock user response"
+
+    def edit(self, files):
+        pass
+
+    def page(self, message):
+        pass
+
+    def confirm(self, message=None):
+        return True
+
+    def open_url(self, url):
+        if url.startswith("file://"):
+            log("MOCK: user.open_url: file://...")
+            return
+        log("MOCK: user.open_url: %s" % url)
+
+
+class MockIRC(object):
+
+    def post(self, message):
+        log("MOCK: irc.post: %s" % message)
+
+    def disconnect(self):
+        log("MOCK: irc.disconnect")
+
+
+class MockStatusServer(object):
+
+    def __init__(self):
+        self.host = "example.com"
+
+    def patch_status(self, queue_name, patch_id):
+        return None
+
+    def svn_revision(self, svn_revision):
+        return None
+
+    def update_status(self, queue_name, status, patch=None, results_file=None):
+        return 187
+
+    def update_svn_revision(self, svn_revision, broken_bot):
+        return 191
+
+
+class MockExecute(Mock):
+    def run_and_throw_if_fail(self, args, quiet=False):
+        return "MOCK output of child process"
+
+    def run_command(self,
+                    args,
+                    cwd=None,
+                    input=None,
+                    error_handler=None,
+                    return_exit_code=False,
+                    return_stderr=True):
+        return "MOCK output of child process"
+
+
+class MockTool():
+
+    def __init__(self, log_executive=False):
+        self.wakeup_event = threading.Event()
+        self.bugs = MockBugzilla()
+        self.buildbot = MockBuildBot()
+        self.executive = MockExecute()
+        if log_executive:
+            self.executive.run_and_throw_if_fail = lambda args: log("MOCK run_and_throw_if_fail: %s" % args)
+        self._irc = None
+        self.user = MockUser()
+        self._scm = MockSCM()
+        self._checkout = MockCheckout()
+        self.status_server = MockStatusServer()
+        self.irc_password = "MOCK irc password"
+        self.codereview = Rietveld(self.executive)
+
+    def scm(self):
+        return self._scm
+
+    def checkout(self):
+        return self._checkout
+
+    def ensure_irc_connected(self, delegate):
+        if not self._irc:
+            self._irc = MockIRC()
+
+    def irc(self):
+        return self._irc
+
+    def path(self):
+        return "echo"
diff --git a/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
new file mode 100644
index 0000000..7940c06
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
@@ -0,0 +1,304 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+# 
+#     * 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.
+#
+# MultiCommandTool provides a framework for writing svn-like/git-like tools
+# which are called with the following format:
+# tool-name [global options] command-name [command options]
+
+import sys
+
+from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option
+
+from webkitpy.tool.grammar import pluralize
+from webkitpy.common.system.deprecated_logging import log
+
+
+class Command(object):
+    name = None
+    show_in_main_help = False
+    def __init__(self, help_text, argument_names=None, options=None, long_help=None, requires_local_commits=False):
+        self.help_text = help_text
+        self.long_help = long_help
+        self.argument_names = argument_names
+        self.required_arguments = self._parse_required_arguments(argument_names)
+        self.options = options
+        self.requires_local_commits = requires_local_commits
+        self.tool = None
+        # option_parser can be overriden by the tool using set_option_parser
+        # This default parser will be used for standalone_help printing.
+        self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
+
+    # This design is slightly awkward, but we need the
+    # the tool to be able to create and modify the option_parser
+    # before it knows what Command to run.
+    def set_option_parser(self, option_parser):
+        self.option_parser = option_parser
+        self._add_options_to_parser()
+
+    def _add_options_to_parser(self):
+        options = self.options or []
+        for option in options:
+            self.option_parser.add_option(option)
+
+    # The tool calls bind_to_tool on each Command after adding it to its list.
+    def bind_to_tool(self, tool):
+        # Command instances can only be bound to one tool at a time.
+        if self.tool and tool != self.tool:
+            raise Exception("Command already bound to tool!")
+        self.tool = tool
+
+    @staticmethod
+    def _parse_required_arguments(argument_names):
+        required_args = []
+        if not argument_names:
+            return required_args
+        split_args = argument_names.split(" ")
+        for argument in split_args:
+            if argument[0] == '[':
+                # For now our parser is rather dumb.  Do some minimal validation that
+                # we haven't confused it.
+                if argument[-1] != ']':
+                    raise Exception("Failure to parse argument string %s.  Argument %s is missing ending ]" % (argument_names, argument))
+            else:
+                required_args.append(argument)
+        return required_args
+
+    def name_with_arguments(self):
+        usage_string = self.name
+        if self.options:
+            usage_string += " [options]"
+        if self.argument_names:
+            usage_string += " " + self.argument_names
+        return usage_string
+
+    def parse_args(self, args):
+        return self.option_parser.parse_args(args)
+
+    def check_arguments_and_execute(self, options, args, tool=None):
+        if len(args) < len(self.required_arguments):
+            log("%s required, %s provided.  Provided: %s  Required: %s\nSee '%s help %s' for usage." % (
+                pluralize("argument", len(self.required_arguments)),
+                pluralize("argument", len(args)),
+                "'%s'" % " ".join(args),
+                " ".join(self.required_arguments),
+                tool.name(),
+                self.name))
+            return 1
+        return self.execute(options, args, tool) or 0
+
+    def standalone_help(self):
+        help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n\n"
+        if self.long_help:
+            help_text += "%s\n\n" % self.long_help
+        help_text += self.option_parser.format_option_help(IndentedHelpFormatter())
+        return help_text
+
+    def execute(self, options, args, tool):
+        raise NotImplementedError, "subclasses must implement"
+
+    # main() exists so that Commands can be turned into stand-alone scripts.
+    # Other parts of the code will likely require modification to work stand-alone.
+    def main(self, args=sys.argv):
+        (options, args) = self.parse_args(args)
+        # Some commands might require a dummy tool
+        return self.check_arguments_and_execute(options, args)
+
+
+# FIXME: This should just be rolled into Command.  help_text and argument_names do not need to be instance variables.
+class AbstractDeclarativeCommand(Command):
+    help_text = None
+    argument_names = None
+    long_help = None
+    def __init__(self, options=None, **kwargs):
+        Command.__init__(self, self.help_text, self.argument_names, options=options, long_help=self.long_help, **kwargs)
+
+
+class HelpPrintingOptionParser(OptionParser):
+    def __init__(self, epilog_method=None, *args, **kwargs):
+        self.epilog_method = epilog_method
+        OptionParser.__init__(self, *args, **kwargs)
+
+    def error(self, msg):
+        self.print_usage(sys.stderr)
+        error_message = "%s: error: %s\n" % (self.get_prog_name(), msg)
+        # This method is overriden to add this one line to the output:
+        error_message += "\nType \"%s --help\" to see usage.\n" % self.get_prog_name()
+        self.exit(1, error_message)
+
+    # We override format_epilog to avoid the default formatting which would paragraph-wrap the epilog
+    # and also to allow us to compute the epilog lazily instead of in the constructor (allowing it to be context sensitive).
+    def format_epilog(self, epilog):
+        if self.epilog_method:
+            return "\n%s\n" % self.epilog_method()
+        return ""
+
+
+class HelpCommand(AbstractDeclarativeCommand):
+    name = "help"
+    help_text = "Display information about this program or its subcommands"
+    argument_names = "[COMMAND]"
+
+    def __init__(self):
+        options = [
+            make_option("-a", "--all-commands", action="store_true", dest="show_all_commands", help="Print all available commands"),
+        ]
+        AbstractDeclarativeCommand.__init__(self, options)
+        self.show_all_commands = False # A hack used to pass --all-commands to _help_epilog even though it's called by the OptionParser.
+
+    def _help_epilog(self):
+        # Only show commands which are relevant to this checkout's SCM system.  Might this be confusing to some users?
+        if self.show_all_commands:
+            epilog = "All %prog commands:\n"
+            relevant_commands = self.tool.commands[:]
+        else:
+            epilog = "Common %prog commands:\n"
+            relevant_commands = filter(self.tool.should_show_in_main_help, self.tool.commands)
+        longest_name_length = max(map(lambda command: len(command.name), relevant_commands))
+        relevant_commands.sort(lambda a, b: cmp(a.name, b.name))
+        command_help_texts = map(lambda command: "   %s   %s\n" % (command.name.ljust(longest_name_length), command.help_text), relevant_commands)
+        epilog += "%s\n" % "".join(command_help_texts)
+        epilog += "See '%prog help --all-commands' to list all commands.\n"
+        epilog += "See '%prog help COMMAND' for more information on a specific command.\n"
+        return epilog.replace("%prog", self.tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
+
+    # FIXME: This is a hack so that we don't show --all-commands as a global option:
+    def _remove_help_options(self):
+        for option in self.options:
+            self.option_parser.remove_option(option.get_opt_string())
+
+    def execute(self, options, args, tool):
+        if args:
+            command = self.tool.command_by_name(args[0])
+            if command:
+                print command.standalone_help()
+                return 0
+
+        self.show_all_commands = options.show_all_commands
+        self._remove_help_options()
+        self.option_parser.print_help()
+        return 0
+
+
+class MultiCommandTool(object):
+    global_options = None
+
+    def __init__(self, name=None, commands=None):
+        self._name = name or OptionParser(prog=name).get_prog_name() # OptionParser has nice logic for fetching the name.
+        # Allow the unit tests to disable command auto-discovery.
+        self.commands = commands or [cls() for cls in self._find_all_commands() if cls.name]
+        self.help_command = self.command_by_name(HelpCommand.name)
+        # Require a help command, even if the manual test list doesn't include one.
+        if not self.help_command:
+            self.help_command = HelpCommand()
+            self.commands.append(self.help_command)
+        for command in self.commands:
+            command.bind_to_tool(self)
+
+    @classmethod
+    def _add_all_subclasses(cls, class_to_crawl, seen_classes):
+        for subclass in class_to_crawl.__subclasses__():
+            if subclass not in seen_classes:
+                seen_classes.add(subclass)
+                cls._add_all_subclasses(subclass, seen_classes)
+
+    @classmethod
+    def _find_all_commands(cls):
+        commands = set()
+        cls._add_all_subclasses(Command, commands)
+        return sorted(commands)
+
+    def name(self):
+        return self._name
+
+    def _create_option_parser(self):
+        usage = "Usage: %prog [options] COMMAND [ARGS]"
+        return HelpPrintingOptionParser(epilog_method=self.help_command._help_epilog, prog=self.name(), usage=usage)
+
+    @staticmethod
+    def _split_command_name_from_args(args):
+        # Assume the first argument which doesn't start with "-" is the command name.
+        command_index = 0
+        for arg in args:
+            if arg[0] != "-":
+                break
+            command_index += 1
+        else:
+            return (None, args[:])
+
+        command = args[command_index]
+        return (command, args[:command_index] + args[command_index + 1:])
+
+    def command_by_name(self, command_name):
+        for command in self.commands:
+            if command_name == command.name:
+                return command
+        return None
+
+    def path(self):
+        raise NotImplementedError, "subclasses must implement"
+
+    def command_completed(self):
+        pass
+
+    def should_show_in_main_help(self, command):
+        return command.show_in_main_help
+
+    def should_execute_command(self, command):
+        return True
+
+    def _add_global_options(self, option_parser):
+        global_options = self.global_options or []
+        for option in global_options:
+            option_parser.add_option(option)
+
+    def handle_global_options(self, options):
+        pass
+
+    def main(self, argv=sys.argv):
+        (command_name, args) = self._split_command_name_from_args(argv[1:])
+
+        option_parser = self._create_option_parser()
+        self._add_global_options(option_parser)
+
+        command = self.command_by_name(command_name) or self.help_command
+        if not command:
+            option_parser.error("%s is not a recognized command" % command_name)
+
+        command.set_option_parser(option_parser)
+        (options, args) = command.parse_args(args)
+        self.handle_global_options(options)
+
+        (should_execute, failure_reason) = self.should_execute_command(command)
+        if not should_execute:
+            log(failure_reason)
+            return 0 # FIXME: Should this really be 0?
+
+        result = command.check_arguments_and_execute(options, args, self)
+        self.command_completed()
+        return result
diff --git a/WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py b/WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py
new file mode 100644
index 0000000..268ebf0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py
@@ -0,0 +1,155 @@
+# Copyright (c) 2009 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.
+
+import sys
+import unittest
+
+from optparse import make_option
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.multicommandtool import MultiCommandTool, Command
+
+
+class TrivialCommand(Command):
+    name = "trivial"
+    show_in_main_help = True
+    def __init__(self, **kwargs):
+        Command.__init__(self, "help text", **kwargs)
+
+    def execute(self, options, args, tool):
+        pass
+
+class UncommonCommand(TrivialCommand):
+    name = "uncommon"
+    show_in_main_help = False
+
+class CommandTest(unittest.TestCase):
+    def test_name_with_arguments(self):
+        command_with_args = TrivialCommand(argument_names="ARG1 ARG2")
+        self.assertEqual(command_with_args.name_with_arguments(), "trivial ARG1 ARG2")
+
+        command_with_args = TrivialCommand(options=[make_option("--my_option")])
+        self.assertEqual(command_with_args.name_with_arguments(), "trivial [options]")
+
+    def test_parse_required_arguments(self):
+        self.assertEqual(Command._parse_required_arguments("ARG1 ARG2"), ["ARG1", "ARG2"])
+        self.assertEqual(Command._parse_required_arguments("[ARG1] [ARG2]"), [])
+        self.assertEqual(Command._parse_required_arguments("[ARG1] ARG2"), ["ARG2"])
+        # Note: We might make our arg parsing smarter in the future and allow this type of arguments string.
+        self.assertRaises(Exception, Command._parse_required_arguments, "[ARG1 ARG2]")
+
+    def test_required_arguments(self):
+        two_required_arguments = TrivialCommand(argument_names="ARG1 ARG2 [ARG3]")
+        expected_missing_args_error = "2 arguments required, 1 argument provided.  Provided: 'foo'  Required: ARG1 ARG2\nSee 'trivial-tool help trivial' for usage.\n"
+        exit_code = OutputCapture().assert_outputs(self, two_required_arguments.check_arguments_and_execute, [None, ["foo"], TrivialTool()], expected_stderr=expected_missing_args_error)
+        self.assertEqual(exit_code, 1)
+
+
+class TrivialTool(MultiCommandTool):
+    def __init__(self, commands=None):
+        MultiCommandTool.__init__(self, name="trivial-tool", commands=commands)
+
+    def path(self):
+        return __file__
+
+    def should_execute_command(self, command):
+        return (True, None)
+
+
+class MultiCommandToolTest(unittest.TestCase):
+    def _assert_split(self, args, expected_split):
+        self.assertEqual(MultiCommandTool._split_command_name_from_args(args), expected_split)
+
+    def test_split_args(self):
+        # MultiCommandToolTest._split_command_name_from_args returns: (command, args)
+        full_args = ["--global-option", "command", "--option", "arg"]
+        full_args_expected = ("command", ["--global-option", "--option", "arg"])
+        self._assert_split(full_args, full_args_expected)
+
+        full_args = []
+        full_args_expected = (None, [])
+        self._assert_split(full_args, full_args_expected)
+
+        full_args = ["command", "arg"]
+        full_args_expected = ("command", ["arg"])
+        self._assert_split(full_args, full_args_expected)
+
+    def test_command_by_name(self):
+        # This also tests Command auto-discovery.
+        tool = TrivialTool()
+        self.assertEqual(tool.command_by_name("trivial").name, "trivial")
+        self.assertEqual(tool.command_by_name("bar"), None)
+
+    def _assert_tool_main_outputs(self, tool, main_args, expected_stdout, expected_stderr = "", expected_exit_code=0):
+        exit_code = OutputCapture().assert_outputs(self, tool.main, [main_args], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+        self.assertEqual(exit_code, expected_exit_code)
+
+    def test_global_help(self):
+        tool = TrivialTool(commands=[TrivialCommand(), UncommonCommand()])
+        expected_common_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
+
+Options:
+  -h, --help  show this help message and exit
+
+Common trivial-tool commands:
+   trivial   help text
+
+See 'trivial-tool help --all-commands' to list all commands.
+See 'trivial-tool help COMMAND' for more information on a specific command.
+
+"""
+        self._assert_tool_main_outputs(tool, ["tool"], expected_common_commands_help)
+        self._assert_tool_main_outputs(tool, ["tool", "help"], expected_common_commands_help)
+        expected_all_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
+
+Options:
+  -h, --help  show this help message and exit
+
+All trivial-tool commands:
+   help       Display information about this program or its subcommands
+   trivial    help text
+   uncommon   help text
+
+See 'trivial-tool help --all-commands' to list all commands.
+See 'trivial-tool help COMMAND' for more information on a specific command.
+
+"""
+        self._assert_tool_main_outputs(tool, ["tool", "help", "--all-commands"], expected_all_commands_help)
+        # Test that arguments can be passed before commands as well
+        self._assert_tool_main_outputs(tool, ["tool", "--all-commands", "help"], expected_all_commands_help)
+
+
+    def test_command_help(self):
+        command_with_options = TrivialCommand(options=[make_option("--my_option")], long_help="LONG HELP")
+        tool = TrivialTool(commands=[command_with_options])
+        expected_subcommand_help = "trivial [options]   help text\n\nLONG HELP\n\nOptions:\n  --my_option=MY_OPTION\n\n"
+        self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
new file mode 100644
index 0000000..d59cdc5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
@@ -0,0 +1,59 @@
+# 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.
+
+# FIXME: Is this the right way to do this?
+from webkitpy.tool.steps.applypatch import ApplyPatch
+from webkitpy.tool.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
+from webkitpy.tool.steps.build import Build
+from webkitpy.tool.steps.checkstyle import CheckStyle
+from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory
+from webkitpy.tool.steps.cleanworkingdirectorywithlocalcommits import CleanWorkingDirectoryWithLocalCommits
+from webkitpy.tool.steps.closebug import CloseBug
+from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
+from webkitpy.tool.steps.closepatch import ClosePatch
+from webkitpy.tool.steps.commit import Commit
+from webkitpy.tool.steps.confirmdiff import ConfirmDiff
+from webkitpy.tool.steps.createbug import CreateBug
+from webkitpy.tool.steps.editchangelog import EditChangeLog
+from webkitpy.tool.steps.ensurebuildersaregreen import EnsureBuildersAreGreen
+from webkitpy.tool.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
+from webkitpy.tool.steps.obsoletepatches import ObsoletePatches
+from webkitpy.tool.steps.options import Options
+from webkitpy.tool.steps.postcodereview import PostCodeReview
+from webkitpy.tool.steps.postdiff import PostDiff
+from webkitpy.tool.steps.postdiffforcommit import PostDiffForCommit
+from webkitpy.tool.steps.postdiffforrevert import PostDiffForRevert
+from webkitpy.tool.steps.preparechangelogforrevert import PrepareChangeLogForRevert
+from webkitpy.tool.steps.preparechangelog import PrepareChangeLog
+from webkitpy.tool.steps.promptforbugortitle import PromptForBugOrTitle
+from webkitpy.tool.steps.reopenbugafterrollout import ReopenBugAfterRollout
+from webkitpy.tool.steps.revertrevision import RevertRevision
+from webkitpy.tool.steps.runtests import RunTests
+from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
+from webkitpy.tool.steps.update import Update
+from webkitpy.tool.steps.validatereviewer import ValidateReviewer
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
new file mode 100644
index 0000000..1ad343d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
@@ -0,0 +1,69 @@
+# 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.
+
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config.ports import WebKitPort
+
+
+class AbstractStep(object):
+    def __init__(self, tool, options):
+        self._tool = tool
+        self._options = options
+        self._port = None
+
+    def _run_script(self, script_name, quiet=False, port=WebKitPort):
+        log("Running %s" % script_name)
+        # FIXME: This should use self.port()
+        self._tool.executive.run_and_throw_if_fail(port.script_path(script_name), quiet)
+
+    # FIXME: The port should live on the tool.
+    def port(self):
+        if self._port:
+            return self._port
+        self._port = WebKitPort.port(self._options.port)
+        return self._port
+
+    _well_known_keys = {
+        "diff" : lambda self: self._tool.scm().create_patch(),
+        "changelogs" : lambda self: self._tool.checkout().modified_changelogs(),
+    }
+
+    def cached_lookup(self, state, key, promise=None):
+        if state.get(key):
+            return state[key]
+        if not promise:
+            promise = self._well_known_keys.get(key)
+        state[key] = promise(self)
+        return state[key]
+
+    @classmethod
+    def options(cls):
+        return []
+
+    def run(self, state):
+        raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
new file mode 100644
index 0000000..66d0a03
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
@@ -0,0 +1,42 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+class ApplyPatch(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.non_interactive,
+        ]
+
+    def run(self, state):
+        log("Processing patch %s from bug %s." % (state["patch"].id(), state["patch"].bug_id()))
+        self._tool.checkout().apply_patch(state["patch"], force=self._options.non_interactive)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py b/WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py
new file mode 100644
index 0000000..70ddfe5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py
@@ -0,0 +1,43 @@
+# 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.
+
+from webkitpy.tool.steps.applypatch import ApplyPatch
+from webkitpy.tool.steps.options import Options
+
+class ApplyPatchWithLocalCommit(ApplyPatch):
+    @classmethod
+    def options(cls):
+        return [
+            Options.local_commit,
+        ] + ApplyPatch.options()
+
+    def run(self, state):
+        ApplyPatch.run(self, state)
+        if self._options.local_commit:
+            commit_message = self._tool.checkout().commit_message_for_this_commit()
+            self._tool.scm().commit_locally_with_message(commit_message.message() or state["patch"].name())
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/build.py b/WebKitTools/Scripts/webkitpy/tool/steps/build.py
new file mode 100644
index 0000000..f0570f9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/build.py
@@ -0,0 +1,54 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+
+class Build(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.build,
+            Options.quiet,
+            Options.build_style,
+        ]
+
+    def build(self, build_style):
+        self._tool.executive.run_and_throw_if_fail(self.port().build_webkit_command(build_style=build_style), self._options.quiet)
+
+    def run(self, state):
+        if not self._options.build:
+            return
+        log("Building WebKit")
+        if self._options.build_style == "both":
+            self.build("debug")
+            self.build("release")
+        else:
+            self.build(self._options.build_style)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py b/WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py
new file mode 100644
index 0000000..63f0114
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py
@@ -0,0 +1,56 @@
+# 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.
+
+import os
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
+
+class CheckStyle(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.non_interactive,
+            Options.check_style,
+        ]
+
+    def run(self, state):
+        if not self._options.check_style:
+            return
+        os.chdir(self._tool.scm().checkout_root)
+        try:
+            self._run_script("check-webkit-style")
+        except ScriptError, e:
+            if self._options.non_interactive:
+                # We need to re-raise the exception here to have the
+                # style-queue do the right thing.
+                raise e
+            if not self._tool.user.confirm("Are you sure you want to continue?"):
+                exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
new file mode 100644
index 0000000..3768297
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
@@ -0,0 +1,52 @@
+# 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.
+
+import os
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class CleanWorkingDirectory(AbstractStep):
+    def __init__(self, tool, options, allow_local_commits=False):
+        AbstractStep.__init__(self, tool, options)
+        self._allow_local_commits = allow_local_commits
+
+    @classmethod
+    def options(cls):
+        return [
+            Options.force_clean,
+            Options.clean,
+        ]
+
+    def run(self, state):
+        os.chdir(self._tool.scm().checkout_root)
+        if not self._allow_local_commits:
+            self._tool.scm().ensure_no_local_commits(self._options.force_clean)
+        if self._options.clean:
+            self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py
new file mode 100644
index 0000000..f06f94e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py
@@ -0,0 +1,34 @@
+# 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.
+
+from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory
+
+class CleanWorkingDirectoryWithLocalCommits(CleanWorkingDirectory):
+    def __init__(self, tool, options):
+        # FIXME: This a bit of a hack.  Consider doing this more cleanly.
+        CleanWorkingDirectory.__init__(self, tool, options, allow_local_commits=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/closebug.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebug.py
new file mode 100644
index 0000000..d5059ea
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebug.py
@@ -0,0 +1,51 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+
+class CloseBug(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.close_bug,
+        ]
+
+    def run(self, state):
+        if not self._options.close_bug:
+            return
+        # Check to make sure there are no r? or r+ patches on the bug before closing.
+        # Assume that r- patches are just previous patches someone forgot to obsolete.
+        patches = self._tool.bugs.fetch_bug(state["patch"].bug_id()).patches()
+        for patch in patches:
+            if patch.review() == "?" or patch.review() == "+":
+                log("Not closing bug %s as attachment %s has review=%s.  Assuming there are more patches to land from this bug." % (patch.bug_id(), patch.id(), patch.review()))
+                return
+        self._tool.bugs.close_bug_as_fixed(state["patch"].bug_id(), "All reviewed patches have been landed.  Closing bug.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py
new file mode 100644
index 0000000..476d3af
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py
@@ -0,0 +1,58 @@
+# 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.
+
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+
+class CloseBugForLandDiff(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.close_bug,
+        ]
+
+    def run(self, state):
+        comment_text = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
+        bug_id = state.get("bug_id")
+        if not bug_id and state.get("patch"):
+            bug_id = state.get("patch").bug_id()
+
+        if bug_id:
+            log("Updating bug %s" % bug_id)
+            if self._options.close_bug:
+                self._tool.bugs.close_bug_as_fixed(bug_id, comment_text)
+            else:
+                # FIXME: We should a smart way to figure out if the patch is attached
+                # to the bug, and if so obsolete it.
+                self._tool.bugs.post_comment_to_bug(bug_id, comment_text)
+        else:
+            log(comment_text)
+            log("No bug id provided.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py
new file mode 100644
index 0000000..4e7f9e6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py
@@ -0,0 +1,41 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
+
+class CloseBugForLandDiffTest(unittest.TestCase):
+    def test_empty_state(self):
+        capture = OutputCapture()
+        step = CloseBugForLandDiff(MockTool(), Mock())
+        expected_stderr = "Committed r49824: <http://trac.webkit.org/changeset/49824>\nNo bug id provided.\n"
+        capture.assert_outputs(self, step.run, [{"commit_text" : "Mock commit text"}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py b/WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py
new file mode 100644
index 0000000..ff94df8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py
@@ -0,0 +1,36 @@
+# 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.
+
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class ClosePatch(AbstractStep):
+    def run(self, state):
+        comment_text = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
+        self._tool.bugs.clear_attachment_flags(state["patch"].id(), comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/commit.py b/WebKitTools/Scripts/webkitpy/tool/steps/commit.py
new file mode 100644
index 0000000..294b41e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/commit.py
@@ -0,0 +1,37 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class Commit(AbstractStep):
+    def run(self, state):
+        commit_message = self._tool.checkout().commit_message_for_this_commit()
+        if len(commit_message.message()) < 50:
+            raise Exception("Attempted to commit with a commit message shorter than 50 characters.  Either your patch is missing a ChangeLog or webkit-patch may have a bug.")
+        state["commit_text"] =  self._tool.scm().commit_with_message(commit_message.message())
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py
new file mode 100644
index 0000000..d08e477
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py
@@ -0,0 +1,74 @@
+# 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.
+
+import urllib
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.prettypatch import PrettyPatch
+from webkitpy.common.system import logutils
+from webkitpy.common.system.executive import ScriptError
+
+
+_log = logutils.get_logger(__file__)
+
+
+class ConfirmDiff(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.confirm,
+        ]
+
+    def _show_pretty_diff(self, diff):
+        try:
+            pretty_patch = PrettyPatch(self._tool.executive,
+                                       self._tool.scm().checkout_root)
+            pretty_diff_file = pretty_patch.pretty_diff_file(diff)
+            url = "file://%s" % urllib.quote(pretty_diff_file.name)
+            self._tool.user.open_url(url)
+            # We return the pretty_diff_file here because we need to keep the
+            # file alive until the user has had a chance to confirm the diff.
+            return pretty_diff_file
+        except ScriptError, e:
+            _log.warning("PrettyPatch failed.  :(")
+        except OSError, e:
+            _log.warning("PrettyPatch unavailable.")
+
+    def run(self, state):
+        if not self._options.confirm:
+            return
+        diff = self.cached_lookup(state, "diff")
+        pretty_diff_file = self._show_pretty_diff(diff)
+        if not pretty_diff_file:
+            self._tool.user.page(diff)
+        diff_correct = self._tool.user.confirm("Was that diff correct?")
+        if pretty_diff_file:
+            pretty_diff_file.close()
+        if not diff_correct:
+            exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py b/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py
new file mode 100644
index 0000000..2f3d42c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py
@@ -0,0 +1,48 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class CreateBug(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.cc,
+            Options.component,
+        ]
+
+    def run(self, state):
+        # No need to create a bug if we already have one.
+        if state.get("bug_id"):
+            return
+        cc = self._options.cc
+        if not cc:
+            cc = state.get("bug_cc")
+        state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=state.get("bug_blocked"), component=self._options.component, cc=cc)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py
new file mode 100644
index 0000000..69c8732
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py
@@ -0,0 +1,37 @@
+# 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.
+
+import os
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class EditChangeLog(AbstractStep):
+    def run(self, state):
+        os.chdir(self._tool.scm().checkout_root)
+        self._tool.user.edit(self.cached_lookup(state, "changelogs"))
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py
new file mode 100644
index 0000000..fd44564
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py
@@ -0,0 +1,48 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
+
+
+class EnsureBuildersAreGreen(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.check_builders,
+        ]
+
+    def run(self, state):
+        if not self._options.check_builders:
+            return
+        red_builders_names = self._tool.buildbot.red_core_builders_names()
+        if not red_builders_names:
+            return
+        red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
+        error("Builders [%s] are red, please do not commit.\nSee http://%s.\nPass --ignore-builders to bypass this check." % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host))
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py b/WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py
new file mode 100644
index 0000000..4f799f2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py
@@ -0,0 +1,43 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
+
+
+class EnsureLocalCommitIfNeeded(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.local_commit,
+        ]
+
+    def run(self, state):
+        if self._options.local_commit and not self._tool.scm().supports_local_commits():
+            error("--local-commit passed, but %s does not support local commits" % self._tool.scm.display_name())
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/metastep.py b/WebKitTools/Scripts/webkitpy/tool/steps/metastep.py
new file mode 100644
index 0000000..7cbd1c5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/metastep.py
@@ -0,0 +1,54 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+# FIXME: Unify with StepSequence?  I'm not sure yet which is the better design.
+class MetaStep(AbstractStep):
+    substeps = [] # Override in subclasses
+    def __init__(self, tool, options):
+        AbstractStep.__init__(self, tool, options)
+        self._step_instances = []
+        for step_class in self.substeps:
+            self._step_instances.append(step_class(tool, options))
+
+    @staticmethod
+    def _collect_options_from_steps(steps):
+        collected_options = []
+        for step in steps:
+            collected_options = collected_options + step.options()
+        return collected_options
+
+    @classmethod
+    def options(cls):
+        return cls._collect_options_from_steps(cls.substeps)
+
+    def run(self, state):
+        for step in self._step_instances:
+             step.run(state)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py b/WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py
new file mode 100644
index 0000000..9f65d41
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py
@@ -0,0 +1,51 @@
+# 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.
+
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+
+class ObsoletePatches(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.obsolete_patches,
+        ]
+
+    def run(self, state):
+        if not self._options.obsolete_patches:
+            return
+        bug_id = state["bug_id"]
+        patches = self._tool.bugs.fetch_bug(bug_id).patches()
+        if not patches:
+            return
+        log("Obsoleting %s on bug %s" % (pluralize("old patch", len(patches)), bug_id))
+        for patch in patches:
+            self._tool.bugs.obsolete_attachment(patch.id())
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
new file mode 100644
index 0000000..7f76f55
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -0,0 +1,56 @@
+# 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.
+
+from optparse import make_option
+
+class Options(object):
+    build = make_option("--build", action="store_true", dest="build", default=False, help="Build and run run-webkit-tests before committing.")
+    build_style = make_option("--build-style", action="store", dest="build_style", default=None, help="Whether to build debug, release, or both.")
+    cc = make_option("--cc", action="store", type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
+    check_builders = make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing.")
+    check_style = make_option("--ignore-style", action="store_false", dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
+    clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
+    close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
+    component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
+    confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
+    description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
+    email = make_option("--email", action="store", type="string", dest="email", help="Email address to use in ChangeLogs.")
+    fancy_review = make_option("--fancy-review", action="store_true", dest="fancy_review", default=False, help="(Experimental) Upload the patch to Rietveld code review tool.")
+    force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
+    local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
+    non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.")
+    obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
+    open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
+    parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
+    port = make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...).")
+    quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
+    request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
+    review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
+    reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
+    test = make_option("--test", action="store_true", dest="test", default=False, help="Commit without running run-webkit-tests")
+    update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py b/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
new file mode 100644
index 0000000..3e7ed76
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
@@ -0,0 +1,74 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class PostCodeReview(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.cc,
+            Options.description,
+            Options.fancy_review,
+            Options.review,
+        ]
+
+    def run(self, state):
+        if not self._options.fancy_review:
+            return
+        # FIXME: This will always be None because we don't retrieve the issue
+        #        number from the ChangeLog yet.
+        codereview_issue = state.get("codereview_issue")
+        message = self._options.description
+        if not message:
+            # If we have an issue number, then the message becomes the label
+            # of the new patch. Otherwise, it becomes the title of the whole
+            # issue.
+            if codereview_issue:
+                message = "Updated patch"
+            elif state.get("bug_title"):
+                # This is the common case for the the first "upload" command.
+                message = state.get("bug_title")
+            elif state.get("bug_id"):
+                # This is the common case for the "post" command and
+                # subsequent runs of the "upload" command.  In this case,
+                # I'd rather add the new patch to the existing issue, but
+                # that's not implemented yet.
+                message = "Code review for %s" % self._tool.bugs.bug_url_for_bug_id(state["bug_id"])
+            else:
+                # Unreachable with our current commands, but we might hit
+                # this case if we support bug-less code reviews.
+                message = "Code review"
+        created_issue = self._tool.codereview.post(message=message,
+                                                   codereview_issue=codereview_issue,
+                                                   cc=self._options.cc)
+        if created_issue:
+            # FIXME: Record the issue number in the ChangeLog.
+            state["codereview_issue"] = created_issue
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
new file mode 100644
index 0000000..6a3dee4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
@@ -0,0 +1,57 @@
+# 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.
+
+import StringIO
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class PostDiff(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.description,
+            Options.review,
+            Options.request_commit,
+            Options.open_bug,
+        ]
+
+    def run(self, state):
+        diff = self.cached_lookup(state, "diff")
+        diff_file = StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
+        description = self._options.description or "Patch"
+        comment_text = None
+        codereview_issue = state.get("codereview_issue")
+        # Include codereview issue number in patch name. This is a bit of a hack,
+        # but it makes doing the rietveld integration a lot easier.
+        if codereview_issue:
+            description += "-%s" % state["codereview_issue"]
+        self._tool.bugs.add_patch_to_bug(state["bug_id"], diff_file, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
+        if self._options.open_bug:
+            self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(state["bug_id"]))
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py
new file mode 100644
index 0000000..03b9e78
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py
@@ -0,0 +1,41 @@
+# 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.
+
+import StringIO
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class PostDiffForCommit(AbstractStep):
+    def run(self, state):
+        self._tool.bugs.add_patch_to_bug(
+            state["bug_id"],
+            StringIO.StringIO(self.cached_lookup(state, "diff")),
+            "Patch for landing",
+            mark_for_review=False,
+            mark_for_landing=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py
new file mode 100644
index 0000000..3b9da04
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py
@@ -0,0 +1,51 @@
+# 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.
+
+import StringIO
+
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class PostDiffForRevert(AbstractStep):
+    def run(self, state):
+        comment_text = "Any committer can land this patch automatically by \
+marking it commit-queue+.  The commit-queue will build and test \
+the patch before landing to ensure that the rollout will be \
+successful.  This process takes approximately 15 minutes.\n\n\
+If you would like to land the rollout faster, you can use the \
+following command:\n\n\
+  webkit-patch land-attachment ATTACHMENT_ID --ignore-builders\n\n\
+where ATTACHMENT_ID is the ID of this attachment."
+        self._tool.bugs.add_patch_to_bug(
+            state["bug_id"],
+            StringIO.StringIO(self.cached_lookup(state, "diff")),
+            "%s%s" % (Attachment.rollout_preamble, state["revision"]),
+            comment_text=comment_text,
+            mark_for_review=False,
+            mark_for_commit_queue=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
new file mode 100644
index 0000000..fcb40be
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
@@ -0,0 +1,59 @@
+# 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.
+
+import os
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
+
+
+class PrepareChangeLog(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.port,
+            Options.quiet,
+            Options.email,
+        ]
+
+    def run(self, state):
+        if self.cached_lookup(state, "changelogs"):
+            return
+        os.chdir(self._tool.scm().checkout_root)
+        args = [self.port().script_path("prepare-ChangeLog")]
+        if state["bug_id"]:
+            args.append("--bug=%s" % state["bug_id"])
+        if self._options.email:
+            args.append("--email=%s" % self._options.email)
+        try:
+            self._tool.executive.run_and_throw_if_fail(args, self._options.quiet)
+        except ScriptError, e:
+            error("Unable to prepare ChangeLogs.")
+        state["diff"] = None # We've changed the diff
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
new file mode 100644
index 0000000..f7d9cd3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
@@ -0,0 +1,44 @@
+# 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.
+
+import os
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class PrepareChangeLogForRevert(AbstractStep):
+    def run(self, state):
+        # This could move to prepare-ChangeLog by adding a --revert= option.
+        self._run_script("prepare-ChangeLog")
+        changelog_paths = self._tool.checkout().modified_changelogs()
+        bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
+        for changelog_path in changelog_paths:
+            # FIXME: Seems we should prepare the message outside of changelogs.py and then just pass in
+            # text that we want to use to replace the reviewed by line.
+            ChangeLog(changelog_path).update_for_revert(state["revision"], state["reason"], bug_url)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py b/WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
new file mode 100644
index 0000000..31c913c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
@@ -0,0 +1,45 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class PromptForBugOrTitle(AbstractStep):
+    def run(self, state):
+        # No need to prompt if we alrady have the bug_id.
+        if state.get("bug_id"):
+            return
+        user_response = self._tool.user.prompt("Please enter a bug number or a title for a new bug:\n")
+        # If the user responds with a number, we assume it's bug number.
+        # Otherwise we assume it's a bug subject.
+        try:
+            state["bug_id"] = int(user_response)
+        except ValueError, TypeError:
+            state["bug_title"] = user_response
+            # FIXME: This is kind of a lame description.
+            state["bug_description"] = user_response
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py b/WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py
new file mode 100644
index 0000000..f369ca9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py
@@ -0,0 +1,44 @@
+# 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.
+
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.common.system.deprecated_logging import log
+
+
+class ReopenBugAfterRollout(AbstractStep):
+    def run(self, state):
+        commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
+        comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
+
+        bug_id = state["bug_id"]
+        if not bug_id:
+            log(comment_text)
+            log("No bugs were updated.")
+            return
+        self._tool.bugs.reopen_bug(bug_id, comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
new file mode 100644
index 0000000..81b6bcb
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
@@ -0,0 +1,34 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class RevertRevision(AbstractStep):
+    def run(self, state):
+        self._tool.checkout().apply_reverse_diff(state["revision"])
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
new file mode 100644
index 0000000..55d8c62
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -0,0 +1,63 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+class RunTests(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.test,
+            Options.non_interactive,
+            Options.quiet,
+            Options.port,
+        ]
+
+    def run(self, state):
+        if not self._options.test:
+            return
+
+        # Run the scripting unit tests first because they're quickest.
+        log("Running Python unit tests")
+        self._tool.executive.run_and_throw_if_fail(self.port().run_python_unittests_command())
+        log("Running Perl unit tests")
+        self._tool.executive.run_and_throw_if_fail(self.port().run_perl_unittests_command())
+        log("Running JavaScriptCore tests")
+        self._tool.executive.run_and_throw_if_fail(self.port().run_javascriptcore_tests_command(), quiet=True)
+
+        log("Running run-webkit-tests")
+        args = self.port().run_webkit_tests_command()
+        if self._options.non_interactive:
+            args.append("--no-launch-safari")
+            args.append("--exit-after-n-failures=1")
+        if self._options.quiet:
+            args.append("--quiet")
+        self._tool.executive.run_and_throw_if_fail(args)
+
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
new file mode 100644
index 0000000..40bee90
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
@@ -0,0 +1,56 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.steps.update import Update
+from webkitpy.tool.steps.promptforbugortitle import PromptForBugOrTitle
+
+
+class StepsTest(unittest.TestCase):
+    def _run_step(self, step, tool=None, options=None, state=None):
+        if not tool:
+            tool = MockTool()
+        if not options:
+            options = Mock()
+        if not state:
+            state = {}
+        step(tool, options).run(state)
+
+    def test_update_step(self):
+        options = Mock()
+        options.update = True
+        self._run_step(Update, options)
+
+    def test_prompt_for_bug_or_title_step(self):
+        tool = MockTool()
+        tool.user.prompt = lambda message: 42
+        self._run_step(PromptForBugOrTitle, tool=tool)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/update.py b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
new file mode 100644
index 0000000..c98eba7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
@@ -0,0 +1,46 @@
+# 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.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
+
+
+class Update(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.update,
+            Options.port,
+        ]
+
+    def run(self, state):
+        if not self._options.update:
+            return
+        log("Updating working directory")
+        self._tool.executive.run_and_throw_if_fail(self.port().update_webkit_command(), quiet=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py
new file mode 100644
index 0000000..0534718
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2009 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.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
+
+class UpdateChangeLogsWithReviewerTest(unittest.TestCase):
+    def test_guess_reviewer_from_bug(self):
+        capture = OutputCapture()
+        step = UpdateChangeLogsWithReviewer(MockTool(), Mock())
+        expected_stderr = "0 reviewed patches on bug 75, cannot infer reviewer.\n"
+        capture.assert_outputs(self, step._guess_reviewer_from_bug, [75], expected_stderr=expected_stderr)
+
+    def test_empty_state(self):
+        capture = OutputCapture()
+        step = UpdateChangeLogsWithReviewer(MockTool(), Mock())
+        capture.assert_outputs(self, step.run, [{}])
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py
new file mode 100644
index 0000000..a35ed8c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py
@@ -0,0 +1,71 @@
+# 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.
+
+import os
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log, error
+
+class UpdateChangeLogsWithReviewer(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            Options.reviewer,
+        ]
+
+    def _guess_reviewer_from_bug(self, bug_id):
+        patches = self._tool.bugs.fetch_bug(bug_id).reviewed_patches()
+        if len(patches) != 1:
+            log("%s on bug %s, cannot infer reviewer." % (pluralize("reviewed patch", len(patches)), bug_id))
+            return None
+        patch = patches[0]
+        log("Guessing \"%s\" as reviewer from attachment %s on bug %s." % (patch.reviewer().full_name, patch.id(), bug_id))
+        return patch.reviewer().full_name
+
+    def run(self, state):
+        bug_id = state.get("bug_id")
+        if not bug_id and state.get("patch"):
+            bug_id = state.get("patch").bug_id()
+
+        reviewer = self._options.reviewer
+        if not reviewer:
+            if not bug_id:
+                log("No bug id provided and --reviewer= not provided.  Not updating ChangeLogs with reviewer.")
+                return
+            reviewer = self._guess_reviewer_from_bug(bug_id)
+
+        if not reviewer:
+            log("Failed to guess reviewer from bug %s and --reviewer= not provided.  Not updating ChangeLogs with reviewer." % bug_id)
+            return
+
+        os.chdir(self._tool.scm().checkout_root)
+        for changelog_path in self._tool.checkout().modified_changelogs():
+            ChangeLog(changelog_path).set_reviewer(reviewer)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py
new file mode 100644
index 0000000..80b2c5d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py
@@ -0,0 +1,64 @@
+# 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.
+
+import os
+import re
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.common.system.deprecated_logging import error, log
+
+
+# FIXME: Some of this logic should probably be unified with CommitterValidator?
+class ValidateReviewer(AbstractStep):
+    # FIXME: This should probably move onto ChangeLogEntry
+    def _has_valid_reviewer(self, changelog_entry):
+        if changelog_entry.reviewer():
+            return True
+        if re.search("unreviewed", changelog_entry.contents(), re.IGNORECASE):
+            return True
+        if re.search("rubber[ -]stamp", changelog_entry.contents(), re.IGNORECASE):
+            return True
+        return False
+
+    def run(self, state):
+        # FIXME: For now we disable this check when a user is driving the script
+        # this check is too draconian (and too poorly tested) to foist upon users.
+        if not self._options.non_interactive:
+            return
+        # FIXME: We should figure out how to handle the current working
+        #        directory issue more globally.
+        os.chdir(self._tool.scm().checkout_root)
+        for changelog_path in self._tool.checkout().modified_changelogs():
+            changelog_entry = ChangeLog(changelog_path).latest_entry()
+            if self._has_valid_reviewer(changelog_entry):
+                continue
+            reviewer_text = changelog_entry.reviewer_text()
+            if reviewer_text:
+                log("%s found in %s does not appear to be a valid reviewer according to committers.py." % (reviewer_text, changelog_path))
+            error('%s neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).' % changelog_path)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py
new file mode 100644
index 0000000..9105102
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py
@@ -0,0 +1,58 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.checkout.changelog import ChangeLogEntry
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.steps.validatereviewer import ValidateReviewer
+
+class ValidateReviewerTest(unittest.TestCase):
+    _boilerplate_entry = '''2009-08-19  Eric Seidel  <eric@webkit.org>
+
+        REVIEW_LINE
+
+        * Scripts/bugzilla-tool:
+'''
+
+    def _test_review_text(self, step, text, expected):
+        contents = self._boilerplate_entry.replace("REVIEW_LINE", text)
+        entry = ChangeLogEntry(contents)
+        self.assertEqual(step._has_valid_reviewer(entry), expected)
+
+    def test_has_valid_reviewer(self):
+        step = ValidateReviewer(MockTool(), Mock())
+        self._test_review_text(step, "Reviewed by Eric Seidel.", True)
+        self._test_review_text(step, "Reviewed by Eric Seidel", True) # Not picky about the '.'
+        self._test_review_text(step, "Reviewed by Eric.", False)
+        self._test_review_text(step, "Reviewed by Eric C Seidel.", False)
+        self._test_review_text(step, "Rubber-stamped by Eric.", True)
+        self._test_review_text(step, "Rubber stamped by Eric.", True)
+        self._test_review_text(step, "Unreviewed build fix.", True)
diff --git a/WebKitTools/Scripts/webkitpy/user.py b/WebKitTools/Scripts/webkitpy/user.py
deleted file mode 100644
index b2ec19e..0000000
--- a/WebKitTools/Scripts/webkitpy/user.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2009, 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.
-
-import os
-import shlex
-import subprocess
-import webbrowser
-
-class User(object):
-    @staticmethod
-    def prompt(message, repeat=1, raw_input=raw_input):
-        response = None
-        while (repeat and not response):
-            repeat -= 1
-            response = raw_input(message)
-        return response
-
-    def edit(self, files):
-        editor = os.environ.get("EDITOR") or "vi"
-        args = shlex.split(editor)
-        subprocess.call(args + files)
-
-    def page(self, message):
-        pager = os.environ.get("PAGER") or "less"
-        try:
-            child_process = subprocess.Popen([pager], stdin=subprocess.PIPE)
-            child_process.communicate(input=message)
-        except IOError, e:
-            pass
-
-    def confirm(self, message=None):
-        if not message:
-            message = "Continue?"
-        response = raw_input("%s [Y/n]: " % message)
-        return not response or response.lower() == "y"
-
-    def open_url(self, url):
-        webbrowser.open(url)
diff --git a/WebKitTools/Scripts/webkitpy/user_unittest.py b/WebKitTools/Scripts/webkitpy/user_unittest.py
deleted file mode 100644
index 34d9983..0000000
--- a/WebKitTools/Scripts/webkitpy/user_unittest.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (C) 2010 Research in Motion Ltd. 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 Research in Motion Ltd. 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.
-
-import unittest
-from webkitpy.user import User
-
-class UserTest(unittest.TestCase):
-
-    example_user_response = "example user response"
-
-    def test_prompt_repeat(self):
-        self.repeatsRemaining = 2
-        def mock_raw_input(message):
-            self.repeatsRemaining -= 1
-            if not self.repeatsRemaining:
-                return UserTest.example_user_response
-            return None
-        self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), UserTest.example_user_response)
-
-    def test_prompt_when_exceeded_repeats(self):
-        self.repeatsRemaining = 2
-        def mock_raw_input(message):
-            self.repeatsRemaining -= 1
-            return None
-        self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), None)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py b/WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py
deleted file mode 100644
index b940a4d..0000000
--- a/WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright (C) 2009 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.
-
-import os
-import subprocess
-import StringIO
-import tempfile
-import unittest
-
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import *
-
-class LoggingTest(unittest.TestCase):
-
-    def assert_log_equals(self, log_input, expected_output):
-        original_stderr = sys.stderr
-        test_stderr = StringIO.StringIO()
-        sys.stderr = test_stderr
-
-        try:
-            log(log_input)
-            actual_output = test_stderr.getvalue()
-        finally:
-            original_stderr = original_stderr
-
-        self.assertEquals(actual_output, expected_output, "log(\"%s\") expected: %s actual: %s" % (log_input, expected_output, actual_output))
-
-    def test_log(self):
-        self.assert_log_equals("test", "test\n")
-
-        # Test that log() does not throw an exception when passed an object instead of a string.
-        self.assert_log_equals(ScriptError(message="ScriptError"), "ScriptError\n")
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/webkitport.py b/WebKitTools/Scripts/webkitpy/webkitport.py
deleted file mode 100644
index cd60a54..0000000
--- a/WebKitTools/Scripts/webkitpy/webkitport.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright (C) 2009, 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.
-#
-# WebKit's Python module for understanding the various ports
-
-import os
-
-from optparse import make_option
-from webkitpy.executive import Executive
-
-
-class WebKitPort(object):
-
-    # We might need to pass scm into this function for scm.checkout_root
-    @classmethod
-    def script_path(cls, script_name):
-        return os.path.join("WebKitTools", "Scripts", script_name)
-
-    @staticmethod
-    def port(port_name):
-        ports = {
-            "chromium": ChromiumPort,
-            "gtk": GtkPort,
-            "mac": MacPort,
-            "qt": QtPort,
-        }
-        # FIXME: We should default to WinPort on Windows.
-        return ports.get(port_name, MacPort)
-
-    @classmethod
-    def name(cls):
-        raise NotImplementedError("subclasses must implement")
-
-    @classmethod
-    def flag(cls):
-        raise NotImplementedError("subclasses must implement")
-
-    @classmethod
-    def update_webkit_command(cls):
-        return [cls.script_path("update-webkit")]
-
-    @classmethod
-    def build_webkit_command(cls, build_style=None):
-        command = [cls.script_path("build-webkit")]
-        if build_style == "debug":
-            command.append("--debug")
-        if build_style == "release":
-            command.append("--release")
-        return command
-
-    @classmethod
-    def run_javascriptcore_tests_command(cls):
-        return [cls.script_path("run-javascriptcore-tests")]
-
-    @classmethod
-    def run_webkit_tests_command(cls):
-        return [cls.script_path("run-webkit-tests")]
-
-    @classmethod
-    def run_python_unittests_command(cls):
-        return [cls.script_path("test-webkitpy")]
-
-    @classmethod
-    def run_perl_unittests_command(cls):
-        return [cls.script_path("test-webkitperl")]
-
-
-class MacPort(WebKitPort):
-
-    @classmethod
-    def name(cls):
-        return "Mac"
-
-    @classmethod
-    def flag(cls):
-        return "--port=mac"
-
-
-class GtkPort(WebKitPort):
-
-    @classmethod
-    def name(cls):
-        return "Gtk"
-
-    @classmethod
-    def flag(cls):
-        return "--port=gtk"
-
-    @classmethod
-    def build_webkit_command(cls, build_style=None):
-        command = WebKitPort.build_webkit_command(build_style=build_style)
-        command.append("--gtk")
-        command.append('--makeargs="-j%s"' % Executive.cpu_count())
-        return command
-
-    @classmethod
-    def run_webkit_tests_command(cls):
-        command = WebKitPort.run_webkit_tests_command()
-        command.append("--gtk")
-        return command
-
-
-class QtPort(WebKitPort):
-
-    @classmethod
-    def name(cls):
-        return "Qt"
-
-    @classmethod
-    def flag(cls):
-        return "--port=qt"
-
-    @classmethod
-    def build_webkit_command(cls, build_style=None):
-        command = WebKitPort.build_webkit_command(build_style=build_style)
-        command.append("--qt")
-        command.append('--makeargs="-j%s"' % Executive.cpu_count())
-        return command
-
-
-class ChromiumPort(WebKitPort):
-
-    @classmethod
-    def name(cls):
-        return "Chromium"
-
-    @classmethod
-    def flag(cls):
-        return "--port=chromium"
-
-    @classmethod
-    def update_webkit_command(cls):
-        command = WebKitPort.update_webkit_command()
-        command.append("--chromium")
-        return command
-
-    @classmethod
-    def build_webkit_command(cls, build_style=None):
-        command = WebKitPort.build_webkit_command(build_style=build_style)
-        command.append("--chromium")
-        return command
diff --git a/WebKitTools/Scripts/webkitpy/webkitport_unittest.py b/WebKitTools/Scripts/webkitpy/webkitport_unittest.py
deleted file mode 100644
index 202234f..0000000
--- a/WebKitTools/Scripts/webkitpy/webkitport_unittest.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, 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.
-
-import unittest
-
-from webkitpy.executive import Executive
-from webkitpy.webkitport import WebKitPort, MacPort, GtkPort, QtPort, ChromiumPort
-
-
-class WebKitPortTest(unittest.TestCase):
-    def test_mac_port(self):
-        self.assertEquals(MacPort.name(), "Mac")
-        self.assertEquals(MacPort.flag(), "--port=mac")
-        self.assertEquals(MacPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
-        self.assertEquals(MacPort.build_webkit_command(), [WebKitPort.script_path("build-webkit")])
-        self.assertEquals(MacPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug"])
-        self.assertEquals(MacPort.build_webkit_command(build_style="release"), [WebKitPort.script_path("build-webkit"), "--release"])
-
-    def test_gtk_port(self):
-        self.assertEquals(GtkPort.name(), "Gtk")
-        self.assertEquals(GtkPort.flag(), "--port=gtk")
-        self.assertEquals(GtkPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests"), "--gtk"])
-        self.assertEquals(GtkPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--gtk", '--makeargs="-j%s"' % Executive.cpu_count()])
-        self.assertEquals(GtkPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--gtk", '--makeargs="-j%s"' % Executive.cpu_count()])
-
-    def test_qt_port(self):
-        self.assertEquals(QtPort.name(), "Qt")
-        self.assertEquals(QtPort.flag(), "--port=qt")
-        self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
-        self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt", '--makeargs="-j%s"' % Executive.cpu_count()])
-        self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--qt", '--makeargs="-j%s"' % Executive.cpu_count()])
-
-    def test_chromium_port(self):
-        self.assertEquals(ChromiumPort.name(), "Chromium")
-        self.assertEquals(ChromiumPort.flag(), "--port=chromium")
-        self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
-        self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium"])
-        self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium"])
-        self.assertEquals(ChromiumPort.update_webkit_command(), [WebKitPort.script_path("update-webkit"), "--chromium"])
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/TestResultServer/app.yaml b/WebKitTools/TestResultServer/app.yaml
new file mode 100644
index 0000000..e51af84
--- /dev/null
+++ b/WebKitTools/TestResultServer/app.yaml
@@ -0,0 +1,19 @@
+application: test-results
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /stylesheets
+  static_dir: stylesheets
+
+- url: /testfile/delete
+  script: main.py
+  login: admin
+
+- url: /dashboards/delete
+  script: main.py
+  login: admin
+
+- url: /.*
+  script: main.py
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/TestResultServer/handlers/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/TestResultServer/handlers/__init__.py
diff --git a/WebKitTools/TestResultServer/handlers/dashboardhandler.py b/WebKitTools/TestResultServer/handlers/dashboardhandler.py
new file mode 100644
index 0000000..45bc471
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/dashboardhandler.py
@@ -0,0 +1,120 @@
+# 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.
+
+import logging
+import mimetypes
+import urllib2
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+from model.dashboardfile import DashboardFile
+
+PARAM_FILE = "file"
+
+def get_content_type(filename):
+    return mimetypes.guess_type(filename)[0] or "application/octet-stream"
+
+
+class GetDashboardFile(webapp.RequestHandler):
+    def get(self, resource):
+        if not resource:
+            logging.debug("Getting dashboard file list.")
+            return self._get_file_list()
+
+        filename = str(urllib2.unquote(resource))
+
+        logging.debug("Getting dashboard file: %s", filename)
+
+        files = DashboardFile.get_files(filename)
+        if not files:
+            logging.error("Failed to find dashboard file: %s, request: %s",
+                filename, self.request)
+            self.response.set_status(404)
+            return
+
+        content_type = "%s; charset=utf-8" % get_content_type(filename)
+        logging.info("content type: %s", content_type)
+        self.response.headers["Content-Type"] = content_type
+        self.response.out.write(files[0].data)
+
+    def _get_file_list(self):
+        logging.info("getting dashboard file list.")
+
+        files = DashboardFile.get_files("", 100)
+        if not files:
+            logging.info("Failed to find dashboard files.")
+            self.response.set_status(404)
+            return
+
+        template_values = {
+            "admin": users.is_current_user_admin(),
+            "files": files,
+        }
+        self.response.out.write(
+            template.render("templates/dashboardfilelist.html",
+                template_values))
+
+
+class UpdateDashboardFile(webapp.RequestHandler):
+    def get(self):
+        files = self.request.get_all(PARAM_FILE)
+        if not files:
+            files = ["flakiness_dashboard.html",
+                     "dashboard_base.js",
+                     "aggregate_results.html"]
+
+        errors = []
+        for file in files:
+            if not DashboardFile.update_file(file):
+                errors.append("Failed to update file: %s" % file)
+
+        if errors:
+            messages = "; ".join(errors)
+            logging.warning(messages)
+            self.response.set_status(500, messages)
+            self.response.out.write("FAIL")
+        else:
+            self.response.set_status(200)
+            self.response.out.write("OK")
+
+
+class DeleteDashboardFile(webapp.RequestHandler):
+    def get(self):
+        files = self.request.get_all(PARAM_FILE)
+        if not files:
+            logging.warning("No dashboard file to delete.")
+            self.response.set_status(400)
+            return
+
+        for file in files:
+            DashboardFile.delete_file(file)
+
+        # Display dashboard file list after deleting the file.
+        self.redirect("/dashboards/")
diff --git a/WebKitTools/TestResultServer/handlers/menu.py b/WebKitTools/TestResultServer/handlers/menu.py
new file mode 100644
index 0000000..ad2599d
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/menu.py
@@ -0,0 +1,64 @@
+# 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.
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+menu = [
+    ["List of test files", "/testfile"],
+    ["List of results.json files", "/testfile?name=results.json"],
+    ["List of expectations.json files", "/testfile?name=expectations.json"],
+    ["Upload test file", "/testfile/uploadform"],
+    ["List of dashboard files", "/dashboards/"],
+    ["Update dashboard files", "/dashboards/update"],
+]
+
+
+class Menu(webapp.RequestHandler):
+    def get(self):
+        user = users.get_current_user()
+        if user:
+            user_email = user.email()
+            login_text = "Sign out"
+            login_url = users.create_logout_url(self.request.uri)
+        else:
+            user_email = ""
+            login_text = "Sign in"
+            login_url = users.create_login_url(self.request.uri)
+
+        template_values = {
+            "user_email": user_email,
+            "login_text": login_text,
+            "login_url": login_url,
+            "menu": menu,
+        }
+
+        self.response.out.write(
+            template.render("templates/menu.html", template_values))
+
diff --git a/WebKitTools/TestResultServer/handlers/testfilehandler.py b/WebKitTools/TestResultServer/handlers/testfilehandler.py
new file mode 100644
index 0000000..972b606
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/testfilehandler.py
@@ -0,0 +1,221 @@
+# 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.
+
+import logging
+import urllib
+
+from google.appengine.api import users
+from google.appengine.ext import blobstore
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import blobstore_handlers
+from google.appengine.ext.webapp import template
+
+from model.testfile import TestFile
+
+PARAM_BUILDER = "builder"
+PARAM_DIR = "dir"
+PARAM_FILE = "file"
+PARAM_NAME = "name"
+PARAM_KEY = "key"
+PARAM_TEST_TYPE = "testtype"
+
+
+class DeleteFile(webapp.RequestHandler):
+    """Delete test file for a given builder and name from datastore (metadata) and blobstore (file data)."""
+
+    def get(self):
+        key = self.request.get(PARAM_KEY)
+        builder = self.request.get(PARAM_BUILDER)
+        test_type = self.request.get(PARAM_TEST_TYPE)
+        name = self.request.get(PARAM_NAME)
+
+        logging.debug(
+            "Deleting File, builder: %s, test_type: %s, name: %s, blob key: %s.",
+            builder, test_type, name, key)
+
+        TestFile.delete_file(key, builder, test_type, name, 100)
+
+        # Display file list after deleting the file.
+        self.redirect("/testfile?builder=%s&testtype=%s&name=%s"
+            % (builder, test_type, name))
+
+
+class GetFile(blobstore_handlers.BlobstoreDownloadHandler):
+    """Get file content or list of files for given builder and name."""
+
+    def _get_file_list(self, builder, test_type, name):
+        """Get and display a list of files that matches builder and file name.
+
+        Args:
+            builder: builder name
+            test_type: type of the test
+            name: file name
+        """
+
+        files = TestFile.get_files(builder, test_type, name, 100)
+        if not files:
+            logging.info("File not found, builder: %s, test_type: %s, name: %s.",
+                         builder, test_type, name)
+            self.response.out.write("File not found")
+            return
+
+        template_values = {
+            "admin": users.is_current_user_admin(),
+            "builder": builder,
+            "test_type": test_type,
+            "name": name,
+            "files": files,
+        }
+        self.response.out.write(template.render("templates/showfilelist.html",
+                                                template_values))
+
+    def _get_file_content(self, builder, test_type, name):
+        """Return content of the file that matches builder and file name.
+
+        Args:
+            builder: builder name
+            test_type: type of the test
+            name: file name
+        """
+
+        files = TestFile.get_files(builder, test_type, name, 1)
+        if not files:
+            logging.info("File not found, builder: %s, test_type: %s, name: %s.",
+                         builder, test_type, name)
+            return
+
+        blob_key = files[0].blob_key
+        blob_info = blobstore.get(blob_key)
+        if blob_info:
+            self.send_blob(blob_info, "text/plain")
+
+    def get(self):
+        builder = self.request.get(PARAM_BUILDER)
+        test_type = self.request.get(PARAM_TEST_TYPE)
+        name = self.request.get(PARAM_NAME)
+        dir = self.request.get(PARAM_DIR)
+
+        logging.debug(
+            "Getting files, builder: %s, test_type: %s, name: %s.",
+            builder, test_type, name)
+
+        # If parameter "dir" is specified or there is no builder or filename
+        # specified in the request, return list of files, otherwise, return
+        # file content.
+        if dir or not builder or not name:
+            return self._get_file_list(builder, test_type, name)
+        else:
+            return self._get_file_content(builder, test_type, name)
+
+
+class GetUploadUrl(webapp.RequestHandler):
+    """Get an url for uploading file to blobstore. A special url is required for each blobsotre upload."""
+
+    def get(self):
+        upload_url = blobstore.create_upload_url("/testfile/upload")
+        logging.info("Getting upload url: %s.", upload_url)
+        self.response.out.write(upload_url)
+
+
+class Upload(blobstore_handlers.BlobstoreUploadHandler):
+    """Upload file to blobstore."""
+
+    def post(self):
+        uploaded_files = self.get_uploads("file")
+        if not uploaded_files:
+            return self._upload_done([("Missing upload file field.")])
+
+        builder = self.request.get(PARAM_BUILDER)
+        if not builder:
+            for blob_info in uploaded_files:
+                blob_info.delete()
+    
+            return self._upload_done([("Missing builder parameter in upload request.")])
+
+        test_type = self.request.get(PARAM_TEST_TYPE)
+
+        logging.debug(
+            "Processing upload request, builder: %s, test_type: %s.",
+            builder, test_type)
+
+        errors = []
+        for blob_info in uploaded_files:
+            tf = TestFile.update_file(builder, test_type, blob_info)
+            if not tf:
+                errors.append(
+                    "Upload failed, builder: %s, test_type: %s, name: %s." %
+                    (builder, test_type, blob_info.filename))
+                blob_info.delete()
+
+        return self._upload_done(errors)
+
+    def _upload_done(self, errors):
+        logging.info("upload done.")
+
+        error_messages = []
+        for error in errors:
+            logging.info(error)
+            error_messages.append("error=%s" % urllib.quote(error))
+
+        if error_messages:
+            redirect_url = "/uploadfail?%s" % "&".join(error_messages)
+        else:
+            redirect_url = "/uploadsuccess"
+
+        logging.info(redirect_url)
+        # BlobstoreUploadHandler requires redirect at the end.
+        self.redirect(redirect_url)
+
+
+class UploadForm(webapp.RequestHandler):
+    """Show a form so user can submit a file to blobstore."""
+
+    def get(self):
+        upload_url = blobstore.create_upload_url("/testfile/upload")
+        template_values = {
+            "upload_url": upload_url,
+        }
+        self.response.out.write(template.render("templates/uploadform.html",
+                                                template_values))
+
+class UploadStatus(webapp.RequestHandler):
+    """Return status of file uploading"""
+
+    def get(self):
+        logging.debug("Update status")
+
+        if self.request.path == "/uploadsuccess":
+            self.response.set_status(200)
+            self.response.out.write("OK")
+        else:
+            errors = self.request.params.getall("error")
+            if errors:
+                messages = "FAIL: " + "; ".join(errors)
+                logging.warning(messages)
+                self.response.set_status(500, messages)
+                self.response.out.write("FAIL")
diff --git a/WebKitTools/TestResultServer/index.yaml b/WebKitTools/TestResultServer/index.yaml
new file mode 100644
index 0000000..50284dc
--- /dev/null
+++ b/WebKitTools/TestResultServer/index.yaml
@@ -0,0 +1,50 @@
+indexes:
+
+# AUTOGENERATED
+
+# This index.yaml is automatically updated whenever the dev_appserver
+# detects that a new type of query is run.  If you want to manage the
+# index.yaml file manually, remove the above marker line (the line
+# saying "# AUTOGENERATED").  If you want to manage some indexes
+# manually, move them above the marker line.  The index.yaml file is
+# automatically uploaded to the admin console when you next deploy
+# your application using appcfg.py.
+
+- kind: DashboardFile
+  properties:
+  - name: name
+  - name: date
+    direction: desc
+
+- kind: TestFile
+  properties:
+  - name: builder
+  - name: date
+    direction: desc
+
+- kind: TestFile
+  properties:
+  - name: builder
+  - name: name
+  - name: date
+    direction: desc
+
+- kind: TestFile
+  properties:
+  - name: builder
+  - name: name
+  - name: test_type
+  - name: date
+    direction: desc
+
+- kind: TestFile
+  properties:
+  - name: name
+  - name: date
+    direction: desc
+
+- kind: TestFile
+  properties:
+  - name: test_type
+  - name: date
+    direction: desc
diff --git a/WebKitTools/TestResultServer/main.py b/WebKitTools/TestResultServer/main.py
new file mode 100644
index 0000000..7a0d237
--- /dev/null
+++ b/WebKitTools/TestResultServer/main.py
@@ -0,0 +1,60 @@
+# 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.
+
+# Request a modern Django
+from google.appengine.dist import use_library
+use_library('django', '1.1')
+
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp.util import run_wsgi_app
+
+from handlers import dashboardhandler
+from handlers import menu
+from handlers import testfilehandler
+
+routes = [
+    ('/dashboards/delete', dashboardhandler.DeleteDashboardFile),
+    ('/dashboards/update', dashboardhandler.UpdateDashboardFile),
+    ('/dashboards/([^?]+)?', dashboardhandler.GetDashboardFile),
+    ('/testfile/delete', testfilehandler.DeleteFile),
+    ('/testfile/uploadurl', testfilehandler.GetUploadUrl),
+    ('/testfile/upload', testfilehandler.Upload),
+    ('/testfile/uploadform', testfilehandler.UploadForm),
+    ('/testfile/?', testfilehandler.GetFile),
+    ('/uploadfail', testfilehandler.UploadStatus),
+    ('/uploadsuccess', testfilehandler.UploadStatus),
+    ('/*|/menu', menu.Menu),
+]
+
+application = webapp.WSGIApplication(routes, debug=True)
+
+def main():
+    run_wsgi_app(application)
+
+if __name__ == "__main__":
+    main()
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/TestResultServer/model/__init__.py
similarity index 100%
copy from WebKitTools/Scripts/webkitpy/commands/__init__.py
copy to WebKitTools/TestResultServer/model/__init__.py
diff --git a/WebKitTools/TestResultServer/model/dashboardfile.py b/WebKitTools/TestResultServer/model/dashboardfile.py
new file mode 100644
index 0000000..c74f071
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/dashboardfile.py
@@ -0,0 +1,116 @@
+# 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.
+
+from datetime import datetime
+import logging
+import urllib
+import urllib2
+
+from google.appengine.ext import db
+
+SVN_PATH_DASHBOARD = ("http://src.chromium.org/viewvc/chrome/trunk/tools/"
+    "dashboards/")
+
+class DashboardFile(db.Model):
+    name = db.StringProperty()
+    data = db.BlobProperty()
+    date = db.DateTimeProperty(auto_now_add=True)
+
+    @classmethod
+    def get_files(cls, name, limit=1):
+        query = DashboardFile.all()
+        if name:
+            query = query.filter("name =", name)
+        return query.order("-date").fetch(limit)
+
+    @classmethod
+    def add_file(cls, name, data):
+        file = DashboardFile()
+        file.name = name
+        file.data = db.Blob(data)
+        file.put()
+
+        logging.debug("Dashboard file saved, name: %s.", name)
+
+        return file
+
+    @classmethod
+    def grab_file_from_svn(cls, name):
+        logging.debug("Grab file from SVN, name: %s.", name)
+
+        url = SVN_PATH_DASHBOARD + urllib.quote_plus(name)
+
+        logging.info("Grab file from SVN, url: %s.", url)
+        try:
+            file = urllib2.urlopen(url)
+            if not file:
+                logging.error("Failed to grab dashboard file: %s.", url)
+                return None
+
+            return file.read()
+        except urllib2.HTTPError, e:
+            logging.error("Failed to grab dashboard file: %s", str(e))
+        except urllib2.URLError, e:
+            logging.error("Failed to grab dashboard file: %s", str(e))
+
+        return None
+
+    @classmethod
+    def update_file(cls, name):
+        data = cls.grab_file_from_svn(name)
+        if not data:
+            return None
+
+        logging.info("Got file from SVN.")
+
+        files = cls.get_files(name)
+        if not files:
+            logging.info("No existing file, added as new file.")
+            return cls.add_file(name, data)
+        
+        logging.debug("Updating existing file.")
+        file = files[0]
+        file.data = data
+        file.date = datetime.now()
+        file.put()
+
+        logging.info("Dashboard file replaced, name: %s.", name)
+
+        return file
+
+    @classmethod
+    def delete_file(cls, name):
+        files = cls.get_files(name)
+        if not files:
+            logging.warning("File not found, name: %s.", name)
+            return False
+
+        for file in files:
+            file.delete()
+
+        return True
diff --git a/WebKitTools/TestResultServer/model/testfile.py b/WebKitTools/TestResultServer/model/testfile.py
new file mode 100644
index 0000000..35ab967
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/testfile.py
@@ -0,0 +1,122 @@
+# 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.
+
+from datetime import datetime
+import logging
+
+from google.appengine.ext import blobstore
+from google.appengine.ext import db
+
+
+class TestFile(db.Model):
+    builder = db.StringProperty()
+    name = db.StringProperty()
+    test_type = db.StringProperty()
+    blob_key = db.StringProperty()
+    date = db.DateTimeProperty(auto_now_add=True)
+
+    @classmethod
+    def delete_file(cls, key, builder, test_type, name, limit):
+        if key:
+            file = db.get(key)
+            if not file:
+                logging.warning("File not found, key: %s.", key)
+                return False
+
+            file._delete_all()
+        else:
+            files = cls.get_files(builder, test_type, name, limit)
+            if not files:
+                logging.warning(
+                    "File not found, builder: %s, test_type:%s, name: %s.",
+                    builder, test_type, name)
+                return False
+
+            for file in files:
+                file._delete_all()
+
+        return True
+
+    @classmethod
+    def get_files(cls, builder, test_type, name, limit):
+        query = TestFile.all()
+        if builder:
+            query = query.filter("builder =", builder)
+        if test_type:
+            query = query.filter("test_type =", test_type)
+        if name:
+            query = query.filter("name =", name)
+
+        return query.order("-date").fetch(limit)
+
+    @classmethod
+    def add_file(cls, builder, test_type, blob_info):
+        file = TestFile()
+        file.builder = builder
+        file.test_type = test_type
+        file.name = blob_info.filename
+        file.blob_key = str(blob_info.key())
+        file.put()
+
+        logging.info(
+            "File saved, builder: %s, test_type: %s, name: %s, blob key: %s.",
+            builder, test_type, file.name, file.blob_key)
+
+        return file
+
+    @classmethod
+    def update_file(cls, builder, test_type, blob_info):
+        files = cls.get_files(builder, test_type, blob_info.filename, 1)
+        if not files:
+            return cls.add_file(builder, test_type, blob_info)
+
+        file = files[0]
+        old_blob_info = blobstore.BlobInfo.get(file.blob_key)
+        if old_blob_info:
+            old_blob_info.delete()
+
+        file.builder = builder
+        file.test_type = test_type
+        file.name = blob_info.filename
+        file.blob_key = str(blob_info.key())
+        file.date = datetime.now()
+        file.put()
+
+        logging.info(
+            "File replaced, builder: %s, test_type: %s, name: %s, blob key: %s.",
+            builder, test_type, file.name, file.blob_key)
+
+        return file
+
+    def _delete_all(self):
+        if self.blob_key:
+            blob_info = blobstore.BlobInfo.get(self.blob_key)
+            if blob_info:
+                blob_info.delete()
+
+        self.delete()
diff --git a/WebKitTools/TestResultServer/stylesheets/dashboardfile.css b/WebKitTools/TestResultServer/stylesheets/dashboardfile.css
new file mode 100644
index 0000000..1b0921c
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/dashboardfile.css
@@ -0,0 +1,30 @@
+body {
+  font-family: Verdana, Helvetica, sans-serif;
+  padding: 0px;
+  color: #444;
+}
+h1 {
+  color: #444;
+  font-size: 14pt;
+  font-style: italic;
+  margin: 0px;
+  padding: 5px;
+}
+table {
+  border-spacing: 0px;
+}
+th {
+  background-color: #AAA;
+  color: white;
+  text-align: left;
+  padding: 5px;
+  font-size: 12pt;
+}
+td {
+  font-size: 11pt;
+  padding: 3px;
+  text-align: left;
+}
+tr:hover {
+  background-color: #EEE;
+}
diff --git a/WebKitTools/TestResultServer/stylesheets/form.css b/WebKitTools/TestResultServer/stylesheets/form.css
new file mode 100644
index 0000000..b8f367d
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/form.css
@@ -0,0 +1,26 @@
+body {
+  font-family: Verdana;
+  padding: 0px;
+  color: #444;
+}
+h1 {
+  color: #444;
+  font-size: 14pt;
+  font-style: italic;
+  margin: 0px;
+  padding: 5px;
+}
+.label {
+  margin: 1px;
+  padding: 5px;
+  font-size: 11pt;
+  width: 90px;
+}
+.inputtext {
+  font-size: 11pt;
+}
+.button {
+  margin: 1px;
+  padding: 1px;
+  font-size: 11pt;
+}
diff --git a/WebKitTools/TestResultServer/stylesheets/menu.css b/WebKitTools/TestResultServer/stylesheets/menu.css
new file mode 100644
index 0000000..9948605
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/menu.css
@@ -0,0 +1,28 @@
+body {
+  font-family: Verdana, Helvetica, sans-serif;
+}
+h1 {
+  background-color: #EEE;
+  color: #444;
+  font-size: 14pt;
+  font-style: italic;
+  margin: 0px;
+  padding: 5px;
+}
+ul {
+  margin: 0px;
+  padding: 20px;
+  list-style: none;
+}
+li {
+  padding: 5px;
+}
+li:hover {
+  background-color: #EEE;
+}
+.login {
+  font-size: 8pt;
+  text-align: right;
+  width: 100%;
+}
+
diff --git a/WebKitTools/TestResultServer/stylesheets/testfile.css b/WebKitTools/TestResultServer/stylesheets/testfile.css
new file mode 100644
index 0000000..1b0921c
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/testfile.css
@@ -0,0 +1,30 @@
+body {
+  font-family: Verdana, Helvetica, sans-serif;
+  padding: 0px;
+  color: #444;
+}
+h1 {
+  color: #444;
+  font-size: 14pt;
+  font-style: italic;
+  margin: 0px;
+  padding: 5px;
+}
+table {
+  border-spacing: 0px;
+}
+th {
+  background-color: #AAA;
+  color: white;
+  text-align: left;
+  padding: 5px;
+  font-size: 12pt;
+}
+td {
+  font-size: 11pt;
+  padding: 3px;
+  text-align: left;
+}
+tr:hover {
+  background-color: #EEE;
+}
diff --git a/WebKitTools/TestResultServer/templates/dashboardfilelist.html b/WebKitTools/TestResultServer/templates/dashboardfilelist.html
new file mode 100644
index 0000000..818cb91
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/dashboardfilelist.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Dashboard Files</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/dashboardfile.css" />
+</head>
+<body>
+<h1>Dashboard Files
+</h1>
+<div>
+    <table>
+        <tr>
+            <th>File</th>
+            <th>Date</th>
+            {% if admin %}
+            <th></th>
+            {% endif %}
+        {% for file in files %}
+        <tr>{% if file.name %}
+            <td><a href="/dashboards/{{ file.name }}" >
+                {{ file.name }}
+                </a>
+            </td>
+            <td>{{ file.date|date:"d-M-Y H:i:s" }}
+            </td>
+            {% if admin %}
+            <td><a href="/dashboards/delete?file={{ file.name }}" >
+                Delete
+                </a>
+            </td>
+            {% endif %}
+        {% endif %}
+        </tr>
+    {% endfor %}
+    </table>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/menu.html b/WebKitTools/TestResultServer/templates/menu.html
new file mode 100644
index 0000000..1ad9f4d
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/menu.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test Result Server</title>
+<table class=login>
+    <tr>
+        <td>
+            {% if user_email %}
+            <span>{{ user_email }}</span>
+            {% endif %}
+            <span><a href="{{ login_url }}">{{ login_text }}</a></span>
+        </td>
+    </tr>
+</table>
+<link type="text/css" rel="stylesheet" href="/stylesheets/menu.css" />
+</head>
+<body>
+<h1>Test Result Server</h1>
+<div>
+    <ul>{% for title,link in menu %}
+        <li>
+            <a href="{{ link }}" >{{ title }}</a>
+        </li>{% endfor %}
+    </ul>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/showfilelist.html b/WebKitTools/TestResultServer/templates/showfilelist.html
new file mode 100644
index 0000000..fa72b7f
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/showfilelist.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test Results</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/testfile.css" />
+</head>
+<body>
+<h1>Test Results
+{% if builder or test_type or name %}
+- {{ builder }} {{test_type }} {{ name }}
+{% endif %}
+</h1>
+<div>
+    <table>
+        <tr>
+            <th>Builder</th>
+            <th>Test Type</th>
+            <th>File</th>
+            <th>Date</th>
+            {% if admin %}
+            <th></th>
+            {% endif %}
+        {% for file in files %}
+        <tr>{% if file.builder and file.name %}
+            <td><a href="/testfile?builder={{ file.builder }}" >
+                {{ file.builder }}
+                </a>
+            </td>
+            <td>{% if file.test_type %}
+                <a href="/testfile?testtype={{ file.test_type }}" >
+                {{ file.test_type }}
+                </a>
+                {% endif %}
+            </td>
+            <td><a href="/testfile?builder={{ file.builder }}&name={{ file.name }}" >
+                {{ file.name }}
+                </a>
+            </td>
+            <td>{{ file.date|date:"d-M-Y H:i:s" }}
+            </td>
+            {% if admin %}
+            <td><a href="/testfile/delete?key={{ file.key }}&builder={{ builder }}&name={{ name }}" >
+                Delete
+                </a>
+            </td>
+            {% endif %}
+        {% endif %}
+        </tr>
+    {% endfor %}
+    </table>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/uploadform.html b/WebKitTools/TestResultServer/templates/uploadform.html
new file mode 100644
index 0000000..933f9f5
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/uploadform.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Upload Test Result File</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/form.css" />
+</head>
+<body>
+<h1>Upload Test Result File</h1>
+<form id="uploadForm" name="test_result_upload" accept="text/html" action="{{ upload_url }}" enctype="multipart/form-data" method="post">
+    <br>
+    <table>
+    <tr>
+        <td class=label><label>Builder:</label></td>
+        <td><input class=inputtext type="text" name="builder" value="Webkit"/></td>
+    </tr>
+    <tr>
+        <td class=label><label>Test Type:</label></td>
+        <td><input class=inputtext type="text" name="testtype" value=""/></td>
+    </tr>
+    </table>
+    <div><input class=button type="file" name="file" multiple></div>
+    <br>
+    <div><input class=button type="submit" value="Upload"></div>
+</form>
+</body>
+</html>
diff --git a/WebKitTools/WinLauncher/WinLauncher.h b/WebKitTools/WinLauncher/WinLauncher.h
index adc2b17..6488285 100644
--- a/WebKitTools/WinLauncher/WinLauncher.h
+++ b/WebKitTools/WinLauncher/WinLauncher.h
@@ -1,115 +1,115 @@
-/*

- * Copyright (C) 2006 Apple Computer, 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 COMPUTER, 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. 

- */

-

-#pragma once

-

-#include "resource.h"

-#include <WebKit/WebKit.h>

-

-class WinLauncherWebHost : public IWebFrameLoadDelegate

-{

-public:

-    WinLauncherWebHost() : m_refCount(1) {}

-

-    // IUnknown

-    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);

-    virtual ULONG STDMETHODCALLTYPE AddRef(void);

-    virtual ULONG STDMETHODCALLTYPE Release(void);

-

-    // IWebFrameLoadDelegate

-    virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( 

-        /* [in] */ IWebView* webView,

-        /* [in] */ IWebFrame* /*frame*/) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebError *error,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }

-    

-    virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ BSTR title,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ OLE_HANDLE hBitmap,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( 

-        /* [in] */ IWebView* webView,

-        /* [in] */ IWebFrame* /*frame*/) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebError *error,

-        /* [in] */ IWebFrame *forFrame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-

-    virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ BSTR url,

-        /* [in] */ double delaySeconds,

-        /* [in] */ DATE fireDate,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual HRESULT STDMETHODCALLTYPE willCloseFrame( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-    

-    virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ JSContextRef context,

-        /* [in] */ JSObjectRef windowScriptObject)  { return S_OK; }

-

-    virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject( 

-        /* [in] */ IWebView *webView,

-        /* [in] */ JSContextRef context,

-        /* [in] */ JSObjectRef windowScriptObject,

-        /* [in] */ IWebFrame *frame) { return S_OK; }

-

-    // WinLauncherWebHost

-

-protected:

-    HRESULT updateAddressBar(IWebView* webView);

-

-protected:

-    ULONG                   m_refCount;

-};

+/*
+ * Copyright (C) 2006 Apple Computer, 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 COMPUTER, 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. 
+ */
+
+#pragma once
+
+#include "resource.h"
+#include <WebKit/WebKit.h>
+
+class WinLauncherWebHost : public IWebFrameLoadDelegate
+{
+public:
+    WinLauncherWebHost() : m_refCount(1) {}
+
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+    virtual ULONG STDMETHODCALLTYPE AddRef(void);
+    virtual ULONG STDMETHODCALLTYPE Release(void);
+
+    // IWebFrameLoadDelegate
+    virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( 
+        /* [in] */ IWebView* webView,
+        /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebError *error,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ BSTR title,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ OLE_HANDLE hBitmap,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( 
+        /* [in] */ IWebView* webView,
+        /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebError *error,
+        /* [in] */ IWebFrame *forFrame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+
+    virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ BSTR url,
+        /* [in] */ double delaySeconds,
+        /* [in] */ DATE fireDate,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE willCloseFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ JSContextRef context,
+        /* [in] */ JSObjectRef windowScriptObject)  { return S_OK; }
+
+    virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ JSContextRef context,
+        /* [in] */ JSObjectRef windowScriptObject,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+
+    // WinLauncherWebHost
+
+protected:
+    HRESULT updateAddressBar(IWebView* webView);
+
+protected:
+    ULONG                   m_refCount;
+};
diff --git a/WebKitTools/gdb/webcore.py b/WebKitTools/gdb/webcore.py
new file mode 100644
index 0000000..83886f8
--- /dev/null
+++ b/WebKitTools/gdb/webcore.py
@@ -0,0 +1,195 @@
+# 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.
+
+"""GDB support for WebKit types.
+
+Add this to your gdb by amending your ~/.gdbinit as follows:
+  python
+  import sys
+  sys.path.insert(0, "/path/to/tools/gdb/")
+  import webcore
+"""
+
+import gdb
+import struct
+
+def ustring_to_string(ptr, length=None):
+    """Convert a pointer to UTF-16 data into a Python Unicode string.
+
+    ptr and length are both gdb.Value objects.
+    If length is unspecified, will guess at the length."""
+    extra = ''
+    if length is None:
+        # Try to guess at the length.
+        for i in xrange(0, 2048):
+            if int((ptr + i).dereference()) == 0:
+                length = i
+                break
+        if length is None:
+            length = 256
+            extra = u' (no trailing NUL found)'
+    else:
+        length = int(length)
+
+    char_vals = [int((ptr + i).dereference()) for i in xrange(length)]
+    string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace')
+
+    return string + extra
+
+
+class StringPrinter(object):
+    "Shared code between different string-printing classes"
+    def __init__(self, val):
+        self.val = val
+
+    def display_hint(self):
+        return 'string'
+
+
+class UCharStringPrinter(StringPrinter):
+    "Print a UChar*; we must guess at the length"
+    def to_string(self):
+        return ustring_to_string(self.val)
+
+
+class WebCoreAtomicStringPrinter(StringPrinter):
+    "Print a WebCore::AtomicString"
+    def to_string(self):
+        return self.val['m_string']
+
+
+class WebCoreStringPrinter(StringPrinter):
+    "Print a WebCore::String"
+    def get_length(self):
+        if not self.val['m_impl']['m_ptr']:
+            return 0
+        return self.val['m_impl']['m_ptr']['m_length']
+
+    def to_string(self):
+        if self.get_length() == 0:
+            return '(null)'
+
+        return ustring_to_string(self.val['m_impl']['m_ptr']['m_data'],
+                                 self.get_length())
+
+
+class WebCoreQualifiedNamePrinter(StringPrinter):
+    "Print a WebCore::QualifiedName"
+
+    def __init__(self, val):
+        super(WebCoreQualifiedNamePrinter, self).__init__(val)
+        self.prefix_length = 0
+        self.length = 0
+        if self.val['m_impl']:
+            self.prefix_printer = WebCoreStringPrinter(
+                self.val['m_impl']['m_prefix']['m_string'])
+            self.local_name_printer = WebCoreStringPrinter(
+                self.val['m_impl']['m_localName']['m_string'])
+            self.prefix_length = self.prefix_printer.get_length()
+            if self.prefix_length > 0:
+                self.length = (self.prefix_length + 1 +
+                    self.local_name_printer.get_length())
+            else:
+                self.length = self.local_name_printer.get_length()
+
+    def get_length(self):
+        return self.length
+
+    def to_string(self):
+        if self.get_length() == 0:
+            return "(null)"
+        else:
+            if self.prefix_length > 0:
+                return (self.prefix_printer.to_string() + ":" +
+                    self.local_name_printer.to_string())
+            else:
+                return self.local_name_printer.to_string()
+
+
+
+def lookup_function(val):
+    """Function used to load pretty printers; will be passed to GDB."""
+    lookup_tag = val.type.tag
+    printers = {
+        "WebCore::AtomicString": WebCoreAtomicStringPrinter,
+        "WebCore::String": WebCoreStringPrinter,
+        "WebCore::QualifiedName": WebCoreQualifiedNamePrinter,
+    }
+    name = val.type.tag
+    if name in printers:
+        return printers[name](val)
+
+    if val.type.code == gdb.TYPE_CODE_PTR:
+        name = str(val.type.target().unqualified())
+        if name == 'UChar':
+            return UCharStringPrinter(val)
+
+    return None
+
+
+gdb.pretty_printers.append(lookup_function)
+
+
+
+class PrintPathToRootCommand(gdb.Command):
+  """Command for printing WebKit Node trees.
+Usage: printpathtoroot variable_name
+"""
+
+  def __init__(self):
+      super(PrintPathToRootCommand, self).__init__("printpathtoroot",
+          gdb.COMMAND_SUPPORT,
+          gdb.COMPLETE_NONE)
+
+  def invoke(self, arg, from_tty):
+      element_type = gdb.lookup_type('WebCore::Element')
+      node_type = gdb.lookup_type('WebCore::Node')
+      frame = gdb.selected_frame()
+      try:
+          val = gdb.Frame.read_var(frame, arg)
+      except:
+          print "No such variable, or invalid type"
+          return
+
+      target_type = str(val.type.target().strip_typedefs())
+      if target_type == str(node_type):
+          stack = []
+          while val:
+              stack.append([val,
+                  val.cast(element_type.pointer()).dereference()['m_tagName']])
+              val = val.dereference()['m_parent']
+
+          padding = ''
+          while len(stack) > 0:
+              pair = stack.pop()
+              print padding, pair[1], pair[0]
+              padding = padding + '  '
+      else:
+          print 'Sorry: I don\'t know how to deal with %s yet.' % target_type
+
+PrintPathToRootCommand()
diff --git a/WebKitTools/iExploder/htdocs/cssproperties.in b/WebKitTools/iExploder/htdocs/cssproperties.in
index 52ccdbe..fc2ee50 100644
--- a/WebKitTools/iExploder/htdocs/cssproperties.in
+++ b/WebKitTools/iExploder/htdocs/cssproperties.in
@@ -1,8 +1,9 @@
-# From WebKit svn r53119 (WebCore/css/CSSPropertyNames.in)
+# From WebKit svn r55658 (WebCore/css/CSSPropertyNames.in)
 -webkit-animation
 -webkit-animation-delay
 -webkit-animation-direction
 -webkit-animation-duration
+-webkit-animation-fill-mode
 -webkit-animation-iteration-count
 -webkit-animation-name
 -webkit-animation-play-state
diff --git a/WebKitTools/iExploder/htdocs/htmlattrs.in b/WebKitTools/iExploder/htdocs/htmlattrs.in
index 2238427..56b4050 100644
--- a/WebKitTools/iExploder/htdocs/htmlattrs.in
+++ b/WebKitTools/iExploder/htdocs/htmlattrs.in
@@ -1,4 +1,4 @@
-# From WebKit svn r53119 (WebCore/html/HTMLAttributeNames.in)
+# From WebKit svn r55658 (WebCore/html/HTMLAttributeNames.in)
 abbr
 accept
 accept_charset
@@ -19,6 +19,7 @@
 aria-expanded
 aria-flowto
 aria-grabbed
+aria-haspopup
 aria-hidden
 aria-label
 aria-labeledby
@@ -37,7 +38,6 @@
 aria-valuemin
 aria-valuenow
 aria-valuetext
-autobuffer
 autocomplete
 autofocus
 autoplay
@@ -83,6 +83,7 @@
 draggable
 enctype
 end
+event
 expanded
 face
 focused
@@ -198,6 +199,7 @@
 onsubmit
 onsuspend
 ontimeupdate
+ontouchcancel
 ontouchend
 ontouchmove
 ontouchstart
@@ -216,6 +218,7 @@
 pluginurl
 poster
 precision
+preload
 primary
 profile
 progress
@@ -268,6 +271,9 @@
 width
 wrap
 
+# Removed from WebKit between r53119 and r56558
+autobuffer
+
 # Removed from WebKit between r14011 and r53119
 left
 pagex
diff --git a/WebKitTools/iExploder/htdocs/htmltags.in b/WebKitTools/iExploder/htdocs/htmltags.in
index b47dd9c..f01d2a7 100644
--- a/WebKitTools/iExploder/htdocs/htmltags.in
+++ b/WebKitTools/iExploder/htdocs/htmltags.in
@@ -1,4 +1,4 @@
-# From WebKit svn r53119 (WebCore/html/HTMLTagNames.in)
+# From WebKit svn r55658 (WebCore/html/HTMLTagNames.in)
 a
 abbr
 acronym
diff --git a/WebKitTools/pywebsocket/example/echo_client.py b/WebKitTools/pywebsocket/example/echo_client.py
deleted file mode 100644
index 3262a6d..0000000
--- a/WebKitTools/pywebsocket/example/echo_client.py
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, 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.
-
-
-"""Web Socket Echo client.
-
-This is an example Web Socket client that talks with echo_wsh.py.
-This may be useful for checking mod_pywebsocket installation.
-
-Note:
-This code is far from robust, e.g., we cut corners in handshake.
-"""
-
-
-import codecs
-from optparse import OptionParser
-import socket
-import sys
-
-
-_TIMEOUT_SEC = 10
-
-_DEFAULT_PORT = 80
-_DEFAULT_SECURE_PORT = 443
-_UNDEFINED_PORT = -1
-
-_UPGRADE_HEADER = 'Upgrade: WebSocket\r\n'
-_CONNECTION_HEADER = 'Connection: Upgrade\r\n'
-_EXPECTED_RESPONSE = (
-        'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
-        _UPGRADE_HEADER +
-        _CONNECTION_HEADER)
-
-_GOODBYE_MESSAGE = 'Goodbye'
-
-
-def _method_line(resource):
-    return 'GET %s HTTP/1.1\r\n' % resource
-
-
-def _origin_header(origin):
-    return 'Origin: %s\r\n' % origin
-
-
-class _TLSSocket(object):
-    """Wrapper for a TLS connection."""
-
-    def __init__(self, raw_socket):
-        self._ssl = socket.ssl(raw_socket)
-
-    def send(self, bytes):
-        return self._ssl.write(bytes)
-
-    def recv(self, size=-1):
-        return self._ssl.read(size)
-
-    def close(self):
-        # Nothing to do.
-        pass
-
-
-class EchoClient(object):
-    """Web Socket echo client."""
-
-    def __init__(self, options):
-        self._options = options
-        self._socket = None
-
-    def run(self):
-        """Run the client.
-
-        Shake hands and then repeat sending message and receiving its echo.
-        """
-        self._socket = socket.socket()
-        self._socket.settimeout(self._options.socket_timeout)
-        try:
-            self._socket.connect((self._options.server_host,
-                                  self._options.server_port))
-            if self._options.use_tls:
-                self._socket = _TLSSocket(self._socket)
-            self._handshake()
-            for line in self._options.message.split(',') + [_GOODBYE_MESSAGE]:
-                frame = '\x00' + line.encode('utf-8') + '\xff'
-                self._socket.send(frame)
-                if self._options.verbose:
-                    print 'Send: %s' % line
-                received = self._socket.recv(len(frame))
-                if received != frame:
-                    raise Exception('Incorrect echo: %r' % received)
-                if self._options.verbose:
-                    print 'Recv: %s' % received[1:-1].decode('utf-8',
-                                                             'replace')
-        finally:
-            self._socket.close()
-
-    def _handshake(self):
-        self._socket.send(_method_line(self._options.resource))
-        self._socket.send(_UPGRADE_HEADER)
-        self._socket.send(_CONNECTION_HEADER)
-        self._socket.send(self._format_host_header())
-        self._socket.send(_origin_header(self._options.origin))
-        self._socket.send('\r\n')
-
-        for expected_char in _EXPECTED_RESPONSE:
-            received = self._socket.recv(1)[0]
-            if expected_char != received:
-                raise Exception('Handshake failure')
-        # We cut corners and skip other headers.
-        self._skip_headers()
-
-    def _skip_headers(self):
-        terminator = '\r\n\r\n'
-        pos = 0
-        while pos < len(terminator):
-            received = self._socket.recv(1)[0]
-            if received == terminator[pos]:
-                pos += 1
-            elif received == terminator[0]:
-                pos = 1
-            else:
-                pos = 0
-
-    def _format_host_header(self):
-        host = 'Host: ' + self._options.server_host
-        if ((not self._options.use_tls and
-             self._options.server_port != _DEFAULT_PORT) or
-            (self._options.use_tls and
-             self._options.server_port != _DEFAULT_SECURE_PORT)):
-            host += ':' + str(self._options.server_port)
-        host += '\r\n'
-        return host
-
-
-def main():
-    sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
-
-    parser = OptionParser()
-    parser.add_option('-s', '--server_host', dest='server_host', type='string',
-                      default='localhost', help='server host')
-    parser.add_option('-p', '--server_port', dest='server_port', type='int',
-                      default=_UNDEFINED_PORT, help='server port')
-    parser.add_option('-o', '--origin', dest='origin', type='string',
-                      default='http://localhost/', help='origin')
-    parser.add_option('-r', '--resource', dest='resource', type='string',
-                      default='/echo', help='resource path')
-    parser.add_option('-m', '--message', dest='message', type='string',
-                      help=('comma-separated messages to send excluding "%s" '
-                            'that is always sent at the end' %
-                            _GOODBYE_MESSAGE))
-    parser.add_option('-q', '--quiet', dest='verbose', action='store_false',
-                      default=True, help='suppress messages')
-    parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
-                      default=False, help='use TLS (wss://)')
-    parser.add_option('-k', '--socket_timeout', dest='socket_timeout',
-                      type='int', default=_TIMEOUT_SEC,
-                      help='Timeout(sec) for sockets')
-
-    (options, unused_args) = parser.parse_args()
-
-    # Default port number depends on whether TLS is used.
-    if options.server_port == _UNDEFINED_PORT:
-        if options.use_tls:
-            options.server_port = _DEFAULT_SECURE_PORT
-        else:
-            options.server_port = _DEFAULT_PORT
-
-    # optparse doesn't seem to handle non-ascii default values.
-    # Set default message here.
-    if not options.message:
-        options.message = u'Hello,\u65e5\u672c'   # "Japan" in Japanese
-
-    EchoClient(options).run()
-
-
-if __name__ == '__main__':
-    main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py b/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py
deleted file mode 100644
index 8628ff9..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py
+++ /dev/null
@@ -1,421 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, 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.
-
-
-"""Standalone Web Socket server.
-
-Use this server to run mod_pywebsocket without Apache HTTP Server.
-
-Usage:
-    python standalone.py [-p <ws_port>] [-w <websock_handlers>]
-                         [-s <scan_dir>]
-                         [-d <document_root>]
-                         [-m <websock_handlers_map_file>]
-                         ... for other options, see _main below ...
-
-<ws_port> is the port number to use for ws:// connection.
-
-<document_root> is the path to the root directory of HTML files.
-
-<websock_handlers> is the path to the root directory of Web Socket handlers.
-See __init__.py for details of <websock_handlers> and how to write Web Socket
-handlers. If this path is relative, <document_root> is used as the base.
-
-<scan_dir> is a path under the root directory. If specified, only the handlers
-under scan_dir are scanned. This is useful in saving scan time.
-
-Note:
-This server is derived from SocketServer.ThreadingMixIn. Hence a thread is
-used for each request.
-"""
-
-import BaseHTTPServer
-import CGIHTTPServer
-import SimpleHTTPServer
-import SocketServer
-import logging
-import logging.handlers
-import optparse
-import os
-import re
-import socket
-import sys
-
-_HAS_OPEN_SSL = False
-try:
-    import OpenSSL.SSL
-    _HAS_OPEN_SSL = True
-except ImportError:
-    pass
-
-import dispatch
-import handshake
-import memorizingfile
-import util
-
-
-_LOG_LEVELS = {
-    'debug': logging.DEBUG,
-    'info': logging.INFO,
-    'warn': logging.WARN,
-    'error': logging.ERROR,
-    'critical': logging.CRITICAL};
-
-_DEFAULT_LOG_MAX_BYTES = 1024 * 256
-_DEFAULT_LOG_BACKUP_COUNT = 5
-
-_DEFAULT_REQUEST_QUEUE_SIZE = 128
-
-# 1024 is practically large enough to contain WebSocket handshake lines.
-_MAX_MEMORIZED_LINES = 1024
-
-def _print_warnings_if_any(dispatcher):
-    warnings = dispatcher.source_warnings()
-    if warnings:
-        for warning in warnings:
-            logging.warning('mod_pywebsocket: %s' % warning)
-
-
-class _StandaloneConnection(object):
-    """Mimic mod_python mp_conn."""
-
-    def __init__(self, request_handler):
-        """Construct an instance.
-
-        Args:
-            request_handler: A WebSocketRequestHandler instance.
-        """
-        self._request_handler = request_handler
-
-    def get_local_addr(self):
-        """Getter to mimic mp_conn.local_addr."""
-        return (self._request_handler.server.server_name,
-                self._request_handler.server.server_port)
-    local_addr = property(get_local_addr)
-
-    def get_remote_addr(self):
-        """Getter to mimic mp_conn.remote_addr.
-
-        Setting the property in __init__ won't work because the request
-        handler is not initialized yet there."""
-        return self._request_handler.client_address
-    remote_addr = property(get_remote_addr)
-
-    def write(self, data):
-        """Mimic mp_conn.write()."""
-        return self._request_handler.wfile.write(data)
-
-    def read(self, length):
-        """Mimic mp_conn.read()."""
-        return self._request_handler.rfile.read(length)
-
-    def get_memorized_lines(self):
-        """Get memorized lines."""
-        return self._request_handler.rfile.get_memorized_lines()
-
-
-class _StandaloneRequest(object):
-    """Mimic mod_python request."""
-
-    def __init__(self, request_handler, use_tls):
-        """Construct an instance.
-
-        Args:
-            request_handler: A WebSocketRequestHandler instance.
-        """
-        self._request_handler = request_handler
-        self.connection = _StandaloneConnection(request_handler)
-        self._use_tls = use_tls
-
-    def get_uri(self):
-        """Getter to mimic request.uri."""
-        return self._request_handler.path
-    uri = property(get_uri)
-
-    def get_headers_in(self):
-        """Getter to mimic request.headers_in."""
-        return self._request_handler.headers
-    headers_in = property(get_headers_in)
-
-    def is_https(self):
-        """Mimic request.is_https()."""
-        return self._use_tls
-
-
-class WebSocketServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
-    """HTTPServer specialized for Web Socket."""
-
-    SocketServer.ThreadingMixIn.daemon_threads = True
-
-    def __init__(self, server_address, RequestHandlerClass):
-        """Override SocketServer.BaseServer.__init__."""
-
-        SocketServer.BaseServer.__init__(
-                self, server_address, RequestHandlerClass)
-        self.socket = self._create_socket()
-        self.server_bind()
-        self.server_activate()
-
-    def _create_socket(self):
-        socket_ = socket.socket(self.address_family, self.socket_type)
-        if WebSocketServer.options.use_tls:
-            ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
-            ctx.use_privatekey_file(WebSocketServer.options.private_key)
-            ctx.use_certificate_file(WebSocketServer.options.certificate)
-            socket_ = OpenSSL.SSL.Connection(ctx, socket_)
-        return socket_
-
-    def handle_error(self, rquest, client_address):
-        """Override SocketServer.handle_error."""
-
-        logging.error(
-            ('Exception in processing request from: %r' % (client_address,)) +
-            '\n' + util.get_stack_trace())
-        # Note: client_address is a tuple. To match it against %r, we need the
-        # trailing comma.
-
-
-class WebSocketRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
-    """CGIHTTPRequestHandler specialized for Web Socket."""
-
-    def setup(self):
-        """Override SocketServer.StreamRequestHandler.setup."""
-
-        self.connection = self.request
-        self.rfile = memorizingfile.MemorizingFile(
-                socket._fileobject(self.request, 'rb', self.rbufsize),
-                max_memorized_lines=_MAX_MEMORIZED_LINES)
-        self.wfile = socket._fileobject(self.request, 'wb', self.wbufsize)
-
-    def __init__(self, *args, **keywords):
-        self._request = _StandaloneRequest(
-                self, WebSocketRequestHandler.options.use_tls)
-        self._dispatcher = WebSocketRequestHandler.options.dispatcher
-        self._print_warnings_if_any()
-        self._handshaker = handshake.Handshaker(
-                self._request, self._dispatcher,
-                WebSocketRequestHandler.options.strict)
-        CGIHTTPServer.CGIHTTPRequestHandler.__init__(
-                self, *args, **keywords)
-
-    def _print_warnings_if_any(self):
-        warnings = self._dispatcher.source_warnings()
-        if warnings:
-            for warning in warnings:
-                logging.warning('mod_pywebsocket: %s' % warning)
-
-    def parse_request(self):
-        """Override BaseHTTPServer.BaseHTTPRequestHandler.parse_request.
-
-        Return True to continue processing for HTTP(S), False otherwise.
-        """
-        result = CGIHTTPServer.CGIHTTPRequestHandler.parse_request(self)
-        if result:
-            try:
-                self._handshaker.do_handshake()
-                self._dispatcher.transfer_data(self._request)
-                return False
-            except handshake.HandshakeError, e:
-                # Handshake for ws(s) failed. Assume http(s).
-                logging.info('mod_pywebsocket: %s' % e)
-                return True
-            except dispatch.DispatchError, e:
-                logging.warning('mod_pywebsocket: %s' % e)
-                return False
-            except Exception, e:
-                logging.warning('mod_pywebsocket: %s' % e)
-                logging.info('mod_pywebsocket: %s' % util.get_stack_trace())
-                return False
-        return result
-
-    def log_request(self, code='-', size='-'):
-        """Override BaseHTTPServer.log_request."""
-
-        logging.info('"%s" %s %s',
-                     self.requestline, str(code), str(size))
-
-    def log_error(self, *args):
-        """Override BaseHTTPServer.log_error."""
-
-        # Despite the name, this method is for warnings than for errors.
-        # For example, HTTP status code is logged by this method.
-        logging.warn('%s - %s' % (self.address_string(), (args[0] % args[1:])))
-
-    def is_cgi(self):
-        """Test whether self.path corresponds to a CGI script.
-
-        Add extra check that self.path doesn't contains .."""
-        if CGIHTTPServer.CGIHTTPRequestHandler.is_cgi(self):
-            if '..' in self.path:
-                return False
-            return True
-        return False
-
-
-def _configure_logging(options):
-    logger = logging.getLogger()
-    logger.setLevel(_LOG_LEVELS[options.log_level])
-    if options.log_file:
-        handler = logging.handlers.RotatingFileHandler(
-                options.log_file, 'a', options.log_max, options.log_count)
-    else:
-        handler = logging.StreamHandler()
-    formatter = logging.Formatter(
-            "[%(asctime)s] [%(levelname)s] %(name)s: %(message)s")
-    handler.setFormatter(formatter)
-    logger.addHandler(handler)
-
-def _alias_handlers(dispatcher, websock_handlers_map_file):
-    """Set aliases specified in websock_handler_map_file in dispatcher.
-
-    Args:
-        dispatcher: dispatch.Dispatcher instance
-        websock_handler_map_file: alias map file
-    """
-    fp = open(websock_handlers_map_file)
-    try:
-        for line in fp:
-            if line[0] == '#' or line.isspace():
-                continue
-            m = re.match('(\S+)\s+(\S+)', line)
-            if not m:
-                logging.warning('Wrong format in map file:' + line)
-                continue
-            try:
-                dispatcher.add_resource_path_alias(
-                    m.group(1), m.group(2))
-            except dispatch.DispatchError, e:
-                logging.error(str(e))
-    finally:
-        fp.close()
-
-
-
-def _main():
-    parser = optparse.OptionParser()
-    parser.add_option('-p', '--port', dest='port', type='int',
-                      default=handshake._DEFAULT_WEB_SOCKET_PORT,
-                      help='port to listen to')
-    parser.add_option('-w', '--websock_handlers', dest='websock_handlers',
-                      default='.',
-                      help='Web Socket handlers root directory.')
-    parser.add_option('-m', '--websock_handlers_map_file',
-                      dest='websock_handlers_map_file',
-                      default=None,
-                      help=('Web Socket handlers map file. '
-                            'Each line consists of alias_resource_path and '
-                            'existing_resource_path, separated by spaces.'))
-    parser.add_option('-s', '--scan_dir', dest='scan_dir',
-                      default=None,
-                      help=('Web Socket handlers scan directory. '
-                            'Must be a directory under websock_handlers.'))
-    parser.add_option('-d', '--document_root', dest='document_root',
-                      default='.',
-                      help='Document root directory.')
-    parser.add_option('-x', '--cgi_paths', dest='cgi_paths',
-                      default=None,
-                      help=('CGI paths relative to document_root.'
-                            'Comma-separated. (e.g -x /cgi,/htbin) '
-                            'Files under document_root/cgi_path are handled '
-                            'as CGI programs. Must be executable.'))
-    parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
-                      default=False, help='use TLS (wss://)')
-    parser.add_option('-k', '--private_key', dest='private_key',
-                      default='', help='TLS private key file.')
-    parser.add_option('-c', '--certificate', dest='certificate',
-                      default='', help='TLS certificate file.')
-    parser.add_option('-l', '--log_file', dest='log_file',
-                      default='', help='Log file.')
-    parser.add_option('--log_level', type='choice', dest='log_level',
-                      default='warn',
-                      choices=['debug', 'info', 'warn', 'error', 'critical'],
-                      help='Log level.')
-    parser.add_option('--log_max', dest='log_max', type='int',
-                      default=_DEFAULT_LOG_MAX_BYTES,
-                      help='Log maximum bytes')
-    parser.add_option('--log_count', dest='log_count', type='int',
-                      default=_DEFAULT_LOG_BACKUP_COUNT,
-                      help='Log backup count')
-    parser.add_option('--strict', dest='strict', action='store_true',
-                      default=False, help='Strictly check handshake request')
-    parser.add_option('-q', '--queue', dest='request_queue_size', type='int',
-                      default=_DEFAULT_REQUEST_QUEUE_SIZE,
-                      help='request queue size')
-    options = parser.parse_args()[0]
-
-    os.chdir(options.document_root)
-
-    _configure_logging(options)
-
-    SocketServer.TCPServer.request_queue_size = options.request_queue_size
-    CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = []
-
-    if options.cgi_paths:
-        CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = \
-            options.cgi_paths.split(',')
-
-    if options.use_tls:
-        if not _HAS_OPEN_SSL:
-            logging.critical('To use TLS, install pyOpenSSL.')
-            sys.exit(1)
-        if not options.private_key or not options.certificate:
-            logging.critical(
-                    'To use TLS, specify private_key and certificate.')
-            sys.exit(1)
-
-    if not options.scan_dir:
-        options.scan_dir = options.websock_handlers
-
-    try:
-        # Share a Dispatcher among request handlers to save time for
-        # instantiation.  Dispatcher can be shared because it is thread-safe.
-        options.dispatcher = dispatch.Dispatcher(options.websock_handlers,
-                                                 options.scan_dir)
-        if options.websock_handlers_map_file:
-            _alias_handlers(options.dispatcher,
-                            options.websock_handlers_map_file)
-        _print_warnings_if_any(options.dispatcher)
-
-        WebSocketRequestHandler.options = options
-        WebSocketServer.options = options
-
-        server = WebSocketServer(('', options.port), WebSocketRequestHandler)
-        server.serve_forever()
-    except Exception, e:
-        logging.critical(str(e))
-        sys.exit(1)
-
-
-if __name__ == '__main__':
-    _main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/util.py b/WebKitTools/pywebsocket/mod_pywebsocket/util.py
deleted file mode 100644
index 0ea8053..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/util.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2009, 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.
-
-
-"""Web Sockets utilities.
-"""
-
-
-import StringIO
-import traceback
-
-
-def get_stack_trace():
-    """Get the current stack trace as string.
-
-    This is needed to support Python 2.3.
-    TODO: Remove this when we only support Python 2.4 and above.
-          Use traceback.format_exc instead.
-    """
-
-    out = StringIO.StringIO()
-    traceback.print_exc(file=out)
-    return out.getvalue()
-
-
-def prepend_message_to_exception(message, exc):
-    """Prepend message to the exception."""
-
-    exc.args = (message + str(exc),)
-    return
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/setup.py b/WebKitTools/pywebsocket/setup.py
deleted file mode 100644
index 9729322..0000000
--- a/WebKitTools/pywebsocket/setup.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, 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.
-
-
-"""Set up script for mod_pywebsocket.
-"""
-
-
-from distutils.core import setup
-import sys
-
-
-_PACKAGE_NAME = 'mod_pywebsocket'
-
-if sys.version < '2.3':
-    print >>sys.stderr, '%s requires Python 2.3 or later.' % _PACKAGE_NAME
-    sys.exit(1)
-
-setup(author='Yuzo Fujishima',
-      author_email='yuzo@chromium.org',
-      description='Web Socket extension for Apache HTTP Server.',
-      long_description=(
-              'mod_pywebsocket is an Apache HTTP Server extension for '
-              'Web Socket (http://tools.ietf.org/html/'
-              'draft-hixie-thewebsocketprotocol). '
-              'See mod_pywebsocket/__init__.py for more detail.'),
-      license='See COPYING',
-      name=_PACKAGE_NAME,
-      packages=[_PACKAGE_NAME],
-      url='http://code.google.com/p/pywebsocket/',
-      version='0.4.8',
-      )
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_util.py b/WebKitTools/pywebsocket/test/test_util.py
deleted file mode 100644
index 83e2635..0000000
--- a/WebKitTools/pywebsocket/test/test_util.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, 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.
-
-
-"""Tests for util module."""
-
-
-import unittest
-
-import config  # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import util
-
-
-class UtilTest(unittest.TestCase):
-    def test_get_stack_trace(self):
-        self.assertEqual('None\n', util.get_stack_trace())
-        try:
-            a = 1 / 0  # Intentionally raise exception.
-        except Exception:
-            trace = util.get_stack_trace()
-            self.failUnless(trace.startswith('Traceback'))
-            self.failUnless(trace.find('ZeroDivisionError') != -1)
-
-    def test_prepend_message_to_exception(self):
-        exc = Exception('World')
-        self.assertEqual('World', str(exc))
-        util.prepend_message_to_exception('Hello ', exc)
-        self.assertEqual('Hello World', str(exc))
-
-
-if __name__ == '__main__':
-    unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/simplejson/decoder.py b/WebKitTools/simplejson/decoder.py
deleted file mode 100644
index a1b53b2..0000000
--- a/WebKitTools/simplejson/decoder.py
+++ /dev/null
@@ -1,273 +0,0 @@
-"""
-Implementation of JSONDecoder
-"""
-import re
-
-from simplejson.scanner import Scanner, pattern
-
-FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
-
-def _floatconstants():
-    import struct
-    import sys
-    _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
-    if sys.byteorder != 'big':
-        _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
-    nan, inf = struct.unpack('dd', _BYTES)
-    return nan, inf, -inf
-
-NaN, PosInf, NegInf = _floatconstants()
-
-def linecol(doc, pos):
-    lineno = doc.count('\n', 0, pos) + 1
-    if lineno == 1:
-        colno = pos
-    else:
-        colno = pos - doc.rindex('\n', 0, pos)
-    return lineno, colno
-
-def errmsg(msg, doc, pos, end=None):
-    lineno, colno = linecol(doc, pos)
-    if end is None:
-        return '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos)
-    endlineno, endcolno = linecol(doc, end)
-    return '%s: line %d column %d - line %d column %d (char %d - %d)' % (
-        msg, lineno, colno, endlineno, endcolno, pos, end)
-
-_CONSTANTS = {
-    '-Infinity': NegInf,
-    'Infinity': PosInf,
-    'NaN': NaN,
-    'true': True,
-    'false': False,
-    'null': None,
-}
-
-def JSONConstant(match, context, c=_CONSTANTS):
-    return c[match.group(0)], None
-pattern('(-?Infinity|NaN|true|false|null)')(JSONConstant)
-
-def JSONNumber(match, context):
-    match = JSONNumber.regex.match(match.string, *match.span())
-    integer, frac, exp = match.groups()
-    if frac or exp:
-        res = float(integer + (frac or '') + (exp or ''))
-    else:
-        res = int(integer)
-    return res, None
-pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(JSONNumber)
-
-STRINGCHUNK = re.compile(r'(.*?)(["\\])', FLAGS)
-BACKSLASH = {
-    '"': u'"', '\\': u'\\', '/': u'/',
-    'b': u'\b', 'f': u'\f', 'n': u'\n', 'r': u'\r', 't': u'\t',
-}
-
-DEFAULT_ENCODING = "utf-8"
-
-def scanstring(s, end, encoding=None, _b=BACKSLASH, _m=STRINGCHUNK.match):
-    if encoding is None:
-        encoding = DEFAULT_ENCODING
-    chunks = []
-    _append = chunks.append
-    begin = end - 1
-    while 1:
-        chunk = _m(s, end)
-        if chunk is None:
-            raise ValueError(
-                errmsg("Unterminated string starting at", s, begin))
-        end = chunk.end()
-        content, terminator = chunk.groups()
-        if content:
-            if not isinstance(content, unicode):
-                content = unicode(content, encoding)
-            _append(content)
-        if terminator == '"':
-            break
-        try:
-            esc = s[end]
-        except IndexError:
-            raise ValueError(
-                errmsg("Unterminated string starting at", s, begin))
-        if esc != 'u':
-            try:
-                m = _b[esc]
-            except KeyError:
-                raise ValueError(
-                    errmsg("Invalid \\escape: %r" % (esc,), s, end))
-            end += 1
-        else:
-            esc = s[end + 1:end + 5]
-            try:
-                m = unichr(int(esc, 16))
-                if len(esc) != 4 or not esc.isalnum():
-                    raise ValueError
-            except ValueError:
-                raise ValueError(errmsg("Invalid \\uXXXX escape", s, end))
-            end += 5
-        _append(m)
-    return u''.join(chunks), end
-
-def JSONString(match, context):
-    encoding = getattr(context, 'encoding', None)
-    return scanstring(match.string, match.end(), encoding)
-pattern(r'"')(JSONString)
-
-WHITESPACE = re.compile(r'\s*', FLAGS)
-
-def JSONObject(match, context, _w=WHITESPACE.match):
-    pairs = {}
-    s = match.string
-    end = _w(s, match.end()).end()
-    nextchar = s[end:end + 1]
-    # trivial empty object
-    if nextchar == '}':
-        return pairs, end + 1
-    if nextchar != '"':
-        raise ValueError(errmsg("Expecting property name", s, end))
-    end += 1
-    encoding = getattr(context, 'encoding', None)
-    iterscan = JSONScanner.iterscan
-    while True:
-        key, end = scanstring(s, end, encoding)
-        end = _w(s, end).end()
-        if s[end:end + 1] != ':':
-            raise ValueError(errmsg("Expecting : delimiter", s, end))
-        end = _w(s, end + 1).end()
-        try:
-            value, end = iterscan(s, idx=end, context=context).next()
-        except StopIteration:
-            raise ValueError(errmsg("Expecting object", s, end))
-        pairs[key] = value
-        end = _w(s, end).end()
-        nextchar = s[end:end + 1]
-        end += 1
-        if nextchar == '}':
-            break
-        if nextchar != ',':
-            raise ValueError(errmsg("Expecting , delimiter", s, end - 1))
-        end = _w(s, end).end()
-        nextchar = s[end:end + 1]
-        end += 1
-        if nextchar != '"':
-            raise ValueError(errmsg("Expecting property name", s, end - 1))
-    object_hook = getattr(context, 'object_hook', None)
-    if object_hook is not None:
-        pairs = object_hook(pairs)
-    return pairs, end
-pattern(r'{')(JSONObject)
-            
-def JSONArray(match, context, _w=WHITESPACE.match):
-    values = []
-    s = match.string
-    end = _w(s, match.end()).end()
-    # look-ahead for trivial empty array
-    nextchar = s[end:end + 1]
-    if nextchar == ']':
-        return values, end + 1
-    iterscan = JSONScanner.iterscan
-    while True:
-        try:
-            value, end = iterscan(s, idx=end, context=context).next()
-        except StopIteration:
-            raise ValueError(errmsg("Expecting object", s, end))
-        values.append(value)
-        end = _w(s, end).end()
-        nextchar = s[end:end + 1]
-        end += 1
-        if nextchar == ']':
-            break
-        if nextchar != ',':
-            raise ValueError(errmsg("Expecting , delimiter", s, end))
-        end = _w(s, end).end()
-    return values, end
-pattern(r'\[')(JSONArray)
- 
-ANYTHING = [
-    JSONObject,
-    JSONArray,
-    JSONString,
-    JSONConstant,
-    JSONNumber,
-]
-
-JSONScanner = Scanner(ANYTHING)
-
-class JSONDecoder(object):
-    """
-    Simple JSON <http://json.org> decoder
-
-    Performs the following translations in decoding:
-    
-    +---------------+-------------------+
-    | JSON          | Python            |
-    +===============+===================+
-    | object        | dict              |
-    +---------------+-------------------+
-    | array         | list              |
-    +---------------+-------------------+
-    | string        | unicode           |
-    +---------------+-------------------+
-    | number (int)  | int, long         |
-    +---------------+-------------------+
-    | number (real) | float             |
-    +---------------+-------------------+
-    | true          | True              |
-    +---------------+-------------------+
-    | false         | False             |
-    +---------------+-------------------+
-    | null          | None              |
-    +---------------+-------------------+
-
-    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
-    their corresponding ``float`` values, which is outside the JSON spec.
-    """
-
-    _scanner = Scanner(ANYTHING)
-    __all__ = ['__init__', 'decode', 'raw_decode']
-
-    def __init__(self, encoding=None, object_hook=None):
-        """
-        ``encoding`` determines the encoding used to interpret any ``str``
-        objects decoded by this instance (utf-8 by default).  It has no
-        effect when decoding ``unicode`` objects.
-        
-        Note that currently only encodings that are a superset of ASCII work,
-        strings of other encodings should be passed in as ``unicode``.
-
-        ``object_hook``, if specified, will be called with the result
-        of every JSON object decoded and its return value will be used in
-        place of the given ``dict``.  This can be used to provide custom
-        deserializations (e.g. to support JSON-RPC class hinting).
-        """
-        self.encoding = encoding
-        self.object_hook = object_hook
-
-    def decode(self, s, _w=WHITESPACE.match):
-        """
-        Return the Python representation of ``s`` (a ``str`` or ``unicode``
-        instance containing a JSON document)
-        """
-        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
-        end = _w(s, end).end()
-        if end != len(s):
-            raise ValueError(errmsg("Extra data", s, end, len(s)))
-        return obj
-
-    def raw_decode(self, s, **kw):
-        """
-        Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning
-        with a JSON document) and return a 2-tuple of the Python
-        representation and the index in ``s`` where the document ended.
-
-        This can be used to decode a JSON document from a string that may
-        have extraneous data at the end.
-        """
-        kw.setdefault('context', self)
-        try:
-            obj, end = self._scanner.iterscan(s, **kw).next()
-        except StopIteration:
-            raise ValueError("No JSON object could be decoded")
-        return obj, end
-
-__all__ = ['JSONDecoder']
diff --git a/WebKitTools/wx/browser/browser.cpp b/WebKitTools/wx/browser/browser.cpp
index df701bb..95c39d4 100644
--- a/WebKitTools/wx/browser/browser.cpp
+++ b/WebKitTools/wx/browser/browser.cpp
@@ -61,7 +61,7 @@
 #if __WXMSW__ || __WXMAC__
     settings.SetPluginsEnabled(true);
 #endif
-    settings.SetDatabasesEnabled(true);
+    frame->webview->SetDatabasesEnabled(true);
     settings.SetEditableLinkBehavior(wxEditableLinkOnlyLiveWithShiftKey);
     frame->CentreOnScreen();
     frame->Show(true);
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index d3b7b2c..baf9657 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -60,7 +60,7 @@
 common_frameworks = []
 
 ports = [
-    'CF',
+    'Brew',
     'Chromium',
     'Gtk', 
     'Haiku',
@@ -90,6 +90,7 @@
     'profiler',
     'runtime',
     'wtf',
+    'wtf/text',
     'wtf/unicode',
     'wtf/unicode/icu',
     'yarr',
@@ -120,7 +121,8 @@
     'page/animation', 
     'platform', 
     'platform/animation', 
-    'platform/graphics', 
+    'platform/graphics',
+    'platform/graphics/filters',
     'platform/graphics/transforms',
     'platform/image-decoders',
     'platform/image-decoders/bmp', 
@@ -135,7 +137,11 @@
     'plugins', 
     'rendering', 
     'rendering/style', 
-    'storage', 
+    'storage',
+    'svg',
+    'svg/animation',
+    'svg/graphics',
+    'svg/graphics/filters',
     'websockets', 
     'xml'
 ]
@@ -168,7 +174,7 @@
     create_hash_table = get_output('cygpath --unix "%s"' % create_hash_table)
 os.environ['CREATE_HASH_TABLE'] = create_hash_table
 
-feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER']
+feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE']
 
 msvc_version = 'msvc2008'
 
diff --git a/autotools/webkit.m4 b/autotools/webkit.m4
index 670cec3..379fa8f 100644
--- a/autotools/webkit.m4
+++ b/autotools/webkit.m4
@@ -50,6 +50,11 @@
    AC_MSG_ERROR([You need 'perl' to compile WebKit])
 fi
 
+AC_PATH_PROG(PYTHON, python)
+if test -z "$PYTHON"; then
+   AC_MSG_ERROR([You need 'python' to compile WebKit])
+fi
+
 AC_PATH_PROG(BISON, bison)
 if test -z "$BISON"; then
    AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])